From: Andrea Bianco Date: Fri, 9 Oct 2020 09:34:48 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.4 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.mail?a=commitdiff_plain;h=ab35486c7acdd384ddf69f03917ff89e392d6125;p=motion2.git Built motion from commit (unavailable).|2.5.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 25eca72..86aa883 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-10-09T08:53:55.786Z", + "time": "2020-10-09T09:23:21.931Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4c4ad69..c392af5 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-10-09T08:53:55.786Z", + "time": "2020-10-09T09:23:21.931Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index fdc1e6d..a09e18a 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 _0x8c6c=['getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL'];(function(_0x2636fd,_0x7fd208){var _0x555539=function(_0x491dad){while(--_0x491dad){_0x2636fd['push'](_0x2636fd['shift']());}};_0x555539(++_0x7fd208);}(_0x8c6c,0xde));var _0xc8c6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8c6c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc8c6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8c6('0x1')],'get':function(_0x28db7c){return this[_0xc8c6('0x2')](_0xc8c6('0x3'));}},'action':{'type':Sequelize[_0xc8c6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xc8c6('0x5'),_0xc8c6('0x6'),_0xc8c6('0x7'),_0xc8c6('0x8'),_0xc8c6('0x9'),_0xc8c6('0xa'),_0xc8c6('0xb')]],'msg':_0xc8c6('0xc')}},'comment':_0xc8c6('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xc8c6('0x4')](0x1000),'comment':_0xc8c6('0xd')},'data3':{'type':Sequelize[_0xc8c6('0x4')](0x1000),'comment':_0xc8c6('0xe')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xc8c6('0x4')](0x1000)},'data6':{'type':Sequelize[_0xc8c6('0x4')]},'data7':{'type':Sequelize[_0xc8c6('0xf')]}}; \ No newline at end of file +var _0x119b=['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','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','bot'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0x119b,0x11d));var _0xb119=function(_0x146837,_0x2aa6a2){_0x146837=_0x146837-0x0;var _0x3d7e60=_0x119b[_0x146837];return _0x3d7e60;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb119('0x0')],'get':function(_0x2b31d8){return this[_0xb119('0x1')](_0xb119('0x2'));}},'action':{'type':Sequelize[_0xb119('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb119('0x4'),_0xb119('0x5'),_0xb119('0x6'),'jscripty',_0xb119('0x7'),'browser',_0xb119('0x8'),'script']],'msg':_0xb119('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xb119('0x3')](0x1000),'comment':_0xb119('0xa')},'data2':{'type':Sequelize[_0xb119('0x3')](0x1000),'comment':_0xb119('0xb')},'data3':{'type':Sequelize[_0xb119('0x3')](0x1000),'comment':_0xb119('0xc')},'data4':{'type':Sequelize[_0xb119('0x3')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xb119('0x3')]},'data7':{'type':Sequelize[_0xb119('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 4bf4a9c..a1f657a 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 _0xb171=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','send','body','Action','find','params','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','squel','crypto','jsforce'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb171,0x122));var _0x1b17=function(_0x1229f1,_0x229bd6){_0x1229f1=_0x1229f1-0x0;var _0x481b53=_0xb171[_0x1229f1];return _0x481b53;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b17('0x1'));var jsonpatch=require(_0x1b17('0x2'));var rp=require(_0x1b17('0x3'));var moment=require(_0x1b17('0x4'));var BPromise=require(_0x1b17('0x5'));var Mustache=require('mustache');var util=require(_0x1b17('0x6'));var path=require('path');var sox=require(_0x1b17('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1b17('0x8'));var crypto=require(_0x1b17('0x9'));var jsforce=require(_0x1b17('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1b17('0xb'));var Papa=require(_0x1b17('0xc'));var Redis=require('ioredis');var authService=require(_0x1b17('0xd'));var qs=require(_0x1b17('0xe'));var as=require(_0x1b17('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b17('0x10'))('api');var utils=require(_0x1b17('0x11'));var config=require(_0x1b17('0x12'));var db=require(_0x1b17('0x13'))['db'];function respondWithStatusCode(_0x169ab1,_0x27aaa3){_0x27aaa3=_0x27aaa3||0xcc;return function(_0x140881){if(_0x140881){return _0x169ab1[_0x1b17('0x14')](_0x27aaa3);}return _0x169ab1['status'](_0x27aaa3)[_0x1b17('0x15')]();};}function respondWithResult(_0x5d16fe,_0x37493b){_0x37493b=_0x37493b||0xc8;return function(_0x5a83d1){if(_0x5a83d1){return _0x5d16fe[_0x1b17('0x16')](_0x37493b)[_0x1b17('0x17')](_0x5a83d1);}};}function respondWithFilteredResult(_0x220d51,_0x11e70b){return function(_0x35c486){if(_0x35c486){var _0x26572b=_0x35c486[_0x1b17('0x18')],_0x2928c6=_0x11e70b[_0x1b17('0x19')],_0x117550=_0x11e70b[_0x1b17('0x19')]+_0x11e70b[_0x1b17('0x1a')],_0x256610;if(_0x117550>=_0x26572b){_0x117550=_0x26572b;_0x256610=0xc8;}else{_0x256610=0xce;}_0x220d51[_0x1b17('0x16')](_0x256610);return _0x220d51[_0x1b17('0x1b')](_0x1b17('0x1c'),_0x2928c6+'-'+_0x117550+'/'+_0x26572b)[_0x1b17('0x17')](_0x35c486);}return null;};}function patchUpdates(_0x11629f){return function(_0x3441e3){try{jsonpatch[_0x1b17('0x1d')](_0x3441e3,_0x11629f,!![]);}catch(_0x205839){return BPromise['reject'](_0x205839);}return _0x3441e3[_0x1b17('0x1e')]();};}function saveUpdates(_0x235943,_0x5494bb){return function(_0x10a646){if(_0x10a646){return _0x10a646[_0x1b17('0x1f')](_0x235943)[_0x1b17('0x20')](function(_0x596c2f){return _0x596c2f;});}return null;};}function removeEntity(_0x3abeb0,_0x56f3ce){return function(_0x10486b){if(_0x10486b){return _0x10486b['destroy']()[_0x1b17('0x20')](function(){_0x3abeb0[_0x1b17('0x16')](0xcc)[_0x1b17('0x15')]();});}};}function handleEntityNotFound(_0x5321e8,_0x342623){return function(_0x194c1c){if(!_0x194c1c){_0x5321e8[_0x1b17('0x14')](0x194);}return _0x194c1c;};}function handleError(_0x227a45,_0x3d7339){_0x3d7339=_0x3d7339||0x1f4;return function(_0x3b5afd){logger[_0x1b17('0x21')](_0x3b5afd[_0x1b17('0x22')]);if(_0x3b5afd[_0x1b17('0x23')]){delete _0x3b5afd[_0x1b17('0x23')];}_0x227a45['status'](_0x3d7339)[_0x1b17('0x24')](_0x3b5afd);};}exports[_0x1b17('0x1f')]=function(_0x30cf28,_0x5d95c9){if(_0x30cf28[_0x1b17('0x25')]['id']){delete _0x30cf28[_0x1b17('0x25')]['id'];}return db[_0x1b17('0x26')][_0x1b17('0x27')]({'where':{'id':_0x30cf28[_0x1b17('0x28')]['id']}})[_0x1b17('0x20')](handleEntityNotFound(_0x5d95c9,null))['then'](saveUpdates(_0x30cf28[_0x1b17('0x25')],null))[_0x1b17('0x20')](respondWithResult(_0x5d95c9,null))[_0x1b17('0x29')](handleError(_0x5d95c9,null));};exports[_0x1b17('0x2a')]=function(_0x539370,_0x41c48b){return db[_0x1b17('0x26')]['find']({'where':{'id':_0x539370[_0x1b17('0x28')]['id']}})['then'](handleEntityNotFound(_0x41c48b,null))[_0x1b17('0x20')](removeEntity(_0x41c48b,null))[_0x1b17('0x29')](handleError(_0x41c48b,null));}; \ No newline at end of file +var _0x474e=['limit','set','Content-Range','reject','save','then','end','stack','name','send','body','Action','find','catch','destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x474e,0xf1));var _0xe474=function(_0x2b1e2d,_0x26511c){_0x2b1e2d=_0x2b1e2d-0x0;var _0x460559=_0x474e[_0x2b1e2d];return _0x460559;};'use strict';var pdf=require(_0xe474('0x0'));var emlformat=require(_0xe474('0x1'));var rimraf=require(_0xe474('0x2'));var zipdir=require(_0xe474('0x3'));var jsonpatch=require(_0xe474('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe474('0x5'));var util=require(_0xe474('0x6'));var path=require(_0xe474('0x7'));var sox=require(_0xe474('0x8'));var csv=require(_0xe474('0x9'));var ejs=require(_0xe474('0xa'));var fs=require('fs');var _=require(_0xe474('0xb'));var squel=require(_0xe474('0xc'));var crypto=require('crypto');var jsforce=require(_0xe474('0xd'));var deskjs=require(_0xe474('0xe'));var toCsv=require(_0xe474('0x9'));var querystring=require(_0xe474('0xf'));var Papa=require(_0xe474('0x10'));var Redis=require(_0xe474('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe474('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe474('0x13'));var logger=require(_0xe474('0x14'))('api');var utils=require(_0xe474('0x15'));var config=require(_0xe474('0x16'));var db=require(_0xe474('0x17'))['db'];function respondWithStatusCode(_0x3fbbd5,_0x263aee){_0x263aee=_0x263aee||0xcc;return function(_0x3698dc){if(_0x3698dc){return _0x3fbbd5[_0xe474('0x18')](_0x263aee);}return _0x3fbbd5[_0xe474('0x19')](_0x263aee)['end']();};}function respondWithResult(_0x174f48,_0x25e56b){_0x25e56b=_0x25e56b||0xc8;return function(_0x362820){if(_0x362820){return _0x174f48[_0xe474('0x19')](_0x25e56b)[_0xe474('0x1a')](_0x362820);}};}function respondWithFilteredResult(_0x208d91,_0x22a7df){return function(_0x5ae611){if(_0x5ae611){var _0x18075e=_0x5ae611[_0xe474('0x1b')],_0x530d26=_0x22a7df[_0xe474('0x1c')],_0x60addf=_0x22a7df['offset']+_0x22a7df[_0xe474('0x1d')],_0xbe95c7;if(_0x60addf>=_0x18075e){_0x60addf=_0x18075e;_0xbe95c7=0xc8;}else{_0xbe95c7=0xce;}_0x208d91[_0xe474('0x19')](_0xbe95c7);return _0x208d91[_0xe474('0x1e')](_0xe474('0x1f'),_0x530d26+'-'+_0x60addf+'/'+_0x18075e)[_0xe474('0x1a')](_0x5ae611);}return null;};}function patchUpdates(_0x1623d2){return function(_0x2dd9d0){try{jsonpatch['apply'](_0x2dd9d0,_0x1623d2,!![]);}catch(_0x50513b){return BPromise[_0xe474('0x20')](_0x50513b);}return _0x2dd9d0[_0xe474('0x21')]();};}function saveUpdates(_0x219e51,_0x29c95e){return function(_0x6b2602){if(_0x6b2602){return _0x6b2602['update'](_0x219e51)[_0xe474('0x22')](function(_0x4e74bc){return _0x4e74bc;});}return null;};}function removeEntity(_0xfdb321,_0x3e23c8){return function(_0x47a831){if(_0x47a831){return _0x47a831['destroy']()[_0xe474('0x22')](function(){_0xfdb321[_0xe474('0x19')](0xcc)[_0xe474('0x23')]();});}};}function handleEntityNotFound(_0x2908f6,_0xfc7cf8){return function(_0x27db5c){if(!_0x27db5c){_0x2908f6[_0xe474('0x18')](0x194);}return _0x27db5c;};}function handleError(_0xb8aaf3,_0x37c5d8){_0x37c5d8=_0x37c5d8||0x1f4;return function(_0xbd3532){logger['error'](_0xbd3532[_0xe474('0x24')]);if(_0xbd3532[_0xe474('0x25')]){delete _0xbd3532[_0xe474('0x25')];}_0xb8aaf3['status'](_0x37c5d8)[_0xe474('0x26')](_0xbd3532);};}exports['update']=function(_0x3000be,_0x3adfb3){if(_0x3000be['body']['id']){delete _0x3000be[_0xe474('0x27')]['id'];}return db[_0xe474('0x28')][_0xe474('0x29')]({'where':{'id':_0x3000be['params']['id']}})[_0xe474('0x22')](handleEntityNotFound(_0x3adfb3,null))[_0xe474('0x22')](saveUpdates(_0x3000be[_0xe474('0x27')],null))[_0xe474('0x22')](respondWithResult(_0x3adfb3,null))[_0xe474('0x2a')](handleError(_0x3adfb3,null));};exports[_0xe474('0x2b')]=function(_0x3d7729,_0x2796fe){return db[_0xe474('0x28')]['find']({'where':{'id':_0x3d7729[_0xe474('0x2c')]['id']}})[_0xe474('0x22')](handleEntityNotFound(_0x2796fe,null))[_0xe474('0x22')](removeEntity(_0x2796fe,null))['catch'](handleError(_0x2796fe,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index cf531bf..df5c2cb 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 _0xed9d=['rimraf','./action.attributes','exports','define','Action','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xed9d,0x155));var _0xded9=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xed9d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xded9('0x0'));var util=require(_0xded9('0x1'));var logger=require(_0xded9('0x2'))(_0xded9('0x3'));var moment=require(_0xded9('0x4'));var BPromise=require(_0xded9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xded9('0x6'));var rimraf=require(_0xded9('0x7'));var config=require('../../config/environment');var attributes=require(_0xded9('0x8'));module[_0xded9('0x9')]=function(_0x55066a,_0x1f8843){return _0x55066a[_0xded9('0xa')](_0xded9('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5ab=['path','rimraf','../../config/environment','./action.attributes','define','lodash','util','api','moment','bluebird'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xf5ab,0x7d));var _0xbf5a=function(_0xd0c6f1,_0x5c6a47){_0xd0c6f1=_0xd0c6f1-0x0;var _0x20389b=_0xf5ab[_0xd0c6f1];return _0x20389b;};'use strict';var _=require(_0xbf5a('0x0'));var util=require(_0xbf5a('0x1'));var logger=require('../../config/logger')(_0xbf5a('0x2'));var moment=require(_0xbf5a('0x3'));var BPromise=require(_0xbf5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf5a('0x5'));var rimraf=require(_0xbf5a('0x6'));var config=require(_0xbf5a('0x7'));var attributes=require(_0xbf5a('0x8'));module['exports']=function(_0xe36c69,_0x4db9c9){return _0xe36c69[_0xbf5a('0x9')]('Action',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 dae7794..7e7ba0b 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x14914a,_0x3eae81){var _0x3766ec=function(_0x2d6c73){while(--_0x2d6c73){_0x14914a['push'](_0x14914a['shift']());}};_0x3766ec(++_0x3eae81);}(_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);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x479ae9,_0x5d1056){var _0x31b9c8=function(_0x24555d){while(--_0x24555d){_0x479ae9['push'](_0x479ae9['shift']());}};_0x31b9c8(++_0x5d1056);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xcb91[_0x10291b];return _0x1d5fbe;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 9ab3348..3b9577d 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 _0xaf7b=['./action.controller','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5e9c85,_0x461674){var _0xcbdcf7=function(_0x2680d9){while(--_0x2680d9){_0x5e9c85['push'](_0x5e9c85['shift']());}};_0xcbdcf7(++_0x461674);}(_0xaf7b,0x1f1));var _0xbaf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf7b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbaf7('0x0'));var util=require(_0xbaf7('0x1'));var path=require('path');var timeout=require(_0xbaf7('0x2'));var express=require(_0xbaf7('0x3'));var router=express[_0xbaf7('0x4')]();var auth=require(_0xbaf7('0x5'));var interaction=require(_0xbaf7('0x6'));var config=require('../../config/environment');var controller=require(_0xbaf7('0x7'));router[_0xbaf7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbaf7('0x9')]);router[_0xbaf7('0xa')](_0xbaf7('0xb'),auth['isAuthenticated'](),controller[_0xbaf7('0xc')]);module[_0xbaf7('0xd')]=router; \ No newline at end of file +var _0x9d73=['../../components/auth/service','../../config/environment','./action.controller','put','isAuthenticated','update','/:id','destroy','exports','util','express','Router'];(function(_0x29c2fb,_0x498f25){var _0x2515b5=function(_0x4365fc){while(--_0x4365fc){_0x29c2fb['push'](_0x29c2fb['shift']());}};_0x2515b5(++_0x498f25);}(_0x9d73,0x1ad));var _0x39d7=function(_0x538c52,_0x24cbca){_0x538c52=_0x538c52-0x0;var _0x298c33=_0x9d73[_0x538c52];return _0x298c33;};'use strict';var multer=require('multer');var util=require(_0x39d7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39d7('0x1'));var router=express[_0x39d7('0x2')]();var auth=require(_0x39d7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x39d7('0x4'));var controller=require(_0x39d7('0x5'));router[_0x39d7('0x6')]('/:id',auth[_0x39d7('0x7')](),controller[_0x39d7('0x8')]);router['delete'](_0x39d7('0x9'),auth[_0x39d7('0x7')](),controller[_0x39d7('0xa')]);module[_0x39d7('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 ef4a69f..6eb5d58 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 _0x2bb9=['STRING','TEXT','exports'];(function(_0x56b820,_0x35e4fe){var _0xc74e1a=function(_0x1b9023){while(--_0x1b9023){_0x56b820['push'](_0x56b820['shift']());}};_0xc74e1a(++_0x35e4fe);}(_0x2bb9,0x16a));var _0x92bb=function(_0x592416,_0x2c75e9){_0x592416=_0x592416-0x0;var _0x3005fa=_0x2bb9[_0x592416];return _0x3005fa;};'use strict';var Sequelize=require('sequelize');module[_0x92bb('0x0')]={'name':{'type':Sequelize[_0x92bb('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x92bb('0x1')]},'table':{'type':Sequelize[_0x92bb('0x1')]},'conditions':{'type':Sequelize[_0x92bb('0x2')]},'joins':{'type':Sequelize[_0x92bb('0x2')]}}; \ No newline at end of file +var _0x4371=['exports','STRING','sequelize'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4371,0xd4));var _0x1437=function(_0x2a0e59,_0x586fcb){_0x2a0e59=_0x2a0e59-0x0;var _0x562b26=_0x4371[_0x2a0e59];return _0x562b26;};'use strict';var Sequelize=require(_0x1437('0x0'));module[_0x1437('0x1')]={'name':{'type':Sequelize[_0x1437('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1437('0x2')]},'parent':{'type':Sequelize[_0x1437('0x2')]},'table':{'type':Sequelize[_0x1437('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index ebd1180..d1216ac 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 _0x8e0d=['sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','length','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','DESC','%s.%s\x20=\x20%s.%s','Limited\x20Query:','No\x20available\x20data','output','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','dbH','end','status','json','count','offset','limit','set','Content-Range','then','destroy','get'];(function(_0x6ea106,_0x181b3d){var _0x49ecfe=function(_0x750f7b){while(--_0x750f7b){_0x6ea106['push'](_0x6ea106['shift']());}};_0x49ecfe(++_0x181b3d);}(_0x8e0d,0x82));var _0xd8e0=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x8e0d[_0x35fabd];return _0x61a8ee;};'use strict';var pdf=require(_0xd8e0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8e0('0x1'));var jsonpatch=require(_0xd8e0('0x2'));var rp=require('request-promise');var moment=require(_0xd8e0('0x3'));var BPromise=require(_0xd8e0('0x4'));var Mustache=require(_0xd8e0('0x5'));var util=require(_0xd8e0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd8e0('0x7'));var ejs=require(_0xd8e0('0x8'));var fs=require('fs');var _=require(_0xd8e0('0x9'));var squel=require(_0xd8e0('0xa'));var crypto=require('crypto');var jsforce=require(_0xd8e0('0xb'));var deskjs=require(_0xd8e0('0xc'));var toCsv=require(_0xd8e0('0x7'));var querystring=require(_0xd8e0('0xd'));var Papa=require(_0xd8e0('0xe'));var Redis=require('ioredis');var authService=require(_0xd8e0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd8e0('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8e0('0x11'));var utils=require(_0xd8e0('0x12'));var config=require(_0xd8e0('0x13'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xd8e0('0x14')];function respondWithStatusCode(_0x4d968a,_0x11cf8d){_0x11cf8d=_0x11cf8d||0xcc;return function(_0x582b8f){if(_0x582b8f){return _0x4d968a['sendStatus'](_0x11cf8d);}return _0x4d968a['status'](_0x11cf8d)[_0xd8e0('0x15')]();};}function respondWithResult(_0x5c983a,_0x34f992){_0x34f992=_0x34f992||0xc8;return function(_0x29f681){if(_0x29f681){return _0x5c983a[_0xd8e0('0x16')](_0x34f992)[_0xd8e0('0x17')](_0x29f681);}};}function respondWithFilteredResult(_0x2689d3,_0x28f3e0){return function(_0xe5d019){if(_0xe5d019){var _0x345e21=_0xe5d019[_0xd8e0('0x18')],_0x1ce603=_0x28f3e0[_0xd8e0('0x19')],_0x488ed9=_0x28f3e0[_0xd8e0('0x19')]+_0x28f3e0[_0xd8e0('0x1a')],_0x107c63;if(_0x488ed9>=_0x345e21){_0x488ed9=_0x345e21;_0x107c63=0xc8;}else{_0x107c63=0xce;}_0x2689d3[_0xd8e0('0x16')](_0x107c63);return _0x2689d3[_0xd8e0('0x1b')](_0xd8e0('0x1c'),_0x1ce603+'-'+_0x488ed9+'/'+_0x345e21)['json'](_0xe5d019);}return null;};}function patchUpdates(_0x371136){return function(_0x4e41d4){try{jsonpatch['apply'](_0x4e41d4,_0x371136,!![]);}catch(_0x8755ce){return BPromise['reject'](_0x8755ce);}return _0x4e41d4['save']();};}function saveUpdates(_0x50c2a2,_0x19894c){return function(_0x29c413){if(_0x29c413){return _0x29c413['update'](_0x50c2a2)[_0xd8e0('0x1d')](function(_0x4209fb){return _0x4209fb;});}return null;};}function removeEntity(_0x1d31de,_0x40f098){return function(_0x471a5c){if(_0x471a5c){return _0x471a5c[_0xd8e0('0x1e')]()['then'](function(){var _0x1757f3=_0x471a5c[_0xd8e0('0x1f')]({'plain':!![]});var _0x54c515='CustomReports';return db['UserProfileResource'][_0xd8e0('0x1e')]({'where':{'type':_0x54c515,'resourceId':_0x1757f3['id']}})[_0xd8e0('0x1d')](function(){return _0x471a5c;});})[_0xd8e0('0x1d')](function(){_0x1d31de[_0xd8e0('0x16')](0xcc)[_0xd8e0('0x15')]();});}};}function handleEntityNotFound(_0x5b0525,_0x5a156c){return function(_0x1a29c7){if(!_0x1a29c7){_0x5b0525[_0xd8e0('0x20')](0x194);}return _0x1a29c7;};}function handleError(_0x15f15b,_0x169373){_0x169373=_0x169373||0x1f4;return function(_0x51c7b6){logger[_0xd8e0('0x21')](_0x51c7b6[_0xd8e0('0x22')]);if(_0x51c7b6[_0xd8e0('0x23')]){delete _0x51c7b6[_0xd8e0('0x23')];}_0x15f15b['status'](_0x169373)[_0xd8e0('0x24')](_0x51c7b6);};}exports[_0xd8e0('0x25')]=function(_0x1a9364,_0x2ab62b){var _0x276665={},_0x345bf3={},_0x16c203={'count':0x0,'rows':[]};var _0x559d97=_[_0xd8e0('0x26')](db[_0xd8e0('0x27')][_0xd8e0('0x28')],function(_0x53e220){return{'name':_0x53e220[_0xd8e0('0x29')],'type':_0x53e220[_0xd8e0('0x2a')][_0xd8e0('0x2b')]};});_0x345bf3[_0xd8e0('0x2c')]=_[_0xd8e0('0x26')](_0x559d97,_0xd8e0('0x23'));_0x345bf3[_0xd8e0('0x2d')]=_['keys'](_0x1a9364[_0xd8e0('0x2d')]);_0x345bf3[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0x345bf3[_0xd8e0('0x2c')],_0x345bf3[_0xd8e0('0x2d')]);_0x276665[_0xd8e0('0x30')]=_['intersection'](_0x345bf3[_0xd8e0('0x2c')],qs[_0xd8e0('0x31')](_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x31')]));_0x276665[_0xd8e0('0x30')]=_0x276665[_0xd8e0('0x30')]['length']?_0x276665[_0xd8e0('0x30')]:_0x345bf3[_0xd8e0('0x2c')];if(!_0x1a9364[_0xd8e0('0x2d')]['hasOwnProperty'](_0xd8e0('0x32'))){_0x276665['limit']=qs[_0xd8e0('0x1a')](_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x1a')]);_0x276665[_0xd8e0('0x19')]=qs[_0xd8e0('0x19')](_0x1a9364[_0xd8e0('0x2d')]['offset']);}_0x276665[_0xd8e0('0x33')]=qs[_0xd8e0('0x34')](_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x34')]);_0x276665[_0xd8e0('0x35')]=qs['filters'](_[_0xd8e0('0x36')](_0x1a9364[_0xd8e0('0x2d')],_0x345bf3[_0xd8e0('0x2e')]),_0x559d97);if(_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x37')]){_0x276665[_0xd8e0('0x35')]=_[_0xd8e0('0x38')](_0x276665[_0xd8e0('0x35')],{'$or':_[_0xd8e0('0x26')](_0x559d97,function(_0x4b3d02){if(_0x4b3d02[_0xd8e0('0x2a')]!==_0xd8e0('0x39')){var _0x19b066={};_0x19b066[_0x4b3d02[_0xd8e0('0x23')]]={'$like':'%'+_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x37')]+'%'};return _0x19b066;}})});}_0x276665=_[_0xd8e0('0x38')]({},_0x276665,_0x1a9364['options']);var _0x24a506={'where':_0x276665[_0xd8e0('0x35')]};return db[_0xd8e0('0x27')][_0xd8e0('0x18')](_0x24a506)[_0xd8e0('0x1d')](function(_0x1d5130){_0x16c203['count']=_0x1d5130;if(_0x1a9364[_0xd8e0('0x2d')][_0xd8e0('0x3a')]){_0x276665['include']=[{'all':!![]}];}return db[_0xd8e0('0x27')][_0xd8e0('0x3b')](_0x276665);})[_0xd8e0('0x1d')](function(_0x45fd12){_0x16c203[_0xd8e0('0x3c')]=_0x45fd12;return _0x16c203;})[_0xd8e0('0x1d')](respondWithFilteredResult(_0x2ab62b,_0x276665))[_0xd8e0('0x3d')](handleError(_0x2ab62b,null));};exports[_0xd8e0('0x3e')]=function(_0xf808a,_0xc48f59){var _0x8bfe97={'raw':![],'where':{'id':_0xf808a[_0xd8e0('0x3f')]['id']}},_0xcada28={};_0xcada28['model']=_['keys'](db[_0xd8e0('0x27')]['rawAttributes']);_0xcada28[_0xd8e0('0x2d')]=_[_0xd8e0('0x40')](_0xf808a['query']);_0xcada28[_0xd8e0('0x2e')]=_[_0xd8e0('0x2f')](_0xcada28[_0xd8e0('0x2c')],_0xcada28[_0xd8e0('0x2d')]);_0x8bfe97[_0xd8e0('0x30')]=_['intersection'](_0xcada28[_0xd8e0('0x2c')],qs[_0xd8e0('0x31')](_0xf808a[_0xd8e0('0x2d')]['fields']));_0x8bfe97['attributes']=_0x8bfe97['attributes'][_0xd8e0('0x41')]?_0x8bfe97[_0xd8e0('0x30')]:_0xcada28[_0xd8e0('0x2c')];if(_0xf808a[_0xd8e0('0x2d')][_0xd8e0('0x3a')]){_0x8bfe97[_0xd8e0('0x42')]=[{'all':!![]}];}_0x8bfe97=_['merge']({},_0x8bfe97,_0xf808a[_0xd8e0('0x43')]);return db[_0xd8e0('0x27')][_0xd8e0('0x44')](_0x8bfe97)[_0xd8e0('0x1d')](handleEntityNotFound(_0xc48f59,null))[_0xd8e0('0x1d')](respondWithResult(_0xc48f59,null))[_0xd8e0('0x3d')](handleError(_0xc48f59,null));};exports[_0xd8e0('0x45')]=function(_0x45be94,_0x4e3667){return db[_0xd8e0('0x27')][_0xd8e0('0x45')](_0x45be94['body'],{})['then'](function(_0x3cec45){var _0x33ce72=_0x45be94[_0xd8e0('0x46')][_0xd8e0('0x1f')]({'plain':!![]});if(!_0x33ce72)throw new Error(_0xd8e0('0x47'));if(_0x33ce72[_0xd8e0('0x48')]===_0xd8e0('0x46')){var _0x3c647d=_0x3cec45[_0xd8e0('0x1f')]({'plain':!![]});var _0x593c8f=_0xd8e0('0x49');return db[_0xd8e0('0x4a')][_0xd8e0('0x44')]({'where':{'name':_0x593c8f,'userProfileId':_0x33ce72['userProfileId']},'raw':!![]})[_0xd8e0('0x1d')](function(_0x3fed9d){if(_0x3fed9d&&_0x3fed9d[_0xd8e0('0x4b')]===0x0){return db[_0xd8e0('0x4c')]['create']({'name':_0x3c647d[_0xd8e0('0x23')],'resourceId':_0x3c647d['id'],'type':_0xd8e0('0x4d'),'sectionId':_0x3fed9d['id']},{})[_0xd8e0('0x1d')](function(){return _0x3cec45;});}else{return _0x3cec45;}})[_0xd8e0('0x3d')](function(_0x393634){logger[_0xd8e0('0x21')](_0xd8e0('0x4e'),_0x393634);throw _0x393634;});}return _0x3cec45;})[_0xd8e0('0x1d')](respondWithResult(_0x4e3667,0xc9))[_0xd8e0('0x3d')](handleError(_0x4e3667,null));};exports['update']=function(_0x36b381,_0x56bd41){if(_0x36b381[_0xd8e0('0x4f')]['id']){delete _0x36b381['body']['id'];}return db['AnalyticCustomReport'][_0xd8e0('0x44')]({'where':{'id':_0x36b381[_0xd8e0('0x3f')]['id']}})[_0xd8e0('0x1d')](handleEntityNotFound(_0x56bd41,null))[_0xd8e0('0x1d')](saveUpdates(_0x36b381[_0xd8e0('0x4f')],null))[_0xd8e0('0x1d')](respondWithResult(_0x56bd41,null))[_0xd8e0('0x3d')](handleError(_0x56bd41,null));};exports['destroy']=function(_0x1b6440,_0x295569){return db[_0xd8e0('0x27')][_0xd8e0('0x44')]({'where':{'id':_0x1b6440['params']['id']}})[_0xd8e0('0x1d')](handleEntityNotFound(_0x295569,null))[_0xd8e0('0x1d')](removeEntity(_0x295569,null))[_0xd8e0('0x3d')](handleError(_0x295569,null));};exports[_0xd8e0('0x50')]=function(_0x17b64f,_0x3e4793){var _0x2847c0=0xa;var _0x562cb9=[_0xd8e0('0x51'),_0xd8e0('0x52'),_0xd8e0('0x53'),_0xd8e0('0x54')];var _0x26c3de={'SUM':_0xd8e0('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd8e0('0x56'),'MAX':_0xd8e0('0x57'),'MIN':_0xd8e0('0x58'),'AVG':_0xd8e0('0x59'),'GROUP_CONCAT':_0xd8e0('0x5a'),'GROUP_CONCAT ASC':_0xd8e0('0x5b'),'GROUP_CONCAT DESC':_0xd8e0('0x5c')};var _0x52a5bd={'SEC_TO_TIME':_0xd8e0('0x5d'),'DATE':_0xd8e0('0x5e'),'HOUR':_0xd8e0('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd8e0('0x60')};var _0x221f91=function(_0x104e56){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd8e0('0x61')],_0x104e56);};var _0x223b5e=function(_0x86c247){if(!_0x86c247||!_0x86c247[_0xd8e0('0x62')][_0xd8e0('0x41')]){return'';}for(var _0x2c4b45='(',_0x476656=0x0;_0x476656<_0x86c247['rules'][_0xd8e0('0x41')];_0x476656+=0x1){_0x476656>0x0&&(_0x2c4b45+='\x20'+_0x86c247[_0xd8e0('0x63')]+'\x20');_0x2c4b45+=_0x86c247[_0xd8e0('0x62')][_0x476656][_0xd8e0('0x64')]?_0x223b5e(_0x86c247['rules'][_0x476656][_0xd8e0('0x64')]):_0x86c247[_0xd8e0('0x62')][_0x476656][_0xd8e0('0x65')]+'\x20'+_0x86c247['rules'][_0x476656][_0xd8e0('0x66')]+(_0x221f91(_0x86c247['rules'][_0x476656]['condition'])?'\x20'+_0x86c247[_0xd8e0('0x62')][_0x476656][_0xd8e0('0x67')]:'');}return _0x2c4b45+')';};var _0x1a4bba={'where':{'id':_0x17b64f['params']['id']}},_0x54330f,_0x2dc97f,_0x1bed54,_0x40b9c5,_0x1182b;_0x1a4bba=_[_0xd8e0('0x38')]({},_0x1a4bba,_0x17b64f[_0xd8e0('0x43')]);return db['AnalyticCustomReport'][_0xd8e0('0x44')](_0x1a4bba)[_0xd8e0('0x1d')](function(_0x5cedde){if(_0x5cedde){_0x54330f=_0x5cedde;return _0x5cedde[_0xd8e0('0x68')]();}return null;})[_0xd8e0('0x1d')](function(_0x2001c2){if(_0x2001c2){if(!_0x2001c2['length']){throw new db[(_0xd8e0('0x69'))][(_0xd8e0('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2dc97f=_0x2001c2;return db[_0xd8e0('0x6b')][_0xd8e0('0x3b')]({'raw':!![]});}return null;})[_0xd8e0('0x1d')](function(_0x250f02){if(_0x250f02){_0x1bed54=_[_0xd8e0('0x6c')](_0x250f02,'id');var _0xfd9f7e;var _0xe68ba2=squel[_0xd8e0('0x6d')]();_0xe68ba2[_0xd8e0('0x6e')](_0x54330f[_0xd8e0('0x6f')]);for(var _0x1c8ee9=0x0;_0x1c8ee9<_0x2dc97f[_0xd8e0('0x41')];_0x1c8ee9+=0x1){_0xfd9f7e=_0x2dc97f[_0x1c8ee9][_0xd8e0('0x70')]?_0x1bed54[_0x2dc97f[_0x1c8ee9][_0xd8e0('0x70')]][_0xd8e0('0x71')]:_0x2dc97f[_0x1c8ee9][_0xd8e0('0x65')];_0xfd9f7e=_0x2dc97f[_0x1c8ee9][_0xd8e0('0x72')]?_[_0xd8e0('0x73')](_0x26c3de[_0x2dc97f[_0x1c8ee9][_0xd8e0('0x72')]],'%s',_0xfd9f7e):_0xfd9f7e;_0xfd9f7e=_0x2dc97f[_0x1c8ee9][_0xd8e0('0x74')]?_['replace'](_0x52a5bd[_0x2dc97f[_0x1c8ee9][_0xd8e0('0x74')]],'%s',_0xfd9f7e):_0xfd9f7e;if(_0x2dc97f[_0x1c8ee9]['groupBy']){_0xe68ba2[_0xd8e0('0x64')](_0xfd9f7e);}_0x2dc97f[_0x1c8ee9][_0xd8e0('0x75')]&&_0xe68ba2[_0xd8e0('0x33')](_0xfd9f7e,_0x2dc97f[_0x1c8ee9][_0xd8e0('0x75')]==='DESC'?![]:!![]);_0xe68ba2[_0xd8e0('0x65')](_0xfd9f7e,_0x2dc97f[_0x1c8ee9][_0xd8e0('0x76')]||_0xfd9f7e);}if(_0x54330f[_0xd8e0('0x77')]){_0x54330f['joins']=JSON[_0xd8e0('0x78')](_0x54330f[_0xd8e0('0x77')]);for(var _0xe2502e=0x0;_0xe2502e<_0x54330f[_0xd8e0('0x77')][_0xd8e0('0x41')];_0xe2502e+=0x1){if(_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x2a')]&&_['includes'](_0x562cb9,_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x2a')])&&_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x79')]&&_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x7a')]&&_0x54330f[_0xd8e0('0x77')][_0xe2502e]['foreignKey']){_0xe68ba2[_0x54330f[_0xd8e0('0x77')][_0xe2502e]['type']](_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x7a')],null,util[_0xd8e0('0x74')]('%s.%s\x20=\x20%s.%s',_0x54330f['table'],_0x54330f[_0xd8e0('0x77')][_0xe2502e]['parentKey'],_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x7a')],_0x54330f[_0xd8e0('0x77')][_0xe2502e][_0xd8e0('0x7b')]));}}}if(_0x54330f['conditions']){_0x54330f[_0xd8e0('0x7c')]=JSON[_0xd8e0('0x78')](_0x54330f[_0xd8e0('0x7c')]);_0xe68ba2[_0xd8e0('0x35')](_0x223b5e(_0x54330f[_0xd8e0('0x7c')][_0xd8e0('0x64')]));}_0x1182b=_0xe68ba2[_0xd8e0('0x7d')]();_0xe68ba2['limit'](_0x2847c0);_0xe68ba2[_0xd8e0('0x19')](0x0);logger[_0xd8e0('0x7e')]('Limited\x20Query:',_0xe68ba2[_0xd8e0('0x7f')]());return db[_0xd8e0('0x80')][_0xd8e0('0x2d')](_0xe68ba2[_0xd8e0('0x7f')](),{'type':db[_0xd8e0('0x80')][_0xd8e0('0x81')][_0xd8e0('0x82')]});}})[_0xd8e0('0x1d')](respondWithResult(_0x3e4793,null))['catch'](handleError(_0x3e4793,null));};function runReport(_0x5d8fdc,_0x3d7f52,_0x1cadec){var _0x7fc8a=_0x3d7f52[_0xd8e0('0x23')];var _0x25e8c0=0xa;var _0x3fa7b4=[_0xd8e0('0x51'),_0xd8e0('0x52'),_0xd8e0('0x53'),_0xd8e0('0x54')];var _0x359d84={'SUM':'SUM(%s)','COUNT':_0xd8e0('0x83'),'COUNT DISTINCT':_0xd8e0('0x56'),'MAX':_0xd8e0('0x57'),'MIN':_0xd8e0('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd8e0('0x5a'),'GROUP_CONCAT ASC':_0xd8e0('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3caee5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd8e0('0x5e'),'HOUR':_0xd8e0('0x5f'),'ROUND':_0xd8e0('0x84'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x509539=function(_0x1a6d11){return!_[_0xd8e0('0x85')]([_0xd8e0('0x86'),_0xd8e0('0x87'),_0xd8e0('0x88'),_0xd8e0('0x61')],_0x1a6d11);};var _0x37d2e4=function(_0x26c610){if(!_0x26c610||!_0x26c610[_0xd8e0('0x62')][_0xd8e0('0x41')]){return'';}for(var _0x1b722c='(',_0x490ac2=0x0;_0x490ac2<_0x26c610[_0xd8e0('0x62')][_0xd8e0('0x41')];_0x490ac2+=0x1){_0x490ac2>0x0&&(_0x1b722c+='\x20'+_0x26c610[_0xd8e0('0x63')]+'\x20');_0x1b722c+=_0x26c610[_0xd8e0('0x62')][_0x490ac2][_0xd8e0('0x64')]?_0x37d2e4(_0x26c610[_0xd8e0('0x62')][_0x490ac2]['group']):_0x26c610[_0xd8e0('0x62')][_0x490ac2][_0xd8e0('0x65')]+'\x20'+_0x26c610[_0xd8e0('0x62')][_0x490ac2]['condition']+(_0x509539(_0x26c610[_0xd8e0('0x62')][_0x490ac2][_0xd8e0('0x66')])?'\x20'+_0x26c610[_0xd8e0('0x62')][_0x490ac2][_0xd8e0('0x67')]:'');}return _0x1b722c+')';};var _0x1021f6={'where':{'id':_0x5d8fdc['id']}},_0x5bb7c9,_0x4161c7,_0x40512e,_0x3366f3,_0x3f1c69;_0x1021f6=_['merge']({},_0x1021f6,_0x1cadec);return db['AnalyticCustomReport'][_0xd8e0('0x44')](_0x1021f6)[_0xd8e0('0x1d')](function(_0x26eff1){if(_0x26eff1){_0x5bb7c9=_0x26eff1;return _0x26eff1['getFields']();}return null;})['then'](function(_0x487c6d){if(_0x487c6d){if(!_0x487c6d[_0xd8e0('0x41')]){throw new db[(_0xd8e0('0x69'))][(_0xd8e0('0x6a'))](_0xd8e0('0x89'),0x193);}_0x4161c7=_0x487c6d;return db[_0xd8e0('0x6b')]['findAll']({'raw':!![]});}return null;})[_0xd8e0('0x1d')](function(_0x3bf51c){if(_0x3bf51c){_0x40512e=_[_0xd8e0('0x6c')](_0x3bf51c,'id');var _0x5ac881;var _0x58203e=squel[_0xd8e0('0x6d')]();_0x58203e[_0xd8e0('0x6e')](_0x5bb7c9[_0xd8e0('0x6f')]);for(var _0x2e06c9=0x0;_0x2e06c9<_0x4161c7[_0xd8e0('0x41')];_0x2e06c9+=0x1){_0x5ac881=_0x4161c7[_0x2e06c9][_0xd8e0('0x70')]?_0x40512e[_0x4161c7[_0x2e06c9][_0xd8e0('0x70')]][_0xd8e0('0x71')]:_0x4161c7[_0x2e06c9][_0xd8e0('0x65')];_0x5ac881=_0x4161c7[_0x2e06c9][_0xd8e0('0x72')]?_[_0xd8e0('0x73')](_0x359d84[_0x4161c7[_0x2e06c9][_0xd8e0('0x72')]],'%s',_0x5ac881):_0x5ac881;_0x5ac881=_0x4161c7[_0x2e06c9][_0xd8e0('0x74')]?_['replace'](_0x3caee5[_0x4161c7[_0x2e06c9][_0xd8e0('0x74')]],'%s',_0x5ac881):_0x5ac881;if(_0x4161c7[_0x2e06c9][_0xd8e0('0x8a')]){_0x58203e[_0xd8e0('0x64')](_0x5ac881);}_0x4161c7[_0x2e06c9][_0xd8e0('0x75')]&&_0x58203e['order'](_0x5ac881,_0x4161c7[_0x2e06c9]['orderBy']===_0xd8e0('0x8b')?![]:!![]);_0x58203e[_0xd8e0('0x65')](_0x5ac881,_0x4161c7[_0x2e06c9][_0xd8e0('0x76')]||_0x5ac881);}if(_0x5bb7c9[_0xd8e0('0x77')]){_0x5bb7c9['joins']=JSON[_0xd8e0('0x78')](_0x5bb7c9[_0xd8e0('0x77')]);for(var _0x5c5be3=0x0;_0x5c5be3<_0x5bb7c9['joins'][_0xd8e0('0x41')];_0x5c5be3+=0x1){if(_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3][_0xd8e0('0x2a')]&&_['includes'](_0x3fa7b4,_0x5bb7c9['joins'][_0x5c5be3][_0xd8e0('0x2a')])&&_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3][_0xd8e0('0x79')]&&_0x5bb7c9['joins'][_0x5c5be3][_0xd8e0('0x7a')]&&_0x5bb7c9['joins'][_0x5c5be3][_0xd8e0('0x7b')]){_0x58203e[_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3][_0xd8e0('0x2a')]](_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3][_0xd8e0('0x7a')],null,util[_0xd8e0('0x74')](_0xd8e0('0x8c'),_0x5bb7c9[_0xd8e0('0x6f')],_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3]['parentKey'],_0x5bb7c9['joins'][_0x5c5be3][_0xd8e0('0x7a')],_0x5bb7c9[_0xd8e0('0x77')][_0x5c5be3]['foreignKey']));}}}if(_0x5bb7c9[_0xd8e0('0x7c')]){_0x5bb7c9['conditions']=JSON['parse'](_0x5bb7c9[_0xd8e0('0x7c')]);_0x58203e[_0xd8e0('0x35')](_0x37d2e4(_0x5bb7c9[_0xd8e0('0x7c')][_0xd8e0('0x64')]));}_0x3f1c69=_0x58203e[_0xd8e0('0x7d')]();_0x58203e[_0xd8e0('0x1a')](_0x25e8c0);_0x58203e[_0xd8e0('0x19')](0x0);logger['debug'](_0xd8e0('0x8d'),_0x58203e['toString']());return db[_0xd8e0('0x80')][_0xd8e0('0x2d')](_0x58203e['toString'](),{'type':db[_0xd8e0('0x80')][_0xd8e0('0x81')][_0xd8e0('0x82')]});}})[_0xd8e0('0x1d')](function(_0x24e471){if(!_0x24e471[_0xd8e0('0x41')]){throw new db[(_0xd8e0('0x69'))][(_0xd8e0('0x6a'))](_0xd8e0('0x8e'),0xcc);}if(_0x3d7f52[_0xd8e0('0x8f')]==='web'){return null;}var _0x51a720=_[_0xd8e0('0x38')](_0x3d7f52,{'name':_0x3d7f52[_0xd8e0('0x90')]||_0x3d7f52[_0xd8e0('0x23')]||_0x5bb7c9['name'],'basename':_0x7fc8a,'savename':util[_0xd8e0('0x74')]('%s-%s.%s',_0x3d7f52['name']||_0x5bb7c9[_0xd8e0('0x23')],require('randomstring')[_0xd8e0('0x91')](0x4),_0x3d7f52[_0xd8e0('0x8f')]||_0xd8e0('0x92')),'reportId':_0x5bb7c9['id'],'reportType':_0xd8e0('0x93')});return db[_0xd8e0('0x94')][_0xd8e0('0x45')](_0x51a720,{'raw':!![]});})['then'](function(_0x368bb8){if(_0x5bb7c9[_0xd8e0('0x6f')]===_0xd8e0('0x95')){_0x3f1c69['where'](_0x5bb7c9['table']+_0xd8e0('0x96'),_0x3d7f52[_0xd8e0('0x97')],_0x3d7f52[_0xd8e0('0x98')]);}else{_0x3f1c69[_0xd8e0('0x35')](_0x5bb7c9[_0xd8e0('0x6f')]+_0xd8e0('0x99'),_0x3d7f52['startDate'],_0x3d7f52[_0xd8e0('0x98')]);}if(_0x368bb8){logger[_0xd8e0('0x9a')](_0xd8e0('0x9b'),_0x3f1c69['toString']());require('child_process')['fork'](path[_0xd8e0('0x51')](__dirname,_0xd8e0('0x9c'),_0x368bb8['output']),[_0x368bb8['id'],_0x3f1c69[_0xd8e0('0x7f')](),path[_0xd8e0('0x51')](__dirname,_0xd8e0('0x9d'),_0x368bb8['savename']),_0x7fc8a]);return _0x368bb8;}else{var _0x591780=squel[_0xd8e0('0x6d')]();_0x591780['from']('('+_0x3f1c69['toString']()+')',_0xd8e0('0x9e'));_0x591780[_0xd8e0('0x65')](_0xd8e0('0x9f'),_0xd8e0('0x18'));_0x3f1c69[_0xd8e0('0x1a')](_0x3d7f52[_0xd8e0('0x1a')]||_0x25e8c0);_0x3f1c69[_0xd8e0('0x19')](_0x3d7f52['offset']||0x0);return dbH['sequelize'][_0xd8e0('0x2d')](_0x591780[_0xd8e0('0x7f')](),{'type':dbH[_0xd8e0('0x80')][_0xd8e0('0x81')][_0xd8e0('0x82')]})['then'](function(_0x320303){if(!_0x320303[_0xd8e0('0x41')]){_0x3366f3=0x0;}else{_0x3366f3=_0x320303[0x0][_0xd8e0('0x18')]||0x0;}return dbH[_0xd8e0('0x80')][_0xd8e0('0x2d')](_0x3f1c69[_0xd8e0('0x7f')](),{'type':dbH[_0xd8e0('0x80')][_0xd8e0('0x81')]['SELECT']});})[_0xd8e0('0x1d')](function(_0xbf0c31){return{'rows':_0xbf0c31||[],'count':_0x3366f3};});}});}exports[_0xd8e0('0xa0')]=function(_0x20c411,_0x57b114){return runReport(_0x20c411[_0xd8e0('0x3f')],_0x20c411['query'],_0x20c411[_0xd8e0('0x43')])[_0xd8e0('0x1d')](respondWithResult(_0x57b114,null))[_0xd8e0('0x3d')](handleError(_0x57b114,null));};exports[_0xd8e0('0xa1')]=runReport;exports[_0xd8e0('0x2d')]=function(_0x2770a2,_0x4e810c){var _0x459f7b=0xa;var _0x145785=[_0xd8e0('0x51'),_0xd8e0('0x52'),_0xd8e0('0x53'),_0xd8e0('0x54')];var _0x3cdc5f={'SUM':_0xd8e0('0x55'),'COUNT':_0xd8e0('0x83'),'COUNT DISTINCT':_0xd8e0('0x56'),'MAX':_0xd8e0('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd8e0('0x5a'),'GROUP_CONCAT ASC':_0xd8e0('0x5b'),'GROUP_CONCAT DESC':_0xd8e0('0x5c')};var _0x61e492={'SEC_TO_TIME':_0xd8e0('0x5d'),'DATE':_0xd8e0('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0xd8e0('0x84'),'UNIX_TIMESTAMP':_0xd8e0('0x60')};var _0x7771a9=function(_0x482707){return!_['includes'](['IS\x20NULL',_0xd8e0('0x87'),_0xd8e0('0x88'),_0xd8e0('0x61')],_0x482707);};var _0x233b9f=function(_0x4a072f){if(!_0x4a072f||!_0x4a072f[_0xd8e0('0x62')][_0xd8e0('0x41')]){return'';}for(var _0x367099='(',_0x2d5365=0x0;_0x2d5365<_0x4a072f[_0xd8e0('0x62')][_0xd8e0('0x41')];_0x2d5365+=0x1){_0x2d5365>0x0&&(_0x367099+='\x20'+_0x4a072f[_0xd8e0('0x63')]+'\x20');_0x367099+=_0x4a072f[_0xd8e0('0x62')][_0x2d5365]['group']?_0x233b9f(_0x4a072f[_0xd8e0('0x62')][_0x2d5365][_0xd8e0('0x64')]):_0x4a072f['rules'][_0x2d5365][_0xd8e0('0x65')]+'\x20'+_0x4a072f[_0xd8e0('0x62')][_0x2d5365][_0xd8e0('0x66')]+(_0x7771a9(_0x4a072f['rules'][_0x2d5365][_0xd8e0('0x66')])?'\x20'+_0x4a072f[_0xd8e0('0x62')][_0x2d5365]['value']:'');}return _0x367099+')';};var _0x3ea9d3={'where':{'id':_0x2770a2[_0xd8e0('0x3f')]['id']}},_0x138f59,_0x56bda6,_0x295dab,_0x173df0,_0x445d8e;_0x3ea9d3=_[_0xd8e0('0x38')]({},_0x3ea9d3,_0x2770a2[_0xd8e0('0x43')]);return db[_0xd8e0('0x27')][_0xd8e0('0x44')](_0x3ea9d3)[_0xd8e0('0x1d')](function(_0x11a2be){if(_0x11a2be){_0x138f59=_0x11a2be;return _0x11a2be[_0xd8e0('0x68')]();}return null;})[_0xd8e0('0x1d')](function(_0x4bb230){if(_0x4bb230){if(!_0x4bb230[_0xd8e0('0x41')]){throw new db[(_0xd8e0('0x69'))][(_0xd8e0('0x6a'))](_0xd8e0('0x89'),0x193);}_0x56bda6=_0x4bb230;return db[_0xd8e0('0x6b')][_0xd8e0('0x3b')]({'raw':!![]});}return null;})[_0xd8e0('0x1d')](function(_0x3f8fae){if(_0x3f8fae){_0x295dab=_[_0xd8e0('0x6c')](_0x3f8fae,'id');var _0x163e4c;var _0x56a015=squel[_0xd8e0('0x6d')]();_0x56a015['from'](_0x138f59[_0xd8e0('0x6f')]);for(var _0x39ff98=0x0;_0x39ff98<_0x56bda6[_0xd8e0('0x41')];_0x39ff98+=0x1){_0x163e4c=_0x56bda6[_0x39ff98][_0xd8e0('0x70')]?_0x295dab[_0x56bda6[_0x39ff98][_0xd8e0('0x70')]][_0xd8e0('0x71')]:_0x56bda6[_0x39ff98][_0xd8e0('0x65')];_0x163e4c=_0x56bda6[_0x39ff98][_0xd8e0('0x72')]?_[_0xd8e0('0x73')](_0x3cdc5f[_0x56bda6[_0x39ff98][_0xd8e0('0x72')]],'%s',_0x163e4c):_0x163e4c;_0x163e4c=_0x56bda6[_0x39ff98][_0xd8e0('0x74')]?_['replace'](_0x61e492[_0x56bda6[_0x39ff98]['format']],'%s',_0x163e4c):_0x163e4c;if(_0x56bda6[_0x39ff98][_0xd8e0('0x8a')]){_0x56a015[_0xd8e0('0x64')](_0x163e4c);}_0x56bda6[_0x39ff98][_0xd8e0('0x75')]&&_0x56a015[_0xd8e0('0x33')](_0x163e4c,_0x56bda6[_0x39ff98][_0xd8e0('0x75')]===_0xd8e0('0x8b')?![]:!![]);_0x56a015[_0xd8e0('0x65')](_0x163e4c,_0x56bda6[_0x39ff98]['alias']||_0x163e4c);}if(_0x138f59[_0xd8e0('0x77')]){_0x138f59[_0xd8e0('0x77')]=JSON[_0xd8e0('0x78')](_0x138f59[_0xd8e0('0x77')]);for(var _0x388feb=0x0;_0x388feb<_0x138f59[_0xd8e0('0x77')][_0xd8e0('0x41')];_0x388feb+=0x1){if(_0x138f59['joins'][_0x388feb][_0xd8e0('0x2a')]&&_[_0xd8e0('0x85')](_0x145785,_0x138f59['joins'][_0x388feb]['type'])&&_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x79')]&&_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x7a')]&&_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x7b')]){_0x56a015[_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x2a')]](_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x7a')],null,util['format'](_0xd8e0('0x8c'),_0x138f59[_0xd8e0('0x6f')],_0x138f59[_0xd8e0('0x77')][_0x388feb]['parentKey'],_0x138f59[_0xd8e0('0x77')][_0x388feb][_0xd8e0('0x7a')],_0x138f59['joins'][_0x388feb][_0xd8e0('0x7b')]));}}}if(_0x138f59[_0xd8e0('0x7c')]){_0x138f59['conditions']=JSON[_0xd8e0('0x78')](_0x138f59[_0xd8e0('0x7c')]);_0x56a015['where'](_0x233b9f(_0x138f59[_0xd8e0('0x7c')][_0xd8e0('0x64')]));}_0x445d8e=_0x56a015[_0xd8e0('0x7d')]();_0x56a015['limit'](_0x459f7b);_0x56a015['offset'](0x0);logger['debug']('Limited\x20Query:',_0x56a015[_0xd8e0('0x7f')]());return db[_0xd8e0('0x80')]['query'](_0x56a015[_0xd8e0('0x7f')](),{'type':db['sequelize'][_0xd8e0('0x81')][_0xd8e0('0x82')]});}})[_0xd8e0('0x1d')](function(){return{'sql':_0x445d8e[_0xd8e0('0x7f')]()};})[_0xd8e0('0x1d')](respondWithResult(_0x4e810c,null))[_0xd8e0('0x3d')](handleError(_0x4e810c,null));}; \ No newline at end of file +var _0xe43c=['condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','replace','format','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','right_join','cross_join','SUM(%s)','AVG(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','operator','metric','function','groupBy','parse','clone','debug','Sequelize','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','end','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','count','includeAll','findAll','catch','show','params','keys','include','create','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field'];(function(_0x2389fb,_0x18c3e6){var _0x5160db=function(_0x3a8080){while(--_0x3a8080){_0x2389fb['push'](_0x2389fb['shift']());}};_0x5160db(++_0x18c3e6);}(_0xe43c,0x180));var _0xce43=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xe43c[_0x11005e];return _0x29338f;};'use strict';var pdf=require(_0xce43('0x0'));var emlformat=require(_0xce43('0x1'));var rimraf=require(_0xce43('0x2'));var zipdir=require(_0xce43('0x3'));var jsonpatch=require(_0xce43('0x4'));var rp=require(_0xce43('0x5'));var moment=require('moment');var BPromise=require(_0xce43('0x6'));var Mustache=require('mustache');var util=require(_0xce43('0x7'));var path=require(_0xce43('0x8'));var sox=require(_0xce43('0x9'));var csv=require(_0xce43('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xce43('0xb'));var squel=require('squel');var crypto=require(_0xce43('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xce43('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xce43('0xe'));var Redis=require(_0xce43('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce43('0x10'));var logger=require('../../config/logger')(_0xce43('0x11'));var utils=require('../../config/utils');var config=require(_0xce43('0x12'));var db=require('../../mysqldb')['db'];var dbH=require(_0xce43('0x13'))[_0xce43('0x14')];function respondWithStatusCode(_0x4c092b,_0x226f21){_0x226f21=_0x226f21||0xcc;return function(_0x1a74bf){if(_0x1a74bf){return _0x4c092b[_0xce43('0x15')](_0x226f21);}return _0x4c092b[_0xce43('0x16')](_0x226f21)['end']();};}function respondWithResult(_0x3034c7,_0x607d92){_0x607d92=_0x607d92||0xc8;return function(_0x3cd0f7){if(_0x3cd0f7){return _0x3034c7[_0xce43('0x16')](_0x607d92)['json'](_0x3cd0f7);}};}function respondWithFilteredResult(_0x588ddb,_0x3c0948){return function(_0x3e4218){if(_0x3e4218){var _0x2eb70b=_0x3e4218['count'],_0x2a9cb4=_0x3c0948[_0xce43('0x17')],_0xd5282=_0x3c0948[_0xce43('0x17')]+_0x3c0948[_0xce43('0x18')],_0x3f79bd;if(_0xd5282>=_0x2eb70b){_0xd5282=_0x2eb70b;_0x3f79bd=0xc8;}else{_0x3f79bd=0xce;}_0x588ddb[_0xce43('0x16')](_0x3f79bd);return _0x588ddb['set'](_0xce43('0x19'),_0x2a9cb4+'-'+_0xd5282+'/'+_0x2eb70b)[_0xce43('0x1a')](_0x3e4218);}return null;};}function patchUpdates(_0x1976eb){return function(_0x2506de){try{jsonpatch[_0xce43('0x1b')](_0x2506de,_0x1976eb,!![]);}catch(_0x3318a0){return BPromise['reject'](_0x3318a0);}return _0x2506de[_0xce43('0x1c')]();};}function saveUpdates(_0x383f69,_0x5973b9){return function(_0xe2ff3f){if(_0xe2ff3f){return _0xe2ff3f[_0xce43('0x1d')](_0x383f69)[_0xce43('0x1e')](function(_0x5a5bd1){return _0x5a5bd1;});}return null;};}function removeEntity(_0x57dcd4,_0x37b34e){return function(_0x30f5a1){if(_0x30f5a1){return _0x30f5a1[_0xce43('0x1f')]()[_0xce43('0x1e')](function(){var _0x2d8f7d=_0x30f5a1[_0xce43('0x20')]({'plain':!![]});var _0x118a89='CustomReports';return db[_0xce43('0x21')][_0xce43('0x1f')]({'where':{'type':_0x118a89,'resourceId':_0x2d8f7d['id']}})[_0xce43('0x1e')](function(){return _0x30f5a1;});})[_0xce43('0x1e')](function(){_0x57dcd4['status'](0xcc)[_0xce43('0x22')]();});}};}function handleEntityNotFound(_0x45fec7,_0x117ac1){return function(_0x1bb63f){if(!_0x1bb63f){_0x45fec7[_0xce43('0x15')](0x194);}return _0x1bb63f;};}function handleError(_0x272b45,_0x49e958){_0x49e958=_0x49e958||0x1f4;return function(_0x371985){logger['error'](_0x371985[_0xce43('0x23')]);if(_0x371985[_0xce43('0x24')]){delete _0x371985[_0xce43('0x24')];}_0x272b45[_0xce43('0x16')](_0x49e958)['send'](_0x371985);};}exports[_0xce43('0x25')]=function(_0x4402f8,_0x2a2d1d){var _0x44ac56={},_0x4b966a={},_0x6a9458={'count':0x0,'rows':[]};var _0x345eaf=_['map'](db[_0xce43('0x26')][_0xce43('0x27')],function(_0x124776){return{'name':_0x124776[_0xce43('0x28')],'type':_0x124776[_0xce43('0x29')][_0xce43('0x2a')]};});_0x4b966a['model']=_['map'](_0x345eaf,_0xce43('0x24'));_0x4b966a[_0xce43('0x2b')]=_['keys'](_0x4402f8[_0xce43('0x2b')]);_0x4b966a[_0xce43('0x2c')]=_[_0xce43('0x2d')](_0x4b966a[_0xce43('0x2e')],_0x4b966a[_0xce43('0x2b')]);_0x44ac56['attributes']=_[_0xce43('0x2d')](_0x4b966a[_0xce43('0x2e')],qs[_0xce43('0x2f')](_0x4402f8[_0xce43('0x2b')][_0xce43('0x2f')]));_0x44ac56[_0xce43('0x30')]=_0x44ac56[_0xce43('0x30')][_0xce43('0x31')]?_0x44ac56[_0xce43('0x30')]:_0x4b966a[_0xce43('0x2e')];if(!_0x4402f8[_0xce43('0x2b')][_0xce43('0x32')](_0xce43('0x33'))){_0x44ac56[_0xce43('0x18')]=qs[_0xce43('0x18')](_0x4402f8[_0xce43('0x2b')][_0xce43('0x18')]);_0x44ac56[_0xce43('0x17')]=qs['offset'](_0x4402f8[_0xce43('0x2b')][_0xce43('0x17')]);}_0x44ac56[_0xce43('0x34')]=qs[_0xce43('0x35')](_0x4402f8[_0xce43('0x2b')][_0xce43('0x35')]);_0x44ac56['where']=qs[_0xce43('0x2c')](_[_0xce43('0x36')](_0x4402f8[_0xce43('0x2b')],_0x4b966a[_0xce43('0x2c')]),_0x345eaf);if(_0x4402f8[_0xce43('0x2b')]['filter']){_0x44ac56['where']=_[_0xce43('0x37')](_0x44ac56[_0xce43('0x38')],{'$or':_['map'](_0x345eaf,function(_0x338c54){if(_0x338c54[_0xce43('0x29')]!==_0xce43('0x39')){var _0x2fcb62={};_0x2fcb62[_0x338c54['name']]={'$like':'%'+_0x4402f8[_0xce43('0x2b')]['filter']+'%'};return _0x2fcb62;}})});}_0x44ac56=_[_0xce43('0x37')]({},_0x44ac56,_0x4402f8[_0xce43('0x3a')]);var _0x522853={'where':_0x44ac56[_0xce43('0x38')]};return db[_0xce43('0x26')][_0xce43('0x3b')](_0x522853)['then'](function(_0x486c51){_0x6a9458[_0xce43('0x3b')]=_0x486c51;if(_0x4402f8[_0xce43('0x2b')][_0xce43('0x3c')]){_0x44ac56['include']=[{'all':!![]}];}return db[_0xce43('0x26')][_0xce43('0x3d')](_0x44ac56);})[_0xce43('0x1e')](function(_0x41565a){_0x6a9458['rows']=_0x41565a;return _0x6a9458;})[_0xce43('0x1e')](respondWithFilteredResult(_0x2a2d1d,_0x44ac56))[_0xce43('0x3e')](handleError(_0x2a2d1d,null));};exports[_0xce43('0x3f')]=function(_0xc55921,_0x3d8734){var _0x51f1f7={'raw':![],'where':{'id':_0xc55921[_0xce43('0x40')]['id']}},_0x2f6e23={};_0x2f6e23[_0xce43('0x2e')]=_['keys'](db['AnalyticCustomReport'][_0xce43('0x27')]);_0x2f6e23[_0xce43('0x2b')]=_[_0xce43('0x41')](_0xc55921[_0xce43('0x2b')]);_0x2f6e23[_0xce43('0x2c')]=_[_0xce43('0x2d')](_0x2f6e23[_0xce43('0x2e')],_0x2f6e23[_0xce43('0x2b')]);_0x51f1f7[_0xce43('0x30')]=_[_0xce43('0x2d')](_0x2f6e23[_0xce43('0x2e')],qs[_0xce43('0x2f')](_0xc55921[_0xce43('0x2b')][_0xce43('0x2f')]));_0x51f1f7[_0xce43('0x30')]=_0x51f1f7[_0xce43('0x30')][_0xce43('0x31')]?_0x51f1f7[_0xce43('0x30')]:_0x2f6e23['model'];if(_0xc55921[_0xce43('0x2b')][_0xce43('0x3c')]){_0x51f1f7[_0xce43('0x42')]=[{'all':!![]}];}_0x51f1f7=_['merge']({},_0x51f1f7,_0xc55921['options']);return db[_0xce43('0x26')]['find'](_0x51f1f7)['then'](handleEntityNotFound(_0x3d8734,null))['then'](respondWithResult(_0x3d8734,null))['catch'](handleError(_0x3d8734,null));};exports[_0xce43('0x43')]=function(_0x1b37ab,_0x5c177d){return db[_0xce43('0x26')]['create'](_0x1b37ab['body'],{})[_0xce43('0x1e')](function(_0x562963){var _0x55181e=_0x1b37ab[_0xce43('0x44')][_0xce43('0x20')]({'plain':!![]});if(!_0x55181e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55181e['role']===_0xce43('0x44')){var _0x4a5f2d=_0x562963[_0xce43('0x20')]({'plain':!![]});var _0x19458a='Reports';return db[_0xce43('0x45')][_0xce43('0x46')]({'where':{'name':_0x19458a,'userProfileId':_0x55181e[_0xce43('0x47')]},'raw':!![]})[_0xce43('0x1e')](function(_0x24a969){if(_0x24a969&&_0x24a969[_0xce43('0x48')]===0x0){return db[_0xce43('0x21')][_0xce43('0x43')]({'name':_0x4a5f2d[_0xce43('0x24')],'resourceId':_0x4a5f2d['id'],'type':'CustomReports','sectionId':_0x24a969['id']},{})['then'](function(){return _0x562963;});}else{return _0x562963;}})[_0xce43('0x3e')](function(_0x25fb99){logger[_0xce43('0x49')](_0xce43('0x4a'),_0x25fb99);throw _0x25fb99;});}return _0x562963;})[_0xce43('0x1e')](respondWithResult(_0x5c177d,0xc9))[_0xce43('0x3e')](handleError(_0x5c177d,null));};exports['update']=function(_0x3f7f21,_0x360ff6){if(_0x3f7f21[_0xce43('0x4b')]['id']){delete _0x3f7f21[_0xce43('0x4b')]['id'];}return db[_0xce43('0x26')][_0xce43('0x46')]({'where':{'id':_0x3f7f21[_0xce43('0x40')]['id']}})[_0xce43('0x1e')](handleEntityNotFound(_0x360ff6,null))[_0xce43('0x1e')](saveUpdates(_0x3f7f21[_0xce43('0x4b')],null))[_0xce43('0x1e')](respondWithResult(_0x360ff6,null))['catch'](handleError(_0x360ff6,null));};exports[_0xce43('0x1f')]=function(_0x680111,_0x3789ef){return db['AnalyticCustomReport'][_0xce43('0x46')]({'where':{'id':_0x680111[_0xce43('0x40')]['id']}})[_0xce43('0x1e')](handleEntityNotFound(_0x3789ef,null))['then'](removeEntity(_0x3789ef,null))['catch'](handleError(_0x3789ef,null));};exports[_0xce43('0x4c')]=function(_0x509e8b,_0x3c4df5){var _0x2a7d36=0xa;var _0x44e351=['join','left_join','right_join','cross_join'];var _0x507c85={'SUM':'SUM(%s)','COUNT':_0xce43('0x4d'),'COUNT DISTINCT':_0xce43('0x4e'),'MAX':_0xce43('0x4f'),'MIN':_0xce43('0x50'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xce43('0x51'),'GROUP_CONCAT DESC':_0xce43('0x52')};var _0x3b26ac={'SEC_TO_TIME':_0xce43('0x53'),'DATE':'DATE(%s)','HOUR':_0xce43('0x54'),'ROUND':_0xce43('0x55'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34fb0d=function(_0x3737e8){return!_[_0xce43('0x56')](['IS\x20NULL',_0xce43('0x57'),_0xce43('0x58'),_0xce43('0x59')],_0x3737e8);};var _0x509c2d=function(_0x4c8296){if(!_0x4c8296||!_0x4c8296[_0xce43('0x5a')]['length']){return'';}for(var _0x40e11b='(',_0x4a0ad1=0x0;_0x4a0ad1<_0x4c8296[_0xce43('0x5a')]['length'];_0x4a0ad1+=0x1){_0x4a0ad1>0x0&&(_0x40e11b+='\x20'+_0x4c8296['operator']+'\x20');_0x40e11b+=_0x4c8296[_0xce43('0x5a')][_0x4a0ad1]['group']?_0x509c2d(_0x4c8296[_0xce43('0x5a')][_0x4a0ad1][_0xce43('0x5b')]):_0x4c8296[_0xce43('0x5a')][_0x4a0ad1][_0xce43('0x5c')]+'\x20'+_0x4c8296[_0xce43('0x5a')][_0x4a0ad1][_0xce43('0x5d')]+(_0x34fb0d(_0x4c8296[_0xce43('0x5a')][_0x4a0ad1][_0xce43('0x5d')])?'\x20'+_0x4c8296[_0xce43('0x5a')][_0x4a0ad1][_0xce43('0x5e')]:'');}return _0x40e11b+')';};var _0x806287={'where':{'id':_0x509e8b[_0xce43('0x40')]['id']}},_0x494f10,_0x282f24,_0x3fee60,_0x25b2a8,_0x286d08;_0x806287=_[_0xce43('0x37')]({},_0x806287,_0x509e8b[_0xce43('0x3a')]);return db[_0xce43('0x26')]['find'](_0x806287)['then'](function(_0x22d277){if(_0x22d277){_0x494f10=_0x22d277;return _0x22d277[_0xce43('0x5f')]();}return null;})['then'](function(_0x1b46fb){if(_0x1b46fb){if(!_0x1b46fb['length']){throw new db['Sequelize'][(_0xce43('0x60'))](_0xce43('0x61'),0x193);}_0x282f24=_0x1b46fb;return db[_0xce43('0x62')][_0xce43('0x3d')]({'raw':!![]});}return null;})[_0xce43('0x1e')](function(_0x4b1f4e){if(_0x4b1f4e){_0x3fee60=_[_0xce43('0x63')](_0x4b1f4e,'id');var _0x3b83b3;var _0x49d33e=squel[_0xce43('0x64')]();_0x49d33e['from'](_0x494f10[_0xce43('0x65')]);for(var _0x31c96e=0x0;_0x31c96e<_0x282f24[_0xce43('0x31')];_0x31c96e+=0x1){_0x3b83b3=_0x282f24[_0x31c96e]['MetricId']?_0x3fee60[_0x282f24[_0x31c96e][_0xce43('0x66')]]['metric']:_0x282f24[_0x31c96e][_0xce43('0x5c')];_0x3b83b3=_0x282f24[_0x31c96e]['function']?_[_0xce43('0x67')](_0x507c85[_0x282f24[_0x31c96e]['function']],'%s',_0x3b83b3):_0x3b83b3;_0x3b83b3=_0x282f24[_0x31c96e]['format']?_['replace'](_0x3b26ac[_0x282f24[_0x31c96e][_0xce43('0x68')]],'%s',_0x3b83b3):_0x3b83b3;if(_0x282f24[_0x31c96e]['groupBy']){_0x49d33e['group'](_0x3b83b3);}_0x282f24[_0x31c96e][_0xce43('0x69')]&&_0x49d33e[_0xce43('0x34')](_0x3b83b3,_0x282f24[_0x31c96e][_0xce43('0x69')]==='DESC'?![]:!![]);_0x49d33e[_0xce43('0x5c')](_0x3b83b3,_0x282f24[_0x31c96e][_0xce43('0x6a')]||_0x3b83b3);}if(_0x494f10[_0xce43('0x6b')]){_0x494f10[_0xce43('0x6b')]=JSON['parse'](_0x494f10['joins']);for(var _0x1b4b62=0x0;_0x1b4b62<_0x494f10[_0xce43('0x6b')][_0xce43('0x31')];_0x1b4b62+=0x1){if(_0x494f10[_0xce43('0x6b')][_0x1b4b62]['type']&&_[_0xce43('0x56')](_0x44e351,_0x494f10[_0xce43('0x6b')][_0x1b4b62]['type'])&&_0x494f10[_0xce43('0x6b')][_0x1b4b62]['parentKey']&&_0x494f10[_0xce43('0x6b')][_0x1b4b62][_0xce43('0x6c')]&&_0x494f10[_0xce43('0x6b')][_0x1b4b62][_0xce43('0x6d')]){_0x49d33e[_0x494f10[_0xce43('0x6b')][_0x1b4b62][_0xce43('0x29')]](_0x494f10[_0xce43('0x6b')][_0x1b4b62][_0xce43('0x6c')],null,util[_0xce43('0x68')](_0xce43('0x6e'),_0x494f10[_0xce43('0x65')],_0x494f10[_0xce43('0x6b')][_0x1b4b62][_0xce43('0x6f')],_0x494f10[_0xce43('0x6b')][_0x1b4b62]['foreignTable'],_0x494f10['joins'][_0x1b4b62][_0xce43('0x6d')]));}}}if(_0x494f10[_0xce43('0x70')]){_0x494f10[_0xce43('0x70')]=JSON['parse'](_0x494f10[_0xce43('0x70')]);_0x49d33e['where'](_0x509c2d(_0x494f10[_0xce43('0x70')][_0xce43('0x5b')]));}_0x286d08=_0x49d33e['clone']();_0x49d33e[_0xce43('0x18')](_0x2a7d36);_0x49d33e[_0xce43('0x17')](0x0);logger['debug'](_0xce43('0x71'),_0x49d33e['toString']());return db[_0xce43('0x72')][_0xce43('0x2b')](_0x49d33e[_0xce43('0x73')](),{'type':db[_0xce43('0x72')][_0xce43('0x74')][_0xce43('0x75')]});}})[_0xce43('0x1e')](respondWithResult(_0x3c4df5,null))[_0xce43('0x3e')](handleError(_0x3c4df5,null));};function runReport(_0x393552,_0x3c1c6d,_0x2b2599){var _0x561dab=_0x3c1c6d['name'];var _0x5c2865=0xa;var _0x3a44cf=[_0xce43('0x76'),_0xce43('0x77'),_0xce43('0x78'),_0xce43('0x79')];var _0x3bedeb={'SUM':_0xce43('0x7a'),'COUNT':_0xce43('0x4d'),'COUNT DISTINCT':_0xce43('0x4e'),'MAX':_0xce43('0x4f'),'MIN':'MIN(%s)','AVG':_0xce43('0x7b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xce43('0x52')};var _0x3694b3={'SEC_TO_TIME':_0xce43('0x53'),'DATE':_0xce43('0x7c'),'HOUR':_0xce43('0x54'),'ROUND':_0xce43('0x55'),'UNIX_TIMESTAMP':_0xce43('0x7d')};var _0x13f712=function(_0x437045){return!_[_0xce43('0x56')]([_0xce43('0x7e'),_0xce43('0x57'),_0xce43('0x58'),'IS\x20NOT\x20EMPTY'],_0x437045);};var _0x302704=function(_0x9d4a47){if(!_0x9d4a47||!_0x9d4a47['rules'][_0xce43('0x31')]){return'';}for(var _0x213c62='(',_0x8d10df=0x0;_0x8d10df<_0x9d4a47['rules'][_0xce43('0x31')];_0x8d10df+=0x1){_0x8d10df>0x0&&(_0x213c62+='\x20'+_0x9d4a47[_0xce43('0x7f')]+'\x20');_0x213c62+=_0x9d4a47[_0xce43('0x5a')][_0x8d10df][_0xce43('0x5b')]?_0x302704(_0x9d4a47['rules'][_0x8d10df]['group']):_0x9d4a47[_0xce43('0x5a')][_0x8d10df][_0xce43('0x5c')]+'\x20'+_0x9d4a47[_0xce43('0x5a')][_0x8d10df][_0xce43('0x5d')]+(_0x13f712(_0x9d4a47[_0xce43('0x5a')][_0x8d10df][_0xce43('0x5d')])?'\x20'+_0x9d4a47[_0xce43('0x5a')][_0x8d10df]['value']:'');}return _0x213c62+')';};var _0x17a9f3={'where':{'id':_0x393552['id']}},_0x43c1ac,_0x33881f,_0x3fe1f8,_0x18cefb,_0x58f5fd;_0x17a9f3=_[_0xce43('0x37')]({},_0x17a9f3,_0x2b2599);return db[_0xce43('0x26')][_0xce43('0x46')](_0x17a9f3)[_0xce43('0x1e')](function(_0x2d3d2d){if(_0x2d3d2d){_0x43c1ac=_0x2d3d2d;return _0x2d3d2d[_0xce43('0x5f')]();}return null;})[_0xce43('0x1e')](function(_0x380dac){if(_0x380dac){if(!_0x380dac[_0xce43('0x31')]){throw new db['Sequelize'][(_0xce43('0x60'))](_0xce43('0x61'),0x193);}_0x33881f=_0x380dac;return db[_0xce43('0x62')]['findAll']({'raw':!![]});}return null;})[_0xce43('0x1e')](function(_0x297172){if(_0x297172){_0x3fe1f8=_['keyBy'](_0x297172,'id');var _0x2ef893;var _0x2e3ab6=squel[_0xce43('0x64')]();_0x2e3ab6['from'](_0x43c1ac[_0xce43('0x65')]);for(var _0x53f9da=0x0;_0x53f9da<_0x33881f[_0xce43('0x31')];_0x53f9da+=0x1){_0x2ef893=_0x33881f[_0x53f9da][_0xce43('0x66')]?_0x3fe1f8[_0x33881f[_0x53f9da][_0xce43('0x66')]][_0xce43('0x80')]:_0x33881f[_0x53f9da][_0xce43('0x5c')];_0x2ef893=_0x33881f[_0x53f9da][_0xce43('0x81')]?_[_0xce43('0x67')](_0x3bedeb[_0x33881f[_0x53f9da][_0xce43('0x81')]],'%s',_0x2ef893):_0x2ef893;_0x2ef893=_0x33881f[_0x53f9da][_0xce43('0x68')]?_['replace'](_0x3694b3[_0x33881f[_0x53f9da][_0xce43('0x68')]],'%s',_0x2ef893):_0x2ef893;if(_0x33881f[_0x53f9da][_0xce43('0x82')]){_0x2e3ab6[_0xce43('0x5b')](_0x2ef893);}_0x33881f[_0x53f9da][_0xce43('0x69')]&&_0x2e3ab6[_0xce43('0x34')](_0x2ef893,_0x33881f[_0x53f9da][_0xce43('0x69')]==='DESC'?![]:!![]);_0x2e3ab6[_0xce43('0x5c')](_0x2ef893,_0x33881f[_0x53f9da][_0xce43('0x6a')]||_0x2ef893);}if(_0x43c1ac[_0xce43('0x6b')]){_0x43c1ac[_0xce43('0x6b')]=JSON[_0xce43('0x83')](_0x43c1ac[_0xce43('0x6b')]);for(var _0x651be4=0x0;_0x651be4<_0x43c1ac[_0xce43('0x6b')][_0xce43('0x31')];_0x651be4+=0x1){if(_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x29')]&&_[_0xce43('0x56')](_0x3a44cf,_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x29')])&&_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x6f')]&&_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x6c')]&&_0x43c1ac['joins'][_0x651be4][_0xce43('0x6d')]){_0x2e3ab6[_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x29')]](_0x43c1ac['joins'][_0x651be4][_0xce43('0x6c')],null,util[_0xce43('0x68')](_0xce43('0x6e'),_0x43c1ac['table'],_0x43c1ac[_0xce43('0x6b')][_0x651be4][_0xce43('0x6f')],_0x43c1ac['joins'][_0x651be4][_0xce43('0x6c')],_0x43c1ac['joins'][_0x651be4][_0xce43('0x6d')]));}}}if(_0x43c1ac[_0xce43('0x70')]){_0x43c1ac[_0xce43('0x70')]=JSON[_0xce43('0x83')](_0x43c1ac[_0xce43('0x70')]);_0x2e3ab6['where'](_0x302704(_0x43c1ac[_0xce43('0x70')][_0xce43('0x5b')]));}_0x58f5fd=_0x2e3ab6[_0xce43('0x84')]();_0x2e3ab6[_0xce43('0x18')](_0x5c2865);_0x2e3ab6['offset'](0x0);logger[_0xce43('0x85')](_0xce43('0x71'),_0x2e3ab6[_0xce43('0x73')]());return db[_0xce43('0x72')][_0xce43('0x2b')](_0x2e3ab6[_0xce43('0x73')](),{'type':db[_0xce43('0x72')][_0xce43('0x74')][_0xce43('0x75')]});}})[_0xce43('0x1e')](function(_0x43af97){if(!_0x43af97[_0xce43('0x31')]){throw new db[(_0xce43('0x86'))]['ValidationErrorItem'](_0xce43('0x87'),0xcc);}if(_0x3c1c6d[_0xce43('0x88')]===_0xce43('0x89')){return null;}var _0x5cfd2f=_[_0xce43('0x37')](_0x3c1c6d,{'name':_0x3c1c6d[_0xce43('0x8a')]||_0x3c1c6d['name']||_0x43c1ac[_0xce43('0x24')],'basename':_0x561dab,'savename':util[_0xce43('0x68')](_0xce43('0x8b'),_0x3c1c6d[_0xce43('0x24')]||_0x43c1ac['name'],require('randomstring')[_0xce43('0x8c')](0x4),_0x3c1c6d['output']||_0xce43('0x8d')),'reportId':_0x43c1ac['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xce43('0x43')](_0x5cfd2f,{'raw':!![]});})['then'](function(_0x34ce6b){if(_0x43c1ac['table']==='cdr'){_0x58f5fd['where'](_0x43c1ac[_0xce43('0x65')]+_0xce43('0x8e'),_0x3c1c6d[_0xce43('0x8f')],_0x3c1c6d[_0xce43('0x90')]);}else{_0x58f5fd[_0xce43('0x38')](_0x43c1ac[_0xce43('0x65')]+_0xce43('0x91'),_0x3c1c6d[_0xce43('0x8f')],_0x3c1c6d['endDate']);}if(_0x34ce6b){logger[_0xce43('0x92')](_0xce43('0x93'),_0x58f5fd[_0xce43('0x73')]());require(_0xce43('0x94'))[_0xce43('0x95')](path['join'](__dirname,_0xce43('0x96'),_0x34ce6b[_0xce43('0x88')]),[_0x34ce6b['id'],_0x58f5fd[_0xce43('0x73')](),path[_0xce43('0x76')](__dirname,_0xce43('0x97'),_0x34ce6b[_0xce43('0x98')]),_0x561dab]);return _0x34ce6b;}else{var _0x159438=squel[_0xce43('0x64')]();_0x159438[_0xce43('0x99')]('('+_0x58f5fd[_0xce43('0x73')]()+')',_0xce43('0x9a'));_0x159438['field'](_0xce43('0x9b'),_0xce43('0x3b'));_0x58f5fd[_0xce43('0x18')](_0x3c1c6d[_0xce43('0x18')]||_0x5c2865);_0x58f5fd[_0xce43('0x17')](_0x3c1c6d['offset']||0x0);return dbH[_0xce43('0x72')][_0xce43('0x2b')](_0x159438[_0xce43('0x73')](),{'type':dbH[_0xce43('0x72')][_0xce43('0x74')][_0xce43('0x75')]})[_0xce43('0x1e')](function(_0x478cea){if(!_0x478cea[_0xce43('0x31')]){_0x18cefb=0x0;}else{_0x18cefb=_0x478cea[0x0][_0xce43('0x3b')]||0x0;}return dbH[_0xce43('0x72')][_0xce43('0x2b')](_0x58f5fd[_0xce43('0x73')](),{'type':dbH[_0xce43('0x72')][_0xce43('0x74')][_0xce43('0x75')]});})[_0xce43('0x1e')](function(_0x130139){return{'rows':_0x130139||[],'count':_0x18cefb};});}});}exports[_0xce43('0x9c')]=function(_0x271da1,_0xd2661f){return runReport(_0x271da1[_0xce43('0x40')],_0x271da1['query'],_0x271da1[_0xce43('0x3a')])['then'](respondWithResult(_0xd2661f,null))[_0xce43('0x3e')](handleError(_0xd2661f,null));};exports[_0xce43('0x9d')]=runReport;exports[_0xce43('0x2b')]=function(_0x5f07d2,_0x519e17){var _0x4914d6=0xa;var _0x260923=[_0xce43('0x76'),_0xce43('0x77'),'right_join',_0xce43('0x79')];var _0x2598d1={'SUM':_0xce43('0x7a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xce43('0x4e'),'MAX':_0xce43('0x4f'),'MIN':'MIN(%s)','AVG':_0xce43('0x7b'),'GROUP_CONCAT':_0xce43('0x9e'),'GROUP_CONCAT ASC':_0xce43('0x51'),'GROUP_CONCAT DESC':_0xce43('0x52')};var _0x479c03={'SEC_TO_TIME':_0xce43('0x53'),'DATE':_0xce43('0x7c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xce43('0x7d')};var _0x2a38d7=function(_0x1ff86a){return!_[_0xce43('0x56')](['IS\x20NULL',_0xce43('0x57'),_0xce43('0x58'),_0xce43('0x59')],_0x1ff86a);};var _0x5b8f02=function(_0x42c9b9){if(!_0x42c9b9||!_0x42c9b9['rules'][_0xce43('0x31')]){return'';}for(var _0x20c076='(',_0x5e0db4=0x0;_0x5e0db4<_0x42c9b9[_0xce43('0x5a')]['length'];_0x5e0db4+=0x1){_0x5e0db4>0x0&&(_0x20c076+='\x20'+_0x42c9b9[_0xce43('0x7f')]+'\x20');_0x20c076+=_0x42c9b9[_0xce43('0x5a')][_0x5e0db4]['group']?_0x5b8f02(_0x42c9b9['rules'][_0x5e0db4][_0xce43('0x5b')]):_0x42c9b9['rules'][_0x5e0db4][_0xce43('0x5c')]+'\x20'+_0x42c9b9['rules'][_0x5e0db4]['condition']+(_0x2a38d7(_0x42c9b9[_0xce43('0x5a')][_0x5e0db4]['condition'])?'\x20'+_0x42c9b9[_0xce43('0x5a')][_0x5e0db4]['value']:'');}return _0x20c076+')';};var _0x11c177={'where':{'id':_0x5f07d2[_0xce43('0x40')]['id']}},_0x55455f,_0x41d8fc,_0x59779e,_0x56c721,_0x494280;_0x11c177=_[_0xce43('0x37')]({},_0x11c177,_0x5f07d2['options']);return db[_0xce43('0x26')][_0xce43('0x46')](_0x11c177)[_0xce43('0x1e')](function(_0x4be50b){if(_0x4be50b){_0x55455f=_0x4be50b;return _0x4be50b[_0xce43('0x5f')]();}return null;})[_0xce43('0x1e')](function(_0xfeb8cc){if(_0xfeb8cc){if(!_0xfeb8cc[_0xce43('0x31')]){throw new db['Sequelize'][(_0xce43('0x60'))](_0xce43('0x61'),0x193);}_0x41d8fc=_0xfeb8cc;return db[_0xce43('0x62')]['findAll']({'raw':!![]});}return null;})[_0xce43('0x1e')](function(_0x1ced9f){if(_0x1ced9f){_0x59779e=_[_0xce43('0x63')](_0x1ced9f,'id');var _0x314163;var _0x929532=squel[_0xce43('0x64')]();_0x929532[_0xce43('0x99')](_0x55455f[_0xce43('0x65')]);for(var _0x535a25=0x0;_0x535a25<_0x41d8fc['length'];_0x535a25+=0x1){_0x314163=_0x41d8fc[_0x535a25][_0xce43('0x66')]?_0x59779e[_0x41d8fc[_0x535a25][_0xce43('0x66')]][_0xce43('0x80')]:_0x41d8fc[_0x535a25][_0xce43('0x5c')];_0x314163=_0x41d8fc[_0x535a25][_0xce43('0x81')]?_[_0xce43('0x67')](_0x2598d1[_0x41d8fc[_0x535a25][_0xce43('0x81')]],'%s',_0x314163):_0x314163;_0x314163=_0x41d8fc[_0x535a25]['format']?_['replace'](_0x479c03[_0x41d8fc[_0x535a25][_0xce43('0x68')]],'%s',_0x314163):_0x314163;if(_0x41d8fc[_0x535a25]['groupBy']){_0x929532['group'](_0x314163);}_0x41d8fc[_0x535a25][_0xce43('0x69')]&&_0x929532[_0xce43('0x34')](_0x314163,_0x41d8fc[_0x535a25]['orderBy']==='DESC'?![]:!![]);_0x929532[_0xce43('0x5c')](_0x314163,_0x41d8fc[_0x535a25][_0xce43('0x6a')]||_0x314163);}if(_0x55455f[_0xce43('0x6b')]){_0x55455f['joins']=JSON[_0xce43('0x83')](_0x55455f[_0xce43('0x6b')]);for(var _0x117fad=0x0;_0x117fad<_0x55455f[_0xce43('0x6b')][_0xce43('0x31')];_0x117fad+=0x1){if(_0x55455f['joins'][_0x117fad][_0xce43('0x29')]&&_[_0xce43('0x56')](_0x260923,_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x29')])&&_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6f')]&&_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6c')]&&_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6d')]){_0x929532[_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x29')]](_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6c')],null,util[_0xce43('0x68')](_0xce43('0x6e'),_0x55455f[_0xce43('0x65')],_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6f')],_0x55455f['joins'][_0x117fad]['foreignTable'],_0x55455f[_0xce43('0x6b')][_0x117fad][_0xce43('0x6d')]));}}}if(_0x55455f[_0xce43('0x70')]){_0x55455f[_0xce43('0x70')]=JSON['parse'](_0x55455f[_0xce43('0x70')]);_0x929532[_0xce43('0x38')](_0x5b8f02(_0x55455f[_0xce43('0x70')][_0xce43('0x5b')]));}_0x494280=_0x929532[_0xce43('0x84')]();_0x929532['limit'](_0x4914d6);_0x929532[_0xce43('0x17')](0x0);logger[_0xce43('0x85')](_0xce43('0x71'),_0x929532[_0xce43('0x73')]());return db[_0xce43('0x72')][_0xce43('0x2b')](_0x929532['toString'](),{'type':db[_0xce43('0x72')][_0xce43('0x74')]['SELECT']});}})[_0xce43('0x1e')](function(){return{'sql':_0x494280[_0xce43('0x73')]()};})['then'](respondWithResult(_0x519e17,null))[_0xce43('0x3e')](handleError(_0x519e17,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 8ba13af..0a9b503 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 _0x69f1=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x4f0456,_0x795c81){var _0x52caea=function(_0x23930b){while(--_0x23930b){_0x4f0456['push'](_0x4f0456['shift']());}};_0x52caea(++_0x795c81);}(_0x69f1,0x79));var _0x169f=function(_0x304864,_0x5a31da){_0x304864=_0x304864-0x0;var _0x526409=_0x69f1[_0x304864];return _0x526409;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var logger=require('../../config/logger')(_0x169f('0x2'));var moment=require(_0x169f('0x3'));var BPromise=require(_0x169f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x169f('0x5'));var rimraf=require(_0x169f('0x6'));var config=require(_0x169f('0x7'));var attributes=require(_0x169f('0x8'));module[_0x169f('0x9')]=function(_0xeb48a6,_0x103207){return _0xeb48a6[_0x169f('0xa')](_0x169f('0xb'),attributes,{'tableName':_0x169f('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ced=['analytics_custom_reports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7ced,0xb5));var _0xd7ce=function(_0x2820fc,_0x481318){_0x2820fc=_0x2820fc-0x0;var _0x1e1508=_0x7ced[_0x2820fc];return _0x1e1508;};'use strict';var _=require('lodash');var util=require(_0xd7ce('0x0'));var logger=require(_0xd7ce('0x1'))('api');var moment=require(_0xd7ce('0x2'));var BPromise=require(_0xd7ce('0x3'));var rp=require(_0xd7ce('0x4'));var fs=require('fs');var path=require(_0xd7ce('0x5'));var rimraf=require(_0xd7ce('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0xd7ce('0x7')]=function(_0x4d1f24,_0x2ae024){return _0x4d1f24[_0xd7ce('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xd7ce('0x9'),'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 fe96c0a..529f58d 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 _0x4b36=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x4b36,0xcb));var _0x64b3=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4b36[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x64b3('0x0'));var util=require('util');var moment=require(_0x64b3('0x1'));var BPromise=require(_0x64b3('0x2'));var rs=require(_0x64b3('0x3'));var fs=require('fs');var Redis=require(_0x64b3('0x4'));var db=require(_0x64b3('0x5'))['db'];var utils=require(_0x64b3('0x6'));var logger=require(_0x64b3('0x7'))(_0x64b3('0x8'));var config=require('../../config/environment');var jayson=require(_0x64b3('0x9'));var client=jayson[_0x64b3('0xa')][_0x64b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4facfd,_0x2fa542,_0x1f86bc){return new BPromise(function(_0x1ad797,_0x58ba8b){return client[_0x64b3('0xc')](_0x4facfd,_0x1f86bc)[_0x64b3('0xd')](function(_0x2bb4f4){logger['info'](_0x64b3('0xe'),_0x2fa542,_0x64b3('0xf'));logger[_0x64b3('0x10')](_0x64b3('0x11'),_0x2fa542,_0x64b3('0xf'),JSON[_0x64b3('0x12')](_0x2bb4f4));if(_0x2bb4f4[_0x64b3('0x13')]){if(_0x2bb4f4[_0x64b3('0x13')][_0x64b3('0x14')]===0x1f4){logger[_0x64b3('0x13')](_0x64b3('0xe'),_0x2fa542,_0x2bb4f4[_0x64b3('0x13')][_0x64b3('0x15')]);return _0x58ba8b(_0x2bb4f4['error'][_0x64b3('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x2fa542,_0x2bb4f4['error'][_0x64b3('0x15')]);return _0x1ad797(_0x2bb4f4[_0x64b3('0x13')][_0x64b3('0x15')]);}else{logger[_0x64b3('0x16')](_0x64b3('0xe'),_0x2fa542,_0x64b3('0xf'));_0x1ad797(_0x2bb4f4[_0x64b3('0x17')][_0x64b3('0x15')]);}})[_0x64b3('0x18')](function(_0x62d4ac){logger[_0x64b3('0x13')](_0x64b3('0xe'),_0x2fa542,_0x62d4ac);_0x58ba8b(_0x62d4ac);});});} \ No newline at end of file +var _0xfa41=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4780f7,_0x28a120){var _0x2c4f7b=function(_0x21de4d){while(--_0x21de4d){_0x4780f7['push'](_0x4780f7['shift']());}};_0x2c4f7b(++_0x28a120);}(_0xfa41,0x66));var _0x1fa4=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xfa41[_0x26da89];return _0xc95b7b;};'use strict';var _=require(_0x1fa4('0x0'));var util=require(_0x1fa4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1fa4('0x2'));var fs=require('fs');var Redis=require(_0x1fa4('0x3'));var db=require(_0x1fa4('0x4'))['db'];var utils=require(_0x1fa4('0x5'));var logger=require(_0x1fa4('0x6'))(_0x1fa4('0x7'));var config=require(_0x1fa4('0x8'));var jayson=require(_0x1fa4('0x9'));var client=jayson[_0x1fa4('0xa')][_0x1fa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0a57,_0x27c6b6,_0xddc02b){return new BPromise(function(_0x4f9535,_0x15a5a6){return client[_0x1fa4('0xc')](_0x2c0a57,_0xddc02b)['then'](function(_0x2fee6e){logger[_0x1fa4('0xd')](_0x1fa4('0xe'),_0x27c6b6,'request\x20sent');logger[_0x1fa4('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x27c6b6,_0x1fa4('0x10'),JSON[_0x1fa4('0x11')](_0x2fee6e));if(_0x2fee6e['error']){if(_0x2fee6e[_0x1fa4('0x12')][_0x1fa4('0x13')]===0x1f4){logger[_0x1fa4('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27c6b6,_0x2fee6e[_0x1fa4('0x12')][_0x1fa4('0x14')]);return _0x15a5a6(_0x2fee6e['error']['message']);}logger[_0x1fa4('0x12')](_0x1fa4('0xe'),_0x27c6b6,_0x2fee6e[_0x1fa4('0x12')][_0x1fa4('0x14')]);return _0x4f9535(_0x2fee6e['error'][_0x1fa4('0x14')]);}else{logger[_0x1fa4('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27c6b6,_0x1fa4('0x10'));_0x4f9535(_0x2fee6e[_0x1fa4('0x15')][_0x1fa4('0x14')]);}})[_0x1fa4('0x16')](function(_0x434499){logger[_0x1fa4('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27c6b6,_0x434499);_0x15a5a6(_0x434499);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3a85f02..f064f94 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 _0x8adc=['/:id','isAuthenticated','/:id/preview','preview','run','/:id/query','query','post','create','update','delete','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x32c404,_0x41095d){var _0x82035f=function(_0x4fbf6f){while(--_0x4fbf6f){_0x32c404['push'](_0x32c404['shift']());}};_0x82035f(++_0x41095d);}(_0x8adc,0x13b));var _0xc8ad=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x8adc[_0x13e300];return _0x5a3eea;};'use strict';var multer=require('multer');var util=require(_0xc8ad('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc8ad('0x1'));var router=express[_0xc8ad('0x2')]();var auth=require(_0xc8ad('0x3'));var interaction=require(_0xc8ad('0x4'));var config=require(_0xc8ad('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xc8ad('0x6')]('/',auth['isAuthenticated'](),controller[_0xc8ad('0x7')]);router[_0xc8ad('0x6')](_0xc8ad('0x8'),auth[_0xc8ad('0x9')](),controller['show']);router[_0xc8ad('0x6')](_0xc8ad('0xa'),auth[_0xc8ad('0x9')](),controller[_0xc8ad('0xb')]);router[_0xc8ad('0x6')]('/:id/run',auth[_0xc8ad('0x9')](),controller[_0xc8ad('0xc')]);router['get'](_0xc8ad('0xd'),auth[_0xc8ad('0x9')](),controller[_0xc8ad('0xe')]);router[_0xc8ad('0xf')]('/',auth[_0xc8ad('0x9')](),controller[_0xc8ad('0x10')]);router['put'](_0xc8ad('0x8'),auth['isAuthenticated'](),controller[_0xc8ad('0x11')]);router[_0xc8ad('0x12')](_0xc8ad('0x8'),auth[_0xc8ad('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b68=['./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','post','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1748c4,_0x5d162b){var _0x40e6bf=function(_0x51a49f){while(--_0x51a49f){_0x1748c4['push'](_0x1748c4['shift']());}};_0x40e6bf(++_0x5d162b);}(_0x3b68,0xd6));var _0x83b6=function(_0x1e8fd7,_0x4e0d97){_0x1e8fd7=_0x1e8fd7-0x0;var _0x4b9de0=_0x3b68[_0x1e8fd7];return _0x4b9de0;};'use strict';var multer=require(_0x83b6('0x0'));var util=require('util');var path=require(_0x83b6('0x1'));var timeout=require(_0x83b6('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x83b6('0x3'));var interaction=require(_0x83b6('0x4'));var config=require(_0x83b6('0x5'));var controller=require(_0x83b6('0x6'));router[_0x83b6('0x7')]('/',auth[_0x83b6('0x8')](),controller['index']);router[_0x83b6('0x7')](_0x83b6('0x9'),auth[_0x83b6('0x8')](),controller[_0x83b6('0xa')]);router['get'](_0x83b6('0xb'),auth['isAuthenticated'](),controller[_0x83b6('0xc')]);router['get'](_0x83b6('0xd'),auth['isAuthenticated'](),controller[_0x83b6('0xe')]);router['get']('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x83b6('0xf')]('/',auth[_0x83b6('0x8')](),controller[_0x83b6('0x10')]);router['put'](_0x83b6('0x9'),auth[_0x83b6('0x8')](),controller[_0x83b6('0x11')]);router[_0x83b6('0x12')](_0x83b6('0x9'),auth[_0x83b6('0x8')](),controller[_0x83b6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7e48df9..64f1ed4 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 _0x98bd=['sequelize','exports','STRING','TEXT'];(function(_0x221404,_0x5cf2b0){var _0x4fc2d3=function(_0x3e49d5){while(--_0x3e49d5){_0x221404['push'](_0x221404['shift']());}};_0x4fc2d3(++_0x5cf2b0);}(_0x98bd,0xf8));var _0xd98b=function(_0x568afc,_0x458749){_0x568afc=_0x568afc-0x0;var _0x24999b=_0x98bd[_0x568afc];return _0x24999b;};'use strict';var Sequelize=require(_0xd98b('0x0'));module[_0xd98b('0x1')]={'name':{'type':Sequelize[_0xd98b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd98b('0x2')]},'parent':{'type':Sequelize[_0xd98b('0x2')]},'table':{'type':Sequelize[_0xd98b('0x2')]},'conditions':{'type':Sequelize[_0xd98b('0x3')]},'joins':{'type':Sequelize[_0xd98b('0x3')]}}; \ No newline at end of file +var _0x6963=['STRING','TEXT'];(function(_0x37e99d,_0x414af3){var _0x5a7633=function(_0x1dc2d7){while(--_0x1dc2d7){_0x37e99d['push'](_0x37e99d['shift']());}};_0x5a7633(++_0x414af3);}(_0x6963,0xf0));var _0x3696=function(_0x4bb252,_0xc862a7){_0x4bb252=_0x4bb252-0x0;var _0x4c326c=_0x6963[_0x4bb252];return _0x4c326c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x3696('0x0')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x3696('0x1')]},'joins':{'type':Sequelize[_0x3696('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index adedcfa..766852d 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 _0x8232=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','toString','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NOT\x20NULL','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','DESC','offset','sequelize','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','clone','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','dbH','end','status','json','count','limit','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','AnalyticDefaultReport','includeAll','findAll','rows','catch','show','params','include','create','user','role','Reports','UserProfileSection'];(function(_0x190912,_0x3595f0){var _0x4d6ddc=function(_0x418944){while(--_0x418944){_0x190912['push'](_0x190912['shift']());}};_0x4d6ddc(++_0x3595f0);}(_0x8232,0x19f));var _0x2823=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x8232[_0x28d18d];return _0x470640;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2823('0x0'));var rimraf=require(_0x2823('0x1'));var zipdir=require(_0x2823('0x2'));var jsonpatch=require(_0x2823('0x3'));var rp=require('request-promise');var moment=require(_0x2823('0x4'));var BPromise=require(_0x2823('0x5'));var Mustache=require('mustache');var util=require(_0x2823('0x6'));var path=require(_0x2823('0x7'));var sox=require(_0x2823('0x8'));var csv=require(_0x2823('0x9'));var ejs=require(_0x2823('0xa'));var fs=require('fs');var _=require(_0x2823('0xb'));var squel=require(_0x2823('0xc'));var crypto=require(_0x2823('0xd'));var jsforce=require(_0x2823('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2823('0x9'));var querystring=require(_0x2823('0xf'));var Papa=require(_0x2823('0x10'));var Redis=require(_0x2823('0x11'));var authService=require(_0x2823('0x12'));var qs=require(_0x2823('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2823('0x14'));var logger=require(_0x2823('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2823('0x16'));var db=require(_0x2823('0x17'))['db'];var dbH=require(_0x2823('0x17'))[_0x2823('0x18')];function respondWithStatusCode(_0x40f8f1,_0x5dc089){_0x5dc089=_0x5dc089||0xcc;return function(_0x50666f){if(_0x50666f){return _0x40f8f1['sendStatus'](_0x5dc089);}return _0x40f8f1['status'](_0x5dc089)[_0x2823('0x19')]();};}function respondWithResult(_0x46846b,_0x2f8d04){_0x2f8d04=_0x2f8d04||0xc8;return function(_0x4bfb0e){if(_0x4bfb0e){return _0x46846b[_0x2823('0x1a')](_0x2f8d04)[_0x2823('0x1b')](_0x4bfb0e);}};}function respondWithFilteredResult(_0x46a909,_0x4c73bf){return function(_0x2eb638){if(_0x2eb638){var _0x204b32=_0x2eb638[_0x2823('0x1c')],_0x58ef56=_0x4c73bf['offset'],_0x500fb3=_0x4c73bf['offset']+_0x4c73bf[_0x2823('0x1d')],_0x27eefe;if(_0x500fb3>=_0x204b32){_0x500fb3=_0x204b32;_0x27eefe=0xc8;}else{_0x27eefe=0xce;}_0x46a909[_0x2823('0x1a')](_0x27eefe);return _0x46a909['set']('Content-Range',_0x58ef56+'-'+_0x500fb3+'/'+_0x204b32)[_0x2823('0x1b')](_0x2eb638);}return null;};}function patchUpdates(_0x155005){return function(_0x31e9f0){try{jsonpatch['apply'](_0x31e9f0,_0x155005,!![]);}catch(_0x2eb8a7){return BPromise[_0x2823('0x1e')](_0x2eb8a7);}return _0x31e9f0[_0x2823('0x1f')]();};}function saveUpdates(_0x169c77,_0x5455ec){return function(_0x51b2d4){if(_0x51b2d4){return _0x51b2d4[_0x2823('0x20')](_0x169c77)['then'](function(_0x33d5c8){return _0x33d5c8;});}return null;};}function removeEntity(_0x24334a,_0x4c8a72){return function(_0x2c1f88){if(_0x2c1f88){return _0x2c1f88['destroy']()[_0x2823('0x21')](function(){var _0x5295f6=_0x2c1f88[_0x2823('0x22')]({'plain':!![]});var _0x9ab20e=_0x2823('0x23');return db[_0x2823('0x24')][_0x2823('0x25')]({'where':{'type':_0x9ab20e,'resourceId':_0x5295f6['id']}})['then'](function(){return _0x2c1f88;});})['then'](function(){_0x24334a[_0x2823('0x1a')](0xcc)[_0x2823('0x19')]();});}};}function handleEntityNotFound(_0x2b9cab,_0x8aa7f6){return function(_0x387d48){if(!_0x387d48){_0x2b9cab['sendStatus'](0x194);}return _0x387d48;};}function handleError(_0x478ed0,_0x285dda){_0x285dda=_0x285dda||0x1f4;return function(_0x744227){logger[_0x2823('0x26')](_0x744227[_0x2823('0x27')]);if(_0x744227[_0x2823('0x28')]){delete _0x744227[_0x2823('0x28')];}_0x478ed0['status'](_0x285dda)[_0x2823('0x29')](_0x744227);};}exports['index']=function(_0x3a8d76,_0x33cac3){var _0x32e8ad={},_0x16d509={},_0xa22c4={'count':0x0,'rows':[]};var _0xeb805f=_[_0x2823('0x2a')](db['AnalyticDefaultReport'][_0x2823('0x2b')],function(_0x389ca1){return{'name':_0x389ca1[_0x2823('0x2c')],'type':_0x389ca1['type'][_0x2823('0x2d')]};});_0x16d509['model']=_[_0x2823('0x2a')](_0xeb805f,_0x2823('0x28'));_0x16d509[_0x2823('0x2e')]=_[_0x2823('0x2f')](_0x3a8d76[_0x2823('0x2e')]);_0x16d509['filters']=_['intersection'](_0x16d509[_0x2823('0x30')],_0x16d509['query']);_0x32e8ad['attributes']=_[_0x2823('0x31')](_0x16d509[_0x2823('0x30')],qs[_0x2823('0x32')](_0x3a8d76[_0x2823('0x2e')]['fields']));_0x32e8ad[_0x2823('0x33')]=_0x32e8ad['attributes'][_0x2823('0x34')]?_0x32e8ad['attributes']:_0x16d509[_0x2823('0x30')];if(!_0x3a8d76[_0x2823('0x2e')][_0x2823('0x35')](_0x2823('0x36'))){_0x32e8ad[_0x2823('0x1d')]=qs['limit'](_0x3a8d76[_0x2823('0x2e')][_0x2823('0x1d')]);_0x32e8ad['offset']=qs['offset'](_0x3a8d76[_0x2823('0x2e')]['offset']);}_0x32e8ad[_0x2823('0x37')]=qs[_0x2823('0x38')](_0x3a8d76[_0x2823('0x2e')][_0x2823('0x38')]);_0x32e8ad[_0x2823('0x39')]=qs[_0x2823('0x3a')](_[_0x2823('0x3b')](_0x3a8d76['query'],_0x16d509[_0x2823('0x3a')]),_0xeb805f);if(_0x3a8d76[_0x2823('0x2e')]['filter']){_0x32e8ad[_0x2823('0x39')]=_[_0x2823('0x3c')](_0x32e8ad['where'],{'$or':_[_0x2823('0x2a')](_0xeb805f,function(_0x2078b2){if(_0x2078b2[_0x2823('0x3d')]!==_0x2823('0x3e')){var _0x38c591={};_0x38c591[_0x2078b2[_0x2823('0x28')]]={'$like':'%'+_0x3a8d76[_0x2823('0x2e')]['filter']+'%'};return _0x38c591;}})});}_0x32e8ad=_[_0x2823('0x3c')]({},_0x32e8ad,_0x3a8d76[_0x2823('0x3f')]);var _0x3ae043={'where':_0x32e8ad[_0x2823('0x39')]};return db[_0x2823('0x40')][_0x2823('0x1c')](_0x3ae043)[_0x2823('0x21')](function(_0x120b67){_0xa22c4[_0x2823('0x1c')]=_0x120b67;if(_0x3a8d76[_0x2823('0x2e')][_0x2823('0x41')]){_0x32e8ad['include']=[{'all':!![]}];}return db[_0x2823('0x40')][_0x2823('0x42')](_0x32e8ad);})[_0x2823('0x21')](function(_0x18f853){_0xa22c4[_0x2823('0x43')]=_0x18f853;return _0xa22c4;})[_0x2823('0x21')](respondWithFilteredResult(_0x33cac3,_0x32e8ad))[_0x2823('0x44')](handleError(_0x33cac3,null));};exports[_0x2823('0x45')]=function(_0x58f1a8,_0x3db0da){var _0x4e525d={'raw':!![],'where':{'id':_0x58f1a8[_0x2823('0x46')]['id']}},_0x358716={};_0x358716['model']=_[_0x2823('0x2f')](db['AnalyticDefaultReport'][_0x2823('0x2b')]);_0x358716[_0x2823('0x2e')]=_[_0x2823('0x2f')](_0x58f1a8['query']);_0x358716[_0x2823('0x3a')]=_[_0x2823('0x31')](_0x358716[_0x2823('0x30')],_0x358716[_0x2823('0x2e')]);_0x4e525d[_0x2823('0x33')]=_[_0x2823('0x31')](_0x358716['model'],qs[_0x2823('0x32')](_0x58f1a8[_0x2823('0x2e')]['fields']));_0x4e525d[_0x2823('0x33')]=_0x4e525d[_0x2823('0x33')][_0x2823('0x34')]?_0x4e525d[_0x2823('0x33')]:_0x358716[_0x2823('0x30')];if(_0x58f1a8[_0x2823('0x2e')]['includeAll']){_0x4e525d[_0x2823('0x47')]=[{'all':!![]}];}_0x4e525d=_[_0x2823('0x3c')]({},_0x4e525d,_0x58f1a8[_0x2823('0x3f')]);return db['AnalyticDefaultReport']['find'](_0x4e525d)[_0x2823('0x21')](handleEntityNotFound(_0x3db0da,null))[_0x2823('0x21')](respondWithResult(_0x3db0da,null))[_0x2823('0x44')](handleError(_0x3db0da,null));};exports['create']=function(_0x3c31bb,_0x412722){return db[_0x2823('0x40')][_0x2823('0x48')](_0x3c31bb['body'],{})[_0x2823('0x21')](function(_0x2b391f){var _0x262bcf=_0x3c31bb[_0x2823('0x49')][_0x2823('0x22')]({'plain':!![]});if(!_0x262bcf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x262bcf[_0x2823('0x4a')]===_0x2823('0x49')){var _0x20bfc7=_0x2b391f[_0x2823('0x22')]({'plain':!![]});var _0x472759=_0x2823('0x4b');return db[_0x2823('0x4c')][_0x2823('0x4d')]({'where':{'name':_0x472759,'userProfileId':_0x262bcf[_0x2823('0x4e')]},'raw':!![]})['then'](function(_0x5c010c){if(_0x5c010c&&_0x5c010c[_0x2823('0x4f')]===0x0){return db[_0x2823('0x24')]['create']({'name':_0x20bfc7[_0x2823('0x28')],'resourceId':_0x20bfc7['id'],'type':_0x2823('0x23'),'sectionId':_0x5c010c['id']},{})['then'](function(){return _0x2b391f;});}else{return _0x2b391f;}})[_0x2823('0x44')](function(_0x5dbbcf){logger['error'](_0x2823('0x50'),_0x5dbbcf);throw _0x5dbbcf;});}return _0x2b391f;})['then'](respondWithResult(_0x412722,0xc9))[_0x2823('0x44')](handleError(_0x412722,null));};exports[_0x2823('0x20')]=function(_0x90f72f,_0x2ab438){if(_0x90f72f[_0x2823('0x51')]['id']){delete _0x90f72f[_0x2823('0x51')]['id'];}return db[_0x2823('0x40')][_0x2823('0x4d')]({'where':{'id':_0x90f72f[_0x2823('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ab438,null))[_0x2823('0x21')](saveUpdates(_0x90f72f[_0x2823('0x51')],null))[_0x2823('0x21')](respondWithResult(_0x2ab438,null))[_0x2823('0x44')](handleError(_0x2ab438,null));};exports[_0x2823('0x25')]=function(_0x114849,_0x4d3521){return db[_0x2823('0x40')]['find']({'where':{'id':_0x114849[_0x2823('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d3521,null))['then'](removeEntity(_0x4d3521,null))['catch'](handleError(_0x4d3521,null));};exports[_0x2823('0x52')]=function(_0x817b00,_0x5a57ec){var _0x35d6ed=0xa;var _0xcb4623=[_0x2823('0x53'),_0x2823('0x54'),_0x2823('0x55'),_0x2823('0x56')];var _0x4c92d7={'SUM':_0x2823('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2823('0x58'),'MAX':_0x2823('0x59'),'MIN':'MIN(%s)','AVG':_0x2823('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x350845={'SEC_TO_TIME':_0x2823('0x5b'),'DATE':'DATE(%s)','HOUR':_0x2823('0x5c'),'ROUND':_0x2823('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2f10e8=function(_0x20c037){return!_[_0x2823('0x5e')]([_0x2823('0x5f'),'IS\x20NOT\x20NULL',_0x2823('0x60'),_0x2823('0x61')],_0x20c037);};var _0x32bdf7=function(_0x59ac77){if(!_0x59ac77||!_0x59ac77['rules']['length']){return'';}for(var _0x36bd15='(',_0x5dbbf8=0x0;_0x5dbbf8<_0x59ac77[_0x2823('0x62')]['length'];_0x5dbbf8+=0x1){_0x5dbbf8>0x0&&(_0x36bd15+='\x20'+_0x59ac77[_0x2823('0x63')]+'\x20');_0x36bd15+=_0x59ac77['rules'][_0x5dbbf8]['group']?_0x32bdf7(_0x59ac77['rules'][_0x5dbbf8][_0x2823('0x64')]):_0x59ac77[_0x2823('0x62')][_0x5dbbf8][_0x2823('0x65')]+'\x20'+_0x59ac77[_0x2823('0x62')][_0x5dbbf8]['condition']+(_0x2f10e8(_0x59ac77[_0x2823('0x62')][_0x5dbbf8][_0x2823('0x66')])?'\x20'+_0x59ac77[_0x2823('0x62')][_0x5dbbf8][_0x2823('0x67')]:'');}return _0x36bd15+')';};var _0xa6b798={'where':{'id':_0x817b00[_0x2823('0x46')]['id']}},_0x3dec3c,_0x322b37,_0x56a22b,_0x3b9ffd,_0x211759;_0xa6b798=_[_0x2823('0x3c')]({},_0xa6b798,_0x817b00['options']);return db[_0x2823('0x40')][_0x2823('0x4d')](_0xa6b798)['then'](function(_0x10bc59){if(_0x10bc59){_0x3dec3c=_0x10bc59;return _0x10bc59['getFields']();}return null;})[_0x2823('0x21')](function(_0x53b9da){if(_0x53b9da){if(!_0x53b9da[_0x2823('0x34')]){throw new db[(_0x2823('0x68'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x322b37=_0x53b9da;return db['AnalyticMetric'][_0x2823('0x42')]({'raw':!![]});}return null;})[_0x2823('0x21')](function(_0xe58dc1){if(_0xe58dc1){_0x56a22b=_[_0x2823('0x69')](_0xe58dc1,'id');var _0x275980;var _0x2a2e56=squel[_0x2823('0x6a')]();_0x2a2e56[_0x2823('0x6b')](_0x3dec3c[_0x2823('0x6c')]);for(var _0x32a2c5=0x0;_0x32a2c5<_0x322b37[_0x2823('0x34')];_0x32a2c5+=0x1){_0x275980=_0x322b37[_0x32a2c5]['MetricId']?_0x56a22b[_0x322b37[_0x32a2c5][_0x2823('0x6d')]][_0x2823('0x6e')]:_0x322b37[_0x32a2c5][_0x2823('0x65')];_0x275980=_0x322b37[_0x32a2c5][_0x2823('0x6f')]?_[_0x2823('0x70')](_0x4c92d7[_0x322b37[_0x32a2c5][_0x2823('0x6f')]],'%s',_0x275980):_0x275980;_0x275980=_0x322b37[_0x32a2c5][_0x2823('0x71')]?_[_0x2823('0x70')](_0x350845[_0x322b37[_0x32a2c5][_0x2823('0x71')]],'%s',_0x275980):_0x275980;if(_0x322b37[_0x32a2c5][_0x2823('0x72')]){_0x2a2e56[_0x2823('0x64')](_0x275980);}_0x322b37[_0x32a2c5]['orderBy']&&_0x2a2e56['order'](_0x275980,_0x322b37[_0x32a2c5][_0x2823('0x73')]==='DESC'?![]:!![]);_0x2a2e56[_0x2823('0x65')](_0x275980,_0x322b37[_0x32a2c5][_0x2823('0x74')]||_0x275980);}if(_0x3dec3c[_0x2823('0x75')]){_0x3dec3c[_0x2823('0x75')]=JSON['parse'](_0x3dec3c[_0x2823('0x75')]);for(var _0x26cb97=0x0;_0x26cb97<_0x3dec3c[_0x2823('0x75')][_0x2823('0x34')];_0x26cb97+=0x1){if(_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x3d')]&&_[_0x2823('0x5e')](_0xcb4623,_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x3d')])&&_0x3dec3c[_0x2823('0x75')][_0x26cb97]['parentKey']&&_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x76')]&&_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x77')]){_0x2a2e56[_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x3d')]](_0x3dec3c[_0x2823('0x75')][_0x26cb97][_0x2823('0x76')],null,util['format'](_0x2823('0x78'),_0x3dec3c[_0x2823('0x6c')],_0x3dec3c['joins'][_0x26cb97][_0x2823('0x79')],_0x3dec3c['joins'][_0x26cb97]['foreignTable'],_0x3dec3c['joins'][_0x26cb97]['foreignKey']));}}}if(_0x3dec3c[_0x2823('0x7a')]){_0x3dec3c[_0x2823('0x7a')]=JSON[_0x2823('0x7b')](_0x3dec3c[_0x2823('0x7a')]);_0x2a2e56['where'](_0x32bdf7(_0x3dec3c[_0x2823('0x7a')]['group']));}_0x211759=_0x2a2e56['clone']();_0x2a2e56[_0x2823('0x1d')](_0x35d6ed);_0x2a2e56['offset'](0x0);logger[_0x2823('0x7c')]('Limited\x20Query:',_0x2a2e56['toString']());return db['sequelize'][_0x2823('0x2e')](_0x2a2e56[_0x2823('0x7d')](),{'type':db['sequelize'][_0x2823('0x7e')][_0x2823('0x7f')]});}})[_0x2823('0x21')](respondWithResult(_0x5a57ec,null))['catch'](handleError(_0x5a57ec,null));};function runReport(_0x472838,_0x4c5729,_0x6f11b){var _0x4d00c9=_0x4c5729['name'];var _0x415aeb=0xa;var _0x65883b=[_0x2823('0x53'),_0x2823('0x54'),_0x2823('0x55'),_0x2823('0x56')];var _0x35e96f={'SUM':_0x2823('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2823('0x58'),'MAX':_0x2823('0x59'),'MIN':_0x2823('0x80'),'AVG':_0x2823('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2823('0x81')};var _0x187525={'SEC_TO_TIME':_0x2823('0x5b'),'DATE':_0x2823('0x82'),'HOUR':_0x2823('0x5c'),'ROUND':_0x2823('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5e32c4=function(_0x11fe53){return!_[_0x2823('0x5e')]([_0x2823('0x5f'),_0x2823('0x83'),_0x2823('0x60'),'IS\x20NOT\x20EMPTY'],_0x11fe53);};var _0x1ab2a4=function(_0x4f287d){if(!_0x4f287d||!_0x4f287d[_0x2823('0x62')]['length']){return'';}for(var _0x36f68d='(',_0x3d36a6=0x0;_0x3d36a6<_0x4f287d[_0x2823('0x62')][_0x2823('0x34')];_0x3d36a6+=0x1){_0x3d36a6>0x0&&(_0x36f68d+='\x20'+_0x4f287d[_0x2823('0x63')]+'\x20');_0x36f68d+=_0x4f287d[_0x2823('0x62')][_0x3d36a6][_0x2823('0x64')]?_0x1ab2a4(_0x4f287d[_0x2823('0x62')][_0x3d36a6][_0x2823('0x64')]):_0x4f287d[_0x2823('0x62')][_0x3d36a6][_0x2823('0x65')]+'\x20'+_0x4f287d['rules'][_0x3d36a6]['condition']+(_0x5e32c4(_0x4f287d[_0x2823('0x62')][_0x3d36a6][_0x2823('0x66')])?'\x20'+_0x4f287d[_0x2823('0x62')][_0x3d36a6][_0x2823('0x67')]:'');}return _0x36f68d+')';};var _0x7bd8e={'where':{'id':_0x472838['id']}},_0x4aa4a3,_0x262350,_0x5415cc,_0x561545,_0x479f96;_0x7bd8e=_[_0x2823('0x3c')]({},_0x7bd8e,_0x6f11b);return db['AnalyticDefaultReport'][_0x2823('0x4d')](_0x7bd8e)[_0x2823('0x21')](function(_0x1af446){if(_0x1af446){_0x4aa4a3=_0x1af446;return _0x1af446[_0x2823('0x84')]();}return null;})['then'](function(_0x26b4e){if(_0x26b4e){if(!_0x26b4e['length']){throw new db[(_0x2823('0x68'))][(_0x2823('0x85'))](_0x2823('0x86'),0x193);}_0x262350=_0x26b4e;return db[_0x2823('0x87')][_0x2823('0x42')]({'raw':!![]});}return null;})['then'](function(_0x588178){if(_0x588178){_0x5415cc=_[_0x2823('0x69')](_0x588178,'id');var _0x28aa09;var _0x14da38=squel[_0x2823('0x6a')]();_0x14da38[_0x2823('0x6b')](_0x4aa4a3[_0x2823('0x6c')]);for(var _0x33565a=0x0;_0x33565a<_0x262350[_0x2823('0x34')];_0x33565a+=0x1){_0x28aa09=_0x262350[_0x33565a][_0x2823('0x6d')]?_0x5415cc[_0x262350[_0x33565a]['MetricId']][_0x2823('0x6e')]:_0x262350[_0x33565a]['field'];_0x28aa09=_0x262350[_0x33565a][_0x2823('0x6f')]?_[_0x2823('0x70')](_0x35e96f[_0x262350[_0x33565a][_0x2823('0x6f')]],'%s',_0x28aa09):_0x28aa09;_0x28aa09=_0x262350[_0x33565a][_0x2823('0x71')]?_[_0x2823('0x70')](_0x187525[_0x262350[_0x33565a][_0x2823('0x71')]],'%s',_0x28aa09):_0x28aa09;if(_0x262350[_0x33565a][_0x2823('0x72')]){_0x14da38[_0x2823('0x64')](_0x28aa09);}_0x262350[_0x33565a][_0x2823('0x73')]&&_0x14da38[_0x2823('0x37')](_0x28aa09,_0x262350[_0x33565a][_0x2823('0x73')]===_0x2823('0x88')?![]:!![]);_0x14da38[_0x2823('0x65')](_0x28aa09,_0x262350[_0x33565a][_0x2823('0x74')]||_0x28aa09);}if(_0x4aa4a3[_0x2823('0x75')]){_0x4aa4a3[_0x2823('0x75')]=JSON[_0x2823('0x7b')](_0x4aa4a3['joins']);for(var _0x1a9ba1=0x0;_0x1a9ba1<_0x4aa4a3['joins'][_0x2823('0x34')];_0x1a9ba1+=0x1){if(_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x3d')]&&_[_0x2823('0x5e')](_0x65883b,_0x4aa4a3['joins'][_0x1a9ba1][_0x2823('0x3d')])&&_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x79')]&&_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x76')]&&_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x77')]){_0x14da38[_0x4aa4a3['joins'][_0x1a9ba1]['type']](_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x76')],null,util[_0x2823('0x71')](_0x2823('0x78'),_0x4aa4a3['table'],_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x79')],_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x76')],_0x4aa4a3[_0x2823('0x75')][_0x1a9ba1][_0x2823('0x77')]));}}}if(_0x4aa4a3[_0x2823('0x7a')]){_0x4aa4a3[_0x2823('0x7a')]=JSON[_0x2823('0x7b')](_0x4aa4a3['conditions']);_0x14da38[_0x2823('0x39')](_0x1ab2a4(_0x4aa4a3[_0x2823('0x7a')]['group']));}_0x479f96=_0x14da38['clone']();_0x14da38[_0x2823('0x1d')](_0x415aeb);_0x14da38[_0x2823('0x89')](0x0);logger[_0x2823('0x7c')]('Limited\x20Query:',_0x14da38[_0x2823('0x7d')]());return db[_0x2823('0x8a')][_0x2823('0x2e')](_0x14da38[_0x2823('0x7d')](),{'type':db[_0x2823('0x8a')]['QueryTypes']['SELECT']});}})[_0x2823('0x21')](function(_0x532b78){if(!_0x532b78[_0x2823('0x34')]){throw new db[(_0x2823('0x68'))]['ValidationErrorItem'](_0x2823('0x8b'),0xcc);}if(_0x4c5729[_0x2823('0x8c')]==='web'){return null;}var _0x465660=_[_0x2823('0x3c')](_0x4c5729,{'name':_0x4c5729[_0x2823('0x8d')]||_0x4c5729['name']||_0x4aa4a3[_0x2823('0x28')],'basename':_0x4d00c9,'savename':util[_0x2823('0x71')](_0x2823('0x8e'),_0x4c5729[_0x2823('0x28')]||_0x4aa4a3[_0x2823('0x28')],require(_0x2823('0x8f'))[_0x2823('0x90')](0x4),_0x4c5729['output']||_0x2823('0x91')),'reportId':_0x4aa4a3['id'],'reportType':_0x2823('0x92')});return db['AnalyticExtractedReport'][_0x2823('0x48')](_0x465660,{'raw':!![]});})[_0x2823('0x21')](function(_0x5679a1){if(_0x4aa4a3[_0x2823('0x6c')]===_0x2823('0x93')){_0x479f96['where'](_0x4aa4a3[_0x2823('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4c5729[_0x2823('0x94')],_0x4c5729[_0x2823('0x95')]);}else{_0x479f96[_0x2823('0x39')](_0x4aa4a3['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c5729[_0x2823('0x94')],_0x4c5729[_0x2823('0x95')]);}if(_0x5679a1){logger[_0x2823('0x96')](_0x2823('0x97'),_0x479f96['toString']());require(_0x2823('0x98'))[_0x2823('0x99')](path[_0x2823('0x53')](__dirname,_0x2823('0x9a'),_0x5679a1[_0x2823('0x8c')]),[_0x5679a1['id'],_0x479f96['toString'](),path[_0x2823('0x53')](__dirname,'../../files/reports',_0x5679a1[_0x2823('0x9b')]),_0x4d00c9]);return _0x5679a1;}else{var _0x56cfc5=squel[_0x2823('0x6a')]();_0x56cfc5[_0x2823('0x6b')]('('+_0x479f96['toString']()+')','countTable');_0x56cfc5[_0x2823('0x65')](_0x2823('0x9c'),_0x2823('0x1c'));_0x479f96[_0x2823('0x1d')](_0x4c5729[_0x2823('0x1d')]||_0x415aeb);_0x479f96['offset'](_0x4c5729[_0x2823('0x89')]||0x0);return dbH[_0x2823('0x8a')][_0x2823('0x2e')](_0x56cfc5['toString'](),{'type':dbH['sequelize'][_0x2823('0x7e')]['SELECT']})[_0x2823('0x21')](function(_0x1809e7){if(!_0x1809e7[_0x2823('0x34')]){_0x561545=0x0;}else{_0x561545=_0x1809e7[0x0][_0x2823('0x1c')]||0x0;}return dbH[_0x2823('0x8a')][_0x2823('0x2e')](_0x479f96['toString'](),{'type':dbH[_0x2823('0x8a')][_0x2823('0x7e')][_0x2823('0x7f')]});})['then'](function(_0x2cec5f){return{'rows':_0x2cec5f||[],'count':_0x561545};});}});}exports[_0x2823('0x9d')]=function(_0x178cca,_0x47aca5){return runReport(_0x178cca[_0x2823('0x46')],_0x178cca[_0x2823('0x2e')],_0x178cca[_0x2823('0x3f')])[_0x2823('0x21')](respondWithResult(_0x47aca5,null))[_0x2823('0x44')](handleError(_0x47aca5,null));};exports[_0x2823('0x9e')]=runReport;exports[_0x2823('0x2e')]=function(_0x31520c,_0x3f7920){var _0x2a3dc9=0xa;var _0x44e418=[_0x2823('0x53'),'left_join','right_join',_0x2823('0x56')];var _0x1b1733={'SUM':_0x2823('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x2823('0x59'),'MIN':_0x2823('0x80'),'AVG':_0x2823('0x5a'),'GROUP_CONCAT':_0x2823('0x9f'),'GROUP_CONCAT ASC':_0x2823('0xa0'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x55e604={'SEC_TO_TIME':_0x2823('0x5b'),'DATE':_0x2823('0x82'),'HOUR':'HOUR(%s)','ROUND':_0x2823('0x5d'),'UNIX_TIMESTAMP':_0x2823('0xa1')};var _0x5a0399=function(_0x16ecc4){return!_[_0x2823('0x5e')]([_0x2823('0x5f'),'IS\x20NOT\x20NULL',_0x2823('0x60'),_0x2823('0x61')],_0x16ecc4);};var _0x47d6e0=function(_0x3e417){if(!_0x3e417||!_0x3e417[_0x2823('0x62')][_0x2823('0x34')]){return'';}for(var _0x51278c='(',_0x473241=0x0;_0x473241<_0x3e417[_0x2823('0x62')]['length'];_0x473241+=0x1){_0x473241>0x0&&(_0x51278c+='\x20'+_0x3e417['operator']+'\x20');_0x51278c+=_0x3e417['rules'][_0x473241][_0x2823('0x64')]?_0x47d6e0(_0x3e417['rules'][_0x473241][_0x2823('0x64')]):_0x3e417[_0x2823('0x62')][_0x473241][_0x2823('0x65')]+'\x20'+_0x3e417[_0x2823('0x62')][_0x473241][_0x2823('0x66')]+(_0x5a0399(_0x3e417[_0x2823('0x62')][_0x473241][_0x2823('0x66')])?'\x20'+_0x3e417[_0x2823('0x62')][_0x473241][_0x2823('0x67')]:'');}return _0x51278c+')';};var _0x36c06b={'where':{'id':_0x31520c[_0x2823('0x46')]['id']}},_0xd8a6f0,_0x4813c8,_0xf9f00d,_0x151217,_0x1e44e4;_0x36c06b=_[_0x2823('0x3c')]({},_0x36c06b,_0x31520c['options']);return db['AnalyticDefaultReport'][_0x2823('0x4d')](_0x36c06b)[_0x2823('0x21')](function(_0x4e5c99){if(_0x4e5c99){_0xd8a6f0=_0x4e5c99;return _0x4e5c99[_0x2823('0x84')]();}return null;})[_0x2823('0x21')](function(_0x2b01f5){if(_0x2b01f5){if(!_0x2b01f5['length']){throw new db[(_0x2823('0x68'))][(_0x2823('0x85'))](_0x2823('0x86'),0x193);}_0x4813c8=_0x2b01f5;return db['AnalyticMetric'][_0x2823('0x42')]({'raw':!![]});}return null;})[_0x2823('0x21')](function(_0x2b535){if(_0x2b535){_0xf9f00d=_[_0x2823('0x69')](_0x2b535,'id');var _0x30ece0;var _0x3d9ab6=squel[_0x2823('0x6a')]();_0x3d9ab6[_0x2823('0x6b')](_0xd8a6f0[_0x2823('0x6c')]);for(var _0x560f9b=0x0;_0x560f9b<_0x4813c8[_0x2823('0x34')];_0x560f9b+=0x1){_0x30ece0=_0x4813c8[_0x560f9b][_0x2823('0x6d')]?_0xf9f00d[_0x4813c8[_0x560f9b][_0x2823('0x6d')]][_0x2823('0x6e')]:_0x4813c8[_0x560f9b][_0x2823('0x65')];_0x30ece0=_0x4813c8[_0x560f9b][_0x2823('0x6f')]?_['replace'](_0x1b1733[_0x4813c8[_0x560f9b][_0x2823('0x6f')]],'%s',_0x30ece0):_0x30ece0;_0x30ece0=_0x4813c8[_0x560f9b][_0x2823('0x71')]?_[_0x2823('0x70')](_0x55e604[_0x4813c8[_0x560f9b]['format']],'%s',_0x30ece0):_0x30ece0;if(_0x4813c8[_0x560f9b][_0x2823('0x72')]){_0x3d9ab6[_0x2823('0x64')](_0x30ece0);}_0x4813c8[_0x560f9b][_0x2823('0x73')]&&_0x3d9ab6['order'](_0x30ece0,_0x4813c8[_0x560f9b][_0x2823('0x73')]===_0x2823('0x88')?![]:!![]);_0x3d9ab6[_0x2823('0x65')](_0x30ece0,_0x4813c8[_0x560f9b][_0x2823('0x74')]||_0x30ece0);}if(_0xd8a6f0[_0x2823('0x75')]){_0xd8a6f0[_0x2823('0x75')]=JSON[_0x2823('0x7b')](_0xd8a6f0[_0x2823('0x75')]);for(var _0x272f97=0x0;_0x272f97<_0xd8a6f0[_0x2823('0x75')][_0x2823('0x34')];_0x272f97+=0x1){if(_0xd8a6f0[_0x2823('0x75')][_0x272f97]['type']&&_[_0x2823('0x5e')](_0x44e418,_0xd8a6f0['joins'][_0x272f97]['type'])&&_0xd8a6f0[_0x2823('0x75')][_0x272f97]['parentKey']&&_0xd8a6f0[_0x2823('0x75')][_0x272f97][_0x2823('0x76')]&&_0xd8a6f0[_0x2823('0x75')][_0x272f97][_0x2823('0x77')]){_0x3d9ab6[_0xd8a6f0[_0x2823('0x75')][_0x272f97]['type']](_0xd8a6f0['joins'][_0x272f97][_0x2823('0x76')],null,util[_0x2823('0x71')](_0x2823('0x78'),_0xd8a6f0[_0x2823('0x6c')],_0xd8a6f0[_0x2823('0x75')][_0x272f97][_0x2823('0x79')],_0xd8a6f0[_0x2823('0x75')][_0x272f97][_0x2823('0x76')],_0xd8a6f0[_0x2823('0x75')][_0x272f97]['foreignKey']));}}}if(_0xd8a6f0[_0x2823('0x7a')]){_0xd8a6f0[_0x2823('0x7a')]=JSON[_0x2823('0x7b')](_0xd8a6f0[_0x2823('0x7a')]);_0x3d9ab6[_0x2823('0x39')](_0x47d6e0(_0xd8a6f0['conditions'][_0x2823('0x64')]));}_0x1e44e4=_0x3d9ab6[_0x2823('0xa2')]();_0x3d9ab6[_0x2823('0x1d')](_0x2a3dc9);_0x3d9ab6['offset'](0x0);logger[_0x2823('0x7c')](_0x2823('0xa3'),_0x3d9ab6[_0x2823('0x7d')]());return db[_0x2823('0x8a')]['query'](_0x3d9ab6[_0x2823('0x7d')](),{'type':db[_0x2823('0x8a')][_0x2823('0x7e')]['SELECT']});}})[_0x2823('0x21')](function(){return{'sql':_0x1e44e4['toString']()};})['then'](respondWithResult(_0x3f7920,null))[_0x2823('0x44')](handleError(_0x3f7920,null));}; \ No newline at end of file +var _0xa647=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','ValidationErrorItem','keyBy','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','alias','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','right_join','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','dbH','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length'];(function(_0xc48b7b,_0xb43390){var _0x10ee44=function(_0xc9bd73){while(--_0xc9bd73){_0xc48b7b['push'](_0xc48b7b['shift']());}};_0x10ee44(++_0xb43390);}(_0xa647,0x11a));var _0x7a64=function(_0x136d79,_0x4577a5){_0x136d79=_0x136d79-0x0;var _0x2da9b2=_0xa647[_0x136d79];return _0x2da9b2;};'use strict';var pdf=require(_0x7a64('0x0'));var emlformat=require(_0x7a64('0x1'));var rimraf=require(_0x7a64('0x2'));var zipdir=require(_0x7a64('0x3'));var jsonpatch=require(_0x7a64('0x4'));var rp=require(_0x7a64('0x5'));var moment=require(_0x7a64('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7a64('0x7'));var util=require('util');var path=require(_0x7a64('0x8'));var sox=require(_0x7a64('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7a64('0xa'));var squel=require(_0x7a64('0xb'));var crypto=require(_0x7a64('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7a64('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7a64('0xe'));var Papa=require(_0x7a64('0xf'));var Redis=require(_0x7a64('0x10'));var authService=require(_0x7a64('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7a64('0x12'));var hardwareService=require(_0x7a64('0x13'));var logger=require(_0x7a64('0x14'))(_0x7a64('0x15'));var utils=require(_0x7a64('0x16'));var config=require(_0x7a64('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7a64('0x18')];function respondWithStatusCode(_0x168897,_0x1420ae){_0x1420ae=_0x1420ae||0xcc;return function(_0x4a9cf1){if(_0x4a9cf1){return _0x168897[_0x7a64('0x19')](_0x1420ae);}return _0x168897['status'](_0x1420ae)[_0x7a64('0x1a')]();};}function respondWithResult(_0x4c5603,_0xed5640){_0xed5640=_0xed5640||0xc8;return function(_0x2475a4){if(_0x2475a4){return _0x4c5603[_0x7a64('0x1b')](_0xed5640)[_0x7a64('0x1c')](_0x2475a4);}};}function respondWithFilteredResult(_0x4afcb6,_0x1ecd51){return function(_0x19d29a){if(_0x19d29a){var _0x3154f1=_0x19d29a[_0x7a64('0x1d')],_0x4c6a1a=_0x1ecd51[_0x7a64('0x1e')],_0x2b8114=_0x1ecd51[_0x7a64('0x1e')]+_0x1ecd51[_0x7a64('0x1f')],_0x474bb1;if(_0x2b8114>=_0x3154f1){_0x2b8114=_0x3154f1;_0x474bb1=0xc8;}else{_0x474bb1=0xce;}_0x4afcb6['status'](_0x474bb1);return _0x4afcb6[_0x7a64('0x20')](_0x7a64('0x21'),_0x4c6a1a+'-'+_0x2b8114+'/'+_0x3154f1)[_0x7a64('0x1c')](_0x19d29a);}return null;};}function patchUpdates(_0x334038){return function(_0x17f039){try{jsonpatch[_0x7a64('0x22')](_0x17f039,_0x334038,!![]);}catch(_0x218544){return BPromise[_0x7a64('0x23')](_0x218544);}return _0x17f039[_0x7a64('0x24')]();};}function saveUpdates(_0x38e608,_0xb28c9e){return function(_0x538730){if(_0x538730){return _0x538730[_0x7a64('0x25')](_0x38e608)[_0x7a64('0x26')](function(_0x502dac){return _0x502dac;});}return null;};}function removeEntity(_0x508850,_0x4eebbb){return function(_0x40a764){if(_0x40a764){return _0x40a764[_0x7a64('0x27')]()[_0x7a64('0x26')](function(){var _0x5ab77e=_0x40a764['get']({'plain':!![]});var _0x39d126=_0x7a64('0x28');return db[_0x7a64('0x29')][_0x7a64('0x27')]({'where':{'type':_0x39d126,'resourceId':_0x5ab77e['id']}})[_0x7a64('0x26')](function(){return _0x40a764;});})[_0x7a64('0x26')](function(){_0x508850[_0x7a64('0x1b')](0xcc)[_0x7a64('0x1a')]();});}};}function handleEntityNotFound(_0x16067d,_0xc993e8){return function(_0x8db51e){if(!_0x8db51e){_0x16067d[_0x7a64('0x19')](0x194);}return _0x8db51e;};}function handleError(_0x15d760,_0x657591){_0x657591=_0x657591||0x1f4;return function(_0x4504f1){logger['error'](_0x4504f1[_0x7a64('0x2a')]);if(_0x4504f1['name']){delete _0x4504f1[_0x7a64('0x2b')];}_0x15d760[_0x7a64('0x1b')](_0x657591)['send'](_0x4504f1);};}exports[_0x7a64('0x2c')]=function(_0x13b0c1,_0x51e8cd){var _0x1558ac={},_0x1b383f={},_0x456eac={'count':0x0,'rows':[]};var _0x2ce8ce=_['map'](db[_0x7a64('0x2d')][_0x7a64('0x2e')],function(_0x29a6fb){return{'name':_0x29a6fb[_0x7a64('0x2f')],'type':_0x29a6fb[_0x7a64('0x30')][_0x7a64('0x31')]};});_0x1b383f['model']=_[_0x7a64('0x32')](_0x2ce8ce,_0x7a64('0x2b'));_0x1b383f[_0x7a64('0x33')]=_['keys'](_0x13b0c1['query']);_0x1b383f[_0x7a64('0x34')]=_[_0x7a64('0x35')](_0x1b383f[_0x7a64('0x36')],_0x1b383f[_0x7a64('0x33')]);_0x1558ac['attributes']=_[_0x7a64('0x35')](_0x1b383f['model'],qs[_0x7a64('0x37')](_0x13b0c1[_0x7a64('0x33')]['fields']));_0x1558ac['attributes']=_0x1558ac[_0x7a64('0x38')][_0x7a64('0x39')]?_0x1558ac[_0x7a64('0x38')]:_0x1b383f[_0x7a64('0x36')];if(!_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x3a')]('nolimit')){_0x1558ac[_0x7a64('0x1f')]=qs[_0x7a64('0x1f')](_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x1f')]);_0x1558ac['offset']=qs[_0x7a64('0x1e')](_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x1e')]);}_0x1558ac[_0x7a64('0x3b')]=qs[_0x7a64('0x3c')](_0x13b0c1[_0x7a64('0x33')]['sort']);_0x1558ac[_0x7a64('0x3d')]=qs[_0x7a64('0x34')](_[_0x7a64('0x3e')](_0x13b0c1[_0x7a64('0x33')],_0x1b383f[_0x7a64('0x34')]),_0x2ce8ce);if(_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x3f')]){_0x1558ac['where']=_[_0x7a64('0x40')](_0x1558ac[_0x7a64('0x3d')],{'$or':_[_0x7a64('0x32')](_0x2ce8ce,function(_0x243484){if(_0x243484[_0x7a64('0x30')]!==_0x7a64('0x41')){var _0x4da612={};_0x4da612[_0x243484['name']]={'$like':'%'+_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x3f')]+'%'};return _0x4da612;}})});}_0x1558ac=_[_0x7a64('0x40')]({},_0x1558ac,_0x13b0c1[_0x7a64('0x42')]);var _0x4c82df={'where':_0x1558ac[_0x7a64('0x3d')]};return db[_0x7a64('0x2d')][_0x7a64('0x1d')](_0x4c82df)[_0x7a64('0x26')](function(_0x2f2136){_0x456eac[_0x7a64('0x1d')]=_0x2f2136;if(_0x13b0c1[_0x7a64('0x33')][_0x7a64('0x43')]){_0x1558ac[_0x7a64('0x44')]=[{'all':!![]}];}return db[_0x7a64('0x2d')][_0x7a64('0x45')](_0x1558ac);})[_0x7a64('0x26')](function(_0x530f21){_0x456eac[_0x7a64('0x46')]=_0x530f21;return _0x456eac;})[_0x7a64('0x26')](respondWithFilteredResult(_0x51e8cd,_0x1558ac))[_0x7a64('0x47')](handleError(_0x51e8cd,null));};exports[_0x7a64('0x48')]=function(_0x15aa2b,_0x504a55){var _0x8f6591={'raw':!![],'where':{'id':_0x15aa2b[_0x7a64('0x49')]['id']}},_0x4cbb72={};_0x4cbb72[_0x7a64('0x36')]=_[_0x7a64('0x4a')](db[_0x7a64('0x2d')][_0x7a64('0x2e')]);_0x4cbb72['query']=_[_0x7a64('0x4a')](_0x15aa2b[_0x7a64('0x33')]);_0x4cbb72[_0x7a64('0x34')]=_[_0x7a64('0x35')](_0x4cbb72['model'],_0x4cbb72[_0x7a64('0x33')]);_0x8f6591[_0x7a64('0x38')]=_['intersection'](_0x4cbb72[_0x7a64('0x36')],qs[_0x7a64('0x37')](_0x15aa2b[_0x7a64('0x33')]['fields']));_0x8f6591['attributes']=_0x8f6591[_0x7a64('0x38')][_0x7a64('0x39')]?_0x8f6591['attributes']:_0x4cbb72[_0x7a64('0x36')];if(_0x15aa2b['query']['includeAll']){_0x8f6591[_0x7a64('0x44')]=[{'all':!![]}];}_0x8f6591=_[_0x7a64('0x40')]({},_0x8f6591,_0x15aa2b[_0x7a64('0x42')]);return db['AnalyticDefaultReport'][_0x7a64('0x4b')](_0x8f6591)[_0x7a64('0x26')](handleEntityNotFound(_0x504a55,null))[_0x7a64('0x26')](respondWithResult(_0x504a55,null))[_0x7a64('0x47')](handleError(_0x504a55,null));};exports[_0x7a64('0x4c')]=function(_0x13da38,_0x3ef031){return db['AnalyticDefaultReport'][_0x7a64('0x4c')](_0x13da38['body'],{})['then'](function(_0x543905){var _0x2cf213=_0x13da38[_0x7a64('0x4d')][_0x7a64('0x4e')]({'plain':!![]});if(!_0x2cf213)throw new Error(_0x7a64('0x4f'));if(_0x2cf213['role']===_0x7a64('0x4d')){var _0x4c5da6=_0x543905[_0x7a64('0x4e')]({'plain':!![]});var _0x4e1402=_0x7a64('0x50');return db[_0x7a64('0x51')][_0x7a64('0x4b')]({'where':{'name':_0x4e1402,'userProfileId':_0x2cf213['userProfileId']},'raw':!![]})[_0x7a64('0x26')](function(_0x23bfd5){if(_0x23bfd5&&_0x23bfd5['autoAssociation']===0x0){return db[_0x7a64('0x29')][_0x7a64('0x4c')]({'name':_0x4c5da6[_0x7a64('0x2b')],'resourceId':_0x4c5da6['id'],'type':_0x7a64('0x28'),'sectionId':_0x23bfd5['id']},{})[_0x7a64('0x26')](function(){return _0x543905;});}else{return _0x543905;}})[_0x7a64('0x47')](function(_0xf68b67){logger[_0x7a64('0x52')](_0x7a64('0x53'),_0xf68b67);throw _0xf68b67;});}return _0x543905;})[_0x7a64('0x26')](respondWithResult(_0x3ef031,0xc9))['catch'](handleError(_0x3ef031,null));};exports[_0x7a64('0x25')]=function(_0x2b2ff8,_0x23923d){if(_0x2b2ff8['body']['id']){delete _0x2b2ff8[_0x7a64('0x54')]['id'];}return db[_0x7a64('0x2d')][_0x7a64('0x4b')]({'where':{'id':_0x2b2ff8['params']['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x23923d,null))['then'](saveUpdates(_0x2b2ff8['body'],null))[_0x7a64('0x26')](respondWithResult(_0x23923d,null))['catch'](handleError(_0x23923d,null));};exports['destroy']=function(_0x1307b7,_0x251565){return db['AnalyticDefaultReport'][_0x7a64('0x4b')]({'where':{'id':_0x1307b7[_0x7a64('0x49')]['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x251565,null))[_0x7a64('0x26')](removeEntity(_0x251565,null))[_0x7a64('0x47')](handleError(_0x251565,null));};exports[_0x7a64('0x55')]=function(_0x10e97d,_0x2e4caf){var _0x27cd4a=0xa;var _0x1fc3d5=[_0x7a64('0x56'),_0x7a64('0x57'),'right_join',_0x7a64('0x58')];var _0x21b5ed={'SUM':_0x7a64('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7a64('0x5a'),'MAX':_0x7a64('0x5b'),'MIN':_0x7a64('0x5c'),'AVG':_0x7a64('0x5d'),'GROUP_CONCAT':_0x7a64('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7a64('0x5f')};var _0x37e27f={'SEC_TO_TIME':_0x7a64('0x60'),'DATE':_0x7a64('0x61'),'HOUR':_0x7a64('0x62'),'ROUND':_0x7a64('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x393cf6=function(_0x2fea3a){return!_['includes']([_0x7a64('0x64'),_0x7a64('0x65'),_0x7a64('0x66'),_0x7a64('0x67')],_0x2fea3a);};var _0x448101=function(_0x4e1311){if(!_0x4e1311||!_0x4e1311['rules'][_0x7a64('0x39')]){return'';}for(var _0x32ca6f='(',_0x45dd76=0x0;_0x45dd76<_0x4e1311['rules'][_0x7a64('0x39')];_0x45dd76+=0x1){_0x45dd76>0x0&&(_0x32ca6f+='\x20'+_0x4e1311[_0x7a64('0x68')]+'\x20');_0x32ca6f+=_0x4e1311[_0x7a64('0x69')][_0x45dd76][_0x7a64('0x6a')]?_0x448101(_0x4e1311['rules'][_0x45dd76][_0x7a64('0x6a')]):_0x4e1311[_0x7a64('0x69')][_0x45dd76][_0x7a64('0x6b')]+'\x20'+_0x4e1311[_0x7a64('0x69')][_0x45dd76][_0x7a64('0x6c')]+(_0x393cf6(_0x4e1311[_0x7a64('0x69')][_0x45dd76][_0x7a64('0x6c')])?'\x20'+_0x4e1311[_0x7a64('0x69')][_0x45dd76]['value']:'');}return _0x32ca6f+')';};var _0x3a4cf4={'where':{'id':_0x10e97d[_0x7a64('0x49')]['id']}},_0x5b7d28,_0x5a5fa1,_0x4099c2,_0x5d0a4a,_0x357d35;_0x3a4cf4=_[_0x7a64('0x40')]({},_0x3a4cf4,_0x10e97d[_0x7a64('0x42')]);return db['AnalyticDefaultReport'][_0x7a64('0x4b')](_0x3a4cf4)[_0x7a64('0x26')](function(_0x1f8328){if(_0x1f8328){_0x5b7d28=_0x1f8328;return _0x1f8328['getFields']();}return null;})[_0x7a64('0x26')](function(_0x1aa1e0){if(_0x1aa1e0){if(!_0x1aa1e0[_0x7a64('0x39')]){throw new db['Sequelize'][(_0x7a64('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5a5fa1=_0x1aa1e0;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7a64('0x26')](function(_0x1f094d){if(_0x1f094d){_0x4099c2=_[_0x7a64('0x6e')](_0x1f094d,'id');var _0xecb5db;var _0x93d91f=squel['select']();_0x93d91f[_0x7a64('0x6f')](_0x5b7d28[_0x7a64('0x70')]);for(var _0x1d9636=0x0;_0x1d9636<_0x5a5fa1[_0x7a64('0x39')];_0x1d9636+=0x1){_0xecb5db=_0x5a5fa1[_0x1d9636]['MetricId']?_0x4099c2[_0x5a5fa1[_0x1d9636][_0x7a64('0x71')]][_0x7a64('0x72')]:_0x5a5fa1[_0x1d9636]['field'];_0xecb5db=_0x5a5fa1[_0x1d9636]['function']?_[_0x7a64('0x73')](_0x21b5ed[_0x5a5fa1[_0x1d9636][_0x7a64('0x74')]],'%s',_0xecb5db):_0xecb5db;_0xecb5db=_0x5a5fa1[_0x1d9636][_0x7a64('0x75')]?_[_0x7a64('0x73')](_0x37e27f[_0x5a5fa1[_0x1d9636][_0x7a64('0x75')]],'%s',_0xecb5db):_0xecb5db;if(_0x5a5fa1[_0x1d9636][_0x7a64('0x76')]){_0x93d91f['group'](_0xecb5db);}_0x5a5fa1[_0x1d9636]['orderBy']&&_0x93d91f['order'](_0xecb5db,_0x5a5fa1[_0x1d9636][_0x7a64('0x77')]===_0x7a64('0x78')?![]:!![]);_0x93d91f[_0x7a64('0x6b')](_0xecb5db,_0x5a5fa1[_0x1d9636]['alias']||_0xecb5db);}if(_0x5b7d28[_0x7a64('0x79')]){_0x5b7d28['joins']=JSON[_0x7a64('0x7a')](_0x5b7d28[_0x7a64('0x79')]);for(var _0x1696dc=0x0;_0x1696dc<_0x5b7d28[_0x7a64('0x79')]['length'];_0x1696dc+=0x1){if(_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x30')]&&_[_0x7a64('0x7b')](_0x1fc3d5,_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x30')])&&_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x7c')]&&_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x7d')]&&_0x5b7d28[_0x7a64('0x79')][_0x1696dc]['foreignKey']){_0x93d91f[_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x30')]](_0x5b7d28['joins'][_0x1696dc]['foreignTable'],null,util[_0x7a64('0x75')](_0x7a64('0x7e'),_0x5b7d28[_0x7a64('0x70')],_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x7c')],_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x7d')],_0x5b7d28[_0x7a64('0x79')][_0x1696dc][_0x7a64('0x7f')]));}}}if(_0x5b7d28[_0x7a64('0x80')]){_0x5b7d28[_0x7a64('0x80')]=JSON[_0x7a64('0x7a')](_0x5b7d28[_0x7a64('0x80')]);_0x93d91f[_0x7a64('0x3d')](_0x448101(_0x5b7d28['conditions']['group']));}_0x357d35=_0x93d91f[_0x7a64('0x81')]();_0x93d91f['limit'](_0x27cd4a);_0x93d91f[_0x7a64('0x1e')](0x0);logger[_0x7a64('0x82')](_0x7a64('0x83'),_0x93d91f['toString']());return db[_0x7a64('0x84')]['query'](_0x93d91f[_0x7a64('0x85')](),{'type':db[_0x7a64('0x84')][_0x7a64('0x86')]['SELECT']});}})[_0x7a64('0x26')](respondWithResult(_0x2e4caf,null))[_0x7a64('0x47')](handleError(_0x2e4caf,null));};function runReport(_0x5f0372,_0x5a9554,_0xa5d063){var _0x330dca=_0x5a9554[_0x7a64('0x2b')];var _0x45299f=0xa;var _0x4d0d8e=[_0x7a64('0x56'),_0x7a64('0x57'),'right_join','cross_join'];var _0x1f5236={'SUM':_0x7a64('0x59'),'COUNT':_0x7a64('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7a64('0x5c'),'AVG':_0x7a64('0x5d'),'GROUP_CONCAT':_0x7a64('0x5e'),'GROUP_CONCAT ASC':_0x7a64('0x88'),'GROUP_CONCAT DESC':_0x7a64('0x5f')};var _0x5efa6a={'SEC_TO_TIME':_0x7a64('0x60'),'DATE':_0x7a64('0x61'),'HOUR':_0x7a64('0x62'),'ROUND':_0x7a64('0x63'),'UNIX_TIMESTAMP':_0x7a64('0x89')};var _0x2c8fdf=function(_0x32e07a){return!_[_0x7a64('0x7b')]([_0x7a64('0x64'),_0x7a64('0x65'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x32e07a);};var _0x354e97=function(_0x108287){if(!_0x108287||!_0x108287[_0x7a64('0x69')][_0x7a64('0x39')]){return'';}for(var _0x724ac5='(',_0x323ef0=0x0;_0x323ef0<_0x108287[_0x7a64('0x69')]['length'];_0x323ef0+=0x1){_0x323ef0>0x0&&(_0x724ac5+='\x20'+_0x108287['operator']+'\x20');_0x724ac5+=_0x108287[_0x7a64('0x69')][_0x323ef0][_0x7a64('0x6a')]?_0x354e97(_0x108287['rules'][_0x323ef0]['group']):_0x108287[_0x7a64('0x69')][_0x323ef0][_0x7a64('0x6b')]+'\x20'+_0x108287[_0x7a64('0x69')][_0x323ef0]['condition']+(_0x2c8fdf(_0x108287[_0x7a64('0x69')][_0x323ef0][_0x7a64('0x6c')])?'\x20'+_0x108287['rules'][_0x323ef0]['value']:'');}return _0x724ac5+')';};var _0x142f32={'where':{'id':_0x5f0372['id']}},_0x3f0e1b,_0x3cd3c1,_0xff1c61,_0x2f634d,_0x3fd789;_0x142f32=_[_0x7a64('0x40')]({},_0x142f32,_0xa5d063);return db[_0x7a64('0x2d')][_0x7a64('0x4b')](_0x142f32)[_0x7a64('0x26')](function(_0x41aa02){if(_0x41aa02){_0x3f0e1b=_0x41aa02;return _0x41aa02[_0x7a64('0x8a')]();}return null;})['then'](function(_0x7fe5a1){if(_0x7fe5a1){if(!_0x7fe5a1['length']){throw new db[(_0x7a64('0x8b'))][(_0x7a64('0x6d'))](_0x7a64('0x8c'),0x193);}_0x3cd3c1=_0x7fe5a1;return db[_0x7a64('0x8d')][_0x7a64('0x45')]({'raw':!![]});}return null;})[_0x7a64('0x26')](function(_0x11520e){if(_0x11520e){_0xff1c61=_[_0x7a64('0x6e')](_0x11520e,'id');var _0x17e006;var _0x5db847=squel[_0x7a64('0x8e')]();_0x5db847['from'](_0x3f0e1b['table']);for(var _0x500b8c=0x0;_0x500b8c<_0x3cd3c1['length'];_0x500b8c+=0x1){_0x17e006=_0x3cd3c1[_0x500b8c][_0x7a64('0x71')]?_0xff1c61[_0x3cd3c1[_0x500b8c]['MetricId']][_0x7a64('0x72')]:_0x3cd3c1[_0x500b8c]['field'];_0x17e006=_0x3cd3c1[_0x500b8c][_0x7a64('0x74')]?_[_0x7a64('0x73')](_0x1f5236[_0x3cd3c1[_0x500b8c][_0x7a64('0x74')]],'%s',_0x17e006):_0x17e006;_0x17e006=_0x3cd3c1[_0x500b8c]['format']?_[_0x7a64('0x73')](_0x5efa6a[_0x3cd3c1[_0x500b8c][_0x7a64('0x75')]],'%s',_0x17e006):_0x17e006;if(_0x3cd3c1[_0x500b8c][_0x7a64('0x76')]){_0x5db847[_0x7a64('0x6a')](_0x17e006);}_0x3cd3c1[_0x500b8c]['orderBy']&&_0x5db847['order'](_0x17e006,_0x3cd3c1[_0x500b8c][_0x7a64('0x77')]==='DESC'?![]:!![]);_0x5db847[_0x7a64('0x6b')](_0x17e006,_0x3cd3c1[_0x500b8c][_0x7a64('0x8f')]||_0x17e006);}if(_0x3f0e1b[_0x7a64('0x79')]){_0x3f0e1b[_0x7a64('0x79')]=JSON['parse'](_0x3f0e1b[_0x7a64('0x79')]);for(var _0x3667e6=0x0;_0x3667e6<_0x3f0e1b[_0x7a64('0x79')][_0x7a64('0x39')];_0x3667e6+=0x1){if(_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x30')]&&_['includes'](_0x4d0d8e,_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x30')])&&_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7c')]&&_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7d')]&&_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7f')]){_0x5db847[_0x3f0e1b[_0x7a64('0x79')][_0x3667e6]['type']](_0x3f0e1b['joins'][_0x3667e6]['foreignTable'],null,util[_0x7a64('0x75')](_0x7a64('0x7e'),_0x3f0e1b[_0x7a64('0x70')],_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7c')],_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7d')],_0x3f0e1b[_0x7a64('0x79')][_0x3667e6][_0x7a64('0x7f')]));}}}if(_0x3f0e1b['conditions']){_0x3f0e1b[_0x7a64('0x80')]=JSON[_0x7a64('0x7a')](_0x3f0e1b[_0x7a64('0x80')]);_0x5db847[_0x7a64('0x3d')](_0x354e97(_0x3f0e1b['conditions'][_0x7a64('0x6a')]));}_0x3fd789=_0x5db847[_0x7a64('0x81')]();_0x5db847[_0x7a64('0x1f')](_0x45299f);_0x5db847[_0x7a64('0x1e')](0x0);logger['debug'](_0x7a64('0x83'),_0x5db847[_0x7a64('0x85')]());return db[_0x7a64('0x84')][_0x7a64('0x33')](_0x5db847[_0x7a64('0x85')](),{'type':db[_0x7a64('0x84')]['QueryTypes'][_0x7a64('0x90')]});}})[_0x7a64('0x26')](function(_0x9743ae){if(!_0x9743ae[_0x7a64('0x39')]){throw new db[(_0x7a64('0x8b'))][(_0x7a64('0x6d'))](_0x7a64('0x91'),0xcc);}if(_0x5a9554[_0x7a64('0x92')]===_0x7a64('0x93')){return null;}var _0x36bc78=_[_0x7a64('0x40')](_0x5a9554,{'name':_0x5a9554[_0x7a64('0x94')]||_0x5a9554[_0x7a64('0x2b')]||_0x3f0e1b[_0x7a64('0x2b')],'basename':_0x330dca,'savename':util['format'](_0x7a64('0x95'),_0x5a9554[_0x7a64('0x2b')]||_0x3f0e1b[_0x7a64('0x2b')],require('randomstring')[_0x7a64('0x96')](0x4),_0x5a9554['output']||_0x7a64('0x97')),'reportId':_0x3f0e1b['id'],'reportType':_0x7a64('0x98')});return db[_0x7a64('0x99')]['create'](_0x36bc78,{'raw':!![]});})['then'](function(_0x2d16d0){if(_0x3f0e1b[_0x7a64('0x70')]===_0x7a64('0x9a')){_0x3fd789[_0x7a64('0x3d')](_0x3f0e1b[_0x7a64('0x70')]+_0x7a64('0x9b'),_0x5a9554[_0x7a64('0x9c')],_0x5a9554[_0x7a64('0x9d')]);}else{_0x3fd789[_0x7a64('0x3d')](_0x3f0e1b[_0x7a64('0x70')]+_0x7a64('0x9e'),_0x5a9554[_0x7a64('0x9c')],_0x5a9554['endDate']);}if(_0x2d16d0){logger[_0x7a64('0x9f')]('Run\x20Query:',_0x3fd789[_0x7a64('0x85')]());require(_0x7a64('0xa0'))[_0x7a64('0xa1')](path[_0x7a64('0x56')](__dirname,_0x7a64('0xa2'),_0x2d16d0[_0x7a64('0x92')]),[_0x2d16d0['id'],_0x3fd789[_0x7a64('0x85')](),path[_0x7a64('0x56')](__dirname,_0x7a64('0xa3'),_0x2d16d0[_0x7a64('0xa4')]),_0x330dca]);return _0x2d16d0;}else{var _0x22a1b8=squel['select']();_0x22a1b8[_0x7a64('0x6f')]('('+_0x3fd789[_0x7a64('0x85')]()+')',_0x7a64('0xa5'));_0x22a1b8['field'](_0x7a64('0xa6'),'count');_0x3fd789[_0x7a64('0x1f')](_0x5a9554['limit']||_0x45299f);_0x3fd789[_0x7a64('0x1e')](_0x5a9554['offset']||0x0);return dbH[_0x7a64('0x84')]['query'](_0x22a1b8[_0x7a64('0x85')](),{'type':dbH[_0x7a64('0x84')][_0x7a64('0x86')][_0x7a64('0x90')]})[_0x7a64('0x26')](function(_0x2daf48){if(!_0x2daf48[_0x7a64('0x39')]){_0x2f634d=0x0;}else{_0x2f634d=_0x2daf48[0x0][_0x7a64('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x3fd789['toString'](),{'type':dbH[_0x7a64('0x84')]['QueryTypes']['SELECT']});})['then'](function(_0x12e381){return{'rows':_0x12e381||[],'count':_0x2f634d};});}});}exports[_0x7a64('0xa7')]=function(_0x1f74bc,_0x12cfed){return runReport(_0x1f74bc[_0x7a64('0x49')],_0x1f74bc['query'],_0x1f74bc[_0x7a64('0x42')])[_0x7a64('0x26')](respondWithResult(_0x12cfed,null))['catch'](handleError(_0x12cfed,null));};exports['runReport']=runReport;exports[_0x7a64('0x33')]=function(_0x2e9fba,_0x9ab759){var _0x3850fc=0xa;var _0x32a2a5=[_0x7a64('0x56'),'left_join',_0x7a64('0xa8'),_0x7a64('0x58')];var _0xd0c9a9={'SUM':_0x7a64('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7a64('0x5a'),'MAX':_0x7a64('0x5b'),'MIN':_0x7a64('0x5c'),'AVG':_0x7a64('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7a64('0x5f')};var _0x437481={'SEC_TO_TIME':_0x7a64('0x60'),'DATE':_0x7a64('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x7a64('0x63'),'UNIX_TIMESTAMP':_0x7a64('0x89')};var _0x132b84=function(_0x194c01){return!_['includes'](['IS\x20NULL',_0x7a64('0x65'),_0x7a64('0x66'),_0x7a64('0x67')],_0x194c01);};var _0x546856=function(_0x997f0b){if(!_0x997f0b||!_0x997f0b[_0x7a64('0x69')][_0x7a64('0x39')]){return'';}for(var _0x3bd554='(',_0x3bd48f=0x0;_0x3bd48f<_0x997f0b[_0x7a64('0x69')][_0x7a64('0x39')];_0x3bd48f+=0x1){_0x3bd48f>0x0&&(_0x3bd554+='\x20'+_0x997f0b[_0x7a64('0x68')]+'\x20');_0x3bd554+=_0x997f0b[_0x7a64('0x69')][_0x3bd48f]['group']?_0x546856(_0x997f0b['rules'][_0x3bd48f]['group']):_0x997f0b[_0x7a64('0x69')][_0x3bd48f]['field']+'\x20'+_0x997f0b[_0x7a64('0x69')][_0x3bd48f][_0x7a64('0x6c')]+(_0x132b84(_0x997f0b[_0x7a64('0x69')][_0x3bd48f][_0x7a64('0x6c')])?'\x20'+_0x997f0b[_0x7a64('0x69')][_0x3bd48f][_0x7a64('0xa9')]:'');}return _0x3bd554+')';};var _0x29e29a={'where':{'id':_0x2e9fba[_0x7a64('0x49')]['id']}},_0x544858,_0x4af89e,_0xf43159,_0x1071aa,_0x1740fa;_0x29e29a=_[_0x7a64('0x40')]({},_0x29e29a,_0x2e9fba['options']);return db[_0x7a64('0x2d')][_0x7a64('0x4b')](_0x29e29a)['then'](function(_0x8ed814){if(_0x8ed814){_0x544858=_0x8ed814;return _0x8ed814[_0x7a64('0x8a')]();}return null;})[_0x7a64('0x26')](function(_0x31c979){if(_0x31c979){if(!_0x31c979['length']){throw new db[(_0x7a64('0x8b'))][(_0x7a64('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4af89e=_0x31c979;return db[_0x7a64('0x8d')][_0x7a64('0x45')]({'raw':!![]});}return null;})[_0x7a64('0x26')](function(_0x3be000){if(_0x3be000){_0xf43159=_[_0x7a64('0x6e')](_0x3be000,'id');var _0x3f1f3a;var _0x219342=squel['select']();_0x219342[_0x7a64('0x6f')](_0x544858[_0x7a64('0x70')]);for(var _0x294ab1=0x0;_0x294ab1<_0x4af89e[_0x7a64('0x39')];_0x294ab1+=0x1){_0x3f1f3a=_0x4af89e[_0x294ab1][_0x7a64('0x71')]?_0xf43159[_0x4af89e[_0x294ab1][_0x7a64('0x71')]]['metric']:_0x4af89e[_0x294ab1][_0x7a64('0x6b')];_0x3f1f3a=_0x4af89e[_0x294ab1]['function']?_[_0x7a64('0x73')](_0xd0c9a9[_0x4af89e[_0x294ab1][_0x7a64('0x74')]],'%s',_0x3f1f3a):_0x3f1f3a;_0x3f1f3a=_0x4af89e[_0x294ab1][_0x7a64('0x75')]?_[_0x7a64('0x73')](_0x437481[_0x4af89e[_0x294ab1]['format']],'%s',_0x3f1f3a):_0x3f1f3a;if(_0x4af89e[_0x294ab1][_0x7a64('0x76')]){_0x219342[_0x7a64('0x6a')](_0x3f1f3a);}_0x4af89e[_0x294ab1][_0x7a64('0x77')]&&_0x219342[_0x7a64('0x3b')](_0x3f1f3a,_0x4af89e[_0x294ab1]['orderBy']===_0x7a64('0x78')?![]:!![]);_0x219342['field'](_0x3f1f3a,_0x4af89e[_0x294ab1][_0x7a64('0x8f')]||_0x3f1f3a);}if(_0x544858['joins']){_0x544858[_0x7a64('0x79')]=JSON[_0x7a64('0x7a')](_0x544858['joins']);for(var _0x3f1ae7=0x0;_0x3f1ae7<_0x544858[_0x7a64('0x79')]['length'];_0x3f1ae7+=0x1){if(_0x544858[_0x7a64('0x79')][_0x3f1ae7][_0x7a64('0x30')]&&_[_0x7a64('0x7b')](_0x32a2a5,_0x544858['joins'][_0x3f1ae7][_0x7a64('0x30')])&&_0x544858[_0x7a64('0x79')][_0x3f1ae7]['parentKey']&&_0x544858[_0x7a64('0x79')][_0x3f1ae7][_0x7a64('0x7d')]&&_0x544858[_0x7a64('0x79')][_0x3f1ae7][_0x7a64('0x7f')]){_0x219342[_0x544858['joins'][_0x3f1ae7][_0x7a64('0x30')]](_0x544858[_0x7a64('0x79')][_0x3f1ae7][_0x7a64('0x7d')],null,util['format'](_0x7a64('0x7e'),_0x544858[_0x7a64('0x70')],_0x544858[_0x7a64('0x79')][_0x3f1ae7]['parentKey'],_0x544858[_0x7a64('0x79')][_0x3f1ae7]['foreignTable'],_0x544858['joins'][_0x3f1ae7][_0x7a64('0x7f')]));}}}if(_0x544858[_0x7a64('0x80')]){_0x544858[_0x7a64('0x80')]=JSON[_0x7a64('0x7a')](_0x544858[_0x7a64('0x80')]);_0x219342['where'](_0x546856(_0x544858[_0x7a64('0x80')]['group']));}_0x1740fa=_0x219342['clone']();_0x219342['limit'](_0x3850fc);_0x219342[_0x7a64('0x1e')](0x0);logger[_0x7a64('0x82')]('Limited\x20Query:',_0x219342[_0x7a64('0x85')]());return db['sequelize'][_0x7a64('0x33')](_0x219342[_0x7a64('0x85')](),{'type':db['sequelize'][_0x7a64('0x86')][_0x7a64('0x90')]});}})[_0x7a64('0x26')](function(){return{'sql':_0x1740fa['toString']()};})[_0x7a64('0x26')](respondWithResult(_0x9ab759,null))[_0x7a64('0x47')](handleError(_0x9ab759,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3dd34d2..e4b9199 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 _0x94ff=['bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x43b2b7,_0x5d7590){var _0x27c8ef=function(_0x2118d4){while(--_0x2118d4){_0x43b2b7['push'](_0x43b2b7['shift']());}};_0x27c8ef(++_0x5d7590);}(_0x94ff,0x181));var _0xf94f=function(_0x283bad,_0x30ec3d){_0x283bad=_0x283bad-0x0;var _0x6ec8dd=_0x94ff[_0x283bad];return _0x6ec8dd;};'use strict';var _=require(_0xf94f('0x0'));var util=require(_0xf94f('0x1'));var logger=require(_0xf94f('0x2'))(_0xf94f('0x3'));var moment=require(_0xf94f('0x4'));var BPromise=require(_0xf94f('0x5'));var rp=require(_0xf94f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf94f('0x7'));var config=require(_0xf94f('0x8'));var attributes=require(_0xf94f('0x9'));module[_0xf94f('0xa')]=function(_0x71edb,_0x1f3100){return _0x71edb['define'](_0xf94f('0xb'),attributes,{'tableName':_0xf94f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dd4=['../../config/logger','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4dd4,0xcf));var _0x44dd=function(_0x46ff3a,_0x1b16e5){_0x46ff3a=_0x46ff3a-0x0;var _0x25fcf8=_0x4dd4[_0x46ff3a];return _0x25fcf8;};'use strict';var _=require(_0x44dd('0x0'));var util=require(_0x44dd('0x1'));var logger=require(_0x44dd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x44dd('0x3'));var rp=require(_0x44dd('0x4'));var fs=require('fs');var path=require(_0x44dd('0x5'));var rimraf=require('rimraf');var config=require(_0x44dd('0x6'));var attributes=require(_0x44dd('0x7'));module['exports']=function(_0x5e8299,_0x2ba594){return _0x5e8299[_0x44dd('0x8')](_0x44dd('0x9'),attributes,{'tableName':_0x44dd('0xa'),'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 e41aa1b..23bab39 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 _0x3013=['../../config/logger','rpc','../../config/environment','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x3013,0xea));var _0x3301=function(_0x2e6be0,_0x260a60){_0x2e6be0=_0x2e6be0-0x0;var _0x2c0ca9=_0x3013[_0x2e6be0];return _0x2c0ca9;};'use strict';var _=require(_0x3301('0x0'));var util=require(_0x3301('0x1'));var moment=require(_0x3301('0x2'));var BPromise=require(_0x3301('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3301('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3301('0x5'));var logger=require(_0x3301('0x6'))(_0x3301('0x7'));var config=require(_0x3301('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3301('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41dd5b,_0x3d7e08,_0x4299f9){return new BPromise(function(_0x1b1d66,_0x224cea){return client['request'](_0x41dd5b,_0x4299f9)[_0x3301('0xa')](function(_0x744189){logger[_0x3301('0xb')](_0x3301('0xc'),_0x3d7e08,_0x3301('0xd'));logger['debug'](_0x3301('0xe'),_0x3d7e08,_0x3301('0xd'),JSON[_0x3301('0xf')](_0x744189));if(_0x744189[_0x3301('0x10')]){if(_0x744189[_0x3301('0x10')][_0x3301('0x11')]===0x1f4){logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x744189[_0x3301('0x10')][_0x3301('0x12')]);return _0x224cea(_0x744189[_0x3301('0x10')][_0x3301('0x12')]);}logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x744189['error'][_0x3301('0x12')]);return _0x1b1d66(_0x744189[_0x3301('0x10')]['message']);}else{logger['info'](_0x3301('0xc'),_0x3d7e08,_0x3301('0xd'));_0x1b1d66(_0x744189['result'][_0x3301('0x12')]);}})[_0x3301('0x13')](function(_0x4a3915){logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x4a3915);_0x224cea(_0x4a3915);});});} \ No newline at end of file +var _0x6739=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x591b7d,_0x4544a9){var _0x37dce0=function(_0x15be91){while(--_0x15be91){_0x591b7d['push'](_0x591b7d['shift']());}};_0x37dce0(++_0x4544a9);}(_0x6739,0xd3));var _0x9673=function(_0x21ddb9,_0x2a2195){_0x21ddb9=_0x21ddb9-0x0;var _0x11cc73=_0x6739[_0x21ddb9];return _0x11cc73;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var moment=require(_0x9673('0x2'));var BPromise=require(_0x9673('0x3'));var rs=require(_0x9673('0x4'));var fs=require('fs');var Redis=require(_0x9673('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9673('0x6'))('rpc');var config=require(_0x9673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad052,_0x3f82df,_0x4981d9){return new BPromise(function(_0x4e1dd5,_0x39b0f0){return client[_0x9673('0x9')](_0x3ad052,_0x4981d9)[_0x9673('0xa')](function(_0x509966){logger[_0x9673('0xb')](_0x9673('0xc'),_0x3f82df,_0x9673('0xd'));logger['debug'](_0x9673('0xe'),_0x3f82df,_0x9673('0xd'),JSON[_0x9673('0xf')](_0x509966));if(_0x509966[_0x9673('0x10')]){if(_0x509966['error'][_0x9673('0x11')]===0x1f4){logger[_0x9673('0x10')](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')]['message']);return _0x39b0f0(_0x509966[_0x9673('0x10')][_0x9673('0x12')]);}logger['error'](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')][_0x9673('0x12')]);return _0x4e1dd5(_0x509966['error'][_0x9673('0x12')]);}else{logger['info'](_0x9673('0xc'),_0x3f82df,'request\x20sent');_0x4e1dd5(_0x509966['result'][_0x9673('0x12')]);}})['catch'](function(_0x3d5642){logger[_0x9673('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f82df,_0x3d5642);_0x39b0f0(_0x3d5642);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 68d8744..d315035 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 _0xc225=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4e09a3,_0x34c0de){var _0x2a611f=function(_0x55c4d2){while(--_0x55c4d2){_0x4e09a3['push'](_0x4e09a3['shift']());}};_0x2a611f(++_0x34c0de);}(_0xc225,0x92));var _0x5c22=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc225[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5c22('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5c22('0x1'));var express=require('express');var router=express[_0x5c22('0x2')]();var auth=require(_0x5c22('0x3'));var interaction=require(_0x5c22('0x4'));var config=require(_0x5c22('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x5c22('0x6')]('/',auth[_0x5c22('0x7')](),controller[_0x5c22('0x8')]);router[_0x5c22('0x6')](_0x5c22('0x9'),auth['isAuthenticated'](),controller[_0x5c22('0xa')]);router[_0x5c22('0x6')](_0x5c22('0xb'),auth[_0x5c22('0x7')](),controller[_0x5c22('0xc')]);router[_0x5c22('0x6')](_0x5c22('0xd'),auth[_0x5c22('0x7')](),controller[_0x5c22('0xe')]);router[_0x5c22('0x6')](_0x5c22('0xf'),auth[_0x5c22('0x7')](),controller[_0x5c22('0x10')]);router['post']('/',auth[_0x5c22('0x7')](),controller[_0x5c22('0x11')]);router[_0x5c22('0x12')](_0x5c22('0x9'),auth[_0x5c22('0x7')](),controller['update']);router[_0x5c22('0x13')]('/:id',auth[_0x5c22('0x7')](),controller[_0x5c22('0x14')]);module[_0x5c22('0x15')]=router; \ No newline at end of file +var _0xec39=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3a52d0,_0x5eacbe){var _0x18271b=function(_0x46d1b6){while(--_0x46d1b6){_0x3a52d0['push'](_0x3a52d0['shift']());}};_0x18271b(++_0x5eacbe);}(_0xec39,0xa9));var _0x9ec3=function(_0x63008f,_0x331c3a){_0x63008f=_0x63008f-0x0;var _0x116b26=_0xec39[_0x63008f];return _0x116b26;};'use strict';var multer=require('multer');var util=require(_0x9ec3('0x0'));var path=require(_0x9ec3('0x1'));var timeout=require(_0x9ec3('0x2'));var express=require(_0x9ec3('0x3'));var router=express[_0x9ec3('0x4')]();var auth=require(_0x9ec3('0x5'));var interaction=require(_0x9ec3('0x6'));var config=require('../../config/environment');var controller=require(_0x9ec3('0x7'));router[_0x9ec3('0x8')]('/',auth[_0x9ec3('0x9')](),controller[_0x9ec3('0xa')]);router[_0x9ec3('0x8')]('/:id',auth[_0x9ec3('0x9')](),controller['show']);router[_0x9ec3('0x8')](_0x9ec3('0xb'),auth[_0x9ec3('0x9')](),controller[_0x9ec3('0xc')]);router[_0x9ec3('0x8')](_0x9ec3('0xd'),auth['isAuthenticated'](),controller[_0x9ec3('0xe')]);router['get'](_0x9ec3('0xf'),auth[_0x9ec3('0x9')](),controller[_0x9ec3('0x10')]);router[_0x9ec3('0x11')]('/',auth['isAuthenticated'](),controller[_0x9ec3('0x12')]);router[_0x9ec3('0x13')](_0x9ec3('0x14'),auth[_0x9ec3('0x9')](),controller['update']);router['delete'](_0x9ec3('0x14'),auth[_0x9ec3('0x9')](),controller['destroy']);module[_0x9ec3('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index a400750..d4e11d1 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 _0x5078=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x2e5fd2,_0x4a7ad7){var _0x4b7242=function(_0x741123){while(--_0x741123){_0x2e5fd2['push'](_0x2e5fd2['shift']());}};_0x4b7242(++_0x4a7ad7);}(_0x5078,0x199));var _0x8507=function(_0x4bc4ab,_0x2c1bad){_0x4bc4ab=_0x4bc4ab-0x0;var _0x368014=_0x5078[_0x4bc4ab];return _0x368014;};'use strict';var Sequelize=require(_0x8507('0x0'));var moment=require(_0x8507('0x1'));module[_0x8507('0x2')]={'name':{'type':Sequelize[_0x8507('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8507('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8507('0x4')](_0x8507('0x5'),_0x8507('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x8507('0x5')},'savename':{'type':Sequelize[_0x8507('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8507('0x7')]},'endDate':{'type':Sequelize[_0x8507('0x7')]},'status':{'type':Sequelize[_0x8507('0x3')],'defaultValue':_0x8507('0x8')},'type':{'type':Sequelize['ENUM'](_0x8507('0x9'),_0x8507('0xa')),'allowNull':![],'defaultValue':_0x8507('0x9')},'reportId':{'type':Sequelize[_0x8507('0xb')](0xb)[_0x8507('0xc')]},'reportType':{'type':Sequelize[_0x8507('0x3')]}}; \ No newline at end of file +var _0x1ad1=['DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x1ad1,0x1aa));var _0x11ad=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1ad1[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0x11ad('0x0'));var moment=require(_0x11ad('0x1'));module[_0x11ad('0x2')]={'name':{'type':Sequelize[_0x11ad('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x11ad('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x11ad('0x4')](_0x11ad('0x5'),_0x11ad('0x6'),_0x11ad('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x11ad('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x11ad('0x8')]},'endDate':{'type':Sequelize[_0x11ad('0x8')]},'status':{'type':Sequelize[_0x11ad('0x3')],'defaultValue':_0x11ad('0x9')},'type':{'type':Sequelize['ENUM']('manual',_0x11ad('0xa')),'allowNull':![],'defaultValue':_0x11ad('0xb')},'reportId':{'type':Sequelize[_0x11ad('0xc')](0xb)[_0x11ad('0xd')]},'reportType':{'type':Sequelize[_0x11ad('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index df7aec6..5a29fc5 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 _0xc79b=['fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','%s.%s','output','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xc79b,0x8c));var _0xbc79=function(_0x97357,_0x515a33){_0x97357=_0x97357-0x0;var _0x1a9f76=_0xc79b[_0x97357];return _0x1a9f76;};'use strict';var pdf=require(_0xbc79('0x0'));var emlformat=require(_0xbc79('0x1'));var rimraf=require(_0xbc79('0x2'));var zipdir=require(_0xbc79('0x3'));var jsonpatch=require(_0xbc79('0x4'));var rp=require(_0xbc79('0x5'));var moment=require(_0xbc79('0x6'));var BPromise=require(_0xbc79('0x7'));var Mustache=require(_0xbc79('0x8'));var util=require('util');var path=require(_0xbc79('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbc79('0xa'));var fs=require('fs');var _=require(_0xbc79('0xb'));var squel=require('squel');var crypto=require(_0xbc79('0xc'));var jsforce=require(_0xbc79('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbc79('0xe'));var Redis=require(_0xbc79('0xf'));var authService=require(_0xbc79('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbc79('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc79('0x12'))('api');var utils=require(_0xbc79('0x13'));var config=require('../../config/environment');var db=require(_0xbc79('0x14'))['db'];function respondWithStatusCode(_0x3f55c,_0x5290dc){_0x5290dc=_0x5290dc||0xcc;return function(_0xf5a22f){if(_0xf5a22f){return _0x3f55c[_0xbc79('0x15')](_0x5290dc);}return _0x3f55c['status'](_0x5290dc)[_0xbc79('0x16')]();};}function respondWithResult(_0x935586,_0x2af900){_0x2af900=_0x2af900||0xc8;return function(_0x4baeb2){if(_0x4baeb2){return _0x935586[_0xbc79('0x17')](_0x2af900)[_0xbc79('0x18')](_0x4baeb2);}};}function respondWithFilteredResult(_0x62a5c5,_0x3b8f5d){return function(_0x22a0b1){if(_0x22a0b1){var _0x1c2f89=_0x22a0b1[_0xbc79('0x19')],_0x22abc8=_0x3b8f5d[_0xbc79('0x1a')],_0xc16ffa=_0x3b8f5d[_0xbc79('0x1a')]+_0x3b8f5d[_0xbc79('0x1b')],_0x37c136;if(_0xc16ffa>=_0x1c2f89){_0xc16ffa=_0x1c2f89;_0x37c136=0xc8;}else{_0x37c136=0xce;}_0x62a5c5[_0xbc79('0x17')](_0x37c136);return _0x62a5c5[_0xbc79('0x1c')]('Content-Range',_0x22abc8+'-'+_0xc16ffa+'/'+_0x1c2f89)[_0xbc79('0x18')](_0x22a0b1);}return null;};}function patchUpdates(_0x18f941){return function(_0x3e2512){try{jsonpatch[_0xbc79('0x1d')](_0x3e2512,_0x18f941,!![]);}catch(_0xd4f7d1){return BPromise[_0xbc79('0x1e')](_0xd4f7d1);}return _0x3e2512[_0xbc79('0x1f')]();};}function saveUpdates(_0x31363d,_0x17ec8b){return function(_0x38dc68){if(_0x38dc68){return _0x38dc68[_0xbc79('0x20')](_0x31363d)[_0xbc79('0x21')](function(_0x4c41cc){return _0x4c41cc;});}return null;};}function removeEntity(_0x514921,_0x554ab1){return function(_0x51d828){if(_0x51d828){return _0x51d828[_0xbc79('0x22')]()[_0xbc79('0x21')](function(){var _0x5bc029=_0x51d828[_0xbc79('0x23')]({'plain':!![]});var _0x43b4d0=_0xbc79('0x24');return db[_0xbc79('0x25')]['destroy']({'where':{'type':_0x43b4d0,'resourceId':_0x5bc029['id']}})['then'](function(){return _0x51d828;});})[_0xbc79('0x21')](function(){_0x514921[_0xbc79('0x17')](0xcc)[_0xbc79('0x16')]();});}};}function handleEntityNotFound(_0x4cd0a6,_0x65dd4f){return function(_0x3c0a68){if(!_0x3c0a68){_0x4cd0a6[_0xbc79('0x15')](0x194);}return _0x3c0a68;};}function handleError(_0x27129b,_0x1ee7c9){_0x1ee7c9=_0x1ee7c9||0x1f4;return function(_0x4ac011){logger[_0xbc79('0x26')](_0x4ac011[_0xbc79('0x27')]);if(_0x4ac011[_0xbc79('0x28')]){delete _0x4ac011[_0xbc79('0x28')];}_0x27129b[_0xbc79('0x17')](_0x1ee7c9)[_0xbc79('0x29')](_0x4ac011);};}exports[_0xbc79('0x2a')]=function(_0x802b33,_0x6436bc){var _0x4a5293={},_0x5621b4={},_0x28e3ae={'count':0x0,'rows':[]};var _0x28fee0=_[_0xbc79('0x2b')](db[_0xbc79('0x2c')][_0xbc79('0x2d')],function(_0x209bb4){return{'name':_0x209bb4[_0xbc79('0x2e')],'type':_0x209bb4[_0xbc79('0x2f')][_0xbc79('0x30')]};});_0x5621b4[_0xbc79('0x31')]=_[_0xbc79('0x2b')](_0x28fee0,_0xbc79('0x28'));_0x5621b4[_0xbc79('0x32')]=_['keys'](_0x802b33[_0xbc79('0x32')]);_0x5621b4[_0xbc79('0x33')]=_[_0xbc79('0x34')](_0x5621b4[_0xbc79('0x31')],_0x5621b4[_0xbc79('0x32')]);_0x4a5293[_0xbc79('0x35')]=_[_0xbc79('0x34')](_0x5621b4[_0xbc79('0x31')],qs['fields'](_0x802b33[_0xbc79('0x32')][_0xbc79('0x36')]));_0x4a5293[_0xbc79('0x35')]=_0x4a5293[_0xbc79('0x35')]['length']?_0x4a5293['attributes']:_0x5621b4[_0xbc79('0x31')];if(!_0x802b33[_0xbc79('0x32')]['hasOwnProperty'](_0xbc79('0x37'))){_0x4a5293[_0xbc79('0x1b')]=qs[_0xbc79('0x1b')](_0x802b33[_0xbc79('0x32')]['limit']);_0x4a5293[_0xbc79('0x1a')]=qs['offset'](_0x802b33['query'][_0xbc79('0x1a')]);}_0x4a5293[_0xbc79('0x38')]=qs[_0xbc79('0x39')](_0x802b33['query'][_0xbc79('0x39')]);_0x4a5293[_0xbc79('0x3a')]=qs[_0xbc79('0x33')](_[_0xbc79('0x3b')](_0x802b33[_0xbc79('0x32')],_0x5621b4['filters']),_0x28fee0);if(_0x802b33['query'][_0xbc79('0x3c')]){_0x4a5293[_0xbc79('0x3a')]=_['merge'](_0x4a5293[_0xbc79('0x3a')],{'$or':_[_0xbc79('0x2b')](_0x28fee0,function(_0x53fd81){if(_0x53fd81[_0xbc79('0x2f')]!==_0xbc79('0x3d')){var _0x4141e0={};_0x4141e0[_0x53fd81['name']]={'$like':'%'+_0x802b33[_0xbc79('0x32')][_0xbc79('0x3c')]+'%'};return _0x4141e0;}})});}_0x4a5293=_[_0xbc79('0x3e')]({},_0x4a5293,_0x802b33[_0xbc79('0x3f')]);var _0x49321a={'where':_0x4a5293['where']};return db[_0xbc79('0x2c')][_0xbc79('0x19')](_0x49321a)['then'](function(_0x254f34){_0x28e3ae['count']=_0x254f34;if(_0x802b33[_0xbc79('0x32')]['includeAll']){_0x4a5293[_0xbc79('0x40')]=[{'all':!![]}];}return db[_0xbc79('0x2c')][_0xbc79('0x41')](_0x4a5293);})[_0xbc79('0x21')](function(_0x1a8e81){_0x28e3ae['rows']=_0x1a8e81;return _0x28e3ae;})[_0xbc79('0x21')](respondWithFilteredResult(_0x6436bc,_0x4a5293))[_0xbc79('0x42')](handleError(_0x6436bc,null));};exports[_0xbc79('0x43')]=function(_0x5617c8,_0x3c2605){var _0x37acfa={'raw':!![],'where':{'id':_0x5617c8[_0xbc79('0x44')]['id']}},_0x30de87={};_0x30de87[_0xbc79('0x31')]=_['keys'](db[_0xbc79('0x2c')][_0xbc79('0x2d')]);_0x30de87[_0xbc79('0x32')]=_[_0xbc79('0x45')](_0x5617c8[_0xbc79('0x32')]);_0x30de87['filters']=_[_0xbc79('0x34')](_0x30de87[_0xbc79('0x31')],_0x30de87[_0xbc79('0x32')]);_0x37acfa[_0xbc79('0x35')]=_[_0xbc79('0x34')](_0x30de87[_0xbc79('0x31')],qs[_0xbc79('0x36')](_0x5617c8[_0xbc79('0x32')]['fields']));_0x37acfa[_0xbc79('0x35')]=_0x37acfa[_0xbc79('0x35')][_0xbc79('0x46')]?_0x37acfa['attributes']:_0x30de87[_0xbc79('0x31')];if(_0x5617c8[_0xbc79('0x32')][_0xbc79('0x47')]){_0x37acfa[_0xbc79('0x40')]=[{'all':!![]}];}_0x37acfa=_[_0xbc79('0x3e')]({},_0x37acfa,_0x5617c8[_0xbc79('0x3f')]);return db['AnalyticExtractedReport'][_0xbc79('0x48')](_0x37acfa)[_0xbc79('0x21')](handleEntityNotFound(_0x3c2605,null))[_0xbc79('0x21')](respondWithResult(_0x3c2605,null))[_0xbc79('0x42')](handleError(_0x3c2605,null));};exports[_0xbc79('0x49')]=function(_0x351ceb,_0x421469){return db['AnalyticExtractedReport']['create'](_0x351ceb[_0xbc79('0x4a')],{})[_0xbc79('0x21')](function(_0x250d89){var _0x2894af=_0x351ceb[_0xbc79('0x4b')][_0xbc79('0x23')]({'plain':!![]});if(!_0x2894af)throw new Error(_0xbc79('0x4c'));if(_0x2894af[_0xbc79('0x4d')]===_0xbc79('0x4b')){var _0x3f1f8e=_0x250d89['get']({'plain':!![]});var _0x27bdb7=_0xbc79('0x24');return db[_0xbc79('0x4e')][_0xbc79('0x48')]({'where':{'name':_0x27bdb7,'userProfileId':_0x2894af[_0xbc79('0x4f')]},'raw':!![]})['then'](function(_0x224aa3){if(_0x224aa3&&_0x224aa3[_0xbc79('0x50')]===0x0){return db[_0xbc79('0x25')][_0xbc79('0x49')]({'name':_0x3f1f8e[_0xbc79('0x28')],'resourceId':_0x3f1f8e['id'],'type':_0x224aa3[_0xbc79('0x28')],'sectionId':_0x224aa3['id']},{})[_0xbc79('0x21')](function(){return _0x250d89;});}else{return _0x250d89;}})[_0xbc79('0x42')](function(_0x22e3dd){logger[_0xbc79('0x26')](_0xbc79('0x51'),_0x22e3dd);throw _0x22e3dd;});}return _0x250d89;})[_0xbc79('0x21')](respondWithResult(_0x421469,0xc9))[_0xbc79('0x42')](handleError(_0x421469,null));};exports[_0xbc79('0x20')]=function(_0x3d375f,_0x2789de){if(_0x3d375f[_0xbc79('0x4a')]['id']){delete _0x3d375f[_0xbc79('0x4a')]['id'];}return db[_0xbc79('0x2c')][_0xbc79('0x48')]({'where':{'id':_0x3d375f[_0xbc79('0x44')]['id']}})['then'](handleEntityNotFound(_0x2789de,null))[_0xbc79('0x21')](saveUpdates(_0x3d375f[_0xbc79('0x4a')],null))[_0xbc79('0x21')](respondWithResult(_0x2789de,null))[_0xbc79('0x42')](handleError(_0x2789de,null));};exports[_0xbc79('0x22')]=function(_0x1e2a63,_0x2f2fbb){return db[_0xbc79('0x2c')]['find']({'where':{'id':_0x1e2a63[_0xbc79('0x44')]['id']}})[_0xbc79('0x21')](handleEntityNotFound(_0x2f2fbb,null))['then'](removeEntity(_0x2f2fbb,null))[_0xbc79('0x42')](handleError(_0x2f2fbb,null));};exports[_0xbc79('0x52')]=function(_0x270be1,_0x1ec6c2,_0x15588e){return db['AnalyticExtractedReport'][_0xbc79('0x48')]({'where':{'id':_0x270be1[_0xbc79('0x44')]['id']},'attributes':[_0xbc79('0x28'),_0xbc79('0x53'),_0xbc79('0x54'),'output'],'raw':!![]})[_0xbc79('0x21')](handleEntityNotFound(_0x1ec6c2,null))[_0xbc79('0x21')](function(_0x45deec){if(_0x45deec){if(!fs['existsSync'](path['join'](config[_0xbc79('0x55')],_0xbc79('0x56'),_0x45deec['savename']))){throw new db['Sequelize'][(_0xbc79('0x57'))](_0xbc79('0x58'));}if(_0x270be1[_0xbc79('0x32')][_0xbc79('0x59')]){return _0x1ec6c2['sendStatus'](0xc8);}return _0x1ec6c2[_0xbc79('0x52')](path[_0xbc79('0x5a')](config[_0xbc79('0x55')],_0xbc79('0x56'),_0x45deec['savename']),util['format'](_0xbc79('0x5b'),_0x45deec[_0xbc79('0x53')]||_0x45deec[_0xbc79('0x28')],_0x45deec[_0xbc79('0x5c')]['toLowerCase']()));}})[_0xbc79('0x42')](handleError(_0x1ec6c2,null));}; \ No newline at end of file +var _0x5ac9=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','create','user','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','html-pdf','eml-format'];(function(_0x4f2aca,_0x89704d){var _0x184c53=function(_0xa581b0){while(--_0xa581b0){_0x4f2aca['push'](_0x4f2aca['shift']());}};_0x184c53(++_0x89704d);}(_0x5ac9,0x118));var _0x95ac=function(_0x3bad6e,_0x3ce278){_0x3bad6e=_0x3bad6e-0x0;var _0x51b684=_0x5ac9[_0x3bad6e];return _0x51b684;};'use strict';var pdf=require(_0x95ac('0x0'));var emlformat=require(_0x95ac('0x1'));var rimraf=require(_0x95ac('0x2'));var zipdir=require(_0x95ac('0x3'));var jsonpatch=require(_0x95ac('0x4'));var rp=require(_0x95ac('0x5'));var moment=require(_0x95ac('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x95ac('0x7'));var path=require(_0x95ac('0x8'));var sox=require(_0x95ac('0x9'));var csv=require('to-csv');var ejs=require(_0x95ac('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x95ac('0xb'));var jsforce=require(_0x95ac('0xc'));var deskjs=require(_0x95ac('0xd'));var toCsv=require(_0x95ac('0xe'));var querystring=require(_0x95ac('0xf'));var Papa=require(_0x95ac('0x10'));var Redis=require(_0x95ac('0x11'));var authService=require(_0x95ac('0x12'));var qs=require(_0x95ac('0x13'));var as=require(_0x95ac('0x14'));var hardwareService=require(_0x95ac('0x15'));var logger=require(_0x95ac('0x16'))(_0x95ac('0x17'));var utils=require(_0x95ac('0x18'));var config=require('../../config/environment');var db=require(_0x95ac('0x19'))['db'];function respondWithStatusCode(_0x10dcca,_0x49e1b4){_0x49e1b4=_0x49e1b4||0xcc;return function(_0xacd43c){if(_0xacd43c){return _0x10dcca[_0x95ac('0x1a')](_0x49e1b4);}return _0x10dcca[_0x95ac('0x1b')](_0x49e1b4)[_0x95ac('0x1c')]();};}function respondWithResult(_0x18adc2,_0x58202c){_0x58202c=_0x58202c||0xc8;return function(_0x216f74){if(_0x216f74){return _0x18adc2['status'](_0x58202c)[_0x95ac('0x1d')](_0x216f74);}};}function respondWithFilteredResult(_0x10ae83,_0x2fda41){return function(_0x4d4eb0){if(_0x4d4eb0){var _0x34cd7d=_0x4d4eb0[_0x95ac('0x1e')],_0x113a18=_0x2fda41[_0x95ac('0x1f')],_0x2e9942=_0x2fda41['offset']+_0x2fda41[_0x95ac('0x20')],_0x3e6172;if(_0x2e9942>=_0x34cd7d){_0x2e9942=_0x34cd7d;_0x3e6172=0xc8;}else{_0x3e6172=0xce;}_0x10ae83[_0x95ac('0x1b')](_0x3e6172);return _0x10ae83['set'](_0x95ac('0x21'),_0x113a18+'-'+_0x2e9942+'/'+_0x34cd7d)[_0x95ac('0x1d')](_0x4d4eb0);}return null;};}function patchUpdates(_0x3fb160){return function(_0x308b47){try{jsonpatch['apply'](_0x308b47,_0x3fb160,!![]);}catch(_0x2a51a0){return BPromise[_0x95ac('0x22')](_0x2a51a0);}return _0x308b47[_0x95ac('0x23')]();};}function saveUpdates(_0x10cd92,_0x4734e2){return function(_0x2abd2d){if(_0x2abd2d){return _0x2abd2d['update'](_0x10cd92)[_0x95ac('0x24')](function(_0x1acef4){return _0x1acef4;});}return null;};}function removeEntity(_0x39f7f2,_0x5f575a){return function(_0x1fe34c){if(_0x1fe34c){return _0x1fe34c['destroy']()['then'](function(){var _0x44bfca=_0x1fe34c[_0x95ac('0x25')]({'plain':!![]});var _0x181adf=_0x95ac('0x26');return db[_0x95ac('0x27')][_0x95ac('0x28')]({'where':{'type':_0x181adf,'resourceId':_0x44bfca['id']}})[_0x95ac('0x24')](function(){return _0x1fe34c;});})[_0x95ac('0x24')](function(){_0x39f7f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cd5a0,_0x2fcdf6){return function(_0x1c9b4d){if(!_0x1c9b4d){_0x2cd5a0[_0x95ac('0x1a')](0x194);}return _0x1c9b4d;};}function handleError(_0x4402f6,_0x706195){_0x706195=_0x706195||0x1f4;return function(_0x2a9288){logger['error'](_0x2a9288[_0x95ac('0x29')]);if(_0x2a9288[_0x95ac('0x2a')]){delete _0x2a9288[_0x95ac('0x2a')];}_0x4402f6[_0x95ac('0x1b')](_0x706195)[_0x95ac('0x2b')](_0x2a9288);};}exports[_0x95ac('0x2c')]=function(_0x1c151a,_0x4026d1){var _0x4e0c58={},_0x2a8e5a={},_0x3be082={'count':0x0,'rows':[]};var _0x5c48ca=_[_0x95ac('0x2d')](db[_0x95ac('0x2e')][_0x95ac('0x2f')],function(_0x5462d9){return{'name':_0x5462d9[_0x95ac('0x30')],'type':_0x5462d9[_0x95ac('0x31')][_0x95ac('0x32')]};});_0x2a8e5a[_0x95ac('0x33')]=_[_0x95ac('0x2d')](_0x5c48ca,_0x95ac('0x2a'));_0x2a8e5a[_0x95ac('0x34')]=_['keys'](_0x1c151a['query']);_0x2a8e5a[_0x95ac('0x35')]=_[_0x95ac('0x36')](_0x2a8e5a[_0x95ac('0x33')],_0x2a8e5a[_0x95ac('0x34')]);_0x4e0c58[_0x95ac('0x37')]=_['intersection'](_0x2a8e5a[_0x95ac('0x33')],qs[_0x95ac('0x38')](_0x1c151a[_0x95ac('0x34')]['fields']));_0x4e0c58['attributes']=_0x4e0c58['attributes'][_0x95ac('0x39')]?_0x4e0c58['attributes']:_0x2a8e5a[_0x95ac('0x33')];if(!_0x1c151a['query'][_0x95ac('0x3a')](_0x95ac('0x3b'))){_0x4e0c58['limit']=qs['limit'](_0x1c151a['query'][_0x95ac('0x20')]);_0x4e0c58[_0x95ac('0x1f')]=qs[_0x95ac('0x1f')](_0x1c151a['query'][_0x95ac('0x1f')]);}_0x4e0c58['order']=qs[_0x95ac('0x3c')](_0x1c151a[_0x95ac('0x34')]['sort']);_0x4e0c58[_0x95ac('0x3d')]=qs[_0x95ac('0x35')](_['pick'](_0x1c151a[_0x95ac('0x34')],_0x2a8e5a['filters']),_0x5c48ca);if(_0x1c151a[_0x95ac('0x34')][_0x95ac('0x3e')]){_0x4e0c58[_0x95ac('0x3d')]=_[_0x95ac('0x3f')](_0x4e0c58[_0x95ac('0x3d')],{'$or':_[_0x95ac('0x2d')](_0x5c48ca,function(_0x4f007d){if(_0x4f007d[_0x95ac('0x31')]!==_0x95ac('0x40')){var _0x2d82af={};_0x2d82af[_0x4f007d[_0x95ac('0x2a')]]={'$like':'%'+_0x1c151a['query'][_0x95ac('0x3e')]+'%'};return _0x2d82af;}})});}_0x4e0c58=_[_0x95ac('0x3f')]({},_0x4e0c58,_0x1c151a[_0x95ac('0x41')]);var _0x4461c9={'where':_0x4e0c58[_0x95ac('0x3d')]};return db[_0x95ac('0x2e')][_0x95ac('0x1e')](_0x4461c9)['then'](function(_0x1f142b){_0x3be082['count']=_0x1f142b;if(_0x1c151a['query'][_0x95ac('0x42')]){_0x4e0c58[_0x95ac('0x43')]=[{'all':!![]}];}return db[_0x95ac('0x2e')][_0x95ac('0x44')](_0x4e0c58);})[_0x95ac('0x24')](function(_0x19db71){_0x3be082[_0x95ac('0x45')]=_0x19db71;return _0x3be082;})[_0x95ac('0x24')](respondWithFilteredResult(_0x4026d1,_0x4e0c58))['catch'](handleError(_0x4026d1,null));};exports['show']=function(_0x2dc373,_0x4cbca5){var _0x12db39={'raw':!![],'where':{'id':_0x2dc373[_0x95ac('0x46')]['id']}},_0x2c6330={};_0x2c6330['model']=_[_0x95ac('0x47')](db['AnalyticExtractedReport'][_0x95ac('0x2f')]);_0x2c6330[_0x95ac('0x34')]=_[_0x95ac('0x47')](_0x2dc373[_0x95ac('0x34')]);_0x2c6330[_0x95ac('0x35')]=_[_0x95ac('0x36')](_0x2c6330[_0x95ac('0x33')],_0x2c6330[_0x95ac('0x34')]);_0x12db39['attributes']=_[_0x95ac('0x36')](_0x2c6330[_0x95ac('0x33')],qs['fields'](_0x2dc373['query'][_0x95ac('0x38')]));_0x12db39[_0x95ac('0x37')]=_0x12db39[_0x95ac('0x37')][_0x95ac('0x39')]?_0x12db39[_0x95ac('0x37')]:_0x2c6330[_0x95ac('0x33')];if(_0x2dc373['query'][_0x95ac('0x42')]){_0x12db39[_0x95ac('0x43')]=[{'all':!![]}];}_0x12db39=_[_0x95ac('0x3f')]({},_0x12db39,_0x2dc373['options']);return db[_0x95ac('0x2e')][_0x95ac('0x48')](_0x12db39)[_0x95ac('0x24')](handleEntityNotFound(_0x4cbca5,null))['then'](respondWithResult(_0x4cbca5,null))['catch'](handleError(_0x4cbca5,null));};exports[_0x95ac('0x49')]=function(_0x55f63c,_0x5d632c){return db[_0x95ac('0x2e')]['create'](_0x55f63c['body'],{})[_0x95ac('0x24')](function(_0x3f08e3){var _0xed12a7=_0x55f63c[_0x95ac('0x4a')][_0x95ac('0x25')]({'plain':!![]});if(!_0xed12a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xed12a7['role']==='user'){var _0x5e8880=_0x3f08e3[_0x95ac('0x25')]({'plain':!![]});var _0x223baf=_0x95ac('0x26');return db[_0x95ac('0x4b')][_0x95ac('0x48')]({'where':{'name':_0x223baf,'userProfileId':_0xed12a7[_0x95ac('0x4c')]},'raw':!![]})[_0x95ac('0x24')](function(_0x4398f8){if(_0x4398f8&&_0x4398f8[_0x95ac('0x4d')]===0x0){return db[_0x95ac('0x27')][_0x95ac('0x49')]({'name':_0x5e8880[_0x95ac('0x2a')],'resourceId':_0x5e8880['id'],'type':_0x4398f8[_0x95ac('0x2a')],'sectionId':_0x4398f8['id']},{})[_0x95ac('0x24')](function(){return _0x3f08e3;});}else{return _0x3f08e3;}})[_0x95ac('0x4e')](function(_0xda7634){logger[_0x95ac('0x4f')](_0x95ac('0x50'),_0xda7634);throw _0xda7634;});}return _0x3f08e3;})[_0x95ac('0x24')](respondWithResult(_0x5d632c,0xc9))[_0x95ac('0x4e')](handleError(_0x5d632c,null));};exports[_0x95ac('0x51')]=function(_0x2f79cd,_0x53a544){if(_0x2f79cd['body']['id']){delete _0x2f79cd[_0x95ac('0x52')]['id'];}return db[_0x95ac('0x2e')][_0x95ac('0x48')]({'where':{'id':_0x2f79cd['params']['id']}})[_0x95ac('0x24')](handleEntityNotFound(_0x53a544,null))[_0x95ac('0x24')](saveUpdates(_0x2f79cd[_0x95ac('0x52')],null))[_0x95ac('0x24')](respondWithResult(_0x53a544,null))[_0x95ac('0x4e')](handleError(_0x53a544,null));};exports[_0x95ac('0x28')]=function(_0x2a93b1,_0x4f9180){return db[_0x95ac('0x2e')][_0x95ac('0x48')]({'where':{'id':_0x2a93b1[_0x95ac('0x46')]['id']}})[_0x95ac('0x24')](handleEntityNotFound(_0x4f9180,null))[_0x95ac('0x24')](removeEntity(_0x4f9180,null))['catch'](handleError(_0x4f9180,null));};exports[_0x95ac('0x53')]=function(_0x231171,_0x261ac3,_0x263682){return db[_0x95ac('0x2e')][_0x95ac('0x48')]({'where':{'id':_0x231171['params']['id']},'attributes':['name',_0x95ac('0x54'),_0x95ac('0x55'),_0x95ac('0x56')],'raw':!![]})[_0x95ac('0x24')](handleEntityNotFound(_0x261ac3,null))['then'](function(_0x29aac0){if(_0x29aac0){if(!fs['existsSync'](path[_0x95ac('0x57')](config[_0x95ac('0x58')],_0x95ac('0x59'),_0x29aac0[_0x95ac('0x55')]))){throw new db['Sequelize']['ValidationError'](_0x95ac('0x5a'));}if(_0x231171[_0x95ac('0x34')][_0x95ac('0x5b')]){return _0x261ac3[_0x95ac('0x1a')](0xc8);}return _0x261ac3['download'](path[_0x95ac('0x57')](config['root'],_0x95ac('0x59'),_0x29aac0['savename']),util['format'](_0x95ac('0x5c'),_0x29aac0[_0x95ac('0x54')]||_0x29aac0[_0x95ac('0x2a')],_0x29aac0[_0x95ac('0x56')][_0x95ac('0x5d')]()));}})['catch'](handleError(_0x261ac3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 5cb5594..7982710 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 _0x40eb=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x3b37df,_0x4e2a15){var _0x19a97e=function(_0x17d5d4){while(--_0x17d5d4){_0x3b37df['push'](_0x3b37df['shift']());}};_0x19a97e(++_0x4e2a15);}(_0x40eb,0x148));var _0xb40e=function(_0x37065a,_0xd1f059){_0x37065a=_0x37065a-0x0;var _0x293d11=_0x40eb[_0x37065a];return _0x293d11;};'use strict';var _=require(_0xb40e('0x0'));var util=require(_0xb40e('0x1'));var logger=require('../../config/logger')(_0xb40e('0x2'));var moment=require(_0xb40e('0x3'));var BPromise=require(_0xb40e('0x4'));var rp=require(_0xb40e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb40e('0x6'));var config=require(_0xb40e('0x7'));var attributes=require(_0xb40e('0x8'));module[_0xb40e('0x9')]=function(_0x91eafd,_0x1e5138){return _0x91eafd[_0xb40e('0xa')](_0xb40e('0xb'),attributes,{'tableName':_0xb40e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08f6=['AnalyticExtractedReport','analytics_extracted_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x08f6,0x6a));var _0x608f=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x08f6[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require('lodash');var util=require(_0x608f('0x0'));var logger=require('../../config/logger')(_0x608f('0x1'));var moment=require(_0x608f('0x2'));var BPromise=require(_0x608f('0x3'));var rp=require(_0x608f('0x4'));var fs=require('fs');var path=require(_0x608f('0x5'));var rimraf=require(_0x608f('0x6'));var config=require(_0x608f('0x7'));var attributes=require(_0x608f('0x8'));module[_0x608f('0x9')]=function(_0x2bd6e6,_0x586989){return _0x2bd6e6[_0x608f('0xa')](_0x608f('0xb'),attributes,{'tableName':_0x608f('0xc'),'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 299517f..044679d 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 _0xd8b3=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x4d3d1c,_0x50772d){var _0x359cb0=function(_0x3daf29){while(--_0x3daf29){_0x4d3d1c['push'](_0x4d3d1c['shift']());}};_0x359cb0(++_0x50772d);}(_0xd8b3,0x1be));var _0x3d8b=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0xd8b3[_0x2053ea];return _0x2232c4;};'use strict';var _=require('lodash');var util=require(_0x3d8b('0x0'));var moment=require(_0x3d8b('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d8b('0x2'));var fs=require('fs');var Redis=require(_0x3d8b('0x3'));var db=require(_0x3d8b('0x4'))['db'];var utils=require(_0x3d8b('0x5'));var logger=require(_0x3d8b('0x6'))(_0x3d8b('0x7'));var config=require(_0x3d8b('0x8'));var jayson=require(_0x3d8b('0x9'));var client=jayson['client'][_0x3d8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3ee4d,_0x317067,_0x32ccd4){return new BPromise(function(_0x519a4a,_0x1e95a4){return client[_0x3d8b('0xb')](_0xc3ee4d,_0x32ccd4)['then'](function(_0x224a2f){logger[_0x3d8b('0xc')](_0x3d8b('0xd'),_0x317067,_0x3d8b('0xe'));logger['debug'](_0x3d8b('0xf'),_0x317067,'request\x20sent',JSON[_0x3d8b('0x10')](_0x224a2f));if(_0x224a2f['error']){if(_0x224a2f[_0x3d8b('0x11')][_0x3d8b('0x12')]===0x1f4){logger[_0x3d8b('0x11')](_0x3d8b('0xd'),_0x317067,_0x224a2f['error'][_0x3d8b('0x13')]);return _0x1e95a4(_0x224a2f['error']['message']);}logger[_0x3d8b('0x11')](_0x3d8b('0xd'),_0x317067,_0x224a2f[_0x3d8b('0x11')][_0x3d8b('0x13')]);return _0x519a4a(_0x224a2f[_0x3d8b('0x11')][_0x3d8b('0x13')]);}else{logger[_0x3d8b('0xc')](_0x3d8b('0xd'),_0x317067,'request\x20sent');_0x519a4a(_0x224a2f[_0x3d8b('0x14')][_0x3d8b('0x13')]);}})[_0x3d8b('0x15')](function(_0x528192){logger[_0x3d8b('0x11')](_0x3d8b('0xd'),_0x317067,_0x528192);_0x1e95a4(_0x528192);});});} \ No newline at end of file +var _0xfd39=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1325de,_0x31a502){var _0x1b366d=function(_0x4bc82d){while(--_0x4bc82d){_0x1325de['push'](_0x1325de['shift']());}};_0x1b366d(++_0x31a502);}(_0xfd39,0x1d8));var _0x9fd3=function(_0x2a304f,_0x2d5b5d){_0x2a304f=_0x2a304f-0x0;var _0x44c93e=_0xfd39[_0x2a304f];return _0x44c93e;};'use strict';var _=require(_0x9fd3('0x0'));var util=require(_0x9fd3('0x1'));var moment=require(_0x9fd3('0x2'));var BPromise=require(_0x9fd3('0x3'));var rs=require(_0x9fd3('0x4'));var fs=require('fs');var Redis=require(_0x9fd3('0x5'));var db=require(_0x9fd3('0x6'))['db'];var utils=require(_0x9fd3('0x7'));var logger=require(_0x9fd3('0x8'))(_0x9fd3('0x9'));var config=require('../../config/environment');var jayson=require(_0x9fd3('0xa'));var client=jayson['client'][_0x9fd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xabda62,_0x471bf6,_0xd679d){return new BPromise(function(_0x43ac87,_0x545a32){return client[_0x9fd3('0xc')](_0xabda62,_0xd679d)['then'](function(_0xd8435d){logger[_0x9fd3('0xd')](_0x9fd3('0xe'),_0x471bf6,_0x9fd3('0xf'));logger[_0x9fd3('0x10')](_0x9fd3('0x11'),_0x471bf6,'request\x20sent',JSON[_0x9fd3('0x12')](_0xd8435d));if(_0xd8435d['error']){if(_0xd8435d['error'][_0x9fd3('0x13')]===0x1f4){logger[_0x9fd3('0x14')](_0x9fd3('0xe'),_0x471bf6,_0xd8435d[_0x9fd3('0x14')][_0x9fd3('0x15')]);return _0x545a32(_0xd8435d[_0x9fd3('0x14')]['message']);}logger[_0x9fd3('0x14')](_0x9fd3('0xe'),_0x471bf6,_0xd8435d[_0x9fd3('0x14')]['message']);return _0x43ac87(_0xd8435d[_0x9fd3('0x14')]['message']);}else{logger[_0x9fd3('0xd')](_0x9fd3('0xe'),_0x471bf6,_0x9fd3('0xf'));_0x43ac87(_0xd8435d[_0x9fd3('0x16')][_0x9fd3('0x15')]);}})['catch'](function(_0x4eddb2){logger[_0x9fd3('0x14')](_0x9fd3('0xe'),_0x471bf6,_0x4eddb2);_0x545a32(_0x4eddb2);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2e961de..e266585 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 _0xe451=['update','delete','exports','multer','path','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','/:id'];(function(_0x57a313,_0x4da781){var _0x287e45=function(_0x2f2678){while(--_0x2f2678){_0x57a313['push'](_0x57a313['shift']());}};_0x287e45(++_0x4da781);}(_0xe451,0x143));var _0x1e45=function(_0x58e994,_0xe962b4){_0x58e994=_0x58e994-0x0;var _0x196334=_0xe451[_0x58e994];return _0x196334;};'use strict';var multer=require(_0x1e45('0x0'));var util=require('util');var path=require(_0x1e45('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e45('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1e45('0x3'));var config=require(_0x1e45('0x4'));var controller=require(_0x1e45('0x5'));router[_0x1e45('0x6')]('/',auth[_0x1e45('0x7')](),controller[_0x1e45('0x8')]);router[_0x1e45('0x6')]('/:id',auth[_0x1e45('0x7')](),controller[_0x1e45('0x9')]);router[_0x1e45('0x6')](_0x1e45('0xa'),auth['isAuthenticated'](),controller[_0x1e45('0xb')]);router['post']('/',auth[_0x1e45('0x7')](),controller['create']);router['put'](_0x1e45('0xc'),auth[_0x1e45('0x7')](),controller[_0x1e45('0xd')]);router[_0x1e45('0xe')](_0x1e45('0xc'),auth[_0x1e45('0x7')](),controller['destroy']);module[_0x1e45('0xf')]=router; \ No newline at end of file +var _0xe0d7=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','put','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0d7,0xba));var _0x7e0d=function(_0x4be634,_0x2b1a67){_0x4be634=_0x4be634-0x0;var _0x2df900=_0xe0d7[_0x4be634];return _0x2df900;};'use strict';var multer=require(_0x7e0d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7e0d('0x1'));var express=require(_0x7e0d('0x2'));var router=express[_0x7e0d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7e0d('0x4'));var config=require(_0x7e0d('0x5'));var controller=require(_0x7e0d('0x6'));router[_0x7e0d('0x7')]('/',auth[_0x7e0d('0x8')](),controller[_0x7e0d('0x9')]);router[_0x7e0d('0x7')](_0x7e0d('0xa'),auth[_0x7e0d('0x8')](),controller[_0x7e0d('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x7e0d('0xc')]);router[_0x7e0d('0xd')]('/',auth[_0x7e0d('0x8')](),controller['create']);router[_0x7e0d('0xe')](_0x7e0d('0xa'),auth[_0x7e0d('0x8')](),controller['update']);router['delete'](_0x7e0d('0xa'),auth[_0x7e0d('0x8')](),controller[_0x7e0d('0xf')]);module[_0x7e0d('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 066e4d4..1b56577 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 _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1fd437,_0x2c0b47){var _0x40d9e6=function(_0x1668a1){while(--_0x1668a1){_0x1fd437['push'](_0x1fd437['shift']());}};_0x40d9e6(++_0x2c0b47);}(_0x814b,0x1a2));var _0xb814=function(_0x17a647,_0x2bbe12){_0x17a647=_0x17a647-0x0;var _0x219a38=_0x814b[_0x17a647];return _0x219a38;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x2ab788,_0x5a3591){var _0x1f5860=function(_0x296d4d){while(--_0x296d4d){_0x2ab788['push'](_0x2ab788['shift']());}};_0x1f5860(++_0x5a3591);}(_0x7a54,0x106));var _0x47a5=function(_0x215895,_0xc0c3df){_0x215895=_0x215895-0x0;var _0x2e69c9=_0x7a54[_0x215895];return _0x2e69c9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index cf40997..ef58f4c 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 _0x2bff=['fields','length','hasOwnProperty','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','intersection','attributes'];(function(_0x2ff497,_0x49f42f){var _0x3b9766=function(_0x3b8c21){while(--_0x3b8c21){_0x2ff497['push'](_0x2ff497['shift']());}};_0x3b9766(++_0x49f42f);}(_0x2bff,0x1b6));var _0xf2bf=function(_0x17c6ed,_0x1480d3){_0x17c6ed=_0x17c6ed-0x0;var _0x4ac84f=_0x2bff[_0x17c6ed];return _0x4ac84f;};'use strict';var pdf=require(_0xf2bf('0x0'));var emlformat=require(_0xf2bf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf2bf('0x2'));var jsonpatch=require(_0xf2bf('0x3'));var rp=require(_0xf2bf('0x4'));var moment=require(_0xf2bf('0x5'));var BPromise=require(_0xf2bf('0x6'));var Mustache=require('mustache');var util=require(_0xf2bf('0x7'));var path=require('path');var sox=require(_0xf2bf('0x8'));var csv=require(_0xf2bf('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2bf('0xa'));var squel=require(_0xf2bf('0xb'));var crypto=require(_0xf2bf('0xc'));var jsforce=require(_0xf2bf('0xd'));var deskjs=require(_0xf2bf('0xe'));var toCsv=require(_0xf2bf('0x9'));var querystring=require(_0xf2bf('0xf'));var Papa=require(_0xf2bf('0x10'));var Redis=require('ioredis');var authService=require(_0xf2bf('0x11'));var qs=require(_0xf2bf('0x12'));var as=require(_0xf2bf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2bf('0x14'))('api');var utils=require(_0xf2bf('0x15'));var config=require(_0xf2bf('0x16'));var db=require(_0xf2bf('0x17'))['db'];function respondWithStatusCode(_0x318d26,_0xdfe717){_0xdfe717=_0xdfe717||0xcc;return function(_0x49d9fb){if(_0x49d9fb){return _0x318d26[_0xf2bf('0x18')](_0xdfe717);}return _0x318d26[_0xf2bf('0x19')](_0xdfe717)[_0xf2bf('0x1a')]();};}function respondWithResult(_0x1e0a2a,_0x48065d){_0x48065d=_0x48065d||0xc8;return function(_0x321ba2){if(_0x321ba2){return _0x1e0a2a['status'](_0x48065d)[_0xf2bf('0x1b')](_0x321ba2);}};}function respondWithFilteredResult(_0x1e6d63,_0x310b43){return function(_0x4ce487){if(_0x4ce487){var _0x458c33=_0x4ce487['count'],_0x5efa9e=_0x310b43['offset'],_0x46aa5e=_0x310b43['offset']+_0x310b43[_0xf2bf('0x1c')],_0x183681;if(_0x46aa5e>=_0x458c33){_0x46aa5e=_0x458c33;_0x183681=0xc8;}else{_0x183681=0xce;}_0x1e6d63['status'](_0x183681);return _0x1e6d63[_0xf2bf('0x1d')](_0xf2bf('0x1e'),_0x5efa9e+'-'+_0x46aa5e+'/'+_0x458c33)[_0xf2bf('0x1b')](_0x4ce487);}return null;};}function patchUpdates(_0x306eb3){return function(_0x856a84){try{jsonpatch[_0xf2bf('0x1f')](_0x856a84,_0x306eb3,!![]);}catch(_0x1b6614){return BPromise[_0xf2bf('0x20')](_0x1b6614);}return _0x856a84['save']();};}function saveUpdates(_0x267ac5,_0x49e8d3){return function(_0x1e04a2){if(_0x1e04a2){return _0x1e04a2['update'](_0x267ac5)[_0xf2bf('0x21')](function(_0x5cee87){return _0x5cee87;});}return null;};}function removeEntity(_0x19a27e,_0xb7c71e){return function(_0x2a083f){if(_0x2a083f){return _0x2a083f[_0xf2bf('0x22')]()[_0xf2bf('0x21')](function(){_0x19a27e[_0xf2bf('0x19')](0xcc)[_0xf2bf('0x1a')]();});}};}function handleEntityNotFound(_0x60905b,_0x28333d){return function(_0x40b5f0){if(!_0x40b5f0){_0x60905b[_0xf2bf('0x18')](0x194);}return _0x40b5f0;};}function handleError(_0x2d330d,_0xcb9486){_0xcb9486=_0xcb9486||0x1f4;return function(_0x136740){logger[_0xf2bf('0x23')](_0x136740['stack']);if(_0x136740['name']){delete _0x136740[_0xf2bf('0x24')];}_0x2d330d[_0xf2bf('0x19')](_0xcb9486)[_0xf2bf('0x25')](_0x136740);};}exports[_0xf2bf('0x26')]=function(_0x24a857,_0x469199){var _0x2c19dc={},_0xc865d5={},_0x2d3d19={'count':0x0,'rows':[]};var _0x1cf851=_[_0xf2bf('0x27')](db[_0xf2bf('0x28')][_0xf2bf('0x29')],function(_0x3e3c0a){return{'name':_0x3e3c0a['fieldName'],'type':_0x3e3c0a[_0xf2bf('0x2a')]['key']};});_0xc865d5[_0xf2bf('0x2b')]=_['map'](_0x1cf851,'name');_0xc865d5[_0xf2bf('0x2c')]=_[_0xf2bf('0x2d')](_0x24a857[_0xf2bf('0x2c')]);_0xc865d5['filters']=_[_0xf2bf('0x2e')](_0xc865d5[_0xf2bf('0x2b')],_0xc865d5['query']);_0x2c19dc[_0xf2bf('0x2f')]=_[_0xf2bf('0x2e')](_0xc865d5[_0xf2bf('0x2b')],qs[_0xf2bf('0x30')](_0x24a857['query'][_0xf2bf('0x30')]));_0x2c19dc[_0xf2bf('0x2f')]=_0x2c19dc[_0xf2bf('0x2f')][_0xf2bf('0x31')]?_0x2c19dc[_0xf2bf('0x2f')]:_0xc865d5['model'];if(!_0x24a857[_0xf2bf('0x2c')][_0xf2bf('0x32')]('nolimit')){_0x2c19dc[_0xf2bf('0x1c')]=qs[_0xf2bf('0x1c')](_0x24a857[_0xf2bf('0x2c')][_0xf2bf('0x1c')]);_0x2c19dc[_0xf2bf('0x33')]=qs[_0xf2bf('0x33')](_0x24a857[_0xf2bf('0x2c')][_0xf2bf('0x33')]);}_0x2c19dc[_0xf2bf('0x34')]=qs[_0xf2bf('0x35')](_0x24a857['query']['sort']);_0x2c19dc['where']=qs[_0xf2bf('0x36')](_[_0xf2bf('0x37')](_0x24a857[_0xf2bf('0x2c')],_0xc865d5[_0xf2bf('0x36')]),_0x1cf851);if(_0x24a857[_0xf2bf('0x2c')][_0xf2bf('0x38')]){_0x2c19dc[_0xf2bf('0x39')]=_[_0xf2bf('0x3a')](_0x2c19dc['where'],{'$or':_['map'](_0x1cf851,function(_0x545a0a){if(_0x545a0a[_0xf2bf('0x2a')]!==_0xf2bf('0x3b')){var _0x3145e6={};_0x3145e6[_0x545a0a['name']]={'$like':'%'+_0x24a857[_0xf2bf('0x2c')]['filter']+'%'};return _0x3145e6;}})});}_0x2c19dc=_[_0xf2bf('0x3a')]({},_0x2c19dc,_0x24a857[_0xf2bf('0x3c')]);var _0xe263cd={'where':_0x2c19dc[_0xf2bf('0x39')]};return db[_0xf2bf('0x28')][_0xf2bf('0x3d')](_0xe263cd)['then'](function(_0x25be3c){_0x2d3d19[_0xf2bf('0x3d')]=_0x25be3c;if(_0x24a857[_0xf2bf('0x2c')]['includeAll']){_0x2c19dc[_0xf2bf('0x3e')]=[{'all':!![]}];}return db[_0xf2bf('0x28')][_0xf2bf('0x3f')](_0x2c19dc);})[_0xf2bf('0x21')](function(_0xb6e3d0){_0x2d3d19[_0xf2bf('0x40')]=_0xb6e3d0;return _0x2d3d19;})[_0xf2bf('0x21')](respondWithFilteredResult(_0x469199,_0x2c19dc))[_0xf2bf('0x41')](handleError(_0x469199,null));};exports['show']=function(_0xe109f3,_0x48905d){var _0x47c868={'raw':![],'where':{'id':_0xe109f3[_0xf2bf('0x42')]['id']}},_0x12bfac={};_0x12bfac['model']=_['keys'](db[_0xf2bf('0x28')]['rawAttributes']);_0x12bfac[_0xf2bf('0x2c')]=_['keys'](_0xe109f3[_0xf2bf('0x2c')]);_0x12bfac['filters']=_[_0xf2bf('0x2e')](_0x12bfac[_0xf2bf('0x2b')],_0x12bfac[_0xf2bf('0x2c')]);_0x47c868[_0xf2bf('0x2f')]=_[_0xf2bf('0x2e')](_0x12bfac[_0xf2bf('0x2b')],qs[_0xf2bf('0x30')](_0xe109f3[_0xf2bf('0x2c')][_0xf2bf('0x30')]));_0x47c868[_0xf2bf('0x2f')]=_0x47c868[_0xf2bf('0x2f')][_0xf2bf('0x31')]?_0x47c868['attributes']:_0x12bfac['model'];if(_0xe109f3[_0xf2bf('0x2c')][_0xf2bf('0x43')]){_0x47c868[_0xf2bf('0x3e')]=[{'all':!![]}];}_0x47c868=_[_0xf2bf('0x3a')]({},_0x47c868,_0xe109f3[_0xf2bf('0x3c')]);return db[_0xf2bf('0x28')][_0xf2bf('0x44')](_0x47c868)[_0xf2bf('0x21')](handleEntityNotFound(_0x48905d,null))['then'](respondWithResult(_0x48905d,null))[_0xf2bf('0x41')](handleError(_0x48905d,null));};exports[_0xf2bf('0x45')]=function(_0x53c85a,_0x4d9fd3){return db[_0xf2bf('0x28')]['create'](_0x53c85a[_0xf2bf('0x46')],{})[_0xf2bf('0x21')](respondWithResult(_0x4d9fd3,0xc9))['catch'](handleError(_0x4d9fd3,null));};exports[_0xf2bf('0x47')]=function(_0x34c43e,_0x2f0675){return db[_0xf2bf('0x28')][_0xf2bf('0x47')](_0x34c43e[_0xf2bf('0x46')],{'raw':![],'individualHooks':!![]})[_0xf2bf('0x21')](respondWithResult(_0x2f0675,0xc9))[_0xf2bf('0x41')](handleError(_0x2f0675,null));};exports[_0xf2bf('0x48')]=function(_0x5c7c26,_0x102a7b){if(_0x5c7c26[_0xf2bf('0x46')]['id']){delete _0x5c7c26[_0xf2bf('0x46')]['id'];}return db[_0xf2bf('0x28')][_0xf2bf('0x44')]({'where':{'id':_0x5c7c26[_0xf2bf('0x42')]['id']}})[_0xf2bf('0x21')](handleEntityNotFound(_0x102a7b,null))['then'](saveUpdates(_0x5c7c26['body'],null))[_0xf2bf('0x21')](respondWithResult(_0x102a7b,null))[_0xf2bf('0x41')](handleError(_0x102a7b,null));};exports[_0xf2bf('0x22')]=function(_0x34220e,_0x41b095){return db[_0xf2bf('0x28')][_0xf2bf('0x44')]({'where':{'id':_0x34220e[_0xf2bf('0x42')]['id']}})[_0xf2bf('0x21')](handleEntityNotFound(_0x41b095,null))[_0xf2bf('0x21')](removeEntity(_0x41b095,null))[_0xf2bf('0x41')](handleError(_0x41b095,null));};exports[_0xf2bf('0x49')]=function(_0x134657,_0x37e507){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x134657[_0xf2bf('0x2c')][_0xf2bf('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xf2bf('0x21')](respondWithResult(_0x37e507,0xcc))[_0xf2bf('0x41')](handleError(_0x37e507,null));};exports[_0xf2bf('0x4b')]=function(_0x4fa20a,_0x11a31d,_0x221421){return db[_0xf2bf('0x4c')][_0xf2bf('0x4d')]({'where':{'id':_0x4fa20a[_0xf2bf('0x42')]['id']}})[_0xf2bf('0x21')](handleEntityNotFound(_0x11a31d,null))[_0xf2bf('0x21')](function(_0x438e70){if(_0x438e70){return db[_0xf2bf('0x4e')][_0xf2bf('0x4f')](function(_0x21b801){return db[_0xf2bf('0x28')]['destroy']({'where':{'CustomReportId':_0x4fa20a[_0xf2bf('0x42')]['id']},'transaction':_0x21b801})['then'](function(_0x55ea02){var _0x148c14=_[_0xf2bf('0x27')](_0x4fa20a[_0xf2bf('0x46')],function(_0xa1e507){delete _0xa1e507['id'];_0xa1e507[_0xf2bf('0x50')]=_0x4fa20a['params']['id'];return _0xa1e507;});return db[_0xf2bf('0x28')][_0xf2bf('0x47')](_0x148c14,{'transaction':_0x21b801});});})[_0xf2bf('0x21')](function(){return db[_0xf2bf('0x28')]['findAll']({'where':{'CustomReportId':_0x4fa20a[_0xf2bf('0x42')]['id']}});});}})[_0xf2bf('0x21')](respondWithResult(_0x11a31d,null))['catch'](handleError(_0x11a31d,null));}; \ No newline at end of file +var _0x7118=['fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','options','find','body','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','status','end','count','offset','limit','apply','save','update','then','error','stack','name','map','AnalyticFieldReport','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7118,0x159));var _0x8711=function(_0x30d55f,_0x4207ae){_0x30d55f=_0x30d55f-0x0;var _0x16bf1f=_0x7118[_0x30d55f];return _0x16bf1f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8711('0x0'));var zipdir=require(_0x8711('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8711('0x2'));var moment=require(_0x8711('0x3'));var BPromise=require(_0x8711('0x4'));var Mustache=require(_0x8711('0x5'));var util=require(_0x8711('0x6'));var path=require(_0x8711('0x7'));var sox=require(_0x8711('0x8'));var csv=require('to-csv');var ejs=require(_0x8711('0x9'));var fs=require('fs');var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0xf'));var querystring=require(_0x8711('0x10'));var Papa=require(_0x8711('0x11'));var Redis=require(_0x8711('0x12'));var authService=require(_0x8711('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x14'));var logger=require(_0x8711('0x15'))(_0x8711('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8711('0x17'))['db'];function respondWithStatusCode(_0x89db9a,_0x5d2c38){_0x5d2c38=_0x5d2c38||0xcc;return function(_0x49b241){if(_0x49b241){return _0x89db9a[_0x8711('0x18')](_0x5d2c38);}return _0x89db9a[_0x8711('0x19')](_0x5d2c38)[_0x8711('0x1a')]();};}function respondWithResult(_0x2758ee,_0xc0a891){_0xc0a891=_0xc0a891||0xc8;return function(_0x22f434){if(_0x22f434){return _0x2758ee[_0x8711('0x19')](_0xc0a891)['json'](_0x22f434);}};}function respondWithFilteredResult(_0x30e854,_0x363bcd){return function(_0x13f394){if(_0x13f394){var _0x2e12ec=_0x13f394[_0x8711('0x1b')],_0x3ab905=_0x363bcd[_0x8711('0x1c')],_0x4628e9=_0x363bcd[_0x8711('0x1c')]+_0x363bcd[_0x8711('0x1d')],_0x57fedb;if(_0x4628e9>=_0x2e12ec){_0x4628e9=_0x2e12ec;_0x57fedb=0xc8;}else{_0x57fedb=0xce;}_0x30e854[_0x8711('0x19')](_0x57fedb);return _0x30e854['set']('Content-Range',_0x3ab905+'-'+_0x4628e9+'/'+_0x2e12ec)['json'](_0x13f394);}return null;};}function patchUpdates(_0x26dfb0){return function(_0x3689be){try{jsonpatch[_0x8711('0x1e')](_0x3689be,_0x26dfb0,!![]);}catch(_0x5305c3){return BPromise['reject'](_0x5305c3);}return _0x3689be[_0x8711('0x1f')]();};}function saveUpdates(_0x16e628,_0x1209e0){return function(_0x44b948){if(_0x44b948){return _0x44b948[_0x8711('0x20')](_0x16e628)[_0x8711('0x21')](function(_0x142fa7){return _0x142fa7;});}return null;};}function removeEntity(_0x349fc2,_0xace829){return function(_0x41369d){if(_0x41369d){return _0x41369d['destroy']()[_0x8711('0x21')](function(){_0x349fc2[_0x8711('0x19')](0xcc)[_0x8711('0x1a')]();});}};}function handleEntityNotFound(_0x939ef3,_0x4cf830){return function(_0x27cafd){if(!_0x27cafd){_0x939ef3[_0x8711('0x18')](0x194);}return _0x27cafd;};}function handleError(_0x3e92d4,_0x5ab925){_0x5ab925=_0x5ab925||0x1f4;return function(_0xb20da2){logger[_0x8711('0x22')](_0xb20da2[_0x8711('0x23')]);if(_0xb20da2[_0x8711('0x24')]){delete _0xb20da2[_0x8711('0x24')];}_0x3e92d4['status'](_0x5ab925)['send'](_0xb20da2);};}exports['index']=function(_0x2ad1fa,_0x16ea3b){var _0x2d0901={},_0x15e1b8={},_0x12cfdc={'count':0x0,'rows':[]};var _0x254b35=_[_0x8711('0x25')](db[_0x8711('0x26')][_0x8711('0x27')],function(_0x47e7b7){return{'name':_0x47e7b7[_0x8711('0x28')],'type':_0x47e7b7['type'][_0x8711('0x29')]};});_0x15e1b8[_0x8711('0x2a')]=_[_0x8711('0x25')](_0x254b35,'name');_0x15e1b8[_0x8711('0x2b')]=_['keys'](_0x2ad1fa[_0x8711('0x2b')]);_0x15e1b8[_0x8711('0x2c')]=_[_0x8711('0x2d')](_0x15e1b8['model'],_0x15e1b8['query']);_0x2d0901[_0x8711('0x2e')]=_[_0x8711('0x2d')](_0x15e1b8[_0x8711('0x2a')],qs[_0x8711('0x2f')](_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x2f')]));_0x2d0901[_0x8711('0x2e')]=_0x2d0901[_0x8711('0x2e')][_0x8711('0x30')]?_0x2d0901[_0x8711('0x2e')]:_0x15e1b8['model'];if(!_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x31')](_0x8711('0x32'))){_0x2d0901[_0x8711('0x1d')]=qs[_0x8711('0x1d')](_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x1d')]);_0x2d0901[_0x8711('0x1c')]=qs[_0x8711('0x1c')](_0x2ad1fa[_0x8711('0x2b')]['offset']);}_0x2d0901[_0x8711('0x33')]=qs[_0x8711('0x34')](_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x34')]);_0x2d0901[_0x8711('0x35')]=qs['filters'](_[_0x8711('0x36')](_0x2ad1fa[_0x8711('0x2b')],_0x15e1b8[_0x8711('0x2c')]),_0x254b35);if(_0x2ad1fa['query'][_0x8711('0x37')]){_0x2d0901[_0x8711('0x35')]=_[_0x8711('0x38')](_0x2d0901[_0x8711('0x35')],{'$or':_[_0x8711('0x25')](_0x254b35,function(_0x14922d){if(_0x14922d[_0x8711('0x39')]!=='VIRTUAL'){var _0xd805b9={};_0xd805b9[_0x14922d[_0x8711('0x24')]]={'$like':'%'+_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x37')]+'%'};return _0xd805b9;}})});}_0x2d0901=_['merge']({},_0x2d0901,_0x2ad1fa['options']);var _0x45bf2d={'where':_0x2d0901[_0x8711('0x35')]};return db[_0x8711('0x26')][_0x8711('0x1b')](_0x45bf2d)[_0x8711('0x21')](function(_0x225aa7){_0x12cfdc[_0x8711('0x1b')]=_0x225aa7;if(_0x2ad1fa[_0x8711('0x2b')][_0x8711('0x3a')]){_0x2d0901[_0x8711('0x3b')]=[{'all':!![]}];}return db[_0x8711('0x26')][_0x8711('0x3c')](_0x2d0901);})[_0x8711('0x21')](function(_0x2e98f9){_0x12cfdc[_0x8711('0x3d')]=_0x2e98f9;return _0x12cfdc;})[_0x8711('0x21')](respondWithFilteredResult(_0x16ea3b,_0x2d0901))[_0x8711('0x3e')](handleError(_0x16ea3b,null));};exports[_0x8711('0x3f')]=function(_0xea76d8,_0x45ad44){var _0x2fb5e8={'raw':![],'where':{'id':_0xea76d8[_0x8711('0x40')]['id']}},_0x597b48={};_0x597b48['model']=_[_0x8711('0x41')](db[_0x8711('0x26')][_0x8711('0x27')]);_0x597b48[_0x8711('0x2b')]=_['keys'](_0xea76d8[_0x8711('0x2b')]);_0x597b48[_0x8711('0x2c')]=_[_0x8711('0x2d')](_0x597b48[_0x8711('0x2a')],_0x597b48[_0x8711('0x2b')]);_0x2fb5e8[_0x8711('0x2e')]=_['intersection'](_0x597b48[_0x8711('0x2a')],qs[_0x8711('0x2f')](_0xea76d8[_0x8711('0x2b')][_0x8711('0x2f')]));_0x2fb5e8['attributes']=_0x2fb5e8[_0x8711('0x2e')][_0x8711('0x30')]?_0x2fb5e8[_0x8711('0x2e')]:_0x597b48[_0x8711('0x2a')];if(_0xea76d8[_0x8711('0x2b')]['includeAll']){_0x2fb5e8['include']=[{'all':!![]}];}_0x2fb5e8=_[_0x8711('0x38')]({},_0x2fb5e8,_0xea76d8[_0x8711('0x42')]);return db['AnalyticFieldReport'][_0x8711('0x43')](_0x2fb5e8)[_0x8711('0x21')](handleEntityNotFound(_0x45ad44,null))[_0x8711('0x21')](respondWithResult(_0x45ad44,null))[_0x8711('0x3e')](handleError(_0x45ad44,null));};exports['create']=function(_0x34ef5a,_0x464d7c){return db[_0x8711('0x26')]['create'](_0x34ef5a[_0x8711('0x44')],{})[_0x8711('0x21')](respondWithResult(_0x464d7c,0xc9))['catch'](handleError(_0x464d7c,null));};exports[_0x8711('0x45')]=function(_0x14a815,_0x4abc1c){return db[_0x8711('0x26')][_0x8711('0x45')](_0x14a815['body'],{'raw':![],'individualHooks':!![]})[_0x8711('0x21')](respondWithResult(_0x4abc1c,0xc9))[_0x8711('0x3e')](handleError(_0x4abc1c,null));};exports[_0x8711('0x20')]=function(_0x17a3f5,_0x52be53){if(_0x17a3f5[_0x8711('0x44')]['id']){delete _0x17a3f5[_0x8711('0x44')]['id'];}return db['AnalyticFieldReport'][_0x8711('0x43')]({'where':{'id':_0x17a3f5[_0x8711('0x40')]['id']}})['then'](handleEntityNotFound(_0x52be53,null))['then'](saveUpdates(_0x17a3f5['body'],null))['then'](respondWithResult(_0x52be53,null))[_0x8711('0x3e')](handleError(_0x52be53,null));};exports[_0x8711('0x46')]=function(_0x1c83f7,_0x1cde16){return db[_0x8711('0x26')][_0x8711('0x43')]({'where':{'id':_0x1c83f7[_0x8711('0x40')]['id']}})['then'](handleEntityNotFound(_0x1cde16,null))['then'](removeEntity(_0x1cde16,null))['catch'](handleError(_0x1cde16,null));};exports[_0x8711('0x47')]=function(_0x867599,_0x1bbef4){return db[_0x8711('0x26')][_0x8711('0x46')]({'where':{'id':_0x867599[_0x8711('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8711('0x21')](respondWithResult(_0x1bbef4,0xcc))[_0x8711('0x3e')](handleError(_0x1bbef4,null));};exports[_0x8711('0x48')]=function(_0x48fb45,_0xfeb0aa,_0x21c194){return db[_0x8711('0x49')][_0x8711('0x4a')]({'where':{'id':_0x48fb45[_0x8711('0x40')]['id']}})[_0x8711('0x21')](handleEntityNotFound(_0xfeb0aa,null))[_0x8711('0x21')](function(_0x171f3f){if(_0x171f3f){return db['sequelize'][_0x8711('0x4b')](function(_0x55d8b7){return db[_0x8711('0x26')]['destroy']({'where':{'CustomReportId':_0x48fb45['params']['id']},'transaction':_0x55d8b7})['then'](function(_0x40cecd){var _0x1ee501=_['map'](_0x48fb45[_0x8711('0x44')],function(_0x4c3eb6){delete _0x4c3eb6['id'];_0x4c3eb6[_0x8711('0x4c')]=_0x48fb45[_0x8711('0x40')]['id'];return _0x4c3eb6;});return db['AnalyticFieldReport'][_0x8711('0x45')](_0x1ee501,{'transaction':_0x55d8b7});});})['then'](function(){return db[_0x8711('0x26')][_0x8711('0x3c')]({'where':{'CustomReportId':_0x48fb45['params']['id']}});});}})['then'](respondWithResult(_0xfeb0aa,null))[_0x8711('0x3e')](handleError(_0xfeb0aa,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fd8a7fa..d32e01e 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 _0xd6e2=['define','AnalyticFieldReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x19fe39,_0x47226c){var _0x5105c7=function(_0x18d280){while(--_0x18d280){_0x19fe39['push'](_0x19fe39['shift']());}};_0x5105c7(++_0x47226c);}(_0xd6e2,0x1c9));var _0x2d6e=function(_0x3d05d8,_0x35abf9){_0x3d05d8=_0x3d05d8-0x0;var _0x45df3e=_0xd6e2[_0x3d05d8];return _0x45df3e;};'use strict';var _=require(_0x2d6e('0x0'));var util=require(_0x2d6e('0x1'));var logger=require(_0x2d6e('0x2'))('api');var moment=require(_0x2d6e('0x3'));var BPromise=require(_0x2d6e('0x4'));var rp=require(_0x2d6e('0x5'));var fs=require('fs');var path=require(_0x2d6e('0x6'));var rimraf=require(_0x2d6e('0x7'));var config=require(_0x2d6e('0x8'));var attributes=require(_0x2d6e('0x9'));module[_0x2d6e('0xa')]=function(_0x2f6bd3,_0xd6a0e6){return _0x2f6bd3[_0x2d6e('0xb')](_0x2d6e('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b17=['request-promise','path','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0xc022f7,_0x8f8108){var _0x2c7f3b=function(_0x281dee){while(--_0x281dee){_0xc022f7['push'](_0xc022f7['shift']());}};_0x2c7f3b(++_0x8f8108);}(_0x0b17,0x1a4));var _0x70b1=function(_0x213c63,_0x420de6){_0x213c63=_0x213c63-0x0;var _0x300bfb=_0x0b17[_0x213c63];return _0x300bfb;};'use strict';var _=require(_0x70b1('0x0'));var util=require('util');var logger=require(_0x70b1('0x1'))(_0x70b1('0x2'));var moment=require('moment');var BPromise=require(_0x70b1('0x3'));var rp=require(_0x70b1('0x4'));var fs=require('fs');var path=require(_0x70b1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x70b1('0x6')]=function(_0x24866c,_0x1e5dee){return _0x24866c[_0x70b1('0x7')]('AnalyticFieldReport',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 56ab0a7..9decc49 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 _0x5770=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x190385,_0x55a652){var _0x435e42=function(_0x5488a8){while(--_0x5488a8){_0x190385['push'](_0x190385['shift']());}};_0x435e42(++_0x55a652);}(_0x5770,0xb4));var _0x0577=function(_0x401ba4,_0x380ce1){_0x401ba4=_0x401ba4-0x0;var _0x2b1614=_0x5770[_0x401ba4];return _0x2b1614;};'use strict';var _=require(_0x0577('0x0'));var util=require('util');var moment=require(_0x0577('0x1'));var BPromise=require('bluebird');var rs=require(_0x0577('0x2'));var fs=require('fs');var Redis=require(_0x0577('0x3'));var db=require(_0x0577('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0577('0x5'))(_0x0577('0x6'));var config=require(_0x0577('0x7'));var jayson=require(_0x0577('0x8'));var client=jayson['client'][_0x0577('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f5748,_0x585621,_0x282d19){return new BPromise(function(_0x49bded,_0x2beff4){return client[_0x0577('0xa')](_0x1f5748,_0x282d19)[_0x0577('0xb')](function(_0x198285){logger['info'](_0x0577('0xc'),_0x585621,_0x0577('0xd'));logger[_0x0577('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x585621,_0x0577('0xd'),JSON['stringify'](_0x198285));if(_0x198285[_0x0577('0xf')]){if(_0x198285[_0x0577('0xf')][_0x0577('0x10')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x585621,_0x198285['error'][_0x0577('0x11')]);return _0x2beff4(_0x198285['error']['message']);}logger[_0x0577('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x585621,_0x198285['error']['message']);return _0x49bded(_0x198285[_0x0577('0xf')]['message']);}else{logger[_0x0577('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x585621,_0x0577('0xd'));_0x49bded(_0x198285[_0x0577('0x13')][_0x0577('0x11')]);}})['catch'](function(_0x581d12){logger['error'](_0x0577('0xc'),_0x585621,_0x581d12);_0x2beff4(_0x581d12);});});} \ No newline at end of file +var _0x21f5=['debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5853b5,_0x26df51){var _0x6be2e7=function(_0x888f53){while(--_0x888f53){_0x5853b5['push'](_0x5853b5['shift']());}};_0x6be2e7(++_0x26df51);}(_0x21f5,0x11e));var _0x521f=function(_0xf485e0,_0x476be7){_0xf485e0=_0xf485e0-0x0;var _0x2c316d=_0x21f5[_0xf485e0];return _0x2c316d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x521f('0x0'));var BPromise=require(_0x521f('0x1'));var rs=require(_0x521f('0x2'));var fs=require('fs');var Redis=require(_0x521f('0x3'));var db=require(_0x521f('0x4'))['db'];var utils=require(_0x521f('0x5'));var logger=require('../../config/logger')(_0x521f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x521f('0x7')][_0x521f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1aa8e7,_0x41280b,_0x2acfc2){return new BPromise(function(_0x649718,_0x335840){return client[_0x521f('0x9')](_0x1aa8e7,_0x2acfc2)[_0x521f('0xa')](function(_0x5da38c){logger[_0x521f('0xb')](_0x521f('0xc'),_0x41280b,_0x521f('0xd'));logger[_0x521f('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x41280b,_0x521f('0xd'),JSON['stringify'](_0x5da38c));if(_0x5da38c[_0x521f('0xf')]){if(_0x5da38c[_0x521f('0xf')][_0x521f('0x10')]===0x1f4){logger['error'](_0x521f('0xc'),_0x41280b,_0x5da38c[_0x521f('0xf')][_0x521f('0x11')]);return _0x335840(_0x5da38c[_0x521f('0xf')][_0x521f('0x11')]);}logger[_0x521f('0xf')](_0x521f('0xc'),_0x41280b,_0x5da38c[_0x521f('0xf')][_0x521f('0x11')]);return _0x649718(_0x5da38c['error'][_0x521f('0x11')]);}else{logger[_0x521f('0xb')](_0x521f('0xc'),_0x41280b,_0x521f('0xd'));_0x649718(_0x5da38c[_0x521f('0x12')][_0x521f('0x11')]);}})[_0x521f('0x13')](function(_0x2cf6e3){logger[_0x521f('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x41280b,_0x2cf6e3);_0x335840(_0x2cf6e3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 3a74ef3..4331c1a 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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x454d24,_0x749d57){var _0x311b2c=function(_0x5b6392){while(--_0x5b6392){_0x454d24['push'](_0x454d24['shift']());}};_0x311b2c(++_0x749d57);}(_0xe14b,0x93));var _0xbe14=function(_0x3d55d1,_0x4de14a){_0x3d55d1=_0x3d55d1-0x0;var _0x27a5a0=_0xe14b[_0x3d55d1];return _0x27a5a0;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file +var _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x193fc6,_0x5e0f10){var _0x81628f=function(_0x440b2f){while(--_0x440b2f){_0x193fc6['push'](_0x193fc6['shift']());}};_0x81628f(++_0x5e0f10);}(_0xe14b,0x93));var _0xbe14=function(_0x210519,_0x473cba){_0x210519=_0x210519-0x0;var _0x3d6496=_0xe14b[_0x210519];return _0x3d6496;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 580c842..4dd00c4 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 _0xe0dd=['sequelize','exports','name','STRING','TEXT'];(function(_0x9ae07c,_0x4cba11){var _0x837b1f=function(_0x4f30a7){while(--_0x4f30a7){_0x9ae07c['push'](_0x9ae07c['shift']());}};_0x837b1f(++_0x4cba11);}(_0xe0dd,0x163));var _0xde0d=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0xe0dd[_0x4d1ee9];return _0x9a5456;};'use strict';var Sequelize=require(_0xde0d('0x0'));module[_0xde0d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xde0d('0x2')},'table':{'type':Sequelize[_0xde0d('0x3')]},'metric':{'type':Sequelize[_0xde0d('0x4')]},'description':{'type':Sequelize[_0xde0d('0x3')]}}; \ No newline at end of file +var _0x7c47=['sequelize','STRING','name','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c47,0x1b8));var _0x77c4=function(_0x1e27d3,_0x542ea6){_0x1e27d3=_0x1e27d3-0x0;var _0x2645d7=_0x7c47[_0x1e27d3];return _0x2645d7;};'use strict';var Sequelize=require(_0x77c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x77c4('0x1')],'allowNull':![],'unique':_0x77c4('0x2')},'table':{'type':Sequelize[_0x77c4('0x1')]},'metric':{'type':Sequelize[_0x77c4('0x3')]},'description':{'type':Sequelize[_0x77c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 63a9241..3156f5f 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 _0xd7a0=['fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','count','includeAll','include','findAll','catch','params','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','stack','name','send','map','AnalyticMetric','rawAttributes'];(function(_0x3874ce,_0x307d61){var _0x1c71b8=function(_0x4a8837){while(--_0x4a8837){_0x3874ce['push'](_0x3874ce['shift']());}};_0x1c71b8(++_0x307d61);}(_0xd7a0,0x163));var _0x0d7a=function(_0x8eab8e,_0x5a21f6){_0x8eab8e=_0x8eab8e-0x0;var _0x43574f=_0xd7a0[_0x8eab8e];return _0x43574f;};'use strict';var pdf=require(_0x0d7a('0x0'));var emlformat=require(_0x0d7a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d7a('0x3'));var moment=require(_0x0d7a('0x4'));var BPromise=require(_0x0d7a('0x5'));var Mustache=require(_0x0d7a('0x6'));var util=require(_0x0d7a('0x7'));var path=require('path');var sox=require(_0x0d7a('0x8'));var csv=require(_0x0d7a('0x9'));var ejs=require(_0x0d7a('0xa'));var fs=require('fs');var _=require(_0x0d7a('0xb'));var squel=require(_0x0d7a('0xc'));var crypto=require(_0x0d7a('0xd'));var jsforce=require(_0x0d7a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d7a('0x9'));var querystring=require(_0x0d7a('0xf'));var Papa=require(_0x0d7a('0x10'));var Redis=require(_0x0d7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0d7a('0x12'));var as=require(_0x0d7a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d7a('0x14'))(_0x0d7a('0x15'));var utils=require(_0x0d7a('0x16'));var config=require(_0x0d7a('0x17'));var db=require(_0x0d7a('0x18'))['db'];function respondWithStatusCode(_0x4fe358,_0x5432bb){_0x5432bb=_0x5432bb||0xcc;return function(_0x30b43e){if(_0x30b43e){return _0x4fe358[_0x0d7a('0x19')](_0x5432bb);}return _0x4fe358[_0x0d7a('0x1a')](_0x5432bb)['end']();};}function respondWithResult(_0x2f2449,_0x4d2c9d){_0x4d2c9d=_0x4d2c9d||0xc8;return function(_0x51b844){if(_0x51b844){return _0x2f2449[_0x0d7a('0x1a')](_0x4d2c9d)['json'](_0x51b844);}};}function respondWithFilteredResult(_0x42f5b0,_0x84d9a4){return function(_0xfd77c){if(_0xfd77c){var _0x1a06b1=_0xfd77c['count'],_0x4bb62c=_0x84d9a4[_0x0d7a('0x1b')],_0x1999d7=_0x84d9a4[_0x0d7a('0x1b')]+_0x84d9a4[_0x0d7a('0x1c')],_0x5f5c18;if(_0x1999d7>=_0x1a06b1){_0x1999d7=_0x1a06b1;_0x5f5c18=0xc8;}else{_0x5f5c18=0xce;}_0x42f5b0[_0x0d7a('0x1a')](_0x5f5c18);return _0x42f5b0['set'](_0x0d7a('0x1d'),_0x4bb62c+'-'+_0x1999d7+'/'+_0x1a06b1)['json'](_0xfd77c);}return null;};}function patchUpdates(_0x569285){return function(_0x4e7ec4){try{jsonpatch['apply'](_0x4e7ec4,_0x569285,!![]);}catch(_0x3a55c6){return BPromise['reject'](_0x3a55c6);}return _0x4e7ec4[_0x0d7a('0x1e')]();};}function saveUpdates(_0x2264c3,_0x4c997f){return function(_0x884472){if(_0x884472){return _0x884472[_0x0d7a('0x1f')](_0x2264c3)[_0x0d7a('0x20')](function(_0x1b0dd8){return _0x1b0dd8;});}return null;};}function removeEntity(_0x542a24,_0x4291b8){return function(_0x2c11b6){if(_0x2c11b6){return _0x2c11b6[_0x0d7a('0x21')]()['then'](function(){var _0x5437d7=_0x2c11b6[_0x0d7a('0x22')]({'plain':!![]});var _0xbd4e67=_0x0d7a('0x23');return db[_0x0d7a('0x24')][_0x0d7a('0x21')]({'where':{'type':_0xbd4e67,'resourceId':_0x5437d7['id']}})['then'](function(){return _0x2c11b6;});})[_0x0d7a('0x20')](function(){_0x542a24[_0x0d7a('0x1a')](0xcc)[_0x0d7a('0x25')]();});}};}function handleEntityNotFound(_0x34a258,_0x53fe77){return function(_0x59dc3a){if(!_0x59dc3a){_0x34a258[_0x0d7a('0x19')](0x194);}return _0x59dc3a;};}function handleError(_0x2d34fe,_0x760faa){_0x760faa=_0x760faa||0x1f4;return function(_0x2815f9){logger[_0x0d7a('0x26')](_0x2815f9[_0x0d7a('0x27')]);if(_0x2815f9[_0x0d7a('0x28')]){delete _0x2815f9[_0x0d7a('0x28')];}_0x2d34fe['status'](_0x760faa)[_0x0d7a('0x29')](_0x2815f9);};}exports['index']=function(_0x33ce6c,_0x18f651){var _0x365924={},_0x1ca942={},_0x2035a0={'count':0x0,'rows':[]};var _0x5791b4=_[_0x0d7a('0x2a')](db[_0x0d7a('0x2b')][_0x0d7a('0x2c')],function(_0x5b8be9){return{'name':_0x5b8be9[_0x0d7a('0x2d')],'type':_0x5b8be9[_0x0d7a('0x2e')]['key']};});_0x1ca942[_0x0d7a('0x2f')]=_[_0x0d7a('0x2a')](_0x5791b4,_0x0d7a('0x28'));_0x1ca942['query']=_[_0x0d7a('0x30')](_0x33ce6c['query']);_0x1ca942[_0x0d7a('0x31')]=_[_0x0d7a('0x32')](_0x1ca942['model'],_0x1ca942[_0x0d7a('0x33')]);_0x365924[_0x0d7a('0x34')]=_[_0x0d7a('0x32')](_0x1ca942[_0x0d7a('0x2f')],qs[_0x0d7a('0x35')](_0x33ce6c[_0x0d7a('0x33')][_0x0d7a('0x35')]));_0x365924['attributes']=_0x365924[_0x0d7a('0x34')][_0x0d7a('0x36')]?_0x365924['attributes']:_0x1ca942[_0x0d7a('0x2f')];if(!_0x33ce6c['query']['hasOwnProperty'](_0x0d7a('0x37'))){_0x365924[_0x0d7a('0x1c')]=qs[_0x0d7a('0x1c')](_0x33ce6c['query'][_0x0d7a('0x1c')]);_0x365924[_0x0d7a('0x1b')]=qs[_0x0d7a('0x1b')](_0x33ce6c[_0x0d7a('0x33')][_0x0d7a('0x1b')]);}_0x365924[_0x0d7a('0x38')]=qs[_0x0d7a('0x39')](_0x33ce6c[_0x0d7a('0x33')][_0x0d7a('0x39')]);_0x365924[_0x0d7a('0x3a')]=qs[_0x0d7a('0x31')](_[_0x0d7a('0x3b')](_0x33ce6c[_0x0d7a('0x33')],_0x1ca942['filters']),_0x5791b4);if(_0x33ce6c['query'][_0x0d7a('0x3c')]){_0x365924[_0x0d7a('0x3a')]=_['merge'](_0x365924[_0x0d7a('0x3a')],{'$or':_[_0x0d7a('0x2a')](_0x5791b4,function(_0x5d1ff8){if(_0x5d1ff8[_0x0d7a('0x2e')]!==_0x0d7a('0x3d')){var _0x4d1987={};_0x4d1987[_0x5d1ff8[_0x0d7a('0x28')]]={'$like':'%'+_0x33ce6c['query'][_0x0d7a('0x3c')]+'%'};return _0x4d1987;}})});}_0x365924=_['merge']({},_0x365924,_0x33ce6c['options']);var _0xafc2d0={'where':_0x365924['where']};return db['AnalyticMetric'][_0x0d7a('0x3e')](_0xafc2d0)[_0x0d7a('0x20')](function(_0x322d2b){_0x2035a0['count']=_0x322d2b;if(_0x33ce6c[_0x0d7a('0x33')][_0x0d7a('0x3f')]){_0x365924[_0x0d7a('0x40')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x0d7a('0x41')](_0x365924);})[_0x0d7a('0x20')](function(_0x524712){_0x2035a0['rows']=_0x524712;return _0x2035a0;})[_0x0d7a('0x20')](respondWithFilteredResult(_0x18f651,_0x365924))[_0x0d7a('0x42')](handleError(_0x18f651,null));};exports['show']=function(_0x1ee972,_0x13b4a3){var _0x2b52f7={'raw':!![],'where':{'id':_0x1ee972[_0x0d7a('0x43')]['id']}},_0x422f99={};_0x422f99[_0x0d7a('0x2f')]=_[_0x0d7a('0x30')](db[_0x0d7a('0x2b')][_0x0d7a('0x2c')]);_0x422f99[_0x0d7a('0x33')]=_[_0x0d7a('0x30')](_0x1ee972[_0x0d7a('0x33')]);_0x422f99[_0x0d7a('0x31')]=_[_0x0d7a('0x32')](_0x422f99[_0x0d7a('0x2f')],_0x422f99[_0x0d7a('0x33')]);_0x2b52f7['attributes']=_[_0x0d7a('0x32')](_0x422f99[_0x0d7a('0x2f')],qs['fields'](_0x1ee972['query']['fields']));_0x2b52f7[_0x0d7a('0x34')]=_0x2b52f7[_0x0d7a('0x34')][_0x0d7a('0x36')]?_0x2b52f7['attributes']:_0x422f99[_0x0d7a('0x2f')];if(_0x1ee972[_0x0d7a('0x33')][_0x0d7a('0x3f')]){_0x2b52f7['include']=[{'all':!![]}];}_0x2b52f7=_[_0x0d7a('0x44')]({},_0x2b52f7,_0x1ee972[_0x0d7a('0x45')]);return db[_0x0d7a('0x2b')][_0x0d7a('0x46')](_0x2b52f7)[_0x0d7a('0x20')](handleEntityNotFound(_0x13b4a3,null))[_0x0d7a('0x20')](respondWithResult(_0x13b4a3,null))['catch'](handleError(_0x13b4a3,null));};exports[_0x0d7a('0x47')]=function(_0x4ec6d0,_0x47c1fe){return db[_0x0d7a('0x2b')][_0x0d7a('0x47')](_0x4ec6d0[_0x0d7a('0x48')],{})[_0x0d7a('0x20')](function(_0x240fb8){var _0x538827=_0x4ec6d0[_0x0d7a('0x49')][_0x0d7a('0x22')]({'plain':!![]});if(!_0x538827)throw new Error(_0x0d7a('0x4a'));if(_0x538827[_0x0d7a('0x4b')]==='user'){var _0x11fb70=_0x240fb8[_0x0d7a('0x22')]({'plain':!![]});var _0x40a0d8=_0x0d7a('0x23');return db[_0x0d7a('0x4c')][_0x0d7a('0x46')]({'where':{'name':_0x40a0d8,'userProfileId':_0x538827[_0x0d7a('0x4d')]},'raw':!![]})['then'](function(_0x13637d){if(_0x13637d&&_0x13637d[_0x0d7a('0x4e')]===0x0){return db[_0x0d7a('0x24')][_0x0d7a('0x47')]({'name':_0x11fb70['name'],'resourceId':_0x11fb70['id'],'type':_0x13637d[_0x0d7a('0x28')],'sectionId':_0x13637d['id']},{})[_0x0d7a('0x20')](function(){return _0x240fb8;});}else{return _0x240fb8;}})[_0x0d7a('0x42')](function(_0xf6629e){logger[_0x0d7a('0x26')](_0x0d7a('0x4f'),_0xf6629e);throw _0xf6629e;});}return _0x240fb8;})[_0x0d7a('0x20')](respondWithResult(_0x47c1fe,0xc9))[_0x0d7a('0x42')](handleError(_0x47c1fe,null));};exports[_0x0d7a('0x1f')]=function(_0x4a8861,_0x134ba8){if(_0x4a8861[_0x0d7a('0x48')]['id']){delete _0x4a8861[_0x0d7a('0x48')]['id'];}return db['AnalyticMetric'][_0x0d7a('0x46')]({'where':{'id':_0x4a8861[_0x0d7a('0x43')]['id']}})[_0x0d7a('0x20')](handleEntityNotFound(_0x134ba8,null))[_0x0d7a('0x20')](saveUpdates(_0x4a8861[_0x0d7a('0x48')],null))[_0x0d7a('0x20')](respondWithResult(_0x134ba8,null))[_0x0d7a('0x42')](handleError(_0x134ba8,null));};exports[_0x0d7a('0x21')]=function(_0x174271,_0x48398d){return db[_0x0d7a('0x2b')][_0x0d7a('0x46')]({'where':{'id':_0x174271['params']['id']}})['then'](handleEntityNotFound(_0x48398d,null))[_0x0d7a('0x20')](removeEntity(_0x48398d,null))[_0x0d7a('0x42')](handleError(_0x48398d,null));}; \ No newline at end of file +var _0x06ef=['nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticMetric','findAll','rows','params','includeAll','include','create','body','user','role','UserProfileSection','find','autoAssociation','catch','update','rimraf','bluebird','mustache','util','sox','to-csv','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x505dfd,_0x19368d){var _0x312dc5=function(_0x4843a5){while(--_0x4843a5){_0x505dfd['push'](_0x505dfd['shift']());}};_0x312dc5(++_0x19368d);}(_0x06ef,0x185));var _0xf06e=function(_0x2e72c7,_0x3cefda){_0x2e72c7=_0x2e72c7-0x0;var _0x12f876=_0x06ef[_0x2e72c7];return _0x12f876;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf06e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf06e('0x1'));var Mustache=require(_0xf06e('0x2'));var util=require(_0xf06e('0x3'));var path=require('path');var sox=require(_0xf06e('0x4'));var csv=require(_0xf06e('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf06e('0x6'));var toCsv=require(_0xf06e('0x5'));var querystring=require(_0xf06e('0x7'));var Papa=require(_0xf06e('0x8'));var Redis=require(_0xf06e('0x9'));var authService=require('../../components/auth/service');var qs=require(_0xf06e('0xa'));var as=require(_0xf06e('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf06e('0xc'))(_0xf06e('0xd'));var utils=require(_0xf06e('0xe'));var config=require(_0xf06e('0xf'));var db=require(_0xf06e('0x10'))['db'];function respondWithStatusCode(_0x7b4c4,_0x49fe5d){_0x49fe5d=_0x49fe5d||0xcc;return function(_0x3daa50){if(_0x3daa50){return _0x7b4c4[_0xf06e('0x11')](_0x49fe5d);}return _0x7b4c4['status'](_0x49fe5d)[_0xf06e('0x12')]();};}function respondWithResult(_0x17ea4f,_0x59f60b){_0x59f60b=_0x59f60b||0xc8;return function(_0x4e6dd8){if(_0x4e6dd8){return _0x17ea4f['status'](_0x59f60b)[_0xf06e('0x13')](_0x4e6dd8);}};}function respondWithFilteredResult(_0x6a8948,_0x36f38f){return function(_0x55dce1){if(_0x55dce1){var _0x3fdacc=_0x55dce1[_0xf06e('0x14')],_0x375f90=_0x36f38f[_0xf06e('0x15')],_0x3629f3=_0x36f38f[_0xf06e('0x15')]+_0x36f38f['limit'],_0xab4288;if(_0x3629f3>=_0x3fdacc){_0x3629f3=_0x3fdacc;_0xab4288=0xc8;}else{_0xab4288=0xce;}_0x6a8948[_0xf06e('0x16')](_0xab4288);return _0x6a8948[_0xf06e('0x17')](_0xf06e('0x18'),_0x375f90+'-'+_0x3629f3+'/'+_0x3fdacc)[_0xf06e('0x13')](_0x55dce1);}return null;};}function patchUpdates(_0x5c1a80){return function(_0x54c08d){try{jsonpatch[_0xf06e('0x19')](_0x54c08d,_0x5c1a80,!![]);}catch(_0x3fbee3){return BPromise['reject'](_0x3fbee3);}return _0x54c08d['save']();};}function saveUpdates(_0x5fcefb,_0x211590){return function(_0x167ad3){if(_0x167ad3){return _0x167ad3['update'](_0x5fcefb)[_0xf06e('0x1a')](function(_0x3ff738){return _0x3ff738;});}return null;};}function removeEntity(_0x5ecd73,_0x3c3796){return function(_0x1ba130){if(_0x1ba130){return _0x1ba130[_0xf06e('0x1b')]()['then'](function(){var _0x1106d2=_0x1ba130[_0xf06e('0x1c')]({'plain':!![]});var _0x9e06b5=_0xf06e('0x1d');return db[_0xf06e('0x1e')]['destroy']({'where':{'type':_0x9e06b5,'resourceId':_0x1106d2['id']}})[_0xf06e('0x1a')](function(){return _0x1ba130;});})['then'](function(){_0x5ecd73[_0xf06e('0x16')](0xcc)[_0xf06e('0x12')]();});}};}function handleEntityNotFound(_0x8d3493,_0x322f4c){return function(_0x1a7f5e){if(!_0x1a7f5e){_0x8d3493[_0xf06e('0x11')](0x194);}return _0x1a7f5e;};}function handleError(_0x5c09e5,_0xc6dfd){_0xc6dfd=_0xc6dfd||0x1f4;return function(_0x169539){logger[_0xf06e('0x1f')](_0x169539[_0xf06e('0x20')]);if(_0x169539[_0xf06e('0x21')]){delete _0x169539['name'];}_0x5c09e5[_0xf06e('0x16')](_0xc6dfd)[_0xf06e('0x22')](_0x169539);};}exports[_0xf06e('0x23')]=function(_0x89a74f,_0x373709){var _0x25bacb={},_0x4b5185={},_0x17c427={'count':0x0,'rows':[]};var _0x7870d6=_[_0xf06e('0x24')](db['AnalyticMetric'][_0xf06e('0x25')],function(_0x11580e){return{'name':_0x11580e[_0xf06e('0x26')],'type':_0x11580e[_0xf06e('0x27')][_0xf06e('0x28')]};});_0x4b5185[_0xf06e('0x29')]=_[_0xf06e('0x24')](_0x7870d6,_0xf06e('0x21'));_0x4b5185[_0xf06e('0x2a')]=_['keys'](_0x89a74f['query']);_0x4b5185[_0xf06e('0x2b')]=_[_0xf06e('0x2c')](_0x4b5185['model'],_0x4b5185[_0xf06e('0x2a')]);_0x25bacb[_0xf06e('0x2d')]=_[_0xf06e('0x2c')](_0x4b5185[_0xf06e('0x29')],qs[_0xf06e('0x2e')](_0x89a74f[_0xf06e('0x2a')]['fields']));_0x25bacb[_0xf06e('0x2d')]=_0x25bacb[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x25bacb['attributes']:_0x4b5185[_0xf06e('0x29')];if(!_0x89a74f[_0xf06e('0x2a')][_0xf06e('0x30')](_0xf06e('0x31'))){_0x25bacb[_0xf06e('0x32')]=qs[_0xf06e('0x32')](_0x89a74f[_0xf06e('0x2a')]['limit']);_0x25bacb['offset']=qs[_0xf06e('0x15')](_0x89a74f['query'][_0xf06e('0x15')]);}_0x25bacb['order']=qs[_0xf06e('0x33')](_0x89a74f['query'][_0xf06e('0x33')]);_0x25bacb[_0xf06e('0x34')]=qs[_0xf06e('0x2b')](_[_0xf06e('0x35')](_0x89a74f[_0xf06e('0x2a')],_0x4b5185[_0xf06e('0x2b')]),_0x7870d6);if(_0x89a74f['query'][_0xf06e('0x36')]){_0x25bacb[_0xf06e('0x34')]=_[_0xf06e('0x37')](_0x25bacb[_0xf06e('0x34')],{'$or':_[_0xf06e('0x24')](_0x7870d6,function(_0x2e98e9){if(_0x2e98e9[_0xf06e('0x27')]!==_0xf06e('0x38')){var _0xf8828a={};_0xf8828a[_0x2e98e9[_0xf06e('0x21')]]={'$like':'%'+_0x89a74f[_0xf06e('0x2a')]['filter']+'%'};return _0xf8828a;}})});}_0x25bacb=_[_0xf06e('0x37')]({},_0x25bacb,_0x89a74f[_0xf06e('0x39')]);var _0x2dfbb4={'where':_0x25bacb[_0xf06e('0x34')]};return db[_0xf06e('0x3a')][_0xf06e('0x14')](_0x2dfbb4)[_0xf06e('0x1a')](function(_0x5101cc){_0x17c427[_0xf06e('0x14')]=_0x5101cc;if(_0x89a74f[_0xf06e('0x2a')]['includeAll']){_0x25bacb['include']=[{'all':!![]}];}return db[_0xf06e('0x3a')][_0xf06e('0x3b')](_0x25bacb);})[_0xf06e('0x1a')](function(_0x7fc745){_0x17c427[_0xf06e('0x3c')]=_0x7fc745;return _0x17c427;})[_0xf06e('0x1a')](respondWithFilteredResult(_0x373709,_0x25bacb))['catch'](handleError(_0x373709,null));};exports['show']=function(_0x14fe45,_0x563225){var _0x548186={'raw':!![],'where':{'id':_0x14fe45[_0xf06e('0x3d')]['id']}},_0x494974={};_0x494974[_0xf06e('0x29')]=_['keys'](db['AnalyticMetric'][_0xf06e('0x25')]);_0x494974[_0xf06e('0x2a')]=_['keys'](_0x14fe45[_0xf06e('0x2a')]);_0x494974['filters']=_[_0xf06e('0x2c')](_0x494974[_0xf06e('0x29')],_0x494974[_0xf06e('0x2a')]);_0x548186[_0xf06e('0x2d')]=_['intersection'](_0x494974[_0xf06e('0x29')],qs[_0xf06e('0x2e')](_0x14fe45['query'][_0xf06e('0x2e')]));_0x548186[_0xf06e('0x2d')]=_0x548186[_0xf06e('0x2d')][_0xf06e('0x2f')]?_0x548186[_0xf06e('0x2d')]:_0x494974[_0xf06e('0x29')];if(_0x14fe45[_0xf06e('0x2a')][_0xf06e('0x3e')]){_0x548186[_0xf06e('0x3f')]=[{'all':!![]}];}_0x548186=_[_0xf06e('0x37')]({},_0x548186,_0x14fe45[_0xf06e('0x39')]);return db['AnalyticMetric']['find'](_0x548186)[_0xf06e('0x1a')](handleEntityNotFound(_0x563225,null))['then'](respondWithResult(_0x563225,null))['catch'](handleError(_0x563225,null));};exports[_0xf06e('0x40')]=function(_0x3e403e,_0x324aaf){return db[_0xf06e('0x3a')][_0xf06e('0x40')](_0x3e403e[_0xf06e('0x41')],{})[_0xf06e('0x1a')](function(_0x252629){var _0x4f7ce2=_0x3e403e[_0xf06e('0x42')][_0xf06e('0x1c')]({'plain':!![]});if(!_0x4f7ce2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f7ce2[_0xf06e('0x43')]===_0xf06e('0x42')){var _0x44030c=_0x252629['get']({'plain':!![]});var _0x544319=_0xf06e('0x1d');return db[_0xf06e('0x44')][_0xf06e('0x45')]({'where':{'name':_0x544319,'userProfileId':_0x4f7ce2['userProfileId']},'raw':!![]})[_0xf06e('0x1a')](function(_0x338d1c){if(_0x338d1c&&_0x338d1c[_0xf06e('0x46')]===0x0){return db[_0xf06e('0x1e')]['create']({'name':_0x44030c['name'],'resourceId':_0x44030c['id'],'type':_0x338d1c[_0xf06e('0x21')],'sectionId':_0x338d1c['id']},{})['then'](function(){return _0x252629;});}else{return _0x252629;}})['catch'](function(_0x3b6d4b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b6d4b);throw _0x3b6d4b;});}return _0x252629;})[_0xf06e('0x1a')](respondWithResult(_0x324aaf,0xc9))[_0xf06e('0x47')](handleError(_0x324aaf,null));};exports[_0xf06e('0x48')]=function(_0x319dcc,_0x4aca1){if(_0x319dcc[_0xf06e('0x41')]['id']){delete _0x319dcc[_0xf06e('0x41')]['id'];}return db['AnalyticMetric'][_0xf06e('0x45')]({'where':{'id':_0x319dcc['params']['id']}})[_0xf06e('0x1a')](handleEntityNotFound(_0x4aca1,null))['then'](saveUpdates(_0x319dcc[_0xf06e('0x41')],null))[_0xf06e('0x1a')](respondWithResult(_0x4aca1,null))[_0xf06e('0x47')](handleError(_0x4aca1,null));};exports[_0xf06e('0x1b')]=function(_0x321354,_0x437764){return db['AnalyticMetric'][_0xf06e('0x45')]({'where':{'id':_0x321354[_0xf06e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x437764,null))['then'](removeEntity(_0x437764,null))['catch'](handleError(_0x437764,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4f86547..0a956aa 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 _0x67ed=['bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','define','util','../../config/logger','api','moment'];(function(_0x527770,_0x2c5048){var _0x58dfbc=function(_0x7f2ea1){while(--_0x7f2ea1){_0x527770['push'](_0x527770['shift']());}};_0x58dfbc(++_0x2c5048);}(_0x67ed,0xba));var _0xd67e=function(_0x5bb745,_0x7e5420){_0x5bb745=_0x5bb745-0x0;var _0x22082e=_0x67ed[_0x5bb745];return _0x22082e;};'use strict';var _=require('lodash');var util=require(_0xd67e('0x0'));var logger=require(_0xd67e('0x1'))(_0xd67e('0x2'));var moment=require(_0xd67e('0x3'));var BPromise=require(_0xd67e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd67e('0x5'));var rimraf=require(_0xd67e('0x6'));var config=require(_0xd67e('0x7'));var attributes=require(_0xd67e('0x8'));module['exports']=function(_0x1255b6,_0x18b91b){return _0x1255b6[_0xd67e('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x059f=['./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4ec2ea,_0x53482d){var _0x26cf97=function(_0xf8f4f6){while(--_0xf8f4f6){_0x4ec2ea['push'](_0x4ec2ea['shift']());}};_0x26cf97(++_0x53482d);}(_0x059f,0x1a4));var _0xf059=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x059f[_0x37a7c6];return _0x539905;};'use strict';var _=require(_0xf059('0x0'));var util=require(_0xf059('0x1'));var logger=require(_0xf059('0x2'))(_0xf059('0x3'));var moment=require(_0xf059('0x4'));var BPromise=require(_0xf059('0x5'));var rp=require(_0xf059('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf059('0x7'));var config=require(_0xf059('0x8'));var attributes=require(_0xf059('0x9'));module[_0xf059('0xa')]=function(_0x31e583,_0x31c96e){return _0x31e583[_0xf059('0xb')](_0xf059('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 2020943..e728ee9 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 _0xf4bb=['code','message','AnalyticMetric,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xf4bb,0xf6));var _0xbf4b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf4bb[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xbf4b('0x0'));var util=require(_0xbf4b('0x1'));var moment=require(_0xbf4b('0x2'));var BPromise=require(_0xbf4b('0x3'));var rs=require(_0xbf4b('0x4'));var fs=require('fs');var Redis=require(_0xbf4b('0x5'));var db=require(_0xbf4b('0x6'))['db'];var utils=require(_0xbf4b('0x7'));var logger=require('../../config/logger')(_0xbf4b('0x8'));var config=require(_0xbf4b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x170c6b,_0x372325,_0xac01c9){return new BPromise(function(_0x1103a8,_0x1f86b8){return client['request'](_0x170c6b,_0xac01c9)[_0xbf4b('0xb')](function(_0x436a1d){logger[_0xbf4b('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x372325,'request\x20sent');logger[_0xbf4b('0xd')](_0xbf4b('0xe'),_0x372325,_0xbf4b('0xf'),JSON[_0xbf4b('0x10')](_0x436a1d));if(_0x436a1d[_0xbf4b('0x11')]){if(_0x436a1d[_0xbf4b('0x11')][_0xbf4b('0x12')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x372325,_0x436a1d[_0xbf4b('0x11')][_0xbf4b('0x13')]);return _0x1f86b8(_0x436a1d[_0xbf4b('0x11')][_0xbf4b('0x13')]);}logger[_0xbf4b('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x372325,_0x436a1d[_0xbf4b('0x11')]['message']);return _0x1103a8(_0x436a1d[_0xbf4b('0x11')][_0xbf4b('0x13')]);}else{logger['info'](_0xbf4b('0x14'),_0x372325,_0xbf4b('0xf'));_0x1103a8(_0x436a1d['result'][_0xbf4b('0x13')]);}})[_0xbf4b('0x15')](function(_0x23b747){logger[_0xbf4b('0x11')](_0xbf4b('0x14'),_0x372325,_0x23b747);_0x1f86b8(_0x23b747);});});} \ No newline at end of file +var _0x54b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0x4bb8e3,_0x907d69){var _0x59af64=function(_0x3825f7){while(--_0x3825f7){_0x4bb8e3['push'](_0x4bb8e3['shift']());}};_0x59af64(++_0x907d69);}(_0x54b5,0x1cc));var _0x554b=function(_0x1c90d4,_0x3957e6){_0x1c90d4=_0x1c90d4-0x0;var _0x214860=_0x54b5[_0x1c90d4];return _0x214860;};'use strict';var _=require(_0x554b('0x0'));var util=require(_0x554b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x554b('0x2'));var fs=require('fs');var Redis=require(_0x554b('0x3'));var db=require(_0x554b('0x4'))['db'];var utils=require(_0x554b('0x5'));var logger=require(_0x554b('0x6'))('rpc');var config=require(_0x554b('0x7'));var jayson=require(_0x554b('0x8'));var client=jayson[_0x554b('0x9')][_0x554b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50f33a,_0x46e30d,_0x216bd7){return new BPromise(function(_0x359077,_0x138d65){return client[_0x554b('0xb')](_0x50f33a,_0x216bd7)[_0x554b('0xc')](function(_0x42af70){logger[_0x554b('0xd')](_0x554b('0xe'),_0x46e30d,_0x554b('0xf'));logger[_0x554b('0x10')](_0x554b('0x11'),_0x46e30d,_0x554b('0xf'),JSON[_0x554b('0x12')](_0x42af70));if(_0x42af70['error']){if(_0x42af70[_0x554b('0x13')]['code']===0x1f4){logger['error'](_0x554b('0xe'),_0x46e30d,_0x42af70['error'][_0x554b('0x14')]);return _0x138d65(_0x42af70['error'][_0x554b('0x14')]);}logger['error'](_0x554b('0xe'),_0x46e30d,_0x42af70['error'][_0x554b('0x14')]);return _0x359077(_0x42af70[_0x554b('0x13')][_0x554b('0x14')]);}else{logger[_0x554b('0xd')](_0x554b('0xe'),_0x46e30d,_0x554b('0xf'));_0x359077(_0x42af70[_0x554b('0x15')][_0x554b('0x14')]);}})['catch'](function(_0x16fe98){logger[_0x554b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46e30d,_0x16fe98);_0x138d65(_0x16fe98);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9d28aba..df9e486 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 _0x4137=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x165563,_0x382703){var _0x1c72a9=function(_0x27e64c){while(--_0x27e64c){_0x165563['push'](_0x165563['shift']());}};_0x1c72a9(++_0x382703);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'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 +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(_0x566bda,_0x1447dc){var _0x4ab467=function(_0x3c3059){while(--_0x3c3059){_0x566bda['push'](_0x566bda['shift']());}};_0x4ab467(++_0x1447dc);}(_0x187d,0x93));var _0xd187=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x187d[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 4290de7..afa698f 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 _0x5502=['TEXT','sequelize'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0x5502,0x133));var _0x2550=function(_0x1c2acb,_0x106166){_0x1c2acb=_0x1c2acb-0x0;var _0x3e2cd6=_0x5502[_0x1c2acb];return _0x3e2cd6;};'use strict';var Sequelize=require(_0x2550('0x0'));module['exports']={'tree':{'type':Sequelize[_0x2550('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x970a=['TEXT','sequelize','exports'];(function(_0xef54fb,_0x50cc8e){var _0x282068=function(_0x1b336d){while(--_0x1b336d){_0xef54fb['push'](_0xef54fb['shift']());}};_0x282068(++_0x50cc8e);}(_0x970a,0x12d));var _0xa970=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x970a[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xa970('0x0'));module[_0xa970('0x1')]={'tree':{'type':Sequelize[_0xa970('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 fdca73c..e171d88 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 _0xad6b=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xad6b,0x113));var _0xbad6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xad6b[_0x4ff09b];return _0x3f5c2e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbad6('0x0'));var rimraf=require(_0xbad6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbad6('0x2'));var rp=require(_0xbad6('0x3'));var moment=require(_0xbad6('0x4'));var BPromise=require(_0xbad6('0x5'));var Mustache=require(_0xbad6('0x6'));var util=require('util');var path=require(_0xbad6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbad6('0x8'));var squel=require('squel');var crypto=require(_0xbad6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbad6('0xa'));var querystring=require(_0xbad6('0xb'));var Papa=require(_0xbad6('0xc'));var Redis=require(_0xbad6('0xd'));var authService=require(_0xbad6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbad6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbad6('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbad6('0x11'));var db=require(_0xbad6('0x12'))['db'];function respondWithStatusCode(_0x444b63,_0x2d9580){_0x2d9580=_0x2d9580||0xcc;return function(_0x484ea9){if(_0x484ea9){return _0x444b63['sendStatus'](_0x2d9580);}return _0x444b63[_0xbad6('0x13')](_0x2d9580)[_0xbad6('0x14')]();};}function respondWithResult(_0x5b9c31,_0x1fd2ab){_0x1fd2ab=_0x1fd2ab||0xc8;return function(_0x77f00a){if(_0x77f00a){return _0x5b9c31[_0xbad6('0x13')](_0x1fd2ab)[_0xbad6('0x15')](_0x77f00a);}};}function respondWithFilteredResult(_0x567a1c,_0x5a33ca){return function(_0x28ddfa){if(_0x28ddfa){var _0x5ec1d6=_0x28ddfa[_0xbad6('0x16')],_0x464d55=_0x5a33ca[_0xbad6('0x17')],_0x339cba=_0x5a33ca[_0xbad6('0x17')]+_0x5a33ca[_0xbad6('0x18')],_0xd6599f;if(_0x339cba>=_0x5ec1d6){_0x339cba=_0x5ec1d6;_0xd6599f=0xc8;}else{_0xd6599f=0xce;}_0x567a1c[_0xbad6('0x13')](_0xd6599f);return _0x567a1c[_0xbad6('0x19')](_0xbad6('0x1a'),_0x464d55+'-'+_0x339cba+'/'+_0x5ec1d6)[_0xbad6('0x15')](_0x28ddfa);}return null;};}function patchUpdates(_0xae8c97){return function(_0x1bb97a){try{jsonpatch[_0xbad6('0x1b')](_0x1bb97a,_0xae8c97,!![]);}catch(_0x4001f0){return BPromise['reject'](_0x4001f0);}return _0x1bb97a['save']();};}function saveUpdates(_0x5241c4,_0x4c96c8){return function(_0x41c4a4){if(_0x41c4a4){return _0x41c4a4[_0xbad6('0x1c')](_0x5241c4)['then'](function(_0x1a39d8){return _0x1a39d8;});}return null;};}function removeEntity(_0x3056d6,_0x2a5501){return function(_0x518ce1){if(_0x518ce1){return _0x518ce1[_0xbad6('0x1d')]()[_0xbad6('0x1e')](function(){_0x3056d6['status'](0xcc)[_0xbad6('0x14')]();});}};}function handleEntityNotFound(_0xf145ee,_0x7cc8c){return function(_0x5aa9ca){if(!_0x5aa9ca){_0xf145ee[_0xbad6('0x1f')](0x194);}return _0x5aa9ca;};}function handleError(_0x51c27b,_0x2f504d){_0x2f504d=_0x2f504d||0x1f4;return function(_0x4329bd){logger[_0xbad6('0x20')](_0x4329bd[_0xbad6('0x21')]);if(_0x4329bd[_0xbad6('0x22')]){delete _0x4329bd[_0xbad6('0x22')];}_0x51c27b['status'](_0x2f504d)[_0xbad6('0x23')](_0x4329bd);};}exports['index']=function(_0x547718,_0x18cace){var _0x4bc543={},_0x403813={},_0x54efd8={'count':0x0,'rows':[]};var _0x295aec=_['map'](db[_0xbad6('0x24')][_0xbad6('0x25')],function(_0x10cc58){return{'name':_0x10cc58[_0xbad6('0x26')],'type':_0x10cc58[_0xbad6('0x27')]['key']};});_0x403813[_0xbad6('0x28')]=_['map'](_0x295aec,_0xbad6('0x22'));_0x403813['query']=_[_0xbad6('0x29')](_0x547718[_0xbad6('0x2a')]);_0x403813[_0xbad6('0x2b')]=_[_0xbad6('0x2c')](_0x403813['model'],_0x403813['query']);_0x4bc543[_0xbad6('0x2d')]=_[_0xbad6('0x2c')](_0x403813[_0xbad6('0x28')],qs['fields'](_0x547718['query'][_0xbad6('0x2e')]));_0x4bc543['attributes']=_0x4bc543['attributes'][_0xbad6('0x2f')]?_0x4bc543[_0xbad6('0x2d')]:_0x403813['model'];if(!_0x547718[_0xbad6('0x2a')]['hasOwnProperty']('nolimit')){_0x4bc543[_0xbad6('0x18')]=qs['limit'](_0x547718[_0xbad6('0x2a')][_0xbad6('0x18')]);_0x4bc543[_0xbad6('0x17')]=qs[_0xbad6('0x17')](_0x547718[_0xbad6('0x2a')][_0xbad6('0x17')]);}_0x4bc543[_0xbad6('0x30')]=qs[_0xbad6('0x31')](_0x547718[_0xbad6('0x2a')][_0xbad6('0x31')]);_0x4bc543[_0xbad6('0x32')]=qs[_0xbad6('0x2b')](_[_0xbad6('0x33')](_0x547718['query'],_0x403813[_0xbad6('0x2b')]),_0x295aec);if(_0x547718[_0xbad6('0x2a')][_0xbad6('0x34')]){_0x4bc543[_0xbad6('0x32')]=_[_0xbad6('0x35')](_0x4bc543[_0xbad6('0x32')],{'$or':_[_0xbad6('0x36')](_0x295aec,function(_0x1baa70){if(_0x1baa70['type']!=='VIRTUAL'){var _0x8240f8={};_0x8240f8[_0x1baa70['name']]={'$like':'%'+_0x547718['query'][_0xbad6('0x34')]+'%'};return _0x8240f8;}})});}_0x4bc543=_[_0xbad6('0x35')]({},_0x4bc543,_0x547718[_0xbad6('0x37')]);var _0x34d327={'where':_0x4bc543[_0xbad6('0x32')]};return db['AnalyticTreeReport'][_0xbad6('0x16')](_0x34d327)[_0xbad6('0x1e')](function(_0x5e833b){_0x54efd8[_0xbad6('0x16')]=_0x5e833b;if(_0x547718[_0xbad6('0x2a')][_0xbad6('0x38')]){_0x4bc543[_0xbad6('0x39')]=[{'all':!![]}];}return db[_0xbad6('0x24')][_0xbad6('0x3a')](_0x4bc543);})['then'](function(_0x78b7e0){_0x54efd8[_0xbad6('0x3b')]=_0x78b7e0;return _0x54efd8;})[_0xbad6('0x1e')](respondWithFilteredResult(_0x18cace,_0x4bc543))[_0xbad6('0x3c')](handleError(_0x18cace,null));};exports[_0xbad6('0x3d')]=function(_0x227fb,_0x3d0980){var _0x2fb816={'raw':!![],'where':{'id':_0x227fb[_0xbad6('0x3e')]['id']}},_0x293d97={};_0x293d97[_0xbad6('0x28')]=_[_0xbad6('0x29')](db['AnalyticTreeReport'][_0xbad6('0x25')]);_0x293d97[_0xbad6('0x2a')]=_[_0xbad6('0x29')](_0x227fb[_0xbad6('0x2a')]);_0x293d97[_0xbad6('0x2b')]=_[_0xbad6('0x2c')](_0x293d97[_0xbad6('0x28')],_0x293d97['query']);_0x2fb816[_0xbad6('0x2d')]=_[_0xbad6('0x2c')](_0x293d97[_0xbad6('0x28')],qs[_0xbad6('0x2e')](_0x227fb[_0xbad6('0x2a')][_0xbad6('0x2e')]));_0x2fb816[_0xbad6('0x2d')]=_0x2fb816[_0xbad6('0x2d')][_0xbad6('0x2f')]?_0x2fb816[_0xbad6('0x2d')]:_0x293d97[_0xbad6('0x28')];if(_0x227fb[_0xbad6('0x2a')][_0xbad6('0x38')]){_0x2fb816['include']=[{'all':!![]}];}_0x2fb816=_['merge']({},_0x2fb816,_0x227fb[_0xbad6('0x37')]);return db['AnalyticTreeReport'][_0xbad6('0x3f')](_0x2fb816)[_0xbad6('0x1e')](handleEntityNotFound(_0x3d0980,null))['then'](respondWithResult(_0x3d0980,null))[_0xbad6('0x3c')](handleError(_0x3d0980,null));};exports['create']=function(_0x11b96e,_0x1529cf){return db[_0xbad6('0x24')][_0xbad6('0x40')](_0x11b96e[_0xbad6('0x41')],{})['then'](respondWithResult(_0x1529cf,0xc9))[_0xbad6('0x3c')](handleError(_0x1529cf,null));};exports[_0xbad6('0x1c')]=function(_0x60edbe,_0x32caba){if(_0x60edbe['body']['id']){delete _0x60edbe['body']['id'];}return db[_0xbad6('0x24')][_0xbad6('0x3f')]({'where':{'id':_0x60edbe['params']['id']}})[_0xbad6('0x1e')](handleEntityNotFound(_0x32caba,null))['then'](saveUpdates(_0x60edbe['body'],null))[_0xbad6('0x1e')](respondWithResult(_0x32caba,null))[_0xbad6('0x3c')](handleError(_0x32caba,null));};exports[_0xbad6('0x1d')]=function(_0x5b3b38,_0x1f513f){return db['AnalyticTreeReport'][_0xbad6('0x3f')]({'where':{'id':_0x5b3b38[_0xbad6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1f513f,null))[_0xbad6('0x1e')](removeEntity(_0x1f513f,null))[_0xbad6('0x3c')](handleError(_0x1f513f,null));}; \ No newline at end of file +var _0x378b=['body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create'];(function(_0x38a095,_0xc60b67){var _0x2ee277=function(_0x11a7a3){while(--_0x11a7a3){_0x38a095['push'](_0x38a095['shift']());}};_0x2ee277(++_0xc60b67);}(_0x378b,0x160));var _0xb378=function(_0x56a34d,_0x4d7e2a){_0x56a34d=_0x56a34d-0x0;var _0x31e801=_0x378b[_0x56a34d];return _0x31e801;};'use strict';var pdf=require(_0xb378('0x0'));var emlformat=require(_0xb378('0x1'));var rimraf=require(_0xb378('0x2'));var zipdir=require(_0xb378('0x3'));var jsonpatch=require(_0xb378('0x4'));var rp=require(_0xb378('0x5'));var moment=require('moment');var BPromise=require(_0xb378('0x6'));var Mustache=require(_0xb378('0x7'));var util=require(_0xb378('0x8'));var path=require(_0xb378('0x9'));var sox=require('sox');var csv=require(_0xb378('0xa'));var ejs=require(_0xb378('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb378('0xc'));var jsforce=require(_0xb378('0xd'));var deskjs=require(_0xb378('0xe'));var toCsv=require(_0xb378('0xa'));var querystring=require(_0xb378('0xf'));var Papa=require(_0xb378('0x10'));var Redis=require('ioredis');var authService=require(_0xb378('0x11'));var qs=require(_0xb378('0x12'));var as=require(_0xb378('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb378('0x14'));var utils=require(_0xb378('0x15'));var config=require(_0xb378('0x16'));var db=require(_0xb378('0x17'))['db'];function respondWithStatusCode(_0x4e8410,_0x4de51e){_0x4de51e=_0x4de51e||0xcc;return function(_0x999379){if(_0x999379){return _0x4e8410[_0xb378('0x18')](_0x4de51e);}return _0x4e8410['status'](_0x4de51e)[_0xb378('0x19')]();};}function respondWithResult(_0x327135,_0x1a3cab){_0x1a3cab=_0x1a3cab||0xc8;return function(_0x49902a){if(_0x49902a){return _0x327135[_0xb378('0x1a')](_0x1a3cab)['json'](_0x49902a);}};}function respondWithFilteredResult(_0x533b71,_0x373057){return function(_0x3a277f){if(_0x3a277f){var _0x1487a3=_0x3a277f[_0xb378('0x1b')],_0x5dae15=_0x373057[_0xb378('0x1c')],_0x472b49=_0x373057['offset']+_0x373057[_0xb378('0x1d')],_0x2459d4;if(_0x472b49>=_0x1487a3){_0x472b49=_0x1487a3;_0x2459d4=0xc8;}else{_0x2459d4=0xce;}_0x533b71[_0xb378('0x1a')](_0x2459d4);return _0x533b71[_0xb378('0x1e')](_0xb378('0x1f'),_0x5dae15+'-'+_0x472b49+'/'+_0x1487a3)['json'](_0x3a277f);}return null;};}function patchUpdates(_0x158e5a){return function(_0x502e57){try{jsonpatch[_0xb378('0x20')](_0x502e57,_0x158e5a,!![]);}catch(_0xe130d4){return BPromise[_0xb378('0x21')](_0xe130d4);}return _0x502e57[_0xb378('0x22')]();};}function saveUpdates(_0x21b39b,_0x47f9de){return function(_0x23f24e){if(_0x23f24e){return _0x23f24e[_0xb378('0x23')](_0x21b39b)[_0xb378('0x24')](function(_0x1e1b11){return _0x1e1b11;});}return null;};}function removeEntity(_0x333409,_0x16e0e6){return function(_0x1a2af5){if(_0x1a2af5){return _0x1a2af5['destroy']()[_0xb378('0x24')](function(){_0x333409[_0xb378('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3c83,_0x2ce02c){return function(_0xa85684){if(!_0xa85684){_0x1f3c83[_0xb378('0x18')](0x194);}return _0xa85684;};}function handleError(_0x47d6f9,_0xcd1d7d){_0xcd1d7d=_0xcd1d7d||0x1f4;return function(_0x597101){logger['error'](_0x597101['stack']);if(_0x597101[_0xb378('0x25')]){delete _0x597101[_0xb378('0x25')];}_0x47d6f9[_0xb378('0x1a')](_0xcd1d7d)['send'](_0x597101);};}exports[_0xb378('0x26')]=function(_0x48fc83,_0x444086){var _0x95de34={},_0x2806a9={},_0x4f5efb={'count':0x0,'rows':[]};var _0x2fea0d=_[_0xb378('0x27')](db[_0xb378('0x28')][_0xb378('0x29')],function(_0x543305){return{'name':_0x543305[_0xb378('0x2a')],'type':_0x543305[_0xb378('0x2b')]['key']};});_0x2806a9[_0xb378('0x2c')]=_[_0xb378('0x27')](_0x2fea0d,_0xb378('0x25'));_0x2806a9['query']=_['keys'](_0x48fc83[_0xb378('0x2d')]);_0x2806a9['filters']=_['intersection'](_0x2806a9[_0xb378('0x2c')],_0x2806a9[_0xb378('0x2d')]);_0x95de34[_0xb378('0x2e')]=_[_0xb378('0x2f')](_0x2806a9[_0xb378('0x2c')],qs[_0xb378('0x30')](_0x48fc83[_0xb378('0x2d')][_0xb378('0x30')]));_0x95de34['attributes']=_0x95de34[_0xb378('0x2e')][_0xb378('0x31')]?_0x95de34[_0xb378('0x2e')]:_0x2806a9[_0xb378('0x2c')];if(!_0x48fc83[_0xb378('0x2d')][_0xb378('0x32')](_0xb378('0x33'))){_0x95de34[_0xb378('0x1d')]=qs[_0xb378('0x1d')](_0x48fc83[_0xb378('0x2d')][_0xb378('0x1d')]);_0x95de34[_0xb378('0x1c')]=qs[_0xb378('0x1c')](_0x48fc83[_0xb378('0x2d')][_0xb378('0x1c')]);}_0x95de34['order']=qs[_0xb378('0x34')](_0x48fc83[_0xb378('0x2d')][_0xb378('0x34')]);_0x95de34['where']=qs[_0xb378('0x35')](_[_0xb378('0x36')](_0x48fc83['query'],_0x2806a9[_0xb378('0x35')]),_0x2fea0d);if(_0x48fc83[_0xb378('0x2d')][_0xb378('0x37')]){_0x95de34[_0xb378('0x38')]=_[_0xb378('0x39')](_0x95de34['where'],{'$or':_[_0xb378('0x27')](_0x2fea0d,function(_0x2d77bc){if(_0x2d77bc[_0xb378('0x2b')]!==_0xb378('0x3a')){var _0x80c5ac={};_0x80c5ac[_0x2d77bc[_0xb378('0x25')]]={'$like':'%'+_0x48fc83['query']['filter']+'%'};return _0x80c5ac;}})});}_0x95de34=_[_0xb378('0x39')]({},_0x95de34,_0x48fc83[_0xb378('0x3b')]);var _0x45e6aa={'where':_0x95de34[_0xb378('0x38')]};return db[_0xb378('0x28')]['count'](_0x45e6aa)['then'](function(_0x1dc8b7){_0x4f5efb[_0xb378('0x1b')]=_0x1dc8b7;if(_0x48fc83[_0xb378('0x2d')][_0xb378('0x3c')]){_0x95de34['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x95de34);})[_0xb378('0x24')](function(_0x1b0ecd){_0x4f5efb[_0xb378('0x3d')]=_0x1b0ecd;return _0x4f5efb;})[_0xb378('0x24')](respondWithFilteredResult(_0x444086,_0x95de34))[_0xb378('0x3e')](handleError(_0x444086,null));};exports['show']=function(_0x332dfa,_0x4b2bef){var _0x1ce877={'raw':!![],'where':{'id':_0x332dfa[_0xb378('0x3f')]['id']}},_0x12b429={};_0x12b429[_0xb378('0x2c')]=_[_0xb378('0x40')](db[_0xb378('0x28')][_0xb378('0x29')]);_0x12b429[_0xb378('0x2d')]=_[_0xb378('0x40')](_0x332dfa[_0xb378('0x2d')]);_0x12b429[_0xb378('0x35')]=_[_0xb378('0x2f')](_0x12b429['model'],_0x12b429[_0xb378('0x2d')]);_0x1ce877[_0xb378('0x2e')]=_[_0xb378('0x2f')](_0x12b429['model'],qs[_0xb378('0x30')](_0x332dfa[_0xb378('0x2d')][_0xb378('0x30')]));_0x1ce877['attributes']=_0x1ce877[_0xb378('0x2e')]['length']?_0x1ce877[_0xb378('0x2e')]:_0x12b429[_0xb378('0x2c')];if(_0x332dfa[_0xb378('0x2d')][_0xb378('0x3c')]){_0x1ce877[_0xb378('0x41')]=[{'all':!![]}];}_0x1ce877=_[_0xb378('0x39')]({},_0x1ce877,_0x332dfa[_0xb378('0x3b')]);return db['AnalyticTreeReport'][_0xb378('0x42')](_0x1ce877)[_0xb378('0x24')](handleEntityNotFound(_0x4b2bef,null))[_0xb378('0x24')](respondWithResult(_0x4b2bef,null))['catch'](handleError(_0x4b2bef,null));};exports[_0xb378('0x43')]=function(_0x402866,_0x318f9b){return db[_0xb378('0x28')]['create'](_0x402866[_0xb378('0x44')],{})[_0xb378('0x24')](respondWithResult(_0x318f9b,0xc9))[_0xb378('0x3e')](handleError(_0x318f9b,null));};exports[_0xb378('0x23')]=function(_0x15f733,_0x528053){if(_0x15f733[_0xb378('0x44')]['id']){delete _0x15f733[_0xb378('0x44')]['id'];}return db['AnalyticTreeReport'][_0xb378('0x42')]({'where':{'id':_0x15f733[_0xb378('0x3f')]['id']}})['then'](handleEntityNotFound(_0x528053,null))[_0xb378('0x24')](saveUpdates(_0x15f733[_0xb378('0x44')],null))[_0xb378('0x24')](respondWithResult(_0x528053,null))[_0xb378('0x3e')](handleError(_0x528053,null));};exports[_0xb378('0x45')]=function(_0x1ed999,_0x5a5c32){return db['AnalyticTreeReport'][_0xb378('0x42')]({'where':{'id':_0x1ed999['params']['id']}})[_0xb378('0x24')](handleEntityNotFound(_0x5a5c32,null))[_0xb378('0x24')](removeEntity(_0x5a5c32,null))[_0xb378('0x3e')](handleError(_0x5a5c32,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e89afc2..9e4c72b 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 _0x5bc1=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xfea8e0,_0x38fd6c){var _0x14f501=function(_0x249b87){while(--_0x249b87){_0xfea8e0['push'](_0xfea8e0['shift']());}};_0x14f501(++_0x38fd6c);}(_0x5bc1,0xb5));var _0x15bc=function(_0x54b8e9,_0x55a1e3){_0x54b8e9=_0x54b8e9-0x0;var _0x26fbbf=_0x5bc1[_0x54b8e9];return _0x26fbbf;};'use strict';var _=require('lodash');var util=require(_0x15bc('0x0'));var logger=require(_0x15bc('0x1'))(_0x15bc('0x2'));var moment=require(_0x15bc('0x3'));var BPromise=require(_0x15bc('0x4'));var rp=require(_0x15bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15bc('0x6'));var attributes=require(_0x15bc('0x7'));module[_0x15bc('0x8')]=function(_0x52766f,_0x109031){return _0x52766f['define'](_0x15bc('0x9'),attributes,{'tableName':_0x15bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e0c=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x2dc6eb,_0x439724){_0x2dc6eb=_0x2dc6eb-0x0;var _0x2faaf1=_0x3e0c[_0x2dc6eb];return _0x2faaf1;};'use strict';var _=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var logger=require(_0xc3e0('0x2'))('api');var moment=require(_0xc3e0('0x3'));var BPromise=require(_0xc3e0('0x4'));var rp=require(_0xc3e0('0x5'));var fs=require('fs');var path=require(_0xc3e0('0x6'));var rimraf=require(_0xc3e0('0x7'));var config=require('../../config/environment');var attributes=require(_0xc3e0('0x8'));module['exports']=function(_0x4eb2ef,_0x541882){return _0x4eb2ef['define'](_0xc3e0('0x9'),attributes,{'tableName':_0xc3e0('0xa'),'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 e2eabdf..a58c1cf 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 _0xbcf1=['request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c4c24,_0x154c79){var _0x1c033d=function(_0x155415){while(--_0x155415){_0x1c4c24['push'](_0x1c4c24['shift']());}};_0x1c033d(++_0x154c79);}(_0xbcf1,0x1f3));var _0x1bcf=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xbcf1[_0x35fb56];return _0x2fd52c;};'use strict';var _=require('lodash');var util=require(_0x1bcf('0x0'));var moment=require(_0x1bcf('0x1'));var BPromise=require(_0x1bcf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1bcf('0x3'))['db'];var utils=require(_0x1bcf('0x4'));var logger=require(_0x1bcf('0x5'))('rpc');var config=require(_0x1bcf('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1bcf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57db25,_0x18b44b,_0x388dfe){return new BPromise(function(_0x214c6d,_0xb6dcfc){return client['request'](_0x57db25,_0x388dfe)[_0x1bcf('0x8')](function(_0x139758){logger['info'](_0x1bcf('0x9'),_0x18b44b,'request\x20sent');logger['debug'](_0x1bcf('0xa'),_0x18b44b,_0x1bcf('0xb'),JSON[_0x1bcf('0xc')](_0x139758));if(_0x139758[_0x1bcf('0xd')]){if(_0x139758[_0x1bcf('0xd')][_0x1bcf('0xe')]===0x1f4){logger[_0x1bcf('0xd')](_0x1bcf('0x9'),_0x18b44b,_0x139758[_0x1bcf('0xd')]['message']);return _0xb6dcfc(_0x139758[_0x1bcf('0xd')]['message']);}logger[_0x1bcf('0xd')](_0x1bcf('0x9'),_0x18b44b,_0x139758[_0x1bcf('0xd')][_0x1bcf('0xf')]);return _0x214c6d(_0x139758[_0x1bcf('0xd')][_0x1bcf('0xf')]);}else{logger['info'](_0x1bcf('0x9'),_0x18b44b,_0x1bcf('0xb'));_0x214c6d(_0x139758['result'][_0x1bcf('0xf')]);}})[_0x1bcf('0x10')](function(_0x48eae0){logger['error'](_0x1bcf('0x9'),_0x18b44b,_0x48eae0);_0xb6dcfc(_0x48eae0);});});} \ No newline at end of file +var _0xc5c8=['code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x29a572,_0x3ebd75){var _0x2ee12f=function(_0x469dac){while(--_0x469dac){_0x29a572['push'](_0x29a572['shift']());}};_0x2ee12f(++_0x3ebd75);}(_0xc5c8,0x1bb));var _0x8c5c=function(_0x374b99,_0x43d40d){_0x374b99=_0x374b99-0x0;var _0x2a8a13=_0xc5c8[_0x374b99];return _0x2a8a13;};'use strict';var _=require(_0x8c5c('0x0'));var util=require(_0x8c5c('0x1'));var moment=require(_0x8c5c('0x2'));var BPromise=require('bluebird');var rs=require(_0x8c5c('0x3'));var fs=require('fs');var Redis=require(_0x8c5c('0x4'));var db=require(_0x8c5c('0x5'))['db'];var utils=require(_0x8c5c('0x6'));var logger=require('../../config/logger')(_0x8c5c('0x7'));var config=require(_0x8c5c('0x8'));var jayson=require(_0x8c5c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7005,_0xd3e06,_0x5c57a2){return new BPromise(function(_0x113937,_0x5cb3be){return client[_0x8c5c('0xa')](_0x5d7005,_0x5c57a2)[_0x8c5c('0xb')](function(_0x469028){logger[_0x8c5c('0xc')](_0x8c5c('0xd'),_0xd3e06,_0x8c5c('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xd3e06,'request\x20sent',JSON[_0x8c5c('0xf')](_0x469028));if(_0x469028['error']){if(_0x469028[_0x8c5c('0x10')][_0x8c5c('0x11')]===0x1f4){logger[_0x8c5c('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0xd3e06,_0x469028[_0x8c5c('0x10')]['message']);return _0x5cb3be(_0x469028['error']['message']);}logger['error'](_0x8c5c('0xd'),_0xd3e06,_0x469028['error'][_0x8c5c('0x12')]);return _0x113937(_0x469028['error'][_0x8c5c('0x12')]);}else{logger['info'](_0x8c5c('0xd'),_0xd3e06,_0x8c5c('0xe'));_0x113937(_0x469028['result'][_0x8c5c('0x12')]);}})[_0x8c5c('0x13')](function(_0x553839){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0xd3e06,_0x553839);_0x5cb3be(_0x553839);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 7118aa2..2f0d7a4 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 _0x197a=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x197a,0x198));var _0xa197=function(_0x3b18e6,_0x35e310){_0x3b18e6=_0x3b18e6-0x0;var _0xaf05b7=_0x197a[_0x3b18e6];return _0xaf05b7;};'use strict';var multer=require(_0xa197('0x0'));var util=require(_0xa197('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa197('0x2'));var router=express[_0xa197('0x3')]();var auth=require(_0xa197('0x4'));var interaction=require(_0xa197('0x5'));var config=require(_0xa197('0x6'));var controller=require(_0xa197('0x7'));router[_0xa197('0x8')]('/',auth[_0xa197('0x9')](),controller[_0xa197('0xa')]);router['get'](_0xa197('0xb'),auth['isAuthenticated'](),controller[_0xa197('0xc')]);router[_0xa197('0xd')]('/',auth[_0xa197('0x9')](),controller[_0xa197('0xe')]);router[_0xa197('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa197('0x9')](),controller[_0xa197('0x10')]);module['exports']=router; \ No newline at end of file +var _0x103e=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete'];(function(_0x2c7d29,_0x519104){var _0x55ec63=function(_0x2e6aad){while(--_0x2e6aad){_0x2c7d29['push'](_0x2c7d29['shift']());}};_0x55ec63(++_0x519104);}(_0x103e,0x1d5));var _0xe103=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x103e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xe103('0x0'));var util=require('util');var path=require(_0xe103('0x1'));var timeout=require('connect-timeout');var express=require(_0xe103('0x2'));var router=express[_0xe103('0x3')]();var auth=require(_0xe103('0x4'));var interaction=require(_0xe103('0x5'));var config=require(_0xe103('0x6'));var controller=require(_0xe103('0x7'));router['get']('/',auth[_0xe103('0x8')](),controller[_0xe103('0x9')]);router[_0xe103('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe103('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe103('0xc')]);router[_0xe103('0xd')](_0xe103('0xe'),auth[_0xe103('0x8')](),controller[_0xe103('0xf')]);router[_0xe103('0x10')](_0xe103('0xe'),auth[_0xe103('0x8')](),controller['destroy']);module[_0xe103('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index e7e6655..73df365 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 _0xb5e2=['STRING','exports'];(function(_0x5e4079,_0x1a8dd6){var _0x5a4df1=function(_0xb9d3a7){while(--_0xb9d3a7){_0x5e4079['push'](_0x5e4079['shift']());}};_0x5a4df1(++_0x1a8dd6);}(_0xb5e2,0x199));var _0x2b5e=function(_0x415360,_0x73bb3a){_0x415360=_0x415360-0x0;var _0x187183=_0xb5e2[_0x415360];return _0x187183;};'use strict';var Sequelize=require('sequelize');module[_0x2b5e('0x0')]={'name':{'type':Sequelize[_0x2b5e('0x1')]},'basename':{'type':Sequelize[_0x2b5e('0x1')]},'type':{'type':Sequelize[_0x2b5e('0x1')]}}; \ No newline at end of file +var _0x434b=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x434b,0x1c3));var _0xb434=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x434b[_0x1d3577];return _0x277d9a;};'use strict';var Sequelize=require(_0xb434('0x0'));module['exports']={'name':{'type':Sequelize[_0xb434('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb434('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 68161f3..5bdcf1f 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 _0xb91f=['clone','get','omit','createdAt','updatedAt','body','create','params','file','originalname','basename','filename','mimetype','findOne','download','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','find'];(function(_0x5585ca,_0x4c6c65){var _0x415be9=function(_0x1cc36c){while(--_0x1cc36c){_0x5585ca['push'](_0x5585ca['shift']());}};_0x415be9(++_0x4c6c65);}(_0xb91f,0x65));var _0xfb91=function(_0x17a8de,_0x30d7a4){_0x17a8de=_0x17a8de-0x0;var _0x38a72b=_0xb91f[_0x17a8de];return _0x38a72b;};'use strict';var pdf=require(_0xfb91('0x0'));var emlformat=require(_0xfb91('0x1'));var rimraf=require(_0xfb91('0x2'));var zipdir=require(_0xfb91('0x3'));var jsonpatch=require(_0xfb91('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb91('0x5'));var path=require(_0xfb91('0x6'));var sox=require(_0xfb91('0x7'));var csv=require(_0xfb91('0x8'));var ejs=require(_0xfb91('0x9'));var fs=require('fs');var _=require(_0xfb91('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb91('0xb'));var toCsv=require(_0xfb91('0x8'));var querystring=require(_0xfb91('0xc'));var Papa=require(_0xfb91('0xd'));var Redis=require(_0xfb91('0xe'));var authService=require(_0xfb91('0xf'));var qs=require(_0xfb91('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb91('0x11'));var logger=require(_0xfb91('0x12'))(_0xfb91('0x13'));var utils=require(_0xfb91('0x14'));var config=require(_0xfb91('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2589a2,_0x552200){_0x552200=_0x552200||0xcc;return function(_0x31589e){if(_0x31589e){return _0x2589a2[_0xfb91('0x16')](_0x552200);}return _0x2589a2['status'](_0x552200)[_0xfb91('0x17')]();};}function respondWithResult(_0x2b1cf9,_0xf7a859){_0xf7a859=_0xf7a859||0xc8;return function(_0x2e3fa1){if(_0x2e3fa1){return _0x2b1cf9[_0xfb91('0x18')](_0xf7a859)[_0xfb91('0x19')](_0x2e3fa1);}};}function respondWithFilteredResult(_0x250645,_0x5ec451){return function(_0x109497){if(_0x109497){var _0x11e9d2=_0x109497[_0xfb91('0x1a')],_0x5b6d42=_0x5ec451[_0xfb91('0x1b')],_0x3c00c5=_0x5ec451[_0xfb91('0x1b')]+_0x5ec451[_0xfb91('0x1c')],_0x18cd84;if(_0x3c00c5>=_0x11e9d2){_0x3c00c5=_0x11e9d2;_0x18cd84=0xc8;}else{_0x18cd84=0xce;}_0x250645['status'](_0x18cd84);return _0x250645[_0xfb91('0x1d')](_0xfb91('0x1e'),_0x5b6d42+'-'+_0x3c00c5+'/'+_0x11e9d2)['json'](_0x109497);}return null;};}function patchUpdates(_0x11f972){return function(_0xa92e3e){try{jsonpatch[_0xfb91('0x1f')](_0xa92e3e,_0x11f972,!![]);}catch(_0x2700fe){return BPromise[_0xfb91('0x20')](_0x2700fe);}return _0xa92e3e[_0xfb91('0x21')]();};}function saveUpdates(_0x5bc464,_0x33fea3){return function(_0xd82ecb){if(_0xd82ecb){return _0xd82ecb[_0xfb91('0x22')](_0x5bc464)[_0xfb91('0x23')](function(_0x5c68bf){return _0x5c68bf;});}return null;};}function removeEntity(_0x427dac,_0x65b689){return function(_0x3e4f30){if(_0x3e4f30){return _0x3e4f30[_0xfb91('0x24')]()[_0xfb91('0x23')](function(){_0x427dac[_0xfb91('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d7b2,_0x28e680){return function(_0x33dc04){if(!_0x33dc04){_0x44d7b2['sendStatus'](0x194);}return _0x33dc04;};}function handleError(_0x4b92bd,_0x941864){_0x941864=_0x941864||0x1f4;return function(_0x41a8cd){logger['error'](_0x41a8cd[_0xfb91('0x25')]);if(_0x41a8cd[_0xfb91('0x26')]){delete _0x41a8cd['name'];}_0x4b92bd[_0xfb91('0x18')](_0x941864)[_0xfb91('0x27')](_0x41a8cd);};}exports[_0xfb91('0x28')]=function(_0x32c8c2,_0x2ea786){var _0x1243f7={},_0x13314c={},_0x50c2e6={'count':0x0,'rows':[]};var _0x176802=_[_0xfb91('0x29')](db[_0xfb91('0x2a')][_0xfb91('0x2b')],function(_0xa87bd8){return{'name':_0xa87bd8['fieldName'],'type':_0xa87bd8[_0xfb91('0x2c')][_0xfb91('0x2d')]};});_0x13314c[_0xfb91('0x2e')]=_[_0xfb91('0x29')](_0x176802,_0xfb91('0x26'));_0x13314c[_0xfb91('0x2f')]=_[_0xfb91('0x30')](_0x32c8c2[_0xfb91('0x2f')]);_0x13314c['filters']=_[_0xfb91('0x31')](_0x13314c[_0xfb91('0x2e')],_0x13314c[_0xfb91('0x2f')]);_0x1243f7[_0xfb91('0x32')]=_[_0xfb91('0x31')](_0x13314c[_0xfb91('0x2e')],qs[_0xfb91('0x33')](_0x32c8c2[_0xfb91('0x2f')][_0xfb91('0x33')]));_0x1243f7[_0xfb91('0x32')]=_0x1243f7[_0xfb91('0x32')][_0xfb91('0x34')]?_0x1243f7[_0xfb91('0x32')]:_0x13314c['model'];if(!_0x32c8c2[_0xfb91('0x2f')][_0xfb91('0x35')](_0xfb91('0x36'))){_0x1243f7[_0xfb91('0x1c')]=qs[_0xfb91('0x1c')](_0x32c8c2['query']['limit']);_0x1243f7[_0xfb91('0x1b')]=qs[_0xfb91('0x1b')](_0x32c8c2['query'][_0xfb91('0x1b')]);}_0x1243f7['order']=qs[_0xfb91('0x37')](_0x32c8c2[_0xfb91('0x2f')][_0xfb91('0x37')]);_0x1243f7[_0xfb91('0x38')]=qs[_0xfb91('0x39')](_[_0xfb91('0x3a')](_0x32c8c2['query'],_0x13314c[_0xfb91('0x39')]),_0x176802);if(_0x32c8c2[_0xfb91('0x2f')]['filter']){_0x1243f7[_0xfb91('0x38')]=_[_0xfb91('0x3b')](_0x1243f7[_0xfb91('0x38')],{'$or':_[_0xfb91('0x29')](_0x176802,function(_0x2f4dd6){if(_0x2f4dd6[_0xfb91('0x2c')]!==_0xfb91('0x3c')){var _0x41b003={};_0x41b003[_0x2f4dd6[_0xfb91('0x26')]]={'$like':'%'+_0x32c8c2[_0xfb91('0x2f')][_0xfb91('0x3d')]+'%'};return _0x41b003;}})});}_0x1243f7=_[_0xfb91('0x3b')]({},_0x1243f7,_0x32c8c2['options']);var _0x120843={'where':_0x1243f7[_0xfb91('0x38')]};return db[_0xfb91('0x2a')]['count'](_0x120843)[_0xfb91('0x23')](function(_0x2c1c19){_0x50c2e6[_0xfb91('0x1a')]=_0x2c1c19;if(_0x32c8c2['query'][_0xfb91('0x3e')]){_0x1243f7[_0xfb91('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0xfb91('0x40')](_0x1243f7);})[_0xfb91('0x23')](function(_0x78719a){_0x50c2e6[_0xfb91('0x41')]=_0x78719a;return _0x50c2e6;})['then'](respondWithFilteredResult(_0x2ea786,_0x1243f7))[_0xfb91('0x42')](handleError(_0x2ea786,null));};exports[_0xfb91('0x43')]=function(_0x54966a,_0x38ab63){var _0x3ede8e={'raw':!![],'where':{'id':_0x54966a['params']['id']}},_0xf8d3b={};_0xf8d3b[_0xfb91('0x2e')]=_[_0xfb91('0x30')](db[_0xfb91('0x2a')][_0xfb91('0x2b')]);_0xf8d3b[_0xfb91('0x2f')]=_[_0xfb91('0x30')](_0x54966a[_0xfb91('0x2f')]);_0xf8d3b[_0xfb91('0x39')]=_[_0xfb91('0x31')](_0xf8d3b[_0xfb91('0x2e')],_0xf8d3b[_0xfb91('0x2f')]);_0x3ede8e[_0xfb91('0x32')]=_[_0xfb91('0x31')](_0xf8d3b['model'],qs['fields'](_0x54966a['query'][_0xfb91('0x33')]));_0x3ede8e['attributes']=_0x3ede8e['attributes']['length']?_0x3ede8e[_0xfb91('0x32')]:_0xf8d3b[_0xfb91('0x2e')];if(_0x54966a[_0xfb91('0x2f')][_0xfb91('0x3e')]){_0x3ede8e[_0xfb91('0x3f')]=[{'all':!![]}];}_0x3ede8e=_['merge']({},_0x3ede8e,_0x54966a['options']);return db[_0xfb91('0x2a')][_0xfb91('0x44')](_0x3ede8e)[_0xfb91('0x23')](handleEntityNotFound(_0x38ab63,null))[_0xfb91('0x23')](respondWithResult(_0x38ab63,null))[_0xfb91('0x42')](handleError(_0x38ab63,null));};exports[_0xfb91('0x45')]=function(_0xce5d38,_0x4bbc12){var _0x365793={'where':{'id':_0xce5d38['params']['id']}},_0x636c08={};_0x636c08['model']=_[_0xfb91('0x30')](db[_0xfb91('0x2a')]['rawAttributes']);_0x365793['attributes']=_[_0xfb91('0x31')](_0x636c08[_0xfb91('0x2e')],qs[_0xfb91('0x33')](_0xce5d38[_0xfb91('0x2f')][_0xfb91('0x33')]));_0x365793[_0xfb91('0x32')]=_0x365793[_0xfb91('0x32')][_0xfb91('0x34')]?_0x365793[_0xfb91('0x32')]:_0x636c08['model'];if(_0xce5d38['query']['includeAll']){_0x365793[_0xfb91('0x3f')]=[{'all':!![]}];}_0x365793=_[_0xfb91('0x3b')]({},_0x365793,_0xce5d38['options']);return db[_0xfb91('0x2a')][_0xfb91('0x44')](_0x365793)[_0xfb91('0x23')](handleEntityNotFound(_0x4bbc12,null))[_0xfb91('0x23')](function(_0x131dfd){if(_0x131dfd){var _0xd7f445=_0x131dfd[_0xfb91('0x46')]({'plain':!![]});_0xd7f445=qs[_0xfb91('0x47')](_0xd7f445,['id',_0xfb91('0x48'),_0xfb91('0x49')]);_0xce5d38[_0xfb91('0x4a')]=_['omit'](_0xce5d38[_0xfb91('0x4a')],['id',_0xfb91('0x48'),_0xfb91('0x49')]);return db[_0xfb91('0x2a')][_0xfb91('0x4b')](_[_0xfb91('0x3b')](_0xd7f445,_0xce5d38[_0xfb91('0x4a')]),{'include':_0xce5d38[_0xfb91('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4bbc12,0xc9))[_0xfb91('0x42')](handleError(_0x4bbc12,null));};exports[_0xfb91('0x22')]=function(_0x5db43c,_0x5c95f3){if(_0x5db43c[_0xfb91('0x4a')]['id']){delete _0x5db43c[_0xfb91('0x4a')]['id'];}return db[_0xfb91('0x2a')]['find']({'where':{'id':_0x5db43c['params']['id']}})[_0xfb91('0x23')](handleEntityNotFound(_0x5c95f3,null))[_0xfb91('0x23')](saveUpdates(_0x5db43c[_0xfb91('0x4a')],null))['then'](respondWithResult(_0x5c95f3,null))[_0xfb91('0x42')](handleError(_0x5c95f3,null));};exports['destroy']=function(_0x1e414e,_0x37f7ef){return db['Attachment'][_0xfb91('0x44')]({'where':{'id':_0x1e414e[_0xfb91('0x4c')]['id']}})[_0xfb91('0x23')](handleEntityNotFound(_0x37f7ef,null))['then'](removeEntity(_0x37f7ef,null))[_0xfb91('0x42')](handleError(_0x37f7ef,null));};exports[_0xfb91('0x4b')]=function(_0x396e66,_0x1c5adf,_0x2a8ae1){_0x396e66['body'][_0xfb91('0x26')]=_0x396e66[_0xfb91('0x4d')][_0xfb91('0x4e')];_0x396e66[_0xfb91('0x4a')][_0xfb91('0x4f')]=_0x396e66['file'][_0xfb91('0x50')];_0x396e66['body']['type']=_0x396e66['file'][_0xfb91('0x51')];return db[_0xfb91('0x2a')]['create'](_0x396e66[_0xfb91('0x4a')])[_0xfb91('0x23')](respondWithResult(_0x1c5adf,0xc9))[_0xfb91('0x42')](handleError(_0x1c5adf,null));};exports['download']=function(_0x5219a7,_0x3c55dd,_0x157e17){return db[_0xfb91('0x2a')][_0xfb91('0x52')]({'where':{'id':_0x5219a7[_0xfb91('0x4c')]['id']},'raw':!![]})[_0xfb91('0x23')](handleEntityNotFound(_0x3c55dd,null))[_0xfb91('0x23')](function(_0x24a8a8){if(_0x24a8a8){return _0x3c55dd[_0xfb91('0x53')](path['join'](config['root'],_0xfb91('0x54'),_0x24a8a8[_0xfb91('0x4f')]));}})[_0xfb91('0x42')](handleError(_0x3c55dd,null));}; \ No newline at end of file +var _0x05e0=['order','sort','where','merge','type','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','clone','get','omit','createdAt','updatedAt','body','create','file','download','findOne','join','root','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x3c0dcc,_0x18c419){var _0x1a224c=function(_0x238ae7){while(--_0x238ae7){_0x3c0dcc['push'](_0x3c0dcc['shift']());}};_0x1a224c(++_0x18c419);}(_0x05e0,0x105));var _0x005e=function(_0x3759fa,_0x4a1baa){_0x3759fa=_0x3759fa-0x0;var _0x4e512e=_0x05e0[_0x3759fa];return _0x4e512e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x005e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x005e('0x1'));var jsonpatch=require(_0x005e('0x2'));var rp=require(_0x005e('0x3'));var moment=require(_0x005e('0x4'));var BPromise=require(_0x005e('0x5'));var Mustache=require('mustache');var util=require(_0x005e('0x6'));var path=require('path');var sox=require(_0x005e('0x7'));var csv=require('to-csv');var ejs=require(_0x005e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x005e('0x9'));var crypto=require('crypto');var jsforce=require(_0x005e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x005e('0xb'));var querystring=require(_0x005e('0xc'));var Papa=require(_0x005e('0xd'));var Redis=require(_0x005e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x005e('0xf'));var hardwareService=require(_0x005e('0x10'));var logger=require(_0x005e('0x11'))(_0x005e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52c9b4,_0x17dfa0){_0x17dfa0=_0x17dfa0||0xcc;return function(_0x4fda26){if(_0x4fda26){return _0x52c9b4[_0x005e('0x13')](_0x17dfa0);}return _0x52c9b4[_0x005e('0x14')](_0x17dfa0)[_0x005e('0x15')]();};}function respondWithResult(_0x3c5f4b,_0x2759e5){_0x2759e5=_0x2759e5||0xc8;return function(_0x4cf958){if(_0x4cf958){return _0x3c5f4b[_0x005e('0x14')](_0x2759e5)[_0x005e('0x16')](_0x4cf958);}};}function respondWithFilteredResult(_0x2d0677,_0x3a6986){return function(_0x39bab6){if(_0x39bab6){var _0x44eb3e=_0x39bab6[_0x005e('0x17')],_0x2007d4=_0x3a6986[_0x005e('0x18')],_0x3702fb=_0x3a6986[_0x005e('0x18')]+_0x3a6986['limit'],_0x47fcca;if(_0x3702fb>=_0x44eb3e){_0x3702fb=_0x44eb3e;_0x47fcca=0xc8;}else{_0x47fcca=0xce;}_0x2d0677[_0x005e('0x14')](_0x47fcca);return _0x2d0677[_0x005e('0x19')](_0x005e('0x1a'),_0x2007d4+'-'+_0x3702fb+'/'+_0x44eb3e)[_0x005e('0x16')](_0x39bab6);}return null;};}function patchUpdates(_0x21b4f1){return function(_0x88bc23){try{jsonpatch[_0x005e('0x1b')](_0x88bc23,_0x21b4f1,!![]);}catch(_0x2fdccc){return BPromise[_0x005e('0x1c')](_0x2fdccc);}return _0x88bc23[_0x005e('0x1d')]();};}function saveUpdates(_0x276bae,_0x10d41d){return function(_0x28ec30){if(_0x28ec30){return _0x28ec30[_0x005e('0x1e')](_0x276bae)[_0x005e('0x1f')](function(_0x391edc){return _0x391edc;});}return null;};}function removeEntity(_0x10b183,_0x4d86e2){return function(_0x46c885){if(_0x46c885){return _0x46c885[_0x005e('0x20')]()[_0x005e('0x1f')](function(){_0x10b183[_0x005e('0x14')](0xcc)[_0x005e('0x15')]();});}};}function handleEntityNotFound(_0x142486,_0x188eda){return function(_0x226da8){if(!_0x226da8){_0x142486[_0x005e('0x13')](0x194);}return _0x226da8;};}function handleError(_0xd14858,_0x2704dc){_0x2704dc=_0x2704dc||0x1f4;return function(_0x3bf5c2){logger[_0x005e('0x21')](_0x3bf5c2[_0x005e('0x22')]);if(_0x3bf5c2[_0x005e('0x23')]){delete _0x3bf5c2[_0x005e('0x23')];}_0xd14858[_0x005e('0x14')](_0x2704dc)[_0x005e('0x24')](_0x3bf5c2);};}exports[_0x005e('0x25')]=function(_0x484b3a,_0x7a7128){var _0x36f9ae={},_0x512129={},_0x3eb7f4={'count':0x0,'rows':[]};var _0x19d48f=_[_0x005e('0x26')](db[_0x005e('0x27')]['rawAttributes'],function(_0xd9d137){return{'name':_0xd9d137[_0x005e('0x28')],'type':_0xd9d137['type']['key']};});_0x512129[_0x005e('0x29')]=_['map'](_0x19d48f,'name');_0x512129[_0x005e('0x2a')]=_['keys'](_0x484b3a['query']);_0x512129[_0x005e('0x2b')]=_[_0x005e('0x2c')](_0x512129['model'],_0x512129[_0x005e('0x2a')]);_0x36f9ae[_0x005e('0x2d')]=_['intersection'](_0x512129[_0x005e('0x29')],qs[_0x005e('0x2e')](_0x484b3a[_0x005e('0x2a')][_0x005e('0x2e')]));_0x36f9ae[_0x005e('0x2d')]=_0x36f9ae[_0x005e('0x2d')][_0x005e('0x2f')]?_0x36f9ae[_0x005e('0x2d')]:_0x512129['model'];if(!_0x484b3a[_0x005e('0x2a')][_0x005e('0x30')](_0x005e('0x31'))){_0x36f9ae[_0x005e('0x32')]=qs[_0x005e('0x32')](_0x484b3a[_0x005e('0x2a')]['limit']);_0x36f9ae[_0x005e('0x18')]=qs[_0x005e('0x18')](_0x484b3a[_0x005e('0x2a')][_0x005e('0x18')]);}_0x36f9ae[_0x005e('0x33')]=qs[_0x005e('0x34')](_0x484b3a[_0x005e('0x2a')]['sort']);_0x36f9ae[_0x005e('0x35')]=qs[_0x005e('0x2b')](_['pick'](_0x484b3a['query'],_0x512129['filters']),_0x19d48f);if(_0x484b3a[_0x005e('0x2a')]['filter']){_0x36f9ae[_0x005e('0x35')]=_[_0x005e('0x36')](_0x36f9ae[_0x005e('0x35')],{'$or':_[_0x005e('0x26')](_0x19d48f,function(_0x5c54df){if(_0x5c54df[_0x005e('0x37')]!=='VIRTUAL'){var _0x55868e={};_0x55868e[_0x5c54df['name']]={'$like':'%'+_0x484b3a['query']['filter']+'%'};return _0x55868e;}})});}_0x36f9ae=_[_0x005e('0x36')]({},_0x36f9ae,_0x484b3a[_0x005e('0x38')]);var _0x3a0428={'where':_0x36f9ae[_0x005e('0x35')]};return db[_0x005e('0x27')]['count'](_0x3a0428)[_0x005e('0x1f')](function(_0x2e26ad){_0x3eb7f4[_0x005e('0x17')]=_0x2e26ad;if(_0x484b3a[_0x005e('0x2a')][_0x005e('0x39')]){_0x36f9ae[_0x005e('0x3a')]=[{'all':!![]}];}return db[_0x005e('0x27')]['findAll'](_0x36f9ae);})['then'](function(_0x512e34){_0x3eb7f4[_0x005e('0x3b')]=_0x512e34;return _0x3eb7f4;})[_0x005e('0x1f')](respondWithFilteredResult(_0x7a7128,_0x36f9ae))[_0x005e('0x3c')](handleError(_0x7a7128,null));};exports[_0x005e('0x3d')]=function(_0x28c3ae,_0x447ba9){var _0xebfff={'raw':!![],'where':{'id':_0x28c3ae[_0x005e('0x3e')]['id']}},_0x39ee3c={};_0x39ee3c[_0x005e('0x29')]=_[_0x005e('0x3f')](db['Attachment'][_0x005e('0x40')]);_0x39ee3c[_0x005e('0x2a')]=_[_0x005e('0x3f')](_0x28c3ae[_0x005e('0x2a')]);_0x39ee3c[_0x005e('0x2b')]=_[_0x005e('0x2c')](_0x39ee3c['model'],_0x39ee3c[_0x005e('0x2a')]);_0xebfff[_0x005e('0x2d')]=_['intersection'](_0x39ee3c[_0x005e('0x29')],qs[_0x005e('0x2e')](_0x28c3ae[_0x005e('0x2a')][_0x005e('0x2e')]));_0xebfff[_0x005e('0x2d')]=_0xebfff[_0x005e('0x2d')]['length']?_0xebfff[_0x005e('0x2d')]:_0x39ee3c['model'];if(_0x28c3ae['query'][_0x005e('0x39')]){_0xebfff['include']=[{'all':!![]}];}_0xebfff=_['merge']({},_0xebfff,_0x28c3ae['options']);return db['Attachment'][_0x005e('0x41')](_0xebfff)['then'](handleEntityNotFound(_0x447ba9,null))[_0x005e('0x1f')](respondWithResult(_0x447ba9,null))['catch'](handleError(_0x447ba9,null));};exports[_0x005e('0x42')]=function(_0x509f70,_0x1e0485){var _0x5bb43a={'where':{'id':_0x509f70[_0x005e('0x3e')]['id']}},_0x4caaee={};_0x4caaee[_0x005e('0x29')]=_[_0x005e('0x3f')](db[_0x005e('0x27')][_0x005e('0x40')]);_0x5bb43a[_0x005e('0x2d')]=_[_0x005e('0x2c')](_0x4caaee[_0x005e('0x29')],qs[_0x005e('0x2e')](_0x509f70['query'][_0x005e('0x2e')]));_0x5bb43a[_0x005e('0x2d')]=_0x5bb43a[_0x005e('0x2d')][_0x005e('0x2f')]?_0x5bb43a[_0x005e('0x2d')]:_0x4caaee[_0x005e('0x29')];if(_0x509f70[_0x005e('0x2a')][_0x005e('0x39')]){_0x5bb43a[_0x005e('0x3a')]=[{'all':!![]}];}_0x5bb43a=_[_0x005e('0x36')]({},_0x5bb43a,_0x509f70[_0x005e('0x38')]);return db[_0x005e('0x27')][_0x005e('0x41')](_0x5bb43a)[_0x005e('0x1f')](handleEntityNotFound(_0x1e0485,null))[_0x005e('0x1f')](function(_0x196646){if(_0x196646){var _0x14e8a8=_0x196646[_0x005e('0x43')]({'plain':!![]});_0x14e8a8=qs[_0x005e('0x44')](_0x14e8a8,['id',_0x005e('0x45'),_0x005e('0x46')]);_0x509f70[_0x005e('0x47')]=_[_0x005e('0x44')](_0x509f70[_0x005e('0x47')],['id',_0x005e('0x45'),_0x005e('0x46')]);return db['Attachment']['create'](_[_0x005e('0x36')](_0x14e8a8,_0x509f70['body']),{'include':_0x509f70['query'][_0x005e('0x39')]?[{'all':!![]}]:undefined});}})[_0x005e('0x1f')](respondWithResult(_0x1e0485,0xc9))[_0x005e('0x3c')](handleError(_0x1e0485,null));};exports[_0x005e('0x1e')]=function(_0x54edb9,_0x4d8201){if(_0x54edb9[_0x005e('0x47')]['id']){delete _0x54edb9[_0x005e('0x47')]['id'];}return db[_0x005e('0x27')][_0x005e('0x41')]({'where':{'id':_0x54edb9[_0x005e('0x3e')]['id']}})[_0x005e('0x1f')](handleEntityNotFound(_0x4d8201,null))[_0x005e('0x1f')](saveUpdates(_0x54edb9[_0x005e('0x47')],null))[_0x005e('0x1f')](respondWithResult(_0x4d8201,null))['catch'](handleError(_0x4d8201,null));};exports[_0x005e('0x20')]=function(_0x416933,_0x2271ba){return db[_0x005e('0x27')][_0x005e('0x41')]({'where':{'id':_0x416933[_0x005e('0x3e')]['id']}})[_0x005e('0x1f')](handleEntityNotFound(_0x2271ba,null))[_0x005e('0x1f')](removeEntity(_0x2271ba,null))[_0x005e('0x3c')](handleError(_0x2271ba,null));};exports[_0x005e('0x48')]=function(_0xf8af4f,_0x56ed3f,_0x2b0632){_0xf8af4f[_0x005e('0x47')][_0x005e('0x23')]=_0xf8af4f['file']['originalname'];_0xf8af4f[_0x005e('0x47')]['basename']=_0xf8af4f[_0x005e('0x49')]['filename'];_0xf8af4f[_0x005e('0x47')]['type']=_0xf8af4f['file']['mimetype'];return db[_0x005e('0x27')][_0x005e('0x48')](_0xf8af4f[_0x005e('0x47')])[_0x005e('0x1f')](respondWithResult(_0x56ed3f,0xc9))[_0x005e('0x3c')](handleError(_0x56ed3f,null));};exports[_0x005e('0x4a')]=function(_0x39dabf,_0x23acbb,_0x4db463){return db[_0x005e('0x27')][_0x005e('0x4b')]({'where':{'id':_0x39dabf[_0x005e('0x3e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x23acbb,null))[_0x005e('0x1f')](function(_0x3380fe){if(_0x3380fe){return _0x23acbb['download'](path[_0x005e('0x4c')](config[_0x005e('0x4d')],'server/files/attachments/',_0x3380fe['basename']));}})[_0x005e('0x3c')](handleError(_0x23acbb,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6e392ad..fe59ed3 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 _0x0447=['moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api'];(function(_0x3cd5b6,_0x3fcc8e){var _0x3a69d9=function(_0x1f836f){while(--_0x1f836f){_0x3cd5b6['push'](_0x3cd5b6['shift']());}};_0x3a69d9(++_0x3fcc8e);}(_0x0447,0x8b));var _0x7044=function(_0x149380,_0x162914){_0x149380=_0x149380-0x0;var _0x46cad=_0x0447[_0x149380];return _0x46cad;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var logger=require(_0x7044('0x2'))(_0x7044('0x3'));var moment=require(_0x7044('0x4'));var BPromise=require('bluebird');var rp=require(_0x7044('0x5'));var fs=require('fs');var path=require(_0x7044('0x6'));var rimraf=require(_0x7044('0x7'));var config=require(_0x7044('0x8'));var attributes=require(_0x7044('0x9'));module[_0x7044('0xa')]=function(_0x148941,_0x20dfb1){return _0x148941[_0x7044('0xb')]('Attachment',attributes,{'tableName':_0x7044('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40ac=['api','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','Attachment','attachments','lodash','../../config/logger'];(function(_0x31624d,_0x5d502b){var _0x5cb843=function(_0x5bb9d4){while(--_0x5bb9d4){_0x31624d['push'](_0x31624d['shift']());}};_0x5cb843(++_0x5d502b);}(_0x40ac,0x1de));var _0xc40a=function(_0xf3768d,_0x4902ff){_0xf3768d=_0xf3768d-0x0;var _0x540bf8=_0x40ac[_0xf3768d];return _0x540bf8;};'use strict';var _=require(_0xc40a('0x0'));var util=require('util');var logger=require(_0xc40a('0x1'))(_0xc40a('0x2'));var moment=require(_0xc40a('0x3'));var BPromise=require(_0xc40a('0x4'));var rp=require(_0xc40a('0x5'));var fs=require('fs');var path=require(_0xc40a('0x6'));var rimraf=require(_0xc40a('0x7'));var config=require('../../config/environment');var attributes=require(_0xc40a('0x8'));module[_0xc40a('0x9')]=function(_0xd6d891,_0x5e179f){return _0xd6d891['define'](_0xc40a('0xa'),attributes,{'tableName':_0xc40a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index bc4822c..5514ba9 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 _0x7d9a=['body','options','raw','stringify','lodash','moment','randomstring','../../mysqldb','../../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','message','catch','CreateAttachment','Attachment'];(function(_0x3e425d,_0x3bec13){var _0x5ca228=function(_0x308c4f){while(--_0x308c4f){_0x3e425d['push'](_0x3e425d['shift']());}};_0x5ca228(++_0x3bec13);}(_0x7d9a,0xba));var _0xa7d9=function(_0x509536,_0x463b99){_0x509536=_0x509536-0x0;var _0x5822e7=_0x7d9a[_0x509536];return _0x5822e7;};'use strict';var _=require(_0xa7d9('0x0'));var util=require('util');var moment=require(_0xa7d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa7d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7d9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7d9('0x4'))(_0xa7d9('0x5'));var config=require(_0xa7d9('0x6'));var jayson=require(_0xa7d9('0x7'));var client=jayson[_0xa7d9('0x8')][_0xa7d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x197dcc,_0x509df2,_0x4eaaea){return new BPromise(function(_0x4addc3,_0x33dce1){return client[_0xa7d9('0xa')](_0x197dcc,_0x4eaaea)[_0xa7d9('0xb')](function(_0x5b030d){logger[_0xa7d9('0xc')](_0xa7d9('0xd'),_0x509df2,_0xa7d9('0xe'));logger[_0xa7d9('0xf')](_0xa7d9('0x10'),_0x509df2,_0xa7d9('0xe'),JSON['stringify'](_0x5b030d));if(_0x5b030d[_0xa7d9('0x11')]){if(_0x5b030d[_0xa7d9('0x11')]['code']===0x1f4){logger[_0xa7d9('0x11')](_0xa7d9('0xd'),_0x509df2,_0x5b030d[_0xa7d9('0x11')]['message']);return _0x33dce1(_0x5b030d[_0xa7d9('0x11')]['message']);}logger[_0xa7d9('0x11')](_0xa7d9('0xd'),_0x509df2,_0x5b030d[_0xa7d9('0x11')][_0xa7d9('0x12')]);return _0x4addc3(_0x5b030d['error']['message']);}else{logger[_0xa7d9('0xc')]('Attachment,\x20%s,\x20%s',_0x509df2,_0xa7d9('0xe'));_0x4addc3(_0x5b030d['result'][_0xa7d9('0x12')]);}})[_0xa7d9('0x13')](function(_0x3b2b9a){logger[_0xa7d9('0x11')](_0xa7d9('0xd'),_0x509df2,_0x3b2b9a);_0x33dce1(_0x3b2b9a);});});}exports[_0xa7d9('0x14')]=function(_0x3be32b){var _0x7d2926=this;return new Promise(function(_0x20cdf2,_0x5bacff){return db[_0xa7d9('0x15')]['create'](_0x3be32b[_0xa7d9('0x16')],{'raw':_0x3be32b[_0xa7d9('0x17')]?_0x3be32b[_0xa7d9('0x17')][_0xa7d9('0x18')]===undefined?!![]:![]:!![]})[_0xa7d9('0xb')](function(_0x4dad21){logger[_0xa7d9('0xc')]('CreateAttachment',_0x3be32b);logger[_0xa7d9('0xf')](_0xa7d9('0x14'),_0x3be32b,JSON[_0xa7d9('0x19')](_0x4dad21));_0x20cdf2(_0x4dad21);})[_0xa7d9('0x13')](function(_0x365d68){logger[_0xa7d9('0x11')]('CreateAttachment',_0x365d68[_0xa7d9('0x12')],_0x3be32b);_0x5bacff(_0x7d2926[_0xa7d9('0x11')](0x1f4,_0x365d68[_0xa7d9('0x12')]));});});}; \ No newline at end of file +var _0x9aa2=['http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9aa2,0x150));var _0x29aa=function(_0x1d43e0,_0x1d7934){_0x1d43e0=_0x1d43e0-0x0;var _0x3c0983=_0x9aa2[_0x1d43e0];return _0x3c0983;};'use strict';var _=require(_0x29aa('0x0'));var util=require(_0x29aa('0x1'));var moment=require(_0x29aa('0x2'));var BPromise=require(_0x29aa('0x3'));var rs=require(_0x29aa('0x4'));var fs=require('fs');var Redis=require(_0x29aa('0x5'));var db=require(_0x29aa('0x6'))['db'];var utils=require(_0x29aa('0x7'));var logger=require(_0x29aa('0x8'))(_0x29aa('0x9'));var config=require('../../config/environment');var jayson=require(_0x29aa('0xa'));var client=jayson[_0x29aa('0xb')][_0x29aa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x303dc3,_0x521084,_0x9ab4d3){return new BPromise(function(_0x44258c,_0x75e319){return client[_0x29aa('0xd')](_0x303dc3,_0x9ab4d3)[_0x29aa('0xe')](function(_0xa0e2d5){logger[_0x29aa('0xf')]('Attachment,\x20%s,\x20%s',_0x521084,_0x29aa('0x10'));logger[_0x29aa('0x11')](_0x29aa('0x12'),_0x521084,'request\x20sent',JSON[_0x29aa('0x13')](_0xa0e2d5));if(_0xa0e2d5[_0x29aa('0x14')]){if(_0xa0e2d5['error'][_0x29aa('0x15')]===0x1f4){logger[_0x29aa('0x14')](_0x29aa('0x16'),_0x521084,_0xa0e2d5[_0x29aa('0x14')]['message']);return _0x75e319(_0xa0e2d5[_0x29aa('0x14')]['message']);}logger[_0x29aa('0x14')](_0x29aa('0x16'),_0x521084,_0xa0e2d5['error'][_0x29aa('0x17')]);return _0x44258c(_0xa0e2d5[_0x29aa('0x14')]['message']);}else{logger['info'](_0x29aa('0x16'),_0x521084,'request\x20sent');_0x44258c(_0xa0e2d5[_0x29aa('0x18')][_0x29aa('0x17')]);}})[_0x29aa('0x19')](function(_0x4f94ed){logger['error'](_0x29aa('0x16'),_0x521084,_0x4f94ed);_0x75e319(_0x4f94ed);});});}exports['CreateAttachment']=function(_0x97dc67){var _0x21759f=this;return new Promise(function(_0x5a43dc,_0x19d525){return db['Attachment']['create'](_0x97dc67['body'],{'raw':_0x97dc67[_0x29aa('0x1a')]?_0x97dc67[_0x29aa('0x1a')][_0x29aa('0x1b')]===undefined?!![]:![]:!![]})[_0x29aa('0xe')](function(_0x293d1b){logger[_0x29aa('0xf')](_0x29aa('0x1c'),_0x97dc67);logger[_0x29aa('0x11')](_0x29aa('0x1c'),_0x97dc67,JSON['stringify'](_0x293d1b));_0x5a43dc(_0x293d1b);})[_0x29aa('0x19')](function(_0x22c59f){logger['error'](_0x29aa('0x1c'),_0x22c59f[_0x29aa('0x17')],_0x97dc67);_0x19d525(_0x21759f[_0x29aa('0x14')](0x1f4,_0x22c59f['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1db5bdc..bd47d3b 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 _0x4529=['download','clone','diskStorage','join','root','format','%s-%s','now','originalname','replace','single','file','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','index','get','/:id','isAuthenticated','show'];(function(_0xf35c95,_0x59b595){var _0x2199bf=function(_0x2e9f54){while(--_0x2e9f54){_0xf35c95['push'](_0xf35c95['shift']());}};_0x2199bf(++_0x59b595);}(_0x4529,0x109));var _0x9452=function(_0x2e1356,_0x2e9baa){_0x2e1356=_0x2e1356-0x0;var _0x17fe7c=_0x4529[_0x2e1356];return _0x17fe7c;};'use strict';var multer=require(_0x9452('0x0'));var util=require('util');var path=require(_0x9452('0x1'));var timeout=require(_0x9452('0x2'));var express=require(_0x9452('0x3'));var router=express[_0x9452('0x4')]();var auth=require(_0x9452('0x5'));var interaction=require(_0x9452('0x6'));var config=require(_0x9452('0x7'));var controller=require(_0x9452('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9452('0x9')]);router[_0x9452('0xa')](_0x9452('0xb'),auth[_0x9452('0xc')](),controller[_0x9452('0xd')]);router[_0x9452('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x9452('0xe')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x9452('0xf')]);var upload=multer({'storage':multer[_0x9452('0x10')]({'destination':function(_0xa56c2b,_0x445883,_0x46847c){_0x46847c(null,path[_0x9452('0x11')](config[_0x9452('0x12')],'server/files/attachments/'));},'filename':function(_0x3f24ed,_0x40341e,_0x305de7){_0x305de7(null,util[_0x9452('0x13')](_0x9452('0x14'),Date[_0x9452('0x15')](),_0x40341e[_0x9452('0x16')][_0x9452('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x9452('0x18')](_0x9452('0x19')),controller[_0x9452('0x1a')]);router['put'](_0x9452('0xb'),auth['isAuthenticated'](),controller[_0x9452('0x1b')]);router[_0x9452('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9452('0x1d')]);module[_0x9452('0x1e')]=router; \ No newline at end of file +var _0xc26e=['Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','index','get','/:id','/:id/download','isAuthenticated','download','post','/:id/clone','clone','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','single','create','update','delete','destroy','exports','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc26e,0x103));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xec26('0x0'));var timeout=require('connect-timeout');var express=require(_0xec26('0x1'));var router=express[_0xec26('0x2')]();var auth=require(_0xec26('0x3'));var interaction=require(_0xec26('0x4'));var config=require('../../config/environment');var controller=require(_0xec26('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xec26('0x6')]);router[_0xec26('0x7')](_0xec26('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xec26('0x7')](_0xec26('0x9'),auth[_0xec26('0xa')](),controller[_0xec26('0xb')]);router[_0xec26('0xc')](_0xec26('0xd'),auth[_0xec26('0xa')](),controller[_0xec26('0xe')]);var upload=multer({'storage':multer[_0xec26('0xf')]({'destination':function(_0x1faf39,_0x4bbb5f,_0x5ada9d){_0x5ada9d(null,path[_0xec26('0x10')](config['root'],_0xec26('0x11')));},'filename':function(_0x5b42a9,_0x59ad16,_0x545660){_0x545660(null,util[_0xec26('0x12')](_0xec26('0x13'),Date[_0xec26('0x14')](),_0x59ad16[_0xec26('0x15')][_0xec26('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xec26('0xc')]('/',upload[_0xec26('0x17')]('file'),controller[_0xec26('0x18')]);router['put'](_0xec26('0x8'),auth[_0xec26('0xa')](),controller[_0xec26('0x19')]);router[_0xec26('0x1a')](_0xec26('0x8'),auth['isAuthenticated'](),controller[_0xec26('0x1b')]);module[_0xec26('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0e99ec2..d456558 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 _0x141d=['../../config/utils','login','authenticate','google','email','callback','use','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x141d,0xac));var _0xd141=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x141d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xd141('0x0'));var passport=require(_0xd141('0x1'));var GoogleStrategy=require(_0xd141('0x2'))[_0xd141('0x3')];var moment=require('moment');var db=require(_0xd141('0x4'))['db'];var config=require(_0xd141('0x5'));var signToken=require(_0xd141('0x6'))[_0xd141('0x7')];var utils=require(_0xd141('0x8'));exports[_0xd141('0x9')]=passport[_0xd141('0xa')](_0xd141('0xb'),{'failureRedirect':'/login','scope':['profile',_0xd141('0xc')],'session':![]});exports[_0xd141('0xd')]=passport[_0xd141('0xa')]('google',{'failureRedirect':'/login','session':![]});passport[_0xd141('0xe')](new GoogleStrategy({'clientID':config[_0xd141('0xb')]?config['google']['clientID']:'id','clientSecret':config[_0xd141('0xb')]?config['google'][_0xd141('0xf')]:_0xd141('0x10'),'callbackURL':config['google']?config[_0xd141('0xb')]['callbackURL']:''},function(_0x46eba3,_0x53ecc2,_0x561c27,_0x4a831c){var _0x20d6b8,_0x5da0fa;return db[_0xd141('0x11')][_0xd141('0x12')]({'where':{'id':0x1},'attributes':[_0xd141('0x13'),_0xd141('0x14')],'raw':!![]})[_0xd141('0x15')](function(_0x14ac69){_0x20d6b8=_0x14ac69;return db[_0xd141('0x16')][_0xd141('0x17')]({'where':{'email':_[_0xd141('0x18')](_0x561c27[_0xd141('0x19')],_0xd141('0x1a')),'role':{'$or':[_0xd141('0x1b'),_0xd141('0x1c'),_0xd141('0x1d')]}}});})[_0xd141('0x15')](function(_0xcebfb9){_0x5da0fa=_0xcebfb9;if(_0x5da0fa){if(_0x5da0fa['disabled']){return _0x4a831c(_0xd141('0x1e'));}else if(_0x20d6b8['blockDuration']>0x0){if(_0x5da0fa[_0xd141('0x1f')]){if(moment(_0x5da0fa['blockedAt'])[_0xd141('0x20')](_0x20d6b8[_0xd141('0x14')],'minutes')>moment()){return _0x4a831c(_0xd141('0x1e'));}else{return utils[_0xd141('0x21')](_0x5da0fa,0x0,![],null)[_0xd141('0x15')](function(){return utils['getLicense'](_0x5da0fa);})[_0xd141('0x15')](function(){return _0x4a831c(null,_0x5da0fa);});}}else{return utils[_0xd141('0x22')](_0x5da0fa)[_0xd141('0x15')](function(){return _0x4a831c(null,_0x5da0fa);});}}else{return utils[_0xd141('0x22')](_0x5da0fa)[_0xd141('0x15')](function(){return _0x4a831c(null,_0x5da0fa);});}}return _0x4a831c(_0xd141('0x1e'));})[_0xd141('0x23')](function(_0x557707){_0x4a831c(_0x557707);});})); \ No newline at end of file +var _0xbca5=['value','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','blockDuration','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','email','use','clientSecret','findOne','User','emails'];(function(_0x1f7bc9,_0xd2e513){var _0x4c470b=function(_0x35ed26){while(--_0x35ed26){_0x1f7bc9['push'](_0x1f7bc9['shift']());}};_0x4c470b(++_0xd2e513);}(_0xbca5,0x1dd));var _0x5bca=function(_0x53972e,_0x275c){_0x53972e=_0x53972e-0x0;var _0xc48fcf=_0xbca5[_0x53972e];return _0xc48fcf;};'use strict';var _=require(_0x5bca('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x5bca('0x1'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x5bca('0x2'));var signToken=require(_0x5bca('0x3'))[_0x5bca('0x4')];var utils=require(_0x5bca('0x5'));exports[_0x5bca('0x6')]=passport[_0x5bca('0x7')](_0x5bca('0x8'),{'failureRedirect':_0x5bca('0x9'),'scope':['profile',_0x5bca('0xa')],'session':![]});exports['callback']=passport[_0x5bca('0x7')](_0x5bca('0x8'),{'failureRedirect':_0x5bca('0x9'),'session':![]});passport[_0x5bca('0xb')](new GoogleStrategy({'clientID':config[_0x5bca('0x8')]?config[_0x5bca('0x8')]['clientID']:'id','clientSecret':config[_0x5bca('0x8')]?config[_0x5bca('0x8')][_0x5bca('0xc')]:'secret','callbackURL':config[_0x5bca('0x8')]?config[_0x5bca('0x8')]['callbackURL']:''},function(_0x1045af,_0x22b08a,_0x3d05f8,_0x157929){var _0x179e18,_0x18d529;return db['Setting'][_0x5bca('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x47c128){_0x179e18=_0x47c128;return db[_0x5bca('0xe')]['find']({'where':{'email':_['map'](_0x3d05f8[_0x5bca('0xf')],_0x5bca('0x10')),'role':{'$or':[_0x5bca('0x11'),_0x5bca('0x12'),_0x5bca('0x13')]}}});})[_0x5bca('0x14')](function(_0x46f877){_0x18d529=_0x46f877;if(_0x18d529){if(_0x18d529['disabled']){return _0x157929(_0x5bca('0x15'));}else if(_0x179e18['blockDuration']>0x0){if(_0x18d529[_0x5bca('0x16')]){if(moment(_0x18d529[_0x5bca('0x17')])[_0x5bca('0x18')](_0x179e18[_0x5bca('0x19')],'minutes')>moment()){return _0x157929('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x5bca('0x1a')](_0x18d529,0x0,![],null)[_0x5bca('0x14')](function(){return utils['getLicense'](_0x18d529);})[_0x5bca('0x14')](function(){return _0x157929(null,_0x18d529);});}}else{return utils[_0x5bca('0x1b')](_0x18d529)[_0x5bca('0x14')](function(){return _0x157929(null,_0x18d529);});}}else{return utils[_0x5bca('0x1b')](_0x18d529)[_0x5bca('0x14')](function(){return _0x157929(null,_0x18d529);});}}return _0x157929('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x5bca('0x1c')](function(_0x51ff72){_0x157929(_0x51ff72);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f203c42..3b42e31 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 _0xc36d=['get','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc36d,0x7d));var _0xdc36=function(_0x3b1d1e,_0x10d8d9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x5670b7=_0xc36d[_0x3b1d1e];return _0x5670b7;};'use strict';var express=require(_0xdc36('0x0'));var passport=require(_0xdc36('0x1'));var router=express[_0xdc36('0x2')]();var controller=require(_0xdc36('0x3'));var userController=require(_0xdc36('0x4'));var authService=require(_0xdc36('0x5'));router['get']('/',controller[_0xdc36('0x6')]);router[_0xdc36('0x7')]('/callback',controller[_0xdc36('0x8')],authService[_0xdc36('0x9')],userController[_0xdc36('0x6')],authService[_0xdc36('0xa')]);module[_0xdc36('0xb')]=router; \ No newline at end of file +var _0x581a=['get','login','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x581a,0x127));var _0xa581=function(_0x3fab74,_0x5bbebe){_0x3fab74=_0x3fab74-0x0;var _0x4e0112=_0x581a[_0x3fab74];return _0x4e0112;};'use strict';var express=require(_0xa581('0x0'));var passport=require(_0xa581('0x1'));var router=express['Router']();var controller=require(_0xa581('0x2'));var userController=require(_0xa581('0x3'));var authService=require(_0xa581('0x4'));router[_0xa581('0x5')]('/',controller[_0xa581('0x6')]);router['get']('/callback',controller[_0xa581('0x7')],authService['isMiddleware'],userController[_0xa581('0x6')],authService[_0xa581('0x8')]);module[_0xa581('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 15c10a3..252b43e 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 _0x32f8=['port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','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~!@#$%^&-_=+[{]}.','login','local','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','http://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','save','Password\x20reset!','catch','use','util','passport','passport-local','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','blocked','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp'];(function(_0x4d91e4,_0x4f0e36){var _0x55cc3e=function(_0x1e0b86){while(--_0x1e0b86){_0x4d91e4['push'](_0x4d91e4['shift']());}};_0x55cc3e(++_0x4f0e36);}(_0x32f8,0x120));var _0x832f=function(_0x52d05e,_0x340f51){_0x52d05e=_0x52d05e-0x0;var _0x3db1a2=_0x32f8[_0x52d05e];return _0x3db1a2;};'use strict';var util=require(_0x832f('0x0'));var passport=require(_0x832f('0x1'));var LocalStrategy=require(_0x832f('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x832f('0x3'));var moment=require('moment');var db=require(_0x832f('0x4'))['db'];var authService=require(_0x832f('0x5'));var utils=require(_0x832f('0x6'));var client=jayson[_0x832f('0x7')][_0x832f('0x8')]({'port':0x232b});function localAuthenticate(_0x310159,_0xc1570d,_0x5bb780,_0xf15756){var _0x3ffff7,_0x2ad4f3;return db[_0x832f('0x9')][_0x832f('0xa')]({'where':{'id':0x1},'attributes':[_0x832f('0xb'),_0x832f('0xc')],'raw':!![]})[_0x832f('0xd')](function(_0x502369){_0x3ffff7=_0x502369;return _0x310159[_0x832f('0xa')]({'attributes':['id',_0x832f('0xe'),'password','salt',_0x832f('0xf'),_0x832f('0x10'),'blocked',_0x832f('0x11'),_0x832f('0x12')],'where':{'name':_0xc1570d,'role':{'$or':[_0x832f('0x13'),_0x832f('0x14'),_0x832f('0x15')]}}});})['then'](function(_0x1e0638){if(!_0x1e0638||_0x1e0638&&_0x1e0638[_0x832f('0xe')]!==_0xc1570d){throw new Error(_0x832f('0x16'));}else{_0x2ad4f3=_0x1e0638;return _0x2ad4f3;}})[_0x832f('0xd')](function(){_0x2ad4f3[_0x832f('0x17')](_0x5bb780,function(_0x622bd5,_0x372cca){var _0x18ad8c=_0x2ad4f3[_0x832f('0x12')]+0x1;if(_0x622bd5){return _0xf15756(_0x622bd5);}else if(!_0x372cca){if(_0x2ad4f3[_0x832f('0x10')]){return _0xf15756(null,![],{'message':_0x832f('0x16')});}else if(_0x3ffff7[_0x832f('0xb')]>0x0){if(_0x2ad4f3['blocked']){if(_0x3ffff7['blockDuration']>0x0){if(moment(_0x2ad4f3[_0x832f('0x11')])['add'](_0x3ffff7[_0x832f('0xc')],_0x832f('0x18'))>moment()){return _0xf15756(null,![],{'message':_0x832f('0x16')});}else{return utils['clearBlockUser'](_0x2ad4f3,_0x18ad8c,![],null)[_0x832f('0xd')](function(){return _0xf15756(null,![],{'message':_0x832f('0x16')});});}}else{return _0xf15756(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x18ad8c>=_0x3ffff7[_0x832f('0xb')]){return utils[_0x832f('0x19')](_0x2ad4f3,0x0,!![],moment())[_0x832f('0xd')](function(){return _0xf15756(null,![],{'message':_0x832f('0x16')});});}else{return utils['clearBlockUser'](_0x2ad4f3,_0x18ad8c,![],null)['then'](function(){return _0xf15756(null,![],{'message':_0x832f('0x16')});});}}}else{return _0xf15756(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ad4f3[_0x832f('0x10')]){return _0xf15756(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3ffff7[_0x832f('0xb')]>0x0){if(_0x2ad4f3['blocked']){if(_0x3ffff7[_0x832f('0xc')]>0x0){if(moment(_0x2ad4f3[_0x832f('0x11')])[_0x832f('0x1a')](_0x3ffff7[_0x832f('0xc')],'minutes')>moment()){return _0xf15756(null,![],{'message':_0x832f('0x16')});}else{return utils[_0x832f('0x19')](_0x2ad4f3,0x0,![],null)[_0x832f('0xd')](function(){return utils[_0x832f('0x1b')](_0x2ad4f3);})[_0x832f('0xd')](function(){return _0xf15756(null,_0x2ad4f3);});}}else{return _0xf15756(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x832f('0x19')](_0x2ad4f3,0x0,![],null)[_0x832f('0xd')](function(){return utils['getLicense'](_0x2ad4f3);})[_0x832f('0xd')](function(){return _0xf15756(null,_0x2ad4f3);})['catch'](function(_0x16585a){return _0xf15756(null,![],_0x16585a);});}}else{if(_0x2ad4f3[_0x832f('0x1c')]){return _0xf15756(null,![],{'message':_0x832f('0x16')});}else{return utils[_0x832f('0x1b')](_0x2ad4f3)[_0x832f('0xd')](function(){return _0xf15756(null,_0x2ad4f3);});}}}});})['catch'](function(_0x4c9833){return _0xf15756(null,![],_0x4c9833);});}function sendServiceMail(_0x2459f7){return db[_0x832f('0x1d')][_0x832f('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x832f('0xe'),_0x832f('0x1f')],'include':[{'model':db[_0x832f('0x20')],'as':'Smtp'}]})[_0x832f('0xd')](function(_0x4fd77b){if(!_0x4fd77b){throw new Error(_0x832f('0x21'));}var _0x5e4cf6={'tls':{'rejectUnauthorized':![]}};if(_0x4fd77b['Smtp']['service']){_0x5e4cf6[_0x832f('0x22')]=_0x4fd77b[_0x832f('0x23')]['service'];}else{_0x5e4cf6['host']=_0x4fd77b['Smtp']['host'];_0x5e4cf6['port']=_0x4fd77b[_0x832f('0x23')][_0x832f('0x24')];_0x5e4cf6['secure']=_0x4fd77b['Smtp'][_0x832f('0x25')];}if(_0x4fd77b[_0x832f('0x23')][_0x832f('0x26')]){_0x5e4cf6[_0x832f('0x27')]={'user':_0x4fd77b[_0x832f('0x23')][_0x832f('0x14')],'pass':_0x4fd77b[_0x832f('0x23')]['pass']};}var _0x30023f={'account':_0x5e4cf6,'message':_[_0x832f('0x28')]({'from':util[_0x832f('0x29')](_0x832f('0x2a'),_0x4fd77b[_0x832f('0xe')],_0x4fd77b['email']||_0x4fd77b[_0x832f('0x23')][_0x832f('0x14')])},_0x2459f7)};return client['request'](_0x832f('0x2b'),_0x30023f);})[_0x832f('0xd')](function(_0x57dc6a){if(_0x57dc6a['error']){throw new Error(util[_0x832f('0x29')](_0x832f('0x2c'),_0x57dc6a[_0x832f('0x2d')][_0x832f('0x2e')]||JSON[_0x832f('0x2f')](_0x57dc6a[_0x832f('0x2d')])));}return!![];});}function handleError(_0x3c006b,_0x5bef54,_0x21d4f){return _0x3c006b['status'](_0x5bef54||0x1f4)[_0x832f('0x30')]({'message':_0x21d4f?_0x21d4f['message']||_0x21d4f:''});}function checkPasswordPattern(_0x1b00ea,_0x558d7d,_0x1da25e){if(_0x1da25e){var _0x55019b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55019b[_0x832f('0x31')](_0x558d7d)){return _0x1b00ea;}else{throw new Error(_0x832f('0x32'));}}else{return _0x1b00ea;}}exports[_0x832f('0x33')]=function(_0x5c6e29,_0xd3a837,_0x280018){passport[_0x832f('0x17')](_0x832f('0x34'),function(_0x117e60,_0x287f3b,_0x4bbd69){var _0x37e4f0=_0x117e60||_0x4bbd69;if(_0x37e4f0){return handleError(_0xd3a837,0x191,_0x37e4f0);}if(!_0x287f3b){return handleError(_0xd3a837,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x190e0d={'payload':{'id':_0x287f3b['id'],'role':_0x287f3b[_0x832f('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x832f('0x35')](_0x190e0d)[_0x832f('0xd')](function(_0x490fd7){_0xd3a837[_0x832f('0x36')]({'id':_0x287f3b['id'],'token':_0x490fd7,'statusCall':'','isAlreadyLogged':_0x287f3b[_0x832f('0x37')]});});}})(_0x5c6e29,_0xd3a837,_0x280018);};exports['forgot']=function(_0x57403a,_0xf98ada,_0x3ecaa9){if(!_0x57403a[_0x832f('0x38')]['email']){return handleError(_0xf98ada,0x1f4,{'message':_0x832f('0x39')});}var _0x26986a=rs[_0x832f('0x3a')]();_0x57403a['body'][_0x832f('0x1f')]=_0x57403a[_0x832f('0x38')][_0x832f('0x1f')][_0x832f('0x3b')]()[_0x832f('0x3c')]();var _0xb081b0;return db[_0x832f('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x832f('0xb'),'blockDuration'],'raw':!![]})[_0x832f('0xd')](function(_0x2d9ede){_0xb081b0=_0x2d9ede;return db[_0x832f('0x3d')][_0x832f('0x1e')]({'where':{'email':_0x57403a['body'][_0x832f('0x1f')]}});})[_0x832f('0xd')](function(_0x125b99){if(!_0x125b99){throw new Error(_0x832f('0x3e'));}if(_0x125b99[_0x832f('0x10')]){throw new Error(_0x832f('0x3f'));}if(_0x125b99[_0x832f('0x1c')]){if(moment(_0x125b99['blockedAt'])[_0x832f('0x1a')](_0xb081b0[_0x832f('0xc')],_0x832f('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x125b99[_0x832f('0x1c')]=![];_0x125b99['blockedAt']=null;}}_0x125b99[_0x832f('0x40')]=_0x26986a;_0x125b99[_0x832f('0x41')]=Date[_0x832f('0x42')]()+0x36ee80;return _0x125b99['save']();})[_0x832f('0xd')](function(){return sendServiceMail({'to':_0x57403a[_0x832f('0x38')]['email'],'subject':_0x832f('0x43'),'text':_0x832f('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x832f('0x45')+_0x57403a['headers']['host']+_0x832f('0x46')+_0x26986a+'\x0a\x0a'+_0x832f('0x47')});})[_0x832f('0xd')](function(){_0xf98ada[_0x832f('0x48')](0xc8)[_0x832f('0x30')]({'message':_0x832f('0x49')});})['catch'](function(_0x30a07a){return handleError(_0xf98ada,0x1f4,_0x30a07a);});};exports['reset']=function(_0x264ce3,_0x3bb2e2,_0x1787c3){var _0x2ae75d;return db[_0x832f('0x3d')][_0x832f('0x1e')]({'where':{'resetPasswordToken':_0x264ce3['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x832f('0x42')]()}}})[_0x832f('0xd')](function(_0x37b596){_0x2ae75d=_0x37b596;if(!_0x2ae75d){throw new Error(_0x832f('0x4a'));}return db[_0x832f('0x9')][_0x832f('0xa')]({'attributes':['id',_0x832f('0x4b')]});})[_0x832f('0xd')](function(_0x4f4a48){return checkPasswordPattern(_0x4f4a48,_0x264ce3[_0x832f('0x38')][_0x832f('0x4c')],_0x4f4a48[_0x832f('0x4b')]);})['then'](function(){_0x2ae75d[_0x832f('0x4c')]=_0x264ce3[_0x832f('0x38')][_0x832f('0x4c')];_0x2ae75d[_0x832f('0x40')]=null;_0x2ae75d[_0x832f('0x41')]=null;return _0x2ae75d[_0x832f('0x4d')]();})[_0x832f('0xd')](function(){_0x3bb2e2[_0x832f('0x48')](0xc8)[_0x832f('0x30')]({'message':_0x832f('0x4e')});})[_0x832f('0x4f')](function(_0x458333){return handleError(_0x3bb2e2,0x1f4,_0x458333);});};passport[_0x832f('0x50')](new LocalStrategy({'usernameField':_0x832f('0xe'),'passwordField':'password'},function(_0x57ad50,_0x1c5e57,_0x9f53fc){return localAuthenticate(db[_0x832f('0x3d')],_0x57ad50,_0x1c5e57,_0x9f53fc);})); \ No newline at end of file +var _0xd072=['agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','merge','\x22%s\x22\x20<%s>','email','error','format','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~!@#$%^&-_=+[{]}.','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0xd072,0x132));var _0x2d07=function(_0x202821,_0x3c1559){_0x202821=_0x202821-0x0;var _0xea50f0=_0xd072[_0x202821];return _0xea50f0;};'use strict';var util=require(_0x2d07('0x0'));var passport=require(_0x2d07('0x1'));var LocalStrategy=require(_0x2d07('0x2'))[_0x2d07('0x3')];var jayson=require(_0x2d07('0x4'));var _=require(_0x2d07('0x5'));var rs=require(_0x2d07('0x6'));var moment=require('moment');var db=require(_0x2d07('0x7'))['db'];var authService=require(_0x2d07('0x8'));var utils=require(_0x2d07('0x9'));var client=jayson[_0x2d07('0xa')][_0x2d07('0xb')]({'port':0x232b});function localAuthenticate(_0x51aae0,_0x1a992a,_0x429d2c,_0x367834){var _0x19d04c,_0x167c61;return db[_0x2d07('0xc')][_0x2d07('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2d07('0xe')],'raw':!![]})[_0x2d07('0xf')](function(_0xa67a15){_0x19d04c=_0xa67a15;return _0x51aae0[_0x2d07('0xd')]({'attributes':['id',_0x2d07('0x10'),_0x2d07('0x11'),_0x2d07('0x12'),_0x2d07('0x13'),_0x2d07('0x14'),_0x2d07('0x15'),_0x2d07('0x16'),_0x2d07('0x17')],'where':{'name':_0x1a992a,'role':{'$or':[_0x2d07('0x18'),_0x2d07('0x19'),_0x2d07('0x1a')]}}});})[_0x2d07('0xf')](function(_0xe8f25f){if(!_0xe8f25f||_0xe8f25f&&_0xe8f25f[_0x2d07('0x10')]!==_0x1a992a){throw new Error(_0x2d07('0x1b'));}else{_0x167c61=_0xe8f25f;return _0x167c61;}})[_0x2d07('0xf')](function(){_0x167c61[_0x2d07('0x1c')](_0x429d2c,function(_0x17eb30,_0x2daa2b){var _0x3a9aa5=_0x167c61[_0x2d07('0x17')]+0x1;if(_0x17eb30){return _0x367834(_0x17eb30);}else if(!_0x2daa2b){if(_0x167c61['disabled']){return _0x367834(null,![],{'message':_0x2d07('0x1b')});}else if(_0x19d04c[_0x2d07('0x1d')]>0x0){if(_0x167c61[_0x2d07('0x15')]){if(_0x19d04c[_0x2d07('0xe')]>0x0){if(moment(_0x167c61[_0x2d07('0x16')])[_0x2d07('0x1e')](_0x19d04c[_0x2d07('0xe')],_0x2d07('0x1f'))>moment()){return _0x367834(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2d07('0x20')](_0x167c61,_0x3a9aa5,![],null)[_0x2d07('0xf')](function(){return _0x367834(null,![],{'message':_0x2d07('0x1b')});});}}else{return _0x367834(null,![],{'message':_0x2d07('0x1b')});}}else{if(_0x3a9aa5>=_0x19d04c['allowedLoginAttempts']){return utils[_0x2d07('0x20')](_0x167c61,0x0,!![],moment())[_0x2d07('0xf')](function(){return _0x367834(null,![],{'message':_0x2d07('0x1b')});});}else{return utils[_0x2d07('0x20')](_0x167c61,_0x3a9aa5,![],null)[_0x2d07('0xf')](function(){return _0x367834(null,![],{'message':_0x2d07('0x1b')});});}}}else{return _0x367834(null,![],{'message':_0x2d07('0x1b')});}}else{if(_0x167c61[_0x2d07('0x14')]){return _0x367834(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x19d04c[_0x2d07('0x1d')]>0x0){if(_0x167c61[_0x2d07('0x15')]){if(_0x19d04c[_0x2d07('0xe')]>0x0){if(moment(_0x167c61['blockedAt'])[_0x2d07('0x1e')](_0x19d04c['blockDuration'],_0x2d07('0x1f'))>moment()){return _0x367834(null,![],{'message':_0x2d07('0x1b')});}else{return utils[_0x2d07('0x20')](_0x167c61,0x0,![],null)['then'](function(){return utils[_0x2d07('0x21')](_0x167c61);})[_0x2d07('0xf')](function(){return _0x367834(null,_0x167c61);});}}else{return _0x367834(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x2d07('0x20')](_0x167c61,0x0,![],null)['then'](function(){return utils[_0x2d07('0x21')](_0x167c61);})[_0x2d07('0xf')](function(){return _0x367834(null,_0x167c61);})[_0x2d07('0x22')](function(_0x41574e){return _0x367834(null,![],_0x41574e);});}}else{if(_0x167c61['blocked']){return _0x367834(null,![],{'message':_0x2d07('0x1b')});}else{return utils[_0x2d07('0x21')](_0x167c61)[_0x2d07('0xf')](function(){return _0x367834(null,_0x167c61);});}}}});})['catch'](function(_0x16c588){return _0x367834(null,![],_0x16c588);});}function sendServiceMail(_0x550fc5){return db['MailAccount'][_0x2d07('0x23')]({'where':{'service':!![]},'attributes':['id',_0x2d07('0x10'),'email'],'include':[{'model':db[_0x2d07('0x24')],'as':'Smtp'}]})['then'](function(_0x35d885){if(!_0x35d885){throw new Error(_0x2d07('0x25'));}var _0x5ecb9a={'tls':{'rejectUnauthorized':![]}};if(_0x35d885[_0x2d07('0x26')]['service']){_0x5ecb9a[_0x2d07('0x27')]=_0x35d885[_0x2d07('0x26')]['service'];}else{_0x5ecb9a[_0x2d07('0x28')]=_0x35d885['Smtp']['host'];_0x5ecb9a[_0x2d07('0x29')]=_0x35d885['Smtp'][_0x2d07('0x29')];_0x5ecb9a[_0x2d07('0x2a')]=_0x35d885[_0x2d07('0x26')]['secure'];}if(_0x35d885['Smtp'][_0x2d07('0x2b')]){_0x5ecb9a[_0x2d07('0x2c')]={'user':_0x35d885[_0x2d07('0x26')][_0x2d07('0x19')],'pass':_0x35d885['Smtp']['pass']};}var _0x5d03f3={'account':_0x5ecb9a,'message':_[_0x2d07('0x2d')]({'from':util['format'](_0x2d07('0x2e'),_0x35d885[_0x2d07('0x10')],_0x35d885[_0x2d07('0x2f')]||_0x35d885[_0x2d07('0x26')][_0x2d07('0x19')])},_0x550fc5)};return client['request']('SendMail',_0x5d03f3);})[_0x2d07('0xf')](function(_0x2da4aa){if(_0x2da4aa[_0x2d07('0x30')]){throw new Error(util[_0x2d07('0x31')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2da4aa[_0x2d07('0x30')][_0x2d07('0x32')]||JSON[_0x2d07('0x33')](_0x2da4aa[_0x2d07('0x30')])));}return!![];});}function handleError(_0x49e754,_0x5706e4,_0x1c88fe){return _0x49e754[_0x2d07('0x34')](_0x5706e4||0x1f4)[_0x2d07('0x35')]({'message':_0x1c88fe?_0x1c88fe['message']||_0x1c88fe:''});}function checkPasswordPattern(_0x4f63c0,_0x63ee18,_0x9f2533){if(_0x9f2533){var _0x18bb24=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18bb24[_0x2d07('0x36')](_0x63ee18)){return _0x4f63c0;}else{throw new Error(_0x2d07('0x37'));}}else{return _0x4f63c0;}}exports['login']=function(_0x18bcc1,_0x264281,_0x4e892c){passport[_0x2d07('0x1c')]('local',function(_0x3f4e2f,_0x38f138,_0x36ac1e){var _0x10c4ca=_0x3f4e2f||_0x36ac1e;if(_0x10c4ca){return handleError(_0x264281,0x191,_0x10c4ca);}if(!_0x38f138){return handleError(_0x264281,0x194,{'message':_0x2d07('0x38')});}else{var _0x2a9156={'payload':{'id':_0x38f138['id'],'role':_0x38f138['role']},'options':{'expiresIn':0x15180}};return authService[_0x2d07('0x39')](_0x2a9156)[_0x2d07('0xf')](function(_0x250a3f){_0x264281[_0x2d07('0x3a')]({'id':_0x38f138['id'],'token':_0x250a3f,'statusCall':'','isAlreadyLogged':_0x38f138['online']});});}})(_0x18bcc1,_0x264281,_0x4e892c);};exports[_0x2d07('0x3b')]=function(_0x4500bf,_0x3f8bb2,_0x2d76e1){if(!_0x4500bf[_0x2d07('0x3c')]['email']){return handleError(_0x3f8bb2,0x1f4,{'message':_0x2d07('0x3d')});}var _0x42f86f=rs[_0x2d07('0x3e')]();_0x4500bf[_0x2d07('0x3c')][_0x2d07('0x2f')]=_0x4500bf[_0x2d07('0x3c')][_0x2d07('0x2f')][_0x2d07('0x3f')]()[_0x2d07('0x40')]();var _0x1fe5c5;return db[_0x2d07('0xc')][_0x2d07('0xd')]({'where':{'id':0x1},'attributes':[_0x2d07('0x1d'),'blockDuration'],'raw':!![]})[_0x2d07('0xf')](function(_0xf74bee){_0x1fe5c5=_0xf74bee;return db['User'][_0x2d07('0x23')]({'where':{'email':_0x4500bf[_0x2d07('0x3c')][_0x2d07('0x2f')]}});})['then'](function(_0x593f55){if(!_0x593f55){throw new Error(_0x2d07('0x41'));}if(_0x593f55[_0x2d07('0x14')]){throw new Error(_0x2d07('0x42'));}if(_0x593f55['blocked']){if(moment(_0x593f55[_0x2d07('0x16')])[_0x2d07('0x1e')](_0x1fe5c5['blockDuration'],_0x2d07('0x1f'))>moment()){throw new Error(_0x2d07('0x43'));}else{_0x593f55[_0x2d07('0x15')]=![];_0x593f55[_0x2d07('0x16')]=null;}}_0x593f55[_0x2d07('0x44')]=_0x42f86f;_0x593f55[_0x2d07('0x45')]=Date['now']()+0x36ee80;return _0x593f55[_0x2d07('0x46')]();})[_0x2d07('0xf')](function(){return sendServiceMail({'to':_0x4500bf['body'][_0x2d07('0x2f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x2d07('0x47')+_0x2d07('0x48')+_0x4500bf['headers']['host']+_0x2d07('0x49')+_0x42f86f+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x2d07('0xf')](function(){_0x3f8bb2['status'](0xc8)[_0x2d07('0x35')]({'message':_0x2d07('0x4a')});})[_0x2d07('0x22')](function(_0x15a348){return handleError(_0x3f8bb2,0x1f4,_0x15a348);});};exports[_0x2d07('0x4b')]=function(_0x27cf40,_0x3de9fb,_0x3bc115){var _0x9fe3f5;return db[_0x2d07('0x4c')][_0x2d07('0x23')]({'where':{'resetPasswordToken':_0x27cf40[_0x2d07('0x4d')][_0x2d07('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x2d07('0x4f')]()}}})[_0x2d07('0xf')](function(_0x12f196){_0x9fe3f5=_0x12f196;if(!_0x9fe3f5){throw new Error(_0x2d07('0x50'));}return db[_0x2d07('0xc')][_0x2d07('0xd')]({'attributes':['id',_0x2d07('0x51')]});})[_0x2d07('0xf')](function(_0x2383a2){return checkPasswordPattern(_0x2383a2,_0x27cf40[_0x2d07('0x3c')][_0x2d07('0x11')],_0x2383a2[_0x2d07('0x51')]);})['then'](function(){_0x9fe3f5[_0x2d07('0x11')]=_0x27cf40['body'][_0x2d07('0x11')];_0x9fe3f5['resetPasswordToken']=null;_0x9fe3f5[_0x2d07('0x45')]=null;return _0x9fe3f5[_0x2d07('0x46')]();})[_0x2d07('0xf')](function(){_0x3de9fb[_0x2d07('0x34')](0xc8)[_0x2d07('0x35')]({'message':_0x2d07('0x52')});})[_0x2d07('0x22')](function(_0x30be3e){return handleError(_0x3de9fb,0x1f4,_0x30be3e);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x452597,_0x363f77,_0x37401a){return localAuthenticate(db[_0x2d07('0x4c')],_0x452597,_0x363f77,_0x37401a);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 5231c5d..dc69ca0 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 _0x6999=['express','Router','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x3702e7,_0x2e9497){var _0x3de29c=function(_0x5a47bb){while(--_0x5a47bb){_0x3702e7['push'](_0x3702e7['shift']());}};_0x3de29c(++_0x2e9497);}(_0x6999,0x90));var _0x9699=function(_0x366b4c,_0x15e6ac){_0x366b4c=_0x366b4c-0x0;var _0x5a13b8=_0x6999[_0x366b4c];return _0x5a13b8;};'use strict';var express=require(_0x9699('0x0'));var router=express[_0x9699('0x1')]();var controller=require('./authLocal.controller');router[_0x9699('0x2')]('/',controller[_0x9699('0x3')]);router[_0x9699('0x2')](_0x9699('0x4'),controller[_0x9699('0x5')]);router['post'](_0x9699('0x6'),controller[_0x9699('0x7')]);module['exports']=router; \ No newline at end of file +var _0xb8b7=['reset','post','/forgot','forgot','/reset/:token'];(function(_0x33aca9,_0x54dc27){var _0x59c757=function(_0x1dc448){while(--_0x1dc448){_0x33aca9['push'](_0x33aca9['shift']());}};_0x59c757(++_0x54dc27);}(_0xb8b7,0x114));var _0x7b8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb8b7[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0x7b8b('0x0')](_0x7b8b('0x1'),controller[_0x7b8b('0x2')]);router['post'](_0x7b8b('0x3'),controller[_0x7b8b('0x4')]);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 44b95b0..92d9b9f 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 _0xd279=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd279,0x1c1));var _0x9d27=function(_0x48d2f4,_0x2ebd62){_0x48d2f4=_0x48d2f4-0x0;var _0x3efa9b=_0xd279[_0x48d2f4];return _0x3efa9b;};'use strict';var Sequelize=require('sequelize');module[_0x9d27('0x0')]={'name':{'type':Sequelize[_0x9d27('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9d27('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9d27('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb4a3=['INTEGER','sequelize','exports','STRING'];(function(_0x4eecbc,_0x5737e7){var _0x9f7eee=function(_0x46bb7c){while(--_0x46bb7c){_0x4eecbc['push'](_0x4eecbc['shift']());}};_0x9f7eee(++_0x5737e7);}(_0xb4a3,0xe1));var _0x3b4a=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0xb4a3[_0x2fd160];return _0x5c2031;};'use strict';var Sequelize=require(_0x3b4a('0x0'));module[_0x3b4a('0x1')]={'name':{'type':Sequelize[_0x3b4a('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3b4a('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3b4a('0x3')],'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 69156ca..f674c77 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 _0x0ed4=['offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','type','options','where','includeAll','include','rows','catch','params','find','create','body','addConditions','Condition','ids','omit','getConditions','order','Action','addActions','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','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'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x0ed4,0x85));var _0x40ed=function(_0x198e50,_0x1f8708){_0x198e50=_0x198e50-0x0;var _0x478867=_0x0ed4[_0x198e50];return _0x478867;};'use strict';var pdf=require(_0x40ed('0x0'));var emlformat=require(_0x40ed('0x1'));var rimraf=require(_0x40ed('0x2'));var zipdir=require(_0x40ed('0x3'));var jsonpatch=require(_0x40ed('0x4'));var rp=require(_0x40ed('0x5'));var moment=require('moment');var BPromise=require(_0x40ed('0x6'));var Mustache=require(_0x40ed('0x7'));var util=require(_0x40ed('0x8'));var path=require(_0x40ed('0x9'));var sox=require('sox');var csv=require(_0x40ed('0xa'));var ejs=require(_0x40ed('0xb'));var fs=require('fs');var _=require(_0x40ed('0xc'));var squel=require(_0x40ed('0xd'));var crypto=require(_0x40ed('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x40ed('0xf'));var toCsv=require('to-csv');var querystring=require(_0x40ed('0x10'));var Papa=require('papaparse');var Redis=require(_0x40ed('0x11'));var authService=require(_0x40ed('0x12'));var qs=require(_0x40ed('0x13'));var as=require(_0x40ed('0x14'));var hardwareService=require(_0x40ed('0x15'));var logger=require(_0x40ed('0x16'))(_0x40ed('0x17'));var utils=require(_0x40ed('0x18'));var config=require(_0x40ed('0x19'));var db=require(_0x40ed('0x1a'))['db'];function respondWithStatusCode(_0x1b0810,_0x9baad4){_0x9baad4=_0x9baad4||0xcc;return function(_0xd9df8c){if(_0xd9df8c){return _0x1b0810['sendStatus'](_0x9baad4);}return _0x1b0810[_0x40ed('0x1b')](_0x9baad4)[_0x40ed('0x1c')]();};}function respondWithResult(_0x133d25,_0x1ce916){_0x1ce916=_0x1ce916||0xc8;return function(_0x5c0170){if(_0x5c0170){return _0x133d25[_0x40ed('0x1b')](_0x1ce916)[_0x40ed('0x1d')](_0x5c0170);}};}function respondWithFilteredResult(_0x5e3f70,_0x5a521f){return function(_0x210607){if(_0x210607){var _0x45a943=_0x210607[_0x40ed('0x1e')],_0x11537e=_0x5a521f['offset'],_0x4e8ab1=_0x5a521f[_0x40ed('0x1f')]+_0x5a521f[_0x40ed('0x20')],_0x3ba9ac;if(_0x4e8ab1>=_0x45a943){_0x4e8ab1=_0x45a943;_0x3ba9ac=0xc8;}else{_0x3ba9ac=0xce;}_0x5e3f70[_0x40ed('0x1b')](_0x3ba9ac);return _0x5e3f70[_0x40ed('0x21')](_0x40ed('0x22'),_0x11537e+'-'+_0x4e8ab1+'/'+_0x45a943)[_0x40ed('0x1d')](_0x210607);}return null;};}function patchUpdates(_0x5ad29e){return function(_0x28e8b9){try{jsonpatch[_0x40ed('0x23')](_0x28e8b9,_0x5ad29e,!![]);}catch(_0x3026b){return BPromise[_0x40ed('0x24')](_0x3026b);}return _0x28e8b9[_0x40ed('0x25')]();};}function saveUpdates(_0x4bce7a,_0x486bac){return function(_0x301799){if(_0x301799){return _0x301799[_0x40ed('0x26')](_0x4bce7a)['then'](function(_0x3852d0){return _0x3852d0;});}return null;};}function removeEntity(_0x4c47ae,_0x36756a){return function(_0x97e707){if(_0x97e707){return _0x97e707['destroy']()[_0x40ed('0x27')](function(){_0x4c47ae[_0x40ed('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf7e8,_0x3fad81){return function(_0x5b2f1e){if(!_0x5b2f1e){_0x1bf7e8['sendStatus'](0x194);}return _0x5b2f1e;};}function handleError(_0x2db20e,_0x4b5684){_0x4b5684=_0x4b5684||0x1f4;return function(_0x491461){logger['error'](_0x491461[_0x40ed('0x28')]);if(_0x491461[_0x40ed('0x29')]){delete _0x491461[_0x40ed('0x29')];}_0x2db20e[_0x40ed('0x1b')](_0x4b5684)[_0x40ed('0x2a')](_0x491461);};}exports[_0x40ed('0x2b')]=function(_0x31a3b1,_0x16cac4){var _0x23cbb0={},_0x3c74f={},_0x258aca={'count':0x0,'rows':[]};var _0x266278=_[_0x40ed('0x2c')](db[_0x40ed('0x2d')][_0x40ed('0x2e')],function(_0x5917f1){return{'name':_0x5917f1[_0x40ed('0x2f')],'type':_0x5917f1['type']['key']};});_0x3c74f['model']=_[_0x40ed('0x2c')](_0x266278,_0x40ed('0x29'));_0x3c74f[_0x40ed('0x30')]=_[_0x40ed('0x31')](_0x31a3b1['query']);_0x3c74f['filters']=_[_0x40ed('0x32')](_0x3c74f[_0x40ed('0x33')],_0x3c74f['query']);_0x23cbb0[_0x40ed('0x34')]=_[_0x40ed('0x32')](_0x3c74f[_0x40ed('0x33')],qs[_0x40ed('0x35')](_0x31a3b1[_0x40ed('0x30')]['fields']));_0x23cbb0['attributes']=_0x23cbb0[_0x40ed('0x34')][_0x40ed('0x36')]?_0x23cbb0[_0x40ed('0x34')]:_0x3c74f[_0x40ed('0x33')];if(!_0x31a3b1['query'][_0x40ed('0x37')](_0x40ed('0x38'))){_0x23cbb0['limit']=qs[_0x40ed('0x20')](_0x31a3b1[_0x40ed('0x30')][_0x40ed('0x20')]);_0x23cbb0[_0x40ed('0x1f')]=qs[_0x40ed('0x1f')](_0x31a3b1[_0x40ed('0x30')][_0x40ed('0x1f')]);}_0x23cbb0['order']=qs[_0x40ed('0x39')](_0x31a3b1[_0x40ed('0x30')][_0x40ed('0x39')]);_0x23cbb0['where']=qs[_0x40ed('0x3a')](_[_0x40ed('0x3b')](_0x31a3b1[_0x40ed('0x30')],_0x3c74f[_0x40ed('0x3a')]),_0x266278);if(_0x31a3b1['query'][_0x40ed('0x3c')]){_0x23cbb0['where']=_[_0x40ed('0x3d')](_0x23cbb0['where'],{'$or':_[_0x40ed('0x2c')](_0x266278,function(_0x25bd4e){if(_0x25bd4e[_0x40ed('0x3e')]!=='VIRTUAL'){var _0x494236={};_0x494236[_0x25bd4e[_0x40ed('0x29')]]={'$like':'%'+_0x31a3b1['query'][_0x40ed('0x3c')]+'%'};return _0x494236;}})});}_0x23cbb0=_['merge']({},_0x23cbb0,_0x31a3b1[_0x40ed('0x3f')]);var _0x1147e4={'where':_0x23cbb0[_0x40ed('0x40')]};return db[_0x40ed('0x2d')]['count'](_0x1147e4)['then'](function(_0x15d324){_0x258aca[_0x40ed('0x1e')]=_0x15d324;if(_0x31a3b1[_0x40ed('0x30')][_0x40ed('0x41')]){_0x23cbb0[_0x40ed('0x42')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x23cbb0);})[_0x40ed('0x27')](function(_0x163211){_0x258aca[_0x40ed('0x43')]=_0x163211;return _0x258aca;})['then'](respondWithFilteredResult(_0x16cac4,_0x23cbb0))[_0x40ed('0x44')](handleError(_0x16cac4,null));};exports['show']=function(_0x4f537c,_0x2d2e25){var _0x3a11b1={'raw':![],'where':{'id':_0x4f537c[_0x40ed('0x45')]['id']}},_0x4fa355={};_0x4fa355[_0x40ed('0x33')]=_[_0x40ed('0x31')](db['Automation'][_0x40ed('0x2e')]);_0x4fa355['query']=_[_0x40ed('0x31')](_0x4f537c[_0x40ed('0x30')]);_0x4fa355['filters']=_['intersection'](_0x4fa355[_0x40ed('0x33')],_0x4fa355[_0x40ed('0x30')]);_0x3a11b1[_0x40ed('0x34')]=_['intersection'](_0x4fa355[_0x40ed('0x33')],qs[_0x40ed('0x35')](_0x4f537c[_0x40ed('0x30')]['fields']));_0x3a11b1[_0x40ed('0x34')]=_0x3a11b1[_0x40ed('0x34')][_0x40ed('0x36')]?_0x3a11b1['attributes']:_0x4fa355[_0x40ed('0x33')];if(_0x4f537c[_0x40ed('0x30')][_0x40ed('0x41')]){_0x3a11b1[_0x40ed('0x42')]=[{'all':!![]}];}_0x3a11b1=_['merge']({},_0x3a11b1,_0x4f537c[_0x40ed('0x3f')]);return db[_0x40ed('0x2d')][_0x40ed('0x46')](_0x3a11b1)['then'](handleEntityNotFound(_0x2d2e25,null))['then'](respondWithResult(_0x2d2e25,null))[_0x40ed('0x44')](handleError(_0x2d2e25,null));};exports['create']=function(_0x2ee0ba,_0x3858f9){return db[_0x40ed('0x2d')][_0x40ed('0x47')](_0x2ee0ba[_0x40ed('0x48')],{})[_0x40ed('0x27')](respondWithResult(_0x3858f9,0xc9))[_0x40ed('0x44')](handleError(_0x3858f9,null));};exports[_0x40ed('0x26')]=function(_0x2a2096,_0x272a51){if(_0x2a2096[_0x40ed('0x48')]['id']){delete _0x2a2096[_0x40ed('0x48')]['id'];}return db[_0x40ed('0x2d')][_0x40ed('0x46')]({'where':{'id':_0x2a2096[_0x40ed('0x45')]['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0x272a51,null))[_0x40ed('0x27')](saveUpdates(_0x2a2096[_0x40ed('0x48')],null))[_0x40ed('0x27')](respondWithResult(_0x272a51,null))[_0x40ed('0x44')](handleError(_0x272a51,null));};exports['destroy']=function(_0x4cd7b0,_0x29437a){return db[_0x40ed('0x2d')][_0x40ed('0x46')]({'where':{'id':_0x4cd7b0[_0x40ed('0x45')]['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0x29437a,null))[_0x40ed('0x27')](removeEntity(_0x29437a,null))[_0x40ed('0x44')](handleError(_0x29437a,null));};exports[_0x40ed('0x49')]=function(_0x5dfb98,_0x2ed15e,_0x107c03){return db[_0x40ed('0x4a')][_0x40ed('0x46')]({'where':{'id':_0x5dfb98['params']['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0x2ed15e,null))[_0x40ed('0x27')](function(_0x79813d){if(_0x79813d){return _0x79813d[_0x40ed('0x49')](_0x5dfb98[_0x40ed('0x48')][_0x40ed('0x4b')],_[_0x40ed('0x4c')](_0x5dfb98[_0x40ed('0x48')],[_0x40ed('0x4b'),'id'])||{});}})[_0x40ed('0x27')](respondWithResult(_0x2ed15e,null))[_0x40ed('0x44')](handleError(_0x2ed15e,null));};exports[_0x40ed('0x4d')]=function(_0x1645cd,_0x14052c,_0xd3d2df){var _0x45bd78={};var _0x329c8c={};var _0x18c293;var _0x49dbf0;return db[_0x40ed('0x2d')]['findOne']({'where':{'id':_0x1645cd['params']['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0x14052c,null))['then'](function(_0x2623ae){if(_0x2623ae){_0x18c293=_0x2623ae;_0x329c8c[_0x40ed('0x33')]=_[_0x40ed('0x31')](db[_0x40ed('0x4a')]['rawAttributes']);_0x329c8c[_0x40ed('0x30')]=_['keys'](_0x1645cd[_0x40ed('0x30')]);_0x329c8c[_0x40ed('0x3a')]=_[_0x40ed('0x32')](_0x329c8c[_0x40ed('0x33')],_0x329c8c[_0x40ed('0x30')]);_0x45bd78[_0x40ed('0x34')]=_[_0x40ed('0x32')](_0x329c8c[_0x40ed('0x33')],qs['fields'](_0x1645cd[_0x40ed('0x30')]['fields']));_0x45bd78[_0x40ed('0x34')]=_0x45bd78['attributes'][_0x40ed('0x36')]?_0x45bd78[_0x40ed('0x34')]:_0x329c8c[_0x40ed('0x33')];_0x45bd78[_0x40ed('0x4e')]=qs[_0x40ed('0x39')](_0x1645cd[_0x40ed('0x30')][_0x40ed('0x39')]);_0x45bd78[_0x40ed('0x40')]=qs[_0x40ed('0x3a')](_['pick'](_0x1645cd[_0x40ed('0x30')],_0x329c8c['filters']));if(_0x1645cd[_0x40ed('0x30')][_0x40ed('0x3c')]){_0x45bd78['where']=_[_0x40ed('0x3d')](_0x45bd78['where'],{'$or':_['map'](_0x45bd78[_0x40ed('0x34')],function(_0x469f41){var _0x50eca3={};_0x50eca3[_0x469f41]={'$like':'%'+_0x1645cd[_0x40ed('0x30')][_0x40ed('0x3c')]+'%'};return _0x50eca3;})});}_0x45bd78=_[_0x40ed('0x3d')]({},_0x45bd78,_0x1645cd[_0x40ed('0x3f')]);return _0x18c293[_0x40ed('0x4d')](_0x45bd78);}})[_0x40ed('0x27')](function(_0xb0c930){if(_0xb0c930){_0x49dbf0=_0xb0c930[_0x40ed('0x36')];if(!_0x1645cd[_0x40ed('0x30')][_0x40ed('0x37')]('nolimit')){_0x45bd78[_0x40ed('0x20')]=qs[_0x40ed('0x20')](_0x1645cd[_0x40ed('0x30')][_0x40ed('0x20')]);_0x45bd78[_0x40ed('0x1f')]=qs[_0x40ed('0x1f')](_0x1645cd[_0x40ed('0x30')]['offset']);}return _0x18c293[_0x40ed('0x4d')](_0x45bd78);}})[_0x40ed('0x27')](function(_0x188e25){if(_0x188e25){return _0x188e25?{'count':_0x49dbf0,'rows':_0x188e25}:null;}})[_0x40ed('0x27')](respondWithResult(_0x14052c,null))[_0x40ed('0x44')](handleError(_0x14052c,null));};exports['addActions']=function(_0xa09cf7,_0x57f70c,_0x516ab9){return db[_0x40ed('0x4f')][_0x40ed('0x46')]({'where':{'id':_0xa09cf7[_0x40ed('0x45')]['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0x57f70c,null))[_0x40ed('0x27')](function(_0x312739){if(_0x312739){return _0x312739[_0x40ed('0x50')](_0xa09cf7[_0x40ed('0x48')][_0x40ed('0x4b')],_[_0x40ed('0x4c')](_0xa09cf7[_0x40ed('0x48')],['ids','id'])||{});}})[_0x40ed('0x27')](respondWithResult(_0x57f70c,null))['catch'](handleError(_0x57f70c,null));};exports[_0x40ed('0x51')]=function(_0x114dc9,_0xf9c5a1,_0x1d02cb){var _0x1e8860={};var _0x364966={};var _0x667fc4;var _0x1406df;return db[_0x40ed('0x2d')]['findOne']({'where':{'id':_0x114dc9[_0x40ed('0x45')]['id']}})[_0x40ed('0x27')](handleEntityNotFound(_0xf9c5a1,null))[_0x40ed('0x27')](function(_0x2cf09c){if(_0x2cf09c){_0x667fc4=_0x2cf09c;_0x364966[_0x40ed('0x33')]=_[_0x40ed('0x31')](db[_0x40ed('0x4f')][_0x40ed('0x2e')]);_0x364966['query']=_[_0x40ed('0x31')](_0x114dc9[_0x40ed('0x30')]);_0x364966[_0x40ed('0x3a')]=_['intersection'](_0x364966[_0x40ed('0x33')],_0x364966[_0x40ed('0x30')]);_0x1e8860[_0x40ed('0x34')]=_[_0x40ed('0x32')](_0x364966[_0x40ed('0x33')],qs[_0x40ed('0x35')](_0x114dc9[_0x40ed('0x30')][_0x40ed('0x35')]));_0x1e8860['attributes']=_0x1e8860[_0x40ed('0x34')][_0x40ed('0x36')]?_0x1e8860[_0x40ed('0x34')]:_0x364966['model'];_0x1e8860[_0x40ed('0x4e')]=qs['sort'](_0x114dc9['query'][_0x40ed('0x39')]);_0x1e8860['where']=qs['filters'](_['pick'](_0x114dc9[_0x40ed('0x30')],_0x364966[_0x40ed('0x3a')]));if(_0x114dc9[_0x40ed('0x30')][_0x40ed('0x3c')]){_0x1e8860[_0x40ed('0x40')]=_[_0x40ed('0x3d')](_0x1e8860[_0x40ed('0x40')],{'$or':_['map'](_0x1e8860[_0x40ed('0x34')],function(_0x5d1fee){var _0x56e1a9={};_0x56e1a9[_0x5d1fee]={'$like':'%'+_0x114dc9[_0x40ed('0x30')][_0x40ed('0x3c')]+'%'};return _0x56e1a9;})});}_0x1e8860=_[_0x40ed('0x3d')]({},_0x1e8860,_0x114dc9[_0x40ed('0x3f')]);return _0x667fc4[_0x40ed('0x51')](_0x1e8860);}})[_0x40ed('0x27')](function(_0x58535a){if(_0x58535a){_0x1406df=_0x58535a[_0x40ed('0x36')];if(!_0x114dc9[_0x40ed('0x30')][_0x40ed('0x37')](_0x40ed('0x38'))){_0x1e8860[_0x40ed('0x20')]=qs[_0x40ed('0x20')](_0x114dc9[_0x40ed('0x30')][_0x40ed('0x20')]);_0x1e8860[_0x40ed('0x1f')]=qs['offset'](_0x114dc9[_0x40ed('0x30')][_0x40ed('0x1f')]);}return _0x667fc4[_0x40ed('0x51')](_0x1e8860);}})[_0x40ed('0x27')](function(_0x279c93){if(_0x279c93){return _0x279c93?{'count':_0x1406df,'rows':_0x279c93}:null;}})[_0x40ed('0x27')](respondWithResult(_0xf9c5a1,null))[_0x40ed('0x44')](handleError(_0xf9c5a1,null));}; \ No newline at end of file +var _0xe979=['pick','filter','merge','VIRTUAL','count','then','includeAll','findAll','rows','catch','show','params','keys','filters','include','options','find','create','body','destroy','addConditions','Condition','ids','getConditions','order','hasOwnProperty','addActions','Action','omit','getActions','findOne','nolimit','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','end','error','stack','name','index','map','Automation','rawAttributes','type','model','query','intersection','attributes','fields','length','sort','where'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xe979,0x113));var _0x9e97=function(_0x2d5c0c,_0x38c5a2){_0x2d5c0c=_0x2d5c0c-0x0;var _0x5a0fa4=_0xe979[_0x2d5c0c];return _0x5a0fa4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9e97('0x0'));var rimraf=require(_0x9e97('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e97('0x2'));var moment=require(_0x9e97('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9e97('0x4'));var util=require(_0x9e97('0x5'));var path=require(_0x9e97('0x6'));var sox=require(_0x9e97('0x7'));var csv=require(_0x9e97('0x8'));var ejs=require(_0x9e97('0x9'));var fs=require('fs');var _=require(_0x9e97('0xa'));var squel=require(_0x9e97('0xb'));var crypto=require(_0x9e97('0xc'));var jsforce=require(_0x9e97('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9e97('0x8'));var querystring=require(_0x9e97('0xe'));var Papa=require(_0x9e97('0xf'));var Redis=require(_0x9e97('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9e97('0x11'));var hardwareService=require(_0x9e97('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9e97('0x13'));var config=require(_0x9e97('0x14'));var db=require(_0x9e97('0x15'))['db'];function respondWithStatusCode(_0x39cc86,_0x400b14){_0x400b14=_0x400b14||0xcc;return function(_0x333be0){if(_0x333be0){return _0x39cc86[_0x9e97('0x16')](_0x400b14);}return _0x39cc86[_0x9e97('0x17')](_0x400b14)['end']();};}function respondWithResult(_0x8badfe,_0x5ce9a7){_0x5ce9a7=_0x5ce9a7||0xc8;return function(_0x169331){if(_0x169331){return _0x8badfe[_0x9e97('0x17')](_0x5ce9a7)[_0x9e97('0x18')](_0x169331);}};}function respondWithFilteredResult(_0x26a65e,_0x42095d){return function(_0x374181){if(_0x374181){var _0x4f5745=_0x374181['count'],_0x44b0f1=_0x42095d['offset'],_0x5c5393=_0x42095d[_0x9e97('0x19')]+_0x42095d[_0x9e97('0x1a')],_0x2a4db3;if(_0x5c5393>=_0x4f5745){_0x5c5393=_0x4f5745;_0x2a4db3=0xc8;}else{_0x2a4db3=0xce;}_0x26a65e['status'](_0x2a4db3);return _0x26a65e['set'](_0x9e97('0x1b'),_0x44b0f1+'-'+_0x5c5393+'/'+_0x4f5745)[_0x9e97('0x18')](_0x374181);}return null;};}function patchUpdates(_0x261e98){return function(_0x4ff20){try{jsonpatch[_0x9e97('0x1c')](_0x4ff20,_0x261e98,!![]);}catch(_0x75bf1){return BPromise[_0x9e97('0x1d')](_0x75bf1);}return _0x4ff20[_0x9e97('0x1e')]();};}function saveUpdates(_0x2228bc,_0xa19918){return function(_0x49399f){if(_0x49399f){return _0x49399f[_0x9e97('0x1f')](_0x2228bc)['then'](function(_0x264711){return _0x264711;});}return null;};}function removeEntity(_0xc1e7e,_0x179eaa){return function(_0x42e0a5){if(_0x42e0a5){return _0x42e0a5['destroy']()['then'](function(){_0xc1e7e['status'](0xcc)[_0x9e97('0x20')]();});}};}function handleEntityNotFound(_0x597078,_0x2edb64){return function(_0xccac72){if(!_0xccac72){_0x597078[_0x9e97('0x16')](0x194);}return _0xccac72;};}function handleError(_0x20c09b,_0x29433a){_0x29433a=_0x29433a||0x1f4;return function(_0xa26bc3){logger[_0x9e97('0x21')](_0xa26bc3[_0x9e97('0x22')]);if(_0xa26bc3[_0x9e97('0x23')]){delete _0xa26bc3['name'];}_0x20c09b[_0x9e97('0x17')](_0x29433a)['send'](_0xa26bc3);};}exports[_0x9e97('0x24')]=function(_0x55515b,_0x28bb8a){var _0x427759={},_0x4e23d9={},_0x337e78={'count':0x0,'rows':[]};var _0x2b8de3=_[_0x9e97('0x25')](db[_0x9e97('0x26')][_0x9e97('0x27')],function(_0x3ad2ea){return{'name':_0x3ad2ea['fieldName'],'type':_0x3ad2ea[_0x9e97('0x28')]['key']};});_0x4e23d9[_0x9e97('0x29')]=_[_0x9e97('0x25')](_0x2b8de3,'name');_0x4e23d9[_0x9e97('0x2a')]=_['keys'](_0x55515b[_0x9e97('0x2a')]);_0x4e23d9['filters']=_[_0x9e97('0x2b')](_0x4e23d9[_0x9e97('0x29')],_0x4e23d9[_0x9e97('0x2a')]);_0x427759[_0x9e97('0x2c')]=_[_0x9e97('0x2b')](_0x4e23d9[_0x9e97('0x29')],qs['fields'](_0x55515b[_0x9e97('0x2a')][_0x9e97('0x2d')]));_0x427759[_0x9e97('0x2c')]=_0x427759[_0x9e97('0x2c')][_0x9e97('0x2e')]?_0x427759[_0x9e97('0x2c')]:_0x4e23d9[_0x9e97('0x29')];if(!_0x55515b['query']['hasOwnProperty']('nolimit')){_0x427759[_0x9e97('0x1a')]=qs[_0x9e97('0x1a')](_0x55515b[_0x9e97('0x2a')]['limit']);_0x427759['offset']=qs[_0x9e97('0x19')](_0x55515b['query'][_0x9e97('0x19')]);}_0x427759['order']=qs['sort'](_0x55515b[_0x9e97('0x2a')][_0x9e97('0x2f')]);_0x427759[_0x9e97('0x30')]=qs['filters'](_[_0x9e97('0x31')](_0x55515b['query'],_0x4e23d9['filters']),_0x2b8de3);if(_0x55515b[_0x9e97('0x2a')][_0x9e97('0x32')]){_0x427759['where']=_[_0x9e97('0x33')](_0x427759['where'],{'$or':_[_0x9e97('0x25')](_0x2b8de3,function(_0x59f51e){if(_0x59f51e[_0x9e97('0x28')]!==_0x9e97('0x34')){var _0x43ac04={};_0x43ac04[_0x59f51e[_0x9e97('0x23')]]={'$like':'%'+_0x55515b[_0x9e97('0x2a')][_0x9e97('0x32')]+'%'};return _0x43ac04;}})});}_0x427759=_['merge']({},_0x427759,_0x55515b['options']);var _0x339bcb={'where':_0x427759[_0x9e97('0x30')]};return db['Automation'][_0x9e97('0x35')](_0x339bcb)[_0x9e97('0x36')](function(_0x326112){_0x337e78[_0x9e97('0x35')]=_0x326112;if(_0x55515b['query'][_0x9e97('0x37')]){_0x427759['include']=[{'all':!![]}];}return db[_0x9e97('0x26')][_0x9e97('0x38')](_0x427759);})[_0x9e97('0x36')](function(_0x15bf1b){_0x337e78[_0x9e97('0x39')]=_0x15bf1b;return _0x337e78;})[_0x9e97('0x36')](respondWithFilteredResult(_0x28bb8a,_0x427759))[_0x9e97('0x3a')](handleError(_0x28bb8a,null));};exports[_0x9e97('0x3b')]=function(_0x44681c,_0x669074){var _0x1dc3c9={'raw':![],'where':{'id':_0x44681c[_0x9e97('0x3c')]['id']}},_0x231757={};_0x231757[_0x9e97('0x29')]=_[_0x9e97('0x3d')](db['Automation']['rawAttributes']);_0x231757[_0x9e97('0x2a')]=_['keys'](_0x44681c[_0x9e97('0x2a')]);_0x231757[_0x9e97('0x3e')]=_[_0x9e97('0x2b')](_0x231757[_0x9e97('0x29')],_0x231757[_0x9e97('0x2a')]);_0x1dc3c9[_0x9e97('0x2c')]=_[_0x9e97('0x2b')](_0x231757['model'],qs[_0x9e97('0x2d')](_0x44681c['query'][_0x9e97('0x2d')]));_0x1dc3c9[_0x9e97('0x2c')]=_0x1dc3c9[_0x9e97('0x2c')][_0x9e97('0x2e')]?_0x1dc3c9[_0x9e97('0x2c')]:_0x231757['model'];if(_0x44681c[_0x9e97('0x2a')][_0x9e97('0x37')]){_0x1dc3c9[_0x9e97('0x3f')]=[{'all':!![]}];}_0x1dc3c9=_['merge']({},_0x1dc3c9,_0x44681c[_0x9e97('0x40')]);return db[_0x9e97('0x26')][_0x9e97('0x41')](_0x1dc3c9)[_0x9e97('0x36')](handleEntityNotFound(_0x669074,null))[_0x9e97('0x36')](respondWithResult(_0x669074,null))[_0x9e97('0x3a')](handleError(_0x669074,null));};exports[_0x9e97('0x42')]=function(_0x49d692,_0x543a1a){return db[_0x9e97('0x26')][_0x9e97('0x42')](_0x49d692[_0x9e97('0x43')],{})[_0x9e97('0x36')](respondWithResult(_0x543a1a,0xc9))[_0x9e97('0x3a')](handleError(_0x543a1a,null));};exports['update']=function(_0x1c7974,_0x5ec746){if(_0x1c7974[_0x9e97('0x43')]['id']){delete _0x1c7974['body']['id'];}return db[_0x9e97('0x26')]['find']({'where':{'id':_0x1c7974[_0x9e97('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5ec746,null))['then'](saveUpdates(_0x1c7974['body'],null))[_0x9e97('0x36')](respondWithResult(_0x5ec746,null))[_0x9e97('0x3a')](handleError(_0x5ec746,null));};exports[_0x9e97('0x44')]=function(_0x2cc242,_0x30e784){return db[_0x9e97('0x26')][_0x9e97('0x41')]({'where':{'id':_0x2cc242['params']['id']}})[_0x9e97('0x36')](handleEntityNotFound(_0x30e784,null))[_0x9e97('0x36')](removeEntity(_0x30e784,null))[_0x9e97('0x3a')](handleError(_0x30e784,null));};exports[_0x9e97('0x45')]=function(_0x187e4c,_0x47dc84,_0x5a9adf){return db[_0x9e97('0x46')]['find']({'where':{'id':_0x187e4c[_0x9e97('0x3c')]['id']}})['then'](handleEntityNotFound(_0x47dc84,null))[_0x9e97('0x36')](function(_0x56b450){if(_0x56b450){return _0x56b450['addConditions'](_0x187e4c[_0x9e97('0x43')][_0x9e97('0x47')],_['omit'](_0x187e4c['body'],[_0x9e97('0x47'),'id'])||{});}})[_0x9e97('0x36')](respondWithResult(_0x47dc84,null))['catch'](handleError(_0x47dc84,null));};exports[_0x9e97('0x48')]=function(_0x43b2db,_0x2fc8a0,_0x4b1aae){var _0x4d6e75={};var _0x34cba6={};var _0xf635aa;var _0x3972b1;return db['Automation']['findOne']({'where':{'id':_0x43b2db[_0x9e97('0x3c')]['id']}})[_0x9e97('0x36')](handleEntityNotFound(_0x2fc8a0,null))[_0x9e97('0x36')](function(_0x2a1241){if(_0x2a1241){_0xf635aa=_0x2a1241;_0x34cba6[_0x9e97('0x29')]=_[_0x9e97('0x3d')](db['Condition'][_0x9e97('0x27')]);_0x34cba6[_0x9e97('0x2a')]=_[_0x9e97('0x3d')](_0x43b2db[_0x9e97('0x2a')]);_0x34cba6[_0x9e97('0x3e')]=_['intersection'](_0x34cba6[_0x9e97('0x29')],_0x34cba6[_0x9e97('0x2a')]);_0x4d6e75[_0x9e97('0x2c')]=_[_0x9e97('0x2b')](_0x34cba6['model'],qs[_0x9e97('0x2d')](_0x43b2db[_0x9e97('0x2a')]['fields']));_0x4d6e75[_0x9e97('0x2c')]=_0x4d6e75['attributes'][_0x9e97('0x2e')]?_0x4d6e75[_0x9e97('0x2c')]:_0x34cba6[_0x9e97('0x29')];_0x4d6e75[_0x9e97('0x49')]=qs[_0x9e97('0x2f')](_0x43b2db[_0x9e97('0x2a')]['sort']);_0x4d6e75[_0x9e97('0x30')]=qs['filters'](_['pick'](_0x43b2db[_0x9e97('0x2a')],_0x34cba6[_0x9e97('0x3e')]));if(_0x43b2db[_0x9e97('0x2a')][_0x9e97('0x32')]){_0x4d6e75[_0x9e97('0x30')]=_['merge'](_0x4d6e75[_0x9e97('0x30')],{'$or':_['map'](_0x4d6e75[_0x9e97('0x2c')],function(_0x48d790){var _0x494bca={};_0x494bca[_0x48d790]={'$like':'%'+_0x43b2db[_0x9e97('0x2a')][_0x9e97('0x32')]+'%'};return _0x494bca;})});}_0x4d6e75=_['merge']({},_0x4d6e75,_0x43b2db['options']);return _0xf635aa['getConditions'](_0x4d6e75);}})[_0x9e97('0x36')](function(_0xb7e8d9){if(_0xb7e8d9){_0x3972b1=_0xb7e8d9['length'];if(!_0x43b2db['query'][_0x9e97('0x4a')]('nolimit')){_0x4d6e75[_0x9e97('0x1a')]=qs[_0x9e97('0x1a')](_0x43b2db[_0x9e97('0x2a')][_0x9e97('0x1a')]);_0x4d6e75[_0x9e97('0x19')]=qs[_0x9e97('0x19')](_0x43b2db[_0x9e97('0x2a')][_0x9e97('0x19')]);}return _0xf635aa[_0x9e97('0x48')](_0x4d6e75);}})[_0x9e97('0x36')](function(_0x232dd2){if(_0x232dd2){return _0x232dd2?{'count':_0x3972b1,'rows':_0x232dd2}:null;}})[_0x9e97('0x36')](respondWithResult(_0x2fc8a0,null))['catch'](handleError(_0x2fc8a0,null));};exports[_0x9e97('0x4b')]=function(_0x65998f,_0x23e005,_0x51c62d){return db[_0x9e97('0x4c')]['find']({'where':{'id':_0x65998f[_0x9e97('0x3c')]['id']}})[_0x9e97('0x36')](handleEntityNotFound(_0x23e005,null))[_0x9e97('0x36')](function(_0x567012){if(_0x567012){return _0x567012[_0x9e97('0x4b')](_0x65998f[_0x9e97('0x43')][_0x9e97('0x47')],_[_0x9e97('0x4d')](_0x65998f['body'],[_0x9e97('0x47'),'id'])||{});}})[_0x9e97('0x36')](respondWithResult(_0x23e005,null))[_0x9e97('0x3a')](handleError(_0x23e005,null));};exports[_0x9e97('0x4e')]=function(_0x15d297,_0x267f83,_0x15480e){var _0x1e5a28={};var _0x2d2b0e={};var _0x2f12c8;var _0x198849;return db[_0x9e97('0x26')][_0x9e97('0x4f')]({'where':{'id':_0x15d297[_0x9e97('0x3c')]['id']}})[_0x9e97('0x36')](handleEntityNotFound(_0x267f83,null))['then'](function(_0x5bf7e4){if(_0x5bf7e4){_0x2f12c8=_0x5bf7e4;_0x2d2b0e[_0x9e97('0x29')]=_[_0x9e97('0x3d')](db['Action']['rawAttributes']);_0x2d2b0e[_0x9e97('0x2a')]=_['keys'](_0x15d297[_0x9e97('0x2a')]);_0x2d2b0e[_0x9e97('0x3e')]=_[_0x9e97('0x2b')](_0x2d2b0e['model'],_0x2d2b0e[_0x9e97('0x2a')]);_0x1e5a28[_0x9e97('0x2c')]=_[_0x9e97('0x2b')](_0x2d2b0e['model'],qs[_0x9e97('0x2d')](_0x15d297[_0x9e97('0x2a')]['fields']));_0x1e5a28[_0x9e97('0x2c')]=_0x1e5a28[_0x9e97('0x2c')][_0x9e97('0x2e')]?_0x1e5a28[_0x9e97('0x2c')]:_0x2d2b0e[_0x9e97('0x29')];_0x1e5a28[_0x9e97('0x49')]=qs['sort'](_0x15d297[_0x9e97('0x2a')]['sort']);_0x1e5a28['where']=qs['filters'](_['pick'](_0x15d297[_0x9e97('0x2a')],_0x2d2b0e[_0x9e97('0x3e')]));if(_0x15d297[_0x9e97('0x2a')][_0x9e97('0x32')]){_0x1e5a28['where']=_['merge'](_0x1e5a28[_0x9e97('0x30')],{'$or':_[_0x9e97('0x25')](_0x1e5a28[_0x9e97('0x2c')],function(_0xddf1e3){var _0x4eb68f={};_0x4eb68f[_0xddf1e3]={'$like':'%'+_0x15d297[_0x9e97('0x2a')]['filter']+'%'};return _0x4eb68f;})});}_0x1e5a28=_[_0x9e97('0x33')]({},_0x1e5a28,_0x15d297[_0x9e97('0x40')]);return _0x2f12c8[_0x9e97('0x4e')](_0x1e5a28);}})[_0x9e97('0x36')](function(_0x5760cc){if(_0x5760cc){_0x198849=_0x5760cc[_0x9e97('0x2e')];if(!_0x15d297['query'][_0x9e97('0x4a')](_0x9e97('0x50'))){_0x1e5a28[_0x9e97('0x1a')]=qs[_0x9e97('0x1a')](_0x15d297[_0x9e97('0x2a')][_0x9e97('0x1a')]);_0x1e5a28['offset']=qs[_0x9e97('0x19')](_0x15d297[_0x9e97('0x2a')]['offset']);}return _0x2f12c8[_0x9e97('0x4e')](_0x1e5a28);}})[_0x9e97('0x36')](function(_0x3b9515){if(_0x3b9515){return _0x3b9515?{'count':_0x198849,'rows':_0x3b9515}:null;}})[_0x9e97('0x36')](respondWithResult(_0x267f83,null))[_0x9e97('0x3a')](handleError(_0x267f83,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a846af4..65d3fce 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 _0x0dac=['tools_automations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x0dac,0x151));var _0xc0da=function(_0x48f008,_0x4ff899){_0x48f008=_0x48f008-0x0;var _0x1714e8=_0x0dac[_0x48f008];return _0x1714e8;};'use strict';var _=require(_0xc0da('0x0'));var util=require(_0xc0da('0x1'));var logger=require(_0xc0da('0x2'))(_0xc0da('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc0da('0x4'));var fs=require('fs');var path=require(_0xc0da('0x5'));var rimraf=require(_0xc0da('0x6'));var config=require(_0xc0da('0x7'));var attributes=require(_0xc0da('0x8'));module[_0xc0da('0x9')]=function(_0x13769c,_0xebf088){return _0x13769c['define'](_0xc0da('0xa'),attributes,{'tableName':_0xc0da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c58=['bluebird','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api'];(function(_0x10644f,_0x39f5fc){var _0x3fcaa0=function(_0x261f80){while(--_0x261f80){_0x10644f['push'](_0x10644f['shift']());}};_0x3fcaa0(++_0x39f5fc);}(_0x6c58,0xcd));var _0x86c5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6c58[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x86c5('0x0'));var util=require(_0x86c5('0x1'));var logger=require(_0x86c5('0x2'))(_0x86c5('0x3'));var moment=require('moment');var BPromise=require(_0x86c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x86c5('0x5'));var config=require(_0x86c5('0x6'));var attributes=require(_0x86c5('0x7'));module[_0x86c5('0x8')]=function(_0x2efdc4,_0x3524c3){return _0x2efdc4['define'](_0x86c5('0x9'),attributes,{'tableName':_0x86c5('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 7763d3d..e740daa 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 _0x75d4=['then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x75d4,0x9c));var _0x475d=function(_0x11f083,_0x22e49c){_0x11f083=_0x11f083-0x0;var _0x1f9f88=_0x75d4[_0x11f083];return _0x1f9f88;};'use strict';var _=require(_0x475d('0x0'));var util=require(_0x475d('0x1'));var moment=require(_0x475d('0x2'));var BPromise=require(_0x475d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x475d('0x4'))['db'];var utils=require(_0x475d('0x5'));var logger=require(_0x475d('0x6'))(_0x475d('0x7'));var config=require('../../config/environment');var jayson=require(_0x475d('0x8'));var client=jayson[_0x475d('0x9')][_0x475d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575526,_0x261832,_0x579320){return new BPromise(function(_0x4711de,_0x3b31dc){return client[_0x475d('0xb')](_0x575526,_0x579320)[_0x475d('0xc')](function(_0x27e269){logger[_0x475d('0xd')](_0x475d('0xe'),_0x261832,_0x475d('0xf'));logger['debug'](_0x475d('0x10'),_0x261832,_0x475d('0xf'),JSON['stringify'](_0x27e269));if(_0x27e269[_0x475d('0x11')]){if(_0x27e269[_0x475d('0x11')][_0x475d('0x12')]===0x1f4){logger[_0x475d('0x11')](_0x475d('0xe'),_0x261832,_0x27e269[_0x475d('0x11')]['message']);return _0x3b31dc(_0x27e269[_0x475d('0x11')]['message']);}logger['error'](_0x475d('0xe'),_0x261832,_0x27e269['error']['message']);return _0x4711de(_0x27e269[_0x475d('0x11')][_0x475d('0x13')]);}else{logger[_0x475d('0xd')](_0x475d('0xe'),_0x261832,_0x475d('0xf'));_0x4711de(_0x27e269[_0x475d('0x14')][_0x475d('0x13')]);}})['catch'](function(_0x4189ba){logger[_0x475d('0x11')](_0x475d('0xe'),_0x261832,_0x4189ba);_0x3b31dc(_0x4189ba);});});} \ No newline at end of file +var _0x6fc3=['Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x40800c,_0x3a3f45){var _0x3761f7=function(_0x3209b0){while(--_0x3209b0){_0x40800c['push'](_0x40800c['shift']());}};_0x3761f7(++_0x3a3f45);}(_0x6fc3,0x1cc));var _0x36fc=function(_0x1a0370,_0x123eb6){_0x1a0370=_0x1a0370-0x0;var _0x54b437=_0x6fc3[_0x1a0370];return _0x54b437;};'use strict';var _=require(_0x36fc('0x0'));var util=require(_0x36fc('0x1'));var moment=require(_0x36fc('0x2'));var BPromise=require(_0x36fc('0x3'));var rs=require(_0x36fc('0x4'));var fs=require('fs');var Redis=require(_0x36fc('0x5'));var db=require(_0x36fc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x36fc('0x7'))(_0x36fc('0x8'));var config=require(_0x36fc('0x9'));var jayson=require(_0x36fc('0xa'));var client=jayson[_0x36fc('0xb')][_0x36fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x365edc,_0xf3b22b,_0x61488){return new BPromise(function(_0x5d0811,_0x20ad34){return client['request'](_0x365edc,_0x61488)[_0x36fc('0xd')](function(_0xf9058f){logger[_0x36fc('0xe')]('Automation,\x20%s,\x20%s',_0xf3b22b,'request\x20sent');logger[_0x36fc('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0xf3b22b,_0x36fc('0x10'),JSON[_0x36fc('0x11')](_0xf9058f));if(_0xf9058f['error']){if(_0xf9058f[_0x36fc('0x12')][_0x36fc('0x13')]===0x1f4){logger[_0x36fc('0x12')](_0x36fc('0x14'),_0xf3b22b,_0xf9058f['error'][_0x36fc('0x15')]);return _0x20ad34(_0xf9058f['error'][_0x36fc('0x15')]);}logger[_0x36fc('0x12')]('Automation,\x20%s,\x20%s',_0xf3b22b,_0xf9058f[_0x36fc('0x12')][_0x36fc('0x15')]);return _0x5d0811(_0xf9058f[_0x36fc('0x12')][_0x36fc('0x15')]);}else{logger[_0x36fc('0xe')](_0x36fc('0x14'),_0xf3b22b,'request\x20sent');_0x5d0811(_0xf9058f[_0x36fc('0x16')][_0x36fc('0x15')]);}})[_0x36fc('0x17')](function(_0x17344a){logger[_0x36fc('0x12')](_0x36fc('0x14'),_0xf3b22b,_0x17344a);_0x20ad34(_0x17344a);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a59aa75..80fdc2c 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 _0xa9bf=['./automation.controller','isAuthenticated','index','get','/:id/conditions','getConditions','getActions','create','post','addActions','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9bf,0x8d));var _0xfa9b=function(_0x4c6c46,_0x4d5b50){_0x4c6c46=_0x4c6c46-0x0;var _0x4eca5e=_0xa9bf[_0x4c6c46];return _0x4eca5e;};'use strict';var multer=require(_0xfa9b('0x0'));var util=require('util');var path=require(_0xfa9b('0x1'));var timeout=require(_0xfa9b('0x2'));var express=require(_0xfa9b('0x3'));var router=express[_0xfa9b('0x4')]();var auth=require(_0xfa9b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa9b('0x6'));router['get']('/',auth[_0xfa9b('0x7')](),controller[_0xfa9b('0x8')]);router[_0xfa9b('0x9')]('/:id',auth[_0xfa9b('0x7')](),controller['show']);router[_0xfa9b('0x9')](_0xfa9b('0xa'),auth[_0xfa9b('0x7')](),controller[_0xfa9b('0xb')]);router['get']('/:id/actions',auth[_0xfa9b('0x7')](),controller[_0xfa9b('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfa9b('0xd')]);router[_0xfa9b('0xe')](_0xfa9b('0xa'),auth['isAuthenticated'](),controller['addConditions']);router[_0xfa9b('0xe')]('/:id/actions',auth[_0xfa9b('0x7')](),controller[_0xfa9b('0xf')]);router[_0xfa9b('0x10')](_0xfa9b('0x11'),auth[_0xfa9b('0x7')](),controller[_0xfa9b('0x12')]);router[_0xfa9b('0x13')](_0xfa9b('0x11'),auth[_0xfa9b('0x7')](),controller[_0xfa9b('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf1d6=['/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xf1d6,0x135));var _0x6f1d=function(_0x4d69be,_0x1174bf){_0x4d69be=_0x4d69be-0x0;var _0xaa62b3=_0xf1d6[_0x4d69be];return _0xaa62b3;};'use strict';var multer=require(_0x6f1d('0x0'));var util=require(_0x6f1d('0x1'));var path=require(_0x6f1d('0x2'));var timeout=require(_0x6f1d('0x3'));var express=require(_0x6f1d('0x4'));var router=express[_0x6f1d('0x5')]();var auth=require(_0x6f1d('0x6'));var interaction=require(_0x6f1d('0x7'));var config=require(_0x6f1d('0x8'));var controller=require(_0x6f1d('0x9'));router[_0x6f1d('0xa')]('/',auth[_0x6f1d('0xb')](),controller['index']);router[_0x6f1d('0xa')](_0x6f1d('0xc'),auth[_0x6f1d('0xb')](),controller['show']);router['get'](_0x6f1d('0xd'),auth['isAuthenticated'](),controller[_0x6f1d('0xe')]);router[_0x6f1d('0xa')](_0x6f1d('0xf'),auth[_0x6f1d('0xb')](),controller['getActions']);router[_0x6f1d('0x10')]('/',auth['isAuthenticated'](),controller[_0x6f1d('0x11')]);router[_0x6f1d('0x10')](_0x6f1d('0xd'),auth[_0x6f1d('0xb')](),controller['addConditions']);router[_0x6f1d('0x10')]('/:id/actions',auth[_0x6f1d('0xb')](),controller[_0x6f1d('0x12')]);router[_0x6f1d('0x13')](_0x6f1d('0xc'),auth['isAuthenticated'](),controller[_0x6f1d('0x14')]);router[_0x6f1d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6f1d('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b85b556..c45e40e 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 _0xbd6e=['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)','ENUM','never','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xbd6e,0xa3));var _0xebd6=function(_0x278f43,_0x1a4f88){_0x278f43=_0x278f43-0x0;var _0x1bbde1=_0xbd6e[_0x278f43];return _0x1bbde1;};'use strict';var Sequelize=require(_0xebd6('0x0'));module[_0xebd6('0x1')]={'name':{'type':Sequelize[_0xebd6('0x2')],'unique':_0xebd6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xebd6('0x4')),'allowNull':![],'defaultValue':_0xebd6('0x4')},'description':{'type':Sequelize[_0xebd6('0x2')]},'active':{'type':Sequelize[_0xebd6('0x5')],'defaultValue':0x0,'comment':_0xebd6('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xebd6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xebd6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xebd6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xebd6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xebd6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'comment':_0xebd6('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xebd6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xebd6('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xebd6('0xf')]('always',_0xebd6('0x10'),'onlyIfOpen'),'defaultValue':_0xebd6('0x11')},'dialAMDActive':{'type':Sequelize[_0xebd6('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xebd6('0xa')](0x9)[_0xebd6('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xebd6('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xebd6('0xa')](0x9)[_0xebd6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xebd6('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xebd6('0xa')](0x9)[_0xebd6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xebd6('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xebd6('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xebd6('0xa')](0x9)[_0xebd6('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xebd6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xebd6('0xa')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xebd6('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xebd6('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xebd6('0xa')](0x9)[_0xebd6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xebd6('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xebd6('0xf')](_0xebd6('0x18'),_0xebd6('0x19')),'defaultValue':_0xebd6('0x18')},'dialPrefix':{'type':Sequelize[_0xebd6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xebd6('0x1a')},'dialCutDigit':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xebd6('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)[_0xebd6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xebd6('0xa')](0x3)[_0xebd6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xebd6('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xebd6('0x22')}}; \ No newline at end of file +var _0xed51=['always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4fc702,_0x590060){var _0x1357d3=function(_0x45a119){while(--_0x45a119){_0x4fc702['push'](_0x4fc702['shift']());}};_0x1357d3(++_0x590060);}(_0xed51,0x137));var _0x1ed5=function(_0x53416b,_0x206ea6){_0x53416b=_0x53416b-0x0;var _0x3b24ce=_0xed51[_0x53416b];return _0x3b24ce;};'use strict';var Sequelize=require('sequelize');module[_0x1ed5('0x0')]={'name':{'type':Sequelize[_0x1ed5('0x1')],'unique':_0x1ed5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1ed5('0x3')](_0x1ed5('0x4')),'allowNull':![],'defaultValue':_0x1ed5('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1ed5('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1ed5('0x6')](0x4)[_0x1ed5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1ed5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1ed5('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1ed5('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1ed5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1ed5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1ed5('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1ed5('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1ed5('0x3')](_0x1ed5('0x11'),_0x1ed5('0x12'),_0x1ed5('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1ed5('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1ed5('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1ed5('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1ed5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ed5('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1ed5('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1ed5('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1ed5('0x6')](0x9)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1ed5('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1ed5('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1ed5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ed5('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1ed5('0x1d'),_0x1ed5('0x1e')),'defaultValue':_0x1ed5('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1ed5('0x1f')},'dialCutDigit':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1ed5('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0x24')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1ed5('0x6')](0x3)[_0x1ed5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ed5('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1ed5('0x6')](0x5)[_0x1ed5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ed5('0x28')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 895f291..9b30574 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 _0x7906=['phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','addBlackLists','push','removeBlackLists','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','rawAttributes','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','error','clone','params','omit','updatedAt','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','hasOwnProperty','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery'];(function(_0x3cad98,_0x3a6539){var _0x53f43c=function(_0x44ff9c){while(--_0x44ff9c){_0x3cad98['push'](_0x3cad98['shift']());}};_0x53f43c(++_0x3a6539);}(_0x7906,0x90));var _0x6790=function(_0x264e92,_0x3bd031){_0x264e92=_0x264e92-0x0;var _0x4a5a54=_0x7906[_0x264e92];return _0x4a5a54;};'use strict';var pdf=require(_0x6790('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6790('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6790('0x2'));var rp=require(_0x6790('0x3'));var moment=require(_0x6790('0x4'));var BPromise=require(_0x6790('0x5'));var Mustache=require(_0x6790('0x6'));var util=require(_0x6790('0x7'));var path=require(_0x6790('0x8'));var sox=require(_0x6790('0x9'));var csv=require('to-csv');var ejs=require(_0x6790('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6790('0xb'));var deskjs=require(_0x6790('0xc'));var toCsv=require(_0x6790('0xd'));var querystring=require('querystring');var Papa=require(_0x6790('0xe'));var Redis=require(_0x6790('0xf'));var authService=require(_0x6790('0x10'));var qs=require(_0x6790('0x11'));var as=require(_0x6790('0x12'));var hardwareService=require(_0x6790('0x13'));var logger=require('../../config/logger')(_0x6790('0x14'));var utils=require(_0x6790('0x15'));var config=require(_0x6790('0x16'));var db=require(_0x6790('0x17'))['db'];function respondWithStatusCode(_0x447e63,_0x53249d){_0x53249d=_0x53249d||0xcc;return function(_0x2a48b5){if(_0x2a48b5){return _0x447e63[_0x6790('0x18')](_0x53249d);}return _0x447e63[_0x6790('0x19')](_0x53249d)[_0x6790('0x1a')]();};}function respondWithResult(_0x13c30a,_0x2b71ac){_0x2b71ac=_0x2b71ac||0xc8;return function(_0x30e6c4){if(_0x30e6c4){return _0x13c30a[_0x6790('0x19')](_0x2b71ac)['json'](_0x30e6c4);}};}function respondWithFilteredResult(_0x1271fc,_0x136c63){return function(_0x39d9ed){if(_0x39d9ed){var _0x1d48e2=_0x39d9ed[_0x6790('0x1b')],_0x59e388=_0x136c63['offset'],_0x2cf674=_0x136c63['offset']+_0x136c63['limit'],_0x34c35b;if(_0x2cf674>=_0x1d48e2){_0x2cf674=_0x1d48e2;_0x34c35b=0xc8;}else{_0x34c35b=0xce;}_0x1271fc[_0x6790('0x19')](_0x34c35b);return _0x1271fc[_0x6790('0x1c')](_0x6790('0x1d'),_0x59e388+'-'+_0x2cf674+'/'+_0x1d48e2)['json'](_0x39d9ed);}return null;};}function patchUpdates(_0x43b148){return function(_0x4ac478){try{jsonpatch['apply'](_0x4ac478,_0x43b148,!![]);}catch(_0x2ac7ef){return BPromise[_0x6790('0x1e')](_0x2ac7ef);}return _0x4ac478[_0x6790('0x1f')]();};}function saveUpdates(_0x3e9263,_0x5229a8){return function(_0xf00853){if(_0xf00853){return _0xf00853[_0x6790('0x20')](_0x3e9263)[_0x6790('0x21')](function(_0x2f0bd3){return _0x2f0bd3;});}return null;};}function removeEntity(_0x187599,_0x27e9e6){return function(_0x47f512){if(_0x47f512){return _0x47f512[_0x6790('0x22')]()[_0x6790('0x21')](function(){var _0x3869b0=_0x47f512['get']({'plain':!![]});var _0x41de1f='IvrCampaigns';return db[_0x6790('0x23')][_0x6790('0x22')]({'where':{'type':_0x41de1f,'resourceId':_0x3869b0['id']}})['then'](function(){return _0x47f512;});})[_0x6790('0x21')](function(){_0x187599['status'](0xcc)[_0x6790('0x1a')]();});}};}function handleEntityNotFound(_0x2e4125,_0x1615e7){return function(_0x74c186){if(!_0x74c186){_0x2e4125['sendStatus'](0x194);}return _0x74c186;};}function handleError(_0x16cc76,_0x4f49b2){_0x4f49b2=_0x4f49b2||0x1f4;return function(_0x637ec5){logger['error'](_0x637ec5[_0x6790('0x24')]);if(_0x637ec5['name']){delete _0x637ec5[_0x6790('0x25')];}_0x16cc76[_0x6790('0x19')](_0x4f49b2)[_0x6790('0x26')](_0x637ec5);};}exports[_0x6790('0x27')]=function(_0x2c7715,_0x2fe675){var _0x2eed33={},_0x350cfb={},_0x5e361f={'count':0x0,'rows':[]};var _0xee51b1=_[_0x6790('0x28')](db[_0x6790('0x29')]['rawAttributes'],function(_0x396a1a){return{'name':_0x396a1a[_0x6790('0x2a')],'type':_0x396a1a[_0x6790('0x2b')][_0x6790('0x2c')]};});_0x350cfb[_0x6790('0x2d')]=_['map'](_0xee51b1,_0x6790('0x25'));_0x350cfb[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x2c7715[_0x6790('0x2e')]);_0x350cfb[_0x6790('0x30')]=_[_0x6790('0x31')](_0x350cfb[_0x6790('0x2d')],_0x350cfb[_0x6790('0x2e')]);_0x2eed33[_0x6790('0x32')]=_['intersection'](_0x350cfb[_0x6790('0x2d')],qs['fields'](_0x2c7715[_0x6790('0x2e')][_0x6790('0x33')]));_0x2eed33[_0x6790('0x32')]=_0x2eed33['attributes'][_0x6790('0x34')]?_0x2eed33[_0x6790('0x32')]:_0x350cfb[_0x6790('0x2d')];if(!_0x2c7715[_0x6790('0x2e')]['hasOwnProperty'](_0x6790('0x35'))){_0x2eed33[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x2c7715[_0x6790('0x2e')][_0x6790('0x36')]);_0x2eed33[_0x6790('0x37')]=qs[_0x6790('0x37')](_0x2c7715[_0x6790('0x2e')]['offset']);}_0x2eed33[_0x6790('0x38')]=qs[_0x6790('0x39')](_0x2c7715[_0x6790('0x2e')][_0x6790('0x39')]);_0x2eed33[_0x6790('0x3a')]=qs['filters'](_[_0x6790('0x3b')](_0x2c7715[_0x6790('0x2e')],_0x350cfb[_0x6790('0x30')]),_0xee51b1);if(_0x2c7715[_0x6790('0x2e')][_0x6790('0x3c')]){_0x2eed33[_0x6790('0x3a')]=_[_0x6790('0x3d')](_0x2eed33[_0x6790('0x3a')],{'$or':_['map'](_0xee51b1,function(_0x1c8e8a){if(_0x1c8e8a['type']!==_0x6790('0x3e')){var _0x1650c7={};_0x1650c7[_0x1c8e8a['name']]={'$like':'%'+_0x2c7715[_0x6790('0x2e')]['filter']+'%'};return _0x1650c7;}})});}_0x2eed33=_[_0x6790('0x3d')]({},_0x2eed33,_0x2c7715['options']);var _0x95d820={'where':_0x2eed33[_0x6790('0x3a')]};return db['Campaign']['count'](_0x95d820)['then'](function(_0x3cc50d){_0x5e361f[_0x6790('0x1b')]=_0x3cc50d;if(_0x2c7715[_0x6790('0x2e')][_0x6790('0x3f')]){_0x2eed33[_0x6790('0x40')]=[{'all':!![]}];}return db[_0x6790('0x29')]['findAll'](_0x2eed33);})[_0x6790('0x21')](function(_0x4b1ea4){_0x5e361f[_0x6790('0x41')]=_0x4b1ea4;return _0x5e361f;})['then'](respondWithFilteredResult(_0x2fe675,_0x2eed33))[_0x6790('0x42')](handleError(_0x2fe675,null));};exports[_0x6790('0x43')]=function(_0x1f7744,_0x57ce8b){var _0x1e524f={'raw':![],'where':{'id':_0x1f7744['params']['id']}},_0x459a2e={};_0x459a2e[_0x6790('0x2d')]=_[_0x6790('0x2f')](db[_0x6790('0x29')][_0x6790('0x44')]);_0x459a2e[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x1f7744[_0x6790('0x2e')]);_0x459a2e[_0x6790('0x30')]=_[_0x6790('0x31')](_0x459a2e[_0x6790('0x2d')],_0x459a2e['query']);_0x1e524f['attributes']=_[_0x6790('0x31')](_0x459a2e[_0x6790('0x2d')],qs[_0x6790('0x33')](_0x1f7744['query']['fields']));_0x1e524f[_0x6790('0x32')]=_0x1e524f['attributes'][_0x6790('0x34')]?_0x1e524f[_0x6790('0x32')]:_0x459a2e[_0x6790('0x2d')];if(_0x1f7744['query'][_0x6790('0x3f')]){_0x1e524f[_0x6790('0x40')]=[{'all':!![]}];}_0x1e524f=_[_0x6790('0x3d')]({},_0x1e524f,_0x1f7744[_0x6790('0x45')]);return db[_0x6790('0x29')]['find'](_0x1e524f)[_0x6790('0x21')](handleEntityNotFound(_0x57ce8b,null))[_0x6790('0x21')](respondWithResult(_0x57ce8b,null))['catch'](handleError(_0x57ce8b,null));};exports[_0x6790('0x46')]=function(_0x402207,_0x338b24){return db[_0x6790('0x29')][_0x6790('0x46')](_0x402207[_0x6790('0x47')],{})[_0x6790('0x21')](function(_0x3683d1){var _0x5ea41b=_0x402207['user'][_0x6790('0x48')]({'plain':!![]});if(!_0x5ea41b)throw new Error(_0x6790('0x49'));if(_0x5ea41b[_0x6790('0x4a')]===_0x6790('0x4b')){var _0x5b309d=_0x3683d1[_0x6790('0x48')]({'plain':!![]});var _0xcc851f=_0x6790('0x4c');return db[_0x6790('0x4d')][_0x6790('0x4e')]({'where':{'name':_0xcc851f,'userProfileId':_0x5ea41b[_0x6790('0x4f')]},'raw':!![]})['then'](function(_0x3c1635){if(_0x3c1635&&_0x3c1635[_0x6790('0x50')]===0x0){return db[_0x6790('0x23')]['create']({'name':_0x5b309d['name'],'resourceId':_0x5b309d['id'],'type':_0x3c1635[_0x6790('0x25')],'sectionId':_0x3c1635['id']},{})['then'](function(){return _0x3683d1;});}else{return _0x3683d1;}})[_0x6790('0x42')](function(_0x35d8e0){logger[_0x6790('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35d8e0);throw _0x35d8e0;});}return _0x3683d1;})[_0x6790('0x21')](respondWithResult(_0x338b24,0xc9))['catch'](handleError(_0x338b24,null));};exports[_0x6790('0x52')]=function(_0x5bba8e,_0x386793){var _0x3a7644={'where':{'id':_0x5bba8e[_0x6790('0x53')]['id']}},_0x5c76fc={};_0x5c76fc[_0x6790('0x2d')]=_[_0x6790('0x2f')](db[_0x6790('0x29')][_0x6790('0x44')]);_0x3a7644[_0x6790('0x32')]=_[_0x6790('0x31')](_0x5c76fc[_0x6790('0x2d')],qs['fields'](_0x5bba8e[_0x6790('0x2e')][_0x6790('0x33')]));_0x3a7644['attributes']=_0x3a7644['attributes'][_0x6790('0x34')]?_0x3a7644[_0x6790('0x32')]:_0x5c76fc[_0x6790('0x2d')];if(_0x5bba8e['query'][_0x6790('0x3f')]){_0x3a7644[_0x6790('0x40')]=[{'all':!![]}];}_0x3a7644=_[_0x6790('0x3d')]({},_0x3a7644,_0x5bba8e[_0x6790('0x45')]);return db['Campaign']['find'](_0x3a7644)[_0x6790('0x21')](handleEntityNotFound(_0x386793,null))['then'](function(_0x3f86a3){if(_0x3f86a3){var _0x176e6f=_0x3f86a3[_0x6790('0x48')]({'plain':!![]});_0x176e6f=qs[_0x6790('0x54')](_0x176e6f,['id','createdAt',_0x6790('0x55')]);_0x5bba8e['body']=_[_0x6790('0x54')](_0x5bba8e[_0x6790('0x47')],['id',_0x6790('0x56'),'updatedAt']);return db[_0x6790('0x29')][_0x6790('0x46')](_['merge'](_0x176e6f,_0x5bba8e['body']),{'include':_0x5bba8e[_0x6790('0x2e')][_0x6790('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x5bd9a1){var _0x7b84b9=_0x5bba8e[_0x6790('0x4b')][_0x6790('0x48')]({'plain':!![]});if(!_0x7b84b9)throw new Error(_0x6790('0x49'));if(_0x7b84b9[_0x6790('0x4a')]===_0x6790('0x4b')){var _0x52a76e=_0x5bd9a1[_0x6790('0x48')]({'plain':!![]});var _0x5c6adf=_0x6790('0x4c');return db['UserProfileSection'][_0x6790('0x4e')]({'where':{'name':_0x5c6adf,'userProfileId':_0x7b84b9[_0x6790('0x4f')]},'raw':!![]})['then'](function(_0x4362ed){if(_0x4362ed&&_0x4362ed[_0x6790('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x52a76e[_0x6790('0x25')],'resourceId':_0x52a76e['id'],'type':_0x4362ed[_0x6790('0x25')],'sectionId':_0x4362ed['id']},{})['then'](function(){return _0x5bd9a1;});}else{return _0x5bd9a1;}})[_0x6790('0x42')](function(_0x3ccf66){logger[_0x6790('0x51')](_0x6790('0x57'),_0x3ccf66);throw _0x3ccf66;});}return _0x5bd9a1;});}})['then'](respondWithResult(_0x386793,0xc9))['catch'](handleError(_0x386793,null));};exports[_0x6790('0x20')]=function(_0x5377bc,_0xc66b08){if(_0x5377bc[_0x6790('0x47')]['id']){delete _0x5377bc['body']['id'];}return db['Campaign'][_0x6790('0x4e')]({'where':{'id':_0x5377bc[_0x6790('0x53')]['id']}})['then'](handleEntityNotFound(_0xc66b08,null))['then'](saveUpdates(_0x5377bc[_0x6790('0x47')],null))[_0x6790('0x21')](respondWithResult(_0xc66b08,null))[_0x6790('0x42')](handleError(_0xc66b08,null));};exports['destroy']=function(_0x757657,_0x4e4de7){return db[_0x6790('0x29')]['find']({'where':{'id':_0x757657[_0x6790('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e4de7,null))['then'](removeEntity(_0x4e4de7,null))[_0x6790('0x42')](handleError(_0x4e4de7,null));};exports['getHoppers']=function(_0x25f03d,_0x78c952,_0x43b41e){var _0x59ecba={'raw':!![],'where':{}};var _0x189cd7={};var _0x412232={'count':0x0,'rows':[]};return db['Campaign'][_0x6790('0x58')]({'where':{'id':_0x25f03d[_0x6790('0x53')]['id']}})['then'](handleEntityNotFound(_0x78c952,null))[_0x6790('0x21')](function(_0x20ef0d){if(_0x20ef0d){_0x189cd7[_0x6790('0x2d')]=_[_0x6790('0x2f')](db[_0x6790('0x59')][_0x6790('0x44')]);_0x189cd7[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x25f03d[_0x6790('0x2e')]);_0x189cd7['filters']=_[_0x6790('0x31')](_0x189cd7[_0x6790('0x2d')],_0x189cd7[_0x6790('0x2e')]);_0x59ecba[_0x6790('0x32')]=_[_0x6790('0x31')](_0x189cd7['model'],qs[_0x6790('0x33')](_0x25f03d[_0x6790('0x2e')][_0x6790('0x33')]));_0x59ecba[_0x6790('0x32')]=_0x59ecba['attributes'][_0x6790('0x34')]?_0x59ecba[_0x6790('0x32')]:_0x189cd7[_0x6790('0x2d')];if(!_0x25f03d[_0x6790('0x2e')][_0x6790('0x5a')](_0x6790('0x35'))){_0x59ecba[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x25f03d[_0x6790('0x2e')][_0x6790('0x36')]);_0x59ecba[_0x6790('0x37')]=qs['offset'](_0x25f03d[_0x6790('0x2e')][_0x6790('0x37')]);}_0x59ecba[_0x6790('0x38')]=qs['sort'](_0x25f03d['query'][_0x6790('0x39')]);_0x59ecba['where']=qs[_0x6790('0x30')](_['pick'](_0x25f03d[_0x6790('0x2e')],_0x189cd7[_0x6790('0x30')]));_0x59ecba['where'][_0x6790('0x5b')]=_0x20ef0d['id'];if(_0x25f03d['query']['filter']){_0x59ecba[_0x6790('0x3a')]=_[_0x6790('0x3d')](_0x59ecba[_0x6790('0x3a')],{'$or':_[_0x6790('0x28')](_0x59ecba[_0x6790('0x32')],function(_0x119d4b){var _0x55d856={};_0x55d856[_0x119d4b]={'$like':'%'+_0x25f03d[_0x6790('0x2e')]['filter']+'%'};return _0x55d856;})});}_0x59ecba=_[_0x6790('0x3d')]({},_0x59ecba,_0x25f03d['options']);return db['CmHopper'][_0x6790('0x1b')]({'where':_0x59ecba['where']})[_0x6790('0x21')](function(_0x4cc82b){_0x412232[_0x6790('0x1b')]=_0x4cc82b;if(_0x25f03d[_0x6790('0x2e')]['includeAll']){_0x59ecba[_0x6790('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x6790('0x5c')](_0x59ecba);})[_0x6790('0x21')](function(_0x2d1c48){_0x412232[_0x6790('0x41')]=_0x2d1c48;return _0x412232;});}})[_0x6790('0x21')](respondWithFilteredResult(_0x78c952,_0x59ecba))[_0x6790('0x42')](handleError(_0x78c952,null));};exports[_0x6790('0x5d')]=function(_0x258e1c,_0x21e0c2,_0x5b42f0){var _0x3dabdf={'raw':!![],'where':{}};var _0x41a139={};var _0x2778d1={'count':0x0,'rows':[]};return db[_0x6790('0x29')][_0x6790('0x58')]({'where':{'id':_0x258e1c[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x21e0c2,null))['then'](function(_0x10eb69){if(_0x10eb69){_0x41a139[_0x6790('0x2d')]=_[_0x6790('0x2f')](db[_0x6790('0x5e')]['rawAttributes']);_0x41a139[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x258e1c[_0x6790('0x2e')]);_0x41a139[_0x6790('0x30')]=_[_0x6790('0x31')](_0x41a139[_0x6790('0x2d')],_0x41a139['query']);_0x3dabdf[_0x6790('0x32')]=_[_0x6790('0x31')](_0x41a139[_0x6790('0x2d')],qs['fields'](_0x258e1c[_0x6790('0x2e')][_0x6790('0x33')]));_0x3dabdf[_0x6790('0x32')]=_0x3dabdf[_0x6790('0x32')][_0x6790('0x34')]?_0x3dabdf[_0x6790('0x32')]:_0x41a139[_0x6790('0x2d')];if(!_0x258e1c[_0x6790('0x2e')][_0x6790('0x5a')]('nolimit')){_0x3dabdf[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x258e1c[_0x6790('0x2e')][_0x6790('0x36')]);_0x3dabdf['offset']=qs[_0x6790('0x37')](_0x258e1c[_0x6790('0x2e')]['offset']);}_0x3dabdf[_0x6790('0x38')]=qs['sort'](_0x258e1c[_0x6790('0x2e')]['sort']);_0x3dabdf[_0x6790('0x3a')]=qs[_0x6790('0x30')](_['pick'](_0x258e1c['query'],_0x41a139[_0x6790('0x30')]));_0x3dabdf[_0x6790('0x3a')][_0x6790('0x5b')]=_0x10eb69['id'];if(_0x258e1c[_0x6790('0x2e')][_0x6790('0x3c')]){_0x3dabdf[_0x6790('0x3a')]=_[_0x6790('0x3d')](_0x3dabdf['where'],{'$or':_[_0x6790('0x28')](_0x3dabdf[_0x6790('0x32')],function(_0x1d55c3){var _0x2caf26={};_0x2caf26[_0x1d55c3]={'$like':'%'+_0x258e1c[_0x6790('0x2e')][_0x6790('0x3c')]+'%'};return _0x2caf26;})});}_0x3dabdf=_[_0x6790('0x3d')]({},_0x3dabdf,_0x258e1c[_0x6790('0x45')]);return db[_0x6790('0x5e')][_0x6790('0x1b')]({'where':_0x3dabdf[_0x6790('0x3a')]})[_0x6790('0x21')](function(_0x578f86){_0x2778d1[_0x6790('0x1b')]=_0x578f86;if(_0x258e1c[_0x6790('0x2e')]['includeAll']){_0x3dabdf[_0x6790('0x40')]=[{'all':!![]}];}return db[_0x6790('0x5e')]['findAll'](_0x3dabdf);})['then'](function(_0x37c0b9){_0x2778d1[_0x6790('0x41')]=_0x37c0b9;return _0x2778d1;});}})[_0x6790('0x21')](respondWithFilteredResult(_0x21e0c2,_0x3dabdf))[_0x6790('0x42')](handleError(_0x21e0c2,null));};exports[_0x6790('0x5f')]=function(_0x3c91eb,_0x415234,_0x686e24){var _0x265a9b={'raw':!![],'where':{}};var _0x2145da={};var _0x386056={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c91eb[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x415234,null))[_0x6790('0x21')](function(_0x1fb73a){if(_0x1fb73a){_0x2145da[_0x6790('0x2d')]=_['keys'](db['CmHopperFinal'][_0x6790('0x44')]);_0x2145da[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x3c91eb[_0x6790('0x2e')]);_0x2145da[_0x6790('0x30')]=_[_0x6790('0x31')](_0x2145da[_0x6790('0x2d')],_0x2145da[_0x6790('0x2e')]);_0x265a9b[_0x6790('0x32')]=_[_0x6790('0x31')](_0x2145da[_0x6790('0x2d')],qs['fields'](_0x3c91eb[_0x6790('0x2e')][_0x6790('0x33')]));_0x265a9b[_0x6790('0x32')]=_0x265a9b[_0x6790('0x32')]['length']?_0x265a9b[_0x6790('0x32')]:_0x2145da[_0x6790('0x2d')];if(!_0x3c91eb['query']['hasOwnProperty']('nolimit')){_0x265a9b[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x3c91eb[_0x6790('0x2e')][_0x6790('0x36')]);_0x265a9b['offset']=qs[_0x6790('0x37')](_0x3c91eb[_0x6790('0x2e')][_0x6790('0x37')]);}_0x265a9b[_0x6790('0x38')]=qs['sort'](_0x3c91eb[_0x6790('0x2e')]['sort']);_0x265a9b[_0x6790('0x3a')]=qs[_0x6790('0x30')](_[_0x6790('0x3b')](_0x3c91eb[_0x6790('0x2e')],_0x2145da[_0x6790('0x30')]));_0x265a9b[_0x6790('0x3a')]['CampaignId']=_0x1fb73a['id'];if(_0x3c91eb[_0x6790('0x2e')][_0x6790('0x3c')]){_0x265a9b['where']=_[_0x6790('0x3d')](_0x265a9b['where'],{'$or':_[_0x6790('0x28')](_0x265a9b[_0x6790('0x32')],function(_0xa7a09a){var _0x2b3bf8={};_0x2b3bf8[_0xa7a09a]={'$like':'%'+_0x3c91eb['query'][_0x6790('0x3c')]+'%'};return _0x2b3bf8;})});}_0x265a9b=_[_0x6790('0x3d')]({},_0x265a9b,_0x3c91eb[_0x6790('0x45')]);return db[_0x6790('0x60')][_0x6790('0x1b')]({'where':_0x265a9b[_0x6790('0x3a')]})[_0x6790('0x21')](function(_0x26e36a){_0x386056[_0x6790('0x1b')]=_0x26e36a;if(_0x3c91eb[_0x6790('0x2e')][_0x6790('0x3f')]){_0x265a9b[_0x6790('0x40')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x265a9b);})[_0x6790('0x21')](function(_0x561153){_0x386056[_0x6790('0x41')]=_0x561153;return _0x386056;});}})[_0x6790('0x21')](respondWithFilteredResult(_0x415234,_0x265a9b))[_0x6790('0x42')](handleError(_0x415234,null));};exports['getHopperBlacks']=function(_0x3fd29d,_0x33bc7a,_0x14afda){var _0x48d7e6={'raw':!![],'where':{}};var _0x5d73f8={};var _0x279712={'count':0x0,'rows':[]};return db[_0x6790('0x29')][_0x6790('0x58')]({'where':{'id':_0x3fd29d[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x33bc7a,null))['then'](function(_0x235e29){if(_0x235e29){_0x5d73f8[_0x6790('0x2d')]=_['keys'](db[_0x6790('0x61')]['rawAttributes']);_0x5d73f8[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x3fd29d[_0x6790('0x2e')]);_0x5d73f8[_0x6790('0x30')]=_['intersection'](_0x5d73f8[_0x6790('0x2d')],_0x5d73f8[_0x6790('0x2e')]);_0x48d7e6['attributes']=_[_0x6790('0x31')](_0x5d73f8[_0x6790('0x2d')],qs[_0x6790('0x33')](_0x3fd29d[_0x6790('0x2e')][_0x6790('0x33')]));_0x48d7e6[_0x6790('0x32')]=_0x48d7e6[_0x6790('0x32')][_0x6790('0x34')]?_0x48d7e6[_0x6790('0x32')]:_0x5d73f8['model'];if(!_0x3fd29d[_0x6790('0x2e')]['hasOwnProperty']('nolimit')){_0x48d7e6[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x3fd29d[_0x6790('0x2e')]['limit']);_0x48d7e6['offset']=qs[_0x6790('0x37')](_0x3fd29d[_0x6790('0x2e')][_0x6790('0x37')]);}_0x48d7e6[_0x6790('0x38')]=qs['sort'](_0x3fd29d['query'][_0x6790('0x39')]);_0x48d7e6['where']=qs[_0x6790('0x30')](_['pick'](_0x3fd29d[_0x6790('0x2e')],_0x5d73f8[_0x6790('0x30')]));_0x48d7e6['where']['CampaignId']=_0x235e29['id'];if(_0x3fd29d[_0x6790('0x2e')][_0x6790('0x3c')]){_0x48d7e6['where']=_[_0x6790('0x3d')](_0x48d7e6['where'],{'$or':_[_0x6790('0x28')](_0x48d7e6[_0x6790('0x32')],function(_0x1996fb){var _0x3c0c29={};_0x3c0c29[_0x1996fb]={'$like':'%'+_0x3fd29d['query']['filter']+'%'};return _0x3c0c29;})});}_0x48d7e6=_['merge']({},_0x48d7e6,_0x3fd29d['options']);return db[_0x6790('0x61')]['count']({'where':_0x48d7e6['where']})[_0x6790('0x21')](function(_0x46a192){_0x279712[_0x6790('0x1b')]=_0x46a192;if(_0x3fd29d[_0x6790('0x2e')]['includeAll']){_0x48d7e6[_0x6790('0x40')]=[{'all':!![]}];}return db[_0x6790('0x61')][_0x6790('0x5c')](_0x48d7e6);})[_0x6790('0x21')](function(_0x2a0393){_0x279712[_0x6790('0x41')]=_0x2a0393;return _0x279712;});}})[_0x6790('0x21')](respondWithFilteredResult(_0x33bc7a,_0x48d7e6))[_0x6790('0x42')](handleError(_0x33bc7a,null));};exports['getLists']=function(_0x2b246c,_0x546e94,_0x55edfd){var _0x4b1615={};var _0x38f935={};var _0x3b2119;var _0x497274;return db['Campaign'][_0x6790('0x58')]({'where':{'id':_0x2b246c[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x546e94,null))[_0x6790('0x21')](function(_0x41b08b){if(_0x41b08b){_0x3b2119=_0x41b08b;_0x38f935[_0x6790('0x2d')]=_[_0x6790('0x2f')](db[_0x6790('0x62')]['rawAttributes']);_0x38f935[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x2b246c['query']);_0x38f935[_0x6790('0x30')]=_[_0x6790('0x31')](_0x38f935['model'],_0x38f935[_0x6790('0x2e')]);_0x4b1615[_0x6790('0x32')]=_[_0x6790('0x31')](_0x38f935[_0x6790('0x2d')],qs['fields'](_0x2b246c[_0x6790('0x2e')][_0x6790('0x33')]));_0x4b1615[_0x6790('0x32')]=_0x4b1615[_0x6790('0x32')][_0x6790('0x34')]?_0x4b1615[_0x6790('0x32')]:_0x38f935[_0x6790('0x2d')];_0x4b1615[_0x6790('0x38')]=qs[_0x6790('0x39')](_0x2b246c[_0x6790('0x2e')][_0x6790('0x39')]);_0x4b1615[_0x6790('0x3a')]=qs[_0x6790('0x30')](_[_0x6790('0x3b')](_0x2b246c[_0x6790('0x2e')],_0x38f935[_0x6790('0x30')]));if(_0x2b246c['query'][_0x6790('0x3c')]){_0x4b1615['where']=_[_0x6790('0x3d')](_0x4b1615[_0x6790('0x3a')],{'$or':_['map'](_0x4b1615[_0x6790('0x32')],function(_0x3b90a6){var _0x2d8868={};_0x2d8868[_0x3b90a6]={'$like':'%'+_0x2b246c[_0x6790('0x2e')][_0x6790('0x3c')]+'%'};return _0x2d8868;})});}_0x4b1615=_['merge']({},_0x4b1615,_0x2b246c[_0x6790('0x45')]);return _0x3b2119[_0x6790('0x63')](_0x4b1615);}})[_0x6790('0x21')](function(_0xb7b91a){if(_0xb7b91a){_0x497274=_0xb7b91a[_0x6790('0x34')];if(!_0x2b246c['query'][_0x6790('0x5a')](_0x6790('0x35'))){_0x4b1615[_0x6790('0x36')]=qs[_0x6790('0x36')](_0x2b246c['query'][_0x6790('0x36')]);_0x4b1615['offset']=qs[_0x6790('0x37')](_0x2b246c[_0x6790('0x2e')][_0x6790('0x37')]);}return _0x3b2119[_0x6790('0x63')](_0x4b1615);}})['then'](function(_0x19621a){if(_0x19621a){return _0x19621a?{'count':_0x497274,'rows':_0x19621a}:null;}})[_0x6790('0x21')](respondWithResult(_0x546e94,null))[_0x6790('0x42')](handleError(_0x546e94,null));};exports[_0x6790('0x64')]=function(_0x290eaf,_0x8c9d57,_0xfdf74c){var _0x1e69a4,_0x52ba3d;return db[_0x6790('0x29')][_0x6790('0x4e')]({'where':{'id':_0x290eaf['params']['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x8c9d57,null))[_0x6790('0x21')](function(_0x56613c){if(_0x56613c){_0x52ba3d=_0x56613c;return _0x56613c['addLists'](_0x290eaf[_0x6790('0x47')][_0x6790('0x65')],_[_0x6790('0x54')](_0x290eaf[_0x6790('0x47')],['ids','id'])||{});}return null;})[_0x6790('0x66')](function(_0x9463c0){var _0x27bcf5;_0x1e69a4=_0x9463c0||[];var _0x4f7054=[];if(_0x9463c0){for(var _0x25f201=0x0;_0x25f201<_0x9463c0[_0x6790('0x34')];_0x25f201+=0x1){var _0x59fcde=_0x9463c0[_0x25f201][_0x6790('0x48')]({'plain':!![]});_0x52ba3d['dialCheckDuplicateType']=_0x290eaf[_0x6790('0x47')][_0x6790('0x67')]?_0x290eaf[_0x6790('0x47')]['dialCheckDuplicateType']:_0x52ba3d['dialCheckDuplicateType'];switch(_0x52ba3d['dialCheckDuplicateType']){case'always':_0x27bcf5=squel[_0x6790('0x68')]()['into']('cm_hopper')['fromQuery']([_0x6790('0x69'),_0x6790('0x6a'),_0x6790('0x6b'),_0x6790('0x6c'),_0x6790('0x5b'),'createdAt','updatedAt'],squel[_0x6790('0x6d')]()[_0x6790('0x6e')](_0x6790('0x69'),_0x6790('0x69'))[_0x6790('0x6e')]('NOW()','scheduledAt')[_0x6790('0x6e')]('id',_0x6790('0x6b'))['field'](_0x59fcde[_0x6790('0x6f')][_0x6790('0x70')](),'ListId')['field'](_0x290eaf[_0x6790('0x53')]['id']['toString'](),'CampaignId')[_0x6790('0x6e')]('NOW()',_0x6790('0x56'))[_0x6790('0x6e')](_0x6790('0x71'),_0x6790('0x55'))[_0x6790('0x72')](_0x6790('0x73'))['where'](_0x6790('0x74'))['where'](_0x6790('0x75'),_0x59fcde['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6790('0x3a')](_0x6790('0x76'),squel[_0x6790('0x6d')]()[_0x6790('0x6e')](_0x6790('0x77'))[_0x6790('0x72')](_0x6790('0x78'))[_0x6790('0x3a')]('CampaignId\x20=\x20?',_0x290eaf[_0x6790('0x53')]['id'][_0x6790('0x70')]()))['where'](_0x6790('0x76'),squel[_0x6790('0x6d')]()[_0x6790('0x6e')]('COALESCE(phone,\x27\x27)')['from'](_0x6790('0x79'))[_0x6790('0x3a')](_0x6790('0x7a'),_0x290eaf[_0x6790('0x53')]['id'][_0x6790('0x70')]())))['toString']();break;case _0x6790('0x7b'):_0x27bcf5=squel[_0x6790('0x68')]()[_0x6790('0x7c')](_0x6790('0x79'))[_0x6790('0x7d')]([_0x6790('0x69'),_0x6790('0x6a'),_0x6790('0x6b'),_0x6790('0x6c'),_0x6790('0x5b'),_0x6790('0x56'),_0x6790('0x55')],squel[_0x6790('0x6d')]()[_0x6790('0x6e')](_0x6790('0x69'),_0x6790('0x69'))[_0x6790('0x6e')](_0x6790('0x71'),_0x6790('0x6a'))[_0x6790('0x6e')]('id','ContactId')[_0x6790('0x6e')](_0x59fcde[_0x6790('0x6f')][_0x6790('0x70')](),_0x6790('0x6c'))[_0x6790('0x6e')](_0x290eaf[_0x6790('0x53')]['id'][_0x6790('0x70')](),'CampaignId')[_0x6790('0x6e')](_0x6790('0x71'),_0x6790('0x56'))['field'](_0x6790('0x71'),_0x6790('0x55'))['from'](_0x6790('0x73'))[_0x6790('0x3a')](_0x6790('0x74'))[_0x6790('0x3a')](_0x6790('0x75'),_0x59fcde['CmListId'][_0x6790('0x70')]())[_0x6790('0x3a')](_0x6790('0x7e'))[_0x6790('0x3a')](_0x6790('0x76'),squel[_0x6790('0x6d')]()[_0x6790('0x6e')](_0x6790('0x7f'))[_0x6790('0x72')](_0x6790('0x79'))[_0x6790('0x3a')](_0x6790('0x7a'),_0x290eaf[_0x6790('0x53')]['id'][_0x6790('0x70')]())))[_0x6790('0x70')]();break;default:_0x27bcf5=squel[_0x6790('0x68')]()['into'](_0x6790('0x79'))[_0x6790('0x7d')]([_0x6790('0x69'),_0x6790('0x6a'),_0x6790('0x6b'),'ListId',_0x6790('0x5b'),'createdAt',_0x6790('0x55')],squel[_0x6790('0x6d')]()[_0x6790('0x6e')](_0x6790('0x69'),_0x6790('0x69'))[_0x6790('0x6e')](_0x6790('0x71'),_0x6790('0x6a'))['field']('id',_0x6790('0x6b'))[_0x6790('0x6e')](_0x59fcde[_0x6790('0x6f')][_0x6790('0x70')](),_0x6790('0x6c'))[_0x6790('0x6e')](_0x290eaf[_0x6790('0x53')]['id'][_0x6790('0x70')](),'CampaignId')[_0x6790('0x6e')](_0x6790('0x71'),_0x6790('0x56'))['field'](_0x6790('0x71'),'updatedAt')[_0x6790('0x72')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x6790('0x3a')](_0x6790('0x75'),_0x59fcde['CmListId']['toString']())[_0x6790('0x3a')](_0x6790('0x7e')))[_0x6790('0x70')]();}_0x4f7054['push'](db[_0x6790('0x80')][_0x6790('0x2e')](_0x27bcf5));}return BPromise[_0x6790('0x81')](_0x4f7054);}})[_0x6790('0x21')](function(){return _0x1e69a4;})[_0x6790('0x21')](respondWithResult(_0x8c9d57,null))[_0x6790('0x42')](handleError(_0x8c9d57,null));};exports['removeLists']=function(_0x11b69d,_0x3ec8a2,_0x5af5de){return db['Campaign']['find']({'where':{'id':_0x11b69d[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x3ec8a2,null))[_0x6790('0x21')](function(_0x3eb597){if(_0x3eb597){return _0x3eb597[_0x6790('0x82')](_0x11b69d[_0x6790('0x2e')][_0x6790('0x65')]);}})[_0x6790('0x21')](function(_0x299522){if(_0x299522){return db[_0x6790('0x59')][_0x6790('0x22')]({'where':{'ListId':_0x11b69d[_0x6790('0x2e')]['ids'],'CampaignId':_0x11b69d['params']['id']}})['then'](function(){return _0x299522;});}})[_0x6790('0x21')](respondWithStatusCode(_0x3ec8a2,null))[_0x6790('0x42')](handleError(_0x3ec8a2,null));};exports[_0x6790('0x83')]=function(_0x1c762a,_0x24c8af,_0x5d4cd5){var _0x1e746d={'raw':!![],'where':{}};var _0x33e3f0={};var _0x3c2d3f={'count':0x0,'rows':[]};return db[_0x6790('0x29')][_0x6790('0x58')]({'where':{'id':_0x1c762a['params']['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x24c8af,null))[_0x6790('0x21')](function(_0x1b3d7c){if(_0x1b3d7c){_0x33e3f0[_0x6790('0x2d')]=_['keys'](db[_0x6790('0x62')]['rawAttributes']);_0x33e3f0[_0x6790('0x2e')]=_[_0x6790('0x2f')](_0x1c762a[_0x6790('0x2e')]);_0x33e3f0[_0x6790('0x30')]=_[_0x6790('0x31')](_0x33e3f0[_0x6790('0x2d')],_0x33e3f0[_0x6790('0x2e')]);_0x1e746d[_0x6790('0x32')]=_[_0x6790('0x31')](_0x33e3f0[_0x6790('0x2d')],qs[_0x6790('0x33')](_0x1c762a['query'][_0x6790('0x33')]));_0x1e746d[_0x6790('0x32')]=_0x1e746d[_0x6790('0x32')][_0x6790('0x34')]?_0x1e746d['attributes']:_0x33e3f0[_0x6790('0x2d')];if(!_0x1c762a[_0x6790('0x2e')]['hasOwnProperty'](_0x6790('0x35'))){_0x1e746d['limit']=qs[_0x6790('0x36')](_0x1c762a[_0x6790('0x2e')][_0x6790('0x36')]);_0x1e746d[_0x6790('0x37')]=qs[_0x6790('0x37')](_0x1c762a[_0x6790('0x2e')][_0x6790('0x37')]);}_0x1e746d[_0x6790('0x38')]=qs[_0x6790('0x39')](_0x1c762a[_0x6790('0x2e')]['sort']);_0x1e746d[_0x6790('0x3a')]=qs['filters'](_['pick'](_0x1c762a[_0x6790('0x2e')],_0x33e3f0[_0x6790('0x30')]));_0x1e746d[_0x6790('0x3a')][_0x6790('0x5b')]=_0x1b3d7c['id'];if(_0x1c762a[_0x6790('0x2e')][_0x6790('0x3c')]){_0x1e746d[_0x6790('0x3a')]=_[_0x6790('0x3d')](_0x1e746d[_0x6790('0x3a')],{'$or':_['map'](_0x1e746d[_0x6790('0x32')],function(_0x5f01ea){var _0x15101a={};_0x15101a[_0x5f01ea]={'$like':'%'+_0x1c762a[_0x6790('0x2e')][_0x6790('0x3c')]+'%'};return _0x15101a;})});}_0x1e746d=_['merge']({},_0x1e746d,_0x1c762a['options']);return db[_0x6790('0x62')][_0x6790('0x1b')]({'where':_0x1e746d[_0x6790('0x3a')]})[_0x6790('0x21')](function(_0x478a93){_0x3c2d3f['count']=_0x478a93;if(_0x1c762a[_0x6790('0x2e')][_0x6790('0x3f')]){_0x1e746d[_0x6790('0x40')]=[{'all':!![]}];}return db[_0x6790('0x62')]['findAll'](_0x1e746d);})[_0x6790('0x21')](function(_0x8cac4){_0x3c2d3f['rows']=_0x8cac4;return _0x3c2d3f;});}})[_0x6790('0x21')](respondWithFilteredResult(_0x24c8af,_0x1e746d))['catch'](handleError(_0x24c8af,null));};exports[_0x6790('0x84')]=function(_0x51f5e6,_0x3e5af4,_0x42e6bf){var _0x5ce890,_0xc5b874;return db['Campaign'][_0x6790('0x4e')]({'where':{'id':_0x51f5e6[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x3e5af4,null))['then'](function(_0x7b752c){if(_0x7b752c){_0xc5b874=_0x7b752c;return _0x7b752c[_0x6790('0x84')](_0x51f5e6[_0x6790('0x47')][_0x6790('0x65')],_[_0x6790('0x54')](_0x51f5e6['body'],[_0x6790('0x65'),'id'])||{});}return null;})[_0x6790('0x66')](function(_0x3b8928){var _0x513907;_0x5ce890=_0x3b8928||[];var _0x4409f9=[];if(_0x3b8928){for(var _0xba1ad5=0x0;_0xba1ad5<_0x3b8928['length'];_0xba1ad5+=0x1){var _0x1fdef6=_0x3b8928[_0xba1ad5]['get']({'plain':!![]});_0x513907=squel[_0x6790('0x68')]()[_0x6790('0x7c')]('cm_hopper_black')[_0x6790('0x7d')]([_0x6790('0x69'),_0x6790('0x6b'),_0x6790('0x6c'),_0x6790('0x5b'),_0x6790('0x56'),_0x6790('0x55')],squel['select']()[_0x6790('0x6e')]('phone',_0x6790('0x69'))[_0x6790('0x6e')]('id',_0x6790('0x6b'))[_0x6790('0x6e')](_0x1fdef6[_0x6790('0x6f')]['toString'](),'ListId')['field'](_0x51f5e6[_0x6790('0x53')]['id'][_0x6790('0x70')](),_0x6790('0x5b'))[_0x6790('0x6e')]('NOW()',_0x6790('0x56'))[_0x6790('0x6e')](_0x6790('0x71'),'updatedAt')[_0x6790('0x72')](_0x6790('0x73'))['where'](_0x6790('0x74'))[_0x6790('0x3a')](_0x6790('0x75'),_0x1fdef6[_0x6790('0x6f')][_0x6790('0x70')]())[_0x6790('0x3a')](_0x6790('0x7e')))[_0x6790('0x70')]();_0x4409f9[_0x6790('0x85')](db[_0x6790('0x80')]['query'](_0x513907));}return BPromise[_0x6790('0x81')](_0x4409f9);}})[_0x6790('0x21')](function(){return _0x5ce890;})[_0x6790('0x21')](respondWithResult(_0x3e5af4,null))['catch'](handleError(_0x3e5af4,null));};exports[_0x6790('0x86')]=function(_0x1cf408,_0x41ce1c,_0x2c19aa){return db[_0x6790('0x29')]['find']({'where':{'id':_0x1cf408[_0x6790('0x53')]['id']}})[_0x6790('0x21')](handleEntityNotFound(_0x41ce1c,null))[_0x6790('0x21')](function(_0x14a9d2){if(_0x14a9d2){return _0x14a9d2['removeBlackLists'](_0x1cf408['query'][_0x6790('0x65')]);}})[_0x6790('0x21')](function(_0x192432){if(_0x192432){return db[_0x6790('0x61')][_0x6790('0x22')]({'where':{'ListId':_0x1cf408[_0x6790('0x2e')][_0x6790('0x65')],'CampaignId':_0x1cf408[_0x6790('0x53')]['id']}})['then'](function(){return _0x192432;});}})[_0x6790('0x21')](respondWithStatusCode(_0x41ce1c,null))['catch'](handleError(_0x41ce1c,null));}; \ No newline at end of file +var _0x9460=['moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','IvrCampaigns','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','type','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','length','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','userProfileId','UserProfileResource','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','rows','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','CmListId','toString','ListId','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','rimraf','zip-dir'];(function(_0x5b29da,_0xd60105){var _0x2887e3=function(_0x4d580b){while(--_0x4d580b){_0x5b29da['push'](_0x5b29da['shift']());}};_0x2887e3(++_0xd60105);}(_0x9460,0x10c));var _0x0946=function(_0x33015a,_0x3d3293){_0x33015a=_0x33015a-0x0;var _0x211b7b=_0x9460[_0x33015a];return _0x211b7b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0946('0x0'));var zipdir=require(_0x0946('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0946('0x2'));var BPromise=require(_0x0946('0x3'));var Mustache=require(_0x0946('0x4'));var util=require(_0x0946('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0946('0x6'));var ejs=require(_0x0946('0x7'));var fs=require('fs');var _=require(_0x0946('0x8'));var squel=require('squel');var crypto=require(_0x0946('0x9'));var jsforce=require(_0x0946('0xa'));var deskjs=require(_0x0946('0xb'));var toCsv=require(_0x0946('0x6'));var querystring=require(_0x0946('0xc'));var Papa=require(_0x0946('0xd'));var Redis=require(_0x0946('0xe'));var authService=require(_0x0946('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0946('0x10'));var hardwareService=require(_0x0946('0x11'));var logger=require(_0x0946('0x12'))(_0x0946('0x13'));var utils=require(_0x0946('0x14'));var config=require(_0x0946('0x15'));var db=require(_0x0946('0x16'))['db'];function respondWithStatusCode(_0x406e85,_0x27f9f0){_0x27f9f0=_0x27f9f0||0xcc;return function(_0x3c6058){if(_0x3c6058){return _0x406e85[_0x0946('0x17')](_0x27f9f0);}return _0x406e85[_0x0946('0x18')](_0x27f9f0)[_0x0946('0x19')]();};}function respondWithResult(_0x17b436,_0x1bd12c){_0x1bd12c=_0x1bd12c||0xc8;return function(_0x34e1f7){if(_0x34e1f7){return _0x17b436[_0x0946('0x18')](_0x1bd12c)['json'](_0x34e1f7);}};}function respondWithFilteredResult(_0x14cabc,_0x295a82){return function(_0x2c8036){if(_0x2c8036){var _0x30ac19=_0x2c8036[_0x0946('0x1a')],_0x2d7d8f=_0x295a82[_0x0946('0x1b')],_0x47bc4d=_0x295a82[_0x0946('0x1b')]+_0x295a82[_0x0946('0x1c')],_0x1cd82e;if(_0x47bc4d>=_0x30ac19){_0x47bc4d=_0x30ac19;_0x1cd82e=0xc8;}else{_0x1cd82e=0xce;}_0x14cabc[_0x0946('0x18')](_0x1cd82e);return _0x14cabc[_0x0946('0x1d')](_0x0946('0x1e'),_0x2d7d8f+'-'+_0x47bc4d+'/'+_0x30ac19)[_0x0946('0x1f')](_0x2c8036);}return null;};}function patchUpdates(_0x252f57){return function(_0x48b1a8){try{jsonpatch['apply'](_0x48b1a8,_0x252f57,!![]);}catch(_0x2b7d6f){return BPromise[_0x0946('0x20')](_0x2b7d6f);}return _0x48b1a8[_0x0946('0x21')]();};}function saveUpdates(_0x114724,_0x43d0c2){return function(_0x42a895){if(_0x42a895){return _0x42a895[_0x0946('0x22')](_0x114724)[_0x0946('0x23')](function(_0x4369c0){return _0x4369c0;});}return null;};}function removeEntity(_0x57e731,_0x379128){return function(_0xcb36b){if(_0xcb36b){return _0xcb36b['destroy']()[_0x0946('0x23')](function(){var _0x583296=_0xcb36b[_0x0946('0x24')]({'plain':!![]});var _0x42358e=_0x0946('0x25');return db['UserProfileResource'][_0x0946('0x26')]({'where':{'type':_0x42358e,'resourceId':_0x583296['id']}})[_0x0946('0x23')](function(){return _0xcb36b;});})[_0x0946('0x23')](function(){_0x57e731[_0x0946('0x18')](0xcc)[_0x0946('0x19')]();});}};}function handleEntityNotFound(_0x1d8113,_0x5b47b9){return function(_0x1616fc){if(!_0x1616fc){_0x1d8113[_0x0946('0x17')](0x194);}return _0x1616fc;};}function handleError(_0x3a60b1,_0x4224ed){_0x4224ed=_0x4224ed||0x1f4;return function(_0x319aa2){logger[_0x0946('0x27')](_0x319aa2[_0x0946('0x28')]);if(_0x319aa2['name']){delete _0x319aa2[_0x0946('0x29')];}_0x3a60b1[_0x0946('0x18')](_0x4224ed)[_0x0946('0x2a')](_0x319aa2);};}exports[_0x0946('0x2b')]=function(_0x2563b7,_0x20f1be){var _0x498707={},_0x49b3e2={},_0x3a3701={'count':0x0,'rows':[]};var _0x527976=_[_0x0946('0x2c')](db[_0x0946('0x2d')][_0x0946('0x2e')],function(_0x38866f){return{'name':_0x38866f['fieldName'],'type':_0x38866f[_0x0946('0x2f')]['key']};});_0x49b3e2['model']=_[_0x0946('0x2c')](_0x527976,_0x0946('0x29'));_0x49b3e2['query']=_[_0x0946('0x30')](_0x2563b7[_0x0946('0x31')]);_0x49b3e2['filters']=_[_0x0946('0x32')](_0x49b3e2[_0x0946('0x33')],_0x49b3e2[_0x0946('0x31')]);_0x498707[_0x0946('0x34')]=_['intersection'](_0x49b3e2[_0x0946('0x33')],qs[_0x0946('0x35')](_0x2563b7[_0x0946('0x31')][_0x0946('0x35')]));_0x498707[_0x0946('0x34')]=_0x498707[_0x0946('0x34')]['length']?_0x498707['attributes']:_0x49b3e2[_0x0946('0x33')];if(!_0x2563b7[_0x0946('0x31')][_0x0946('0x36')](_0x0946('0x37'))){_0x498707[_0x0946('0x1c')]=qs['limit'](_0x2563b7[_0x0946('0x31')][_0x0946('0x1c')]);_0x498707['offset']=qs['offset'](_0x2563b7[_0x0946('0x31')]['offset']);}_0x498707[_0x0946('0x38')]=qs[_0x0946('0x39')](_0x2563b7['query']['sort']);_0x498707['where']=qs[_0x0946('0x3a')](_[_0x0946('0x3b')](_0x2563b7[_0x0946('0x31')],_0x49b3e2['filters']),_0x527976);if(_0x2563b7[_0x0946('0x31')][_0x0946('0x3c')]){_0x498707[_0x0946('0x3d')]=_[_0x0946('0x3e')](_0x498707[_0x0946('0x3d')],{'$or':_[_0x0946('0x2c')](_0x527976,function(_0x461761){if(_0x461761['type']!==_0x0946('0x3f')){var _0x5d9a9d={};_0x5d9a9d[_0x461761['name']]={'$like':'%'+_0x2563b7[_0x0946('0x31')][_0x0946('0x3c')]+'%'};return _0x5d9a9d;}})});}_0x498707=_[_0x0946('0x3e')]({},_0x498707,_0x2563b7[_0x0946('0x40')]);var _0x38b70c={'where':_0x498707[_0x0946('0x3d')]};return db[_0x0946('0x2d')][_0x0946('0x1a')](_0x38b70c)[_0x0946('0x23')](function(_0xc2f1c8){_0x3a3701[_0x0946('0x1a')]=_0xc2f1c8;if(_0x2563b7[_0x0946('0x31')][_0x0946('0x41')]){_0x498707[_0x0946('0x42')]=[{'all':!![]}];}return db['Campaign'][_0x0946('0x43')](_0x498707);})['then'](function(_0x2a5d18){_0x3a3701['rows']=_0x2a5d18;return _0x3a3701;})['then'](respondWithFilteredResult(_0x20f1be,_0x498707))['catch'](handleError(_0x20f1be,null));};exports[_0x0946('0x44')]=function(_0x513f21,_0x5ae0fa){var _0x275fc7={'raw':![],'where':{'id':_0x513f21['params']['id']}},_0x497310={};_0x497310[_0x0946('0x33')]=_[_0x0946('0x30')](db[_0x0946('0x2d')][_0x0946('0x2e')]);_0x497310[_0x0946('0x31')]=_[_0x0946('0x30')](_0x513f21['query']);_0x497310['filters']=_['intersection'](_0x497310[_0x0946('0x33')],_0x497310['query']);_0x275fc7[_0x0946('0x34')]=_['intersection'](_0x497310[_0x0946('0x33')],qs[_0x0946('0x35')](_0x513f21[_0x0946('0x31')][_0x0946('0x35')]));_0x275fc7['attributes']=_0x275fc7[_0x0946('0x34')][_0x0946('0x45')]?_0x275fc7[_0x0946('0x34')]:_0x497310[_0x0946('0x33')];if(_0x513f21['query'][_0x0946('0x41')]){_0x275fc7[_0x0946('0x42')]=[{'all':!![]}];}_0x275fc7=_[_0x0946('0x3e')]({},_0x275fc7,_0x513f21[_0x0946('0x40')]);return db[_0x0946('0x2d')][_0x0946('0x46')](_0x275fc7)[_0x0946('0x23')](handleEntityNotFound(_0x5ae0fa,null))[_0x0946('0x23')](respondWithResult(_0x5ae0fa,null))['catch'](handleError(_0x5ae0fa,null));};exports[_0x0946('0x47')]=function(_0x43df8d,_0x25d898){return db[_0x0946('0x2d')][_0x0946('0x47')](_0x43df8d[_0x0946('0x48')],{})[_0x0946('0x23')](function(_0x3724b0){var _0x134fe1=_0x43df8d[_0x0946('0x49')][_0x0946('0x24')]({'plain':!![]});if(!_0x134fe1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x134fe1[_0x0946('0x4a')]===_0x0946('0x49')){var _0x2d9146=_0x3724b0['get']({'plain':!![]});var _0x41579c=_0x0946('0x25');return db[_0x0946('0x4b')]['find']({'where':{'name':_0x41579c,'userProfileId':_0x134fe1['userProfileId']},'raw':!![]})['then'](function(_0x5ed0da){if(_0x5ed0da&&_0x5ed0da[_0x0946('0x4c')]===0x0){return db['UserProfileResource'][_0x0946('0x47')]({'name':_0x2d9146[_0x0946('0x29')],'resourceId':_0x2d9146['id'],'type':_0x5ed0da['name'],'sectionId':_0x5ed0da['id']},{})[_0x0946('0x23')](function(){return _0x3724b0;});}else{return _0x3724b0;}})[_0x0946('0x4d')](function(_0x1741be){logger[_0x0946('0x27')](_0x0946('0x4e'),_0x1741be);throw _0x1741be;});}return _0x3724b0;})['then'](respondWithResult(_0x25d898,0xc9))[_0x0946('0x4d')](handleError(_0x25d898,null));};exports[_0x0946('0x4f')]=function(_0x23d989,_0x16c5ab){var _0x2e2438={'where':{'id':_0x23d989[_0x0946('0x50')]['id']}},_0x1d75b6={};_0x1d75b6[_0x0946('0x33')]=_[_0x0946('0x30')](db['Campaign'][_0x0946('0x2e')]);_0x2e2438[_0x0946('0x34')]=_[_0x0946('0x32')](_0x1d75b6['model'],qs[_0x0946('0x35')](_0x23d989[_0x0946('0x31')][_0x0946('0x35')]));_0x2e2438[_0x0946('0x34')]=_0x2e2438[_0x0946('0x34')]['length']?_0x2e2438[_0x0946('0x34')]:_0x1d75b6[_0x0946('0x33')];if(_0x23d989[_0x0946('0x31')][_0x0946('0x41')]){_0x2e2438[_0x0946('0x42')]=[{'all':!![]}];}_0x2e2438=_[_0x0946('0x3e')]({},_0x2e2438,_0x23d989['options']);return db[_0x0946('0x2d')][_0x0946('0x46')](_0x2e2438)[_0x0946('0x23')](handleEntityNotFound(_0x16c5ab,null))[_0x0946('0x23')](function(_0x5589af){if(_0x5589af){var _0x1c42ec=_0x5589af[_0x0946('0x24')]({'plain':!![]});_0x1c42ec=qs['omit'](_0x1c42ec,['id',_0x0946('0x51'),_0x0946('0x52')]);_0x23d989[_0x0946('0x48')]=_[_0x0946('0x53')](_0x23d989[_0x0946('0x48')],['id',_0x0946('0x51'),_0x0946('0x52')]);return db[_0x0946('0x2d')][_0x0946('0x47')](_['merge'](_0x1c42ec,_0x23d989[_0x0946('0x48')]),{'include':_0x23d989[_0x0946('0x31')][_0x0946('0x41')]?[{'all':!![]}]:undefined})[_0x0946('0x23')](function(_0x31fed4){var _0x31e485=_0x23d989[_0x0946('0x49')][_0x0946('0x24')]({'plain':!![]});if(!_0x31e485)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31e485[_0x0946('0x4a')]===_0x0946('0x49')){var _0x397cb9=_0x31fed4[_0x0946('0x24')]({'plain':!![]});var _0x5460a3=_0x0946('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x5460a3,'userProfileId':_0x31e485[_0x0946('0x54')]},'raw':!![]})[_0x0946('0x23')](function(_0x18f8f0){if(_0x18f8f0&&_0x18f8f0['autoAssociation']===0x0){return db[_0x0946('0x55')]['create']({'name':_0x397cb9[_0x0946('0x29')],'resourceId':_0x397cb9['id'],'type':_0x18f8f0[_0x0946('0x29')],'sectionId':_0x18f8f0['id']},{})[_0x0946('0x23')](function(){return _0x31fed4;});}else{return _0x31fed4;}})[_0x0946('0x4d')](function(_0x109055){logger[_0x0946('0x27')](_0x0946('0x4e'),_0x109055);throw _0x109055;});}return _0x31fed4;});}})[_0x0946('0x23')](respondWithResult(_0x16c5ab,0xc9))[_0x0946('0x4d')](handleError(_0x16c5ab,null));};exports['update']=function(_0x1ff3a5,_0x175394){if(_0x1ff3a5[_0x0946('0x48')]['id']){delete _0x1ff3a5[_0x0946('0x48')]['id'];}return db['Campaign']['find']({'where':{'id':_0x1ff3a5[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x175394,null))['then'](saveUpdates(_0x1ff3a5[_0x0946('0x48')],null))[_0x0946('0x23')](respondWithResult(_0x175394,null))[_0x0946('0x4d')](handleError(_0x175394,null));};exports[_0x0946('0x26')]=function(_0x151195,_0x273eca){return db[_0x0946('0x2d')][_0x0946('0x46')]({'where':{'id':_0x151195[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x273eca,null))[_0x0946('0x23')](removeEntity(_0x273eca,null))[_0x0946('0x4d')](handleError(_0x273eca,null));};exports[_0x0946('0x56')]=function(_0x82ef4,_0x425e93,_0x3a6099){var _0x5051cc={'raw':!![],'where':{}};var _0x41c1e7={};var _0x196506={'count':0x0,'rows':[]};return db[_0x0946('0x2d')][_0x0946('0x57')]({'where':{'id':_0x82ef4[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x425e93,null))[_0x0946('0x23')](function(_0x3c0d8d){if(_0x3c0d8d){_0x41c1e7[_0x0946('0x33')]=_[_0x0946('0x30')](db['CmHopper'][_0x0946('0x2e')]);_0x41c1e7['query']=_[_0x0946('0x30')](_0x82ef4[_0x0946('0x31')]);_0x41c1e7[_0x0946('0x3a')]=_['intersection'](_0x41c1e7['model'],_0x41c1e7[_0x0946('0x31')]);_0x5051cc['attributes']=_[_0x0946('0x32')](_0x41c1e7['model'],qs[_0x0946('0x35')](_0x82ef4[_0x0946('0x31')][_0x0946('0x35')]));_0x5051cc[_0x0946('0x34')]=_0x5051cc[_0x0946('0x34')][_0x0946('0x45')]?_0x5051cc[_0x0946('0x34')]:_0x41c1e7[_0x0946('0x33')];if(!_0x82ef4[_0x0946('0x31')][_0x0946('0x36')]('nolimit')){_0x5051cc[_0x0946('0x1c')]=qs[_0x0946('0x1c')](_0x82ef4[_0x0946('0x31')]['limit']);_0x5051cc[_0x0946('0x1b')]=qs[_0x0946('0x1b')](_0x82ef4[_0x0946('0x31')]['offset']);}_0x5051cc[_0x0946('0x38')]=qs[_0x0946('0x39')](_0x82ef4['query'][_0x0946('0x39')]);_0x5051cc[_0x0946('0x3d')]=qs[_0x0946('0x3a')](_[_0x0946('0x3b')](_0x82ef4['query'],_0x41c1e7[_0x0946('0x3a')]));_0x5051cc['where'][_0x0946('0x58')]=_0x3c0d8d['id'];if(_0x82ef4[_0x0946('0x31')][_0x0946('0x3c')]){_0x5051cc[_0x0946('0x3d')]=_['merge'](_0x5051cc[_0x0946('0x3d')],{'$or':_[_0x0946('0x2c')](_0x5051cc[_0x0946('0x34')],function(_0x5717c3){var _0x133285={};_0x133285[_0x5717c3]={'$like':'%'+_0x82ef4[_0x0946('0x31')][_0x0946('0x3c')]+'%'};return _0x133285;})});}_0x5051cc=_[_0x0946('0x3e')]({},_0x5051cc,_0x82ef4['options']);return db['CmHopper'][_0x0946('0x1a')]({'where':_0x5051cc['where']})[_0x0946('0x23')](function(_0x20c704){_0x196506[_0x0946('0x1a')]=_0x20c704;if(_0x82ef4[_0x0946('0x31')]['includeAll']){_0x5051cc[_0x0946('0x42')]=[{'all':!![]}];}return db[_0x0946('0x59')][_0x0946('0x43')](_0x5051cc);})[_0x0946('0x23')](function(_0xc7f89b){_0x196506['rows']=_0xc7f89b;return _0x196506;});}})[_0x0946('0x23')](respondWithFilteredResult(_0x425e93,_0x5051cc))[_0x0946('0x4d')](handleError(_0x425e93,null));};exports[_0x0946('0x5a')]=function(_0x372604,_0x101257,_0x716ece){var _0x5ea9d4={'raw':!![],'where':{}};var _0x33f946={};var _0x359985={'count':0x0,'rows':[]};return db[_0x0946('0x2d')][_0x0946('0x57')]({'where':{'id':_0x372604[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x101257,null))[_0x0946('0x23')](function(_0x11e072){if(_0x11e072){_0x33f946[_0x0946('0x33')]=_['keys'](db[_0x0946('0x5b')]['rawAttributes']);_0x33f946[_0x0946('0x31')]=_[_0x0946('0x30')](_0x372604[_0x0946('0x31')]);_0x33f946[_0x0946('0x3a')]=_['intersection'](_0x33f946['model'],_0x33f946[_0x0946('0x31')]);_0x5ea9d4[_0x0946('0x34')]=_[_0x0946('0x32')](_0x33f946['model'],qs[_0x0946('0x35')](_0x372604['query'][_0x0946('0x35')]));_0x5ea9d4[_0x0946('0x34')]=_0x5ea9d4[_0x0946('0x34')][_0x0946('0x45')]?_0x5ea9d4['attributes']:_0x33f946['model'];if(!_0x372604[_0x0946('0x31')][_0x0946('0x36')](_0x0946('0x37'))){_0x5ea9d4[_0x0946('0x1c')]=qs[_0x0946('0x1c')](_0x372604[_0x0946('0x31')][_0x0946('0x1c')]);_0x5ea9d4[_0x0946('0x1b')]=qs[_0x0946('0x1b')](_0x372604[_0x0946('0x31')]['offset']);}_0x5ea9d4['order']=qs['sort'](_0x372604[_0x0946('0x31')][_0x0946('0x39')]);_0x5ea9d4['where']=qs[_0x0946('0x3a')](_['pick'](_0x372604['query'],_0x33f946['filters']));_0x5ea9d4[_0x0946('0x3d')][_0x0946('0x58')]=_0x11e072['id'];if(_0x372604[_0x0946('0x31')][_0x0946('0x3c')]){_0x5ea9d4[_0x0946('0x3d')]=_[_0x0946('0x3e')](_0x5ea9d4['where'],{'$or':_[_0x0946('0x2c')](_0x5ea9d4['attributes'],function(_0x218ca8){var _0x36e760={};_0x36e760[_0x218ca8]={'$like':'%'+_0x372604[_0x0946('0x31')]['filter']+'%'};return _0x36e760;})});}_0x5ea9d4=_['merge']({},_0x5ea9d4,_0x372604[_0x0946('0x40')]);return db['CmHopperHistory']['count']({'where':_0x5ea9d4[_0x0946('0x3d')]})['then'](function(_0x1fc09f){_0x359985[_0x0946('0x1a')]=_0x1fc09f;if(_0x372604[_0x0946('0x31')][_0x0946('0x41')]){_0x5ea9d4[_0x0946('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0946('0x43')](_0x5ea9d4);})[_0x0946('0x23')](function(_0x5dc864){_0x359985['rows']=_0x5dc864;return _0x359985;});}})[_0x0946('0x23')](respondWithFilteredResult(_0x101257,_0x5ea9d4))[_0x0946('0x4d')](handleError(_0x101257,null));};exports[_0x0946('0x5c')]=function(_0x373553,_0xfa9acf,_0x55b432){var _0x34cd2d={'raw':!![],'where':{}};var _0x1c43a9={};var _0x5b1276={'count':0x0,'rows':[]};return db[_0x0946('0x2d')]['findOne']({'where':{'id':_0x373553[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0xfa9acf,null))[_0x0946('0x23')](function(_0x5f1f12){if(_0x5f1f12){_0x1c43a9[_0x0946('0x33')]=_['keys'](db[_0x0946('0x5d')][_0x0946('0x2e')]);_0x1c43a9[_0x0946('0x31')]=_['keys'](_0x373553['query']);_0x1c43a9[_0x0946('0x3a')]=_[_0x0946('0x32')](_0x1c43a9[_0x0946('0x33')],_0x1c43a9[_0x0946('0x31')]);_0x34cd2d[_0x0946('0x34')]=_[_0x0946('0x32')](_0x1c43a9['model'],qs[_0x0946('0x35')](_0x373553[_0x0946('0x31')][_0x0946('0x35')]));_0x34cd2d[_0x0946('0x34')]=_0x34cd2d[_0x0946('0x34')][_0x0946('0x45')]?_0x34cd2d[_0x0946('0x34')]:_0x1c43a9['model'];if(!_0x373553[_0x0946('0x31')][_0x0946('0x36')](_0x0946('0x37'))){_0x34cd2d[_0x0946('0x1c')]=qs['limit'](_0x373553[_0x0946('0x31')][_0x0946('0x1c')]);_0x34cd2d[_0x0946('0x1b')]=qs[_0x0946('0x1b')](_0x373553[_0x0946('0x31')][_0x0946('0x1b')]);}_0x34cd2d['order']=qs['sort'](_0x373553[_0x0946('0x31')][_0x0946('0x39')]);_0x34cd2d[_0x0946('0x3d')]=qs[_0x0946('0x3a')](_[_0x0946('0x3b')](_0x373553[_0x0946('0x31')],_0x1c43a9[_0x0946('0x3a')]));_0x34cd2d[_0x0946('0x3d')][_0x0946('0x58')]=_0x5f1f12['id'];if(_0x373553[_0x0946('0x31')]['filter']){_0x34cd2d[_0x0946('0x3d')]=_[_0x0946('0x3e')](_0x34cd2d[_0x0946('0x3d')],{'$or':_[_0x0946('0x2c')](_0x34cd2d[_0x0946('0x34')],function(_0x52a437){var _0x39bdb7={};_0x39bdb7[_0x52a437]={'$like':'%'+_0x373553[_0x0946('0x31')]['filter']+'%'};return _0x39bdb7;})});}_0x34cd2d=_[_0x0946('0x3e')]({},_0x34cd2d,_0x373553[_0x0946('0x40')]);return db['CmHopperFinal'][_0x0946('0x1a')]({'where':_0x34cd2d[_0x0946('0x3d')]})[_0x0946('0x23')](function(_0x29fe94){_0x5b1276[_0x0946('0x1a')]=_0x29fe94;if(_0x373553['query'][_0x0946('0x41')]){_0x34cd2d[_0x0946('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x34cd2d);})[_0x0946('0x23')](function(_0x14fb52){_0x5b1276[_0x0946('0x5e')]=_0x14fb52;return _0x5b1276;});}})['then'](respondWithFilteredResult(_0xfa9acf,_0x34cd2d))['catch'](handleError(_0xfa9acf,null));};exports[_0x0946('0x5f')]=function(_0x2faea8,_0x567de4,_0x3e0d57){var _0x277f63={'raw':!![],'where':{}};var _0x4b28e5={};var _0x3ea9bb={'count':0x0,'rows':[]};return db[_0x0946('0x2d')][_0x0946('0x57')]({'where':{'id':_0x2faea8[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x567de4,null))[_0x0946('0x23')](function(_0xf1f8f5){if(_0xf1f8f5){_0x4b28e5[_0x0946('0x33')]=_[_0x0946('0x30')](db['CmHopperBlack']['rawAttributes']);_0x4b28e5[_0x0946('0x31')]=_[_0x0946('0x30')](_0x2faea8['query']);_0x4b28e5[_0x0946('0x3a')]=_[_0x0946('0x32')](_0x4b28e5[_0x0946('0x33')],_0x4b28e5[_0x0946('0x31')]);_0x277f63[_0x0946('0x34')]=_['intersection'](_0x4b28e5['model'],qs[_0x0946('0x35')](_0x2faea8[_0x0946('0x31')][_0x0946('0x35')]));_0x277f63[_0x0946('0x34')]=_0x277f63[_0x0946('0x34')]['length']?_0x277f63['attributes']:_0x4b28e5[_0x0946('0x33')];if(!_0x2faea8[_0x0946('0x31')][_0x0946('0x36')]('nolimit')){_0x277f63[_0x0946('0x1c')]=qs[_0x0946('0x1c')](_0x2faea8[_0x0946('0x31')][_0x0946('0x1c')]);_0x277f63['offset']=qs[_0x0946('0x1b')](_0x2faea8[_0x0946('0x31')][_0x0946('0x1b')]);}_0x277f63['order']=qs[_0x0946('0x39')](_0x2faea8['query'][_0x0946('0x39')]);_0x277f63[_0x0946('0x3d')]=qs['filters'](_[_0x0946('0x3b')](_0x2faea8['query'],_0x4b28e5['filters']));_0x277f63[_0x0946('0x3d')][_0x0946('0x58')]=_0xf1f8f5['id'];if(_0x2faea8['query'][_0x0946('0x3c')]){_0x277f63[_0x0946('0x3d')]=_['merge'](_0x277f63['where'],{'$or':_['map'](_0x277f63[_0x0946('0x34')],function(_0x367913){var _0x3853e1={};_0x3853e1[_0x367913]={'$like':'%'+_0x2faea8[_0x0946('0x31')]['filter']+'%'};return _0x3853e1;})});}_0x277f63=_[_0x0946('0x3e')]({},_0x277f63,_0x2faea8[_0x0946('0x40')]);return db[_0x0946('0x60')][_0x0946('0x1a')]({'where':_0x277f63[_0x0946('0x3d')]})[_0x0946('0x23')](function(_0x1b73e4){_0x3ea9bb[_0x0946('0x1a')]=_0x1b73e4;if(_0x2faea8[_0x0946('0x31')][_0x0946('0x41')]){_0x277f63[_0x0946('0x42')]=[{'all':!![]}];}return db[_0x0946('0x60')][_0x0946('0x43')](_0x277f63);})[_0x0946('0x23')](function(_0x3000bd){_0x3ea9bb[_0x0946('0x5e')]=_0x3000bd;return _0x3ea9bb;});}})['then'](respondWithFilteredResult(_0x567de4,_0x277f63))['catch'](handleError(_0x567de4,null));};exports[_0x0946('0x61')]=function(_0x169644,_0x55aef0,_0x3f786e){var _0x428cdc={};var _0x4c3239={};var _0x4f4028;var _0x596630;return db[_0x0946('0x2d')][_0x0946('0x57')]({'where':{'id':_0x169644[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x55aef0,null))[_0x0946('0x23')](function(_0x182ef4){if(_0x182ef4){_0x4f4028=_0x182ef4;_0x4c3239[_0x0946('0x33')]=_[_0x0946('0x30')](db[_0x0946('0x62')][_0x0946('0x2e')]);_0x4c3239[_0x0946('0x31')]=_[_0x0946('0x30')](_0x169644[_0x0946('0x31')]);_0x4c3239[_0x0946('0x3a')]=_[_0x0946('0x32')](_0x4c3239['model'],_0x4c3239[_0x0946('0x31')]);_0x428cdc[_0x0946('0x34')]=_['intersection'](_0x4c3239['model'],qs[_0x0946('0x35')](_0x169644['query'][_0x0946('0x35')]));_0x428cdc['attributes']=_0x428cdc[_0x0946('0x34')][_0x0946('0x45')]?_0x428cdc[_0x0946('0x34')]:_0x4c3239[_0x0946('0x33')];_0x428cdc['order']=qs['sort'](_0x169644['query']['sort']);_0x428cdc[_0x0946('0x3d')]=qs[_0x0946('0x3a')](_[_0x0946('0x3b')](_0x169644[_0x0946('0x31')],_0x4c3239[_0x0946('0x3a')]));if(_0x169644[_0x0946('0x31')]['filter']){_0x428cdc['where']=_[_0x0946('0x3e')](_0x428cdc['where'],{'$or':_[_0x0946('0x2c')](_0x428cdc[_0x0946('0x34')],function(_0x31361f){var _0x455619={};_0x455619[_0x31361f]={'$like':'%'+_0x169644[_0x0946('0x31')][_0x0946('0x3c')]+'%'};return _0x455619;})});}_0x428cdc=_[_0x0946('0x3e')]({},_0x428cdc,_0x169644['options']);return _0x4f4028['getLists'](_0x428cdc);}})['then'](function(_0x394db8){if(_0x394db8){_0x596630=_0x394db8[_0x0946('0x45')];if(!_0x169644[_0x0946('0x31')]['hasOwnProperty'](_0x0946('0x37'))){_0x428cdc[_0x0946('0x1c')]=qs[_0x0946('0x1c')](_0x169644[_0x0946('0x31')][_0x0946('0x1c')]);_0x428cdc[_0x0946('0x1b')]=qs[_0x0946('0x1b')](_0x169644[_0x0946('0x31')]['offset']);}return _0x4f4028[_0x0946('0x61')](_0x428cdc);}})[_0x0946('0x23')](function(_0x200e43){if(_0x200e43){return _0x200e43?{'count':_0x596630,'rows':_0x200e43}:null;}})[_0x0946('0x23')](respondWithResult(_0x55aef0,null))['catch'](handleError(_0x55aef0,null));};exports[_0x0946('0x63')]=function(_0x358f35,_0x78c8ea,_0x4716b8){var _0x56924c,_0x55953d;return db[_0x0946('0x2d')][_0x0946('0x46')]({'where':{'id':_0x358f35[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x78c8ea,null))[_0x0946('0x23')](function(_0x289652){if(_0x289652){_0x55953d=_0x289652;return _0x289652[_0x0946('0x63')](_0x358f35['body']['ids'],_[_0x0946('0x53')](_0x358f35[_0x0946('0x48')],[_0x0946('0x64'),'id'])||{});}return null;})['spread'](function(_0x156545){var _0x5099fd;_0x56924c=_0x156545||[];var _0x273092=[];if(_0x156545){for(var _0x30918b=0x0;_0x30918b<_0x156545['length'];_0x30918b+=0x1){var _0x1c2740=_0x156545[_0x30918b][_0x0946('0x24')]({'plain':!![]});_0x55953d[_0x0946('0x65')]=_0x358f35[_0x0946('0x48')][_0x0946('0x65')]?_0x358f35[_0x0946('0x48')][_0x0946('0x65')]:_0x55953d[_0x0946('0x65')];switch(_0x55953d['dialCheckDuplicateType']){case _0x0946('0x66'):_0x5099fd=squel['insert']()[_0x0946('0x67')](_0x0946('0x68'))[_0x0946('0x69')]([_0x0946('0x6a'),_0x0946('0x6b'),_0x0946('0x6c'),'ListId',_0x0946('0x58'),_0x0946('0x51'),_0x0946('0x52')],squel['select']()[_0x0946('0x6d')]('phone',_0x0946('0x6a'))[_0x0946('0x6d')](_0x0946('0x6e'),_0x0946('0x6b'))[_0x0946('0x6d')]('id',_0x0946('0x6c'))[_0x0946('0x6d')](_0x1c2740[_0x0946('0x6f')][_0x0946('0x70')](),_0x0946('0x71'))[_0x0946('0x6d')](_0x358f35['params']['id']['toString'](),_0x0946('0x58'))['field'](_0x0946('0x6e'),_0x0946('0x51'))['field']('NOW()',_0x0946('0x52'))[_0x0946('0x72')](_0x0946('0x73'))[_0x0946('0x3d')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x1c2740[_0x0946('0x6f')][_0x0946('0x70')]())[_0x0946('0x3d')](_0x0946('0x74'))[_0x0946('0x3d')](_0x0946('0x75'),squel[_0x0946('0x76')]()[_0x0946('0x6d')](_0x0946('0x77'))['from'](_0x0946('0x78'))[_0x0946('0x3d')](_0x0946('0x79'),_0x358f35['params']['id']['toString']()))[_0x0946('0x3d')](_0x0946('0x75'),squel[_0x0946('0x76')]()[_0x0946('0x6d')](_0x0946('0x7a'))[_0x0946('0x72')](_0x0946('0x68'))[_0x0946('0x3d')](_0x0946('0x79'),_0x358f35[_0x0946('0x50')]['id'][_0x0946('0x70')]())))['toString']();break;case _0x0946('0x7b'):_0x5099fd=squel[_0x0946('0x7c')]()[_0x0946('0x67')](_0x0946('0x68'))[_0x0946('0x69')]([_0x0946('0x6a'),_0x0946('0x6b'),_0x0946('0x6c'),'ListId',_0x0946('0x58'),_0x0946('0x51'),_0x0946('0x52')],squel[_0x0946('0x76')]()[_0x0946('0x6d')]('phone',_0x0946('0x6a'))['field']('NOW()',_0x0946('0x6b'))[_0x0946('0x6d')]('id',_0x0946('0x6c'))[_0x0946('0x6d')](_0x1c2740[_0x0946('0x6f')]['toString'](),'ListId')[_0x0946('0x6d')](_0x358f35[_0x0946('0x50')]['id'][_0x0946('0x70')](),_0x0946('0x58'))[_0x0946('0x6d')](_0x0946('0x6e'),_0x0946('0x51'))[_0x0946('0x6d')](_0x0946('0x6e'),_0x0946('0x52'))[_0x0946('0x72')](_0x0946('0x73'))[_0x0946('0x3d')](_0x0946('0x7d'))[_0x0946('0x3d')](_0x0946('0x7e'),_0x1c2740[_0x0946('0x6f')][_0x0946('0x70')]())[_0x0946('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x0946('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0946('0x76')]()[_0x0946('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x0946('0x68'))[_0x0946('0x3d')](_0x0946('0x79'),_0x358f35[_0x0946('0x50')]['id'][_0x0946('0x70')]())))[_0x0946('0x70')]();break;default:_0x5099fd=squel[_0x0946('0x7c')]()[_0x0946('0x67')]('cm_hopper')[_0x0946('0x69')]([_0x0946('0x6a'),'scheduledAt',_0x0946('0x6c'),_0x0946('0x71'),'CampaignId',_0x0946('0x51'),_0x0946('0x52')],squel[_0x0946('0x76')]()['field'](_0x0946('0x6a'),_0x0946('0x6a'))['field'](_0x0946('0x6e'),_0x0946('0x6b'))[_0x0946('0x6d')]('id','ContactId')[_0x0946('0x6d')](_0x1c2740[_0x0946('0x6f')][_0x0946('0x70')](),_0x0946('0x71'))['field'](_0x358f35[_0x0946('0x50')]['id'][_0x0946('0x70')](),_0x0946('0x58'))[_0x0946('0x6d')](_0x0946('0x6e'),_0x0946('0x51'))['field']('NOW()',_0x0946('0x52'))['from'](_0x0946('0x73'))['where'](_0x0946('0x7d'))['where'](_0x0946('0x7e'),_0x1c2740[_0x0946('0x6f')][_0x0946('0x70')]())['where'](_0x0946('0x74')))[_0x0946('0x70')]();}_0x273092[_0x0946('0x7f')](db[_0x0946('0x80')][_0x0946('0x31')](_0x5099fd));}return BPromise[_0x0946('0x81')](_0x273092);}})[_0x0946('0x23')](function(){return _0x56924c;})[_0x0946('0x23')](respondWithResult(_0x78c8ea,null))[_0x0946('0x4d')](handleError(_0x78c8ea,null));};exports[_0x0946('0x82')]=function(_0x5da27b,_0x17b2e8,_0x58b77c){return db['Campaign'][_0x0946('0x46')]({'where':{'id':_0x5da27b[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x17b2e8,null))[_0x0946('0x23')](function(_0x3040b2){if(_0x3040b2){return _0x3040b2[_0x0946('0x82')](_0x5da27b[_0x0946('0x31')]['ids']);}})['then'](function(_0x8c18d1){if(_0x8c18d1){return db[_0x0946('0x59')][_0x0946('0x26')]({'where':{'ListId':_0x5da27b[_0x0946('0x31')]['ids'],'CampaignId':_0x5da27b[_0x0946('0x50')]['id']}})[_0x0946('0x23')](function(){return _0x8c18d1;});}})['then'](respondWithStatusCode(_0x17b2e8,null))[_0x0946('0x4d')](handleError(_0x17b2e8,null));};exports['getBlackLists']=function(_0x490110,_0x3886fc,_0x4a5577){var _0x19919b={'raw':!![],'where':{}};var _0x8e8738={};var _0x3b0ad6={'count':0x0,'rows':[]};return db['Campaign'][_0x0946('0x57')]({'where':{'id':_0x490110['params']['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x3886fc,null))[_0x0946('0x23')](function(_0x370009){if(_0x370009){_0x8e8738[_0x0946('0x33')]=_[_0x0946('0x30')](db[_0x0946('0x62')][_0x0946('0x2e')]);_0x8e8738[_0x0946('0x31')]=_[_0x0946('0x30')](_0x490110[_0x0946('0x31')]);_0x8e8738['filters']=_[_0x0946('0x32')](_0x8e8738[_0x0946('0x33')],_0x8e8738[_0x0946('0x31')]);_0x19919b['attributes']=_[_0x0946('0x32')](_0x8e8738[_0x0946('0x33')],qs[_0x0946('0x35')](_0x490110[_0x0946('0x31')][_0x0946('0x35')]));_0x19919b[_0x0946('0x34')]=_0x19919b[_0x0946('0x34')][_0x0946('0x45')]?_0x19919b[_0x0946('0x34')]:_0x8e8738['model'];if(!_0x490110[_0x0946('0x31')][_0x0946('0x36')](_0x0946('0x37'))){_0x19919b['limit']=qs[_0x0946('0x1c')](_0x490110['query'][_0x0946('0x1c')]);_0x19919b[_0x0946('0x1b')]=qs[_0x0946('0x1b')](_0x490110['query'][_0x0946('0x1b')]);}_0x19919b[_0x0946('0x38')]=qs[_0x0946('0x39')](_0x490110[_0x0946('0x31')][_0x0946('0x39')]);_0x19919b[_0x0946('0x3d')]=qs[_0x0946('0x3a')](_['pick'](_0x490110[_0x0946('0x31')],_0x8e8738[_0x0946('0x3a')]));_0x19919b[_0x0946('0x3d')][_0x0946('0x58')]=_0x370009['id'];if(_0x490110[_0x0946('0x31')]['filter']){_0x19919b[_0x0946('0x3d')]=_[_0x0946('0x3e')](_0x19919b['where'],{'$or':_['map'](_0x19919b[_0x0946('0x34')],function(_0x420402){var _0x335201={};_0x335201[_0x420402]={'$like':'%'+_0x490110[_0x0946('0x31')]['filter']+'%'};return _0x335201;})});}_0x19919b=_[_0x0946('0x3e')]({},_0x19919b,_0x490110[_0x0946('0x40')]);return db[_0x0946('0x62')][_0x0946('0x1a')]({'where':_0x19919b[_0x0946('0x3d')]})[_0x0946('0x23')](function(_0x37f162){_0x3b0ad6[_0x0946('0x1a')]=_0x37f162;if(_0x490110[_0x0946('0x31')][_0x0946('0x41')]){_0x19919b[_0x0946('0x42')]=[{'all':!![]}];}return db['CmList'][_0x0946('0x43')](_0x19919b);})['then'](function(_0x4bc3ab){_0x3b0ad6[_0x0946('0x5e')]=_0x4bc3ab;return _0x3b0ad6;});}})[_0x0946('0x23')](respondWithFilteredResult(_0x3886fc,_0x19919b))['catch'](handleError(_0x3886fc,null));};exports[_0x0946('0x83')]=function(_0x310ee7,_0x56bb84,_0x3471f5){var _0x435f22,_0x41d04c;return db[_0x0946('0x2d')][_0x0946('0x46')]({'where':{'id':_0x310ee7['params']['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x56bb84,null))[_0x0946('0x23')](function(_0x54a017){if(_0x54a017){_0x41d04c=_0x54a017;return _0x54a017[_0x0946('0x83')](_0x310ee7[_0x0946('0x48')][_0x0946('0x64')],_[_0x0946('0x53')](_0x310ee7[_0x0946('0x48')],[_0x0946('0x64'),'id'])||{});}return null;})[_0x0946('0x84')](function(_0x4104a2){var _0x7a9d5f;_0x435f22=_0x4104a2||[];var _0x2aaa4f=[];if(_0x4104a2){for(var _0x468267=0x0;_0x468267<_0x4104a2[_0x0946('0x45')];_0x468267+=0x1){var _0x174922=_0x4104a2[_0x468267]['get']({'plain':!![]});_0x7a9d5f=squel[_0x0946('0x7c')]()['into'](_0x0946('0x85'))[_0x0946('0x69')]([_0x0946('0x6a'),'ContactId',_0x0946('0x71'),'CampaignId',_0x0946('0x51'),_0x0946('0x52')],squel[_0x0946('0x76')]()[_0x0946('0x6d')](_0x0946('0x6a'),_0x0946('0x6a'))['field']('id',_0x0946('0x6c'))[_0x0946('0x6d')](_0x174922[_0x0946('0x6f')][_0x0946('0x70')](),_0x0946('0x71'))[_0x0946('0x6d')](_0x310ee7['params']['id'][_0x0946('0x70')](),_0x0946('0x58'))[_0x0946('0x6d')](_0x0946('0x6e'),'createdAt')[_0x0946('0x6d')](_0x0946('0x6e'),_0x0946('0x52'))[_0x0946('0x72')]('cm_contacts')[_0x0946('0x3d')](_0x0946('0x7d'))[_0x0946('0x3d')](_0x0946('0x7e'),_0x174922[_0x0946('0x6f')][_0x0946('0x70')]())[_0x0946('0x3d')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x2aaa4f[_0x0946('0x7f')](db[_0x0946('0x80')][_0x0946('0x31')](_0x7a9d5f));}return BPromise[_0x0946('0x81')](_0x2aaa4f);}})[_0x0946('0x23')](function(){return _0x435f22;})[_0x0946('0x23')](respondWithResult(_0x56bb84,null))[_0x0946('0x4d')](handleError(_0x56bb84,null));};exports[_0x0946('0x86')]=function(_0x5cdbd9,_0x2b7c59,_0x3b1a1a){return db['Campaign'][_0x0946('0x46')]({'where':{'id':_0x5cdbd9[_0x0946('0x50')]['id']}})[_0x0946('0x23')](handleEntityNotFound(_0x2b7c59,null))[_0x0946('0x23')](function(_0x6b8463){if(_0x6b8463){return _0x6b8463[_0x0946('0x86')](_0x5cdbd9[_0x0946('0x31')]['ids']);}})['then'](function(_0x484e33){if(_0x484e33){return db[_0x0946('0x60')][_0x0946('0x26')]({'where':{'ListId':_0x5cdbd9[_0x0946('0x31')][_0x0946('0x64')],'CampaignId':_0x5cdbd9['params']['id']}})['then'](function(){return _0x484e33;});}})[_0x0946('0x23')](respondWithStatusCode(_0x2b7c59,null))[_0x0946('0x4d')](handleError(_0x2b7c59,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index d253355..6343d38 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 _0x8886=['lodash','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns'];(function(_0x41b197,_0x45e597){var _0x351e61=function(_0x54d4f4){while(--_0x54d4f4){_0x41b197['push'](_0x41b197['shift']());}};_0x351e61(++_0x45e597);}(_0x8886,0xd2));var _0x6888=function(_0x411cc8,_0x571c20){_0x411cc8=_0x411cc8-0x0;var _0x2dc97f=_0x8886[_0x411cc8];return _0x2dc97f;};'use strict';var _=require(_0x6888('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6888('0x1'));var rp=require(_0x6888('0x2'));var fs=require('fs');var path=require(_0x6888('0x3'));var rimraf=require(_0x6888('0x4'));var config=require(_0x6888('0x5'));var attributes=require(_0x6888('0x6'));module[_0x6888('0x7')]=function(_0x26deb6,_0x59af86){return _0x26deb6['define'](_0x6888('0x8'),attributes,{'tableName':_0x6888('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde5e=['moment','bluebird','request-promise','rimraf','./campaign.attributes','campaigns','lodash','util','../../config/logger','api'];(function(_0x25278d,_0xcd081c){var _0x58d59f=function(_0x4c5025){while(--_0x4c5025){_0x25278d['push'](_0x25278d['shift']());}};_0x58d59f(++_0xcd081c);}(_0xde5e,0x182));var _0xede5=function(_0x51349a,_0x159c14){_0x51349a=_0x51349a-0x0;var _0x533931=_0xde5e[_0x51349a];return _0x533931;};'use strict';var _=require(_0xede5('0x0'));var util=require(_0xede5('0x1'));var logger=require(_0xede5('0x2'))(_0xede5('0x3'));var moment=require(_0xede5('0x4'));var BPromise=require(_0xede5('0x5'));var rp=require(_0xede5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xede5('0x7'));var config=require('../../config/environment');var attributes=require(_0xede5('0x8'));module['exports']=function(_0x1060b5,_0x1a303a){return _0x1060b5['define']('Campaign',attributes,{'tableName':_0xede5('0x9'),'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 22cfa8a..f800c08 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x126e97,_0x122139){var _0x11d788=function(_0x2411a5){while(--_0x2411a5){_0x126e97['push'](_0x126e97['shift']());}};_0x11d788(++_0x122139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x6046ac,_0x33b4cc){var _0x46137d=function(_0x228042){while(--_0x228042){_0x6046ac['push'](_0x6046ac['shift']());}};_0x46137d(++_0x33b4cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index b4201ce..d39e017 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 _0xc1d6=['../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xc1d6,0x14c));var _0x6c1d=function(_0x3a6d52,_0x11d25a){_0x3a6d52=_0x3a6d52-0x0;var _0x2ae3f7=_0xc1d6[_0x3a6d52];return _0x2ae3f7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6c1d('0x0'));var router=express[_0x6c1d('0x1')]();var auth=require(_0x6c1d('0x2'));var interaction=require(_0x6c1d('0x3'));var config=require(_0x6c1d('0x4'));var controller=require(_0x6c1d('0x5'));router[_0x6c1d('0x6')]('/',auth[_0x6c1d('0x7')](),controller['index']);router[_0x6c1d('0x6')](_0x6c1d('0x8'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x9')]);router[_0x6c1d('0x6')]('/:id/hoppers',auth[_0x6c1d('0x7')](),controller[_0x6c1d('0xa')]);router[_0x6c1d('0x6')]('/:id/hopper_histories',auth[_0x6c1d('0x7')](),controller['getHopperHistories']);router[_0x6c1d('0x6')](_0x6c1d('0xb'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0xc')]);router['get']('/:id/hopper_black',auth[_0x6c1d('0x7')](),controller[_0x6c1d('0xd')]);router[_0x6c1d('0x6')](_0x6c1d('0xe'),auth[_0x6c1d('0x7')](),controller['getLists']);router[_0x6c1d('0x6')](_0x6c1d('0xf'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x10')]);router['post']('/',auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x11')]);router[_0x6c1d('0x12')](_0x6c1d('0x13'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x14')]);router['post'](_0x6c1d('0xe'),auth[_0x6c1d('0x7')](),controller['addLists']);router[_0x6c1d('0x12')](_0x6c1d('0xf'),auth['isAuthenticated'](),controller[_0x6c1d('0x15')]);router[_0x6c1d('0x16')](_0x6c1d('0x8'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x17')]);router[_0x6c1d('0x18')](_0x6c1d('0x8'),auth[_0x6c1d('0x7')](),controller['destroy']);router['delete']('/:id/lists',auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x19')]);router[_0x6c1d('0x18')](_0x6c1d('0xf'),auth[_0x6c1d('0x7')](),controller[_0x6c1d('0x1a')]);module[_0x6c1d('0x1b')]=router; \ No newline at end of file +var _0x1490=['index','/:id','show','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','update','destroy','delete','/:id/lists','removeLists','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1490,0x85));var _0x0149=function(_0x2a5ff2,_0x4b588e){_0x2a5ff2=_0x2a5ff2-0x0;var _0x2a8951=_0x1490[_0x2a5ff2];return _0x2a8951;};'use strict';var multer=require(_0x0149('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0149('0x1'));var express=require('express');var router=express[_0x0149('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x0149('0x3'));var config=require(_0x0149('0x4'));var controller=require(_0x0149('0x5'));router[_0x0149('0x6')]('/',auth['isAuthenticated'](),controller[_0x0149('0x7')]);router[_0x0149('0x6')](_0x0149('0x8'),auth['isAuthenticated'](),controller[_0x0149('0x9')]);router['get']('/:id/hoppers',auth[_0x0149('0xa')](),controller['getHoppers']);router[_0x0149('0x6')](_0x0149('0xb'),auth[_0x0149('0xa')](),controller[_0x0149('0xc')]);router[_0x0149('0x6')](_0x0149('0xd'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x0149('0xa')](),controller[_0x0149('0xe')]);router['get']('/:id/lists',auth[_0x0149('0xa')](),controller[_0x0149('0xf')]);router['get'](_0x0149('0x10'),auth[_0x0149('0xa')](),controller[_0x0149('0x11')]);router[_0x0149('0x12')]('/',auth['isAuthenticated'](),controller[_0x0149('0x13')]);router['post'](_0x0149('0x14'),auth[_0x0149('0xa')](),controller[_0x0149('0x15')]);router[_0x0149('0x12')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router['post'](_0x0149('0x10'),auth[_0x0149('0xa')](),controller[_0x0149('0x16')]);router['put'](_0x0149('0x8'),auth[_0x0149('0xa')](),controller[_0x0149('0x17')]);router['delete'](_0x0149('0x8'),auth[_0x0149('0xa')](),controller[_0x0149('0x18')]);router[_0x0149('0x19')](_0x0149('0x1a'),auth[_0x0149('0xa')](),controller[_0x0149('0x1b')]);router[_0x0149('0x19')](_0x0149('0x10'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6bb34a1..629c958 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 _0x6c89=['VIRTUAL','sequelize','exports','TEXT','STRING'];(function(_0x106337,_0x1d8b2e){var _0x3bc29f=function(_0x3404b6){while(--_0x3404b6){_0x106337['push'](_0x106337['shift']());}};_0x3bc29f(++_0x1d8b2e);}(_0x6c89,0x15a));var _0x96c8=function(_0x19edc6,_0x2834e2){_0x19edc6=_0x19edc6-0x0;var _0x23ad78=_0x6c89[_0x19edc6];return _0x23ad78;};'use strict';var Sequelize=require(_0x96c8('0x0'));module[_0x96c8('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x96c8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x96c8('0x3')]},'name':{'type':Sequelize[_0x96c8('0x4')],'get':function(){return this['getDataValue']('key');}}}; \ No newline at end of file +var _0x9e52=['getDataValue','sequelize','exports','STRING','VIRTUAL'];(function(_0x5e5982,_0x5e9a65){var _0xa20a32=function(_0x5a7900){while(--_0x5a7900){_0x5e5982['push'](_0x5e5982['shift']());}};_0xa20a32(++_0x5e9a65);}(_0x9e52,0x19b));var _0x29e5=function(_0x4178d9,_0x457645){_0x4178d9=_0x4178d9-0x0;var _0x4c0932=_0x9e52[_0x4178d9];return _0x4c0932;};'use strict';var Sequelize=require(_0x29e5('0x0'));module[_0x29e5('0x1')]={'key':{'type':Sequelize[_0x29e5('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x29e5('0x2')]},'name':{'type':Sequelize[_0x29e5('0x3')],'get':function(){return this[_0x29e5('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index ec68c2f..67e1fa1 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 _0xfa7a=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','map','CannedAnswer','rawAttributes','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfa7a,0x18a));var _0xafa7=function(_0x191d63,_0x45830a){_0x191d63=_0x191d63-0x0;var _0x39cbea=_0xfa7a[_0x191d63];return _0x39cbea;};'use strict';var pdf=require(_0xafa7('0x0'));var emlformat=require(_0xafa7('0x1'));var rimraf=require(_0xafa7('0x2'));var zipdir=require(_0xafa7('0x3'));var jsonpatch=require(_0xafa7('0x4'));var rp=require(_0xafa7('0x5'));var moment=require(_0xafa7('0x6'));var BPromise=require(_0xafa7('0x7'));var Mustache=require(_0xafa7('0x8'));var util=require(_0xafa7('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xafa7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xafa7('0xb'));var squel=require('squel');var crypto=require(_0xafa7('0xc'));var jsforce=require(_0xafa7('0xd'));var deskjs=require(_0xafa7('0xe'));var toCsv=require(_0xafa7('0xa'));var querystring=require(_0xafa7('0xf'));var Papa=require(_0xafa7('0x10'));var Redis=require(_0xafa7('0x11'));var authService=require(_0xafa7('0x12'));var qs=require(_0xafa7('0x13'));var as=require(_0xafa7('0x14'));var hardwareService=require(_0xafa7('0x15'));var logger=require(_0xafa7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xafa7('0x17'));var db=require(_0xafa7('0x18'))['db'];function respondWithStatusCode(_0x2063d3,_0x58e2a2){_0x58e2a2=_0x58e2a2||0xcc;return function(_0x171a71){if(_0x171a71){return _0x2063d3[_0xafa7('0x19')](_0x58e2a2);}return _0x2063d3['status'](_0x58e2a2)['end']();};}function respondWithResult(_0x3571a9,_0x23a4a1){_0x23a4a1=_0x23a4a1||0xc8;return function(_0x131ee4){if(_0x131ee4){return _0x3571a9[_0xafa7('0x1a')](_0x23a4a1)['json'](_0x131ee4);}};}function respondWithFilteredResult(_0x1f7b5b,_0x1b3d91){return function(_0x40e3b2){if(_0x40e3b2){var _0x1fffcb=_0x40e3b2[_0xafa7('0x1b')],_0x1ad171=_0x1b3d91[_0xafa7('0x1c')],_0x434604=_0x1b3d91[_0xafa7('0x1c')]+_0x1b3d91[_0xafa7('0x1d')],_0x1697bd;if(_0x434604>=_0x1fffcb){_0x434604=_0x1fffcb;_0x1697bd=0xc8;}else{_0x1697bd=0xce;}_0x1f7b5b[_0xafa7('0x1a')](_0x1697bd);return _0x1f7b5b['set']('Content-Range',_0x1ad171+'-'+_0x434604+'/'+_0x1fffcb)[_0xafa7('0x1e')](_0x40e3b2);}return null;};}function patchUpdates(_0x14084a){return function(_0x5e9c02){try{jsonpatch[_0xafa7('0x1f')](_0x5e9c02,_0x14084a,!![]);}catch(_0x39d50d){return BPromise[_0xafa7('0x20')](_0x39d50d);}return _0x5e9c02[_0xafa7('0x21')]();};}function saveUpdates(_0x2a91a4,_0x5d7488){return function(_0x203ee2){if(_0x203ee2){return _0x203ee2['update'](_0x2a91a4)[_0xafa7('0x22')](function(_0x34f31){return _0x34f31;});}return null;};}function removeEntity(_0x2a9e98,_0x544848){return function(_0x3ee374){if(_0x3ee374){return _0x3ee374[_0xafa7('0x23')]()[_0xafa7('0x22')](function(){var _0x4ff5c8=_0x3ee374[_0xafa7('0x24')]({'plain':!![]});var _0x196db3=_0xafa7('0x25');return db[_0xafa7('0x26')]['destroy']({'where':{'type':_0x196db3,'resourceId':_0x4ff5c8['id']}})['then'](function(){return _0x3ee374;});})[_0xafa7('0x22')](function(){_0x2a9e98[_0xafa7('0x1a')](0xcc)[_0xafa7('0x27')]();});}};}function handleEntityNotFound(_0x580d73,_0x5e30d8){return function(_0x11c3c8){if(!_0x11c3c8){_0x580d73[_0xafa7('0x19')](0x194);}return _0x11c3c8;};}function handleError(_0x154de8,_0x141066){_0x141066=_0x141066||0x1f4;return function(_0x315a26){logger[_0xafa7('0x28')](_0x315a26[_0xafa7('0x29')]);if(_0x315a26[_0xafa7('0x2a')]){delete _0x315a26[_0xafa7('0x2a')];}_0x154de8['status'](_0x141066)['send'](_0x315a26);};}exports['index']=function(_0x18ad3a,_0x3a8769){var _0x2470fb={},_0x806fb4={},_0x476cf5={'count':0x0,'rows':[]};var _0x5a4c42=_[_0xafa7('0x2b')](db[_0xafa7('0x2c')][_0xafa7('0x2d')],function(_0x10a3d1){return{'name':_0x10a3d1['fieldName'],'type':_0x10a3d1[_0xafa7('0x2e')]['key']};});_0x806fb4['model']=_[_0xafa7('0x2b')](_0x5a4c42,_0xafa7('0x2a'));_0x806fb4['query']=_[_0xafa7('0x2f')](_0x18ad3a[_0xafa7('0x30')]);_0x806fb4[_0xafa7('0x31')]=_[_0xafa7('0x32')](_0x806fb4['model'],_0x806fb4[_0xafa7('0x30')]);_0x2470fb['attributes']=_[_0xafa7('0x32')](_0x806fb4[_0xafa7('0x33')],qs[_0xafa7('0x34')](_0x18ad3a['query'][_0xafa7('0x34')]));_0x2470fb[_0xafa7('0x35')]=_0x2470fb[_0xafa7('0x35')][_0xafa7('0x36')]?_0x2470fb[_0xafa7('0x35')]:_0x806fb4[_0xafa7('0x33')];if(!_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x37')]('nolimit')){_0x2470fb['limit']=qs[_0xafa7('0x1d')](_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x1d')]);_0x2470fb[_0xafa7('0x1c')]=qs[_0xafa7('0x1c')](_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x1c')]);}_0x2470fb[_0xafa7('0x38')]=qs[_0xafa7('0x39')](_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x39')]);_0x2470fb[_0xafa7('0x3a')]=qs[_0xafa7('0x31')](_['pick'](_0x18ad3a[_0xafa7('0x30')],_0x806fb4[_0xafa7('0x31')]),_0x5a4c42);if(_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x3b')]){_0x2470fb[_0xafa7('0x3a')]=_['merge'](_0x2470fb['where'],{'$or':_[_0xafa7('0x2b')](_0x5a4c42,function(_0x1faf0d){if(_0x1faf0d[_0xafa7('0x2e')]!=='VIRTUAL'){var _0xd48925={};_0xd48925[_0x1faf0d['name']]={'$like':'%'+_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x3b')]+'%'};return _0xd48925;}})});}_0x2470fb=_['merge']({},_0x2470fb,_0x18ad3a[_0xafa7('0x3c')]);var _0x3054d4={'where':_0x2470fb[_0xafa7('0x3a')]};return db[_0xafa7('0x2c')][_0xafa7('0x1b')](_0x3054d4)[_0xafa7('0x22')](function(_0x3996c1){_0x476cf5['count']=_0x3996c1;if(_0x18ad3a[_0xafa7('0x30')][_0xafa7('0x3d')]){_0x2470fb[_0xafa7('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xafa7('0x3f')](_0x2470fb);})[_0xafa7('0x22')](function(_0x586785){_0x476cf5[_0xafa7('0x40')]=_0x586785;return _0x476cf5;})[_0xafa7('0x22')](respondWithFilteredResult(_0x3a8769,_0x2470fb))[_0xafa7('0x41')](handleError(_0x3a8769,null));};exports[_0xafa7('0x42')]=function(_0x41bb17,_0x4db334){var _0x1290cf={'raw':!![],'where':{'id':_0x41bb17[_0xafa7('0x43')]['id']}},_0x4f6dc1={};_0x4f6dc1[_0xafa7('0x33')]=_[_0xafa7('0x2f')](db['CannedAnswer'][_0xafa7('0x2d')]);_0x4f6dc1[_0xafa7('0x30')]=_['keys'](_0x41bb17[_0xafa7('0x30')]);_0x4f6dc1[_0xafa7('0x31')]=_['intersection'](_0x4f6dc1[_0xafa7('0x33')],_0x4f6dc1[_0xafa7('0x30')]);_0x1290cf[_0xafa7('0x35')]=_[_0xafa7('0x32')](_0x4f6dc1['model'],qs[_0xafa7('0x34')](_0x41bb17[_0xafa7('0x30')][_0xafa7('0x34')]));_0x1290cf[_0xafa7('0x35')]=_0x1290cf[_0xafa7('0x35')][_0xafa7('0x36')]?_0x1290cf[_0xafa7('0x35')]:_0x4f6dc1['model'];if(_0x41bb17['query'][_0xafa7('0x3d')]){_0x1290cf['include']=[{'all':!![]}];}_0x1290cf=_['merge']({},_0x1290cf,_0x41bb17[_0xafa7('0x3c')]);return db[_0xafa7('0x2c')][_0xafa7('0x44')](_0x1290cf)[_0xafa7('0x22')](handleEntityNotFound(_0x4db334,null))[_0xafa7('0x22')](respondWithResult(_0x4db334,null))[_0xafa7('0x41')](handleError(_0x4db334,null));};exports[_0xafa7('0x45')]=function(_0x128025,_0x3eecb2){if(_0x128025[_0xafa7('0x46')]['id']){delete _0x128025[_0xafa7('0x46')]['id'];}return db[_0xafa7('0x2c')][_0xafa7('0x44')]({'where':{'id':_0x128025[_0xafa7('0x43')]['id']}})[_0xafa7('0x22')](handleEntityNotFound(_0x3eecb2,null))[_0xafa7('0x22')](saveUpdates(_0x128025[_0xafa7('0x46')],null))['then'](respondWithResult(_0x3eecb2,null))['catch'](handleError(_0x3eecb2,null));};exports[_0xafa7('0x23')]=function(_0x2591a6,_0x5a58fa){return db['CannedAnswer'][_0xafa7('0x44')]({'where':{'id':_0x2591a6[_0xafa7('0x43')]['id']}})[_0xafa7('0x22')](handleEntityNotFound(_0x5a58fa,null))[_0xafa7('0x22')](removeEntity(_0x5a58fa,null))[_0xafa7('0x41')](handleError(_0x5a58fa,null));};exports[_0xafa7('0x47')]=function(_0x38f6ed,_0x34bdf4){var _0x802ebb={'key':_0x38f6ed[_0xafa7('0x46')]['key']};if(_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x48')]){_0x802ebb[_0xafa7('0x48')]=_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x48')];}else if(_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x49')]){_0x802ebb['SmsAccountId']=_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x49')];}else if(_0x38f6ed[_0xafa7('0x46')]['OpenchannelAccountId']){_0x802ebb[_0xafa7('0x4a')]=_0x38f6ed[_0xafa7('0x46')]['OpenchannelAccountId'];}else if(_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x4b')]){_0x802ebb[_0xafa7('0x4b')]=_0x38f6ed[_0xafa7('0x46')][_0xafa7('0x4b')];}return db[_0xafa7('0x2c')]['find']({'where':_0x802ebb})['then'](function(_0xe0d968){if(_0xe0d968){throw new db['Sequelize']['ValidationError'](_0xafa7('0x4c'));}return db['CannedAnswer'][_0xafa7('0x47')](_0x38f6ed[_0xafa7('0x46')]);})['then'](function(_0x437573){var _0x27a9b5=_0x38f6ed[_0xafa7('0x4d')]['get']({'plain':!![]});if(!_0x27a9b5)throw new Error(_0xafa7('0x4e'));if(_0x27a9b5[_0xafa7('0x4f')]==='user'){var _0x5d82dd=_0x437573[_0xafa7('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xafa7('0x44')]({'where':{'name':_0xafa7('0x25'),'userProfileId':_0x27a9b5[_0xafa7('0x50')]},'raw':!![]})[_0xafa7('0x22')](function(_0x28588b){if(_0x28588b&&_0x28588b['autoAssociation']===0x0){return db[_0xafa7('0x26')][_0xafa7('0x47')]({'name':_0x5d82dd[_0xafa7('0x2a')],'resourceId':_0x5d82dd['id'],'type':_0x28588b[_0xafa7('0x2a')],'sectionId':_0x28588b['id']},{})['then'](function(){return _0x437573;});}else{return _0x437573;}})[_0xafa7('0x41')](function(_0x491fc3){logger[_0xafa7('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x491fc3);throw _0x491fc3;});}return _0x437573;})[_0xafa7('0x22')](respondWithResult(_0x34bdf4,0xc9))['catch'](handleError(_0x34bdf4,null));}; \ No newline at end of file +var _0xa1ce=['find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','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','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','show','params'];(function(_0xc54ea3,_0x580076){var _0x304df0=function(_0x3f866a){while(--_0x3f866a){_0xc54ea3['push'](_0xc54ea3['shift']());}};_0x304df0(++_0x580076);}(_0xa1ce,0x10f));var _0xea1c=function(_0x5e0860,_0x122b5a){_0x5e0860=_0x5e0860-0x0;var _0x53f01e=_0xa1ce[_0x5e0860];return _0x53f01e;};'use strict';var pdf=require(_0xea1c('0x0'));var emlformat=require(_0xea1c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea1c('0x2'));var jsonpatch=require(_0xea1c('0x3'));var rp=require(_0xea1c('0x4'));var moment=require(_0xea1c('0x5'));var BPromise=require(_0xea1c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea1c('0x7'));var sox=require(_0xea1c('0x8'));var csv=require(_0xea1c('0x9'));var ejs=require(_0xea1c('0xa'));var fs=require('fs');var _=require(_0xea1c('0xb'));var squel=require(_0xea1c('0xc'));var crypto=require(_0xea1c('0xd'));var jsforce=require(_0xea1c('0xe'));var deskjs=require(_0xea1c('0xf'));var toCsv=require(_0xea1c('0x9'));var querystring=require('querystring');var Papa=require(_0xea1c('0x10'));var Redis=require(_0xea1c('0x11'));var authService=require(_0xea1c('0x12'));var qs=require(_0xea1c('0x13'));var as=require(_0xea1c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea1c('0x15'))(_0xea1c('0x16'));var utils=require(_0xea1c('0x17'));var config=require(_0xea1c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6757cc,_0x20d0c8){_0x20d0c8=_0x20d0c8||0xcc;return function(_0x5642df){if(_0x5642df){return _0x6757cc['sendStatus'](_0x20d0c8);}return _0x6757cc[_0xea1c('0x19')](_0x20d0c8)['end']();};}function respondWithResult(_0x1c3767,_0xa085eb){_0xa085eb=_0xa085eb||0xc8;return function(_0x5881fa){if(_0x5881fa){return _0x1c3767[_0xea1c('0x19')](_0xa085eb)[_0xea1c('0x1a')](_0x5881fa);}};}function respondWithFilteredResult(_0x198870,_0x111b3a){return function(_0x1d923e){if(_0x1d923e){var _0x5d6693=_0x1d923e[_0xea1c('0x1b')],_0x2d13e3=_0x111b3a['offset'],_0x3e1ac4=_0x111b3a[_0xea1c('0x1c')]+_0x111b3a[_0xea1c('0x1d')],_0xc36ed0;if(_0x3e1ac4>=_0x5d6693){_0x3e1ac4=_0x5d6693;_0xc36ed0=0xc8;}else{_0xc36ed0=0xce;}_0x198870[_0xea1c('0x19')](_0xc36ed0);return _0x198870[_0xea1c('0x1e')](_0xea1c('0x1f'),_0x2d13e3+'-'+_0x3e1ac4+'/'+_0x5d6693)['json'](_0x1d923e);}return null;};}function patchUpdates(_0x1973b1){return function(_0x25f784){try{jsonpatch['apply'](_0x25f784,_0x1973b1,!![]);}catch(_0x28fbc1){return BPromise[_0xea1c('0x20')](_0x28fbc1);}return _0x25f784[_0xea1c('0x21')]();};}function saveUpdates(_0x4053b2,_0x4a9611){return function(_0x10810d){if(_0x10810d){return _0x10810d[_0xea1c('0x22')](_0x4053b2)[_0xea1c('0x23')](function(_0x58b305){return _0x58b305;});}return null;};}function removeEntity(_0x519762,_0x50af21){return function(_0x23260a){if(_0x23260a){return _0x23260a[_0xea1c('0x24')]()[_0xea1c('0x23')](function(){var _0x31f355=_0x23260a[_0xea1c('0x25')]({'plain':!![]});var _0x31459f='CannedAnswers';return db[_0xea1c('0x26')]['destroy']({'where':{'type':_0x31459f,'resourceId':_0x31f355['id']}})[_0xea1c('0x23')](function(){return _0x23260a;});})[_0xea1c('0x23')](function(){_0x519762[_0xea1c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47f79d,_0x3fcb5d){return function(_0x233ed8){if(!_0x233ed8){_0x47f79d[_0xea1c('0x27')](0x194);}return _0x233ed8;};}function handleError(_0xc08674,_0x30bca5){_0x30bca5=_0x30bca5||0x1f4;return function(_0x43ffc3){logger[_0xea1c('0x28')](_0x43ffc3[_0xea1c('0x29')]);if(_0x43ffc3[_0xea1c('0x2a')]){delete _0x43ffc3[_0xea1c('0x2a')];}_0xc08674[_0xea1c('0x19')](_0x30bca5)[_0xea1c('0x2b')](_0x43ffc3);};}exports[_0xea1c('0x2c')]=function(_0x3260be,_0x232e3f){var _0x177b99={},_0xece098={},_0x4bd03d={'count':0x0,'rows':[]};var _0x516e38=_[_0xea1c('0x2d')](db[_0xea1c('0x2e')][_0xea1c('0x2f')],function(_0x3c92c7){return{'name':_0x3c92c7[_0xea1c('0x30')],'type':_0x3c92c7[_0xea1c('0x31')][_0xea1c('0x32')]};});_0xece098['model']=_[_0xea1c('0x2d')](_0x516e38,'name');_0xece098[_0xea1c('0x33')]=_[_0xea1c('0x34')](_0x3260be[_0xea1c('0x33')]);_0xece098[_0xea1c('0x35')]=_[_0xea1c('0x36')](_0xece098[_0xea1c('0x37')],_0xece098[_0xea1c('0x33')]);_0x177b99[_0xea1c('0x38')]=_[_0xea1c('0x36')](_0xece098[_0xea1c('0x37')],qs[_0xea1c('0x39')](_0x3260be[_0xea1c('0x33')][_0xea1c('0x39')]));_0x177b99[_0xea1c('0x38')]=_0x177b99[_0xea1c('0x38')][_0xea1c('0x3a')]?_0x177b99['attributes']:_0xece098[_0xea1c('0x37')];if(!_0x3260be[_0xea1c('0x33')][_0xea1c('0x3b')]('nolimit')){_0x177b99[_0xea1c('0x1d')]=qs[_0xea1c('0x1d')](_0x3260be[_0xea1c('0x33')]['limit']);_0x177b99['offset']=qs[_0xea1c('0x1c')](_0x3260be[_0xea1c('0x33')][_0xea1c('0x1c')]);}_0x177b99[_0xea1c('0x3c')]=qs[_0xea1c('0x3d')](_0x3260be[_0xea1c('0x33')]['sort']);_0x177b99['where']=qs['filters'](_[_0xea1c('0x3e')](_0x3260be[_0xea1c('0x33')],_0xece098[_0xea1c('0x35')]),_0x516e38);if(_0x3260be[_0xea1c('0x33')][_0xea1c('0x3f')]){_0x177b99['where']=_[_0xea1c('0x40')](_0x177b99[_0xea1c('0x41')],{'$or':_[_0xea1c('0x2d')](_0x516e38,function(_0x28fef7){if(_0x28fef7[_0xea1c('0x31')]!==_0xea1c('0x42')){var _0x40e681={};_0x40e681[_0x28fef7['name']]={'$like':'%'+_0x3260be[_0xea1c('0x33')]['filter']+'%'};return _0x40e681;}})});}_0x177b99=_['merge']({},_0x177b99,_0x3260be[_0xea1c('0x43')]);var _0xb101d1={'where':_0x177b99['where']};return db[_0xea1c('0x2e')][_0xea1c('0x1b')](_0xb101d1)[_0xea1c('0x23')](function(_0x585e2a){_0x4bd03d['count']=_0x585e2a;if(_0x3260be[_0xea1c('0x33')][_0xea1c('0x44')]){_0x177b99[_0xea1c('0x45')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x177b99);})[_0xea1c('0x23')](function(_0x45e57a){_0x4bd03d['rows']=_0x45e57a;return _0x4bd03d;})[_0xea1c('0x23')](respondWithFilteredResult(_0x232e3f,_0x177b99))[_0xea1c('0x46')](handleError(_0x232e3f,null));};exports[_0xea1c('0x47')]=function(_0x5cb494,_0x137511){var _0x36c40e={'raw':!![],'where':{'id':_0x5cb494[_0xea1c('0x48')]['id']}},_0x183b07={};_0x183b07[_0xea1c('0x37')]=_[_0xea1c('0x34')](db[_0xea1c('0x2e')][_0xea1c('0x2f')]);_0x183b07['query']=_[_0xea1c('0x34')](_0x5cb494['query']);_0x183b07['filters']=_[_0xea1c('0x36')](_0x183b07[_0xea1c('0x37')],_0x183b07[_0xea1c('0x33')]);_0x36c40e['attributes']=_[_0xea1c('0x36')](_0x183b07[_0xea1c('0x37')],qs[_0xea1c('0x39')](_0x5cb494[_0xea1c('0x33')][_0xea1c('0x39')]));_0x36c40e[_0xea1c('0x38')]=_0x36c40e[_0xea1c('0x38')]['length']?_0x36c40e[_0xea1c('0x38')]:_0x183b07[_0xea1c('0x37')];if(_0x5cb494[_0xea1c('0x33')]['includeAll']){_0x36c40e[_0xea1c('0x45')]=[{'all':!![]}];}_0x36c40e=_[_0xea1c('0x40')]({},_0x36c40e,_0x5cb494[_0xea1c('0x43')]);return db[_0xea1c('0x2e')][_0xea1c('0x49')](_0x36c40e)['then'](handleEntityNotFound(_0x137511,null))[_0xea1c('0x23')](respondWithResult(_0x137511,null))[_0xea1c('0x46')](handleError(_0x137511,null));};exports[_0xea1c('0x22')]=function(_0x1674e0,_0xf446aa){if(_0x1674e0['body']['id']){delete _0x1674e0[_0xea1c('0x4a')]['id'];}return db[_0xea1c('0x2e')][_0xea1c('0x49')]({'where':{'id':_0x1674e0['params']['id']}})[_0xea1c('0x23')](handleEntityNotFound(_0xf446aa,null))[_0xea1c('0x23')](saveUpdates(_0x1674e0['body'],null))[_0xea1c('0x23')](respondWithResult(_0xf446aa,null))[_0xea1c('0x46')](handleError(_0xf446aa,null));};exports['destroy']=function(_0x5ccc54,_0x216ea2){return db[_0xea1c('0x2e')][_0xea1c('0x49')]({'where':{'id':_0x5ccc54['params']['id']}})[_0xea1c('0x23')](handleEntityNotFound(_0x216ea2,null))[_0xea1c('0x23')](removeEntity(_0x216ea2,null))['catch'](handleError(_0x216ea2,null));};exports[_0xea1c('0x4b')]=function(_0x235f62,_0x4bc455){var _0x5b95ac={'key':_0x235f62['body'][_0xea1c('0x32')]};if(_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4c')]){_0x5b95ac['MailAccountId']=_0x235f62['body'][_0xea1c('0x4c')];}else if(_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4d')]){_0x5b95ac[_0xea1c('0x4d')]=_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4d')];}else if(_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4e')]){_0x5b95ac[_0xea1c('0x4e')]=_0x235f62['body'][_0xea1c('0x4e')];}else if(_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4f')]){_0x5b95ac['ChatWebsiteId']=_0x235f62[_0xea1c('0x4a')][_0xea1c('0x4f')];}return db[_0xea1c('0x2e')][_0xea1c('0x49')]({'where':_0x5b95ac})[_0xea1c('0x23')](function(_0x31c68a){if(_0x31c68a){throw new db['Sequelize'][(_0xea1c('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xea1c('0x2e')][_0xea1c('0x4b')](_0x235f62[_0xea1c('0x4a')]);})[_0xea1c('0x23')](function(_0x3a8db5){var _0x10efbb=_0x235f62[_0xea1c('0x51')]['get']({'plain':!![]});if(!_0x10efbb)throw new Error(_0xea1c('0x52'));if(_0x10efbb[_0xea1c('0x53')]===_0xea1c('0x51')){var _0x3e6313=_0x3a8db5[_0xea1c('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xea1c('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x10efbb[_0xea1c('0x54')]},'raw':!![]})['then'](function(_0x18b55a){if(_0x18b55a&&_0x18b55a[_0xea1c('0x55')]===0x0){return db[_0xea1c('0x26')]['create']({'name':_0x3e6313['name'],'resourceId':_0x3e6313['id'],'type':_0x18b55a['name'],'sectionId':_0x18b55a['id']},{})[_0xea1c('0x23')](function(){return _0x3a8db5;});}else{return _0x3a8db5;}})['catch'](function(_0x4b35da){logger[_0xea1c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b35da);throw _0x4b35da;});}return _0x3a8db5;})[_0xea1c('0x23')](respondWithResult(_0x4bc455,0xc9))[_0xea1c('0x46')](handleError(_0x4bc455,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9d70c19..3ec1e78 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 _0xac0b=['path','rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0xac0b,0x164));var _0xbac0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xac0b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbac0('0x0'));var util=require(_0xbac0('0x1'));var logger=require(_0xbac0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbac0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbac0('0x4'));var rimraf=require(_0xbac0('0x5'));var config=require(_0xbac0('0x6'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4ada50,_0x3f73f9){return _0x4ada50[_0xbac0('0x7')](_0xbac0('0x8'),attributes,{'tableName':_0xbac0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbac0('0xa'),'collate':_0xbac0('0xb')});}; \ No newline at end of file +var _0xbe85=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xbe85,0x19c));var _0x5be8=function(_0x1820d7,_0x5ef72d){_0x1820d7=_0x1820d7-0x0;var _0x56d616=_0xbe85[_0x1820d7];return _0x56d616;};'use strict';var _=require(_0x5be8('0x0'));var util=require(_0x5be8('0x1'));var logger=require(_0x5be8('0x2'))('api');var moment=require(_0x5be8('0x3'));var BPromise=require(_0x5be8('0x4'));var rp=require(_0x5be8('0x5'));var fs=require('fs');var path=require(_0x5be8('0x6'));var rimraf=require(_0x5be8('0x7'));var config=require(_0x5be8('0x8'));var attributes=require(_0x5be8('0x9'));module[_0x5be8('0xa')]=function(_0x29fadb,_0x40ee6c){return _0x29fadb[_0x5be8('0xb')](_0x5be8('0xc'),attributes,{'tableName':_0x5be8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5be8('0xe'),'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 e386c25..28c950c 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 _0xf0fb=['debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info'];(function(_0x2b81b5,_0x485df9){var _0x275868=function(_0x1412ea){while(--_0x1412ea){_0x2b81b5['push'](_0x2b81b5['shift']());}};_0x275868(++_0x485df9);}(_0xf0fb,0x134));var _0xbf0f=function(_0xb2120f,_0x1e23c1){_0xb2120f=_0xb2120f-0x0;var _0x3b8dd9=_0xf0fb[_0xb2120f];return _0x3b8dd9;};'use strict';var _=require('lodash');var util=require(_0xbf0f('0x0'));var moment=require(_0xbf0f('0x1'));var BPromise=require(_0xbf0f('0x2'));var rs=require(_0xbf0f('0x3'));var fs=require('fs');var Redis=require(_0xbf0f('0x4'));var db=require(_0xbf0f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf0f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf0f('0x7')][_0xbf0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48ca69,_0x1f3bcd,_0x647b3b){return new BPromise(function(_0x2df22e,_0x1001ef){return client[_0xbf0f('0x9')](_0x48ca69,_0x647b3b)[_0xbf0f('0xa')](function(_0x1cce1f){logger[_0xbf0f('0xb')]('CannedAnswer,\x20%s,\x20%s',_0x1f3bcd,'request\x20sent');logger[_0xbf0f('0xc')](_0xbf0f('0xd'),_0x1f3bcd,'request\x20sent',JSON[_0xbf0f('0xe')](_0x1cce1f));if(_0x1cce1f[_0xbf0f('0xf')]){if(_0x1cce1f[_0xbf0f('0xf')][_0xbf0f('0x10')]===0x1f4){logger[_0xbf0f('0xf')](_0xbf0f('0x11'),_0x1f3bcd,_0x1cce1f[_0xbf0f('0xf')][_0xbf0f('0x12')]);return _0x1001ef(_0x1cce1f['error'][_0xbf0f('0x12')]);}logger['error'](_0xbf0f('0x11'),_0x1f3bcd,_0x1cce1f[_0xbf0f('0xf')][_0xbf0f('0x12')]);return _0x2df22e(_0x1cce1f[_0xbf0f('0xf')][_0xbf0f('0x12')]);}else{logger[_0xbf0f('0xb')](_0xbf0f('0x11'),_0x1f3bcd,'request\x20sent');_0x2df22e(_0x1cce1f[_0xbf0f('0x13')][_0xbf0f('0x12')]);}})['catch'](function(_0xa9920f){logger[_0xbf0f('0xf')](_0xbf0f('0x11'),_0x1f3bcd,_0xa9920f);_0x1001ef(_0xa9920f);});});} \ No newline at end of file +var _0xe04a=['code','error','CannedAnswer,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x533b02,_0x1afe6a){var _0x174eec=function(_0x428c5a){while(--_0x428c5a){_0x533b02['push'](_0x533b02['shift']());}};_0x174eec(++_0x1afe6a);}(_0xe04a,0x150));var _0xae04=function(_0x2c7fdb,_0x1e2c50){_0x2c7fdb=_0x2c7fdb-0x0;var _0x25640d=_0xe04a[_0x2c7fdb];return _0x25640d;};'use strict';var _=require('lodash');var util=require(_0xae04('0x0'));var moment=require(_0xae04('0x1'));var BPromise=require(_0xae04('0x2'));var rs=require(_0xae04('0x3'));var fs=require('fs');var Redis=require(_0xae04('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xae04('0x5'))(_0xae04('0x6'));var config=require(_0xae04('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xae04('0x8')][_0xae04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa93b67,_0x138a6d,_0x2e698e){return new BPromise(function(_0x29f6c1,_0x39fb63){return client[_0xae04('0xa')](_0xa93b67,_0x2e698e)[_0xae04('0xb')](function(_0x386f0b){logger[_0xae04('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x138a6d,_0xae04('0xd'));logger[_0xae04('0xe')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x138a6d,_0xae04('0xd'),JSON[_0xae04('0xf')](_0x386f0b));if(_0x386f0b['error']){if(_0x386f0b['error'][_0xae04('0x10')]===0x1f4){logger[_0xae04('0x11')](_0xae04('0x12'),_0x138a6d,_0x386f0b[_0xae04('0x11')][_0xae04('0x13')]);return _0x39fb63(_0x386f0b[_0xae04('0x11')]['message']);}logger[_0xae04('0x11')](_0xae04('0x12'),_0x138a6d,_0x386f0b[_0xae04('0x11')]['message']);return _0x29f6c1(_0x386f0b['error'][_0xae04('0x13')]);}else{logger[_0xae04('0xc')](_0xae04('0x12'),_0x138a6d,_0xae04('0xd'));_0x29f6c1(_0x386f0b[_0xae04('0x14')][_0xae04('0x13')]);}})[_0xae04('0x15')](function(_0x1d3188){logger['error'](_0xae04('0x12'),_0x138a6d,_0x1d3188);_0x39fb63(_0x1d3188);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index edc7b38..e8d7228 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 _0x4111=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4111,0x91));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var path=require(_0x1411('0x2'));var timeout=require(_0x1411('0x3'));var express=require('express');var router=express[_0x1411('0x4')]();var auth=require(_0x1411('0x5'));var interaction=require(_0x1411('0x6'));var config=require(_0x1411('0x7'));var controller=require(_0x1411('0x8'));router[_0x1411('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1411('0x9')](_0x1411('0xa'),auth[_0x1411('0xb')](),controller[_0x1411('0xc')]);router[_0x1411('0xd')]('/',auth[_0x1411('0xb')](),controller['create']);router[_0x1411('0xe')](_0x1411('0xa'),auth[_0x1411('0xb')](),controller[_0x1411('0xf')]);router[_0x1411('0x10')](_0x1411('0xa'),auth[_0x1411('0xb')](),controller[_0x1411('0x11')]);module['exports']=router; \ No newline at end of file +var _0x004c=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','util'];(function(_0x14da03,_0x28538b){var _0x19aa67=function(_0x496db4){while(--_0x496db4){_0x14da03['push'](_0x14da03['shift']());}};_0x19aa67(++_0x28538b);}(_0x004c,0x76));var _0xc004=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x004c[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require('multer');var util=require(_0xc004('0x0'));var path=require(_0xc004('0x1'));var timeout=require(_0xc004('0x2'));var express=require(_0xc004('0x3'));var router=express['Router']();var auth=require(_0xc004('0x4'));var interaction=require(_0xc004('0x5'));var config=require(_0xc004('0x6'));var controller=require(_0xc004('0x7'));router[_0xc004('0x8')]('/',auth[_0xc004('0x9')](),controller[_0xc004('0xa')]);router[_0xc004('0x8')](_0xc004('0xb'),auth[_0xc004('0x9')](),controller[_0xc004('0xc')]);router['post']('/',auth[_0xc004('0x9')](),controller['create']);router[_0xc004('0xd')](_0xc004('0xb'),auth[_0xc004('0x9')](),controller[_0xc004('0xe')]);router[_0xc004('0xf')](_0xc004('0xb'),auth[_0xc004('0x9')](),controller['destroy']);module[_0xc004('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 6703268..fe38f86 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 _0x9c6a=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x56b04a,_0x1a28e8){var _0x33b980=function(_0x577095){while(--_0x577095){_0x56b04a['push'](_0x56b04a['shift']());}};_0x33b980(++_0x1a28e8);}(_0x9c6a,0x8a));var _0xa9c6=function(_0xd17f74,_0x1ff030){_0xd17f74=_0xd17f74-0x0;var _0x103861=_0x9c6a[_0xd17f74];return _0x103861;};'use strict';var Sequelize=require('sequelize');module[_0xa9c6('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xa9c6('0x1')},'clid':{'type':Sequelize[_0xa9c6('0x2')]},'src':{'type':Sequelize[_0xa9c6('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa9c6('0x2')]},'dstchannel':{'type':Sequelize[_0xa9c6('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xa9c6('0x2')]},'duration':{'type':Sequelize[_0xa9c6('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa9c6('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa9c6('0x2')]},'userfield':{'type':Sequelize[_0xa9c6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xa9c6('0x2')]},'peeraccount':{'type':Sequelize[_0xa9c6('0x2')]},'type':{'type':Sequelize[_0xa9c6('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0c6c=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x0c6c,0x183));var _0xc0c6=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0x0c6c[_0x3d18af];return _0x2ef919;};'use strict';var Sequelize=require(_0xc0c6('0x0'));module[_0xc0c6('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xc0c6('0x2')},'clid':{'type':Sequelize[_0xc0c6('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xc0c6('0x3')]},'lastdata':{'type':Sequelize[_0xc0c6('0x3')]},'duration':{'type':Sequelize[_0xc0c6('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc0c6('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xc0c6('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc0c6('0x3')]},'userfield':{'type':Sequelize[_0xc0c6('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc0c6('0x3')]},'peeraccount':{'type':Sequelize[_0xc0c6('0x3')]},'type':{'type':Sequelize[_0xc0c6('0x3')]},'tag':{'type':Sequelize[_0xc0c6('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index e55182b..b5d22d8 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 _0x16da=['where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','error','stack','send','index','Cdr','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x16da,0xaa));var _0xa16d=function(_0x174f86,_0x39e952){_0x174f86=_0x174f86-0x0;var _0x5c12e9=_0x16da[_0x174f86];return _0x5c12e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa16d('0x0'));var rimraf=require(_0xa16d('0x1'));var zipdir=require(_0xa16d('0x2'));var jsonpatch=require(_0xa16d('0x3'));var rp=require(_0xa16d('0x4'));var moment=require(_0xa16d('0x5'));var BPromise=require(_0xa16d('0x6'));var Mustache=require(_0xa16d('0x7'));var util=require(_0xa16d('0x8'));var path=require(_0xa16d('0x9'));var sox=require(_0xa16d('0xa'));var csv=require(_0xa16d('0xb'));var ejs=require(_0xa16d('0xc'));var fs=require('fs');var _=require(_0xa16d('0xd'));var squel=require(_0xa16d('0xe'));var crypto=require(_0xa16d('0xf'));var jsforce=require(_0xa16d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa16d('0xb'));var querystring=require(_0xa16d('0x11'));var Papa=require(_0xa16d('0x12'));var Redis=require(_0xa16d('0x13'));var authService=require(_0xa16d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa16d('0x15'));var logger=require(_0xa16d('0x16'))('api');var utils=require(_0xa16d('0x17'));var config=require(_0xa16d('0x18'));var db=require(_0xa16d('0x19'))['db'];function respondWithStatusCode(_0x59a5e3,_0x237649){_0x237649=_0x237649||0xcc;return function(_0x32b6b1){if(_0x32b6b1){return _0x59a5e3[_0xa16d('0x1a')](_0x237649);}return _0x59a5e3[_0xa16d('0x1b')](_0x237649)[_0xa16d('0x1c')]();};}function respondWithResult(_0x506e98,_0x31e31b){_0x31e31b=_0x31e31b||0xc8;return function(_0x3e3583){if(_0x3e3583){return _0x506e98['status'](_0x31e31b)[_0xa16d('0x1d')](_0x3e3583);}};}function respondWithFilteredResult(_0x1c20a8,_0x1a8301){return function(_0x508027){if(_0x508027){var _0x335fbd=_0x508027[_0xa16d('0x1e')],_0x132f60=_0x1a8301[_0xa16d('0x1f')],_0x5bb209=_0x1a8301['offset']+_0x1a8301[_0xa16d('0x20')],_0x1545ab;if(_0x5bb209>=_0x335fbd){_0x5bb209=_0x335fbd;_0x1545ab=0xc8;}else{_0x1545ab=0xce;}_0x1c20a8[_0xa16d('0x1b')](_0x1545ab);return _0x1c20a8[_0xa16d('0x21')](_0xa16d('0x22'),_0x132f60+'-'+_0x5bb209+'/'+_0x335fbd)[_0xa16d('0x1d')](_0x508027);}return null;};}function patchUpdates(_0x536fdb){return function(_0x5eefd5){try{jsonpatch['apply'](_0x5eefd5,_0x536fdb,!![]);}catch(_0x32c1ee){return BPromise[_0xa16d('0x23')](_0x32c1ee);}return _0x5eefd5['save']();};}function saveUpdates(_0x5c316a,_0x1352dc){return function(_0x138533){if(_0x138533){return _0x138533[_0xa16d('0x24')](_0x5c316a)[_0xa16d('0x25')](function(_0x2532b3){return _0x2532b3;});}return null;};}function removeEntity(_0x42257a,_0x252e11){return function(_0xe5db5b){if(_0xe5db5b){return _0xe5db5b[_0xa16d('0x26')]()['then'](function(){_0x42257a['status'](0xcc)[_0xa16d('0x1c')]();});}};}function handleEntityNotFound(_0x20e1d6,_0x36915f){return function(_0x5b1c99){if(!_0x5b1c99){_0x20e1d6[_0xa16d('0x1a')](0x194);}return _0x5b1c99;};}function handleError(_0x5230ef,_0x2dc34b){_0x2dc34b=_0x2dc34b||0x1f4;return function(_0x111238){logger[_0xa16d('0x27')](_0x111238[_0xa16d('0x28')]);if(_0x111238['name']){delete _0x111238['name'];}_0x5230ef['status'](_0x2dc34b)[_0xa16d('0x29')](_0x111238);};}exports[_0xa16d('0x2a')]=function(_0x11425e,_0x1d5507){var _0x50d4df={},_0x2efec8={},_0xfdc029={'count':0x0,'rows':[]};var _0x57b7cc=_['map'](db[_0xa16d('0x2b')]['rawAttributes'],function(_0x5c4571){return{'name':_0x5c4571[_0xa16d('0x2c')],'type':_0x5c4571[_0xa16d('0x2d')][_0xa16d('0x2e')]};});_0x2efec8[_0xa16d('0x2f')]=_['map'](_0x57b7cc,_0xa16d('0x30'));_0x2efec8[_0xa16d('0x31')]=_[_0xa16d('0x32')](_0x11425e['query']);_0x2efec8[_0xa16d('0x33')]=_[_0xa16d('0x34')](_0x2efec8['model'],_0x2efec8[_0xa16d('0x31')]);_0x50d4df[_0xa16d('0x35')]=_['intersection'](_0x2efec8['model'],qs[_0xa16d('0x36')](_0x11425e[_0xa16d('0x31')][_0xa16d('0x36')]));_0x50d4df[_0xa16d('0x35')]=_0x50d4df[_0xa16d('0x35')]['length']?_0x50d4df['attributes']:_0x2efec8[_0xa16d('0x2f')];if(!_0x11425e[_0xa16d('0x31')][_0xa16d('0x37')](_0xa16d('0x38'))){_0x50d4df['limit']=qs['limit'](_0x11425e[_0xa16d('0x31')][_0xa16d('0x20')]);_0x50d4df[_0xa16d('0x1f')]=qs[_0xa16d('0x1f')](_0x11425e[_0xa16d('0x31')]['offset']);}_0x50d4df['order']=qs[_0xa16d('0x39')](_0x11425e[_0xa16d('0x31')][_0xa16d('0x39')]);_0x50d4df[_0xa16d('0x3a')]=qs[_0xa16d('0x33')](_[_0xa16d('0x3b')](_0x11425e[_0xa16d('0x31')],_0x2efec8[_0xa16d('0x33')]),_0x57b7cc);if(_0x11425e[_0xa16d('0x31')][_0xa16d('0x3c')]){_0x50d4df[_0xa16d('0x3a')]=_[_0xa16d('0x3d')](_0x50d4df[_0xa16d('0x3a')],{'$or':_[_0xa16d('0x3e')](_0x57b7cc,function(_0x575c75){if(_0x575c75[_0xa16d('0x2d')]!==_0xa16d('0x3f')){var _0x5cb27e={};_0x5cb27e[_0x575c75['name']]={'$like':'%'+_0x11425e[_0xa16d('0x31')][_0xa16d('0x3c')]+'%'};return _0x5cb27e;}})});}_0x50d4df=_[_0xa16d('0x3d')]({},_0x50d4df,_0x11425e[_0xa16d('0x40')]);var _0x3c6c38={'where':_0x50d4df[_0xa16d('0x3a')]};return db[_0xa16d('0x2b')][_0xa16d('0x1e')](_0x3c6c38)['then'](function(_0x250417){_0xfdc029['count']=_0x250417;if(_0x11425e[_0xa16d('0x31')][_0xa16d('0x41')]){_0x50d4df[_0xa16d('0x42')]=[{'all':!![]}];}return db[_0xa16d('0x2b')]['findAll'](_0x50d4df);})[_0xa16d('0x25')](function(_0x537dfc){_0xfdc029[_0xa16d('0x43')]=_0x537dfc;return _0xfdc029;})[_0xa16d('0x25')](respondWithFilteredResult(_0x1d5507,_0x50d4df))['catch'](handleError(_0x1d5507,null));};exports[_0xa16d('0x44')]=function(_0x22a90c,_0xa22f5a){var _0x160bbb={'raw':!![],'where':{'id':_0x22a90c[_0xa16d('0x45')]['id']}},_0x24ae8f={};_0x24ae8f[_0xa16d('0x2f')]=_['keys'](db[_0xa16d('0x2b')][_0xa16d('0x46')]);_0x24ae8f['query']=_[_0xa16d('0x32')](_0x22a90c[_0xa16d('0x31')]);_0x24ae8f['filters']=_[_0xa16d('0x34')](_0x24ae8f[_0xa16d('0x2f')],_0x24ae8f[_0xa16d('0x31')]);_0x160bbb['attributes']=_[_0xa16d('0x34')](_0x24ae8f[_0xa16d('0x2f')],qs[_0xa16d('0x36')](_0x22a90c[_0xa16d('0x31')]['fields']));_0x160bbb['attributes']=_0x160bbb[_0xa16d('0x35')][_0xa16d('0x47')]?_0x160bbb['attributes']:_0x24ae8f[_0xa16d('0x2f')];if(_0x22a90c['query'][_0xa16d('0x41')]){_0x160bbb[_0xa16d('0x42')]=[{'all':!![]}];}_0x160bbb=_[_0xa16d('0x3d')]({},_0x160bbb,_0x22a90c[_0xa16d('0x40')]);return db[_0xa16d('0x2b')][_0xa16d('0x48')](_0x160bbb)[_0xa16d('0x25')](handleEntityNotFound(_0xa22f5a,null))[_0xa16d('0x25')](respondWithResult(_0xa22f5a,null))[_0xa16d('0x49')](handleError(_0xa22f5a,null));};exports['create']=function(_0x2f5d3f,_0x5c30d6){return db[_0xa16d('0x2b')][_0xa16d('0x4a')](_0x2f5d3f[_0xa16d('0x4b')],{})['then'](respondWithResult(_0x5c30d6,0xc9))[_0xa16d('0x49')](handleError(_0x5c30d6,null));};exports[_0xa16d('0x24')]=function(_0x9729cb,_0x58cb11){if(_0x9729cb['body']['id']){delete _0x9729cb[_0xa16d('0x4b')]['id'];}return db[_0xa16d('0x2b')]['find']({'where':{'id':_0x9729cb['params']['id']}})[_0xa16d('0x25')](handleEntityNotFound(_0x58cb11,null))[_0xa16d('0x25')](saveUpdates(_0x9729cb['body'],null))[_0xa16d('0x25')](respondWithResult(_0x58cb11,null))['catch'](handleError(_0x58cb11,null));};exports['destroy']=function(_0x28e011,_0x7698bb){return db[_0xa16d('0x2b')]['find']({'where':{'id':_0x28e011['params']['id']}})['then'](handleEntityNotFound(_0x7698bb,null))[_0xa16d('0x25')](removeEntity(_0x7698bb,null))[_0xa16d('0x49')](handleError(_0x7698bb,null));};exports['describe']=function(_0x4dd685,_0x5726c4){return db['Cdr']['describe']()[_0xa16d('0x25')](respondWithResult(_0x5726c4,null))[_0xa16d('0x49')](handleError(_0x5726c4,null));}; \ No newline at end of file +var _0x7d67=['status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','fast-json-patch','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d67,0xba));var _0x77d6=function(_0x28177e,_0xb71d31){_0x28177e=_0x28177e-0x0;var _0x11052a=_0x7d67[_0x28177e];return _0x11052a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x77d6('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x77d6('0x1'));var Mustache=require('mustache');var util=require(_0x77d6('0x2'));var path=require(_0x77d6('0x3'));var sox=require(_0x77d6('0x4'));var csv=require('to-csv');var ejs=require(_0x77d6('0x5'));var fs=require('fs');var _=require(_0x77d6('0x6'));var squel=require('squel');var crypto=require(_0x77d6('0x7'));var jsforce=require(_0x77d6('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x77d6('0x9'));var Papa=require(_0x77d6('0xa'));var Redis=require('ioredis');var authService=require(_0x77d6('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77d6('0xc'));var logger=require(_0x77d6('0xd'))(_0x77d6('0xe'));var utils=require('../../config/utils');var config=require(_0x77d6('0xf'));var db=require(_0x77d6('0x10'))['db'];function respondWithStatusCode(_0x32465f,_0x29c199){_0x29c199=_0x29c199||0xcc;return function(_0x18437a){if(_0x18437a){return _0x32465f[_0x77d6('0x11')](_0x29c199);}return _0x32465f[_0x77d6('0x12')](_0x29c199)[_0x77d6('0x13')]();};}function respondWithResult(_0x2438ce,_0xbe4d22){_0xbe4d22=_0xbe4d22||0xc8;return function(_0x50a16b){if(_0x50a16b){return _0x2438ce['status'](_0xbe4d22)[_0x77d6('0x14')](_0x50a16b);}};}function respondWithFilteredResult(_0x40150b,_0x2c02b7){return function(_0x16cd02){if(_0x16cd02){var _0x54ed4c=_0x16cd02[_0x77d6('0x15')],_0x1f7521=_0x2c02b7[_0x77d6('0x16')],_0x16e550=_0x2c02b7[_0x77d6('0x16')]+_0x2c02b7[_0x77d6('0x17')],_0x145dad;if(_0x16e550>=_0x54ed4c){_0x16e550=_0x54ed4c;_0x145dad=0xc8;}else{_0x145dad=0xce;}_0x40150b[_0x77d6('0x12')](_0x145dad);return _0x40150b[_0x77d6('0x18')](_0x77d6('0x19'),_0x1f7521+'-'+_0x16e550+'/'+_0x54ed4c)[_0x77d6('0x14')](_0x16cd02);}return null;};}function patchUpdates(_0x6aa042){return function(_0x5b2a69){try{jsonpatch['apply'](_0x5b2a69,_0x6aa042,!![]);}catch(_0x8404b){return BPromise[_0x77d6('0x1a')](_0x8404b);}return _0x5b2a69['save']();};}function saveUpdates(_0x4d3a09,_0x25d084){return function(_0x2786a6){if(_0x2786a6){return _0x2786a6[_0x77d6('0x1b')](_0x4d3a09)['then'](function(_0x174705){return _0x174705;});}return null;};}function removeEntity(_0x56b153,_0x2b91f3){return function(_0x31f360){if(_0x31f360){return _0x31f360[_0x77d6('0x1c')]()[_0x77d6('0x1d')](function(){_0x56b153[_0x77d6('0x12')](0xcc)[_0x77d6('0x13')]();});}};}function handleEntityNotFound(_0x58ed6e,_0x48ceb3){return function(_0x42ecb3){if(!_0x42ecb3){_0x58ed6e[_0x77d6('0x11')](0x194);}return _0x42ecb3;};}function handleError(_0x48da3f,_0x117fe8){_0x117fe8=_0x117fe8||0x1f4;return function(_0x212bdb){logger[_0x77d6('0x1e')](_0x212bdb[_0x77d6('0x1f')]);if(_0x212bdb[_0x77d6('0x20')]){delete _0x212bdb[_0x77d6('0x20')];}_0x48da3f['status'](_0x117fe8)[_0x77d6('0x21')](_0x212bdb);};}exports[_0x77d6('0x22')]=function(_0xfae76f,_0x186546){var _0x410c44={},_0x2d5fa6={},_0x46dc36={'count':0x0,'rows':[]};var _0x4e01ea=_[_0x77d6('0x23')](db[_0x77d6('0x24')][_0x77d6('0x25')],function(_0x807f4c){return{'name':_0x807f4c[_0x77d6('0x26')],'type':_0x807f4c['type']['key']};});_0x2d5fa6[_0x77d6('0x27')]=_[_0x77d6('0x23')](_0x4e01ea,'name');_0x2d5fa6[_0x77d6('0x28')]=_[_0x77d6('0x29')](_0xfae76f[_0x77d6('0x28')]);_0x2d5fa6[_0x77d6('0x2a')]=_[_0x77d6('0x2b')](_0x2d5fa6[_0x77d6('0x27')],_0x2d5fa6[_0x77d6('0x28')]);_0x410c44['attributes']=_[_0x77d6('0x2b')](_0x2d5fa6[_0x77d6('0x27')],qs['fields'](_0xfae76f[_0x77d6('0x28')][_0x77d6('0x2c')]));_0x410c44['attributes']=_0x410c44[_0x77d6('0x2d')][_0x77d6('0x2e')]?_0x410c44[_0x77d6('0x2d')]:_0x2d5fa6[_0x77d6('0x27')];if(!_0xfae76f['query'][_0x77d6('0x2f')]('nolimit')){_0x410c44['limit']=qs[_0x77d6('0x17')](_0xfae76f[_0x77d6('0x28')][_0x77d6('0x17')]);_0x410c44[_0x77d6('0x16')]=qs[_0x77d6('0x16')](_0xfae76f[_0x77d6('0x28')][_0x77d6('0x16')]);}_0x410c44[_0x77d6('0x30')]=qs[_0x77d6('0x31')](_0xfae76f[_0x77d6('0x28')]['sort']);_0x410c44[_0x77d6('0x32')]=qs[_0x77d6('0x2a')](_[_0x77d6('0x33')](_0xfae76f[_0x77d6('0x28')],_0x2d5fa6[_0x77d6('0x2a')]),_0x4e01ea);if(_0xfae76f[_0x77d6('0x28')]['filter']){_0x410c44[_0x77d6('0x32')]=_['merge'](_0x410c44[_0x77d6('0x32')],{'$or':_[_0x77d6('0x23')](_0x4e01ea,function(_0x55e3f7){if(_0x55e3f7[_0x77d6('0x34')]!==_0x77d6('0x35')){var _0x1b5977={};_0x1b5977[_0x55e3f7[_0x77d6('0x20')]]={'$like':'%'+_0xfae76f[_0x77d6('0x28')][_0x77d6('0x36')]+'%'};return _0x1b5977;}})});}_0x410c44=_[_0x77d6('0x37')]({},_0x410c44,_0xfae76f[_0x77d6('0x38')]);var _0x1cebe2={'where':_0x410c44['where']};return db[_0x77d6('0x24')]['count'](_0x1cebe2)[_0x77d6('0x1d')](function(_0x361ee0){_0x46dc36['count']=_0x361ee0;if(_0xfae76f[_0x77d6('0x28')][_0x77d6('0x39')]){_0x410c44[_0x77d6('0x3a')]=[{'all':!![]}];}return db[_0x77d6('0x24')][_0x77d6('0x3b')](_0x410c44);})[_0x77d6('0x1d')](function(_0xfb0a16){_0x46dc36[_0x77d6('0x3c')]=_0xfb0a16;return _0x46dc36;})[_0x77d6('0x1d')](respondWithFilteredResult(_0x186546,_0x410c44))[_0x77d6('0x3d')](handleError(_0x186546,null));};exports[_0x77d6('0x3e')]=function(_0x21254e,_0x264710){var _0x585413={'raw':!![],'where':{'id':_0x21254e['params']['id']}},_0x103f66={};_0x103f66[_0x77d6('0x27')]=_['keys'](db[_0x77d6('0x24')][_0x77d6('0x25')]);_0x103f66[_0x77d6('0x28')]=_[_0x77d6('0x29')](_0x21254e[_0x77d6('0x28')]);_0x103f66[_0x77d6('0x2a')]=_[_0x77d6('0x2b')](_0x103f66['model'],_0x103f66[_0x77d6('0x28')]);_0x585413[_0x77d6('0x2d')]=_['intersection'](_0x103f66[_0x77d6('0x27')],qs[_0x77d6('0x2c')](_0x21254e[_0x77d6('0x28')][_0x77d6('0x2c')]));_0x585413['attributes']=_0x585413[_0x77d6('0x2d')][_0x77d6('0x2e')]?_0x585413[_0x77d6('0x2d')]:_0x103f66[_0x77d6('0x27')];if(_0x21254e[_0x77d6('0x28')]['includeAll']){_0x585413[_0x77d6('0x3a')]=[{'all':!![]}];}_0x585413=_[_0x77d6('0x37')]({},_0x585413,_0x21254e['options']);return db['Cdr'][_0x77d6('0x3f')](_0x585413)[_0x77d6('0x1d')](handleEntityNotFound(_0x264710,null))[_0x77d6('0x1d')](respondWithResult(_0x264710,null))['catch'](handleError(_0x264710,null));};exports['create']=function(_0x4a06b2,_0x41d3ce){return db[_0x77d6('0x24')][_0x77d6('0x40')](_0x4a06b2[_0x77d6('0x41')],{})['then'](respondWithResult(_0x41d3ce,0xc9))[_0x77d6('0x3d')](handleError(_0x41d3ce,null));};exports[_0x77d6('0x1b')]=function(_0x3a767e,_0x3a99c8){if(_0x3a767e[_0x77d6('0x41')]['id']){delete _0x3a767e[_0x77d6('0x41')]['id'];}return db[_0x77d6('0x24')]['find']({'where':{'id':_0x3a767e[_0x77d6('0x42')]['id']}})[_0x77d6('0x1d')](handleEntityNotFound(_0x3a99c8,null))[_0x77d6('0x1d')](saveUpdates(_0x3a767e['body'],null))['then'](respondWithResult(_0x3a99c8,null))[_0x77d6('0x3d')](handleError(_0x3a99c8,null));};exports[_0x77d6('0x1c')]=function(_0x2ba647,_0x52e240){return db[_0x77d6('0x24')]['find']({'where':{'id':_0x2ba647['params']['id']}})[_0x77d6('0x1d')](handleEntityNotFound(_0x52e240,null))[_0x77d6('0x1d')](removeEntity(_0x52e240,null))[_0x77d6('0x3d')](handleError(_0x52e240,null));};exports[_0x77d6('0x43')]=function(_0x398eb9,_0x5c697d){return db[_0x77d6('0x24')]['describe']()['then'](respondWithResult(_0x5c697d,null))[_0x77d6('0x3d')](handleError(_0x5c697d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7a1c38b..e13daa1 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 _0x687b=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0x687b,0x14a));var _0xb687=function(_0x1cd726,_0x2bf581){_0x1cd726=_0x1cd726-0x0;var _0x179932=_0x687b[_0x1cd726];return _0x179932;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'calldate','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('0xe')]},{'name':_0xb687('0xf'),'fields':[_0xb687('0xf')]},{'name':_0xb687('0x10'),'fields':[_0xb687('0x10')]},{'name':_0xb687('0x11'),'fields':[_0xb687('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1967=['./cdr.attributes','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x286400,_0x27384d){var _0x100ee1=function(_0x572573){while(--_0x572573){_0x286400['push'](_0x286400['shift']());}};_0x100ee1(++_0x27384d);}(_0x1967,0x173));var _0x7196=function(_0x2172d1,_0x5cfe43){_0x2172d1=_0x2172d1-0x0;var _0x1506f6=_0x1967[_0x2172d1];return _0x1506f6;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[{'name':_0x7196('0xd'),'fields':['accountcode']},{'name':_0x7196('0xe'),'fields':[_0x7196('0xe')]},{'name':_0x7196('0xf'),'fields':[_0x7196('0xf')]},{'name':_0x7196('0x10'),'fields':['dst']},{'name':'src','fields':[_0x7196('0x11')]},{'name':_0x7196('0x12'),'fields':[_0x7196('0x12')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index ed937d3..2620491 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 _0xde7b=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x1feb3a,_0x2187c5){var _0x26ea1f=function(_0x4fecab){while(--_0x4fecab){_0x1feb3a['push'](_0x1feb3a['shift']());}};_0x26ea1f(++_0x2187c5);}(_0xde7b,0xe3));var _0xbde7=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xde7b[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xbde7('0x0'));var moment=require(_0xbde7('0x1'));var BPromise=require('bluebird');var rs=require(_0xbde7('0x2'));var fs=require('fs');var Redis=require(_0xbde7('0x3'));var db=require(_0xbde7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde7('0x5'))(_0xbde7('0x6'));var config=require(_0xbde7('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9fad,_0x8b1c55,_0x5416bc){return new BPromise(function(_0x1b64e6,_0x6e9e44){return client[_0xbde7('0x8')](_0x2c9fad,_0x5416bc)[_0xbde7('0x9')](function(_0x330cc4){logger[_0xbde7('0xa')](_0xbde7('0xb'),_0x8b1c55,_0xbde7('0xc'));logger[_0xbde7('0xd')](_0xbde7('0xe'),_0x8b1c55,_0xbde7('0xc'),JSON[_0xbde7('0xf')](_0x330cc4));if(_0x330cc4[_0xbde7('0x10')]){if(_0x330cc4['error']['code']===0x1f4){logger[_0xbde7('0x10')](_0xbde7('0xb'),_0x8b1c55,_0x330cc4[_0xbde7('0x10')][_0xbde7('0x11')]);return _0x6e9e44(_0x330cc4[_0xbde7('0x10')]['message']);}logger[_0xbde7('0x10')](_0xbde7('0xb'),_0x8b1c55,_0x330cc4[_0xbde7('0x10')][_0xbde7('0x11')]);return _0x1b64e6(_0x330cc4[_0xbde7('0x10')][_0xbde7('0x11')]);}else{logger[_0xbde7('0xa')](_0xbde7('0xb'),_0x8b1c55,_0xbde7('0xc'));_0x1b64e6(_0x330cc4[_0xbde7('0x12')][_0xbde7('0x11')]);}})[_0xbde7('0x13')](function(_0x2ee807){logger['error'](_0xbde7('0xb'),_0x8b1c55,_0x2ee807);_0x6e9e44(_0x2ee807);});});} \ No newline at end of file +var _0x6477=['http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ee32a,_0x4c9b29){var _0x5be1b=function(_0x157448){while(--_0x157448){_0x5ee32a['push'](_0x5ee32a['shift']());}};_0x5be1b(++_0x4c9b29);}(_0x6477,0x68));var _0x7647=function(_0x5182f9,_0x4acf0c){_0x5182f9=_0x5182f9-0x0;var _0x4c9fad=_0x6477[_0x5182f9];return _0x4c9fad;};'use strict';var _=require(_0x7647('0x0'));var util=require(_0x7647('0x1'));var moment=require(_0x7647('0x2'));var BPromise=require('bluebird');var rs=require(_0x7647('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7647('0x4'))['db'];var utils=require(_0x7647('0x5'));var logger=require(_0x7647('0x6'))(_0x7647('0x7'));var config=require(_0x7647('0x8'));var jayson=require(_0x7647('0x9'));var client=jayson[_0x7647('0xa')][_0x7647('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe214af,_0xbbd8c7,_0x23b373){return new BPromise(function(_0x266fe9,_0x5d4a1b){return client[_0x7647('0xc')](_0xe214af,_0x23b373)[_0x7647('0xd')](function(_0x3e1349){logger['info'](_0x7647('0xe'),_0xbbd8c7,_0x7647('0xf'));logger[_0x7647('0x10')](_0x7647('0x11'),_0xbbd8c7,'request\x20sent',JSON[_0x7647('0x12')](_0x3e1349));if(_0x3e1349[_0x7647('0x13')]){if(_0x3e1349[_0x7647('0x13')][_0x7647('0x14')]===0x1f4){logger[_0x7647('0x13')](_0x7647('0xe'),_0xbbd8c7,_0x3e1349[_0x7647('0x13')][_0x7647('0x15')]);return _0x5d4a1b(_0x3e1349['error'][_0x7647('0x15')]);}logger['error'](_0x7647('0xe'),_0xbbd8c7,_0x3e1349[_0x7647('0x13')]['message']);return _0x266fe9(_0x3e1349[_0x7647('0x13')][_0x7647('0x15')]);}else{logger['info'](_0x7647('0xe'),_0xbbd8c7,_0x7647('0xf'));_0x266fe9(_0x3e1349['result'][_0x7647('0x15')]);}})[_0x7647('0x16')](function(_0x2885b3){logger[_0x7647('0x13')](_0x7647('0xe'),_0xbbd8c7,_0x2885b3);_0x5d4a1b(_0x2885b3);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 9518ac1..ee47aeb 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 _0xf7ea=['/:id','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7ea,0x111));var _0xaf7e=function(_0x4dade6,_0x48ee92){_0x4dade6=_0x4dade6-0x0;var _0x269f90=_0xf7ea[_0x4dade6];return _0x269f90;};'use strict';var multer=require(_0xaf7e('0x0'));var util=require(_0xaf7e('0x1'));var path=require('path');var timeout=require(_0xaf7e('0x2'));var express=require(_0xaf7e('0x3'));var router=express[_0xaf7e('0x4')]();var auth=require(_0xaf7e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xaf7e('0x6')]('/',auth[_0xaf7e('0x7')](),controller[_0xaf7e('0x8')]);router[_0xaf7e('0x6')](_0xaf7e('0x9'),auth[_0xaf7e('0x7')](),controller[_0xaf7e('0xa')]);router[_0xaf7e('0x6')]('/:id',auth[_0xaf7e('0x7')](),controller[_0xaf7e('0xb')]);router[_0xaf7e('0xc')]('/',auth[_0xaf7e('0x7')](),controller[_0xaf7e('0xd')]);router[_0xaf7e('0xe')](_0xaf7e('0xf'),auth[_0xaf7e('0x7')](),controller['update']);router[_0xaf7e('0x10')](_0xaf7e('0xf'),auth['isAuthenticated'](),controller[_0xaf7e('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf9a4=['destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','update','/:id'];(function(_0x49a60f,_0x518c48){var _0x38c29c=function(_0x42b9cb){while(--_0x42b9cb){_0x49a60f['push'](_0x49a60f['shift']());}};_0x38c29c(++_0x518c48);}(_0xf9a4,0x11f));var _0x4f9a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xf9a4[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0x4f9a('0x0'));var util=require(_0x4f9a('0x1'));var path=require(_0x4f9a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f9a('0x3')]();var auth=require(_0x4f9a('0x4'));var interaction=require(_0x4f9a('0x5'));var config=require(_0x4f9a('0x6'));var controller=require('./cdr.controller');router[_0x4f9a('0x7')]('/',auth['isAuthenticated'](),controller[_0x4f9a('0x8')]);router['get'](_0x4f9a('0x9'),auth[_0x4f9a('0xa')](),controller['describe']);router[_0x4f9a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4f9a('0xb')]);router[_0x4f9a('0xc')]('/',auth[_0x4f9a('0xa')](),controller[_0x4f9a('0xd')]);router[_0x4f9a('0xe')]('/:id',auth[_0x4f9a('0xa')](),controller[_0x4f9a('0xf')]);router['delete'](_0x4f9a('0x10'),auth[_0x4f9a('0xa')](),controller[_0x4f9a('0x11')]);module[_0x4f9a('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index fb99abc..5bf7758 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 _0x84bc=['INTEGER','noop','TEXT','STRING','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x84bc,0x1ae));var _0xc84b=function(_0x3fdbd8,_0x6b3c42){_0x3fdbd8=_0x3fdbd8-0x0;var _0x14adb3=_0x84bc[_0x3fdbd8];return _0x14adb3;};'use strict';var Sequelize=require(_0xc84b('0x0'));module[_0xc84b('0x1')]={'priority':{'type':Sequelize[_0xc84b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc84b('0x3')},'appdata':{'type':Sequelize[_0xc84b('0x4')]()},'description':{'type':Sequelize[_0xc84b('0x5')]},'interval':{'type':Sequelize[_0xc84b('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8c1c=['*,*,*,*','sequelize','exports','INTEGER','noop','STRING'];(function(_0xead02f,_0x3a8323){var _0x5797e7=function(_0x4b463e){while(--_0x4b463e){_0xead02f['push'](_0xead02f['shift']());}};_0x5797e7(++_0x3a8323);}(_0x8c1c,0x85));var _0xc8c1=function(_0x483889,_0x4c80ad){_0x483889=_0x483889-0x0;var _0x477f7a=_0x8c1c[_0x483889];return _0x477f7a;};'use strict';var Sequelize=require(_0xc8c1('0x0'));module[_0xc8c1('0x1')]={'priority':{'type':Sequelize[_0xc8c1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc8c1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc8c1('0x4')]},'interval':{'type':Sequelize[_0xc8c1('0x4')],'defaultValue':_0xc8c1('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1424b36..30ccbfe 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 _0x25ea=['then','destroy','error','stack','name','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','body','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x25ea,0x1ce));var _0xa25e=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x25ea[_0x58c20f];return _0x3b0318;};'use strict';var pdf=require(_0xa25e('0x0'));var emlformat=require(_0xa25e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa25e('0x2'));var jsonpatch=require(_0xa25e('0x3'));var rp=require(_0xa25e('0x4'));var moment=require(_0xa25e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa25e('0x6'));var util=require('util');var path=require(_0xa25e('0x7'));var sox=require(_0xa25e('0x8'));var csv=require('to-csv');var ejs=require(_0xa25e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa25e('0xa'));var toCsv=require(_0xa25e('0xb'));var querystring=require(_0xa25e('0xc'));var Papa=require(_0xa25e('0xd'));var Redis=require('ioredis');var authService=require(_0xa25e('0xe'));var qs=require(_0xa25e('0xf'));var as=require(_0xa25e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa25e('0x11'))(_0xa25e('0x12'));var utils=require(_0xa25e('0x13'));var config=require('../../config/environment');var db=require(_0xa25e('0x14'))['db'];function respondWithStatusCode(_0x988294,_0x3157a4){_0x3157a4=_0x3157a4||0xcc;return function(_0x4cc552){if(_0x4cc552){return _0x988294[_0xa25e('0x15')](_0x3157a4);}return _0x988294['status'](_0x3157a4)[_0xa25e('0x16')]();};}function respondWithResult(_0x4c7d63,_0x47104f){_0x47104f=_0x47104f||0xc8;return function(_0x279d39){if(_0x279d39){return _0x4c7d63[_0xa25e('0x17')](_0x47104f)[_0xa25e('0x18')](_0x279d39);}};}function respondWithFilteredResult(_0x3bf412,_0x17f90f){return function(_0x1d2f4e){if(_0x1d2f4e){var _0x27a453=_0x1d2f4e[_0xa25e('0x19')],_0x3e52a4=_0x17f90f[_0xa25e('0x1a')],_0x3bce6b=_0x17f90f[_0xa25e('0x1a')]+_0x17f90f[_0xa25e('0x1b')],_0xe8754a;if(_0x3bce6b>=_0x27a453){_0x3bce6b=_0x27a453;_0xe8754a=0xc8;}else{_0xe8754a=0xce;}_0x3bf412[_0xa25e('0x17')](_0xe8754a);return _0x3bf412['set'](_0xa25e('0x1c'),_0x3e52a4+'-'+_0x3bce6b+'/'+_0x27a453)[_0xa25e('0x18')](_0x1d2f4e);}return null;};}function patchUpdates(_0x2f2981){return function(_0x575ecb){try{jsonpatch[_0xa25e('0x1d')](_0x575ecb,_0x2f2981,!![]);}catch(_0x3b3c28){return BPromise[_0xa25e('0x1e')](_0x3b3c28);}return _0x575ecb[_0xa25e('0x1f')]();};}function saveUpdates(_0x474d1b,_0x49562){return function(_0x2bb8f6){if(_0x2bb8f6){return _0x2bb8f6[_0xa25e('0x20')](_0x474d1b)[_0xa25e('0x21')](function(_0x261275){return _0x261275;});}return null;};}function removeEntity(_0x24d1c6,_0x41557b){return function(_0x54d267){if(_0x54d267){return _0x54d267[_0xa25e('0x22')]()['then'](function(){_0x24d1c6[_0xa25e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d6da,_0x319154){return function(_0x498144){if(!_0x498144){_0x30d6da[_0xa25e('0x15')](0x194);}return _0x498144;};}function handleError(_0x48fe4b,_0x4f57a2){_0x4f57a2=_0x4f57a2||0x1f4;return function(_0x1b57f6){logger[_0xa25e('0x23')](_0x1b57f6[_0xa25e('0x24')]);if(_0x1b57f6[_0xa25e('0x25')]){delete _0x1b57f6[_0xa25e('0x25')];}_0x48fe4b['status'](_0x4f57a2)['send'](_0x1b57f6);};}exports[_0xa25e('0x26')]=function(_0xa965cf,_0x5e77ce){var _0x3cc36d={'raw':!![],'where':{'id':_0xa965cf['params']['id']}},_0x359ca0={};_0x359ca0[_0xa25e('0x27')]=_[_0xa25e('0x28')](db[_0xa25e('0x29')]['rawAttributes']);_0x359ca0[_0xa25e('0x2a')]=_['keys'](_0xa965cf['query']);_0x359ca0[_0xa25e('0x2b')]=_[_0xa25e('0x2c')](_0x359ca0[_0xa25e('0x27')],_0x359ca0[_0xa25e('0x2a')]);_0x3cc36d[_0xa25e('0x2d')]=_[_0xa25e('0x2c')](_0x359ca0['model'],qs[_0xa25e('0x2e')](_0xa965cf[_0xa25e('0x2a')][_0xa25e('0x2e')]));_0x3cc36d['attributes']=_0x3cc36d[_0xa25e('0x2d')][_0xa25e('0x2f')]?_0x3cc36d[_0xa25e('0x2d')]:_0x359ca0[_0xa25e('0x27')];if(_0xa965cf[_0xa25e('0x2a')][_0xa25e('0x30')]){_0x3cc36d[_0xa25e('0x31')]=[{'all':!![]}];}_0x3cc36d=_['merge']({},_0x3cc36d,_0xa965cf[_0xa25e('0x32')]);return db[_0xa25e('0x29')][_0xa25e('0x33')](_0x3cc36d)['then'](handleEntityNotFound(_0x5e77ce,null))[_0xa25e('0x21')](respondWithResult(_0x5e77ce,null))['catch'](handleError(_0x5e77ce,null));};exports[_0xa25e('0x20')]=function(_0x47f2d4,_0x5f37e1){if(_0x47f2d4[_0xa25e('0x34')]['id']){delete _0x47f2d4[_0xa25e('0x34')]['id'];}return db[_0xa25e('0x29')]['find']({'where':{'id':_0x47f2d4[_0xa25e('0x35')]['id']}})[_0xa25e('0x21')](handleEntityNotFound(_0x5f37e1,null))['then'](saveUpdates(_0x47f2d4[_0xa25e('0x34')],null))[_0xa25e('0x21')](respondWithResult(_0x5f37e1,null))[_0xa25e('0x36')](handleError(_0x5f37e1,null));};exports[_0xa25e('0x22')]=function(_0x4a7134,_0x4fae04){return db['ChatApplication']['find']({'where':{'id':_0x4a7134['params']['id']}})[_0xa25e('0x21')](handleEntityNotFound(_0x4fae04,null))[_0xa25e('0x21')](removeEntity(_0x4fae04,null))[_0xa25e('0x36')](handleError(_0x4fae04,null));}; \ No newline at end of file +var _0x51fd=['rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','params','ChatApplication'];(function(_0x619e70,_0x37cbc9){var _0x44022b=function(_0x3824a0){while(--_0x3824a0){_0x619e70['push'](_0x619e70['shift']());}};_0x44022b(++_0x37cbc9);}(_0x51fd,0x123));var _0xd51f=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x51fd[_0x209941];return _0x1e8729;};'use strict';var pdf=require(_0xd51f('0x0'));var emlformat=require(_0xd51f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd51f('0x2'));var jsonpatch=require(_0xd51f('0x3'));var rp=require(_0xd51f('0x4'));var moment=require('moment');var BPromise=require(_0xd51f('0x5'));var Mustache=require(_0xd51f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xd51f('0x7'));var csv=require(_0xd51f('0x8'));var ejs=require(_0xd51f('0x9'));var fs=require('fs');var _=require(_0xd51f('0xa'));var squel=require(_0xd51f('0xb'));var crypto=require('crypto');var jsforce=require(_0xd51f('0xc'));var deskjs=require(_0xd51f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd51f('0xe'));var Papa=require('papaparse');var Redis=require(_0xd51f('0xf'));var authService=require(_0xd51f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd51f('0x11'));var hardwareService=require(_0xd51f('0x12'));var logger=require(_0xd51f('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd51f('0x14'))['db'];function respondWithStatusCode(_0x1a164c,_0x5d59be){_0x5d59be=_0x5d59be||0xcc;return function(_0x493559){if(_0x493559){return _0x1a164c['sendStatus'](_0x5d59be);}return _0x1a164c[_0xd51f('0x15')](_0x5d59be)[_0xd51f('0x16')]();};}function respondWithResult(_0x3b5b08,_0x269768){_0x269768=_0x269768||0xc8;return function(_0x591461){if(_0x591461){return _0x3b5b08[_0xd51f('0x15')](_0x269768)['json'](_0x591461);}};}function respondWithFilteredResult(_0x4f7266,_0x3243b2){return function(_0x41ef84){if(_0x41ef84){var _0x144a51=_0x41ef84['count'],_0x18938f=_0x3243b2[_0xd51f('0x17')],_0x164fa8=_0x3243b2[_0xd51f('0x17')]+_0x3243b2[_0xd51f('0x18')],_0x23db4b;if(_0x164fa8>=_0x144a51){_0x164fa8=_0x144a51;_0x23db4b=0xc8;}else{_0x23db4b=0xce;}_0x4f7266[_0xd51f('0x15')](_0x23db4b);return _0x4f7266[_0xd51f('0x19')](_0xd51f('0x1a'),_0x18938f+'-'+_0x164fa8+'/'+_0x144a51)[_0xd51f('0x1b')](_0x41ef84);}return null;};}function patchUpdates(_0x56d9cc){return function(_0x3fcfff){try{jsonpatch[_0xd51f('0x1c')](_0x3fcfff,_0x56d9cc,!![]);}catch(_0x130e9){return BPromise['reject'](_0x130e9);}return _0x3fcfff[_0xd51f('0x1d')]();};}function saveUpdates(_0x3678dd,_0xb30421){return function(_0x688e4c){if(_0x688e4c){return _0x688e4c[_0xd51f('0x1e')](_0x3678dd)[_0xd51f('0x1f')](function(_0x10356c){return _0x10356c;});}return null;};}function removeEntity(_0x5492ad,_0x2b1c0b){return function(_0x36a07f){if(_0x36a07f){return _0x36a07f['destroy']()[_0xd51f('0x1f')](function(){_0x5492ad[_0xd51f('0x15')](0xcc)[_0xd51f('0x16')]();});}};}function handleEntityNotFound(_0x595872,_0x58cd3a){return function(_0x198234){if(!_0x198234){_0x595872[_0xd51f('0x20')](0x194);}return _0x198234;};}function handleError(_0xb451be,_0x514384){_0x514384=_0x514384||0x1f4;return function(_0x4c76f4){logger[_0xd51f('0x21')](_0x4c76f4[_0xd51f('0x22')]);if(_0x4c76f4[_0xd51f('0x23')]){delete _0x4c76f4['name'];}_0xb451be[_0xd51f('0x15')](_0x514384)[_0xd51f('0x24')](_0x4c76f4);};}exports['show']=function(_0x3e3400,_0x3a5510){var _0x5d1307={'raw':!![],'where':{'id':_0x3e3400[_0xd51f('0x25')]['id']}},_0x24b8c9={};_0x24b8c9['model']=_['keys'](db[_0xd51f('0x26')][_0xd51f('0x27')]);_0x24b8c9[_0xd51f('0x28')]=_[_0xd51f('0x29')](_0x3e3400[_0xd51f('0x28')]);_0x24b8c9[_0xd51f('0x2a')]=_[_0xd51f('0x2b')](_0x24b8c9[_0xd51f('0x2c')],_0x24b8c9[_0xd51f('0x28')]);_0x5d1307[_0xd51f('0x2d')]=_[_0xd51f('0x2b')](_0x24b8c9[_0xd51f('0x2c')],qs['fields'](_0x3e3400['query'][_0xd51f('0x2e')]));_0x5d1307[_0xd51f('0x2d')]=_0x5d1307[_0xd51f('0x2d')][_0xd51f('0x2f')]?_0x5d1307[_0xd51f('0x2d')]:_0x24b8c9[_0xd51f('0x2c')];if(_0x3e3400[_0xd51f('0x28')][_0xd51f('0x30')]){_0x5d1307[_0xd51f('0x31')]=[{'all':!![]}];}_0x5d1307=_[_0xd51f('0x32')]({},_0x5d1307,_0x3e3400[_0xd51f('0x33')]);return db[_0xd51f('0x26')][_0xd51f('0x34')](_0x5d1307)['then'](handleEntityNotFound(_0x3a5510,null))[_0xd51f('0x1f')](respondWithResult(_0x3a5510,null))[_0xd51f('0x35')](handleError(_0x3a5510,null));};exports[_0xd51f('0x1e')]=function(_0x3f63e5,_0x3209d5){if(_0x3f63e5['body']['id']){delete _0x3f63e5[_0xd51f('0x36')]['id'];}return db['ChatApplication'][_0xd51f('0x34')]({'where':{'id':_0x3f63e5[_0xd51f('0x25')]['id']}})[_0xd51f('0x1f')](handleEntityNotFound(_0x3209d5,null))[_0xd51f('0x1f')](saveUpdates(_0x3f63e5[_0xd51f('0x36')],null))[_0xd51f('0x1f')](respondWithResult(_0x3209d5,null))['catch'](handleError(_0x3209d5,null));};exports['destroy']=function(_0x27d074,_0x3859a5){return db[_0xd51f('0x26')][_0xd51f('0x34')]({'where':{'id':_0x27d074[_0xd51f('0x25')]['id']}})['then'](handleEntityNotFound(_0x3859a5,null))[_0xd51f('0x1f')](removeEntity(_0x3859a5,null))[_0xd51f('0x35')](handleError(_0x3859a5,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 6d045da..c95a1c8 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(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 9744107..eaa577e 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 _0x6fb1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird'];(function(_0x595775,_0x1d5665){var _0x5ad30f=function(_0xf245e3){while(--_0xf245e3){_0x595775['push'](_0x595775['shift']());}};_0x5ad30f(++_0x1d5665);}(_0x6fb1,0xc5));var _0x16fb=function(_0x522421,_0x909c38){_0x522421=_0x522421-0x0;var _0x8e418a=_0x6fb1[_0x522421];return _0x8e418a;};'use strict';var _=require('lodash');var util=require(_0x16fb('0x0'));var moment=require(_0x16fb('0x1'));var BPromise=require(_0x16fb('0x2'));var rs=require(_0x16fb('0x3'));var fs=require('fs');var Redis=require(_0x16fb('0x4'));var db=require(_0x16fb('0x5'))['db'];var utils=require(_0x16fb('0x6'));var logger=require(_0x16fb('0x7'))('rpc');var config=require(_0x16fb('0x8'));var jayson=require(_0x16fb('0x9'));var client=jayson['client'][_0x16fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fad25,_0x597843,_0x253bbf){return new BPromise(function(_0x3d2eb3,_0x5b7b2b){return client['request'](_0x3fad25,_0x253bbf)[_0x16fb('0xb')](function(_0x96b30e){logger[_0x16fb('0xc')](_0x16fb('0xd'),_0x597843,'request\x20sent');logger['debug'](_0x16fb('0xe'),_0x597843,_0x16fb('0xf'),JSON['stringify'](_0x96b30e));if(_0x96b30e[_0x16fb('0x10')]){if(_0x96b30e[_0x16fb('0x10')][_0x16fb('0x11')]===0x1f4){logger[_0x16fb('0x10')](_0x16fb('0xd'),_0x597843,_0x96b30e[_0x16fb('0x10')][_0x16fb('0x12')]);return _0x5b7b2b(_0x96b30e[_0x16fb('0x10')][_0x16fb('0x12')]);}logger[_0x16fb('0x10')](_0x16fb('0xd'),_0x597843,_0x96b30e[_0x16fb('0x10')][_0x16fb('0x12')]);return _0x3d2eb3(_0x96b30e[_0x16fb('0x10')][_0x16fb('0x12')]);}else{logger[_0x16fb('0xc')](_0x16fb('0xd'),_0x597843,_0x16fb('0xf'));_0x3d2eb3(_0x96b30e['result']['message']);}})[_0x16fb('0x13')](function(_0x31c994){logger[_0x16fb('0x10')](_0x16fb('0xd'),_0x597843,_0x31c994);_0x5b7b2b(_0x31c994);});});} \ No newline at end of file +var _0x1c57=['client','http','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','ChatApplication,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3611a7,_0x59563c){var _0x569692=function(_0x5bbdc7){while(--_0x5bbdc7){_0x3611a7['push'](_0x3611a7['shift']());}};_0x569692(++_0x59563c);}(_0x1c57,0x122));var _0x71c5=function(_0x8c0032,_0x5052ed){_0x8c0032=_0x8c0032-0x0;var _0x284555=_0x1c57[_0x8c0032];return _0x284555;};'use strict';var _=require(_0x71c5('0x0'));var util=require(_0x71c5('0x1'));var moment=require(_0x71c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x71c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71c5('0x4'))['db'];var utils=require(_0x71c5('0x5'));var logger=require(_0x71c5('0x6'))(_0x71c5('0x7'));var config=require(_0x71c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x71c5('0x9')][_0x71c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x211a1a,_0x3f65ac,_0x5b8630){return new BPromise(function(_0x4c4529,_0x691de3){return client['request'](_0x211a1a,_0x5b8630)[_0x71c5('0xb')](function(_0x2579eb){logger[_0x71c5('0xc')]('ChatApplication,\x20%s,\x20%s',_0x3f65ac,_0x71c5('0xd'));logger[_0x71c5('0xe')](_0x71c5('0xf'),_0x3f65ac,_0x71c5('0xd'),JSON[_0x71c5('0x10')](_0x2579eb));if(_0x2579eb['error']){if(_0x2579eb['error'][_0x71c5('0x11')]===0x1f4){logger['error'](_0x71c5('0x12'),_0x3f65ac,_0x2579eb[_0x71c5('0x13')][_0x71c5('0x14')]);return _0x691de3(_0x2579eb[_0x71c5('0x13')]['message']);}logger[_0x71c5('0x13')](_0x71c5('0x12'),_0x3f65ac,_0x2579eb[_0x71c5('0x13')][_0x71c5('0x14')]);return _0x4c4529(_0x2579eb[_0x71c5('0x13')]['message']);}else{logger[_0x71c5('0xc')](_0x71c5('0x12'),_0x3f65ac,_0x71c5('0xd'));_0x4c4529(_0x2579eb[_0x71c5('0x15')][_0x71c5('0x14')]);}})[_0x71c5('0x16')](function(_0x8383e8){logger[_0x71c5('0x13')]('ChatApplication,\x20%s,\x20%s',_0x3f65ac,_0x8383e8);_0x691de3(_0x8383e8);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 34aca9d..36a9098 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 _0x0d53=['connect-timeout','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer','util','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x0d53,0x75));var _0x30d5=function(_0x46a08e,_0x321c81){_0x46a08e=_0x46a08e-0x0;var _0x38d2d0=_0x0d53[_0x46a08e];return _0x38d2d0;};'use strict';var multer=require(_0x30d5('0x0'));var util=require(_0x30d5('0x1'));var path=require(_0x30d5('0x2'));var timeout=require(_0x30d5('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x30d5('0x4'));var interaction=require(_0x30d5('0x5'));var config=require('../../config/environment');var controller=require(_0x30d5('0x6'));router[_0x30d5('0x7')](_0x30d5('0x8'),auth[_0x30d5('0x9')](),controller[_0x30d5('0xa')]);router[_0x30d5('0xb')](_0x30d5('0x8'),auth[_0x30d5('0x9')](),controller[_0x30d5('0xc')]);router[_0x30d5('0xd')]('/:id',auth[_0x30d5('0x9')](),controller[_0x30d5('0xe')]);module['exports']=router; \ No newline at end of file +var _0x656e=['destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','update','delete'];(function(_0x1e7a55,_0x2bf159){var _0x20742e=function(_0x3cb71d){while(--_0x3cb71d){_0x1e7a55['push'](_0x1e7a55['shift']());}};_0x20742e(++_0x2bf159);}(_0x656e,0xf9));var _0xe656=function(_0x380329,_0x63b51e){_0x380329=_0x380329-0x0;var _0x15b881=_0x656e[_0x380329];return _0x15b881;};'use strict';var multer=require(_0xe656('0x0'));var util=require(_0xe656('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe656('0x2'));var router=express['Router']();var auth=require(_0xe656('0x3'));var interaction=require(_0xe656('0x4'));var config=require('../../config/environment');var controller=require(_0xe656('0x5'));router[_0xe656('0x6')](_0xe656('0x7'),auth[_0xe656('0x8')](),controller['show']);router['put'](_0xe656('0x7'),auth['isAuthenticated'](),controller[_0xe656('0x9')]);router[_0xe656('0xa')](_0xe656('0x7'),auth['isAuthenticated'](),controller[_0xe656('0xb')]);module[_0xe656('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 97e7643..19fd4fe 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 _0xc88e=['BOOLEAN','sequelize','STRING'];(function(_0x93522d,_0x422c3a){var _0x7919c2=function(_0x245d45){while(--_0x245d45){_0x93522d['push'](_0x93522d['shift']());}};_0x7919c2(++_0x422c3a);}(_0xc88e,0xd3));var _0xec88=function(_0x139263,_0x43c8d9){_0x139263=_0x139263-0x0;var _0x5b6d02=_0xc88e[_0x139263];return _0x5b6d02;};'use strict';var Sequelize=require(_0xec88('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xec88('0x1')]},'write':{'type':Sequelize[_0xec88('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf68d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x25ca30,_0xe38294){var _0x1b1c8e=function(_0x6c33a2){while(--_0x6c33a2){_0x25ca30['push'](_0x25ca30['shift']());}};_0x1b1c8e(++_0xe38294);}(_0xf68d,0x135));var _0xdf68=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xf68d[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0xdf68('0x0'));module[_0xdf68('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xdf68('0x2')]},'write':{'type':Sequelize[_0xdf68('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 77375e7..2529b8d 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 _0x3262=['../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','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~!@#$%^&-_=+[{]}.','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','ids','omit','User','length','filter','getMembers','removeMembers','ChatGroupId','getMessages','findOne','order','$gte','split','format','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x312c5b,_0x43ffae){var _0x103722=function(_0x22f08a){while(--_0x22f08a){_0x312c5b['push'](_0x312c5b['shift']());}};_0x103722(++_0x43ffae);}(_0x3262,0x12a));var _0x2326=function(_0x399bd4,_0x3c84ab){_0x399bd4=_0x399bd4-0x0;var _0x12d41b=_0x3262[_0x399bd4];return _0x12d41b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2326('0x0'));var rimraf=require(_0x2326('0x1'));var zipdir=require(_0x2326('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2326('0x3'));var moment=require(_0x2326('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2326('0x5'));var util=require(_0x2326('0x6'));var path=require(_0x2326('0x7'));var sox=require('sox');var csv=require(_0x2326('0x8'));var ejs=require(_0x2326('0x9'));var fs=require('fs');var _=require(_0x2326('0xa'));var squel=require('squel');var crypto=require(_0x2326('0xb'));var jsforce=require(_0x2326('0xc'));var deskjs=require(_0x2326('0xd'));var toCsv=require(_0x2326('0x8'));var querystring=require('querystring');var Papa=require(_0x2326('0xe'));var Redis=require(_0x2326('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2326('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2326('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2326('0x12'));var config=require(_0x2326('0x13'));var db=require(_0x2326('0x14'))['db'];config[_0x2326('0x15')]=_[_0x2326('0x16')](config[_0x2326('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x2326('0x17'))(new Redis(config[_0x2326('0x15')]));require(_0x2326('0x18'))[_0x2326('0x19')](socket);var jayson=require(_0x2326('0x1a'));var client=jayson[_0x2326('0x1b')][_0x2326('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x43c4a2,_0x220a6a,_0x542758){if(_0x542758){var _0x55ab94=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55ab94[_0x2326('0x1d')](_0x220a6a)){return _0x43c4a2;}else{throw new db['Sequelize'][(_0x2326('0x1e'))](_0x2326('0x1f'));}}else{return _0x43c4a2;}}function respondWithRpcPromise(_0x8d385,_0x7ead34,_0x6a7ad1,_0x5397f0){return new BPromise(function(_0x495f95,_0x22acbb){var _0x14053f=_0x5397f0||client;return _0x14053f['request'](_0x8d385,_0x6a7ad1)[_0x2326('0x20')](function(_0x8951c9){logger[_0x2326('0x21')](_0x2326('0x22'),_0x7ead34,_0x2326('0x23'));logger['debug'](_0x2326('0x24'),_0x7ead34,_0x2326('0x23'),JSON['stringify'](_0x8951c9));if(_0x8951c9[_0x2326('0x25')]){if(_0x8951c9[_0x2326('0x25')][_0x2326('0x26')]===0x1f4){logger[_0x2326('0x25')](_0x2326('0x22'),_0x7ead34,_0x8951c9[_0x2326('0x25')][_0x2326('0x27')]);return _0x22acbb(_0x8951c9[_0x2326('0x25')][_0x2326('0x27')]);}logger[_0x2326('0x25')](_0x2326('0x22'),_0x7ead34,_0x8951c9[_0x2326('0x25')]['message']);return _0x495f95(_0x8951c9['error'][_0x2326('0x27')]);}else{logger[_0x2326('0x21')](_0x2326('0x22'),_0x7ead34,_0x2326('0x23'));_0x495f95(_0x8951c9['result']['message']);}})['catch'](function(_0x3293a7){logger[_0x2326('0x25')](_0x2326('0x22'),_0x7ead34,_0x3293a7);_0x22acbb(_0x3293a7);});});}function respondWithStatusCode(_0x46b9ec,_0x47cc5a){_0x47cc5a=_0x47cc5a||0xcc;return function(_0x5631e5){if(_0x5631e5){return _0x46b9ec[_0x2326('0x28')](_0x47cc5a);}return _0x46b9ec[_0x2326('0x29')](_0x47cc5a)[_0x2326('0x2a')]();};}function respondWithResult(_0x491c6e,_0x4c3f53){_0x4c3f53=_0x4c3f53||0xc8;return function(_0x19cded){if(_0x19cded){return _0x491c6e[_0x2326('0x29')](_0x4c3f53)['json'](_0x19cded);}};}function respondWithFilteredResult(_0xb26971,_0x162ace){return function(_0x5f231e){if(_0x5f231e){var _0x581f8e=_0x5f231e['count'],_0x4671f2=_0x162ace[_0x2326('0x2b')],_0x3e4126=_0x162ace[_0x2326('0x2b')]+_0x162ace[_0x2326('0x2c')],_0x236028;if(_0x3e4126>=_0x581f8e){_0x3e4126=_0x581f8e;_0x236028=0xc8;}else{_0x236028=0xce;}_0xb26971['status'](_0x236028);return _0xb26971[_0x2326('0x2d')](_0x2326('0x2e'),_0x4671f2+'-'+_0x3e4126+'/'+_0x581f8e)[_0x2326('0x2f')](_0x5f231e);}return null;};}function patchUpdates(_0x2ac193){return function(_0x31debe){try{jsonpatch[_0x2326('0x30')](_0x31debe,_0x2ac193,!![]);}catch(_0x387316){return BPromise[_0x2326('0x31')](_0x387316);}return _0x31debe[_0x2326('0x32')]();};}function saveUpdates(_0xec8acf,_0x437af9){return function(_0x59608c){if(_0x59608c){return _0x59608c[_0x2326('0x33')](_0xec8acf)['then'](function(_0xd412de){return _0xd412de;});}return null;};}function removeEntity(_0x3c49db,_0x1d151){return function(_0x561a04){if(_0x561a04){return _0x561a04[_0x2326('0x34')]()[_0x2326('0x20')](function(){_0x3c49db[_0x2326('0x29')](0xcc)[_0x2326('0x2a')]();});}};}function handleEntityNotFound(_0x11a430,_0x64e7cc){return function(_0x5ece27){if(!_0x5ece27){_0x11a430['sendStatus'](0x194);}return _0x5ece27;};}function handleError(_0x27b3e1,_0x321b3f){_0x321b3f=_0x321b3f||0x1f4;return function(_0x1733e3){logger[_0x2326('0x25')](_0x1733e3[_0x2326('0x35')]);if(_0x1733e3['name']){delete _0x1733e3[_0x2326('0x36')];}_0x27b3e1[_0x2326('0x29')](_0x321b3f)[_0x2326('0x37')](_0x1733e3);};}exports[_0x2326('0x38')]=function(_0x12eeda,_0x1ed2b2){var _0x1dd75d={},_0x2fa755={},_0x4c16b2={'count':0x0,'rows':[]};var _0x1bba06=_[_0x2326('0x39')](db[_0x2326('0x3a')][_0x2326('0x3b')],function(_0x5e487c){return{'name':_0x5e487c['fieldName'],'type':_0x5e487c[_0x2326('0x3c')][_0x2326('0x3d')]};});_0x2fa755[_0x2326('0x3e')]=_[_0x2326('0x39')](_0x1bba06,_0x2326('0x36'));_0x2fa755[_0x2326('0x3f')]=_[_0x2326('0x40')](_0x12eeda[_0x2326('0x3f')]);_0x2fa755[_0x2326('0x41')]=_[_0x2326('0x42')](_0x2fa755['model'],_0x2fa755['query']);_0x1dd75d['attributes']=_[_0x2326('0x42')](_0x2fa755[_0x2326('0x3e')],qs['fields'](_0x12eeda['query'][_0x2326('0x43')]));_0x1dd75d[_0x2326('0x44')]=_0x1dd75d[_0x2326('0x44')]['length']?_0x1dd75d[_0x2326('0x44')]:_0x2fa755[_0x2326('0x3e')];if(!_0x12eeda[_0x2326('0x3f')][_0x2326('0x45')](_0x2326('0x46'))){_0x1dd75d[_0x2326('0x2c')]=qs[_0x2326('0x2c')](_0x12eeda[_0x2326('0x3f')]['limit']);_0x1dd75d['offset']=qs['offset'](_0x12eeda[_0x2326('0x3f')][_0x2326('0x2b')]);}_0x1dd75d['order']=qs[_0x2326('0x47')](_0x12eeda[_0x2326('0x3f')]['sort']);_0x1dd75d[_0x2326('0x48')]=qs[_0x2326('0x41')](_[_0x2326('0x49')](_0x12eeda[_0x2326('0x3f')],_0x2fa755[_0x2326('0x41')]),_0x1bba06);if(_0x12eeda['query']['filter']){_0x1dd75d['where']=_['merge'](_0x1dd75d[_0x2326('0x48')],{'$or':_[_0x2326('0x39')](_0x1bba06,function(_0x5081e0){if(_0x5081e0[_0x2326('0x3c')]!==_0x2326('0x4a')){var _0x5a589a={};_0x5a589a[_0x5081e0['name']]={'$like':'%'+_0x12eeda[_0x2326('0x3f')]['filter']+'%'};return _0x5a589a;}})});}_0x1dd75d=_[_0x2326('0x4b')]({},_0x1dd75d,_0x12eeda[_0x2326('0x4c')]);var _0x4e8010={'where':_0x1dd75d[_0x2326('0x48')]};return db[_0x2326('0x3a')][_0x2326('0x4d')](_0x4e8010)[_0x2326('0x20')](function(_0x18dc8d){_0x4c16b2['count']=_0x18dc8d;if(_0x12eeda[_0x2326('0x3f')][_0x2326('0x4e')]){_0x1dd75d[_0x2326('0x4f')]=[{'all':!![]}];}return db[_0x2326('0x3a')]['findAll'](_0x1dd75d);})[_0x2326('0x20')](function(_0x5b8943){_0x4c16b2[_0x2326('0x50')]=_0x5b8943;return _0x4c16b2;})[_0x2326('0x20')](respondWithFilteredResult(_0x1ed2b2,_0x1dd75d))[_0x2326('0x51')](handleError(_0x1ed2b2,null));};exports[_0x2326('0x52')]=function(_0x766e84,_0x52857c){var _0x33981a={'raw':!![],'where':{'id':_0x766e84['params']['id']}},_0x599e2f={};_0x599e2f['model']=_[_0x2326('0x40')](db[_0x2326('0x3a')][_0x2326('0x3b')]);_0x599e2f['query']=_[_0x2326('0x40')](_0x766e84['query']);_0x599e2f[_0x2326('0x41')]=_[_0x2326('0x42')](_0x599e2f[_0x2326('0x3e')],_0x599e2f[_0x2326('0x3f')]);_0x33981a[_0x2326('0x44')]=_[_0x2326('0x42')](_0x599e2f[_0x2326('0x3e')],qs['fields'](_0x766e84[_0x2326('0x3f')]['fields']));_0x33981a[_0x2326('0x44')]=_0x33981a['attributes']['length']?_0x33981a[_0x2326('0x44')]:_0x599e2f[_0x2326('0x3e')];if(_0x766e84[_0x2326('0x3f')]['includeAll']){_0x33981a[_0x2326('0x4f')]=[{'all':!![]}];}_0x33981a=_[_0x2326('0x4b')]({},_0x33981a,_0x766e84[_0x2326('0x4c')]);return db[_0x2326('0x3a')][_0x2326('0x53')](_0x33981a)[_0x2326('0x20')](handleEntityNotFound(_0x52857c,null))['then'](respondWithResult(_0x52857c,null))['catch'](handleError(_0x52857c,null));};exports[_0x2326('0x54')]=function(_0x24d1af,_0xa41d73){return db['ChatGroup'][_0x2326('0x54')](_0x24d1af[_0x2326('0x55')],{})['then'](respondWithResult(_0xa41d73,0xc9))[_0x2326('0x51')](handleError(_0xa41d73,null));};exports[_0x2326('0x33')]=function(_0x1350e4,_0x1fbb2f){if(_0x1350e4[_0x2326('0x55')]['id']){delete _0x1350e4[_0x2326('0x55')]['id'];}return db[_0x2326('0x3a')][_0x2326('0x53')]({'where':{'id':_0x1350e4[_0x2326('0x56')]['id']}})[_0x2326('0x20')](handleEntityNotFound(_0x1fbb2f,null))[_0x2326('0x20')](saveUpdates(_0x1350e4[_0x2326('0x55')],null))[_0x2326('0x20')](respondWithResult(_0x1fbb2f,null))[_0x2326('0x51')](handleError(_0x1fbb2f,null));};exports[_0x2326('0x34')]=function(_0x5e6480,_0x30f070){return db[_0x2326('0x3a')][_0x2326('0x53')]({'where':{'id':_0x5e6480[_0x2326('0x56')]['id']}})['then'](handleEntityNotFound(_0x30f070,null))[_0x2326('0x20')](removeEntity(_0x30f070,null))[_0x2326('0x51')](handleError(_0x30f070,null));};exports['describe']=function(_0x51b5d5,_0x5d150c){return db[_0x2326('0x3a')][_0x2326('0x57')]()[_0x2326('0x20')](respondWithResult(_0x5d150c,null))[_0x2326('0x51')](handleError(_0x5d150c,null));};exports[_0x2326('0x58')]=function(_0x4b87fa,_0x43d6aa,_0x1d74f9){return db[_0x2326('0x59')][_0x2326('0x4d')]({'where':{'ChatGroupId':_0x4b87fa['params']['id'],'ToId':_0x4b87fa['user']['id'],'read':![]}})[_0x2326('0x20')](function(_0x566262){return{'id':_[_0x2326('0x5a')](_0x4b87fa['params']['id']),'count':_0x566262};})[_0x2326('0x20')](respondWithResult(_0x43d6aa,null))[_0x2326('0x51')](handleError(_0x43d6aa,null));};exports['addMembers']=function(_0x506a38,_0x4f192b,_0x454f7a){return db[_0x2326('0x3a')]['find']({'where':{'id':_0x506a38['params']['id']}})[_0x2326('0x20')](handleEntityNotFound(_0x4f192b,null))[_0x2326('0x20')](function(_0x566bec){if(_0x566bec){return _0x566bec['addMembers'](_0x506a38['body'][_0x2326('0x5b')],_[_0x2326('0x5c')](_0x506a38['body'],[_0x2326('0x5b'),'id'])||{});}})[_0x2326('0x20')](respondWithResult(_0x4f192b,null))['catch'](handleError(_0x4f192b,null));};exports['getMembers']=function(_0x2c18d7,_0x1c124a,_0x2100cc){var _0x30de99={};var _0x57efa4={};var _0x2eeb00;var _0x1a3b74;return db[_0x2326('0x3a')]['findOne']({'where':{'id':_0x2c18d7[_0x2326('0x56')]['id']}})[_0x2326('0x20')](handleEntityNotFound(_0x1c124a,null))[_0x2326('0x20')](function(_0x406f56){if(_0x406f56){_0x2eeb00=_0x406f56;_0x57efa4[_0x2326('0x3e')]=_[_0x2326('0x40')](db[_0x2326('0x5d')][_0x2326('0x3b')]);_0x57efa4[_0x2326('0x3f')]=_[_0x2326('0x40')](_0x2c18d7[_0x2326('0x3f')]);_0x57efa4[_0x2326('0x41')]=_[_0x2326('0x42')](_0x57efa4[_0x2326('0x3e')],_0x57efa4['query']);_0x30de99[_0x2326('0x44')]=_[_0x2326('0x42')](_0x57efa4['model'],qs[_0x2326('0x43')](_0x2c18d7[_0x2326('0x3f')][_0x2326('0x43')]));_0x30de99['attributes']=_0x30de99[_0x2326('0x44')][_0x2326('0x5e')]?_0x30de99[_0x2326('0x44')]:_0x57efa4['model'];_0x30de99['order']=qs[_0x2326('0x47')](_0x2c18d7[_0x2326('0x3f')]['sort']);_0x30de99[_0x2326('0x48')]=qs['filters'](_[_0x2326('0x49')](_0x2c18d7[_0x2326('0x3f')],_0x57efa4[_0x2326('0x41')]));if(_0x2c18d7[_0x2326('0x3f')][_0x2326('0x5f')]){_0x30de99[_0x2326('0x48')]=_[_0x2326('0x4b')](_0x30de99[_0x2326('0x48')],{'$or':_[_0x2326('0x39')](_0x30de99[_0x2326('0x44')],function(_0x3c7146){var _0x127c40={};_0x127c40[_0x3c7146]={'$like':'%'+_0x2c18d7['query'][_0x2326('0x5f')]+'%'};return _0x127c40;})});}_0x30de99=_[_0x2326('0x4b')]({},_0x30de99,_0x2c18d7[_0x2326('0x4c')]);return _0x2eeb00[_0x2326('0x60')](_0x30de99);}})['then'](function(_0x10043c){if(_0x10043c){_0x1a3b74=_0x10043c[_0x2326('0x5e')];if(!_0x2c18d7[_0x2326('0x3f')][_0x2326('0x45')]('nolimit')){_0x30de99[_0x2326('0x2c')]=qs[_0x2326('0x2c')](_0x2c18d7['query'][_0x2326('0x2c')]);_0x30de99[_0x2326('0x2b')]=qs[_0x2326('0x2b')](_0x2c18d7[_0x2326('0x3f')][_0x2326('0x2b')]);}return _0x2eeb00['getMembers'](_0x30de99);}})['then'](function(_0x5f5119){if(_0x5f5119){return _0x5f5119?{'count':_0x1a3b74,'rows':_0x5f5119}:null;}})['then'](respondWithResult(_0x1c124a,null))['catch'](handleError(_0x1c124a,null));};exports[_0x2326('0x61')]=function(_0x5da71a,_0x51adc0,_0x528d0e){return db['ChatGroup']['find']({'where':{'id':_0x5da71a['params']['id']}})[_0x2326('0x20')](handleEntityNotFound(_0x51adc0,null))[_0x2326('0x20')](function(_0x459d19){if(_0x459d19){return _0x459d19[_0x2326('0x61')](_0x5da71a[_0x2326('0x3f')][_0x2326('0x5b')]);}})[_0x2326('0x20')](respondWithStatusCode(_0x51adc0,null))[_0x2326('0x51')](handleError(_0x51adc0,null));};exports['addMessage']=function(_0x363533,_0x52d3f1,_0x700b72){if(_0x363533[_0x2326('0x55')]['id']){delete _0x363533[_0x2326('0x55')]['id'];}return db['ChatGroup'][_0x2326('0x53')]({'where':{'id':_0x363533[_0x2326('0x56')]['id']}})['then'](handleEntityNotFound(_0x52d3f1,null))[_0x2326('0x20')](function(_0x20a274){if(_0x20a274){_0x363533[_0x2326('0x55')][_0x2326('0x62')]=_0x20a274['id'];return db[_0x2326('0x59')][_0x2326('0x54')](_0x363533[_0x2326('0x55')]);}})[_0x2326('0x20')](respondWithResult(_0x52d3f1,null))[_0x2326('0x51')](handleError(_0x52d3f1,null));};exports[_0x2326('0x63')]=function(_0x296938,_0x14ebcf,_0x5e3afb){var _0x277ef8={};var _0x3f805c={};var _0x437600;var _0xc4def2;return db[_0x2326('0x3a')][_0x2326('0x64')]({'where':{'id':_0x296938[_0x2326('0x56')]['id']}})[_0x2326('0x20')](handleEntityNotFound(_0x14ebcf,null))[_0x2326('0x20')](function(_0x312ab5){if(_0x312ab5){_0x437600=_0x312ab5;_0x3f805c[_0x2326('0x3e')]=_[_0x2326('0x40')](db[_0x2326('0x59')][_0x2326('0x3b')]);_0x3f805c[_0x2326('0x3f')]=_[_0x2326('0x40')](_0x296938[_0x2326('0x3f')]);_0x3f805c[_0x2326('0x41')]=_[_0x2326('0x42')](_0x3f805c['model'],_0x3f805c[_0x2326('0x3f')]);_0x277ef8['attributes']=_[_0x2326('0x42')](_0x3f805c[_0x2326('0x3e')],qs[_0x2326('0x43')](_0x296938[_0x2326('0x3f')]['fields']));_0x277ef8[_0x2326('0x44')]=_0x277ef8['attributes'][_0x2326('0x5e')]?_0x277ef8[_0x2326('0x44')]:_0x3f805c[_0x2326('0x3e')];_0x277ef8[_0x2326('0x65')]=qs[_0x2326('0x47')](_0x296938[_0x2326('0x3f')]['sort']);_0x277ef8['where']=qs[_0x2326('0x41')](_[_0x2326('0x49')](_0x296938[_0x2326('0x3f')],_0x3f805c[_0x2326('0x41')]));if(_0x296938[_0x2326('0x3f')][_0x2326('0x5f')]){_0x277ef8[_0x2326('0x48')]=_[_0x2326('0x4b')](_0x277ef8[_0x2326('0x48')],{'$or':_[_0x2326('0x39')](_0x277ef8['attributes'],function(_0x5a2a33){var _0x292dde={};_0x292dde[_0x5a2a33]={'$like':'%'+_0x296938[_0x2326('0x3f')][_0x2326('0x5f')]+'%'};return _0x292dde;})});}if(_0x296938[_0x2326('0x3f')][_0x2326('0x66')]){var _0x346f6d=_0x296938['query'][_0x2326('0x66')][_0x2326('0x67')](',');var _0xd5558c={};_0xd5558c[_0x346f6d[0x0]]={'$gte':moment(_0x346f6d[0x1])[_0x2326('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x277ef8[_0x2326('0x48')]=_[_0x2326('0x4b')](_0x277ef8[_0x2326('0x48')],_0xd5558c);}_0x277ef8=_[_0x2326('0x4b')]({},_0x277ef8,_0x296938['options']);return _0x437600[_0x2326('0x63')](_0x277ef8);}})['then'](function(_0xb9f2b1){if(_0xb9f2b1){_0xc4def2=_0xb9f2b1[_0x2326('0x5e')];if(!_0x296938['query'][_0x2326('0x45')](_0x2326('0x46'))){_0x277ef8[_0x2326('0x2c')]=qs['limit'](_0x296938[_0x2326('0x3f')]['limit']);_0x277ef8[_0x2326('0x2b')]=qs[_0x2326('0x2b')](_0x296938[_0x2326('0x3f')]['offset']);}return _0x437600[_0x2326('0x63')](_0x277ef8);}})['then'](function(_0x2ce76a){if(_0x2ce76a){return _0x2ce76a?{'count':_0xc4def2,'rows':_0x2ce76a}:null;}})[_0x2326('0x20')](respondWithResult(_0x14ebcf,null))['catch'](handleError(_0x14ebcf,null));}; \ No newline at end of file +var _0x1f8a=['hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','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','redis','defaults','localhost','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','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','count','offset','limit','set','Content-Range','json','apply','reject','destroy','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','map','VIRTUAL','where','ChatGroup','includeAll','include','findAll','rows','show','params','options','find','create','update','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','keys','User','pick'];(function(_0x52c2ad,_0x2adc78){var _0x30122a=function(_0x64147f){while(--_0x64147f){_0x52c2ad['push'](_0x52c2ad['shift']());}};_0x30122a(++_0x2adc78);}(_0x1f8a,0x1d9));var _0xa1f8=function(_0x5e18b5,_0x35807e){_0x5e18b5=_0x5e18b5-0x0;var _0x2a0cd2=_0x1f8a[_0x5e18b5];return _0x2a0cd2;};'use strict';var pdf=require(_0xa1f8('0x0'));var emlformat=require(_0xa1f8('0x1'));var rimraf=require(_0xa1f8('0x2'));var zipdir=require(_0xa1f8('0x3'));var jsonpatch=require(_0xa1f8('0x4'));var rp=require(_0xa1f8('0x5'));var moment=require(_0xa1f8('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa1f8('0x7'));var path=require(_0xa1f8('0x8'));var sox=require(_0xa1f8('0x9'));var csv=require(_0xa1f8('0xa'));var ejs=require(_0xa1f8('0xb'));var fs=require('fs');var _=require(_0xa1f8('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa1f8('0xd'));var deskjs=require(_0xa1f8('0xe'));var toCsv=require(_0xa1f8('0xa'));var querystring=require(_0xa1f8('0xf'));var Papa=require(_0xa1f8('0x10'));var Redis=require(_0xa1f8('0x11'));var authService=require(_0xa1f8('0x12'));var qs=require(_0xa1f8('0x13'));var as=require(_0xa1f8('0x14'));var hardwareService=require(_0xa1f8('0x15'));var logger=require(_0xa1f8('0x16'))(_0xa1f8('0x17'));var utils=require(_0xa1f8('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa1f8('0x19')]=_[_0xa1f8('0x1a')](config['redis'],{'host':_0xa1f8('0x1b'),'port':0x18eb});var socket=require(_0xa1f8('0x1c'))(new Redis(config['redis']));require(_0xa1f8('0x1d'))[_0xa1f8('0x1e')](socket);var jayson=require(_0xa1f8('0x1f'));var client=jayson[_0xa1f8('0x20')][_0xa1f8('0x21')]({'port':0x232a});function checkPasswordPattern(_0x184218,_0x4c2087,_0x1fe6f9){if(_0x1fe6f9){var _0x508d87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x508d87[_0xa1f8('0x22')](_0x4c2087)){return _0x184218;}else{throw new db['Sequelize'][(_0xa1f8('0x23'))](_0xa1f8('0x24'));}}else{return _0x184218;}}function respondWithRpcPromise(_0x3441bd,_0x435289,_0x47c7c2,_0x3defa1){return new BPromise(function(_0x4877b7,_0x3a8b7c){var _0x4bdb4a=_0x3defa1||client;return _0x4bdb4a[_0xa1f8('0x25')](_0x3441bd,_0x47c7c2)[_0xa1f8('0x26')](function(_0x358efd){logger['info'](_0xa1f8('0x27'),_0x435289,_0xa1f8('0x28'));logger['debug'](_0xa1f8('0x29'),_0x435289,'request\x20sent',JSON[_0xa1f8('0x2a')](_0x358efd));if(_0x358efd['error']){if(_0x358efd[_0xa1f8('0x2b')]['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x435289,_0x358efd[_0xa1f8('0x2b')][_0xa1f8('0x2c')]);return _0x3a8b7c(_0x358efd[_0xa1f8('0x2b')]['message']);}logger[_0xa1f8('0x2b')](_0xa1f8('0x27'),_0x435289,_0x358efd['error'][_0xa1f8('0x2c')]);return _0x4877b7(_0x358efd[_0xa1f8('0x2b')][_0xa1f8('0x2c')]);}else{logger[_0xa1f8('0x2d')]('ChatGroup,\x20%s,\x20%s',_0x435289,_0xa1f8('0x28'));_0x4877b7(_0x358efd[_0xa1f8('0x2e')][_0xa1f8('0x2c')]);}})[_0xa1f8('0x2f')](function(_0x4ff15b){logger[_0xa1f8('0x2b')]('ChatGroup,\x20%s,\x20%s',_0x435289,_0x4ff15b);_0x3a8b7c(_0x4ff15b);});});}function respondWithStatusCode(_0x292a5c,_0xccbe66){_0xccbe66=_0xccbe66||0xcc;return function(_0x1b3a3c){if(_0x1b3a3c){return _0x292a5c['sendStatus'](_0xccbe66);}return _0x292a5c[_0xa1f8('0x30')](_0xccbe66)[_0xa1f8('0x31')]();};}function respondWithResult(_0x26fde1,_0x271951){_0x271951=_0x271951||0xc8;return function(_0x352557){if(_0x352557){return _0x26fde1[_0xa1f8('0x30')](_0x271951)['json'](_0x352557);}};}function respondWithFilteredResult(_0x55342e,_0x27a322){return function(_0x26b862){if(_0x26b862){var _0x304bec=_0x26b862[_0xa1f8('0x32')],_0x23a85c=_0x27a322[_0xa1f8('0x33')],_0x17db38=_0x27a322[_0xa1f8('0x33')]+_0x27a322[_0xa1f8('0x34')],_0x37d11e;if(_0x17db38>=_0x304bec){_0x17db38=_0x304bec;_0x37d11e=0xc8;}else{_0x37d11e=0xce;}_0x55342e['status'](_0x37d11e);return _0x55342e[_0xa1f8('0x35')](_0xa1f8('0x36'),_0x23a85c+'-'+_0x17db38+'/'+_0x304bec)[_0xa1f8('0x37')](_0x26b862);}return null;};}function patchUpdates(_0x2ea556){return function(_0x5e1579){try{jsonpatch[_0xa1f8('0x38')](_0x5e1579,_0x2ea556,!![]);}catch(_0x398b4b){return BPromise[_0xa1f8('0x39')](_0x398b4b);}return _0x5e1579['save']();};}function saveUpdates(_0x1a884d,_0x38e801){return function(_0x41e50a){if(_0x41e50a){return _0x41e50a['update'](_0x1a884d)['then'](function(_0x363981){return _0x363981;});}return null;};}function removeEntity(_0x20a673,_0x23675e){return function(_0x4a642d){if(_0x4a642d){return _0x4a642d[_0xa1f8('0x3a')]()[_0xa1f8('0x26')](function(){_0x20a673[_0xa1f8('0x30')](0xcc)[_0xa1f8('0x31')]();});}};}function handleEntityNotFound(_0x131cc1,_0x42b346){return function(_0x5b426d){if(!_0x5b426d){_0x131cc1[_0xa1f8('0x3b')](0x194);}return _0x5b426d;};}function handleError(_0x30d34a,_0x1ad2a1){_0x1ad2a1=_0x1ad2a1||0x1f4;return function(_0x2ccbfc){logger[_0xa1f8('0x2b')](_0x2ccbfc[_0xa1f8('0x3c')]);if(_0x2ccbfc[_0xa1f8('0x3d')]){delete _0x2ccbfc[_0xa1f8('0x3d')];}_0x30d34a[_0xa1f8('0x30')](_0x1ad2a1)['send'](_0x2ccbfc);};}exports[_0xa1f8('0x3e')]=function(_0x1bb131,_0x14c313){var _0x21ce4b={},_0x3d7262={},_0x1ddb67={'count':0x0,'rows':[]};var _0x1fd43a=_['map'](db['ChatGroup'][_0xa1f8('0x3f')],function(_0x1a66a0){return{'name':_0x1a66a0[_0xa1f8('0x40')],'type':_0x1a66a0[_0xa1f8('0x41')][_0xa1f8('0x42')]};});_0x3d7262['model']=_['map'](_0x1fd43a,_0xa1f8('0x3d'));_0x3d7262[_0xa1f8('0x43')]=_['keys'](_0x1bb131[_0xa1f8('0x43')]);_0x3d7262[_0xa1f8('0x44')]=_[_0xa1f8('0x45')](_0x3d7262[_0xa1f8('0x46')],_0x3d7262[_0xa1f8('0x43')]);_0x21ce4b[_0xa1f8('0x47')]=_['intersection'](_0x3d7262[_0xa1f8('0x46')],qs[_0xa1f8('0x48')](_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x48')]));_0x21ce4b[_0xa1f8('0x47')]=_0x21ce4b[_0xa1f8('0x47')][_0xa1f8('0x49')]?_0x21ce4b[_0xa1f8('0x47')]:_0x3d7262[_0xa1f8('0x46')];if(!_0x1bb131[_0xa1f8('0x43')]['hasOwnProperty'](_0xa1f8('0x4a'))){_0x21ce4b[_0xa1f8('0x34')]=qs[_0xa1f8('0x34')](_0x1bb131['query'][_0xa1f8('0x34')]);_0x21ce4b['offset']=qs[_0xa1f8('0x33')](_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x33')]);}_0x21ce4b[_0xa1f8('0x4b')]=qs[_0xa1f8('0x4c')](_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x4c')]);_0x21ce4b['where']=qs[_0xa1f8('0x44')](_['pick'](_0x1bb131[_0xa1f8('0x43')],_0x3d7262[_0xa1f8('0x44')]),_0x1fd43a);if(_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x4d')]){_0x21ce4b['where']=_[_0xa1f8('0x4e')](_0x21ce4b['where'],{'$or':_[_0xa1f8('0x4f')](_0x1fd43a,function(_0xde9096){if(_0xde9096['type']!==_0xa1f8('0x50')){var _0x297259={};_0x297259[_0xde9096[_0xa1f8('0x3d')]]={'$like':'%'+_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x4d')]+'%'};return _0x297259;}})});}_0x21ce4b=_[_0xa1f8('0x4e')]({},_0x21ce4b,_0x1bb131['options']);var _0x2dada5={'where':_0x21ce4b[_0xa1f8('0x51')]};return db[_0xa1f8('0x52')]['count'](_0x2dada5)[_0xa1f8('0x26')](function(_0x33f381){_0x1ddb67[_0xa1f8('0x32')]=_0x33f381;if(_0x1bb131[_0xa1f8('0x43')][_0xa1f8('0x53')]){_0x21ce4b[_0xa1f8('0x54')]=[{'all':!![]}];}return db[_0xa1f8('0x52')][_0xa1f8('0x55')](_0x21ce4b);})[_0xa1f8('0x26')](function(_0x369143){_0x1ddb67[_0xa1f8('0x56')]=_0x369143;return _0x1ddb67;})[_0xa1f8('0x26')](respondWithFilteredResult(_0x14c313,_0x21ce4b))[_0xa1f8('0x2f')](handleError(_0x14c313,null));};exports[_0xa1f8('0x57')]=function(_0x1877de,_0x5c7565){var _0x15d143={'raw':!![],'where':{'id':_0x1877de[_0xa1f8('0x58')]['id']}},_0x5be979={};_0x5be979[_0xa1f8('0x46')]=_['keys'](db[_0xa1f8('0x52')]['rawAttributes']);_0x5be979[_0xa1f8('0x43')]=_['keys'](_0x1877de[_0xa1f8('0x43')]);_0x5be979[_0xa1f8('0x44')]=_['intersection'](_0x5be979[_0xa1f8('0x46')],_0x5be979[_0xa1f8('0x43')]);_0x15d143['attributes']=_[_0xa1f8('0x45')](_0x5be979[_0xa1f8('0x46')],qs[_0xa1f8('0x48')](_0x1877de['query'][_0xa1f8('0x48')]));_0x15d143[_0xa1f8('0x47')]=_0x15d143[_0xa1f8('0x47')][_0xa1f8('0x49')]?_0x15d143[_0xa1f8('0x47')]:_0x5be979[_0xa1f8('0x46')];if(_0x1877de['query']['includeAll']){_0x15d143[_0xa1f8('0x54')]=[{'all':!![]}];}_0x15d143=_['merge']({},_0x15d143,_0x1877de[_0xa1f8('0x59')]);return db['ChatGroup'][_0xa1f8('0x5a')](_0x15d143)['then'](handleEntityNotFound(_0x5c7565,null))[_0xa1f8('0x26')](respondWithResult(_0x5c7565,null))[_0xa1f8('0x2f')](handleError(_0x5c7565,null));};exports['create']=function(_0x51bf9c,_0x2c3f0b){return db[_0xa1f8('0x52')][_0xa1f8('0x5b')](_0x51bf9c['body'],{})[_0xa1f8('0x26')](respondWithResult(_0x2c3f0b,0xc9))[_0xa1f8('0x2f')](handleError(_0x2c3f0b,null));};exports[_0xa1f8('0x5c')]=function(_0x1d94e6,_0x572f1c){if(_0x1d94e6['body']['id']){delete _0x1d94e6[_0xa1f8('0x5d')]['id'];}return db[_0xa1f8('0x52')][_0xa1f8('0x5a')]({'where':{'id':_0x1d94e6[_0xa1f8('0x58')]['id']}})[_0xa1f8('0x26')](handleEntityNotFound(_0x572f1c,null))[_0xa1f8('0x26')](saveUpdates(_0x1d94e6[_0xa1f8('0x5d')],null))[_0xa1f8('0x26')](respondWithResult(_0x572f1c,null))['catch'](handleError(_0x572f1c,null));};exports[_0xa1f8('0x3a')]=function(_0x45acbc,_0x2d2bf8){return db['ChatGroup']['find']({'where':{'id':_0x45acbc['params']['id']}})['then'](handleEntityNotFound(_0x2d2bf8,null))[_0xa1f8('0x26')](removeEntity(_0x2d2bf8,null))[_0xa1f8('0x2f')](handleError(_0x2d2bf8,null));};exports[_0xa1f8('0x5e')]=function(_0x402be8,_0x1f2461){return db['ChatGroup'][_0xa1f8('0x5e')]()[_0xa1f8('0x26')](respondWithResult(_0x1f2461,null))[_0xa1f8('0x2f')](handleError(_0x1f2461,null));};exports[_0xa1f8('0x5f')]=function(_0x2e0295,_0x2273ad,_0x107f0a){return db[_0xa1f8('0x60')]['count']({'where':{'ChatGroupId':_0x2e0295['params']['id'],'ToId':_0x2e0295[_0xa1f8('0x61')]['id'],'read':![]}})[_0xa1f8('0x26')](function(_0x274cd0){return{'id':_[_0xa1f8('0x62')](_0x2e0295[_0xa1f8('0x58')]['id']),'count':_0x274cd0};})[_0xa1f8('0x26')](respondWithResult(_0x2273ad,null))['catch'](handleError(_0x2273ad,null));};exports[_0xa1f8('0x63')]=function(_0x4403b6,_0x1e6e5b,_0x4bf73b){return db[_0xa1f8('0x52')]['find']({'where':{'id':_0x4403b6['params']['id']}})[_0xa1f8('0x26')](handleEntityNotFound(_0x1e6e5b,null))[_0xa1f8('0x26')](function(_0x35551e){if(_0x35551e){return _0x35551e[_0xa1f8('0x63')](_0x4403b6[_0xa1f8('0x5d')][_0xa1f8('0x64')],_[_0xa1f8('0x65')](_0x4403b6[_0xa1f8('0x5d')],[_0xa1f8('0x64'),'id'])||{});}})['then'](respondWithResult(_0x1e6e5b,null))[_0xa1f8('0x2f')](handleError(_0x1e6e5b,null));};exports[_0xa1f8('0x66')]=function(_0x20cbe8,_0x193663,_0x2b1f5a){var _0x1e6783={};var _0x36cbdd={};var _0x534520;var _0x1be815;return db[_0xa1f8('0x52')][_0xa1f8('0x67')]({'where':{'id':_0x20cbe8['params']['id']}})[_0xa1f8('0x26')](handleEntityNotFound(_0x193663,null))[_0xa1f8('0x26')](function(_0x638740){if(_0x638740){_0x534520=_0x638740;_0x36cbdd[_0xa1f8('0x46')]=_[_0xa1f8('0x68')](db[_0xa1f8('0x69')][_0xa1f8('0x3f')]);_0x36cbdd[_0xa1f8('0x43')]=_[_0xa1f8('0x68')](_0x20cbe8[_0xa1f8('0x43')]);_0x36cbdd['filters']=_[_0xa1f8('0x45')](_0x36cbdd[_0xa1f8('0x46')],_0x36cbdd['query']);_0x1e6783[_0xa1f8('0x47')]=_[_0xa1f8('0x45')](_0x36cbdd[_0xa1f8('0x46')],qs[_0xa1f8('0x48')](_0x20cbe8[_0xa1f8('0x43')]['fields']));_0x1e6783[_0xa1f8('0x47')]=_0x1e6783[_0xa1f8('0x47')]['length']?_0x1e6783['attributes']:_0x36cbdd[_0xa1f8('0x46')];_0x1e6783['order']=qs[_0xa1f8('0x4c')](_0x20cbe8['query'][_0xa1f8('0x4c')]);_0x1e6783[_0xa1f8('0x51')]=qs[_0xa1f8('0x44')](_[_0xa1f8('0x6a')](_0x20cbe8['query'],_0x36cbdd['filters']));if(_0x20cbe8[_0xa1f8('0x43')]['filter']){_0x1e6783[_0xa1f8('0x51')]=_[_0xa1f8('0x4e')](_0x1e6783[_0xa1f8('0x51')],{'$or':_[_0xa1f8('0x4f')](_0x1e6783['attributes'],function(_0x13372b){var _0x4eb231={};_0x4eb231[_0x13372b]={'$like':'%'+_0x20cbe8['query'][_0xa1f8('0x4d')]+'%'};return _0x4eb231;})});}_0x1e6783=_[_0xa1f8('0x4e')]({},_0x1e6783,_0x20cbe8['options']);return _0x534520[_0xa1f8('0x66')](_0x1e6783);}})[_0xa1f8('0x26')](function(_0x5cb237){if(_0x5cb237){_0x1be815=_0x5cb237['length'];if(!_0x20cbe8[_0xa1f8('0x43')][_0xa1f8('0x6b')](_0xa1f8('0x4a'))){_0x1e6783['limit']=qs[_0xa1f8('0x34')](_0x20cbe8[_0xa1f8('0x43')][_0xa1f8('0x34')]);_0x1e6783['offset']=qs[_0xa1f8('0x33')](_0x20cbe8[_0xa1f8('0x43')][_0xa1f8('0x33')]);}return _0x534520[_0xa1f8('0x66')](_0x1e6783);}})['then'](function(_0x110d69){if(_0x110d69){return _0x110d69?{'count':_0x1be815,'rows':_0x110d69}:null;}})['then'](respondWithResult(_0x193663,null))['catch'](handleError(_0x193663,null));};exports['removeMembers']=function(_0x1bc0b4,_0x19a420,_0x2e95bd){return db['ChatGroup'][_0xa1f8('0x5a')]({'where':{'id':_0x1bc0b4[_0xa1f8('0x58')]['id']}})[_0xa1f8('0x26')](handleEntityNotFound(_0x19a420,null))[_0xa1f8('0x26')](function(_0x161b26){if(_0x161b26){return _0x161b26[_0xa1f8('0x6c')](_0x1bc0b4[_0xa1f8('0x43')][_0xa1f8('0x64')]);}})['then'](respondWithStatusCode(_0x19a420,null))['catch'](handleError(_0x19a420,null));};exports[_0xa1f8('0x6d')]=function(_0x3bacfa,_0x4737cd,_0x1cdf26){if(_0x3bacfa['body']['id']){delete _0x3bacfa['body']['id'];}return db['ChatGroup'][_0xa1f8('0x5a')]({'where':{'id':_0x3bacfa[_0xa1f8('0x58')]['id']}})['then'](handleEntityNotFound(_0x4737cd,null))[_0xa1f8('0x26')](function(_0x57bbe1){if(_0x57bbe1){_0x3bacfa[_0xa1f8('0x5d')][_0xa1f8('0x6e')]=_0x57bbe1['id'];return db[_0xa1f8('0x60')][_0xa1f8('0x5b')](_0x3bacfa[_0xa1f8('0x5d')]);}})[_0xa1f8('0x26')](respondWithResult(_0x4737cd,null))[_0xa1f8('0x2f')](handleError(_0x4737cd,null));};exports[_0xa1f8('0x6f')]=function(_0x1f5039,_0x29496b,_0x3a7607){var _0x2af271={};var _0x453206={};var _0x50c2b6;var _0x351c7c;return db[_0xa1f8('0x52')][_0xa1f8('0x67')]({'where':{'id':_0x1f5039[_0xa1f8('0x58')]['id']}})[_0xa1f8('0x26')](handleEntityNotFound(_0x29496b,null))[_0xa1f8('0x26')](function(_0x4985d6){if(_0x4985d6){_0x50c2b6=_0x4985d6;_0x453206[_0xa1f8('0x46')]=_[_0xa1f8('0x68')](db[_0xa1f8('0x60')]['rawAttributes']);_0x453206['query']=_[_0xa1f8('0x68')](_0x1f5039[_0xa1f8('0x43')]);_0x453206[_0xa1f8('0x44')]=_[_0xa1f8('0x45')](_0x453206[_0xa1f8('0x46')],_0x453206[_0xa1f8('0x43')]);_0x2af271[_0xa1f8('0x47')]=_['intersection'](_0x453206[_0xa1f8('0x46')],qs['fields'](_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x48')]));_0x2af271[_0xa1f8('0x47')]=_0x2af271[_0xa1f8('0x47')][_0xa1f8('0x49')]?_0x2af271[_0xa1f8('0x47')]:_0x453206[_0xa1f8('0x46')];_0x2af271[_0xa1f8('0x4b')]=qs[_0xa1f8('0x4c')](_0x1f5039[_0xa1f8('0x43')]['sort']);_0x2af271[_0xa1f8('0x51')]=qs[_0xa1f8('0x44')](_[_0xa1f8('0x6a')](_0x1f5039[_0xa1f8('0x43')],_0x453206[_0xa1f8('0x44')]));if(_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x4d')]){_0x2af271[_0xa1f8('0x51')]=_[_0xa1f8('0x4e')](_0x2af271[_0xa1f8('0x51')],{'$or':_[_0xa1f8('0x4f')](_0x2af271[_0xa1f8('0x47')],function(_0x14feaf){var _0x2b54f1={};_0x2b54f1[_0x14feaf]={'$like':'%'+_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x4d')]+'%'};return _0x2b54f1;})});}if(_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x70')]){var _0x3cb650=_0x1f5039['query'][_0xa1f8('0x70')][_0xa1f8('0x71')](',');var _0x1f7412={};_0x1f7412[_0x3cb650[0x0]]={'$gte':moment(_0x3cb650[0x1])[_0xa1f8('0x72')](_0xa1f8('0x73'))};_0x2af271[_0xa1f8('0x51')]=_[_0xa1f8('0x4e')](_0x2af271[_0xa1f8('0x51')],_0x1f7412);}_0x2af271=_[_0xa1f8('0x4e')]({},_0x2af271,_0x1f5039['options']);return _0x50c2b6[_0xa1f8('0x6f')](_0x2af271);}})['then'](function(_0x166322){if(_0x166322){_0x351c7c=_0x166322[_0xa1f8('0x49')];if(!_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x6b')]('nolimit')){_0x2af271[_0xa1f8('0x34')]=qs['limit'](_0x1f5039[_0xa1f8('0x43')][_0xa1f8('0x34')]);_0x2af271[_0xa1f8('0x33')]=qs[_0xa1f8('0x33')](_0x1f5039[_0xa1f8('0x43')]['offset']);}return _0x50c2b6['getMessages'](_0x2af271);}})[_0xa1f8('0x26')](function(_0x3bb92f){if(_0x3bb92f){return _0x3bb92f?{'count':_0x351c7c,'rows':_0x3bb92f}:null;}})['then'](respondWithResult(_0x29496b,null))[_0xa1f8('0x2f')](handleError(_0x29496b,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1eed676..5b5baa8 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 _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x176b86,_0x260b34){var _0x2ed0d5=function(_0x118618){while(--_0x118618){_0x176b86['push'](_0x176b86['shift']());}};_0x2ed0d5(++_0x260b34);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0x0b0e[_0x4880fd];return _0x4a4b50;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x269658,_0x50e08d){var _0x268a6b=function(_0x33313e){while(--_0x33313e){_0x269658['push'](_0x269658['shift']());}};_0x268a6b(++_0x50e08d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ef040,_0xc6201d){_0x1ef040=_0x1ef040-0x0;var _0x45d6d6=_0x5f2f[_0x1ef040];return _0x45d6d6;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatGroup=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatGroupEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatGroupEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatGroup[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 7e4e4ae..59dd19e 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 _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util'];(function(_0x1d1f81,_0x41029b){var _0x4e8d95=function(_0x391859){while(--_0x391859){_0x1d1f81['push'](_0x1d1f81['shift']());}};_0x4e8d95(++_0x41029b);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xa4ba[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('ChatGroup',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1666=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups'];(function(_0x30240a,_0x53544c){var _0x246313=function(_0x24f3c0){while(--_0x24f3c0){_0x30240a['push'](_0x30240a['shift']());}};_0x246313(++_0x53544c);}(_0x1666,0x75));var _0x6166=function(_0x17acbf,_0x5a5971){_0x17acbf=_0x17acbf-0x0;var _0x45106c=_0x1666[_0x17acbf];return _0x45106c;};'use strict';var _=require(_0x6166('0x0'));var util=require(_0x6166('0x1'));var logger=require('../../config/logger')(_0x6166('0x2'));var moment=require(_0x6166('0x3'));var BPromise=require(_0x6166('0x4'));var rp=require(_0x6166('0x5'));var fs=require('fs');var path=require(_0x6166('0x6'));var rimraf=require(_0x6166('0x7'));var config=require(_0x6166('0x8'));var attributes=require(_0x6166('0x9'));module['exports']=function(_0x2ee359,_0x1d4f2a){return _0x2ee359[_0x6166('0xa')](_0x6166('0xb'),attributes,{'tableName':_0x6166('0xc'),'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 be151fe..b76da5d 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 _0xf767=['error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf767,0x18d));var _0x7f76=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xf767[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require(_0x7f76('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f76('0x1'));var fs=require('fs');var Redis=require(_0x7f76('0x2'));var db=require(_0x7f76('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f76('0x4'))(_0x7f76('0x5'));var config=require(_0x7f76('0x6'));var jayson=require(_0x7f76('0x7'));var client=jayson[_0x7f76('0x8')][_0x7f76('0x9')]({'port':0x232a});config[_0x7f76('0xa')]=_[_0x7f76('0xb')](config['redis'],{'host':_0x7f76('0xc'),'port':0x18eb});var socket=require(_0x7f76('0xd'))(new Redis(config[_0x7f76('0xa')]));require(_0x7f76('0xe'))[_0x7f76('0xf')](socket);function respondWithRpcPromise(_0x4a4563,_0x11033e,_0x498427){return new BPromise(function(_0x417aea,_0x787a06){return client['request'](_0x4a4563,_0x498427)[_0x7f76('0x10')](function(_0x838873){logger[_0x7f76('0x11')](_0x7f76('0x12'),_0x11033e,_0x7f76('0x13'));logger[_0x7f76('0x14')](_0x7f76('0x15'),_0x11033e,_0x7f76('0x13'),JSON[_0x7f76('0x16')](_0x838873));if(_0x838873[_0x7f76('0x17')]){if(_0x838873[_0x7f76('0x17')][_0x7f76('0x18')]===0x1f4){logger[_0x7f76('0x17')](_0x7f76('0x12'),_0x11033e,_0x838873[_0x7f76('0x17')][_0x7f76('0x19')]);return _0x787a06(_0x838873[_0x7f76('0x17')][_0x7f76('0x19')]);}logger[_0x7f76('0x17')](_0x7f76('0x12'),_0x11033e,_0x838873[_0x7f76('0x17')][_0x7f76('0x19')]);return _0x417aea(_0x838873[_0x7f76('0x17')][_0x7f76('0x19')]);}else{logger[_0x7f76('0x11')](_0x7f76('0x12'),_0x11033e,_0x7f76('0x13'));_0x417aea(_0x838873[_0x7f76('0x1a')][_0x7f76('0x19')]);}})[_0x7f76('0x1b')](function(_0x27eeee){logger[_0x7f76('0x17')](_0x7f76('0x12'),_0x11033e,_0x27eeee);_0x787a06(_0x27eeee);});});} \ No newline at end of file +var _0xc8fd=['ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc8fd,0x102));var _0xdc8f=function(_0x2337f2,_0x591d5d){_0x2337f2=_0x2337f2-0x0;var _0x9488a2=_0xc8fd[_0x2337f2];return _0x9488a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdc8f('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc8f('0x1'))['db'];var utils=require(_0xdc8f('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc8f('0x3'));var jayson=require(_0xdc8f('0x4'));var client=jayson[_0xdc8f('0x5')][_0xdc8f('0x6')]({'port':0x232a});config[_0xdc8f('0x7')]=_[_0xdc8f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdc8f('0x9'))(new Redis(config[_0xdc8f('0x7')]));require(_0xdc8f('0xa'))[_0xdc8f('0xb')](socket);function respondWithRpcPromise(_0x4c1dce,_0x211cf5,_0x5c2728){return new BPromise(function(_0x43a978,_0xe86349){return client['request'](_0x4c1dce,_0x5c2728)[_0xdc8f('0xc')](function(_0xecf6bd){logger[_0xdc8f('0xd')](_0xdc8f('0xe'),_0x211cf5,'request\x20sent');logger['debug'](_0xdc8f('0xf'),_0x211cf5,'request\x20sent',JSON['stringify'](_0xecf6bd));if(_0xecf6bd['error']){if(_0xecf6bd[_0xdc8f('0x10')][_0xdc8f('0x11')]===0x1f4){logger['error'](_0xdc8f('0xe'),_0x211cf5,_0xecf6bd[_0xdc8f('0x10')][_0xdc8f('0x12')]);return _0xe86349(_0xecf6bd[_0xdc8f('0x10')][_0xdc8f('0x12')]);}logger[_0xdc8f('0x10')](_0xdc8f('0xe'),_0x211cf5,_0xecf6bd[_0xdc8f('0x10')][_0xdc8f('0x12')]);return _0x43a978(_0xecf6bd[_0xdc8f('0x10')][_0xdc8f('0x12')]);}else{logger['info'](_0xdc8f('0xe'),_0x211cf5,'request\x20sent');_0x43a978(_0xecf6bd[_0xdc8f('0x13')][_0xdc8f('0x12')]);}})[_0xdc8f('0x14')](function(_0x3e72a0){logger[_0xdc8f('0x10')](_0xdc8f('0xe'),_0x211cf5,_0x3e72a0);_0xe86349(_0x3e72a0);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 20d0b10..3d08fbe 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 _0x8cca=['save','remove','emit','removeListener','register','./chatGroup.events'];(function(_0x15049e,_0x4e66bb){var _0x865413=function(_0x377558){while(--_0x377558){_0x15049e['push'](_0x15049e['shift']());}};_0x865413(++_0x4e66bb);}(_0x8cca,0xe9));var _0xa8cc=function(_0x42d861,_0x4f9b86){_0x42d861=_0x42d861-0x0;var _0x4c7bf6=_0x8cca[_0x42d861];return _0x4c7bf6;};'use strict';var ChatGroupEvents=require(_0xa8cc('0x0'));var events=[_0xa8cc('0x1'),_0xa8cc('0x2'),'update'];function createListener(_0x2e1e30,_0x37be13){return function(_0x338cda){_0x37be13[_0xa8cc('0x3')](_0x2e1e30,_0x338cda);};}function removeListener(_0x39d2c1,_0x3a00e8){return function(){ChatGroupEvents[_0xa8cc('0x4')](_0x39d2c1,_0x3a00e8);};}exports[_0xa8cc('0x5')]=function(_0x175d53){for(var _0x54e920=0x0,_0x55d95d=events['length'];_0x54e920<_0x55d95d;_0x54e920++){var _0x1f9b80=events[_0x54e920];var _0x4030ac=createListener('chatGroup:'+_0x1f9b80,_0x175d53);ChatGroupEvents['on'](_0x1f9b80,_0x4030ac);}}; \ No newline at end of file +var _0x08f3=['removeListener','register','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x2da230,_0x5a5dfc){var _0x3504a9=function(_0x5bc685){while(--_0x5bc685){_0x2da230['push'](_0x2da230['shift']());}};_0x3504a9(++_0x5a5dfc);}(_0x08f3,0x143));var _0x308f=function(_0x4712b3,_0x435df1){_0x4712b3=_0x4712b3-0x0;var _0x2448eb=_0x08f3[_0x4712b3];return _0x2448eb;};'use strict';var ChatGroupEvents=require(_0x308f('0x0'));var events=[_0x308f('0x1'),_0x308f('0x2'),_0x308f('0x3')];function createListener(_0x407dbd,_0x7cc5f7){return function(_0x16b618){_0x7cc5f7[_0x308f('0x4')](_0x407dbd,_0x16b618);};}function removeListener(_0x57f8c2,_0x2c5913){return function(){ChatGroupEvents[_0x308f('0x5')](_0x57f8c2,_0x2c5913);};}exports[_0x308f('0x6')]=function(_0x2326fa){for(var _0x3ad512=0x0,_0x2819d9=events['length'];_0x3ad512<_0x2819d9;_0x3ad512++){var _0x197ddc=events[_0x3ad512];var _0x393aca=createListener(_0x308f('0x7')+_0x197ddc,_0x2326fa);ChatGroupEvents['on'](_0x197ddc,_0x393aca);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index a004758..88db467 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 _0xd79d=['addMessage','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','describe','get','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post'];(function(_0x5cdc52,_0x33ce72){var _0x455283=function(_0x54070d){while(--_0x54070d){_0x5cdc52['push'](_0x5cdc52['shift']());}};_0x455283(++_0x33ce72);}(_0xd79d,0x14a));var _0xdd79=function(_0x17df1b,_0x4cf1d7){_0x17df1b=_0x17df1b-0x0;var _0x297263=_0xd79d[_0x17df1b];return _0x297263;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd79('0x0'));var timeout=require(_0xdd79('0x1'));var express=require(_0xdd79('0x2'));var router=express[_0xdd79('0x3')]();var auth=require(_0xdd79('0x4'));var interaction=require(_0xdd79('0x5'));var config=require(_0xdd79('0x6'));var controller=require(_0xdd79('0x7'));router['get']('/',auth[_0xdd79('0x8')](),controller[_0xdd79('0x9')]);router['get'](_0xdd79('0xa'),auth[_0xdd79('0x8')](),controller[_0xdd79('0xb')]);router[_0xdd79('0xc')]('/:id',auth[_0xdd79('0x8')](),controller['show']);router[_0xdd79('0xc')](_0xdd79('0xd'),auth[_0xdd79('0x8')](),controller[_0xdd79('0xe')]);router[_0xdd79('0xc')](_0xdd79('0xf'),auth['isAuthenticated'](),controller[_0xdd79('0x10')]);router[_0xdd79('0xc')](_0xdd79('0x11'),auth[_0xdd79('0x8')](),controller[_0xdd79('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd79('0x13')]);router[_0xdd79('0x14')](_0xdd79('0xf'),auth[_0xdd79('0x8')](),controller['addMembers']);router['post'](_0xdd79('0x11'),auth[_0xdd79('0x8')](),controller[_0xdd79('0x15')]);router[_0xdd79('0x16')](_0xdd79('0x17'),auth[_0xdd79('0x8')](),controller[_0xdd79('0x18')]);router[_0xdd79('0x19')](_0xdd79('0x17'),auth[_0xdd79('0x8')](),controller[_0xdd79('0x1a')]);router[_0xdd79('0x19')](_0xdd79('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x80a3=['../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','addMessage','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x531a78,_0x477d97){var _0x13ed6e=function(_0x11134c){while(--_0x11134c){_0x531a78['push'](_0x531a78['shift']());}};_0x13ed6e(++_0x477d97);}(_0x80a3,0x69));var _0x380a=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x80a3[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x380a('0x0'));var util=require(_0x380a('0x1'));var path=require(_0x380a('0x2'));var timeout=require(_0x380a('0x3'));var express=require(_0x380a('0x4'));var router=express[_0x380a('0x5')]();var auth=require(_0x380a('0x6'));var interaction=require(_0x380a('0x7'));var config=require(_0x380a('0x8'));var controller=require(_0x380a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x380a('0xa')]);router[_0x380a('0xb')](_0x380a('0xc'),auth[_0x380a('0xd')](),controller['describe']);router[_0x380a('0xb')](_0x380a('0xe'),auth[_0x380a('0xd')](),controller[_0x380a('0xf')]);router['get'](_0x380a('0x10'),auth[_0x380a('0xd')](),controller[_0x380a('0x11')]);router['get'](_0x380a('0x12'),auth[_0x380a('0xd')](),controller[_0x380a('0x13')]);router['get']('/:id/messages',auth[_0x380a('0xd')](),controller[_0x380a('0x14')]);router[_0x380a('0x15')]('/',auth[_0x380a('0xd')](),controller[_0x380a('0x16')]);router[_0x380a('0x15')](_0x380a('0x12'),auth[_0x380a('0xd')](),controller[_0x380a('0x17')]);router['post']('/:id/messages',auth[_0x380a('0xd')](),controller[_0x380a('0x18')]);router['put'](_0x380a('0xe'),auth[_0x380a('0xd')](),controller[_0x380a('0x19')]);router[_0x380a('0x1a')]('/:id',auth[_0x380a('0xd')](),controller[_0x380a('0x1b')]);router[_0x380a('0x1a')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);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 d5dfbef..a803a77 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 _0x9343=['star','TEXT','STRING','DATE','long','sequelize','exports','INTEGER','ENUM','thumb'];(function(_0x12dcec,_0x593c61){var _0x995eda=function(_0x295e32){while(--_0x295e32){_0x12dcec['push'](_0x12dcec['shift']());}};_0x995eda(++_0x593c61);}(_0x9343,0xaf));var _0x3934=function(_0x55b8ae,_0x28def4){_0x55b8ae=_0x55b8ae-0x0;var _0x5aba2d=_0x9343[_0x55b8ae];return _0x5aba2d;};'use strict';var Sequelize=require(_0x3934('0x0'));module[_0x3934('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3934('0x2')]},'ratingType':{'type':Sequelize[_0x3934('0x3')]('star',_0x3934('0x4')),'defaultValue':_0x3934('0x5')},'ratingMessage':{'type':Sequelize[_0x3934('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3934('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3934('0x8')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3934('0x7')]},'browserName':{'type':Sequelize[_0x3934('0x7')]},'browserVersion':{'type':Sequelize[_0x3934('0x7')]},'osName':{'type':Sequelize[_0x3934('0x7')]},'osVersion':{'type':Sequelize[_0x3934('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3934('0x6')]},'customerIp':{'type':Sequelize[_0x3934('0x7')]},'formData':{'type':Sequelize[_0x3934('0x6')](_0x3934('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3934('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3934('0x7')]},'customerPort':{'type':Sequelize[_0x3934('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x3934('0x6')]}}; \ No newline at end of file +var _0x6d6a=['ENUM','star','TEXT','STRING','DATE','out','INTEGER'];(function(_0x3556b5,_0x5eb8c1){var _0x3640bc=function(_0x731ee4){while(--_0x731ee4){_0x3556b5['push'](_0x3556b5['shift']());}};_0x3640bc(++_0x5eb8c1);}(_0x6d6a,0x68));var _0xa6d6=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x6d6a[_0x15876a];return _0xbd900f;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa6d6('0x0')]},'ratingType':{'type':Sequelize[_0xa6d6('0x1')](_0xa6d6('0x2'),'thumb'),'defaultValue':_0xa6d6('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xa6d6('0x3')]},'mailTranscript':{'type':Sequelize[_0xa6d6('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa6d6('0x5')]},'disposition':{'type':Sequelize[_0xa6d6('0x4')]},'note':{'type':Sequelize[_0xa6d6('0x4')]},'browserName':{'type':Sequelize[_0xa6d6('0x4')]},'browserVersion':{'type':Sequelize[_0xa6d6('0x4')]},'osName':{'type':Sequelize[_0xa6d6('0x4')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa6d6('0x4')]},'deviceVendor':{'type':Sequelize[_0xa6d6('0x4')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa6d6('0x4')]},'formData':{'type':Sequelize[_0xa6d6('0x3')]('long')},'read1stAt':{'type':Sequelize[_0xa6d6('0x5')]},'lastMsgAt':{'type':Sequelize[_0xa6d6('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xa6d6('0x1')]('in',_0xa6d6('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xa6d6('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index b0b63f5..2cd78bf 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 _0x2ef3=['find','ContactId','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','buildExpression','body','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','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','QueryTypes','SELECT','i.id','order','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','merge','options','create','destroy','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','basename','attachId','download','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','%s%d','agentAlias','Visitor','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','user','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','server','tmp','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','secret','read','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
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','30px','%s\x20#%d','YYYY-MM-DD','N.A.','closed','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','renderFile','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','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','client','http','test','Sequelize','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','set','apply','update','sendStatus','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','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','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','unreadMessages','value','having','`\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?'];(function(_0x3692d6,_0x36b5f5){var _0x49f104=function(_0x23c0bd){while(--_0x23c0bd){_0x3692d6['push'](_0x3692d6['shift']());}};_0x49f104(++_0x36b5f5);}(_0x2ef3,0xba));var _0x32ef=function(_0x556bb5,_0x4c317a){_0x556bb5=_0x556bb5-0x0;var _0x416342=_0x2ef3[_0x556bb5];return _0x416342;};'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('./chatInteraction.socket')[_0x32ef('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232b});var client9004=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x57aff1,_0x55bf0b,_0x531e30){if(_0x531e30){var _0x13db1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13db1a[_0x32ef('0x1f')](_0x55bf0b)){return _0x57aff1;}else{throw new db[(_0x32ef('0x20'))]['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 _0x57aff1;}}function respondWithRpcPromise(_0x1eb468,_0x1a9476,_0x286bfb,_0x57863c){return new BPromise(function(_0xbe37f6,_0x33e230){var _0x4f4c98=_0x57863c||client;return _0x4f4c98[_0x32ef('0x21')](_0x1eb468,_0x286bfb)[_0x32ef('0x22')](function(_0x26aff3){logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));logger['debug'](_0x32ef('0x26'),_0x1a9476,'request\x20sent',JSON[_0x32ef('0x27')](_0x26aff3));if(_0x26aff3[_0x32ef('0x28')]){if(_0x26aff3['error'][_0x32ef('0x29')]===0x1f4){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x26aff3['error']['message']);return _0x33e230(_0x26aff3[_0x32ef('0x28')][_0x32ef('0x2a')]);}logger[_0x32ef('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x1a9476,_0x26aff3['error'][_0x32ef('0x2a')]);return _0xbe37f6(_0x26aff3['error']['message']);}else{logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));_0xbe37f6(_0x26aff3[_0x32ef('0x2b')][_0x32ef('0x2a')]);}})[_0x32ef('0x2c')](function(_0x1874ea){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x1874ea);_0x33e230(_0x1874ea);});});}function respondWithStatusCode(_0x2f52d7,_0x1335e2){_0x1335e2=_0x1335e2||0xcc;return function(_0xba4b3f){if(_0xba4b3f){return _0x2f52d7['sendStatus'](_0x1335e2);}return _0x2f52d7[_0x32ef('0x2d')](_0x1335e2)[_0x32ef('0x2e')]();};}function respondWithResult(_0x5a04cd,_0x12de1a){_0x12de1a=_0x12de1a||0xc8;return function(_0x3c569d){if(_0x3c569d){return _0x5a04cd[_0x32ef('0x2d')](_0x12de1a)[_0x32ef('0x2f')](_0x3c569d);}};}function respondWithFilteredResult(_0x50a95b,_0x10e38c){return function(_0x22bf86){if(_0x22bf86){var _0x31dbc3=_0x22bf86[_0x32ef('0x30')],_0x2ac686=_0x10e38c['offset'],_0x1b668a=_0x10e38c[_0x32ef('0x31')]+_0x10e38c['limit'],_0x1a6ed2;if(_0x1b668a>=_0x31dbc3){_0x1b668a=_0x31dbc3;_0x1a6ed2=0xc8;}else{_0x1a6ed2=0xce;}_0x50a95b[_0x32ef('0x2d')](_0x1a6ed2);return _0x50a95b[_0x32ef('0x32')]('Content-Range',_0x2ac686+'-'+_0x1b668a+'/'+_0x31dbc3)[_0x32ef('0x2f')](_0x22bf86);}return null;};}function patchUpdates(_0x17e4d1){return function(_0x3b00ad){try{jsonpatch[_0x32ef('0x33')](_0x3b00ad,_0x17e4d1,!![]);}catch(_0x120f30){return BPromise['reject'](_0x120f30);}return _0x3b00ad['save']();};}function saveUpdates(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(_0x643dc4){return _0x643dc4[_0x32ef('0x34')](_0x2a5eb5)[_0x32ef('0x22')](function(_0x390670){return _0x390670;});}return null;};}function removeEntity(_0x389583,_0x22fa1a){return function(_0x566b56){if(_0x566b56){return _0x566b56['destroy']()['then'](function(){_0x389583[_0x32ef('0x2d')](0xcc)[_0x32ef('0x2e')]();});}};}function handleEntityNotFound(_0x136b02,_0x5f2443){return function(_0x4fb402){if(!_0x4fb402){_0x136b02[_0x32ef('0x35')](0x194);}return _0x4fb402;};}function handleError(_0x2bd8a9,_0x410334){_0x410334=_0x410334||0x1f4;return function(_0x480348){logger['error'](_0x480348[_0x32ef('0x36')]);if(_0x480348[_0x32ef('0x37')]){delete _0x480348[_0x32ef('0x37')];}_0x2bd8a9[_0x32ef('0x2d')](_0x410334)[_0x32ef('0x38')](_0x480348);};}function getInteractionUsers(_0x211c79,_0x3223d5){return new BPromise(function(_0x21da90,_0x7f2319){try{if(_0x3223d5[_0x211c79['id']]){_0x211c79['Users']=_[_0x32ef('0x39')](_0x3223d5[_0x211c79['id']],function(_0x36e374){return{'id':_0x36e374['id'],'fullname':_0x36e374[_0x32ef('0x3a')]};});}}catch(_0x4b97dc){_0x7f2319(_0x4b97dc);}_0x21da90(_0x211c79);});}function getInteractionTags(_0x365125,_0x17e489){return new BPromise(function(_0x879e33,_0x393a89){try{if(_0x365125[_0x32ef('0x3b')]){_0x365125[_0x32ef('0x3c')]=[];_0x365125[_0x32ef('0x3b')][_0x32ef('0x3d')](',')[_0x32ef('0x3e')](function(_0x57a3c0){_0x365125[_0x32ef('0x3c')][_0x32ef('0x3f')](_0x17e489[_0x57a3c0]);});}delete _0x365125['TagIds'];}catch(_0x3cac2e){_0x393a89(_0x3cac2e);}_0x879e33(_0x365125);});}function updateChatInteraction(_0xc3a6d3,_0x26a40f,_0x1733e3){return new BPromise(function(_0x2f92f5,_0x2ca66b){return getInteractionUsers(_0xc3a6d3,_0x1733e3)[_0x32ef('0x22')](function(_0x596d5a){return getInteractionTags(_0x596d5a,_0x26a40f);})['then'](function(_0x399caa){_0x2f92f5(_0x399caa);})[_0x32ef('0x2c')](function(_0x2a33dd){_0x2ca66b(_0x2a33dd);});});}exports[_0x32ef('0x40')]=function(_0x5dca14,_0x2901a1){var _0x1f323a={},_0x5d2f06={},_0x4744ba={'count':0x0,'rows':[]};var _0x4bc5bc=_[_0x32ef('0x39')](db[_0x32ef('0x41')][_0x32ef('0x42')],function(_0x3be46d){return{'name':_0x3be46d[_0x32ef('0x43')],'type':_0x3be46d[_0x32ef('0x44')][_0x32ef('0x45')]};});_0x5d2f06[_0x32ef('0x46')]=_[_0x32ef('0x39')](_0x4bc5bc,_0x32ef('0x37'));_0x5d2f06['query']=_[_0x32ef('0x47')](_0x5dca14['query']);_0x5d2f06[_0x32ef('0x48')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x46')],_0x5d2f06['query']);_0x1f323a[_0x32ef('0x4a')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x46')],qs[_0x32ef('0x4b')](_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x4b')]));_0x1f323a[_0x32ef('0x4a')]=_0x1f323a['attributes']['length']?_0x1f323a[_0x32ef('0x4a')]:_0x5d2f06[_0x32ef('0x46')];if(!_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x4d')](_0x32ef('0x4e'))){_0x1f323a[_0x32ef('0x4f')]=qs[_0x32ef('0x4f')](_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x4f')]);_0x1f323a[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x31')]);}_0x1f323a['order']=qs[_0x32ef('0x50')](_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x50')]);_0x1f323a[_0x32ef('0x51')]=qs[_0x32ef('0x48')](_[_0x32ef('0x52')](_0x5dca14[_0x32ef('0x4c')],_0x5d2f06[_0x32ef('0x48')]),_0x4bc5bc);var _0x24d8b4=[];var _0x2a366b=squel[_0x32ef('0x53')]()[_0x32ef('0x54')]('id')[_0x32ef('0x54')](_0x32ef('0x37'))[_0x32ef('0x54')](_0x32ef('0x55'))[_0x32ef('0x56')](_0x32ef('0x57'));var _0x4e0d6b=squel['select']()[_0x32ef('0x54')](_0x32ef('0x58'))[_0x32ef('0x54')](_0x32ef('0x59'))[_0x32ef('0x54')](_0x32ef('0x5a'))[_0x32ef('0x56')](_0x32ef('0x5b'),'ui')[_0x32ef('0x5c')](_0x32ef('0x5d'),'u',_0x32ef('0x5e'));var _0x4a6fd2=squel[_0x32ef('0x53')]()[_0x32ef('0x56')](_0x32ef('0x5f'),'i')[_0x32ef('0x5c')](_0x32ef('0x60'),'c',_0x32ef('0x61'))['left_join'](_0x32ef('0x5d'),'o',_0x32ef('0x62'))[_0x32ef('0x5c')]('chat_websites','a',_0x32ef('0x63'))['left_join'](_0x32ef('0x64'),'me',_0x32ef('0x65'))['left_join'](_0x32ef('0x66'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x32ef('0x5c')](_0x32ef('0x57'),'t',_0x32ef('0x67'));var _0x3a3513=squel[_0x32ef('0x68')]();var _0x30e377=[];var _0x42c7f4=squel['expr']();var _0x56cc75;if(_0x5dca14[_0x32ef('0x4c')]['search']){_0x56cc75=as['parseSearch'](_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x69')]);var _0x2ef0f8=_0x56cc75[_0x32ef('0x6a')];for(var _0x2468e6=0x0;_0x2468e6<_0x56cc75[_0x32ef('0x6b')][_0x32ef('0x6c')];_0x2468e6++){var _0x4249c3=_0x56cc75[_0x32ef('0x6b')][_0x2468e6];var _0x123571='i';var _0x4c125c=_['find'](_0x4bc5bc,[_0x32ef('0x37'),_0x4249c3[_0x32ef('0x54')]]);if(!_0x4c125c){switch(_0x4249c3['field']){case _0x32ef('0x6d'):if(_0x4249c3[_0x32ef('0x6e')]==0x1){_0x4a6fd2[_0x32ef('0x6f')]('`'+_0x4249c3['field']+_0x32ef('0x70'));}else{_0x4a6fd2[_0x32ef('0x6f')]('`'+_0x4249c3[_0x32ef('0x54')]+'`\x20>\x200');}break;case'Contact':if(_0x4249c3[_0x32ef('0x71')]==='$substring'){if(_0x4249c3[_0x32ef('0x6e')]['split']('\x20')['length']>0x1){_0x3a3513[_0x2ef0f8](_0x32ef('0x72'),qs[_0x32ef('0x73')](_0x4249c3[_0x32ef('0x6e')]),null);}else{var _0x5dca6a='%'+_0x4249c3[_0x32ef('0x6e')]+'%';_0x3a3513[_0x2ef0f8](_0x32ef('0x74'),_0x5dca6a,_0x5dca6a,_0x5dca6a);}}else{_0x4c125c=_[_0x32ef('0x75')](_0x4bc5bc,['name',_0x32ef('0x76')]);_0x4249c3[_0x32ef('0x54')]='ContactId';_0x52b63b=as['buildExpression'](_0x123571,_0x4c125c[_0x32ef('0x44')],_0x4249c3);_0x3a3513[_0x2ef0f8](_0x52b63b[_0x32ef('0x77')],_0x52b63b[_0x32ef('0x6e')][_0x32ef('0x78')],_0x52b63b[_0x32ef('0x6e')][_0x32ef('0x2e')]);}break;case'Tag':var _0x285330=_0x4249c3[_0x32ef('0x6e')][_0x32ef('0x3d')](',')[_0x32ef('0x39')](function(_0x21e930){return Number(_0x21e930);});_0x285330[_0x32ef('0x3e')](function(_0x1dc755){_0x42c7f4['or'](_0x32ef('0x79'),'%,'+_0x1dc755+',%');});_0x30e377=_[_0x32ef('0x7a')](_0x30e377,_0x285330);break;case'User':if(_0x4249c3[_0x32ef('0x71')]===_0x32ef('0x7b')){_0x3a3513[_0x2ef0f8](_0x32ef('0x7c'),'%'+_0x4249c3[_0x32ef('0x6e')]+'%',null);}else{_0x4c125c=_[_0x32ef('0x75')](_0x4bc5bc,['name','UserId']);_0x4249c3[_0x32ef('0x54')]=_0x32ef('0x7d');_0x52b63b=as[_0x32ef('0x7e')](_0x123571,_0x4c125c[_0x32ef('0x44')],_0x4249c3);_0x3a3513[_0x2ef0f8](_0x52b63b[_0x32ef('0x77')],_0x52b63b['value'][_0x32ef('0x78')],_0x52b63b['value'][_0x32ef('0x2e')]);}break;case _0x32ef('0x7f'):_0x52b63b=as['buildExpression']('me',null,_0x4249c3);_0x3a3513[_0x2ef0f8](_0x52b63b['text'],_0x52b63b[_0x32ef('0x6e')][_0x32ef('0x78')],_0x52b63b[_0x32ef('0x6e')]['end']);break;}}else{var _0x52b63b=as[_0x32ef('0x7e')](_0x123571,_0x4c125c[_0x32ef('0x44')],_0x4249c3);_0x3a3513[_0x2ef0f8](_0x52b63b[_0x32ef('0x77')],_0x52b63b[_0x32ef('0x6e')]['start'],_0x52b63b[_0x32ef('0x6e')][_0x32ef('0x2e')]);}}}else{var _0x974974=_(_0x5dca14[_0x32ef('0x4c')])[_0x32ef('0x47')]()[_0x32ef('0x39')](function(_0x43b176){return _[_0x32ef('0x80')](_0x4bc5bc,[_0x32ef('0x37'),_0x43b176])?_0x43b176:undefined;})[_0x32ef('0x81')]()[_0x32ef('0x6e')]();if(!_[_0x32ef('0x82')](_0x974974)){_0x974974['forEach'](function(_0x4ab179){if(_0x4ab179===_0x32ef('0x83')){_0x4a6fd2[_0x32ef('0x51')]('i.ChatWebsiteId\x20IN\x20?',[][_0x32ef('0x84')](_0x5dca14['query'][_0x4ab179]));}else if(_0x4ab179===_0x32ef('0x85')){var _0x33845d=JSON[_0x32ef('0x86')](_0x5dca14['query'][_0x4ab179])[_0x32ef('0x87')];var _0x4978a6=JSON[_0x32ef('0x86')](_0x5dca14[_0x32ef('0x4c')][_0x4ab179])['$lte'];_0x4a6fd2['where'](_0x32ef('0x88'),_0x33845d,_0x4978a6);}else{if(_0x5dca14['query'][_0x4ab179]===_0x32ef('0x89')){_0x4a6fd2['where']('i.'+_0x4ab179+_0x32ef('0x8a'));}else{_0x4a6fd2[_0x32ef('0x51')]('i.'+_0x4ab179+_0x32ef('0x8b'),_0x5dca14['query'][_0x4ab179]);}}});}if(_0x5dca14['query']['read']){if(_0x5dca14[_0x32ef('0x4c')]['read']==0x1){_0x4a6fd2[_0x32ef('0x6f')](_0x32ef('0x8c'));}else{_0x4a6fd2[_0x32ef('0x6f')](_0x32ef('0x8d'));}}if(_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x8e')]){_0x30e377=_['isArray'](_0x5dca14[_0x32ef('0x4c')]['tag'])?_0x5dca14['query'][_0x32ef('0x8e')]:new Array(_0x5dca14['query'][_0x32ef('0x8e')]);_0x30e377[_0x32ef('0x3e')](function(_0x4d64ec){_0x42c7f4['or'](_0x32ef('0x79'),'%,'+_0x4d64ec+',%');});}if(_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x8f')]){var _0x4712dc=_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x8f')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x32ef('0x90'));if(qs['isNumeric'](_0x4712dc)){_0x3a3513['or'](_0x32ef('0x91'),_0x4712dc+'%');}else{_0x3a3513['or'](_0x32ef('0x92'),qs[_0x32ef('0x73')](_0x4712dc))['or'](_0x32ef('0x93'),_0x4712dc+'%');}}}_0x4a6fd2[_0x32ef('0x51')](_0x3a3513);_0x4a6fd2[_0x32ef('0x94')]('i.id');var _0x3232ca={'type':db[_0x32ef('0x20')][_0x32ef('0x95')][_0x32ef('0x96')],'raw':!![]};var _0x2eda01=_0x4a6fd2['clone']();_0x2eda01['field'](_0x32ef('0x97'));_0x2eda01[_0x32ef('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x32ef('0x6d'));if(_0x1f323a[_0x32ef('0x98')]){_0x1f323a[_0x32ef('0x98')][_0x32ef('0x3e')](function(_0xc3664d){_0x4a6fd2[_0x32ef('0x98')]('i.'+_0xc3664d[0x0],_0xc3664d[0x1]===_0x32ef('0x99')?![]:!![]);});}if(!_[_0x32ef('0x82')](_0x30e377)){_0x4a6fd2[_0x32ef('0x6f')](_0x42c7f4);_0x2eda01['where'](_0x32ef('0x9a'),_0x30e377);}BPromise[_0x32ef('0x9b')]()['then'](function(){if(!_0x56cc75){if(_0x5dca14[_0x32ef('0x4c')]['ChatWebsiteId']||_0x5dca14[_0x32ef('0x4c')]['journey'])return;_0x2eda01[_0x32ef('0x51')](_0x32ef('0x9c'));_0x4a6fd2[_0x32ef('0x51')](_0x32ef('0x9c'));return;}return _0x5dca14['user'][_0x32ef('0x9d')]({'attributes':['id'],'raw':!![]})[_0x32ef('0x22')](function(_0x31f99f){if(_['isEmpty'](_0x31f99f)){_0x2eda01['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x4a6fd2[_0x32ef('0x51')](_0x32ef('0x9e'));}else{_0x2eda01[_0x32ef('0x51')](_0x32ef('0x9f'),_[_0x32ef('0x39')](_0x31f99f,'id'));_0x4a6fd2['where'](_0x32ef('0x9f'),_['map'](_0x31f99f,'id'));}});})[_0x32ef('0x22')](function(){db[_0x32ef('0xa0')][_0x32ef('0x4c')](_0x2eda01['toString'](),_0x3232ca)[_0x32ef('0x22')](function(_0x42d2d4){_0x4744ba[_0x32ef('0x30')]=_0x42d2d4[_0x32ef('0x6c')];if(_0x4744ba[_0x32ef('0x30')]===0x0)return[];return db['sequelize'][_0x32ef('0x4c')](_0x2a366b['toString'](),_0x3232ca)[_0x32ef('0x22')](function(_0x42a57f){_0x24d8b4=_['keyBy'](_0x42a57f,'id');_0x3232ca=_['merge'](_0x3232ca,{'model':db[_0x32ef('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5dca14[_0x32ef('0x4c')][_0x32ef('0x4b')]){_0x1f323a[_0x32ef('0x4a')]['forEach'](function(_0x356fd4){_0x4a6fd2['field']('i.'+_0x356fd4);});}else{_0x4a6fd2['field'](_0x32ef('0xa1'),'unreadMessages');_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xa2'),_0x32ef('0xa3'));_0x4a6fd2['field']('a.mandatoryDisposition',_0x32ef('0xa4'));_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xa5'));_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xa6'),_0x32ef('0xa7'));_0x4a6fd2[_0x32ef('0x54')]('c.lastName',_0x32ef('0xa8'));_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xa9'),_0x32ef('0xaa'));_0x4a6fd2['field']('c.phone',_0x32ef('0xab'));_0x4a6fd2['field'](_0x32ef('0xac'),_0x32ef('0xad'));_0x4a6fd2['field']('c.fax','Contact.fax');_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xae'),_0x32ef('0xaf'));_0x4a6fd2[_0x32ef('0x54')]('o.internal',_0x32ef('0xb0'));_0x4a6fd2[_0x32ef('0x54')](_0x32ef('0xb1'),'TagIds');}if(_0x1f323a[_0x32ef('0x4f')])_0x4a6fd2['limit'](_0x1f323a[_0x32ef('0x4f')]);if(_0x1f323a[_0x32ef('0x31')])_0x4a6fd2['offset'](_0x1f323a['offset']);return db[_0x32ef('0xa0')][_0x32ef('0x4c')](_0x4a6fd2[_0x32ef('0xb2')](),_0x3232ca);})[_0x32ef('0x22')](function(_0xa58937){_0x4e0d6b[_0x32ef('0x51')](_0x32ef('0xb3'),_[_0x32ef('0x39')](_0xa58937,'id'));return db[_0x32ef('0xa0')]['query'](_0x4e0d6b[_0x32ef('0xb2')](),_0x3232ca)['then'](function(_0x22d657){var _0x7e47b9=_[_0x32ef('0xb4')](_0x22d657,_0x32ef('0xb5'));var _0x102f2f=[];_0xa58937['forEach'](function(_0x3ef09c){_0x102f2f[_0x32ef('0x3f')](updateChatInteraction(_0x3ef09c,_0x24d8b4,_0x7e47b9));});return BPromise[_0x32ef('0xb6')](_0x102f2f);});});})[_0x32ef('0x22')](function(_0x1db74d){_0x4744ba[_0x32ef('0xb7')]=_0x1db74d;return _0x4744ba;})[_0x32ef('0x22')](respondWithFilteredResult(_0x2901a1,_0x1f323a));})[_0x32ef('0x2c')](handleError(_0x2901a1,null));};exports[_0x32ef('0xb8')]=function(_0x59602f,_0x53dc9b){var _0x4fb09e={'raw':![],'where':{'id':_0x59602f[_0x32ef('0xb9')]['id']}},_0x2e01fa={};_0x2e01fa['model']=_[_0x32ef('0x47')](db['ChatInteraction'][_0x32ef('0x42')]);_0x2e01fa['query']=_['keys'](_0x59602f[_0x32ef('0x4c')]);_0x2e01fa[_0x32ef('0x48')]=_[_0x32ef('0x49')](_0x2e01fa[_0x32ef('0x46')],_0x2e01fa[_0x32ef('0x4c')]);_0x4fb09e['attributes']=_[_0x32ef('0x49')](_0x2e01fa['model'],qs[_0x32ef('0x4b')](_0x59602f['query']['fields']));_0x4fb09e['attributes']=_0x4fb09e['attributes']['length']?_0x4fb09e[_0x32ef('0x4a')]:_0x2e01fa[_0x32ef('0x46')];if(_0x59602f['query'][_0x32ef('0xba')]){_0x4fb09e[_0x32ef('0xbb')]=[{'all':!![]}];}_0x4fb09e=_[_0x32ef('0xbc')]({},_0x4fb09e,_0x59602f[_0x32ef('0xbd')]);return db[_0x32ef('0x41')][_0x32ef('0x75')](_0x4fb09e)['then'](handleEntityNotFound(_0x53dc9b,null))[_0x32ef('0x22')](respondWithResult(_0x53dc9b,null))['catch'](handleError(_0x53dc9b,null));};exports[_0x32ef('0xbe')]=function(_0x1be713,_0x536b3d){return db[_0x32ef('0x41')]['create'](_0x1be713[_0x32ef('0x7f')],{})[_0x32ef('0x22')](respondWithResult(_0x536b3d,0xc9))[_0x32ef('0x2c')](handleError(_0x536b3d,null));};exports[_0x32ef('0x34')]=function(_0x586ab4,_0x145fe3){if(_0x586ab4[_0x32ef('0x7f')]['id']){delete _0x586ab4[_0x32ef('0x7f')]['id'];}return db[_0x32ef('0x41')]['find']({'where':{'id':_0x586ab4[_0x32ef('0xb9')]['id']}})['then'](handleEntityNotFound(_0x145fe3,null))[_0x32ef('0x22')](saveUpdates(_0x586ab4[_0x32ef('0x7f')],null))[_0x32ef('0x22')](respondWithResult(_0x145fe3,null))[_0x32ef('0x2c')](handleError(_0x145fe3,null));};exports[_0x32ef('0xbf')]=function(_0x31481c,_0x5e2516){return db[_0x32ef('0x41')]['find']({'where':{'id':_0x31481c['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x5e2516,null))[_0x32ef('0x22')](removeEntity(_0x5e2516,null))[_0x32ef('0x2c')](handleError(_0x5e2516,null));};exports[_0x32ef('0xc0')]=function(_0x4dd1f0,_0x8d3b24){return db[_0x32ef('0x41')][_0x32ef('0xc0')]()[_0x32ef('0x22')](respondWithResult(_0x8d3b24,null))['catch'](handleError(_0x8d3b24,null));};exports['createVidaooSession']=function(_0x4ed0c9,_0x9a5c92){var _0x7811a6=_0x4ed0c9[_0x32ef('0xb9')]['id'];var _0xc92dcc;var _0x3d18b9;var _0x9233cb;return db[_0x32ef('0x41')][_0x32ef('0xc1')]({'where':{'id':_0x7811a6}})[_0x32ef('0x22')](function(_0x2b0b07){_0xc92dcc=_0x2b0b07;return db[_0x32ef('0xc2')]['findOne']({'where':{'id':_0x2b0b07[_0x32ef('0x83')]},'attributes':['id',_0x32ef('0xc3'),_0x32ef('0xc4')],'raw':!![]});})[_0x32ef('0x22')](function(_0x766edf){if(_0x766edf&&_0x766edf[_0x32ef('0xc3')]&&_0x766edf['vidaooEscalation']){_0x3d18b9=_0x766edf;var _0x35edf1={'rejectUnauthorized':![],'method':_0x32ef('0xc5'),'uri':_0x32ef('0xc6'),'headers':{'X-APIKEY':_0x766edf[_0x32ef('0xc3')]},'body':{'name':_0x32ef('0xc7')+_0x7811a6},'redirect':_0x32ef('0xc8'),'json':!![]};return rp(_0x35edf1);}else{throw new db[(_0x32ef('0x20'))][(_0x32ef('0xc9'))](_0x32ef('0xca'));}})[_0x32ef('0x22')](function(_0x439146){_0x9233cb=_0x439146;if(_0x9233cb['id']){var _0x1bb4b2={'body':_0x9233cb[_0x32ef('0xcb')],'ChatWebsiteId':_0x3d18b9['id'],'ChatInteractionId':_0xc92dcc['id'],'direction':_0x32ef('0xcc'),'UserId':_0x4ed0c9['user']['id']};return db[_0x32ef('0xcd')][_0x32ef('0xbe')](_0x1bb4b2,{});}else{throw new db[(_0x32ef('0x20'))]['ValidationError'](_0x32ef('0xce'));}})['then'](function(){return _0xc92dcc[_0x32ef('0xcf')]({'vidaooSessionId':_0x9233cb['id']});})[_0x32ef('0x22')](respondWithResult(_0x9a5c92,null))[_0x32ef('0x2c')](handleError(_0x9a5c92,null));};exports['customUpdate']=function(_0x27aff9,_0x4c2d6f){if(_0x27aff9[_0x32ef('0x7f')]['id']){delete _0x27aff9[_0x32ef('0x7f')]['id'];}return db['ChatInteraction'][_0x32ef('0x75')]({'where':{'id':_0x27aff9[_0x32ef('0xb9')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x4c2d6f,null))[_0x32ef('0x22')](saveUpdates(_0x27aff9[_0x32ef('0x7f')],null))[_0x32ef('0x22')](respondWithResult(_0x4c2d6f,null))[_0x32ef('0x2c')](handleError(_0x4c2d6f,null));};exports['abandon']=function(_0x493ae9,_0x143d39,_0x497948){if(_0x493ae9[_0x32ef('0x7f')]['id']){delete _0x493ae9[_0x32ef('0x7f')]['id'];}return db['ChatInteraction'][_0x32ef('0x75')]({'where':{'id':_0x493ae9[_0x32ef('0xb9')]['id']}})['then'](function(_0x1200c9){if(!_0x1200c9){logger[_0x32ef('0x28')](_0x32ef('0xd0'),_0x32ef('0xd1'),0x194,_0x32ef('0xd2'));_0x143d39['sendStatus'](0x194);}else{if(_0x1200c9[_0x32ef('0x7d')]){throw new db[(_0x32ef('0x20'))]['ValidationError'](_0x32ef('0xd3'));}}return _0x1200c9;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){return _0x55ad11[_0x32ef('0x34')]({'closed':_0x493ae9[_0x32ef('0x7f')]['closed'],'disposition':_0x493ae9[_0x32ef('0x7f')][_0x32ef('0xd4')]})['then'](function(_0xb41a01){return _0xb41a01;});}})[_0x32ef('0x22')](function(_0x66718b){return respondWithRpcPromise(_0x32ef('0xd5'),_0x32ef('0xd1'),_0x493ae9[_0x32ef('0x7f')],client9004);})[_0x32ef('0x22')](respondWithResult(_0x143d39,null))['catch'](handleError(_0x143d39,null));};exports['attachmentUpload']=function(_0x18c29b,_0x41c38d,_0x32a533){_0x18c29b['body'][_0x32ef('0x37')]=_0x18c29b[_0x32ef('0xd6')]['originalname'];_0x18c29b[_0x32ef('0x7f')][_0x32ef('0xd7')]=_0x18c29b['file']['filename'];_0x18c29b[_0x32ef('0x7f')][_0x32ef('0x44')]=_0x18c29b[_0x32ef('0xd6')]['mimetype'];return db['Attachment']['create'](_0x18c29b[_0x32ef('0x7f')])[_0x32ef('0x22')](respondWithResult(_0x41c38d,0xc9))[_0x32ef('0x2c')](handleError(_0x41c38d,null));};exports['attachmentDownload']=function(_0x3c13f1,_0x223287,_0x30596b){return db['ChatInteraction'][_0x32ef('0xc1')]({'where':{'id':_0x3c13f1[_0x32ef('0xb9')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x223287,null))['then'](function(_0x46f599){if(_0x46f599){if(_0x46f599['closed']){return _0x223287[_0x32ef('0x2d')](0x193)[_0x32ef('0x2f')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x32ef('0xc1')]({'where':{'id':_0x3c13f1['query'][_0x32ef('0xd8')]},'raw':!![]})[_0x32ef('0x22')](handleEntityNotFound(_0x223287,null));}})[_0x32ef('0x22')](function(_0x193bb5){if(_0x193bb5){return _0x223287[_0x32ef('0xd9')](path[_0x32ef('0xda')](config[_0x32ef('0xdb')],_0x32ef('0xdc'),_0x193bb5[_0x32ef('0xd7')]));}})[_0x32ef('0x2c')](handleError(_0x223287,null));};exports['close']=function(_0x49fdd7,_0x1e8096){var _0x27a2f3=null;var _0x1ebebc=null;var _0x199880=null;var _0x28da62=null;if(_0x49fdd7[_0x32ef('0x7f')]['id']){delete _0x49fdd7[_0x32ef('0x7f')]['id'];}if(_0x49fdd7[_0x32ef('0x7f')][_0x32ef('0xdd')]){_0x28da62=path[_0x32ef('0xda')](config['root'],_0x32ef('0xde'),util[_0x32ef('0xdf')](_0x32ef('0xe0'),Date[_0x32ef('0xe1')]()));_0x49fdd7[_0x32ef('0x7f')][_0x32ef('0xe2')]=_0x28da62;}return db[_0x32ef('0x41')][_0x32ef('0x75')]({'where':{'id':_0x49fdd7[_0x32ef('0xb9')]['id']},'include':[{'model':db[_0x32ef('0xcd')],'as':_0x32ef('0xe3'),'include':[{'model':db[_0x32ef('0xe4')],'as':_0x32ef('0xe4')}]}]})['then'](handleEntityNotFound(_0x1e8096,null))[_0x32ef('0x22')](saveUpdates(_0x49fdd7[_0x32ef('0x7f')],null))[_0x32ef('0x22')](function(_0x245289){if(_0x245289){_0x27a2f3=_0x245289;return db[_0x32ef('0xc2')][_0x32ef('0x75')]({'where':{'id':_0x27a2f3[_0x32ef('0x83')]}});}})[_0x32ef('0x22')](function(_0xa734b){if(_0xa734b){_0x199880=_0xa734b;return db[_0x32ef('0xe5')]['find']({'where':{'id':_0x27a2f3[_0x32ef('0x76')]}});}})[_0x32ef('0x22')](function(_0x176d96){if(_0x176d96){_0x1ebebc=_0x176d96;if(_0x28da62){var _0x3b56e7=null;for(var _0x5176d3=0x1;_0x5176d3<_0x27a2f3[_0x32ef('0xe3')][_0x32ef('0x6c')];++_0x5176d3){_0x3b56e7=_0x27a2f3['Messages'][_0x5176d3];var _0x4da679=_0x3b56e7['UserId']?util[_0x32ef('0xdf')](_0x32ef('0xe6'),_0x199880[_0x32ef('0xe7')],_0x3b56e7[_0x32ef('0x7d')]):'System';var _0x5f2996=_0x49fdd7[_0x32ef('0x7f')]['customer']||util['format'](_0x32ef('0xe6'),_0x32ef('0xe8'),_0x3b56e7[_0x32ef('0x76')]);switch(_0x199880['agentIdentifier']){case'website_alias':_0x4da679=_0x3b56e7['UserId']?util[_0x32ef('0xdf')](_0x32ef('0xe6'),_0x199880[_0x32ef('0xe7')],_0x3b56e7[_0x32ef('0x7d')]):_0x32ef('0xe9');break;case _0x32ef('0xea'):_0x4da679=_0x3b56e7[_0x32ef('0x7d')]?_0x3b56e7[_0x32ef('0xe4')][_0x32ef('0xeb')]||_0x3b56e7['User']['fullname']:'System';break;case _0x32ef('0xec'):_0x4da679=_0x3b56e7[_0x32ef('0x7d')]?_0x3b56e7['User']['fullname']:_0x32ef('0xe9');break;default:_0x4da679=_0x3b56e7['UserId']?util[_0x32ef('0xdf')](_0x32ef('0xe6'),_0x199880[_0x32ef('0xe7')],_0x3b56e7[_0x32ef('0x7d')]):'System';}var _0xa6f073=util[_0x32ef('0xdf')](_0x32ef('0xed'),moment(_0x3b56e7[_0x32ef('0x85')])['format'](_0x32ef('0xee')),_0x3b56e7[_0x32ef('0xef')]==='in'?_0x5f2996:_0x4da679,_0x3b56e7['body']);if(!_0x3b56e7['secret']){fs[_0x32ef('0xf0')](_0x28da62,_0xa6f073);}}return db[_0x32ef('0xf1')][_0x32ef('0xc1')]({'where':{'service':!![]},'include':[{'model':db[_0x32ef('0xf2')],'as':_0x32ef('0xf3'),'raw':!![]}]});}}})[_0x32ef('0x22')](function(_0xbe674c){if(_0xbe674c&&_0xbe674c['Smtp']&&_0x49fdd7[_0x32ef('0x7f')]){var _0x326729={'tls':{'rejectUnauthorized':![]}};if(_0xbe674c[_0x32ef('0xf3')][_0x32ef('0xf4')]){_0x326729['service']=_0xbe674c['Smtp'][_0x32ef('0xf4')];}else{_0x326729['host']=_0xbe674c[_0x32ef('0xf3')][_0x32ef('0xf5')];_0x326729[_0x32ef('0xf6')]=_0xbe674c[_0x32ef('0xf3')][_0x32ef('0xf6')];_0x326729[_0x32ef('0xf7')]=_0xbe674c[_0x32ef('0xf3')][_0x32ef('0xf7')];}if(_0xbe674c['Smtp'][_0x32ef('0xf8')]){_0x326729['auth']={'user':_0xbe674c[_0x32ef('0xf3')]['user'],'pass':_0xbe674c['Smtp']['pass']};}return respondWithRpcPromise(_0x32ef('0xf9'),'sendMail',{'account':_0x326729,'message':{'from':util[_0x32ef('0xdf')]('\x22%s\x22\x20<%s>',_0xbe674c[_0x32ef('0x37')],_0xbe674c['email']||_0xbe674c[_0x32ef('0xf3')][_0x32ef('0xfa')]),'to':_0x49fdd7['body'][_0x32ef('0xdd')],'subject':'Mail\x20Transcript','text':util[_0x32ef('0xdf')](_0x32ef('0xfb'),_0x49fdd7[_0x32ef('0x7f')][_0x32ef('0xdd')]),'attachments':[{'path':_0x28da62}]}})[_0x32ef('0x22')](function(){return _0x27a2f3;})['catch'](function(_0x4340fd){console[_0x32ef('0x28')](_0x4340fd);});}else{return _0x27a2f3;}})[_0x32ef('0x22')](respondWithStatusCode(_0x1e8096,0xc8))[_0x32ef('0x2c')](handleError(_0x1e8096,null));};exports[_0x32ef('0xfc')]=function(_0x35aa0a,_0x14c3c4,_0x4255f5){return db['ChatMessage'][_0x32ef('0x75')]({'where':{'id':_0x35aa0a['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x14c3c4,null))[_0x32ef('0x22')](function(_0x2c5250){if(_0x2c5250){return _0x2c5250['addMessage'](_0x35aa0a['body'][_0x32ef('0xfd')],_[_0x32ef('0xfe')](_0x35aa0a[_0x32ef('0x7f')],[_0x32ef('0xfd'),'id'])||{});}})[_0x32ef('0x22')](respondWithResult(_0x14c3c4,null))[_0x32ef('0x2c')](handleError(_0x14c3c4,null));};exports[_0x32ef('0xff')]=function(_0xa7f0b3,_0x73a49e,_0x156348){var _0x169a8e={'raw':![],'where':{}};var _0x4d0170={};var _0x153792={'count':0x0,'rows':[]};return db[_0x32ef('0x41')][_0x32ef('0xc1')]({'where':{'id':_0xa7f0b3[_0x32ef('0xb9')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x73a49e,null))[_0x32ef('0x22')](function(_0x2c5417){if(_0x2c5417){_0x4d0170[_0x32ef('0x46')]=_[_0x32ef('0x47')](db[_0x32ef('0xcd')]['rawAttributes']);_0x4d0170[_0x32ef('0x4c')]=_[_0x32ef('0x47')](_0xa7f0b3[_0x32ef('0x4c')]);_0x4d0170[_0x32ef('0x48')]=_[_0x32ef('0x49')](_0x4d0170['model'],_0x4d0170[_0x32ef('0x4c')]);_0x169a8e[_0x32ef('0x4a')]=_[_0x32ef('0x49')](_0x4d0170['model'],qs['fields'](_0xa7f0b3[_0x32ef('0x4c')]['fields']));_0x169a8e[_0x32ef('0x4a')]=_0x169a8e['attributes'][_0x32ef('0x6c')]?_0x169a8e[_0x32ef('0x4a')]:_0x4d0170[_0x32ef('0x46')];if(!_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x4d')]('nolimit')){_0x169a8e[_0x32ef('0x4f')]=qs['limit'](_0xa7f0b3['query']['limit']);_0x169a8e[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x31')]);}_0x169a8e[_0x32ef('0x98')]=qs['sort'](_0xa7f0b3[_0x32ef('0x4c')]['sort']);_0x169a8e[_0x32ef('0x51')]=qs[_0x32ef('0x48')](_[_0x32ef('0x52')](_0xa7f0b3[_0x32ef('0x4c')],_0x4d0170['filters']));_0x169a8e['where'][_0x32ef('0xb5')]=_0x2c5417['id'];if(_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x8f')]){_0x169a8e[_0x32ef('0x51')]=_[_0x32ef('0xbc')](_0x169a8e['where'],{'$or':_['map'](_0x169a8e[_0x32ef('0x4a')],function(_0x4b6c94){var _0x485bf8={};_0x485bf8[_0x4b6c94]={'$like':'%'+_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x8f')]+'%'};return _0x485bf8;})});}if(_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x87')]){var _0x5ef66d=_0xa7f0b3[_0x32ef('0x4c')][_0x32ef('0x87')]['split'](',');var _0x50fd30={};_0x50fd30[_0x5ef66d[0x0]]={'$gte':moment(_0x5ef66d[0x1])['format'](_0x32ef('0x100'))};_0x169a8e['where']=_[_0x32ef('0xbc')](_0x169a8e['where'],_0x50fd30);}_0x169a8e=_[_0x32ef('0xbc')]({},_0x169a8e,_0xa7f0b3[_0x32ef('0xbd')]);return db[_0x32ef('0xcd')][_0x32ef('0x30')]({'where':_0x169a8e[_0x32ef('0x51')]})[_0x32ef('0x22')](function(_0x950bc1){_0x153792[_0x32ef('0x30')]=_0x950bc1;if(_0xa7f0b3['query'][_0x32ef('0xba')]){_0x169a8e['include']=[{'all':!![]}];}return db[_0x32ef('0xcd')][_0x32ef('0x101')](_0x169a8e);})[_0x32ef('0x22')](function(_0x49129a){_0x153792[_0x32ef('0xb7')]=_0x49129a;return _0x153792;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x73a49e,_0x169a8e))[_0x32ef('0x2c')](handleError(_0x73a49e,null));};exports[_0x32ef('0x102')]=function(_0x4d7f2c,_0x17ba0f,_0x463610){var _0x27e130={'where':{}},_0x3d8fc7={},_0x1f6691={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x32ef('0xc1')]({'where':{'id':_0x4d7f2c[_0x32ef('0xb9')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x17ba0f,null))[_0x32ef('0x22')](function(_0x4ac273){if(_0x4ac273){_0x3d8fc7[_0x32ef('0x46')]=_['keys'](db[_0x32ef('0xcd')][_0x32ef('0x42')]);_0x3d8fc7['query']=_[_0x32ef('0x47')](_0x4d7f2c[_0x32ef('0x4c')]);_0x3d8fc7[_0x32ef('0x48')]=_[_0x32ef('0x49')](_0x3d8fc7[_0x32ef('0x46')],_0x3d8fc7[_0x32ef('0x4c')]);_0x27e130[_0x32ef('0x4a')]=_['intersection'](_0x3d8fc7[_0x32ef('0x46')],qs[_0x32ef('0x4b')](_0x4d7f2c['query'][_0x32ef('0x4b')]));_0x27e130['attributes']=_0x27e130['attributes']['length']?_0x27e130[_0x32ef('0x4a')]:_0x3d8fc7[_0x32ef('0x46')];if(!_0x4d7f2c[_0x32ef('0x4c')][_0x32ef('0x4d')](_0x32ef('0x4e'))){_0x27e130[_0x32ef('0x4f')]=qs[_0x32ef('0x4f')](_0x4d7f2c[_0x32ef('0x4c')][_0x32ef('0x4f')]);_0x27e130[_0x32ef('0x31')]=qs['offset'](_0x4d7f2c['query'][_0x32ef('0x31')]);}_0x27e130['order']=qs[_0x32ef('0x50')](_0x4d7f2c[_0x32ef('0x4c')]['sort']);_0x27e130['where']=qs[_0x32ef('0x48')](_['pick'](_0x4d7f2c[_0x32ef('0x4c')],_0x3d8fc7['filters']));_0x27e130[_0x32ef('0x51')][_0x32ef('0xb5')]=_0x4ac273['id'];if(_0x4d7f2c['query'][_0x32ef('0x8f')]){_0x27e130[_0x32ef('0x51')]=_[_0x32ef('0xbc')](_0x27e130['where'],{'$or':_[_0x32ef('0x39')](_0x27e130[_0x32ef('0x4a')],function(_0x485648){var _0x1ea426={};_0x1ea426[_0x485648]={'$like':'%'+_0x4d7f2c[_0x32ef('0x4c')][_0x32ef('0x8f')]+'%'};return _0x1ea426;})});}_0x27e130[_0x32ef('0x51')]['secret']=![];if(_0x4d7f2c['query']['id']){_0x27e130[_0x32ef('0x51')]['id']={'$gt':_0x4d7f2c[_0x32ef('0x4c')]['id']};}_0x27e130=_[_0x32ef('0xbc')]({},_0x27e130,_0x4d7f2c['options']);return db[_0x32ef('0xcd')][_0x32ef('0x30')]({'where':_0x27e130[_0x32ef('0x51')]})['then'](function(_0x1bc00e){_0x1f6691[_0x32ef('0x30')]=_0x1bc00e;_0x27e130[_0x32ef('0xbb')]=[];if(_0x4d7f2c[_0x32ef('0x4c')]['includeAgent']){_0x27e130[_0x32ef('0xbb')][_0x32ef('0x3f')]({'model':db[_0x32ef('0xe4')],'as':_0x32ef('0xe4'),'attributes':['id',_0x32ef('0x3a'),'alias']});}if(_0x4d7f2c[_0x32ef('0x4c')][_0x32ef('0xba')]){_0x27e130['include']=[{'all':!![]}];}return db[_0x32ef('0xcd')][_0x32ef('0x101')](_0x27e130);})[_0x32ef('0x22')](function(_0x89401f){_0x1f6691[_0x32ef('0xb7')]=_0x89401f;return _0x1f6691;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x17ba0f,_0x27e130))[_0x32ef('0x2c')](handleError(_0x17ba0f,null));};exports[_0x32ef('0x103')]=function(_0x466890,_0x17c36d,_0x3b7d43){return db[_0x32ef('0x41')][_0x32ef('0x75')]({'where':{'id':_0x466890[_0x32ef('0xb9')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x17c36d,null))[_0x32ef('0x22')](function(_0x44eeb5){if(_0x44eeb5){return _0x44eeb5[_0x32ef('0x104')](_0x466890[_0x32ef('0x7f')]['ids'],_['omit'](_0x466890[_0x32ef('0x7f')],[_0x32ef('0xfd'),'id'])||{})[_0x32ef('0x105')](function(){return db[_0x32ef('0x106')][_0x32ef('0x101')]({'attributes':['id',_0x32ef('0x37'),'color'],'where':{'id':_0x466890['body'][_0x32ef('0xfd')]}});})['then'](function(_0x2f7c05){socket[_0x32ef('0x107')](_0x32ef('0x108'),{'id':Number(_0x466890['params']['id']),'tags':_0x2f7c05||[]});return{'id':Number(_0x466890[_0x32ef('0xb9')]['id']),'tags':_0x2f7c05||[]};});}})[_0x32ef('0x22')](respondWithResult(_0x17c36d,null))[_0x32ef('0x2c')](handleError(_0x17c36d,null));};exports['removeTags']=function(_0x1dd122,_0x54f1f4,_0x3702b){return db[_0x32ef('0x41')]['find']({'where':{'id':_0x1dd122['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x54f1f4,null))[_0x32ef('0x22')](function(_0x5c1de4){if(_0x5c1de4){return _0x5c1de4[_0x32ef('0x109')](_0x1dd122['query'][_0x32ef('0xfd')]);}})['then'](respondWithStatusCode(_0x54f1f4,null))[_0x32ef('0x2c')](handleError(_0x54f1f4,null));};exports['download']=function(_0x311be3,_0x382aed){var _0xb60be2=moment()['unix']()[_0x32ef('0xb2')]();var _0x4b3c9d=path[_0x32ef('0xda')](config['root'],_0x32ef('0x10a'),'files',_0x32ef('0x10b'));var _0x46bf2b=path['join'](config[_0x32ef('0xdb')],'server',_0x32ef('0x10c'),_0x32ef('0x10d'));var _0x1902ed=path[_0x32ef('0xda')](_0x4b3c9d,_0xb60be2);var _0x742a55=util[_0x32ef('0xdf')](_0x32ef('0x10e'),_0x311be3['params']['id'],_0xb60be2);var _0x42b669=path['join'](_0x4b3c9d,_0x742a55);var _0x47a574=[];_0x47a574[_0x32ef('0x3f')]({'model':db[_0x32ef('0xe4')],'as':_0x32ef('0xe4'),'attributes':['id',_0x32ef('0x3a')],'raw':!![]});_0x47a574[_0x32ef('0x3f')]({'model':db['CmContact'],'as':_0x32ef('0x10f'),'attributes':['id',_0x32ef('0x110'),_0x32ef('0x111')],'raw':!![]});if(_0x311be3[_0x32ef('0x4c')][_0x32ef('0x10d')]){_0x47a574[_0x32ef('0x3f')]({'model':db[_0x32ef('0x112')],'as':_0x32ef('0x112'),'raw':!![]});}var _0x2e08d0=[{'model':db[_0x32ef('0xcd')],'as':_0x32ef('0xe3'),'attributes':['id',_0x32ef('0x7f'),_0x32ef('0x85'),_0x32ef('0xef'),_0x32ef('0x113'),_0x32ef('0x114')],'include':_0x47a574}];_0x2e08d0[_0x32ef('0x3f')]({'model':db[_0x32ef('0xc2')],'as':_0x32ef('0x115'),'attributes':['id','name']});_0x2e08d0[_0x32ef('0x3f')]({'model':db[_0x32ef('0xe4')],'as':_0x32ef('0x116'),'attributes':['id',_0x32ef('0x3a')]});return db[_0x32ef('0x41')]['find']({'where':{'id':_0x311be3['params']['id']},'include':_0x2e08d0})[_0x32ef('0x22')](handleEntityNotFound(_0x382aed,null))[_0x32ef('0x22')](function(_0x18323f){if(_0x18323f){var _0x575325=_0x18323f[_0x32ef('0x117')]({'plain':!![]});fs[_0x32ef('0x118')](_0x1902ed);var _0x3548e0={'format':'A4','border':_0x32ef('0x119'),'header':{'height':_0x32ef('0x11a'),'contents':{'first':_0x32ef('0x11b')}},'footer':{'height':_0x32ef('0x11c'),'contents':{'default':util[_0x32ef('0xdf')]('\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\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\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%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\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\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{{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\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\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%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\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',util[_0x32ef('0xdf')](_0x32ef('0x11d'),'Chat',_0x575325['id']),moment()[_0x32ef('0xdf')](_0x32ef('0x11e'))[_0x32ef('0xb2')]())}}};var _0x5efb3f={'channel':'Chat','account':_0x575325[_0x32ef('0x115')][_0x32ef('0x37')],'agent':_0x575325[_0x32ef('0x116')]?_0x575325[_0x32ef('0x116')][_0x32ef('0x3a')]:_0x32ef('0x11f'),'createdAt':moment(_0x575325['createdAt'])[_0x32ef('0xdf')](_0x32ef('0x100'))['toString'](),'closedAt':_0x575325[_0x32ef('0x120')]?moment(_0x575325['closedAt'])[_0x32ef('0xdf')](_0x32ef('0x100'))[_0x32ef('0xb2')]():'','disposition':_0x575325[_0x32ef('0xd4')],'chatInfo':{'browser':_0x575325['browserName'],'os':_0x575325[_0x32ef('0x121')],'referer':_0x575325[_0x32ef('0x122')],'customerIp':_0x575325[_0x32ef('0x123')],'customerPort':_0x575325['customerPort']?_0x575325[_0x32ef('0x124')]:_0x32ef('0x11f')},'messages':_(_0x575325[_0x32ef('0xe3')])['tail']()[_0x32ef('0x8f')]({'secret':![]})[_0x32ef('0x39')](function(_0x256eb5){if(_0x256eb5['Attachment']){var _0x1f2728=path[_0x32ef('0xda')](_0x46bf2b,_0x256eb5[_0x32ef('0x112')][_0x32ef('0xd7')]);if(fs[_0x32ef('0x125')](_0x1f2728)){fs[_0x32ef('0x126')](_0x1f2728)[_0x32ef('0x127')](fs['createWriteStream'](path['join'](_0x1902ed,_0x256eb5[_0x32ef('0x112')][_0x32ef('0xd7')])));}}return{'date':moment(_0x256eb5[_0x32ef('0x85')])[_0x32ef('0xdf')](_0x32ef('0x100'))[_0x32ef('0xb2')](),'sender':_0x256eb5[_0x32ef('0xef')]===_0x32ef('0xcc')?_0x256eb5[_0x32ef('0xe4')]?_0x256eb5['User'][_0x32ef('0x3a')]:_0x32ef('0xe9'):_0x256eb5[_0x32ef('0x10f')]['firstName']+(_0x256eb5['Contact'][_0x32ef('0x111')]?'\x20'+_0x256eb5['Contact']['lastName']:''),'body':_0x256eb5[_0x32ef('0x112')]?_0x256eb5['Attachment'][_0x32ef('0xd7')]:_0x256eb5['body'],'direction':_0x256eb5[_0x32ef('0xef')]===_0x32ef('0xcc')?'A':'C','secret':_0x256eb5['secret'],'read':_0x256eb5[_0x32ef('0x114')],'attachment':_0x256eb5[_0x32ef('0x112')]};})['value']()};return ejs[_0x32ef('0x128')](path[_0x32ef('0xda')](config[_0x32ef('0xdb')],'server','views',_0x32ef('0x129')),{'interaction':_0x5efb3f})[_0x32ef('0x22')](function(_0x205350){return new BPromise(function(_0x3c4bab,_0x201509){pdf['create'](_0x205350,_0x3548e0)[_0x32ef('0x12a')](path[_0x32ef('0xda')](_0x1902ed,'transcript-'+_0x575325['id']+'-'+_0xb60be2+_0x32ef('0x12b')),function(_0x2616c9,_0x12d8e6){if(_0x2616c9)return _0x201509(_0x2616c9);_0x3c4bab(_0x12d8e6);});});})['then'](function(){return new BPromise(function(_0x1d84bf,_0x12c87d){zipdir(_0x1902ed,{'saveTo':_0x42b669},function(_0x1743a0,_0x51401d){if(_0x1743a0)return _0x12c87d(_0x1743a0);return _0x1d84bf(_0x51401d);});})[_0x32ef('0x22')](function(){return new BPromise(function(_0xa89962,_0x2dabc4){rimraf(_0x1902ed,function(_0x37e862){if(_0x37e862)_0x2dabc4(_0x37e862);return _0xa89962();});});})[_0x32ef('0x22')](function(){return _0x382aed[_0x32ef('0xd9')](_0x42b669,_0x742a55,function(_0x144346){if(_0x144346){console[_0x32ef('0x12c')](_0x32ef('0x12d'),_0x144346);}else{fs[_0x32ef('0x12e')](_0x42b669);}});});});}else{return _0x382aed['sendStatus'](0xc8);}})[_0x32ef('0x2c')](handleError(_0x382aed,null));}; \ No newline at end of file +var _0x1623=['having','`unreadMessages`\x20>\x200','tag','isArray','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?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','ChatInteraction','includeAll','include','create','update','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','filename','file','mimetype','Attachment','attachmentDownload','Unauthorized','download','root','server/files/attachments/','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','omit','ids','getMessages','pick','filter','options','findAll','getMyMessages','includeAgent','addTags','spread','Tag','emit','removeTags','unix','join','files','attachments','transcript-%d-%s.zip','push','lastName','direction','Account','Owner','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
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','30px','Chat','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','server','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','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','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','end','name','Users','Tags','TagIds','split','forEach','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','field','color','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','conditions','find','unreadMessages','`\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)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200'];(function(_0x33be9d,_0x41618e){var _0x4a9267=function(_0x4f0e70){while(--_0x4f0e70){_0x33be9d['push'](_0x33be9d['shift']());}};_0x4a9267(++_0x41618e);}(_0x1623,0xab));var _0x3162=function(_0x4804e7,_0x69ba34){_0x4804e7=_0x4804e7-0x0;var _0x318d9c=_0x1623[_0x4804e7];return _0x318d9c;};'use strict';var pdf=require(_0x3162('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3162('0x6'));var sox=require('sox');var csv=require(_0x3162('0x7'));var ejs=require(_0x3162('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0x7'));var querystring=require(_0x3162('0xd'));var Papa=require(_0x3162('0xe'));var Redis=require(_0x3162('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x10'));var hardwareService=require(_0x3162('0x11'));var logger=require(_0x3162('0x12'))(_0x3162('0x13'));var utils=require(_0x3162('0x14'));var config=require(_0x3162('0x15'));var db=require(_0x3162('0x16'))['db'];config[_0x3162('0x17')]=_[_0x3162('0x18')](config['redis'],{'host':_0x3162('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3162('0x17')]));require(_0x3162('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3162('0x1b')][_0x3162('0x1c')]({'port':0x232b});var client9004=jayson[_0x3162('0x1b')]['http']({'port':0x232c});function checkPasswordPattern(_0x15e348,_0x3d0bea,_0x2705d1){if(_0x2705d1){var _0x490371=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x490371[_0x3162('0x1d')](_0x3d0bea)){return _0x15e348;}else{throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0x20'));}}else{return _0x15e348;}}function respondWithRpcPromise(_0x930415,_0x1eed46,_0x391d97,_0x4b2bf3){return new BPromise(function(_0x42f283,_0x1e3d75){var _0x460b7b=_0x4b2bf3||client;return _0x460b7b[_0x3162('0x21')](_0x930415,_0x391d97)['then'](function(_0x1dfd5c){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1eed46,_0x3162('0x22'));logger[_0x3162('0x23')](_0x3162('0x24'),_0x1eed46,'request\x20sent',JSON['stringify'](_0x1dfd5c));if(_0x1dfd5c[_0x3162('0x25')]){if(_0x1dfd5c[_0x3162('0x25')][_0x3162('0x26')]===0x1f4){logger[_0x3162('0x25')](_0x3162('0x27'),_0x1eed46,_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);return _0x1e3d75(_0x1dfd5c[_0x3162('0x25')]['message']);}logger[_0x3162('0x25')](_0x3162('0x27'),_0x1eed46,_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);return _0x42f283(_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);}else{logger[_0x3162('0x29')](_0x3162('0x27'),_0x1eed46,_0x3162('0x22'));_0x42f283(_0x1dfd5c[_0x3162('0x2a')][_0x3162('0x28')]);}})[_0x3162('0x2b')](function(_0x1c03a4){logger['error'](_0x3162('0x27'),_0x1eed46,_0x1c03a4);_0x1e3d75(_0x1c03a4);});});}function respondWithStatusCode(_0x552469,_0x37acdd){_0x37acdd=_0x37acdd||0xcc;return function(_0x31f7fd){if(_0x31f7fd){return _0x552469[_0x3162('0x2c')](_0x37acdd);}return _0x552469['status'](_0x37acdd)['end']();};}function respondWithResult(_0xda0389,_0xaa1f35){_0xaa1f35=_0xaa1f35||0xc8;return function(_0x14df16){if(_0x14df16){return _0xda0389[_0x3162('0x2d')](_0xaa1f35)[_0x3162('0x2e')](_0x14df16);}};}function respondWithFilteredResult(_0x5c2d28,_0x8a7bce){return function(_0x4e3cc2){if(_0x4e3cc2){var _0xf11765=_0x4e3cc2[_0x3162('0x2f')],_0x3a188e=_0x8a7bce[_0x3162('0x30')],_0x41e933=_0x8a7bce[_0x3162('0x30')]+_0x8a7bce[_0x3162('0x31')],_0x221b38;if(_0x41e933>=_0xf11765){_0x41e933=_0xf11765;_0x221b38=0xc8;}else{_0x221b38=0xce;}_0x5c2d28['status'](_0x221b38);return _0x5c2d28[_0x3162('0x32')](_0x3162('0x33'),_0x3a188e+'-'+_0x41e933+'/'+_0xf11765)['json'](_0x4e3cc2);}return null;};}function patchUpdates(_0x110bb4){return function(_0x155b78){try{jsonpatch['apply'](_0x155b78,_0x110bb4,!![]);}catch(_0x5b7efb){return BPromise[_0x3162('0x34')](_0x5b7efb);}return _0x155b78['save']();};}function saveUpdates(_0x266aab,_0x47241c){return function(_0x1de909){if(_0x1de909){return _0x1de909['update'](_0x266aab)['then'](function(_0x3bb9d0){return _0x3bb9d0;});}return null;};}function removeEntity(_0x1cf9a6,_0x5d8714){return function(_0x1a79fc){if(_0x1a79fc){return _0x1a79fc['destroy']()[_0x3162('0x35')](function(){_0x1cf9a6[_0x3162('0x2d')](0xcc)[_0x3162('0x36')]();});}};}function handleEntityNotFound(_0x137e9b,_0x435aed){return function(_0x3b6c91){if(!_0x3b6c91){_0x137e9b[_0x3162('0x2c')](0x194);}return _0x3b6c91;};}function handleError(_0x25951b,_0x3ee5f8){_0x3ee5f8=_0x3ee5f8||0x1f4;return function(_0x16c5d6){logger[_0x3162('0x25')](_0x16c5d6['stack']);if(_0x16c5d6[_0x3162('0x37')]){delete _0x16c5d6[_0x3162('0x37')];}_0x25951b[_0x3162('0x2d')](_0x3ee5f8)['send'](_0x16c5d6);};}function getInteractionUsers(_0x59759d,_0x3b0a0b){return new BPromise(function(_0x124c92,_0x2e1ab5){try{if(_0x3b0a0b[_0x59759d['id']]){_0x59759d[_0x3162('0x38')]=_['map'](_0x3b0a0b[_0x59759d['id']],function(_0x4186b6){return{'id':_0x4186b6['id'],'fullname':_0x4186b6['fullname']};});}}catch(_0x59e049){_0x2e1ab5(_0x59e049);}_0x124c92(_0x59759d);});}function getInteractionTags(_0x5dee49,_0x298ed7){return new BPromise(function(_0x3fe4d2,_0x315fdb){try{if(_0x5dee49['TagIds']){_0x5dee49[_0x3162('0x39')]=[];_0x5dee49[_0x3162('0x3a')][_0x3162('0x3b')](',')[_0x3162('0x3c')](function(_0x1e8d5e){_0x5dee49['Tags']['push'](_0x298ed7[_0x1e8d5e]);});}delete _0x5dee49[_0x3162('0x3a')];}catch(_0x3783bd){_0x315fdb(_0x3783bd);}_0x3fe4d2(_0x5dee49);});}function updateChatInteraction(_0x5ae385,_0x5960cd,_0x43f780){return new BPromise(function(_0x32c960,_0x379756){return getInteractionUsers(_0x5ae385,_0x43f780)['then'](function(_0x3502ba){return getInteractionTags(_0x3502ba,_0x5960cd);})[_0x3162('0x35')](function(_0x1831f5){_0x32c960(_0x1831f5);})[_0x3162('0x2b')](function(_0x534708){_0x379756(_0x534708);});});}exports[_0x3162('0x3d')]=function(_0x282e3e,_0x522cce){var _0x1d78de={},_0x337352={},_0x500e6b={'count':0x0,'rows':[]};var _0xbb8846=_[_0x3162('0x3e')](db['ChatInteraction'][_0x3162('0x3f')],function(_0x555d33){return{'name':_0x555d33[_0x3162('0x40')],'type':_0x555d33[_0x3162('0x41')][_0x3162('0x42')]};});_0x337352[_0x3162('0x43')]=_[_0x3162('0x3e')](_0xbb8846,_0x3162('0x37'));_0x337352['query']=_[_0x3162('0x44')](_0x282e3e[_0x3162('0x45')]);_0x337352[_0x3162('0x46')]=_['intersection'](_0x337352[_0x3162('0x43')],_0x337352[_0x3162('0x45')]);_0x1d78de['attributes']=_[_0x3162('0x47')](_0x337352['model'],qs['fields'](_0x282e3e['query'][_0x3162('0x48')]));_0x1d78de[_0x3162('0x49')]=_0x1d78de[_0x3162('0x49')][_0x3162('0x4a')]?_0x1d78de[_0x3162('0x49')]:_0x337352[_0x3162('0x43')];if(!_0x282e3e[_0x3162('0x45')][_0x3162('0x4b')](_0x3162('0x4c'))){_0x1d78de[_0x3162('0x31')]=qs[_0x3162('0x31')](_0x282e3e[_0x3162('0x45')][_0x3162('0x31')]);_0x1d78de['offset']=qs[_0x3162('0x30')](_0x282e3e['query']['offset']);}_0x1d78de[_0x3162('0x4d')]=qs[_0x3162('0x4e')](_0x282e3e[_0x3162('0x45')][_0x3162('0x4e')]);_0x1d78de['where']=qs[_0x3162('0x46')](_['pick'](_0x282e3e[_0x3162('0x45')],_0x337352[_0x3162('0x46')]),_0xbb8846);var _0x4b23e8=[];var _0x146758=squel['select']()['field']('id')[_0x3162('0x4f')](_0x3162('0x37'))[_0x3162('0x4f')](_0x3162('0x50'))[_0x3162('0x51')](_0x3162('0x52'));var _0x871a24=squel[_0x3162('0x53')]()['field']('u.id')['field'](_0x3162('0x54'))[_0x3162('0x4f')](_0x3162('0x55'))[_0x3162('0x51')](_0x3162('0x56'),'ui')[_0x3162('0x57')](_0x3162('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x1f35ae=squel['select']()[_0x3162('0x51')]('chat_interactions','i')[_0x3162('0x57')]('cm_contacts','c',_0x3162('0x59'))[_0x3162('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x3162('0x57')](_0x3162('0x5a'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3162('0x57')](_0x3162('0x5b'),'me',_0x3162('0x5c'))[_0x3162('0x57')](_0x3162('0x5d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x3162('0x57')](_0x3162('0x52'),'t','t.id\x20=\x20it.TagId');var _0x5e1f2b=squel[_0x3162('0x5e')]();var _0x6ed643=[];var _0x27eaba=squel['expr']();var _0xf7d3e1;if(_0x282e3e[_0x3162('0x45')][_0x3162('0x5f')]){_0xf7d3e1=as[_0x3162('0x60')](_0x282e3e['query'][_0x3162('0x5f')]);var _0x286aad=_0xf7d3e1['sqlOperator'];for(var _0x3179a=0x0;_0x3179a<_0xf7d3e1['conditions'][_0x3162('0x4a')];_0x3179a++){var _0x1b0f2b=_0xf7d3e1[_0x3162('0x61')][_0x3179a];var _0x53ad9b='i';var _0x291aa7=_[_0x3162('0x62')](_0xbb8846,[_0x3162('0x37'),_0x1b0f2b[_0x3162('0x4f')]]);if(!_0x291aa7){switch(_0x1b0f2b[_0x3162('0x4f')]){case _0x3162('0x63'):if(_0x1b0f2b['value']==0x1){_0x1f35ae['having']('`'+_0x1b0f2b['field']+_0x3162('0x64'));}else{_0x1f35ae['having']('`'+_0x1b0f2b[_0x3162('0x4f')]+_0x3162('0x65'));}break;case _0x3162('0x66'):if(_0x1b0f2b[_0x3162('0x67')]===_0x3162('0x68')){if(_0x1b0f2b['value']['split']('\x20')[_0x3162('0x4a')]>0x1){_0x5e1f2b[_0x286aad](_0x3162('0x69'),qs['getFullTextValue'](_0x1b0f2b[_0x3162('0x6a')]),null);}else{var _0x2bd1ba='%'+_0x1b0f2b[_0x3162('0x6a')]+'%';_0x5e1f2b[_0x286aad](_0x3162('0x6b'),_0x2bd1ba,_0x2bd1ba,_0x2bd1ba);}}else{_0x291aa7=_[_0x3162('0x62')](_0xbb8846,['name',_0x3162('0x6c')]);_0x1b0f2b[_0x3162('0x4f')]=_0x3162('0x6c');_0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae['text'],_0x355cae[_0x3162('0x6a')][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);}break;case'Tag':var _0x134a99=_0x1b0f2b[_0x3162('0x6a')][_0x3162('0x3b')](',')[_0x3162('0x3e')](function(_0x2f6fa2){return Number(_0x2f6fa2);});_0x134a99[_0x3162('0x3c')](function(_0xbc75f){_0x27eaba['or'](_0x3162('0x6f'),'%,'+_0xbc75f+',%');});_0x6ed643=_[_0x3162('0x70')](_0x6ed643,_0x134a99);break;case _0x3162('0x71'):if(_0x1b0f2b['operator']===_0x3162('0x68')){_0x5e1f2b[_0x286aad](_0x3162('0x72'),'%'+_0x1b0f2b['value']+'%',null);}else{_0x291aa7=_[_0x3162('0x62')](_0xbb8846,['name',_0x3162('0x73')]);_0x1b0f2b[_0x3162('0x4f')]=_0x3162('0x73');_0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value'][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);}break;case _0x3162('0x75'):_0x355cae=as[_0x3162('0x6d')]('me',null,_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value'][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);break;}}else{var _0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value']['start'],_0x355cae['value'][_0x3162('0x36')]);}}}else{var _0x3b4afd=_(_0x282e3e['query'])[_0x3162('0x44')]()[_0x3162('0x3e')](function(_0x4acd77){return _[_0x3162('0x76')](_0xbb8846,['name',_0x4acd77])?_0x4acd77:undefined;})[_0x3162('0x77')]()[_0x3162('0x6a')]();if(!_['isEmpty'](_0x3b4afd)){_0x3b4afd[_0x3162('0x3c')](function(_0x5e5892){if(_0x5e5892===_0x3162('0x78')){_0x1f35ae['where'](_0x3162('0x79'),[]['concat'](_0x282e3e[_0x3162('0x45')][_0x5e5892]));}else if(_0x5e5892===_0x3162('0x7a')){var _0x22c234=JSON[_0x3162('0x7b')](_0x282e3e[_0x3162('0x45')][_0x5e5892])[_0x3162('0x7c')];var _0x5885dd=JSON[_0x3162('0x7b')](_0x282e3e[_0x3162('0x45')][_0x5e5892])[_0x3162('0x7d')];_0x1f35ae['where'](_0x3162('0x7e'),_0x22c234,_0x5885dd);}else{if(_0x282e3e[_0x3162('0x45')][_0x5e5892]===_0x3162('0x7f')){_0x1f35ae[_0x3162('0x80')]('i.'+_0x5e5892+_0x3162('0x81'));}else{_0x1f35ae['where']('i.'+_0x5e5892+_0x3162('0x82'),_0x282e3e[_0x3162('0x45')][_0x5e5892]);}}});}if(_0x282e3e['query']['read']){if(_0x282e3e[_0x3162('0x45')][_0x3162('0x83')]==0x1){_0x1f35ae['having'](_0x3162('0x84'));}else{_0x1f35ae[_0x3162('0x85')](_0x3162('0x86'));}}if(_0x282e3e[_0x3162('0x45')][_0x3162('0x87')]){_0x6ed643=_[_0x3162('0x88')](_0x282e3e[_0x3162('0x45')][_0x3162('0x87')])?_0x282e3e[_0x3162('0x45')]['tag']:new Array(_0x282e3e['query'][_0x3162('0x87')]);_0x6ed643[_0x3162('0x3c')](function(_0x5d9af1){_0x27eaba['or'](_0x3162('0x6f'),'%,'+_0x5d9af1+',%');});}if(_0x282e3e['query']['filter']){var _0x4bc14c=_0x282e3e[_0x3162('0x45')]['filter'][_0x3162('0x89')]('\x5c','\x5c\x5c')[_0x3162('0x89')]('\x27\x27',_0x3162('0x8a'));if(qs[_0x3162('0x8b')](_0x4bc14c)){_0x5e1f2b['or'](_0x3162('0x8c'),_0x4bc14c+'%');}else{_0x5e1f2b['or'](_0x3162('0x8d'),qs[_0x3162('0x8e')](_0x4bc14c))['or'](_0x3162('0x8f'),_0x4bc14c+'%');}}}_0x1f35ae[_0x3162('0x80')](_0x5e1f2b);_0x1f35ae[_0x3162('0x90')](_0x3162('0x91'));var _0x53d6d9={'type':db[_0x3162('0x1e')][_0x3162('0x92')][_0x3162('0x93')],'raw':!![]};var _0x38ac7a=_0x1f35ae[_0x3162('0x94')]();_0x38ac7a[_0x3162('0x4f')](_0x3162('0x91'));_0x38ac7a[_0x3162('0x4f')](_0x3162('0x95'),_0x3162('0x63'));if(_0x1d78de[_0x3162('0x4d')]){_0x1d78de[_0x3162('0x4d')]['forEach'](function(_0x22bfb6){_0x1f35ae[_0x3162('0x4d')]('i.'+_0x22bfb6[0x0],_0x22bfb6[0x1]===_0x3162('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x6ed643)){_0x1f35ae[_0x3162('0x85')](_0x27eaba);_0x38ac7a['where'](_0x3162('0x97'),_0x6ed643);}BPromise[_0x3162('0x98')]()['then'](function(){if(!_0xf7d3e1){if(_0x282e3e['query'][_0x3162('0x78')]||_0x282e3e[_0x3162('0x45')]['journey'])return;_0x38ac7a[_0x3162('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x1f35ae[_0x3162('0x80')](_0x3162('0x99'));return;}return _0x282e3e[_0x3162('0x9a')][_0x3162('0x9b')]({'attributes':['id'],'raw':!![]})[_0x3162('0x35')](function(_0x32b6cf){if(_[_0x3162('0x9c')](_0x32b6cf)){_0x38ac7a[_0x3162('0x80')](_0x3162('0x9d'));_0x1f35ae['where'](_0x3162('0x9d'));}else{_0x38ac7a['where'](_0x3162('0x79'),_[_0x3162('0x3e')](_0x32b6cf,'id'));_0x1f35ae['where'](_0x3162('0x79'),_[_0x3162('0x3e')](_0x32b6cf,'id'));}});})[_0x3162('0x35')](function(){db[_0x3162('0x9e')][_0x3162('0x45')](_0x38ac7a[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x59a84b){_0x500e6b[_0x3162('0x2f')]=_0x59a84b[_0x3162('0x4a')];if(_0x500e6b[_0x3162('0x2f')]===0x0)return[];return db['sequelize'][_0x3162('0x45')](_0x146758[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x2b8e21){_0x4b23e8=_[_0x3162('0xa0')](_0x2b8e21,'id');_0x53d6d9=_[_0x3162('0xa1')](_0x53d6d9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x282e3e[_0x3162('0x45')][_0x3162('0x48')]){_0x1d78de[_0x3162('0x49')][_0x3162('0x3c')](function(_0x40ae99){_0x1f35ae['field']('i.'+_0x40ae99);});}else{_0x1f35ae[_0x3162('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3162('0x63'));_0x1f35ae[_0x3162('0x4f')]('a.key',_0x3162('0xa2'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa3'),'Account.mandatoryDisposition');_0x1f35ae[_0x3162('0x4f')]('i.*');_0x1f35ae['field'](_0x3162('0xa4'),_0x3162('0xa5'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa6'),_0x3162('0xa7'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa8'),'Contact.email');_0x1f35ae['field']('c.phone',_0x3162('0xa9'));_0x1f35ae[_0x3162('0x4f')]('c.mobile','Contact.mobile');_0x1f35ae[_0x3162('0x4f')]('c.fax',_0x3162('0xaa'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xab'),_0x3162('0xac'));_0x1f35ae['field'](_0x3162('0xad'),_0x3162('0xae'));_0x1f35ae[_0x3162('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3162('0x3a'));}if(_0x1d78de['limit'])_0x1f35ae[_0x3162('0x31')](_0x1d78de['limit']);if(_0x1d78de[_0x3162('0x30')])_0x1f35ae[_0x3162('0x30')](_0x1d78de[_0x3162('0x30')]);return db['sequelize'][_0x3162('0x45')](_0x1f35ae[_0x3162('0x9f')](),_0x53d6d9);})[_0x3162('0x35')](function(_0x249b87){_0x871a24['where'](_0x3162('0xaf'),_[_0x3162('0x3e')](_0x249b87,'id'));return db['sequelize'][_0x3162('0x45')](_0x871a24[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x2243b3){var _0xdccc1a=_[_0x3162('0xb0')](_0x2243b3,_0x3162('0xb1'));var _0x3d977b=[];_0x249b87[_0x3162('0x3c')](function(_0xa2b606){_0x3d977b['push'](updateChatInteraction(_0xa2b606,_0x4b23e8,_0xdccc1a));});return BPromise[_0x3162('0xb2')](_0x3d977b);});});})[_0x3162('0x35')](function(_0x1ccb06){_0x500e6b[_0x3162('0xb3')]=_0x1ccb06;return _0x500e6b;})[_0x3162('0x35')](respondWithFilteredResult(_0x522cce,_0x1d78de));})[_0x3162('0x2b')](handleError(_0x522cce,null));};exports[_0x3162('0xb4')]=function(_0x3a103f,_0x49a2fe){var _0x2d179b={'raw':![],'where':{'id':_0x3a103f['params']['id']}},_0x3f0764={};_0x3f0764[_0x3162('0x43')]=_[_0x3162('0x44')](db[_0x3162('0xb5')][_0x3162('0x3f')]);_0x3f0764[_0x3162('0x45')]=_['keys'](_0x3a103f[_0x3162('0x45')]);_0x3f0764[_0x3162('0x46')]=_['intersection'](_0x3f0764[_0x3162('0x43')],_0x3f0764[_0x3162('0x45')]);_0x2d179b[_0x3162('0x49')]=_['intersection'](_0x3f0764['model'],qs[_0x3162('0x48')](_0x3a103f[_0x3162('0x45')]['fields']));_0x2d179b[_0x3162('0x49')]=_0x2d179b[_0x3162('0x49')][_0x3162('0x4a')]?_0x2d179b[_0x3162('0x49')]:_0x3f0764[_0x3162('0x43')];if(_0x3a103f[_0x3162('0x45')][_0x3162('0xb6')]){_0x2d179b[_0x3162('0xb7')]=[{'all':!![]}];}_0x2d179b=_[_0x3162('0xa1')]({},_0x2d179b,_0x3a103f['options']);return db[_0x3162('0xb5')][_0x3162('0x62')](_0x2d179b)['then'](handleEntityNotFound(_0x49a2fe,null))[_0x3162('0x35')](respondWithResult(_0x49a2fe,null))[_0x3162('0x2b')](handleError(_0x49a2fe,null));};exports[_0x3162('0xb8')]=function(_0x21a870,_0x334634){return db[_0x3162('0xb5')][_0x3162('0xb8')](_0x21a870[_0x3162('0x75')],{})[_0x3162('0x35')](respondWithResult(_0x334634,0xc9))[_0x3162('0x2b')](handleError(_0x334634,null));};exports[_0x3162('0xb9')]=function(_0x29b50e,_0x3fdb63){if(_0x29b50e['body']['id']){delete _0x29b50e[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')]['find']({'where':{'id':_0x29b50e[_0x3162('0xba')]['id']}})['then'](handleEntityNotFound(_0x3fdb63,null))[_0x3162('0x35')](saveUpdates(_0x29b50e[_0x3162('0x75')],null))[_0x3162('0x35')](respondWithResult(_0x3fdb63,null))[_0x3162('0x2b')](handleError(_0x3fdb63,null));};exports['destroy']=function(_0x301b3e,_0x43b706){return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x301b3e[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x43b706,null))[_0x3162('0x35')](removeEntity(_0x43b706,null))[_0x3162('0x2b')](handleError(_0x43b706,null));};exports[_0x3162('0xbb')]=function(_0x185974,_0x448ea9){return db['ChatInteraction'][_0x3162('0xbb')]()[_0x3162('0x35')](respondWithResult(_0x448ea9,null))[_0x3162('0x2b')](handleError(_0x448ea9,null));};exports[_0x3162('0xbc')]=function(_0x543964,_0x1b53ac){var _0xd056ef=_0x543964[_0x3162('0xba')]['id'];var _0x5ab418;var _0xa64510;var _0x411582;return db['ChatInteraction'][_0x3162('0xbd')]({'where':{'id':_0xd056ef}})[_0x3162('0x35')](function(_0x562335){_0x5ab418=_0x562335;return db[_0x3162('0xbe')][_0x3162('0xbd')]({'where':{'id':_0x562335[_0x3162('0x78')]},'attributes':['id',_0x3162('0xbf'),'vidaooEscalation'],'raw':!![]});})[_0x3162('0x35')](function(_0x13f37d){if(_0x13f37d&&_0x13f37d[_0x3162('0xbf')]&&_0x13f37d['vidaooEscalation']){_0xa64510=_0x13f37d;var _0x1dbdcc={'rejectUnauthorized':![],'method':_0x3162('0xc0'),'uri':_0x3162('0xc1'),'headers':{'X-APIKEY':_0x13f37d[_0x3162('0xbf')]},'body':{'name':_0x3162('0xc2')+_0xd056ef},'redirect':_0x3162('0xc3'),'json':!![]};return rp(_0x1dbdcc);}else{throw new db[(_0x3162('0x1e'))]['ValidationError'](_0x3162('0xc4'));}})[_0x3162('0x35')](function(_0x348241){_0x411582=_0x348241;if(_0x411582['id']){var _0x56ba1e={'body':_0x411582[_0x3162('0xc5')],'ChatWebsiteId':_0xa64510['id'],'ChatInteractionId':_0x5ab418['id'],'direction':_0x3162('0xc6'),'UserId':_0x543964[_0x3162('0x9a')]['id']};return db['ChatMessage'][_0x3162('0xb8')](_0x56ba1e,{});}else{throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0xc7'));}})[_0x3162('0x35')](function(){return _0x5ab418[_0x3162('0xc8')]({'vidaooSessionId':_0x411582['id']});})[_0x3162('0x35')](respondWithResult(_0x1b53ac,null))[_0x3162('0x2b')](handleError(_0x1b53ac,null));};exports[_0x3162('0xc9')]=function(_0x2f1bc1,_0x42c65a){if(_0x2f1bc1[_0x3162('0x75')]['id']){delete _0x2f1bc1[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x2f1bc1[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x42c65a,null))[_0x3162('0x35')](saveUpdates(_0x2f1bc1[_0x3162('0x75')],null))[_0x3162('0x35')](respondWithResult(_0x42c65a,null))[_0x3162('0x2b')](handleError(_0x42c65a,null));};exports[_0x3162('0xca')]=function(_0x5f3a9b,_0x13507d,_0x4137cb){if(_0x5f3a9b['body']['id']){delete _0x5f3a9b[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x5f3a9b[_0x3162('0xba')]['id']}})[_0x3162('0x35')](function(_0x3bd8e4){if(!_0x3bd8e4){logger['error'](_0x3162('0xcb'),_0x3162('0xca'),0x194,'entity\x20not\x20found');_0x13507d[_0x3162('0x2c')](0x194);}else{if(_0x3bd8e4['UserId']){throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0xcc'));}}return _0x3bd8e4;})[_0x3162('0x35')](function(_0x545f3e){if(_0x545f3e){return _0x545f3e[_0x3162('0xb9')]({'closed':_0x5f3a9b[_0x3162('0x75')][_0x3162('0xcd')],'disposition':_0x5f3a9b[_0x3162('0x75')][_0x3162('0xce')]})[_0x3162('0x35')](function(_0x4555ec){return _0x4555ec;});}})[_0x3162('0x35')](function(_0x594f55){return respondWithRpcPromise(_0x3162('0xcf'),_0x3162('0xca'),_0x5f3a9b[_0x3162('0x75')],client9004);})[_0x3162('0x35')](respondWithResult(_0x13507d,null))[_0x3162('0x2b')](handleError(_0x13507d,null));};exports[_0x3162('0xd0')]=function(_0x59c60a,_0x12282c,_0x421bb7){_0x59c60a[_0x3162('0x75')][_0x3162('0x37')]=_0x59c60a['file'][_0x3162('0xd1')];_0x59c60a[_0x3162('0x75')][_0x3162('0xd2')]=_0x59c60a['file'][_0x3162('0xd3')];_0x59c60a['body'][_0x3162('0x41')]=_0x59c60a[_0x3162('0xd4')][_0x3162('0xd5')];return db[_0x3162('0xd6')][_0x3162('0xb8')](_0x59c60a[_0x3162('0x75')])[_0x3162('0x35')](respondWithResult(_0x12282c,0xc9))['catch'](handleError(_0x12282c,null));};exports[_0x3162('0xd7')]=function(_0x71b6b9,_0x26a8ff,_0x30e1b7){return db[_0x3162('0xb5')][_0x3162('0xbd')]({'where':{'id':_0x71b6b9['params']['id']},'raw':!![]})[_0x3162('0x35')](handleEntityNotFound(_0x26a8ff,null))[_0x3162('0x35')](function(_0x1cca9a){if(_0x1cca9a){if(_0x1cca9a[_0x3162('0xcd')]){return _0x26a8ff['status'](0x193)[_0x3162('0x2e')]({'status':0x193,'message':_0x3162('0xd8')});}return db[_0x3162('0xd6')][_0x3162('0xbd')]({'where':{'id':_0x71b6b9[_0x3162('0x45')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x26a8ff,null));}})[_0x3162('0x35')](function(_0xc6d3a1){if(_0xc6d3a1){return _0x26a8ff[_0x3162('0xd9')](path['join'](config[_0x3162('0xda')],_0x3162('0xdb'),_0xc6d3a1[_0x3162('0xd2')]));}})[_0x3162('0x2b')](handleError(_0x26a8ff,null));};exports[_0x3162('0xdc')]=function(_0x391873,_0x548926){var _0x2df99e=null;var _0x4a7364=null;var _0x4749ba=null;var _0x468c8d=null;if(_0x391873['body']['id']){delete _0x391873[_0x3162('0x75')]['id'];}if(_0x391873[_0x3162('0x75')][_0x3162('0xdd')]){_0x468c8d=path['join'](config['root'],'server/files/chat/upload/',util[_0x3162('0xde')](_0x3162('0xdf'),Date[_0x3162('0xe0')]()));_0x391873[_0x3162('0x75')]['pathTranscript']=_0x468c8d;}return db['ChatInteraction'][_0x3162('0x62')]({'where':{'id':_0x391873['params']['id']},'include':[{'model':db[_0x3162('0xe1')],'as':_0x3162('0xe2'),'include':[{'model':db[_0x3162('0x71')],'as':_0x3162('0x71')}]}]})[_0x3162('0x35')](handleEntityNotFound(_0x548926,null))[_0x3162('0x35')](saveUpdates(_0x391873['body'],null))[_0x3162('0x35')](function(_0x459392){if(_0x459392){_0x2df99e=_0x459392;return db['ChatWebsite'][_0x3162('0x62')]({'where':{'id':_0x2df99e['ChatWebsiteId']}});}})[_0x3162('0x35')](function(_0x54e1ac){if(_0x54e1ac){_0x4749ba=_0x54e1ac;return db[_0x3162('0xe3')][_0x3162('0x62')]({'where':{'id':_0x2df99e[_0x3162('0x6c')]}});}})['then'](function(_0x332e31){if(_0x332e31){_0x4a7364=_0x332e31;if(_0x468c8d){var _0x505ef9=null;for(var _0x5381bc=0x1;_0x5381bc<_0x2df99e['Messages'][_0x3162('0x4a')];++_0x5381bc){_0x505ef9=_0x2df99e[_0x3162('0xe2')][_0x5381bc];var _0x341b67=_0x505ef9[_0x3162('0x73')]?util[_0x3162('0xde')](_0x3162('0xe4'),_0x4749ba[_0x3162('0xe5')],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');var _0x2d298e=_0x391873[_0x3162('0x75')][_0x3162('0xe7')]||util[_0x3162('0xde')](_0x3162('0xe4'),_0x3162('0xe8'),_0x505ef9[_0x3162('0x6c')]);switch(_0x4749ba['agentIdentifier']){case _0x3162('0xe9'):_0x341b67=_0x505ef9['UserId']?util[_0x3162('0xde')](_0x3162('0xe4'),_0x4749ba[_0x3162('0xe5')],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');break;case _0x3162('0xea'):_0x341b67=_0x505ef9[_0x3162('0x73')]?_0x505ef9[_0x3162('0x71')][_0x3162('0xeb')]||_0x505ef9[_0x3162('0x71')][_0x3162('0xec')]:_0x3162('0xe6');break;case _0x3162('0xed'):_0x341b67=_0x505ef9['UserId']?_0x505ef9['User'][_0x3162('0xec')]:_0x3162('0xe6');break;default:_0x341b67=_0x505ef9[_0x3162('0x73')]?util['format']('%s%d',_0x4749ba['agentAlias'],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');}var _0x39785a=util[_0x3162('0xde')]('[%s]\x20%s:\x20%s\x0a',moment(_0x505ef9[_0x3162('0x7a')])['format'](_0x3162('0xee')),_0x505ef9['direction']==='in'?_0x2d298e:_0x341b67,_0x505ef9[_0x3162('0x75')]);if(!_0x505ef9[_0x3162('0xef')]){fs[_0x3162('0xf0')](_0x468c8d,_0x39785a);}}return db[_0x3162('0xf1')][_0x3162('0xbd')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3162('0x35')](function(_0x2c485b){if(_0x2c485b&&_0x2c485b[_0x3162('0xf2')]&&_0x391873[_0x3162('0x75')]){var _0x1be5ab={'tls':{'rejectUnauthorized':![]}};if(_0x2c485b['Smtp'][_0x3162('0xf3')]){_0x1be5ab[_0x3162('0xf3')]=_0x2c485b[_0x3162('0xf2')][_0x3162('0xf3')];}else{_0x1be5ab[_0x3162('0xf4')]=_0x2c485b[_0x3162('0xf2')]['host'];_0x1be5ab[_0x3162('0xf5')]=_0x2c485b[_0x3162('0xf2')]['port'];_0x1be5ab[_0x3162('0xf6')]=_0x2c485b['Smtp']['secure'];}if(_0x2c485b['Smtp'][_0x3162('0xf7')]){_0x1be5ab['auth']={'user':_0x2c485b[_0x3162('0xf2')]['user'],'pass':_0x2c485b[_0x3162('0xf2')][_0x3162('0xf8')]};}return respondWithRpcPromise(_0x3162('0xf9'),'sendMail',{'account':_0x1be5ab,'message':{'from':util[_0x3162('0xde')](_0x3162('0xfa'),_0x2c485b[_0x3162('0x37')],_0x2c485b[_0x3162('0xfb')]||_0x2c485b[_0x3162('0xf2')][_0x3162('0x9a')]),'to':_0x391873[_0x3162('0x75')][_0x3162('0xdd')],'subject':_0x3162('0xfc'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x391873['body']['mailTranscript']),'attachments':[{'path':_0x468c8d}]}})[_0x3162('0x35')](function(){return _0x2df99e;})[_0x3162('0x2b')](function(_0x560089){console[_0x3162('0x25')](_0x560089);});}else{return _0x2df99e;}})[_0x3162('0x35')](respondWithStatusCode(_0x548926,0xc8))['catch'](handleError(_0x548926,null));};exports[_0x3162('0xfd')]=function(_0x4e54ed,_0x2b3e5e,_0x58b2c8){return db['ChatMessage']['find']({'where':{'id':_0x4e54ed[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x2b3e5e,null))['then'](function(_0x1d3e81){if(_0x1d3e81){return _0x1d3e81[_0x3162('0xfd')](_0x4e54ed[_0x3162('0x75')]['ids'],_[_0x3162('0xfe')](_0x4e54ed['body'],[_0x3162('0xff'),'id'])||{});}})[_0x3162('0x35')](respondWithResult(_0x2b3e5e,null))[_0x3162('0x2b')](handleError(_0x2b3e5e,null));};exports[_0x3162('0x100')]=function(_0x12e467,_0x26f3ad,_0x5397e2){var _0x8d0df={'raw':![],'where':{}};var _0x167d75={};var _0x2dcc43={'count':0x0,'rows':[]};return db[_0x3162('0xb5')]['findOne']({'where':{'id':_0x12e467[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x26f3ad,null))[_0x3162('0x35')](function(_0x2d7dc2){if(_0x2d7dc2){_0x167d75[_0x3162('0x43')]=_[_0x3162('0x44')](db[_0x3162('0xe1')]['rawAttributes']);_0x167d75[_0x3162('0x45')]=_[_0x3162('0x44')](_0x12e467[_0x3162('0x45')]);_0x167d75[_0x3162('0x46')]=_[_0x3162('0x47')](_0x167d75[_0x3162('0x43')],_0x167d75['query']);_0x8d0df[_0x3162('0x49')]=_['intersection'](_0x167d75[_0x3162('0x43')],qs[_0x3162('0x48')](_0x12e467['query'][_0x3162('0x48')]));_0x8d0df[_0x3162('0x49')]=_0x8d0df[_0x3162('0x49')]['length']?_0x8d0df[_0x3162('0x49')]:_0x167d75['model'];if(!_0x12e467[_0x3162('0x45')][_0x3162('0x4b')](_0x3162('0x4c'))){_0x8d0df[_0x3162('0x31')]=qs[_0x3162('0x31')](_0x12e467[_0x3162('0x45')]['limit']);_0x8d0df[_0x3162('0x30')]=qs['offset'](_0x12e467[_0x3162('0x45')][_0x3162('0x30')]);}_0x8d0df[_0x3162('0x4d')]=qs[_0x3162('0x4e')](_0x12e467['query'][_0x3162('0x4e')]);_0x8d0df[_0x3162('0x80')]=qs[_0x3162('0x46')](_[_0x3162('0x101')](_0x12e467[_0x3162('0x45')],_0x167d75[_0x3162('0x46')]));_0x8d0df[_0x3162('0x80')]['ChatInteractionId']=_0x2d7dc2['id'];if(_0x12e467[_0x3162('0x45')][_0x3162('0x102')]){_0x8d0df[_0x3162('0x80')]=_['merge'](_0x8d0df[_0x3162('0x80')],{'$or':_[_0x3162('0x3e')](_0x8d0df['attributes'],function(_0x109f34){var _0xf633c5={};_0xf633c5[_0x109f34]={'$like':'%'+_0x12e467[_0x3162('0x45')][_0x3162('0x102')]+'%'};return _0xf633c5;})});}if(_0x12e467['query'][_0x3162('0x7c')]){var _0x655e50=_0x12e467[_0x3162('0x45')]['$gte'][_0x3162('0x3b')](',');var _0x1df3ef={};_0x1df3ef[_0x655e50[0x0]]={'$gte':moment(_0x655e50[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x8d0df[_0x3162('0x80')]=_['merge'](_0x8d0df['where'],_0x1df3ef);}_0x8d0df=_[_0x3162('0xa1')]({},_0x8d0df,_0x12e467[_0x3162('0x103')]);return db[_0x3162('0xe1')][_0x3162('0x2f')]({'where':_0x8d0df[_0x3162('0x80')]})[_0x3162('0x35')](function(_0x4db20b){_0x2dcc43[_0x3162('0x2f')]=_0x4db20b;if(_0x12e467[_0x3162('0x45')][_0x3162('0xb6')]){_0x8d0df[_0x3162('0xb7')]=[{'all':!![]}];}return db['ChatMessage'][_0x3162('0x104')](_0x8d0df);})[_0x3162('0x35')](function(_0x25a0b8){_0x2dcc43[_0x3162('0xb3')]=_0x25a0b8;return _0x2dcc43;});}})['then'](respondWithFilteredResult(_0x26f3ad,_0x8d0df))[_0x3162('0x2b')](handleError(_0x26f3ad,null));};exports[_0x3162('0x105')]=function(_0x1f1e55,_0x2aeef7,_0x12655a){var _0x2bd203={'where':{}},_0x579bf2={},_0x1363c8={'count':0x0,'rows':[]};return db[_0x3162('0xb5')][_0x3162('0xbd')]({'where':{'id':_0x1f1e55[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x2aeef7,null))['then'](function(_0x506aad){if(_0x506aad){_0x579bf2[_0x3162('0x43')]=_['keys'](db[_0x3162('0xe1')][_0x3162('0x3f')]);_0x579bf2[_0x3162('0x45')]=_[_0x3162('0x44')](_0x1f1e55['query']);_0x579bf2[_0x3162('0x46')]=_['intersection'](_0x579bf2[_0x3162('0x43')],_0x579bf2[_0x3162('0x45')]);_0x2bd203[_0x3162('0x49')]=_['intersection'](_0x579bf2[_0x3162('0x43')],qs[_0x3162('0x48')](_0x1f1e55[_0x3162('0x45')]['fields']));_0x2bd203[_0x3162('0x49')]=_0x2bd203[_0x3162('0x49')][_0x3162('0x4a')]?_0x2bd203[_0x3162('0x49')]:_0x579bf2[_0x3162('0x43')];if(!_0x1f1e55['query']['hasOwnProperty'](_0x3162('0x4c'))){_0x2bd203['limit']=qs[_0x3162('0x31')](_0x1f1e55['query'][_0x3162('0x31')]);_0x2bd203[_0x3162('0x30')]=qs[_0x3162('0x30')](_0x1f1e55['query'][_0x3162('0x30')]);}_0x2bd203[_0x3162('0x4d')]=qs['sort'](_0x1f1e55[_0x3162('0x45')]['sort']);_0x2bd203[_0x3162('0x80')]=qs[_0x3162('0x46')](_[_0x3162('0x101')](_0x1f1e55[_0x3162('0x45')],_0x579bf2[_0x3162('0x46')]));_0x2bd203[_0x3162('0x80')][_0x3162('0xb1')]=_0x506aad['id'];if(_0x1f1e55[_0x3162('0x45')][_0x3162('0x102')]){_0x2bd203[_0x3162('0x80')]=_['merge'](_0x2bd203[_0x3162('0x80')],{'$or':_[_0x3162('0x3e')](_0x2bd203[_0x3162('0x49')],function(_0x476077){var _0xa09807={};_0xa09807[_0x476077]={'$like':'%'+_0x1f1e55[_0x3162('0x45')]['filter']+'%'};return _0xa09807;})});}_0x2bd203[_0x3162('0x80')][_0x3162('0xef')]=![];if(_0x1f1e55[_0x3162('0x45')]['id']){_0x2bd203['where']['id']={'$gt':_0x1f1e55[_0x3162('0x45')]['id']};}_0x2bd203=_['merge']({},_0x2bd203,_0x1f1e55[_0x3162('0x103')]);return db[_0x3162('0xe1')][_0x3162('0x2f')]({'where':_0x2bd203[_0x3162('0x80')]})['then'](function(_0x548fb5){_0x1363c8[_0x3162('0x2f')]=_0x548fb5;_0x2bd203[_0x3162('0xb7')]=[];if(_0x1f1e55[_0x3162('0x45')][_0x3162('0x106')]){_0x2bd203[_0x3162('0xb7')]['push']({'model':db[_0x3162('0x71')],'as':'User','attributes':['id',_0x3162('0xec'),_0x3162('0xeb')]});}if(_0x1f1e55[_0x3162('0x45')]['includeAll']){_0x2bd203[_0x3162('0xb7')]=[{'all':!![]}];}return db[_0x3162('0xe1')][_0x3162('0x104')](_0x2bd203);})[_0x3162('0x35')](function(_0x201644){_0x1363c8['rows']=_0x201644;return _0x1363c8;});}})[_0x3162('0x35')](respondWithFilteredResult(_0x2aeef7,_0x2bd203))['catch'](handleError(_0x2aeef7,null));};exports[_0x3162('0x107')]=function(_0x491aed,_0x235e9f,_0x3c2e92){return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x491aed[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x235e9f,null))[_0x3162('0x35')](function(_0x26cf0e){if(_0x26cf0e){return _0x26cf0e['setTags'](_0x491aed['body'][_0x3162('0xff')],_[_0x3162('0xfe')](_0x491aed[_0x3162('0x75')],[_0x3162('0xff'),'id'])||{})[_0x3162('0x108')](function(){return db[_0x3162('0x109')]['findAll']({'attributes':['id',_0x3162('0x37'),_0x3162('0x50')],'where':{'id':_0x491aed[_0x3162('0x75')]['ids']}});})[_0x3162('0x35')](function(_0x442122){socket[_0x3162('0x10a')]('chatInteractionTags:save',{'id':Number(_0x491aed[_0x3162('0xba')]['id']),'tags':_0x442122||[]});return{'id':Number(_0x491aed[_0x3162('0xba')]['id']),'tags':_0x442122||[]};});}})['then'](respondWithResult(_0x235e9f,null))[_0x3162('0x2b')](handleError(_0x235e9f,null));};exports[_0x3162('0x10b')]=function(_0x2af795,_0x4d031b,_0x10c3ab){return db['ChatInteraction'][_0x3162('0x62')]({'where':{'id':_0x2af795[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x4d031b,null))[_0x3162('0x35')](function(_0x41f32a){if(_0x41f32a){return _0x41f32a[_0x3162('0x10b')](_0x2af795[_0x3162('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x4d031b,null))['catch'](handleError(_0x4d031b,null));};exports[_0x3162('0xd9')]=function(_0x3dbcbe,_0x39a4b8){var _0x4f9c36=moment()[_0x3162('0x10c')]()['toString']();var _0x35ae89=path[_0x3162('0x10d')](config[_0x3162('0xda')],'server',_0x3162('0x10e'),'tmp');var _0x41500b=path['join'](config[_0x3162('0xda')],'server','files',_0x3162('0x10f'));var _0xe47f9b=path[_0x3162('0x10d')](_0x35ae89,_0x4f9c36);var _0x4f3266=util[_0x3162('0xde')](_0x3162('0x110'),_0x3dbcbe[_0x3162('0xba')]['id'],_0x4f9c36);var _0x478f9f=path[_0x3162('0x10d')](_0x35ae89,_0x4f3266);var _0xfadf2a=[];_0xfadf2a[_0x3162('0x111')]({'model':db[_0x3162('0x71')],'as':_0x3162('0x71'),'attributes':['id','fullname'],'raw':!![]});_0xfadf2a[_0x3162('0x111')]({'model':db['CmContact'],'as':_0x3162('0x66'),'attributes':['id','firstName',_0x3162('0x112')],'raw':!![]});if(_0x3dbcbe['query']['attachments']){_0xfadf2a[_0x3162('0x111')]({'model':db[_0x3162('0xd6')],'as':_0x3162('0xd6'),'raw':!![]});}var _0x238eef=[{'model':db[_0x3162('0xe1')],'as':'Messages','attributes':['id','body',_0x3162('0x7a'),_0x3162('0x113'),_0x3162('0xef'),'read'],'include':_0xfadf2a}];_0x238eef['push']({'model':db[_0x3162('0xbe')],'as':_0x3162('0x114'),'attributes':['id',_0x3162('0x37')]});_0x238eef[_0x3162('0x111')]({'model':db['User'],'as':_0x3162('0x115'),'attributes':['id',_0x3162('0xec')]});return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x3dbcbe[_0x3162('0xba')]['id']},'include':_0x238eef})['then'](handleEntityNotFound(_0x39a4b8,null))['then'](function(_0x471d89){if(_0x471d89){var _0x4f536c=_0x471d89['get']({'plain':!![]});fs[_0x3162('0x116')](_0xe47f9b);var _0x3d15ec={'format':'A4','border':_0x3162('0x117'),'header':{'height':_0x3162('0x118'),'contents':{'first':_0x3162('0x119')}},'footer':{'height':_0x3162('0x11a'),'contents':{'default':util[_0x3162('0xde')]('\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\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\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%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\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\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{{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\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\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%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\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',util[_0x3162('0xde')]('%s\x20#%d',_0x3162('0x11b'),_0x4f536c['id']),moment()[_0x3162('0xde')](_0x3162('0x11c'))[_0x3162('0x9f')]())}}};var _0x6023bd={'channel':_0x3162('0x11b'),'account':_0x4f536c['Account'][_0x3162('0x37')],'agent':_0x4f536c[_0x3162('0x115')]?_0x4f536c[_0x3162('0x115')]['fullname']:_0x3162('0x11d'),'createdAt':moment(_0x4f536c[_0x3162('0x7a')])[_0x3162('0xde')](_0x3162('0x11e'))[_0x3162('0x9f')](),'closedAt':_0x4f536c['closed']?moment(_0x4f536c['closedAt'])[_0x3162('0xde')](_0x3162('0x11e'))['toString']():'','disposition':_0x4f536c[_0x3162('0xce')],'chatInfo':{'browser':_0x4f536c[_0x3162('0x11f')],'os':_0x4f536c[_0x3162('0x120')],'referer':_0x4f536c[_0x3162('0x121')],'customerIp':_0x4f536c['customerIp'],'customerPort':_0x4f536c['customerPort']?_0x4f536c[_0x3162('0x122')]:_0x3162('0x11d')},'messages':_(_0x4f536c[_0x3162('0xe2')])[_0x3162('0x123')]()['filter']({'secret':![]})[_0x3162('0x3e')](function(_0x42ce41){if(_0x42ce41[_0x3162('0xd6')]){var _0x5c2208=path[_0x3162('0x10d')](_0x41500b,_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')]);if(fs[_0x3162('0x124')](_0x5c2208)){fs[_0x3162('0x125')](_0x5c2208)[_0x3162('0x126')](fs[_0x3162('0x127')](path[_0x3162('0x10d')](_0xe47f9b,_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')])));}}return{'date':moment(_0x42ce41['createdAt'])[_0x3162('0xde')](_0x3162('0x11e'))[_0x3162('0x9f')](),'sender':_0x42ce41[_0x3162('0x113')]===_0x3162('0xc6')?_0x42ce41[_0x3162('0x71')]?_0x42ce41['User'][_0x3162('0xec')]:_0x3162('0xe6'):_0x42ce41[_0x3162('0x66')]['firstName']+(_0x42ce41[_0x3162('0x66')][_0x3162('0x112')]?'\x20'+_0x42ce41[_0x3162('0x66')][_0x3162('0x112')]:''),'body':_0x42ce41[_0x3162('0xd6')]?_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')]:_0x42ce41[_0x3162('0x75')],'direction':_0x42ce41[_0x3162('0x113')]==='out'?'A':'C','secret':_0x42ce41[_0x3162('0xef')],'read':_0x42ce41['read'],'attachment':_0x42ce41[_0x3162('0xd6')]};})['value']()};return ejs[_0x3162('0x128')](path[_0x3162('0x10d')](config[_0x3162('0xda')],_0x3162('0x129'),'views',_0x3162('0x12a')),{'interaction':_0x6023bd})['then'](function(_0x4d23a9){return new BPromise(function(_0x549a4b,_0x25b697){pdf[_0x3162('0xb8')](_0x4d23a9,_0x3d15ec)[_0x3162('0x12b')](path[_0x3162('0x10d')](_0xe47f9b,'transcript-'+_0x4f536c['id']+'-'+_0x4f9c36+_0x3162('0x12c')),function(_0x8d17c4,_0x52718f){if(_0x8d17c4)return _0x25b697(_0x8d17c4);_0x549a4b(_0x52718f);});});})[_0x3162('0x35')](function(){return new BPromise(function(_0x4ca74a,_0xe54261){zipdir(_0xe47f9b,{'saveTo':_0x478f9f},function(_0x5964b7,_0x19f1d6){if(_0x5964b7)return _0xe54261(_0x5964b7);return _0x4ca74a(_0x19f1d6);});})['then'](function(){return new BPromise(function(_0x4716b2,_0x5b89b7){rimraf(_0xe47f9b,function(_0x1be91b){if(_0x1be91b)_0x5b89b7(_0x1be91b);return _0x4716b2();});});})[_0x3162('0x35')](function(){return _0x39a4b8[_0x3162('0xd9')](_0x478f9f,_0x4f3266,function(_0x8922b5){if(_0x8922b5){console[_0x3162('0x12d')](_0x3162('0x12e'),_0x8922b5);}else{fs[_0x3162('0x12f')](_0x478f9f);}});});});}else{return _0x39a4b8[_0x3162('0x2c')](0xc8);}})[_0x3162('0x2b')](handleError(_0x39a4b8,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4d0702a..78be78b 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 _0xc4b8=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x2c5943,_0x56457d){var _0x74e029=function(_0x221da2){while(--_0x221da2){_0x2c5943['push'](_0x2c5943['shift']());}};_0x74e029(++_0x56457d);}(_0xc4b8,0x1ed));var _0x8c4b=function(_0x395f7a,_0x278639){_0x395f7a=_0x395f7a-0x0;var _0x16b589=_0xc4b8[_0x395f7a];return _0x16b589;};'use strict';var EventEmitter=require(_0x8c4b('0x0'));var ChatInteraction=require(_0x8c4b('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x8c4b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8c4b('0x2')](0x0);var events={'afterCreate':_0x8c4b('0x3'),'afterUpdate':_0x8c4b('0x4'),'afterDestroy':_0x8c4b('0x5')};function emitEvent(_0x2f3e9d){return function(_0x36e7a2,_0x35c29a,_0x4ed730){_0x36e7a2[_0x8c4b('0x6')]({'attributes':['id'],'raw':!![]})[_0x8c4b('0x7')](function(_0x517038){_0x36e7a2[_0x8c4b('0x8')](_0x8c4b('0x9'),_0x517038[_0x8c4b('0xa')](function(_0x56934c){return{'id':_0x56934c['id']};}));return ChatMessage[_0x8c4b('0xb')]({'where':{'ChatInteractionId':_0x36e7a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8c4b('0x7')](function(_0x4e7d04){_0x36e7a2[_0x8c4b('0x8')](_0x8c4b('0xc'),_0x4e7d04[_0x8c4b('0xd')]);ChatInteractionEvents[_0x8c4b('0xe')](_0x2f3e9d+':'+_0x36e7a2['id'],_0x36e7a2);ChatInteractionEvents[_0x8c4b('0xe')](_0x2f3e9d,_0x36e7a2);_0x4ed730(null);})[_0x8c4b('0xf')](_0x4ed730(null));};}for(var e in events){if(events[_0x8c4b('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x8c4b('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x269b=['setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','getUsers','then'];(function(_0x2028a2,_0xeaf4ff){var _0x22ddde=function(_0x55a5f9){while(--_0x55a5f9){_0x2028a2['push'](_0x2028a2['shift']());}};_0x22ddde(++_0xeaf4ff);}(_0x269b,0x9a));var _0xb269=function(_0x1c8ce1,_0x14a3d1){_0x1c8ce1=_0x1c8ce1-0x0;var _0x50280d=_0x269b[_0x1c8ce1];return _0x50280d;};'use strict';var EventEmitter=require(_0xb269('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xb269('0x1')];var ChatMessage=require(_0xb269('0x2'))['db'][_0xb269('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb269('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb269('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c4827){return function(_0x4b6243,_0x349406,_0x2398bb){_0x4b6243[_0xb269('0x6')]({'attributes':['id'],'raw':!![]})[_0xb269('0x7')](function(_0x17dcff){_0x4b6243[_0xb269('0x8')](_0xb269('0x9'),_0x17dcff['map'](function(_0x57a954){return{'id':_0x57a954['id']};}));return ChatMessage[_0xb269('0xa')]({'where':{'ChatInteractionId':_0x4b6243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb269('0x7')](function(_0x33799c){_0x4b6243[_0xb269('0x8')](_0xb269('0xb'),_0x33799c[_0xb269('0xc')]);ChatInteractionEvents[_0xb269('0xd')](_0x5c4827+':'+_0x4b6243['id'],_0x4b6243);ChatInteractionEvents[_0xb269('0xd')](_0x5c4827,_0x4b6243);_0x2398bb(null);})[_0xb269('0xe')](_0x2398bb(null));};}for(var e in events){if(events[_0xb269('0xf')](e)){var event=events[e];ChatInteraction[_0xb269('0x10')](e,emitEvent(event));}}module[_0xb269('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index fa3e78d..724c038 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 _0xf3b6=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x3f9602,_0x115411){var _0xb22e48=function(_0x227c90){while(--_0x227c90){_0x3f9602['push'](_0x3f9602['shift']());}};_0xb22e48(++_0x115411);}(_0xf3b6,0x1c5));var _0x6f3b=function(_0x3b37cf,_0x4e6ddb){_0x3b37cf=_0x3b37cf-0x0;var _0x21a23e=_0xf3b6[_0x3b37cf];return _0x21a23e;};'use strict';var _=require(_0x6f3b('0x0'));var util=require(_0x6f3b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6f3b('0x2'));var BPromise=require(_0x6f3b('0x3'));var rp=require(_0x6f3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f3b('0x5'));var attributes=require(_0x6f3b('0x6'));module[_0x6f3b('0x7')]=function(_0x135712,_0x314e9c){return _0x135712[_0x6f3b('0x8')](_0x6f3b('0x9'),attributes,{'tableName':_0x6f3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x338bdc,_0x1888dc,_0x5969d0){if(_0x338bdc[_0x6f3b('0xb')](_0x6f3b('0xc'))){_0x338bdc[_0x6f3b('0xd')]=moment()[_0x6f3b('0xe')](_0x6f3b('0xf'));}_0x5969d0(null,_0x338bdc);}},'charset':_0x6f3b('0x10'),'collate':_0x6f3b('0x11')});}; \ No newline at end of file +var _0x2634=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','closed','format'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x2634,0x1f3));var _0x4263=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2634[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x4263('0x0'));var logger=require(_0x4263('0x1'))(_0x4263('0x2'));var moment=require('moment');var BPromise=require(_0x4263('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4263('0x4'));var rimraf=require(_0x4263('0x5'));var config=require(_0x4263('0x6'));var attributes=require(_0x4263('0x7'));module['exports']=function(_0x1123ed,_0x4d5018){return _0x1123ed[_0x4263('0x8')](_0x4263('0x9'),attributes,{'tableName':_0x4263('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57ece9,_0x17b72f,_0x538744){if(_0x57ece9['changed'](_0x4263('0xb'))){_0x57ece9['closedAt']=moment()[_0x4263('0xc')](_0x4263('0xd'));}_0x538744(null,_0x57ece9);}},'charset':_0x4263('0xe'),'collate':_0x4263('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index db18139..576c969 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 _0xc99d=['ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','then','debug','AddTagsToChatInteraction','find','where','addTags','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','info'];(function(_0x2ebea7,_0x5496c0){var _0x28ded4=function(_0x2e70d2){while(--_0x2e70d2){_0x2ebea7['push'](_0x2ebea7['shift']());}};_0x28ded4(++_0x5496c0);}(_0xc99d,0x1ea));var _0xdc99=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xc99d[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xdc99('0x0'));var util=require('util');var moment=require(_0xdc99('0x1'));var BPromise=require(_0xdc99('0x2'));var rs=require(_0xdc99('0x3'));var fs=require('fs');var Redis=require(_0xdc99('0x4'));var db=require(_0xdc99('0x5'))['db'];var utils=require(_0xdc99('0x6'));var logger=require(_0xdc99('0x7'))(_0xdc99('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdc99('0x9')][_0xdc99('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdc99('0xb')],{'host':_0xdc99('0xc'),'port':0x18eb});var socket=require(_0xdc99('0xd'))(new Redis(config[_0xdc99('0xb')]));require(_0xdc99('0xe'))[_0xdc99('0xf')](socket);function respondWithRpcPromise(_0x5f4d05,_0x1ec32c,_0x3779d4){return new BPromise(function(_0xfe3aed,_0xdbde02){return client['request'](_0x5f4d05,_0x3779d4)['then'](function(_0x2fb225){logger[_0xdc99('0x10')](_0xdc99('0x11'),_0x1ec32c,_0xdc99('0x12'));logger['debug'](_0xdc99('0x13'),_0x1ec32c,_0xdc99('0x12'),JSON[_0xdc99('0x14')](_0x2fb225));if(_0x2fb225[_0xdc99('0x15')]){if(_0x2fb225[_0xdc99('0x15')][_0xdc99('0x16')]===0x1f4){logger['error'](_0xdc99('0x11'),_0x1ec32c,_0x2fb225[_0xdc99('0x15')]['message']);return _0xdbde02(_0x2fb225[_0xdc99('0x15')]['message']);}logger[_0xdc99('0x15')](_0xdc99('0x11'),_0x1ec32c,_0x2fb225['error'][_0xdc99('0x17')]);return _0xfe3aed(_0x2fb225[_0xdc99('0x15')][_0xdc99('0x17')]);}else{logger['info'](_0xdc99('0x11'),_0x1ec32c,_0xdc99('0x12'));_0xfe3aed(_0x2fb225[_0xdc99('0x18')]['message']);}})[_0xdc99('0x19')](function(_0x38e330){logger['error'](_0xdc99('0x11'),_0x1ec32c,_0x38e330);_0xdbde02(_0x38e330);});});}exports[_0xdc99('0x1a')]=function(_0xb6e38d){var _0x146573=this;return new Promise(function(_0x2d7915,_0x569e27){return db[_0xdc99('0x1b')]['update'](_0xb6e38d[_0xdc99('0x1c')],{'raw':_0xb6e38d[_0xdc99('0x1d')]?_0xb6e38d[_0xdc99('0x1d')][_0xdc99('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb6e38d[_0xdc99('0x1d')]?_0xb6e38d[_0xdc99('0x1d')]['where']||null:null,'attributes':_0xb6e38d[_0xdc99('0x1d')]?_0xb6e38d['options'][_0xdc99('0x1f')]||null:null,'limit':_0xb6e38d[_0xdc99('0x1d')]?_0xb6e38d[_0xdc99('0x1d')]['limit']||null:null})[_0xdc99('0x20')](function(_0x8a2dfd){logger[_0xdc99('0x10')](_0xdc99('0x1a'),_0xb6e38d);logger[_0xdc99('0x21')](_0xdc99('0x1a'),_0xb6e38d,JSON[_0xdc99('0x14')](_0x8a2dfd));_0x2d7915(_0x8a2dfd);})['catch'](function(_0x209a59){logger[_0xdc99('0x15')](_0xdc99('0x1a'),_0x209a59[_0xdc99('0x17')],_0xb6e38d);_0x569e27(_0x146573['error'](0x1f4,_0x209a59[_0xdc99('0x17')]));});});};exports[_0xdc99('0x22')]=function(_0x396158){return new Promise(function(_0x17cbf7,_0x2811a6){return db['ChatInteraction'][_0xdc99('0x23')]({'where':_0x396158[_0xdc99('0x1d')]?_0x396158[_0xdc99('0x1d')][_0xdc99('0x24')]||null:null})[_0xdc99('0x20')](function(_0x4e48eb){if(_0x4e48eb){return _0x4e48eb[_0xdc99('0x25')](_0x396158[_0xdc99('0x1c')]['ids'],_['omit'](_0x396158[_0xdc99('0x1c')],['ids','id'])||{});}})['spread'](function(_0x305453){logger[_0xdc99('0x10')]('AddTags',_0x396158);logger[_0xdc99('0x21')](_0xdc99('0x26'),_0x396158,JSON[_0xdc99('0x14')](_0x305453));_0x17cbf7(_0x305453);})[_0xdc99('0x19')](function(_0xe2abf6){logger[_0xdc99('0x15')](_0xdc99('0x26'),_0xe2abf6['message'],_0x396158);_0x2811a6(_this['error'](0x1f4,_0xe2abf6[_0xdc99('0x17')]));});});}; \ No newline at end of file +var _0x6c91=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','debug','stringify','AddTagsToChatInteraction','find','where','ids','omit','spread','AddTags','lodash','moment','bluebird'];(function(_0x37537c,_0x1a4cd5){var _0x42345b=function(_0x5c5309){while(--_0x5c5309){_0x37537c['push'](_0x37537c['shift']());}};_0x42345b(++_0x1a4cd5);}(_0x6c91,0xed));var _0x16c9=function(_0x1c7668,_0x3f047f){_0x1c7668=_0x1c7668-0x0;var _0x5b2934=_0x6c91[_0x1c7668];return _0x5b2934;};'use strict';var _=require(_0x16c9('0x0'));var util=require('util');var moment=require(_0x16c9('0x1'));var BPromise=require(_0x16c9('0x2'));var rs=require(_0x16c9('0x3'));var fs=require('fs');var Redis=require(_0x16c9('0x4'));var db=require(_0x16c9('0x5'))['db'];var utils=require(_0x16c9('0x6'));var logger=require('../../config/logger')(_0x16c9('0x7'));var config=require('../../config/environment');var jayson=require(_0x16c9('0x8'));var client=jayson[_0x16c9('0x9')][_0x16c9('0xa')]({'port':0x232a});config[_0x16c9('0xb')]=_[_0x16c9('0xc')](config[_0x16c9('0xb')],{'host':_0x16c9('0xd'),'port':0x18eb});var socket=require(_0x16c9('0xe'))(new Redis(config[_0x16c9('0xb')]));require(_0x16c9('0xf'))['register'](socket);function respondWithRpcPromise(_0x5853e4,_0x1df1d5,_0xa72142){return new BPromise(function(_0x6842be,_0xc59501){return client['request'](_0x5853e4,_0xa72142)[_0x16c9('0x10')](function(_0x47ac09){logger[_0x16c9('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x1df1d5,'request\x20sent');logger['debug'](_0x16c9('0x12'),_0x1df1d5,_0x16c9('0x13'),JSON['stringify'](_0x47ac09));if(_0x47ac09[_0x16c9('0x14')]){if(_0x47ac09['error'][_0x16c9('0x15')]===0x1f4){logger[_0x16c9('0x14')](_0x16c9('0x16'),_0x1df1d5,_0x47ac09[_0x16c9('0x14')][_0x16c9('0x17')]);return _0xc59501(_0x47ac09['error'][_0x16c9('0x17')]);}logger[_0x16c9('0x14')](_0x16c9('0x16'),_0x1df1d5,_0x47ac09[_0x16c9('0x14')]['message']);return _0x6842be(_0x47ac09[_0x16c9('0x14')][_0x16c9('0x17')]);}else{logger[_0x16c9('0x11')](_0x16c9('0x16'),_0x1df1d5,_0x16c9('0x13'));_0x6842be(_0x47ac09[_0x16c9('0x18')]['message']);}})[_0x16c9('0x19')](function(_0x5f4ebc){logger[_0x16c9('0x14')](_0x16c9('0x16'),_0x1df1d5,_0x5f4ebc);_0xc59501(_0x5f4ebc);});});}exports[_0x16c9('0x1a')]=function(_0x6defc4){var _0x4beaac=this;return new Promise(function(_0x4ad122,_0xa745a9){return db[_0x16c9('0x1b')]['update'](_0x6defc4[_0x16c9('0x1c')],{'raw':_0x6defc4[_0x16c9('0x1d')]?_0x6defc4['options'][_0x16c9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6defc4[_0x16c9('0x1d')]?_0x6defc4[_0x16c9('0x1d')]['where']||null:null,'attributes':_0x6defc4[_0x16c9('0x1d')]?_0x6defc4[_0x16c9('0x1d')]['attributes']||null:null,'limit':_0x6defc4['options']?_0x6defc4[_0x16c9('0x1d')]['limit']||null:null})['then'](function(_0xc7e98a){logger['info'](_0x16c9('0x1a'),_0x6defc4);logger[_0x16c9('0x1f')](_0x16c9('0x1a'),_0x6defc4,JSON[_0x16c9('0x20')](_0xc7e98a));_0x4ad122(_0xc7e98a);})[_0x16c9('0x19')](function(_0x308168){logger[_0x16c9('0x14')](_0x16c9('0x1a'),_0x308168[_0x16c9('0x17')],_0x6defc4);_0xa745a9(_0x4beaac[_0x16c9('0x14')](0x1f4,_0x308168['message']));});});};exports[_0x16c9('0x21')]=function(_0x9d49de){return new Promise(function(_0x109311,_0x359b4c){return db[_0x16c9('0x1b')][_0x16c9('0x22')]({'where':_0x9d49de['options']?_0x9d49de[_0x16c9('0x1d')][_0x16c9('0x23')]||null:null})[_0x16c9('0x10')](function(_0x3316b9){if(_0x3316b9){return _0x3316b9['addTags'](_0x9d49de[_0x16c9('0x1c')][_0x16c9('0x24')],_[_0x16c9('0x25')](_0x9d49de['body'],[_0x16c9('0x24'),'id'])||{});}})[_0x16c9('0x26')](function(_0x5d5e74){logger[_0x16c9('0x11')]('AddTags',_0x9d49de);logger[_0x16c9('0x1f')](_0x16c9('0x27'),_0x9d49de,JSON['stringify'](_0x5d5e74));_0x109311(_0x5d5e74);})[_0x16c9('0x19')](function(_0x481598){logger[_0x16c9('0x14')](_0x16c9('0x27'),_0x481598[_0x16c9('0x17')],_0x9d49de);_0x359b4c(_this[_0x16c9('0x14')](0x1f4,_0x481598['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 5c5007c..24204d3 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 _0xe96b=['length','chatInteraction:','./chatInteraction.events','save','remove','emit','removeListener','register'];(function(_0x2df782,_0x524eeb){var _0x205b8a=function(_0x5e8162){while(--_0x5e8162){_0x2df782['push'](_0x2df782['shift']());}};_0x205b8a(++_0x524eeb);}(_0xe96b,0x132));var _0xbe96=function(_0x4ba259,_0x1766a8){_0x4ba259=_0x4ba259-0x0;var _0x4bb7a2=_0xe96b[_0x4ba259];return _0x4bb7a2;};'use strict';var ChatInteractionEvents=require(_0xbe96('0x0'));var events=[_0xbe96('0x1'),_0xbe96('0x2'),'update'];function createListener(_0x5de8b3,_0x2d6334){return function(_0x1d1c7d){_0x2d6334[_0xbe96('0x3')](_0x5de8b3,_0x1d1c7d);};}function removeListener(_0x1bb542,_0x5c4b20){return function(){ChatInteractionEvents[_0xbe96('0x4')](_0x1bb542,_0x5c4b20);};}exports[_0xbe96('0x5')]=function(_0x2cd35d){for(var _0x38ede2=0x0,_0x3642f2=events[_0xbe96('0x6')];_0x38ede2<_0x3642f2;_0x38ede2++){var _0xace869=events[_0x38ede2];var _0x4decb8=createListener(_0xbe96('0x7')+_0xace869,_0x2cd35d);ChatInteractionEvents['on'](_0xace869,_0x4decb8);}}; \ No newline at end of file +var _0x2d9a=['remove','emit','register','chatInteraction:'];(function(_0x3e85bb,_0x2e9931){var _0x4a66b2=function(_0x12f422){while(--_0x12f422){_0x3e85bb['push'](_0x3e85bb['shift']());}};_0x4a66b2(++_0x2e9931);}(_0x2d9a,0x114));var _0xa2d9=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x2d9a[_0x1f7839];return _0x36b42e;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xa2d9('0x0'),'update'];function createListener(_0x5066dc,_0xa3bd7){return function(_0x21b17f){_0xa3bd7[_0xa2d9('0x1')](_0x5066dc,_0x21b17f);};}function removeListener(_0xe7eb1a,_0x4c4d38){return function(){ChatInteractionEvents['removeListener'](_0xe7eb1a,_0x4c4d38);};}exports[_0xa2d9('0x2')]=function(_0x5346be){for(var _0x159f47=0x0,_0x361fd8=events['length'];_0x159f47<_0x361fd8;_0x159f47++){var _0x9f7cda=events[_0x159f47];var _0xd67d7e=createListener(_0xa2d9('0x3')+_0x9f7cda,_0x5346be);ChatInteractionEvents['on'](_0x9f7cda,_0xd67d7e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 667a187..01aed8c 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 _0xe820=['join','server/files/attachments/','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','/:id/vidaoo'];(function(_0x586acc,_0x4a2779){var _0x3a214a=function(_0x32ad69){while(--_0x32ad69){_0x586acc['push'](_0x586acc['shift']());}};_0x3a214a(++_0x4a2779);}(_0xe820,0xd2));var _0x0e82=function(_0x1b8d39,_0x36a40b){_0x1b8d39=_0x1b8d39-0x0;var _0x12d867=_0xe820[_0x1b8d39];return _0x12d867;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var auth=require(_0x0e82('0x3'));var interaction=require(_0x0e82('0x4'));var config=require('../../config/environment');var controller=require(_0x0e82('0x5'));router['get']('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0x7')]);router[_0x0e82('0x8')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller['describe']);router[_0x0e82('0x8')](_0x0e82('0xa'),auth[_0x0e82('0xb')](),controller[_0x0e82('0xc')]);router[_0x0e82('0x8')]('/:id/attachment_download',auth[_0x0e82('0xb')](),controller[_0x0e82('0xd')]);router[_0x0e82('0x8')](_0x0e82('0xe'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xf')]);router[_0x0e82('0x8')]('/:id/my_messages',auth[_0x0e82('0xb')](),controller[_0x0e82('0x10')]);router[_0x0e82('0x8')](_0x0e82('0x11'),auth[_0x0e82('0x6')](),controller[_0x0e82('0x12')]);router['post']('/',auth[_0x0e82('0x6')](),controller['create']);router['post'](_0x0e82('0x13'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3298c7,_0x4d1aa0,_0x585b9b){_0x585b9b(null,path[_0x0e82('0x14')](config['root'],_0x0e82('0x15')));},'filename':function(_0x39cf23,_0x233c6d,_0x315ce4){_0x315ce4(null,util['format'](_0x0e82('0x16'),Date[_0x0e82('0x17')](),_0x233c6d[_0x0e82('0x18')][_0x0e82('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0e82('0x1a')](_0x0e82('0x1b'),upload[_0x0e82('0x1c')](_0x0e82('0x1d')),controller[_0x0e82('0x1e')]);router[_0x0e82('0x1a')](_0x0e82('0xe'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x0e82('0x1a')](_0x0e82('0x1f'),auth[_0x0e82('0x6')](),interaction[_0x0e82('0x20')](_0x0e82('0x21'),_0x0e82('0x22')),controller[_0x0e82('0x23')]);router[_0x0e82('0x24')]('/:id',auth[_0x0e82('0x6')](),interaction[_0x0e82('0x20')](_0x0e82('0x21'),_0x0e82('0x25')),controller['update']);router[_0x0e82('0x24')](_0x0e82('0x26'),controller[_0x0e82('0x27')]);router[_0x0e82('0x24')]('/:id/abandon',auth[_0x0e82('0xb')](),controller['abandon']);router['put'](_0x0e82('0x28'),controller[_0x0e82('0x29')]);router['delete'](_0x0e82('0xa'),auth[_0x0e82('0x6')](),interaction[_0x0e82('0x20')]('chat',_0x0e82('0x2a')),controller[_0x0e82('0x2b')]);router['delete'](_0x0e82('0x1f'),auth['isAuthenticated'](),controller[_0x0e82('0x2c')]);module[_0x0e82('0x2d')]=router; \ No newline at end of file +var _0x6a95=['attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download'];(function(_0x3ec551,_0xbf0edc){var _0x4b5e52=function(_0x4707c0){while(--_0x4707c0){_0x3ec551['push'](_0x3ec551['shift']());}};_0x4b5e52(++_0xbf0edc);}(_0x6a95,0x1db));var _0x56a9=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x6a95[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var path=require(_0x56a9('0x2'));var timeout=require(_0x56a9('0x3'));var express=require(_0x56a9('0x4'));var router=express[_0x56a9('0x5')]();var auth=require(_0x56a9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x56a9('0x7'));router[_0x56a9('0x8')]('/',auth[_0x56a9('0x9')](),controller[_0x56a9('0xa')]);router[_0x56a9('0x8')](_0x56a9('0xb'),auth[_0x56a9('0x9')](),controller['describe']);router['get'](_0x56a9('0xc'),auth[_0x56a9('0xd')](),controller['show']);router[_0x56a9('0x8')](_0x56a9('0xe'),auth[_0x56a9('0xd')](),controller[_0x56a9('0xf')]);router[_0x56a9('0x8')](_0x56a9('0x10'),auth[_0x56a9('0x9')](),controller[_0x56a9('0x11')]);router[_0x56a9('0x8')]('/:id/my_messages',auth[_0x56a9('0xd')](),controller['getMyMessages']);router[_0x56a9('0x8')](_0x56a9('0x12'),auth[_0x56a9('0x9')](),controller[_0x56a9('0x13')]);router[_0x56a9('0x14')]('/',auth[_0x56a9('0x9')](),controller[_0x56a9('0x15')]);router[_0x56a9('0x14')](_0x56a9('0x16'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x56a9('0x17')]({'destination':function(_0x2a0714,_0x42007b,_0x46f854){_0x46f854(null,path['join'](config[_0x56a9('0x18')],'server/files/attachments/'));},'filename':function(_0x5e5218,_0x4e292f,_0x312e58){_0x312e58(null,util[_0x56a9('0x19')](_0x56a9('0x1a'),Date[_0x56a9('0x1b')](),_0x4e292f[_0x56a9('0x1c')][_0x56a9('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x56a9('0x14')](_0x56a9('0x1e'),upload[_0x56a9('0x1f')](_0x56a9('0x20')),controller[_0x56a9('0x21')]);router[_0x56a9('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x56a9('0x22')]);router[_0x56a9('0x14')](_0x56a9('0x23'),auth[_0x56a9('0x9')](),interaction['tracked'](_0x56a9('0x24'),_0x56a9('0x25')),controller[_0x56a9('0x26')]);router[_0x56a9('0x27')]('/:id',auth[_0x56a9('0x9')](),interaction[_0x56a9('0x28')](_0x56a9('0x24'),_0x56a9('0x29')),controller[_0x56a9('0x2a')]);router['put'](_0x56a9('0x2b'),controller[_0x56a9('0x2c')]);router[_0x56a9('0x27')]('/:id/abandon',auth[_0x56a9('0xd')](),controller['abandon']);router[_0x56a9('0x27')](_0x56a9('0x2d'),controller[_0x56a9('0x2e')]);router[_0x56a9('0x2f')](_0x56a9('0xc'),auth[_0x56a9('0x9')](),interaction[_0x56a9('0x28')](_0x56a9('0x24'),'chatinteraction:destroy'),controller[_0x56a9('0x30')]);router[_0x56a9('0x2f')]('/:id/tags',auth[_0x56a9('0x9')](),controller['removeTags']);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 0500652..bc49fd6 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 _0x1a85=['BOOLEAN','TEXT','medium'];(function(_0x403115,_0x2d6d03){var _0x596ef3=function(_0x145d97){while(--_0x145d97){_0x403115['push'](_0x403115['shift']());}};_0x596ef3(++_0x2d6d03);}(_0x1a85,0x178));var _0x51a8=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x1a85[_0x100e36];return _0x1df0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x51a8('0x0')](_0x51a8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x57ca=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x51853a,_0x2dd1eb){var _0x54a035=function(_0x1881f3){while(--_0x1881f3){_0x51853a['push'](_0x51853a['shift']());}};_0x54a035(++_0x2dd1eb);}(_0x57ca,0x108));var _0xa57c=function(_0x56abda,_0x3f0212){_0x56abda=_0x56abda-0x0;var _0x1f8f30=_0x57ca[_0x56abda];return _0x1f8f30;};'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 c6f1b1d..078bdbe 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 _0xd831=['ToId','read','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','count','offset','limit','json','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','ChatInternalMessage','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xd831,0x14c));var _0x1d83=function(_0x50c54d,_0x2c4f68){_0x50c54d=_0x50c54d-0x0;var _0x48c54f=_0xd831[_0x50c54d];return _0x48c54f;};'use strict';var pdf=require(_0x1d83('0x0'));var emlformat=require(_0x1d83('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1d83('0x2'));var jsonpatch=require(_0x1d83('0x3'));var rp=require('request-promise');var moment=require(_0x1d83('0x4'));var BPromise=require(_0x1d83('0x5'));var Mustache=require('mustache');var util=require(_0x1d83('0x6'));var path=require('path');var sox=require(_0x1d83('0x7'));var csv=require(_0x1d83('0x8'));var ejs=require(_0x1d83('0x9'));var fs=require('fs');var _=require(_0x1d83('0xa'));var squel=require(_0x1d83('0xb'));var crypto=require('crypto');var jsforce=require(_0x1d83('0xc'));var deskjs=require(_0x1d83('0xd'));var toCsv=require(_0x1d83('0x8'));var querystring=require(_0x1d83('0xe'));var Papa=require(_0x1d83('0xf'));var Redis=require('ioredis');var authService=require(_0x1d83('0x10'));var qs=require(_0x1d83('0x11'));var as=require(_0x1d83('0x12'));var hardwareService=require(_0x1d83('0x13'));var logger=require(_0x1d83('0x14'))(_0x1d83('0x15'));var utils=require('../../config/utils');var config=require(_0x1d83('0x16'));var db=require(_0x1d83('0x17'))['db'];config[_0x1d83('0x18')]=_[_0x1d83('0x19')](config[_0x1d83('0x18')],{'host':_0x1d83('0x1a'),'port':0x18eb});var socket=require(_0x1d83('0x1b'))(new Redis(config[_0x1d83('0x18')]));require('./chatInternalMessage.socket')[_0x1d83('0x1c')](socket);function respondWithStatusCode(_0x28028f,_0xa0717f){_0xa0717f=_0xa0717f||0xcc;return function(_0x594aac){if(_0x594aac){return _0x28028f[_0x1d83('0x1d')](_0xa0717f);}return _0x28028f['status'](_0xa0717f)[_0x1d83('0x1e')]();};}function respondWithResult(_0x5dda1b,_0x33672e){_0x33672e=_0x33672e||0xc8;return function(_0x135c5a){if(_0x135c5a){return _0x5dda1b[_0x1d83('0x1f')](_0x33672e)['json'](_0x135c5a);}};}function respondWithFilteredResult(_0x2f8493,_0x522239){return function(_0x2625bb){if(_0x2625bb){var _0x39c8ac=_0x2625bb[_0x1d83('0x20')],_0xd84050=_0x522239['offset'],_0x3e9c9f=_0x522239[_0x1d83('0x21')]+_0x522239[_0x1d83('0x22')],_0x1718b7;if(_0x3e9c9f>=_0x39c8ac){_0x3e9c9f=_0x39c8ac;_0x1718b7=0xc8;}else{_0x1718b7=0xce;}_0x2f8493[_0x1d83('0x1f')](_0x1718b7);return _0x2f8493['set']('Content-Range',_0xd84050+'-'+_0x3e9c9f+'/'+_0x39c8ac)[_0x1d83('0x23')](_0x2625bb);}return null;};}function patchUpdates(_0x105bc3){return function(_0x1af150){try{jsonpatch[_0x1d83('0x24')](_0x1af150,_0x105bc3,!![]);}catch(_0x1b6511){return BPromise[_0x1d83('0x25')](_0x1b6511);}return _0x1af150[_0x1d83('0x26')]();};}function saveUpdates(_0x281662,_0x50dd33){return function(_0x3bea4c){if(_0x3bea4c){return _0x3bea4c[_0x1d83('0x27')](_0x281662)[_0x1d83('0x28')](function(_0x5e2970){return _0x5e2970;});}return null;};}function removeEntity(_0x40533b,_0x3bd54c){return function(_0x436946){if(_0x436946){return _0x436946[_0x1d83('0x29')]()[_0x1d83('0x28')](function(){_0x40533b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x209ec5,_0x5ee5c3){return function(_0x369bcd){if(!_0x369bcd){_0x209ec5[_0x1d83('0x1d')](0x194);}return _0x369bcd;};}function handleError(_0x6e92bb,_0x587645){_0x587645=_0x587645||0x1f4;return function(_0x375c95){logger[_0x1d83('0x2a')](_0x375c95['stack']);if(_0x375c95[_0x1d83('0x2b')]){delete _0x375c95['name'];}_0x6e92bb[_0x1d83('0x1f')](_0x587645)[_0x1d83('0x2c')](_0x375c95);};}exports[_0x1d83('0x2d')]=function(_0x2f4ccc,_0x387ece){var _0x2f2db9={},_0x3dbcaa={},_0xc15e74={'count':0x0,'rows':[]};var _0xc02abe=_['map'](db['ChatInternalMessage'][_0x1d83('0x2e')],function(_0x513abc){return{'name':_0x513abc[_0x1d83('0x2f')],'type':_0x513abc[_0x1d83('0x30')]['key']};});_0x3dbcaa[_0x1d83('0x31')]=_[_0x1d83('0x32')](_0xc02abe,'name');_0x3dbcaa['query']=_[_0x1d83('0x33')](_0x2f4ccc[_0x1d83('0x34')]);_0x3dbcaa[_0x1d83('0x35')]=_[_0x1d83('0x36')](_0x3dbcaa[_0x1d83('0x31')],_0x3dbcaa[_0x1d83('0x34')]);_0x2f2db9[_0x1d83('0x37')]=_[_0x1d83('0x36')](_0x3dbcaa[_0x1d83('0x31')],qs[_0x1d83('0x38')](_0x2f4ccc['query'][_0x1d83('0x38')]));_0x2f2db9[_0x1d83('0x37')]=_0x2f2db9[_0x1d83('0x37')]['length']?_0x2f2db9['attributes']:_0x3dbcaa['model'];if(!_0x2f4ccc[_0x1d83('0x34')][_0x1d83('0x39')](_0x1d83('0x3a'))){_0x2f2db9[_0x1d83('0x22')]=qs[_0x1d83('0x22')](_0x2f4ccc['query'][_0x1d83('0x22')]);_0x2f2db9[_0x1d83('0x21')]=qs[_0x1d83('0x21')](_0x2f4ccc[_0x1d83('0x34')]['offset']);}_0x2f2db9['order']=qs[_0x1d83('0x3b')](_0x2f4ccc[_0x1d83('0x34')][_0x1d83('0x3b')]);_0x2f2db9['where']=qs[_0x1d83('0x35')](_['pick'](_0x2f4ccc[_0x1d83('0x34')],_0x3dbcaa[_0x1d83('0x35')]),_0xc02abe);if(_0x2f4ccc[_0x1d83('0x34')][_0x1d83('0x3c')]){_0x2f2db9[_0x1d83('0x3d')]=_[_0x1d83('0x3e')](_0x2f2db9[_0x1d83('0x3d')],{'$or':_[_0x1d83('0x32')](_0xc02abe,function(_0x922f4a){if(_0x922f4a[_0x1d83('0x30')]!==_0x1d83('0x3f')){var _0x271b9a={};_0x271b9a[_0x922f4a['name']]={'$like':'%'+_0x2f4ccc[_0x1d83('0x34')]['filter']+'%'};return _0x271b9a;}})});}_0x2f2db9=_[_0x1d83('0x3e')]({},_0x2f2db9,_0x2f4ccc['options']);var _0x2febd0={'where':_0x2f2db9[_0x1d83('0x3d')]};return db[_0x1d83('0x40')][_0x1d83('0x20')](_0x2febd0)[_0x1d83('0x28')](function(_0x412363){_0xc15e74['count']=_0x412363;if(_0x2f4ccc[_0x1d83('0x34')][_0x1d83('0x41')]){_0x2f2db9[_0x1d83('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1d83('0x43')](_0x2f2db9);})[_0x1d83('0x28')](function(_0x41acfc){_0xc15e74[_0x1d83('0x44')]=_0x41acfc;return _0xc15e74;})['then'](respondWithFilteredResult(_0x387ece,_0x2f2db9))[_0x1d83('0x45')](handleError(_0x387ece,null));};exports['show']=function(_0x26c9f1,_0x2cdcd2){var _0x3c1c10={'raw':!![],'where':{'id':_0x26c9f1['params']['id']}},_0x2ae9e5={};_0x2ae9e5['model']=_[_0x1d83('0x33')](db[_0x1d83('0x40')]['rawAttributes']);_0x2ae9e5[_0x1d83('0x34')]=_[_0x1d83('0x33')](_0x26c9f1[_0x1d83('0x34')]);_0x2ae9e5[_0x1d83('0x35')]=_[_0x1d83('0x36')](_0x2ae9e5[_0x1d83('0x31')],_0x2ae9e5['query']);_0x3c1c10[_0x1d83('0x37')]=_['intersection'](_0x2ae9e5['model'],qs[_0x1d83('0x38')](_0x26c9f1[_0x1d83('0x34')][_0x1d83('0x38')]));_0x3c1c10[_0x1d83('0x37')]=_0x3c1c10[_0x1d83('0x37')][_0x1d83('0x46')]?_0x3c1c10[_0x1d83('0x37')]:_0x2ae9e5[_0x1d83('0x31')];if(_0x26c9f1[_0x1d83('0x34')]['includeAll']){_0x3c1c10[_0x1d83('0x42')]=[{'all':!![]}];}_0x3c1c10=_[_0x1d83('0x3e')]({},_0x3c1c10,_0x26c9f1[_0x1d83('0x47')]);return db['ChatInternalMessage'][_0x1d83('0x48')](_0x3c1c10)['then'](handleEntityNotFound(_0x2cdcd2,null))[_0x1d83('0x28')](respondWithResult(_0x2cdcd2,null))['catch'](handleError(_0x2cdcd2,null));};exports[_0x1d83('0x49')]=function(_0x146d01,_0x19d583){return db['ChatInternalMessage'][_0x1d83('0x49')](_0x146d01['body'],{})[_0x1d83('0x28')](respondWithResult(_0x19d583,0xc9))[_0x1d83('0x45')](handleError(_0x19d583,null));};exports[_0x1d83('0x27')]=function(_0x197899,_0x677d2b){if(_0x197899[_0x1d83('0x4a')]['id']){delete _0x197899[_0x1d83('0x4a')]['id'];}return db[_0x1d83('0x40')]['find']({'where':{'id':_0x197899[_0x1d83('0x4b')]['id']}})[_0x1d83('0x28')](handleEntityNotFound(_0x677d2b,null))[_0x1d83('0x28')](saveUpdates(_0x197899[_0x1d83('0x4a')],null))[_0x1d83('0x28')](respondWithResult(_0x677d2b,null))[_0x1d83('0x45')](handleError(_0x677d2b,null));};exports['destroy']=function(_0x464bd6,_0x2281b5){return db[_0x1d83('0x40')][_0x1d83('0x48')]({'where':{'id':_0x464bd6['params']['id']}})[_0x1d83('0x28')](handleEntityNotFound(_0x2281b5,null))[_0x1d83('0x28')](removeEntity(_0x2281b5,null))[_0x1d83('0x45')](handleError(_0x2281b5,null));};exports[_0x1d83('0x4c')]=function(_0x430c73,_0x4927f5){return db['ChatInternalMessage'][_0x1d83('0x4c')]()[_0x1d83('0x28')](respondWithResult(_0x4927f5,null))[_0x1d83('0x45')](handleError(_0x4927f5,null));};function wrapUser(_0x34a506){return function(_0x34d2be){var _0x302a82=_0x34a506[_0x1d83('0x4d')]({'plain':!![]});_0x302a82[_0x1d83('0x4e')]=[];if(_0x34d2be){_0x302a82[_0x1d83('0x4f')]=_0x34d2be[_0x1d83('0x50')];_0x302a82[_0x1d83('0x51')]=_0x34d2be;}else{_0x302a82[_0x1d83('0x4f')]=moment(0x0)[_0x1d83('0x52')](_0x1d83('0x53'));_0x302a82['lastMessage']={};}return _0x302a82;};}exports['getUsers']=function(_0x458c5a,_0x1eff18,_0x111aa0){var _0x52c2d0=[];return db[_0x1d83('0x54')][_0x1d83('0x43')]({'where':{'role':['agent',_0x1d83('0x55'),'user']},'attributes':['id',_0x1d83('0x56'),_0x1d83('0x2b'),_0x1d83('0x57'),_0x1d83('0x58'),_0x1d83('0x59'),_0x1d83('0x5a'),_0x1d83('0x5b'),_0x1d83('0x5c'),_0x1d83('0x5d')],'order':qs[_0x1d83('0x3b')](_0x1d83('0x5e')),'include':[{'model':db[_0x1d83('0x5f')],'as':_0x1d83('0x60'),'attributes':['id','name',_0x1d83('0x30')],'through':{'attributes':[]}}]})[_0x1d83('0x28')](function(_0x276dbe){if(_0x276dbe){var _0x460221=_0x458c5a[_0x1d83('0x61')]['get']({'plain':!![]});if(!_0x460221)throw new Error(_0x1d83('0x62'));if(_0x460221[_0x1d83('0x57')]==='user'){return db[_0x1d83('0x63')][_0x1d83('0x48')]({'where':{'name':_0x1d83('0x64'),'userProfileId':_0x460221['userProfileId']},'raw':!![]})[_0x1d83('0x28')](function(_0x33c126){if(_0x33c126){if(_0x33c126[_0x1d83('0x65')]===0x0){return db[_0x1d83('0x66')][_0x1d83('0x43')]({'where':{'sectionId':_0x33c126['id']},'raw':!![]})[_0x1d83('0x28')](function(_0x359366){var _0x3d6685=[];if(_[_0x1d83('0x67')](_0x359366)){_0x3d6685=_[_0x1d83('0x3c')](_0x276dbe,function(_0x142273){if(_0x142273[_0x1d83('0x57')]!==_0x1d83('0x68')){return _0x142273;}});return _0x3d6685;}else{for(var _0x2ab5d8=0x0;_0x2ab5d8<_0x276dbe[_0x1d83('0x46')];_0x2ab5d8++){var _0x145109=_0x276dbe[_0x2ab5d8];if(_0x145109[_0x1d83('0x57')]===_0x1d83('0x68')){var _0x94ac3a=_['find'](_0x359366,function(_0x47a939){return _0x47a939[_0x1d83('0x69')]===_0x145109['id'];});if(_0x94ac3a)_0x3d6685['push'](_0x145109);}else{_0x3d6685['push'](_0x145109);}}return _0x3d6685;}});}else{return _0x276dbe;}}else{var _0x1e1a2c=_[_0x1d83('0x3c')](_0x276dbe,function(_0x3afb6f){if(_0x3afb6f[_0x1d83('0x57')]!=='agent'){return _0x3afb6f;}});return _0x1e1a2c;}});}else{return _0x276dbe;}}})['then'](function(_0x3557a3){var _0x171b99=[];if(_0x3557a3){_0x52c2d0=_0x3557a3;for(var _0xa07389=0x0;_0xa07389<_0x3557a3['length'];_0xa07389+=0x1){_0x52c2d0[_0xa07389][_0x1d83('0x4e')]=[];_0x171b99[_0x1d83('0x6a')](db[_0x1d83('0x40')][_0x1d83('0x48')]({'where':{'FromId':[_0x458c5a[_0x1d83('0x61')]['id'],_0x3557a3[_0xa07389]['id']],'ToId':[_0x458c5a[_0x1d83('0x61')]['id'],_0x3557a3[_0xa07389]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1d83('0x6b'),_0x1d83('0x6c'),_0x1d83('0x6d'),'body'],'order':qs[_0x1d83('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1d83('0x28')](wrapUser(_0x3557a3[_0xa07389])));}return BPromise['all'](_0x171b99);}return[];})[_0x1d83('0x28')](function(_0x598a33){return{'rows':_0x598a33,'count':_0x598a33[_0x1d83('0x46')]};})['then'](respondWithResult(_0x1eff18,null))[_0x1d83('0x45')](handleError(_0x1eff18,null));}; \ No newline at end of file +var _0xb3ce=['send','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','messages','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','user','fullname','role','userpic','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','save','destroy','then','name'];(function(_0x411b36,_0x15e8c9){var _0x3702a0=function(_0x1d93d7){while(--_0x1d93d7){_0x411b36['push'](_0x411b36['shift']());}};_0x3702a0(++_0x15e8c9);}(_0xb3ce,0x16e));var _0xeb3c=function(_0x462832,_0x3c5525){_0x462832=_0x462832-0x0;var _0x33f578=_0xb3ce[_0x462832];return _0x33f578;};'use strict';var pdf=require(_0xeb3c('0x0'));var emlformat=require(_0xeb3c('0x1'));var rimraf=require(_0xeb3c('0x2'));var zipdir=require(_0xeb3c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb3c('0x4'));var moment=require('moment');var BPromise=require(_0xeb3c('0x5'));var Mustache=require(_0xeb3c('0x6'));var util=require(_0xeb3c('0x7'));var path=require('path');var sox=require(_0xeb3c('0x8'));var csv=require(_0xeb3c('0x9'));var ejs=require(_0xeb3c('0xa'));var fs=require('fs');var _=require(_0xeb3c('0xb'));var squel=require(_0xeb3c('0xc'));var crypto=require('crypto');var jsforce=require(_0xeb3c('0xd'));var deskjs=require(_0xeb3c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb3c('0xf'));var Redis=require('ioredis');var authService=require(_0xeb3c('0x10'));var qs=require(_0xeb3c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb3c('0x12'))(_0xeb3c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xeb3c('0x14'))['db'];config[_0xeb3c('0x15')]=_[_0xeb3c('0x16')](config[_0xeb3c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb3c('0x17'))(new Redis(config[_0xeb3c('0x15')]));require(_0xeb3c('0x18'))[_0xeb3c('0x19')](socket);function respondWithStatusCode(_0x5ecab9,_0x3a6c28){_0x3a6c28=_0x3a6c28||0xcc;return function(_0x108f81){if(_0x108f81){return _0x5ecab9[_0xeb3c('0x1a')](_0x3a6c28);}return _0x5ecab9[_0xeb3c('0x1b')](_0x3a6c28)[_0xeb3c('0x1c')]();};}function respondWithResult(_0x4c358d,_0x4f9b9f){_0x4f9b9f=_0x4f9b9f||0xc8;return function(_0x22a874){if(_0x22a874){return _0x4c358d[_0xeb3c('0x1b')](_0x4f9b9f)['json'](_0x22a874);}};}function respondWithFilteredResult(_0x2dec39,_0x157fd8){return function(_0x475b3a){if(_0x475b3a){var _0x523e5e=_0x475b3a[_0xeb3c('0x1d')],_0x3d7d60=_0x157fd8[_0xeb3c('0x1e')],_0x41f79f=_0x157fd8[_0xeb3c('0x1e')]+_0x157fd8[_0xeb3c('0x1f')],_0x5da35a;if(_0x41f79f>=_0x523e5e){_0x41f79f=_0x523e5e;_0x5da35a=0xc8;}else{_0x5da35a=0xce;}_0x2dec39['status'](_0x5da35a);return _0x2dec39['set'](_0xeb3c('0x20'),_0x3d7d60+'-'+_0x41f79f+'/'+_0x523e5e)[_0xeb3c('0x21')](_0x475b3a);}return null;};}function patchUpdates(_0xa35c6b){return function(_0x3b54aa){try{jsonpatch['apply'](_0x3b54aa,_0xa35c6b,!![]);}catch(_0x4a0ab4){return BPromise['reject'](_0x4a0ab4);}return _0x3b54aa[_0xeb3c('0x22')]();};}function saveUpdates(_0xd7a5bc,_0x1bd292){return function(_0x1d9494){if(_0x1d9494){return _0x1d9494['update'](_0xd7a5bc)['then'](function(_0x171510){return _0x171510;});}return null;};}function removeEntity(_0x151d15,_0x2f4e78){return function(_0x20449c){if(_0x20449c){return _0x20449c[_0xeb3c('0x23')]()[_0xeb3c('0x24')](function(){_0x151d15[_0xeb3c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4c703,_0x5b15e3){return function(_0x3e2379){if(!_0x3e2379){_0xa4c703[_0xeb3c('0x1a')](0x194);}return _0x3e2379;};}function handleError(_0x31f491,_0x1f61a6){_0x1f61a6=_0x1f61a6||0x1f4;return function(_0x4bf0dd){logger['error'](_0x4bf0dd['stack']);if(_0x4bf0dd[_0xeb3c('0x25')]){delete _0x4bf0dd['name'];}_0x31f491[_0xeb3c('0x1b')](_0x1f61a6)[_0xeb3c('0x26')](_0x4bf0dd);};}exports[_0xeb3c('0x27')]=function(_0x3d7ee0,_0x346270){var _0x1b0e9d={},_0x483047={},_0x3549d7={'count':0x0,'rows':[]};var _0x1bfddd=_[_0xeb3c('0x28')](db[_0xeb3c('0x29')][_0xeb3c('0x2a')],function(_0x3d7878){return{'name':_0x3d7878['fieldName'],'type':_0x3d7878[_0xeb3c('0x2b')][_0xeb3c('0x2c')]};});_0x483047[_0xeb3c('0x2d')]=_[_0xeb3c('0x28')](_0x1bfddd,_0xeb3c('0x25'));_0x483047['query']=_[_0xeb3c('0x2e')](_0x3d7ee0[_0xeb3c('0x2f')]);_0x483047[_0xeb3c('0x30')]=_['intersection'](_0x483047[_0xeb3c('0x2d')],_0x483047[_0xeb3c('0x2f')]);_0x1b0e9d['attributes']=_[_0xeb3c('0x31')](_0x483047[_0xeb3c('0x2d')],qs[_0xeb3c('0x32')](_0x3d7ee0[_0xeb3c('0x2f')]['fields']));_0x1b0e9d[_0xeb3c('0x33')]=_0x1b0e9d[_0xeb3c('0x33')][_0xeb3c('0x34')]?_0x1b0e9d[_0xeb3c('0x33')]:_0x483047['model'];if(!_0x3d7ee0['query'][_0xeb3c('0x35')](_0xeb3c('0x36'))){_0x1b0e9d['limit']=qs['limit'](_0x3d7ee0['query'][_0xeb3c('0x1f')]);_0x1b0e9d[_0xeb3c('0x1e')]=qs[_0xeb3c('0x1e')](_0x3d7ee0[_0xeb3c('0x2f')][_0xeb3c('0x1e')]);}_0x1b0e9d[_0xeb3c('0x37')]=qs['sort'](_0x3d7ee0['query'][_0xeb3c('0x38')]);_0x1b0e9d[_0xeb3c('0x39')]=qs[_0xeb3c('0x30')](_[_0xeb3c('0x3a')](_0x3d7ee0[_0xeb3c('0x2f')],_0x483047[_0xeb3c('0x30')]),_0x1bfddd);if(_0x3d7ee0[_0xeb3c('0x2f')]['filter']){_0x1b0e9d['where']=_[_0xeb3c('0x3b')](_0x1b0e9d[_0xeb3c('0x39')],{'$or':_['map'](_0x1bfddd,function(_0x56b161){if(_0x56b161[_0xeb3c('0x2b')]!==_0xeb3c('0x3c')){var _0x13b2e4={};_0x13b2e4[_0x56b161['name']]={'$like':'%'+_0x3d7ee0[_0xeb3c('0x2f')][_0xeb3c('0x3d')]+'%'};return _0x13b2e4;}})});}_0x1b0e9d=_['merge']({},_0x1b0e9d,_0x3d7ee0[_0xeb3c('0x3e')]);var _0x23bf8e={'where':_0x1b0e9d[_0xeb3c('0x39')]};return db[_0xeb3c('0x29')][_0xeb3c('0x1d')](_0x23bf8e)[_0xeb3c('0x24')](function(_0x37d156){_0x3549d7[_0xeb3c('0x1d')]=_0x37d156;if(_0x3d7ee0[_0xeb3c('0x2f')][_0xeb3c('0x3f')]){_0x1b0e9d[_0xeb3c('0x40')]=[{'all':!![]}];}return db[_0xeb3c('0x29')][_0xeb3c('0x41')](_0x1b0e9d);})[_0xeb3c('0x24')](function(_0x416eb5){_0x3549d7[_0xeb3c('0x42')]=_0x416eb5;return _0x3549d7;})['then'](respondWithFilteredResult(_0x346270,_0x1b0e9d))['catch'](handleError(_0x346270,null));};exports[_0xeb3c('0x43')]=function(_0x42be71,_0x4f05d0){var _0x5d2058={'raw':!![],'where':{'id':_0x42be71[_0xeb3c('0x44')]['id']}},_0x4b1ca0={};_0x4b1ca0[_0xeb3c('0x2d')]=_[_0xeb3c('0x2e')](db['ChatInternalMessage']['rawAttributes']);_0x4b1ca0[_0xeb3c('0x2f')]=_[_0xeb3c('0x2e')](_0x42be71[_0xeb3c('0x2f')]);_0x4b1ca0[_0xeb3c('0x30')]=_[_0xeb3c('0x31')](_0x4b1ca0[_0xeb3c('0x2d')],_0x4b1ca0[_0xeb3c('0x2f')]);_0x5d2058[_0xeb3c('0x33')]=_[_0xeb3c('0x31')](_0x4b1ca0[_0xeb3c('0x2d')],qs[_0xeb3c('0x32')](_0x42be71['query']['fields']));_0x5d2058[_0xeb3c('0x33')]=_0x5d2058['attributes'][_0xeb3c('0x34')]?_0x5d2058[_0xeb3c('0x33')]:_0x4b1ca0[_0xeb3c('0x2d')];if(_0x42be71['query'][_0xeb3c('0x3f')]){_0x5d2058['include']=[{'all':!![]}];}_0x5d2058=_[_0xeb3c('0x3b')]({},_0x5d2058,_0x42be71[_0xeb3c('0x3e')]);return db[_0xeb3c('0x29')]['find'](_0x5d2058)[_0xeb3c('0x24')](handleEntityNotFound(_0x4f05d0,null))[_0xeb3c('0x24')](respondWithResult(_0x4f05d0,null))[_0xeb3c('0x45')](handleError(_0x4f05d0,null));};exports[_0xeb3c('0x46')]=function(_0x3791c2,_0x4d1c82){return db[_0xeb3c('0x29')]['create'](_0x3791c2[_0xeb3c('0x47')],{})[_0xeb3c('0x24')](respondWithResult(_0x4d1c82,0xc9))[_0xeb3c('0x45')](handleError(_0x4d1c82,null));};exports['update']=function(_0x543371,_0x1540cf){if(_0x543371[_0xeb3c('0x47')]['id']){delete _0x543371[_0xeb3c('0x47')]['id'];}return db[_0xeb3c('0x29')]['find']({'where':{'id':_0x543371['params']['id']}})['then'](handleEntityNotFound(_0x1540cf,null))[_0xeb3c('0x24')](saveUpdates(_0x543371[_0xeb3c('0x47')],null))[_0xeb3c('0x24')](respondWithResult(_0x1540cf,null))['catch'](handleError(_0x1540cf,null));};exports[_0xeb3c('0x23')]=function(_0x256c73,_0x2fa683){return db[_0xeb3c('0x29')][_0xeb3c('0x48')]({'where':{'id':_0x256c73[_0xeb3c('0x44')]['id']}})[_0xeb3c('0x24')](handleEntityNotFound(_0x2fa683,null))[_0xeb3c('0x24')](removeEntity(_0x2fa683,null))[_0xeb3c('0x45')](handleError(_0x2fa683,null));};exports['describe']=function(_0x460e9d,_0x32110a){return db[_0xeb3c('0x29')]['describe']()[_0xeb3c('0x24')](respondWithResult(_0x32110a,null))[_0xeb3c('0x45')](handleError(_0x32110a,null));};function wrapUser(_0x4f8043){return function(_0x2e1a1b){var _0x429d58=_0x4f8043['get']({'plain':!![]});_0x429d58[_0xeb3c('0x49')]=[];if(_0x2e1a1b){_0x429d58[_0xeb3c('0x4a')]=_0x2e1a1b['createdAt'];_0x429d58['lastMessage']=_0x2e1a1b;}else{_0x429d58[_0xeb3c('0x4a')]=moment(0x0)['format'](_0xeb3c('0x4b'));_0x429d58[_0xeb3c('0x4c')]={};}return _0x429d58;};}exports[_0xeb3c('0x4d')]=function(_0x4637a2,_0x5856ac,_0xeca05e){var _0x32327b=[];return db['User'][_0xeb3c('0x41')]({'where':{'role':[_0xeb3c('0x4e'),'admin',_0xeb3c('0x4f')]},'attributes':['id',_0xeb3c('0x50'),_0xeb3c('0x25'),_0xeb3c('0x51'),_0xeb3c('0x52'),'internal',_0xeb3c('0x53'),_0xeb3c('0x54'),'allowmessenger','showWebBar'],'order':qs[_0xeb3c('0x38')](_0xeb3c('0x55')),'include':[{'model':db[_0xeb3c('0x56')],'as':_0xeb3c('0x57'),'attributes':['id',_0xeb3c('0x25'),_0xeb3c('0x2b')],'through':{'attributes':[]}}]})[_0xeb3c('0x24')](function(_0x2b6f33){if(_0x2b6f33){var _0x39eb86=_0x4637a2[_0xeb3c('0x4f')]['get']({'plain':!![]});if(!_0x39eb86)throw new Error(_0xeb3c('0x58'));if(_0x39eb86['role']===_0xeb3c('0x4f')){return db[_0xeb3c('0x59')][_0xeb3c('0x48')]({'where':{'name':_0xeb3c('0x5a'),'userProfileId':_0x39eb86['userProfileId']},'raw':!![]})[_0xeb3c('0x24')](function(_0x1a2702){if(_0x1a2702){if(_0x1a2702[_0xeb3c('0x5b')]===0x0){return db[_0xeb3c('0x5c')][_0xeb3c('0x41')]({'where':{'sectionId':_0x1a2702['id']},'raw':!![]})[_0xeb3c('0x24')](function(_0x57de3c){var _0x4d2710=[];if(_[_0xeb3c('0x5d')](_0x57de3c)){_0x4d2710=_[_0xeb3c('0x3d')](_0x2b6f33,function(_0x3ddaec){if(_0x3ddaec[_0xeb3c('0x51')]!==_0xeb3c('0x4e')){return _0x3ddaec;}});return _0x4d2710;}else{for(var _0x12a7cf=0x0;_0x12a7cf<_0x2b6f33['length'];_0x12a7cf++){var _0x1c17fd=_0x2b6f33[_0x12a7cf];if(_0x1c17fd[_0xeb3c('0x51')]===_0xeb3c('0x4e')){var _0x5d239f=_[_0xeb3c('0x48')](_0x57de3c,function(_0x229779){return _0x229779[_0xeb3c('0x5e')]===_0x1c17fd['id'];});if(_0x5d239f)_0x4d2710['push'](_0x1c17fd);}else{_0x4d2710[_0xeb3c('0x5f')](_0x1c17fd);}}return _0x4d2710;}});}else{return _0x2b6f33;}}else{var _0x1b420b=_[_0xeb3c('0x3d')](_0x2b6f33,function(_0x135203){if(_0x135203[_0xeb3c('0x51')]!==_0xeb3c('0x4e')){return _0x135203;}});return _0x1b420b;}});}else{return _0x2b6f33;}}})[_0xeb3c('0x24')](function(_0x151db3){var _0x2a6915=[];if(_0x151db3){_0x32327b=_0x151db3;for(var _0x549139=0x0;_0x549139<_0x151db3[_0xeb3c('0x34')];_0x549139+=0x1){_0x32327b[_0x549139][_0xeb3c('0x49')]=[];_0x2a6915[_0xeb3c('0x5f')](db[_0xeb3c('0x29')][_0xeb3c('0x48')]({'where':{'FromId':[_0x4637a2[_0xeb3c('0x4f')]['id'],_0x151db3[_0x549139]['id']],'ToId':[_0x4637a2['user']['id'],_0x151db3[_0x549139]['id']],'ChatGroupId':null},'attributes':['id',_0xeb3c('0x60'),_0xeb3c('0x61'),_0xeb3c('0x62'),_0xeb3c('0x63'),_0xeb3c('0x47')],'order':qs[_0xeb3c('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xeb3c('0x24')](wrapUser(_0x151db3[_0x549139])));}return BPromise[_0xeb3c('0x64')](_0x2a6915);}return[];})[_0xeb3c('0x24')](function(_0xca7032){return{'rows':_0xca7032,'count':_0xca7032['length']};})[_0xeb3c('0x24')](respondWithResult(_0x5856ac,null))[_0xeb3c('0x45')](handleError(_0x5856ac,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b885b82..a83f873 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 _0x142c=['setMaxListeners','save','remove','emit','hook','exports','events','ChatInternalMessage'];(function(_0xed9fea,_0x5ed774){var _0x198f12=function(_0xfb85f6){while(--_0xfb85f6){_0xed9fea['push'](_0xed9fea['shift']());}};_0x198f12(++_0x5ed774);}(_0x142c,0x86));var _0xc142=function(_0x184939,_0x274a91){_0x184939=_0x184939-0x0;var _0x4901b8=_0x142c[_0x184939];return _0x4901b8;};'use strict';var EventEmitter=require(_0xc142('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xc142('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc142('0x2')](0x0);var events={'afterCreate':_0xc142('0x3'),'afterUpdate':'update','afterDestroy':_0xc142('0x4')};function emitEvent(_0x3d66ef){return function(_0x4fa56e,_0x47e43a,_0x110b14){ChatInternalMessageEvents['emit'](_0x3d66ef+':'+_0x4fa56e['id'],_0x4fa56e);ChatInternalMessageEvents[_0xc142('0x5')](_0x3d66ef,_0x4fa56e);_0x110b14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc142('0x6')](e,emitEvent(event));}}module[_0xc142('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xee5c=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x346111,_0x47e5fb){var _0x2229b3=function(_0x31d248){while(--_0x31d248){_0x346111['push'](_0x346111['shift']());}};_0x2229b3(++_0x47e5fb);}(_0xee5c,0xcd));var _0xcee5=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xee5c[_0x2e4cbf];return _0x52840f;};'use strict';var EventEmitter=require(_0xcee5('0x0'));var ChatInternalMessage=require(_0xcee5('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcee5('0x2')](0x0);var events={'afterCreate':_0xcee5('0x3'),'afterUpdate':'update','afterDestroy':_0xcee5('0x4')};function emitEvent(_0x2535a8){return function(_0x25a4a8,_0x214d8e,_0x14d6aa){ChatInternalMessageEvents[_0xcee5('0x5')](_0x2535a8+':'+_0x25a4a8['id'],_0x25a4a8);ChatInternalMessageEvents[_0xcee5('0x5')](_0x2535a8,_0x25a4a8);_0x14d6aa(null);};}for(var e in events){if(events[_0xcee5('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xcee5('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 469cbf5..c93cf9e 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(_0x3893ea,_0x2e49ff){var _0x403f34=function(_0x4be820){while(--_0x4be820){_0x3893ea['push'](_0x3893ea['shift']());}};_0x403f34(++_0x2e49ff);}(_0x4fc2,0x111));var _0x24fc=function(_0x496af1,_0x2d5f59){_0x496af1=_0x496af1-0x0;var _0x5700b3=_0x4fc2[_0x496af1];return _0x5700b3;};'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 _0xbdb7=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xbdb7[_0xa60623];return _0x4a6487;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bdb('0xb'),'collate':_0x7bdb('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 96b9954..6bd9a67 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 _0x7819=['socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x7819,0x1db));var _0x9781=function(_0x560ce5,_0x2768fc){_0x560ce5=_0x560ce5-0x0;var _0xd3c885=_0x7819[_0x560ce5];return _0xd3c885;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9781('0x0'));var BPromise=require('bluebird');var rs=require(_0x9781('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9781('0x2'))['db'];var utils=require(_0x9781('0x3'));var logger=require('../../config/logger')(_0x9781('0x4'));var config=require('../../config/environment');var jayson=require(_0x9781('0x5'));var client=jayson[_0x9781('0x6')][_0x9781('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9781('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x9781('0x9'))(new Redis(config[_0x9781('0x8')]));require(_0x9781('0xa'))[_0x9781('0xb')](socket);function respondWithRpcPromise(_0x2ebea3,_0xe8927a,_0x23908c){return new BPromise(function(_0x2bd1d3,_0x2d8386){return client['request'](_0x2ebea3,_0x23908c)[_0x9781('0xc')](function(_0x1fc5c9){logger[_0x9781('0xd')](_0x9781('0xe'),_0xe8927a,'request\x20sent');logger[_0x9781('0xf')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xe8927a,_0x9781('0x10'),JSON[_0x9781('0x11')](_0x1fc5c9));if(_0x1fc5c9[_0x9781('0x12')]){if(_0x1fc5c9[_0x9781('0x12')][_0x9781('0x13')]===0x1f4){logger[_0x9781('0x12')](_0x9781('0xe'),_0xe8927a,_0x1fc5c9[_0x9781('0x12')][_0x9781('0x14')]);return _0x2d8386(_0x1fc5c9['error'][_0x9781('0x14')]);}logger[_0x9781('0x12')](_0x9781('0xe'),_0xe8927a,_0x1fc5c9['error']['message']);return _0x2bd1d3(_0x1fc5c9[_0x9781('0x12')]['message']);}else{logger[_0x9781('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0xe8927a,_0x9781('0x10'));_0x2bd1d3(_0x1fc5c9[_0x9781('0x15')]['message']);}})['catch'](function(_0x3863b0){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xe8927a,_0x3863b0);_0x2d8386(_0x3863b0);});});} \ No newline at end of file +var _0xd13e=['../../config/logger','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd13e,0x1c2));var _0xed13=function(_0x4ba5c6,_0x41e42b){_0x4ba5c6=_0x4ba5c6-0x0;var _0x5a2863=_0xd13e[_0x4ba5c6];return _0x5a2863;};'use strict';var _=require('lodash');var util=require(_0xed13('0x0'));var moment=require(_0xed13('0x1'));var BPromise=require(_0xed13('0x2'));var rs=require(_0xed13('0x3'));var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require(_0xed13('0x6'))('rpc');var config=require(_0xed13('0x7'));var jayson=require(_0xed13('0x8'));var client=jayson['client'][_0xed13('0x9')]({'port':0x232a});config[_0xed13('0xa')]=_['defaults'](config[_0xed13('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xed13('0xb'))(new Redis(config['redis']));require(_0xed13('0xc'))['register'](socket);function respondWithRpcPromise(_0x3da3eb,_0x12e4f9,_0x6c0bd8){return new BPromise(function(_0x469dd9,_0x463c34){return client['request'](_0x3da3eb,_0x6c0bd8)[_0xed13('0xd')](function(_0x24874e){logger[_0xed13('0xe')](_0xed13('0xf'),_0x12e4f9,_0xed13('0x10'));logger[_0xed13('0x11')](_0xed13('0x12'),_0x12e4f9,_0xed13('0x10'),JSON[_0xed13('0x13')](_0x24874e));if(_0x24874e[_0xed13('0x14')]){if(_0x24874e[_0xed13('0x14')][_0xed13('0x15')]===0x1f4){logger[_0xed13('0x14')](_0xed13('0xf'),_0x12e4f9,_0x24874e['error']['message']);return _0x463c34(_0x24874e[_0xed13('0x14')][_0xed13('0x16')]);}logger[_0xed13('0x14')](_0xed13('0xf'),_0x12e4f9,_0x24874e[_0xed13('0x14')][_0xed13('0x16')]);return _0x469dd9(_0x24874e['error'][_0xed13('0x16')]);}else{logger[_0xed13('0xe')](_0xed13('0xf'),_0x12e4f9,_0xed13('0x10'));_0x469dd9(_0x24874e[_0xed13('0x17')][_0xed13('0x16')]);}})['catch'](function(_0x35034f){logger[_0xed13('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x12e4f9,_0x35034f);_0x463c34(_0x35034f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5f516bc..c4dcec2 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 _0xf53f=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x48232d,_0x7c3808){var _0x32583c=function(_0x3e21a7){while(--_0x3e21a7){_0x48232d['push'](_0x48232d['shift']());}};_0x32583c(++_0x7c3808);}(_0xf53f,0x8d));var _0xff53=function(_0x8c71ee,_0x555cbd){_0x8c71ee=_0x8c71ee-0x0;var _0x53150f=_0xf53f[_0x8c71ee];return _0x53150f;};'use strict';var ChatInternalMessageEvents=require(_0xff53('0x0'));var events=[_0xff53('0x1'),_0xff53('0x2'),_0xff53('0x3')];function createListener(_0x3b48fc,_0x4afcd){return function(_0x492e12){_0x4afcd[_0xff53('0x4')](_0x3b48fc,_0x492e12);};}function removeListener(_0x18b504,_0x2077b9){return function(){ChatInternalMessageEvents[_0xff53('0x5')](_0x18b504,_0x2077b9);};}exports[_0xff53('0x6')]=function(_0x54d39c){for(var _0x54e637=0x0,_0x27b397=events['length'];_0x54e637<_0x27b397;_0x54e637++){var _0x1c27bb=events[_0x54e637];var _0x122746=createListener(_0xff53('0x7')+_0x1c27bb,_0x54d39c);ChatInternalMessageEvents['on'](_0x1c27bb,_0x122746);}}; \ No newline at end of file +var _0x593e=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x513b32,_0x1e0cde){var _0x415451=function(_0x51ab8e){while(--_0x51ab8e){_0x513b32['push'](_0x513b32['shift']());}};_0x415451(++_0x1e0cde);}(_0x593e,0xcb));var _0xe593=function(_0x416429,_0xaaf0cb){_0x416429=_0x416429-0x0;var _0x48e26e=_0x593e[_0x416429];return _0x48e26e;};'use strict';var ChatInternalMessageEvents=require(_0xe593('0x0'));var events=[_0xe593('0x1'),_0xe593('0x2'),_0xe593('0x3')];function createListener(_0x43dabb,_0x184a6b){return function(_0x2c7c48){_0x184a6b[_0xe593('0x4')](_0x43dabb,_0x2c7c48);};}function removeListener(_0x550574,_0x8a87e8){return function(){ChatInternalMessageEvents[_0xe593('0x5')](_0x550574,_0x8a87e8);};}exports[_0xe593('0x6')]=function(_0x1e50d3){for(var _0x3b7082=0x0,_0x14cff3=events[_0xe593('0x7')];_0x3b7082<_0x14cff3;_0x3b7082++){var _0x307dad=events[_0x3b7082];var _0x169c08=createListener(_0xe593('0x8')+_0x307dad,_0x1e50d3);ChatInternalMessageEvents['on'](_0x307dad,_0x169c08);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c53d541..27a109f 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 _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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('./chatInternalMessage.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('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',controller['update']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router; \ No newline at end of file +var _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.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('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',controller['update']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 1c8d0a2..366de7a 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 _0x5e0a=['DATE','exports','medium','BOOLEAN','ENUM','out'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x5e0a,0x175));var _0xa5e0=function(_0x442984,_0x2937d1){_0x442984=_0x442984-0x0;var _0x420b17=_0x5e0a[_0x442984];return _0x420b17;};'use strict';var Sequelize=require('sequelize');module[_0xa5e0('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa5e0('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa5e0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa5e0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa5e0('0x3')]('in','out'),'defaultValue':_0xa5e0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa5e0('0x5')]}}; \ No newline at end of file +var _0xadbb=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xadbb,0x170));var _0xbadb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xadbb[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xbadb('0x0'));module[_0xbadb('0x1')]={'body':{'type':Sequelize[_0xbadb('0x2')](_0xbadb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbadb('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbadb('0x5')]('in',_0xbadb('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xbadb('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0597eb0..3751d49 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 _0xdb3e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','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','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','UserId','user','CmContact','Contact','ChatInteraction','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','parse','formData','../../config/logger','reject','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x11ebac,_0x476a52){var _0x29ae69=function(_0x604176){while(--_0x604176){_0x11ebac['push'](_0x11ebac['shift']());}};_0x29ae69(++_0x476a52);}(_0xdb3e,0xef));var _0xedb3=function(_0x3ebac6,_0x2b849f){_0x3ebac6=_0x3ebac6-0x0;var _0xf36c9f=_0xdb3e[_0x3ebac6];return _0xf36c9f;};'use strict';var pdf=require(_0xedb3('0x0'));var emlformat=require(_0xedb3('0x1'));var rimraf=require(_0xedb3('0x2'));var zipdir=require(_0xedb3('0x3'));var jsonpatch=require(_0xedb3('0x4'));var rp=require(_0xedb3('0x5'));var moment=require(_0xedb3('0x6'));var BPromise=require(_0xedb3('0x7'));var Mustache=require(_0xedb3('0x8'));var util=require(_0xedb3('0x9'));var path=require(_0xedb3('0xa'));var sox=require('sox');var csv=require(_0xedb3('0xb'));var ejs=require(_0xedb3('0xc'));var fs=require('fs');var _=require(_0xedb3('0xd'));var squel=require(_0xedb3('0xe'));var crypto=require('crypto');var jsforce=require(_0xedb3('0xf'));var deskjs=require(_0xedb3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xedb3('0x11'));var Papa=require('papaparse');var Redis=require(_0xedb3('0x12'));var authService=require(_0xedb3('0x13'));var qs=require(_0xedb3('0x14'));var as=require(_0xedb3('0x15'));var hardwareService=require(_0xedb3('0x16'));var logger=require('../../config/logger')(_0xedb3('0x17'));var utils=require(_0xedb3('0x18'));var config=require(_0xedb3('0x19'));var db=require(_0xedb3('0x1a'))['db'];config[_0xedb3('0x1b')]=_[_0xedb3('0x1c')](config[_0xedb3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xedb3('0x1d'))(new Redis(config[_0xedb3('0x1b')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xedb3('0x1e'));var client=jayson[_0xedb3('0x1f')][_0xedb3('0x20')]({'port':0x232c});var client9002=jayson[_0xedb3('0x1f')][_0xedb3('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1edad4,_0x54500f,_0x479903){if(_0x479903){var _0x91e294=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x91e294[_0xedb3('0x21')](_0x54500f)){return _0x1edad4;}else{throw new db[(_0xedb3('0x22'))]['ValidationError'](_0xedb3('0x23'));}}else{return _0x1edad4;}}function respondWithRpcPromise(_0xe99431,_0xfb6039,_0x35a0f9,_0x51e8ae){return new BPromise(function(_0x449df9,_0x392d37){var _0x139a23=_0x51e8ae||client;return _0x139a23[_0xedb3('0x24')](_0xe99431,_0x35a0f9)[_0xedb3('0x25')](function(_0x27c3b4){logger['info']('ChatMessage,\x20%s,\x20%s',_0xfb6039,'request\x20sent');logger[_0xedb3('0x26')](_0xedb3('0x27'),_0xfb6039,_0xedb3('0x28'),JSON[_0xedb3('0x29')](_0x27c3b4));if(_0x27c3b4[_0xedb3('0x2a')]){if(_0x27c3b4['error']['code']===0x1f4){logger['error'](_0xedb3('0x2b'),_0xfb6039,_0x27c3b4[_0xedb3('0x2a')][_0xedb3('0x2c')]);return _0x392d37(_0x27c3b4[_0xedb3('0x2a')][_0xedb3('0x2c')]);}logger[_0xedb3('0x2a')](_0xedb3('0x2b'),_0xfb6039,_0x27c3b4[_0xedb3('0x2a')][_0xedb3('0x2c')]);return _0x449df9(_0x27c3b4[_0xedb3('0x2a')][_0xedb3('0x2c')]);}else{logger[_0xedb3('0x2d')](_0xedb3('0x2b'),_0xfb6039,_0xedb3('0x28'));_0x449df9(_0x27c3b4['result']['message']);}})['catch'](function(_0xe991a2){logger[_0xedb3('0x2a')](_0xedb3('0x2b'),_0xfb6039,_0xe991a2);_0x392d37(_0xe991a2);});});}function respondWithStatusCode(_0x4b27f3,_0x3f1e59){_0x3f1e59=_0x3f1e59||0xcc;return function(_0x33999b){if(_0x33999b){return _0x4b27f3[_0xedb3('0x2e')](_0x3f1e59);}return _0x4b27f3['status'](_0x3f1e59)[_0xedb3('0x2f')]();};}function respondWithResult(_0x376dbb,_0x2d3a3f){_0x2d3a3f=_0x2d3a3f||0xc8;return function(_0x55d259){if(_0x55d259){return _0x376dbb[_0xedb3('0x30')](_0x2d3a3f)[_0xedb3('0x31')](_0x55d259);}};}function respondWithFilteredResult(_0x4e6f2e,_0x1764ea){return function(_0x4ab026){if(_0x4ab026){var _0x188a0d=_0x4ab026[_0xedb3('0x32')],_0x5eccd2=_0x1764ea[_0xedb3('0x33')],_0x438988=_0x1764ea[_0xedb3('0x33')]+_0x1764ea[_0xedb3('0x34')],_0x40f3d2;if(_0x438988>=_0x188a0d){_0x438988=_0x188a0d;_0x40f3d2=0xc8;}else{_0x40f3d2=0xce;}_0x4e6f2e[_0xedb3('0x30')](_0x40f3d2);return _0x4e6f2e[_0xedb3('0x35')](_0xedb3('0x36'),_0x5eccd2+'-'+_0x438988+'/'+_0x188a0d)[_0xedb3('0x31')](_0x4ab026);}return null;};}function patchUpdates(_0x157115){return function(_0x12b503){try{jsonpatch[_0xedb3('0x37')](_0x12b503,_0x157115,!![]);}catch(_0x3debf5){return BPromise['reject'](_0x3debf5);}return _0x12b503[_0xedb3('0x38')]();};}function saveUpdates(_0x587195,_0x50a171){return function(_0x2545c6){if(_0x2545c6){return _0x2545c6['update'](_0x587195)['then'](function(_0x4988a7){return _0x4988a7;});}return null;};}function removeEntity(_0x5e4227,_0x14ac01){return function(_0x6d7e1e){if(_0x6d7e1e){return _0x6d7e1e[_0xedb3('0x39')]()[_0xedb3('0x25')](function(){_0x5e4227[_0xedb3('0x30')](0xcc)[_0xedb3('0x2f')]();});}};}function handleEntityNotFound(_0x48be24,_0x5a0676){return function(_0x5aac82){if(!_0x5aac82){_0x48be24[_0xedb3('0x2e')](0x194);}return _0x5aac82;};}function handleError(_0x2b7d66,_0x2e24de){_0x2e24de=_0x2e24de||0x1f4;return function(_0x54054b){logger[_0xedb3('0x2a')](_0x54054b[_0xedb3('0x3a')]);if(_0x54054b['name']){delete _0x54054b[_0xedb3('0x3b')];}_0x2b7d66['status'](_0x2e24de)[_0xedb3('0x3c')](_0x54054b);};}exports[_0xedb3('0x3d')]=function(_0x36ccb3,_0x1585dc){var _0x2d598f={},_0x322d47={},_0x1aded5={'count':0x0,'rows':[]};var _0x1197cf=_[_0xedb3('0x3e')](db[_0xedb3('0x3f')][_0xedb3('0x40')],function(_0x5b86db){return{'name':_0x5b86db['fieldName'],'type':_0x5b86db[_0xedb3('0x41')][_0xedb3('0x42')]};});_0x322d47['model']=_[_0xedb3('0x3e')](_0x1197cf,'name');_0x322d47[_0xedb3('0x43')]=_[_0xedb3('0x44')](_0x36ccb3[_0xedb3('0x43')]);_0x322d47[_0xedb3('0x45')]=_['intersection'](_0x322d47[_0xedb3('0x46')],_0x322d47[_0xedb3('0x43')]);_0x2d598f[_0xedb3('0x47')]=_[_0xedb3('0x48')](_0x322d47[_0xedb3('0x46')],qs[_0xedb3('0x49')](_0x36ccb3['query']['fields']));_0x2d598f[_0xedb3('0x47')]=_0x2d598f[_0xedb3('0x47')][_0xedb3('0x4a')]?_0x2d598f[_0xedb3('0x47')]:_0x322d47[_0xedb3('0x46')];if(!_0x36ccb3[_0xedb3('0x43')][_0xedb3('0x4b')]('nolimit')){_0x2d598f['limit']=qs[_0xedb3('0x34')](_0x36ccb3[_0xedb3('0x43')]['limit']);_0x2d598f[_0xedb3('0x33')]=qs[_0xedb3('0x33')](_0x36ccb3[_0xedb3('0x43')][_0xedb3('0x33')]);}_0x2d598f['order']=qs[_0xedb3('0x4c')](_0x36ccb3[_0xedb3('0x43')]['sort']);_0x2d598f[_0xedb3('0x4d')]=qs['filters'](_[_0xedb3('0x4e')](_0x36ccb3[_0xedb3('0x43')],_0x322d47[_0xedb3('0x45')]),_0x1197cf);if(_0x36ccb3[_0xedb3('0x43')][_0xedb3('0x4f')]){_0x2d598f['where']=_[_0xedb3('0x50')](_0x2d598f[_0xedb3('0x4d')],{'$or':_[_0xedb3('0x3e')](_0x1197cf,function(_0x4a05bb){if(_0x4a05bb[_0xedb3('0x41')]!=='VIRTUAL'){var _0x289f44={};_0x289f44[_0x4a05bb[_0xedb3('0x3b')]]={'$like':'%'+_0x36ccb3[_0xedb3('0x43')][_0xedb3('0x4f')]+'%'};return _0x289f44;}})});}_0x2d598f=_['merge']({},_0x2d598f,_0x36ccb3['options']);var _0x28f31c={'where':_0x2d598f[_0xedb3('0x4d')]};return db[_0xedb3('0x3f')][_0xedb3('0x32')](_0x28f31c)[_0xedb3('0x25')](function(_0x26e821){_0x1aded5['count']=_0x26e821;if(_0x36ccb3[_0xedb3('0x43')][_0xedb3('0x51')]){_0x2d598f[_0xedb3('0x52')]=[{'all':!![]}];}return db[_0xedb3('0x3f')]['findAll'](_0x2d598f);})[_0xedb3('0x25')](function(_0x43093e){_0x1aded5[_0xedb3('0x53')]=_0x43093e;return _0x1aded5;})['then'](respondWithFilteredResult(_0x1585dc,_0x2d598f))[_0xedb3('0x54')](handleError(_0x1585dc,null));};exports[_0xedb3('0x55')]=function(_0xcd4d55,_0x6b7fc3){var _0x5f36ef={'raw':!![],'where':{'id':_0xcd4d55[_0xedb3('0x56')]['id']}},_0x18613c={};_0x18613c[_0xedb3('0x46')]=_[_0xedb3('0x44')](db[_0xedb3('0x3f')][_0xedb3('0x40')]);_0x18613c['query']=_['keys'](_0xcd4d55[_0xedb3('0x43')]);_0x18613c[_0xedb3('0x45')]=_[_0xedb3('0x48')](_0x18613c[_0xedb3('0x46')],_0x18613c[_0xedb3('0x43')]);_0x5f36ef[_0xedb3('0x47')]=_[_0xedb3('0x48')](_0x18613c[_0xedb3('0x46')],qs[_0xedb3('0x49')](_0xcd4d55[_0xedb3('0x43')][_0xedb3('0x49')]));_0x5f36ef[_0xedb3('0x47')]=_0x5f36ef[_0xedb3('0x47')][_0xedb3('0x4a')]?_0x5f36ef[_0xedb3('0x47')]:_0x18613c[_0xedb3('0x46')];if(_0xcd4d55[_0xedb3('0x43')][_0xedb3('0x51')]){_0x5f36ef[_0xedb3('0x52')]=[{'all':!![]}];}_0x5f36ef=_[_0xedb3('0x50')]({},_0x5f36ef,_0xcd4d55[_0xedb3('0x57')]);return db[_0xedb3('0x3f')][_0xedb3('0x58')](_0x5f36ef)[_0xedb3('0x25')](handleEntityNotFound(_0x6b7fc3,null))['then'](respondWithResult(_0x6b7fc3,null))[_0xedb3('0x54')](handleError(_0x6b7fc3,null));};exports[_0xedb3('0x59')]=function(_0x1891a7,_0x279052){return db[_0xedb3('0x3f')][_0xedb3('0x59')](_0x1891a7[_0xedb3('0x5a')],{})[_0xedb3('0x25')](respondWithResult(_0x279052,0xc9))[_0xedb3('0x54')](handleError(_0x279052,null));};exports[_0xedb3('0x5b')]=function(_0x2637d6,_0x318be4){if(_0x2637d6[_0xedb3('0x5a')]['id']){delete _0x2637d6[_0xedb3('0x5a')]['id'];}return db['ChatMessage'][_0xedb3('0x58')]({'where':{'id':_0x2637d6[_0xedb3('0x56')]['id']}})[_0xedb3('0x25')](handleEntityNotFound(_0x318be4,null))[_0xedb3('0x25')](saveUpdates(_0x2637d6['body'],null))[_0xedb3('0x25')](respondWithResult(_0x318be4,null))['catch'](handleError(_0x318be4,null));};exports[_0xedb3('0x39')]=function(_0x272d67,_0x2a368f){return db[_0xedb3('0x3f')][_0xedb3('0x58')]({'where':{'id':_0x272d67[_0xedb3('0x56')]['id']}})[_0xedb3('0x25')](handleEntityNotFound(_0x2a368f,null))[_0xedb3('0x25')](removeEntity(_0x2a368f,null))['catch'](handleError(_0x2a368f,null));};exports[_0xedb3('0x5c')]=function(_0x11064e,_0xfeb8df){return db[_0xedb3('0x3f')]['describe']()['then'](respondWithResult(_0xfeb8df,null))[_0xedb3('0x54')](handleError(_0xfeb8df,null));};var interaction_log=require('../../config/logger')(_0xedb3('0x5d'));exports[_0xedb3('0x5e')]=function(_0x23c9ad,_0x258d43,_0x2d61ac){var _0x102e3f={'channel':_0xedb3('0x5f')};if(_0x23c9ad[_0xedb3('0x5a')]['id']){delete _0x23c9ad['body']['id'];}_0x23c9ad['body'][_0xedb3('0x60')]=!![];_0x23c9ad[_0xedb3('0x5a')][_0xedb3('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x23c9ad['body'][_0xedb3('0x62')]=_0x23c9ad['body'][_0xedb3('0x62')]||_0x23c9ad[_0xedb3('0x63')]['id'];return db[_0xedb3('0x3f')]['find']({'where':{'id':_0x23c9ad[_0xedb3('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xedb3('0x64')],'as':_0xedb3('0x65')}]})['then'](handleEntityNotFound(_0x258d43,null))['then'](saveUpdates(_0x23c9ad['body'],null))[_0xedb3('0x25')](function(_0x5073fd){if(_0x5073fd){_0x102e3f[_0xedb3('0x2c')]=_0x5073fd['get']({'plain':!![]});return db[_0xedb3('0x66')][_0xedb3('0x58')]({'where':{'id':_0x5073fd['ChatInteractionId']}});}return null;})[_0xedb3('0x25')](handleEntityNotFound(_0x258d43,null))[_0xedb3('0x25')](function(_0x4d0426){if(_0x4d0426){return _0x4d0426[_0xedb3('0x5b')]({'UserId':_0x23c9ad['body'][_0xedb3('0x62')],'read1stAt':_[_0xedb3('0x67')](_0x4d0426[_0xedb3('0x68')])?moment()[_0xedb3('0x69')](_0xedb3('0x6a')):undefined});}return null;})[_0xedb3('0x25')](function(_0x49a32f){if(_0x49a32f){_0x102e3f[_0xedb3('0x6b')]=_0x49a32f[_0xedb3('0x6c')]({'plain':!![]});interaction_log[_0xedb3('0x2d')](_0xedb3('0x6d'),_0x23c9ad[_0xedb3('0x63')]['id'],_0x23c9ad['user'][_0xedb3('0x3b')],_0x23c9ad['user'][_0xedb3('0x6e')],_0x102e3f[_0xedb3('0x6b')]['id'],_0x23c9ad[_0xedb3('0x5a')]?JSON[_0xedb3('0x29')](_0x23c9ad[_0xedb3('0x5a')]):_0xedb3('0x6f'));return respondWithRpcPromise(_0xedb3('0x70'),_0xedb3('0x71'),_0x102e3f);}return null;})['then'](function(_0x24b815){if(_0x24b815){if(_0x23c9ad[_0xedb3('0x5a')][_0xedb3('0x72')]){_0x102e3f['message']['interface']=util[_0xedb3('0x69')](_0xedb3('0x73'),_0x23c9ad[_0xedb3('0x63')][_0xedb3('0x3b')]);_0x102e3f[_0xedb3('0x2c')]['channel']=_0x102e3f[_0xedb3('0x74')];_0x102e3f['message'][_0xedb3('0x75')]=_0xedb3('0x5e');return respondWithRpcPromise(_0xedb3('0x76'),_0xedb3('0x76'),{'event':'acceptmessage','message':_[_0xedb3('0x50')](_0x102e3f[_0xedb3('0x2c')],JSON[_0xedb3('0x77')](_0x102e3f[_0xedb3('0x6b')][_0xedb3('0x78')]))},client9002)[_0xedb3('0x25')](function(){return _0x102e3f;});}return _0x102e3f;}return null;})['then'](respondWithResult(_0x258d43,null))[_0xedb3('0x54')](handleError(_0x258d43,null));};var interaction_log=require(_0xedb3('0x79'))(_0xedb3('0x5d'));exports[_0xedb3('0x7a')]=function(_0x5afcdf,_0x1df5cf,_0x69536e){var _0xd4be04={'agent':{},'channel':_0xedb3('0x5f')};if(_0x5afcdf[_0xedb3('0x5a')]['id']){delete _0x5afcdf[_0xedb3('0x5a')]['id'];}_0x5afcdf['body']['UserId']=_0x5afcdf[_0xedb3('0x5a')][_0xedb3('0x62')]||_0x5afcdf[_0xedb3('0x63')]['id'];_0xd4be04[_0xedb3('0x7b')]['id']=_0x5afcdf['body']['UserId'];return db[_0xedb3('0x3f')][_0xedb3('0x58')]({'where':{'id':_0x5afcdf[_0xedb3('0x56')]['id'],'UserId':null}})[_0xedb3('0x25')](handleEntityNotFound(_0x1df5cf,null))[_0xedb3('0x25')](function(_0x4f21e6){if(_0x4f21e6){_0xd4be04[_0xedb3('0x2c')]=_0x4f21e6[_0xedb3('0x6c')]({'plain':!![]});return db['ChatInteraction'][_0xedb3('0x58')]({'where':{'id':_0x4f21e6[_0xedb3('0x7c')]}});}return null;})[_0xedb3('0x25')](handleEntityNotFound(_0x1df5cf,null))[_0xedb3('0x25')](function(_0xaf16c6){if(_0xaf16c6){_0xd4be04['interaction']=_0xaf16c6[_0xedb3('0x6c')]({'plain':!![]});interaction_log['info'](_0xedb3('0x7d'),_0x5afcdf['user']['id'],_0x5afcdf[_0xedb3('0x63')][_0xedb3('0x3b')],_0x5afcdf[_0xedb3('0x63')]['role'],_0xd4be04[_0xedb3('0x6b')]['id'],_0x5afcdf[_0xedb3('0x5a')]?JSON[_0xedb3('0x29')](_0x5afcdf[_0xedb3('0x5a')]):_0xedb3('0x6f'));return respondWithRpcPromise(_0xedb3('0x7e'),'rejectMessage',_0xd4be04);}return null;})[_0xedb3('0x25')](function(_0x45f4ee){if(_0x45f4ee){_0x45f4ee[_0xedb3('0x2c')][_0xedb3('0x7f')]=util[_0xedb3('0x69')](_0xedb3('0x73'),_0x5afcdf[_0xedb3('0x63')][_0xedb3('0x3b')]);_0x45f4ee[_0xedb3('0x2c')][_0xedb3('0x74')]=_0xd4be04[_0xedb3('0x74')];_0x45f4ee[_0xedb3('0x2c')][_0xedb3('0x75')]='reject';respondWithRpcPromise('EventManager',_0xedb3('0x76'),{'event':_0xedb3('0x80'),'message':_0x45f4ee['message']},client9002);return _0xd4be04;}return null;})[_0xedb3('0x25')](respondWithResult(_0x1df5cf,null))[_0xedb3('0x54')](handleError(_0x1df5cf,null));}; \ No newline at end of file +var _0x7151=['get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','defaults','localhost','socket.io-emitter','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','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','sendStatus','status','end','json','count','limit','Content-Range','destroy','then','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','include','findAll','rows','show','params','rawAttributes','find','create','body','update','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil','interaction'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x7151,0x8c));var _0x1715=function(_0x2e5c2c,_0x1a744a){_0x2e5c2c=_0x2e5c2c-0x0;var _0x5e240b=_0x7151[_0x2e5c2c];return _0x5e240b;};'use strict';var pdf=require(_0x1715('0x0'));var emlformat=require(_0x1715('0x1'));var rimraf=require(_0x1715('0x2'));var zipdir=require(_0x1715('0x3'));var jsonpatch=require(_0x1715('0x4'));var rp=require(_0x1715('0x5'));var moment=require(_0x1715('0x6'));var BPromise=require(_0x1715('0x7'));var Mustache=require(_0x1715('0x8'));var util=require(_0x1715('0x9'));var path=require(_0x1715('0xa'));var sox=require(_0x1715('0xb'));var csv=require(_0x1715('0xc'));var ejs=require(_0x1715('0xd'));var fs=require('fs');var _=require(_0x1715('0xe'));var squel=require(_0x1715('0xf'));var crypto=require(_0x1715('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1715('0x11'));var authService=require(_0x1715('0x12'));var qs=require(_0x1715('0x13'));var as=require(_0x1715('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1715('0x15'))(_0x1715('0x16'));var utils=require(_0x1715('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x1715('0x18')](config['redis'],{'host':_0x1715('0x19'),'port':0x18eb});var socket=require(_0x1715('0x1a'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x1715('0x1b'));var client=jayson[_0x1715('0x1c')][_0x1715('0x1d')]({'port':0x232c});var client9002=jayson[_0x1715('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x1861dd,_0x424f4c,_0x2b85c8){if(_0x2b85c8){var _0x3523a5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3523a5[_0x1715('0x1e')](_0x424f4c)){return _0x1861dd;}else{throw new db[(_0x1715('0x1f'))]['ValidationError'](_0x1715('0x20'));}}else{return _0x1861dd;}}function respondWithRpcPromise(_0x525a3b,_0x40c09,_0xb0c0fe,_0xa8e6d0){return new BPromise(function(_0x3d1178,_0x3ecf1c){var _0x27d0b8=_0xa8e6d0||client;return _0x27d0b8[_0x1715('0x21')](_0x525a3b,_0xb0c0fe)['then'](function(_0xad9e93){logger['info'](_0x1715('0x22'),_0x40c09,_0x1715('0x23'));logger[_0x1715('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x40c09,'request\x20sent',JSON['stringify'](_0xad9e93));if(_0xad9e93[_0x1715('0x25')]){if(_0xad9e93[_0x1715('0x25')]['code']===0x1f4){logger['error'](_0x1715('0x22'),_0x40c09,_0xad9e93[_0x1715('0x25')][_0x1715('0x26')]);return _0x3ecf1c(_0xad9e93['error'][_0x1715('0x26')]);}logger['error'](_0x1715('0x22'),_0x40c09,_0xad9e93[_0x1715('0x25')]['message']);return _0x3d1178(_0xad9e93[_0x1715('0x25')]['message']);}else{logger[_0x1715('0x27')](_0x1715('0x22'),_0x40c09,_0x1715('0x23'));_0x3d1178(_0xad9e93[_0x1715('0x28')][_0x1715('0x26')]);}})[_0x1715('0x29')](function(_0x43c0b5){logger['error'](_0x1715('0x22'),_0x40c09,_0x43c0b5);_0x3ecf1c(_0x43c0b5);});});}function respondWithStatusCode(_0x559b40,_0x3e84b8){_0x3e84b8=_0x3e84b8||0xcc;return function(_0x398431){if(_0x398431){return _0x559b40[_0x1715('0x2a')](_0x3e84b8);}return _0x559b40[_0x1715('0x2b')](_0x3e84b8)[_0x1715('0x2c')]();};}function respondWithResult(_0x1cd61b,_0x26cdca){_0x26cdca=_0x26cdca||0xc8;return function(_0x4a29fe){if(_0x4a29fe){return _0x1cd61b[_0x1715('0x2b')](_0x26cdca)[_0x1715('0x2d')](_0x4a29fe);}};}function respondWithFilteredResult(_0x2147de,_0x4e4bfe){return function(_0x19c0e3){if(_0x19c0e3){var _0x203310=_0x19c0e3[_0x1715('0x2e')],_0xc7b469=_0x4e4bfe['offset'],_0x9f3b7f=_0x4e4bfe['offset']+_0x4e4bfe[_0x1715('0x2f')],_0x351859;if(_0x9f3b7f>=_0x203310){_0x9f3b7f=_0x203310;_0x351859=0xc8;}else{_0x351859=0xce;}_0x2147de[_0x1715('0x2b')](_0x351859);return _0x2147de['set'](_0x1715('0x30'),_0xc7b469+'-'+_0x9f3b7f+'/'+_0x203310)[_0x1715('0x2d')](_0x19c0e3);}return null;};}function patchUpdates(_0x485b89){return function(_0x47a38a){try{jsonpatch['apply'](_0x47a38a,_0x485b89,!![]);}catch(_0x4dce87){return BPromise['reject'](_0x4dce87);}return _0x47a38a['save']();};}function saveUpdates(_0x2939fb,_0x1b8c7b){return function(_0xc91865){if(_0xc91865){return _0xc91865['update'](_0x2939fb)['then'](function(_0x3e1708){return _0x3e1708;});}return null;};}function removeEntity(_0x1e1740,_0x39e4fd){return function(_0x4ab542){if(_0x4ab542){return _0x4ab542[_0x1715('0x31')]()[_0x1715('0x32')](function(){_0x1e1740[_0x1715('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590ee3,_0x3615b4){return function(_0x5705c9){if(!_0x5705c9){_0x590ee3[_0x1715('0x2a')](0x194);}return _0x5705c9;};}function handleError(_0x56d0d5,_0x374a49){_0x374a49=_0x374a49||0x1f4;return function(_0x3a7006){logger['error'](_0x3a7006['stack']);if(_0x3a7006[_0x1715('0x33')]){delete _0x3a7006[_0x1715('0x33')];}_0x56d0d5[_0x1715('0x2b')](_0x374a49)[_0x1715('0x34')](_0x3a7006);};}exports[_0x1715('0x35')]=function(_0x35a435,_0x12d601){var _0x2ad61b={},_0x300055={},_0x23a300={'count':0x0,'rows':[]};var _0x4bc92b=_[_0x1715('0x36')](db['ChatMessage']['rawAttributes'],function(_0xf170b7){return{'name':_0xf170b7[_0x1715('0x37')],'type':_0xf170b7[_0x1715('0x38')][_0x1715('0x39')]};});_0x300055['model']=_[_0x1715('0x36')](_0x4bc92b,_0x1715('0x33'));_0x300055['query']=_[_0x1715('0x3a')](_0x35a435[_0x1715('0x3b')]);_0x300055[_0x1715('0x3c')]=_[_0x1715('0x3d')](_0x300055[_0x1715('0x3e')],_0x300055['query']);_0x2ad61b['attributes']=_[_0x1715('0x3d')](_0x300055[_0x1715('0x3e')],qs[_0x1715('0x3f')](_0x35a435[_0x1715('0x3b')][_0x1715('0x3f')]));_0x2ad61b[_0x1715('0x40')]=_0x2ad61b[_0x1715('0x40')][_0x1715('0x41')]?_0x2ad61b[_0x1715('0x40')]:_0x300055['model'];if(!_0x35a435['query'][_0x1715('0x42')](_0x1715('0x43'))){_0x2ad61b['limit']=qs[_0x1715('0x2f')](_0x35a435[_0x1715('0x3b')]['limit']);_0x2ad61b[_0x1715('0x44')]=qs[_0x1715('0x44')](_0x35a435[_0x1715('0x3b')][_0x1715('0x44')]);}_0x2ad61b[_0x1715('0x45')]=qs[_0x1715('0x46')](_0x35a435['query'][_0x1715('0x46')]);_0x2ad61b[_0x1715('0x47')]=qs[_0x1715('0x3c')](_[_0x1715('0x48')](_0x35a435['query'],_0x300055[_0x1715('0x3c')]),_0x4bc92b);if(_0x35a435[_0x1715('0x3b')][_0x1715('0x49')]){_0x2ad61b[_0x1715('0x47')]=_[_0x1715('0x4a')](_0x2ad61b['where'],{'$or':_[_0x1715('0x36')](_0x4bc92b,function(_0x160c6f){if(_0x160c6f['type']!==_0x1715('0x4b')){var _0x172fe6={};_0x172fe6[_0x160c6f[_0x1715('0x33')]]={'$like':'%'+_0x35a435[_0x1715('0x3b')][_0x1715('0x49')]+'%'};return _0x172fe6;}})});}_0x2ad61b=_[_0x1715('0x4a')]({},_0x2ad61b,_0x35a435[_0x1715('0x4c')]);var _0x47cbcf={'where':_0x2ad61b[_0x1715('0x47')]};return db[_0x1715('0x4d')][_0x1715('0x2e')](_0x47cbcf)[_0x1715('0x32')](function(_0x5e1c35){_0x23a300[_0x1715('0x2e')]=_0x5e1c35;if(_0x35a435[_0x1715('0x3b')]['includeAll']){_0x2ad61b[_0x1715('0x4e')]=[{'all':!![]}];}return db[_0x1715('0x4d')][_0x1715('0x4f')](_0x2ad61b);})[_0x1715('0x32')](function(_0x575d47){_0x23a300[_0x1715('0x50')]=_0x575d47;return _0x23a300;})['then'](respondWithFilteredResult(_0x12d601,_0x2ad61b))['catch'](handleError(_0x12d601,null));};exports[_0x1715('0x51')]=function(_0x3292e6,_0xa2e4ac){var _0x2edce8={'raw':!![],'where':{'id':_0x3292e6[_0x1715('0x52')]['id']}},_0x33cadc={};_0x33cadc['model']=_[_0x1715('0x3a')](db[_0x1715('0x4d')][_0x1715('0x53')]);_0x33cadc['query']=_[_0x1715('0x3a')](_0x3292e6[_0x1715('0x3b')]);_0x33cadc[_0x1715('0x3c')]=_[_0x1715('0x3d')](_0x33cadc[_0x1715('0x3e')],_0x33cadc['query']);_0x2edce8[_0x1715('0x40')]=_[_0x1715('0x3d')](_0x33cadc[_0x1715('0x3e')],qs[_0x1715('0x3f')](_0x3292e6[_0x1715('0x3b')]['fields']));_0x2edce8[_0x1715('0x40')]=_0x2edce8['attributes'][_0x1715('0x41')]?_0x2edce8[_0x1715('0x40')]:_0x33cadc[_0x1715('0x3e')];if(_0x3292e6[_0x1715('0x3b')]['includeAll']){_0x2edce8['include']=[{'all':!![]}];}_0x2edce8=_[_0x1715('0x4a')]({},_0x2edce8,_0x3292e6['options']);return db['ChatMessage'][_0x1715('0x54')](_0x2edce8)['then'](handleEntityNotFound(_0xa2e4ac,null))[_0x1715('0x32')](respondWithResult(_0xa2e4ac,null))[_0x1715('0x29')](handleError(_0xa2e4ac,null));};exports[_0x1715('0x55')]=function(_0x1bd669,_0x50f24d){return db[_0x1715('0x4d')][_0x1715('0x55')](_0x1bd669[_0x1715('0x56')],{})['then'](respondWithResult(_0x50f24d,0xc9))[_0x1715('0x29')](handleError(_0x50f24d,null));};exports[_0x1715('0x57')]=function(_0x4ea20e,_0x2164c2){if(_0x4ea20e['body']['id']){delete _0x4ea20e[_0x1715('0x56')]['id'];}return db[_0x1715('0x4d')]['find']({'where':{'id':_0x4ea20e[_0x1715('0x52')]['id']}})['then'](handleEntityNotFound(_0x2164c2,null))[_0x1715('0x32')](saveUpdates(_0x4ea20e[_0x1715('0x56')],null))[_0x1715('0x32')](respondWithResult(_0x2164c2,null))[_0x1715('0x29')](handleError(_0x2164c2,null));};exports['destroy']=function(_0x57ed64,_0x5586b4){return db[_0x1715('0x4d')][_0x1715('0x54')]({'where':{'id':_0x57ed64[_0x1715('0x52')]['id']}})[_0x1715('0x32')](handleEntityNotFound(_0x5586b4,null))[_0x1715('0x32')](removeEntity(_0x5586b4,null))[_0x1715('0x29')](handleError(_0x5586b4,null));};exports['describe']=function(_0xd68bf1,_0x5583e8){return db[_0x1715('0x4d')][_0x1715('0x58')]()['then'](respondWithResult(_0x5583e8,null))[_0x1715('0x29')](handleError(_0x5583e8,null));};var interaction_log=require(_0x1715('0x15'))('chat-interactions');exports[_0x1715('0x59')]=function(_0x2bc1ef,_0x11fc27,_0x174470){var _0x1daa45={'channel':_0x1715('0x5a')};if(_0x2bc1ef[_0x1715('0x56')]['id']){delete _0x2bc1ef[_0x1715('0x56')]['id'];}_0x2bc1ef[_0x1715('0x56')]['read']=!![];_0x2bc1ef[_0x1715('0x56')][_0x1715('0x5b')]=moment()[_0x1715('0x5c')](_0x1715('0x5d'));_0x2bc1ef[_0x1715('0x56')][_0x1715('0x5e')]=_0x2bc1ef['body'][_0x1715('0x5e')]||_0x2bc1ef[_0x1715('0x5f')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x2bc1ef['params']['id'],'UserId':null},'include':[{'model':db[_0x1715('0x60')],'as':_0x1715('0x61')}]})['then'](handleEntityNotFound(_0x11fc27,null))[_0x1715('0x32')](saveUpdates(_0x2bc1ef[_0x1715('0x56')],null))[_0x1715('0x32')](function(_0x216c3c){if(_0x216c3c){_0x1daa45[_0x1715('0x26')]=_0x216c3c['get']({'plain':!![]});return db[_0x1715('0x62')]['find']({'where':{'id':_0x216c3c[_0x1715('0x63')]}});}return null;})[_0x1715('0x32')](handleEntityNotFound(_0x11fc27,null))[_0x1715('0x32')](function(_0x5ec5ec){if(_0x5ec5ec){return _0x5ec5ec[_0x1715('0x57')]({'UserId':_0x2bc1ef[_0x1715('0x56')]['UserId'],'read1stAt':_[_0x1715('0x64')](_0x5ec5ec['read1stAt'])?moment()['format'](_0x1715('0x5d')):undefined});}return null;})['then'](function(_0x1f7566){if(_0x1f7566){_0x1daa45[_0x1715('0x65')]=_0x1f7566[_0x1715('0x66')]({'plain':!![]});interaction_log[_0x1715('0x27')](_0x1715('0x67'),_0x2bc1ef[_0x1715('0x5f')]['id'],_0x2bc1ef[_0x1715('0x5f')][_0x1715('0x33')],_0x2bc1ef[_0x1715('0x5f')][_0x1715('0x68')],_0x1daa45[_0x1715('0x65')]['id'],_0x2bc1ef[_0x1715('0x56')]?JSON[_0x1715('0x69')](_0x2bc1ef[_0x1715('0x56')]):_0x1715('0x6a'));return respondWithRpcPromise(_0x1715('0x6b'),_0x1715('0x6c'),_0x1daa45);}return null;})[_0x1715('0x32')](function(_0x48518b){if(_0x48518b){if(_0x2bc1ef[_0x1715('0x56')]['manual']){_0x1daa45[_0x1715('0x26')][_0x1715('0x6d')]=util[_0x1715('0x5c')](_0x1715('0x6e'),_0x2bc1ef[_0x1715('0x5f')][_0x1715('0x33')]);_0x1daa45[_0x1715('0x26')][_0x1715('0x6f')]=_0x1daa45['channel'];_0x1daa45[_0x1715('0x26')][_0x1715('0x70')]=_0x1715('0x59');return respondWithRpcPromise(_0x1715('0x71'),_0x1715('0x71'),{'event':_0x1715('0x72'),'message':_[_0x1715('0x4a')](_0x1daa45[_0x1715('0x26')],JSON[_0x1715('0x73')](_0x1daa45[_0x1715('0x65')]['formData']))},client9002)[_0x1715('0x32')](function(){return _0x1daa45;});}return _0x1daa45;}return null;})['then'](respondWithResult(_0x11fc27,null))['catch'](handleError(_0x11fc27,null));};var interaction_log=require(_0x1715('0x15'))(_0x1715('0x74'));exports[_0x1715('0x75')]=function(_0x294398,_0x4258cd,_0x2b648c){var _0x50a627={'agent':{},'channel':_0x1715('0x5a')};if(_0x294398[_0x1715('0x56')]['id']){delete _0x294398['body']['id'];}_0x294398['body'][_0x1715('0x5e')]=_0x294398[_0x1715('0x56')][_0x1715('0x5e')]||_0x294398['user']['id'];_0x50a627['agent']['id']=_0x294398[_0x1715('0x56')]['UserId'];return db[_0x1715('0x4d')][_0x1715('0x54')]({'where':{'id':_0x294398[_0x1715('0x52')]['id'],'UserId':null}})[_0x1715('0x32')](handleEntityNotFound(_0x4258cd,null))[_0x1715('0x32')](function(_0x388263){if(_0x388263){_0x50a627[_0x1715('0x26')]=_0x388263['get']({'plain':!![]});return db[_0x1715('0x62')][_0x1715('0x54')]({'where':{'id':_0x388263[_0x1715('0x63')]}});}return null;})[_0x1715('0x32')](handleEntityNotFound(_0x4258cd,null))[_0x1715('0x32')](function(_0xd30d58){if(_0xd30d58){_0x50a627[_0x1715('0x65')]=_0xd30d58[_0x1715('0x66')]({'plain':!![]});interaction_log['info'](_0x1715('0x76'),_0x294398[_0x1715('0x5f')]['id'],_0x294398[_0x1715('0x5f')]['name'],_0x294398[_0x1715('0x5f')][_0x1715('0x68')],_0x50a627[_0x1715('0x65')]['id'],_0x294398[_0x1715('0x56')]?JSON[_0x1715('0x69')](_0x294398[_0x1715('0x56')]):_0x1715('0x6a'));return respondWithRpcPromise('RejectMessage',_0x1715('0x77'),_0x50a627);}return null;})[_0x1715('0x32')](function(_0x5331ee){if(_0x5331ee){_0x5331ee[_0x1715('0x26')][_0x1715('0x6d')]=util[_0x1715('0x5c')](_0x1715('0x6e'),_0x294398[_0x1715('0x5f')][_0x1715('0x33')]);_0x5331ee[_0x1715('0x26')][_0x1715('0x6f')]=_0x50a627[_0x1715('0x6f')];_0x5331ee[_0x1715('0x26')][_0x1715('0x70')]=_0x1715('0x75');respondWithRpcPromise(_0x1715('0x71'),_0x1715('0x71'),{'event':_0x1715('0x78'),'message':_0x5331ee[_0x1715('0x26')]},client9002);return _0x50a627;}return null;})[_0x1715('0x32')](respondWithResult(_0x4258cd,null))[_0x1715('0x29')](handleError(_0x4258cd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8753872..5afc8c9 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 _0x3697=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x37abe8,_0x59e65d){var _0x4c2670=function(_0x5c5595){while(--_0x5c5595){_0x37abe8['push'](_0x37abe8['shift']());}};_0x4c2670(++_0x59e65d);}(_0x3697,0x15f));var _0x7369=function(_0x8d5013,_0x36cc8d){_0x8d5013=_0x8d5013-0x0;var _0x3798e6=_0x3697[_0x8d5013];return _0x3798e6;};'use strict';var EventEmitter=require(_0x7369('0x0'));var ChatMessage=require(_0x7369('0x1'))['db'][_0x7369('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7369('0x3')](0x0);var events={'afterCreate':_0x7369('0x4'),'afterUpdate':_0x7369('0x5'),'afterDestroy':_0x7369('0x6')};function emitEvent(_0x185bdd){return function(_0x163d0b,_0x5b47d1,_0x5e70e4){ChatMessageEvents['emit'](_0x185bdd+':'+_0x163d0b['id'],_0x163d0b);ChatMessageEvents['emit'](_0x185bdd,_0x163d0b);_0x5e70e4(null);};}for(var e in events){if(events[_0x7369('0x7')](e)){var event=events[e];ChatMessage[_0x7369('0x8')](e,emitEvent(event));}}module[_0x7369('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xe775=['hook','exports','events','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x386165,_0x19aae8){var _0x56fe83=function(_0x18983b){while(--_0x18983b){_0x386165['push'](_0x386165['shift']());}};_0x56fe83(++_0x19aae8);}(_0xe775,0x158));var _0x5e77=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xe775[_0x1c5950];return _0x2b720a;};'use strict';var EventEmitter=require(_0x5e77('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x5e77('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5e77('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e77('0x3'),'afterDestroy':_0x5e77('0x4')};function emitEvent(_0x19053d){return function(_0x2a3819,_0x541802,_0xd07968){ChatMessageEvents[_0x5e77('0x5')](_0x19053d+':'+_0x2a3819['id'],_0x2a3819);ChatMessageEvents[_0x5e77('0x5')](_0x19053d,_0x2a3819);_0xd07968(null);};}for(var e in events){if(events[_0x5e77('0x6')](e)){var event=events[e];ChatMessage[_0x5e77('0x7')](e,emitEvent(event));}}module[_0x5e77('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4cbfe3d..ba6629f 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 _0x0e4d=['ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','models','toLowerCase','direction','out','isNil','UserId','ChatInteraction','findOne'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e4d,0x157));var _0xd0e4=function(_0x3ad684,_0x2abdbb){_0x3ad684=_0x3ad684-0x0;var _0x32a22d=_0x0e4d[_0x3ad684];return _0x32a22d;};'use strict';var _=require(_0xd0e4('0x0'));var util=require('util');var logger=require(_0xd0e4('0x1'))(_0xd0e4('0x2'));var moment=require(_0xd0e4('0x3'));var BPromise=require(_0xd0e4('0x4'));var rp=require(_0xd0e4('0x5'));var fs=require('fs');var path=require(_0xd0e4('0x6'));var rimraf=require(_0xd0e4('0x7'));var config=require(_0xd0e4('0x8'));var attributes=require('./chatMessage.attributes');module[_0xd0e4('0x9')]=function(_0x2e3bfd,_0x3e9d25){return _0x2e3bfd['define'](_0xd0e4('0xa'),attributes,{'tableName':_0xd0e4('0xb'),'paranoid':![],'indexes':[{'name':_0xd0e4('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f8ef6,_0x1e8681,_0x142fc0){var _0x1cfd08=_0x2e3bfd[_0xd0e4('0xd')];var _0xc97924=_0x1f8ef6['get']({'plain':!![]});if(_0xc97924['direction'][_0xd0e4('0xe')]()==='in'||_0xc97924[_0xd0e4('0xf')][_0xd0e4('0xe')]()===_0xd0e4('0x10')&&!_0xc97924['secret']&&!_[_0xd0e4('0x11')](_0xc97924[_0xd0e4('0x12')])){_0x1cfd08[_0xd0e4('0x13')][_0xd0e4('0x14')]({'where':{'id':_0xc97924[_0xd0e4('0x15')]}})[_0xd0e4('0x16')](function(_0x46e0f4){if(_0x46e0f4){_0x46e0f4['update']({'lastMsgAt':_0xc97924[_0xd0e4('0x17')],'lastMsgDirection':_0xc97924['direction']['toLowerCase']()});}})[_0xd0e4('0x18')](function(_0x1b2102){console[_0xd0e4('0x19')](_0x1b2102);});}_0x142fc0();}},'charset':_0xd0e4('0x1a'),'collate':_0xd0e4('0x1b')});}; \ No newline at end of file +var _0x89bc=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x89bc,0xe0));var _0xc89b=function(_0xa5e821,_0x4dd2f6){_0xa5e821=_0xa5e821-0x0;var _0x62d0cd=_0x89bc[_0xa5e821];return _0x62d0cd;};'use strict';var _=require(_0xc89b('0x0'));var util=require(_0xc89b('0x1'));var logger=require(_0xc89b('0x2'))('api');var moment=require(_0xc89b('0x3'));var BPromise=require(_0xc89b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc89b('0x5'));var rimraf=require(_0xc89b('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xc89b('0x7')]=function(_0x1b7cde,_0x36c8a0){return _0x1b7cde[_0xc89b('0x8')](_0xc89b('0x9'),attributes,{'tableName':_0xc89b('0xa'),'paranoid':![],'indexes':[{'name':_0xc89b('0xb'),'fields':[_0xc89b('0xc')],'type':_0xc89b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x288429,_0x5b28db,_0x27ad0a){var _0x265940=_0x1b7cde['models'];var _0x878313=_0x288429[_0xc89b('0xe')]({'plain':!![]});if(_0x878313[_0xc89b('0xf')][_0xc89b('0x10')]()==='in'||_0x878313['direction'][_0xc89b('0x10')]()===_0xc89b('0x11')&&!_0x878313['secret']&&!_[_0xc89b('0x12')](_0x878313[_0xc89b('0x13')])){_0x265940[_0xc89b('0x14')][_0xc89b('0x15')]({'where':{'id':_0x878313['ChatInteractionId']}})[_0xc89b('0x16')](function(_0x198104){if(_0x198104){_0x198104[_0xc89b('0x17')]({'lastMsgAt':_0x878313[_0xc89b('0x18')],'lastMsgDirection':_0x878313[_0xc89b('0xf')][_0xc89b('0x10')]()});}})[_0xc89b('0x19')](function(_0x4e2236){console[_0xc89b('0x1a')](_0x4e2236);});}_0x27ad0a();}},'charset':'utf8mb4','collate':_0xc89b('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 4664a1a..0e125fd 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 _0xf7e9=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bb92f,_0x2eb742){var _0x26a335=function(_0x2be158){while(--_0x2be158){_0x2bb92f['push'](_0x2bb92f['shift']());}};_0x26a335(++_0x2eb742);}(_0xf7e9,0x1a4));var _0x9f7e=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xf7e9[_0x485b5a];return _0xd2b34d;};'use strict';var _=require(_0x9f7e('0x0'));var util=require(_0x9f7e('0x1'));var moment=require(_0x9f7e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9f7e('0x3'));var logger=require(_0x9f7e('0x4'))(_0x9f7e('0x5'));var config=require(_0x9f7e('0x6'));var jayson=require(_0x9f7e('0x7'));var client=jayson[_0x9f7e('0x8')][_0x9f7e('0x9')]({'port':0x232a});config[_0x9f7e('0xa')]=_[_0x9f7e('0xb')](config[_0x9f7e('0xa')],{'host':_0x9f7e('0xc'),'port':0x18eb});var socket=require(_0x9f7e('0xd'))(new Redis(config[_0x9f7e('0xa')]));require('./chatMessage.socket')[_0x9f7e('0xe')](socket);function respondWithRpcPromise(_0x1949d9,_0x1a3cac,_0xb23bcc){return new BPromise(function(_0x34f6bb,_0x25f047){return client[_0x9f7e('0xf')](_0x1949d9,_0xb23bcc)[_0x9f7e('0x10')](function(_0x5cd250){logger[_0x9f7e('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1a3cac,_0x9f7e('0x12'));logger[_0x9f7e('0x13')](_0x9f7e('0x14'),_0x1a3cac,'request\x20sent',JSON[_0x9f7e('0x15')](_0x5cd250));if(_0x5cd250[_0x9f7e('0x16')]){if(_0x5cd250[_0x9f7e('0x16')][_0x9f7e('0x17')]===0x1f4){logger[_0x9f7e('0x16')](_0x9f7e('0x18'),_0x1a3cac,_0x5cd250[_0x9f7e('0x16')][_0x9f7e('0x19')]);return _0x25f047(_0x5cd250['error'][_0x9f7e('0x19')]);}logger[_0x9f7e('0x16')]('ChatMessage,\x20%s,\x20%s',_0x1a3cac,_0x5cd250[_0x9f7e('0x16')][_0x9f7e('0x19')]);return _0x34f6bb(_0x5cd250[_0x9f7e('0x16')][_0x9f7e('0x19')]);}else{logger[_0x9f7e('0x11')](_0x9f7e('0x18'),_0x1a3cac,_0x9f7e('0x12'));_0x34f6bb(_0x5cd250['result']['message']);}})[_0x9f7e('0x1a')](function(_0x5b6738){logger[_0x9f7e('0x16')](_0x9f7e('0x18'),_0x1a3cac,_0x5b6738);_0x25f047(_0x5b6738);});});}exports['CreateChatMessage']=function(_0x2ce78e){var _0x211e55=this;return new Promise(function(_0x5c412e,_0x286489){return db[_0x9f7e('0x1b')][_0x9f7e('0x1c')](_0x2ce78e[_0x9f7e('0x1d')],{'raw':_0x2ce78e[_0x9f7e('0x1e')]?_0x2ce78e[_0x9f7e('0x1e')][_0x9f7e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x346484){logger[_0x9f7e('0x11')](_0x9f7e('0x20'),_0x2ce78e);logger[_0x9f7e('0x13')](_0x9f7e('0x20'),_0x2ce78e,JSON[_0x9f7e('0x15')](_0x346484));_0x5c412e(_0x346484);})[_0x9f7e('0x1a')](function(_0x23903c){logger[_0x9f7e('0x16')]('CreateChatMessage',_0x23903c[_0x9f7e('0x19')],_0x2ce78e);_0x286489(_0x211e55[_0x9f7e('0x16')](0x1f4,_0x23903c[_0x9f7e('0x19')]));});});}; \ No newline at end of file +var _0x900a=['info','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x900a,0x1ec));var _0xa900=function(_0x9f528a,_0x5b1bc8){_0x9f528a=_0x9f528a-0x0;var _0x273be7=_0x900a[_0x9f528a];return _0x273be7;};'use strict';var _=require('lodash');var util=require(_0xa900('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa900('0x1'));var fs=require('fs');var Redis=require(_0xa900('0x2'));var db=require(_0xa900('0x3'))['db'];var utils=require(_0xa900('0x4'));var logger=require(_0xa900('0x5'))(_0xa900('0x6'));var config=require(_0xa900('0x7'));var jayson=require(_0xa900('0x8'));var client=jayson['client'][_0xa900('0x9')]({'port':0x232a});config[_0xa900('0xa')]=_[_0xa900('0xb')](config[_0xa900('0xa')],{'host':_0xa900('0xc'),'port':0x18eb});var socket=require(_0xa900('0xd'))(new Redis(config[_0xa900('0xa')]));require(_0xa900('0xe'))[_0xa900('0xf')](socket);function respondWithRpcPromise(_0x50b813,_0x12b4cb,_0x3ab44a){return new BPromise(function(_0x246d19,_0x399fbe){return client[_0xa900('0x10')](_0x50b813,_0x3ab44a)[_0xa900('0x11')](function(_0x5d9313){logger[_0xa900('0x12')]('ChatMessage,\x20%s,\x20%s',_0x12b4cb,'request\x20sent');logger['debug'](_0xa900('0x13'),_0x12b4cb,_0xa900('0x14'),JSON[_0xa900('0x15')](_0x5d9313));if(_0x5d9313[_0xa900('0x16')]){if(_0x5d9313['error'][_0xa900('0x17')]===0x1f4){logger[_0xa900('0x16')](_0xa900('0x18'),_0x12b4cb,_0x5d9313[_0xa900('0x16')][_0xa900('0x19')]);return _0x399fbe(_0x5d9313[_0xa900('0x16')][_0xa900('0x19')]);}logger[_0xa900('0x16')](_0xa900('0x18'),_0x12b4cb,_0x5d9313[_0xa900('0x16')]['message']);return _0x246d19(_0x5d9313[_0xa900('0x16')]['message']);}else{logger['info'](_0xa900('0x18'),_0x12b4cb,_0xa900('0x14'));_0x246d19(_0x5d9313[_0xa900('0x1a')][_0xa900('0x19')]);}})[_0xa900('0x1b')](function(_0x4b5642){logger[_0xa900('0x16')](_0xa900('0x18'),_0x12b4cb,_0x4b5642);_0x399fbe(_0x4b5642);});});}exports[_0xa900('0x1c')]=function(_0x3961c7){var _0xd0ad41=this;return new Promise(function(_0x36fcca,_0x21db21){return db['ChatMessage'][_0xa900('0x1d')](_0x3961c7[_0xa900('0x1e')],{'raw':_0x3961c7[_0xa900('0x1f')]?_0x3961c7[_0xa900('0x1f')][_0xa900('0x20')]===undefined?!![]:![]:!![]})[_0xa900('0x11')](function(_0x2b56df){logger[_0xa900('0x12')](_0xa900('0x1c'),_0x3961c7);logger[_0xa900('0x21')](_0xa900('0x1c'),_0x3961c7,JSON[_0xa900('0x15')](_0x2b56df));_0x36fcca(_0x2b56df);})[_0xa900('0x1b')](function(_0x1e0ee){logger[_0xa900('0x16')](_0xa900('0x1c'),_0x1e0ee[_0xa900('0x19')],_0x3961c7);_0x21db21(_0xd0ad41[_0xa900('0x16')](0x1f4,_0x1e0ee[_0xa900('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 4bb6d98..0d6390a 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 _0x326f=['update','emit','removeListener','register','length','./chatMessage.events'];(function(_0x172a7b,_0x1e9c9f){var _0x1eeb0a=function(_0x326b31){while(--_0x326b31){_0x172a7b['push'](_0x172a7b['shift']());}};_0x1eeb0a(++_0x1e9c9f);}(_0x326f,0xd1));var _0xf326=function(_0x409c55,_0x468efe){_0x409c55=_0x409c55-0x0;var _0x4ac250=_0x326f[_0x409c55];return _0x4ac250;};'use strict';var ChatMessageEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){ChatMessageEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('chatMessage:'+_0x165f95,_0x3ace29);ChatMessageEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file +var _0x7880=['register','length','save','remove','update','removeListener'];(function(_0x2cd4a7,_0x49a857){var _0x58462d=function(_0x12f62d){while(--_0x12f62d){_0x2cd4a7['push'](_0x2cd4a7['shift']());}};_0x58462d(++_0x49a857);}(_0x7880,0x1f4));var _0x0788=function(_0x2126c7,_0x5cd37f){_0x2126c7=_0x2126c7-0x0;var _0x2d91f4=_0x7880[_0x2126c7];return _0x2d91f4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x0788('0x0'),_0x0788('0x1'),_0x0788('0x2')];function createListener(_0x1b196a,_0x47dc20){return function(_0x446ded){_0x47dc20['emit'](_0x1b196a,_0x446ded);};}function removeListener(_0x3925a6,_0x1e0814){return function(){ChatMessageEvents[_0x0788('0x3')](_0x3925a6,_0x1e0814);};}exports[_0x0788('0x4')]=function(_0x262f5c){for(var _0x775629=0x0,_0x3f9cb8=events[_0x0788('0x5')];_0x775629<_0x3f9cb8;_0x775629++){var _0x3c29f3=events[_0x775629];var _0x422f8b=createListener('chatMessage:'+_0x3c29f3,_0x262f5c);ChatMessageEvents['on'](_0x3c29f3,_0x422f8b);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index add2783..84b093e 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 _0xcd0d=['/:id','show','post','tracked','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe'];(function(_0x182fff,_0x568aee){var _0x1b4171=function(_0x212d46){while(--_0x212d46){_0x182fff['push'](_0x182fff['shift']());}};_0x1b4171(++_0x568aee);}(_0xcd0d,0xf8));var _0xdcd0=function(_0x362e87,_0x38d17c){_0x362e87=_0x362e87-0x0;var _0x334244=_0xcd0d[_0x362e87];return _0x334244;};'use strict';var multer=require(_0xdcd0('0x0'));var util=require(_0xdcd0('0x1'));var path=require(_0xdcd0('0x2'));var timeout=require('connect-timeout');var express=require(_0xdcd0('0x3'));var router=express[_0xdcd0('0x4')]();var auth=require(_0xdcd0('0x5'));var interaction=require(_0xdcd0('0x6'));var config=require(_0xdcd0('0x7'));var controller=require(_0xdcd0('0x8'));router[_0xdcd0('0x9')]('/',auth[_0xdcd0('0xa')](),controller['index']);router[_0xdcd0('0x9')](_0xdcd0('0xb'),auth[_0xdcd0('0xa')](),controller['describe']);router[_0xdcd0('0x9')](_0xdcd0('0xc'),auth['isAuthenticated'](),controller[_0xdcd0('0xd')]);router[_0xdcd0('0xe')]('/',auth[_0xdcd0('0xa')](),interaction[_0xdcd0('0xf')]('chat',_0xdcd0('0x10')),controller[_0xdcd0('0x11')]);router[_0xdcd0('0x12')]('/:id',controller[_0xdcd0('0x13')]);router[_0xdcd0('0x12')](_0xdcd0('0x14'),auth[_0xdcd0('0xa')](),controller['accept']);router[_0xdcd0('0x12')](_0xdcd0('0x15'),auth['isAuthenticated'](),controller[_0xdcd0('0x16')]);router[_0xdcd0('0x17')]('/:id',auth[_0xdcd0('0xa')](),controller[_0xdcd0('0x18')]);module[_0xdcd0('0x19')]=router; \ No newline at end of file +var _0x2483=['reject','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject'];(function(_0x354634,_0x5beaed){var _0x386114=function(_0x3a12f2){while(--_0x3a12f2){_0x354634['push'](_0x354634['shift']());}};_0x386114(++_0x5beaed);}(_0x2483,0xb2));var _0x3248=function(_0x4b6512,_0x5c076e){_0x4b6512=_0x4b6512-0x0;var _0x36dc78=_0x2483[_0x4b6512];return _0x36dc78;};'use strict';var multer=require(_0x3248('0x0'));var util=require('util');var path=require(_0x3248('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3248('0x2')]();var auth=require(_0x3248('0x3'));var interaction=require(_0x3248('0x4'));var config=require(_0x3248('0x5'));var controller=require('./chatMessage.controller');router[_0x3248('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3248('0x6')](_0x3248('0x7'),auth[_0x3248('0x8')](),controller[_0x3248('0x9')]);router[_0x3248('0x6')](_0x3248('0xa'),auth[_0x3248('0x8')](),controller[_0x3248('0xb')]);router[_0x3248('0xc')]('/',auth[_0x3248('0x8')](),interaction[_0x3248('0xd')](_0x3248('0xe'),_0x3248('0xf')),controller[_0x3248('0x10')]);router['put'](_0x3248('0xa'),controller[_0x3248('0x11')]);router[_0x3248('0x12')](_0x3248('0x13'),auth[_0x3248('0x8')](),controller[_0x3248('0x14')]);router['put'](_0x3248('0x15'),auth[_0x3248('0x8')](),controller[_0x3248('0x16')]);router[_0x3248('0x17')]('/:id',auth[_0x3248('0x8')](),controller['destroy']);module[_0x3248('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 332e5de..4533ccb 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 _0x3586=['TEXT','sequelize','exports'];(function(_0x60337,_0x163a14){var _0x48e690=function(_0x570685){while(--_0x570685){_0x60337['push'](_0x60337['shift']());}};_0x48e690(++_0x163a14);}(_0x3586,0x1d2));var _0x6358=function(_0x370338,_0x4178ec){_0x370338=_0x370338-0x0;var _0x2e10df=_0x3586[_0x370338];return _0x2e10df;};'use strict';var Sequelize=require(_0x6358('0x0'));module[_0x6358('0x1')]={'body':{'type':Sequelize[_0x6358('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x86d9=['TEXT','medium'];(function(_0x1b30cb,_0x3c9692){var _0x1e0cc5=function(_0x52b205){while(--_0x52b205){_0x1b30cb['push'](_0x1b30cb['shift']());}};_0x1e0cc5(++_0x3c9692);}(_0x86d9,0xa8));var _0x986d=function(_0xba6a4a,_0xc8d9be){_0xba6a4a=_0xba6a4a-0x0;var _0x443d50=_0x86d9[_0xba6a4a];return _0x443d50;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x986d('0x0')](_0x986d('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ba2568c..653d580 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 _0x723e=['util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','stack','name','send','map','ChatOfflineMessage','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x487f15,_0x1cf5fb){var _0x32c8a1=function(_0x255c2f){while(--_0x255c2f){_0x487f15['push'](_0x487f15['shift']());}};_0x32c8a1(++_0x1cf5fb);}(_0x723e,0x179));var _0xe723=function(_0xd4d369,_0x4f6ad2){_0xd4d369=_0xd4d369-0x0;var _0x293e5d=_0x723e[_0xd4d369];return _0x293e5d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe723('0x0'));var rimraf=require(_0xe723('0x1'));var zipdir=require(_0xe723('0x2'));var jsonpatch=require(_0xe723('0x3'));var rp=require(_0xe723('0x4'));var moment=require(_0xe723('0x5'));var BPromise=require(_0xe723('0x6'));var Mustache=require(_0xe723('0x7'));var util=require(_0xe723('0x8'));var path=require(_0xe723('0x9'));var sox=require('sox');var csv=require(_0xe723('0xa'));var ejs=require(_0xe723('0xb'));var fs=require('fs');var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0xa'));var querystring=require('querystring');var Papa=require(_0xe723('0x11'));var Redis=require(_0xe723('0x12'));var authService=require(_0xe723('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x14'));var hardwareService=require(_0xe723('0x15'));var logger=require(_0xe723('0x16'))('api');var utils=require(_0xe723('0x17'));var config=require(_0xe723('0x18'));var db=require(_0xe723('0x19'))['db'];function respondWithStatusCode(_0x293f66,_0x236b69){_0x236b69=_0x236b69||0xcc;return function(_0x5c066c){if(_0x5c066c){return _0x293f66[_0xe723('0x1a')](_0x236b69);}return _0x293f66['status'](_0x236b69)['end']();};}function respondWithResult(_0x5201f2,_0x57bc0e){_0x57bc0e=_0x57bc0e||0xc8;return function(_0x75c12c){if(_0x75c12c){return _0x5201f2[_0xe723('0x1b')](_0x57bc0e)[_0xe723('0x1c')](_0x75c12c);}};}function respondWithFilteredResult(_0x2b010b,_0xf29a39){return function(_0x5aec97){if(_0x5aec97){var _0x23d0b2=_0x5aec97[_0xe723('0x1d')],_0xbf5ca3=_0xf29a39[_0xe723('0x1e')],_0xb8f1d=_0xf29a39[_0xe723('0x1e')]+_0xf29a39[_0xe723('0x1f')],_0x2ec702;if(_0xb8f1d>=_0x23d0b2){_0xb8f1d=_0x23d0b2;_0x2ec702=0xc8;}else{_0x2ec702=0xce;}_0x2b010b[_0xe723('0x1b')](_0x2ec702);return _0x2b010b[_0xe723('0x20')](_0xe723('0x21'),_0xbf5ca3+'-'+_0xb8f1d+'/'+_0x23d0b2)[_0xe723('0x1c')](_0x5aec97);}return null;};}function patchUpdates(_0x262a8d){return function(_0x367782){try{jsonpatch['apply'](_0x367782,_0x262a8d,!![]);}catch(_0x5b2308){return BPromise[_0xe723('0x22')](_0x5b2308);}return _0x367782[_0xe723('0x23')]();};}function saveUpdates(_0x487058,_0x28caca){return function(_0x2762e2){if(_0x2762e2){return _0x2762e2['update'](_0x487058)[_0xe723('0x24')](function(_0x52fe6e){return _0x52fe6e;});}return null;};}function removeEntity(_0x3296cc,_0x43ccfc){return function(_0x3b82b2){if(_0x3b82b2){return _0x3b82b2[_0xe723('0x25')]()[_0xe723('0x24')](function(){_0x3296cc[_0xe723('0x1b')](0xcc)[_0xe723('0x26')]();});}};}function handleEntityNotFound(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(!_0x19bd0c){_0x15196c[_0xe723('0x1a')](0x194);}return _0x19bd0c;};}function handleError(_0x47dcf7,_0x5c4fb4){_0x5c4fb4=_0x5c4fb4||0x1f4;return function(_0x384786){logger['error'](_0x384786[_0xe723('0x27')]);if(_0x384786[_0xe723('0x28')]){delete _0x384786[_0xe723('0x28')];}_0x47dcf7[_0xe723('0x1b')](_0x5c4fb4)[_0xe723('0x29')](_0x384786);};}exports['index']=function(_0x2925bc,_0x52feb9){var _0x52f919={},_0x15911d={},_0x511c74={'count':0x0,'rows':[]};var _0x3e6bc0=_[_0xe723('0x2a')](db[_0xe723('0x2b')]['rawAttributes'],function(_0x1edbb2){return{'name':_0x1edbb2[_0xe723('0x2c')],'type':_0x1edbb2['type'][_0xe723('0x2d')]};});_0x15911d['model']=_['map'](_0x3e6bc0,_0xe723('0x28'));_0x15911d[_0xe723('0x2e')]=_[_0xe723('0x2f')](_0x2925bc[_0xe723('0x2e')]);_0x15911d['filters']=_['intersection'](_0x15911d[_0xe723('0x30')],_0x15911d['query']);_0x52f919[_0xe723('0x31')]=_[_0xe723('0x32')](_0x15911d[_0xe723('0x30')],qs[_0xe723('0x33')](_0x2925bc[_0xe723('0x2e')][_0xe723('0x33')]));_0x52f919[_0xe723('0x31')]=_0x52f919[_0xe723('0x31')][_0xe723('0x34')]?_0x52f919[_0xe723('0x31')]:_0x15911d[_0xe723('0x30')];if(!_0x2925bc[_0xe723('0x2e')][_0xe723('0x35')](_0xe723('0x36'))){_0x52f919['limit']=qs[_0xe723('0x1f')](_0x2925bc['query'][_0xe723('0x1f')]);_0x52f919[_0xe723('0x1e')]=qs['offset'](_0x2925bc['query'][_0xe723('0x1e')]);}_0x52f919[_0xe723('0x37')]=qs[_0xe723('0x38')](_0x2925bc[_0xe723('0x2e')][_0xe723('0x38')]);_0x52f919[_0xe723('0x39')]=qs['filters'](_[_0xe723('0x3a')](_0x2925bc[_0xe723('0x2e')],_0x15911d[_0xe723('0x3b')]),_0x3e6bc0);if(_0x2925bc[_0xe723('0x2e')][_0xe723('0x3c')]){_0x52f919[_0xe723('0x39')]=_[_0xe723('0x3d')](_0x52f919[_0xe723('0x39')],{'$or':_[_0xe723('0x2a')](_0x3e6bc0,function(_0x3dca81){if(_0x3dca81[_0xe723('0x3e')]!==_0xe723('0x3f')){var _0x22a4ea={};_0x22a4ea[_0x3dca81[_0xe723('0x28')]]={'$like':'%'+_0x2925bc[_0xe723('0x2e')][_0xe723('0x3c')]+'%'};return _0x22a4ea;}})});}_0x52f919=_['merge']({},_0x52f919,_0x2925bc[_0xe723('0x40')]);var _0x29c148={'where':_0x52f919[_0xe723('0x39')]};return db[_0xe723('0x2b')]['count'](_0x29c148)['then'](function(_0x105233){_0x511c74[_0xe723('0x1d')]=_0x105233;if(_0x2925bc[_0xe723('0x2e')][_0xe723('0x41')]){_0x52f919['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xe723('0x42')](_0x52f919);})[_0xe723('0x24')](function(_0x24909){_0x511c74[_0xe723('0x43')]=_0x24909;return _0x511c74;})[_0xe723('0x24')](respondWithFilteredResult(_0x52feb9,_0x52f919))[_0xe723('0x44')](handleError(_0x52feb9,null));};exports[_0xe723('0x45')]=function(_0x2b74d5,_0x637b5f){var _0x5b0c89={'raw':!![],'where':{'id':_0x2b74d5[_0xe723('0x46')]['id']}},_0x490993={};_0x490993['model']=_['keys'](db[_0xe723('0x2b')]['rawAttributes']);_0x490993[_0xe723('0x2e')]=_[_0xe723('0x2f')](_0x2b74d5[_0xe723('0x2e')]);_0x490993[_0xe723('0x3b')]=_[_0xe723('0x32')](_0x490993[_0xe723('0x30')],_0x490993[_0xe723('0x2e')]);_0x5b0c89['attributes']=_['intersection'](_0x490993[_0xe723('0x30')],qs['fields'](_0x2b74d5[_0xe723('0x2e')]['fields']));_0x5b0c89[_0xe723('0x31')]=_0x5b0c89[_0xe723('0x31')][_0xe723('0x34')]?_0x5b0c89[_0xe723('0x31')]:_0x490993[_0xe723('0x30')];if(_0x2b74d5[_0xe723('0x2e')][_0xe723('0x41')]){_0x5b0c89[_0xe723('0x47')]=[{'all':!![]}];}_0x5b0c89=_[_0xe723('0x3d')]({},_0x5b0c89,_0x2b74d5['options']);return db['ChatOfflineMessage'][_0xe723('0x48')](_0x5b0c89)[_0xe723('0x24')](handleEntityNotFound(_0x637b5f,null))[_0xe723('0x24')](respondWithResult(_0x637b5f,null))['catch'](handleError(_0x637b5f,null));};exports['create']=function(_0x5a4612,_0xf25d94){return db[_0xe723('0x2b')][_0xe723('0x49')](_0x5a4612['body'],{})[_0xe723('0x24')](respondWithResult(_0xf25d94,0xc9))[_0xe723('0x44')](handleError(_0xf25d94,null));};exports[_0xe723('0x4a')]=function(_0x38bd1a,_0x15bfd0){if(_0x38bd1a['body']['id']){delete _0x38bd1a[_0xe723('0x4b')]['id'];}return db['ChatOfflineMessage'][_0xe723('0x48')]({'where':{'id':_0x38bd1a['params']['id']}})['then'](handleEntityNotFound(_0x15bfd0,null))[_0xe723('0x24')](saveUpdates(_0x38bd1a[_0xe723('0x4b')],null))[_0xe723('0x24')](respondWithResult(_0x15bfd0,null))['catch'](handleError(_0x15bfd0,null));};exports[_0xe723('0x25')]=function(_0x505966,_0x467cbd){return db[_0xe723('0x2b')][_0xe723('0x48')]({'where':{'id':_0x505966[_0xe723('0x46')]['id']}})[_0xe723('0x24')](handleEntityNotFound(_0x467cbd,null))[_0xe723('0x24')](removeEntity(_0x467cbd,null))[_0xe723('0x44')](handleError(_0x467cbd,null));};exports[_0xe723('0x4c')]=function(_0x1bf58b,_0x51eaa2){return db[_0xe723('0x2b')][_0xe723('0x4c')]()['then'](respondWithResult(_0x51eaa2,null))[_0xe723('0x44')](handleError(_0x51eaa2,null));}; \ No newline at end of file +var _0xd101=['name','send','index','ChatOfflineMessage','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','describe','html-pdf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error'];(function(_0x1389e8,_0x971f55){var _0x114191=function(_0x54304e){while(--_0x54304e){_0x1389e8['push'](_0x1389e8['shift']());}};_0x114191(++_0x971f55);}(_0xd101,0xc1));var _0x1d10=function(_0xbf4b27,_0x1d08d3){_0xbf4b27=_0xbf4b27-0x0;var _0x46c7df=_0xd101[_0xbf4b27];return _0x46c7df;};'use strict';var pdf=require(_0x1d10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d10('0x1'));var zipdir=require(_0x1d10('0x2'));var jsonpatch=require(_0x1d10('0x3'));var rp=require(_0x1d10('0x4'));var moment=require(_0x1d10('0x5'));var BPromise=require(_0x1d10('0x6'));var Mustache=require(_0x1d10('0x7'));var util=require(_0x1d10('0x8'));var path=require('path');var sox=require(_0x1d10('0x9'));var csv=require(_0x1d10('0xa'));var ejs=require(_0x1d10('0xb'));var fs=require('fs');var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0xa'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var db=require(_0x1d10('0x1b'))['db'];function respondWithStatusCode(_0x190d4c,_0x268506){_0x268506=_0x268506||0xcc;return function(_0x5b71d8){if(_0x5b71d8){return _0x190d4c[_0x1d10('0x1c')](_0x268506);}return _0x190d4c[_0x1d10('0x1d')](_0x268506)[_0x1d10('0x1e')]();};}function respondWithResult(_0x2b7c35,_0x2224ff){_0x2224ff=_0x2224ff||0xc8;return function(_0x183bc4){if(_0x183bc4){return _0x2b7c35['status'](_0x2224ff)[_0x1d10('0x1f')](_0x183bc4);}};}function respondWithFilteredResult(_0x556f27,_0x306953){return function(_0x2ad3c0){if(_0x2ad3c0){var _0x4f014a=_0x2ad3c0[_0x1d10('0x20')],_0x3aedf7=_0x306953[_0x1d10('0x21')],_0x3fe555=_0x306953[_0x1d10('0x21')]+_0x306953[_0x1d10('0x22')],_0x41152c;if(_0x3fe555>=_0x4f014a){_0x3fe555=_0x4f014a;_0x41152c=0xc8;}else{_0x41152c=0xce;}_0x556f27['status'](_0x41152c);return _0x556f27[_0x1d10('0x23')](_0x1d10('0x24'),_0x3aedf7+'-'+_0x3fe555+'/'+_0x4f014a)[_0x1d10('0x1f')](_0x2ad3c0);}return null;};}function patchUpdates(_0xd4a7ca){return function(_0x42e1a8){try{jsonpatch['apply'](_0x42e1a8,_0xd4a7ca,!![]);}catch(_0x47d4e2){return BPromise[_0x1d10('0x25')](_0x47d4e2);}return _0x42e1a8['save']();};}function saveUpdates(_0x4b94db,_0x5774f9){return function(_0x237b92){if(_0x237b92){return _0x237b92[_0x1d10('0x26')](_0x4b94db)[_0x1d10('0x27')](function(_0x250395){return _0x250395;});}return null;};}function removeEntity(_0x4ce84a,_0x5e5315){return function(_0x140147){if(_0x140147){return _0x140147['destroy']()[_0x1d10('0x27')](function(){_0x4ce84a[_0x1d10('0x1d')](0xcc)[_0x1d10('0x1e')]();});}};}function handleEntityNotFound(_0x37f22d,_0x127b37){return function(_0x3601ba){if(!_0x3601ba){_0x37f22d[_0x1d10('0x1c')](0x194);}return _0x3601ba;};}function handleError(_0x3af06d,_0x4168e){_0x4168e=_0x4168e||0x1f4;return function(_0x84055f){logger[_0x1d10('0x28')](_0x84055f['stack']);if(_0x84055f[_0x1d10('0x29')]){delete _0x84055f[_0x1d10('0x29')];}_0x3af06d[_0x1d10('0x1d')](_0x4168e)[_0x1d10('0x2a')](_0x84055f);};}exports[_0x1d10('0x2b')]=function(_0x3bffbe,_0x38f583){var _0xaa8ab6={},_0x4f7837={},_0x355e10={'count':0x0,'rows':[]};var _0x24eb47=_['map'](db[_0x1d10('0x2c')]['rawAttributes'],function(_0x4db221){return{'name':_0x4db221[_0x1d10('0x2d')],'type':_0x4db221['type'][_0x1d10('0x2e')]};});_0x4f7837[_0x1d10('0x2f')]=_[_0x1d10('0x30')](_0x24eb47,_0x1d10('0x29'));_0x4f7837[_0x1d10('0x31')]=_[_0x1d10('0x32')](_0x3bffbe['query']);_0x4f7837['filters']=_[_0x1d10('0x33')](_0x4f7837[_0x1d10('0x2f')],_0x4f7837[_0x1d10('0x31')]);_0xaa8ab6[_0x1d10('0x34')]=_[_0x1d10('0x33')](_0x4f7837[_0x1d10('0x2f')],qs[_0x1d10('0x35')](_0x3bffbe[_0x1d10('0x31')][_0x1d10('0x35')]));_0xaa8ab6[_0x1d10('0x34')]=_0xaa8ab6['attributes'][_0x1d10('0x36')]?_0xaa8ab6['attributes']:_0x4f7837[_0x1d10('0x2f')];if(!_0x3bffbe[_0x1d10('0x31')]['hasOwnProperty'](_0x1d10('0x37'))){_0xaa8ab6['limit']=qs[_0x1d10('0x22')](_0x3bffbe[_0x1d10('0x31')][_0x1d10('0x22')]);_0xaa8ab6[_0x1d10('0x21')]=qs[_0x1d10('0x21')](_0x3bffbe['query']['offset']);}_0xaa8ab6[_0x1d10('0x38')]=qs[_0x1d10('0x39')](_0x3bffbe[_0x1d10('0x31')]['sort']);_0xaa8ab6['where']=qs['filters'](_[_0x1d10('0x3a')](_0x3bffbe['query'],_0x4f7837[_0x1d10('0x3b')]),_0x24eb47);if(_0x3bffbe[_0x1d10('0x31')][_0x1d10('0x3c')]){_0xaa8ab6[_0x1d10('0x3d')]=_['merge'](_0xaa8ab6['where'],{'$or':_[_0x1d10('0x30')](_0x24eb47,function(_0x13049a){if(_0x13049a[_0x1d10('0x3e')]!==_0x1d10('0x3f')){var _0x549e83={};_0x549e83[_0x13049a[_0x1d10('0x29')]]={'$like':'%'+_0x3bffbe['query'][_0x1d10('0x3c')]+'%'};return _0x549e83;}})});}_0xaa8ab6=_[_0x1d10('0x40')]({},_0xaa8ab6,_0x3bffbe[_0x1d10('0x41')]);var _0x8d8405={'where':_0xaa8ab6[_0x1d10('0x3d')]};return db[_0x1d10('0x2c')][_0x1d10('0x20')](_0x8d8405)[_0x1d10('0x27')](function(_0x1a5126){_0x355e10[_0x1d10('0x20')]=_0x1a5126;if(_0x3bffbe[_0x1d10('0x31')][_0x1d10('0x42')]){_0xaa8ab6[_0x1d10('0x43')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0xaa8ab6);})[_0x1d10('0x27')](function(_0x3267c5){_0x355e10[_0x1d10('0x44')]=_0x3267c5;return _0x355e10;})[_0x1d10('0x27')](respondWithFilteredResult(_0x38f583,_0xaa8ab6))[_0x1d10('0x45')](handleError(_0x38f583,null));};exports[_0x1d10('0x46')]=function(_0x1ab775,_0x4ebd4a){var _0x1a67e9={'raw':!![],'where':{'id':_0x1ab775[_0x1d10('0x47')]['id']}},_0xf1fc47={};_0xf1fc47['model']=_[_0x1d10('0x32')](db[_0x1d10('0x2c')][_0x1d10('0x48')]);_0xf1fc47['query']=_['keys'](_0x1ab775[_0x1d10('0x31')]);_0xf1fc47[_0x1d10('0x3b')]=_[_0x1d10('0x33')](_0xf1fc47[_0x1d10('0x2f')],_0xf1fc47[_0x1d10('0x31')]);_0x1a67e9[_0x1d10('0x34')]=_[_0x1d10('0x33')](_0xf1fc47['model'],qs[_0x1d10('0x35')](_0x1ab775[_0x1d10('0x31')]['fields']));_0x1a67e9[_0x1d10('0x34')]=_0x1a67e9['attributes'][_0x1d10('0x36')]?_0x1a67e9['attributes']:_0xf1fc47['model'];if(_0x1ab775[_0x1d10('0x31')][_0x1d10('0x42')]){_0x1a67e9[_0x1d10('0x43')]=[{'all':!![]}];}_0x1a67e9=_[_0x1d10('0x40')]({},_0x1a67e9,_0x1ab775[_0x1d10('0x41')]);return db[_0x1d10('0x2c')][_0x1d10('0x49')](_0x1a67e9)[_0x1d10('0x27')](handleEntityNotFound(_0x4ebd4a,null))[_0x1d10('0x27')](respondWithResult(_0x4ebd4a,null))['catch'](handleError(_0x4ebd4a,null));};exports['create']=function(_0x1ce4e9,_0x38bcba){return db[_0x1d10('0x2c')][_0x1d10('0x4a')](_0x1ce4e9[_0x1d10('0x4b')],{})[_0x1d10('0x27')](respondWithResult(_0x38bcba,0xc9))['catch'](handleError(_0x38bcba,null));};exports[_0x1d10('0x26')]=function(_0x1b8513,_0x304342){if(_0x1b8513[_0x1d10('0x4b')]['id']){delete _0x1b8513[_0x1d10('0x4b')]['id'];}return db[_0x1d10('0x2c')][_0x1d10('0x49')]({'where':{'id':_0x1b8513[_0x1d10('0x47')]['id']}})[_0x1d10('0x27')](handleEntityNotFound(_0x304342,null))[_0x1d10('0x27')](saveUpdates(_0x1b8513[_0x1d10('0x4b')],null))[_0x1d10('0x27')](respondWithResult(_0x304342,null))[_0x1d10('0x45')](handleError(_0x304342,null));};exports[_0x1d10('0x4c')]=function(_0x5ebe57,_0x560b6f){return db[_0x1d10('0x2c')]['find']({'where':{'id':_0x5ebe57['params']['id']}})[_0x1d10('0x27')](handleEntityNotFound(_0x560b6f,null))[_0x1d10('0x27')](removeEntity(_0x560b6f,null))[_0x1d10('0x45')](handleError(_0x560b6f,null));};exports[_0x1d10('0x4d')]=function(_0x2f9542,_0x5a9250){return db['ChatOfflineMessage']['describe']()['then'](respondWithResult(_0x5a9250,null))[_0x1d10('0x45')](handleError(_0x5a9250,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 514eaf5..a17c05a 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 _0xf873=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf873,0xb2));var _0x3f87=function(_0x350c9d,_0x2b5aa3){_0x350c9d=_0x350c9d-0x0;var _0x3f5e8e=_0xf873[_0x350c9d];return _0x3f5e8e;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var fs=require('fs');var path=require(_0x3f87('0x6'));var rimraf=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x3f87('0x9')]=function(_0x43c8e4,_0x27c03e){return _0x43c8e4['define'](_0x3f87('0xa'),attributes,{'tableName':_0x3f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f87('0xc'),'collate':_0x3f87('0xd')});}; \ No newline at end of file +var _0x207c=['bluebird','request-promise','path','../../config/environment','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x5382dd,_0x2b4157){var _0x55758e=function(_0x206b7d){while(--_0x206b7d){_0x5382dd['push'](_0x5382dd['shift']());}};_0x55758e(++_0x2b4157);}(_0x207c,0x1e8));var _0xc207=function(_0x5759e0,_0x31984b){_0x5759e0=_0x5759e0-0x0;var _0x1a64cd=_0x207c[_0x5759e0];return _0x1a64cd;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc207('0xa'),'collate':_0xc207('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 925ead6..32daa1e 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 _0x7440=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7440,0xb5));var _0x0744=function(_0x431ddc,_0x50f976){_0x431ddc=_0x431ddc-0x0;var _0x461e22=_0x7440[_0x431ddc];return _0x461e22;};'use strict';var _=require(_0x0744('0x0'));var util=require(_0x0744('0x1'));var moment=require(_0x0744('0x2'));var BPromise=require('bluebird');var rs=require(_0x0744('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0744('0x4'))['db'];var utils=require(_0x0744('0x5'));var logger=require('../../config/logger')(_0x0744('0x6'));var config=require('../../config/environment');var jayson=require(_0x0744('0x7'));var client=jayson[_0x0744('0x8')][_0x0744('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec06e,_0x3fbe38,_0x82ba73){return new BPromise(function(_0x6c6d8d,_0x220f23){return client['request'](_0x1ec06e,_0x82ba73)['then'](function(_0x377e5e){logger[_0x0744('0xa')](_0x0744('0xb'),_0x3fbe38,_0x0744('0xc'));logger['debug'](_0x0744('0xd'),_0x3fbe38,_0x0744('0xc'),JSON[_0x0744('0xe')](_0x377e5e));if(_0x377e5e[_0x0744('0xf')]){if(_0x377e5e['error']['code']===0x1f4){logger[_0x0744('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3fbe38,_0x377e5e[_0x0744('0xf')]['message']);return _0x220f23(_0x377e5e['error'][_0x0744('0x10')]);}logger[_0x0744('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3fbe38,_0x377e5e['error'][_0x0744('0x10')]);return _0x6c6d8d(_0x377e5e[_0x0744('0xf')][_0x0744('0x10')]);}else{logger[_0x0744('0xa')](_0x0744('0xb'),_0x3fbe38,_0x0744('0xc'));_0x6c6d8d(_0x377e5e['result'][_0x0744('0x10')]);}})[_0x0744('0x11')](function(_0x457d07){logger[_0x0744('0xf')](_0x0744('0xb'),_0x3fbe38,_0x457d07);_0x220f23(_0x457d07);});});} \ No newline at end of file +var _0x5f54=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x22f061,_0x2604c2){var _0x3b3ec9=function(_0x296cd4){while(--_0x296cd4){_0x22f061['push'](_0x22f061['shift']());}};_0x3b3ec9(++_0x2604c2);}(_0x5f54,0xe7));var _0x45f5=function(_0x580bab,_0x319f08){_0x580bab=_0x580bab-0x0;var _0x53e7e7=_0x5f54[_0x580bab];return _0x53e7e7;};'use strict';var _=require(_0x45f5('0x0'));var util=require(_0x45f5('0x1'));var moment=require(_0x45f5('0x2'));var BPromise=require(_0x45f5('0x3'));var rs=require(_0x45f5('0x4'));var fs=require('fs');var Redis=require(_0x45f5('0x5'));var db=require(_0x45f5('0x6'))['db'];var utils=require(_0x45f5('0x7'));var logger=require(_0x45f5('0x8'))(_0x45f5('0x9'));var config=require('../../config/environment');var jayson=require(_0x45f5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e69af,_0x503332,_0x6819b9){return new BPromise(function(_0x56daf7,_0x31a223){return client['request'](_0x2e69af,_0x6819b9)[_0x45f5('0xb')](function(_0x3efac5){logger[_0x45f5('0xc')](_0x45f5('0xd'),_0x503332,_0x45f5('0xe'));logger['debug'](_0x45f5('0xf'),_0x503332,'request\x20sent',JSON['stringify'](_0x3efac5));if(_0x3efac5[_0x45f5('0x10')]){if(_0x3efac5[_0x45f5('0x10')][_0x45f5('0x11')]===0x1f4){logger[_0x45f5('0x10')](_0x45f5('0xd'),_0x503332,_0x3efac5['error']['message']);return _0x31a223(_0x3efac5[_0x45f5('0x10')][_0x45f5('0x12')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x503332,_0x3efac5[_0x45f5('0x10')][_0x45f5('0x12')]);return _0x56daf7(_0x3efac5[_0x45f5('0x10')][_0x45f5('0x12')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x503332,_0x45f5('0xe'));_0x56daf7(_0x3efac5[_0x45f5('0x13')][_0x45f5('0x12')]);}})[_0x45f5('0x14')](function(_0x4fd50f){logger['error'](_0x45f5('0xd'),_0x503332,_0x4fd50f);_0x31a223(_0x4fd50f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 9669b4b..4a9a091 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 _0xb0eb=['../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xb0eb,0x151));var _0xbb0e=function(_0x2d0a25,_0x3d5ee0){_0x2d0a25=_0x2d0a25-0x0;var _0x5266ea=_0xb0eb[_0x2d0a25];return _0x5266ea;};'use strict';var multer=require(_0xbb0e('0x0'));var util=require(_0xbb0e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb0e('0x2'));var router=express[_0xbb0e('0x3')]();var auth=require(_0xbb0e('0x4'));var interaction=require(_0xbb0e('0x5'));var config=require('../../config/environment');var controller=require(_0xbb0e('0x6'));router[_0xbb0e('0x7')]('/',auth[_0xbb0e('0x8')](),controller[_0xbb0e('0x9')]);router['get']('/describe',auth[_0xbb0e('0x8')](),controller[_0xbb0e('0xa')]);router[_0xbb0e('0x7')](_0xbb0e('0xb'),auth[_0xbb0e('0x8')](),controller[_0xbb0e('0xc')]);router[_0xbb0e('0xd')]('/',auth[_0xbb0e('0x8')](),controller[_0xbb0e('0xe')]);router[_0xbb0e('0xf')](_0xbb0e('0xb'),auth[_0xbb0e('0x8')](),controller[_0xbb0e('0x10')]);router['delete'](_0xbb0e('0xb'),auth['isAuthenticated'](),controller[_0xbb0e('0x11')]);module[_0xbb0e('0x12')]=router; \ No newline at end of file +var _0x2476=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x535e90,_0x52d9d7){var _0x2cb1ac=function(_0x36fc69){while(--_0x36fc69){_0x535e90['push'](_0x535e90['shift']());}};_0x2cb1ac(++_0x52d9d7);}(_0x2476,0x1a2));var _0x6247=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2476[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6247('0x0'));var util=require(_0x6247('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6247('0x2'));var router=express[_0x6247('0x3')]();var auth=require(_0x6247('0x4'));var interaction=require(_0x6247('0x5'));var config=require(_0x6247('0x6'));var controller=require(_0x6247('0x7'));router[_0x6247('0x8')]('/',auth[_0x6247('0x9')](),controller[_0x6247('0xa')]);router[_0x6247('0x8')](_0x6247('0xb'),auth['isAuthenticated'](),controller[_0x6247('0xc')]);router[_0x6247('0x8')](_0x6247('0xd'),auth[_0x6247('0x9')](),controller['show']);router[_0x6247('0xe')]('/',auth[_0x6247('0x9')](),controller[_0x6247('0xf')]);router[_0x6247('0x10')](_0x6247('0xd'),auth['isAuthenticated'](),controller[_0x6247('0x11')]);router[_0x6247('0x12')]('/:id',auth[_0x6247('0x9')](),controller[_0x6247('0x13')]);module[_0x6247('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3e1fdc0..1c1525a 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 _0x14b9=['STRING','ENUM','timeout','mouseOver','INTEGER','sequelize','exports'];(function(_0x48c9fe,_0x5f0300){var _0x540658=function(_0x47cb66){while(--_0x47cb66){_0x48c9fe['push'](_0x48c9fe['shift']());}};_0x540658(++_0x5f0300);}(_0x14b9,0x98));var _0x914b=function(_0x157e57,_0x30b9f0){_0x157e57=_0x157e57-0x0;var _0x20db26=_0x14b9[_0x157e57];return _0x20db26;};'use strict';var Sequelize=require(_0x914b('0x0'));module[_0x914b('0x1')]={'name':{'type':Sequelize[_0x914b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x914b('0x3')]('mouseOver',_0x914b('0x4')),'defaultValue':_0x914b('0x5')},'selector':{'type':Sequelize[_0x914b('0x2')]},'timeout':{'type':Sequelize[_0x914b('0x6')]}}; \ No newline at end of file +var _0x2050=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x2050,0x180));var _0x0205=function(_0x32560c,_0x1bc9ee){_0x32560c=_0x32560c-0x0;var _0x4f2c2c=_0x2050[_0x32560c];return _0x4f2c2c;};'use strict';var Sequelize=require(_0x0205('0x0'));module[_0x0205('0x1')]={'name':{'type':Sequelize[_0x0205('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0205('0x3')](_0x0205('0x4'),_0x0205('0x5')),'defaultValue':_0x0205('0x4')},'selector':{'type':Sequelize[_0x0205('0x2')]},'timeout':{'type':Sequelize[_0x0205('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 95f2aa2..62ded95 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 _0x9c44=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','catch','create','ChatProactiveAction','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs'];(function(_0xc91ccd,_0x28f968){var _0x28c08e=function(_0x593eef){while(--_0x593eef){_0xc91ccd['push'](_0xc91ccd['shift']());}};_0x28c08e(++_0x28f968);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){_0x2197d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2263ae,_0x15581b){return function(_0x26c640){if(!_0x26c640){_0x2263ae[_0x49c4('0x14')](0x194);}return _0x26c640;};}function handleError(_0x4811c4,_0x5850f2){_0x5850f2=_0x5850f2||0x1f4;return function(_0x180276){logger[_0x49c4('0x21')](_0x180276['stack']);if(_0x180276[_0x49c4('0x22')]){delete _0x180276[_0x49c4('0x22')];}_0x4811c4[_0x49c4('0x16')](_0x5850f2)[_0x49c4('0x23')](_0x180276);};}exports['show']=function(_0x543ea2,_0x449960){var _0x53c199={'raw':!![],'where':{'id':_0x543ea2[_0x49c4('0x24')]['id']}},_0x3800b7={};_0x3800b7[_0x49c4('0x25')]=_[_0x49c4('0x26')](db['ChatProactiveAction'][_0x49c4('0x27')]);_0x3800b7[_0x49c4('0x28')]=_[_0x49c4('0x26')](_0x543ea2[_0x49c4('0x28')]);_0x3800b7[_0x49c4('0x29')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],_0x3800b7[_0x49c4('0x28')]);_0x53c199[_0x49c4('0x2b')]=_[_0x49c4('0x2a')](_0x3800b7[_0x49c4('0x25')],qs['fields'](_0x543ea2['query']['fields']));_0x53c199[_0x49c4('0x2b')]=_0x53c199[_0x49c4('0x2b')][_0x49c4('0x2c')]?_0x53c199[_0x49c4('0x2b')]:_0x3800b7[_0x49c4('0x25')];if(_0x543ea2['query'][_0x49c4('0x2d')]){_0x53c199[_0x49c4('0x2e')]=[{'all':!![]}];}_0x53c199=_[_0x49c4('0x2f')]({},_0x53c199,_0x543ea2[_0x49c4('0x30')]);return db['ChatProactiveAction']['find'](_0x53c199)[_0x49c4('0x20')](handleEntityNotFound(_0x449960,null))[_0x49c4('0x20')](respondWithResult(_0x449960,null))[_0x49c4('0x31')](handleError(_0x449960,null));};exports[_0x49c4('0x32')]=function(_0xd38540,_0x4a0c7a){return db[_0x49c4('0x33')][_0x49c4('0x32')](_0xd38540[_0x49c4('0x34')],{})['then'](respondWithResult(_0x4a0c7a,0xc9))['catch'](handleError(_0x4a0c7a,null));};exports[_0x49c4('0x1f')]=function(_0x1991e9,_0x3bec0a){if(_0x1991e9[_0x49c4('0x34')]['id']){delete _0x1991e9[_0x49c4('0x34')]['id'];}return db[_0x49c4('0x33')][_0x49c4('0x35')]({'where':{'id':_0x1991e9[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x3bec0a,null))['then'](saveUpdates(_0x1991e9[_0x49c4('0x34')],null))['then'](respondWithResult(_0x3bec0a,null))[_0x49c4('0x31')](handleError(_0x3bec0a,null));};exports[_0x49c4('0x36')]=function(_0x2625a6,_0x1c2830){return db['ChatProactiveAction'][_0x49c4('0x35')]({'where':{'id':_0x2625a6[_0x49c4('0x24')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x1c2830,null))['then'](removeEntity(_0x1c2830,null))[_0x49c4('0x31')](handleError(_0x1c2830,null));}; \ No newline at end of file +var _0xcb91=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','length','includeAll','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xcb91[_0x313c96];return _0x522f53;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['show']=function(_0xd6891c,_0x21effa){var _0x41a9a0={'raw':!![],'where':{'id':_0xd6891c[_0x1cb9('0x26')]['id']}},_0x1804fd={};_0x1804fd[_0x1cb9('0x27')]=_[_0x1cb9('0x28')](db[_0x1cb9('0x29')][_0x1cb9('0x2a')]);_0x1804fd[_0x1cb9('0x2b')]=_['keys'](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2c')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2d')]=_[_0x1cb9('0x2c')](_0x1804fd[_0x1cb9('0x27')],qs['fields'](_0xd6891c[_0x1cb9('0x2b')]['fields']));_0x41a9a0[_0x1cb9('0x2d')]=_0x41a9a0[_0x1cb9('0x2d')][_0x1cb9('0x2e')]?_0x41a9a0['attributes']:_0x1804fd[_0x1cb9('0x27')];if(_0xd6891c['query'][_0x1cb9('0x2f')]){_0x41a9a0['include']=[{'all':!![]}];}_0x41a9a0=_[_0x1cb9('0x30')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x31')]);return db[_0x1cb9('0x29')][_0x1cb9('0x32')](_0x41a9a0)['then'](handleEntityNotFound(_0x21effa,null))[_0x1cb9('0x1f')](respondWithResult(_0x21effa,null))[_0x1cb9('0x33')](handleError(_0x21effa,null));};exports[_0x1cb9('0x34')]=function(_0x91a1db,_0xc6784c){return db[_0x1cb9('0x29')][_0x1cb9('0x34')](_0x91a1db[_0x1cb9('0x35')],{})[_0x1cb9('0x1f')](respondWithResult(_0xc6784c,0xc9))[_0x1cb9('0x33')](handleError(_0xc6784c,null));};exports[_0x1cb9('0x36')]=function(_0x26b950,_0x29f149){if(_0x26b950['body']['id']){delete _0x26b950['body']['id'];}return db[_0x1cb9('0x29')][_0x1cb9('0x32')]({'where':{'id':_0x26b950[_0x1cb9('0x26')]['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x29f149,null))[_0x1cb9('0x1f')](saveUpdates(_0x26b950[_0x1cb9('0x35')],null))[_0x1cb9('0x1f')](respondWithResult(_0x29f149,null))[_0x1cb9('0x33')](handleError(_0x29f149,null));};exports['destroy']=function(_0x2aa59b,_0x1482c4){return db[_0x1cb9('0x29')]['find']({'where':{'id':_0x2aa59b[_0x1cb9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1482c4,null))[_0x1cb9('0x1f')](removeEntity(_0x1482c4,null))['catch'](handleError(_0x1482c4,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d902ed7..5617129 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 _0x2b10=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x2ef608,_0x53a7b1){var _0x56aa07=function(_0x318e2b){while(--_0x318e2b){_0x2ef608['push'](_0x2ef608['shift']());}};_0x56aa07(++_0x53a7b1);}(_0x2b10,0xa4));var _0x02b1=function(_0x4d4c21,_0x1f8ed0){_0x4d4c21=_0x4d4c21-0x0;var _0x36e683=_0x2b10[_0x4d4c21];return _0x36e683;};'use strict';var _=require('lodash');var util=require(_0x02b1('0x0'));var logger=require(_0x02b1('0x1'))(_0x02b1('0x2'));var moment=require(_0x02b1('0x3'));var BPromise=require(_0x02b1('0x4'));var rp=require(_0x02b1('0x5'));var fs=require('fs');var path=require(_0x02b1('0x6'));var rimraf=require(_0x02b1('0x7'));var config=require(_0x02b1('0x8'));var attributes=require(_0x02b1('0x9'));module[_0x02b1('0xa')]=function(_0x121657,_0x54bfe1){return _0x121657['define'](_0x02b1('0xb'),attributes,{'tableName':_0x02b1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x293b=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x293b,0x1b4));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb293('0x0'));var util=require('util');var logger=require(_0xb293('0x1'))(_0xb293('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb293('0x3'));var fs=require('fs');var path=require(_0xb293('0x4'));var rimraf=require(_0xb293('0x5'));var config=require(_0xb293('0x6'));var attributes=require(_0xb293('0x7'));module[_0xb293('0x8')]=function(_0x428202,_0x2ab585){return _0x428202[_0xb293('0x9')](_0xb293('0xa'),attributes,{'tableName':_0xb293('0xb'),'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 03a35f6..a994b2e 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 _0xe0c0=['http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x381900,_0x2d2804){var _0x54da53=function(_0x56d214){while(--_0x56d214){_0x381900['push'](_0x381900['shift']());}};_0x54da53(++_0x2d2804);}(_0xe0c0,0xe8));var _0x0e0c=function(_0x1a91f8,_0xc4c9cc){_0x1a91f8=_0x1a91f8-0x0;var _0x466288=_0xe0c0[_0x1a91f8];return _0x466288;};'use strict';var _=require('lodash');var util=require(_0x0e0c('0x0'));var moment=require(_0x0e0c('0x1'));var BPromise=require(_0x0e0c('0x2'));var rs=require(_0x0e0c('0x3'));var fs=require('fs');var Redis=require(_0x0e0c('0x4'));var db=require(_0x0e0c('0x5'))['db'];var utils=require(_0x0e0c('0x6'));var logger=require(_0x0e0c('0x7'))(_0x0e0c('0x8'));var config=require('../../config/environment');var jayson=require(_0x0e0c('0x9'));var client=jayson['client'][_0x0e0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cbcc7,_0x443215,_0x3c7a95){return new BPromise(function(_0x514f5b,_0x30b4c7){return client[_0x0e0c('0xb')](_0x2cbcc7,_0x3c7a95)[_0x0e0c('0xc')](function(_0x44f6b4){logger[_0x0e0c('0xd')](_0x0e0c('0xe'),_0x443215,_0x0e0c('0xf'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x443215,'request\x20sent',JSON[_0x0e0c('0x10')](_0x44f6b4));if(_0x44f6b4[_0x0e0c('0x11')]){if(_0x44f6b4[_0x0e0c('0x11')][_0x0e0c('0x12')]===0x1f4){logger[_0x0e0c('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x443215,_0x44f6b4[_0x0e0c('0x11')][_0x0e0c('0x13')]);return _0x30b4c7(_0x44f6b4[_0x0e0c('0x11')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x443215,_0x44f6b4[_0x0e0c('0x11')][_0x0e0c('0x13')]);return _0x514f5b(_0x44f6b4['error']['message']);}else{logger[_0x0e0c('0xd')](_0x0e0c('0xe'),_0x443215,'request\x20sent');_0x514f5b(_0x44f6b4[_0x0e0c('0x14')][_0x0e0c('0x13')]);}})[_0x0e0c('0x15')](function(_0x5d5f2c){logger[_0x0e0c('0x11')](_0x0e0c('0xe'),_0x443215,_0x5d5f2c);_0x30b4c7(_0x5d5f2c);});});} \ No newline at end of file +var _0x20f0=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x2f6136,_0x27b599){var _0x1d9243=function(_0x1b9004){while(--_0x1b9004){_0x2f6136['push'](_0x2f6136['shift']());}};_0x1d9243(++_0x27b599);}(_0x20f0,0x72));var _0x020f=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x20f0[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x020f('0x0'));var util=require(_0x020f('0x1'));var moment=require(_0x020f('0x2'));var BPromise=require(_0x020f('0x3'));var rs=require(_0x020f('0x4'));var fs=require('fs');var Redis=require(_0x020f('0x5'));var db=require(_0x020f('0x6'))['db'];var utils=require(_0x020f('0x7'));var logger=require(_0x020f('0x8'))(_0x020f('0x9'));var config=require(_0x020f('0xa'));var jayson=require(_0x020f('0xb'));var client=jayson[_0x020f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cce07,_0x23fcc2,_0x36c237){return new BPromise(function(_0x218c8b,_0x45ca31){return client[_0x020f('0xd')](_0x2cce07,_0x36c237)[_0x020f('0xe')](function(_0x478dd1){logger[_0x020f('0xf')](_0x020f('0x10'),_0x23fcc2,_0x020f('0x11'));logger[_0x020f('0x12')](_0x020f('0x13'),_0x23fcc2,_0x020f('0x11'),JSON[_0x020f('0x14')](_0x478dd1));if(_0x478dd1[_0x020f('0x15')]){if(_0x478dd1[_0x020f('0x15')][_0x020f('0x16')]===0x1f4){logger[_0x020f('0x15')](_0x020f('0x10'),_0x23fcc2,_0x478dd1[_0x020f('0x15')][_0x020f('0x17')]);return _0x45ca31(_0x478dd1[_0x020f('0x15')][_0x020f('0x17')]);}logger['error'](_0x020f('0x10'),_0x23fcc2,_0x478dd1[_0x020f('0x15')][_0x020f('0x17')]);return _0x218c8b(_0x478dd1['error'][_0x020f('0x17')]);}else{logger[_0x020f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x23fcc2,_0x020f('0x11'));_0x218c8b(_0x478dd1[_0x020f('0x18')][_0x020f('0x17')]);}})[_0x020f('0x19')](function(_0x132361){logger[_0x020f('0x15')](_0x020f('0x10'),_0x23fcc2,_0x132361);_0x45ca31(_0x132361);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index c7f3e77..9f77f71 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 _0x544f=['get','/:id','isAuthenticated','show','create','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5d951c,_0x22a120){var _0x4d2053=function(_0x1f1f8a){while(--_0x1f1f8a){_0x5d951c['push'](_0x5d951c['shift']());}};_0x4d2053(++_0x22a120);}(_0x544f,0xbc));var _0xf544=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x544f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf544('0x0'));var util=require(_0xf544('0x1'));var path=require(_0xf544('0x2'));var timeout=require('connect-timeout');var express=require(_0xf544('0x3'));var router=express[_0xf544('0x4')]();var auth=require(_0xf544('0x5'));var interaction=require(_0xf544('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0xf544('0x7')](_0xf544('0x8'),auth[_0xf544('0x9')](),controller[_0xf544('0xa')]);router['post']('/',auth[_0xf544('0x9')](),controller[_0xf544('0xb')]);router['put'](_0xf544('0x8'),auth[_0xf544('0x9')](),controller['update']);router[_0xf544('0xc')](_0xf544('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0c94=['create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x0c94,0x7a));var _0x40c9=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0c94[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x40c9('0x0'));var util=require(_0x40c9('0x1'));var path=require(_0x40c9('0x2'));var timeout=require(_0x40c9('0x3'));var express=require(_0x40c9('0x4'));var router=express[_0x40c9('0x5')]();var auth=require(_0x40c9('0x6'));var interaction=require(_0x40c9('0x7'));var config=require(_0x40c9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0x40c9('0x9')](_0x40c9('0xa'),auth['isAuthenticated'](),controller[_0x40c9('0xb')]);router[_0x40c9('0xc')]('/',auth[_0x40c9('0xd')](),controller[_0x40c9('0xe')]);router[_0x40c9('0xf')](_0x40c9('0xa'),auth['isAuthenticated'](),controller[_0x40c9('0x10')]);router['delete']('/:id',auth[_0x40c9('0xd')](),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 9e8c03f..553b056 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 _0x1cb0=['rrmemory','beepall','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x480849,_0x26e305){var _0x5e72fd=function(_0x46503b){while(--_0x46503b){_0x480849['push'](_0x480849['shift']());}};_0x5e72fd(++_0x26e305);}(_0x1cb0,0x1b5));var _0x01cb=function(_0x1b6ac8,_0x4c90f2){_0x1b6ac8=_0x1b6ac8-0x0;var _0x36bec8=_0x1cb0[_0x1b6ac8];return _0x36bec8;};'use strict';var Sequelize=require('sequelize');module[_0x01cb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01cb('0x1')]},'timeout':{'type':Sequelize[_0x01cb('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01cb('0x3')](_0x01cb('0x4'),_0x01cb('0x5'),_0x01cb('0x6'))}}; \ No newline at end of file +var _0xa750=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3ccb1a,_0x4d78cc){var _0x4661fb=function(_0x5dd024){while(--_0x5dd024){_0x3ccb1a['push'](_0x3ccb1a['shift']());}};_0x4661fb(++_0x4d78cc);}(_0xa750,0x15e));var _0x0a75=function(_0x4158c7,_0x23c429){_0x4158c7=_0x4158c7-0x0;var _0x985677=_0xa750[_0x4158c7];return _0x985677;};'use strict';var Sequelize=require(_0x0a75('0x0'));module[_0x0a75('0x1')]={'name':{'type':Sequelize[_0x0a75('0x2')],'unique':_0x0a75('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0a75('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0a75('0x4')](_0x0a75('0x5'),_0x0a75('0x6'),_0x0a75('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 98235b0..597c5a0 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 _0x76de=['error','message','info','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','name','send','index','map','ChatQueue','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','filter','options','rows','params','filters','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','getAgents','html-pdf','eml-format','rimraf','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','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','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0x76de,0x193));var _0xe76d=function(_0x137655,_0x2a8c11){_0x137655=_0x137655-0x0;var _0x4326ce=_0x76de[_0x137655];return _0x4326ce;};'use strict';var pdf=require(_0xe76d('0x0'));var emlformat=require(_0xe76d('0x1'));var rimraf=require(_0xe76d('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('mustache');var util=require(_0xe76d('0x3'));var path=require(_0xe76d('0x4'));var sox=require(_0xe76d('0x5'));var csv=require(_0xe76d('0x6'));var ejs=require(_0xe76d('0x7'));var fs=require('fs');var _=require(_0xe76d('0x8'));var squel=require(_0xe76d('0x9'));var crypto=require(_0xe76d('0xa'));var jsforce=require(_0xe76d('0xb'));var deskjs=require(_0xe76d('0xc'));var toCsv=require(_0xe76d('0x6'));var querystring=require('querystring');var Papa=require(_0xe76d('0xd'));var Redis=require(_0xe76d('0xe'));var authService=require(_0xe76d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe76d('0x10'));var hardwareService=require(_0xe76d('0x11'));var logger=require('../../config/logger')(_0xe76d('0x12'));var utils=require(_0xe76d('0x13'));var config=require(_0xe76d('0x14'));var db=require(_0xe76d('0x15'))['db'];config[_0xe76d('0x16')]=_['defaults'](config['redis'],{'host':_0xe76d('0x17'),'port':0x18eb});var socket=require(_0xe76d('0x18'))(new Redis(config[_0xe76d('0x16')]));require('./chatQueue.socket')[_0xe76d('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe76d('0x1a')][_0xe76d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x10ba7c,_0x8e1802,_0x886490){if(_0x886490){var _0x26e193=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26e193[_0xe76d('0x1c')](_0x8e1802)){return _0x10ba7c;}else{throw new db['Sequelize'][(_0xe76d('0x1d'))](_0xe76d('0x1e'));}}else{return _0x10ba7c;}}function respondWithRpcPromise(_0x4feb4d,_0x455b49,_0x6c52bf,_0x439a64){return new BPromise(function(_0xbe25e1,_0x51f6a6){var _0x373db5=_0x439a64||client;return _0x373db5[_0xe76d('0x1f')](_0x4feb4d,_0x6c52bf)[_0xe76d('0x20')](function(_0x3c97f8){logger['info'](_0xe76d('0x21'),_0x455b49,_0xe76d('0x22'));logger[_0xe76d('0x23')](_0xe76d('0x24'),_0x455b49,_0xe76d('0x22'),JSON[_0xe76d('0x25')](_0x3c97f8));if(_0x3c97f8[_0xe76d('0x26')]){if(_0x3c97f8[_0xe76d('0x26')]['code']===0x1f4){logger[_0xe76d('0x26')](_0xe76d('0x21'),_0x455b49,_0x3c97f8['error'][_0xe76d('0x27')]);return _0x51f6a6(_0x3c97f8[_0xe76d('0x26')][_0xe76d('0x27')]);}logger[_0xe76d('0x26')]('ChatQueue,\x20%s,\x20%s',_0x455b49,_0x3c97f8[_0xe76d('0x26')]['message']);return _0xbe25e1(_0x3c97f8[_0xe76d('0x26')]['message']);}else{logger[_0xe76d('0x28')]('ChatQueue,\x20%s,\x20%s',_0x455b49,_0xe76d('0x22'));_0xbe25e1(_0x3c97f8[_0xe76d('0x29')][_0xe76d('0x27')]);}})[_0xe76d('0x2a')](function(_0x40eb97){logger['error'](_0xe76d('0x21'),_0x455b49,_0x40eb97);_0x51f6a6(_0x40eb97);});});}function respondWithStatusCode(_0x23a0cd,_0x2a6b90){_0x2a6b90=_0x2a6b90||0xcc;return function(_0x2db5a7){if(_0x2db5a7){return _0x23a0cd[_0xe76d('0x2b')](_0x2a6b90);}return _0x23a0cd[_0xe76d('0x2c')](_0x2a6b90)[_0xe76d('0x2d')]();};}function respondWithResult(_0x31246d,_0x40a17e){_0x40a17e=_0x40a17e||0xc8;return function(_0x3a99b6){if(_0x3a99b6){return _0x31246d[_0xe76d('0x2c')](_0x40a17e)[_0xe76d('0x2e')](_0x3a99b6);}};}function respondWithFilteredResult(_0x2d6c15,_0x5827ec){return function(_0x3b9702){if(_0x3b9702){var _0x3719a2=_0x3b9702[_0xe76d('0x2f')],_0x2feedb=_0x5827ec['offset'],_0x52db50=_0x5827ec['offset']+_0x5827ec[_0xe76d('0x30')],_0x4b6811;if(_0x52db50>=_0x3719a2){_0x52db50=_0x3719a2;_0x4b6811=0xc8;}else{_0x4b6811=0xce;}_0x2d6c15['status'](_0x4b6811);return _0x2d6c15[_0xe76d('0x31')](_0xe76d('0x32'),_0x2feedb+'-'+_0x52db50+'/'+_0x3719a2)['json'](_0x3b9702);}return null;};}function patchUpdates(_0x57b163){return function(_0x3e8b49){try{jsonpatch[_0xe76d('0x33')](_0x3e8b49,_0x57b163,!![]);}catch(_0x1a53f3){return BPromise[_0xe76d('0x34')](_0x1a53f3);}return _0x3e8b49[_0xe76d('0x35')]();};}function saveUpdates(_0x305c2e,_0x1732e5){return function(_0x35d26){if(_0x35d26){return _0x35d26[_0xe76d('0x36')](_0x305c2e)['then'](function(_0x2604cb){return _0x2604cb;});}return null;};}function removeEntity(_0x34f1b9,_0x465744){return function(_0x2a5a7d){if(_0x2a5a7d){return _0x2a5a7d[_0xe76d('0x37')]()[_0xe76d('0x20')](function(){var _0x1b244a=_0x2a5a7d[_0xe76d('0x38')]({'plain':!![]});var _0x945bb6=_0xe76d('0x39');return db['UserProfileResource'][_0xe76d('0x37')]({'where':{'type':_0x945bb6,'resourceId':_0x1b244a['id']}})['then'](function(){return _0x2a5a7d;});})['then'](function(){_0x34f1b9['status'](0xcc)[_0xe76d('0x2d')]();});}};}function handleEntityNotFound(_0x20440d,_0x131e0e){return function(_0x1e9594){if(!_0x1e9594){_0x20440d[_0xe76d('0x2b')](0x194);}return _0x1e9594;};}function handleError(_0x609e43,_0x326c88){_0x326c88=_0x326c88||0x1f4;return function(_0x5e9840){logger[_0xe76d('0x26')](_0x5e9840['stack']);if(_0x5e9840['name']){delete _0x5e9840[_0xe76d('0x3a')];}_0x609e43[_0xe76d('0x2c')](_0x326c88)[_0xe76d('0x3b')](_0x5e9840);};}exports[_0xe76d('0x3c')]=function(_0x51ac93,_0x35f04a){var _0x58aa25={},_0x17af10={},_0x967d1c={'count':0x0,'rows':[]};var _0x4f9596=_[_0xe76d('0x3d')](db[_0xe76d('0x3e')][_0xe76d('0x3f')],function(_0x1d2d6e){return{'name':_0x1d2d6e['fieldName'],'type':_0x1d2d6e[_0xe76d('0x40')]['key']};});_0x17af10[_0xe76d('0x41')]=_[_0xe76d('0x3d')](_0x4f9596,_0xe76d('0x3a'));_0x17af10[_0xe76d('0x42')]=_[_0xe76d('0x43')](_0x51ac93[_0xe76d('0x42')]);_0x17af10['filters']=_[_0xe76d('0x44')](_0x17af10['model'],_0x17af10[_0xe76d('0x42')]);_0x58aa25[_0xe76d('0x45')]=_[_0xe76d('0x44')](_0x17af10[_0xe76d('0x41')],qs[_0xe76d('0x46')](_0x51ac93[_0xe76d('0x42')][_0xe76d('0x46')]));_0x58aa25[_0xe76d('0x45')]=_0x58aa25['attributes'][_0xe76d('0x47')]?_0x58aa25[_0xe76d('0x45')]:_0x17af10[_0xe76d('0x41')];if(!_0x51ac93[_0xe76d('0x42')]['hasOwnProperty'](_0xe76d('0x48'))){_0x58aa25['limit']=qs['limit'](_0x51ac93[_0xe76d('0x42')][_0xe76d('0x30')]);_0x58aa25[_0xe76d('0x49')]=qs[_0xe76d('0x49')](_0x51ac93[_0xe76d('0x42')][_0xe76d('0x49')]);}_0x58aa25[_0xe76d('0x4a')]=qs[_0xe76d('0x4b')](_0x51ac93[_0xe76d('0x42')][_0xe76d('0x4b')]);_0x58aa25[_0xe76d('0x4c')]=qs['filters'](_[_0xe76d('0x4d')](_0x51ac93[_0xe76d('0x42')],_0x17af10['filters']),_0x4f9596);if(_0x51ac93[_0xe76d('0x42')]['filter']){_0x58aa25[_0xe76d('0x4c')]=_[_0xe76d('0x4e')](_0x58aa25[_0xe76d('0x4c')],{'$or':_[_0xe76d('0x3d')](_0x4f9596,function(_0x289e5e){if(_0x289e5e[_0xe76d('0x40')]!=='VIRTUAL'){var _0x33e4d0={};_0x33e4d0[_0x289e5e[_0xe76d('0x3a')]]={'$like':'%'+_0x51ac93['query'][_0xe76d('0x4f')]+'%'};return _0x33e4d0;}})});}_0x58aa25=_[_0xe76d('0x4e')]({},_0x58aa25,_0x51ac93[_0xe76d('0x50')]);var _0x4ba507={'where':_0x58aa25[_0xe76d('0x4c')]};return db[_0xe76d('0x3e')][_0xe76d('0x2f')](_0x4ba507)[_0xe76d('0x20')](function(_0x3556ac){_0x967d1c['count']=_0x3556ac;if(_0x51ac93[_0xe76d('0x42')]['includeAll']){_0x58aa25['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x58aa25);})[_0xe76d('0x20')](function(_0x23e961){_0x967d1c[_0xe76d('0x51')]=_0x23e961;return _0x967d1c;})[_0xe76d('0x20')](respondWithFilteredResult(_0x35f04a,_0x58aa25))[_0xe76d('0x2a')](handleError(_0x35f04a,null));};exports['show']=function(_0x565280,_0x119423){var _0x52ef89={'raw':!![],'where':{'id':_0x565280[_0xe76d('0x52')]['id']}},_0x4b6d61={};_0x4b6d61[_0xe76d('0x41')]=_[_0xe76d('0x43')](db[_0xe76d('0x3e')][_0xe76d('0x3f')]);_0x4b6d61['query']=_[_0xe76d('0x43')](_0x565280[_0xe76d('0x42')]);_0x4b6d61[_0xe76d('0x53')]=_[_0xe76d('0x44')](_0x4b6d61[_0xe76d('0x41')],_0x4b6d61[_0xe76d('0x42')]);_0x52ef89['attributes']=_[_0xe76d('0x44')](_0x4b6d61[_0xe76d('0x41')],qs[_0xe76d('0x46')](_0x565280[_0xe76d('0x42')]['fields']));_0x52ef89[_0xe76d('0x45')]=_0x52ef89[_0xe76d('0x45')][_0xe76d('0x47')]?_0x52ef89['attributes']:_0x4b6d61['model'];if(_0x565280['query']['includeAll']){_0x52ef89[_0xe76d('0x54')]=[{'all':!![]}];}_0x52ef89=_[_0xe76d('0x4e')]({},_0x52ef89,_0x565280[_0xe76d('0x50')]);return db[_0xe76d('0x3e')][_0xe76d('0x55')](_0x52ef89)[_0xe76d('0x20')](handleEntityNotFound(_0x119423,null))[_0xe76d('0x20')](respondWithResult(_0x119423,null))[_0xe76d('0x2a')](handleError(_0x119423,null));};exports[_0xe76d('0x56')]=function(_0x535acc,_0x28c6a2){return db[_0xe76d('0x3e')]['create'](_0x535acc[_0xe76d('0x57')],{})[_0xe76d('0x20')](function(_0x1a16ab){var _0x1be1c0=_0x535acc[_0xe76d('0x58')][_0xe76d('0x38')]({'plain':!![]});if(!_0x1be1c0)throw new Error(_0xe76d('0x59'));if(_0x1be1c0[_0xe76d('0x5a')]==='user'){var _0x30ad30=_0x1a16ab['get']({'plain':!![]});var _0x250b28='ChatQueues';return db[_0xe76d('0x5b')]['find']({'where':{'name':_0x250b28,'userProfileId':_0x1be1c0[_0xe76d('0x5c')]},'raw':!![]})['then'](function(_0x36f821){if(_0x36f821&&_0x36f821['autoAssociation']===0x0){return db['UserProfileResource'][_0xe76d('0x56')]({'name':_0x30ad30[_0xe76d('0x3a')],'resourceId':_0x30ad30['id'],'type':_0x36f821['name'],'sectionId':_0x36f821['id']},{})[_0xe76d('0x20')](function(){return _0x1a16ab;});}else{return _0x1a16ab;}})[_0xe76d('0x2a')](function(_0x16dd70){logger[_0xe76d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16dd70);throw _0x16dd70;});}return _0x1a16ab;})[_0xe76d('0x20')](respondWithResult(_0x28c6a2,0xc9))['catch'](handleError(_0x28c6a2,null));};exports[_0xe76d('0x36')]=function(_0x4a801a,_0x828b04){if(_0x4a801a['body']['id']){delete _0x4a801a[_0xe76d('0x57')]['id'];}return db[_0xe76d('0x3e')][_0xe76d('0x55')]({'where':{'id':_0x4a801a[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x828b04,null))[_0xe76d('0x20')](saveUpdates(_0x4a801a[_0xe76d('0x57')],null))[_0xe76d('0x20')](respondWithResult(_0x828b04,null))[_0xe76d('0x2a')](handleError(_0x828b04,null));};exports['destroy']=function(_0xda9646,_0x418abd){return db[_0xe76d('0x3e')][_0xe76d('0x55')]({'where':{'id':_0xda9646[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x418abd,null))[_0xe76d('0x20')](removeEntity(_0x418abd,null))[_0xe76d('0x2a')](handleError(_0x418abd,null));};exports[_0xe76d('0x5d')]=function(_0x46e313,_0x905bf8){return db[_0xe76d('0x3e')][_0xe76d('0x5d')]()[_0xe76d('0x20')](respondWithResult(_0x905bf8,null))[_0xe76d('0x2a')](handleError(_0x905bf8,null));};exports['getMembers']=function(_0x360b1a,_0x2171dc,_0xf66ffb){var _0x160c2c={'raw':!![],'where':{}},_0xece815={},_0x3439f9;return db['ChatQueue'][_0xe76d('0x5e')]({'where':{'id':_0x360b1a[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x2171dc,null))[_0xe76d('0x20')](function(_0x5626a1){if(_0x5626a1){_0x3439f9=_0x5626a1[_0xe76d('0x38')]({'plain':!![]});_0xece815['model']=_['keys'](db[_0xe76d('0x5f')][_0xe76d('0x3f')]);_0xece815['query']=_[_0xe76d('0x43')](_0x360b1a[_0xe76d('0x42')]);_0xece815[_0xe76d('0x53')]=_['intersection'](_0xece815['model'],_0xece815[_0xe76d('0x42')]);_0x160c2c['attributes']=_[_0xe76d('0x44')](_0xece815['model'],qs['fields'](_0x360b1a[_0xe76d('0x42')]['fields']));_0x160c2c['attributes']=_0x160c2c[_0xe76d('0x45')]['length']?_0x160c2c[_0xe76d('0x45')]:_0xece815['model'];if(!_0x360b1a[_0xe76d('0x42')][_0xe76d('0x60')](_0xe76d('0x48'))){_0x160c2c[_0xe76d('0x30')]=qs[_0xe76d('0x30')](_0x360b1a[_0xe76d('0x42')][_0xe76d('0x30')]);_0x160c2c[_0xe76d('0x49')]=qs[_0xe76d('0x49')](_0x360b1a[_0xe76d('0x42')][_0xe76d('0x49')]);}_0x160c2c[_0xe76d('0x4a')]=qs[_0xe76d('0x4b')](_0x360b1a[_0xe76d('0x42')][_0xe76d('0x4b')]);_0x160c2c['where']=qs['filters'](_[_0xe76d('0x4d')](_0x360b1a[_0xe76d('0x42')],_0xece815[_0xe76d('0x53')]));_0x160c2c[_0xe76d('0x4c')][_0xe76d('0x61')]=_0x5626a1['id'];if(_0x360b1a['query']['filter']){_0x160c2c[_0xe76d('0x4c')]=_[_0xe76d('0x4e')](_0x160c2c[_0xe76d('0x4c')],{'$or':_[_0xe76d('0x3d')](_0x160c2c['attributes'],function(_0x5cbcc9){var _0x5a1d7c={};_0x5a1d7c[_0x5cbcc9]={'$like':'%'+_0x360b1a[_0xe76d('0x42')][_0xe76d('0x4f')]+'%'};return _0x5a1d7c;})});}_0x160c2c=_[_0xe76d('0x4e')]({},_0x160c2c,_0x360b1a[_0xe76d('0x50')]);return db[_0xe76d('0x5f')][_0xe76d('0x62')](_0x160c2c);}})['then'](function(_0x16e82a){if(_0x16e82a){return db[_0xe76d('0x63')][_0xe76d('0x64')]({'where':{'id':_[_0xe76d('0x3d')](_0x16e82a,_0xe76d('0x65')),'role':_0xe76d('0x66')},'attributes':['id',_0xe76d('0x3a'),_0xe76d('0x67'),_0xe76d('0x68'),_0xe76d('0x69')]});}})[_0xe76d('0x20')](function(_0x1bd729){if(_0x1bd729){return{'count':_0x1bd729[_0xe76d('0x2f')],'rows':_[_0xe76d('0x3d')](_0x1bd729['rows'],function(_0x4e4bfc){return{'membername':_0x4e4bfc['name'],'UserId':_0x4e4bfc['id'],'queue_name':_0x3439f9[_0xe76d('0x3a')],'ChatQueueId':_0x3439f9['id'],'interface':util['format'](_0xe76d('0x6a'),_0xe76d('0x6b'),_0x4e4bfc[_0xe76d('0x3a')]),'penalty':0x0,'paused':_0x4e4bfc[_0xe76d('0x67')],'createdAt':_0x4e4bfc[_0xe76d('0x69')],'updatedAt':_0x4e4bfc[_0xe76d('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe76d('0x20')](respondWithFilteredResult(_0x2171dc,_0x160c2c))['catch'](handleError(_0x2171dc,null));};exports[_0xe76d('0x6c')]=function(_0x3e9dc0,_0x216b94,_0x447fb9){var _0x63246f={};var _0x48c587={};var _0x3dd014;var _0x5b248c;return db[_0xe76d('0x3e')][_0xe76d('0x5e')]({'where':{'id':_0x3e9dc0[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x216b94,null))[_0xe76d('0x20')](function(_0x2565a6){if(_0x2565a6){_0x3dd014=_0x2565a6;_0x48c587['model']=_['keys'](db[_0xe76d('0x6d')]['rawAttributes']);_0x48c587[_0xe76d('0x42')]=_['keys'](_0x3e9dc0[_0xe76d('0x42')]);_0x48c587[_0xe76d('0x53')]=_[_0xe76d('0x44')](_0x48c587[_0xe76d('0x41')],_0x48c587[_0xe76d('0x42')]);_0x63246f[_0xe76d('0x45')]=_[_0xe76d('0x44')](_0x48c587[_0xe76d('0x41')],qs[_0xe76d('0x46')](_0x3e9dc0['query'][_0xe76d('0x46')]));_0x63246f[_0xe76d('0x45')]=_0x63246f['attributes'][_0xe76d('0x47')]?_0x63246f['attributes']:_0x48c587[_0xe76d('0x41')];_0x63246f['order']=qs[_0xe76d('0x4b')](_0x3e9dc0[_0xe76d('0x42')][_0xe76d('0x4b')]);_0x63246f[_0xe76d('0x4c')]=qs[_0xe76d('0x53')](_['pick'](_0x3e9dc0[_0xe76d('0x42')],_0x48c587['filters']));if(_0x3e9dc0[_0xe76d('0x42')]['filter']){_0x63246f['where']=_[_0xe76d('0x4e')](_0x63246f[_0xe76d('0x4c')],{'$or':_['map'](_0x63246f[_0xe76d('0x45')],function(_0x502e14){var _0x4e5b36={};_0x4e5b36[_0x502e14]={'$like':'%'+_0x3e9dc0['query'][_0xe76d('0x4f')]+'%'};return _0x4e5b36;})});}_0x63246f=_[_0xe76d('0x4e')]({},_0x63246f,_0x3e9dc0[_0xe76d('0x50')]);return _0x3dd014[_0xe76d('0x6c')](_0x63246f);}})['then'](function(_0x4a42df){if(_0x4a42df){_0x5b248c=_0x4a42df['length'];if(!_0x3e9dc0[_0xe76d('0x42')][_0xe76d('0x60')](_0xe76d('0x48'))){_0x63246f[_0xe76d('0x30')]=qs[_0xe76d('0x30')](_0x3e9dc0[_0xe76d('0x42')]['limit']);_0x63246f[_0xe76d('0x49')]=qs[_0xe76d('0x49')](_0x3e9dc0[_0xe76d('0x42')][_0xe76d('0x49')]);}return _0x3dd014[_0xe76d('0x6c')](_0x63246f);}})[_0xe76d('0x20')](function(_0x1ac0f0){if(_0x1ac0f0){return _0x1ac0f0?{'count':_0x5b248c,'rows':_0x1ac0f0}:null;}})[_0xe76d('0x20')](respondWithResult(_0x216b94,null))['catch'](handleError(_0x216b94,null));};exports[_0xe76d('0x6e')]=function(_0x4ed1a4,_0x462d78,_0x5acc9c){var _0x1ea84e=_0x4ed1a4[_0xe76d('0x57')][_0xe76d('0x6f')];return db[_0xe76d('0x6d')][_0xe76d('0x62')]({'where':{'id':_0x1ea84e},'attributes':['id'],'include':[{'model':db[_0xe76d('0x63')],'as':_0xe76d('0x70'),'attributes':['id','name','online',_0xe76d('0x71'),_0xe76d('0x72')],'raw':!![]}]})[_0xe76d('0x20')](function(_0x2bade6){if(_0x2bade6){var _0x11ac23=_[_0xe76d('0x73')](_0x2bade6,function(_0x523e3d){var _0x43a016=_0x523e3d[_0xe76d('0x38')]({'plain':!![]});return _0x43a016[_0xe76d('0x70')];});return db[_0xe76d('0x3e')]['find']({'where':{'id':_0x4ed1a4['params']['id']}})['then'](function(_0x24c7e4){return db[_0xe76d('0x74')][_0xe76d('0x75')](function(_0x490b9d){return _0x24c7e4[_0xe76d('0x6e')](_0x1ea84e,{'transaction':_0x490b9d})[_0xe76d('0x20')](function(){return BPromise[_0xe76d('0x76')](_0x11ac23,function(_0x23ac6e){return db[_0xe76d('0x5f')]['findOrCreate']({'where':{'UserId':_0x23ac6e['id'],'ChatQueueId':_0x4ed1a4['params']['id']},'transaction':_0x490b9d});});})[_0xe76d('0x20')](function(){_0x11ac23[_0xe76d('0x77')](function(_0x328063){socket[_0xe76d('0x78')]('userChatQueue:save',{'UserId':_0x328063['id'],'ChatQueueId':_0x24c7e4['id']});});});});});}})['then'](respondWithStatusCode(_0x462d78,null))[_0xe76d('0x2a')](handleError(_0x462d78,null));};exports[_0xe76d('0x79')]=function(_0x5e9b26,_0x35b4d0,_0x32b27d){return db[_0xe76d('0x6d')][_0xe76d('0x62')]({'where':{'id':_0x5e9b26[_0xe76d('0x42')][_0xe76d('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xe76d('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35b4d0,null))[_0xe76d('0x20')](function(_0x29c8f9){var _0x5193c9=_['map'](_0x29c8f9,'id');var _0x302570=[];var _0x343057=[];var _0x5c8bfb=squel[_0xe76d('0x7a')]();_0x5c8bfb[_0xe76d('0x7b')](_0xe76d('0x7c'))[_0xe76d('0x7d')]('team_has_chat_queues','tq')[_0xe76d('0x7e')](_0xe76d('0x7f'),'ut',_0xe76d('0x80'))[_0xe76d('0x4c')](_0xe76d('0x81'),_0x5e9b26[_0xe76d('0x52')]['id']);for(var _0x12c55e=0x0;_0x12c55e<_0x29c8f9[_0xe76d('0x47')];_0x12c55e+=0x1){let _0x38ed25=_0x29c8f9[_0x12c55e];for(var _0x305563=0x0;_0x305563<_0x38ed25['Agents']['length'];_0x305563+=0x1){let _0x2d20e5=_0x38ed25['Agents'][_0x305563];var _0x40eecf=_0x5c8bfb[_0xe76d('0x82')]();_0x40eecf[_0xe76d('0x4c')]('ut.UserId\x20=\x20?',_0x2d20e5['id']);_0x343057['push'](db[_0xe76d('0x74')][_0xe76d('0x42')](_0x40eecf[_0xe76d('0x83')](),{'type':db[_0xe76d('0x74')][_0xe76d('0x84')][_0xe76d('0x85')]})[_0xe76d('0x20')](function(_0x1dcfdd){if(_0x1dcfdd['length']===0x1){return _0x2d20e5['id'];}else{var _0x45a316=_[_0xe76d('0x86')](_['map'](_0x1dcfdd,_0xe76d('0x87')),function(_0xd22d77){return _[_0xe76d('0x88')](_0x5193c9,_0xd22d77);});if(_0x45a316){return _0x2d20e5['id'];}}}));}}return BPromise[_0xe76d('0x89')](_0x343057)[_0xe76d('0x20')](function(_0x1e8934){_0x302570=_(_0x302570)[_0xe76d('0x8a')](_0x1e8934)[_0xe76d('0x8b')]()['value']();return db[_0xe76d('0x3e')]['find']({'where':{'id':_0x5e9b26[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](function(_0x302209){return db[_0xe76d('0x74')][_0xe76d('0x75')](function(_0x20c815){return _0x302209[_0xe76d('0x79')](_0x5e9b26['query']['ids'],{'transaction':_0x20c815})['then'](function(){if(!_[_0xe76d('0x8c')](_0x302570)){return _0x302209[_0xe76d('0x8d')](_0x302570,{'transaction':_0x20c815});}})[_0xe76d('0x20')](function(){_0x302570[_0xe76d('0x77')](function(_0x1c34da){socket[_0xe76d('0x78')](_0xe76d('0x8e'),{'UserId':_0x1c34da,'ChatQueueId':_0x302209['id']});});});});});});})[_0xe76d('0x20')](respondWithStatusCode(_0x35b4d0,null))['catch'](handleError(_0x35b4d0,null));};exports['addAgents']=function(_0x15110f,_0x1ed94f,_0x19a85a){return db[_0xe76d('0x3e')][_0xe76d('0x55')]({'where':{'id':_0x15110f[_0xe76d('0x52')]['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x1ed94f,null))[_0xe76d('0x20')](function(_0x1cf426){if(_0x1cf426){return _0x1cf426[_0xe76d('0x8f')](_0x15110f[_0xe76d('0x57')][_0xe76d('0x6f')],_['omit'](_0x15110f[_0xe76d('0x57')],['ids','id'])||{})[_0xe76d('0x90')](function(_0x5310f4){for(var _0x4fdcda=0x0;_0x4fdcda<_0x15110f[_0xe76d('0x57')]['ids'][_0xe76d('0x47')];_0x4fdcda+=0x1){socket['emit'](_0xe76d('0x91'),{'UserId':_0x15110f[_0xe76d('0x57')][_0xe76d('0x6f')][_0x4fdcda],'ChatQueueId':_0x15110f['params']['id']});}return _0x5310f4;});}})[_0xe76d('0x20')](respondWithResult(_0x1ed94f,null))[_0xe76d('0x2a')](handleError(_0x1ed94f,null));};exports[_0xe76d('0x8d')]=function(_0x2f1452,_0x24c0ae,_0x4ca438){return db['ChatQueue']['find']({'where':{'id':_0x2f1452['params']['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x24c0ae,null))['then'](function(_0x3e1e02){if(_0x3e1e02){return _0x3e1e02[_0xe76d('0x8d')](_0x2f1452[_0xe76d('0x42')][_0xe76d('0x6f')])['then'](function(){if(_['isArray'](_0x2f1452[_0xe76d('0x42')][_0xe76d('0x6f')])){for(var _0x9a9bc1=0x0;_0x9a9bc1<_0x2f1452[_0xe76d('0x42')]['ids'][_0xe76d('0x47')];_0x9a9bc1+=0x1){socket['emit'](_0xe76d('0x8e'),{'UserId':Number(_0x2f1452[_0xe76d('0x42')][_0xe76d('0x6f')][_0x9a9bc1]),'ChatQueueId':Number(_0x2f1452[_0xe76d('0x52')]['id'])});}}else{socket[_0xe76d('0x78')]('userChatQueue:remove',{'UserId':Number(_0x2f1452[_0xe76d('0x42')][_0xe76d('0x6f')]),'ChatQueueId':Number(_0x2f1452[_0xe76d('0x52')]['id'])});}});}})[_0xe76d('0x20')](respondWithStatusCode(_0x24c0ae,null))[_0xe76d('0x2a')](handleError(_0x24c0ae,null));};exports[_0xe76d('0x92')]=function(_0x4539c1,_0x44cae2,_0x1217f6){var _0x38dab2={};var _0x455af5={};var _0x59b22f;var _0x4a8547;return db[_0xe76d('0x3e')]['findOne']({'where':{'id':_0x4539c1['params']['id']}})[_0xe76d('0x20')](handleEntityNotFound(_0x44cae2,null))['then'](function(_0x22c21d){if(_0x22c21d){_0x59b22f=_0x22c21d;_0x455af5[_0xe76d('0x41')]=_['keys'](db[_0xe76d('0x63')]['rawAttributes']);_0x455af5[_0xe76d('0x42')]=_[_0xe76d('0x43')](_0x4539c1[_0xe76d('0x42')]);_0x455af5['filters']=_[_0xe76d('0x44')](_0x455af5[_0xe76d('0x41')],_0x455af5[_0xe76d('0x42')]);_0x38dab2[_0xe76d('0x45')]=_[_0xe76d('0x44')](_0x455af5['model'],qs[_0xe76d('0x46')](_0x4539c1['query'][_0xe76d('0x46')]));_0x38dab2[_0xe76d('0x45')]=_0x38dab2['attributes']['length']?_0x38dab2[_0xe76d('0x45')]:_0x455af5[_0xe76d('0x41')];_0x38dab2[_0xe76d('0x4a')]=qs[_0xe76d('0x4b')](_0x4539c1[_0xe76d('0x42')]['sort']);_0x38dab2[_0xe76d('0x4c')]=qs[_0xe76d('0x53')](_['pick'](_0x4539c1['query'],_0x455af5['filters']));if(_0x4539c1[_0xe76d('0x42')][_0xe76d('0x4f')]){_0x38dab2['where']=_[_0xe76d('0x4e')](_0x38dab2[_0xe76d('0x4c')],{'$or':_[_0xe76d('0x3d')](_0x38dab2[_0xe76d('0x45')],function(_0x45bd12){var _0xa8b07c={};_0xa8b07c[_0x45bd12]={'$like':'%'+_0x4539c1[_0xe76d('0x42')][_0xe76d('0x4f')]+'%'};return _0xa8b07c;})});}_0x38dab2=_[_0xe76d('0x4e')]({},_0x38dab2,_0x4539c1[_0xe76d('0x50')]);return _0x59b22f[_0xe76d('0x92')](_0x38dab2);}})[_0xe76d('0x20')](function(_0x32d5d7){if(_0x32d5d7){_0x4a8547=_0x32d5d7[_0xe76d('0x47')];if(!_0x4539c1[_0xe76d('0x42')][_0xe76d('0x60')](_0xe76d('0x48'))){_0x38dab2['limit']=qs[_0xe76d('0x30')](_0x4539c1[_0xe76d('0x42')]['limit']);_0x38dab2['offset']=qs[_0xe76d('0x49')](_0x4539c1[_0xe76d('0x42')][_0xe76d('0x49')]);}return _0x59b22f[_0xe76d('0x92')](_0x38dab2);}})['then'](function(_0xc8b38b){if(_0xc8b38b){return _0xc8b38b?{'count':_0x4a8547,'rows':_0xc8b38b}:null;}})['then'](respondWithResult(_0x44cae2,null))[_0xe76d('0x2a')](handleError(_0x44cae2,null));}; \ No newline at end of file +var _0x5ca2=['ids','online','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','hasOwnProperty','pick','User','findAndCountAll','agent','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','addTeams'];(function(_0xcdb9ef,_0x2e0083){var _0x2f7741=function(_0x429e37){while(--_0x429e37){_0xcdb9ef['push'](_0xcdb9ef['shift']());}};_0x2f7741(++_0x2e0083);}(_0x5ca2,0x158));var _0x25ca=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5ca2[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x25ca('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x25ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25ca('0x2'));var rp=require(_0x25ca('0x3'));var moment=require('moment');var BPromise=require(_0x25ca('0x4'));var Mustache=require('mustache');var util=require(_0x25ca('0x5'));var path=require(_0x25ca('0x6'));var sox=require(_0x25ca('0x7'));var csv=require(_0x25ca('0x8'));var ejs=require(_0x25ca('0x9'));var fs=require('fs');var _=require(_0x25ca('0xa'));var squel=require(_0x25ca('0xb'));var crypto=require(_0x25ca('0xc'));var jsforce=require(_0x25ca('0xd'));var deskjs=require(_0x25ca('0xe'));var toCsv=require('to-csv');var querystring=require(_0x25ca('0xf'));var Papa=require(_0x25ca('0x10'));var Redis=require(_0x25ca('0x11'));var authService=require(_0x25ca('0x12'));var qs=require(_0x25ca('0x13'));var as=require(_0x25ca('0x14'));var hardwareService=require(_0x25ca('0x15'));var logger=require('../../config/logger')(_0x25ca('0x16'));var utils=require(_0x25ca('0x17'));var config=require(_0x25ca('0x18'));var db=require(_0x25ca('0x19'))['db'];config[_0x25ca('0x1a')]=_['defaults'](config[_0x25ca('0x1a')],{'host':_0x25ca('0x1b'),'port':0x18eb});var socket=require(_0x25ca('0x1c'))(new Redis(config[_0x25ca('0x1a')]));require(_0x25ca('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x25ca('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x446365,_0x425cf1,_0x4b4d19){if(_0x4b4d19){var _0x11250f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11250f['test'](_0x425cf1)){return _0x446365;}else{throw new db[(_0x25ca('0x1f'))][(_0x25ca('0x20'))](_0x25ca('0x21'));}}else{return _0x446365;}}function respondWithRpcPromise(_0x42dcff,_0x5e7acb,_0x1874b8,_0x1465db){return new BPromise(function(_0x200850,_0x542cc6){var _0x1576a7=_0x1465db||client;return _0x1576a7['request'](_0x42dcff,_0x1874b8)['then'](function(_0x4523e3){logger[_0x25ca('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5e7acb,_0x25ca('0x23'));logger[_0x25ca('0x24')](_0x25ca('0x25'),_0x5e7acb,'request\x20sent',JSON[_0x25ca('0x26')](_0x4523e3));if(_0x4523e3[_0x25ca('0x27')]){if(_0x4523e3[_0x25ca('0x27')]['code']===0x1f4){logger[_0x25ca('0x27')](_0x25ca('0x28'),_0x5e7acb,_0x4523e3[_0x25ca('0x27')][_0x25ca('0x29')]);return _0x542cc6(_0x4523e3[_0x25ca('0x27')]['message']);}logger[_0x25ca('0x27')](_0x25ca('0x28'),_0x5e7acb,_0x4523e3[_0x25ca('0x27')][_0x25ca('0x29')]);return _0x200850(_0x4523e3[_0x25ca('0x27')]['message']);}else{logger[_0x25ca('0x22')](_0x25ca('0x28'),_0x5e7acb,'request\x20sent');_0x200850(_0x4523e3[_0x25ca('0x2a')][_0x25ca('0x29')]);}})[_0x25ca('0x2b')](function(_0x459300){logger['error'](_0x25ca('0x28'),_0x5e7acb,_0x459300);_0x542cc6(_0x459300);});});}function respondWithStatusCode(_0x2726c1,_0x5afdf8){_0x5afdf8=_0x5afdf8||0xcc;return function(_0x3ab933){if(_0x3ab933){return _0x2726c1[_0x25ca('0x2c')](_0x5afdf8);}return _0x2726c1[_0x25ca('0x2d')](_0x5afdf8)[_0x25ca('0x2e')]();};}function respondWithResult(_0x3bffc7,_0x3d3254){_0x3d3254=_0x3d3254||0xc8;return function(_0x20cbb1){if(_0x20cbb1){return _0x3bffc7[_0x25ca('0x2d')](_0x3d3254)[_0x25ca('0x2f')](_0x20cbb1);}};}function respondWithFilteredResult(_0x4cb15c,_0x39ee84){return function(_0x53013a){if(_0x53013a){var _0x333bf5=_0x53013a['count'],_0x2c7f24=_0x39ee84[_0x25ca('0x30')],_0x5dd45d=_0x39ee84[_0x25ca('0x30')]+_0x39ee84[_0x25ca('0x31')],_0x55271b;if(_0x5dd45d>=_0x333bf5){_0x5dd45d=_0x333bf5;_0x55271b=0xc8;}else{_0x55271b=0xce;}_0x4cb15c[_0x25ca('0x2d')](_0x55271b);return _0x4cb15c[_0x25ca('0x32')](_0x25ca('0x33'),_0x2c7f24+'-'+_0x5dd45d+'/'+_0x333bf5)[_0x25ca('0x2f')](_0x53013a);}return null;};}function patchUpdates(_0xd7c8c3){return function(_0x18c52f){try{jsonpatch[_0x25ca('0x34')](_0x18c52f,_0xd7c8c3,!![]);}catch(_0xc4fe77){return BPromise[_0x25ca('0x35')](_0xc4fe77);}return _0x18c52f[_0x25ca('0x36')]();};}function saveUpdates(_0x5d146c,_0x4ac32e){return function(_0xb17187){if(_0xb17187){return _0xb17187[_0x25ca('0x37')](_0x5d146c)[_0x25ca('0x38')](function(_0xaa79fc){return _0xaa79fc;});}return null;};}function removeEntity(_0x50eabd,_0x59e953){return function(_0x28a89b){if(_0x28a89b){return _0x28a89b[_0x25ca('0x39')]()[_0x25ca('0x38')](function(){var _0x3b541c=_0x28a89b[_0x25ca('0x3a')]({'plain':!![]});var _0x2af66e='ChatQueues';return db['UserProfileResource'][_0x25ca('0x39')]({'where':{'type':_0x2af66e,'resourceId':_0x3b541c['id']}})['then'](function(){return _0x28a89b;});})[_0x25ca('0x38')](function(){_0x50eabd[_0x25ca('0x2d')](0xcc)[_0x25ca('0x2e')]();});}};}function handleEntityNotFound(_0x4df6a4,_0x84785c){return function(_0x13fe3b){if(!_0x13fe3b){_0x4df6a4[_0x25ca('0x2c')](0x194);}return _0x13fe3b;};}function handleError(_0x1ac6ce,_0x1452e2){_0x1452e2=_0x1452e2||0x1f4;return function(_0x3d5cee){logger[_0x25ca('0x27')](_0x3d5cee[_0x25ca('0x3b')]);if(_0x3d5cee['name']){delete _0x3d5cee[_0x25ca('0x3c')];}_0x1ac6ce[_0x25ca('0x2d')](_0x1452e2)[_0x25ca('0x3d')](_0x3d5cee);};}exports[_0x25ca('0x3e')]=function(_0x1da1a2,_0x519db8){var _0x5508c7={},_0x8f0f68={},_0x9a716a={'count':0x0,'rows':[]};var _0x81381b=_[_0x25ca('0x3f')](db[_0x25ca('0x40')][_0x25ca('0x41')],function(_0x4367bc){return{'name':_0x4367bc[_0x25ca('0x42')],'type':_0x4367bc[_0x25ca('0x43')][_0x25ca('0x44')]};});_0x8f0f68[_0x25ca('0x45')]=_['map'](_0x81381b,_0x25ca('0x3c'));_0x8f0f68[_0x25ca('0x46')]=_[_0x25ca('0x47')](_0x1da1a2['query']);_0x8f0f68[_0x25ca('0x48')]=_[_0x25ca('0x49')](_0x8f0f68['model'],_0x8f0f68[_0x25ca('0x46')]);_0x5508c7[_0x25ca('0x4a')]=_['intersection'](_0x8f0f68['model'],qs[_0x25ca('0x4b')](_0x1da1a2[_0x25ca('0x46')][_0x25ca('0x4b')]));_0x5508c7[_0x25ca('0x4a')]=_0x5508c7[_0x25ca('0x4a')]['length']?_0x5508c7[_0x25ca('0x4a')]:_0x8f0f68['model'];if(!_0x1da1a2['query']['hasOwnProperty'](_0x25ca('0x4c'))){_0x5508c7[_0x25ca('0x31')]=qs[_0x25ca('0x31')](_0x1da1a2['query'][_0x25ca('0x31')]);_0x5508c7['offset']=qs[_0x25ca('0x30')](_0x1da1a2[_0x25ca('0x46')]['offset']);}_0x5508c7[_0x25ca('0x4d')]=qs[_0x25ca('0x4e')](_0x1da1a2[_0x25ca('0x46')][_0x25ca('0x4e')]);_0x5508c7[_0x25ca('0x4f')]=qs[_0x25ca('0x48')](_['pick'](_0x1da1a2[_0x25ca('0x46')],_0x8f0f68[_0x25ca('0x48')]),_0x81381b);if(_0x1da1a2['query'][_0x25ca('0x50')]){_0x5508c7[_0x25ca('0x4f')]=_[_0x25ca('0x51')](_0x5508c7['where'],{'$or':_[_0x25ca('0x3f')](_0x81381b,function(_0x45d418){if(_0x45d418[_0x25ca('0x43')]!==_0x25ca('0x52')){var _0x2d91bb={};_0x2d91bb[_0x45d418['name']]={'$like':'%'+_0x1da1a2[_0x25ca('0x46')][_0x25ca('0x50')]+'%'};return _0x2d91bb;}})});}_0x5508c7=_['merge']({},_0x5508c7,_0x1da1a2[_0x25ca('0x53')]);var _0x12df37={'where':_0x5508c7[_0x25ca('0x4f')]};return db[_0x25ca('0x40')][_0x25ca('0x54')](_0x12df37)[_0x25ca('0x38')](function(_0x5714c1){_0x9a716a[_0x25ca('0x54')]=_0x5714c1;if(_0x1da1a2['query'][_0x25ca('0x55')]){_0x5508c7[_0x25ca('0x56')]=[{'all':!![]}];}return db[_0x25ca('0x40')][_0x25ca('0x57')](_0x5508c7);})[_0x25ca('0x38')](function(_0xf027be){_0x9a716a['rows']=_0xf027be;return _0x9a716a;})[_0x25ca('0x38')](respondWithFilteredResult(_0x519db8,_0x5508c7))[_0x25ca('0x2b')](handleError(_0x519db8,null));};exports['show']=function(_0x5ad580,_0x431882){var _0x14e5b0={'raw':!![],'where':{'id':_0x5ad580['params']['id']}},_0x17e552={};_0x17e552[_0x25ca('0x45')]=_[_0x25ca('0x47')](db[_0x25ca('0x40')][_0x25ca('0x41')]);_0x17e552['query']=_[_0x25ca('0x47')](_0x5ad580['query']);_0x17e552[_0x25ca('0x48')]=_[_0x25ca('0x49')](_0x17e552[_0x25ca('0x45')],_0x17e552['query']);_0x14e5b0[_0x25ca('0x4a')]=_[_0x25ca('0x49')](_0x17e552[_0x25ca('0x45')],qs['fields'](_0x5ad580[_0x25ca('0x46')]['fields']));_0x14e5b0['attributes']=_0x14e5b0[_0x25ca('0x4a')][_0x25ca('0x58')]?_0x14e5b0['attributes']:_0x17e552[_0x25ca('0x45')];if(_0x5ad580[_0x25ca('0x46')][_0x25ca('0x55')]){_0x14e5b0['include']=[{'all':!![]}];}_0x14e5b0=_[_0x25ca('0x51')]({},_0x14e5b0,_0x5ad580[_0x25ca('0x53')]);return db[_0x25ca('0x40')][_0x25ca('0x59')](_0x14e5b0)[_0x25ca('0x38')](handleEntityNotFound(_0x431882,null))[_0x25ca('0x38')](respondWithResult(_0x431882,null))[_0x25ca('0x2b')](handleError(_0x431882,null));};exports[_0x25ca('0x5a')]=function(_0x15662b,_0x38698f){return db[_0x25ca('0x40')]['create'](_0x15662b[_0x25ca('0x5b')],{})[_0x25ca('0x38')](function(_0x22bcc9){var _0x31738d=_0x15662b[_0x25ca('0x5c')][_0x25ca('0x3a')]({'plain':!![]});if(!_0x31738d)throw new Error(_0x25ca('0x5d'));if(_0x31738d[_0x25ca('0x5e')]===_0x25ca('0x5c')){var _0x1733d0=_0x22bcc9[_0x25ca('0x3a')]({'plain':!![]});var _0x5a047d=_0x25ca('0x5f');return db[_0x25ca('0x60')]['find']({'where':{'name':_0x5a047d,'userProfileId':_0x31738d[_0x25ca('0x61')]},'raw':!![]})[_0x25ca('0x38')](function(_0x568a64){if(_0x568a64&&_0x568a64[_0x25ca('0x62')]===0x0){return db[_0x25ca('0x63')]['create']({'name':_0x1733d0[_0x25ca('0x3c')],'resourceId':_0x1733d0['id'],'type':_0x568a64[_0x25ca('0x3c')],'sectionId':_0x568a64['id']},{})[_0x25ca('0x38')](function(){return _0x22bcc9;});}else{return _0x22bcc9;}})[_0x25ca('0x2b')](function(_0x111588){logger[_0x25ca('0x27')](_0x25ca('0x64'),_0x111588);throw _0x111588;});}return _0x22bcc9;})[_0x25ca('0x38')](respondWithResult(_0x38698f,0xc9))[_0x25ca('0x2b')](handleError(_0x38698f,null));};exports[_0x25ca('0x37')]=function(_0x5557bf,_0x55b44b){if(_0x5557bf['body']['id']){delete _0x5557bf['body']['id'];}return db[_0x25ca('0x40')][_0x25ca('0x59')]({'where':{'id':_0x5557bf[_0x25ca('0x65')]['id']}})[_0x25ca('0x38')](handleEntityNotFound(_0x55b44b,null))[_0x25ca('0x38')](saveUpdates(_0x5557bf['body'],null))['then'](respondWithResult(_0x55b44b,null))['catch'](handleError(_0x55b44b,null));};exports[_0x25ca('0x39')]=function(_0x4900bc,_0x4401ac){return db['ChatQueue']['find']({'where':{'id':_0x4900bc[_0x25ca('0x65')]['id']}})[_0x25ca('0x38')](handleEntityNotFound(_0x4401ac,null))['then'](removeEntity(_0x4401ac,null))[_0x25ca('0x2b')](handleError(_0x4401ac,null));};exports[_0x25ca('0x66')]=function(_0x4b576f,_0x16d1b8){return db[_0x25ca('0x40')][_0x25ca('0x66')]()[_0x25ca('0x38')](respondWithResult(_0x16d1b8,null))[_0x25ca('0x2b')](handleError(_0x16d1b8,null));};exports['getMembers']=function(_0x3e9c70,_0x1456b8,_0x49788b){var _0x428949={'raw':!![],'where':{}},_0x1f986d={},_0x290a49;return db[_0x25ca('0x40')][_0x25ca('0x67')]({'where':{'id':_0x3e9c70[_0x25ca('0x65')]['id']}})['then'](handleEntityNotFound(_0x1456b8,null))[_0x25ca('0x38')](function(_0x168987){if(_0x168987){_0x290a49=_0x168987[_0x25ca('0x3a')]({'plain':!![]});_0x1f986d['model']=_[_0x25ca('0x47')](db[_0x25ca('0x68')]['rawAttributes']);_0x1f986d[_0x25ca('0x46')]=_[_0x25ca('0x47')](_0x3e9c70[_0x25ca('0x46')]);_0x1f986d['filters']=_['intersection'](_0x1f986d[_0x25ca('0x45')],_0x1f986d[_0x25ca('0x46')]);_0x428949[_0x25ca('0x4a')]=_[_0x25ca('0x49')](_0x1f986d[_0x25ca('0x45')],qs[_0x25ca('0x4b')](_0x3e9c70[_0x25ca('0x46')]['fields']));_0x428949[_0x25ca('0x4a')]=_0x428949['attributes'][_0x25ca('0x58')]?_0x428949[_0x25ca('0x4a')]:_0x1f986d['model'];if(!_0x3e9c70[_0x25ca('0x46')][_0x25ca('0x69')](_0x25ca('0x4c'))){_0x428949['limit']=qs[_0x25ca('0x31')](_0x3e9c70['query'][_0x25ca('0x31')]);_0x428949['offset']=qs[_0x25ca('0x30')](_0x3e9c70[_0x25ca('0x46')][_0x25ca('0x30')]);}_0x428949[_0x25ca('0x4d')]=qs[_0x25ca('0x4e')](_0x3e9c70[_0x25ca('0x46')][_0x25ca('0x4e')]);_0x428949[_0x25ca('0x4f')]=qs[_0x25ca('0x48')](_[_0x25ca('0x6a')](_0x3e9c70['query'],_0x1f986d[_0x25ca('0x48')]));_0x428949[_0x25ca('0x4f')]['ChatQueueId']=_0x168987['id'];if(_0x3e9c70['query']['filter']){_0x428949[_0x25ca('0x4f')]=_[_0x25ca('0x51')](_0x428949[_0x25ca('0x4f')],{'$or':_[_0x25ca('0x3f')](_0x428949['attributes'],function(_0x1f7811){var _0x2f7cdc={};_0x2f7cdc[_0x1f7811]={'$like':'%'+_0x3e9c70[_0x25ca('0x46')][_0x25ca('0x50')]+'%'};return _0x2f7cdc;})});}_0x428949=_[_0x25ca('0x51')]({},_0x428949,_0x3e9c70[_0x25ca('0x53')]);return db[_0x25ca('0x68')]['findAll'](_0x428949);}})[_0x25ca('0x38')](function(_0x517e5b){if(_0x517e5b){return db[_0x25ca('0x6b')][_0x25ca('0x6c')]({'where':{'id':_[_0x25ca('0x3f')](_0x517e5b,'UserId'),'role':_0x25ca('0x6d')},'attributes':['id',_0x25ca('0x3c'),'chatPause','updatedAt',_0x25ca('0x6e')]});}})[_0x25ca('0x38')](function(_0x245a3c){if(_0x245a3c){return{'count':_0x245a3c['count'],'rows':_[_0x25ca('0x3f')](_0x245a3c['rows'],function(_0x304e3a){return{'membername':_0x304e3a['name'],'UserId':_0x304e3a['id'],'queue_name':_0x290a49[_0x25ca('0x3c')],'ChatQueueId':_0x290a49['id'],'interface':util[_0x25ca('0x6f')](_0x25ca('0x70'),_0x25ca('0x71'),_0x304e3a['name']),'penalty':0x0,'paused':_0x304e3a[_0x25ca('0x72')],'createdAt':_0x304e3a[_0x25ca('0x6e')],'updatedAt':_0x304e3a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x25ca('0x38')](respondWithFilteredResult(_0x1456b8,_0x428949))[_0x25ca('0x2b')](handleError(_0x1456b8,null));};exports['getTeams']=function(_0xb90c2e,_0x436d27,_0x3f31e3){var _0x1a095c={};var _0x5cab1d={};var _0x5cb9e1;var _0x5dba9f;return db['ChatQueue'][_0x25ca('0x67')]({'where':{'id':_0xb90c2e['params']['id']}})[_0x25ca('0x38')](handleEntityNotFound(_0x436d27,null))[_0x25ca('0x38')](function(_0x22b448){if(_0x22b448){_0x5cb9e1=_0x22b448;_0x5cab1d['model']=_[_0x25ca('0x47')](db[_0x25ca('0x73')][_0x25ca('0x41')]);_0x5cab1d[_0x25ca('0x46')]=_['keys'](_0xb90c2e[_0x25ca('0x46')]);_0x5cab1d[_0x25ca('0x48')]=_[_0x25ca('0x49')](_0x5cab1d[_0x25ca('0x45')],_0x5cab1d['query']);_0x1a095c[_0x25ca('0x4a')]=_['intersection'](_0x5cab1d[_0x25ca('0x45')],qs['fields'](_0xb90c2e[_0x25ca('0x46')][_0x25ca('0x4b')]));_0x1a095c[_0x25ca('0x4a')]=_0x1a095c[_0x25ca('0x4a')][_0x25ca('0x58')]?_0x1a095c[_0x25ca('0x4a')]:_0x5cab1d['model'];_0x1a095c[_0x25ca('0x4d')]=qs[_0x25ca('0x4e')](_0xb90c2e[_0x25ca('0x46')][_0x25ca('0x4e')]);_0x1a095c[_0x25ca('0x4f')]=qs[_0x25ca('0x48')](_['pick'](_0xb90c2e[_0x25ca('0x46')],_0x5cab1d[_0x25ca('0x48')]));if(_0xb90c2e[_0x25ca('0x46')][_0x25ca('0x50')]){_0x1a095c[_0x25ca('0x4f')]=_['merge'](_0x1a095c[_0x25ca('0x4f')],{'$or':_[_0x25ca('0x3f')](_0x1a095c[_0x25ca('0x4a')],function(_0xc3768b){var _0x445d92={};_0x445d92[_0xc3768b]={'$like':'%'+_0xb90c2e['query'][_0x25ca('0x50')]+'%'};return _0x445d92;})});}_0x1a095c=_[_0x25ca('0x51')]({},_0x1a095c,_0xb90c2e[_0x25ca('0x53')]);return _0x5cb9e1[_0x25ca('0x74')](_0x1a095c);}})['then'](function(_0x30c7c0){if(_0x30c7c0){_0x5dba9f=_0x30c7c0[_0x25ca('0x58')];if(!_0xb90c2e['query'][_0x25ca('0x69')]('nolimit')){_0x1a095c['limit']=qs[_0x25ca('0x31')](_0xb90c2e[_0x25ca('0x46')][_0x25ca('0x31')]);_0x1a095c['offset']=qs[_0x25ca('0x30')](_0xb90c2e[_0x25ca('0x46')][_0x25ca('0x30')]);}return _0x5cb9e1[_0x25ca('0x74')](_0x1a095c);}})[_0x25ca('0x38')](function(_0x58664f){if(_0x58664f){return _0x58664f?{'count':_0x5dba9f,'rows':_0x58664f}:null;}})[_0x25ca('0x38')](respondWithResult(_0x436d27,null))['catch'](handleError(_0x436d27,null));};exports[_0x25ca('0x75')]=function(_0x5a1f6e,_0xd47d53,_0x343a22){var _0x282a24=_0x5a1f6e[_0x25ca('0x5b')][_0x25ca('0x76')];return db['Team']['findAll']({'where':{'id':_0x282a24},'attributes':['id'],'include':[{'model':db[_0x25ca('0x6b')],'as':'Agents','attributes':['id',_0x25ca('0x3c'),_0x25ca('0x77'),'voicePause',_0x25ca('0x78')],'raw':!![]}]})['then'](function(_0x37b563){if(_0x37b563){var _0xab329a=_[_0x25ca('0x79')](_0x37b563,function(_0x4bd762){var _0x4c55bf=_0x4bd762[_0x25ca('0x3a')]({'plain':!![]});return _0x4c55bf[_0x25ca('0x7a')];});return db[_0x25ca('0x40')]['find']({'where':{'id':_0x5a1f6e['params']['id']}})['then'](function(_0x494247){return db['sequelize'][_0x25ca('0x7b')](function(_0x25fcdb){return _0x494247[_0x25ca('0x75')](_0x282a24,{'transaction':_0x25fcdb})[_0x25ca('0x38')](function(){return BPromise[_0x25ca('0x7c')](_0xab329a,function(_0x3db827){return db[_0x25ca('0x68')][_0x25ca('0x7d')]({'where':{'UserId':_0x3db827['id'],'ChatQueueId':_0x5a1f6e[_0x25ca('0x65')]['id']},'transaction':_0x25fcdb});});})[_0x25ca('0x38')](function(){_0xab329a[_0x25ca('0x7e')](function(_0x272f2c){socket['emit'](_0x25ca('0x7f'),{'UserId':_0x272f2c['id'],'ChatQueueId':_0x494247['id']});});});});});}})[_0x25ca('0x38')](respondWithStatusCode(_0xd47d53,null))[_0x25ca('0x2b')](handleError(_0xd47d53,null));};exports[_0x25ca('0x80')]=function(_0x3b869a,_0x1d9e64,_0x57ce06){return db[_0x25ca('0x73')][_0x25ca('0x57')]({'where':{'id':_0x3b869a['query'][_0x25ca('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x25ca('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x25ca('0x38')](handleEntityNotFound(_0x1d9e64,null))[_0x25ca('0x38')](function(_0x5dd858){var _0x5befb8=_[_0x25ca('0x3f')](_0x5dd858,'id');var _0x25f193=[];var _0x52edf7=[];var _0xae61e2=squel[_0x25ca('0x81')]();_0xae61e2['field']('tq.TeamId')[_0x25ca('0x82')](_0x25ca('0x83'),'tq')[_0x25ca('0x84')](_0x25ca('0x85'),'ut',_0x25ca('0x86'))['where'](_0x25ca('0x87'),_0x3b869a[_0x25ca('0x65')]['id']);for(var _0x345fb7=0x0;_0x345fb7<_0x5dd858['length'];_0x345fb7+=0x1){let _0xd0ed6d=_0x5dd858[_0x345fb7];for(var _0x2a78a8=0x0;_0x2a78a8<_0xd0ed6d[_0x25ca('0x7a')][_0x25ca('0x58')];_0x2a78a8+=0x1){let _0x2ee1eb=_0xd0ed6d[_0x25ca('0x7a')][_0x2a78a8];var _0x506dee=_0xae61e2[_0x25ca('0x88')]();_0x506dee[_0x25ca('0x4f')](_0x25ca('0x89'),_0x2ee1eb['id']);_0x52edf7[_0x25ca('0x8a')](db[_0x25ca('0x8b')][_0x25ca('0x46')](_0x506dee[_0x25ca('0x8c')](),{'type':db[_0x25ca('0x8b')]['QueryTypes'][_0x25ca('0x8d')]})['then'](function(_0x18c3c8){if(_0x18c3c8[_0x25ca('0x58')]===0x1){return _0x2ee1eb['id'];}else{var _0xa93db1=_['every'](_['map'](_0x18c3c8,'TeamId'),function(_0x510b1a){return _[_0x25ca('0x8e')](_0x5befb8,_0x510b1a);});if(_0xa93db1){return _0x2ee1eb['id'];}}}));}}return BPromise[_0x25ca('0x8f')](_0x52edf7)[_0x25ca('0x38')](function(_0x4405d6){_0x25f193=_(_0x25f193)['union'](_0x4405d6)[_0x25ca('0x90')]()[_0x25ca('0x91')]();return db[_0x25ca('0x40')][_0x25ca('0x59')]({'where':{'id':_0x3b869a[_0x25ca('0x65')]['id']}})[_0x25ca('0x38')](function(_0x1f61d6){return db[_0x25ca('0x8b')]['transaction'](function(_0x221fd8){return _0x1f61d6[_0x25ca('0x80')](_0x3b869a[_0x25ca('0x46')][_0x25ca('0x76')],{'transaction':_0x221fd8})['then'](function(){if(!_[_0x25ca('0x92')](_0x25f193)){return _0x1f61d6[_0x25ca('0x93')](_0x25f193,{'transaction':_0x221fd8});}})[_0x25ca('0x38')](function(){_0x25f193[_0x25ca('0x7e')](function(_0x252d01){socket[_0x25ca('0x94')](_0x25ca('0x95'),{'UserId':_0x252d01,'ChatQueueId':_0x1f61d6['id']});});});});});});})[_0x25ca('0x38')](respondWithStatusCode(_0x1d9e64,null))[_0x25ca('0x2b')](handleError(_0x1d9e64,null));};exports[_0x25ca('0x96')]=function(_0x11bda7,_0xda251e,_0x1b678f){return db[_0x25ca('0x40')][_0x25ca('0x59')]({'where':{'id':_0x11bda7[_0x25ca('0x65')]['id']}})['then'](handleEntityNotFound(_0xda251e,null))[_0x25ca('0x38')](function(_0x122333){if(_0x122333){return _0x122333[_0x25ca('0x96')](_0x11bda7['body']['ids'],_[_0x25ca('0x97')](_0x11bda7['body'],['ids','id'])||{})[_0x25ca('0x98')](function(_0x417306){for(var _0x3cba40=0x0;_0x3cba40<_0x11bda7[_0x25ca('0x5b')]['ids'][_0x25ca('0x58')];_0x3cba40+=0x1){socket[_0x25ca('0x94')](_0x25ca('0x7f'),{'UserId':_0x11bda7[_0x25ca('0x5b')]['ids'][_0x3cba40],'ChatQueueId':_0x11bda7['params']['id']});}return _0x417306;});}})[_0x25ca('0x38')](respondWithResult(_0xda251e,null))[_0x25ca('0x2b')](handleError(_0xda251e,null));};exports[_0x25ca('0x93')]=function(_0x56fc88,_0x18f011,_0x16362a){return db[_0x25ca('0x40')][_0x25ca('0x59')]({'where':{'id':_0x56fc88['params']['id']}})[_0x25ca('0x38')](handleEntityNotFound(_0x18f011,null))['then'](function(_0x5dd8cf){if(_0x5dd8cf){return _0x5dd8cf[_0x25ca('0x93')](_0x56fc88['query']['ids'])['then'](function(){if(_['isArray'](_0x56fc88[_0x25ca('0x46')][_0x25ca('0x76')])){for(var _0x24bb6d=0x0;_0x24bb6d<_0x56fc88[_0x25ca('0x46')][_0x25ca('0x76')]['length'];_0x24bb6d+=0x1){socket['emit'](_0x25ca('0x95'),{'UserId':Number(_0x56fc88[_0x25ca('0x46')][_0x25ca('0x76')][_0x24bb6d]),'ChatQueueId':Number(_0x56fc88[_0x25ca('0x65')]['id'])});}}else{socket[_0x25ca('0x94')]('userChatQueue:remove',{'UserId':Number(_0x56fc88[_0x25ca('0x46')][_0x25ca('0x76')]),'ChatQueueId':Number(_0x56fc88['params']['id'])});}});}})[_0x25ca('0x38')](respondWithStatusCode(_0x18f011,null))[_0x25ca('0x2b')](handleError(_0x18f011,null));};exports[_0x25ca('0x99')]=function(_0x3252bc,_0x5e55be,_0x2c4b26){var _0x5e8173={};var _0x282f89={};var _0xc69387;var _0x1bfb12;return db[_0x25ca('0x40')][_0x25ca('0x67')]({'where':{'id':_0x3252bc[_0x25ca('0x65')]['id']}})[_0x25ca('0x38')](handleEntityNotFound(_0x5e55be,null))[_0x25ca('0x38')](function(_0x100de7){if(_0x100de7){_0xc69387=_0x100de7;_0x282f89[_0x25ca('0x45')]=_[_0x25ca('0x47')](db[_0x25ca('0x6b')][_0x25ca('0x41')]);_0x282f89[_0x25ca('0x46')]=_['keys'](_0x3252bc[_0x25ca('0x46')]);_0x282f89[_0x25ca('0x48')]=_['intersection'](_0x282f89[_0x25ca('0x45')],_0x282f89[_0x25ca('0x46')]);_0x5e8173[_0x25ca('0x4a')]=_['intersection'](_0x282f89[_0x25ca('0x45')],qs['fields'](_0x3252bc[_0x25ca('0x46')][_0x25ca('0x4b')]));_0x5e8173[_0x25ca('0x4a')]=_0x5e8173[_0x25ca('0x4a')]['length']?_0x5e8173['attributes']:_0x282f89[_0x25ca('0x45')];_0x5e8173['order']=qs[_0x25ca('0x4e')](_0x3252bc[_0x25ca('0x46')][_0x25ca('0x4e')]);_0x5e8173[_0x25ca('0x4f')]=qs['filters'](_['pick'](_0x3252bc['query'],_0x282f89[_0x25ca('0x48')]));if(_0x3252bc[_0x25ca('0x46')][_0x25ca('0x50')]){_0x5e8173[_0x25ca('0x4f')]=_['merge'](_0x5e8173[_0x25ca('0x4f')],{'$or':_[_0x25ca('0x3f')](_0x5e8173[_0x25ca('0x4a')],function(_0x18f4b1){var _0x11ee53={};_0x11ee53[_0x18f4b1]={'$like':'%'+_0x3252bc[_0x25ca('0x46')][_0x25ca('0x50')]+'%'};return _0x11ee53;})});}_0x5e8173=_[_0x25ca('0x51')]({},_0x5e8173,_0x3252bc[_0x25ca('0x53')]);return _0xc69387[_0x25ca('0x99')](_0x5e8173);}})[_0x25ca('0x38')](function(_0x8fae9e){if(_0x8fae9e){_0x1bfb12=_0x8fae9e[_0x25ca('0x58')];if(!_0x3252bc[_0x25ca('0x46')][_0x25ca('0x69')](_0x25ca('0x4c'))){_0x5e8173[_0x25ca('0x31')]=qs[_0x25ca('0x31')](_0x3252bc[_0x25ca('0x46')][_0x25ca('0x31')]);_0x5e8173[_0x25ca('0x30')]=qs[_0x25ca('0x30')](_0x3252bc[_0x25ca('0x46')]['offset']);}return _0xc69387[_0x25ca('0x99')](_0x5e8173);}})['then'](function(_0xb64570){if(_0xb64570){return _0xb64570?{'count':_0x1bfb12,'rows':_0xb64570}:null;}})[_0x25ca('0x38')](respondWithResult(_0x5e55be,null))[_0x25ca('0x2b')](handleError(_0x5e55be,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 53ecbec..077069a 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x37413b,_0x423b30){var _0x15b210=function(_0x34430e){while(--_0x34430e){_0x37413b['push'](_0x37413b['shift']());}};_0x15b210(++_0x423b30);}(_0xb10b,0x12a));var _0xbb10=function(_0x1017c3,_0x7127ba){_0x1017c3=_0x1017c3-0x0;var _0x335335=_0xb10b[_0x1017c3];return _0x335335;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x1aec99,_0x54b962){var _0x400114=function(_0xab69c1){while(--_0xab69c1){_0x1aec99['push'](_0x1aec99['shift']());}};_0x400114(++_0x54b962);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a7be5,_0x4aa6a6){_0x5a7be5=_0x5a7be5-0x0;var _0xb0cb13=_0x5f2f[_0x5a7be5];return _0xb0cb13;};'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 5148cad..3ba0cc9 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 _0xff31=['ChatQueue','chat_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff31,0x1ee));var _0x1ff3=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xff31[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require(_0x1ff3('0x0'));var logger=require('../../config/logger')(_0x1ff3('0x1'));var moment=require(_0x1ff3('0x2'));var BPromise=require(_0x1ff3('0x3'));var rp=require(_0x1ff3('0x4'));var fs=require('fs');var path=require(_0x1ff3('0x5'));var rimraf=require(_0x1ff3('0x6'));var config=require(_0x1ff3('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1ff3('0x8')]=function(_0x7fb586,_0x2bd987){return _0x7fb586[_0x1ff3('0x9')](_0x1ff3('0xa'),attributes,{'tableName':_0x1ff3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c7b=['moment','bluebird','path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','util','../../config/logger','api'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x7c7b,0x81));var _0xb7c7=function(_0x53814e,_0x5eaf21){_0x53814e=_0x53814e-0x0;var _0x206d91=_0x7c7b[_0x53814e];return _0x206d91;};'use strict';var _=require('lodash');var util=require(_0xb7c7('0x0'));var logger=require(_0xb7c7('0x1'))(_0xb7c7('0x2'));var moment=require(_0xb7c7('0x3'));var BPromise=require(_0xb7c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7c7('0x5'));var rimraf=require('rimraf');var config=require(_0xb7c7('0x6'));var attributes=require(_0xb7c7('0x7'));module[_0xb7c7('0x8')]=function(_0x4d806f,_0x230fd2){return _0x4d806f['define'](_0xb7c7('0x9'),attributes,{'tableName':_0xb7c7('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 a45c95e..8d915fa 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 _0xd33c=['stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','model','map','ShowChatQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0xd33c,0x115));var _0xcd33=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xd33c[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0xcd33('0x0'));var util=require(_0xcd33('0x1'));var moment=require('moment');var BPromise=require(_0xcd33('0x2'));var rs=require(_0xcd33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd33('0x5'))(_0xcd33('0x6'));var config=require(_0xcd33('0x7'));var jayson=require(_0xcd33('0x8'));var client=jayson[_0xcd33('0x9')]['http']({'port':0x232a});config[_0xcd33('0xa')]=_['defaults'](config[_0xcd33('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0xcd33('0xb')](socket);function respondWithRpcPromise(_0x1c9ad4,_0x3af2af,_0x193d37){return new BPromise(function(_0x303574,_0x2ed902){return client[_0xcd33('0xc')](_0x1c9ad4,_0x193d37)[_0xcd33('0xd')](function(_0x15a46d){logger[_0xcd33('0xe')](_0xcd33('0xf'),_0x3af2af,_0xcd33('0x10'));logger[_0xcd33('0x11')](_0xcd33('0x12'),_0x3af2af,_0xcd33('0x10'),JSON[_0xcd33('0x13')](_0x15a46d));if(_0x15a46d['error']){if(_0x15a46d[_0xcd33('0x14')][_0xcd33('0x15')]===0x1f4){logger[_0xcd33('0x14')]('ChatQueue,\x20%s,\x20%s',_0x3af2af,_0x15a46d['error'][_0xcd33('0x16')]);return _0x2ed902(_0x15a46d['error'][_0xcd33('0x16')]);}logger[_0xcd33('0x14')](_0xcd33('0xf'),_0x3af2af,_0x15a46d[_0xcd33('0x14')][_0xcd33('0x16')]);return _0x303574(_0x15a46d['error'][_0xcd33('0x16')]);}else{logger['info'](_0xcd33('0xf'),_0x3af2af,_0xcd33('0x10'));_0x303574(_0x15a46d[_0xcd33('0x17')][_0xcd33('0x16')]);}})[_0xcd33('0x18')](function(_0x20fe8e){logger[_0xcd33('0x14')](_0xcd33('0xf'),_0x3af2af,_0x20fe8e);_0x2ed902(_0x20fe8e);});});}exports[_0xcd33('0x19')]=function(_0x53069f){var _0x146a9a=this;return new Promise(function(_0x58a806,_0x52e5ed){return db[_0xcd33('0x1a')][_0xcd33('0x1b')]({'raw':_0x53069f[_0xcd33('0x1c')]?_0x53069f[_0xcd33('0x1c')][_0xcd33('0x1d')]===undefined?!![]:![]:!![],'where':_0x53069f[_0xcd33('0x1c')]?_0x53069f['options'][_0xcd33('0x1e')]||null:null,'attributes':_0x53069f[_0xcd33('0x1c')]?_0x53069f[_0xcd33('0x1c')][_0xcd33('0x1f')]||null:null,'limit':_0x53069f[_0xcd33('0x1c')]?_0x53069f[_0xcd33('0x1c')]['limit']||null:null,'include':_0x53069f[_0xcd33('0x1c')]?_0x53069f[_0xcd33('0x1c')]['include']?_['map'](_0x53069f[_0xcd33('0x1c')][_0xcd33('0x20')],function(_0x35701e){return{'model':db[_0x35701e[_0xcd33('0x21')]],'as':_0x35701e['as'],'attributes':_0x35701e[_0xcd33('0x1f')],'include':_0x35701e['include']?_[_0xcd33('0x22')](_0x35701e['include'],function(_0x1aad04){return{'model':db[_0x1aad04[_0xcd33('0x21')]],'as':_0x1aad04['as'],'attributes':_0x1aad04[_0xcd33('0x1f')],'include':_0x1aad04[_0xcd33('0x20')]?_[_0xcd33('0x22')](_0x1aad04[_0xcd33('0x20')],function(_0x2f7b04){return{'model':db[_0x2f7b04['model']],'as':_0x2f7b04['as'],'attributes':_0x2f7b04['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd33('0xd')](function(_0x1b717b){logger[_0xcd33('0xe')]('GetChatQueue',_0x53069f);logger[_0xcd33('0x11')](_0xcd33('0x19'),_0x53069f,JSON[_0xcd33('0x13')](_0x1b717b));_0x58a806(_0x1b717b);})[_0xcd33('0x18')](function(_0x4b3ee1){logger[_0xcd33('0x14')](_0xcd33('0x19'),_0x4b3ee1['message'],_0x53069f);_0x52e5ed(_0x146a9a[_0xcd33('0x14')](0x1f4,_0x4b3ee1[_0xcd33('0x16')]));});});};exports[_0xcd33('0x23')]=function(_0x2489e7){var _0x3df27f=this;return new Promise(function(_0x18a2af,_0x1befb8){return db[_0xcd33('0x1a')][_0xcd33('0x24')]({'raw':_0x2489e7[_0xcd33('0x1c')]?_0x2489e7[_0xcd33('0x1c')][_0xcd33('0x1d')]===undefined?!![]:![]:!![],'where':_0x2489e7[_0xcd33('0x1c')]?_0x2489e7['options'][_0xcd33('0x1e')]||null:null,'attributes':_0x2489e7[_0xcd33('0x1c')]?_0x2489e7[_0xcd33('0x1c')][_0xcd33('0x1f')]||null:null,'include':_0x2489e7[_0xcd33('0x1c')]?_0x2489e7[_0xcd33('0x1c')][_0xcd33('0x20')]?_[_0xcd33('0x22')](_0x2489e7['options'][_0xcd33('0x20')],function(_0x2a72e8){return{'model':db[_0x2a72e8['model']],'as':_0x2a72e8['as'],'attributes':_0x2a72e8[_0xcd33('0x1f')],'include':_0x2a72e8['include']?_[_0xcd33('0x22')](_0x2a72e8[_0xcd33('0x20')],function(_0x2656fb){return{'model':db[_0x2656fb['model']],'as':_0x2656fb['as'],'attributes':_0x2656fb[_0xcd33('0x1f')],'include':_0x2656fb[_0xcd33('0x20')]?_[_0xcd33('0x22')](_0x2656fb['include'],function(_0x4e69c2){return{'model':db[_0x4e69c2['model']],'as':_0x4e69c2['as'],'attributes':_0x4e69c2[_0xcd33('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd33('0xd')](function(_0x39ce33){logger[_0xcd33('0xe')](_0xcd33('0x23'),_0x2489e7);logger[_0xcd33('0x11')]('ShowChatQueue',_0x2489e7,JSON[_0xcd33('0x13')](_0x39ce33));_0x18a2af(_0x39ce33);})[_0xcd33('0x18')](function(_0x3947a6){logger[_0xcd33('0x14')](_0xcd33('0x23'),_0x3947a6['message'],_0x2489e7);_0x1befb8(_0x3df27f[_0xcd33('0x14')](0x1f4,_0x3947a6[_0xcd33('0x16')]));});});}; \ No newline at end of file +var _0xbcff=['limit','include','map','model','then','find','ShowChatQueue','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes'];(function(_0x488c16,_0x2dcab7){var _0x57ae25=function(_0x2d7f1f){while(--_0x2d7f1f){_0x488c16['push'](_0x488c16['shift']());}};_0x57ae25(++_0x2dcab7);}(_0xbcff,0x12e));var _0xfbcf=function(_0x1a5d05,_0x432575){_0x1a5d05=_0x1a5d05-0x0;var _0x11c7d6=_0xbcff[_0x1a5d05];return _0x11c7d6;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});config['redis']=_[_0xfbcf('0xb')](config[_0xfbcf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbcf('0xd'))(new Redis(config['redis']));require(_0xfbcf('0xe'))[_0xfbcf('0xf')](socket);function respondWithRpcPromise(_0x5eb1b8,_0x59fdda,_0x307226){return new BPromise(function(_0x3a960d,_0x1fbe45){return client[_0xfbcf('0x10')](_0x5eb1b8,_0x307226)['then'](function(_0x117f2c){logger[_0xfbcf('0x11')](_0xfbcf('0x12'),_0x59fdda,_0xfbcf('0x13'));logger[_0xfbcf('0x14')](_0xfbcf('0x15'),_0x59fdda,_0xfbcf('0x13'),JSON['stringify'](_0x117f2c));if(_0x117f2c[_0xfbcf('0x16')]){if(_0x117f2c['error'][_0xfbcf('0x17')]===0x1f4){logger[_0xfbcf('0x16')](_0xfbcf('0x12'),_0x59fdda,_0x117f2c[_0xfbcf('0x16')][_0xfbcf('0x18')]);return _0x1fbe45(_0x117f2c[_0xfbcf('0x16')][_0xfbcf('0x18')]);}logger[_0xfbcf('0x16')](_0xfbcf('0x12'),_0x59fdda,_0x117f2c['error'][_0xfbcf('0x18')]);return _0x3a960d(_0x117f2c[_0xfbcf('0x16')][_0xfbcf('0x18')]);}else{logger[_0xfbcf('0x11')](_0xfbcf('0x12'),_0x59fdda,_0xfbcf('0x13'));_0x3a960d(_0x117f2c[_0xfbcf('0x19')][_0xfbcf('0x18')]);}})[_0xfbcf('0x1a')](function(_0xef5fcf){logger[_0xfbcf('0x16')]('ChatQueue,\x20%s,\x20%s',_0x59fdda,_0xef5fcf);_0x1fbe45(_0xef5fcf);});});}exports[_0xfbcf('0x1b')]=function(_0x3a5785){var _0x54f09b=this;return new Promise(function(_0x42b15f,_0x1fbbef){return db[_0xfbcf('0x1c')][_0xfbcf('0x1d')]({'raw':_0x3a5785[_0xfbcf('0x1e')]?_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a5785['options']?_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x20')]||null:null,'attributes':_0x3a5785['options']?_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x21')]||null:null,'limit':_0x3a5785['options']?_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x22')]||null:null,'include':_0x3a5785[_0xfbcf('0x1e')]?_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x23')]?_['map'](_0x3a5785[_0xfbcf('0x1e')][_0xfbcf('0x23')],function(_0x1f94de){return{'model':db[_0x1f94de['model']],'as':_0x1f94de['as'],'attributes':_0x1f94de['attributes'],'include':_0x1f94de[_0xfbcf('0x23')]?_[_0xfbcf('0x24')](_0x1f94de['include'],function(_0x43a263){return{'model':db[_0x43a263[_0xfbcf('0x25')]],'as':_0x43a263['as'],'attributes':_0x43a263['attributes'],'include':_0x43a263[_0xfbcf('0x23')]?_[_0xfbcf('0x24')](_0x43a263[_0xfbcf('0x23')],function(_0x4db905){return{'model':db[_0x4db905['model']],'as':_0x4db905['as'],'attributes':_0x4db905[_0xfbcf('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfbcf('0x26')](function(_0x35fab2){logger[_0xfbcf('0x11')](_0xfbcf('0x1b'),_0x3a5785);logger[_0xfbcf('0x14')](_0xfbcf('0x1b'),_0x3a5785,JSON['stringify'](_0x35fab2));_0x42b15f(_0x35fab2);})[_0xfbcf('0x1a')](function(_0x24fefa){logger['error'](_0xfbcf('0x1b'),_0x24fefa[_0xfbcf('0x18')],_0x3a5785);_0x1fbbef(_0x54f09b[_0xfbcf('0x16')](0x1f4,_0x24fefa[_0xfbcf('0x18')]));});});};exports['ShowChatQueue']=function(_0x30beaa){var _0x4240cf=this;return new Promise(function(_0x58fa0d,_0xad39a5){return db[_0xfbcf('0x1c')][_0xfbcf('0x27')]({'raw':_0x30beaa[_0xfbcf('0x1e')]?_0x30beaa[_0xfbcf('0x1e')][_0xfbcf('0x1f')]===undefined?!![]:![]:!![],'where':_0x30beaa[_0xfbcf('0x1e')]?_0x30beaa[_0xfbcf('0x1e')][_0xfbcf('0x20')]||null:null,'attributes':_0x30beaa['options']?_0x30beaa[_0xfbcf('0x1e')]['attributes']||null:null,'include':_0x30beaa[_0xfbcf('0x1e')]?_0x30beaa[_0xfbcf('0x1e')][_0xfbcf('0x23')]?_[_0xfbcf('0x24')](_0x30beaa['options'][_0xfbcf('0x23')],function(_0x4f8ba3){return{'model':db[_0x4f8ba3[_0xfbcf('0x25')]],'as':_0x4f8ba3['as'],'attributes':_0x4f8ba3[_0xfbcf('0x21')],'include':_0x4f8ba3[_0xfbcf('0x23')]?_[_0xfbcf('0x24')](_0x4f8ba3[_0xfbcf('0x23')],function(_0x1e5339){return{'model':db[_0x1e5339[_0xfbcf('0x25')]],'as':_0x1e5339['as'],'attributes':_0x1e5339[_0xfbcf('0x21')],'include':_0x1e5339[_0xfbcf('0x23')]?_[_0xfbcf('0x24')](_0x1e5339[_0xfbcf('0x23')],function(_0x4ec1b0){return{'model':db[_0x4ec1b0[_0xfbcf('0x25')]],'as':_0x4ec1b0['as'],'attributes':_0x4ec1b0[_0xfbcf('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfbcf('0x26')](function(_0x46c8a6){logger['info'](_0xfbcf('0x28'),_0x30beaa);logger[_0xfbcf('0x14')]('ShowChatQueue',_0x30beaa,JSON[_0xfbcf('0x29')](_0x46c8a6));_0x58fa0d(_0x46c8a6);})['catch'](function(_0x5ed4be){logger[_0xfbcf('0x16')](_0xfbcf('0x28'),_0x5ed4be['message'],_0x30beaa);_0xad39a5(_0x4240cf[_0xfbcf('0x16')](0x1f4,_0x5ed4be['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fda7113..a2cb866 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(_0xf71ea6,_0x6891e9){var _0x3c271a=function(_0x936683){while(--_0x936683){_0xf71ea6['push'](_0xf71ea6['shift']());}};_0x3c271a(++_0x6891e9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0x0b0e[_0x47242d];return _0x30273a;};'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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x4b4255,_0xf71f54){var _0x3ab4a6=function(_0x1eb42e){while(--_0x1eb42e){_0x4b4255['push'](_0x4b4255['shift']());}};_0x3ab4a6(++_0xf71f54);}(_0x0b0e,0x187));var _0xe0b0=function(_0x475191,_0x5bce86){_0x475191=_0x475191-0x0;var _0x189e96=_0x0b0e[_0x475191];return _0x189e96;};'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 diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b7db145..e910d63 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 _0x9464=['../../components/interaction/service','./chatQueue.controller','get','index','describe','/:id','isAuthenticated','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','delete','destroy','removeAgents','exports','path','connect-timeout','../../components/auth/service'];(function(_0x48f2bc,_0x6af1fc){var _0x1ae4a3=function(_0x59ebb9){while(--_0x59ebb9){_0x48f2bc['push'](_0x48f2bc['shift']());}};_0x1ae4a3(++_0x6af1fc);}(_0x9464,0x11b));var _0x4946=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0x9464[_0x5e1b91];return _0x59b52f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4946('0x0'));var timeout=require(_0x4946('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x4946('0x2'));var interaction=require(_0x4946('0x3'));var config=require('../../config/environment');var controller=require(_0x4946('0x4'));router[_0x4946('0x5')]('/',auth['isAuthenticated'](),controller[_0x4946('0x6')]);router[_0x4946('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x4946('0x7')]);router['get'](_0x4946('0x8'),auth[_0x4946('0x9')](),controller[_0x4946('0xa')]);router[_0x4946('0x5')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x4946('0x5')](_0x4946('0xb'),auth[_0x4946('0x9')](),controller[_0x4946('0xc')]);router[_0x4946('0x5')](_0x4946('0xd'),auth['isAuthenticated'](),controller[_0x4946('0xe')]);router[_0x4946('0xf')]('/',auth[_0x4946('0x9')](),controller[_0x4946('0x10')]);router[_0x4946('0xf')]('/:id/teams',auth[_0x4946('0x9')](),controller['addTeams']);router[_0x4946('0xf')](_0x4946('0xd'),auth['isAuthenticated'](),controller[_0x4946('0x11')]);router['put'](_0x4946('0x8'),auth[_0x4946('0x9')](),controller['update']);router[_0x4946('0x12')](_0x4946('0x8'),auth[_0x4946('0x9')](),controller[_0x4946('0x13')]);router[_0x4946('0x12')](_0x4946('0xb'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x4946('0x12')](_0x4946('0xd'),auth['isAuthenticated'](),controller[_0x4946('0x14')]);module[_0x4946('0x15')]=router; \ No newline at end of file +var _0x64c7=['Router','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout'];(function(_0x401920,_0x4e4877){var _0x68075e=function(_0x2bb848){while(--_0x2bb848){_0x401920['push'](_0x401920['shift']());}};_0x68075e(++_0x4e4877);}(_0x64c7,0x1b7));var _0x764c=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x64c7[_0x492535];return _0x256620;};'use strict';var multer=require(_0x764c('0x0'));var util=require(_0x764c('0x1'));var path=require('path');var timeout=require(_0x764c('0x2'));var express=require('express');var router=express[_0x764c('0x3')]();var auth=require(_0x764c('0x4'));var interaction=require(_0x764c('0x5'));var config=require('../../config/environment');var controller=require(_0x764c('0x6'));router[_0x764c('0x7')]('/',auth[_0x764c('0x8')](),controller[_0x764c('0x9')]);router[_0x764c('0x7')](_0x764c('0xa'),auth[_0x764c('0x8')](),controller['describe']);router[_0x764c('0x7')](_0x764c('0xb'),auth['isAuthenticated'](),controller[_0x764c('0xc')]);router[_0x764c('0x7')](_0x764c('0xd'),auth[_0x764c('0x8')](),controller[_0x764c('0xe')]);router['get'](_0x764c('0xf'),auth['isAuthenticated'](),controller[_0x764c('0x10')]);router[_0x764c('0x7')](_0x764c('0x11'),auth[_0x764c('0x8')](),controller[_0x764c('0x12')]);router['post']('/',auth[_0x764c('0x8')](),controller['create']);router['post'](_0x764c('0xf'),auth['isAuthenticated'](),controller[_0x764c('0x13')]);router[_0x764c('0x14')](_0x764c('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x764c('0xb'),auth['isAuthenticated'](),controller[_0x764c('0x15')]);router[_0x764c('0x16')](_0x764c('0xb'),auth[_0x764c('0x8')](),controller[_0x764c('0x17')]);router['delete'](_0x764c('0xf'),auth['isAuthenticated'](),controller[_0x764c('0x18')]);router[_0x764c('0x16')](_0x764c('0x11'),auth[_0x764c('0x8')](),controller['removeAgents']);module[_0x764c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 66ccd58..675d62f 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 _0x529b=['DATE','STRING','moment','sequelize','exports'];(function(_0x2d296c,_0x53da61){var _0xc59265=function(_0x21dc0f){while(--_0x21dc0f){_0x2d296c['push'](_0x2d296c['shift']());}};_0xc59265(++_0x53da61);}(_0x529b,0x70));var _0xb529=function(_0x4167b0,_0x245702){_0x4167b0=_0x4167b0-0x0;var _0x31b60e=_0x529b[_0x4167b0];return _0x31b60e;};'use strict';var moment=require(_0xb529('0x0'));var Sequelize=require(_0xb529('0x1'));module[_0xb529('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb529('0x3')]},'acceptAt':{'type':Sequelize[_0xb529('0x3')]},'exitAt':{'type':Sequelize[_0xb529('0x3')]},'reason':{'type':Sequelize[_0xb529('0x4')]}}; \ No newline at end of file +var _0xec5d=['exports','STRING','DATE','sequelize'];(function(_0x5d0a1e,_0x3c20c9){var _0x4c9d7d=function(_0x37c8f3){while(--_0x37c8f3){_0x5d0a1e['push'](_0x5d0a1e['shift']());}};_0x4c9d7d(++_0x3c20c9);}(_0xec5d,0xcf));var _0xdec5=function(_0x5a40d7,_0x41310a){_0x5a40d7=_0x5a40d7-0x0;var _0xd4a319=_0xec5d[_0x5a40d7];return _0xd4a319;};'use strict';var moment=require('moment');var Sequelize=require(_0xdec5('0x0'));module[_0xdec5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdec5('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xdec5('0x3')]},'acceptAt':{'type':Sequelize[_0xdec5('0x3')]},'exitAt':{'type':Sequelize[_0xdec5('0x3')]},'reason':{'type':Sequelize[_0xdec5('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7696749..4b3ac39 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 _0xb7e7=['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','ChatQueueReport','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','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'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')]),_0x57b9da);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['ChatQueueReport'][_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['ChatQueueReport'][_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));};exports[_0x7b7e('0x4a')]=function(_0x29024e,_0x46d4ee){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()[_0x7b7e('0x24')](respondWithResult(_0x46d4ee,null))[_0x7b7e('0x43')](handleError(_0x46d4ee,null));}; \ No newline at end of file +var _0xb7e7=['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','ChatQueueReport','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','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'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')]),_0x57b9da);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['ChatQueueReport'][_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['ChatQueueReport'][_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));};exports[_0x7b7e('0x4a')]=function(_0x29024e,_0x46d4ee){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()[_0x7b7e('0x24')](respondWithResult(_0x46d4ee,null))[_0x7b7e('0x43')](handleError(_0x46d4ee,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index cb3347a..f7d97fb 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 _0x7793=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid'];(function(_0x2111be,_0x286335){var _0x22e30b=function(_0x2bd146){while(--_0x2bd146){_0x2111be['push'](_0x2111be['shift']());}};_0x22e30b(++_0x286335);}(_0x7793,0x144));var _0x3779=function(_0x456099,_0x4e4265){_0x456099=_0x456099-0x0;var _0x33e673=_0x7793[_0x456099];return _0x33e673;};'use strict';var _=require(_0x3779('0x0'));var util=require(_0x3779('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3779('0x2'));var BPromise=require(_0x3779('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3779('0x4'));var rimraf=require(_0x3779('0x5'));var config=require(_0x3779('0x6'));var attributes=require(_0x3779('0x7'));module[_0x3779('0x8')]=function(_0x49b612,_0x261ddb){return _0x49b612[_0x3779('0x9')](_0x3779('0xa'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3779('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f46=['report_chat_queue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x491deb,_0x1bf192){var _0xc21671=function(_0x320df4){while(--_0x320df4){_0x491deb['push'](_0x491deb['shift']());}};_0xc21671(++_0x1bf192);}(_0x6f46,0x10b));var _0x66f4=function(_0x235fae,_0xea3869){_0x235fae=_0x235fae-0x0;var _0x221dc8=_0x6f46[_0x235fae];return _0x221dc8;};'use strict';var _=require(_0x66f4('0x0'));var util=require(_0x66f4('0x1'));var logger=require(_0x66f4('0x2'))(_0x66f4('0x3'));var moment=require('moment');var BPromise=require(_0x66f4('0x4'));var rp=require(_0x66f4('0x5'));var fs=require('fs');var path=require(_0x66f4('0x6'));var rimraf=require(_0x66f4('0x7'));var config=require(_0x66f4('0x8'));var attributes=require(_0x66f4('0x9'));module[_0x66f4('0xa')]=function(_0x1c2b4e,_0x5bf968){return _0x1c2b4e[_0x66f4('0xb')](_0x66f4('0xc'),attributes,{'tableName':_0x66f4('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f6f7005..90b6278 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 _0x04d3=['create','options','raw','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','request\x20sent','result','message','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0xa67795,_0x426173){var _0x1e2dab=function(_0x442a02){while(--_0x442a02){_0xa67795['push'](_0xa67795['shift']());}};_0x1e2dab(++_0x426173);}(_0x04d3,0xb7));var _0x304d=function(_0x49d33f,_0x176755){_0x49d33f=_0x49d33f-0x0;var _0x297496=_0x04d3[_0x49d33f];return _0x297496;};'use strict';var _=require(_0x304d('0x0'));var util=require(_0x304d('0x1'));var moment=require('moment');var BPromise=require(_0x304d('0x2'));var rs=require(_0x304d('0x3'));var fs=require('fs');var Redis=require(_0x304d('0x4'));var db=require(_0x304d('0x5'))['db'];var utils=require(_0x304d('0x6'));var logger=require(_0x304d('0x7'))('rpc');var config=require(_0x304d('0x8'));var jayson=require(_0x304d('0x9'));var client=jayson[_0x304d('0xa')][_0x304d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2440ae,_0x32ed2b,_0x1b45e8){return new BPromise(function(_0x417489,_0x192404){return client[_0x304d('0xc')](_0x2440ae,_0x1b45e8)[_0x304d('0xd')](function(_0xde96bb){logger[_0x304d('0xe')](_0x304d('0xf'),_0x32ed2b,'request\x20sent');logger[_0x304d('0x10')](_0x304d('0x11'),_0x32ed2b,'request\x20sent',JSON[_0x304d('0x12')](_0xde96bb));if(_0xde96bb[_0x304d('0x13')]){if(_0xde96bb[_0x304d('0x13')][_0x304d('0x14')]===0x1f4){logger[_0x304d('0x13')](_0x304d('0xf'),_0x32ed2b,_0xde96bb['error']['message']);return _0x192404(_0xde96bb[_0x304d('0x13')]['message']);}logger[_0x304d('0x13')](_0x304d('0xf'),_0x32ed2b,_0xde96bb['error']['message']);return _0x417489(_0xde96bb[_0x304d('0x13')]['message']);}else{logger[_0x304d('0xe')](_0x304d('0xf'),_0x32ed2b,_0x304d('0x15'));_0x417489(_0xde96bb[_0x304d('0x16')][_0x304d('0x17')]);}})[_0x304d('0x18')](function(_0x376e76){logger[_0x304d('0x13')](_0x304d('0xf'),_0x32ed2b,_0x376e76);_0x192404(_0x376e76);});});}exports[_0x304d('0x19')]=function(_0x5621c6){var _0x3f9268=this;return new Promise(function(_0x1a5b81,_0x453603){return db[_0x304d('0x1a')][_0x304d('0x1b')](_0x5621c6['body'],{'raw':_0x5621c6[_0x304d('0x1c')]?_0x5621c6[_0x304d('0x1c')][_0x304d('0x1d')]===undefined?!![]:![]:!![]})[_0x304d('0xd')](function(_0x23dc4d){logger[_0x304d('0xe')](_0x304d('0x19'),_0x5621c6);logger[_0x304d('0x10')]('CreateChatQueueReport',_0x5621c6,JSON[_0x304d('0x12')](_0x23dc4d));_0x1a5b81(_0x23dc4d);})[_0x304d('0x18')](function(_0x29deff){logger['error'](_0x304d('0x19'),_0x29deff[_0x304d('0x17')],_0x5621c6);_0x453603(_0x3f9268['error'](0x1f4,_0x29deff[_0x304d('0x17')]));});});};exports[_0x304d('0x1e')]=function(_0x1fd750){var _0x5c16b4=this;return new Promise(function(_0x167593,_0x268a49){return db['ChatQueueReport'][_0x304d('0x1f')](_0x1fd750['body'],{'raw':_0x1fd750[_0x304d('0x1c')]?_0x1fd750[_0x304d('0x1c')][_0x304d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd750[_0x304d('0x1c')]?_0x1fd750['options'][_0x304d('0x20')]||null:null,'attributes':_0x1fd750[_0x304d('0x1c')]?_0x1fd750['options'][_0x304d('0x21')]||null:null,'limit':_0x1fd750['options']?_0x1fd750[_0x304d('0x1c')][_0x304d('0x22')]||null:null})[_0x304d('0xd')](function(_0xd60431){logger[_0x304d('0xe')](_0x304d('0x1e'),_0x1fd750);logger[_0x304d('0x10')](_0x304d('0x1e'),_0x1fd750,JSON['stringify'](_0xd60431));_0x167593(_0xd60431);})[_0x304d('0x18')](function(_0x46bcbb){logger[_0x304d('0x13')](_0x304d('0x1e'),_0x46bcbb['message'],_0x1fd750);_0x268a49(_0x5c16b4[_0x304d('0x13')](0x1f4,_0x46bcbb[_0x304d('0x17')]));});});}; \ No newline at end of file +var _0xfdb6=['error','code','message','info','catch','ChatQueueReport,\x20%s,\x20%s','CreateChatQueueReport','create','body','options','raw','then','ChatQueueReport','update','where','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11c193,_0xb90e1c){var _0x46297b=function(_0x27b193){while(--_0x27b193){_0x11c193['push'](_0x11c193['shift']());}};_0x46297b(++_0xb90e1c);}(_0xfdb6,0x1de));var _0x6fdb=function(_0x10fe10,_0x4fd05e){_0x10fe10=_0x10fe10-0x0;var _0x5cb04f=_0xfdb6[_0x10fe10];return _0x5cb04f;};'use strict';var _=require(_0x6fdb('0x0'));var util=require(_0x6fdb('0x1'));var moment=require(_0x6fdb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6fdb('0x3'));var fs=require('fs');var Redis=require(_0x6fdb('0x4'));var db=require(_0x6fdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fdb('0x6'))(_0x6fdb('0x7'));var config=require(_0x6fdb('0x8'));var jayson=require(_0x6fdb('0x9'));var client=jayson[_0x6fdb('0xa')][_0x6fdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x259e4b,_0x49cb28,_0xe2387f){return new BPromise(function(_0x348d3e,_0x4b49af){return client[_0x6fdb('0xc')](_0x259e4b,_0xe2387f)['then'](function(_0x33be97){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x49cb28,_0x6fdb('0xd'));logger[_0x6fdb('0xe')](_0x6fdb('0xf'),_0x49cb28,_0x6fdb('0xd'),JSON[_0x6fdb('0x10')](_0x33be97));if(_0x33be97[_0x6fdb('0x11')]){if(_0x33be97[_0x6fdb('0x11')][_0x6fdb('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x49cb28,_0x33be97[_0x6fdb('0x11')]['message']);return _0x4b49af(_0x33be97[_0x6fdb('0x11')][_0x6fdb('0x13')]);}logger[_0x6fdb('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x49cb28,_0x33be97['error'][_0x6fdb('0x13')]);return _0x348d3e(_0x33be97['error']['message']);}else{logger[_0x6fdb('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x49cb28,_0x6fdb('0xd'));_0x348d3e(_0x33be97['result'][_0x6fdb('0x13')]);}})[_0x6fdb('0x15')](function(_0x4ae579){logger['error'](_0x6fdb('0x16'),_0x49cb28,_0x4ae579);_0x4b49af(_0x4ae579);});});}exports[_0x6fdb('0x17')]=function(_0x19f6b3){var _0x338a33=this;return new Promise(function(_0x2e0ff9,_0xb5da8b){return db['ChatQueueReport'][_0x6fdb('0x18')](_0x19f6b3[_0x6fdb('0x19')],{'raw':_0x19f6b3[_0x6fdb('0x1a')]?_0x19f6b3[_0x6fdb('0x1a')][_0x6fdb('0x1b')]===undefined?!![]:![]:!![]})[_0x6fdb('0x1c')](function(_0x1bf16a){logger[_0x6fdb('0x14')](_0x6fdb('0x17'),_0x19f6b3);logger[_0x6fdb('0xe')](_0x6fdb('0x17'),_0x19f6b3,JSON[_0x6fdb('0x10')](_0x1bf16a));_0x2e0ff9(_0x1bf16a);})[_0x6fdb('0x15')](function(_0x52260e){logger[_0x6fdb('0x11')](_0x6fdb('0x17'),_0x52260e[_0x6fdb('0x13')],_0x19f6b3);_0xb5da8b(_0x338a33['error'](0x1f4,_0x52260e[_0x6fdb('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x18f735){var _0x12def3=this;return new Promise(function(_0x5b1f23,_0x702698){return db[_0x6fdb('0x1d')][_0x6fdb('0x1e')](_0x18f735[_0x6fdb('0x19')],{'raw':_0x18f735[_0x6fdb('0x1a')]?_0x18f735['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f735[_0x6fdb('0x1a')]?_0x18f735[_0x6fdb('0x1a')][_0x6fdb('0x1f')]||null:null,'attributes':_0x18f735[_0x6fdb('0x1a')]?_0x18f735[_0x6fdb('0x1a')]['attributes']||null:null,'limit':_0x18f735['options']?_0x18f735['options']['limit']||null:null})[_0x6fdb('0x1c')](function(_0x1074a4){logger[_0x6fdb('0x14')](_0x6fdb('0x20'),_0x18f735);logger[_0x6fdb('0xe')](_0x6fdb('0x20'),_0x18f735,JSON['stringify'](_0x1074a4));_0x5b1f23(_0x1074a4);})['catch'](function(_0x1c9b83){logger['error'](_0x6fdb('0x20'),_0x1c9b83[_0x6fdb('0x13')],_0x18f735);_0x702698(_0x12def3[_0x6fdb('0x11')](0x1f4,_0x1c9b83[_0x6fdb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9b17267..9815ff6 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 _0x0e40=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','destroy','exports','util','path','connect-timeout','express'];(function(_0x24e7d2,_0x3f1c78){var _0x1dbc44=function(_0x2ed288){while(--_0x2ed288){_0x24e7d2['push'](_0x24e7d2['shift']());}};_0x1dbc44(++_0x3f1c78);}(_0x0e40,0x10c));var _0x00e4=function(_0x4e4bf1,_0x54dcf9){_0x4e4bf1=_0x4e4bf1-0x0;var _0x3d067b=_0x0e40[_0x4e4bf1];return _0x3d067b;};'use strict';var multer=require('multer');var util=require(_0x00e4('0x0'));var path=require(_0x00e4('0x1'));var timeout=require(_0x00e4('0x2'));var express=require(_0x00e4('0x3'));var router=express[_0x00e4('0x4')]();var auth=require(_0x00e4('0x5'));var interaction=require(_0x00e4('0x6'));var config=require(_0x00e4('0x7'));var controller=require(_0x00e4('0x8'));router[_0x00e4('0x9')]('/',auth[_0x00e4('0xa')](),controller[_0x00e4('0xb')]);router['get']('/describe',auth[_0x00e4('0xa')](),controller[_0x00e4('0xc')]);router['get'](_0x00e4('0xd'),auth[_0x00e4('0xa')](),controller[_0x00e4('0xe')]);router['post']('/',auth[_0x00e4('0xa')](),controller['create']);router['put']('/:id',auth[_0x00e4('0xa')](),controller['update']);router['delete'](_0x00e4('0xd'),auth[_0x00e4('0xa')](),controller[_0x00e4('0xf')]);module[_0x00e4('0x10')]=router; \ No newline at end of file +var _0x7949=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x28958d,_0xfa5f9f){var _0x439c72=function(_0x280df5){while(--_0x280df5){_0x28958d['push'](_0x28958d['shift']());}};_0x439c72(++_0xfa5f9f);}(_0x7949,0xf9));var _0x9794=function(_0x578a7a,_0xe0adcd){_0x578a7a=_0x578a7a-0x0;var _0x5d55c3=_0x7949[_0x578a7a];return _0x5d55c3;};'use strict';var multer=require(_0x9794('0x0'));var util=require(_0x9794('0x1'));var path=require(_0x9794('0x2'));var timeout=require(_0x9794('0x3'));var express=require(_0x9794('0x4'));var router=express[_0x9794('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9794('0x6'));var config=require(_0x9794('0x7'));var controller=require(_0x9794('0x8'));router['get']('/',auth[_0x9794('0x9')](),controller[_0x9794('0xa')]);router['get'](_0x9794('0xb'),auth[_0x9794('0x9')](),controller[_0x9794('0xc')]);router[_0x9794('0xd')]('/:id',auth[_0x9794('0x9')](),controller[_0x9794('0xe')]);router[_0x9794('0xf')]('/',auth[_0x9794('0x9')](),controller['create']);router[_0x9794('0x10')](_0x9794('0x11'),auth[_0x9794('0x9')](),controller[_0x9794('0x12')]);router[_0x9794('0x13')](_0x9794('0x11'),auth[_0x9794('0x9')](),controller[_0x9794('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index af1813d..abac526 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 _0x5dd0=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x4ff46d,_0x26c3d9){var _0x1f0a58=function(_0x2091d3){while(--_0x2091d3){_0x4ff46d['push'](_0x4ff46d['shift']());}};_0x1f0a58(++_0x26c3d9);}(_0x5dd0,0x9b));var _0x05dd=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5dd0[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0x05dd('0x0'));var Sequelize=require(_0x05dd('0x1'));module[_0x05dd('0x2')]={'uniqueid':{'type':Sequelize[_0x05dd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x05dd('0x4')](_0x05dd('0x5'),_0x05dd('0x6'),_0x05dd('0x7')),'allowNull':![],'defaultValue':_0x05dd('0x7')},'transferredAt':{'type':Sequelize[_0x05dd('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x05dd('0x9')]}}; \ No newline at end of file +var _0x1ac0=['agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x34016a,_0x19c998){var _0x272a18=function(_0xb0a910){while(--_0xb0a910){_0x34016a['push'](_0x34016a['shift']());}};_0x272a18(++_0x19c998);}(_0x1ac0,0x1bc));var _0x01ac=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1ac0[_0x17d9e3];return _0x14192d;};'use strict';var moment=require(_0x01ac('0x0'));var Sequelize=require(_0x01ac('0x1'));module[_0x01ac('0x2')]={'uniqueid':{'type':Sequelize[_0x01ac('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x01ac('0x4')](_0x01ac('0x5'),_0x01ac('0x6'),_0x01ac('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x01ac('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x01ac('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 9f0d0da..2ce1311 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 _0x5d9b=['apply','reject','save','then','error','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','count','include','rows','catch','params','ChatTransferReport','includeAll','options','create','update','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','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','end','offset','limit','set','Content-Range','json'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x5d9b,0x150));var _0xb5d9=function(_0x108ae1,_0x31fbb3){_0x108ae1=_0x108ae1-0x0;var _0x713c6d=_0x5d9b[_0x108ae1];return _0x713c6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb5d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5d9('0x1'));var jsonpatch=require(_0xb5d9('0x2'));var rp=require(_0xb5d9('0x3'));var moment=require(_0xb5d9('0x4'));var BPromise=require(_0xb5d9('0x5'));var Mustache=require(_0xb5d9('0x6'));var util=require('util');var path=require(_0xb5d9('0x7'));var sox=require(_0xb5d9('0x8'));var csv=require(_0xb5d9('0x9'));var ejs=require(_0xb5d9('0xa'));var fs=require('fs');var _=require(_0xb5d9('0xb'));var squel=require(_0xb5d9('0xc'));var crypto=require(_0xb5d9('0xd'));var jsforce=require(_0xb5d9('0xe'));var deskjs=require(_0xb5d9('0xf'));var toCsv=require(_0xb5d9('0x9'));var querystring=require('querystring');var Papa=require(_0xb5d9('0x10'));var Redis=require('ioredis');var authService=require(_0xb5d9('0x11'));var qs=require(_0xb5d9('0x12'));var as=require(_0xb5d9('0x13'));var hardwareService=require(_0xb5d9('0x14'));var logger=require(_0xb5d9('0x15'))(_0xb5d9('0x16'));var utils=require(_0xb5d9('0x17'));var config=require(_0xb5d9('0x18'));var db=require(_0xb5d9('0x19'))['db'];function respondWithStatusCode(_0x38ff14,_0x28cc72){_0x28cc72=_0x28cc72||0xcc;return function(_0x464be9){if(_0x464be9){return _0x38ff14[_0xb5d9('0x1a')](_0x28cc72);}return _0x38ff14[_0xb5d9('0x1b')](_0x28cc72)[_0xb5d9('0x1c')]();};}function respondWithResult(_0x3dd574,_0x29a07d){_0x29a07d=_0x29a07d||0xc8;return function(_0x485591){if(_0x485591){return _0x3dd574[_0xb5d9('0x1b')](_0x29a07d)['json'](_0x485591);}};}function respondWithFilteredResult(_0x30d472,_0x49b37e){return function(_0x5a04c1){if(_0x5a04c1){var _0x37a482=_0x5a04c1['count'],_0x16e0db=_0x49b37e[_0xb5d9('0x1d')],_0x5b6d5b=_0x49b37e['offset']+_0x49b37e[_0xb5d9('0x1e')],_0x5b83d2;if(_0x5b6d5b>=_0x37a482){_0x5b6d5b=_0x37a482;_0x5b83d2=0xc8;}else{_0x5b83d2=0xce;}_0x30d472[_0xb5d9('0x1b')](_0x5b83d2);return _0x30d472[_0xb5d9('0x1f')](_0xb5d9('0x20'),_0x16e0db+'-'+_0x5b6d5b+'/'+_0x37a482)[_0xb5d9('0x21')](_0x5a04c1);}return null;};}function patchUpdates(_0x25976a){return function(_0x2db374){try{jsonpatch[_0xb5d9('0x22')](_0x2db374,_0x25976a,!![]);}catch(_0x13b9e0){return BPromise[_0xb5d9('0x23')](_0x13b9e0);}return _0x2db374[_0xb5d9('0x24')]();};}function saveUpdates(_0x5eeb3b,_0x19ddb5){return function(_0x518319){if(_0x518319){return _0x518319['update'](_0x5eeb3b)['then'](function(_0x39a88a){return _0x39a88a;});}return null;};}function removeEntity(_0x2fc751,_0x12e0b2){return function(_0x7a2389){if(_0x7a2389){return _0x7a2389['destroy']()[_0xb5d9('0x25')](function(){_0x2fc751['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbe66a9,_0x46e279){return function(_0x56237e){if(!_0x56237e){_0xbe66a9[_0xb5d9('0x1a')](0x194);}return _0x56237e;};}function handleError(_0x25e1a5,_0x786025){_0x786025=_0x786025||0x1f4;return function(_0x123b7b){logger[_0xb5d9('0x26')](_0x123b7b['stack']);if(_0x123b7b[_0xb5d9('0x27')]){delete _0x123b7b['name'];}_0x25e1a5[_0xb5d9('0x1b')](_0x786025)['send'](_0x123b7b);};}exports[_0xb5d9('0x28')]=function(_0x4a542b,_0x49326b){var _0x5bfb03={},_0x298be7={},_0x555f67={'count':0x0,'rows':[]};var _0x558ef7=_[_0xb5d9('0x29')](db['ChatTransferReport'][_0xb5d9('0x2a')],function(_0x14b48b){return{'name':_0x14b48b['fieldName'],'type':_0x14b48b['type'][_0xb5d9('0x2b')]};});_0x298be7[_0xb5d9('0x2c')]=_[_0xb5d9('0x29')](_0x558ef7,_0xb5d9('0x27'));_0x298be7[_0xb5d9('0x2d')]=_[_0xb5d9('0x2e')](_0x4a542b[_0xb5d9('0x2d')]);_0x298be7[_0xb5d9('0x2f')]=_[_0xb5d9('0x30')](_0x298be7['model'],_0x298be7[_0xb5d9('0x2d')]);_0x5bfb03['attributes']=_['intersection'](_0x298be7['model'],qs[_0xb5d9('0x31')](_0x4a542b['query'][_0xb5d9('0x31')]));_0x5bfb03[_0xb5d9('0x32')]=_0x5bfb03['attributes'][_0xb5d9('0x33')]?_0x5bfb03[_0xb5d9('0x32')]:_0x298be7[_0xb5d9('0x2c')];if(!_0x4a542b[_0xb5d9('0x2d')][_0xb5d9('0x34')](_0xb5d9('0x35'))){_0x5bfb03['limit']=qs[_0xb5d9('0x1e')](_0x4a542b['query'][_0xb5d9('0x1e')]);_0x5bfb03[_0xb5d9('0x1d')]=qs[_0xb5d9('0x1d')](_0x4a542b['query']['offset']);}_0x5bfb03[_0xb5d9('0x36')]=qs[_0xb5d9('0x37')](_0x4a542b['query']['sort']);_0x5bfb03[_0xb5d9('0x38')]=qs[_0xb5d9('0x2f')](_['pick'](_0x4a542b[_0xb5d9('0x2d')],_0x298be7[_0xb5d9('0x2f')]),_0x558ef7);if(_0x4a542b[_0xb5d9('0x2d')][_0xb5d9('0x39')]){_0x5bfb03[_0xb5d9('0x38')]=_[_0xb5d9('0x3a')](_0x5bfb03['where'],{'$or':_['map'](_0x558ef7,function(_0x1089a8){if(_0x1089a8['type']!==_0xb5d9('0x3b')){var _0x96f2de={};_0x96f2de[_0x1089a8['name']]={'$like':'%'+_0x4a542b[_0xb5d9('0x2d')]['filter']+'%'};return _0x96f2de;}})});}_0x5bfb03=_[_0xb5d9('0x3a')]({},_0x5bfb03,_0x4a542b['options']);var _0x4126f0={'where':_0x5bfb03[_0xb5d9('0x38')]};return db['ChatTransferReport'][_0xb5d9('0x3c')](_0x4126f0)['then'](function(_0x525c60){_0x555f67[_0xb5d9('0x3c')]=_0x525c60;if(_0x4a542b[_0xb5d9('0x2d')]['includeAll']){_0x5bfb03[_0xb5d9('0x3d')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5bfb03);})[_0xb5d9('0x25')](function(_0x585d97){_0x555f67[_0xb5d9('0x3e')]=_0x585d97;return _0x555f67;})[_0xb5d9('0x25')](respondWithFilteredResult(_0x49326b,_0x5bfb03))[_0xb5d9('0x3f')](handleError(_0x49326b,null));};exports['show']=function(_0x21afff,_0x514b16){var _0x38b77e={'raw':!![],'where':{'id':_0x21afff[_0xb5d9('0x40')]['id']}},_0x56e6c0={};_0x56e6c0[_0xb5d9('0x2c')]=_[_0xb5d9('0x2e')](db[_0xb5d9('0x41')][_0xb5d9('0x2a')]);_0x56e6c0[_0xb5d9('0x2d')]=_[_0xb5d9('0x2e')](_0x21afff[_0xb5d9('0x2d')]);_0x56e6c0[_0xb5d9('0x2f')]=_[_0xb5d9('0x30')](_0x56e6c0[_0xb5d9('0x2c')],_0x56e6c0[_0xb5d9('0x2d')]);_0x38b77e[_0xb5d9('0x32')]=_[_0xb5d9('0x30')](_0x56e6c0[_0xb5d9('0x2c')],qs[_0xb5d9('0x31')](_0x21afff[_0xb5d9('0x2d')][_0xb5d9('0x31')]));_0x38b77e[_0xb5d9('0x32')]=_0x38b77e[_0xb5d9('0x32')][_0xb5d9('0x33')]?_0x38b77e[_0xb5d9('0x32')]:_0x56e6c0[_0xb5d9('0x2c')];if(_0x21afff[_0xb5d9('0x2d')][_0xb5d9('0x42')]){_0x38b77e[_0xb5d9('0x3d')]=[{'all':!![]}];}_0x38b77e=_[_0xb5d9('0x3a')]({},_0x38b77e,_0x21afff[_0xb5d9('0x43')]);return db[_0xb5d9('0x41')]['find'](_0x38b77e)[_0xb5d9('0x25')](handleEntityNotFound(_0x514b16,null))[_0xb5d9('0x25')](respondWithResult(_0x514b16,null))[_0xb5d9('0x3f')](handleError(_0x514b16,null));};exports[_0xb5d9('0x44')]=function(_0x333e77,_0x27fef0){return db[_0xb5d9('0x41')][_0xb5d9('0x44')](_0x333e77['body'],{})['then'](respondWithResult(_0x27fef0,0xc9))[_0xb5d9('0x3f')](handleError(_0x27fef0,null));};exports[_0xb5d9('0x45')]=function(_0x432aea,_0x522162){if(_0x432aea[_0xb5d9('0x46')]['id']){delete _0x432aea[_0xb5d9('0x46')]['id'];}return db['ChatTransferReport'][_0xb5d9('0x47')]({'where':{'id':_0x432aea[_0xb5d9('0x40')]['id']}})[_0xb5d9('0x25')](handleEntityNotFound(_0x522162,null))[_0xb5d9('0x25')](saveUpdates(_0x432aea[_0xb5d9('0x46')],null))[_0xb5d9('0x25')](respondWithResult(_0x522162,null))[_0xb5d9('0x3f')](handleError(_0x522162,null));};exports[_0xb5d9('0x48')]=function(_0x192cf8,_0x406584){return db[_0xb5d9('0x41')]['find']({'where':{'id':_0x192cf8[_0xb5d9('0x40')]['id']}})['then'](handleEntityNotFound(_0x406584,null))['then'](removeEntity(_0x406584,null))[_0xb5d9('0x3f')](handleError(_0x406584,null));};exports[_0xb5d9('0x49')]=function(_0x41682f,_0x588bac){return db['ChatTransferReport'][_0xb5d9('0x49')]()[_0xb5d9('0x25')](respondWithResult(_0x588bac,null))[_0xb5d9('0x3f')](handleError(_0x588bac,null));}; \ No newline at end of file +var _0xa5ee=['filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','reject','save','update','then','destroy','sendStatus','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','query','keys'];(function(_0x3b9ba7,_0x2500be){var _0x4c3dfe=function(_0x5c5db5){while(--_0x5c5db5){_0x3b9ba7['push'](_0x3b9ba7['shift']());}};_0x4c3dfe(++_0x2500be);}(_0xa5ee,0x1dc));var _0xea5e=function(_0x1d0374,_0x5b6bb0){_0x1d0374=_0x1d0374-0x0;var _0x55b65a=_0xa5ee[_0x1d0374];return _0x55b65a;};'use strict';var pdf=require(_0xea5e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea5e('0x1'));var zipdir=require(_0xea5e('0x2'));var jsonpatch=require(_0xea5e('0x3'));var rp=require(_0xea5e('0x4'));var moment=require(_0xea5e('0x5'));var BPromise=require(_0xea5e('0x6'));var Mustache=require(_0xea5e('0x7'));var util=require(_0xea5e('0x8'));var path=require(_0xea5e('0x9'));var sox=require(_0xea5e('0xa'));var csv=require(_0xea5e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xea5e('0xc'));var squel=require(_0xea5e('0xd'));var crypto=require(_0xea5e('0xe'));var jsforce=require(_0xea5e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xea5e('0x11'));var authService=require(_0xea5e('0x12'));var qs=require(_0xea5e('0x13'));var as=require(_0xea5e('0x14'));var hardwareService=require(_0xea5e('0x15'));var logger=require(_0xea5e('0x16'))(_0xea5e('0x17'));var utils=require(_0xea5e('0x18'));var config=require(_0xea5e('0x19'));var db=require(_0xea5e('0x1a'))['db'];function respondWithStatusCode(_0x539450,_0x11518e){_0x11518e=_0x11518e||0xcc;return function(_0x4832b4){if(_0x4832b4){return _0x539450['sendStatus'](_0x11518e);}return _0x539450[_0xea5e('0x1b')](_0x11518e)[_0xea5e('0x1c')]();};}function respondWithResult(_0x2530dd,_0x36dbdb){_0x36dbdb=_0x36dbdb||0xc8;return function(_0x36978c){if(_0x36978c){return _0x2530dd[_0xea5e('0x1b')](_0x36dbdb)[_0xea5e('0x1d')](_0x36978c);}};}function respondWithFilteredResult(_0x19f754,_0x1968f5){return function(_0xc43c29){if(_0xc43c29){var _0x35867e=_0xc43c29[_0xea5e('0x1e')],_0x1ea75a=_0x1968f5[_0xea5e('0x1f')],_0x43c93a=_0x1968f5[_0xea5e('0x1f')]+_0x1968f5[_0xea5e('0x20')],_0x37d395;if(_0x43c93a>=_0x35867e){_0x43c93a=_0x35867e;_0x37d395=0xc8;}else{_0x37d395=0xce;}_0x19f754[_0xea5e('0x1b')](_0x37d395);return _0x19f754['set']('Content-Range',_0x1ea75a+'-'+_0x43c93a+'/'+_0x35867e)['json'](_0xc43c29);}return null;};}function patchUpdates(_0xb9ae20){return function(_0x1045d0){try{jsonpatch['apply'](_0x1045d0,_0xb9ae20,!![]);}catch(_0x53d711){return BPromise[_0xea5e('0x21')](_0x53d711);}return _0x1045d0[_0xea5e('0x22')]();};}function saveUpdates(_0x511e6b,_0x4fdcab){return function(_0x23a25c){if(_0x23a25c){return _0x23a25c[_0xea5e('0x23')](_0x511e6b)[_0xea5e('0x24')](function(_0x3f2025){return _0x3f2025;});}return null;};}function removeEntity(_0xb1483e,_0xdea9d5){return function(_0x43b43a){if(_0x43b43a){return _0x43b43a[_0xea5e('0x25')]()[_0xea5e('0x24')](function(){_0xb1483e['status'](0xcc)[_0xea5e('0x1c')]();});}};}function handleEntityNotFound(_0x4b33f5,_0x1116e3){return function(_0x33898e){if(!_0x33898e){_0x4b33f5[_0xea5e('0x26')](0x194);}return _0x33898e;};}function handleError(_0x35dce9,_0x4063ff){_0x4063ff=_0x4063ff||0x1f4;return function(_0x3e2b17){logger[_0xea5e('0x27')](_0x3e2b17['stack']);if(_0x3e2b17['name']){delete _0x3e2b17['name'];}_0x35dce9['status'](_0x4063ff)[_0xea5e('0x28')](_0x3e2b17);};}exports[_0xea5e('0x29')]=function(_0x59021d,_0x155f0b){var _0x5971e5={},_0x5aa2f3={},_0xd18fc6={'count':0x0,'rows':[]};var _0x129376=_[_0xea5e('0x2a')](db[_0xea5e('0x2b')][_0xea5e('0x2c')],function(_0x3cd18c){return{'name':_0x3cd18c[_0xea5e('0x2d')],'type':_0x3cd18c[_0xea5e('0x2e')]['key']};});_0x5aa2f3['model']=_[_0xea5e('0x2a')](_0x129376,'name');_0x5aa2f3[_0xea5e('0x2f')]=_[_0xea5e('0x30')](_0x59021d[_0xea5e('0x2f')]);_0x5aa2f3[_0xea5e('0x31')]=_[_0xea5e('0x32')](_0x5aa2f3[_0xea5e('0x33')],_0x5aa2f3[_0xea5e('0x2f')]);_0x5971e5[_0xea5e('0x34')]=_['intersection'](_0x5aa2f3[_0xea5e('0x33')],qs['fields'](_0x59021d[_0xea5e('0x2f')][_0xea5e('0x35')]));_0x5971e5[_0xea5e('0x34')]=_0x5971e5[_0xea5e('0x34')][_0xea5e('0x36')]?_0x5971e5['attributes']:_0x5aa2f3[_0xea5e('0x33')];if(!_0x59021d['query']['hasOwnProperty'](_0xea5e('0x37'))){_0x5971e5['limit']=qs['limit'](_0x59021d[_0xea5e('0x2f')][_0xea5e('0x20')]);_0x5971e5[_0xea5e('0x1f')]=qs[_0xea5e('0x1f')](_0x59021d[_0xea5e('0x2f')][_0xea5e('0x1f')]);}_0x5971e5[_0xea5e('0x38')]=qs[_0xea5e('0x39')](_0x59021d[_0xea5e('0x2f')][_0xea5e('0x39')]);_0x5971e5['where']=qs[_0xea5e('0x31')](_[_0xea5e('0x3a')](_0x59021d['query'],_0x5aa2f3[_0xea5e('0x31')]),_0x129376);if(_0x59021d[_0xea5e('0x2f')][_0xea5e('0x3b')]){_0x5971e5[_0xea5e('0x3c')]=_[_0xea5e('0x3d')](_0x5971e5[_0xea5e('0x3c')],{'$or':_[_0xea5e('0x2a')](_0x129376,function(_0x48c514){if(_0x48c514[_0xea5e('0x2e')]!==_0xea5e('0x3e')){var _0xae642a={};_0xae642a[_0x48c514['name']]={'$like':'%'+_0x59021d[_0xea5e('0x2f')][_0xea5e('0x3b')]+'%'};return _0xae642a;}})});}_0x5971e5=_['merge']({},_0x5971e5,_0x59021d[_0xea5e('0x3f')]);var _0x446eb7={'where':_0x5971e5[_0xea5e('0x3c')]};return db['ChatTransferReport'][_0xea5e('0x1e')](_0x446eb7)[_0xea5e('0x24')](function(_0x7616cd){_0xd18fc6[_0xea5e('0x1e')]=_0x7616cd;if(_0x59021d[_0xea5e('0x2f')][_0xea5e('0x40')]){_0x5971e5[_0xea5e('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xea5e('0x42')](_0x5971e5);})[_0xea5e('0x24')](function(_0x244c4b){_0xd18fc6[_0xea5e('0x43')]=_0x244c4b;return _0xd18fc6;})[_0xea5e('0x24')](respondWithFilteredResult(_0x155f0b,_0x5971e5))[_0xea5e('0x44')](handleError(_0x155f0b,null));};exports[_0xea5e('0x45')]=function(_0x37b2fb,_0x301be5){var _0x5a05a1={'raw':!![],'where':{'id':_0x37b2fb['params']['id']}},_0x5cb535={};_0x5cb535[_0xea5e('0x33')]=_[_0xea5e('0x30')](db[_0xea5e('0x2b')]['rawAttributes']);_0x5cb535[_0xea5e('0x2f')]=_['keys'](_0x37b2fb['query']);_0x5cb535['filters']=_[_0xea5e('0x32')](_0x5cb535[_0xea5e('0x33')],_0x5cb535['query']);_0x5a05a1[_0xea5e('0x34')]=_['intersection'](_0x5cb535[_0xea5e('0x33')],qs[_0xea5e('0x35')](_0x37b2fb['query'][_0xea5e('0x35')]));_0x5a05a1[_0xea5e('0x34')]=_0x5a05a1[_0xea5e('0x34')][_0xea5e('0x36')]?_0x5a05a1[_0xea5e('0x34')]:_0x5cb535[_0xea5e('0x33')];if(_0x37b2fb['query']['includeAll']){_0x5a05a1['include']=[{'all':!![]}];}_0x5a05a1=_[_0xea5e('0x3d')]({},_0x5a05a1,_0x37b2fb[_0xea5e('0x3f')]);return db[_0xea5e('0x2b')]['find'](_0x5a05a1)['then'](handleEntityNotFound(_0x301be5,null))[_0xea5e('0x24')](respondWithResult(_0x301be5,null))[_0xea5e('0x44')](handleError(_0x301be5,null));};exports[_0xea5e('0x46')]=function(_0x512a0b,_0x2bd00a){return db[_0xea5e('0x2b')][_0xea5e('0x46')](_0x512a0b[_0xea5e('0x47')],{})[_0xea5e('0x24')](respondWithResult(_0x2bd00a,0xc9))[_0xea5e('0x44')](handleError(_0x2bd00a,null));};exports['update']=function(_0x47a988,_0x19ffd1){if(_0x47a988[_0xea5e('0x47')]['id']){delete _0x47a988[_0xea5e('0x47')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x47a988[_0xea5e('0x48')]['id']}})[_0xea5e('0x24')](handleEntityNotFound(_0x19ffd1,null))['then'](saveUpdates(_0x47a988['body'],null))['then'](respondWithResult(_0x19ffd1,null))[_0xea5e('0x44')](handleError(_0x19ffd1,null));};exports[_0xea5e('0x25')]=function(_0x59060b,_0x320c7d){return db[_0xea5e('0x2b')][_0xea5e('0x49')]({'where':{'id':_0x59060b[_0xea5e('0x48')]['id']}})[_0xea5e('0x24')](handleEntityNotFound(_0x320c7d,null))[_0xea5e('0x24')](removeEntity(_0x320c7d,null))[_0xea5e('0x44')](handleError(_0x320c7d,null));};exports[_0xea5e('0x4a')]=function(_0x3d3984,_0x88391){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x88391,null))[_0xea5e('0x44')](handleError(_0x88391,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 63e22f3..99456ed 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 _0x0b80=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x52246c,_0x32403f){var _0x3a690c=function(_0x182b60){while(--_0x182b60){_0x52246c['push'](_0x52246c['shift']());}};_0x3a690c(++_0x32403f);}(_0x0b80,0x196));var _0x00b8=function(_0x81a5f2,_0x271329){_0x81a5f2=_0x81a5f2-0x0;var _0x229abd=_0x0b80[_0x81a5f2];return _0x229abd;};'use strict';var _=require(_0x00b8('0x0'));var util=require(_0x00b8('0x1'));var logger=require(_0x00b8('0x2'))('api');var moment=require(_0x00b8('0x3'));var BPromise=require(_0x00b8('0x4'));var rp=require(_0x00b8('0x5'));var fs=require('fs');var path=require(_0x00b8('0x6'));var rimraf=require(_0x00b8('0x7'));var config=require(_0x00b8('0x8'));var attributes=require(_0x00b8('0x9'));module[_0x00b8('0xa')]=function(_0x40ddc6,_0x337508){return _0x40ddc6[_0x00b8('0xb')](_0x00b8('0xc'),attributes,{'tableName':_0x00b8('0xd'),'paranoid':![],'indexes':[{'name':_0x00b8('0xe'),'fields':[_0x00b8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5034=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x1ac571,_0xebb9fb){var _0x42b9af=function(_0x490b4b){while(--_0x490b4b){_0x1ac571['push'](_0x1ac571['shift']());}};_0x42b9af(++_0xebb9fb);}(_0x5034,0x8d));var _0x4503=function(_0x43f55b,_0x3f14e0){_0x43f55b=_0x43f55b-0x0;var _0x16683d=_0x5034[_0x43f55b];return _0x16683d;};'use strict';var _=require(_0x4503('0x0'));var util=require(_0x4503('0x1'));var logger=require(_0x4503('0x2'))('api');var moment=require(_0x4503('0x3'));var BPromise=require(_0x4503('0x4'));var rp=require(_0x4503('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4503('0x6'));var config=require(_0x4503('0x7'));var attributes=require(_0x4503('0x8'));module[_0x4503('0x9')]=function(_0x217cd4,_0x516a40){return _0x217cd4['define'](_0x4503('0xa'),attributes,{'tableName':_0x4503('0xb'),'paranoid':![],'indexes':[{'name':_0x4503('0xc'),'fields':[_0x4503('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a385d75..39975ef 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 _0x1f64=['result','lodash','util','bluebird','ioredis','../../config/utils','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x1f64,0xfd));var _0x41f6=function(_0x55db59,_0x4f7017){_0x55db59=_0x55db59-0x0;var _0x3a9298=_0x1f64[_0x55db59];return _0x3a9298;};'use strict';var _=require(_0x41f6('0x0'));var util=require(_0x41f6('0x1'));var moment=require('moment');var BPromise=require(_0x41f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x41f6('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x41f6('0x5'));var client=jayson[_0x41f6('0x6')][_0x41f6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a5f45,_0x1f2295,_0x4ab123){return new BPromise(function(_0xde7f0b,_0x231598){return client[_0x41f6('0x8')](_0x2a5f45,_0x4ab123)['then'](function(_0x26bb20){logger[_0x41f6('0x9')](_0x41f6('0xa'),_0x1f2295,'request\x20sent');logger[_0x41f6('0xb')](_0x41f6('0xc'),_0x1f2295,_0x41f6('0xd'),JSON['stringify'](_0x26bb20));if(_0x26bb20[_0x41f6('0xe')]){if(_0x26bb20[_0x41f6('0xe')][_0x41f6('0xf')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1f2295,_0x26bb20[_0x41f6('0xe')]['message']);return _0x231598(_0x26bb20[_0x41f6('0xe')][_0x41f6('0x10')]);}logger[_0x41f6('0xe')](_0x41f6('0xa'),_0x1f2295,_0x26bb20['error']['message']);return _0xde7f0b(_0x26bb20[_0x41f6('0xe')]['message']);}else{logger[_0x41f6('0x9')](_0x41f6('0xa'),_0x1f2295,_0x41f6('0xd'));_0xde7f0b(_0x26bb20[_0x41f6('0x11')][_0x41f6('0x10')]);}})['catch'](function(_0x2c28fc){logger['error'](_0x41f6('0xa'),_0x1f2295,_0x2c28fc);_0x231598(_0x2c28fc);});});} \ No newline at end of file +var _0xf1d0=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x33375c,_0x327942){var _0x24084e=function(_0x21039b){while(--_0x21039b){_0x33375c['push'](_0x33375c['shift']());}};_0x24084e(++_0x327942);}(_0xf1d0,0xdd));var _0x0f1d=function(_0x5372e2,_0x531fcf){_0x5372e2=_0x5372e2-0x0;var _0x55ff3d=_0xf1d0[_0x5372e2];return _0x55ff3d;};'use strict';var _=require(_0x0f1d('0x0'));var util=require(_0x0f1d('0x1'));var moment=require(_0x0f1d('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f1d('0x3'));var fs=require('fs');var Redis=require(_0x0f1d('0x4'));var db=require(_0x0f1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f1d('0x6'))('rpc');var config=require(_0x0f1d('0x7'));var jayson=require(_0x0f1d('0x8'));var client=jayson[_0x0f1d('0x9')][_0x0f1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11a15b,_0x4335df,_0x44e82e){return new BPromise(function(_0x47cc7d,_0x5f0631){return client[_0x0f1d('0xb')](_0x11a15b,_0x44e82e)[_0x0f1d('0xc')](function(_0xf9ed79){logger[_0x0f1d('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4335df,_0x0f1d('0xe'));logger[_0x0f1d('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4335df,_0x0f1d('0xe'),JSON[_0x0f1d('0x10')](_0xf9ed79));if(_0xf9ed79[_0x0f1d('0x11')]){if(_0xf9ed79[_0x0f1d('0x11')][_0x0f1d('0x12')]===0x1f4){logger[_0x0f1d('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4335df,_0xf9ed79[_0x0f1d('0x11')][_0x0f1d('0x13')]);return _0x5f0631(_0xf9ed79['error']['message']);}logger[_0x0f1d('0x11')](_0x0f1d('0x14'),_0x4335df,_0xf9ed79['error'][_0x0f1d('0x13')]);return _0x47cc7d(_0xf9ed79[_0x0f1d('0x11')][_0x0f1d('0x13')]);}else{logger[_0x0f1d('0xd')](_0x0f1d('0x14'),_0x4335df,_0x0f1d('0xe'));_0x47cc7d(_0xf9ed79[_0x0f1d('0x15')][_0x0f1d('0x13')]);}})[_0x0f1d('0x16')](function(_0x1b4fe5){logger[_0x0f1d('0x11')](_0x0f1d('0x14'),_0x4335df,_0x1b4fe5);_0x5f0631(_0x1b4fe5);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 645ef47..e44340a 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(_0x32c57d,_0x4b455a){var _0x353d7f=function(_0x15b980){while(--_0x15b980){_0x32c57d['push'](_0x32c57d['shift']());}};_0x353d7f(++_0x4b455a);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a3fe2,_0x553b71){_0x1a3fe2=_0x1a3fe2-0x0;var _0x490ee2=_0xb10b[_0x1a3fe2];return _0x490ee2;};'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 _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(_0x16df8f,_0x3dbe15){var _0x56ffee=function(_0x23aa44){while(--_0x23aa44){_0x16df8f['push'](_0x16df8f['shift']());}};_0x56ffee(++_0x3dbe15);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b58ba,_0x16159f){_0x5b58ba=_0x5b58ba-0x0;var _0xc67099=_0xb10b[_0x5b58ba];return _0xc67099;};'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 diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index f954d88..b8e0e94 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 _0xbccd=['squared','We\x20are\x20here!','Chat','Send','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','text','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xbccd[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xdbcc('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![],'unique':_0xdbcc('0x2')},'description':{'type':Sequelize[_0xdbcc('0x1')]},'mapKey':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0x3')},'key':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x4')},'customerAlias':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![],'defaultValue':_0xdbcc('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![],'defaultValue':_0xdbcc('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![],'defaultValue':_0xdbcc('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xdbcc('0x8'),_0xdbcc('0x9')),'defaultValue':_0xdbcc('0x8')},'header_online':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0xa')},'start_chat_button':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdbcc('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdbcc('0xf')]},'closingQuestion':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0x11')},'noteTitle':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x12')},'placeholderMessage':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x13')},'closingMessage':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x14')},'closingMessageButton':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0xc')},'skipMessageButton':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x15')},'conditionAgreement':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xdbcc('0x17'),'thumb'),'defaultValue':_0xdbcc('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdbcc('0x18')]({'items':[{'type':_0xdbcc('0x19'),'variable':null,'config':{'placeholder':_0xdbcc('0x1a'),'type':_0xdbcc('0x1b'),'required':!![]},'props':{'title':_0xdbcc('0x1a'),'helpText':''}},{'type':_0xdbcc('0x19'),'props':{'title':_0xdbcc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xdbcc('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdbcc('0x1c')]('onlineForm')?JSON[_0xdbcc('0x1d')](this[_0xdbcc('0x1c')]('onlineForm')):{};},'set':function(_0x18d76d){return this[_0xdbcc('0x1e')](_0xdbcc('0x1f'),JSON['stringify'](_0x18d76d));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdbcc('0x18')]({'items':[{'type':_0xdbcc('0x19'),'props':{'title':_0xdbcc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xdbcc('0x3')},'variable':null},{'type':_0xdbcc('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xdbcc('0x21'),'helpText':_0xdbcc('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xdbcc('0x1c')]('offlineForm')?JSON[_0xdbcc('0x1d')](this['getDataValue'](_0xdbcc('0x23'))):{};},'set':function(_0x57d722){return this[_0xdbcc('0x1e')]('offlineForm',JSON[_0xdbcc('0x18')](_0x57d722));}},'token':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':function(){return rs[_0xdbcc('0x24')]();}},'autoclose':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xdbcc('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xdbcc('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x28')},'skipUnmanaged':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x15')},'sendUnmanaged':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xdbcc('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdbcc('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xdbcc('0x2b')},'verticalAlignment':{'type':Sequelize[_0xdbcc('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xdbcc('0x1')]},'customerAvatar':{'type':Sequelize[_0xdbcc('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdbcc('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdbcc('0x1')],'allowNull':![],'defaultValue':_0xdbcc('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':_0xdbcc('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdbcc('0xd')],'comment':_0xdbcc('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![],'comment':_0xdbcc('0x2f'),'set':function(_0x7f1b20){if(!_0x7f1b20)this[_0xdbcc('0x1e')](_0xdbcc('0x30'),null);this[_0xdbcc('0x1e')]('mandatoryDisposition',_0x7f1b20);}},'vidaooEscalation':{'type':Sequelize[_0xdbcc('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdbcc('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x34ab=['thumb','star','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ab,0xf1));var _0xb34a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34ab[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb34a('0x0'));var rs=require(_0xb34a('0x1'));module[_0xb34a('0x2')]={'name':{'type':Sequelize[_0xb34a('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xb34a('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x5')},'customerAlias':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb34a('0x3')],'allowNull':![],'defaultValue':_0xb34a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb34a('0x3')],'allowNull':![],'defaultValue':_0xb34a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb34a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb34a('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb34a('0xa')](_0xb34a('0xb'),'squared'),'defaultValue':_0xb34a('0xb')},'header_online':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xc')},'start_chat_button':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xd')},'offline_chat_button':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xe')},'header_offline':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb34a('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb34a('0x11')]},'closingQuestion':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x14')},'placeholderMessage':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x16')},'closingMessageButton':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xe')},'skipMessageButton':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x17')},'ratingType':{'type':Sequelize[_0xb34a('0xa')]('star',_0xb34a('0x18')),'defaultValue':_0xb34a('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xb34a('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xb34a('0x1a')]({'items':[{'type':_0xb34a('0x1b'),'variable':null,'config':{'placeholder':_0xb34a('0x1c'),'type':_0xb34a('0x1d'),'required':!![]},'props':{'title':_0xb34a('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0xb34a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb34a('0x1e')](_0xb34a('0x1f'))?JSON[_0xb34a('0x20')](this['getDataValue']('onlineForm')):{};},'set':function(_0x3324a2){return this[_0xb34a('0x21')]('onlineForm',JSON[_0xb34a('0x1a')](_0x3324a2));}},'offlineForm':{'type':Sequelize[_0xb34a('0x11')],'defaultValue':function(){return JSON[_0xb34a('0x1a')]({'items':[{'type':_0xb34a('0x1b'),'props':{'title':_0xb34a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xb34a('0x4')},'variable':null},{'type':_0xb34a('0x22'),'config':{'placeholder':'Comments'},'props':{'title':_0xb34a('0x23'),'helpText':_0xb34a('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xb34a('0x1e')](_0xb34a('0x25'))?JSON['parse'](this['getDataValue'](_0xb34a('0x25'))):{};},'set':function(_0x8cc74d){return this['setDataValue'](_0xb34a('0x25'),JSON[_0xb34a('0x1a')](_0x8cc74d));}},'token':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':function(){return rs[_0xb34a('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb34a('0x3')]},'waitingTitle':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x27')},'waitingMessage':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x29')},'offlineMessageBody':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb34a('0x2b')},'sendUnmanaged':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb34a('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb34a('0x2c');}},'notificationSound':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb34a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xb34a('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x2e')},'defaultTitle':{'type':Sequelize[_0xb34a('0x3')]},'customerAvatar':{'type':Sequelize[_0xb34a('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb34a('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb34a('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb34a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':_0xb34a('0x30')},'systemAvatar':{'type':Sequelize[_0xb34a('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb34a('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb34a('0x32'),'set':function(_0x510f7d){if(!_0x510f7d)this[_0xb34a('0x21')](_0xb34a('0x33'),null);this[_0xb34a('0x21')](_0xb34a('0x34'),_0x510f7d);}},'vidaooEscalation':{'type':Sequelize[_0xb34a('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c669328..e77fb57 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 _0x4d2e=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','ChatWebsiteId','Disposition','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','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','isNil','showCustomerAvatar','getSystemAvatar','headers','chat','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','unknown','device','vendor','format','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','notify','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','MailAccount','findOne','MailServerOut','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','replace','alignment','color','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','omit','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','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','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','VIRTUAL','filter','merge','options','ChatWebsite','include','findAll','rows','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource'];(function(_0x52e994,_0x2d6434){var _0x1253e0=function(_0x1128e5){while(--_0x1128e5){_0x52e994['push'](_0x52e994['shift']());}};_0x1253e0(++_0x2d6434);}(_0x4d2e,0x1e0));var _0xe4d2=function(_0x4753db,_0x346fa7){_0x4753db=_0x4753db-0x0;var _0x1ee50d=_0x4d2e[_0x4753db];return _0x1ee50d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe4d2('0x0'));var zipdir=require(_0xe4d2('0x1'));var jsonpatch=require(_0xe4d2('0x2'));var rp=require(_0xe4d2('0x3'));var moment=require(_0xe4d2('0x4'));var BPromise=require(_0xe4d2('0x5'));var Mustache=require(_0xe4d2('0x6'));var util=require(_0xe4d2('0x7'));var path=require('path');var sox=require(_0xe4d2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe4d2('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe4d2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe4d2('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4d2('0xc'));var authService=require(_0xe4d2('0xd'));var qs=require(_0xe4d2('0xe'));var as=require(_0xe4d2('0xf'));var hardwareService=require(_0xe4d2('0x10'));var logger=require(_0xe4d2('0x11'))(_0xe4d2('0x12'));var utils=require(_0xe4d2('0x13'));var config=require(_0xe4d2('0x14'));var db=require('../../mysqldb')['db'];config[_0xe4d2('0x15')]=_['defaults'](config[_0xe4d2('0x15')],{'host':_0xe4d2('0x16'),'port':0x18eb});var socket=require(_0xe4d2('0x17'))(new Redis(config[_0xe4d2('0x15')]));require(_0xe4d2('0x18'))[_0xe4d2('0x19')](socket);var jayson=require(_0xe4d2('0x1a'));var client=jayson[_0xe4d2('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xe4d2('0x1b')][_0xe4d2('0x1c')]({'port':0x232a});var client9003=jayson[_0xe4d2('0x1b')][_0xe4d2('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x5b6736,_0x4863bc,_0x629087){if(_0x629087){var _0x38e509=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38e509[_0xe4d2('0x1d')](_0x4863bc)){return _0x5b6736;}else{throw new db[(_0xe4d2('0x1e'))][(_0xe4d2('0x1f'))](_0xe4d2('0x20'));}}else{return _0x5b6736;}}function respondWithRpcPromise(_0x461f5c,_0x4ddec4,_0x32da1f,_0xdb8439){return new BPromise(function(_0x18b4ea,_0x3fa1ec){var _0x2687f5=_0xdb8439||client;return _0x2687f5[_0xe4d2('0x21')](_0x461f5c,_0x32da1f)[_0xe4d2('0x22')](function(_0x577268){logger[_0xe4d2('0x23')](_0xe4d2('0x24'),_0x4ddec4,'request\x20sent');logger[_0xe4d2('0x25')](_0xe4d2('0x26'),_0x4ddec4,_0xe4d2('0x27'),JSON['stringify'](_0x577268));if(_0x577268['error']){if(_0x577268[_0xe4d2('0x28')][_0xe4d2('0x29')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4ddec4,_0x577268[_0xe4d2('0x28')][_0xe4d2('0x2a')]);return _0x3fa1ec(_0x577268[_0xe4d2('0x28')][_0xe4d2('0x2a')]);}logger['error'](_0xe4d2('0x24'),_0x4ddec4,_0x577268['error'][_0xe4d2('0x2a')]);return _0x18b4ea(_0x577268['error'][_0xe4d2('0x2a')]);}else{logger[_0xe4d2('0x23')](_0xe4d2('0x24'),_0x4ddec4,_0xe4d2('0x27'));_0x18b4ea(_0x577268[_0xe4d2('0x2b')][_0xe4d2('0x2a')]);}})[_0xe4d2('0x2c')](function(_0x318c40){logger['error'](_0xe4d2('0x24'),_0x4ddec4,_0x318c40);_0x3fa1ec(_0x318c40);});});}function respondWithStatusCode(_0x3c8866,_0x2721e9){_0x2721e9=_0x2721e9||0xcc;return function(_0x1bbea7){if(_0x1bbea7){return _0x3c8866['sendStatus'](_0x2721e9);}return _0x3c8866['status'](_0x2721e9)[_0xe4d2('0x2d')]();};}function respondWithResult(_0x4cf496,_0x2aead1){_0x2aead1=_0x2aead1||0xc8;return function(_0x3bddab){if(_0x3bddab){return _0x4cf496[_0xe4d2('0x2e')](_0x2aead1)[_0xe4d2('0x2f')](_0x3bddab);}};}function respondWithFilteredResult(_0x2935a5,_0x114e23){return function(_0x2b9d7f){if(_0x2b9d7f){var _0x3ce1f1=_0x2b9d7f[_0xe4d2('0x30')],_0x153f78=_0x114e23['offset'],_0x307347=_0x114e23[_0xe4d2('0x31')]+_0x114e23[_0xe4d2('0x32')],_0x52d759;if(_0x307347>=_0x3ce1f1){_0x307347=_0x3ce1f1;_0x52d759=0xc8;}else{_0x52d759=0xce;}_0x2935a5[_0xe4d2('0x2e')](_0x52d759);return _0x2935a5[_0xe4d2('0x33')](_0xe4d2('0x34'),_0x153f78+'-'+_0x307347+'/'+_0x3ce1f1)['json'](_0x2b9d7f);}return null;};}function patchUpdates(_0x1ef563){return function(_0xa79c26){try{jsonpatch[_0xe4d2('0x35')](_0xa79c26,_0x1ef563,!![]);}catch(_0x40a166){return BPromise[_0xe4d2('0x36')](_0x40a166);}return _0xa79c26[_0xe4d2('0x37')]();};}function saveUpdates(_0x17a91a,_0x3d4a18){return function(_0x30073e){if(_0x30073e){return _0x30073e[_0xe4d2('0x38')](_0x17a91a)[_0xe4d2('0x22')](function(_0x4a4182){return _0x4a4182;});}return null;};}function removeEntity(_0x2c4b86,_0x290220){return function(_0x311bd0){if(_0x311bd0){return _0x311bd0[_0xe4d2('0x39')]()[_0xe4d2('0x22')](function(){var _0x2ce9c1=_0x311bd0[_0xe4d2('0x3a')]({'plain':!![]});var _0x43d3dd=_0xe4d2('0x3b');return db['UserProfileResource'][_0xe4d2('0x39')]({'where':{'type':_0x43d3dd,'resourceId':_0x2ce9c1['id']}})[_0xe4d2('0x22')](function(){return _0x311bd0;});})[_0xe4d2('0x22')](function(){_0x2c4b86[_0xe4d2('0x2e')](0xcc)[_0xe4d2('0x2d')]();});}};}function handleEntityNotFound(_0x4db200,_0x551af9){return function(_0x3548b5){if(!_0x3548b5){_0x4db200[_0xe4d2('0x3c')](0x194);}return _0x3548b5;};}function handleError(_0x570e22,_0x168102){_0x168102=_0x168102||0x1f4;return function(_0x5d4838){logger[_0xe4d2('0x28')](_0x5d4838[_0xe4d2('0x3d')]);if(_0x5d4838['name']){delete _0x5d4838[_0xe4d2('0x3e')];}_0x570e22[_0xe4d2('0x2e')](_0x168102)[_0xe4d2('0x3f')](_0x5d4838);};}exports[_0xe4d2('0x40')]=function(_0x99a03b,_0x1dd1c4){var _0x36d21d={'include':[{'model':db[_0xe4d2('0x41')],'as':_0xe4d2('0x42')}]},_0x58cb3e={},_0x238921={'count':0x0,'rows':[]};var _0x20ff74=_[_0xe4d2('0x43')](db['ChatWebsite'][_0xe4d2('0x44')],function(_0x135e80){return{'name':_0x135e80[_0xe4d2('0x45')],'type':_0x135e80[_0xe4d2('0x46')][_0xe4d2('0x47')]};});_0x58cb3e[_0xe4d2('0x48')]=_[_0xe4d2('0x43')](_0x20ff74,_0xe4d2('0x3e'));_0x58cb3e[_0xe4d2('0x49')]=_[_0xe4d2('0x4a')](_0x99a03b[_0xe4d2('0x49')]);_0x58cb3e[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x58cb3e['model'],_0x58cb3e[_0xe4d2('0x49')]);_0x36d21d['attributes']=_[_0xe4d2('0x4c')](_0x58cb3e[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x99a03b[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x36d21d[_0xe4d2('0x4e')]=_0x36d21d['attributes'][_0xe4d2('0x4f')]?_0x36d21d['attributes']:_0x58cb3e[_0xe4d2('0x48')];if(!_0x99a03b[_0xe4d2('0x49')]['hasOwnProperty'](_0xe4d2('0x50'))){_0x36d21d[_0xe4d2('0x32')]=qs['limit'](_0x99a03b[_0xe4d2('0x49')][_0xe4d2('0x32')]);_0x36d21d[_0xe4d2('0x31')]=qs['offset'](_0x99a03b[_0xe4d2('0x49')][_0xe4d2('0x31')]);}_0x36d21d['order']=qs[_0xe4d2('0x51')](_0x99a03b[_0xe4d2('0x49')][_0xe4d2('0x51')]);_0x36d21d[_0xe4d2('0x52')]=qs['filters'](_['pick'](_0x99a03b[_0xe4d2('0x49')],_0x58cb3e['filters']),_0x20ff74);if(_0x99a03b[_0xe4d2('0x49')]['filter']){_0x36d21d[_0xe4d2('0x52')]=_['merge'](_0x36d21d[_0xe4d2('0x52')],{'$or':_[_0xe4d2('0x43')](_0x20ff74,function(_0x534430){if(_0x534430['type']!==_0xe4d2('0x53')){var _0x332af9={};_0x332af9[_0x534430['name']]={'$like':'%'+_0x99a03b[_0xe4d2('0x49')][_0xe4d2('0x54')]+'%'};return _0x332af9;}})});}_0x36d21d=_[_0xe4d2('0x55')]({},_0x36d21d,_0x99a03b[_0xe4d2('0x56')]);var _0x3dd4f3={'where':_0x36d21d[_0xe4d2('0x52')]};return db[_0xe4d2('0x57')]['count'](_0x3dd4f3)[_0xe4d2('0x22')](function(_0x129ae9){_0x238921[_0xe4d2('0x30')]=_0x129ae9;if(_0x99a03b[_0xe4d2('0x49')]['includeAll']){_0x36d21d[_0xe4d2('0x58')]=[{'all':!![]}];}return db['ChatWebsite'][_0xe4d2('0x59')](_0x36d21d);})[_0xe4d2('0x22')](function(_0x1794c5){_0x238921[_0xe4d2('0x5a')]=_0x1794c5;return _0x238921;})[_0xe4d2('0x22')](respondWithFilteredResult(_0x1dd1c4,_0x36d21d))[_0xe4d2('0x2c')](handleError(_0x1dd1c4,null));};exports[_0xe4d2('0x5b')]=function(_0x18ca19,_0x43eff8){var _0x5ef72e={'raw':![],'where':{'id':_0x18ca19[_0xe4d2('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe4d2('0x42')}]},_0x3e4fac={};_0x3e4fac[_0xe4d2('0x48')]=_['keys'](db[_0xe4d2('0x57')][_0xe4d2('0x44')]);_0x3e4fac['query']=_[_0xe4d2('0x4a')](_0x18ca19['query']);_0x3e4fac[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x3e4fac[_0xe4d2('0x48')],_0x3e4fac[_0xe4d2('0x49')]);_0x5ef72e['attributes']=_[_0xe4d2('0x4c')](_0x3e4fac[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x18ca19[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x5ef72e[_0xe4d2('0x4e')]=_0x5ef72e['attributes']['length']?_0x5ef72e[_0xe4d2('0x4e')]:_0x3e4fac[_0xe4d2('0x48')];if(_0x18ca19['query'][_0xe4d2('0x5d')]){_0x5ef72e[_0xe4d2('0x58')]=[{'all':!![]}];}_0x5ef72e=_[_0xe4d2('0x55')]({},_0x5ef72e,_0x18ca19['options']);return db[_0xe4d2('0x57')]['find'](_0x5ef72e)[_0xe4d2('0x22')](handleEntityNotFound(_0x43eff8,null))[_0xe4d2('0x22')](respondWithResult(_0x43eff8,null))['catch'](handleError(_0x43eff8,null));};exports[_0xe4d2('0x5e')]=function(_0x3af04a,_0x4f48a0){return db[_0xe4d2('0x57')][_0xe4d2('0x5e')](_0x3af04a[_0xe4d2('0x5f')],{})[_0xe4d2('0x22')](function(_0x307eee){var _0xc4a63a=_0x3af04a[_0xe4d2('0x60')][_0xe4d2('0x3a')]({'plain':!![]});if(!_0xc4a63a)throw new Error(_0xe4d2('0x61'));if(_0xc4a63a[_0xe4d2('0x62')]===_0xe4d2('0x60')){var _0x2548fa=_0x307eee[_0xe4d2('0x3a')]({'plain':!![]});var _0x5385c6=_0xe4d2('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x5385c6,'userProfileId':_0xc4a63a[_0xe4d2('0x63')]},'raw':!![]})['then'](function(_0x13b2aa){if(_0x13b2aa&&_0x13b2aa[_0xe4d2('0x64')]===0x0){return db[_0xe4d2('0x65')][_0xe4d2('0x5e')]({'name':_0x2548fa[_0xe4d2('0x3e')],'resourceId':_0x2548fa['id'],'type':_0x13b2aa[_0xe4d2('0x3e')],'sectionId':_0x13b2aa['id']},{})['then'](function(){return _0x307eee;});}else{return _0x307eee;}})[_0xe4d2('0x2c')](function(_0x5e5749){logger['error'](_0xe4d2('0x66'),_0x5e5749);throw _0x5e5749;});}return _0x307eee;})[_0xe4d2('0x22')](respondWithResult(_0x4f48a0,0xc9))[_0xe4d2('0x2c')](handleError(_0x4f48a0,null));};exports[_0xe4d2('0x38')]=function(_0x23fcce,_0x59034e){if(_0x23fcce[_0xe4d2('0x5f')]['id']){delete _0x23fcce[_0xe4d2('0x5f')]['id'];}return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x23fcce[_0xe4d2('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xe4d2('0x22')](handleEntityNotFound(_0x59034e,null))['then'](saveUpdates(_0x23fcce[_0xe4d2('0x5f')],null))[_0xe4d2('0x22')](respondWithResult(_0x59034e,null))[_0xe4d2('0x2c')](handleError(_0x59034e,null));};exports[_0xe4d2('0x39')]=function(_0x274079,_0x3c7f6c){return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x274079[_0xe4d2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c7f6c,null))['then'](removeEntity(_0x3c7f6c,null))[_0xe4d2('0x2c')](handleError(_0x3c7f6c,null));};exports[_0xe4d2('0x68')]=function(_0x13e7ca,_0x1c7d96){return db[_0xe4d2('0x57')]['describe']()[_0xe4d2('0x22')](respondWithResult(_0x1c7d96,null))[_0xe4d2('0x2c')](handleError(_0x1c7d96,null));};exports[_0xe4d2('0x69')]=function(_0xe9f448,_0x2abbdb,_0x53cba5){if(_0xe9f448[_0xe4d2('0x5f')]['id']){delete _0xe9f448[_0xe4d2('0x5f')]['id'];}return db[_0xe4d2('0x57')]['find']({'where':{'id':_0xe9f448['params']['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x2abbdb,null))[_0xe4d2('0x22')](function(_0x2c26f2){if(_0x2c26f2){_0xe9f448[_0xe4d2('0x5f')][_0xe4d2('0x6a')]=_0x2c26f2['id'];return db[_0xe4d2('0x6b')][_0xe4d2('0x5e')](_0xe9f448[_0xe4d2('0x5f')]);}})[_0xe4d2('0x22')](respondWithResult(_0x2abbdb,null))[_0xe4d2('0x2c')](handleError(_0x2abbdb,null));};exports['getDispositions']=function(_0x19f7ac,_0x424387,_0x37c174){var _0x4fd939={'raw':![],'where':{}};var _0x1a848b={};var _0x15d860={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x19f7ac[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x424387,null))[_0xe4d2('0x22')](function(_0x30d4ba){if(_0x30d4ba){_0x1a848b['model']=_[_0xe4d2('0x4a')](db[_0xe4d2('0x6b')]['rawAttributes']);_0x1a848b['query']=_[_0xe4d2('0x4a')](_0x19f7ac[_0xe4d2('0x49')]);_0x1a848b[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x1a848b[_0xe4d2('0x48')],_0x1a848b[_0xe4d2('0x49')]);_0x4fd939[_0xe4d2('0x4e')]=_[_0xe4d2('0x4c')](_0x1a848b[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x19f7ac['query'][_0xe4d2('0x4d')]));_0x4fd939[_0xe4d2('0x4e')]=_0x4fd939[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x4fd939[_0xe4d2('0x4e')]:_0x1a848b[_0xe4d2('0x48')];if(!_0x19f7ac[_0xe4d2('0x49')][_0xe4d2('0x6c')](_0xe4d2('0x50'))){_0x4fd939[_0xe4d2('0x32')]=qs['limit'](_0x19f7ac[_0xe4d2('0x49')]['limit']);_0x4fd939[_0xe4d2('0x31')]=qs['offset'](_0x19f7ac['query'][_0xe4d2('0x31')]);}_0x4fd939[_0xe4d2('0x6d')]=qs[_0xe4d2('0x51')](_0x19f7ac[_0xe4d2('0x49')][_0xe4d2('0x51')]);_0x4fd939[_0xe4d2('0x52')]=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0x19f7ac[_0xe4d2('0x49')],_0x1a848b[_0xe4d2('0x4b')]));_0x4fd939[_0xe4d2('0x52')][_0xe4d2('0x6a')]=_0x30d4ba['id'];if(_0x19f7ac[_0xe4d2('0x49')][_0xe4d2('0x54')]){_0x4fd939[_0xe4d2('0x52')]=_['merge'](_0x4fd939[_0xe4d2('0x52')],{'$or':_[_0xe4d2('0x43')](_0x4fd939[_0xe4d2('0x4e')],function(_0x26eac4){var _0x546e43={};_0x546e43[_0x26eac4]={'$like':'%'+_0x19f7ac['query'][_0xe4d2('0x54')]+'%'};return _0x546e43;})});}_0x4fd939=_[_0xe4d2('0x55')]({},_0x4fd939,_0x19f7ac[_0xe4d2('0x56')]);return db[_0xe4d2('0x6b')][_0xe4d2('0x30')]({'where':_0x4fd939[_0xe4d2('0x52')]})['then'](function(_0xd2b25){_0x15d860[_0xe4d2('0x30')]=_0xd2b25;if(_0x19f7ac[_0xe4d2('0x49')][_0xe4d2('0x5d')]){_0x4fd939[_0xe4d2('0x58')]=[{'all':!![]}];}return db[_0xe4d2('0x6b')][_0xe4d2('0x59')](_0x4fd939);})[_0xe4d2('0x22')](function(_0x2193e4){_0x15d860[_0xe4d2('0x5a')]=_0x2193e4;return _0x15d860;});}})[_0xe4d2('0x22')](respondWithFilteredResult(_0x424387,_0x4fd939))[_0xe4d2('0x2c')](handleError(_0x424387,null));};exports['removeDispositions']=function(_0x2d2d89,_0x2ed943,_0xb96234){return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x2d2d89[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x2ed943,null))[_0xe4d2('0x22')](function(_0x1bf082){if(_0x1bf082){return _0x1bf082[_0xe4d2('0x6f')](_0x2d2d89[_0xe4d2('0x49')][_0xe4d2('0x70')]);}})['then'](respondWithStatusCode(_0x2ed943,null))[_0xe4d2('0x2c')](handleError(_0x2ed943,null));};exports[_0xe4d2('0x71')]=function(_0x53460d,_0x2ade23,_0x48f585){if(_0x53460d[_0xe4d2('0x5f')]['id']){delete _0x53460d['body']['id'];}return db['ChatWebsite'][_0xe4d2('0x67')]({'where':{'id':_0x53460d[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x2ade23,null))[_0xe4d2('0x22')](function(_0x2939a2){if(_0x2939a2){_0x53460d[_0xe4d2('0x5f')][_0xe4d2('0x6a')]=_0x2939a2['id'];return db[_0xe4d2('0x72')]['create'](_0x53460d['body']);}})[_0xe4d2('0x22')](respondWithResult(_0x2ade23,null))[_0xe4d2('0x2c')](handleError(_0x2ade23,null));};exports[_0xe4d2('0x73')]=function(_0x12cf4b,_0x41cf5a,_0x281840){var _0x1dcd93={'raw':![],'where':{}};var _0x1b939c={};var _0x1de6d5={'count':0x0,'rows':[]};return db[_0xe4d2('0x57')]['findOne']({'where':{'id':_0x12cf4b[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x41cf5a,null))[_0xe4d2('0x22')](function(_0x45cd90){if(_0x45cd90){_0x1b939c[_0xe4d2('0x48')]=_[_0xe4d2('0x4a')](db[_0xe4d2('0x72')]['rawAttributes']);_0x1b939c['query']=_[_0xe4d2('0x4a')](_0x12cf4b[_0xe4d2('0x49')]);_0x1b939c[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x1b939c['model'],_0x1b939c[_0xe4d2('0x49')]);_0x1dcd93[_0xe4d2('0x4e')]=_[_0xe4d2('0x4c')](_0x1b939c[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x12cf4b[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x1dcd93['attributes']=_0x1dcd93[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x1dcd93[_0xe4d2('0x4e')]:_0x1b939c[_0xe4d2('0x48')];if(!_0x12cf4b['query'][_0xe4d2('0x6c')](_0xe4d2('0x50'))){_0x1dcd93['limit']=qs[_0xe4d2('0x32')](_0x12cf4b['query']['limit']);_0x1dcd93[_0xe4d2('0x31')]=qs[_0xe4d2('0x31')](_0x12cf4b[_0xe4d2('0x49')]['offset']);}_0x1dcd93[_0xe4d2('0x6d')]=qs[_0xe4d2('0x51')](_0x12cf4b[_0xe4d2('0x49')]['sort']);_0x1dcd93[_0xe4d2('0x52')]=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0x12cf4b[_0xe4d2('0x49')],_0x1b939c[_0xe4d2('0x4b')]));_0x1dcd93[_0xe4d2('0x52')][_0xe4d2('0x6a')]=_0x45cd90['id'];if(_0x12cf4b['query'][_0xe4d2('0x54')]){_0x1dcd93[_0xe4d2('0x52')]=_[_0xe4d2('0x55')](_0x1dcd93['where'],{'$or':_['map'](_0x1dcd93['attributes'],function(_0x11449f){var _0x22fd81={};_0x22fd81[_0x11449f]={'$like':'%'+_0x12cf4b['query'][_0xe4d2('0x54')]+'%'};return _0x22fd81;})});}_0x1dcd93=_[_0xe4d2('0x55')]({},_0x1dcd93,_0x12cf4b[_0xe4d2('0x56')]);return db[_0xe4d2('0x72')][_0xe4d2('0x30')]({'where':_0x1dcd93['where']})[_0xe4d2('0x22')](function(_0x227fdd){_0x1de6d5[_0xe4d2('0x30')]=_0x227fdd;if(_0x12cf4b[_0xe4d2('0x49')][_0xe4d2('0x5d')]){_0x1dcd93[_0xe4d2('0x58')]=[{'all':!![]}];}return db[_0xe4d2('0x72')][_0xe4d2('0x59')](_0x1dcd93);})[_0xe4d2('0x22')](function(_0x250029){_0x1de6d5[_0xe4d2('0x5a')]=_0x250029;return _0x1de6d5;});}})['then'](respondWithFilteredResult(_0x41cf5a,_0x1dcd93))[_0xe4d2('0x2c')](handleError(_0x41cf5a,null));};exports[_0xe4d2('0x74')]=function(_0x56f5e3,_0x525210,_0x2a3a32){return db['ChatWebsite'][_0xe4d2('0x67')]({'where':{'id':_0x56f5e3[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x525210,null))[_0xe4d2('0x22')](function(_0x3aff06){if(_0x3aff06){return _0x3aff06[_0xe4d2('0x74')](_0x56f5e3[_0xe4d2('0x49')][_0xe4d2('0x70')]);}})[_0xe4d2('0x22')](respondWithStatusCode(_0x525210,null))[_0xe4d2('0x2c')](handleError(_0x525210,null));};exports[_0xe4d2('0x75')]=function(_0x26a4b4,_0x53eaa1,_0x5c9259){_0x26a4b4[_0xe4d2('0x5f')][_0xe4d2('0x76')]=_0x26a4b4[_0xe4d2('0x77')][_0xe4d2('0x78')];return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x26a4b4[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x53eaa1,null))[_0xe4d2('0x22')](saveUpdates(_0x26a4b4[_0xe4d2('0x5f')],null))[_0xe4d2('0x22')](respondWithResult(_0x53eaa1,null))[_0xe4d2('0x2c')](handleError(_0x53eaa1,null));};exports[_0xe4d2('0x79')]=function(_0x2911e3,_0x5d991f,_0x1da857){_0x2911e3['body'][_0xe4d2('0x7a')]=_0x2911e3['file'][_0xe4d2('0x78')];return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x2911e3[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x5d991f,null))[_0xe4d2('0x22')](saveUpdates(_0x2911e3[_0xe4d2('0x5f')],null))[_0xe4d2('0x22')](respondWithResult(_0x5d991f,null))[_0xe4d2('0x2c')](handleError(_0x5d991f,null));};exports[_0xe4d2('0x7b')]=function(_0x461430,_0x564939,_0x5dece3){_0x461430[_0xe4d2('0x5f')][_0xe4d2('0x7c')]=_0x461430[_0xe4d2('0x77')]['filename'];return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x461430[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x564939,null))[_0xe4d2('0x22')](saveUpdates(_0x461430[_0xe4d2('0x5f')],null))['then'](respondWithResult(_0x564939,null))[_0xe4d2('0x2c')](handleError(_0x564939,null));};exports[_0xe4d2('0x7d')]=function(_0x22ffcc,_0x57767b,_0x5667f8){_0x22ffcc['body'][_0xe4d2('0x7e')]=_0x22ffcc[_0xe4d2('0x77')][_0xe4d2('0x78')];return db['ChatWebsite']['find']({'where':{'id':_0x22ffcc[_0xe4d2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57767b,null))['then'](saveUpdates(_0x22ffcc['body'],null))[_0xe4d2('0x22')](respondWithResult(_0x57767b,null))[_0xe4d2('0x2c')](handleError(_0x57767b,null));};exports[_0xe4d2('0x7f')]=function(_0x3655f5,_0x16bc90,_0x5e141c){var _0x4aba2a=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],'server/files/images/logos/default_logo.svg');var _0x399084={'where':{'id':_0x3655f5[_0xe4d2('0x5c')]['id']},'attributes':['id',_0xe4d2('0x76')],'raw':!![]};var _0x1624fa=![];return require(_0xe4d2('0x82'))['getLicense']()[_0xe4d2('0x22')](function(_0x5b6983){if(_0x5b6983){_0x1624fa=_0x5b6983[_0xe4d2('0x83')];}})['then'](function(){return db[_0xe4d2('0x57')]['find'](_0x399084);})[_0xe4d2('0x22')](handleEntityNotFound(_0x16bc90,null))['then'](function(_0x27e691){if(_0x27e691){if(!_['isNil'](_0x27e691[_0xe4d2('0x76')])){if(fs[_0xe4d2('0x84')](path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x85'),_0x27e691[_0xe4d2('0x76')]))&&_0x1624fa){_0x4aba2a=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x85'),_0x27e691['sitepic']);}}return _0x16bc90[_0xe4d2('0x86')](_0x4aba2a);}})[_0xe4d2('0x2c')](handleError(_0x16bc90,null));};exports[_0xe4d2('0x87')]=function(_0xd40974,_0x54ba97,_0x3074e8){var _0x5942a2=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x88'));var _0x43b777={'where':{'id':_0xd40974[_0xe4d2('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xe4d2('0x57')]['find'](_0x43b777)[_0xe4d2('0x22')](handleEntityNotFound(_0x54ba97,null))[_0xe4d2('0x22')](function(_0x2b009d){if(_0x2b009d){if(!_['isNil'](_0x2b009d[_0xe4d2('0x7a')])){if(fs[_0xe4d2('0x84')](path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x89'),_0x2b009d[_0xe4d2('0x7a')]))){_0x5942a2=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],'server/files/images/avatars/',_0x2b009d['agentAvatar']);}}return _0x54ba97[_0xe4d2('0x86')](_0x5942a2);}})[_0xe4d2('0x2c')](handleError(_0x54ba97,null));};exports[_0xe4d2('0x8a')]=function(_0x3d84af,_0x595f19,_0x7c9058){var _0x15b317=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x8b'));var _0x324ff2={'where':{'id':_0x3d84af[_0xe4d2('0x5c')]['id']},'attributes':['id',_0xe4d2('0x7c'),'showCustomerAvatar'],'raw':!![]};return db[_0xe4d2('0x57')]['find'](_0x324ff2)[_0xe4d2('0x22')](handleEntityNotFound(_0x595f19,null))[_0xe4d2('0x22')](function(_0xd87547){if(_0xd87547){if(!_[_0xe4d2('0x8c')](_0xd87547['customerAvatar'])){if(fs[_0xe4d2('0x84')](path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x89'),_0xd87547[_0xe4d2('0x7c')]))&&_0xd87547[_0xe4d2('0x8d')]){_0x15b317=path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],_0xe4d2('0x89'),_0xd87547[_0xe4d2('0x7c')]);}}return _0x595f19[_0xe4d2('0x86')](_0x15b317);}})[_0xe4d2('0x2c')](handleError(_0x595f19,null));};exports[_0xe4d2('0x8e')]=function(_0x41023a,_0x407354,_0x1d8492){var _0x6d88de=path['join'](config[_0xe4d2('0x81')],'server/files/images/avatars/system_avatar.png');var _0x40a27c={'where':{'id':_0x41023a['params']['id']},'attributes':['id',_0xe4d2('0x7e')],'raw':!![]};return db[_0xe4d2('0x57')][_0xe4d2('0x67')](_0x40a27c)[_0xe4d2('0x22')](handleEntityNotFound(_0x407354,null))[_0xe4d2('0x22')](function(_0x52aefd){if(_0x52aefd){if(!_[_0xe4d2('0x8c')](_0x52aefd[_0xe4d2('0x7e')])){if(fs[_0xe4d2('0x84')](path[_0xe4d2('0x80')](config[_0xe4d2('0x81')],'server/files/images/avatars/',_0x52aefd['systemAvatar']))){_0x6d88de=path['join'](config[_0xe4d2('0x81')],'server/files/images/avatars/',_0x52aefd[_0xe4d2('0x7e')]);}}return _0x407354[_0xe4d2('0x86')](_0x6d88de);}})[_0xe4d2('0x2c')](handleError(_0x407354,null));};exports['notify']=function(_0x1b0477,_0x4533dd,_0x1c2ce0){var _0x5c2d53=require('user-agent-parser');var _0x46c403=new _0x5c2d53();var _0x35e8a9=_0x46c403['setUA'](_0x1b0477[_0xe4d2('0x8f')]['user-agent'])['getResult']();var _0x3f8f34={'body':_0x1b0477[_0xe4d2('0x5f')],'channel':_0xe4d2('0x90')};var _0x33e185=[];var _0x13af8f=[];var _0x4d2809={};var _0x2996ce=![];return db['CmContact'][_0xe4d2('0x68')]()['then'](function(_0x1dccab){if(!_0x1dccab){throw new db['Sequelize'][(_0xe4d2('0x1f'))](_0xe4d2('0x91'));}_0x33e185=_[_0xe4d2('0x92')](_[_0xe4d2('0x4a')](_0x1dccab),[_0xe4d2('0x93'),'updatedAt']);_0x13af8f=_['difference'](_[_0xe4d2('0x4a')](_0x1dccab),[_0xe4d2('0x93'),_0xe4d2('0x94'),'CompanyId',_0xe4d2('0x95')]);if(_0x1b0477[_0xe4d2('0x5f')]['id']){delete _0x1b0477[_0xe4d2('0x5f')]['id'];}if(_['isNil'](_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0x96')])){throw new db[(_0xe4d2('0x1e'))]['ValidationError'](_0xe4d2('0x97'));}if(_['isNil'](_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0x5f')])||_0x1b0477['body'][_0xe4d2('0x5f')]===''){throw new db['Sequelize'][(_0xe4d2('0x1f'))](_0xe4d2('0x98'));}if(_['isNil'](_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0x99')])){throw new db[(_0xe4d2('0x1e'))][(_0xe4d2('0x1f'))](_0xe4d2('0x9a')+_0x13af8f);}if(!_['includes'](_0x13af8f,_0x1b0477['body'][_0xe4d2('0x99')])){throw new db[(_0xe4d2('0x1e'))][(_0xe4d2('0x1f'))](_0xe4d2('0x9b')+_0x13af8f);}_0x4d2809[_0x1b0477['body'][_0xe4d2('0x99')]]=_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0x96')];})[_0xe4d2('0x22')](function(){return db['ChatWebsite'][_0xe4d2('0x67')]({'where':{'id':_0x1b0477['params']['id']},'include':[{'model':db[_0xe4d2('0x9c')],'as':_0xe4d2('0x9d'),'include':[{'model':db[_0xe4d2('0x9e')],'as':_0xe4d2('0x9f'),'where':_0x4d2809,'limit':0x1,'order':[[_0xe4d2('0x94'),_0xe4d2('0xa0')]]}]},{'model':db[_0xe4d2('0xa1')],'as':_0xe4d2('0xa2')}]});})['then'](handleEntityNotFound(_0x4533dd,null))[_0xe4d2('0x22')](function(_0x6c8333){if(_0x6c8333&&_0x6c8333['List']){_0x3f8f34[_0xe4d2('0xa3')]=_0x6c8333;_0x3f8f34[_0xe4d2('0xa4')]=_0x6c8333[_0xe4d2('0xa2')];_0x3f8f34[_0xe4d2('0xa5')]=_0x6c8333[_0xe4d2('0x9d')];_0x3f8f34[_0xe4d2('0xa4')]=_[_0xe4d2('0xa6')](_0x3f8f34[_0xe4d2('0xa4')],[_0xe4d2('0xa7')],[_0xe4d2('0xa8')]);if(_0x3f8f34[_0xe4d2('0xa3')][_0xe4d2('0xa2')]){delete _0x3f8f34[_0xe4d2('0xa3')][_0xe4d2('0xa2')];}if(_0x3f8f34[_0xe4d2('0xa3')][_0xe4d2('0x9d')]&&_0x3f8f34[_0xe4d2('0xa3')]['List']['Contacts'][_0xe4d2('0x4f')]){return _0x3f8f34[_0xe4d2('0xa3')][_0xe4d2('0x9d')][_0xe4d2('0x9f')][0x0];}var _0x53d84b=_[_0xe4d2('0xa9')](_0x1b0477[_0xe4d2('0x5f')],{'firstName':_0x1b0477['body']['from'],'ListId':_0x6c8333[_0xe4d2('0x95')]});_0x53d84b[_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0x99')]]=_0x1b0477[_0xe4d2('0x5f')]['from'];return db[_0xe4d2('0x9e')][_0xe4d2('0x5e')](_0x53d84b,{'fields':_0x33e185,'raw':!![]});}})[_0xe4d2('0x22')](handleEntityNotFound(_0x4533dd,null))['then'](function(_0x3fa3cc){_0x3f8f34[_0xe4d2('0xaa')]=_0x3fa3cc;var _0x4590c4=_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xab')];if(_0x1b0477[_0xe4d2('0x8f')][_0xe4d2('0xac')]){_0x4590c4=_0x1b0477[_0xe4d2('0x8f')][_0xe4d2('0xac')];}else if(_0x1b0477[_0xe4d2('0x8f')]['x-forwarded-for']){_0x4590c4=_[_0xe4d2('0xad')](_0x1b0477[_0xe4d2('0x8f')][_0xe4d2('0xae')][_0xe4d2('0xaf')](','));}if(_0x3fa3cc){var _0x45643a={'ContactId':_0x3fa3cc['id'],'ChatWebsiteId':_0x1b0477[_0xe4d2('0x5c')]['id'],'from':(_0x3fa3cc[_0xe4d2('0xb0')]||'')+'\x20'+(_0x3fa3cc['lastName']||''),'customerIp':_0x4590c4,'customerPort':_0x1b0477['headers'][_0xe4d2('0xb1')]?_0x1b0477['headers'][_0xe4d2('0xb1')]:null,'referer':_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xb2')],'browserName':_0x35e8a9['browser'][_0xe4d2('0x3e')]&&_0x35e8a9[_0xe4d2('0xb3')][_0xe4d2('0xb4')]?util['format']('%s\x20%s',_0x35e8a9[_0xe4d2('0xb3')][_0xe4d2('0x3e')],_0x35e8a9[_0xe4d2('0xb3')][_0xe4d2('0xb4')]):_0xe4d2('0xb5'),'browserVersion':_0x35e8a9['browser'][_0xe4d2('0xb4')]||_0xe4d2('0xb5'),'osName':util['format']('%s\x20%s',_0x35e8a9['os'][_0xe4d2('0x3e')],_0x35e8a9['os'][_0xe4d2('0xb4')]),'osVersion':_0x35e8a9['os']['version'],'deviceModel':_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0x48')]&&_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0xb7')]?util[_0xe4d2('0xb8')](_0xe4d2('0xb9'),_0x35e8a9['device'][_0xe4d2('0x48')],_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0xb7')],_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0x46')]):null,'deviceVendor':_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0xb7')],'deviceType':_0x35e8a9[_0xe4d2('0xb6')][_0xe4d2('0x46')],'formData':JSON[_0xe4d2('0xba')](_0x1b0477[_0xe4d2('0x5f')])};var _0x294618={'ChatWebsiteId':_0x1b0477['params']['id'],'closed':![]};if(_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xbb')]){_0x294618[_0xe4d2('0xbb')]=_0x1b0477[_0xe4d2('0x5f')]['threadId'];return db[_0xe4d2('0xbc')][_0xe4d2('0x67')]({'where':_0x294618})[_0xe4d2('0x22')](function(_0x4a94ea){if(_0x4a94ea){return[_0x4a94ea,![]];}_0x45643a[_0xe4d2('0xbb')]=_0x1b0477['body']['threadId'];_0x45643a[_0xe4d2('0xbd')]=_0x1b0477[_0xe4d2('0x5f')]['externalUrl'];return db[_0xe4d2('0xbc')][_0xe4d2('0x5e')](_0x45643a)['then'](function(_0x48c2fb){return[_0x48c2fb,!![]];});});}_0x294618[_0xe4d2('0xbe')]=_0x3fa3cc['id'];if(_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xbf')]&&_0x1b0477[_0xe4d2('0x5f')]['interaction']['id']){_0x294618['id']=_0x1b0477['body']['interaction']['id'];return db[_0xe4d2('0xbc')][_0xe4d2('0x67')]({'where':_0x294618})[_0xe4d2('0x22')](function(_0x10a8b9){if(_0x10a8b9){return[_0x10a8b9,![]];}return db['ChatInteraction']['create'](_0x45643a)[_0xe4d2('0x22')](function(_0x4406e1){return[_0x4406e1,!![]];});});}return db['ChatInteraction']['create'](_0x45643a)[_0xe4d2('0x22')](function(_0x253b02){return[_0x253b02,!![]];});}})[_0xe4d2('0xc0')](function(_0x2f482e,_0x13e081){if(_0x2f482e){_0x2996ce=_0x13e081;if(!_0x13e081){var _0x3bf97d={'from':(_0x3f8f34[_0xe4d2('0xaa')][_0xe4d2('0xb0')]||'')+'\x20'+(_0x3f8f34[_0xe4d2('0xaa')]['lastName']||'')};if(_0x1b0477[_0xe4d2('0x5f')]['threadId']&&_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xc1')]&&_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xbb')]!=_0x1b0477['body']['messageId']){_0x3bf97d[_0xe4d2('0xbb')]=_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xc1')];}return _0x2f482e[_0xe4d2('0x38')](_0x3bf97d);}else{return _0x2f482e;}}})[_0xe4d2('0x22')](function(_0x5d0b48){_0x3f8f34[_0xe4d2('0xbf')]=_0x5d0b48[_0xe4d2('0x3a')]({'plain':!![]});_0x3f8f34[_0xe4d2('0xbf')]['created']=_0x2996ce;if(_0x3f8f34[_0xe4d2('0xbf')][_0xe4d2('0xc2')]){if(_0x3f8f34[_0xe4d2('0xa3')][_0xe4d2('0xc3')]){_0x3f8f34[_0xe4d2('0xa4')][_0xe4d2('0xc4')]({'id':0x0,'priority':_0x3f8f34['applications'][_0xe4d2('0x4f')]+0x1,'app':_0xe4d2('0xc5'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xe4d2('0xc6')][_0xe4d2('0x5e')]({'body':_0x1b0477['body']['body'],'ChatWebsiteId':_0x1b0477[_0xe4d2('0x5c')]['id'],'ChatInteractionId':_0x5d0b48['id'],'direction':'in','ContactId':_0x3f8f34[_0xe4d2('0xaa')]['id'],'AttachmentId':_0x1b0477[_0xe4d2('0x5f')][_0xe4d2('0xc7')]});})[_0xe4d2('0x22')](function(_0x3eee1b){_0x3f8f34[_0xe4d2('0x2a')]=_0x3eee1b;if(_0x3f8f34[_0xe4d2('0xbf')][_0xe4d2('0xc8')]){return db[_0xe4d2('0xc9')][_0xe4d2('0x67')]({'attributes':['id',_0xe4d2('0x3e')],'where':{'id':_0x3f8f34[_0xe4d2('0xbf')][_0xe4d2('0xc8')]}})[_0xe4d2('0x22')](function(_0x59621d){if(_0x59621d){_0x3f8f34[_0xe4d2('0xa4')][_0xe4d2('0xca')]({'id':0x0,'priority':0x0,'app':_0xe4d2('0xcb'),'appdata':_0x59621d['name']+','+(_0x3f8f34[_0xe4d2('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':_0xe4d2('0xcc')});_0x3f8f34[_0xe4d2('0xcd')]=!![];}return respondWithRpcPromise(_0xe4d2('0xce'),_0xe4d2('0xcf'),_0x3f8f34);});}return respondWithRpcPromise(_0xe4d2('0xce'),_0xe4d2('0xcf'),_0x3f8f34);})['then'](function(_0x22f932){respondWithRpcPromise('EventManager','EventManager',{'event':_0xe4d2('0xd0'),'message':_0x22f932},client9002);return _0x22f932;})[_0xe4d2('0x22')](respondWithResult(_0x4533dd,null))['catch'](handleError(_0x4533dd,null));};exports[_0xe4d2('0xd1')]=function(_0x1e5394,_0x28b533,_0x2f922c){var _0x197ad4,_0x3cb6f4,_0x481c09;var _0x2e22f5=[];var _0x2f5c7e=[];var _0x3b1bfb={};return db['CmContact']['describe']()[_0xe4d2('0x22')](function(_0x52333f){if(!_0x52333f){throw new db[(_0xe4d2('0x1e'))][(_0xe4d2('0x1f'))](_0xe4d2('0x91'));}_0x2f5c7e=_[_0xe4d2('0x92')](_['keys'](_0x52333f),[_0xe4d2('0x93'),_0xe4d2('0x94')]);_0x2e22f5=_[_0xe4d2('0x92')](_['keys'](_0x52333f),[_0xe4d2('0x93'),_0xe4d2('0x94'),_0xe4d2('0xd2'),_0xe4d2('0x95')]);if(_0x1e5394[_0xe4d2('0x5f')]['id']){delete _0x1e5394['body']['id'];}if(_[_0xe4d2('0x8c')](_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0x96')])){throw _0x28b533[_0xe4d2('0x2e')](0x1f4)[_0xe4d2('0x3f')](new db['Sequelize'][(_0xe4d2('0x1f'))]('from\x20is\x20mandatory'));}if(_[_0xe4d2('0x8c')](_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0x5f')])||_0x1e5394['body'][_0xe4d2('0x5f')]===''){throw _0x28b533['status'](0x1f4)[_0xe4d2('0x3f')](new db['Sequelize'][(_0xe4d2('0x1f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xe4d2('0x8c')](_0x1e5394['body'][_0xe4d2('0xd3')])){throw _0x28b533[_0xe4d2('0x2e')](0x1f4)[_0xe4d2('0x3f')](new db[(_0xe4d2('0x1e'))][(_0xe4d2('0x1f'))](_0xe4d2('0xd4')+_0x2e22f5));}if(!_[_0xe4d2('0xd5')](_0x2e22f5,_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0xd3')])){throw _0x28b533[_0xe4d2('0x2e')](0x1f4)[_0xe4d2('0x3f')](new db['Sequelize'][(_0xe4d2('0x1f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e22f5));}_0x3b1bfb[_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0xd3')]]=_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0x96')];})['then'](function(){return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x1e5394['params']['id']},'include':[{'model':db['CmList'],'as':_0xe4d2('0x9d')}]});})[_0xe4d2('0x22')](handleEntityNotFound(_0x28b533,null))[_0xe4d2('0x22')](function(_0x5a9bf8){if(_0x5a9bf8&&_0x5a9bf8[_0xe4d2('0x9d')]){_0x3cb6f4=_0x5a9bf8;var _0x156520=_['defaults'](_0x1e5394[_0xe4d2('0x5f')],{'firstName':_0x1e5394[_0xe4d2('0x5f')]['from'],'phone':_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0x96')],'ListId':_0x5a9bf8[_0xe4d2('0x95')]});_0x156520[_0x1e5394['body'][_0xe4d2('0xd3')]]=_0x1e5394[_0xe4d2('0x5f')][_0xe4d2('0x96')];return db[_0xe4d2('0x9e')]['findOrCreate']({'where':_0x3b1bfb,'defaults':_0x156520});}})[_0xe4d2('0xc0')](function(_0x20574a){if(_0x20574a){_0x481c09=_0x20574a;var _0x1f7b1c=fs[_0xe4d2('0xd6')](path['join'](config[_0xe4d2('0x81')],_0xe4d2('0xd7')),'utf8');var _0x63a054=ejs[_0xe4d2('0xd8')](_0x1f7b1c,{'body':_[_0xe4d2('0xd9')](_0x1e5394['body'][_0xe4d2('0x5f')]),'bodyTitle':_0x3cb6f4[_0xe4d2('0xda')]});return db['ChatOfflineMessage'][_0xe4d2('0x5e')]({'body':_0x63a054,'ContactId':_0x20574a['id'],'ChatWebsiteId':_0x3cb6f4['id']});}})[_0xe4d2('0x22')](function(_0x5c5b96){if(_0x5c5b96){_0x197ad4=_0x5c5b96;return db[_0xe4d2('0xdb')][_0xe4d2('0xdc')]({'where':{'service':!![]},'include':[{'model':db[_0xe4d2('0xdd')],'as':'Smtp','raw':!![]}]});}})[_0xe4d2('0x22')](function(_0x4eccd2){if(_0x4eccd2&&_0x4eccd2['Smtp']&&_0x3cb6f4[_0xe4d2('0xde')]){var _0x51c36e={'tls':{'rejectUnauthorized':![]}};if(_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0xe0')]){_0x51c36e['service']=_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0xe0')];}else{_0x51c36e[_0xe4d2('0xe1')]=_0x4eccd2['Smtp'][_0xe4d2('0xe1')];_0x51c36e[_0xe4d2('0xe2')]=_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0xe2')];_0x51c36e[_0xe4d2('0xe3')]=_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0xe3')];}if(_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0xe4')]){_0x51c36e[_0xe4d2('0xe5')]={'user':_0x4eccd2[_0xe4d2('0xdf')][_0xe4d2('0x60')],'pass':_0x4eccd2[_0xe4d2('0xdf')]['pass']};}return respondWithRpcPromise(_0xe4d2('0xe6'),'sendMail',{'account':_0x51c36e,'message':{'from':util[_0xe4d2('0xb8')](_0xe4d2('0xe7'),_0x4eccd2['name'],_0x4eccd2[_0xe4d2('0xe8')]||_0x4eccd2['Smtp'][_0xe4d2('0x60')]),'to':_0x3cb6f4[_0xe4d2('0xde')],'subject':_0x3cb6f4[_0xe4d2('0xe9')],'text':_0x197ad4['body']}},client9003)[_0xe4d2('0x22')](function(){return _0x197ad4;})[_0xe4d2('0x2c')](function(_0x2aa3ce){console[_0xe4d2('0x28')](_0x2aa3ce);});}})[_0xe4d2('0x22')](function(){if(_0x197ad4){return _0x197ad4;}})[_0xe4d2('0x22')](respondWithResult(_0x28b533,null))['catch'](handleError(_0x28b533,null));};exports[_0xe4d2('0xea')]=function(_0x58cced,_0x521c12,_0x32cc97){return db[_0xe4d2('0xbc')][_0xe4d2('0x67')]({'where':{'id':_0x58cced['params']['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x521c12,null))[_0xe4d2('0x22')](function(_0x2eca45){if(_0x2eca45){return _0x2eca45[_0xe4d2('0xea')](_0x58cced[_0xe4d2('0x5f')]['ids'],_['omit'](_0x58cced['body'],[_0xe4d2('0x70'),'id'])||{});}})[_0xe4d2('0x22')](respondWithResult(_0x521c12,null))[_0xe4d2('0x2c')](handleError(_0x521c12,null));};exports[_0xe4d2('0xeb')]=function(_0x7e3b61,_0x5a6c44,_0x1a4e2c){var _0x5338b4={'raw':![],'where':{}};var _0x2cae99={};var _0x2e3c71={'count':0x0,'rows':[]};return db[_0xe4d2('0x57')][_0xe4d2('0xdc')]({'where':{'id':_0x7e3b61['params']['id']}})['then'](handleEntityNotFound(_0x5a6c44,null))['then'](function(_0x585c58){if(_0x585c58){_0x2cae99['model']=_[_0xe4d2('0x4a')](db[_0xe4d2('0xbc')][_0xe4d2('0x44')]);_0x2cae99['query']=_[_0xe4d2('0x4a')](_0x7e3b61[_0xe4d2('0x49')]);_0x2cae99[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x2cae99[_0xe4d2('0x48')],_0x2cae99[_0xe4d2('0x49')]);_0x5338b4[_0xe4d2('0x4e')]=_[_0xe4d2('0x4c')](_0x2cae99['model'],qs[_0xe4d2('0x4d')](_0x7e3b61[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x5338b4[_0xe4d2('0x4e')]=_0x5338b4[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x5338b4[_0xe4d2('0x4e')]:_0x2cae99[_0xe4d2('0x48')];if(!_0x7e3b61['query'][_0xe4d2('0x6c')](_0xe4d2('0x50'))){_0x5338b4[_0xe4d2('0x32')]=qs[_0xe4d2('0x32')](_0x7e3b61[_0xe4d2('0x49')][_0xe4d2('0x32')]);_0x5338b4[_0xe4d2('0x31')]=qs[_0xe4d2('0x31')](_0x7e3b61[_0xe4d2('0x49')][_0xe4d2('0x31')]);}_0x5338b4[_0xe4d2('0x6d')]=qs[_0xe4d2('0x51')](_0x7e3b61['query'][_0xe4d2('0x51')]);_0x5338b4[_0xe4d2('0x52')]=qs[_0xe4d2('0x4b')](_['pick'](_0x7e3b61['query'],_0x2cae99[_0xe4d2('0x4b')]));_0x5338b4[_0xe4d2('0x52')][_0xe4d2('0x6a')]=_0x585c58['id'];if(_0x7e3b61[_0xe4d2('0x49')]['filter']){_0x5338b4[_0xe4d2('0x52')]=_['merge'](_0x5338b4[_0xe4d2('0x52')],{'$or':_[_0xe4d2('0x43')](_0x5338b4['attributes'],function(_0x45ce15){var _0x1f12d9={};_0x1f12d9[_0x45ce15]={'$like':'%'+_0x7e3b61['query']['filter']+'%'};return _0x1f12d9;})});}_0x5338b4=_['merge']({},_0x5338b4,_0x7e3b61[_0xe4d2('0x56')]);return db[_0xe4d2('0xbc')][_0xe4d2('0x30')]({'where':_0x5338b4[_0xe4d2('0x52')]})['then'](function(_0x31a413){_0x2e3c71['count']=_0x31a413;if(_0x7e3b61[_0xe4d2('0x49')]['includeAll']){_0x5338b4['include']=[{'model':db[_0xe4d2('0x9e')],'as':_0xe4d2('0xec'),'required':![]},{'model':db[_0xe4d2('0xc9')],'as':_0xe4d2('0xed'),'attributes':[_0xe4d2('0x3e'),_0xe4d2('0xee'),_0xe4d2('0xef')],'required':![]},{'model':db['Tag'],'as':_0xe4d2('0xf0'),'attributes':['id','name','color'],'where':_0x7e3b61[_0xe4d2('0x49')]['tag']?{'id':_0x7e3b61[_0xe4d2('0x49')][_0xe4d2('0xf1')]}:undefined,'required':_0x7e3b61[_0xe4d2('0x49')]['tag']?!![]:![]}];}return db[_0xe4d2('0xbc')][_0xe4d2('0x59')](_0x5338b4);})['then'](function(_0x3ec164){_0x2e3c71[_0xe4d2('0x5a')]=_0x3ec164;return _0x2e3c71;});}})[_0xe4d2('0x22')](respondWithFilteredResult(_0x5a6c44,_0x5338b4))[_0xe4d2('0x2c')](handleError(_0x5a6c44,null));};function iftimePromise(_0x4716f5,_0x2f079b){return respondWithRpcPromise(_0xe4d2('0xf2'),_0xe4d2('0xf3'),{'command':_0x2f079b[_0xe4d2('0xf4')]?util[_0xe4d2('0xb8')](_0xe4d2('0xf5'),_0x4716f5[_0xe4d2('0xf6')],_0x2f079b[_0xe4d2('0xf4')]):util['format']('iftime\x20%s',_0x4716f5['interval'])},client9002)['then'](function(_0x471fc8){var _0x52aa67=_0x471fc8&&_0x471fc8['indexOf']('true')>=0x0?!![]:![];logger[_0xe4d2('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2f079b['id'],_0x4716f5['id'],_0x4716f5['interval'],_0x52aa67?_0xe4d2('0xf7'):_0xe4d2('0xf8'),_0x2f079b[_0xe4d2('0xf4')]?_0x2f079b[_0xe4d2('0xf4')]:_0xe4d2('0xf9'));return _0x52aa67;})['catch'](function(_0x4c2d89){logger['error'](_0xe4d2('0xfa'),_0x2f079b['id'],_0x4716f5['id'],_0x4716f5[_0xe4d2('0xf6')],util[_0xe4d2('0xfb')](_0x4c2d89,{'showHidden':![],'depth':null}),_0x2f079b[_0xe4d2('0xf4')]?_0x2f079b[_0xe4d2('0xf4')]:_0xe4d2('0xf9'));return![];});}exports[_0xe4d2('0xf3')]=function(_0x42cf1b,_0x596531,_0x2259c6){var _0x16a98b=0x0;var _0x2238bf=0x0;var _0x1e523e=![];var _0x4ee14c;var _0x590302;return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x42cf1b[_0xe4d2('0x5c')]['id']},'include':[{'model':db[_0xe4d2('0xfc')],'as':_0xe4d2('0xfc'),'include':[{'model':db[_0xe4d2('0xfc')],'as':_0xe4d2('0xfd'),'attributes':['id',_0xe4d2('0xf6')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x596531,null))[_0xe4d2('0x22')](function(_0x45e282){if(_0x45e282){_0x4ee14c=_0x45e282;return _0x45e282[_0xe4d2('0xfe')]({'raw':!![]});}})[_0xe4d2('0x22')](function(_0x1f7f3a){if(_0x4ee14c){if(_0x1f7f3a){_0x590302=_0x1f7f3a;}}return require(_0xe4d2('0x82'))['getLicense']();})[_0xe4d2('0x22')](function(_0x16e587){if(_0x16e587){_0x2238bf=_0x16e587[_0xe4d2('0xff')];_0x1e523e=_0x16e587[_0xe4d2('0x83')];}})['then'](function(){return db[_0xe4d2('0xbc')][_0xe4d2('0x30')]({'where':{'closed':![]}});})[_0xe4d2('0x22')](function(_0x35da09){_0x16a98b=_0x35da09;if(_0x2238bf&&_0x35da09>_0x2238bf){return db['License'][_0xe4d2('0xdc')]({'where':{'id':0x1}})[_0xe4d2('0x22')](function(_0x757dab){if(_0x757dab){_0x757dab[_0xe4d2('0x100')](_0xe4d2('0x101'));}});}})['then'](function(){if(_0x4ee14c['Interval']&&_0x4ee14c[_0xe4d2('0xfc')]['Intervals']){var _0xab4c21=[];for(var _0x175915=0x0;_0x175915<_0x4ee14c[_0xe4d2('0xfc')][_0xe4d2('0xfd')]['length'];_0x175915++){var _0x1be466=_0x4ee14c[_0xe4d2('0xfc')][_0xe4d2('0xfd')][_0x175915][_0xe4d2('0x3a')]({'plain':!![]});_0xab4c21[_0xe4d2('0xc4')](iftimePromise(_0x1be466,_0x4ee14c));}return BPromise[_0xe4d2('0x102')](_0xab4c21)[_0xe4d2('0x22')](function(_0x204706){return _[_0xe4d2('0x103')](_0x204706);});}else{return!![];}})[_0xe4d2('0x22')](function(_0x4201b9){var _0x4b7506=fs[_0xe4d2('0xd6')](path['join'](config['root'],_0xe4d2('0x104')),_0xe4d2('0x105'));var _0x1f2b21={'remote':_0x4ee14c[_0xe4d2('0x106')],'query':querystring[_0xe4d2('0xba')](_[_0xe4d2('0x55')](_0x4ee14c['get']({'plain':!![]}),{'customerIp':_0x42cf1b['headers'][_0xe4d2('0xae')]||_0x42cf1b[_0xe4d2('0x8f')][_0xe4d2('0x107')]||_0x42cf1b[_0xe4d2('0x108')]['remoteAddress']||_0x42cf1b['ip'],'referer':_0x42cf1b['headers'][_0xe4d2('0xb2')],'openedInteractions':_0x16a98b,'maxInteractions':_0x2238bf,'virtual':_0x1e523e['virtual'],'online':_0x4201b9,'custom':_0x1e523e}))[_0xe4d2('0x109')](/'/g,'\x5c\x27')};_0x596531[_0xe4d2('0x3f')](ejs[_0xe4d2('0xd8')](Mustache[_0xe4d2('0xd8')](_0x4b7506,_0x1f2b21),{'proactiveActions':_0x590302,'alignment':_0x4ee14c[_0xe4d2('0x10a')],'verticalAlignment':_0x4ee14c['verticalAlignment'],'div_color':_0x4ee14c[_0xe4d2('0x10b')],'text_color':_0x4ee14c['textColor']}));})['catch'](handleError(_0x596531,null));};exports[_0xe4d2('0x10c')]=function(_0x5dcdbf,_0x1dcda8,_0x15b86b){return db['ChatWebsite'][_0xe4d2('0xdc')]({'where':{'id':_0x5dcdbf[_0xe4d2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1dcda8,null))['then'](function(_0x5e94d6){if(_0x5e94d6){return db[_0xe4d2('0x10d')][_0xe4d2('0x10e')](function(_0x30fac0){return db[_0xe4d2('0xa1')][_0xe4d2('0x39')]({'where':{'ChatWebsiteId':_0x5dcdbf[_0xe4d2('0x5c')]['id']},'transaction':_0x30fac0})[_0xe4d2('0x22')](function(_0x5af252){var _0x2540b4=_[_0xe4d2('0x43')](_0x5dcdbf[_0xe4d2('0x5f')],function(_0x515560){_0x515560['ChatWebsiteId']=_0x5dcdbf[_0xe4d2('0x5c')]['id'];return _0x515560;});return db[_0xe4d2('0xa1')][_0xe4d2('0x10f')](_0x2540b4,{'transaction':_0x30fac0});});})['then'](function(){return db[_0xe4d2('0xa1')][_0xe4d2('0x110')]({'where':{'ChatWebsiteId':_0x5dcdbf[_0xe4d2('0x5c')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x1dcda8,null))[_0xe4d2('0x2c')](handleError(_0x1dcda8,null));};exports[_0xe4d2('0x111')]=function(_0xf2cd98,_0x39056e,_0x28f070){var _0x3198b8={};var _0x7f72cc={};var _0x18b6ff;var _0x23728b;return db[_0xe4d2('0x57')][_0xe4d2('0xdc')]({'where':{'id':_0xf2cd98[_0xe4d2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x39056e,null))[_0xe4d2('0x22')](function(_0x3f7fd9){if(_0x3f7fd9){_0x18b6ff=_0x3f7fd9;_0x7f72cc[_0xe4d2('0x48')]=_[_0xe4d2('0x4a')](db[_0xe4d2('0xa1')][_0xe4d2('0x44')]);_0x7f72cc[_0xe4d2('0x49')]=_[_0xe4d2('0x4a')](_0xf2cd98[_0xe4d2('0x49')]);_0x7f72cc[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x7f72cc[_0xe4d2('0x48')],_0x7f72cc['query']);_0x3198b8[_0xe4d2('0x4e')]=_[_0xe4d2('0x4c')](_0x7f72cc[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0xf2cd98['query'][_0xe4d2('0x4d')]));_0x3198b8[_0xe4d2('0x4e')]=_0x3198b8[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x3198b8[_0xe4d2('0x4e')]:_0x7f72cc['model'];_0x3198b8['order']=qs[_0xe4d2('0x51')](_0xf2cd98[_0xe4d2('0x49')][_0xe4d2('0x51')]);_0x3198b8['where']=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0xf2cd98['query'],_0x7f72cc[_0xe4d2('0x4b')]));if(_0xf2cd98[_0xe4d2('0x49')][_0xe4d2('0x54')]){_0x3198b8['where']=_[_0xe4d2('0x55')](_0x3198b8[_0xe4d2('0x52')],{'$or':_[_0xe4d2('0x43')](_0x3198b8[_0xe4d2('0x4e')],function(_0x55d1a5){var _0x9b3edb={};_0x9b3edb[_0x55d1a5]={'$like':'%'+_0xf2cd98[_0xe4d2('0x49')][_0xe4d2('0x54')]+'%'};return _0x9b3edb;})});}_0x3198b8=_['merge']({},_0x3198b8,_0xf2cd98[_0xe4d2('0x56')]);return _0x18b6ff[_0xe4d2('0x111')](_0x3198b8);}})[_0xe4d2('0x22')](function(_0x1cc1a7){if(_0x1cc1a7){_0x23728b=_0x1cc1a7['length'];if(!_0xf2cd98[_0xe4d2('0x49')][_0xe4d2('0x6c')]('nolimit')){_0x3198b8[_0xe4d2('0x32')]=qs[_0xe4d2('0x32')](_0xf2cd98[_0xe4d2('0x49')]['limit']);_0x3198b8[_0xe4d2('0x31')]=qs[_0xe4d2('0x31')](_0xf2cd98[_0xe4d2('0x49')][_0xe4d2('0x31')]);}return _0x18b6ff['getApplications'](_0x3198b8);}})[_0xe4d2('0x22')](function(_0x3b8382){if(_0x3b8382){return _0x3b8382?{'count':_0x23728b,'rows':_0x3b8382}:null;}})['then'](respondWithResult(_0x39056e,null))['catch'](handleError(_0x39056e,null));};exports[_0xe4d2('0x112')]=function(_0x38544d,_0x19b5cf,_0x4150e5){return db[_0xe4d2('0x113')][_0xe4d2('0x67')]({'where':{'id':_0x38544d[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x19b5cf,null))[_0xe4d2('0x22')](function(_0x37f80d){if(_0x37f80d){return _0x37f80d['addProactiveActions'](_0x38544d[_0xe4d2('0x5f')][_0xe4d2('0x70')],_['omit'](_0x38544d['body'],[_0xe4d2('0x70'),'id'])||{});}})[_0xe4d2('0x22')](respondWithResult(_0x19b5cf,null))['catch'](handleError(_0x19b5cf,null));};exports[_0xe4d2('0xfe')]=function(_0x17250a,_0x563d9d,_0x199271){var _0x33d9d9={};var _0x5d2f9a={};var _0x42d34b;var _0x4252b2;return db[_0xe4d2('0x57')]['findOne']({'where':{'id':_0x17250a[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x563d9d,null))[_0xe4d2('0x22')](function(_0x36e192){if(_0x36e192){_0x42d34b=_0x36e192;_0x5d2f9a[_0xe4d2('0x48')]=_['keys'](db['ChatProactiveAction'][_0xe4d2('0x44')]);_0x5d2f9a[_0xe4d2('0x49')]=_[_0xe4d2('0x4a')](_0x17250a[_0xe4d2('0x49')]);_0x5d2f9a[_0xe4d2('0x4b')]=_['intersection'](_0x5d2f9a[_0xe4d2('0x48')],_0x5d2f9a['query']);_0x33d9d9['attributes']=_[_0xe4d2('0x4c')](_0x5d2f9a[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x17250a[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x33d9d9['attributes']=_0x33d9d9[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x33d9d9[_0xe4d2('0x4e')]:_0x5d2f9a[_0xe4d2('0x48')];_0x33d9d9['order']=qs[_0xe4d2('0x51')](_0x17250a[_0xe4d2('0x49')]['sort']);_0x33d9d9['where']=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0x17250a[_0xe4d2('0x49')],_0x5d2f9a[_0xe4d2('0x4b')]));if(_0x17250a[_0xe4d2('0x49')][_0xe4d2('0x54')]){_0x33d9d9['where']=_[_0xe4d2('0x55')](_0x33d9d9[_0xe4d2('0x52')],{'$or':_['map'](_0x33d9d9[_0xe4d2('0x4e')],function(_0x4225f1){var _0x7a3c5={};_0x7a3c5[_0x4225f1]={'$like':'%'+_0x17250a['query']['filter']+'%'};return _0x7a3c5;})});}_0x33d9d9=_['merge']({},_0x33d9d9,_0x17250a[_0xe4d2('0x56')]);return _0x42d34b['getProactiveActions'](_0x33d9d9);}})[_0xe4d2('0x22')](function(_0xdd82f2){if(_0xdd82f2){_0x4252b2=_0xdd82f2[_0xe4d2('0x4f')];if(!_0x17250a[_0xe4d2('0x49')][_0xe4d2('0x6c')]('nolimit')){_0x33d9d9[_0xe4d2('0x32')]=qs[_0xe4d2('0x32')](_0x17250a['query'][_0xe4d2('0x32')]);_0x33d9d9['offset']=qs[_0xe4d2('0x31')](_0x17250a['query'][_0xe4d2('0x31')]);}return _0x42d34b[_0xe4d2('0xfe')](_0x33d9d9);}})['then'](function(_0x302488){if(_0x302488){return _0x302488?{'count':_0x4252b2,'rows':_0x302488}:null;}})['then'](respondWithResult(_0x563d9d,null))['catch'](handleError(_0x563d9d,null));};exports['getFields']=function(_0x2e59cc,_0x118d73,_0x220f8e){var _0x504bb4=_0x2e59cc[_0xe4d2('0x49')][_0xe4d2('0x114')]===_0xe4d2('0x115')?_0xe4d2('0x116'):_0xe4d2('0x117');return db['ChatWebsite'][_0xe4d2('0x67')]({'attributes':['id',_0x504bb4],'where':{'id':_0x2e59cc[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x118d73,null))[_0xe4d2('0x22')](function(_0x9c2ec1){if(_0x9c2ec1){var _0xab92f4=_0x9c2ec1[_0x504bb4];var _0x345da2=_0xab92f4&&_0xab92f4['items']?_0xab92f4[_0xe4d2('0x118')]:[];_0x118d73[_0xe4d2('0x3f')]({'fromKey':_[_0xe4d2('0x8c')](_0xab92f4[_0xe4d2('0x119')])?undefined:_0xab92f4[_0xe4d2('0x119')],'count':_0x345da2[_0xe4d2('0x4f')],'rows':_0x345da2});}})[_0xe4d2('0x2c')](handleError(_0x118d73,null));};exports[_0xe4d2('0x11a')]=function(_0x5547df,_0x5d0e1d,_0x179216){var _0x27f7a6={'raw':![],'where':{}};var _0x5dfeef={};var _0x29da6f={'count':0x0,'rows':[]};return db[_0xe4d2('0x57')]['findOne']({'where':{'id':_0x5547df[_0xe4d2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d0e1d,null))[_0xe4d2('0x22')](function(_0x2dfda6){if(_0x2dfda6){_0x5dfeef['model']=_[_0xe4d2('0x4a')](db[_0xe4d2('0x11b')]['rawAttributes']);_0x5dfeef[_0xe4d2('0x49')]=_[_0xe4d2('0x4a')](_0x5547df[_0xe4d2('0x49')]);_0x5dfeef[_0xe4d2('0x4b')]=_['intersection'](_0x5dfeef[_0xe4d2('0x48')],_0x5dfeef['query']);_0x27f7a6['attributes']=_[_0xe4d2('0x4c')](_0x5dfeef[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x5547df[_0xe4d2('0x49')]['fields']));_0x27f7a6[_0xe4d2('0x4e')]=_0x27f7a6[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x27f7a6[_0xe4d2('0x4e')]:_0x5dfeef[_0xe4d2('0x48')];if(!_0x5547df[_0xe4d2('0x49')][_0xe4d2('0x6c')]('nolimit')){_0x27f7a6['limit']=qs[_0xe4d2('0x32')](_0x5547df[_0xe4d2('0x49')][_0xe4d2('0x32')]);_0x27f7a6[_0xe4d2('0x31')]=qs[_0xe4d2('0x31')](_0x5547df[_0xe4d2('0x49')][_0xe4d2('0x31')]);}_0x27f7a6[_0xe4d2('0x6d')]=qs[_0xe4d2('0x51')](_0x5547df['query'][_0xe4d2('0x51')]);_0x27f7a6[_0xe4d2('0x52')]=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0x5547df['query'],_0x5dfeef['filters']));_0x27f7a6[_0xe4d2('0x52')]['ChatWebsiteId']=_0x2dfda6['id'];if(_0x5547df['query'][_0xe4d2('0x54')]){_0x27f7a6[_0xe4d2('0x52')]=_['merge'](_0x27f7a6['where'],{'$or':_[_0xe4d2('0x43')](_0x27f7a6['attributes'],function(_0x44bf9f){var _0x4f1079={};_0x4f1079[_0x44bf9f]={'$like':'%'+_0x5547df[_0xe4d2('0x49')][_0xe4d2('0x54')]+'%'};return _0x4f1079;})});}_0x27f7a6=_[_0xe4d2('0x55')]({},_0x27f7a6,_0x5547df[_0xe4d2('0x56')]);return db['ChatOfflineMessage']['count']({'where':_0x27f7a6[_0xe4d2('0x52')]})['then'](function(_0x3153b1){_0x29da6f[_0xe4d2('0x30')]=_0x3153b1;if(_0x5547df[_0xe4d2('0x49')][_0xe4d2('0x5d')]){_0x27f7a6['include']=[{'all':!![]}];}else{_0x27f7a6[_0xe4d2('0x58')]=[{'model':db[_0xe4d2('0x9e')],'as':_0xe4d2('0xec'),'required':![]}];}return db[_0xe4d2('0x11b')][_0xe4d2('0x59')](_0x27f7a6);})[_0xe4d2('0x22')](function(_0x33a05c){_0x29da6f[_0xe4d2('0x5a')]=_0x33a05c;return _0x29da6f;});}})[_0xe4d2('0x22')](respondWithFilteredResult(_0x5d0e1d,_0x27f7a6))[_0xe4d2('0x2c')](handleError(_0x5d0e1d,null));};exports[_0xe4d2('0x11c')]=function(_0x316ea9,_0x11d71,_0x2cf5a9){return db[_0xe4d2('0x57')]['find']({'where':{'id':_0x316ea9['params']['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x11d71,null))['then'](function(_0x26fe63){if(_0x26fe63){return _0x26fe63[_0xe4d2('0x11c')](_0x316ea9[_0xe4d2('0x5f')][_0xe4d2('0x70')],_[_0xe4d2('0x11d')](_0x316ea9['body'],[_0xe4d2('0x70'),'id'])||{})[_0xe4d2('0xc0')](function(_0x55bbff){for(var _0x51dc44=0x0;_0x51dc44<_0x316ea9[_0xe4d2('0x5f')][_0xe4d2('0x70')][_0xe4d2('0x4f')];_0x51dc44+=0x1){socket[_0xe4d2('0x11e')](_0xe4d2('0x11f'),{'UserId':_0x316ea9[_0xe4d2('0x5f')][_0xe4d2('0x70')][_0x51dc44],'ChatWebsiteId':_0x316ea9[_0xe4d2('0x5c')]['id']});}return _0x55bbff;});}})['then'](respondWithResult(_0x11d71,null))[_0xe4d2('0x2c')](handleError(_0x11d71,null));};exports['removeAgents']=function(_0x5f0422,_0x4a7d4b,_0x20ae8b){return db[_0xe4d2('0x57')][_0xe4d2('0x67')]({'where':{'id':_0x5f0422[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x4a7d4b,null))[_0xe4d2('0x22')](function(_0x3b1f79){if(_0x3b1f79){return _0x3b1f79['removeAgents'](_0x5f0422['query'][_0xe4d2('0x70')])['then'](function(){if(_[_0xe4d2('0x120')](_0x5f0422['query'][_0xe4d2('0x70')])){for(var _0x4fe0ab=0x0;_0x4fe0ab<_0x5f0422[_0xe4d2('0x49')][_0xe4d2('0x70')]['length'];_0x4fe0ab+=0x1){socket[_0xe4d2('0x11e')](_0xe4d2('0x121'),{'UserId':Number(_0x5f0422['query']['ids'][_0x4fe0ab]),'ChatWebsiteId':Number(_0x5f0422[_0xe4d2('0x5c')]['id'])});}}else{socket['emit'](_0xe4d2('0x121'),{'UserId':Number(_0x5f0422[_0xe4d2('0x49')][_0xe4d2('0x70')]),'ChatWebsiteId':Number(_0x5f0422[_0xe4d2('0x5c')]['id'])});}});}})[_0xe4d2('0x22')](respondWithStatusCode(_0x4a7d4b,null))[_0xe4d2('0x2c')](handleError(_0x4a7d4b,null));};exports[_0xe4d2('0x122')]=function(_0x4e2817,_0x28cdbb,_0x35450c){var _0x22a397={};var _0x1062dc={};var _0x22751f;var _0x44631a;return db['ChatWebsite'][_0xe4d2('0xdc')]({'where':{'id':_0x4e2817[_0xe4d2('0x5c')]['id']}})[_0xe4d2('0x22')](handleEntityNotFound(_0x28cdbb,null))[_0xe4d2('0x22')](function(_0x210f63){if(_0x210f63){_0x22751f=_0x210f63;_0x1062dc[_0xe4d2('0x48')]=_['keys'](db[_0xe4d2('0xc9')][_0xe4d2('0x44')]);_0x1062dc[_0xe4d2('0x49')]=_['keys'](_0x4e2817[_0xe4d2('0x49')]);_0x1062dc[_0xe4d2('0x4b')]=_[_0xe4d2('0x4c')](_0x1062dc[_0xe4d2('0x48')],_0x1062dc[_0xe4d2('0x49')]);_0x22a397[_0xe4d2('0x4e')]=_['intersection'](_0x1062dc[_0xe4d2('0x48')],qs[_0xe4d2('0x4d')](_0x4e2817[_0xe4d2('0x49')][_0xe4d2('0x4d')]));_0x22a397[_0xe4d2('0x4e')]=_0x22a397[_0xe4d2('0x4e')][_0xe4d2('0x4f')]?_0x22a397[_0xe4d2('0x4e')]:_0x1062dc['model'];_0x22a397[_0xe4d2('0x6d')]=qs[_0xe4d2('0x51')](_0x4e2817['query']['sort']);_0x22a397[_0xe4d2('0x52')]=qs[_0xe4d2('0x4b')](_[_0xe4d2('0x6e')](_0x4e2817[_0xe4d2('0x49')],_0x1062dc[_0xe4d2('0x4b')]));if(_0x4e2817['query'][_0xe4d2('0x54')]){_0x22a397[_0xe4d2('0x52')]=_[_0xe4d2('0x55')](_0x22a397[_0xe4d2('0x52')],{'$or':_[_0xe4d2('0x43')](_0x22a397[_0xe4d2('0x4e')],function(_0x56983f){var _0x2ee8e8={};_0x2ee8e8[_0x56983f]={'$like':'%'+_0x4e2817['query']['filter']+'%'};return _0x2ee8e8;})});}_0x22a397=_[_0xe4d2('0x55')]({},_0x22a397,_0x4e2817['options']);return _0x22751f['getAgents'](_0x22a397);}})['then'](function(_0x525ac3){if(_0x525ac3){_0x44631a=_0x525ac3['length'];if(!_0x4e2817[_0xe4d2('0x49')]['hasOwnProperty']('nolimit')){_0x22a397['limit']=qs[_0xe4d2('0x32')](_0x4e2817[_0xe4d2('0x49')]['limit']);_0x22a397['offset']=qs[_0xe4d2('0x31')](_0x4e2817['query'][_0xe4d2('0x31')]);}return _0x22751f['getAgents'](_0x22a397);}})[_0xe4d2('0x22')](function(_0x496c4b){if(_0x496c4b){return _0x496c4b?{'count':_0x44631a,'rows':_0x496c4b}:null;}})[_0xe4d2('0x22')](respondWithResult(_0x28cdbb,null))[_0xe4d2('0x2c')](handleError(_0x28cdbb,null));}; \ No newline at end of file +var _0x598d=['chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','DESC','List','account','Applications','list','applications','orderBy','priority','asc','Contacts','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','EventManager','offline','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','email','addInteraction','getInteractions','Contact','Owner','fullname','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','some','remote','x-real-ip','connection','alignment','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','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~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','ChatWebsite','include','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatWebsites','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','notify','user-agent-parser','setUA','getResult'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0x598d,0x1b9));var _0xd598=function(_0x323437,_0x3bc345){_0x323437=_0x323437-0x0;var _0x2da452=_0x598d[_0x323437];return _0x2da452;};'use strict';var pdf=require(_0xd598('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd598('0x1'));var jsonpatch=require(_0xd598('0x2'));var rp=require(_0xd598('0x3'));var moment=require(_0xd598('0x4'));var BPromise=require(_0xd598('0x5'));var Mustache=require(_0xd598('0x6'));var util=require(_0xd598('0x7'));var path=require(_0xd598('0x8'));var sox=require(_0xd598('0x9'));var csv=require(_0xd598('0xa'));var ejs=require(_0xd598('0xb'));var fs=require('fs');var _=require(_0xd598('0xc'));var squel=require(_0xd598('0xd'));var crypto=require(_0xd598('0xe'));var jsforce=require(_0xd598('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd598('0xa'));var querystring=require('querystring');var Papa=require(_0xd598('0x10'));var Redis=require(_0xd598('0x11'));var authService=require(_0xd598('0x12'));var qs=require(_0xd598('0x13'));var as=require(_0xd598('0x14'));var hardwareService=require(_0xd598('0x15'));var logger=require('../../config/logger')(_0xd598('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd598('0x17')]=_[_0xd598('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd598('0x19'))(new Redis(config[_0xd598('0x17')]));require(_0xd598('0x1a'))[_0xd598('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xd598('0x1c')][_0xd598('0x1d')]({'port':0x232a});var client9003=jayson[_0xd598('0x1c')][_0xd598('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x4cb714,_0x5815aa,_0x104a6e){if(_0x104a6e){var _0x1d7205=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d7205[_0xd598('0x1e')](_0x5815aa)){return _0x4cb714;}else{throw new db['Sequelize']['ValidationError'](_0xd598('0x1f'));}}else{return _0x4cb714;}}function respondWithRpcPromise(_0x6b90cd,_0x382f0b,_0x46f2e5,_0x38fec4){return new BPromise(function(_0x528c01,_0x3823b6){var _0x58df17=_0x38fec4||client;return _0x58df17[_0xd598('0x20')](_0x6b90cd,_0x46f2e5)['then'](function(_0x3980cf){logger[_0xd598('0x21')](_0xd598('0x22'),_0x382f0b,_0xd598('0x23'));logger[_0xd598('0x24')](_0xd598('0x25'),_0x382f0b,_0xd598('0x23'),JSON[_0xd598('0x26')](_0x3980cf));if(_0x3980cf[_0xd598('0x27')]){if(_0x3980cf[_0xd598('0x27')][_0xd598('0x28')]===0x1f4){logger[_0xd598('0x27')](_0xd598('0x22'),_0x382f0b,_0x3980cf[_0xd598('0x27')][_0xd598('0x29')]);return _0x3823b6(_0x3980cf[_0xd598('0x27')][_0xd598('0x29')]);}logger[_0xd598('0x27')](_0xd598('0x22'),_0x382f0b,_0x3980cf['error']['message']);return _0x528c01(_0x3980cf[_0xd598('0x27')][_0xd598('0x29')]);}else{logger[_0xd598('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x382f0b,_0xd598('0x23'));_0x528c01(_0x3980cf[_0xd598('0x2a')]['message']);}})[_0xd598('0x2b')](function(_0x2faaf1){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x382f0b,_0x2faaf1);_0x3823b6(_0x2faaf1);});});}function respondWithStatusCode(_0x26b84e,_0x2490b4){_0x2490b4=_0x2490b4||0xcc;return function(_0x2b6b3c){if(_0x2b6b3c){return _0x26b84e[_0xd598('0x2c')](_0x2490b4);}return _0x26b84e[_0xd598('0x2d')](_0x2490b4)[_0xd598('0x2e')]();};}function respondWithResult(_0x5d2c5a,_0xea4ff0){_0xea4ff0=_0xea4ff0||0xc8;return function(_0x98ea0d){if(_0x98ea0d){return _0x5d2c5a[_0xd598('0x2d')](_0xea4ff0)[_0xd598('0x2f')](_0x98ea0d);}};}function respondWithFilteredResult(_0x3cb75a,_0x49a3c9){return function(_0x1dc172){if(_0x1dc172){var _0xb2e19e=_0x1dc172[_0xd598('0x30')],_0x38a184=_0x49a3c9[_0xd598('0x31')],_0x50804e=_0x49a3c9['offset']+_0x49a3c9[_0xd598('0x32')],_0x3425fd;if(_0x50804e>=_0xb2e19e){_0x50804e=_0xb2e19e;_0x3425fd=0xc8;}else{_0x3425fd=0xce;}_0x3cb75a[_0xd598('0x2d')](_0x3425fd);return _0x3cb75a[_0xd598('0x33')](_0xd598('0x34'),_0x38a184+'-'+_0x50804e+'/'+_0xb2e19e)[_0xd598('0x2f')](_0x1dc172);}return null;};}function patchUpdates(_0xf88574){return function(_0x32e0ec){try{jsonpatch[_0xd598('0x35')](_0x32e0ec,_0xf88574,!![]);}catch(_0x239fa4){return BPromise[_0xd598('0x36')](_0x239fa4);}return _0x32e0ec['save']();};}function saveUpdates(_0x3ec8c8,_0x5bbcee){return function(_0x288560){if(_0x288560){return _0x288560[_0xd598('0x37')](_0x3ec8c8)[_0xd598('0x38')](function(_0x949eb1){return _0x949eb1;});}return null;};}function removeEntity(_0xc7ad1b,_0x1d84e9){return function(_0x198c3d){if(_0x198c3d){return _0x198c3d[_0xd598('0x39')]()[_0xd598('0x38')](function(){var _0x25a464=_0x198c3d[_0xd598('0x3a')]({'plain':!![]});var _0x51e2e3='ChatWebsites';return db[_0xd598('0x3b')][_0xd598('0x39')]({'where':{'type':_0x51e2e3,'resourceId':_0x25a464['id']}})[_0xd598('0x38')](function(){return _0x198c3d;});})[_0xd598('0x38')](function(){_0xc7ad1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c715,_0x55cf78){return function(_0x20380e){if(!_0x20380e){_0x50c715[_0xd598('0x2c')](0x194);}return _0x20380e;};}function handleError(_0x3d4224,_0x1da0ba){_0x1da0ba=_0x1da0ba||0x1f4;return function(_0xbb548){logger[_0xd598('0x27')](_0xbb548[_0xd598('0x3c')]);if(_0xbb548[_0xd598('0x3d')]){delete _0xbb548['name'];}_0x3d4224[_0xd598('0x2d')](_0x1da0ba)['send'](_0xbb548);};}exports[_0xd598('0x3e')]=function(_0x1c1f66,_0x3bb6ab){var _0x57f142={'include':[{'model':db[_0xd598('0x3f')],'as':_0xd598('0x40')}]},_0x4cdb4f={},_0x4fba00={'count':0x0,'rows':[]};var _0x29fab1=_[_0xd598('0x41')](db['ChatWebsite'][_0xd598('0x42')],function(_0x1761be){return{'name':_0x1761be[_0xd598('0x43')],'type':_0x1761be['type'][_0xd598('0x44')]};});_0x4cdb4f[_0xd598('0x45')]=_[_0xd598('0x41')](_0x29fab1,_0xd598('0x3d'));_0x4cdb4f[_0xd598('0x46')]=_[_0xd598('0x47')](_0x1c1f66[_0xd598('0x46')]);_0x4cdb4f[_0xd598('0x48')]=_[_0xd598('0x49')](_0x4cdb4f['model'],_0x4cdb4f[_0xd598('0x46')]);_0x57f142[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x4cdb4f['model'],qs['fields'](_0x1c1f66[_0xd598('0x46')][_0xd598('0x4b')]));_0x57f142[_0xd598('0x4a')]=_0x57f142[_0xd598('0x4a')][_0xd598('0x4c')]?_0x57f142[_0xd598('0x4a')]:_0x4cdb4f[_0xd598('0x45')];if(!_0x1c1f66[_0xd598('0x46')][_0xd598('0x4d')](_0xd598('0x4e'))){_0x57f142['limit']=qs[_0xd598('0x32')](_0x1c1f66[_0xd598('0x46')][_0xd598('0x32')]);_0x57f142[_0xd598('0x31')]=qs[_0xd598('0x31')](_0x1c1f66['query'][_0xd598('0x31')]);}_0x57f142[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x1c1f66[_0xd598('0x46')][_0xd598('0x50')]);_0x57f142['where']=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x1c1f66[_0xd598('0x46')],_0x4cdb4f[_0xd598('0x48')]),_0x29fab1);if(_0x1c1f66[_0xd598('0x46')][_0xd598('0x52')]){_0x57f142[_0xd598('0x53')]=_[_0xd598('0x54')](_0x57f142[_0xd598('0x53')],{'$or':_['map'](_0x29fab1,function(_0x6de56e){if(_0x6de56e[_0xd598('0x55')]!=='VIRTUAL'){var _0x58abe9={};_0x58abe9[_0x6de56e[_0xd598('0x3d')]]={'$like':'%'+_0x1c1f66[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0x58abe9;}})});}_0x57f142=_[_0xd598('0x54')]({},_0x57f142,_0x1c1f66[_0xd598('0x56')]);var _0x2ec19c={'where':_0x57f142[_0xd598('0x53')]};return db[_0xd598('0x57')][_0xd598('0x30')](_0x2ec19c)['then'](function(_0x3c3a91){_0x4fba00[_0xd598('0x30')]=_0x3c3a91;if(_0x1c1f66['query']['includeAll']){_0x57f142[_0xd598('0x58')]=[{'all':!![]}];}return db[_0xd598('0x57')][_0xd598('0x59')](_0x57f142);})[_0xd598('0x38')](function(_0x236ab0){_0x4fba00[_0xd598('0x5a')]=_0x236ab0;return _0x4fba00;})['then'](respondWithFilteredResult(_0x3bb6ab,_0x57f142))[_0xd598('0x2b')](handleError(_0x3bb6ab,null));};exports[_0xd598('0x5b')]=function(_0x53bab5,_0xb089b7){var _0x2c7ef2={'raw':![],'where':{'id':_0x53bab5['params']['id']},'include':[{'model':db[_0xd598('0x3f')],'as':'mandatoryDispositionPause'}]},_0x2d665c={};_0x2d665c['model']=_[_0xd598('0x47')](db['ChatWebsite'][_0xd598('0x42')]);_0x2d665c[_0xd598('0x46')]=_[_0xd598('0x47')](_0x53bab5['query']);_0x2d665c['filters']=_['intersection'](_0x2d665c['model'],_0x2d665c[_0xd598('0x46')]);_0x2c7ef2[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x2d665c['model'],qs[_0xd598('0x4b')](_0x53bab5[_0xd598('0x46')][_0xd598('0x4b')]));_0x2c7ef2[_0xd598('0x4a')]=_0x2c7ef2['attributes']['length']?_0x2c7ef2[_0xd598('0x4a')]:_0x2d665c[_0xd598('0x45')];if(_0x53bab5[_0xd598('0x46')][_0xd598('0x5c')]){_0x2c7ef2[_0xd598('0x58')]=[{'all':!![]}];}_0x2c7ef2=_[_0xd598('0x54')]({},_0x2c7ef2,_0x53bab5[_0xd598('0x56')]);return db[_0xd598('0x57')][_0xd598('0x5d')](_0x2c7ef2)['then'](handleEntityNotFound(_0xb089b7,null))['then'](respondWithResult(_0xb089b7,null))[_0xd598('0x2b')](handleError(_0xb089b7,null));};exports[_0xd598('0x5e')]=function(_0x1e1a31,_0x207e98){return db['ChatWebsite'][_0xd598('0x5e')](_0x1e1a31[_0xd598('0x5f')],{})[_0xd598('0x38')](function(_0x2c1341){var _0x24696b=_0x1e1a31['user'][_0xd598('0x3a')]({'plain':!![]});if(!_0x24696b)throw new Error(_0xd598('0x60'));if(_0x24696b['role']===_0xd598('0x61')){var _0x5af418=_0x2c1341[_0xd598('0x3a')]({'plain':!![]});var _0x706775=_0xd598('0x62');return db[_0xd598('0x63')][_0xd598('0x5d')]({'where':{'name':_0x706775,'userProfileId':_0x24696b['userProfileId']},'raw':!![]})[_0xd598('0x38')](function(_0x4ecc02){if(_0x4ecc02&&_0x4ecc02['autoAssociation']===0x0){return db[_0xd598('0x3b')][_0xd598('0x5e')]({'name':_0x5af418[_0xd598('0x3d')],'resourceId':_0x5af418['id'],'type':_0x4ecc02[_0xd598('0x3d')],'sectionId':_0x4ecc02['id']},{})[_0xd598('0x38')](function(){return _0x2c1341;});}else{return _0x2c1341;}})[_0xd598('0x2b')](function(_0x3763b3){logger[_0xd598('0x27')](_0xd598('0x64'),_0x3763b3);throw _0x3763b3;});}return _0x2c1341;})[_0xd598('0x38')](respondWithResult(_0x207e98,0xc9))[_0xd598('0x2b')](handleError(_0x207e98,null));};exports[_0xd598('0x37')]=function(_0x113ad8,_0x587803){if(_0x113ad8[_0xd598('0x5f')]['id']){delete _0x113ad8[_0xd598('0x5f')]['id'];}return db[_0xd598('0x57')]['find']({'where':{'id':_0x113ad8[_0xd598('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0xd598('0x40')}]})[_0xd598('0x38')](handleEntityNotFound(_0x587803,null))[_0xd598('0x38')](saveUpdates(_0x113ad8[_0xd598('0x5f')],null))['then'](respondWithResult(_0x587803,null))['catch'](handleError(_0x587803,null));};exports['destroy']=function(_0x23140e,_0x520489){return db[_0xd598('0x57')]['find']({'where':{'id':_0x23140e[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x520489,null))[_0xd598('0x38')](removeEntity(_0x520489,null))[_0xd598('0x2b')](handleError(_0x520489,null));};exports[_0xd598('0x66')]=function(_0x57ee13,_0xf38465){return db[_0xd598('0x57')][_0xd598('0x66')]()[_0xd598('0x38')](respondWithResult(_0xf38465,null))[_0xd598('0x2b')](handleError(_0xf38465,null));};exports['addDisposition']=function(_0x50fa3e,_0x36595b,_0x13d273){if(_0x50fa3e[_0xd598('0x5f')]['id']){delete _0x50fa3e[_0xd598('0x5f')]['id'];}return db['ChatWebsite'][_0xd598('0x5d')]({'where':{'id':_0x50fa3e[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x36595b,null))[_0xd598('0x38')](function(_0x141425){if(_0x141425){_0x50fa3e[_0xd598('0x5f')][_0xd598('0x67')]=_0x141425['id'];return db[_0xd598('0x68')][_0xd598('0x5e')](_0x50fa3e[_0xd598('0x5f')]);}})['then'](respondWithResult(_0x36595b,null))[_0xd598('0x2b')](handleError(_0x36595b,null));};exports[_0xd598('0x69')]=function(_0x58f04c,_0x3001a3,_0x4b094f){var _0x352f4e={'raw':![],'where':{}};var _0x392456={};var _0x54cd53={'count':0x0,'rows':[]};return db[_0xd598('0x57')][_0xd598('0x6a')]({'where':{'id':_0x58f04c[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x3001a3,null))[_0xd598('0x38')](function(_0x4dd820){if(_0x4dd820){_0x392456[_0xd598('0x45')]=_[_0xd598('0x47')](db[_0xd598('0x68')][_0xd598('0x42')]);_0x392456['query']=_[_0xd598('0x47')](_0x58f04c[_0xd598('0x46')]);_0x392456[_0xd598('0x48')]=_[_0xd598('0x49')](_0x392456[_0xd598('0x45')],_0x392456[_0xd598('0x46')]);_0x352f4e['attributes']=_[_0xd598('0x49')](_0x392456[_0xd598('0x45')],qs['fields'](_0x58f04c[_0xd598('0x46')][_0xd598('0x4b')]));_0x352f4e[_0xd598('0x4a')]=_0x352f4e[_0xd598('0x4a')]['length']?_0x352f4e[_0xd598('0x4a')]:_0x392456[_0xd598('0x45')];if(!_0x58f04c[_0xd598('0x46')][_0xd598('0x4d')](_0xd598('0x4e'))){_0x352f4e[_0xd598('0x32')]=qs[_0xd598('0x32')](_0x58f04c[_0xd598('0x46')][_0xd598('0x32')]);_0x352f4e['offset']=qs[_0xd598('0x31')](_0x58f04c[_0xd598('0x46')][_0xd598('0x31')]);}_0x352f4e[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x58f04c[_0xd598('0x46')][_0xd598('0x50')]);_0x352f4e[_0xd598('0x53')]=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x58f04c[_0xd598('0x46')],_0x392456[_0xd598('0x48')]));_0x352f4e[_0xd598('0x53')][_0xd598('0x67')]=_0x4dd820['id'];if(_0x58f04c[_0xd598('0x46')][_0xd598('0x52')]){_0x352f4e['where']=_[_0xd598('0x54')](_0x352f4e[_0xd598('0x53')],{'$or':_['map'](_0x352f4e['attributes'],function(_0x43c200){var _0x38070f={};_0x38070f[_0x43c200]={'$like':'%'+_0x58f04c[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0x38070f;})});}_0x352f4e=_['merge']({},_0x352f4e,_0x58f04c[_0xd598('0x56')]);return db[_0xd598('0x68')][_0xd598('0x30')]({'where':_0x352f4e[_0xd598('0x53')]})[_0xd598('0x38')](function(_0x5c4b2e){_0x54cd53[_0xd598('0x30')]=_0x5c4b2e;if(_0x58f04c[_0xd598('0x46')][_0xd598('0x5c')]){_0x352f4e[_0xd598('0x58')]=[{'all':!![]}];}return db[_0xd598('0x68')][_0xd598('0x59')](_0x352f4e);})[_0xd598('0x38')](function(_0x5b4921){_0x54cd53['rows']=_0x5b4921;return _0x54cd53;});}})[_0xd598('0x38')](respondWithFilteredResult(_0x3001a3,_0x352f4e))[_0xd598('0x2b')](handleError(_0x3001a3,null));};exports[_0xd598('0x6b')]=function(_0x1a2cf0,_0xbbfc47,_0x4a3ee1){return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x1a2cf0[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0xbbfc47,null))[_0xd598('0x38')](function(_0x41ee36){if(_0x41ee36){return _0x41ee36[_0xd598('0x6b')](_0x1a2cf0[_0xd598('0x46')][_0xd598('0x6c')]);}})[_0xd598('0x38')](respondWithStatusCode(_0xbbfc47,null))['catch'](handleError(_0xbbfc47,null));};exports[_0xd598('0x6d')]=function(_0x106616,_0x3271f3,_0x3c7a7b){if(_0x106616[_0xd598('0x5f')]['id']){delete _0x106616['body']['id'];}return db['ChatWebsite'][_0xd598('0x5d')]({'where':{'id':_0x106616[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x3271f3,null))['then'](function(_0x58a48d){if(_0x58a48d){_0x106616['body'][_0xd598('0x67')]=_0x58a48d['id'];return db[_0xd598('0x6e')]['create'](_0x106616[_0xd598('0x5f')]);}})[_0xd598('0x38')](respondWithResult(_0x3271f3,null))[_0xd598('0x2b')](handleError(_0x3271f3,null));};exports[_0xd598('0x6f')]=function(_0x4fb267,_0xd5d594,_0x2bca1f){var _0x17b75f={'raw':![],'where':{}};var _0x5bb7e5={};var _0xdf6873={'count':0x0,'rows':[]};return db[_0xd598('0x57')][_0xd598('0x6a')]({'where':{'id':_0x4fb267[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0xd5d594,null))[_0xd598('0x38')](function(_0x27e840){if(_0x27e840){_0x5bb7e5[_0xd598('0x45')]=_[_0xd598('0x47')](db[_0xd598('0x6e')][_0xd598('0x42')]);_0x5bb7e5[_0xd598('0x46')]=_[_0xd598('0x47')](_0x4fb267[_0xd598('0x46')]);_0x5bb7e5[_0xd598('0x48')]=_[_0xd598('0x49')](_0x5bb7e5[_0xd598('0x45')],_0x5bb7e5['query']);_0x17b75f[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x5bb7e5[_0xd598('0x45')],qs[_0xd598('0x4b')](_0x4fb267[_0xd598('0x46')]['fields']));_0x17b75f[_0xd598('0x4a')]=_0x17b75f[_0xd598('0x4a')][_0xd598('0x4c')]?_0x17b75f['attributes']:_0x5bb7e5[_0xd598('0x45')];if(!_0x4fb267[_0xd598('0x46')][_0xd598('0x4d')](_0xd598('0x4e'))){_0x17b75f[_0xd598('0x32')]=qs[_0xd598('0x32')](_0x4fb267[_0xd598('0x46')][_0xd598('0x32')]);_0x17b75f[_0xd598('0x31')]=qs['offset'](_0x4fb267[_0xd598('0x46')]['offset']);}_0x17b75f['order']=qs[_0xd598('0x50')](_0x4fb267[_0xd598('0x46')]['sort']);_0x17b75f['where']=qs[_0xd598('0x48')](_['pick'](_0x4fb267[_0xd598('0x46')],_0x5bb7e5[_0xd598('0x48')]));_0x17b75f[_0xd598('0x53')][_0xd598('0x67')]=_0x27e840['id'];if(_0x4fb267['query']['filter']){_0x17b75f['where']=_['merge'](_0x17b75f[_0xd598('0x53')],{'$or':_['map'](_0x17b75f[_0xd598('0x4a')],function(_0x5801c1){var _0x1bc2fd={};_0x1bc2fd[_0x5801c1]={'$like':'%'+_0x4fb267['query'][_0xd598('0x52')]+'%'};return _0x1bc2fd;})});}_0x17b75f=_['merge']({},_0x17b75f,_0x4fb267[_0xd598('0x56')]);return db[_0xd598('0x6e')][_0xd598('0x30')]({'where':_0x17b75f[_0xd598('0x53')]})['then'](function(_0x154403){_0xdf6873['count']=_0x154403;if(_0x4fb267[_0xd598('0x46')][_0xd598('0x5c')]){_0x17b75f['include']=[{'all':!![]}];}return db[_0xd598('0x6e')][_0xd598('0x59')](_0x17b75f);})[_0xd598('0x38')](function(_0x1d026f){_0xdf6873[_0xd598('0x5a')]=_0x1d026f;return _0xdf6873;});}})[_0xd598('0x38')](respondWithFilteredResult(_0xd5d594,_0x17b75f))[_0xd598('0x2b')](handleError(_0xd5d594,null));};exports[_0xd598('0x70')]=function(_0x4c0470,_0x2247aa,_0xd67e0){return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x4c0470[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x2247aa,null))[_0xd598('0x38')](function(_0x4c0051){if(_0x4c0051){return _0x4c0051['removeAnswers'](_0x4c0470[_0xd598('0x46')][_0xd598('0x6c')]);}})['then'](respondWithStatusCode(_0x2247aa,null))[_0xd598('0x2b')](handleError(_0x2247aa,null));};exports['addLogo']=function(_0x46cef7,_0x65b833,_0x18458c){_0x46cef7[_0xd598('0x5f')]['sitepic']=_0x46cef7[_0xd598('0x71')][_0xd598('0x72')];return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x46cef7['params']['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x65b833,null))['then'](saveUpdates(_0x46cef7[_0xd598('0x5f')],null))[_0xd598('0x38')](respondWithResult(_0x65b833,null))[_0xd598('0x2b')](handleError(_0x65b833,null));};exports[_0xd598('0x73')]=function(_0x124391,_0x40dd50,_0x2bd47c){_0x124391['body'][_0xd598('0x74')]=_0x124391[_0xd598('0x71')][_0xd598('0x72')];return db['ChatWebsite'][_0xd598('0x5d')]({'where':{'id':_0x124391[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x40dd50,null))[_0xd598('0x38')](saveUpdates(_0x124391[_0xd598('0x5f')],null))[_0xd598('0x38')](respondWithResult(_0x40dd50,null))['catch'](handleError(_0x40dd50,null));};exports[_0xd598('0x75')]=function(_0x5f1313,_0x1475f9,_0x3061bf){_0x5f1313[_0xd598('0x5f')][_0xd598('0x76')]=_0x5f1313['file'][_0xd598('0x72')];return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x5f1313[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0x1475f9,null))['then'](saveUpdates(_0x5f1313['body'],null))['then'](respondWithResult(_0x1475f9,null))[_0xd598('0x2b')](handleError(_0x1475f9,null));};exports[_0xd598('0x77')]=function(_0x1adba5,_0x290c00,_0x397ed6){_0x1adba5[_0xd598('0x5f')][_0xd598('0x78')]=_0x1adba5[_0xd598('0x71')][_0xd598('0x72')];return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x1adba5[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x290c00,null))[_0xd598('0x38')](saveUpdates(_0x1adba5[_0xd598('0x5f')],null))[_0xd598('0x38')](respondWithResult(_0x290c00,null))['catch'](handleError(_0x290c00,null));};exports[_0xd598('0x79')]=function(_0x484ebf,_0x205dd2,_0x2538c0){var _0x5f0df6=path[_0xd598('0x7a')](config[_0xd598('0x7b')],'server/files/images/logos/default_logo.svg');var _0x3a3e51={'where':{'id':_0x484ebf[_0xd598('0x65')]['id']},'attributes':['id',_0xd598('0x7c')],'raw':!![]};var _0x57ea2a=![];return require(_0xd598('0x7d'))[_0xd598('0x7e')]()['then'](function(_0x22eb45){if(_0x22eb45){_0x57ea2a=_0x22eb45[_0xd598('0x7f')];}})[_0xd598('0x38')](function(){return db[_0xd598('0x57')][_0xd598('0x5d')](_0x3a3e51);})[_0xd598('0x38')](handleEntityNotFound(_0x205dd2,null))[_0xd598('0x38')](function(_0x1752e2){if(_0x1752e2){if(!_['isNil'](_0x1752e2[_0xd598('0x7c')])){if(fs['existsSync'](path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x80'),_0x1752e2[_0xd598('0x7c')]))&&_0x57ea2a){_0x5f0df6=path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x80'),_0x1752e2[_0xd598('0x7c')]);}}return _0x205dd2[_0xd598('0x81')](_0x5f0df6);}})['catch'](handleError(_0x205dd2,null));};exports[_0xd598('0x82')]=function(_0x3e8208,_0x5e1588,_0x9d61da){var _0x3cad9f=path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x83'));var _0x4d1a0b={'where':{'id':_0x3e8208[_0xd598('0x65')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd598('0x57')][_0xd598('0x5d')](_0x4d1a0b)[_0xd598('0x38')](handleEntityNotFound(_0x5e1588,null))['then'](function(_0x5893ba){if(_0x5893ba){if(!_[_0xd598('0x84')](_0x5893ba[_0xd598('0x74')])){if(fs['existsSync'](path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x85'),_0x5893ba['agentAvatar']))){_0x3cad9f=path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x85'),_0x5893ba['agentAvatar']);}}return _0x5e1588[_0xd598('0x81')](_0x3cad9f);}})[_0xd598('0x2b')](handleError(_0x5e1588,null));};exports[_0xd598('0x86')]=function(_0x47b8b0,_0x525727,_0x199aab){var _0x2a29a9=path['join'](config[_0xd598('0x7b')],_0xd598('0x87'));var _0x2df418={'where':{'id':_0x47b8b0[_0xd598('0x65')]['id']},'attributes':['id',_0xd598('0x76'),_0xd598('0x88')],'raw':!![]};return db[_0xd598('0x57')][_0xd598('0x5d')](_0x2df418)[_0xd598('0x38')](handleEntityNotFound(_0x525727,null))[_0xd598('0x38')](function(_0x5d67cb){if(_0x5d67cb){if(!_[_0xd598('0x84')](_0x5d67cb[_0xd598('0x76')])){if(fs[_0xd598('0x89')](path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x85'),_0x5d67cb[_0xd598('0x76')]))&&_0x5d67cb[_0xd598('0x88')]){_0x2a29a9=path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0x85'),_0x5d67cb[_0xd598('0x76')]);}}return _0x525727[_0xd598('0x81')](_0x2a29a9);}})['catch'](handleError(_0x525727,null));};exports[_0xd598('0x8a')]=function(_0x5df211,_0x37391e,_0x27b31d){var _0x306f32=path[_0xd598('0x7a')](config[_0xd598('0x7b')],'server/files/images/avatars/system_avatar.png');var _0xed1b05={'where':{'id':_0x5df211['params']['id']},'attributes':['id',_0xd598('0x78')],'raw':!![]};return db[_0xd598('0x57')]['find'](_0xed1b05)[_0xd598('0x38')](handleEntityNotFound(_0x37391e,null))[_0xd598('0x38')](function(_0x46920e){if(_0x46920e){if(!_['isNil'](_0x46920e[_0xd598('0x78')])){if(fs[_0xd598('0x89')](path[_0xd598('0x7a')](config['root'],_0xd598('0x85'),_0x46920e[_0xd598('0x78')]))){_0x306f32=path[_0xd598('0x7a')](config[_0xd598('0x7b')],'server/files/images/avatars/',_0x46920e[_0xd598('0x78')]);}}return _0x37391e[_0xd598('0x81')](_0x306f32);}})[_0xd598('0x2b')](handleError(_0x37391e,null));};exports[_0xd598('0x8b')]=function(_0x4b2d94,_0x758ef1,_0x26eb8d){var _0x3a8fd5=require(_0xd598('0x8c'));var _0x2825cd=new _0x3a8fd5();var _0x5aa7b2=_0x2825cd[_0xd598('0x8d')](_0x4b2d94['headers']['user-agent'])[_0xd598('0x8e')]();var _0x3f8c7f={'body':_0x4b2d94['body'],'channel':_0xd598('0x8f')};var _0x40631f=[];var _0x48629d=[];var _0x5bfaee={};var _0xd57400=![];return db[_0xd598('0x90')]['describe']()['then'](function(_0x1dbcb4){if(!_0x1dbcb4){throw new db['Sequelize'][(_0xd598('0x91'))](_0xd598('0x92'));}_0x40631f=_[_0xd598('0x93')](_[_0xd598('0x47')](_0x1dbcb4),[_0xd598('0x94'),_0xd598('0x95')]);_0x48629d=_[_0xd598('0x93')](_[_0xd598('0x47')](_0x1dbcb4),[_0xd598('0x94'),_0xd598('0x95'),_0xd598('0x96'),'ListId']);if(_0x4b2d94[_0xd598('0x5f')]['id']){delete _0x4b2d94[_0xd598('0x5f')]['id'];}if(_[_0xd598('0x84')](_0x4b2d94[_0xd598('0x5f')][_0xd598('0x97')])){throw new db['Sequelize'][(_0xd598('0x91'))](_0xd598('0x98'));}if(_['isNil'](_0x4b2d94['body'][_0xd598('0x5f')])||_0x4b2d94[_0xd598('0x5f')][_0xd598('0x5f')]===''){throw new db[(_0xd598('0x99'))][(_0xd598('0x91'))](_0xd598('0x9a'));}if(_[_0xd598('0x84')](_0x4b2d94[_0xd598('0x5f')]['mapKey'])){throw new db[(_0xd598('0x99'))]['ValidationError'](_0xd598('0x9b')+_0x48629d);}if(!_[_0xd598('0x9c')](_0x48629d,_0x4b2d94['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xd598('0x9d')+_0x48629d);}_0x5bfaee[_0x4b2d94['body'][_0xd598('0x9e')]]=_0x4b2d94[_0xd598('0x5f')]['from'];})[_0xd598('0x38')](function(){return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x4b2d94[_0xd598('0x65')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5bfaee,'limit':0x1,'order':[['updatedAt',_0xd598('0x9f')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0xd598('0x38')](handleEntityNotFound(_0x758ef1,null))[_0xd598('0x38')](function(_0x3e45fd){if(_0x3e45fd&&_0x3e45fd[_0xd598('0xa0')]){_0x3f8c7f[_0xd598('0xa1')]=_0x3e45fd;_0x3f8c7f['applications']=_0x3e45fd[_0xd598('0xa2')];_0x3f8c7f[_0xd598('0xa3')]=_0x3e45fd[_0xd598('0xa0')];_0x3f8c7f[_0xd598('0xa4')]=_[_0xd598('0xa5')](_0x3f8c7f[_0xd598('0xa4')],[_0xd598('0xa6')],[_0xd598('0xa7')]);if(_0x3f8c7f[_0xd598('0xa1')]['Applications']){delete _0x3f8c7f[_0xd598('0xa1')][_0xd598('0xa2')];}if(_0x3f8c7f['account']['List']&&_0x3f8c7f[_0xd598('0xa1')]['List'][_0xd598('0xa8')][_0xd598('0x4c')]){return _0x3f8c7f[_0xd598('0xa1')][_0xd598('0xa0')][_0xd598('0xa8')][0x0];}var _0x3e13b1=_[_0xd598('0x18')](_0x4b2d94[_0xd598('0x5f')],{'firstName':_0x4b2d94['body']['from'],'ListId':_0x3e45fd[_0xd598('0xa9')]});_0x3e13b1[_0x4b2d94[_0xd598('0x5f')][_0xd598('0x9e')]]=_0x4b2d94[_0xd598('0x5f')][_0xd598('0x97')];return db['CmContact'][_0xd598('0x5e')](_0x3e13b1,{'fields':_0x40631f,'raw':!![]});}})['then'](handleEntityNotFound(_0x758ef1,null))[_0xd598('0x38')](function(_0x4a4cf3){_0x3f8c7f[_0xd598('0xaa')]=_0x4a4cf3;var _0x25ff8e=_0x4b2d94[_0xd598('0x5f')][_0xd598('0xab')];if(_0x4b2d94[_0xd598('0xac')][_0xd598('0xad')]){_0x25ff8e=_0x4b2d94[_0xd598('0xac')][_0xd598('0xad')];}else if(_0x4b2d94['headers'][_0xd598('0xae')]){_0x25ff8e=_[_0xd598('0xaf')](_0x4b2d94[_0xd598('0xac')][_0xd598('0xae')][_0xd598('0xb0')](','));}if(_0x4a4cf3){var _0x3825fb={'ContactId':_0x4a4cf3['id'],'ChatWebsiteId':_0x4b2d94['params']['id'],'from':(_0x4a4cf3[_0xd598('0xb1')]||'')+'\x20'+(_0x4a4cf3['lastName']||''),'customerIp':_0x25ff8e,'customerPort':_0x4b2d94[_0xd598('0xac')][_0xd598('0xb2')]?_0x4b2d94[_0xd598('0xac')]['x-real-port']:null,'referer':_0x4b2d94['body'][_0xd598('0xb3')],'browserName':_0x5aa7b2[_0xd598('0xb4')]['name']&&_0x5aa7b2[_0xd598('0xb4')][_0xd598('0xb5')]?util[_0xd598('0xb6')]('%s\x20%s',_0x5aa7b2['browser']['name'],_0x5aa7b2[_0xd598('0xb4')][_0xd598('0xb5')]):_0xd598('0xb7'),'browserVersion':_0x5aa7b2[_0xd598('0xb4')][_0xd598('0xb5')]||'unknown','osName':util[_0xd598('0xb6')](_0xd598('0xb8'),_0x5aa7b2['os']['name'],_0x5aa7b2['os'][_0xd598('0xb5')]),'osVersion':_0x5aa7b2['os'][_0xd598('0xb5')],'deviceModel':_0x5aa7b2[_0xd598('0xb9')][_0xd598('0x45')]&&_0x5aa7b2['device'][_0xd598('0xba')]?util[_0xd598('0xb6')](_0xd598('0xbb'),_0x5aa7b2['device'][_0xd598('0x45')],_0x5aa7b2[_0xd598('0xb9')][_0xd598('0xba')],_0x5aa7b2['device'][_0xd598('0x55')]):null,'deviceVendor':_0x5aa7b2[_0xd598('0xb9')][_0xd598('0xba')],'deviceType':_0x5aa7b2[_0xd598('0xb9')][_0xd598('0x55')],'formData':JSON[_0xd598('0x26')](_0x4b2d94['body'])};var _0x22ead0={'ChatWebsiteId':_0x4b2d94[_0xd598('0x65')]['id'],'closed':![]};if(_0x4b2d94['body'][_0xd598('0xbc')]){_0x22ead0[_0xd598('0xbc')]=_0x4b2d94[_0xd598('0x5f')][_0xd598('0xbc')];return db['ChatInteraction'][_0xd598('0x5d')]({'where':_0x22ead0})['then'](function(_0x5a3f2f){if(_0x5a3f2f){return[_0x5a3f2f,![]];}_0x3825fb[_0xd598('0xbc')]=_0x4b2d94[_0xd598('0x5f')]['threadId'];_0x3825fb[_0xd598('0xbd')]=_0x4b2d94[_0xd598('0x5f')]['externalUrl'];return db[_0xd598('0xbe')][_0xd598('0x5e')](_0x3825fb)[_0xd598('0x38')](function(_0x52e435){return[_0x52e435,!![]];});});}_0x22ead0[_0xd598('0xbf')]=_0x4a4cf3['id'];if(_0x4b2d94['body'][_0xd598('0xc0')]&&_0x4b2d94[_0xd598('0x5f')][_0xd598('0xc0')]['id']){_0x22ead0['id']=_0x4b2d94[_0xd598('0x5f')]['interaction']['id'];return db[_0xd598('0xbe')][_0xd598('0x5d')]({'where':_0x22ead0})[_0xd598('0x38')](function(_0x56f287){if(_0x56f287){return[_0x56f287,![]];}return db['ChatInteraction'][_0xd598('0x5e')](_0x3825fb)['then'](function(_0x48203b){return[_0x48203b,!![]];});});}return db['ChatInteraction'][_0xd598('0x5e')](_0x3825fb)[_0xd598('0x38')](function(_0x16dcae){return[_0x16dcae,!![]];});}})[_0xd598('0xc1')](function(_0x413085,_0x32bd2d){if(_0x413085){_0xd57400=_0x32bd2d;if(!_0x32bd2d){var _0x1bcc5c={'from':(_0x3f8c7f[_0xd598('0xaa')]['firstName']||'')+'\x20'+(_0x3f8c7f[_0xd598('0xaa')][_0xd598('0xc2')]||'')};if(_0x4b2d94['body']['threadId']&&_0x4b2d94[_0xd598('0x5f')][_0xd598('0xc3')]&&_0x4b2d94['body'][_0xd598('0xbc')]!=_0x4b2d94[_0xd598('0x5f')][_0xd598('0xc3')]){_0x1bcc5c['threadId']=_0x4b2d94[_0xd598('0x5f')][_0xd598('0xc3')];}return _0x413085['update'](_0x1bcc5c);}else{return _0x413085;}}})[_0xd598('0x38')](function(_0x30923e){_0x3f8c7f['interaction']=_0x30923e[_0xd598('0x3a')]({'plain':!![]});_0x3f8c7f[_0xd598('0xc0')][_0xd598('0xc4')]=_0xd57400;if(_0x3f8c7f['interaction']['created']){if(_0x3f8c7f['account'][_0xd598('0xc5')]){_0x3f8c7f['applications'][_0xd598('0xc6')]({'id':0x0,'priority':_0x3f8c7f[_0xd598('0xa4')][_0xd598('0x4c')]+0x1,'app':_0xd598('0xc7'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xd598('0x5e')]({'body':_0x4b2d94[_0xd598('0x5f')]['body'],'ChatWebsiteId':_0x4b2d94[_0xd598('0x65')]['id'],'ChatInteractionId':_0x30923e['id'],'direction':'in','ContactId':_0x3f8c7f[_0xd598('0xaa')]['id'],'AttachmentId':_0x4b2d94[_0xd598('0x5f')][_0xd598('0xc8')]});})[_0xd598('0x38')](function(_0x7f44b7){_0x3f8c7f['message']=_0x7f44b7;if(_0x3f8c7f[_0xd598('0xc0')][_0xd598('0xc9')]){return db[_0xd598('0xca')][_0xd598('0x5d')]({'attributes':['id',_0xd598('0x3d')],'where':{'id':_0x3f8c7f['interaction'][_0xd598('0xc9')]}})[_0xd598('0x38')](function(_0x4380f2){if(_0x4380f2){_0x3f8c7f['applications'][_0xd598('0xcb')]({'id':0x0,'priority':0x0,'app':_0xd598('0xcc'),'appdata':_0x4380f2[_0xd598('0x3d')]+','+(_0x3f8c7f[_0xd598('0xa1')][_0xd598('0xcd')]||0xa),'interval':_0xd598('0xce')});_0x3f8c7f['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xd598('0xcf'),_0x3f8c7f);});}return respondWithRpcPromise('Start','startRouting',_0x3f8c7f);})[_0xd598('0x38')](function(_0x4d6a32){respondWithRpcPromise(_0xd598('0xd0'),_0xd598('0xd0'),{'event':'notify','message':_0x4d6a32},client9002);return _0x4d6a32;})[_0xd598('0x38')](respondWithResult(_0x758ef1,null))['catch'](handleError(_0x758ef1,null));};exports[_0xd598('0xd1')]=function(_0x33f30c,_0x237c89,_0x559802){var _0x58de95,_0x50964a,_0x17279c;var _0x5c2f62=[];var _0x3e8609=[];var _0xd2e0a5={};return db[_0xd598('0x90')][_0xd598('0x66')]()[_0xd598('0x38')](function(_0x3dd496){if(!_0x3dd496){throw new db['Sequelize']['ValidationError'](_0xd598('0x92'));}_0x3e8609=_[_0xd598('0x93')](_[_0xd598('0x47')](_0x3dd496),[_0xd598('0x94'),'updatedAt']);_0x5c2f62=_[_0xd598('0x93')](_[_0xd598('0x47')](_0x3dd496),[_0xd598('0x94'),_0xd598('0x95'),'CompanyId',_0xd598('0xa9')]);if(_0x33f30c[_0xd598('0x5f')]['id']){delete _0x33f30c['body']['id'];}if(_[_0xd598('0x84')](_0x33f30c['body']['from'])){throw _0x237c89[_0xd598('0x2d')](0x1f4)[_0xd598('0xd2')](new db[(_0xd598('0x99'))]['ValidationError'](_0xd598('0x98')));}if(_['isNil'](_0x33f30c[_0xd598('0x5f')]['body'])||_0x33f30c[_0xd598('0x5f')][_0xd598('0x5f')]===''){throw _0x237c89[_0xd598('0x2d')](0x1f4)[_0xd598('0xd2')](new db['Sequelize'][(_0xd598('0x91'))](_0xd598('0x9a')));}if(_['isNil'](_0x33f30c['body'][_0xd598('0xd3')])){throw _0x237c89[_0xd598('0x2d')](0x1f4)[_0xd598('0xd2')](new db[(_0xd598('0x99'))][(_0xd598('0x91'))](_0xd598('0xd4')+_0x5c2f62));}if(!_['includes'](_0x5c2f62,_0x33f30c['body'][_0xd598('0xd3')])){throw _0x237c89[_0xd598('0x2d')](0x1f4)[_0xd598('0xd2')](new db[(_0xd598('0x99'))][(_0xd598('0x91'))](_0xd598('0xd5')+_0x5c2f62));}_0xd2e0a5[_0x33f30c[_0xd598('0x5f')]['mapKeyOffline']]=_0x33f30c[_0xd598('0x5f')][_0xd598('0x97')];})[_0xd598('0x38')](function(){return db[_0xd598('0x57')][_0xd598('0x5d')]({'where':{'id':_0x33f30c[_0xd598('0x65')]['id']},'include':[{'model':db[_0xd598('0xd6')],'as':_0xd598('0xa0')}]});})[_0xd598('0x38')](handleEntityNotFound(_0x237c89,null))[_0xd598('0x38')](function(_0x1e36bd){if(_0x1e36bd&&_0x1e36bd[_0xd598('0xa0')]){_0x50964a=_0x1e36bd;var _0xfa8d08=_[_0xd598('0x18')](_0x33f30c[_0xd598('0x5f')],{'firstName':_0x33f30c[_0xd598('0x5f')][_0xd598('0x97')],'phone':_0x33f30c[_0xd598('0x5f')][_0xd598('0x97')],'ListId':_0x1e36bd['ListId']});_0xfa8d08[_0x33f30c[_0xd598('0x5f')][_0xd598('0xd3')]]=_0x33f30c[_0xd598('0x5f')][_0xd598('0x97')];return db[_0xd598('0x90')][_0xd598('0xd7')]({'where':_0xd2e0a5,'defaults':_0xfa8d08});}})['spread'](function(_0x319526){if(_0x319526){_0x17279c=_0x319526;var _0x142d28=fs[_0xd598('0xd8')](path[_0xd598('0x7a')](config[_0xd598('0x7b')],_0xd598('0xd9')),_0xd598('0xda'));var _0x145ab1=ejs[_0xd598('0xdb')](_0x142d28,{'body':_[_0xd598('0xdc')](_0x33f30c[_0xd598('0x5f')][_0xd598('0x5f')]),'bodyTitle':_0x50964a['offlineMessageBody']});return db[_0xd598('0xdd')]['create']({'body':_0x145ab1,'ContactId':_0x319526['id'],'ChatWebsiteId':_0x50964a['id']});}})[_0xd598('0x38')](function(_0x2915a8){if(_0x2915a8){_0x58de95=_0x2915a8;return db[_0xd598('0xde')][_0xd598('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0xd598('0xdf')],'as':_0xd598('0xe0'),'raw':!![]}]});}})[_0xd598('0x38')](function(_0x3f395b){if(_0x3f395b&&_0x3f395b[_0xd598('0xe0')]&&_0x50964a[_0xd598('0xe1')]){var _0x13b322={'tls':{'rejectUnauthorized':![]}};if(_0x3f395b['Smtp'][_0xd598('0xe2')]){_0x13b322[_0xd598('0xe2')]=_0x3f395b[_0xd598('0xe0')][_0xd598('0xe2')];}else{_0x13b322[_0xd598('0xe3')]=_0x3f395b[_0xd598('0xe0')][_0xd598('0xe3')];_0x13b322[_0xd598('0xe4')]=_0x3f395b[_0xd598('0xe0')][_0xd598('0xe4')];_0x13b322[_0xd598('0xe5')]=_0x3f395b[_0xd598('0xe0')][_0xd598('0xe5')];}if(_0x3f395b[_0xd598('0xe0')][_0xd598('0xe6')]){_0x13b322[_0xd598('0xe7')]={'user':_0x3f395b[_0xd598('0xe0')][_0xd598('0x61')],'pass':_0x3f395b['Smtp'][_0xd598('0xe8')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x13b322,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3f395b[_0xd598('0x3d')],_0x3f395b[_0xd598('0xe9')]||_0x3f395b[_0xd598('0xe0')][_0xd598('0x61')]),'to':_0x50964a[_0xd598('0xe1')],'subject':_0x50964a['offlineMessageSubject'],'text':_0x58de95['body']}},client9003)['then'](function(){return _0x58de95;})['catch'](function(_0x4ff785){console[_0xd598('0x27')](_0x4ff785);});}})[_0xd598('0x38')](function(){if(_0x58de95){return _0x58de95;}})['then'](respondWithResult(_0x237c89,null))[_0xd598('0x2b')](handleError(_0x237c89,null));};exports[_0xd598('0xea')]=function(_0x48ae33,_0x3b9d60,_0x4a7aa1){return db[_0xd598('0xbe')][_0xd598('0x5d')]({'where':{'id':_0x48ae33['params']['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x3b9d60,null))[_0xd598('0x38')](function(_0xd4c61c){if(_0xd4c61c){return _0xd4c61c['addInteraction'](_0x48ae33['body'][_0xd598('0x6c')],_['omit'](_0x48ae33[_0xd598('0x5f')],[_0xd598('0x6c'),'id'])||{});}})[_0xd598('0x38')](respondWithResult(_0x3b9d60,null))[_0xd598('0x2b')](handleError(_0x3b9d60,null));};exports[_0xd598('0xeb')]=function(_0x315a74,_0x443df8,_0x4c1e0d){var _0x7794f0={'raw':![],'where':{}};var _0x7c99ec={};var _0x2727d6={'count':0x0,'rows':[]};return db[_0xd598('0x57')][_0xd598('0x6a')]({'where':{'id':_0x315a74[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0x443df8,null))['then'](function(_0x3fee87){if(_0x3fee87){_0x7c99ec[_0xd598('0x45')]=_['keys'](db[_0xd598('0xbe')][_0xd598('0x42')]);_0x7c99ec[_0xd598('0x46')]=_[_0xd598('0x47')](_0x315a74[_0xd598('0x46')]);_0x7c99ec[_0xd598('0x48')]=_['intersection'](_0x7c99ec[_0xd598('0x45')],_0x7c99ec['query']);_0x7794f0[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x7c99ec[_0xd598('0x45')],qs[_0xd598('0x4b')](_0x315a74['query'][_0xd598('0x4b')]));_0x7794f0[_0xd598('0x4a')]=_0x7794f0['attributes']['length']?_0x7794f0[_0xd598('0x4a')]:_0x7c99ec[_0xd598('0x45')];if(!_0x315a74[_0xd598('0x46')][_0xd598('0x4d')]('nolimit')){_0x7794f0['limit']=qs[_0xd598('0x32')](_0x315a74[_0xd598('0x46')][_0xd598('0x32')]);_0x7794f0['offset']=qs[_0xd598('0x31')](_0x315a74[_0xd598('0x46')]['offset']);}_0x7794f0[_0xd598('0x4f')]=qs['sort'](_0x315a74[_0xd598('0x46')][_0xd598('0x50')]);_0x7794f0[_0xd598('0x53')]=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x315a74[_0xd598('0x46')],_0x7c99ec[_0xd598('0x48')]));_0x7794f0['where'][_0xd598('0x67')]=_0x3fee87['id'];if(_0x315a74[_0xd598('0x46')]['filter']){_0x7794f0['where']=_[_0xd598('0x54')](_0x7794f0[_0xd598('0x53')],{'$or':_[_0xd598('0x41')](_0x7794f0[_0xd598('0x4a')],function(_0x138cf1){var _0x18fec5={};_0x18fec5[_0x138cf1]={'$like':'%'+_0x315a74[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0x18fec5;})});}_0x7794f0=_[_0xd598('0x54')]({},_0x7794f0,_0x315a74[_0xd598('0x56')]);return db['ChatInteraction']['count']({'where':_0x7794f0[_0xd598('0x53')]})['then'](function(_0x20f629){_0x2727d6[_0xd598('0x30')]=_0x20f629;if(_0x315a74[_0xd598('0x46')][_0xd598('0x5c')]){_0x7794f0[_0xd598('0x58')]=[{'model':db[_0xd598('0x90')],'as':_0xd598('0xec'),'required':![]},{'model':db[_0xd598('0xca')],'as':_0xd598('0xed'),'attributes':[_0xd598('0x3d'),_0xd598('0xee'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xd598('0xef'),'attributes':['id',_0xd598('0x3d'),_0xd598('0xf0')],'where':_0x315a74['query'][_0xd598('0xf1')]?{'id':_0x315a74[_0xd598('0x46')]['tag']}:undefined,'required':_0x315a74['query'][_0xd598('0xf1')]?!![]:![]}];}return db['ChatInteraction'][_0xd598('0x59')](_0x7794f0);})[_0xd598('0x38')](function(_0x510e6a){_0x2727d6['rows']=_0x510e6a;return _0x2727d6;});}})[_0xd598('0x38')](respondWithFilteredResult(_0x443df8,_0x7794f0))[_0xd598('0x2b')](handleError(_0x443df8,null));};function iftimePromise(_0x416d02,_0x474976){return respondWithRpcPromise(_0xd598('0xf2'),'getSnippet',{'command':_0x474976['timezone']?util[_0xd598('0xb6')](_0xd598('0xf3'),_0x416d02[_0xd598('0xf4')],_0x474976[_0xd598('0xf5')]):util[_0xd598('0xb6')](_0xd598('0xf6'),_0x416d02['interval'])},client9002)[_0xd598('0x38')](function(_0x446e02){var _0x14a8fc=_0x446e02&&_0x446e02[_0xd598('0xf7')]('true')>=0x0?!![]:![];logger[_0xd598('0x21')](_0xd598('0xf8'),_0x474976['id'],_0x416d02['id'],_0x416d02[_0xd598('0xf4')],_0x14a8fc?_0xd598('0xf9'):_0xd598('0xfa'),_0x474976['timezone']?_0x474976[_0xd598('0xf5')]:_0xd598('0xfb'));return _0x14a8fc;})[_0xd598('0x2b')](function(_0x4c7606){logger['error'](_0xd598('0xf8'),_0x474976['id'],_0x416d02['id'],_0x416d02[_0xd598('0xf4')],util[_0xd598('0xfc')](_0x4c7606,{'showHidden':![],'depth':null}),_0x474976['timezone']?_0x474976[_0xd598('0xf5')]:_0xd598('0xfb'));return![];});}exports[_0xd598('0xfd')]=function(_0x18d19c,_0x3d0335,_0x2002b9){var _0xf4b591=0x0;var _0x4c36e4=0x0;var _0x149bbc=![];var _0x171e0d;var _0x519db7;return db['ChatWebsite'][_0xd598('0x5d')]({'where':{'id':_0x18d19c[_0xd598('0x65')]['id']},'include':[{'model':db[_0xd598('0xfe')],'as':_0xd598('0xfe'),'include':[{'model':db['Interval'],'as':_0xd598('0xff'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xd598('0x38')](handleEntityNotFound(_0x3d0335,null))[_0xd598('0x38')](function(_0x253ec9){if(_0x253ec9){_0x171e0d=_0x253ec9;return _0x253ec9[_0xd598('0x100')]({'raw':!![]});}})['then'](function(_0x1c44e9){if(_0x171e0d){if(_0x1c44e9){_0x519db7=_0x1c44e9;}}return require(_0xd598('0x7d'))[_0xd598('0x7e')]();})['then'](function(_0x457b67){if(_0x457b67){_0x4c36e4=_0x457b67[_0xd598('0x101')];_0x149bbc=_0x457b67[_0xd598('0x7f')];}})[_0xd598('0x38')](function(){return db[_0xd598('0xbe')][_0xd598('0x30')]({'where':{'closed':![]}});})[_0xd598('0x38')](function(_0x3c2f22){_0xf4b591=_0x3c2f22;if(_0x4c36e4&&_0x3c2f22>_0x4c36e4){return db[_0xd598('0x102')]['findOne']({'where':{'id':0x1}})[_0xd598('0x38')](function(_0x12f2a3){if(_0x12f2a3){_0x12f2a3['increment'](_0xd598('0x103'));}});}})[_0xd598('0x38')](function(){if(_0x171e0d[_0xd598('0xfe')]&&_0x171e0d[_0xd598('0xfe')][_0xd598('0xff')]){var _0x28fdbb=[];for(var _0x182249=0x0;_0x182249<_0x171e0d[_0xd598('0xfe')][_0xd598('0xff')][_0xd598('0x4c')];_0x182249++){var _0x4e57bd=_0x171e0d[_0xd598('0xfe')][_0xd598('0xff')][_0x182249][_0xd598('0x3a')]({'plain':!![]});_0x28fdbb[_0xd598('0xc6')](iftimePromise(_0x4e57bd,_0x171e0d));}return BPromise['all'](_0x28fdbb)[_0xd598('0x38')](function(_0x1868f2){return _[_0xd598('0x104')](_0x1868f2);});}else{return!![];}})[_0xd598('0x38')](function(_0x395667){var _0xfb9914=fs[_0xd598('0xd8')](path[_0xd598('0x7a')](config['root'],'server/files/chat/iframe.js'),_0xd598('0xda'));var _0x124cb5={'remote':_0x171e0d[_0xd598('0x105')],'query':querystring[_0xd598('0x26')](_[_0xd598('0x54')](_0x171e0d[_0xd598('0x3a')]({'plain':!![]}),{'customerIp':_0x18d19c[_0xd598('0xac')][_0xd598('0xae')]||_0x18d19c[_0xd598('0xac')][_0xd598('0x106')]||_0x18d19c[_0xd598('0x107')]['remoteAddress']||_0x18d19c['ip'],'referer':_0x18d19c['headers'][_0xd598('0xb3')],'openedInteractions':_0xf4b591,'maxInteractions':_0x4c36e4,'virtual':_0x149bbc[_0xd598('0x101')],'online':_0x395667,'custom':_0x149bbc}))['replace'](/'/g,'\x5c\x27')};_0x3d0335[_0xd598('0xd2')](ejs[_0xd598('0xdb')](Mustache[_0xd598('0xdb')](_0xfb9914,_0x124cb5),{'proactiveActions':_0x519db7,'alignment':_0x171e0d[_0xd598('0x108')],'verticalAlignment':_0x171e0d[_0xd598('0x109')],'div_color':_0x171e0d[_0xd598('0xf0')],'text_color':_0x171e0d['textColor']}));})[_0xd598('0x2b')](handleError(_0x3d0335,null));};exports[_0xd598('0x10a')]=function(_0x24f059,_0x5eb30d,_0x30cb48){return db[_0xd598('0x57')][_0xd598('0x6a')]({'where':{'id':_0x24f059[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0x5eb30d,null))['then'](function(_0x553e0a){if(_0x553e0a){return db[_0xd598('0x10b')][_0xd598('0x10c')](function(_0x5b9b39){return db[_0xd598('0x10d')]['destroy']({'where':{'ChatWebsiteId':_0x24f059[_0xd598('0x65')]['id']},'transaction':_0x5b9b39})['then'](function(_0x284dbb){var _0x2bcd83=_[_0xd598('0x41')](_0x24f059[_0xd598('0x5f')],function(_0x9b7a8){_0x9b7a8[_0xd598('0x67')]=_0x24f059['params']['id'];return _0x9b7a8;});return db[_0xd598('0x10d')][_0xd598('0x10e')](_0x2bcd83,{'transaction':_0x5b9b39});});})[_0xd598('0x38')](function(){return db['ChatApplication'][_0xd598('0x10f')]({'where':{'ChatWebsiteId':_0x24f059[_0xd598('0x65')]['id']},'order':_0xd598('0xa6')});});}})[_0xd598('0x38')](respondWithResult(_0x5eb30d,null))[_0xd598('0x2b')](handleError(_0x5eb30d,null));};exports[_0xd598('0x110')]=function(_0x593b1b,_0x69eec6,_0x587f0e){var _0x519279={};var _0x1ce3b7={};var _0x22a6c0;var _0x3f3620;return db['ChatWebsite'][_0xd598('0x6a')]({'where':{'id':_0x593b1b[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x69eec6,null))['then'](function(_0x8b6f0){if(_0x8b6f0){_0x22a6c0=_0x8b6f0;_0x1ce3b7[_0xd598('0x45')]=_[_0xd598('0x47')](db[_0xd598('0x10d')][_0xd598('0x42')]);_0x1ce3b7['query']=_[_0xd598('0x47')](_0x593b1b['query']);_0x1ce3b7[_0xd598('0x48')]=_[_0xd598('0x49')](_0x1ce3b7['model'],_0x1ce3b7[_0xd598('0x46')]);_0x519279[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x1ce3b7['model'],qs[_0xd598('0x4b')](_0x593b1b[_0xd598('0x46')]['fields']));_0x519279['attributes']=_0x519279[_0xd598('0x4a')]['length']?_0x519279[_0xd598('0x4a')]:_0x1ce3b7['model'];_0x519279[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x593b1b[_0xd598('0x46')][_0xd598('0x50')]);_0x519279[_0xd598('0x53')]=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x593b1b[_0xd598('0x46')],_0x1ce3b7['filters']));if(_0x593b1b[_0xd598('0x46')][_0xd598('0x52')]){_0x519279[_0xd598('0x53')]=_[_0xd598('0x54')](_0x519279['where'],{'$or':_['map'](_0x519279[_0xd598('0x4a')],function(_0x4f4500){var _0x59d4fc={};_0x59d4fc[_0x4f4500]={'$like':'%'+_0x593b1b['query'][_0xd598('0x52')]+'%'};return _0x59d4fc;})});}_0x519279=_[_0xd598('0x54')]({},_0x519279,_0x593b1b[_0xd598('0x56')]);return _0x22a6c0[_0xd598('0x110')](_0x519279);}})[_0xd598('0x38')](function(_0x53388e){if(_0x53388e){_0x3f3620=_0x53388e[_0xd598('0x4c')];if(!_0x593b1b['query'][_0xd598('0x4d')](_0xd598('0x4e'))){_0x519279[_0xd598('0x32')]=qs[_0xd598('0x32')](_0x593b1b['query'][_0xd598('0x32')]);_0x519279[_0xd598('0x31')]=qs['offset'](_0x593b1b[_0xd598('0x46')]['offset']);}return _0x22a6c0['getApplications'](_0x519279);}})[_0xd598('0x38')](function(_0x3fc3b5){if(_0x3fc3b5){return _0x3fc3b5?{'count':_0x3f3620,'rows':_0x3fc3b5}:null;}})[_0xd598('0x38')](respondWithResult(_0x69eec6,null))[_0xd598('0x2b')](handleError(_0x69eec6,null));};exports[_0xd598('0x111')]=function(_0x500061,_0xca1a86,_0x529745){return db[_0xd598('0x112')][_0xd598('0x5d')]({'where':{'id':_0x500061[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0xca1a86,null))[_0xd598('0x38')](function(_0xdea1e7){if(_0xdea1e7){return _0xdea1e7[_0xd598('0x111')](_0x500061[_0xd598('0x5f')][_0xd598('0x6c')],_[_0xd598('0x113')](_0x500061[_0xd598('0x5f')],[_0xd598('0x6c'),'id'])||{});}})[_0xd598('0x38')](respondWithResult(_0xca1a86,null))[_0xd598('0x2b')](handleError(_0xca1a86,null));};exports[_0xd598('0x100')]=function(_0x5ade72,_0xe3082b,_0x2e49da){var _0x16698f={};var _0x244488={};var _0xab6f60;var _0x4104e7;return db['ChatWebsite']['findOne']({'where':{'id':_0x5ade72['params']['id']}})[_0xd598('0x38')](handleEntityNotFound(_0xe3082b,null))[_0xd598('0x38')](function(_0x41c806){if(_0x41c806){_0xab6f60=_0x41c806;_0x244488[_0xd598('0x45')]=_[_0xd598('0x47')](db[_0xd598('0x114')][_0xd598('0x42')]);_0x244488[_0xd598('0x46')]=_[_0xd598('0x47')](_0x5ade72['query']);_0x244488[_0xd598('0x48')]=_[_0xd598('0x49')](_0x244488[_0xd598('0x45')],_0x244488[_0xd598('0x46')]);_0x16698f[_0xd598('0x4a')]=_['intersection'](_0x244488['model'],qs[_0xd598('0x4b')](_0x5ade72[_0xd598('0x46')]['fields']));_0x16698f[_0xd598('0x4a')]=_0x16698f[_0xd598('0x4a')][_0xd598('0x4c')]?_0x16698f[_0xd598('0x4a')]:_0x244488[_0xd598('0x45')];_0x16698f[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x5ade72[_0xd598('0x46')][_0xd598('0x50')]);_0x16698f[_0xd598('0x53')]=qs[_0xd598('0x48')](_['pick'](_0x5ade72[_0xd598('0x46')],_0x244488['filters']));if(_0x5ade72[_0xd598('0x46')][_0xd598('0x52')]){_0x16698f['where']=_[_0xd598('0x54')](_0x16698f[_0xd598('0x53')],{'$or':_['map'](_0x16698f[_0xd598('0x4a')],function(_0x4a9974){var _0xbcf5bb={};_0xbcf5bb[_0x4a9974]={'$like':'%'+_0x5ade72[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0xbcf5bb;})});}_0x16698f=_[_0xd598('0x54')]({},_0x16698f,_0x5ade72[_0xd598('0x56')]);return _0xab6f60[_0xd598('0x100')](_0x16698f);}})[_0xd598('0x38')](function(_0x5a4761){if(_0x5a4761){_0x4104e7=_0x5a4761[_0xd598('0x4c')];if(!_0x5ade72[_0xd598('0x46')]['hasOwnProperty'](_0xd598('0x4e'))){_0x16698f['limit']=qs[_0xd598('0x32')](_0x5ade72[_0xd598('0x46')]['limit']);_0x16698f[_0xd598('0x31')]=qs[_0xd598('0x31')](_0x5ade72[_0xd598('0x46')][_0xd598('0x31')]);}return _0xab6f60[_0xd598('0x100')](_0x16698f);}})['then'](function(_0x4c2d89){if(_0x4c2d89){return _0x4c2d89?{'count':_0x4104e7,'rows':_0x4c2d89}:null;}})[_0xd598('0x38')](respondWithResult(_0xe3082b,null))[_0xd598('0x2b')](handleError(_0xe3082b,null));};exports[_0xd598('0x115')]=function(_0x652cb0,_0x4e499d,_0xa35a9a){var _0x23608d=_0x652cb0['query'][_0xd598('0x116')]===_0xd598('0x117')?_0xd598('0x118'):_0xd598('0x119');return db[_0xd598('0x57')][_0xd598('0x5d')]({'attributes':['id',_0x23608d],'where':{'id':_0x652cb0[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x4e499d,null))[_0xd598('0x38')](function(_0x19f853){if(_0x19f853){var _0x408943=_0x19f853[_0x23608d];var _0x3d5496=_0x408943&&_0x408943[_0xd598('0x11a')]?_0x408943['items']:[];_0x4e499d[_0xd598('0xd2')]({'fromKey':_['isNil'](_0x408943['fromKey'])?undefined:_0x408943[_0xd598('0x11b')],'count':_0x3d5496[_0xd598('0x4c')],'rows':_0x3d5496});}})[_0xd598('0x2b')](handleError(_0x4e499d,null));};exports[_0xd598('0x11c')]=function(_0x53f7b0,_0x216bcd,_0x1e8ebc){var _0x493beb={'raw':![],'where':{}};var _0x308823={};var _0x3137ad={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd598('0x6a')]({'where':{'id':_0x53f7b0[_0xd598('0x65')]['id']}})[_0xd598('0x38')](handleEntityNotFound(_0x216bcd,null))[_0xd598('0x38')](function(_0x484f4a){if(_0x484f4a){_0x308823[_0xd598('0x45')]=_[_0xd598('0x47')](db[_0xd598('0xdd')][_0xd598('0x42')]);_0x308823[_0xd598('0x46')]=_['keys'](_0x53f7b0['query']);_0x308823[_0xd598('0x48')]=_[_0xd598('0x49')](_0x308823[_0xd598('0x45')],_0x308823[_0xd598('0x46')]);_0x493beb[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x308823[_0xd598('0x45')],qs['fields'](_0x53f7b0['query'][_0xd598('0x4b')]));_0x493beb['attributes']=_0x493beb['attributes'][_0xd598('0x4c')]?_0x493beb['attributes']:_0x308823[_0xd598('0x45')];if(!_0x53f7b0[_0xd598('0x46')]['hasOwnProperty']('nolimit')){_0x493beb[_0xd598('0x32')]=qs['limit'](_0x53f7b0['query'][_0xd598('0x32')]);_0x493beb[_0xd598('0x31')]=qs[_0xd598('0x31')](_0x53f7b0[_0xd598('0x46')][_0xd598('0x31')]);}_0x493beb[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x53f7b0[_0xd598('0x46')][_0xd598('0x50')]);_0x493beb[_0xd598('0x53')]=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x53f7b0[_0xd598('0x46')],_0x308823[_0xd598('0x48')]));_0x493beb[_0xd598('0x53')][_0xd598('0x67')]=_0x484f4a['id'];if(_0x53f7b0['query']['filter']){_0x493beb[_0xd598('0x53')]=_['merge'](_0x493beb[_0xd598('0x53')],{'$or':_['map'](_0x493beb[_0xd598('0x4a')],function(_0x2a3a1f){var _0x2b75ec={};_0x2b75ec[_0x2a3a1f]={'$like':'%'+_0x53f7b0[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0x2b75ec;})});}_0x493beb=_[_0xd598('0x54')]({},_0x493beb,_0x53f7b0[_0xd598('0x56')]);return db[_0xd598('0xdd')][_0xd598('0x30')]({'where':_0x493beb[_0xd598('0x53')]})[_0xd598('0x38')](function(_0x5370fe){_0x3137ad['count']=_0x5370fe;if(_0x53f7b0[_0xd598('0x46')]['includeAll']){_0x493beb[_0xd598('0x58')]=[{'all':!![]}];}else{_0x493beb[_0xd598('0x58')]=[{'model':db['CmContact'],'as':_0xd598('0xec'),'required':![]}];}return db[_0xd598('0xdd')][_0xd598('0x59')](_0x493beb);})['then'](function(_0x205e64){_0x3137ad[_0xd598('0x5a')]=_0x205e64;return _0x3137ad;});}})['then'](respondWithFilteredResult(_0x216bcd,_0x493beb))['catch'](handleError(_0x216bcd,null));};exports[_0xd598('0x11d')]=function(_0x511f59,_0xf77a,_0x6d9a99){return db['ChatWebsite'][_0xd598('0x5d')]({'where':{'id':_0x511f59['params']['id']}})[_0xd598('0x38')](handleEntityNotFound(_0xf77a,null))['then'](function(_0xbfcfad){if(_0xbfcfad){return _0xbfcfad['addAgents'](_0x511f59[_0xd598('0x5f')][_0xd598('0x6c')],_['omit'](_0x511f59[_0xd598('0x5f')],[_0xd598('0x6c'),'id'])||{})[_0xd598('0xc1')](function(_0xe3d235){for(var _0x401219=0x0;_0x401219<_0x511f59[_0xd598('0x5f')][_0xd598('0x6c')][_0xd598('0x4c')];_0x401219+=0x1){socket[_0xd598('0x11e')](_0xd598('0x11f'),{'UserId':_0x511f59['body'][_0xd598('0x6c')][_0x401219],'ChatWebsiteId':_0x511f59[_0xd598('0x65')]['id']});}return _0xe3d235;});}})[_0xd598('0x38')](respondWithResult(_0xf77a,null))['catch'](handleError(_0xf77a,null));};exports[_0xd598('0x120')]=function(_0x1c7260,_0xf79358,_0x101600){return db[_0xd598('0x57')]['find']({'where':{'id':_0x1c7260['params']['id']}})[_0xd598('0x38')](handleEntityNotFound(_0xf79358,null))[_0xd598('0x38')](function(_0x5bd2b9){if(_0x5bd2b9){return _0x5bd2b9[_0xd598('0x120')](_0x1c7260[_0xd598('0x46')]['ids'])['then'](function(){if(_[_0xd598('0x121')](_0x1c7260[_0xd598('0x46')][_0xd598('0x6c')])){for(var _0x2a8d08=0x0;_0x2a8d08<_0x1c7260[_0xd598('0x46')][_0xd598('0x6c')][_0xd598('0x4c')];_0x2a8d08+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x1c7260[_0xd598('0x46')][_0xd598('0x6c')][_0x2a8d08]),'ChatWebsiteId':Number(_0x1c7260[_0xd598('0x65')]['id'])});}}else{socket[_0xd598('0x11e')](_0xd598('0x122'),{'UserId':Number(_0x1c7260[_0xd598('0x46')]['ids']),'ChatWebsiteId':Number(_0x1c7260['params']['id'])});}});}})[_0xd598('0x38')](respondWithStatusCode(_0xf79358,null))[_0xd598('0x2b')](handleError(_0xf79358,null));};exports['getAgents']=function(_0x5114a6,_0x1be1e6,_0x644fc9){var _0x4a0d86={};var _0x50b102={};var _0xf9e649;var _0x277af6;return db['ChatWebsite'][_0xd598('0x6a')]({'where':{'id':_0x5114a6[_0xd598('0x65')]['id']}})['then'](handleEntityNotFound(_0x1be1e6,null))['then'](function(_0x377a80){if(_0x377a80){_0xf9e649=_0x377a80;_0x50b102['model']=_[_0xd598('0x47')](db[_0xd598('0xca')][_0xd598('0x42')]);_0x50b102[_0xd598('0x46')]=_[_0xd598('0x47')](_0x5114a6[_0xd598('0x46')]);_0x50b102[_0xd598('0x48')]=_[_0xd598('0x49')](_0x50b102[_0xd598('0x45')],_0x50b102['query']);_0x4a0d86[_0xd598('0x4a')]=_[_0xd598('0x49')](_0x50b102[_0xd598('0x45')],qs[_0xd598('0x4b')](_0x5114a6['query']['fields']));_0x4a0d86['attributes']=_0x4a0d86[_0xd598('0x4a')]['length']?_0x4a0d86['attributes']:_0x50b102[_0xd598('0x45')];_0x4a0d86[_0xd598('0x4f')]=qs[_0xd598('0x50')](_0x5114a6[_0xd598('0x46')][_0xd598('0x50')]);_0x4a0d86[_0xd598('0x53')]=qs[_0xd598('0x48')](_[_0xd598('0x51')](_0x5114a6[_0xd598('0x46')],_0x50b102[_0xd598('0x48')]));if(_0x5114a6[_0xd598('0x46')][_0xd598('0x52')]){_0x4a0d86[_0xd598('0x53')]=_[_0xd598('0x54')](_0x4a0d86[_0xd598('0x53')],{'$or':_[_0xd598('0x41')](_0x4a0d86['attributes'],function(_0x4515ca){var _0x3f446b={};_0x3f446b[_0x4515ca]={'$like':'%'+_0x5114a6[_0xd598('0x46')][_0xd598('0x52')]+'%'};return _0x3f446b;})});}_0x4a0d86=_[_0xd598('0x54')]({},_0x4a0d86,_0x5114a6[_0xd598('0x56')]);return _0xf9e649[_0xd598('0x123')](_0x4a0d86);}})[_0xd598('0x38')](function(_0x362a29){if(_0x362a29){_0x277af6=_0x362a29[_0xd598('0x4c')];if(!_0x5114a6['query'][_0xd598('0x4d')](_0xd598('0x4e'))){_0x4a0d86[_0xd598('0x32')]=qs[_0xd598('0x32')](_0x5114a6[_0xd598('0x46')][_0xd598('0x32')]);_0x4a0d86['offset']=qs[_0xd598('0x31')](_0x5114a6[_0xd598('0x46')][_0xd598('0x31')]);}return _0xf9e649['getAgents'](_0x4a0d86);}})[_0xd598('0x38')](function(_0x22ec9b){if(_0x22ec9b){return _0x22ec9b?{'count':_0x277af6,'rows':_0x22ec9b}:null;}})[_0xd598('0x38')](respondWithResult(_0x1be1e6,null))['catch'](handleError(_0x1be1e6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 4fc1605..ca5050b 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 _0xc9f5=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xc9f5[_0x1ed116];return _0x574066;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5c9f('0x0'))['db'][_0x5c9f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c9f('0x2'),'afterUpdate':_0x5c9f('0x3'),'afterDestroy':_0x5c9f('0x4')};function emitEvent(_0x5a1ee5){return function(_0x4a046a,_0x1af905,_0x57d666){ChatWebsiteEvents[_0x5c9f('0x5')](_0x5a1ee5+':'+_0x4a046a['id'],_0x4a046a);ChatWebsiteEvents['emit'](_0x5a1ee5,_0x4a046a);_0x57d666(null);};}for(var e in events){if(events[_0x5c9f('0x6')](e)){var event=events[e];ChatWebsite[_0x5c9f('0x7')](e,emitEvent(event));}}module[_0x5c9f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7024=['exports','events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0x7024,0xa1));var _0x4702=function(_0x51d953,_0x11a23b){_0x51d953=_0x51d953-0x0;var _0x5080c5=_0x7024[_0x51d953];return _0x5080c5;};'use strict';var EventEmitter=require(_0x4702('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4702('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4702('0x2')](0x0);var events={'afterCreate':_0x4702('0x3'),'afterUpdate':_0x4702('0x4'),'afterDestroy':_0x4702('0x5')};function emitEvent(_0x514e34){return function(_0x144426,_0x5902f0,_0x446766){ChatWebsiteEvents[_0x4702('0x6')](_0x514e34+':'+_0x144426['id'],_0x144426);ChatWebsiteEvents['emit'](_0x514e34,_0x144426);_0x446766(null);};}for(var e in events){if(events[_0x4702('0x7')](e)){var event=events[e];ChatWebsite[_0x4702('0x8')](e,emitEvent(event));}}module[_0x4702('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index faf7829..2cba48d 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 _0xf403=['path','rimraf','../../config/environment','define','ChatWebsite','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x493404,_0x5efd40){var _0x2868f3=function(_0x22b5cf){while(--_0x22b5cf){_0x493404['push'](_0x493404['shift']());}};_0x2868f3(++_0x5efd40);}(_0xf403,0x1d3));var _0x3f40=function(_0xe2c604,_0x46d4c3){_0xe2c604=_0xe2c604-0x0;var _0xe41261=_0xf403[_0xe2c604];return _0xe41261;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var logger=require(_0x3f40('0x1'))(_0x3f40('0x2'));var moment=require(_0x3f40('0x3'));var BPromise=require(_0x3f40('0x4'));var rp=require(_0x3f40('0x5'));var fs=require('fs');var path=require(_0x3f40('0x6'));var rimraf=require(_0x3f40('0x7'));var config=require(_0x3f40('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x33f742,_0x22d5e6){return _0x33f742[_0x3f40('0x9')](_0x3f40('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2da=['exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x29ab70,_0x10a26f){var _0x3cab86=function(_0x34ecf6){while(--_0x34ecf6){_0x29ab70['push'](_0x29ab70['shift']());}};_0x3cab86(++_0x10a26f);}(_0xc2da,0x124));var _0xac2d=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0xc2da[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var logger=require(_0xac2d('0x1'))('api');var moment=require(_0xac2d('0x2'));var BPromise=require('bluebird');var rp=require(_0xac2d('0x3'));var fs=require('fs');var path=require(_0xac2d('0x4'));var rimraf=require(_0xac2d('0x5'));var config=require(_0xac2d('0x6'));var attributes=require(_0xac2d('0x7'));module[_0xac2d('0x8')]=function(_0x3db400,_0x133e22){return _0x3db400[_0xac2d('0x9')](_0xac2d('0xa'),attributes,{'tableName':_0xac2d('0xb'),'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 ad31d93..a8d99b8 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 _0x4991=['localhost','socket.io-emitter','./chatWebsite.socket','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatWebsite,\x20%s,\x20%s','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x5e54ea,_0x27a035){var _0x5ebbfb=function(_0x1a4968){while(--_0x1a4968){_0x5e54ea['push'](_0x5e54ea['shift']());}};_0x5ebbfb(++_0x27a035);}(_0x4991,0xf7));var _0x1499=function(_0x40adb4,_0x47cd73){_0x40adb4=_0x40adb4-0x0;var _0x11cc22=_0x4991[_0x40adb4];return _0x11cc22;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});config[_0x1499('0xb')]=_[_0x1499('0xc')](config[_0x1499('0xb')],{'host':_0x1499('0xd'),'port':0x18eb});var socket=require(_0x1499('0xe'))(new Redis(config[_0x1499('0xb')]));require(_0x1499('0xf'))['register'](socket);function respondWithRpcPromise(_0x16e8ad,_0x36a053,_0x575251){return new BPromise(function(_0x2a4816,_0x352180){return client['request'](_0x16e8ad,_0x575251)[_0x1499('0x10')](function(_0x2867b1){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x36a053,'request\x20sent');logger[_0x1499('0x11')](_0x1499('0x12'),_0x36a053,_0x1499('0x13'),JSON[_0x1499('0x14')](_0x2867b1));if(_0x2867b1[_0x1499('0x15')]){if(_0x2867b1['error']['code']===0x1f4){logger[_0x1499('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x36a053,_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);return _0x352180(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}logger['error'](_0x1499('0x17'),_0x36a053,_0x2867b1[_0x1499('0x15')]['message']);return _0x2a4816(_0x2867b1[_0x1499('0x15')][_0x1499('0x16')]);}else{logger[_0x1499('0x18')](_0x1499('0x17'),_0x36a053,_0x1499('0x13'));_0x2a4816(_0x2867b1[_0x1499('0x19')]['message']);}})['catch'](function(_0x5bcb5f){logger[_0x1499('0x15')](_0x1499('0x17'),_0x36a053,_0x5bcb5f);_0x352180(_0x5bcb5f);});});} \ No newline at end of file +var _0xf61e=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x28a26e,_0xf2632d){var _0x581f16=function(_0x331f45){while(--_0x331f45){_0x28a26e['push'](_0x28a26e['shift']());}};_0x581f16(++_0xf2632d);}(_0xf61e,0x191));var _0xef61=function(_0x1e1c0f,_0x3acd26){_0x1e1c0f=_0x1e1c0f-0x0;var _0x335e64=_0xf61e[_0x1e1c0f];return _0x335e64;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});config[_0xef61('0xd')]=_['defaults'](config[_0xef61('0xd')],{'host':_0xef61('0xe'),'port':0x18eb});var socket=require(_0xef61('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xef61('0x10')](socket);function respondWithRpcPromise(_0x2e28c7,_0x1ab79d,_0x11181b){return new BPromise(function(_0x2af74c,_0xdcd707){return client[_0xef61('0x11')](_0x2e28c7,_0x11181b)[_0xef61('0x12')](function(_0x237f43){logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));logger[_0xef61('0x16')](_0xef61('0x17'),_0x1ab79d,'request\x20sent',JSON[_0xef61('0x18')](_0x237f43));if(_0x237f43['error']){if(_0x237f43[_0xef61('0x19')][_0xef61('0x1a')]===0x1f4){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x237f43['error'][_0xef61('0x1b')]);return _0xdcd707(_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);}logger[_0xef61('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x1ab79d,_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);return _0x2af74c(_0x237f43['error'][_0xef61('0x1b')]);}else{logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));_0x2af74c(_0x237f43[_0xef61('0x1c')][_0xef61('0x1b')]);}})[_0xef61('0x1d')](function(_0x55f887){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x55f887);_0xdcd707(_0x55f887);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 5a03af5..4943727 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(_0x5d5ad9,_0x9fe65c){var _0x461f64=function(_0x97c064){while(--_0x97c064){_0x5d5ad9['push'](_0x5d5ad9['shift']());}};_0x461f64(++_0x9fe65c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2063e6,_0x4f04e6){_0x2063e6=_0x2063e6-0x0;var _0x3e3f25=_0x5f2f[_0x2063e6];return _0x3e3f25;};'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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x216e72,_0x5cd161){var _0x2ff28d=function(_0x29a533){while(--_0x29a533){_0x216e72['push'](_0x216e72['shift']());}};_0x2ff28d(++_0x5cd161);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1030c1,_0x325080){_0x1030c1=_0x1030c1-0x0;var _0xf6ae57=_0x5f2f[_0x1030c1];return _0xf6ae57;};'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 diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 7446fd6..3a20db3 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 _0x6c83=['/:id/system_avatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','post','create','addDisposition','/:id/canned_answers','addAnswer','join','format','now','originalname','single','file','addLogo','server/files/images/avatars/','/:id/avatar','addAvatar','diskStorage','root','addCustomerAvatar','%s-%s','addSystemAvatar','/:id/offline','/:id/interactions','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar'];(function(_0x2a79c0,_0x54030d){var _0x48ab04=function(_0x1f69a0){while(--_0x1f69a0){_0x2a79c0['push'](_0x2a79c0['shift']());}};_0x48ab04(++_0x54030d);}(_0x6c83,0x1f2));var _0x36c8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6c83[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x36c8('0x0'));var util=require('util');var path=require(_0x36c8('0x1'));var timeout=require(_0x36c8('0x2'));var express=require(_0x36c8('0x3'));var router=express[_0x36c8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x36c8('0x5'));var config=require(_0x36c8('0x6'));var controller=require(_0x36c8('0x7'));router[_0x36c8('0x8')]('/',auth['isAuthenticated'](),controller[_0x36c8('0x9')]);router[_0x36c8('0x8')](_0x36c8('0xa'),auth[_0x36c8('0xb')](),controller[_0x36c8('0xc')]);router['get'](_0x36c8('0xd'),auth['isAuthenticated'](),controller[_0x36c8('0xe')]);router[_0x36c8('0x8')](_0x36c8('0xf'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x10')]);router[_0x36c8('0x8')]('/:id/canned_answers',auth[_0x36c8('0xb')](),controller[_0x36c8('0x11')]);router[_0x36c8('0x8')](_0x36c8('0x12'),controller['getLogo']);router[_0x36c8('0x8')]('/:id/avatar',controller[_0x36c8('0x13')]);router['get'](_0x36c8('0x14'),controller[_0x36c8('0x15')]);router['get'](_0x36c8('0x16'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x36c8('0xb')](),controller[_0x36c8('0x17')]);router[_0x36c8('0x8')](_0x36c8('0x18'),controller['getSnippet']);router[_0x36c8('0x8')](_0x36c8('0x19'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x1a')]);router[_0x36c8('0x8')](_0x36c8('0x1b'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x1c')]);router[_0x36c8('0x8')](_0x36c8('0x1d'),controller['getFields']);router[_0x36c8('0x8')]('/:id/offline_messages',auth[_0x36c8('0xb')](),controller[_0x36c8('0x1e')]);router[_0x36c8('0x8')]('/:id/users',auth[_0x36c8('0xb')](),controller['getAgents']);router[_0x36c8('0x1f')]('/',auth[_0x36c8('0xb')](),controller[_0x36c8('0x20')]);router[_0x36c8('0x1f')](_0x36c8('0xf'),auth['isAuthenticated'](),controller[_0x36c8('0x21')]);router[_0x36c8('0x1f')](_0x36c8('0x22'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b5e77,_0x161e14,_0x3bd06e){_0x3bd06e(null,path[_0x36c8('0x24')](config['root'],'server/files/images/logos/'));},'filename':function(_0x18a670,_0x3c3399,_0x3cdf8e){_0x3cdf8e(null,util[_0x36c8('0x25')]('%s-%s',Date[_0x36c8('0x26')](),_0x3c3399[_0x36c8('0x27')]));}})});router[_0x36c8('0x1f')](_0x36c8('0x12'),upload[_0x36c8('0x28')](_0x36c8('0x29')),controller[_0x36c8('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb893e9,_0x32dc6f,_0x17a66c){_0x17a66c(null,path[_0x36c8('0x24')](config['root'],_0x36c8('0x2b')));},'filename':function(_0x42d2d7,_0xd71a7d,_0x5eceb7){_0x5eceb7(null,util[_0x36c8('0x25')]('%s-%s',Date[_0x36c8('0x26')](),_0xd71a7d[_0x36c8('0x27')]));}})});router[_0x36c8('0x1f')](_0x36c8('0x2c'),upload[_0x36c8('0x28')]('file'),controller[_0x36c8('0x2d')]);var upload=multer({'storage':multer[_0x36c8('0x2e')]({'destination':function(_0x24f8f4,_0x5ce88a,_0x3cad04){_0x3cad04(null,path['join'](config[_0x36c8('0x2f')],_0x36c8('0x2b')));},'filename':function(_0x363418,_0x21901c,_0x3f882a){_0x3f882a(null,util[_0x36c8('0x25')]('%s-%s',Date[_0x36c8('0x26')](),_0x21901c[_0x36c8('0x27')]));}})});router[_0x36c8('0x1f')](_0x36c8('0x14'),upload[_0x36c8('0x28')](_0x36c8('0x29')),controller[_0x36c8('0x30')]);var upload=multer({'storage':multer[_0x36c8('0x2e')]({'destination':function(_0x165c90,_0x1fb51f,_0x5550c5){_0x5550c5(null,path[_0x36c8('0x24')](config[_0x36c8('0x2f')],_0x36c8('0x2b')));},'filename':function(_0x44ae97,_0x489750,_0xc3eb48){_0xc3eb48(null,util[_0x36c8('0x25')](_0x36c8('0x31'),Date[_0x36c8('0x26')](),_0x489750['originalname']));}})});router[_0x36c8('0x1f')](_0x36c8('0x16'),upload[_0x36c8('0x28')](_0x36c8('0x29')),controller[_0x36c8('0x32')]);router['post']('/:id/notify',controller['notify']);router['post'](_0x36c8('0x33'),controller['offline']);router[_0x36c8('0x1f')](_0x36c8('0x34'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x36c8('0x19'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x35')]);router[_0x36c8('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x36c8('0x36')]);router['post'](_0x36c8('0x37'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x38')]);router[_0x36c8('0x39')](_0x36c8('0xd'),auth['isAuthenticated'](),controller[_0x36c8('0x3a')]);router[_0x36c8('0x3b')](_0x36c8('0xd'),auth['isAuthenticated'](),controller[_0x36c8('0x3c')]);router[_0x36c8('0x3b')](_0x36c8('0xf'),auth[_0x36c8('0xb')](),controller[_0x36c8('0x3d')]);router[_0x36c8('0x3b')]('/:id/canned_answers',auth[_0x36c8('0xb')](),controller[_0x36c8('0x3e')]);router[_0x36c8('0x3b')]('/:id/users',auth[_0x36c8('0xb')](),controller[_0x36c8('0x3f')]);module[_0x36c8('0x40')]=router; \ No newline at end of file +var _0xb36e=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','server/files/images/logos/','addLogo','join','server/files/images/avatars/','format','%s-%s','now','originalname','single','file','addAvatar','root','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','multer','util','path','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getAnswers','/:id/logo','getLogo'];(function(_0x5e030c,_0x231dda){var _0x1767a1=function(_0x12c75b){while(--_0x12c75b){_0x5e030c['push'](_0x5e030c['shift']());}};_0x1767a1(++_0x231dda);}(_0xb36e,0x140));var _0xeb36=function(_0x855f7f,_0x3cb7d5){_0x855f7f=_0x855f7f-0x0;var _0x23acc=_0xb36e[_0x855f7f];return _0x23acc;};'use strict';var multer=require(_0xeb36('0x0'));var util=require(_0xeb36('0x1'));var path=require(_0xeb36('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeb36('0x3'));var config=require(_0xeb36('0x4'));var controller=require('./chatWebsite.controller');router[_0xeb36('0x5')]('/',auth[_0xeb36('0x6')](),controller[_0xeb36('0x7')]);router[_0xeb36('0x5')](_0xeb36('0x8'),auth['isAuthenticated'](),controller[_0xeb36('0x9')]);router[_0xeb36('0x5')]('/:id',auth[_0xeb36('0x6')](),controller[_0xeb36('0xa')]);router[_0xeb36('0x5')](_0xeb36('0xb'),auth[_0xeb36('0x6')](),controller['getDispositions']);router[_0xeb36('0x5')]('/:id/canned_answers',auth[_0xeb36('0x6')](),controller[_0xeb36('0xc')]);router[_0xeb36('0x5')](_0xeb36('0xd'),controller[_0xeb36('0xe')]);router[_0xeb36('0x5')](_0xeb36('0xf'),controller[_0xeb36('0x10')]);router[_0xeb36('0x5')](_0xeb36('0x11'),controller[_0xeb36('0x12')]);router[_0xeb36('0x5')](_0xeb36('0x13'),controller['getSystemAvatar']);router[_0xeb36('0x5')](_0xeb36('0x14'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x15')]);router[_0xeb36('0x5')](_0xeb36('0x16'),controller[_0xeb36('0x17')]);router[_0xeb36('0x5')](_0xeb36('0x18'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x19')]);router['get']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xeb36('0x1a')]);router[_0xeb36('0x5')]('/:id/fields',controller[_0xeb36('0x1b')]);router[_0xeb36('0x5')](_0xeb36('0x1c'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x1d')]);router[_0xeb36('0x5')](_0xeb36('0x1e'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x1f')]);router[_0xeb36('0x20')]('/',auth[_0xeb36('0x6')](),controller['create']);router[_0xeb36('0x20')](_0xeb36('0xb'),auth['isAuthenticated'](),controller[_0xeb36('0x21')]);router[_0xeb36('0x20')](_0xeb36('0x22'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x23')]);var upload=multer({'storage':multer[_0xeb36('0x24')]({'destination':function(_0xa73595,_0x2f7687,_0x529023){_0x529023(null,path['join'](config['root'],_0xeb36('0x25')));},'filename':function(_0x3d70d7,_0x26b708,_0x4c2503){_0x4c2503(null,util['format']('%s-%s',Date['now'](),_0x26b708['originalname']));}})});router[_0xeb36('0x20')](_0xeb36('0xd'),upload['single']('file'),controller[_0xeb36('0x26')]);var upload=multer({'storage':multer[_0xeb36('0x24')]({'destination':function(_0x11072b,_0x4bb24a,_0x49362d){_0x49362d(null,path[_0xeb36('0x27')](config['root'],_0xeb36('0x28')));},'filename':function(_0x5d3715,_0x41e2ee,_0x1e45f6){_0x1e45f6(null,util[_0xeb36('0x29')](_0xeb36('0x2a'),Date[_0xeb36('0x2b')](),_0x41e2ee[_0xeb36('0x2c')]));}})});router[_0xeb36('0x20')](_0xeb36('0xf'),upload[_0xeb36('0x2d')](_0xeb36('0x2e')),controller[_0xeb36('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14e7ea,_0x5a4320,_0x426c53){_0x426c53(null,path[_0xeb36('0x27')](config[_0xeb36('0x30')],'server/files/images/avatars/'));},'filename':function(_0x38a516,_0x917a72,_0x1da280){_0x1da280(null,util[_0xeb36('0x29')](_0xeb36('0x2a'),Date[_0xeb36('0x2b')](),_0x917a72['originalname']));}})});router[_0xeb36('0x20')](_0xeb36('0x11'),upload[_0xeb36('0x2d')](_0xeb36('0x2e')),controller[_0xeb36('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b279f,_0x4ecb19,_0x52152d){_0x52152d(null,path['join'](config['root'],_0xeb36('0x28')));},'filename':function(_0x3fb3ec,_0x2dbe3c,_0x70c420){_0x70c420(null,util['format']('%s-%s',Date[_0xeb36('0x2b')](),_0x2dbe3c[_0xeb36('0x2c')]));}})});router[_0xeb36('0x20')](_0xeb36('0x13'),upload[_0xeb36('0x2d')](_0xeb36('0x2e')),controller[_0xeb36('0x32')]);router[_0xeb36('0x20')](_0xeb36('0x33'),controller[_0xeb36('0x34')]);router[_0xeb36('0x20')](_0xeb36('0x35'),controller[_0xeb36('0x36')]);router[_0xeb36('0x20')](_0xeb36('0x14'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x37')]);router[_0xeb36('0x20')](_0xeb36('0x18'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x38')]);router[_0xeb36('0x20')](_0xeb36('0x39'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x3a')]);router['post'](_0xeb36('0x1e'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x3b')]);router[_0xeb36('0x3c')](_0xeb36('0x3d'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x3e')]);router['delete'](_0xeb36('0x3d'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x3f')]);router[_0xeb36('0x40')](_0xeb36('0xb'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x41')]);router[_0xeb36('0x40')](_0xeb36('0x22'),auth[_0xeb36('0x6')](),controller['removeAnswers']);router['delete'](_0xeb36('0x1e'),auth[_0xeb36('0x6')](),controller[_0xeb36('0x42')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 015938a..cfbf6e8 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d59=['Google','exports','STRING','ENUM','AmazonAWS'];(function(_0xcc2c66,_0x27cf7b){var _0x2197b2=function(_0xacbaeb){while(--_0xacbaeb){_0xcc2c66['push'](_0xcc2c66['shift']());}};_0x2197b2(++_0x27cf7b);}(_0x5d59,0x15f));var _0x95d5=function(_0x4c4d6d,_0x10ac62){_0x4c4d6d=_0x4c4d6d-0x0;var _0x4eacef=_0x5d59[_0x4c4d6d];return _0x4eacef;};'use strict';var Sequelize=require('sequelize');module[_0x95d5('0x0')]={'name':{'type':Sequelize[_0x95d5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x95d5('0x2')](_0x95d5('0x3'),_0x95d5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x95d5('0x1')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcb41=['exports','STRING','ENUM','Google','sequelize'];(function(_0x212a37,_0xf35b2e){var _0x5d0bf9=function(_0x51850f){while(--_0x51850f){_0x212a37['push'](_0x212a37['shift']());}};_0x5d0bf9(++_0xf35b2e);}(_0xcb41,0x1df));var _0x1cb4=function(_0x3ef3c2,_0x2206c1){_0x3ef3c2=_0x3ef3c2-0x0;var _0x47c700=_0xcb41[_0x3ef3c2];return _0x47c700;};'use strict';var Sequelize=require(_0x1cb4('0x0'));module[_0x1cb4('0x1')]={'name':{'type':Sequelize[_0x1cb4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1cb4('0x3')]('AmazonAWS',_0x1cb4('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x1cb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 35e8358..a507dd4 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93d5=['index','map','CloudProvider','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json','count','offset','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send'];(function(_0x2c4f3f,_0x266947){var _0x3d0234=function(_0x31495c){while(--_0x31495c){_0x2c4f3f['push'](_0x2c4f3f['shift']());}};_0x3d0234(++_0x266947);}(_0x93d5,0x192));var _0x593d=function(_0x549baf,_0x8416bf){_0x549baf=_0x549baf-0x0;var _0x2ddc4e=_0x93d5[_0x549baf];return _0x2ddc4e;};'use strict';var pdf=require(_0x593d('0x0'));var emlformat=require(_0x593d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x593d('0x2'));var rp=require(_0x593d('0x3'));var moment=require('moment');var BPromise=require(_0x593d('0x4'));var Mustache=require(_0x593d('0x5'));var util=require('util');var path=require(_0x593d('0x6'));var sox=require(_0x593d('0x7'));var csv=require(_0x593d('0x8'));var ejs=require(_0x593d('0x9'));var fs=require('fs');var _=require(_0x593d('0xa'));var squel=require(_0x593d('0xb'));var crypto=require(_0x593d('0xc'));var jsforce=require(_0x593d('0xd'));var deskjs=require(_0x593d('0xe'));var toCsv=require(_0x593d('0x8'));var querystring=require(_0x593d('0xf'));var Papa=require(_0x593d('0x10'));var Redis=require(_0x593d('0x11'));var authService=require(_0x593d('0x12'));var qs=require(_0x593d('0x13'));var as=require(_0x593d('0x14'));var hardwareService=require(_0x593d('0x15'));var logger=require(_0x593d('0x16'))(_0x593d('0x17'));var utils=require(_0x593d('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48e405,_0x1af943){_0x1af943=_0x1af943||0xcc;return function(_0x1c2120){if(_0x1c2120){return _0x48e405['sendStatus'](_0x1af943);}return _0x48e405[_0x593d('0x19')](_0x1af943)['end']();};}function respondWithResult(_0x4b41c1,_0x3b1c83){_0x3b1c83=_0x3b1c83||0xc8;return function(_0x311c21){if(_0x311c21){return _0x4b41c1[_0x593d('0x19')](_0x3b1c83)[_0x593d('0x1a')](_0x311c21);}};}function respondWithFilteredResult(_0x5be2eb,_0x593e4f){return function(_0x84f83c){if(_0x84f83c){var _0x4372f6=_0x84f83c[_0x593d('0x1b')],_0xdee582=_0x593e4f[_0x593d('0x1c')],_0x6b03f1=_0x593e4f[_0x593d('0x1c')]+_0x593e4f[_0x593d('0x1d')],_0x425fcc;if(_0x6b03f1>=_0x4372f6){_0x6b03f1=_0x4372f6;_0x425fcc=0xc8;}else{_0x425fcc=0xce;}_0x5be2eb[_0x593d('0x19')](_0x425fcc);return _0x5be2eb[_0x593d('0x1e')]('Content-Range',_0xdee582+'-'+_0x6b03f1+'/'+_0x4372f6)['json'](_0x84f83c);}return null;};}function patchUpdates(_0x3aa4bb){return function(_0x5e4ec0){try{jsonpatch[_0x593d('0x1f')](_0x5e4ec0,_0x3aa4bb,!![]);}catch(_0x26d17c){return BPromise['reject'](_0x26d17c);}return _0x5e4ec0[_0x593d('0x20')]();};}function saveUpdates(_0x21935a,_0x53dcb8){return function(_0x1e22a9){if(_0x1e22a9){return _0x1e22a9[_0x593d('0x21')](_0x21935a)[_0x593d('0x22')](function(_0x5c0d49){return _0x5c0d49;});}return null;};}function removeEntity(_0x41bcac,_0x1f290a){return function(_0x189319){if(_0x189319){return _0x189319[_0x593d('0x23')]()[_0x593d('0x22')](function(){_0x41bcac[_0x593d('0x19')](0xcc)[_0x593d('0x24')]();});}};}function handleEntityNotFound(_0x2d1891,_0x1dcae2){return function(_0x61013b){if(!_0x61013b){_0x2d1891[_0x593d('0x25')](0x194);}return _0x61013b;};}function handleError(_0x230db9,_0xbe2e0f){_0xbe2e0f=_0xbe2e0f||0x1f4;return function(_0x30300e){logger[_0x593d('0x26')](_0x30300e[_0x593d('0x27')]);if(_0x30300e[_0x593d('0x28')]){delete _0x30300e[_0x593d('0x28')];}_0x230db9['status'](_0xbe2e0f)[_0x593d('0x29')](_0x30300e);};}exports[_0x593d('0x2a')]=function(_0x15085d,_0x3f2fbf){var _0x44f856={},_0x315936={},_0x265a44={'count':0x0,'rows':[]};var _0x4227aa=_[_0x593d('0x2b')](db[_0x593d('0x2c')][_0x593d('0x2d')],function(_0x1d8597){return{'name':_0x1d8597['fieldName'],'type':_0x1d8597[_0x593d('0x2e')][_0x593d('0x2f')]};});_0x315936[_0x593d('0x30')]=_[_0x593d('0x2b')](_0x4227aa,_0x593d('0x28'));_0x315936[_0x593d('0x31')]=_['keys'](_0x15085d[_0x593d('0x31')]);_0x315936[_0x593d('0x32')]=_[_0x593d('0x33')](_0x315936[_0x593d('0x30')],_0x315936['query']);_0x44f856[_0x593d('0x34')]=_[_0x593d('0x33')](_0x315936[_0x593d('0x30')],qs['fields'](_0x15085d[_0x593d('0x31')][_0x593d('0x35')]));_0x44f856[_0x593d('0x34')]=_0x44f856[_0x593d('0x34')]['length']?_0x44f856[_0x593d('0x34')]:_0x315936[_0x593d('0x30')];if(!_0x15085d[_0x593d('0x31')][_0x593d('0x36')](_0x593d('0x37'))){_0x44f856[_0x593d('0x1d')]=qs['limit'](_0x15085d['query'][_0x593d('0x1d')]);_0x44f856[_0x593d('0x1c')]=qs[_0x593d('0x1c')](_0x15085d['query'][_0x593d('0x1c')]);}_0x44f856[_0x593d('0x38')]=qs[_0x593d('0x39')](_0x15085d[_0x593d('0x31')]['sort']);_0x44f856[_0x593d('0x3a')]=qs[_0x593d('0x32')](_[_0x593d('0x3b')](_0x15085d[_0x593d('0x31')],_0x315936[_0x593d('0x32')]),_0x4227aa);if(_0x15085d[_0x593d('0x31')][_0x593d('0x3c')]){_0x44f856['where']=_[_0x593d('0x3d')](_0x44f856[_0x593d('0x3a')],{'$or':_[_0x593d('0x2b')](_0x4227aa,function(_0x368177){if(_0x368177[_0x593d('0x2e')]!==_0x593d('0x3e')){var _0x1e5214={};_0x1e5214[_0x368177['name']]={'$like':'%'+_0x15085d['query'][_0x593d('0x3c')]+'%'};return _0x1e5214;}})});}_0x44f856=_[_0x593d('0x3d')]({},_0x44f856,_0x15085d[_0x593d('0x3f')]);var _0x28c73e={'where':_0x44f856[_0x593d('0x3a')]};return db[_0x593d('0x2c')]['count'](_0x28c73e)[_0x593d('0x22')](function(_0x4ac0f2){_0x265a44['count']=_0x4ac0f2;if(_0x15085d[_0x593d('0x31')][_0x593d('0x40')]){_0x44f856[_0x593d('0x41')]=[{'all':!![]}];}return db[_0x593d('0x2c')]['findAll'](_0x44f856);})[_0x593d('0x22')](function(_0x1d3620){_0x265a44[_0x593d('0x42')]=_0x1d3620;return _0x265a44;})[_0x593d('0x22')](respondWithFilteredResult(_0x3f2fbf,_0x44f856))[_0x593d('0x43')](handleError(_0x3f2fbf,null));};exports[_0x593d('0x44')]=function(_0x23562f,_0x9c7807){var _0xd42a87={'raw':!![],'where':{'id':_0x23562f[_0x593d('0x45')]['id']}},_0x70185b={};_0x70185b[_0x593d('0x30')]=_[_0x593d('0x46')](db[_0x593d('0x2c')][_0x593d('0x2d')]);_0x70185b[_0x593d('0x31')]=_[_0x593d('0x46')](_0x23562f[_0x593d('0x31')]);_0x70185b['filters']=_[_0x593d('0x33')](_0x70185b[_0x593d('0x30')],_0x70185b[_0x593d('0x31')]);_0xd42a87[_0x593d('0x34')]=_[_0x593d('0x33')](_0x70185b[_0x593d('0x30')],qs['fields'](_0x23562f[_0x593d('0x31')][_0x593d('0x35')]));_0xd42a87[_0x593d('0x34')]=_0xd42a87[_0x593d('0x34')]['length']?_0xd42a87['attributes']:_0x70185b['model'];if(_0x23562f['query'][_0x593d('0x40')]){_0xd42a87['include']=[{'all':!![]}];}_0xd42a87=_[_0x593d('0x3d')]({},_0xd42a87,_0x23562f[_0x593d('0x3f')]);return db[_0x593d('0x2c')][_0x593d('0x47')](_0xd42a87)[_0x593d('0x22')](handleEntityNotFound(_0x9c7807,null))[_0x593d('0x22')](respondWithResult(_0x9c7807,null))['catch'](handleError(_0x9c7807,null));};exports[_0x593d('0x48')]=function(_0x264900,_0x4d43a3){return db[_0x593d('0x2c')][_0x593d('0x48')](_0x264900[_0x593d('0x49')],{})['then'](respondWithResult(_0x4d43a3,0xc9))['catch'](handleError(_0x4d43a3,null));};exports[_0x593d('0x21')]=function(_0x1e678c,_0x40da56){if(_0x1e678c[_0x593d('0x49')]['id']){delete _0x1e678c[_0x593d('0x49')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x1e678c[_0x593d('0x45')]['id']}})['then'](handleEntityNotFound(_0x40da56,null))[_0x593d('0x22')](saveUpdates(_0x1e678c['body'],null))[_0x593d('0x22')](respondWithResult(_0x40da56,null))['catch'](handleError(_0x40da56,null));};exports[_0x593d('0x23')]=function(_0x15d587,_0x44dfe4){return db[_0x593d('0x2c')]['find']({'where':{'id':_0x15d587[_0x593d('0x45')]['id']}})[_0x593d('0x22')](handleEntityNotFound(_0x44dfe4,null))['then'](removeEntity(_0x44dfe4,null))[_0x593d('0x43')](handleError(_0x44dfe4,null));}; \ No newline at end of file +var _0x41a4=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','keys','length','find','create','body','catch','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x5a516a,_0x541200){var _0x38c0d9=function(_0x4d2d8f){while(--_0x4d2d8f){_0x5a516a['push'](_0x5a516a['shift']());}};_0x38c0d9(++_0x541200);}(_0x41a4,0x163));var _0x441a=function(_0x152374,_0x15c2a1){_0x152374=_0x152374-0x0;var _0x5c7f33=_0x41a4[_0x152374];return _0x5c7f33;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x441a('0x0'));var zipdir=require(_0x441a('0x1'));var jsonpatch=require(_0x441a('0x2'));var rp=require(_0x441a('0x3'));var moment=require(_0x441a('0x4'));var BPromise=require(_0x441a('0x5'));var Mustache=require(_0x441a('0x6'));var util=require(_0x441a('0x7'));var path=require(_0x441a('0x8'));var sox=require(_0x441a('0x9'));var csv=require('to-csv');var ejs=require(_0x441a('0xa'));var fs=require('fs');var _=require(_0x441a('0xb'));var squel=require(_0x441a('0xc'));var crypto=require('crypto');var jsforce=require(_0x441a('0xd'));var deskjs=require(_0x441a('0xe'));var toCsv=require(_0x441a('0xf'));var querystring=require(_0x441a('0x10'));var Papa=require(_0x441a('0x11'));var Redis=require(_0x441a('0x12'));var authService=require(_0x441a('0x13'));var qs=require(_0x441a('0x14'));var as=require(_0x441a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x441a('0x16'))(_0x441a('0x17'));var utils=require(_0x441a('0x18'));var config=require(_0x441a('0x19'));var db=require(_0x441a('0x1a'))['db'];function respondWithStatusCode(_0x186520,_0x47aaa4){_0x47aaa4=_0x47aaa4||0xcc;return function(_0x228883){if(_0x228883){return _0x186520[_0x441a('0x1b')](_0x47aaa4);}return _0x186520['status'](_0x47aaa4)[_0x441a('0x1c')]();};}function respondWithResult(_0x461dfc,_0x27d2ab){_0x27d2ab=_0x27d2ab||0xc8;return function(_0x407b27){if(_0x407b27){return _0x461dfc[_0x441a('0x1d')](_0x27d2ab)['json'](_0x407b27);}};}function respondWithFilteredResult(_0x2a0907,_0x37b9e9){return function(_0x545bba){if(_0x545bba){var _0x589f69=_0x545bba[_0x441a('0x1e')],_0x4e33a7=_0x37b9e9[_0x441a('0x1f')],_0x413079=_0x37b9e9[_0x441a('0x1f')]+_0x37b9e9[_0x441a('0x20')],_0x1f90f0;if(_0x413079>=_0x589f69){_0x413079=_0x589f69;_0x1f90f0=0xc8;}else{_0x1f90f0=0xce;}_0x2a0907[_0x441a('0x1d')](_0x1f90f0);return _0x2a0907[_0x441a('0x21')](_0x441a('0x22'),_0x4e33a7+'-'+_0x413079+'/'+_0x589f69)[_0x441a('0x23')](_0x545bba);}return null;};}function patchUpdates(_0x48af97){return function(_0x5986ad){try{jsonpatch[_0x441a('0x24')](_0x5986ad,_0x48af97,!![]);}catch(_0x4c2844){return BPromise['reject'](_0x4c2844);}return _0x5986ad[_0x441a('0x25')]();};}function saveUpdates(_0x58d6c0,_0x4d4277){return function(_0x28c1f4){if(_0x28c1f4){return _0x28c1f4[_0x441a('0x26')](_0x58d6c0)[_0x441a('0x27')](function(_0xe6e63f){return _0xe6e63f;});}return null;};}function removeEntity(_0xecef66,_0x570155){return function(_0x30e3e9){if(_0x30e3e9){return _0x30e3e9['destroy']()[_0x441a('0x27')](function(){_0xecef66[_0x441a('0x1d')](0xcc)[_0x441a('0x1c')]();});}};}function handleEntityNotFound(_0x3a7ae3,_0x49ffd3){return function(_0x58604c){if(!_0x58604c){_0x3a7ae3[_0x441a('0x1b')](0x194);}return _0x58604c;};}function handleError(_0x4e8466,_0x467390){_0x467390=_0x467390||0x1f4;return function(_0x2a3c35){logger['error'](_0x2a3c35[_0x441a('0x28')]);if(_0x2a3c35[_0x441a('0x29')]){delete _0x2a3c35[_0x441a('0x29')];}_0x4e8466[_0x441a('0x1d')](_0x467390)[_0x441a('0x2a')](_0x2a3c35);};}exports[_0x441a('0x2b')]=function(_0x5c0f38,_0x32506d){var _0x364851={},_0x51bf89={},_0x3bf355={'count':0x0,'rows':[]};var _0x4cd46d=_['map'](db[_0x441a('0x2c')][_0x441a('0x2d')],function(_0x502134){return{'name':_0x502134[_0x441a('0x2e')],'type':_0x502134['type']['key']};});_0x51bf89[_0x441a('0x2f')]=_[_0x441a('0x30')](_0x4cd46d,_0x441a('0x29'));_0x51bf89[_0x441a('0x31')]=_['keys'](_0x5c0f38[_0x441a('0x31')]);_0x51bf89[_0x441a('0x32')]=_['intersection'](_0x51bf89[_0x441a('0x2f')],_0x51bf89[_0x441a('0x31')]);_0x364851[_0x441a('0x33')]=_[_0x441a('0x34')](_0x51bf89[_0x441a('0x2f')],qs['fields'](_0x5c0f38[_0x441a('0x31')][_0x441a('0x35')]));_0x364851[_0x441a('0x33')]=_0x364851[_0x441a('0x33')]['length']?_0x364851[_0x441a('0x33')]:_0x51bf89[_0x441a('0x2f')];if(!_0x5c0f38[_0x441a('0x31')][_0x441a('0x36')](_0x441a('0x37'))){_0x364851[_0x441a('0x20')]=qs['limit'](_0x5c0f38[_0x441a('0x31')][_0x441a('0x20')]);_0x364851[_0x441a('0x1f')]=qs['offset'](_0x5c0f38['query'][_0x441a('0x1f')]);}_0x364851['order']=qs['sort'](_0x5c0f38['query'][_0x441a('0x38')]);_0x364851[_0x441a('0x39')]=qs['filters'](_[_0x441a('0x3a')](_0x5c0f38[_0x441a('0x31')],_0x51bf89[_0x441a('0x32')]),_0x4cd46d);if(_0x5c0f38['query'][_0x441a('0x3b')]){_0x364851[_0x441a('0x39')]=_[_0x441a('0x3c')](_0x364851[_0x441a('0x39')],{'$or':_[_0x441a('0x30')](_0x4cd46d,function(_0x3f1068){if(_0x3f1068[_0x441a('0x3d')]!==_0x441a('0x3e')){var _0x5353ce={};_0x5353ce[_0x3f1068[_0x441a('0x29')]]={'$like':'%'+_0x5c0f38[_0x441a('0x31')][_0x441a('0x3b')]+'%'};return _0x5353ce;}})});}_0x364851=_['merge']({},_0x364851,_0x5c0f38['options']);var _0x5d4182={'where':_0x364851[_0x441a('0x39')]};return db[_0x441a('0x2c')][_0x441a('0x1e')](_0x5d4182)[_0x441a('0x27')](function(_0x25de97){_0x3bf355[_0x441a('0x1e')]=_0x25de97;if(_0x5c0f38[_0x441a('0x31')][_0x441a('0x3f')]){_0x364851[_0x441a('0x40')]=[{'all':!![]}];}return db[_0x441a('0x2c')]['findAll'](_0x364851);})[_0x441a('0x27')](function(_0x564f02){_0x3bf355['rows']=_0x564f02;return _0x3bf355;})[_0x441a('0x27')](respondWithFilteredResult(_0x32506d,_0x364851))['catch'](handleError(_0x32506d,null));};exports['show']=function(_0x31ed9d,_0x17b249){var _0xa70639={'raw':!![],'where':{'id':_0x31ed9d['params']['id']}},_0x4491d9={};_0x4491d9[_0x441a('0x2f')]=_[_0x441a('0x41')](db[_0x441a('0x2c')]['rawAttributes']);_0x4491d9[_0x441a('0x31')]=_[_0x441a('0x41')](_0x31ed9d[_0x441a('0x31')]);_0x4491d9[_0x441a('0x32')]=_[_0x441a('0x34')](_0x4491d9[_0x441a('0x2f')],_0x4491d9['query']);_0xa70639['attributes']=_[_0x441a('0x34')](_0x4491d9[_0x441a('0x2f')],qs['fields'](_0x31ed9d['query']['fields']));_0xa70639[_0x441a('0x33')]=_0xa70639[_0x441a('0x33')][_0x441a('0x42')]?_0xa70639[_0x441a('0x33')]:_0x4491d9['model'];if(_0x31ed9d[_0x441a('0x31')][_0x441a('0x3f')]){_0xa70639['include']=[{'all':!![]}];}_0xa70639=_[_0x441a('0x3c')]({},_0xa70639,_0x31ed9d['options']);return db[_0x441a('0x2c')][_0x441a('0x43')](_0xa70639)[_0x441a('0x27')](handleEntityNotFound(_0x17b249,null))[_0x441a('0x27')](respondWithResult(_0x17b249,null))['catch'](handleError(_0x17b249,null));};exports['create']=function(_0x516ec2,_0x31b73c){return db[_0x441a('0x2c')][_0x441a('0x44')](_0x516ec2[_0x441a('0x45')],{})[_0x441a('0x27')](respondWithResult(_0x31b73c,0xc9))[_0x441a('0x46')](handleError(_0x31b73c,null));};exports['update']=function(_0x3ab386,_0x41dea6){if(_0x3ab386[_0x441a('0x45')]['id']){delete _0x3ab386['body']['id'];}return db[_0x441a('0x2c')][_0x441a('0x43')]({'where':{'id':_0x3ab386[_0x441a('0x47')]['id']}})[_0x441a('0x27')](handleEntityNotFound(_0x41dea6,null))[_0x441a('0x27')](saveUpdates(_0x3ab386[_0x441a('0x45')],null))[_0x441a('0x27')](respondWithResult(_0x41dea6,null))[_0x441a('0x46')](handleError(_0x41dea6,null));};exports[_0x441a('0x48')]=function(_0x149dab,_0x26e4d1){return db[_0x441a('0x2c')][_0x441a('0x43')]({'where':{'id':_0x149dab[_0x441a('0x47')]['id']}})['then'](handleEntityNotFound(_0x26e4d1,null))['then'](removeEntity(_0x26e4d1,null))[_0x441a('0x46')](handleError(_0x26e4d1,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 759e466..af0bc2d 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x987d=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x29551d,_0x5c8430){var _0x7e358e=function(_0x150337){while(--_0x150337){_0x29551d['push'](_0x29551d['shift']());}};_0x7e358e(++_0x5c8430);}(_0x987d,0x144));var _0xd987=function(_0x15d6e6,_0x36039e){_0x15d6e6=_0x15d6e6-0x0;var _0x4fb1a7=_0x987d[_0x15d6e6];return _0x4fb1a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd987('0x0'))(_0xd987('0x1'));var moment=require(_0xd987('0x2'));var BPromise=require('bluebird');var rp=require(_0xd987('0x3'));var fs=require('fs');var path=require(_0xd987('0x4'));var rimraf=require(_0xd987('0x5'));var config=require(_0xd987('0x6'));var attributes=require(_0xd987('0x7'));module[_0xd987('0x8')]=function(_0x35497e,_0x52a3f9){return _0x35497e[_0xd987('0x9')](_0xd987('0xa'),attributes,{'tableName':_0xd987('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb358=['request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','moment','bluebird'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xb358,0x194));var _0x8b35=function(_0xbfd058,_0x1ee59){_0xbfd058=_0xbfd058-0x0;var _0x568cb1=_0xb358[_0xbfd058];return _0x568cb1;};'use strict';var _=require(_0x8b35('0x0'));var util=require('util');var logger=require(_0x8b35('0x1'))('api');var moment=require(_0x8b35('0x2'));var BPromise=require(_0x8b35('0x3'));var rp=require(_0x8b35('0x4'));var fs=require('fs');var path=require(_0x8b35('0x5'));var rimraf=require(_0x8b35('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b35('0x7'));module[_0x8b35('0x8')]=function(_0x21641b,_0x2dbd2a){return _0x21641b[_0x8b35('0x9')](_0x8b35('0xa'),attributes,{'tableName':_0x8b35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 8694cfb..cdd0804 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff35=['request','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1ace67,_0xf592f7){var _0x4dcaea=function(_0x206564){while(--_0x206564){_0x1ace67['push'](_0x1ace67['shift']());}};_0x4dcaea(++_0xf592f7);}(_0xff35,0xcb));var _0x5ff3=function(_0x351ce5,_0x150077){_0x351ce5=_0x351ce5-0x0;var _0x260035=_0xff35[_0x351ce5];return _0x260035;};'use strict';var _=require(_0x5ff3('0x0'));var util=require(_0x5ff3('0x1'));var moment=require(_0x5ff3('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ff3('0x3'));var fs=require('fs');var Redis=require(_0x5ff3('0x4'));var db=require(_0x5ff3('0x5'))['db'];var utils=require(_0x5ff3('0x6'));var logger=require(_0x5ff3('0x7'))(_0x5ff3('0x8'));var config=require(_0x5ff3('0x9'));var jayson=require(_0x5ff3('0xa'));var client=jayson[_0x5ff3('0xb')][_0x5ff3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x432650,_0x4b3ad3,_0x230746){return new BPromise(function(_0x4cf2b0,_0x525cb8){return client[_0x5ff3('0xd')](_0x432650,_0x230746)['then'](function(_0x52c3b4){logger[_0x5ff3('0xe')](_0x5ff3('0xf'),_0x4b3ad3,'request\x20sent');logger['debug'](_0x5ff3('0x10'),_0x4b3ad3,_0x5ff3('0x11'),JSON[_0x5ff3('0x12')](_0x52c3b4));if(_0x52c3b4[_0x5ff3('0x13')]){if(_0x52c3b4[_0x5ff3('0x13')][_0x5ff3('0x14')]===0x1f4){logger[_0x5ff3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4b3ad3,_0x52c3b4[_0x5ff3('0x13')][_0x5ff3('0x15')]);return _0x525cb8(_0x52c3b4[_0x5ff3('0x13')]['message']);}logger[_0x5ff3('0x13')](_0x5ff3('0xf'),_0x4b3ad3,_0x52c3b4['error']['message']);return _0x4cf2b0(_0x52c3b4['error'][_0x5ff3('0x15')]);}else{logger[_0x5ff3('0xe')](_0x5ff3('0xf'),_0x4b3ad3,'request\x20sent');_0x4cf2b0(_0x52c3b4[_0x5ff3('0x16')]['message']);}})[_0x5ff3('0x17')](function(_0x2ccde0){logger[_0x5ff3('0x13')](_0x5ff3('0xf'),_0x4b3ad3,_0x2ccde0);_0x525cb8(_0x2ccde0);});});} \ No newline at end of file +var _0x7e8a=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0xfa8bcc,_0x1f1fd4){var _0x55cbe7=function(_0x1b57b3){while(--_0x1b57b3){_0xfa8bcc['push'](_0xfa8bcc['shift']());}};_0x55cbe7(++_0x1f1fd4);}(_0x7e8a,0xeb));var _0xa7e8=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7e8a[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xa7e8('0x0'));var util=require(_0xa7e8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa7e8('0x2'));var fs=require('fs');var Redis=require(_0xa7e8('0x3'));var db=require(_0xa7e8('0x4'))['db'];var utils=require(_0xa7e8('0x5'));var logger=require(_0xa7e8('0x6'))('rpc');var config=require(_0xa7e8('0x7'));var jayson=require(_0xa7e8('0x8'));var client=jayson[_0xa7e8('0x9')][_0xa7e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c0a3,_0x46afe3,_0x14916e){return new BPromise(function(_0x1283e1,_0x11d4c4){return client[_0xa7e8('0xb')](_0x29c0a3,_0x14916e)['then'](function(_0x27d029){logger[_0xa7e8('0xc')](_0xa7e8('0xd'),_0x46afe3,_0xa7e8('0xe'));logger[_0xa7e8('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x46afe3,'request\x20sent',JSON['stringify'](_0x27d029));if(_0x27d029[_0xa7e8('0x10')]){if(_0x27d029[_0xa7e8('0x10')][_0xa7e8('0x11')]===0x1f4){logger[_0xa7e8('0x10')](_0xa7e8('0xd'),_0x46afe3,_0x27d029[_0xa7e8('0x10')][_0xa7e8('0x12')]);return _0x11d4c4(_0x27d029[_0xa7e8('0x10')]['message']);}logger[_0xa7e8('0x10')]('CloudProvider,\x20%s,\x20%s',_0x46afe3,_0x27d029['error'][_0xa7e8('0x12')]);return _0x1283e1(_0x27d029[_0xa7e8('0x10')][_0xa7e8('0x12')]);}else{logger[_0xa7e8('0xc')](_0xa7e8('0xd'),_0x46afe3,'request\x20sent');_0x1283e1(_0x27d029['result'][_0xa7e8('0x12')]);}})[_0xa7e8('0x13')](function(_0xd0a2d4){logger[_0xa7e8('0x10')](_0xa7e8('0xd'),_0x46afe3,_0xd0a2d4);_0x11d4c4(_0xd0a2d4);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 560380f..f8c6850 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25e4=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','create','put'];(function(_0x10db36,_0x1d0aca){var _0x24357c=function(_0x192b20){while(--_0x192b20){_0x10db36['push'](_0x10db36['shift']());}};_0x24357c(++_0x1d0aca);}(_0x25e4,0x112));var _0x425e=function(_0x4cd71b,_0x4835a0){_0x4cd71b=_0x4cd71b-0x0;var _0x2245e4=_0x25e4[_0x4cd71b];return _0x2245e4;};'use strict';var multer=require(_0x425e('0x0'));var util=require('util');var path=require(_0x425e('0x1'));var timeout=require(_0x425e('0x2'));var express=require(_0x425e('0x3'));var router=express[_0x425e('0x4')]();var auth=require(_0x425e('0x5'));var interaction=require(_0x425e('0x6'));var config=require(_0x425e('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x425e('0x8')]);router['get'](_0x425e('0x9'),auth[_0x425e('0xa')](),controller[_0x425e('0xb')]);router['post']('/',auth[_0x425e('0xa')](),controller[_0x425e('0xc')]);router[_0x425e('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x425e('0xe')]);router[_0x425e('0xf')]('/:id',auth[_0x425e('0xa')](),controller[_0x425e('0x10')]);module[_0x425e('0x11')]=router; \ No newline at end of file +var _0xcc42=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0xcc42,0x16a));var _0x2cc4=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0xcc42[_0x527824];return _0xc8b8ed;};'use strict';var multer=require(_0x2cc4('0x0'));var util=require(_0x2cc4('0x1'));var path=require(_0x2cc4('0x2'));var timeout=require(_0x2cc4('0x3'));var express=require(_0x2cc4('0x4'));var router=express[_0x2cc4('0x5')]();var auth=require(_0x2cc4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cc4('0x7'));var controller=require('./cloudProvider.controller');router[_0x2cc4('0x8')]('/',auth[_0x2cc4('0x9')](),controller[_0x2cc4('0xa')]);router[_0x2cc4('0x8')]('/:id',auth[_0x2cc4('0x9')](),controller[_0x2cc4('0xb')]);router[_0x2cc4('0xc')]('/',auth[_0x2cc4('0x9')](),controller[_0x2cc4('0xd')]);router[_0x2cc4('0xe')](_0x2cc4('0xf'),auth[_0x2cc4('0x9')](),controller[_0x2cc4('0x10')]);router[_0x2cc4('0x11')](_0x2cc4('0xf'),auth[_0x2cc4('0x9')](),controller['destroy']);module[_0x2cc4('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index c90a5e1..4bd83e5 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 _0x220d=['STRING','exports'];(function(_0x349b00,_0x5b58c3){var _0x45744f=function(_0x3caf27){while(--_0x3caf27){_0x349b00['push'](_0x349b00['shift']());}};_0x45744f(++_0x5b58c3);}(_0x220d,0x18b));var _0xd220=function(_0x599b22,_0x34d0b4){_0x599b22=_0x599b22-0x0;var _0x3e0e1a=_0x220d[_0x599b22];return _0x3e0e1a;};'use strict';var Sequelize=require('sequelize');module[_0xd220('0x0')]={'name':{'type':Sequelize[_0xd220('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xd220('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd220('0x1')]},'fax':{'type':Sequelize[_0xd220('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd220('0x1')]},'postalCode':{'type':Sequelize[_0xd220('0x1')]},'city':{'type':Sequelize[_0xd220('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd220('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd220('0x1')]},'sStreet':{'type':Sequelize[_0xd220('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xd220('0x1')]},'sCountry':{'type':Sequelize[_0xd220('0x1')]},'description':{'type':Sequelize[_0xd220('0x1')]}}; \ No newline at end of file +var _0xca8b=['sequelize','exports','STRING','name'];(function(_0xa94ac1,_0x48a13c){var _0xd9cfde=function(_0x529a98){while(--_0x529a98){_0xa94ac1['push'](_0xa94ac1['shift']());}};_0xd9cfde(++_0x48a13c);}(_0xca8b,0x150));var _0xbca8=function(_0x5289c5,_0x58e2a3){_0x5289c5=_0x5289c5-0x0;var _0x53d7bc=_0xca8b[_0x5289c5];return _0x53d7bc;};'use strict';var Sequelize=require(_0xbca8('0x0'));module[_0xbca8('0x1')]={'name':{'type':Sequelize[_0xbca8('0x2')],'unique':_0xbca8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbca8('0x2')]},'companyId':{'type':Sequelize[_0xbca8('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbca8('0x2')]},'type':{'type':Sequelize[_0xbca8('0x2')]},'street':{'type':Sequelize[_0xbca8('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xbca8('0x2')]},'country':{'type':Sequelize[_0xbca8('0x2')]},'email':{'type':Sequelize[_0xbca8('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbca8('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xbca8('0x2')]},'sCountry':{'type':Sequelize[_0xbca8('0x2')]},'description':{'type':Sequelize[_0xbca8('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index ba976a4..0b99f50 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 _0xcdba=['fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','order','map','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','findAll','catch','show','params','rawAttributes'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0xcdba,0x69));var _0xacdb=function(_0x48e750,_0x2125d4){_0x48e750=_0x48e750-0x0;var _0x17f085=_0xcdba[_0x48e750];return _0x17f085;};'use strict';var pdf=require(_0xacdb('0x0'));var emlformat=require(_0xacdb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xacdb('0x2'));var jsonpatch=require(_0xacdb('0x3'));var rp=require(_0xacdb('0x4'));var moment=require(_0xacdb('0x5'));var BPromise=require(_0xacdb('0x6'));var Mustache=require('mustache');var util=require(_0xacdb('0x7'));var path=require(_0xacdb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xacdb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xacdb('0xa'));var crypto=require(_0xacdb('0xb'));var jsforce=require(_0xacdb('0xc'));var deskjs=require(_0xacdb('0xd'));var toCsv=require(_0xacdb('0xe'));var querystring=require(_0xacdb('0xf'));var Papa=require('papaparse');var Redis=require(_0xacdb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xacdb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacdb('0x12'));var logger=require(_0xacdb('0x13'))(_0xacdb('0x14'));var utils=require(_0xacdb('0x15'));var config=require(_0xacdb('0x16'));var db=require(_0xacdb('0x17'))['db'];function respondWithStatusCode(_0x46b521,_0xfb7c5a){_0xfb7c5a=_0xfb7c5a||0xcc;return function(_0x5247b0){if(_0x5247b0){return _0x46b521[_0xacdb('0x18')](_0xfb7c5a);}return _0x46b521[_0xacdb('0x19')](_0xfb7c5a)[_0xacdb('0x1a')]();};}function respondWithResult(_0x3fad7b,_0x322618){_0x322618=_0x322618||0xc8;return function(_0x28cded){if(_0x28cded){return _0x3fad7b[_0xacdb('0x19')](_0x322618)[_0xacdb('0x1b')](_0x28cded);}};}function respondWithFilteredResult(_0x39c3cd,_0x114508){return function(_0x2ccf15){if(_0x2ccf15){var _0x3cc8df=_0x2ccf15[_0xacdb('0x1c')],_0x3397bc=_0x114508[_0xacdb('0x1d')],_0x1ff0a6=_0x114508[_0xacdb('0x1d')]+_0x114508[_0xacdb('0x1e')],_0x576ec4;if(_0x1ff0a6>=_0x3cc8df){_0x1ff0a6=_0x3cc8df;_0x576ec4=0xc8;}else{_0x576ec4=0xce;}_0x39c3cd['status'](_0x576ec4);return _0x39c3cd[_0xacdb('0x1f')]('Content-Range',_0x3397bc+'-'+_0x1ff0a6+'/'+_0x3cc8df)['json'](_0x2ccf15);}return null;};}function patchUpdates(_0x192afd){return function(_0x12f658){try{jsonpatch[_0xacdb('0x20')](_0x12f658,_0x192afd,!![]);}catch(_0x385fb){return BPromise['reject'](_0x385fb);}return _0x12f658[_0xacdb('0x21')]();};}function saveUpdates(_0x20b172,_0xf7b82d){return function(_0x2145a5){if(_0x2145a5){return _0x2145a5[_0xacdb('0x22')](_0x20b172)[_0xacdb('0x23')](function(_0x4a7364){return _0x4a7364;});}return null;};}function removeEntity(_0x5e9f30,_0x223d05){return function(_0x1d0584){if(_0x1d0584){return _0x1d0584[_0xacdb('0x24')]()[_0xacdb('0x23')](function(){var _0x354299=_0x1d0584[_0xacdb('0x25')]({'plain':!![]});var _0x89e45a=_0xacdb('0x26');return db[_0xacdb('0x27')][_0xacdb('0x24')]({'where':{'type':_0x89e45a,'resourceId':_0x354299['id']}})['then'](function(){return _0x1d0584;});})['then'](function(){_0x5e9f30[_0xacdb('0x19')](0xcc)[_0xacdb('0x1a')]();});}};}function handleEntityNotFound(_0x58a32a,_0x46a0d8){return function(_0x272ee1){if(!_0x272ee1){_0x58a32a[_0xacdb('0x18')](0x194);}return _0x272ee1;};}function handleError(_0x2901d7,_0xbbfc8e){_0xbbfc8e=_0xbbfc8e||0x1f4;return function(_0x2dba9d){logger[_0xacdb('0x28')](_0x2dba9d[_0xacdb('0x29')]);if(_0x2dba9d['name']){delete _0x2dba9d[_0xacdb('0x2a')];}_0x2901d7[_0xacdb('0x19')](_0xbbfc8e)[_0xacdb('0x2b')](_0x2dba9d);};}exports[_0xacdb('0x2c')]=function(_0x33cceb,_0x5bdf91){var _0x5d454c={},_0x39ad53={},_0x468cd7={'count':0x0,'rows':[]};return db[_0xacdb('0x2d')][_0xacdb('0x2e')]()[_0xacdb('0x23')](function(_0x1c9d31){_0x39ad53[_0xacdb('0x2f')]=_['keys'](_0x1c9d31);_0x39ad53[_0xacdb('0x30')]=_[_0xacdb('0x31')](_0x33cceb[_0xacdb('0x30')]);_0x39ad53[_0xacdb('0x32')]=_[_0xacdb('0x33')](_0x39ad53[_0xacdb('0x2f')],_0x39ad53['query']);_0x5d454c[_0xacdb('0x34')]=_[_0xacdb('0x33')](_0x39ad53[_0xacdb('0x2f')],qs['fields'](_0x33cceb['query']['fields']));_0x5d454c[_0xacdb('0x34')]=_0x5d454c[_0xacdb('0x34')][_0xacdb('0x35')]?_0x5d454c[_0xacdb('0x34')]:_0x39ad53[_0xacdb('0x2f')];if(!_0x33cceb[_0xacdb('0x30')][_0xacdb('0x36')](_0xacdb('0x37'))){_0x5d454c[_0xacdb('0x1e')]=qs[_0xacdb('0x1e')](_0x33cceb[_0xacdb('0x30')][_0xacdb('0x1e')]);_0x5d454c[_0xacdb('0x1d')]=qs['offset'](_0x33cceb[_0xacdb('0x30')][_0xacdb('0x1d')]);}_0x5d454c['order']=qs[_0xacdb('0x38')](_0x33cceb[_0xacdb('0x30')][_0xacdb('0x38')]);_0x5d454c['where']=qs[_0xacdb('0x32')](_[_0xacdb('0x39')](_0x33cceb[_0xacdb('0x30')],_0x39ad53[_0xacdb('0x32')]),_0x1c9d31);if(_0x33cceb[_0xacdb('0x30')][_0xacdb('0x3a')]){_0x5d454c['where']=_[_0xacdb('0x3b')](_0x5d454c[_0xacdb('0x3c')],{'$or':_['map'](_0x5d454c['attributes'],function(_0x3914a3){var _0x451d07={};_0x451d07[_0x3914a3]={'$like':'%'+_0x33cceb[_0xacdb('0x30')][_0xacdb('0x3a')]+'%'};return _0x451d07;})});}_0x5d454c=_[_0xacdb('0x3b')]({},_0x5d454c,_0x33cceb[_0xacdb('0x3d')]);var _0xd50646={'where':_0x5d454c[_0xacdb('0x3c')]};return db[_0xacdb('0x2d')][_0xacdb('0x1c')](_0xd50646)[_0xacdb('0x23')](function(_0x286b8f){_0x468cd7['count']=_0x286b8f;if(_0x33cceb['query']['includeAll']){_0x5d454c['include']=[{'all':!![]}];}return db[_0xacdb('0x2d')][_0xacdb('0x3e')](_0x5d454c);})[_0xacdb('0x23')](function(_0x154608){_0x468cd7['rows']=_0x154608;return _0x468cd7;})[_0xacdb('0x23')](respondWithFilteredResult(_0x5bdf91,_0x5d454c))[_0xacdb('0x3f')](handleError(_0x5bdf91,null));})[_0xacdb('0x3f')](handleError(_0x5bdf91,null));};exports[_0xacdb('0x40')]=function(_0x2cb9c5,_0x237241){var _0xbeae59={'raw':![],'where':{'id':_0x2cb9c5[_0xacdb('0x41')]['id']}},_0x7839bd={};_0x7839bd['model']=_[_0xacdb('0x31')](db[_0xacdb('0x2d')][_0xacdb('0x42')]);_0x7839bd['query']=_[_0xacdb('0x31')](_0x2cb9c5['query']);_0x7839bd[_0xacdb('0x32')]=_[_0xacdb('0x33')](_0x7839bd[_0xacdb('0x2f')],_0x7839bd[_0xacdb('0x30')]);_0xbeae59[_0xacdb('0x34')]=_['intersection'](_0x7839bd[_0xacdb('0x2f')],qs[_0xacdb('0x43')](_0x2cb9c5['query']['fields']));_0xbeae59[_0xacdb('0x34')]=_0xbeae59[_0xacdb('0x34')][_0xacdb('0x35')]?_0xbeae59[_0xacdb('0x34')]:_0x7839bd[_0xacdb('0x2f')];if(_0x2cb9c5[_0xacdb('0x30')]['includeAll']){_0xbeae59['include']=[{'all':!![]}];}_0xbeae59=_[_0xacdb('0x3b')]({},_0xbeae59,_0x2cb9c5[_0xacdb('0x3d')]);return db[_0xacdb('0x2d')][_0xacdb('0x44')](_0xbeae59)[_0xacdb('0x23')](handleEntityNotFound(_0x237241,null))[_0xacdb('0x23')](respondWithResult(_0x237241,null))[_0xacdb('0x3f')](handleError(_0x237241,null));};exports[_0xacdb('0x45')]=function(_0x3d3e44,_0x586225){return db[_0xacdb('0x2d')]['create'](_0x3d3e44[_0xacdb('0x46')],{})[_0xacdb('0x23')](function(_0x26a579){var _0x44ac81=_0x3d3e44[_0xacdb('0x47')][_0xacdb('0x25')]({'plain':!![]});if(!_0x44ac81)throw new Error(_0xacdb('0x48'));if(_0x44ac81[_0xacdb('0x49')]===_0xacdb('0x47')){var _0x110ef1=_0x26a579[_0xacdb('0x25')]({'plain':!![]});var _0x5add10=_0xacdb('0x26');return db[_0xacdb('0x4a')][_0xacdb('0x44')]({'where':{'name':_0x5add10,'userProfileId':_0x44ac81[_0xacdb('0x4b')]},'raw':!![]})['then'](function(_0x2b07cb){if(_0x2b07cb&&_0x2b07cb[_0xacdb('0x4c')]===0x0){return db[_0xacdb('0x27')][_0xacdb('0x45')]({'name':_0x110ef1[_0xacdb('0x2a')],'resourceId':_0x110ef1['id'],'type':_0x2b07cb[_0xacdb('0x2a')],'sectionId':_0x2b07cb['id']},{})[_0xacdb('0x23')](function(){return _0x26a579;});}else{return _0x26a579;}})['catch'](function(_0x365d9d){logger[_0xacdb('0x28')](_0xacdb('0x4d'),_0x365d9d);throw _0x365d9d;});}return _0x26a579;})[_0xacdb('0x23')](respondWithResult(_0x586225,0xc9))[_0xacdb('0x3f')](handleError(_0x586225,null));};exports[_0xacdb('0x22')]=function(_0x49f5e7,_0x3e2e7c){if(_0x49f5e7[_0xacdb('0x46')]['id']){delete _0x49f5e7[_0xacdb('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x49f5e7[_0xacdb('0x41')]['id']}})[_0xacdb('0x23')](handleEntityNotFound(_0x3e2e7c,null))[_0xacdb('0x23')](saveUpdates(_0x49f5e7[_0xacdb('0x46')],null))[_0xacdb('0x23')](respondWithResult(_0x3e2e7c,null))['catch'](handleError(_0x3e2e7c,null));};exports['destroy']=function(_0x5325a5,_0x15ee08){return db[_0xacdb('0x2d')][_0xacdb('0x44')]({'where':{'id':_0x5325a5[_0xacdb('0x41')]['id']}})[_0xacdb('0x23')](handleEntityNotFound(_0x15ee08,null))[_0xacdb('0x23')](removeEntity(_0x15ee08,null))['catch'](handleError(_0x15ee08,null));};exports[_0xacdb('0x2e')]=function(_0x2266b7,_0x1b886d){return db[_0xacdb('0x2d')]['describe']()[_0xacdb('0x23')](respondWithResult(_0x1b886d,null))['catch'](handleError(_0x1b886d,null));};exports[_0xacdb('0x4e')]=function(_0x903f64,_0x31157c,_0x4804a3){return db[_0xacdb('0x4f')][_0xacdb('0x44')]({'where':{'id':_0x903f64['params']['id']}})[_0xacdb('0x23')](handleEntityNotFound(_0x31157c,null))[_0xacdb('0x23')](function(_0xc8d0ac){if(_0xc8d0ac){return _0xc8d0ac[_0xacdb('0x4e')](_0x903f64[_0xacdb('0x46')][_0xacdb('0x50')],_[_0xacdb('0x51')](_0x903f64['body'],[_0xacdb('0x50'),'id'])||{});}})['then'](respondWithResult(_0x31157c,null))[_0xacdb('0x3f')](handleError(_0x31157c,null));};exports[_0xacdb('0x52')]=function(_0xd67d39,_0x165e53,_0x4ae1e4){var _0xab9341={};var _0x9442c={};var _0x5f24a2;var _0x5a48da;return db[_0xacdb('0x2d')][_0xacdb('0x53')]({'where':{'id':_0xd67d39[_0xacdb('0x41')]['id']}})[_0xacdb('0x23')](handleEntityNotFound(_0x165e53,null))[_0xacdb('0x23')](function(_0x26d07a){if(_0x26d07a){_0x5f24a2=_0x26d07a;_0x9442c[_0xacdb('0x2f')]=_['keys'](db[_0xacdb('0x4f')]['rawAttributes']);_0x9442c[_0xacdb('0x30')]=_[_0xacdb('0x31')](_0xd67d39['query']);_0x9442c[_0xacdb('0x32')]=_[_0xacdb('0x33')](_0x9442c[_0xacdb('0x2f')],_0x9442c[_0xacdb('0x30')]);_0xab9341[_0xacdb('0x34')]=_['intersection'](_0x9442c[_0xacdb('0x2f')],qs[_0xacdb('0x43')](_0xd67d39[_0xacdb('0x30')][_0xacdb('0x43')]));_0xab9341[_0xacdb('0x34')]=_0xab9341[_0xacdb('0x34')][_0xacdb('0x35')]?_0xab9341[_0xacdb('0x34')]:_0x9442c[_0xacdb('0x2f')];_0xab9341[_0xacdb('0x54')]=qs[_0xacdb('0x38')](_0xd67d39[_0xacdb('0x30')][_0xacdb('0x38')]);_0xab9341[_0xacdb('0x3c')]=qs[_0xacdb('0x32')](_[_0xacdb('0x39')](_0xd67d39[_0xacdb('0x30')],_0x9442c['filters']));if(_0xd67d39['query']['filter']){_0xab9341['where']=_[_0xacdb('0x3b')](_0xab9341[_0xacdb('0x3c')],{'$or':_[_0xacdb('0x55')](_0xab9341[_0xacdb('0x34')],function(_0x702e7f){var _0x62accd={};_0x62accd[_0x702e7f]={'$like':'%'+_0xd67d39[_0xacdb('0x30')][_0xacdb('0x3a')]+'%'};return _0x62accd;})});}_0xab9341=_[_0xacdb('0x3b')]({},_0xab9341,_0xd67d39[_0xacdb('0x3d')]);return _0x5f24a2['getContacts'](_0xab9341);}})[_0xacdb('0x23')](function(_0x46bbfb){if(_0x46bbfb){_0x5a48da=_0x46bbfb[_0xacdb('0x35')];if(!_0xd67d39['query']['hasOwnProperty'](_0xacdb('0x37'))){_0xab9341[_0xacdb('0x1e')]=qs['limit'](_0xd67d39[_0xacdb('0x30')][_0xacdb('0x1e')]);_0xab9341[_0xacdb('0x1d')]=qs['offset'](_0xd67d39['query'][_0xacdb('0x1d')]);}return _0x5f24a2[_0xacdb('0x52')](_0xab9341);}})[_0xacdb('0x23')](function(_0x350b4a){if(_0x350b4a){return _0x350b4a?{'count':_0x5a48da,'rows':_0x350b4a}:null;}})[_0xacdb('0x23')](respondWithResult(_0x165e53,null))[_0xacdb('0x3f')](handleError(_0x165e53,null));}; \ No newline at end of file +var _0x6110=['where','pick','filter','merge','map','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','addContacts','CmContact','ids','findOne','getContacts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x6110,0x75));var _0x0611=function(_0x5c6c8a,_0x16e6a0){_0x5c6c8a=_0x5c6c8a-0x0;var _0x9926e0=_0x6110[_0x5c6c8a];return _0x9926e0;};'use strict';var pdf=require(_0x0611('0x0'));var emlformat=require(_0x0611('0x1'));var rimraf=require(_0x0611('0x2'));var zipdir=require(_0x0611('0x3'));var jsonpatch=require(_0x0611('0x4'));var rp=require(_0x0611('0x5'));var moment=require(_0x0611('0x6'));var BPromise=require(_0x0611('0x7'));var Mustache=require(_0x0611('0x8'));var util=require(_0x0611('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x0611('0xa'));var ejs=require(_0x0611('0xb'));var fs=require('fs');var _=require(_0x0611('0xc'));var squel=require(_0x0611('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0611('0xa'));var querystring=require(_0x0611('0xe'));var Papa=require(_0x0611('0xf'));var Redis=require(_0x0611('0x10'));var authService=require(_0x0611('0x11'));var qs=require(_0x0611('0x12'));var as=require(_0x0611('0x13'));var hardwareService=require(_0x0611('0x14'));var logger=require(_0x0611('0x15'))(_0x0611('0x16'));var utils=require(_0x0611('0x17'));var config=require(_0x0611('0x18'));var db=require(_0x0611('0x19'))['db'];function respondWithStatusCode(_0x57e88a,_0x378e37){_0x378e37=_0x378e37||0xcc;return function(_0x40299b){if(_0x40299b){return _0x57e88a[_0x0611('0x1a')](_0x378e37);}return _0x57e88a[_0x0611('0x1b')](_0x378e37)[_0x0611('0x1c')]();};}function respondWithResult(_0x5a7d17,_0x34a0e5){_0x34a0e5=_0x34a0e5||0xc8;return function(_0xc669de){if(_0xc669de){return _0x5a7d17[_0x0611('0x1b')](_0x34a0e5)['json'](_0xc669de);}};}function respondWithFilteredResult(_0x269b35,_0x56a54f){return function(_0x2f9518){if(_0x2f9518){var _0x5372ff=_0x2f9518[_0x0611('0x1d')],_0x5e40f7=_0x56a54f['offset'],_0x33412f=_0x56a54f[_0x0611('0x1e')]+_0x56a54f['limit'],_0x7c27b4;if(_0x33412f>=_0x5372ff){_0x33412f=_0x5372ff;_0x7c27b4=0xc8;}else{_0x7c27b4=0xce;}_0x269b35[_0x0611('0x1b')](_0x7c27b4);return _0x269b35[_0x0611('0x1f')](_0x0611('0x20'),_0x5e40f7+'-'+_0x33412f+'/'+_0x5372ff)[_0x0611('0x21')](_0x2f9518);}return null;};}function patchUpdates(_0x4f605c){return function(_0x33c051){try{jsonpatch[_0x0611('0x22')](_0x33c051,_0x4f605c,!![]);}catch(_0x266027){return BPromise['reject'](_0x266027);}return _0x33c051[_0x0611('0x23')]();};}function saveUpdates(_0x24f20c,_0x125373){return function(_0xa97384){if(_0xa97384){return _0xa97384[_0x0611('0x24')](_0x24f20c)[_0x0611('0x25')](function(_0x3854c1){return _0x3854c1;});}return null;};}function removeEntity(_0x302edc,_0x426ce3){return function(_0x218036){if(_0x218036){return _0x218036[_0x0611('0x26')]()[_0x0611('0x25')](function(){var _0x5d9949=_0x218036[_0x0611('0x27')]({'plain':!![]});var _0x1200eb=_0x0611('0x28');return db['UserProfileResource'][_0x0611('0x26')]({'where':{'type':_0x1200eb,'resourceId':_0x5d9949['id']}})[_0x0611('0x25')](function(){return _0x218036;});})[_0x0611('0x25')](function(){_0x302edc[_0x0611('0x1b')](0xcc)[_0x0611('0x1c')]();});}};}function handleEntityNotFound(_0x3f0508,_0x2c0720){return function(_0x1beb95){if(!_0x1beb95){_0x3f0508[_0x0611('0x1a')](0x194);}return _0x1beb95;};}function handleError(_0xb7c650,_0x2811b7){_0x2811b7=_0x2811b7||0x1f4;return function(_0x38a095){logger[_0x0611('0x29')](_0x38a095[_0x0611('0x2a')]);if(_0x38a095['name']){delete _0x38a095[_0x0611('0x2b')];}_0xb7c650['status'](_0x2811b7)[_0x0611('0x2c')](_0x38a095);};}exports[_0x0611('0x2d')]=function(_0x7e9792,_0x9071fd){var _0x5be7db={},_0x205bc5={},_0x28a2a4={'count':0x0,'rows':[]};return db[_0x0611('0x2e')][_0x0611('0x2f')]()['then'](function(_0x385c85){_0x205bc5[_0x0611('0x30')]=_['keys'](_0x385c85);_0x205bc5['query']=_[_0x0611('0x31')](_0x7e9792[_0x0611('0x32')]);_0x205bc5[_0x0611('0x33')]=_['intersection'](_0x205bc5[_0x0611('0x30')],_0x205bc5[_0x0611('0x32')]);_0x5be7db['attributes']=_[_0x0611('0x34')](_0x205bc5['model'],qs[_0x0611('0x35')](_0x7e9792['query'][_0x0611('0x35')]));_0x5be7db[_0x0611('0x36')]=_0x5be7db['attributes'][_0x0611('0x37')]?_0x5be7db[_0x0611('0x36')]:_0x205bc5[_0x0611('0x30')];if(!_0x7e9792[_0x0611('0x32')][_0x0611('0x38')](_0x0611('0x39'))){_0x5be7db[_0x0611('0x3a')]=qs['limit'](_0x7e9792[_0x0611('0x32')]['limit']);_0x5be7db['offset']=qs[_0x0611('0x1e')](_0x7e9792[_0x0611('0x32')][_0x0611('0x1e')]);}_0x5be7db[_0x0611('0x3b')]=qs[_0x0611('0x3c')](_0x7e9792[_0x0611('0x32')][_0x0611('0x3c')]);_0x5be7db[_0x0611('0x3d')]=qs[_0x0611('0x33')](_[_0x0611('0x3e')](_0x7e9792[_0x0611('0x32')],_0x205bc5[_0x0611('0x33')]),_0x385c85);if(_0x7e9792[_0x0611('0x32')][_0x0611('0x3f')]){_0x5be7db[_0x0611('0x3d')]=_[_0x0611('0x40')](_0x5be7db['where'],{'$or':_[_0x0611('0x41')](_0x5be7db[_0x0611('0x36')],function(_0x57a827){var _0x163511={};_0x163511[_0x57a827]={'$like':'%'+_0x7e9792[_0x0611('0x32')]['filter']+'%'};return _0x163511;})});}_0x5be7db=_[_0x0611('0x40')]({},_0x5be7db,_0x7e9792[_0x0611('0x42')]);var _0x388632={'where':_0x5be7db[_0x0611('0x3d')]};return db[_0x0611('0x2e')][_0x0611('0x1d')](_0x388632)[_0x0611('0x25')](function(_0x260b92){_0x28a2a4[_0x0611('0x1d')]=_0x260b92;if(_0x7e9792['query']['includeAll']){_0x5be7db[_0x0611('0x43')]=[{'all':!![]}];}return db[_0x0611('0x2e')][_0x0611('0x44')](_0x5be7db);})[_0x0611('0x25')](function(_0x3364dc){_0x28a2a4[_0x0611('0x45')]=_0x3364dc;return _0x28a2a4;})[_0x0611('0x25')](respondWithFilteredResult(_0x9071fd,_0x5be7db))['catch'](handleError(_0x9071fd,null));})[_0x0611('0x46')](handleError(_0x9071fd,null));};exports['show']=function(_0x1ffe09,_0x111498){var _0x689800={'raw':![],'where':{'id':_0x1ffe09[_0x0611('0x47')]['id']}},_0xbb284d={};_0xbb284d[_0x0611('0x30')]=_[_0x0611('0x31')](db[_0x0611('0x2e')][_0x0611('0x48')]);_0xbb284d[_0x0611('0x32')]=_[_0x0611('0x31')](_0x1ffe09[_0x0611('0x32')]);_0xbb284d[_0x0611('0x33')]=_[_0x0611('0x34')](_0xbb284d[_0x0611('0x30')],_0xbb284d[_0x0611('0x32')]);_0x689800[_0x0611('0x36')]=_[_0x0611('0x34')](_0xbb284d[_0x0611('0x30')],qs[_0x0611('0x35')](_0x1ffe09['query']['fields']));_0x689800['attributes']=_0x689800[_0x0611('0x36')][_0x0611('0x37')]?_0x689800[_0x0611('0x36')]:_0xbb284d[_0x0611('0x30')];if(_0x1ffe09[_0x0611('0x32')][_0x0611('0x49')]){_0x689800[_0x0611('0x43')]=[{'all':!![]}];}_0x689800=_[_0x0611('0x40')]({},_0x689800,_0x1ffe09['options']);return db[_0x0611('0x2e')][_0x0611('0x4a')](_0x689800)[_0x0611('0x25')](handleEntityNotFound(_0x111498,null))['then'](respondWithResult(_0x111498,null))[_0x0611('0x46')](handleError(_0x111498,null));};exports['create']=function(_0xea6798,_0x24ed54){return db[_0x0611('0x2e')][_0x0611('0x4b')](_0xea6798['body'],{})['then'](function(_0x5a669d){var _0x4d9bec=_0xea6798[_0x0611('0x4c')][_0x0611('0x27')]({'plain':!![]});if(!_0x4d9bec)throw new Error(_0x0611('0x4d'));if(_0x4d9bec[_0x0611('0x4e')]===_0x0611('0x4c')){var _0x4ea91a=_0x5a669d[_0x0611('0x27')]({'plain':!![]});var _0x14a117=_0x0611('0x28');return db[_0x0611('0x4f')][_0x0611('0x4a')]({'where':{'name':_0x14a117,'userProfileId':_0x4d9bec[_0x0611('0x50')]},'raw':!![]})['then'](function(_0x20ff13){if(_0x20ff13&&_0x20ff13[_0x0611('0x51')]===0x0){return db[_0x0611('0x52')][_0x0611('0x4b')]({'name':_0x4ea91a['name'],'resourceId':_0x4ea91a['id'],'type':_0x20ff13[_0x0611('0x2b')],'sectionId':_0x20ff13['id']},{})[_0x0611('0x25')](function(){return _0x5a669d;});}else{return _0x5a669d;}})[_0x0611('0x46')](function(_0x8582b6){logger[_0x0611('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8582b6);throw _0x8582b6;});}return _0x5a669d;})[_0x0611('0x25')](respondWithResult(_0x24ed54,0xc9))[_0x0611('0x46')](handleError(_0x24ed54,null));};exports['update']=function(_0x460dfb,_0x423072){if(_0x460dfb[_0x0611('0x53')]['id']){delete _0x460dfb[_0x0611('0x53')]['id'];}return db[_0x0611('0x2e')][_0x0611('0x4a')]({'where':{'id':_0x460dfb[_0x0611('0x47')]['id']}})[_0x0611('0x25')](handleEntityNotFound(_0x423072,null))['then'](saveUpdates(_0x460dfb[_0x0611('0x53')],null))[_0x0611('0x25')](respondWithResult(_0x423072,null))[_0x0611('0x46')](handleError(_0x423072,null));};exports['destroy']=function(_0x5e90c0,_0x2c400a){return db[_0x0611('0x2e')]['find']({'where':{'id':_0x5e90c0[_0x0611('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c400a,null))[_0x0611('0x25')](removeEntity(_0x2c400a,null))['catch'](handleError(_0x2c400a,null));};exports[_0x0611('0x2f')]=function(_0x4e648a,_0x1b4a54){return db['CmCompany'][_0x0611('0x2f')]()['then'](respondWithResult(_0x1b4a54,null))[_0x0611('0x46')](handleError(_0x1b4a54,null));};exports[_0x0611('0x54')]=function(_0x3e6353,_0x298a29,_0x41dada){return db[_0x0611('0x55')][_0x0611('0x4a')]({'where':{'id':_0x3e6353[_0x0611('0x47')]['id']}})[_0x0611('0x25')](handleEntityNotFound(_0x298a29,null))[_0x0611('0x25')](function(_0x297072){if(_0x297072){return _0x297072['addContacts'](_0x3e6353['body'][_0x0611('0x56')],_['omit'](_0x3e6353['body'],[_0x0611('0x56'),'id'])||{});}})['then'](respondWithResult(_0x298a29,null))['catch'](handleError(_0x298a29,null));};exports['getContacts']=function(_0x32dc65,_0x6703bb,_0x111efd){var _0x2969c9={};var _0x276496={};var _0x150fdd;var _0x164665;return db['CmCompany'][_0x0611('0x57')]({'where':{'id':_0x32dc65[_0x0611('0x47')]['id']}})[_0x0611('0x25')](handleEntityNotFound(_0x6703bb,null))['then'](function(_0x4412cc){if(_0x4412cc){_0x150fdd=_0x4412cc;_0x276496[_0x0611('0x30')]=_[_0x0611('0x31')](db[_0x0611('0x55')][_0x0611('0x48')]);_0x276496[_0x0611('0x32')]=_['keys'](_0x32dc65[_0x0611('0x32')]);_0x276496[_0x0611('0x33')]=_[_0x0611('0x34')](_0x276496[_0x0611('0x30')],_0x276496['query']);_0x2969c9[_0x0611('0x36')]=_[_0x0611('0x34')](_0x276496[_0x0611('0x30')],qs[_0x0611('0x35')](_0x32dc65[_0x0611('0x32')][_0x0611('0x35')]));_0x2969c9['attributes']=_0x2969c9[_0x0611('0x36')]['length']?_0x2969c9['attributes']:_0x276496['model'];_0x2969c9[_0x0611('0x3b')]=qs[_0x0611('0x3c')](_0x32dc65['query'][_0x0611('0x3c')]);_0x2969c9[_0x0611('0x3d')]=qs[_0x0611('0x33')](_[_0x0611('0x3e')](_0x32dc65[_0x0611('0x32')],_0x276496[_0x0611('0x33')]));if(_0x32dc65[_0x0611('0x32')][_0x0611('0x3f')]){_0x2969c9['where']=_[_0x0611('0x40')](_0x2969c9[_0x0611('0x3d')],{'$or':_[_0x0611('0x41')](_0x2969c9['attributes'],function(_0x3027db){var _0x5422bc={};_0x5422bc[_0x3027db]={'$like':'%'+_0x32dc65[_0x0611('0x32')][_0x0611('0x3f')]+'%'};return _0x5422bc;})});}_0x2969c9=_[_0x0611('0x40')]({},_0x2969c9,_0x32dc65[_0x0611('0x42')]);return _0x150fdd[_0x0611('0x58')](_0x2969c9);}})[_0x0611('0x25')](function(_0x4667de){if(_0x4667de){_0x164665=_0x4667de[_0x0611('0x37')];if(!_0x32dc65['query'][_0x0611('0x38')]('nolimit')){_0x2969c9[_0x0611('0x3a')]=qs[_0x0611('0x3a')](_0x32dc65['query']['limit']);_0x2969c9['offset']=qs[_0x0611('0x1e')](_0x32dc65[_0x0611('0x32')]['offset']);}return _0x150fdd['getContacts'](_0x2969c9);}})[_0x0611('0x25')](function(_0x37ffd2){if(_0x37ffd2){return _0x37ffd2?{'count':_0x164665,'rows':_0x37ffd2}:null;}})[_0x0611('0x25')](respondWithResult(_0x6703bb,null))[_0x0611('0x46')](handleError(_0x6703bb,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5bbc7a6..237651d 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 _0xf2cf=['./cmCompany.attributes','CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12faa6,_0x29d735){var _0x15a89d=function(_0x302212){while(--_0x302212){_0x12faa6['push'](_0x12faa6['shift']());}};_0x15a89d(++_0x29d735);}(_0xf2cf,0xf5));var _0xff2c=function(_0x425802,_0x4f996f){_0x425802=_0x425802-0x0;var _0x12a4fa=_0xf2cf[_0x425802];return _0x12a4fa;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var logger=require(_0xff2c('0x1'))(_0xff2c('0x2'));var moment=require('moment');var BPromise=require(_0xff2c('0x3'));var rp=require(_0xff2c('0x4'));var fs=require('fs');var path=require(_0xff2c('0x5'));var rimraf=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var attributes=require(_0xff2c('0x8'));module['exports']=function(_0x8f0f4,_0x68b356){return _0x8f0f4['define'](_0xff2c('0x9'),attributes,{'tableName':_0xff2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa786=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','../../config/logger','api'];(function(_0x15b303,_0x68ba03){var _0x404ec6=function(_0x38064a){while(--_0x38064a){_0x15b303['push'](_0x15b303['shift']());}};_0x404ec6(++_0x68ba03);}(_0xa786,0x1d2));var _0x6a78=function(_0x519a12,_0x1990a9){_0x519a12=_0x519a12-0x0;var _0xd96043=_0xa786[_0x519a12];return _0xd96043;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a78('0x0'))(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require(_0x6a78('0x3'));var rp=require(_0x6a78('0x4'));var fs=require('fs');var path=require(_0x6a78('0x5'));var rimraf=require(_0x6a78('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a78('0x7'));module[_0x6a78('0x8')]=function(_0xc0be8b,_0x45470e){return _0xc0be8b[_0x6a78('0x9')](_0x6a78('0xa'),attributes,{'tableName':_0x6a78('0xb'),'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 cedb9cb..cb144a2 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 _0x8ed8=['CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5b5a2e,_0x421b5d){var _0x50f592=function(_0xe1e8b){while(--_0xe1e8b){_0x5b5a2e['push'](_0x5b5a2e['shift']());}};_0x50f592(++_0x421b5d);}(_0x8ed8,0x168));var _0x88ed=function(_0x4582f9,_0x2ba207){_0x4582f9=_0x4582f9-0x0;var _0x33b957=_0x8ed8[_0x4582f9];return _0x33b957;};'use strict';var _=require(_0x88ed('0x0'));var util=require(_0x88ed('0x1'));var moment=require(_0x88ed('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88ed('0x3'));var db=require(_0x88ed('0x4'))['db'];var utils=require(_0x88ed('0x5'));var logger=require('../../config/logger')(_0x88ed('0x6'));var config=require('../../config/environment');var jayson=require(_0x88ed('0x7'));var client=jayson[_0x88ed('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbf2,_0xbd647f,_0x3e3a9d){return new BPromise(function(_0x582e60,_0x1be946){return client[_0x88ed('0x9')](_0x27cbf2,_0x3e3a9d)[_0x88ed('0xa')](function(_0x54bc8c){logger['info']('CmCompany,\x20%s,\x20%s',_0xbd647f,_0x88ed('0xb'));logger[_0x88ed('0xc')](_0x88ed('0xd'),_0xbd647f,'request\x20sent',JSON[_0x88ed('0xe')](_0x54bc8c));if(_0x54bc8c[_0x88ed('0xf')]){if(_0x54bc8c[_0x88ed('0xf')][_0x88ed('0x10')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0xbd647f,_0x54bc8c['error'][_0x88ed('0x11')]);return _0x1be946(_0x54bc8c[_0x88ed('0xf')][_0x88ed('0x11')]);}logger[_0x88ed('0xf')](_0x88ed('0x12'),_0xbd647f,_0x54bc8c['error'][_0x88ed('0x11')]);return _0x582e60(_0x54bc8c[_0x88ed('0xf')][_0x88ed('0x11')]);}else{logger['info'](_0x88ed('0x12'),_0xbd647f,_0x88ed('0xb'));_0x582e60(_0x54bc8c[_0x88ed('0x13')][_0x88ed('0x11')]);}})[_0x88ed('0x14')](function(_0x5eb5c4){logger['error'](_0x88ed('0x12'),_0xbd647f,_0x5eb5c4);_0x1be946(_0x5eb5c4);});});} \ No newline at end of file +var _0xd519=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd519,0x101));var _0x9d51=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd519[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x9d51('0x0'));var moment=require(_0x9d51('0x1'));var BPromise=require(_0x9d51('0x2'));var rs=require(_0x9d51('0x3'));var fs=require('fs');var Redis=require(_0x9d51('0x4'));var db=require(_0x9d51('0x5'))['db'];var utils=require(_0x9d51('0x6'));var logger=require(_0x9d51('0x7'))(_0x9d51('0x8'));var config=require(_0x9d51('0x9'));var jayson=require(_0x9d51('0xa'));var client=jayson[_0x9d51('0xb')][_0x9d51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b90c,_0x442f41,_0x2c79a7){return new BPromise(function(_0x268a9b,_0x17146c){return client[_0x9d51('0xd')](_0x46b90c,_0x2c79a7)['then'](function(_0x3fa485){logger['info'](_0x9d51('0xe'),_0x442f41,_0x9d51('0xf'));logger['debug'](_0x9d51('0x10'),_0x442f41,'request\x20sent',JSON[_0x9d51('0x11')](_0x3fa485));if(_0x3fa485['error']){if(_0x3fa485['error'][_0x9d51('0x12')]===0x1f4){logger[_0x9d51('0x13')](_0x9d51('0xe'),_0x442f41,_0x3fa485['error'][_0x9d51('0x14')]);return _0x17146c(_0x3fa485[_0x9d51('0x13')]['message']);}logger[_0x9d51('0x13')]('CmCompany,\x20%s,\x20%s',_0x442f41,_0x3fa485[_0x9d51('0x13')][_0x9d51('0x14')]);return _0x268a9b(_0x3fa485[_0x9d51('0x13')][_0x9d51('0x14')]);}else{logger[_0x9d51('0x15')](_0x9d51('0xe'),_0x442f41,_0x9d51('0xf'));_0x268a9b(_0x3fa485[_0x9d51('0x16')][_0x9d51('0x14')]);}})[_0x9d51('0x17')](function(_0x2ffff7){logger['error']('CmCompany,\x20%s,\x20%s',_0x442f41,_0x2ffff7);_0x17146c(_0x2ffff7);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index ad97113..9c16f92 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 _0x2a07=['delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','create','post','/:id/contacts','put','update'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x2a07,0x74));var _0x72a0=function(_0x4adad3,_0x202bba){_0x4adad3=_0x4adad3-0x0;var _0x52dae4=_0x2a07[_0x4adad3];return _0x52dae4;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x9')]('/:id/contacts',auth[_0x72a0('0xa')](),controller[_0x72a0('0x10')]);router['post']('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')](_0x72a0('0x13'),auth[_0x72a0('0xa')](),controller['addContacts']);router[_0x72a0('0x14')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0x15')]);router[_0x72a0('0x16')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x25e7=['get','/:id','show','/:id/contacts','getContacts','post','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','isAuthenticated','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x25e7,0x1d6));var _0x725e=function(_0x200703,_0x4cccfd){_0x200703=_0x200703-0x0;var _0x5a32dc=_0x25e7[_0x200703];return _0x5a32dc;};'use strict';var multer=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var path=require(_0x725e('0x2'));var timeout=require(_0x725e('0x3'));var express=require(_0x725e('0x4'));var router=express[_0x725e('0x5')]();var auth=require(_0x725e('0x6'));var interaction=require(_0x725e('0x7'));var config=require(_0x725e('0x8'));var controller=require(_0x725e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x725e('0xa')]);router['get']('/describe',auth[_0x725e('0xb')](),controller[_0x725e('0xc')]);router[_0x725e('0xd')](_0x725e('0xe'),auth[_0x725e('0xb')](),controller[_0x725e('0xf')]);router[_0x725e('0xd')](_0x725e('0x10'),auth[_0x725e('0xb')](),controller[_0x725e('0x11')]);router[_0x725e('0x12')]('/',auth[_0x725e('0xb')](),controller['create']);router['post'](_0x725e('0x10'),auth[_0x725e('0xb')](),controller['addContacts']);router['put'](_0x725e('0xe'),auth[_0x725e('0xb')](),controller['update']);router[_0x725e('0x13')](_0x725e('0xe'),auth[_0x725e('0xb')](),controller['destroy']);module[_0x725e('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d133622..01e2a6a 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 _0x652c=['TEXT','INTEGER','UNSIGNED','DATE','lodash','sequelize','exports','STRING'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0x652c,0x15c));var _0xc652=function(_0x37a350,_0x154790){_0x37a350=_0x37a350-0x0;var _0x15627a=_0x652c[_0x37a350];return _0x15627a;};'use strict';var _=require(_0xc652('0x0'));var Sequelize=require(_0xc652('0x1'));module[_0xc652('0x2')]={'firstName':{'type':Sequelize[_0xc652('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc652('0x3')]},'street':{'type':Sequelize[_0xc652('0x3')]},'postalCode':{'type':Sequelize[_0xc652('0x3')]},'city':{'type':Sequelize[_0xc652('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xc652('0x3')]},'description':{'type':Sequelize[_0xc652('0x4')]},'phone':{'type':Sequelize[_0xc652('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc652('0x3')]},'url':{'type':Sequelize[_0xc652('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc652('0x3')]},'twitter':{'type':Sequelize[_0xc652('0x3')]},'skype':{'type':Sequelize[_0xc652('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xc652('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xc652('0x3')]},'telegram':{'type':Sequelize[_0xc652('0x3')]},'UserId':{'type':Sequelize[_0xc652('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc652('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc652('0x7')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xc37e=['sequelize','exports','STRING','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x5d8027,_0x372235){var _0x135a7a=function(_0xe5e5db){while(--_0xe5e5db){_0x5d8027['push'](_0x5d8027['shift']());}};_0x135a7a(++_0x372235);}(_0xc37e,0x9f));var _0xec37=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc37e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xec37('0x0'));var Sequelize=require(_0xec37('0x1'));module[_0xec37('0x2')]={'firstName':{'type':Sequelize[_0xec37('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xec37('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xec37('0x3')]},'country':{'type':Sequelize[_0xec37('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xec37('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xec37('0x3')]},'email':{'type':Sequelize[_0xec37('0x3')]},'url':{'type':Sequelize[_0xec37('0x3')]},'facebook':{'type':Sequelize[_0xec37('0x3')]},'fb_data':{'type':Sequelize[_0xec37('0x3')]},'twitter':{'type':Sequelize[_0xec37('0x3')]},'skype':{'type':Sequelize[_0xec37('0x3')]},'teams':{'type':Sequelize[_0xec37('0x3')]},'viber':{'type':Sequelize[_0xec37('0x3')]},'line':{'type':Sequelize[_0xec37('0x3')]},'wechat':{'type':Sequelize[_0xec37('0x3')]},'telegram':{'type':Sequelize[_0xec37('0x3')]},'UserId':{'type':Sequelize[_0xec37('0x4')]},'priority':{'type':Sequelize[_0xec37('0x4')](0x2)[_0xec37('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xec37('0x6')],'defaultValue':Sequelize[_0xec37('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 2efe303..d710420 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 _0x9684=['push','findOne','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','uc.UserId\x20=\x20?','value','datetime','castTo','DATE','buildExpression','text','start','isNil','Contact','isEmpty','ListId','concat','\x20=\x20?','tag','isArray','filter','replace','isNumeric','c.id\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','some','User','user','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','keyBy','c.lastName','c.phone','c.mobile','c.fax','c.ListId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','rows','catch','CmContact','find','params','columnName','CmCustomField','displayName','alias','custom','merge','body','findAll','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','omit','format','$and','pickBy','cf_%d','toParam','phone','rawAttributes','options','getTags','setTags','getHoppers','ContactId','includeAll','getHopperHistories','getHopperFinals','CmHopperFinal','getJscriptySessions','include','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','upload','createReadStream','parse','meta','import','agent','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','describe','keys','startsWith','cf_'];(function(_0x2891d9,_0x22b8b3){var _0x2c4930=function(_0x4edb44){while(--_0x4edb44){_0x2891d9['push'](_0x2891d9['shift']());}};_0x2c4930(++_0x22b8b3);}(_0x9684,0x1ad));var _0x4968=function(_0x22c4db,_0x544e41){_0x22c4db=_0x22c4db-0x0;var _0x3cdac2=_0x9684[_0x22c4db];return _0x3cdac2;};'use strict';var pdf=require(_0x4968('0x0'));var emlformat=require(_0x4968('0x1'));var rimraf=require(_0x4968('0x2'));var zipdir=require(_0x4968('0x3'));var jsonpatch=require(_0x4968('0x4'));var rp=require(_0x4968('0x5'));var moment=require(_0x4968('0x6'));var BPromise=require(_0x4968('0x7'));var Mustache=require(_0x4968('0x8'));var util=require(_0x4968('0x9'));var path=require(_0x4968('0xa'));var sox=require(_0x4968('0xb'));var csv=require(_0x4968('0xc'));var ejs=require(_0x4968('0xd'));var fs=require('fs');var _=require(_0x4968('0xe'));var squel=require('squel');var crypto=require(_0x4968('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4968('0xc'));var querystring=require(_0x4968('0x10'));var Papa=require(_0x4968('0x11'));var Redis=require(_0x4968('0x12'));var authService=require(_0x4968('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4968('0x14'));var logger=require(_0x4968('0x15'))(_0x4968('0x16'));var utils=require(_0x4968('0x17'));var config=require(_0x4968('0x18'));var db=require(_0x4968('0x19'))['db'];config[_0x4968('0x1a')]=_['defaults'](config[_0x4968('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4968('0x1b'))(new Redis(config[_0x4968('0x1a')]));require(_0x4968('0x1c'))[_0x4968('0x1d')](socket);function respondWithStatusCode(_0x3ce507,_0xa0c5e1){_0xa0c5e1=_0xa0c5e1||0xcc;return function(_0x445779){if(_0x445779){return _0x3ce507['sendStatus'](_0xa0c5e1);}return _0x3ce507[_0x4968('0x1e')](_0xa0c5e1)[_0x4968('0x1f')]();};}function respondWithResult(_0x4d476e,_0x14d11b){_0x14d11b=_0x14d11b||0xc8;return function(_0x5ecdd7){if(_0x5ecdd7){return _0x4d476e[_0x4968('0x1e')](_0x14d11b)[_0x4968('0x20')](_0x5ecdd7);}};}function respondWithFilteredResult(_0x33ce27,_0x339d23){return function(_0x220b54){if(_0x220b54){var _0x5197a1=_0x220b54[_0x4968('0x21')],_0x547cf6=_0x339d23[_0x4968('0x22')],_0x5f1a71=_0x339d23[_0x4968('0x22')]+_0x339d23[_0x4968('0x23')],_0x317c80;if(_0x5f1a71>=_0x5197a1){_0x5f1a71=_0x5197a1;_0x317c80=0xc8;}else{_0x317c80=0xce;}_0x33ce27[_0x4968('0x1e')](_0x317c80);return _0x33ce27[_0x4968('0x24')](_0x4968('0x25'),_0x547cf6+'-'+_0x5f1a71+'/'+_0x5197a1)[_0x4968('0x20')](_0x220b54);}return null;};}function patchUpdates(_0x432e5d){return function(_0x36b33d){try{jsonpatch[_0x4968('0x26')](_0x36b33d,_0x432e5d,!![]);}catch(_0x3d87a3){return BPromise[_0x4968('0x27')](_0x3d87a3);}return _0x36b33d[_0x4968('0x28')]();};}function saveUpdates(_0x55e268,_0x3c747e){return function(_0x43791c){if(_0x43791c){return _0x43791c['update'](_0x55e268)[_0x4968('0x29')](function(_0xcceccb){return _0xcceccb;});}return null;};}function removeEntity(_0x4ad9ef,_0x44685d){return function(_0x333fc7){if(_0x333fc7){return _0x333fc7[_0x4968('0x2a')]()[_0x4968('0x29')](function(){_0x4ad9ef[_0x4968('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5681d0,_0x580180){return function(_0x393275){if(!_0x393275){_0x5681d0[_0x4968('0x2b')](0x194);}return _0x393275;};}function handleError(_0x7b8f26,_0x174bd2){_0x174bd2=_0x174bd2||0x1f4;return function(_0xa4d28f){logger['error'](_0xa4d28f[_0x4968('0x2c')]);if(_0xa4d28f[_0x4968('0x2d')]){delete _0xa4d28f['name'];}_0x7b8f26['status'](_0x174bd2)[_0x4968('0x2e')](_0xa4d28f);};}exports['index']=function(_0x20b6cf,_0x265eff){var _0x2eb35b={},_0x5ca9e5={},_0x33aabd={'count':0x0,'rows':[]};return db['CmContact'][_0x4968('0x2f')]()[_0x4968('0x29')](function(_0x5b707a){var _0x14a11a=[];for(var _0x1dbcaf=0x0;_0x1dbcaf0x1){_0x36e5a2['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x47709d),null);}else{if(qs[_0x4968('0x6d')](_0x47709d)){_0x36e5a2['or'](_0x4968('0x6e'),_0x47709d+'%');_0x36e5a2['or']('c.phone\x20LIKE\x20?',_0x47709d+'%');_0x36e5a2['or']('c.mobile\x20LIKE\x20?',_0x47709d+'%');_0x36e5a2['or'](_0x4968('0x6f'),_0x47709d+'%');}else if(qs[_0x4968('0x70')](_0x47709d)){_0x36e5a2['or'](_0x4968('0x71'),_0x47709d+'%');}else{_0x36e5a2['or']('c.firstName\x20LIKE\x20?','%'+_0x47709d+'%');_0x36e5a2['or']('c.lastName\x20LIKE\x20?','%'+_0x47709d+'%');_0x36e5a2['or'](_0x4968('0x71'),'%'+_0x47709d+'%');}}}}_0x14fa2e[_0x4968('0x4e')](_0x36e5a2);_0x14fa2e['group'](_0x4968('0x72'));var _0x2078a7={'type':db[_0x4968('0x73')][_0x4968('0x74')][_0x4968('0x75')],'raw':!![]};var _0x53009f=_0x14fa2e['clone']()[_0x4968('0x45')](_0x4968('0x72'));if(_0x2eb35b[_0x4968('0x41')]){_0x2eb35b[_0x4968('0x41')][_0x4968('0x58')](function(_0x2c32f4){_0x14fa2e[_0x4968('0x41')]('c.'+_0x2c32f4[0x0],_0x2c32f4[0x1]===_0x4968('0x76')?![]:!![]);});}if(!_[_0x4968('0x65')](_0x1b898c)){_0x14fa2e[_0x4968('0x77')](_0x312714);_0x53009f[_0x4968('0x4e')](_0x4968('0x78'),_0x1b898c);}BPromise['resolve']()[_0x4968('0x29')](function(){if(_0x1079f6&&!_[_0x4968('0x79')](_0x1079f6[_0x4968('0x54')],[_0x4968('0x45'),_0x4968('0x7a')])){return _0x20b6cf[_0x4968('0x7b')]['getLists']({'attributes':['id'],'raw':!![]})[_0x4968('0x29')](function(_0x1db385){if(_[_0x4968('0x65')](_0x1db385)){_0x53009f[_0x4968('0x4e')]('c.ListId\x20IS\x20NULL');_0x14fa2e[_0x4968('0x4e')](_0x4968('0x7c'));}else{_0x53009f[_0x4968('0x4e')](_0x4968('0x7d'),_['map'](_0x1db385,'id'));_0x14fa2e['where'](_0x4968('0x7d'),_['map'](_0x1db385,'id'));}});}else{return;}})['then'](function(){db[_0x4968('0x7e')][_0x4968('0x3a')](_0x53009f['toString'](),_0x2078a7)[_0x4968('0x29')](function(_0xcf41b){_0x33aabd[_0x4968('0x21')]=_0xcf41b[_0x4968('0x36')];if(_0x33aabd['count']===0x0)return[];return db[_0x4968('0x7e')][_0x4968('0x3a')](_0x5b6d0f['toString'](),_0x2078a7);})[_0x4968('0x29')](function(_0x3b29c2){_0x428561=_[_0x4968('0x7f')](_0x3b29c2,'id');_0x2078a7=_['merge'](_0x2078a7,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x20b6cf['query'][_0x4968('0x3e')]){_0x2eb35b[_0x4968('0x3d')]['forEach'](function(_0x4d52aa){_0x14fa2e[_0x4968('0x45')]('c.'+_0x4d52aa);});}else{_0x14fa2e[_0x4968('0x45')](_0x4968('0x72'));_0x14fa2e['field']('c.firstName');_0x14fa2e[_0x4968('0x45')](_0x4968('0x80'));_0x14fa2e[_0x4968('0x45')](_0x4968('0x81'));_0x14fa2e[_0x4968('0x45')](_0x4968('0x82'));_0x14fa2e[_0x4968('0x45')](_0x4968('0x83'));_0x14fa2e[_0x4968('0x45')]('c.email');_0x14fa2e['field'](_0x4968('0x84'));_0x14fa2e[_0x4968('0x45')]('c.deletedAt');_0x14fa2e['field'](_0x4968('0x85'),_0x4968('0x86'));}if(_0x2eb35b['limit'])_0x14fa2e[_0x4968('0x23')](_0x2eb35b[_0x4968('0x23')]);if(_0x2eb35b[_0x4968('0x22')])_0x14fa2e['offset'](_0x2eb35b[_0x4968('0x22')]);return db[_0x4968('0x7e')][_0x4968('0x3a')](_0x14fa2e[_0x4968('0x87')](),_0x2078a7);})[_0x4968('0x29')](function(_0x275311){_0x275311['forEach'](function(_0x31c762){if(_0x31c762[_0x4968('0x86')]){_0x31c762[_0x4968('0x88')]=[];_0x31c762['TagIds'][_0x4968('0x56')](',')[_0x4968('0x58')](function(_0x2f4fd9){_0x31c762['Tags'][_0x4968('0x33')](_0x428561[_0x2f4fd9]);});}delete _0x31c762[_0x4968('0x86')];});_0x33aabd[_0x4968('0x89')]=_0x275311;return _0x33aabd;})[_0x4968('0x29')](respondWithFilteredResult(_0x265eff,_0x2eb35b));});})[_0x4968('0x8a')](handleError(_0x265eff,null));};exports[_0x4968('0x2a')]=function(_0x2a8b9d,_0xe4e2a2){return db[_0x4968('0x8b')][_0x4968('0x8c')]({'where':{'id':_0x2a8b9d[_0x4968('0x8d')]['id']}})['then'](handleEntityNotFound(_0xe4e2a2,null))[_0x4968('0x29')](removeEntity(_0xe4e2a2,null))[_0x4968('0x8a')](handleError(_0xe4e2a2,null));};exports[_0x4968('0x2f')]=function(_0xe25778,_0x1e0632){return db[_0x4968('0x8b')][_0x4968('0x2f')]()['then'](function(_0x19d78f){delete _0x19d78f['tags'];for(var _0x51b467=0x0;_0x51b467=_0x1d91ba){_0x38d410=_0x1d91ba;_0x209385=0xc8;}else{_0x209385=0xce;}_0x5e98ff['status'](_0x209385);return _0x5e98ff[_0xb361('0x21')]('Content-Range',_0x299391+'-'+_0x38d410+'/'+_0x1d91ba)[_0xb361('0x22')](_0xbc5a87);}return null;};}function patchUpdates(_0x2a0772){return function(_0x4464d2){try{jsonpatch[_0xb361('0x23')](_0x4464d2,_0x2a0772,!![]);}catch(_0x370360){return BPromise[_0xb361('0x24')](_0x370360);}return _0x4464d2[_0xb361('0x25')]();};}function saveUpdates(_0x36dec8,_0xe9627b){return function(_0x78339c){if(_0x78339c){return _0x78339c[_0xb361('0x26')](_0x36dec8)[_0xb361('0x27')](function(_0x51777d){return _0x51777d;});}return null;};}function removeEntity(_0x35c8a8,_0xb4efff){return function(_0x343136){if(_0x343136){return _0x343136[_0xb361('0x28')]()['then'](function(){_0x35c8a8['status'](0xcc)[_0xb361('0x29')]();});}};}function handleEntityNotFound(_0x595d87,_0x531f4a){return function(_0x662463){if(!_0x662463){_0x595d87[_0xb361('0x2a')](0x194);}return _0x662463;};}function handleError(_0x475e91,_0x595fd3){_0x595fd3=_0x595fd3||0x1f4;return function(_0x1f4e39){logger[_0xb361('0x2b')](_0x1f4e39[_0xb361('0x2c')]);if(_0x1f4e39[_0xb361('0x2d')]){delete _0x1f4e39[_0xb361('0x2d')];}_0x475e91[_0xb361('0x1d')](_0x595fd3)[_0xb361('0x2e')](_0x1f4e39);};}exports['index']=function(_0x366b08,_0x4d4ced){var _0x220a77={},_0x216abb={},_0x34b8ce={'count':0x0,'rows':[]};return db['CmContact'][_0xb361('0x2f')]()[_0xb361('0x27')](function(_0x1c78bd){var _0x2da86e=[];for(var _0x5ef0ba=0x0;_0x5ef0ba0x1){_0x477c31['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb361('0x6e')](_0xbff04f),null);}else{if(qs[_0xb361('0x6f')](_0xbff04f)){_0x477c31['or'](_0xb361('0x70'),_0xbff04f+'%');_0x477c31['or'](_0xb361('0x71'),_0xbff04f+'%');_0x477c31['or']('c.mobile\x20LIKE\x20?',_0xbff04f+'%');_0x477c31['or'](_0xb361('0x72'),_0xbff04f+'%');}else if(qs[_0xb361('0x73')](_0xbff04f)){_0x477c31['or'](_0xb361('0x74'),_0xbff04f+'%');}else{_0x477c31['or']('c.firstName\x20LIKE\x20?','%'+_0xbff04f+'%');_0x477c31['or'](_0xb361('0x75'),'%'+_0xbff04f+'%');_0x477c31['or']('c.email\x20LIKE\x20?','%'+_0xbff04f+'%');}}}}_0x540ef9['where'](_0x477c31);_0x540ef9[_0xb361('0x76')]('c.id');var _0x536d34={'type':db[_0xb361('0x77')]['QueryTypes'][_0xb361('0x78')],'raw':!![]};var _0x23280d=_0x540ef9[_0xb361('0x79')]()[_0xb361('0x46')]('c.id');if(_0x220a77[_0xb361('0x41')]){_0x220a77[_0xb361('0x41')][_0xb361('0x67')](function(_0x4b76df){_0x540ef9[_0xb361('0x41')]('c.'+_0x4b76df[0x0],_0x4b76df[0x1]===_0xb361('0x7a')?![]:!![]);});}if(!_[_0xb361('0x66')](_0x38b73a)){_0x540ef9[_0xb361('0x7b')](_0x36c5f1);_0x23280d['where'](_0xb361('0x7c'),_0x38b73a);}BPromise[_0xb361('0x7d')]()[_0xb361('0x27')](function(){if(_0x444b7e&&!_[_0xb361('0x7e')](_0x444b7e[_0xb361('0x51')],[_0xb361('0x46'),_0xb361('0x58')])){return _0x366b08[_0xb361('0x7f')][_0xb361('0x80')]({'attributes':['id'],'raw':!![]})[_0xb361('0x27')](function(_0x295a75){if(_['isEmpty'](_0x295a75)){_0x23280d['where'](_0xb361('0x81'));_0x540ef9['where'](_0xb361('0x81'));}else{_0x23280d[_0xb361('0x43')](_0xb361('0x82'),_['map'](_0x295a75,'id'));_0x540ef9[_0xb361('0x43')](_0xb361('0x82'),_[_0xb361('0x55')](_0x295a75,'id'));}});}else{return;}})[_0xb361('0x27')](function(){db['sequelize'][_0xb361('0x3b')](_0x23280d[_0xb361('0x83')](),_0x536d34)['then'](function(_0x55275b){_0x34b8ce[_0xb361('0x1e')]=_0x55275b['length'];if(_0x34b8ce[_0xb361('0x1e')]===0x0)return[];return db[_0xb361('0x84')][_0xb361('0x3b')](_0x169165[_0xb361('0x83')](),_0x536d34);})[_0xb361('0x27')](function(_0x4ca782){_0x4bdd3f=_[_0xb361('0x85')](_0x4ca782,'id');_0x536d34=_[_0xb361('0x86')](_0x536d34,{'model':db[_0xb361('0x87')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x366b08[_0xb361('0x3b')][_0xb361('0x3f')]){_0x220a77[_0xb361('0x3e')]['forEach'](function(_0x120ff4){_0x540ef9[_0xb361('0x46')]('c.'+_0x120ff4);});}else{_0x540ef9[_0xb361('0x46')](_0xb361('0x88'));_0x540ef9[_0xb361('0x46')]('c.firstName');_0x540ef9[_0xb361('0x46')](_0xb361('0x89'));_0x540ef9[_0xb361('0x46')]('c.phone');_0x540ef9[_0xb361('0x46')]('c.mobile');_0x540ef9[_0xb361('0x46')]('c.fax');_0x540ef9[_0xb361('0x46')]('c.email');_0x540ef9[_0xb361('0x46')]('c.ListId');_0x540ef9[_0xb361('0x46')](_0xb361('0x8a'));_0x540ef9[_0xb361('0x46')](_0xb361('0x8b'),_0xb361('0x8c'));}if(_0x220a77[_0xb361('0x20')])_0x540ef9[_0xb361('0x20')](_0x220a77['limit']);if(_0x220a77['offset'])_0x540ef9[_0xb361('0x1f')](_0x220a77['offset']);return db['sequelize'][_0xb361('0x3b')](_0x540ef9[_0xb361('0x83')](),_0x536d34);})[_0xb361('0x27')](function(_0x3b6567){_0x3b6567[_0xb361('0x67')](function(_0xd14343){if(_0xd14343[_0xb361('0x8c')]){_0xd14343[_0xb361('0x8d')]=[];_0xd14343[_0xb361('0x8c')][_0xb361('0x54')](',')[_0xb361('0x67')](function(_0x4834b9){_0xd14343[_0xb361('0x8d')][_0xb361('0x31')](_0x4bdd3f[_0x4834b9]);});}delete _0xd14343['TagIds'];});_0x34b8ce[_0xb361('0x8e')]=_0x3b6567;return _0x34b8ce;})[_0xb361('0x27')](respondWithFilteredResult(_0x4d4ced,_0x220a77));});})['catch'](handleError(_0x4d4ced,null));};exports[_0xb361('0x28')]=function(_0x22b7a8,_0x5af60a){return db['CmContact'][_0xb361('0x52')]({'where':{'id':_0x22b7a8[_0xb361('0x8f')]['id']}})[_0xb361('0x27')](handleEntityNotFound(_0x5af60a,null))[_0xb361('0x27')](removeEntity(_0x5af60a,null))[_0xb361('0x90')](handleError(_0x5af60a,null));};exports[_0xb361('0x2f')]=function(_0x531a74,_0x15789a){return db[_0xb361('0x87')]['describe']()[_0xb361('0x27')](function(_0x5c5241){delete _0x5c5241['tags'];for(var _0x4071f3=0x0;_0x4071f3{}\s\\|]/g,'-');_0x1e2411(null,util['format']('%s-%s%s',path['basename'](_0x2253fd[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x2253fd['originalname'])),Date[_0x72d1('0x23')](),path[_0x72d1('0x22')](_0x2253fd[_0x72d1('0x21')])));}})});router[_0x72d1('0x16')](_0x72d1('0x24'),upload['single']('file'),controller[_0x72d1('0x25')]);var upload=multer({'storage':multer[_0x72d1('0x1d')]({'destination':function(_0x2f661,_0x2f879f,_0xdf6a69){_0xdf6a69(null,path[_0x72d1('0x1e')](config[_0x72d1('0x1f')],'server/files/tmp'));},'filename':function(_0x57ec9e,_0x1ba258,_0x482cb8){_0x1ba258[_0x72d1('0x21')]=_0x1ba258[_0x72d1('0x21')][_0x72d1('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x482cb8(null,util['format'](_0x72d1('0x27'),path['basename'](_0x1ba258[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x1ba258[_0x72d1('0x21')])),Date[_0x72d1('0x23')](),path['extname'](_0x1ba258[_0x72d1('0x21')])));}})});router['post'](_0x72d1('0x28'),upload[_0x72d1('0x29')]('file'),controller[_0x72d1('0x2a')]);router[_0x72d1('0x16')](_0x72d1('0x2b'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2c')]);router['put'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2d')]);router['delete'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller['destroy']);module[_0x72d1('0x2e')]=router; \ No newline at end of file +var _0xb4c7=['diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','/upload','upload','import','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','describe','isAuthenticated','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/merge','merge','post','create','/create_many','bulkCreate'];(function(_0x28e388,_0x5ed424){var _0x45cb01=function(_0x317098){while(--_0x317098){_0x28e388['push'](_0x28e388['shift']());}};_0x45cb01(++_0x5ed424);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x45c9bd,_0x34a819){_0x45c9bd=_0x45c9bd-0x0;var _0xdf438f=_0xb4c7[_0x45c9bd];return _0xdf438f;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var auth=require(_0x7b4c('0x5'));var interaction=require(_0x7b4c('0x6'));var config=require(_0x7b4c('0x7'));var controller=require(_0x7b4c('0x8'));router[_0x7b4c('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xa')]);router[_0x7b4c('0x9')](_0x7b4c('0xb'),auth['isAuthenticated'](),controller[_0x7b4c('0xc')]);router[_0x7b4c('0x9')]('/:id',auth[_0x7b4c('0xd')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0x9')](_0x7b4c('0xf'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x10')]);router[_0x7b4c('0x9')](_0x7b4c('0x11'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x12')]);router['get']('/:id/hopper_histories',auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x9')](_0x7b4c('0x14'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x15')]);router[_0x7b4c('0x9')](_0x7b4c('0x16'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x17')]);router['post'](_0x7b4c('0x18'),auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x19')]);router[_0x7b4c('0x1a')]('/',auth[_0x7b4c('0xd')](),controller[_0x7b4c('0x1b')]);router[_0x7b4c('0x1a')](_0x7b4c('0x1c'),auth['isAuthenticated'](),controller[_0x7b4c('0x1d')]);router[_0x7b4c('0x1a')](_0x7b4c('0xf'),auth[_0x7b4c('0xd')](),controller['setTags']);var upload=multer({'storage':multer[_0x7b4c('0x1e')]({'destination':function(_0x3d314d,_0x32110e,_0x380b79){_0x380b79(null,path[_0x7b4c('0x1f')](config[_0x7b4c('0x20')],_0x7b4c('0x21')));},'filename':function(_0x445281,_0x3556d8,_0x55e3df){_0x3556d8[_0x7b4c('0x22')]=_0x3556d8[_0x7b4c('0x22')][_0x7b4c('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x55e3df(null,util[_0x7b4c('0x24')](_0x7b4c('0x25'),path[_0x7b4c('0x26')](_0x3556d8[_0x7b4c('0x22')],path[_0x7b4c('0x27')](_0x3556d8[_0x7b4c('0x22')])),Date[_0x7b4c('0x28')](),path['extname'](_0x3556d8[_0x7b4c('0x22')])));}})});router[_0x7b4c('0x1a')](_0x7b4c('0x29'),upload[_0x7b4c('0x2a')](_0x7b4c('0x2b')),controller[_0x7b4c('0x2c')]);var upload=multer({'storage':multer[_0x7b4c('0x1e')]({'destination':function(_0x459eb4,_0x1f311e,_0x1a69db){_0x1a69db(null,path[_0x7b4c('0x1f')](config[_0x7b4c('0x20')],_0x7b4c('0x21')));},'filename':function(_0x501f75,_0x27f361,_0x3ab614){_0x27f361[_0x7b4c('0x22')]=_0x27f361[_0x7b4c('0x22')][_0x7b4c('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ab614(null,util[_0x7b4c('0x24')](_0x7b4c('0x25'),path[_0x7b4c('0x26')](_0x27f361[_0x7b4c('0x22')],path[_0x7b4c('0x27')](_0x27f361[_0x7b4c('0x22')])),Date[_0x7b4c('0x28')](),path[_0x7b4c('0x27')](_0x27f361[_0x7b4c('0x22')])));}})});router[_0x7b4c('0x1a')](_0x7b4c('0x2d'),upload[_0x7b4c('0x2a')](_0x7b4c('0x2b')),controller[_0x7b4c('0x2e')]);router['post']('/upload/:id',auth['isAuthenticated'](),controller[_0x7b4c('0x2f')]);router[_0x7b4c('0x30')](_0x7b4c('0x31'),auth[_0x7b4c('0xd')](),controller['update']);router[_0x7b4c('0x32')](_0x7b4c('0x31'),auth['isAuthenticated'](),controller[_0x7b4c('0x33')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 1a68224..c999aa0 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 _0xd802=['STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','exports','VIRTUAL','getDataValue','alias'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd802,0x10b));var _0x2d80=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0xd802[_0x9fb081];return _0x43f8b0;};'use strict';var Sequelize=require(_0x2d80('0x0'));var _=require('lodash');module[_0x2d80('0x1')]={'name':{'type':Sequelize[_0x2d80('0x2')],'get':function(_0x4dbc96){return this[_0x2d80('0x3')](_0x2d80('0x4'));}},'alias':{'type':Sequelize[_0x2d80('0x5')],'allowNull':![],'set':function(_0x4370a9){this[_0x2d80('0x6')](_0x2d80('0x4'),_0x4370a9?_0x4370a9:this[_0x2d80('0x3')](_0x2d80('0x7')));}},'type':{'type':Sequelize[_0x2d80('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x2d80('0x8')](_0x2d80('0x9')),'get':function(){if(this[_0x2d80('0x3')](_0x2d80('0xa'))===_0x2d80('0xb')){return JSON[_0x2d80('0xc')](this[_0x2d80('0x3')](_0x2d80('0xd')));}else{return this[_0x2d80('0x3')](_0x2d80('0xd'));}},'set':function(_0x48b355){if(Array[_0x2d80('0xe')](_0x48b355)){this[_0x2d80('0x6')](_0x2d80('0xd'),JSON[_0x2d80('0xf')](_0x48b355));}else{this[_0x2d80('0x6')](_0x2d80('0xd'),_0x48b355);}}},'required':{'type':Sequelize[_0x2d80('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb04=['getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL'];(function(_0x461a6e,_0x11dfeb){var _0x336db4=function(_0x53f85b){while(--_0x53f85b){_0x461a6e['push'](_0x461a6e['shift']());}};_0x336db4(++_0x11dfeb);}(_0xfb04,0x6c));var _0x4fb0=function(_0x327c52,_0x467df6){_0x327c52=_0x327c52-0x0;var _0x59e28c=_0xfb04[_0x327c52];return _0x59e28c;};'use strict';var Sequelize=require(_0x4fb0('0x0'));var _=require(_0x4fb0('0x1'));module[_0x4fb0('0x2')]={'name':{'type':Sequelize[_0x4fb0('0x3')],'get':function(_0x323de6){return this[_0x4fb0('0x4')](_0x4fb0('0x5'));}},'alias':{'type':Sequelize[_0x4fb0('0x6')],'allowNull':![],'set':function(_0x5bb841){this[_0x4fb0('0x7')](_0x4fb0('0x5'),_0x5bb841?_0x5bb841:this[_0x4fb0('0x4')]('name'));}},'type':{'type':Sequelize[_0x4fb0('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x4fb0('0x8')](_0x4fb0('0x9')),'get':function(){if(this['getDataValue'](_0x4fb0('0xa'))===_0x4fb0('0xb')){return JSON['parse'](this[_0x4fb0('0x4')](_0x4fb0('0xc')));}else{return this['getDataValue'](_0x4fb0('0xc'));}},'set':function(_0xe43813){if(Array[_0x4fb0('0xd')](_0xe43813)){this[_0x4fb0('0x7')](_0x4fb0('0xc'),JSON[_0x4fb0('0xe')](_0xe43813));}else{this[_0x4fb0('0x7')]('values',_0xe43813);}}},'required':{'type':Sequelize[_0x4fb0('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 f8954fa..43b1dda 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 _0x6215=['mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','stack','map','rawAttributes','type','name','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','CmCustomField','count','includeAll','include','findAll','rows','show','catch','body','find','params','sequelize','transaction','create','text','TEXT','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x6215,0x19e));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5621('0x1'));var jsonpatch=require(_0x5621('0x2'));var rp=require(_0x5621('0x3'));var moment=require(_0x5621('0x4'));var BPromise=require(_0x5621('0x5'));var Mustache=require(_0x5621('0x6'));var util=require('util');var path=require(_0x5621('0x7'));var sox=require(_0x5621('0x8'));var csv=require('to-csv');var ejs=require(_0x5621('0x9'));var fs=require('fs');var _=require(_0x5621('0xa'));var squel=require('squel');var crypto=require(_0x5621('0xb'));var jsforce=require(_0x5621('0xc'));var deskjs=require(_0x5621('0xd'));var toCsv=require(_0x5621('0xe'));var querystring=require(_0x5621('0xf'));var Papa=require(_0x5621('0x10'));var Redis=require('ioredis');var authService=require(_0x5621('0x11'));var qs=require(_0x5621('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5621('0x13'));var logger=require(_0x5621('0x14'))(_0x5621('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5621('0x16'))['db'];function respondWithStatusCode(_0x1ad3c6,_0x560e84){_0x560e84=_0x560e84||0xcc;return function(_0xef6013){if(_0xef6013){return _0x1ad3c6[_0x5621('0x17')](_0x560e84);}return _0x1ad3c6['status'](_0x560e84)[_0x5621('0x18')]();};}function respondWithResult(_0x34e350,_0x34a1c1){_0x34a1c1=_0x34a1c1||0xc8;return function(_0x3bdd75){if(_0x3bdd75){return _0x34e350[_0x5621('0x19')](_0x34a1c1)[_0x5621('0x1a')](_0x3bdd75);}};}function respondWithFilteredResult(_0x360e2a,_0x545003){return function(_0x5b0ef0){if(_0x5b0ef0){var _0x37a308=_0x5b0ef0['count'],_0x2d73b3=_0x545003['offset'],_0x3747bd=_0x545003[_0x5621('0x1b')]+_0x545003[_0x5621('0x1c')],_0xbfa5e6;if(_0x3747bd>=_0x37a308){_0x3747bd=_0x37a308;_0xbfa5e6=0xc8;}else{_0xbfa5e6=0xce;}_0x360e2a[_0x5621('0x19')](_0xbfa5e6);return _0x360e2a[_0x5621('0x1d')](_0x5621('0x1e'),_0x2d73b3+'-'+_0x3747bd+'/'+_0x37a308)[_0x5621('0x1a')](_0x5b0ef0);}return null;};}function patchUpdates(_0x2922a5){return function(_0x5ad788){try{jsonpatch['apply'](_0x5ad788,_0x2922a5,!![]);}catch(_0x51a6cb){return BPromise[_0x5621('0x1f')](_0x51a6cb);}return _0x5ad788[_0x5621('0x20')]();};}function saveUpdates(_0x371a73,_0x2d4f5a){return function(_0x1843d2){if(_0x1843d2){return _0x1843d2[_0x5621('0x21')](_0x371a73)[_0x5621('0x22')](function(_0x64a41b){return _0x64a41b;});}return null;};}function removeEntity(_0x5ba75a,_0x219044){return function(_0x14b786){if(_0x14b786){return _0x14b786['destroy']()['then'](function(){_0x5ba75a[_0x5621('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12088b,_0x3446bd){return function(_0x19ea8d){if(!_0x19ea8d){_0x12088b[_0x5621('0x17')](0x194);}return _0x19ea8d;};}function handleError(_0x5a546a,_0x1444eb){_0x1444eb=_0x1444eb||0x1f4;return function(_0x1111ad){logger['error'](_0x1111ad[_0x5621('0x23')]);if(_0x1111ad['name']){delete _0x1111ad['name'];}_0x5a546a[_0x5621('0x19')](_0x1444eb)['send'](_0x1111ad);};}exports['index']=function(_0x591194,_0x1d0ce6){var _0x2694b7={},_0x22e97f={},_0x37be5d={'count':0x0,'rows':[]};var _0x588e43=_[_0x5621('0x24')](db['CmCustomField'][_0x5621('0x25')],function(_0x57294a){return{'name':_0x57294a['fieldName'],'type':_0x57294a[_0x5621('0x26')]['key']};});_0x22e97f['model']=_['differenceBy'](_[_0x5621('0x24')](_0x588e43,_0x5621('0x27')),['name']);_0x22e97f[_0x5621('0x28')]=_[_0x5621('0x29')](_0x591194[_0x5621('0x28')]);_0x22e97f['filters']=_['intersection'](_0x22e97f['model'],_0x22e97f[_0x5621('0x28')]);_0x2694b7[_0x5621('0x2a')]=_[_0x5621('0x2b')](_0x22e97f[_0x5621('0x2c')],qs['fields'](_0x591194[_0x5621('0x28')][_0x5621('0x2d')]));_0x2694b7[_0x5621('0x2a')]=_0x2694b7[_0x5621('0x2a')][_0x5621('0x2e')]?_0x2694b7['attributes']:_0x22e97f[_0x5621('0x2c')];if(!_0x591194[_0x5621('0x28')][_0x5621('0x2f')](_0x5621('0x30'))){_0x2694b7['limit']=qs[_0x5621('0x1c')](_0x591194[_0x5621('0x28')][_0x5621('0x1c')]);_0x2694b7[_0x5621('0x1b')]=qs['offset'](_0x591194[_0x5621('0x28')]['offset']);}_0x2694b7[_0x5621('0x31')]=qs[_0x5621('0x32')](_0x591194[_0x5621('0x28')][_0x5621('0x32')]);_0x2694b7[_0x5621('0x33')]=qs['filters'](_[_0x5621('0x34')](_0x591194[_0x5621('0x28')],_0x22e97f[_0x5621('0x35')]),_0x588e43);if(_0x591194[_0x5621('0x28')]['filter']){_0x2694b7['where']=_[_0x5621('0x36')](_0x2694b7[_0x5621('0x33')],{'$or':_[_0x5621('0x24')](_0x588e43,function(_0x2b907d){if(_0x2b907d[_0x5621('0x26')]!==_0x5621('0x37')){var _0x78e692={};_0x78e692[_0x2b907d['name']]={'$like':'%'+_0x591194[_0x5621('0x28')][_0x5621('0x38')]+'%'};return _0x78e692;}})});}_0x2694b7=_[_0x5621('0x36')]({},_0x2694b7,_0x591194[_0x5621('0x39')]);var _0x39f6de={'where':_0x2694b7[_0x5621('0x33')]};return db[_0x5621('0x3a')][_0x5621('0x3b')](_0x39f6de)[_0x5621('0x22')](function(_0x42d2fb){_0x37be5d[_0x5621('0x3b')]=_0x42d2fb;if(_0x591194[_0x5621('0x28')][_0x5621('0x3c')]){_0x2694b7[_0x5621('0x3d')]=[{'all':!![]}];}return db[_0x5621('0x3a')][_0x5621('0x3e')](_0x2694b7);})[_0x5621('0x22')](function(_0x53dcdd){_0x37be5d[_0x5621('0x3f')]=_0x53dcdd;return _0x37be5d;})[_0x5621('0x22')](respondWithFilteredResult(_0x1d0ce6,_0x2694b7))['catch'](handleError(_0x1d0ce6,null));};exports[_0x5621('0x40')]=function(_0x402f1e,_0x195768){var _0x439b5e={'raw':!![],'where':{'id':_0x402f1e['params']['id']}},_0x1d7d14={};_0x1d7d14[_0x5621('0x2c')]=_['keys'](db[_0x5621('0x3a')][_0x5621('0x25')]);_0x1d7d14[_0x5621('0x28')]=_[_0x5621('0x29')](_0x402f1e[_0x5621('0x28')]);_0x1d7d14[_0x5621('0x35')]=_[_0x5621('0x2b')](_0x1d7d14[_0x5621('0x2c')],_0x1d7d14['query']);_0x439b5e['attributes']=_[_0x5621('0x2b')](_0x1d7d14['model'],qs[_0x5621('0x2d')](_0x402f1e[_0x5621('0x28')][_0x5621('0x2d')]));_0x439b5e[_0x5621('0x2a')]=_0x439b5e['attributes'][_0x5621('0x2e')]?_0x439b5e['attributes']:_0x1d7d14[_0x5621('0x2c')];if(_0x402f1e[_0x5621('0x28')]['includeAll']){_0x439b5e[_0x5621('0x3d')]=[{'all':!![]}];}_0x439b5e=_['merge']({},_0x439b5e,_0x402f1e[_0x5621('0x39')]);return db[_0x5621('0x3a')]['find'](_0x439b5e)[_0x5621('0x22')](handleEntityNotFound(_0x195768,null))[_0x5621('0x22')](respondWithResult(_0x195768,null))[_0x5621('0x41')](handleError(_0x195768,null));};exports['update']=function(_0x4c289d,_0x4b05d6){if(_0x4c289d[_0x5621('0x42')]['id']){delete _0x4c289d['body']['id'];}return db['CmCustomField'][_0x5621('0x43')]({'where':{'id':_0x4c289d[_0x5621('0x44')]['id']}})[_0x5621('0x22')](handleEntityNotFound(_0x4b05d6,null))['then'](saveUpdates(_0x4c289d[_0x5621('0x42')],null))[_0x5621('0x22')](respondWithResult(_0x4b05d6,null))[_0x5621('0x41')](handleError(_0x4b05d6,null));};exports['destroy']=function(_0x28fa45,_0x35d68f){return db[_0x5621('0x3a')][_0x5621('0x43')]({'where':{'id':_0x28fa45['params']['id']}})[_0x5621('0x22')](handleEntityNotFound(_0x35d68f,null))[_0x5621('0x22')](removeEntity(_0x35d68f,null))[_0x5621('0x41')](handleError(_0x35d68f,null));};exports['create']=function(_0x2241ac,_0x4e8698){var _0x3db1a4;return db[_0x5621('0x45')][_0x5621('0x46')](function(_0xb04d1a){return db[_0x5621('0x3a')][_0x5621('0x47')](_0x2241ac[_0x5621('0x42')],{'transaction':_0xb04d1a})[_0x5621('0x22')](function(_0x42cdbe){_0x3db1a4=_0x42cdbe;var _0x56e6a3={'type':db['Sequelize']['TEXT'],'transaction':_0xb04d1a};switch(_0x2241ac[_0x5621('0x42')]['type']){case _0x5621('0x48'):_0x56e6a3[_0x5621('0x26')]=db['Sequelize'][_0x5621('0x49')];break;case _0x5621('0x4a'):_0x56e6a3['type']=db[_0x5621('0x4b')][_0x5621('0x4c')];break;case _0x5621('0x4d'):_0x56e6a3['type']=db[_0x5621('0x4b')][_0x5621('0x4e')];_0x56e6a3[_0x5621('0x4f')]=![];break;default:}return db[_0x5621('0x45')]['queryInterface'][_0x5621('0x50')](_0x5621('0x51'),util[_0x5621('0x52')](_0x5621('0x53'),_0x3db1a4['id']),_0x56e6a3);})['then'](function(){return _0x3db1a4;});})['then'](respondWithResult(_0x4e8698,0xc9))['catch'](handleError(_0x4e8698,null));}; \ No newline at end of file +var _0x1a95=['key','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','CmCustomField','includeAll','rows','catch','show','rawAttributes','include','options','find','body','params','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','fieldName','type'];(function(_0x79c52f,_0x5bd9d3){var _0x37f2a8=function(_0x53d6f2){while(--_0x53d6f2){_0x79c52f['push'](_0x79c52f['shift']());}};_0x37f2a8(++_0x5bd9d3);}(_0x1a95,0x12f));var _0x51a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a95[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x51a9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x51a9('0x1'));var zipdir=require(_0x51a9('0x2'));var jsonpatch=require(_0x51a9('0x3'));var rp=require(_0x51a9('0x4'));var moment=require(_0x51a9('0x5'));var BPromise=require(_0x51a9('0x6'));var Mustache=require('mustache');var util=require(_0x51a9('0x7'));var path=require(_0x51a9('0x8'));var sox=require(_0x51a9('0x9'));var csv=require(_0x51a9('0xa'));var ejs=require(_0x51a9('0xb'));var fs=require('fs');var _=require(_0x51a9('0xc'));var squel=require(_0x51a9('0xd'));var crypto=require(_0x51a9('0xe'));var jsforce=require(_0x51a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x51a9('0xa'));var querystring=require(_0x51a9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51a9('0x11'));var as=require(_0x51a9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x51a9('0x13'));var utils=require(_0x51a9('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x686093,_0x3b4921){_0x3b4921=_0x3b4921||0xcc;return function(_0x5501b9){if(_0x5501b9){return _0x686093[_0x51a9('0x15')](_0x3b4921);}return _0x686093[_0x51a9('0x16')](_0x3b4921)[_0x51a9('0x17')]();};}function respondWithResult(_0x3e8c4a,_0x51f4ba){_0x51f4ba=_0x51f4ba||0xc8;return function(_0x354111){if(_0x354111){return _0x3e8c4a[_0x51a9('0x16')](_0x51f4ba)[_0x51a9('0x18')](_0x354111);}};}function respondWithFilteredResult(_0x141768,_0x28397f){return function(_0x16c157){if(_0x16c157){var _0x344198=_0x16c157[_0x51a9('0x19')],_0x194f35=_0x28397f[_0x51a9('0x1a')],_0x412eb6=_0x28397f[_0x51a9('0x1a')]+_0x28397f['limit'],_0x1e7510;if(_0x412eb6>=_0x344198){_0x412eb6=_0x344198;_0x1e7510=0xc8;}else{_0x1e7510=0xce;}_0x141768[_0x51a9('0x16')](_0x1e7510);return _0x141768[_0x51a9('0x1b')](_0x51a9('0x1c'),_0x194f35+'-'+_0x412eb6+'/'+_0x344198)['json'](_0x16c157);}return null;};}function patchUpdates(_0x55ad68){return function(_0x5f28b0){try{jsonpatch['apply'](_0x5f28b0,_0x55ad68,!![]);}catch(_0x18a8ab){return BPromise[_0x51a9('0x1d')](_0x18a8ab);}return _0x5f28b0[_0x51a9('0x1e')]();};}function saveUpdates(_0x244d8,_0x1b8947){return function(_0x45a81){if(_0x45a81){return _0x45a81[_0x51a9('0x1f')](_0x244d8)[_0x51a9('0x20')](function(_0x1ef91c){return _0x1ef91c;});}return null;};}function removeEntity(_0x27f892,_0x404b65){return function(_0x4f2ab3){if(_0x4f2ab3){return _0x4f2ab3[_0x51a9('0x21')]()[_0x51a9('0x20')](function(){_0x27f892[_0x51a9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53762c,_0x4eb51b){return function(_0x5248fc){if(!_0x5248fc){_0x53762c[_0x51a9('0x15')](0x194);}return _0x5248fc;};}function handleError(_0x10d50b,_0x3d2c79){_0x3d2c79=_0x3d2c79||0x1f4;return function(_0x51e46e){logger[_0x51a9('0x22')](_0x51e46e[_0x51a9('0x23')]);if(_0x51e46e['name']){delete _0x51e46e['name'];}_0x10d50b[_0x51a9('0x16')](_0x3d2c79)[_0x51a9('0x24')](_0x51e46e);};}exports[_0x51a9('0x25')]=function(_0x352d9e,_0x31dd4f){var _0x572a08={},_0x401633={},_0x3e8b92={'count':0x0,'rows':[]};var _0x43cf8c=_[_0x51a9('0x26')](db['CmCustomField']['rawAttributes'],function(_0x27c070){return{'name':_0x27c070[_0x51a9('0x27')],'type':_0x27c070[_0x51a9('0x28')][_0x51a9('0x29')]};});_0x401633[_0x51a9('0x2a')]=_[_0x51a9('0x2b')](_[_0x51a9('0x26')](_0x43cf8c,_0x51a9('0x2c')),[_0x51a9('0x2c')]);_0x401633[_0x51a9('0x2d')]=_[_0x51a9('0x2e')](_0x352d9e[_0x51a9('0x2d')]);_0x401633[_0x51a9('0x2f')]=_[_0x51a9('0x30')](_0x401633[_0x51a9('0x2a')],_0x401633[_0x51a9('0x2d')]);_0x572a08[_0x51a9('0x31')]=_[_0x51a9('0x30')](_0x401633[_0x51a9('0x2a')],qs[_0x51a9('0x32')](_0x352d9e[_0x51a9('0x2d')][_0x51a9('0x32')]));_0x572a08['attributes']=_0x572a08['attributes'][_0x51a9('0x33')]?_0x572a08['attributes']:_0x401633[_0x51a9('0x2a')];if(!_0x352d9e[_0x51a9('0x2d')][_0x51a9('0x34')](_0x51a9('0x35'))){_0x572a08[_0x51a9('0x36')]=qs[_0x51a9('0x36')](_0x352d9e['query']['limit']);_0x572a08[_0x51a9('0x1a')]=qs['offset'](_0x352d9e['query']['offset']);}_0x572a08[_0x51a9('0x37')]=qs[_0x51a9('0x38')](_0x352d9e[_0x51a9('0x2d')][_0x51a9('0x38')]);_0x572a08[_0x51a9('0x39')]=qs['filters'](_[_0x51a9('0x3a')](_0x352d9e[_0x51a9('0x2d')],_0x401633['filters']),_0x43cf8c);if(_0x352d9e['query'][_0x51a9('0x3b')]){_0x572a08[_0x51a9('0x39')]=_[_0x51a9('0x3c')](_0x572a08[_0x51a9('0x39')],{'$or':_[_0x51a9('0x26')](_0x43cf8c,function(_0x518d56){if(_0x518d56[_0x51a9('0x28')]!=='VIRTUAL'){var _0x1f85f5={};_0x1f85f5[_0x518d56[_0x51a9('0x2c')]]={'$like':'%'+_0x352d9e[_0x51a9('0x2d')][_0x51a9('0x3b')]+'%'};return _0x1f85f5;}})});}_0x572a08=_[_0x51a9('0x3c')]({},_0x572a08,_0x352d9e['options']);var _0x4d038c={'where':_0x572a08[_0x51a9('0x39')]};return db[_0x51a9('0x3d')][_0x51a9('0x19')](_0x4d038c)['then'](function(_0x24febd){_0x3e8b92[_0x51a9('0x19')]=_0x24febd;if(_0x352d9e[_0x51a9('0x2d')][_0x51a9('0x3e')]){_0x572a08['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x572a08);})[_0x51a9('0x20')](function(_0x1b18a3){_0x3e8b92[_0x51a9('0x3f')]=_0x1b18a3;return _0x3e8b92;})[_0x51a9('0x20')](respondWithFilteredResult(_0x31dd4f,_0x572a08))[_0x51a9('0x40')](handleError(_0x31dd4f,null));};exports[_0x51a9('0x41')]=function(_0x910d0b,_0xfc6507){var _0x2b47e4={'raw':!![],'where':{'id':_0x910d0b['params']['id']}},_0x11e262={};_0x11e262['model']=_[_0x51a9('0x2e')](db[_0x51a9('0x3d')][_0x51a9('0x42')]);_0x11e262[_0x51a9('0x2d')]=_[_0x51a9('0x2e')](_0x910d0b['query']);_0x11e262[_0x51a9('0x2f')]=_[_0x51a9('0x30')](_0x11e262[_0x51a9('0x2a')],_0x11e262[_0x51a9('0x2d')]);_0x2b47e4[_0x51a9('0x31')]=_[_0x51a9('0x30')](_0x11e262['model'],qs[_0x51a9('0x32')](_0x910d0b[_0x51a9('0x2d')][_0x51a9('0x32')]));_0x2b47e4[_0x51a9('0x31')]=_0x2b47e4[_0x51a9('0x31')][_0x51a9('0x33')]?_0x2b47e4[_0x51a9('0x31')]:_0x11e262[_0x51a9('0x2a')];if(_0x910d0b['query'][_0x51a9('0x3e')]){_0x2b47e4[_0x51a9('0x43')]=[{'all':!![]}];}_0x2b47e4=_[_0x51a9('0x3c')]({},_0x2b47e4,_0x910d0b[_0x51a9('0x44')]);return db['CmCustomField'][_0x51a9('0x45')](_0x2b47e4)[_0x51a9('0x20')](handleEntityNotFound(_0xfc6507,null))[_0x51a9('0x20')](respondWithResult(_0xfc6507,null))[_0x51a9('0x40')](handleError(_0xfc6507,null));};exports[_0x51a9('0x1f')]=function(_0x17817d,_0x2bca6c){if(_0x17817d[_0x51a9('0x46')]['id']){delete _0x17817d[_0x51a9('0x46')]['id'];}return db[_0x51a9('0x3d')][_0x51a9('0x45')]({'where':{'id':_0x17817d[_0x51a9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bca6c,null))[_0x51a9('0x20')](saveUpdates(_0x17817d[_0x51a9('0x46')],null))[_0x51a9('0x20')](respondWithResult(_0x2bca6c,null))['catch'](handleError(_0x2bca6c,null));};exports[_0x51a9('0x21')]=function(_0x6b0752,_0x558c9b){return db[_0x51a9('0x3d')][_0x51a9('0x45')]({'where':{'id':_0x6b0752[_0x51a9('0x47')]['id']}})[_0x51a9('0x20')](handleEntityNotFound(_0x558c9b,null))[_0x51a9('0x20')](removeEntity(_0x558c9b,null))[_0x51a9('0x40')](handleError(_0x558c9b,null));};exports[_0x51a9('0x48')]=function(_0x4bc69c,_0x2a0244){var _0x26c047;return db[_0x51a9('0x49')][_0x51a9('0x4a')](function(_0x20fc0b){return db[_0x51a9('0x3d')][_0x51a9('0x48')](_0x4bc69c['body'],{'transaction':_0x20fc0b})[_0x51a9('0x20')](function(_0x5eb357){_0x26c047=_0x5eb357;var _0x1caf6f={'type':db[_0x51a9('0x4b')][_0x51a9('0x4c')],'transaction':_0x20fc0b};switch(_0x4bc69c[_0x51a9('0x46')][_0x51a9('0x28')]){case'text':_0x1caf6f[_0x51a9('0x28')]=db['Sequelize'][_0x51a9('0x4c')];break;case _0x51a9('0x4d'):_0x1caf6f[_0x51a9('0x28')]=db['Sequelize'][_0x51a9('0x4e')];break;case _0x51a9('0x4f'):_0x1caf6f['type']=db[_0x51a9('0x4b')][_0x51a9('0x50')];_0x1caf6f['defaultValue']=![];break;default:}return db[_0x51a9('0x49')][_0x51a9('0x51')][_0x51a9('0x52')](_0x51a9('0x53'),util[_0x51a9('0x54')](_0x51a9('0x55'),_0x26c047['id']),_0x1caf6f);})[_0x51a9('0x20')](function(){return _0x26c047;});})[_0x51a9('0x20')](respondWithResult(_0x2a0244,0xc9))['catch'](handleError(_0x2a0244,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 4b2af3c..815b2f7 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 _0x4ea5=['./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x5460be,_0x871df3){var _0x3b18c4=function(_0x5d88e8){while(--_0x5d88e8){_0x5460be['push'](_0x5460be['shift']());}};_0x3b18c4(++_0x871df3);}(_0x4ea5,0xcb));var _0x54ea=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x4ea5[_0x38af48];return _0x445384;};'use strict';var _=require(_0x54ea('0x0'));var util=require('util');var logger=require(_0x54ea('0x1'))(_0x54ea('0x2'));var moment=require(_0x54ea('0x3'));var BPromise=require('bluebird');var rp=require(_0x54ea('0x4'));var fs=require('fs');var path=require(_0x54ea('0x5'));var rimraf=require('rimraf');var config=require(_0x54ea('0x6'));var attributes=require(_0x54ea('0x7'));module['exports']=function(_0x11941c,_0x396f28){return _0x11941c['define'](_0x54ea('0x8'),attributes,{'tableName':_0x54ea('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4844=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields'];(function(_0x3f5f84,_0x4302dc){var _0x410d8d=function(_0x26da28){while(--_0x26da28){_0x3f5f84['push'](_0x3f5f84['shift']());}};_0x410d8d(++_0x4302dc);}(_0x4844,0x6c));var _0x4484=function(_0x2e5fc7,_0x430dc2){_0x2e5fc7=_0x2e5fc7-0x0;var _0x3123e3=_0x4844[_0x2e5fc7];return _0x3123e3;};'use strict';var _=require(_0x4484('0x0'));var util=require(_0x4484('0x1'));var logger=require('../../config/logger')(_0x4484('0x2'));var moment=require('moment');var BPromise=require(_0x4484('0x3'));var rp=require(_0x4484('0x4'));var fs=require('fs');var path=require(_0x4484('0x5'));var rimraf=require(_0x4484('0x6'));var config=require(_0x4484('0x7'));var attributes=require(_0x4484('0x8'));module['exports']=function(_0x1761cc,_0x47fbfa){return _0x1761cc[_0x4484('0x9')](_0x4484('0xa'),attributes,{'tableName':_0x4484('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index f734778..0c7c832 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 _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0xa99357,_0x50ffad){var _0x111875=function(_0x4dce0c){while(--_0x4dce0c){_0xa99357['push'](_0xa99357['shift']());}};_0x111875(++_0x50ffad);}(_0xb821,0xa7));var _0x1b82=function(_0x23f741,_0x494b5f){_0x23f741=_0x23f741-0x0;var _0x2bda3d=_0xb821[_0x23f741];return _0x2bda3d;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +var _0x22fb=['CmCustomField,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5d1a13,_0x31af61){var _0x5b0304=function(_0x5e9991){while(--_0x5e9991){_0x5d1a13['push'](_0x5d1a13['shift']());}};_0x5b0304(++_0x31af61);}(_0x22fb,0x192));var _0xb22f=function(_0x452738,_0x336092){_0x452738=_0x452738-0x0;var _0x565eb4=_0x22fb[_0x452738];return _0x565eb4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('CmCustomField,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 06d01a5..90f5705 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 _0x7677=['update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0xebbd1e,_0xad74b4){var _0x25e2e5=function(_0x29ee2c){while(--_0x29ee2c){_0xebbd1e['push'](_0xebbd1e['shift']());}};_0x25e2e5(++_0xad74b4);}(_0x7677,0x18f));var _0x7767=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7677[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x7767('0x0'));var util=require('util');var path=require(_0x7767('0x1'));var timeout=require(_0x7767('0x2'));var express=require(_0x7767('0x3'));var router=express['Router']();var auth=require(_0x7767('0x4'));var interaction=require(_0x7767('0x5'));var config=require(_0x7767('0x6'));var controller=require(_0x7767('0x7'));router[_0x7767('0x8')]('/',auth[_0x7767('0x9')](),controller[_0x7767('0xa')]);router[_0x7767('0x8')]('/:id',auth[_0x7767('0x9')](),controller[_0x7767('0xb')]);router['post']('/',auth[_0x7767('0x9')](),controller[_0x7767('0xc')]);router[_0x7767('0xd')](_0x7767('0xe'),auth['isAuthenticated'](),controller[_0x7767('0xf')]);router[_0x7767('0x10')](_0x7767('0xe'),auth[_0x7767('0x9')](),controller['destroy']);module[_0x7767('0x11')]=router; \ No newline at end of file +var _0xf271=['update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x36ee93,_0x502135){var _0x2a936c=function(_0xb6659c){while(--_0xb6659c){_0x36ee93['push'](_0x36ee93['shift']());}};_0x2a936c(++_0x502135);}(_0xf271,0xff));var _0x1f27=function(_0x173375,_0x11809f){_0x173375=_0x173375-0x0;var _0x3ac760=_0xf271[_0x173375];return _0x3ac760;};'use strict';var multer=require(_0x1f27('0x0'));var util=require(_0x1f27('0x1'));var path=require('path');var timeout=require(_0x1f27('0x2'));var express=require(_0x1f27('0x3'));var router=express['Router']();var auth=require(_0x1f27('0x4'));var interaction=require(_0x1f27('0x5'));var config=require(_0x1f27('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x1f27('0x7')](),controller[_0x1f27('0x8')]);router[_0x1f27('0x9')](_0x1f27('0xa'),auth[_0x1f27('0x7')](),controller[_0x1f27('0xb')]);router[_0x1f27('0xc')]('/',auth['isAuthenticated'](),controller[_0x1f27('0xd')]);router[_0x1f27('0xe')](_0x1f27('0xa'),auth['isAuthenticated'](),controller[_0x1f27('0xf')]);router[_0x1f27('0x10')](_0x1f27('0xa'),auth[_0x1f27('0x7')](),controller[_0x1f27('0x11')]);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 0171ec0..eeba0bc 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 _0x2bd8=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format'];(function(_0x381874,_0x3f2356){var _0x1ba1d5=function(_0x339a00){while(--_0x339a00){_0x381874['push'](_0x381874['shift']());}};_0x1ba1d5(++_0x3f2356);}(_0x2bd8,0x130));var _0x82bd=function(_0x52b2e2,_0x3e6a1f){_0x52b2e2=_0x52b2e2-0x0;var _0x40c96e=_0x2bd8[_0x52b2e2];return _0x40c96e;};'use strict';var moment=require(_0x82bd('0x0'));var Sequelize=require('sequelize');module[_0x82bd('0x1')]={'phone':{'type':Sequelize[_0x82bd('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x82bd('0x4')],'defaultValue':moment()[_0x82bd('0x5')](_0x82bd('0x6'))},'countbusyretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x82bd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x82bd('0x7')](0x2)[_0x82bd('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x82bd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x82bd('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x82bd('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x82bd('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x82bd('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb66c=['DATE','format','INTEGER','UNSIGNED','contactListQueue','moment','exports','BOOLEAN'];(function(_0x3705f7,_0x2553c4){var _0x2a1cf2=function(_0x51f080){while(--_0x51f080){_0x3705f7['push'](_0x3705f7['shift']());}};_0x2a1cf2(++_0x2553c4);}(_0xb66c,0x175));var _0xcb66=function(_0xb235b9,_0x55271b){_0xb235b9=_0xb235b9-0x0;var _0x7fcb99=_0xb66c[_0xb235b9];return _0x7fcb99;};'use strict';var moment=require(_0xcb66('0x0'));var Sequelize=require('sequelize');module[_0xcb66('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xcb66('0x3')],'defaultValue':moment()[_0xcb66('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xcb66('0x5')](0x2)[_0xcb66('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcb66('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xcb66('0x5')],'unique':_0xcb66('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcb66('0x7')},'UserId':{'type':Sequelize[_0xcb66('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xcb66('0x5')],'unique':_0xcb66('0x7')},'CampaignId':{'type':Sequelize[_0xcb66('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcb66('0x5')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 78c86d9..2d2bed6 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 _0xc9d5=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','json','offset','Content-Range','save','then','end','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','intersection','query','filters','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$contained','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','update','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmList','List','Queue','dialActive','isNumber','getOpenContacts','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x1d6e31,_0x1c5921){var _0x249c60=function(_0x5dd68d){while(--_0x5dd68d){_0x1d6e31['push'](_0x1d6e31['shift']());}};_0x249c60(++_0x1c5921);}(_0xc9d5,0x19f));var _0x5c9d=function(_0x5cd9b9,_0x40d591){_0x5cd9b9=_0x5cd9b9-0x0;var _0x5cc187=_0xc9d5[_0x5cd9b9];return _0x5cc187;};'use strict';var pdf=require(_0x5c9d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5c9d('0x1'));var zipdir=require(_0x5c9d('0x2'));var jsonpatch=require(_0x5c9d('0x3'));var rp=require(_0x5c9d('0x4'));var moment=require(_0x5c9d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c9d('0x6'));var path=require(_0x5c9d('0x7'));var sox=require(_0x5c9d('0x8'));var csv=require(_0x5c9d('0x9'));var ejs=require(_0x5c9d('0xa'));var fs=require('fs');var _=require(_0x5c9d('0xb'));var squel=require('squel');var crypto=require(_0x5c9d('0xc'));var jsforce=require(_0x5c9d('0xd'));var deskjs=require(_0x5c9d('0xe'));var toCsv=require(_0x5c9d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c9d('0xf'));var authService=require(_0x5c9d('0x10'));var qs=require(_0x5c9d('0x11'));var as=require(_0x5c9d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c9d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5c9d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45668e,_0xccd7ce){_0xccd7ce=_0xccd7ce||0xcc;return function(_0x47a9a4){if(_0x47a9a4){return _0x45668e[_0x5c9d('0x15')](_0xccd7ce);}return _0x45668e[_0x5c9d('0x16')](_0xccd7ce)['end']();};}function respondWithResult(_0x3aad05,_0x2e97b1){_0x2e97b1=_0x2e97b1||0xc8;return function(_0x11838d){if(_0x11838d){return _0x3aad05[_0x5c9d('0x16')](_0x2e97b1)[_0x5c9d('0x17')](_0x11838d);}};}function respondWithFilteredResult(_0xbd1215,_0x21a0e2){return function(_0x49ecf0){if(_0x49ecf0){var _0xe2df3c=_0x49ecf0['count'],_0xbfd873=_0x21a0e2[_0x5c9d('0x18')],_0xb5a221=_0x21a0e2[_0x5c9d('0x18')]+_0x21a0e2['limit'],_0x5b22f1;if(_0xb5a221>=_0xe2df3c){_0xb5a221=_0xe2df3c;_0x5b22f1=0xc8;}else{_0x5b22f1=0xce;}_0xbd1215[_0x5c9d('0x16')](_0x5b22f1);return _0xbd1215['set'](_0x5c9d('0x19'),_0xbfd873+'-'+_0xb5a221+'/'+_0xe2df3c)['json'](_0x49ecf0);}return null;};}function patchUpdates(_0x5dbf73){return function(_0x403ae5){try{jsonpatch['apply'](_0x403ae5,_0x5dbf73,!![]);}catch(_0x8eef54){return BPromise['reject'](_0x8eef54);}return _0x403ae5[_0x5c9d('0x1a')]();};}function saveUpdates(_0x39e255,_0xbe8125){return function(_0x1936bb){if(_0x1936bb){return _0x1936bb['update'](_0x39e255)[_0x5c9d('0x1b')](function(_0x4d5b88){return _0x4d5b88;});}return null;};}function removeEntity(_0x27fb24,_0x227e8e){return function(_0x24e639){if(_0x24e639){return _0x24e639['destroy']()[_0x5c9d('0x1b')](function(){_0x27fb24[_0x5c9d('0x16')](0xcc)[_0x5c9d('0x1c')]();});}};}function handleEntityNotFound(_0x3c456d,_0x1d4891){return function(_0x3fdc7a){if(!_0x3fdc7a){_0x3c456d[_0x5c9d('0x15')](0x194);}return _0x3fdc7a;};}function handleError(_0x2d8ae9,_0x450884){_0x450884=_0x450884||0x1f4;return function(_0x39480b){logger[_0x5c9d('0x1d')](_0x39480b[_0x5c9d('0x1e')]);if(_0x39480b[_0x5c9d('0x1f')]){delete _0x39480b[_0x5c9d('0x1f')];}_0x2d8ae9['status'](_0x450884)[_0x5c9d('0x20')](_0x39480b);};}exports[_0x5c9d('0x21')]=function(_0x28ee6a,_0x2ba9e8){var _0x1f3e4a={},_0x527208={},_0x51dd37={'count':0x0,'rows':[]};var _0x3d210d=_[_0x5c9d('0x22')](db[_0x5c9d('0x23')][_0x5c9d('0x24')],function(_0x25dd2d){return{'name':_0x25dd2d[_0x5c9d('0x25')],'type':_0x25dd2d[_0x5c9d('0x26')][_0x5c9d('0x27')]};});_0x527208[_0x5c9d('0x28')]=_[_0x5c9d('0x22')](_0x3d210d,_0x5c9d('0x1f'));_0x527208['query']=_[_0x5c9d('0x29')](_0x28ee6a['query']);_0x527208['filters']=_[_0x5c9d('0x2a')](_0x527208[_0x5c9d('0x28')],_0x527208[_0x5c9d('0x2b')]);_0x527208[_0x5c9d('0x2c')]=_[_0x5c9d('0x2d')](_0x527208[_0x5c9d('0x2c')],['$and',_0x5c9d('0x2e'),_0x5c9d('0x2f'),_0x5c9d('0x30'),_0x5c9d('0x31'),_0x5c9d('0x32'),_0x5c9d('0x33'),_0x5c9d('0x34'),'$not',_0x5c9d('0x35'),_0x5c9d('0x36'),_0x5c9d('0x37'),'$notIn','$like',_0x5c9d('0x38'),_0x5c9d('0x39'),_0x5c9d('0x3a'),_0x5c9d('0x3b'),'$overlap','$contains',_0x5c9d('0x3c'),'$any']);_0x1f3e4a[_0x5c9d('0x3d')]=_[_0x5c9d('0x2a')](_0x527208[_0x5c9d('0x28')],qs['fields'](_0x28ee6a[_0x5c9d('0x2b')]['fields']));_0x1f3e4a[_0x5c9d('0x3d')]=_0x1f3e4a[_0x5c9d('0x3d')][_0x5c9d('0x3e')]?_0x1f3e4a[_0x5c9d('0x3d')]:_0x527208[_0x5c9d('0x28')];if(!_0x28ee6a['query'][_0x5c9d('0x3f')](_0x5c9d('0x40'))){_0x1f3e4a[_0x5c9d('0x41')]=qs[_0x5c9d('0x41')](_0x28ee6a[_0x5c9d('0x2b')][_0x5c9d('0x41')]);_0x1f3e4a['offset']=qs[_0x5c9d('0x18')](_0x28ee6a[_0x5c9d('0x2b')][_0x5c9d('0x18')]);}_0x1f3e4a[_0x5c9d('0x42')]=qs[_0x5c9d('0x43')](_0x28ee6a[_0x5c9d('0x2b')]['sort']);_0x1f3e4a[_0x5c9d('0x44')]=qs[_0x5c9d('0x2c')](_['pick'](_0x28ee6a['query'],_0x527208['filters']),_0x3d210d);if(_0x28ee6a[_0x5c9d('0x2b')][_0x5c9d('0x45')]){_0x1f3e4a['where']=_[_0x5c9d('0x46')](_0x1f3e4a[_0x5c9d('0x44')],{'$or':_[_0x5c9d('0x22')](_0x3d210d,function(_0x454172){if(_0x454172[_0x5c9d('0x26')]!==_0x5c9d('0x47')){var _0x3bd0a8={};_0x3bd0a8[_0x454172[_0x5c9d('0x1f')]]={'$like':'%'+_0x28ee6a[_0x5c9d('0x2b')][_0x5c9d('0x45')]+'%'};return _0x3bd0a8;}})});}_0x1f3e4a=_[_0x5c9d('0x46')]({},_0x1f3e4a,_0x28ee6a['options']);var _0x3cb457={'where':_0x1f3e4a[_0x5c9d('0x44')]};return db[_0x5c9d('0x23')]['count'](_0x3cb457)['then'](function(_0x37200c){_0x51dd37[_0x5c9d('0x48')]=_0x37200c;if(_0x28ee6a[_0x5c9d('0x2b')][_0x5c9d('0x49')]){_0x1f3e4a[_0x5c9d('0x4a')]=[{'all':!![]}];}return db[_0x5c9d('0x23')][_0x5c9d('0x4b')](_0x1f3e4a);})[_0x5c9d('0x1b')](function(_0x21d0ec){_0x51dd37[_0x5c9d('0x4c')]=_0x21d0ec;return _0x51dd37;})[_0x5c9d('0x1b')](respondWithFilteredResult(_0x2ba9e8,_0x1f3e4a))[_0x5c9d('0x4d')](handleError(_0x2ba9e8,null));};exports[_0x5c9d('0x4e')]=function(_0x2bac9e,_0x2fa749){var _0x26e13e={'raw':!![],'where':{'id':_0x2bac9e[_0x5c9d('0x4f')]['id']}},_0x272921={};_0x272921[_0x5c9d('0x28')]=_[_0x5c9d('0x29')](db[_0x5c9d('0x23')][_0x5c9d('0x24')]);_0x272921['query']=_['keys'](_0x2bac9e[_0x5c9d('0x2b')]);_0x272921[_0x5c9d('0x2c')]=_['intersection'](_0x272921[_0x5c9d('0x28')],_0x272921['query']);_0x26e13e[_0x5c9d('0x3d')]=_[_0x5c9d('0x2a')](_0x272921[_0x5c9d('0x28')],qs[_0x5c9d('0x50')](_0x2bac9e[_0x5c9d('0x2b')]['fields']));_0x26e13e[_0x5c9d('0x3d')]=_0x26e13e['attributes'][_0x5c9d('0x3e')]?_0x26e13e['attributes']:_0x272921[_0x5c9d('0x28')];if(_0x2bac9e['query'][_0x5c9d('0x49')]){_0x26e13e[_0x5c9d('0x4a')]=[{'all':!![]}];}_0x26e13e=_[_0x5c9d('0x46')]({},_0x26e13e,_0x2bac9e[_0x5c9d('0x51')]);return db[_0x5c9d('0x23')][_0x5c9d('0x52')](_0x26e13e)['then'](handleEntityNotFound(_0x2fa749,null))['then'](respondWithResult(_0x2fa749,null))[_0x5c9d('0x4d')](handleError(_0x2fa749,null));};exports['create']=function(_0x17f314,_0x20e25c){return db[_0x5c9d('0x23')][_0x5c9d('0x53')](_0x17f314[_0x5c9d('0x54')],{})[_0x5c9d('0x1b')](respondWithResult(_0x20e25c,0xc9))[_0x5c9d('0x4d')](handleError(_0x20e25c,null));};exports[_0x5c9d('0x55')]=function(_0x1b055f,_0x32aecc){if(_0x1b055f['body']['id']){delete _0x1b055f['body']['id'];}return db[_0x5c9d('0x23')]['find']({'where':{'id':_0x1b055f[_0x5c9d('0x4f')]['id']}})[_0x5c9d('0x1b')](handleEntityNotFound(_0x32aecc,null))[_0x5c9d('0x1b')](saveUpdates(_0x1b055f['body'],null))['then'](respondWithResult(_0x32aecc,null))['catch'](handleError(_0x32aecc,null));};exports[_0x5c9d('0x56')]=function(_0x1e458d,_0x996688){return db[_0x5c9d('0x23')]['describe']()[_0x5c9d('0x1b')](respondWithResult(_0x996688,null))['catch'](handleError(_0x996688,null));};exports['destroy']=function(_0xff6338,_0xc8d0c){var _0x6b2aee;return db[_0x5c9d('0x23')][_0x5c9d('0x52')]({'where':{'id':_0xff6338[_0x5c9d('0x4f')]['id']}})[_0x5c9d('0x1b')](handleEntityNotFound(_0xc8d0c,null))[_0x5c9d('0x1b')](function(_0x117f2d){if(_0x117f2d){return _0x117f2d[_0x5c9d('0x57')]()[_0x5c9d('0x1b')](function(_0x39e1c6){return _0x39e1c6;});}})[_0x5c9d('0x1b')](function(_0x9fbf4d){_0x6b2aee=_0x9fbf4d;if(_0x9fbf4d){if(_0x9fbf4d[_0x5c9d('0x58')]||_0x9fbf4d[_0x5c9d('0x59')]){return db[_0x9fbf4d[_0x5c9d('0x58')]?_0x5c9d('0x5a'):_0x5c9d('0x5b')][_0x5c9d('0x52')]({'where':{'id':_0x9fbf4d['VoiceQueueId']?_0x9fbf4d[_0x5c9d('0x58')]:_0x9fbf4d[_0x5c9d('0x59')]},'attributes':['id',_0x5c9d('0x1f')],'raw':!![]});}}})['then'](function(_0x558593){var _0x1004a1={};if(_0x558593){_[_0x5c9d('0x46')](_0x1004a1,_[_0x5c9d('0x5c')](_0x6b2aee[_0x5c9d('0x5d')],[_0x5c9d('0x5e'),_0x5c9d('0x5f'),'id']));_0x1004a1['state']=0x15;_0x1004a1[_0x5c9d('0x60')]=_0x5c9d('0x61');_0x1004a1[_0x5c9d('0x62')]=_0x558593[_0x5c9d('0x1f')];_0x1004a1[_0x5c9d('0x63')]=_0xff6338[_0x5c9d('0x64')]['name'];_0x1004a1[_0x5c9d('0x65')]=_0xff6338['user']['id'];_0x1004a1[_0x5c9d('0x61')]=!![];_0x1004a1[_0x5c9d('0x66')]=moment()[_0x5c9d('0x67')](_0x5c9d('0x68'));_0x1004a1['calleridnum']=_0x6b2aee[_0x5c9d('0x69')];_0x1004a1[_0x5c9d('0x6a')]=_0x6b2aee['VoiceQueueId']?_0x5c9d('0x6b'):_0x5c9d('0x6c');return db[_0x5c9d('0x6d')][_0x5c9d('0x52')]({'where':{'id':_0x1004a1[_0x5c9d('0x6e')]},'attributes':[_0x5c9d('0x6f'),_0x5c9d('0x70')]})[_0x5c9d('0x1b')](function(_0x260020){if(!_[_0x5c9d('0x71')](_0xc8d0c)&&!_[_0x5c9d('0x71')](_0x260020['firstName'])){_0x1004a1['calleridname']=_0x260020[_0x5c9d('0x6f')];if(!_['isNil'](_0x260020['lastName'])){_0x1004a1['calleridname']+='\x20'+_0x260020[_0x5c9d('0x70')];}}})['finally'](function(){return db['CmHopperFinal'][_0x5c9d('0x53')](_0x1004a1);});}})['then'](function(){return _0xc8d0c[_0x5c9d('0x16')](0xcc)[_0x5c9d('0x1c')]();})[_0x5c9d('0x4d')](handleError(_0xc8d0c,null));};exports[_0x5c9d('0x72')]=function(_0x105d70,_0x306e10,_0x3039a5){var _0x32b06a=[];return db['CmContact'][_0x5c9d('0x56')]()['then'](function(_0x6fec7f){_0x32b06a=_[_0x5c9d('0x29')](_0x6fec7f);return _0x105d70['user'][_0x5c9d('0x73')]({'where':{'type':_0x5c9d('0x74'),'dialActive':!![],'dialMethod':_0x5c9d('0x75')},'attributes':['id',_0x5c9d('0x76')],'raw':!![]});})[_0x5c9d('0x1b')](function(_0x106c56){if(_0x106c56&&_0x106c56[_0x5c9d('0x3e')]){return db[_0x5c9d('0x77')][_0x5c9d('0x78')](function(_0x498413){var _0x24131c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5c9d('0x67')](_0x5c9d('0x68'))},'VoiceQueueId':{'$in':_[_0x5c9d('0x22')](_0x106c56,'id')},'$or':[{'UserId':null},{'UserId':_0x105d70[_0x5c9d('0x64')]['id']}]};var _0x4b8bbf=[];if(_0x105d70[_0x5c9d('0x54')][_0x5c9d('0x79')]&&_0x105d70[_0x5c9d('0x54')][_0x5c9d('0x79')]===_0x5c9d('0x7a')){if(!_[_0x5c9d('0x7b')](_0x105d70['body'][_0x5c9d('0x7c')])){_0x24131c['id']={'$in':_0x105d70[_0x5c9d('0x54')][_0x5c9d('0x7c')]};}_0x4b8bbf=[[_0x5c9d('0x7d'),'ASC'],['scheduledAt',_0x106c56[0x0][_0x5c9d('0x76')]===_0x5c9d('0x7e')?_0x5c9d('0x7f'):_0x5c9d('0x7e')],db['sequelize'][_0x5c9d('0x80')](_0x5c9d('0x81')),['id','DESC']];}else{if(!_[_0x5c9d('0x7b')](_0x105d70[_0x5c9d('0x54')]['hopperIds'])){_0x24131c['id']={'$notIn':_0x105d70['body']['hopperIds']};}_0x4b8bbf=[[_0x5c9d('0x7d'),'DESC'],[_0x5c9d('0x82'),_0x106c56[0x0]['dialOrderByScheduledAt']],db[_0x5c9d('0x77')][_0x5c9d('0x80')](_0x5c9d('0x83')),['id',_0x5c9d('0x7e')]];}return db[_0x5c9d('0x23')][_0x5c9d('0x84')]({'attributes':['id',_0x5c9d('0x85')],'where':_0x24131c,'order':_0x4b8bbf,'transaction':_0x498413,'lock':_0x498413[_0x5c9d('0x86')][_0x5c9d('0x87')],'include':[{'model':db[_0x5c9d('0x6d')],'as':_0x5c9d('0x88'),'attributes':_0x32b06a,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x5c9d('0x89')],'as':_0x5c9d('0x8a'),'attributes':['id',_0x5c9d('0x1f')]},{'model':db[_0x5c9d('0x5a')],'as':_0x5c9d('0x8b'),'attributes':['id',_0x5c9d('0x1f'),_0x5c9d('0x8c')]}]})[_0x5c9d('0x1b')](function(_0x267fcf){if(_0x267fcf){return _0x267fcf['update']({'UserId':_0x105d70[_0x5c9d('0x64')]['id']},{'transaction':_0x498413});}});});}})[_0x5c9d('0x1b')](handleEntityNotFound(_0x306e10,null))['then'](respondWithResult(_0x306e10,null))[_0x5c9d('0x4d')](handleError(_0x306e10,null));};exports['getOpenContacts']=function(_0x538096,_0x249ef1,_0x83fd66){return _0x538096[_0x5c9d('0x64')][_0x5c9d('0x73')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5c9d('0x75')},'attributes':['id'],'raw':!![]})[_0x5c9d('0x1b')](function(_0x3225a9){if(_0x3225a9&&_0x3225a9[_0x5c9d('0x3e')]){return db[_0x5c9d('0x23')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5c9d('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3225a9,'id')},'$or':[{'UserId':null},{'UserId':_0x538096['user']['id']}]}});}return 0x0;})[_0x5c9d('0x1b')](function(_0x264ecd){if(!_[_0x5c9d('0x71')](_0x264ecd)&&_[_0x5c9d('0x8d')](_0x264ecd)){return _0x249ef1['status'](0xc8)[_0x5c9d('0x17')]({'contacts':_0x264ecd});}else{logger[_0x5c9d('0x1d')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x5c9d('0x8e'),0x194,'entity\x20not\x20found');_0x249ef1['sendStatus'](0x194);}})['catch'](handleError(_0x249ef1,null));}; \ No newline at end of file +var _0x71ae=['sequelize','transaction','format','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','state','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','calleridname','finally','getPreview','outbound','preview','dialOrderByScheduledAt'];(function(_0x44317d,_0x58e860){var _0x4f2c6c=function(_0x25bea8){while(--_0x25bea8){_0x44317d['push'](_0x44317d['shift']());}};_0x4f2c6c(++_0x58e860);}(_0x71ae,0xa9));var _0xe71a=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x71ae[_0x3b1b23];return _0x1efc85;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe71a('0x0'));var rimraf=require(_0xe71a('0x1'));var zipdir=require(_0xe71a('0x2'));var jsonpatch=require(_0xe71a('0x3'));var rp=require(_0xe71a('0x4'));var moment=require(_0xe71a('0x5'));var BPromise=require(_0xe71a('0x6'));var Mustache=require(_0xe71a('0x7'));var util=require(_0xe71a('0x8'));var path=require(_0xe71a('0x9'));var sox=require(_0xe71a('0xa'));var csv=require(_0xe71a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe71a('0xc'));var squel=require(_0xe71a('0xd'));var crypto=require(_0xe71a('0xe'));var jsforce=require(_0xe71a('0xf'));var deskjs=require(_0xe71a('0x10'));var toCsv=require(_0xe71a('0xb'));var querystring=require(_0xe71a('0x11'));var Papa=require('papaparse');var Redis=require(_0xe71a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe71a('0x13'));var hardwareService=require(_0xe71a('0x14'));var logger=require(_0xe71a('0x15'))('api');var utils=require(_0xe71a('0x16'));var config=require(_0xe71a('0x17'));var db=require(_0xe71a('0x18'))['db'];function respondWithStatusCode(_0x556ff5,_0x4830c2){_0x4830c2=_0x4830c2||0xcc;return function(_0x4ec873){if(_0x4ec873){return _0x556ff5[_0xe71a('0x19')](_0x4830c2);}return _0x556ff5['status'](_0x4830c2)[_0xe71a('0x1a')]();};}function respondWithResult(_0x456fe4,_0x145025){_0x145025=_0x145025||0xc8;return function(_0x11a8c8){if(_0x11a8c8){return _0x456fe4['status'](_0x145025)[_0xe71a('0x1b')](_0x11a8c8);}};}function respondWithFilteredResult(_0x53a070,_0x5a4c41){return function(_0x17fe7e){if(_0x17fe7e){var _0x4c17e7=_0x17fe7e[_0xe71a('0x1c')],_0x878b70=_0x5a4c41[_0xe71a('0x1d')],_0x2b2a95=_0x5a4c41[_0xe71a('0x1d')]+_0x5a4c41[_0xe71a('0x1e')],_0xa7ec58;if(_0x2b2a95>=_0x4c17e7){_0x2b2a95=_0x4c17e7;_0xa7ec58=0xc8;}else{_0xa7ec58=0xce;}_0x53a070[_0xe71a('0x1f')](_0xa7ec58);return _0x53a070[_0xe71a('0x20')]('Content-Range',_0x878b70+'-'+_0x2b2a95+'/'+_0x4c17e7)[_0xe71a('0x1b')](_0x17fe7e);}return null;};}function patchUpdates(_0x27081d){return function(_0xf26343){try{jsonpatch[_0xe71a('0x21')](_0xf26343,_0x27081d,!![]);}catch(_0x4fe784){return BPromise['reject'](_0x4fe784);}return _0xf26343[_0xe71a('0x22')]();};}function saveUpdates(_0x767aab,_0x586a73){return function(_0x281bec){if(_0x281bec){return _0x281bec[_0xe71a('0x23')](_0x767aab)[_0xe71a('0x24')](function(_0x516a02){return _0x516a02;});}return null;};}function removeEntity(_0x1f7b7d,_0xfcbe13){return function(_0x3b715c){if(_0x3b715c){return _0x3b715c[_0xe71a('0x25')]()[_0xe71a('0x24')](function(){_0x1f7b7d[_0xe71a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19dc48,_0x5a3e80){return function(_0x404df9){if(!_0x404df9){_0x19dc48[_0xe71a('0x19')](0x194);}return _0x404df9;};}function handleError(_0x4714ce,_0xc386bd){_0xc386bd=_0xc386bd||0x1f4;return function(_0x12cfb5){logger[_0xe71a('0x26')](_0x12cfb5[_0xe71a('0x27')]);if(_0x12cfb5[_0xe71a('0x28')]){delete _0x12cfb5[_0xe71a('0x28')];}_0x4714ce[_0xe71a('0x1f')](_0xc386bd)['send'](_0x12cfb5);};}exports[_0xe71a('0x29')]=function(_0x4a6951,_0x3e67b9){var _0x2377c8={},_0x12b0cf={},_0x31b8dd={'count':0x0,'rows':[]};var _0x1ddc9e=_[_0xe71a('0x2a')](db['CmHopper']['rawAttributes'],function(_0x2e9cbc){return{'name':_0x2e9cbc[_0xe71a('0x2b')],'type':_0x2e9cbc[_0xe71a('0x2c')]['key']};});_0x12b0cf[_0xe71a('0x2d')]=_[_0xe71a('0x2a')](_0x1ddc9e,_0xe71a('0x28'));_0x12b0cf[_0xe71a('0x2e')]=_[_0xe71a('0x2f')](_0x4a6951['query']);_0x12b0cf[_0xe71a('0x30')]=_[_0xe71a('0x31')](_0x12b0cf[_0xe71a('0x2d')],_0x12b0cf[_0xe71a('0x2e')]);_0x12b0cf[_0xe71a('0x30')]=_[_0xe71a('0x32')](_0x12b0cf[_0xe71a('0x30')],[_0xe71a('0x33'),_0xe71a('0x34'),_0xe71a('0x35'),_0xe71a('0x36'),_0xe71a('0x37'),_0xe71a('0x38'),_0xe71a('0x39'),'$eq','$not',_0xe71a('0x3a'),_0xe71a('0x3b'),_0xe71a('0x3c'),_0xe71a('0x3d'),_0xe71a('0x3e'),_0xe71a('0x3f'),_0xe71a('0x40'),_0xe71a('0x41'),_0xe71a('0x3e'),_0xe71a('0x42'),'$contains','$contained','$any']);_0x2377c8['attributes']=_[_0xe71a('0x31')](_0x12b0cf[_0xe71a('0x2d')],qs[_0xe71a('0x43')](_0x4a6951[_0xe71a('0x2e')][_0xe71a('0x43')]));_0x2377c8[_0xe71a('0x44')]=_0x2377c8[_0xe71a('0x44')][_0xe71a('0x45')]?_0x2377c8[_0xe71a('0x44')]:_0x12b0cf[_0xe71a('0x2d')];if(!_0x4a6951['query'][_0xe71a('0x46')](_0xe71a('0x47'))){_0x2377c8[_0xe71a('0x1e')]=qs[_0xe71a('0x1e')](_0x4a6951[_0xe71a('0x2e')][_0xe71a('0x1e')]);_0x2377c8[_0xe71a('0x1d')]=qs[_0xe71a('0x1d')](_0x4a6951[_0xe71a('0x2e')]['offset']);}_0x2377c8[_0xe71a('0x48')]=qs[_0xe71a('0x49')](_0x4a6951[_0xe71a('0x2e')][_0xe71a('0x49')]);_0x2377c8[_0xe71a('0x4a')]=qs[_0xe71a('0x30')](_[_0xe71a('0x4b')](_0x4a6951[_0xe71a('0x2e')],_0x12b0cf[_0xe71a('0x30')]),_0x1ddc9e);if(_0x4a6951[_0xe71a('0x2e')][_0xe71a('0x4c')]){_0x2377c8['where']=_['merge'](_0x2377c8['where'],{'$or':_['map'](_0x1ddc9e,function(_0x283e34){if(_0x283e34[_0xe71a('0x2c')]!=='VIRTUAL'){var _0x210261={};_0x210261[_0x283e34[_0xe71a('0x28')]]={'$like':'%'+_0x4a6951['query'][_0xe71a('0x4c')]+'%'};return _0x210261;}})});}_0x2377c8=_[_0xe71a('0x4d')]({},_0x2377c8,_0x4a6951[_0xe71a('0x4e')]);var _0x4a2289={'where':_0x2377c8[_0xe71a('0x4a')]};return db[_0xe71a('0x4f')]['count'](_0x4a2289)[_0xe71a('0x24')](function(_0xb5ce9){_0x31b8dd['count']=_0xb5ce9;if(_0x4a6951[_0xe71a('0x2e')][_0xe71a('0x50')]){_0x2377c8[_0xe71a('0x51')]=[{'all':!![]}];}return db[_0xe71a('0x4f')]['findAll'](_0x2377c8);})[_0xe71a('0x24')](function(_0x5497a6){_0x31b8dd['rows']=_0x5497a6;return _0x31b8dd;})[_0xe71a('0x24')](respondWithFilteredResult(_0x3e67b9,_0x2377c8))[_0xe71a('0x52')](handleError(_0x3e67b9,null));};exports[_0xe71a('0x53')]=function(_0x59596b,_0x411e40){var _0x481713={'raw':!![],'where':{'id':_0x59596b[_0xe71a('0x54')]['id']}},_0x167849={};_0x167849[_0xe71a('0x2d')]=_[_0xe71a('0x2f')](db[_0xe71a('0x4f')][_0xe71a('0x55')]);_0x167849[_0xe71a('0x2e')]=_[_0xe71a('0x2f')](_0x59596b[_0xe71a('0x2e')]);_0x167849[_0xe71a('0x30')]=_['intersection'](_0x167849[_0xe71a('0x2d')],_0x167849[_0xe71a('0x2e')]);_0x481713[_0xe71a('0x44')]=_[_0xe71a('0x31')](_0x167849['model'],qs['fields'](_0x59596b[_0xe71a('0x2e')]['fields']));_0x481713[_0xe71a('0x44')]=_0x481713[_0xe71a('0x44')]['length']?_0x481713[_0xe71a('0x44')]:_0x167849[_0xe71a('0x2d')];if(_0x59596b['query'][_0xe71a('0x50')]){_0x481713[_0xe71a('0x51')]=[{'all':!![]}];}_0x481713=_[_0xe71a('0x4d')]({},_0x481713,_0x59596b[_0xe71a('0x4e')]);return db[_0xe71a('0x4f')][_0xe71a('0x56')](_0x481713)[_0xe71a('0x24')](handleEntityNotFound(_0x411e40,null))[_0xe71a('0x24')](respondWithResult(_0x411e40,null))[_0xe71a('0x52')](handleError(_0x411e40,null));};exports[_0xe71a('0x57')]=function(_0x345cf0,_0x59cbaf){return db['CmHopper'][_0xe71a('0x57')](_0x345cf0[_0xe71a('0x58')],{})[_0xe71a('0x24')](respondWithResult(_0x59cbaf,0xc9))[_0xe71a('0x52')](handleError(_0x59cbaf,null));};exports[_0xe71a('0x23')]=function(_0x535912,_0x7e23a0){if(_0x535912[_0xe71a('0x58')]['id']){delete _0x535912[_0xe71a('0x58')]['id'];}return db[_0xe71a('0x4f')]['find']({'where':{'id':_0x535912[_0xe71a('0x54')]['id']}})[_0xe71a('0x24')](handleEntityNotFound(_0x7e23a0,null))[_0xe71a('0x24')](saveUpdates(_0x535912[_0xe71a('0x58')],null))['then'](respondWithResult(_0x7e23a0,null))[_0xe71a('0x52')](handleError(_0x7e23a0,null));};exports[_0xe71a('0x59')]=function(_0x4836f6,_0x441dd5){return db[_0xe71a('0x4f')]['describe']()[_0xe71a('0x24')](respondWithResult(_0x441dd5,null))[_0xe71a('0x52')](handleError(_0x441dd5,null));};exports[_0xe71a('0x25')]=function(_0x4a4708,_0x3a6df3){var _0x5f2f7d;return db[_0xe71a('0x4f')][_0xe71a('0x56')]({'where':{'id':_0x4a4708[_0xe71a('0x54')]['id']}})[_0xe71a('0x24')](handleEntityNotFound(_0x3a6df3,null))[_0xe71a('0x24')](function(_0x13ed64){if(_0x13ed64){return _0x13ed64['destroy']()[_0xe71a('0x24')](function(_0x5f097e){return _0x5f097e;});}})[_0xe71a('0x24')](function(_0x3e0026){_0x5f2f7d=_0x3e0026;if(_0x3e0026){if(_0x3e0026[_0xe71a('0x5a')]||_0x3e0026[_0xe71a('0x5b')]){return db[_0x3e0026[_0xe71a('0x5a')]?_0xe71a('0x5c'):_0xe71a('0x5d')][_0xe71a('0x56')]({'where':{'id':_0x3e0026['VoiceQueueId']?_0x3e0026[_0xe71a('0x5a')]:_0x3e0026[_0xe71a('0x5b')]},'attributes':['id',_0xe71a('0x28')],'raw':!![]});}}})[_0xe71a('0x24')](function(_0x53cfeb){var _0x3b8705={};if(_0x53cfeb){_[_0xe71a('0x4d')](_0x3b8705,_[_0xe71a('0x5e')](_0x5f2f7d['dataValues'],[_0xe71a('0x5f'),_0xe71a('0x60'),'id']));_0x3b8705[_0xe71a('0x61')]=0x15;_0x3b8705['statedesc']=_0xe71a('0x62');_0x3b8705['campaign']=_0x53cfeb[_0xe71a('0x28')];_0x3b8705[_0xe71a('0x63')]=_0x4a4708[_0xe71a('0x64')][_0xe71a('0x28')];_0x3b8705[_0xe71a('0x65')]=_0x4a4708[_0xe71a('0x64')]['id'];_0x3b8705[_0xe71a('0x62')]=!![];_0x3b8705[_0xe71a('0x66')]=moment()['format'](_0xe71a('0x67'));_0x3b8705[_0xe71a('0x68')]=_0x5f2f7d[_0xe71a('0x69')];_0x3b8705[_0xe71a('0x6a')]=_0x5f2f7d[_0xe71a('0x5a')]?_0xe71a('0x6b'):_0xe71a('0x6c');return db[_0xe71a('0x6d')]['find']({'where':{'id':_0x3b8705['ContactId']},'attributes':['firstName',_0xe71a('0x6e')]})[_0xe71a('0x24')](function(_0x2dc4cd){if(!_[_0xe71a('0x6f')](_0x3a6df3)&&!_[_0xe71a('0x6f')](_0x2dc4cd[_0xe71a('0x70')])){_0x3b8705[_0xe71a('0x71')]=_0x2dc4cd[_0xe71a('0x70')];if(!_[_0xe71a('0x6f')](_0x2dc4cd[_0xe71a('0x6e')])){_0x3b8705[_0xe71a('0x71')]+='\x20'+_0x2dc4cd[_0xe71a('0x6e')];}}})[_0xe71a('0x72')](function(){return db['CmHopperFinal']['create'](_0x3b8705);});}})[_0xe71a('0x24')](function(){return _0x3a6df3[_0xe71a('0x1f')](0xcc)[_0xe71a('0x1a')]();})[_0xe71a('0x52')](handleError(_0x3a6df3,null));};exports[_0xe71a('0x73')]=function(_0x59f389,_0x42f3ee,_0x9f29b8){var _0x56e1b4=[];return db[_0xe71a('0x6d')][_0xe71a('0x59')]()[_0xe71a('0x24')](function(_0x590c01){_0x56e1b4=_[_0xe71a('0x2f')](_0x590c01);return _0x59f389[_0xe71a('0x64')]['getVoiceQueues']({'where':{'type':_0xe71a('0x74'),'dialActive':!![],'dialMethod':_0xe71a('0x75')},'attributes':['id',_0xe71a('0x76')],'raw':!![]});})[_0xe71a('0x24')](function(_0x32efb8){if(_0x32efb8&&_0x32efb8[_0xe71a('0x45')]){return db[_0xe71a('0x77')][_0xe71a('0x78')](function(_0x5f3fb4){var _0x38efa8={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe71a('0x79')](_0xe71a('0x67'))},'VoiceQueueId':{'$in':_['map'](_0x32efb8,'id')},'$or':[{'UserId':null},{'UserId':_0x59f389[_0xe71a('0x64')]['id']}]};var _0xc56708=[];if(_0x59f389[_0xe71a('0x58')][_0xe71a('0x7a')]&&_0x59f389[_0xe71a('0x58')][_0xe71a('0x7a')]===_0xe71a('0x7b')){if(!_[_0xe71a('0x7c')](_0x59f389[_0xe71a('0x58')][_0xe71a('0x7d')])){_0x38efa8['id']={'$in':_0x59f389[_0xe71a('0x58')][_0xe71a('0x7d')]};}_0xc56708=[['priority',_0xe71a('0x7e')],[_0xe71a('0x7f'),_0x32efb8[0x0][_0xe71a('0x76')]===_0xe71a('0x7e')?_0xe71a('0x80'):_0xe71a('0x7e')],db[_0xe71a('0x77')]['literal'](_0xe71a('0x81')),['id',_0xe71a('0x80')]];}else{if(!_[_0xe71a('0x7c')](_0x59f389['body']['hopperIds'])){_0x38efa8['id']={'$notIn':_0x59f389['body'][_0xe71a('0x7d')]};}_0xc56708=[['priority',_0xe71a('0x80')],['scheduledAt',_0x32efb8[0x0][_0xe71a('0x76')]],db[_0xe71a('0x77')]['literal'](_0xe71a('0x82')),['id','ASC']];}return db[_0xe71a('0x4f')]['findOne']({'attributes':['id',_0xe71a('0x83')],'where':_0x38efa8,'order':_0xc56708,'transaction':_0x5f3fb4,'lock':_0x5f3fb4[_0xe71a('0x84')][_0xe71a('0x85')],'include':[{'model':db[_0xe71a('0x6d')],'as':_0xe71a('0x86'),'attributes':_0x56e1b4,'include':[{'model':db[_0xe71a('0x87')],'as':_0xe71a('0x88'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xe71a('0x89'),'attributes':['id',_0xe71a('0x28')]},{'model':db[_0xe71a('0x5c')],'as':_0xe71a('0x8a'),'attributes':['id',_0xe71a('0x28'),_0xe71a('0x8b')]}]})[_0xe71a('0x24')](function(_0x10f082){if(_0x10f082){return _0x10f082[_0xe71a('0x23')]({'UserId':_0x59f389[_0xe71a('0x64')]['id']},{'transaction':_0x5f3fb4});}});});}})['then'](handleEntityNotFound(_0x42f3ee,null))[_0xe71a('0x24')](respondWithResult(_0x42f3ee,null))[_0xe71a('0x52')](handleError(_0x42f3ee,null));};exports[_0xe71a('0x8c')]=function(_0x455211,_0x30c641,_0x55261c){return _0x455211['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xe71a('0x75')},'attributes':['id'],'raw':!![]})['then'](function(_0x46f820){if(_0x46f820&&_0x46f820[_0xe71a('0x45')]){return db[_0xe71a('0x4f')][_0xe71a('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe71a('0x79')](_0xe71a('0x67'))},'VoiceQueueId':{'$in':_[_0xe71a('0x2a')](_0x46f820,'id')},'$or':[{'UserId':null},{'UserId':_0x455211[_0xe71a('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x24d22f){if(!_[_0xe71a('0x6f')](_0x24d22f)&&_[_0xe71a('0x8d')](_0x24d22f)){return _0x30c641[_0xe71a('0x1f')](0xc8)[_0xe71a('0x1b')]({'contacts':_0x24d22f});}else{logger[_0xe71a('0x26')](_0xe71a('0x8e'),'getOpenContacts',0x194,_0xe71a('0x8f'));_0x30c641[_0xe71a('0x19')](0x194);}})[_0xe71a('0x52')](handleError(_0x30c641,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 0e16703..7aee8e2 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 _0xe202=['define','CmHopper','scheduledat','phone','priority','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xe202,0x147));var _0x2e20=function(_0x47c3c3,_0x5dc6a5){_0x47c3c3=_0x47c3c3-0x0;var _0x1ca8e4=_0xe202[_0x47c3c3];return _0x1ca8e4;};'use strict';var _=require(_0x2e20('0x0'));var util=require('util');var logger=require(_0x2e20('0x1'))('api');var moment=require(_0x2e20('0x2'));var BPromise=require(_0x2e20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e20('0x4'));var rimraf=require(_0x2e20('0x5'));var config=require(_0x2e20('0x6'));var attributes=require(_0x2e20('0x7'));module[_0x2e20('0x8')]=function(_0xec053f,_0x155e5f){return _0xec053f[_0x2e20('0x9')](_0x2e20('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x2e20('0xb'),'fields':[_0x2e20('0xb')]},{'name':_0x2e20('0xc'),'fields':[_0x2e20('0xc')]},{'name':'priority','fields':[_0x2e20('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5b5=['moment','bluebird','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x54fadf,_0x25947b){var _0x1bca87=function(_0x3860f1){while(--_0x3860f1){_0x54fadf['push'](_0x54fadf['shift']());}};_0x1bca87(++_0x25947b);}(_0xd5b5,0xed));var _0x5d5b=function(_0x416bc9,_0x28a051){_0x416bc9=_0x416bc9-0x0;var _0x5884f4=_0xd5b5[_0x416bc9];return _0x5884f4;};'use strict';var _=require(_0x5d5b('0x0'));var util=require('util');var logger=require(_0x5d5b('0x1'))(_0x5d5b('0x2'));var moment=require(_0x5d5b('0x3'));var BPromise=require(_0x5d5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5d5b('0x5'));var config=require(_0x5d5b('0x6'));var attributes=require(_0x5d5b('0x7'));module[_0x5d5b('0x8')]=function(_0x2b9da0,_0x3db278){return _0x2b9da0[_0x5d5b('0x9')](_0x5d5b('0xa'),attributes,{'tableName':_0x5d5b('0xb'),'paranoid':![],'indexes':[{'name':_0x5d5b('0xc'),'fields':['scheduledat']},{'name':_0x5d5b('0xd'),'fields':['phone']},{'name':_0x5d5b('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 26ca833..c8b41e7 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 _0xee8a=['stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','ShowCmHopper','find','CreateCmHopper','CmHopper','body','raw','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','includes','push','UserId','all','CmHopperFinal','create','CountReScheduled','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','GetCmHopperPreview','lodash','moment','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x2104d2,_0xcc2a90){var _0xd3a9a7=function(_0x3837a1){while(--_0x3837a1){_0x2104d2['push'](_0x2104d2['shift']());}};_0xd3a9a7(++_0xcc2a90);}(_0xee8a,0x103));var _0xaee8=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xee8a[_0x4849f6];return _0x1a3dcd;};'use strict';var _=require(_0xaee8('0x0'));var util=require('util');var moment=require(_0xaee8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaee8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xaee8('0x3'))('rpc');var config=require(_0xaee8('0x4'));var jayson=require(_0xaee8('0x5'));var client=jayson[_0xaee8('0x6')][_0xaee8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18bc5c,_0x1a5500,_0x2994c3){return new BPromise(function(_0x47c1f1,_0x12fe4c){return client[_0xaee8('0x8')](_0x18bc5c,_0x2994c3)[_0xaee8('0x9')](function(_0x50e859){logger[_0xaee8('0xa')]('CmHopper,\x20%s,\x20%s',_0x1a5500,_0xaee8('0xb'));logger[_0xaee8('0xc')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x1a5500,_0xaee8('0xb'),JSON[_0xaee8('0xd')](_0x50e859));if(_0x50e859[_0xaee8('0xe')]){if(_0x50e859[_0xaee8('0xe')][_0xaee8('0xf')]===0x1f4){logger[_0xaee8('0xe')](_0xaee8('0x10'),_0x1a5500,_0x50e859[_0xaee8('0xe')][_0xaee8('0x11')]);return _0x12fe4c(_0x50e859[_0xaee8('0xe')][_0xaee8('0x11')]);}logger[_0xaee8('0xe')](_0xaee8('0x10'),_0x1a5500,_0x50e859[_0xaee8('0xe')][_0xaee8('0x11')]);return _0x47c1f1(_0x50e859[_0xaee8('0xe')]['message']);}else{logger[_0xaee8('0xa')](_0xaee8('0x10'),_0x1a5500,_0xaee8('0xb'));_0x47c1f1(_0x50e859[_0xaee8('0x12')][_0xaee8('0x11')]);}})[_0xaee8('0x13')](function(_0x36cd07){logger['error'](_0xaee8('0x10'),_0x1a5500,_0x36cd07);_0x12fe4c(_0x36cd07);});});}exports[_0xaee8('0x14')]=function(_0xbeca26){var _0x2862d8=this;return new Promise(function(_0x187a39,_0x1e472f){return db['CmHopper'][_0xaee8('0x15')]({'raw':_0xbeca26[_0xaee8('0x16')]?_0xbeca26[_0xaee8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xbeca26[_0xaee8('0x16')]?_0xbeca26[_0xaee8('0x16')][_0xaee8('0x17')]||null:null,'attributes':_0xbeca26[_0xaee8('0x16')]?_0xbeca26['options'][_0xaee8('0x18')]||null:null,'limit':_0xbeca26[_0xaee8('0x16')]?_0xbeca26[_0xaee8('0x16')][_0xaee8('0x19')]||null:null,'include':_0xbeca26[_0xaee8('0x16')]?_0xbeca26[_0xaee8('0x16')][_0xaee8('0x1a')]?_[_0xaee8('0x1b')](_0xbeca26[_0xaee8('0x16')][_0xaee8('0x1a')],function(_0x1029b5){return{'model':db[_0x1029b5[_0xaee8('0x1c')]],'as':_0x1029b5['as'],'attributes':_0x1029b5['attributes'],'include':_0x1029b5[_0xaee8('0x1a')]?_['map'](_0x1029b5[_0xaee8('0x1a')],function(_0x18fdac){return{'model':db[_0x18fdac[_0xaee8('0x1c')]],'as':_0x18fdac['as'],'attributes':_0x18fdac[_0xaee8('0x18')],'include':_0x18fdac['include']?_[_0xaee8('0x1b')](_0x18fdac[_0xaee8('0x1a')],function(_0x46ae64){return{'model':db[_0x46ae64[_0xaee8('0x1c')]],'as':_0x46ae64['as'],'attributes':_0x46ae64['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x260a33){logger[_0xaee8('0xa')]('GetCmHopper',_0xbeca26);logger['debug']('GetCmHopper',_0xbeca26,JSON[_0xaee8('0xd')](_0x260a33));_0x187a39(_0x260a33);})[_0xaee8('0x13')](function(_0x4f4e8d){logger[_0xaee8('0xe')](_0xaee8('0x14'),_0x4f4e8d[_0xaee8('0x11')],_0xbeca26);_0x1e472f(_0x2862d8[_0xaee8('0xe')](0x1f4,_0x4f4e8d[_0xaee8('0x11')]));});});};exports[_0xaee8('0x1d')]=function(_0x5d7397){var _0x1660b3=this;return new Promise(function(_0x59785d,_0x13e9c2){return db['CmHopper'][_0xaee8('0x1e')]({'raw':_0x5d7397[_0xaee8('0x16')]?_0x5d7397['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d7397['options']?_0x5d7397['options']['where']||null:null,'attributes':_0x5d7397[_0xaee8('0x16')]?_0x5d7397['options'][_0xaee8('0x18')]||null:null,'include':_0x5d7397[_0xaee8('0x16')]?_0x5d7397['options'][_0xaee8('0x1a')]?_['map'](_0x5d7397[_0xaee8('0x16')]['include'],function(_0xa4e2d3){return{'model':db[_0xa4e2d3['model']],'as':_0xa4e2d3['as'],'attributes':_0xa4e2d3['attributes'],'include':_0xa4e2d3[_0xaee8('0x1a')]?_[_0xaee8('0x1b')](_0xa4e2d3[_0xaee8('0x1a')],function(_0x58c791){return{'model':db[_0x58c791['model']],'as':_0x58c791['as'],'attributes':_0x58c791['attributes'],'include':_0x58c791[_0xaee8('0x1a')]?_[_0xaee8('0x1b')](_0x58c791[_0xaee8('0x1a')],function(_0x320da2){return{'model':db[_0x320da2[_0xaee8('0x1c')]],'as':_0x320da2['as'],'attributes':_0x320da2[_0xaee8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x924cf8){logger[_0xaee8('0xa')](_0xaee8('0x1d'),_0x5d7397);logger[_0xaee8('0xc')]('ShowCmHopper',_0x5d7397,JSON['stringify'](_0x924cf8));_0x59785d(_0x924cf8);})[_0xaee8('0x13')](function(_0x27925a){logger[_0xaee8('0xe')]('ShowCmHopper',_0x27925a[_0xaee8('0x11')],_0x5d7397);_0x13e9c2(_0x1660b3[_0xaee8('0xe')](0x1f4,_0x27925a[_0xaee8('0x11')]));});});};exports[_0xaee8('0x1f')]=function(_0x4f00eb){var _0x42e664=this;return new Promise(function(_0x53230a,_0x48a573){return db[_0xaee8('0x20')]['create'](_0x4f00eb[_0xaee8('0x21')],{'raw':_0x4f00eb[_0xaee8('0x16')]?_0x4f00eb['options'][_0xaee8('0x22')]===undefined?!![]:![]:!![]})[_0xaee8('0x9')](function(_0x234bcc){logger[_0xaee8('0xa')](_0xaee8('0x1f'),_0x4f00eb);logger['debug'](_0xaee8('0x1f'),_0x4f00eb,JSON[_0xaee8('0xd')](_0x234bcc));_0x53230a(_0x234bcc);})[_0xaee8('0x13')](function(_0x1bc55f){logger[_0xaee8('0xe')](_0xaee8('0x1f'),_0x1bc55f[_0xaee8('0x11')],_0x4f00eb);_0x48a573(_0x42e664[_0xaee8('0xe')](0x1f4,_0x1bc55f[_0xaee8('0x11')]));});});};exports[_0xaee8('0x23')]=function(_0x464d54){var _0x504ced=this;return new Promise(function(_0x4bf4a2,_0x36fd19){return db['CmHopper'][_0xaee8('0x24')](_0x464d54[_0xaee8('0x21')],{'raw':_0x464d54['options']?_0x464d54[_0xaee8('0x16')][_0xaee8('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464d54[_0xaee8('0x16')]?_0x464d54[_0xaee8('0x16')]['where']||null:null,'attributes':_0x464d54[_0xaee8('0x16')]?_0x464d54['options'][_0xaee8('0x18')]||null:null,'limit':_0x464d54[_0xaee8('0x16')]?_0x464d54[_0xaee8('0x16')][_0xaee8('0x19')]||null:null})[_0xaee8('0x9')](function(_0x20f357){logger[_0xaee8('0xa')](_0xaee8('0x23'),_0x464d54);logger[_0xaee8('0xc')]('UpdateCmHopper',_0x464d54,JSON[_0xaee8('0xd')](_0x20f357));_0x4bf4a2(_0x20f357);})[_0xaee8('0x13')](function(_0x3c017d){logger[_0xaee8('0xe')](_0xaee8('0x23'),_0x3c017d[_0xaee8('0x11')],_0x464d54);_0x36fd19(_0x504ced[_0xaee8('0xe')](0x1f4,_0x3c017d[_0xaee8('0x11')]));});});};exports[_0xaee8('0x25')]=function(_0x3ab42c){var _0x53ae71=this;return new Promise(function(_0x549c75,_0x500dcb){return db[_0xaee8('0x20')][_0xaee8('0x26')]({'where':_0x3ab42c[_0xaee8('0x16')]?_0x3ab42c[_0xaee8('0x16')]['where']||null:null})['then'](function(_0x19df2a){logger[_0xaee8('0xa')](_0xaee8('0x25'),_0x3ab42c);logger[_0xaee8('0xc')](_0xaee8('0x25'),_0x3ab42c,JSON[_0xaee8('0xd')](_0x19df2a));_0x549c75(_0x19df2a);})['catch'](function(_0x1ca6d1){logger[_0xaee8('0xe')](_0xaee8('0x25'),_0x1ca6d1[_0xaee8('0x11')],_0x3ab42c);_0x500dcb(_0x53ae71['error'](0x1f4,_0x1ca6d1[_0xaee8('0x11')]));});});};exports[_0xaee8('0x27')]=function(_0x3be72e){var _0xbad69b=this;return new Promise(function(_0xb9b7d0,_0x1171d0){return db[_0xaee8('0x28')][_0xaee8('0x29')]()['then'](function(_0x4e593b){return db[_0xaee8('0x2a')][_0xaee8('0x2b')](function(_0x4fa158){return db[_0xaee8('0x20')][_0xaee8('0x15')]({'where':_0x3be72e[_0xaee8('0x16')]?_0x3be72e[_0xaee8('0x16')][_0xaee8('0x17')]||null:null,'attributes':_0x3be72e[_0xaee8('0x16')]?_0x3be72e[_0xaee8('0x16')]['attributes']||null:null,'limit':_0x3be72e[_0xaee8('0x16')]?_0x3be72e[_0xaee8('0x16')][_0xaee8('0x19')]||null:null,'order':_0x3be72e[_0xaee8('0x16')]?_0x3be72e['options']['order']||null:null,'transaction':_0x4fa158,'lock':_0x4fa158[_0xaee8('0x2c')][_0xaee8('0x2d')],'include':[{'model':db['CmContact'],'as':_0xaee8('0x2e'),'attributes':_[_0xaee8('0x2f')](_0x4e593b)},{'model':db[_0xaee8('0x30')],'as':_0xaee8('0x31'),'attributes':['id',_0xaee8('0x32'),_0xaee8('0x33')]}]})['then'](function(_0x2bfb20){var _0x4d3e2e=[];var _0x14995a=[];for(var _0x323ea5=0x0;_0x323ea5<_0x2bfb20[_0xaee8('0x34')];_0x323ea5+=0x1){if(!_0x14995a[_0xaee8('0x35')](_0x2bfb20[_0x323ea5]['UserId'])){_0x14995a[_0xaee8('0x36')](_0x2bfb20[_0x323ea5][_0xaee8('0x37')]);_0x4d3e2e[_0xaee8('0x36')](_0x2bfb20[_0x323ea5][_0xaee8('0x24')](_0x3be72e[_0xaee8('0x21')],{'transaction':_0x4fa158}));}}return BPromise[_0xaee8('0x38')](_0x4d3e2e);});})['then'](function(_0x4b2647){logger[_0xaee8('0xa')](_0xaee8('0x27'),_0x3be72e);logger[_0xaee8('0xc')](_0xaee8('0x27'),_0x3be72e,JSON[_0xaee8('0xd')](_0x4b2647));_0xb9b7d0(_0x4b2647);})[_0xaee8('0x13')](function(_0x1c1953){logger[_0xaee8('0xe')](_0xaee8('0x27'),_0x1c1953[_0xaee8('0x11')],_0x3be72e);_0x1171d0(_0xbad69b[_0xaee8('0xe')](0x1f4,_0x1c1953[_0xaee8('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x4de8b3){var _0x4ccd61=this;return new Promise(function(_0xf8162,_0xb46638){return db[_0xaee8('0x2a')]['transaction'](function(_0x2a731c){return db[_0xaee8('0x39')][_0xaee8('0x3a')](_0x4de8b3[_0xaee8('0x21')],{'raw':_0x4de8b3[_0xaee8('0x16')]?_0x4de8b3[_0xaee8('0x16')][_0xaee8('0x22')]===undefined?!![]:![]:!![],'transaction':_0x2a731c})[_0xaee8('0x9')](function(){return db[_0xaee8('0x20')][_0xaee8('0x26')]({'where':_0x4de8b3[_0xaee8('0x16')]?_0x4de8b3[_0xaee8('0x16')]['where']||null:null,'transaction':_0x2a731c});});})[_0xaee8('0x9')](function(_0x89857c){logger[_0xaee8('0xa')]('MoveContactManagedDialer',_0x4de8b3);logger['debug']('MoveContactManagedDialer',_0x4de8b3,JSON[_0xaee8('0xd')](_0x89857c));_0xf8162(_0x89857c);})[_0xaee8('0x13')](function(_0x20c038){logger[_0xaee8('0xe')]('MoveContactManagedDialer',_0x20c038['message'],_0x4de8b3);_0xb46638(_0x4ccd61[_0xaee8('0xe')](0x1f4,_0x20c038['message']));});});};exports[_0xaee8('0x3b')]=function(_0x555d5e){var _0xc822e6=this;return new Promise(function(_0x3f6562,_0x360001){return db[_0xaee8('0x20')]['findAll']({'raw':_0x555d5e[_0xaee8('0x16')]?_0x555d5e[_0xaee8('0x16')][_0xaee8('0x22')]===undefined?!![]:![]:!![],'where':_0x555d5e[_0xaee8('0x16')]?_0x555d5e[_0xaee8('0x16')][_0xaee8('0x17')]||null:null,'attributes':[[db[_0xaee8('0x2a')]['fn']('COUNT',db[_0xaee8('0x2a')]['fn']('IF',db[_0xaee8('0x2a')]['literal']('`scheduledat`\x20>=\x20'+util[_0xaee8('0x3c')](_0xaee8('0x3d'),moment()[_0xaee8('0x3c')](_0xaee8('0x3e')))+_0xaee8('0x3f')))),_0xaee8('0x40')]]})[_0xaee8('0x9')](function(_0x5dc68b){logger[_0xaee8('0xa')](_0xaee8('0x3b'),_0x555d5e);logger[_0xaee8('0xc')]('CountReScheduled',_0x555d5e,JSON[_0xaee8('0xd')](_0x5dc68b));_0x3f6562(_0x5dc68b);})[_0xaee8('0x13')](function(_0x80881f){logger['error'](_0xaee8('0x3b'),_0x80881f[_0xaee8('0x11')],_0x555d5e);_0x360001(_0xc822e6['error'](0x1f4,_0x80881f[_0xaee8('0x11')]));});});};exports[_0xaee8('0x41')]=function(_0x2f33de){var _0x4a174e=this;return new Promise(function(_0x23e700,_0x1fd495){return db[_0xaee8('0x28')]['describe']()[_0xaee8('0x9')](function(_0x5c066b){return db[_0xaee8('0x2a')]['transaction'](function(_0x4c9ab0){return db['CmHopper']['findAll']({'where':_0x2f33de[_0xaee8('0x16')]?_0x2f33de[_0xaee8('0x16')]['where']||null:null,'attributes':_0x2f33de[_0xaee8('0x16')]?_0x2f33de[_0xaee8('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x2f33de[_0xaee8('0x16')]?_0x2f33de[_0xaee8('0x16')][_0xaee8('0x42')]||null:null,'group':db[_0xaee8('0x20')][_0xaee8('0x37')],'transaction':_0x4c9ab0,'lock':_0x4c9ab0[_0xaee8('0x2c')][_0xaee8('0x2d')],'include':_0x2f33de[_0xaee8('0x16')]?_0x2f33de['options'][_0xaee8('0x1a')]?_[_0xaee8('0x1b')](_0x2f33de[_0xaee8('0x16')][_0xaee8('0x1a')],function(_0x32bfd5){return{'model':db[_0x32bfd5[_0xaee8('0x1c')]],'as':_0x32bfd5['as'],'attributes':_0x32bfd5[_0xaee8('0x18')],'include':_0x32bfd5[_0xaee8('0x1a')]?_['map'](_0x32bfd5[_0xaee8('0x1a')],function(_0x1b245c){return{'model':db[_0x1b245c['model']],'as':_0x1b245c['as'],'attributes':_0x1b245c[_0xaee8('0x18')],'include':_0x1b245c['include']?_[_0xaee8('0x1b')](_0x1b245c[_0xaee8('0x1a')],function(_0xc1200a){return{'model':db[_0xc1200a[_0xaee8('0x1c')]],'as':_0xc1200a['as'],'attributes':_0xc1200a[_0xaee8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xaee8('0x9')](function(_0x3e5059){var _0x22af79=[];for(var _0xb03f4e=0x0;_0xb03f4e<_0x3e5059['length'];_0xb03f4e+=0x1){_0x22af79['push'](_0x3e5059[_0xb03f4e]['update'](_0x2f33de[_0xaee8('0x21')],{'transaction':_0x4c9ab0}));}return BPromise['all'](_0x22af79);});})['then'](function(_0x412ebc){logger[_0xaee8('0xa')](_0xaee8('0x41'),_0x2f33de);logger['debug'](_0xaee8('0x41'),_0x2f33de,JSON[_0xaee8('0xd')](_0x412ebc));_0x23e700(_0x412ebc);})[_0xaee8('0x13')](function(_0x36811a){logger['error'](_0xaee8('0x41'),_0x36811a[_0xaee8('0x11')],_0x2f33de);_0x1fd495(_0x4a174e[_0xaee8('0xe')](0x1f4,_0x36811a['message']));});});});};exports[_0xaee8('0x43')]=function(_0x292976){var _0x336222=this;return new Promise(function(_0x8d7e46,_0x547868){db[_0xaee8('0x28')][_0xaee8('0x29')]()[_0xaee8('0x9')](function(_0x37cd94){return db[_0xaee8('0x20')]['findAll']({'raw':_0x292976[_0xaee8('0x16')]?_0x292976[_0xaee8('0x16')][_0xaee8('0x22')]===undefined?!![]:![]:!![],'where':_0x292976['options']?_0x292976[_0xaee8('0x16')]['where']||null:null,'attributes':_0x292976[_0xaee8('0x16')]?_0x292976[_0xaee8('0x16')][_0xaee8('0x18')]||null:null,'limit':_0x292976['options']?_0x292976[_0xaee8('0x16')][_0xaee8('0x19')]||null:null,'include':_0x292976[_0xaee8('0x16')]?_0x292976[_0xaee8('0x16')][_0xaee8('0x1a')]?_[_0xaee8('0x1b')](_0x292976[_0xaee8('0x16')][_0xaee8('0x1a')],function(_0x422189){return{'model':db[_0x422189['model']],'as':_0x422189['as'],'attributes':_0x422189['as']===_0xaee8('0x2e')?_[_0xaee8('0x2f')](_0x37cd94):_0x422189[_0xaee8('0x18')],'include':_0x422189['include']?_[_0xaee8('0x1b')](_0x422189[_0xaee8('0x1a')],function(_0x3b4ef3){return{'model':db[_0x3b4ef3['model']],'as':_0x3b4ef3['as'],'attributes':_0x3b4ef3['attributes'],'include':_0x3b4ef3['include']?_[_0xaee8('0x1b')](_0x3b4ef3['include'],function(_0x11ec85){return{'model':db[_0x11ec85['model']],'as':_0x11ec85['as'],'attributes':_0x11ec85[_0xaee8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56da10){logger[_0xaee8('0xa')](_0xaee8('0x14'),_0x292976);logger[_0xaee8('0xc')]('GetCmHopper',_0x292976,JSON['stringify'](_0x56da10));_0x8d7e46(_0x56da10);})[_0xaee8('0x13')](function(_0x78ceae){logger['error'](_0xaee8('0x14'),_0x78ceae[_0xaee8('0x11')],_0x292976);_0x547868(_0x336222[_0xaee8('0xe')](0x1f4,_0x78ceae[_0xaee8('0x11')]));});});});}; \ No newline at end of file +var _0x2fd9=['info','result','GetCmHopper','options','raw','where','attributes','limit','include','model','map','stringify','CmHopper','find','ShowCmHopper','catch','CreateCmHopper','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','findAll','LOCK','keys','User','Agent','name','voicePause','includes','UserId','push','all','MoveContactManagedDialer','transaction','CmHopperFinal','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','order','UPDATE','length','GetContactRecallMe','GetCmHopperPreview','CmContact','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code','CmHopper,\x20%s,\x20%s','message'];(function(_0x554bbe,_0x449e76){var _0x5cc316=function(_0x5e24a3){while(--_0x5e24a3){_0x554bbe['push'](_0x554bbe['shift']());}};_0x5cc316(++_0x449e76);}(_0x2fd9,0x1ae));var _0x92fd=function(_0x59625f,_0x3b2c76){_0x59625f=_0x59625f-0x0;var _0x498e1e=_0x2fd9[_0x59625f];return _0x498e1e;};'use strict';var _=require(_0x92fd('0x0'));var util=require(_0x92fd('0x1'));var moment=require(_0x92fd('0x2'));var BPromise=require('bluebird');var rs=require(_0x92fd('0x3'));var fs=require('fs');var Redis=require(_0x92fd('0x4'));var db=require(_0x92fd('0x5'))['db'];var utils=require(_0x92fd('0x6'));var logger=require(_0x92fd('0x7'))(_0x92fd('0x8'));var config=require(_0x92fd('0x9'));var jayson=require(_0x92fd('0xa'));var client=jayson[_0x92fd('0xb')][_0x92fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49df80,_0x2583e2,_0x5e55f6){return new BPromise(function(_0xc71958,_0x34e298){return client['request'](_0x49df80,_0x5e55f6)[_0x92fd('0xd')](function(_0x1a9226){logger['info']('CmHopper,\x20%s,\x20%s',_0x2583e2,_0x92fd('0xe'));logger[_0x92fd('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x2583e2,'request\x20sent',JSON['stringify'](_0x1a9226));if(_0x1a9226[_0x92fd('0x10')]){if(_0x1a9226[_0x92fd('0x10')][_0x92fd('0x11')]===0x1f4){logger[_0x92fd('0x10')](_0x92fd('0x12'),_0x2583e2,_0x1a9226[_0x92fd('0x10')]['message']);return _0x34e298(_0x1a9226['error'][_0x92fd('0x13')]);}logger[_0x92fd('0x10')](_0x92fd('0x12'),_0x2583e2,_0x1a9226[_0x92fd('0x10')][_0x92fd('0x13')]);return _0xc71958(_0x1a9226[_0x92fd('0x10')][_0x92fd('0x13')]);}else{logger[_0x92fd('0x14')](_0x92fd('0x12'),_0x2583e2,_0x92fd('0xe'));_0xc71958(_0x1a9226[_0x92fd('0x15')][_0x92fd('0x13')]);}})['catch'](function(_0x14ce23){logger[_0x92fd('0x10')]('CmHopper,\x20%s,\x20%s',_0x2583e2,_0x14ce23);_0x34e298(_0x14ce23);});});}exports[_0x92fd('0x16')]=function(_0x135cf2){var _0x1ca691=this;return new Promise(function(_0x2e5a55,_0x484037){return db['CmHopper']['findAll']({'raw':_0x135cf2[_0x92fd('0x17')]?_0x135cf2[_0x92fd('0x17')][_0x92fd('0x18')]===undefined?!![]:![]:!![],'where':_0x135cf2['options']?_0x135cf2[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'attributes':_0x135cf2[_0x92fd('0x17')]?_0x135cf2[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'limit':_0x135cf2[_0x92fd('0x17')]?_0x135cf2[_0x92fd('0x17')][_0x92fd('0x1b')]||null:null,'include':_0x135cf2[_0x92fd('0x17')]?_0x135cf2[_0x92fd('0x17')][_0x92fd('0x1c')]?_['map'](_0x135cf2['options'][_0x92fd('0x1c')],function(_0x19a8f1){return{'model':db[_0x19a8f1[_0x92fd('0x1d')]],'as':_0x19a8f1['as'],'attributes':_0x19a8f1[_0x92fd('0x1a')],'include':_0x19a8f1['include']?_[_0x92fd('0x1e')](_0x19a8f1[_0x92fd('0x1c')],function(_0x50503c){return{'model':db[_0x50503c['model']],'as':_0x50503c['as'],'attributes':_0x50503c[_0x92fd('0x1a')],'include':_0x50503c[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x50503c['include'],function(_0x1360cf){return{'model':db[_0x1360cf[_0x92fd('0x1d')]],'as':_0x1360cf['as'],'attributes':_0x1360cf[_0x92fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x92fd('0xd')](function(_0x14aa82){logger['info'](_0x92fd('0x16'),_0x135cf2);logger[_0x92fd('0xf')](_0x92fd('0x16'),_0x135cf2,JSON[_0x92fd('0x1f')](_0x14aa82));_0x2e5a55(_0x14aa82);})['catch'](function(_0x11b8ff){logger[_0x92fd('0x10')](_0x92fd('0x16'),_0x11b8ff[_0x92fd('0x13')],_0x135cf2);_0x484037(_0x1ca691['error'](0x1f4,_0x11b8ff['message']));});});};exports['ShowCmHopper']=function(_0x4edbf3){var _0x4c86e3=this;return new Promise(function(_0x14ccc5,_0xbb418f){return db[_0x92fd('0x20')][_0x92fd('0x21')]({'raw':_0x4edbf3[_0x92fd('0x17')]?_0x4edbf3[_0x92fd('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4edbf3[_0x92fd('0x17')]?_0x4edbf3[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'attributes':_0x4edbf3['options']?_0x4edbf3[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'include':_0x4edbf3[_0x92fd('0x17')]?_0x4edbf3['options'][_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x4edbf3[_0x92fd('0x17')][_0x92fd('0x1c')],function(_0x1d6e38){return{'model':db[_0x1d6e38[_0x92fd('0x1d')]],'as':_0x1d6e38['as'],'attributes':_0x1d6e38[_0x92fd('0x1a')],'include':_0x1d6e38[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x1d6e38[_0x92fd('0x1c')],function(_0x3014d2){return{'model':db[_0x3014d2[_0x92fd('0x1d')]],'as':_0x3014d2['as'],'attributes':_0x3014d2[_0x92fd('0x1a')],'include':_0x3014d2['include']?_[_0x92fd('0x1e')](_0x3014d2[_0x92fd('0x1c')],function(_0x34e42c){return{'model':db[_0x34e42c[_0x92fd('0x1d')]],'as':_0x34e42c['as'],'attributes':_0x34e42c[_0x92fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x92fd('0xd')](function(_0x50703a){logger[_0x92fd('0x14')](_0x92fd('0x22'),_0x4edbf3);logger['debug'](_0x92fd('0x22'),_0x4edbf3,JSON[_0x92fd('0x1f')](_0x50703a));_0x14ccc5(_0x50703a);})[_0x92fd('0x23')](function(_0x4b47c1){logger['error']('ShowCmHopper',_0x4b47c1[_0x92fd('0x13')],_0x4edbf3);_0xbb418f(_0x4c86e3[_0x92fd('0x10')](0x1f4,_0x4b47c1[_0x92fd('0x13')]));});});};exports[_0x92fd('0x24')]=function(_0x57a7fc){var _0x26942b=this;return new Promise(function(_0x32f3aa,_0x14721d){return db['CmHopper']['create'](_0x57a7fc[_0x92fd('0x25')],{'raw':_0x57a7fc['options']?_0x57a7fc[_0x92fd('0x17')][_0x92fd('0x18')]===undefined?!![]:![]:!![]})[_0x92fd('0xd')](function(_0x19726b){logger['info'](_0x92fd('0x24'),_0x57a7fc);logger[_0x92fd('0xf')]('CreateCmHopper',_0x57a7fc,JSON[_0x92fd('0x1f')](_0x19726b));_0x32f3aa(_0x19726b);})[_0x92fd('0x23')](function(_0x38622b){logger[_0x92fd('0x10')](_0x92fd('0x24'),_0x38622b[_0x92fd('0x13')],_0x57a7fc);_0x14721d(_0x26942b[_0x92fd('0x10')](0x1f4,_0x38622b['message']));});});};exports[_0x92fd('0x26')]=function(_0x4417b7){var _0x40bac1=this;return new Promise(function(_0x4a8e96,_0x11b116){return db[_0x92fd('0x20')][_0x92fd('0x27')](_0x4417b7[_0x92fd('0x25')],{'raw':_0x4417b7['options']?_0x4417b7['options'][_0x92fd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4417b7['options']?_0x4417b7[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'attributes':_0x4417b7[_0x92fd('0x17')]?_0x4417b7[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'limit':_0x4417b7[_0x92fd('0x17')]?_0x4417b7[_0x92fd('0x17')][_0x92fd('0x1b')]||null:null})[_0x92fd('0xd')](function(_0xe88611){logger[_0x92fd('0x14')](_0x92fd('0x26'),_0x4417b7);logger[_0x92fd('0xf')]('UpdateCmHopper',_0x4417b7,JSON['stringify'](_0xe88611));_0x4a8e96(_0xe88611);})['catch'](function(_0x4559c3){logger[_0x92fd('0x10')](_0x92fd('0x26'),_0x4559c3[_0x92fd('0x13')],_0x4417b7);_0x11b116(_0x40bac1[_0x92fd('0x10')](0x1f4,_0x4559c3[_0x92fd('0x13')]));});});};exports[_0x92fd('0x28')]=function(_0x2b5973){var _0x466a4d=this;return new Promise(function(_0x174109,_0x41949e){return db[_0x92fd('0x20')][_0x92fd('0x29')]({'where':_0x2b5973[_0x92fd('0x17')]?_0x2b5973[_0x92fd('0x17')]['where']||null:null})['then'](function(_0x109739){logger[_0x92fd('0x14')](_0x92fd('0x28'),_0x2b5973);logger[_0x92fd('0xf')](_0x92fd('0x28'),_0x2b5973,JSON[_0x92fd('0x1f')](_0x109739));_0x174109(_0x109739);})[_0x92fd('0x23')](function(_0x303b5d){logger[_0x92fd('0x10')]('DestroyCmHopper',_0x303b5d[_0x92fd('0x13')],_0x2b5973);_0x41949e(_0x466a4d[_0x92fd('0x10')](0x1f4,_0x303b5d[_0x92fd('0x13')]));});});};exports[_0x92fd('0x2a')]=function(_0x1d0fae){var _0x3be535=this;return new Promise(function(_0x27451b,_0x2d00f2){return db['CmContact'][_0x92fd('0x2b')]()[_0x92fd('0xd')](function(_0x5277a5){return db[_0x92fd('0x2c')]['transaction'](function(_0x187642){return db[_0x92fd('0x20')][_0x92fd('0x2d')]({'where':_0x1d0fae[_0x92fd('0x17')]?_0x1d0fae[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'attributes':_0x1d0fae[_0x92fd('0x17')]?_0x1d0fae[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'limit':_0x1d0fae['options']?_0x1d0fae['options']['limit']||null:null,'order':_0x1d0fae[_0x92fd('0x17')]?_0x1d0fae[_0x92fd('0x17')]['order']||null:null,'transaction':_0x187642,'lock':_0x187642[_0x92fd('0x2e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x92fd('0x2f')](_0x5277a5)},{'model':db[_0x92fd('0x30')],'as':_0x92fd('0x31'),'attributes':['id',_0x92fd('0x32'),_0x92fd('0x33')]}]})['then'](function(_0x4404a8){var _0x2eba52=[];var _0x34dfcb=[];for(var _0xb34ab2=0x0;_0xb34ab2<_0x4404a8['length'];_0xb34ab2+=0x1){if(!_0x34dfcb[_0x92fd('0x34')](_0x4404a8[_0xb34ab2]['UserId'])){_0x34dfcb['push'](_0x4404a8[_0xb34ab2][_0x92fd('0x35')]);_0x2eba52[_0x92fd('0x36')](_0x4404a8[_0xb34ab2][_0x92fd('0x27')](_0x1d0fae['body'],{'transaction':_0x187642}));}}return BPromise[_0x92fd('0x37')](_0x2eba52);});})[_0x92fd('0xd')](function(_0x57b4e0){logger[_0x92fd('0x14')](_0x92fd('0x2a'),_0x1d0fae);logger[_0x92fd('0xf')](_0x92fd('0x2a'),_0x1d0fae,JSON['stringify'](_0x57b4e0));_0x27451b(_0x57b4e0);})[_0x92fd('0x23')](function(_0x303148){logger['error']('GetContactDialer',_0x303148['message'],_0x1d0fae);_0x2d00f2(_0x3be535[_0x92fd('0x10')](0x1f4,_0x303148[_0x92fd('0x13')]));});});});};exports[_0x92fd('0x38')]=function(_0x696bd6){var _0x1602f9=this;return new Promise(function(_0x487f6e,_0x25ea1c){return db[_0x92fd('0x2c')][_0x92fd('0x39')](function(_0x76aafd){return db[_0x92fd('0x3a')][_0x92fd('0x3b')](_0x696bd6[_0x92fd('0x25')],{'raw':_0x696bd6['options']?_0x696bd6[_0x92fd('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x76aafd})[_0x92fd('0xd')](function(){return db[_0x92fd('0x20')]['destroy']({'where':_0x696bd6[_0x92fd('0x17')]?_0x696bd6[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'transaction':_0x76aafd});});})[_0x92fd('0xd')](function(_0x1a67d1){logger[_0x92fd('0x14')](_0x92fd('0x38'),_0x696bd6);logger['debug'](_0x92fd('0x38'),_0x696bd6,JSON[_0x92fd('0x1f')](_0x1a67d1));_0x487f6e(_0x1a67d1);})['catch'](function(_0x98b2b6){logger[_0x92fd('0x10')](_0x92fd('0x38'),_0x98b2b6[_0x92fd('0x13')],_0x696bd6);_0x25ea1c(_0x1602f9['error'](0x1f4,_0x98b2b6[_0x92fd('0x13')]));});});};exports[_0x92fd('0x3c')]=function(_0x21405c){var _0x56a628=this;return new Promise(function(_0xd52e6b,_0x2d0021){return db['CmHopper'][_0x92fd('0x2d')]({'raw':_0x21405c[_0x92fd('0x17')]?_0x21405c['options']['raw']===undefined?!![]:![]:!![],'where':_0x21405c[_0x92fd('0x17')]?_0x21405c[_0x92fd('0x17')][_0x92fd('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0x92fd('0x3d'),db[_0x92fd('0x2c')]['fn']('IF',db[_0x92fd('0x2c')][_0x92fd('0x3e')](_0x92fd('0x3f')+util['format'](_0x92fd('0x40'),moment()[_0x92fd('0x41')](_0x92fd('0x42')))+_0x92fd('0x43')))),_0x92fd('0x44')]]})[_0x92fd('0xd')](function(_0x454023){logger['info'](_0x92fd('0x3c'),_0x21405c);logger['debug']('CountReScheduled',_0x21405c,JSON[_0x92fd('0x1f')](_0x454023));_0xd52e6b(_0x454023);})[_0x92fd('0x23')](function(_0x3861ca){logger[_0x92fd('0x10')](_0x92fd('0x3c'),_0x3861ca[_0x92fd('0x13')],_0x21405c);_0x2d0021(_0x56a628[_0x92fd('0x10')](0x1f4,_0x3861ca[_0x92fd('0x13')]));});});};exports['GetContactRecallMe']=function(_0x433fb1){var _0x2b94e3=this;return new Promise(function(_0xc650da,_0x27d30c){return db['CmContact'][_0x92fd('0x2b')]()[_0x92fd('0xd')](function(_0x4aeac9){return db[_0x92fd('0x2c')][_0x92fd('0x39')](function(_0x4d0f22){return db[_0x92fd('0x20')][_0x92fd('0x2d')]({'where':_0x433fb1['options']?_0x433fb1[_0x92fd('0x17')]['where']||null:null,'attributes':_0x433fb1['options']?_0x433fb1[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'limit':0x1,'order':_0x433fb1[_0x92fd('0x17')]?_0x433fb1['options'][_0x92fd('0x45')]||null:null,'group':db[_0x92fd('0x20')][_0x92fd('0x35')],'transaction':_0x4d0f22,'lock':_0x4d0f22[_0x92fd('0x2e')][_0x92fd('0x46')],'include':_0x433fb1['options']?_0x433fb1[_0x92fd('0x17')][_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x433fb1['options'][_0x92fd('0x1c')],function(_0x1613a2){return{'model':db[_0x1613a2[_0x92fd('0x1d')]],'as':_0x1613a2['as'],'attributes':_0x1613a2[_0x92fd('0x1a')],'include':_0x1613a2[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x1613a2[_0x92fd('0x1c')],function(_0x2b3e31){return{'model':db[_0x2b3e31[_0x92fd('0x1d')]],'as':_0x2b3e31['as'],'attributes':_0x2b3e31[_0x92fd('0x1a')],'include':_0x2b3e31[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x2b3e31[_0x92fd('0x1c')],function(_0x3fea50){return{'model':db[_0x3fea50[_0x92fd('0x1d')]],'as':_0x3fea50['as'],'attributes':_0x3fea50[_0x92fd('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x92fd('0xd')](function(_0x37f51f){var _0x4a6371=[];for(var _0xc6f0e2=0x0;_0xc6f0e2<_0x37f51f[_0x92fd('0x47')];_0xc6f0e2+=0x1){_0x4a6371[_0x92fd('0x36')](_0x37f51f[_0xc6f0e2]['update'](_0x433fb1[_0x92fd('0x25')],{'transaction':_0x4d0f22}));}return BPromise[_0x92fd('0x37')](_0x4a6371);});})[_0x92fd('0xd')](function(_0x138eaf){logger[_0x92fd('0x14')](_0x92fd('0x48'),_0x433fb1);logger[_0x92fd('0xf')](_0x92fd('0x48'),_0x433fb1,JSON[_0x92fd('0x1f')](_0x138eaf));_0xc650da(_0x138eaf);})[_0x92fd('0x23')](function(_0xdbb530){logger[_0x92fd('0x10')](_0x92fd('0x48'),_0xdbb530[_0x92fd('0x13')],_0x433fb1);_0x27d30c(_0x2b94e3[_0x92fd('0x10')](0x1f4,_0xdbb530[_0x92fd('0x13')]));});});});};exports[_0x92fd('0x49')]=function(_0x282b26){var _0x4e679f=this;return new Promise(function(_0x27e9a5,_0x103a60){db[_0x92fd('0x4a')][_0x92fd('0x2b')]()[_0x92fd('0xd')](function(_0x28fa14){return db['CmHopper'][_0x92fd('0x2d')]({'raw':_0x282b26[_0x92fd('0x17')]?_0x282b26[_0x92fd('0x17')][_0x92fd('0x18')]===undefined?!![]:![]:!![],'where':_0x282b26[_0x92fd('0x17')]?_0x282b26['options'][_0x92fd('0x19')]||null:null,'attributes':_0x282b26[_0x92fd('0x17')]?_0x282b26[_0x92fd('0x17')][_0x92fd('0x1a')]||null:null,'limit':_0x282b26['options']?_0x282b26[_0x92fd('0x17')]['limit']||null:null,'include':_0x282b26[_0x92fd('0x17')]?_0x282b26[_0x92fd('0x17')][_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x282b26[_0x92fd('0x17')][_0x92fd('0x1c')],function(_0x5abaa8){return{'model':db[_0x5abaa8[_0x92fd('0x1d')]],'as':_0x5abaa8['as'],'attributes':_0x5abaa8['as']==='Contact'?_[_0x92fd('0x2f')](_0x28fa14):_0x5abaa8[_0x92fd('0x1a')],'include':_0x5abaa8[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x5abaa8['include'],function(_0x1d10c6){return{'model':db[_0x1d10c6[_0x92fd('0x1d')]],'as':_0x1d10c6['as'],'attributes':_0x1d10c6[_0x92fd('0x1a')],'include':_0x1d10c6[_0x92fd('0x1c')]?_[_0x92fd('0x1e')](_0x1d10c6[_0x92fd('0x1c')],function(_0x185430){return{'model':db[_0x185430[_0x92fd('0x1d')]],'as':_0x185430['as'],'attributes':_0x185430['attributes']};}):[]};}):[]};}):[]:[]})[_0x92fd('0xd')](function(_0x59675a){logger[_0x92fd('0x14')](_0x92fd('0x16'),_0x282b26);logger[_0x92fd('0xf')](_0x92fd('0x16'),_0x282b26,JSON[_0x92fd('0x1f')](_0x59675a));_0x27e9a5(_0x59675a);})[_0x92fd('0x23')](function(_0x4d15ce){logger[_0x92fd('0x10')]('GetCmHopper',_0x4d15ce[_0x92fd('0x13')],_0x282b26);_0x103a60(_0x4e679f[_0x92fd('0x10')](0x1f4,_0x4d15ce['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b1a9599..263c29f 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 _0x30c7=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','getOpenContacts','/:id','show','post','create','getPreview','put','update','delete','destroy','exports'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x30c7,0x111));var _0x730c=function(_0x4154c7,_0x2ae804){_0x4154c7=_0x4154c7-0x0;var _0xad1a71=_0x30c7[_0x4154c7];return _0xad1a71;};'use strict';var multer=require(_0x730c('0x0'));var util=require('util');var path=require(_0x730c('0x1'));var timeout=require(_0x730c('0x2'));var express=require(_0x730c('0x3'));var router=express['Router']();var auth=require(_0x730c('0x4'));var interaction=require(_0x730c('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x730c('0x6')]);router[_0x730c('0x7')]('/describe',auth[_0x730c('0x8')](),controller[_0x730c('0x9')]);router[_0x730c('0x7')]('/opencontacts',auth[_0x730c('0x8')](),controller[_0x730c('0xa')]);router['get'](_0x730c('0xb'),auth[_0x730c('0x8')](),controller[_0x730c('0xc')]);router[_0x730c('0xd')]('/',auth[_0x730c('0x8')](),controller[_0x730c('0xe')]);router[_0x730c('0xd')]('/preview',auth[_0x730c('0x8')](),controller[_0x730c('0xf')]);router[_0x730c('0x10')](_0x730c('0xb'),auth['isAuthenticated'](),controller[_0x730c('0x11')]);router[_0x730c('0x12')](_0x730c('0xb'),auth[_0x730c('0x8')](),controller[_0x730c('0x13')]);module[_0x730c('0x14')]=router; \ No newline at end of file +var _0x2884=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','update','delete','destroy','multer','path','connect-timeout'];(function(_0x1ee299,_0xaef0b0){var _0x492982=function(_0xa797b5){while(--_0xa797b5){_0x1ee299['push'](_0x1ee299['shift']());}};_0x492982(++_0xaef0b0);}(_0x2884,0x1eb));var _0x4288=function(_0x185c5e,_0x1b05f5){_0x185c5e=_0x185c5e-0x0;var _0x14053a=_0x2884[_0x185c5e];return _0x14053a;};'use strict';var multer=require(_0x4288('0x0'));var util=require('util');var path=require(_0x4288('0x1'));var timeout=require(_0x4288('0x2'));var express=require(_0x4288('0x3'));var router=express['Router']();var auth=require(_0x4288('0x4'));var interaction=require(_0x4288('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0x4288('0x6')]('/',auth[_0x4288('0x7')](),controller[_0x4288('0x8')]);router['get']('/describe',auth[_0x4288('0x7')](),controller['describe']);router[_0x4288('0x6')](_0x4288('0x9'),auth['isAuthenticated'](),controller[_0x4288('0xa')]);router[_0x4288('0x6')](_0x4288('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4288('0xc')]('/',auth[_0x4288('0x7')](),controller[_0x4288('0xd')]);router[_0x4288('0xc')](_0x4288('0xe'),auth[_0x4288('0x7')](),controller[_0x4288('0xf')]);router['put'](_0x4288('0xb'),auth[_0x4288('0x7')](),controller[_0x4288('0x10')]);router[_0x4288('0x11')]('/:id',auth[_0x4288('0x7')](),controller[_0x4288('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ffeb0bf..5592ee6 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 _0x22e5=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x38c3c8,_0x25a7c5){var _0x256252=function(_0x282b1d){while(--_0x282b1d){_0x38c3c8['push'](_0x38c3c8['shift']());}};_0x256252(++_0x25a7c5);}(_0x22e5,0x185));var _0x522e=function(_0x145e2c,_0x3128e9){_0x145e2c=_0x145e2c-0x0;var _0x3bbd82=_0x22e5[_0x145e2c];return _0x3bbd82;};'use strict';var moment=require(_0x522e('0x0'));var Sequelize=require(_0x522e('0x1'));module[_0x522e('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x522e('0x3')],'unique':_0x522e('0x4')},'ListId':{'type':Sequelize[_0x522e('0x3')],'unique':_0x522e('0x4')},'VoiceQueueId':{'type':Sequelize[_0x522e('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x25e9=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x505245,_0x39fd3e){var _0x23612e=function(_0x4579e1){while(--_0x4579e1){_0x505245['push'](_0x505245['shift']());}};_0x23612e(++_0x39fd3e);}(_0x25e9,0x1a8));var _0x925e=function(_0x22b2be,_0x4b164c){_0x22b2be=_0x22b2be-0x0;var _0x213c31=_0x25e9[_0x22b2be];return _0x213c31;};'use strict';var moment=require(_0x925e('0x0'));var Sequelize=require(_0x925e('0x1'));module[_0x925e('0x2')]={'phone':{'type':Sequelize[_0x925e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x925e('0x4')],'unique':_0x925e('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x925e('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 242f911..7e279df 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','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','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x4ed802,_0x5c66a2){var _0x390c99=function(_0x24683d){while(--_0x24683d){_0x4ed802['push'](_0x4ed802['shift']());}};_0x390c99(++_0x5c66a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','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','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0xc58a59,_0x5c5875){var _0x456aa6=function(_0x4cdbf1){while(--_0x4cdbf1){_0xc58a59['push'](_0xc58a59['shift']());}};_0x456aa6(++_0x5c5875);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index dc3c49c..13631d1 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 _0x5f66=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','api'];(function(_0x4528cf,_0x3b1892){var _0x4bca53=function(_0x47d77b){while(--_0x47d77b){_0x4528cf['push'](_0x4528cf['shift']());}};_0x4bca53(++_0x3b1892);}(_0x5f66,0xc0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x65f6('0x0'));var util=require(_0x65f6('0x1'));var logger=require(_0x65f6('0x2'))(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var rp=require(_0x65f6('0x6'));var fs=require('fs');var path=require(_0x65f6('0x7'));var rimraf=require(_0x65f6('0x8'));var config=require(_0x65f6('0x9'));var attributes=require(_0x65f6('0xa'));module[_0x65f6('0xb')]=function(_0x1347d0,_0x4c634c){return _0x1347d0[_0x65f6('0xc')](_0x65f6('0xd'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8d3=['cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack'];(function(_0x1f8f86,_0x3e1fe6){var _0x21359d=function(_0x599184){while(--_0x599184){_0x1f8f86['push'](_0x1f8f86['shift']());}};_0x21359d(++_0x3e1fe6);}(_0xb8d3,0x151));var _0x3b8d=function(_0x57fda8,_0x5e80a0){_0x57fda8=_0x57fda8-0x0;var _0x11c895=_0xb8d3[_0x57fda8];return _0x11c895;};'use strict';var _=require(_0x3b8d('0x0'));var util=require(_0x3b8d('0x1'));var logger=require(_0x3b8d('0x2'))(_0x3b8d('0x3'));var moment=require(_0x3b8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x3b8d('0x5'));var fs=require('fs');var path=require(_0x3b8d('0x6'));var rimraf=require(_0x3b8d('0x7'));var config=require(_0x3b8d('0x8'));var attributes=require(_0x3b8d('0x9'));module[_0x3b8d('0xa')]=function(_0x154386,_0x31a268){return _0x154386[_0x3b8d('0xb')](_0x3b8d('0xc'),attributes,{'tableName':_0x3b8d('0xd'),'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 af74793..78cfbf6 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 _0xec70=['then','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x163b12,_0x140f0b){var _0x44118f=function(_0x588744){while(--_0x588744){_0x163b12['push'](_0x163b12['shift']());}};_0x44118f(++_0x140f0b);}(_0xec70,0xf2));var _0x0ec7=function(_0x4812dd,_0x38e4db){_0x4812dd=_0x4812dd-0x0;var _0x5bade8=_0xec70[_0x4812dd];return _0x5bade8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ec7('0x0'));var BPromise=require(_0x0ec7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ec7('0x2'));var db=require(_0x0ec7('0x3'))['db'];var utils=require(_0x0ec7('0x4'));var logger=require(_0x0ec7('0x5'))(_0x0ec7('0x6'));var config=require(_0x0ec7('0x7'));var jayson=require(_0x0ec7('0x8'));var client=jayson[_0x0ec7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ad,_0x54aa1b,_0xdf5c75){return new BPromise(function(_0x562531,_0x549b38){return client[_0x0ec7('0xa')](_0x2d69ad,_0xdf5c75)['then'](function(_0x1676c6){logger['info'](_0x0ec7('0xb'),_0x54aa1b,_0x0ec7('0xc'));logger[_0x0ec7('0xd')](_0x0ec7('0xe'),_0x54aa1b,_0x0ec7('0xc'),JSON['stringify'](_0x1676c6));if(_0x1676c6[_0x0ec7('0xf')]){if(_0x1676c6[_0x0ec7('0xf')][_0x0ec7('0x10')]===0x1f4){logger[_0x0ec7('0xf')](_0x0ec7('0xb'),_0x54aa1b,_0x1676c6[_0x0ec7('0xf')][_0x0ec7('0x11')]);return _0x549b38(_0x1676c6[_0x0ec7('0xf')][_0x0ec7('0x11')]);}logger['error'](_0x0ec7('0xb'),_0x54aa1b,_0x1676c6['error'][_0x0ec7('0x11')]);return _0x562531(_0x1676c6[_0x0ec7('0xf')][_0x0ec7('0x11')]);}else{logger[_0x0ec7('0x12')](_0x0ec7('0xb'),_0x54aa1b,'request\x20sent');_0x562531(_0x1676c6[_0x0ec7('0x13')]['message']);}})[_0x0ec7('0x14')](function(_0x44d0c4){logger[_0x0ec7('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x54aa1b,_0x44d0c4);_0x549b38(_0x44d0c4);});});}exports['GetCmHopperBlack']=function(_0x2df137){var _0x39930b=this;return new Promise(function(_0x176917,_0x4a9540){return db[_0x0ec7('0x15')][_0x0ec7('0x16')]({'raw':_0x2df137[_0x0ec7('0x17')]?_0x2df137['options'][_0x0ec7('0x18')]===undefined?!![]:![]:!![],'where':_0x2df137[_0x0ec7('0x17')]?_0x2df137[_0x0ec7('0x17')][_0x0ec7('0x19')]||null:null,'attributes':_0x2df137[_0x0ec7('0x17')]?_0x2df137[_0x0ec7('0x17')][_0x0ec7('0x1a')]||null:null,'limit':_0x2df137[_0x0ec7('0x17')]?_0x2df137[_0x0ec7('0x17')][_0x0ec7('0x1b')]||null:null,'include':_0x2df137[_0x0ec7('0x17')]?_0x2df137['options']['include']?_['map'](_0x2df137[_0x0ec7('0x17')]['include'],function(_0x4a5778){return{'model':db[_0x4a5778['model']],'as':_0x4a5778['as'],'attributes':_0x4a5778[_0x0ec7('0x1a')],'include':_0x4a5778[_0x0ec7('0x1c')]?_[_0x0ec7('0x1d')](_0x4a5778['include'],function(_0x2cf151){return{'model':db[_0x2cf151[_0x0ec7('0x1e')]],'as':_0x2cf151['as'],'attributes':_0x2cf151[_0x0ec7('0x1a')],'include':_0x2cf151[_0x0ec7('0x1c')]?_['map'](_0x2cf151[_0x0ec7('0x1c')],function(_0x18698b){return{'model':db[_0x18698b[_0x0ec7('0x1e')]],'as':_0x18698b['as'],'attributes':_0x18698b[_0x0ec7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0ec7('0x1f')](function(_0x322ad7){logger['info'](_0x0ec7('0x20'),_0x2df137);logger[_0x0ec7('0xd')](_0x0ec7('0x20'),_0x2df137,JSON[_0x0ec7('0x21')](_0x322ad7));_0x176917(_0x322ad7);})[_0x0ec7('0x14')](function(_0x400bae){logger[_0x0ec7('0xf')]('GetCmHopperBlack',_0x400bae[_0x0ec7('0x11')],_0x2df137);_0x4a9540(_0x39930b[_0x0ec7('0xf')](0x1f4,_0x400bae[_0x0ec7('0x11')]));});});};exports[_0x0ec7('0x22')]=function(_0x4077a7){var _0x205244=this;return new Promise(function(_0x4ba97e,_0x2108a7){return db[_0x0ec7('0x15')][_0x0ec7('0x23')](_0x4077a7[_0x0ec7('0x24')],{'raw':_0x4077a7[_0x0ec7('0x17')]?_0x4077a7[_0x0ec7('0x17')][_0x0ec7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4077a7[_0x0ec7('0x17')]?_0x4077a7['options'][_0x0ec7('0x19')]||null:null,'attributes':_0x4077a7[_0x0ec7('0x17')]?_0x4077a7[_0x0ec7('0x17')]['attributes']||null:null,'limit':_0x4077a7[_0x0ec7('0x17')]?_0x4077a7['options'][_0x0ec7('0x1b')]||null:null})['then'](function(_0x40a160){logger['info']('UpdateCmHopperBlack',_0x4077a7);logger[_0x0ec7('0xd')](_0x0ec7('0x22'),_0x4077a7,JSON['stringify'](_0x40a160));_0x4ba97e(_0x40a160);})[_0x0ec7('0x14')](function(_0x1505fd){logger['error'](_0x0ec7('0x22'),_0x1505fd[_0x0ec7('0x11')],_0x4077a7);_0x2108a7(_0x205244[_0x0ec7('0xf')](0x1f4,_0x1505fd[_0x0ec7('0x11')]));});});};exports[_0x0ec7('0x25')]=function(_0x286a5b){var _0x42583b=this;return new Promise(function(_0x14bd46,_0x401ccf){return db['CmHopperBlack'][_0x0ec7('0x26')]({'where':_0x286a5b[_0x0ec7('0x17')]?_0x286a5b[_0x0ec7('0x17')][_0x0ec7('0x19')]||null:null})[_0x0ec7('0x1f')](function(_0xd8efc5){logger[_0x0ec7('0x12')]('DestroyCmHopperBlack',_0x286a5b);logger[_0x0ec7('0xd')](_0x0ec7('0x25'),_0x286a5b,JSON[_0x0ec7('0x21')](_0xd8efc5));_0x14bd46(_0xd8efc5);})[_0x0ec7('0x14')](function(_0x116edf){logger['error'](_0x0ec7('0x25'),_0x116edf[_0x0ec7('0x11')],_0x286a5b);_0x401ccf(_0x42583b[_0x0ec7('0xf')](0x1f4,_0x116edf[_0x0ec7('0x11')]));});});}; \ No newline at end of file +var _0x4c59=['where','attributes','include','model','map','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','info','catch','CmHopperBlack','options','raw'];(function(_0x17b9d0,_0x3ac188){var _0x40b459=function(_0x160671){while(--_0x160671){_0x17b9d0['push'](_0x17b9d0['shift']());}};_0x40b459(++_0x3ac188);}(_0x4c59,0x1af));var _0x94c5=function(_0x7ecd61,_0x28c775){_0x7ecd61=_0x7ecd61-0x0;var _0x67d35d=_0x4c59[_0x7ecd61];return _0x67d35d;};'use strict';var _=require(_0x94c5('0x0'));var util=require(_0x94c5('0x1'));var moment=require('moment');var BPromise=require(_0x94c5('0x2'));var rs=require(_0x94c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x94c5('0x4'));var logger=require(_0x94c5('0x5'))(_0x94c5('0x6'));var config=require(_0x94c5('0x7'));var jayson=require(_0x94c5('0x8'));var client=jayson[_0x94c5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39889e,_0x285de6,_0x24ab42){return new BPromise(function(_0x51e557,_0x2a8943){return client[_0x94c5('0xa')](_0x39889e,_0x24ab42)[_0x94c5('0xb')](function(_0x562b70){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x285de6,_0x94c5('0xc'));logger[_0x94c5('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x285de6,_0x94c5('0xc'),JSON[_0x94c5('0xe')](_0x562b70));if(_0x562b70[_0x94c5('0xf')]){if(_0x562b70[_0x94c5('0xf')][_0x94c5('0x10')]===0x1f4){logger[_0x94c5('0xf')](_0x94c5('0x11'),_0x285de6,_0x562b70['error'][_0x94c5('0x12')]);return _0x2a8943(_0x562b70[_0x94c5('0xf')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x285de6,_0x562b70['error'][_0x94c5('0x12')]);return _0x51e557(_0x562b70['error']['message']);}else{logger[_0x94c5('0x13')](_0x94c5('0x11'),_0x285de6,_0x94c5('0xc'));_0x51e557(_0x562b70['result'][_0x94c5('0x12')]);}})[_0x94c5('0x14')](function(_0x27e2bf){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x285de6,_0x27e2bf);_0x2a8943(_0x27e2bf);});});}exports['GetCmHopperBlack']=function(_0x58a9f9){var _0x59d788=this;return new Promise(function(_0x310a11,_0x20c49f){return db[_0x94c5('0x15')]['findAll']({'raw':_0x58a9f9[_0x94c5('0x16')]?_0x58a9f9[_0x94c5('0x16')][_0x94c5('0x17')]===undefined?!![]:![]:!![],'where':_0x58a9f9[_0x94c5('0x16')]?_0x58a9f9['options'][_0x94c5('0x18')]||null:null,'attributes':_0x58a9f9[_0x94c5('0x16')]?_0x58a9f9[_0x94c5('0x16')][_0x94c5('0x19')]||null:null,'limit':_0x58a9f9[_0x94c5('0x16')]?_0x58a9f9['options']['limit']||null:null,'include':_0x58a9f9[_0x94c5('0x16')]?_0x58a9f9[_0x94c5('0x16')][_0x94c5('0x1a')]?_['map'](_0x58a9f9[_0x94c5('0x16')]['include'],function(_0x24b324){return{'model':db[_0x24b324[_0x94c5('0x1b')]],'as':_0x24b324['as'],'attributes':_0x24b324[_0x94c5('0x19')],'include':_0x24b324[_0x94c5('0x1a')]?_[_0x94c5('0x1c')](_0x24b324[_0x94c5('0x1a')],function(_0x561092){return{'model':db[_0x561092[_0x94c5('0x1b')]],'as':_0x561092['as'],'attributes':_0x561092[_0x94c5('0x19')],'include':_0x561092[_0x94c5('0x1a')]?_[_0x94c5('0x1c')](_0x561092['include'],function(_0x18210c){return{'model':db[_0x18210c[_0x94c5('0x1b')]],'as':_0x18210c['as'],'attributes':_0x18210c[_0x94c5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x94c5('0xb')](function(_0x41f1da){logger[_0x94c5('0x13')](_0x94c5('0x1d'),_0x58a9f9);logger[_0x94c5('0xd')](_0x94c5('0x1d'),_0x58a9f9,JSON[_0x94c5('0xe')](_0x41f1da));_0x310a11(_0x41f1da);})[_0x94c5('0x14')](function(_0x58edae){logger['error'](_0x94c5('0x1d'),_0x58edae[_0x94c5('0x12')],_0x58a9f9);_0x20c49f(_0x59d788['error'](0x1f4,_0x58edae[_0x94c5('0x12')]));});});};exports[_0x94c5('0x1e')]=function(_0x163765){var _0xc9fe51=this;return new Promise(function(_0x9af015,_0x12518c){return db['CmHopperBlack'][_0x94c5('0x1f')](_0x163765[_0x94c5('0x20')],{'raw':_0x163765['options']?_0x163765[_0x94c5('0x16')][_0x94c5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x163765[_0x94c5('0x16')]?_0x163765[_0x94c5('0x16')]['where']||null:null,'attributes':_0x163765[_0x94c5('0x16')]?_0x163765[_0x94c5('0x16')][_0x94c5('0x19')]||null:null,'limit':_0x163765[_0x94c5('0x16')]?_0x163765[_0x94c5('0x16')]['limit']||null:null})['then'](function(_0x578e2f){logger['info']('UpdateCmHopperBlack',_0x163765);logger[_0x94c5('0xd')](_0x94c5('0x1e'),_0x163765,JSON[_0x94c5('0xe')](_0x578e2f));_0x9af015(_0x578e2f);})[_0x94c5('0x14')](function(_0x363078){logger[_0x94c5('0xf')](_0x94c5('0x1e'),_0x363078['message'],_0x163765);_0x12518c(_0xc9fe51['error'](0x1f4,_0x363078[_0x94c5('0x12')]));});});};exports[_0x94c5('0x21')]=function(_0x44609a){var _0x17f83f=this;return new Promise(function(_0xd0fda4,_0x32b06f){return db['CmHopperBlack'][_0x94c5('0x22')]({'where':_0x44609a[_0x94c5('0x16')]?_0x44609a['options'][_0x94c5('0x18')]||null:null})['then'](function(_0x59077e){logger[_0x94c5('0x13')]('DestroyCmHopperBlack',_0x44609a);logger['debug'](_0x94c5('0x21'),_0x44609a,JSON['stringify'](_0x59077e));_0xd0fda4(_0x59077e);})['catch'](function(_0x2fc910){logger[_0x94c5('0xf')]('DestroyCmHopperBlack',_0x2fc910['message'],_0x44609a);_0x32b06f(_0x17f83f[_0x94c5('0xf')](0x1f4,_0x2fc910[_0x94c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 03e65d4..c77765d 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 _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(_0x34cad9,_0x3fa757){var _0x2f8aa4=function(_0x364bc8){while(--_0x364bc8){_0x34cad9['push'](_0x34cad9['shift']());}};_0x2f8aa4(++_0x3fa757);}(_0xda55,0x6d));var _0x5da5=function(_0x34049b,_0x2a5f1b){_0x34049b=_0x34049b-0x0;var _0x3a82e9=_0xda55[_0x34049b];return _0x3a82e9;};'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 +var _0x9a19=['/describe','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index'];(function(_0x299020,_0x206dac){var _0x32152f=function(_0x191f8d){while(--_0x191f8d){_0x299020['push'](_0x299020['shift']());}};_0x32152f(++_0x206dac);}(_0x9a19,0x114));var _0x99a1=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x9a19[_0x152fe3];return _0xc5bb39;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var auth=require(_0x99a1('0x5'));var interaction=require(_0x99a1('0x6'));var config=require(_0x99a1('0x7'));var controller=require(_0x99a1('0x8'));router[_0x99a1('0x9')]('/',auth[_0x99a1('0xa')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x9')](_0x99a1('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller['show']);router['put'](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller[_0x99a1('0xe')]);router[_0x99a1('0xf')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x10')]);module[_0x99a1('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6c8a6ea..fa5fc86 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 _0xc6af=['getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN','moment','INTEGER','DATE','STRING'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xc6af,0x1d2));var _0xfc6a=function(_0xcdcb27,_0x25af6f){_0xcdcb27=_0xcdcb27-0x0;var _0x214445=_0xc6af[_0xcdcb27];return _0x214445;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfc6a('0x0'));module['exports']={'state':{'type':Sequelize[_0xfc6a('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xfc6a('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfc6a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xfc6a('0x3')]},'originatecalleridname':{'type':Sequelize[_0xfc6a('0x3')]},'calleridnum':{'type':Sequelize[_0xfc6a('0x3')]},'calleridname':{'type':Sequelize[_0xfc6a('0x3')]},'starttime':{'type':Sequelize[_0xfc6a('0x2')]},'responsetime':{'type':Sequelize[_0xfc6a('0x2')]},'answertime':{'type':Sequelize[_0xfc6a('0x2')]},'droptime':{'type':Sequelize[_0xfc6a('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfc6a('0x3')]},'campaign':{'type':Sequelize[_0xfc6a('0x3')]},'campaigntype':{'type':Sequelize[_0xfc6a('0x3')]},'membername':{'type':Sequelize[_0xfc6a('0x3')]},'reason':{'type':Sequelize[_0xfc6a('0x3')]},'disposition':{'type':Sequelize[_0xfc6a('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x463c41){var _0x32ac52=this[_0xfc6a('0x4')](_0xfc6a('0x5'));if(_0x32ac52&&_0x463c41){this[_0xfc6a('0x6')](_0xfc6a('0x7'),moment(_0x463c41)[_0xfc6a('0x8')](moment(_0x32ac52),'seconds'));}return this[_0xfc6a('0x6')]('dispositionat',_0x463c41);}},'amd':{'type':Sequelize[_0xfc6a('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfc6a('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfc6a('0x2')]},'callback':{'type':Sequelize[_0xfc6a('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfc6a('0x2')]},'deleted':{'type':Sequelize[_0xfc6a('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfc6a('0x2')]},'recallme':{'type':Sequelize[_0xfc6a('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xfc6a('0x2')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfc6a('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a04=['endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x5e8bfa,_0x1e83d1){var _0x10b312=function(_0x2613e6){while(--_0x2613e6){_0x5e8bfa['push'](_0x5e8bfa['shift']());}};_0x10b312(++_0x1e83d1);}(_0x3a04,0x171));var _0x43a0=function(_0xb4b80e,_0x1f02e8){_0xb4b80e=_0xb4b80e-0x0;var _0x5e4846=_0x3a04[_0xb4b80e];return _0x5e4846;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x43a0('0x0')]={'state':{'type':Sequelize[_0x43a0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x43a0('0x2')]},'scheduledat':{'type':Sequelize[_0x43a0('0x3')]},'countbusyretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x43a0('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x43a0('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43a0('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x43a0('0x3')]},'answertime':{'type':Sequelize[_0x43a0('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x43a0('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x43a0('0x2')]},'campaigntype':{'type':Sequelize[_0x43a0('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x43a0('0x3')],'set':function(_0x5842df){var _0x2523b4=this[_0x43a0('0x4')](_0x43a0('0x5'));if(_0x2523b4&&_0x5842df){this[_0x43a0('0x6')]('followuptime',moment(_0x5842df)[_0x43a0('0x7')](moment(_0x2523b4),_0x43a0('0x8')));}return this[_0x43a0('0x6')](_0x43a0('0x9'),_0x5842df);}},'amd':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x43a0('0x3')]},'callback':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x43a0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x43a0('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x43a0('0x3')]},'recallme':{'type':Sequelize[_0x43a0('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x43a0('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x43a0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 8eb9b53..17f3140 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 _0x8b52=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','describe','update','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','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','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','phone','from','cm_hopper','select','calleridnum','state\x20=\x204','Campaign','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','save','then','end','sendStatus','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','key','model','query'];(function(_0x4b1508,_0x3ec884){var _0x4e8f0b=function(_0x1a9c6f){while(--_0x1a9c6f){_0x4b1508['push'](_0x4b1508['shift']());}};_0x4e8f0b(++_0x3ec884);}(_0x8b52,0x151));var _0x28b5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8b52[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require(_0x28b5('0x0'));var emlformat=require(_0x28b5('0x1'));var rimraf=require(_0x28b5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28b5('0x3'));var rp=require(_0x28b5('0x4'));var moment=require('moment');var BPromise=require(_0x28b5('0x5'));var Mustache=require(_0x28b5('0x6'));var util=require(_0x28b5('0x7'));var path=require(_0x28b5('0x8'));var sox=require(_0x28b5('0x9'));var csv=require(_0x28b5('0xa'));var ejs=require(_0x28b5('0xb'));var fs=require('fs');var _=require(_0x28b5('0xc'));var squel=require(_0x28b5('0xd'));var crypto=require('crypto');var jsforce=require(_0x28b5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28b5('0xf'));var Papa=require(_0x28b5('0x10'));var Redis=require('ioredis');var authService=require(_0x28b5('0x11'));var qs=require(_0x28b5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28b5('0x13'));var logger=require(_0x28b5('0x14'))(_0x28b5('0x15'));var utils=require(_0x28b5('0x16'));var config=require('../../config/environment');var db=require(_0x28b5('0x17'))['db'];function respondWithStatusCode(_0x5ef09b,_0xc18108){_0xc18108=_0xc18108||0xcc;return function(_0x3bd9f3){if(_0x3bd9f3){return _0x5ef09b['sendStatus'](_0xc18108);}return _0x5ef09b[_0x28b5('0x18')](_0xc18108)['end']();};}function respondWithResult(_0x26d895,_0x4a684e){_0x4a684e=_0x4a684e||0xc8;return function(_0x58f350){if(_0x58f350){return _0x26d895[_0x28b5('0x18')](_0x4a684e)[_0x28b5('0x19')](_0x58f350);}};}function respondWithFilteredResult(_0x590ef6,_0x2c17c7){return function(_0x26213c){if(_0x26213c){var _0x1e4a10=_0x26213c[_0x28b5('0x1a')],_0x16c115=_0x2c17c7['offset'],_0x39ae7f=_0x2c17c7[_0x28b5('0x1b')]+_0x2c17c7[_0x28b5('0x1c')],_0x593561;if(_0x39ae7f>=_0x1e4a10){_0x39ae7f=_0x1e4a10;_0x593561=0xc8;}else{_0x593561=0xce;}_0x590ef6[_0x28b5('0x18')](_0x593561);return _0x590ef6[_0x28b5('0x1d')]('Content-Range',_0x16c115+'-'+_0x39ae7f+'/'+_0x1e4a10)[_0x28b5('0x19')](_0x26213c);}return null;};}function patchUpdates(_0x1396cf){return function(_0x3a8059){try{jsonpatch['apply'](_0x3a8059,_0x1396cf,!![]);}catch(_0x1ddaf2){return BPromise['reject'](_0x1ddaf2);}return _0x3a8059[_0x28b5('0x1e')]();};}function saveUpdates(_0x20e18c,_0x2c4cae){return function(_0x386494){if(_0x386494){return _0x386494['update'](_0x20e18c)[_0x28b5('0x1f')](function(_0x3658dc){return _0x3658dc;});}return null;};}function removeEntity(_0x16e3ec,_0x32c819){return function(_0x5c453a){if(_0x5c453a){return _0x5c453a['destroy']()['then'](function(){_0x16e3ec[_0x28b5('0x18')](0xcc)[_0x28b5('0x20')]();});}};}function handleEntityNotFound(_0x395feb,_0x740562){return function(_0x8fa4b9){if(!_0x8fa4b9){_0x395feb[_0x28b5('0x21')](0x194);}return _0x8fa4b9;};}function handleError(_0x488374,_0x4b1673){_0x4b1673=_0x4b1673||0x1f4;return function(_0x32f15d){logger['error'](_0x32f15d[_0x28b5('0x22')]);if(_0x32f15d[_0x28b5('0x23')]){delete _0x32f15d[_0x28b5('0x23')];}_0x488374[_0x28b5('0x18')](_0x4b1673)[_0x28b5('0x24')](_0x32f15d);};}exports['index']=function(_0x47e031,_0x30348a){var _0x41784a={},_0x12c721={},_0xb109dd={'count':0x0,'rows':[]};var _0x291811=_[_0x28b5('0x25')](db[_0x28b5('0x26')][_0x28b5('0x27')],function(_0x139524){return{'name':_0x139524[_0x28b5('0x28')],'type':_0x139524['type'][_0x28b5('0x29')]};});_0x12c721[_0x28b5('0x2a')]=_['map'](_0x291811,_0x28b5('0x23'));_0x12c721[_0x28b5('0x2b')]=_[_0x28b5('0x2c')](_0x47e031[_0x28b5('0x2b')]);_0x12c721[_0x28b5('0x2d')]=_[_0x28b5('0x2e')](_0x12c721[_0x28b5('0x2a')],_0x12c721['query']);_0x41784a[_0x28b5('0x2f')]=_['intersection'](_0x12c721[_0x28b5('0x2a')],qs[_0x28b5('0x30')](_0x47e031[_0x28b5('0x2b')][_0x28b5('0x30')]));_0x41784a[_0x28b5('0x2f')]=_0x41784a[_0x28b5('0x2f')][_0x28b5('0x31')]?_0x41784a[_0x28b5('0x2f')]:_0x12c721[_0x28b5('0x2a')];if(!_0x47e031[_0x28b5('0x2b')][_0x28b5('0x32')](_0x28b5('0x33'))){_0x41784a[_0x28b5('0x1c')]=qs[_0x28b5('0x1c')](_0x47e031[_0x28b5('0x2b')][_0x28b5('0x1c')]);_0x41784a['offset']=qs[_0x28b5('0x1b')](_0x47e031['query'][_0x28b5('0x1b')]);}_0x41784a[_0x28b5('0x34')]=qs[_0x28b5('0x35')](_0x47e031[_0x28b5('0x2b')]['sort']);_0x41784a[_0x28b5('0x36')]=qs[_0x28b5('0x2d')](_[_0x28b5('0x37')](_0x47e031['query'],_0x12c721['filters']),_0x291811);if(_0x47e031[_0x28b5('0x2b')][_0x28b5('0x38')]){_0x41784a[_0x28b5('0x36')]=_[_0x28b5('0x39')](_0x41784a['where'],{'$or':_[_0x28b5('0x25')](_0x291811,function(_0x388339){if(_0x388339[_0x28b5('0x3a')]!==_0x28b5('0x3b')){var _0x46421f={};_0x46421f[_0x388339[_0x28b5('0x23')]]={'$like':'%'+_0x47e031[_0x28b5('0x2b')][_0x28b5('0x38')]+'%'};return _0x46421f;}})});}_0x41784a=_['merge']({},_0x41784a,_0x47e031[_0x28b5('0x3c')]);var _0x360671={'where':_0x41784a['where']};return db[_0x28b5('0x26')]['count'](_0x360671)[_0x28b5('0x1f')](function(_0x2a20c9){_0xb109dd[_0x28b5('0x1a')]=_0x2a20c9;if(_0x47e031['query'][_0x28b5('0x3d')]){_0x41784a[_0x28b5('0x3e')]=[{'all':!![]}];}return db[_0x28b5('0x26')][_0x28b5('0x3f')](_0x41784a);})[_0x28b5('0x1f')](function(_0x11d429){_0xb109dd['rows']=_0x11d429;return _0xb109dd;})[_0x28b5('0x1f')](respondWithFilteredResult(_0x30348a,_0x41784a))[_0x28b5('0x40')](handleError(_0x30348a,null));};exports[_0x28b5('0x41')]=function(_0x3b068f,_0x3d3a7f){var _0x5c237f={'raw':!![],'where':{'id':_0x3b068f[_0x28b5('0x42')]['id']}},_0x108a49={};_0x108a49[_0x28b5('0x2a')]=_[_0x28b5('0x2c')](db[_0x28b5('0x26')]['rawAttributes']);_0x108a49[_0x28b5('0x2b')]=_[_0x28b5('0x2c')](_0x3b068f[_0x28b5('0x2b')]);_0x108a49[_0x28b5('0x2d')]=_[_0x28b5('0x2e')](_0x108a49[_0x28b5('0x2a')],_0x108a49['query']);_0x5c237f['attributes']=_[_0x28b5('0x2e')](_0x108a49[_0x28b5('0x2a')],qs[_0x28b5('0x30')](_0x3b068f[_0x28b5('0x2b')][_0x28b5('0x30')]));_0x5c237f['attributes']=_0x5c237f[_0x28b5('0x2f')]['length']?_0x5c237f[_0x28b5('0x2f')]:_0x108a49[_0x28b5('0x2a')];if(_0x3b068f[_0x28b5('0x2b')][_0x28b5('0x3d')]){_0x5c237f[_0x28b5('0x3e')]=[{'all':!![]}];}_0x5c237f=_[_0x28b5('0x39')]({},_0x5c237f,_0x3b068f[_0x28b5('0x3c')]);return db['CmHopperFinal'][_0x28b5('0x43')](_0x5c237f)[_0x28b5('0x1f')](handleEntityNotFound(_0x3d3a7f,null))[_0x28b5('0x1f')](respondWithResult(_0x3d3a7f,null))[_0x28b5('0x40')](handleError(_0x3d3a7f,null));};exports[_0x28b5('0x44')]=function(_0x5a24f1,_0x370aa6){return db[_0x28b5('0x26')][_0x28b5('0x44')]()['then'](respondWithResult(_0x370aa6,null))[_0x28b5('0x40')](handleError(_0x370aa6,null));};exports[_0x28b5('0x45')]=function(_0xe46b0a,_0x141f9a){if(_0xe46b0a['body'][_0x28b5('0x46')]){delete _0xe46b0a[_0x28b5('0x47')][_0x28b5('0x46')];}return db[_0x28b5('0x26')][_0x28b5('0x43')]({'where':{'uniqueid':_0xe46b0a[_0x28b5('0x42')]['id']}})[_0x28b5('0x1f')](handleEntityNotFound(_0x141f9a,null))[_0x28b5('0x1f')](saveUpdates(_0xe46b0a[_0x28b5('0x47')],null))[_0x28b5('0x1f')](respondWithResult(_0x141f9a,null))[_0x28b5('0x40')](handleError(_0x141f9a,null));};exports[_0x28b5('0x48')]=function(_0x97dfe5,_0x319a0f,_0x5ebe01){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x97dfe5[_0x28b5('0x42')]['id']},'attributes':[[db[_0x28b5('0x49')]['fn']('COUNT',db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')]['literal'](_0x28b5('0x4a')))),_0x28b5('0x4b')],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x28b5('0x4d')](_0x28b5('0x4e')))),_0x28b5('0x4f')],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x28b5('0x4d')](_0x28b5('0x50')))),'busyContacts'],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')]['literal'](_0x28b5('0x51')))),_0x28b5('0x52')],[db['sequelize']['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x53')))),_0x28b5('0x54')],[db[_0x28b5('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x28b5('0x49')]['literal'](_0x28b5('0x55')))),_0x28b5('0x56')],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x28b5('0x4d')](_0x28b5('0x57')))),'reCallContacts'],[db[_0x28b5('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x58')))),_0x28b5('0x59')]]})['then'](handleEntityNotFound(_0x319a0f,null))[_0x28b5('0x1f')](respondWithResult(_0x319a0f,null))[_0x28b5('0x40')](handleError(_0x319a0f,null));};exports[_0x28b5('0x5a')]=function(_0x5e81aa,_0x3ca81c,_0x86aeb8){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x5e81aa['params']['id']},'attributes':[[db[_0x28b5('0x49')]['fn']('COUNT',db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x4a')))),_0x28b5('0x4b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x4e')))),'noAnswerContacts'],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db['sequelize'][_0x28b5('0x4d')](_0x28b5('0x50')))),'busyContacts'],[db['sequelize']['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')]['literal'](_0x28b5('0x51')))),_0x28b5('0x52')],[db['sequelize']['fn']('COUNT',db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x53')))),_0x28b5('0x54')],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x55')))),_0x28b5('0x56')],[db[_0x28b5('0x49')]['fn'](_0x28b5('0x4c'),db[_0x28b5('0x49')]['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x57')))),_0x28b5('0x5b')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x28b5('0x49')][_0x28b5('0x4d')](_0x28b5('0x58')))),_0x28b5('0x59')]]})[_0x28b5('0x1f')](handleEntityNotFound(_0x3ca81c,null))['then'](respondWithResult(_0x3ca81c,null))[_0x28b5('0x40')](handleError(_0x3ca81c,null));};exports[_0x28b5('0x5c')]=function(_0x26d9be,_0x42c12d,_0x5c70b5){return db[_0x28b5('0x5d')][_0x28b5('0x43')]({'where':{'id':_0x26d9be[_0x28b5('0x42')]['id']}})[_0x28b5('0x1f')](handleEntityNotFound(_0x42c12d,null))[_0x28b5('0x1f')](function(_0x50e97a){var _0x19cab5;if(_0x50e97a){_0x19cab5=squel[_0x28b5('0x5e')]()[_0x28b5('0x5f')]('cm_hopper')[_0x28b5('0x60')](['phone',_0x28b5('0x61'),_0x28b5('0x62'),_0x28b5('0x63'),_0x28b5('0x64'),_0x28b5('0x65'),_0x28b5('0x66')],squel['select']()[_0x28b5('0x67')](_0x28b5('0x68'),'phone')[_0x28b5('0x67')](_0x28b5('0x69'),_0x28b5('0x61'))[_0x28b5('0x67')](_0x28b5('0x6a'),_0x28b5('0x62'))[_0x28b5('0x67')](_0x28b5('0x6b'),'ListId')[_0x28b5('0x67')](_0x28b5('0x6c'),_0x28b5('0x64'))[_0x28b5('0x67')](_0x28b5('0x69'),_0x28b5('0x65'))[_0x28b5('0x67')]('NOW()','updatedAt')['from'](_0x28b5('0x6d'))[_0x28b5('0x36')](_0x28b5('0x6e'),_0x26d9be['params']['id'][_0x28b5('0x6f')]())[_0x28b5('0x36')](_0x28b5('0x70'),_0x26d9be['body'][_0x28b5('0x71')][_0x28b5('0x6f')]())['where'](_0x28b5('0x72'))[_0x28b5('0x36')](_0x28b5('0x73'),squel['select']()['field'](_0x28b5('0x74'))[_0x28b5('0x75')](_0x28b5('0x76'))[_0x28b5('0x36')](_0x28b5('0x6e'),_0x26d9be['params']['id'][_0x28b5('0x6f')]()))[_0x28b5('0x36')](_0x28b5('0x73'),squel[_0x28b5('0x77')]()[_0x28b5('0x67')](_0x28b5('0x78'))[_0x28b5('0x75')](_0x28b5('0x6d'))['where'](_0x28b5('0x6e'),_0x26d9be['params']['id'][_0x28b5('0x6f')]())[_0x28b5('0x36')](_0x28b5('0x79')))['group']('ContactId'))[_0x28b5('0x6f')]();return db['sequelize'][_0x28b5('0x2b')](_0x19cab5);}return[];})[_0x28b5('0x1f')](respondWithResult(_0x42c12d,null))[_0x28b5('0x40')](handleError(_0x42c12d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1a5267,_0x15ed43,_0x7ba15){return db[_0x28b5('0x7a')]['find']({'where':{'id':_0x1a5267[_0x28b5('0x42')]['id']}})[_0x28b5('0x1f')](handleEntityNotFound(_0x15ed43,null))[_0x28b5('0x1f')](function(_0x5588b5){var _0x137e0d;if(_0x5588b5){_0x137e0d=squel[_0x28b5('0x5e')]()[_0x28b5('0x5f')](_0x28b5('0x76'))[_0x28b5('0x60')]([_0x28b5('0x74'),_0x28b5('0x61'),_0x28b5('0x62'),_0x28b5('0x63'),_0x28b5('0x7b'),_0x28b5('0x65'),_0x28b5('0x66')],squel[_0x28b5('0x77')]()[_0x28b5('0x67')]('ANY_VALUE(calleridnum)',_0x28b5('0x74'))['field'](_0x28b5('0x69'),_0x28b5('0x61'))['field']('ANY_VALUE(ContactId)','ContactId')[_0x28b5('0x67')](_0x28b5('0x6b'),_0x28b5('0x63'))[_0x28b5('0x67')]('ANY_VALUE(CampaignId)','CampaignId')[_0x28b5('0x67')](_0x28b5('0x69'),_0x28b5('0x65'))['field'](_0x28b5('0x69'),_0x28b5('0x66'))[_0x28b5('0x75')](_0x28b5('0x6d'))['where'](_0x28b5('0x7c'),_0x1a5267['params']['id']['toString']())[_0x28b5('0x36')](_0x28b5('0x70'),_0x1a5267[_0x28b5('0x47')]['state'][_0x28b5('0x6f')]())['where'](_0x28b5('0x72'))[_0x28b5('0x36')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x28b5('0x67')]('phone')[_0x28b5('0x75')](_0x28b5('0x76'))[_0x28b5('0x36')](_0x28b5('0x7c'),_0x1a5267[_0x28b5('0x42')]['id'][_0x28b5('0x6f')]()))[_0x28b5('0x36')](_0x28b5('0x73'),squel[_0x28b5('0x77')]()[_0x28b5('0x67')](_0x28b5('0x78'))[_0x28b5('0x75')](_0x28b5('0x6d'))[_0x28b5('0x36')](_0x28b5('0x7c'),_0x1a5267['params']['id']['toString']())[_0x28b5('0x36')](_0x28b5('0x79')))['group']('ContactId'))['toString']();return db[_0x28b5('0x49')][_0x28b5('0x2b')](_0x137e0d);}return[];})[_0x28b5('0x1f')](respondWithResult(_0x15ed43,null))[_0x28b5('0x40')](handleError(_0x15ed43,null));};exports[_0x28b5('0x7d')]=function(_0x2d5c84,_0x32c312,_0x4c65e5){return db['CmHopper'][_0x28b5('0x7e')]({'where':{'VoiceQueueId':_0x2d5c84[_0x28b5('0x47')][_0x28b5('0x64')],'CampaignId':_0x2d5c84['body'][_0x28b5('0x7b')],'ContactId':_0x2d5c84['body'][_0x28b5('0x62')]}})[_0x28b5('0x1f')](handleEntityNotFound(_0x32c312,null))[_0x28b5('0x1f')](function(_0x3c2613){if(_0x3c2613){return _0x3c2613;}return null;})[_0x28b5('0x1f')](respondWithResult(_0x32c312,null))['catch'](handleError(_0x32c312,null));}; \ No newline at end of file +var _0x7bd0=['CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','CmHopperFinal','includeAll','findAll','rows','catch','show','params','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','reCallContacts','`state`\x20=\x2019,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','NOW()','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','from','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','fromQuery'];(function(_0x4934e3,_0x1d2e40){var _0x44b196=function(_0x7e5c0b){while(--_0x7e5c0b){_0x4934e3['push'](_0x4934e3['shift']());}};_0x44b196(++_0x1d2e40);}(_0x7bd0,0x111));var _0x07bd=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x7bd0[_0x52c4e9];return _0x252a03;};'use strict';var pdf=require(_0x07bd('0x0'));var emlformat=require(_0x07bd('0x1'));var rimraf=require(_0x07bd('0x2'));var zipdir=require(_0x07bd('0x3'));var jsonpatch=require(_0x07bd('0x4'));var rp=require(_0x07bd('0x5'));var moment=require(_0x07bd('0x6'));var BPromise=require(_0x07bd('0x7'));var Mustache=require('mustache');var util=require(_0x07bd('0x8'));var path=require(_0x07bd('0x9'));var sox=require(_0x07bd('0xa'));var csv=require(_0x07bd('0xb'));var ejs=require(_0x07bd('0xc'));var fs=require('fs');var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xb'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var db=require(_0x07bd('0x19'))['db'];function respondWithStatusCode(_0x456ecd,_0x1eff6c){_0x1eff6c=_0x1eff6c||0xcc;return function(_0x10aa2e){if(_0x10aa2e){return _0x456ecd[_0x07bd('0x1a')](_0x1eff6c);}return _0x456ecd['status'](_0x1eff6c)['end']();};}function respondWithResult(_0x2ca1bc,_0x3fe523){_0x3fe523=_0x3fe523||0xc8;return function(_0x1c59c2){if(_0x1c59c2){return _0x2ca1bc[_0x07bd('0x1b')](_0x3fe523)[_0x07bd('0x1c')](_0x1c59c2);}};}function respondWithFilteredResult(_0x2406b0,_0x2c9166){return function(_0x49d962){if(_0x49d962){var _0x418444=_0x49d962[_0x07bd('0x1d')],_0x505839=_0x2c9166[_0x07bd('0x1e')],_0x229bf1=_0x2c9166[_0x07bd('0x1e')]+_0x2c9166['limit'],_0x2dd97b;if(_0x229bf1>=_0x418444){_0x229bf1=_0x418444;_0x2dd97b=0xc8;}else{_0x2dd97b=0xce;}_0x2406b0[_0x07bd('0x1b')](_0x2dd97b);return _0x2406b0[_0x07bd('0x1f')]('Content-Range',_0x505839+'-'+_0x229bf1+'/'+_0x418444)[_0x07bd('0x1c')](_0x49d962);}return null;};}function patchUpdates(_0x72f775){return function(_0x758fd5){try{jsonpatch[_0x07bd('0x20')](_0x758fd5,_0x72f775,!![]);}catch(_0x36ccec){return BPromise[_0x07bd('0x21')](_0x36ccec);}return _0x758fd5[_0x07bd('0x22')]();};}function saveUpdates(_0x1a65ff,_0x29a52e){return function(_0x50109f){if(_0x50109f){return _0x50109f[_0x07bd('0x23')](_0x1a65ff)[_0x07bd('0x24')](function(_0xcb8b23){return _0xcb8b23;});}return null;};}function removeEntity(_0x11684d,_0x16d0e6){return function(_0x47bd50){if(_0x47bd50){return _0x47bd50['destroy']()[_0x07bd('0x24')](function(){_0x11684d['status'](0xcc)[_0x07bd('0x25')]();});}};}function handleEntityNotFound(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(!_0x4165bc){_0x480c9c[_0x07bd('0x1a')](0x194);}return _0x4165bc;};}function handleError(_0xf3b23c,_0xdb47ba){_0xdb47ba=_0xdb47ba||0x1f4;return function(_0x28bd91){logger[_0x07bd('0x26')](_0x28bd91['stack']);if(_0x28bd91[_0x07bd('0x27')]){delete _0x28bd91[_0x07bd('0x27')];}_0xf3b23c[_0x07bd('0x1b')](_0xdb47ba)[_0x07bd('0x28')](_0x28bd91);};}exports[_0x07bd('0x29')]=function(_0x1c1fda,_0x571dab){var _0x56687f={},_0x5184dc={},_0x335d61={'count':0x0,'rows':[]};var _0xfa7566=_[_0x07bd('0x2a')](db['CmHopperFinal'][_0x07bd('0x2b')],function(_0x400cc0){return{'name':_0x400cc0[_0x07bd('0x2c')],'type':_0x400cc0[_0x07bd('0x2d')][_0x07bd('0x2e')]};});_0x5184dc[_0x07bd('0x2f')]=_['map'](_0xfa7566,_0x07bd('0x27'));_0x5184dc[_0x07bd('0x30')]=_[_0x07bd('0x31')](_0x1c1fda[_0x07bd('0x30')]);_0x5184dc[_0x07bd('0x32')]=_[_0x07bd('0x33')](_0x5184dc[_0x07bd('0x2f')],_0x5184dc[_0x07bd('0x30')]);_0x56687f['attributes']=_['intersection'](_0x5184dc[_0x07bd('0x2f')],qs[_0x07bd('0x34')](_0x1c1fda[_0x07bd('0x30')]['fields']));_0x56687f[_0x07bd('0x35')]=_0x56687f[_0x07bd('0x35')][_0x07bd('0x36')]?_0x56687f['attributes']:_0x5184dc['model'];if(!_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x37')](_0x07bd('0x38'))){_0x56687f[_0x07bd('0x39')]=qs['limit'](_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x39')]);_0x56687f[_0x07bd('0x1e')]=qs['offset'](_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x1e')]);}_0x56687f['order']=qs[_0x07bd('0x3a')](_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x3a')]);_0x56687f[_0x07bd('0x3b')]=qs['filters'](_['pick'](_0x1c1fda[_0x07bd('0x30')],_0x5184dc['filters']),_0xfa7566);if(_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x3c')]){_0x56687f[_0x07bd('0x3b')]=_[_0x07bd('0x3d')](_0x56687f[_0x07bd('0x3b')],{'$or':_[_0x07bd('0x2a')](_0xfa7566,function(_0x3e63b3){if(_0x3e63b3[_0x07bd('0x2d')]!==_0x07bd('0x3e')){var _0x27b563={};_0x27b563[_0x3e63b3[_0x07bd('0x27')]]={'$like':'%'+_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x3c')]+'%'};return _0x27b563;}})});}_0x56687f=_['merge']({},_0x56687f,_0x1c1fda[_0x07bd('0x3f')]);var _0x2799c6={'where':_0x56687f[_0x07bd('0x3b')]};return db[_0x07bd('0x40')]['count'](_0x2799c6)[_0x07bd('0x24')](function(_0xa36d6b){_0x335d61[_0x07bd('0x1d')]=_0xa36d6b;if(_0x1c1fda[_0x07bd('0x30')][_0x07bd('0x41')]){_0x56687f['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x07bd('0x42')](_0x56687f);})[_0x07bd('0x24')](function(_0x17c3df){_0x335d61[_0x07bd('0x43')]=_0x17c3df;return _0x335d61;})['then'](respondWithFilteredResult(_0x571dab,_0x56687f))[_0x07bd('0x44')](handleError(_0x571dab,null));};exports[_0x07bd('0x45')]=function(_0x3de7d3,_0x6cdf23){var _0x318b7c={'raw':!![],'where':{'id':_0x3de7d3[_0x07bd('0x46')]['id']}},_0x2a08e3={};_0x2a08e3['model']=_[_0x07bd('0x31')](db[_0x07bd('0x40')][_0x07bd('0x2b')]);_0x2a08e3[_0x07bd('0x30')]=_[_0x07bd('0x31')](_0x3de7d3['query']);_0x2a08e3[_0x07bd('0x32')]=_[_0x07bd('0x33')](_0x2a08e3[_0x07bd('0x2f')],_0x2a08e3[_0x07bd('0x30')]);_0x318b7c[_0x07bd('0x35')]=_['intersection'](_0x2a08e3[_0x07bd('0x2f')],qs[_0x07bd('0x34')](_0x3de7d3[_0x07bd('0x30')][_0x07bd('0x34')]));_0x318b7c['attributes']=_0x318b7c['attributes'][_0x07bd('0x36')]?_0x318b7c[_0x07bd('0x35')]:_0x2a08e3[_0x07bd('0x2f')];if(_0x3de7d3[_0x07bd('0x30')][_0x07bd('0x41')]){_0x318b7c[_0x07bd('0x47')]=[{'all':!![]}];}_0x318b7c=_[_0x07bd('0x3d')]({},_0x318b7c,_0x3de7d3[_0x07bd('0x3f')]);return db[_0x07bd('0x40')]['find'](_0x318b7c)['then'](handleEntityNotFound(_0x6cdf23,null))[_0x07bd('0x24')](respondWithResult(_0x6cdf23,null))[_0x07bd('0x44')](handleError(_0x6cdf23,null));};exports[_0x07bd('0x48')]=function(_0xaa85c5,_0x44274b){return db[_0x07bd('0x40')]['describe']()[_0x07bd('0x24')](respondWithResult(_0x44274b,null))[_0x07bd('0x44')](handleError(_0x44274b,null));};exports[_0x07bd('0x23')]=function(_0x39823e,_0x7755e2){if(_0x39823e[_0x07bd('0x49')]['uniqueid']){delete _0x39823e[_0x07bd('0x49')][_0x07bd('0x4a')];}return db[_0x07bd('0x40')][_0x07bd('0x4b')]({'where':{'uniqueid':_0x39823e[_0x07bd('0x46')]['id']}})[_0x07bd('0x24')](handleEntityNotFound(_0x7755e2,null))[_0x07bd('0x24')](saveUpdates(_0x39823e[_0x07bd('0x49')],null))[_0x07bd('0x24')](respondWithResult(_0x7755e2,null))[_0x07bd('0x44')](handleError(_0x7755e2,null));};exports[_0x07bd('0x4c')]=function(_0x2fa62e,_0x4896e4,_0x1a2606){return db[_0x07bd('0x40')][_0x07bd('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x2fa62e['params']['id']},'attributes':[[db['sequelize']['fn'](_0x07bd('0x4d'),db['sequelize']['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x50')))),_0x07bd('0x51')],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')]['literal'](_0x07bd('0x52')))),_0x07bd('0x53')],[db[_0x07bd('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x07bd('0x4f')](_0x07bd('0x54')))),_0x07bd('0x55')],[db['sequelize']['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x56')))),_0x07bd('0x57')],[db['sequelize']['fn']('COUNT',db[_0x07bd('0x4e')]['fn']('IF',db['sequelize']['literal'](_0x07bd('0x58')))),_0x07bd('0x59')],[db[_0x07bd('0x4e')]['fn']('COUNT',db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x5a')))),_0x07bd('0x5b')],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')]['literal'](_0x07bd('0x5c')))),'reCallContacts'],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db['sequelize'][_0x07bd('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x07bd('0x5d')]]})[_0x07bd('0x24')](handleEntityNotFound(_0x4896e4,null))[_0x07bd('0x24')](respondWithResult(_0x4896e4,null))[_0x07bd('0x44')](handleError(_0x4896e4,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x5dc6f6,_0x135e4e,_0x5e4670){return db[_0x07bd('0x40')][_0x07bd('0x42')]({'raw':![],'where':{'CampaignId':_0x5dc6f6[_0x07bd('0x46')]['id']},'attributes':[[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db['sequelize'][_0x07bd('0x4f')](_0x07bd('0x50')))),_0x07bd('0x51')],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db['sequelize']['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x52')))),'noAnswerContacts'],[db[_0x07bd('0x4e')]['fn']('COUNT',db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x07bd('0x55')],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')]['literal'](_0x07bd('0x56')))),'congestionContacts'],[db[_0x07bd('0x4e')]['fn']('COUNT',db[_0x07bd('0x4e')]['fn']('IF',db['sequelize']['literal'](_0x07bd('0x58')))),_0x07bd('0x59')],[db[_0x07bd('0x4e')]['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x5a')))),_0x07bd('0x5b')],[db[_0x07bd('0x4e')]['fn']('COUNT',db[_0x07bd('0x4e')]['fn']('IF',db['sequelize'][_0x07bd('0x4f')](_0x07bd('0x5c')))),_0x07bd('0x5e')],[db['sequelize']['fn'](_0x07bd('0x4d'),db[_0x07bd('0x4e')]['fn']('IF',db[_0x07bd('0x4e')][_0x07bd('0x4f')](_0x07bd('0x5f')))),_0x07bd('0x5d')]]})[_0x07bd('0x24')](handleEntityNotFound(_0x135e4e,null))['then'](respondWithResult(_0x135e4e,null))[_0x07bd('0x44')](handleError(_0x135e4e,null));};exports[_0x07bd('0x60')]=function(_0x6bf34b,_0x5acb4a,_0x29a452){return db[_0x07bd('0x61')][_0x07bd('0x4b')]({'where':{'id':_0x6bf34b[_0x07bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x5acb4a,null))[_0x07bd('0x24')](function(_0x15bcd3){var _0x2d1ee7;if(_0x15bcd3){_0x2d1ee7=squel[_0x07bd('0x62')]()['into'](_0x07bd('0x63'))['fromQuery']([_0x07bd('0x64'),_0x07bd('0x65'),_0x07bd('0x66'),_0x07bd('0x67'),'VoiceQueueId',_0x07bd('0x68'),_0x07bd('0x69')],squel[_0x07bd('0x6a')]()[_0x07bd('0x6b')](_0x07bd('0x6c'),_0x07bd('0x64'))[_0x07bd('0x6b')]('NOW()',_0x07bd('0x65'))[_0x07bd('0x6b')](_0x07bd('0x6d'),_0x07bd('0x66'))[_0x07bd('0x6b')]('ANY_VALUE(ListId)',_0x07bd('0x67'))[_0x07bd('0x6b')](_0x07bd('0x6e'),'VoiceQueueId')[_0x07bd('0x6b')](_0x07bd('0x6f'),_0x07bd('0x68'))[_0x07bd('0x6b')](_0x07bd('0x6f'),'updatedAt')['from'](_0x07bd('0x70'))[_0x07bd('0x3b')](_0x07bd('0x71'),_0x6bf34b[_0x07bd('0x46')]['id'][_0x07bd('0x72')]())[_0x07bd('0x3b')](_0x07bd('0x73'),_0x6bf34b[_0x07bd('0x49')][_0x07bd('0x74')]['toString']())[_0x07bd('0x3b')](_0x07bd('0x75'))[_0x07bd('0x3b')](_0x07bd('0x76'),squel[_0x07bd('0x6a')]()['field'](_0x07bd('0x64'))['from'](_0x07bd('0x63'))[_0x07bd('0x3b')]('VoiceQueueId\x20=\x20?',_0x6bf34b[_0x07bd('0x46')]['id']['toString']()))['where'](_0x07bd('0x76'),squel[_0x07bd('0x6a')]()[_0x07bd('0x6b')](_0x07bd('0x77'))[_0x07bd('0x78')]('cm_hopper_final')[_0x07bd('0x3b')](_0x07bd('0x71'),_0x6bf34b[_0x07bd('0x46')]['id']['toString']())[_0x07bd('0x3b')](_0x07bd('0x79')))['group'](_0x07bd('0x66')))[_0x07bd('0x72')]();return db['sequelize'][_0x07bd('0x30')](_0x2d1ee7);}return[];})[_0x07bd('0x24')](respondWithResult(_0x5acb4a,null))[_0x07bd('0x44')](handleError(_0x5acb4a,null));};exports[_0x07bd('0x7a')]=function(_0x37d153,_0x3d1275,_0x3124c2){return db[_0x07bd('0x7b')]['find']({'where':{'id':_0x37d153[_0x07bd('0x46')]['id']}})[_0x07bd('0x24')](handleEntityNotFound(_0x3d1275,null))['then'](function(_0x31a9ac){var _0x138515;if(_0x31a9ac){_0x138515=squel[_0x07bd('0x62')]()[_0x07bd('0x7c')]('cm_hopper')[_0x07bd('0x7d')]([_0x07bd('0x64'),_0x07bd('0x65'),_0x07bd('0x66'),'ListId',_0x07bd('0x7e'),_0x07bd('0x68'),_0x07bd('0x69')],squel[_0x07bd('0x6a')]()[_0x07bd('0x6b')](_0x07bd('0x6c'),_0x07bd('0x64'))[_0x07bd('0x6b')](_0x07bd('0x6f'),_0x07bd('0x65'))[_0x07bd('0x6b')](_0x07bd('0x6d'),_0x07bd('0x66'))[_0x07bd('0x6b')](_0x07bd('0x7f'),_0x07bd('0x67'))[_0x07bd('0x6b')](_0x07bd('0x80'),'CampaignId')[_0x07bd('0x6b')](_0x07bd('0x6f'),_0x07bd('0x68'))[_0x07bd('0x6b')](_0x07bd('0x6f'),_0x07bd('0x69'))[_0x07bd('0x78')](_0x07bd('0x70'))[_0x07bd('0x3b')](_0x07bd('0x81'),_0x37d153['params']['id'][_0x07bd('0x72')]())[_0x07bd('0x3b')](_0x07bd('0x73'),_0x37d153[_0x07bd('0x49')][_0x07bd('0x74')][_0x07bd('0x72')]())[_0x07bd('0x3b')](_0x07bd('0x75'))[_0x07bd('0x3b')](_0x07bd('0x76'),squel[_0x07bd('0x6a')]()[_0x07bd('0x6b')](_0x07bd('0x64'))[_0x07bd('0x78')](_0x07bd('0x63'))[_0x07bd('0x3b')](_0x07bd('0x81'),_0x37d153[_0x07bd('0x46')]['id'][_0x07bd('0x72')]()))[_0x07bd('0x3b')](_0x07bd('0x76'),squel[_0x07bd('0x6a')]()['field'](_0x07bd('0x77'))[_0x07bd('0x78')]('cm_hopper_final')[_0x07bd('0x3b')]('CampaignId\x20=\x20?',_0x37d153[_0x07bd('0x46')]['id']['toString']())[_0x07bd('0x3b')](_0x07bd('0x79')))['group'](_0x07bd('0x66')))[_0x07bd('0x72')]();return db['sequelize'][_0x07bd('0x30')](_0x138515);}return[];})['then'](respondWithResult(_0x3d1275,null))[_0x07bd('0x44')](handleError(_0x3d1275,null));};exports[_0x07bd('0x82')]=function(_0x207fde,_0x349e55,_0xaac9a4){return db[_0x07bd('0x83')][_0x07bd('0x84')]({'where':{'VoiceQueueId':_0x207fde['body']['VoiceQueueId'],'CampaignId':_0x207fde[_0x07bd('0x49')][_0x07bd('0x7e')],'ContactId':_0x207fde[_0x07bd('0x49')][_0x07bd('0x66')]}})[_0x07bd('0x24')](handleEntityNotFound(_0x349e55,null))[_0x07bd('0x24')](function(_0x5872b8){if(_0x5872b8){return _0x5872b8;}return null;})[_0x07bd('0x24')](respondWithResult(_0x349e55,null))['catch'](handleError(_0x349e55,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 05f71fb..896526f 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 _0x1fd8=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x5a9846,_0xac81db){var _0x4c7b9d=function(_0x3eea6a){while(--_0x3eea6a){_0x5a9846['push'](_0x5a9846['shift']());}};_0x4c7b9d(++_0xac81db);}(_0x1fd8,0xa5));var _0x81fd=function(_0x3eff93,_0x17d9b2){_0x3eff93=_0x3eff93-0x0;var _0x28bd82=_0x1fd8[_0x3eff93];return _0x28bd82;};'use strict';var _=require(_0x81fd('0x0'));var util=require(_0x81fd('0x1'));var logger=require(_0x81fd('0x2'))('api');var moment=require(_0x81fd('0x3'));var BPromise=require(_0x81fd('0x4'));var rp=require(_0x81fd('0x5'));var fs=require('fs');var path=require(_0x81fd('0x6'));var rimraf=require(_0x81fd('0x7'));var config=require(_0x81fd('0x8'));var attributes=require(_0x81fd('0x9'));module[_0x81fd('0xa')]=function(_0x2803ac,_0x13dd4e){return _0x2803ac[_0x81fd('0xb')](_0x81fd('0xc'),attributes,{'tableName':_0x81fd('0xd'),'paranoid':![],'indexes':[{'name':_0x81fd('0xe'),'fields':['calleridnum']},{'name':_0x81fd('0xf'),'fields':[_0x81fd('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbb=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x547459,_0x1d2690){var _0x4d261b=function(_0x323865){while(--_0x323865){_0x547459['push'](_0x547459['shift']());}};_0x4d261b(++_0x1d2690);}(_0xfdbb,0xb3));var _0xbfdb=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0xfdbb[_0x378b4];return _0x11d07b;};'use strict';var _=require(_0xbfdb('0x0'));var util=require(_0xbfdb('0x1'));var logger=require(_0xbfdb('0x2'))(_0xbfdb('0x3'));var moment=require(_0xbfdb('0x4'));var BPromise=require(_0xbfdb('0x5'));var rp=require(_0xbfdb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfdb('0x7'));var config=require(_0xbfdb('0x8'));var attributes=require(_0xbfdb('0x9'));module[_0xbfdb('0xa')]=function(_0x3e6b6e,_0x478430){return _0x3e6b6e['define'](_0xbfdb('0xb'),attributes,{'tableName':_0xbfdb('0xc'),'paranoid':![],'indexes':[{'name':_0xbfdb('0xd'),'fields':[_0xbfdb('0xd')]},{'name':_0xbfdb('0xe'),'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 a2e6938..4546909 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 _0x2d8d=['info','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperFinal,\x20%s,\x20%s','result','catch','CmHopperFinal','create','options','raw','then','CreateCmHopperFinal','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2bfb6e,_0xff43a6){var _0x2b4bba=function(_0x34c5d1){while(--_0x34c5d1){_0x2bfb6e['push'](_0x2bfb6e['shift']());}};_0x2b4bba(++_0xff43a6);}(_0x2d8d,0x154));var _0xd2d8=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x2d8d[_0x30cd7e];return _0x462a02;};'use strict';var _=require(_0xd2d8('0x0'));var util=require(_0xd2d8('0x1'));var moment=require(_0xd2d8('0x2'));var BPromise=require(_0xd2d8('0x3'));var rs=require(_0xd2d8('0x4'));var fs=require('fs');var Redis=require(_0xd2d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd2d8('0x6'))(_0xd2d8('0x7'));var config=require('../../config/environment');var jayson=require(_0xd2d8('0x8'));var client=jayson[_0xd2d8('0x9')][_0xd2d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256863,_0x3c8971,_0x561afc){return new BPromise(function(_0x44d189,_0x4de791){return client['request'](_0x256863,_0x561afc)['then'](function(_0x3aa0e1){logger[_0xd2d8('0xb')]('CmHopperFinal,\x20%s,\x20%s',_0x3c8971,_0xd2d8('0xc'));logger['debug'](_0xd2d8('0xd'),_0x3c8971,_0xd2d8('0xc'),JSON[_0xd2d8('0xe')](_0x3aa0e1));if(_0x3aa0e1['error']){if(_0x3aa0e1['error']['code']===0x1f4){logger[_0xd2d8('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x3c8971,_0x3aa0e1[_0xd2d8('0xf')][_0xd2d8('0x10')]);return _0x4de791(_0x3aa0e1['error'][_0xd2d8('0x10')]);}logger[_0xd2d8('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x3c8971,_0x3aa0e1[_0xd2d8('0xf')]['message']);return _0x44d189(_0x3aa0e1['error'][_0xd2d8('0x10')]);}else{logger[_0xd2d8('0xb')](_0xd2d8('0x11'),_0x3c8971,_0xd2d8('0xc'));_0x44d189(_0x3aa0e1[_0xd2d8('0x12')][_0xd2d8('0x10')]);}})[_0xd2d8('0x13')](function(_0x145373){logger[_0xd2d8('0xf')](_0xd2d8('0x11'),_0x3c8971,_0x145373);_0x4de791(_0x145373);});});}exports['CreateCmHopperFinal']=function(_0x3e2181){var _0xff938e=this;return new Promise(function(_0x28f2e7,_0x2f8503){return db[_0xd2d8('0x14')][_0xd2d8('0x15')](_0x3e2181['body'],{'raw':_0x3e2181[_0xd2d8('0x16')]?_0x3e2181['options'][_0xd2d8('0x17')]===undefined?!![]:![]:!![]})[_0xd2d8('0x18')](function(_0x344a1c){logger['info'](_0xd2d8('0x19'),_0x3e2181);logger[_0xd2d8('0x1a')]('CreateCmHopperFinal',_0x3e2181,JSON[_0xd2d8('0xe')](_0x344a1c));_0x28f2e7(_0x344a1c);})[_0xd2d8('0x13')](function(_0x2dc047){logger['error'](_0xd2d8('0x19'),_0x2dc047[_0xd2d8('0x10')],_0x3e2181);_0x2f8503(_0xff938e[_0xd2d8('0xf')](0x1f4,_0x2dc047[_0xd2d8('0x10')]));});});}; \ No newline at end of file +var _0x12b7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','CmHopperFinal,\x20%s,\x20%s','message','result','catch','create','body','options','raw','then','CreateCmHopperFinal','stringify','moment','bluebird','randomstring','ioredis'];(function(_0x2b08ea,_0x28ad45){var _0x46474d=function(_0x5f0ead){while(--_0x5f0ead){_0x2b08ea['push'](_0x2b08ea['shift']());}};_0x46474d(++_0x28ad45);}(_0x12b7,0x182));var _0x712b=function(_0x45fbd2,_0x507381){_0x45fbd2=_0x45fbd2-0x0;var _0x926e6a=_0x12b7[_0x45fbd2];return _0x926e6a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x712b('0x0'));var BPromise=require(_0x712b('0x1'));var rs=require(_0x712b('0x2'));var fs=require('fs');var Redis=require(_0x712b('0x3'));var db=require(_0x712b('0x4'))['db'];var utils=require(_0x712b('0x5'));var logger=require(_0x712b('0x6'))(_0x712b('0x7'));var config=require(_0x712b('0x8'));var jayson=require(_0x712b('0x9'));var client=jayson[_0x712b('0xa')][_0x712b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f46a8,_0x231fb3,_0x454359){return new BPromise(function(_0x5d2ef4,_0x5159e7){return client[_0x712b('0xc')](_0x5f46a8,_0x454359)['then'](function(_0x1c54bd){logger[_0x712b('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x231fb3,_0x712b('0xe'));logger[_0x712b('0xf')](_0x712b('0x10'),_0x231fb3,'request\x20sent',JSON['stringify'](_0x1c54bd));if(_0x1c54bd[_0x712b('0x11')]){if(_0x1c54bd[_0x712b('0x11')][_0x712b('0x12')]===0x1f4){logger[_0x712b('0x11')](_0x712b('0x13'),_0x231fb3,_0x1c54bd[_0x712b('0x11')][_0x712b('0x14')]);return _0x5159e7(_0x1c54bd[_0x712b('0x11')]['message']);}logger[_0x712b('0x11')](_0x712b('0x13'),_0x231fb3,_0x1c54bd[_0x712b('0x11')][_0x712b('0x14')]);return _0x5d2ef4(_0x1c54bd[_0x712b('0x11')][_0x712b('0x14')]);}else{logger['info'](_0x712b('0x13'),_0x231fb3,_0x712b('0xe'));_0x5d2ef4(_0x1c54bd[_0x712b('0x15')][_0x712b('0x14')]);}})[_0x712b('0x16')](function(_0x2b0a82){logger[_0x712b('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x231fb3,_0x2b0a82);_0x5159e7(_0x2b0a82);});});}exports['CreateCmHopperFinal']=function(_0x3fe990){var _0x32ae23=this;return new Promise(function(_0x222863,_0x251bc6){return db['CmHopperFinal'][_0x712b('0x17')](_0x3fe990[_0x712b('0x18')],{'raw':_0x3fe990[_0x712b('0x19')]?_0x3fe990[_0x712b('0x19')][_0x712b('0x1a')]===undefined?!![]:![]:!![]})[_0x712b('0x1b')](function(_0x40b381){logger['info'](_0x712b('0x1c'),_0x3fe990);logger[_0x712b('0xf')](_0x712b('0x1c'),_0x3fe990,JSON[_0x712b('0x1d')](_0x40b381));_0x222863(_0x40b381);})[_0x712b('0x16')](function(_0x34ce3c){logger[_0x712b('0x11')](_0x712b('0x1c'),_0x34ce3c['message'],_0x3fe990);_0x251bc6(_0x32ae23[_0x712b('0x11')](0x1f4,_0x34ce3c[_0x712b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 03ef32b..0d9cb41 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 _0xad02=['express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','path'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0xad02,0xef));var _0x2ad0=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0xad02[_0x2db667];return _0x83ff9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2ad0('0x0'));var timeout=require('connect-timeout');var express=require(_0x2ad0('0x1'));var router=express[_0x2ad0('0x2')]();var auth=require(_0x2ad0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2ad0('0x4'));var controller=require(_0x2ad0('0x5'));router[_0x2ad0('0x6')]('/',auth[_0x2ad0('0x7')](),controller[_0x2ad0('0x8')]);router[_0x2ad0('0x6')](_0x2ad0('0x9'),auth[_0x2ad0('0x7')](),controller['describe']);router[_0x2ad0('0x6')](_0x2ad0('0xa'),auth[_0x2ad0('0x7')](),controller[_0x2ad0('0xb')]);router[_0x2ad0('0x6')](_0x2ad0('0xc'),auth[_0x2ad0('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x2ad0('0x6')](_0x2ad0('0xd'),auth[_0x2ad0('0x7')](),controller[_0x2ad0('0xe')]);router[_0x2ad0('0xf')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x2ad0('0x10')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0x2ad0('0x7')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x2ad0('0xf')](_0x2ad0('0x11'),auth[_0x2ad0('0x7')](),controller[_0x2ad0('0x12')]);router['put'](_0x2ad0('0xa'),auth['isAuthenticated'](),controller[_0x2ad0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8d50=['checkContactHopper','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id'];(function(_0x589189,_0x2ff145){var _0x3cd621=function(_0x1a63b4){while(--_0x1a63b4){_0x589189['push'](_0x589189['shift']());}};_0x3cd621(++_0x2ff145);}(_0x8d50,0xdc));var _0x08d5=function(_0x50946f,_0xb2abb7){_0x50946f=_0x50946f-0x0;var _0xdea2e1=_0x8d50[_0x50946f];return _0xdea2e1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x08d5('0x0'));var timeout=require(_0x08d5('0x1'));var express=require(_0x08d5('0x2'));var router=express[_0x08d5('0x3')]();var auth=require(_0x08d5('0x4'));var interaction=require(_0x08d5('0x5'));var config=require(_0x08d5('0x6'));var controller=require(_0x08d5('0x7'));router['get']('/',auth[_0x08d5('0x8')](),controller[_0x08d5('0x9')]);router[_0x08d5('0xa')](_0x08d5('0xb'),auth[_0x08d5('0x8')](),controller[_0x08d5('0xc')]);router[_0x08d5('0xa')](_0x08d5('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x08d5('0xa')](_0x08d5('0xe'),auth[_0x08d5('0x8')](),controller[_0x08d5('0xf')]);router[_0x08d5('0xa')]('/campaign/countAttributes/:id',auth[_0x08d5('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x08d5('0x10'),auth[_0x08d5('0x8')](),controller[_0x08d5('0x11')]);router[_0x08d5('0x12')](_0x08d5('0x13'),auth[_0x08d5('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x08d5('0x14')]);router[_0x08d5('0x15')](_0x08d5('0xd'),auth['isAuthenticated'](),controller[_0x08d5('0x16')]);module[_0x08d5('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 49c2f99..f9c0304 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 _0xa18c=['STRING','INTEGER','DATE','BOOLEAN','sequelize','exports'];(function(_0x417bde,_0x9f389e){var _0xd29a29=function(_0x1f54f0){while(--_0x1f54f0){_0x417bde['push'](_0x417bde['shift']());}};_0xd29a29(++_0x9f389e);}(_0xa18c,0x160));var _0xca18=function(_0x5dff13,_0x4391ad){_0x5dff13=_0x5dff13-0x0;var _0x50998d=_0xa18c[_0x5dff13];return _0x50998d;};'use strict';var Sequelize=require(_0xca18('0x0'));module[_0xca18('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xca18('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xca18('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xca18('0x2')]},'originatecalleridname':{'type':Sequelize[_0xca18('0x2')]},'calleridnum':{'type':Sequelize[_0xca18('0x2')]},'calleridname':{'type':Sequelize[_0xca18('0x2')]},'starttime':{'type':Sequelize[_0xca18('0x4')]},'responsetime':{'type':Sequelize[_0xca18('0x4')]},'answertime':{'type':Sequelize[_0xca18('0x4')]},'droptime':{'type':Sequelize[_0xca18('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xca18('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xca18('0x2')]},'membername':{'type':Sequelize[_0xca18('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xca18('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xca18('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xca18('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xca18('0x4')]},'recallme':{'type':Sequelize[_0xca18('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xca18('0x4')]},'edited':{'type':Sequelize[_0xca18('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xca18('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x219d=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x37bc3b,_0x5ca5c3){var _0x508415=function(_0x2e55ed){while(--_0x2e55ed){_0x37bc3b['push'](_0x37bc3b['shift']());}};_0x508415(++_0x5ca5c3);}(_0x219d,0x199));var _0xd219=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x219d[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xd219('0x0'));module[_0xd219('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd219('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd219('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd219('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xd219('0x4')]},'answertime':{'type':Sequelize[_0xd219('0x4')]},'droptime':{'type':Sequelize[_0xd219('0x4')]},'endtime':{'type':Sequelize[_0xd219('0x4')]},'ringtime':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd219('0x2')]},'campaign':{'type':Sequelize[_0xd219('0x2')]},'campaigntype':{'type':Sequelize[_0xd219('0x2')]},'membername':{'type':Sequelize[_0xd219('0x2')]},'reason':{'type':Sequelize[_0xd219('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd219('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd219('0x4')]},'edited':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd219('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b1e0b0d..c1dbea3 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 _0x2a7a=['reject','then','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','find','catch','create','body','describe','uniqueid','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','limit','set','json','apply'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x2a7a,0x6b));var _0xa2a7=function(_0x186850,_0x522266){_0x186850=_0x186850-0x0;var _0x50ef0e=_0x2a7a[_0x186850];return _0x50ef0e;};'use strict';var pdf=require(_0xa2a7('0x0'));var emlformat=require(_0xa2a7('0x1'));var rimraf=require(_0xa2a7('0x2'));var zipdir=require(_0xa2a7('0x3'));var jsonpatch=require(_0xa2a7('0x4'));var rp=require(_0xa2a7('0x5'));var moment=require(_0xa2a7('0x6'));var BPromise=require(_0xa2a7('0x7'));var Mustache=require('mustache');var util=require(_0xa2a7('0x8'));var path=require(_0xa2a7('0x9'));var sox=require('sox');var csv=require(_0xa2a7('0xa'));var ejs=require(_0xa2a7('0xb'));var fs=require('fs');var _=require(_0xa2a7('0xc'));var squel=require('squel');var crypto=require(_0xa2a7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa2a7('0xe'));var toCsv=require(_0xa2a7('0xa'));var querystring=require(_0xa2a7('0xf'));var Papa=require(_0xa2a7('0x10'));var Redis=require(_0xa2a7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa2a7('0x12'));var hardwareService=require(_0xa2a7('0x13'));var logger=require(_0xa2a7('0x14'))(_0xa2a7('0x15'));var utils=require('../../config/utils');var config=require(_0xa2a7('0x16'));var db=require(_0xa2a7('0x17'))['db'];function respondWithStatusCode(_0x2da610,_0x21ce79){_0x21ce79=_0x21ce79||0xcc;return function(_0x5e3601){if(_0x5e3601){return _0x2da610['sendStatus'](_0x21ce79);}return _0x2da610[_0xa2a7('0x18')](_0x21ce79)[_0xa2a7('0x19')]();};}function respondWithResult(_0x32a74e,_0x11bbe4){_0x11bbe4=_0x11bbe4||0xc8;return function(_0x522c4f){if(_0x522c4f){return _0x32a74e[_0xa2a7('0x18')](_0x11bbe4)['json'](_0x522c4f);}};}function respondWithFilteredResult(_0x2ff3a7,_0x5acd31){return function(_0xf145dd){if(_0xf145dd){var _0x269ba4=_0xf145dd['count'],_0x3e9ddb=_0x5acd31['offset'],_0x8659ff=_0x5acd31[_0xa2a7('0x1a')]+_0x5acd31[_0xa2a7('0x1b')],_0x2a4aa3;if(_0x8659ff>=_0x269ba4){_0x8659ff=_0x269ba4;_0x2a4aa3=0xc8;}else{_0x2a4aa3=0xce;}_0x2ff3a7[_0xa2a7('0x18')](_0x2a4aa3);return _0x2ff3a7[_0xa2a7('0x1c')]('Content-Range',_0x3e9ddb+'-'+_0x8659ff+'/'+_0x269ba4)[_0xa2a7('0x1d')](_0xf145dd);}return null;};}function patchUpdates(_0x174dc5){return function(_0x37079a){try{jsonpatch[_0xa2a7('0x1e')](_0x37079a,_0x174dc5,!![]);}catch(_0x8bf5f5){return BPromise[_0xa2a7('0x1f')](_0x8bf5f5);}return _0x37079a['save']();};}function saveUpdates(_0xe91f1e,_0x30c37a){return function(_0x10c7b2){if(_0x10c7b2){return _0x10c7b2['update'](_0xe91f1e)[_0xa2a7('0x20')](function(_0x97da06){return _0x97da06;});}return null;};}function removeEntity(_0x248ce7,_0x17916d){return function(_0x3d5133){if(_0x3d5133){return _0x3d5133['destroy']()[_0xa2a7('0x20')](function(){_0x248ce7['status'](0xcc)[_0xa2a7('0x19')]();});}};}function handleEntityNotFound(_0x107ff8,_0x34ae56){return function(_0x2ea125){if(!_0x2ea125){_0x107ff8['sendStatus'](0x194);}return _0x2ea125;};}function handleError(_0x4a4de1,_0x22c05d){_0x22c05d=_0x22c05d||0x1f4;return function(_0x20be62){logger['error'](_0x20be62[_0xa2a7('0x21')]);if(_0x20be62[_0xa2a7('0x22')]){delete _0x20be62[_0xa2a7('0x22')];}_0x4a4de1[_0xa2a7('0x18')](_0x22c05d)[_0xa2a7('0x23')](_0x20be62);};}exports[_0xa2a7('0x24')]=function(_0x53b055,_0x13a1f0){var _0x448a83={},_0x1c10e6={},_0x294318={'count':0x0,'rows':[]};var _0x4585d2=_[_0xa2a7('0x25')](db[_0xa2a7('0x26')][_0xa2a7('0x27')],function(_0x2f57cd){return{'name':_0x2f57cd['fieldName'],'type':_0x2f57cd[_0xa2a7('0x28')][_0xa2a7('0x29')]};});_0x1c10e6['model']=_[_0xa2a7('0x25')](_0x4585d2,_0xa2a7('0x22'));_0x1c10e6[_0xa2a7('0x2a')]=_[_0xa2a7('0x2b')](_0x53b055[_0xa2a7('0x2a')]);_0x1c10e6[_0xa2a7('0x2c')]=_[_0xa2a7('0x2d')](_0x1c10e6[_0xa2a7('0x2e')],_0x1c10e6[_0xa2a7('0x2a')]);_0x448a83[_0xa2a7('0x2f')]=_[_0xa2a7('0x2d')](_0x1c10e6['model'],qs[_0xa2a7('0x30')](_0x53b055['query']['fields']));_0x448a83[_0xa2a7('0x2f')]=_0x448a83[_0xa2a7('0x2f')][_0xa2a7('0x31')]?_0x448a83[_0xa2a7('0x2f')]:_0x1c10e6[_0xa2a7('0x2e')];if(!_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x32')]('nolimit')){_0x448a83['limit']=qs[_0xa2a7('0x1b')](_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x1b')]);_0x448a83[_0xa2a7('0x1a')]=qs[_0xa2a7('0x1a')](_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x1a')]);}_0x448a83['order']=qs[_0xa2a7('0x33')](_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x33')]);_0x448a83[_0xa2a7('0x34')]=qs[_0xa2a7('0x2c')](_[_0xa2a7('0x35')](_0x53b055[_0xa2a7('0x2a')],_0x1c10e6[_0xa2a7('0x2c')]),_0x4585d2);if(_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x36')]){_0x448a83[_0xa2a7('0x34')]=_[_0xa2a7('0x37')](_0x448a83[_0xa2a7('0x34')],{'$or':_[_0xa2a7('0x25')](_0x4585d2,function(_0x16eb44){if(_0x16eb44['type']!==_0xa2a7('0x38')){var _0xf3ad7c={};_0xf3ad7c[_0x16eb44[_0xa2a7('0x22')]]={'$like':'%'+_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x36')]+'%'};return _0xf3ad7c;}})});}_0x448a83=_[_0xa2a7('0x37')]({},_0x448a83,_0x53b055[_0xa2a7('0x39')]);var _0x3d557b={'where':_0x448a83['where']};return db[_0xa2a7('0x26')][_0xa2a7('0x3a')](_0x3d557b)[_0xa2a7('0x20')](function(_0x3ea967){_0x294318[_0xa2a7('0x3a')]=_0x3ea967;if(_0x53b055[_0xa2a7('0x2a')][_0xa2a7('0x3b')]){_0x448a83[_0xa2a7('0x3c')]=[{'all':!![]}];}return db[_0xa2a7('0x26')][_0xa2a7('0x3d')](_0x448a83);})['then'](function(_0x5c8e37){_0x294318['rows']=_0x5c8e37;return _0x294318;})[_0xa2a7('0x20')](respondWithFilteredResult(_0x13a1f0,_0x448a83))['catch'](handleError(_0x13a1f0,null));};exports['show']=function(_0x337266,_0x58f762){var _0x3766c6={'raw':!![],'where':{'id':_0x337266['params']['id']}},_0x5c8dd9={};_0x5c8dd9[_0xa2a7('0x2e')]=_['keys'](db[_0xa2a7('0x26')][_0xa2a7('0x27')]);_0x5c8dd9[_0xa2a7('0x2a')]=_[_0xa2a7('0x2b')](_0x337266[_0xa2a7('0x2a')]);_0x5c8dd9[_0xa2a7('0x2c')]=_['intersection'](_0x5c8dd9[_0xa2a7('0x2e')],_0x5c8dd9['query']);_0x3766c6[_0xa2a7('0x2f')]=_['intersection'](_0x5c8dd9['model'],qs['fields'](_0x337266[_0xa2a7('0x2a')][_0xa2a7('0x30')]));_0x3766c6[_0xa2a7('0x2f')]=_0x3766c6[_0xa2a7('0x2f')][_0xa2a7('0x31')]?_0x3766c6[_0xa2a7('0x2f')]:_0x5c8dd9[_0xa2a7('0x2e')];if(_0x337266[_0xa2a7('0x2a')][_0xa2a7('0x3b')]){_0x3766c6[_0xa2a7('0x3c')]=[{'all':!![]}];}_0x3766c6=_[_0xa2a7('0x37')]({},_0x3766c6,_0x337266['options']);return db['CmHopperHistory'][_0xa2a7('0x3e')](_0x3766c6)['then'](handleEntityNotFound(_0x58f762,null))['then'](respondWithResult(_0x58f762,null))[_0xa2a7('0x3f')](handleError(_0x58f762,null));};exports[_0xa2a7('0x40')]=function(_0x210a91,_0x500672){return db['CmHopperHistory'][_0xa2a7('0x40')](_0x210a91[_0xa2a7('0x41')],{})[_0xa2a7('0x20')](respondWithResult(_0x500672,0xc9))[_0xa2a7('0x3f')](handleError(_0x500672,null));};exports[_0xa2a7('0x42')]=function(_0x9a67c6,_0x16524e){return db[_0xa2a7('0x26')]['describe']()['then'](respondWithResult(_0x16524e,null))[_0xa2a7('0x3f')](handleError(_0x16524e,null));};exports['update']=function(_0x782eea,_0x22749d){if(_0x782eea[_0xa2a7('0x41')][_0xa2a7('0x43')]){delete _0x782eea[_0xa2a7('0x41')][_0xa2a7('0x43')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x782eea[_0xa2a7('0x44')]['id']}})['then'](handleEntityNotFound(_0x22749d,null))[_0xa2a7('0x20')](saveUpdates(_0x782eea['body'],null))[_0xa2a7('0x20')](respondWithResult(_0x22749d,null))['catch'](handleError(_0x22749d,null));}; \ No newline at end of file +var _0x094f=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmHopperHistory','includeAll','catch','show','params','find','create','describe','uniqueid','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack'];(function(_0x4d4440,_0x101e49){var _0x38959b=function(_0x143aea){while(--_0x143aea){_0x4d4440['push'](_0x4d4440['shift']());}};_0x38959b(++_0x101e49);}(_0x094f,0x1a4));var _0xf094=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x094f[_0x1b70e3];return _0x1452ab;};'use strict';var pdf=require(_0xf094('0x0'));var emlformat=require(_0xf094('0x1'));var rimraf=require(_0xf094('0x2'));var zipdir=require(_0xf094('0x3'));var jsonpatch=require(_0xf094('0x4'));var rp=require(_0xf094('0x5'));var moment=require(_0xf094('0x6'));var BPromise=require(_0xf094('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf094('0x8'));var sox=require(_0xf094('0x9'));var csv=require(_0xf094('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf094('0xb'));var squel=require(_0xf094('0xc'));var crypto=require(_0xf094('0xd'));var jsforce=require(_0xf094('0xe'));var deskjs=require(_0xf094('0xf'));var toCsv=require(_0xf094('0xa'));var querystring=require(_0xf094('0x10'));var Papa=require(_0xf094('0x11'));var Redis=require(_0xf094('0x12'));var authService=require(_0xf094('0x13'));var qs=require(_0xf094('0x14'));var as=require(_0xf094('0x15'));var hardwareService=require(_0xf094('0x16'));var logger=require(_0xf094('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf094('0x18'))['db'];function respondWithStatusCode(_0x42605f,_0x25d982){_0x25d982=_0x25d982||0xcc;return function(_0x37c187){if(_0x37c187){return _0x42605f[_0xf094('0x19')](_0x25d982);}return _0x42605f['status'](_0x25d982)[_0xf094('0x1a')]();};}function respondWithResult(_0x3f057b,_0x11ec6a){_0x11ec6a=_0x11ec6a||0xc8;return function(_0x3327d7){if(_0x3327d7){return _0x3f057b[_0xf094('0x1b')](_0x11ec6a)['json'](_0x3327d7);}};}function respondWithFilteredResult(_0x52622e,_0x1ac556){return function(_0x271f92){if(_0x271f92){var _0x444370=_0x271f92[_0xf094('0x1c')],_0x432f18=_0x1ac556['offset'],_0x5be3a9=_0x1ac556[_0xf094('0x1d')]+_0x1ac556[_0xf094('0x1e')],_0x1ee049;if(_0x5be3a9>=_0x444370){_0x5be3a9=_0x444370;_0x1ee049=0xc8;}else{_0x1ee049=0xce;}_0x52622e[_0xf094('0x1b')](_0x1ee049);return _0x52622e[_0xf094('0x1f')](_0xf094('0x20'),_0x432f18+'-'+_0x5be3a9+'/'+_0x444370)[_0xf094('0x21')](_0x271f92);}return null;};}function patchUpdates(_0x29c4ab){return function(_0x537fda){try{jsonpatch[_0xf094('0x22')](_0x537fda,_0x29c4ab,!![]);}catch(_0x5c602b){return BPromise[_0xf094('0x23')](_0x5c602b);}return _0x537fda[_0xf094('0x24')]();};}function saveUpdates(_0x19b0c4,_0x45b223){return function(_0x32db59){if(_0x32db59){return _0x32db59[_0xf094('0x25')](_0x19b0c4)[_0xf094('0x26')](function(_0x14fb61){return _0x14fb61;});}return null;};}function removeEntity(_0x40a2a0,_0x43d765){return function(_0x4d7be0){if(_0x4d7be0){return _0x4d7be0[_0xf094('0x27')]()[_0xf094('0x26')](function(){_0x40a2a0[_0xf094('0x1b')](0xcc)[_0xf094('0x1a')]();});}};}function handleEntityNotFound(_0x239880,_0x55891f){return function(_0x4fe7db){if(!_0x4fe7db){_0x239880[_0xf094('0x19')](0x194);}return _0x4fe7db;};}function handleError(_0x2f95d5,_0xe80fdf){_0xe80fdf=_0xe80fdf||0x1f4;return function(_0x2bdd1c){logger[_0xf094('0x28')](_0x2bdd1c[_0xf094('0x29')]);if(_0x2bdd1c['name']){delete _0x2bdd1c[_0xf094('0x2a')];}_0x2f95d5['status'](_0xe80fdf)[_0xf094('0x2b')](_0x2bdd1c);};}exports[_0xf094('0x2c')]=function(_0x41887b,_0x237d89){var _0x45de8c={},_0x2b8be8={},_0x38290a={'count':0x0,'rows':[]};var _0xc03097=_[_0xf094('0x2d')](db['CmHopperHistory'][_0xf094('0x2e')],function(_0x72636c){return{'name':_0x72636c[_0xf094('0x2f')],'type':_0x72636c[_0xf094('0x30')][_0xf094('0x31')]};});_0x2b8be8['model']=_[_0xf094('0x2d')](_0xc03097,'name');_0x2b8be8[_0xf094('0x32')]=_[_0xf094('0x33')](_0x41887b['query']);_0x2b8be8[_0xf094('0x34')]=_[_0xf094('0x35')](_0x2b8be8[_0xf094('0x36')],_0x2b8be8[_0xf094('0x32')]);_0x45de8c[_0xf094('0x37')]=_[_0xf094('0x35')](_0x2b8be8[_0xf094('0x36')],qs[_0xf094('0x38')](_0x41887b[_0xf094('0x32')][_0xf094('0x38')]));_0x45de8c[_0xf094('0x37')]=_0x45de8c[_0xf094('0x37')][_0xf094('0x39')]?_0x45de8c['attributes']:_0x2b8be8[_0xf094('0x36')];if(!_0x41887b[_0xf094('0x32')][_0xf094('0x3a')](_0xf094('0x3b'))){_0x45de8c[_0xf094('0x1e')]=qs[_0xf094('0x1e')](_0x41887b['query']['limit']);_0x45de8c['offset']=qs[_0xf094('0x1d')](_0x41887b['query'][_0xf094('0x1d')]);}_0x45de8c[_0xf094('0x3c')]=qs[_0xf094('0x3d')](_0x41887b[_0xf094('0x32')][_0xf094('0x3d')]);_0x45de8c[_0xf094('0x3e')]=qs[_0xf094('0x34')](_[_0xf094('0x3f')](_0x41887b[_0xf094('0x32')],_0x2b8be8['filters']),_0xc03097);if(_0x41887b[_0xf094('0x32')][_0xf094('0x40')]){_0x45de8c[_0xf094('0x3e')]=_[_0xf094('0x41')](_0x45de8c[_0xf094('0x3e')],{'$or':_['map'](_0xc03097,function(_0x450fb8){if(_0x450fb8['type']!=='VIRTUAL'){var _0x478be5={};_0x478be5[_0x450fb8[_0xf094('0x2a')]]={'$like':'%'+_0x41887b['query'][_0xf094('0x40')]+'%'};return _0x478be5;}})});}_0x45de8c=_[_0xf094('0x41')]({},_0x45de8c,_0x41887b[_0xf094('0x42')]);var _0x434ec4={'where':_0x45de8c[_0xf094('0x3e')]};return db[_0xf094('0x43')][_0xf094('0x1c')](_0x434ec4)[_0xf094('0x26')](function(_0x1e9ec3){_0x38290a['count']=_0x1e9ec3;if(_0x41887b[_0xf094('0x32')][_0xf094('0x44')]){_0x45de8c['include']=[{'all':!![]}];}return db[_0xf094('0x43')]['findAll'](_0x45de8c);})[_0xf094('0x26')](function(_0xeb1335){_0x38290a['rows']=_0xeb1335;return _0x38290a;})[_0xf094('0x26')](respondWithFilteredResult(_0x237d89,_0x45de8c))[_0xf094('0x45')](handleError(_0x237d89,null));};exports[_0xf094('0x46')]=function(_0x5ac7ab,_0x6652ef){var _0x2a9ab5={'raw':!![],'where':{'id':_0x5ac7ab[_0xf094('0x47')]['id']}},_0x27dfae={};_0x27dfae[_0xf094('0x36')]=_[_0xf094('0x33')](db['CmHopperHistory'][_0xf094('0x2e')]);_0x27dfae['query']=_[_0xf094('0x33')](_0x5ac7ab[_0xf094('0x32')]);_0x27dfae['filters']=_[_0xf094('0x35')](_0x27dfae[_0xf094('0x36')],_0x27dfae[_0xf094('0x32')]);_0x2a9ab5['attributes']=_[_0xf094('0x35')](_0x27dfae[_0xf094('0x36')],qs['fields'](_0x5ac7ab[_0xf094('0x32')][_0xf094('0x38')]));_0x2a9ab5['attributes']=_0x2a9ab5[_0xf094('0x37')][_0xf094('0x39')]?_0x2a9ab5[_0xf094('0x37')]:_0x27dfae[_0xf094('0x36')];if(_0x5ac7ab['query'][_0xf094('0x44')]){_0x2a9ab5['include']=[{'all':!![]}];}_0x2a9ab5=_[_0xf094('0x41')]({},_0x2a9ab5,_0x5ac7ab['options']);return db[_0xf094('0x43')][_0xf094('0x48')](_0x2a9ab5)[_0xf094('0x26')](handleEntityNotFound(_0x6652ef,null))['then'](respondWithResult(_0x6652ef,null))[_0xf094('0x45')](handleError(_0x6652ef,null));};exports['create']=function(_0x5adb46,_0x2cbf6c){return db[_0xf094('0x43')][_0xf094('0x49')](_0x5adb46['body'],{})[_0xf094('0x26')](respondWithResult(_0x2cbf6c,0xc9))[_0xf094('0x45')](handleError(_0x2cbf6c,null));};exports[_0xf094('0x4a')]=function(_0x4e5045,_0x20bd45){return db['CmHopperHistory']['describe']()[_0xf094('0x26')](respondWithResult(_0x20bd45,null))[_0xf094('0x45')](handleError(_0x20bd45,null));};exports[_0xf094('0x25')]=function(_0x35b4ac,_0x34e8c7){if(_0x35b4ac['body']['uniqueid']){delete _0x35b4ac['body'][_0xf094('0x4b')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x35b4ac[_0xf094('0x47')]['id']}})[_0xf094('0x26')](handleEntityNotFound(_0x34e8c7,null))[_0xf094('0x26')](saveUpdates(_0x35b4ac[_0xf094('0x4c')],null))['then'](respondWithResult(_0x34e8c7,null))[_0xf094('0x45')](handleError(_0x34e8c7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index b58a305..87b901b 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 _0xacc2=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','moment','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xacc2,0xb8));var _0x2acc=function(_0x4a1d79,_0x2fdf58){_0x4a1d79=_0x4a1d79-0x0;var _0x71b353=_0xacc2[_0x4a1d79];return _0x71b353;};'use strict';var _=require(_0x2acc('0x0'));var util=require(_0x2acc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2acc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2acc('0x3'));var rimraf=require(_0x2acc('0x4'));var config=require(_0x2acc('0x5'));var attributes=require(_0x2acc('0x6'));module[_0x2acc('0x7')]=function(_0x195d3f,_0x2f4d64){return _0x195d3f['define'](_0x2acc('0x8'),attributes,{'tableName':_0x2acc('0x9'),'paranoid':![],'indexes':[{'name':_0x2acc('0xa'),'fields':['endtime']},{'name':_0x2acc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf66=['moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define','endtime','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2aed41,_0x479e81){var _0x4ff431=function(_0x53f695){while(--_0x53f695){_0x2aed41['push'](_0x2aed41['shift']());}};_0x4ff431(++_0x479e81);}(_0xdf66,0x1a9));var _0x6df6=function(_0x163d42,_0x3cabea){_0x163d42=_0x163d42-0x0;var _0x59186c=_0xdf66[_0x163d42];return _0x59186c;};'use strict';var _=require(_0x6df6('0x0'));var util=require(_0x6df6('0x1'));var logger=require(_0x6df6('0x2'))(_0x6df6('0x3'));var moment=require(_0x6df6('0x4'));var BPromise=require(_0x6df6('0x5'));var rp=require(_0x6df6('0x6'));var fs=require('fs');var path=require(_0x6df6('0x7'));var rimraf=require(_0x6df6('0x8'));var config=require('../../config/environment');var attributes=require(_0x6df6('0x9'));module['exports']=function(_0x5df40f,_0x333a12){return _0x5df40f[_0x6df6('0xa')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x6df6('0xb'),'fields':[_0x6df6('0xb')]},{'name':_0x6df6('0xc'),'fields':[_0x6df6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2685581..bdec2e8 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 _0x7916=['body','options','raw','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','AvgHandleTime','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','findAll','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x380016,_0x178dd6){var _0x5c7ac0=function(_0xa8ddca){while(--_0xa8ddca){_0x380016['push'](_0x380016['shift']());}};_0x5c7ac0(++_0x178dd6);}(_0x7916,0x128));var _0x6791=function(_0x3d23e4,_0x164466){_0x3d23e4=_0x3d23e4-0x0;var _0x1aedd6=_0x7916[_0x3d23e4];return _0x1aedd6;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});}exports[_0x6791('0x15')]=function(_0x5bec14){var _0x1872f5=this;return new Promise(function(_0x4d8a79,_0xe55dba){return db[_0x6791('0x16')][_0x6791('0x17')](_0x5bec14[_0x6791('0x18')],{'raw':_0x5bec14[_0x6791('0x19')]?_0x5bec14[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4a2922){logger[_0x6791('0x12')]('CreateCmHopperHistory',_0x5bec14);logger[_0x6791('0xd')](_0x6791('0x15'),_0x5bec14,JSON['stringify'](_0x4a2922));_0x4d8a79(_0x4a2922);})[_0x6791('0x14')](function(_0x309610){logger[_0x6791('0xf')](_0x6791('0x15'),_0x309610['message'],_0x5bec14);_0xe55dba(_0x1872f5[_0x6791('0xf')](0x1f4,_0x309610[_0x6791('0x11')]));});});};exports['AvgHandleTime']=function(_0x53bb44){var _0x4b23bc=this;return new Promise(function(_0x372dae,_0x502043){return db[_0x6791('0x16')]['findAll']({'raw':_0x53bb44['options']?_0x53bb44['options'][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x53bb44[_0x6791('0x19')]?_0x53bb44[_0x6791('0x19')]['where']||null:null,'attributes':[[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db['sequelize'][_0x6791('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x6791('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x1e')))),_0x6791('0x1f')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x21')))),_0x6791('0x22')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x6791('0x24')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x23'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x1de770){logger[_0x6791('0x12')](_0x6791('0x25'),_0x53bb44);logger['debug']('AvgHandleTime',_0x53bb44,JSON[_0x6791('0xe')](_0x1de770));_0x372dae(_0x1de770);})[_0x6791('0x14')](function(_0x31a525){logger[_0x6791('0xf')]('AvgHandleTime',_0x31a525[_0x6791('0x11')],_0x53bb44);_0x502043(_0x4b23bc[_0x6791('0xf')](0x1f4,_0x31a525[_0x6791('0x11')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x31217d){var _0x567e36=this;return new Promise(function(_0x4ee010,_0x256c02){return db[_0x6791('0x16')]['findAll']({'raw':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')][_0x6791('0x1a')]===undefined?!![]:![]:!![],'where':_0x31217d[_0x6791('0x19')]?_0x31217d[_0x6791('0x19')]['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0x6791('0x28')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x29')))),_0x6791('0x2a')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x1e')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x2b')))),_0x6791('0x2c')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2d')))),'outboundCongestionCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x2e')))),_0x6791('0x2f')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x30')))),'outboundDropCallsDayCallersExit'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x31')))),_0x6791('0x32')],[db['sequelize']['fn'](_0x6791('0x1c'),db['sequelize']['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x33')))),_0x6791('0x34')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2014,\x201,\x20null'))),_0x6791('0x35')],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')](_0x6791('0x36')))),'outboundRejectCallsDay'],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')][_0x6791('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),_0x6791('0x37')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')](_0x6791('0x38')))),_0x6791('0x39')],[db[_0x6791('0x1b')]['fn']('COUNT',db[_0x6791('0x1b')]['fn']('IF',db[_0x6791('0x1b')]['literal'](_0x6791('0x3a')))),_0x6791('0x3b')]],'group':[_0x6791('0x26')]})['then'](function(_0x355e97){logger[_0x6791('0x12')]('GetVoiceQueueHopperHistory',_0x31217d);logger[_0x6791('0xd')](_0x6791('0x3c'),_0x31217d,JSON['stringify'](_0x355e97));_0x4ee010(_0x355e97);})[_0x6791('0x14')](function(_0x216498){logger[_0x6791('0xf')](_0x6791('0x3c'),_0x216498['message'],_0x31217d);_0x256c02(_0x567e36[_0x6791('0xf')](0x1f4,_0x216498[_0x6791('0x11')]));});});};exports[_0x6791('0x3d')]=function(_0x5b534b){var _0x5a7a88=this;return new Promise(function(_0x1d6bec,_0x6b8acd){return db[_0x6791('0x16')][_0x6791('0x3e')]({'raw':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b534b[_0x6791('0x19')]?_0x5b534b['options']['where']||null:null,'attributes':[[_0x6791('0x26'),_0x6791('0x27')],[db[_0x6791('0x1b')]['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')][_0x6791('0x1d')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x6791('0x1c'),db[_0x6791('0x1b')]['fn']('IF',db['sequelize'][_0x6791('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x6791('0x3f')]],'group':[_0x6791('0x26')]})['then'](function(_0x1ebfb6){logger[_0x6791('0x12')](_0x6791('0x3d'),_0x5b534b);logger['debug'](_0x6791('0x3d'),_0x5b534b,JSON[_0x6791('0xe')](_0x1ebfb6));_0x1d6bec(_0x1ebfb6);})[_0x6791('0x14')](function(_0x383853){logger[_0x6791('0xf')]('GetCampaignHopperHistory',_0x383853['message'],_0x5b534b);_0x6b8acd(_0x5a7a88[_0x6791('0xf')](0x1f4,_0x383853[_0x6791('0x11')]));});});}; \ No newline at end of file +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(_0x369633,_0x263fb9){var _0x1eda8c=function(_0x3b1b46){while(--_0x3b1b46){_0x369633['push'](_0x369633['shift']());}};_0x1eda8c(++_0x263fb9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4e55cc,_0x6e5a19){_0x4e55cc=_0x4e55cc-0x0;var _0xa243fb=_0xf4eb[_0x4e55cc];return _0xa243fb;};'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 diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 6617cfc..41be326 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 _0x64e4=['/describe','describe','get','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated'];(function(_0x361484,_0xd0f420){var _0x4b1eb3=function(_0x390bc4){while(--_0x390bc4){_0x361484['push'](_0x361484['shift']());}};_0x4b1eb3(++_0xd0f420);}(_0x64e4,0x135));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x464e('0x0'));var util=require(_0x464e('0x1'));var path=require(_0x464e('0x2'));var timeout=require(_0x464e('0x3'));var express=require(_0x464e('0x4'));var router=express[_0x464e('0x5')]();var auth=require(_0x464e('0x6'));var interaction=require(_0x464e('0x7'));var config=require(_0x464e('0x8'));var controller=require(_0x464e('0x9'));router['get']('/',auth[_0x464e('0xa')](),controller['index']);router['get'](_0x464e('0xb'),auth['isAuthenticated'](),controller[_0x464e('0xc')]);router[_0x464e('0xd')](_0x464e('0xe'),auth[_0x464e('0xa')](),controller[_0x464e('0xf')]);router[_0x464e('0x10')]('/',auth[_0x464e('0xa')](),controller['create']);router[_0x464e('0x11')](_0x464e('0xe'),auth[_0x464e('0xa')](),controller[_0x464e('0x12')]);module[_0x464e('0x13')]=router; \ No newline at end of file +var _0x5fab=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x3987e5,_0x3fc01d){var _0x45d23c=function(_0x278fb3){while(--_0x278fb3){_0x3987e5['push'](_0x3987e5['shift']());}};_0x45d23c(++_0x3fc01d);}(_0x5fab,0x177));var _0xb5fa=function(_0x581d53,_0x4ad997){_0x581d53=_0x581d53-0x0;var _0x56c2d8=_0x5fab[_0x581d53];return _0x56c2d8;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/describe',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0x9')]('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xd')]);router[_0xb5fa('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x11')]);module[_0xb5fa('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 78bdcbc..f8cdc77 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 _0xeeb6=['STRING','name','exports'];(function(_0x162e41,_0x37a68f){var _0x18b742=function(_0x5b232a){while(--_0x5b232a){_0x162e41['push'](_0x162e41['shift']());}};_0x18b742(++_0x37a68f);}(_0xeeb6,0xfe));var _0x6eeb=function(_0x520f9b,_0x1d53e6){_0x520f9b=_0x520f9b-0x0;var _0x3b32ab=_0xeeb6[_0x520f9b];return _0x3b32ab;};'use strict';var Sequelize=require('sequelize');module[_0x6eeb('0x0')]={'name':{'type':Sequelize[_0x6eeb('0x1')],'unique':_0x6eeb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6eeb('0x1')]},'dialPrefix':{'type':Sequelize[_0x6eeb('0x1')]}}; \ No newline at end of file +var _0xba7a=['STRING','name','exports'];(function(_0x2acd24,_0xf315ac){var _0x546099=function(_0x479e66){while(--_0x479e66){_0x2acd24['push'](_0x2acd24['shift']());}};_0x546099(++_0xf315ac);}(_0xba7a,0x89));var _0xaba7=function(_0x3e9e3e,_0x331b44){_0x3e9e3e=_0x3e9e3e-0x0;var _0x32ae57=_0xba7a[_0x3e9e3e];return _0x32ae57;};'use strict';var Sequelize=require('sequelize');module[_0xaba7('0x0')]={'name':{'type':Sequelize[_0xaba7('0x1')],'unique':_0xaba7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaba7('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 49f0940..9a79d09 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 _0xd267=['number','switch','BOOLEAN','defaultValue','cm_contacts','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','localhost','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','getDispositions','findOne','order','ListId','rows','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContacts','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text'];(function(_0x49cfb0,_0x430675){var _0x56954e=function(_0x401391){while(--_0x401391){_0x49cfb0['push'](_0x49cfb0['shift']());}};_0x56954e(++_0x430675);}(_0xd267,0x1bd));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7d26('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d26('0x1'));var jsonpatch=require(_0x7d26('0x2'));var rp=require(_0x7d26('0x3'));var moment=require(_0x7d26('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d26('0x5'));var util=require(_0x7d26('0x6'));var path=require(_0x7d26('0x7'));var sox=require(_0x7d26('0x8'));var csv=require(_0x7d26('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d26('0xa'));var squel=require(_0x7d26('0xb'));var crypto=require(_0x7d26('0xc'));var jsforce=require(_0x7d26('0xd'));var deskjs=require(_0x7d26('0xe'));var toCsv=require(_0x7d26('0x9'));var querystring=require(_0x7d26('0xf'));var Papa=require('papaparse');var Redis=require(_0x7d26('0x10'));var authService=require(_0x7d26('0x11'));var qs=require(_0x7d26('0x12'));var as=require(_0x7d26('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d26('0x14'))('api');var utils=require(_0x7d26('0x15'));var config=require(_0x7d26('0x16'));var db=require('../../mysqldb')['db'];config[_0x7d26('0x17')]=_['defaults'](config[_0x7d26('0x17')],{'host':_0x7d26('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d26('0x17')]));require(_0x7d26('0x19'))[_0x7d26('0x1a')](socket);function respondWithStatusCode(_0x5d8d63,_0x64453){_0x64453=_0x64453||0xcc;return function(_0x728590){if(_0x728590){return _0x5d8d63[_0x7d26('0x1b')](_0x64453);}return _0x5d8d63[_0x7d26('0x1c')](_0x64453)[_0x7d26('0x1d')]();};}function respondWithResult(_0x44e923,_0x51319a){_0x51319a=_0x51319a||0xc8;return function(_0x12ef09){if(_0x12ef09){return _0x44e923[_0x7d26('0x1c')](_0x51319a)[_0x7d26('0x1e')](_0x12ef09);}};}function respondWithFilteredResult(_0x359ad6,_0x25b7f8){return function(_0x38b71b){if(_0x38b71b){var _0x2c395a=_0x38b71b[_0x7d26('0x1f')],_0x46f3cf=_0x25b7f8[_0x7d26('0x20')],_0x4b5bf2=_0x25b7f8['offset']+_0x25b7f8[_0x7d26('0x21')],_0x559c3c;if(_0x4b5bf2>=_0x2c395a){_0x4b5bf2=_0x2c395a;_0x559c3c=0xc8;}else{_0x559c3c=0xce;}_0x359ad6[_0x7d26('0x1c')](_0x559c3c);return _0x359ad6[_0x7d26('0x22')](_0x7d26('0x23'),_0x46f3cf+'-'+_0x4b5bf2+'/'+_0x2c395a)['json'](_0x38b71b);}return null;};}function patchUpdates(_0x3217d8){return function(_0x110ccf){try{jsonpatch[_0x7d26('0x24')](_0x110ccf,_0x3217d8,!![]);}catch(_0x879a1c){return BPromise[_0x7d26('0x25')](_0x879a1c);}return _0x110ccf['save']();};}function saveUpdates(_0x45a0d9,_0x19eab4){return function(_0x122502){if(_0x122502){return _0x122502[_0x7d26('0x26')](_0x45a0d9)['then'](function(_0x215108){return _0x215108;});}return null;};}function removeEntity(_0x102e06,_0x248496){return function(_0x2f7ec9){if(_0x2f7ec9){return _0x2f7ec9[_0x7d26('0x27')]()[_0x7d26('0x28')](function(){var _0x241e6a=_0x2f7ec9['get']({'plain':!![]});var _0x3459='Lists';return db[_0x7d26('0x29')][_0x7d26('0x27')]({'where':{'type':_0x3459,'resourceId':_0x241e6a['id']}})[_0x7d26('0x28')](function(){return _0x2f7ec9;});})[_0x7d26('0x28')](function(){_0x102e06[_0x7d26('0x1c')](0xcc)[_0x7d26('0x1d')]();});}};}function handleEntityNotFound(_0x3dbfdb,_0x5d56cf){return function(_0x266652){if(!_0x266652){_0x3dbfdb[_0x7d26('0x1b')](0x194);}return _0x266652;};}function handleError(_0x5c0ac7,_0xbe859){_0xbe859=_0xbe859||0x1f4;return function(_0x5475ec){logger[_0x7d26('0x2a')](_0x5475ec[_0x7d26('0x2b')]);if(_0x5475ec[_0x7d26('0x2c')]){delete _0x5475ec[_0x7d26('0x2c')];}_0x5c0ac7[_0x7d26('0x1c')](_0xbe859)[_0x7d26('0x2d')](_0x5475ec);};}exports[_0x7d26('0x2e')]=function(_0x35a72c,_0x2f3d82){var _0x23b39b={},_0x875755={},_0x159bb3={'count':0x0,'rows':[]};var _0x13c642=_['map'](db[_0x7d26('0x2f')][_0x7d26('0x30')],function(_0x3ef5f7){return{'name':_0x3ef5f7['fieldName'],'type':_0x3ef5f7[_0x7d26('0x31')][_0x7d26('0x32')]};});_0x875755[_0x7d26('0x33')]=_[_0x7d26('0x34')](_0x13c642,_0x7d26('0x2c'));_0x875755[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x35a72c[_0x7d26('0x35')]);_0x875755[_0x7d26('0x37')]=_[_0x7d26('0x38')](_0x875755[_0x7d26('0x33')],_0x875755[_0x7d26('0x35')]);_0x23b39b['attributes']=_[_0x7d26('0x38')](_0x875755[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x35a72c[_0x7d26('0x35')]['fields']));_0x23b39b['attributes']=_0x23b39b['attributes'][_0x7d26('0x3a')]?_0x23b39b[_0x7d26('0x3b')]:_0x875755['model'];if(!_0x35a72c[_0x7d26('0x35')][_0x7d26('0x3c')](_0x7d26('0x3d'))){_0x23b39b['limit']=qs['limit'](_0x35a72c[_0x7d26('0x35')]['limit']);_0x23b39b[_0x7d26('0x20')]=qs['offset'](_0x35a72c['query'][_0x7d26('0x20')]);}_0x23b39b['order']=qs[_0x7d26('0x3e')](_0x35a72c[_0x7d26('0x35')]['sort']);_0x23b39b['where']=qs[_0x7d26('0x37')](_[_0x7d26('0x3f')](_0x35a72c[_0x7d26('0x35')],_0x875755[_0x7d26('0x37')]),_0x13c642);if(_0x35a72c['query'][_0x7d26('0x40')]){_0x23b39b['where']=_[_0x7d26('0x41')](_0x23b39b[_0x7d26('0x42')],{'$or':_['map'](_0x13c642,function(_0x37f823){if(_0x37f823[_0x7d26('0x31')]!==_0x7d26('0x43')){var _0x59b9ff={};_0x59b9ff[_0x37f823[_0x7d26('0x2c')]]={'$like':'%'+_0x35a72c[_0x7d26('0x35')][_0x7d26('0x40')]+'%'};return _0x59b9ff;}})});}_0x23b39b=_[_0x7d26('0x41')]({},_0x23b39b,_0x35a72c[_0x7d26('0x44')]);var _0x3e8624={'where':_0x23b39b[_0x7d26('0x42')]};return db['CmList'][_0x7d26('0x1f')](_0x3e8624)[_0x7d26('0x28')](function(_0x1fab48){_0x159bb3[_0x7d26('0x1f')]=_0x1fab48;if(_0x35a72c['query'][_0x7d26('0x45')]){_0x23b39b[_0x7d26('0x46')]=[{'all':!![]}];}return db[_0x7d26('0x2f')][_0x7d26('0x47')](_0x23b39b);})[_0x7d26('0x28')](function(_0x12cbc){_0x159bb3['rows']=_0x12cbc;return _0x159bb3;})[_0x7d26('0x28')](respondWithFilteredResult(_0x2f3d82,_0x23b39b))[_0x7d26('0x48')](handleError(_0x2f3d82,null));};exports[_0x7d26('0x49')]=function(_0x5583ae,_0x215dd6){var _0x4c890a={'raw':![],'where':{'id':_0x5583ae[_0x7d26('0x4a')]['id']}},_0x5066e7={};_0x5066e7['model']=_[_0x7d26('0x36')](db[_0x7d26('0x2f')][_0x7d26('0x30')]);_0x5066e7[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x5583ae[_0x7d26('0x35')]);_0x5066e7[_0x7d26('0x37')]=_[_0x7d26('0x38')](_0x5066e7[_0x7d26('0x33')],_0x5066e7[_0x7d26('0x35')]);_0x4c890a['attributes']=_[_0x7d26('0x38')](_0x5066e7[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x5583ae[_0x7d26('0x35')]['fields']));_0x4c890a[_0x7d26('0x3b')]=_0x4c890a[_0x7d26('0x3b')]['length']?_0x4c890a[_0x7d26('0x3b')]:_0x5066e7[_0x7d26('0x33')];if(_0x5583ae[_0x7d26('0x35')][_0x7d26('0x45')]){_0x4c890a[_0x7d26('0x46')]=[{'all':!![]}];}_0x4c890a=_['merge']({},_0x4c890a,_0x5583ae['options']);return db[_0x7d26('0x2f')][_0x7d26('0x4b')](_0x4c890a)[_0x7d26('0x28')](handleEntityNotFound(_0x215dd6,null))[_0x7d26('0x28')](respondWithResult(_0x215dd6,null))[_0x7d26('0x48')](handleError(_0x215dd6,null));};exports[_0x7d26('0x4c')]=function(_0x24f098,_0x13d367){return db['CmList'][_0x7d26('0x4c')](_0x24f098['body'],{})[_0x7d26('0x28')](function(_0x41b53e){var _0x3908ba=_0x24f098[_0x7d26('0x4d')][_0x7d26('0x4e')]({'plain':!![]});if(!_0x3908ba)throw new Error(_0x7d26('0x4f'));if(_0x3908ba['role']===_0x7d26('0x4d')){var _0xc48ac9=_0x41b53e[_0x7d26('0x4e')]({'plain':!![]});var _0x406251=_0x7d26('0x50');return db['UserProfileSection'][_0x7d26('0x4b')]({'where':{'name':_0x406251,'userProfileId':_0x3908ba[_0x7d26('0x51')]},'raw':!![]})[_0x7d26('0x28')](function(_0x140763){if(_0x140763&&_0x140763[_0x7d26('0x52')]===0x0){return db[_0x7d26('0x29')]['create']({'name':_0xc48ac9[_0x7d26('0x2c')],'resourceId':_0xc48ac9['id'],'type':_0x140763['name'],'sectionId':_0x140763['id']},{})[_0x7d26('0x28')](function(){return _0x41b53e;});}else{return _0x41b53e;}})[_0x7d26('0x48')](function(_0x352ad6){logger[_0x7d26('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x352ad6);throw _0x352ad6;});}return _0x41b53e;})[_0x7d26('0x28')](respondWithResult(_0x13d367,0xc9))[_0x7d26('0x48')](handleError(_0x13d367,null));};exports[_0x7d26('0x26')]=function(_0x2e9c8a,_0x11c43e){if(_0x2e9c8a[_0x7d26('0x53')]['id']){delete _0x2e9c8a[_0x7d26('0x53')]['id'];}return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x2e9c8a['params']['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x11c43e,null))[_0x7d26('0x28')](saveUpdates(_0x2e9c8a[_0x7d26('0x53')],null))['then'](respondWithResult(_0x11c43e,null))[_0x7d26('0x48')](handleError(_0x11c43e,null));};exports[_0x7d26('0x27')]=function(_0x37ea0a,_0x668675){return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x37ea0a[_0x7d26('0x4a')]['id']}})['then'](handleEntityNotFound(_0x668675,null))['then'](removeEntity(_0x668675,null))['catch'](handleError(_0x668675,null));};exports[_0x7d26('0x54')]=function(_0x1b6230,_0x39fe58){return db[_0x7d26('0x2f')][_0x7d26('0x54')]()[_0x7d26('0x28')](respondWithResult(_0x39fe58,null))['catch'](handleError(_0x39fe58,null));};exports[_0x7d26('0x55')]=function(_0x38433c,_0xaced3c,_0x54fd2b){if(_0x38433c['body']['id']){delete _0x38433c[_0x7d26('0x53')]['id'];}return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x38433c[_0x7d26('0x4a')]['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0xaced3c,null))['then'](function(_0x5dd8da){if(_0x5dd8da){_0x38433c[_0x7d26('0x53')]['ListId']=_0x5dd8da['id'];return db[_0x7d26('0x56')][_0x7d26('0x4c')](_0x38433c[_0x7d26('0x53')]);}})['then'](respondWithResult(_0xaced3c,null))[_0x7d26('0x48')](handleError(_0xaced3c,null));};exports[_0x7d26('0x57')]=function(_0x424d43,_0x43fae6,_0x4b9b97){var _0x2c889b={'raw':![],'where':{}};var _0x3bf852={};var _0x4aef67={'count':0x0,'rows':[]};return db['CmList'][_0x7d26('0x58')]({'where':{'id':_0x424d43[_0x7d26('0x4a')]['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x43fae6,null))[_0x7d26('0x28')](function(_0x57af97){if(_0x57af97){_0x3bf852[_0x7d26('0x33')]=_[_0x7d26('0x36')](db[_0x7d26('0x56')][_0x7d26('0x30')]);_0x3bf852[_0x7d26('0x35')]=_['keys'](_0x424d43[_0x7d26('0x35')]);_0x3bf852['filters']=_[_0x7d26('0x38')](_0x3bf852[_0x7d26('0x33')],_0x3bf852['query']);_0x2c889b[_0x7d26('0x3b')]=_['intersection'](_0x3bf852[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x424d43[_0x7d26('0x35')][_0x7d26('0x39')]));_0x2c889b[_0x7d26('0x3b')]=_0x2c889b['attributes']['length']?_0x2c889b[_0x7d26('0x3b')]:_0x3bf852['model'];if(!_0x424d43[_0x7d26('0x35')]['hasOwnProperty'](_0x7d26('0x3d'))){_0x2c889b['limit']=qs[_0x7d26('0x21')](_0x424d43['query'][_0x7d26('0x21')]);_0x2c889b[_0x7d26('0x20')]=qs['offset'](_0x424d43[_0x7d26('0x35')][_0x7d26('0x20')]);}_0x2c889b[_0x7d26('0x59')]=qs[_0x7d26('0x3e')](_0x424d43[_0x7d26('0x35')]['sort']);_0x2c889b[_0x7d26('0x42')]=qs[_0x7d26('0x37')](_['pick'](_0x424d43[_0x7d26('0x35')],_0x3bf852[_0x7d26('0x37')]));_0x2c889b['where'][_0x7d26('0x5a')]=_0x57af97['id'];if(_0x424d43[_0x7d26('0x35')]['filter']){_0x2c889b[_0x7d26('0x42')]=_[_0x7d26('0x41')](_0x2c889b[_0x7d26('0x42')],{'$or':_[_0x7d26('0x34')](_0x2c889b['attributes'],function(_0xd5fa03){var _0x1ca61f={};_0x1ca61f[_0xd5fa03]={'$like':'%'+_0x424d43[_0x7d26('0x35')][_0x7d26('0x40')]+'%'};return _0x1ca61f;})});}_0x2c889b=_['merge']({},_0x2c889b,_0x424d43[_0x7d26('0x44')]);return db['Disposition'][_0x7d26('0x1f')]({'where':_0x2c889b['where']})[_0x7d26('0x28')](function(_0x52a092){_0x4aef67[_0x7d26('0x1f')]=_0x52a092;if(_0x424d43[_0x7d26('0x35')][_0x7d26('0x45')]){_0x2c889b[_0x7d26('0x46')]=[{'all':!![]}];}return db[_0x7d26('0x56')][_0x7d26('0x47')](_0x2c889b);})[_0x7d26('0x28')](function(_0x3fb157){_0x4aef67[_0x7d26('0x5b')]=_0x3fb157;return _0x4aef67;});}})[_0x7d26('0x28')](respondWithFilteredResult(_0x43fae6,_0x2c889b))['catch'](handleError(_0x43fae6,null));};exports[_0x7d26('0x5c')]=function(_0x9d602c,_0x2a83ff,_0xcc8572){return db[_0x7d26('0x2f')]['find']({'where':{'id':_0x9d602c[_0x7d26('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2a83ff,null))[_0x7d26('0x28')](function(_0x26ccb7){if(_0x26ccb7){return _0x26ccb7[_0x7d26('0x5c')](_0x9d602c[_0x7d26('0x35')][_0x7d26('0x5d')]);}})[_0x7d26('0x28')](respondWithStatusCode(_0x2a83ff,null))[_0x7d26('0x48')](handleError(_0x2a83ff,null));};exports[_0x7d26('0x5e')]=function(_0x262f6b,_0x59678d,_0x412f61){return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x262f6b[_0x7d26('0x4a')]['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x59678d,null))[_0x7d26('0x28')](function(_0x39ecb7){if(_0x39ecb7){var _0x28a7a0=[];var _0x41310e={'success':[],'errors':[]};return db[_0x7d26('0x5f')]['describe']()[_0x7d26('0x28')](function(_0x2b98b1){if(_0x262f6b[_0x7d26('0x53')][_0x7d26('0x60')]&&_['isArray'](_0x262f6b[_0x7d26('0x53')][_0x7d26('0x60')])){if(_0x262f6b[_0x7d26('0x53')][_0x7d26('0x60')]['length']){_0x262f6b['body'][_0x7d26('0x60')]=_0x262f6b[_0x7d26('0x53')]['tags'][_0x7d26('0x61')](';')+';';}else{_0x262f6b[_0x7d26('0x53')]['tags']=null;}}else{_0x262f6b['body'][_0x7d26('0x60')]=null;}if(_0x262f6b[_0x7d26('0x53')]&&_[_0x7d26('0x62')](_0x262f6b[_0x7d26('0x53')])){for(var _0x5ee3bd=0x0;_0x5ee3bd<_0x262f6b[_0x7d26('0x53')][_0x7d26('0x3a')];_0x5ee3bd+=0x1){_0x262f6b[_0x7d26('0x53')][_0x5ee3bd]['ListId']=_0x262f6b[_0x7d26('0x4a')]['id'];_0x28a7a0[_0x7d26('0x63')](_0x262f6b[_0x7d26('0x53')][_0x5ee3bd]);}return BPromise[_0x7d26('0x64')](_0x28a7a0,function(_0xdd085d){return db[_0x7d26('0x5f')][_0x7d26('0x4c')](_[_0x7d26('0x65')](_0xdd085d,[_0x7d26('0x5d'),'id'])||{},{'fields':_['keys'](_0x2b98b1),'raw':!![]})[_0x7d26('0x28')](function(_0x445dd1){_0x41310e[_0x7d26('0x66')][_0x7d26('0x63')](_0x445dd1[_0x7d26('0x67')]);})['catch'](function(_0x4bd771){_0x41310e[_0x7d26('0x68')][_0x7d26('0x63')]({'data':_0xdd085d,'error':_0x4bd771[_0x7d26('0x69')]});});})[_0x7d26('0x28')](function(_0x404c3b){return _0x41310e;})[_0x7d26('0x48')](function(_0x525ef2){return _0x525ef2;});}else{_0x59678d[_0x7d26('0x1c')](0x190)[_0x7d26('0x1e')]({'message':_0x7d26('0x6a')});}});}})[_0x7d26('0x28')](respondWithResult(_0x59678d,null))[_0x7d26('0x48')](handleError(_0x59678d,null));};exports['getContacts']=function(_0x1e3fb,_0x4775d8,_0xfb1ea0){var _0x33dfd2;return db[_0x7d26('0x2f')]['find']({'where':{'id':_0x1e3fb[_0x7d26('0x4a')]['id']},'include':[{'model':db[_0x7d26('0x6b')],'as':_0x7d26('0x6c')}]})[_0x7d26('0x28')](handleEntityNotFound(_0x4775d8,null))[_0x7d26('0x28')](function(_0x437bdb){if(_0x437bdb){_0x33dfd2=_0x437bdb;return db[_0x7d26('0x5f')]['rawAttributes'];}})['then'](function(_0x2553ca){if(_0x2553ca){var _0x48702f={};var _0x45a8a8={};_0x45a8a8[_0x7d26('0x33')]=_[_0x7d26('0x6d')](_['keys'](_0x2553ca),_[_0x7d26('0x34')](_0x33dfd2[_0x7d26('0x6c')],function(_0x41ba9e){return util[_0x7d26('0x6e')](_0x7d26('0x6f'),_0x41ba9e['id']);}));_0x45a8a8[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x1e3fb[_0x7d26('0x35')]);_0x45a8a8[_0x7d26('0x37')]=_[_0x7d26('0x38')](_0x45a8a8[_0x7d26('0x33')],_0x45a8a8['query']);_0x48702f['attributes']=_['intersection'](_0x45a8a8[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x1e3fb[_0x7d26('0x35')][_0x7d26('0x39')]));_0x48702f[_0x7d26('0x3b')]=_0x48702f[_0x7d26('0x3b')][_0x7d26('0x3a')]?_0x48702f[_0x7d26('0x3b')]:_0x45a8a8['model'];if(!_0x1e3fb['query']['hasOwnProperty'](_0x7d26('0x3d'))){_0x48702f[_0x7d26('0x21')]=qs[_0x7d26('0x21')](_0x1e3fb[_0x7d26('0x35')][_0x7d26('0x21')]);_0x48702f[_0x7d26('0x20')]=qs[_0x7d26('0x20')](_0x1e3fb[_0x7d26('0x35')]['offset']);}_0x48702f[_0x7d26('0x59')]=qs[_0x7d26('0x3e')](_0x1e3fb[_0x7d26('0x35')][_0x7d26('0x3e')]);_0x48702f['where']=qs[_0x7d26('0x37')](_[_0x7d26('0x3f')](_0x1e3fb[_0x7d26('0x35')],_0x45a8a8['filters']));_0x48702f[_0x7d26('0x70')]=!![];if(_0x1e3fb['query'][_0x7d26('0x40')]){_0x48702f['where']=_[_0x7d26('0x41')](_0x48702f[_0x7d26('0x42')],{'$or':_[_0x7d26('0x34')](_0x48702f[_0x7d26('0x3b')],function(_0x3481ff){var _0x46581f={};_0x46581f[_0x3481ff]={'$like':'%'+_0x1e3fb[_0x7d26('0x35')]['filter']+'%'};return _0x46581f;})});}_0x48702f=_[_0x7d26('0x41')]({},_0x48702f,_0x1e3fb[_0x7d26('0x44')]);return _0x33dfd2[_0x7d26('0x71')](_0x48702f);}})[_0x7d26('0x28')](respondWithResult(_0x4775d8,null))['catch'](handleError(_0x4775d8,null));};exports[_0x7d26('0x72')]=function(_0x57dafe,_0x1cbf04,_0x36b4f3){var _0x4a72a2;return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x57dafe[_0x7d26('0x4a')]['id']},'include':[{'model':db[_0x7d26('0x6b')],'as':_0x7d26('0x6c')}]})[_0x7d26('0x28')](handleEntityNotFound(_0x1cbf04,null))[_0x7d26('0x28')](function(_0x211039){if(_0x211039){_0x4a72a2=_0x211039;return db[_0x7d26('0x5f')]['rawAttributes'];}})[_0x7d26('0x28')](function(_0x187c54){if(_0x187c54){var _0x23780c={};var _0x4ab950={};_0x4ab950[_0x7d26('0x33')]=_[_0x7d26('0x6d')](_['keys'](_0x187c54),_[_0x7d26('0x34')](_0x4a72a2['CustomFields'],function(_0x5a4c73){return util[_0x7d26('0x6e')](_0x7d26('0x6f'),_0x5a4c73['id']);}));_0x4ab950[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x57dafe['query']);_0x4ab950[_0x7d26('0x37')]=_[_0x7d26('0x38')](_0x4ab950[_0x7d26('0x33')],_0x4ab950[_0x7d26('0x35')]);_0x23780c[_0x7d26('0x3b')]=_[_0x7d26('0x38')](_0x4ab950['model'],qs[_0x7d26('0x39')](_0x57dafe[_0x7d26('0x35')][_0x7d26('0x39')]));_0x23780c['attributes']=_0x23780c[_0x7d26('0x3b')][_0x7d26('0x3a')]?_0x23780c['attributes']:_0x4ab950[_0x7d26('0x33')];if(!_0x57dafe[_0x7d26('0x35')][_0x7d26('0x3c')](_0x7d26('0x3d'))){_0x23780c[_0x7d26('0x21')]=qs[_0x7d26('0x21')](_0x57dafe['query'][_0x7d26('0x21')]);_0x23780c[_0x7d26('0x20')]=qs[_0x7d26('0x20')](_0x57dafe['query'][_0x7d26('0x20')]);}_0x23780c[_0x7d26('0x59')]=qs[_0x7d26('0x3e')](_0x57dafe[_0x7d26('0x35')]['sort']);_0x23780c['where']=qs[_0x7d26('0x37')](_[_0x7d26('0x3f')](_0x57dafe[_0x7d26('0x35')],_0x4ab950['filters']));_0x23780c[_0x7d26('0x70')]=!![];if(_0x57dafe[_0x7d26('0x35')][_0x7d26('0x40')]){_0x23780c[_0x7d26('0x42')]=_[_0x7d26('0x41')](_0x23780c[_0x7d26('0x42')],{'$or':_['map'](_0x23780c[_0x7d26('0x3b')],function(_0x276289){var _0x8a44f0={};_0x8a44f0[_0x276289]={'$like':'%'+_0x57dafe['query'][_0x7d26('0x40')]+'%'};return _0x8a44f0;})});}_0x23780c=_[_0x7d26('0x41')]({},_0x23780c,_0x57dafe['options']);return _0x4a72a2[_0x7d26('0x71')](_0x23780c);}})[_0x7d26('0x28')](function(_0x50954f){if(!_[_0x7d26('0x73')](_0x50954f)){var _0x56539b=toCsv(_0x50954f);var _0xb6abf2=Date[_0x7d26('0x74')]();fs[_0x7d26('0x75')](util[_0x7d26('0x6e')](_0x7d26('0x76'),_0x4a72a2['id'],_0xb6abf2),_0x56539b);_0x1cbf04[_0x7d26('0x77')](_0x7d26('0x78'),_0x7d26('0x79')+util['format'](_0x7d26('0x7a'),_0x4a72a2['id'],_0xb6abf2));_0x1cbf04[_0x7d26('0x77')]('Content-type',_0x7d26('0x7b'));return _0x1cbf04[_0x7d26('0x7c')](util[_0x7d26('0x6e')]('/tmp/list_%d_%s.csv',_0x4a72a2['id'],_0xb6abf2));}else{return _0x1cbf04[_0x7d26('0x1b')](0xcc);}})['catch'](handleError(_0x1cbf04,null));};exports[_0x7d26('0x7d')]=function(_0x28d710,_0x410319,_0x59ed90){var _0x291f21;delete _0x28d710[_0x7d26('0x53')]['id'];return db[_0x7d26('0x2f')][_0x7d26('0x58')]({'where':{'id':_0x28d710['params']['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x410319,null))['then'](function(_0xc5fbb0){if(_0xc5fbb0){return db['sequelize'][_0x7d26('0x7e')](function(_0x4f580e){return db[_0x7d26('0x6b')]['create'](_0x28d710[_0x7d26('0x53')],{'transaction':_0x4f580e})[_0x7d26('0x28')](function(_0x1a26e5){_0x291f21=_0x1a26e5;return _0xc5fbb0[_0x7d26('0x7f')](_0x1a26e5,{'transaction':_0x4f580e});})[_0x7d26('0x28')](function(){var _0x4bb4db={'type':db[_0x7d26('0x80')][_0x7d26('0x81')],'transaction':_0x4f580e};switch(_0x28d710['body'][_0x7d26('0x31')]){case _0x7d26('0x82'):_0x4bb4db[_0x7d26('0x31')]=db[_0x7d26('0x80')]['TEXT'];break;case _0x7d26('0x83'):_0x4bb4db[_0x7d26('0x31')]=db[_0x7d26('0x80')]['INTEGER'];break;case _0x7d26('0x84'):_0x4bb4db[_0x7d26('0x31')]=db[_0x7d26('0x80')][_0x7d26('0x85')];_0x4bb4db[_0x7d26('0x86')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x7d26('0x87'),util[_0x7d26('0x6e')]('cf_%s',_0x291f21['id']),_0x4bb4db);})[_0x7d26('0x28')](function(){return _0x291f21;});});}})[_0x7d26('0x28')](respondWithResult(_0x410319,null))[_0x7d26('0x48')](handleError(_0x410319,null));};exports['getCustomFields']=function(_0x5bae60,_0x334b26,_0x3fd865){var _0x1e2580={};var _0x8f2c16={};var _0x4703c5;var _0x2d2c5a;return db[_0x7d26('0x2f')]['findOne']({'where':{'id':_0x5bae60[_0x7d26('0x4a')]['id']}})['then'](handleEntityNotFound(_0x334b26,null))[_0x7d26('0x28')](function(_0x57e51a){if(_0x57e51a){_0x4703c5=_0x57e51a;_0x8f2c16[_0x7d26('0x33')]=_[_0x7d26('0x36')](db[_0x7d26('0x6b')][_0x7d26('0x30')]);_0x8f2c16[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x5bae60['query']);_0x8f2c16[_0x7d26('0x37')]=_['intersection'](_0x8f2c16[_0x7d26('0x33')],_0x8f2c16[_0x7d26('0x35')]);_0x1e2580[_0x7d26('0x3b')]=_[_0x7d26('0x38')](_0x8f2c16[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x5bae60['query'][_0x7d26('0x39')]));_0x1e2580[_0x7d26('0x3b')]=_0x1e2580['attributes']['length']?_0x1e2580['attributes']:_0x8f2c16['model'];_0x1e2580[_0x7d26('0x59')]=qs['sort'](_0x5bae60['query'][_0x7d26('0x3e')]);_0x1e2580['where']=qs[_0x7d26('0x37')](_[_0x7d26('0x3f')](_0x5bae60[_0x7d26('0x35')],_0x8f2c16[_0x7d26('0x37')]));_0x1e2580[_0x7d26('0x42')]=_[_0x7d26('0x41')](_0x1e2580['where'],{'$or':[{'ListId':_0x57e51a['id']},{'ListId':null}]});if(_0x5bae60[_0x7d26('0x35')][_0x7d26('0x40')]){_0x1e2580[_0x7d26('0x42')]=_[_0x7d26('0x41')](_0x1e2580[_0x7d26('0x42')],{'$or':_[_0x7d26('0x34')](_0x1e2580['attributes'],function(_0x46b19c){var _0x5a43a2={};_0x5a43a2[_0x46b19c]={'$like':'%'+_0x5bae60[_0x7d26('0x35')]['filter']+'%'};return _0x5a43a2;})});}_0x1e2580=_[_0x7d26('0x41')]({},_0x1e2580,_0x5bae60[_0x7d26('0x44')]);return db[_0x7d26('0x6b')][_0x7d26('0x88')](_0x1e2580);}})[_0x7d26('0x28')](respondWithResult(_0x334b26,null))[_0x7d26('0x48')](handleError(_0x334b26,null));};exports[_0x7d26('0x89')]=function(_0x24ddea,_0x2955b5,_0x429da0){return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x24ddea[_0x7d26('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2955b5,null))['then'](function(_0xa1d6e8){if(_0xa1d6e8){return _0xa1d6e8[_0x7d26('0x89')](_0x24ddea[_0x7d26('0x53')][_0x7d26('0x5d')],_[_0x7d26('0x65')](_0x24ddea[_0x7d26('0x53')],[_0x7d26('0x5d'),'id'])||{})['spread'](function(_0x2e67a1){for(var _0x27e68b=0x0;_0x27e68b<_0x24ddea[_0x7d26('0x53')][_0x7d26('0x5d')][_0x7d26('0x3a')];_0x27e68b+=0x1){socket[_0x7d26('0x8a')](_0x7d26('0x8b'),{'UserId':_0x24ddea[_0x7d26('0x53')][_0x7d26('0x5d')][_0x27e68b],'CmListId':_0x24ddea[_0x7d26('0x4a')]['id']});}return _0x2e67a1;});}})[_0x7d26('0x28')](respondWithResult(_0x2955b5,null))[_0x7d26('0x48')](handleError(_0x2955b5,null));};exports[_0x7d26('0x8c')]=function(_0x618abf,_0x390cae,_0x465f7c){return db[_0x7d26('0x2f')][_0x7d26('0x4b')]({'where':{'id':_0x618abf[_0x7d26('0x4a')]['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x390cae,null))[_0x7d26('0x28')](function(_0x3ec621){if(_0x3ec621){return _0x3ec621[_0x7d26('0x8c')](_0x618abf['query'][_0x7d26('0x5d')])[_0x7d26('0x28')](function(){if(_[_0x7d26('0x62')](_0x618abf['query'][_0x7d26('0x5d')])){for(var _0x79797e=0x0;_0x79797e<_0x618abf[_0x7d26('0x35')][_0x7d26('0x5d')][_0x7d26('0x3a')];_0x79797e+=0x1){socket[_0x7d26('0x8a')](_0x7d26('0x8d'),{'UserId':Number(_0x618abf[_0x7d26('0x35')][_0x7d26('0x5d')][_0x79797e]),'CmListId':Number(_0x618abf[_0x7d26('0x4a')]['id'])});}}else{socket[_0x7d26('0x8a')](_0x7d26('0x8d'),{'UserId':Number(_0x618abf[_0x7d26('0x35')][_0x7d26('0x5d')]),'CmListId':Number(_0x618abf[_0x7d26('0x4a')]['id'])});}});}})[_0x7d26('0x28')](respondWithStatusCode(_0x390cae,null))[_0x7d26('0x48')](handleError(_0x390cae,null));};exports[_0x7d26('0x8e')]=function(_0x4601fa,_0x1875c3,_0x1387ff){var _0x483bf5={};var _0x414009={};var _0x2d0970;var _0x155467;return db[_0x7d26('0x2f')][_0x7d26('0x58')]({'where':{'id':_0x4601fa[_0x7d26('0x4a')]['id']}})[_0x7d26('0x28')](handleEntityNotFound(_0x1875c3,null))[_0x7d26('0x28')](function(_0x4fa8a9){if(_0x4fa8a9){_0x2d0970=_0x4fa8a9;_0x414009[_0x7d26('0x33')]=_[_0x7d26('0x36')](db[_0x7d26('0x8f')][_0x7d26('0x30')]);_0x414009[_0x7d26('0x35')]=_[_0x7d26('0x36')](_0x4601fa[_0x7d26('0x35')]);_0x414009[_0x7d26('0x37')]=_[_0x7d26('0x38')](_0x414009[_0x7d26('0x33')],_0x414009[_0x7d26('0x35')]);_0x483bf5['attributes']=_['intersection'](_0x414009[_0x7d26('0x33')],qs[_0x7d26('0x39')](_0x4601fa[_0x7d26('0x35')][_0x7d26('0x39')]));_0x483bf5['attributes']=_0x483bf5['attributes']['length']?_0x483bf5[_0x7d26('0x3b')]:_0x414009[_0x7d26('0x33')];_0x483bf5[_0x7d26('0x59')]=qs[_0x7d26('0x3e')](_0x4601fa[_0x7d26('0x35')]['sort']);_0x483bf5[_0x7d26('0x42')]=qs[_0x7d26('0x37')](_[_0x7d26('0x3f')](_0x4601fa[_0x7d26('0x35')],_0x414009['filters']));if(_0x4601fa[_0x7d26('0x35')][_0x7d26('0x40')]){_0x483bf5['where']=_['merge'](_0x483bf5[_0x7d26('0x42')],{'$or':_[_0x7d26('0x34')](_0x483bf5[_0x7d26('0x3b')],function(_0x3e05d0){var _0x12fede={};_0x12fede[_0x3e05d0]={'$like':'%'+_0x4601fa[_0x7d26('0x35')]['filter']+'%'};return _0x12fede;})});}_0x483bf5=_[_0x7d26('0x41')]({},_0x483bf5,_0x4601fa[_0x7d26('0x44')]);return _0x2d0970[_0x7d26('0x8e')](_0x483bf5);}})[_0x7d26('0x28')](function(_0xe5050b){if(_0xe5050b){_0x155467=_0xe5050b[_0x7d26('0x3a')];if(!_0x4601fa[_0x7d26('0x35')][_0x7d26('0x3c')](_0x7d26('0x3d'))){_0x483bf5[_0x7d26('0x21')]=qs[_0x7d26('0x21')](_0x4601fa[_0x7d26('0x35')][_0x7d26('0x21')]);_0x483bf5['offset']=qs[_0x7d26('0x20')](_0x4601fa[_0x7d26('0x35')][_0x7d26('0x20')]);}return _0x2d0970[_0x7d26('0x8e')](_0x483bf5);}})[_0x7d26('0x28')](function(_0x11848d){if(_0x11848d){return _0x11848d?{'count':_0x155467,'rows':_0x11848d}:null;}})[_0x7d26('0x28')](respondWithResult(_0x1875c3,null))[_0x7d26('0x48')](handleError(_0x1875c3,null));}; \ No newline at end of file +var _0x3c56=['redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','error','stack','name','send','map','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','CmList','findAll','rows','show','keys','rawAttributes','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','findOne','ListId','Disposition','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','raw','CmCustomField','format','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x47343f,_0x5452bc){var _0x4b2162=function(_0xa05d1c){while(--_0xa05d1c){_0x47343f['push'](_0x47343f['shift']());}};_0x4b2162(++_0x5452bc);}(_0x3c56,0x102));var _0x63c5=function(_0x4ac350,_0x35498b){_0x4ac350=_0x4ac350-0x0;var _0x384923=_0x3c56[_0x4ac350];return _0x384923;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x63c5('0x0'));var jsonpatch=require(_0x63c5('0x1'));var rp=require(_0x63c5('0x2'));var moment=require(_0x63c5('0x3'));var BPromise=require(_0x63c5('0x4'));var Mustache=require(_0x63c5('0x5'));var util=require(_0x63c5('0x6'));var path=require('path');var sox=require(_0x63c5('0x7'));var csv=require(_0x63c5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x63c5('0x9'));var crypto=require(_0x63c5('0xa'));var jsforce=require(_0x63c5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x63c5('0x8'));var querystring=require('querystring');var Papa=require(_0x63c5('0xc'));var Redis=require('ioredis');var authService=require(_0x63c5('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63c5('0xe'));var logger=require('../../config/logger')(_0x63c5('0xf'));var utils=require(_0x63c5('0x10'));var config=require(_0x63c5('0x11'));var db=require('../../mysqldb')['db'];config[_0x63c5('0x12')]=_[_0x63c5('0x13')](config[_0x63c5('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x63c5('0x14'))(new Redis(config[_0x63c5('0x12')]));require(_0x63c5('0x15'))[_0x63c5('0x16')](socket);function respondWithStatusCode(_0x5b5770,_0x35e390){_0x35e390=_0x35e390||0xcc;return function(_0x4a9518){if(_0x4a9518){return _0x5b5770[_0x63c5('0x17')](_0x35e390);}return _0x5b5770[_0x63c5('0x18')](_0x35e390)[_0x63c5('0x19')]();};}function respondWithResult(_0x4d2258,_0x364208){_0x364208=_0x364208||0xc8;return function(_0x5aba7e){if(_0x5aba7e){return _0x4d2258[_0x63c5('0x18')](_0x364208)['json'](_0x5aba7e);}};}function respondWithFilteredResult(_0x461017,_0x54fedd){return function(_0x3cfdb8){if(_0x3cfdb8){var _0x22f2f1=_0x3cfdb8[_0x63c5('0x1a')],_0x4b9252=_0x54fedd[_0x63c5('0x1b')],_0x52ab26=_0x54fedd['offset']+_0x54fedd[_0x63c5('0x1c')],_0x1b4917;if(_0x52ab26>=_0x22f2f1){_0x52ab26=_0x22f2f1;_0x1b4917=0xc8;}else{_0x1b4917=0xce;}_0x461017['status'](_0x1b4917);return _0x461017['set'](_0x63c5('0x1d'),_0x4b9252+'-'+_0x52ab26+'/'+_0x22f2f1)[_0x63c5('0x1e')](_0x3cfdb8);}return null;};}function patchUpdates(_0x3a549f){return function(_0x29d59f){try{jsonpatch[_0x63c5('0x1f')](_0x29d59f,_0x3a549f,!![]);}catch(_0x285cef){return BPromise[_0x63c5('0x20')](_0x285cef);}return _0x29d59f[_0x63c5('0x21')]();};}function saveUpdates(_0x5307b8,_0x5955c3){return function(_0x4ad34f){if(_0x4ad34f){return _0x4ad34f[_0x63c5('0x22')](_0x5307b8)[_0x63c5('0x23')](function(_0x4761eb){return _0x4761eb;});}return null;};}function removeEntity(_0x1c0eee,_0x57bd26){return function(_0x15cb7e){if(_0x15cb7e){return _0x15cb7e[_0x63c5('0x24')]()[_0x63c5('0x23')](function(){var _0x94975d=_0x15cb7e[_0x63c5('0x25')]({'plain':!![]});var _0x2cd94b=_0x63c5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2cd94b,'resourceId':_0x94975d['id']}})['then'](function(){return _0x15cb7e;});})[_0x63c5('0x23')](function(){_0x1c0eee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f350,_0x403a9d){return function(_0x325e4f){if(!_0x325e4f){_0x32f350[_0x63c5('0x17')](0x194);}return _0x325e4f;};}function handleError(_0x189b79,_0x4f7a8b){_0x4f7a8b=_0x4f7a8b||0x1f4;return function(_0x4b848d){logger[_0x63c5('0x27')](_0x4b848d[_0x63c5('0x28')]);if(_0x4b848d[_0x63c5('0x29')]){delete _0x4b848d['name'];}_0x189b79[_0x63c5('0x18')](_0x4f7a8b)[_0x63c5('0x2a')](_0x4b848d);};}exports['index']=function(_0x5a19dc,_0x1012d1){var _0x11633b={},_0xe64dab={},_0x2fbc94={'count':0x0,'rows':[]};var _0x4a4e74=_[_0x63c5('0x2b')](db['CmList']['rawAttributes'],function(_0x5c03fc){return{'name':_0x5c03fc['fieldName'],'type':_0x5c03fc[_0x63c5('0x2c')][_0x63c5('0x2d')]};});_0xe64dab[_0x63c5('0x2e')]=_['map'](_0x4a4e74,'name');_0xe64dab[_0x63c5('0x2f')]=_['keys'](_0x5a19dc[_0x63c5('0x2f')]);_0xe64dab[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0xe64dab[_0x63c5('0x2e')],_0xe64dab['query']);_0x11633b[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0xe64dab[_0x63c5('0x2e')],qs[_0x63c5('0x33')](_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x33')]));_0x11633b[_0x63c5('0x32')]=_0x11633b[_0x63c5('0x32')]['length']?_0x11633b[_0x63c5('0x32')]:_0xe64dab[_0x63c5('0x2e')];if(!_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x34')](_0x63c5('0x35'))){_0x11633b['limit']=qs[_0x63c5('0x1c')](_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x1c')]);_0x11633b[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x5a19dc[_0x63c5('0x2f')]['offset']);}_0x11633b[_0x63c5('0x36')]=qs[_0x63c5('0x37')](_0x5a19dc[_0x63c5('0x2f')]['sort']);_0x11633b[_0x63c5('0x38')]=qs[_0x63c5('0x30')](_[_0x63c5('0x39')](_0x5a19dc[_0x63c5('0x2f')],_0xe64dab[_0x63c5('0x30')]),_0x4a4e74);if(_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x3a')]){_0x11633b[_0x63c5('0x38')]=_[_0x63c5('0x3b')](_0x11633b[_0x63c5('0x38')],{'$or':_[_0x63c5('0x2b')](_0x4a4e74,function(_0xe3fa26){if(_0xe3fa26[_0x63c5('0x2c')]!==_0x63c5('0x3c')){var _0x5b77cd={};_0x5b77cd[_0xe3fa26['name']]={'$like':'%'+_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x3a')]+'%'};return _0x5b77cd;}})});}_0x11633b=_[_0x63c5('0x3b')]({},_0x11633b,_0x5a19dc[_0x63c5('0x3d')]);var _0x3e90d4={'where':_0x11633b[_0x63c5('0x38')]};return db['CmList'][_0x63c5('0x1a')](_0x3e90d4)[_0x63c5('0x23')](function(_0x27d651){_0x2fbc94[_0x63c5('0x1a')]=_0x27d651;if(_0x5a19dc[_0x63c5('0x2f')][_0x63c5('0x3e')]){_0x11633b[_0x63c5('0x3f')]=[{'all':!![]}];}return db[_0x63c5('0x40')][_0x63c5('0x41')](_0x11633b);})[_0x63c5('0x23')](function(_0x4e2999){_0x2fbc94[_0x63c5('0x42')]=_0x4e2999;return _0x2fbc94;})[_0x63c5('0x23')](respondWithFilteredResult(_0x1012d1,_0x11633b))['catch'](handleError(_0x1012d1,null));};exports[_0x63c5('0x43')]=function(_0x50aeaa,_0xf9cf7d){var _0x556c9a={'raw':![],'where':{'id':_0x50aeaa['params']['id']}},_0x2beb98={};_0x2beb98[_0x63c5('0x2e')]=_[_0x63c5('0x44')](db['CmList'][_0x63c5('0x45')]);_0x2beb98[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x50aeaa['query']);_0x2beb98['filters']=_['intersection'](_0x2beb98[_0x63c5('0x2e')],_0x2beb98[_0x63c5('0x2f')]);_0x556c9a[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x2beb98[_0x63c5('0x2e')],qs['fields'](_0x50aeaa[_0x63c5('0x2f')]['fields']));_0x556c9a['attributes']=_0x556c9a['attributes'][_0x63c5('0x46')]?_0x556c9a['attributes']:_0x2beb98[_0x63c5('0x2e')];if(_0x50aeaa[_0x63c5('0x2f')]['includeAll']){_0x556c9a[_0x63c5('0x3f')]=[{'all':!![]}];}_0x556c9a=_[_0x63c5('0x3b')]({},_0x556c9a,_0x50aeaa[_0x63c5('0x3d')]);return db['CmList']['find'](_0x556c9a)[_0x63c5('0x23')](handleEntityNotFound(_0xf9cf7d,null))[_0x63c5('0x23')](respondWithResult(_0xf9cf7d,null))[_0x63c5('0x47')](handleError(_0xf9cf7d,null));};exports[_0x63c5('0x48')]=function(_0x4c09dc,_0x5d3bbe){return db[_0x63c5('0x40')]['create'](_0x4c09dc[_0x63c5('0x49')],{})[_0x63c5('0x23')](function(_0x37a044){var _0x45f48a=_0x4c09dc[_0x63c5('0x4a')][_0x63c5('0x25')]({'plain':!![]});if(!_0x45f48a)throw new Error(_0x63c5('0x4b'));if(_0x45f48a[_0x63c5('0x4c')]===_0x63c5('0x4a')){var _0x191516=_0x37a044[_0x63c5('0x25')]({'plain':!![]});var _0x5a5331='Lists';return db[_0x63c5('0x4d')][_0x63c5('0x4e')]({'where':{'name':_0x5a5331,'userProfileId':_0x45f48a[_0x63c5('0x4f')]},'raw':!![]})[_0x63c5('0x23')](function(_0x1b6f2d){if(_0x1b6f2d&&_0x1b6f2d[_0x63c5('0x50')]===0x0){return db[_0x63c5('0x51')][_0x63c5('0x48')]({'name':_0x191516[_0x63c5('0x29')],'resourceId':_0x191516['id'],'type':_0x1b6f2d['name'],'sectionId':_0x1b6f2d['id']},{})[_0x63c5('0x23')](function(){return _0x37a044;});}else{return _0x37a044;}})[_0x63c5('0x47')](function(_0x8caefd){logger[_0x63c5('0x27')](_0x63c5('0x52'),_0x8caefd);throw _0x8caefd;});}return _0x37a044;})['then'](respondWithResult(_0x5d3bbe,0xc9))['catch'](handleError(_0x5d3bbe,null));};exports[_0x63c5('0x22')]=function(_0x7712f0,_0x28ca34){if(_0x7712f0[_0x63c5('0x49')]['id']){delete _0x7712f0[_0x63c5('0x49')]['id'];}return db[_0x63c5('0x40')][_0x63c5('0x4e')]({'where':{'id':_0x7712f0[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x28ca34,null))['then'](saveUpdates(_0x7712f0[_0x63c5('0x49')],null))['then'](respondWithResult(_0x28ca34,null))[_0x63c5('0x47')](handleError(_0x28ca34,null));};exports[_0x63c5('0x24')]=function(_0x22cf49,_0x594717){return db[_0x63c5('0x40')]['find']({'where':{'id':_0x22cf49[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x594717,null))[_0x63c5('0x23')](removeEntity(_0x594717,null))['catch'](handleError(_0x594717,null));};exports[_0x63c5('0x54')]=function(_0x6f56c1,_0x2a624d){return db['CmList'][_0x63c5('0x54')]()['then'](respondWithResult(_0x2a624d,null))[_0x63c5('0x47')](handleError(_0x2a624d,null));};exports[_0x63c5('0x55')]=function(_0xdaf193,_0xf9c10a,_0x40ae34){if(_0xdaf193[_0x63c5('0x49')]['id']){delete _0xdaf193[_0x63c5('0x49')]['id'];}return db[_0x63c5('0x40')]['find']({'where':{'id':_0xdaf193[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0xf9c10a,null))[_0x63c5('0x23')](function(_0x544d50){if(_0x544d50){_0xdaf193[_0x63c5('0x49')]['ListId']=_0x544d50['id'];return db['Disposition'][_0x63c5('0x48')](_0xdaf193['body']);}})[_0x63c5('0x23')](respondWithResult(_0xf9c10a,null))[_0x63c5('0x47')](handleError(_0xf9c10a,null));};exports['getDispositions']=function(_0x464c5f,_0x17d605,_0x44ef29){var _0x4e0276={'raw':![],'where':{}};var _0x1acba7={};var _0x365008={'count':0x0,'rows':[]};return db['CmList'][_0x63c5('0x56')]({'where':{'id':_0x464c5f['params']['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x17d605,null))[_0x63c5('0x23')](function(_0x1186f2){if(_0x1186f2){_0x1acba7[_0x63c5('0x2e')]=_[_0x63c5('0x44')](db['Disposition'][_0x63c5('0x45')]);_0x1acba7[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x464c5f[_0x63c5('0x2f')]);_0x1acba7[_0x63c5('0x30')]=_['intersection'](_0x1acba7[_0x63c5('0x2e')],_0x1acba7[_0x63c5('0x2f')]);_0x4e0276[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x1acba7[_0x63c5('0x2e')],qs[_0x63c5('0x33')](_0x464c5f[_0x63c5('0x2f')][_0x63c5('0x33')]));_0x4e0276['attributes']=_0x4e0276[_0x63c5('0x32')][_0x63c5('0x46')]?_0x4e0276[_0x63c5('0x32')]:_0x1acba7['model'];if(!_0x464c5f['query'][_0x63c5('0x34')](_0x63c5('0x35'))){_0x4e0276[_0x63c5('0x1c')]=qs['limit'](_0x464c5f[_0x63c5('0x2f')][_0x63c5('0x1c')]);_0x4e0276['offset']=qs[_0x63c5('0x1b')](_0x464c5f['query']['offset']);}_0x4e0276[_0x63c5('0x36')]=qs[_0x63c5('0x37')](_0x464c5f['query']['sort']);_0x4e0276[_0x63c5('0x38')]=qs[_0x63c5('0x30')](_['pick'](_0x464c5f['query'],_0x1acba7[_0x63c5('0x30')]));_0x4e0276[_0x63c5('0x38')][_0x63c5('0x57')]=_0x1186f2['id'];if(_0x464c5f[_0x63c5('0x2f')][_0x63c5('0x3a')]){_0x4e0276['where']=_[_0x63c5('0x3b')](_0x4e0276[_0x63c5('0x38')],{'$or':_['map'](_0x4e0276['attributes'],function(_0x5904f2){var _0x59b5e9={};_0x59b5e9[_0x5904f2]={'$like':'%'+_0x464c5f[_0x63c5('0x2f')][_0x63c5('0x3a')]+'%'};return _0x59b5e9;})});}_0x4e0276=_['merge']({},_0x4e0276,_0x464c5f[_0x63c5('0x3d')]);return db[_0x63c5('0x58')][_0x63c5('0x1a')]({'where':_0x4e0276[_0x63c5('0x38')]})[_0x63c5('0x23')](function(_0x1eb00){_0x365008[_0x63c5('0x1a')]=_0x1eb00;if(_0x464c5f[_0x63c5('0x2f')][_0x63c5('0x3e')]){_0x4e0276['include']=[{'all':!![]}];}return db[_0x63c5('0x58')][_0x63c5('0x41')](_0x4e0276);})[_0x63c5('0x23')](function(_0x2033f9){_0x365008[_0x63c5('0x42')]=_0x2033f9;return _0x365008;});}})[_0x63c5('0x23')](respondWithFilteredResult(_0x17d605,_0x4e0276))[_0x63c5('0x47')](handleError(_0x17d605,null));};exports[_0x63c5('0x59')]=function(_0x3d2bef,_0x344800,_0x17bc13){return db[_0x63c5('0x40')][_0x63c5('0x4e')]({'where':{'id':_0x3d2bef[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x344800,null))[_0x63c5('0x23')](function(_0x41c445){if(_0x41c445){return _0x41c445[_0x63c5('0x59')](_0x3d2bef['query'][_0x63c5('0x5a')]);}})[_0x63c5('0x23')](respondWithStatusCode(_0x344800,null))[_0x63c5('0x47')](handleError(_0x344800,null));};exports['addContacts']=function(_0x383eef,_0x363af8,_0x5c1f0c){return db['CmList'][_0x63c5('0x4e')]({'where':{'id':_0x383eef[_0x63c5('0x53')]['id']}})['then'](handleEntityNotFound(_0x363af8,null))[_0x63c5('0x23')](function(_0x588861){if(_0x588861){var _0x1eac99=[];var _0x29d32e={'success':[],'errors':[]};return db[_0x63c5('0x5b')][_0x63c5('0x54')]()[_0x63c5('0x23')](function(_0x75db5d){if(_0x383eef['body'][_0x63c5('0x5c')]&&_[_0x63c5('0x5d')](_0x383eef[_0x63c5('0x49')][_0x63c5('0x5c')])){if(_0x383eef['body'][_0x63c5('0x5c')][_0x63c5('0x46')]){_0x383eef['body'][_0x63c5('0x5c')]=_0x383eef['body'][_0x63c5('0x5c')][_0x63c5('0x5e')](';')+';';}else{_0x383eef[_0x63c5('0x49')][_0x63c5('0x5c')]=null;}}else{_0x383eef[_0x63c5('0x49')]['tags']=null;}if(_0x383eef[_0x63c5('0x49')]&&_[_0x63c5('0x5d')](_0x383eef[_0x63c5('0x49')])){for(var _0x59eb00=0x0;_0x59eb00<_0x383eef[_0x63c5('0x49')]['length'];_0x59eb00+=0x1){_0x383eef[_0x63c5('0x49')][_0x59eb00]['ListId']=_0x383eef[_0x63c5('0x53')]['id'];_0x1eac99[_0x63c5('0x5f')](_0x383eef[_0x63c5('0x49')][_0x59eb00]);}return BPromise[_0x63c5('0x60')](_0x1eac99,function(_0x2c8eda){return db[_0x63c5('0x5b')][_0x63c5('0x48')](_[_0x63c5('0x61')](_0x2c8eda,[_0x63c5('0x5a'),'id'])||{},{'fields':_['keys'](_0x75db5d),'raw':!![]})[_0x63c5('0x23')](function(_0x219bee){_0x29d32e[_0x63c5('0x62')]['push'](_0x219bee[_0x63c5('0x63')]);})[_0x63c5('0x47')](function(_0x45cc12){_0x29d32e[_0x63c5('0x64')]['push']({'data':_0x2c8eda,'error':_0x45cc12[_0x63c5('0x65')]});});})[_0x63c5('0x23')](function(_0x3becec){return _0x29d32e;})['catch'](function(_0x29792f){return _0x29792f;});}else{_0x363af8[_0x63c5('0x18')](0x190)[_0x63c5('0x1e')]({'message':_0x63c5('0x66')});}});}})[_0x63c5('0x23')](respondWithResult(_0x363af8,null))[_0x63c5('0x47')](handleError(_0x363af8,null));};exports[_0x63c5('0x67')]=function(_0x19f5e6,_0xa5ca1c,_0xc615bf){var _0x21b8c9;return db['CmList'][_0x63c5('0x4e')]({'where':{'id':_0x19f5e6[_0x63c5('0x53')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x63c5('0x68')}]})[_0x63c5('0x23')](handleEntityNotFound(_0xa5ca1c,null))['then'](function(_0x3967ce){if(_0x3967ce){_0x21b8c9=_0x3967ce;return db[_0x63c5('0x5b')][_0x63c5('0x45')];}})[_0x63c5('0x23')](function(_0xd1b5a0){if(_0xd1b5a0){var _0x513fee={};var _0x2300ad={};_0x2300ad[_0x63c5('0x2e')]=_[_0x63c5('0x69')](_['keys'](_0xd1b5a0),_[_0x63c5('0x2b')](_0x21b8c9[_0x63c5('0x68')],function(_0x5a0baa){return util['format'](_0x63c5('0x6a'),_0x5a0baa['id']);}));_0x2300ad[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x19f5e6['query']);_0x2300ad[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0x2300ad[_0x63c5('0x2e')],_0x2300ad[_0x63c5('0x2f')]);_0x513fee[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x2300ad[_0x63c5('0x2e')],qs[_0x63c5('0x33')](_0x19f5e6['query'][_0x63c5('0x33')]));_0x513fee['attributes']=_0x513fee['attributes'][_0x63c5('0x46')]?_0x513fee[_0x63c5('0x32')]:_0x2300ad['model'];if(!_0x19f5e6[_0x63c5('0x2f')][_0x63c5('0x34')](_0x63c5('0x35'))){_0x513fee[_0x63c5('0x1c')]=qs[_0x63c5('0x1c')](_0x19f5e6[_0x63c5('0x2f')][_0x63c5('0x1c')]);_0x513fee[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x19f5e6[_0x63c5('0x2f')][_0x63c5('0x1b')]);}_0x513fee[_0x63c5('0x36')]=qs[_0x63c5('0x37')](_0x19f5e6[_0x63c5('0x2f')][_0x63c5('0x37')]);_0x513fee['where']=qs[_0x63c5('0x30')](_['pick'](_0x19f5e6[_0x63c5('0x2f')],_0x2300ad[_0x63c5('0x30')]));_0x513fee[_0x63c5('0x6b')]=!![];if(_0x19f5e6[_0x63c5('0x2f')][_0x63c5('0x3a')]){_0x513fee[_0x63c5('0x38')]=_[_0x63c5('0x3b')](_0x513fee[_0x63c5('0x38')],{'$or':_[_0x63c5('0x2b')](_0x513fee[_0x63c5('0x32')],function(_0x157d46){var _0x189037={};_0x189037[_0x157d46]={'$like':'%'+_0x19f5e6[_0x63c5('0x2f')]['filter']+'%'};return _0x189037;})});}_0x513fee=_[_0x63c5('0x3b')]({},_0x513fee,_0x19f5e6[_0x63c5('0x3d')]);return _0x21b8c9[_0x63c5('0x67')](_0x513fee);}})[_0x63c5('0x23')](respondWithResult(_0xa5ca1c,null))[_0x63c5('0x47')](handleError(_0xa5ca1c,null));};exports['getContactsCsv']=function(_0x6908b5,_0x311c69,_0x2fa7ef){var _0x3eec12;return db[_0x63c5('0x40')][_0x63c5('0x4e')]({'where':{'id':_0x6908b5['params']['id']},'include':[{'model':db[_0x63c5('0x6c')],'as':'CustomFields'}]})[_0x63c5('0x23')](handleEntityNotFound(_0x311c69,null))[_0x63c5('0x23')](function(_0x48ebfd){if(_0x48ebfd){_0x3eec12=_0x48ebfd;return db[_0x63c5('0x5b')]['rawAttributes'];}})[_0x63c5('0x23')](function(_0x2f372d){if(_0x2f372d){var _0x10be43={};var _0x412a4d={};_0x412a4d['model']=_[_0x63c5('0x69')](_[_0x63c5('0x44')](_0x2f372d),_[_0x63c5('0x2b')](_0x3eec12[_0x63c5('0x68')],function(_0x293979){return util[_0x63c5('0x6d')]('cf_%d',_0x293979['id']);}));_0x412a4d[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x6908b5[_0x63c5('0x2f')]);_0x412a4d[_0x63c5('0x30')]=_['intersection'](_0x412a4d[_0x63c5('0x2e')],_0x412a4d[_0x63c5('0x2f')]);_0x10be43[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x412a4d['model'],qs['fields'](_0x6908b5['query'][_0x63c5('0x33')]));_0x10be43['attributes']=_0x10be43[_0x63c5('0x32')][_0x63c5('0x46')]?_0x10be43[_0x63c5('0x32')]:_0x412a4d[_0x63c5('0x2e')];if(!_0x6908b5[_0x63c5('0x2f')]['hasOwnProperty'](_0x63c5('0x35'))){_0x10be43[_0x63c5('0x1c')]=qs[_0x63c5('0x1c')](_0x6908b5[_0x63c5('0x2f')][_0x63c5('0x1c')]);_0x10be43[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x6908b5[_0x63c5('0x2f')]['offset']);}_0x10be43['order']=qs[_0x63c5('0x37')](_0x6908b5[_0x63c5('0x2f')][_0x63c5('0x37')]);_0x10be43[_0x63c5('0x38')]=qs['filters'](_[_0x63c5('0x39')](_0x6908b5[_0x63c5('0x2f')],_0x412a4d[_0x63c5('0x30')]));_0x10be43[_0x63c5('0x6b')]=!![];if(_0x6908b5[_0x63c5('0x2f')]['filter']){_0x10be43['where']=_[_0x63c5('0x3b')](_0x10be43[_0x63c5('0x38')],{'$or':_['map'](_0x10be43['attributes'],function(_0x1598b4){var _0x3485aa={};_0x3485aa[_0x1598b4]={'$like':'%'+_0x6908b5[_0x63c5('0x2f')][_0x63c5('0x3a')]+'%'};return _0x3485aa;})});}_0x10be43=_['merge']({},_0x10be43,_0x6908b5['options']);return _0x3eec12[_0x63c5('0x67')](_0x10be43);}})['then'](function(_0x19bd5f){if(!_[_0x63c5('0x6e')](_0x19bd5f)){var _0x59dacd=toCsv(_0x19bd5f);var _0x243911=Date['now']();fs['writeFileSync'](util[_0x63c5('0x6d')](_0x63c5('0x6f'),_0x3eec12['id'],_0x243911),_0x59dacd);_0x311c69[_0x63c5('0x70')](_0x63c5('0x71'),_0x63c5('0x72')+util[_0x63c5('0x6d')]('list_%d_%s.csv',_0x3eec12['id'],_0x243911));_0x311c69['setHeader']('Content-type',_0x63c5('0x73'));return _0x311c69['download'](util[_0x63c5('0x6d')](_0x63c5('0x6f'),_0x3eec12['id'],_0x243911));}else{return _0x311c69['sendStatus'](0xcc);}})['catch'](handleError(_0x311c69,null));};exports['addCustomField']=function(_0x29db3d,_0x3b5e74,_0x3f197f){var _0x187b8a;delete _0x29db3d['body']['id'];return db[_0x63c5('0x40')][_0x63c5('0x56')]({'where':{'id':_0x29db3d[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x3b5e74,null))[_0x63c5('0x23')](function(_0x1fe5c6){if(_0x1fe5c6){return db[_0x63c5('0x74')]['transaction'](function(_0xca3572){return db[_0x63c5('0x6c')][_0x63c5('0x48')](_0x29db3d[_0x63c5('0x49')],{'transaction':_0xca3572})[_0x63c5('0x23')](function(_0x148465){_0x187b8a=_0x148465;return _0x1fe5c6[_0x63c5('0x75')](_0x148465,{'transaction':_0xca3572});})[_0x63c5('0x23')](function(){var _0x47b3c5={'type':db[_0x63c5('0x76')][_0x63c5('0x77')],'transaction':_0xca3572};switch(_0x29db3d[_0x63c5('0x49')][_0x63c5('0x2c')]){case _0x63c5('0x78'):_0x47b3c5[_0x63c5('0x2c')]=db[_0x63c5('0x76')][_0x63c5('0x77')];break;case _0x63c5('0x79'):_0x47b3c5[_0x63c5('0x2c')]=db[_0x63c5('0x76')][_0x63c5('0x7a')];break;case _0x63c5('0x7b'):_0x47b3c5[_0x63c5('0x2c')]=db['Sequelize'][_0x63c5('0x7c')];_0x47b3c5[_0x63c5('0x7d')]=![];break;default:}return db[_0x63c5('0x74')][_0x63c5('0x7e')][_0x63c5('0x7f')](_0x63c5('0x80'),util['format']('cf_%s',_0x187b8a['id']),_0x47b3c5);})[_0x63c5('0x23')](function(){return _0x187b8a;});});}})[_0x63c5('0x23')](respondWithResult(_0x3b5e74,null))[_0x63c5('0x47')](handleError(_0x3b5e74,null));};exports['getCustomFields']=function(_0x119e0e,_0x7f5e5b,_0x30b9b7){var _0x17e744={};var _0x5a3193={};var _0xb8c521;var _0x25e228;return db[_0x63c5('0x40')][_0x63c5('0x56')]({'where':{'id':_0x119e0e[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x7f5e5b,null))[_0x63c5('0x23')](function(_0x2b05b8){if(_0x2b05b8){_0xb8c521=_0x2b05b8;_0x5a3193[_0x63c5('0x2e')]=_[_0x63c5('0x44')](db[_0x63c5('0x6c')][_0x63c5('0x45')]);_0x5a3193[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x119e0e['query']);_0x5a3193[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0x5a3193[_0x63c5('0x2e')],_0x5a3193[_0x63c5('0x2f')]);_0x17e744[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x5a3193[_0x63c5('0x2e')],qs[_0x63c5('0x33')](_0x119e0e[_0x63c5('0x2f')]['fields']));_0x17e744[_0x63c5('0x32')]=_0x17e744[_0x63c5('0x32')]['length']?_0x17e744[_0x63c5('0x32')]:_0x5a3193[_0x63c5('0x2e')];_0x17e744['order']=qs[_0x63c5('0x37')](_0x119e0e[_0x63c5('0x2f')][_0x63c5('0x37')]);_0x17e744[_0x63c5('0x38')]=qs[_0x63c5('0x30')](_[_0x63c5('0x39')](_0x119e0e['query'],_0x5a3193[_0x63c5('0x30')]));_0x17e744[_0x63c5('0x38')]=_[_0x63c5('0x3b')](_0x17e744['where'],{'$or':[{'ListId':_0x2b05b8['id']},{'ListId':null}]});if(_0x119e0e['query'][_0x63c5('0x3a')]){_0x17e744[_0x63c5('0x38')]=_[_0x63c5('0x3b')](_0x17e744[_0x63c5('0x38')],{'$or':_[_0x63c5('0x2b')](_0x17e744[_0x63c5('0x32')],function(_0xc5566){var _0x14704f={};_0x14704f[_0xc5566]={'$like':'%'+_0x119e0e[_0x63c5('0x2f')]['filter']+'%'};return _0x14704f;})});}_0x17e744=_[_0x63c5('0x3b')]({},_0x17e744,_0x119e0e['options']);return db[_0x63c5('0x6c')][_0x63c5('0x81')](_0x17e744);}})['then'](respondWithResult(_0x7f5e5b,null))['catch'](handleError(_0x7f5e5b,null));};exports[_0x63c5('0x82')]=function(_0x59ca75,_0x8235cc,_0x540aac){return db[_0x63c5('0x40')]['find']({'where':{'id':_0x59ca75['params']['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x8235cc,null))[_0x63c5('0x23')](function(_0x1e1f2f){if(_0x1e1f2f){return _0x1e1f2f[_0x63c5('0x82')](_0x59ca75[_0x63c5('0x49')][_0x63c5('0x5a')],_[_0x63c5('0x61')](_0x59ca75['body'],[_0x63c5('0x5a'),'id'])||{})[_0x63c5('0x83')](function(_0x5c9627){for(var _0x5b5569=0x0;_0x5b5569<_0x59ca75[_0x63c5('0x49')][_0x63c5('0x5a')][_0x63c5('0x46')];_0x5b5569+=0x1){socket[_0x63c5('0x84')](_0x63c5('0x85'),{'UserId':_0x59ca75[_0x63c5('0x49')][_0x63c5('0x5a')][_0x5b5569],'CmListId':_0x59ca75[_0x63c5('0x53')]['id']});}return _0x5c9627;});}})[_0x63c5('0x23')](respondWithResult(_0x8235cc,null))[_0x63c5('0x47')](handleError(_0x8235cc,null));};exports[_0x63c5('0x86')]=function(_0x53b0f1,_0x33bdc6,_0x823a75){return db[_0x63c5('0x40')][_0x63c5('0x4e')]({'where':{'id':_0x53b0f1[_0x63c5('0x53')]['id']}})['then'](handleEntityNotFound(_0x33bdc6,null))[_0x63c5('0x23')](function(_0x394bef){if(_0x394bef){return _0x394bef[_0x63c5('0x86')](_0x53b0f1[_0x63c5('0x2f')][_0x63c5('0x5a')])[_0x63c5('0x23')](function(){if(_[_0x63c5('0x5d')](_0x53b0f1['query']['ids'])){for(var _0x165277=0x0;_0x165277<_0x53b0f1[_0x63c5('0x2f')][_0x63c5('0x5a')]['length'];_0x165277+=0x1){socket[_0x63c5('0x84')](_0x63c5('0x87'),{'UserId':Number(_0x53b0f1[_0x63c5('0x2f')][_0x63c5('0x5a')][_0x165277]),'CmListId':Number(_0x53b0f1[_0x63c5('0x53')]['id'])});}}else{socket['emit'](_0x63c5('0x87'),{'UserId':Number(_0x53b0f1['query'][_0x63c5('0x5a')]),'CmListId':Number(_0x53b0f1[_0x63c5('0x53')]['id'])});}});}})[_0x63c5('0x23')](respondWithStatusCode(_0x33bdc6,null))['catch'](handleError(_0x33bdc6,null));};exports['getAgents']=function(_0x52cdc4,_0x17177b,_0x440faa){var _0x16fcee={};var _0x26b06a={};var _0x392e1e;var _0x384473;return db[_0x63c5('0x40')][_0x63c5('0x56')]({'where':{'id':_0x52cdc4[_0x63c5('0x53')]['id']}})[_0x63c5('0x23')](handleEntityNotFound(_0x17177b,null))[_0x63c5('0x23')](function(_0x2c23ff){if(_0x2c23ff){_0x392e1e=_0x2c23ff;_0x26b06a[_0x63c5('0x2e')]=_[_0x63c5('0x44')](db[_0x63c5('0x88')][_0x63c5('0x45')]);_0x26b06a[_0x63c5('0x2f')]=_[_0x63c5('0x44')](_0x52cdc4[_0x63c5('0x2f')]);_0x26b06a[_0x63c5('0x30')]=_[_0x63c5('0x31')](_0x26b06a[_0x63c5('0x2e')],_0x26b06a[_0x63c5('0x2f')]);_0x16fcee[_0x63c5('0x32')]=_[_0x63c5('0x31')](_0x26b06a[_0x63c5('0x2e')],qs[_0x63c5('0x33')](_0x52cdc4['query']['fields']));_0x16fcee['attributes']=_0x16fcee[_0x63c5('0x32')]['length']?_0x16fcee[_0x63c5('0x32')]:_0x26b06a['model'];_0x16fcee[_0x63c5('0x36')]=qs[_0x63c5('0x37')](_0x52cdc4[_0x63c5('0x2f')][_0x63c5('0x37')]);_0x16fcee[_0x63c5('0x38')]=qs[_0x63c5('0x30')](_[_0x63c5('0x39')](_0x52cdc4[_0x63c5('0x2f')],_0x26b06a[_0x63c5('0x30')]));if(_0x52cdc4[_0x63c5('0x2f')][_0x63c5('0x3a')]){_0x16fcee[_0x63c5('0x38')]=_[_0x63c5('0x3b')](_0x16fcee[_0x63c5('0x38')],{'$or':_[_0x63c5('0x2b')](_0x16fcee[_0x63c5('0x32')],function(_0x4c8496){var _0x382000={};_0x382000[_0x4c8496]={'$like':'%'+_0x52cdc4[_0x63c5('0x2f')][_0x63c5('0x3a')]+'%'};return _0x382000;})});}_0x16fcee=_[_0x63c5('0x3b')]({},_0x16fcee,_0x52cdc4[_0x63c5('0x3d')]);return _0x392e1e['getAgents'](_0x16fcee);}})[_0x63c5('0x23')](function(_0x266cb4){if(_0x266cb4){_0x384473=_0x266cb4[_0x63c5('0x46')];if(!_0x52cdc4[_0x63c5('0x2f')][_0x63c5('0x34')](_0x63c5('0x35'))){_0x16fcee['limit']=qs[_0x63c5('0x1c')](_0x52cdc4[_0x63c5('0x2f')]['limit']);_0x16fcee[_0x63c5('0x1b')]=qs[_0x63c5('0x1b')](_0x52cdc4[_0x63c5('0x2f')]['offset']);}return _0x392e1e[_0x63c5('0x89')](_0x16fcee);}})[_0x63c5('0x23')](function(_0x33cf77){if(_0x33cf77){return _0x33cf77?{'count':_0x384473,'rows':_0x33cf77}:null;}})[_0x63c5('0x23')](respondWithResult(_0x17177b,null))[_0x63c5('0x47')](handleError(_0x17177b,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index bb4dc93..b10f0fa 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 _0x3ecb=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x572997,_0x323709){var _0x1de5ae=function(_0x4ef06d){while(--_0x4ef06d){_0x572997['push'](_0x572997['shift']());}};_0x1de5ae(++_0x323709);}(_0x3ecb,0xa5));var _0xb3ec=function(_0x150397,_0x258581){_0x150397=_0x150397-0x0;var _0x5cadab=_0x3ecb[_0x150397];return _0x5cadab;};'use strict';var EventEmitter=require(_0xb3ec('0x0'));var CmList=require(_0xb3ec('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xb3ec('0x2')](0x0);var events={'afterCreate':_0xb3ec('0x3'),'afterUpdate':_0xb3ec('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfa75c){return function(_0x95e3c0,_0x34b8b0,_0x1bbf05){CmListEvents[_0xb3ec('0x5')](_0xfa75c+':'+_0x95e3c0['id'],_0x95e3c0);CmListEvents[_0xb3ec('0x5')](_0xfa75c,_0x95e3c0);_0x1bbf05(null);};}for(var e in events){if(events[_0xb3ec('0x6')](e)){var event=events[e];CmList[_0xb3ec('0x7')](e,emitEvent(event));}}module[_0xb3ec('0x8')]=CmListEvents; \ No newline at end of file +var _0xed4e=['hook','exports','../../mysqldb','CmList','save','remove','emit','hasOwnProperty'];(function(_0x1d94b7,_0x5988e5){var _0x40a258=function(_0x3da766){while(--_0x3da766){_0x1d94b7['push'](_0x1d94b7['shift']());}};_0x40a258(++_0x5988e5);}(_0xed4e,0xe2));var _0xeed4=function(_0x15e097,_0xf4848){_0x15e097=_0x15e097-0x0;var _0x3866be=_0xed4e[_0x15e097];return _0x3866be;};'use strict';var EventEmitter=require('events');var CmList=require(_0xeed4('0x0'))['db'][_0xeed4('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeed4('0x2'),'afterUpdate':'update','afterDestroy':_0xeed4('0x3')};function emitEvent(_0x3d81fd){return function(_0x447a04,_0x18a02,_0x47efd0){CmListEvents['emit'](_0x3d81fd+':'+_0x447a04['id'],_0x447a04);CmListEvents[_0xeed4('0x4')](_0x3d81fd,_0x447a04);_0x47efd0(null);};}for(var e in events){if(events[_0xeed4('0x5')](e)){var event=events[e];CmList[_0xeed4('0x6')](e,emitEvent(event));}}module[_0xeed4('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 e4a4607..c22fa5a 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 _0x7b37=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','cm_lists','lodash','api','bluebird'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x7b37,0x1da));var _0x77b3=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0x7b37[_0x2ca0cf];return _0x12e852;};'use strict';var _=require(_0x77b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77b3('0x1'));var moment=require('moment');var BPromise=require(_0x77b3('0x2'));var rp=require(_0x77b3('0x3'));var fs=require('fs');var path=require(_0x77b3('0x4'));var rimraf=require(_0x77b3('0x5'));var config=require(_0x77b3('0x6'));var attributes=require(_0x77b3('0x7'));module['exports']=function(_0x567aed,_0x4d3b09){return _0x567aed['define']('CmList',attributes,{'tableName':_0x77b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd56=['../../config/logger','api','moment','./cmList.attributes','cm_lists','lodash','util'];(function(_0x554f21,_0x23044d){var _0x4dc64b=function(_0x37891d){while(--_0x37891d){_0x554f21['push'](_0x554f21['shift']());}};_0x4dc64b(++_0x23044d);}(_0xcd56,0x1c5));var _0x6cd5=function(_0x44cf54,_0x168f8b){_0x44cf54=_0x44cf54-0x0;var _0x3f5d08=_0xcd56[_0x44cf54];return _0x3f5d08;};'use strict';var _=require(_0x6cd5('0x0'));var util=require(_0x6cd5('0x1'));var logger=require(_0x6cd5('0x2'))(_0x6cd5('0x3'));var moment=require(_0x6cd5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6cd5('0x5'));module['exports']=function(_0x50666d,_0x190d9e){return _0x50666d['define']('CmList',attributes,{'tableName':_0x6cd5('0x6'),'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 549fcb8..770e7c6 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 _0x847f=['defaults','socket.io-emitter','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x566d4d,_0x457261){var _0x12a84a=function(_0x17bc0a){while(--_0x17bc0a){_0x566d4d['push'](_0x566d4d['shift']());}};_0x12a84a(++_0x457261);}(_0x847f,0xc4));var _0xf847=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x847f[_0x377fb1];return _0x3248e9;};'use strict';var _=require('lodash');var util=require(_0xf847('0x0'));var moment=require(_0xf847('0x1'));var BPromise=require(_0xf847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf847('0x4'));var logger=require(_0xf847('0x5'))(_0xf847('0x6'));var config=require(_0xf847('0x7'));var jayson=require(_0xf847('0x8'));var client=jayson[_0xf847('0x9')][_0xf847('0xa')]({'port':0x232a});config[_0xf847('0xb')]=_[_0xf847('0xc')](config[_0xf847('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf847('0xd'))(new Redis(config[_0xf847('0xb')]));require(_0xf847('0xe'))[_0xf847('0xf')](socket);function respondWithRpcPromise(_0x2f7733,_0x1eebe6,_0x526f25){return new BPromise(function(_0x120b39,_0x5c2279){return client['request'](_0x2f7733,_0x526f25)[_0xf847('0x10')](function(_0x17c9f2){logger[_0xf847('0x11')](_0xf847('0x12'),_0x1eebe6,_0xf847('0x13'));logger['debug'](_0xf847('0x14'),_0x1eebe6,_0xf847('0x13'),JSON['stringify'](_0x17c9f2));if(_0x17c9f2['error']){if(_0x17c9f2[_0xf847('0x15')][_0xf847('0x16')]===0x1f4){logger[_0xf847('0x15')](_0xf847('0x12'),_0x1eebe6,_0x17c9f2['error'][_0xf847('0x17')]);return _0x5c2279(_0x17c9f2[_0xf847('0x15')][_0xf847('0x17')]);}logger['error']('CmList,\x20%s,\x20%s',_0x1eebe6,_0x17c9f2[_0xf847('0x15')]['message']);return _0x120b39(_0x17c9f2[_0xf847('0x15')][_0xf847('0x17')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x1eebe6,_0xf847('0x13'));_0x120b39(_0x17c9f2[_0xf847('0x18')]['message']);}})[_0xf847('0x19')](function(_0x407ebb){logger[_0xf847('0x15')](_0xf847('0x12'),_0x1eebe6,_0x407ebb);_0x5c2279(_0x407ebb);});});} \ No newline at end of file +var _0xc27d=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc27d,0x199));var _0xdc27=function(_0x6d989d,_0x416427){_0x6d989d=_0x6d989d-0x0;var _0x5c5535=_0xc27d[_0x6d989d];return _0x5c5535;};'use strict';var _=require(_0xdc27('0x0'));var util=require(_0xdc27('0x1'));var moment=require(_0xdc27('0x2'));var BPromise=require(_0xdc27('0x3'));var rs=require(_0xdc27('0x4'));var fs=require('fs');var Redis=require(_0xdc27('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc27('0x6'));var logger=require(_0xdc27('0x7'))('rpc');var config=require(_0xdc27('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdc27('0x9')]['http']({'port':0x232a});config[_0xdc27('0xa')]=_['defaults'](config[_0xdc27('0xa')],{'host':_0xdc27('0xb'),'port':0x18eb});var socket=require(_0xdc27('0xc'))(new Redis(config['redis']));require(_0xdc27('0xd'))[_0xdc27('0xe')](socket);function respondWithRpcPromise(_0x4f4414,_0xb4c9ef,_0x197bc4){return new BPromise(function(_0x2f3881,_0xa9dee){return client['request'](_0x4f4414,_0x197bc4)[_0xdc27('0xf')](function(_0x118b1c){logger['info'](_0xdc27('0x10'),_0xb4c9ef,_0xdc27('0x11'));logger[_0xdc27('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0xb4c9ef,_0xdc27('0x11'),JSON['stringify'](_0x118b1c));if(_0x118b1c['error']){if(_0x118b1c['error'][_0xdc27('0x13')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0xb4c9ef,_0x118b1c[_0xdc27('0x14')][_0xdc27('0x15')]);return _0xa9dee(_0x118b1c[_0xdc27('0x14')][_0xdc27('0x15')]);}logger[_0xdc27('0x14')](_0xdc27('0x10'),_0xb4c9ef,_0x118b1c[_0xdc27('0x14')][_0xdc27('0x15')]);return _0x2f3881(_0x118b1c[_0xdc27('0x14')]['message']);}else{logger[_0xdc27('0x16')](_0xdc27('0x10'),_0xb4c9ef,_0xdc27('0x11'));_0x2f3881(_0x118b1c['result'][_0xdc27('0x15')]);}})[_0xdc27('0x17')](function(_0x415459){logger[_0xdc27('0x14')]('CmList,\x20%s,\x20%s',_0xb4c9ef,_0x415459);_0xa9dee(_0x415459);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 0d485eb..a9081a9 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 _0xbdb9=['update','register','length','cmList:','./cmList.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb9,0xac));var _0x9bdb=function(_0x3f8568,_0x11efa9){_0x3f8568=_0x3f8568-0x0;var _0x5249c0=_0xbdb9[_0x3f8568];return _0x5249c0;};'use strict';var CmListEvents=require(_0x9bdb('0x0'));var events=[_0x9bdb('0x1'),_0x9bdb('0x2'),_0x9bdb('0x3')];function createListener(_0x23595d,_0x4fe743){return function(_0x24a6af){_0x4fe743['emit'](_0x23595d,_0x24a6af);};}function removeListener(_0x5dbce0,_0x5870f6){return function(){CmListEvents['removeListener'](_0x5dbce0,_0x5870f6);};}exports[_0x9bdb('0x4')]=function(_0x4f9fbe){for(var _0x225a66=0x0,_0x4e9c54=events[_0x9bdb('0x5')];_0x225a66<_0x4e9c54;_0x225a66++){var _0x27cdd8=events[_0x225a66];var _0x27c6b8=createListener(_0x9bdb('0x6')+_0x27cdd8,_0x4f9fbe);CmListEvents['on'](_0x27cdd8,_0x27c6b8);}}; \ No newline at end of file +var _0xe292=['remove','update','emit','removeListener','length','cmList:'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe292,0x19e));var _0x2e29=function(_0x598fb2,_0x6808e7){_0x598fb2=_0x598fb2-0x0;var _0x1a10a8=_0xe292[_0x598fb2];return _0x1a10a8;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x2e29('0x0'),_0x2e29('0x1')];function createListener(_0x56d796,_0x575f18){return function(_0x1d2c2a){_0x575f18[_0x2e29('0x2')](_0x56d796,_0x1d2c2a);};}function removeListener(_0x4fec69,_0x59d723){return function(){CmListEvents[_0x2e29('0x3')](_0x4fec69,_0x59d723);};}exports['register']=function(_0x5bd6cc){for(var _0xcdccd7=0x0,_0x422679=events[_0x2e29('0x4')];_0xcdccd7<_0x422679;_0xcdccd7++){var _0x39f1ee=events[_0xcdccd7];var _0x1e7c81=createListener(_0x2e29('0x5')+_0x39f1ee,_0x5bd6cc);CmListEvents['on'](_0x39f1ee,_0x1e7c81);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index f048009..a28fd36 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 _0x7fe0=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','create','post','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','/:id','update','delete','destroy'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x7fe0,0x1e3));var _0x07fe=function(_0x45c1df,_0x2d14bc){_0x45c1df=_0x45c1df-0x0;var _0x1bb9db=_0x7fe0[_0x45c1df];return _0x1bb9db;};'use strict';var multer=require(_0x07fe('0x0'));var util=require(_0x07fe('0x1'));var path=require(_0x07fe('0x2'));var timeout=require(_0x07fe('0x3'));var express=require(_0x07fe('0x4'));var router=express[_0x07fe('0x5')]();var auth=require(_0x07fe('0x6'));var interaction=require(_0x07fe('0x7'));var config=require('../../config/environment');var controller=require(_0x07fe('0x8'));router[_0x07fe('0x9')]('/',auth['isAuthenticated'](),controller[_0x07fe('0xa')]);router[_0x07fe('0x9')](_0x07fe('0xb'),auth[_0x07fe('0xc')](),controller[_0x07fe('0xd')]);router[_0x07fe('0x9')]('/:id',auth[_0x07fe('0xc')](),controller[_0x07fe('0xe')]);router['get'](_0x07fe('0xf'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x10')]);router[_0x07fe('0x9')](_0x07fe('0x11'),auth['isAuthenticated'](),controller['getContacts']);router[_0x07fe('0x9')](_0x07fe('0x12'),auth['isAuthenticated'](),controller[_0x07fe('0x13')]);router['get']('/:id/fields',auth[_0x07fe('0xc')](),controller[_0x07fe('0x14')]);router[_0x07fe('0x9')](_0x07fe('0x15'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x16')]);router['post']('/',auth[_0x07fe('0xc')](),controller[_0x07fe('0x17')]);router[_0x07fe('0x18')](_0x07fe('0xf'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x19')]);router[_0x07fe('0x18')](_0x07fe('0x11'),auth['isAuthenticated'](),controller[_0x07fe('0x1a')]);router[_0x07fe('0x18')](_0x07fe('0x1b'),auth['isAuthenticated'](),controller[_0x07fe('0x1c')]);router[_0x07fe('0x18')](_0x07fe('0x15'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x1d')]);router[_0x07fe('0x1e')](_0x07fe('0x1f'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x20')]);router[_0x07fe('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x07fe('0x22')]);router[_0x07fe('0x21')](_0x07fe('0xf'),auth[_0x07fe('0xc')](),controller['removeDispositions']);router[_0x07fe('0x21')](_0x07fe('0x15'),auth[_0x07fe('0xc')](),controller[_0x07fe('0x23')]);module[_0x07fe('0x24')]=router; \ No newline at end of file +var _0x8b7e=['show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','addDisposition','addContacts','addCustomField','/:id/users','put','/:id','update','delete','destroy','removeDispositions','exports','multer','util','path','Router','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x48647c,_0x1ac6c4){var _0xc917fc=function(_0x34761d){while(--_0x34761d){_0x48647c['push'](_0x48647c['shift']());}};_0xc917fc(++_0x1ac6c4);}(_0x8b7e,0x75));var _0xe8b7=function(_0x33829b,_0x3f5c8d){_0x33829b=_0x33829b-0x0;var _0x233357=_0x8b7e[_0x33829b];return _0x233357;};'use strict';var multer=require(_0xe8b7('0x0'));var util=require(_0xe8b7('0x1'));var path=require(_0xe8b7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8b7('0x3')]();var auth=require(_0xe8b7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe8b7('0x5'));router[_0xe8b7('0x6')]('/',auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x8')]);router['get'](_0xe8b7('0x9'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xa')]);router[_0xe8b7('0x6')]('/:id',auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xb')]);router[_0xe8b7('0x6')](_0xe8b7('0xc'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xd')]);router['get'](_0xe8b7('0xe'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0xf')]);router[_0xe8b7('0x6')](_0xe8b7('0x10'),auth[_0xe8b7('0x7')](),controller['getContactsCsv']);router['get'](_0xe8b7('0x11'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x12')]);router[_0xe8b7('0x6')]('/:id/users',auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x13')]);router[_0xe8b7('0x14')]('/',auth[_0xe8b7('0x7')](),controller['create']);router['post'](_0xe8b7('0xc'),auth['isAuthenticated'](),controller[_0xe8b7('0x15')]);router[_0xe8b7('0x14')](_0xe8b7('0xe'),auth['isAuthenticated'](),controller[_0xe8b7('0x16')]);router[_0xe8b7('0x14')](_0xe8b7('0x11'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x17')]);router[_0xe8b7('0x14')](_0xe8b7('0x18'),auth[_0xe8b7('0x7')](),controller['addAgents']);router[_0xe8b7('0x19')](_0xe8b7('0x1a'),auth[_0xe8b7('0x7')](),controller[_0xe8b7('0x1b')]);router[_0xe8b7('0x1c')](_0xe8b7('0x1a'),auth['isAuthenticated'](),controller[_0xe8b7('0x1d')]);router[_0xe8b7('0x1c')](_0xe8b7('0xc'),auth['isAuthenticated'](),controller[_0xe8b7('0x1e')]);router[_0xe8b7('0x1c')](_0xe8b7('0x18'),auth[_0xe8b7('0x7')](),controller['removeAgents']);module[_0xe8b7('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index eaeea1e..37ea4e9 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(_0x1ef6e3,_0x2a2df5){var _0x21cf56=function(_0x19b02f){while(--_0x19b02f){_0x1ef6e3['push'](_0x1ef6e3['shift']());}};_0x21cf56(++_0x2a2df5);}(_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')]={'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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x32f1a2,_0xa27ac3){var _0x2023f0=function(_0x27208b){while(--_0x27208b){_0x32f1a2['push'](_0x32f1a2['shift']());}};_0x2023f0(++_0xa27ac3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('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 25be5dc..f8afd6e 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 _0x81cb=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Condition','catch','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x81cb,0xaa));var _0xb81c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81cb[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xb81c('0x0'));var emlformat=require(_0xb81c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb81c('0x2'));var jsonpatch=require(_0xb81c('0x3'));var rp=require('request-promise');var moment=require(_0xb81c('0x4'));var BPromise=require(_0xb81c('0x5'));var Mustache=require(_0xb81c('0x6'));var util=require(_0xb81c('0x7'));var path=require('path');var sox=require(_0xb81c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb81c('0x9'));var squel=require(_0xb81c('0xa'));var crypto=require(_0xb81c('0xb'));var jsforce=require(_0xb81c('0xc'));var deskjs=require(_0xb81c('0xd'));var toCsv=require(_0xb81c('0xe'));var querystring=require(_0xb81c('0xf'));var Papa=require(_0xb81c('0x10'));var Redis=require(_0xb81c('0x11'));var authService=require(_0xb81c('0x12'));var qs=require(_0xb81c('0x13'));var as=require(_0xb81c('0x14'));var hardwareService=require(_0xb81c('0x15'));var logger=require(_0xb81c('0x16'))('api');var utils=require(_0xb81c('0x17'));var config=require(_0xb81c('0x18'));var db=require(_0xb81c('0x19'))['db'];function respondWithStatusCode(_0x60aa8e,_0x2e8242){_0x2e8242=_0x2e8242||0xcc;return function(_0x4b1d98){if(_0x4b1d98){return _0x60aa8e[_0xb81c('0x1a')](_0x2e8242);}return _0x60aa8e['status'](_0x2e8242)[_0xb81c('0x1b')]();};}function respondWithResult(_0x29b1db,_0x572945){_0x572945=_0x572945||0xc8;return function(_0x1bb255){if(_0x1bb255){return _0x29b1db[_0xb81c('0x1c')](_0x572945)['json'](_0x1bb255);}};}function respondWithFilteredResult(_0x21f5c8,_0x3942dc){return function(_0x3462bd){if(_0x3462bd){var _0x56eb92=_0x3462bd[_0xb81c('0x1d')],_0x393e11=_0x3942dc[_0xb81c('0x1e')],_0x112ad5=_0x3942dc[_0xb81c('0x1e')]+_0x3942dc['limit'],_0x4d95cd;if(_0x112ad5>=_0x56eb92){_0x112ad5=_0x56eb92;_0x4d95cd=0xc8;}else{_0x4d95cd=0xce;}_0x21f5c8[_0xb81c('0x1c')](_0x4d95cd);return _0x21f5c8[_0xb81c('0x1f')](_0xb81c('0x20'),_0x393e11+'-'+_0x112ad5+'/'+_0x56eb92)['json'](_0x3462bd);}return null;};}function patchUpdates(_0x174009){return function(_0x3e8376){try{jsonpatch[_0xb81c('0x21')](_0x3e8376,_0x174009,!![]);}catch(_0x1d970c){return BPromise[_0xb81c('0x22')](_0x1d970c);}return _0x3e8376[_0xb81c('0x23')]();};}function saveUpdates(_0x445222,_0x4f09d7){return function(_0xc2ba68){if(_0xc2ba68){return _0xc2ba68[_0xb81c('0x24')](_0x445222)[_0xb81c('0x25')](function(_0x2cb18e){return _0x2cb18e;});}return null;};}function removeEntity(_0x4dab47,_0x11a5d3){return function(_0x597547){if(_0x597547){return _0x597547[_0xb81c('0x26')]()[_0xb81c('0x25')](function(){_0x4dab47[_0xb81c('0x1c')](0xcc)[_0xb81c('0x1b')]();});}};}function handleEntityNotFound(_0x554cc0,_0x5de2ac){return function(_0x12798b){if(!_0x12798b){_0x554cc0[_0xb81c('0x1a')](0x194);}return _0x12798b;};}function handleError(_0x101e04,_0x43b90f){_0x43b90f=_0x43b90f||0x1f4;return function(_0x375b9b){logger[_0xb81c('0x27')](_0x375b9b[_0xb81c('0x28')]);if(_0x375b9b[_0xb81c('0x29')]){delete _0x375b9b[_0xb81c('0x29')];}_0x101e04[_0xb81c('0x1c')](_0x43b90f)[_0xb81c('0x2a')](_0x375b9b);};}exports[_0xb81c('0x24')]=function(_0x7c57ba,_0x20b7ea){if(_0x7c57ba[_0xb81c('0x2b')]['id']){delete _0x7c57ba[_0xb81c('0x2b')]['id'];}return db[_0xb81c('0x2c')]['find']({'where':{'id':_0x7c57ba['params']['id']}})[_0xb81c('0x25')](handleEntityNotFound(_0x20b7ea,null))[_0xb81c('0x25')](saveUpdates(_0x7c57ba['body'],null))[_0xb81c('0x25')](respondWithResult(_0x20b7ea,null))[_0xb81c('0x2d')](handleError(_0x20b7ea,null));};exports['destroy']=function(_0x3c8384,_0x484ce9){return db[_0xb81c('0x2c')]['find']({'where':{'id':_0x3c8384[_0xb81c('0x2e')]['id']}})[_0xb81c('0x25')](handleEntityNotFound(_0x484ce9,null))[_0xb81c('0x25')](removeEntity(_0x484ce9,null))['catch'](handleError(_0x484ce9,null));}; \ No newline at end of file +var _0x9e38=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','Content-Range','reject','save','update','then','error','name','send','body','find','Condition','params','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0xb7fc0b,_0x4181d9){var _0x586afc=function(_0x1dfa07){while(--_0x1dfa07){_0xb7fc0b['push'](_0xb7fc0b['shift']());}};_0x586afc(++_0x4181d9);}(_0x9e38,0x171));var _0x89e3=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0x9e38[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require(_0x89e3('0x0'));var emlformat=require(_0x89e3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x89e3('0x2'));var jsonpatch=require(_0x89e3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x89e3('0x4'));var Mustache=require(_0x89e3('0x5'));var util=require(_0x89e3('0x6'));var path=require(_0x89e3('0x7'));var sox=require(_0x89e3('0x8'));var csv=require(_0x89e3('0x9'));var ejs=require(_0x89e3('0xa'));var fs=require('fs');var _=require(_0x89e3('0xb'));var squel=require(_0x89e3('0xc'));var crypto=require(_0x89e3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x89e3('0xe'));var toCsv=require(_0x89e3('0x9'));var querystring=require(_0x89e3('0xf'));var Papa=require(_0x89e3('0x10'));var Redis=require(_0x89e3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x89e3('0x12'));var as=require(_0x89e3('0x13'));var hardwareService=require(_0x89e3('0x14'));var logger=require(_0x89e3('0x15'))(_0x89e3('0x16'));var utils=require('../../config/utils');var config=require(_0x89e3('0x17'));var db=require(_0x89e3('0x18'))['db'];function respondWithStatusCode(_0x3aa8f1,_0x264c0a){_0x264c0a=_0x264c0a||0xcc;return function(_0x2205c8){if(_0x2205c8){return _0x3aa8f1[_0x89e3('0x19')](_0x264c0a);}return _0x3aa8f1['status'](_0x264c0a)[_0x89e3('0x1a')]();};}function respondWithResult(_0x768d1c,_0x2a6e98){_0x2a6e98=_0x2a6e98||0xc8;return function(_0x43bc47){if(_0x43bc47){return _0x768d1c[_0x89e3('0x1b')](_0x2a6e98)['json'](_0x43bc47);}};}function respondWithFilteredResult(_0x5d1308,_0x8b768a){return function(_0x4ab641){if(_0x4ab641){var _0x47a728=_0x4ab641[_0x89e3('0x1c')],_0xeedc96=_0x8b768a['offset'],_0xd925a0=_0x8b768a[_0x89e3('0x1d')]+_0x8b768a['limit'],_0x342250;if(_0xd925a0>=_0x47a728){_0xd925a0=_0x47a728;_0x342250=0xc8;}else{_0x342250=0xce;}_0x5d1308['status'](_0x342250);return _0x5d1308['set'](_0x89e3('0x1e'),_0xeedc96+'-'+_0xd925a0+'/'+_0x47a728)['json'](_0x4ab641);}return null;};}function patchUpdates(_0x3adc8f){return function(_0x425b3f){try{jsonpatch['apply'](_0x425b3f,_0x3adc8f,!![]);}catch(_0x2eb202){return BPromise[_0x89e3('0x1f')](_0x2eb202);}return _0x425b3f[_0x89e3('0x20')]();};}function saveUpdates(_0x5cf380,_0x34628e){return function(_0x1c8ab3){if(_0x1c8ab3){return _0x1c8ab3[_0x89e3('0x21')](_0x5cf380)[_0x89e3('0x22')](function(_0x28fa34){return _0x28fa34;});}return null;};}function removeEntity(_0x293c1e,_0x189d69){return function(_0x50afe2){if(_0x50afe2){return _0x50afe2['destroy']()['then'](function(){_0x293c1e[_0x89e3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc740ec,_0x13b440){return function(_0x1adca7){if(!_0x1adca7){_0xc740ec['sendStatus'](0x194);}return _0x1adca7;};}function handleError(_0x82459,_0x2b2f9d){_0x2b2f9d=_0x2b2f9d||0x1f4;return function(_0x1be1ce){logger[_0x89e3('0x23')](_0x1be1ce['stack']);if(_0x1be1ce[_0x89e3('0x24')]){delete _0x1be1ce[_0x89e3('0x24')];}_0x82459['status'](_0x2b2f9d)[_0x89e3('0x25')](_0x1be1ce);};}exports[_0x89e3('0x21')]=function(_0x503869,_0x24179c){if(_0x503869[_0x89e3('0x26')]['id']){delete _0x503869[_0x89e3('0x26')]['id'];}return db['Condition'][_0x89e3('0x27')]({'where':{'id':_0x503869['params']['id']}})[_0x89e3('0x22')](handleEntityNotFound(_0x24179c,null))[_0x89e3('0x22')](saveUpdates(_0x503869[_0x89e3('0x26')],null))[_0x89e3('0x22')](respondWithResult(_0x24179c,null))['catch'](handleError(_0x24179c,null));};exports['destroy']=function(_0xc4092d,_0x2ebbcc){return db[_0x89e3('0x28')]['find']({'where':{'id':_0xc4092d[_0x89e3('0x29')]['id']}})[_0x89e3('0x22')](handleEntityNotFound(_0x2ebbcc,null))[_0x89e3('0x22')](removeEntity(_0x2ebbcc,null))['catch'](handleError(_0x2ebbcc,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 0d94511..2e05366 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 _0x2c2e=['../../config/environment','./condition.attributes','exports','define','Condition','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c2e,0x89));var _0xe2c2=function(_0x19e2aa,_0x5bd441){_0x19e2aa=_0x19e2aa-0x0;var _0x1b5df5=_0x2c2e[_0x19e2aa];return _0x1b5df5;};'use strict';var _=require(_0xe2c2('0x0'));var util=require(_0xe2c2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe2c2('0x2'));var BPromise=require(_0xe2c2('0x3'));var rp=require(_0xe2c2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2c2('0x5'));var config=require(_0xe2c2('0x6'));var attributes=require(_0xe2c2('0x7'));module[_0xe2c2('0x8')]=function(_0x1c9a02,_0x140450){return _0x1c9a02[_0xe2c2('0x9')](_0xe2c2('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd36c=['bluebird','request-promise','exports','define','Condition','lodash','util','../../config/logger','moment'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0xd36c,0x1b5));var _0xcd36=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xd36c[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xcd36('0x0'));var util=require(_0xcd36('0x1'));var logger=require(_0xcd36('0x2'))('api');var moment=require(_0xcd36('0x3'));var BPromise=require(_0xcd36('0x4'));var rp=require(_0xcd36('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0xcd36('0x6')]=function(_0x4cdbec,_0xcd649b){return _0x4cdbec[_0xcd36('0x7')](_0xcd36('0x8'),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 9f9aa26..11f074d 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 _0x8d1c=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','info'];(function(_0x3904fa,_0x21d5f4){var _0x426439=function(_0x543f41){while(--_0x543f41){_0x3904fa['push'](_0x3904fa['shift']());}};_0x426439(++_0x21d5f4);}(_0x8d1c,0x1ae));var _0xc8d1=function(_0x1cfb37,_0x19d0d6){_0x1cfb37=_0x1cfb37-0x0;var _0x1f9a1f=_0x8d1c[_0x1cfb37];return _0x1f9a1f;};'use strict';var _=require(_0xc8d1('0x0'));var util=require(_0xc8d1('0x1'));var moment=require(_0xc8d1('0x2'));var BPromise=require(_0xc8d1('0x3'));var rs=require(_0xc8d1('0x4'));var fs=require('fs');var Redis=require(_0xc8d1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc8d1('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc8d1('0x7'));var client=jayson[_0xc8d1('0x8')][_0xc8d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d5221,_0x28ac27,_0x534c12){return new BPromise(function(_0x5b7f9d,_0x479dc5){return client['request'](_0x2d5221,_0x534c12)['then'](function(_0x9710a6){logger[_0xc8d1('0xa')]('Condition,\x20%s,\x20%s',_0x28ac27,_0xc8d1('0xb'));logger[_0xc8d1('0xc')](_0xc8d1('0xd'),_0x28ac27,_0xc8d1('0xb'),JSON[_0xc8d1('0xe')](_0x9710a6));if(_0x9710a6[_0xc8d1('0xf')]){if(_0x9710a6[_0xc8d1('0xf')][_0xc8d1('0x10')]===0x1f4){logger[_0xc8d1('0xf')](_0xc8d1('0x11'),_0x28ac27,_0x9710a6['error']['message']);return _0x479dc5(_0x9710a6[_0xc8d1('0xf')][_0xc8d1('0x12')]);}logger[_0xc8d1('0xf')](_0xc8d1('0x11'),_0x28ac27,_0x9710a6[_0xc8d1('0xf')]['message']);return _0x5b7f9d(_0x9710a6['error']['message']);}else{logger[_0xc8d1('0xa')](_0xc8d1('0x11'),_0x28ac27,_0xc8d1('0xb'));_0x5b7f9d(_0x9710a6[_0xc8d1('0x13')][_0xc8d1('0x12')]);}})[_0xc8d1('0x14')](function(_0x204868){logger[_0xc8d1('0xf')](_0xc8d1('0x11'),_0x28ac27,_0x204868);_0x479dc5(_0x204868);});});} \ No newline at end of file +var _0x4db7=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x4db7,0x1eb));var _0x74db=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x4db7[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x74db('0x0'));var util=require(_0x74db('0x1'));var moment=require(_0x74db('0x2'));var BPromise=require('bluebird');var rs=require(_0x74db('0x3'));var fs=require('fs');var Redis=require(_0x74db('0x4'));var db=require(_0x74db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74db('0x6'))(_0x74db('0x7'));var config=require(_0x74db('0x8'));var jayson=require(_0x74db('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x232882,_0x4b14bb,_0x45c150){return new BPromise(function(_0x16961f,_0x3c65a1){return client[_0x74db('0xa')](_0x232882,_0x45c150)[_0x74db('0xb')](function(_0x2aae75){logger[_0x74db('0xc')]('Condition,\x20%s,\x20%s',_0x4b14bb,_0x74db('0xd'));logger[_0x74db('0xe')](_0x74db('0xf'),_0x4b14bb,_0x74db('0xd'),JSON[_0x74db('0x10')](_0x2aae75));if(_0x2aae75['error']){if(_0x2aae75[_0x74db('0x11')][_0x74db('0x12')]===0x1f4){logger[_0x74db('0x11')](_0x74db('0x13'),_0x4b14bb,_0x2aae75[_0x74db('0x11')][_0x74db('0x14')]);return _0x3c65a1(_0x2aae75['error'][_0x74db('0x14')]);}logger[_0x74db('0x11')](_0x74db('0x13'),_0x4b14bb,_0x2aae75[_0x74db('0x11')]['message']);return _0x16961f(_0x2aae75[_0x74db('0x11')]['message']);}else{logger['info'](_0x74db('0x13'),_0x4b14bb,_0x74db('0xd'));_0x16961f(_0x2aae75[_0x74db('0x15')][_0x74db('0x14')]);}})[_0x74db('0x16')](function(_0x323da8){logger[_0x74db('0x11')](_0x74db('0x13'),_0x4b14bb,_0x323da8);_0x3c65a1(_0x323da8);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d4ce150..fdea442 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 _0x4a95=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update'];(function(_0x4d9618,_0x2a4178){var _0x100f02=function(_0x144799){while(--_0x144799){_0x4d9618['push'](_0x4d9618['shift']());}};_0x100f02(++_0x2a4178);}(_0x4a95,0xab));var _0x54a9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4a95[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x54a9('0x0'));var util=require(_0x54a9('0x1'));var path=require(_0x54a9('0x2'));var timeout=require(_0x54a9('0x3'));var express=require('express');var router=express[_0x54a9('0x4')]();var auth=require(_0x54a9('0x5'));var interaction=require(_0x54a9('0x6'));var config=require('../../config/environment');var controller=require(_0x54a9('0x7'));router['put'](_0x54a9('0x8'),auth[_0x54a9('0x9')](),controller[_0x54a9('0xa')]);router['delete'](_0x54a9('0x8'),auth[_0x54a9('0x9')](),controller[_0x54a9('0xb')]);module[_0x54a9('0xc')]=router; \ No newline at end of file +var _0x9428=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer'];(function(_0x1eaad7,_0x44dd84){var _0x20929e=function(_0x265504){while(--_0x265504){_0x1eaad7['push'](_0x1eaad7['shift']());}};_0x20929e(++_0x44dd84);}(_0x9428,0x1db));var _0x8942=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x9428[_0x5a2285];return _0x48f6ed;};'use strict';var multer=require(_0x8942('0x0'));var util=require(_0x8942('0x1'));var path=require(_0x8942('0x2'));var timeout=require(_0x8942('0x3'));var express=require(_0x8942('0x4'));var router=express[_0x8942('0x5')]();var auth=require(_0x8942('0x6'));var interaction=require(_0x8942('0x7'));var config=require(_0x8942('0x8'));var controller=require(_0x8942('0x9'));router[_0x8942('0xa')]('/:id',auth[_0x8942('0xb')](),controller[_0x8942('0xc')]);router[_0x8942('0xd')](_0x8942('0xe'),auth[_0x8942('0xb')](),controller[_0x8942('0xf')]);module[_0x8942('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 1940bed..21d2fc1 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 _0x548b=['STRING','name','sequelize'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x548b,0x14f));var _0xb548=function(_0x46abd1,_0x3ca47d){_0x46abd1=_0x46abd1-0x0;var _0x28f4f5=_0x548b[_0x46abd1];return _0x28f4f5;};'use strict';var Sequelize=require(_0xb548('0x0'));module['exports']={'name':{'type':Sequelize[_0xb548('0x1')],'allowNull':![],'unique':_0xb548('0x2')},'description':{'type':Sequelize[_0xb548('0x1')]}}; \ No newline at end of file +var _0x5a63=['exports','STRING','sequelize'];(function(_0x1f1c46,_0x572114){var _0x5f4a51=function(_0x45ee9e){while(--_0x45ee9e){_0x1f1c46['push'](_0x1f1c46['shift']());}};_0x5f4a51(++_0x572114);}(_0x5a63,0xe3));var _0x35a6=function(_0x600477,_0x217c57){_0x600477=_0x600477-0x0;var _0x7d2596=_0x5a63[_0x600477];return _0x7d2596;};'use strict';var Sequelize=require(_0x35a6('0x0'));module[_0x35a6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x35a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 894434e..8019f45 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 _0x73b5=['zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','get','omit','createdAt','updatedAt','update','attrUrl','attrs','value','https://','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','html-pdf'];(function(_0x4375fb,_0x22650a){var _0x445a97=function(_0x37e046){while(--_0x37e046){_0x4375fb['push'](_0x4375fb['shift']());}};_0x445a97(++_0x22650a);}(_0x73b5,0x164));var _0x573b=function(_0x3e1896,_0x531fab){_0x3e1896=_0x3e1896-0x0;var _0x3a5074=_0x73b5[_0x3e1896];return _0x3a5074;};'use strict';var pdf=require(_0x573b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x573b('0x1'));var jsonpatch=require(_0x573b('0x2'));var rp=require(_0x573b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x573b('0x4'));var util=require(_0x573b('0x5'));var path=require(_0x573b('0x6'));var sox=require(_0x573b('0x7'));var csv=require(_0x573b('0x8'));var ejs=require(_0x573b('0x9'));var fs=require('fs');var _=require(_0x573b('0xa'));var squel=require(_0x573b('0xb'));var crypto=require('crypto');var jsforce=require(_0x573b('0xc'));var deskjs=require(_0x573b('0xd'));var toCsv=require(_0x573b('0x8'));var querystring=require(_0x573b('0xe'));var Papa=require(_0x573b('0xf'));var Redis=require('ioredis');var authService=require(_0x573b('0x10'));var qs=require(_0x573b('0x11'));var as=require(_0x573b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x573b('0x13'))(_0x573b('0x14'));var utils=require(_0x573b('0x15'));var config=require('../../config/environment');var db=require(_0x573b('0x16'))['db'];config[_0x573b('0x17')]=_['defaults'](config[_0x573b('0x17')],{'host':_0x573b('0x18'),'port':0x18eb});var socket=require(_0x573b('0x19'))(new Redis(config[_0x573b('0x17')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x460f09,_0x5ce93e){_0x5ce93e=_0x5ce93e||0xcc;return function(_0x386cbb){if(_0x386cbb){return _0x460f09[_0x573b('0x1a')](_0x5ce93e);}return _0x460f09['status'](_0x5ce93e)[_0x573b('0x1b')]();};}function respondWithResult(_0x50b35b,_0xec676b){_0xec676b=_0xec676b||0xc8;return function(_0x38303f){if(_0x38303f){return _0x50b35b[_0x573b('0x1c')](_0xec676b)[_0x573b('0x1d')](_0x38303f);}};}function respondWithFilteredResult(_0x153606,_0x4fda22){return function(_0x16ac4e){if(_0x16ac4e){var _0x2598a3=_0x16ac4e[_0x573b('0x1e')],_0x537433=_0x4fda22['offset'],_0x24597e=_0x4fda22[_0x573b('0x1f')]+_0x4fda22['limit'],_0xdfa6ea;if(_0x24597e>=_0x2598a3){_0x24597e=_0x2598a3;_0xdfa6ea=0xc8;}else{_0xdfa6ea=0xce;}_0x153606[_0x573b('0x1c')](_0xdfa6ea);return _0x153606[_0x573b('0x20')](_0x573b('0x21'),_0x537433+'-'+_0x24597e+'/'+_0x2598a3)[_0x573b('0x1d')](_0x16ac4e);}return null;};}function patchUpdates(_0x2c01ad){return function(_0x427c23){try{jsonpatch[_0x573b('0x22')](_0x427c23,_0x2c01ad,!![]);}catch(_0x103d63){return BPromise['reject'](_0x103d63);}return _0x427c23[_0x573b('0x23')]();};}function saveUpdates(_0x578bd8,_0x2302ab){return function(_0x14d154){if(_0x14d154){return _0x14d154['update'](_0x578bd8)[_0x573b('0x24')](function(_0x447f22){return _0x447f22;});}return null;};}function removeEntity(_0x5369b2,_0x3cb930){return function(_0x1a77aa){if(_0x1a77aa){return _0x1a77aa[_0x573b('0x25')]()[_0x573b('0x24')](function(){var _0x5ad7fc=_0x1a77aa['get']({'plain':!![]});var _0x4d7f8b=_0x573b('0x26');return db[_0x573b('0x27')][_0x573b('0x25')]({'where':{'type':_0x4d7f8b,'resourceId':_0x5ad7fc['id']}})[_0x573b('0x24')](function(){return _0x1a77aa;});})[_0x573b('0x24')](function(){_0x5369b2[_0x573b('0x1c')](0xcc)[_0x573b('0x1b')]();});}};}function handleEntityNotFound(_0x1463b7,_0x4e3027){return function(_0x1f0ea7){if(!_0x1f0ea7){_0x1463b7[_0x573b('0x1a')](0x194);}return _0x1f0ea7;};}function handleError(_0x1a3cf6,_0x35d70e){_0x35d70e=_0x35d70e||0x1f4;return function(_0x44975b){logger[_0x573b('0x28')](_0x44975b[_0x573b('0x29')]);if(_0x44975b['name']){delete _0x44975b[_0x573b('0x2a')];}_0x1a3cf6[_0x573b('0x1c')](_0x35d70e)[_0x573b('0x2b')](_0x44975b);};}exports[_0x573b('0x2c')]=function(_0x37aacb,_0x277874){var _0x10e1e7={},_0x416e06={},_0x82f16d={'count':0x0,'rows':[]};var _0x39a321=_[_0x573b('0x2d')](db[_0x573b('0x2e')][_0x573b('0x2f')],function(_0x1d64ae){return{'name':_0x1d64ae[_0x573b('0x30')],'type':_0x1d64ae[_0x573b('0x31')][_0x573b('0x32')]};});_0x416e06[_0x573b('0x33')]=_['map'](_0x39a321,_0x573b('0x2a'));_0x416e06[_0x573b('0x34')]=_[_0x573b('0x35')](_0x37aacb[_0x573b('0x34')]);_0x416e06[_0x573b('0x36')]=_[_0x573b('0x37')](_0x416e06[_0x573b('0x33')],_0x416e06['query']);_0x10e1e7[_0x573b('0x38')]=_['intersection'](_0x416e06[_0x573b('0x33')],qs['fields'](_0x37aacb[_0x573b('0x34')][_0x573b('0x39')]));_0x10e1e7[_0x573b('0x38')]=_0x10e1e7['attributes']['length']?_0x10e1e7['attributes']:_0x416e06[_0x573b('0x33')];if(!_0x37aacb['query'][_0x573b('0x3a')](_0x573b('0x3b'))){_0x10e1e7['limit']=qs[_0x573b('0x3c')](_0x37aacb[_0x573b('0x34')]['limit']);_0x10e1e7[_0x573b('0x1f')]=qs[_0x573b('0x1f')](_0x37aacb[_0x573b('0x34')][_0x573b('0x1f')]);}_0x10e1e7[_0x573b('0x3d')]=qs['sort'](_0x37aacb[_0x573b('0x34')][_0x573b('0x3e')]);_0x10e1e7['where']=qs[_0x573b('0x36')](_['pick'](_0x37aacb[_0x573b('0x34')],_0x416e06[_0x573b('0x36')]),_0x39a321);if(_0x37aacb[_0x573b('0x34')][_0x573b('0x3f')]){_0x10e1e7[_0x573b('0x40')]=_[_0x573b('0x41')](_0x10e1e7[_0x573b('0x40')],{'$or':_[_0x573b('0x2d')](_0x39a321,function(_0x42e761){if(_0x42e761['type']!=='VIRTUAL'){var _0x474cb0={};_0x474cb0[_0x42e761[_0x573b('0x2a')]]={'$like':'%'+_0x37aacb[_0x573b('0x34')][_0x573b('0x3f')]+'%'};return _0x474cb0;}})});}_0x10e1e7=_['merge']({},_0x10e1e7,_0x37aacb[_0x573b('0x42')]);var _0x3e327d={'where':_0x10e1e7['where']};return db[_0x573b('0x2e')][_0x573b('0x1e')](_0x3e327d)[_0x573b('0x24')](function(_0x2a234a){_0x82f16d[_0x573b('0x1e')]=_0x2a234a;if(_0x37aacb[_0x573b('0x34')][_0x573b('0x43')]){_0x10e1e7[_0x573b('0x44')]=[{'all':!![]}];}return db[_0x573b('0x2e')][_0x573b('0x45')](_0x10e1e7);})[_0x573b('0x24')](function(_0x1d2e6c){_0x82f16d[_0x573b('0x46')]=_0x1d2e6c;return _0x82f16d;})[_0x573b('0x24')](respondWithFilteredResult(_0x277874,_0x10e1e7))['catch'](handleError(_0x277874,null));};exports['show']=function(_0x55346d,_0x6e21fa){var _0x59b947={'raw':![],'where':{'id':_0x55346d[_0x573b('0x47')]['id']}},_0x11aa0e={};_0x11aa0e[_0x573b('0x33')]=_[_0x573b('0x35')](db[_0x573b('0x2e')][_0x573b('0x2f')]);_0x11aa0e[_0x573b('0x34')]=_[_0x573b('0x35')](_0x55346d[_0x573b('0x34')]);_0x11aa0e[_0x573b('0x36')]=_[_0x573b('0x37')](_0x11aa0e[_0x573b('0x33')],_0x11aa0e[_0x573b('0x34')]);_0x59b947[_0x573b('0x38')]=_[_0x573b('0x37')](_0x11aa0e[_0x573b('0x33')],qs[_0x573b('0x39')](_0x55346d[_0x573b('0x34')][_0x573b('0x39')]));_0x59b947[_0x573b('0x38')]=_0x59b947[_0x573b('0x38')][_0x573b('0x48')]?_0x59b947[_0x573b('0x38')]:_0x11aa0e[_0x573b('0x33')];if(_0x55346d['query'][_0x573b('0x43')]){_0x59b947[_0x573b('0x44')]=[{'all':!![]}];}_0x59b947=_[_0x573b('0x41')]({},_0x59b947,_0x55346d[_0x573b('0x42')]);return db['Dashboard'][_0x573b('0x49')](_0x59b947)[_0x573b('0x24')](handleEntityNotFound(_0x6e21fa,null))[_0x573b('0x24')](respondWithResult(_0x6e21fa,null))[_0x573b('0x4a')](handleError(_0x6e21fa,null));};exports[_0x573b('0x4b')]=function(_0x529d76,_0x5bcdfa){return db[_0x573b('0x2e')]['create'](_0x529d76[_0x573b('0x4c')],{})[_0x573b('0x24')](function(_0x101a2f){var _0x1dc14a=_0x529d76[_0x573b('0x4d')]['get']({'plain':!![]});if(!_0x1dc14a)throw new Error(_0x573b('0x4e'));if(_0x1dc14a[_0x573b('0x4f')]===_0x573b('0x4d')){var _0x3e0df7=_0x101a2f['get']({'plain':!![]});var _0xf6f810='CustomDashboards';return db[_0x573b('0x50')][_0x573b('0x49')]({'where':{'name':_0xf6f810,'userProfileId':_0x1dc14a[_0x573b('0x51')]},'raw':!![]})[_0x573b('0x24')](function(_0x2eef0c){if(_0x2eef0c&&_0x2eef0c['autoAssociation']===0x0){return db[_0x573b('0x27')][_0x573b('0x4b')]({'name':_0x3e0df7[_0x573b('0x2a')],'resourceId':_0x3e0df7['id'],'type':_0x2eef0c[_0x573b('0x2a')],'sectionId':_0x2eef0c['id']},{})[_0x573b('0x24')](function(){return _0x101a2f;});}else{return _0x101a2f;}})['catch'](function(_0xdd537e){logger['error'](_0x573b('0x52'),_0xdd537e);throw _0xdd537e;});}return _0x101a2f;})[_0x573b('0x24')](respondWithResult(_0x5bcdfa,0xc9))[_0x573b('0x4a')](handleError(_0x5bcdfa,null));};exports['clone']=function(_0x510ba4,_0x2ade86){var _0x3f957f={'where':{'id':_0x510ba4[_0x573b('0x47')]['id']}},_0x38efe0={};_0x38efe0[_0x573b('0x33')]=_['keys'](db[_0x573b('0x2e')]['rawAttributes']);_0x3f957f['attributes']=_['intersection'](_0x38efe0[_0x573b('0x33')],qs[_0x573b('0x39')](_0x510ba4['query'][_0x573b('0x39')]));_0x3f957f['attributes']=_0x3f957f[_0x573b('0x38')]['length']?_0x3f957f['attributes']:_0x38efe0[_0x573b('0x33')];if(_0x510ba4[_0x573b('0x34')]['includeAll']){_0x3f957f[_0x573b('0x44')]=[{'all':!![]}];}_0x3f957f=_[_0x573b('0x41')]({},_0x3f957f,_0x510ba4[_0x573b('0x42')]);return db[_0x573b('0x2e')][_0x573b('0x49')](_0x3f957f)[_0x573b('0x24')](handleEntityNotFound(_0x2ade86,null))['then'](function(_0x4b4af7){if(_0x4b4af7){var _0xea15b4=_0x4b4af7[_0x573b('0x53')]({'plain':!![]});_0xea15b4=qs[_0x573b('0x54')](_0xea15b4,['id',_0x573b('0x55'),_0x573b('0x56')]);_0x510ba4[_0x573b('0x4c')]=_['omit'](_0x510ba4[_0x573b('0x4c')],['id',_0x573b('0x55'),_0x573b('0x56')]);return db[_0x573b('0x2e')][_0x573b('0x4b')](_[_0x573b('0x41')](_0xea15b4,_0x510ba4[_0x573b('0x4c')]),{'include':_0x510ba4[_0x573b('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x573b('0x24')](function(_0x41737d){var _0x3d44c9=_0x510ba4[_0x573b('0x4d')][_0x573b('0x53')]({'plain':!![]});if(!_0x3d44c9)throw new Error(_0x573b('0x4e'));if(_0x3d44c9['role']===_0x573b('0x4d')){var _0x1560bb=_0x41737d[_0x573b('0x53')]({'plain':!![]});var _0x21560f=_0x573b('0x26');return db[_0x573b('0x50')][_0x573b('0x49')]({'where':{'name':_0x21560f,'userProfileId':_0x3d44c9[_0x573b('0x51')]},'raw':!![]})[_0x573b('0x24')](function(_0x14b7db){if(_0x14b7db&&_0x14b7db['autoAssociation']===0x0){return db[_0x573b('0x27')][_0x573b('0x4b')]({'name':_0x1560bb[_0x573b('0x2a')],'resourceId':_0x1560bb['id'],'type':_0x14b7db[_0x573b('0x2a')],'sectionId':_0x14b7db['id']},{})[_0x573b('0x24')](function(){return _0x41737d;});}else{return _0x41737d;}})[_0x573b('0x4a')](function(_0x360f42){logger[_0x573b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x360f42);throw _0x360f42;});}return _0x41737d;});}})[_0x573b('0x24')](respondWithResult(_0x2ade86,0xc9))[_0x573b('0x4a')](handleError(_0x2ade86,null));};exports[_0x573b('0x57')]=function(_0x39d01e,_0x200c6c){if(_0x39d01e[_0x573b('0x4c')]['id']){delete _0x39d01e[_0x573b('0x4c')]['id'];}return db[_0x573b('0x2e')]['find']({'where':{'id':_0x39d01e['params']['id']}})[_0x573b('0x24')](handleEntityNotFound(_0x200c6c,null))[_0x573b('0x24')](saveUpdates(_0x39d01e[_0x573b('0x4c')],null))[_0x573b('0x24')](respondWithResult(_0x200c6c,null))[_0x573b('0x4a')](handleError(_0x200c6c,null));};exports[_0x573b('0x25')]=function(_0x36ff76,_0x2a8ffe){return db[_0x573b('0x2e')][_0x573b('0x49')]({'where':{'id':_0x36ff76[_0x573b('0x47')]['id']}})[_0x573b('0x24')](handleEntityNotFound(_0x2a8ffe,null))[_0x573b('0x24')](removeEntity(_0x2a8ffe,null))[_0x573b('0x4a')](handleError(_0x2a8ffe,null));};function widgetAttributes(_0x5cda83){try{switch(_0x5cda83['type']){case'iframe':return[{'name':_0x573b('0x58'),'value':_0x5cda83[_0x573b('0x58')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0][_0x573b('0x5a')]:undefined)||_0x573b('0x5b')}];case'custom':return[{'name':_0x573b('0x5c'),'value':_0x5cda83[_0x573b('0x5c')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83['attrs'][0x0]?_0x5cda83['attrs'][0x0]['value']:undefined)||''}];case _0x573b('0x5d'):return[{'name':'attrHourFormat','value':_0x5cda83['attrHourFormat']||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0][_0x573b('0x5a')]:undefined)||_0x573b('0x5e')},{'name':_0x573b('0x5f'),'value':_0x5cda83['attrTimezone']||(_0x5cda83['attrs']&&_0x5cda83[_0x573b('0x59')][0x1]?_0x5cda83[_0x573b('0x59')][0x1][_0x573b('0x5a')]:undefined)||_0x573b('0x60')},{'name':_0x573b('0x61'),'value':_0x5cda83[_0x573b('0x61')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x2]?_0x5cda83[_0x573b('0x59')][0x2][_0x573b('0x5a')]:undefined)||0xc}];case _0x573b('0x62'):return[{'name':_0x573b('0x63'),'value':_0x5cda83[_0x573b('0x63')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0][_0x573b('0x5a')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x5cda83[_0x573b('0x64')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x1]?_0x5cda83[_0x573b('0x59')][0x1]['value']:undefined)||[]},{'name':_0x573b('0x61'),'value':_0x5cda83[_0x573b('0x61')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x2]?_0x5cda83['attrs'][0x2]['value']:undefined)||0x14}];case _0x573b('0x65'):case _0x573b('0x66'):return[{'name':_0x573b('0x67'),'value':_0x5cda83[_0x573b('0x67')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0][_0x573b('0x5a')]:undefined)||_0x573b('0x68')},{'name':_0x573b('0x69'),'value':_0x5cda83[_0x573b('0x69')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x1]?_0x5cda83[_0x573b('0x59')][0x1][_0x573b('0x5a')]:undefined)||null},{'name':_0x573b('0x6a'),'value':_0x5cda83[_0x573b('0x6a')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x2]?_0x5cda83['attrs'][0x2][_0x573b('0x5a')]:undefined)||null},{'name':_0x573b('0x64'),'value':_0x5cda83[_0x573b('0x64')]||(_0x5cda83['attrs']&&_0x5cda83[_0x573b('0x59')][0x3]?_0x5cda83['attrs'][0x3][_0x573b('0x5a')]:undefined)||[]}];case _0x573b('0x6b'):return[{'name':'attrReport','type':_0x5cda83[_0x573b('0x6c')]||(_0x5cda83['attrs']&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0]['type']:undefined)||null,'value':_0x5cda83[_0x573b('0x6d')]||(_0x5cda83['attrs']&&_0x5cda83[_0x573b('0x59')][0x0]?_0x5cda83[_0x573b('0x59')][0x0][_0x573b('0x5a')]:undefined)||null},{'name':_0x573b('0x6e'),'value':_0x5cda83[_0x573b('0x6e')]||(_0x5cda83[_0x573b('0x59')]&&_0x5cda83[_0x573b('0x59')][0x1]?_0x5cda83['attrs'][0x1][_0x573b('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x15da3b){logger[_0x573b('0x28')](_0x573b('0x6f'),JSON[_0x573b('0x70')](_0x15da3b));return[];}}exports[_0x573b('0x71')]=function(_0x4793e7,_0x109571,_0x2ee25d){if(_0x4793e7[_0x573b('0x4c')]['id']){delete _0x4793e7['body']['id'];}return db[_0x573b('0x2e')][_0x573b('0x49')]({'where':{'id':_0x4793e7[_0x573b('0x47')]['id']}})[_0x573b('0x24')](handleEntityNotFound(_0x109571,null))[_0x573b('0x24')](function(_0x3c1123){if(_0x3c1123){_0x4793e7[_0x573b('0x4c')][_0x573b('0x72')]=_0x3c1123['id'];_0x4793e7[_0x573b('0x4c')][_0x573b('0x59')]=widgetAttributes(_0x4793e7[_0x573b('0x4c')]);return db[_0x573b('0x73')][_0x573b('0x4b')](_0x4793e7[_0x573b('0x4c')]);}})[_0x573b('0x24')](respondWithResult(_0x109571,null))[_0x573b('0x4a')](handleError(_0x109571,null));};exports[_0x573b('0x74')]=function(_0x549f75,_0x3741ee,_0x2f552e){var _0x40a11a={};var _0x5a4df1={};var _0x1b68a0;var _0x5e55f9;return db[_0x573b('0x2e')][_0x573b('0x75')]({'where':{'id':_0x549f75[_0x573b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3741ee,null))[_0x573b('0x24')](function(_0x49b603){if(_0x49b603){_0x1b68a0=_0x49b603;_0x5a4df1['model']=_[_0x573b('0x35')](db['DashboardItem'][_0x573b('0x2f')]);_0x5a4df1[_0x573b('0x34')]=_[_0x573b('0x35')](_0x549f75[_0x573b('0x34')]);_0x5a4df1[_0x573b('0x36')]=_[_0x573b('0x37')](_0x5a4df1[_0x573b('0x33')],_0x5a4df1[_0x573b('0x34')]);_0x40a11a[_0x573b('0x38')]=_[_0x573b('0x37')](_0x5a4df1[_0x573b('0x33')],qs[_0x573b('0x39')](_0x549f75[_0x573b('0x34')][_0x573b('0x39')]));_0x40a11a[_0x573b('0x38')]=_0x40a11a[_0x573b('0x38')][_0x573b('0x48')]?_0x40a11a[_0x573b('0x38')]:_0x5a4df1['model'];_0x40a11a[_0x573b('0x3d')]=qs[_0x573b('0x3e')](_0x549f75['query'][_0x573b('0x3e')]);_0x40a11a[_0x573b('0x40')]=qs[_0x573b('0x36')](_[_0x573b('0x76')](_0x549f75['query'],_0x5a4df1[_0x573b('0x36')]));if(_0x549f75['query'][_0x573b('0x3f')]){_0x40a11a['where']=_[_0x573b('0x41')](_0x40a11a['where'],{'$or':_[_0x573b('0x2d')](_0x40a11a[_0x573b('0x38')],function(_0x120e85){var _0x45c498={};_0x45c498[_0x120e85]={'$like':'%'+_0x549f75[_0x573b('0x34')][_0x573b('0x3f')]+'%'};return _0x45c498;})});}_0x40a11a=_['merge']({},_0x40a11a,_0x549f75['options']);return _0x1b68a0[_0x573b('0x74')](_0x40a11a);}})[_0x573b('0x24')](function(_0xf42fe5){if(_0xf42fe5){_0x5e55f9=_0xf42fe5[_0x573b('0x48')];if(!_0x549f75[_0x573b('0x34')][_0x573b('0x3a')](_0x573b('0x3b'))){_0x40a11a[_0x573b('0x3c')]=qs[_0x573b('0x3c')](_0x549f75[_0x573b('0x34')][_0x573b('0x3c')]);_0x40a11a['offset']=qs[_0x573b('0x1f')](_0x549f75[_0x573b('0x34')][_0x573b('0x1f')]);}return _0x1b68a0[_0x573b('0x74')](_0x40a11a);}})[_0x573b('0x24')](function(_0x298195){if(_0x298195){return _0x298195?{'count':_0x5e55f9,'rows':_0x298195}:null;}})[_0x573b('0x24')](respondWithResult(_0x3741ee,null))['catch'](handleError(_0x3741ee,null));}; \ No newline at end of file +var _0x1193=['update','then','destroy','get','CustomDashboards','error','stack','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','Dashboard','includeAll','findAll','rows','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','clone','omit','createdAt','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','DashboardId','getItems','findOne','DashboardItem','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject'];(function(_0x4a3ac8,_0x2699f8){var _0xd84d0=function(_0x574bd7){while(--_0x574bd7){_0x4a3ac8['push'](_0x4a3ac8['shift']());}};_0xd84d0(++_0x2699f8);}(_0x1193,0xcd));var _0x3119=function(_0x3ad64e,_0x3641ef){_0x3ad64e=_0x3ad64e-0x0;var _0x461f83=_0x1193[_0x3ad64e];return _0x461f83;};'use strict';var pdf=require(_0x3119('0x0'));var emlformat=require(_0x3119('0x1'));var rimraf=require(_0x3119('0x2'));var zipdir=require(_0x3119('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3119('0x4'));var moment=require(_0x3119('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3119('0x6'));var util=require(_0x3119('0x7'));var path=require(_0x3119('0x8'));var sox=require(_0x3119('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3119('0xa'));var squel=require(_0x3119('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3119('0xc'));var Papa=require(_0x3119('0xd'));var Redis=require(_0x3119('0xe'));var authService=require(_0x3119('0xf'));var qs=require(_0x3119('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3119('0x11'));var logger=require(_0x3119('0x12'))(_0x3119('0x13'));var utils=require(_0x3119('0x14'));var config=require(_0x3119('0x15'));var db=require(_0x3119('0x16'))['db'];config['redis']=_[_0x3119('0x17')](config[_0x3119('0x18')],{'host':_0x3119('0x19'),'port':0x18eb});var socket=require(_0x3119('0x1a'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x10f404,_0x3787cb){_0x3787cb=_0x3787cb||0xcc;return function(_0x4b63c1){if(_0x4b63c1){return _0x10f404[_0x3119('0x1b')](_0x3787cb);}return _0x10f404[_0x3119('0x1c')](_0x3787cb)[_0x3119('0x1d')]();};}function respondWithResult(_0x31c9e8,_0x10c1be){_0x10c1be=_0x10c1be||0xc8;return function(_0x5c64c1){if(_0x5c64c1){return _0x31c9e8[_0x3119('0x1c')](_0x10c1be)['json'](_0x5c64c1);}};}function respondWithFilteredResult(_0x113c07,_0x5e7a83){return function(_0x4b4f6b){if(_0x4b4f6b){var _0x3382e5=_0x4b4f6b[_0x3119('0x1e')],_0x17eff6=_0x5e7a83[_0x3119('0x1f')],_0x44de71=_0x5e7a83[_0x3119('0x1f')]+_0x5e7a83[_0x3119('0x20')],_0x49093b;if(_0x44de71>=_0x3382e5){_0x44de71=_0x3382e5;_0x49093b=0xc8;}else{_0x49093b=0xce;}_0x113c07[_0x3119('0x1c')](_0x49093b);return _0x113c07['set'](_0x3119('0x21'),_0x17eff6+'-'+_0x44de71+'/'+_0x3382e5)[_0x3119('0x22')](_0x4b4f6b);}return null;};}function patchUpdates(_0x1c62cd){return function(_0x522d3d){try{jsonpatch[_0x3119('0x23')](_0x522d3d,_0x1c62cd,!![]);}catch(_0x15294d){return BPromise[_0x3119('0x24')](_0x15294d);}return _0x522d3d['save']();};}function saveUpdates(_0x1ddd68,_0x5d50a4){return function(_0x819bf6){if(_0x819bf6){return _0x819bf6[_0x3119('0x25')](_0x1ddd68)[_0x3119('0x26')](function(_0x5f5c09){return _0x5f5c09;});}return null;};}function removeEntity(_0x3934dd,_0x3cfd27){return function(_0x237298){if(_0x237298){return _0x237298[_0x3119('0x27')]()['then'](function(){var _0xd2eaa8=_0x237298[_0x3119('0x28')]({'plain':!![]});var _0x2fabff=_0x3119('0x29');return db['UserProfileResource'][_0x3119('0x27')]({'where':{'type':_0x2fabff,'resourceId':_0xd2eaa8['id']}})[_0x3119('0x26')](function(){return _0x237298;});})[_0x3119('0x26')](function(){_0x3934dd[_0x3119('0x1c')](0xcc)[_0x3119('0x1d')]();});}};}function handleEntityNotFound(_0x14e23a,_0x50cf71){return function(_0x238cc3){if(!_0x238cc3){_0x14e23a[_0x3119('0x1b')](0x194);}return _0x238cc3;};}function handleError(_0x47e926,_0x44f9f5){_0x44f9f5=_0x44f9f5||0x1f4;return function(_0x4e4725){logger[_0x3119('0x2a')](_0x4e4725[_0x3119('0x2b')]);if(_0x4e4725['name']){delete _0x4e4725[_0x3119('0x2c')];}_0x47e926[_0x3119('0x1c')](_0x44f9f5)[_0x3119('0x2d')](_0x4e4725);};}exports[_0x3119('0x2e')]=function(_0x48197e,_0x57a734){var _0x370eb6={},_0x47c483={},_0xcb04f7={'count':0x0,'rows':[]};var _0xb496f3=_['map'](db['Dashboard'][_0x3119('0x2f')],function(_0x26121e){return{'name':_0x26121e['fieldName'],'type':_0x26121e['type'][_0x3119('0x30')]};});_0x47c483[_0x3119('0x31')]=_['map'](_0xb496f3,_0x3119('0x2c'));_0x47c483[_0x3119('0x32')]=_[_0x3119('0x33')](_0x48197e[_0x3119('0x32')]);_0x47c483[_0x3119('0x34')]=_['intersection'](_0x47c483['model'],_0x47c483[_0x3119('0x32')]);_0x370eb6['attributes']=_[_0x3119('0x35')](_0x47c483[_0x3119('0x31')],qs['fields'](_0x48197e[_0x3119('0x32')][_0x3119('0x36')]));_0x370eb6[_0x3119('0x37')]=_0x370eb6[_0x3119('0x37')][_0x3119('0x38')]?_0x370eb6[_0x3119('0x37')]:_0x47c483[_0x3119('0x31')];if(!_0x48197e[_0x3119('0x32')][_0x3119('0x39')](_0x3119('0x3a'))){_0x370eb6['limit']=qs['limit'](_0x48197e['query'][_0x3119('0x20')]);_0x370eb6[_0x3119('0x1f')]=qs['offset'](_0x48197e[_0x3119('0x32')][_0x3119('0x1f')]);}_0x370eb6[_0x3119('0x3b')]=qs[_0x3119('0x3c')](_0x48197e['query'][_0x3119('0x3c')]);_0x370eb6['where']=qs['filters'](_[_0x3119('0x3d')](_0x48197e[_0x3119('0x32')],_0x47c483['filters']),_0xb496f3);if(_0x48197e['query'][_0x3119('0x3e')]){_0x370eb6[_0x3119('0x3f')]=_[_0x3119('0x40')](_0x370eb6[_0x3119('0x3f')],{'$or':_[_0x3119('0x41')](_0xb496f3,function(_0x21ffd1){if(_0x21ffd1[_0x3119('0x42')]!==_0x3119('0x43')){var _0x906364={};_0x906364[_0x21ffd1[_0x3119('0x2c')]]={'$like':'%'+_0x48197e[_0x3119('0x32')][_0x3119('0x3e')]+'%'};return _0x906364;}})});}_0x370eb6=_[_0x3119('0x40')]({},_0x370eb6,_0x48197e['options']);var _0x27129d={'where':_0x370eb6['where']};return db[_0x3119('0x44')]['count'](_0x27129d)[_0x3119('0x26')](function(_0x28e74a){_0xcb04f7[_0x3119('0x1e')]=_0x28e74a;if(_0x48197e[_0x3119('0x32')][_0x3119('0x45')]){_0x370eb6['include']=[{'all':!![]}];}return db[_0x3119('0x44')][_0x3119('0x46')](_0x370eb6);})[_0x3119('0x26')](function(_0x3e3159){_0xcb04f7[_0x3119('0x47')]=_0x3e3159;return _0xcb04f7;})[_0x3119('0x26')](respondWithFilteredResult(_0x57a734,_0x370eb6))['catch'](handleError(_0x57a734,null));};exports[_0x3119('0x48')]=function(_0xefbb0d,_0x3915c8){var _0xf65160={'raw':![],'where':{'id':_0xefbb0d[_0x3119('0x49')]['id']}},_0xce943c={};_0xce943c[_0x3119('0x31')]=_[_0x3119('0x33')](db[_0x3119('0x44')][_0x3119('0x2f')]);_0xce943c[_0x3119('0x32')]=_['keys'](_0xefbb0d[_0x3119('0x32')]);_0xce943c['filters']=_[_0x3119('0x35')](_0xce943c[_0x3119('0x31')],_0xce943c[_0x3119('0x32')]);_0xf65160['attributes']=_['intersection'](_0xce943c['model'],qs[_0x3119('0x36')](_0xefbb0d[_0x3119('0x32')][_0x3119('0x36')]));_0xf65160[_0x3119('0x37')]=_0xf65160[_0x3119('0x37')]['length']?_0xf65160[_0x3119('0x37')]:_0xce943c['model'];if(_0xefbb0d['query'][_0x3119('0x45')]){_0xf65160[_0x3119('0x4a')]=[{'all':!![]}];}_0xf65160=_[_0x3119('0x40')]({},_0xf65160,_0xefbb0d[_0x3119('0x4b')]);return db[_0x3119('0x44')][_0x3119('0x4c')](_0xf65160)['then'](handleEntityNotFound(_0x3915c8,null))[_0x3119('0x26')](respondWithResult(_0x3915c8,null))['catch'](handleError(_0x3915c8,null));};exports[_0x3119('0x4d')]=function(_0x18dc94,_0x7ed69a){return db[_0x3119('0x44')]['create'](_0x18dc94[_0x3119('0x4e')],{})[_0x3119('0x26')](function(_0x543780){var _0xf1da94=_0x18dc94[_0x3119('0x4f')][_0x3119('0x28')]({'plain':!![]});if(!_0xf1da94)throw new Error(_0x3119('0x50'));if(_0xf1da94[_0x3119('0x51')]===_0x3119('0x4f')){var _0x25db96=_0x543780[_0x3119('0x28')]({'plain':!![]});var _0x50d8d8=_0x3119('0x29');return db[_0x3119('0x52')]['find']({'where':{'name':_0x50d8d8,'userProfileId':_0xf1da94[_0x3119('0x53')]},'raw':!![]})[_0x3119('0x26')](function(_0x2b9f0b){if(_0x2b9f0b&&_0x2b9f0b['autoAssociation']===0x0){return db['UserProfileResource'][_0x3119('0x4d')]({'name':_0x25db96[_0x3119('0x2c')],'resourceId':_0x25db96['id'],'type':_0x2b9f0b['name'],'sectionId':_0x2b9f0b['id']},{})[_0x3119('0x26')](function(){return _0x543780;});}else{return _0x543780;}})[_0x3119('0x54')](function(_0x236a3a){logger[_0x3119('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x236a3a);throw _0x236a3a;});}return _0x543780;})[_0x3119('0x26')](respondWithResult(_0x7ed69a,0xc9))[_0x3119('0x54')](handleError(_0x7ed69a,null));};exports[_0x3119('0x55')]=function(_0x83751e,_0x43c2df){var _0x304f5e={'where':{'id':_0x83751e['params']['id']}},_0x1eef85={};_0x1eef85[_0x3119('0x31')]=_[_0x3119('0x33')](db[_0x3119('0x44')][_0x3119('0x2f')]);_0x304f5e[_0x3119('0x37')]=_[_0x3119('0x35')](_0x1eef85[_0x3119('0x31')],qs[_0x3119('0x36')](_0x83751e[_0x3119('0x32')][_0x3119('0x36')]));_0x304f5e[_0x3119('0x37')]=_0x304f5e[_0x3119('0x37')]['length']?_0x304f5e['attributes']:_0x1eef85['model'];if(_0x83751e[_0x3119('0x32')][_0x3119('0x45')]){_0x304f5e[_0x3119('0x4a')]=[{'all':!![]}];}_0x304f5e=_[_0x3119('0x40')]({},_0x304f5e,_0x83751e[_0x3119('0x4b')]);return db[_0x3119('0x44')][_0x3119('0x4c')](_0x304f5e)[_0x3119('0x26')](handleEntityNotFound(_0x43c2df,null))['then'](function(_0x1c76b3){if(_0x1c76b3){var _0x5bac3e=_0x1c76b3[_0x3119('0x28')]({'plain':!![]});_0x5bac3e=qs[_0x3119('0x56')](_0x5bac3e,['id',_0x3119('0x57'),'updatedAt']);_0x83751e[_0x3119('0x4e')]=_[_0x3119('0x56')](_0x83751e['body'],['id','createdAt','updatedAt']);return db['Dashboard'][_0x3119('0x4d')](_['merge'](_0x5bac3e,_0x83751e[_0x3119('0x4e')]),{'include':_0x83751e['query'][_0x3119('0x45')]?[{'all':!![]}]:undefined})[_0x3119('0x26')](function(_0x1d5ff5){var _0x7b43d9=_0x83751e[_0x3119('0x4f')]['get']({'plain':!![]});if(!_0x7b43d9)throw new Error(_0x3119('0x50'));if(_0x7b43d9['role']===_0x3119('0x4f')){var _0x530cc7=_0x1d5ff5[_0x3119('0x28')]({'plain':!![]});var _0x56ce08=_0x3119('0x29');return db[_0x3119('0x52')][_0x3119('0x4c')]({'where':{'name':_0x56ce08,'userProfileId':_0x7b43d9[_0x3119('0x53')]},'raw':!![]})[_0x3119('0x26')](function(_0x4d1344){if(_0x4d1344&&_0x4d1344[_0x3119('0x58')]===0x0){return db[_0x3119('0x59')][_0x3119('0x4d')]({'name':_0x530cc7['name'],'resourceId':_0x530cc7['id'],'type':_0x4d1344[_0x3119('0x2c')],'sectionId':_0x4d1344['id']},{})[_0x3119('0x26')](function(){return _0x1d5ff5;});}else{return _0x1d5ff5;}})[_0x3119('0x54')](function(_0x45fb1c){logger['error'](_0x3119('0x5a'),_0x45fb1c);throw _0x45fb1c;});}return _0x1d5ff5;});}})['then'](respondWithResult(_0x43c2df,0xc9))['catch'](handleError(_0x43c2df,null));};exports[_0x3119('0x25')]=function(_0x30f851,_0x3f00c9){if(_0x30f851[_0x3119('0x4e')]['id']){delete _0x30f851['body']['id'];}return db[_0x3119('0x44')][_0x3119('0x4c')]({'where':{'id':_0x30f851[_0x3119('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f00c9,null))[_0x3119('0x26')](saveUpdates(_0x30f851[_0x3119('0x4e')],null))['then'](respondWithResult(_0x3f00c9,null))[_0x3119('0x54')](handleError(_0x3f00c9,null));};exports['destroy']=function(_0x495f9a,_0x15326d){return db[_0x3119('0x44')][_0x3119('0x4c')]({'where':{'id':_0x495f9a[_0x3119('0x49')]['id']}})[_0x3119('0x26')](handleEntityNotFound(_0x15326d,null))[_0x3119('0x26')](removeEntity(_0x15326d,null))['catch'](handleError(_0x15326d,null));};function widgetAttributes(_0x207e20){try{switch(_0x207e20[_0x3119('0x42')]){case'iframe':return[{'name':_0x3119('0x5b'),'value':_0x207e20['attrUrl']||(_0x207e20[_0x3119('0x5c')]&&_0x207e20[_0x3119('0x5c')][0x0]?_0x207e20['attrs'][0x0][_0x3119('0x5d')]:undefined)||_0x3119('0x5e')}];case _0x3119('0x5f'):return[{'name':_0x3119('0x60'),'value':_0x207e20[_0x3119('0x60')]||(_0x207e20['attrs']&&_0x207e20[_0x3119('0x5c')][0x0]?_0x207e20[_0x3119('0x5c')][0x0][_0x3119('0x5d')]:undefined)||''}];case _0x3119('0x61'):return[{'name':_0x3119('0x62'),'value':_0x207e20[_0x3119('0x62')]||(_0x207e20[_0x3119('0x5c')]&&_0x207e20[_0x3119('0x5c')][0x0]?_0x207e20[_0x3119('0x5c')][0x0][_0x3119('0x5d')]:undefined)||_0x3119('0x63')},{'name':_0x3119('0x64'),'value':_0x207e20[_0x3119('0x64')]||(_0x207e20[_0x3119('0x5c')]&&_0x207e20[_0x3119('0x5c')][0x1]?_0x207e20[_0x3119('0x5c')][0x1][_0x3119('0x5d')]:undefined)||_0x3119('0x65')},{'name':_0x3119('0x66'),'value':_0x207e20[_0x3119('0x66')]||(_0x207e20['attrs']&&_0x207e20['attrs'][0x2]?_0x207e20[_0x3119('0x5c')][0x2][_0x3119('0x5d')]:undefined)||0xc}];case _0x3119('0x67'):return[{'name':_0x3119('0x68'),'value':_0x207e20[_0x3119('0x68')]||(_0x207e20['attrs']&&_0x207e20['attrs'][0x0]?_0x207e20['attrs'][0x0][_0x3119('0x5d')]:undefined)||_0x3119('0x69')},{'name':'attrVoiceQueues','value':_0x207e20[_0x3119('0x6a')]||(_0x207e20['attrs']&&_0x207e20[_0x3119('0x5c')][0x1]?_0x207e20[_0x3119('0x5c')][0x1][_0x3119('0x5d')]:undefined)||[]},{'name':_0x3119('0x66'),'value':_0x207e20['attrFontSize']||(_0x207e20[_0x3119('0x5c')]&&_0x207e20['attrs'][0x2]?_0x207e20[_0x3119('0x5c')][0x2][_0x3119('0x5d')]:undefined)||0x14}];case _0x3119('0x6b'):case _0x3119('0x6c'):return[{'name':_0x3119('0x6d'),'value':_0x207e20[_0x3119('0x6d')]||(_0x207e20[_0x3119('0x5c')]&&_0x207e20[_0x3119('0x5c')][0x0]?_0x207e20[_0x3119('0x5c')][0x0][_0x3119('0x5d')]:undefined)||_0x3119('0x69')},{'name':_0x3119('0x6e'),'value':_0x207e20[_0x3119('0x6e')]||(_0x207e20[_0x3119('0x5c')]&&_0x207e20[_0x3119('0x5c')][0x1]?_0x207e20[_0x3119('0x5c')][0x1][_0x3119('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x207e20[_0x3119('0x6f')]||(_0x207e20['attrs']&&_0x207e20['attrs'][0x2]?_0x207e20[_0x3119('0x5c')][0x2][_0x3119('0x5d')]:undefined)||null},{'name':_0x3119('0x6a'),'value':_0x207e20[_0x3119('0x6a')]||(_0x207e20['attrs']&&_0x207e20[_0x3119('0x5c')][0x3]?_0x207e20[_0x3119('0x5c')][0x3][_0x3119('0x5d')]:undefined)||[]}];case _0x3119('0x70'):return[{'name':'attrReport','type':_0x207e20[_0x3119('0x71')]||(_0x207e20[_0x3119('0x5c')]&&_0x207e20['attrs'][0x0]?_0x207e20[_0x3119('0x5c')][0x0][_0x3119('0x42')]:undefined)||null,'value':_0x207e20[_0x3119('0x72')]||(_0x207e20['attrs']&&_0x207e20[_0x3119('0x5c')][0x0]?_0x207e20[_0x3119('0x5c')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x207e20[_0x3119('0x73')]||(_0x207e20['attrs']&&_0x207e20[_0x3119('0x5c')][0x1]?_0x207e20[_0x3119('0x5c')][0x1][_0x3119('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x37be01){logger[_0x3119('0x2a')]('widgetAttributes:\x20%s',JSON[_0x3119('0x74')](_0x37be01));return[];}}exports['addItem']=function(_0xd58eb4,_0x39d050,_0x2b9d32){if(_0xd58eb4[_0x3119('0x4e')]['id']){delete _0xd58eb4['body']['id'];}return db['Dashboard'][_0x3119('0x4c')]({'where':{'id':_0xd58eb4[_0x3119('0x49')]['id']}})[_0x3119('0x26')](handleEntityNotFound(_0x39d050,null))[_0x3119('0x26')](function(_0xccaa47){if(_0xccaa47){_0xd58eb4[_0x3119('0x4e')][_0x3119('0x75')]=_0xccaa47['id'];_0xd58eb4['body'][_0x3119('0x5c')]=widgetAttributes(_0xd58eb4[_0x3119('0x4e')]);return db['DashboardItem']['create'](_0xd58eb4[_0x3119('0x4e')]);}})[_0x3119('0x26')](respondWithResult(_0x39d050,null))['catch'](handleError(_0x39d050,null));};exports[_0x3119('0x76')]=function(_0x2d2f76,_0x52822f,_0x1dd78b){var _0x240933={};var _0x15832b={};var _0x15569e;var _0x5bc149;return db[_0x3119('0x44')][_0x3119('0x77')]({'where':{'id':_0x2d2f76[_0x3119('0x49')]['id']}})['then'](handleEntityNotFound(_0x52822f,null))['then'](function(_0x56c269){if(_0x56c269){_0x15569e=_0x56c269;_0x15832b[_0x3119('0x31')]=_['keys'](db[_0x3119('0x78')][_0x3119('0x2f')]);_0x15832b[_0x3119('0x32')]=_[_0x3119('0x33')](_0x2d2f76[_0x3119('0x32')]);_0x15832b[_0x3119('0x34')]=_[_0x3119('0x35')](_0x15832b[_0x3119('0x31')],_0x15832b['query']);_0x240933['attributes']=_[_0x3119('0x35')](_0x15832b[_0x3119('0x31')],qs['fields'](_0x2d2f76[_0x3119('0x32')][_0x3119('0x36')]));_0x240933[_0x3119('0x37')]=_0x240933[_0x3119('0x37')][_0x3119('0x38')]?_0x240933[_0x3119('0x37')]:_0x15832b[_0x3119('0x31')];_0x240933['order']=qs[_0x3119('0x3c')](_0x2d2f76[_0x3119('0x32')][_0x3119('0x3c')]);_0x240933['where']=qs[_0x3119('0x34')](_[_0x3119('0x3d')](_0x2d2f76[_0x3119('0x32')],_0x15832b[_0x3119('0x34')]));if(_0x2d2f76[_0x3119('0x32')][_0x3119('0x3e')]){_0x240933[_0x3119('0x3f')]=_[_0x3119('0x40')](_0x240933['where'],{'$or':_[_0x3119('0x41')](_0x240933[_0x3119('0x37')],function(_0x1958d4){var _0x3d59a4={};_0x3d59a4[_0x1958d4]={'$like':'%'+_0x2d2f76['query']['filter']+'%'};return _0x3d59a4;})});}_0x240933=_[_0x3119('0x40')]({},_0x240933,_0x2d2f76['options']);return _0x15569e[_0x3119('0x76')](_0x240933);}})[_0x3119('0x26')](function(_0x425443){if(_0x425443){_0x5bc149=_0x425443[_0x3119('0x38')];if(!_0x2d2f76[_0x3119('0x32')][_0x3119('0x39')]('nolimit')){_0x240933[_0x3119('0x20')]=qs['limit'](_0x2d2f76[_0x3119('0x32')][_0x3119('0x20')]);_0x240933['offset']=qs[_0x3119('0x1f')](_0x2d2f76[_0x3119('0x32')][_0x3119('0x1f')]);}return _0x15569e['getItems'](_0x240933);}})[_0x3119('0x26')](function(_0x2229eb){if(_0x2229eb){return _0x2229eb?{'count':_0x5bc149,'rows':_0x2229eb}:null;}})['then'](respondWithResult(_0x52822f,null))[_0x3119('0x54')](handleError(_0x52822f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 0800c18..ed0d5ff 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 _0x406f=['exports','events','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x406f,0x78));var _0xf406=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x406f[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xf406('0x0'));var Dashboard=require(_0xf406('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf406('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf406('0x3')};function emitEvent(_0x396903){return function(_0x15f78f,_0x1661ae,_0x1af7b5){DashboardEvents[_0xf406('0x4')](_0x396903+':'+_0x15f78f['id'],_0x15f78f);DashboardEvents[_0xf406('0x4')](_0x396903,_0x15f78f);_0x1af7b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xf406('0x5')](e,emitEvent(event));}}module[_0xf406('0x6')]=DashboardEvents; \ No newline at end of file +var _0xffc5=['Dashboard','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffc5,0x1bf));var _0x5ffc=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xffc5[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x5ffc('0x0'))['db'][_0x5ffc('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ffc('0x2'),'afterDestroy':_0x5ffc('0x3')};function emitEvent(_0x1a1e8f){return function(_0x1785c8,_0x58d4c2,_0x552532){DashboardEvents[_0x5ffc('0x4')](_0x1a1e8f+':'+_0x1785c8['id'],_0x1785c8);DashboardEvents[_0x5ffc('0x4')](_0x1a1e8f,_0x1785c8);_0x552532(null);};}for(var e in events){if(events[_0x5ffc('0x5')](e)){var event=events[e];Dashboard[_0x5ffc('0x6')](e,emitEvent(event));}}module[_0x5ffc('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5ecb590..14c63f0 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 _0xc3dc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util'];(function(_0x3a77ce,_0x486ee8){var _0xe885c7=function(_0x5a8ae0){while(--_0x5a8ae0){_0x3a77ce['push'](_0x3a77ce['shift']());}};_0xe885c7(++_0x486ee8);}(_0xc3dc,0x186));var _0xcc3d=function(_0x1a9b87,_0x4b9987){_0x1a9b87=_0x1a9b87-0x0;var _0x3e5a50=_0xc3dc[_0x1a9b87];return _0x3e5a50;};'use strict';var _=require(_0xcc3d('0x0'));var util=require(_0xcc3d('0x1'));var logger=require(_0xcc3d('0x2'))(_0xcc3d('0x3'));var moment=require(_0xcc3d('0x4'));var BPromise=require(_0xcc3d('0x5'));var rp=require(_0xcc3d('0x6'));var fs=require('fs');var path=require(_0xcc3d('0x7'));var rimraf=require(_0xcc3d('0x8'));var config=require(_0xcc3d('0x9'));var attributes=require(_0xcc3d('0xa'));module[_0xcc3d('0xb')]=function(_0x253156,_0x4cd3a7){return _0x253156['define'](_0xcc3d('0xc'),attributes,{'tableName':_0xcc3d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cf5=['lodash','util','../../config/logger','api','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7cf5,0x82));var _0x57cf=function(_0x199de6,_0x54e5e3){_0x199de6=_0x199de6-0x0;var _0xbae868=_0x7cf5[_0x199de6];return _0xbae868;};'use strict';var _=require(_0x57cf('0x0'));var util=require(_0x57cf('0x1'));var logger=require(_0x57cf('0x2'))(_0x57cf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x57cf('0x4'));var rimraf=require('rimraf');var config=require(_0x57cf('0x5'));var attributes=require(_0x57cf('0x6'));module[_0x57cf('0x7')]=function(_0x47a03b,_0x8cd73e){return _0x47a03b[_0x57cf('0x8')](_0x57cf('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 44ab8e0..4ffbb52 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 _0x6981=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','then'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x6981,0x14d));var _0x1698=function(_0x2dca4e,_0x44f614){_0x2dca4e=_0x2dca4e-0x0;var _0x32fb16=_0x6981[_0x2dca4e];return _0x32fb16;};'use strict';var _=require(_0x1698('0x0'));var util=require(_0x1698('0x1'));var moment=require(_0x1698('0x2'));var BPromise=require(_0x1698('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1698('0x4'));var db=require(_0x1698('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1698('0x6'))(_0x1698('0x7'));var config=require(_0x1698('0x8'));var jayson=require(_0x1698('0x9'));var client=jayson[_0x1698('0xa')][_0x1698('0xb')]({'port':0x232a});config[_0x1698('0xc')]=_['defaults'](config[_0x1698('0xc')],{'host':_0x1698('0xd'),'port':0x18eb});var socket=require(_0x1698('0xe'))(new Redis(config[_0x1698('0xc')]));require(_0x1698('0xf'))[_0x1698('0x10')](socket);function respondWithRpcPromise(_0x33ff3b,_0x237884,_0x926653){return new BPromise(function(_0x2ca130,_0x28e9e8){return client['request'](_0x33ff3b,_0x926653)[_0x1698('0x11')](function(_0x292d9a){logger['info'](_0x1698('0x12'),_0x237884,_0x1698('0x13'));logger[_0x1698('0x14')](_0x1698('0x15'),_0x237884,'request\x20sent',JSON[_0x1698('0x16')](_0x292d9a));if(_0x292d9a[_0x1698('0x17')]){if(_0x292d9a[_0x1698('0x17')][_0x1698('0x18')]===0x1f4){logger[_0x1698('0x17')](_0x1698('0x12'),_0x237884,_0x292d9a[_0x1698('0x17')][_0x1698('0x19')]);return _0x28e9e8(_0x292d9a['error'][_0x1698('0x19')]);}logger[_0x1698('0x17')](_0x1698('0x12'),_0x237884,_0x292d9a[_0x1698('0x17')][_0x1698('0x19')]);return _0x2ca130(_0x292d9a['error'][_0x1698('0x19')]);}else{logger[_0x1698('0x1a')]('Dashboard,\x20%s,\x20%s',_0x237884,_0x1698('0x13'));_0x2ca130(_0x292d9a['result']['message']);}})['catch'](function(_0x575c64){logger[_0x1698('0x17')](_0x1698('0x12'),_0x237884,_0x575c64);_0x28e9e8(_0x575c64);});});} \ No newline at end of file +var _0xea44=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25c019,_0xd5a5b8){var _0x41950d=function(_0x53381f){while(--_0x53381f){_0x25c019['push'](_0x25c019['shift']());}};_0x41950d(++_0xd5a5b8);}(_0xea44,0x1a5));var _0x4ea4=function(_0x5e8ec8,_0x2dd32b){_0x5e8ec8=_0x5e8ec8-0x0;var _0x287b71=_0xea44[_0x5e8ec8];return _0x287b71;};'use strict';var _=require(_0x4ea4('0x0'));var util=require(_0x4ea4('0x1'));var moment=require(_0x4ea4('0x2'));var BPromise=require(_0x4ea4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ea4('0x4'));var db=require(_0x4ea4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4ea4('0x6'))(_0x4ea4('0x7'));var config=require(_0x4ea4('0x8'));var jayson=require(_0x4ea4('0x9'));var client=jayson['client'][_0x4ea4('0xa')]({'port':0x232a});config[_0x4ea4('0xb')]=_[_0x4ea4('0xc')](config[_0x4ea4('0xb')],{'host':_0x4ea4('0xd'),'port':0x18eb});var socket=require(_0x4ea4('0xe'))(new Redis(config[_0x4ea4('0xb')]));require(_0x4ea4('0xf'))[_0x4ea4('0x10')](socket);function respondWithRpcPromise(_0x4904a4,_0x333358,_0x56654d){return new BPromise(function(_0x4b6df1,_0x42732c){return client['request'](_0x4904a4,_0x56654d)[_0x4ea4('0x11')](function(_0x379914){logger[_0x4ea4('0x12')](_0x4ea4('0x13'),_0x333358,_0x4ea4('0x14'));logger[_0x4ea4('0x15')](_0x4ea4('0x16'),_0x333358,_0x4ea4('0x14'),JSON[_0x4ea4('0x17')](_0x379914));if(_0x379914[_0x4ea4('0x18')]){if(_0x379914[_0x4ea4('0x18')][_0x4ea4('0x19')]===0x1f4){logger[_0x4ea4('0x18')](_0x4ea4('0x13'),_0x333358,_0x379914['error'][_0x4ea4('0x1a')]);return _0x42732c(_0x379914[_0x4ea4('0x18')][_0x4ea4('0x1a')]);}logger[_0x4ea4('0x18')](_0x4ea4('0x13'),_0x333358,_0x379914[_0x4ea4('0x18')]['message']);return _0x4b6df1(_0x379914[_0x4ea4('0x18')]['message']);}else{logger['info'](_0x4ea4('0x13'),_0x333358,_0x4ea4('0x14'));_0x4b6df1(_0x379914['result'][_0x4ea4('0x1a')]);}})[_0x4ea4('0x1b')](function(_0x47e44c){logger[_0x4ea4('0x18')](_0x4ea4('0x13'),_0x333358,_0x47e44c);_0x42732c(_0x47e44c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index eba142a..6098a71 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 _0x7483=['remove','emit','length','dashboard:','save'];(function(_0x56e37e,_0x5c595d){var _0x56b462=function(_0x1495d6){while(--_0x1495d6){_0x56e37e['push'](_0x56e37e['shift']());}};_0x56b462(++_0x5c595d);}(_0x7483,0x1d0));var _0x3748=function(_0x1795bc,_0x7d89f6){_0x1795bc=_0x1795bc-0x0;var _0x9c9519=_0x7483[_0x1795bc];return _0x9c9519;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x3748('0x0'),_0x3748('0x1'),'update'];function createListener(_0x2c5a79,_0x1966a6){return function(_0x5c6507){_0x1966a6[_0x3748('0x2')](_0x2c5a79,_0x5c6507);};}function removeListener(_0x43b104,_0x2e0857){return function(){DashboardEvents['removeListener'](_0x43b104,_0x2e0857);};}exports['register']=function(_0x4c7712){for(var _0x3f5b69=0x0,_0x5717b5=events[_0x3748('0x3')];_0x3f5b69<_0x5717b5;_0x3f5b69++){var _0x442038=events[_0x3f5b69];var _0x1b2efa=createListener(_0x3748('0x4')+_0x442038,_0x4c7712);DashboardEvents['on'](_0x442038,_0x1b2efa);}}; \ No newline at end of file +var _0x3eeb=['update','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x3eeb,0x98));var _0xb3ee=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3eeb[_0x6131cd];return _0x47e916;};'use strict';var DashboardEvents=require(_0xb3ee('0x0'));var events=[_0xb3ee('0x1'),'remove',_0xb3ee('0x2')];function createListener(_0x131d70,_0x3058cf){return function(_0x5f41c1){_0x3058cf['emit'](_0x131d70,_0x5f41c1);};}function removeListener(_0x170b59,_0x45cb73){return function(){DashboardEvents[_0xb3ee('0x3')](_0x170b59,_0x45cb73);};}exports[_0xb3ee('0x4')]=function(_0x222193){for(var _0x533855=0x0,_0x1eccfc=events[_0xb3ee('0x5')];_0x533855<_0x1eccfc;_0x533855++){var _0x462b4d=events[_0x533855];var _0x3f7dea=createListener(_0xb3ee('0x6')+_0x462b4d,_0x222193);DashboardEvents['on'](_0x462b4d,_0x3f7dea);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index cccd2d5..cff152a 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(_0x379172,_0x16ae4e){var _0x49ee77=function(_0x45dbc7){while(--_0x45dbc7){_0x379172['push'](_0x379172['shift']());}};_0x49ee77(++_0x16ae4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x1b642d,_0x4e8eb0){var _0x7c508a=function(_0xab3358){while(--_0xab3358){_0x1b642d['push'](_0x1b642d['shift']());}};_0x7c508a(++_0x4e8eb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 2d28fad..fbd578a 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 _0x1bc3=['getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','lodash','exports','STRING','TEXT','parse'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x1bc3,0x7e));var _0x31bc=function(_0x4c26ea,_0x37e307){_0x4c26ea=_0x4c26ea-0x0;var _0x3b3a39=_0x1bc3[_0x4c26ea];return _0x3b3a39;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x31bc('0x0'));var _=require(_0x31bc('0x1'));module[_0x31bc('0x2')]={'title':{'type':Sequelize[_0x31bc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x31bc('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x31bc('0x4')]('long'),'get':function(){try{return JSON[_0x31bc('0x5')](this[_0x31bc('0x6')](_0x31bc('0x7')));}catch(_0x39b0e0){return[];}},'set':function(_0x53d84c){try{this[_0x31bc('0x8')]('attrs',JSON[_0x31bc('0x9')](_0x53d84c));}catch(_0x42acf5){this[_0x31bc('0x8')](_0x31bc('0x7'),JSON[_0x31bc('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x31bc('0xa')]},'col':{'type':Sequelize[_0x31bc('0xa')]},'background':{'type':Sequelize[_0x31bc('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x31bc('0x3')],'allowNull':![],'defaultValue':_0x31bc('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x31bc('0x3')]}}; \ No newline at end of file +var _0xc585=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash','STRING','TEXT','long','parse'];(function(_0x4d9f7a,_0x5785fc){var _0x2d6c25=function(_0x1a8ccd){while(--_0x1a8ccd){_0x4d9f7a['push'](_0x4d9f7a['shift']());}};_0x2d6c25(++_0x5785fc);}(_0xc585,0xf7));var _0x5c58=function(_0x150df4,_0x2a9950){_0x150df4=_0x150df4-0x0;var _0x141103=_0xc585[_0x150df4];return _0x141103;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x5c58('0x0'));module['exports']={'title':{'type':Sequelize[_0x5c58('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5c58('0x2')](_0x5c58('0x3')),'get':function(){try{return JSON[_0x5c58('0x4')](this[_0x5c58('0x5')](_0x5c58('0x6')));}catch(_0x4b988b){return[];}},'set':function(_0x3172fe){try{this[_0x5c58('0x7')](_0x5c58('0x6'),JSON[_0x5c58('0x8')](_0x3172fe));}catch(_0x394343){this[_0x5c58('0x7')](_0x5c58('0x6'),JSON[_0x5c58('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5c58('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5c58('0x9')]},'col':{'type':Sequelize[_0x5c58('0x9')]},'background':{'type':Sequelize[_0x5c58('0x1')],'allowNull':![],'defaultValue':_0x5c58('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5c58('0x1')],'allowNull':![],'defaultValue':_0x5c58('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5c58('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 0ca60df..922cc32 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 _0x31a2=['localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','catch','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x86f0fb,_0xdc2f14){var _0x3e71c6=function(_0x4efcf3){while(--_0x4efcf3){_0x86f0fb['push'](_0x86f0fb['shift']());}};_0x3e71c6(++_0xdc2f14);}(_0x31a2,0x96));var _0x231a=function(_0x482cbd,_0x3862f3){_0x482cbd=_0x482cbd-0x0;var _0x27d8b0=_0x31a2[_0x482cbd];return _0x27d8b0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x231a('0x0'));var rimraf=require(_0x231a('0x1'));var zipdir=require(_0x231a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x231a('0x3'));var moment=require(_0x231a('0x4'));var BPromise=require(_0x231a('0x5'));var Mustache=require(_0x231a('0x6'));var util=require(_0x231a('0x7'));var path=require(_0x231a('0x8'));var sox=require(_0x231a('0x9'));var csv=require(_0x231a('0xa'));var ejs=require(_0x231a('0xb'));var fs=require('fs');var _=require(_0x231a('0xc'));var squel=require(_0x231a('0xd'));var crypto=require(_0x231a('0xe'));var jsforce=require(_0x231a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x231a('0x10'));var Papa=require(_0x231a('0x11'));var Redis=require(_0x231a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x231a('0x13'));var as=require(_0x231a('0x14'));var hardwareService=require(_0x231a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x231a('0x16'));var config=require(_0x231a('0x17'));var db=require(_0x231a('0x18'))['db'];config[_0x231a('0x19')]=_['defaults'](config[_0x231a('0x19')],{'host':_0x231a('0x1a'),'port':0x18eb});var socket=require(_0x231a('0x1b'))(new Redis(config[_0x231a('0x19')]));require(_0x231a('0x1c'))[_0x231a('0x1d')](socket);function respondWithStatusCode(_0x43f152,_0x2d7cd1){_0x2d7cd1=_0x2d7cd1||0xcc;return function(_0x1abead){if(_0x1abead){return _0x43f152[_0x231a('0x1e')](_0x2d7cd1);}return _0x43f152['status'](_0x2d7cd1)[_0x231a('0x1f')]();};}function respondWithResult(_0x3a9f6f,_0xe35fb2){_0xe35fb2=_0xe35fb2||0xc8;return function(_0x5d4013){if(_0x5d4013){return _0x3a9f6f[_0x231a('0x20')](_0xe35fb2)[_0x231a('0x21')](_0x5d4013);}};}function respondWithFilteredResult(_0x33ebf6,_0x269b79){return function(_0x2ff571){if(_0x2ff571){var _0x555480=_0x2ff571[_0x231a('0x22')],_0x413706=_0x269b79[_0x231a('0x23')],_0x2d54d6=_0x269b79[_0x231a('0x23')]+_0x269b79[_0x231a('0x24')],_0x34ebb3;if(_0x2d54d6>=_0x555480){_0x2d54d6=_0x555480;_0x34ebb3=0xc8;}else{_0x34ebb3=0xce;}_0x33ebf6['status'](_0x34ebb3);return _0x33ebf6[_0x231a('0x25')](_0x231a('0x26'),_0x413706+'-'+_0x2d54d6+'/'+_0x555480)['json'](_0x2ff571);}return null;};}function patchUpdates(_0x26d6cc){return function(_0x3b209c){try{jsonpatch['apply'](_0x3b209c,_0x26d6cc,!![]);}catch(_0x3bbb61){return BPromise[_0x231a('0x27')](_0x3bbb61);}return _0x3b209c[_0x231a('0x28')]();};}function saveUpdates(_0x3a776b,_0x589298){return function(_0x4d9548){if(_0x4d9548){return _0x4d9548['update'](_0x3a776b)[_0x231a('0x29')](function(_0x30782d){return _0x30782d;});}return null;};}function removeEntity(_0x40bf4c,_0x5a4247){return function(_0x182043){if(_0x182043){return _0x182043[_0x231a('0x2a')]()['then'](function(){_0x40bf4c['status'](0xcc)[_0x231a('0x1f')]();});}};}function handleEntityNotFound(_0x305380,_0x15f9df){return function(_0x48c9aa){if(!_0x48c9aa){_0x305380[_0x231a('0x1e')](0x194);}return _0x48c9aa;};}function handleError(_0x336783,_0x5ea1ae){_0x5ea1ae=_0x5ea1ae||0x1f4;return function(_0xf9da82){logger[_0x231a('0x2b')](_0xf9da82[_0x231a('0x2c')]);if(_0xf9da82[_0x231a('0x2d')]){delete _0xf9da82['name'];}_0x336783[_0x231a('0x20')](_0x5ea1ae)['send'](_0xf9da82);};}exports[_0x231a('0x2e')]=function(_0x4b719b,_0x417096){var _0x32c655={'raw':![],'where':{'id':_0x4b719b[_0x231a('0x2f')]['id']}},_0x11c850={};_0x11c850[_0x231a('0x30')]=_[_0x231a('0x31')](db[_0x231a('0x32')][_0x231a('0x33')]);_0x11c850[_0x231a('0x34')]=_[_0x231a('0x31')](_0x4b719b[_0x231a('0x34')]);_0x11c850['filters']=_[_0x231a('0x35')](_0x11c850[_0x231a('0x30')],_0x11c850[_0x231a('0x34')]);_0x32c655[_0x231a('0x36')]=_[_0x231a('0x35')](_0x11c850[_0x231a('0x30')],qs[_0x231a('0x37')](_0x4b719b['query'][_0x231a('0x37')]));_0x32c655[_0x231a('0x36')]=_0x32c655['attributes'][_0x231a('0x38')]?_0x32c655[_0x231a('0x36')]:_0x11c850[_0x231a('0x30')];if(_0x4b719b[_0x231a('0x34')][_0x231a('0x39')]){_0x32c655[_0x231a('0x3a')]=[{'all':!![]}];}_0x32c655=_[_0x231a('0x3b')]({},_0x32c655,_0x4b719b[_0x231a('0x3c')]);return db['DashboardItem']['find'](_0x32c655)['then'](handleEntityNotFound(_0x417096,null))[_0x231a('0x29')](respondWithResult(_0x417096,null))['catch'](handleError(_0x417096,null));};exports['destroy']=function(_0x2a7356,_0x1f8756){return db[_0x231a('0x32')]['find']({'where':{'id':_0x2a7356[_0x231a('0x2f')]['id']}})[_0x231a('0x29')](handleEntityNotFound(_0x1f8756,null))[_0x231a('0x29')](removeEntity(_0x1f8756,null))[_0x231a('0x3d')](handleError(_0x1f8756,null));};function widgetAttributes(_0x56fc7d){try{switch(_0x56fc7d['type']){case'iframe':return[{'name':_0x231a('0x3e'),'value':_0x56fc7d[_0x231a('0x3e')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x0]?_0x56fc7d[_0x231a('0x3f')][0x0][_0x231a('0x40')]:undefined)||'https://'}];case _0x231a('0x41'):return[{'name':_0x231a('0x42'),'value':_0x56fc7d['attrPath']||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x0]?_0x56fc7d[_0x231a('0x3f')][0x0]['value']:undefined)||''}];case _0x231a('0x43'):return[{'name':_0x231a('0x44'),'value':_0x56fc7d[_0x231a('0x44')]||(_0x56fc7d['attrs']&&_0x56fc7d['attrs'][0x0]?_0x56fc7d[_0x231a('0x3f')][0x0][_0x231a('0x40')]:undefined)||_0x231a('0x45')},{'name':_0x231a('0x46'),'value':_0x56fc7d[_0x231a('0x46')]||(_0x56fc7d['attrs']&&_0x56fc7d[_0x231a('0x3f')][0x1]?_0x56fc7d[_0x231a('0x3f')][0x1][_0x231a('0x40')]:undefined)||_0x231a('0x47')},{'name':_0x231a('0x48'),'value':_0x56fc7d[_0x231a('0x48')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x2]?_0x56fc7d['attrs'][0x2]['value']:undefined)||0xc}];case _0x231a('0x49'):return[{'name':'attrMetric','value':_0x56fc7d[_0x231a('0x4a')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x0]?_0x56fc7d[_0x231a('0x3f')][0x0][_0x231a('0x40')]:undefined)||'total'},{'name':_0x231a('0x4b'),'value':_0x56fc7d['attrVoiceQueues']||(_0x56fc7d['attrs']&&_0x56fc7d['attrs'][0x1]?_0x56fc7d[_0x231a('0x3f')][0x1][_0x231a('0x40')]:undefined)||[]},{'name':_0x231a('0x48'),'value':_0x56fc7d[_0x231a('0x48')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x2]?_0x56fc7d[_0x231a('0x3f')][0x2][_0x231a('0x40')]:undefined)||0x14}];case'multibar-chart':case _0x231a('0x4c'):return[{'name':'attrSerie1','value':_0x56fc7d[_0x231a('0x4d')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x0]?_0x56fc7d['attrs'][0x0][_0x231a('0x40')]:undefined)||'total'},{'name':_0x231a('0x4e'),'value':_0x56fc7d['attrSerie2']||(_0x56fc7d['attrs']&&_0x56fc7d[_0x231a('0x3f')][0x1]?_0x56fc7d[_0x231a('0x3f')][0x1][_0x231a('0x40')]:undefined)||null},{'name':_0x231a('0x4f'),'value':_0x56fc7d[_0x231a('0x4f')]||(_0x56fc7d['attrs']&&_0x56fc7d[_0x231a('0x3f')][0x2]?_0x56fc7d['attrs'][0x2][_0x231a('0x40')]:undefined)||null},{'name':_0x231a('0x4b'),'value':_0x56fc7d[_0x231a('0x4b')]||(_0x56fc7d['attrs']&&_0x56fc7d[_0x231a('0x3f')][0x3]?_0x56fc7d[_0x231a('0x3f')][0x3][_0x231a('0x40')]:undefined)||[]}];case'web-report':return[{'name':_0x231a('0x50'),'type':_0x56fc7d[_0x231a('0x51')]||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x0]?_0x56fc7d['attrs'][0x0]['type']:undefined)||null,'value':_0x56fc7d['attrReport']||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d['attrs'][0x0]?_0x56fc7d['attrs'][0x0][_0x231a('0x40')]:undefined)||null},{'name':_0x231a('0x52'),'value':_0x56fc7d['attrRefresh']||(_0x56fc7d[_0x231a('0x3f')]&&_0x56fc7d[_0x231a('0x3f')][0x1]?_0x56fc7d[_0x231a('0x3f')][0x1][_0x231a('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x252e88){logger[_0x231a('0x2b')](_0x231a('0x53'),JSON[_0x231a('0x54')](_0x252e88));return[];}}exports['create']=function(_0x106078,_0x4981bd){if(_0x106078[_0x231a('0x55')]){_0x106078[_0x231a('0x55')]['attrs']=widgetAttributes(_0x106078[_0x231a('0x55')]);}return db[_0x231a('0x32')][_0x231a('0x56')](_0x106078['body'],{})[_0x231a('0x29')](respondWithResult(_0x4981bd,0xc9))['catch'](handleError(_0x4981bd,null));};exports['update']=function(_0x487032,_0x383e0c){if(_0x487032['body']['id']){delete _0x487032[_0x231a('0x55')]['id'];}_0x487032[_0x231a('0x55')][_0x231a('0x3f')]=widgetAttributes(_0x487032['body']);return db[_0x231a('0x32')][_0x231a('0x57')]({'where':{'id':_0x487032[_0x231a('0x2f')]['id']}})['then'](handleEntityNotFound(_0x383e0c,null))[_0x231a('0x29')](saveUpdates(_0x487032[_0x231a('0x55')],null))['then'](respondWithResult(_0x383e0c,null))['catch'](handleError(_0x383e0c,null));}; \ No newline at end of file +var _0x0e6d=['squel','crypto','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','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','show','params','keys','query','filters','intersection','attributes','model','fields','length','includeAll','include','catch','destroy','find','type','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','create','body','update','DashboardItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x458edc,_0x9baf98){var _0x44af29=function(_0x41929c){while(--_0x41929c){_0x458edc['push'](_0x458edc['shift']());}};_0x44af29(++_0x9baf98);}(_0x0e6d,0xae));var _0xd0e6=function(_0x3186ae,_0x5d615c){_0x3186ae=_0x3186ae-0x0;var _0x247818=_0x0e6d[_0x3186ae];return _0x247818;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd0e6('0x0'));var rimraf=require(_0xd0e6('0x1'));var zipdir=require(_0xd0e6('0x2'));var jsonpatch=require(_0xd0e6('0x3'));var rp=require(_0xd0e6('0x4'));var moment=require(_0xd0e6('0x5'));var BPromise=require(_0xd0e6('0x6'));var Mustache=require(_0xd0e6('0x7'));var util=require(_0xd0e6('0x8'));var path=require(_0xd0e6('0x9'));var sox=require('sox');var csv=require(_0xd0e6('0xa'));var ejs=require(_0xd0e6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd0e6('0xc'));var crypto=require(_0xd0e6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0e6('0xa'));var querystring=require(_0xd0e6('0xe'));var Papa=require(_0xd0e6('0xf'));var Redis=require(_0xd0e6('0x10'));var authService=require(_0xd0e6('0x11'));var qs=require(_0xd0e6('0x12'));var as=require(_0xd0e6('0x13'));var hardwareService=require(_0xd0e6('0x14'));var logger=require(_0xd0e6('0x15'))(_0xd0e6('0x16'));var utils=require(_0xd0e6('0x17'));var config=require(_0xd0e6('0x18'));var db=require('../../mysqldb')['db'];config[_0xd0e6('0x19')]=_[_0xd0e6('0x1a')](config[_0xd0e6('0x19')],{'host':_0xd0e6('0x1b'),'port':0x18eb});var socket=require(_0xd0e6('0x1c'))(new Redis(config[_0xd0e6('0x19')]));require('./dashboardItem.socket')[_0xd0e6('0x1d')](socket);function respondWithStatusCode(_0x54fdd9,_0x364545){_0x364545=_0x364545||0xcc;return function(_0x2731c9){if(_0x2731c9){return _0x54fdd9[_0xd0e6('0x1e')](_0x364545);}return _0x54fdd9[_0xd0e6('0x1f')](_0x364545)[_0xd0e6('0x20')]();};}function respondWithResult(_0x324e5c,_0x1eb342){_0x1eb342=_0x1eb342||0xc8;return function(_0x717f2b){if(_0x717f2b){return _0x324e5c[_0xd0e6('0x1f')](_0x1eb342)[_0xd0e6('0x21')](_0x717f2b);}};}function respondWithFilteredResult(_0x44e298,_0x25bb45){return function(_0x525539){if(_0x525539){var _0x55b261=_0x525539[_0xd0e6('0x22')],_0x5b8720=_0x25bb45[_0xd0e6('0x23')],_0x1f9a30=_0x25bb45[_0xd0e6('0x23')]+_0x25bb45[_0xd0e6('0x24')],_0x409a2a;if(_0x1f9a30>=_0x55b261){_0x1f9a30=_0x55b261;_0x409a2a=0xc8;}else{_0x409a2a=0xce;}_0x44e298[_0xd0e6('0x1f')](_0x409a2a);return _0x44e298[_0xd0e6('0x25')](_0xd0e6('0x26'),_0x5b8720+'-'+_0x1f9a30+'/'+_0x55b261)[_0xd0e6('0x21')](_0x525539);}return null;};}function patchUpdates(_0x4d5e52){return function(_0x3eb7d4){try{jsonpatch[_0xd0e6('0x27')](_0x3eb7d4,_0x4d5e52,!![]);}catch(_0x58b1c3){return BPromise[_0xd0e6('0x28')](_0x58b1c3);}return _0x3eb7d4[_0xd0e6('0x29')]();};}function saveUpdates(_0xf737d0,_0x3b2818){return function(_0xd5e5c6){if(_0xd5e5c6){return _0xd5e5c6['update'](_0xf737d0)['then'](function(_0x590b6d){return _0x590b6d;});}return null;};}function removeEntity(_0x286d76,_0x253be3){return function(_0x207366){if(_0x207366){return _0x207366['destroy']()[_0xd0e6('0x2a')](function(){_0x286d76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1e59,_0x3e52db){return function(_0xbaa58d){if(!_0xbaa58d){_0x5e1e59[_0xd0e6('0x1e')](0x194);}return _0xbaa58d;};}function handleError(_0x591be1,_0x525178){_0x525178=_0x525178||0x1f4;return function(_0x513612){logger[_0xd0e6('0x2b')](_0x513612[_0xd0e6('0x2c')]);if(_0x513612['name']){delete _0x513612[_0xd0e6('0x2d')];}_0x591be1[_0xd0e6('0x1f')](_0x525178)[_0xd0e6('0x2e')](_0x513612);};}exports[_0xd0e6('0x2f')]=function(_0x4cc73a,_0x43b1da){var _0x23fa8d={'raw':![],'where':{'id':_0x4cc73a[_0xd0e6('0x30')]['id']}},_0x19606a={};_0x19606a['model']=_[_0xd0e6('0x31')](db['DashboardItem']['rawAttributes']);_0x19606a[_0xd0e6('0x32')]=_[_0xd0e6('0x31')](_0x4cc73a[_0xd0e6('0x32')]);_0x19606a[_0xd0e6('0x33')]=_[_0xd0e6('0x34')](_0x19606a['model'],_0x19606a[_0xd0e6('0x32')]);_0x23fa8d[_0xd0e6('0x35')]=_[_0xd0e6('0x34')](_0x19606a[_0xd0e6('0x36')],qs[_0xd0e6('0x37')](_0x4cc73a[_0xd0e6('0x32')][_0xd0e6('0x37')]));_0x23fa8d[_0xd0e6('0x35')]=_0x23fa8d[_0xd0e6('0x35')][_0xd0e6('0x38')]?_0x23fa8d[_0xd0e6('0x35')]:_0x19606a[_0xd0e6('0x36')];if(_0x4cc73a[_0xd0e6('0x32')][_0xd0e6('0x39')]){_0x23fa8d[_0xd0e6('0x3a')]=[{'all':!![]}];}_0x23fa8d=_['merge']({},_0x23fa8d,_0x4cc73a['options']);return db['DashboardItem']['find'](_0x23fa8d)['then'](handleEntityNotFound(_0x43b1da,null))[_0xd0e6('0x2a')](respondWithResult(_0x43b1da,null))[_0xd0e6('0x3b')](handleError(_0x43b1da,null));};exports[_0xd0e6('0x3c')]=function(_0x61ffd,_0x524b0d){return db['DashboardItem'][_0xd0e6('0x3d')]({'where':{'id':_0x61ffd[_0xd0e6('0x30')]['id']}})[_0xd0e6('0x2a')](handleEntityNotFound(_0x524b0d,null))[_0xd0e6('0x2a')](removeEntity(_0x524b0d,null))[_0xd0e6('0x3b')](handleError(_0x524b0d,null));};function widgetAttributes(_0xd35631){try{switch(_0xd35631[_0xd0e6('0x3e')]){case'iframe':return[{'name':_0xd0e6('0x3f'),'value':_0xd35631[_0xd0e6('0x3f')]||(_0xd35631['attrs']&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0][_0xd0e6('0x41')]:undefined)||_0xd0e6('0x42')}];case _0xd0e6('0x43'):return[{'name':_0xd0e6('0x44'),'value':_0xd35631[_0xd0e6('0x44')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0][_0xd0e6('0x41')]:undefined)||''}];case'clock':return[{'name':_0xd0e6('0x45'),'value':_0xd35631[_0xd0e6('0x45')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0][_0xd0e6('0x41')]:undefined)||_0xd0e6('0x46')},{'name':_0xd0e6('0x47'),'value':_0xd35631[_0xd0e6('0x47')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x1]?_0xd35631[_0xd0e6('0x40')][0x1][_0xd0e6('0x41')]:undefined)||_0xd0e6('0x48')},{'name':'attrFontSize','value':_0xd35631[_0xd0e6('0x49')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x2]?_0xd35631[_0xd0e6('0x40')][0x2][_0xd0e6('0x41')]:undefined)||0xc}];case _0xd0e6('0x4a'):return[{'name':'attrMetric','value':_0xd35631[_0xd0e6('0x4b')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xd0e6('0x4c'),'value':_0xd35631['attrVoiceQueues']||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631['attrs'][0x1]?_0xd35631[_0xd0e6('0x40')][0x1][_0xd0e6('0x41')]:undefined)||[]},{'name':'attrFontSize','value':_0xd35631[_0xd0e6('0x49')]||(_0xd35631['attrs']&&_0xd35631[_0xd0e6('0x40')][0x2]?_0xd35631[_0xd0e6('0x40')][0x2][_0xd0e6('0x41')]:undefined)||0x14}];case _0xd0e6('0x4d'):case _0xd0e6('0x4e'):return[{'name':'attrSerie1','value':_0xd35631[_0xd0e6('0x4f')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0]['value']:undefined)||_0xd0e6('0x50')},{'name':'attrSerie2','value':_0xd35631[_0xd0e6('0x51')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631['attrs'][0x1]?_0xd35631['attrs'][0x1][_0xd0e6('0x41')]:undefined)||null},{'name':_0xd0e6('0x52'),'value':_0xd35631['attrSerie3']||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x2]?_0xd35631[_0xd0e6('0x40')][0x2][_0xd0e6('0x41')]:undefined)||null},{'name':_0xd0e6('0x4c'),'value':_0xd35631[_0xd0e6('0x4c')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x3]?_0xd35631[_0xd0e6('0x40')][0x3]['value']:undefined)||[]}];case _0xd0e6('0x53'):return[{'name':_0xd0e6('0x54'),'type':_0xd35631[_0xd0e6('0x55')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0][_0xd0e6('0x3e')]:undefined)||null,'value':_0xd35631[_0xd0e6('0x54')]||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x0]?_0xd35631[_0xd0e6('0x40')][0x0]['value']:undefined)||null},{'name':_0xd0e6('0x56'),'value':_0xd35631['attrRefresh']||(_0xd35631[_0xd0e6('0x40')]&&_0xd35631[_0xd0e6('0x40')][0x1]?_0xd35631[_0xd0e6('0x40')][0x1][_0xd0e6('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x1d9b71){logger[_0xd0e6('0x2b')](_0xd0e6('0x57'),JSON[_0xd0e6('0x58')](_0x1d9b71));return[];}}exports[_0xd0e6('0x59')]=function(_0x4080ae,_0x2c3452){if(_0x4080ae['body']){_0x4080ae[_0xd0e6('0x5a')]['attrs']=widgetAttributes(_0x4080ae[_0xd0e6('0x5a')]);}return db['DashboardItem'][_0xd0e6('0x59')](_0x4080ae[_0xd0e6('0x5a')],{})[_0xd0e6('0x2a')](respondWithResult(_0x2c3452,0xc9))[_0xd0e6('0x3b')](handleError(_0x2c3452,null));};exports[_0xd0e6('0x5b')]=function(_0x15460f,_0x4e2935){if(_0x15460f[_0xd0e6('0x5a')]['id']){delete _0x15460f['body']['id'];}_0x15460f[_0xd0e6('0x5a')]['attrs']=widgetAttributes(_0x15460f[_0xd0e6('0x5a')]);return db[_0xd0e6('0x5c')][_0xd0e6('0x3d')]({'where':{'id':_0x15460f[_0xd0e6('0x30')]['id']}})[_0xd0e6('0x2a')](handleEntityNotFound(_0x4e2935,null))[_0xd0e6('0x2a')](saveUpdates(_0x15460f['body'],null))[_0xd0e6('0x2a')](respondWithResult(_0x4e2935,null))[_0xd0e6('0x3b')](handleError(_0x4e2935,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e7201c9..8105e3e 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 _0x09f1=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0xcf82b2,_0x49ab9a){var _0x4275e9=function(_0x5b768f){while(--_0x5b768f){_0xcf82b2['push'](_0xcf82b2['shift']());}};_0x4275e9(++_0x49ab9a);}(_0x09f1,0xbf));var _0x109f=function(_0x29c579,_0x572b71){_0x29c579=_0x29c579-0x0;var _0x65a95a=_0x09f1[_0x29c579];return _0x65a95a;};'use strict';var EventEmitter=require(_0x109f('0x0'));var DashboardItem=require(_0x109f('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x109f('0x2')](0x0);var events={'afterCreate':_0x109f('0x3'),'afterUpdate':_0x109f('0x4'),'afterDestroy':_0x109f('0x5')};function emitEvent(_0x1acd97){return function(_0xba0ea1,_0x11ac9d,_0x3c5370){DashboardItemEvents[_0x109f('0x6')](_0x1acd97+':'+_0xba0ea1['id'],_0xba0ea1);DashboardItemEvents[_0x109f('0x6')](_0x1acd97,_0xba0ea1);_0x3c5370(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x109f('0x7')](e,emitEvent(event));}}module[_0x109f('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x808a=['../../mysqldb','DashboardItem','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x51f964,_0x4a9d5a){var _0x37fe61=function(_0xb0fb97){while(--_0xb0fb97){_0x51f964['push'](_0x51f964['shift']());}};_0x37fe61(++_0x4a9d5a);}(_0x808a,0x1b7));var _0xa808=function(_0x423e4b,_0x1bb75b){_0x423e4b=_0x423e4b-0x0;var _0x626fd4=_0x808a[_0x423e4b];return _0x626fd4;};'use strict';var EventEmitter=require(_0xa808('0x0'));var DashboardItem=require(_0xa808('0x1'))['db'][_0xa808('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa808('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x591089){return function(_0x169e1d,_0x38ed20,_0x3baf9b){DashboardItemEvents[_0xa808('0x4')](_0x591089+':'+_0x169e1d['id'],_0x169e1d);DashboardItemEvents['emit'](_0x591089,_0x169e1d);_0x3baf9b(null);};}for(var e in events){if(events[_0xa808('0x5')](e)){var event=events[e];DashboardItem[_0xa808('0x6')](e,emitEvent(event));}}module[_0xa808('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 705e698..63afc0b 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 _0xcff9=['rimraf','../../config/environment','DashboardItem','dashboard_items','util','../../config/logger','moment','bluebird','path'];(function(_0x23bea4,_0x38a38){var _0xb54789=function(_0x2a5608){while(--_0x2a5608){_0x23bea4['push'](_0x23bea4['shift']());}};_0xb54789(++_0x38a38);}(_0xcff9,0x8b));var _0x9cff=function(_0x5847f2,_0x5c06dd){_0x5847f2=_0x5847f2-0x0;var _0x18ec0d=_0xcff9[_0x5847f2];return _0x18ec0d;};'use strict';var _=require('lodash');var util=require(_0x9cff('0x0'));var logger=require(_0x9cff('0x1'))('api');var moment=require(_0x9cff('0x2'));var BPromise=require(_0x9cff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cff('0x4'));var rimraf=require(_0x9cff('0x5'));var config=require(_0x9cff('0x6'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x17b65e,_0x48614e){return _0x17b65e['define'](_0x9cff('0x7'),attributes,{'tableName':_0x9cff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0704=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','../../config/logger'];(function(_0x3453e5,_0x5c0f68){var _0x4c63b4=function(_0x380ee7){while(--_0x380ee7){_0x3453e5['push'](_0x3453e5['shift']());}};_0x4c63b4(++_0x5c0f68);}(_0x0704,0x8e));var _0x4070=function(_0x349942,_0xaf2dc4){_0x349942=_0x349942-0x0;var _0x40a55b=_0x0704[_0x349942];return _0x40a55b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4070('0x0'))(_0x4070('0x1'));var moment=require(_0x4070('0x2'));var BPromise=require(_0x4070('0x3'));var rp=require(_0x4070('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4070('0x5'));var config=require(_0x4070('0x6'));var attributes=require(_0x4070('0x7'));module[_0x4070('0x8')]=function(_0x5eaad8,_0x16c4d1){return _0x5eaad8['define'](_0x4070('0x9'),attributes,{'tableName':_0x4070('0xa'),'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 e8604bb..135660b 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 _0xdada=['request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s'];(function(_0x22a81b,_0x51edff){var _0x4540aa=function(_0x10b676){while(--_0x10b676){_0x22a81b['push'](_0x22a81b['shift']());}};_0x4540aa(++_0x51edff);}(_0xdada,0x7e));var _0xadad=function(_0x257e7e,_0x59e43f){_0x257e7e=_0x257e7e-0x0;var _0x116184=_0xdada[_0x257e7e];return _0x116184;};'use strict';var _=require(_0xadad('0x0'));var util=require(_0xadad('0x1'));var moment=require(_0xadad('0x2'));var BPromise=require(_0xadad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xadad('0x4'));var db=require(_0xadad('0x5'))['db'];var utils=require(_0xadad('0x6'));var logger=require(_0xadad('0x7'))('rpc');var config=require(_0xadad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xadad('0x9')]['http']({'port':0x232a});config[_0xadad('0xa')]=_['defaults'](config[_0xadad('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xadad('0xb'))(new Redis(config[_0xadad('0xa')]));require(_0xadad('0xc'))[_0xadad('0xd')](socket);function respondWithRpcPromise(_0x185850,_0x55ebfa,_0x484a12){return new BPromise(function(_0x1fb798,_0x19d94e){return client[_0xadad('0xe')](_0x185850,_0x484a12)[_0xadad('0xf')](function(_0xafa1ec){logger[_0xadad('0x10')](_0xadad('0x11'),_0x55ebfa,_0xadad('0x12'));logger['debug'](_0xadad('0x13'),_0x55ebfa,_0xadad('0x12'),JSON['stringify'](_0xafa1ec));if(_0xafa1ec[_0xadad('0x14')]){if(_0xafa1ec['error'][_0xadad('0x15')]===0x1f4){logger['error'](_0xadad('0x11'),_0x55ebfa,_0xafa1ec[_0xadad('0x14')][_0xadad('0x16')]);return _0x19d94e(_0xafa1ec[_0xadad('0x14')][_0xadad('0x16')]);}logger[_0xadad('0x14')](_0xadad('0x11'),_0x55ebfa,_0xafa1ec[_0xadad('0x14')][_0xadad('0x16')]);return _0x1fb798(_0xafa1ec[_0xadad('0x14')][_0xadad('0x16')]);}else{logger[_0xadad('0x10')](_0xadad('0x11'),_0x55ebfa,_0xadad('0x12'));_0x1fb798(_0xafa1ec[_0xadad('0x17')][_0xadad('0x16')]);}})['catch'](function(_0x30d0a9){logger[_0xadad('0x14')](_0xadad('0x11'),_0x55ebfa,_0x30d0a9);_0x19d94e(_0x30d0a9);});});} \ No newline at end of file +var _0x96dc=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','moment','randomstring'];(function(_0x11b0c8,_0xf4b742){var _0x348398=function(_0x2047d2){while(--_0x2047d2){_0x11b0c8['push'](_0x11b0c8['shift']());}};_0x348398(++_0xf4b742);}(_0x96dc,0x11c));var _0xc96d=function(_0x56ae7b,_0x4d95db){_0x56ae7b=_0x56ae7b-0x0;var _0x4a3d58=_0x96dc[_0x56ae7b];return _0x4a3d58;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc96d('0x0'));var BPromise=require('bluebird');var rs=require(_0xc96d('0x1'));var fs=require('fs');var Redis=require(_0xc96d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc96d('0x3'));var logger=require(_0xc96d('0x4'))(_0xc96d('0x5'));var config=require('../../config/environment');var jayson=require(_0xc96d('0x6'));var client=jayson['client'][_0xc96d('0x7')]({'port':0x232a});config[_0xc96d('0x8')]=_[_0xc96d('0x9')](config['redis'],{'host':_0xc96d('0xa'),'port':0x18eb});var socket=require(_0xc96d('0xb'))(new Redis(config[_0xc96d('0x8')]));require(_0xc96d('0xc'))[_0xc96d('0xd')](socket);function respondWithRpcPromise(_0x15c27f,_0xcbc49a,_0x153b2f){return new BPromise(function(_0x441016,_0x57a069){return client['request'](_0x15c27f,_0x153b2f)[_0xc96d('0xe')](function(_0x4a2ae6){logger[_0xc96d('0xf')]('DashboardItem,\x20%s,\x20%s',_0xcbc49a,_0xc96d('0x10'));logger[_0xc96d('0x11')](_0xc96d('0x12'),_0xcbc49a,_0xc96d('0x10'),JSON[_0xc96d('0x13')](_0x4a2ae6));if(_0x4a2ae6['error']){if(_0x4a2ae6[_0xc96d('0x14')][_0xc96d('0x15')]===0x1f4){logger[_0xc96d('0x14')](_0xc96d('0x16'),_0xcbc49a,_0x4a2ae6[_0xc96d('0x14')][_0xc96d('0x17')]);return _0x57a069(_0x4a2ae6[_0xc96d('0x14')][_0xc96d('0x17')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0xcbc49a,_0x4a2ae6['error'][_0xc96d('0x17')]);return _0x441016(_0x4a2ae6[_0xc96d('0x14')][_0xc96d('0x17')]);}else{logger[_0xc96d('0xf')](_0xc96d('0x16'),_0xcbc49a,_0xc96d('0x10'));_0x441016(_0x4a2ae6[_0xc96d('0x18')][_0xc96d('0x17')]);}})[_0xc96d('0x19')](function(_0x3cdd5c){logger[_0xc96d('0x14')](_0xc96d('0x16'),_0xcbc49a,_0x3cdd5c);_0x57a069(_0x3cdd5c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index b8f438e..7d04300 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 _0x81d7=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','register','length'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x81d7,0x1e1));var _0x781d=function(_0x19152e,_0x1e349f){_0x19152e=_0x19152e-0x0;var _0x13cba3=_0x81d7[_0x19152e];return _0x13cba3;};'use strict';var DashboardItemEvents=require(_0x781d('0x0'));var events=[_0x781d('0x1'),_0x781d('0x2'),_0x781d('0x3')];function createListener(_0x1183ae,_0x94e824){return function(_0x7476a7){_0x94e824[_0x781d('0x4')](_0x1183ae,_0x7476a7);};}function removeListener(_0x4299c8,_0x25e19f){return function(){DashboardItemEvents['removeListener'](_0x4299c8,_0x25e19f);};}exports[_0x781d('0x5')]=function(_0x546288){for(var _0x25fe98=0x0,_0xf7b932=events[_0x781d('0x6')];_0x25fe98<_0xf7b932;_0x25fe98++){var _0x4c99f0=events[_0x25fe98];var _0x4b1ca1=createListener(_0x781d('0x7')+_0x4c99f0,_0x546288);DashboardItemEvents['on'](_0x4c99f0,_0x4b1ca1);}}; \ No newline at end of file +var _0x6cb6=['register','./dashboardItem.events','save','remove','emit','removeListener'];(function(_0x17cb63,_0x4c0e90){var _0x4340bc=function(_0x364807){while(--_0x364807){_0x17cb63['push'](_0x17cb63['shift']());}};_0x4340bc(++_0x4c0e90);}(_0x6cb6,0x1db));var _0x66cb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6cb6[_0x3b380d];return _0x54502b;};'use strict';var DashboardItemEvents=require(_0x66cb('0x0'));var events=[_0x66cb('0x1'),_0x66cb('0x2'),'update'];function createListener(_0x4215b2,_0x43d0ed){return function(_0x2010d5){_0x43d0ed[_0x66cb('0x3')](_0x4215b2,_0x2010d5);};}function removeListener(_0x1dd926,_0x327fbf){return function(){DashboardItemEvents[_0x66cb('0x4')](_0x1dd926,_0x327fbf);};}exports[_0x66cb('0x5')]=function(_0x1a31b2){for(var _0x30f536=0x0,_0x430c5c=events['length'];_0x30f536<_0x430c5c;_0x30f536++){var _0x205927=events[_0x30f536];var _0x26d5c7=createListener('dashboardItem:'+_0x205927,_0x1a31b2);DashboardItemEvents['on'](_0x205927,_0x26d5c7);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 61de997..86e43f7 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 _0xdbf5=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','exports','util','express','Router','../../components/auth/service'];(function(_0x3a254f,_0x5d4955){var _0xaf1686=function(_0x16cfdb){while(--_0x16cfdb){_0x3a254f['push'](_0x3a254f['shift']());}};_0xaf1686(++_0x5d4955);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x54b44a,_0x70b8b5){_0x54b44a=_0x54b44a-0x0;var _0x4d8bb4=_0xdbf5[_0x54b44a];return _0x4d8bb4;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')](_0x5dbf('0x8'),auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0xb')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router['put'](_0x5dbf('0x8'),auth['isAuthenticated'](),controller[_0x5dbf('0xd')]);router[_0x5dbf('0xe')](_0x5dbf('0x8'),auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0xf')]=router; \ No newline at end of file +var _0x4819=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','create','put','/:id','delete','exports','util','path','connect-timeout'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0x4819,0xcd));var _0x9481=function(_0x5293c8,_0xab0c3c){_0x5293c8=_0x5293c8-0x0;var _0x3623fb=_0x4819[_0x5293c8];return _0x3623fb;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/:id',auth[_0x9481('0xa')](),controller['show']);router['post']('/',auth[_0x9481('0xa')](),controller[_0x9481('0xb')]);router[_0x9481('0xc')](_0x9481('0xd'),auth[_0x9481('0xa')](),controller['update']);router[_0x9481('0xe')]('/:id',auth[_0x9481('0xa')](),controller['destroy']);module[_0x9481('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index be0ffce..4022487 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa474=['STRING','exports'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xa474,0x195));var _0x4a47=function(_0x28332e,_0x17a69c){_0x28332e=_0x28332e-0x0;var _0x2f1b5b=_0xa474[_0x28332e];return _0x2f1b5b;};'use strict';var Sequelize=require('sequelize');module[_0x4a47('0x0')]={'name':{'type':Sequelize[_0x4a47('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 4a6db3b..a7156c5 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 _0x41f8=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','get','UserProfileResource','destroy','then','name','Disposition','rawAttributes','model','map'];(function(_0x4be27a,_0x208578){var _0x10de26=function(_0x551f30){while(--_0x551f30){_0x4be27a['push'](_0x4be27a['shift']());}};_0x10de26(++_0x208578);}(_0x41f8,0x116));var _0x841f=function(_0x4e07d2,_0x3c2365){_0x4e07d2=_0x4e07d2-0x0;var _0x5d2ffa=_0x41f8[_0x4e07d2];return _0x5d2ffa;};'use strict';var pdf=require(_0x841f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x841f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x841f('0x2'));var rp=require(_0x841f('0x3'));var moment=require(_0x841f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x841f('0x5'));var util=require(_0x841f('0x6'));var path=require(_0x841f('0x7'));var sox=require(_0x841f('0x8'));var csv=require(_0x841f('0x9'));var ejs=require(_0x841f('0xa'));var fs=require('fs');var _=require(_0x841f('0xb'));var squel=require(_0x841f('0xc'));var crypto=require(_0x841f('0xd'));var jsforce=require(_0x841f('0xe'));var deskjs=require(_0x841f('0xf'));var toCsv=require(_0x841f('0x9'));var querystring=require(_0x841f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x841f('0x11'));var qs=require(_0x841f('0x12'));var as=require(_0x841f('0x13'));var hardwareService=require(_0x841f('0x14'));var logger=require(_0x841f('0x15'))(_0x841f('0x16'));var utils=require('../../config/utils');var config=require(_0x841f('0x17'));var db=require(_0x841f('0x18'))['db'];function respondWithStatusCode(_0x35e38d,_0x38f585){_0x38f585=_0x38f585||0xcc;return function(_0x2f5ee1){if(_0x2f5ee1){return _0x35e38d[_0x841f('0x19')](_0x38f585);}return _0x35e38d[_0x841f('0x1a')](_0x38f585)[_0x841f('0x1b')]();};}function respondWithResult(_0x4870da,_0x487623){_0x487623=_0x487623||0xc8;return function(_0x15d2be){if(_0x15d2be){return _0x4870da['status'](_0x487623)['json'](_0x15d2be);}};}function respondWithFilteredResult(_0x1b00e3,_0x26e160){return function(_0x59775f){if(_0x59775f){var _0x53d9d7=_0x59775f[_0x841f('0x1c')],_0x1c9015=_0x26e160[_0x841f('0x1d')],_0x2edadd=_0x26e160[_0x841f('0x1d')]+_0x26e160[_0x841f('0x1e')],_0x5a201b;if(_0x2edadd>=_0x53d9d7){_0x2edadd=_0x53d9d7;_0x5a201b=0xc8;}else{_0x5a201b=0xce;}_0x1b00e3[_0x841f('0x1a')](_0x5a201b);return _0x1b00e3[_0x841f('0x1f')](_0x841f('0x20'),_0x1c9015+'-'+_0x2edadd+'/'+_0x53d9d7)[_0x841f('0x21')](_0x59775f);}return null;};}function patchUpdates(_0x3f6edb){return function(_0x3728e3){try{jsonpatch['apply'](_0x3728e3,_0x3f6edb,!![]);}catch(_0x45200e){return BPromise[_0x841f('0x22')](_0x45200e);}return _0x3728e3[_0x841f('0x23')]();};}function saveUpdates(_0x447b7d,_0x79aa57){return function(_0x3a3545){if(_0x3a3545){return _0x3a3545[_0x841f('0x24')](_0x447b7d)['then'](function(_0x4903d4){return _0x4903d4;});}return null;};}function removeEntity(_0x407724,_0x539544){return function(_0xace08e){if(_0xace08e){return _0xace08e['destroy']()['then'](function(){var _0x40469d=_0xace08e[_0x841f('0x25')]({'plain':!![]});var _0x19371f='Dispositions';return db[_0x841f('0x26')][_0x841f('0x27')]({'where':{'type':_0x19371f,'resourceId':_0x40469d['id']}})[_0x841f('0x28')](function(){return _0xace08e;});})['then'](function(){_0x407724[_0x841f('0x1a')](0xcc)[_0x841f('0x1b')]();});}};}function handleEntityNotFound(_0x1dbb59,_0xc2a7d7){return function(_0x543641){if(!_0x543641){_0x1dbb59[_0x841f('0x19')](0x194);}return _0x543641;};}function handleError(_0x4a11a7,_0x3790bf){_0x3790bf=_0x3790bf||0x1f4;return function(_0x2fb77d){logger['error'](_0x2fb77d['stack']);if(_0x2fb77d[_0x841f('0x29')]){delete _0x2fb77d[_0x841f('0x29')];}_0x4a11a7[_0x841f('0x1a')](_0x3790bf)['send'](_0x2fb77d);};}exports['index']=function(_0xed2e23,_0x44f127){var _0x4de839={},_0x58d004={},_0x2b73a9={'count':0x0,'rows':[]};var _0x3e63b2=_['map'](db[_0x841f('0x2a')][_0x841f('0x2b')],function(_0x3c7a2f){return{'name':_0x3c7a2f['fieldName'],'type':_0x3c7a2f['type']['key']};});_0x58d004[_0x841f('0x2c')]=_[_0x841f('0x2d')](_0x3e63b2,_0x841f('0x29'));_0x58d004['query']=_[_0x841f('0x2e')](_0xed2e23['query']);_0x58d004[_0x841f('0x2f')]=_[_0x841f('0x30')](_0x58d004[_0x841f('0x2c')],_0x58d004[_0x841f('0x31')]);_0x4de839[_0x841f('0x32')]=_[_0x841f('0x30')](_0x58d004[_0x841f('0x2c')],qs['fields'](_0xed2e23[_0x841f('0x31')][_0x841f('0x33')]));_0x4de839[_0x841f('0x32')]=_0x4de839[_0x841f('0x32')][_0x841f('0x34')]?_0x4de839[_0x841f('0x32')]:_0x58d004[_0x841f('0x2c')];if(!_0xed2e23[_0x841f('0x31')][_0x841f('0x35')]('nolimit')){_0x4de839[_0x841f('0x1e')]=qs['limit'](_0xed2e23[_0x841f('0x31')]['limit']);_0x4de839[_0x841f('0x1d')]=qs['offset'](_0xed2e23[_0x841f('0x31')][_0x841f('0x1d')]);}_0x4de839[_0x841f('0x36')]=qs[_0x841f('0x37')](_0xed2e23[_0x841f('0x31')]['sort']);_0x4de839[_0x841f('0x38')]=qs[_0x841f('0x2f')](_[_0x841f('0x39')](_0xed2e23['query'],_0x58d004[_0x841f('0x2f')]),_0x3e63b2);if(_0xed2e23['query']['filter']){_0x4de839[_0x841f('0x38')]=_['merge'](_0x4de839[_0x841f('0x38')],{'$or':_[_0x841f('0x2d')](_0x3e63b2,function(_0x344195){if(_0x344195['type']!==_0x841f('0x3a')){var _0x356a4d={};_0x356a4d[_0x344195[_0x841f('0x29')]]={'$like':'%'+_0xed2e23[_0x841f('0x31')][_0x841f('0x3b')]+'%'};return _0x356a4d;}})});}_0x4de839=_['merge']({},_0x4de839,_0xed2e23['options']);var _0x451eb6={'where':_0x4de839[_0x841f('0x38')]};return db['Disposition'][_0x841f('0x1c')](_0x451eb6)[_0x841f('0x28')](function(_0x4ddb7a){_0x2b73a9[_0x841f('0x1c')]=_0x4ddb7a;if(_0xed2e23['query'][_0x841f('0x3c')]){_0x4de839[_0x841f('0x3d')]=[{'all':!![]}];}return db[_0x841f('0x2a')][_0x841f('0x3e')](_0x4de839);})[_0x841f('0x28')](function(_0x58fce4){_0x2b73a9[_0x841f('0x3f')]=_0x58fce4;return _0x2b73a9;})[_0x841f('0x28')](respondWithFilteredResult(_0x44f127,_0x4de839))[_0x841f('0x40')](handleError(_0x44f127,null));};exports[_0x841f('0x41')]=function(_0x22a741,_0x3ed196){var _0x1d4f16={'raw':!![],'where':{'id':_0x22a741[_0x841f('0x42')]['id']}},_0x3d1d8d={};_0x3d1d8d[_0x841f('0x2c')]=_[_0x841f('0x2e')](db[_0x841f('0x2a')][_0x841f('0x2b')]);_0x3d1d8d[_0x841f('0x31')]=_[_0x841f('0x2e')](_0x22a741['query']);_0x3d1d8d[_0x841f('0x2f')]=_['intersection'](_0x3d1d8d[_0x841f('0x2c')],_0x3d1d8d[_0x841f('0x31')]);_0x1d4f16[_0x841f('0x32')]=_[_0x841f('0x30')](_0x3d1d8d[_0x841f('0x2c')],qs['fields'](_0x22a741[_0x841f('0x31')][_0x841f('0x33')]));_0x1d4f16['attributes']=_0x1d4f16[_0x841f('0x32')]['length']?_0x1d4f16['attributes']:_0x3d1d8d[_0x841f('0x2c')];if(_0x22a741[_0x841f('0x31')][_0x841f('0x3c')]){_0x1d4f16[_0x841f('0x3d')]=[{'all':!![]}];}_0x1d4f16=_[_0x841f('0x43')]({},_0x1d4f16,_0x22a741[_0x841f('0x44')]);return db[_0x841f('0x2a')][_0x841f('0x45')](_0x1d4f16)[_0x841f('0x28')](handleEntityNotFound(_0x3ed196,null))[_0x841f('0x28')](respondWithResult(_0x3ed196,null))[_0x841f('0x40')](handleError(_0x3ed196,null));};exports['create']=function(_0x1240ec,_0x57a63e){return db[_0x841f('0x2a')][_0x841f('0x46')](_0x1240ec[_0x841f('0x47')],{})['then'](function(_0x43626d){var _0x43401f=_0x1240ec[_0x841f('0x48')][_0x841f('0x25')]({'plain':!![]});if(!_0x43401f)throw new Error(_0x841f('0x49'));if(_0x43401f[_0x841f('0x4a')]===_0x841f('0x48')){var _0x56fb3d=_0x43626d[_0x841f('0x25')]({'plain':!![]});var _0x2745b4=_0x841f('0x4b');return db[_0x841f('0x4c')]['find']({'where':{'name':_0x2745b4,'userProfileId':_0x43401f[_0x841f('0x4d')]},'raw':!![]})[_0x841f('0x28')](function(_0x3ef9cc){if(_0x3ef9cc&&_0x3ef9cc[_0x841f('0x4e')]===0x0){return db[_0x841f('0x26')][_0x841f('0x46')]({'name':_0x56fb3d[_0x841f('0x29')],'resourceId':_0x56fb3d['id'],'type':_0x3ef9cc[_0x841f('0x29')],'sectionId':_0x3ef9cc['id']},{})[_0x841f('0x28')](function(){return _0x43626d;});}else{return _0x43626d;}})[_0x841f('0x40')](function(_0x298a20){logger[_0x841f('0x4f')](_0x841f('0x50'),_0x298a20);throw _0x298a20;});}return _0x43626d;})[_0x841f('0x28')](respondWithResult(_0x57a63e,0xc9))['catch'](handleError(_0x57a63e,null));};exports[_0x841f('0x24')]=function(_0xca192e,_0x28d3d9){if(_0xca192e[_0x841f('0x47')]['id']){delete _0xca192e[_0x841f('0x47')]['id'];}return db[_0x841f('0x2a')][_0x841f('0x45')]({'where':{'id':_0xca192e[_0x841f('0x42')]['id']}})['then'](handleEntityNotFound(_0x28d3d9,null))[_0x841f('0x28')](saveUpdates(_0xca192e[_0x841f('0x47')],null))[_0x841f('0x28')](respondWithResult(_0x28d3d9,null))[_0x841f('0x40')](handleError(_0x28d3d9,null));};exports[_0x841f('0x27')]=function(_0x4928f3,_0x5f0d8f){return db[_0x841f('0x2a')][_0x841f('0x45')]({'where':{'id':_0x4928f3[_0x841f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5f0d8f,null))[_0x841f('0x28')](removeEntity(_0x5f0d8f,null))['catch'](handleError(_0x5f0d8f,null));}; \ No newline at end of file +var _0xb027=['send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','Disposition','includeAll','include','findAll','rows','catch','length','find','create','body','user','role','UserProfileSection','params','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','get','Dispositions','UserProfileResource','destroy','then','stack','name'];(function(_0x122395,_0x7851b0){var _0x264333=function(_0x516da5){while(--_0x516da5){_0x122395['push'](_0x122395['shift']());}};_0x264333(++_0x7851b0);}(_0xb027,0x191));var _0x7b02=function(_0x5dc2a7,_0x5cdc58){_0x5dc2a7=_0x5dc2a7-0x0;var _0x149c6c=_0xb027[_0x5dc2a7];return _0x149c6c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7b02('0x0'));var zipdir=require(_0x7b02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b02('0x2'));var moment=require(_0x7b02('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b02('0x4'));var util=require(_0x7b02('0x5'));var path=require('path');var sox=require(_0x7b02('0x6'));var csv=require(_0x7b02('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7b02('0x8'));var squel=require('squel');var crypto=require(_0x7b02('0x9'));var jsforce=require(_0x7b02('0xa'));var deskjs=require(_0x7b02('0xb'));var toCsv=require(_0x7b02('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7b02('0xc'));var authService=require(_0x7b02('0xd'));var qs=require(_0x7b02('0xe'));var as=require(_0x7b02('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b02('0x10'));var utils=require('../../config/utils');var config=require(_0x7b02('0x11'));var db=require(_0x7b02('0x12'))['db'];function respondWithStatusCode(_0x20cd88,_0x15ef06){_0x15ef06=_0x15ef06||0xcc;return function(_0xbb69ec){if(_0xbb69ec){return _0x20cd88[_0x7b02('0x13')](_0x15ef06);}return _0x20cd88[_0x7b02('0x14')](_0x15ef06)[_0x7b02('0x15')]();};}function respondWithResult(_0x1f846f,_0x5708bc){_0x5708bc=_0x5708bc||0xc8;return function(_0x253bfe){if(_0x253bfe){return _0x1f846f[_0x7b02('0x14')](_0x5708bc)[_0x7b02('0x16')](_0x253bfe);}};}function respondWithFilteredResult(_0x2502c1,_0x2d81fe){return function(_0x574777){if(_0x574777){var _0x5d6d63=_0x574777[_0x7b02('0x17')],_0x4c0acb=_0x2d81fe[_0x7b02('0x18')],_0x53488b=_0x2d81fe[_0x7b02('0x18')]+_0x2d81fe[_0x7b02('0x19')],_0x584fcd;if(_0x53488b>=_0x5d6d63){_0x53488b=_0x5d6d63;_0x584fcd=0xc8;}else{_0x584fcd=0xce;}_0x2502c1[_0x7b02('0x14')](_0x584fcd);return _0x2502c1[_0x7b02('0x1a')](_0x7b02('0x1b'),_0x4c0acb+'-'+_0x53488b+'/'+_0x5d6d63)['json'](_0x574777);}return null;};}function patchUpdates(_0x16e9ee){return function(_0x24793b){try{jsonpatch['apply'](_0x24793b,_0x16e9ee,!![]);}catch(_0x4a43f4){return BPromise['reject'](_0x4a43f4);}return _0x24793b[_0x7b02('0x1c')]();};}function saveUpdates(_0x2feaa9,_0x4921a7){return function(_0x10b771){if(_0x10b771){return _0x10b771[_0x7b02('0x1d')](_0x2feaa9)['then'](function(_0x1766c8){return _0x1766c8;});}return null;};}function removeEntity(_0xd2296a,_0x41a3ad){return function(_0x2cd08a){if(_0x2cd08a){return _0x2cd08a['destroy']()['then'](function(){var _0x2f73c7=_0x2cd08a[_0x7b02('0x1e')]({'plain':!![]});var _0x24cfbf=_0x7b02('0x1f');return db[_0x7b02('0x20')][_0x7b02('0x21')]({'where':{'type':_0x24cfbf,'resourceId':_0x2f73c7['id']}})[_0x7b02('0x22')](function(){return _0x2cd08a;});})[_0x7b02('0x22')](function(){_0xd2296a[_0x7b02('0x14')](0xcc)[_0x7b02('0x15')]();});}};}function handleEntityNotFound(_0x6c951d,_0xc2a77b){return function(_0x55933c){if(!_0x55933c){_0x6c951d['sendStatus'](0x194);}return _0x55933c;};}function handleError(_0x3b4bab,_0x3f2375){_0x3f2375=_0x3f2375||0x1f4;return function(_0x2de9b2){logger['error'](_0x2de9b2[_0x7b02('0x23')]);if(_0x2de9b2['name']){delete _0x2de9b2[_0x7b02('0x24')];}_0x3b4bab[_0x7b02('0x14')](_0x3f2375)[_0x7b02('0x25')](_0x2de9b2);};}exports[_0x7b02('0x26')]=function(_0x565a25,_0x12f005){var _0x3b5aaa={},_0x4262e7={},_0x1c9632={'count':0x0,'rows':[]};var _0x2db658=_[_0x7b02('0x27')](db['Disposition'][_0x7b02('0x28')],function(_0x3f2287){return{'name':_0x3f2287[_0x7b02('0x29')],'type':_0x3f2287[_0x7b02('0x2a')][_0x7b02('0x2b')]};});_0x4262e7[_0x7b02('0x2c')]=_[_0x7b02('0x27')](_0x2db658,_0x7b02('0x24'));_0x4262e7[_0x7b02('0x2d')]=_[_0x7b02('0x2e')](_0x565a25['query']);_0x4262e7[_0x7b02('0x2f')]=_[_0x7b02('0x30')](_0x4262e7[_0x7b02('0x2c')],_0x4262e7[_0x7b02('0x2d')]);_0x3b5aaa['attributes']=_['intersection'](_0x4262e7['model'],qs[_0x7b02('0x31')](_0x565a25[_0x7b02('0x2d')]['fields']));_0x3b5aaa['attributes']=_0x3b5aaa[_0x7b02('0x32')]['length']?_0x3b5aaa['attributes']:_0x4262e7[_0x7b02('0x2c')];if(!_0x565a25[_0x7b02('0x2d')][_0x7b02('0x33')]('nolimit')){_0x3b5aaa[_0x7b02('0x19')]=qs['limit'](_0x565a25[_0x7b02('0x2d')][_0x7b02('0x19')]);_0x3b5aaa[_0x7b02('0x18')]=qs[_0x7b02('0x18')](_0x565a25['query'][_0x7b02('0x18')]);}_0x3b5aaa[_0x7b02('0x34')]=qs[_0x7b02('0x35')](_0x565a25[_0x7b02('0x2d')][_0x7b02('0x35')]);_0x3b5aaa['where']=qs[_0x7b02('0x2f')](_[_0x7b02('0x36')](_0x565a25['query'],_0x4262e7[_0x7b02('0x2f')]),_0x2db658);if(_0x565a25['query'][_0x7b02('0x37')]){_0x3b5aaa[_0x7b02('0x38')]=_[_0x7b02('0x39')](_0x3b5aaa['where'],{'$or':_[_0x7b02('0x27')](_0x2db658,function(_0x2f8649){if(_0x2f8649[_0x7b02('0x2a')]!==_0x7b02('0x3a')){var _0x83412b={};_0x83412b[_0x2f8649[_0x7b02('0x24')]]={'$like':'%'+_0x565a25[_0x7b02('0x2d')][_0x7b02('0x37')]+'%'};return _0x83412b;}})});}_0x3b5aaa=_[_0x7b02('0x39')]({},_0x3b5aaa,_0x565a25['options']);var _0x4653de={'where':_0x3b5aaa[_0x7b02('0x38')]};return db[_0x7b02('0x3b')][_0x7b02('0x17')](_0x4653de)[_0x7b02('0x22')](function(_0x12647f){_0x1c9632[_0x7b02('0x17')]=_0x12647f;if(_0x565a25['query'][_0x7b02('0x3c')]){_0x3b5aaa[_0x7b02('0x3d')]=[{'all':!![]}];}return db['Disposition'][_0x7b02('0x3e')](_0x3b5aaa);})['then'](function(_0x2ccb2c){_0x1c9632[_0x7b02('0x3f')]=_0x2ccb2c;return _0x1c9632;})[_0x7b02('0x22')](respondWithFilteredResult(_0x12f005,_0x3b5aaa))[_0x7b02('0x40')](handleError(_0x12f005,null));};exports['show']=function(_0x4c92d1,_0x1c53c8){var _0x31f685={'raw':!![],'where':{'id':_0x4c92d1['params']['id']}},_0x5a059f={};_0x5a059f[_0x7b02('0x2c')]=_[_0x7b02('0x2e')](db[_0x7b02('0x3b')][_0x7b02('0x28')]);_0x5a059f[_0x7b02('0x2d')]=_[_0x7b02('0x2e')](_0x4c92d1['query']);_0x5a059f[_0x7b02('0x2f')]=_[_0x7b02('0x30')](_0x5a059f[_0x7b02('0x2c')],_0x5a059f[_0x7b02('0x2d')]);_0x31f685[_0x7b02('0x32')]=_[_0x7b02('0x30')](_0x5a059f[_0x7b02('0x2c')],qs[_0x7b02('0x31')](_0x4c92d1['query'][_0x7b02('0x31')]));_0x31f685['attributes']=_0x31f685['attributes'][_0x7b02('0x41')]?_0x31f685[_0x7b02('0x32')]:_0x5a059f[_0x7b02('0x2c')];if(_0x4c92d1[_0x7b02('0x2d')]['includeAll']){_0x31f685['include']=[{'all':!![]}];}_0x31f685=_[_0x7b02('0x39')]({},_0x31f685,_0x4c92d1['options']);return db[_0x7b02('0x3b')][_0x7b02('0x42')](_0x31f685)[_0x7b02('0x22')](handleEntityNotFound(_0x1c53c8,null))[_0x7b02('0x22')](respondWithResult(_0x1c53c8,null))[_0x7b02('0x40')](handleError(_0x1c53c8,null));};exports[_0x7b02('0x43')]=function(_0x6000a0,_0x2777de){return db[_0x7b02('0x3b')][_0x7b02('0x43')](_0x6000a0[_0x7b02('0x44')],{})[_0x7b02('0x22')](function(_0xab5ba5){var _0x4c5a6e=_0x6000a0[_0x7b02('0x45')][_0x7b02('0x1e')]({'plain':!![]});if(!_0x4c5a6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c5a6e[_0x7b02('0x46')]==='user'){var _0x2de710=_0xab5ba5[_0x7b02('0x1e')]({'plain':!![]});var _0x439d9=_0x7b02('0x1f');return db[_0x7b02('0x47')][_0x7b02('0x42')]({'where':{'name':_0x439d9,'userProfileId':_0x4c5a6e['userProfileId']},'raw':!![]})[_0x7b02('0x22')](function(_0x4931d0){if(_0x4931d0&&_0x4931d0['autoAssociation']===0x0){return db[_0x7b02('0x20')][_0x7b02('0x43')]({'name':_0x2de710[_0x7b02('0x24')],'resourceId':_0x2de710['id'],'type':_0x4931d0[_0x7b02('0x24')],'sectionId':_0x4931d0['id']},{})[_0x7b02('0x22')](function(){return _0xab5ba5;});}else{return _0xab5ba5;}})[_0x7b02('0x40')](function(_0x539b9f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x539b9f);throw _0x539b9f;});}return _0xab5ba5;})[_0x7b02('0x22')](respondWithResult(_0x2777de,0xc9))[_0x7b02('0x40')](handleError(_0x2777de,null));};exports[_0x7b02('0x1d')]=function(_0x3c9172,_0x35e26d){if(_0x3c9172[_0x7b02('0x44')]['id']){delete _0x3c9172[_0x7b02('0x44')]['id'];}return db[_0x7b02('0x3b')][_0x7b02('0x42')]({'where':{'id':_0x3c9172['params']['id']}})[_0x7b02('0x22')](handleEntityNotFound(_0x35e26d,null))[_0x7b02('0x22')](saveUpdates(_0x3c9172[_0x7b02('0x44')],null))[_0x7b02('0x22')](respondWithResult(_0x35e26d,null))[_0x7b02('0x40')](handleError(_0x35e26d,null));};exports['destroy']=function(_0x59652e,_0xa84494){return db[_0x7b02('0x3b')][_0x7b02('0x42')]({'where':{'id':_0x59652e[_0x7b02('0x48')]['id']}})['then'](handleEntityNotFound(_0xa84494,null))[_0x7b02('0x22')](removeEntity(_0xa84494,null))[_0x7b02('0x40')](handleError(_0xa84494,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d425553..1e969af 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 _0xc92f=['name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','define','tools_dispositions'];(function(_0x52a9d3,_0x32c240){var _0x343278=function(_0x1a1e94){while(--_0x1a1e94){_0x52a9d3['push'](_0x52a9d3['shift']());}};_0x343278(++_0x32c240);}(_0xc92f,0xf3));var _0xfc92=function(_0x4c0293,_0x5b20fe){_0x4c0293=_0x4c0293-0x0;var _0x26ee1c=_0xc92f[_0x4c0293];return _0x26ee1c;};'use strict';var _=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var logger=require('../../config/logger')(_0xfc92('0x2'));var moment=require(_0xfc92('0x3'));var BPromise=require(_0xfc92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc92('0x5'));var rimraf=require(_0xfc92('0x6'));var config=require(_0xfc92('0x7'));var attributes=require('./disposition.attributes');module['exports']=function(_0x930bab,_0x47abee){return _0x930bab[_0xfc92('0x8')]('Disposition',attributes,{'tableName':_0xfc92('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xfc92('0xa'),_0xfc92('0xb')]},{'unique':!![],'name':_0xfc92('0xc'),'fields':['name',_0xfc92('0xd')]},{'unique':!![],'name':_0xfc92('0xe'),'fields':[_0xfc92('0xa'),'MailAccountId']},{'unique':!![],'name':_0xfc92('0xf'),'fields':[_0xfc92('0xa'),_0xfc92('0x10')]},{'unique':!![],'name':_0xfc92('0x11'),'fields':[_0xfc92('0xa'),_0xfc92('0x12')]},{'unique':!![],'name':_0xfc92('0x13'),'fields':[_0xfc92('0xa'),_0xfc92('0x14')]},{'unique':!![],'name':_0xfc92('0x15'),'fields':[_0xfc92('0xa'),_0xfc92('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c1f=['api','bluebird','request-promise','path','exports','define','Disposition','tools_dispositions','name_voice','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger'];(function(_0x5f01a7,_0x5cb047){var _0x2f8b0b=function(_0x596602){while(--_0x596602){_0x5f01a7['push'](_0x5f01a7['shift']());}};_0x2f8b0b(++_0x5cb047);}(_0x5c1f,0x1b3));var _0xf5c1=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x5c1f[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xf5c1('0x0'));var util=require('util');var logger=require(_0xf5c1('0x1'))(_0xf5c1('0x2'));var moment=require('moment');var BPromise=require(_0xf5c1('0x3'));var rp=require(_0xf5c1('0x4'));var fs=require('fs');var path=require(_0xf5c1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0xf5c1('0x6')]=function(_0x3a7475,_0x52e4cb){return _0x3a7475[_0xf5c1('0x7')](_0xf5c1('0x8'),attributes,{'tableName':_0xf5c1('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf5c1('0xa'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':['name',_0xf5c1('0xb')]},{'unique':!![],'name':_0xf5c1('0xc'),'fields':[_0xf5c1('0xd'),_0xf5c1('0xe')]},{'unique':!![],'name':_0xf5c1('0xf'),'fields':[_0xf5c1('0xd'),_0xf5c1('0x10')]},{'unique':!![],'name':_0xf5c1('0x11'),'fields':['name',_0xf5c1('0x12')]},{'unique':!![],'name':_0xf5c1('0x13'),'fields':[_0xf5c1('0xd'),_0xf5c1('0x14')]},{'unique':!![],'name':_0xf5c1('0x15'),'fields':['name',_0xf5c1('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 699f21c..926db94 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 _0xf3f6=['stringify','error','code','message','Disposition,\x20%s,\x20%s','result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x204894,_0x50f992){var _0x5a7c0=function(_0x1079c4){while(--_0x1079c4){_0x204894['push'](_0x204894['shift']());}};_0x5a7c0(++_0x50f992);}(_0xf3f6,0x132));var _0x6f3f=function(_0x980b9b,_0x2e2dad){_0x980b9b=_0x980b9b-0x0;var _0x20bb63=_0xf3f6[_0x980b9b];return _0x20bb63;};'use strict';var _=require(_0x6f3f('0x0'));var util=require(_0x6f3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f3f('0x2'));var fs=require('fs');var Redis=require(_0x6f3f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f3f('0x4'));var logger=require(_0x6f3f('0x5'))(_0x6f3f('0x6'));var config=require(_0x6f3f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f3f('0x8')][_0x6f3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46c439,_0x45cbb3,_0x3dde2d){return new BPromise(function(_0x5609b6,_0x5c10c2){return client[_0x6f3f('0xa')](_0x46c439,_0x3dde2d)[_0x6f3f('0xb')](function(_0x3c70b4){logger[_0x6f3f('0xc')]('Disposition,\x20%s,\x20%s',_0x45cbb3,'request\x20sent');logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x45cbb3,_0x6f3f('0xd'),JSON[_0x6f3f('0xe')](_0x3c70b4));if(_0x3c70b4[_0x6f3f('0xf')]){if(_0x3c70b4[_0x6f3f('0xf')][_0x6f3f('0x10')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x45cbb3,_0x3c70b4['error']['message']);return _0x5c10c2(_0x3c70b4[_0x6f3f('0xf')][_0x6f3f('0x11')]);}logger[_0x6f3f('0xf')](_0x6f3f('0x12'),_0x45cbb3,_0x3c70b4[_0x6f3f('0xf')][_0x6f3f('0x11')]);return _0x5609b6(_0x3c70b4[_0x6f3f('0xf')][_0x6f3f('0x11')]);}else{logger[_0x6f3f('0xc')](_0x6f3f('0x12'),_0x45cbb3,'request\x20sent');_0x5609b6(_0x3c70b4[_0x6f3f('0x13')][_0x6f3f('0x11')]);}})['catch'](function(_0x4b94e7){logger[_0x6f3f('0xf')](_0x6f3f('0x12'),_0x45cbb3,_0x4b94e7);_0x5c10c2(_0x4b94e7);});});} \ No newline at end of file +var _0x51a4=['code','message','info','Disposition,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','request','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xecc801,_0x37a8d1){var _0x36d0e8=function(_0x17a0bf){while(--_0x17a0bf){_0xecc801['push'](_0xecc801['shift']());}};_0x36d0e8(++_0x37a8d1);}(_0x51a4,0x16e));var _0x451a=function(_0x344dd7,_0x39eb8c){_0x344dd7=_0x344dd7-0x0;var _0x3fcba8=_0x51a4[_0x344dd7];return _0x3fcba8;};'use strict';var _=require('lodash');var util=require(_0x451a('0x0'));var moment=require(_0x451a('0x1'));var BPromise=require(_0x451a('0x2'));var rs=require(_0x451a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x451a('0x4'))['db'];var utils=require(_0x451a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x451a('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b11ac,_0x2389c5,_0x4cc715){return new BPromise(function(_0xd19767,_0x2cdf3e){return client[_0x451a('0x7')](_0x5b11ac,_0x4cc715)['then'](function(_0x2976a1){logger['info']('Disposition,\x20%s,\x20%s',_0x2389c5,_0x451a('0x8'));logger['debug'](_0x451a('0x9'),_0x2389c5,_0x451a('0x8'),JSON[_0x451a('0xa')](_0x2976a1));if(_0x2976a1[_0x451a('0xb')]){if(_0x2976a1['error'][_0x451a('0xc')]===0x1f4){logger[_0x451a('0xb')]('Disposition,\x20%s,\x20%s',_0x2389c5,_0x2976a1[_0x451a('0xb')][_0x451a('0xd')]);return _0x2cdf3e(_0x2976a1[_0x451a('0xb')]['message']);}logger[_0x451a('0xb')]('Disposition,\x20%s,\x20%s',_0x2389c5,_0x2976a1[_0x451a('0xb')][_0x451a('0xd')]);return _0xd19767(_0x2976a1[_0x451a('0xb')][_0x451a('0xd')]);}else{logger[_0x451a('0xe')](_0x451a('0xf'),_0x2389c5,_0x451a('0x8'));_0xd19767(_0x2976a1[_0x451a('0x10')][_0x451a('0xd')]);}})[_0x451a('0x11')](function(_0x523e2d){logger[_0x451a('0xb')](_0x451a('0xf'),_0x2389c5,_0x523e2d);_0x2cdf3e(_0x523e2d);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 335bc5a..b5e7fba 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 _0xb2f3=['show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id'];(function(_0x1b2071,_0x3b3149){var _0x1598aa=function(_0x5460bd){while(--_0x5460bd){_0x1b2071['push'](_0x1b2071['shift']());}};_0x1598aa(++_0x3b3149);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb2f3[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var path=require(_0x3b2f('0x2'));var timeout=require(_0x3b2f('0x3'));var express=require(_0x3b2f('0x4'));var router=express[_0x3b2f('0x5')]();var auth=require(_0x3b2f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3b2f('0x7'));var controller=require(_0x3b2f('0x8'));router[_0x3b2f('0x9')]('/',auth[_0x3b2f('0xa')](),controller[_0x3b2f('0xb')]);router[_0x3b2f('0x9')](_0x3b2f('0xc'),auth['isAuthenticated'](),controller[_0x3b2f('0xd')]);router['post']('/',auth[_0x3b2f('0xa')](),controller[_0x3b2f('0xe')]);router[_0x3b2f('0xf')](_0x3b2f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3b2f('0x10')](_0x3b2f('0xc'),auth[_0x3b2f('0xa')](),controller[_0x3b2f('0x11')]);module[_0x3b2f('0x12')]=router; \ No newline at end of file +var _0xb016=['delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','show','post','put','/:id','update'];(function(_0x276846,_0x7c88b0){var _0x25a493=function(_0x31d735){while(--_0x31d735){_0x276846['push'](_0x276846['shift']());}};_0x25a493(++_0x7c88b0);}(_0xb016,0x159));var _0x6b01=function(_0x1ded18,_0x1c6634){_0x1ded18=_0x1ded18-0x0;var _0x5ef7cd=_0xb016[_0x1ded18];return _0x5ef7cd;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var auth=require(_0x6b01('0x3'));var interaction=require(_0x6b01('0x4'));var config=require(_0x6b01('0x5'));var controller=require(_0x6b01('0x6'));router['get']('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0x8')]);router[_0x6b01('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0xa')]);router[_0x6b01('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b01('0xc')](_0x6b01('0xd'),auth[_0x6b01('0x7')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0x10')]);module[_0x6b01('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 8d2f97b..1b73b19 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 _0xe48c=['STRING','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','ENUM','yes'];(function(_0x4bb353,_0x23d4de){var _0x46a8bb=function(_0x5af20b){while(--_0x5af20b){_0x4bb353['push'](_0x4bb353['shift']());}};_0x46a8bb(++_0x23d4de);}(_0xe48c,0x147));var _0xce48=function(_0x3f2c9b,_0x277794){_0x3f2c9b=_0x3f2c9b-0x0;var _0x542039=_0xe48c[_0x3f2c9b];return _0x542039;};'use strict';var Sequelize=require(_0xce48('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0xce48('0x1')](_0xce48('0x2'),'no'),'defaultValue':_0xce48('0x2')},'headerinfo':{'type':Sequelize[_0xce48('0x3')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xce48('0x4')},'minrate':{'type':Sequelize[_0xce48('0x1')](_0xce48('0x5'),_0xce48('0x6'),_0xce48('0x7'),_0xce48('0x8'),_0xce48('0x9'),_0xce48('0xa')),'defaultValue':_0xce48('0x6')},'maxrate':{'type':Sequelize[_0xce48('0x1')](_0xce48('0x5'),_0xce48('0x6'),'7200',_0xce48('0x8'),_0xce48('0x9'),_0xce48('0xa')),'defaultValue':_0xce48('0xa')},'modem':{'type':Sequelize[_0xce48('0x3')],'defaultValue':_0xce48('0xb')},'gateway':{'type':Sequelize[_0xce48('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xce48('0x3')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xce48('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xce48('0x1')](_0xce48('0xd'),'IAX','DADHI',_0xce48('0xe')),'defaultValue':_0xce48('0xd')},'key':{'type':Sequelize[_0xce48('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xce48('0xf')],'defaultValue':function(){return _0xce48('0x10');}},'notificationSound':{'type':Sequelize[_0xce48('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xce48('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xce48('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xce48('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xce48('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xce48('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xce48('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xce48('0x11')],'defaultValue':![],'comment':_0xce48('0x12'),'set':function(_0x251a67){if(!_0x251a67)this[_0xce48('0x13')](_0xce48('0x14'),null);this[_0xce48('0x13')](_0xce48('0x15'),_0x251a67);}}}; \ No newline at end of file +var _0xe88f=['localstationid','4800','7200','14400','9600','12000','SIP','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x549d00,_0x3ad946){var _0x46b21d=function(_0x1a2f32){while(--_0x1a2f32){_0x549d00['push'](_0x549d00['shift']());}};_0x46b21d(++_0x3ad946);}(_0xe88f,0x186));var _0xfe88=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0xe88f[_0x5bd4f6];return _0x33a165;};'use strict';var Sequelize=require(_0xfe88('0x0'));module[_0xfe88('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfe88('0x2')]},'ecm':{'type':Sequelize[_0xfe88('0x3')](_0xfe88('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xfe88('0x2')],'defaultValue':_0xfe88('0x5')},'localstationid':{'type':Sequelize[_0xfe88('0x2')],'unique':_0xfe88('0x6')},'minrate':{'type':Sequelize['ENUM']('2400',_0xfe88('0x7'),_0xfe88('0x8'),'9600','12000',_0xfe88('0x9')),'defaultValue':_0xfe88('0x7')},'maxrate':{'type':Sequelize[_0xfe88('0x3')]('2400',_0xfe88('0x7'),'7200',_0xfe88('0xa'),_0xfe88('0xb'),'14400'),'defaultValue':_0xfe88('0x9')},'modem':{'type':Sequelize[_0xfe88('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xfe88('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xfe88('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfe88('0x3')](_0xfe88('0xc'),'IAX',_0xfe88('0xd'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfe88('0xe')],'defaultValue':function(){return _0xfe88('0xf');}},'notificationSound':{'type':Sequelize[_0xfe88('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfe88('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfe88('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfe88('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe88('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfe88('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0xfe88('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x264a86){if(!_0x264a86)this[_0xfe88('0x13')](_0xfe88('0x14'),null);this['setDataValue'](_0xfe88('0x15'),_0x264a86);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 623f546..5df127c 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 _0xb125=['dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','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~!@#$%^&-_=+[{]}.','request','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','FaxAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','FaxAccount','findAll','show','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','getDispositions','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','format','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','ContactId'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb125,0xcd));var _0x5b12=function(_0x3cadff,_0xf88fa1){_0x3cadff=_0x3cadff-0x0;var _0x6c9fbe=_0xb125[_0x3cadff];return _0x6c9fbe;};'use strict';var pdf=require(_0x5b12('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5b12('0x1'));var zipdir=require(_0x5b12('0x2'));var jsonpatch=require(_0x5b12('0x3'));var rp=require('request-promise');var moment=require(_0x5b12('0x4'));var BPromise=require(_0x5b12('0x5'));var Mustache=require(_0x5b12('0x6'));var util=require('util');var path=require(_0x5b12('0x7'));var sox=require(_0x5b12('0x8'));var csv=require(_0x5b12('0x9'));var ejs=require(_0x5b12('0xa'));var fs=require('fs');var _=require(_0x5b12('0xb'));var squel=require(_0x5b12('0xc'));var crypto=require(_0x5b12('0xd'));var jsforce=require(_0x5b12('0xe'));var deskjs=require(_0x5b12('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5b12('0x10'));var Redis=require(_0x5b12('0x11'));var authService=require(_0x5b12('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b12('0x13'));var logger=require(_0x5b12('0x14'))(_0x5b12('0x15'));var utils=require(_0x5b12('0x16'));var config=require('../../config/environment');var db=require(_0x5b12('0x17'))['db'];config[_0x5b12('0x18')]=_[_0x5b12('0x19')](config[_0x5b12('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b12('0x1a'))(new Redis(config[_0x5b12('0x18')]));require(_0x5b12('0x1b'))[_0x5b12('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5b12('0x1d')][_0x5b12('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x5b12('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xd6986c,_0x551c8f,_0x32275f){if(_0x32275f){var _0x244cd6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x244cd6[_0x5b12('0x1f')](_0x551c8f)){return _0xd6986c;}else{throw new db['Sequelize']['ValidationError'](_0x5b12('0x20'));}}else{return _0xd6986c;}}function respondWithRpcPromise(_0x1936a8,_0x47d6c7,_0x3dbe9c,_0x36bbfd){return new BPromise(function(_0x3b64a9,_0x4b37fa){var _0x29951b=_0x36bbfd||client;return _0x29951b[_0x5b12('0x21')](_0x1936a8,_0x3dbe9c)['then'](function(_0x236142){logger[_0x5b12('0x22')]('FaxAccount,\x20%s,\x20%s',_0x47d6c7,_0x5b12('0x23'));logger['debug'](_0x5b12('0x24'),_0x47d6c7,_0x5b12('0x23'),JSON[_0x5b12('0x25')](_0x236142));if(_0x236142[_0x5b12('0x26')]){if(_0x236142[_0x5b12('0x26')][_0x5b12('0x27')]===0x1f4){logger['error'](_0x5b12('0x28'),_0x47d6c7,_0x236142[_0x5b12('0x26')][_0x5b12('0x29')]);return _0x4b37fa(_0x236142[_0x5b12('0x26')][_0x5b12('0x29')]);}logger[_0x5b12('0x26')]('FaxAccount,\x20%s,\x20%s',_0x47d6c7,_0x236142['error']['message']);return _0x3b64a9(_0x236142[_0x5b12('0x26')][_0x5b12('0x29')]);}else{logger[_0x5b12('0x22')]('FaxAccount,\x20%s,\x20%s',_0x47d6c7,_0x5b12('0x23'));_0x3b64a9(_0x236142[_0x5b12('0x2a')][_0x5b12('0x29')]);}})[_0x5b12('0x2b')](function(_0x858e6a){logger[_0x5b12('0x26')]('FaxAccount,\x20%s,\x20%s',_0x47d6c7,_0x858e6a);_0x4b37fa(_0x858e6a);});});}function respondWithStatusCode(_0xf1ba51,_0x2ab451){_0x2ab451=_0x2ab451||0xcc;return function(_0xefad8e){if(_0xefad8e){return _0xf1ba51[_0x5b12('0x2c')](_0x2ab451);}return _0xf1ba51[_0x5b12('0x2d')](_0x2ab451)[_0x5b12('0x2e')]();};}function respondWithResult(_0x2291e2,_0x1616fa){_0x1616fa=_0x1616fa||0xc8;return function(_0x440838){if(_0x440838){return _0x2291e2[_0x5b12('0x2d')](_0x1616fa)[_0x5b12('0x2f')](_0x440838);}};}function respondWithFilteredResult(_0x1a2902,_0x5c174e){return function(_0x1d6927){if(_0x1d6927){var _0x14f8f2=_0x1d6927[_0x5b12('0x30')],_0x1c59da=_0x5c174e['offset'],_0x3e04b0=_0x5c174e[_0x5b12('0x31')]+_0x5c174e[_0x5b12('0x32')],_0x5d8fba;if(_0x3e04b0>=_0x14f8f2){_0x3e04b0=_0x14f8f2;_0x5d8fba=0xc8;}else{_0x5d8fba=0xce;}_0x1a2902['status'](_0x5d8fba);return _0x1a2902[_0x5b12('0x33')](_0x5b12('0x34'),_0x1c59da+'-'+_0x3e04b0+'/'+_0x14f8f2)[_0x5b12('0x2f')](_0x1d6927);}return null;};}function patchUpdates(_0x2207e2){return function(_0x37650d){try{jsonpatch[_0x5b12('0x35')](_0x37650d,_0x2207e2,!![]);}catch(_0x684e23){return BPromise['reject'](_0x684e23);}return _0x37650d[_0x5b12('0x36')]();};}function saveUpdates(_0x17a647,_0x33833d){return function(_0x47adfb){if(_0x47adfb){return _0x47adfb[_0x5b12('0x37')](_0x17a647)[_0x5b12('0x38')](function(_0x370f35){return _0x370f35;});}return null;};}function removeEntity(_0xe5dc06,_0xbe0a57){return function(_0x239f9f){if(_0x239f9f){return _0x239f9f[_0x5b12('0x39')]()['then'](function(){var _0x13d7b4=_0x239f9f[_0x5b12('0x3a')]({'plain':!![]});var _0x395af6=_0x5b12('0x3b');return db[_0x5b12('0x3c')][_0x5b12('0x39')]({'where':{'type':_0x395af6,'resourceId':_0x13d7b4['id']}})['then'](function(){return _0x239f9f;});})[_0x5b12('0x38')](function(){_0xe5dc06[_0x5b12('0x2d')](0xcc)[_0x5b12('0x2e')]();});}};}function handleEntityNotFound(_0x56cab7,_0x1a105d){return function(_0x1a51e3){if(!_0x1a51e3){_0x56cab7['sendStatus'](0x194);}return _0x1a51e3;};}function handleError(_0x246915,_0x1f8c35){_0x1f8c35=_0x1f8c35||0x1f4;return function(_0x2088c4){logger[_0x5b12('0x26')](_0x2088c4[_0x5b12('0x3d')]);if(_0x2088c4['name']){delete _0x2088c4['name'];}_0x246915['status'](_0x1f8c35)[_0x5b12('0x3e')](_0x2088c4);};}exports[_0x5b12('0x3f')]=function(_0x3412d8,_0x233bd5){var _0x1a708e={'include':[{'model':db[_0x5b12('0x40')],'as':_0x5b12('0x41')}]},_0x50d5a5={},_0x1e712d={'count':0x0,'rows':[]};var _0x38f9d5=_[_0x5b12('0x42')](db['FaxAccount'][_0x5b12('0x43')],function(_0x3939bf){return{'name':_0x3939bf[_0x5b12('0x44')],'type':_0x3939bf['type']['key']};});_0x50d5a5[_0x5b12('0x45')]=_[_0x5b12('0x42')](_0x38f9d5,_0x5b12('0x46'));_0x50d5a5['query']=_[_0x5b12('0x47')](_0x3412d8[_0x5b12('0x48')]);_0x50d5a5[_0x5b12('0x49')]=_[_0x5b12('0x4a')](_0x50d5a5[_0x5b12('0x45')],_0x50d5a5['query']);_0x1a708e[_0x5b12('0x4b')]=_['intersection'](_0x50d5a5[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0x3412d8[_0x5b12('0x48')][_0x5b12('0x4c')]));_0x1a708e[_0x5b12('0x4b')]=_0x1a708e[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x1a708e[_0x5b12('0x4b')]:_0x50d5a5[_0x5b12('0x45')];if(!_0x3412d8[_0x5b12('0x48')][_0x5b12('0x4e')]('nolimit')){_0x1a708e['limit']=qs[_0x5b12('0x32')](_0x3412d8[_0x5b12('0x48')]['limit']);_0x1a708e[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x3412d8['query'][_0x5b12('0x31')]);}_0x1a708e[_0x5b12('0x4f')]=qs[_0x5b12('0x50')](_0x3412d8[_0x5b12('0x48')]['sort']);_0x1a708e['where']=qs['filters'](_[_0x5b12('0x51')](_0x3412d8['query'],_0x50d5a5['filters']),_0x38f9d5);if(_0x3412d8[_0x5b12('0x48')][_0x5b12('0x52')]){_0x1a708e[_0x5b12('0x53')]=_[_0x5b12('0x54')](_0x1a708e[_0x5b12('0x53')],{'$or':_[_0x5b12('0x42')](_0x38f9d5,function(_0x2de37e){if(_0x2de37e[_0x5b12('0x55')]!==_0x5b12('0x56')){var _0x16fd94={};_0x16fd94[_0x2de37e[_0x5b12('0x46')]]={'$like':'%'+_0x3412d8[_0x5b12('0x48')][_0x5b12('0x52')]+'%'};return _0x16fd94;}})});}_0x1a708e=_[_0x5b12('0x54')]({},_0x1a708e,_0x3412d8[_0x5b12('0x57')]);var _0x28f92c={'where':_0x1a708e['where']};return db['FaxAccount'][_0x5b12('0x30')](_0x28f92c)['then'](function(_0x1ac963){_0x1e712d[_0x5b12('0x30')]=_0x1ac963;if(_0x3412d8[_0x5b12('0x48')][_0x5b12('0x58')]){_0x1a708e[_0x5b12('0x59')]=[{'all':!![]}];}return db[_0x5b12('0x5a')][_0x5b12('0x5b')](_0x1a708e);})['then'](function(_0x2e7a41){_0x1e712d['rows']=_0x2e7a41;return _0x1e712d;})[_0x5b12('0x38')](respondWithFilteredResult(_0x233bd5,_0x1a708e))[_0x5b12('0x2b')](handleError(_0x233bd5,null));};exports[_0x5b12('0x5c')]=function(_0x4ca65b,_0x138cbd){var _0x1af521={'raw':![],'where':{'id':_0x4ca65b['params']['id']},'include':[{'model':db[_0x5b12('0x40')],'as':'mandatoryDispositionPause'}]},_0x24523e={};_0x24523e[_0x5b12('0x45')]=_[_0x5b12('0x47')](db[_0x5b12('0x5a')]['rawAttributes']);_0x24523e[_0x5b12('0x48')]=_['keys'](_0x4ca65b[_0x5b12('0x48')]);_0x24523e[_0x5b12('0x49')]=_[_0x5b12('0x4a')](_0x24523e[_0x5b12('0x45')],_0x24523e[_0x5b12('0x48')]);_0x1af521[_0x5b12('0x4b')]=_[_0x5b12('0x4a')](_0x24523e[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0x4ca65b[_0x5b12('0x48')][_0x5b12('0x4c')]));_0x1af521[_0x5b12('0x4b')]=_0x1af521[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x1af521[_0x5b12('0x4b')]:_0x24523e['model'];if(_0x4ca65b[_0x5b12('0x48')][_0x5b12('0x58')]){_0x1af521['include']=[{'all':!![]}];}_0x1af521=_['merge']({},_0x1af521,_0x4ca65b[_0x5b12('0x57')]);return db[_0x5b12('0x5a')]['find'](_0x1af521)['then'](handleEntityNotFound(_0x138cbd,null))[_0x5b12('0x38')](respondWithResult(_0x138cbd,null))[_0x5b12('0x2b')](handleError(_0x138cbd,null));};exports[_0x5b12('0x5d')]=function(_0x5f4336,_0x177404){return db['FaxAccount'][_0x5b12('0x5d')](_0x5f4336[_0x5b12('0x5e')],{})['then'](function(_0x5c6712){var _0x361254=_0x5f4336[_0x5b12('0x5f')][_0x5b12('0x3a')]({'plain':!![]});if(!_0x361254)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x361254[_0x5b12('0x60')]===_0x5b12('0x5f')){var _0x2dd4c6=_0x5c6712[_0x5b12('0x3a')]({'plain':!![]});var _0x520cb6=_0x5b12('0x3b');return db[_0x5b12('0x61')][_0x5b12('0x62')]({'where':{'name':_0x520cb6,'userProfileId':_0x361254['userProfileId']},'raw':!![]})[_0x5b12('0x38')](function(_0x539b53){if(_0x539b53&&_0x539b53[_0x5b12('0x63')]===0x0){return db[_0x5b12('0x3c')]['create']({'name':_0x2dd4c6['name'],'resourceId':_0x2dd4c6['id'],'type':_0x539b53[_0x5b12('0x46')],'sectionId':_0x539b53['id']},{})[_0x5b12('0x38')](function(){return _0x5c6712;});}else{return _0x5c6712;}})['catch'](function(_0x5536b5){logger[_0x5b12('0x26')](_0x5b12('0x64'),_0x5536b5);throw _0x5536b5;});}return _0x5c6712;})[_0x5b12('0x38')](respondWithResult(_0x177404,0xc9))[_0x5b12('0x2b')](handleError(_0x177404,null));};exports[_0x5b12('0x37')]=function(_0x450866,_0x4b13cd){if(_0x450866[_0x5b12('0x5e')]['id']){delete _0x450866['body']['id'];}return db[_0x5b12('0x5a')]['find']({'where':{'id':_0x450866[_0x5b12('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x5b12('0x41')}]})[_0x5b12('0x38')](handleEntityNotFound(_0x4b13cd,null))[_0x5b12('0x38')](saveUpdates(_0x450866['body'],null))['then'](respondWithResult(_0x4b13cd,null))[_0x5b12('0x2b')](handleError(_0x4b13cd,null));};exports[_0x5b12('0x39')]=function(_0x1c66c1,_0x3c592e){return db['FaxAccount'][_0x5b12('0x62')]({'where':{'id':_0x1c66c1[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x3c592e,null))[_0x5b12('0x38')](removeEntity(_0x3c592e,null))[_0x5b12('0x2b')](handleError(_0x3c592e,null));};exports['describe']=function(_0x119da3,_0x5576eb){return db[_0x5b12('0x5a')][_0x5b12('0x66')]()[_0x5b12('0x38')](respondWithResult(_0x5576eb,null))[_0x5b12('0x2b')](handleError(_0x5576eb,null));};exports['addDisposition']=function(_0x1ca6f9,_0x1e3de8,_0x31315e){if(_0x1ca6f9['body']['id']){delete _0x1ca6f9[_0x5b12('0x5e')]['id'];}return db[_0x5b12('0x5a')][_0x5b12('0x62')]({'where':{'id':_0x1ca6f9[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x1e3de8,null))[_0x5b12('0x38')](function(_0x599692){if(_0x599692){_0x1ca6f9[_0x5b12('0x5e')][_0x5b12('0x67')]=_0x599692['id'];return db[_0x5b12('0x68')][_0x5b12('0x5d')](_0x1ca6f9[_0x5b12('0x5e')]);}})[_0x5b12('0x38')](respondWithResult(_0x1e3de8,null))[_0x5b12('0x2b')](handleError(_0x1e3de8,null));};exports[_0x5b12('0x69')]=function(_0x9c73cf,_0x3b994b,_0x12a4ff){var _0x1cae17={'raw':![],'where':{}};var _0x432e10={};var _0x3fbf12={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x9c73cf[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x3b994b,null))[_0x5b12('0x38')](function(_0x273892){if(_0x273892){_0x432e10[_0x5b12('0x45')]=_[_0x5b12('0x47')](db[_0x5b12('0x68')]['rawAttributes']);_0x432e10[_0x5b12('0x48')]=_[_0x5b12('0x47')](_0x9c73cf[_0x5b12('0x48')]);_0x432e10['filters']=_[_0x5b12('0x4a')](_0x432e10[_0x5b12('0x45')],_0x432e10[_0x5b12('0x48')]);_0x1cae17[_0x5b12('0x4b')]=_[_0x5b12('0x4a')](_0x432e10[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0x9c73cf['query'][_0x5b12('0x4c')]));_0x1cae17[_0x5b12('0x4b')]=_0x1cae17['attributes']['length']?_0x1cae17['attributes']:_0x432e10[_0x5b12('0x45')];if(!_0x9c73cf[_0x5b12('0x48')][_0x5b12('0x4e')](_0x5b12('0x6a'))){_0x1cae17['limit']=qs['limit'](_0x9c73cf[_0x5b12('0x48')][_0x5b12('0x32')]);_0x1cae17[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x9c73cf[_0x5b12('0x48')][_0x5b12('0x31')]);}_0x1cae17['order']=qs[_0x5b12('0x50')](_0x9c73cf[_0x5b12('0x48')][_0x5b12('0x50')]);_0x1cae17[_0x5b12('0x53')]=qs[_0x5b12('0x49')](_['pick'](_0x9c73cf[_0x5b12('0x48')],_0x432e10[_0x5b12('0x49')]));_0x1cae17[_0x5b12('0x53')][_0x5b12('0x67')]=_0x273892['id'];if(_0x9c73cf['query']['filter']){_0x1cae17['where']=_[_0x5b12('0x54')](_0x1cae17[_0x5b12('0x53')],{'$or':_[_0x5b12('0x42')](_0x1cae17[_0x5b12('0x4b')],function(_0x543846){var _0x543db1={};_0x543db1[_0x543846]={'$like':'%'+_0x9c73cf['query']['filter']+'%'};return _0x543db1;})});}_0x1cae17=_['merge']({},_0x1cae17,_0x9c73cf[_0x5b12('0x57')]);return db[_0x5b12('0x68')]['count']({'where':_0x1cae17['where']})[_0x5b12('0x38')](function(_0x3aa0be){_0x3fbf12[_0x5b12('0x30')]=_0x3aa0be;if(_0x9c73cf[_0x5b12('0x48')][_0x5b12('0x58')]){_0x1cae17[_0x5b12('0x59')]=[{'all':!![]}];}return db[_0x5b12('0x68')][_0x5b12('0x5b')](_0x1cae17);})[_0x5b12('0x38')](function(_0x45423f){_0x3fbf12[_0x5b12('0x6b')]=_0x45423f;return _0x3fbf12;});}})[_0x5b12('0x38')](respondWithFilteredResult(_0x3b994b,_0x1cae17))[_0x5b12('0x2b')](handleError(_0x3b994b,null));};exports[_0x5b12('0x6c')]=function(_0x1f67f8,_0x4d6c87,_0x1ec4c2){return db['FaxAccount'][_0x5b12('0x62')]({'where':{'id':_0x1f67f8['params']['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x4d6c87,null))[_0x5b12('0x38')](function(_0x409ee3){if(_0x409ee3){return _0x409ee3['removeDispositions'](_0x1f67f8['query'][_0x5b12('0x6d')]);}})[_0x5b12('0x38')](respondWithStatusCode(_0x4d6c87,null))[_0x5b12('0x2b')](handleError(_0x4d6c87,null));};exports[_0x5b12('0x6e')]=function(_0x51459f,_0x1e2e2f,_0x58b732){if(_0x51459f['body']['id']){delete _0x51459f[_0x5b12('0x5e')]['id'];}return db[_0x5b12('0x5a')][_0x5b12('0x62')]({'where':{'id':_0x51459f['params']['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x1e2e2f,null))[_0x5b12('0x38')](function(_0x308e43){if(_0x308e43){_0x51459f[_0x5b12('0x5e')]['FaxAccountId']=_0x308e43['id'];return db[_0x5b12('0x6f')][_0x5b12('0x5d')](_0x51459f[_0x5b12('0x5e')]);}})[_0x5b12('0x38')](respondWithResult(_0x1e2e2f,null))[_0x5b12('0x2b')](handleError(_0x1e2e2f,null));};exports[_0x5b12('0x70')]=function(_0xa7e442,_0x9acfca,_0x791b58){var _0x222cc5={'raw':![],'where':{}};var _0x1a2bab={};var _0x1cd0f4={'count':0x0,'rows':[]};return db[_0x5b12('0x5a')][_0x5b12('0x71')]({'where':{'id':_0xa7e442[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x9acfca,null))[_0x5b12('0x38')](function(_0xd6c1a0){if(_0xd6c1a0){_0x1a2bab[_0x5b12('0x45')]=_[_0x5b12('0x47')](db[_0x5b12('0x6f')]['rawAttributes']);_0x1a2bab['query']=_[_0x5b12('0x47')](_0xa7e442[_0x5b12('0x48')]);_0x1a2bab[_0x5b12('0x49')]=_[_0x5b12('0x4a')](_0x1a2bab[_0x5b12('0x45')],_0x1a2bab[_0x5b12('0x48')]);_0x222cc5['attributes']=_[_0x5b12('0x4a')](_0x1a2bab[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0xa7e442[_0x5b12('0x48')][_0x5b12('0x4c')]));_0x222cc5[_0x5b12('0x4b')]=_0x222cc5[_0x5b12('0x4b')]['length']?_0x222cc5[_0x5b12('0x4b')]:_0x1a2bab['model'];if(!_0xa7e442[_0x5b12('0x48')][_0x5b12('0x4e')](_0x5b12('0x6a'))){_0x222cc5['limit']=qs[_0x5b12('0x32')](_0xa7e442[_0x5b12('0x48')]['limit']);_0x222cc5['offset']=qs[_0x5b12('0x31')](_0xa7e442['query'][_0x5b12('0x31')]);}_0x222cc5[_0x5b12('0x4f')]=qs['sort'](_0xa7e442[_0x5b12('0x48')][_0x5b12('0x50')]);_0x222cc5['where']=qs['filters'](_[_0x5b12('0x51')](_0xa7e442['query'],_0x1a2bab[_0x5b12('0x49')]));_0x222cc5[_0x5b12('0x53')][_0x5b12('0x67')]=_0xd6c1a0['id'];if(_0xa7e442[_0x5b12('0x48')]['filter']){_0x222cc5[_0x5b12('0x53')]=_[_0x5b12('0x54')](_0x222cc5['where'],{'$or':_['map'](_0x222cc5['attributes'],function(_0x553ea8){var _0x4ad4ef={};_0x4ad4ef[_0x553ea8]={'$like':'%'+_0xa7e442['query'][_0x5b12('0x52')]+'%'};return _0x4ad4ef;})});}_0x222cc5=_[_0x5b12('0x54')]({},_0x222cc5,_0xa7e442['options']);return db[_0x5b12('0x6f')][_0x5b12('0x30')]({'where':_0x222cc5[_0x5b12('0x53')]})[_0x5b12('0x38')](function(_0x18f73b){_0x1cd0f4[_0x5b12('0x30')]=_0x18f73b;if(_0xa7e442[_0x5b12('0x48')][_0x5b12('0x58')]){_0x222cc5[_0x5b12('0x59')]=[{'all':!![]}];}return db[_0x5b12('0x6f')][_0x5b12('0x5b')](_0x222cc5);})[_0x5b12('0x38')](function(_0x58cf88){_0x1cd0f4[_0x5b12('0x6b')]=_0x58cf88;return _0x1cd0f4;});}})[_0x5b12('0x38')](respondWithFilteredResult(_0x9acfca,_0x222cc5))[_0x5b12('0x2b')](handleError(_0x9acfca,null));};exports[_0x5b12('0x72')]=function(_0x85944a,_0x2ee94d,_0x2572ea){return db[_0x5b12('0x5a')][_0x5b12('0x62')]({'where':{'id':_0x85944a['params']['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x2ee94d,null))[_0x5b12('0x38')](function(_0x1e1fb4){if(_0x1e1fb4){return _0x1e1fb4[_0x5b12('0x72')](_0x85944a[_0x5b12('0x48')][_0x5b12('0x6d')]);}})[_0x5b12('0x38')](respondWithStatusCode(_0x2ee94d,null))[_0x5b12('0x2b')](handleError(_0x2ee94d,null));};exports[_0x5b12('0x73')]=function(_0x2d6484,_0xeb4c3a,_0x4429f2){return db[_0x5b12('0x74')][_0x5b12('0x62')]({'where':{'id':_0x2d6484[_0x5b12('0x65')]['id']}})['then'](handleEntityNotFound(_0xeb4c3a,null))['then'](function(_0x29d3e8){if(_0x29d3e8){return _0x29d3e8[_0x5b12('0x73')](_0x2d6484[_0x5b12('0x5e')][_0x5b12('0x6d')],_[_0x5b12('0x75')](_0x2d6484['body'],[_0x5b12('0x6d'),'id'])||{});}})[_0x5b12('0x38')](respondWithResult(_0xeb4c3a,null))[_0x5b12('0x2b')](handleError(_0xeb4c3a,null));};exports['getInteractions']=function(_0x3f105c,_0x4d9c0b,_0xaa43b4){var _0x2fa8eb={'raw':![],'where':{}};var _0x42a16f={};var _0x464167={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5b12('0x71')]({'where':{'id':_0x3f105c[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x4d9c0b,null))[_0x5b12('0x38')](function(_0x49eaa5){if(_0x49eaa5){_0x42a16f[_0x5b12('0x45')]=_[_0x5b12('0x47')](db[_0x5b12('0x74')][_0x5b12('0x43')]);_0x42a16f[_0x5b12('0x48')]=_[_0x5b12('0x47')](_0x3f105c[_0x5b12('0x48')]);_0x42a16f[_0x5b12('0x49')]=_[_0x5b12('0x4a')](_0x42a16f[_0x5b12('0x45')],_0x42a16f['query']);_0x2fa8eb[_0x5b12('0x4b')]=_[_0x5b12('0x4a')](_0x42a16f[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0x3f105c[_0x5b12('0x48')]['fields']));_0x2fa8eb['attributes']=_0x2fa8eb[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x2fa8eb[_0x5b12('0x4b')]:_0x42a16f[_0x5b12('0x45')];if(!_0x3f105c[_0x5b12('0x48')][_0x5b12('0x4e')](_0x5b12('0x6a'))){_0x2fa8eb[_0x5b12('0x32')]=qs[_0x5b12('0x32')](_0x3f105c[_0x5b12('0x48')][_0x5b12('0x32')]);_0x2fa8eb[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x3f105c[_0x5b12('0x48')][_0x5b12('0x31')]);}_0x2fa8eb[_0x5b12('0x4f')]=qs[_0x5b12('0x50')](_0x3f105c[_0x5b12('0x48')][_0x5b12('0x50')]);_0x2fa8eb[_0x5b12('0x53')]=qs[_0x5b12('0x49')](_[_0x5b12('0x51')](_0x3f105c[_0x5b12('0x48')],_0x42a16f[_0x5b12('0x49')]));_0x2fa8eb['where'][_0x5b12('0x67')]=_0x49eaa5['id'];if(_0x3f105c['query']['filter']){_0x2fa8eb[_0x5b12('0x53')]=_[_0x5b12('0x54')](_0x2fa8eb[_0x5b12('0x53')],{'$or':_[_0x5b12('0x42')](_0x2fa8eb[_0x5b12('0x4b')],function(_0x21c0c6){var _0x3dd446={};_0x3dd446[_0x21c0c6]={'$like':'%'+_0x3f105c[_0x5b12('0x48')][_0x5b12('0x52')]+'%'};return _0x3dd446;})});}_0x2fa8eb=_[_0x5b12('0x54')]({},_0x2fa8eb,_0x3f105c[_0x5b12('0x57')]);return db[_0x5b12('0x74')][_0x5b12('0x30')]({'where':_0x2fa8eb[_0x5b12('0x53')]})[_0x5b12('0x38')](function(_0x16b9ff){_0x464167['count']=_0x16b9ff;if(_0x3f105c['query'][_0x5b12('0x58')]){_0x2fa8eb['include']=[{'model':db[_0x5b12('0x76')],'as':_0x5b12('0x77'),'required':![]},{'model':db['User'],'as':_0x5b12('0x78'),'attributes':['name','fullname',_0x5b12('0x79')],'required':![]},{'model':db[_0x5b12('0x7a')],'as':_0x5b12('0x7b'),'attributes':['id','name',_0x5b12('0x7c')],'where':_0x3f105c[_0x5b12('0x48')][_0x5b12('0x7d')]?{'id':_0x3f105c[_0x5b12('0x48')][_0x5b12('0x7d')]}:undefined,'required':_0x3f105c[_0x5b12('0x48')][_0x5b12('0x7d')]?!![]:![]}];}return db[_0x5b12('0x74')][_0x5b12('0x5b')](_0x2fa8eb);})[_0x5b12('0x38')](function(_0x516010){_0x464167[_0x5b12('0x6b')]=_0x516010;return _0x464167;});}})[_0x5b12('0x38')](respondWithFilteredResult(_0x4d9c0b,_0x2fa8eb))[_0x5b12('0x2b')](handleError(_0x4d9c0b,null));};exports[_0x5b12('0x7e')]=function(_0x3f59e7,_0x1126ba,_0x454b3d){return db['FaxAccount'][_0x5b12('0x71')]({'where':{'id':_0x3f59e7['params']['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x1126ba,null))[_0x5b12('0x38')](function(_0x2bd72f){if(_0x2bd72f){return db[_0x5b12('0x7f')][_0x5b12('0x80')](function(_0x1e9cce){return db[_0x5b12('0x81')][_0x5b12('0x39')]({'where':{'FaxAccountId':_0x3f59e7[_0x5b12('0x65')]['id']},'transaction':_0x1e9cce})[_0x5b12('0x38')](function(_0x19b37c){var _0x2c87f4=_[_0x5b12('0x42')](_0x3f59e7['body'],function(_0x25c955){_0x25c955[_0x5b12('0x67')]=_0x3f59e7[_0x5b12('0x65')]['id'];return _0x25c955;});return db[_0x5b12('0x81')][_0x5b12('0x82')](_0x2c87f4,{'transaction':_0x1e9cce});});})[_0x5b12('0x38')](function(){return db[_0x5b12('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x3f59e7[_0x5b12('0x65')]['id']},'order':_0x5b12('0x83')});});}})[_0x5b12('0x38')](respondWithResult(_0x1126ba,null))[_0x5b12('0x2b')](handleError(_0x1126ba,null));};exports['getApplications']=function(_0x3b88e0,_0xe3368,_0x54573e){var _0x2699b3={};var _0x428543={};var _0x11fce9;var _0x289961;return db['FaxAccount'][_0x5b12('0x71')]({'where':{'id':_0x3b88e0['params']['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0xe3368,null))['then'](function(_0x1b5f66){if(_0x1b5f66){_0x11fce9=_0x1b5f66;_0x428543[_0x5b12('0x45')]=_[_0x5b12('0x47')](db['FaxApplication'][_0x5b12('0x43')]);_0x428543[_0x5b12('0x48')]=_[_0x5b12('0x47')](_0x3b88e0[_0x5b12('0x48')]);_0x428543[_0x5b12('0x49')]=_[_0x5b12('0x4a')](_0x428543['model'],_0x428543[_0x5b12('0x48')]);_0x2699b3[_0x5b12('0x4b')]=_['intersection'](_0x428543[_0x5b12('0x45')],qs['fields'](_0x3b88e0['query'][_0x5b12('0x4c')]));_0x2699b3[_0x5b12('0x4b')]=_0x2699b3[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x2699b3[_0x5b12('0x4b')]:_0x428543['model'];_0x2699b3['order']=qs[_0x5b12('0x50')](_0x3b88e0['query'][_0x5b12('0x50')]);_0x2699b3['where']=qs[_0x5b12('0x49')](_[_0x5b12('0x51')](_0x3b88e0[_0x5b12('0x48')],_0x428543[_0x5b12('0x49')]));if(_0x3b88e0[_0x5b12('0x48')][_0x5b12('0x52')]){_0x2699b3[_0x5b12('0x53')]=_[_0x5b12('0x54')](_0x2699b3['where'],{'$or':_[_0x5b12('0x42')](_0x2699b3[_0x5b12('0x4b')],function(_0x35e505){var _0x55a774={};_0x55a774[_0x35e505]={'$like':'%'+_0x3b88e0[_0x5b12('0x48')][_0x5b12('0x52')]+'%'};return _0x55a774;})});}_0x2699b3=_[_0x5b12('0x54')]({},_0x2699b3,_0x3b88e0[_0x5b12('0x57')]);return _0x11fce9[_0x5b12('0x84')](_0x2699b3);}})['then'](function(_0x8606ff){if(_0x8606ff){_0x289961=_0x8606ff[_0x5b12('0x4d')];if(!_0x3b88e0[_0x5b12('0x48')][_0x5b12('0x4e')]('nolimit')){_0x2699b3[_0x5b12('0x32')]=qs[_0x5b12('0x32')](_0x3b88e0[_0x5b12('0x48')][_0x5b12('0x32')]);_0x2699b3[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x3b88e0[_0x5b12('0x48')][_0x5b12('0x31')]);}return _0x11fce9['getApplications'](_0x2699b3);}})['then'](function(_0x1d3c88){if(_0x1d3c88){return _0x1d3c88?{'count':_0x289961,'rows':_0x1d3c88}:null;}})['then'](respondWithResult(_0xe3368,null))[_0x5b12('0x2b')](handleError(_0xe3368,null));};function Extension(_0x499dae,_0x9dc26f,_0x49ae2b,_0x46162b){this[_0x5b12('0x85')]=_0x5b12('0x86');this[_0x5b12('0x87')]=_0x499dae[_0x5b12('0x88')];this[_0x5b12('0x89')]=_0x46162b;this[_0x5b12('0x55')]='system';this['description']=_0x5b12('0x8a');this[_0x5b12('0x67')]=_0x499dae['id'];this[_0x5b12('0x83')]=_0x9dc26f;this['appdata']=_0x49ae2b;}function createExtensionsReciveFax(_0x13fc6d){var _0x21862b=0x1;var _0xd16ee7=[];_0xd16ee7[_0x5b12('0x8b')](new Extension(_0x13fc6d,_0x21862b,'',_0x5b12('0x8c')));_0x21862b+=0x1;_0xd16ee7[_0x5b12('0x8b')](new Extension(_0x13fc6d,_0x21862b,_0x5b12('0x8d'),'Set'));_0x21862b+=0x1;for(var _0x8b2f0d in _0x13fc6d){if(_0x13fc6d[_0x5b12('0x4e')](_0x8b2f0d)&&(_0x8b2f0d===_0x5b12('0x8e')||_0x8b2f0d==='localstationid'||_0x8b2f0d===_0x5b12('0x8f')||_0x8b2f0d===_0x5b12('0x90')||_0x8b2f0d===_0x5b12('0x91')||_0x8b2f0d===_0x5b12('0x92')||_0x8b2f0d===_0x5b12('0x93')||_0x8b2f0d===_0x5b12('0x94')||_0x8b2f0d===_0x5b12('0x95'))){_0xd16ee7['push'](new Extension(_0x13fc6d,_0x21862b,_0x5b12('0x96')+_0x8b2f0d+')='+_0x13fc6d[_0x8b2f0d],'Set'));_0x21862b+=0x1;}}_0xd16ee7[_0x5b12('0x8b')](new Extension(_0x13fc6d,_0x21862b,'6',_0x5b12('0x97')));_0x21862b+=0x1;_0xd16ee7['push'](new Extension(_0x13fc6d,_0x21862b,'/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',_0x5b12('0x98')));_0x21862b=0x0;return _0xd16ee7;}exports[_0x5b12('0x99')]=function(_0x49bb19,_0xbc60ff,_0x1fe719){var _0x1d5fe5;return db['sequelize']['transaction'](function(_0x5bd35a){return db['FaxAccount']['create'](_0x49bb19[_0x5b12('0x5e')],{'transaction':_0x5bd35a})['then'](function(_0x1cefdb){_0x1d5fe5=_0x1cefdb['get']({'plain':!![]});return db[_0x5b12('0x9a')][_0x5b12('0x82')](createExtensionsReciveFax(_0x1d5fe5),{'transaction':_0x5bd35a});});})['then'](function(){return _0x1d5fe5;})[_0x5b12('0x38')](respondWithResult(_0xbc60ff,null))[_0x5b12('0x2b')](handleError(_0xbc60ff,null));};exports[_0x5b12('0x9b')]=function(_0x523467,_0x3cf4cf,_0x2d4542){var _0x389485;return db[_0x5b12('0x7f')]['transaction'](function(_0x4ed067){return db[_0x5b12('0x5a')][_0x5b12('0x37')](_0x523467[_0x5b12('0x5e')],{'where':{'id':_0x523467[_0x5b12('0x5e')]['id']},'transaction':_0x4ed067})[_0x5b12('0x38')](function(_0x330db8){return db[_0x5b12('0x9a')][_0x5b12('0x39')]({'where':{'FaxAccountId':_0x523467[_0x5b12('0x5e')]['id']},'transaction':_0x4ed067})['then'](function(_0xacbf25){return db[_0x5b12('0x9a')][_0x5b12('0x82')](createExtensionsReciveFax(_[_0x5b12('0x75')](_0x523467[_0x5b12('0x5e')],[_0x5b12('0x9c'),'key',_0x5b12('0x9d'),_0x5b12('0x9e'),_0x5b12('0x9f'),_0x5b12('0xa0')])),{'transaction':_0x4ed067});});});})[_0x5b12('0x38')](function(){return db[_0x5b12('0x5a')]['findById'](_0x523467[_0x5b12('0x5e')]['id']);})[_0x5b12('0x38')](respondWithResult(_0x3cf4cf,null))[_0x5b12('0x2b')](handleError(_0x3cf4cf,null));};exports[_0x5b12('0xa1')]=function(_0x54a22c,_0x838bae,_0x1380b5){var _0x1dc2a4={'raw':!![],'where':{}};var _0x5ec116={};var _0x50e371={'count':0x0,'rows':[]};return db[_0x5b12('0x5a')][_0x5b12('0x71')]({'where':{'id':_0x54a22c[_0x5b12('0x65')]['id']}})['then'](handleEntityNotFound(_0x838bae,null))[_0x5b12('0x38')](function(_0x59a282){if(_0x59a282){_0x5ec116[_0x5b12('0x45')]=_['keys'](db['FaxMessage'][_0x5b12('0x43')]);_0x5ec116[_0x5b12('0x48')]=_[_0x5b12('0x47')](_0x54a22c['query']);_0x5ec116['filters']=_['intersection'](_0x5ec116[_0x5b12('0x45')],_0x5ec116['query']);_0x1dc2a4[_0x5b12('0x4b')]=_['intersection'](_0x5ec116[_0x5b12('0x45')],qs['fields'](_0x54a22c['query'][_0x5b12('0x4c')]));_0x1dc2a4[_0x5b12('0x4b')]=_0x1dc2a4[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x1dc2a4['attributes']:_0x5ec116['model'];if(!_0x54a22c[_0x5b12('0x48')][_0x5b12('0x4e')](_0x5b12('0x6a'))){_0x1dc2a4[_0x5b12('0x32')]=qs[_0x5b12('0x32')](_0x54a22c['query'][_0x5b12('0x32')]);_0x1dc2a4[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x54a22c[_0x5b12('0x48')][_0x5b12('0x31')]);}_0x1dc2a4[_0x5b12('0x4f')]=qs[_0x5b12('0x50')](_0x54a22c[_0x5b12('0x48')][_0x5b12('0x50')]);_0x1dc2a4[_0x5b12('0x53')]=qs[_0x5b12('0x49')](_[_0x5b12('0x51')](_0x54a22c['query'],_0x5ec116[_0x5b12('0x49')]));_0x1dc2a4[_0x5b12('0x53')][_0x5b12('0x67')]=_0x59a282['id'];if(_0x54a22c[_0x5b12('0x48')][_0x5b12('0x52')]){_0x1dc2a4[_0x5b12('0x53')]=_[_0x5b12('0x54')](_0x1dc2a4[_0x5b12('0x53')],{'$or':_[_0x5b12('0x42')](_0x1dc2a4[_0x5b12('0x4b')],function(_0x546d60){var _0x2b606b={};_0x2b606b[_0x546d60]={'$like':'%'+_0x54a22c[_0x5b12('0x48')]['filter']+'%'};return _0x2b606b;})});}if(_0x54a22c['query']['$gte']){var _0x517c1e=_0x54a22c[_0x5b12('0x48')][_0x5b12('0xa2')][_0x5b12('0xa3')](',');var _0x24c9b2={};_0x24c9b2[_0x517c1e[0x0]]={'$gte':moment(_0x517c1e[0x1])[_0x5b12('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1dc2a4['where']=_[_0x5b12('0x54')](_0x1dc2a4[_0x5b12('0x53')],_0x24c9b2);}_0x1dc2a4=_[_0x5b12('0x54')]({},_0x1dc2a4,_0x54a22c['options']);return db[_0x5b12('0xa5')][_0x5b12('0x30')]({'where':_0x1dc2a4[_0x5b12('0x53')]})[_0x5b12('0x38')](function(_0x189f62){_0x50e371[_0x5b12('0x30')]=_0x189f62;if(_0x54a22c[_0x5b12('0x48')][_0x5b12('0x58')]){_0x1dc2a4[_0x5b12('0x59')]=[{'all':!![]}];}return db[_0x5b12('0xa5')]['findAll'](_0x1dc2a4);})[_0x5b12('0x38')](function(_0x5b572b){_0x50e371[_0x5b12('0x6b')]=_0x5b572b;return _0x50e371;});}})[_0x5b12('0x38')](respondWithFilteredResult(_0x838bae,_0x1dc2a4))[_0x5b12('0x2b')](handleError(_0x838bae,null));};exports[_0x5b12('0x3e')]=function(_0x44ad77,_0x456d91,_0x149d6c){var _0x3e117c,_0x20cb9e={},_0xd9f92d;if(_0x44ad77['body']['to']){_0xd9f92d=_0x44ad77[_0x5b12('0x5e')]['to'][0x0];}return db[_0x5b12('0x5a')][_0x5b12('0x62')]({'where':{'id':_0x44ad77['params']['id']},'include':[{'model':db[_0x5b12('0xa6')],'as':_0x5b12('0xa7'),'include':[{'model':db[_0x5b12('0x76')],'as':_0x5b12('0xa8'),'where':{'fax':_0xd9f92d},'limit':0x1,'order':[[_0x5b12('0x9e'),_0x5b12('0xa9')]]}]}]})['then'](handleEntityNotFound(_0x456d91,null))[_0x5b12('0x38')](function(_0x2ba646){_0x3e117c=_0x2ba646;if(_0x44ad77['body'][_0x5b12('0xaa')]&&_0x44ad77[_0x5b12('0x5e')]['attachments'][_0x5b12('0x4d')]){for(var _0x53fa5a=0x0;_0x53fa5a<_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')]['length'];_0x53fa5a+=0x1){_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][_0x53fa5a]={'filename':_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][_0x53fa5a]['name'],'id':_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][_0x53fa5a]['id'],'path':path[_0x5b12('0xab')](config[_0x5b12('0xac')],'server/files/attachments',_0x44ad77[_0x5b12('0x5e')]['attachments'][_0x53fa5a][_0x5b12('0xad')])};}}return respondWithRpcPromise(_0x5b12('0xae'),_0x5b12('0xae'),{'FaxAccountId':_[_0x5b12('0xaf')](_0x44ad77[_0x5b12('0x65')]['id'])?undefined:_0x44ad77[_0x5b12('0x65')]['id'],'path':_['isNil'](_0x44ad77['body'][_0x5b12('0xaa')][0x0][_0x5b12('0x7')])?undefined:_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][0x0]['path'],'fax':_[_0x5b12('0xaf')](_0x44ad77[_0x5b12('0x5e')]['to'][0x0])?undefined:_0x44ad77[_0x5b12('0x5e')]['to'][0x0]},client9002);})[_0x5b12('0x38')](function(){if(_0x3e117c){if(_['isNil'](_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xb0')])){_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xb0')]=util[_0x5b12('0xa4')](_0x5b12('0xb1'),_0x3e117c[_0x5b12('0x46')],_0x3e117c[_0x5b12('0xb2')]);}if(_0x3e117c[_0x5b12('0xa7')]){if(_0x3e117c[_0x5b12('0xa7')]['Contacts'][_0x5b12('0x4d')]){return _0x3e117c['List'][_0x5b12('0xa8')][0x0];}else{return db['CmContact']['create'](_[_0x5b12('0x19')](_0x44ad77['body'],{'firstName':_0x44ad77[_0x5b12('0x5e')]['to'][0x0],'phone':_0x44ad77['body']['to'][0x0],'fax':_0x44ad77[_0x5b12('0x5e')]['to'][0x0],'ListId':_0x3e117c[_0x5b12('0xa0')]}));}}else{throw new Error(_0x5b12('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x4cf4ab){if(_0x4cf4ab){return db[_0x5b12('0x74')][_0x5b12('0x62')]({'where':{'ContactId':_0x4cf4ab['id'],'closed':![],'FaxAccountId':_0x3e117c['id']}})['then'](function(_0x53dae2){if(_0x53dae2){return[_0x53dae2,![]];}return db[_0x5b12('0x74')][_0x5b12('0x5d')]({'UserId':_0x44ad77[_0x5b12('0x5f')]['id'],'ContactId':_0x4cf4ab['id'],'FaxAccountId':_0x3e117c['id'],'fax':_0x44ad77[_0x5b12('0x5e')]['to'][0x0],'firstMsgDirection':_0x5b12('0xb4'),'Messages':[_[_0x5b12('0x54')](_0x44ad77[_0x5b12('0x5e')],{'read':![],'body':_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][0x0][_0x5b12('0xb5')],'FaxAccountId':_0x3e117c['id'],'UserId':_0x44ad77[_0x5b12('0x5f')]['id'],'ContactId':_0x4cf4ab['id'],'AttachmentId':_0x44ad77['body'][_0x5b12('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x5b12('0xb6')}]})['then'](function(_0x6dc165){return[_0x6dc165,!![]];});});}else{throw new Error(_0x5b12('0xb7'));}})['spread'](function(_0x4964ae,_0x399e3a){if(_0x399e3a){return _0x4964ae;}return db[_0x5b12('0xa5')][_0x5b12('0x5d')]({'direction':'out','read':![],'body':_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][0x0][_0x5b12('0xb5')],'FaxAccountId':_0x3e117c['id'],'FaxInteractionId':_0x4964ae['id'],'UserId':_0x44ad77[_0x5b12('0x5f')]['id'],'ContactId':_0x4964ae[_0x5b12('0xb8')],'AttachmentId':_0x44ad77['body'][_0x5b12('0xaa')][0x0]['id']})[_0x5b12('0x38')](function(_0x490e6d){_0x4964ae[_0x5b12('0xb9')][_0x5b12('0xb6')]=[];_0x4964ae[_0x5b12('0xb9')][_0x5b12('0xb6')][_0x5b12('0x8b')](_0x490e6d[_0x5b12('0xb9')]);return _0x4964ae;});})[_0x5b12('0x38')](function(_0x4a2993){respondWithRpcPromise(_0x5b12('0xba'),_0x5b12('0xba'),{'FaxAccountId':_['isNil'](_0x44ad77[_0x5b12('0x65')]['id'])?undefined:_0x44ad77[_0x5b12('0x65')]['id'],'path':_[_0x5b12('0xaf')](_0x44ad77[_0x5b12('0x5e')]['attachments'][0x0][_0x5b12('0x7')])?undefined:_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][0x0][_0x5b12('0x7')],'fax':_[_0x5b12('0xaf')](_0x44ad77[_0x5b12('0x5e')]['to'][0x0])?undefined:_0x44ad77[_0x5b12('0x5e')]['to'][0x0],'AttachmentId':_0x44ad77[_0x5b12('0x5e')][_0x5b12('0xaa')][0x0]['id']},client9002)[_0x5b12('0x38')](function(_0x4083ef){logger[_0x5b12('0x22')](_0x5b12('0xbb'),_0x4083ef);})['catch'](function(_0x5d46c2){logger[_0x5b12('0x22')]('SendFaxRpc,\x20%s',_0x5d46c2);});return _0x4a2993;})[_0x5b12('0x38')](respondWithResult(_0x456d91,null))[_0x5b12('0x2b')](handleError(_0x456d91,null));};exports[_0x5b12('0xbc')]=function(_0x19e7f1,_0x51524b,_0x3f06be){return db['FaxAccount'][_0x5b12('0x62')]({'where':{'id':_0x19e7f1[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x51524b,null))[_0x5b12('0x38')](function(_0x104a45){if(_0x104a45){return _0x104a45[_0x5b12('0xbc')](_0x19e7f1[_0x5b12('0x5e')][_0x5b12('0x6d')],_[_0x5b12('0x75')](_0x19e7f1['body'],[_0x5b12('0x6d'),'id'])||{})[_0x5b12('0xbd')](function(_0x5cd6d2){for(var _0x18d4a3=0x0;_0x18d4a3<_0x19e7f1['body'][_0x5b12('0x6d')][_0x5b12('0x4d')];_0x18d4a3+=0x1){socket[_0x5b12('0xbe')](_0x5b12('0xbf'),{'UserId':_0x19e7f1['body'][_0x5b12('0x6d')][_0x18d4a3],'FaxAccountId':_0x19e7f1[_0x5b12('0x65')]['id']});}return _0x5cd6d2;});}})[_0x5b12('0x38')](respondWithResult(_0x51524b,null))[_0x5b12('0x2b')](handleError(_0x51524b,null));};exports[_0x5b12('0xc0')]=function(_0x33bfc5,_0x470e86,_0x557bb3){return db[_0x5b12('0x5a')]['find']({'where':{'id':_0x33bfc5[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x470e86,null))[_0x5b12('0x38')](function(_0x251e55){if(_0x251e55){return _0x251e55[_0x5b12('0xc0')](_0x33bfc5['query'][_0x5b12('0x6d')])[_0x5b12('0x38')](function(){if(_['isArray'](_0x33bfc5[_0x5b12('0x48')][_0x5b12('0x6d')])){for(var _0x20b9d4=0x0;_0x20b9d4<_0x33bfc5[_0x5b12('0x48')][_0x5b12('0x6d')][_0x5b12('0x4d')];_0x20b9d4+=0x1){socket['emit'](_0x5b12('0xc1'),{'UserId':Number(_0x33bfc5[_0x5b12('0x48')][_0x5b12('0x6d')][_0x20b9d4]),'FaxAccountId':Number(_0x33bfc5['params']['id'])});}}else{socket[_0x5b12('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x33bfc5[_0x5b12('0x48')][_0x5b12('0x6d')]),'FaxAccountId':Number(_0x33bfc5[_0x5b12('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x470e86,null))['catch'](handleError(_0x470e86,null));};exports[_0x5b12('0xc2')]=function(_0x230fcd,_0x209d2f,_0x2bdd97){var _0x178c43={};var _0x3d11aa={};var _0x1469a4;var _0x3b8b61;return db[_0x5b12('0x5a')][_0x5b12('0x71')]({'where':{'id':_0x230fcd[_0x5b12('0x65')]['id']}})[_0x5b12('0x38')](handleEntityNotFound(_0x209d2f,null))['then'](function(_0x20548a){if(_0x20548a){_0x1469a4=_0x20548a;_0x3d11aa['model']=_[_0x5b12('0x47')](db['User']['rawAttributes']);_0x3d11aa[_0x5b12('0x48')]=_[_0x5b12('0x47')](_0x230fcd['query']);_0x3d11aa[_0x5b12('0x49')]=_['intersection'](_0x3d11aa[_0x5b12('0x45')],_0x3d11aa['query']);_0x178c43[_0x5b12('0x4b')]=_[_0x5b12('0x4a')](_0x3d11aa[_0x5b12('0x45')],qs[_0x5b12('0x4c')](_0x230fcd[_0x5b12('0x48')][_0x5b12('0x4c')]));_0x178c43[_0x5b12('0x4b')]=_0x178c43[_0x5b12('0x4b')][_0x5b12('0x4d')]?_0x178c43[_0x5b12('0x4b')]:_0x3d11aa[_0x5b12('0x45')];_0x178c43[_0x5b12('0x4f')]=qs['sort'](_0x230fcd[_0x5b12('0x48')]['sort']);_0x178c43[_0x5b12('0x53')]=qs[_0x5b12('0x49')](_[_0x5b12('0x51')](_0x230fcd[_0x5b12('0x48')],_0x3d11aa['filters']));if(_0x230fcd[_0x5b12('0x48')][_0x5b12('0x52')]){_0x178c43[_0x5b12('0x53')]=_['merge'](_0x178c43['where'],{'$or':_[_0x5b12('0x42')](_0x178c43[_0x5b12('0x4b')],function(_0x31b51d){var _0x13a69f={};_0x13a69f[_0x31b51d]={'$like':'%'+_0x230fcd[_0x5b12('0x48')][_0x5b12('0x52')]+'%'};return _0x13a69f;})});}_0x178c43=_['merge']({},_0x178c43,_0x230fcd[_0x5b12('0x57')]);return _0x1469a4['getAgents'](_0x178c43);}})[_0x5b12('0x38')](function(_0x297c63){if(_0x297c63){_0x3b8b61=_0x297c63[_0x5b12('0x4d')];if(!_0x230fcd[_0x5b12('0x48')][_0x5b12('0x4e')](_0x5b12('0x6a'))){_0x178c43[_0x5b12('0x32')]=qs['limit'](_0x230fcd[_0x5b12('0x48')][_0x5b12('0x32')]);_0x178c43[_0x5b12('0x31')]=qs[_0x5b12('0x31')](_0x230fcd[_0x5b12('0x48')][_0x5b12('0x31')]);}return _0x1469a4[_0x5b12('0xc2')](_0x178c43);}})[_0x5b12('0x38')](function(_0x47a9fd){if(_0x47a9fd){return _0x47a9fd?{'count':_0x3b8b61,'rows':_0x47a9fd}:null;}})[_0x5b12('0x38')](respondWithResult(_0x209d2f,null))[_0x5b12('0x2b')](handleError(_0x209d2f,null));}; \ No newline at end of file +var _0x93ba=['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','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','name','index','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','options','FaxAccount','includeAll','include','findAll','rows','show','params','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','FaxAccountId','removeDispositions','CannedAnswer','length','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','internal','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','sequelize','tech','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','updatedAt','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket'];(function(_0x1f4a8f,_0x3786b0){var _0x293e34=function(_0x4f313a){while(--_0x4f313a){_0x1f4a8f['push'](_0x1f4a8f['shift']());}};_0x293e34(++_0x3786b0);}(_0x93ba,0x16a));var _0xa93b=function(_0x4ad3df,_0x504543){_0x4ad3df=_0x4ad3df-0x0;var _0xbd9e63=_0x93ba[_0x4ad3df];return _0xbd9e63;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa93b('0x0'));var rimraf=require(_0xa93b('0x1'));var zipdir=require(_0xa93b('0x2'));var jsonpatch=require(_0xa93b('0x3'));var rp=require(_0xa93b('0x4'));var moment=require(_0xa93b('0x5'));var BPromise=require(_0xa93b('0x6'));var Mustache=require(_0xa93b('0x7'));var util=require('util');var path=require(_0xa93b('0x8'));var sox=require('sox');var csv=require(_0xa93b('0x9'));var ejs=require(_0xa93b('0xa'));var fs=require('fs');var _=require(_0xa93b('0xb'));var squel=require(_0xa93b('0xc'));var crypto=require(_0xa93b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa93b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa93b('0xf'));var Papa=require(_0xa93b('0x10'));var Redis=require(_0xa93b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa93b('0x12'));var as=require(_0xa93b('0x13'));var hardwareService=require(_0xa93b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa93b('0x15'));var config=require('../../config/environment');var db=require(_0xa93b('0x16'))['db'];config[_0xa93b('0x17')]=_[_0xa93b('0x18')](config[_0xa93b('0x17')],{'host':_0xa93b('0x19'),'port':0x18eb});var socket=require(_0xa93b('0x1a'))(new Redis(config['redis']));require(_0xa93b('0x1b'))[_0xa93b('0x1c')](socket);var jayson=require(_0xa93b('0x1d'));var client=jayson[_0xa93b('0x1e')][_0xa93b('0x1f')]({'port':0x232c});var client9002=jayson[_0xa93b('0x1e')][_0xa93b('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x349566,_0x7cd67b,_0x2bc5eb){if(_0x2bc5eb){var _0x42fff4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42fff4[_0xa93b('0x20')](_0x7cd67b)){return _0x349566;}else{throw new db[(_0xa93b('0x21'))][(_0xa93b('0x22'))](_0xa93b('0x23'));}}else{return _0x349566;}}function respondWithRpcPromise(_0x59913b,_0x64c15,_0x1d162d,_0x4a1887){return new BPromise(function(_0x3eab85,_0x4b16fa){var _0x43234b=_0x4a1887||client;return _0x43234b['request'](_0x59913b,_0x1d162d)[_0xa93b('0x24')](function(_0x3ad7fc){logger[_0xa93b('0x25')](_0xa93b('0x26'),_0x64c15,_0xa93b('0x27'));logger[_0xa93b('0x28')](_0xa93b('0x29'),_0x64c15,_0xa93b('0x27'),JSON[_0xa93b('0x2a')](_0x3ad7fc));if(_0x3ad7fc[_0xa93b('0x2b')]){if(_0x3ad7fc[_0xa93b('0x2b')]['code']===0x1f4){logger[_0xa93b('0x2b')](_0xa93b('0x26'),_0x64c15,_0x3ad7fc['error'][_0xa93b('0x2c')]);return _0x4b16fa(_0x3ad7fc[_0xa93b('0x2b')][_0xa93b('0x2c')]);}logger[_0xa93b('0x2b')](_0xa93b('0x26'),_0x64c15,_0x3ad7fc[_0xa93b('0x2b')][_0xa93b('0x2c')]);return _0x3eab85(_0x3ad7fc[_0xa93b('0x2b')][_0xa93b('0x2c')]);}else{logger[_0xa93b('0x25')](_0xa93b('0x26'),_0x64c15,_0xa93b('0x27'));_0x3eab85(_0x3ad7fc[_0xa93b('0x2d')][_0xa93b('0x2c')]);}})[_0xa93b('0x2e')](function(_0x5ea19e){logger[_0xa93b('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x64c15,_0x5ea19e);_0x4b16fa(_0x5ea19e);});});}function respondWithStatusCode(_0x1ff09f,_0x5e8438){_0x5e8438=_0x5e8438||0xcc;return function(_0x31f3eb){if(_0x31f3eb){return _0x1ff09f[_0xa93b('0x2f')](_0x5e8438);}return _0x1ff09f[_0xa93b('0x30')](_0x5e8438)[_0xa93b('0x31')]();};}function respondWithResult(_0x352b87,_0x8197f2){_0x8197f2=_0x8197f2||0xc8;return function(_0x5d141d){if(_0x5d141d){return _0x352b87['status'](_0x8197f2)[_0xa93b('0x32')](_0x5d141d);}};}function respondWithFilteredResult(_0xb2d6a8,_0x5c7a9){return function(_0x226b78){if(_0x226b78){var _0x48fda3=_0x226b78[_0xa93b('0x33')],_0x519c56=_0x5c7a9[_0xa93b('0x34')],_0x5e3afd=_0x5c7a9[_0xa93b('0x34')]+_0x5c7a9['limit'],_0x3934b3;if(_0x5e3afd>=_0x48fda3){_0x5e3afd=_0x48fda3;_0x3934b3=0xc8;}else{_0x3934b3=0xce;}_0xb2d6a8['status'](_0x3934b3);return _0xb2d6a8['set'](_0xa93b('0x35'),_0x519c56+'-'+_0x5e3afd+'/'+_0x48fda3)['json'](_0x226b78);}return null;};}function patchUpdates(_0x428b1e){return function(_0x49a094){try{jsonpatch[_0xa93b('0x36')](_0x49a094,_0x428b1e,!![]);}catch(_0x39083d){return BPromise[_0xa93b('0x37')](_0x39083d);}return _0x49a094[_0xa93b('0x38')]();};}function saveUpdates(_0x12b03f,_0x8151ed){return function(_0x48cd36){if(_0x48cd36){return _0x48cd36[_0xa93b('0x39')](_0x12b03f)['then'](function(_0x10255f){return _0x10255f;});}return null;};}function removeEntity(_0x2c894d,_0x44c9b6){return function(_0x57c6ff){if(_0x57c6ff){return _0x57c6ff['destroy']()['then'](function(){var _0x164ea1=_0x57c6ff[_0xa93b('0x3a')]({'plain':!![]});var _0x1e4a05='FaxAccounts';return db[_0xa93b('0x3b')][_0xa93b('0x3c')]({'where':{'type':_0x1e4a05,'resourceId':_0x164ea1['id']}})[_0xa93b('0x24')](function(){return _0x57c6ff;});})[_0xa93b('0x24')](function(){_0x2c894d[_0xa93b('0x30')](0xcc)[_0xa93b('0x31')]();});}};}function handleEntityNotFound(_0x1b790d,_0x262131){return function(_0x19f32f){if(!_0x19f32f){_0x1b790d[_0xa93b('0x2f')](0x194);}return _0x19f32f;};}function handleError(_0x1d524d,_0x5bb89f){_0x5bb89f=_0x5bb89f||0x1f4;return function(_0x4fce18){logger[_0xa93b('0x2b')](_0x4fce18['stack']);if(_0x4fce18[_0xa93b('0x3d')]){delete _0x4fce18[_0xa93b('0x3d')];}_0x1d524d[_0xa93b('0x30')](_0x5bb89f)['send'](_0x4fce18);};}exports[_0xa93b('0x3e')]=function(_0x224c66,_0x6d0f99){var _0x5c591f={'include':[{'model':db['Pause'],'as':_0xa93b('0x3f')}]},_0x2885ab={},_0x3eaf92={'count':0x0,'rows':[]};var _0x1da0ca=_['map'](db['FaxAccount'][_0xa93b('0x40')],function(_0x61335c){return{'name':_0x61335c[_0xa93b('0x41')],'type':_0x61335c[_0xa93b('0x42')][_0xa93b('0x43')]};});_0x2885ab[_0xa93b('0x44')]=_['map'](_0x1da0ca,'name');_0x2885ab[_0xa93b('0x45')]=_[_0xa93b('0x46')](_0x224c66[_0xa93b('0x45')]);_0x2885ab[_0xa93b('0x47')]=_['intersection'](_0x2885ab[_0xa93b('0x44')],_0x2885ab[_0xa93b('0x45')]);_0x5c591f['attributes']=_[_0xa93b('0x48')](_0x2885ab[_0xa93b('0x44')],qs['fields'](_0x224c66[_0xa93b('0x45')][_0xa93b('0x49')]));_0x5c591f[_0xa93b('0x4a')]=_0x5c591f[_0xa93b('0x4a')]['length']?_0x5c591f['attributes']:_0x2885ab['model'];if(!_0x224c66['query'][_0xa93b('0x4b')](_0xa93b('0x4c'))){_0x5c591f[_0xa93b('0x4d')]=qs['limit'](_0x224c66[_0xa93b('0x45')]['limit']);_0x5c591f[_0xa93b('0x34')]=qs[_0xa93b('0x34')](_0x224c66['query'][_0xa93b('0x34')]);}_0x5c591f[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x224c66['query'][_0xa93b('0x4f')]);_0x5c591f[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0x224c66[_0xa93b('0x45')],_0x2885ab[_0xa93b('0x47')]),_0x1da0ca);if(_0x224c66['query'][_0xa93b('0x52')]){_0x5c591f['where']=_[_0xa93b('0x53')](_0x5c591f[_0xa93b('0x50')],{'$or':_[_0xa93b('0x54')](_0x1da0ca,function(_0x37ea25){if(_0x37ea25['type']!=='VIRTUAL'){var _0x397c1f={};_0x397c1f[_0x37ea25[_0xa93b('0x3d')]]={'$like':'%'+_0x224c66[_0xa93b('0x45')][_0xa93b('0x52')]+'%'};return _0x397c1f;}})});}_0x5c591f=_[_0xa93b('0x53')]({},_0x5c591f,_0x224c66[_0xa93b('0x55')]);var _0x464389={'where':_0x5c591f[_0xa93b('0x50')]};return db[_0xa93b('0x56')][_0xa93b('0x33')](_0x464389)[_0xa93b('0x24')](function(_0x5375a9){_0x3eaf92[_0xa93b('0x33')]=_0x5375a9;if(_0x224c66[_0xa93b('0x45')][_0xa93b('0x57')]){_0x5c591f[_0xa93b('0x58')]=[{'all':!![]}];}return db['FaxAccount'][_0xa93b('0x59')](_0x5c591f);})[_0xa93b('0x24')](function(_0x1ca34c){_0x3eaf92[_0xa93b('0x5a')]=_0x1ca34c;return _0x3eaf92;})['then'](respondWithFilteredResult(_0x6d0f99,_0x5c591f))['catch'](handleError(_0x6d0f99,null));};exports[_0xa93b('0x5b')]=function(_0x3ae47f,_0x43140b){var _0x46df7a={'raw':![],'where':{'id':_0x3ae47f[_0xa93b('0x5c')]['id']},'include':[{'model':db[_0xa93b('0x5d')],'as':_0xa93b('0x3f')}]},_0x20d647={};_0x20d647[_0xa93b('0x44')]=_[_0xa93b('0x46')](db[_0xa93b('0x56')]['rawAttributes']);_0x20d647[_0xa93b('0x45')]=_[_0xa93b('0x46')](_0x3ae47f[_0xa93b('0x45')]);_0x20d647['filters']=_[_0xa93b('0x48')](_0x20d647[_0xa93b('0x44')],_0x20d647['query']);_0x46df7a[_0xa93b('0x4a')]=_['intersection'](_0x20d647[_0xa93b('0x44')],qs[_0xa93b('0x49')](_0x3ae47f[_0xa93b('0x45')][_0xa93b('0x49')]));_0x46df7a[_0xa93b('0x4a')]=_0x46df7a[_0xa93b('0x4a')]['length']?_0x46df7a[_0xa93b('0x4a')]:_0x20d647[_0xa93b('0x44')];if(_0x3ae47f['query'][_0xa93b('0x57')]){_0x46df7a[_0xa93b('0x58')]=[{'all':!![]}];}_0x46df7a=_[_0xa93b('0x53')]({},_0x46df7a,_0x3ae47f[_0xa93b('0x55')]);return db[_0xa93b('0x56')]['find'](_0x46df7a)[_0xa93b('0x24')](handleEntityNotFound(_0x43140b,null))[_0xa93b('0x24')](respondWithResult(_0x43140b,null))[_0xa93b('0x2e')](handleError(_0x43140b,null));};exports[_0xa93b('0x5e')]=function(_0x4da32d,_0x4a5f22){return db['FaxAccount']['create'](_0x4da32d[_0xa93b('0x5f')],{})[_0xa93b('0x24')](function(_0x1d15c6){var _0x55fad3=_0x4da32d[_0xa93b('0x60')]['get']({'plain':!![]});if(!_0x55fad3)throw new Error(_0xa93b('0x61'));if(_0x55fad3[_0xa93b('0x62')]===_0xa93b('0x60')){var _0xe75781=_0x1d15c6[_0xa93b('0x3a')]({'plain':!![]});var _0xaeddd8=_0xa93b('0x63');return db[_0xa93b('0x64')][_0xa93b('0x65')]({'where':{'name':_0xaeddd8,'userProfileId':_0x55fad3[_0xa93b('0x66')]},'raw':!![]})[_0xa93b('0x24')](function(_0x3dfbd7){if(_0x3dfbd7&&_0x3dfbd7[_0xa93b('0x67')]===0x0){return db[_0xa93b('0x3b')][_0xa93b('0x5e')]({'name':_0xe75781[_0xa93b('0x3d')],'resourceId':_0xe75781['id'],'type':_0x3dfbd7[_0xa93b('0x3d')],'sectionId':_0x3dfbd7['id']},{})[_0xa93b('0x24')](function(){return _0x1d15c6;});}else{return _0x1d15c6;}})[_0xa93b('0x2e')](function(_0x3ed655){logger[_0xa93b('0x2b')](_0xa93b('0x68'),_0x3ed655);throw _0x3ed655;});}return _0x1d15c6;})[_0xa93b('0x24')](respondWithResult(_0x4a5f22,0xc9))[_0xa93b('0x2e')](handleError(_0x4a5f22,null));};exports[_0xa93b('0x39')]=function(_0x58a236,_0x5e2acd){if(_0x58a236[_0xa93b('0x5f')]['id']){delete _0x58a236[_0xa93b('0x5f')]['id'];}return db['FaxAccount'][_0xa93b('0x65')]({'where':{'id':_0x58a236[_0xa93b('0x5c')]['id']},'include':[{'model':db[_0xa93b('0x5d')],'as':_0xa93b('0x3f')}]})[_0xa93b('0x24')](handleEntityNotFound(_0x5e2acd,null))['then'](saveUpdates(_0x58a236[_0xa93b('0x5f')],null))[_0xa93b('0x24')](respondWithResult(_0x5e2acd,null))[_0xa93b('0x2e')](handleError(_0x5e2acd,null));};exports[_0xa93b('0x3c')]=function(_0x53edde,_0x416619){return db[_0xa93b('0x56')][_0xa93b('0x65')]({'where':{'id':_0x53edde[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x416619,null))[_0xa93b('0x24')](removeEntity(_0x416619,null))[_0xa93b('0x2e')](handleError(_0x416619,null));};exports[_0xa93b('0x69')]=function(_0x151127,_0x4c6dcd){return db['FaxAccount'][_0xa93b('0x69')]()['then'](respondWithResult(_0x4c6dcd,null))['catch'](handleError(_0x4c6dcd,null));};exports[_0xa93b('0x6a')]=function(_0xd01f46,_0x13cf76,_0x2f30be){if(_0xd01f46[_0xa93b('0x5f')]['id']){delete _0xd01f46['body']['id'];}return db[_0xa93b('0x56')][_0xa93b('0x65')]({'where':{'id':_0xd01f46[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x13cf76,null))[_0xa93b('0x24')](function(_0xd5863b){if(_0xd5863b){_0xd01f46[_0xa93b('0x5f')]['FaxAccountId']=_0xd5863b['id'];return db[_0xa93b('0x6b')]['create'](_0xd01f46[_0xa93b('0x5f')]);}})['then'](respondWithResult(_0x13cf76,null))[_0xa93b('0x2e')](handleError(_0x13cf76,null));};exports[_0xa93b('0x6c')]=function(_0x437d3e,_0x2b3201,_0x27b7e4){var _0x2304b2={'raw':![],'where':{}};var _0xcf7658={};var _0x4e0d53={'count':0x0,'rows':[]};return db[_0xa93b('0x56')][_0xa93b('0x6d')]({'where':{'id':_0x437d3e[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x2b3201,null))['then'](function(_0x1c822e){if(_0x1c822e){_0xcf7658[_0xa93b('0x44')]=_['keys'](db[_0xa93b('0x6b')][_0xa93b('0x40')]);_0xcf7658['query']=_[_0xa93b('0x46')](_0x437d3e[_0xa93b('0x45')]);_0xcf7658[_0xa93b('0x47')]=_[_0xa93b('0x48')](_0xcf7658[_0xa93b('0x44')],_0xcf7658[_0xa93b('0x45')]);_0x2304b2[_0xa93b('0x4a')]=_[_0xa93b('0x48')](_0xcf7658['model'],qs[_0xa93b('0x49')](_0x437d3e[_0xa93b('0x45')][_0xa93b('0x49')]));_0x2304b2[_0xa93b('0x4a')]=_0x2304b2['attributes']['length']?_0x2304b2[_0xa93b('0x4a')]:_0xcf7658['model'];if(!_0x437d3e[_0xa93b('0x45')]['hasOwnProperty'](_0xa93b('0x4c'))){_0x2304b2[_0xa93b('0x4d')]=qs[_0xa93b('0x4d')](_0x437d3e[_0xa93b('0x45')][_0xa93b('0x4d')]);_0x2304b2['offset']=qs[_0xa93b('0x34')](_0x437d3e[_0xa93b('0x45')][_0xa93b('0x34')]);}_0x2304b2[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x437d3e[_0xa93b('0x45')][_0xa93b('0x4f')]);_0x2304b2[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0x437d3e[_0xa93b('0x45')],_0xcf7658['filters']));_0x2304b2['where'][_0xa93b('0x6e')]=_0x1c822e['id'];if(_0x437d3e[_0xa93b('0x45')][_0xa93b('0x52')]){_0x2304b2[_0xa93b('0x50')]=_[_0xa93b('0x53')](_0x2304b2[_0xa93b('0x50')],{'$or':_['map'](_0x2304b2['attributes'],function(_0x1c9a17){var _0x500dc2={};_0x500dc2[_0x1c9a17]={'$like':'%'+_0x437d3e[_0xa93b('0x45')][_0xa93b('0x52')]+'%'};return _0x500dc2;})});}_0x2304b2=_[_0xa93b('0x53')]({},_0x2304b2,_0x437d3e['options']);return db[_0xa93b('0x6b')][_0xa93b('0x33')]({'where':_0x2304b2[_0xa93b('0x50')]})['then'](function(_0x2dbca7){_0x4e0d53[_0xa93b('0x33')]=_0x2dbca7;if(_0x437d3e[_0xa93b('0x45')][_0xa93b('0x57')]){_0x2304b2[_0xa93b('0x58')]=[{'all':!![]}];}return db[_0xa93b('0x6b')][_0xa93b('0x59')](_0x2304b2);})['then'](function(_0xa320d5){_0x4e0d53[_0xa93b('0x5a')]=_0xa320d5;return _0x4e0d53;});}})['then'](respondWithFilteredResult(_0x2b3201,_0x2304b2))[_0xa93b('0x2e')](handleError(_0x2b3201,null));};exports[_0xa93b('0x6f')]=function(_0x4527f1,_0xadbfa5,_0x4ce786){return db['FaxAccount'][_0xa93b('0x65')]({'where':{'id':_0x4527f1[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0xadbfa5,null))[_0xa93b('0x24')](function(_0x46adea){if(_0x46adea){return _0x46adea[_0xa93b('0x6f')](_0x4527f1[_0xa93b('0x45')]['ids']);}})[_0xa93b('0x24')](respondWithStatusCode(_0xadbfa5,null))[_0xa93b('0x2e')](handleError(_0xadbfa5,null));};exports['addAnswer']=function(_0x17d2ad,_0x45f7ae,_0x11509f){if(_0x17d2ad['body']['id']){delete _0x17d2ad['body']['id'];}return db[_0xa93b('0x56')][_0xa93b('0x65')]({'where':{'id':_0x17d2ad[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x45f7ae,null))[_0xa93b('0x24')](function(_0x5b3538){if(_0x5b3538){_0x17d2ad[_0xa93b('0x5f')]['FaxAccountId']=_0x5b3538['id'];return db['CannedAnswer']['create'](_0x17d2ad['body']);}})[_0xa93b('0x24')](respondWithResult(_0x45f7ae,null))[_0xa93b('0x2e')](handleError(_0x45f7ae,null));};exports['getAnswers']=function(_0x2002b2,_0x145b7f,_0x34971c){var _0x2aca81={'raw':![],'where':{}};var _0x26a129={};var _0x7974c8={'count':0x0,'rows':[]};return db[_0xa93b('0x56')]['findOne']({'where':{'id':_0x2002b2['params']['id']}})['then'](handleEntityNotFound(_0x145b7f,null))[_0xa93b('0x24')](function(_0x5005fa){if(_0x5005fa){_0x26a129['model']=_[_0xa93b('0x46')](db[_0xa93b('0x70')][_0xa93b('0x40')]);_0x26a129['query']=_[_0xa93b('0x46')](_0x2002b2[_0xa93b('0x45')]);_0x26a129[_0xa93b('0x47')]=_[_0xa93b('0x48')](_0x26a129[_0xa93b('0x44')],_0x26a129['query']);_0x2aca81[_0xa93b('0x4a')]=_[_0xa93b('0x48')](_0x26a129[_0xa93b('0x44')],qs[_0xa93b('0x49')](_0x2002b2[_0xa93b('0x45')][_0xa93b('0x49')]));_0x2aca81[_0xa93b('0x4a')]=_0x2aca81[_0xa93b('0x4a')][_0xa93b('0x71')]?_0x2aca81['attributes']:_0x26a129[_0xa93b('0x44')];if(!_0x2002b2[_0xa93b('0x45')][_0xa93b('0x4b')](_0xa93b('0x4c'))){_0x2aca81[_0xa93b('0x4d')]=qs[_0xa93b('0x4d')](_0x2002b2[_0xa93b('0x45')][_0xa93b('0x4d')]);_0x2aca81['offset']=qs[_0xa93b('0x34')](_0x2002b2[_0xa93b('0x45')][_0xa93b('0x34')]);}_0x2aca81[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x2002b2['query'][_0xa93b('0x4f')]);_0x2aca81[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_['pick'](_0x2002b2[_0xa93b('0x45')],_0x26a129['filters']));_0x2aca81[_0xa93b('0x50')][_0xa93b('0x6e')]=_0x5005fa['id'];if(_0x2002b2['query'][_0xa93b('0x52')]){_0x2aca81[_0xa93b('0x50')]=_[_0xa93b('0x53')](_0x2aca81['where'],{'$or':_[_0xa93b('0x54')](_0x2aca81['attributes'],function(_0x3e1db6){var _0x10a134={};_0x10a134[_0x3e1db6]={'$like':'%'+_0x2002b2[_0xa93b('0x45')]['filter']+'%'};return _0x10a134;})});}_0x2aca81=_[_0xa93b('0x53')]({},_0x2aca81,_0x2002b2[_0xa93b('0x55')]);return db[_0xa93b('0x70')]['count']({'where':_0x2aca81[_0xa93b('0x50')]})['then'](function(_0x49e8fa){_0x7974c8['count']=_0x49e8fa;if(_0x2002b2[_0xa93b('0x45')]['includeAll']){_0x2aca81['include']=[{'all':!![]}];}return db[_0xa93b('0x70')][_0xa93b('0x59')](_0x2aca81);})[_0xa93b('0x24')](function(_0x57549b){_0x7974c8[_0xa93b('0x5a')]=_0x57549b;return _0x7974c8;});}})['then'](respondWithFilteredResult(_0x145b7f,_0x2aca81))['catch'](handleError(_0x145b7f,null));};exports[_0xa93b('0x72')]=function(_0x53dd8e,_0x3993d7,_0x211c4f){return db['FaxAccount'][_0xa93b('0x65')]({'where':{'id':_0x53dd8e[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x3993d7,null))[_0xa93b('0x24')](function(_0x122e4e){if(_0x122e4e){return _0x122e4e[_0xa93b('0x72')](_0x53dd8e[_0xa93b('0x45')][_0xa93b('0x73')]);}})['then'](respondWithStatusCode(_0x3993d7,null))['catch'](handleError(_0x3993d7,null));};exports[_0xa93b('0x74')]=function(_0x37f5f8,_0x1676f1,_0x19c559){return db[_0xa93b('0x75')][_0xa93b('0x65')]({'where':{'id':_0x37f5f8[_0xa93b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1676f1,null))[_0xa93b('0x24')](function(_0x16d8c0){if(_0x16d8c0){return _0x16d8c0[_0xa93b('0x74')](_0x37f5f8[_0xa93b('0x5f')]['ids'],_[_0xa93b('0x76')](_0x37f5f8['body'],[_0xa93b('0x73'),'id'])||{});}})[_0xa93b('0x24')](respondWithResult(_0x1676f1,null))[_0xa93b('0x2e')](handleError(_0x1676f1,null));};exports[_0xa93b('0x77')]=function(_0x1db861,_0x8a2afa,_0x2f16e6){var _0x4ee8ee={'raw':![],'where':{}};var _0x37998b={};var _0x364ac2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa93b('0x6d')]({'where':{'id':_0x1db861[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x8a2afa,null))['then'](function(_0x35c511){if(_0x35c511){_0x37998b['model']=_['keys'](db[_0xa93b('0x75')][_0xa93b('0x40')]);_0x37998b[_0xa93b('0x45')]=_[_0xa93b('0x46')](_0x1db861[_0xa93b('0x45')]);_0x37998b[_0xa93b('0x47')]=_[_0xa93b('0x48')](_0x37998b[_0xa93b('0x44')],_0x37998b[_0xa93b('0x45')]);_0x4ee8ee[_0xa93b('0x4a')]=_['intersection'](_0x37998b[_0xa93b('0x44')],qs[_0xa93b('0x49')](_0x1db861[_0xa93b('0x45')]['fields']));_0x4ee8ee[_0xa93b('0x4a')]=_0x4ee8ee[_0xa93b('0x4a')][_0xa93b('0x71')]?_0x4ee8ee[_0xa93b('0x4a')]:_0x37998b[_0xa93b('0x44')];if(!_0x1db861[_0xa93b('0x45')][_0xa93b('0x4b')](_0xa93b('0x4c'))){_0x4ee8ee['limit']=qs[_0xa93b('0x4d')](_0x1db861[_0xa93b('0x45')][_0xa93b('0x4d')]);_0x4ee8ee[_0xa93b('0x34')]=qs[_0xa93b('0x34')](_0x1db861[_0xa93b('0x45')]['offset']);}_0x4ee8ee[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x1db861['query']['sort']);_0x4ee8ee[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0x1db861[_0xa93b('0x45')],_0x37998b['filters']));_0x4ee8ee[_0xa93b('0x50')][_0xa93b('0x6e')]=_0x35c511['id'];if(_0x1db861[_0xa93b('0x45')]['filter']){_0x4ee8ee[_0xa93b('0x50')]=_[_0xa93b('0x53')](_0x4ee8ee[_0xa93b('0x50')],{'$or':_[_0xa93b('0x54')](_0x4ee8ee[_0xa93b('0x4a')],function(_0x3433b6){var _0x214710={};_0x214710[_0x3433b6]={'$like':'%'+_0x1db861[_0xa93b('0x45')][_0xa93b('0x52')]+'%'};return _0x214710;})});}_0x4ee8ee=_[_0xa93b('0x53')]({},_0x4ee8ee,_0x1db861['options']);return db['FaxInteraction'][_0xa93b('0x33')]({'where':_0x4ee8ee[_0xa93b('0x50')]})['then'](function(_0x5ccb40){_0x364ac2[_0xa93b('0x33')]=_0x5ccb40;if(_0x1db861[_0xa93b('0x45')][_0xa93b('0x57')]){_0x4ee8ee[_0xa93b('0x58')]=[{'model':db[_0xa93b('0x78')],'as':_0xa93b('0x79'),'required':![]},{'model':db[_0xa93b('0x7a')],'as':'Owner','attributes':['name','fullname',_0xa93b('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xa93b('0x7c'),'attributes':['id',_0xa93b('0x3d'),_0xa93b('0x7d')],'where':_0x1db861[_0xa93b('0x45')][_0xa93b('0x7e')]?{'id':_0x1db861[_0xa93b('0x45')][_0xa93b('0x7e')]}:undefined,'required':_0x1db861[_0xa93b('0x45')][_0xa93b('0x7e')]?!![]:![]}];}return db[_0xa93b('0x75')][_0xa93b('0x59')](_0x4ee8ee);})[_0xa93b('0x24')](function(_0x36b6aa){_0x364ac2[_0xa93b('0x5a')]=_0x36b6aa;return _0x364ac2;});}})[_0xa93b('0x24')](respondWithFilteredResult(_0x8a2afa,_0x4ee8ee))[_0xa93b('0x2e')](handleError(_0x8a2afa,null));};exports[_0xa93b('0x7f')]=function(_0x30a38e,_0x1d599d,_0x1fa5c5){return db[_0xa93b('0x56')][_0xa93b('0x6d')]({'where':{'id':_0x30a38e[_0xa93b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1d599d,null))[_0xa93b('0x24')](function(_0xd31190){if(_0xd31190){return db['sequelize'][_0xa93b('0x80')](function(_0x1c5c25){return db['FaxApplication'][_0xa93b('0x3c')]({'where':{'FaxAccountId':_0x30a38e[_0xa93b('0x5c')]['id']},'transaction':_0x1c5c25})[_0xa93b('0x24')](function(_0x63ddcf){var _0xf65122=_[_0xa93b('0x54')](_0x30a38e[_0xa93b('0x5f')],function(_0x3959ef){_0x3959ef['FaxAccountId']=_0x30a38e[_0xa93b('0x5c')]['id'];return _0x3959ef;});return db[_0xa93b('0x81')][_0xa93b('0x82')](_0xf65122,{'transaction':_0x1c5c25});});})[_0xa93b('0x24')](function(){return db[_0xa93b('0x81')][_0xa93b('0x83')]({'where':{'FaxAccountId':_0x30a38e[_0xa93b('0x5c')]['id']},'order':_0xa93b('0x84')});});}})[_0xa93b('0x24')](respondWithResult(_0x1d599d,null))['catch'](handleError(_0x1d599d,null));};exports[_0xa93b('0x85')]=function(_0x49d154,_0x582afe,_0x43a990){var _0xbc5d17={};var _0xc8eaf7={};var _0x4fc3cb;var _0x1690d7;return db['FaxAccount']['findOne']({'where':{'id':_0x49d154[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x582afe,null))['then'](function(_0x366fe1){if(_0x366fe1){_0x4fc3cb=_0x366fe1;_0xc8eaf7[_0xa93b('0x44')]=_['keys'](db[_0xa93b('0x81')][_0xa93b('0x40')]);_0xc8eaf7[_0xa93b('0x45')]=_[_0xa93b('0x46')](_0x49d154[_0xa93b('0x45')]);_0xc8eaf7['filters']=_[_0xa93b('0x48')](_0xc8eaf7[_0xa93b('0x44')],_0xc8eaf7[_0xa93b('0x45')]);_0xbc5d17[_0xa93b('0x4a')]=_[_0xa93b('0x48')](_0xc8eaf7['model'],qs['fields'](_0x49d154[_0xa93b('0x45')]['fields']));_0xbc5d17[_0xa93b('0x4a')]=_0xbc5d17[_0xa93b('0x4a')][_0xa93b('0x71')]?_0xbc5d17[_0xa93b('0x4a')]:_0xc8eaf7[_0xa93b('0x44')];_0xbc5d17[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x49d154['query'][_0xa93b('0x4f')]);_0xbc5d17[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0x49d154[_0xa93b('0x45')],_0xc8eaf7[_0xa93b('0x47')]));if(_0x49d154[_0xa93b('0x45')][_0xa93b('0x52')]){_0xbc5d17[_0xa93b('0x50')]=_[_0xa93b('0x53')](_0xbc5d17[_0xa93b('0x50')],{'$or':_[_0xa93b('0x54')](_0xbc5d17['attributes'],function(_0x2637ce){var _0x5d392f={};_0x5d392f[_0x2637ce]={'$like':'%'+_0x49d154[_0xa93b('0x45')]['filter']+'%'};return _0x5d392f;})});}_0xbc5d17=_[_0xa93b('0x53')]({},_0xbc5d17,_0x49d154[_0xa93b('0x55')]);return _0x4fc3cb[_0xa93b('0x85')](_0xbc5d17);}})[_0xa93b('0x24')](function(_0x4bfa65){if(_0x4bfa65){_0x1690d7=_0x4bfa65[_0xa93b('0x71')];if(!_0x49d154['query'][_0xa93b('0x4b')](_0xa93b('0x4c'))){_0xbc5d17['limit']=qs[_0xa93b('0x4d')](_0x49d154[_0xa93b('0x45')]['limit']);_0xbc5d17[_0xa93b('0x34')]=qs['offset'](_0x49d154['query'][_0xa93b('0x34')]);}return _0x4fc3cb[_0xa93b('0x85')](_0xbc5d17);}})['then'](function(_0x3f3948){if(_0x3f3948){return _0x3f3948?{'count':_0x1690d7,'rows':_0x3f3948}:null;}})[_0xa93b('0x24')](respondWithResult(_0x582afe,null))[_0xa93b('0x2e')](handleError(_0x582afe,null));};function Extension(_0x3adfad,_0x7bee8f,_0x4a4d43,_0x32bca4){this['context']=_0xa93b('0x86');this[_0xa93b('0x87')]=_0x3adfad[_0xa93b('0x88')];this['app']=_0x32bca4;this[_0xa93b('0x42')]=_0xa93b('0x89');this[_0xa93b('0x8a')]=_0xa93b('0x8b');this['FaxAccountId']=_0x3adfad['id'];this[_0xa93b('0x84')]=_0x7bee8f;this[_0xa93b('0x8c')]=_0x4a4d43;}function createExtensionsReciveFax(_0xa2e696){var _0x5d092d=0x1;var _0x296a75=[];_0x296a75['push'](new Extension(_0xa2e696,_0x5d092d,'','Answer'));_0x5d092d+=0x1;_0x296a75[_0xa93b('0x8d')](new Extension(_0xa2e696,_0x5d092d,'CDR(type)=inbound-fax',_0xa93b('0x8e')));_0x5d092d+=0x1;for(var _0xb6f1e2 in _0xa2e696){if(_0xa2e696[_0xa93b('0x4b')](_0xb6f1e2)&&(_0xb6f1e2===_0xa93b('0x8f')||_0xb6f1e2===_0xa93b('0x88')||_0xb6f1e2===_0xa93b('0x90')||_0xb6f1e2===_0xa93b('0x91')||_0xb6f1e2===_0xa93b('0x92')||_0xb6f1e2===_0xa93b('0x93')||_0xb6f1e2===_0xa93b('0x94')||_0xb6f1e2===_0xa93b('0x95')||_0xb6f1e2===_0xa93b('0x96'))){_0x296a75[_0xa93b('0x8d')](new Extension(_0xa2e696,_0x5d092d,_0xa93b('0x97')+_0xb6f1e2+')='+_0xa2e696[_0xb6f1e2],_0xa93b('0x8e')));_0x5d092d+=0x1;}}_0x296a75[_0xa93b('0x8d')](new Extension(_0xa2e696,_0x5d092d,'6','Wait'));_0x5d092d+=0x1;_0x296a75[_0xa93b('0x8d')](new Extension(_0xa2e696,_0x5d092d,_0xa93b('0x98'),_0xa93b('0x99')));_0x5d092d=0x0;return _0x296a75;}exports['addAccountApplications']=function(_0x2a8447,_0x3134eb,_0x186545){var _0x2cc0bc;return db['sequelize'][_0xa93b('0x80')](function(_0x18ea13){return db[_0xa93b('0x56')][_0xa93b('0x5e')](_0x2a8447['body'],{'transaction':_0x18ea13})[_0xa93b('0x24')](function(_0x6c12fe){_0x2cc0bc=_0x6c12fe[_0xa93b('0x3a')]({'plain':!![]});return db[_0xa93b('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x2cc0bc),{'transaction':_0x18ea13});});})[_0xa93b('0x24')](function(){return _0x2cc0bc;})[_0xa93b('0x24')](respondWithResult(_0x3134eb,null))[_0xa93b('0x2e')](handleError(_0x3134eb,null));};exports[_0xa93b('0x9b')]=function(_0x23ad23,_0x404180,_0x2c9336){var _0x2a300b;return db[_0xa93b('0x9c')][_0xa93b('0x80')](function(_0x2a87a3){return db[_0xa93b('0x56')][_0xa93b('0x39')](_0x23ad23[_0xa93b('0x5f')],{'where':{'id':_0x23ad23['body']['id']},'transaction':_0x2a87a3})['then'](function(_0x1dfce7){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x23ad23['body']['id']},'transaction':_0x2a87a3})[_0xa93b('0x24')](function(_0x6ced0b){return db['VoiceExtension'][_0xa93b('0x82')](createExtensionsReciveFax(_['omit'](_0x23ad23['body'],[_0xa93b('0x9d'),_0xa93b('0x43'),'createdAt','updatedAt',_0xa93b('0x9e'),_0xa93b('0x9f')])),{'transaction':_0x2a87a3});});});})['then'](function(){return db[_0xa93b('0x56')][_0xa93b('0xa0')](_0x23ad23[_0xa93b('0x5f')]['id']);})[_0xa93b('0x24')](respondWithResult(_0x404180,null))[_0xa93b('0x2e')](handleError(_0x404180,null));};exports[_0xa93b('0xa1')]=function(_0x3f0773,_0xe92276,_0x5d58f9){var _0x3fa44e={'raw':!![],'where':{}};var _0x45768c={};var _0x436ef8={'count':0x0,'rows':[]};return db[_0xa93b('0x56')][_0xa93b('0x6d')]({'where':{'id':_0x3f0773[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0xe92276,null))[_0xa93b('0x24')](function(_0x52fb1c){if(_0x52fb1c){_0x45768c['model']=_['keys'](db[_0xa93b('0xa2')][_0xa93b('0x40')]);_0x45768c['query']=_[_0xa93b('0x46')](_0x3f0773[_0xa93b('0x45')]);_0x45768c['filters']=_[_0xa93b('0x48')](_0x45768c[_0xa93b('0x44')],_0x45768c[_0xa93b('0x45')]);_0x3fa44e['attributes']=_[_0xa93b('0x48')](_0x45768c[_0xa93b('0x44')],qs[_0xa93b('0x49')](_0x3f0773[_0xa93b('0x45')][_0xa93b('0x49')]));_0x3fa44e[_0xa93b('0x4a')]=_0x3fa44e[_0xa93b('0x4a')][_0xa93b('0x71')]?_0x3fa44e[_0xa93b('0x4a')]:_0x45768c[_0xa93b('0x44')];if(!_0x3f0773[_0xa93b('0x45')][_0xa93b('0x4b')]('nolimit')){_0x3fa44e[_0xa93b('0x4d')]=qs['limit'](_0x3f0773[_0xa93b('0x45')][_0xa93b('0x4d')]);_0x3fa44e['offset']=qs[_0xa93b('0x34')](_0x3f0773[_0xa93b('0x45')]['offset']);}_0x3fa44e[_0xa93b('0x4e')]=qs[_0xa93b('0x4f')](_0x3f0773[_0xa93b('0x45')][_0xa93b('0x4f')]);_0x3fa44e[_0xa93b('0x50')]=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0x3f0773['query'],_0x45768c[_0xa93b('0x47')]));_0x3fa44e[_0xa93b('0x50')][_0xa93b('0x6e')]=_0x52fb1c['id'];if(_0x3f0773[_0xa93b('0x45')][_0xa93b('0x52')]){_0x3fa44e[_0xa93b('0x50')]=_[_0xa93b('0x53')](_0x3fa44e[_0xa93b('0x50')],{'$or':_[_0xa93b('0x54')](_0x3fa44e[_0xa93b('0x4a')],function(_0xb4b83c){var _0x197b5b={};_0x197b5b[_0xb4b83c]={'$like':'%'+_0x3f0773[_0xa93b('0x45')][_0xa93b('0x52')]+'%'};return _0x197b5b;})});}if(_0x3f0773[_0xa93b('0x45')][_0xa93b('0xa3')]){var _0x1a1ccf=_0x3f0773[_0xa93b('0x45')][_0xa93b('0xa3')][_0xa93b('0xa4')](',');var _0x4114b3={};_0x4114b3[_0x1a1ccf[0x0]]={'$gte':moment(_0x1a1ccf[0x1])[_0xa93b('0xa5')](_0xa93b('0xa6'))};_0x3fa44e[_0xa93b('0x50')]=_['merge'](_0x3fa44e[_0xa93b('0x50')],_0x4114b3);}_0x3fa44e=_[_0xa93b('0x53')]({},_0x3fa44e,_0x3f0773[_0xa93b('0x55')]);return db[_0xa93b('0xa2')][_0xa93b('0x33')]({'where':_0x3fa44e[_0xa93b('0x50')]})['then'](function(_0x7ccc8e){_0x436ef8['count']=_0x7ccc8e;if(_0x3f0773[_0xa93b('0x45')][_0xa93b('0x57')]){_0x3fa44e[_0xa93b('0x58')]=[{'all':!![]}];}return db[_0xa93b('0xa2')][_0xa93b('0x59')](_0x3fa44e);})[_0xa93b('0x24')](function(_0x3bde2e){_0x436ef8[_0xa93b('0x5a')]=_0x3bde2e;return _0x436ef8;});}})[_0xa93b('0x24')](respondWithFilteredResult(_0xe92276,_0x3fa44e))['catch'](handleError(_0xe92276,null));};exports[_0xa93b('0xa7')]=function(_0x5c941a,_0x48813c,_0x400d85){var _0x1b6d36,_0x10057f={},_0x1bc63f;if(_0x5c941a[_0xa93b('0x5f')]['to']){_0x1bc63f=_0x5c941a[_0xa93b('0x5f')]['to'][0x0];}return db['FaxAccount'][_0xa93b('0x65')]({'where':{'id':_0x5c941a[_0xa93b('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xa93b('0xa8'),'include':[{'model':db[_0xa93b('0x78')],'as':_0xa93b('0xa9'),'where':{'fax':_0x1bc63f},'limit':0x1,'order':[[_0xa93b('0xaa'),'DESC']]}]}]})[_0xa93b('0x24')](handleEntityNotFound(_0x48813c,null))[_0xa93b('0x24')](function(_0x3bc508){_0x1b6d36=_0x3bc508;if(_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')]&&_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')]['length']){for(var _0x15ae22=0x0;_0x15ae22<_0x5c941a[_0xa93b('0x5f')]['attachments'][_0xa93b('0x71')];_0x15ae22+=0x1){_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][_0x15ae22]={'filename':_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][_0x15ae22][_0xa93b('0x3d')],'id':_0x5c941a[_0xa93b('0x5f')]['attachments'][_0x15ae22]['id'],'path':path[_0xa93b('0xac')](config['root'],_0xa93b('0xad'),_0x5c941a['body'][_0xa93b('0xab')][_0x15ae22][_0xa93b('0xae')])};}}return respondWithRpcPromise(_0xa93b('0xaf'),_0xa93b('0xaf'),{'FaxAccountId':_[_0xa93b('0xb0')](_0x5c941a['params']['id'])?undefined:_0x5c941a[_0xa93b('0x5c')]['id'],'path':_[_0xa93b('0xb0')](_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][0x0]['path'])?undefined:_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][0x0][_0xa93b('0x8')],'fax':_[_0xa93b('0xb0')](_0x5c941a[_0xa93b('0x5f')]['to'][0x0])?undefined:_0x5c941a[_0xa93b('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x1b6d36){if(_['isNil'](_0x5c941a['body'][_0xa93b('0xb1')])){_0x5c941a['body'][_0xa93b('0xb1')]=util[_0xa93b('0xa5')](_0xa93b('0xb2'),_0x1b6d36[_0xa93b('0x3d')],_0x1b6d36[_0xa93b('0xb3')]);}if(_0x1b6d36[_0xa93b('0xa8')]){if(_0x1b6d36[_0xa93b('0xa8')][_0xa93b('0xa9')]['length']){return _0x1b6d36[_0xa93b('0xa8')][_0xa93b('0xa9')][0x0];}else{return db[_0xa93b('0x78')][_0xa93b('0x5e')](_[_0xa93b('0x18')](_0x5c941a[_0xa93b('0x5f')],{'firstName':_0x5c941a[_0xa93b('0x5f')]['to'][0x0],'phone':_0x5c941a['body']['to'][0x0],'fax':_0x5c941a['body']['to'][0x0],'ListId':_0x1b6d36[_0xa93b('0x9f')]}));}}else{throw new Error(_0xa93b('0xb4'));}}else{throw new Error(_0xa93b('0xb5'));}})[_0xa93b('0x24')](function(_0x587bf1){if(_0x587bf1){return db[_0xa93b('0x75')][_0xa93b('0x65')]({'where':{'ContactId':_0x587bf1['id'],'closed':![],'FaxAccountId':_0x1b6d36['id']}})['then'](function(_0x13b399){if(_0x13b399){return[_0x13b399,![]];}return db['FaxInteraction']['create']({'UserId':_0x5c941a[_0xa93b('0x60')]['id'],'ContactId':_0x587bf1['id'],'FaxAccountId':_0x1b6d36['id'],'fax':_0x5c941a['body']['to'][0x0],'firstMsgDirection':_0xa93b('0xb6'),'Messages':[_['merge'](_0x5c941a[_0xa93b('0x5f')],{'read':![],'body':_0x5c941a['body'][_0xa93b('0xab')][0x0]['filename'],'FaxAccountId':_0x1b6d36['id'],'UserId':_0x5c941a[_0xa93b('0x60')]['id'],'ContactId':_0x587bf1['id'],'AttachmentId':_0x5c941a['body'][_0xa93b('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xa93b('0xa2')],'as':_0xa93b('0xb7')}]})['then'](function(_0x2afa17){return[_0x2afa17,!![]];});});}else{throw new Error(_0xa93b('0xb8'));}})[_0xa93b('0xb9')](function(_0x29e317,_0x4c622d){if(_0x4c622d){return _0x29e317;}return db['FaxMessage'][_0xa93b('0x5e')]({'direction':_0xa93b('0xb6'),'read':![],'body':_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][0x0]['filename'],'FaxAccountId':_0x1b6d36['id'],'FaxInteractionId':_0x29e317['id'],'UserId':_0x5c941a[_0xa93b('0x60')]['id'],'ContactId':_0x29e317[_0xa93b('0xba')],'AttachmentId':_0x5c941a[_0xa93b('0x5f')]['attachments'][0x0]['id']})[_0xa93b('0x24')](function(_0x27e24c){_0x29e317[_0xa93b('0xbb')][_0xa93b('0xb7')]=[];_0x29e317[_0xa93b('0xbb')]['Messages'][_0xa93b('0x8d')](_0x27e24c[_0xa93b('0xbb')]);return _0x29e317;});})[_0xa93b('0x24')](function(_0x8bc9be){respondWithRpcPromise(_0xa93b('0xbc'),_0xa93b('0xbc'),{'FaxAccountId':_[_0xa93b('0xb0')](_0x5c941a[_0xa93b('0x5c')]['id'])?undefined:_0x5c941a[_0xa93b('0x5c')]['id'],'path':_[_0xa93b('0xb0')](_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][0x0][_0xa93b('0x8')])?undefined:_0x5c941a[_0xa93b('0x5f')][_0xa93b('0xab')][0x0]['path'],'fax':_[_0xa93b('0xb0')](_0x5c941a[_0xa93b('0x5f')]['to'][0x0])?undefined:_0x5c941a[_0xa93b('0x5f')]['to'][0x0],'AttachmentId':_0x5c941a['body']['attachments'][0x0]['id']},client9002)[_0xa93b('0x24')](function(_0x5f1c8d){logger['info'](_0xa93b('0xbd'),_0x5f1c8d);})['catch'](function(_0x6382a0){logger[_0xa93b('0x25')](_0xa93b('0xbd'),_0x6382a0);});return _0x8bc9be;})[_0xa93b('0x24')](respondWithResult(_0x48813c,null))['catch'](handleError(_0x48813c,null));};exports[_0xa93b('0xbe')]=function(_0x54b854,_0x3eccde,_0x7a0052){return db[_0xa93b('0x56')][_0xa93b('0x65')]({'where':{'id':_0x54b854[_0xa93b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3eccde,null))[_0xa93b('0x24')](function(_0x503171){if(_0x503171){return _0x503171[_0xa93b('0xbe')](_0x54b854[_0xa93b('0x5f')][_0xa93b('0x73')],_[_0xa93b('0x76')](_0x54b854[_0xa93b('0x5f')],[_0xa93b('0x73'),'id'])||{})[_0xa93b('0xb9')](function(_0x4b2c4d){for(var _0x5447ea=0x0;_0x5447ea<_0x54b854['body'][_0xa93b('0x73')][_0xa93b('0x71')];_0x5447ea+=0x1){socket[_0xa93b('0xbf')]('userFaxAccount:save',{'UserId':_0x54b854['body']['ids'][_0x5447ea],'FaxAccountId':_0x54b854[_0xa93b('0x5c')]['id']});}return _0x4b2c4d;});}})[_0xa93b('0x24')](respondWithResult(_0x3eccde,null))[_0xa93b('0x2e')](handleError(_0x3eccde,null));};exports['removeAgents']=function(_0x55fa45,_0x508496,_0x2c687c){return db[_0xa93b('0x56')][_0xa93b('0x65')]({'where':{'id':_0x55fa45[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x508496,null))['then'](function(_0x5c4ed){if(_0x5c4ed){return _0x5c4ed['removeAgents'](_0x55fa45['query'][_0xa93b('0x73')])[_0xa93b('0x24')](function(){if(_[_0xa93b('0xc0')](_0x55fa45[_0xa93b('0x45')][_0xa93b('0x73')])){for(var _0x428e9d=0x0;_0x428e9d<_0x55fa45[_0xa93b('0x45')][_0xa93b('0x73')][_0xa93b('0x71')];_0x428e9d+=0x1){socket[_0xa93b('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x55fa45[_0xa93b('0x45')][_0xa93b('0x73')][_0x428e9d]),'FaxAccountId':Number(_0x55fa45[_0xa93b('0x5c')]['id'])});}}else{socket[_0xa93b('0xbf')](_0xa93b('0xc1'),{'UserId':Number(_0x55fa45[_0xa93b('0x45')][_0xa93b('0x73')]),'FaxAccountId':Number(_0x55fa45['params']['id'])});}});}})['then'](respondWithStatusCode(_0x508496,null))[_0xa93b('0x2e')](handleError(_0x508496,null));};exports[_0xa93b('0xc2')]=function(_0xa99175,_0x31e203,_0x5827e5){var _0x14d2f6={};var _0xe7b36={};var _0x42715c;var _0x26057a;return db[_0xa93b('0x56')][_0xa93b('0x6d')]({'where':{'id':_0xa99175[_0xa93b('0x5c')]['id']}})[_0xa93b('0x24')](handleEntityNotFound(_0x31e203,null))[_0xa93b('0x24')](function(_0x1d9661){if(_0x1d9661){_0x42715c=_0x1d9661;_0xe7b36[_0xa93b('0x44')]=_[_0xa93b('0x46')](db['User'][_0xa93b('0x40')]);_0xe7b36[_0xa93b('0x45')]=_[_0xa93b('0x46')](_0xa99175[_0xa93b('0x45')]);_0xe7b36['filters']=_['intersection'](_0xe7b36[_0xa93b('0x44')],_0xe7b36['query']);_0x14d2f6[_0xa93b('0x4a')]=_[_0xa93b('0x48')](_0xe7b36[_0xa93b('0x44')],qs['fields'](_0xa99175[_0xa93b('0x45')]['fields']));_0x14d2f6[_0xa93b('0x4a')]=_0x14d2f6[_0xa93b('0x4a')][_0xa93b('0x71')]?_0x14d2f6['attributes']:_0xe7b36[_0xa93b('0x44')];_0x14d2f6['order']=qs[_0xa93b('0x4f')](_0xa99175['query'][_0xa93b('0x4f')]);_0x14d2f6['where']=qs[_0xa93b('0x47')](_[_0xa93b('0x51')](_0xa99175['query'],_0xe7b36[_0xa93b('0x47')]));if(_0xa99175[_0xa93b('0x45')][_0xa93b('0x52')]){_0x14d2f6['where']=_[_0xa93b('0x53')](_0x14d2f6[_0xa93b('0x50')],{'$or':_[_0xa93b('0x54')](_0x14d2f6['attributes'],function(_0xcc41fb){var _0x200b3a={};_0x200b3a[_0xcc41fb]={'$like':'%'+_0xa99175[_0xa93b('0x45')][_0xa93b('0x52')]+'%'};return _0x200b3a;})});}_0x14d2f6=_[_0xa93b('0x53')]({},_0x14d2f6,_0xa99175[_0xa93b('0x55')]);return _0x42715c['getAgents'](_0x14d2f6);}})['then'](function(_0x10ac72){if(_0x10ac72){_0x26057a=_0x10ac72[_0xa93b('0x71')];if(!_0xa99175['query'][_0xa93b('0x4b')]('nolimit')){_0x14d2f6['limit']=qs[_0xa93b('0x4d')](_0xa99175[_0xa93b('0x45')]['limit']);_0x14d2f6[_0xa93b('0x34')]=qs[_0xa93b('0x34')](_0xa99175[_0xa93b('0x45')]['offset']);}return _0x42715c[_0xa93b('0xc2')](_0x14d2f6);}})[_0xa93b('0x24')](function(_0x4acc80){if(_0x4acc80){return _0x4acc80?{'count':_0x26057a,'rows':_0x4acc80}:null;}})['then'](respondWithResult(_0x31e203,null))[_0xa93b('0x2e')](handleError(_0x31e203,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 14e964b..9c690be 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 _0x3be2=['emit','exports','FaxAccount','setMaxListeners','update'];(function(_0x41c8f8,_0x23be4d){var _0xbc785a=function(_0x5e4b66){while(--_0x5e4b66){_0x41c8f8['push'](_0x41c8f8['shift']());}};_0xbc785a(++_0x23be4d);}(_0x3be2,0x17e));var _0x23be=function(_0x13d3d4,_0x493ea5){_0x13d3d4=_0x13d3d4-0x0;var _0x48c26c=_0x3be2[_0x13d3d4];return _0x48c26c;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x23be('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x23be('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x23be('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1d9a4f){return function(_0x65895e,_0x348d91,_0xf6222a){FaxAccountEvents[_0x23be('0x3')](_0x1d9a4f+':'+_0x65895e['id'],_0x65895e);FaxAccountEvents[_0x23be('0x3')](_0x1d9a4f,_0x65895e);_0xf6222a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x23be('0x4')]=FaxAccountEvents; \ No newline at end of file +var _0x3620=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0xfe575e,_0x577879){var _0x16eba1=function(_0x76c5a0){while(--_0x76c5a0){_0xfe575e['push'](_0xfe575e['shift']());}};_0x16eba1(++_0x577879);}(_0x3620,0x13e));var _0x0362=function(_0x2e14b2,_0x275f09){_0x2e14b2=_0x2e14b2-0x0;var _0x484a05=_0x3620[_0x2e14b2];return _0x484a05;};'use strict';var EventEmitter=require(_0x0362('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0362('0x1')](0x0);var events={'afterCreate':_0x0362('0x2'),'afterUpdate':_0x0362('0x3'),'afterDestroy':'remove'};function emitEvent(_0x224ad7){return function(_0x40c925,_0x24d6ba,_0x442f48){FaxAccountEvents[_0x0362('0x4')](_0x224ad7+':'+_0x40c925['id'],_0x40c925);FaxAccountEvents['emit'](_0x224ad7,_0x40c925);_0x442f48(null);};}for(var e in events){if(events[_0x0362('0x5')](e)){var event=events[e];FaxAccount[_0x0362('0x6')](e,emitEvent(event));}}module[_0x0362('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 8574ddb..7375796 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 _0x4aa5=['fax_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4aa5,0x18d));var _0x54aa=function(_0x5b42af,_0x40c27b){_0x5b42af=_0x5b42af-0x0;var _0x35839e=_0x4aa5[_0x5b42af];return _0x35839e;};'use strict';var _=require(_0x54aa('0x0'));var util=require(_0x54aa('0x1'));var logger=require(_0x54aa('0x2'))(_0x54aa('0x3'));var moment=require('moment');var BPromise=require(_0x54aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54aa('0x5'));var rimraf=require(_0x54aa('0x6'));var config=require(_0x54aa('0x7'));var attributes=require(_0x54aa('0x8'));module[_0x54aa('0x9')]=function(_0x303595,_0xdfbbf6){return _0x303595['define'](_0x54aa('0xa'),attributes,{'tableName':_0x54aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c1=['moment','bluebird','path','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger'];(function(_0x3ac219,_0x426e1c){var _0x118273=function(_0x16c018){while(--_0x16c018){_0x3ac219['push'](_0x3ac219['shift']());}};_0x118273(++_0x426e1c);}(_0xb4c1,0x126));var _0x1b4c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb4c1[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x1b4c('0x0'));var util=require(_0x1b4c('0x1'));var logger=require(_0x1b4c('0x2'))('api');var moment=require(_0x1b4c('0x3'));var BPromise=require(_0x1b4c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b4c('0x5'));var rimraf=require('rimraf');var config=require(_0x1b4c('0x6'));var attributes=require(_0x1b4c('0x7'));module[_0x1b4c('0x8')]=function(_0x80d720,_0x3bded4){return _0x80d720[_0x1b4c('0x9')]('FaxAccount',attributes,{'tableName':_0x1b4c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 74d2544..5d94aa6 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 _0xd041=['map','model','stringify','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','FaxApplication','Applications','List','applications','list','priority','asc','Contacts','length','create','FaxInteraction','spread','get','autoclose','push','close','unmanaged','created','interaction','FaxMessage','ContactId','UserId','name','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxAccount','FaxAccount','options','raw','attributes','include'];(function(_0x10c0ff,_0x4aa275){var _0x330bf1=function(_0xff322a){while(--_0xff322a){_0x10c0ff['push'](_0x10c0ff['shift']());}};_0x330bf1(++_0x4aa275);}(_0xd041,0x1e9));var _0x1d04=function(_0x369f28,_0x2c949d){_0x369f28=_0x369f28-0x0;var _0x584c8c=_0xd041[_0x369f28];return _0x584c8c;};'use strict';var _=require(_0x1d04('0x0'));var util=require(_0x1d04('0x1'));var moment=require(_0x1d04('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d04('0x3'));var fs=require('fs');var Redis=require(_0x1d04('0x4'));var db=require(_0x1d04('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d04('0x6'))(_0x1d04('0x7'));var config=require('../../config/environment');var jayson=require(_0x1d04('0x8'));var client=jayson[_0x1d04('0x9')][_0x1d04('0xa')]({'port':0x232c});config[_0x1d04('0xb')]=_[_0x1d04('0xc')](config[_0x1d04('0xb')],{'host':_0x1d04('0xd'),'port':0x18eb});var socket=require(_0x1d04('0xe'))(new Redis(config[_0x1d04('0xb')]));require(_0x1d04('0xf'))['register'](socket);function respondWithRpcPromise(_0x38ce69,_0x27514d,_0x4ea671){return new BPromise(function(_0x1b5b63,_0x1a5de6){return client[_0x1d04('0x10')](_0x38ce69,_0x4ea671)[_0x1d04('0x11')](function(_0x3605e8){logger[_0x1d04('0x12')](_0x1d04('0x13'),_0x27514d,_0x1d04('0x14'));logger[_0x1d04('0x15')](_0x1d04('0x16'),_0x27514d,'request\x20sent',JSON['stringify'](_0x3605e8));if(_0x3605e8[_0x1d04('0x17')]){if(_0x3605e8[_0x1d04('0x17')][_0x1d04('0x18')]===0x1f4){logger[_0x1d04('0x17')](_0x1d04('0x13'),_0x27514d,_0x3605e8[_0x1d04('0x17')]['message']);return _0x1a5de6(_0x3605e8['error'][_0x1d04('0x19')]);}logger[_0x1d04('0x17')](_0x1d04('0x13'),_0x27514d,_0x3605e8[_0x1d04('0x17')][_0x1d04('0x19')]);return _0x1b5b63(_0x3605e8[_0x1d04('0x17')][_0x1d04('0x19')]);}else{logger[_0x1d04('0x12')]('FaxAccount,\x20%s,\x20%s',_0x27514d,_0x1d04('0x14'));_0x1b5b63(_0x3605e8['result'][_0x1d04('0x19')]);}})[_0x1d04('0x1a')](function(_0x2175ea){logger[_0x1d04('0x17')](_0x1d04('0x13'),_0x27514d,_0x2175ea);_0x1a5de6(_0x2175ea);});});}exports[_0x1d04('0x1b')]=function(_0x3aa801){var _0x1b2e3c=this;return new Promise(function(_0x1563dc,_0x539f0){return db[_0x1d04('0x1c')]['findAll']({'raw':_0x3aa801[_0x1d04('0x1d')]?_0x3aa801[_0x1d04('0x1d')][_0x1d04('0x1e')]===undefined?!![]:![]:!![],'where':_0x3aa801[_0x1d04('0x1d')]?_0x3aa801[_0x1d04('0x1d')]['where']||null:null,'attributes':_0x3aa801[_0x1d04('0x1d')]?_0x3aa801[_0x1d04('0x1d')][_0x1d04('0x1f')]||null:null,'limit':_0x3aa801[_0x1d04('0x1d')]?_0x3aa801[_0x1d04('0x1d')]['limit']||null:null,'include':_0x3aa801[_0x1d04('0x1d')]?_0x3aa801[_0x1d04('0x1d')][_0x1d04('0x20')]?_[_0x1d04('0x21')](_0x3aa801[_0x1d04('0x1d')][_0x1d04('0x20')],function(_0x6bf38e){return{'model':db[_0x6bf38e[_0x1d04('0x22')]],'as':_0x6bf38e['as'],'attributes':_0x6bf38e[_0x1d04('0x1f')],'include':_0x6bf38e[_0x1d04('0x20')]?_[_0x1d04('0x21')](_0x6bf38e[_0x1d04('0x20')],function(_0x557fbd){return{'model':db[_0x557fbd[_0x1d04('0x22')]],'as':_0x557fbd['as'],'attributes':_0x557fbd[_0x1d04('0x1f')],'include':_0x557fbd[_0x1d04('0x20')]?_[_0x1d04('0x21')](_0x557fbd[_0x1d04('0x20')],function(_0x48e382){return{'model':db[_0x48e382['model']],'as':_0x48e382['as'],'attributes':_0x48e382[_0x1d04('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1d04('0x11')](function(_0x229eec){logger[_0x1d04('0x12')](_0x1d04('0x1b'),_0x3aa801);logger[_0x1d04('0x15')]('GetFaxAccount',_0x3aa801,JSON[_0x1d04('0x23')](_0x229eec));_0x1563dc(_0x229eec);})[_0x1d04('0x1a')](function(_0x5cc8b0){logger[_0x1d04('0x17')]('GetFaxAccount',_0x5cc8b0['message'],_0x3aa801);_0x539f0(_0x1b2e3c[_0x1d04('0x17')](0x1f4,_0x5cc8b0[_0x1d04('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x38b122,_0x509b04,_0x20cdc4){var _0xe62439=this;return new Promise(function(_0x2219ca,_0x491e29){var _0x16cce0={'body':_0x38b122[_0x1d04('0x24')],'channel':_0x1d04('0x25')};var _0x4d1110=[];var _0x59965a=[];var _0x342c1c={};return db['CmContact'][_0x1d04('0x26')]()[_0x1d04('0x11')](function(_0x22ec84){if(!_0x22ec84){throw new db[(_0x1d04('0x27'))][(_0x1d04('0x28'))](_0x1d04('0x29'));}_0x4d1110=_[_0x1d04('0x2a')](_['keys'](_0x22ec84),[_0x1d04('0x2b'),_0x1d04('0x2c')]);_0x59965a=_[_0x1d04('0x2a')](_[_0x1d04('0x2d')](_0x22ec84),[_0x1d04('0x2b'),_0x1d04('0x2c'),_0x1d04('0x2e'),_0x1d04('0x2f')]);if(_0x38b122[_0x1d04('0x24')]['id']){delete _0x38b122[_0x1d04('0x24')]['id'];}if(_[_0x1d04('0x30')](_0x38b122[_0x1d04('0x24')][_0x1d04('0x31')])){throw new db[(_0x1d04('0x27'))][(_0x1d04('0x28'))](_0x1d04('0x32'));}if(_['isNil'](_0x38b122[_0x1d04('0x24')][_0x1d04('0x24')])||_0x38b122[_0x1d04('0x24')][_0x1d04('0x24')]===''){throw new db[(_0x1d04('0x27'))][(_0x1d04('0x28'))](_0x1d04('0x33'));}if(_[_0x1d04('0x30')](_0x38b122['body'][_0x1d04('0x34')])){throw new db[(_0x1d04('0x27'))][(_0x1d04('0x28'))](_0x1d04('0x35')+_0x59965a);}if(!_['includes'](_0x59965a,_0x38b122[_0x1d04('0x24')][_0x1d04('0x34')])){throw new db[(_0x1d04('0x27'))]['ValidationError'](_0x1d04('0x36')+_0x59965a);}_0x342c1c[_0x38b122[_0x1d04('0x24')][_0x1d04('0x34')]]=_0x38b122[_0x1d04('0x24')][_0x1d04('0x31')];})[_0x1d04('0x11')](function(){return db[_0x1d04('0x1c')][_0x1d04('0x37')]({'where':{'id':_0x38b122[_0x1d04('0x38')]['id']},'include':[{'model':db[_0x1d04('0x39')],'as':'List','include':[{'model':db[_0x1d04('0x3a')],'as':'Contacts','where':_0x342c1c,'limit':0x1,'order':[[_0x1d04('0x2c'),'DESC']]}]},{'model':db[_0x1d04('0x3b')],'as':_0x1d04('0x3c')}]});})['then'](function(_0x2779ee){if(_0x2779ee&&_0x2779ee[_0x1d04('0x3d')]){var _0x299e9e=_0x2779ee['get']({'plain':!![]});_0x16cce0[_0x1d04('0x38')]=_0x299e9e;_0x16cce0[_0x1d04('0x3e')]=_0x299e9e[_0x1d04('0x3c')];_0x16cce0[_0x1d04('0x3f')]=_0x299e9e[_0x1d04('0x3d')];_0x16cce0[_0x1d04('0x3e')]=_['orderBy'](_0x16cce0[_0x1d04('0x3e')],[_0x1d04('0x40')],[_0x1d04('0x41')]);if(_0x16cce0['account'][_0x1d04('0x3c')]){delete _0x16cce0['account'][_0x1d04('0x3c')];}if(_0x16cce0['account'][_0x1d04('0x3d')]&&_0x16cce0[_0x1d04('0x38')][_0x1d04('0x3d')][_0x1d04('0x42')][_0x1d04('0x43')]){return _0x16cce0[_0x1d04('0x38')]['List'][_0x1d04('0x42')][0x0];}var _0x9e7bf=_[_0x1d04('0xc')](_0x38b122[_0x1d04('0x24')],{'firstName':_0x38b122[_0x1d04('0x24')][_0x1d04('0x31')],'ListId':_0x299e9e[_0x1d04('0x2f')]});_0x9e7bf[_0x38b122[_0x1d04('0x24')][_0x1d04('0x34')]]=_0x38b122['body']['from'];return db[_0x1d04('0x3a')][_0x1d04('0x44')](_0x9e7bf,{'fields':_0x4d1110,'raw':!![]});}})[_0x1d04('0x11')](function(_0x52a900){_0x16cce0['contact']=_0x52a900;if(_0x52a900){var _0x2fc707={'ContactId':_0x52a900['id'],'FaxAccountId':_0x38b122[_0x1d04('0x38')]['id'],'fax':_0x52a900[_0x1d04('0x25')]};return db[_0x1d04('0x45')][_0x1d04('0x37')]({'where':{'ContactId':_0x52a900['id'],'closed':![],'FaxAccountId':_0x38b122[_0x1d04('0x38')]['id']}})[_0x1d04('0x11')](function(_0x292c07){if(_0x292c07){return[_0x292c07,![]];}return db[_0x1d04('0x45')]['create'](_0x2fc707)[_0x1d04('0x11')](function(_0x286e27){return[_0x286e27,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1d04('0x46')](function(_0x3bdf87,_0x71568b){var _0x1918cf=_0x3bdf87[_0x1d04('0x47')]({'plain':!![]});if(_0x71568b){if(_0x16cce0[_0x1d04('0x38')][_0x1d04('0x48')]){_0x16cce0[_0x1d04('0x3e')][_0x1d04('0x49')]({'id':0x0,'priority':_0x16cce0[_0x1d04('0x3e')][_0x1d04('0x43')]+0x1,'app':_0x1d04('0x4a'),'appdata':_0x1d04('0x4b'),'interval':'*,*,*,*'});}_0x1918cf['created']=!![];}else{_0x1918cf[_0x1d04('0x4c')]=![];}_0x16cce0[_0x1d04('0x4d')]=_0x1918cf;return db[_0x1d04('0x4e')]['create']({'body':_0x38b122['body']['body'],'FaxAccountId':_0x38b122[_0x1d04('0x38')]['id'],'FaxInteractionId':_0x3bdf87['id'],'direction':'in','ContactId':_0x3bdf87[_0x1d04('0x4f')],'AttachmentId':_0x38b122[_0x1d04('0x24')]['AttachmentId']});})[_0x1d04('0x11')](function(_0x2a945d){_0x16cce0[_0x1d04('0x19')]=_0x2a945d;if(_0x16cce0[_0x1d04('0x4d')][_0x1d04('0x50')]){return db['User']['find']({'attributes':['id',_0x1d04('0x51')],'where':{'id':_0x16cce0[_0x1d04('0x4d')][_0x1d04('0x50')]}})['then'](function(_0x5d6b0f){if(_0x5d6b0f){_0x16cce0[_0x1d04('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1d04('0x52'),'appdata':_0x5d6b0f[_0x1d04('0x51')]+','+(_0x16cce0[_0x1d04('0x38')][_0x1d04('0x53')]||0xa),'interval':_0x1d04('0x54')});}return respondWithRpcPromise(_0x1d04('0x55'),_0x1d04('0x56'),_0x16cce0);});}return respondWithRpcPromise(_0x1d04('0x55'),'startRouting',_0x16cce0);})['then'](function(_0x459079){_0x2219ca(_0x459079);})['catch'](function(_0x5cc283){_0x491e29(_0xe62439[_0x1d04('0x17')](0x1f4,_0x5cc283['message']));});});}; \ No newline at end of file +var _0xb1fc=['isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','priority','asc','Contacts','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','created','interaction','FaxMessage','AttachmentId','name','UserId','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','register','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','findAll','options','attributes','include','map','model','debug','stringify','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','body'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb1fc,0x78));var _0xcb1f=function(_0x40c2c9,_0x22d19a){_0x40c2c9=_0x40c2c9-0x0;var _0x5c13c5=_0xb1fc[_0x40c2c9];return _0x5c13c5;};'use strict';var _=require(_0xcb1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb1f('0x1'));var fs=require('fs');var Redis=require(_0xcb1f('0x2'));var db=require(_0xcb1f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb1f('0x4'))(_0xcb1f('0x5'));var config=require(_0xcb1f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb1f('0x7')]({'port':0x232c});config[_0xcb1f('0x8')]=_['defaults'](config[_0xcb1f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb1f('0x9'))(new Redis(config[_0xcb1f('0x8')]));require('./faxAccount.socket')[_0xcb1f('0xa')](socket);function respondWithRpcPromise(_0xd5ad2a,_0x1cd0e7,_0x4f3254){return new BPromise(function(_0x52457a,_0x426e7e){return client['request'](_0xd5ad2a,_0x4f3254)[_0xcb1f('0xb')](function(_0x1d5660){logger[_0xcb1f('0xc')]('FaxAccount,\x20%s,\x20%s',_0x1cd0e7,_0xcb1f('0xd'));logger['debug'](_0xcb1f('0xe'),_0x1cd0e7,_0xcb1f('0xd'),JSON['stringify'](_0x1d5660));if(_0x1d5660[_0xcb1f('0xf')]){if(_0x1d5660[_0xcb1f('0xf')][_0xcb1f('0x10')]===0x1f4){logger[_0xcb1f('0xf')](_0xcb1f('0x11'),_0x1cd0e7,_0x1d5660[_0xcb1f('0xf')][_0xcb1f('0x12')]);return _0x426e7e(_0x1d5660[_0xcb1f('0xf')][_0xcb1f('0x12')]);}logger[_0xcb1f('0xf')](_0xcb1f('0x11'),_0x1cd0e7,_0x1d5660['error'][_0xcb1f('0x12')]);return _0x52457a(_0x1d5660[_0xcb1f('0xf')][_0xcb1f('0x12')]);}else{logger['info'](_0xcb1f('0x11'),_0x1cd0e7,_0xcb1f('0xd'));_0x52457a(_0x1d5660[_0xcb1f('0x13')][_0xcb1f('0x12')]);}})['catch'](function(_0x44cf6f){logger['error'](_0xcb1f('0x11'),_0x1cd0e7,_0x44cf6f);_0x426e7e(_0x44cf6f);});});}exports[_0xcb1f('0x14')]=function(_0xf78f4f){var _0x241c62=this;return new Promise(function(_0x53bfd9,_0x3d8744){return db[_0xcb1f('0x15')][_0xcb1f('0x16')]({'raw':_0xf78f4f['options']?_0xf78f4f['options']['raw']===undefined?!![]:![]:!![],'where':_0xf78f4f[_0xcb1f('0x17')]?_0xf78f4f[_0xcb1f('0x17')]['where']||null:null,'attributes':_0xf78f4f[_0xcb1f('0x17')]?_0xf78f4f[_0xcb1f('0x17')][_0xcb1f('0x18')]||null:null,'limit':_0xf78f4f[_0xcb1f('0x17')]?_0xf78f4f[_0xcb1f('0x17')]['limit']||null:null,'include':_0xf78f4f['options']?_0xf78f4f[_0xcb1f('0x17')][_0xcb1f('0x19')]?_[_0xcb1f('0x1a')](_0xf78f4f[_0xcb1f('0x17')][_0xcb1f('0x19')],function(_0x15b4a6){return{'model':db[_0x15b4a6['model']],'as':_0x15b4a6['as'],'attributes':_0x15b4a6['attributes'],'include':_0x15b4a6[_0xcb1f('0x19')]?_[_0xcb1f('0x1a')](_0x15b4a6[_0xcb1f('0x19')],function(_0x1fb089){return{'model':db[_0x1fb089['model']],'as':_0x1fb089['as'],'attributes':_0x1fb089[_0xcb1f('0x18')],'include':_0x1fb089['include']?_[_0xcb1f('0x1a')](_0x1fb089['include'],function(_0x5a36fd){return{'model':db[_0x5a36fd[_0xcb1f('0x1b')]],'as':_0x5a36fd['as'],'attributes':_0x5a36fd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4726c4){logger['info'](_0xcb1f('0x14'),_0xf78f4f);logger[_0xcb1f('0x1c')](_0xcb1f('0x14'),_0xf78f4f,JSON[_0xcb1f('0x1d')](_0x4726c4));_0x53bfd9(_0x4726c4);})['catch'](function(_0x2ec557){logger[_0xcb1f('0xf')](_0xcb1f('0x14'),_0x2ec557['message'],_0xf78f4f);_0x3d8744(_0x241c62[_0xcb1f('0xf')](0x1f4,_0x2ec557[_0xcb1f('0x12')]));});});};exports[_0xcb1f('0x1e')]=function(_0x2027c8,_0x59531e,_0x8973a){var _0x3d144f=this;return new Promise(function(_0x4e0afe,_0x53d8b0){var _0x42db83={'body':_0x2027c8['body'],'channel':_0xcb1f('0x1f')};var _0x55c029=[];var _0x25a99e=[];var _0x316999={};return db[_0xcb1f('0x20')][_0xcb1f('0x21')]()['then'](function(_0x26d487){if(!_0x26d487){throw new db[(_0xcb1f('0x22'))][(_0xcb1f('0x23'))]('no\x20available\x20attributes');}_0x55c029=_[_0xcb1f('0x24')](_[_0xcb1f('0x25')](_0x26d487),[_0xcb1f('0x26'),_0xcb1f('0x27')]);_0x25a99e=_[_0xcb1f('0x24')](_[_0xcb1f('0x25')](_0x26d487),[_0xcb1f('0x26'),_0xcb1f('0x27'),_0xcb1f('0x28'),'ListId']);if(_0x2027c8[_0xcb1f('0x29')]['id']){delete _0x2027c8[_0xcb1f('0x29')]['id'];}if(_[_0xcb1f('0x2a')](_0x2027c8[_0xcb1f('0x29')]['from'])){throw new db['Sequelize'][(_0xcb1f('0x23'))](_0xcb1f('0x2b'));}if(_[_0xcb1f('0x2a')](_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x29')])||_0x2027c8[_0xcb1f('0x29')]['body']===''){throw new db['Sequelize'][(_0xcb1f('0x23'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcb1f('0x2a')](_0x2027c8[_0xcb1f('0x29')]['mapKey'])){throw new db[(_0xcb1f('0x22'))][(_0xcb1f('0x23'))](_0xcb1f('0x2c')+_0x25a99e);}if(!_[_0xcb1f('0x2d')](_0x25a99e,_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x2e')])){throw new db[(_0xcb1f('0x22'))][(_0xcb1f('0x23'))](_0xcb1f('0x2f')+_0x25a99e);}_0x316999[_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x2e')]]=_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x30')];})[_0xcb1f('0xb')](function(){return db[_0xcb1f('0x15')][_0xcb1f('0x31')]({'where':{'id':_0x2027c8[_0xcb1f('0x32')]['id']},'include':[{'model':db[_0xcb1f('0x33')],'as':_0xcb1f('0x34'),'include':[{'model':db[_0xcb1f('0x20')],'as':'Contacts','where':_0x316999,'limit':0x1,'order':[['updatedAt',_0xcb1f('0x35')]]}]},{'model':db[_0xcb1f('0x36')],'as':_0xcb1f('0x37')}]});})[_0xcb1f('0xb')](function(_0x52da4b){if(_0x52da4b&&_0x52da4b[_0xcb1f('0x34')]){var _0x55fc25=_0x52da4b[_0xcb1f('0x38')]({'plain':!![]});_0x42db83[_0xcb1f('0x32')]=_0x55fc25;_0x42db83[_0xcb1f('0x39')]=_0x55fc25['Applications'];_0x42db83[_0xcb1f('0x3a')]=_0x55fc25['List'];_0x42db83[_0xcb1f('0x39')]=_['orderBy'](_0x42db83[_0xcb1f('0x39')],[_0xcb1f('0x3b')],[_0xcb1f('0x3c')]);if(_0x42db83[_0xcb1f('0x32')][_0xcb1f('0x37')]){delete _0x42db83['account'][_0xcb1f('0x37')];}if(_0x42db83[_0xcb1f('0x32')][_0xcb1f('0x34')]&&_0x42db83[_0xcb1f('0x32')][_0xcb1f('0x34')][_0xcb1f('0x3d')][_0xcb1f('0x3e')]){return _0x42db83[_0xcb1f('0x32')][_0xcb1f('0x34')]['Contacts'][0x0];}var _0x3b7484=_['defaults'](_0x2027c8[_0xcb1f('0x29')],{'firstName':_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x30')],'ListId':_0x55fc25['ListId']});_0x3b7484[_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x2e')]]=_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x30')];return db['CmContact'][_0xcb1f('0x3f')](_0x3b7484,{'fields':_0x55c029,'raw':!![]});}})[_0xcb1f('0xb')](function(_0xaacb32){_0x42db83[_0xcb1f('0x40')]=_0xaacb32;if(_0xaacb32){var _0x42b734={'ContactId':_0xaacb32['id'],'FaxAccountId':_0x2027c8[_0xcb1f('0x32')]['id'],'fax':_0xaacb32['fax']};return db[_0xcb1f('0x41')]['find']({'where':{'ContactId':_0xaacb32['id'],'closed':![],'FaxAccountId':_0x2027c8[_0xcb1f('0x32')]['id']}})['then'](function(_0x318a10){if(_0x318a10){return[_0x318a10,![]];}return db[_0xcb1f('0x41')]['create'](_0x42b734)[_0xcb1f('0xb')](function(_0x189783){return[_0x189783,!![]];});});}else{throw new Error(_0xcb1f('0x42'));}})[_0xcb1f('0x43')](function(_0x5a3a79,_0x3c908e){var _0x17751c=_0x5a3a79[_0xcb1f('0x38')]({'plain':!![]});if(_0x3c908e){if(_0x42db83[_0xcb1f('0x32')]['autoclose']){_0x42db83[_0xcb1f('0x39')][_0xcb1f('0x44')]({'id':0x0,'priority':_0x42db83[_0xcb1f('0x39')][_0xcb1f('0x3e')]+0x1,'app':_0xcb1f('0x45'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x17751c['created']=!![];}else{_0x17751c[_0xcb1f('0x46')]=![];}_0x42db83[_0xcb1f('0x47')]=_0x17751c;return db[_0xcb1f('0x48')]['create']({'body':_0x2027c8['body'][_0xcb1f('0x29')],'FaxAccountId':_0x2027c8[_0xcb1f('0x32')]['id'],'FaxInteractionId':_0x5a3a79['id'],'direction':'in','ContactId':_0x5a3a79['ContactId'],'AttachmentId':_0x2027c8[_0xcb1f('0x29')][_0xcb1f('0x49')]});})['then'](function(_0xd2383c){_0x42db83[_0xcb1f('0x12')]=_0xd2383c;if(_0x42db83['interaction']['UserId']){return db['User'][_0xcb1f('0x31')]({'attributes':['id',_0xcb1f('0x4a')],'where':{'id':_0x42db83[_0xcb1f('0x47')][_0xcb1f('0x4b')]}})[_0xcb1f('0xb')](function(_0xeb512d){if(_0xeb512d){_0x42db83[_0xcb1f('0x39')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xeb512d[_0xcb1f('0x4a')]+','+(_0x42db83['account'][_0xcb1f('0x4c')]||0xa),'interval':_0xcb1f('0x4d')});}return respondWithRpcPromise(_0xcb1f('0x4e'),_0xcb1f('0x4f'),_0x42db83);});}return respondWithRpcPromise(_0xcb1f('0x4e'),_0xcb1f('0x4f'),_0x42db83);})['then'](function(_0x1692d8){_0x4e0afe(_0x1692d8);})[_0xcb1f('0x50')](function(_0x1f40ba){_0x53d8b0(_0x3d144f[_0xcb1f('0xf')](0x1f4,_0x1f40ba[_0xcb1f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 62b392c..6d40fb8 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 _0x6455=['emit','removeListener','register','length','./faxAccount.events','remove','update'];(function(_0x4b1c44,_0x207008){var _0x24121d=function(_0x4c45e0){while(--_0x4c45e0){_0x4b1c44['push'](_0x4b1c44['shift']());}};_0x24121d(++_0x207008);}(_0x6455,0x97));var _0x5645=function(_0x36b1fb,_0x270bae){_0x36b1fb=_0x36b1fb-0x0;var _0x3571ed=_0x6455[_0x36b1fb];return _0x3571ed;};'use strict';var FaxAccountEvents=require(_0x5645('0x0'));var events=['save',_0x5645('0x1'),_0x5645('0x2')];function createListener(_0x431773,_0x1c3f7e){return function(_0x37c67a){_0x1c3f7e[_0x5645('0x3')](_0x431773,_0x37c67a);};}function removeListener(_0x5388ff,_0x233875){return function(){FaxAccountEvents[_0x5645('0x4')](_0x5388ff,_0x233875);};}exports[_0x5645('0x5')]=function(_0x9400a8){for(var _0x3a635d=0x0,_0x37d672=events[_0x5645('0x6')];_0x3a635d<_0x37d672;_0x3a635d++){var _0x278d86=events[_0x3a635d];var _0x518a28=createListener('faxAccount:'+_0x278d86,_0x9400a8);FaxAccountEvents['on'](_0x278d86,_0x518a28);}}; \ No newline at end of file +var _0x7708=['length','faxAccount:','./faxAccount.events','save','update','register'];(function(_0x59f024,_0x3c233a){var _0x528e37=function(_0x163585){while(--_0x163585){_0x59f024['push'](_0x59f024['shift']());}};_0x528e37(++_0x3c233a);}(_0x7708,0x188));var _0x8770=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x7708[_0x5af59e];return _0x4240df;};'use strict';var FaxAccountEvents=require(_0x8770('0x0'));var events=[_0x8770('0x1'),'remove',_0x8770('0x2')];function createListener(_0x5a8b5b,_0x5ca46f){return function(_0x555477){_0x5ca46f['emit'](_0x5a8b5b,_0x555477);};}function removeListener(_0x182d52,_0x1a796d){return function(){FaxAccountEvents['removeListener'](_0x182d52,_0x1a796d);};}exports[_0x8770('0x3')]=function(_0x50bab7){for(var _0x31390d=0x0,_0x42d305=events[_0x8770('0x4')];_0x31390d<_0x42d305;_0x31390d++){var _0x20e293=events[_0x31390d];var _0x212b12=createListener(_0x8770('0x5')+_0x20e293,_0x50bab7);FaxAccountEvents['on'](_0x20e293,_0x212b12);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 377af15..0380a52 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 _0x66d8=['/:id/dispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show'];(function(_0x56f883,_0x146daf){var _0x563550=function(_0x3d3aee){while(--_0x3d3aee){_0x56f883['push'](_0x56f883['shift']());}};_0x563550(++_0x146daf);}(_0x66d8,0x143));var _0x866d=function(_0x2b608e,_0x2b9d76){_0x2b608e=_0x2b608e-0x0;var _0x2aca67=_0x66d8[_0x2b608e];return _0x2aca67;};'use strict';var multer=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var path=require(_0x866d('0x2'));var timeout=require(_0x866d('0x3'));var express=require(_0x866d('0x4'));var router=express['Router']();var auth=require(_0x866d('0x5'));var interaction=require(_0x866d('0x6'));var config=require(_0x866d('0x7'));var controller=require('./faxAccount.controller');router[_0x866d('0x8')]('/',auth[_0x866d('0x9')](),controller['index']);router['get'](_0x866d('0xa'),auth[_0x866d('0x9')](),controller['describe']);router['get'](_0x866d('0xb'),auth[_0x866d('0x9')](),controller[_0x866d('0xc')]);router[_0x866d('0x8')](_0x866d('0xd'),auth[_0x866d('0x9')](),controller['getDispositions']);router['get'](_0x866d('0xe'),auth[_0x866d('0x9')](),controller['getAnswers']);router['get'](_0x866d('0xf'),auth['isAuthenticated'](),controller[_0x866d('0x10')]);router[_0x866d('0x8')](_0x866d('0x11'),auth[_0x866d('0x9')](),controller['getApplications']);router[_0x866d('0x8')](_0x866d('0x12'),auth[_0x866d('0x9')](),controller[_0x866d('0x13')]);router[_0x866d('0x8')](_0x866d('0x14'),auth[_0x866d('0x9')](),controller[_0x866d('0x15')]);router[_0x866d('0x16')]('/',auth['isAuthenticated'](),controller[_0x866d('0x17')]);router['post']('/:id/dispositions',auth[_0x866d('0x9')](),controller[_0x866d('0x18')]);router[_0x866d('0x16')](_0x866d('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x866d('0xf'),auth['isAuthenticated'](),controller[_0x866d('0x19')]);router[_0x866d('0x16')](_0x866d('0x11'),auth[_0x866d('0x9')](),controller[_0x866d('0x1a')]);router[_0x866d('0x16')](_0x866d('0x1b'),auth[_0x866d('0x9')](),controller[_0x866d('0x1c')]);router[_0x866d('0x16')](_0x866d('0x1d'),auth[_0x866d('0x9')](),controller[_0x866d('0x1e')]);router[_0x866d('0x16')](_0x866d('0x1f'),auth[_0x866d('0x9')](),controller[_0x866d('0x20')]);router['post'](_0x866d('0x14'),auth[_0x866d('0x9')](),controller[_0x866d('0x21')]);router[_0x866d('0x22')](_0x866d('0xb'),auth['isAuthenticated'](),controller[_0x866d('0x23')]);router[_0x866d('0x24')](_0x866d('0xb'),auth['isAuthenticated'](),controller[_0x866d('0x25')]);router[_0x866d('0x24')](_0x866d('0xd'),auth[_0x866d('0x9')](),controller[_0x866d('0x26')]);router[_0x866d('0x24')](_0x866d('0xe'),auth[_0x866d('0x9')](),controller[_0x866d('0x27')]);router[_0x866d('0x24')]('/:id/users',auth[_0x866d('0x9')](),controller[_0x866d('0x28')]);module[_0x866d('0x29')]=router; \ No newline at end of file +var _0xf987=['get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/messages','/:id/users','getAgents','post','/:id/interactions','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','update','delete','destroy','removeDispositions','exports','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index'];(function(_0x50e033,_0x391e5d){var _0x40b17e=function(_0x203afd){while(--_0x203afd){_0x50e033['push'](_0x50e033['shift']());}};_0x40b17e(++_0x391e5d);}(_0xf987,0xb4));var _0x7f98=function(_0xc4094d,_0x15121a){_0xc4094d=_0xc4094d-0x0;var _0x5cc355=_0xf987[_0xc4094d];return _0x5cc355;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x7f98('0x0'));var interaction=require(_0x7f98('0x1'));var config=require(_0x7f98('0x2'));var controller=require(_0x7f98('0x3'));router['get']('/',auth[_0x7f98('0x4')](),controller[_0x7f98('0x5')]);router[_0x7f98('0x6')]('/describe',auth[_0x7f98('0x4')](),controller['describe']);router[_0x7f98('0x6')](_0x7f98('0x7'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x8')]);router[_0x7f98('0x6')](_0x7f98('0x9'),auth[_0x7f98('0x4')](),controller[_0x7f98('0xa')]);router[_0x7f98('0x6')](_0x7f98('0xb'),auth[_0x7f98('0x4')](),controller[_0x7f98('0xc')]);router[_0x7f98('0x6')]('/:id/interactions',auth[_0x7f98('0x4')](),controller['getInteractions']);router['get'](_0x7f98('0xd'),auth[_0x7f98('0x4')](),controller['getApplications']);router[_0x7f98('0x6')](_0x7f98('0xe'),auth[_0x7f98('0x4')](),controller['getMessages']);router[_0x7f98('0x6')](_0x7f98('0xf'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x10')]);router[_0x7f98('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7f98('0x9'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x7f98('0xb'),auth[_0x7f98('0x4')](),controller['addAnswer']);router['post'](_0x7f98('0x12'),auth['isAuthenticated'](),controller[_0x7f98('0x13')]);router[_0x7f98('0x11')](_0x7f98('0xd'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x14')]);router[_0x7f98('0x11')](_0x7f98('0x15'),auth['isAuthenticated'](),controller['addAccountApplications']);router[_0x7f98('0x11')](_0x7f98('0x16'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x17')]);router['post'](_0x7f98('0x18'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x19')]);router[_0x7f98('0x11')]('/:id/users',auth[_0x7f98('0x4')](),controller['addAgents']);router['put'](_0x7f98('0x7'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x1a')]);router[_0x7f98('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x7f98('0x1c')]);router[_0x7f98('0x1b')](_0x7f98('0x9'),auth[_0x7f98('0x4')](),controller[_0x7f98('0x1d')]);router['delete'](_0x7f98('0xb'),auth[_0x7f98('0x4')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x7f98('0x4')](),controller['removeAgents']);module[_0x7f98('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6db307b..cdb2ed5 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 _0x82d8=['INTEGER','TEXT','STRING','sequelize'];(function(_0x5c07b7,_0x589b4c){var _0xb25d55=function(_0x5f1c3b){while(--_0x5f1c3b){_0x5c07b7['push'](_0x5c07b7['shift']());}};_0xb25d55(++_0x589b4c);}(_0x82d8,0xff));var _0x882d=function(_0x2fdeaf,_0x426b20){_0x2fdeaf=_0x2fdeaf-0x0;var _0x3e8954=_0x82d8[_0x2fdeaf];return _0x3e8954;};'use strict';var Sequelize=require(_0x882d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x882d('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x882d('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x882d('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2432=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xc489d8,_0x562c9b){var _0x17dc03=function(_0x774be0){while(--_0x774be0){_0xc489d8['push'](_0xc489d8['shift']());}};_0x17dc03(++_0x562c9b);}(_0x2432,0x7a));var _0x2243=function(_0x187e30,_0x27f261){_0x187e30=_0x187e30-0x0;var _0x3f7ae2=_0x2432[_0x187e30];return _0x3f7ae2;};'use strict';var Sequelize=require(_0x2243('0x0'));module[_0x2243('0x1')]={'priority':{'type':Sequelize[_0x2243('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2243('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2243('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2243('0x3')],'defaultValue':_0x2243('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e584340..75a648c 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 _0x1cb9=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','error','stack','index','map','FaxApplication','rawAttributes','type','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x10638a,_0x484345){var _0x1471ed=function(_0x4a79ee){while(--_0x4a79ee){_0x10638a['push'](_0x10638a['shift']());}};_0x1471ed(++_0x484345);}(_0x1cb9,0x14e));var _0x91cb=function(_0x44e9e8,_0x2cd96d){_0x44e9e8=_0x44e9e8-0x0;var _0x46af1a=_0x1cb9[_0x44e9e8];return _0x46af1a;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0xcc;return function(_0x4ba2f2){if(_0x4ba2f2){return _0x3c1f56[_0x91cb('0x18')](_0x366f09);}return _0x3c1f56[_0x91cb('0x19')](_0x366f09)[_0x91cb('0x1a')]();};}function respondWithResult(_0x2c7d40,_0x4a7d45){_0x4a7d45=_0x4a7d45||0xc8;return function(_0x4cc6ef){if(_0x4cc6ef){return _0x2c7d40[_0x91cb('0x19')](_0x4a7d45)[_0x91cb('0x1b')](_0x4cc6ef);}};}function respondWithFilteredResult(_0x585470,_0x528f73){return function(_0x576369){if(_0x576369){var _0xc3629e=_0x576369[_0x91cb('0x1c')],_0x347980=_0x528f73['offset'],_0x5ea796=_0x528f73[_0x91cb('0x1d')]+_0x528f73[_0x91cb('0x1e')],_0x238f11;if(_0x5ea796>=_0xc3629e){_0x5ea796=_0xc3629e;_0x238f11=0xc8;}else{_0x238f11=0xce;}_0x585470[_0x91cb('0x19')](_0x238f11);return _0x585470[_0x91cb('0x1f')]('Content-Range',_0x347980+'-'+_0x5ea796+'/'+_0xc3629e)[_0x91cb('0x1b')](_0x576369);}return null;};}function patchUpdates(_0x7dcf60){return function(_0x4ca8e8){try{jsonpatch[_0x91cb('0x20')](_0x4ca8e8,_0x7dcf60,!![]);}catch(_0x4c9fb2){return BPromise['reject'](_0x4c9fb2);}return _0x4ca8e8[_0x91cb('0x21')]();};}function saveUpdates(_0x160ded,_0x56e409){return function(_0x51a1d5){if(_0x51a1d5){return _0x51a1d5['update'](_0x160ded)[_0x91cb('0x22')](function(_0x18827b){return _0x18827b;});}return null;};}function removeEntity(_0x20aff5,_0x1dbee2){return function(_0x5c6a15){if(_0x5c6a15){return _0x5c6a15[_0x91cb('0x23')]()[_0x91cb('0x22')](function(){_0x20aff5[_0x91cb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(!_0x2447e7){_0x26f18f[_0x91cb('0x18')](0x194);}return _0x2447e7;};}function handleError(_0x3ca500,_0x7ad361){_0x7ad361=_0x7ad361||0x1f4;return function(_0x414e60){logger[_0x91cb('0x24')](_0x414e60[_0x91cb('0x25')]);if(_0x414e60['name']){delete _0x414e60['name'];}_0x3ca500[_0x91cb('0x19')](_0x7ad361)['send'](_0x414e60);};}exports[_0x91cb('0x26')]=function(_0x34d372,_0x318031){var _0x5595c5={},_0x9b26a6={},_0x4f5a7b={'count':0x0,'rows':[]};var _0x4572f6=_[_0x91cb('0x27')](db[_0x91cb('0x28')][_0x91cb('0x29')],function(_0x468908){return{'name':_0x468908['fieldName'],'type':_0x468908[_0x91cb('0x2a')]['key']};});_0x9b26a6[_0x91cb('0x2b')]=_[_0x91cb('0x27')](_0x4572f6,_0x91cb('0x2c'));_0x9b26a6['query']=_[_0x91cb('0x2d')](_0x34d372[_0x91cb('0x2e')]);_0x9b26a6[_0x91cb('0x2f')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],_0x9b26a6[_0x91cb('0x2e')]);_0x5595c5[_0x91cb('0x31')]=_[_0x91cb('0x30')](_0x9b26a6[_0x91cb('0x2b')],qs['fields'](_0x34d372[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5595c5[_0x91cb('0x31')]=_0x5595c5[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5595c5['attributes']:_0x9b26a6[_0x91cb('0x2b')];if(!_0x34d372[_0x91cb('0x2e')][_0x91cb('0x34')](_0x91cb('0x35'))){_0x5595c5[_0x91cb('0x1e')]=qs['limit'](_0x34d372[_0x91cb('0x2e')]['limit']);_0x5595c5['offset']=qs['offset'](_0x34d372[_0x91cb('0x2e')]['offset']);}_0x5595c5[_0x91cb('0x36')]=qs['sort'](_0x34d372['query'][_0x91cb('0x37')]);_0x5595c5[_0x91cb('0x38')]=qs[_0x91cb('0x2f')](_[_0x91cb('0x39')](_0x34d372[_0x91cb('0x2e')],_0x9b26a6['filters']),_0x4572f6);if(_0x34d372[_0x91cb('0x2e')][_0x91cb('0x3a')]){_0x5595c5[_0x91cb('0x38')]=_[_0x91cb('0x3b')](_0x5595c5['where'],{'$or':_['map'](_0x4572f6,function(_0x1eed21){if(_0x1eed21[_0x91cb('0x2a')]!=='VIRTUAL'){var _0x39bd64={};_0x39bd64[_0x1eed21[_0x91cb('0x2c')]]={'$like':'%'+_0x34d372['query'][_0x91cb('0x3a')]+'%'};return _0x39bd64;}})});}_0x5595c5=_[_0x91cb('0x3b')]({},_0x5595c5,_0x34d372['options']);var _0x43d4fe={'where':_0x5595c5['where']};return db[_0x91cb('0x28')][_0x91cb('0x1c')](_0x43d4fe)[_0x91cb('0x22')](function(_0x279ad5){_0x4f5a7b[_0x91cb('0x1c')]=_0x279ad5;if(_0x34d372[_0x91cb('0x2e')]['includeAll']){_0x5595c5[_0x91cb('0x3c')]=[{'all':!![]}];}return db[_0x91cb('0x28')]['findAll'](_0x5595c5);})[_0x91cb('0x22')](function(_0x4ecbd7){_0x4f5a7b[_0x91cb('0x3d')]=_0x4ecbd7;return _0x4f5a7b;})[_0x91cb('0x22')](respondWithFilteredResult(_0x318031,_0x5595c5))[_0x91cb('0x3e')](handleError(_0x318031,null));};exports[_0x91cb('0x3f')]=function(_0x5e98c4,_0x435fff){var _0x5af0e6={'raw':!![],'where':{'id':_0x5e98c4[_0x91cb('0x40')]['id']}},_0x2cf27e={};_0x2cf27e[_0x91cb('0x2b')]=_[_0x91cb('0x2d')](db[_0x91cb('0x28')][_0x91cb('0x29')]);_0x2cf27e[_0x91cb('0x2e')]=_[_0x91cb('0x2d')](_0x5e98c4['query']);_0x2cf27e[_0x91cb('0x2f')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],_0x2cf27e['query']);_0x5af0e6[_0x91cb('0x31')]=_['intersection'](_0x2cf27e[_0x91cb('0x2b')],qs[_0x91cb('0x32')](_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x32')]));_0x5af0e6['attributes']=_0x5af0e6[_0x91cb('0x31')][_0x91cb('0x33')]?_0x5af0e6['attributes']:_0x2cf27e[_0x91cb('0x2b')];if(_0x5e98c4[_0x91cb('0x2e')][_0x91cb('0x41')]){_0x5af0e6[_0x91cb('0x3c')]=[{'all':!![]}];}_0x5af0e6=_[_0x91cb('0x3b')]({},_0x5af0e6,_0x5e98c4[_0x91cb('0x42')]);return db[_0x91cb('0x28')][_0x91cb('0x43')](_0x5af0e6)[_0x91cb('0x22')](handleEntityNotFound(_0x435fff,null))['then'](respondWithResult(_0x435fff,null))[_0x91cb('0x3e')](handleError(_0x435fff,null));};exports[_0x91cb('0x44')]=function(_0x2b7323,_0x470996){return db[_0x91cb('0x28')][_0x91cb('0x44')](_0x2b7323[_0x91cb('0x45')],{})[_0x91cb('0x22')](respondWithResult(_0x470996,0xc9))['catch'](handleError(_0x470996,null));};exports[_0x91cb('0x46')]=function(_0x46caf1,_0x2b8b7f){if(_0x46caf1[_0x91cb('0x45')]['id']){delete _0x46caf1['body']['id'];}return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x46caf1['params']['id']}})[_0x91cb('0x22')](handleEntityNotFound(_0x2b8b7f,null))['then'](saveUpdates(_0x46caf1[_0x91cb('0x45')],null))['then'](respondWithResult(_0x2b8b7f,null))['catch'](handleError(_0x2b8b7f,null));};exports['destroy']=function(_0x98245b,_0xff3d11){return db[_0x91cb('0x28')][_0x91cb('0x43')]({'where':{'id':_0x98245b[_0x91cb('0x40')]['id']}})['then'](handleEntityNotFound(_0xff3d11,null))['then'](removeEntity(_0xff3d11,null))[_0x91cb('0x3e')](handleError(_0xff3d11,null));}; \ No newline at end of file +var _0xe14b=['options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','update','then','error','stack','name','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL'];(function(_0x4b2a49,_0x27836f){var _0x158874=function(_0x1ac619){while(--_0x1ac619){_0x4b2a49['push'](_0x4b2a49['shift']());}};_0x158874(++_0x27836f);}(_0xe14b,0x93));var _0xbe14=function(_0x4bc605,_0x493389){_0x4bc605=_0x4bc605-0x0;var _0x3121f8=_0xe14b[_0x4bc605];return _0x3121f8;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];function respondWithStatusCode(_0x3d38c2,_0x27792f){_0x27792f=_0x27792f||0xcc;return function(_0x3b898d){if(_0x3b898d){return _0x3d38c2[_0xbe14('0x15')](_0x27792f);}return _0x3d38c2[_0xbe14('0x16')](_0x27792f)[_0xbe14('0x17')]();};}function respondWithResult(_0xa2cf72,_0x1e4826){_0x1e4826=_0x1e4826||0xc8;return function(_0x33fd54){if(_0x33fd54){return _0xa2cf72[_0xbe14('0x16')](_0x1e4826)['json'](_0x33fd54);}};}function respondWithFilteredResult(_0x55b3a7,_0x3f58f5){return function(_0x3dc4a9){if(_0x3dc4a9){var _0xf4ac9=_0x3dc4a9[_0xbe14('0x18')],_0x37ce4e=_0x3f58f5[_0xbe14('0x19')],_0x4e8f34=_0x3f58f5[_0xbe14('0x19')]+_0x3f58f5[_0xbe14('0x1a')],_0x21c789;if(_0x4e8f34>=_0xf4ac9){_0x4e8f34=_0xf4ac9;_0x21c789=0xc8;}else{_0x21c789=0xce;}_0x55b3a7[_0xbe14('0x16')](_0x21c789);return _0x55b3a7[_0xbe14('0x1b')]('Content-Range',_0x37ce4e+'-'+_0x4e8f34+'/'+_0xf4ac9)[_0xbe14('0x1c')](_0x3dc4a9);}return null;};}function patchUpdates(_0x456ca8){return function(_0x329588){try{jsonpatch[_0xbe14('0x1d')](_0x329588,_0x456ca8,!![]);}catch(_0x3249da){return BPromise[_0xbe14('0x1e')](_0x3249da);}return _0x329588['save']();};}function saveUpdates(_0x24f820,_0x4a1bbd){return function(_0x417c8d){if(_0x417c8d){return _0x417c8d[_0xbe14('0x1f')](_0x24f820)[_0xbe14('0x20')](function(_0x51dc0b){return _0x51dc0b;});}return null;};}function removeEntity(_0xe60f42,_0x56d845){return function(_0x3c1c85){if(_0x3c1c85){return _0x3c1c85['destroy']()[_0xbe14('0x20')](function(){_0xe60f42['status'](0xcc)[_0xbe14('0x17')]();});}};}function handleEntityNotFound(_0x3d3608,_0x505dbd){return function(_0x2da350){if(!_0x2da350){_0x3d3608['sendStatus'](0x194);}return _0x2da350;};}function handleError(_0x4587a8,_0x4851f8){_0x4851f8=_0x4851f8||0x1f4;return function(_0x36a21e){logger[_0xbe14('0x21')](_0x36a21e[_0xbe14('0x22')]);if(_0x36a21e[_0xbe14('0x23')]){delete _0x36a21e[_0xbe14('0x23')];}_0x4587a8[_0xbe14('0x16')](_0x4851f8)['send'](_0x36a21e);};}exports[_0xbe14('0x24')]=function(_0x1ba46a,_0x391556){var _0x169369={},_0x5dd475={},_0x16f884={'count':0x0,'rows':[]};var _0x29fc64=_['map'](db[_0xbe14('0x25')][_0xbe14('0x26')],function(_0x1c7cc7){return{'name':_0x1c7cc7[_0xbe14('0x27')],'type':_0x1c7cc7[_0xbe14('0x28')][_0xbe14('0x29')]};});_0x5dd475[_0xbe14('0x2a')]=_[_0xbe14('0x2b')](_0x29fc64,_0xbe14('0x23'));_0x5dd475[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](_0x1ba46a[_0xbe14('0x2c')]);_0x5dd475[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],_0x5dd475[_0xbe14('0x2c')]);_0x169369[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x5dd475[_0xbe14('0x2a')],qs[_0xbe14('0x31')](_0x1ba46a['query'][_0xbe14('0x31')]));_0x169369['attributes']=_0x169369['attributes'][_0xbe14('0x32')]?_0x169369['attributes']:_0x5dd475[_0xbe14('0x2a')];if(!_0x1ba46a[_0xbe14('0x2c')]['hasOwnProperty']('nolimit')){_0x169369['limit']=qs[_0xbe14('0x1a')](_0x1ba46a[_0xbe14('0x2c')]['limit']);_0x169369[_0xbe14('0x19')]=qs[_0xbe14('0x19')](_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x19')]);}_0x169369[_0xbe14('0x33')]=qs['sort'](_0x1ba46a['query'][_0xbe14('0x34')]);_0x169369['where']=qs['filters'](_['pick'](_0x1ba46a[_0xbe14('0x2c')],_0x5dd475[_0xbe14('0x2e')]),_0x29fc64);if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x35')]){_0x169369[_0xbe14('0x36')]=_[_0xbe14('0x37')](_0x169369[_0xbe14('0x36')],{'$or':_[_0xbe14('0x2b')](_0x29fc64,function(_0x2d9c12){if(_0x2d9c12[_0xbe14('0x28')]!==_0xbe14('0x38')){var _0x32c59d={};_0x32c59d[_0x2d9c12['name']]={'$like':'%'+_0x1ba46a['query'][_0xbe14('0x35')]+'%'};return _0x32c59d;}})});}_0x169369=_[_0xbe14('0x37')]({},_0x169369,_0x1ba46a[_0xbe14('0x39')]);var _0x520e09={'where':_0x169369[_0xbe14('0x36')]};return db[_0xbe14('0x25')][_0xbe14('0x18')](_0x520e09)[_0xbe14('0x20')](function(_0x3bd454){_0x16f884[_0xbe14('0x18')]=_0x3bd454;if(_0x1ba46a[_0xbe14('0x2c')][_0xbe14('0x3a')]){_0x169369[_0xbe14('0x3b')]=[{'all':!![]}];}return db['FaxApplication'][_0xbe14('0x3c')](_0x169369);})[_0xbe14('0x20')](function(_0x3463c4){_0x16f884[_0xbe14('0x3d')]=_0x3463c4;return _0x16f884;})[_0xbe14('0x20')](respondWithFilteredResult(_0x391556,_0x169369))[_0xbe14('0x3e')](handleError(_0x391556,null));};exports['show']=function(_0xb0f143,_0x1974a4){var _0x1220c9={'raw':!![],'where':{'id':_0xb0f143['params']['id']}},_0x36263c={};_0x36263c['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x25')][_0xbe14('0x26')]);_0x36263c['query']=_['keys'](_0xb0f143[_0xbe14('0x2c')]);_0x36263c['filters']=_['intersection'](_0x36263c[_0xbe14('0x2a')],_0x36263c[_0xbe14('0x2c')]);_0x1220c9[_0xbe14('0x30')]=_['intersection'](_0x36263c['model'],qs['fields'](_0xb0f143[_0xbe14('0x2c')][_0xbe14('0x31')]));_0x1220c9[_0xbe14('0x30')]=_0x1220c9['attributes'][_0xbe14('0x32')]?_0x1220c9[_0xbe14('0x30')]:_0x36263c[_0xbe14('0x2a')];if(_0xb0f143[_0xbe14('0x2c')]['includeAll']){_0x1220c9['include']=[{'all':!![]}];}_0x1220c9=_[_0xbe14('0x37')]({},_0x1220c9,_0xb0f143[_0xbe14('0x39')]);return db[_0xbe14('0x25')][_0xbe14('0x3f')](_0x1220c9)[_0xbe14('0x20')](handleEntityNotFound(_0x1974a4,null))['then'](respondWithResult(_0x1974a4,null))['catch'](handleError(_0x1974a4,null));};exports[_0xbe14('0x40')]=function(_0x2a3623,_0x238c60){return db[_0xbe14('0x25')]['create'](_0x2a3623[_0xbe14('0x41')],{})[_0xbe14('0x20')](respondWithResult(_0x238c60,0xc9))['catch'](handleError(_0x238c60,null));};exports[_0xbe14('0x1f')]=function(_0x2a35e5,_0x2d6ee8){if(_0x2a35e5[_0xbe14('0x41')]['id']){delete _0x2a35e5['body']['id'];}return db['FaxApplication'][_0xbe14('0x3f')]({'where':{'id':_0x2a35e5[_0xbe14('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ee8,null))['then'](saveUpdates(_0x2a35e5[_0xbe14('0x41')],null))[_0xbe14('0x20')](respondWithResult(_0x2d6ee8,null))[_0xbe14('0x3e')](handleError(_0x2d6ee8,null));};exports[_0xbe14('0x43')]=function(_0xdbc6e1,_0xd04fd5){return db[_0xbe14('0x25')]['find']({'where':{'id':_0xdbc6e1[_0xbe14('0x42')]['id']}})[_0xbe14('0x20')](handleEntityNotFound(_0xd04fd5,null))[_0xbe14('0x20')](removeEntity(_0xd04fd5,null))[_0xbe14('0x3e')](handleError(_0xd04fd5,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 729de9d..617ed3e 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 _0xa35c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa193ea,_0x490360){var _0x403c5c=function(_0x2eac9e){while(--_0x2eac9e){_0xa193ea['push'](_0xa193ea['shift']());}};_0x403c5c(++_0x490360);}(_0xa35c,0xce));var _0xca35=function(_0x38487d,_0x3011cd){_0x38487d=_0x38487d-0x0;var _0x5838d4=_0xa35c[_0x38487d];return _0x5838d4;};'use strict';var _=require(_0xca35('0x0'));var util=require(_0xca35('0x1'));var logger=require(_0xca35('0x2'))(_0xca35('0x3'));var moment=require(_0xca35('0x4'));var BPromise=require(_0xca35('0x5'));var rp=require(_0xca35('0x6'));var fs=require('fs');var path=require(_0xca35('0x7'));var rimraf=require(_0xca35('0x8'));var config=require(_0xca35('0x9'));var attributes=require(_0xca35('0xa'));module[_0xca35('0xb')]=function(_0x2a1e73,_0x2c302d){return _0x2a1e73[_0xca35('0xc')]('FaxApplication',attributes,{'tableName':_0xca35('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca35('0xe'),'collate':_0xca35('0xf')});}; \ No newline at end of file +var _0x3241=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','lodash','util','api','moment','bluebird','request-promise'];(function(_0x56e657,_0x439be6){var _0x61a99c=function(_0x431fab){while(--_0x431fab){_0x56e657['push'](_0x56e657['shift']());}};_0x61a99c(++_0x439be6);}(_0x3241,0x86));var _0x1324=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1324('0x0'));var util=require(_0x1324('0x1'));var logger=require('../../config/logger')(_0x1324('0x2'));var moment=require(_0x1324('0x3'));var BPromise=require(_0x1324('0x4'));var rp=require(_0x1324('0x5'));var fs=require('fs');var path=require(_0x1324('0x6'));var rimraf=require(_0x1324('0x7'));var config=require(_0x1324('0x8'));var attributes=require(_0x1324('0x9'));module[_0x1324('0xa')]=function(_0x52ebd2,_0x583748){return _0x52ebd2[_0x1324('0xb')]('FaxApplication',attributes,{'tableName':_0x1324('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1324('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index f3efc6c..c03aa0e 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 _0x92d3=['request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x2af009,_0x5432ee){var _0x46d15f=function(_0x26569f){while(--_0x26569f){_0x2af009['push'](_0x2af009['shift']());}};_0x46d15f(++_0x5432ee);}(_0x92d3,0x1e5));var _0x392d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x92d3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x392d('0x0'));var util=require(_0x392d('0x1'));var moment=require(_0x392d('0x2'));var BPromise=require(_0x392d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x392d('0x4'));var db=require(_0x392d('0x5'))['db'];var utils=require(_0x392d('0x6'));var logger=require(_0x392d('0x7'))(_0x392d('0x8'));var config=require('../../config/environment');var jayson=require(_0x392d('0x9'));var client=jayson['client'][_0x392d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19c149,_0x41e7c9,_0x51b228){return new BPromise(function(_0x233d3d,_0x16ca0d){return client[_0x392d('0xb')](_0x19c149,_0x51b228)[_0x392d('0xc')](function(_0x14747f){logger[_0x392d('0xd')](_0x392d('0xe'),_0x41e7c9,_0x392d('0xf'));logger[_0x392d('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x41e7c9,_0x392d('0xf'),JSON['stringify'](_0x14747f));if(_0x14747f[_0x392d('0x11')]){if(_0x14747f[_0x392d('0x11')][_0x392d('0x12')]===0x1f4){logger[_0x392d('0x11')](_0x392d('0xe'),_0x41e7c9,_0x14747f[_0x392d('0x11')][_0x392d('0x13')]);return _0x16ca0d(_0x14747f[_0x392d('0x11')][_0x392d('0x13')]);}logger[_0x392d('0x11')](_0x392d('0xe'),_0x41e7c9,_0x14747f[_0x392d('0x11')][_0x392d('0x13')]);return _0x233d3d(_0x14747f[_0x392d('0x11')]['message']);}else{logger[_0x392d('0xd')](_0x392d('0xe'),_0x41e7c9,_0x392d('0xf'));_0x233d3d(_0x14747f[_0x392d('0x14')][_0x392d('0x13')]);}})[_0x392d('0x15')](function(_0x193a9a){logger['error'](_0x392d('0xe'),_0x41e7c9,_0x193a9a);_0x16ca0d(_0x193a9a);});});}exports[_0x392d('0x16')]=function(_0x1ede17){var _0xaace1b=this;return new Promise(function(_0x5ef550,_0x5a2d02){return db[_0x392d('0x17')][_0x392d('0x18')](_0x1ede17[_0x392d('0x19')],{'raw':_0x1ede17[_0x392d('0x1a')]?_0x1ede17['options'][_0x392d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ede17[_0x392d('0x1a')]?_0x1ede17[_0x392d('0x1a')][_0x392d('0x1c')]||null:null,'attributes':_0x1ede17[_0x392d('0x1a')]?_0x1ede17[_0x392d('0x1a')]['attributes']||null:null,'limit':_0x1ede17[_0x392d('0x1a')]?_0x1ede17[_0x392d('0x1a')][_0x392d('0x1d')]||null:null})[_0x392d('0xc')](function(_0x5f56f0){logger['info'](_0x392d('0x16'),_0x1ede17);logger[_0x392d('0x10')](_0x392d('0x16'),_0x1ede17,JSON[_0x392d('0x1e')](_0x5f56f0));_0x5ef550(_0x5f56f0);})[_0x392d('0x15')](function(_0x42b80e){logger[_0x392d('0x11')](_0x392d('0x16'),_0x42b80e[_0x392d('0x13')],_0x1ede17);_0x5a2d02(_0xaace1b[_0x392d('0x11')](0x1f4,_0x42b80e[_0x392d('0x13')]));});});}; \ No newline at end of file +var _0xffb6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','limit','then','lodash','util'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xffb6,0x120));var _0x6ffb=function(_0x284897,_0x3a3f0f){_0x284897=_0x284897-0x0;var _0x108a2e=_0xffb6[_0x284897];return _0x108a2e;};'use strict';var _=require(_0x6ffb('0x0'));var util=require(_0x6ffb('0x1'));var moment=require(_0x6ffb('0x2'));var BPromise=require(_0x6ffb('0x3'));var rs=require(_0x6ffb('0x4'));var fs=require('fs');var Redis=require(_0x6ffb('0x5'));var db=require(_0x6ffb('0x6'))['db'];var utils=require(_0x6ffb('0x7'));var logger=require(_0x6ffb('0x8'))(_0x6ffb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ffb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfc3b5e,_0x3fbba0,_0x186eaf){return new BPromise(function(_0x1db05b,_0x2c06ae){return client['request'](_0xfc3b5e,_0x186eaf)['then'](function(_0x2ec0a1){logger[_0x6ffb('0xb')](_0x6ffb('0xc'),_0x3fbba0,'request\x20sent');logger[_0x6ffb('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3fbba0,_0x6ffb('0xe'),JSON[_0x6ffb('0xf')](_0x2ec0a1));if(_0x2ec0a1['error']){if(_0x2ec0a1[_0x6ffb('0x10')][_0x6ffb('0x11')]===0x1f4){logger[_0x6ffb('0x10')](_0x6ffb('0xc'),_0x3fbba0,_0x2ec0a1[_0x6ffb('0x10')]['message']);return _0x2c06ae(_0x2ec0a1[_0x6ffb('0x10')][_0x6ffb('0x12')]);}logger[_0x6ffb('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3fbba0,_0x2ec0a1[_0x6ffb('0x10')]['message']);return _0x1db05b(_0x2ec0a1['error']['message']);}else{logger[_0x6ffb('0xb')](_0x6ffb('0xc'),_0x3fbba0,_0x6ffb('0xe'));_0x1db05b(_0x2ec0a1[_0x6ffb('0x13')][_0x6ffb('0x12')]);}})[_0x6ffb('0x14')](function(_0x34222e){logger[_0x6ffb('0x10')](_0x6ffb('0xc'),_0x3fbba0,_0x34222e);_0x2c06ae(_0x34222e);});});}exports[_0x6ffb('0x15')]=function(_0x400824){var _0x26598c=this;return new Promise(function(_0x2cc01c,_0x373c76){return db[_0x6ffb('0x16')][_0x6ffb('0x17')](_0x400824['body'],{'raw':_0x400824[_0x6ffb('0x18')]?_0x400824[_0x6ffb('0x18')][_0x6ffb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x400824['options']?_0x400824[_0x6ffb('0x18')][_0x6ffb('0x1a')]||null:null,'attributes':_0x400824['options']?_0x400824[_0x6ffb('0x18')]['attributes']||null:null,'limit':_0x400824[_0x6ffb('0x18')]?_0x400824['options'][_0x6ffb('0x1b')]||null:null})[_0x6ffb('0x1c')](function(_0x37c753){logger['info'](_0x6ffb('0x15'),_0x400824);logger[_0x6ffb('0xd')]('UpdateFaxApplication',_0x400824,JSON[_0x6ffb('0xf')](_0x37c753));_0x2cc01c(_0x37c753);})[_0x6ffb('0x14')](function(_0x2df37a){logger[_0x6ffb('0x10')](_0x6ffb('0x15'),_0x2df37a['message'],_0x400824);_0x373c76(_0x26598c[_0x6ffb('0x10')](0x1f4,_0x2df37a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index acdb19c..756407a 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 _0xc4aa=['connect-timeout','express','Router','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path'];(function(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xac4a('0xc')]);router[_0xac4a('0xd')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')](_0xac4a('0xa'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);module['exports']=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','./faxApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x326f,0xd1));var _0xf326=function(_0x377f64,_0x24b0aa){_0x377f64=_0x377f64-0x0;var _0x2a0114=_0x326f[_0x377f64];return _0x2a0114;};'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/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index cf6f56d..15f28ce 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 _0x4051=['STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x4051,0x13c));var _0x1405=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4051[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x1405('0x0'));module[_0x1405('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1405('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1405('0x3')]},'fax':{'type':Sequelize[_0x1405('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1405('0x4')]('in',_0x1405('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1405('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1405('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7586=['STRING','out','ENUM','BOOLEAN','DATE'];(function(_0x19a931,_0x6a12b6){var _0x519a86=function(_0x4784d5){while(--_0x4784d5){_0x19a931['push'](_0x19a931['shift']());}};_0x519a86(++_0x6a12b6);}(_0x7586,0x8a));var _0x6758=function(_0x3bd961,_0x26f947){_0x3bd961=_0x3bd961-0x0;var _0xbeeb8e=_0x7586[_0x3bd961];return _0xbeeb8e;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6758('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6758('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6758('0x2')]},'read1stAt':{'type':Sequelize[_0x6758('0x1')]},'fax':{'type':Sequelize[_0x6758('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6758('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6758('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x6758('0x4')]('in',_0x6758('0x3')),'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 7df5ea3..6ce998f 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 _0xfff0=['ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','resolve','journey','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','catch','show','params','include','merge','describe','FaxMessage','addMessage','ids','omit','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','Tag','emit','download','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','json','count','offset','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','index','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','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?'];(function(_0x55eabe,_0x44d1ab){var _0x5df9f7=function(_0x42ffaf){while(--_0x42ffaf){_0x55eabe['push'](_0x55eabe['shift']());}};_0x5df9f7(++_0x44d1ab);}(_0xfff0,0x139));var _0x0fff=function(_0x16f589,_0x1513d6){_0x16f589=_0x16f589-0x0;var _0x3a261e=_0xfff0[_0x16f589];return _0x3a261e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fff('0x0'));var rimraf=require(_0x0fff('0x1'));var zipdir=require(_0x0fff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0fff('0x3'));var moment=require(_0x0fff('0x4'));var BPromise=require(_0x0fff('0x5'));var Mustache=require('mustache');var util=require(_0x0fff('0x6'));var path=require(_0x0fff('0x7'));var sox=require('sox');var csv=require(_0x0fff('0x8'));var ejs=require(_0x0fff('0x9'));var fs=require('fs');var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var db=require(_0x0fff('0x17'))['db'];config[_0x0fff('0x18')]=_[_0x0fff('0x19')](config['redis'],{'host':_0x0fff('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fff('0x18')]));require(_0x0fff('0x1b'))[_0x0fff('0x1c')](socket);function respondWithStatusCode(_0x2c0322,_0x55e5fa){_0x55e5fa=_0x55e5fa||0xcc;return function(_0x53bde9){if(_0x53bde9){return _0x2c0322[_0x0fff('0x1d')](_0x55e5fa);}return _0x2c0322['status'](_0x55e5fa)['end']();};}function respondWithResult(_0x51ceea,_0x1fb430){_0x1fb430=_0x1fb430||0xc8;return function(_0x41e2e7){if(_0x41e2e7){return _0x51ceea['status'](_0x1fb430)[_0x0fff('0x1e')](_0x41e2e7);}};}function respondWithFilteredResult(_0x6c24d2,_0x540a67){return function(_0x528071){if(_0x528071){var _0x48f36d=_0x528071[_0x0fff('0x1f')],_0x2337f=_0x540a67[_0x0fff('0x20')],_0x606792=_0x540a67[_0x0fff('0x20')]+_0x540a67['limit'],_0x46a02d;if(_0x606792>=_0x48f36d){_0x606792=_0x48f36d;_0x46a02d=0xc8;}else{_0x46a02d=0xce;}_0x6c24d2[_0x0fff('0x21')](_0x46a02d);return _0x6c24d2[_0x0fff('0x22')](_0x0fff('0x23'),_0x2337f+'-'+_0x606792+'/'+_0x48f36d)['json'](_0x528071);}return null;};}function patchUpdates(_0x5e27df){return function(_0x40831d){try{jsonpatch[_0x0fff('0x24')](_0x40831d,_0x5e27df,!![]);}catch(_0x1f97c5){return BPromise[_0x0fff('0x25')](_0x1f97c5);}return _0x40831d['save']();};}function saveUpdates(_0x155132,_0x2f8665){return function(_0x29d703){if(_0x29d703){return _0x29d703[_0x0fff('0x26')](_0x155132)[_0x0fff('0x27')](function(_0x17fba6){return _0x17fba6;});}return null;};}function removeEntity(_0x580b8e,_0x6a116c){return function(_0x29f702){if(_0x29f702){return _0x29f702[_0x0fff('0x28')]()[_0x0fff('0x27')](function(){_0x580b8e[_0x0fff('0x21')](0xcc)[_0x0fff('0x29')]();});}};}function handleEntityNotFound(_0x482e1e,_0x2c9725){return function(_0x87b3a6){if(!_0x87b3a6){_0x482e1e[_0x0fff('0x1d')](0x194);}return _0x87b3a6;};}function handleError(_0x440f56,_0x36d268){_0x36d268=_0x36d268||0x1f4;return function(_0x12d699){logger[_0x0fff('0x2a')](_0x12d699[_0x0fff('0x2b')]);if(_0x12d699[_0x0fff('0x2c')]){delete _0x12d699[_0x0fff('0x2c')];}_0x440f56[_0x0fff('0x21')](_0x36d268)[_0x0fff('0x2d')](_0x12d699);};}function getInteractionUsers(_0x495734,_0x7046a3){return new BPromise(function(_0x2d1800,_0x17ab6f){try{if(_0x7046a3[_0x495734['id']]){_0x495734[_0x0fff('0x2e')]=_[_0x0fff('0x2f')](_0x7046a3[_0x495734['id']],function(_0x125844){return{'id':_0x125844['id'],'fullname':_0x125844['fullname']};});}}catch(_0x31f9a4){_0x17ab6f(_0x31f9a4);}_0x2d1800(_0x495734);});}function getInteractionTags(_0xa16c29,_0x351102){return new BPromise(function(_0x48f1d1,_0x1016fa){try{if(_0xa16c29[_0x0fff('0x30')]){_0xa16c29['Tags']=[];_0xa16c29[_0x0fff('0x30')][_0x0fff('0x31')](',')[_0x0fff('0x32')](function(_0x15ae24){_0xa16c29[_0x0fff('0x33')][_0x0fff('0x34')](_0x351102[_0x15ae24]);});}delete _0xa16c29[_0x0fff('0x30')];}catch(_0x213958){_0x1016fa(_0x213958);}_0x48f1d1(_0xa16c29);});}function updateFaxInteraction(_0x3ac875,_0x3aaa62,_0x58469b){return new BPromise(function(_0x157863,_0x1c19f5){return getInteractionUsers(_0x3ac875,_0x58469b)[_0x0fff('0x27')](function(_0x1bbb9e){return getInteractionTags(_0x1bbb9e,_0x3aaa62);})[_0x0fff('0x27')](function(_0x5967dc){_0x157863(_0x5967dc);})['catch'](function(_0x316057){_0x1c19f5(_0x316057);});});}exports[_0x0fff('0x35')]=function(_0x648285,_0x30a131){var _0x5c1797={},_0x2458fb={},_0x2f5616={'count':0x0,'rows':[]};var _0x13347d=_[_0x0fff('0x2f')](db['FaxInteraction'][_0x0fff('0x36')],function(_0xfadd4f){return{'name':_0xfadd4f[_0x0fff('0x37')],'type':_0xfadd4f[_0x0fff('0x38')][_0x0fff('0x39')]};});_0x2458fb[_0x0fff('0x3a')]=_[_0x0fff('0x2f')](_0x13347d,_0x0fff('0x2c'));_0x2458fb[_0x0fff('0x3b')]=_[_0x0fff('0x3c')](_0x648285[_0x0fff('0x3b')]);_0x2458fb[_0x0fff('0x3d')]=_['intersection'](_0x2458fb[_0x0fff('0x3a')],_0x2458fb[_0x0fff('0x3b')]);_0x5c1797[_0x0fff('0x3e')]=_[_0x0fff('0x3f')](_0x2458fb[_0x0fff('0x3a')],qs[_0x0fff('0x40')](_0x648285['query'][_0x0fff('0x40')]));_0x5c1797[_0x0fff('0x3e')]=_0x5c1797[_0x0fff('0x3e')][_0x0fff('0x41')]?_0x5c1797[_0x0fff('0x3e')]:_0x2458fb[_0x0fff('0x3a')];if(!_0x648285[_0x0fff('0x3b')][_0x0fff('0x42')](_0x0fff('0x43'))){_0x5c1797['limit']=qs[_0x0fff('0x44')](_0x648285['query'][_0x0fff('0x44')]);_0x5c1797[_0x0fff('0x20')]=qs[_0x0fff('0x20')](_0x648285['query']['offset']);}_0x5c1797[_0x0fff('0x45')]=qs[_0x0fff('0x46')](_0x648285[_0x0fff('0x3b')]['sort']);_0x5c1797['where']=qs[_0x0fff('0x3d')](_['pick'](_0x648285[_0x0fff('0x3b')],_0x2458fb[_0x0fff('0x3d')]),_0x13347d);var _0x8352c1=[];var _0x309d75=squel[_0x0fff('0x47')]()[_0x0fff('0x48')]('id')['field'](_0x0fff('0x2c'))[_0x0fff('0x48')](_0x0fff('0x49'))[_0x0fff('0x4a')](_0x0fff('0x4b'));var _0xebc17b=squel[_0x0fff('0x47')]()['field'](_0x0fff('0x4c'))[_0x0fff('0x48')](_0x0fff('0x4d'))['field'](_0x0fff('0x4e'))[_0x0fff('0x4a')](_0x0fff('0x4f'),'ui')[_0x0fff('0x50')](_0x0fff('0x51'),'u',_0x0fff('0x52'));var _0x2f73cf=squel[_0x0fff('0x47')]()[_0x0fff('0x4a')](_0x0fff('0x53'),'i')[_0x0fff('0x50')]('cm_contacts','c',_0x0fff('0x54'))[_0x0fff('0x50')]('users','o',_0x0fff('0x55'))[_0x0fff('0x50')](_0x0fff('0x56'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x0fff('0x57'),'me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x0fff('0x58'),'it',_0x0fff('0x59'))[_0x0fff('0x50')](_0x0fff('0x4b'),'t',_0x0fff('0x5a'));var _0x1a7677=squel['expr']();var _0x350144=[];var _0x3ee3e3=squel[_0x0fff('0x5b')]();var _0x32568a;if(_0x648285[_0x0fff('0x3b')][_0x0fff('0x5c')]){_0x32568a=as['parseSearch'](_0x648285[_0x0fff('0x3b')][_0x0fff('0x5c')]);var _0x47f8db=_0x32568a[_0x0fff('0x5d')];for(var _0x4bae35=0x0;_0x4bae35<_0x32568a['conditions']['length'];_0x4bae35++){var _0x218e1c=_0x32568a[_0x0fff('0x5e')][_0x4bae35];var _0x15f725='i';var _0x194ed8=_[_0x0fff('0x5f')](_0x13347d,['name',_0x218e1c[_0x0fff('0x48')]]);if(!_0x194ed8){switch(_0x218e1c[_0x0fff('0x48')]){case _0x0fff('0x60'):if(_0x218e1c[_0x0fff('0x61')]==0x1){_0x2f73cf[_0x0fff('0x62')]('`'+_0x218e1c['field']+_0x0fff('0x63'));}else{_0x2f73cf[_0x0fff('0x62')]('`'+_0x218e1c[_0x0fff('0x48')]+_0x0fff('0x64'));}break;case _0x0fff('0x65'):if(_0x218e1c[_0x0fff('0x66')]===_0x0fff('0x67')){if(_0x218e1c[_0x0fff('0x61')][_0x0fff('0x31')]('\x20')[_0x0fff('0x41')]>0x1){_0x1a7677[_0x47f8db](_0x0fff('0x68'),qs[_0x0fff('0x69')](_0x218e1c[_0x0fff('0x61')]),null);}else{var _0x2608be='%'+_0x218e1c[_0x0fff('0x61')]+'%';_0x1a7677[_0x47f8db](_0x0fff('0x6a'),_0x2608be,_0x2608be,_0x2608be);}}else{_0x194ed8=_[_0x0fff('0x5f')](_0x13347d,[_0x0fff('0x2c'),_0x0fff('0x6b')]);_0x218e1c[_0x0fff('0x48')]=_0x0fff('0x6b');_0x56d5c5=as['buildExpression'](_0x15f725,_0x194ed8[_0x0fff('0x38')],_0x218e1c);_0x1a7677[_0x47f8db](_0x56d5c5[_0x0fff('0x6c')],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x6d')],_0x56d5c5['value'][_0x0fff('0x29')]);}break;case'Tag':var _0x3d6e54=_0x218e1c[_0x0fff('0x61')][_0x0fff('0x31')](',')[_0x0fff('0x2f')](function(_0x4bf865){return Number(_0x4bf865);});_0x3d6e54[_0x0fff('0x32')](function(_0x169855){_0x3ee3e3['or'](_0x0fff('0x6e'),'%,'+_0x169855+',%');});_0x350144=_[_0x0fff('0x6f')](_0x350144,_0x3d6e54);break;case'User':if(_0x218e1c['operator']===_0x0fff('0x67')){_0x1a7677[_0x47f8db](_0x0fff('0x70'),'%'+_0x218e1c[_0x0fff('0x61')]+'%',null);}else{_0x194ed8=_[_0x0fff('0x5f')](_0x13347d,[_0x0fff('0x2c'),_0x0fff('0x71')]);_0x218e1c['field']='UserId';_0x56d5c5=as[_0x0fff('0x72')](_0x15f725,_0x194ed8[_0x0fff('0x38')],_0x218e1c);_0x1a7677[_0x47f8db](_0x56d5c5[_0x0fff('0x6c')],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x6d')],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x29')]);}break;case _0x0fff('0x73'):_0x56d5c5=as['buildExpression']('me',null,_0x218e1c);_0x1a7677[_0x47f8db](_0x56d5c5[_0x0fff('0x6c')],_0x56d5c5['value'][_0x0fff('0x6d')],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x29')]);break;}}else{var _0x56d5c5=as['buildExpression'](_0x15f725,_0x194ed8[_0x0fff('0x38')],_0x218e1c);_0x1a7677[_0x47f8db](_0x56d5c5['text'],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x6d')],_0x56d5c5[_0x0fff('0x61')][_0x0fff('0x29')]);}}}else{var _0x4e3a31=_(_0x648285[_0x0fff('0x3b')])[_0x0fff('0x3c')]()['map'](function(_0x38e5d7){return _[_0x0fff('0x74')](_0x13347d,[_0x0fff('0x2c'),_0x38e5d7])?_0x38e5d7:undefined;})['compact']()[_0x0fff('0x61')]();if(!_[_0x0fff('0x75')](_0x4e3a31)){_0x4e3a31[_0x0fff('0x32')](function(_0x383d78){if(_0x383d78===_0x0fff('0x76')){_0x2f73cf[_0x0fff('0x77')](_0x0fff('0x78'),[][_0x0fff('0x79')](_0x648285[_0x0fff('0x3b')][_0x383d78]));}else if(_0x383d78===_0x0fff('0x7a')){var _0x1a5988=JSON[_0x0fff('0x7b')](_0x648285['query'][_0x383d78])['$gte'];var _0x247819=JSON['parse'](_0x648285['query'][_0x383d78])[_0x0fff('0x7c')];_0x2f73cf[_0x0fff('0x77')](_0x0fff('0x7d'),_0x1a5988,_0x247819);}else{if(_0x648285['query'][_0x383d78]==='null'){_0x2f73cf[_0x0fff('0x77')]('i.'+_0x383d78+_0x0fff('0x7e'));}else{_0x2f73cf[_0x0fff('0x77')]('i.'+_0x383d78+_0x0fff('0x7f'),_0x648285['query'][_0x383d78]);}}});}if(_0x648285[_0x0fff('0x3b')][_0x0fff('0x80')]){if(_0x648285[_0x0fff('0x3b')][_0x0fff('0x80')]==0x1){_0x2f73cf['having'](_0x0fff('0x81'));}else{_0x2f73cf[_0x0fff('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x648285['query'][_0x0fff('0x82')]){_0x350144=_[_0x0fff('0x83')](_0x648285[_0x0fff('0x3b')][_0x0fff('0x82')])?_0x648285[_0x0fff('0x3b')]['tag']:new Array(_0x648285[_0x0fff('0x3b')][_0x0fff('0x82')]);_0x350144[_0x0fff('0x32')](function(_0x2d77bd){_0x3ee3e3['or'](_0x0fff('0x6e'),'%,'+_0x2d77bd+',%');});}if(_0x648285['query']['filter']){var _0x3713a9=_0x648285['query'][_0x0fff('0x84')][_0x0fff('0x85')]('\x5c','\x5c\x5c')[_0x0fff('0x85')]('\x27\x27',_0x0fff('0x86'));if(qs[_0x0fff('0x87')](_0x3713a9)){_0x1a7677['or']('i.id\x20LIKE\x20?',_0x3713a9+'%')['or'](_0x0fff('0x88'),_0x3713a9+'%');}_0x1a7677['or'](_0x0fff('0x89'),_0x3713a9+'%');}}_0x2f73cf[_0x0fff('0x77')](_0x1a7677);_0x2f73cf[_0x0fff('0x8a')](_0x0fff('0x8b'));var _0x15ab8e={'type':db[_0x0fff('0x8c')][_0x0fff('0x8d')][_0x0fff('0x8e')],'raw':!![]};var _0xfac929=_0x2f73cf[_0x0fff('0x8f')]();_0xfac929['field'](_0x0fff('0x8b'));_0xfac929[_0x0fff('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0fff('0x60'));if(_0x5c1797['order']){_0x5c1797[_0x0fff('0x45')][_0x0fff('0x32')](function(_0x1f2314){_0x2f73cf[_0x0fff('0x45')]('i.'+_0x1f2314[0x0],_0x1f2314[0x1]===_0x0fff('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x350144)){_0x2f73cf[_0x0fff('0x62')](_0x3ee3e3);_0xfac929[_0x0fff('0x77')]('t.id\x20IN\x20?',_0x350144);}BPromise[_0x0fff('0x91')]()[_0x0fff('0x27')](function(){if(!_0x32568a){if(_0x648285[_0x0fff('0x3b')]['FaxAccountId']||_0x648285[_0x0fff('0x3b')][_0x0fff('0x92')])return;_0xfac929['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x2f73cf[_0x0fff('0x77')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}return _0x648285['user'][_0x0fff('0x93')]({'attributes':['id'],'raw':!![]})[_0x0fff('0x27')](function(_0x258df6){if(_['isEmpty'](_0x258df6)){_0xfac929['where'](_0x0fff('0x94'));_0x2f73cf['where'](_0x0fff('0x94'));}else{_0xfac929[_0x0fff('0x77')](_0x0fff('0x78'),_[_0x0fff('0x2f')](_0x258df6,'id'));_0x2f73cf[_0x0fff('0x77')](_0x0fff('0x78'),_[_0x0fff('0x2f')](_0x258df6,'id'));}});})['then'](function(){db[_0x0fff('0x95')][_0x0fff('0x3b')](_0xfac929[_0x0fff('0x96')](),_0x15ab8e)[_0x0fff('0x27')](function(_0x340048){_0x2f5616[_0x0fff('0x1f')]=_0x340048['length'];if(_0x2f5616[_0x0fff('0x1f')]===0x0)return[];return db['sequelize'][_0x0fff('0x3b')](_0x309d75[_0x0fff('0x96')](),_0x15ab8e)[_0x0fff('0x27')](function(_0x4542c2){_0x8352c1=_['keyBy'](_0x4542c2,'id');_0x15ab8e=_['merge'](_0x15ab8e,{'model':db[_0x0fff('0x97')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x648285['query'][_0x0fff('0x40')]){_0x5c1797[_0x0fff('0x3e')]['forEach'](function(_0x5b04f2){_0x2f73cf[_0x0fff('0x48')]('i.'+_0x5b04f2);});}else{_0x2f73cf[_0x0fff('0x48')](_0x0fff('0x98'),_0x0fff('0x60'));_0x2f73cf['field'](_0x0fff('0x99'),'Account.key');_0x2f73cf[_0x0fff('0x48')](_0x0fff('0x9a'),_0x0fff('0x9b'));_0x2f73cf['field']('i.*');_0x2f73cf['field'](_0x0fff('0x9c'),'Contact.firstName');_0x2f73cf[_0x0fff('0x48')](_0x0fff('0x9d'),_0x0fff('0x9e'));_0x2f73cf[_0x0fff('0x48')](_0x0fff('0x9f'),_0x0fff('0xa0'));_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa1'),_0x0fff('0xa2'));_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa3'),'Contact.mobile');_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa4'),_0x0fff('0xa5'));_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa6'),'Owner.fullname');_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa7'),'Owner.internal');_0x2f73cf[_0x0fff('0x48')](_0x0fff('0xa8'),_0x0fff('0x30'));}if(_0x5c1797[_0x0fff('0x44')])_0x2f73cf[_0x0fff('0x44')](_0x5c1797[_0x0fff('0x44')]);if(_0x5c1797[_0x0fff('0x20')])_0x2f73cf[_0x0fff('0x20')](_0x5c1797[_0x0fff('0x20')]);return db[_0x0fff('0x95')]['query'](_0x2f73cf[_0x0fff('0x96')](),_0x15ab8e);})[_0x0fff('0x27')](function(_0x2404b2){_0xebc17b[_0x0fff('0x77')](_0x0fff('0xa9'),_[_0x0fff('0x2f')](_0x2404b2,'id'));return db[_0x0fff('0x95')]['query'](_0xebc17b[_0x0fff('0x96')](),_0x15ab8e)['then'](function(_0x11eeb6){var _0x3e3166=_[_0x0fff('0xaa')](_0x11eeb6,_0x0fff('0xab'));var _0x29ed33=[];_0x2404b2['forEach'](function(_0x359653){_0x29ed33['push'](updateFaxInteraction(_0x359653,_0x8352c1,_0x3e3166));});return BPromise['all'](_0x29ed33);});});})[_0x0fff('0x27')](function(_0x173b44){_0x2f5616[_0x0fff('0xac')]=_0x173b44;return _0x2f5616;})[_0x0fff('0x27')](respondWithFilteredResult(_0x30a131,_0x5c1797));})[_0x0fff('0xad')](handleError(_0x30a131,null));};exports[_0x0fff('0xae')]=function(_0x5bc4e1,_0x50f95c){var _0x5b637e={'raw':![],'where':{'id':_0x5bc4e1[_0x0fff('0xaf')]['id']}},_0x1bd02a={};_0x1bd02a[_0x0fff('0x3a')]=_[_0x0fff('0x3c')](db[_0x0fff('0x97')][_0x0fff('0x36')]);_0x1bd02a[_0x0fff('0x3b')]=_[_0x0fff('0x3c')](_0x5bc4e1[_0x0fff('0x3b')]);_0x1bd02a[_0x0fff('0x3d')]=_[_0x0fff('0x3f')](_0x1bd02a[_0x0fff('0x3a')],_0x1bd02a[_0x0fff('0x3b')]);_0x5b637e[_0x0fff('0x3e')]=_[_0x0fff('0x3f')](_0x1bd02a[_0x0fff('0x3a')],qs[_0x0fff('0x40')](_0x5bc4e1['query'][_0x0fff('0x40')]));_0x5b637e[_0x0fff('0x3e')]=_0x5b637e[_0x0fff('0x3e')][_0x0fff('0x41')]?_0x5b637e[_0x0fff('0x3e')]:_0x1bd02a[_0x0fff('0x3a')];if(_0x5bc4e1[_0x0fff('0x3b')]['includeAll']){_0x5b637e[_0x0fff('0xb0')]=[{'all':!![]}];}_0x5b637e=_[_0x0fff('0xb1')]({},_0x5b637e,_0x5bc4e1['options']);return db[_0x0fff('0x97')]['find'](_0x5b637e)[_0x0fff('0x27')](handleEntityNotFound(_0x50f95c,null))[_0x0fff('0x27')](respondWithResult(_0x50f95c,null))['catch'](handleError(_0x50f95c,null));};exports['create']=function(_0x5613e5,_0x22da86){return db['FaxInteraction']['create'](_0x5613e5['body'],{})['then'](respondWithResult(_0x22da86,0xc9))[_0x0fff('0xad')](handleError(_0x22da86,null));};exports['update']=function(_0x1ec5e6,_0x502215){if(_0x1ec5e6[_0x0fff('0x73')]['id']){delete _0x1ec5e6['body']['id'];}return db[_0x0fff('0x97')][_0x0fff('0x5f')]({'where':{'id':_0x1ec5e6['params']['id']}})['then'](handleEntityNotFound(_0x502215,null))[_0x0fff('0x27')](saveUpdates(_0x1ec5e6[_0x0fff('0x73')],null))[_0x0fff('0x27')](respondWithResult(_0x502215,null))[_0x0fff('0xad')](handleError(_0x502215,null));};exports[_0x0fff('0x28')]=function(_0x259628,_0x2aa43a){return db['FaxInteraction'][_0x0fff('0x5f')]({'where':{'id':_0x259628[_0x0fff('0xaf')]['id']}})[_0x0fff('0x27')](handleEntityNotFound(_0x2aa43a,null))[_0x0fff('0x27')](removeEntity(_0x2aa43a,null))['catch'](handleError(_0x2aa43a,null));};exports[_0x0fff('0xb2')]=function(_0x1d1264,_0x5bf8ad){return db['FaxInteraction']['describe']()[_0x0fff('0x27')](respondWithResult(_0x5bf8ad,null))[_0x0fff('0xad')](handleError(_0x5bf8ad,null));};exports['addMessage']=function(_0x3712af,_0x30a508,_0x4ab665){return db[_0x0fff('0xb3')][_0x0fff('0x5f')]({'where':{'id':_0x3712af[_0x0fff('0xaf')]['id']}})['then'](handleEntityNotFound(_0x30a508,null))['then'](function(_0x2eeee9){if(_0x2eeee9){return _0x2eeee9[_0x0fff('0xb4')](_0x3712af['body'][_0x0fff('0xb5')],_[_0x0fff('0xb6')](_0x3712af[_0x0fff('0x73')],[_0x0fff('0xb5'),'id'])||{});}})[_0x0fff('0x27')](respondWithResult(_0x30a508,null))[_0x0fff('0xad')](handleError(_0x30a508,null));};exports[_0x0fff('0xb7')]=function(_0x1b500a,_0x327b5,_0x320c2d){var _0x10aa61={'raw':![],'where':{}};var _0xc99224={};var _0x59127e={'count':0x0,'rows':[]};return db[_0x0fff('0x97')]['findOne']({'where':{'id':_0x1b500a[_0x0fff('0xaf')]['id']}})['then'](handleEntityNotFound(_0x327b5,null))[_0x0fff('0x27')](function(_0x5336){if(_0x5336){_0xc99224[_0x0fff('0x3a')]=_[_0x0fff('0x3c')](db[_0x0fff('0xb3')][_0x0fff('0x36')]);_0xc99224['query']=_[_0x0fff('0x3c')](_0x1b500a[_0x0fff('0x3b')]);_0xc99224['filters']=_[_0x0fff('0x3f')](_0xc99224['model'],_0xc99224['query']);_0x10aa61[_0x0fff('0x3e')]=_[_0x0fff('0x3f')](_0xc99224[_0x0fff('0x3a')],qs[_0x0fff('0x40')](_0x1b500a[_0x0fff('0x3b')][_0x0fff('0x40')]));_0x10aa61['attributes']=_0x10aa61[_0x0fff('0x3e')][_0x0fff('0x41')]?_0x10aa61[_0x0fff('0x3e')]:_0xc99224[_0x0fff('0x3a')];if(!_0x1b500a[_0x0fff('0x3b')]['hasOwnProperty'](_0x0fff('0x43'))){_0x10aa61[_0x0fff('0x44')]=qs[_0x0fff('0x44')](_0x1b500a[_0x0fff('0x3b')][_0x0fff('0x44')]);_0x10aa61[_0x0fff('0x20')]=qs[_0x0fff('0x20')](_0x1b500a['query']['offset']);}_0x10aa61[_0x0fff('0x45')]=qs['sort'](_0x1b500a[_0x0fff('0x3b')]['sort']);_0x10aa61['where']=qs['filters'](_[_0x0fff('0xb8')](_0x1b500a[_0x0fff('0x3b')],_0xc99224[_0x0fff('0x3d')]));_0x10aa61[_0x0fff('0x77')][_0x0fff('0xab')]=_0x5336['id'];if(_0x1b500a['query'][_0x0fff('0x84')]){_0x10aa61[_0x0fff('0x77')]=_[_0x0fff('0xb1')](_0x10aa61[_0x0fff('0x77')],{'$or':_[_0x0fff('0x2f')](_0x10aa61[_0x0fff('0x3e')],function(_0x40c1a8){var _0x115445={};_0x115445[_0x40c1a8]={'$like':'%'+_0x1b500a['query']['filter']+'%'};return _0x115445;})});}if(_0x1b500a[_0x0fff('0x3b')][_0x0fff('0xb9')]){var _0x2c599f=_0x1b500a['query'][_0x0fff('0xb9')][_0x0fff('0x31')](',');var _0x141d89={};_0x141d89[_0x2c599f[0x0]]={'$gte':moment(_0x2c599f[0x1])['format'](_0x0fff('0xba'))};_0x10aa61[_0x0fff('0x77')]=_[_0x0fff('0xb1')](_0x10aa61[_0x0fff('0x77')],_0x141d89);}_0x10aa61=_[_0x0fff('0xb1')]({},_0x10aa61,_0x1b500a[_0x0fff('0xbb')]);return db[_0x0fff('0xb3')]['count']({'where':_0x10aa61['where']})['then'](function(_0x247b3a){_0x59127e[_0x0fff('0x1f')]=_0x247b3a;if(_0x1b500a[_0x0fff('0x3b')][_0x0fff('0xbc')]){_0x10aa61[_0x0fff('0xb0')]=[{'all':!![]}];}return db[_0x0fff('0xb3')]['findAll'](_0x10aa61);})[_0x0fff('0x27')](function(_0x2f98b6){_0x59127e[_0x0fff('0xac')]=_0x2f98b6;return _0x59127e;});}})['then'](respondWithFilteredResult(_0x327b5,_0x10aa61))['catch'](handleError(_0x327b5,null));};exports[_0x0fff('0xbd')]=function(_0x51f70b,_0x8bcb8b,_0x15ed92){return db['FaxInteraction'][_0x0fff('0x5f')]({'where':{'id':_0x51f70b[_0x0fff('0xaf')]['id']}})['then'](handleEntityNotFound(_0x8bcb8b,null))[_0x0fff('0x27')](function(_0x2497b7){if(_0x2497b7){return _0x2497b7[_0x0fff('0xbe')](_0x51f70b[_0x0fff('0x73')][_0x0fff('0xb5')],_[_0x0fff('0xb6')](_0x51f70b['body'],[_0x0fff('0xb5'),'id'])||{})['spread'](function(){return db[_0x0fff('0xbf')]['findAll']({'attributes':['id',_0x0fff('0x2c'),'color'],'where':{'id':_0x51f70b[_0x0fff('0x73')][_0x0fff('0xb5')]}});})[_0x0fff('0x27')](function(_0x55f902){socket[_0x0fff('0xc0')]('faxInteractionTags:save',{'id':Number(_0x51f70b[_0x0fff('0xaf')]['id']),'tags':_0x55f902||[]});return{'id':Number(_0x51f70b[_0x0fff('0xaf')]['id']),'tags':_0x55f902||[]};});}})[_0x0fff('0x27')](respondWithResult(_0x8bcb8b,null))['catch'](handleError(_0x8bcb8b,null));};exports['removeTags']=function(_0x4b1b2f,_0x30a237,_0x57ed16){return db['FaxInteraction'][_0x0fff('0x5f')]({'where':{'id':_0x4b1b2f[_0x0fff('0xaf')]['id']}})[_0x0fff('0x27')](handleEntityNotFound(_0x30a237,null))[_0x0fff('0x27')](function(_0x314c84){if(_0x314c84){return _0x314c84['removeTags'](_0x4b1b2f[_0x0fff('0x3b')]['ids']);}})[_0x0fff('0x27')](respondWithStatusCode(_0x30a237,null))[_0x0fff('0xad')](handleError(_0x30a237,null));};exports[_0x0fff('0xc1')]=function(_0x188b79,_0x5cbaf8){var _0x2fa9e0=moment()['unix']()[_0x0fff('0x96')]();var _0x464cef=path[_0x0fff('0xc2')](config[_0x0fff('0xc3')],_0x0fff('0xc4'),'files','tmp');var _0x8b874d=path[_0x0fff('0xc2')](config[_0x0fff('0xc3')],'server',_0x0fff('0xc5'),_0x0fff('0xc6'));var _0x153c8a=path['join'](_0x464cef,_0x2fa9e0);var _0x3a8267=util['format'](_0x0fff('0xc7'),_0x188b79[_0x0fff('0xaf')]['id'],_0x2fa9e0);var _0x3df9df=path[_0x0fff('0xc2')](_0x464cef,_0x3a8267);var _0x1fc042=[];_0x1fc042[_0x0fff('0x34')]({'model':db[_0x0fff('0xc8')],'as':_0x0fff('0xc8'),'raw':!![]});var _0x3691f1=[{'model':db[_0x0fff('0xb3')],'as':'Messages','attributes':['id',_0x0fff('0x73'),_0x0fff('0x7a')],'include':_0x1fc042}];return db[_0x0fff('0x97')][_0x0fff('0x5f')]({'where':{'id':_0x188b79[_0x0fff('0xaf')]['id']},'include':_0x3691f1})[_0x0fff('0x27')](handleEntityNotFound(_0x5cbaf8,null))['then'](function(_0x58fde1){if(_0x58fde1&&_0x58fde1[_0x0fff('0xc9')]){var _0x4f5914=_0x58fde1[_0x0fff('0xca')]({'plain':!![]});fs[_0x0fff('0xcb')](_0x153c8a);for(var _0x545191=0x0;_0x545191<_0x4f5914[_0x0fff('0xc9')]['length'];_0x545191++){var _0x1b0ff4=_0x4f5914['Messages'][_0x545191]['Attachment'];if(_0x1b0ff4){var _0x5a7c28=path['join'](_0x8b874d,_0x1b0ff4['basename']);if(fs['existsSync'](_0x5a7c28)){fs[_0x0fff('0xcc')](_0x5a7c28)[_0x0fff('0xcd')](fs[_0x0fff('0xce')](path[_0x0fff('0xc2')](_0x153c8a,_0x1b0ff4['basename'])));}}}return BPromise[_0x0fff('0x91')]()['then'](function(){return new BPromise(function(_0x1f94b2,_0x5e6692){zipdir(_0x153c8a,{'saveTo':_0x3df9df},function(_0x752a12,_0x5bed22){if(_0x752a12)return _0x5e6692(_0x752a12);return _0x1f94b2(_0x5bed22);});})['then'](function(){return new BPromise(function(_0x5a6583,_0x29b6ab){rimraf(_0x153c8a,function(_0x2f8cf0){if(_0x2f8cf0)_0x29b6ab(_0x2f8cf0);return _0x5a6583();});});})[_0x0fff('0x27')](function(){return _0x5cbaf8[_0x0fff('0xc1')](_0x3df9df,_0x3a8267,function(_0x3033eb){if(_0x3033eb){console[_0x0fff('0xcf')](_0x0fff('0xd0'),_0x3033eb);}else{fs[_0x0fff('0xd1')](_0x3df9df);}});});});}else{return _0x5cbaf8[_0x0fff('0x1d')](0xc8);}})[_0x0fff('0xad')](handleError(_0x5cbaf8,null));}; \ No newline at end of file +var _0x8eba=['path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','./faxInteraction.socket','register','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fullname','TagIds','split','push','catch','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','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?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','keys','some','compact','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','group','SELECT','clone','isEmpty','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','FaxInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','options','create','params','describe','FaxMessage','addMessage','omit','ids','getMessages','FaxInteractionId','format','include','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','request-promise','moment','bluebird','mustache'];(function(_0x2a332d,_0x3d5865){var _0x5d24c4=function(_0x255e6c){while(--_0x255e6c){_0x2a332d['push'](_0x2a332d['shift']());}};_0x5d24c4(++_0x3d5865);}(_0x8eba,0xc3));var _0xa8eb=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x8eba[_0x20a558];return _0x53d3f7;};'use strict';var pdf=require(_0xa8eb('0x0'));var emlformat=require(_0xa8eb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa8eb('0x2'));var moment=require(_0xa8eb('0x3'));var BPromise=require(_0xa8eb('0x4'));var Mustache=require(_0xa8eb('0x5'));var util=require('util');var path=require(_0xa8eb('0x6'));var sox=require(_0xa8eb('0x7'));var csv=require('to-csv');var ejs=require(_0xa8eb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa8eb('0x9'));var crypto=require(_0xa8eb('0xa'));var jsforce=require(_0xa8eb('0xb'));var deskjs=require(_0xa8eb('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa8eb('0xd'));var Papa=require(_0xa8eb('0xe'));var Redis=require('ioredis');var authService=require(_0xa8eb('0xf'));var qs=require(_0xa8eb('0x10'));var as=require(_0xa8eb('0x11'));var hardwareService=require(_0xa8eb('0x12'));var logger=require('../../config/logger')(_0xa8eb('0x13'));var utils=require('../../config/utils');var config=require(_0xa8eb('0x14'));var db=require('../../mysqldb')['db'];config[_0xa8eb('0x15')]=_[_0xa8eb('0x16')](config['redis'],{'host':_0xa8eb('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8eb('0x15')]));require(_0xa8eb('0x18'))[_0xa8eb('0x19')](socket);function respondWithStatusCode(_0x1a014a,_0x557bb0){_0x557bb0=_0x557bb0||0xcc;return function(_0x2d35c7){if(_0x2d35c7){return _0x1a014a['sendStatus'](_0x557bb0);}return _0x1a014a[_0xa8eb('0x1a')](_0x557bb0)[_0xa8eb('0x1b')]();};}function respondWithResult(_0x40ec36,_0x102a81){_0x102a81=_0x102a81||0xc8;return function(_0x538313){if(_0x538313){return _0x40ec36[_0xa8eb('0x1a')](_0x102a81)[_0xa8eb('0x1c')](_0x538313);}};}function respondWithFilteredResult(_0x1a6500,_0x249527){return function(_0x215b2d){if(_0x215b2d){var _0x57a6c6=_0x215b2d[_0xa8eb('0x1d')],_0x307bef=_0x249527[_0xa8eb('0x1e')],_0x1cb4f1=_0x249527[_0xa8eb('0x1e')]+_0x249527[_0xa8eb('0x1f')],_0x2c16a0;if(_0x1cb4f1>=_0x57a6c6){_0x1cb4f1=_0x57a6c6;_0x2c16a0=0xc8;}else{_0x2c16a0=0xce;}_0x1a6500[_0xa8eb('0x1a')](_0x2c16a0);return _0x1a6500['set']('Content-Range',_0x307bef+'-'+_0x1cb4f1+'/'+_0x57a6c6)['json'](_0x215b2d);}return null;};}function patchUpdates(_0x1f6d6d){return function(_0x3f3e49){try{jsonpatch[_0xa8eb('0x20')](_0x3f3e49,_0x1f6d6d,!![]);}catch(_0x597df0){return BPromise[_0xa8eb('0x21')](_0x597df0);}return _0x3f3e49[_0xa8eb('0x22')]();};}function saveUpdates(_0x449f76,_0x453b69){return function(_0xd0ecf){if(_0xd0ecf){return _0xd0ecf[_0xa8eb('0x23')](_0x449f76)[_0xa8eb('0x24')](function(_0x32e9ce){return _0x32e9ce;});}return null;};}function removeEntity(_0x4557fc,_0x387d49){return function(_0xf55fd4){if(_0xf55fd4){return _0xf55fd4[_0xa8eb('0x25')]()[_0xa8eb('0x24')](function(){_0x4557fc['status'](0xcc)[_0xa8eb('0x1b')]();});}};}function handleEntityNotFound(_0x1760ec,_0x130a51){return function(_0x18f65f){if(!_0x18f65f){_0x1760ec[_0xa8eb('0x26')](0x194);}return _0x18f65f;};}function handleError(_0x4aa445,_0x261248){_0x261248=_0x261248||0x1f4;return function(_0x1d4a0b){logger[_0xa8eb('0x27')](_0x1d4a0b[_0xa8eb('0x28')]);if(_0x1d4a0b[_0xa8eb('0x29')]){delete _0x1d4a0b['name'];}_0x4aa445['status'](_0x261248)[_0xa8eb('0x2a')](_0x1d4a0b);};}function getInteractionUsers(_0x3cfcf0,_0x167f29){return new BPromise(function(_0x186eb5,_0x418200){try{if(_0x167f29[_0x3cfcf0['id']]){_0x3cfcf0['Users']=_[_0xa8eb('0x2b')](_0x167f29[_0x3cfcf0['id']],function(_0x453fb5){return{'id':_0x453fb5['id'],'fullname':_0x453fb5[_0xa8eb('0x2c')]};});}}catch(_0x109433){_0x418200(_0x109433);}_0x186eb5(_0x3cfcf0);});}function getInteractionTags(_0x262304,_0x17ddcf){return new BPromise(function(_0xc1d74d,_0x5a3cec){try{if(_0x262304[_0xa8eb('0x2d')]){_0x262304['Tags']=[];_0x262304[_0xa8eb('0x2d')][_0xa8eb('0x2e')](',')['forEach'](function(_0x9fa6ce){_0x262304['Tags'][_0xa8eb('0x2f')](_0x17ddcf[_0x9fa6ce]);});}delete _0x262304[_0xa8eb('0x2d')];}catch(_0x11ff1c){_0x5a3cec(_0x11ff1c);}_0xc1d74d(_0x262304);});}function updateFaxInteraction(_0x215677,_0x532f1e,_0x3844f0){return new BPromise(function(_0x2df68f,_0xc71f34){return getInteractionUsers(_0x215677,_0x3844f0)[_0xa8eb('0x24')](function(_0x3ad0df){return getInteractionTags(_0x3ad0df,_0x532f1e);})[_0xa8eb('0x24')](function(_0x5e7106){_0x2df68f(_0x5e7106);})[_0xa8eb('0x30')](function(_0x5af9ec){_0xc71f34(_0x5af9ec);});});}exports['index']=function(_0x594923,_0xed9001){var _0x246931={},_0x3ec1ec={},_0x20b760={'count':0x0,'rows':[]};var _0x201a1e=_['map'](db['FaxInteraction'][_0xa8eb('0x31')],function(_0x181346){return{'name':_0x181346[_0xa8eb('0x32')],'type':_0x181346[_0xa8eb('0x33')][_0xa8eb('0x34')]};});_0x3ec1ec['model']=_[_0xa8eb('0x2b')](_0x201a1e,'name');_0x3ec1ec[_0xa8eb('0x35')]=_['keys'](_0x594923[_0xa8eb('0x35')]);_0x3ec1ec[_0xa8eb('0x36')]=_[_0xa8eb('0x37')](_0x3ec1ec[_0xa8eb('0x38')],_0x3ec1ec['query']);_0x246931[_0xa8eb('0x39')]=_['intersection'](_0x3ec1ec[_0xa8eb('0x38')],qs[_0xa8eb('0x3a')](_0x594923[_0xa8eb('0x35')][_0xa8eb('0x3a')]));_0x246931['attributes']=_0x246931[_0xa8eb('0x39')][_0xa8eb('0x3b')]?_0x246931['attributes']:_0x3ec1ec[_0xa8eb('0x38')];if(!_0x594923['query'][_0xa8eb('0x3c')](_0xa8eb('0x3d'))){_0x246931[_0xa8eb('0x1f')]=qs['limit'](_0x594923[_0xa8eb('0x35')]['limit']);_0x246931['offset']=qs[_0xa8eb('0x1e')](_0x594923[_0xa8eb('0x35')]['offset']);}_0x246931[_0xa8eb('0x3e')]=qs[_0xa8eb('0x3f')](_0x594923[_0xa8eb('0x35')][_0xa8eb('0x3f')]);_0x246931[_0xa8eb('0x40')]=qs[_0xa8eb('0x36')](_[_0xa8eb('0x41')](_0x594923[_0xa8eb('0x35')],_0x3ec1ec[_0xa8eb('0x36')]),_0x201a1e);var _0x4613d3=[];var _0x5bcf53=squel['select']()[_0xa8eb('0x42')]('id')[_0xa8eb('0x42')](_0xa8eb('0x29'))[_0xa8eb('0x42')](_0xa8eb('0x43'))[_0xa8eb('0x44')](_0xa8eb('0x45'));var _0x470e68=squel['select']()['field'](_0xa8eb('0x46'))[_0xa8eb('0x42')](_0xa8eb('0x47'))['field'](_0xa8eb('0x48'))[_0xa8eb('0x44')](_0xa8eb('0x49'),'ui')[_0xa8eb('0x4a')](_0xa8eb('0x4b'),'u',_0xa8eb('0x4c'));var _0xe7c7c0=squel[_0xa8eb('0x4d')]()[_0xa8eb('0x44')]('fax_interactions','i')[_0xa8eb('0x4a')]('cm_contacts','c',_0xa8eb('0x4e'))[_0xa8eb('0x4a')](_0xa8eb('0x4b'),'o','o.id\x20=\x20i.UserId')[_0xa8eb('0x4a')](_0xa8eb('0x4f'),'a',_0xa8eb('0x50'))[_0xa8eb('0x4a')](_0xa8eb('0x51'),'me',_0xa8eb('0x52'))[_0xa8eb('0x4a')](_0xa8eb('0x53'),'it',_0xa8eb('0x54'))['left_join']('tools_tags','t',_0xa8eb('0x55'));var _0x3c2aff=squel[_0xa8eb('0x56')]();var _0x1b2bb8=[];var _0x50f65c=squel['expr']();var _0x527ee0;if(_0x594923[_0xa8eb('0x35')]['search']){_0x527ee0=as[_0xa8eb('0x57')](_0x594923[_0xa8eb('0x35')][_0xa8eb('0x58')]);var _0x279a0f=_0x527ee0[_0xa8eb('0x59')];for(var _0x7e0af2=0x0;_0x7e0af2<_0x527ee0[_0xa8eb('0x5a')][_0xa8eb('0x3b')];_0x7e0af2++){var _0xd8790a=_0x527ee0[_0xa8eb('0x5a')][_0x7e0af2];var _0x80d0fc='i';var _0x2268cc=_[_0xa8eb('0x5b')](_0x201a1e,[_0xa8eb('0x29'),_0xd8790a[_0xa8eb('0x42')]]);if(!_0x2268cc){switch(_0xd8790a[_0xa8eb('0x42')]){case _0xa8eb('0x5c'):if(_0xd8790a['value']==0x1){_0xe7c7c0['having']('`'+_0xd8790a[_0xa8eb('0x42')]+'`\x20=\x200');}else{_0xe7c7c0[_0xa8eb('0x5d')]('`'+_0xd8790a['field']+_0xa8eb('0x5e'));}break;case _0xa8eb('0x5f'):if(_0xd8790a['operator']==='$substring'){if(_0xd8790a[_0xa8eb('0x60')][_0xa8eb('0x2e')]('\x20')[_0xa8eb('0x3b')]>0x1){_0x3c2aff[_0x279a0f](_0xa8eb('0x61'),qs[_0xa8eb('0x62')](_0xd8790a[_0xa8eb('0x60')]),null);}else{var _0xcda846='%'+_0xd8790a[_0xa8eb('0x60')]+'%';_0x3c2aff[_0x279a0f](_0xa8eb('0x63'),_0xcda846,_0xcda846,_0xcda846);}}else{_0x2268cc=_[_0xa8eb('0x5b')](_0x201a1e,[_0xa8eb('0x29'),_0xa8eb('0x64')]);_0xd8790a[_0xa8eb('0x42')]=_0xa8eb('0x64');_0x3786c4=as['buildExpression'](_0x80d0fc,_0x2268cc['type'],_0xd8790a);_0x3c2aff[_0x279a0f](_0x3786c4[_0xa8eb('0x65')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x66')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x1b')]);}break;case _0xa8eb('0x67'):var _0x5a2df8=_0xd8790a[_0xa8eb('0x60')][_0xa8eb('0x2e')](',')[_0xa8eb('0x2b')](function(_0x292a15){return Number(_0x292a15);});_0x5a2df8['forEach'](function(_0xcdef6a){_0x50f65c['or'](_0xa8eb('0x68'),'%,'+_0xcdef6a+',%');});_0x1b2bb8=_['union'](_0x1b2bb8,_0x5a2df8);break;case'User':if(_0xd8790a[_0xa8eb('0x69')]==='$substring'){_0x3c2aff[_0x279a0f](_0xa8eb('0x6a'),'%'+_0xd8790a['value']+'%',null);}else{_0x2268cc=_[_0xa8eb('0x5b')](_0x201a1e,['name','UserId']);_0xd8790a[_0xa8eb('0x42')]=_0xa8eb('0x6b');_0x3786c4=as[_0xa8eb('0x6c')](_0x80d0fc,_0x2268cc[_0xa8eb('0x33')],_0xd8790a);_0x3c2aff[_0x279a0f](_0x3786c4[_0xa8eb('0x65')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x66')],_0x3786c4[_0xa8eb('0x60')]['end']);}break;case _0xa8eb('0x6d'):_0x3786c4=as[_0xa8eb('0x6c')]('me',null,_0xd8790a);_0x3c2aff[_0x279a0f](_0x3786c4['text'],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x66')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x1b')]);break;}}else{var _0x3786c4=as[_0xa8eb('0x6c')](_0x80d0fc,_0x2268cc[_0xa8eb('0x33')],_0xd8790a);_0x3c2aff[_0x279a0f](_0x3786c4[_0xa8eb('0x65')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x66')],_0x3786c4[_0xa8eb('0x60')][_0xa8eb('0x1b')]);}}}else{var _0x212ddc=_(_0x594923['query'])[_0xa8eb('0x6e')]()[_0xa8eb('0x2b')](function(_0x32254e){return _[_0xa8eb('0x6f')](_0x201a1e,['name',_0x32254e])?_0x32254e:undefined;})[_0xa8eb('0x70')]()[_0xa8eb('0x60')]();if(!_['isEmpty'](_0x212ddc)){_0x212ddc[_0xa8eb('0x71')](function(_0x2b016f){if(_0x2b016f===_0xa8eb('0x72')){_0xe7c7c0[_0xa8eb('0x40')](_0xa8eb('0x73'),[]['concat'](_0x594923[_0xa8eb('0x35')][_0x2b016f]));}else if(_0x2b016f===_0xa8eb('0x74')){var _0x4b9585=JSON[_0xa8eb('0x75')](_0x594923['query'][_0x2b016f])[_0xa8eb('0x76')];var _0x4582be=JSON[_0xa8eb('0x75')](_0x594923['query'][_0x2b016f])['$lte'];_0xe7c7c0[_0xa8eb('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4b9585,_0x4582be);}else{if(_0x594923[_0xa8eb('0x35')][_0x2b016f]===_0xa8eb('0x77')){_0xe7c7c0[_0xa8eb('0x40')]('i.'+_0x2b016f+_0xa8eb('0x78'));}else{_0xe7c7c0[_0xa8eb('0x40')]('i.'+_0x2b016f+_0xa8eb('0x79'),_0x594923[_0xa8eb('0x35')][_0x2b016f]);}}});}if(_0x594923[_0xa8eb('0x35')]['read']){if(_0x594923[_0xa8eb('0x35')][_0xa8eb('0x7a')]==0x1){_0xe7c7c0['having'](_0xa8eb('0x7b'));}else{_0xe7c7c0[_0xa8eb('0x5d')](_0xa8eb('0x7c'));}}if(_0x594923[_0xa8eb('0x35')]['tag']){_0x1b2bb8=_[_0xa8eb('0x7d')](_0x594923['query']['tag'])?_0x594923[_0xa8eb('0x35')][_0xa8eb('0x7e')]:new Array(_0x594923[_0xa8eb('0x35')]['tag']);_0x1b2bb8[_0xa8eb('0x71')](function(_0x1ef45b){_0x50f65c['or'](_0xa8eb('0x68'),'%,'+_0x1ef45b+',%');});}if(_0x594923['query'][_0xa8eb('0x7f')]){var _0x193a3d=_0x594923[_0xa8eb('0x35')][_0xa8eb('0x7f')]['replace']('\x5c','\x5c\x5c')[_0xa8eb('0x80')]('\x27\x27',_0xa8eb('0x81'));if(qs['isNumeric'](_0x193a3d)){_0x3c2aff['or'](_0xa8eb('0x82'),_0x193a3d+'%')['or']('i.fax\x20LIKE\x20?',_0x193a3d+'%');}_0x3c2aff['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x193a3d+'%');}}_0xe7c7c0[_0xa8eb('0x40')](_0x3c2aff);_0xe7c7c0[_0xa8eb('0x83')]('i.id');var _0x79a545={'type':db['Sequelize']['QueryTypes'][_0xa8eb('0x84')],'raw':!![]};var _0x382da9=_0xe7c7c0[_0xa8eb('0x85')]();_0x382da9[_0xa8eb('0x42')]('i.id');_0x382da9[_0xa8eb('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa8eb('0x5c'));if(_0x246931[_0xa8eb('0x3e')]){_0x246931[_0xa8eb('0x3e')]['forEach'](function(_0x3eb373){_0xe7c7c0[_0xa8eb('0x3e')]('i.'+_0x3eb373[0x0],_0x3eb373[0x1]==='DESC'?![]:!![]);});}if(!_[_0xa8eb('0x86')](_0x1b2bb8)){_0xe7c7c0[_0xa8eb('0x5d')](_0x50f65c);_0x382da9[_0xa8eb('0x40')](_0xa8eb('0x87'),_0x1b2bb8);}BPromise[_0xa8eb('0x88')]()[_0xa8eb('0x24')](function(){if(!_0x527ee0){if(_0x594923[_0xa8eb('0x35')][_0xa8eb('0x72')]||_0x594923[_0xa8eb('0x35')][_0xa8eb('0x89')])return;_0x382da9[_0xa8eb('0x40')](_0xa8eb('0x8a'));_0xe7c7c0[_0xa8eb('0x40')](_0xa8eb('0x8a'));return;}return _0x594923[_0xa8eb('0x8b')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x5cb335){if(_[_0xa8eb('0x86')](_0x5cb335)){_0x382da9[_0xa8eb('0x40')](_0xa8eb('0x8c'));_0xe7c7c0[_0xa8eb('0x40')](_0xa8eb('0x8c'));}else{_0x382da9[_0xa8eb('0x40')](_0xa8eb('0x73'),_['map'](_0x5cb335,'id'));_0xe7c7c0[_0xa8eb('0x40')](_0xa8eb('0x73'),_[_0xa8eb('0x2b')](_0x5cb335,'id'));}});})[_0xa8eb('0x24')](function(){db[_0xa8eb('0x8d')][_0xa8eb('0x35')](_0x382da9[_0xa8eb('0x8e')](),_0x79a545)[_0xa8eb('0x24')](function(_0x4a504c){_0x20b760['count']=_0x4a504c['length'];if(_0x20b760['count']===0x0)return[];return db[_0xa8eb('0x8d')]['query'](_0x5bcf53[_0xa8eb('0x8e')](),_0x79a545)[_0xa8eb('0x24')](function(_0x5c7d4a){_0x4613d3=_['keyBy'](_0x5c7d4a,'id');_0x79a545=_[_0xa8eb('0x8f')](_0x79a545,{'model':db[_0xa8eb('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x594923[_0xa8eb('0x35')][_0xa8eb('0x3a')]){_0x246931[_0xa8eb('0x39')][_0xa8eb('0x71')](function(_0x2f5568){_0xe7c7c0['field']('i.'+_0x2f5568);});}else{_0xe7c7c0[_0xa8eb('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa8eb('0x5c'));_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x91'),'Account.key');_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x92'),_0xa8eb('0x93'));_0xe7c7c0[_0xa8eb('0x42')]('i.*');_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x94'),'Contact.firstName');_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x95'),_0xa8eb('0x96'));_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x97'),_0xa8eb('0x98'));_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x99'),_0xa8eb('0x9a'));_0xe7c7c0['field']('c.mobile',_0xa8eb('0x9b'));_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x9c'),'Contact.fax');_0xe7c7c0['field'](_0xa8eb('0x9d'),_0xa8eb('0x9e'));_0xe7c7c0[_0xa8eb('0x42')]('o.internal','Owner.internal');_0xe7c7c0[_0xa8eb('0x42')](_0xa8eb('0x9f'),_0xa8eb('0x2d'));}if(_0x246931['limit'])_0xe7c7c0[_0xa8eb('0x1f')](_0x246931[_0xa8eb('0x1f')]);if(_0x246931[_0xa8eb('0x1e')])_0xe7c7c0[_0xa8eb('0x1e')](_0x246931[_0xa8eb('0x1e')]);return db[_0xa8eb('0x8d')][_0xa8eb('0x35')](_0xe7c7c0[_0xa8eb('0x8e')](),_0x79a545);})[_0xa8eb('0x24')](function(_0x117b3d){_0x470e68[_0xa8eb('0x40')](_0xa8eb('0xa0'),_[_0xa8eb('0x2b')](_0x117b3d,'id'));return db[_0xa8eb('0x8d')][_0xa8eb('0x35')](_0x470e68['toString'](),_0x79a545)[_0xa8eb('0x24')](function(_0x3ab5d6){var _0x53fde3=_[_0xa8eb('0xa1')](_0x3ab5d6,'FaxInteractionId');var _0x353f82=[];_0x117b3d[_0xa8eb('0x71')](function(_0x6952c6){_0x353f82[_0xa8eb('0x2f')](updateFaxInteraction(_0x6952c6,_0x4613d3,_0x53fde3));});return BPromise[_0xa8eb('0xa2')](_0x353f82);});});})[_0xa8eb('0x24')](function(_0x2a5077){_0x20b760[_0xa8eb('0xa3')]=_0x2a5077;return _0x20b760;})[_0xa8eb('0x24')](respondWithFilteredResult(_0xed9001,_0x246931));})[_0xa8eb('0x30')](handleError(_0xed9001,null));};exports['show']=function(_0x1f2f37,_0x5af9d3){var _0x15119c={'raw':![],'where':{'id':_0x1f2f37['params']['id']}},_0x10ad83={};_0x10ad83[_0xa8eb('0x38')]=_['keys'](db[_0xa8eb('0x90')][_0xa8eb('0x31')]);_0x10ad83['query']=_[_0xa8eb('0x6e')](_0x1f2f37['query']);_0x10ad83[_0xa8eb('0x36')]=_['intersection'](_0x10ad83[_0xa8eb('0x38')],_0x10ad83[_0xa8eb('0x35')]);_0x15119c[_0xa8eb('0x39')]=_['intersection'](_0x10ad83[_0xa8eb('0x38')],qs['fields'](_0x1f2f37[_0xa8eb('0x35')][_0xa8eb('0x3a')]));_0x15119c[_0xa8eb('0x39')]=_0x15119c['attributes'][_0xa8eb('0x3b')]?_0x15119c[_0xa8eb('0x39')]:_0x10ad83[_0xa8eb('0x38')];if(_0x1f2f37[_0xa8eb('0x35')][_0xa8eb('0xa4')]){_0x15119c['include']=[{'all':!![]}];}_0x15119c=_[_0xa8eb('0x8f')]({},_0x15119c,_0x1f2f37[_0xa8eb('0xa5')]);return db[_0xa8eb('0x90')]['find'](_0x15119c)['then'](handleEntityNotFound(_0x5af9d3,null))[_0xa8eb('0x24')](respondWithResult(_0x5af9d3,null))[_0xa8eb('0x30')](handleError(_0x5af9d3,null));};exports[_0xa8eb('0xa6')]=function(_0x174a34,_0x19215f){return db[_0xa8eb('0x90')][_0xa8eb('0xa6')](_0x174a34['body'],{})[_0xa8eb('0x24')](respondWithResult(_0x19215f,0xc9))[_0xa8eb('0x30')](handleError(_0x19215f,null));};exports[_0xa8eb('0x23')]=function(_0x157732,_0xf25aea){if(_0x157732['body']['id']){delete _0x157732[_0xa8eb('0x6d')]['id'];}return db[_0xa8eb('0x90')][_0xa8eb('0x5b')]({'where':{'id':_0x157732[_0xa8eb('0xa7')]['id']}})[_0xa8eb('0x24')](handleEntityNotFound(_0xf25aea,null))[_0xa8eb('0x24')](saveUpdates(_0x157732['body'],null))['then'](respondWithResult(_0xf25aea,null))[_0xa8eb('0x30')](handleError(_0xf25aea,null));};exports[_0xa8eb('0x25')]=function(_0x1e738a,_0x25ea3c){return db['FaxInteraction'][_0xa8eb('0x5b')]({'where':{'id':_0x1e738a[_0xa8eb('0xa7')]['id']}})[_0xa8eb('0x24')](handleEntityNotFound(_0x25ea3c,null))[_0xa8eb('0x24')](removeEntity(_0x25ea3c,null))['catch'](handleError(_0x25ea3c,null));};exports['describe']=function(_0x3b1a2b,_0x3f3c29){return db['FaxInteraction'][_0xa8eb('0xa8')]()[_0xa8eb('0x24')](respondWithResult(_0x3f3c29,null))[_0xa8eb('0x30')](handleError(_0x3f3c29,null));};exports['addMessage']=function(_0x102b54,_0x59a424,_0x50d8e0){return db[_0xa8eb('0xa9')][_0xa8eb('0x5b')]({'where':{'id':_0x102b54[_0xa8eb('0xa7')]['id']}})[_0xa8eb('0x24')](handleEntityNotFound(_0x59a424,null))['then'](function(_0x37f37c){if(_0x37f37c){return _0x37f37c[_0xa8eb('0xaa')](_0x102b54['body']['ids'],_[_0xa8eb('0xab')](_0x102b54['body'],[_0xa8eb('0xac'),'id'])||{});}})['then'](respondWithResult(_0x59a424,null))[_0xa8eb('0x30')](handleError(_0x59a424,null));};exports[_0xa8eb('0xad')]=function(_0x85bc9,_0x7457b2,_0x294687){var _0x37fab8={'raw':![],'where':{}};var _0x3b9f87={};var _0xc3500b={'count':0x0,'rows':[]};return db[_0xa8eb('0x90')]['findOne']({'where':{'id':_0x85bc9[_0xa8eb('0xa7')]['id']}})['then'](handleEntityNotFound(_0x7457b2,null))['then'](function(_0x5a1b30){if(_0x5a1b30){_0x3b9f87[_0xa8eb('0x38')]=_[_0xa8eb('0x6e')](db[_0xa8eb('0xa9')][_0xa8eb('0x31')]);_0x3b9f87[_0xa8eb('0x35')]=_[_0xa8eb('0x6e')](_0x85bc9[_0xa8eb('0x35')]);_0x3b9f87[_0xa8eb('0x36')]=_['intersection'](_0x3b9f87[_0xa8eb('0x38')],_0x3b9f87[_0xa8eb('0x35')]);_0x37fab8[_0xa8eb('0x39')]=_[_0xa8eb('0x37')](_0x3b9f87[_0xa8eb('0x38')],qs[_0xa8eb('0x3a')](_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x3a')]));_0x37fab8[_0xa8eb('0x39')]=_0x37fab8[_0xa8eb('0x39')][_0xa8eb('0x3b')]?_0x37fab8['attributes']:_0x3b9f87[_0xa8eb('0x38')];if(!_0x85bc9['query'][_0xa8eb('0x3c')](_0xa8eb('0x3d'))){_0x37fab8['limit']=qs['limit'](_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x1f')]);_0x37fab8[_0xa8eb('0x1e')]=qs[_0xa8eb('0x1e')](_0x85bc9[_0xa8eb('0x35')]['offset']);}_0x37fab8['order']=qs['sort'](_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x3f')]);_0x37fab8[_0xa8eb('0x40')]=qs['filters'](_['pick'](_0x85bc9[_0xa8eb('0x35')],_0x3b9f87[_0xa8eb('0x36')]));_0x37fab8[_0xa8eb('0x40')][_0xa8eb('0xae')]=_0x5a1b30['id'];if(_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x7f')]){_0x37fab8[_0xa8eb('0x40')]=_[_0xa8eb('0x8f')](_0x37fab8[_0xa8eb('0x40')],{'$or':_['map'](_0x37fab8[_0xa8eb('0x39')],function(_0x37f975){var _0x1edd3d={};_0x1edd3d[_0x37f975]={'$like':'%'+_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x7f')]+'%'};return _0x1edd3d;})});}if(_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x76')]){var _0x10aad9=_0x85bc9[_0xa8eb('0x35')][_0xa8eb('0x76')][_0xa8eb('0x2e')](',');var _0x5bce2b={};_0x5bce2b[_0x10aad9[0x0]]={'$gte':moment(_0x10aad9[0x1])[_0xa8eb('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x37fab8[_0xa8eb('0x40')]=_[_0xa8eb('0x8f')](_0x37fab8[_0xa8eb('0x40')],_0x5bce2b);}_0x37fab8=_[_0xa8eb('0x8f')]({},_0x37fab8,_0x85bc9[_0xa8eb('0xa5')]);return db[_0xa8eb('0xa9')][_0xa8eb('0x1d')]({'where':_0x37fab8[_0xa8eb('0x40')]})[_0xa8eb('0x24')](function(_0x5665f1){_0xc3500b['count']=_0x5665f1;if(_0x85bc9['query']['includeAll']){_0x37fab8[_0xa8eb('0xb0')]=[{'all':!![]}];}return db[_0xa8eb('0xa9')][_0xa8eb('0xb1')](_0x37fab8);})['then'](function(_0x4a3b83){_0xc3500b[_0xa8eb('0xa3')]=_0x4a3b83;return _0xc3500b;});}})[_0xa8eb('0x24')](respondWithFilteredResult(_0x7457b2,_0x37fab8))['catch'](handleError(_0x7457b2,null));};exports[_0xa8eb('0xb2')]=function(_0xf25768,_0x1b021f,_0x4595cb){return db[_0xa8eb('0x90')][_0xa8eb('0x5b')]({'where':{'id':_0xf25768[_0xa8eb('0xa7')]['id']}})[_0xa8eb('0x24')](handleEntityNotFound(_0x1b021f,null))[_0xa8eb('0x24')](function(_0x1cd5f8){if(_0x1cd5f8){return _0x1cd5f8['setTags'](_0xf25768['body'][_0xa8eb('0xac')],_[_0xa8eb('0xab')](_0xf25768['body'],['ids','id'])||{})[_0xa8eb('0xb3')](function(){return db[_0xa8eb('0x67')][_0xa8eb('0xb1')]({'attributes':['id',_0xa8eb('0x29'),_0xa8eb('0x43')],'where':{'id':_0xf25768['body'][_0xa8eb('0xac')]}});})[_0xa8eb('0x24')](function(_0x332f6a){socket[_0xa8eb('0xb4')](_0xa8eb('0xb5'),{'id':Number(_0xf25768['params']['id']),'tags':_0x332f6a||[]});return{'id':Number(_0xf25768[_0xa8eb('0xa7')]['id']),'tags':_0x332f6a||[]};});}})[_0xa8eb('0x24')](respondWithResult(_0x1b021f,null))['catch'](handleError(_0x1b021f,null));};exports[_0xa8eb('0xb6')]=function(_0x2c9cba,_0x1683c5,_0x4442dd){return db[_0xa8eb('0x90')][_0xa8eb('0x5b')]({'where':{'id':_0x2c9cba['params']['id']}})[_0xa8eb('0x24')](handleEntityNotFound(_0x1683c5,null))[_0xa8eb('0x24')](function(_0x49c3b5){if(_0x49c3b5){return _0x49c3b5[_0xa8eb('0xb6')](_0x2c9cba[_0xa8eb('0x35')][_0xa8eb('0xac')]);}})[_0xa8eb('0x24')](respondWithStatusCode(_0x1683c5,null))[_0xa8eb('0x30')](handleError(_0x1683c5,null));};exports[_0xa8eb('0xb7')]=function(_0x444e01,_0x120dd8){var _0x32f8ab=moment()[_0xa8eb('0xb8')]()[_0xa8eb('0x8e')]();var _0xbd2cec=path[_0xa8eb('0xb9')](config[_0xa8eb('0xba')],'server',_0xa8eb('0xbb'),'tmp');var _0x1a30bb=path['join'](config[_0xa8eb('0xba')],'server',_0xa8eb('0xbb'),_0xa8eb('0xbc'));var _0x102546=path[_0xa8eb('0xb9')](_0xbd2cec,_0x32f8ab);var _0x444ba6=util['format'](_0xa8eb('0xbd'),_0x444e01['params']['id'],_0x32f8ab);var _0x45cab1=path[_0xa8eb('0xb9')](_0xbd2cec,_0x444ba6);var _0x2dd90c=[];_0x2dd90c[_0xa8eb('0x2f')]({'model':db[_0xa8eb('0xbe')],'as':_0xa8eb('0xbe'),'raw':!![]});var _0x19f7f5=[{'model':db[_0xa8eb('0xa9')],'as':'Messages','attributes':['id','body',_0xa8eb('0x74')],'include':_0x2dd90c}];return db[_0xa8eb('0x90')][_0xa8eb('0x5b')]({'where':{'id':_0x444e01['params']['id']},'include':_0x19f7f5})['then'](handleEntityNotFound(_0x120dd8,null))[_0xa8eb('0x24')](function(_0x281d80){if(_0x281d80&&_0x281d80[_0xa8eb('0xbf')]){var _0x1c6988=_0x281d80[_0xa8eb('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x102546);for(var _0x483f9c=0x0;_0x483f9c<_0x1c6988[_0xa8eb('0xbf')][_0xa8eb('0x3b')];_0x483f9c++){var _0x4aef65=_0x1c6988[_0xa8eb('0xbf')][_0x483f9c][_0xa8eb('0xbe')];if(_0x4aef65){var _0xd7b42e=path[_0xa8eb('0xb9')](_0x1a30bb,_0x4aef65[_0xa8eb('0xc1')]);if(fs[_0xa8eb('0xc2')](_0xd7b42e)){fs[_0xa8eb('0xc3')](_0xd7b42e)[_0xa8eb('0xc4')](fs[_0xa8eb('0xc5')](path['join'](_0x102546,_0x4aef65[_0xa8eb('0xc1')])));}}}return BPromise[_0xa8eb('0x88')]()['then'](function(){return new BPromise(function(_0x10b7a3,_0x15cb43){zipdir(_0x102546,{'saveTo':_0x45cab1},function(_0xd75663,_0x41ac8c){if(_0xd75663)return _0x15cb43(_0xd75663);return _0x10b7a3(_0x41ac8c);});})[_0xa8eb('0x24')](function(){return new BPromise(function(_0x2823d4,_0x4244ef){rimraf(_0x102546,function(_0x46dfe4){if(_0x46dfe4)_0x4244ef(_0x46dfe4);return _0x2823d4();});});})['then'](function(){return _0x120dd8['download'](_0x45cab1,_0x444ba6,function(_0x46c0ad){if(_0x46c0ad){console[_0xa8eb('0xc6')](_0xa8eb('0xc7'),_0x46c0ad);}else{fs[_0xa8eb('0xc8')](_0x45cab1);}});});});}else{return _0x120dd8['sendStatus'](0xc8);}})['catch'](handleError(_0x120dd8,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index cfe7358..bd1cabe 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 _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x443dda,_0x166898){var _0x29d49b=function(_0x2a027){while(--_0x2a027){_0x443dda['push'](_0x443dda['shift']());}};_0x29d49b(++_0x166898);}(_0x1261,0x144));var _0x1126=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x1261[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x5dc5cb,_0x11f12d){var _0x74b231=function(_0x5ca349){while(--_0x5ca349){_0x5dc5cb['push'](_0x5dc5cb['shift']());}};_0x74b231(++_0x11f12d);}(_0x326f,0xd1));var _0xf326=function(_0x2c4e2c,_0x3a6cb8){_0x2c4e2c=_0x2c4e2c-0x0;var _0x2ea7d4=_0x326f[_0x2c4e2c];return _0x2ea7d4;};'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 diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 65a6c6c..ea83a1d 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 _0x2709=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x3af0f2,_0x5bc727){var _0x557a6a=function(_0x153961){while(--_0x153961){_0x3af0f2['push'](_0x3af0f2['shift']());}};_0x557a6a(++_0x5bc727);}(_0x2709,0x112));var _0x9270=function(_0x151f32,_0x2c1420){_0x151f32=_0x151f32-0x0;var _0xd05b16=_0x2709[_0x151f32];return _0xd05b16;};'use strict';var _=require(_0x9270('0x0'));var util=require('util');var logger=require(_0x9270('0x1'))(_0x9270('0x2'));var moment=require(_0x9270('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9270('0x4'));var rimraf=require(_0x9270('0x5'));var config=require('../../config/environment');var attributes=require(_0x9270('0x6'));module[_0x9270('0x7')]=function(_0x25ae31,_0x57ea60){return _0x25ae31[_0x9270('0x8')](_0x9270('0x9'),attributes,{'tableName':_0x9270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39a062,_0x2a6f16,_0x22e6c7){if(_0x39a062[_0x9270('0xb')](_0x9270('0xc'))){_0x39a062[_0x9270('0xd')]=moment()['format'](_0x9270('0xe'));}_0x22e6c7(null,_0x39a062);}}});}; \ No newline at end of file +var _0x79eb=['exports','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','path','rimraf','./faxInteraction.attributes'];(function(_0x2f3b44,_0x54d1a0){var _0x2f406e=function(_0x176344){while(--_0x176344){_0x2f3b44['push'](_0x2f3b44['shift']());}};_0x2f406e(++_0x54d1a0);}(_0x79eb,0x1e8));var _0xb79e=function(_0x5c053b,_0x3159c6){_0x5c053b=_0x5c053b-0x0;var _0x1db17a=_0x79eb[_0x5c053b];return _0x1db17a;};'use strict';var _=require(_0xb79e('0x0'));var util=require('util');var logger=require(_0xb79e('0x1'))(_0xb79e('0x2'));var moment=require(_0xb79e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb79e('0x4'));var rimraf=require(_0xb79e('0x5'));var config=require('../../config/environment');var attributes=require(_0xb79e('0x6'));module[_0xb79e('0x7')]=function(_0x870f3a,_0x2822df){return _0x870f3a[_0xb79e('0x8')](_0xb79e('0x9'),attributes,{'tableName':_0xb79e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x342aa5,_0x2bdc2b,_0x32aeee){if(_0x342aa5[_0xb79e('0xb')]('closed')){_0x342aa5[_0xb79e('0xc')]=moment()[_0xb79e('0xd')](_0xb79e('0xe'));}_0x32aeee(null,_0x342aa5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2505dbb..539dc3e 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 _0xf7d2=['stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x599c44,_0x2fb16e){var _0x1d6cf6=function(_0x43f375){while(--_0x43f375){_0x599c44['push'](_0x599c44['shift']());}};_0x1d6cf6(++_0x2fb16e);}(_0xf7d2,0x172));var _0x2f7d=function(_0x279de7,_0x5ac30d){_0x279de7=_0x279de7-0x0;var _0xcc8d9b=_0xf7d2[_0x279de7];return _0xcc8d9b;};'use strict';var _=require('lodash');var util=require(_0x2f7d('0x0'));var moment=require(_0x2f7d('0x1'));var BPromise=require(_0x2f7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f7d('0x3'));var db=require(_0x2f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f7d('0x5'))('rpc');var config=require(_0x2f7d('0x6'));var jayson=require(_0x2f7d('0x7'));var client=jayson[_0x2f7d('0x8')][_0x2f7d('0x9')]({'port':0x232a});config['redis']=_[_0x2f7d('0xa')](config[_0x2f7d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2f7d('0xc'))(new Redis(config[_0x2f7d('0xb')]));require('./faxInteraction.socket')[_0x2f7d('0xd')](socket);function respondWithRpcPromise(_0x469ee6,_0x4a2d79,_0x111760){return new BPromise(function(_0x1acab9,_0x191669){return client[_0x2f7d('0xe')](_0x469ee6,_0x111760)[_0x2f7d('0xf')](function(_0x522b2f){logger[_0x2f7d('0x10')](_0x2f7d('0x11'),_0x4a2d79,_0x2f7d('0x12'));logger[_0x2f7d('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x4a2d79,_0x2f7d('0x12'),JSON[_0x2f7d('0x14')](_0x522b2f));if(_0x522b2f['error']){if(_0x522b2f[_0x2f7d('0x15')]['code']===0x1f4){logger[_0x2f7d('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x4a2d79,_0x522b2f[_0x2f7d('0x15')]['message']);return _0x191669(_0x522b2f[_0x2f7d('0x15')][_0x2f7d('0x16')]);}logger['error'](_0x2f7d('0x11'),_0x4a2d79,_0x522b2f[_0x2f7d('0x15')][_0x2f7d('0x16')]);return _0x1acab9(_0x522b2f[_0x2f7d('0x15')][_0x2f7d('0x16')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x4a2d79,_0x2f7d('0x12'));_0x1acab9(_0x522b2f['result']['message']);}})[_0x2f7d('0x17')](function(_0x14ba4c){logger[_0x2f7d('0x15')](_0x2f7d('0x11'),_0x4a2d79,_0x14ba4c);_0x191669(_0x14ba4c);});});}exports[_0x2f7d('0x18')]=function(_0x40d939){var _0x241e79=this;return new Promise(function(_0x341066,_0x5283ac){return db[_0x2f7d('0x19')]['update'](_0x40d939[_0x2f7d('0x1a')],{'raw':_0x40d939[_0x2f7d('0x1b')]?_0x40d939[_0x2f7d('0x1b')][_0x2f7d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40d939[_0x2f7d('0x1b')]?_0x40d939['options'][_0x2f7d('0x1d')]||null:null,'attributes':_0x40d939[_0x2f7d('0x1b')]?_0x40d939['options'][_0x2f7d('0x1e')]||null:null,'limit':_0x40d939[_0x2f7d('0x1b')]?_0x40d939[_0x2f7d('0x1b')][_0x2f7d('0x1f')]||null:null})[_0x2f7d('0xf')](function(_0x16eeaf){logger[_0x2f7d('0x10')](_0x2f7d('0x18'),_0x40d939);logger[_0x2f7d('0x13')](_0x2f7d('0x18'),_0x40d939,JSON[_0x2f7d('0x14')](_0x16eeaf));_0x341066(_0x16eeaf);})[_0x2f7d('0x17')](function(_0x5c53e9){logger[_0x2f7d('0x15')](_0x2f7d('0x18'),_0x5c53e9[_0x2f7d('0x16')],_0x40d939);_0x5283ac(_0x241e79['error'](0x1f4,_0x5c53e9[_0x2f7d('0x16')]));});});};exports[_0x2f7d('0x20')]=function(_0x5ca268){return new Promise(function(_0x50fdaf,_0x2d626a){return db['FaxInteraction'][_0x2f7d('0x21')]({'where':_0x5ca268[_0x2f7d('0x1b')]?_0x5ca268[_0x2f7d('0x1b')]['where']||null:null})[_0x2f7d('0xf')](function(_0x2f388c){if(_0x2f388c){return _0x2f388c[_0x2f7d('0x22')](_0x5ca268[_0x2f7d('0x1a')][_0x2f7d('0x23')],_[_0x2f7d('0x24')](_0x5ca268['body'],[_0x2f7d('0x23'),'id'])||{});}})[_0x2f7d('0x25')](function(_0x221277){logger[_0x2f7d('0x10')](_0x2f7d('0x26'),_0x5ca268);logger[_0x2f7d('0x13')]('AddTags',_0x5ca268,JSON[_0x2f7d('0x14')](_0x221277));_0x50fdaf(_0x221277);})[_0x2f7d('0x17')](function(_0x4a8193){logger[_0x2f7d('0x15')](_0x2f7d('0x26'),_0x4a8193[_0x2f7d('0x16')],_0x5ca268);_0x2d626a(_this['error'](0x1f4,_0x4a8193[_0x2f7d('0x16')]));});});}; \ No newline at end of file +var _0x41c9=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','then','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x231510,_0x207dac){var _0x364e1a=function(_0x5c900b){while(--_0x5c900b){_0x231510['push'](_0x231510['shift']());}};_0x364e1a(++_0x207dac);}(_0x41c9,0x15b));var _0x941c=function(_0x24d0a0,_0x38b28f){_0x24d0a0=_0x24d0a0-0x0;var _0x30c1c6=_0x41c9[_0x24d0a0];return _0x30c1c6;};'use strict';var _=require(_0x941c('0x0'));var util=require(_0x941c('0x1'));var moment=require(_0x941c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x941c('0x3'));var db=require(_0x941c('0x4'))['db'];var utils=require(_0x941c('0x5'));var logger=require(_0x941c('0x6'))('rpc');var config=require(_0x941c('0x7'));var jayson=require(_0x941c('0x8'));var client=jayson['client'][_0x941c('0x9')]({'port':0x232a});config[_0x941c('0xa')]=_[_0x941c('0xb')](config[_0x941c('0xa')],{'host':_0x941c('0xc'),'port':0x18eb});var socket=require(_0x941c('0xd'))(new Redis(config[_0x941c('0xa')]));require(_0x941c('0xe'))[_0x941c('0xf')](socket);function respondWithRpcPromise(_0x3adf67,_0x35de2c,_0x195c30){return new BPromise(function(_0x49a123,_0x1b855b){return client[_0x941c('0x10')](_0x3adf67,_0x195c30)['then'](function(_0x5db19a){logger[_0x941c('0x11')](_0x941c('0x12'),_0x35de2c,_0x941c('0x13'));logger[_0x941c('0x14')](_0x941c('0x15'),_0x35de2c,_0x941c('0x13'),JSON[_0x941c('0x16')](_0x5db19a));if(_0x5db19a[_0x941c('0x17')]){if(_0x5db19a[_0x941c('0x17')][_0x941c('0x18')]===0x1f4){logger[_0x941c('0x17')](_0x941c('0x12'),_0x35de2c,_0x5db19a[_0x941c('0x17')][_0x941c('0x19')]);return _0x1b855b(_0x5db19a[_0x941c('0x17')][_0x941c('0x19')]);}logger[_0x941c('0x17')](_0x941c('0x12'),_0x35de2c,_0x5db19a['error']['message']);return _0x49a123(_0x5db19a[_0x941c('0x17')][_0x941c('0x19')]);}else{logger[_0x941c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x35de2c,_0x941c('0x13'));_0x49a123(_0x5db19a[_0x941c('0x1a')][_0x941c('0x19')]);}})[_0x941c('0x1b')](function(_0x58c141){logger[_0x941c('0x17')](_0x941c('0x12'),_0x35de2c,_0x58c141);_0x1b855b(_0x58c141);});});}exports[_0x941c('0x1c')]=function(_0x18ee90){var _0x3d0579=this;return new Promise(function(_0x2d4c97,_0x25236e){return db[_0x941c('0x1d')][_0x941c('0x1e')](_0x18ee90['body'],{'raw':_0x18ee90[_0x941c('0x1f')]?_0x18ee90[_0x941c('0x1f')][_0x941c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ee90['options']?_0x18ee90['options'][_0x941c('0x21')]||null:null,'attributes':_0x18ee90[_0x941c('0x1f')]?_0x18ee90[_0x941c('0x1f')][_0x941c('0x22')]||null:null,'limit':_0x18ee90[_0x941c('0x1f')]?_0x18ee90[_0x941c('0x1f')][_0x941c('0x23')]||null:null})[_0x941c('0x24')](function(_0x2c8189){logger['info'](_0x941c('0x1c'),_0x18ee90);logger[_0x941c('0x14')](_0x941c('0x1c'),_0x18ee90,JSON[_0x941c('0x16')](_0x2c8189));_0x2d4c97(_0x2c8189);})[_0x941c('0x1b')](function(_0x3c6bc2){logger[_0x941c('0x17')](_0x941c('0x1c'),_0x3c6bc2[_0x941c('0x19')],_0x18ee90);_0x25236e(_0x3d0579[_0x941c('0x17')](0x1f4,_0x3c6bc2[_0x941c('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2e7ea4){return new Promise(function(_0x9b1bdf,_0x42095c){return db[_0x941c('0x1d')][_0x941c('0x25')]({'where':_0x2e7ea4[_0x941c('0x1f')]?_0x2e7ea4[_0x941c('0x1f')][_0x941c('0x21')]||null:null})[_0x941c('0x24')](function(_0x2fc84f){if(_0x2fc84f){return _0x2fc84f[_0x941c('0x26')](_0x2e7ea4[_0x941c('0x27')][_0x941c('0x28')],_[_0x941c('0x29')](_0x2e7ea4[_0x941c('0x27')],[_0x941c('0x28'),'id'])||{});}})[_0x941c('0x2a')](function(_0x2ec7e6){logger['info'](_0x941c('0x2b'),_0x2e7ea4);logger[_0x941c('0x14')](_0x941c('0x2b'),_0x2e7ea4,JSON['stringify'](_0x2ec7e6));_0x9b1bdf(_0x2ec7e6);})[_0x941c('0x1b')](function(_0x501fee){logger[_0x941c('0x17')](_0x941c('0x2b'),_0x501fee[_0x941c('0x19')],_0x2e7ea4);_0x42095c(_this['error'](0x1f4,_0x501fee[_0x941c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 1982232..a7f11ee 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 _0x3c18=['./faxInteraction.events','save','remove','update','removeListener','register','faxInteraction:'];(function(_0x47f23d,_0x13d2ed){var _0x1340a4=function(_0x12b177){while(--_0x12b177){_0x47f23d['push'](_0x47f23d['shift']());}};_0x1340a4(++_0x13d2ed);}(_0x3c18,0x1c7));var _0x83c1=function(_0x332e31,_0x379ec9){_0x332e31=_0x332e31-0x0;var _0x3d9408=_0x3c18[_0x332e31];return _0x3d9408;};'use strict';var FaxInteractionEvents=require(_0x83c1('0x0'));var events=[_0x83c1('0x1'),_0x83c1('0x2'),_0x83c1('0x3')];function createListener(_0xb5a9e9,_0x3afe82){return function(_0x2586c4){_0x3afe82['emit'](_0xb5a9e9,_0x2586c4);};}function removeListener(_0x409b5b,_0x47186c){return function(){FaxInteractionEvents[_0x83c1('0x4')](_0x409b5b,_0x47186c);};}exports[_0x83c1('0x5')]=function(_0x196ff5){for(var _0xf1228d=0x0,_0x469627=events['length'];_0xf1228d<_0x469627;_0xf1228d++){var _0x11a7d9=events[_0xf1228d];var _0x172c83=createListener(_0x83c1('0x6')+_0x11a7d9,_0x196ff5);FaxInteractionEvents['on'](_0x11a7d9,_0x172c83);}}; \ No newline at end of file +var _0x8d73=['remove','update','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x1035a9,_0x301969){var _0x310e4a=function(_0x2cdee7){while(--_0x2cdee7){_0x1035a9['push'](_0x1035a9['shift']());}};_0x310e4a(++_0x301969);}(_0x8d73,0x1af));var _0x38d7=function(_0x45dafe,_0x9ff797){_0x45dafe=_0x45dafe-0x0;var _0x5e7f7e=_0x8d73[_0x45dafe];return _0x5e7f7e;};'use strict';var FaxInteractionEvents=require(_0x38d7('0x0'));var events=['save',_0x38d7('0x1'),_0x38d7('0x2')];function createListener(_0x4068db,_0x200dc0){return function(_0xf92c98){_0x200dc0['emit'](_0x4068db,_0xf92c98);};}function removeListener(_0x3c79bb,_0xf1732b){return function(){FaxInteractionEvents['removeListener'](_0x3c79bb,_0xf1732b);};}exports[_0x38d7('0x3')]=function(_0x4d34d6){for(var _0x4cd943=0x0,_0x42d6f7=events[_0x38d7('0x4')];_0x4cd943<_0x42d6f7;_0x4cd943++){var _0x24c11f=events[_0x4cd943];var _0x2cd283=createListener(_0x38d7('0x5')+_0x24c11f,_0x4d34d6);FaxInteractionEvents['on'](_0x24c11f,_0x2cd283);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c01ff73..2237a60 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 _0x3361=['post','addMessage','/:id/tags','faxinteraction:addtags','addTags','tracked','fax','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','getMessages','/:id/download','download'];(function(_0x295a92,_0x7d70dc){var _0x3f5dac=function(_0x47b9e8){while(--_0x47b9e8){_0x295a92['push'](_0x295a92['shift']());}};_0x3f5dac(++_0x7d70dc);}(_0x3361,0x124));var _0x1336=function(_0x168ee5,_0x2c04e1){_0x168ee5=_0x168ee5-0x0;var _0x3a4b43=_0x3361[_0x168ee5];return _0x3a4b43;};'use strict';var multer=require(_0x1336('0x0'));var util=require(_0x1336('0x1'));var path=require(_0x1336('0x2'));var timeout=require(_0x1336('0x3'));var express=require(_0x1336('0x4'));var router=express[_0x1336('0x5')]();var auth=require(_0x1336('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1336('0x7'));var controller=require(_0x1336('0x8'));router['get']('/',auth[_0x1336('0x9')](),controller[_0x1336('0xa')]);router[_0x1336('0xb')](_0x1336('0xc'),auth[_0x1336('0x9')](),controller['describe']);router['get'](_0x1336('0xd'),auth['isAuthenticated'](),controller[_0x1336('0xe')]);router[_0x1336('0xb')]('/:id/messages',auth[_0x1336('0x9')](),controller[_0x1336('0xf')]);router[_0x1336('0xb')](_0x1336('0x10'),auth[_0x1336('0x9')](),controller[_0x1336('0x11')]);router[_0x1336('0x12')]('/',auth[_0x1336('0x9')](),controller['create']);router[_0x1336('0x12')]('/:id/messages',auth[_0x1336('0x9')](),controller[_0x1336('0x13')]);router['post'](_0x1336('0x14'),auth[_0x1336('0x9')](),interaction['tracked']('fax',_0x1336('0x15')),controller[_0x1336('0x16')]);router['put'](_0x1336('0xd'),auth[_0x1336('0x9')](),interaction[_0x1336('0x17')](_0x1336('0x18'),_0x1336('0x19')),controller[_0x1336('0x1a')]);router[_0x1336('0x1b')](_0x1336('0xd'),auth[_0x1336('0x9')](),interaction[_0x1336('0x17')](_0x1336('0x18'),'faxinteraction:destroy'),controller[_0x1336('0x1c')]);router['delete'](_0x1336('0x14'),auth[_0x1336('0x9')](),controller[_0x1336('0x1d')]);module[_0x1336('0x1e')]=router; \ No newline at end of file +var _0xecee=['faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/messages','/:id/download','download','create','post','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','update','delete'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0xecee,0x1a7));var _0xeece=function(_0x44b668,_0xebc29c){_0x44b668=_0x44b668-0x0;var _0x28e78a=_0xecee[_0x44b668];return _0x28e78a;};'use strict';var multer=require(_0xeece('0x0'));var util=require(_0xeece('0x1'));var path=require(_0xeece('0x2'));var timeout=require(_0xeece('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeece('0x4'));var config=require('../../config/environment');var controller=require(_0xeece('0x5'));router['get']('/',auth[_0xeece('0x6')](),controller[_0xeece('0x7')]);router['get'](_0xeece('0x8'),auth[_0xeece('0x6')](),controller['describe']);router[_0xeece('0x9')](_0xeece('0xa'),auth[_0xeece('0x6')](),controller[_0xeece('0xb')]);router[_0xeece('0x9')](_0xeece('0xc'),auth[_0xeece('0x6')](),controller['getMessages']);router['get'](_0xeece('0xd'),auth[_0xeece('0x6')](),controller[_0xeece('0xe')]);router['post']('/',auth[_0xeece('0x6')](),controller[_0xeece('0xf')]);router[_0xeece('0x10')]('/:id/messages',auth[_0xeece('0x6')](),controller['addMessage']);router[_0xeece('0x10')](_0xeece('0x11'),auth[_0xeece('0x6')](),interaction['tracked'](_0xeece('0x12'),_0xeece('0x13')),controller[_0xeece('0x14')]);router[_0xeece('0x15')](_0xeece('0xa'),auth['isAuthenticated'](),interaction[_0xeece('0x16')]('fax','faxinteraction:update'),controller[_0xeece('0x17')]);router[_0xeece('0x18')](_0xeece('0xa'),auth[_0xeece('0x6')](),interaction[_0xeece('0x16')](_0xeece('0x12'),_0xeece('0x19')),controller[_0xeece('0x1a')]);router[_0xeece('0x18')](_0xeece('0x11'),auth[_0xeece('0x6')](),controller[_0xeece('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index c04c45d..a778695 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 _0xf406=['BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf406,0x15a));var _0x6f40=function(_0x50972d,_0x1376a9){_0x50972d=_0x50972d-0x0;var _0x334bb8=_0xf406[_0x50972d];return _0x334bb8;};'use strict';var Sequelize=require('sequelize');module[_0x6f40('0x0')]={'body':{'type':Sequelize[_0x6f40('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6f40('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6f40('0x3')]('in',_0x6f40('0x4')),'defaultValue':_0x6f40('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6f40('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6f40('0x5')]}}; \ No newline at end of file +var _0x761e=['ENUM','out','exports','TEXT','medium','BOOLEAN'];(function(_0x26caae,_0x62a08f){var _0x1caa52=function(_0x35742e){while(--_0x35742e){_0x26caae['push'](_0x26caae['shift']());}};_0x1caa52(++_0x62a08f);}(_0x761e,0x104));var _0xe761=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x761e[_0x31e5cb];return _0x4170df;};'use strict';var Sequelize=require('sequelize');module[_0xe761('0x0')]={'body':{'type':Sequelize[_0xe761('0x1')](_0xe761('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe761('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe761('0x4')]('in','out'),'defaultValue':_0xe761('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe761('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 1abc0b0..b29f116 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 _0x36b9=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','ValidationError','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','stack','name','send','map','FaxMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','catch','body','params','destroy','describe','../../config/logger','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','fax-interactions','reject','agent','role','RejectMessage','rejectMessage','rejectmessage','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x35c287,_0x32da43){var _0x91b030=function(_0x1e2e36){while(--_0x1e2e36){_0x35c287['push'](_0x35c287['shift']());}};_0x91b030(++_0x32da43);}(_0x36b9,0x17c));var _0x936b=function(_0x862db4,_0x50b080){_0x862db4=_0x862db4-0x0;var _0x3ff95d=_0x36b9[_0x862db4];return _0x3ff95d;};'use strict';var pdf=require(_0x936b('0x0'));var emlformat=require(_0x936b('0x1'));var rimraf=require(_0x936b('0x2'));var zipdir=require(_0x936b('0x3'));var jsonpatch=require(_0x936b('0x4'));var rp=require('request-promise');var moment=require(_0x936b('0x5'));var BPromise=require(_0x936b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x936b('0x7'));var ejs=require(_0x936b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x936b('0x9'));var crypto=require(_0x936b('0xa'));var jsforce=require(_0x936b('0xb'));var deskjs=require(_0x936b('0xc'));var toCsv=require(_0x936b('0x7'));var querystring=require('querystring');var Papa=require(_0x936b('0xd'));var Redis=require(_0x936b('0xe'));var authService=require(_0x936b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x936b('0x10'));var hardwareService=require(_0x936b('0x11'));var logger=require('../../config/logger')(_0x936b('0x12'));var utils=require(_0x936b('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x936b('0x14')]=_['defaults'](config[_0x936b('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x936b('0x15'))(new Redis(config[_0x936b('0x14')]));require(_0x936b('0x16'))['register'](socket);var jayson=require(_0x936b('0x17'));var client=jayson[_0x936b('0x18')][_0x936b('0x19')]({'port':0x232c});var client9002=jayson[_0x936b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x11e5ad,_0x2c9bdf,_0x2f0254){if(_0x2f0254){var _0x2f5169=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f5169['test'](_0x2c9bdf)){return _0x11e5ad;}else{throw new db['Sequelize'][(_0x936b('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 _0x11e5ad;}}function respondWithRpcPromise(_0x19dd95,_0x4f915,_0x4fd4d3,_0xfdb779){return new BPromise(function(_0x3acea0,_0x442c1a){var _0x2a69c7=_0xfdb779||client;return _0x2a69c7['request'](_0x19dd95,_0x4fd4d3)[_0x936b('0x1b')](function(_0x481b8d){logger['info'](_0x936b('0x1c'),_0x4f915,'request\x20sent');logger[_0x936b('0x1d')](_0x936b('0x1e'),_0x4f915,_0x936b('0x1f'),JSON['stringify'](_0x481b8d));if(_0x481b8d[_0x936b('0x20')]){if(_0x481b8d[_0x936b('0x20')][_0x936b('0x21')]===0x1f4){logger[_0x936b('0x20')](_0x936b('0x1c'),_0x4f915,_0x481b8d['error'][_0x936b('0x22')]);return _0x442c1a(_0x481b8d[_0x936b('0x20')][_0x936b('0x22')]);}logger[_0x936b('0x20')]('FaxMessage,\x20%s,\x20%s',_0x4f915,_0x481b8d[_0x936b('0x20')][_0x936b('0x22')]);return _0x3acea0(_0x481b8d[_0x936b('0x20')][_0x936b('0x22')]);}else{logger[_0x936b('0x23')](_0x936b('0x1c'),_0x4f915,'request\x20sent');_0x3acea0(_0x481b8d[_0x936b('0x24')][_0x936b('0x22')]);}})['catch'](function(_0x54521a){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4f915,_0x54521a);_0x442c1a(_0x54521a);});});}function respondWithStatusCode(_0x827b8,_0x2fa19e){_0x2fa19e=_0x2fa19e||0xcc;return function(_0x1ab8a0){if(_0x1ab8a0){return _0x827b8[_0x936b('0x25')](_0x2fa19e);}return _0x827b8[_0x936b('0x26')](_0x2fa19e)[_0x936b('0x27')]();};}function respondWithResult(_0x2485e4,_0x72f4b4){_0x72f4b4=_0x72f4b4||0xc8;return function(_0x5b8e0e){if(_0x5b8e0e){return _0x2485e4[_0x936b('0x26')](_0x72f4b4)['json'](_0x5b8e0e);}};}function respondWithFilteredResult(_0x15856c,_0x3b953f){return function(_0x5a5e3c){if(_0x5a5e3c){var _0x23419a=_0x5a5e3c[_0x936b('0x28')],_0x2eaf80=_0x3b953f[_0x936b('0x29')],_0x36942f=_0x3b953f[_0x936b('0x29')]+_0x3b953f['limit'],_0x5efe62;if(_0x36942f>=_0x23419a){_0x36942f=_0x23419a;_0x5efe62=0xc8;}else{_0x5efe62=0xce;}_0x15856c[_0x936b('0x26')](_0x5efe62);return _0x15856c[_0x936b('0x2a')](_0x936b('0x2b'),_0x2eaf80+'-'+_0x36942f+'/'+_0x23419a)[_0x936b('0x2c')](_0x5a5e3c);}return null;};}function patchUpdates(_0x5d996d){return function(_0x14bf23){try{jsonpatch[_0x936b('0x2d')](_0x14bf23,_0x5d996d,!![]);}catch(_0x3f0006){return BPromise['reject'](_0x3f0006);}return _0x14bf23[_0x936b('0x2e')]();};}function saveUpdates(_0x31daf5,_0x2f641b){return function(_0x51fd04){if(_0x51fd04){return _0x51fd04[_0x936b('0x2f')](_0x31daf5)['then'](function(_0x42ecb7){return _0x42ecb7;});}return null;};}function removeEntity(_0x277d81,_0x5a0ea0){return function(_0x3353dd){if(_0x3353dd){return _0x3353dd['destroy']()[_0x936b('0x1b')](function(){_0x277d81[_0x936b('0x26')](0xcc)[_0x936b('0x27')]();});}};}function handleEntityNotFound(_0x143528,_0x21784c){return function(_0x2cd2a5){if(!_0x2cd2a5){_0x143528[_0x936b('0x25')](0x194);}return _0x2cd2a5;};}function handleError(_0x49cdc6,_0x16d123){_0x16d123=_0x16d123||0x1f4;return function(_0x1143e1){logger[_0x936b('0x20')](_0x1143e1[_0x936b('0x30')]);if(_0x1143e1[_0x936b('0x31')]){delete _0x1143e1['name'];}_0x49cdc6[_0x936b('0x26')](_0x16d123)[_0x936b('0x32')](_0x1143e1);};}exports['index']=function(_0x10a607,_0x2c17c5){var _0x410e9e={},_0x344292={},_0x57d40b={'count':0x0,'rows':[]};var _0x14981c=_[_0x936b('0x33')](db[_0x936b('0x34')][_0x936b('0x35')],function(_0x3b8e5e){return{'name':_0x3b8e5e['fieldName'],'type':_0x3b8e5e[_0x936b('0x36')][_0x936b('0x37')]};});_0x344292[_0x936b('0x38')]=_[_0x936b('0x33')](_0x14981c,_0x936b('0x31'));_0x344292[_0x936b('0x39')]=_[_0x936b('0x3a')](_0x10a607['query']);_0x344292['filters']=_[_0x936b('0x3b')](_0x344292['model'],_0x344292[_0x936b('0x39')]);_0x410e9e[_0x936b('0x3c')]=_[_0x936b('0x3b')](_0x344292[_0x936b('0x38')],qs[_0x936b('0x3d')](_0x10a607[_0x936b('0x39')][_0x936b('0x3d')]));_0x410e9e[_0x936b('0x3c')]=_0x410e9e[_0x936b('0x3c')][_0x936b('0x3e')]?_0x410e9e[_0x936b('0x3c')]:_0x344292[_0x936b('0x38')];if(!_0x10a607[_0x936b('0x39')][_0x936b('0x3f')](_0x936b('0x40'))){_0x410e9e[_0x936b('0x41')]=qs[_0x936b('0x41')](_0x10a607[_0x936b('0x39')]['limit']);_0x410e9e[_0x936b('0x29')]=qs[_0x936b('0x29')](_0x10a607[_0x936b('0x39')][_0x936b('0x29')]);}_0x410e9e[_0x936b('0x42')]=qs[_0x936b('0x43')](_0x10a607[_0x936b('0x39')]['sort']);_0x410e9e[_0x936b('0x44')]=qs[_0x936b('0x45')](_[_0x936b('0x46')](_0x10a607[_0x936b('0x39')],_0x344292[_0x936b('0x45')]),_0x14981c);if(_0x10a607['query']['filter']){_0x410e9e[_0x936b('0x44')]=_[_0x936b('0x47')](_0x410e9e['where'],{'$or':_['map'](_0x14981c,function(_0x12e0aa){if(_0x12e0aa[_0x936b('0x36')]!==_0x936b('0x48')){var _0x2600d0={};_0x2600d0[_0x12e0aa['name']]={'$like':'%'+_0x10a607[_0x936b('0x39')][_0x936b('0x49')]+'%'};return _0x2600d0;}})});}_0x410e9e=_[_0x936b('0x47')]({},_0x410e9e,_0x10a607[_0x936b('0x4a')]);var _0x1951e6={'where':_0x410e9e[_0x936b('0x44')]};return db[_0x936b('0x34')][_0x936b('0x28')](_0x1951e6)[_0x936b('0x1b')](function(_0x1e390e){_0x57d40b[_0x936b('0x28')]=_0x1e390e;if(_0x10a607[_0x936b('0x39')][_0x936b('0x4b')]){_0x410e9e[_0x936b('0x4c')]=[{'all':!![]}];}return db[_0x936b('0x34')][_0x936b('0x4d')](_0x410e9e);})[_0x936b('0x1b')](function(_0x1dab2e){_0x57d40b[_0x936b('0x4e')]=_0x1dab2e;return _0x57d40b;})[_0x936b('0x1b')](respondWithFilteredResult(_0x2c17c5,_0x410e9e))['catch'](handleError(_0x2c17c5,null));};exports['show']=function(_0x3e7772,_0x15c323){var _0x14b2d6={'raw':!![],'where':{'id':_0x3e7772['params']['id']}},_0x276bd5={};_0x276bd5[_0x936b('0x38')]=_['keys'](db['FaxMessage'][_0x936b('0x35')]);_0x276bd5[_0x936b('0x39')]=_['keys'](_0x3e7772[_0x936b('0x39')]);_0x276bd5[_0x936b('0x45')]=_[_0x936b('0x3b')](_0x276bd5[_0x936b('0x38')],_0x276bd5['query']);_0x14b2d6[_0x936b('0x3c')]=_['intersection'](_0x276bd5[_0x936b('0x38')],qs[_0x936b('0x3d')](_0x3e7772[_0x936b('0x39')][_0x936b('0x3d')]));_0x14b2d6[_0x936b('0x3c')]=_0x14b2d6[_0x936b('0x3c')][_0x936b('0x3e')]?_0x14b2d6[_0x936b('0x3c')]:_0x276bd5[_0x936b('0x38')];if(_0x3e7772['query'][_0x936b('0x4b')]){_0x14b2d6[_0x936b('0x4c')]=[{'all':!![]}];}_0x14b2d6=_[_0x936b('0x47')]({},_0x14b2d6,_0x3e7772[_0x936b('0x4a')]);return db[_0x936b('0x34')][_0x936b('0x4f')](_0x14b2d6)[_0x936b('0x1b')](handleEntityNotFound(_0x15c323,null))[_0x936b('0x1b')](respondWithResult(_0x15c323,null))[_0x936b('0x50')](handleError(_0x15c323,null));};exports[_0x936b('0x2f')]=function(_0x218f0e,_0x249369){if(_0x218f0e[_0x936b('0x51')]['id']){delete _0x218f0e[_0x936b('0x51')]['id'];}return db[_0x936b('0x34')][_0x936b('0x4f')]({'where':{'id':_0x218f0e[_0x936b('0x52')]['id']}})[_0x936b('0x1b')](handleEntityNotFound(_0x249369,null))[_0x936b('0x1b')](saveUpdates(_0x218f0e[_0x936b('0x51')],null))[_0x936b('0x1b')](respondWithResult(_0x249369,null))['catch'](handleError(_0x249369,null));};exports[_0x936b('0x53')]=function(_0x52adff,_0x4f7eca){return db[_0x936b('0x34')][_0x936b('0x4f')]({'where':{'id':_0x52adff[_0x936b('0x52')]['id']}})[_0x936b('0x1b')](handleEntityNotFound(_0x4f7eca,null))[_0x936b('0x1b')](removeEntity(_0x4f7eca,null))[_0x936b('0x50')](handleError(_0x4f7eca,null));};exports[_0x936b('0x54')]=function(_0x35497c,_0xde4029){return db['FaxMessage'][_0x936b('0x54')]()[_0x936b('0x1b')](respondWithResult(_0xde4029,null))['catch'](handleError(_0xde4029,null));};var interaction_log=require(_0x936b('0x55'))('fax-interactions');exports[_0x936b('0x56')]=function(_0x491b06,_0x195670,_0x4b04e2){var _0x4fa1f4={'channel':_0x936b('0x57')};if(_0x491b06[_0x936b('0x51')]['id']){delete _0x491b06[_0x936b('0x51')]['id'];}_0x491b06['body'][_0x936b('0x58')]=!![];_0x491b06[_0x936b('0x51')]['readAt']=moment()[_0x936b('0x59')](_0x936b('0x5a'));_0x491b06[_0x936b('0x51')]['UserId']=_0x491b06[_0x936b('0x51')][_0x936b('0x5b')]||_0x491b06[_0x936b('0x5c')]['id'];return db[_0x936b('0x34')][_0x936b('0x4f')]({'where':{'id':_0x491b06[_0x936b('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x936b('0x5d')],'as':_0x936b('0x5e')}]})['then'](handleEntityNotFound(_0x195670,null))['then'](saveUpdates(_0x491b06[_0x936b('0x51')],null))[_0x936b('0x1b')](function(_0x1a153d){if(_0x1a153d){_0x4fa1f4['message']=_0x1a153d['get']({'plain':!![]});return db[_0x936b('0x5f')][_0x936b('0x4f')]({'where':{'id':_0x1a153d[_0x936b('0x60')]}});}return null;})[_0x936b('0x1b')](handleEntityNotFound(_0x195670,null))[_0x936b('0x1b')](function(_0x46b99b){if(_0x46b99b){return _0x46b99b[_0x936b('0x2f')]({'UserId':_0x491b06[_0x936b('0x51')][_0x936b('0x5b')],'read1stAt':_[_0x936b('0x61')](_0x46b99b[_0x936b('0x62')])?moment()[_0x936b('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x936b('0x1b')](function(_0x42507a){if(_0x42507a){_0x4fa1f4['interaction']=_0x42507a[_0x936b('0x63')]({'plain':!![]});interaction_log[_0x936b('0x23')](_0x936b('0x64'),_0x491b06[_0x936b('0x5c')]['id'],_0x491b06[_0x936b('0x5c')][_0x936b('0x31')],_0x491b06[_0x936b('0x5c')]['role'],_0x4fa1f4[_0x936b('0x65')]['id'],_0x491b06['body']?JSON[_0x936b('0x66')](_0x491b06['body']):_0x936b('0x67'));return respondWithRpcPromise(_0x936b('0x68'),_0x936b('0x69'),_0x4fa1f4);}return null;})[_0x936b('0x1b')](function(_0x1273e6){if(_0x1273e6){if(_0x491b06[_0x936b('0x51')][_0x936b('0x6a')]){_0x4fa1f4['message'][_0x936b('0x6b')]=util[_0x936b('0x59')](_0x936b('0x6c'),_0x491b06[_0x936b('0x5c')][_0x936b('0x31')]);_0x4fa1f4['message'][_0x936b('0x6d')]=_0x4fa1f4['channel'];_0x4fa1f4[_0x936b('0x22')]['event']=_0x936b('0x56');return respondWithRpcPromise(_0x936b('0x6e'),_0x936b('0x6e'),{'event':'acceptmessage','message':_0x4fa1f4[_0x936b('0x22')]},client9002)['then'](function(){return _0x4fa1f4;});}return _0x4fa1f4;}return null;})[_0x936b('0x1b')](respondWithResult(_0x195670,null))['catch'](handleError(_0x195670,null));};var interaction_log=require(_0x936b('0x55'))(_0x936b('0x6f'));exports[_0x936b('0x70')]=function(_0x2d3692,_0x2513e3,_0x1fb2b0){var _0xccb105={'agent':{},'channel':_0x936b('0x57')};if(_0x2d3692[_0x936b('0x51')]['id']){delete _0x2d3692['body']['id'];}_0x2d3692['body'][_0x936b('0x5b')]=_0x2d3692[_0x936b('0x51')]['UserId']||_0x2d3692[_0x936b('0x5c')]['id'];_0xccb105[_0x936b('0x71')]['id']=_0x2d3692['body'][_0x936b('0x5b')];return db[_0x936b('0x34')][_0x936b('0x4f')]({'where':{'id':_0x2d3692['params']['id'],'UserId':null}})[_0x936b('0x1b')](handleEntityNotFound(_0x2513e3,null))[_0x936b('0x1b')](function(_0x5813b5){if(_0x5813b5){_0xccb105[_0x936b('0x22')]=_0x5813b5['get']({'plain':!![]});return db[_0x936b('0x5f')][_0x936b('0x4f')]({'where':{'id':_0x5813b5[_0x936b('0x60')]}});}return null;})[_0x936b('0x1b')](handleEntityNotFound(_0x2513e3,null))[_0x936b('0x1b')](function(_0x4807ac){if(_0x4807ac){_0xccb105[_0x936b('0x65')]=_0x4807ac[_0x936b('0x63')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d3692[_0x936b('0x5c')]['id'],_0x2d3692[_0x936b('0x5c')][_0x936b('0x31')],_0x2d3692[_0x936b('0x5c')][_0x936b('0x72')],_0xccb105['interaction']['id'],_0x2d3692[_0x936b('0x51')]?JSON[_0x936b('0x66')](_0x2d3692[_0x936b('0x51')]):_0x936b('0x67'));return respondWithRpcPromise(_0x936b('0x73'),_0x936b('0x74'),_0xccb105);}return null;})[_0x936b('0x1b')](function(_0x120562){if(_0x120562){_0x120562[_0x936b('0x22')]['interface']=util[_0x936b('0x59')](_0x936b('0x6c'),_0x2d3692[_0x936b('0x5c')][_0x936b('0x31')]);_0x120562[_0x936b('0x22')][_0x936b('0x6d')]=_0xccb105[_0x936b('0x6d')];_0x120562[_0x936b('0x22')]['event']=_0x936b('0x70');respondWithRpcPromise(_0x936b('0x6e'),_0x936b('0x6e'),{'event':_0x936b('0x75'),'message':_0x120562['message']},client9002);return _0xccb105;}return null;})[_0x936b('0x1b')](respondWithResult(_0x2513e3,null))[_0x936b('0x50')](handleError(_0x2513e3,null));};exports[_0x936b('0x76')]=function(_0xc2d7bc,_0x16f8e2){var _0x205bc2;return db[_0x936b('0x34')][_0x936b('0x76')](_0xc2d7bc['body'],{})['then'](function(_0x16e234){_0x205bc2=_0x16e234;return db[_0x936b('0x5d')][_0x936b('0x77')]({'where':{'id':_0x205bc2['ContactId']}});})[_0x936b('0x1b')](function(_0x1e1de5){if(_[_0x936b('0x61')](_0x1e1de5)){return;}else{_0x205bc2[_0x936b('0x57')]=_0x1e1de5['fax'];return db[_0x936b('0x78')][_0x936b('0x77')]({'where':{'id':_0x205bc2['AttachmentId']}});}})['then'](function(_0x331fd5){return respondWithRpcPromise(_0x936b('0x79'),_0x936b('0x79'),{'FaxAccountId':_[_0x936b('0x61')](_0xc2d7bc[_0x936b('0x51')])?undefined:_0xc2d7bc[_0x936b('0x51')][_0x936b('0x7a')],'path':_[_0x936b('0x61')](_0x331fd5)?undefined:util['format'](_0x936b('0x7b'),_0x331fd5[_0x936b('0x7c')]),'fax':_['isNil'](_0x205bc2[_0x936b('0x57')])?undefined:_0x205bc2[_0x936b('0x57')],'AttachmentId':_0x205bc2[_0x936b('0x7d')]},client9002);})[_0x936b('0x1b')](respondWithResult(_0x16f8e2,0xc9))[_0x936b('0x50')](handleError(_0x16f8e2,null));};exports[_0x936b('0x7e')]=function(_0xbe129b,_0x5cd703){var _0x443fdd=path[_0x936b('0x7f')](config[_0x936b('0x80')],_0x936b('0x81'),_0x936b('0x82'),'attachments');return db[_0x936b('0x34')][_0x936b('0x4f')]({'where':{'id':_0xbe129b[_0x936b('0x52')]['id']},'include':[{'model':db[_0x936b('0x78')],'as':'Attachment'}]})[_0x936b('0x1b')](handleEntityNotFound(_0x5cd703,null))['then'](function(_0x128dde){if(_0x128dde){return _0x5cd703[_0x936b('0x7e')](path[_0x936b('0x7f')](_0x443fdd,_0x128dde[_0x936b('0x78')][_0x936b('0x7c')]));}})[_0x936b('0x50')](handleError(_0x5cd703,null));}; \ No newline at end of file +var _0x1614=['nolimit','limit','where','filter','merge','include','FaxMessage','findAll','rows','catch','show','params','includeAll','options','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','agent','null','rejectMessage','interface','event','rejectmessage','create','CmContact','findOne','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','join','server','files','attachments','download','html-pdf','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','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','info','request\x20sent','debug','stringify','error','message','FaxMessage,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','length'];(function(_0x1a7431,_0x3ee90){var _0xf745d0=function(_0x328260){while(--_0x328260){_0x1a7431['push'](_0x1a7431['shift']());}};_0xf745d0(++_0x3ee90);}(_0x1614,0xc4));var _0x4161=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x1614[_0x4bfac3];return _0x15f0f2;};'use strict';var pdf=require(_0x4161('0x0'));var emlformat=require(_0x4161('0x1'));var rimraf=require(_0x4161('0x2'));var zipdir=require(_0x4161('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4161('0x4'));var moment=require(_0x4161('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4161('0x6'));var util=require(_0x4161('0x7'));var path=require(_0x4161('0x8'));var sox=require(_0x4161('0x9'));var csv=require(_0x4161('0xa'));var ejs=require(_0x4161('0xb'));var fs=require('fs');var _=require(_0x4161('0xc'));var squel=require(_0x4161('0xd'));var crypto=require(_0x4161('0xe'));var jsforce=require(_0x4161('0xf'));var deskjs=require(_0x4161('0x10'));var toCsv=require(_0x4161('0xa'));var querystring=require(_0x4161('0x11'));var Papa=require('papaparse');var Redis=require(_0x4161('0x12'));var authService=require(_0x4161('0x13'));var qs=require(_0x4161('0x14'));var as=require(_0x4161('0x15'));var hardwareService=require(_0x4161('0x16'));var logger=require(_0x4161('0x17'))(_0x4161('0x18'));var utils=require(_0x4161('0x19'));var config=require(_0x4161('0x1a'));var db=require(_0x4161('0x1b'))['db'];config[_0x4161('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4161('0x1d'))(new Redis(config[_0x4161('0x1c')]));require('./faxMessage.socket')[_0x4161('0x1e')](socket);var jayson=require(_0x4161('0x1f'));var client=jayson[_0x4161('0x20')][_0x4161('0x21')]({'port':0x232c});var client9002=jayson[_0x4161('0x20')][_0x4161('0x21')]({'port':0x232a});function checkPasswordPattern(_0x4cf54e,_0x22443c,_0x25c24e){if(_0x25c24e){var _0x1d6ebf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d6ebf[_0x4161('0x22')](_0x22443c)){return _0x4cf54e;}else{throw new db[(_0x4161('0x23'))][(_0x4161('0x24'))](_0x4161('0x25'));}}else{return _0x4cf54e;}}function respondWithRpcPromise(_0x597b0b,_0x17d334,_0x6c79f4,_0x34ac10){return new BPromise(function(_0x38f44f,_0xc47d64){var _0x122ab=_0x34ac10||client;return _0x122ab[_0x4161('0x26')](_0x597b0b,_0x6c79f4)['then'](function(_0x4ca186){logger[_0x4161('0x27')]('FaxMessage,\x20%s,\x20%s',_0x17d334,_0x4161('0x28'));logger[_0x4161('0x29')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x17d334,_0x4161('0x28'),JSON[_0x4161('0x2a')](_0x4ca186));if(_0x4ca186[_0x4161('0x2b')]){if(_0x4ca186['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x17d334,_0x4ca186['error'][_0x4161('0x2c')]);return _0xc47d64(_0x4ca186[_0x4161('0x2b')][_0x4161('0x2c')]);}logger['error'](_0x4161('0x2d'),_0x17d334,_0x4ca186['error']['message']);return _0x38f44f(_0x4ca186['error'][_0x4161('0x2c')]);}else{logger[_0x4161('0x27')](_0x4161('0x2d'),_0x17d334,'request\x20sent');_0x38f44f(_0x4ca186[_0x4161('0x2e')][_0x4161('0x2c')]);}})['catch'](function(_0x1109cd){logger['error'](_0x4161('0x2d'),_0x17d334,_0x1109cd);_0xc47d64(_0x1109cd);});});}function respondWithStatusCode(_0xf29ac5,_0x318d2a){_0x318d2a=_0x318d2a||0xcc;return function(_0x252e29){if(_0x252e29){return _0xf29ac5[_0x4161('0x2f')](_0x318d2a);}return _0xf29ac5[_0x4161('0x30')](_0x318d2a)[_0x4161('0x31')]();};}function respondWithResult(_0x3ecdc6,_0x948c64){_0x948c64=_0x948c64||0xc8;return function(_0x4ad4f1){if(_0x4ad4f1){return _0x3ecdc6['status'](_0x948c64)[_0x4161('0x32')](_0x4ad4f1);}};}function respondWithFilteredResult(_0x341eb4,_0x5c0919){return function(_0x449c00){if(_0x449c00){var _0x48ff47=_0x449c00[_0x4161('0x33')],_0x70252e=_0x5c0919[_0x4161('0x34')],_0x9fd5d=_0x5c0919[_0x4161('0x34')]+_0x5c0919['limit'],_0x596c88;if(_0x9fd5d>=_0x48ff47){_0x9fd5d=_0x48ff47;_0x596c88=0xc8;}else{_0x596c88=0xce;}_0x341eb4['status'](_0x596c88);return _0x341eb4['set'](_0x4161('0x35'),_0x70252e+'-'+_0x9fd5d+'/'+_0x48ff47)[_0x4161('0x32')](_0x449c00);}return null;};}function patchUpdates(_0x2677e3){return function(_0x21d868){try{jsonpatch[_0x4161('0x36')](_0x21d868,_0x2677e3,!![]);}catch(_0x544e5f){return BPromise[_0x4161('0x37')](_0x544e5f);}return _0x21d868[_0x4161('0x38')]();};}function saveUpdates(_0x4621d5,_0x3e9a1c){return function(_0x4a2758){if(_0x4a2758){return _0x4a2758[_0x4161('0x39')](_0x4621d5)[_0x4161('0x3a')](function(_0x4fad6e){return _0x4fad6e;});}return null;};}function removeEntity(_0x3de73a,_0x289c49){return function(_0x2711b8){if(_0x2711b8){return _0x2711b8['destroy']()[_0x4161('0x3a')](function(){_0x3de73a[_0x4161('0x30')](0xcc)[_0x4161('0x31')]();});}};}function handleEntityNotFound(_0x5e22e4,_0xd3922c){return function(_0x56f670){if(!_0x56f670){_0x5e22e4[_0x4161('0x2f')](0x194);}return _0x56f670;};}function handleError(_0x2a3d54,_0x37c0d2){_0x37c0d2=_0x37c0d2||0x1f4;return function(_0x34076a){logger[_0x4161('0x2b')](_0x34076a[_0x4161('0x3b')]);if(_0x34076a[_0x4161('0x3c')]){delete _0x34076a['name'];}_0x2a3d54[_0x4161('0x30')](_0x37c0d2)[_0x4161('0x3d')](_0x34076a);};}exports[_0x4161('0x3e')]=function(_0x48fa62,_0x4083ff){var _0x12bf7c={},_0x1b9d52={},_0x21fbdf={'count':0x0,'rows':[]};var _0x2e34f9=_[_0x4161('0x3f')](db['FaxMessage'][_0x4161('0x40')],function(_0x4c3711){return{'name':_0x4c3711['fieldName'],'type':_0x4c3711[_0x4161('0x41')]['key']};});_0x1b9d52['model']=_['map'](_0x2e34f9,'name');_0x1b9d52['query']=_[_0x4161('0x42')](_0x48fa62['query']);_0x1b9d52[_0x4161('0x43')]=_[_0x4161('0x44')](_0x1b9d52[_0x4161('0x45')],_0x1b9d52[_0x4161('0x46')]);_0x12bf7c[_0x4161('0x47')]=_[_0x4161('0x44')](_0x1b9d52['model'],qs[_0x4161('0x48')](_0x48fa62['query'][_0x4161('0x48')]));_0x12bf7c[_0x4161('0x47')]=_0x12bf7c[_0x4161('0x47')][_0x4161('0x49')]?_0x12bf7c[_0x4161('0x47')]:_0x1b9d52[_0x4161('0x45')];if(!_0x48fa62[_0x4161('0x46')]['hasOwnProperty'](_0x4161('0x4a'))){_0x12bf7c[_0x4161('0x4b')]=qs['limit'](_0x48fa62[_0x4161('0x46')][_0x4161('0x4b')]);_0x12bf7c['offset']=qs[_0x4161('0x34')](_0x48fa62[_0x4161('0x46')][_0x4161('0x34')]);}_0x12bf7c['order']=qs['sort'](_0x48fa62[_0x4161('0x46')]['sort']);_0x12bf7c[_0x4161('0x4c')]=qs[_0x4161('0x43')](_['pick'](_0x48fa62[_0x4161('0x46')],_0x1b9d52['filters']),_0x2e34f9);if(_0x48fa62['query'][_0x4161('0x4d')]){_0x12bf7c[_0x4161('0x4c')]=_[_0x4161('0x4e')](_0x12bf7c['where'],{'$or':_[_0x4161('0x3f')](_0x2e34f9,function(_0x77b239){if(_0x77b239[_0x4161('0x41')]!=='VIRTUAL'){var _0x4dc964={};_0x4dc964[_0x77b239['name']]={'$like':'%'+_0x48fa62[_0x4161('0x46')][_0x4161('0x4d')]+'%'};return _0x4dc964;}})});}_0x12bf7c=_['merge']({},_0x12bf7c,_0x48fa62['options']);var _0x3844a0={'where':_0x12bf7c[_0x4161('0x4c')]};return db['FaxMessage'][_0x4161('0x33')](_0x3844a0)['then'](function(_0x2bef65){_0x21fbdf[_0x4161('0x33')]=_0x2bef65;if(_0x48fa62[_0x4161('0x46')]['includeAll']){_0x12bf7c[_0x4161('0x4f')]=[{'all':!![]}];}return db[_0x4161('0x50')][_0x4161('0x51')](_0x12bf7c);})['then'](function(_0x27708c){_0x21fbdf[_0x4161('0x52')]=_0x27708c;return _0x21fbdf;})['then'](respondWithFilteredResult(_0x4083ff,_0x12bf7c))[_0x4161('0x53')](handleError(_0x4083ff,null));};exports[_0x4161('0x54')]=function(_0x5805c5,_0x27da2d){var _0x3b7b68={'raw':!![],'where':{'id':_0x5805c5[_0x4161('0x55')]['id']}},_0x44f269={};_0x44f269[_0x4161('0x45')]=_['keys'](db[_0x4161('0x50')]['rawAttributes']);_0x44f269[_0x4161('0x46')]=_[_0x4161('0x42')](_0x5805c5[_0x4161('0x46')]);_0x44f269[_0x4161('0x43')]=_[_0x4161('0x44')](_0x44f269[_0x4161('0x45')],_0x44f269[_0x4161('0x46')]);_0x3b7b68[_0x4161('0x47')]=_[_0x4161('0x44')](_0x44f269[_0x4161('0x45')],qs[_0x4161('0x48')](_0x5805c5[_0x4161('0x46')]['fields']));_0x3b7b68['attributes']=_0x3b7b68['attributes'][_0x4161('0x49')]?_0x3b7b68[_0x4161('0x47')]:_0x44f269[_0x4161('0x45')];if(_0x5805c5[_0x4161('0x46')][_0x4161('0x56')]){_0x3b7b68['include']=[{'all':!![]}];}_0x3b7b68=_[_0x4161('0x4e')]({},_0x3b7b68,_0x5805c5[_0x4161('0x57')]);return db[_0x4161('0x50')][_0x4161('0x58')](_0x3b7b68)[_0x4161('0x3a')](handleEntityNotFound(_0x27da2d,null))['then'](respondWithResult(_0x27da2d,null))['catch'](handleError(_0x27da2d,null));};exports[_0x4161('0x39')]=function(_0x40b6c1,_0xeab925){if(_0x40b6c1['body']['id']){delete _0x40b6c1[_0x4161('0x59')]['id'];}return db['FaxMessage'][_0x4161('0x58')]({'where':{'id':_0x40b6c1[_0x4161('0x55')]['id']}})[_0x4161('0x3a')](handleEntityNotFound(_0xeab925,null))[_0x4161('0x3a')](saveUpdates(_0x40b6c1['body'],null))['then'](respondWithResult(_0xeab925,null))[_0x4161('0x53')](handleError(_0xeab925,null));};exports[_0x4161('0x5a')]=function(_0x31a162,_0x56ce88){return db['FaxMessage'][_0x4161('0x58')]({'where':{'id':_0x31a162[_0x4161('0x55')]['id']}})[_0x4161('0x3a')](handleEntityNotFound(_0x56ce88,null))['then'](removeEntity(_0x56ce88,null))[_0x4161('0x53')](handleError(_0x56ce88,null));};exports[_0x4161('0x5b')]=function(_0x25e4fc,_0x5b1387){return db[_0x4161('0x50')][_0x4161('0x5b')]()[_0x4161('0x3a')](respondWithResult(_0x5b1387,null))[_0x4161('0x53')](handleError(_0x5b1387,null));};var interaction_log=require(_0x4161('0x17'))(_0x4161('0x5c'));exports[_0x4161('0x5d')]=function(_0x279c04,_0x109412,_0x48e2bd){var _0x285612={'channel':_0x4161('0x5e')};if(_0x279c04[_0x4161('0x59')]['id']){delete _0x279c04[_0x4161('0x59')]['id'];}_0x279c04[_0x4161('0x59')][_0x4161('0x5f')]=!![];_0x279c04[_0x4161('0x59')][_0x4161('0x60')]=moment()[_0x4161('0x61')](_0x4161('0x62'));_0x279c04[_0x4161('0x59')][_0x4161('0x63')]=_0x279c04[_0x4161('0x59')]['UserId']||_0x279c04['user']['id'];return db[_0x4161('0x50')][_0x4161('0x58')]({'where':{'id':_0x279c04[_0x4161('0x55')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x4161('0x64')}]})[_0x4161('0x3a')](handleEntityNotFound(_0x109412,null))[_0x4161('0x3a')](saveUpdates(_0x279c04[_0x4161('0x59')],null))['then'](function(_0x17aa25){if(_0x17aa25){_0x285612[_0x4161('0x2c')]=_0x17aa25[_0x4161('0x65')]({'plain':!![]});return db[_0x4161('0x66')][_0x4161('0x58')]({'where':{'id':_0x17aa25[_0x4161('0x67')]}});}return null;})[_0x4161('0x3a')](handleEntityNotFound(_0x109412,null))['then'](function(_0x28787a){if(_0x28787a){return _0x28787a[_0x4161('0x39')]({'UserId':_0x279c04[_0x4161('0x59')][_0x4161('0x63')],'read1stAt':_[_0x4161('0x68')](_0x28787a['read1stAt'])?moment()[_0x4161('0x61')](_0x4161('0x62')):undefined});}return null;})[_0x4161('0x3a')](function(_0x3685ee){if(_0x3685ee){_0x285612[_0x4161('0x69')]=_0x3685ee[_0x4161('0x65')]({'plain':!![]});interaction_log[_0x4161('0x27')](_0x4161('0x6a'),_0x279c04[_0x4161('0x6b')]['id'],_0x279c04['user'][_0x4161('0x3c')],_0x279c04['user'][_0x4161('0x6c')],_0x285612[_0x4161('0x69')]['id'],_0x279c04[_0x4161('0x59')]?JSON[_0x4161('0x2a')](_0x279c04[_0x4161('0x59')]):'null');return respondWithRpcPromise(_0x4161('0x6d'),_0x4161('0x6e'),_0x285612);}return null;})[_0x4161('0x3a')](function(_0xdf3017){if(_0xdf3017){if(_0x279c04[_0x4161('0x59')][_0x4161('0x6f')]){_0x285612[_0x4161('0x2c')]['interface']=util[_0x4161('0x61')](_0x4161('0x70'),_0x279c04[_0x4161('0x6b')]['name']);_0x285612[_0x4161('0x2c')][_0x4161('0x71')]=_0x285612[_0x4161('0x71')];_0x285612[_0x4161('0x2c')]['event']=_0x4161('0x5d');return respondWithRpcPromise(_0x4161('0x72'),_0x4161('0x72'),{'event':_0x4161('0x73'),'message':_0x285612[_0x4161('0x2c')]},client9002)[_0x4161('0x3a')](function(){return _0x285612;});}return _0x285612;}return null;})[_0x4161('0x3a')](respondWithResult(_0x109412,null))[_0x4161('0x53')](handleError(_0x109412,null));};var interaction_log=require(_0x4161('0x17'))(_0x4161('0x5c'));exports['reject']=function(_0x25990a,_0x291407,_0x4648fe){var _0xa95740={'agent':{},'channel':_0x4161('0x5e')};if(_0x25990a['body']['id']){delete _0x25990a['body']['id'];}_0x25990a['body']['UserId']=_0x25990a[_0x4161('0x59')][_0x4161('0x63')]||_0x25990a[_0x4161('0x6b')]['id'];_0xa95740[_0x4161('0x74')]['id']=_0x25990a[_0x4161('0x59')]['UserId'];return db[_0x4161('0x50')][_0x4161('0x58')]({'where':{'id':_0x25990a['params']['id'],'UserId':null}})[_0x4161('0x3a')](handleEntityNotFound(_0x291407,null))[_0x4161('0x3a')](function(_0x29458e){if(_0x29458e){_0xa95740[_0x4161('0x2c')]=_0x29458e[_0x4161('0x65')]({'plain':!![]});return db[_0x4161('0x66')]['find']({'where':{'id':_0x29458e[_0x4161('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x291407,null))['then'](function(_0x3c6baa){if(_0x3c6baa){_0xa95740[_0x4161('0x69')]=_0x3c6baa[_0x4161('0x65')]({'plain':!![]});interaction_log[_0x4161('0x27')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x25990a['user']['id'],_0x25990a[_0x4161('0x6b')][_0x4161('0x3c')],_0x25990a[_0x4161('0x6b')]['role'],_0xa95740['interaction']['id'],_0x25990a[_0x4161('0x59')]?JSON['stringify'](_0x25990a['body']):_0x4161('0x75'));return respondWithRpcPromise('RejectMessage',_0x4161('0x76'),_0xa95740);}return null;})['then'](function(_0x2488ac){if(_0x2488ac){_0x2488ac[_0x4161('0x2c')][_0x4161('0x77')]=util['format'](_0x4161('0x70'),_0x25990a[_0x4161('0x6b')][_0x4161('0x3c')]);_0x2488ac[_0x4161('0x2c')][_0x4161('0x71')]=_0xa95740[_0x4161('0x71')];_0x2488ac[_0x4161('0x2c')][_0x4161('0x78')]='reject';respondWithRpcPromise(_0x4161('0x72'),'EventManager',{'event':_0x4161('0x79'),'message':_0x2488ac[_0x4161('0x2c')]},client9002);return _0xa95740;}return null;})[_0x4161('0x3a')](respondWithResult(_0x291407,null))[_0x4161('0x53')](handleError(_0x291407,null));};exports[_0x4161('0x7a')]=function(_0x50b2a5,_0x1e389c){var _0xc5d418;return db[_0x4161('0x50')][_0x4161('0x7a')](_0x50b2a5['body'],{})[_0x4161('0x3a')](function(_0x4cb624){_0xc5d418=_0x4cb624;return db[_0x4161('0x7b')][_0x4161('0x7c')]({'where':{'id':_0xc5d418['ContactId']}});})['then'](function(_0x15c3a3){if(_[_0x4161('0x68')](_0x15c3a3)){return;}else{_0xc5d418['fax']=_0x15c3a3[_0x4161('0x5e')];return db[_0x4161('0x7d')][_0x4161('0x7c')]({'where':{'id':_0xc5d418['AttachmentId']}});}})[_0x4161('0x3a')](function(_0x4c26cb){return respondWithRpcPromise(_0x4161('0x7e'),'SendFax',{'FaxAccountId':_[_0x4161('0x68')](_0x50b2a5[_0x4161('0x59')])?undefined:_0x50b2a5['body']['FaxAccountId'],'path':_[_0x4161('0x68')](_0x4c26cb)?undefined:util['format'](_0x4161('0x7f'),_0x4c26cb[_0x4161('0x80')]),'fax':_['isNil'](_0xc5d418[_0x4161('0x5e')])?undefined:_0xc5d418['fax'],'AttachmentId':_0xc5d418[_0x4161('0x81')]},client9002);})[_0x4161('0x3a')](respondWithResult(_0x1e389c,0xc9))[_0x4161('0x53')](handleError(_0x1e389c,null));};exports['download']=function(_0x2dfa11,_0x3e69f0){var _0x32cfbc=path[_0x4161('0x82')](config['root'],_0x4161('0x83'),_0x4161('0x84'),_0x4161('0x85'));return db['FaxMessage'][_0x4161('0x58')]({'where':{'id':_0x2dfa11[_0x4161('0x55')]['id']},'include':[{'model':db[_0x4161('0x7d')],'as':'Attachment'}]})[_0x4161('0x3a')](handleEntityNotFound(_0x3e69f0,null))[_0x4161('0x3a')](function(_0x21c0a0){if(_0x21c0a0){return _0x3e69f0[_0x4161('0x86')](path[_0x4161('0x82')](_0x32cfbc,_0x21c0a0['Attachment'][_0x4161('0x80')]));}})[_0x4161('0x53')](handleError(_0x3e69f0,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7486383..b952330 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(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x34e8,0x12c));var _0x834e=function(_0x457243,_0x403379){_0x457243=_0x457243-0x0;var _0x4e33b4=_0x34e8[_0x457243];return _0x4e33b4;};'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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x22d1a6,_0x127148){var _0x50e885=function(_0x25dcb4){while(--_0x25dcb4){_0x22d1a6['push'](_0x22d1a6['shift']());}};_0x50e885(++_0x127148);}(_0x008c,0x188));var _0xc008=function(_0x42e013,_0x4e1584){_0x42e013=_0x42e013-0x0;var _0x3e951b=_0x008c[_0x42e013];return _0x3e951b;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index f805672..18590b6 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 _0x2f95=['secret','isNil','FaxInteraction','findOne','FaxInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','direction','toLowerCase'];(function(_0x278d8d,_0x458be8){var _0x8a6be7=function(_0xbefe2b){while(--_0xbefe2b){_0x278d8d['push'](_0x278d8d['shift']());}};_0x8a6be7(++_0x458be8);}(_0x2f95,0x1a0));var _0x52f9=function(_0x509592,_0x51310c){_0x509592=_0x509592-0x0;var _0x222336=_0x2f95[_0x509592];return _0x222336;};'use strict';var _=require(_0x52f9('0x0'));var util=require(_0x52f9('0x1'));var logger=require(_0x52f9('0x2'))(_0x52f9('0x3'));var moment=require('moment');var BPromise=require(_0x52f9('0x4'));var rp=require(_0x52f9('0x5'));var fs=require('fs');var path=require(_0x52f9('0x6'));var rimraf=require(_0x52f9('0x7'));var config=require(_0x52f9('0x8'));var attributes=require(_0x52f9('0x9'));module[_0x52f9('0xa')]=function(_0x170d8b,_0x4136b1){return _0x170d8b[_0x52f9('0xb')](_0x52f9('0xc'),attributes,{'tableName':_0x52f9('0xd'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x52f9('0xe')],'type':_0x52f9('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ce2a8,_0x1be2f8,_0x3e5999){var _0x36cb3d=_0x170d8b[_0x52f9('0x10')];var _0xe82294=_0x4ce2a8['get']({'plain':!![]});if(_0xe82294[_0x52f9('0x11')][_0x52f9('0x12')]()==='in'||_0xe82294[_0x52f9('0x11')][_0x52f9('0x12')]()==='out'&&!_0xe82294[_0x52f9('0x13')]&&!_[_0x52f9('0x14')](_0xe82294['UserId'])){_0x36cb3d[_0x52f9('0x15')][_0x52f9('0x16')]({'where':{'id':_0xe82294[_0x52f9('0x17')]}})['then'](function(_0x38bde2){if(_0x38bde2){_0x38bde2[_0x52f9('0x18')]({'lastMsgAt':_0xe82294['createdAt'],'lastMsgDirection':_0xe82294[_0x52f9('0x11')][_0x52f9('0x12')]()});}})[_0x52f9('0x19')](function(_0x45710c){console[_0x52f9('0x1a')](_0x45710c);});}_0x3e5999();}},'charset':_0x52f9('0x1b'),'collate':_0x52f9('0x1c')});}; \ No newline at end of file +var _0x138b=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1bea7a,_0x3ce27){var _0x93964e=function(_0x2f34cf){while(--_0x2f34cf){_0x1bea7a['push'](_0x1bea7a['shift']());}};_0x93964e(++_0x3ce27);}(_0x138b,0x12d));var _0xb138=function(_0x43c6a1,_0x3134c1){_0x43c6a1=_0x43c6a1-0x0;var _0x5ad58a=_0x138b[_0x43c6a1];return _0x5ad58a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb138('0x0'));var moment=require(_0xb138('0x1'));var BPromise=require(_0xb138('0x2'));var rp=require(_0xb138('0x3'));var fs=require('fs');var path=require(_0xb138('0x4'));var rimraf=require(_0xb138('0x5'));var config=require(_0xb138('0x6'));var attributes=require(_0xb138('0x7'));module[_0xb138('0x8')]=function(_0x517968,_0x2bfeb6){return _0x517968[_0xb138('0x9')](_0xb138('0xa'),attributes,{'tableName':_0xb138('0xb'),'paranoid':![],'indexes':[{'name':_0xb138('0xc'),'fields':[_0xb138('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x48cd16,_0x48bd29,_0x3af0a8){var _0x7a15e9=_0x517968['models'];var _0xaf9a2=_0x48cd16[_0xb138('0xe')]({'plain':!![]});if(_0xaf9a2[_0xb138('0xf')][_0xb138('0x10')]()==='in'||_0xaf9a2[_0xb138('0xf')][_0xb138('0x10')]()===_0xb138('0x11')&&!_0xaf9a2[_0xb138('0x12')]&&!_['isNil'](_0xaf9a2[_0xb138('0x13')])){_0x7a15e9[_0xb138('0x14')][_0xb138('0x15')]({'where':{'id':_0xaf9a2[_0xb138('0x16')]}})[_0xb138('0x17')](function(_0x2376da){if(_0x2376da){_0x2376da[_0xb138('0x18')]({'lastMsgAt':_0xaf9a2['createdAt'],'lastMsgDirection':_0xaf9a2['direction'][_0xb138('0x10')]()});}})[_0xb138('0x19')](function(_0x160d77){console[_0xb138('0x1a')](_0x160d77);});}_0x3af0a8();}},'charset':_0xb138('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ee772a1..3293bb4 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 _0x390a=['localhost','./faxMessage.socket','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','create','body','options','raw','catch','FaxMessage','update','where','attributes','limit','then','UpdateFaxMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x390a,0xbe));var _0xa390=function(_0xd2b56f,_0x161dcc){_0xd2b56f=_0xd2b56f-0x0;var _0x51daec=_0x390a[_0xd2b56f];return _0x51daec;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require(_0xa390('0x4'));var fs=require('fs');var Redis=require(_0xa390('0x5'));var db=require(_0xa390('0x6'))['db'];var utils=require(_0xa390('0x7'));var logger=require(_0xa390('0x8'))(_0xa390('0x9'));var config=require(_0xa390('0xa'));var jayson=require(_0xa390('0xb'));var client=jayson[_0xa390('0xc')]['http']({'port':0x232a});config[_0xa390('0xd')]=_[_0xa390('0xe')](config['redis'],{'host':_0xa390('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa390('0x10'))[_0xa390('0x11')](socket);function respondWithRpcPromise(_0xf5b97f,_0x8a741a,_0x475ecc){return new BPromise(function(_0x4e94e6,_0x38dfdb){return client[_0xa390('0x12')](_0xf5b97f,_0x475ecc)['then'](function(_0x3a9a18){logger[_0xa390('0x13')](_0xa390('0x14'),_0x8a741a,_0xa390('0x15'));logger[_0xa390('0x16')](_0xa390('0x17'),_0x8a741a,'request\x20sent',JSON[_0xa390('0x18')](_0x3a9a18));if(_0x3a9a18[_0xa390('0x19')]){if(_0x3a9a18[_0xa390('0x19')]['code']===0x1f4){logger['error'](_0xa390('0x14'),_0x8a741a,_0x3a9a18['error'][_0xa390('0x1a')]);return _0x38dfdb(_0x3a9a18[_0xa390('0x19')][_0xa390('0x1a')]);}logger[_0xa390('0x19')](_0xa390('0x14'),_0x8a741a,_0x3a9a18['error']['message']);return _0x4e94e6(_0x3a9a18['error'][_0xa390('0x1a')]);}else{logger[_0xa390('0x13')]('FaxMessage,\x20%s,\x20%s',_0x8a741a,_0xa390('0x15'));_0x4e94e6(_0x3a9a18[_0xa390('0x1b')][_0xa390('0x1a')]);}})['catch'](function(_0x192f3d){logger[_0xa390('0x19')](_0xa390('0x14'),_0x8a741a,_0x192f3d);_0x38dfdb(_0x192f3d);});});}exports[_0xa390('0x1c')]=function(_0x22298c){var _0x112e46=this;return new Promise(function(_0x4b8fe1,_0xba6a8){return db['FaxMessage'][_0xa390('0x1d')](_0x22298c[_0xa390('0x1e')],{'raw':_0x22298c['options']?_0x22298c[_0xa390('0x1f')][_0xa390('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x361b2f){logger[_0xa390('0x13')](_0xa390('0x1c'),_0x22298c);logger['debug'](_0xa390('0x1c'),_0x22298c,JSON[_0xa390('0x18')](_0x361b2f));_0x4b8fe1(_0x361b2f);})[_0xa390('0x21')](function(_0x10e815){logger[_0xa390('0x19')](_0xa390('0x1c'),_0x10e815[_0xa390('0x1a')],_0x22298c);_0xba6a8(_0x112e46[_0xa390('0x19')](0x1f4,_0x10e815['message']));});});};exports['UpdateFaxMessage']=function(_0x2f01be){var _0x54b25f=this;return new Promise(function(_0x5af8ef,_0x19f161){return db[_0xa390('0x22')][_0xa390('0x23')](_0x2f01be[_0xa390('0x1e')],{'raw':_0x2f01be[_0xa390('0x1f')]?_0x2f01be[_0xa390('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f01be[_0xa390('0x1f')]?_0x2f01be[_0xa390('0x1f')][_0xa390('0x24')]||null:null,'attributes':_0x2f01be[_0xa390('0x1f')]?_0x2f01be[_0xa390('0x1f')][_0xa390('0x25')]||null:null,'limit':_0x2f01be[_0xa390('0x1f')]?_0x2f01be['options'][_0xa390('0x26')]||null:null})[_0xa390('0x27')](function(_0x41874e){logger['info'](_0xa390('0x28'),_0x2f01be);logger[_0xa390('0x16')]('UpdateFaxMessage',_0x2f01be,JSON[_0xa390('0x18')](_0x41874e));_0x5af8ef(_0x41874e);})[_0xa390('0x21')](function(_0xcc1dd1){logger[_0xa390('0x19')](_0xa390('0x28'),_0xcc1dd1[_0xa390('0x1a')],_0x2f01be);_0x19f161(_0x54b25f[_0xa390('0x19')](0x1f4,_0xcc1dd1[_0xa390('0x1a')]));});});}; \ No newline at end of file +var _0x7428=['error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','raw','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7428,0xfc));var _0x8742=function(_0x17495b,_0x2ca8c0){_0x17495b=_0x17495b-0x0;var _0x4edfda=_0x7428[_0x17495b];return _0x4edfda;};'use strict';var _=require(_0x8742('0x0'));var util=require(_0x8742('0x1'));var moment=require('moment');var BPromise=require(_0x8742('0x2'));var rs=require(_0x8742('0x3'));var fs=require('fs');var Redis=require(_0x8742('0x4'));var db=require(_0x8742('0x5'))['db'];var utils=require(_0x8742('0x6'));var logger=require(_0x8742('0x7'))(_0x8742('0x8'));var config=require(_0x8742('0x9'));var jayson=require(_0x8742('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x8742('0xb')]=_[_0x8742('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8742('0xb')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a4efe,_0x358832,_0x4f0ebe){return new BPromise(function(_0x2665d3,_0x518997){return client['request'](_0x2a4efe,_0x4f0ebe)[_0x8742('0xd')](function(_0x1f75c2){logger[_0x8742('0xe')](_0x8742('0xf'),_0x358832,'request\x20sent');logger[_0x8742('0x10')](_0x8742('0x11'),_0x358832,_0x8742('0x12'),JSON[_0x8742('0x13')](_0x1f75c2));if(_0x1f75c2[_0x8742('0x14')]){if(_0x1f75c2[_0x8742('0x14')]['code']===0x1f4){logger['error'](_0x8742('0xf'),_0x358832,_0x1f75c2[_0x8742('0x14')][_0x8742('0x15')]);return _0x518997(_0x1f75c2[_0x8742('0x14')][_0x8742('0x15')]);}logger[_0x8742('0x14')](_0x8742('0xf'),_0x358832,_0x1f75c2['error']['message']);return _0x2665d3(_0x1f75c2[_0x8742('0x14')][_0x8742('0x15')]);}else{logger[_0x8742('0xe')](_0x8742('0xf'),_0x358832,_0x8742('0x12'));_0x2665d3(_0x1f75c2[_0x8742('0x16')]['message']);}})[_0x8742('0x17')](function(_0x127940){logger[_0x8742('0x14')](_0x8742('0xf'),_0x358832,_0x127940);_0x518997(_0x127940);});});}exports[_0x8742('0x18')]=function(_0x787a4){var _0x186385=this;return new Promise(function(_0x4d774f,_0x590774){return db[_0x8742('0x19')][_0x8742('0x1a')](_0x787a4[_0x8742('0x1b')],{'raw':_0x787a4[_0x8742('0x1c')]?_0x787a4['options']['raw']===undefined?!![]:![]:!![]})[_0x8742('0xd')](function(_0x26613b){logger[_0x8742('0xe')]('CreateFaxMessage',_0x787a4);logger[_0x8742('0x10')](_0x8742('0x18'),_0x787a4,JSON['stringify'](_0x26613b));_0x4d774f(_0x26613b);})[_0x8742('0x17')](function(_0x1a7029){logger['error'](_0x8742('0x18'),_0x1a7029[_0x8742('0x15')],_0x787a4);_0x590774(_0x186385[_0x8742('0x14')](0x1f4,_0x1a7029['message']));});});};exports[_0x8742('0x1d')]=function(_0x10de26){var _0x328183=this;return new Promise(function(_0x34f644,_0x16d8a0){return db[_0x8742('0x19')][_0x8742('0x1e')](_0x10de26[_0x8742('0x1b')],{'raw':_0x10de26[_0x8742('0x1c')]?_0x10de26[_0x8742('0x1c')][_0x8742('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10de26[_0x8742('0x1c')]?_0x10de26[_0x8742('0x1c')]['where']||null:null,'attributes':_0x10de26['options']?_0x10de26['options'][_0x8742('0x20')]||null:null,'limit':_0x10de26[_0x8742('0x1c')]?_0x10de26[_0x8742('0x1c')][_0x8742('0x21')]||null:null})[_0x8742('0xd')](function(_0x276591){logger[_0x8742('0xe')](_0x8742('0x1d'),_0x10de26);logger[_0x8742('0x10')]('UpdateFaxMessage',_0x10de26,JSON[_0x8742('0x13')](_0x276591));_0x34f644(_0x276591);})[_0x8742('0x17')](function(_0x100321){logger[_0x8742('0x14')]('UpdateFaxMessage',_0x100321[_0x8742('0x15')],_0x10de26);_0x16d8a0(_0x328183[_0x8742('0x14')](0x1f4,_0x100321[_0x8742('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b7b4e71..732b864 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index cd0c08f..2889a4e 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 _0xb1d5=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','multer'];(function(_0x3c8b28,_0xee9491){var _0x2febc8=function(_0x236b18){while(--_0x236b18){_0x3c8b28['push'](_0x3c8b28['shift']());}};_0x2febc8(++_0xee9491);}(_0xb1d5,0x187));var _0x5b1d=function(_0x5bcb11,_0x5b5d84){_0x5bcb11=_0x5bcb11-0x0;var _0x3daa19=_0xb1d5[_0x5bcb11];return _0x3daa19;};'use strict';var multer=require(_0x5b1d('0x0'));var util=require(_0x5b1d('0x1'));var path=require(_0x5b1d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b1d('0x3')]();var auth=require(_0x5b1d('0x4'));var interaction=require(_0x5b1d('0x5'));var config=require(_0x5b1d('0x6'));var controller=require(_0x5b1d('0x7'));router['get']('/',auth[_0x5b1d('0x8')](),controller[_0x5b1d('0x9')]);router[_0x5b1d('0xa')](_0x5b1d('0xb'),auth['isAuthenticated'](),controller[_0x5b1d('0xc')]);router[_0x5b1d('0xa')](_0x5b1d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5b1d('0xa')](_0x5b1d('0xe'),auth['isAuthenticated'](),controller[_0x5b1d('0xf')]);router[_0x5b1d('0x10')]('/',auth['isAuthenticated'](),interaction[_0x5b1d('0x11')](_0x5b1d('0x12'),_0x5b1d('0x13')),controller[_0x5b1d('0x14')]);router[_0x5b1d('0x15')](_0x5b1d('0xd'),auth[_0x5b1d('0x8')](),controller[_0x5b1d('0x16')]);router[_0x5b1d('0x15')](_0x5b1d('0x17'),auth[_0x5b1d('0x8')](),controller[_0x5b1d('0x18')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x5b1d('0x19')](_0x5b1d('0xd'),auth['isAuthenticated'](),controller[_0x5b1d('0x1a')]);module[_0x5b1d('0x1b')]=router; \ No newline at end of file +var _0x5b45=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','fax','faxmessage:create','create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5b45,0x1d0));var _0x55b4=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0x5b45[_0x316c42];return _0x2b38f7;};'use strict';var multer=require(_0x55b4('0x0'));var util=require(_0x55b4('0x1'));var path=require(_0x55b4('0x2'));var timeout=require(_0x55b4('0x3'));var express=require(_0x55b4('0x4'));var router=express[_0x55b4('0x5')]();var auth=require(_0x55b4('0x6'));var interaction=require(_0x55b4('0x7'));var config=require(_0x55b4('0x8'));var controller=require(_0x55b4('0x9'));router[_0x55b4('0xa')]('/',auth[_0x55b4('0xb')](),controller[_0x55b4('0xc')]);router[_0x55b4('0xa')](_0x55b4('0xd'),auth[_0x55b4('0xb')](),controller[_0x55b4('0xe')]);router[_0x55b4('0xa')](_0x55b4('0xf'),auth[_0x55b4('0xb')](),controller[_0x55b4('0x10')]);router[_0x55b4('0xa')]('/:id/download',auth[_0x55b4('0xb')](),controller['download']);router[_0x55b4('0x11')]('/',auth['isAuthenticated'](),interaction[_0x55b4('0x12')](_0x55b4('0x13'),_0x55b4('0x14')),controller[_0x55b4('0x15')]);router['put'](_0x55b4('0xf'),auth[_0x55b4('0xb')](),controller[_0x55b4('0x16')]);router[_0x55b4('0x17')](_0x55b4('0x18'),auth[_0x55b4('0xb')](),controller[_0x55b4('0x19')]);router[_0x55b4('0x17')](_0x55b4('0x1a'),auth[_0x55b4('0xb')](),controller[_0x55b4('0x1b')]);router[_0x55b4('0x1c')](_0x55b4('0xf'),auth[_0x55b4('0xb')](),controller[_0x55b4('0x1d')]);module[_0x55b4('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 2df8507..d836ece 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 _0x7a28=['rrmemory','beepall','roundrobin','exports','name','INTEGER','ENUM'];(function(_0x1065a0,_0x5777bc){var _0x45322b=function(_0x2ed02a){while(--_0x2ed02a){_0x1065a0['push'](_0x1065a0['shift']());}};_0x45322b(++_0x5777bc);}(_0x7a28,0x176));var _0x87a2=function(_0x4acdeb,_0x4c175f){_0x4acdeb=_0x4acdeb-0x0;var _0x28cde4=_0x7a28[_0x4acdeb];return _0x28cde4;};'use strict';var Sequelize=require('sequelize');module[_0x87a2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x87a2('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x87a2('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x87a2('0x3')](_0x87a2('0x4'),_0x87a2('0x5'),_0x87a2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x87a2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9b7c=['beepall','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x349a91,_0x17f611){var _0x5a07b1=function(_0x430a90){while(--_0x430a90){_0x349a91['push'](_0x349a91['shift']());}};_0x5a07b1(++_0x17f611);}(_0x9b7c,0x19e));var _0xc9b7=function(_0x58252d,_0x2070b3){_0x58252d=_0x58252d-0x0;var _0x55a98c=_0x9b7c[_0x58252d];return _0x55a98c;};'use strict';var Sequelize=require(_0xc9b7('0x0'));module[_0xc9b7('0x1')]={'name':{'type':Sequelize[_0xc9b7('0x2')],'unique':_0xc9b7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc9b7('0x2')]},'timeout':{'type':Sequelize[_0xc9b7('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc9b7('0x5'),_0xc9b7('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc9b7('0x4')],'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 1927e71..e661e17 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 _0x3843=['findAll','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','agent','faxPause','createdAt','rows','SIP','updatedAt','getTeams','addTeams','ids','Team','User','Agents','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_fax_queues','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0x3843,0x144));var _0x3384=function(_0x5704d4,_0x566c58){_0x5704d4=_0x5704d4-0x0;var _0x495bd4=_0x3843[_0x5704d4];return _0x495bd4;};'use strict';var pdf=require(_0x3384('0x0'));var emlformat=require(_0x3384('0x1'));var rimraf=require(_0x3384('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3384('0x3'));var moment=require('moment');var BPromise=require(_0x3384('0x4'));var Mustache=require('mustache');var util=require(_0x3384('0x5'));var path=require('path');var sox=require(_0x3384('0x6'));var csv=require('to-csv');var ejs=require(_0x3384('0x7'));var fs=require('fs');var _=require(_0x3384('0x8'));var squel=require(_0x3384('0x9'));var crypto=require(_0x3384('0xa'));var jsforce=require(_0x3384('0xb'));var deskjs=require(_0x3384('0xc'));var toCsv=require(_0x3384('0xd'));var querystring=require(_0x3384('0xe'));var Papa=require(_0x3384('0xf'));var Redis=require(_0x3384('0x10'));var authService=require(_0x3384('0x11'));var qs=require(_0x3384('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3384('0x13'))(_0x3384('0x14'));var utils=require('../../config/utils');var config=require(_0x3384('0x15'));var db=require(_0x3384('0x16'))['db'];config[_0x3384('0x17')]=_[_0x3384('0x18')](config[_0x3384('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3384('0x19'))(new Redis(config[_0x3384('0x17')]));require('./faxQueue.socket')[_0x3384('0x1a')](socket);function respondWithStatusCode(_0x56ed14,_0x5e30b6){_0x5e30b6=_0x5e30b6||0xcc;return function(_0x22fec9){if(_0x22fec9){return _0x56ed14[_0x3384('0x1b')](_0x5e30b6);}return _0x56ed14[_0x3384('0x1c')](_0x5e30b6)[_0x3384('0x1d')]();};}function respondWithResult(_0x27efdb,_0x5d6c62){_0x5d6c62=_0x5d6c62||0xc8;return function(_0x2fec76){if(_0x2fec76){return _0x27efdb['status'](_0x5d6c62)[_0x3384('0x1e')](_0x2fec76);}};}function respondWithFilteredResult(_0x262099,_0x12d35b){return function(_0x5089ab){if(_0x5089ab){var _0x53f2da=_0x5089ab['count'],_0x549767=_0x12d35b[_0x3384('0x1f')],_0x4da375=_0x12d35b[_0x3384('0x1f')]+_0x12d35b[_0x3384('0x20')],_0x16aa4b;if(_0x4da375>=_0x53f2da){_0x4da375=_0x53f2da;_0x16aa4b=0xc8;}else{_0x16aa4b=0xce;}_0x262099[_0x3384('0x1c')](_0x16aa4b);return _0x262099[_0x3384('0x21')](_0x3384('0x22'),_0x549767+'-'+_0x4da375+'/'+_0x53f2da)[_0x3384('0x1e')](_0x5089ab);}return null;};}function patchUpdates(_0x265f0b){return function(_0x1d9556){try{jsonpatch['apply'](_0x1d9556,_0x265f0b,!![]);}catch(_0x31b746){return BPromise[_0x3384('0x23')](_0x31b746);}return _0x1d9556[_0x3384('0x24')]();};}function saveUpdates(_0x394bc2,_0x163f55){return function(_0x5eecdb){if(_0x5eecdb){return _0x5eecdb['update'](_0x394bc2)[_0x3384('0x25')](function(_0x575e68){return _0x575e68;});}return null;};}function removeEntity(_0x514f64,_0x2e1c53){return function(_0x21fa1){if(_0x21fa1){return _0x21fa1[_0x3384('0x26')]()[_0x3384('0x25')](function(){var _0x425819=_0x21fa1[_0x3384('0x27')]({'plain':!![]});var _0x6b2f17=_0x3384('0x28');return db[_0x3384('0x29')]['destroy']({'where':{'type':_0x6b2f17,'resourceId':_0x425819['id']}})['then'](function(){return _0x21fa1;});})[_0x3384('0x25')](function(){_0x514f64[_0x3384('0x1c')](0xcc)[_0x3384('0x1d')]();});}};}function handleEntityNotFound(_0xf6b085,_0x474f23){return function(_0x261f13){if(!_0x261f13){_0xf6b085[_0x3384('0x1b')](0x194);}return _0x261f13;};}function handleError(_0x3b25bf,_0x20a11b){_0x20a11b=_0x20a11b||0x1f4;return function(_0x5d5ed4){logger[_0x3384('0x2a')](_0x5d5ed4[_0x3384('0x2b')]);if(_0x5d5ed4[_0x3384('0x2c')]){delete _0x5d5ed4[_0x3384('0x2c')];}_0x3b25bf[_0x3384('0x1c')](_0x20a11b)['send'](_0x5d5ed4);};}exports[_0x3384('0x2d')]=function(_0x5f0841,_0x36e183){var _0x31957a={},_0x30e264={},_0x521887={'count':0x0,'rows':[]};var _0x51b110=_[_0x3384('0x2e')](db[_0x3384('0x2f')][_0x3384('0x30')],function(_0x7ed1c9){return{'name':_0x7ed1c9[_0x3384('0x31')],'type':_0x7ed1c9[_0x3384('0x32')][_0x3384('0x33')]};});_0x30e264['model']=_[_0x3384('0x2e')](_0x51b110,_0x3384('0x2c'));_0x30e264[_0x3384('0x34')]=_[_0x3384('0x35')](_0x5f0841[_0x3384('0x34')]);_0x30e264['filters']=_[_0x3384('0x36')](_0x30e264[_0x3384('0x37')],_0x30e264['query']);_0x31957a['attributes']=_[_0x3384('0x36')](_0x30e264[_0x3384('0x37')],qs[_0x3384('0x38')](_0x5f0841['query'][_0x3384('0x38')]));_0x31957a['attributes']=_0x31957a[_0x3384('0x39')][_0x3384('0x3a')]?_0x31957a[_0x3384('0x39')]:_0x30e264[_0x3384('0x37')];if(!_0x5f0841[_0x3384('0x34')][_0x3384('0x3b')](_0x3384('0x3c'))){_0x31957a['limit']=qs[_0x3384('0x20')](_0x5f0841[_0x3384('0x34')][_0x3384('0x20')]);_0x31957a['offset']=qs[_0x3384('0x1f')](_0x5f0841[_0x3384('0x34')]['offset']);}_0x31957a[_0x3384('0x3d')]=qs[_0x3384('0x3e')](_0x5f0841[_0x3384('0x34')][_0x3384('0x3e')]);_0x31957a[_0x3384('0x3f')]=qs[_0x3384('0x40')](_[_0x3384('0x41')](_0x5f0841[_0x3384('0x34')],_0x30e264[_0x3384('0x40')]),_0x51b110);if(_0x5f0841['query']['filter']){_0x31957a[_0x3384('0x3f')]=_[_0x3384('0x42')](_0x31957a[_0x3384('0x3f')],{'$or':_['map'](_0x51b110,function(_0x1e4a23){if(_0x1e4a23[_0x3384('0x32')]!==_0x3384('0x43')){var _0x5a020f={};_0x5a020f[_0x1e4a23[_0x3384('0x2c')]]={'$like':'%'+_0x5f0841[_0x3384('0x34')][_0x3384('0x44')]+'%'};return _0x5a020f;}})});}_0x31957a=_[_0x3384('0x42')]({},_0x31957a,_0x5f0841[_0x3384('0x45')]);var _0x46e107={'where':_0x31957a[_0x3384('0x3f')]};return db[_0x3384('0x2f')][_0x3384('0x46')](_0x46e107)[_0x3384('0x25')](function(_0x1bebab){_0x521887['count']=_0x1bebab;if(_0x5f0841[_0x3384('0x34')][_0x3384('0x47')]){_0x31957a['include']=[{'all':!![]}];}return db['FaxQueue'][_0x3384('0x48')](_0x31957a);})[_0x3384('0x25')](function(_0x49978){_0x521887['rows']=_0x49978;return _0x521887;})[_0x3384('0x25')](respondWithFilteredResult(_0x36e183,_0x31957a))[_0x3384('0x49')](handleError(_0x36e183,null));};exports[_0x3384('0x4a')]=function(_0x29aa78,_0x3c2c45){var _0x331c20={'raw':!![],'where':{'id':_0x29aa78[_0x3384('0x4b')]['id']}},_0x54e7d5={};_0x54e7d5[_0x3384('0x37')]=_[_0x3384('0x35')](db[_0x3384('0x2f')][_0x3384('0x30')]);_0x54e7d5[_0x3384('0x34')]=_['keys'](_0x29aa78[_0x3384('0x34')]);_0x54e7d5[_0x3384('0x40')]=_[_0x3384('0x36')](_0x54e7d5[_0x3384('0x37')],_0x54e7d5[_0x3384('0x34')]);_0x331c20[_0x3384('0x39')]=_['intersection'](_0x54e7d5[_0x3384('0x37')],qs[_0x3384('0x38')](_0x29aa78[_0x3384('0x34')][_0x3384('0x38')]));_0x331c20[_0x3384('0x39')]=_0x331c20[_0x3384('0x39')][_0x3384('0x3a')]?_0x331c20[_0x3384('0x39')]:_0x54e7d5['model'];if(_0x29aa78[_0x3384('0x34')][_0x3384('0x47')]){_0x331c20['include']=[{'all':!![]}];}_0x331c20=_['merge']({},_0x331c20,_0x29aa78[_0x3384('0x45')]);return db['FaxQueue'][_0x3384('0x4c')](_0x331c20)['then'](handleEntityNotFound(_0x3c2c45,null))[_0x3384('0x25')](respondWithResult(_0x3c2c45,null))[_0x3384('0x49')](handleError(_0x3c2c45,null));};exports['create']=function(_0x5f514b,_0xbd5be7){return db[_0x3384('0x2f')][_0x3384('0x4d')](_0x5f514b[_0x3384('0x4e')],{})[_0x3384('0x25')](function(_0x41461d){var _0x3764fb=_0x5f514b[_0x3384('0x4f')][_0x3384('0x27')]({'plain':!![]});if(!_0x3764fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3764fb[_0x3384('0x50')]===_0x3384('0x4f')){var _0x1a1c22=_0x41461d[_0x3384('0x27')]({'plain':!![]});var _0x245e6d=_0x3384('0x28');return db[_0x3384('0x51')][_0x3384('0x4c')]({'where':{'name':_0x245e6d,'userProfileId':_0x3764fb[_0x3384('0x52')]},'raw':!![]})['then'](function(_0x464d44){if(_0x464d44&&_0x464d44[_0x3384('0x53')]===0x0){return db[_0x3384('0x29')][_0x3384('0x4d')]({'name':_0x1a1c22['name'],'resourceId':_0x1a1c22['id'],'type':_0x464d44[_0x3384('0x2c')],'sectionId':_0x464d44['id']},{})[_0x3384('0x25')](function(){return _0x41461d;});}else{return _0x41461d;}})[_0x3384('0x49')](function(_0x56633e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56633e);throw _0x56633e;});}return _0x41461d;})[_0x3384('0x25')](respondWithResult(_0xbd5be7,0xc9))[_0x3384('0x49')](handleError(_0xbd5be7,null));};exports[_0x3384('0x54')]=function(_0x100a68,_0x63feb4){if(_0x100a68[_0x3384('0x4e')]['id']){delete _0x100a68[_0x3384('0x4e')]['id'];}return db[_0x3384('0x2f')][_0x3384('0x4c')]({'where':{'id':_0x100a68[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](handleEntityNotFound(_0x63feb4,null))[_0x3384('0x25')](saveUpdates(_0x100a68[_0x3384('0x4e')],null))['then'](respondWithResult(_0x63feb4,null))[_0x3384('0x49')](handleError(_0x63feb4,null));};exports[_0x3384('0x26')]=function(_0x3733c5,_0x44f68f){return db['FaxQueue'][_0x3384('0x4c')]({'where':{'id':_0x3733c5[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](handleEntityNotFound(_0x44f68f,null))[_0x3384('0x25')](removeEntity(_0x44f68f,null))[_0x3384('0x49')](handleError(_0x44f68f,null));};exports[_0x3384('0x55')]=function(_0x14771a,_0x37d952){return db['FaxQueue'][_0x3384('0x55')]()[_0x3384('0x25')](respondWithResult(_0x37d952,null))[_0x3384('0x49')](handleError(_0x37d952,null));};exports[_0x3384('0x56')]=function(_0x412098,_0x3a37fd,_0x449f37){var _0x2a3962={'raw':!![],'where':{}},_0x26afd3={},_0x375053;return db[_0x3384('0x2f')][_0x3384('0x57')]({'where':{'id':_0x412098[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](handleEntityNotFound(_0x3a37fd,null))['then'](function(_0x20f9d5){if(_0x20f9d5){_0x375053=_0x20f9d5[_0x3384('0x27')]({'plain':!![]});_0x26afd3[_0x3384('0x37')]=_[_0x3384('0x35')](db[_0x3384('0x58')][_0x3384('0x30')]);_0x26afd3[_0x3384('0x34')]=_[_0x3384('0x35')](_0x412098[_0x3384('0x34')]);_0x26afd3[_0x3384('0x40')]=_['intersection'](_0x26afd3[_0x3384('0x37')],_0x26afd3['query']);_0x2a3962[_0x3384('0x39')]=_[_0x3384('0x36')](_0x26afd3[_0x3384('0x37')],qs[_0x3384('0x38')](_0x412098['query']['fields']));_0x2a3962[_0x3384('0x39')]=_0x2a3962[_0x3384('0x39')][_0x3384('0x3a')]?_0x2a3962[_0x3384('0x39')]:_0x26afd3[_0x3384('0x37')];if(!_0x412098[_0x3384('0x34')]['hasOwnProperty'](_0x3384('0x3c'))){_0x2a3962[_0x3384('0x20')]=qs['limit'](_0x412098[_0x3384('0x34')]['limit']);_0x2a3962[_0x3384('0x1f')]=qs[_0x3384('0x1f')](_0x412098[_0x3384('0x34')][_0x3384('0x1f')]);}_0x2a3962[_0x3384('0x3d')]=qs[_0x3384('0x3e')](_0x412098[_0x3384('0x34')]['sort']);_0x2a3962[_0x3384('0x3f')]=qs[_0x3384('0x40')](_['pick'](_0x412098[_0x3384('0x34')],_0x26afd3['filters']));_0x2a3962[_0x3384('0x3f')][_0x3384('0x59')]=_0x20f9d5['id'];if(_0x412098[_0x3384('0x34')][_0x3384('0x44')]){_0x2a3962[_0x3384('0x3f')]=_[_0x3384('0x42')](_0x2a3962[_0x3384('0x3f')],{'$or':_[_0x3384('0x2e')](_0x2a3962[_0x3384('0x39')],function(_0x115bf1){var _0x533640={};_0x533640[_0x115bf1]={'$like':'%'+_0x412098['query'][_0x3384('0x44')]+'%'};return _0x533640;})});}_0x2a3962=_[_0x3384('0x42')]({},_0x2a3962,_0x412098[_0x3384('0x45')]);return db[_0x3384('0x58')][_0x3384('0x48')](_0x2a3962);}})['then'](function(_0x1e6b61){if(_0x1e6b61){return db['User'][_0x3384('0x5a')]({'where':{'id':_[_0x3384('0x2e')](_0x1e6b61,'UserId'),'role':_0x3384('0x5b')},'attributes':['id',_0x3384('0x2c'),_0x3384('0x5c'),'updatedAt',_0x3384('0x5d')]});}})[_0x3384('0x25')](function(_0x2acbc4){if(_0x2acbc4){return{'count':_0x2acbc4[_0x3384('0x46')],'rows':_[_0x3384('0x2e')](_0x2acbc4[_0x3384('0x5e')],function(_0x40a2bd){return{'membername':_0x40a2bd[_0x3384('0x2c')],'UserId':_0x40a2bd['id'],'queue_name':_0x375053[_0x3384('0x2c')],'FaxQueueId':_0x375053['id'],'interface':util['format']('%s/%s',_0x3384('0x5f'),_0x40a2bd[_0x3384('0x2c')]),'penalty':0x0,'paused':_0x40a2bd[_0x3384('0x5c')],'createdAt':_0x40a2bd[_0x3384('0x5d')],'updatedAt':_0x40a2bd[_0x3384('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a37fd,_0x2a3962))[_0x3384('0x49')](handleError(_0x3a37fd,null));};exports[_0x3384('0x61')]=function(_0x2c1c55,_0x30fdf8,_0x539193){var _0x1bcc6f={};var _0x5d326e={};var _0x2635b7;var _0x38b31e;return db[_0x3384('0x2f')]['findOne']({'where':{'id':_0x2c1c55[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](handleEntityNotFound(_0x30fdf8,null))['then'](function(_0x4158e8){if(_0x4158e8){_0x2635b7=_0x4158e8;_0x5d326e[_0x3384('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x5d326e[_0x3384('0x34')]=_[_0x3384('0x35')](_0x2c1c55[_0x3384('0x34')]);_0x5d326e[_0x3384('0x40')]=_['intersection'](_0x5d326e[_0x3384('0x37')],_0x5d326e[_0x3384('0x34')]);_0x1bcc6f[_0x3384('0x39')]=_[_0x3384('0x36')](_0x5d326e[_0x3384('0x37')],qs[_0x3384('0x38')](_0x2c1c55[_0x3384('0x34')]['fields']));_0x1bcc6f['attributes']=_0x1bcc6f[_0x3384('0x39')][_0x3384('0x3a')]?_0x1bcc6f[_0x3384('0x39')]:_0x5d326e[_0x3384('0x37')];_0x1bcc6f[_0x3384('0x3d')]=qs[_0x3384('0x3e')](_0x2c1c55[_0x3384('0x34')][_0x3384('0x3e')]);_0x1bcc6f[_0x3384('0x3f')]=qs[_0x3384('0x40')](_[_0x3384('0x41')](_0x2c1c55[_0x3384('0x34')],_0x5d326e[_0x3384('0x40')]));if(_0x2c1c55[_0x3384('0x34')][_0x3384('0x44')]){_0x1bcc6f['where']=_[_0x3384('0x42')](_0x1bcc6f[_0x3384('0x3f')],{'$or':_[_0x3384('0x2e')](_0x1bcc6f[_0x3384('0x39')],function(_0x32750f){var _0x5d0464={};_0x5d0464[_0x32750f]={'$like':'%'+_0x2c1c55[_0x3384('0x34')][_0x3384('0x44')]+'%'};return _0x5d0464;})});}_0x1bcc6f=_['merge']({},_0x1bcc6f,_0x2c1c55[_0x3384('0x45')]);return _0x2635b7['getTeams'](_0x1bcc6f);}})[_0x3384('0x25')](function(_0x295f4d){if(_0x295f4d){_0x38b31e=_0x295f4d[_0x3384('0x3a')];if(!_0x2c1c55['query'][_0x3384('0x3b')]('nolimit')){_0x1bcc6f['limit']=qs[_0x3384('0x20')](_0x2c1c55[_0x3384('0x34')][_0x3384('0x20')]);_0x1bcc6f[_0x3384('0x1f')]=qs[_0x3384('0x1f')](_0x2c1c55['query'][_0x3384('0x1f')]);}return _0x2635b7['getTeams'](_0x1bcc6f);}})[_0x3384('0x25')](function(_0x25d31f){if(_0x25d31f){return _0x25d31f?{'count':_0x38b31e,'rows':_0x25d31f}:null;}})[_0x3384('0x25')](respondWithResult(_0x30fdf8,null))[_0x3384('0x49')](handleError(_0x30fdf8,null));};exports[_0x3384('0x62')]=function(_0x998e13,_0xe77451,_0x2480ee){var _0x2ffddc=_0x998e13[_0x3384('0x4e')][_0x3384('0x63')];return db[_0x3384('0x64')][_0x3384('0x48')]({'where':{'id':_0x2ffddc},'attributes':['id'],'include':[{'model':db[_0x3384('0x65')],'as':_0x3384('0x66'),'attributes':['id','name','online',_0x3384('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x57f2e0){if(_0x57f2e0){var _0x3efa09=_['flatMap'](_0x57f2e0,function(_0x279db9){var _0x103629=_0x279db9[_0x3384('0x27')]({'plain':!![]});return _0x103629[_0x3384('0x66')];});return db[_0x3384('0x2f')][_0x3384('0x4c')]({'where':{'id':_0x998e13[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](function(_0x276a5c){return db[_0x3384('0x68')][_0x3384('0x69')](function(_0x1563f6){return _0x276a5c[_0x3384('0x62')](_0x2ffddc,{'transaction':_0x1563f6})[_0x3384('0x25')](function(){return BPromise[_0x3384('0x6a')](_0x3efa09,function(_0x5c98e1){return db[_0x3384('0x58')][_0x3384('0x6b')]({'where':{'UserId':_0x5c98e1['id'],'FaxQueueId':_0x998e13[_0x3384('0x4b')]['id']},'transaction':_0x1563f6});});})[_0x3384('0x25')](function(){_0x3efa09[_0x3384('0x6c')](function(_0x479009){socket[_0x3384('0x6d')]('userFaxQueue:save',{'UserId':_0x479009['id'],'FaxQueueId':_0x276a5c['id']});});});});});}})[_0x3384('0x25')](respondWithStatusCode(_0xe77451,null))[_0x3384('0x49')](handleError(_0xe77451,null));};exports['removeTeams']=function(_0xfca560,_0x37e582,_0x1191da){return db[_0x3384('0x64')][_0x3384('0x48')]({'where':{'id':_0xfca560['query'][_0x3384('0x63')]},'attributes':['id'],'include':[{'model':db[_0x3384('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x37e582,null))['then'](function(_0x1f0a3b){var _0x3b4348=_[_0x3384('0x2e')](_0x1f0a3b,'id');var _0x3e785a=[];var _0x57ed6e=[];var _0x23bea6=squel[_0x3384('0x6e')]();_0x23bea6[_0x3384('0x6f')](_0x3384('0x70'))[_0x3384('0x71')](_0x3384('0x72'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3384('0x3f')](_0x3384('0x73'),_0xfca560[_0x3384('0x4b')]['id']);for(var _0xb35448=0x0;_0xb35448<_0x1f0a3b[_0x3384('0x3a')];_0xb35448+=0x1){let _0x69b4c7=_0x1f0a3b[_0xb35448];for(var _0x189a66=0x0;_0x189a66<_0x69b4c7[_0x3384('0x66')][_0x3384('0x3a')];_0x189a66+=0x1){let _0x306bb3=_0x69b4c7['Agents'][_0x189a66];var _0x5c7874=_0x23bea6[_0x3384('0x74')]();_0x5c7874[_0x3384('0x3f')](_0x3384('0x75'),_0x306bb3['id']);_0x57ed6e['push'](db[_0x3384('0x68')][_0x3384('0x34')](_0x5c7874[_0x3384('0x76')](),{'type':db[_0x3384('0x68')]['QueryTypes']['SELECT']})[_0x3384('0x25')](function(_0x302c75){if(_0x302c75[_0x3384('0x3a')]===0x1){return _0x306bb3['id'];}else{var _0x5916fe=_['every'](_[_0x3384('0x2e')](_0x302c75,_0x3384('0x77')),function(_0x12cbdd){return _[_0x3384('0x78')](_0x3b4348,_0x12cbdd);});if(_0x5916fe){return _0x306bb3['id'];}}}));}}return BPromise[_0x3384('0x79')](_0x57ed6e)[_0x3384('0x25')](function(_0x45eb16){_0x3e785a=_(_0x3e785a)[_0x3384('0x7a')](_0x45eb16)['compact']()[_0x3384('0x7b')]();return db['FaxQueue']['find']({'where':{'id':_0xfca560[_0x3384('0x4b')]['id']}})['then'](function(_0x5298d4){return db[_0x3384('0x68')][_0x3384('0x69')](function(_0x219b9e){return _0x5298d4[_0x3384('0x7c')](_0xfca560[_0x3384('0x34')][_0x3384('0x63')],{'transaction':_0x219b9e})[_0x3384('0x25')](function(){if(!_[_0x3384('0x7d')](_0x3e785a)){return _0x5298d4[_0x3384('0x7e')](_0x3e785a,{'transaction':_0x219b9e});}})['then'](function(){_0x3e785a[_0x3384('0x6c')](function(_0xfa056f){socket[_0x3384('0x6d')](_0x3384('0x7f'),{'UserId':_0xfa056f,'FaxQueueId':_0x5298d4['id']});});});});});});})['then'](respondWithStatusCode(_0x37e582,null))['catch'](handleError(_0x37e582,null));};exports[_0x3384('0x80')]=function(_0x1bc903,_0x3be20f,_0x41feb2){return db[_0x3384('0x2f')][_0x3384('0x4c')]({'where':{'id':_0x1bc903[_0x3384('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3be20f,null))[_0x3384('0x25')](function(_0x136bfc){if(_0x136bfc){return _0x136bfc[_0x3384('0x80')](_0x1bc903[_0x3384('0x4e')][_0x3384('0x63')],_[_0x3384('0x81')](_0x1bc903[_0x3384('0x4e')],[_0x3384('0x63'),'id'])||{})['spread'](function(_0x392618){for(var _0x272151=0x0;_0x272151<_0x1bc903[_0x3384('0x4e')][_0x3384('0x63')][_0x3384('0x3a')];_0x272151+=0x1){socket[_0x3384('0x6d')](_0x3384('0x82'),{'UserId':_0x1bc903[_0x3384('0x4e')][_0x3384('0x63')][_0x272151],'FaxQueueId':_0x1bc903[_0x3384('0x4b')]['id']});}return _0x392618;});}})[_0x3384('0x25')](respondWithResult(_0x3be20f,null))[_0x3384('0x49')](handleError(_0x3be20f,null));};exports[_0x3384('0x7e')]=function(_0x2804b8,_0x30b46b,_0x375296){return db[_0x3384('0x2f')][_0x3384('0x4c')]({'where':{'id':_0x2804b8[_0x3384('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30b46b,null))[_0x3384('0x25')](function(_0x2e0c6d){if(_0x2e0c6d){return _0x2e0c6d[_0x3384('0x7e')](_0x2804b8[_0x3384('0x34')][_0x3384('0x63')])[_0x3384('0x25')](function(){if(_['isArray'](_0x2804b8[_0x3384('0x34')][_0x3384('0x63')])){for(var _0x525bfb=0x0;_0x525bfb<_0x2804b8['query'][_0x3384('0x63')][_0x3384('0x3a')];_0x525bfb+=0x1){socket[_0x3384('0x6d')](_0x3384('0x7f'),{'UserId':Number(_0x2804b8['query']['ids'][_0x525bfb]),'FaxQueueId':Number(_0x2804b8[_0x3384('0x4b')]['id'])});}}else{socket[_0x3384('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x2804b8[_0x3384('0x34')][_0x3384('0x63')]),'FaxQueueId':Number(_0x2804b8[_0x3384('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x30b46b,null))['catch'](handleError(_0x30b46b,null));};exports[_0x3384('0x83')]=function(_0x3b22f4,_0xf283c8,_0x25ac2a){var _0x3ab516={};var _0x294165={};var _0x1ba392;var _0x5af073;return db['FaxQueue']['findOne']({'where':{'id':_0x3b22f4[_0x3384('0x4b')]['id']}})[_0x3384('0x25')](handleEntityNotFound(_0xf283c8,null))['then'](function(_0xb55297){if(_0xb55297){_0x1ba392=_0xb55297;_0x294165[_0x3384('0x37')]=_[_0x3384('0x35')](db[_0x3384('0x65')]['rawAttributes']);_0x294165[_0x3384('0x34')]=_[_0x3384('0x35')](_0x3b22f4[_0x3384('0x34')]);_0x294165[_0x3384('0x40')]=_[_0x3384('0x36')](_0x294165[_0x3384('0x37')],_0x294165['query']);_0x3ab516[_0x3384('0x39')]=_[_0x3384('0x36')](_0x294165[_0x3384('0x37')],qs[_0x3384('0x38')](_0x3b22f4[_0x3384('0x34')][_0x3384('0x38')]));_0x3ab516[_0x3384('0x39')]=_0x3ab516[_0x3384('0x39')][_0x3384('0x3a')]?_0x3ab516[_0x3384('0x39')]:_0x294165[_0x3384('0x37')];_0x3ab516[_0x3384('0x3d')]=qs[_0x3384('0x3e')](_0x3b22f4[_0x3384('0x34')][_0x3384('0x3e')]);_0x3ab516['where']=qs[_0x3384('0x40')](_[_0x3384('0x41')](_0x3b22f4[_0x3384('0x34')],_0x294165[_0x3384('0x40')]));if(_0x3b22f4[_0x3384('0x34')]['filter']){_0x3ab516[_0x3384('0x3f')]=_['merge'](_0x3ab516[_0x3384('0x3f')],{'$or':_[_0x3384('0x2e')](_0x3ab516['attributes'],function(_0x14c56b){var _0x1063ed={};_0x1063ed[_0x14c56b]={'$like':'%'+_0x3b22f4[_0x3384('0x34')][_0x3384('0x44')]+'%'};return _0x1063ed;})});}_0x3ab516=_[_0x3384('0x42')]({},_0x3ab516,_0x3b22f4[_0x3384('0x45')]);return _0x1ba392[_0x3384('0x83')](_0x3ab516);}})[_0x3384('0x25')](function(_0x57b7bd){if(_0x57b7bd){_0x5af073=_0x57b7bd['length'];if(!_0x3b22f4[_0x3384('0x34')]['hasOwnProperty'](_0x3384('0x3c'))){_0x3ab516[_0x3384('0x20')]=qs[_0x3384('0x20')](_0x3b22f4[_0x3384('0x34')][_0x3384('0x20')]);_0x3ab516[_0x3384('0x1f')]=qs[_0x3384('0x1f')](_0x3b22f4['query'][_0x3384('0x1f')]);}return _0x1ba392[_0x3384('0x83')](_0x3ab516);}})[_0x3384('0x25')](function(_0x18f8eb){if(_0x18f8eb){return _0x18f8eb?{'count':_0x5af073,'rows':_0x18f8eb}:null;}})[_0x3384('0x25')](respondWithResult(_0xf283c8,null))[_0x3384('0x49')](handleError(_0xf283c8,null));}; \ No newline at end of file +var _0x1775=['Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','FaxQueues','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','options','FaxQueue','includeAll','findAll','rows','show','params','length','catch','body','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','merge','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','SIP','getTeams'];(function(_0x4a7a9d,_0x1661b0){var _0x238cff=function(_0x5bcdeb){while(--_0x5bcdeb){_0x4a7a9d['push'](_0x4a7a9d['shift']());}};_0x238cff(++_0x1661b0);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5177('0x0'));var rimraf=require(_0x5177('0x1'));var zipdir=require(_0x5177('0x2'));var jsonpatch=require(_0x5177('0x3'));var rp=require(_0x5177('0x4'));var moment=require(_0x5177('0x5'));var BPromise=require(_0x5177('0x6'));var Mustache=require(_0x5177('0x7'));var util=require(_0x5177('0x8'));var path=require(_0x5177('0x9'));var sox=require(_0x5177('0xa'));var csv=require(_0x5177('0xb'));var ejs=require(_0x5177('0xc'));var fs=require('fs');var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xb'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var db=require(_0x5177('0x1a'))['db'];config[_0x5177('0x1b')]=_[_0x5177('0x1c')](config[_0x5177('0x1b')],{'host':_0x5177('0x1d'),'port':0x18eb});var socket=require(_0x5177('0x1e'))(new Redis(config[_0x5177('0x1b')]));require(_0x5177('0x1f'))[_0x5177('0x20')](socket);function respondWithStatusCode(_0x1eb9dd,_0x41bef4){_0x41bef4=_0x41bef4||0xcc;return function(_0x2bf5bb){if(_0x2bf5bb){return _0x1eb9dd[_0x5177('0x21')](_0x41bef4);}return _0x1eb9dd[_0x5177('0x22')](_0x41bef4)[_0x5177('0x23')]();};}function respondWithResult(_0x175ca6,_0x2ab5e5){_0x2ab5e5=_0x2ab5e5||0xc8;return function(_0x7dba6f){if(_0x7dba6f){return _0x175ca6[_0x5177('0x22')](_0x2ab5e5)['json'](_0x7dba6f);}};}function respondWithFilteredResult(_0x288e3f,_0x41e687){return function(_0x3f5ab5){if(_0x3f5ab5){var _0x1b4102=_0x3f5ab5[_0x5177('0x24')],_0x5f5bd4=_0x41e687['offset'],_0x3e6944=_0x41e687[_0x5177('0x25')]+_0x41e687['limit'],_0x2ebf91;if(_0x3e6944>=_0x1b4102){_0x3e6944=_0x1b4102;_0x2ebf91=0xc8;}else{_0x2ebf91=0xce;}_0x288e3f[_0x5177('0x22')](_0x2ebf91);return _0x288e3f[_0x5177('0x26')](_0x5177('0x27'),_0x5f5bd4+'-'+_0x3e6944+'/'+_0x1b4102)[_0x5177('0x28')](_0x3f5ab5);}return null;};}function patchUpdates(_0x451e5c){return function(_0x3314f2){try{jsonpatch[_0x5177('0x29')](_0x3314f2,_0x451e5c,!![]);}catch(_0xfc1bd4){return BPromise[_0x5177('0x2a')](_0xfc1bd4);}return _0x3314f2[_0x5177('0x2b')]();};}function saveUpdates(_0x23dad2,_0x3b0c37){return function(_0x5d9a9c){if(_0x5d9a9c){return _0x5d9a9c[_0x5177('0x2c')](_0x23dad2)['then'](function(_0x30b60f){return _0x30b60f;});}return null;};}function removeEntity(_0x2c68d8,_0x3b39b5){return function(_0x2d51d0){if(_0x2d51d0){return _0x2d51d0['destroy']()[_0x5177('0x2d')](function(){var _0x533409=_0x2d51d0['get']({'plain':!![]});var _0x19a0c2=_0x5177('0x2e');return db['UserProfileResource'][_0x5177('0x2f')]({'where':{'type':_0x19a0c2,'resourceId':_0x533409['id']}})['then'](function(){return _0x2d51d0;});})[_0x5177('0x2d')](function(){_0x2c68d8[_0x5177('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e021a,_0x2554ec){return function(_0x3c4248){if(!_0x3c4248){_0x3e021a[_0x5177('0x21')](0x194);}return _0x3c4248;};}function handleError(_0xe98ff1,_0x1cef5d){_0x1cef5d=_0x1cef5d||0x1f4;return function(_0x5577bb){logger['error'](_0x5577bb[_0x5177('0x30')]);if(_0x5577bb[_0x5177('0x31')]){delete _0x5577bb[_0x5177('0x31')];}_0xe98ff1[_0x5177('0x22')](_0x1cef5d)[_0x5177('0x32')](_0x5577bb);};}exports[_0x5177('0x33')]=function(_0x31eb9f,_0x72dced){var _0x49f6f1={},_0x42e1db={},_0x2233a2={'count':0x0,'rows':[]};var _0x4f3416=_[_0x5177('0x34')](db['FaxQueue'][_0x5177('0x35')],function(_0x1a2c46){return{'name':_0x1a2c46[_0x5177('0x36')],'type':_0x1a2c46['type']['key']};});_0x42e1db[_0x5177('0x37')]=_[_0x5177('0x34')](_0x4f3416,_0x5177('0x31'));_0x42e1db[_0x5177('0x38')]=_[_0x5177('0x39')](_0x31eb9f[_0x5177('0x38')]);_0x42e1db[_0x5177('0x3a')]=_[_0x5177('0x3b')](_0x42e1db['model'],_0x42e1db[_0x5177('0x38')]);_0x49f6f1[_0x5177('0x3c')]=_['intersection'](_0x42e1db[_0x5177('0x37')],qs[_0x5177('0x3d')](_0x31eb9f[_0x5177('0x38')][_0x5177('0x3d')]));_0x49f6f1[_0x5177('0x3c')]=_0x49f6f1[_0x5177('0x3c')]['length']?_0x49f6f1[_0x5177('0x3c')]:_0x42e1db[_0x5177('0x37')];if(!_0x31eb9f[_0x5177('0x38')][_0x5177('0x3e')](_0x5177('0x3f'))){_0x49f6f1[_0x5177('0x40')]=qs[_0x5177('0x40')](_0x31eb9f['query'][_0x5177('0x40')]);_0x49f6f1[_0x5177('0x25')]=qs['offset'](_0x31eb9f['query'][_0x5177('0x25')]);}_0x49f6f1[_0x5177('0x41')]=qs[_0x5177('0x42')](_0x31eb9f[_0x5177('0x38')][_0x5177('0x42')]);_0x49f6f1[_0x5177('0x43')]=qs[_0x5177('0x3a')](_[_0x5177('0x44')](_0x31eb9f[_0x5177('0x38')],_0x42e1db[_0x5177('0x3a')]),_0x4f3416);if(_0x31eb9f[_0x5177('0x38')][_0x5177('0x45')]){_0x49f6f1[_0x5177('0x43')]=_['merge'](_0x49f6f1[_0x5177('0x43')],{'$or':_[_0x5177('0x34')](_0x4f3416,function(_0x4e3677){if(_0x4e3677[_0x5177('0x46')]!=='VIRTUAL'){var _0x2d4d35={};_0x2d4d35[_0x4e3677[_0x5177('0x31')]]={'$like':'%'+_0x31eb9f[_0x5177('0x38')]['filter']+'%'};return _0x2d4d35;}})});}_0x49f6f1=_['merge']({},_0x49f6f1,_0x31eb9f[_0x5177('0x47')]);var _0x227654={'where':_0x49f6f1[_0x5177('0x43')]};return db[_0x5177('0x48')][_0x5177('0x24')](_0x227654)[_0x5177('0x2d')](function(_0x41d874){_0x2233a2[_0x5177('0x24')]=_0x41d874;if(_0x31eb9f['query'][_0x5177('0x49')]){_0x49f6f1['include']=[{'all':!![]}];}return db['FaxQueue'][_0x5177('0x4a')](_0x49f6f1);})[_0x5177('0x2d')](function(_0x5172f8){_0x2233a2[_0x5177('0x4b')]=_0x5172f8;return _0x2233a2;})['then'](respondWithFilteredResult(_0x72dced,_0x49f6f1))['catch'](handleError(_0x72dced,null));};exports[_0x5177('0x4c')]=function(_0x1769cd,_0x262c71){var _0x3776b8={'raw':!![],'where':{'id':_0x1769cd[_0x5177('0x4d')]['id']}},_0x191973={};_0x191973[_0x5177('0x37')]=_['keys'](db['FaxQueue'][_0x5177('0x35')]);_0x191973['query']=_[_0x5177('0x39')](_0x1769cd[_0x5177('0x38')]);_0x191973[_0x5177('0x3a')]=_[_0x5177('0x3b')](_0x191973['model'],_0x191973[_0x5177('0x38')]);_0x3776b8[_0x5177('0x3c')]=_[_0x5177('0x3b')](_0x191973[_0x5177('0x37')],qs[_0x5177('0x3d')](_0x1769cd[_0x5177('0x38')][_0x5177('0x3d')]));_0x3776b8[_0x5177('0x3c')]=_0x3776b8[_0x5177('0x3c')][_0x5177('0x4e')]?_0x3776b8[_0x5177('0x3c')]:_0x191973['model'];if(_0x1769cd[_0x5177('0x38')]['includeAll']){_0x3776b8['include']=[{'all':!![]}];}_0x3776b8=_['merge']({},_0x3776b8,_0x1769cd[_0x5177('0x47')]);return db[_0x5177('0x48')]['find'](_0x3776b8)[_0x5177('0x2d')](handleEntityNotFound(_0x262c71,null))[_0x5177('0x2d')](respondWithResult(_0x262c71,null))[_0x5177('0x4f')](handleError(_0x262c71,null));};exports['create']=function(_0x1d4ae4,_0x5981dc){return db['FaxQueue']['create'](_0x1d4ae4[_0x5177('0x50')],{})[_0x5177('0x2d')](function(_0x1300d7){var _0x5a1f8b=_0x1d4ae4['user'][_0x5177('0x51')]({'plain':!![]});if(!_0x5a1f8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a1f8b[_0x5177('0x52')]===_0x5177('0x53')){var _0x430e8e=_0x1300d7[_0x5177('0x51')]({'plain':!![]});var _0x84233c=_0x5177('0x2e');return db[_0x5177('0x54')][_0x5177('0x55')]({'where':{'name':_0x84233c,'userProfileId':_0x5a1f8b[_0x5177('0x56')]},'raw':!![]})[_0x5177('0x2d')](function(_0x89fe3a){if(_0x89fe3a&&_0x89fe3a[_0x5177('0x57')]===0x0){return db[_0x5177('0x58')]['create']({'name':_0x430e8e['name'],'resourceId':_0x430e8e['id'],'type':_0x89fe3a[_0x5177('0x31')],'sectionId':_0x89fe3a['id']},{})['then'](function(){return _0x1300d7;});}else{return _0x1300d7;}})[_0x5177('0x4f')](function(_0x49aba9){logger[_0x5177('0x59')](_0x5177('0x5a'),_0x49aba9);throw _0x49aba9;});}return _0x1300d7;})[_0x5177('0x2d')](respondWithResult(_0x5981dc,0xc9))['catch'](handleError(_0x5981dc,null));};exports['update']=function(_0x19884e,_0x43b5b9){if(_0x19884e[_0x5177('0x50')]['id']){delete _0x19884e[_0x5177('0x50')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x19884e[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x43b5b9,null))[_0x5177('0x2d')](saveUpdates(_0x19884e[_0x5177('0x50')],null))['then'](respondWithResult(_0x43b5b9,null))[_0x5177('0x4f')](handleError(_0x43b5b9,null));};exports[_0x5177('0x2f')]=function(_0x3a18ad,_0x589da8){return db[_0x5177('0x48')][_0x5177('0x55')]({'where':{'id':_0x3a18ad[_0x5177('0x4d')]['id']}})['then'](handleEntityNotFound(_0x589da8,null))[_0x5177('0x2d')](removeEntity(_0x589da8,null))['catch'](handleError(_0x589da8,null));};exports[_0x5177('0x5b')]=function(_0x39fb92,_0x3268bd){return db['FaxQueue'][_0x5177('0x5b')]()[_0x5177('0x2d')](respondWithResult(_0x3268bd,null))[_0x5177('0x4f')](handleError(_0x3268bd,null));};exports[_0x5177('0x5c')]=function(_0xc7a59e,_0x74589e,_0x37380c){var _0x267599={'raw':!![],'where':{}},_0x5ceed2={},_0x5d96ce;return db['FaxQueue'][_0x5177('0x5d')]({'where':{'id':_0xc7a59e[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x74589e,null))[_0x5177('0x2d')](function(_0x2472e9){if(_0x2472e9){_0x5d96ce=_0x2472e9[_0x5177('0x51')]({'plain':!![]});_0x5ceed2['model']=_['keys'](db[_0x5177('0x5e')][_0x5177('0x35')]);_0x5ceed2[_0x5177('0x38')]=_[_0x5177('0x39')](_0xc7a59e[_0x5177('0x38')]);_0x5ceed2[_0x5177('0x3a')]=_[_0x5177('0x3b')](_0x5ceed2[_0x5177('0x37')],_0x5ceed2[_0x5177('0x38')]);_0x267599['attributes']=_[_0x5177('0x3b')](_0x5ceed2[_0x5177('0x37')],qs['fields'](_0xc7a59e[_0x5177('0x38')][_0x5177('0x3d')]));_0x267599['attributes']=_0x267599[_0x5177('0x3c')][_0x5177('0x4e')]?_0x267599[_0x5177('0x3c')]:_0x5ceed2['model'];if(!_0xc7a59e[_0x5177('0x38')][_0x5177('0x3e')]('nolimit')){_0x267599['limit']=qs[_0x5177('0x40')](_0xc7a59e['query'][_0x5177('0x40')]);_0x267599['offset']=qs[_0x5177('0x25')](_0xc7a59e[_0x5177('0x38')]['offset']);}_0x267599[_0x5177('0x41')]=qs[_0x5177('0x42')](_0xc7a59e[_0x5177('0x38')][_0x5177('0x42')]);_0x267599[_0x5177('0x43')]=qs[_0x5177('0x3a')](_[_0x5177('0x44')](_0xc7a59e['query'],_0x5ceed2[_0x5177('0x3a')]));_0x267599['where']['FaxQueueId']=_0x2472e9['id'];if(_0xc7a59e[_0x5177('0x38')][_0x5177('0x45')]){_0x267599['where']=_[_0x5177('0x5f')](_0x267599[_0x5177('0x43')],{'$or':_[_0x5177('0x34')](_0x267599[_0x5177('0x3c')],function(_0x19b587){var _0x128cab={};_0x128cab[_0x19b587]={'$like':'%'+_0xc7a59e[_0x5177('0x38')][_0x5177('0x45')]+'%'};return _0x128cab;})});}_0x267599=_['merge']({},_0x267599,_0xc7a59e['options']);return db[_0x5177('0x5e')][_0x5177('0x4a')](_0x267599);}})[_0x5177('0x2d')](function(_0x2d24b3){if(_0x2d24b3){return db[_0x5177('0x60')][_0x5177('0x61')]({'where':{'id':_['map'](_0x2d24b3,_0x5177('0x62')),'role':_0x5177('0x63')},'attributes':['id',_0x5177('0x31'),_0x5177('0x64'),'updatedAt',_0x5177('0x65')]});}})[_0x5177('0x2d')](function(_0x124935){if(_0x124935){return{'count':_0x124935[_0x5177('0x24')],'rows':_[_0x5177('0x34')](_0x124935['rows'],function(_0x2734fc){return{'membername':_0x2734fc['name'],'UserId':_0x2734fc['id'],'queue_name':_0x5d96ce[_0x5177('0x31')],'FaxQueueId':_0x5d96ce['id'],'interface':util[_0x5177('0x66')]('%s/%s',_0x5177('0x67'),_0x2734fc[_0x5177('0x31')]),'penalty':0x0,'paused':_0x2734fc[_0x5177('0x64')],'createdAt':_0x2734fc[_0x5177('0x65')],'updatedAt':_0x2734fc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5177('0x2d')](respondWithFilteredResult(_0x74589e,_0x267599))[_0x5177('0x4f')](handleError(_0x74589e,null));};exports[_0x5177('0x68')]=function(_0x20fc85,_0x50485e,_0x16b85b){var _0x17456b={};var _0x3502dd={};var _0x4c8a15;var _0x54b87d;return db[_0x5177('0x48')][_0x5177('0x5d')]({'where':{'id':_0x20fc85[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x50485e,null))[_0x5177('0x2d')](function(_0x37ed49){if(_0x37ed49){_0x4c8a15=_0x37ed49;_0x3502dd[_0x5177('0x37')]=_[_0x5177('0x39')](db[_0x5177('0x69')]['rawAttributes']);_0x3502dd['query']=_['keys'](_0x20fc85[_0x5177('0x38')]);_0x3502dd['filters']=_[_0x5177('0x3b')](_0x3502dd[_0x5177('0x37')],_0x3502dd[_0x5177('0x38')]);_0x17456b[_0x5177('0x3c')]=_[_0x5177('0x3b')](_0x3502dd['model'],qs[_0x5177('0x3d')](_0x20fc85[_0x5177('0x38')][_0x5177('0x3d')]));_0x17456b['attributes']=_0x17456b[_0x5177('0x3c')]['length']?_0x17456b[_0x5177('0x3c')]:_0x3502dd[_0x5177('0x37')];_0x17456b['order']=qs[_0x5177('0x42')](_0x20fc85[_0x5177('0x38')]['sort']);_0x17456b['where']=qs[_0x5177('0x3a')](_['pick'](_0x20fc85[_0x5177('0x38')],_0x3502dd[_0x5177('0x3a')]));if(_0x20fc85['query'][_0x5177('0x45')]){_0x17456b[_0x5177('0x43')]=_[_0x5177('0x5f')](_0x17456b[_0x5177('0x43')],{'$or':_[_0x5177('0x34')](_0x17456b[_0x5177('0x3c')],function(_0xbc8f9f){var _0x10b062={};_0x10b062[_0xbc8f9f]={'$like':'%'+_0x20fc85['query'][_0x5177('0x45')]+'%'};return _0x10b062;})});}_0x17456b=_['merge']({},_0x17456b,_0x20fc85[_0x5177('0x47')]);return _0x4c8a15[_0x5177('0x68')](_0x17456b);}})[_0x5177('0x2d')](function(_0x2f9728){if(_0x2f9728){_0x54b87d=_0x2f9728['length'];if(!_0x20fc85[_0x5177('0x38')][_0x5177('0x3e')]('nolimit')){_0x17456b[_0x5177('0x40')]=qs[_0x5177('0x40')](_0x20fc85['query'][_0x5177('0x40')]);_0x17456b['offset']=qs[_0x5177('0x25')](_0x20fc85['query']['offset']);}return _0x4c8a15['getTeams'](_0x17456b);}})[_0x5177('0x2d')](function(_0x348da7){if(_0x348da7){return _0x348da7?{'count':_0x54b87d,'rows':_0x348da7}:null;}})[_0x5177('0x2d')](respondWithResult(_0x50485e,null))['catch'](handleError(_0x50485e,null));};exports[_0x5177('0x6a')]=function(_0x3473ef,_0x3adb47,_0x3b68b2){var _0x42446a=_0x3473ef['body'][_0x5177('0x6b')];return db[_0x5177('0x69')]['findAll']({'where':{'id':_0x42446a},'attributes':['id'],'include':[{'model':db[_0x5177('0x60')],'as':'Agents','attributes':['id',_0x5177('0x31'),'online',_0x5177('0x6c'),_0x5177('0x6d')],'raw':!![]}]})[_0x5177('0x2d')](function(_0x11cce2){if(_0x11cce2){var _0x3447b9=_[_0x5177('0x6e')](_0x11cce2,function(_0x4ba911){var _0x5ba4ef=_0x4ba911[_0x5177('0x51')]({'plain':!![]});return _0x5ba4ef[_0x5177('0x6f')];});return db[_0x5177('0x48')]['find']({'where':{'id':_0x3473ef[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](function(_0x4ee41d){return db[_0x5177('0x70')]['transaction'](function(_0x125b08){return _0x4ee41d[_0x5177('0x6a')](_0x42446a,{'transaction':_0x125b08})[_0x5177('0x2d')](function(){return BPromise['each'](_0x3447b9,function(_0x33b82b){return db['UserFaxQueue'][_0x5177('0x71')]({'where':{'UserId':_0x33b82b['id'],'FaxQueueId':_0x3473ef[_0x5177('0x4d')]['id']},'transaction':_0x125b08});});})['then'](function(){_0x3447b9['forEach'](function(_0x4a61da){socket[_0x5177('0x72')]('userFaxQueue:save',{'UserId':_0x4a61da['id'],'FaxQueueId':_0x4ee41d['id']});});});});});}})[_0x5177('0x2d')](respondWithStatusCode(_0x3adb47,null))[_0x5177('0x4f')](handleError(_0x3adb47,null));};exports[_0x5177('0x73')]=function(_0x57adf4,_0x5e4963,_0x5e870f){return db[_0x5177('0x69')][_0x5177('0x4a')]({'where':{'id':_0x57adf4[_0x5177('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5177('0x60')],'as':_0x5177('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e4963,null))[_0x5177('0x2d')](function(_0x526459){var _0x26fd12=_['map'](_0x526459,'id');var _0x4a0f8b=[];var _0x5910a8=[];var _0x3940dd=squel['select']();_0x3940dd[_0x5177('0x74')](_0x5177('0x75'))[_0x5177('0x76')](_0x5177('0x77'),'tq')[_0x5177('0x78')](_0x5177('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5177('0x43')](_0x5177('0x7a'),_0x57adf4['params']['id']);for(var _0x346a22=0x0;_0x346a22<_0x526459[_0x5177('0x4e')];_0x346a22+=0x1){let _0x1e64fa=_0x526459[_0x346a22];for(var _0x51f7ce=0x0;_0x51f7ce<_0x1e64fa['Agents']['length'];_0x51f7ce+=0x1){let _0x1a83d2=_0x1e64fa[_0x5177('0x6f')][_0x51f7ce];var _0x12591e=_0x3940dd[_0x5177('0x7b')]();_0x12591e[_0x5177('0x43')](_0x5177('0x7c'),_0x1a83d2['id']);_0x5910a8[_0x5177('0x7d')](db[_0x5177('0x70')][_0x5177('0x38')](_0x12591e[_0x5177('0x7e')](),{'type':db[_0x5177('0x70')][_0x5177('0x7f')]['SELECT']})[_0x5177('0x2d')](function(_0x5d05e8){if(_0x5d05e8[_0x5177('0x4e')]===0x1){return _0x1a83d2['id'];}else{var _0x42c345=_[_0x5177('0x80')](_['map'](_0x5d05e8,_0x5177('0x81')),function(_0x15f6bd){return _[_0x5177('0x82')](_0x26fd12,_0x15f6bd);});if(_0x42c345){return _0x1a83d2['id'];}}}));}}return BPromise[_0x5177('0x83')](_0x5910a8)[_0x5177('0x2d')](function(_0x17abe1){_0x4a0f8b=_(_0x4a0f8b)[_0x5177('0x84')](_0x17abe1)[_0x5177('0x85')]()['value']();return db['FaxQueue'][_0x5177('0x55')]({'where':{'id':_0x57adf4['params']['id']}})[_0x5177('0x2d')](function(_0xd443b2){return db['sequelize'][_0x5177('0x86')](function(_0x1fb680){return _0xd443b2['removeTeams'](_0x57adf4[_0x5177('0x38')][_0x5177('0x6b')],{'transaction':_0x1fb680})[_0x5177('0x2d')](function(){if(!_[_0x5177('0x87')](_0x4a0f8b)){return _0xd443b2[_0x5177('0x88')](_0x4a0f8b,{'transaction':_0x1fb680});}})[_0x5177('0x2d')](function(){_0x4a0f8b[_0x5177('0x89')](function(_0x7a67fb){socket[_0x5177('0x72')](_0x5177('0x8a'),{'UserId':_0x7a67fb,'FaxQueueId':_0xd443b2['id']});});});});});});})[_0x5177('0x2d')](respondWithStatusCode(_0x5e4963,null))[_0x5177('0x4f')](handleError(_0x5e4963,null));};exports[_0x5177('0x8b')]=function(_0x4f27ec,_0x174655,_0x20302d){return db[_0x5177('0x48')]['find']({'where':{'id':_0x4f27ec[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x174655,null))['then'](function(_0x15aa8a){if(_0x15aa8a){return _0x15aa8a['addAgents'](_0x4f27ec['body'][_0x5177('0x6b')],_[_0x5177('0x8c')](_0x4f27ec[_0x5177('0x50')],[_0x5177('0x6b'),'id'])||{})[_0x5177('0x8d')](function(_0x219a7c){for(var _0x56bd2b=0x0;_0x56bd2b<_0x4f27ec[_0x5177('0x50')][_0x5177('0x6b')]['length'];_0x56bd2b+=0x1){socket[_0x5177('0x72')](_0x5177('0x8e'),{'UserId':_0x4f27ec[_0x5177('0x50')][_0x5177('0x6b')][_0x56bd2b],'FaxQueueId':_0x4f27ec[_0x5177('0x4d')]['id']});}return _0x219a7c;});}})[_0x5177('0x2d')](respondWithResult(_0x174655,null))[_0x5177('0x4f')](handleError(_0x174655,null));};exports[_0x5177('0x88')]=function(_0x4e60b2,_0x193dbf,_0x566d71){return db[_0x5177('0x48')]['find']({'where':{'id':_0x4e60b2[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x193dbf,null))[_0x5177('0x2d')](function(_0x396e5c){if(_0x396e5c){return _0x396e5c['removeAgents'](_0x4e60b2[_0x5177('0x38')][_0x5177('0x6b')])[_0x5177('0x2d')](function(){if(_[_0x5177('0x8f')](_0x4e60b2['query']['ids'])){for(var _0x561e41=0x0;_0x561e41<_0x4e60b2['query'][_0x5177('0x6b')]['length'];_0x561e41+=0x1){socket[_0x5177('0x72')]('userFaxQueue:remove',{'UserId':Number(_0x4e60b2[_0x5177('0x38')]['ids'][_0x561e41]),'FaxQueueId':Number(_0x4e60b2[_0x5177('0x4d')]['id'])});}}else{socket[_0x5177('0x72')](_0x5177('0x8a'),{'UserId':Number(_0x4e60b2[_0x5177('0x38')][_0x5177('0x6b')]),'FaxQueueId':Number(_0x4e60b2[_0x5177('0x4d')]['id'])});}});}})[_0x5177('0x2d')](respondWithStatusCode(_0x193dbf,null))[_0x5177('0x4f')](handleError(_0x193dbf,null));};exports[_0x5177('0x90')]=function(_0x1845a6,_0x4d7ada,_0x1c8890){var _0x13fa90={};var _0x3475c3={};var _0x5ed46a;var _0x467638;return db[_0x5177('0x48')][_0x5177('0x5d')]({'where':{'id':_0x1845a6[_0x5177('0x4d')]['id']}})[_0x5177('0x2d')](handleEntityNotFound(_0x4d7ada,null))[_0x5177('0x2d')](function(_0x2e871b){if(_0x2e871b){_0x5ed46a=_0x2e871b;_0x3475c3[_0x5177('0x37')]=_[_0x5177('0x39')](db[_0x5177('0x60')][_0x5177('0x35')]);_0x3475c3['query']=_[_0x5177('0x39')](_0x1845a6[_0x5177('0x38')]);_0x3475c3[_0x5177('0x3a')]=_['intersection'](_0x3475c3[_0x5177('0x37')],_0x3475c3[_0x5177('0x38')]);_0x13fa90['attributes']=_[_0x5177('0x3b')](_0x3475c3[_0x5177('0x37')],qs[_0x5177('0x3d')](_0x1845a6['query'][_0x5177('0x3d')]));_0x13fa90[_0x5177('0x3c')]=_0x13fa90[_0x5177('0x3c')][_0x5177('0x4e')]?_0x13fa90[_0x5177('0x3c')]:_0x3475c3['model'];_0x13fa90['order']=qs[_0x5177('0x42')](_0x1845a6[_0x5177('0x38')]['sort']);_0x13fa90[_0x5177('0x43')]=qs[_0x5177('0x3a')](_['pick'](_0x1845a6[_0x5177('0x38')],_0x3475c3[_0x5177('0x3a')]));if(_0x1845a6['query']['filter']){_0x13fa90[_0x5177('0x43')]=_['merge'](_0x13fa90['where'],{'$or':_[_0x5177('0x34')](_0x13fa90[_0x5177('0x3c')],function(_0x58170f){var _0x303bf4={};_0x303bf4[_0x58170f]={'$like':'%'+_0x1845a6[_0x5177('0x38')][_0x5177('0x45')]+'%'};return _0x303bf4;})});}_0x13fa90=_[_0x5177('0x5f')]({},_0x13fa90,_0x1845a6[_0x5177('0x47')]);return _0x5ed46a[_0x5177('0x90')](_0x13fa90);}})['then'](function(_0x37f9ed){if(_0x37f9ed){_0x467638=_0x37f9ed['length'];if(!_0x1845a6['query'][_0x5177('0x3e')](_0x5177('0x3f'))){_0x13fa90[_0x5177('0x40')]=qs['limit'](_0x1845a6[_0x5177('0x38')][_0x5177('0x40')]);_0x13fa90[_0x5177('0x25')]=qs[_0x5177('0x25')](_0x1845a6[_0x5177('0x38')][_0x5177('0x25')]);}return _0x5ed46a[_0x5177('0x90')](_0x13fa90);}})[_0x5177('0x2d')](function(_0x153bb1){if(_0x153bb1){return _0x153bb1?{'count':_0x467638,'rows':_0x153bb1}:null;}})[_0x5177('0x2d')](respondWithResult(_0x4d7ada,null))[_0x5177('0x4f')](handleError(_0x4d7ada,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 66cef54..b7468ac 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 _0xdc27=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x34747e,_0x5962eb){var _0x24db6e=function(_0xc7a6da){while(--_0xc7a6da){_0x34747e['push'](_0x34747e['shift']());}};_0x24db6e(++_0x5962eb);}(_0xdc27,0x1ec));var _0x7dc2=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0xdc27[_0x48c4ef];return _0x435715;};'use strict';var EventEmitter=require(_0x7dc2('0x0'));var FaxQueue=require(_0x7dc2('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7dc2('0x2')](0x0);var events={'afterCreate':_0x7dc2('0x3'),'afterUpdate':_0x7dc2('0x4'),'afterDestroy':_0x7dc2('0x5')};function emitEvent(_0x4ec460){return function(_0x52bd67,_0x11f1b6,_0x16f2f1){FaxQueueEvents[_0x7dc2('0x6')](_0x4ec460+':'+_0x52bd67['id'],_0x52bd67);FaxQueueEvents['emit'](_0x4ec460,_0x52bd67);_0x16f2f1(null);};}for(var e in events){if(events[_0x7dc2('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x7dc2('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x86d3=['FaxQueue','setMaxListeners','save','update','emit','hasOwnProperty','events'];(function(_0x5b1dcc,_0x43b3b0){var _0x3c8fa9=function(_0xe70816){while(--_0xe70816){_0x5b1dcc['push'](_0x5b1dcc['shift']());}};_0x3c8fa9(++_0x43b3b0);}(_0x86d3,0xd1));var _0x386d=function(_0x15fab0,_0x416c7d){_0x15fab0=_0x15fab0-0x0;var _0x1b41a8=_0x86d3[_0x15fab0];return _0x1b41a8;};'use strict';var EventEmitter=require(_0x386d('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x386d('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x386d('0x2')](0x0);var events={'afterCreate':_0x386d('0x3'),'afterUpdate':_0x386d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d8949){return function(_0x25d223,_0x22b8ac,_0x40f71e){FaxQueueEvents[_0x386d('0x5')](_0x5d8949+':'+_0x25d223['id'],_0x25d223);FaxQueueEvents[_0x386d('0x5')](_0x5d8949,_0x25d223);_0x40f71e(null);};}for(var e in events){if(events[_0x386d('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 2e8dc6c..2d7e2b0 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 _0xa4dd=['define','FaxQueue','fax_queues','lodash','util','api','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0xc84c1d,_0x4f3d46){var _0x41afd7=function(_0x5d22ba){while(--_0x5d22ba){_0xc84c1d['push'](_0xc84c1d['shift']());}};_0x41afd7(++_0x4f3d46);}(_0xa4dd,0x9f));var _0xda4d=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0xa4dd[_0x41930d];return _0x455ade;};'use strict';var _=require(_0xda4d('0x0'));var util=require(_0xda4d('0x1'));var logger=require('../../config/logger')(_0xda4d('0x2'));var moment=require('moment');var BPromise=require(_0xda4d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda4d('0x4'));var rimraf=require(_0xda4d('0x5'));var config=require(_0xda4d('0x6'));var attributes=require(_0xda4d('0x7'));module[_0xda4d('0x8')]=function(_0x518f2c,_0x383dda){return _0x518f2c[_0xda4d('0x9')](_0xda4d('0xa'),attributes,{'tableName':_0xda4d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2652=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./faxQueue.attributes','exports','define'];(function(_0x36b9da,_0x580057){var _0x4c84ff=function(_0xae9a9f){while(--_0xae9a9f){_0x36b9da['push'](_0x36b9da['shift']());}};_0x4c84ff(++_0x580057);}(_0x2652,0x116));var _0x2265=function(_0x3bfb5b,_0x32c9b5){_0x3bfb5b=_0x3bfb5b-0x0;var _0x1d193f=_0x2652[_0x3bfb5b];return _0x1d193f;};'use strict';var _=require(_0x2265('0x0'));var util=require(_0x2265('0x1'));var logger=require(_0x2265('0x2'))(_0x2265('0x3'));var moment=require(_0x2265('0x4'));var BPromise=require(_0x2265('0x5'));var rp=require(_0x2265('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2265('0x7'));module[_0x2265('0x8')]=function(_0x215929,_0x446ab9){return _0x215929[_0x2265('0x9')](_0x2265('0xa'),attributes,{'tableName':_0x2265('0xb'),'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 8f28f7f..3860ebb 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 _0xd152=['catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xd152,0x124));var _0x2d15=function(_0x34c22c,_0xf4377a){_0x34c22c=_0x34c22c-0x0;var _0x10731f=_0xd152[_0x34c22c];return _0x10731f;};'use strict';var _=require(_0x2d15('0x0'));var util=require(_0x2d15('0x1'));var moment=require(_0x2d15('0x2'));var BPromise=require(_0x2d15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d15('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d15('0x5'));var logger=require(_0x2d15('0x6'))(_0x2d15('0x7'));var config=require('../../config/environment');var jayson=require(_0x2d15('0x8'));var client=jayson[_0x2d15('0x9')][_0x2d15('0xa')]({'port':0x232a});config[_0x2d15('0xb')]=_[_0x2d15('0xc')](config['redis'],{'host':_0x2d15('0xd'),'port':0x18eb});var socket=require(_0x2d15('0xe'))(new Redis(config[_0x2d15('0xb')]));require('./faxQueue.socket')[_0x2d15('0xf')](socket);function respondWithRpcPromise(_0x22921a,_0x356919,_0x1f480b){return new BPromise(function(_0x244be5,_0x1a2c36){return client[_0x2d15('0x10')](_0x22921a,_0x1f480b)[_0x2d15('0x11')](function(_0x41dd6c){logger[_0x2d15('0x12')](_0x2d15('0x13'),_0x356919,_0x2d15('0x14'));logger[_0x2d15('0x15')](_0x2d15('0x16'),_0x356919,_0x2d15('0x14'),JSON[_0x2d15('0x17')](_0x41dd6c));if(_0x41dd6c[_0x2d15('0x18')]){if(_0x41dd6c[_0x2d15('0x18')][_0x2d15('0x19')]===0x1f4){logger[_0x2d15('0x18')](_0x2d15('0x13'),_0x356919,_0x41dd6c[_0x2d15('0x18')][_0x2d15('0x1a')]);return _0x1a2c36(_0x41dd6c[_0x2d15('0x18')][_0x2d15('0x1a')]);}logger[_0x2d15('0x18')](_0x2d15('0x13'),_0x356919,_0x41dd6c['error']['message']);return _0x244be5(_0x41dd6c[_0x2d15('0x18')][_0x2d15('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x356919,_0x2d15('0x14'));_0x244be5(_0x41dd6c[_0x2d15('0x1b')][_0x2d15('0x1a')]);}})[_0x2d15('0x1c')](function(_0x233ad9){logger[_0x2d15('0x18')](_0x2d15('0x13'),_0x356919,_0x233ad9);_0x1a2c36(_0x233ad9);});});}exports[_0x2d15('0x1d')]=function(_0x2a5a65){var _0xf631c8=this;return new Promise(function(_0xe5c297,_0x42c242){return db[_0x2d15('0x1e')]['findAll']({'raw':_0x2a5a65[_0x2d15('0x1f')]?_0x2a5a65[_0x2d15('0x1f')][_0x2d15('0x20')]===undefined?!![]:![]:!![],'where':_0x2a5a65[_0x2d15('0x1f')]?_0x2a5a65[_0x2d15('0x1f')][_0x2d15('0x21')]||null:null,'attributes':_0x2a5a65[_0x2d15('0x1f')]?_0x2a5a65['options'][_0x2d15('0x22')]||null:null,'limit':_0x2a5a65[_0x2d15('0x1f')]?_0x2a5a65[_0x2d15('0x1f')][_0x2d15('0x23')]||null:null,'include':_0x2a5a65[_0x2d15('0x1f')]?_0x2a5a65[_0x2d15('0x1f')]['include']?_[_0x2d15('0x24')](_0x2a5a65[_0x2d15('0x1f')]['include'],function(_0x36c64a){return{'model':db[_0x36c64a['model']],'as':_0x36c64a['as'],'attributes':_0x36c64a['attributes'],'include':_0x36c64a[_0x2d15('0x25')]?_['map'](_0x36c64a['include'],function(_0x495df4){return{'model':db[_0x495df4[_0x2d15('0x26')]],'as':_0x495df4['as'],'attributes':_0x495df4['attributes'],'include':_0x495df4[_0x2d15('0x25')]?_['map'](_0x495df4['include'],function(_0x481004){return{'model':db[_0x481004[_0x2d15('0x26')]],'as':_0x481004['as'],'attributes':_0x481004[_0x2d15('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b4c26){logger[_0x2d15('0x12')](_0x2d15('0x1d'),_0x2a5a65);logger[_0x2d15('0x15')](_0x2d15('0x1d'),_0x2a5a65,JSON[_0x2d15('0x17')](_0x1b4c26));_0xe5c297(_0x1b4c26);})[_0x2d15('0x1c')](function(_0x4f3658){logger[_0x2d15('0x18')](_0x2d15('0x1d'),_0x4f3658['message'],_0x2a5a65);_0x42c242(_0xf631c8['error'](0x1f4,_0x4f3658['message']));});});};exports[_0x2d15('0x27')]=function(_0x158c95){var _0x50cc8a=this;return new Promise(function(_0x104ae7,_0x25114d){return db[_0x2d15('0x1e')]['find']({'raw':_0x158c95['options']?_0x158c95[_0x2d15('0x1f')][_0x2d15('0x20')]===undefined?!![]:![]:!![],'where':_0x158c95['options']?_0x158c95[_0x2d15('0x1f')][_0x2d15('0x21')]||null:null,'attributes':_0x158c95[_0x2d15('0x1f')]?_0x158c95[_0x2d15('0x1f')][_0x2d15('0x22')]||null:null,'include':_0x158c95[_0x2d15('0x1f')]?_0x158c95[_0x2d15('0x1f')][_0x2d15('0x25')]?_[_0x2d15('0x24')](_0x158c95[_0x2d15('0x1f')]['include'],function(_0x4c4fb4){return{'model':db[_0x4c4fb4['model']],'as':_0x4c4fb4['as'],'attributes':_0x4c4fb4[_0x2d15('0x22')],'include':_0x4c4fb4[_0x2d15('0x25')]?_['map'](_0x4c4fb4[_0x2d15('0x25')],function(_0x485f42){return{'model':db[_0x485f42[_0x2d15('0x26')]],'as':_0x485f42['as'],'attributes':_0x485f42[_0x2d15('0x22')],'include':_0x485f42['include']?_[_0x2d15('0x24')](_0x485f42[_0x2d15('0x25')],function(_0x17842d){return{'model':db[_0x17842d[_0x2d15('0x26')]],'as':_0x17842d['as'],'attributes':_0x17842d[_0x2d15('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x293e1b){logger[_0x2d15('0x12')]('ShowFaxQueue',_0x158c95);logger[_0x2d15('0x15')]('ShowFaxQueue',_0x158c95,JSON[_0x2d15('0x17')](_0x293e1b));_0x104ae7(_0x293e1b);})['catch'](function(_0x428f3c){logger['error']('ShowFaxQueue',_0x428f3c['message'],_0x158c95);_0x25114d(_0x50cc8a[_0x2d15('0x18')](0x1f4,_0x428f3c[_0x2d15('0x1a')]));});});}; \ No newline at end of file +var _0xee53=['client','localhost','socket.io-emitter','redis','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','map','attributes','ShowFaxQueue','find','raw','model','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a5578,_0x4efc52){var _0x19eebc=function(_0x57b5cd){while(--_0x57b5cd){_0x4a5578['push'](_0x4a5578['shift']());}};_0x19eebc(++_0x4efc52);}(_0xee53,0x1d7));var _0x3ee5=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0xee53[_0x587693];return _0x510a1a;};'use strict';var _=require(_0x3ee5('0x0'));var util=require(_0x3ee5('0x1'));var moment=require(_0x3ee5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ee5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3ee5('0x4'));var logger=require(_0x3ee5('0x5'))(_0x3ee5('0x6'));var config=require(_0x3ee5('0x7'));var jayson=require(_0x3ee5('0x8'));var client=jayson[_0x3ee5('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x3ee5('0xa'),'port':0x18eb});var socket=require(_0x3ee5('0xb'))(new Redis(config[_0x3ee5('0xc')]));require(_0x3ee5('0xd'))[_0x3ee5('0xe')](socket);function respondWithRpcPromise(_0xd4c754,_0x41ee16,_0x930de7){return new BPromise(function(_0xf1d77,_0x439b3e){return client[_0x3ee5('0xf')](_0xd4c754,_0x930de7)[_0x3ee5('0x10')](function(_0x5daaae){logger['info'](_0x3ee5('0x11'),_0x41ee16,_0x3ee5('0x12'));logger[_0x3ee5('0x13')](_0x3ee5('0x14'),_0x41ee16,'request\x20sent',JSON['stringify'](_0x5daaae));if(_0x5daaae[_0x3ee5('0x15')]){if(_0x5daaae[_0x3ee5('0x15')]['code']===0x1f4){logger['error'](_0x3ee5('0x11'),_0x41ee16,_0x5daaae[_0x3ee5('0x15')][_0x3ee5('0x16')]);return _0x439b3e(_0x5daaae[_0x3ee5('0x15')]['message']);}logger['error'](_0x3ee5('0x11'),_0x41ee16,_0x5daaae['error'][_0x3ee5('0x16')]);return _0xf1d77(_0x5daaae[_0x3ee5('0x15')]['message']);}else{logger[_0x3ee5('0x17')](_0x3ee5('0x11'),_0x41ee16,'request\x20sent');_0xf1d77(_0x5daaae[_0x3ee5('0x18')][_0x3ee5('0x16')]);}})[_0x3ee5('0x19')](function(_0x430b76){logger['error'](_0x3ee5('0x11'),_0x41ee16,_0x430b76);_0x439b3e(_0x430b76);});});}exports[_0x3ee5('0x1a')]=function(_0x56b43b){var _0x16fb49=this;return new Promise(function(_0x357aa8,_0x4b2627){return db[_0x3ee5('0x1b')][_0x3ee5('0x1c')]({'raw':_0x56b43b[_0x3ee5('0x1d')]?_0x56b43b[_0x3ee5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x56b43b['options']?_0x56b43b[_0x3ee5('0x1d')][_0x3ee5('0x1e')]||null:null,'attributes':_0x56b43b['options']?_0x56b43b[_0x3ee5('0x1d')]['attributes']||null:null,'limit':_0x56b43b[_0x3ee5('0x1d')]?_0x56b43b['options'][_0x3ee5('0x1f')]||null:null,'include':_0x56b43b['options']?_0x56b43b['options'][_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x56b43b[_0x3ee5('0x1d')][_0x3ee5('0x20')],function(_0x43165a){return{'model':db[_0x43165a['model']],'as':_0x43165a['as'],'attributes':_0x43165a['attributes'],'include':_0x43165a[_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x43165a[_0x3ee5('0x20')],function(_0x2daafb){return{'model':db[_0x2daafb['model']],'as':_0x2daafb['as'],'attributes':_0x2daafb['attributes'],'include':_0x2daafb[_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x2daafb[_0x3ee5('0x20')],function(_0x3041b1){return{'model':db[_0x3041b1['model']],'as':_0x3041b1['as'],'attributes':_0x3041b1[_0x3ee5('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3ee5('0x10')](function(_0xa9f139){logger['info'](_0x3ee5('0x1a'),_0x56b43b);logger['debug'](_0x3ee5('0x1a'),_0x56b43b,JSON['stringify'](_0xa9f139));_0x357aa8(_0xa9f139);})[_0x3ee5('0x19')](function(_0x19ebf9){logger[_0x3ee5('0x15')](_0x3ee5('0x1a'),_0x19ebf9['message'],_0x56b43b);_0x4b2627(_0x16fb49['error'](0x1f4,_0x19ebf9['message']));});});};exports[_0x3ee5('0x23')]=function(_0x42bdee){var _0x2a84b9=this;return new Promise(function(_0x293bfa,_0x4f035b){return db[_0x3ee5('0x1b')][_0x3ee5('0x24')]({'raw':_0x42bdee[_0x3ee5('0x1d')]?_0x42bdee['options'][_0x3ee5('0x25')]===undefined?!![]:![]:!![],'where':_0x42bdee[_0x3ee5('0x1d')]?_0x42bdee[_0x3ee5('0x1d')][_0x3ee5('0x1e')]||null:null,'attributes':_0x42bdee[_0x3ee5('0x1d')]?_0x42bdee[_0x3ee5('0x1d')][_0x3ee5('0x22')]||null:null,'include':_0x42bdee[_0x3ee5('0x1d')]?_0x42bdee[_0x3ee5('0x1d')][_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x42bdee['options'][_0x3ee5('0x20')],function(_0x41779e){return{'model':db[_0x41779e[_0x3ee5('0x26')]],'as':_0x41779e['as'],'attributes':_0x41779e[_0x3ee5('0x22')],'include':_0x41779e[_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x41779e[_0x3ee5('0x20')],function(_0x4810c2){return{'model':db[_0x4810c2[_0x3ee5('0x26')]],'as':_0x4810c2['as'],'attributes':_0x4810c2[_0x3ee5('0x22')],'include':_0x4810c2[_0x3ee5('0x20')]?_[_0x3ee5('0x21')](_0x4810c2['include'],function(_0x465495){return{'model':db[_0x465495[_0x3ee5('0x26')]],'as':_0x465495['as'],'attributes':_0x465495[_0x3ee5('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3ee5('0x10')](function(_0x53f78a){logger['info'](_0x3ee5('0x23'),_0x42bdee);logger[_0x3ee5('0x13')](_0x3ee5('0x23'),_0x42bdee,JSON[_0x3ee5('0x27')](_0x53f78a));_0x293bfa(_0x53f78a);})[_0x3ee5('0x19')](function(_0x5d7f98){logger[_0x3ee5('0x15')](_0x3ee5('0x23'),_0x5d7f98[_0x3ee5('0x16')],_0x42bdee);_0x4f035b(_0x2a84b9[_0x3ee5('0x15')](0x1f4,_0x5d7f98['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a1f50b8..5a2782f 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 _0x37af=['update','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x584267,_0x3dbe07){var _0x224516=function(_0x2e5f28){while(--_0x2e5f28){_0x584267['push'](_0x584267['shift']());}};_0x224516(++_0x3dbe07);}(_0x37af,0x1e9));var _0xf37a=function(_0x3de4d4,_0x5b21e2){_0x3de4d4=_0x3de4d4-0x0;var _0x304dac=_0x37af[_0x3de4d4];return _0x304dac;};'use strict';var FaxQueueEvents=require(_0xf37a('0x0'));var events=[_0xf37a('0x1'),_0xf37a('0x2'),_0xf37a('0x3')];function createListener(_0x994dae,_0x11820e){return function(_0x564a5c){_0x11820e['emit'](_0x994dae,_0x564a5c);};}function removeListener(_0x241e84,_0x3c88b1){return function(){FaxQueueEvents['removeListener'](_0x241e84,_0x3c88b1);};}exports['register']=function(_0x17b9bc){for(var _0x5e646f=0x0,_0x5a6ce1=events[_0xf37a('0x4')];_0x5e646f<_0x5a6ce1;_0x5e646f++){var _0x3bc605=events[_0x5e646f];var _0x7eb0f8=createListener(_0xf37a('0x5')+_0x3bc605,_0x17b9bc);FaxQueueEvents['on'](_0x3bc605,_0x7eb0f8);}}; \ No newline at end of file +var _0x47cb=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x1622a0,_0x2b55a9){var _0x2a2308=function(_0x38d05b){while(--_0x38d05b){_0x1622a0['push'](_0x1622a0['shift']());}};_0x2a2308(++_0x2b55a9);}(_0x47cb,0xd6));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xb47c('0x0'));var events=[_0xb47c('0x1'),'remove',_0xb47c('0x2')];function createListener(_0x513b65,_0x5b42b1){return function(_0x37f4f5){_0x5b42b1[_0xb47c('0x3')](_0x513b65,_0x37f4f5);};}function removeListener(_0x1c8c18,_0x549858){return function(){FaxQueueEvents[_0xb47c('0x4')](_0x1c8c18,_0x549858);};}exports[_0xb47c('0x5')]=function(_0x1337f2){for(var _0x739d13=0x0,_0x46f5d6=events[_0xb47c('0x6')];_0x739d13<_0x46f5d6;_0x739d13++){var _0x34246a=events[_0x739d13];var _0x497442=createListener(_0xb47c('0x7')+_0x34246a,_0x1337f2);FaxQueueEvents['on'](_0x34246a,_0x497442);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 94391e8..e11095e 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 _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x411428,_0x986e54){var _0x50f873=function(_0x48da50){while(--_0x48da50){_0x411428['push'](_0x411428['shift']());}};_0x50f873(++_0x986e54);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb10b,0x12a));var _0xbb10=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0xb10b[_0x4e1d3c];return _0x5177b2;};'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['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 5b93596..7b150bd 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 _0x0779=['DATE','moment','sequelize','STRING'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x0779,0x14d));var _0x9077=function(_0x4579df,_0x2954ec){_0x4579df=_0x4579df-0x0;var _0x26b889=_0x0779[_0x4579df];return _0x26b889;};'use strict';var moment=require(_0x9077('0x0'));var Sequelize=require(_0x9077('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9077('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9077('0x2')]},'joinAt':{'type':Sequelize[_0x9077('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9077('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9077('0x2')]}}; \ No newline at end of file +var _0x2f0f=['STRING','DATE'];(function(_0x5d5aa1,_0x3e4aaf){var _0x39f9d5=function(_0xc3bfb4){while(--_0xc3bfb4){_0x5d5aa1['push'](_0x5d5aa1['shift']());}};_0x39f9d5(++_0x3e4aaf);}(_0x2f0f,0x182));var _0xf2f0=function(_0x290c78,_0x406c3d){_0x290c78=_0x290c78-0x0;var _0x5d5bf5=_0x2f0f[_0x290c78];return _0x5d5bf5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf2f0('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf2f0('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf2f0('0x1')]},'reason':{'type':Sequelize[_0xf2f0('0x0')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index af1b92d..3839207 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 _0xc59d=['FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','then','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc59d,0xb6));var _0xdc59=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc59d[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xdc59('0x0'));var emlformat=require(_0xdc59('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdc59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdc59('0x3'));var BPromise=require(_0xdc59('0x4'));var Mustache=require(_0xdc59('0x5'));var util=require(_0xdc59('0x6'));var path=require(_0xdc59('0x7'));var sox=require(_0xdc59('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc59('0x9'));var squel=require(_0xdc59('0xa'));var crypto=require('crypto');var jsforce=require(_0xdc59('0xb'));var deskjs=require(_0xdc59('0xc'));var toCsv=require(_0xdc59('0xd'));var querystring=require(_0xdc59('0xe'));var Papa=require(_0xdc59('0xf'));var Redis=require(_0xdc59('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdc59('0x11'));var as=require(_0xdc59('0x12'));var hardwareService=require(_0xdc59('0x13'));var logger=require(_0xdc59('0x14'))(_0xdc59('0x15'));var utils=require(_0xdc59('0x16'));var config=require(_0xdc59('0x17'));var db=require(_0xdc59('0x18'))['db'];function respondWithStatusCode(_0x536f1b,_0x18f4db){_0x18f4db=_0x18f4db||0xcc;return function(_0x42262c){if(_0x42262c){return _0x536f1b[_0xdc59('0x19')](_0x18f4db);}return _0x536f1b[_0xdc59('0x1a')](_0x18f4db)[_0xdc59('0x1b')]();};}function respondWithResult(_0x4ae1a9,_0x3b1428){_0x3b1428=_0x3b1428||0xc8;return function(_0x1a6257){if(_0x1a6257){return _0x4ae1a9[_0xdc59('0x1a')](_0x3b1428)['json'](_0x1a6257);}};}function respondWithFilteredResult(_0x48cd9c,_0x522a0e){return function(_0x2a4686){if(_0x2a4686){var _0xc42ef4=_0x2a4686[_0xdc59('0x1c')],_0x435e1c=_0x522a0e[_0xdc59('0x1d')],_0x2c99a7=_0x522a0e[_0xdc59('0x1d')]+_0x522a0e[_0xdc59('0x1e')],_0xfdd82c;if(_0x2c99a7>=_0xc42ef4){_0x2c99a7=_0xc42ef4;_0xfdd82c=0xc8;}else{_0xfdd82c=0xce;}_0x48cd9c[_0xdc59('0x1a')](_0xfdd82c);return _0x48cd9c['set'](_0xdc59('0x1f'),_0x435e1c+'-'+_0x2c99a7+'/'+_0xc42ef4)['json'](_0x2a4686);}return null;};}function patchUpdates(_0x776336){return function(_0x4a809b){try{jsonpatch[_0xdc59('0x20')](_0x4a809b,_0x776336,!![]);}catch(_0x171dd7){return BPromise[_0xdc59('0x21')](_0x171dd7);}return _0x4a809b[_0xdc59('0x22')]();};}function saveUpdates(_0xf92b33,_0x3c19d9){return function(_0x542a74){if(_0x542a74){return _0x542a74[_0xdc59('0x23')](_0xf92b33)['then'](function(_0x24b6f2){return _0x24b6f2;});}return null;};}function removeEntity(_0x3e42bd,_0x33a82a){return function(_0x59e71a){if(_0x59e71a){return _0x59e71a[_0xdc59('0x24')]()['then'](function(){_0x3e42bd[_0xdc59('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b5fa,_0x2e77c6){return function(_0x42b7fa){if(!_0x42b7fa){_0x16b5fa[_0xdc59('0x19')](0x194);}return _0x42b7fa;};}function handleError(_0x1f979b,_0x26cd64){_0x26cd64=_0x26cd64||0x1f4;return function(_0x5aaa7c){logger[_0xdc59('0x25')](_0x5aaa7c[_0xdc59('0x26')]);if(_0x5aaa7c[_0xdc59('0x27')]){delete _0x5aaa7c[_0xdc59('0x27')];}_0x1f979b['status'](_0x26cd64)[_0xdc59('0x28')](_0x5aaa7c);};}exports[_0xdc59('0x29')]=function(_0x47fba8,_0x456f13){var _0x3b86fb={},_0x1ea72f={},_0x450b02={'count':0x0,'rows':[]};var _0x2bbc7e=_[_0xdc59('0x2a')](db[_0xdc59('0x2b')][_0xdc59('0x2c')],function(_0x1f6eb2){return{'name':_0x1f6eb2[_0xdc59('0x2d')],'type':_0x1f6eb2[_0xdc59('0x2e')][_0xdc59('0x2f')]};});_0x1ea72f[_0xdc59('0x30')]=_[_0xdc59('0x2a')](_0x2bbc7e,_0xdc59('0x27'));_0x1ea72f['query']=_[_0xdc59('0x31')](_0x47fba8[_0xdc59('0x32')]);_0x1ea72f['filters']=_[_0xdc59('0x33')](_0x1ea72f[_0xdc59('0x30')],_0x1ea72f[_0xdc59('0x32')]);_0x3b86fb[_0xdc59('0x34')]=_[_0xdc59('0x33')](_0x1ea72f[_0xdc59('0x30')],qs[_0xdc59('0x35')](_0x47fba8['query'][_0xdc59('0x35')]));_0x3b86fb[_0xdc59('0x34')]=_0x3b86fb[_0xdc59('0x34')][_0xdc59('0x36')]?_0x3b86fb[_0xdc59('0x34')]:_0x1ea72f[_0xdc59('0x30')];if(!_0x47fba8[_0xdc59('0x32')]['hasOwnProperty']('nolimit')){_0x3b86fb[_0xdc59('0x1e')]=qs[_0xdc59('0x1e')](_0x47fba8[_0xdc59('0x32')]['limit']);_0x3b86fb[_0xdc59('0x1d')]=qs[_0xdc59('0x1d')](_0x47fba8[_0xdc59('0x32')]['offset']);}_0x3b86fb[_0xdc59('0x37')]=qs[_0xdc59('0x38')](_0x47fba8[_0xdc59('0x32')][_0xdc59('0x38')]);_0x3b86fb[_0xdc59('0x39')]=qs[_0xdc59('0x3a')](_[_0xdc59('0x3b')](_0x47fba8[_0xdc59('0x32')],_0x1ea72f[_0xdc59('0x3a')]),_0x2bbc7e);if(_0x47fba8[_0xdc59('0x32')][_0xdc59('0x3c')]){_0x3b86fb[_0xdc59('0x39')]=_[_0xdc59('0x3d')](_0x3b86fb[_0xdc59('0x39')],{'$or':_['map'](_0x2bbc7e,function(_0x95fbcf){if(_0x95fbcf['type']!==_0xdc59('0x3e')){var _0x402471={};_0x402471[_0x95fbcf['name']]={'$like':'%'+_0x47fba8[_0xdc59('0x32')][_0xdc59('0x3c')]+'%'};return _0x402471;}})});}_0x3b86fb=_[_0xdc59('0x3d')]({},_0x3b86fb,_0x47fba8[_0xdc59('0x3f')]);var _0xbaa587={'where':_0x3b86fb[_0xdc59('0x39')]};return db[_0xdc59('0x2b')]['count'](_0xbaa587)['then'](function(_0x44fbda){_0x450b02['count']=_0x44fbda;if(_0x47fba8[_0xdc59('0x32')]['includeAll']){_0x3b86fb['include']=[{'all':!![]}];}return db[_0xdc59('0x2b')][_0xdc59('0x40')](_0x3b86fb);})[_0xdc59('0x41')](function(_0x5c3e2b){_0x450b02[_0xdc59('0x42')]=_0x5c3e2b;return _0x450b02;})['then'](respondWithFilteredResult(_0x456f13,_0x3b86fb))[_0xdc59('0x43')](handleError(_0x456f13,null));};exports[_0xdc59('0x44')]=function(_0x23c569,_0x2dac5f){var _0x4842d7={'raw':!![],'where':{'id':_0x23c569[_0xdc59('0x45')]['id']}},_0x1176b4={};_0x1176b4[_0xdc59('0x30')]=_['keys'](db[_0xdc59('0x2b')][_0xdc59('0x2c')]);_0x1176b4[_0xdc59('0x32')]=_[_0xdc59('0x31')](_0x23c569[_0xdc59('0x32')]);_0x1176b4[_0xdc59('0x3a')]=_['intersection'](_0x1176b4['model'],_0x1176b4['query']);_0x4842d7[_0xdc59('0x34')]=_['intersection'](_0x1176b4[_0xdc59('0x30')],qs[_0xdc59('0x35')](_0x23c569[_0xdc59('0x32')][_0xdc59('0x35')]));_0x4842d7[_0xdc59('0x34')]=_0x4842d7['attributes'][_0xdc59('0x36')]?_0x4842d7[_0xdc59('0x34')]:_0x1176b4['model'];if(_0x23c569[_0xdc59('0x32')]['includeAll']){_0x4842d7[_0xdc59('0x46')]=[{'all':!![]}];}_0x4842d7=_[_0xdc59('0x3d')]({},_0x4842d7,_0x23c569[_0xdc59('0x3f')]);return db[_0xdc59('0x2b')][_0xdc59('0x47')](_0x4842d7)[_0xdc59('0x41')](handleEntityNotFound(_0x2dac5f,null))['then'](respondWithResult(_0x2dac5f,null))[_0xdc59('0x43')](handleError(_0x2dac5f,null));};exports[_0xdc59('0x48')]=function(_0x13da83,_0x1a7852){return db[_0xdc59('0x2b')]['create'](_0x13da83[_0xdc59('0x49')],{})[_0xdc59('0x41')](respondWithResult(_0x1a7852,0xc9))[_0xdc59('0x43')](handleError(_0x1a7852,null));};exports[_0xdc59('0x23')]=function(_0x5c9def,_0x579661){if(_0x5c9def['body']['id']){delete _0x5c9def[_0xdc59('0x49')]['id'];}return db[_0xdc59('0x2b')][_0xdc59('0x47')]({'where':{'id':_0x5c9def[_0xdc59('0x45')]['id']}})['then'](handleEntityNotFound(_0x579661,null))[_0xdc59('0x41')](saveUpdates(_0x5c9def[_0xdc59('0x49')],null))['then'](respondWithResult(_0x579661,null))[_0xdc59('0x43')](handleError(_0x579661,null));};exports[_0xdc59('0x24')]=function(_0x2beb17,_0x27d44a){return db[_0xdc59('0x2b')]['find']({'where':{'id':_0x2beb17[_0xdc59('0x45')]['id']}})[_0xdc59('0x41')](handleEntityNotFound(_0x27d44a,null))[_0xdc59('0x41')](removeEntity(_0x27d44a,null))['catch'](handleError(_0x27d44a,null));};exports[_0xdc59('0x4a')]=function(_0x371236,_0x3987ca){return db[_0xdc59('0x2b')][_0xdc59('0x4a')]()[_0xdc59('0x41')](respondWithResult(_0x3987ca,null))[_0xdc59('0x43')](handleError(_0x3987ca,null));}; \ No newline at end of file +var _0x56b2=['stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','save','then','sendStatus','error'];(function(_0x5fc355,_0x5c1953){var _0x129e43=function(_0x357969){while(--_0x357969){_0x5fc355['push'](_0x5fc355['shift']());}};_0x129e43(++_0x5c1953);}(_0x56b2,0x142));var _0x256b=function(_0x5d5727,_0x4297e0){_0x5d5727=_0x5d5727-0x0;var _0x593cd3=_0x56b2[_0x5d5727];return _0x593cd3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x256b('0x0'));var rimraf=require(_0x256b('0x1'));var zipdir=require(_0x256b('0x2'));var jsonpatch=require(_0x256b('0x3'));var rp=require(_0x256b('0x4'));var moment=require('moment');var BPromise=require(_0x256b('0x5'));var Mustache=require('mustache');var util=require(_0x256b('0x6'));var path=require(_0x256b('0x7'));var sox=require(_0x256b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x256b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x256b('0xa'));var querystring=require(_0x256b('0xb'));var Papa=require(_0x256b('0xc'));var Redis=require(_0x256b('0xd'));var authService=require(_0x256b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x256b('0xf'));var hardwareService=require(_0x256b('0x10'));var logger=require(_0x256b('0x11'))(_0x256b('0x12'));var utils=require('../../config/utils');var config=require(_0x256b('0x13'));var db=require(_0x256b('0x14'))['db'];function respondWithStatusCode(_0x5934b9,_0x3cd5ff){_0x3cd5ff=_0x3cd5ff||0xcc;return function(_0x2cbcdc){if(_0x2cbcdc){return _0x5934b9['sendStatus'](_0x3cd5ff);}return _0x5934b9[_0x256b('0x15')](_0x3cd5ff)[_0x256b('0x16')]();};}function respondWithResult(_0x46cc5a,_0x48f179){_0x48f179=_0x48f179||0xc8;return function(_0x4e9bdd){if(_0x4e9bdd){return _0x46cc5a[_0x256b('0x15')](_0x48f179)[_0x256b('0x17')](_0x4e9bdd);}};}function respondWithFilteredResult(_0x3f2668,_0x25ce87){return function(_0x338e4e){if(_0x338e4e){var _0x35e33e=_0x338e4e[_0x256b('0x18')],_0x484b1c=_0x25ce87[_0x256b('0x19')],_0x81fb6e=_0x25ce87[_0x256b('0x19')]+_0x25ce87[_0x256b('0x1a')],_0x569216;if(_0x81fb6e>=_0x35e33e){_0x81fb6e=_0x35e33e;_0x569216=0xc8;}else{_0x569216=0xce;}_0x3f2668[_0x256b('0x15')](_0x569216);return _0x3f2668['set'](_0x256b('0x1b'),_0x484b1c+'-'+_0x81fb6e+'/'+_0x35e33e)[_0x256b('0x17')](_0x338e4e);}return null;};}function patchUpdates(_0x4a9531){return function(_0x4b3a7f){try{jsonpatch[_0x256b('0x1c')](_0x4b3a7f,_0x4a9531,!![]);}catch(_0x4e72b3){return BPromise['reject'](_0x4e72b3);}return _0x4b3a7f[_0x256b('0x1d')]();};}function saveUpdates(_0x308b78,_0x1c295d){return function(_0x547e36){if(_0x547e36){return _0x547e36['update'](_0x308b78)[_0x256b('0x1e')](function(_0x513cc4){return _0x513cc4;});}return null;};}function removeEntity(_0x4b5b4b,_0x244178){return function(_0x139888){if(_0x139888){return _0x139888['destroy']()[_0x256b('0x1e')](function(){_0x4b5b4b[_0x256b('0x15')](0xcc)[_0x256b('0x16')]();});}};}function handleEntityNotFound(_0x528a95,_0x531f4c){return function(_0x442ccf){if(!_0x442ccf){_0x528a95[_0x256b('0x1f')](0x194);}return _0x442ccf;};}function handleError(_0x185be0,_0x5d44e9){_0x5d44e9=_0x5d44e9||0x1f4;return function(_0x4c0608){logger[_0x256b('0x20')](_0x4c0608[_0x256b('0x21')]);if(_0x4c0608[_0x256b('0x22')]){delete _0x4c0608[_0x256b('0x22')];}_0x185be0[_0x256b('0x15')](_0x5d44e9)[_0x256b('0x23')](_0x4c0608);};}exports[_0x256b('0x24')]=function(_0x390ff3,_0x415342){var _0x19503e={},_0x419083={},_0xeb6ff0={'count':0x0,'rows':[]};var _0x2bb0e0=_['map'](db[_0x256b('0x25')][_0x256b('0x26')],function(_0x317d0c){return{'name':_0x317d0c[_0x256b('0x27')],'type':_0x317d0c[_0x256b('0x28')][_0x256b('0x29')]};});_0x419083[_0x256b('0x2a')]=_['map'](_0x2bb0e0,_0x256b('0x22'));_0x419083[_0x256b('0x2b')]=_[_0x256b('0x2c')](_0x390ff3[_0x256b('0x2b')]);_0x419083['filters']=_['intersection'](_0x419083[_0x256b('0x2a')],_0x419083[_0x256b('0x2b')]);_0x19503e['attributes']=_['intersection'](_0x419083[_0x256b('0x2a')],qs[_0x256b('0x2d')](_0x390ff3[_0x256b('0x2b')][_0x256b('0x2d')]));_0x19503e[_0x256b('0x2e')]=_0x19503e[_0x256b('0x2e')][_0x256b('0x2f')]?_0x19503e['attributes']:_0x419083[_0x256b('0x2a')];if(!_0x390ff3[_0x256b('0x2b')]['hasOwnProperty'](_0x256b('0x30'))){_0x19503e[_0x256b('0x1a')]=qs[_0x256b('0x1a')](_0x390ff3[_0x256b('0x2b')]['limit']);_0x19503e['offset']=qs[_0x256b('0x19')](_0x390ff3[_0x256b('0x2b')][_0x256b('0x19')]);}_0x19503e[_0x256b('0x31')]=qs[_0x256b('0x32')](_0x390ff3[_0x256b('0x2b')][_0x256b('0x32')]);_0x19503e[_0x256b('0x33')]=qs[_0x256b('0x34')](_[_0x256b('0x35')](_0x390ff3[_0x256b('0x2b')],_0x419083[_0x256b('0x34')]),_0x2bb0e0);if(_0x390ff3[_0x256b('0x2b')]['filter']){_0x19503e['where']=_['merge'](_0x19503e[_0x256b('0x33')],{'$or':_['map'](_0x2bb0e0,function(_0x22470b){if(_0x22470b[_0x256b('0x28')]!==_0x256b('0x36')){var _0x3ac22b={};_0x3ac22b[_0x22470b[_0x256b('0x22')]]={'$like':'%'+_0x390ff3[_0x256b('0x2b')][_0x256b('0x37')]+'%'};return _0x3ac22b;}})});}_0x19503e=_[_0x256b('0x38')]({},_0x19503e,_0x390ff3[_0x256b('0x39')]);var _0xf5a666={'where':_0x19503e[_0x256b('0x33')]};return db[_0x256b('0x25')][_0x256b('0x18')](_0xf5a666)[_0x256b('0x1e')](function(_0x44b50b){_0xeb6ff0['count']=_0x44b50b;if(_0x390ff3[_0x256b('0x2b')][_0x256b('0x3a')]){_0x19503e[_0x256b('0x3b')]=[{'all':!![]}];}return db[_0x256b('0x25')]['findAll'](_0x19503e);})[_0x256b('0x1e')](function(_0x10cc9b){_0xeb6ff0[_0x256b('0x3c')]=_0x10cc9b;return _0xeb6ff0;})[_0x256b('0x1e')](respondWithFilteredResult(_0x415342,_0x19503e))[_0x256b('0x3d')](handleError(_0x415342,null));};exports[_0x256b('0x3e')]=function(_0x46a52a,_0x4b7ae1){var _0x2f29cb={'raw':!![],'where':{'id':_0x46a52a[_0x256b('0x3f')]['id']}},_0x5b4bbf={};_0x5b4bbf[_0x256b('0x2a')]=_[_0x256b('0x2c')](db[_0x256b('0x25')][_0x256b('0x26')]);_0x5b4bbf[_0x256b('0x2b')]=_['keys'](_0x46a52a['query']);_0x5b4bbf['filters']=_['intersection'](_0x5b4bbf[_0x256b('0x2a')],_0x5b4bbf[_0x256b('0x2b')]);_0x2f29cb[_0x256b('0x2e')]=_[_0x256b('0x40')](_0x5b4bbf[_0x256b('0x2a')],qs[_0x256b('0x2d')](_0x46a52a[_0x256b('0x2b')][_0x256b('0x2d')]));_0x2f29cb[_0x256b('0x2e')]=_0x2f29cb[_0x256b('0x2e')]['length']?_0x2f29cb[_0x256b('0x2e')]:_0x5b4bbf[_0x256b('0x2a')];if(_0x46a52a[_0x256b('0x2b')][_0x256b('0x3a')]){_0x2f29cb['include']=[{'all':!![]}];}_0x2f29cb=_[_0x256b('0x38')]({},_0x2f29cb,_0x46a52a[_0x256b('0x39')]);return db[_0x256b('0x25')][_0x256b('0x41')](_0x2f29cb)[_0x256b('0x1e')](handleEntityNotFound(_0x4b7ae1,null))[_0x256b('0x1e')](respondWithResult(_0x4b7ae1,null))['catch'](handleError(_0x4b7ae1,null));};exports['create']=function(_0x331b82,_0x49b6da){return db[_0x256b('0x25')][_0x256b('0x42')](_0x331b82[_0x256b('0x43')],{})['then'](respondWithResult(_0x49b6da,0xc9))['catch'](handleError(_0x49b6da,null));};exports[_0x256b('0x44')]=function(_0x5465bc,_0x1c5c2b){if(_0x5465bc[_0x256b('0x43')]['id']){delete _0x5465bc[_0x256b('0x43')]['id'];}return db[_0x256b('0x25')]['find']({'where':{'id':_0x5465bc[_0x256b('0x3f')]['id']}})[_0x256b('0x1e')](handleEntityNotFound(_0x1c5c2b,null))[_0x256b('0x1e')](saveUpdates(_0x5465bc['body'],null))[_0x256b('0x1e')](respondWithResult(_0x1c5c2b,null))[_0x256b('0x3d')](handleError(_0x1c5c2b,null));};exports[_0x256b('0x45')]=function(_0x185a95,_0x57e9c7){return db[_0x256b('0x25')][_0x256b('0x41')]({'where':{'id':_0x185a95[_0x256b('0x3f')]['id']}})[_0x256b('0x1e')](handleEntityNotFound(_0x57e9c7,null))[_0x256b('0x1e')](removeEntity(_0x57e9c7,null))['catch'](handleError(_0x57e9c7,null));};exports[_0x256b('0x46')]=function(_0x27a4f2,_0x4816e5){return db[_0x256b('0x25')]['describe']()[_0x256b('0x1e')](respondWithResult(_0x4816e5,null))[_0x256b('0x3d')](handleError(_0x4816e5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 508f073..2381e3d 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 _0x2534=['./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','util','path','rimraf'];(function(_0x199c9b,_0xd6e4c3){var _0x2f4c42=function(_0x458822){while(--_0x458822){_0x199c9b['push'](_0x199c9b['shift']());}};_0x2f4c42(++_0xd6e4c3);}(_0x2534,0x84));var _0x4253=function(_0x233ff9,_0x5f1db1){_0x233ff9=_0x233ff9-0x0;var _0x290ffa=_0x2534[_0x233ff9];return _0x290ffa;};'use strict';var _=require('lodash');var util=require(_0x4253('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4253('0x1'));var rimraf=require(_0x4253('0x2'));var config=require('../../config/environment');var attributes=require(_0x4253('0x3'));module[_0x4253('0x4')]=function(_0x2204d0,_0x5f47ad){return _0x2204d0[_0x4253('0x5')](_0x4253('0x6'),attributes,{'tableName':_0x4253('0x7'),'paranoid':![],'indexes':[{'name':_0x4253('0x8'),'fields':[_0x4253('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x52ee=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue'];(function(_0x21f7b2,_0xe13c0){var _0x12ca03=function(_0x4c5c58){while(--_0x4c5c58){_0x21f7b2['push'](_0x21f7b2['shift']());}};_0x12ca03(++_0xe13c0);}(_0x52ee,0x1cf));var _0xe52e=function(_0x42e9c2,_0xf71604){_0x42e9c2=_0x42e9c2-0x0;var _0x1e7c80=_0x52ee[_0x42e9c2];return _0x1e7c80;};'use strict';var _=require(_0xe52e('0x0'));var util=require(_0xe52e('0x1'));var logger=require(_0xe52e('0x2'))(_0xe52e('0x3'));var moment=require(_0xe52e('0x4'));var BPromise=require(_0xe52e('0x5'));var rp=require(_0xe52e('0x6'));var fs=require('fs');var path=require(_0xe52e('0x7'));var rimraf=require('rimraf');var config=require(_0xe52e('0x8'));var attributes=require(_0xe52e('0x9'));module[_0xe52e('0xa')]=function(_0x43e8f4,_0x18e2a8){return _0x43e8f4['define'](_0xe52e('0xb'),attributes,{'tableName':_0xe52e('0xc'),'paranoid':![],'indexes':[{'name':_0xe52e('0xd'),'fields':[_0xe52e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 402d754..e48289a 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 _0xd93d=['../../config/logger','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2c40de,_0x34e6dc){var _0x2048aa=function(_0x571d70){while(--_0x571d70){_0x2c40de['push'](_0x2c40de['shift']());}};_0x2048aa(++_0x34e6dc);}(_0xd93d,0x185));var _0xdd93=function(_0x3c0432,_0x1d6c64){_0x3c0432=_0x3c0432-0x0;var _0x33d2fd=_0xd93d[_0x3c0432];return _0x33d2fd;};'use strict';var _=require(_0xdd93('0x0'));var util=require(_0xdd93('0x1'));var moment=require(_0xdd93('0x2'));var BPromise=require(_0xdd93('0x3'));var rs=require(_0xdd93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd93('0x5'))['db'];var utils=require(_0xdd93('0x6'));var logger=require(_0xdd93('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdd93('0x8'));var client=jayson[_0xdd93('0x9')][_0xdd93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x403266,_0x19386d,_0xc667a3){return new BPromise(function(_0x2e5b0c,_0x10859b){return client['request'](_0x403266,_0xc667a3)[_0xdd93('0xb')](function(_0x1c106a){logger[_0xdd93('0xc')](_0xdd93('0xd'),_0x19386d,_0xdd93('0xe'));logger[_0xdd93('0xf')](_0xdd93('0x10'),_0x19386d,'request\x20sent',JSON[_0xdd93('0x11')](_0x1c106a));if(_0x1c106a[_0xdd93('0x12')]){if(_0x1c106a[_0xdd93('0x12')][_0xdd93('0x13')]===0x1f4){logger[_0xdd93('0x12')](_0xdd93('0xd'),_0x19386d,_0x1c106a[_0xdd93('0x12')][_0xdd93('0x14')]);return _0x10859b(_0x1c106a['error']['message']);}logger[_0xdd93('0x12')](_0xdd93('0xd'),_0x19386d,_0x1c106a[_0xdd93('0x12')][_0xdd93('0x14')]);return _0x2e5b0c(_0x1c106a[_0xdd93('0x12')][_0xdd93('0x14')]);}else{logger[_0xdd93('0xc')](_0xdd93('0xd'),_0x19386d,_0xdd93('0xe'));_0x2e5b0c(_0x1c106a[_0xdd93('0x15')][_0xdd93('0x14')]);}})[_0xdd93('0x16')](function(_0x20097a){logger['error'](_0xdd93('0xd'),_0x19386d,_0x20097a);_0x10859b(_0x20097a);});});}exports[_0xdd93('0x17')]=function(_0x2210f3){var _0x440db7=this;return new Promise(function(_0x4c6352,_0x2039f8){return db[_0xdd93('0x18')]['create'](_0x2210f3[_0xdd93('0x19')],{'raw':_0x2210f3['options']?_0x2210f3[_0xdd93('0x1a')][_0xdd93('0x1b')]===undefined?!![]:![]:!![]})[_0xdd93('0xb')](function(_0x4d25b8){logger[_0xdd93('0xc')]('CreateFaxQueueReport',_0x2210f3);logger[_0xdd93('0xf')]('CreateFaxQueueReport',_0x2210f3,JSON[_0xdd93('0x11')](_0x4d25b8));_0x4c6352(_0x4d25b8);})[_0xdd93('0x16')](function(_0x29e6d7){logger[_0xdd93('0x12')](_0xdd93('0x17'),_0x29e6d7[_0xdd93('0x14')],_0x2210f3);_0x2039f8(_0x440db7[_0xdd93('0x12')](0x1f4,_0x29e6d7[_0xdd93('0x14')]));});});};exports[_0xdd93('0x1c')]=function(_0x4feebd){var _0x533d4d=this;return new Promise(function(_0x224834,_0x44a20f){return db['FaxQueueReport'][_0xdd93('0x1d')](_0x4feebd[_0xdd93('0x19')],{'raw':_0x4feebd[_0xdd93('0x1a')]?_0x4feebd[_0xdd93('0x1a')][_0xdd93('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4feebd[_0xdd93('0x1a')]?_0x4feebd[_0xdd93('0x1a')][_0xdd93('0x1e')]||null:null,'attributes':_0x4feebd[_0xdd93('0x1a')]?_0x4feebd[_0xdd93('0x1a')][_0xdd93('0x1f')]||null:null,'limit':_0x4feebd[_0xdd93('0x1a')]?_0x4feebd[_0xdd93('0x1a')][_0xdd93('0x20')]||null:null})[_0xdd93('0xb')](function(_0x36aa34){logger[_0xdd93('0xc')]('UpdateFaxQueueReport',_0x4feebd);logger[_0xdd93('0xf')]('UpdateFaxQueueReport',_0x4feebd,JSON['stringify'](_0x36aa34));_0x224834(_0x36aa34);})[_0xdd93('0x16')](function(_0x2dace3){logger['error']('UpdateFaxQueueReport',_0x2dace3[_0xdd93('0x14')],_0x4feebd);_0x44a20f(_0x533d4d[_0xdd93('0x12')](0x1f4,_0x2dace3[_0xdd93('0x14')]));});});}; \ No newline at end of file +var _0x3c04=['CreateFaxQueueReport','FaxQueueReport','body','options','then','debug','UpdateFaxQueueReport','update','raw','limit','stringify','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0x3c04,0xc0));var _0x43c0=function(_0x22e567,_0x4435cb){_0x22e567=_0x22e567-0x0;var _0x12e30e=_0x3c04[_0x22e567];return _0x12e30e;};'use strict';var _=require(_0x43c0('0x0'));var util=require(_0x43c0('0x1'));var moment=require('moment');var BPromise=require(_0x43c0('0x2'));var rs=require(_0x43c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x43c0('0x5'))(_0x43c0('0x6'));var config=require(_0x43c0('0x7'));var jayson=require(_0x43c0('0x8'));var client=jayson[_0x43c0('0x9')][_0x43c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x114deb,_0x2a811c,_0x20bc86){return new BPromise(function(_0x1d4565,_0x2c2750){return client['request'](_0x114deb,_0x20bc86)['then'](function(_0x3c1ad0){logger[_0x43c0('0xb')](_0x43c0('0xc'),_0x2a811c,_0x43c0('0xd'));logger['debug'](_0x43c0('0xe'),_0x2a811c,'request\x20sent',JSON['stringify'](_0x3c1ad0));if(_0x3c1ad0[_0x43c0('0xf')]){if(_0x3c1ad0[_0x43c0('0xf')][_0x43c0('0x10')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2a811c,_0x3c1ad0[_0x43c0('0xf')][_0x43c0('0x11')]);return _0x2c2750(_0x3c1ad0['error']['message']);}logger[_0x43c0('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2a811c,_0x3c1ad0[_0x43c0('0xf')][_0x43c0('0x11')]);return _0x1d4565(_0x3c1ad0[_0x43c0('0xf')][_0x43c0('0x11')]);}else{logger[_0x43c0('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x2a811c,_0x43c0('0xd'));_0x1d4565(_0x3c1ad0['result'][_0x43c0('0x11')]);}})['catch'](function(_0x27c3cc){logger[_0x43c0('0xf')](_0x43c0('0xc'),_0x2a811c,_0x27c3cc);_0x2c2750(_0x27c3cc);});});}exports[_0x43c0('0x12')]=function(_0x1dabe5){var _0x3c5b05=this;return new Promise(function(_0x2a2422,_0x1e876e){return db[_0x43c0('0x13')]['create'](_0x1dabe5[_0x43c0('0x14')],{'raw':_0x1dabe5[_0x43c0('0x15')]?_0x1dabe5[_0x43c0('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x43c0('0x16')](function(_0x1054d1){logger['info'](_0x43c0('0x12'),_0x1dabe5);logger[_0x43c0('0x17')](_0x43c0('0x12'),_0x1dabe5,JSON['stringify'](_0x1054d1));_0x2a2422(_0x1054d1);})['catch'](function(_0x4aa903){logger[_0x43c0('0xf')](_0x43c0('0x12'),_0x4aa903[_0x43c0('0x11')],_0x1dabe5);_0x1e876e(_0x3c5b05['error'](0x1f4,_0x4aa903[_0x43c0('0x11')]));});});};exports[_0x43c0('0x18')]=function(_0x4f8aa7){var _0x2f4781=this;return new Promise(function(_0x6f1e88,_0x2379ce){return db[_0x43c0('0x13')][_0x43c0('0x19')](_0x4f8aa7[_0x43c0('0x14')],{'raw':_0x4f8aa7[_0x43c0('0x15')]?_0x4f8aa7[_0x43c0('0x15')][_0x43c0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f8aa7[_0x43c0('0x15')]?_0x4f8aa7['options']['where']||null:null,'attributes':_0x4f8aa7['options']?_0x4f8aa7[_0x43c0('0x15')]['attributes']||null:null,'limit':_0x4f8aa7[_0x43c0('0x15')]?_0x4f8aa7[_0x43c0('0x15')][_0x43c0('0x1b')]||null:null})[_0x43c0('0x16')](function(_0x5cd81b){logger[_0x43c0('0xb')](_0x43c0('0x18'),_0x4f8aa7);logger[_0x43c0('0x17')](_0x43c0('0x18'),_0x4f8aa7,JSON[_0x43c0('0x1c')](_0x5cd81b));_0x6f1e88(_0x5cd81b);})[_0x43c0('0x1d')](function(_0x220532){logger['error'](_0x43c0('0x18'),_0x220532[_0x43c0('0x11')],_0x4f8aa7);_0x2379ce(_0x2f4781[_0x43c0('0xf')](0x1f4,_0x220532[_0x43c0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 182abd7..6d90884 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 _0xfbfe=['/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x105a8e,_0x12dd9a){var _0x298729=function(_0x3e9079){while(--_0x3e9079){_0x105a8e['push'](_0x105a8e['shift']());}};_0x298729(++_0x12dd9a);}(_0xfbfe,0x132));var _0xefbf=function(_0x6ef804,_0x24ed53){_0x6ef804=_0x6ef804-0x0;var _0xac9434=_0xfbfe[_0x6ef804];return _0xac9434;};'use strict';var multer=require(_0xefbf('0x0'));var util=require(_0xefbf('0x1'));var path=require(_0xefbf('0x2'));var timeout=require(_0xefbf('0x3'));var express=require(_0xefbf('0x4'));var router=express[_0xefbf('0x5')]();var auth=require(_0xefbf('0x6'));var interaction=require(_0xefbf('0x7'));var config=require(_0xefbf('0x8'));var controller=require('./faxQueueReport.controller');router[_0xefbf('0x9')]('/',auth['isAuthenticated'](),controller[_0xefbf('0xa')]);router[_0xefbf('0x9')](_0xefbf('0xb'),auth[_0xefbf('0xc')](),controller[_0xefbf('0xd')]);router[_0xefbf('0x9')](_0xefbf('0xe'),auth[_0xefbf('0xc')](),controller['show']);router[_0xefbf('0xf')]('/',auth[_0xefbf('0xc')](),controller[_0xefbf('0x10')]);router[_0xefbf('0x11')](_0xefbf('0xe'),auth[_0xefbf('0xc')](),controller['update']);router[_0xefbf('0x12')](_0xefbf('0xe'),auth[_0xefbf('0xc')](),controller[_0xefbf('0x13')]);module['exports']=router; \ No newline at end of file +var _0xcf90=['express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','index','isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','path'];(function(_0x521b61,_0x47e2b4){var _0x476cdf=function(_0xbca2ca){while(--_0xbca2ca){_0x521b61['push'](_0x521b61['shift']());}};_0x476cdf(++_0x47e2b4);}(_0xcf90,0x10e));var _0x0cf9=function(_0xdf20cb,_0x35f605){_0xdf20cb=_0xdf20cb-0x0;var _0x4522bc=_0xcf90[_0xdf20cb];return _0x4522bc;};'use strict';var multer=require(_0x0cf9('0x0'));var util=require('util');var path=require(_0x0cf9('0x1'));var timeout=require('connect-timeout');var express=require(_0x0cf9('0x2'));var router=express[_0x0cf9('0x3')]();var auth=require(_0x0cf9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0cf9('0x5'));var controller=require(_0x0cf9('0x6'));router[_0x0cf9('0x7')]('/',auth['isAuthenticated'](),controller[_0x0cf9('0x8')]);router['get']('/describe',auth[_0x0cf9('0x9')](),controller['describe']);router[_0x0cf9('0x7')](_0x0cf9('0xa'),auth[_0x0cf9('0x9')](),controller['show']);router[_0x0cf9('0xb')]('/',auth[_0x0cf9('0x9')](),controller[_0x0cf9('0xc')]);router[_0x0cf9('0xd')]('/:id',auth[_0x0cf9('0x9')](),controller['update']);router[_0x0cf9('0xe')](_0x0cf9('0xa'),auth['isAuthenticated'](),controller[_0x0cf9('0xf')]);module[_0x0cf9('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 97fe700..570acd3 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 _0x11aa=['agent','queue','DATE','NOW','moment','sequelize','exports','account'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11aa,0xe4));var _0xa11a=function(_0x3e8522,_0x4be7d6){_0x3e8522=_0x3e8522-0x0;var _0x4e8438=_0x11aa[_0x3e8522];return _0x4e8438;};'use strict';var moment=require(_0xa11a('0x0'));var Sequelize=require(_0xa11a('0x1'));module[_0xa11a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa11a('0x3'),_0xa11a('0x4'),_0xa11a('0x5')),'allowNull':![],'defaultValue':_0xa11a('0x5')},'transferredAt':{'type':Sequelize[_0xa11a('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xa11a('0x7')]}}; \ No newline at end of file +var _0x0373=['DATE','NOW','sequelize','exports','STRING','account','agent','queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0373,0x1a2));var _0x3037=function(_0x333734,_0x412291){_0x333734=_0x333734-0x0;var _0x4e91e7=_0x0373[_0x333734];return _0x4e91e7;};'use strict';var moment=require('moment');var Sequelize=require(_0x3037('0x0'));module[_0x3037('0x1')]={'uniqueid':{'type':Sequelize[_0x3037('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3037('0x3'),_0x3037('0x4'),_0x3037('0x5')),'allowNull':![],'defaultValue':_0x3037('0x5')},'transferredAt':{'type':Sequelize[_0x3037('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x3037('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1c27eee..07ef389 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 _0x5f2f=['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','FaxTransferReport','then','include','rows','catch','show','params','intersection','options','find','create','body','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','sendStatus','status','json','count','offset','limit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49a190,_0xb4433b){_0x49a190=_0x49a190-0x0;var _0x11fd84=_0x5f2f[_0x49a190];return _0x11fd84;};'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['FaxTransferReport']['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')]),_0x198c73);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));};exports[_0xf5f2('0x41')]=function(_0x462ea3,_0x2083b3){var _0x574f24={'raw':!![],'where':{'id':_0x462ea3[_0xf5f2('0x42')]['id']}},_0x31c3c={};_0x31c3c[_0xf5f2('0x2f')]=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x31c3c[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x462ea3['query']);_0x31c3c[_0xf5f2('0x38')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],_0x31c3c[_0xf5f2('0x2d')]);_0x574f24[_0xf5f2('0x30')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x462ea3[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x574f24[_0xf5f2('0x30')]=_0x574f24[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x574f24[_0xf5f2('0x30')]:_0x31c3c['model'];if(_0x462ea3[_0xf5f2('0x2d')]['includeAll']){_0x574f24[_0xf5f2('0x3e')]=[{'all':!![]}];}_0x574f24=_[_0xf5f2('0x3a')]({},_0x574f24,_0x462ea3[_0xf5f2('0x44')]);return db[_0xf5f2('0x3c')][_0xf5f2('0x45')](_0x574f24)[_0xf5f2('0x3d')](handleEntityNotFound(_0x2083b3,null))['then'](respondWithResult(_0x2083b3,null))[_0xf5f2('0x40')](handleError(_0x2083b3,null));};exports[_0xf5f2('0x46')]=function(_0x1c1497,_0x29b108){return db[_0xf5f2('0x3c')][_0xf5f2('0x46')](_0x1c1497[_0xf5f2('0x47')],{})[_0xf5f2('0x3d')](respondWithResult(_0x29b108,0xc9))['catch'](handleError(_0x29b108,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x47')]['id'];}return db[_0xf5f2('0x3c')][_0xf5f2('0x45')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x3d')](saveUpdates(_0x33ec29[_0xf5f2('0x47')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x40')](handleError(_0x45db9a,null));};exports['destroy']=function(_0x740321,_0x497eb8){return db[_0xf5f2('0x3c')]['find']({'where':{'id':_0x740321[_0xf5f2('0x42')]['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x497eb8,null))[_0xf5f2('0x3d')](removeEntity(_0x497eb8,null))[_0xf5f2('0x40')](handleError(_0x497eb8,null));};exports['describe']=function(_0x3154c1,_0x2b782f){return db['FaxTransferReport']['describe']()[_0xf5f2('0x3d')](respondWithResult(_0x2b782f,null))[_0xf5f2('0x40')](handleError(_0x2b782f,null));}; \ No newline at end of file +var _0xadb5=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','FaxTransferReport','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','find','create','body','update','describe','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','name','send','index'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xadb5,0xad));var _0x5adb=function(_0x12cac5,_0xb8b836){_0x12cac5=_0x12cac5-0x0;var _0x3273b9=_0xadb5[_0x12cac5];return _0x3273b9;};'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['FaxTransferReport']['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')]),_0x36459b);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['FaxTransferReport'][_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['FaxTransferReport'][_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));};exports[_0x5adb('0x46')]=function(_0x55c535,_0x2402a3){return db[_0x5adb('0x39')][_0x5adb('0x46')]()[_0x5adb('0x22')](respondWithResult(_0x2402a3,null))[_0x5adb('0x3c')](handleError(_0x2402a3,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a12d37b..ac3dcee 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 _0x8baf=['lodash','util','../../config/logger','moment','request-promise','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x592bdc,_0x37bb69){var _0x517235=function(_0x45f7de){while(--_0x45f7de){_0x592bdc['push'](_0x592bdc['shift']());}};_0x517235(++_0x37bb69);}(_0x8baf,0xd8));var _0xf8ba=function(_0x3ab0f4,_0x1ae9f5){_0x3ab0f4=_0x3ab0f4-0x0;var _0x58af7f=_0x8baf[_0x3ab0f4];return _0x58af7f;};'use strict';var _=require(_0xf8ba('0x0'));var util=require(_0xf8ba('0x1'));var logger=require(_0xf8ba('0x2'))('api');var moment=require(_0xf8ba('0x3'));var BPromise=require('bluebird');var rp=require(_0xf8ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8ba('0x5'));var attributes=require(_0xf8ba('0x6'));module[_0xf8ba('0x7')]=function(_0x476e92,_0x281554){return _0x476e92[_0xf8ba('0x8')](_0xf8ba('0x9'),attributes,{'tableName':_0xf8ba('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf8ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x991b=['path','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','api','moment','request-promise'];(function(_0x38d207,_0x29970f){var _0x3f38ab=function(_0x268cc5){while(--_0x268cc5){_0x38d207['push'](_0x38d207['shift']());}};_0x3f38ab(++_0x29970f);}(_0x991b,0x6b));var _0xb991=function(_0x11b62d,_0x4af8eb){_0x11b62d=_0x11b62d-0x0;var _0x3ed6ee=_0x991b[_0x11b62d];return _0x3ed6ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb991('0x0'));var moment=require(_0xb991('0x1'));var BPromise=require('bluebird');var rp=require(_0xb991('0x2'));var fs=require('fs');var path=require(_0xb991('0x3'));var rimraf=require(_0xb991('0x4'));var config=require('../../config/environment');var attributes=require(_0xb991('0x5'));module[_0xb991('0x6')]=function(_0x16214e,_0x199a63){return _0x16214e[_0xb991('0x7')](_0xb991('0x8'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xb991('0x9'),'fields':[_0xb991('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 1593daf..6503f3c 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 _0x8918=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x1c0d1c,_0x349882){var _0x2057af=function(_0x58ec34){while(--_0x58ec34){_0x1c0d1c['push'](_0x1c0d1c['shift']());}};_0x2057af(++_0x349882);}(_0x8918,0x169));var _0x8891=function(_0x573592,_0x5ef466){_0x573592=_0x573592-0x0;var _0x411ae5=_0x8918[_0x573592];return _0x411ae5;};'use strict';var _=require('lodash');var util=require(_0x8891('0x0'));var moment=require(_0x8891('0x1'));var BPromise=require(_0x8891('0x2'));var rs=require(_0x8891('0x3'));var fs=require('fs');var Redis=require(_0x8891('0x4'));var db=require(_0x8891('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8891('0x6'))('rpc');var config=require(_0x8891('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8891('0x8')][_0x8891('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x107266,_0x3e9ca6,_0x15f38b){return new BPromise(function(_0x80d741,_0x37b2ad){return client[_0x8891('0xa')](_0x107266,_0x15f38b)['then'](function(_0x3b06aa){logger[_0x8891('0xb')](_0x8891('0xc'),_0x3e9ca6,_0x8891('0xd'));logger['debug'](_0x8891('0xe'),_0x3e9ca6,_0x8891('0xd'),JSON['stringify'](_0x3b06aa));if(_0x3b06aa['error']){if(_0x3b06aa[_0x8891('0xf')][_0x8891('0x10')]===0x1f4){logger['error'](_0x8891('0xc'),_0x3e9ca6,_0x3b06aa[_0x8891('0xf')][_0x8891('0x11')]);return _0x37b2ad(_0x3b06aa[_0x8891('0xf')]['message']);}logger['error'](_0x8891('0xc'),_0x3e9ca6,_0x3b06aa['error'][_0x8891('0x11')]);return _0x80d741(_0x3b06aa[_0x8891('0xf')][_0x8891('0x11')]);}else{logger[_0x8891('0xb')](_0x8891('0xc'),_0x3e9ca6,_0x8891('0xd'));_0x80d741(_0x3b06aa[_0x8891('0x12')][_0x8891('0x11')]);}})[_0x8891('0x13')](function(_0x49db62){logger[_0x8891('0xf')](_0x8891('0xc'),_0x3e9ca6,_0x49db62);_0x37b2ad(_0x49db62);});});} \ No newline at end of file +var _0x35a6=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1bd498,_0x14b925){var _0xb4473e=function(_0x367808){while(--_0x367808){_0x1bd498['push'](_0x1bd498['shift']());}};_0xb4473e(++_0x14b925);}(_0x35a6,0x136));var _0x635a=function(_0x13ea36,_0x2805ad){_0x13ea36=_0x13ea36-0x0;var _0x312066=_0x35a6[_0x13ea36];return _0x312066;};'use strict';var _=require(_0x635a('0x0'));var util=require(_0x635a('0x1'));var moment=require('moment');var BPromise=require(_0x635a('0x2'));var rs=require(_0x635a('0x3'));var fs=require('fs');var Redis=require(_0x635a('0x4'));var db=require(_0x635a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x635a('0x6'));var jayson=require(_0x635a('0x7'));var client=jayson[_0x635a('0x8')][_0x635a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39f3ca,_0x309919,_0x435ae0){return new BPromise(function(_0x5c3925,_0x90d99b){return client[_0x635a('0xa')](_0x39f3ca,_0x435ae0)[_0x635a('0xb')](function(_0x221a50){logger[_0x635a('0xc')](_0x635a('0xd'),_0x309919,_0x635a('0xe'));logger[_0x635a('0xf')](_0x635a('0x10'),_0x309919,'request\x20sent',JSON[_0x635a('0x11')](_0x221a50));if(_0x221a50[_0x635a('0x12')]){if(_0x221a50[_0x635a('0x12')][_0x635a('0x13')]===0x1f4){logger[_0x635a('0x12')](_0x635a('0xd'),_0x309919,_0x221a50[_0x635a('0x12')][_0x635a('0x14')]);return _0x90d99b(_0x221a50[_0x635a('0x12')][_0x635a('0x14')]);}logger[_0x635a('0x12')](_0x635a('0xd'),_0x309919,_0x221a50[_0x635a('0x12')][_0x635a('0x14')]);return _0x5c3925(_0x221a50['error']['message']);}else{logger['info'](_0x635a('0xd'),_0x309919,_0x635a('0xe'));_0x5c3925(_0x221a50[_0x635a('0x15')][_0x635a('0x14')]);}})[_0x635a('0x16')](function(_0x4b05d1){logger[_0x635a('0x12')](_0x635a('0xd'),_0x309919,_0x4b05d1);_0x90d99b(_0x4b05d1);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 2431016..f923907 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 _0x06d3=['create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post'];(function(_0x1011ae,_0x447133){var _0x314fb=function(_0x166933){while(--_0x166933){_0x1011ae['push'](_0x1011ae['shift']());}};_0x314fb(++_0x447133);}(_0x06d3,0x1a7));var _0x306d=function(_0x5e8596,_0x154f23){_0x5e8596=_0x5e8596-0x0;var _0x4bd24b=_0x06d3[_0x5e8596];return _0x4bd24b;};'use strict';var multer=require(_0x306d('0x0'));var util=require(_0x306d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x306d('0x2'));var router=express[_0x306d('0x3')]();var auth=require(_0x306d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x306d('0x5'));var controller=require(_0x306d('0x6'));router['get']('/',auth[_0x306d('0x7')](),controller[_0x306d('0x8')]);router[_0x306d('0x9')](_0x306d('0xa'),auth[_0x306d('0x7')](),controller[_0x306d('0xb')]);router[_0x306d('0x9')](_0x306d('0xc'),auth[_0x306d('0x7')](),controller['show']);router[_0x306d('0xd')]('/',auth[_0x306d('0x7')](),controller[_0x306d('0xe')]);router['put'](_0x306d('0xc'),auth[_0x306d('0x7')](),controller[_0x306d('0xf')]);router[_0x306d('0x10')](_0x306d('0xc'),auth[_0x306d('0x7')](),controller[_0x306d('0x11')]);module[_0x306d('0x12')]=router; \ No newline at end of file +var _0x1186=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update'];(function(_0x540fad,_0x5874e5){var _0x8508a2=function(_0x541a07){while(--_0x541a07){_0x540fad['push'](_0x540fad['shift']());}};_0x8508a2(++_0x5874e5);}(_0x1186,0x167));var _0x6118=function(_0x57826f,_0x271bf1){_0x57826f=_0x57826f-0x0;var _0x18f80f=_0x1186[_0x57826f];return _0x18f80f;};'use strict';var multer=require(_0x6118('0x0'));var util=require(_0x6118('0x1'));var path=require(_0x6118('0x2'));var timeout=require(_0x6118('0x3'));var express=require('express');var router=express[_0x6118('0x4')]();var auth=require(_0x6118('0x5'));var interaction=require(_0x6118('0x6'));var config=require(_0x6118('0x7'));var controller=require(_0x6118('0x8'));router[_0x6118('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6118('0x9')](_0x6118('0xa'),auth[_0x6118('0xb')](),controller[_0x6118('0xc')]);router[_0x6118('0x9')]('/:id',auth[_0x6118('0xb')](),controller[_0x6118('0xd')]);router[_0x6118('0xe')]('/',auth['isAuthenticated'](),controller[_0x6118('0xf')]);router[_0x6118('0x10')](_0x6118('0x11'),auth[_0x6118('0xb')](),controller[_0x6118('0x12')]);router[_0x6118('0x13')](_0x6118('0x11'),auth[_0x6118('0xb')](),controller[_0x6118('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ad49d2e..336306d 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 _0xa23f=['express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','destroy','exports','multer','util'];(function(_0x46a688,_0x3ee9f8){var _0x4bcb44=function(_0x294b66){while(--_0x294b66){_0x46a688['push'](_0x46a688['shift']());}};_0x4bcb44(++_0x3ee9f8);}(_0xa23f,0x7c));var _0xfa23=function(_0x8af5c8,_0x3c0659){_0x8af5c8=_0x8af5c8-0x0;var _0x3a242e=_0xa23f[_0x8af5c8];return _0x3a242e;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa23('0x2'));var router=express[_0xfa23('0x3')]();var auth=require(_0xfa23('0x4'));var interaction=require(_0xfa23('0x5'));var config=require('../../config/environment');var controller=require(_0xfa23('0x6'));router['get']('/',auth[_0xfa23('0x7')](),controller[_0xfa23('0x8')]);router[_0xfa23('0x9')](_0xfa23('0xa'),auth['isAuthenticated'](),controller[_0xfa23('0xb')]);router['get'](_0xfa23('0xc'),auth[_0xfa23('0x7')](),controller[_0xfa23('0xd')]);router[_0xfa23('0x9')](_0xfa23('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xfa23('0xf')]('/',auth['isAuthenticated'](),controller[_0xfa23('0x10')]);router['post'](_0xfa23('0xc'),auth[_0xfa23('0x7')](),controller[_0xfa23('0x11')]);router['put'](_0xfa23('0xa'),auth[_0xfa23('0x7')](),controller[_0xfa23('0x12')]);router['delete']('/:id',auth[_0xfa23('0x7')](),controller[_0xfa23('0x13')]);module[_0xfa23('0x14')]=router; \ No newline at end of file +var _0x6334=['getConfigurations','/:id/fields','getFields','post','create','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id/configurations'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x6334,0x119));var _0x4633=function(_0x1bd2a6,_0x45f0fc){_0x1bd2a6=_0x1bd2a6-0x0;var _0x525206=_0x6334[_0x1bd2a6];return _0x525206;};'use strict';var multer=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var path=require(_0x4633('0x2'));var timeout=require(_0x4633('0x3'));var express=require(_0x4633('0x4'));var router=express[_0x4633('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4633('0x6'));var config=require(_0x4633('0x7'));var controller=require(_0x4633('0x8'));router[_0x4633('0x9')]('/',auth[_0x4633('0xa')](),controller[_0x4633('0xb')]);router[_0x4633('0x9')]('/:id',auth[_0x4633('0xa')](),controller['show']);router[_0x4633('0x9')](_0x4633('0xc'),auth['isAuthenticated'](),controller[_0x4633('0xd')]);router[_0x4633('0x9')](_0x4633('0xe'),auth['isAuthenticated'](),controller[_0x4633('0xf')]);router[_0x4633('0x10')]('/',auth['isAuthenticated'](),controller[_0x4633('0x11')]);router[_0x4633('0x10')](_0x4633('0xc'),auth[_0x4633('0xa')](),controller['addConfiguration']);router[_0x4633('0x12')](_0x4633('0x13'),auth[_0x4633('0xa')](),controller['update']);router['delete']('/:id',auth[_0x4633('0xa')](),controller[_0x4633('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e69aea0..7e26839 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 _0x96a3=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x2c0011,_0x41391b){var _0x850b00=function(_0x2394e6){while(--_0x2394e6){_0x2c0011['push'](_0x2c0011['shift']());}};_0x850b00(++_0x41391b);}(_0x96a3,0x18f));var _0x396a=function(_0x332930,_0x5ace7a){_0x332930=_0x332930-0x0;var _0x378133=_0x96a3[_0x332930];return _0x378133;};'use strict';var Sequelize=require(_0x396a('0x0'));module[_0x396a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x396a('0x2')]},'username':{'type':Sequelize[_0x396a('0x2')]},'remoteUri':{'type':Sequelize[_0x396a('0x2')]},'authType':{'type':Sequelize[_0x396a('0x3')](_0x396a('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x396a('0x2')]},'consumerKey':{'type':Sequelize[_0x396a('0x2')]},'consumerSecret':{'type':Sequelize[_0x396a('0x2')]},'token':{'type':Sequelize[_0x396a('0x2')]},'tokenSecret':{'type':Sequelize[_0x396a('0x2')]},'serverUrl':{'type':Sequelize[_0x396a('0x2')]},'type':{'type':Sequelize[_0x396a('0x3')](_0x396a('0x5'),_0x396a('0x6')),'defaultValue':_0x396a('0x5')}}; \ No newline at end of file +var _0x69a7=['integrationTab','sequelize','exports','STRING','ENUM','basic','newTab'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x69a7,0x119));var _0x769a=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0x69a7[_0x241424];return _0x3da798;};'use strict';var Sequelize=require(_0x769a('0x0'));module[_0x769a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x769a('0x2')]},'username':{'type':Sequelize[_0x769a('0x2')]},'remoteUri':{'type':Sequelize[_0x769a('0x2')]},'authType':{'type':Sequelize[_0x769a('0x3')]('basic'),'defaultValue':_0x769a('0x4')},'password':{'type':Sequelize[_0x769a('0x2')]},'consumerKey':{'type':Sequelize[_0x769a('0x2')]},'consumerSecret':{'type':Sequelize[_0x769a('0x2')]},'token':{'type':Sequelize[_0x769a('0x2')]},'tokenSecret':{'type':Sequelize[_0x769a('0x2')]},'serverUrl':{'type':Sequelize[_0x769a('0x2')]},'type':{'type':Sequelize[_0x769a('0x3')]('integrationTab',_0x769a('0x5')),'defaultValue':_0x769a('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 04b16ac..74d9e33 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 _0x53f2=['sort','where','pick','filter','VIRTUAL','merge','options','DeskAccount','count','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','DeskConfiguration','Subjects','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','entries','label','statusCode','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','status','end','json','offset','limit','set','apply','reject','save','update','destroy','sendStatus','name','send','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4ab61e,_0x18e343){var _0x146120=function(_0x56de1a){while(--_0x56de1a){_0x4ab61e['push'](_0x4ab61e['shift']());}};_0x146120(++_0x18e343);}(_0x53f2,0x1a3));var _0x253f=function(_0x56f6fe,_0xb99e11){_0x56f6fe=_0x56f6fe-0x0;var _0x3700ef=_0x53f2[_0x56f6fe];return _0x3700ef;};'use strict';var pdf=require(_0x253f('0x0'));var emlformat=require(_0x253f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x253f('0x2'));var rp=require('request-promise');var moment=require(_0x253f('0x3'));var BPromise=require(_0x253f('0x4'));var Mustache=require(_0x253f('0x5'));var util=require(_0x253f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x253f('0x7'));var ejs=require(_0x253f('0x8'));var fs=require('fs');var _=require(_0x253f('0x9'));var squel=require(_0x253f('0xa'));var crypto=require(_0x253f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x253f('0xc'));var toCsv=require(_0x253f('0x7'));var querystring=require('querystring');var Papa=require(_0x253f('0xd'));var Redis=require(_0x253f('0xe'));var authService=require(_0x253f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x253f('0x10'));var hardwareService=require(_0x253f('0x11'));var logger=require(_0x253f('0x12'))(_0x253f('0x13'));var utils=require(_0x253f('0x14'));var config=require('../../config/environment');var db=require(_0x253f('0x15'))['db'];var integrations=require(_0x253f('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x253f('0x17')][_0x253f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2461ae,_0x4935fc,_0x353105){if(_0x353105){var _0x1735ea=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1735ea[_0x253f('0x19')](_0x4935fc)){return _0x2461ae;}else{throw new db['Sequelize'][(_0x253f('0x1a'))](_0x253f('0x1b'));}}else{return _0x2461ae;}}function respondWithRpcPromise(_0x3642dd,_0x11705f,_0x398b28,_0xb7c9a9){return new BPromise(function(_0x315b89,_0x34c0e7){var _0x35a5e2=_0xb7c9a9||client;return _0x35a5e2[_0x253f('0x1c')](_0x3642dd,_0x398b28)[_0x253f('0x1d')](function(_0x16f8a2){logger['info'](_0x253f('0x1e'),_0x11705f,_0x253f('0x1f'));logger[_0x253f('0x20')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x11705f,_0x253f('0x1f'),JSON[_0x253f('0x21')](_0x16f8a2));if(_0x16f8a2[_0x253f('0x22')]){if(_0x16f8a2[_0x253f('0x22')][_0x253f('0x23')]===0x1f4){logger[_0x253f('0x22')](_0x253f('0x1e'),_0x11705f,_0x16f8a2['error']['message']);return _0x34c0e7(_0x16f8a2[_0x253f('0x22')][_0x253f('0x24')]);}logger[_0x253f('0x22')](_0x253f('0x1e'),_0x11705f,_0x16f8a2[_0x253f('0x22')][_0x253f('0x24')]);return _0x315b89(_0x16f8a2[_0x253f('0x22')]['message']);}else{logger[_0x253f('0x25')]('DeskAccount,\x20%s,\x20%s',_0x11705f,'request\x20sent');_0x315b89(_0x16f8a2[_0x253f('0x26')][_0x253f('0x24')]);}})['catch'](function(_0x134589){logger[_0x253f('0x22')]('DeskAccount,\x20%s,\x20%s',_0x11705f,_0x134589);_0x34c0e7(_0x134589);});});}function respondWithStatusCode(_0x3ca342,_0x23a542){_0x23a542=_0x23a542||0xcc;return function(_0x414ddb){if(_0x414ddb){return _0x3ca342['sendStatus'](_0x23a542);}return _0x3ca342[_0x253f('0x27')](_0x23a542)[_0x253f('0x28')]();};}function respondWithResult(_0x4ffdad,_0x3f8d47){_0x3f8d47=_0x3f8d47||0xc8;return function(_0x34e70c){if(_0x34e70c){return _0x4ffdad['status'](_0x3f8d47)[_0x253f('0x29')](_0x34e70c);}};}function respondWithFilteredResult(_0x38ca20,_0x3e63f0){return function(_0x5088fa){if(_0x5088fa){var _0x42ad79=_0x5088fa['count'],_0x354624=_0x3e63f0[_0x253f('0x2a')],_0x150b0b=_0x3e63f0['offset']+_0x3e63f0[_0x253f('0x2b')],_0x5839e4;if(_0x150b0b>=_0x42ad79){_0x150b0b=_0x42ad79;_0x5839e4=0xc8;}else{_0x5839e4=0xce;}_0x38ca20[_0x253f('0x27')](_0x5839e4);return _0x38ca20[_0x253f('0x2c')]('Content-Range',_0x354624+'-'+_0x150b0b+'/'+_0x42ad79)[_0x253f('0x29')](_0x5088fa);}return null;};}function patchUpdates(_0x5904fd){return function(_0x4cc8ad){try{jsonpatch[_0x253f('0x2d')](_0x4cc8ad,_0x5904fd,!![]);}catch(_0x1ae75e){return BPromise[_0x253f('0x2e')](_0x1ae75e);}return _0x4cc8ad[_0x253f('0x2f')]();};}function saveUpdates(_0x38f726,_0x936b06){return function(_0x206bbc){if(_0x206bbc){return _0x206bbc[_0x253f('0x30')](_0x38f726)[_0x253f('0x1d')](function(_0x58a90f){return _0x58a90f;});}return null;};}function removeEntity(_0x2b9e0b,_0x4c1a6a){return function(_0x5e2bfb){if(_0x5e2bfb){return _0x5e2bfb[_0x253f('0x31')]()[_0x253f('0x1d')](function(){_0x2b9e0b[_0x253f('0x27')](0xcc)[_0x253f('0x28')]();});}};}function handleEntityNotFound(_0x3f9173,_0x314580){return function(_0x4faf9c){if(!_0x4faf9c){_0x3f9173[_0x253f('0x32')](0x194);}return _0x4faf9c;};}function handleError(_0xad22a5,_0x54d432){_0x54d432=_0x54d432||0x1f4;return function(_0x47303c){logger[_0x253f('0x22')](_0x47303c['stack']);if(_0x47303c[_0x253f('0x33')]){delete _0x47303c['name'];}_0xad22a5[_0x253f('0x27')](_0x54d432)[_0x253f('0x34')](_0x47303c);};}exports[_0x253f('0x35')]=function(_0x16340f,_0x96a156){var _0x222bb2={},_0x117652={},_0x1f99bb={'count':0x0,'rows':[]};var _0x4a9864=_['map'](db['DeskAccount']['rawAttributes'],function(_0x1543f6){return{'name':_0x1543f6[_0x253f('0x36')],'type':_0x1543f6[_0x253f('0x37')][_0x253f('0x38')]};});_0x117652[_0x253f('0x39')]=_[_0x253f('0x3a')](_0x4a9864,_0x253f('0x33'));_0x117652['query']=_[_0x253f('0x3b')](_0x16340f[_0x253f('0x3c')]);_0x117652[_0x253f('0x3d')]=_[_0x253f('0x3e')](_0x117652[_0x253f('0x39')],_0x117652[_0x253f('0x3c')]);_0x222bb2[_0x253f('0x3f')]=_[_0x253f('0x3e')](_0x117652[_0x253f('0x39')],qs[_0x253f('0x40')](_0x16340f[_0x253f('0x3c')]['fields']));_0x222bb2[_0x253f('0x3f')]=_0x222bb2[_0x253f('0x3f')][_0x253f('0x41')]?_0x222bb2[_0x253f('0x3f')]:_0x117652[_0x253f('0x39')];if(!_0x16340f[_0x253f('0x3c')][_0x253f('0x42')](_0x253f('0x43'))){_0x222bb2[_0x253f('0x2b')]=qs[_0x253f('0x2b')](_0x16340f[_0x253f('0x3c')][_0x253f('0x2b')]);_0x222bb2[_0x253f('0x2a')]=qs[_0x253f('0x2a')](_0x16340f[_0x253f('0x3c')][_0x253f('0x2a')]);}_0x222bb2[_0x253f('0x44')]=qs[_0x253f('0x45')](_0x16340f[_0x253f('0x3c')][_0x253f('0x45')]);_0x222bb2[_0x253f('0x46')]=qs['filters'](_[_0x253f('0x47')](_0x16340f[_0x253f('0x3c')],_0x117652[_0x253f('0x3d')]),_0x4a9864);if(_0x16340f[_0x253f('0x3c')][_0x253f('0x48')]){_0x222bb2['where']=_['merge'](_0x222bb2[_0x253f('0x46')],{'$or':_[_0x253f('0x3a')](_0x4a9864,function(_0x495257){if(_0x495257['type']!==_0x253f('0x49')){var _0x3f2820={};_0x3f2820[_0x495257[_0x253f('0x33')]]={'$like':'%'+_0x16340f[_0x253f('0x3c')][_0x253f('0x48')]+'%'};return _0x3f2820;}})});}_0x222bb2=_[_0x253f('0x4a')]({},_0x222bb2,_0x16340f[_0x253f('0x4b')]);var _0xd78f54={'where':_0x222bb2[_0x253f('0x46')]};return db[_0x253f('0x4c')][_0x253f('0x4d')](_0xd78f54)[_0x253f('0x1d')](function(_0x32c7b6){_0x1f99bb[_0x253f('0x4d')]=_0x32c7b6;if(_0x16340f[_0x253f('0x3c')][_0x253f('0x4e')]){_0x222bb2[_0x253f('0x4f')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x222bb2);})[_0x253f('0x1d')](function(_0x26af91){_0x1f99bb[_0x253f('0x50')]=_0x26af91;return _0x1f99bb;})['then'](respondWithFilteredResult(_0x96a156,_0x222bb2))['catch'](handleError(_0x96a156,null));};exports[_0x253f('0x51')]=function(_0x3543a3,_0x2c700c){var _0x5bb369={'raw':![],'where':{'id':_0x3543a3[_0x253f('0x52')]['id']}},_0xe555e4={};_0xe555e4[_0x253f('0x39')]=_[_0x253f('0x3b')](db[_0x253f('0x4c')][_0x253f('0x53')]);_0xe555e4[_0x253f('0x3c')]=_[_0x253f('0x3b')](_0x3543a3['query']);_0xe555e4[_0x253f('0x3d')]=_['intersection'](_0xe555e4['model'],_0xe555e4[_0x253f('0x3c')]);_0x5bb369[_0x253f('0x3f')]=_[_0x253f('0x3e')](_0xe555e4[_0x253f('0x39')],qs[_0x253f('0x40')](_0x3543a3[_0x253f('0x3c')]['fields']));_0x5bb369['attributes']=_0x5bb369[_0x253f('0x3f')]['length']?_0x5bb369['attributes']:_0xe555e4['model'];if(_0x3543a3[_0x253f('0x3c')][_0x253f('0x4e')]){_0x5bb369['include']=[{'all':!![]}];}_0x5bb369=_['merge']({},_0x5bb369,_0x3543a3[_0x253f('0x4b')]);return db[_0x253f('0x4c')][_0x253f('0x54')](_0x5bb369)['then'](handleEntityNotFound(_0x2c700c,null))[_0x253f('0x1d')](respondWithResult(_0x2c700c,null))[_0x253f('0x55')](handleError(_0x2c700c,null));};exports[_0x253f('0x56')]=function(_0x1c47fd,_0x7359de){return db[_0x253f('0x4c')][_0x253f('0x56')](_0x1c47fd[_0x253f('0x57')],{})[_0x253f('0x1d')](respondWithResult(_0x7359de,0xc9))[_0x253f('0x55')](handleError(_0x7359de,null));};exports[_0x253f('0x30')]=function(_0x4d79f5,_0x4aeed1){if(_0x4d79f5[_0x253f('0x57')]['id']){delete _0x4d79f5[_0x253f('0x57')]['id'];}return db[_0x253f('0x4c')][_0x253f('0x54')]({'where':{'id':_0x4d79f5[_0x253f('0x52')]['id']}})[_0x253f('0x1d')](handleEntityNotFound(_0x4aeed1,null))[_0x253f('0x1d')](saveUpdates(_0x4d79f5[_0x253f('0x57')],null))['then'](respondWithResult(_0x4aeed1,null))[_0x253f('0x55')](handleError(_0x4aeed1,null));};exports[_0x253f('0x31')]=function(_0x5d0227,_0x477f40){return db[_0x253f('0x4c')][_0x253f('0x54')]({'where':{'id':_0x5d0227[_0x253f('0x52')]['id']}})['then'](handleEntityNotFound(_0x477f40,null))[_0x253f('0x1d')](removeEntity(_0x477f40,null))[_0x253f('0x55')](handleError(_0x477f40,null));};exports[_0x253f('0x58')]=function(_0x19515a,_0x21003d,_0x3e7e1c){var _0x59b70a={};var _0x3a13a8={};var _0x1101d4;var _0x3b0464;return db[_0x253f('0x4c')]['findOne']({'where':{'id':_0x19515a['params']['id']}})[_0x253f('0x1d')](handleEntityNotFound(_0x21003d,null))[_0x253f('0x1d')](function(_0x9e12d7){if(_0x9e12d7){_0x1101d4=_0x9e12d7;_0x3a13a8[_0x253f('0x39')]=_[_0x253f('0x3b')](db['DeskConfiguration'][_0x253f('0x53')]);_0x3a13a8[_0x253f('0x3c')]=_[_0x253f('0x3b')](_0x19515a[_0x253f('0x3c')]);_0x3a13a8[_0x253f('0x3d')]=_['intersection'](_0x3a13a8[_0x253f('0x39')],_0x3a13a8[_0x253f('0x3c')]);_0x59b70a[_0x253f('0x3f')]=_[_0x253f('0x3e')](_0x3a13a8[_0x253f('0x39')],qs['fields'](_0x19515a[_0x253f('0x3c')][_0x253f('0x40')]));_0x59b70a[_0x253f('0x3f')]=_0x59b70a[_0x253f('0x3f')]['length']?_0x59b70a[_0x253f('0x3f')]:_0x3a13a8[_0x253f('0x39')];_0x59b70a[_0x253f('0x44')]=qs[_0x253f('0x45')](_0x19515a[_0x253f('0x3c')][_0x253f('0x45')]);_0x59b70a[_0x253f('0x46')]=qs['filters'](_[_0x253f('0x47')](_0x19515a[_0x253f('0x3c')],_0x3a13a8[_0x253f('0x3d')]));if(_0x19515a[_0x253f('0x3c')]['filter']){_0x59b70a['where']=_[_0x253f('0x4a')](_0x59b70a[_0x253f('0x46')],{'$or':_[_0x253f('0x3a')](_0x59b70a['attributes'],function(_0x1b0669){var _0x176cba={};_0x176cba[_0x1b0669]={'$like':'%'+_0x19515a[_0x253f('0x3c')]['filter']+'%'};return _0x176cba;})});}_0x59b70a=_[_0x253f('0x4a')]({},_0x59b70a,_0x19515a[_0x253f('0x4b')]);return _0x1101d4[_0x253f('0x58')](_0x59b70a);}})['then'](function(_0x466051){if(_0x466051){_0x3b0464=_0x466051[_0x253f('0x41')];if(!_0x19515a['query']['hasOwnProperty'](_0x253f('0x43'))){_0x59b70a[_0x253f('0x2b')]=qs[_0x253f('0x2b')](_0x19515a['query']['limit']);_0x59b70a['offset']=qs['offset'](_0x19515a[_0x253f('0x3c')][_0x253f('0x2a')]);}return _0x1101d4[_0x253f('0x58')](_0x59b70a);}})[_0x253f('0x1d')](function(_0x4f25cc){if(_0x4f25cc){return _0x4f25cc?{'count':_0x3b0464,'rows':_0x4f25cc}:null;}})['then'](respondWithResult(_0x21003d,null))['catch'](handleError(_0x21003d,null));};exports[_0x253f('0x59')]=function(_0x4785d4,_0x47f44f,_0x3865cc){if(_0x4785d4[_0x253f('0x57')]['id']){delete _0x4785d4[_0x253f('0x57')]['id'];}return db['DeskAccount'][_0x253f('0x5a')]({'where':{'id':_0x4785d4[_0x253f('0x52')]['id']}})['then'](handleEntityNotFound(_0x47f44f,null))[_0x253f('0x1d')](function(_0x1f1887){if(_0x1f1887){_0x4785d4[_0x253f('0x57')][_0x253f('0x5b')]=_0x1f1887['id'];_0x4785d4[_0x253f('0x57')]['Subjects']=integrations[_0x253f('0x5c')](_0x4785d4[_0x253f('0x57')][_0x253f('0x5d')],_0x4785d4['body'][_0x253f('0x37')]);_0x4785d4[_0x253f('0x57')][_0x253f('0x5e')]=integrations['getDescriptions'](_0x4785d4[_0x253f('0x57')]['channel'],_0x4785d4['body'][_0x253f('0x37')]);return db[_0x253f('0x5f')][_0x253f('0x56')](_0x4785d4[_0x253f('0x57')],{'include':[{'model':db['DeskField'],'as':_0x253f('0x60')},{'model':db[_0x253f('0x61')],'as':_0x253f('0x5e')}]});}return null;})[_0x253f('0x1d')](respondWithResult(_0x47f44f,null))['catch'](handleError(_0x47f44f,null));};exports[_0x253f('0x62')]=function(_0x107332,_0x2d6043,_0x4440af){var _0x3b2238=[{'name':_0x253f('0x63'),'label':_0x253f('0x63'),'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 _0x44c680='';return db[_0x253f('0x4c')][_0x253f('0x5a')]({'where':{'id':_0x107332[_0x253f('0x52')]['id']},'attributes':['id',_0x253f('0x64'),_0x253f('0x65'),_0x253f('0x66'),'password',_0x253f('0x67'),_0x253f('0x68'),_0x253f('0x69'),_0x253f('0x6a')]})[_0x253f('0x1d')](handleEntityNotFound(_0x2d6043,null))[_0x253f('0x1d')](function(_0x3c4bc0){if(_0x3c4bc0){_0x44c680=_0x3c4bc0[_0x253f('0x64')];var _0x29af1f=_0x44c680[_0x253f('0x6b')](-0x1);if(_0x29af1f==='/'){_0x44c680=_0x44c680['substring'](0x0,_0x44c680[_0x253f('0x6c')](_0x29af1f));}var _0x1d3b04={'method':'GET','uri':util[_0x253f('0x6d')](_0x253f('0x6e'),_0x44c680),'headers':{'Content-Type':_0x253f('0x6f'),'Accept':_0x253f('0x6f')},'json':!![]};if(_0x3c4bc0[_0x253f('0x65')]===_0x253f('0x70')){_0x1d3b04['headers'][_0x253f('0x71')]=util[_0x253f('0x6d')](_0x253f('0x72'),new Buffer(util[_0x253f('0x6d')](_0x253f('0x73'),_0x3c4bc0[_0x253f('0x66')],_0x3c4bc0['password']))[_0x253f('0x74')](_0x253f('0x75')));}return rp(_0x1d3b04)[_0x253f('0x1d')](function(_0x434417){return _0x3b2238['concat'](_['map'](_0x434417[_0x253f('0x76')][_0x253f('0x77')],function(_0x26d72a){return{'id':_0x26d72a[_0x253f('0x33')],'name':_0x26d72a[_0x253f('0x33')],'type':_0x26d72a[_0x253f('0x37')],'active':_0x26d72a['active'],'label':_0x26d72a[_0x253f('0x78')],'custom':!![]};}));});}})[_0x253f('0x1d')](function(_0x183328){return{'count':_0x183328[_0x253f('0x41')],'rows':_0x183328};})[_0x253f('0x1d')](respondWithResult(_0x2d6043,null))[_0x253f('0x55')](function(_0xb0db41){var _0x335fa8=_0x107332[_0x253f('0x3c')]['test']?0x1f4:_0xb0db41[_0x253f('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x335fa8,JSON['stringify'](_0xb0db41));delete _0xb0db41[_0x253f('0x33')];if(_0x335fa8===0x191){_0x335fa8=0x190;}_0x2d6043[_0x253f('0x27')](_0x335fa8)[_0x253f('0x34')](_0x107332[_0x253f('0x3c')][_0x253f('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0xb0db41[_0x253f('0x79')]}:_0xb0db41);});}; \ No newline at end of file +var _0xf8a6=['getSubjects','getDescriptions','channel','DeskField','Descriptions','getFields','priority','authType','username','password','consumerKey','consumerSecret','token','remoteUri','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','%s:%s','base64','concat','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../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','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','count','offset','limit','json','apply','save','update','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','include','rows','show','params','includeAll','options','find','create','body','destroy','DeskConfiguration','getConfigurations','addConfiguration','findOne','Subjects'];(function(_0x6c008,_0x226dbb){var _0x2746b8=function(_0x3278fb){while(--_0x3278fb){_0x6c008['push'](_0x6c008['shift']());}};_0x2746b8(++_0x226dbb);}(_0xf8a6,0x9b));var _0x6f8a=function(_0x43a7c4,_0x24ec22){_0x43a7c4=_0x43a7c4-0x0;var _0x54241e=_0xf8a6[_0x43a7c4];return _0x54241e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6f8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f8a('0x1'));var jsonpatch=require(_0x6f8a('0x2'));var rp=require(_0x6f8a('0x3'));var moment=require(_0x6f8a('0x4'));var BPromise=require(_0x6f8a('0x5'));var Mustache=require('mustache');var util=require(_0x6f8a('0x6'));var path=require(_0x6f8a('0x7'));var sox=require('sox');var csv=require(_0x6f8a('0x8'));var ejs=require(_0x6f8a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f8a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6f8a('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6f8a('0xc'));var Redis=require('ioredis');var authService=require(_0x6f8a('0xd'));var qs=require(_0x6f8a('0xe'));var as=require(_0x6f8a('0xf'));var hardwareService=require(_0x6f8a('0x10'));var logger=require(_0x6f8a('0x11'))('api');var utils=require(_0x6f8a('0x12'));var config=require(_0x6f8a('0x13'));var db=require(_0x6f8a('0x14'))['db'];var integrations=require(_0x6f8a('0x15'));var jayson=require(_0x6f8a('0x16'));var client=jayson[_0x6f8a('0x17')][_0x6f8a('0x18')]({'port':0x232a});function checkPasswordPattern(_0xbab398,_0x9a6d73,_0x16f9c0){if(_0x16f9c0){var _0x82d0ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x82d0ba[_0x6f8a('0x19')](_0x9a6d73)){return _0xbab398;}else{throw new db[(_0x6f8a('0x1a'))][(_0x6f8a('0x1b'))](_0x6f8a('0x1c'));}}else{return _0xbab398;}}function respondWithRpcPromise(_0x542ec9,_0x43a694,_0x2ff8ca,_0x2ff31b){return new BPromise(function(_0x4e36fd,_0x33544f){var _0x4eb0ab=_0x2ff31b||client;return _0x4eb0ab[_0x6f8a('0x1d')](_0x542ec9,_0x2ff8ca)[_0x6f8a('0x1e')](function(_0x3d0604){logger[_0x6f8a('0x1f')](_0x6f8a('0x20'),_0x43a694,_0x6f8a('0x21'));logger[_0x6f8a('0x22')](_0x6f8a('0x23'),_0x43a694,_0x6f8a('0x21'),JSON[_0x6f8a('0x24')](_0x3d0604));if(_0x3d0604[_0x6f8a('0x25')]){if(_0x3d0604[_0x6f8a('0x25')][_0x6f8a('0x26')]===0x1f4){logger['error'](_0x6f8a('0x20'),_0x43a694,_0x3d0604[_0x6f8a('0x25')]['message']);return _0x33544f(_0x3d0604['error'][_0x6f8a('0x27')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x43a694,_0x3d0604[_0x6f8a('0x25')]['message']);return _0x4e36fd(_0x3d0604[_0x6f8a('0x25')][_0x6f8a('0x27')]);}else{logger[_0x6f8a('0x1f')](_0x6f8a('0x20'),_0x43a694,'request\x20sent');_0x4e36fd(_0x3d0604['result']['message']);}})[_0x6f8a('0x28')](function(_0x320a37){logger[_0x6f8a('0x25')](_0x6f8a('0x20'),_0x43a694,_0x320a37);_0x33544f(_0x320a37);});});}function respondWithStatusCode(_0x4b48ab,_0x140ce3){_0x140ce3=_0x140ce3||0xcc;return function(_0x144e96){if(_0x144e96){return _0x4b48ab['sendStatus'](_0x140ce3);}return _0x4b48ab['status'](_0x140ce3)[_0x6f8a('0x29')]();};}function respondWithResult(_0x6eefad,_0xd9b4df){_0xd9b4df=_0xd9b4df||0xc8;return function(_0xe0b34){if(_0xe0b34){return _0x6eefad[_0x6f8a('0x2a')](_0xd9b4df)['json'](_0xe0b34);}};}function respondWithFilteredResult(_0x4e042a,_0x53e640){return function(_0x3243b4){if(_0x3243b4){var _0x245cb3=_0x3243b4[_0x6f8a('0x2b')],_0x238e09=_0x53e640[_0x6f8a('0x2c')],_0x456eac=_0x53e640[_0x6f8a('0x2c')]+_0x53e640[_0x6f8a('0x2d')],_0x1fb34f;if(_0x456eac>=_0x245cb3){_0x456eac=_0x245cb3;_0x1fb34f=0xc8;}else{_0x1fb34f=0xce;}_0x4e042a[_0x6f8a('0x2a')](_0x1fb34f);return _0x4e042a['set']('Content-Range',_0x238e09+'-'+_0x456eac+'/'+_0x245cb3)[_0x6f8a('0x2e')](_0x3243b4);}return null;};}function patchUpdates(_0x19973b){return function(_0x2c3add){try{jsonpatch[_0x6f8a('0x2f')](_0x2c3add,_0x19973b,!![]);}catch(_0x24b54d){return BPromise['reject'](_0x24b54d);}return _0x2c3add[_0x6f8a('0x30')]();};}function saveUpdates(_0xb17594,_0x257b3e){return function(_0x2598c3){if(_0x2598c3){return _0x2598c3[_0x6f8a('0x31')](_0xb17594)[_0x6f8a('0x1e')](function(_0x559140){return _0x559140;});}return null;};}function removeEntity(_0x363b97,_0x370523){return function(_0xfc4d1){if(_0xfc4d1){return _0xfc4d1['destroy']()[_0x6f8a('0x1e')](function(){_0x363b97[_0x6f8a('0x2a')](0xcc)[_0x6f8a('0x29')]();});}};}function handleEntityNotFound(_0xd8d995,_0x4f0ff5){return function(_0x4d105f){if(!_0x4d105f){_0xd8d995[_0x6f8a('0x32')](0x194);}return _0x4d105f;};}function handleError(_0x3d1df7,_0x2bfacd){_0x2bfacd=_0x2bfacd||0x1f4;return function(_0x554d3f){logger['error'](_0x554d3f[_0x6f8a('0x33')]);if(_0x554d3f[_0x6f8a('0x34')]){delete _0x554d3f[_0x6f8a('0x34')];}_0x3d1df7[_0x6f8a('0x2a')](_0x2bfacd)[_0x6f8a('0x35')](_0x554d3f);};}exports[_0x6f8a('0x36')]=function(_0x288c05,_0x2109a2){var _0x56ebc4={},_0x2371be={},_0x35d6e9={'count':0x0,'rows':[]};var _0x11c05d=_[_0x6f8a('0x37')](db[_0x6f8a('0x38')][_0x6f8a('0x39')],function(_0x390e5a){return{'name':_0x390e5a[_0x6f8a('0x3a')],'type':_0x390e5a['type'][_0x6f8a('0x3b')]};});_0x2371be['model']=_[_0x6f8a('0x37')](_0x11c05d,'name');_0x2371be['query']=_[_0x6f8a('0x3c')](_0x288c05[_0x6f8a('0x3d')]);_0x2371be[_0x6f8a('0x3e')]=_[_0x6f8a('0x3f')](_0x2371be['model'],_0x2371be[_0x6f8a('0x3d')]);_0x56ebc4[_0x6f8a('0x40')]=_['intersection'](_0x2371be[_0x6f8a('0x41')],qs[_0x6f8a('0x42')](_0x288c05['query'][_0x6f8a('0x42')]));_0x56ebc4['attributes']=_0x56ebc4[_0x6f8a('0x40')][_0x6f8a('0x43')]?_0x56ebc4[_0x6f8a('0x40')]:_0x2371be['model'];if(!_0x288c05[_0x6f8a('0x3d')]['hasOwnProperty'](_0x6f8a('0x44'))){_0x56ebc4[_0x6f8a('0x2d')]=qs['limit'](_0x288c05[_0x6f8a('0x3d')][_0x6f8a('0x2d')]);_0x56ebc4[_0x6f8a('0x2c')]=qs[_0x6f8a('0x2c')](_0x288c05['query'][_0x6f8a('0x2c')]);}_0x56ebc4[_0x6f8a('0x45')]=qs['sort'](_0x288c05[_0x6f8a('0x3d')][_0x6f8a('0x46')]);_0x56ebc4[_0x6f8a('0x47')]=qs[_0x6f8a('0x3e')](_[_0x6f8a('0x48')](_0x288c05[_0x6f8a('0x3d')],_0x2371be[_0x6f8a('0x3e')]),_0x11c05d);if(_0x288c05[_0x6f8a('0x3d')][_0x6f8a('0x49')]){_0x56ebc4[_0x6f8a('0x47')]=_[_0x6f8a('0x4a')](_0x56ebc4[_0x6f8a('0x47')],{'$or':_[_0x6f8a('0x37')](_0x11c05d,function(_0x163013){if(_0x163013[_0x6f8a('0x4b')]!=='VIRTUAL'){var _0x4faec3={};_0x4faec3[_0x163013[_0x6f8a('0x34')]]={'$like':'%'+_0x288c05[_0x6f8a('0x3d')]['filter']+'%'};return _0x4faec3;}})});}_0x56ebc4=_[_0x6f8a('0x4a')]({},_0x56ebc4,_0x288c05['options']);var _0x555470={'where':_0x56ebc4['where']};return db['DeskAccount'][_0x6f8a('0x2b')](_0x555470)[_0x6f8a('0x1e')](function(_0x29ee08){_0x35d6e9['count']=_0x29ee08;if(_0x288c05[_0x6f8a('0x3d')]['includeAll']){_0x56ebc4[_0x6f8a('0x4c')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x56ebc4);})[_0x6f8a('0x1e')](function(_0x4f0b65){_0x35d6e9[_0x6f8a('0x4d')]=_0x4f0b65;return _0x35d6e9;})[_0x6f8a('0x1e')](respondWithFilteredResult(_0x2109a2,_0x56ebc4))[_0x6f8a('0x28')](handleError(_0x2109a2,null));};exports[_0x6f8a('0x4e')]=function(_0x4998da,_0x1ee63b){var _0x142f65={'raw':![],'where':{'id':_0x4998da[_0x6f8a('0x4f')]['id']}},_0x19c2a3={};_0x19c2a3[_0x6f8a('0x41')]=_[_0x6f8a('0x3c')](db[_0x6f8a('0x38')][_0x6f8a('0x39')]);_0x19c2a3['query']=_[_0x6f8a('0x3c')](_0x4998da['query']);_0x19c2a3[_0x6f8a('0x3e')]=_[_0x6f8a('0x3f')](_0x19c2a3[_0x6f8a('0x41')],_0x19c2a3[_0x6f8a('0x3d')]);_0x142f65[_0x6f8a('0x40')]=_[_0x6f8a('0x3f')](_0x19c2a3[_0x6f8a('0x41')],qs['fields'](_0x4998da[_0x6f8a('0x3d')]['fields']));_0x142f65[_0x6f8a('0x40')]=_0x142f65['attributes'][_0x6f8a('0x43')]?_0x142f65[_0x6f8a('0x40')]:_0x19c2a3[_0x6f8a('0x41')];if(_0x4998da[_0x6f8a('0x3d')][_0x6f8a('0x50')]){_0x142f65[_0x6f8a('0x4c')]=[{'all':!![]}];}_0x142f65=_[_0x6f8a('0x4a')]({},_0x142f65,_0x4998da[_0x6f8a('0x51')]);return db[_0x6f8a('0x38')][_0x6f8a('0x52')](_0x142f65)[_0x6f8a('0x1e')](handleEntityNotFound(_0x1ee63b,null))[_0x6f8a('0x1e')](respondWithResult(_0x1ee63b,null))[_0x6f8a('0x28')](handleError(_0x1ee63b,null));};exports[_0x6f8a('0x53')]=function(_0x50dc55,_0x393d6a){return db['DeskAccount']['create'](_0x50dc55[_0x6f8a('0x54')],{})[_0x6f8a('0x1e')](respondWithResult(_0x393d6a,0xc9))[_0x6f8a('0x28')](handleError(_0x393d6a,null));};exports[_0x6f8a('0x31')]=function(_0x332629,_0x1e1163){if(_0x332629['body']['id']){delete _0x332629['body']['id'];}return db['DeskAccount'][_0x6f8a('0x52')]({'where':{'id':_0x332629[_0x6f8a('0x4f')]['id']}})[_0x6f8a('0x1e')](handleEntityNotFound(_0x1e1163,null))['then'](saveUpdates(_0x332629[_0x6f8a('0x54')],null))[_0x6f8a('0x1e')](respondWithResult(_0x1e1163,null))[_0x6f8a('0x28')](handleError(_0x1e1163,null));};exports[_0x6f8a('0x55')]=function(_0x237659,_0x44348a){return db[_0x6f8a('0x38')][_0x6f8a('0x52')]({'where':{'id':_0x237659[_0x6f8a('0x4f')]['id']}})['then'](handleEntityNotFound(_0x44348a,null))[_0x6f8a('0x1e')](removeEntity(_0x44348a,null))[_0x6f8a('0x28')](handleError(_0x44348a,null));};exports['getConfigurations']=function(_0x521661,_0x1a0353,_0x25887d){var _0x1e8fc7={};var _0x4ae1d7={};var _0x1636eb;var _0x6bf3e6;return db[_0x6f8a('0x38')]['findOne']({'where':{'id':_0x521661[_0x6f8a('0x4f')]['id']}})[_0x6f8a('0x1e')](handleEntityNotFound(_0x1a0353,null))[_0x6f8a('0x1e')](function(_0x82dc3a){if(_0x82dc3a){_0x1636eb=_0x82dc3a;_0x4ae1d7[_0x6f8a('0x41')]=_[_0x6f8a('0x3c')](db[_0x6f8a('0x56')][_0x6f8a('0x39')]);_0x4ae1d7['query']=_['keys'](_0x521661['query']);_0x4ae1d7['filters']=_[_0x6f8a('0x3f')](_0x4ae1d7[_0x6f8a('0x41')],_0x4ae1d7['query']);_0x1e8fc7[_0x6f8a('0x40')]=_[_0x6f8a('0x3f')](_0x4ae1d7[_0x6f8a('0x41')],qs[_0x6f8a('0x42')](_0x521661['query']['fields']));_0x1e8fc7[_0x6f8a('0x40')]=_0x1e8fc7[_0x6f8a('0x40')][_0x6f8a('0x43')]?_0x1e8fc7[_0x6f8a('0x40')]:_0x4ae1d7[_0x6f8a('0x41')];_0x1e8fc7[_0x6f8a('0x45')]=qs[_0x6f8a('0x46')](_0x521661['query'][_0x6f8a('0x46')]);_0x1e8fc7[_0x6f8a('0x47')]=qs['filters'](_['pick'](_0x521661['query'],_0x4ae1d7[_0x6f8a('0x3e')]));if(_0x521661[_0x6f8a('0x3d')][_0x6f8a('0x49')]){_0x1e8fc7[_0x6f8a('0x47')]=_[_0x6f8a('0x4a')](_0x1e8fc7['where'],{'$or':_[_0x6f8a('0x37')](_0x1e8fc7[_0x6f8a('0x40')],function(_0x2f3418){var _0x384ae6={};_0x384ae6[_0x2f3418]={'$like':'%'+_0x521661[_0x6f8a('0x3d')][_0x6f8a('0x49')]+'%'};return _0x384ae6;})});}_0x1e8fc7=_['merge']({},_0x1e8fc7,_0x521661[_0x6f8a('0x51')]);return _0x1636eb[_0x6f8a('0x57')](_0x1e8fc7);}})[_0x6f8a('0x1e')](function(_0x3c500e){if(_0x3c500e){_0x6bf3e6=_0x3c500e[_0x6f8a('0x43')];if(!_0x521661[_0x6f8a('0x3d')]['hasOwnProperty'](_0x6f8a('0x44'))){_0x1e8fc7['limit']=qs['limit'](_0x521661[_0x6f8a('0x3d')][_0x6f8a('0x2d')]);_0x1e8fc7[_0x6f8a('0x2c')]=qs['offset'](_0x521661['query'][_0x6f8a('0x2c')]);}return _0x1636eb[_0x6f8a('0x57')](_0x1e8fc7);}})[_0x6f8a('0x1e')](function(_0x1f11a7){if(_0x1f11a7){return _0x1f11a7?{'count':_0x6bf3e6,'rows':_0x1f11a7}:null;}})[_0x6f8a('0x1e')](respondWithResult(_0x1a0353,null))[_0x6f8a('0x28')](handleError(_0x1a0353,null));};exports[_0x6f8a('0x58')]=function(_0x29bdcc,_0xc62a9,_0x738d6a){if(_0x29bdcc[_0x6f8a('0x54')]['id']){delete _0x29bdcc['body']['id'];}return db[_0x6f8a('0x38')][_0x6f8a('0x59')]({'where':{'id':_0x29bdcc[_0x6f8a('0x4f')]['id']}})[_0x6f8a('0x1e')](handleEntityNotFound(_0xc62a9,null))[_0x6f8a('0x1e')](function(_0x1a25d8){if(_0x1a25d8){_0x29bdcc[_0x6f8a('0x54')]['AccountId']=_0x1a25d8['id'];_0x29bdcc['body'][_0x6f8a('0x5a')]=integrations[_0x6f8a('0x5b')](_0x29bdcc[_0x6f8a('0x54')]['channel'],_0x29bdcc[_0x6f8a('0x54')][_0x6f8a('0x4b')]);_0x29bdcc[_0x6f8a('0x54')]['Descriptions']=integrations[_0x6f8a('0x5c')](_0x29bdcc[_0x6f8a('0x54')][_0x6f8a('0x5d')],_0x29bdcc['body'][_0x6f8a('0x4b')]);return db[_0x6f8a('0x56')]['create'](_0x29bdcc['body'],{'include':[{'model':db[_0x6f8a('0x5e')],'as':_0x6f8a('0x5a')},{'model':db[_0x6f8a('0x5e')],'as':_0x6f8a('0x5f')}]});}return null;})[_0x6f8a('0x1e')](respondWithResult(_0xc62a9,null))[_0x6f8a('0x28')](handleError(_0xc62a9,null));};exports[_0x6f8a('0x60')]=function(_0x121b2a,_0x428952,_0x1e20e0){var _0x1e423a=[{'name':'priority','label':_0x6f8a('0x61'),'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 _0x1e5985='';return db[_0x6f8a('0x38')][_0x6f8a('0x59')]({'where':{'id':_0x121b2a[_0x6f8a('0x4f')]['id']},'attributes':['id','remoteUri',_0x6f8a('0x62'),_0x6f8a('0x63'),_0x6f8a('0x64'),_0x6f8a('0x65'),_0x6f8a('0x66'),_0x6f8a('0x67'),'tokenSecret']})[_0x6f8a('0x1e')](handleEntityNotFound(_0x428952,null))[_0x6f8a('0x1e')](function(_0x5af820){if(_0x5af820){_0x1e5985=_0x5af820[_0x6f8a('0x68')];var _0x432d4b=_0x1e5985[_0x6f8a('0x69')](-0x1);if(_0x432d4b==='/'){_0x1e5985=_0x1e5985['substring'](0x0,_0x1e5985[_0x6f8a('0x6a')](_0x432d4b));}var _0x111de6={'method':_0x6f8a('0x6b'),'uri':util[_0x6f8a('0x6c')](_0x6f8a('0x6d'),_0x1e5985),'headers':{'Content-Type':_0x6f8a('0x6e'),'Accept':_0x6f8a('0x6e')},'json':!![]};if(_0x5af820[_0x6f8a('0x62')]===_0x6f8a('0x6f')){_0x111de6[_0x6f8a('0x70')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0x6f8a('0x6c')](_0x6f8a('0x71'),_0x5af820[_0x6f8a('0x63')],_0x5af820['password']))['toString'](_0x6f8a('0x72')));}return rp(_0x111de6)[_0x6f8a('0x1e')](function(_0x58aaa7){return _0x1e423a[_0x6f8a('0x73')](_[_0x6f8a('0x37')](_0x58aaa7[_0x6f8a('0x74')][_0x6f8a('0x75')],function(_0x52a7e5){return{'id':_0x52a7e5['name'],'name':_0x52a7e5['name'],'type':_0x52a7e5[_0x6f8a('0x4b')],'active':_0x52a7e5[_0x6f8a('0x76')],'label':_0x52a7e5[_0x6f8a('0x77')],'custom':!![]};}));});}})[_0x6f8a('0x1e')](function(_0x586327){return{'count':_0x586327[_0x6f8a('0x43')],'rows':_0x586327};})[_0x6f8a('0x1e')](respondWithResult(_0x428952,null))[_0x6f8a('0x28')](function(_0x525249){var _0x3efce3=_0x121b2a['query'][_0x6f8a('0x19')]?0x1f4:_0x525249['statusCode']||0x1f4;logger['error'](_0x6f8a('0x78'),_0x6f8a('0x60'),_0x3efce3,JSON[_0x6f8a('0x24')](_0x525249));delete _0x525249[_0x6f8a('0x34')];if(_0x3efce3===0x191){_0x3efce3=0x190;}_0x428952['status'](_0x3efce3)['send'](_0x121b2a[_0x6f8a('0x3d')][_0x6f8a('0x19')]?{'message':_0x6f8a('0x79'),'statusCode':_0x525249[_0x6f8a('0x7a')]}:_0x525249);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3ae7f79..4d39947 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 _0x02fa=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util','../../config/logger','moment','request-promise'];(function(_0x658305,_0x53aa13){var _0x552daf=function(_0x236833){while(--_0x236833){_0x658305['push'](_0x658305['shift']());}};_0x552daf(++_0x53aa13);}(_0x02fa,0x140));var _0xa02f=function(_0xc89464,_0x44ed6b){_0xc89464=_0xc89464-0x0;var _0x1557a3=_0x02fa[_0xc89464];return _0x1557a3;};'use strict';var _=require('lodash');var util=require(_0xa02f('0x0'));var logger=require(_0xa02f('0x1'))('api');var moment=require(_0xa02f('0x2'));var BPromise=require('bluebird');var rp=require(_0xa02f('0x3'));var fs=require('fs');var path=require(_0xa02f('0x4'));var rimraf=require(_0xa02f('0x5'));var config=require(_0xa02f('0x6'));var attributes=require(_0xa02f('0x7'));var integrations=require(_0xa02f('0x8'));module[_0xa02f('0x9')]=function(_0xb807a2,_0x5b4c2d){return _0xb807a2['define'](_0xa02f('0xa'),attributes,{'tableName':_0xa02f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb682=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xb682,0x11d));var _0x2b68=function(_0x5532e1,_0x388cd1){_0x5532e1=_0x5532e1-0x0;var _0x276bb5=_0xb682[_0x5532e1];return _0x276bb5;};'use strict';var _=require(_0x2b68('0x0'));var util=require(_0x2b68('0x1'));var logger=require(_0x2b68('0x2'))('api');var moment=require(_0x2b68('0x3'));var BPromise=require(_0x2b68('0x4'));var rp=require(_0x2b68('0x5'));var fs=require('fs');var path=require(_0x2b68('0x6'));var rimraf=require(_0x2b68('0x7'));var config=require(_0x2b68('0x8'));var attributes=require(_0x2b68('0x9'));var integrations=require(_0x2b68('0xa'));module[_0x2b68('0xb')]=function(_0x5e7d2e,_0x501079){return _0x5e7d2e[_0x2b68('0xc')](_0x2b68('0xd'),attributes,{'tableName':_0x2b68('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index ed48386..fff7cdc 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 _0x5997=['moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','options','raw','where','limit','map','include','model','attributes','find','ShowDeskAccount','lodash','util'];(function(_0x13fc4b,_0x2cfb3f){var _0x56f81f=function(_0x332fc2){while(--_0x332fc2){_0x13fc4b['push'](_0x13fc4b['shift']());}};_0x56f81f(++_0x2cfb3f);}(_0x5997,0x13e));var _0x7599=function(_0x5a4b6e,_0x2d7e09){_0x5a4b6e=_0x5a4b6e-0x0;var _0x1c68ed=_0x5997[_0x5a4b6e];return _0x1c68ed;};'use strict';var _=require(_0x7599('0x0'));var util=require(_0x7599('0x1'));var moment=require(_0x7599('0x2'));var BPromise=require(_0x7599('0x3'));var rs=require(_0x7599('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7599('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7599('0x6'));var config=require(_0x7599('0x7'));var jayson=require(_0x7599('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8d10dc,_0x5bcb22,_0x5a9aac){return new BPromise(function(_0x5cbd2e,_0x5190dc){return client['request'](_0x8d10dc,_0x5a9aac)[_0x7599('0x9')](function(_0x4724ed){logger[_0x7599('0xa')](_0x7599('0xb'),_0x5bcb22,_0x7599('0xc'));logger[_0x7599('0xd')](_0x7599('0xe'),_0x5bcb22,_0x7599('0xc'),JSON[_0x7599('0xf')](_0x4724ed));if(_0x4724ed[_0x7599('0x10')]){if(_0x4724ed[_0x7599('0x10')][_0x7599('0x11')]===0x1f4){logger[_0x7599('0x10')](_0x7599('0xb'),_0x5bcb22,_0x4724ed[_0x7599('0x10')]['message']);return _0x5190dc(_0x4724ed['error'][_0x7599('0x12')]);}logger['error'](_0x7599('0xb'),_0x5bcb22,_0x4724ed[_0x7599('0x10')][_0x7599('0x12')]);return _0x5cbd2e(_0x4724ed['error'][_0x7599('0x12')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x5bcb22,'request\x20sent');_0x5cbd2e(_0x4724ed['result'][_0x7599('0x12')]);}})[_0x7599('0x13')](function(_0x40d92a){logger[_0x7599('0x10')]('DeskAccount,\x20%s,\x20%s',_0x5bcb22,_0x40d92a);_0x5190dc(_0x40d92a);});});}exports[_0x7599('0x14')]=function(_0xf9d609){var _0x20261d=this;return new Promise(function(_0x556df1,_0x140d9d){return db[_0x7599('0x15')]['findAll']({'raw':_0xf9d609[_0x7599('0x16')]?_0xf9d609[_0x7599('0x16')][_0x7599('0x17')]===undefined?!![]:![]:!![],'where':_0xf9d609[_0x7599('0x16')]?_0xf9d609['options'][_0x7599('0x18')]||null:null,'attributes':_0xf9d609[_0x7599('0x16')]?_0xf9d609['options']['attributes']||null:null,'limit':_0xf9d609[_0x7599('0x16')]?_0xf9d609[_0x7599('0x16')][_0x7599('0x19')]||null:null,'include':_0xf9d609[_0x7599('0x16')]?_0xf9d609['options']['include']?_[_0x7599('0x1a')](_0xf9d609['options'][_0x7599('0x1b')],function(_0x1d4377){return{'model':db[_0x1d4377[_0x7599('0x1c')]],'as':_0x1d4377['as'],'attributes':_0x1d4377[_0x7599('0x1d')],'include':_0x1d4377[_0x7599('0x1b')]?_[_0x7599('0x1a')](_0x1d4377[_0x7599('0x1b')],function(_0x27139c){return{'model':db[_0x27139c[_0x7599('0x1c')]],'as':_0x27139c['as'],'attributes':_0x27139c[_0x7599('0x1d')],'include':_0x27139c[_0x7599('0x1b')]?_[_0x7599('0x1a')](_0x27139c[_0x7599('0x1b')],function(_0x5150dd){return{'model':db[_0x5150dd[_0x7599('0x1c')]],'as':_0x5150dd['as'],'attributes':_0x5150dd[_0x7599('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7599('0x9')](function(_0x26da98){logger[_0x7599('0xa')]('GetDeskAccount',_0xf9d609);logger[_0x7599('0xd')]('GetDeskAccount',_0xf9d609,JSON[_0x7599('0xf')](_0x26da98));_0x556df1(_0x26da98);})[_0x7599('0x13')](function(_0x1d018c){logger[_0x7599('0x10')](_0x7599('0x14'),_0x1d018c[_0x7599('0x12')],_0xf9d609);_0x140d9d(_0x20261d[_0x7599('0x10')](0x1f4,_0x1d018c['message']));});});};exports['ShowDeskAccount']=function(_0x32baba){var _0x308860=this;return new Promise(function(_0x13d9f5,_0x5e7062){return db[_0x7599('0x15')][_0x7599('0x1e')]({'raw':_0x32baba[_0x7599('0x16')]?_0x32baba[_0x7599('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32baba[_0x7599('0x16')]?_0x32baba['options']['where']||null:null,'attributes':_0x32baba[_0x7599('0x16')]?_0x32baba['options'][_0x7599('0x1d')]||null:null,'include':_0x32baba[_0x7599('0x16')]?_0x32baba[_0x7599('0x16')]['include']?_[_0x7599('0x1a')](_0x32baba[_0x7599('0x16')]['include'],function(_0x5523ad){return{'model':db[_0x5523ad[_0x7599('0x1c')]],'as':_0x5523ad['as'],'attributes':_0x5523ad[_0x7599('0x1d')],'include':_0x5523ad[_0x7599('0x1b')]?_[_0x7599('0x1a')](_0x5523ad[_0x7599('0x1b')],function(_0x1fe2ce){return{'model':db[_0x1fe2ce[_0x7599('0x1c')]],'as':_0x1fe2ce['as'],'attributes':_0x1fe2ce['attributes'],'include':_0x1fe2ce['include']?_[_0x7599('0x1a')](_0x1fe2ce['include'],function(_0x5986f7){return{'model':db[_0x5986f7['model']],'as':_0x5986f7['as'],'attributes':_0x5986f7[_0x7599('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae3ce){logger[_0x7599('0xa')](_0x7599('0x1f'),_0x32baba);logger[_0x7599('0xd')](_0x7599('0x1f'),_0x32baba,JSON[_0x7599('0xf')](_0x4ae3ce));_0x13d9f5(_0x4ae3ce);})[_0x7599('0x13')](function(_0x270578){logger[_0x7599('0x10')](_0x7599('0x1f'),_0x270578[_0x7599('0x12')],_0x32baba);_0x5e7062(_0x308860[_0x7599('0x10')](0x1f4,_0x270578[_0x7599('0x12')]));});});}; \ No newline at end of file +var _0x5db1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x5db1,0x90));var _0x15db=function(_0x408e6b,_0x165500){_0x408e6b=_0x408e6b-0x0;var _0x2f1a14=_0x5db1[_0x408e6b];return _0x2f1a14;};'use strict';var _=require(_0x15db('0x0'));var util=require(_0x15db('0x1'));var moment=require(_0x15db('0x2'));var BPromise=require(_0x15db('0x3'));var rs=require(_0x15db('0x4'));var fs=require('fs');var Redis=require(_0x15db('0x5'));var db=require(_0x15db('0x6'))['db'];var utils=require(_0x15db('0x7'));var logger=require(_0x15db('0x8'))(_0x15db('0x9'));var config=require(_0x15db('0xa'));var jayson=require(_0x15db('0xb'));var client=jayson[_0x15db('0xc')][_0x15db('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x14e485,_0x1ecb90,_0x20f4cd){return new BPromise(function(_0x3bdafc,_0x3ebab6){return client[_0x15db('0xe')](_0x14e485,_0x20f4cd)[_0x15db('0xf')](function(_0x473dff){logger[_0x15db('0x10')](_0x15db('0x11'),_0x1ecb90,'request\x20sent');logger['debug'](_0x15db('0x12'),_0x1ecb90,_0x15db('0x13'),JSON[_0x15db('0x14')](_0x473dff));if(_0x473dff['error']){if(_0x473dff[_0x15db('0x15')][_0x15db('0x16')]===0x1f4){logger[_0x15db('0x15')](_0x15db('0x11'),_0x1ecb90,_0x473dff[_0x15db('0x15')][_0x15db('0x17')]);return _0x3ebab6(_0x473dff['error']['message']);}logger[_0x15db('0x15')](_0x15db('0x11'),_0x1ecb90,_0x473dff['error'][_0x15db('0x17')]);return _0x3bdafc(_0x473dff[_0x15db('0x15')][_0x15db('0x17')]);}else{logger[_0x15db('0x10')](_0x15db('0x11'),_0x1ecb90,_0x15db('0x13'));_0x3bdafc(_0x473dff[_0x15db('0x18')][_0x15db('0x17')]);}})[_0x15db('0x19')](function(_0x43400c){logger[_0x15db('0x15')](_0x15db('0x11'),_0x1ecb90,_0x43400c);_0x3ebab6(_0x43400c);});});}exports['GetDeskAccount']=function(_0x2b2c19){var _0x691783=this;return new Promise(function(_0x1cf8e7,_0x36628f){return db[_0x15db('0x1a')][_0x15db('0x1b')]({'raw':_0x2b2c19[_0x15db('0x1c')]?_0x2b2c19['options'][_0x15db('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b2c19[_0x15db('0x1c')]?_0x2b2c19[_0x15db('0x1c')][_0x15db('0x1e')]||null:null,'attributes':_0x2b2c19[_0x15db('0x1c')]?_0x2b2c19[_0x15db('0x1c')][_0x15db('0x1f')]||null:null,'limit':_0x2b2c19[_0x15db('0x1c')]?_0x2b2c19[_0x15db('0x1c')][_0x15db('0x20')]||null:null,'include':_0x2b2c19[_0x15db('0x1c')]?_0x2b2c19['options'][_0x15db('0x21')]?_[_0x15db('0x22')](_0x2b2c19[_0x15db('0x1c')]['include'],function(_0x45f8b3){return{'model':db[_0x45f8b3['model']],'as':_0x45f8b3['as'],'attributes':_0x45f8b3[_0x15db('0x1f')],'include':_0x45f8b3[_0x15db('0x21')]?_['map'](_0x45f8b3['include'],function(_0xf175fa){return{'model':db[_0xf175fa['model']],'as':_0xf175fa['as'],'attributes':_0xf175fa[_0x15db('0x1f')],'include':_0xf175fa['include']?_[_0x15db('0x22')](_0xf175fa[_0x15db('0x21')],function(_0x5395bf){return{'model':db[_0x5395bf[_0x15db('0x23')]],'as':_0x5395bf['as'],'attributes':_0x5395bf[_0x15db('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x15db('0xf')](function(_0x7c9a46){logger[_0x15db('0x10')](_0x15db('0x24'),_0x2b2c19);logger['debug'](_0x15db('0x24'),_0x2b2c19,JSON[_0x15db('0x14')](_0x7c9a46));_0x1cf8e7(_0x7c9a46);})['catch'](function(_0x435e05){logger[_0x15db('0x15')](_0x15db('0x24'),_0x435e05[_0x15db('0x17')],_0x2b2c19);_0x36628f(_0x691783[_0x15db('0x15')](0x1f4,_0x435e05[_0x15db('0x17')]));});});};exports[_0x15db('0x25')]=function(_0x5b6a08){var _0x2b080c=this;return new Promise(function(_0x435829,_0x983eef){return db[_0x15db('0x1a')]['find']({'raw':_0x5b6a08[_0x15db('0x1c')]?_0x5b6a08['options'][_0x15db('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b6a08[_0x15db('0x1c')]?_0x5b6a08[_0x15db('0x1c')][_0x15db('0x1e')]||null:null,'attributes':_0x5b6a08['options']?_0x5b6a08[_0x15db('0x1c')][_0x15db('0x1f')]||null:null,'include':_0x5b6a08[_0x15db('0x1c')]?_0x5b6a08[_0x15db('0x1c')][_0x15db('0x21')]?_[_0x15db('0x22')](_0x5b6a08[_0x15db('0x1c')][_0x15db('0x21')],function(_0x2b9629){return{'model':db[_0x2b9629['model']],'as':_0x2b9629['as'],'attributes':_0x2b9629[_0x15db('0x1f')],'include':_0x2b9629[_0x15db('0x21')]?_[_0x15db('0x22')](_0x2b9629['include'],function(_0x5502b5){return{'model':db[_0x5502b5[_0x15db('0x23')]],'as':_0x5502b5['as'],'attributes':_0x5502b5['attributes'],'include':_0x5502b5[_0x15db('0x21')]?_[_0x15db('0x22')](_0x5502b5[_0x15db('0x21')],function(_0x1ad9d2){return{'model':db[_0x1ad9d2[_0x15db('0x23')]],'as':_0x1ad9d2['as'],'attributes':_0x1ad9d2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2517ae){logger[_0x15db('0x10')](_0x15db('0x25'),_0x5b6a08);logger['debug'](_0x15db('0x25'),_0x5b6a08,JSON[_0x15db('0x14')](_0x2517ae));_0x435829(_0x2517ae);})['catch'](function(_0x2309e1){logger[_0x15db('0x15')]('ShowDeskAccount',_0x2309e1[_0x15db('0x17')],_0x5b6a08);_0x983eef(_0x2b080c['error'](0x1f4,_0x2309e1['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d1fa3b0..5493ea6 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 _0xa93a=['index','show','/:id/fields','getFields','getDescriptions','getTags','post','/:id/tags','setTags','put','delete','/:id','exports','path','Router','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa93a,0xb8));var _0xaa93=function(_0x54d3d9,_0x2434ab){_0x54d3d9=_0x54d3d9-0x0;var _0x411260=_0xa93a[_0x54d3d9];return _0x411260;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa93('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa93('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa93('0x2'));var config=require('../../config/environment');var controller=require(_0xaa93('0x3'));router[_0xaa93('0x4')]('/',auth[_0xaa93('0x5')](),controller[_0xaa93('0x6')]);router[_0xaa93('0x4')]('/:id',auth[_0xaa93('0x5')](),controller[_0xaa93('0x7')]);router['get'](_0xaa93('0x8'),auth['isAuthenticated'](),controller[_0xaa93('0x9')]);router[_0xaa93('0x4')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xaa93('0x4')]('/:id/descriptions',auth[_0xaa93('0x5')](),controller[_0xaa93('0xa')]);router[_0xaa93('0x4')]('/:id/tags',auth['isAuthenticated'](),controller[_0xaa93('0xb')]);router['post']('/',auth[_0xaa93('0x5')](),controller['create']);router[_0xaa93('0xc')](_0xaa93('0xd'),auth[_0xaa93('0x5')](),controller[_0xaa93('0xe')]);router[_0xaa93('0xf')]('/:id',auth[_0xaa93('0x5')](),controller['update']);router[_0xaa93('0x10')](_0xaa93('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa93('0x12')]=router; \ No newline at end of file +var _0x4253=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x386746,_0x372192){var _0x122328=function(_0x5fcdc3){while(--_0x5fcdc3){_0x386746['push'](_0x386746['shift']());}};_0x122328(++_0x372192);}(_0x4253,0x14c));var _0x3425=function(_0x4610a3,_0x47d045){_0x4610a3=_0x4610a3-0x0;var _0x7c38ee=_0x4253[_0x4610a3];return _0x7c38ee;};'use strict';var multer=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var path=require('path');var timeout=require(_0x3425('0x2'));var express=require('express');var router=express[_0x3425('0x3')]();var auth=require(_0x3425('0x4'));var interaction=require(_0x3425('0x5'));var config=require(_0x3425('0x6'));var controller=require(_0x3425('0x7'));router[_0x3425('0x8')]('/',auth[_0x3425('0x9')](),controller[_0x3425('0xa')]);router[_0x3425('0x8')]('/:id',auth[_0x3425('0x9')](),controller[_0x3425('0xb')]);router[_0x3425('0x8')]('/:id/fields',auth[_0x3425('0x9')](),controller[_0x3425('0xc')]);router['get'](_0x3425('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x3425('0xe'),auth[_0x3425('0x9')](),controller[_0x3425('0xf')]);router['get'](_0x3425('0x10'),auth[_0x3425('0x9')](),controller[_0x3425('0x11')]);router['post']('/',auth[_0x3425('0x9')](),controller[_0x3425('0x12')]);router[_0x3425('0x13')](_0x3425('0x10'),auth[_0x3425('0x9')](),controller[_0x3425('0x14')]);router[_0x3425('0x15')]('/:id',auth[_0x3425('0x9')](),controller['update']);router[_0x3425('0x16')](_0x3425('0x17'),auth['isAuthenticated'](),controller[_0x3425('0x18')]);module[_0x3425('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 95ed00a..1b30344 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 _0x7408=['exports','STRING','sequelize'];(function(_0x43c0cd,_0x58da2a){var _0xed699b=function(_0x2a804b){while(--_0x2a804b){_0x43c0cd['push'](_0x43c0cd['shift']());}};_0xed699b(++_0x58da2a);}(_0x7408,0x11c));var _0x8740=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x7408[_0x5235a6];return _0x1cf37e;};'use strict';var Sequelize=require(_0x8740('0x0'));module[_0x8740('0x1')]={'name':{'type':Sequelize[_0x8740('0x2')]},'description':{'type':Sequelize[_0x8740('0x2')]}}; \ No newline at end of file +var _0x6fee=['sequelize','exports','STRING'];(function(_0x2485f1,_0x126dc4){var _0x3fc3e3=function(_0x26ac45){while(--_0x26ac45){_0x2485f1['push'](_0x2485f1['shift']());}};_0x3fc3e3(++_0x126dc4);}(_0x6fee,0x147));var _0xe6fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe6fe('0x0'));module[_0xe6fe('0x1')]={'name':{'type':Sequelize[_0xe6fe('0x2')]},'description':{'type':Sequelize[_0xe6fe('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 8b792a1..1e33c34 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 _0xbc8d=['message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','stack','name','map','DeskConfiguration','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','create','update','body','findOne','DeskField','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','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','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','stringify','error','code','DeskConfiguration,\x20%s,\x20%s'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xdbc8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdbc8('0x1'));var zipdir=require(_0xdbc8('0x2'));var jsonpatch=require(_0xdbc8('0x3'));var rp=require(_0xdbc8('0x4'));var moment=require('moment');var BPromise=require(_0xdbc8('0x5'));var Mustache=require(_0xdbc8('0x6'));var util=require(_0xdbc8('0x7'));var path=require('path');var sox=require(_0xdbc8('0x8'));var csv=require(_0xdbc8('0x9'));var ejs=require(_0xdbc8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdbc8('0xb'));var crypto=require('crypto');var jsforce=require(_0xdbc8('0xc'));var deskjs=require(_0xdbc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbc8('0xe'));var Papa=require(_0xdbc8('0xf'));var Redis=require(_0xdbc8('0x10'));var authService=require(_0xdbc8('0x11'));var qs=require(_0xdbc8('0x12'));var as=require(_0xdbc8('0x13'));var hardwareService=require(_0xdbc8('0x14'));var logger=require(_0xdbc8('0x15'))(_0xdbc8('0x16'));var utils=require(_0xdbc8('0x17'));var config=require(_0xdbc8('0x18'));var db=require(_0xdbc8('0x19'))['db'];var jayson=require(_0xdbc8('0x1a'));var client=jayson[_0xdbc8('0x1b')][_0xdbc8('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4a6595,_0x2ceaa6,_0x562914){if(_0x562914){var _0x42acc5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42acc5[_0xdbc8('0x1d')](_0x2ceaa6)){return _0x4a6595;}else{throw new db[(_0xdbc8('0x1e'))][(_0xdbc8('0x1f'))](_0xdbc8('0x20'));}}else{return _0x4a6595;}}function respondWithRpcPromise(_0x21a2be,_0x1d5d7e,_0x32c678,_0x2f15c8){return new BPromise(function(_0x34ccb8,_0x24fd2a){var _0x3daa35=_0x2f15c8||client;return _0x3daa35[_0xdbc8('0x21')](_0x21a2be,_0x32c678)[_0xdbc8('0x22')](function(_0x4cdb17){logger[_0xdbc8('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x1d5d7e,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1d5d7e,_0xdbc8('0x24'),JSON[_0xdbc8('0x25')](_0x4cdb17));if(_0x4cdb17[_0xdbc8('0x26')]){if(_0x4cdb17[_0xdbc8('0x26')][_0xdbc8('0x27')]===0x1f4){logger[_0xdbc8('0x26')](_0xdbc8('0x28'),_0x1d5d7e,_0x4cdb17[_0xdbc8('0x26')][_0xdbc8('0x29')]);return _0x24fd2a(_0x4cdb17[_0xdbc8('0x26')][_0xdbc8('0x29')]);}logger[_0xdbc8('0x26')](_0xdbc8('0x28'),_0x1d5d7e,_0x4cdb17[_0xdbc8('0x26')][_0xdbc8('0x29')]);return _0x34ccb8(_0x4cdb17[_0xdbc8('0x26')][_0xdbc8('0x29')]);}else{logger[_0xdbc8('0x23')](_0xdbc8('0x28'),_0x1d5d7e,'request\x20sent');_0x34ccb8(_0x4cdb17[_0xdbc8('0x2a')][_0xdbc8('0x29')]);}})[_0xdbc8('0x2b')](function(_0x1cd9c7){logger[_0xdbc8('0x26')](_0xdbc8('0x28'),_0x1d5d7e,_0x1cd9c7);_0x24fd2a(_0x1cd9c7);});});}function respondWithStatusCode(_0xb7c29c,_0xbc557a){_0xbc557a=_0xbc557a||0xcc;return function(_0x144d1c){if(_0x144d1c){return _0xb7c29c[_0xdbc8('0x2c')](_0xbc557a);}return _0xb7c29c[_0xdbc8('0x2d')](_0xbc557a)[_0xdbc8('0x2e')]();};}function respondWithResult(_0x26064a,_0x556d28){_0x556d28=_0x556d28||0xc8;return function(_0x23964f){if(_0x23964f){return _0x26064a[_0xdbc8('0x2d')](_0x556d28)[_0xdbc8('0x2f')](_0x23964f);}};}function respondWithFilteredResult(_0xf431c8,_0x36a8d9){return function(_0x536108){if(_0x536108){var _0x27ef0e=_0x536108[_0xdbc8('0x30')],_0x4f3bb8=_0x36a8d9['offset'],_0x137c8e=_0x36a8d9[_0xdbc8('0x31')]+_0x36a8d9[_0xdbc8('0x32')],_0x372454;if(_0x137c8e>=_0x27ef0e){_0x137c8e=_0x27ef0e;_0x372454=0xc8;}else{_0x372454=0xce;}_0xf431c8[_0xdbc8('0x2d')](_0x372454);return _0xf431c8['set'](_0xdbc8('0x33'),_0x4f3bb8+'-'+_0x137c8e+'/'+_0x27ef0e)[_0xdbc8('0x2f')](_0x536108);}return null;};}function patchUpdates(_0x2f465a){return function(_0x442e01){try{jsonpatch[_0xdbc8('0x34')](_0x442e01,_0x2f465a,!![]);}catch(_0x54d91e){return BPromise['reject'](_0x54d91e);}return _0x442e01[_0xdbc8('0x35')]();};}function saveUpdates(_0x54d5d1,_0x341af3){return function(_0x4c4eb7){if(_0x4c4eb7){return _0x4c4eb7['update'](_0x54d5d1)[_0xdbc8('0x22')](function(_0x4b605d){return _0x4b605d;});}return null;};}function removeEntity(_0x3780f8,_0x117d42){return function(_0x36f49c){if(_0x36f49c){return _0x36f49c[_0xdbc8('0x36')]()[_0xdbc8('0x22')](function(){_0x3780f8[_0xdbc8('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1edf94,_0xdf5ad4){return function(_0x52c00b){if(!_0x52c00b){_0x1edf94[_0xdbc8('0x2c')](0x194);}return _0x52c00b;};}function handleError(_0x2768a6,_0x9ade8f){_0x9ade8f=_0x9ade8f||0x1f4;return function(_0x5d0e58){logger[_0xdbc8('0x26')](_0x5d0e58[_0xdbc8('0x37')]);if(_0x5d0e58[_0xdbc8('0x38')]){delete _0x5d0e58[_0xdbc8('0x38')];}_0x2768a6[_0xdbc8('0x2d')](_0x9ade8f)['send'](_0x5d0e58);};}exports['index']=function(_0x39d913,_0x2a557e){var _0x6eb2b7={},_0x3c8647={},_0x46c391={'count':0x0,'rows':[]};var _0x545614=_[_0xdbc8('0x39')](db[_0xdbc8('0x3a')][_0xdbc8('0x3b')],function(_0x2f6b41){return{'name':_0x2f6b41['fieldName'],'type':_0x2f6b41[_0xdbc8('0x3c')]['key']};});_0x3c8647['model']=_['map'](_0x545614,'name');_0x3c8647[_0xdbc8('0x3d')]=_[_0xdbc8('0x3e')](_0x39d913['query']);_0x3c8647[_0xdbc8('0x3f')]=_[_0xdbc8('0x40')](_0x3c8647[_0xdbc8('0x41')],_0x3c8647['query']);_0x6eb2b7[_0xdbc8('0x42')]=_[_0xdbc8('0x40')](_0x3c8647[_0xdbc8('0x41')],qs[_0xdbc8('0x43')](_0x39d913[_0xdbc8('0x3d')][_0xdbc8('0x43')]));_0x6eb2b7[_0xdbc8('0x42')]=_0x6eb2b7[_0xdbc8('0x42')][_0xdbc8('0x44')]?_0x6eb2b7[_0xdbc8('0x42')]:_0x3c8647[_0xdbc8('0x41')];if(!_0x39d913['query'][_0xdbc8('0x45')](_0xdbc8('0x46'))){_0x6eb2b7['limit']=qs['limit'](_0x39d913[_0xdbc8('0x3d')][_0xdbc8('0x32')]);_0x6eb2b7[_0xdbc8('0x31')]=qs[_0xdbc8('0x31')](_0x39d913[_0xdbc8('0x3d')]['offset']);}_0x6eb2b7['order']=qs[_0xdbc8('0x47')](_0x39d913[_0xdbc8('0x3d')][_0xdbc8('0x47')]);_0x6eb2b7['where']=qs[_0xdbc8('0x3f')](_['pick'](_0x39d913[_0xdbc8('0x3d')],_0x3c8647[_0xdbc8('0x3f')]),_0x545614);if(_0x39d913[_0xdbc8('0x3d')][_0xdbc8('0x48')]){_0x6eb2b7[_0xdbc8('0x49')]=_[_0xdbc8('0x4a')](_0x6eb2b7['where'],{'$or':_['map'](_0x545614,function(_0x26b43b){if(_0x26b43b[_0xdbc8('0x3c')]!==_0xdbc8('0x4b')){var _0x39a6af={};_0x39a6af[_0x26b43b[_0xdbc8('0x38')]]={'$like':'%'+_0x39d913[_0xdbc8('0x3d')]['filter']+'%'};return _0x39a6af;}})});}_0x6eb2b7=_[_0xdbc8('0x4a')]({},_0x6eb2b7,_0x39d913['options']);var _0x308a8f={'where':_0x6eb2b7[_0xdbc8('0x49')]};return db['DeskConfiguration'][_0xdbc8('0x30')](_0x308a8f)[_0xdbc8('0x22')](function(_0x1b342a){_0x46c391['count']=_0x1b342a;if(_0x39d913[_0xdbc8('0x3d')][_0xdbc8('0x4c')]){_0x6eb2b7['include']=[{'all':!![]}];}return db[_0xdbc8('0x3a')][_0xdbc8('0x4d')](_0x6eb2b7);})[_0xdbc8('0x22')](function(_0x358887){_0x46c391[_0xdbc8('0x4e')]=_0x358887;return _0x46c391;})[_0xdbc8('0x22')](respondWithFilteredResult(_0x2a557e,_0x6eb2b7))[_0xdbc8('0x2b')](handleError(_0x2a557e,null));};exports[_0xdbc8('0x4f')]=function(_0x101cf9,_0x21fba7){var _0x426efc={'raw':![],'where':{'id':_0x101cf9[_0xdbc8('0x50')]['id']}},_0x237ef6={};_0x237ef6['model']=_['keys'](db[_0xdbc8('0x3a')]['rawAttributes']);_0x237ef6['query']=_['keys'](_0x101cf9['query']);_0x237ef6[_0xdbc8('0x3f')]=_[_0xdbc8('0x40')](_0x237ef6[_0xdbc8('0x41')],_0x237ef6['query']);_0x426efc[_0xdbc8('0x42')]=_['intersection'](_0x237ef6[_0xdbc8('0x41')],qs[_0xdbc8('0x43')](_0x101cf9[_0xdbc8('0x3d')][_0xdbc8('0x43')]));_0x426efc[_0xdbc8('0x42')]=_0x426efc[_0xdbc8('0x42')][_0xdbc8('0x44')]?_0x426efc[_0xdbc8('0x42')]:_0x237ef6[_0xdbc8('0x41')];if(_0x101cf9[_0xdbc8('0x3d')][_0xdbc8('0x4c')]){_0x426efc[_0xdbc8('0x51')]=[{'all':!![]}];}_0x426efc=_['merge']({},_0x426efc,_0x101cf9[_0xdbc8('0x52')]);return db[_0xdbc8('0x3a')][_0xdbc8('0x53')](_0x426efc)['then'](handleEntityNotFound(_0x21fba7,null))['then'](respondWithResult(_0x21fba7,null))['catch'](handleError(_0x21fba7,null));};exports[_0xdbc8('0x54')]=function(_0x20d196,_0x5dbd09){return db[_0xdbc8('0x3a')][_0xdbc8('0x54')](_0x20d196['body'],{})[_0xdbc8('0x22')](respondWithResult(_0x5dbd09,0xc9))['catch'](handleError(_0x5dbd09,null));};exports[_0xdbc8('0x55')]=function(_0x3aefc5,_0x102064){if(_0x3aefc5[_0xdbc8('0x56')]['id']){delete _0x3aefc5[_0xdbc8('0x56')]['id'];}return db[_0xdbc8('0x3a')][_0xdbc8('0x53')]({'where':{'id':_0x3aefc5[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x102064,null))[_0xdbc8('0x22')](saveUpdates(_0x3aefc5[_0xdbc8('0x56')],null))['then'](respondWithResult(_0x102064,null))[_0xdbc8('0x2b')](handleError(_0x102064,null));};exports['destroy']=function(_0x4b35a7,_0x5a163f){return db[_0xdbc8('0x3a')][_0xdbc8('0x53')]({'where':{'id':_0x4b35a7[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x5a163f,null))[_0xdbc8('0x22')](removeEntity(_0x5a163f,null))['catch'](handleError(_0x5a163f,null));};exports['getFields']=function(_0x3d0475,_0x176b69,_0x493f81){var _0x5168e3={};var _0x42d800={};var _0x386aac;var _0x42c3b2;return db[_0xdbc8('0x3a')][_0xdbc8('0x57')]({'where':{'id':_0x3d0475[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x176b69,null))[_0xdbc8('0x22')](function(_0x3a0a4d){if(_0x3a0a4d){_0x386aac=_0x3a0a4d;_0x42d800[_0xdbc8('0x41')]=_[_0xdbc8('0x3e')](db[_0xdbc8('0x58')]['rawAttributes']);_0x42d800['query']=_[_0xdbc8('0x3e')](_0x3d0475[_0xdbc8('0x3d')]);_0x42d800[_0xdbc8('0x3f')]=_[_0xdbc8('0x40')](_0x42d800[_0xdbc8('0x41')],_0x42d800[_0xdbc8('0x3d')]);_0x5168e3[_0xdbc8('0x42')]=_[_0xdbc8('0x40')](_0x42d800[_0xdbc8('0x41')],qs['fields'](_0x3d0475['query'][_0xdbc8('0x43')]));_0x5168e3[_0xdbc8('0x42')]=_0x5168e3[_0xdbc8('0x42')]['length']?_0x5168e3['attributes']:_0x42d800['model'];_0x5168e3[_0xdbc8('0x59')]=qs[_0xdbc8('0x47')](_0x3d0475['query'][_0xdbc8('0x47')]);_0x5168e3[_0xdbc8('0x49')]=qs[_0xdbc8('0x3f')](_[_0xdbc8('0x5a')](_0x3d0475[_0xdbc8('0x3d')],_0x42d800[_0xdbc8('0x3f')]));if(_0x3d0475[_0xdbc8('0x3d')][_0xdbc8('0x48')]){_0x5168e3[_0xdbc8('0x49')]=_[_0xdbc8('0x4a')](_0x5168e3[_0xdbc8('0x49')],{'$or':_[_0xdbc8('0x39')](_0x5168e3[_0xdbc8('0x42')],function(_0x247f3c){var _0x32f8d3={};_0x32f8d3[_0x247f3c]={'$like':'%'+_0x3d0475[_0xdbc8('0x3d')][_0xdbc8('0x48')]+'%'};return _0x32f8d3;})});}_0x5168e3=_['merge']({},_0x5168e3,_0x3d0475[_0xdbc8('0x52')]);return _0x386aac['getFields'](_0x5168e3);}})[_0xdbc8('0x22')](function(_0x4333b5){if(_0x4333b5){_0x42c3b2=_0x4333b5[_0xdbc8('0x44')];if(!_0x3d0475[_0xdbc8('0x3d')][_0xdbc8('0x45')](_0xdbc8('0x46'))){_0x5168e3[_0xdbc8('0x32')]=qs[_0xdbc8('0x32')](_0x3d0475[_0xdbc8('0x3d')][_0xdbc8('0x32')]);_0x5168e3[_0xdbc8('0x31')]=qs[_0xdbc8('0x31')](_0x3d0475[_0xdbc8('0x3d')]['offset']);}return _0x386aac['getFields'](_0x5168e3);}})[_0xdbc8('0x22')](function(_0x191468){if(_0x191468){return _0x191468?{'count':_0x42c3b2,'rows':_0x191468}:null;}})[_0xdbc8('0x22')](respondWithResult(_0x176b69,null))[_0xdbc8('0x2b')](handleError(_0x176b69,null));};exports['getSubjects']=function(_0x428d7c,_0x51f142,_0x24cd4b){var _0x3b8248={};var _0x36080d={};var _0x113501;var _0x4a1b16;return db['DeskConfiguration'][_0xdbc8('0x57')]({'where':{'id':_0x428d7c['params']['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x51f142,null))[_0xdbc8('0x22')](function(_0x2451b5){if(_0x2451b5){_0x113501=_0x2451b5;_0x36080d['model']=_[_0xdbc8('0x3e')](db[_0xdbc8('0x58')][_0xdbc8('0x3b')]);_0x36080d[_0xdbc8('0x3d')]=_[_0xdbc8('0x3e')](_0x428d7c['query']);_0x36080d[_0xdbc8('0x3f')]=_[_0xdbc8('0x40')](_0x36080d[_0xdbc8('0x41')],_0x36080d[_0xdbc8('0x3d')]);_0x3b8248[_0xdbc8('0x42')]=_[_0xdbc8('0x40')](_0x36080d[_0xdbc8('0x41')],qs[_0xdbc8('0x43')](_0x428d7c['query']['fields']));_0x3b8248[_0xdbc8('0x42')]=_0x3b8248['attributes']['length']?_0x3b8248['attributes']:_0x36080d[_0xdbc8('0x41')];_0x3b8248[_0xdbc8('0x59')]=qs[_0xdbc8('0x47')](_0x428d7c['query'][_0xdbc8('0x47')]);_0x3b8248[_0xdbc8('0x49')]=qs[_0xdbc8('0x3f')](_['pick'](_0x428d7c[_0xdbc8('0x3d')],_0x36080d['filters']));if(_0x428d7c['query']['filter']){_0x3b8248[_0xdbc8('0x49')]=_['merge'](_0x3b8248[_0xdbc8('0x49')],{'$or':_[_0xdbc8('0x39')](_0x3b8248[_0xdbc8('0x42')],function(_0x554a03){var _0x34ddf6={};_0x34ddf6[_0x554a03]={'$like':'%'+_0x428d7c['query']['filter']+'%'};return _0x34ddf6;})});}_0x3b8248=_['merge']({},_0x3b8248,_0x428d7c['options']);return _0x113501['getSubjects'](_0x3b8248);}})[_0xdbc8('0x22')](function(_0x505ff7){if(_0x505ff7){_0x4a1b16=_0x505ff7['length'];if(!_0x428d7c[_0xdbc8('0x3d')]['hasOwnProperty']('nolimit')){_0x3b8248['limit']=qs['limit'](_0x428d7c[_0xdbc8('0x3d')][_0xdbc8('0x32')]);_0x3b8248[_0xdbc8('0x31')]=qs[_0xdbc8('0x31')](_0x428d7c[_0xdbc8('0x3d')][_0xdbc8('0x31')]);}return _0x113501[_0xdbc8('0x5b')](_0x3b8248);}})[_0xdbc8('0x22')](function(_0x127728){if(_0x127728){return _0x127728?{'count':_0x4a1b16,'rows':_0x127728}:null;}})[_0xdbc8('0x22')](respondWithResult(_0x51f142,null))[_0xdbc8('0x2b')](handleError(_0x51f142,null));};exports[_0xdbc8('0x5c')]=function(_0x5f1b93,_0x159368,_0xff6b89){var _0x50578d={};var _0x3f3adb={};var _0x1d84e3;var _0x3134d2;return db[_0xdbc8('0x3a')][_0xdbc8('0x57')]({'where':{'id':_0x5f1b93[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x159368,null))[_0xdbc8('0x22')](function(_0x166251){if(_0x166251){_0x1d84e3=_0x166251;_0x3f3adb[_0xdbc8('0x41')]=_[_0xdbc8('0x3e')](db[_0xdbc8('0x58')][_0xdbc8('0x3b')]);_0x3f3adb[_0xdbc8('0x3d')]=_[_0xdbc8('0x3e')](_0x5f1b93[_0xdbc8('0x3d')]);_0x3f3adb['filters']=_[_0xdbc8('0x40')](_0x3f3adb['model'],_0x3f3adb['query']);_0x50578d[_0xdbc8('0x42')]=_[_0xdbc8('0x40')](_0x3f3adb['model'],qs[_0xdbc8('0x43')](_0x5f1b93['query'][_0xdbc8('0x43')]));_0x50578d[_0xdbc8('0x42')]=_0x50578d[_0xdbc8('0x42')]['length']?_0x50578d[_0xdbc8('0x42')]:_0x3f3adb[_0xdbc8('0x41')];_0x50578d[_0xdbc8('0x59')]=qs[_0xdbc8('0x47')](_0x5f1b93[_0xdbc8('0x3d')][_0xdbc8('0x47')]);_0x50578d[_0xdbc8('0x49')]=qs['filters'](_['pick'](_0x5f1b93[_0xdbc8('0x3d')],_0x3f3adb[_0xdbc8('0x3f')]));if(_0x5f1b93[_0xdbc8('0x3d')][_0xdbc8('0x48')]){_0x50578d[_0xdbc8('0x49')]=_[_0xdbc8('0x4a')](_0x50578d['where'],{'$or':_[_0xdbc8('0x39')](_0x50578d[_0xdbc8('0x42')],function(_0x521e87){var _0x5c17ef={};_0x5c17ef[_0x521e87]={'$like':'%'+_0x5f1b93[_0xdbc8('0x3d')]['filter']+'%'};return _0x5c17ef;})});}_0x50578d=_['merge']({},_0x50578d,_0x5f1b93['options']);return _0x1d84e3[_0xdbc8('0x5c')](_0x50578d);}})['then'](function(_0x3598a7){if(_0x3598a7){_0x3134d2=_0x3598a7[_0xdbc8('0x44')];if(!_0x5f1b93[_0xdbc8('0x3d')][_0xdbc8('0x45')](_0xdbc8('0x46'))){_0x50578d['limit']=qs[_0xdbc8('0x32')](_0x5f1b93['query'][_0xdbc8('0x32')]);_0x50578d[_0xdbc8('0x31')]=qs[_0xdbc8('0x31')](_0x5f1b93['query'][_0xdbc8('0x31')]);}return _0x1d84e3[_0xdbc8('0x5c')](_0x50578d);}})[_0xdbc8('0x22')](function(_0x2a5da2){if(_0x2a5da2){return _0x2a5da2?{'count':_0x3134d2,'rows':_0x2a5da2}:null;}})[_0xdbc8('0x22')](respondWithResult(_0x159368,null))[_0xdbc8('0x2b')](handleError(_0x159368,null));};exports[_0xdbc8('0x5d')]=function(_0x473ae1,_0x4583db,_0x2fba87){var _0x33f2ee={};var _0x4d3cef={};var _0x41a758;var _0x1b705f;return db['DeskConfiguration'][_0xdbc8('0x57')]({'where':{'id':_0x473ae1['params']['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x4583db,null))[_0xdbc8('0x22')](function(_0x5ee983){if(_0x5ee983){_0x41a758=_0x5ee983;_0x4d3cef[_0xdbc8('0x41')]=_['keys'](db[_0xdbc8('0x5e')]['rawAttributes']);_0x4d3cef['query']=_['keys'](_0x473ae1[_0xdbc8('0x3d')]);_0x4d3cef[_0xdbc8('0x3f')]=_[_0xdbc8('0x40')](_0x4d3cef[_0xdbc8('0x41')],_0x4d3cef['query']);_0x33f2ee[_0xdbc8('0x42')]=_['intersection'](_0x4d3cef[_0xdbc8('0x41')],qs['fields'](_0x473ae1[_0xdbc8('0x3d')]['fields']));_0x33f2ee[_0xdbc8('0x42')]=_0x33f2ee['attributes']['length']?_0x33f2ee[_0xdbc8('0x42')]:_0x4d3cef[_0xdbc8('0x41')];_0x33f2ee[_0xdbc8('0x59')]=qs[_0xdbc8('0x47')](_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x47')]);_0x33f2ee[_0xdbc8('0x49')]=qs[_0xdbc8('0x3f')](_[_0xdbc8('0x5a')](_0x473ae1['query'],_0x4d3cef['filters']));if(_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x48')]){_0x33f2ee[_0xdbc8('0x49')]=_[_0xdbc8('0x4a')](_0x33f2ee['where'],{'$or':_[_0xdbc8('0x39')](_0x33f2ee[_0xdbc8('0x42')],function(_0x44de95){var _0x1d7cf6={};_0x1d7cf6[_0x44de95]={'$like':'%'+_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x48')]+'%'};return _0x1d7cf6;})});}_0x33f2ee=_[_0xdbc8('0x4a')]({},_0x33f2ee,_0x473ae1[_0xdbc8('0x52')]);return _0x41a758[_0xdbc8('0x5d')](_0x33f2ee);}})[_0xdbc8('0x22')](function(_0x149c42){if(_0x149c42){_0x1b705f=_0x149c42[_0xdbc8('0x44')];if(!_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x45')](_0xdbc8('0x46'))){_0x33f2ee[_0xdbc8('0x32')]=qs[_0xdbc8('0x32')](_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x32')]);_0x33f2ee[_0xdbc8('0x31')]=qs[_0xdbc8('0x31')](_0x473ae1[_0xdbc8('0x3d')][_0xdbc8('0x31')]);}return _0x41a758[_0xdbc8('0x5d')](_0x33f2ee);}})['then'](function(_0x5711c6){if(_0x5711c6){return _0x5711c6?{'count':_0x1b705f,'rows':_0x5711c6}:null;}})['then'](respondWithResult(_0x4583db,null))[_0xdbc8('0x2b')](handleError(_0x4583db,null));};exports[_0xdbc8('0x5f')]=function(_0x330bb7,_0x8fe5dd,_0x3667d7){if(_0x330bb7[_0xdbc8('0x56')]['id']){delete _0x330bb7['body']['id'];}return db[_0xdbc8('0x3a')][_0xdbc8('0x57')]({'where':{'id':_0x330bb7[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x22')](handleEntityNotFound(_0x8fe5dd,null))['then'](function(_0x23057d){if(_0x23057d){return _0x23057d[_0xdbc8('0x5f')](_0x330bb7[_0xdbc8('0x56')][_0xdbc8('0x60')]||[]);}return null;})['then'](respondWithResult(_0x8fe5dd,null))[_0xdbc8('0x2b')](handleError(_0x8fe5dd,null));}; \ No newline at end of file +var _0x04d0=['getDescriptions','findOne','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','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','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','map','DeskConfiguration','type','key','model','query','keys','filters','attributes','intersection','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','params','fields','length','find','create','body','getFields','rawAttributes','hasOwnProperty','getSubjects','DeskField','nolimit'];(function(_0x41d2d4,_0x12bcf4){var _0x225e0f=function(_0x8464f5){while(--_0x8464f5){_0x41d2d4['push'](_0x41d2d4['shift']());}};_0x225e0f(++_0x12bcf4);}(_0x04d0,0x10a));var _0x004d=function(_0x1c2ffa,_0x4ab74c){_0x1c2ffa=_0x1c2ffa-0x0;var _0x2e568c=_0x04d0[_0x1c2ffa];return _0x2e568c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x004d('0x0'));var zipdir=require(_0x004d('0x1'));var jsonpatch=require(_0x004d('0x2'));var rp=require(_0x004d('0x3'));var moment=require(_0x004d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x004d('0x5'));var path=require('path');var sox=require(_0x004d('0x6'));var csv=require(_0x004d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x004d('0x8'));var squel=require(_0x004d('0x9'));var crypto=require('crypto');var jsforce=require(_0x004d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x004d('0x7'));var querystring=require(_0x004d('0xb'));var Papa=require(_0x004d('0xc'));var Redis=require('ioredis');var authService=require(_0x004d('0xd'));var qs=require(_0x004d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x004d('0xf'));var logger=require('../../config/logger')(_0x004d('0x10'));var utils=require(_0x004d('0x11'));var config=require('../../config/environment');var db=require(_0x004d('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x004d('0x13')][_0x004d('0x14')]({'port':0x232a});function checkPasswordPattern(_0x3ec7fb,_0xe201bb,_0x20308e){if(_0x20308e){var _0x25417a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25417a[_0x004d('0x15')](_0xe201bb)){return _0x3ec7fb;}else{throw new db[(_0x004d('0x16'))]['ValidationError'](_0x004d('0x17'));}}else{return _0x3ec7fb;}}function respondWithRpcPromise(_0x3bd18c,_0x22d22d,_0x1822f5,_0x43f5fb){return new BPromise(function(_0x402969,_0x1904a6){var _0x365c20=_0x43f5fb||client;return _0x365c20['request'](_0x3bd18c,_0x1822f5)[_0x004d('0x18')](function(_0x1f3482){logger[_0x004d('0x19')]('DeskConfiguration,\x20%s,\x20%s',_0x22d22d,_0x004d('0x1a'));logger['debug'](_0x004d('0x1b'),_0x22d22d,_0x004d('0x1a'),JSON[_0x004d('0x1c')](_0x1f3482));if(_0x1f3482[_0x004d('0x1d')]){if(_0x1f3482['error'][_0x004d('0x1e')]===0x1f4){logger[_0x004d('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x22d22d,_0x1f3482[_0x004d('0x1d')][_0x004d('0x1f')]);return _0x1904a6(_0x1f3482[_0x004d('0x1d')][_0x004d('0x1f')]);}logger['error'](_0x004d('0x20'),_0x22d22d,_0x1f3482[_0x004d('0x1d')][_0x004d('0x1f')]);return _0x402969(_0x1f3482[_0x004d('0x1d')][_0x004d('0x1f')]);}else{logger[_0x004d('0x19')](_0x004d('0x20'),_0x22d22d,_0x004d('0x1a'));_0x402969(_0x1f3482[_0x004d('0x21')][_0x004d('0x1f')]);}})[_0x004d('0x22')](function(_0x83a2f0){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x22d22d,_0x83a2f0);_0x1904a6(_0x83a2f0);});});}function respondWithStatusCode(_0x1263d8,_0xb07ff9){_0xb07ff9=_0xb07ff9||0xcc;return function(_0x4a4fe1){if(_0x4a4fe1){return _0x1263d8[_0x004d('0x23')](_0xb07ff9);}return _0x1263d8[_0x004d('0x24')](_0xb07ff9)[_0x004d('0x25')]();};}function respondWithResult(_0xd13fff,_0x225527){_0x225527=_0x225527||0xc8;return function(_0x1ccb0e){if(_0x1ccb0e){return _0xd13fff[_0x004d('0x24')](_0x225527)['json'](_0x1ccb0e);}};}function respondWithFilteredResult(_0x2e6ab1,_0x5c55a3){return function(_0x5b3c9a){if(_0x5b3c9a){var _0x2e7763=_0x5b3c9a['count'],_0x38518d=_0x5c55a3[_0x004d('0x26')],_0xe17b2d=_0x5c55a3[_0x004d('0x26')]+_0x5c55a3[_0x004d('0x27')],_0x1e13b1;if(_0xe17b2d>=_0x2e7763){_0xe17b2d=_0x2e7763;_0x1e13b1=0xc8;}else{_0x1e13b1=0xce;}_0x2e6ab1[_0x004d('0x24')](_0x1e13b1);return _0x2e6ab1[_0x004d('0x28')](_0x004d('0x29'),_0x38518d+'-'+_0xe17b2d+'/'+_0x2e7763)['json'](_0x5b3c9a);}return null;};}function patchUpdates(_0x88920b){return function(_0x268606){try{jsonpatch[_0x004d('0x2a')](_0x268606,_0x88920b,!![]);}catch(_0x188248){return BPromise['reject'](_0x188248);}return _0x268606['save']();};}function saveUpdates(_0x457385,_0x4d06d8){return function(_0x3aa5f3){if(_0x3aa5f3){return _0x3aa5f3[_0x004d('0x2b')](_0x457385)[_0x004d('0x18')](function(_0x15b0c1){return _0x15b0c1;});}return null;};}function removeEntity(_0x9d5260,_0x1ce8b4){return function(_0x357b34){if(_0x357b34){return _0x357b34[_0x004d('0x2c')]()[_0x004d('0x18')](function(){_0x9d5260[_0x004d('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c9c9,_0x1dbdf7){return function(_0x59d2ea){if(!_0x59d2ea){_0x31c9c9[_0x004d('0x23')](0x194);}return _0x59d2ea;};}function handleError(_0x54b85a,_0x251baa){_0x251baa=_0x251baa||0x1f4;return function(_0x269750){logger['error'](_0x269750[_0x004d('0x2d')]);if(_0x269750[_0x004d('0x2e')]){delete _0x269750[_0x004d('0x2e')];}_0x54b85a[_0x004d('0x24')](_0x251baa)[_0x004d('0x2f')](_0x269750);};}exports['index']=function(_0x2ef5cf,_0x6467a2){var _0x164f24={},_0x1b91ab={},_0xb9e65e={'count':0x0,'rows':[]};var _0x36ff48=_[_0x004d('0x30')](db[_0x004d('0x31')]['rawAttributes'],function(_0xd97acc){return{'name':_0xd97acc['fieldName'],'type':_0xd97acc[_0x004d('0x32')][_0x004d('0x33')]};});_0x1b91ab[_0x004d('0x34')]=_['map'](_0x36ff48,_0x004d('0x2e'));_0x1b91ab[_0x004d('0x35')]=_[_0x004d('0x36')](_0x2ef5cf['query']);_0x1b91ab[_0x004d('0x37')]=_['intersection'](_0x1b91ab[_0x004d('0x34')],_0x1b91ab[_0x004d('0x35')]);_0x164f24[_0x004d('0x38')]=_[_0x004d('0x39')](_0x1b91ab[_0x004d('0x34')],qs['fields'](_0x2ef5cf['query']['fields']));_0x164f24[_0x004d('0x38')]=_0x164f24['attributes']['length']?_0x164f24[_0x004d('0x38')]:_0x1b91ab['model'];if(!_0x2ef5cf[_0x004d('0x35')]['hasOwnProperty']('nolimit')){_0x164f24[_0x004d('0x27')]=qs[_0x004d('0x27')](_0x2ef5cf[_0x004d('0x35')]['limit']);_0x164f24['offset']=qs[_0x004d('0x26')](_0x2ef5cf[_0x004d('0x35')][_0x004d('0x26')]);}_0x164f24[_0x004d('0x3a')]=qs[_0x004d('0x3b')](_0x2ef5cf[_0x004d('0x35')][_0x004d('0x3b')]);_0x164f24[_0x004d('0x3c')]=qs[_0x004d('0x37')](_[_0x004d('0x3d')](_0x2ef5cf['query'],_0x1b91ab[_0x004d('0x37')]),_0x36ff48);if(_0x2ef5cf[_0x004d('0x35')][_0x004d('0x3e')]){_0x164f24[_0x004d('0x3c')]=_[_0x004d('0x3f')](_0x164f24[_0x004d('0x3c')],{'$or':_['map'](_0x36ff48,function(_0xe3c206){if(_0xe3c206[_0x004d('0x32')]!==_0x004d('0x40')){var _0xf0aed={};_0xf0aed[_0xe3c206[_0x004d('0x2e')]]={'$like':'%'+_0x2ef5cf['query'][_0x004d('0x3e')]+'%'};return _0xf0aed;}})});}_0x164f24=_[_0x004d('0x3f')]({},_0x164f24,_0x2ef5cf[_0x004d('0x41')]);var _0x4d1a4a={'where':_0x164f24[_0x004d('0x3c')]};return db[_0x004d('0x31')][_0x004d('0x42')](_0x4d1a4a)[_0x004d('0x18')](function(_0x5b61af){_0xb9e65e['count']=_0x5b61af;if(_0x2ef5cf[_0x004d('0x35')][_0x004d('0x43')]){_0x164f24[_0x004d('0x44')]=[{'all':!![]}];}return db[_0x004d('0x31')]['findAll'](_0x164f24);})[_0x004d('0x18')](function(_0x432af3){_0xb9e65e[_0x004d('0x45')]=_0x432af3;return _0xb9e65e;})[_0x004d('0x18')](respondWithFilteredResult(_0x6467a2,_0x164f24))['catch'](handleError(_0x6467a2,null));};exports['show']=function(_0x25ecb0,_0x21fc27){var _0x4cb5fa={'raw':![],'where':{'id':_0x25ecb0[_0x004d('0x46')]['id']}},_0x48eb46={};_0x48eb46[_0x004d('0x34')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x48eb46[_0x004d('0x35')]=_['keys'](_0x25ecb0[_0x004d('0x35')]);_0x48eb46[_0x004d('0x37')]=_['intersection'](_0x48eb46[_0x004d('0x34')],_0x48eb46['query']);_0x4cb5fa[_0x004d('0x38')]=_['intersection'](_0x48eb46[_0x004d('0x34')],qs[_0x004d('0x47')](_0x25ecb0[_0x004d('0x35')]['fields']));_0x4cb5fa['attributes']=_0x4cb5fa[_0x004d('0x38')][_0x004d('0x48')]?_0x4cb5fa['attributes']:_0x48eb46[_0x004d('0x34')];if(_0x25ecb0['query'][_0x004d('0x43')]){_0x4cb5fa[_0x004d('0x44')]=[{'all':!![]}];}_0x4cb5fa=_['merge']({},_0x4cb5fa,_0x25ecb0[_0x004d('0x41')]);return db[_0x004d('0x31')][_0x004d('0x49')](_0x4cb5fa)[_0x004d('0x18')](handleEntityNotFound(_0x21fc27,null))['then'](respondWithResult(_0x21fc27,null))[_0x004d('0x22')](handleError(_0x21fc27,null));};exports[_0x004d('0x4a')]=function(_0x2d5b2d,_0x4d3969){return db[_0x004d('0x31')][_0x004d('0x4a')](_0x2d5b2d[_0x004d('0x4b')],{})[_0x004d('0x18')](respondWithResult(_0x4d3969,0xc9))[_0x004d('0x22')](handleError(_0x4d3969,null));};exports[_0x004d('0x2b')]=function(_0x3bd8c1,_0x2b7a72){if(_0x3bd8c1['body']['id']){delete _0x3bd8c1[_0x004d('0x4b')]['id'];}return db[_0x004d('0x31')][_0x004d('0x49')]({'where':{'id':_0x3bd8c1[_0x004d('0x46')]['id']}})[_0x004d('0x18')](handleEntityNotFound(_0x2b7a72,null))['then'](saveUpdates(_0x3bd8c1[_0x004d('0x4b')],null))['then'](respondWithResult(_0x2b7a72,null))['catch'](handleError(_0x2b7a72,null));};exports[_0x004d('0x2c')]=function(_0x1355d7,_0x3e200b){return db[_0x004d('0x31')][_0x004d('0x49')]({'where':{'id':_0x1355d7[_0x004d('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e200b,null))['then'](removeEntity(_0x3e200b,null))[_0x004d('0x22')](handleError(_0x3e200b,null));};exports[_0x004d('0x4c')]=function(_0x4d5869,_0x296100,_0x3f6591){var _0x264977={};var _0xfe703f={};var _0x22c0d8;var _0x3d95c4;return db[_0x004d('0x31')]['findOne']({'where':{'id':_0x4d5869[_0x004d('0x46')]['id']}})['then'](handleEntityNotFound(_0x296100,null))[_0x004d('0x18')](function(_0x568710){if(_0x568710){_0x22c0d8=_0x568710;_0xfe703f['model']=_[_0x004d('0x36')](db['DeskField'][_0x004d('0x4d')]);_0xfe703f[_0x004d('0x35')]=_[_0x004d('0x36')](_0x4d5869[_0x004d('0x35')]);_0xfe703f[_0x004d('0x37')]=_[_0x004d('0x39')](_0xfe703f[_0x004d('0x34')],_0xfe703f[_0x004d('0x35')]);_0x264977['attributes']=_[_0x004d('0x39')](_0xfe703f[_0x004d('0x34')],qs[_0x004d('0x47')](_0x4d5869['query'][_0x004d('0x47')]));_0x264977[_0x004d('0x38')]=_0x264977['attributes']['length']?_0x264977[_0x004d('0x38')]:_0xfe703f[_0x004d('0x34')];_0x264977[_0x004d('0x3a')]=qs[_0x004d('0x3b')](_0x4d5869[_0x004d('0x35')][_0x004d('0x3b')]);_0x264977[_0x004d('0x3c')]=qs[_0x004d('0x37')](_[_0x004d('0x3d')](_0x4d5869[_0x004d('0x35')],_0xfe703f[_0x004d('0x37')]));if(_0x4d5869[_0x004d('0x35')]['filter']){_0x264977[_0x004d('0x3c')]=_[_0x004d('0x3f')](_0x264977['where'],{'$or':_[_0x004d('0x30')](_0x264977[_0x004d('0x38')],function(_0x3fda2c){var _0x36d9f7={};_0x36d9f7[_0x3fda2c]={'$like':'%'+_0x4d5869[_0x004d('0x35')][_0x004d('0x3e')]+'%'};return _0x36d9f7;})});}_0x264977=_[_0x004d('0x3f')]({},_0x264977,_0x4d5869[_0x004d('0x41')]);return _0x22c0d8[_0x004d('0x4c')](_0x264977);}})['then'](function(_0x4b4470){if(_0x4b4470){_0x3d95c4=_0x4b4470[_0x004d('0x48')];if(!_0x4d5869['query'][_0x004d('0x4e')]('nolimit')){_0x264977[_0x004d('0x27')]=qs[_0x004d('0x27')](_0x4d5869['query']['limit']);_0x264977[_0x004d('0x26')]=qs[_0x004d('0x26')](_0x4d5869[_0x004d('0x35')][_0x004d('0x26')]);}return _0x22c0d8[_0x004d('0x4c')](_0x264977);}})['then'](function(_0x301a88){if(_0x301a88){return _0x301a88?{'count':_0x3d95c4,'rows':_0x301a88}:null;}})['then'](respondWithResult(_0x296100,null))[_0x004d('0x22')](handleError(_0x296100,null));};exports[_0x004d('0x4f')]=function(_0x44158a,_0x30ea57,_0x56adf6){var _0x4e6f2d={};var _0x3b12d3={};var _0x58ba51;var _0xf2fc89;return db[_0x004d('0x31')]['findOne']({'where':{'id':_0x44158a['params']['id']}})['then'](handleEntityNotFound(_0x30ea57,null))['then'](function(_0x292a0d){if(_0x292a0d){_0x58ba51=_0x292a0d;_0x3b12d3[_0x004d('0x34')]=_['keys'](db[_0x004d('0x50')]['rawAttributes']);_0x3b12d3['query']=_[_0x004d('0x36')](_0x44158a[_0x004d('0x35')]);_0x3b12d3[_0x004d('0x37')]=_['intersection'](_0x3b12d3[_0x004d('0x34')],_0x3b12d3[_0x004d('0x35')]);_0x4e6f2d['attributes']=_[_0x004d('0x39')](_0x3b12d3[_0x004d('0x34')],qs[_0x004d('0x47')](_0x44158a[_0x004d('0x35')][_0x004d('0x47')]));_0x4e6f2d[_0x004d('0x38')]=_0x4e6f2d[_0x004d('0x38')]['length']?_0x4e6f2d[_0x004d('0x38')]:_0x3b12d3[_0x004d('0x34')];_0x4e6f2d[_0x004d('0x3a')]=qs[_0x004d('0x3b')](_0x44158a[_0x004d('0x35')][_0x004d('0x3b')]);_0x4e6f2d[_0x004d('0x3c')]=qs[_0x004d('0x37')](_[_0x004d('0x3d')](_0x44158a[_0x004d('0x35')],_0x3b12d3[_0x004d('0x37')]));if(_0x44158a[_0x004d('0x35')]['filter']){_0x4e6f2d[_0x004d('0x3c')]=_[_0x004d('0x3f')](_0x4e6f2d[_0x004d('0x3c')],{'$or':_[_0x004d('0x30')](_0x4e6f2d[_0x004d('0x38')],function(_0x2b8b87){var _0x530071={};_0x530071[_0x2b8b87]={'$like':'%'+_0x44158a['query'][_0x004d('0x3e')]+'%'};return _0x530071;})});}_0x4e6f2d=_[_0x004d('0x3f')]({},_0x4e6f2d,_0x44158a[_0x004d('0x41')]);return _0x58ba51[_0x004d('0x4f')](_0x4e6f2d);}})[_0x004d('0x18')](function(_0xebaa04){if(_0xebaa04){_0xf2fc89=_0xebaa04[_0x004d('0x48')];if(!_0x44158a[_0x004d('0x35')]['hasOwnProperty'](_0x004d('0x51'))){_0x4e6f2d['limit']=qs[_0x004d('0x27')](_0x44158a['query'][_0x004d('0x27')]);_0x4e6f2d[_0x004d('0x26')]=qs['offset'](_0x44158a[_0x004d('0x35')]['offset']);}return _0x58ba51[_0x004d('0x4f')](_0x4e6f2d);}})['then'](function(_0x238b04){if(_0x238b04){return _0x238b04?{'count':_0xf2fc89,'rows':_0x238b04}:null;}})[_0x004d('0x18')](respondWithResult(_0x30ea57,null))[_0x004d('0x22')](handleError(_0x30ea57,null));};exports[_0x004d('0x52')]=function(_0x294ef7,_0x5707c7,_0x608746){var _0x3b5d56={};var _0x55c8cf={};var _0x4f5cca;var _0x4a9dda;return db[_0x004d('0x31')][_0x004d('0x53')]({'where':{'id':_0x294ef7[_0x004d('0x46')]['id']}})[_0x004d('0x18')](handleEntityNotFound(_0x5707c7,null))[_0x004d('0x18')](function(_0x51ab41){if(_0x51ab41){_0x4f5cca=_0x51ab41;_0x55c8cf[_0x004d('0x34')]=_[_0x004d('0x36')](db[_0x004d('0x50')][_0x004d('0x4d')]);_0x55c8cf[_0x004d('0x35')]=_[_0x004d('0x36')](_0x294ef7[_0x004d('0x35')]);_0x55c8cf[_0x004d('0x37')]=_[_0x004d('0x39')](_0x55c8cf['model'],_0x55c8cf[_0x004d('0x35')]);_0x3b5d56[_0x004d('0x38')]=_[_0x004d('0x39')](_0x55c8cf[_0x004d('0x34')],qs[_0x004d('0x47')](_0x294ef7['query'][_0x004d('0x47')]));_0x3b5d56['attributes']=_0x3b5d56[_0x004d('0x38')][_0x004d('0x48')]?_0x3b5d56[_0x004d('0x38')]:_0x55c8cf[_0x004d('0x34')];_0x3b5d56[_0x004d('0x3a')]=qs[_0x004d('0x3b')](_0x294ef7[_0x004d('0x35')][_0x004d('0x3b')]);_0x3b5d56[_0x004d('0x3c')]=qs[_0x004d('0x37')](_[_0x004d('0x3d')](_0x294ef7[_0x004d('0x35')],_0x55c8cf[_0x004d('0x37')]));if(_0x294ef7[_0x004d('0x35')][_0x004d('0x3e')]){_0x3b5d56[_0x004d('0x3c')]=_['merge'](_0x3b5d56[_0x004d('0x3c')],{'$or':_[_0x004d('0x30')](_0x3b5d56[_0x004d('0x38')],function(_0x27c986){var _0x4ba9ab={};_0x4ba9ab[_0x27c986]={'$like':'%'+_0x294ef7[_0x004d('0x35')][_0x004d('0x3e')]+'%'};return _0x4ba9ab;})});}_0x3b5d56=_[_0x004d('0x3f')]({},_0x3b5d56,_0x294ef7['options']);return _0x4f5cca['getDescriptions'](_0x3b5d56);}})[_0x004d('0x18')](function(_0xa23337){if(_0xa23337){_0x4a9dda=_0xa23337[_0x004d('0x48')];if(!_0x294ef7[_0x004d('0x35')][_0x004d('0x4e')](_0x004d('0x51'))){_0x3b5d56[_0x004d('0x27')]=qs['limit'](_0x294ef7[_0x004d('0x35')]['limit']);_0x3b5d56[_0x004d('0x26')]=qs[_0x004d('0x26')](_0x294ef7[_0x004d('0x35')][_0x004d('0x26')]);}return _0x4f5cca[_0x004d('0x52')](_0x3b5d56);}})[_0x004d('0x18')](function(_0x3020dd){if(_0x3020dd){return _0x3020dd?{'count':_0x4a9dda,'rows':_0x3020dd}:null;}})[_0x004d('0x18')](respondWithResult(_0x5707c7,null))[_0x004d('0x22')](handleError(_0x5707c7,null));};exports[_0x004d('0x54')]=function(_0x176f84,_0x533d45,_0x1d9d2f){var _0x37a849={};var _0x1071cc={};var _0x4066e1;var _0x46b2e7;return db['DeskConfiguration']['findOne']({'where':{'id':_0x176f84[_0x004d('0x46')]['id']}})[_0x004d('0x18')](handleEntityNotFound(_0x533d45,null))['then'](function(_0x14dbb9){if(_0x14dbb9){_0x4066e1=_0x14dbb9;_0x1071cc[_0x004d('0x34')]=_[_0x004d('0x36')](db[_0x004d('0x55')][_0x004d('0x4d')]);_0x1071cc[_0x004d('0x35')]=_[_0x004d('0x36')](_0x176f84[_0x004d('0x35')]);_0x1071cc[_0x004d('0x37')]=_[_0x004d('0x39')](_0x1071cc[_0x004d('0x34')],_0x1071cc['query']);_0x37a849[_0x004d('0x38')]=_[_0x004d('0x39')](_0x1071cc[_0x004d('0x34')],qs[_0x004d('0x47')](_0x176f84['query'][_0x004d('0x47')]));_0x37a849[_0x004d('0x38')]=_0x37a849[_0x004d('0x38')][_0x004d('0x48')]?_0x37a849['attributes']:_0x1071cc[_0x004d('0x34')];_0x37a849[_0x004d('0x3a')]=qs[_0x004d('0x3b')](_0x176f84[_0x004d('0x35')][_0x004d('0x3b')]);_0x37a849[_0x004d('0x3c')]=qs[_0x004d('0x37')](_['pick'](_0x176f84[_0x004d('0x35')],_0x1071cc['filters']));if(_0x176f84[_0x004d('0x35')][_0x004d('0x3e')]){_0x37a849['where']=_[_0x004d('0x3f')](_0x37a849[_0x004d('0x3c')],{'$or':_[_0x004d('0x30')](_0x37a849[_0x004d('0x38')],function(_0xb10fa1){var _0x543253={};_0x543253[_0xb10fa1]={'$like':'%'+_0x176f84['query']['filter']+'%'};return _0x543253;})});}_0x37a849=_[_0x004d('0x3f')]({},_0x37a849,_0x176f84[_0x004d('0x41')]);return _0x4066e1[_0x004d('0x54')](_0x37a849);}})[_0x004d('0x18')](function(_0x34c6df){if(_0x34c6df){_0x46b2e7=_0x34c6df['length'];if(!_0x176f84['query'][_0x004d('0x4e')]('nolimit')){_0x37a849[_0x004d('0x27')]=qs[_0x004d('0x27')](_0x176f84[_0x004d('0x35')]['limit']);_0x37a849[_0x004d('0x26')]=qs['offset'](_0x176f84[_0x004d('0x35')][_0x004d('0x26')]);}return _0x4066e1[_0x004d('0x54')](_0x37a849);}})[_0x004d('0x18')](function(_0x35477a){if(_0x35477a){return _0x35477a?{'count':_0x46b2e7,'rows':_0x35477a}:null;}})[_0x004d('0x18')](respondWithResult(_0x533d45,null))['catch'](handleError(_0x533d45,null));};exports[_0x004d('0x56')]=function(_0x4a236d,_0x5b19af,_0x412179){if(_0x4a236d[_0x004d('0x4b')]['id']){delete _0x4a236d[_0x004d('0x4b')]['id'];}return db['DeskConfiguration'][_0x004d('0x53')]({'where':{'id':_0x4a236d['params']['id']}})[_0x004d('0x18')](handleEntityNotFound(_0x5b19af,null))[_0x004d('0x18')](function(_0x229976){if(_0x229976){return _0x229976[_0x004d('0x56')](_0x4a236d[_0x004d('0x4b')]['ids']||[]);}return null;})[_0x004d('0x18')](respondWithResult(_0x5b19af,null))[_0x004d('0x22')](handleError(_0x5b19af,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 83d22dc..c3c11b4 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 _0x0055=['define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x2a1517,_0x4a91c1){var _0x406f24=function(_0x3ff0c2){while(--_0x3ff0c2){_0x2a1517['push'](_0x2a1517['shift']());}};_0x406f24(++_0x4a91c1);}(_0x0055,0x1bd));var _0x5005=function(_0x4ef5cd,_0x51d0ea){_0x4ef5cd=_0x4ef5cd-0x0;var _0x30a49e=_0x0055[_0x4ef5cd];return _0x30a49e;};'use strict';var _=require(_0x5005('0x0'));var util=require('util');var logger=require(_0x5005('0x1'))(_0x5005('0x2'));var moment=require('moment');var BPromise=require(_0x5005('0x3'));var rp=require(_0x5005('0x4'));var fs=require('fs');var path=require(_0x5005('0x5'));var rimraf=require(_0x5005('0x6'));var config=require(_0x5005('0x7'));var attributes=require(_0x5005('0x8'));module[_0x5005('0x9')]=function(_0x23fa94,_0x361de5){return _0x23fa94[_0x5005('0xa')](_0x5005('0xb'),attributes,{'tableName':_0x5005('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6105=['./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','request-promise','path','rimraf'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x6105,0x18b));var _0x5610=function(_0xb41913,_0x46ea28){_0xb41913=_0xb41913-0x0;var _0xe3ecf8=_0x6105[_0xb41913];return _0xe3ecf8;};'use strict';var _=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5610('0x2'));var fs=require('fs');var path=require(_0x5610('0x3'));var rimraf=require(_0x5610('0x4'));var config=require('../../config/environment');var attributes=require(_0x5610('0x5'));module['exports']=function(_0x25b1f8,_0x2064e8){return _0x25b1f8[_0x5610('0x6')]('DeskConfiguration',attributes,{'tableName':_0x5610('0x7'),'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 490ebdd..05635df 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 _0x8369=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8369,0x10b));var _0x9836=function(_0x24c22c,_0xf14040){_0x24c22c=_0x24c22c-0x0;var _0x2d645b=_0x8369[_0x24c22c];return _0x2d645b;};'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 _0xfa12=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x233bbb,_0x4294f9){var _0x1bc0db=function(_0x25048f){while(--_0x25048f){_0x233bbb['push'](_0x233bbb['shift']());}};_0x1bc0db(++_0x4294f9);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x2244cf,_0x1333e2){_0x2244cf=_0x2244cf-0x0;var _0x48d2fa=_0xfa12[_0x2244cf];return _0x48d2fa;};'use strict';var _=require(_0x2fa1('0x0'));var util=require(_0x2fa1('0x1'));var moment=require('moment');var BPromise=require(_0x2fa1('0x2'));var rs=require(_0x2fa1('0x3'));var fs=require('fs');var Redis=require(_0x2fa1('0x4'));var db=require(_0x2fa1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fa1('0x6'))(_0x2fa1('0x7'));var config=require(_0x2fa1('0x8'));var jayson=require(_0x2fa1('0x9'));var client=jayson['client'][_0x2fa1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b233,_0x58a81e,_0x3449c3){return new BPromise(function(_0x30a897,_0x2a9dc4){return client[_0x2fa1('0xb')](_0x25b233,_0x3449c3)['then'](function(_0x3ac971){logger[_0x2fa1('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x58a81e,_0x2fa1('0xd'));logger[_0x2fa1('0xe')](_0x2fa1('0xf'),_0x58a81e,_0x2fa1('0xd'),JSON[_0x2fa1('0x10')](_0x3ac971));if(_0x3ac971[_0x2fa1('0x11')]){if(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x12')]===0x1f4){logger['error'](_0x2fa1('0x13'),_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x2a9dc4(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}logger[_0x2fa1('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x58a81e,_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);return _0x30a897(_0x3ac971[_0x2fa1('0x11')][_0x2fa1('0x14')]);}else{logger['info'](_0x2fa1('0x13'),_0x58a81e,_0x2fa1('0xd'));_0x30a897(_0x3ac971['result'][_0x2fa1('0x14')]);}})[_0x2fa1('0x15')](function(_0x453d24){logger[_0x2fa1('0x11')](_0x2fa1('0x13'),_0x58a81e,_0x453d24);_0x2a9dc4(_0x453d24);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 63f74c3..b919008 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 _0xc41d=['util','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskField.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','multer'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xc41d,0x142));var _0xdc41=function(_0x5486cd,_0x20ada3){_0x5486cd=_0x5486cd-0x0;var _0x239dc8=_0xc41d[_0x5486cd];return _0x239dc8;};'use strict';var multer=require(_0xdc41('0x0'));var util=require(_0xdc41('0x1'));var path=require(_0xdc41('0x2'));var timeout=require(_0xdc41('0x3'));var express=require(_0xdc41('0x4'));var router=express[_0xdc41('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdc41('0x6'));var config=require('../../config/environment');var controller=require(_0xdc41('0x7'));router[_0xdc41('0x8')]('/',auth['isAuthenticated'](),controller[_0xdc41('0x9')]);router['get'](_0xdc41('0xa'),auth[_0xdc41('0xb')](),controller['show']);router[_0xdc41('0xc')]('/',auth[_0xdc41('0xb')](),controller['create']);router[_0xdc41('0xd')](_0xdc41('0xa'),auth[_0xdc41('0xb')](),controller[_0xdc41('0xe')]);router[_0xdc41('0xf')](_0xdc41('0xa'),auth[_0xdc41('0xb')](),controller[_0xdc41('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6f77=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','post','create','/:id'];(function(_0x10ab62,_0x21d1da){var _0x3b325b=function(_0x4aae9d){while(--_0x4aae9d){_0x10ab62['push'](_0x10ab62['shift']());}};_0x3b325b(++_0x21d1da);}(_0x6f77,0x1cc));var _0x76f7=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x6f77[_0x548627];return _0x844a84;};'use strict';var multer=require(_0x76f7('0x0'));var util=require(_0x76f7('0x1'));var path=require(_0x76f7('0x2'));var timeout=require(_0x76f7('0x3'));var express=require('express');var router=express[_0x76f7('0x4')]();var auth=require(_0x76f7('0x5'));var interaction=require(_0x76f7('0x6'));var config=require(_0x76f7('0x7'));var controller=require(_0x76f7('0x8'));router[_0x76f7('0x9')]('/',auth[_0x76f7('0xa')](),controller[_0x76f7('0xb')]);router[_0x76f7('0x9')]('/:id',auth[_0x76f7('0xa')](),controller['show']);router[_0x76f7('0xc')]('/',auth[_0x76f7('0xa')](),controller[_0x76f7('0xd')]);router['put'](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0xf')]);router[_0x76f7('0x10')](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x11')]);module[_0x76f7('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3c6e6fa..642b227 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 _0x0bb2=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x27856f,_0x5ab561){var _0x2dd87e=function(_0x147184){while(--_0x147184){_0x27856f['push'](_0x27856f['shift']());}};_0x2dd87e(++_0x5ab561);}(_0x0bb2,0xe2));var _0x20bb=function(_0x5d77f1,_0x31a467){_0x5d77f1=_0x5d77f1-0x0;var _0x3ba56f=_0x0bb2[_0x5d77f1];return _0x3ba56f;};'use strict';var Sequelize=require(_0x20bb('0x0'));module[_0x20bb('0x1')]={'type':{'type':Sequelize[_0x20bb('0x2')](_0x20bb('0x3'),_0x20bb('0x4'),_0x20bb('0x5'),_0x20bb('0x6')),'defaultValue':_0x20bb('0x3')},'content':{'type':Sequelize[_0x20bb('0x7')]},'key':{'type':Sequelize[_0x20bb('0x7')]},'keyType':{'type':Sequelize[_0x20bb('0x2')](_0x20bb('0x3'),_0x20bb('0x4'),_0x20bb('0x5'))},'keyContent':{'type':Sequelize[_0x20bb('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x20bb('0x7')]},'customField':{'type':Sequelize[_0x20bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x20bb('0x7')]}}; \ No newline at end of file +var _0x43dd=['variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue','STRING','string'];(function(_0x55768b,_0x3dbd37){var _0x32c5bf=function(_0x11b381){while(--_0x11b381){_0x55768b['push'](_0x55768b['shift']());}};_0x32c5bf(++_0x3dbd37);}(_0x43dd,0x110));var _0xd43d=function(_0x39c589,_0x389217){_0x39c589=_0x39c589-0x0;var _0x6b90d5=_0x43dd[_0x39c589];return _0x6b90d5;};'use strict';var Sequelize=require(_0xd43d('0x0'));module[_0xd43d('0x1')]={'type':{'type':Sequelize[_0xd43d('0x2')]('string','variable',_0xd43d('0x3'),_0xd43d('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd43d('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd43d('0x2')](_0xd43d('0x6'),_0xd43d('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xd43d('0x5')]},'idField':{'type':Sequelize[_0xd43d('0x5')]},'nameField':{'type':Sequelize[_0xd43d('0x5')]},'customField':{'type':Sequelize[_0xd43d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd43d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 6979cf8..81a81ce 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 _0xaf9e=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','catch','show','params'];(function(_0x28f4ff,_0x5b575b){var _0x28a341=function(_0x1ccef8){while(--_0x1ccef8){_0x28f4ff['push'](_0x28f4ff['shift']());}};_0x28a341(++_0x5b575b);}(_0xaf9e,0x97));var _0xeaf9=function(_0x53f5dd,_0x3e2c6f){_0x53f5dd=_0x53f5dd-0x0;var _0x3a531e=_0xaf9e[_0x53f5dd];return _0x3a531e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeaf9('0x0'));var rimraf=require(_0xeaf9('0x1'));var zipdir=require(_0xeaf9('0x2'));var jsonpatch=require(_0xeaf9('0x3'));var rp=require(_0xeaf9('0x4'));var moment=require(_0xeaf9('0x5'));var BPromise=require(_0xeaf9('0x6'));var Mustache=require('mustache');var util=require(_0xeaf9('0x7'));var path=require('path');var sox=require(_0xeaf9('0x8'));var csv=require(_0xeaf9('0x9'));var ejs=require(_0xeaf9('0xa'));var fs=require('fs');var _=require(_0xeaf9('0xb'));var squel=require(_0xeaf9('0xc'));var crypto=require(_0xeaf9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeaf9('0xe'));var toCsv=require(_0xeaf9('0x9'));var querystring=require(_0xeaf9('0xf'));var Papa=require(_0xeaf9('0x10'));var Redis=require(_0xeaf9('0x11'));var authService=require(_0xeaf9('0x12'));var qs=require(_0xeaf9('0x13'));var as=require(_0xeaf9('0x14'));var hardwareService=require(_0xeaf9('0x15'));var logger=require(_0xeaf9('0x16'))(_0xeaf9('0x17'));var utils=require(_0xeaf9('0x18'));var config=require('../../config/environment');var db=require(_0xeaf9('0x19'))['db'];function respondWithStatusCode(_0x52ce7c,_0x1d998c){_0x1d998c=_0x1d998c||0xcc;return function(_0x93c31c){if(_0x93c31c){return _0x52ce7c[_0xeaf9('0x1a')](_0x1d998c);}return _0x52ce7c[_0xeaf9('0x1b')](_0x1d998c)[_0xeaf9('0x1c')]();};}function respondWithResult(_0x24e231,_0x1e396f){_0x1e396f=_0x1e396f||0xc8;return function(_0x3b5866){if(_0x3b5866){return _0x24e231[_0xeaf9('0x1b')](_0x1e396f)[_0xeaf9('0x1d')](_0x3b5866);}};}function respondWithFilteredResult(_0x292e35,_0x57dfb4){return function(_0x169932){if(_0x169932){var _0x58e35c=_0x169932['count'],_0x23c421=_0x57dfb4[_0xeaf9('0x1e')],_0x5d5b4b=_0x57dfb4[_0xeaf9('0x1e')]+_0x57dfb4[_0xeaf9('0x1f')],_0x3e631e;if(_0x5d5b4b>=_0x58e35c){_0x5d5b4b=_0x58e35c;_0x3e631e=0xc8;}else{_0x3e631e=0xce;}_0x292e35['status'](_0x3e631e);return _0x292e35[_0xeaf9('0x20')](_0xeaf9('0x21'),_0x23c421+'-'+_0x5d5b4b+'/'+_0x58e35c)[_0xeaf9('0x1d')](_0x169932);}return null;};}function patchUpdates(_0x2d0092){return function(_0x396127){try{jsonpatch['apply'](_0x396127,_0x2d0092,!![]);}catch(_0x18ace6){return BPromise[_0xeaf9('0x22')](_0x18ace6);}return _0x396127[_0xeaf9('0x23')]();};}function saveUpdates(_0x3022e8,_0x45a035){return function(_0x28a1f){if(_0x28a1f){return _0x28a1f['update'](_0x3022e8)[_0xeaf9('0x24')](function(_0x3e0fb7){return _0x3e0fb7;});}return null;};}function removeEntity(_0x2d5629,_0x35904b){return function(_0xff4abf){if(_0xff4abf){return _0xff4abf[_0xeaf9('0x25')]()['then'](function(){_0x2d5629[_0xeaf9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x368d42,_0x3bd68b){return function(_0x428c92){if(!_0x428c92){_0x368d42[_0xeaf9('0x1a')](0x194);}return _0x428c92;};}function handleError(_0x4d1666,_0x4b73ac){_0x4b73ac=_0x4b73ac||0x1f4;return function(_0x481c18){logger[_0xeaf9('0x26')](_0x481c18[_0xeaf9('0x27')]);if(_0x481c18[_0xeaf9('0x28')]){delete _0x481c18[_0xeaf9('0x28')];}_0x4d1666[_0xeaf9('0x1b')](_0x4b73ac)[_0xeaf9('0x29')](_0x481c18);};}exports[_0xeaf9('0x2a')]=function(_0x449089,_0xbc4eea){var _0x3dc8e0={},_0x42788e={},_0x11e6b8={'count':0x0,'rows':[]};var _0x564627=_[_0xeaf9('0x2b')](db[_0xeaf9('0x2c')][_0xeaf9('0x2d')],function(_0x216b14){return{'name':_0x216b14['fieldName'],'type':_0x216b14[_0xeaf9('0x2e')][_0xeaf9('0x2f')]};});_0x42788e['model']=_['map'](_0x564627,_0xeaf9('0x28'));_0x42788e[_0xeaf9('0x30')]=_[_0xeaf9('0x31')](_0x449089['query']);_0x42788e[_0xeaf9('0x32')]=_['intersection'](_0x42788e[_0xeaf9('0x33')],_0x42788e[_0xeaf9('0x30')]);_0x3dc8e0['attributes']=_[_0xeaf9('0x34')](_0x42788e[_0xeaf9('0x33')],qs[_0xeaf9('0x35')](_0x449089[_0xeaf9('0x30')][_0xeaf9('0x35')]));_0x3dc8e0[_0xeaf9('0x36')]=_0x3dc8e0[_0xeaf9('0x36')][_0xeaf9('0x37')]?_0x3dc8e0[_0xeaf9('0x36')]:_0x42788e[_0xeaf9('0x33')];if(!_0x449089[_0xeaf9('0x30')][_0xeaf9('0x38')](_0xeaf9('0x39'))){_0x3dc8e0[_0xeaf9('0x1f')]=qs[_0xeaf9('0x1f')](_0x449089[_0xeaf9('0x30')][_0xeaf9('0x1f')]);_0x3dc8e0[_0xeaf9('0x1e')]=qs[_0xeaf9('0x1e')](_0x449089[_0xeaf9('0x30')][_0xeaf9('0x1e')]);}_0x3dc8e0[_0xeaf9('0x3a')]=qs[_0xeaf9('0x3b')](_0x449089[_0xeaf9('0x30')][_0xeaf9('0x3b')]);_0x3dc8e0[_0xeaf9('0x3c')]=qs['filters'](_['pick'](_0x449089[_0xeaf9('0x30')],_0x42788e[_0xeaf9('0x32')]),_0x564627);if(_0x449089[_0xeaf9('0x30')][_0xeaf9('0x3d')]){_0x3dc8e0[_0xeaf9('0x3c')]=_[_0xeaf9('0x3e')](_0x3dc8e0['where'],{'$or':_['map'](_0x564627,function(_0x3a37f5){if(_0x3a37f5[_0xeaf9('0x2e')]!=='VIRTUAL'){var _0x155120={};_0x155120[_0x3a37f5['name']]={'$like':'%'+_0x449089['query']['filter']+'%'};return _0x155120;}})});}_0x3dc8e0=_[_0xeaf9('0x3e')]({},_0x3dc8e0,_0x449089[_0xeaf9('0x3f')]);var _0x590b67={'where':_0x3dc8e0['where']};return db[_0xeaf9('0x2c')][_0xeaf9('0x40')](_0x590b67)[_0xeaf9('0x24')](function(_0x5b0719){_0x11e6b8[_0xeaf9('0x40')]=_0x5b0719;if(_0x449089['query'][_0xeaf9('0x41')]){_0x3dc8e0[_0xeaf9('0x42')]=[{'all':!![]}];}return db[_0xeaf9('0x2c')][_0xeaf9('0x43')](_0x3dc8e0);})[_0xeaf9('0x24')](function(_0x224379){_0x11e6b8['rows']=_0x224379;return _0x11e6b8;})['then'](respondWithFilteredResult(_0xbc4eea,_0x3dc8e0))[_0xeaf9('0x44')](handleError(_0xbc4eea,null));};exports[_0xeaf9('0x45')]=function(_0xa413ef,_0x549254){var _0x1a9e03={'raw':!![],'where':{'id':_0xa413ef[_0xeaf9('0x46')]['id']}},_0x2686c1={};_0x2686c1['model']=_[_0xeaf9('0x31')](db[_0xeaf9('0x2c')][_0xeaf9('0x2d')]);_0x2686c1['query']=_[_0xeaf9('0x31')](_0xa413ef['query']);_0x2686c1[_0xeaf9('0x32')]=_['intersection'](_0x2686c1[_0xeaf9('0x33')],_0x2686c1[_0xeaf9('0x30')]);_0x1a9e03[_0xeaf9('0x36')]=_[_0xeaf9('0x34')](_0x2686c1[_0xeaf9('0x33')],qs['fields'](_0xa413ef[_0xeaf9('0x30')][_0xeaf9('0x35')]));_0x1a9e03['attributes']=_0x1a9e03[_0xeaf9('0x36')][_0xeaf9('0x37')]?_0x1a9e03[_0xeaf9('0x36')]:_0x2686c1[_0xeaf9('0x33')];if(_0xa413ef[_0xeaf9('0x30')][_0xeaf9('0x41')]){_0x1a9e03['include']=[{'all':!![]}];}_0x1a9e03=_['merge']({},_0x1a9e03,_0xa413ef['options']);return db['DeskField'][_0xeaf9('0x47')](_0x1a9e03)[_0xeaf9('0x24')](handleEntityNotFound(_0x549254,null))[_0xeaf9('0x24')](respondWithResult(_0x549254,null))[_0xeaf9('0x44')](handleError(_0x549254,null));};exports['create']=function(_0x445223,_0x51ac0d){return db[_0xeaf9('0x2c')][_0xeaf9('0x48')](_0x445223['body'],{})[_0xeaf9('0x24')](respondWithResult(_0x51ac0d,0xc9))[_0xeaf9('0x44')](handleError(_0x51ac0d,null));};exports['update']=function(_0x50b31e,_0x2e194b){if(_0x50b31e[_0xeaf9('0x49')]['id']){delete _0x50b31e[_0xeaf9('0x49')]['id'];}return db[_0xeaf9('0x2c')][_0xeaf9('0x47')]({'where':{'id':_0x50b31e['params']['id']}})[_0xeaf9('0x24')](handleEntityNotFound(_0x2e194b,null))[_0xeaf9('0x24')](saveUpdates(_0x50b31e[_0xeaf9('0x49')],null))[_0xeaf9('0x24')](respondWithResult(_0x2e194b,null))['catch'](handleError(_0x2e194b,null));};exports[_0xeaf9('0x25')]=function(_0x458dda,_0x234d2f){return db[_0xeaf9('0x2c')][_0xeaf9('0x47')]({'where':{'id':_0x458dda[_0xeaf9('0x46')]['id']}})['then'](handleEntityNotFound(_0x234d2f,null))[_0xeaf9('0x24')](removeEntity(_0x234d2f,null))[_0xeaf9('0x44')](handleError(_0x234d2f,null));}; \ No newline at end of file +var _0x0481=['eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','DeskField','includeAll','include','rows','catch','params','keys','options','create','body','find'];(function(_0xc8dbcf,_0xa57a31){var _0x1e1f4d=function(_0x7da737){while(--_0x7da737){_0xc8dbcf['push'](_0xc8dbcf['shift']());}};_0x1e1f4d(++_0xa57a31);}(_0x0481,0x1ea));var _0x1048=function(_0x5f1d74,_0x33e095){_0x5f1d74=_0x5f1d74-0x0;var _0xab75f5=_0x0481[_0x5f1d74];return _0xab75f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1048('0x0'));var rimraf=require(_0x1048('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1048('0x2'));var rp=require('request-promise');var moment=require(_0x1048('0x3'));var BPromise=require(_0x1048('0x4'));var Mustache=require(_0x1048('0x5'));var util=require(_0x1048('0x6'));var path=require(_0x1048('0x7'));var sox=require(_0x1048('0x8'));var csv=require('to-csv');var ejs=require(_0x1048('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1048('0xa'));var crypto=require('crypto');var jsforce=require(_0x1048('0xb'));var deskjs=require(_0x1048('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1048('0xd'));var Papa=require('papaparse');var Redis=require(_0x1048('0xe'));var authService=require(_0x1048('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1048('0x10'));var hardwareService=require(_0x1048('0x11'));var logger=require(_0x1048('0x12'))(_0x1048('0x13'));var utils=require('../../config/utils');var config=require(_0x1048('0x14'));var db=require(_0x1048('0x15'))['db'];function respondWithStatusCode(_0x11dbe0,_0x3ac779){_0x3ac779=_0x3ac779||0xcc;return function(_0x36dc1c){if(_0x36dc1c){return _0x11dbe0[_0x1048('0x16')](_0x3ac779);}return _0x11dbe0['status'](_0x3ac779)[_0x1048('0x17')]();};}function respondWithResult(_0x1ff21e,_0x25620c){_0x25620c=_0x25620c||0xc8;return function(_0x2c82af){if(_0x2c82af){return _0x1ff21e[_0x1048('0x18')](_0x25620c)[_0x1048('0x19')](_0x2c82af);}};}function respondWithFilteredResult(_0x286577,_0x2a0dc3){return function(_0x501727){if(_0x501727){var _0x309795=_0x501727[_0x1048('0x1a')],_0x51adfd=_0x2a0dc3[_0x1048('0x1b')],_0x5e3337=_0x2a0dc3[_0x1048('0x1b')]+_0x2a0dc3[_0x1048('0x1c')],_0x5c3d9c;if(_0x5e3337>=_0x309795){_0x5e3337=_0x309795;_0x5c3d9c=0xc8;}else{_0x5c3d9c=0xce;}_0x286577[_0x1048('0x18')](_0x5c3d9c);return _0x286577['set'](_0x1048('0x1d'),_0x51adfd+'-'+_0x5e3337+'/'+_0x309795)[_0x1048('0x19')](_0x501727);}return null;};}function patchUpdates(_0x5ef798){return function(_0x217f17){try{jsonpatch[_0x1048('0x1e')](_0x217f17,_0x5ef798,!![]);}catch(_0x2b6c7d){return BPromise[_0x1048('0x1f')](_0x2b6c7d);}return _0x217f17[_0x1048('0x20')]();};}function saveUpdates(_0x220d40,_0x391f07){return function(_0x2dbcb7){if(_0x2dbcb7){return _0x2dbcb7[_0x1048('0x21')](_0x220d40)['then'](function(_0x424bfa){return _0x424bfa;});}return null;};}function removeEntity(_0x2365c6,_0x3714bb){return function(_0x4b9e04){if(_0x4b9e04){return _0x4b9e04[_0x1048('0x22')]()[_0x1048('0x23')](function(){_0x2365c6[_0x1048('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e113,_0x7d1db3){return function(_0x4f068a){if(!_0x4f068a){_0x59e113['sendStatus'](0x194);}return _0x4f068a;};}function handleError(_0xc54014,_0x53329d){_0x53329d=_0x53329d||0x1f4;return function(_0x5dcdea){logger[_0x1048('0x24')](_0x5dcdea[_0x1048('0x25')]);if(_0x5dcdea[_0x1048('0x26')]){delete _0x5dcdea['name'];}_0xc54014[_0x1048('0x18')](_0x53329d)[_0x1048('0x27')](_0x5dcdea);};}exports[_0x1048('0x28')]=function(_0x38e489,_0x112fda){var _0x2b6ac7={},_0x21190d={},_0x58cd70={'count':0x0,'rows':[]};var _0x4c24b7=_[_0x1048('0x29')](db['DeskField'][_0x1048('0x2a')],function(_0x3c4b48){return{'name':_0x3c4b48[_0x1048('0x2b')],'type':_0x3c4b48[_0x1048('0x2c')]['key']};});_0x21190d[_0x1048('0x2d')]=_[_0x1048('0x29')](_0x4c24b7,_0x1048('0x26'));_0x21190d[_0x1048('0x2e')]=_['keys'](_0x38e489[_0x1048('0x2e')]);_0x21190d[_0x1048('0x2f')]=_[_0x1048('0x30')](_0x21190d[_0x1048('0x2d')],_0x21190d[_0x1048('0x2e')]);_0x2b6ac7[_0x1048('0x31')]=_[_0x1048('0x30')](_0x21190d[_0x1048('0x2d')],qs['fields'](_0x38e489[_0x1048('0x2e')][_0x1048('0x32')]));_0x2b6ac7[_0x1048('0x31')]=_0x2b6ac7[_0x1048('0x31')][_0x1048('0x33')]?_0x2b6ac7[_0x1048('0x31')]:_0x21190d[_0x1048('0x2d')];if(!_0x38e489['query'][_0x1048('0x34')]('nolimit')){_0x2b6ac7[_0x1048('0x1c')]=qs[_0x1048('0x1c')](_0x38e489[_0x1048('0x2e')][_0x1048('0x1c')]);_0x2b6ac7['offset']=qs[_0x1048('0x1b')](_0x38e489[_0x1048('0x2e')][_0x1048('0x1b')]);}_0x2b6ac7[_0x1048('0x35')]=qs[_0x1048('0x36')](_0x38e489[_0x1048('0x2e')][_0x1048('0x36')]);_0x2b6ac7[_0x1048('0x37')]=qs[_0x1048('0x2f')](_['pick'](_0x38e489[_0x1048('0x2e')],_0x21190d[_0x1048('0x2f')]),_0x4c24b7);if(_0x38e489[_0x1048('0x2e')][_0x1048('0x38')]){_0x2b6ac7[_0x1048('0x37')]=_[_0x1048('0x39')](_0x2b6ac7[_0x1048('0x37')],{'$or':_['map'](_0x4c24b7,function(_0x47b503){if(_0x47b503[_0x1048('0x2c')]!==_0x1048('0x3a')){var _0x3af631={};_0x3af631[_0x47b503[_0x1048('0x26')]]={'$like':'%'+_0x38e489[_0x1048('0x2e')][_0x1048('0x38')]+'%'};return _0x3af631;}})});}_0x2b6ac7=_[_0x1048('0x39')]({},_0x2b6ac7,_0x38e489['options']);var _0x131bda={'where':_0x2b6ac7[_0x1048('0x37')]};return db[_0x1048('0x3b')][_0x1048('0x1a')](_0x131bda)['then'](function(_0x2bf85f){_0x58cd70[_0x1048('0x1a')]=_0x2bf85f;if(_0x38e489[_0x1048('0x2e')][_0x1048('0x3c')]){_0x2b6ac7[_0x1048('0x3d')]=[{'all':!![]}];}return db[_0x1048('0x3b')]['findAll'](_0x2b6ac7);})['then'](function(_0x4636cf){_0x58cd70[_0x1048('0x3e')]=_0x4636cf;return _0x58cd70;})[_0x1048('0x23')](respondWithFilteredResult(_0x112fda,_0x2b6ac7))[_0x1048('0x3f')](handleError(_0x112fda,null));};exports['show']=function(_0x2cc00e,_0x5cd3cd){var _0x45fa13={'raw':!![],'where':{'id':_0x2cc00e[_0x1048('0x40')]['id']}},_0x1723db={};_0x1723db[_0x1048('0x2d')]=_[_0x1048('0x41')](db['DeskField'][_0x1048('0x2a')]);_0x1723db[_0x1048('0x2e')]=_[_0x1048('0x41')](_0x2cc00e['query']);_0x1723db['filters']=_[_0x1048('0x30')](_0x1723db[_0x1048('0x2d')],_0x1723db[_0x1048('0x2e')]);_0x45fa13[_0x1048('0x31')]=_[_0x1048('0x30')](_0x1723db[_0x1048('0x2d')],qs['fields'](_0x2cc00e[_0x1048('0x2e')][_0x1048('0x32')]));_0x45fa13[_0x1048('0x31')]=_0x45fa13[_0x1048('0x31')][_0x1048('0x33')]?_0x45fa13[_0x1048('0x31')]:_0x1723db[_0x1048('0x2d')];if(_0x2cc00e[_0x1048('0x2e')]['includeAll']){_0x45fa13[_0x1048('0x3d')]=[{'all':!![]}];}_0x45fa13=_[_0x1048('0x39')]({},_0x45fa13,_0x2cc00e[_0x1048('0x42')]);return db[_0x1048('0x3b')]['find'](_0x45fa13)[_0x1048('0x23')](handleEntityNotFound(_0x5cd3cd,null))[_0x1048('0x23')](respondWithResult(_0x5cd3cd,null))[_0x1048('0x3f')](handleError(_0x5cd3cd,null));};exports[_0x1048('0x43')]=function(_0x49e455,_0x29413c){return db[_0x1048('0x3b')]['create'](_0x49e455[_0x1048('0x44')],{})['then'](respondWithResult(_0x29413c,0xc9))['catch'](handleError(_0x29413c,null));};exports[_0x1048('0x21')]=function(_0xabea57,_0x398021){if(_0xabea57[_0x1048('0x44')]['id']){delete _0xabea57[_0x1048('0x44')]['id'];}return db['DeskField'][_0x1048('0x45')]({'where':{'id':_0xabea57[_0x1048('0x40')]['id']}})[_0x1048('0x23')](handleEntityNotFound(_0x398021,null))[_0x1048('0x23')](saveUpdates(_0xabea57[_0x1048('0x44')],null))[_0x1048('0x23')](respondWithResult(_0x398021,null))[_0x1048('0x3f')](handleError(_0x398021,null));};exports[_0x1048('0x22')]=function(_0x2f0c4c,_0x1fc82b){return db[_0x1048('0x3b')][_0x1048('0x45')]({'where':{'id':_0x2f0c4c['params']['id']}})[_0x1048('0x23')](handleEntityNotFound(_0x1fc82b,null))[_0x1048('0x23')](removeEntity(_0x1fc82b,null))['catch'](handleError(_0x1fc82b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 890fefd..e41f88c 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 _0x60d3=['DeskField','desk_unique_index','idField','FieldId','util','../../config/logger','moment','request-promise','path','rimraf','./intDeskField.attributes','exports','define'];(function(_0x561ffc,_0x20d0b3){var _0x2aff8b=function(_0xbe16b2){while(--_0xbe16b2){_0x561ffc['push'](_0x561ffc['shift']());}};_0x2aff8b(++_0x20d0b3);}(_0x60d3,0xd4));var _0x360d=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x60d3[_0x1b70e3];return _0x1452ab;};'use strict';var _=require('lodash');var util=require(_0x360d('0x0'));var logger=require(_0x360d('0x1'))('api');var moment=require(_0x360d('0x2'));var BPromise=require('bluebird');var rp=require(_0x360d('0x3'));var fs=require('fs');var path=require(_0x360d('0x4'));var rimraf=require(_0x360d('0x5'));var config=require('../../config/environment');var attributes=require(_0x360d('0x6'));module[_0x360d('0x7')]=function(_0x5bb72a,_0x4da21a){return _0x5bb72a[_0x360d('0x8')](_0x360d('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x360d('0xa'),'fields':[_0x360d('0xb'),_0x360d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf770=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf770,0x16c));var _0x0f77=function(_0x3412d6,_0x1f67f1){_0x3412d6=_0x3412d6-0x0;var _0x12cdd8=_0xf770[_0x3412d6];return _0x12cdd8;};'use strict';var _=require(_0x0f77('0x0'));var util=require('util');var logger=require(_0x0f77('0x1'))(_0x0f77('0x2'));var moment=require(_0x0f77('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f77('0x5'));var config=require(_0x0f77('0x6'));var attributes=require('./intDeskField.attributes');module[_0x0f77('0x7')]=function(_0x341626,_0x38052c){return _0x341626[_0x0f77('0x8')]('DeskField',attributes,{'tableName':_0x0f77('0x9'),'paranoid':![],'indexes':[{'name':_0x0f77('0xa'),'fields':[_0x0f77('0xb'),_0x0f77('0xc')],'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 ae29a5d..f4b83de 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 _0x6192=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x6192,0x13f));var _0x2619=function(_0x42319d,_0x33ecbe){_0x42319d=_0x42319d-0x0;var _0x5cc83d=_0x6192[_0x42319d];return _0x5cc83d;};'use strict';var _=require('lodash');var util=require(_0x2619('0x0'));var moment=require('moment');var BPromise=require(_0x2619('0x1'));var rs=require(_0x2619('0x2'));var fs=require('fs');var Redis=require(_0x2619('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2619('0x4'))(_0x2619('0x5'));var config=require(_0x2619('0x6'));var jayson=require(_0x2619('0x7'));var client=jayson['client'][_0x2619('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d9697,_0x11fdc7,_0x253c4b){return new BPromise(function(_0x382c8e,_0x53ccc0){return client['request'](_0x4d9697,_0x253c4b)[_0x2619('0x9')](function(_0x2a4f75){logger[_0x2619('0xa')](_0x2619('0xb'),_0x11fdc7,_0x2619('0xc'));logger['debug'](_0x2619('0xd'),_0x11fdc7,'request\x20sent',JSON[_0x2619('0xe')](_0x2a4f75));if(_0x2a4f75[_0x2619('0xf')]){if(_0x2a4f75[_0x2619('0xf')][_0x2619('0x10')]===0x1f4){logger[_0x2619('0xf')](_0x2619('0xb'),_0x11fdc7,_0x2a4f75[_0x2619('0xf')]['message']);return _0x53ccc0(_0x2a4f75['error']['message']);}logger[_0x2619('0xf')]('DeskField,\x20%s,\x20%s',_0x11fdc7,_0x2a4f75['error'][_0x2619('0x11')]);return _0x382c8e(_0x2a4f75[_0x2619('0xf')]['message']);}else{logger[_0x2619('0xa')](_0x2619('0xb'),_0x11fdc7,_0x2619('0xc'));_0x382c8e(_0x2a4f75['result'][_0x2619('0x11')]);}})[_0x2619('0x12')](function(_0x2090fd){logger[_0x2619('0xf')]('DeskField,\x20%s,\x20%s',_0x11fdc7,_0x2090fd);_0x53ccc0(_0x2090fd);});});} \ No newline at end of file +var _0xaecd=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0xa45c53,_0xe21591){var _0x4a5b39=function(_0x526b2e){while(--_0x526b2e){_0xa45c53['push'](_0xa45c53['shift']());}};_0x4a5b39(++_0xe21591);}(_0xaecd,0x11f));var _0xdaec=function(_0x3293dc,_0x2089fe){_0x3293dc=_0x3293dc-0x0;var _0x46960f=_0xaecd[_0x3293dc];return _0x46960f;};'use strict';var _=require(_0xdaec('0x0'));var util=require(_0xdaec('0x1'));var moment=require(_0xdaec('0x2'));var BPromise=require(_0xdaec('0x3'));var rs=require(_0xdaec('0x4'));var fs=require('fs');var Redis=require(_0xdaec('0x5'));var db=require(_0xdaec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaec('0x7'))(_0xdaec('0x8'));var config=require(_0xdaec('0x9'));var jayson=require(_0xdaec('0xa'));var client=jayson['client'][_0xdaec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x478285,_0x33d0c8,_0xbae55d){return new BPromise(function(_0x3ab54d,_0x558b22){return client[_0xdaec('0xc')](_0x478285,_0xbae55d)[_0xdaec('0xd')](function(_0x1a1104){logger[_0xdaec('0xe')](_0xdaec('0xf'),_0x33d0c8,_0xdaec('0x10'));logger[_0xdaec('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x33d0c8,_0xdaec('0x10'),JSON[_0xdaec('0x12')](_0x1a1104));if(_0x1a1104[_0xdaec('0x13')]){if(_0x1a1104['error']['code']===0x1f4){logger[_0xdaec('0x13')](_0xdaec('0xf'),_0x33d0c8,_0x1a1104[_0xdaec('0x13')][_0xdaec('0x14')]);return _0x558b22(_0x1a1104[_0xdaec('0x13')][_0xdaec('0x14')]);}logger['error'](_0xdaec('0xf'),_0x33d0c8,_0x1a1104[_0xdaec('0x13')][_0xdaec('0x14')]);return _0x3ab54d(_0x1a1104[_0xdaec('0x13')][_0xdaec('0x14')]);}else{logger[_0xdaec('0xe')](_0xdaec('0xf'),_0x33d0c8,'request\x20sent');_0x3ab54d(_0x1a1104[_0xdaec('0x15')][_0xdaec('0x14')]);}})[_0xdaec('0x16')](function(_0x48fa3c){logger['error']('DeskField,\x20%s,\x20%s',_0x33d0c8,_0x48fa3c);_0x558b22(_0x48fa3c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e934243..54fcceb 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 _0x2092=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x2092,0x1f1));var _0x2209=function(_0x3a3eaf,_0x10b24c){_0x3a3eaf=_0x3a3eaf-0x0;var _0x187fbf=_0x2092[_0x3a3eaf];return _0x187fbf;};'use strict';var multer=require('multer');var util=require(_0x2209('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2209('0x1'));var router=express[_0x2209('0x2')]();var auth=require(_0x2209('0x3'));var interaction=require(_0x2209('0x4'));var config=require(_0x2209('0x5'));var controller=require(_0x2209('0x6'));router[_0x2209('0x7')]('/',auth[_0x2209('0x8')](),controller[_0x2209('0x9')]);router['get'](_0x2209('0xa'),auth['isAuthenticated'](),controller[_0x2209('0xb')]);router[_0x2209('0x7')](_0x2209('0xc'),auth[_0x2209('0x8')](),controller[_0x2209('0xd')]);router[_0x2209('0x7')](_0x2209('0xe'),auth[_0x2209('0x8')](),controller['getFields']);router[_0x2209('0xf')]('/',auth[_0x2209('0x8')](),controller[_0x2209('0x10')]);router[_0x2209('0xf')](_0x2209('0xc'),auth[_0x2209('0x8')](),controller[_0x2209('0x11')]);router[_0x2209('0x12')](_0x2209('0xa'),auth[_0x2209('0x8')](),controller[_0x2209('0x13')]);router[_0x2209('0x14')](_0x2209('0xa'),auth['isAuthenticated'](),controller[_0x2209('0x15')]);module[_0x2209('0x16')]=router; \ No newline at end of file +var _0x6acd=['isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','put','destroy','exports','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get'];(function(_0xb28ee9,_0x184eae){var _0x3d830f=function(_0x37be18){while(--_0x37be18){_0xb28ee9['push'](_0xb28ee9['shift']());}};_0x3d830f(++_0x184eae);}(_0x6acd,0x19a));var _0xd6ac=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6acd[_0x40a045];return _0x1a687c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd6ac('0x0'));var express=require(_0xd6ac('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd6ac('0x2'));var config=require(_0xd6ac('0x3'));var controller=require(_0xd6ac('0x4'));router[_0xd6ac('0x5')]('/',auth[_0xd6ac('0x6')](),controller['index']);router['get'](_0xd6ac('0x7'),auth[_0xd6ac('0x6')](),controller[_0xd6ac('0x8')]);router[_0xd6ac('0x5')](_0xd6ac('0x9'),auth[_0xd6ac('0x6')](),controller[_0xd6ac('0xa')]);router[_0xd6ac('0x5')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd6ac('0xb')]);router['post']('/',auth[_0xd6ac('0x6')](),controller['create']);router[_0xd6ac('0xc')](_0xd6ac('0x9'),auth[_0xd6ac('0x6')](),controller['addConfiguration']);router[_0xd6ac('0xd')](_0xd6ac('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd6ac('0x7'),auth[_0xd6ac('0x6')](),controller[_0xd6ac('0xe')]);module[_0xd6ac('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 9e9e8e7..c7ae2e3 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 _0x4524=['exports','STRING','sequelize'];(function(_0x17ed95,_0x23bbaf){var _0x267b68=function(_0x28ea16){while(--_0x28ea16){_0x17ed95['push'](_0x17ed95['shift']());}};_0x267b68(++_0x23bbaf);}(_0x4524,0x1a0));var _0x4452=function(_0xb33004,_0x48cab3){_0xb33004=_0xb33004-0x0;var _0x34469b=_0x4524[_0xb33004];return _0x34469b;};'use strict';var Sequelize=require(_0x4452('0x0'));module[_0x4452('0x1')]={'name':{'type':Sequelize[_0x4452('0x2')]},'username':{'type':Sequelize[_0x4452('0x2')]},'password':{'type':Sequelize[_0x4452('0x2')]},'remoteUri':{'type':Sequelize[_0x4452('0x2')]},'tenantId':{'type':Sequelize[_0x4452('0x2')]},'clientId':{'type':Sequelize[_0x4452('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4452('0x2')]},'description':{'type':Sequelize[_0x4452('0x2')]}}; \ No newline at end of file +var _0x7af2=['exports','STRING','sequelize'];(function(_0x20e702,_0x37eafd){var _0x4cd3a0=function(_0x90105a){while(--_0x90105a){_0x20e702['push'](_0x20e702['shift']());}};_0x4cd3a0(++_0x37eafd);}(_0x7af2,0x1dc));var _0x27af=function(_0x2ef345,_0x7edda2){_0x2ef345=_0x2ef345-0x0;var _0x3dbad6=_0x7af2[_0x2ef345];return _0x3dbad6;};'use strict';var Sequelize=require(_0x27af('0x0'));module[_0x27af('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x27af('0x2')]},'password':{'type':Sequelize[_0x27af('0x2')]},'remoteUri':{'type':Sequelize[_0x27af('0x2')]},'tenantId':{'type':Sequelize[_0x27af('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x27af('0x2')]},'serverUrl':{'type':Sequelize[_0x27af('0x2')]},'description':{'type':Sequelize[_0x27af('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 0f96fa4..6f901db 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 _0x4141=['getConfigurations','findOne','Dynamics365Configuration','pick','nolimit','addConfiguration','Subjects','channel','type','getDescriptions','Descriptions','getFields','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','productidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','versionnumber','username','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','Wrong\x20credentials','UserLocalizedLabel','Label',')/Attributes(','OptionSet','TrueOption','true','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','json','count','offset','limit','Content-Range','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','Dynamics365Account','includeAll','include','findAll','show','params','keys','options','create','body','find'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x4141,0x7e));var _0x1414=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4141[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1414('0x0'));var rimraf=require(_0x1414('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1414('0x2'));var rp=require(_0x1414('0x3'));var moment=require(_0x1414('0x4'));var BPromise=require(_0x1414('0x5'));var Mustache=require(_0x1414('0x6'));var util=require('util');var path=require(_0x1414('0x7'));var sox=require(_0x1414('0x8'));var csv=require('to-csv');var ejs=require(_0x1414('0x9'));var fs=require('fs');var _=require(_0x1414('0xa'));var squel=require(_0x1414('0xb'));var crypto=require(_0x1414('0xc'));var jsforce=require(_0x1414('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1414('0xe'));var querystring=require(_0x1414('0xf'));var Papa=require(_0x1414('0x10'));var Redis=require(_0x1414('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1414('0x12'));var hardwareService=require(_0x1414('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1414('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x1414('0x15'));var jayson=require(_0x1414('0x16'));var client=jayson[_0x1414('0x17')][_0x1414('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2ad24b,_0x24ee44,_0x5025c0){if(_0x5025c0){var _0x234bd9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x234bd9[_0x1414('0x19')](_0x24ee44)){return _0x2ad24b;}else{throw new db[(_0x1414('0x1a'))][(_0x1414('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 _0x2ad24b;}}function respondWithRpcPromise(_0x1a1b46,_0x1f1ace,_0x1826b5,_0x247436){return new BPromise(function(_0x3ae086,_0x125d7a){var _0x16ce20=_0x247436||client;return _0x16ce20[_0x1414('0x1c')](_0x1a1b46,_0x1826b5)[_0x1414('0x1d')](function(_0x47797f){logger[_0x1414('0x1e')]('Dynamics365Account,\x20%s,\x20%s',_0x1f1ace,'request\x20sent');logger[_0x1414('0x1f')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1f1ace,'request\x20sent',JSON[_0x1414('0x20')](_0x47797f));if(_0x47797f[_0x1414('0x21')]){if(_0x47797f[_0x1414('0x21')][_0x1414('0x22')]===0x1f4){logger['error'](_0x1414('0x23'),_0x1f1ace,_0x47797f[_0x1414('0x21')][_0x1414('0x24')]);return _0x125d7a(_0x47797f['error'][_0x1414('0x24')]);}logger[_0x1414('0x21')](_0x1414('0x23'),_0x1f1ace,_0x47797f[_0x1414('0x21')][_0x1414('0x24')]);return _0x3ae086(_0x47797f[_0x1414('0x21')][_0x1414('0x24')]);}else{logger[_0x1414('0x1e')](_0x1414('0x23'),_0x1f1ace,_0x1414('0x25'));_0x3ae086(_0x47797f[_0x1414('0x26')]['message']);}})[_0x1414('0x27')](function(_0x4c7152){logger[_0x1414('0x21')](_0x1414('0x23'),_0x1f1ace,_0x4c7152);_0x125d7a(_0x4c7152);});});}function respondWithStatusCode(_0x240a4a,_0x1a9a43){_0x1a9a43=_0x1a9a43||0xcc;return function(_0x19097b){if(_0x19097b){return _0x240a4a['sendStatus'](_0x1a9a43);}return _0x240a4a[_0x1414('0x28')](_0x1a9a43)[_0x1414('0x29')]();};}function respondWithResult(_0xf6d19e,_0x30fa13){_0x30fa13=_0x30fa13||0xc8;return function(_0x5caad4){if(_0x5caad4){return _0xf6d19e[_0x1414('0x28')](_0x30fa13)[_0x1414('0x2a')](_0x5caad4);}};}function respondWithFilteredResult(_0x2038bb,_0x1f997d){return function(_0x15e5a9){if(_0x15e5a9){var _0xabebbe=_0x15e5a9[_0x1414('0x2b')],_0x1ffaba=_0x1f997d[_0x1414('0x2c')],_0x27ac38=_0x1f997d[_0x1414('0x2c')]+_0x1f997d[_0x1414('0x2d')],_0x3ae98d;if(_0x27ac38>=_0xabebbe){_0x27ac38=_0xabebbe;_0x3ae98d=0xc8;}else{_0x3ae98d=0xce;}_0x2038bb[_0x1414('0x28')](_0x3ae98d);return _0x2038bb['set'](_0x1414('0x2e'),_0x1ffaba+'-'+_0x27ac38+'/'+_0xabebbe)[_0x1414('0x2a')](_0x15e5a9);}return null;};}function patchUpdates(_0x46e96f){return function(_0x66c7a5){try{jsonpatch['apply'](_0x66c7a5,_0x46e96f,!![]);}catch(_0x446e59){return BPromise['reject'](_0x446e59);}return _0x66c7a5[_0x1414('0x2f')]();};}function saveUpdates(_0x484895,_0x54d950){return function(_0x22016e){if(_0x22016e){return _0x22016e[_0x1414('0x30')](_0x484895)[_0x1414('0x1d')](function(_0x5f2962){return _0x5f2962;});}return null;};}function removeEntity(_0x3db0b1,_0x316e57){return function(_0x544ea2){if(_0x544ea2){return _0x544ea2[_0x1414('0x31')]()[_0x1414('0x1d')](function(){_0x3db0b1[_0x1414('0x28')](0xcc)[_0x1414('0x29')]();});}};}function handleEntityNotFound(_0x77b538,_0x1ddf58){return function(_0x186a5b){if(!_0x186a5b){_0x77b538[_0x1414('0x32')](0x194);}return _0x186a5b;};}function handleError(_0x2cb1a9,_0x1a4c1b){_0x1a4c1b=_0x1a4c1b||0x1f4;return function(_0x497a16){logger['error'](_0x497a16[_0x1414('0x33')]);if(_0x497a16[_0x1414('0x34')]){delete _0x497a16[_0x1414('0x34')];}_0x2cb1a9[_0x1414('0x28')](_0x1a4c1b)[_0x1414('0x35')](_0x497a16);};}exports[_0x1414('0x36')]=function(_0x324e2e,_0x4ec5dc){var _0x7a8119={},_0x2be805={},_0x3b7168={'count':0x0,'rows':[]};var _0x10e6e6=_[_0x1414('0x37')](db['Dynamics365Account'][_0x1414('0x38')],function(_0x5d33d7){return{'name':_0x5d33d7['fieldName'],'type':_0x5d33d7['type'][_0x1414('0x39')]};});_0x2be805[_0x1414('0x3a')]=_[_0x1414('0x37')](_0x10e6e6,_0x1414('0x34'));_0x2be805[_0x1414('0x3b')]=_['keys'](_0x324e2e[_0x1414('0x3b')]);_0x2be805[_0x1414('0x3c')]=_['intersection'](_0x2be805[_0x1414('0x3a')],_0x2be805[_0x1414('0x3b')]);_0x7a8119[_0x1414('0x3d')]=_[_0x1414('0x3e')](_0x2be805[_0x1414('0x3a')],qs['fields'](_0x324e2e[_0x1414('0x3b')][_0x1414('0x3f')]));_0x7a8119[_0x1414('0x3d')]=_0x7a8119[_0x1414('0x3d')][_0x1414('0x40')]?_0x7a8119[_0x1414('0x3d')]:_0x2be805['model'];if(!_0x324e2e[_0x1414('0x3b')]['hasOwnProperty']('nolimit')){_0x7a8119[_0x1414('0x2d')]=qs[_0x1414('0x2d')](_0x324e2e[_0x1414('0x3b')][_0x1414('0x2d')]);_0x7a8119[_0x1414('0x2c')]=qs[_0x1414('0x2c')](_0x324e2e[_0x1414('0x3b')][_0x1414('0x2c')]);}_0x7a8119[_0x1414('0x41')]=qs[_0x1414('0x42')](_0x324e2e[_0x1414('0x3b')][_0x1414('0x42')]);_0x7a8119[_0x1414('0x43')]=qs[_0x1414('0x3c')](_['pick'](_0x324e2e[_0x1414('0x3b')],_0x2be805[_0x1414('0x3c')]),_0x10e6e6);if(_0x324e2e[_0x1414('0x3b')][_0x1414('0x44')]){_0x7a8119[_0x1414('0x43')]=_[_0x1414('0x45')](_0x7a8119[_0x1414('0x43')],{'$or':_[_0x1414('0x37')](_0x10e6e6,function(_0x12d88e){if(_0x12d88e['type']!=='VIRTUAL'){var _0x4613dc={};_0x4613dc[_0x12d88e[_0x1414('0x34')]]={'$like':'%'+_0x324e2e[_0x1414('0x3b')][_0x1414('0x44')]+'%'};return _0x4613dc;}})});}_0x7a8119=_['merge']({},_0x7a8119,_0x324e2e['options']);var _0x24f615={'where':_0x7a8119[_0x1414('0x43')]};return db[_0x1414('0x46')][_0x1414('0x2b')](_0x24f615)[_0x1414('0x1d')](function(_0x2da220){_0x3b7168[_0x1414('0x2b')]=_0x2da220;if(_0x324e2e[_0x1414('0x3b')][_0x1414('0x47')]){_0x7a8119[_0x1414('0x48')]=[{'all':!![]}];}return db[_0x1414('0x46')][_0x1414('0x49')](_0x7a8119);})['then'](function(_0x449faf){_0x3b7168['rows']=_0x449faf;return _0x3b7168;})[_0x1414('0x1d')](respondWithFilteredResult(_0x4ec5dc,_0x7a8119))['catch'](handleError(_0x4ec5dc,null));};exports[_0x1414('0x4a')]=function(_0x4a2f79,_0x15466e){var _0x3c1be3={'raw':![],'where':{'id':_0x4a2f79[_0x1414('0x4b')]['id']}},_0x3fe4c5={};_0x3fe4c5['model']=_[_0x1414('0x4c')](db[_0x1414('0x46')][_0x1414('0x38')]);_0x3fe4c5[_0x1414('0x3b')]=_[_0x1414('0x4c')](_0x4a2f79[_0x1414('0x3b')]);_0x3fe4c5[_0x1414('0x3c')]=_['intersection'](_0x3fe4c5[_0x1414('0x3a')],_0x3fe4c5[_0x1414('0x3b')]);_0x3c1be3['attributes']=_[_0x1414('0x3e')](_0x3fe4c5[_0x1414('0x3a')],qs[_0x1414('0x3f')](_0x4a2f79[_0x1414('0x3b')][_0x1414('0x3f')]));_0x3c1be3[_0x1414('0x3d')]=_0x3c1be3[_0x1414('0x3d')][_0x1414('0x40')]?_0x3c1be3[_0x1414('0x3d')]:_0x3fe4c5['model'];if(_0x4a2f79[_0x1414('0x3b')][_0x1414('0x47')]){_0x3c1be3[_0x1414('0x48')]=[{'all':!![]}];}_0x3c1be3=_[_0x1414('0x45')]({},_0x3c1be3,_0x4a2f79[_0x1414('0x4d')]);return db[_0x1414('0x46')]['find'](_0x3c1be3)[_0x1414('0x1d')](handleEntityNotFound(_0x15466e,null))[_0x1414('0x1d')](respondWithResult(_0x15466e,null))[_0x1414('0x27')](handleError(_0x15466e,null));};exports[_0x1414('0x4e')]=function(_0x6fa3be,_0x4f6079){return db['Dynamics365Account']['create'](_0x6fa3be[_0x1414('0x4f')],{})[_0x1414('0x1d')](respondWithResult(_0x4f6079,0xc9))[_0x1414('0x27')](handleError(_0x4f6079,null));};exports[_0x1414('0x30')]=function(_0xf6ebd3,_0x78480){if(_0xf6ebd3[_0x1414('0x4f')]['id']){delete _0xf6ebd3[_0x1414('0x4f')]['id'];}return db['Dynamics365Account'][_0x1414('0x50')]({'where':{'id':_0xf6ebd3[_0x1414('0x4b')]['id']}})[_0x1414('0x1d')](handleEntityNotFound(_0x78480,null))[_0x1414('0x1d')](saveUpdates(_0xf6ebd3[_0x1414('0x4f')],null))[_0x1414('0x1d')](respondWithResult(_0x78480,null))[_0x1414('0x27')](handleError(_0x78480,null));};exports['destroy']=function(_0x5104fd,_0x426f5a){return db['Dynamics365Account'][_0x1414('0x50')]({'where':{'id':_0x5104fd['params']['id']}})[_0x1414('0x1d')](handleEntityNotFound(_0x426f5a,null))['then'](removeEntity(_0x426f5a,null))[_0x1414('0x27')](handleError(_0x426f5a,null));};exports[_0x1414('0x51')]=function(_0x5130c1,_0x27f751,_0x361155){var _0x2d7ce4={};var _0x2da5f8={};var _0x373b1b;var _0x43a25e;return db[_0x1414('0x46')][_0x1414('0x52')]({'where':{'id':_0x5130c1[_0x1414('0x4b')]['id']}})[_0x1414('0x1d')](handleEntityNotFound(_0x27f751,null))[_0x1414('0x1d')](function(_0x31495e){if(_0x31495e){_0x373b1b=_0x31495e;_0x2da5f8['model']=_[_0x1414('0x4c')](db[_0x1414('0x53')][_0x1414('0x38')]);_0x2da5f8[_0x1414('0x3b')]=_[_0x1414('0x4c')](_0x5130c1[_0x1414('0x3b')]);_0x2da5f8[_0x1414('0x3c')]=_[_0x1414('0x3e')](_0x2da5f8[_0x1414('0x3a')],_0x2da5f8[_0x1414('0x3b')]);_0x2d7ce4[_0x1414('0x3d')]=_[_0x1414('0x3e')](_0x2da5f8[_0x1414('0x3a')],qs[_0x1414('0x3f')](_0x5130c1[_0x1414('0x3b')][_0x1414('0x3f')]));_0x2d7ce4[_0x1414('0x3d')]=_0x2d7ce4[_0x1414('0x3d')][_0x1414('0x40')]?_0x2d7ce4[_0x1414('0x3d')]:_0x2da5f8[_0x1414('0x3a')];_0x2d7ce4[_0x1414('0x41')]=qs['sort'](_0x5130c1[_0x1414('0x3b')][_0x1414('0x42')]);_0x2d7ce4[_0x1414('0x43')]=qs[_0x1414('0x3c')](_[_0x1414('0x54')](_0x5130c1[_0x1414('0x3b')],_0x2da5f8['filters']));if(_0x5130c1[_0x1414('0x3b')][_0x1414('0x44')]){_0x2d7ce4[_0x1414('0x43')]=_[_0x1414('0x45')](_0x2d7ce4[_0x1414('0x43')],{'$or':_[_0x1414('0x37')](_0x2d7ce4[_0x1414('0x3d')],function(_0x544896){var _0x5c28b9={};_0x5c28b9[_0x544896]={'$like':'%'+_0x5130c1[_0x1414('0x3b')][_0x1414('0x44')]+'%'};return _0x5c28b9;})});}_0x2d7ce4=_[_0x1414('0x45')]({},_0x2d7ce4,_0x5130c1[_0x1414('0x4d')]);return _0x373b1b[_0x1414('0x51')](_0x2d7ce4);}})[_0x1414('0x1d')](function(_0x55a410){if(_0x55a410){_0x43a25e=_0x55a410['length'];if(!_0x5130c1['query']['hasOwnProperty'](_0x1414('0x55'))){_0x2d7ce4[_0x1414('0x2d')]=qs[_0x1414('0x2d')](_0x5130c1[_0x1414('0x3b')]['limit']);_0x2d7ce4[_0x1414('0x2c')]=qs['offset'](_0x5130c1[_0x1414('0x3b')][_0x1414('0x2c')]);}return _0x373b1b[_0x1414('0x51')](_0x2d7ce4);}})[_0x1414('0x1d')](function(_0x16c6d0){if(_0x16c6d0){return _0x16c6d0?{'count':_0x43a25e,'rows':_0x16c6d0}:null;}})[_0x1414('0x1d')](respondWithResult(_0x27f751,null))[_0x1414('0x27')](handleError(_0x27f751,null));};exports[_0x1414('0x56')]=function(_0x2dcb92,_0x4bd302,_0x4ef126){if(_0x2dcb92[_0x1414('0x4f')]['id']){delete _0x2dcb92['body']['id'];}return db[_0x1414('0x46')][_0x1414('0x52')]({'where':{'id':_0x2dcb92[_0x1414('0x4b')]['id']}})[_0x1414('0x1d')](handleEntityNotFound(_0x4bd302,null))[_0x1414('0x1d')](function(_0xb5e16f){if(_0xb5e16f){_0x2dcb92[_0x1414('0x4f')]['AccountId']=_0xb5e16f['id'];_0x2dcb92[_0x1414('0x4f')][_0x1414('0x57')]=integrations['getSubjects'](_0x2dcb92[_0x1414('0x4f')][_0x1414('0x58')],_0x2dcb92[_0x1414('0x4f')][_0x1414('0x59')]);_0x2dcb92[_0x1414('0x4f')]['Descriptions']=integrations[_0x1414('0x5a')](_0x2dcb92[_0x1414('0x4f')]['channel'],_0x2dcb92[_0x1414('0x4f')][_0x1414('0x59')]);return db[_0x1414('0x53')][_0x1414('0x4e')](_0x2dcb92[_0x1414('0x4f')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x1414('0x5b')}]});}return null;})['then'](respondWithResult(_0x4bd302,null))[_0x1414('0x27')](handleError(_0x4bd302,null));};exports[_0x1414('0x5c')]=function(_0x4fe9bc,_0x1e1034,_0x2df171){var _0x1ee54a=_0x4fe9bc['query']['ticketType'];var _0x2d3a66=_0x1ee54a===_0x1414('0x5d')?_0x1414('0x5e'):'PhoneCall';var _0xb0b131='';var _0x16da10='';var _0x433a69='';var _0x5d1e6d='';var _0xdde799='';var _0x37d8df='';var _0x20bf94='';var _0x212ef6='';var _0x4bd379=[_0x1414('0x5f'),_0x1414('0x60'),_0x1414('0x61'),_0x1414('0x62'),_0x1414('0x63'),_0x1414('0x64'),_0x1414('0x65'),_0x1414('0x66'),_0x1414('0x67'),'phonecall_activity_parties'];var _0x2a592b=['accountidname','accountidyominame',_0x1414('0x68'),_0x1414('0x69'),_0x1414('0x6a'),_0x1414('0x6b'),_0x1414('0x6c'),'contractidname',_0x1414('0x6d'),_0x1414('0x6e'),'createdbyname',_0x1414('0x6f'),'createdon','createdonbehalfbyname',_0x1414('0x70'),_0x1414('0x71'),'customeridtype',_0x1414('0x72'),_0x1414('0x73'),_0x1414('0x74'),_0x1414('0x75'),_0x1414('0x76'),_0x1414('0x77'),_0x1414('0x78'),_0x1414('0x79'),_0x1414('0x7a'),_0x1414('0x7b'),_0x1414('0x7c'),_0x1414('0x7d'),_0x1414('0x7e'),_0x1414('0x7f'),_0x1414('0x80'),_0x1414('0x81'),_0x1414('0x82'),_0x1414('0x83'),_0x1414('0x84'),'modifiedonbehalfbyname',_0x1414('0x85'),_0x1414('0x86'),_0x1414('0x87'),_0x1414('0x88'),_0x1414('0x89'),_0x1414('0x8a'),_0x1414('0x8b'),_0x1414('0x8c'),_0x1414('0x8d'),_0x1414('0x8e'),'primarycontactidname','primarycontactidyominame','prioritycodename',_0x1414('0x8f'),'productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname',_0x1414('0x90'),_0x1414('0x91'),_0x1414('0x92'),_0x1414('0x93'),_0x1414('0x94'),_0x1414('0x95'),_0x1414('0x96'),_0x1414('0x97'),'ticketnumber',_0x1414('0x98'),'transactioncurrencyidname',_0x1414('0x99'),'utcconversiontimezonecode',_0x1414('0x9a')];var _0x3f6c80=_0x4bd379['concat'](_0x2a592b);return db['Dynamics365Account'][_0x1414('0x52')]({'where':{'id':_0x4fe9bc[_0x1414('0x4b')]['id']},'attributes':['id',_0x1414('0x9b'),_0x1414('0x9c'),_0x1414('0x9d'),'tenantId',_0x1414('0x9e'),_0x1414('0x9f')]})['then'](handleEntityNotFound(_0x1e1034,null))[_0x1414('0x1d')](function(_0x5928bd){if(_0x5928bd){_0x212ef6=_0x5928bd['remoteUri'];var _0x24c5d0=_0x212ef6[_0x1414('0xa0')](-0x1);if(_0x24c5d0==='/'){_0x212ef6=_0x212ef6[_0x1414('0xa1')](0x0,_0x212ef6[_0x1414('0xa2')](_0x24c5d0));}_0x20bf94=util[_0x1414('0xa3')](_0x1414('0xa4'),_0x212ef6);var _0x5f250e={'method':_0x1414('0xa5'),'uri':_0x1414('0xa6')+_0x5928bd['tenantId']+_0x1414('0xa7'),'form':{'client_id':_0x5928bd[_0x1414('0x9e')],'resource':_0x212ef6,'username':_0x5928bd[_0x1414('0x9b')],'password':_0x5928bd[_0x1414('0x9c')],'grant_type':_0x1414('0x9c'),'client_secret':_0x5928bd[_0x1414('0x9f')]},'json':!![]};return rp(_0x5f250e);}})[_0x1414('0x1d')](function(_0x5b4085){_0x37d8df=_0x5b4085[_0x1414('0xa8')];var _0x3d396d={'method':'GET','uri':encodeURI(_0x20bf94+_0x1414('0xa9')+_0x2d3a66+'\x27'),'headers':{'Authorization':_0x1414('0xaa')+_0x37d8df,'If-None-Match':null,'OData-Version':_0x1414('0xab')},'json':!![]};return rp(_0x3d396d);})[_0x1414('0x1d')](function(_0x482ff8){var _0x34afd4=_0x482ff8['value'][0x0];var _0x5f19aa=_0x34afd4[_0x1414('0xac')];var _0x3aa9de={'method':_0x1414('0xad'),'uri':_0x20bf94+_0x1414('0xae')+_0x5f19aa+_0x1414('0xaf'),'headers':{'Authorization':_0x1414('0xaa')+_0x37d8df,'If-None-Match':null,'OData-Version':_0x1414('0xab')},'json':!![]};return rp(_0x3aa9de);})[_0x1414('0x1d')](function(_0x3cb23e){_0xb0b131=_0x3cb23e;_0x16da10=_0xb0b131[_0x1414('0xb0')];_0x16da10=_['remove'](_0x16da10,function(_0x5560d4){return!_0x3f6c80[_0x1414('0xb1')](_0x5560d4[_0x1414('0xb2')]);});var _0x4aaacb=[];var _0x42540c=[];_0x16da10[_0x1414('0xb3')](function(_0x53eb09){if(_0x53eb09[_0x1414('0xb4')]){var _0x5e0ea8=_0x53eb09[_0x1414('0xb4')]['substring'](_0x53eb09[_0x1414('0xb4')]['lastIndexOf']('.')+0x1);if(_0x5e0ea8===_0x1414('0xb5')){_0x4aaacb[_0x1414('0xb6')](getSelectList(_0x20bf94,_0x1ee54a,_0x42540c,_0xb0b131[_0x1414('0xac')],_0x53eb09[_0x1414('0xac')],_0x37d8df));}}});return Promise[_0x1414('0xb7')](_0x4aaacb);})[_0x1414('0x1d')](function(_0x35fdb3){_0x433a69=_0x35fdb3[0x0];var _0x6c3c48=[];var _0xd873a4=[];_0x16da10[_0x1414('0xb3')](function(_0x10f336){if(!_[_0x1414('0xb8')](_0x10f336['@odata.type'])){var _0x4efbc0=_0x10f336[_0x1414('0xb4')][_0x1414('0xa1')](_0x10f336[_0x1414('0xb4')][_0x1414('0xa2')]('.')+0x1);if(_0x4efbc0===_0x1414('0xb9')){_0x6c3c48[_0x1414('0xb6')](getBooleanList(_0x20bf94,_0x1ee54a,_0xd873a4,_0xb0b131['MetadataId'],_0x10f336[_0x1414('0xac')],_0x37d8df));}}});return Promise[_0x1414('0xb7')](_0x6c3c48);})[_0x1414('0x1d')](function(_0x532c9d){_0x5d1e6d=_0x532c9d[0x0];var _0x2207e8=[];var _0xc7a67f=[];_0x16da10[_0x1414('0xb3')](function(_0xa3d528){if(_0xa3d528[_0x1414('0xb4')]){var _0x3965d6=_0xa3d528[_0x1414('0xb4')][_0x1414('0xa1')](_0xa3d528[_0x1414('0xb4')]['lastIndexOf']('.')+0x1);if(_0x3965d6===_0x1414('0xba')||_0x3965d6===_0x1414('0xbb')||_0x3965d6==='BigIntAttributeMetadata'||_0x3965d6===_0x1414('0xbc')||_0x3965d6===_0x1414('0xbd')||_0x3965d6===_0x1414('0xbe')||_0x3965d6===_0x1414('0xbf')||_0x3965d6===_0x1414('0xc0')||_0x3965d6===_0x1414('0xc1')||_0x3965d6===_0x1414('0xc2')){_0x2207e8['push'](getInputList(_0x20bf94,_0x1ee54a,_0x3965d6,_0xc7a67f,_0xb0b131[_0x1414('0xac')],_0xa3d528[_0x1414('0xac')],_0x37d8df));}}});return Promise[_0x1414('0xb7')](_0x2207e8);})[_0x1414('0x1d')](function(_0x141717){_0xdde799=_0x141717[0x0];var _0x556611=_0x433a69[_0x1414('0xc3')](_0x5d1e6d)[_0x1414('0xc3')](_0xdde799);var _0x104522={'count':_0x556611[_0x1414('0x40')],'rows':_0x556611};return _0x104522;})[_0x1414('0x1d')](respondWithResult(_0x1e1034,null))[_0x1414('0x27')](function(_0x1096a0){var _0x4dadd2=_0x4fe9bc[_0x1414('0x3b')][_0x1414('0x19')]?0x1f4:_0x1096a0['statusCode']||0x1f4;logger['error'](_0x1096a0[_0x1414('0x33')]);delete _0x1096a0[_0x1414('0x34')];if(_0x4dadd2===0x191){_0x4dadd2=0x190;}_0x1e1034[_0x1414('0x28')](_0x4dadd2)[_0x1414('0x35')](_0x4fe9bc['query']['test']?{'message':_0x1414('0xc4'),'statusCode':_0x1096a0['statusCode']}:_0x1096a0);});};function getSelectList(_0x3e10e6,_0x580a,_0x84935,_0x5453f4,_0x26ea88,_0xa48524){var _0x12da7c={'method':_0x1414('0xad'),'uri':_0x3e10e6+'EntityDefinitions('+_0x5453f4+')/Attributes('+_0x26ea88+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x1414('0xaa')+_0xa48524,'If-None-Match':null,'OData-Version':_0x1414('0xab')},'json':!![]};return rp(_0x12da7c)[_0x1414('0x1d')](function(_0x4cfd8a){var _0x29c986=[];var _0x5466a7=_0x4cfd8a['OptionSet']['Options'];_0x5466a7[_0x1414('0xb3')](function(_0x4538a3){_0x29c986[_0x1414('0xb6')]({'name':_0x4538a3['Label'][_0x1414('0xc5')][_0x1414('0xc6')],'value':String(_0x4538a3['Value'])});});var _0x22e433={'id':_0x580a+'_'+_0x4cfd8a[_0x1414('0xb2')],'name':_0x4cfd8a['DisplayName'][_0x1414('0xc5')][_0x1414('0xc6')],'custom':![],'options':_0x29c986};_0x84935[_0x1414('0xb6')](_0x22e433);return _0x84935;});}function getBooleanList(_0x3c09b6,_0x2ee9b8,_0x19c7ec,_0x11d60b,_0x56f1b6,_0x566549){var _0x4c3124={'method':'GET','uri':_0x3c09b6+_0x1414('0xae')+_0x11d60b+_0x1414('0xc7')+_0x56f1b6+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1414('0xaa')+_0x566549,'If-None-Match':null,'OData-Version':_0x1414('0xab')},'json':!![]};return rp(_0x4c3124)['then'](function(_0xcdf695){var _0x51fb18=[];_0x51fb18[_0x1414('0xb6')]({'name':_0xcdf695[_0x1414('0xc8')][_0x1414('0xc9')][_0x1414('0xc6')][_0x1414('0xc5')]['Label'],'value':_0x1414('0xca')},{'name':_0xcdf695[_0x1414('0xc8')]['FalseOption'][_0x1414('0xc6')][_0x1414('0xc5')][_0x1414('0xc6')],'value':_0x1414('0xcb')});var _0x4487dd={'id':_0x2ee9b8+'_'+_0xcdf695[_0x1414('0xb2')],'name':_0xcdf695[_0x1414('0xcc')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x51fb18};_0x19c7ec[_0x1414('0xb6')](_0x4487dd);return _0x19c7ec;});}function getInputList(_0x2d873a,_0x38aee8,_0x36cf32,_0x120daf,_0x12ad68,_0x20006b,_0x183bfe){var _0x4b3fab={'method':_0x1414('0xad'),'uri':_0x2d873a+_0x1414('0xae')+_0x12ad68+_0x1414('0xc7')+_0x20006b+_0x1414('0xcd')+_0x36cf32+_0x1414('0xce'),'headers':{'Authorization':_0x1414('0xaa')+_0x183bfe,'If-None-Match':null,'OData-Version':_0x1414('0xab')},'json':!![]};return rp(_0x4b3fab)['then'](function(_0x44bcb3){var _0x9c3f2b={'id':_0x38aee8+'_'+_0x44bcb3[_0x1414('0xb2')],'name':_0x44bcb3[_0x1414('0xcc')][_0x1414('0xc5')]?_0x44bcb3[_0x1414('0xcc')][_0x1414('0xc5')]['Label']:_0x44bcb3[_0x1414('0xb2')],'custom':![],'options':[]};_0x120daf[_0x1414('0xb6')](_0x9c3f2b);return _0x120daf;});} \ No newline at end of file +var _0xc8a0=['PicklistAttributeMetadata','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','getConfigurations','rawAttributes','hasOwnProperty','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','Subjects','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','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)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring'];(function(_0x485abd,_0x32c7c1){var _0x3379f1=function(_0x36b528){while(--_0x36b528){_0x485abd['push'](_0x485abd['shift']());}};_0x3379f1(++_0x32c7c1);}(_0xc8a0,0xf8));var _0x0c8a=function(_0x1f3dcc,_0x39e9f9){_0x1f3dcc=_0x1f3dcc-0x0;var _0xf990ba=_0xc8a0[_0x1f3dcc];return _0xf990ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0c8a('0x0'));var rimraf=require(_0x0c8a('0x1'));var zipdir=require(_0x0c8a('0x2'));var jsonpatch=require(_0x0c8a('0x3'));var rp=require(_0x0c8a('0x4'));var moment=require(_0x0c8a('0x5'));var BPromise=require(_0x0c8a('0x6'));var Mustache=require(_0x0c8a('0x7'));var util=require('util');var path=require(_0x0c8a('0x8'));var sox=require(_0x0c8a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0c8a('0xa'));var squel=require(_0x0c8a('0xb'));var crypto=require(_0x0c8a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0c8a('0xd'));var toCsv=require(_0x0c8a('0xe'));var querystring=require(_0x0c8a('0xf'));var Papa=require(_0x0c8a('0x10'));var Redis=require(_0x0c8a('0x11'));var authService=require(_0x0c8a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0c8a('0x13'));var hardwareService=require(_0x0c8a('0x14'));var logger=require(_0x0c8a('0x15'))('api');var utils=require(_0x0c8a('0x16'));var config=require(_0x0c8a('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x0c8a('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x10b22,_0x434a71,_0x16afc0){if(_0x16afc0){var _0x3e7c5d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e7c5d[_0x0c8a('0x19')](_0x434a71)){return _0x10b22;}else{throw new db[(_0x0c8a('0x1a'))][(_0x0c8a('0x1b'))](_0x0c8a('0x1c'));}}else{return _0x10b22;}}function respondWithRpcPromise(_0x3bcb58,_0x5d150c,_0x577a47,_0x3efc5c){return new BPromise(function(_0x4c6b56,_0x49fe46){var _0x4b1409=_0x3efc5c||client;return _0x4b1409[_0x0c8a('0x1d')](_0x3bcb58,_0x577a47)[_0x0c8a('0x1e')](function(_0x51b9c8){logger[_0x0c8a('0x1f')](_0x0c8a('0x20'),_0x5d150c,_0x0c8a('0x21'));logger[_0x0c8a('0x22')](_0x0c8a('0x23'),_0x5d150c,_0x0c8a('0x21'),JSON[_0x0c8a('0x24')](_0x51b9c8));if(_0x51b9c8['error']){if(_0x51b9c8[_0x0c8a('0x25')]['code']===0x1f4){logger[_0x0c8a('0x25')](_0x0c8a('0x20'),_0x5d150c,_0x51b9c8[_0x0c8a('0x25')][_0x0c8a('0x26')]);return _0x49fe46(_0x51b9c8[_0x0c8a('0x25')][_0x0c8a('0x26')]);}logger[_0x0c8a('0x25')](_0x0c8a('0x20'),_0x5d150c,_0x51b9c8[_0x0c8a('0x25')]['message']);return _0x4c6b56(_0x51b9c8[_0x0c8a('0x25')][_0x0c8a('0x26')]);}else{logger['info'](_0x0c8a('0x20'),_0x5d150c,_0x0c8a('0x21'));_0x4c6b56(_0x51b9c8[_0x0c8a('0x27')][_0x0c8a('0x26')]);}})['catch'](function(_0x1611da){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5d150c,_0x1611da);_0x49fe46(_0x1611da);});});}function respondWithStatusCode(_0x2887d9,_0x1fd560){_0x1fd560=_0x1fd560||0xcc;return function(_0x236187){if(_0x236187){return _0x2887d9['sendStatus'](_0x1fd560);}return _0x2887d9[_0x0c8a('0x28')](_0x1fd560)[_0x0c8a('0x29')]();};}function respondWithResult(_0x3afdbe,_0x5cab97){_0x5cab97=_0x5cab97||0xc8;return function(_0xc9e4d1){if(_0xc9e4d1){return _0x3afdbe[_0x0c8a('0x28')](_0x5cab97)[_0x0c8a('0x2a')](_0xc9e4d1);}};}function respondWithFilteredResult(_0xeec116,_0x3faded){return function(_0x76f459){if(_0x76f459){var _0x28a638=_0x76f459[_0x0c8a('0x2b')],_0x167caa=_0x3faded[_0x0c8a('0x2c')],_0x22b21f=_0x3faded[_0x0c8a('0x2c')]+_0x3faded[_0x0c8a('0x2d')],_0x3062ad;if(_0x22b21f>=_0x28a638){_0x22b21f=_0x28a638;_0x3062ad=0xc8;}else{_0x3062ad=0xce;}_0xeec116[_0x0c8a('0x28')](_0x3062ad);return _0xeec116['set'](_0x0c8a('0x2e'),_0x167caa+'-'+_0x22b21f+'/'+_0x28a638)[_0x0c8a('0x2a')](_0x76f459);}return null;};}function patchUpdates(_0x2091b8){return function(_0x20c2bb){try{jsonpatch[_0x0c8a('0x2f')](_0x20c2bb,_0x2091b8,!![]);}catch(_0x3e35c2){return BPromise[_0x0c8a('0x30')](_0x3e35c2);}return _0x20c2bb[_0x0c8a('0x31')]();};}function saveUpdates(_0x9f7d2f,_0x46e8a3){return function(_0x399a43){if(_0x399a43){return _0x399a43[_0x0c8a('0x32')](_0x9f7d2f)[_0x0c8a('0x1e')](function(_0x2d5153){return _0x2d5153;});}return null;};}function removeEntity(_0x2824ae,_0x5ecf76){return function(_0x5c7963){if(_0x5c7963){return _0x5c7963[_0x0c8a('0x33')]()[_0x0c8a('0x1e')](function(){_0x2824ae[_0x0c8a('0x28')](0xcc)[_0x0c8a('0x29')]();});}};}function handleEntityNotFound(_0x39e879,_0x5359b6){return function(_0x1e3daf){if(!_0x1e3daf){_0x39e879[_0x0c8a('0x34')](0x194);}return _0x1e3daf;};}function handleError(_0x2f8797,_0x3e20b0){_0x3e20b0=_0x3e20b0||0x1f4;return function(_0x4220f9){logger[_0x0c8a('0x25')](_0x4220f9[_0x0c8a('0x35')]);if(_0x4220f9[_0x0c8a('0x36')]){delete _0x4220f9[_0x0c8a('0x36')];}_0x2f8797[_0x0c8a('0x28')](_0x3e20b0)[_0x0c8a('0x37')](_0x4220f9);};}exports[_0x0c8a('0x38')]=function(_0x2147bd,_0x22da85){var _0xfd5c14={},_0x116b16={},_0xce7753={'count':0x0,'rows':[]};var _0x4f858a=_[_0x0c8a('0x39')](db[_0x0c8a('0x3a')]['rawAttributes'],function(_0x20ec44){return{'name':_0x20ec44[_0x0c8a('0x3b')],'type':_0x20ec44[_0x0c8a('0x3c')][_0x0c8a('0x3d')]};});_0x116b16[_0x0c8a('0x3e')]=_[_0x0c8a('0x39')](_0x4f858a,_0x0c8a('0x36'));_0x116b16[_0x0c8a('0x3f')]=_['keys'](_0x2147bd[_0x0c8a('0x3f')]);_0x116b16[_0x0c8a('0x40')]=_[_0x0c8a('0x41')](_0x116b16[_0x0c8a('0x3e')],_0x116b16['query']);_0xfd5c14[_0x0c8a('0x42')]=_['intersection'](_0x116b16[_0x0c8a('0x3e')],qs[_0x0c8a('0x43')](_0x2147bd[_0x0c8a('0x3f')][_0x0c8a('0x43')]));_0xfd5c14[_0x0c8a('0x42')]=_0xfd5c14[_0x0c8a('0x42')][_0x0c8a('0x44')]?_0xfd5c14[_0x0c8a('0x42')]:_0x116b16[_0x0c8a('0x3e')];if(!_0x2147bd['query']['hasOwnProperty'](_0x0c8a('0x45'))){_0xfd5c14[_0x0c8a('0x2d')]=qs[_0x0c8a('0x2d')](_0x2147bd['query'][_0x0c8a('0x2d')]);_0xfd5c14[_0x0c8a('0x2c')]=qs[_0x0c8a('0x2c')](_0x2147bd[_0x0c8a('0x3f')]['offset']);}_0xfd5c14[_0x0c8a('0x46')]=qs['sort'](_0x2147bd[_0x0c8a('0x3f')][_0x0c8a('0x47')]);_0xfd5c14[_0x0c8a('0x48')]=qs[_0x0c8a('0x40')](_[_0x0c8a('0x49')](_0x2147bd[_0x0c8a('0x3f')],_0x116b16[_0x0c8a('0x40')]),_0x4f858a);if(_0x2147bd[_0x0c8a('0x3f')][_0x0c8a('0x4a')]){_0xfd5c14[_0x0c8a('0x48')]=_[_0x0c8a('0x4b')](_0xfd5c14[_0x0c8a('0x48')],{'$or':_[_0x0c8a('0x39')](_0x4f858a,function(_0x57e915){if(_0x57e915['type']!=='VIRTUAL'){var _0x67ab14={};_0x67ab14[_0x57e915[_0x0c8a('0x36')]]={'$like':'%'+_0x2147bd[_0x0c8a('0x3f')][_0x0c8a('0x4a')]+'%'};return _0x67ab14;}})});}_0xfd5c14=_[_0x0c8a('0x4b')]({},_0xfd5c14,_0x2147bd[_0x0c8a('0x4c')]);var _0x1852c9={'where':_0xfd5c14[_0x0c8a('0x48')]};return db[_0x0c8a('0x3a')][_0x0c8a('0x2b')](_0x1852c9)[_0x0c8a('0x1e')](function(_0xa83083){_0xce7753[_0x0c8a('0x2b')]=_0xa83083;if(_0x2147bd[_0x0c8a('0x3f')][_0x0c8a('0x4d')]){_0xfd5c14[_0x0c8a('0x4e')]=[{'all':!![]}];}return db[_0x0c8a('0x3a')][_0x0c8a('0x4f')](_0xfd5c14);})[_0x0c8a('0x1e')](function(_0x511122){_0xce7753[_0x0c8a('0x50')]=_0x511122;return _0xce7753;})[_0x0c8a('0x1e')](respondWithFilteredResult(_0x22da85,_0xfd5c14))[_0x0c8a('0x51')](handleError(_0x22da85,null));};exports['show']=function(_0x122d55,_0x27d9bd){var _0x4fedc8={'raw':![],'where':{'id':_0x122d55['params']['id']}},_0x50919c={};_0x50919c[_0x0c8a('0x3e')]=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x50919c[_0x0c8a('0x3f')]=_[_0x0c8a('0x52')](_0x122d55[_0x0c8a('0x3f')]);_0x50919c[_0x0c8a('0x40')]=_[_0x0c8a('0x41')](_0x50919c[_0x0c8a('0x3e')],_0x50919c[_0x0c8a('0x3f')]);_0x4fedc8[_0x0c8a('0x42')]=_[_0x0c8a('0x41')](_0x50919c['model'],qs[_0x0c8a('0x43')](_0x122d55[_0x0c8a('0x3f')][_0x0c8a('0x43')]));_0x4fedc8['attributes']=_0x4fedc8[_0x0c8a('0x42')][_0x0c8a('0x44')]?_0x4fedc8['attributes']:_0x50919c['model'];if(_0x122d55['query'][_0x0c8a('0x4d')]){_0x4fedc8[_0x0c8a('0x4e')]=[{'all':!![]}];}_0x4fedc8=_[_0x0c8a('0x4b')]({},_0x4fedc8,_0x122d55['options']);return db[_0x0c8a('0x3a')][_0x0c8a('0x53')](_0x4fedc8)['then'](handleEntityNotFound(_0x27d9bd,null))[_0x0c8a('0x1e')](respondWithResult(_0x27d9bd,null))[_0x0c8a('0x51')](handleError(_0x27d9bd,null));};exports[_0x0c8a('0x54')]=function(_0x30722f,_0x5b74f1){return db['Dynamics365Account'][_0x0c8a('0x54')](_0x30722f['body'],{})[_0x0c8a('0x1e')](respondWithResult(_0x5b74f1,0xc9))[_0x0c8a('0x51')](handleError(_0x5b74f1,null));};exports[_0x0c8a('0x32')]=function(_0x37f352,_0x4cb486){if(_0x37f352[_0x0c8a('0x55')]['id']){delete _0x37f352[_0x0c8a('0x55')]['id'];}return db[_0x0c8a('0x3a')][_0x0c8a('0x53')]({'where':{'id':_0x37f352[_0x0c8a('0x56')]['id']}})[_0x0c8a('0x1e')](handleEntityNotFound(_0x4cb486,null))[_0x0c8a('0x1e')](saveUpdates(_0x37f352[_0x0c8a('0x55')],null))[_0x0c8a('0x1e')](respondWithResult(_0x4cb486,null))['catch'](handleError(_0x4cb486,null));};exports[_0x0c8a('0x33')]=function(_0x500c69,_0x5290b2){return db['Dynamics365Account'][_0x0c8a('0x53')]({'where':{'id':_0x500c69[_0x0c8a('0x56')]['id']}})[_0x0c8a('0x1e')](handleEntityNotFound(_0x5290b2,null))[_0x0c8a('0x1e')](removeEntity(_0x5290b2,null))[_0x0c8a('0x51')](handleError(_0x5290b2,null));};exports[_0x0c8a('0x57')]=function(_0x249372,_0x348766,_0x12617e){var _0x31b0af={};var _0x2cc53e={};var _0x435b12;var _0x5b0e50;return db[_0x0c8a('0x3a')]['findOne']({'where':{'id':_0x249372[_0x0c8a('0x56')]['id']}})[_0x0c8a('0x1e')](handleEntityNotFound(_0x348766,null))[_0x0c8a('0x1e')](function(_0x21d5d8){if(_0x21d5d8){_0x435b12=_0x21d5d8;_0x2cc53e['model']=_[_0x0c8a('0x52')](db['Dynamics365Configuration'][_0x0c8a('0x58')]);_0x2cc53e[_0x0c8a('0x3f')]=_[_0x0c8a('0x52')](_0x249372[_0x0c8a('0x3f')]);_0x2cc53e[_0x0c8a('0x40')]=_[_0x0c8a('0x41')](_0x2cc53e['model'],_0x2cc53e[_0x0c8a('0x3f')]);_0x31b0af[_0x0c8a('0x42')]=_[_0x0c8a('0x41')](_0x2cc53e[_0x0c8a('0x3e')],qs[_0x0c8a('0x43')](_0x249372[_0x0c8a('0x3f')][_0x0c8a('0x43')]));_0x31b0af[_0x0c8a('0x42')]=_0x31b0af[_0x0c8a('0x42')][_0x0c8a('0x44')]?_0x31b0af[_0x0c8a('0x42')]:_0x2cc53e['model'];_0x31b0af[_0x0c8a('0x46')]=qs['sort'](_0x249372['query'][_0x0c8a('0x47')]);_0x31b0af['where']=qs[_0x0c8a('0x40')](_[_0x0c8a('0x49')](_0x249372[_0x0c8a('0x3f')],_0x2cc53e['filters']));if(_0x249372[_0x0c8a('0x3f')][_0x0c8a('0x4a')]){_0x31b0af[_0x0c8a('0x48')]=_['merge'](_0x31b0af[_0x0c8a('0x48')],{'$or':_['map'](_0x31b0af[_0x0c8a('0x42')],function(_0x3a3d22){var _0xa6be3c={};_0xa6be3c[_0x3a3d22]={'$like':'%'+_0x249372[_0x0c8a('0x3f')][_0x0c8a('0x4a')]+'%'};return _0xa6be3c;})});}_0x31b0af=_[_0x0c8a('0x4b')]({},_0x31b0af,_0x249372[_0x0c8a('0x4c')]);return _0x435b12[_0x0c8a('0x57')](_0x31b0af);}})[_0x0c8a('0x1e')](function(_0x3ebfa9){if(_0x3ebfa9){_0x5b0e50=_0x3ebfa9['length'];if(!_0x249372[_0x0c8a('0x3f')][_0x0c8a('0x59')](_0x0c8a('0x45'))){_0x31b0af[_0x0c8a('0x2d')]=qs[_0x0c8a('0x2d')](_0x249372[_0x0c8a('0x3f')][_0x0c8a('0x2d')]);_0x31b0af['offset']=qs[_0x0c8a('0x2c')](_0x249372[_0x0c8a('0x3f')]['offset']);}return _0x435b12[_0x0c8a('0x57')](_0x31b0af);}})[_0x0c8a('0x1e')](function(_0x43567c){if(_0x43567c){return _0x43567c?{'count':_0x5b0e50,'rows':_0x43567c}:null;}})[_0x0c8a('0x1e')](respondWithResult(_0x348766,null))[_0x0c8a('0x51')](handleError(_0x348766,null));};exports[_0x0c8a('0x5a')]=function(_0x2eda27,_0x240983,_0x2d9a52){if(_0x2eda27[_0x0c8a('0x55')]['id']){delete _0x2eda27['body']['id'];}return db[_0x0c8a('0x3a')][_0x0c8a('0x5b')]({'where':{'id':_0x2eda27[_0x0c8a('0x56')]['id']}})['then'](handleEntityNotFound(_0x240983,null))[_0x0c8a('0x1e')](function(_0x293365){if(_0x293365){_0x2eda27['body'][_0x0c8a('0x5c')]=_0x293365['id'];_0x2eda27[_0x0c8a('0x55')]['Subjects']=integrations[_0x0c8a('0x5d')](_0x2eda27['body'][_0x0c8a('0x5e')],_0x2eda27[_0x0c8a('0x55')][_0x0c8a('0x3c')]);_0x2eda27[_0x0c8a('0x55')][_0x0c8a('0x5f')]=integrations[_0x0c8a('0x60')](_0x2eda27['body'][_0x0c8a('0x5e')],_0x2eda27[_0x0c8a('0x55')][_0x0c8a('0x3c')]);return db[_0x0c8a('0x61')][_0x0c8a('0x54')](_0x2eda27[_0x0c8a('0x55')],{'include':[{'model':db[_0x0c8a('0x62')],'as':_0x0c8a('0x63')},{'model':db[_0x0c8a('0x62')],'as':_0x0c8a('0x5f')}]});}return null;})[_0x0c8a('0x1e')](respondWithResult(_0x240983,null))[_0x0c8a('0x51')](handleError(_0x240983,null));};exports['getFields']=function(_0x185d80,_0x39e152,_0x2199f8){var _0x33c582=_0x185d80[_0x0c8a('0x3f')][_0x0c8a('0x64')];var _0x56fbc0=_0x33c582===_0x0c8a('0x65')?_0x0c8a('0x66'):_0x0c8a('0x67');var _0x4b1da3='';var _0x55dd83='';var _0x1e7eae='';var _0x2aa9cc='';var _0x3934d2='';var _0x677e24='';var _0x429f48='';var _0x2a06aa='';var _0x23decd=[_0x0c8a('0x68'),_0x0c8a('0x69'),_0x0c8a('0x6a'),_0x0c8a('0x6b'),_0x0c8a('0x6c'),_0x0c8a('0x6d'),_0x0c8a('0x6e'),_0x0c8a('0x6f'),_0x0c8a('0x70'),_0x0c8a('0x71')];var _0x3e64b6=[_0x0c8a('0x72'),_0x0c8a('0x73'),'actualserviceunits',_0x0c8a('0x74'),_0x0c8a('0x75'),_0x0c8a('0x76'),_0x0c8a('0x77'),'contractidname','createdbyexternalpartyname',_0x0c8a('0x78'),_0x0c8a('0x79'),_0x0c8a('0x7a'),'createdon',_0x0c8a('0x7b'),_0x0c8a('0x7c'),_0x0c8a('0x7d'),'customeridtype',_0x0c8a('0x7e'),'emailaddress',_0x0c8a('0x7f'),_0x0c8a('0x80'),_0x0c8a('0x81'),_0x0c8a('0x82'),_0x0c8a('0x83'),'firstresponsebykpiidname',_0x0c8a('0x84'),'importsequencenumber',_0x0c8a('0x85'),'kbarticleidname',_0x0c8a('0x86'),_0x0c8a('0x87'),_0x0c8a('0x88'),_0x0c8a('0x89'),_0x0c8a('0x8a'),_0x0c8a('0x8b'),_0x0c8a('0x8c'),_0x0c8a('0x8d'),'modifiedonbehalfbyyominame',_0x0c8a('0x8e'),'msdyn_iotalertname','numberofchildincidents',_0x0c8a('0x8f'),_0x0c8a('0x90'),_0x0c8a('0x91'),'owneridtype',_0x0c8a('0x92'),_0x0c8a('0x93'),_0x0c8a('0x94'),_0x0c8a('0x95'),_0x0c8a('0x96'),_0x0c8a('0x97'),'productserialnumber',_0x0c8a('0x98'),_0x0c8a('0x99'),_0x0c8a('0x9a'),'responsiblecontactidname','responsiblecontactidyominame',_0x0c8a('0x9b'),_0x0c8a('0x9c'),'slaname','socialprofileidname','statecode',_0x0c8a('0x9d'),_0x0c8a('0x9e'),_0x0c8a('0x9f'),_0x0c8a('0xa0'),'transactioncurrencyidname',_0x0c8a('0xa1'),_0x0c8a('0xa2'),_0x0c8a('0xa3')];var _0x37b038=_0x23decd[_0x0c8a('0xa4')](_0x3e64b6);return db[_0x0c8a('0x3a')][_0x0c8a('0x5b')]({'where':{'id':_0x185d80[_0x0c8a('0x56')]['id']},'attributes':['id',_0x0c8a('0xa5'),_0x0c8a('0xa6'),_0x0c8a('0xa7'),_0x0c8a('0xa8'),_0x0c8a('0xa9'),_0x0c8a('0xaa')]})[_0x0c8a('0x1e')](handleEntityNotFound(_0x39e152,null))['then'](function(_0x3e5447){if(_0x3e5447){_0x2a06aa=_0x3e5447['remoteUri'];var _0x10412c=_0x2a06aa[_0x0c8a('0xab')](-0x1);if(_0x10412c==='/'){_0x2a06aa=_0x2a06aa['substring'](0x0,_0x2a06aa[_0x0c8a('0xac')](_0x10412c));}_0x429f48=util[_0x0c8a('0xad')](_0x0c8a('0xae'),_0x2a06aa);var _0x2f8117={'method':_0x0c8a('0xaf'),'uri':_0x0c8a('0xb0')+_0x3e5447[_0x0c8a('0xa8')]+_0x0c8a('0xb1'),'form':{'client_id':_0x3e5447[_0x0c8a('0xa9')],'resource':_0x2a06aa,'username':_0x3e5447[_0x0c8a('0xa5')],'password':_0x3e5447[_0x0c8a('0xa6')],'grant_type':_0x0c8a('0xa6'),'client_secret':_0x3e5447[_0x0c8a('0xaa')]},'json':!![]};return rp(_0x2f8117);}})[_0x0c8a('0x1e')](function(_0x2cd367){_0x677e24=_0x2cd367[_0x0c8a('0xb2')];var _0x187fcf={'method':_0x0c8a('0xb3'),'uri':encodeURI(_0x429f48+_0x0c8a('0xb4')+_0x56fbc0+'\x27'),'headers':{'Authorization':_0x0c8a('0xb5')+_0x677e24,'If-None-Match':null,'OData-Version':_0x0c8a('0xb6')},'json':!![]};return rp(_0x187fcf);})['then'](function(_0x427ad2){var _0x43b7a5=_0x427ad2[_0x0c8a('0xb7')][0x0];var _0x46d2b2=_0x43b7a5[_0x0c8a('0xb8')];var _0xc2a567={'method':'GET','uri':_0x429f48+_0x0c8a('0xb9')+_0x46d2b2+_0x0c8a('0xba'),'headers':{'Authorization':_0x0c8a('0xb5')+_0x677e24,'If-None-Match':null,'OData-Version':_0x0c8a('0xb6')},'json':!![]};return rp(_0xc2a567);})['then'](function(_0x447864){_0x4b1da3=_0x447864;_0x55dd83=_0x4b1da3[_0x0c8a('0xbb')];_0x55dd83=_[_0x0c8a('0xbc')](_0x55dd83,function(_0x149d98){return!_0x37b038[_0x0c8a('0xbd')](_0x149d98[_0x0c8a('0xbe')]);});var _0x383f97=[];var _0x5faa57=[];_0x55dd83[_0x0c8a('0xbf')](function(_0x2b9fc8){if(_0x2b9fc8['@odata.type']){var _0xfb6007=_0x2b9fc8[_0x0c8a('0xc0')][_0x0c8a('0xc1')](_0x2b9fc8[_0x0c8a('0xc0')]['lastIndexOf']('.')+0x1);if(_0xfb6007===_0x0c8a('0xc2')){_0x383f97['push'](getSelectList(_0x429f48,_0x33c582,_0x5faa57,_0x4b1da3[_0x0c8a('0xb8')],_0x2b9fc8[_0x0c8a('0xb8')],_0x677e24));}}});return Promise[_0x0c8a('0xc3')](_0x383f97);})[_0x0c8a('0x1e')](function(_0x87dbc8){_0x1e7eae=_0x87dbc8[0x0];var _0x40bc88=[];var _0xc365f1=[];_0x55dd83[_0x0c8a('0xbf')](function(_0x49382f){if(!_[_0x0c8a('0xc4')](_0x49382f[_0x0c8a('0xc0')])){var _0x96cde4=_0x49382f[_0x0c8a('0xc0')]['substring'](_0x49382f[_0x0c8a('0xc0')][_0x0c8a('0xac')]('.')+0x1);if(_0x96cde4==='BooleanAttributeMetadata'){_0x40bc88[_0x0c8a('0xc5')](getBooleanList(_0x429f48,_0x33c582,_0xc365f1,_0x4b1da3['MetadataId'],_0x49382f['MetadataId'],_0x677e24));}}});return Promise[_0x0c8a('0xc3')](_0x40bc88);})['then'](function(_0x2d0dce){_0x2aa9cc=_0x2d0dce[0x0];var _0x1a6c2b=[];var _0x2fbae7=[];_0x55dd83[_0x0c8a('0xbf')](function(_0x53aeda){if(_0x53aeda[_0x0c8a('0xc0')]){var _0x41ef17=_0x53aeda[_0x0c8a('0xc0')][_0x0c8a('0xc1')](_0x53aeda[_0x0c8a('0xc0')][_0x0c8a('0xac')]('.')+0x1);if(_0x41ef17===_0x0c8a('0xc6')||_0x41ef17===_0x0c8a('0xc7')||_0x41ef17===_0x0c8a('0xc8')||_0x41ef17==='IntegerAttributeMetadata'||_0x41ef17===_0x0c8a('0xc9')||_0x41ef17===_0x0c8a('0xca')||_0x41ef17===_0x0c8a('0xcb')||_0x41ef17===_0x0c8a('0xcc')||_0x41ef17==='StateAttributeMetadata'||_0x41ef17===_0x0c8a('0xcd')){_0x1a6c2b[_0x0c8a('0xc5')](getInputList(_0x429f48,_0x33c582,_0x41ef17,_0x2fbae7,_0x4b1da3[_0x0c8a('0xb8')],_0x53aeda[_0x0c8a('0xb8')],_0x677e24));}}});return Promise['all'](_0x1a6c2b);})[_0x0c8a('0x1e')](function(_0x47faf5){_0x3934d2=_0x47faf5[0x0];var _0xcf44ab=_0x1e7eae[_0x0c8a('0xa4')](_0x2aa9cc)[_0x0c8a('0xa4')](_0x3934d2);var _0x52f85d={'count':_0xcf44ab['length'],'rows':_0xcf44ab};return _0x52f85d;})[_0x0c8a('0x1e')](respondWithResult(_0x39e152,null))[_0x0c8a('0x51')](function(_0x1e1965){var _0x20b334=_0x185d80[_0x0c8a('0x3f')][_0x0c8a('0x19')]?0x1f4:_0x1e1965[_0x0c8a('0xce')]||0x1f4;logger[_0x0c8a('0x25')](_0x1e1965[_0x0c8a('0x35')]);delete _0x1e1965[_0x0c8a('0x36')];if(_0x20b334===0x191){_0x20b334=0x190;}_0x39e152[_0x0c8a('0x28')](_0x20b334)[_0x0c8a('0x37')](_0x185d80[_0x0c8a('0x3f')][_0x0c8a('0x19')]?{'message':_0x0c8a('0xcf'),'statusCode':_0x1e1965['statusCode']}:_0x1e1965);});};function getSelectList(_0x32de9a,_0x235c84,_0x67667a,_0x3e755f,_0x4e62cc,_0x226e26){var _0x55c9a6={'method':'GET','uri':_0x32de9a+'EntityDefinitions('+_0x3e755f+_0x0c8a('0xd0')+_0x4e62cc+_0x0c8a('0xd1')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x226e26,'If-None-Match':null,'OData-Version':_0x0c8a('0xb6')},'json':!![]};return rp(_0x55c9a6)[_0x0c8a('0x1e')](function(_0x2bfff6){var _0xc6d58f=[];var _0x53e38f=_0x2bfff6[_0x0c8a('0xd2')][_0x0c8a('0xd3')];_0x53e38f['forEach'](function(_0x4125a3){_0xc6d58f[_0x0c8a('0xc5')]({'name':_0x4125a3['Label'][_0x0c8a('0xd4')][_0x0c8a('0xd5')],'value':String(_0x4125a3[_0x0c8a('0xd6')])});});var _0x2b05a4={'id':_0x235c84+'_'+_0x2bfff6[_0x0c8a('0xbe')],'name':_0x2bfff6[_0x0c8a('0xd7')][_0x0c8a('0xd4')]['Label'],'custom':![],'options':_0xc6d58f};_0x67667a['push'](_0x2b05a4);return _0x67667a;});}function getBooleanList(_0x4583ed,_0x519643,_0x5c00b9,_0x658680,_0x54cf4e,_0x1ab1a3){var _0x44d60c={'method':_0x0c8a('0xb3'),'uri':_0x4583ed+_0x0c8a('0xb9')+_0x658680+')/Attributes('+_0x54cf4e+_0x0c8a('0xd8'),'headers':{'Authorization':'Bearer\x20'+_0x1ab1a3,'If-None-Match':null,'OData-Version':_0x0c8a('0xb6')},'json':!![]};return rp(_0x44d60c)[_0x0c8a('0x1e')](function(_0x1a14e8){var _0x33ff6d=[];_0x33ff6d[_0x0c8a('0xc5')]({'name':_0x1a14e8[_0x0c8a('0xd2')]['TrueOption']['Label']['UserLocalizedLabel'][_0x0c8a('0xd5')],'value':'true'},{'name':_0x1a14e8[_0x0c8a('0xd2')][_0x0c8a('0xd9')][_0x0c8a('0xd5')]['UserLocalizedLabel'][_0x0c8a('0xd5')],'value':_0x0c8a('0xda')});var _0x558b02={'id':_0x519643+'_'+_0x1a14e8[_0x0c8a('0xbe')],'name':_0x1a14e8[_0x0c8a('0xd7')][_0x0c8a('0xd4')]['Label'],'custom':![],'options':_0x33ff6d};_0x5c00b9[_0x0c8a('0xc5')](_0x558b02);return _0x5c00b9;});}function getInputList(_0x47b9bb,_0x9562de,_0x50f9c1,_0x4859ed,_0x35e07e,_0x3ea89e,_0xbf3083){var _0x525626={'method':_0x0c8a('0xb3'),'uri':_0x47b9bb+'EntityDefinitions('+_0x35e07e+_0x0c8a('0xd0')+_0x3ea89e+_0x0c8a('0xdb')+_0x50f9c1+_0x0c8a('0xdc'),'headers':{'Authorization':'Bearer\x20'+_0xbf3083,'If-None-Match':null,'OData-Version':_0x0c8a('0xb6')},'json':!![]};return rp(_0x525626)[_0x0c8a('0x1e')](function(_0x37875f){var _0x536b25={'id':_0x9562de+'_'+_0x37875f[_0x0c8a('0xbe')],'name':_0x37875f['DisplayName'][_0x0c8a('0xd4')]?_0x37875f[_0x0c8a('0xd7')][_0x0c8a('0xd4')][_0x0c8a('0xd5')]:_0x37875f[_0x0c8a('0xbe')],'custom':![],'options':[]};_0x4859ed[_0x0c8a('0xc5')](_0x536b25);return _0x4859ed;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 47ac9ad..1661647 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 _0x71c3=['define','int_dynamics365_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports'];(function(_0x8dc6c,_0x13ebb3){var _0x16a7aa=function(_0x352ecd){while(--_0x352ecd){_0x8dc6c['push'](_0x8dc6c['shift']());}};_0x16a7aa(++_0x13ebb3);}(_0x71c3,0x146));var _0x371c=function(_0x593822,_0x43d0b){_0x593822=_0x593822-0x0;var _0x58c413=_0x71c3[_0x593822];return _0x58c413;};'use strict';var _=require('lodash');var util=require(_0x371c('0x0'));var logger=require(_0x371c('0x1'))(_0x371c('0x2'));var moment=require('moment');var BPromise=require(_0x371c('0x3'));var rp=require(_0x371c('0x4'));var fs=require('fs');var path=require(_0x371c('0x5'));var rimraf=require('rimraf');var config=require(_0x371c('0x6'));var attributes=require(_0x371c('0x7'));var integrations=require(_0x371c('0x8'));module[_0x371c('0x9')]=function(_0x5c5ab8,_0x12b001){return _0x5c5ab8[_0x371c('0xa')]('Dynamics365Account',attributes,{'tableName':_0x371c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01ce=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','util'];(function(_0x791c7b,_0x49bbb6){var _0x110508=function(_0x3d156e){while(--_0x3d156e){_0x791c7b['push'](_0x791c7b['shift']());}};_0x110508(++_0x49bbb6);}(_0x01ce,0xe2));var _0xe01c=function(_0x25f5ba,_0x3b6ba8){_0x25f5ba=_0x25f5ba-0x0;var _0x151382=_0x01ce[_0x25f5ba];return _0x151382;};'use strict';var _=require(_0xe01c('0x0'));var util=require(_0xe01c('0x1'));var logger=require(_0xe01c('0x2'))(_0xe01c('0x3'));var moment=require('moment');var BPromise=require(_0xe01c('0x4'));var rp=require(_0xe01c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe01c('0x6'));var config=require(_0xe01c('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0xe01c('0x8'));module[_0xe01c('0x9')]=function(_0x5e8fc2,_0x4ca988){return _0x5e8fc2[_0xe01c('0xa')]('Dynamics365Account',attributes,{'tableName':_0xe01c('0xb'),'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 bb2df72..05085d3 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 _0xc9ab=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetDynamics365Account','stringify','ShowDynamics365Account','find','lodash','util','moment'];(function(_0x2d92cf,_0x434a92){var _0x592841=function(_0x4e5c22){while(--_0x4e5c22){_0x2d92cf['push'](_0x2d92cf['shift']());}};_0x592841(++_0x434a92);}(_0xc9ab,0x125));var _0xbc9a=function(_0x4b3b26,_0x44a22a){_0x4b3b26=_0x4b3b26-0x0;var _0x464112=_0xc9ab[_0x4b3b26];return _0x464112;};'use strict';var _=require(_0xbc9a('0x0'));var util=require(_0xbc9a('0x1'));var moment=require(_0xbc9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc9a('0x3'))['db'];var utils=require(_0xbc9a('0x4'));var logger=require(_0xbc9a('0x5'))(_0xbc9a('0x6'));var config=require(_0xbc9a('0x7'));var jayson=require(_0xbc9a('0x8'));var client=jayson[_0xbc9a('0x9')][_0xbc9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x477055,_0x3baf56,_0x26f5f4){return new BPromise(function(_0x14c87a,_0x18beac){return client[_0xbc9a('0xb')](_0x477055,_0x26f5f4)['then'](function(_0x54caf0){logger['info'](_0xbc9a('0xc'),_0x3baf56,'request\x20sent');logger[_0xbc9a('0xd')](_0xbc9a('0xe'),_0x3baf56,'request\x20sent',JSON['stringify'](_0x54caf0));if(_0x54caf0['error']){if(_0x54caf0[_0xbc9a('0xf')][_0xbc9a('0x10')]===0x1f4){logger['error'](_0xbc9a('0xc'),_0x3baf56,_0x54caf0[_0xbc9a('0xf')][_0xbc9a('0x11')]);return _0x18beac(_0x54caf0[_0xbc9a('0xf')][_0xbc9a('0x11')]);}logger[_0xbc9a('0xf')](_0xbc9a('0xc'),_0x3baf56,_0x54caf0['error'][_0xbc9a('0x11')]);return _0x14c87a(_0x54caf0[_0xbc9a('0xf')][_0xbc9a('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x3baf56,_0xbc9a('0x12'));_0x14c87a(_0x54caf0[_0xbc9a('0x13')][_0xbc9a('0x11')]);}})[_0xbc9a('0x14')](function(_0x35dacf){logger[_0xbc9a('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x3baf56,_0x35dacf);_0x18beac(_0x35dacf);});});}exports['GetDynamics365Account']=function(_0x1f11ca){var _0x3cc279=this;return new Promise(function(_0x5b44fe,_0xf036b0){return db[_0xbc9a('0x15')][_0xbc9a('0x16')]({'raw':_0x1f11ca['options']?_0x1f11ca[_0xbc9a('0x17')][_0xbc9a('0x18')]===undefined?!![]:![]:!![],'where':_0x1f11ca[_0xbc9a('0x17')]?_0x1f11ca[_0xbc9a('0x17')][_0xbc9a('0x19')]||null:null,'attributes':_0x1f11ca[_0xbc9a('0x17')]?_0x1f11ca[_0xbc9a('0x17')][_0xbc9a('0x1a')]||null:null,'limit':_0x1f11ca[_0xbc9a('0x17')]?_0x1f11ca[_0xbc9a('0x17')][_0xbc9a('0x1b')]||null:null,'include':_0x1f11ca['options']?_0x1f11ca['options'][_0xbc9a('0x1c')]?_[_0xbc9a('0x1d')](_0x1f11ca[_0xbc9a('0x17')][_0xbc9a('0x1c')],function(_0x46e932){return{'model':db[_0x46e932[_0xbc9a('0x1e')]],'as':_0x46e932['as'],'attributes':_0x46e932[_0xbc9a('0x1a')],'include':_0x46e932[_0xbc9a('0x1c')]?_[_0xbc9a('0x1d')](_0x46e932[_0xbc9a('0x1c')],function(_0x141b3f){return{'model':db[_0x141b3f[_0xbc9a('0x1e')]],'as':_0x141b3f['as'],'attributes':_0x141b3f['attributes'],'include':_0x141b3f[_0xbc9a('0x1c')]?_[_0xbc9a('0x1d')](_0x141b3f[_0xbc9a('0x1c')],function(_0x1acae8){return{'model':db[_0x1acae8[_0xbc9a('0x1e')]],'as':_0x1acae8['as'],'attributes':_0x1acae8[_0xbc9a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbc9a('0x1f')](function(_0x47fff5){logger[_0xbc9a('0x20')](_0xbc9a('0x21'),_0x1f11ca);logger[_0xbc9a('0xd')]('GetDynamics365Account',_0x1f11ca,JSON[_0xbc9a('0x22')](_0x47fff5));_0x5b44fe(_0x47fff5);})[_0xbc9a('0x14')](function(_0x3c4310){logger[_0xbc9a('0xf')](_0xbc9a('0x21'),_0x3c4310[_0xbc9a('0x11')],_0x1f11ca);_0xf036b0(_0x3cc279[_0xbc9a('0xf')](0x1f4,_0x3c4310[_0xbc9a('0x11')]));});});};exports[_0xbc9a('0x23')]=function(_0x4eaa7d){var _0x2d3231=this;return new Promise(function(_0xce0671,_0x561257){return db['Dynamics365Account'][_0xbc9a('0x24')]({'raw':_0x4eaa7d[_0xbc9a('0x17')]?_0x4eaa7d[_0xbc9a('0x17')][_0xbc9a('0x18')]===undefined?!![]:![]:!![],'where':_0x4eaa7d[_0xbc9a('0x17')]?_0x4eaa7d[_0xbc9a('0x17')][_0xbc9a('0x19')]||null:null,'attributes':_0x4eaa7d[_0xbc9a('0x17')]?_0x4eaa7d[_0xbc9a('0x17')]['attributes']||null:null,'include':_0x4eaa7d[_0xbc9a('0x17')]?_0x4eaa7d[_0xbc9a('0x17')][_0xbc9a('0x1c')]?_[_0xbc9a('0x1d')](_0x4eaa7d['options'][_0xbc9a('0x1c')],function(_0x2b03de){return{'model':db[_0x2b03de[_0xbc9a('0x1e')]],'as':_0x2b03de['as'],'attributes':_0x2b03de[_0xbc9a('0x1a')],'include':_0x2b03de[_0xbc9a('0x1c')]?_[_0xbc9a('0x1d')](_0x2b03de['include'],function(_0x2b2996){return{'model':db[_0x2b2996['model']],'as':_0x2b2996['as'],'attributes':_0x2b2996['attributes'],'include':_0x2b2996[_0xbc9a('0x1c')]?_['map'](_0x2b2996[_0xbc9a('0x1c')],function(_0x4cbc7d){return{'model':db[_0x4cbc7d[_0xbc9a('0x1e')]],'as':_0x4cbc7d['as'],'attributes':_0x4cbc7d[_0xbc9a('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x396400){logger['info'](_0xbc9a('0x23'),_0x4eaa7d);logger[_0xbc9a('0xd')](_0xbc9a('0x23'),_0x4eaa7d,JSON[_0xbc9a('0x22')](_0x396400));_0xce0671(_0x396400);})[_0xbc9a('0x14')](function(_0x53601a){logger[_0xbc9a('0xf')](_0xbc9a('0x23'),_0x53601a[_0xbc9a('0x11')],_0x4eaa7d);_0x561257(_0x2d3231[_0xbc9a('0xf')](0x1f4,_0x53601a[_0xbc9a('0x11')]));});});}; \ No newline at end of file +var _0x8375=['client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','GetDynamics365Account','Dynamics365Account','options','raw','attributes','limit','include','map','model','debug','stringify','catch','ShowDynamics365Account','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8375,0x132));var _0x5837=function(_0x380bd4,_0x522b8f){_0x380bd4=_0x380bd4-0x0;var _0x33f96f=_0x8375[_0x380bd4];return _0x33f96f;};'use strict';var _=require('lodash');var util=require(_0x5837('0x0'));var moment=require(_0x5837('0x1'));var BPromise=require(_0x5837('0x2'));var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5837('0x6'))(_0x5837('0x7'));var config=require('../../config/environment');var jayson=require(_0x5837('0x8'));var client=jayson[_0x5837('0x9')][_0x5837('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d00,_0x5e980d,_0x23454c){return new BPromise(function(_0x1f4f78,_0x89657e){return client[_0x5837('0xb')](_0x1e0d00,_0x23454c)[_0x5837('0xc')](function(_0x32e545){logger[_0x5837('0xd')](_0x5837('0xe'),_0x5e980d,_0x5837('0xf'));logger['debug'](_0x5837('0x10'),_0x5e980d,_0x5837('0xf'),JSON['stringify'](_0x32e545));if(_0x32e545[_0x5837('0x11')]){if(_0x32e545[_0x5837('0x11')]['code']===0x1f4){logger[_0x5837('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x5e980d,_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);return _0x89657e(_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);}logger['error'](_0x5837('0xe'),_0x5e980d,_0x32e545[_0x5837('0x11')][_0x5837('0x12')]);return _0x1f4f78(_0x32e545['error'][_0x5837('0x12')]);}else{logger[_0x5837('0xd')](_0x5837('0xe'),_0x5e980d,_0x5837('0xf'));_0x1f4f78(_0x32e545[_0x5837('0x13')][_0x5837('0x12')]);}})['catch'](function(_0x555ebb){logger['error'](_0x5837('0xe'),_0x5e980d,_0x555ebb);_0x89657e(_0x555ebb);});});}exports[_0x5837('0x14')]=function(_0x1a5725){var _0x423a9f=this;return new Promise(function(_0x128b4a,_0x602f19){return db[_0x5837('0x15')]['findAll']({'raw':_0x1a5725[_0x5837('0x16')]?_0x1a5725[_0x5837('0x16')][_0x5837('0x17')]===undefined?!![]:![]:!![],'where':_0x1a5725[_0x5837('0x16')]?_0x1a5725[_0x5837('0x16')]['where']||null:null,'attributes':_0x1a5725['options']?_0x1a5725[_0x5837('0x16')][_0x5837('0x18')]||null:null,'limit':_0x1a5725[_0x5837('0x16')]?_0x1a5725['options'][_0x5837('0x19')]||null:null,'include':_0x1a5725[_0x5837('0x16')]?_0x1a5725['options'][_0x5837('0x1a')]?_[_0x5837('0x1b')](_0x1a5725['options'][_0x5837('0x1a')],function(_0x2709cf){return{'model':db[_0x2709cf[_0x5837('0x1c')]],'as':_0x2709cf['as'],'attributes':_0x2709cf['attributes'],'include':_0x2709cf[_0x5837('0x1a')]?_['map'](_0x2709cf[_0x5837('0x1a')],function(_0x8e5a48){return{'model':db[_0x8e5a48[_0x5837('0x1c')]],'as':_0x8e5a48['as'],'attributes':_0x8e5a48[_0x5837('0x18')],'include':_0x8e5a48[_0x5837('0x1a')]?_[_0x5837('0x1b')](_0x8e5a48[_0x5837('0x1a')],function(_0x1d7285){return{'model':db[_0x1d7285[_0x5837('0x1c')]],'as':_0x1d7285['as'],'attributes':_0x1d7285[_0x5837('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5837('0xc')](function(_0x27848d){logger[_0x5837('0xd')](_0x5837('0x14'),_0x1a5725);logger[_0x5837('0x1d')]('GetDynamics365Account',_0x1a5725,JSON[_0x5837('0x1e')](_0x27848d));_0x128b4a(_0x27848d);})[_0x5837('0x1f')](function(_0x170cb2){logger[_0x5837('0x11')](_0x5837('0x14'),_0x170cb2[_0x5837('0x12')],_0x1a5725);_0x602f19(_0x423a9f[_0x5837('0x11')](0x1f4,_0x170cb2['message']));});});};exports[_0x5837('0x20')]=function(_0x290e14){var _0x3a3a34=this;return new Promise(function(_0x285186,_0x55b71b){return db['Dynamics365Account'][_0x5837('0x21')]({'raw':_0x290e14[_0x5837('0x16')]?_0x290e14[_0x5837('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x290e14[_0x5837('0x16')]?_0x290e14[_0x5837('0x16')][_0x5837('0x22')]||null:null,'attributes':_0x290e14[_0x5837('0x16')]?_0x290e14[_0x5837('0x16')][_0x5837('0x18')]||null:null,'include':_0x290e14['options']?_0x290e14[_0x5837('0x16')][_0x5837('0x1a')]?_['map'](_0x290e14[_0x5837('0x16')][_0x5837('0x1a')],function(_0x216f11){return{'model':db[_0x216f11['model']],'as':_0x216f11['as'],'attributes':_0x216f11['attributes'],'include':_0x216f11['include']?_['map'](_0x216f11[_0x5837('0x1a')],function(_0x57322c){return{'model':db[_0x57322c['model']],'as':_0x57322c['as'],'attributes':_0x57322c[_0x5837('0x18')],'include':_0x57322c[_0x5837('0x1a')]?_['map'](_0x57322c[_0x5837('0x1a')],function(_0x549fc4){return{'model':db[_0x549fc4[_0x5837('0x1c')]],'as':_0x549fc4['as'],'attributes':_0x549fc4[_0x5837('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4109fa){logger[_0x5837('0xd')]('ShowDynamics365Account',_0x290e14);logger[_0x5837('0x1d')]('ShowDynamics365Account',_0x290e14,JSON[_0x5837('0x1e')](_0x4109fa));_0x285186(_0x4109fa);})['catch'](function(_0x495901){logger[_0x5837('0x11')](_0x5837('0x20'),_0x495901[_0x5837('0x12')],_0x290e14);_0x55b71b(_0x3a3a34[_0x5837('0x11')](0x1f4,_0x495901[_0x5837('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 7e0dc9b..9797005 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 _0x1230=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x1230,0x135));var _0x0123=function(_0x3b408e,_0x221eba){_0x3b408e=_0x3b408e-0x0;var _0x517c43=_0x1230[_0x3b408e];return _0x517c43;};'use strict';var multer=require(_0x0123('0x0'));var util=require(_0x0123('0x1'));var path=require(_0x0123('0x2'));var timeout=require(_0x0123('0x3'));var express=require('express');var router=express[_0x0123('0x4')]();var auth=require(_0x0123('0x5'));var interaction=require(_0x0123('0x6'));var config=require(_0x0123('0x7'));var controller=require(_0x0123('0x8'));router[_0x0123('0x9')]('/',auth[_0x0123('0xa')](),controller[_0x0123('0xb')]);router[_0x0123('0x9')](_0x0123('0xc'),auth[_0x0123('0xa')](),controller[_0x0123('0xd')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x0123('0xe')]);router[_0x0123('0x9')](_0x0123('0xf'),auth[_0x0123('0xa')](),controller[_0x0123('0x10')]);router[_0x0123('0x9')](_0x0123('0x11'),auth['isAuthenticated'](),controller[_0x0123('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0123('0x13')]('/:id',auth[_0x0123('0xa')](),controller[_0x0123('0x14')]);router[_0x0123('0x15')](_0x0123('0xc'),auth['isAuthenticated'](),controller[_0x0123('0x16')]);module[_0x0123('0x17')]=router; \ No newline at end of file +var _0xa3f9=['get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','express','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller'];(function(_0x2fa9df,_0x3f9a11){var _0x39f749=function(_0xa77a3e){while(--_0xa77a3e){_0x2fa9df['push'](_0x2fa9df['shift']());}};_0x39f749(++_0x3f9a11);}(_0xa3f9,0xd7));var _0x9a3f=function(_0x1c4cd1,_0x447f9d){_0x1c4cd1=_0x1c4cd1-0x0;var _0x53e576=_0xa3f9[_0x1c4cd1];return _0x53e576;};'use strict';var multer=require(_0x9a3f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9a3f('0x1'));var router=express['Router']();var auth=require(_0x9a3f('0x2'));var interaction=require(_0x9a3f('0x3'));var config=require('../../config/environment');var controller=require(_0x9a3f('0x4'));router[_0x9a3f('0x5')]('/',auth[_0x9a3f('0x6')](),controller[_0x9a3f('0x7')]);router['get'](_0x9a3f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x9a3f('0x5')](_0x9a3f('0x9'),auth[_0x9a3f('0x6')](),controller[_0x9a3f('0xa')]);router[_0x9a3f('0x5')](_0x9a3f('0xb'),auth['isAuthenticated'](),controller[_0x9a3f('0xc')]);router[_0x9a3f('0x5')](_0x9a3f('0xd'),auth[_0x9a3f('0x6')](),controller[_0x9a3f('0xe')]);router[_0x9a3f('0xf')]('/',auth[_0x9a3f('0x6')](),controller['create']);router[_0x9a3f('0x10')](_0x9a3f('0x8'),auth[_0x9a3f('0x6')](),controller[_0x9a3f('0x11')]);router[_0x9a3f('0x12')](_0x9a3f('0x8'),auth[_0x9a3f('0x6')](),controller[_0x9a3f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 97fad3f..e9b3051 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 _0xa6b7=['STRING','ENUM','incident','sequelize','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa6b7,0x1a2));var _0x7a6b=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xa6b7[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0x7a6b('0x0'));module[_0x7a6b('0x1')]={'name':{'type':Sequelize[_0x7a6b('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x7a6b('0x3')](_0x7a6b('0x4'),'phonecall'),'defaultValue':_0x7a6b('0x4')}}; \ No newline at end of file +var _0xdde4=['sequelize','STRING','incident'];(function(_0x1782ae,_0x16ce5b){var _0x19b2af=function(_0x2c03a5){while(--_0x2c03a5){_0x1782ae['push'](_0x1782ae['shift']());}};_0x19b2af(++_0x16ce5b);}(_0xdde4,0x12c));var _0x4dde=function(_0x350a97,_0x33648e){_0x350a97=_0x350a97-0x0;var _0x39cb80=_0xdde4[_0x350a97];return _0x39cb80;};'use strict';var Sequelize=require(_0x4dde('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4dde('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':_0x4dde('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 947fc28..fab239b 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 _0x4876=['find','getFields','findOne','Dynamics365Field','length','map','getSubjects','getDescriptions','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','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','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','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Dynamics365Configuration','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','rows','show','params','include','options','create','body'];(function(_0x511ec9,_0x2d543b){var _0x5e7af2=function(_0x30bc14){while(--_0x30bc14){_0x511ec9['push'](_0x511ec9['shift']());}};_0x5e7af2(++_0x2d543b);}(_0x4876,0x67));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x6487('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6487('0x1'));var rp=require(_0x6487('0x2'));var moment=require('moment');var BPromise=require(_0x6487('0x3'));var Mustache=require(_0x6487('0x4'));var util=require(_0x6487('0x5'));var path=require(_0x6487('0x6'));var sox=require('sox');var csv=require(_0x6487('0x7'));var ejs=require(_0x6487('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6487('0x9'));var crypto=require(_0x6487('0xa'));var jsforce=require(_0x6487('0xb'));var deskjs=require(_0x6487('0xc'));var toCsv=require(_0x6487('0x7'));var querystring=require(_0x6487('0xd'));var Papa=require(_0x6487('0xe'));var Redis=require('ioredis');var authService=require(_0x6487('0xf'));var qs=require(_0x6487('0x10'));var as=require(_0x6487('0x11'));var hardwareService=require(_0x6487('0x12'));var logger=require(_0x6487('0x13'))(_0x6487('0x14'));var utils=require(_0x6487('0x15'));var config=require(_0x6487('0x16'));var db=require(_0x6487('0x17'))['db'];var jayson=require(_0x6487('0x18'));var client=jayson[_0x6487('0x19')][_0x6487('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x25eb49,_0x2d1d1e,_0x18673f){if(_0x18673f){var _0x434935=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x434935[_0x6487('0x1b')](_0x2d1d1e)){return _0x25eb49;}else{throw new db[(_0x6487('0x1c'))][(_0x6487('0x1d'))](_0x6487('0x1e'));}}else{return _0x25eb49;}}function respondWithRpcPromise(_0x4459cd,_0x59fef9,_0x14f2a2,_0x442788){return new BPromise(function(_0x390c99,_0x4cc1cc){var _0xa47638=_0x442788||client;return _0xa47638[_0x6487('0x1f')](_0x4459cd,_0x14f2a2)[_0x6487('0x20')](function(_0x542b57){logger[_0x6487('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x59fef9,_0x6487('0x22'));logger[_0x6487('0x23')](_0x6487('0x24'),_0x59fef9,_0x6487('0x22'),JSON['stringify'](_0x542b57));if(_0x542b57[_0x6487('0x25')]){if(_0x542b57['error'][_0x6487('0x26')]===0x1f4){logger[_0x6487('0x25')](_0x6487('0x27'),_0x59fef9,_0x542b57[_0x6487('0x25')][_0x6487('0x28')]);return _0x4cc1cc(_0x542b57[_0x6487('0x25')][_0x6487('0x28')]);}logger[_0x6487('0x25')](_0x6487('0x27'),_0x59fef9,_0x542b57[_0x6487('0x25')]['message']);return _0x390c99(_0x542b57[_0x6487('0x25')]['message']);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x59fef9,'request\x20sent');_0x390c99(_0x542b57[_0x6487('0x29')][_0x6487('0x28')]);}})[_0x6487('0x2a')](function(_0xba02c3){logger[_0x6487('0x25')](_0x6487('0x27'),_0x59fef9,_0xba02c3);_0x4cc1cc(_0xba02c3);});});}function respondWithStatusCode(_0x2381f1,_0x569908){_0x569908=_0x569908||0xcc;return function(_0x3abcd1){if(_0x3abcd1){return _0x2381f1[_0x6487('0x2b')](_0x569908);}return _0x2381f1[_0x6487('0x2c')](_0x569908)[_0x6487('0x2d')]();};}function respondWithResult(_0xe8c34a,_0x5a5c7f){_0x5a5c7f=_0x5a5c7f||0xc8;return function(_0x31f229){if(_0x31f229){return _0xe8c34a[_0x6487('0x2c')](_0x5a5c7f)[_0x6487('0x2e')](_0x31f229);}};}function respondWithFilteredResult(_0x465dd7,_0x509559){return function(_0x576c26){if(_0x576c26){var _0x4f82a8=_0x576c26[_0x6487('0x2f')],_0x2deab4=_0x509559['offset'],_0x19e7a3=_0x509559[_0x6487('0x30')]+_0x509559['limit'],_0x57488a;if(_0x19e7a3>=_0x4f82a8){_0x19e7a3=_0x4f82a8;_0x57488a=0xc8;}else{_0x57488a=0xce;}_0x465dd7[_0x6487('0x2c')](_0x57488a);return _0x465dd7[_0x6487('0x31')](_0x6487('0x32'),_0x2deab4+'-'+_0x19e7a3+'/'+_0x4f82a8)[_0x6487('0x2e')](_0x576c26);}return null;};}function patchUpdates(_0x20cba4){return function(_0x38fba0){try{jsonpatch[_0x6487('0x33')](_0x38fba0,_0x20cba4,!![]);}catch(_0xe3e5ea){return BPromise[_0x6487('0x34')](_0xe3e5ea);}return _0x38fba0[_0x6487('0x35')]();};}function saveUpdates(_0x1090ec,_0xb33511){return function(_0x4f28a7){if(_0x4f28a7){return _0x4f28a7[_0x6487('0x36')](_0x1090ec)[_0x6487('0x20')](function(_0x1a4441){return _0x1a4441;});}return null;};}function removeEntity(_0x130726,_0x57040a){return function(_0x51d4a6){if(_0x51d4a6){return _0x51d4a6[_0x6487('0x37')]()[_0x6487('0x20')](function(){_0x130726['status'](0xcc)[_0x6487('0x2d')]();});}};}function handleEntityNotFound(_0x59571a,_0x169d86){return function(_0x57b4e7){if(!_0x57b4e7){_0x59571a['sendStatus'](0x194);}return _0x57b4e7;};}function handleError(_0x1667ec,_0x476d18){_0x476d18=_0x476d18||0x1f4;return function(_0xa14545){logger[_0x6487('0x25')](_0xa14545[_0x6487('0x38')]);if(_0xa14545[_0x6487('0x39')]){delete _0xa14545[_0x6487('0x39')];}_0x1667ec[_0x6487('0x2c')](_0x476d18)[_0x6487('0x3a')](_0xa14545);};}exports[_0x6487('0x3b')]=function(_0x5ceebf,_0x1d80aa){var _0x33dafb={},_0x48fa0c={},_0x3a0f25={'count':0x0,'rows':[]};var _0x3daebe=_['map'](db[_0x6487('0x3c')][_0x6487('0x3d')],function(_0x23fdaa){return{'name':_0x23fdaa['fieldName'],'type':_0x23fdaa[_0x6487('0x3e')]['key']};});_0x48fa0c[_0x6487('0x3f')]=_['map'](_0x3daebe,_0x6487('0x39'));_0x48fa0c[_0x6487('0x40')]=_[_0x6487('0x41')](_0x5ceebf[_0x6487('0x40')]);_0x48fa0c[_0x6487('0x42')]=_['intersection'](_0x48fa0c[_0x6487('0x3f')],_0x48fa0c['query']);_0x33dafb['attributes']=_[_0x6487('0x43')](_0x48fa0c[_0x6487('0x3f')],qs[_0x6487('0x44')](_0x5ceebf[_0x6487('0x40')][_0x6487('0x44')]));_0x33dafb[_0x6487('0x45')]=_0x33dafb[_0x6487('0x45')]['length']?_0x33dafb[_0x6487('0x45')]:_0x48fa0c['model'];if(!_0x5ceebf[_0x6487('0x40')][_0x6487('0x46')](_0x6487('0x47'))){_0x33dafb[_0x6487('0x48')]=qs[_0x6487('0x48')](_0x5ceebf[_0x6487('0x40')][_0x6487('0x48')]);_0x33dafb[_0x6487('0x30')]=qs[_0x6487('0x30')](_0x5ceebf[_0x6487('0x40')][_0x6487('0x30')]);}_0x33dafb[_0x6487('0x49')]=qs['sort'](_0x5ceebf[_0x6487('0x40')][_0x6487('0x4a')]);_0x33dafb[_0x6487('0x4b')]=qs['filters'](_[_0x6487('0x4c')](_0x5ceebf[_0x6487('0x40')],_0x48fa0c[_0x6487('0x42')]),_0x3daebe);if(_0x5ceebf[_0x6487('0x40')][_0x6487('0x4d')]){_0x33dafb['where']=_[_0x6487('0x4e')](_0x33dafb[_0x6487('0x4b')],{'$or':_['map'](_0x3daebe,function(_0x16af17){if(_0x16af17[_0x6487('0x3e')]!=='VIRTUAL'){var _0x24d441={};_0x24d441[_0x16af17[_0x6487('0x39')]]={'$like':'%'+_0x5ceebf[_0x6487('0x40')][_0x6487('0x4d')]+'%'};return _0x24d441;}})});}_0x33dafb=_[_0x6487('0x4e')]({},_0x33dafb,_0x5ceebf['options']);var _0x15630b={'where':_0x33dafb[_0x6487('0x4b')]};return db[_0x6487('0x3c')][_0x6487('0x2f')](_0x15630b)['then'](function(_0x263f4a){_0x3a0f25[_0x6487('0x2f')]=_0x263f4a;if(_0x5ceebf[_0x6487('0x40')][_0x6487('0x4f')]){_0x33dafb['include']=[{'all':!![]}];}return db[_0x6487('0x3c')]['findAll'](_0x33dafb);})[_0x6487('0x20')](function(_0x4a4042){_0x3a0f25[_0x6487('0x50')]=_0x4a4042;return _0x3a0f25;})[_0x6487('0x20')](respondWithFilteredResult(_0x1d80aa,_0x33dafb))[_0x6487('0x2a')](handleError(_0x1d80aa,null));};exports[_0x6487('0x51')]=function(_0x5d7c76,_0x1e5711){var _0x2f6846={'raw':![],'where':{'id':_0x5d7c76[_0x6487('0x52')]['id']}},_0x1b68c9={};_0x1b68c9['model']=_['keys'](db[_0x6487('0x3c')][_0x6487('0x3d')]);_0x1b68c9['query']=_[_0x6487('0x41')](_0x5d7c76[_0x6487('0x40')]);_0x1b68c9['filters']=_['intersection'](_0x1b68c9[_0x6487('0x3f')],_0x1b68c9[_0x6487('0x40')]);_0x2f6846[_0x6487('0x45')]=_[_0x6487('0x43')](_0x1b68c9[_0x6487('0x3f')],qs[_0x6487('0x44')](_0x5d7c76['query'][_0x6487('0x44')]));_0x2f6846[_0x6487('0x45')]=_0x2f6846['attributes']['length']?_0x2f6846[_0x6487('0x45')]:_0x1b68c9[_0x6487('0x3f')];if(_0x5d7c76[_0x6487('0x40')][_0x6487('0x4f')]){_0x2f6846[_0x6487('0x53')]=[{'all':!![]}];}_0x2f6846=_[_0x6487('0x4e')]({},_0x2f6846,_0x5d7c76[_0x6487('0x54')]);return db['Dynamics365Configuration']['find'](_0x2f6846)[_0x6487('0x20')](handleEntityNotFound(_0x1e5711,null))[_0x6487('0x20')](respondWithResult(_0x1e5711,null))[_0x6487('0x2a')](handleError(_0x1e5711,null));};exports[_0x6487('0x55')]=function(_0x362c04,_0x5d5848){return db['Dynamics365Configuration']['create'](_0x362c04[_0x6487('0x56')],{})[_0x6487('0x20')](respondWithResult(_0x5d5848,0xc9))[_0x6487('0x2a')](handleError(_0x5d5848,null));};exports[_0x6487('0x36')]=function(_0x3d0908,_0x985838){if(_0x3d0908['body']['id']){delete _0x3d0908[_0x6487('0x56')]['id'];}return db[_0x6487('0x3c')][_0x6487('0x57')]({'where':{'id':_0x3d0908['params']['id']}})['then'](handleEntityNotFound(_0x985838,null))[_0x6487('0x20')](saveUpdates(_0x3d0908[_0x6487('0x56')],null))[_0x6487('0x20')](respondWithResult(_0x985838,null))[_0x6487('0x2a')](handleError(_0x985838,null));};exports[_0x6487('0x37')]=function(_0x45d7f4,_0x301213){return db['Dynamics365Configuration'][_0x6487('0x57')]({'where':{'id':_0x45d7f4[_0x6487('0x52')]['id']}})['then'](handleEntityNotFound(_0x301213,null))['then'](removeEntity(_0x301213,null))[_0x6487('0x2a')](handleError(_0x301213,null));};exports[_0x6487('0x58')]=function(_0x56cb44,_0x212260,_0x2e6e54){var _0x4ada17={};var _0x4ac0f5={};var _0x1983c6;var _0x2b2ff1;return db[_0x6487('0x3c')][_0x6487('0x59')]({'where':{'id':_0x56cb44[_0x6487('0x52')]['id']}})[_0x6487('0x20')](handleEntityNotFound(_0x212260,null))[_0x6487('0x20')](function(_0xc8942){if(_0xc8942){_0x1983c6=_0xc8942;_0x4ac0f5[_0x6487('0x3f')]=_['keys'](db[_0x6487('0x5a')][_0x6487('0x3d')]);_0x4ac0f5[_0x6487('0x40')]=_[_0x6487('0x41')](_0x56cb44[_0x6487('0x40')]);_0x4ac0f5[_0x6487('0x42')]=_[_0x6487('0x43')](_0x4ac0f5[_0x6487('0x3f')],_0x4ac0f5['query']);_0x4ada17[_0x6487('0x45')]=_[_0x6487('0x43')](_0x4ac0f5[_0x6487('0x3f')],qs['fields'](_0x56cb44['query']['fields']));_0x4ada17[_0x6487('0x45')]=_0x4ada17['attributes'][_0x6487('0x5b')]?_0x4ada17[_0x6487('0x45')]:_0x4ac0f5['model'];_0x4ada17[_0x6487('0x49')]=qs[_0x6487('0x4a')](_0x56cb44[_0x6487('0x40')][_0x6487('0x4a')]);_0x4ada17[_0x6487('0x4b')]=qs['filters'](_['pick'](_0x56cb44[_0x6487('0x40')],_0x4ac0f5['filters']));if(_0x56cb44[_0x6487('0x40')][_0x6487('0x4d')]){_0x4ada17['where']=_['merge'](_0x4ada17['where'],{'$or':_[_0x6487('0x5c')](_0x4ada17['attributes'],function(_0x2fb172){var _0x277d60={};_0x277d60[_0x2fb172]={'$like':'%'+_0x56cb44[_0x6487('0x40')][_0x6487('0x4d')]+'%'};return _0x277d60;})});}_0x4ada17=_[_0x6487('0x4e')]({},_0x4ada17,_0x56cb44[_0x6487('0x54')]);return _0x1983c6[_0x6487('0x58')](_0x4ada17);}})['then'](function(_0x2d4d5b){if(_0x2d4d5b){_0x2b2ff1=_0x2d4d5b['length'];if(!_0x56cb44[_0x6487('0x40')][_0x6487('0x46')](_0x6487('0x47'))){_0x4ada17[_0x6487('0x48')]=qs[_0x6487('0x48')](_0x56cb44[_0x6487('0x40')]['limit']);_0x4ada17[_0x6487('0x30')]=qs[_0x6487('0x30')](_0x56cb44[_0x6487('0x40')][_0x6487('0x30')]);}return _0x1983c6[_0x6487('0x58')](_0x4ada17);}})[_0x6487('0x20')](function(_0x129dd8){if(_0x129dd8){return _0x129dd8?{'count':_0x2b2ff1,'rows':_0x129dd8}:null;}})['then'](respondWithResult(_0x212260,null))[_0x6487('0x2a')](handleError(_0x212260,null));};exports['getSubjects']=function(_0x460fdd,_0x27bafd,_0x602fbc){var _0x3b04b4={};var _0x489a09={};var _0x4b9c91;var _0x3e6ac3;return db[_0x6487('0x3c')][_0x6487('0x59')]({'where':{'id':_0x460fdd[_0x6487('0x52')]['id']}})[_0x6487('0x20')](handleEntityNotFound(_0x27bafd,null))[_0x6487('0x20')](function(_0x5e6e53){if(_0x5e6e53){_0x4b9c91=_0x5e6e53;_0x489a09['model']=_[_0x6487('0x41')](db[_0x6487('0x5a')][_0x6487('0x3d')]);_0x489a09[_0x6487('0x40')]=_[_0x6487('0x41')](_0x460fdd[_0x6487('0x40')]);_0x489a09[_0x6487('0x42')]=_['intersection'](_0x489a09[_0x6487('0x3f')],_0x489a09[_0x6487('0x40')]);_0x3b04b4['attributes']=_[_0x6487('0x43')](_0x489a09['model'],qs[_0x6487('0x44')](_0x460fdd[_0x6487('0x40')]['fields']));_0x3b04b4[_0x6487('0x45')]=_0x3b04b4['attributes']['length']?_0x3b04b4[_0x6487('0x45')]:_0x489a09[_0x6487('0x3f')];_0x3b04b4[_0x6487('0x49')]=qs[_0x6487('0x4a')](_0x460fdd['query'][_0x6487('0x4a')]);_0x3b04b4['where']=qs[_0x6487('0x42')](_[_0x6487('0x4c')](_0x460fdd['query'],_0x489a09[_0x6487('0x42')]));if(_0x460fdd[_0x6487('0x40')][_0x6487('0x4d')]){_0x3b04b4[_0x6487('0x4b')]=_[_0x6487('0x4e')](_0x3b04b4[_0x6487('0x4b')],{'$or':_[_0x6487('0x5c')](_0x3b04b4[_0x6487('0x45')],function(_0x399476){var _0x1eb3d9={};_0x1eb3d9[_0x399476]={'$like':'%'+_0x460fdd[_0x6487('0x40')][_0x6487('0x4d')]+'%'};return _0x1eb3d9;})});}_0x3b04b4=_[_0x6487('0x4e')]({},_0x3b04b4,_0x460fdd[_0x6487('0x54')]);return _0x4b9c91[_0x6487('0x5d')](_0x3b04b4);}})[_0x6487('0x20')](function(_0x5a42e3){if(_0x5a42e3){_0x3e6ac3=_0x5a42e3['length'];if(!_0x460fdd[_0x6487('0x40')][_0x6487('0x46')]('nolimit')){_0x3b04b4[_0x6487('0x48')]=qs[_0x6487('0x48')](_0x460fdd[_0x6487('0x40')][_0x6487('0x48')]);_0x3b04b4['offset']=qs[_0x6487('0x30')](_0x460fdd['query'][_0x6487('0x30')]);}return _0x4b9c91[_0x6487('0x5d')](_0x3b04b4);}})['then'](function(_0x1a190c){if(_0x1a190c){return _0x1a190c?{'count':_0x3e6ac3,'rows':_0x1a190c}:null;}})[_0x6487('0x20')](respondWithResult(_0x27bafd,null))[_0x6487('0x2a')](handleError(_0x27bafd,null));};exports['getDescriptions']=function(_0x3a81de,_0x29ff22,_0x3f215c){var _0x460e9e={};var _0x123f86={};var _0x284639;var _0x40bb16;return db['Dynamics365Configuration'][_0x6487('0x59')]({'where':{'id':_0x3a81de[_0x6487('0x52')]['id']}})[_0x6487('0x20')](handleEntityNotFound(_0x29ff22,null))['then'](function(_0x25d449){if(_0x25d449){_0x284639=_0x25d449;_0x123f86['model']=_['keys'](db[_0x6487('0x5a')]['rawAttributes']);_0x123f86[_0x6487('0x40')]=_[_0x6487('0x41')](_0x3a81de[_0x6487('0x40')]);_0x123f86[_0x6487('0x42')]=_[_0x6487('0x43')](_0x123f86['model'],_0x123f86[_0x6487('0x40')]);_0x460e9e['attributes']=_[_0x6487('0x43')](_0x123f86[_0x6487('0x3f')],qs[_0x6487('0x44')](_0x3a81de[_0x6487('0x40')][_0x6487('0x44')]));_0x460e9e[_0x6487('0x45')]=_0x460e9e[_0x6487('0x45')][_0x6487('0x5b')]?_0x460e9e[_0x6487('0x45')]:_0x123f86['model'];_0x460e9e['order']=qs[_0x6487('0x4a')](_0x3a81de['query']['sort']);_0x460e9e[_0x6487('0x4b')]=qs[_0x6487('0x42')](_['pick'](_0x3a81de[_0x6487('0x40')],_0x123f86['filters']));if(_0x3a81de[_0x6487('0x40')][_0x6487('0x4d')]){_0x460e9e[_0x6487('0x4b')]=_[_0x6487('0x4e')](_0x460e9e['where'],{'$or':_[_0x6487('0x5c')](_0x460e9e[_0x6487('0x45')],function(_0xb88473){var _0x25e560={};_0x25e560[_0xb88473]={'$like':'%'+_0x3a81de[_0x6487('0x40')][_0x6487('0x4d')]+'%'};return _0x25e560;})});}_0x460e9e=_[_0x6487('0x4e')]({},_0x460e9e,_0x3a81de[_0x6487('0x54')]);return _0x284639[_0x6487('0x5e')](_0x460e9e);}})[_0x6487('0x20')](function(_0x3fba4f){if(_0x3fba4f){_0x40bb16=_0x3fba4f[_0x6487('0x5b')];if(!_0x3a81de[_0x6487('0x40')][_0x6487('0x46')](_0x6487('0x47'))){_0x460e9e[_0x6487('0x48')]=qs[_0x6487('0x48')](_0x3a81de[_0x6487('0x40')][_0x6487('0x48')]);_0x460e9e[_0x6487('0x30')]=qs['offset'](_0x3a81de[_0x6487('0x40')][_0x6487('0x30')]);}return _0x284639[_0x6487('0x5e')](_0x460e9e);}})[_0x6487('0x20')](function(_0x11afbb){if(_0x11afbb){return _0x11afbb?{'count':_0x40bb16,'rows':_0x11afbb}:null;}})['then'](respondWithResult(_0x29ff22,null))['catch'](handleError(_0x29ff22,null));}; \ No newline at end of file +var _0x9696=['save','then','destroy','end','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','length','include','find','create','body','update','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','apply','reject'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x9696,0x92));var _0x6969=function(_0x4c2406,_0x1de04d){_0x4c2406=_0x4c2406-0x0;var _0x344f78=_0x9696[_0x4c2406];return _0x344f78;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6969('0x0'));var rimraf=require(_0x6969('0x1'));var zipdir=require(_0x6969('0x2'));var jsonpatch=require(_0x6969('0x3'));var rp=require(_0x6969('0x4'));var moment=require(_0x6969('0x5'));var BPromise=require(_0x6969('0x6'));var Mustache=require('mustache');var util=require(_0x6969('0x7'));var path=require('path');var sox=require(_0x6969('0x8'));var csv=require('to-csv');var ejs=require(_0x6969('0x9'));var fs=require('fs');var _=require(_0x6969('0xa'));var squel=require('squel');var crypto=require(_0x6969('0xb'));var jsforce=require(_0x6969('0xc'));var deskjs=require(_0x6969('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6969('0xe'));var Papa=require(_0x6969('0xf'));var Redis=require('ioredis');var authService=require(_0x6969('0x10'));var qs=require(_0x6969('0x11'));var as=require(_0x6969('0x12'));var hardwareService=require(_0x6969('0x13'));var logger=require(_0x6969('0x14'))(_0x6969('0x15'));var utils=require(_0x6969('0x16'));var config=require(_0x6969('0x17'));var db=require(_0x6969('0x18'))['db'];var jayson=require(_0x6969('0x19'));var client=jayson[_0x6969('0x1a')][_0x6969('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x425200,_0x539c09,_0x71c4bf){if(_0x71c4bf){var _0x38c91a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38c91a[_0x6969('0x1c')](_0x539c09)){return _0x425200;}else{throw new db[(_0x6969('0x1d'))][(_0x6969('0x1e'))](_0x6969('0x1f'));}}else{return _0x425200;}}function respondWithRpcPromise(_0x9961a0,_0x344d83,_0x3b85e6,_0x346b6d){return new BPromise(function(_0x291ee1,_0x3f9ce7){var _0x61f6f2=_0x346b6d||client;return _0x61f6f2[_0x6969('0x20')](_0x9961a0,_0x3b85e6)['then'](function(_0x2fba94){logger[_0x6969('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x344d83,_0x6969('0x22'));logger[_0x6969('0x23')](_0x6969('0x24'),_0x344d83,_0x6969('0x22'),JSON[_0x6969('0x25')](_0x2fba94));if(_0x2fba94[_0x6969('0x26')]){if(_0x2fba94[_0x6969('0x26')][_0x6969('0x27')]===0x1f4){logger[_0x6969('0x26')](_0x6969('0x28'),_0x344d83,_0x2fba94[_0x6969('0x26')]['message']);return _0x3f9ce7(_0x2fba94['error'][_0x6969('0x29')]);}logger['error'](_0x6969('0x28'),_0x344d83,_0x2fba94[_0x6969('0x26')][_0x6969('0x29')]);return _0x291ee1(_0x2fba94['error'][_0x6969('0x29')]);}else{logger['info'](_0x6969('0x28'),_0x344d83,_0x6969('0x22'));_0x291ee1(_0x2fba94[_0x6969('0x2a')][_0x6969('0x29')]);}})[_0x6969('0x2b')](function(_0x4ca072){logger['error'](_0x6969('0x28'),_0x344d83,_0x4ca072);_0x3f9ce7(_0x4ca072);});});}function respondWithStatusCode(_0x3c41ea,_0x103192){_0x103192=_0x103192||0xcc;return function(_0x1f65d5){if(_0x1f65d5){return _0x3c41ea[_0x6969('0x2c')](_0x103192);}return _0x3c41ea[_0x6969('0x2d')](_0x103192)['end']();};}function respondWithResult(_0x59aee3,_0x52c022){_0x52c022=_0x52c022||0xc8;return function(_0x14047f){if(_0x14047f){return _0x59aee3[_0x6969('0x2d')](_0x52c022)[_0x6969('0x2e')](_0x14047f);}};}function respondWithFilteredResult(_0x395209,_0x41e395){return function(_0x2b2fdb){if(_0x2b2fdb){var _0x4ba9fd=_0x2b2fdb[_0x6969('0x2f')],_0x1ea78d=_0x41e395['offset'],_0x127afd=_0x41e395['offset']+_0x41e395['limit'],_0x3c0c9a;if(_0x127afd>=_0x4ba9fd){_0x127afd=_0x4ba9fd;_0x3c0c9a=0xc8;}else{_0x3c0c9a=0xce;}_0x395209[_0x6969('0x2d')](_0x3c0c9a);return _0x395209['set']('Content-Range',_0x1ea78d+'-'+_0x127afd+'/'+_0x4ba9fd)[_0x6969('0x2e')](_0x2b2fdb);}return null;};}function patchUpdates(_0x2d682d){return function(_0x2e2b99){try{jsonpatch[_0x6969('0x30')](_0x2e2b99,_0x2d682d,!![]);}catch(_0x10e3b1){return BPromise[_0x6969('0x31')](_0x10e3b1);}return _0x2e2b99[_0x6969('0x32')]();};}function saveUpdates(_0x4c0745,_0x72b4bc){return function(_0x24326b){if(_0x24326b){return _0x24326b['update'](_0x4c0745)[_0x6969('0x33')](function(_0x402ddf){return _0x402ddf;});}return null;};}function removeEntity(_0xd64eac,_0x48a25f){return function(_0x24c115){if(_0x24c115){return _0x24c115[_0x6969('0x34')]()[_0x6969('0x33')](function(){_0xd64eac[_0x6969('0x2d')](0xcc)[_0x6969('0x35')]();});}};}function handleEntityNotFound(_0x11cac0,_0xcb6f33){return function(_0x43aff1){if(!_0x43aff1){_0x11cac0[_0x6969('0x2c')](0x194);}return _0x43aff1;};}function handleError(_0x4519af,_0x232945){_0x232945=_0x232945||0x1f4;return function(_0x312246){logger[_0x6969('0x26')](_0x312246[_0x6969('0x36')]);if(_0x312246[_0x6969('0x37')]){delete _0x312246[_0x6969('0x37')];}_0x4519af[_0x6969('0x2d')](_0x232945)[_0x6969('0x38')](_0x312246);};}exports[_0x6969('0x39')]=function(_0x1b74a1,_0x148859){var _0x3c695d={},_0x5c224c={},_0x533fc9={'count':0x0,'rows':[]};var _0x2f06f6=_['map'](db[_0x6969('0x3a')][_0x6969('0x3b')],function(_0x141588){return{'name':_0x141588[_0x6969('0x3c')],'type':_0x141588[_0x6969('0x3d')][_0x6969('0x3e')]};});_0x5c224c['model']=_[_0x6969('0x3f')](_0x2f06f6,_0x6969('0x37'));_0x5c224c[_0x6969('0x40')]=_[_0x6969('0x41')](_0x1b74a1['query']);_0x5c224c[_0x6969('0x42')]=_['intersection'](_0x5c224c[_0x6969('0x43')],_0x5c224c[_0x6969('0x40')]);_0x3c695d[_0x6969('0x44')]=_[_0x6969('0x45')](_0x5c224c[_0x6969('0x43')],qs[_0x6969('0x46')](_0x1b74a1[_0x6969('0x40')]['fields']));_0x3c695d['attributes']=_0x3c695d[_0x6969('0x44')]['length']?_0x3c695d[_0x6969('0x44')]:_0x5c224c[_0x6969('0x43')];if(!_0x1b74a1[_0x6969('0x40')][_0x6969('0x47')](_0x6969('0x48'))){_0x3c695d[_0x6969('0x49')]=qs[_0x6969('0x49')](_0x1b74a1[_0x6969('0x40')][_0x6969('0x49')]);_0x3c695d[_0x6969('0x4a')]=qs[_0x6969('0x4a')](_0x1b74a1[_0x6969('0x40')][_0x6969('0x4a')]);}_0x3c695d[_0x6969('0x4b')]=qs[_0x6969('0x4c')](_0x1b74a1[_0x6969('0x40')]['sort']);_0x3c695d['where']=qs[_0x6969('0x42')](_[_0x6969('0x4d')](_0x1b74a1[_0x6969('0x40')],_0x5c224c[_0x6969('0x42')]),_0x2f06f6);if(_0x1b74a1[_0x6969('0x40')][_0x6969('0x4e')]){_0x3c695d[_0x6969('0x4f')]=_[_0x6969('0x50')](_0x3c695d[_0x6969('0x4f')],{'$or':_[_0x6969('0x3f')](_0x2f06f6,function(_0x3810ba){if(_0x3810ba[_0x6969('0x3d')]!==_0x6969('0x51')){var _0x5a2b7d={};_0x5a2b7d[_0x3810ba[_0x6969('0x37')]]={'$like':'%'+_0x1b74a1[_0x6969('0x40')][_0x6969('0x4e')]+'%'};return _0x5a2b7d;}})});}_0x3c695d=_['merge']({},_0x3c695d,_0x1b74a1[_0x6969('0x52')]);var _0x26bebc={'where':_0x3c695d['where']};return db['Dynamics365Configuration']['count'](_0x26bebc)['then'](function(_0x3db005){_0x533fc9[_0x6969('0x2f')]=_0x3db005;if(_0x1b74a1[_0x6969('0x40')][_0x6969('0x53')]){_0x3c695d['include']=[{'all':!![]}];}return db[_0x6969('0x3a')]['findAll'](_0x3c695d);})[_0x6969('0x33')](function(_0x50c03e){_0x533fc9[_0x6969('0x54')]=_0x50c03e;return _0x533fc9;})[_0x6969('0x33')](respondWithFilteredResult(_0x148859,_0x3c695d))[_0x6969('0x2b')](handleError(_0x148859,null));};exports[_0x6969('0x55')]=function(_0x378de8,_0x536f51){var _0x58a8fc={'raw':![],'where':{'id':_0x378de8[_0x6969('0x56')]['id']}},_0x556ede={};_0x556ede[_0x6969('0x43')]=_[_0x6969('0x41')](db[_0x6969('0x3a')][_0x6969('0x3b')]);_0x556ede['query']=_[_0x6969('0x41')](_0x378de8[_0x6969('0x40')]);_0x556ede[_0x6969('0x42')]=_[_0x6969('0x45')](_0x556ede[_0x6969('0x43')],_0x556ede[_0x6969('0x40')]);_0x58a8fc[_0x6969('0x44')]=_['intersection'](_0x556ede['model'],qs[_0x6969('0x46')](_0x378de8[_0x6969('0x40')]['fields']));_0x58a8fc[_0x6969('0x44')]=_0x58a8fc[_0x6969('0x44')][_0x6969('0x57')]?_0x58a8fc['attributes']:_0x556ede[_0x6969('0x43')];if(_0x378de8[_0x6969('0x40')][_0x6969('0x53')]){_0x58a8fc[_0x6969('0x58')]=[{'all':!![]}];}_0x58a8fc=_[_0x6969('0x50')]({},_0x58a8fc,_0x378de8[_0x6969('0x52')]);return db[_0x6969('0x3a')][_0x6969('0x59')](_0x58a8fc)[_0x6969('0x33')](handleEntityNotFound(_0x536f51,null))['then'](respondWithResult(_0x536f51,null))[_0x6969('0x2b')](handleError(_0x536f51,null));};exports[_0x6969('0x5a')]=function(_0x524dfe,_0x90a8a2){return db[_0x6969('0x3a')][_0x6969('0x5a')](_0x524dfe[_0x6969('0x5b')],{})['then'](respondWithResult(_0x90a8a2,0xc9))['catch'](handleError(_0x90a8a2,null));};exports[_0x6969('0x5c')]=function(_0x50101e,_0x391654){if(_0x50101e[_0x6969('0x5b')]['id']){delete _0x50101e[_0x6969('0x5b')]['id'];}return db[_0x6969('0x3a')][_0x6969('0x59')]({'where':{'id':_0x50101e[_0x6969('0x56')]['id']}})['then'](handleEntityNotFound(_0x391654,null))[_0x6969('0x33')](saveUpdates(_0x50101e[_0x6969('0x5b')],null))[_0x6969('0x33')](respondWithResult(_0x391654,null))['catch'](handleError(_0x391654,null));};exports[_0x6969('0x34')]=function(_0x14c36b,_0x534f6f){return db[_0x6969('0x3a')]['find']({'where':{'id':_0x14c36b[_0x6969('0x56')]['id']}})[_0x6969('0x33')](handleEntityNotFound(_0x534f6f,null))[_0x6969('0x33')](removeEntity(_0x534f6f,null))[_0x6969('0x2b')](handleError(_0x534f6f,null));};exports[_0x6969('0x5d')]=function(_0x225b25,_0x38bb4b,_0x1ba9de){var _0x3e1f80={};var _0x3360fc={};var _0x2236b4;var _0x3331c6;return db[_0x6969('0x3a')][_0x6969('0x5e')]({'where':{'id':_0x225b25['params']['id']}})[_0x6969('0x33')](handleEntityNotFound(_0x38bb4b,null))[_0x6969('0x33')](function(_0x3f801d){if(_0x3f801d){_0x2236b4=_0x3f801d;_0x3360fc['model']=_[_0x6969('0x41')](db[_0x6969('0x5f')][_0x6969('0x3b')]);_0x3360fc[_0x6969('0x40')]=_['keys'](_0x225b25[_0x6969('0x40')]);_0x3360fc[_0x6969('0x42')]=_[_0x6969('0x45')](_0x3360fc[_0x6969('0x43')],_0x3360fc[_0x6969('0x40')]);_0x3e1f80[_0x6969('0x44')]=_[_0x6969('0x45')](_0x3360fc[_0x6969('0x43')],qs['fields'](_0x225b25[_0x6969('0x40')][_0x6969('0x46')]));_0x3e1f80[_0x6969('0x44')]=_0x3e1f80[_0x6969('0x44')][_0x6969('0x57')]?_0x3e1f80[_0x6969('0x44')]:_0x3360fc[_0x6969('0x43')];_0x3e1f80[_0x6969('0x4b')]=qs[_0x6969('0x4c')](_0x225b25[_0x6969('0x40')][_0x6969('0x4c')]);_0x3e1f80[_0x6969('0x4f')]=qs['filters'](_[_0x6969('0x4d')](_0x225b25['query'],_0x3360fc[_0x6969('0x42')]));if(_0x225b25['query'][_0x6969('0x4e')]){_0x3e1f80[_0x6969('0x4f')]=_[_0x6969('0x50')](_0x3e1f80[_0x6969('0x4f')],{'$or':_[_0x6969('0x3f')](_0x3e1f80['attributes'],function(_0xbb3fc3){var _0x34df03={};_0x34df03[_0xbb3fc3]={'$like':'%'+_0x225b25[_0x6969('0x40')]['filter']+'%'};return _0x34df03;})});}_0x3e1f80=_[_0x6969('0x50')]({},_0x3e1f80,_0x225b25[_0x6969('0x52')]);return _0x2236b4['getFields'](_0x3e1f80);}})[_0x6969('0x33')](function(_0x2bacdd){if(_0x2bacdd){_0x3331c6=_0x2bacdd[_0x6969('0x57')];if(!_0x225b25[_0x6969('0x40')]['hasOwnProperty'](_0x6969('0x48'))){_0x3e1f80['limit']=qs['limit'](_0x225b25[_0x6969('0x40')][_0x6969('0x49')]);_0x3e1f80[_0x6969('0x4a')]=qs[_0x6969('0x4a')](_0x225b25[_0x6969('0x40')][_0x6969('0x4a')]);}return _0x2236b4[_0x6969('0x5d')](_0x3e1f80);}})['then'](function(_0x2e6453){if(_0x2e6453){return _0x2e6453?{'count':_0x3331c6,'rows':_0x2e6453}:null;}})[_0x6969('0x33')](respondWithResult(_0x38bb4b,null))[_0x6969('0x2b')](handleError(_0x38bb4b,null));};exports[_0x6969('0x60')]=function(_0x16886e,_0x493333,_0x334a97){var _0x2ec958={};var _0x47d8fe={};var _0x12a39c;var _0x56e6c8;return db['Dynamics365Configuration'][_0x6969('0x5e')]({'where':{'id':_0x16886e[_0x6969('0x56')]['id']}})[_0x6969('0x33')](handleEntityNotFound(_0x493333,null))['then'](function(_0x15e336){if(_0x15e336){_0x12a39c=_0x15e336;_0x47d8fe['model']=_[_0x6969('0x41')](db[_0x6969('0x5f')][_0x6969('0x3b')]);_0x47d8fe[_0x6969('0x40')]=_[_0x6969('0x41')](_0x16886e[_0x6969('0x40')]);_0x47d8fe[_0x6969('0x42')]=_['intersection'](_0x47d8fe['model'],_0x47d8fe[_0x6969('0x40')]);_0x2ec958[_0x6969('0x44')]=_[_0x6969('0x45')](_0x47d8fe[_0x6969('0x43')],qs['fields'](_0x16886e['query'][_0x6969('0x46')]));_0x2ec958['attributes']=_0x2ec958[_0x6969('0x44')][_0x6969('0x57')]?_0x2ec958[_0x6969('0x44')]:_0x47d8fe[_0x6969('0x43')];_0x2ec958[_0x6969('0x4b')]=qs['sort'](_0x16886e[_0x6969('0x40')][_0x6969('0x4c')]);_0x2ec958['where']=qs['filters'](_[_0x6969('0x4d')](_0x16886e[_0x6969('0x40')],_0x47d8fe['filters']));if(_0x16886e[_0x6969('0x40')]['filter']){_0x2ec958[_0x6969('0x4f')]=_[_0x6969('0x50')](_0x2ec958[_0x6969('0x4f')],{'$or':_[_0x6969('0x3f')](_0x2ec958[_0x6969('0x44')],function(_0x636e90){var _0x3cacee={};_0x3cacee[_0x636e90]={'$like':'%'+_0x16886e['query']['filter']+'%'};return _0x3cacee;})});}_0x2ec958=_[_0x6969('0x50')]({},_0x2ec958,_0x16886e[_0x6969('0x52')]);return _0x12a39c['getSubjects'](_0x2ec958);}})[_0x6969('0x33')](function(_0x13f46d){if(_0x13f46d){_0x56e6c8=_0x13f46d['length'];if(!_0x16886e[_0x6969('0x40')][_0x6969('0x47')](_0x6969('0x48'))){_0x2ec958['limit']=qs[_0x6969('0x49')](_0x16886e['query']['limit']);_0x2ec958[_0x6969('0x4a')]=qs['offset'](_0x16886e['query'][_0x6969('0x4a')]);}return _0x12a39c[_0x6969('0x60')](_0x2ec958);}})[_0x6969('0x33')](function(_0x3595ce){if(_0x3595ce){return _0x3595ce?{'count':_0x56e6c8,'rows':_0x3595ce}:null;}})[_0x6969('0x33')](respondWithResult(_0x493333,null))[_0x6969('0x2b')](handleError(_0x493333,null));};exports['getDescriptions']=function(_0x497bbe,_0x4d1683,_0x1b6480){var _0x4327fc={};var _0x23cd3d={};var _0xda9d12;var _0x58b55f;return db[_0x6969('0x3a')][_0x6969('0x5e')]({'where':{'id':_0x497bbe[_0x6969('0x56')]['id']}})[_0x6969('0x33')](handleEntityNotFound(_0x4d1683,null))[_0x6969('0x33')](function(_0x25cde6){if(_0x25cde6){_0xda9d12=_0x25cde6;_0x23cd3d[_0x6969('0x43')]=_[_0x6969('0x41')](db[_0x6969('0x5f')][_0x6969('0x3b')]);_0x23cd3d[_0x6969('0x40')]=_['keys'](_0x497bbe[_0x6969('0x40')]);_0x23cd3d[_0x6969('0x42')]=_['intersection'](_0x23cd3d[_0x6969('0x43')],_0x23cd3d[_0x6969('0x40')]);_0x4327fc[_0x6969('0x44')]=_['intersection'](_0x23cd3d['model'],qs['fields'](_0x497bbe[_0x6969('0x40')]['fields']));_0x4327fc[_0x6969('0x44')]=_0x4327fc['attributes'][_0x6969('0x57')]?_0x4327fc[_0x6969('0x44')]:_0x23cd3d[_0x6969('0x43')];_0x4327fc['order']=qs[_0x6969('0x4c')](_0x497bbe[_0x6969('0x40')][_0x6969('0x4c')]);_0x4327fc[_0x6969('0x4f')]=qs[_0x6969('0x42')](_[_0x6969('0x4d')](_0x497bbe[_0x6969('0x40')],_0x23cd3d[_0x6969('0x42')]));if(_0x497bbe[_0x6969('0x40')][_0x6969('0x4e')]){_0x4327fc['where']=_[_0x6969('0x50')](_0x4327fc[_0x6969('0x4f')],{'$or':_['map'](_0x4327fc[_0x6969('0x44')],function(_0x11f0f3){var _0x2ef36f={};_0x2ef36f[_0x11f0f3]={'$like':'%'+_0x497bbe[_0x6969('0x40')][_0x6969('0x4e')]+'%'};return _0x2ef36f;})});}_0x4327fc=_[_0x6969('0x50')]({},_0x4327fc,_0x497bbe[_0x6969('0x52')]);return _0xda9d12[_0x6969('0x61')](_0x4327fc);}})[_0x6969('0x33')](function(_0x3ab7df){if(_0x3ab7df){_0x58b55f=_0x3ab7df[_0x6969('0x57')];if(!_0x497bbe[_0x6969('0x40')]['hasOwnProperty']('nolimit')){_0x4327fc[_0x6969('0x49')]=qs['limit'](_0x497bbe[_0x6969('0x40')][_0x6969('0x49')]);_0x4327fc[_0x6969('0x4a')]=qs[_0x6969('0x4a')](_0x497bbe['query'][_0x6969('0x4a')]);}return _0xda9d12[_0x6969('0x61')](_0x4327fc);}})[_0x6969('0x33')](function(_0x1a133f){if(_0x1a133f){return _0x1a133f?{'count':_0x58b55f,'rows':_0x1a133f}:null;}})['then'](respondWithResult(_0x4d1683,null))['catch'](handleError(_0x4d1683,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index e67defd..4749897 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 _0x22b0=['./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b882b,_0x4fbea6){var _0x591869=function(_0x2460fd){while(--_0x2460fd){_0x2b882b['push'](_0x2b882b['shift']());}};_0x591869(++_0x4fbea6);}(_0x22b0,0xe0));var _0x022b=function(_0x33b4e7,_0x151401){_0x33b4e7=_0x33b4e7-0x0;var _0x29e187=_0x22b0[_0x33b4e7];return _0x29e187;};'use strict';var _=require(_0x022b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x022b('0x1'));var moment=require(_0x022b('0x2'));var BPromise=require(_0x022b('0x3'));var rp=require(_0x022b('0x4'));var fs=require('fs');var path=require(_0x022b('0x5'));var rimraf=require(_0x022b('0x6'));var config=require('../../config/environment');var attributes=require(_0x022b('0x7'));module[_0x022b('0x8')]=function(_0x2c02c7,_0x42290c){return _0x2c02c7['define'](_0x022b('0x9'),attributes,{'tableName':_0x022b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2bd=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','lodash'];(function(_0x3bea64,_0x3f73b5){var _0x3ab4c2=function(_0x48052d){while(--_0x48052d){_0x3bea64['push'](_0x3bea64['shift']());}};_0x3ab4c2(++_0x3f73b5);}(_0xc2bd,0x179));var _0xdc2b=function(_0x118769,_0x681f23){_0x118769=_0x118769-0x0;var _0x28ef87=_0xc2bd[_0x118769];return _0x28ef87;};'use strict';var _=require(_0xdc2b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdc2b('0x1'));var moment=require('moment');var BPromise=require(_0xdc2b('0x2'));var rp=require(_0xdc2b('0x3'));var fs=require('fs');var path=require(_0xdc2b('0x4'));var rimraf=require(_0xdc2b('0x5'));var config=require(_0xdc2b('0x6'));var attributes=require(_0xdc2b('0x7'));module[_0xdc2b('0x8')]=function(_0x18de01,_0x1aaa3f){return _0x18de01['define']('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index c9c35a5..9ae132e 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 _0xd8b1=['stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x279702,_0x12e9b5){var _0x34f62e=function(_0x3f65e8){while(--_0x3f65e8){_0x279702['push'](_0x279702['shift']());}};_0x34f62e(++_0x12e9b5);}(_0xd8b1,0x195));var _0x1d8b=function(_0x4893c0,_0x30df8d){_0x4893c0=_0x4893c0-0x0;var _0x5f2934=_0xd8b1[_0x4893c0];return _0x5f2934;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var moment=require('moment');var BPromise=require(_0x1d8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d8b('0x3'))['db'];var utils=require(_0x1d8b('0x4'));var logger=require(_0x1d8b('0x5'))('rpc');var config=require(_0x1d8b('0x6'));var jayson=require(_0x1d8b('0x7'));var client=jayson['client'][_0x1d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x510be9,_0x15f150,_0x5f2758){return new BPromise(function(_0x3f2887,_0x3d01c3){return client[_0x1d8b('0x9')](_0x510be9,_0x5f2758)['then'](function(_0xa32e78){logger[_0x1d8b('0xa')](_0x1d8b('0xb'),_0x15f150,'request\x20sent');logger[_0x1d8b('0xc')](_0x1d8b('0xd'),_0x15f150,_0x1d8b('0xe'),JSON[_0x1d8b('0xf')](_0xa32e78));if(_0xa32e78[_0x1d8b('0x10')]){if(_0xa32e78[_0x1d8b('0x10')][_0x1d8b('0x11')]===0x1f4){logger['error'](_0x1d8b('0xb'),_0x15f150,_0xa32e78[_0x1d8b('0x10')][_0x1d8b('0x12')]);return _0x3d01c3(_0xa32e78[_0x1d8b('0x10')][_0x1d8b('0x12')]);}logger[_0x1d8b('0x10')](_0x1d8b('0xb'),_0x15f150,_0xa32e78['error']['message']);return _0x3f2887(_0xa32e78[_0x1d8b('0x10')][_0x1d8b('0x12')]);}else{logger[_0x1d8b('0xa')](_0x1d8b('0xb'),_0x15f150,'request\x20sent');_0x3f2887(_0xa32e78[_0x1d8b('0x13')][_0x1d8b('0x12')]);}})[_0x1d8b('0x14')](function(_0x3dad87){logger['error'](_0x1d8b('0xb'),_0x15f150,_0x3dad87);_0x3d01c3(_0x3dad87);});});} \ No newline at end of file +var _0xbb5b=['error','code','message','info','request\x20sent','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb5b,0x1d4));var _0xbbb5=function(_0x3f7598,_0x212e37){_0x3f7598=_0x3f7598-0x0;var _0x51fb16=_0xbb5b[_0x3f7598];return _0x51fb16;};'use strict';var _=require(_0xbbb5('0x0'));var util=require(_0xbbb5('0x1'));var moment=require(_0xbbb5('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbb5('0x3'));var fs=require('fs');var Redis=require(_0xbbb5('0x4'));var db=require(_0xbbb5('0x5'))['db'];var utils=require(_0xbbb5('0x6'));var logger=require(_0xbbb5('0x7'))(_0xbbb5('0x8'));var config=require(_0xbbb5('0x9'));var jayson=require(_0xbbb5('0xa'));var client=jayson[_0xbbb5('0xb')][_0xbbb5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58ee62,_0x3a84e4,_0x2b1a7b){return new BPromise(function(_0x7fb3ea,_0x6140d2){return client[_0xbbb5('0xd')](_0x58ee62,_0x2b1a7b)['then'](function(_0x3e295f){logger['info'](_0xbbb5('0xe'),_0x3a84e4,'request\x20sent');logger['debug'](_0xbbb5('0xf'),_0x3a84e4,'request\x20sent',JSON['stringify'](_0x3e295f));if(_0x3e295f[_0xbbb5('0x10')]){if(_0x3e295f[_0xbbb5('0x10')][_0xbbb5('0x11')]===0x1f4){logger[_0xbbb5('0x10')](_0xbbb5('0xe'),_0x3a84e4,_0x3e295f[_0xbbb5('0x10')]['message']);return _0x6140d2(_0x3e295f[_0xbbb5('0x10')]['message']);}logger[_0xbbb5('0x10')](_0xbbb5('0xe'),_0x3a84e4,_0x3e295f[_0xbbb5('0x10')][_0xbbb5('0x12')]);return _0x7fb3ea(_0x3e295f['error'][_0xbbb5('0x12')]);}else{logger[_0xbbb5('0x13')](_0xbbb5('0xe'),_0x3a84e4,_0xbbb5('0x14'));_0x7fb3ea(_0x3e295f['result'][_0xbbb5('0x12')]);}})[_0xbbb5('0x15')](function(_0x1410a4){logger[_0xbbb5('0x10')](_0xbbb5('0xe'),_0x3a84e4,_0x1410a4);_0x6140d2(_0x1410a4);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index ce8417f..eb0f444 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 _0xae79=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1750f4,_0x2ae878){var _0x2611f3=function(_0x1c94c8){while(--_0x1c94c8){_0x1750f4['push'](_0x1750f4['shift']());}};_0x2611f3(++_0x2ae878);}(_0xae79,0x1d3));var _0x9ae7=function(_0x3a675b,_0x29e475){_0x3a675b=_0x3a675b-0x0;var _0x48e9fe=_0xae79[_0x3a675b];return _0x48e9fe;};'use strict';var multer=require(_0x9ae7('0x0'));var util=require(_0x9ae7('0x1'));var path=require(_0x9ae7('0x2'));var timeout=require(_0x9ae7('0x3'));var express=require(_0x9ae7('0x4'));var router=express[_0x9ae7('0x5')]();var auth=require(_0x9ae7('0x6'));var interaction=require(_0x9ae7('0x7'));var config=require(_0x9ae7('0x8'));var controller=require(_0x9ae7('0x9'));router[_0x9ae7('0xa')]('/',auth[_0x9ae7('0xb')](),controller[_0x9ae7('0xc')]);router[_0x9ae7('0xa')](_0x9ae7('0xd'),auth['isAuthenticated'](),controller[_0x9ae7('0xe')]);router[_0x9ae7('0xf')]('/',auth[_0x9ae7('0xb')](),controller[_0x9ae7('0x10')]);router[_0x9ae7('0x11')](_0x9ae7('0xd'),auth['isAuthenticated'](),controller[_0x9ae7('0x12')]);router['delete'](_0x9ae7('0xd'),auth[_0x9ae7('0xb')](),controller[_0x9ae7('0x13')]);module[_0x9ae7('0x14')]=router; \ No newline at end of file +var _0xa699=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x3f0897,_0x44d968){var _0x55831f=function(_0x39825a){while(--_0x39825a){_0x3f0897['push'](_0x3f0897['shift']());}};_0x55831f(++_0x44d968);}(_0xa699,0x6b));var _0x9a69=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0xa699[_0x5a7d41];return _0x98d8fa;};'use strict';var multer=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var path=require(_0x9a69('0x2'));var timeout=require(_0x9a69('0x3'));var express=require(_0x9a69('0x4'));var router=express[_0x9a69('0x5')]();var auth=require(_0x9a69('0x6'));var interaction=require(_0x9a69('0x7'));var config=require(_0x9a69('0x8'));var controller=require(_0x9a69('0x9'));router[_0x9a69('0xa')]('/',auth[_0x9a69('0xb')](),controller[_0x9a69('0xc')]);router['get'](_0x9a69('0xd'),auth[_0x9a69('0xb')](),controller[_0x9a69('0xe')]);router[_0x9a69('0xf')]('/',auth['isAuthenticated'](),controller[_0x9a69('0x10')]);router[_0x9a69('0x11')](_0x9a69('0xd'),auth[_0x9a69('0xb')](),controller[_0x9a69('0x12')]);router['delete']('/:id',auth[_0x9a69('0xb')](),controller['destroy']);module[_0x9a69('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index cef33ec..4af6bee 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 _0x843b=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x568dc2,_0x4657c6){var _0x2a879d=function(_0x40832a){while(--_0x40832a){_0x568dc2['push'](_0x568dc2['shift']());}};_0x2a879d(++_0x4657c6);}(_0x843b,0xc5));var _0xb843=function(_0x568e21,_0x524fea){_0x568e21=_0x568e21-0x0;var _0x1a8162=_0x843b[_0x568e21];return _0x1a8162;};'use strict';var Sequelize=require(_0xb843('0x0'));module[_0xb843('0x1')]={'type':{'type':Sequelize[_0xb843('0x2')]('string',_0xb843('0x3'),_0xb843('0x4'),_0xb843('0x5')),'defaultValue':_0xb843('0x6')},'content':{'type':Sequelize[_0xb843('0x7')]},'key':{'type':Sequelize[_0xb843('0x7')]},'keyType':{'type':Sequelize[_0xb843('0x2')](_0xb843('0x6'),_0xb843('0x3'),_0xb843('0x4'))},'keyContent':{'type':Sequelize[_0xb843('0x7')]},'idField':{'type':Sequelize[_0xb843('0x7')]},'nameField':{'type':Sequelize[_0xb843('0x7')]},'customField':{'type':Sequelize[_0xb843('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb843('0x7')]}}; \ No newline at end of file +var _0x36cf=['STRING','BOOLEAN','sequelize','exports','variable','keyValue'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x36cf,0xbc));var _0xf36c=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x36cf[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0xf36c('0x0'));module[_0xf36c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf36c('0x2'),'customVariable',_0xf36c('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf36c('0x4')]},'key':{'type':Sequelize[_0xf36c('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf36c('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf36c('0x4')]},'idField':{'type':Sequelize[_0xf36c('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf36c('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf36c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 889111f..8c58ab3 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 _0xe5f7=['catch','params','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','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','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows'];(function(_0xe86c6d,_0x19a07f){var _0x26fbff=function(_0x3f254b){while(--_0x3f254b){_0xe86c6d['push'](_0xe86c6d['shift']());}};_0x26fbff(++_0x19a07f);}(_0xe5f7,0x178));var _0x7e5f=function(_0x1c35bb,_0x38051e){_0x1c35bb=_0x1c35bb-0x0;var _0x5b9842=_0xe5f7[_0x1c35bb];return _0x5b9842;};'use strict';var pdf=require(_0x7e5f('0x0'));var emlformat=require(_0x7e5f('0x1'));var rimraf=require(_0x7e5f('0x2'));var zipdir=require(_0x7e5f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e5f('0x4'));var BPromise=require(_0x7e5f('0x5'));var Mustache=require(_0x7e5f('0x6'));var util=require('util');var path=require(_0x7e5f('0x7'));var sox=require(_0x7e5f('0x8'));var csv=require('to-csv');var ejs=require(_0x7e5f('0x9'));var fs=require('fs');var _=require(_0x7e5f('0xa'));var squel=require(_0x7e5f('0xb'));var crypto=require(_0x7e5f('0xc'));var jsforce=require(_0x7e5f('0xd'));var deskjs=require(_0x7e5f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7e5f('0xf'));var Redis=require(_0x7e5f('0x10'));var authService=require(_0x7e5f('0x11'));var qs=require(_0x7e5f('0x12'));var as=require(_0x7e5f('0x13'));var hardwareService=require(_0x7e5f('0x14'));var logger=require(_0x7e5f('0x15'))(_0x7e5f('0x16'));var utils=require(_0x7e5f('0x17'));var config=require(_0x7e5f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc3c8,_0x505fbb){_0x505fbb=_0x505fbb||0xcc;return function(_0x29d0e0){if(_0x29d0e0){return _0x3dc3c8[_0x7e5f('0x19')](_0x505fbb);}return _0x3dc3c8[_0x7e5f('0x1a')](_0x505fbb)[_0x7e5f('0x1b')]();};}function respondWithResult(_0x23e241,_0x282866){_0x282866=_0x282866||0xc8;return function(_0x1eddfd){if(_0x1eddfd){return _0x23e241[_0x7e5f('0x1a')](_0x282866)[_0x7e5f('0x1c')](_0x1eddfd);}};}function respondWithFilteredResult(_0x199712,_0x5ba25b){return function(_0x40c6ee){if(_0x40c6ee){var _0x39b644=_0x40c6ee['count'],_0x25448c=_0x5ba25b['offset'],_0x62cdf5=_0x5ba25b[_0x7e5f('0x1d')]+_0x5ba25b[_0x7e5f('0x1e')],_0x5a0c96;if(_0x62cdf5>=_0x39b644){_0x62cdf5=_0x39b644;_0x5a0c96=0xc8;}else{_0x5a0c96=0xce;}_0x199712['status'](_0x5a0c96);return _0x199712[_0x7e5f('0x1f')](_0x7e5f('0x20'),_0x25448c+'-'+_0x62cdf5+'/'+_0x39b644)[_0x7e5f('0x1c')](_0x40c6ee);}return null;};}function patchUpdates(_0xd97c29){return function(_0x16754e){try{jsonpatch[_0x7e5f('0x21')](_0x16754e,_0xd97c29,!![]);}catch(_0x2e2385){return BPromise['reject'](_0x2e2385);}return _0x16754e[_0x7e5f('0x22')]();};}function saveUpdates(_0x5a2624,_0x1d77fe){return function(_0x26a574){if(_0x26a574){return _0x26a574['update'](_0x5a2624)[_0x7e5f('0x23')](function(_0x4c81d5){return _0x4c81d5;});}return null;};}function removeEntity(_0x4997a7,_0x273c9b){return function(_0x5b4aaa){if(_0x5b4aaa){return _0x5b4aaa[_0x7e5f('0x24')]()['then'](function(){_0x4997a7[_0x7e5f('0x1a')](0xcc)[_0x7e5f('0x1b')]();});}};}function handleEntityNotFound(_0xd997bf,_0x50cfc6){return function(_0x5137a6){if(!_0x5137a6){_0xd997bf['sendStatus'](0x194);}return _0x5137a6;};}function handleError(_0x33b4f6,_0x3e7191){_0x3e7191=_0x3e7191||0x1f4;return function(_0x372eb9){logger[_0x7e5f('0x25')](_0x372eb9[_0x7e5f('0x26')]);if(_0x372eb9[_0x7e5f('0x27')]){delete _0x372eb9[_0x7e5f('0x27')];}_0x33b4f6[_0x7e5f('0x1a')](_0x3e7191)['send'](_0x372eb9);};}exports['index']=function(_0x7b83a3,_0x455071){var _0x3fe09d={},_0x26d09d={},_0x62f838={'count':0x0,'rows':[]};var _0x16a06e=_[_0x7e5f('0x28')](db[_0x7e5f('0x29')][_0x7e5f('0x2a')],function(_0x3b73c6){return{'name':_0x3b73c6[_0x7e5f('0x2b')],'type':_0x3b73c6[_0x7e5f('0x2c')][_0x7e5f('0x2d')]};});_0x26d09d[_0x7e5f('0x2e')]=_[_0x7e5f('0x28')](_0x16a06e,_0x7e5f('0x27'));_0x26d09d['query']=_[_0x7e5f('0x2f')](_0x7b83a3[_0x7e5f('0x30')]);_0x26d09d[_0x7e5f('0x31')]=_[_0x7e5f('0x32')](_0x26d09d[_0x7e5f('0x2e')],_0x26d09d[_0x7e5f('0x30')]);_0x3fe09d['attributes']=_['intersection'](_0x26d09d[_0x7e5f('0x2e')],qs[_0x7e5f('0x33')](_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x33')]));_0x3fe09d[_0x7e5f('0x34')]=_0x3fe09d[_0x7e5f('0x34')][_0x7e5f('0x35')]?_0x3fe09d[_0x7e5f('0x34')]:_0x26d09d['model'];if(!_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x36')](_0x7e5f('0x37'))){_0x3fe09d[_0x7e5f('0x1e')]=qs[_0x7e5f('0x1e')](_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x1e')]);_0x3fe09d[_0x7e5f('0x1d')]=qs[_0x7e5f('0x1d')](_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x1d')]);}_0x3fe09d[_0x7e5f('0x38')]=qs['sort'](_0x7b83a3[_0x7e5f('0x30')]['sort']);_0x3fe09d[_0x7e5f('0x39')]=qs[_0x7e5f('0x31')](_[_0x7e5f('0x3a')](_0x7b83a3[_0x7e5f('0x30')],_0x26d09d[_0x7e5f('0x31')]),_0x16a06e);if(_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x3b')]){_0x3fe09d[_0x7e5f('0x39')]=_[_0x7e5f('0x3c')](_0x3fe09d[_0x7e5f('0x39')],{'$or':_[_0x7e5f('0x28')](_0x16a06e,function(_0x2430ad){if(_0x2430ad['type']!==_0x7e5f('0x3d')){var _0x423735={};_0x423735[_0x2430ad[_0x7e5f('0x27')]]={'$like':'%'+_0x7b83a3[_0x7e5f('0x30')]['filter']+'%'};return _0x423735;}})});}_0x3fe09d=_['merge']({},_0x3fe09d,_0x7b83a3[_0x7e5f('0x3e')]);var _0x7abca4={'where':_0x3fe09d[_0x7e5f('0x39')]};return db[_0x7e5f('0x29')][_0x7e5f('0x3f')](_0x7abca4)[_0x7e5f('0x23')](function(_0x92955d){_0x62f838[_0x7e5f('0x3f')]=_0x92955d;if(_0x7b83a3[_0x7e5f('0x30')][_0x7e5f('0x40')]){_0x3fe09d[_0x7e5f('0x41')]=[{'all':!![]}];}return db[_0x7e5f('0x29')][_0x7e5f('0x42')](_0x3fe09d);})['then'](function(_0x1e3eca){_0x62f838[_0x7e5f('0x43')]=_0x1e3eca;return _0x62f838;})[_0x7e5f('0x23')](respondWithFilteredResult(_0x455071,_0x3fe09d))[_0x7e5f('0x44')](handleError(_0x455071,null));};exports['show']=function(_0x1835f2,_0x581ab3){var _0xaee3ce={'raw':!![],'where':{'id':_0x1835f2[_0x7e5f('0x45')]['id']}},_0x108342={};_0x108342[_0x7e5f('0x2e')]=_[_0x7e5f('0x2f')](db['Dynamics365Field'][_0x7e5f('0x2a')]);_0x108342[_0x7e5f('0x30')]=_[_0x7e5f('0x2f')](_0x1835f2[_0x7e5f('0x30')]);_0x108342['filters']=_[_0x7e5f('0x32')](_0x108342[_0x7e5f('0x2e')],_0x108342[_0x7e5f('0x30')]);_0xaee3ce[_0x7e5f('0x34')]=_['intersection'](_0x108342[_0x7e5f('0x2e')],qs['fields'](_0x1835f2[_0x7e5f('0x30')]['fields']));_0xaee3ce[_0x7e5f('0x34')]=_0xaee3ce[_0x7e5f('0x34')][_0x7e5f('0x35')]?_0xaee3ce['attributes']:_0x108342[_0x7e5f('0x2e')];if(_0x1835f2[_0x7e5f('0x30')][_0x7e5f('0x40')]){_0xaee3ce[_0x7e5f('0x41')]=[{'all':!![]}];}_0xaee3ce=_[_0x7e5f('0x3c')]({},_0xaee3ce,_0x1835f2[_0x7e5f('0x3e')]);return db[_0x7e5f('0x29')][_0x7e5f('0x46')](_0xaee3ce)['then'](handleEntityNotFound(_0x581ab3,null))[_0x7e5f('0x23')](respondWithResult(_0x581ab3,null))['catch'](handleError(_0x581ab3,null));};exports[_0x7e5f('0x47')]=function(_0x1633fc,_0x36dd38){return db[_0x7e5f('0x29')][_0x7e5f('0x47')](_0x1633fc[_0x7e5f('0x48')],{})[_0x7e5f('0x23')](respondWithResult(_0x36dd38,0xc9))['catch'](handleError(_0x36dd38,null));};exports[_0x7e5f('0x49')]=function(_0x366859,_0x4b7fe2){if(_0x366859[_0x7e5f('0x48')]['id']){delete _0x366859[_0x7e5f('0x48')]['id'];}return db[_0x7e5f('0x29')][_0x7e5f('0x46')]({'where':{'id':_0x366859[_0x7e5f('0x45')]['id']}})[_0x7e5f('0x23')](handleEntityNotFound(_0x4b7fe2,null))[_0x7e5f('0x23')](saveUpdates(_0x366859[_0x7e5f('0x48')],null))['then'](respondWithResult(_0x4b7fe2,null))['catch'](handleError(_0x4b7fe2,null));};exports['destroy']=function(_0x39d8ee,_0x497155){return db[_0x7e5f('0x29')][_0x7e5f('0x46')]({'where':{'id':_0x39d8ee['params']['id']}})[_0x7e5f('0x23')](handleEntityNotFound(_0x497155,null))[_0x7e5f('0x23')](removeEntity(_0x497155,null))['catch'](handleError(_0x497155,null));}; \ No newline at end of file +var _0xe41f=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Dynamics365Field','includeAll','include','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe41f,0x13e));var _0xfe41=function(_0x464829,_0x83eb3f){_0x464829=_0x464829-0x0;var _0x5af5cb=_0xe41f[_0x464829];return _0x5af5cb;};'use strict';var pdf=require(_0xfe41('0x0'));var emlformat=require(_0xfe41('0x1'));var rimraf=require(_0xfe41('0x2'));var zipdir=require(_0xfe41('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe41('0x4'));var Mustache=require(_0xfe41('0x5'));var util=require(_0xfe41('0x6'));var path=require(_0xfe41('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfe41('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe41('0x9'));var crypto=require(_0xfe41('0xa'));var jsforce=require(_0xfe41('0xb'));var deskjs=require(_0xfe41('0xc'));var toCsv=require(_0xfe41('0xd'));var querystring=require(_0xfe41('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfe41('0xf'));var hardwareService=require(_0xfe41('0x10'));var logger=require(_0xfe41('0x11'))('api');var utils=require(_0xfe41('0x12'));var config=require(_0xfe41('0x13'));var db=require(_0xfe41('0x14'))['db'];function respondWithStatusCode(_0x57c097,_0x19ed0e){_0x19ed0e=_0x19ed0e||0xcc;return function(_0x3c41da){if(_0x3c41da){return _0x57c097['sendStatus'](_0x19ed0e);}return _0x57c097[_0xfe41('0x15')](_0x19ed0e)[_0xfe41('0x16')]();};}function respondWithResult(_0x421eb7,_0x2fd465){_0x2fd465=_0x2fd465||0xc8;return function(_0x3cffc1){if(_0x3cffc1){return _0x421eb7['status'](_0x2fd465)[_0xfe41('0x17')](_0x3cffc1);}};}function respondWithFilteredResult(_0x384749,_0x1de7f0){return function(_0x539962){if(_0x539962){var _0x597522=_0x539962[_0xfe41('0x18')],_0x364979=_0x1de7f0['offset'],_0xca164f=_0x1de7f0[_0xfe41('0x19')]+_0x1de7f0[_0xfe41('0x1a')],_0x31dedd;if(_0xca164f>=_0x597522){_0xca164f=_0x597522;_0x31dedd=0xc8;}else{_0x31dedd=0xce;}_0x384749[_0xfe41('0x15')](_0x31dedd);return _0x384749[_0xfe41('0x1b')](_0xfe41('0x1c'),_0x364979+'-'+_0xca164f+'/'+_0x597522)[_0xfe41('0x17')](_0x539962);}return null;};}function patchUpdates(_0x3d3dc3){return function(_0x22a631){try{jsonpatch[_0xfe41('0x1d')](_0x22a631,_0x3d3dc3,!![]);}catch(_0x3ad01a){return BPromise[_0xfe41('0x1e')](_0x3ad01a);}return _0x22a631[_0xfe41('0x1f')]();};}function saveUpdates(_0x3cf01e,_0x4d5538){return function(_0x2e85ca){if(_0x2e85ca){return _0x2e85ca[_0xfe41('0x20')](_0x3cf01e)[_0xfe41('0x21')](function(_0x2ca1d4){return _0x2ca1d4;});}return null;};}function removeEntity(_0x916a2,_0x4186d9){return function(_0x3cfccc){if(_0x3cfccc){return _0x3cfccc[_0xfe41('0x22')]()[_0xfe41('0x21')](function(){_0x916a2[_0xfe41('0x15')](0xcc)[_0xfe41('0x16')]();});}};}function handleEntityNotFound(_0x21f42a,_0x5afe19){return function(_0x33d1b7){if(!_0x33d1b7){_0x21f42a[_0xfe41('0x23')](0x194);}return _0x33d1b7;};}function handleError(_0x344bea,_0x450e0a){_0x450e0a=_0x450e0a||0x1f4;return function(_0x16709b){logger['error'](_0x16709b[_0xfe41('0x24')]);if(_0x16709b[_0xfe41('0x25')]){delete _0x16709b[_0xfe41('0x25')];}_0x344bea[_0xfe41('0x15')](_0x450e0a)[_0xfe41('0x26')](_0x16709b);};}exports['index']=function(_0x10e5ed,_0x2a3dcc){var _0x167151={},_0x422d80={},_0x44d7a3={'count':0x0,'rows':[]};var _0x2804b7=_[_0xfe41('0x27')](db['Dynamics365Field'][_0xfe41('0x28')],function(_0x9a5108){return{'name':_0x9a5108['fieldName'],'type':_0x9a5108[_0xfe41('0x29')]['key']};});_0x422d80[_0xfe41('0x2a')]=_['map'](_0x2804b7,_0xfe41('0x25'));_0x422d80[_0xfe41('0x2b')]=_[_0xfe41('0x2c')](_0x10e5ed[_0xfe41('0x2b')]);_0x422d80[_0xfe41('0x2d')]=_[_0xfe41('0x2e')](_0x422d80['model'],_0x422d80[_0xfe41('0x2b')]);_0x167151[_0xfe41('0x2f')]=_[_0xfe41('0x2e')](_0x422d80['model'],qs[_0xfe41('0x30')](_0x10e5ed['query'][_0xfe41('0x30')]));_0x167151[_0xfe41('0x2f')]=_0x167151[_0xfe41('0x2f')][_0xfe41('0x31')]?_0x167151[_0xfe41('0x2f')]:_0x422d80[_0xfe41('0x2a')];if(!_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x32')]('nolimit')){_0x167151[_0xfe41('0x1a')]=qs[_0xfe41('0x1a')](_0x10e5ed[_0xfe41('0x2b')]['limit']);_0x167151[_0xfe41('0x19')]=qs[_0xfe41('0x19')](_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x19')]);}_0x167151[_0xfe41('0x33')]=qs[_0xfe41('0x34')](_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x34')]);_0x167151[_0xfe41('0x35')]=qs[_0xfe41('0x2d')](_[_0xfe41('0x36')](_0x10e5ed['query'],_0x422d80[_0xfe41('0x2d')]),_0x2804b7);if(_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x37')]){_0x167151[_0xfe41('0x35')]=_[_0xfe41('0x38')](_0x167151['where'],{'$or':_[_0xfe41('0x27')](_0x2804b7,function(_0x547ae5){if(_0x547ae5[_0xfe41('0x29')]!=='VIRTUAL'){var _0x1b6566={};_0x1b6566[_0x547ae5[_0xfe41('0x25')]]={'$like':'%'+_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x37')]+'%'};return _0x1b6566;}})});}_0x167151=_[_0xfe41('0x38')]({},_0x167151,_0x10e5ed[_0xfe41('0x39')]);var _0x4bffcf={'where':_0x167151[_0xfe41('0x35')]};return db[_0xfe41('0x3a')][_0xfe41('0x18')](_0x4bffcf)['then'](function(_0x5ebe52){_0x44d7a3[_0xfe41('0x18')]=_0x5ebe52;if(_0x10e5ed[_0xfe41('0x2b')][_0xfe41('0x3b')]){_0x167151[_0xfe41('0x3c')]=[{'all':!![]}];}return db[_0xfe41('0x3a')]['findAll'](_0x167151);})[_0xfe41('0x21')](function(_0x4fc5e6){_0x44d7a3['rows']=_0x4fc5e6;return _0x44d7a3;})[_0xfe41('0x21')](respondWithFilteredResult(_0x2a3dcc,_0x167151))[_0xfe41('0x3d')](handleError(_0x2a3dcc,null));};exports[_0xfe41('0x3e')]=function(_0x15dee2,_0x2cd38f){var _0x5a12d2={'raw':!![],'where':{'id':_0x15dee2[_0xfe41('0x3f')]['id']}},_0x2448cb={};_0x2448cb[_0xfe41('0x2a')]=_[_0xfe41('0x2c')](db[_0xfe41('0x3a')][_0xfe41('0x28')]);_0x2448cb[_0xfe41('0x2b')]=_[_0xfe41('0x2c')](_0x15dee2[_0xfe41('0x2b')]);_0x2448cb['filters']=_[_0xfe41('0x2e')](_0x2448cb[_0xfe41('0x2a')],_0x2448cb[_0xfe41('0x2b')]);_0x5a12d2[_0xfe41('0x2f')]=_[_0xfe41('0x2e')](_0x2448cb[_0xfe41('0x2a')],qs[_0xfe41('0x30')](_0x15dee2[_0xfe41('0x2b')]['fields']));_0x5a12d2['attributes']=_0x5a12d2[_0xfe41('0x2f')]['length']?_0x5a12d2[_0xfe41('0x2f')]:_0x2448cb['model'];if(_0x15dee2[_0xfe41('0x2b')]['includeAll']){_0x5a12d2['include']=[{'all':!![]}];}_0x5a12d2=_[_0xfe41('0x38')]({},_0x5a12d2,_0x15dee2['options']);return db[_0xfe41('0x3a')][_0xfe41('0x40')](_0x5a12d2)['then'](handleEntityNotFound(_0x2cd38f,null))[_0xfe41('0x21')](respondWithResult(_0x2cd38f,null))[_0xfe41('0x3d')](handleError(_0x2cd38f,null));};exports[_0xfe41('0x41')]=function(_0x307485,_0x20c73d){return db[_0xfe41('0x3a')][_0xfe41('0x41')](_0x307485[_0xfe41('0x42')],{})[_0xfe41('0x21')](respondWithResult(_0x20c73d,0xc9))['catch'](handleError(_0x20c73d,null));};exports[_0xfe41('0x20')]=function(_0x3c293e,_0x1c25f2){if(_0x3c293e[_0xfe41('0x42')]['id']){delete _0x3c293e[_0xfe41('0x42')]['id'];}return db[_0xfe41('0x3a')][_0xfe41('0x40')]({'where':{'id':_0x3c293e[_0xfe41('0x3f')]['id']}})[_0xfe41('0x21')](handleEntityNotFound(_0x1c25f2,null))[_0xfe41('0x21')](saveUpdates(_0x3c293e[_0xfe41('0x42')],null))[_0xfe41('0x21')](respondWithResult(_0x1c25f2,null))[_0xfe41('0x3d')](handleError(_0x1c25f2,null));};exports[_0xfe41('0x22')]=function(_0x364ebe,_0x12c2bd){return db[_0xfe41('0x3a')][_0xfe41('0x40')]({'where':{'id':_0x364ebe[_0xfe41('0x3f')]['id']}})['then'](handleEntityNotFound(_0x12c2bd,null))['then'](removeEntity(_0x12c2bd,null))[_0xfe41('0x3d')](handleError(_0x12c2bd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c2d73e2..4d35a49 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 _0x49e7=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3aec49,_0x30d0f8){var _0x41d74e=function(_0x34faa1){while(--_0x34faa1){_0x3aec49['push'](_0x3aec49['shift']());}};_0x41d74e(++_0x30d0f8);}(_0x49e7,0xda));var _0x749e=function(_0x4ec964,_0x3b9bd8){_0x4ec964=_0x4ec964-0x0;var _0x5943e2=_0x49e7[_0x4ec964];return _0x5943e2;};'use strict';var _=require('lodash');var util=require(_0x749e('0x0'));var logger=require(_0x749e('0x1'))('api');var moment=require(_0x749e('0x2'));var BPromise=require(_0x749e('0x3'));var rp=require(_0x749e('0x4'));var fs=require('fs');var path=require(_0x749e('0x5'));var rimraf=require(_0x749e('0x6'));var config=require(_0x749e('0x7'));var attributes=require(_0x749e('0x8'));module[_0x749e('0x9')]=function(_0xa71346,_0x4507a6){return _0xa71346['define'](_0x749e('0xa'),attributes,{'tableName':_0x749e('0xb'),'paranoid':![],'indexes':[{'name':_0x749e('0xc'),'fields':[_0x749e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x16e2=['../../config/environment','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise','rimraf'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x16e2,0x8b));var _0x216e=function(_0xaab43b,_0x171483){_0xaab43b=_0xaab43b-0x0;var _0x83838=_0x16e2[_0xaab43b];return _0x83838;};'use strict';var _=require(_0x216e('0x0'));var util=require('util');var logger=require(_0x216e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x216e('0x2'));var rp=require(_0x216e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x216e('0x4'));var config=require(_0x216e('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x216e('0x6')]=function(_0x186aa6,_0x40d537){return _0x186aa6[_0x216e('0x7')]('Dynamics365Field',attributes,{'tableName':_0x216e('0x8'),'paranoid':![],'indexes':[{'name':_0x216e('0x9'),'fields':[_0x216e('0xa'),_0x216e('0xb')],'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 973a01c..504e6ec 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 _0xbd0a=['catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','result','message'];(function(_0x3250f5,_0x5d856a){var _0x589823=function(_0x38dfee){while(--_0x38dfee){_0x3250f5['push'](_0x3250f5['shift']());}};_0x589823(++_0x5d856a);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x6ed5fd,_0x436c31){_0x6ed5fd=_0x6ed5fd-0x0;var _0x5dc8b9=_0xbd0a[_0x6ed5fd];return _0x5dc8b9;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe18a18,_0x4ac4ad,_0xf44097){return new BPromise(function(_0xb60e77,_0x2b50c1){return client['request'](_0xe18a18,_0xf44097)[_0xabd0('0xa')](function(_0x4830c4){logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));logger[_0xabd0('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4ac4ad,_0xabd0('0xd'),JSON['stringify'](_0x4830c4));if(_0x4830c4[_0xabd0('0xf')]){if(_0x4830c4[_0xabd0('0xf')][_0xabd0('0x10')]===0x1f4){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4[_0xabd0('0xf')]['message']);return _0x2b50c1(_0x4830c4[_0xabd0('0xf')]['message']);}logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4['error']['message']);return _0xb60e77(_0x4830c4['error']['message']);}else{logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));_0xb60e77(_0x4830c4[_0xabd0('0x11')][_0xabd0('0x12')]);}})[_0xabd0('0x13')](function(_0x389e1e){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x389e1e);_0x2b50c1(_0x389e1e);});});} \ No newline at end of file +var _0x4ccb=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x3db750,_0x5d66c2){var _0x5427a=function(_0x41fdb8){while(--_0x41fdb8){_0x3db750['push'](_0x3db750['shift']());}};_0x5427a(++_0x5d66c2);}(_0x4ccb,0x196));var _0xb4cc=function(_0x1316ee,_0x28a687){_0x1316ee=_0x1316ee-0x0;var _0x2118bf=_0x4ccb[_0x1316ee];return _0x2118bf;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var moment=require(_0xb4cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4cc('0x3'));var fs=require('fs');var Redis=require(_0xb4cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4cc('0x5'));var logger=require(_0xb4cc('0x6'))(_0xb4cc('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4cc('0x8'));var client=jayson[_0xb4cc('0x9')][_0xb4cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c0bdd,_0x370b12,_0x6ba3bf){return new BPromise(function(_0x2129ef,_0x5327a4){return client[_0xb4cc('0xb')](_0x5c0bdd,_0x6ba3bf)[_0xb4cc('0xc')](function(_0xbf893){logger[_0xb4cc('0xd')](_0xb4cc('0xe'),_0x370b12,'request\x20sent');logger[_0xb4cc('0xf')](_0xb4cc('0x10'),_0x370b12,'request\x20sent',JSON[_0xb4cc('0x11')](_0xbf893));if(_0xbf893['error']){if(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x13')]===0x1f4){logger[_0xb4cc('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x5327a4(_0xbf893['error']['message']);}logger[_0xb4cc('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x2129ef(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x14')]);}else{logger['info'](_0xb4cc('0xe'),_0x370b12,_0xb4cc('0x15'));_0x2129ef(_0xbf893[_0xb4cc('0x16')][_0xb4cc('0x14')]);}})[_0xb4cc('0x17')](function(_0x506ef9){logger[_0xb4cc('0x12')](_0xb4cc('0xe'),_0x370b12,_0x506ef9);_0x5327a4(_0x506ef9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1e61ae1..147f62f 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 _0x5aa8=['./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0xcb5f3c,_0x11ffbb){var _0x3c2a15=function(_0x7c0b41){while(--_0x7c0b41){_0xcb5f3c['push'](_0xcb5f3c['shift']());}};_0x3c2a15(++_0x11ffbb);}(_0x5aa8,0x13b));var _0x85aa=function(_0x3b84f7,_0x55dd20){_0x3b84f7=_0x3b84f7-0x0;var _0x3c9a6c=_0x5aa8[_0x3b84f7];return _0x3c9a6c;};'use strict';var multer=require(_0x85aa('0x0'));var util=require(_0x85aa('0x1'));var path=require(_0x85aa('0x2'));var timeout=require('connect-timeout');var express=require(_0x85aa('0x3'));var router=express[_0x85aa('0x4')]();var auth=require(_0x85aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x85aa('0x6'));var controller=require(_0x85aa('0x7'));router[_0x85aa('0x8')]('/',auth[_0x85aa('0x9')](),controller[_0x85aa('0xa')]);router[_0x85aa('0x8')]('/:id',auth[_0x85aa('0x9')](),controller[_0x85aa('0xb')]);router[_0x85aa('0x8')](_0x85aa('0xc'),auth['isAuthenticated'](),controller[_0x85aa('0xd')]);router[_0x85aa('0x8')](_0x85aa('0xe'),auth[_0x85aa('0x9')](),controller[_0x85aa('0xf')]);router[_0x85aa('0x10')]('/',auth[_0x85aa('0x9')](),controller[_0x85aa('0x11')]);router[_0x85aa('0x10')](_0x85aa('0xc'),auth[_0x85aa('0x9')](),controller[_0x85aa('0x12')]);router[_0x85aa('0x13')](_0x85aa('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x85aa('0x15')](_0x85aa('0x14'),auth[_0x85aa('0x9')](),controller['destroy']);module[_0x85aa('0x16')]=router; \ No newline at end of file +var _0x3b45=['get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./intFreshdeskAccount.controller'];(function(_0x52a312,_0x52fa77){var _0x2fbf53=function(_0x469863){while(--_0x469863){_0x52a312['push'](_0x52a312['shift']());}};_0x2fbf53(++_0x52fa77);}(_0x3b45,0xde));var _0x53b4=function(_0xfadae6,_0x13ec35){_0xfadae6=_0xfadae6-0x0;var _0x2a156e=_0x3b45[_0xfadae6];return _0x2a156e;};'use strict';var multer=require(_0x53b4('0x0'));var util=require('util');var path=require(_0x53b4('0x1'));var timeout=require(_0x53b4('0x2'));var express=require(_0x53b4('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x53b4('0x4'));var config=require('../../config/environment');var controller=require(_0x53b4('0x5'));router[_0x53b4('0x6')]('/',auth[_0x53b4('0x7')](),controller['index']);router[_0x53b4('0x6')]('/:id',auth[_0x53b4('0x7')](),controller['show']);router[_0x53b4('0x6')](_0x53b4('0x8'),auth[_0x53b4('0x7')](),controller[_0x53b4('0x9')]);router['get'](_0x53b4('0xa'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x53b4('0x7')](),controller[_0x53b4('0xb')]);router['post'](_0x53b4('0x8'),auth[_0x53b4('0x7')](),controller[_0x53b4('0xc')]);router[_0x53b4('0xd')](_0x53b4('0xe'),auth['isAuthenticated'](),controller[_0x53b4('0xf')]);router[_0x53b4('0x10')](_0x53b4('0xe'),auth['isAuthenticated'](),controller[_0x53b4('0x11')]);module[_0x53b4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 7611c88..c43589b 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 _0xd26f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x55ed34,_0x369cc2){var _0x158abf=function(_0x2b7ff4){while(--_0x2b7ff4){_0x55ed34['push'](_0x55ed34['shift']());}};_0x158abf(++_0x369cc2);}(_0xd26f,0x113));var _0xfd26=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd26f[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x3')},'apiKey':{'type':Sequelize[_0xfd26('0x2')]},'remoteUri':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x4')},'serverUrl':{'type':Sequelize[_0xfd26('0x2')]}}; \ No newline at end of file +var _0x014c=['STRING','username','remoteUri','exports'];(function(_0x11bd81,_0x11fa4c){var _0x158de0=function(_0xa93fbb){while(--_0xa93fbb){_0x11bd81['push'](_0x11bd81['shift']());}};_0x158de0(++_0x11fa4c);}(_0x014c,0x17b));var _0xc014=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x014c[_0x5d9ceb];return _0x33ce82;};'use strict';var Sequelize=require('sequelize');module[_0xc014('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc014('0x1')]},'username':{'type':Sequelize[_0xc014('0x1')],'unique':_0xc014('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc014('0x3')},'serverUrl':{'type':Sequelize[_0xc014('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index cc8023f..63aecf1 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 _0xa41a=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','end','status','json','count','offset','limit','Content-Range','apply','update','destroy','sendStatus','name','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','FreshdeskConfiguration','map','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject','description','priority','source','ticket_type','company','includes','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce'];(function(_0x3dfcaf,_0x2dff56){var _0x2cdd63=function(_0xcaaf9d){while(--_0xcaaf9d){_0x3dfcaf['push'](_0x3dfcaf['shift']());}};_0x2cdd63(++_0x2dff56);}(_0xa41a,0x6b));var _0xaa41=function(_0x30913b,_0x26abea){_0x30913b=_0x30913b-0x0;var _0x34675b=_0xa41a[_0x30913b];return _0x34675b;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var Redis=require(_0xaa41('0x10'));var authService=require(_0xaa41('0x11'));var qs=require(_0xaa41('0x12'));var as=require(_0xaa41('0x13'));var hardwareService=require(_0xaa41('0x14'));var logger=require(_0xaa41('0x15'))('api');var utils=require(_0xaa41('0x16'));var config=require(_0xaa41('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xaa41('0x18'));var client=jayson['client'][_0xaa41('0x19')]({'port':0x232a});function checkPasswordPattern(_0x12d9e6,_0x2f64bc,_0x889d44){if(_0x889d44){var _0x6f9ade=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6f9ade['test'](_0x2f64bc)){return _0x12d9e6;}else{throw new db[(_0xaa41('0x1a'))][(_0xaa41('0x1b'))](_0xaa41('0x1c'));}}else{return _0x12d9e6;}}function respondWithRpcPromise(_0x1ef7d9,_0x2a6988,_0x2005ae,_0x1e1e02){return new BPromise(function(_0x550ad5,_0x2d868a){var _0x16b930=_0x1e1e02||client;return _0x16b930[_0xaa41('0x1d')](_0x1ef7d9,_0x2005ae)[_0xaa41('0x1e')](function(_0x230a6a){logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));logger[_0xaa41('0x22')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2a6988,'request\x20sent',JSON[_0xaa41('0x23')](_0x230a6a));if(_0x230a6a[_0xaa41('0x24')]){if(_0x230a6a[_0xaa41('0x24')]['code']===0x1f4){logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a['error']['message']);return _0x2d868a(_0x230a6a[_0xaa41('0x24')]['message']);}logger[_0xaa41('0x24')](_0xaa41('0x20'),_0x2a6988,_0x230a6a[_0xaa41('0x24')][_0xaa41('0x25')]);return _0x550ad5(_0x230a6a[_0xaa41('0x24')]['message']);}else{logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2a6988,_0xaa41('0x21'));_0x550ad5(_0x230a6a[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x5c3074){logger['error'](_0xaa41('0x20'),_0x2a6988,_0x5c3074);_0x2d868a(_0x5c3074);});});}function respondWithStatusCode(_0x527cac,_0x493a10){_0x493a10=_0x493a10||0xcc;return function(_0x12e362){if(_0x12e362){return _0x527cac['sendStatus'](_0x493a10);}return _0x527cac['status'](_0x493a10)[_0xaa41('0x28')]();};}function respondWithResult(_0x9c8c21,_0x392214){_0x392214=_0x392214||0xc8;return function(_0x632fd2){if(_0x632fd2){return _0x9c8c21[_0xaa41('0x29')](_0x392214)[_0xaa41('0x2a')](_0x632fd2);}};}function respondWithFilteredResult(_0x57ef96,_0x30a174){return function(_0x1f0275){if(_0x1f0275){var _0x63c18c=_0x1f0275[_0xaa41('0x2b')],_0x9a16e3=_0x30a174[_0xaa41('0x2c')],_0x1d8c2b=_0x30a174['offset']+_0x30a174[_0xaa41('0x2d')],_0x4466a3;if(_0x1d8c2b>=_0x63c18c){_0x1d8c2b=_0x63c18c;_0x4466a3=0xc8;}else{_0x4466a3=0xce;}_0x57ef96['status'](_0x4466a3);return _0x57ef96['set'](_0xaa41('0x2e'),_0x9a16e3+'-'+_0x1d8c2b+'/'+_0x63c18c)[_0xaa41('0x2a')](_0x1f0275);}return null;};}function patchUpdates(_0x534a85){return function(_0x392b5d){try{jsonpatch[_0xaa41('0x2f')](_0x392b5d,_0x534a85,!![]);}catch(_0x4e3b44){return BPromise['reject'](_0x4e3b44);}return _0x392b5d['save']();};}function saveUpdates(_0x1cf3da,_0x2f5cc0){return function(_0x2a186e){if(_0x2a186e){return _0x2a186e[_0xaa41('0x30')](_0x1cf3da)['then'](function(_0x289c4a){return _0x289c4a;});}return null;};}function removeEntity(_0x45c8fe,_0x3e0204){return function(_0x4de770){if(_0x4de770){return _0x4de770[_0xaa41('0x31')]()[_0xaa41('0x1e')](function(){_0x45c8fe[_0xaa41('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x252c62,_0x374117){return function(_0x57fe1d){if(!_0x57fe1d){_0x252c62[_0xaa41('0x32')](0x194);}return _0x57fe1d;};}function handleError(_0x13b6d4,_0x2298ed){_0x2298ed=_0x2298ed||0x1f4;return function(_0x5cec87){logger[_0xaa41('0x24')](_0x5cec87['stack']);if(_0x5cec87[_0xaa41('0x33')]){delete _0x5cec87[_0xaa41('0x33')];}_0x13b6d4[_0xaa41('0x29')](_0x2298ed)['send'](_0x5cec87);};}exports['index']=function(_0x4cdd42,_0x2dc05a){var _0x2e785f={},_0x1334c8={},_0x224eb3={'count':0x0,'rows':[]};var _0x4fbb92=_['map'](db[_0xaa41('0x34')][_0xaa41('0x35')],function(_0x951e52){return{'name':_0x951e52[_0xaa41('0x36')],'type':_0x951e52[_0xaa41('0x37')][_0xaa41('0x38')]};});_0x1334c8[_0xaa41('0x39')]=_['map'](_0x4fbb92,_0xaa41('0x33'));_0x1334c8[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x4cdd42[_0xaa41('0x3a')]);_0x1334c8['filters']=_['intersection'](_0x1334c8[_0xaa41('0x39')],_0x1334c8[_0xaa41('0x3a')]);_0x2e785f['attributes']=_[_0xaa41('0x3c')](_0x1334c8['model'],qs[_0xaa41('0x3d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x3d')]));_0x2e785f[_0xaa41('0x3e')]=_0x2e785f[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0x2e785f[_0xaa41('0x3e')]:_0x1334c8[_0xaa41('0x39')];if(!_0x4cdd42['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0x2e785f[_0xaa41('0x2d')]=qs[_0xaa41('0x2d')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0x2e785f['offset']=qs['offset'](_0x4cdd42[_0xaa41('0x3a')]['offset']);}_0x2e785f[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x43')]);_0x2e785f[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x4cdd42['query'],_0x1334c8[_0xaa41('0x45')]),_0x4fbb92);if(_0x4cdd42['query']['filter']){_0x2e785f[_0xaa41('0x44')]=_['merge'](_0x2e785f['where'],{'$or':_['map'](_0x4fbb92,function(_0x3bad48){if(_0x3bad48['type']!==_0xaa41('0x47')){var _0x198716={};_0x198716[_0x3bad48['name']]={'$like':'%'+_0x4cdd42['query'][_0xaa41('0x48')]+'%'};return _0x198716;}})});}_0x2e785f=_[_0xaa41('0x49')]({},_0x2e785f,_0x4cdd42[_0xaa41('0x4a')]);var _0x2af8ba={'where':_0x2e785f[_0xaa41('0x44')]};return db[_0xaa41('0x34')][_0xaa41('0x2b')](_0x2af8ba)[_0xaa41('0x1e')](function(_0x2fa6ec){_0x224eb3['count']=_0x2fa6ec;if(_0x4cdd42[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x2e785f[_0xaa41('0x4c')]=[{'all':!![]}];}return db[_0xaa41('0x34')][_0xaa41('0x4d')](_0x2e785f);})[_0xaa41('0x1e')](function(_0x538b12){_0x224eb3[_0xaa41('0x4e')]=_0x538b12;return _0x224eb3;})[_0xaa41('0x1e')](respondWithFilteredResult(_0x2dc05a,_0x2e785f))[_0xaa41('0x27')](handleError(_0x2dc05a,null));};exports[_0xaa41('0x4f')]=function(_0x57d1f6,_0x23bc61){var _0x5787f3={'raw':![],'where':{'id':_0x57d1f6[_0xaa41('0x50')]['id']}},_0x49fedd={};_0x49fedd[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db['FreshdeskAccount'][_0xaa41('0x35')]);_0x49fedd[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x57d1f6['query']);_0x49fedd[_0xaa41('0x45')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],_0x49fedd[_0xaa41('0x3a')]);_0x5787f3[_0xaa41('0x3e')]=_[_0xaa41('0x3c')](_0x49fedd[_0xaa41('0x39')],qs[_0xaa41('0x3d')](_0x57d1f6['query'][_0xaa41('0x3d')]));_0x5787f3['attributes']=_0x5787f3['attributes'][_0xaa41('0x3f')]?_0x5787f3[_0xaa41('0x3e')]:_0x49fedd[_0xaa41('0x39')];if(_0x57d1f6[_0xaa41('0x3a')][_0xaa41('0x4b')]){_0x5787f3[_0xaa41('0x4c')]=[{'all':!![]}];}_0x5787f3=_[_0xaa41('0x49')]({},_0x5787f3,_0x57d1f6[_0xaa41('0x4a')]);return db['FreshdeskAccount'][_0xaa41('0x51')](_0x5787f3)[_0xaa41('0x1e')](handleEntityNotFound(_0x23bc61,null))[_0xaa41('0x1e')](respondWithResult(_0x23bc61,null))['catch'](handleError(_0x23bc61,null));};exports[_0xaa41('0x52')]=function(_0x35f664,_0x4cf674){return db[_0xaa41('0x34')][_0xaa41('0x52')](_0x35f664[_0xaa41('0x53')],{})['then'](respondWithResult(_0x4cf674,0xc9))[_0xaa41('0x27')](handleError(_0x4cf674,null));};exports[_0xaa41('0x30')]=function(_0x4e3b13,_0x49789a){if(_0x4e3b13[_0xaa41('0x53')]['id']){delete _0x4e3b13[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')]['find']({'where':{'id':_0x4e3b13[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x49789a,null))[_0xaa41('0x1e')](saveUpdates(_0x4e3b13[_0xaa41('0x53')],null))[_0xaa41('0x1e')](respondWithResult(_0x49789a,null))['catch'](handleError(_0x49789a,null));};exports[_0xaa41('0x31')]=function(_0x57cb70,_0x555186){return db[_0xaa41('0x34')]['find']({'where':{'id':_0x57cb70[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x555186,null))[_0xaa41('0x1e')](removeEntity(_0x555186,null))['catch'](handleError(_0x555186,null));};exports[_0xaa41('0x54')]=function(_0x41c7f4,_0x36154e,_0x857bbc){var _0xa1f9f9={};var _0x332a3c={};var _0xc56018;var _0x337059;return db[_0xaa41('0x34')]['findOne']({'where':{'id':_0x41c7f4[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x36154e,null))[_0xaa41('0x1e')](function(_0x5a5a55){if(_0x5a5a55){_0xc56018=_0x5a5a55;_0x332a3c[_0xaa41('0x39')]=_[_0xaa41('0x3b')](db[_0xaa41('0x55')][_0xaa41('0x35')]);_0x332a3c[_0xaa41('0x3a')]=_[_0xaa41('0x3b')](_0x41c7f4[_0xaa41('0x3a')]);_0x332a3c['filters']=_['intersection'](_0x332a3c['model'],_0x332a3c['query']);_0xa1f9f9['attributes']=_['intersection'](_0x332a3c[_0xaa41('0x39')],qs['fields'](_0x41c7f4['query'][_0xaa41('0x3d')]));_0xa1f9f9[_0xaa41('0x3e')]=_0xa1f9f9[_0xaa41('0x3e')][_0xaa41('0x3f')]?_0xa1f9f9['attributes']:_0x332a3c[_0xaa41('0x39')];_0xa1f9f9[_0xaa41('0x42')]=qs[_0xaa41('0x43')](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x43')]);_0xa1f9f9[_0xaa41('0x44')]=qs[_0xaa41('0x45')](_[_0xaa41('0x46')](_0x41c7f4[_0xaa41('0x3a')],_0x332a3c['filters']));if(_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]){_0xa1f9f9['where']=_['merge'](_0xa1f9f9['where'],{'$or':_[_0xaa41('0x56')](_0xa1f9f9['attributes'],function(_0x1eac4a){var _0x5c8028={};_0x5c8028[_0x1eac4a]={'$like':'%'+_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x48')]+'%'};return _0x5c8028;})});}_0xa1f9f9=_['merge']({},_0xa1f9f9,_0x41c7f4[_0xaa41('0x4a')]);return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})[_0xaa41('0x1e')](function(_0x33f5c2){if(_0x33f5c2){_0x337059=_0x33f5c2['length'];if(!_0x41c7f4['query'][_0xaa41('0x40')](_0xaa41('0x41'))){_0xa1f9f9['limit']=qs['limit'](_0x41c7f4[_0xaa41('0x3a')][_0xaa41('0x2d')]);_0xa1f9f9[_0xaa41('0x2c')]=qs[_0xaa41('0x2c')](_0x41c7f4[_0xaa41('0x3a')]['offset']);}return _0xc56018[_0xaa41('0x54')](_0xa1f9f9);}})['then'](function(_0x5062db){if(_0x5062db){return _0x5062db?{'count':_0x337059,'rows':_0x5062db}:null;}})['then'](respondWithResult(_0x36154e,null))[_0xaa41('0x27')](handleError(_0x36154e,null));};exports[_0xaa41('0x57')]=function(_0x436362,_0x5bad74,_0x229297){if(_0x436362[_0xaa41('0x53')]['id']){delete _0x436362[_0xaa41('0x53')]['id'];}return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x436362[_0xaa41('0x50')]['id']}})[_0xaa41('0x1e')](handleEntityNotFound(_0x5bad74,null))['then'](function(_0x1d2978){if(_0x1d2978){_0x436362[_0xaa41('0x53')][_0xaa41('0x59')]=_0x1d2978['id'];_0x436362[_0xaa41('0x53')]['Subjects']=integrations[_0xaa41('0x5a')](_0x436362['body'][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')][_0xaa41('0x37')]);_0x436362[_0xaa41('0x53')]['Descriptions']=integrations[_0xaa41('0x5c')](_0x436362[_0xaa41('0x53')][_0xaa41('0x5b')],_0x436362[_0xaa41('0x53')]['type']);return db[_0xaa41('0x55')]['create'](_0x436362[_0xaa41('0x53')],{'include':[{'model':db[_0xaa41('0x5d')],'as':'Subjects'},{'model':db[_0xaa41('0x5d')],'as':_0xaa41('0x5e')}]});}return null;})[_0xaa41('0x1e')](respondWithResult(_0x5bad74,null))[_0xaa41('0x27')](handleError(_0x5bad74,null));};exports[_0xaa41('0x5f')]=function(_0x1338d3,_0x384aba,_0x297ec6){var _0x33b5f4='';return db[_0xaa41('0x34')][_0xaa41('0x58')]({'where':{'id':_0x1338d3['params']['id']},'attributes':['id',_0xaa41('0x60'),_0xaa41('0x61')]})[_0xaa41('0x1e')](handleEntityNotFound(_0x384aba,null))['then'](function(_0x5ec19b){if(_0x5ec19b){_0x33b5f4=_0x5ec19b[_0xaa41('0x60')];var _0x39da69=_0x33b5f4['slice'](-0x1);if(_0x39da69==='/'){_0x33b5f4=_0x33b5f4[_0xaa41('0x62')](0x0,_0x33b5f4[_0xaa41('0x63')](_0x39da69));}return rp({'method':'GET','uri':util[_0xaa41('0x64')](_0xaa41('0x65'),_0x33b5f4,_0xaa41('0x66')),'headers':{'Authorization':util[_0xaa41('0x64')](_0xaa41('0x67'),new Buffer(util[_0xaa41('0x64')](_0xaa41('0x68'),_0x5ec19b[_0xaa41('0x61')]))['toString']('base64'))},'json':!![]});}})[_0xaa41('0x1e')](function(_0x481db9){if(_0x481db9){var _0x654594=[_0xaa41('0x69'),_0xaa41('0x6a'),'agent',_0xaa41('0x6b'),_0xaa41('0x29'),_0xaa41('0x6c'),'group',_0xaa41('0x6d'),_0xaa41('0x6e'),'group',_0xaa41('0x6f')];_['remove'](_0x481db9,function(_0x53faf4){return _0x654594[_0xaa41('0x70')](_0x53faf4[_0xaa41('0x33')])||!_0x53faf4['default']&&_0x53faf4['type']!==_0xaa41('0x71')&&_0x53faf4[_0xaa41('0x37')]!==_0xaa41('0x72');});return{'count':_0x481db9[_0xaa41('0x3f')],'rows':_['map'](_0x481db9,function(_0x9741a8){return{'id':_0x9741a8[_0xaa41('0x33')],'name':_0x9741a8[_0xaa41('0x73')],'custom':!_0x9741a8['default'],'options':_0x9741a8[_0xaa41('0x74')]?_[_0xaa41('0x56')](_0x9741a8[_0xaa41('0x74')],function(_0x5697b6){return{'name':_[_0xaa41('0x75')](_0x5697b6),'value':_0x5697b6};}):[]};})};}})['then'](respondWithResult(_0x384aba,null))['catch'](function(_0x364d24){var _0x25c4d0=_0x1338d3['query'][_0xaa41('0x76')]?0x1f4:_0x364d24[_0xaa41('0x77')]||0x1f4;logger[_0xaa41('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xaa41('0x5f'),_0x25c4d0,JSON[_0xaa41('0x23')](_0x364d24));delete _0x364d24[_0xaa41('0x33')];if(_0x25c4d0===0x191){_0x25c4d0=0x190;}_0x384aba[_0xaa41('0x29')](_0x25c4d0)[_0xaa41('0x78')](_0x1338d3['query'][_0xaa41('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x364d24[_0xaa41('0x77')]}:_0x364d24);});}; \ No newline at end of file +var _0xe14b=['apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','priority','group','ticket_type','company','includes','default','custom_text','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','name','index','map','FreshdeskAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri'];(function(_0x2fdebe,_0x3d65fe){var _0x45f85f=function(_0x161e1b){while(--_0x161e1b){_0x2fdebe['push'](_0x2fdebe['shift']());}};_0x45f85f(++_0x3d65fe);}(_0xe14b,0x93));var _0xbe14=function(_0x171f9e,_0x2bdf80){_0x171f9e=_0x171f9e-0x0;var _0x12f8e3=_0xe14b[_0x171f9e];return _0x12f8e3;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var integrations=require(_0xbe14('0x15'));var jayson=require(_0xbe14('0x16'));var client=jayson[_0xbe14('0x17')][_0xbe14('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2850cb,_0x16893f,_0xa2cf72){if(_0xa2cf72){var _0x1e4826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e4826[_0xbe14('0x19')](_0x16893f)){return _0x2850cb;}else{throw new db[(_0xbe14('0x1a'))]['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 _0x2850cb;}}function respondWithRpcPromise(_0x3f58f5,_0x3dc4a9,_0xf4ac9,_0x37ce4e){return new BPromise(function(_0x4e8f34,_0x21c789){var _0xe9c3ec=_0x37ce4e||client;return _0xe9c3ec[_0xbe14('0x1b')](_0x3f58f5,_0xf4ac9)[_0xbe14('0x1c')](function(_0x38f1ea){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');logger[_0xbe14('0x1f')](_0xbe14('0x20'),_0x3dc4a9,_0xbe14('0x21'),JSON[_0xbe14('0x22')](_0x38f1ea));if(_0x38f1ea[_0xbe14('0x23')]){if(_0x38f1ea[_0xbe14('0x23')]['code']===0x1f4){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')][_0xbe14('0x24')]);return _0x21c789(_0x38f1ea[_0xbe14('0x23')]['message']);}logger[_0xbe14('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')]['message']);return _0x4e8f34(_0x38f1ea[_0xbe14('0x23')]['message']);}else{logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');_0x4e8f34(_0x38f1ea[_0xbe14('0x25')]['message']);}})[_0xbe14('0x26')](function(_0x4851f8){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x4851f8);_0x21c789(_0x4851f8);});});}function respondWithStatusCode(_0x1ee9c1,_0x39cc81){_0x39cc81=_0x39cc81||0xcc;return function(_0x15ef02){if(_0x15ef02){return _0x1ee9c1[_0xbe14('0x27')](_0x39cc81);}return _0x1ee9c1['status'](_0x39cc81)[_0xbe14('0x28')]();};}function respondWithResult(_0x1ba46a,_0x391556){_0x391556=_0x391556||0xc8;return function(_0x169369){if(_0x169369){return _0x1ba46a['status'](_0x391556)[_0xbe14('0x29')](_0x169369);}};}function respondWithFilteredResult(_0x29fc64,_0x59bf34){return function(_0x3c3613){if(_0x3c3613){var _0x3b3e84=_0x3c3613[_0xbe14('0x2a')],_0x1c7cc7=_0x59bf34[_0xbe14('0x2b')],_0x19252f=_0x59bf34[_0xbe14('0x2b')]+_0x59bf34[_0xbe14('0x2c')],_0x34d648;if(_0x19252f>=_0x3b3e84){_0x19252f=_0x3b3e84;_0x34d648=0xc8;}else{_0x34d648=0xce;}_0x29fc64[_0xbe14('0x2d')](_0x34d648);return _0x29fc64[_0xbe14('0x2e')](_0xbe14('0x2f'),_0x1c7cc7+'-'+_0x19252f+'/'+_0x3b3e84)[_0xbe14('0x29')](_0x3c3613);}return null;};}function patchUpdates(_0x10ae36){return function(_0x223f7a){try{jsonpatch[_0xbe14('0x30')](_0x223f7a,_0x10ae36,!![]);}catch(_0x6ba36c){return BPromise[_0xbe14('0x31')](_0x6ba36c);}return _0x223f7a[_0xbe14('0x32')]();};}function saveUpdates(_0x14e7c4,_0x581e86){return function(_0x2e33e1){if(_0x2e33e1){return _0x2e33e1['update'](_0x14e7c4)['then'](function(_0x46c2d1){return _0x46c2d1;});}return null;};}function removeEntity(_0x4c1e7e,_0x243524){return function(_0x345b0){if(_0x345b0){return _0x345b0['destroy']()['then'](function(){_0x4c1e7e['status'](0xcc)[_0xbe14('0x28')]();});}};}function handleEntityNotFound(_0xa3d24,_0x5f27b6){return function(_0x46c570){if(!_0x46c570){_0xa3d24[_0xbe14('0x27')](0x194);}return _0x46c570;};}function handleError(_0x452635,_0x1aa849){_0x1aa849=_0x1aa849||0x1f4;return function(_0x29c23e){logger['error'](_0x29c23e['stack']);if(_0x29c23e[_0xbe14('0x33')]){delete _0x29c23e['name'];}_0x452635['status'](_0x1aa849)['send'](_0x29c23e);};}exports[_0xbe14('0x34')]=function(_0x393f6b,_0x2bb45){var _0x3dbacb={},_0x172e79={},_0x29356f={'count':0x0,'rows':[]};var _0xcdc50=_[_0xbe14('0x35')](db[_0xbe14('0x36')][_0xbe14('0x37')],function(_0x41652d){return{'name':_0x41652d[_0xbe14('0x38')],'type':_0x41652d['type']['key']};});_0x172e79[_0xbe14('0x39')]=_[_0xbe14('0x35')](_0xcdc50,_0xbe14('0x33'));_0x172e79['query']=_[_0xbe14('0x3a')](_0x393f6b[_0xbe14('0x3b')]);_0x172e79[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],_0x172e79[_0xbe14('0x3b')]);_0x3dbacb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],qs['fields'](_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x3dbacb[_0xbe14('0x3e')]=_0x3dbacb[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x3dbacb[_0xbe14('0x3e')]:_0x172e79['model'];if(!_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x3dbacb[_0xbe14('0x2c')]=qs['limit'](_0x393f6b['query'][_0xbe14('0x2c')]);_0x3dbacb[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x393f6b['query']['offset']);}_0x3dbacb[_0xbe14('0x43')]=qs['sort'](_0x393f6b['query'][_0xbe14('0x44')]);_0x3dbacb[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x393f6b['query'],_0x172e79['filters']),_0xcdc50);if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x3dbacb[_0xbe14('0x45')]=_['merge'](_0x3dbacb[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0xcdc50,function(_0x32f22e){if(_0x32f22e[_0xbe14('0x47')]!=='VIRTUAL'){var _0x4a1a4b={};_0x4a1a4b[_0x32f22e[_0xbe14('0x33')]]={'$like':'%'+_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0x4a1a4b;}})});}_0x3dbacb=_[_0xbe14('0x48')]({},_0x3dbacb,_0x393f6b[_0xbe14('0x49')]);var _0x4f2d95={'where':_0x3dbacb['where']};return db[_0xbe14('0x36')][_0xbe14('0x2a')](_0x4f2d95)[_0xbe14('0x1c')](function(_0x2a3b35){_0x29356f['count']=_0x2a3b35;if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x4a')]){_0x3dbacb['include']=[{'all':!![]}];}return db[_0xbe14('0x36')][_0xbe14('0x4b')](_0x3dbacb);})[_0xbe14('0x1c')](function(_0x36c20c){_0x29356f['rows']=_0x36c20c;return _0x29356f;})['then'](respondWithFilteredResult(_0x2bb45,_0x3dbacb))[_0xbe14('0x26')](handleError(_0x2bb45,null));};exports[_0xbe14('0x4c')]=function(_0x4a1a37,_0x5acf90){var _0xca8cdb={'raw':![],'where':{'id':_0x4a1a37[_0xbe14('0x4d')]['id']}},_0x5d3726={};_0x5d3726[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x36')][_0xbe14('0x37')]);_0x5d3726['query']=_[_0xbe14('0x3a')](_0x4a1a37[_0xbe14('0x3b')]);_0x5d3726[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],_0x5d3726['query']);_0xca8cdb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x4a1a37[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0xca8cdb['attributes']=_0xca8cdb['attributes'][_0xbe14('0x40')]?_0xca8cdb[_0xbe14('0x3e')]:_0x5d3726[_0xbe14('0x39')];if(_0x4a1a37['query']['includeAll']){_0xca8cdb[_0xbe14('0x4e')]=[{'all':!![]}];}_0xca8cdb=_[_0xbe14('0x48')]({},_0xca8cdb,_0x4a1a37['options']);return db[_0xbe14('0x36')][_0xbe14('0x4f')](_0xca8cdb)['then'](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x1c')](respondWithResult(_0x5acf90,null))['catch'](handleError(_0x5acf90,null));};exports[_0xbe14('0x50')]=function(_0x410c59,_0x12a9de){return db['FreshdeskAccount'][_0xbe14('0x50')](_0x410c59[_0xbe14('0x51')],{})['then'](respondWithResult(_0x12a9de,0xc9))[_0xbe14('0x26')](handleError(_0x12a9de,null));};exports[_0xbe14('0x52')]=function(_0x2210cc,_0x20c48d){if(_0x2210cc[_0xbe14('0x51')]['id']){delete _0x2210cc['body']['id'];}return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x2210cc[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x20c48d,null))[_0xbe14('0x1c')](saveUpdates(_0x2210cc[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x20c48d,null))['catch'](handleError(_0x20c48d,null));};exports[_0xbe14('0x53')]=function(_0x1b47a4,_0x941ee2){return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x1b47a4[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x941ee2,null))[_0xbe14('0x1c')](removeEntity(_0x941ee2,null))[_0xbe14('0x26')](handleError(_0x941ee2,null));};exports[_0xbe14('0x54')]=function(_0x358950,_0x4bccfc,_0x56bcd3){var _0x58dd79={};var _0x10c0bc={};var _0x1bfcbf;var _0x2f4e52;return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x358950[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x4bccfc,null))[_0xbe14('0x1c')](function(_0x31d015){if(_0x31d015){_0x1bfcbf=_0x31d015;_0x10c0bc[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x56')][_0xbe14('0x37')]);_0x10c0bc[_0xbe14('0x3b')]=_[_0xbe14('0x3a')](_0x358950[_0xbe14('0x3b')]);_0x10c0bc[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],_0x10c0bc[_0xbe14('0x3b')]);_0x58dd79['attributes']=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x58dd79[_0xbe14('0x3e')]=_0x58dd79[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x58dd79[_0xbe14('0x3e')]:_0x10c0bc[_0xbe14('0x39')];_0x58dd79['order']=qs[_0xbe14('0x44')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x44')]);_0x58dd79[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x358950[_0xbe14('0x3b')],_0x10c0bc[_0xbe14('0x3c')]));if(_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x58dd79[_0xbe14('0x45')]=_['merge'](_0x58dd79[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0x58dd79[_0xbe14('0x3e')],function(_0x29bb26){var _0xaebce8={};_0xaebce8[_0x29bb26]={'$like':'%'+_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0xaebce8;})});}_0x58dd79=_[_0xbe14('0x48')]({},_0x58dd79,_0x358950['options']);return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x2fdf5d){if(_0x2fdf5d){_0x2f4e52=_0x2fdf5d[_0xbe14('0x40')];if(!_0x358950[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x58dd79['limit']=qs['limit'](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2c')]);_0x58dd79[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2b')]);}return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x50e644){if(_0x50e644){return _0x50e644?{'count':_0x2f4e52,'rows':_0x50e644}:null;}})['then'](respondWithResult(_0x4bccfc,null))[_0xbe14('0x26')](handleError(_0x4bccfc,null));};exports[_0xbe14('0x57')]=function(_0x29aa52,_0x57729f,_0x76e91e){if(_0x29aa52[_0xbe14('0x51')]['id']){delete _0x29aa52[_0xbe14('0x51')]['id'];}return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x29aa52[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x57729f,null))['then'](function(_0x43b817){if(_0x43b817){_0x29aa52[_0xbe14('0x51')][_0xbe14('0x58')]=_0x43b817['id'];_0x29aa52[_0xbe14('0x51')][_0xbe14('0x59')]=integrations[_0xbe14('0x5a')](_0x29aa52[_0xbe14('0x51')]['channel'],_0x29aa52[_0xbe14('0x51')][_0xbe14('0x47')]);_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5b')]=integrations[_0xbe14('0x5c')](_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5d')],_0x29aa52[_0xbe14('0x51')]['type']);return db[_0xbe14('0x56')][_0xbe14('0x50')](_0x29aa52[_0xbe14('0x51')],{'include':[{'model':db[_0xbe14('0x5e')],'as':_0xbe14('0x59')},{'model':db[_0xbe14('0x5e')],'as':'Descriptions'}]});}return null;})[_0xbe14('0x1c')](respondWithResult(_0x57729f,null))[_0xbe14('0x26')](handleError(_0x57729f,null));};exports[_0xbe14('0x5f')]=function(_0x1b23a1,_0x508455,_0x7e9e5c){var _0x1578b6='';return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x1b23a1[_0xbe14('0x4d')]['id']},'attributes':['id',_0xbe14('0x60'),_0xbe14('0x61')]})['then'](handleEntityNotFound(_0x508455,null))[_0xbe14('0x1c')](function(_0x589197){if(_0x589197){_0x1578b6=_0x589197[_0xbe14('0x60')];var _0x5d85d3=_0x1578b6[_0xbe14('0x62')](-0x1);if(_0x5d85d3==='/'){_0x1578b6=_0x1578b6[_0xbe14('0x63')](0x0,_0x1578b6[_0xbe14('0x64')](_0x5d85d3));}return rp({'method':'GET','uri':util[_0xbe14('0x65')](_0xbe14('0x66'),_0x1578b6,_0xbe14('0x67')),'headers':{'Authorization':util['format'](_0xbe14('0x68'),new Buffer(util[_0xbe14('0x65')](_0xbe14('0x69'),_0x589197[_0xbe14('0x61')]))['toString'](_0xbe14('0x6a')))},'json':!![]});}})[_0xbe14('0x1c')](function(_0x34f90b){if(_0x34f90b){var _0x2b2e0e=[_0xbe14('0x6b'),_0xbe14('0x6c'),_0xbe14('0x6d'),'description',_0xbe14('0x2d'),_0xbe14('0x6e'),_0xbe14('0x6f'),'source',_0xbe14('0x70'),_0xbe14('0x6f'),_0xbe14('0x71')];_['remove'](_0x34f90b,function(_0xa53262){return _0x2b2e0e[_0xbe14('0x72')](_0xa53262['name'])||!_0xa53262[_0xbe14('0x73')]&&_0xa53262['type']!==_0xbe14('0x74')&&_0xa53262[_0xbe14('0x47')]!=='custom_dropdown';});return{'count':_0x34f90b['length'],'rows':_[_0xbe14('0x35')](_0x34f90b,function(_0x3db955){return{'id':_0x3db955[_0xbe14('0x33')],'name':_0x3db955['label'],'custom':!_0x3db955[_0xbe14('0x73')],'options':_0x3db955[_0xbe14('0x75')]?_[_0xbe14('0x35')](_0x3db955[_0xbe14('0x75')],function(_0x5ee624){return{'name':_['capitalize'](_0x5ee624),'value':_0x5ee624};}):[]};})};}})[_0xbe14('0x1c')](respondWithResult(_0x508455,null))[_0xbe14('0x26')](function(_0xc8d0f6){var _0x215d5b=_0x1b23a1[_0xbe14('0x3b')][_0xbe14('0x19')]?0x1f4:_0xc8d0f6[_0xbe14('0x76')]||0x1f4;logger['error'](_0xbe14('0x77'),'getFields',_0x215d5b,JSON[_0xbe14('0x22')](_0xc8d0f6));delete _0xc8d0f6[_0xbe14('0x33')];if(_0x215d5b===0x191){_0x215d5b=0x190;}_0x508455[_0xbe14('0x2d')](_0x215d5b)[_0xbe14('0x78')](_0x1b23a1['query'][_0xbe14('0x19')]?{'message':_0xbe14('0x79'),'statusCode':_0xc8d0f6[_0xbe14('0x76')]}:_0xc8d0f6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6d9ff6a..2731077 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 _0x14a6=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xf40d11,_0xb4dd63){var _0x2c21c8=function(_0x14a2cc){while(--_0x14a2cc){_0xf40d11['push'](_0xf40d11['shift']());}};_0x2c21c8(++_0xb4dd63);}(_0x14a6,0x6f));var _0x614a=function(_0xf20b6,_0x49ddbb){_0xf20b6=_0xf20b6-0x0;var _0x4ff567=_0x14a6[_0xf20b6];return _0x4ff567;};'use strict';var _=require(_0x614a('0x0'));var util=require(_0x614a('0x1'));var logger=require(_0x614a('0x2'))(_0x614a('0x3'));var moment=require(_0x614a('0x4'));var BPromise=require(_0x614a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x614a('0x6'));var rimraf=require(_0x614a('0x7'));var config=require(_0x614a('0x8'));var attributes=require(_0x614a('0x9'));var integrations=require(_0x614a('0xa'));module[_0x614a('0xb')]=function(_0x2ba9c2,_0x2ae876){return _0x2ba9c2[_0x614a('0xc')](_0x614a('0xd'),attributes,{'tableName':_0x614a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x498f=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','api','moment','rimraf','../../config/environment'];(function(_0x191c42,_0x13fa6d){var _0x1b055f=function(_0x38f6bd){while(--_0x38f6bd){_0x191c42['push'](_0x191c42['shift']());}};_0x1b055f(++_0x13fa6d);}(_0x498f,0x100));var _0xf498=function(_0x58c766,_0x207d43){_0x58c766=_0x58c766-0x0;var _0x8d22b7=_0x498f[_0x58c766];return _0x8d22b7;};'use strict';var _=require(_0xf498('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf498('0x1'));var moment=require(_0xf498('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf498('0x3'));var config=require(_0xf498('0x4'));var attributes=require(_0xf498('0x5'));var integrations=require(_0xf498('0x6'));module['exports']=function(_0x740d41,_0x2523f0){return _0x740d41['define'](_0xf498('0x7'),attributes,{'tableName':_0xf498('0x8'),'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 945fa1f..9aa8f90 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 _0x3236=['../../config/utils','../../config/logger','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x39d83b,_0x1d8565){var _0x33a3d8=function(_0x51f039){while(--_0x51f039){_0x39d83b['push'](_0x39d83b['shift']());}};_0x33a3d8(++_0x1d8565);}(_0x3236,0xc0));var _0x6323=function(_0x1a126b,_0x200dca){_0x1a126b=_0x1a126b-0x0;var _0x3ef243=_0x3236[_0x1a126b];return _0x3ef243;};'use strict';var _=require(_0x6323('0x0'));var util=require(_0x6323('0x1'));var moment=require(_0x6323('0x2'));var BPromise=require(_0x6323('0x3'));var rs=require(_0x6323('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6323('0x5'))['db'];var utils=require(_0x6323('0x6'));var logger=require(_0x6323('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6323('0x8')][_0x6323('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ddfc,_0x22c73e,_0x8913f9){return new BPromise(function(_0xd71fca,_0x4298a5){return client['request'](_0x30ddfc,_0x8913f9)[_0x6323('0xa')](function(_0xbfb7d2){logger[_0x6323('0xb')](_0x6323('0xc'),_0x22c73e,'request\x20sent');logger[_0x6323('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x22c73e,_0x6323('0xe'),JSON[_0x6323('0xf')](_0xbfb7d2));if(_0xbfb7d2['error']){if(_0xbfb7d2[_0x6323('0x10')]['code']===0x1f4){logger[_0x6323('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x22c73e,_0xbfb7d2['error'][_0x6323('0x11')]);return _0x4298a5(_0xbfb7d2['error'][_0x6323('0x11')]);}logger[_0x6323('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x22c73e,_0xbfb7d2[_0x6323('0x10')][_0x6323('0x11')]);return _0xd71fca(_0xbfb7d2[_0x6323('0x10')][_0x6323('0x11')]);}else{logger[_0x6323('0xb')](_0x6323('0xc'),_0x22c73e,_0x6323('0xe'));_0xd71fca(_0xbfb7d2[_0x6323('0x12')][_0x6323('0x11')]);}})['catch'](function(_0x367f1c){logger[_0x6323('0x10')](_0x6323('0xc'),_0x22c73e,_0x367f1c);_0x4298a5(_0x367f1c);});});}exports[_0x6323('0x13')]=function(_0x27ad83){var _0x435956=this;return new Promise(function(_0x51b5f0,_0x446eb6){return db[_0x6323('0x14')][_0x6323('0x15')]({'raw':_0x27ad83[_0x6323('0x16')]?_0x27ad83[_0x6323('0x16')][_0x6323('0x17')]===undefined?!![]:![]:!![],'where':_0x27ad83['options']?_0x27ad83[_0x6323('0x16')][_0x6323('0x18')]||null:null,'attributes':_0x27ad83[_0x6323('0x16')]?_0x27ad83[_0x6323('0x16')][_0x6323('0x19')]||null:null,'limit':_0x27ad83[_0x6323('0x16')]?_0x27ad83[_0x6323('0x16')][_0x6323('0x1a')]||null:null,'include':_0x27ad83[_0x6323('0x16')]?_0x27ad83[_0x6323('0x16')][_0x6323('0x1b')]?_[_0x6323('0x1c')](_0x27ad83[_0x6323('0x16')][_0x6323('0x1b')],function(_0x165114){return{'model':db[_0x165114[_0x6323('0x1d')]],'as':_0x165114['as'],'attributes':_0x165114[_0x6323('0x19')],'include':_0x165114[_0x6323('0x1b')]?_[_0x6323('0x1c')](_0x165114[_0x6323('0x1b')],function(_0x327bcd){return{'model':db[_0x327bcd['model']],'as':_0x327bcd['as'],'attributes':_0x327bcd[_0x6323('0x19')],'include':_0x327bcd[_0x6323('0x1b')]?_[_0x6323('0x1c')](_0x327bcd[_0x6323('0x1b')],function(_0x46beba){return{'model':db[_0x46beba['model']],'as':_0x46beba['as'],'attributes':_0x46beba[_0x6323('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aadf5){logger[_0x6323('0xb')](_0x6323('0x13'),_0x27ad83);logger[_0x6323('0xd')](_0x6323('0x13'),_0x27ad83,JSON['stringify'](_0x4aadf5));_0x51b5f0(_0x4aadf5);})[_0x6323('0x1e')](function(_0x5d410a){logger[_0x6323('0x10')](_0x6323('0x13'),_0x5d410a[_0x6323('0x11')],_0x27ad83);_0x446eb6(_0x435956[_0x6323('0x10')](0x1f4,_0x5d410a['message']));});});};exports[_0x6323('0x1f')]=function(_0x4b8848){var _0x317866=this;return new Promise(function(_0x93185c,_0x25d21d){return db[_0x6323('0x14')][_0x6323('0x20')]({'raw':_0x4b8848[_0x6323('0x16')]?_0x4b8848[_0x6323('0x16')][_0x6323('0x17')]===undefined?!![]:![]:!![],'where':_0x4b8848['options']?_0x4b8848[_0x6323('0x16')]['where']||null:null,'attributes':_0x4b8848[_0x6323('0x16')]?_0x4b8848[_0x6323('0x16')][_0x6323('0x19')]||null:null,'include':_0x4b8848[_0x6323('0x16')]?_0x4b8848[_0x6323('0x16')]['include']?_[_0x6323('0x1c')](_0x4b8848[_0x6323('0x16')][_0x6323('0x1b')],function(_0xd06fd4){return{'model':db[_0xd06fd4[_0x6323('0x1d')]],'as':_0xd06fd4['as'],'attributes':_0xd06fd4['attributes'],'include':_0xd06fd4[_0x6323('0x1b')]?_[_0x6323('0x1c')](_0xd06fd4[_0x6323('0x1b')],function(_0x5e9a58){return{'model':db[_0x5e9a58[_0x6323('0x1d')]],'as':_0x5e9a58['as'],'attributes':_0x5e9a58[_0x6323('0x19')],'include':_0x5e9a58[_0x6323('0x1b')]?_[_0x6323('0x1c')](_0x5e9a58[_0x6323('0x1b')],function(_0x59c044){return{'model':db[_0x59c044[_0x6323('0x1d')]],'as':_0x59c044['as'],'attributes':_0x59c044[_0x6323('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6323('0xa')](function(_0x366785){logger[_0x6323('0xb')]('ShowFreshdeskAccount',_0x4b8848);logger[_0x6323('0xd')](_0x6323('0x1f'),_0x4b8848,JSON[_0x6323('0xf')](_0x366785));_0x93185c(_0x366785);})['catch'](function(_0x2c3505){logger['error']('ShowFreshdeskAccount',_0x2c3505[_0x6323('0x11')],_0x4b8848);_0x25d21d(_0x317866['error'](0x1f4,_0x2c3505[_0x6323('0x11')]));});});}; \ No newline at end of file +var _0x8e1f=['message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x8e1f,0x101));var _0xf8e1=function(_0x1421c3,_0x3cb122){_0x1421c3=_0x1421c3-0x0;var _0x4b791d=_0x8e1f[_0x1421c3];return _0x4b791d;};'use strict';var _=require(_0xf8e1('0x0'));var util=require(_0xf8e1('0x1'));var moment=require(_0xf8e1('0x2'));var BPromise=require(_0xf8e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8e1('0x4'));var logger=require(_0xf8e1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf8e1('0x6'));var client=jayson[_0xf8e1('0x7')][_0xf8e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ca9bd,_0x388237,_0x48331c){return new BPromise(function(_0x50fda3,_0x445c8b){return client[_0xf8e1('0x9')](_0x5ca9bd,_0x48331c)['then'](function(_0xe403e2){logger['info'](_0xf8e1('0xa'),_0x388237,_0xf8e1('0xb'));logger['debug'](_0xf8e1('0xc'),_0x388237,_0xf8e1('0xb'),JSON['stringify'](_0xe403e2));if(_0xe403e2[_0xf8e1('0xd')]){if(_0xe403e2['error'][_0xf8e1('0xe')]===0x1f4){logger[_0xf8e1('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x388237,_0xe403e2[_0xf8e1('0xd')][_0xf8e1('0xf')]);return _0x445c8b(_0xe403e2[_0xf8e1('0xd')][_0xf8e1('0xf')]);}logger[_0xf8e1('0xd')](_0xf8e1('0xa'),_0x388237,_0xe403e2['error']['message']);return _0x50fda3(_0xe403e2['error']['message']);}else{logger[_0xf8e1('0x10')](_0xf8e1('0xa'),_0x388237,_0xf8e1('0xb'));_0x50fda3(_0xe403e2[_0xf8e1('0x11')]['message']);}})[_0xf8e1('0x12')](function(_0x57604b){logger['error'](_0xf8e1('0xa'),_0x388237,_0x57604b);_0x445c8b(_0x57604b);});});}exports[_0xf8e1('0x13')]=function(_0x3f056a){var _0x468cdd=this;return new Promise(function(_0x4e2431,_0x582a32){return db[_0xf8e1('0x14')]['findAll']({'raw':_0x3f056a[_0xf8e1('0x15')]?_0x3f056a['options'][_0xf8e1('0x16')]===undefined?!![]:![]:!![],'where':_0x3f056a[_0xf8e1('0x15')]?_0x3f056a['options'][_0xf8e1('0x17')]||null:null,'attributes':_0x3f056a[_0xf8e1('0x15')]?_0x3f056a[_0xf8e1('0x15')][_0xf8e1('0x18')]||null:null,'limit':_0x3f056a['options']?_0x3f056a[_0xf8e1('0x15')][_0xf8e1('0x19')]||null:null,'include':_0x3f056a[_0xf8e1('0x15')]?_0x3f056a['options'][_0xf8e1('0x1a')]?_['map'](_0x3f056a[_0xf8e1('0x15')][_0xf8e1('0x1a')],function(_0x3ea9a1){return{'model':db[_0x3ea9a1['model']],'as':_0x3ea9a1['as'],'attributes':_0x3ea9a1[_0xf8e1('0x18')],'include':_0x3ea9a1['include']?_[_0xf8e1('0x1b')](_0x3ea9a1['include'],function(_0x27b4bf){return{'model':db[_0x27b4bf[_0xf8e1('0x1c')]],'as':_0x27b4bf['as'],'attributes':_0x27b4bf['attributes'],'include':_0x27b4bf['include']?_[_0xf8e1('0x1b')](_0x27b4bf[_0xf8e1('0x1a')],function(_0x1a2393){return{'model':db[_0x1a2393[_0xf8e1('0x1c')]],'as':_0x1a2393['as'],'attributes':_0x1a2393[_0xf8e1('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf8e1('0x1d')](function(_0x112d53){logger[_0xf8e1('0x10')]('GetFreshdeskAccount',_0x3f056a);logger[_0xf8e1('0x1e')]('GetFreshdeskAccount',_0x3f056a,JSON[_0xf8e1('0x1f')](_0x112d53));_0x4e2431(_0x112d53);})[_0xf8e1('0x12')](function(_0x2dcf65){logger[_0xf8e1('0xd')](_0xf8e1('0x13'),_0x2dcf65[_0xf8e1('0xf')],_0x3f056a);_0x582a32(_0x468cdd[_0xf8e1('0xd')](0x1f4,_0x2dcf65[_0xf8e1('0xf')]));});});};exports['ShowFreshdeskAccount']=function(_0x4b3152){var _0x2fa002=this;return new Promise(function(_0x308964,_0x1f1928){return db[_0xf8e1('0x14')][_0xf8e1('0x20')]({'raw':_0x4b3152[_0xf8e1('0x15')]?_0x4b3152[_0xf8e1('0x15')][_0xf8e1('0x16')]===undefined?!![]:![]:!![],'where':_0x4b3152['options']?_0x4b3152[_0xf8e1('0x15')]['where']||null:null,'attributes':_0x4b3152[_0xf8e1('0x15')]?_0x4b3152[_0xf8e1('0x15')][_0xf8e1('0x18')]||null:null,'include':_0x4b3152[_0xf8e1('0x15')]?_0x4b3152[_0xf8e1('0x15')][_0xf8e1('0x1a')]?_[_0xf8e1('0x1b')](_0x4b3152[_0xf8e1('0x15')][_0xf8e1('0x1a')],function(_0x1fc3e6){return{'model':db[_0x1fc3e6[_0xf8e1('0x1c')]],'as':_0x1fc3e6['as'],'attributes':_0x1fc3e6['attributes'],'include':_0x1fc3e6[_0xf8e1('0x1a')]?_[_0xf8e1('0x1b')](_0x1fc3e6['include'],function(_0x5cee23){return{'model':db[_0x5cee23[_0xf8e1('0x1c')]],'as':_0x5cee23['as'],'attributes':_0x5cee23[_0xf8e1('0x18')],'include':_0x5cee23['include']?_[_0xf8e1('0x1b')](_0x5cee23[_0xf8e1('0x1a')],function(_0xcfff3f){return{'model':db[_0xcfff3f[_0xf8e1('0x1c')]],'as':_0xcfff3f['as'],'attributes':_0xcfff3f[_0xf8e1('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf8e1('0x1d')](function(_0x29d860){logger[_0xf8e1('0x10')]('ShowFreshdeskAccount',_0x4b3152);logger[_0xf8e1('0x1e')](_0xf8e1('0x21'),_0x4b3152,JSON[_0xf8e1('0x1f')](_0x29d860));_0x308964(_0x29d860);})['catch'](function(_0x10eef6){logger[_0xf8e1('0xd')](_0xf8e1('0x21'),_0x10eef6[_0xf8e1('0xf')],_0x4b3152);_0x1f1928(_0x2fa002[_0xf8e1('0xd')](0x1f4,_0x10eef6[_0xf8e1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c28c70f..77878b1 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 _0x45f9=['/:id/descriptions','getTags','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x156913,_0x2700bc){var _0x3781aa=function(_0x594527){while(--_0x594527){_0x156913['push'](_0x156913['shift']());}};_0x3781aa(++_0x2700bc);}(_0x45f9,0x79));var _0x945f=function(_0x22d210,_0x2c1dfc){_0x22d210=_0x22d210-0x0;var _0x394e97=_0x45f9[_0x22d210];return _0x394e97;};'use strict';var multer=require(_0x945f('0x0'));var util=require(_0x945f('0x1'));var path=require(_0x945f('0x2'));var timeout=require(_0x945f('0x3'));var express=require(_0x945f('0x4'));var router=express['Router']();var auth=require(_0x945f('0x5'));var interaction=require(_0x945f('0x6'));var config=require(_0x945f('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x945f('0x8')]('/',auth[_0x945f('0x9')](),controller[_0x945f('0xa')]);router[_0x945f('0x8')](_0x945f('0xb'),auth[_0x945f('0x9')](),controller[_0x945f('0xc')]);router['get'](_0x945f('0xd'),auth[_0x945f('0x9')](),controller[_0x945f('0xe')]);router['get'](_0x945f('0xf'),auth[_0x945f('0x9')](),controller[_0x945f('0x10')]);router['get'](_0x945f('0x11'),auth[_0x945f('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x945f('0x9')](),controller[_0x945f('0x12')]);router[_0x945f('0x13')]('/',auth[_0x945f('0x9')](),controller['create']);router[_0x945f('0x13')]('/:id/tags',auth[_0x945f('0x9')](),controller['setTags']);router[_0x945f('0x14')](_0x945f('0xb'),auth[_0x945f('0x9')](),controller[_0x945f('0x15')]);router[_0x945f('0x16')](_0x945f('0xb'),auth[_0x945f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c82=['post','setTags','put','update','destroy','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags'];(function(_0x3fc59a,_0x5c0c1d){var _0x2af724=function(_0xa23f3e){while(--_0xa23f3e){_0x3fc59a['push'](_0x3fc59a['shift']());}};_0x2af724(++_0x5c0c1d);}(_0x4c82,0xb5));var _0x24c8=function(_0x4db341,_0xb12794){_0x4db341=_0x4db341-0x0;var _0x193cb0=_0x4c82[_0x4db341];return _0x193cb0;};'use strict';var multer=require(_0x24c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x24c8('0x1'));var express=require('express');var router=express[_0x24c8('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x24c8('0x3'));var config=require(_0x24c8('0x4'));var controller=require(_0x24c8('0x5'));router['get']('/',auth[_0x24c8('0x6')](),controller[_0x24c8('0x7')]);router[_0x24c8('0x8')](_0x24c8('0x9'),auth['isAuthenticated'](),controller[_0x24c8('0xa')]);router['get'](_0x24c8('0xb'),auth[_0x24c8('0x6')](),controller['getFields']);router[_0x24c8('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x24c8('0xc')]);router['get'](_0x24c8('0xd'),auth[_0x24c8('0x6')](),controller[_0x24c8('0xe')]);router[_0x24c8('0x8')](_0x24c8('0xf'),auth[_0x24c8('0x6')](),controller[_0x24c8('0x10')]);router[_0x24c8('0x11')]('/',auth[_0x24c8('0x6')](),controller['create']);router[_0x24c8('0x11')]('/:id/tags',auth[_0x24c8('0x6')](),controller[_0x24c8('0x12')]);router[_0x24c8('0x13')](_0x24c8('0x9'),auth['isAuthenticated'](),controller[_0x24c8('0x14')]);router['delete'](_0x24c8('0x9'),auth[_0x24c8('0x6')](),controller[_0x24c8('0x15')]);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 3e7f526..5dac657 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 _0x1cfe=['STRING'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x1cfe,0x1f1));var _0xe1cf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1cfe[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe1cf('0x0')]},'description':{'type':Sequelize[_0xe1cf('0x0')]}}; \ No newline at end of file +var _0xbf5b=['STRING','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbf5b,0x1b9));var _0xbbf5=function(_0x360dc2,_0x843dd0){_0x360dc2=_0x360dc2-0x0;var _0x32817d=_0xbf5b[_0x360dc2];return _0x32817d;};'use strict';var Sequelize=require('sequelize');module[_0xbbf5('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbbf5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 140b08c..2deb5ab 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 _0x7b4c=['../../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','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','status','end','json','count','offset','set','Content-Range','apply','reject','update','sendStatus','stack','name','send','index','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','merge','where','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','getFields','findOne','order','getSubjects','FreshdeskField','rawAttributes','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x20b30f,_0x1a44f4){var _0x3fbda1=function(_0x19d504){while(--_0x19d504){_0x20b30f['push'](_0x20b30f['shift']());}};_0x3fbda1(++_0x1a44f4);}(_0x7b4c,0x1dc));var _0xc7b4=function(_0x340a89,_0x485978){_0x340a89=_0x340a89-0x0;var _0x598a4e=_0x7b4c[_0x340a89];return _0x598a4e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc7b4('0x0'));var rimraf=require(_0xc7b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc7b4('0x2'));var rp=require(_0xc7b4('0x3'));var moment=require(_0xc7b4('0x4'));var BPromise=require(_0xc7b4('0x5'));var Mustache=require(_0xc7b4('0x6'));var util=require(_0xc7b4('0x7'));var path=require('path');var sox=require(_0xc7b4('0x8'));var csv=require(_0xc7b4('0x9'));var ejs=require(_0xc7b4('0xa'));var fs=require('fs');var _=require(_0xc7b4('0xb'));var squel=require('squel');var crypto=require(_0xc7b4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc7b4('0xd'));var toCsv=require(_0xc7b4('0x9'));var querystring=require(_0xc7b4('0xe'));var Papa=require(_0xc7b4('0xf'));var Redis=require(_0xc7b4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc7b4('0x11'));var as=require(_0xc7b4('0x12'));var hardwareService=require(_0xc7b4('0x13'));var logger=require(_0xc7b4('0x14'))(_0xc7b4('0x15'));var utils=require(_0xc7b4('0x16'));var config=require(_0xc7b4('0x17'));var db=require(_0xc7b4('0x18'))['db'];var jayson=require(_0xc7b4('0x19'));var client=jayson[_0xc7b4('0x1a')][_0xc7b4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x270364,_0x4816ec,_0x12c888){if(_0x12c888){var _0x16f85f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16f85f[_0xc7b4('0x1c')](_0x4816ec)){return _0x270364;}else{throw new db[(_0xc7b4('0x1d'))][(_0xc7b4('0x1e'))](_0xc7b4('0x1f'));}}else{return _0x270364;}}function respondWithRpcPromise(_0x38f781,_0x4fd0ad,_0x348d57,_0x4465a6){return new BPromise(function(_0x14e753,_0x44fb17){var _0x46ba76=_0x4465a6||client;return _0x46ba76[_0xc7b4('0x20')](_0x38f781,_0x348d57)[_0xc7b4('0x21')](function(_0x4b7433){logger[_0xc7b4('0x22')](_0xc7b4('0x23'),_0x4fd0ad,_0xc7b4('0x24'));logger[_0xc7b4('0x25')](_0xc7b4('0x26'),_0x4fd0ad,_0xc7b4('0x24'),JSON['stringify'](_0x4b7433));if(_0x4b7433[_0xc7b4('0x27')]){if(_0x4b7433[_0xc7b4('0x27')]['code']===0x1f4){logger[_0xc7b4('0x27')](_0xc7b4('0x23'),_0x4fd0ad,_0x4b7433['error'][_0xc7b4('0x28')]);return _0x44fb17(_0x4b7433[_0xc7b4('0x27')][_0xc7b4('0x28')]);}logger[_0xc7b4('0x27')](_0xc7b4('0x23'),_0x4fd0ad,_0x4b7433[_0xc7b4('0x27')]['message']);return _0x14e753(_0x4b7433[_0xc7b4('0x27')]['message']);}else{logger[_0xc7b4('0x22')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4fd0ad,_0xc7b4('0x24'));_0x14e753(_0x4b7433['result']['message']);}})[_0xc7b4('0x29')](function(_0x22045){logger['error'](_0xc7b4('0x23'),_0x4fd0ad,_0x22045);_0x44fb17(_0x22045);});});}function respondWithStatusCode(_0x5936a6,_0x169cf2){_0x169cf2=_0x169cf2||0xcc;return function(_0x274374){if(_0x274374){return _0x5936a6['sendStatus'](_0x169cf2);}return _0x5936a6[_0xc7b4('0x2a')](_0x169cf2)[_0xc7b4('0x2b')]();};}function respondWithResult(_0x1fcb34,_0x56c2ea){_0x56c2ea=_0x56c2ea||0xc8;return function(_0x860c57){if(_0x860c57){return _0x1fcb34[_0xc7b4('0x2a')](_0x56c2ea)[_0xc7b4('0x2c')](_0x860c57);}};}function respondWithFilteredResult(_0xb8ad13,_0x5b8ca6){return function(_0x3c6fcf){if(_0x3c6fcf){var _0x12d4e5=_0x3c6fcf[_0xc7b4('0x2d')],_0x17b935=_0x5b8ca6[_0xc7b4('0x2e')],_0xd86062=_0x5b8ca6[_0xc7b4('0x2e')]+_0x5b8ca6['limit'],_0x2e6e4f;if(_0xd86062>=_0x12d4e5){_0xd86062=_0x12d4e5;_0x2e6e4f=0xc8;}else{_0x2e6e4f=0xce;}_0xb8ad13[_0xc7b4('0x2a')](_0x2e6e4f);return _0xb8ad13[_0xc7b4('0x2f')](_0xc7b4('0x30'),_0x17b935+'-'+_0xd86062+'/'+_0x12d4e5)[_0xc7b4('0x2c')](_0x3c6fcf);}return null;};}function patchUpdates(_0x1ceda1){return function(_0x2caf57){try{jsonpatch[_0xc7b4('0x31')](_0x2caf57,_0x1ceda1,!![]);}catch(_0x568b6){return BPromise[_0xc7b4('0x32')](_0x568b6);}return _0x2caf57['save']();};}function saveUpdates(_0x3009b5,_0x46c336){return function(_0x18d88f){if(_0x18d88f){return _0x18d88f[_0xc7b4('0x33')](_0x3009b5)['then'](function(_0x4ae0ce){return _0x4ae0ce;});}return null;};}function removeEntity(_0x30231f,_0x1bd5ed){return function(_0x3d510e){if(_0x3d510e){return _0x3d510e['destroy']()[_0xc7b4('0x21')](function(){_0x30231f[_0xc7b4('0x2a')](0xcc)[_0xc7b4('0x2b')]();});}};}function handleEntityNotFound(_0x575191,_0x3bed31){return function(_0x3066d6){if(!_0x3066d6){_0x575191[_0xc7b4('0x34')](0x194);}return _0x3066d6;};}function handleError(_0x34956e,_0x540ac7){_0x540ac7=_0x540ac7||0x1f4;return function(_0x24d671){logger[_0xc7b4('0x27')](_0x24d671[_0xc7b4('0x35')]);if(_0x24d671[_0xc7b4('0x36')]){delete _0x24d671[_0xc7b4('0x36')];}_0x34956e[_0xc7b4('0x2a')](_0x540ac7)[_0xc7b4('0x37')](_0x24d671);};}exports[_0xc7b4('0x38')]=function(_0x42cfce,_0x47f888){var _0x216d50={},_0x188e50={},_0x578957={'count':0x0,'rows':[]};var _0x2652d2=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x271396){return{'name':_0x271396[_0xc7b4('0x39')],'type':_0x271396['type'][_0xc7b4('0x3a')]};});_0x188e50[_0xc7b4('0x3b')]=_[_0xc7b4('0x3c')](_0x2652d2,_0xc7b4('0x36'));_0x188e50['query']=_[_0xc7b4('0x3d')](_0x42cfce[_0xc7b4('0x3e')]);_0x188e50[_0xc7b4('0x3f')]=_['intersection'](_0x188e50['model'],_0x188e50[_0xc7b4('0x3e')]);_0x216d50[_0xc7b4('0x40')]=_[_0xc7b4('0x41')](_0x188e50[_0xc7b4('0x3b')],qs[_0xc7b4('0x42')](_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x42')]));_0x216d50[_0xc7b4('0x40')]=_0x216d50['attributes']['length']?_0x216d50[_0xc7b4('0x40')]:_0x188e50[_0xc7b4('0x3b')];if(!_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x43')](_0xc7b4('0x44'))){_0x216d50['limit']=qs['limit'](_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x45')]);_0x216d50[_0xc7b4('0x2e')]=qs[_0xc7b4('0x2e')](_0x42cfce[_0xc7b4('0x3e')]['offset']);}_0x216d50['order']=qs['sort'](_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x46')]);_0x216d50['where']=qs[_0xc7b4('0x3f')](_[_0xc7b4('0x47')](_0x42cfce['query'],_0x188e50[_0xc7b4('0x3f')]),_0x2652d2);if(_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x48')]){_0x216d50['where']=_[_0xc7b4('0x49')](_0x216d50[_0xc7b4('0x4a')],{'$or':_[_0xc7b4('0x3c')](_0x2652d2,function(_0x437886){if(_0x437886['type']!==_0xc7b4('0x4b')){var _0x7fb738={};_0x7fb738[_0x437886['name']]={'$like':'%'+_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x48')]+'%'};return _0x7fb738;}})});}_0x216d50=_[_0xc7b4('0x49')]({},_0x216d50,_0x42cfce[_0xc7b4('0x4c')]);var _0x5af25c={'where':_0x216d50['where']};return db[_0xc7b4('0x4d')]['count'](_0x5af25c)['then'](function(_0x5e57d0){_0x578957[_0xc7b4('0x2d')]=_0x5e57d0;if(_0x42cfce[_0xc7b4('0x3e')][_0xc7b4('0x4e')]){_0x216d50[_0xc7b4('0x4f')]=[{'all':!![]}];}return db[_0xc7b4('0x4d')][_0xc7b4('0x50')](_0x216d50);})['then'](function(_0x3d0508){_0x578957[_0xc7b4('0x51')]=_0x3d0508;return _0x578957;})[_0xc7b4('0x21')](respondWithFilteredResult(_0x47f888,_0x216d50))['catch'](handleError(_0x47f888,null));};exports[_0xc7b4('0x52')]=function(_0x4b9f30,_0x37c3d9){var _0x29e679={'raw':![],'where':{'id':_0x4b9f30[_0xc7b4('0x53')]['id']}},_0x4b1da3={};_0x4b1da3[_0xc7b4('0x3b')]=_[_0xc7b4('0x3d')](db['FreshdeskConfiguration']['rawAttributes']);_0x4b1da3[_0xc7b4('0x3e')]=_[_0xc7b4('0x3d')](_0x4b9f30['query']);_0x4b1da3[_0xc7b4('0x3f')]=_['intersection'](_0x4b1da3[_0xc7b4('0x3b')],_0x4b1da3[_0xc7b4('0x3e')]);_0x29e679[_0xc7b4('0x40')]=_[_0xc7b4('0x41')](_0x4b1da3[_0xc7b4('0x3b')],qs['fields'](_0x4b9f30['query'][_0xc7b4('0x42')]));_0x29e679['attributes']=_0x29e679[_0xc7b4('0x40')][_0xc7b4('0x54')]?_0x29e679[_0xc7b4('0x40')]:_0x4b1da3['model'];if(_0x4b9f30[_0xc7b4('0x3e')][_0xc7b4('0x4e')]){_0x29e679[_0xc7b4('0x4f')]=[{'all':!![]}];}_0x29e679=_[_0xc7b4('0x49')]({},_0x29e679,_0x4b9f30[_0xc7b4('0x4c')]);return db['FreshdeskConfiguration'][_0xc7b4('0x55')](_0x29e679)['then'](handleEntityNotFound(_0x37c3d9,null))['then'](respondWithResult(_0x37c3d9,null))[_0xc7b4('0x29')](handleError(_0x37c3d9,null));};exports['create']=function(_0x20e1ad,_0xd3337a){return db[_0xc7b4('0x4d')][_0xc7b4('0x56')](_0x20e1ad['body'],{})[_0xc7b4('0x21')](respondWithResult(_0xd3337a,0xc9))['catch'](handleError(_0xd3337a,null));};exports[_0xc7b4('0x33')]=function(_0x435e53,_0x2c7eb1){if(_0x435e53[_0xc7b4('0x57')]['id']){delete _0x435e53[_0xc7b4('0x57')]['id'];}return db[_0xc7b4('0x4d')][_0xc7b4('0x55')]({'where':{'id':_0x435e53[_0xc7b4('0x53')]['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x2c7eb1,null))['then'](saveUpdates(_0x435e53['body'],null))[_0xc7b4('0x21')](respondWithResult(_0x2c7eb1,null))[_0xc7b4('0x29')](handleError(_0x2c7eb1,null));};exports[_0xc7b4('0x58')]=function(_0x321162,_0x45cac8){return db[_0xc7b4('0x4d')][_0xc7b4('0x55')]({'where':{'id':_0x321162[_0xc7b4('0x53')]['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x45cac8,null))[_0xc7b4('0x21')](removeEntity(_0x45cac8,null))[_0xc7b4('0x29')](handleError(_0x45cac8,null));};exports[_0xc7b4('0x59')]=function(_0x154ed8,_0x47b1bb,_0x19352a){var _0x2c9ac9={};var _0x54cc99={};var _0x361d62;var _0xd6d004;return db[_0xc7b4('0x4d')][_0xc7b4('0x5a')]({'where':{'id':_0x154ed8[_0xc7b4('0x53')]['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x47b1bb,null))['then'](function(_0x3f9590){if(_0x3f9590){_0x361d62=_0x3f9590;_0x54cc99['model']=_['keys'](db['FreshdeskField']['rawAttributes']);_0x54cc99[_0xc7b4('0x3e')]=_[_0xc7b4('0x3d')](_0x154ed8[_0xc7b4('0x3e')]);_0x54cc99[_0xc7b4('0x3f')]=_[_0xc7b4('0x41')](_0x54cc99[_0xc7b4('0x3b')],_0x54cc99[_0xc7b4('0x3e')]);_0x2c9ac9[_0xc7b4('0x40')]=_[_0xc7b4('0x41')](_0x54cc99[_0xc7b4('0x3b')],qs[_0xc7b4('0x42')](_0x154ed8[_0xc7b4('0x3e')]['fields']));_0x2c9ac9[_0xc7b4('0x40')]=_0x2c9ac9['attributes'][_0xc7b4('0x54')]?_0x2c9ac9[_0xc7b4('0x40')]:_0x54cc99['model'];_0x2c9ac9[_0xc7b4('0x5b')]=qs[_0xc7b4('0x46')](_0x154ed8[_0xc7b4('0x3e')][_0xc7b4('0x46')]);_0x2c9ac9[_0xc7b4('0x4a')]=qs[_0xc7b4('0x3f')](_[_0xc7b4('0x47')](_0x154ed8['query'],_0x54cc99['filters']));if(_0x154ed8['query'][_0xc7b4('0x48')]){_0x2c9ac9[_0xc7b4('0x4a')]=_[_0xc7b4('0x49')](_0x2c9ac9[_0xc7b4('0x4a')],{'$or':_[_0xc7b4('0x3c')](_0x2c9ac9[_0xc7b4('0x40')],function(_0x47e5fc){var _0x4a65db={};_0x4a65db[_0x47e5fc]={'$like':'%'+_0x154ed8[_0xc7b4('0x3e')][_0xc7b4('0x48')]+'%'};return _0x4a65db;})});}_0x2c9ac9=_[_0xc7b4('0x49')]({},_0x2c9ac9,_0x154ed8[_0xc7b4('0x4c')]);return _0x361d62[_0xc7b4('0x59')](_0x2c9ac9);}})[_0xc7b4('0x21')](function(_0x354db8){if(_0x354db8){_0xd6d004=_0x354db8[_0xc7b4('0x54')];if(!_0x154ed8[_0xc7b4('0x3e')][_0xc7b4('0x43')](_0xc7b4('0x44'))){_0x2c9ac9['limit']=qs[_0xc7b4('0x45')](_0x154ed8[_0xc7b4('0x3e')][_0xc7b4('0x45')]);_0x2c9ac9[_0xc7b4('0x2e')]=qs['offset'](_0x154ed8['query'][_0xc7b4('0x2e')]);}return _0x361d62[_0xc7b4('0x59')](_0x2c9ac9);}})[_0xc7b4('0x21')](function(_0x47ceda){if(_0x47ceda){return _0x47ceda?{'count':_0xd6d004,'rows':_0x47ceda}:null;}})['then'](respondWithResult(_0x47b1bb,null))[_0xc7b4('0x29')](handleError(_0x47b1bb,null));};exports[_0xc7b4('0x5c')]=function(_0x2759ad,_0x589a0a,_0x35af34){var _0x4f379b={};var _0x5af8d5={};var _0x17aeb6;var _0x158b1e;return db[_0xc7b4('0x4d')][_0xc7b4('0x5a')]({'where':{'id':_0x2759ad['params']['id']}})['then'](handleEntityNotFound(_0x589a0a,null))[_0xc7b4('0x21')](function(_0x5772ea){if(_0x5772ea){_0x17aeb6=_0x5772ea;_0x5af8d5[_0xc7b4('0x3b')]=_[_0xc7b4('0x3d')](db[_0xc7b4('0x5d')][_0xc7b4('0x5e')]);_0x5af8d5['query']=_[_0xc7b4('0x3d')](_0x2759ad['query']);_0x5af8d5['filters']=_[_0xc7b4('0x41')](_0x5af8d5[_0xc7b4('0x3b')],_0x5af8d5['query']);_0x4f379b[_0xc7b4('0x40')]=_[_0xc7b4('0x41')](_0x5af8d5['model'],qs[_0xc7b4('0x42')](_0x2759ad['query'][_0xc7b4('0x42')]));_0x4f379b[_0xc7b4('0x40')]=_0x4f379b[_0xc7b4('0x40')][_0xc7b4('0x54')]?_0x4f379b[_0xc7b4('0x40')]:_0x5af8d5['model'];_0x4f379b[_0xc7b4('0x5b')]=qs[_0xc7b4('0x46')](_0x2759ad[_0xc7b4('0x3e')][_0xc7b4('0x46')]);_0x4f379b[_0xc7b4('0x4a')]=qs[_0xc7b4('0x3f')](_[_0xc7b4('0x47')](_0x2759ad[_0xc7b4('0x3e')],_0x5af8d5['filters']));if(_0x2759ad[_0xc7b4('0x3e')][_0xc7b4('0x48')]){_0x4f379b[_0xc7b4('0x4a')]=_[_0xc7b4('0x49')](_0x4f379b[_0xc7b4('0x4a')],{'$or':_[_0xc7b4('0x3c')](_0x4f379b[_0xc7b4('0x40')],function(_0x40d9d2){var _0x3b365a={};_0x3b365a[_0x40d9d2]={'$like':'%'+_0x2759ad[_0xc7b4('0x3e')]['filter']+'%'};return _0x3b365a;})});}_0x4f379b=_[_0xc7b4('0x49')]({},_0x4f379b,_0x2759ad['options']);return _0x17aeb6['getSubjects'](_0x4f379b);}})['then'](function(_0x47fe98){if(_0x47fe98){_0x158b1e=_0x47fe98[_0xc7b4('0x54')];if(!_0x2759ad[_0xc7b4('0x3e')][_0xc7b4('0x43')](_0xc7b4('0x44'))){_0x4f379b[_0xc7b4('0x45')]=qs[_0xc7b4('0x45')](_0x2759ad[_0xc7b4('0x3e')][_0xc7b4('0x45')]);_0x4f379b[_0xc7b4('0x2e')]=qs[_0xc7b4('0x2e')](_0x2759ad[_0xc7b4('0x3e')][_0xc7b4('0x2e')]);}return _0x17aeb6[_0xc7b4('0x5c')](_0x4f379b);}})['then'](function(_0x3f038d){if(_0x3f038d){return _0x3f038d?{'count':_0x158b1e,'rows':_0x3f038d}:null;}})['then'](respondWithResult(_0x589a0a,null))[_0xc7b4('0x29')](handleError(_0x589a0a,null));};exports[_0xc7b4('0x5f')]=function(_0x3b863f,_0x14f22c,_0x3064d1){var _0x475e7e={};var _0x931c53={};var _0x41d3b5;var _0x11e126;return db[_0xc7b4('0x4d')]['findOne']({'where':{'id':_0x3b863f['params']['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x14f22c,null))[_0xc7b4('0x21')](function(_0x135c46){if(_0x135c46){_0x41d3b5=_0x135c46;_0x931c53['model']=_[_0xc7b4('0x3d')](db[_0xc7b4('0x5d')][_0xc7b4('0x5e')]);_0x931c53['query']=_[_0xc7b4('0x3d')](_0x3b863f['query']);_0x931c53[_0xc7b4('0x3f')]=_[_0xc7b4('0x41')](_0x931c53[_0xc7b4('0x3b')],_0x931c53['query']);_0x475e7e[_0xc7b4('0x40')]=_['intersection'](_0x931c53[_0xc7b4('0x3b')],qs['fields'](_0x3b863f[_0xc7b4('0x3e')]['fields']));_0x475e7e[_0xc7b4('0x40')]=_0x475e7e['attributes']['length']?_0x475e7e[_0xc7b4('0x40')]:_0x931c53[_0xc7b4('0x3b')];_0x475e7e['order']=qs[_0xc7b4('0x46')](_0x3b863f[_0xc7b4('0x3e')][_0xc7b4('0x46')]);_0x475e7e['where']=qs[_0xc7b4('0x3f')](_[_0xc7b4('0x47')](_0x3b863f[_0xc7b4('0x3e')],_0x931c53[_0xc7b4('0x3f')]));if(_0x3b863f[_0xc7b4('0x3e')][_0xc7b4('0x48')]){_0x475e7e['where']=_[_0xc7b4('0x49')](_0x475e7e[_0xc7b4('0x4a')],{'$or':_[_0xc7b4('0x3c')](_0x475e7e[_0xc7b4('0x40')],function(_0x353d2a){var _0x288e39={};_0x288e39[_0x353d2a]={'$like':'%'+_0x3b863f[_0xc7b4('0x3e')][_0xc7b4('0x48')]+'%'};return _0x288e39;})});}_0x475e7e=_[_0xc7b4('0x49')]({},_0x475e7e,_0x3b863f[_0xc7b4('0x4c')]);return _0x41d3b5[_0xc7b4('0x5f')](_0x475e7e);}})['then'](function(_0x16433e){if(_0x16433e){_0x11e126=_0x16433e[_0xc7b4('0x54')];if(!_0x3b863f['query'][_0xc7b4('0x43')]('nolimit')){_0x475e7e[_0xc7b4('0x45')]=qs[_0xc7b4('0x45')](_0x3b863f[_0xc7b4('0x3e')][_0xc7b4('0x45')]);_0x475e7e[_0xc7b4('0x2e')]=qs[_0xc7b4('0x2e')](_0x3b863f['query']['offset']);}return _0x41d3b5[_0xc7b4('0x5f')](_0x475e7e);}})[_0xc7b4('0x21')](function(_0x79f528){if(_0x79f528){return _0x79f528?{'count':_0x11e126,'rows':_0x79f528}:null;}})[_0xc7b4('0x21')](respondWithResult(_0x14f22c,null))[_0xc7b4('0x29')](handleError(_0x14f22c,null));};exports[_0xc7b4('0x60')]=function(_0x16dd04,_0x46031c,_0x38a99e){var _0xf77b1c={};var _0x48b849={};var _0x5a0830;var _0x1e71ba;return db['FreshdeskConfiguration'][_0xc7b4('0x5a')]({'where':{'id':_0x16dd04[_0xc7b4('0x53')]['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x46031c,null))['then'](function(_0x4f2aea){if(_0x4f2aea){_0x5a0830=_0x4f2aea;_0x48b849[_0xc7b4('0x3b')]=_[_0xc7b4('0x3d')](db[_0xc7b4('0x61')][_0xc7b4('0x5e')]);_0x48b849[_0xc7b4('0x3e')]=_['keys'](_0x16dd04[_0xc7b4('0x3e')]);_0x48b849[_0xc7b4('0x3f')]=_[_0xc7b4('0x41')](_0x48b849['model'],_0x48b849[_0xc7b4('0x3e')]);_0xf77b1c[_0xc7b4('0x40')]=_['intersection'](_0x48b849[_0xc7b4('0x3b')],qs[_0xc7b4('0x42')](_0x16dd04[_0xc7b4('0x3e')]['fields']));_0xf77b1c[_0xc7b4('0x40')]=_0xf77b1c['attributes']['length']?_0xf77b1c[_0xc7b4('0x40')]:_0x48b849['model'];_0xf77b1c[_0xc7b4('0x5b')]=qs[_0xc7b4('0x46')](_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x46')]);_0xf77b1c[_0xc7b4('0x4a')]=qs['filters'](_[_0xc7b4('0x47')](_0x16dd04[_0xc7b4('0x3e')],_0x48b849[_0xc7b4('0x3f')]));if(_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x48')]){_0xf77b1c[_0xc7b4('0x4a')]=_['merge'](_0xf77b1c[_0xc7b4('0x4a')],{'$or':_['map'](_0xf77b1c[_0xc7b4('0x40')],function(_0x373cb5){var _0xe3722e={};_0xe3722e[_0x373cb5]={'$like':'%'+_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x48')]+'%'};return _0xe3722e;})});}_0xf77b1c=_[_0xc7b4('0x49')]({},_0xf77b1c,_0x16dd04[_0xc7b4('0x4c')]);return _0x5a0830['getTags'](_0xf77b1c);}})[_0xc7b4('0x21')](function(_0x5d67b0){if(_0x5d67b0){_0x1e71ba=_0x5d67b0[_0xc7b4('0x54')];if(!_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x43')](_0xc7b4('0x44'))){_0xf77b1c['limit']=qs[_0xc7b4('0x45')](_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x45')]);_0xf77b1c[_0xc7b4('0x2e')]=qs['offset'](_0x16dd04[_0xc7b4('0x3e')][_0xc7b4('0x2e')]);}return _0x5a0830[_0xc7b4('0x60')](_0xf77b1c);}})[_0xc7b4('0x21')](function(_0x4ec793){if(_0x4ec793){return _0x4ec793?{'count':_0x1e71ba,'rows':_0x4ec793}:null;}})[_0xc7b4('0x21')](respondWithResult(_0x46031c,null))['catch'](handleError(_0x46031c,null));};exports['setTags']=function(_0x5696e8,_0x71d086,_0x552260){if(_0x5696e8[_0xc7b4('0x57')]['id']){delete _0x5696e8[_0xc7b4('0x57')]['id'];}return db[_0xc7b4('0x4d')][_0xc7b4('0x5a')]({'where':{'id':_0x5696e8[_0xc7b4('0x53')]['id']}})[_0xc7b4('0x21')](handleEntityNotFound(_0x71d086,null))['then'](function(_0x322559){if(_0x322559){return _0x322559[_0xc7b4('0x62')](_0x5696e8['body'][_0xc7b4('0x63')]||[]);}return null;})[_0xc7b4('0x21')](respondWithResult(_0x71d086,null))[_0xc7b4('0x29')](handleError(_0x71d086,null));}; \ No newline at end of file +var _0xe0ae=['then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','FreshdeskConfiguration','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','create','body','find','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','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'];(function(_0x26baa8,_0x1a199d){var _0x3a8ada=function(_0x548b8f){while(--_0x548b8f){_0x26baa8['push'](_0x26baa8['shift']());}};_0x3a8ada(++_0x1a199d);}(_0xe0ae,0xa1));var _0xee0a=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xe0ae[_0x4de877];return _0xb2cfeb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xee0a('0x0'));var zipdir=require(_0xee0a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee0a('0x2'));var moment=require('moment');var BPromise=require(_0xee0a('0x3'));var Mustache=require(_0xee0a('0x4'));var util=require('util');var path=require(_0xee0a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee0a('0x6'));var fs=require('fs');var _=require(_0xee0a('0x7'));var squel=require(_0xee0a('0x8'));var crypto=require(_0xee0a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xee0a('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee0a('0xb'));var Redis=require(_0xee0a('0xc'));var authService=require(_0xee0a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xee0a('0xe'));var hardwareService=require(_0xee0a('0xf'));var logger=require('../../config/logger')(_0xee0a('0x10'));var utils=require('../../config/utils');var config=require(_0xee0a('0x11'));var db=require(_0xee0a('0x12'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xee0a('0x13')]['http']({'port':0x232a});function checkPasswordPattern(_0x32fad9,_0x1f2e57,_0x58adf4){if(_0x58adf4){var _0x4e1cd0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e1cd0[_0xee0a('0x14')](_0x1f2e57)){return _0x32fad9;}else{throw new db[(_0xee0a('0x15'))][(_0xee0a('0x16'))](_0xee0a('0x17'));}}else{return _0x32fad9;}}function respondWithRpcPromise(_0x41d4e4,_0x57afe6,_0xb891a9,_0xd39431){return new BPromise(function(_0x50063f,_0x2c804a){var _0x35d1e4=_0xd39431||client;return _0x35d1e4[_0xee0a('0x18')](_0x41d4e4,_0xb891a9)[_0xee0a('0x19')](function(_0x4f711b){logger[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x57afe6,_0xee0a('0x1c'));logger['debug'](_0xee0a('0x1d'),_0x57afe6,_0xee0a('0x1c'),JSON[_0xee0a('0x1e')](_0x4f711b));if(_0x4f711b[_0xee0a('0x1f')]){if(_0x4f711b['error'][_0xee0a('0x20')]===0x1f4){logger[_0xee0a('0x1f')](_0xee0a('0x1b'),_0x57afe6,_0x4f711b[_0xee0a('0x1f')]['message']);return _0x2c804a(_0x4f711b[_0xee0a('0x1f')][_0xee0a('0x21')]);}logger[_0xee0a('0x1f')](_0xee0a('0x1b'),_0x57afe6,_0x4f711b[_0xee0a('0x1f')][_0xee0a('0x21')]);return _0x50063f(_0x4f711b[_0xee0a('0x1f')]['message']);}else{logger[_0xee0a('0x1a')](_0xee0a('0x1b'),_0x57afe6,_0xee0a('0x1c'));_0x50063f(_0x4f711b[_0xee0a('0x22')]['message']);}})[_0xee0a('0x23')](function(_0x197616){logger[_0xee0a('0x1f')](_0xee0a('0x1b'),_0x57afe6,_0x197616);_0x2c804a(_0x197616);});});}function respondWithStatusCode(_0x4c61e2,_0x50e9d1){_0x50e9d1=_0x50e9d1||0xcc;return function(_0x578ecf){if(_0x578ecf){return _0x4c61e2[_0xee0a('0x24')](_0x50e9d1);}return _0x4c61e2['status'](_0x50e9d1)['end']();};}function respondWithResult(_0x1c9ad8,_0x2c8965){_0x2c8965=_0x2c8965||0xc8;return function(_0xe5365f){if(_0xe5365f){return _0x1c9ad8['status'](_0x2c8965)[_0xee0a('0x25')](_0xe5365f);}};}function respondWithFilteredResult(_0xe14449,_0x15b1c0){return function(_0x30d1f1){if(_0x30d1f1){var _0x2e7f18=_0x30d1f1[_0xee0a('0x26')],_0x45538d=_0x15b1c0[_0xee0a('0x27')],_0x145332=_0x15b1c0['offset']+_0x15b1c0[_0xee0a('0x28')],_0x408909;if(_0x145332>=_0x2e7f18){_0x145332=_0x2e7f18;_0x408909=0xc8;}else{_0x408909=0xce;}_0xe14449[_0xee0a('0x29')](_0x408909);return _0xe14449[_0xee0a('0x2a')](_0xee0a('0x2b'),_0x45538d+'-'+_0x145332+'/'+_0x2e7f18)[_0xee0a('0x25')](_0x30d1f1);}return null;};}function patchUpdates(_0x3faad3){return function(_0x4cf1df){try{jsonpatch[_0xee0a('0x2c')](_0x4cf1df,_0x3faad3,!![]);}catch(_0x31ae71){return BPromise[_0xee0a('0x2d')](_0x31ae71);}return _0x4cf1df[_0xee0a('0x2e')]();};}function saveUpdates(_0x4b9cd7,_0x354dff){return function(_0x55e328){if(_0x55e328){return _0x55e328[_0xee0a('0x2f')](_0x4b9cd7)[_0xee0a('0x19')](function(_0x3d6de4){return _0x3d6de4;});}return null;};}function removeEntity(_0x229f8d,_0x318c82){return function(_0x443678){if(_0x443678){return _0x443678[_0xee0a('0x30')]()[_0xee0a('0x19')](function(){_0x229f8d['status'](0xcc)[_0xee0a('0x31')]();});}};}function handleEntityNotFound(_0x1d4578,_0x508c87){return function(_0x2ce5c6){if(!_0x2ce5c6){_0x1d4578[_0xee0a('0x24')](0x194);}return _0x2ce5c6;};}function handleError(_0x27db4c,_0x4aede0){_0x4aede0=_0x4aede0||0x1f4;return function(_0x131b60){logger[_0xee0a('0x1f')](_0x131b60[_0xee0a('0x32')]);if(_0x131b60['name']){delete _0x131b60[_0xee0a('0x33')];}_0x27db4c[_0xee0a('0x29')](_0x4aede0)[_0xee0a('0x34')](_0x131b60);};}exports['index']=function(_0x47a59c,_0x7db483){var _0x10e8a5={},_0x2912ce={},_0x25041c={'count':0x0,'rows':[]};var _0xd19cd3=_[_0xee0a('0x35')](db[_0xee0a('0x36')][_0xee0a('0x37')],function(_0x22d505){return{'name':_0x22d505['fieldName'],'type':_0x22d505[_0xee0a('0x38')][_0xee0a('0x39')]};});_0x2912ce['model']=_[_0xee0a('0x35')](_0xd19cd3,_0xee0a('0x33'));_0x2912ce['query']=_[_0xee0a('0x3a')](_0x47a59c[_0xee0a('0x3b')]);_0x2912ce[_0xee0a('0x3c')]=_[_0xee0a('0x3d')](_0x2912ce[_0xee0a('0x3e')],_0x2912ce[_0xee0a('0x3b')]);_0x10e8a5[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0x2912ce[_0xee0a('0x3e')],qs['fields'](_0x47a59c[_0xee0a('0x3b')][_0xee0a('0x40')]));_0x10e8a5[_0xee0a('0x3f')]=_0x10e8a5[_0xee0a('0x3f')]['length']?_0x10e8a5['attributes']:_0x2912ce[_0xee0a('0x3e')];if(!_0x47a59c[_0xee0a('0x3b')][_0xee0a('0x41')](_0xee0a('0x42'))){_0x10e8a5[_0xee0a('0x28')]=qs[_0xee0a('0x28')](_0x47a59c[_0xee0a('0x3b')]['limit']);_0x10e8a5['offset']=qs[_0xee0a('0x27')](_0x47a59c[_0xee0a('0x3b')]['offset']);}_0x10e8a5[_0xee0a('0x43')]=qs[_0xee0a('0x44')](_0x47a59c['query'][_0xee0a('0x44')]);_0x10e8a5[_0xee0a('0x45')]=qs[_0xee0a('0x3c')](_[_0xee0a('0x46')](_0x47a59c[_0xee0a('0x3b')],_0x2912ce[_0xee0a('0x3c')]),_0xd19cd3);if(_0x47a59c[_0xee0a('0x3b')]['filter']){_0x10e8a5['where']=_[_0xee0a('0x47')](_0x10e8a5['where'],{'$or':_['map'](_0xd19cd3,function(_0x5cb774){if(_0x5cb774[_0xee0a('0x38')]!==_0xee0a('0x48')){var _0x4cbda6={};_0x4cbda6[_0x5cb774['name']]={'$like':'%'+_0x47a59c['query']['filter']+'%'};return _0x4cbda6;}})});}_0x10e8a5=_[_0xee0a('0x47')]({},_0x10e8a5,_0x47a59c[_0xee0a('0x49')]);var _0x32fd2d={'where':_0x10e8a5[_0xee0a('0x45')]};return db[_0xee0a('0x36')][_0xee0a('0x26')](_0x32fd2d)['then'](function(_0x1a72a2){_0x25041c['count']=_0x1a72a2;if(_0x47a59c[_0xee0a('0x3b')][_0xee0a('0x4a')]){_0x10e8a5[_0xee0a('0x4b')]=[{'all':!![]}];}return db[_0xee0a('0x36')]['findAll'](_0x10e8a5);})[_0xee0a('0x19')](function(_0x219dd3){_0x25041c[_0xee0a('0x4c')]=_0x219dd3;return _0x25041c;})[_0xee0a('0x19')](respondWithFilteredResult(_0x7db483,_0x10e8a5))[_0xee0a('0x23')](handleError(_0x7db483,null));};exports[_0xee0a('0x4d')]=function(_0x340cc9,_0x4cd7d3){var _0x51300e={'raw':![],'where':{'id':_0x340cc9[_0xee0a('0x4e')]['id']}},_0x1b571c={};_0x1b571c[_0xee0a('0x3e')]=_[_0xee0a('0x3a')](db[_0xee0a('0x36')][_0xee0a('0x37')]);_0x1b571c[_0xee0a('0x3b')]=_[_0xee0a('0x3a')](_0x340cc9[_0xee0a('0x3b')]);_0x1b571c[_0xee0a('0x3c')]=_[_0xee0a('0x3d')](_0x1b571c[_0xee0a('0x3e')],_0x1b571c['query']);_0x51300e[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0x1b571c[_0xee0a('0x3e')],qs[_0xee0a('0x40')](_0x340cc9[_0xee0a('0x3b')]['fields']));_0x51300e[_0xee0a('0x3f')]=_0x51300e[_0xee0a('0x3f')][_0xee0a('0x4f')]?_0x51300e[_0xee0a('0x3f')]:_0x1b571c[_0xee0a('0x3e')];if(_0x340cc9['query'][_0xee0a('0x4a')]){_0x51300e[_0xee0a('0x4b')]=[{'all':!![]}];}_0x51300e=_[_0xee0a('0x47')]({},_0x51300e,_0x340cc9[_0xee0a('0x49')]);return db[_0xee0a('0x36')]['find'](_0x51300e)[_0xee0a('0x19')](handleEntityNotFound(_0x4cd7d3,null))[_0xee0a('0x19')](respondWithResult(_0x4cd7d3,null))[_0xee0a('0x23')](handleError(_0x4cd7d3,null));};exports[_0xee0a('0x50')]=function(_0x2ff182,_0x458e0c){return db[_0xee0a('0x36')][_0xee0a('0x50')](_0x2ff182[_0xee0a('0x51')],{})[_0xee0a('0x19')](respondWithResult(_0x458e0c,0xc9))[_0xee0a('0x23')](handleError(_0x458e0c,null));};exports[_0xee0a('0x2f')]=function(_0x309a4e,_0x341f43){if(_0x309a4e[_0xee0a('0x51')]['id']){delete _0x309a4e[_0xee0a('0x51')]['id'];}return db[_0xee0a('0x36')][_0xee0a('0x52')]({'where':{'id':_0x309a4e[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x341f43,null))[_0xee0a('0x19')](saveUpdates(_0x309a4e[_0xee0a('0x51')],null))['then'](respondWithResult(_0x341f43,null))['catch'](handleError(_0x341f43,null));};exports['destroy']=function(_0x35eb93,_0x557690){return db[_0xee0a('0x36')][_0xee0a('0x52')]({'where':{'id':_0x35eb93[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x557690,null))['then'](removeEntity(_0x557690,null))[_0xee0a('0x23')](handleError(_0x557690,null));};exports[_0xee0a('0x53')]=function(_0x1e6601,_0x1d6398,_0x301f69){var _0x99e2b0={};var _0xf576ea={};var _0x3c9456;var _0x101c8e;return db[_0xee0a('0x36')][_0xee0a('0x54')]({'where':{'id':_0x1e6601[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x1d6398,null))[_0xee0a('0x19')](function(_0x4eb728){if(_0x4eb728){_0x3c9456=_0x4eb728;_0xf576ea[_0xee0a('0x3e')]=_['keys'](db[_0xee0a('0x55')][_0xee0a('0x37')]);_0xf576ea['query']=_[_0xee0a('0x3a')](_0x1e6601['query']);_0xf576ea[_0xee0a('0x3c')]=_['intersection'](_0xf576ea['model'],_0xf576ea['query']);_0x99e2b0[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0xf576ea[_0xee0a('0x3e')],qs[_0xee0a('0x40')](_0x1e6601[_0xee0a('0x3b')][_0xee0a('0x40')]));_0x99e2b0[_0xee0a('0x3f')]=_0x99e2b0[_0xee0a('0x3f')]['length']?_0x99e2b0[_0xee0a('0x3f')]:_0xf576ea['model'];_0x99e2b0['order']=qs[_0xee0a('0x44')](_0x1e6601[_0xee0a('0x3b')][_0xee0a('0x44')]);_0x99e2b0[_0xee0a('0x45')]=qs[_0xee0a('0x3c')](_[_0xee0a('0x46')](_0x1e6601[_0xee0a('0x3b')],_0xf576ea[_0xee0a('0x3c')]));if(_0x1e6601['query'][_0xee0a('0x56')]){_0x99e2b0['where']=_[_0xee0a('0x47')](_0x99e2b0[_0xee0a('0x45')],{'$or':_[_0xee0a('0x35')](_0x99e2b0[_0xee0a('0x3f')],function(_0x4115bd){var _0x2c7bba={};_0x2c7bba[_0x4115bd]={'$like':'%'+_0x1e6601['query'][_0xee0a('0x56')]+'%'};return _0x2c7bba;})});}_0x99e2b0=_[_0xee0a('0x47')]({},_0x99e2b0,_0x1e6601[_0xee0a('0x49')]);return _0x3c9456['getFields'](_0x99e2b0);}})[_0xee0a('0x19')](function(_0x2fb3b5){if(_0x2fb3b5){_0x101c8e=_0x2fb3b5['length'];if(!_0x1e6601[_0xee0a('0x3b')]['hasOwnProperty']('nolimit')){_0x99e2b0['limit']=qs['limit'](_0x1e6601[_0xee0a('0x3b')]['limit']);_0x99e2b0[_0xee0a('0x27')]=qs['offset'](_0x1e6601[_0xee0a('0x3b')][_0xee0a('0x27')]);}return _0x3c9456[_0xee0a('0x53')](_0x99e2b0);}})[_0xee0a('0x19')](function(_0x5f082e){if(_0x5f082e){return _0x5f082e?{'count':_0x101c8e,'rows':_0x5f082e}:null;}})[_0xee0a('0x19')](respondWithResult(_0x1d6398,null))[_0xee0a('0x23')](handleError(_0x1d6398,null));};exports[_0xee0a('0x57')]=function(_0x37936a,_0x336d65,_0x48941f){var _0x10aeda={};var _0xbd642={};var _0x3011da;var _0x5c3897;return db[_0xee0a('0x36')][_0xee0a('0x54')]({'where':{'id':_0x37936a['params']['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x336d65,null))[_0xee0a('0x19')](function(_0x3f701d){if(_0x3f701d){_0x3011da=_0x3f701d;_0xbd642[_0xee0a('0x3e')]=_[_0xee0a('0x3a')](db[_0xee0a('0x55')][_0xee0a('0x37')]);_0xbd642[_0xee0a('0x3b')]=_['keys'](_0x37936a[_0xee0a('0x3b')]);_0xbd642[_0xee0a('0x3c')]=_[_0xee0a('0x3d')](_0xbd642[_0xee0a('0x3e')],_0xbd642[_0xee0a('0x3b')]);_0x10aeda[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0xbd642['model'],qs[_0xee0a('0x40')](_0x37936a[_0xee0a('0x3b')][_0xee0a('0x40')]));_0x10aeda[_0xee0a('0x3f')]=_0x10aeda['attributes'][_0xee0a('0x4f')]?_0x10aeda[_0xee0a('0x3f')]:_0xbd642[_0xee0a('0x3e')];_0x10aeda[_0xee0a('0x43')]=qs[_0xee0a('0x44')](_0x37936a['query']['sort']);_0x10aeda[_0xee0a('0x45')]=qs[_0xee0a('0x3c')](_[_0xee0a('0x46')](_0x37936a['query'],_0xbd642[_0xee0a('0x3c')]));if(_0x37936a[_0xee0a('0x3b')][_0xee0a('0x56')]){_0x10aeda[_0xee0a('0x45')]=_[_0xee0a('0x47')](_0x10aeda[_0xee0a('0x45')],{'$or':_[_0xee0a('0x35')](_0x10aeda[_0xee0a('0x3f')],function(_0x56d4b0){var _0x5cfb45={};_0x5cfb45[_0x56d4b0]={'$like':'%'+_0x37936a[_0xee0a('0x3b')][_0xee0a('0x56')]+'%'};return _0x5cfb45;})});}_0x10aeda=_[_0xee0a('0x47')]({},_0x10aeda,_0x37936a[_0xee0a('0x49')]);return _0x3011da['getSubjects'](_0x10aeda);}})[_0xee0a('0x19')](function(_0x18fa7f){if(_0x18fa7f){_0x5c3897=_0x18fa7f[_0xee0a('0x4f')];if(!_0x37936a[_0xee0a('0x3b')][_0xee0a('0x41')]('nolimit')){_0x10aeda['limit']=qs['limit'](_0x37936a['query'][_0xee0a('0x28')]);_0x10aeda['offset']=qs[_0xee0a('0x27')](_0x37936a[_0xee0a('0x3b')]['offset']);}return _0x3011da[_0xee0a('0x57')](_0x10aeda);}})['then'](function(_0xaf2aac){if(_0xaf2aac){return _0xaf2aac?{'count':_0x5c3897,'rows':_0xaf2aac}:null;}})[_0xee0a('0x19')](respondWithResult(_0x336d65,null))[_0xee0a('0x23')](handleError(_0x336d65,null));};exports[_0xee0a('0x58')]=function(_0x527470,_0x2c8bf3,_0x401491){var _0x22dea8={};var _0x461729={};var _0x584a04;var _0x1baba3;return db[_0xee0a('0x36')][_0xee0a('0x54')]({'where':{'id':_0x527470[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x2c8bf3,null))[_0xee0a('0x19')](function(_0x571e54){if(_0x571e54){_0x584a04=_0x571e54;_0x461729[_0xee0a('0x3e')]=_[_0xee0a('0x3a')](db[_0xee0a('0x55')][_0xee0a('0x37')]);_0x461729[_0xee0a('0x3b')]=_[_0xee0a('0x3a')](_0x527470['query']);_0x461729[_0xee0a('0x3c')]=_[_0xee0a('0x3d')](_0x461729[_0xee0a('0x3e')],_0x461729[_0xee0a('0x3b')]);_0x22dea8[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0x461729['model'],qs[_0xee0a('0x40')](_0x527470[_0xee0a('0x3b')][_0xee0a('0x40')]));_0x22dea8[_0xee0a('0x3f')]=_0x22dea8[_0xee0a('0x3f')][_0xee0a('0x4f')]?_0x22dea8[_0xee0a('0x3f')]:_0x461729[_0xee0a('0x3e')];_0x22dea8[_0xee0a('0x43')]=qs[_0xee0a('0x44')](_0x527470[_0xee0a('0x3b')][_0xee0a('0x44')]);_0x22dea8[_0xee0a('0x45')]=qs[_0xee0a('0x3c')](_[_0xee0a('0x46')](_0x527470['query'],_0x461729[_0xee0a('0x3c')]));if(_0x527470[_0xee0a('0x3b')]['filter']){_0x22dea8[_0xee0a('0x45')]=_[_0xee0a('0x47')](_0x22dea8['where'],{'$or':_['map'](_0x22dea8[_0xee0a('0x3f')],function(_0x56a25b){var _0x44e49e={};_0x44e49e[_0x56a25b]={'$like':'%'+_0x527470[_0xee0a('0x3b')]['filter']+'%'};return _0x44e49e;})});}_0x22dea8=_[_0xee0a('0x47')]({},_0x22dea8,_0x527470[_0xee0a('0x49')]);return _0x584a04[_0xee0a('0x58')](_0x22dea8);}})[_0xee0a('0x19')](function(_0x341bc7){if(_0x341bc7){_0x1baba3=_0x341bc7['length'];if(!_0x527470[_0xee0a('0x3b')][_0xee0a('0x41')](_0xee0a('0x42'))){_0x22dea8[_0xee0a('0x28')]=qs[_0xee0a('0x28')](_0x527470[_0xee0a('0x3b')][_0xee0a('0x28')]);_0x22dea8[_0xee0a('0x27')]=qs[_0xee0a('0x27')](_0x527470[_0xee0a('0x3b')][_0xee0a('0x27')]);}return _0x584a04[_0xee0a('0x58')](_0x22dea8);}})[_0xee0a('0x19')](function(_0x5e4d48){if(_0x5e4d48){return _0x5e4d48?{'count':_0x1baba3,'rows':_0x5e4d48}:null;}})[_0xee0a('0x19')](respondWithResult(_0x2c8bf3,null))['catch'](handleError(_0x2c8bf3,null));};exports[_0xee0a('0x59')]=function(_0x2ee940,_0x1c7ce7,_0x2f9e9d){var _0x5aa076={};var _0xc748b6={};var _0x5eca63;var _0x7f1f6a;return db[_0xee0a('0x36')]['findOne']({'where':{'id':_0x2ee940[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x1c7ce7,null))[_0xee0a('0x19')](function(_0x21b7ea){if(_0x21b7ea){_0x5eca63=_0x21b7ea;_0xc748b6[_0xee0a('0x3e')]=_[_0xee0a('0x3a')](db[_0xee0a('0x5a')][_0xee0a('0x37')]);_0xc748b6['query']=_['keys'](_0x2ee940[_0xee0a('0x3b')]);_0xc748b6[_0xee0a('0x3c')]=_[_0xee0a('0x3d')](_0xc748b6[_0xee0a('0x3e')],_0xc748b6['query']);_0x5aa076[_0xee0a('0x3f')]=_[_0xee0a('0x3d')](_0xc748b6[_0xee0a('0x3e')],qs[_0xee0a('0x40')](_0x2ee940[_0xee0a('0x3b')][_0xee0a('0x40')]));_0x5aa076['attributes']=_0x5aa076['attributes'][_0xee0a('0x4f')]?_0x5aa076[_0xee0a('0x3f')]:_0xc748b6[_0xee0a('0x3e')];_0x5aa076[_0xee0a('0x43')]=qs[_0xee0a('0x44')](_0x2ee940[_0xee0a('0x3b')][_0xee0a('0x44')]);_0x5aa076[_0xee0a('0x45')]=qs['filters'](_[_0xee0a('0x46')](_0x2ee940[_0xee0a('0x3b')],_0xc748b6['filters']));if(_0x2ee940['query'][_0xee0a('0x56')]){_0x5aa076[_0xee0a('0x45')]=_[_0xee0a('0x47')](_0x5aa076[_0xee0a('0x45')],{'$or':_[_0xee0a('0x35')](_0x5aa076['attributes'],function(_0x3de8e7){var _0x2c4248={};_0x2c4248[_0x3de8e7]={'$like':'%'+_0x2ee940['query'][_0xee0a('0x56')]+'%'};return _0x2c4248;})});}_0x5aa076=_['merge']({},_0x5aa076,_0x2ee940[_0xee0a('0x49')]);return _0x5eca63[_0xee0a('0x59')](_0x5aa076);}})[_0xee0a('0x19')](function(_0x561e0d){if(_0x561e0d){_0x7f1f6a=_0x561e0d[_0xee0a('0x4f')];if(!_0x2ee940[_0xee0a('0x3b')][_0xee0a('0x41')](_0xee0a('0x42'))){_0x5aa076['limit']=qs['limit'](_0x2ee940['query'][_0xee0a('0x28')]);_0x5aa076[_0xee0a('0x27')]=qs[_0xee0a('0x27')](_0x2ee940['query']['offset']);}return _0x5eca63[_0xee0a('0x59')](_0x5aa076);}})[_0xee0a('0x19')](function(_0x3a405a){if(_0x3a405a){return _0x3a405a?{'count':_0x7f1f6a,'rows':_0x3a405a}:null;}})['then'](respondWithResult(_0x1c7ce7,null))['catch'](handleError(_0x1c7ce7,null));};exports[_0xee0a('0x5b')]=function(_0x5adfd1,_0x5f93d3,_0x2fffa7){if(_0x5adfd1[_0xee0a('0x51')]['id']){delete _0x5adfd1[_0xee0a('0x51')]['id'];}return db['FreshdeskConfiguration'][_0xee0a('0x54')]({'where':{'id':_0x5adfd1[_0xee0a('0x4e')]['id']}})[_0xee0a('0x19')](handleEntityNotFound(_0x5f93d3,null))[_0xee0a('0x19')](function(_0x13f5e8){if(_0x13f5e8){return _0x13f5e8[_0xee0a('0x5b')](_0x5adfd1[_0xee0a('0x51')][_0xee0a('0x5c')]||[]);}return null;})[_0xee0a('0x19')](respondWithResult(_0x5f93d3,null))[_0xee0a('0x23')](handleError(_0x5f93d3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b9f4832..86c1a88 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 _0x41cb=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x41cb,0xf0));var _0xb41c=function(_0x2544d1,_0x3e78fa){_0x2544d1=_0x2544d1-0x0;var _0x5acf94=_0x41cb[_0x2544d1];return _0x5acf94;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb41c('0x0'))(_0xb41c('0x1'));var moment=require('moment');var BPromise=require(_0xb41c('0x2'));var rp=require(_0xb41c('0x3'));var fs=require('fs');var path=require(_0xb41c('0x4'));var rimraf=require(_0xb41c('0x5'));var config=require(_0xb41c('0x6'));var attributes=require(_0xb41c('0x7'));module['exports']=function(_0x5c826d,_0x7b23f7){return _0x5c826d[_0xb41c('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0xb41c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13b1=['path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2488b4,_0x3c3ea1){var _0x5c3f2f=function(_0x3386ab){while(--_0x3386ab){_0x2488b4['push'](_0x2488b4['shift']());}};_0x5c3f2f(++_0x3c3ea1);}(_0x13b1,0x11a));var _0x113b=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0x13b1[_0x2118ad];return _0x4b5715;};'use strict';var _=require(_0x113b('0x0'));var util=require(_0x113b('0x1'));var logger=require(_0x113b('0x2'))(_0x113b('0x3'));var moment=require('moment');var BPromise=require(_0x113b('0x4'));var rp=require(_0x113b('0x5'));var fs=require('fs');var path=require(_0x113b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x113b('0x7'));module[_0x113b('0x8')]=function(_0x16a1ad,_0x129268){return _0x16a1ad[_0x113b('0x9')](_0x113b('0xa'),attributes,{'tableName':_0x113b('0xb'),'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 3cecb41..c190e0b 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 _0x56c6=['catch','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x53b49f,_0x1f18bf){var _0x891e21=function(_0x476bc5){while(--_0x476bc5){_0x53b49f['push'](_0x53b49f['shift']());}};_0x891e21(++_0x1f18bf);}(_0x56c6,0x119));var _0x656c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x56c6[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x656c('0x0'));var moment=require(_0x656c('0x1'));var BPromise=require(_0x656c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x656c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x656c('0x4'))(_0x656c('0x5'));var config=require(_0x656c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x656c('0x7')][_0x656c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dcaec,_0x5b6e10,_0x151b66){return new BPromise(function(_0x1839aa,_0x4fcac4){return client['request'](_0x4dcaec,_0x151b66)[_0x656c('0x9')](function(_0x1ff050){logger[_0x656c('0xa')](_0x656c('0xb'),_0x5b6e10,_0x656c('0xc'));logger[_0x656c('0xd')](_0x656c('0xe'),_0x5b6e10,_0x656c('0xc'),JSON[_0x656c('0xf')](_0x1ff050));if(_0x1ff050['error']){if(_0x1ff050['error'][_0x656c('0x10')]===0x1f4){logger[_0x656c('0x11')](_0x656c('0xb'),_0x5b6e10,_0x1ff050[_0x656c('0x11')][_0x656c('0x12')]);return _0x4fcac4(_0x1ff050[_0x656c('0x11')]['message']);}logger[_0x656c('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5b6e10,_0x1ff050['error'][_0x656c('0x12')]);return _0x1839aa(_0x1ff050[_0x656c('0x11')][_0x656c('0x12')]);}else{logger['info'](_0x656c('0xb'),_0x5b6e10,'request\x20sent');_0x1839aa(_0x1ff050['result'][_0x656c('0x12')]);}})[_0x656c('0x13')](function(_0x5ccdec){logger[_0x656c('0x11')](_0x656c('0xb'),_0x5b6e10,_0x5ccdec);_0x4fcac4(_0x5ccdec);});});} \ No newline at end of file +var _0x226c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash'];(function(_0xb3c668,_0x4d0408){var _0x2f6f68=function(_0x2c7289){while(--_0x2c7289){_0xb3c668['push'](_0xb3c668['shift']());}};_0x2f6f68(++_0x4d0408);}(_0x226c,0xc7));var _0xc226=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x226c[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xc226('0x0'));var util=require(_0xc226('0x1'));var moment=require('moment');var BPromise=require(_0xc226('0x2'));var rs=require(_0xc226('0x3'));var fs=require('fs');var Redis=require(_0xc226('0x4'));var db=require(_0xc226('0x5'))['db'];var utils=require(_0xc226('0x6'));var logger=require(_0xc226('0x7'))(_0xc226('0x8'));var config=require(_0xc226('0x9'));var jayson=require(_0xc226('0xa'));var client=jayson[_0xc226('0xb')][_0xc226('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16d789,_0x284f97,_0x3dc548){return new BPromise(function(_0x5adaaa,_0x3118a1){return client[_0xc226('0xd')](_0x16d789,_0x3dc548)[_0xc226('0xe')](function(_0x38ede3){logger[_0xc226('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x284f97,_0xc226('0x10'));logger[_0xc226('0x11')](_0xc226('0x12'),_0x284f97,_0xc226('0x10'),JSON['stringify'](_0x38ede3));if(_0x38ede3['error']){if(_0x38ede3['error'][_0xc226('0x13')]===0x1f4){logger[_0xc226('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x284f97,_0x38ede3[_0xc226('0x14')][_0xc226('0x15')]);return _0x3118a1(_0x38ede3['error'][_0xc226('0x15')]);}logger[_0xc226('0x14')](_0xc226('0x16'),_0x284f97,_0x38ede3[_0xc226('0x14')]['message']);return _0x5adaaa(_0x38ede3[_0xc226('0x14')][_0xc226('0x15')]);}else{logger['info'](_0xc226('0x16'),_0x284f97,_0xc226('0x10'));_0x5adaaa(_0x38ede3[_0xc226('0x17')][_0xc226('0x15')]);}})[_0xc226('0x18')](function(_0xfa9c01){logger['error'](_0xc226('0x16'),_0x284f97,_0xfa9c01);_0x3118a1(_0xfa9c01);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index af097d9..2b076dc 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 _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x1a3fe2,_0x553b71){var _0x490ee2=function(_0xc569b4){while(--_0xc569b4){_0x1a3fe2['push'](_0x1a3fe2['shift']());}};_0x490ee2(++_0x553b71);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file +var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x9640c0,_0x3d6b05){var _0x3a53f1=function(_0x497f4d){while(--_0x497f4d){_0x9640c0['push'](_0x9640c0['shift']());}};_0x3a53f1(++_0x3d6b05);}(_0x008c,0x188));var _0xc008=function(_0x14f681,_0xa0808e){_0x14f681=_0x14f681-0x0;var _0x1d4cb2=_0x008c[_0x14f681];return _0x1d4cb2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 32762ac..7dbe391 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 _0x5636=['keyValue','string','STRING','ENUM','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x3660b8,_0x404ee8){var _0x56f4c9=function(_0x17e59e){while(--_0x17e59e){_0x3660b8['push'](_0x3660b8['shift']());}};_0x56f4c9(++_0x404ee8);}(_0x5636,0x102));var _0x6563=function(_0x3b97ca,_0x4c91b5){_0x3b97ca=_0x3b97ca-0x0;var _0x38f507=_0x5636[_0x3b97ca];return _0x38f507;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x6563('0x2'),_0x6563('0x3')),'defaultValue':_0x6563('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6563('0x5')]},'keyType':{'type':Sequelize[_0x6563('0x6')](_0x6563('0x4'),_0x6563('0x7'),_0x6563('0x2'))},'keyContent':{'type':Sequelize[_0x6563('0x5')]},'idField':{'type':Sequelize[_0x6563('0x5')]},'nameField':{'type':Sequelize[_0x6563('0x5')]},'customField':{'type':Sequelize[_0x6563('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6563('0x5')]}}; \ No newline at end of file +var _0x9efb=['ENUM','variable','customVariable','string','STRING','exports'];(function(_0x1bbeb9,_0x4f9726){var _0x1b710b=function(_0x5316cb){while(--_0x5316cb){_0x1bbeb9['push'](_0x1bbeb9['shift']());}};_0x1b710b(++_0x4f9726);}(_0x9efb,0x143));var _0xb9ef=function(_0x18ba06,_0x42f589){_0x18ba06=_0x18ba06-0x0;var _0x4f4ed9=_0x9efb[_0x18ba06];return _0x4f4ed9;};'use strict';var Sequelize=require('sequelize');module[_0xb9ef('0x0')]={'type':{'type':Sequelize[_0xb9ef('0x1')]('string',_0xb9ef('0x2'),_0xb9ef('0x3'),'keyValue'),'defaultValue':_0xb9ef('0x4')},'content':{'type':Sequelize[_0xb9ef('0x5')]},'key':{'type':Sequelize[_0xb9ef('0x5')]},'keyType':{'type':Sequelize[_0xb9ef('0x1')](_0xb9ef('0x4'),_0xb9ef('0x2'),_0xb9ef('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb9ef('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 9c53567..8c0d6bf 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 _0x0a9f=['limit','order','sort','filters','pick','where','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a9f,0xe2));var _0xf0a9=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0x0a9f[_0x137815];return _0x29ded1;};'use strict';var pdf=require(_0xf0a9('0x0'));var emlformat=require(_0xf0a9('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0a9('0x2'));var moment=require(_0xf0a9('0x3'));var BPromise=require(_0xf0a9('0x4'));var Mustache=require(_0xf0a9('0x5'));var util=require(_0xf0a9('0x6'));var path=require(_0xf0a9('0x7'));var sox=require('sox');var csv=require(_0xf0a9('0x8'));var ejs=require(_0xf0a9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0a9('0xa'));var crypto=require(_0xf0a9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf0a9('0xc'));var toCsv=require(_0xf0a9('0x8'));var querystring=require(_0xf0a9('0xd'));var Papa=require(_0xf0a9('0xe'));var Redis=require('ioredis');var authService=require(_0xf0a9('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0a9('0x10'));var logger=require(_0xf0a9('0x11'))(_0xf0a9('0x12'));var utils=require(_0xf0a9('0x13'));var config=require('../../config/environment');var db=require(_0xf0a9('0x14'))['db'];function respondWithStatusCode(_0x4ede97,_0x2572a2){_0x2572a2=_0x2572a2||0xcc;return function(_0x1699a1){if(_0x1699a1){return _0x4ede97[_0xf0a9('0x15')](_0x2572a2);}return _0x4ede97[_0xf0a9('0x16')](_0x2572a2)['end']();};}function respondWithResult(_0x57d459,_0x250a73){_0x250a73=_0x250a73||0xc8;return function(_0xff655){if(_0xff655){return _0x57d459[_0xf0a9('0x16')](_0x250a73)[_0xf0a9('0x17')](_0xff655);}};}function respondWithFilteredResult(_0x31a175,_0x4a7708){return function(_0x25bec4){if(_0x25bec4){var _0x133d34=_0x25bec4['count'],_0xca15c=_0x4a7708[_0xf0a9('0x18')],_0x2b1848=_0x4a7708['offset']+_0x4a7708['limit'],_0x1be482;if(_0x2b1848>=_0x133d34){_0x2b1848=_0x133d34;_0x1be482=0xc8;}else{_0x1be482=0xce;}_0x31a175[_0xf0a9('0x16')](_0x1be482);return _0x31a175[_0xf0a9('0x19')]('Content-Range',_0xca15c+'-'+_0x2b1848+'/'+_0x133d34)[_0xf0a9('0x17')](_0x25bec4);}return null;};}function patchUpdates(_0x339c16){return function(_0x5f2d19){try{jsonpatch[_0xf0a9('0x1a')](_0x5f2d19,_0x339c16,!![]);}catch(_0x2534b5){return BPromise[_0xf0a9('0x1b')](_0x2534b5);}return _0x5f2d19['save']();};}function saveUpdates(_0x4e41e7,_0x1e5307){return function(_0x52c0b2){if(_0x52c0b2){return _0x52c0b2[_0xf0a9('0x1c')](_0x4e41e7)[_0xf0a9('0x1d')](function(_0x7e5cd0){return _0x7e5cd0;});}return null;};}function removeEntity(_0x56ac61,_0x478b1d){return function(_0x1badde){if(_0x1badde){return _0x1badde[_0xf0a9('0x1e')]()[_0xf0a9('0x1d')](function(){_0x56ac61[_0xf0a9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534e01,_0x250a70){return function(_0x364cf7){if(!_0x364cf7){_0x534e01['sendStatus'](0x194);}return _0x364cf7;};}function handleError(_0x170415,_0x75dfe6){_0x75dfe6=_0x75dfe6||0x1f4;return function(_0x1596c2){logger[_0xf0a9('0x1f')](_0x1596c2[_0xf0a9('0x20')]);if(_0x1596c2[_0xf0a9('0x21')]){delete _0x1596c2['name'];}_0x170415[_0xf0a9('0x16')](_0x75dfe6)[_0xf0a9('0x22')](_0x1596c2);};}exports[_0xf0a9('0x23')]=function(_0x4ab6dc,_0x59d33a){var _0x5697f1={},_0x43be45={},_0x3607da={'count':0x0,'rows':[]};var _0x170746=_[_0xf0a9('0x24')](db[_0xf0a9('0x25')][_0xf0a9('0x26')],function(_0x25adf0){return{'name':_0x25adf0['fieldName'],'type':_0x25adf0['type']['key']};});_0x43be45[_0xf0a9('0x27')]=_[_0xf0a9('0x24')](_0x170746,'name');_0x43be45['query']=_[_0xf0a9('0x28')](_0x4ab6dc[_0xf0a9('0x29')]);_0x43be45['filters']=_[_0xf0a9('0x2a')](_0x43be45[_0xf0a9('0x27')],_0x43be45[_0xf0a9('0x29')]);_0x5697f1[_0xf0a9('0x2b')]=_[_0xf0a9('0x2a')](_0x43be45[_0xf0a9('0x27')],qs[_0xf0a9('0x2c')](_0x4ab6dc['query'][_0xf0a9('0x2c')]));_0x5697f1[_0xf0a9('0x2b')]=_0x5697f1[_0xf0a9('0x2b')]['length']?_0x5697f1[_0xf0a9('0x2b')]:_0x43be45[_0xf0a9('0x27')];if(!_0x4ab6dc[_0xf0a9('0x29')][_0xf0a9('0x2d')]('nolimit')){_0x5697f1[_0xf0a9('0x2e')]=qs[_0xf0a9('0x2e')](_0x4ab6dc['query'][_0xf0a9('0x2e')]);_0x5697f1[_0xf0a9('0x18')]=qs[_0xf0a9('0x18')](_0x4ab6dc[_0xf0a9('0x29')][_0xf0a9('0x18')]);}_0x5697f1[_0xf0a9('0x2f')]=qs[_0xf0a9('0x30')](_0x4ab6dc[_0xf0a9('0x29')]['sort']);_0x5697f1['where']=qs[_0xf0a9('0x31')](_[_0xf0a9('0x32')](_0x4ab6dc[_0xf0a9('0x29')],_0x43be45['filters']),_0x170746);if(_0x4ab6dc['query']['filter']){_0x5697f1[_0xf0a9('0x33')]=_['merge'](_0x5697f1[_0xf0a9('0x33')],{'$or':_[_0xf0a9('0x24')](_0x170746,function(_0x4e9186){if(_0x4e9186[_0xf0a9('0x34')]!==_0xf0a9('0x35')){var _0x260b8f={};_0x260b8f[_0x4e9186['name']]={'$like':'%'+_0x4ab6dc[_0xf0a9('0x29')]['filter']+'%'};return _0x260b8f;}})});}_0x5697f1=_[_0xf0a9('0x36')]({},_0x5697f1,_0x4ab6dc[_0xf0a9('0x37')]);var _0x1fb2ec={'where':_0x5697f1[_0xf0a9('0x33')]};return db['FreshdeskField'][_0xf0a9('0x38')](_0x1fb2ec)[_0xf0a9('0x1d')](function(_0xdd465){_0x3607da[_0xf0a9('0x38')]=_0xdd465;if(_0x4ab6dc[_0xf0a9('0x29')][_0xf0a9('0x39')]){_0x5697f1['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xf0a9('0x3a')](_0x5697f1);})[_0xf0a9('0x1d')](function(_0x581c0c){_0x3607da[_0xf0a9('0x3b')]=_0x581c0c;return _0x3607da;})[_0xf0a9('0x1d')](respondWithFilteredResult(_0x59d33a,_0x5697f1))[_0xf0a9('0x3c')](handleError(_0x59d33a,null));};exports[_0xf0a9('0x3d')]=function(_0x4d7227,_0x12cc87){var _0x3c86d3={'raw':!![],'where':{'id':_0x4d7227['params']['id']}},_0x182ac3={};_0x182ac3[_0xf0a9('0x27')]=_[_0xf0a9('0x28')](db['FreshdeskField']['rawAttributes']);_0x182ac3[_0xf0a9('0x29')]=_['keys'](_0x4d7227[_0xf0a9('0x29')]);_0x182ac3[_0xf0a9('0x31')]=_[_0xf0a9('0x2a')](_0x182ac3[_0xf0a9('0x27')],_0x182ac3['query']);_0x3c86d3[_0xf0a9('0x2b')]=_[_0xf0a9('0x2a')](_0x182ac3['model'],qs[_0xf0a9('0x2c')](_0x4d7227[_0xf0a9('0x29')][_0xf0a9('0x2c')]));_0x3c86d3[_0xf0a9('0x2b')]=_0x3c86d3[_0xf0a9('0x2b')][_0xf0a9('0x3e')]?_0x3c86d3[_0xf0a9('0x2b')]:_0x182ac3[_0xf0a9('0x27')];if(_0x4d7227[_0xf0a9('0x29')][_0xf0a9('0x39')]){_0x3c86d3[_0xf0a9('0x3f')]=[{'all':!![]}];}_0x3c86d3=_[_0xf0a9('0x36')]({},_0x3c86d3,_0x4d7227[_0xf0a9('0x37')]);return db[_0xf0a9('0x25')]['find'](_0x3c86d3)[_0xf0a9('0x1d')](handleEntityNotFound(_0x12cc87,null))[_0xf0a9('0x1d')](respondWithResult(_0x12cc87,null))[_0xf0a9('0x3c')](handleError(_0x12cc87,null));};exports[_0xf0a9('0x40')]=function(_0x289003,_0x1c98e6){return db[_0xf0a9('0x25')][_0xf0a9('0x40')](_0x289003['body'],{})[_0xf0a9('0x1d')](respondWithResult(_0x1c98e6,0xc9))[_0xf0a9('0x3c')](handleError(_0x1c98e6,null));};exports[_0xf0a9('0x1c')]=function(_0x1e914d,_0x352c0c){if(_0x1e914d[_0xf0a9('0x41')]['id']){delete _0x1e914d['body']['id'];}return db[_0xf0a9('0x25')]['find']({'where':{'id':_0x1e914d['params']['id']}})[_0xf0a9('0x1d')](handleEntityNotFound(_0x352c0c,null))['then'](saveUpdates(_0x1e914d['body'],null))['then'](respondWithResult(_0x352c0c,null))[_0xf0a9('0x3c')](handleError(_0x352c0c,null));};exports[_0xf0a9('0x1e')]=function(_0x364981,_0x2d1b7b){return db[_0xf0a9('0x25')][_0xf0a9('0x42')]({'where':{'id':_0x364981[_0xf0a9('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d1b7b,null))[_0xf0a9('0x1d')](removeEntity(_0x2d1b7b,null))[_0xf0a9('0x3c')](handleError(_0x2d1b7b,null));}; \ No newline at end of file +var _0x75bd=['bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','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','save','then','destroy','error','stack','name','FreshdeskField','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','find','create','body','html-pdf','eml-format','zip-dir','request-promise','moment'];(function(_0x5d1566,_0x3fed4b){var _0x3441a2=function(_0x57c3fe){while(--_0x57c3fe){_0x5d1566['push'](_0x5d1566['shift']());}};_0x3441a2(++_0x3fed4b);}(_0x75bd,0x113));var _0xd75b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75bd[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xd75b('0x0'));var emlformat=require(_0xd75b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd75b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd75b('0x3'));var moment=require(_0xd75b('0x4'));var BPromise=require(_0xd75b('0x5'));var Mustache=require(_0xd75b('0x6'));var util=require(_0xd75b('0x7'));var path=require(_0xd75b('0x8'));var sox=require('sox');var csv=require(_0xd75b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd75b('0xa'));var squel=require('squel');var crypto=require(_0xd75b('0xb'));var jsforce=require(_0xd75b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd75b('0x9'));var querystring=require(_0xd75b('0xd'));var Papa=require(_0xd75b('0xe'));var Redis=require(_0xd75b('0xf'));var authService=require(_0xd75b('0x10'));var qs=require(_0xd75b('0x11'));var as=require(_0xd75b('0x12'));var hardwareService=require(_0xd75b('0x13'));var logger=require('../../config/logger')(_0xd75b('0x14'));var utils=require(_0xd75b('0x15'));var config=require('../../config/environment');var db=require(_0xd75b('0x16'))['db'];function respondWithStatusCode(_0x39040d,_0xe8e193){_0xe8e193=_0xe8e193||0xcc;return function(_0x4775d4){if(_0x4775d4){return _0x39040d[_0xd75b('0x17')](_0xe8e193);}return _0x39040d[_0xd75b('0x18')](_0xe8e193)[_0xd75b('0x19')]();};}function respondWithResult(_0x547423,_0x3fb939){_0x3fb939=_0x3fb939||0xc8;return function(_0x49954d){if(_0x49954d){return _0x547423[_0xd75b('0x18')](_0x3fb939)[_0xd75b('0x1a')](_0x49954d);}};}function respondWithFilteredResult(_0x1776d7,_0x5362d2){return function(_0x1c35e0){if(_0x1c35e0){var _0x37a1f4=_0x1c35e0[_0xd75b('0x1b')],_0x3db384=_0x5362d2[_0xd75b('0x1c')],_0x1d71fc=_0x5362d2[_0xd75b('0x1c')]+_0x5362d2['limit'],_0x578c7c;if(_0x1d71fc>=_0x37a1f4){_0x1d71fc=_0x37a1f4;_0x578c7c=0xc8;}else{_0x578c7c=0xce;}_0x1776d7[_0xd75b('0x18')](_0x578c7c);return _0x1776d7[_0xd75b('0x1d')](_0xd75b('0x1e'),_0x3db384+'-'+_0x1d71fc+'/'+_0x37a1f4)['json'](_0x1c35e0);}return null;};}function patchUpdates(_0x4ad9ab){return function(_0x45978a){try{jsonpatch['apply'](_0x45978a,_0x4ad9ab,!![]);}catch(_0x5d3afe){return BPromise['reject'](_0x5d3afe);}return _0x45978a[_0xd75b('0x1f')]();};}function saveUpdates(_0x3cb617,_0x2fb0f8){return function(_0x28d0b7){if(_0x28d0b7){return _0x28d0b7['update'](_0x3cb617)[_0xd75b('0x20')](function(_0x4184fc){return _0x4184fc;});}return null;};}function removeEntity(_0x36a461,_0x5c7b75){return function(_0x5be884){if(_0x5be884){return _0x5be884[_0xd75b('0x21')]()[_0xd75b('0x20')](function(){_0x36a461[_0xd75b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aea75,_0xf932b4){return function(_0x8a0ab5){if(!_0x8a0ab5){_0x1aea75['sendStatus'](0x194);}return _0x8a0ab5;};}function handleError(_0x3c2a4a,_0x353052){_0x353052=_0x353052||0x1f4;return function(_0x4bba7c){logger[_0xd75b('0x22')](_0x4bba7c[_0xd75b('0x23')]);if(_0x4bba7c[_0xd75b('0x24')]){delete _0x4bba7c[_0xd75b('0x24')];}_0x3c2a4a[_0xd75b('0x18')](_0x353052)['send'](_0x4bba7c);};}exports['index']=function(_0x2af650,_0x3c0cc3){var _0x588782={},_0x3e50b2={},_0x2d4205={'count':0x0,'rows':[]};var _0x14b441=_['map'](db[_0xd75b('0x25')][_0xd75b('0x26')],function(_0x140cc3){return{'name':_0x140cc3[_0xd75b('0x27')],'type':_0x140cc3[_0xd75b('0x28')][_0xd75b('0x29')]};});_0x3e50b2['model']=_[_0xd75b('0x2a')](_0x14b441,'name');_0x3e50b2[_0xd75b('0x2b')]=_['keys'](_0x2af650[_0xd75b('0x2b')]);_0x3e50b2[_0xd75b('0x2c')]=_[_0xd75b('0x2d')](_0x3e50b2[_0xd75b('0x2e')],_0x3e50b2[_0xd75b('0x2b')]);_0x588782[_0xd75b('0x2f')]=_['intersection'](_0x3e50b2[_0xd75b('0x2e')],qs[_0xd75b('0x30')](_0x2af650[_0xd75b('0x2b')]['fields']));_0x588782[_0xd75b('0x2f')]=_0x588782[_0xd75b('0x2f')][_0xd75b('0x31')]?_0x588782[_0xd75b('0x2f')]:_0x3e50b2[_0xd75b('0x2e')];if(!_0x2af650['query'][_0xd75b('0x32')](_0xd75b('0x33'))){_0x588782[_0xd75b('0x34')]=qs[_0xd75b('0x34')](_0x2af650[_0xd75b('0x2b')][_0xd75b('0x34')]);_0x588782[_0xd75b('0x1c')]=qs['offset'](_0x2af650[_0xd75b('0x2b')]['offset']);}_0x588782[_0xd75b('0x35')]=qs[_0xd75b('0x36')](_0x2af650[_0xd75b('0x2b')][_0xd75b('0x36')]);_0x588782[_0xd75b('0x37')]=qs['filters'](_[_0xd75b('0x38')](_0x2af650[_0xd75b('0x2b')],_0x3e50b2['filters']),_0x14b441);if(_0x2af650[_0xd75b('0x2b')][_0xd75b('0x39')]){_0x588782[_0xd75b('0x37')]=_[_0xd75b('0x3a')](_0x588782[_0xd75b('0x37')],{'$or':_[_0xd75b('0x2a')](_0x14b441,function(_0x29a860){if(_0x29a860[_0xd75b('0x28')]!==_0xd75b('0x3b')){var _0x54607b={};_0x54607b[_0x29a860[_0xd75b('0x24')]]={'$like':'%'+_0x2af650[_0xd75b('0x2b')][_0xd75b('0x39')]+'%'};return _0x54607b;}})});}_0x588782=_[_0xd75b('0x3a')]({},_0x588782,_0x2af650['options']);var _0x40697e={'where':_0x588782[_0xd75b('0x37')]};return db[_0xd75b('0x25')][_0xd75b('0x1b')](_0x40697e)[_0xd75b('0x20')](function(_0x4c97a5){_0x2d4205[_0xd75b('0x1b')]=_0x4c97a5;if(_0x2af650[_0xd75b('0x2b')][_0xd75b('0x3c')]){_0x588782[_0xd75b('0x3d')]=[{'all':!![]}];}return db[_0xd75b('0x25')][_0xd75b('0x3e')](_0x588782);})['then'](function(_0x2f0530){_0x2d4205[_0xd75b('0x3f')]=_0x2f0530;return _0x2d4205;})['then'](respondWithFilteredResult(_0x3c0cc3,_0x588782))[_0xd75b('0x40')](handleError(_0x3c0cc3,null));};exports['show']=function(_0xe48eba,_0xbf6c41){var _0x24b141={'raw':!![],'where':{'id':_0xe48eba[_0xd75b('0x41')]['id']}},_0x2d9303={};_0x2d9303[_0xd75b('0x2e')]=_[_0xd75b('0x42')](db[_0xd75b('0x25')][_0xd75b('0x26')]);_0x2d9303[_0xd75b('0x2b')]=_[_0xd75b('0x42')](_0xe48eba['query']);_0x2d9303[_0xd75b('0x2c')]=_[_0xd75b('0x2d')](_0x2d9303[_0xd75b('0x2e')],_0x2d9303['query']);_0x24b141[_0xd75b('0x2f')]=_[_0xd75b('0x2d')](_0x2d9303['model'],qs[_0xd75b('0x30')](_0xe48eba['query'][_0xd75b('0x30')]));_0x24b141[_0xd75b('0x2f')]=_0x24b141[_0xd75b('0x2f')]['length']?_0x24b141[_0xd75b('0x2f')]:_0x2d9303[_0xd75b('0x2e')];if(_0xe48eba[_0xd75b('0x2b')][_0xd75b('0x3c')]){_0x24b141['include']=[{'all':!![]}];}_0x24b141=_[_0xd75b('0x3a')]({},_0x24b141,_0xe48eba['options']);return db['FreshdeskField'][_0xd75b('0x43')](_0x24b141)['then'](handleEntityNotFound(_0xbf6c41,null))['then'](respondWithResult(_0xbf6c41,null))[_0xd75b('0x40')](handleError(_0xbf6c41,null));};exports[_0xd75b('0x44')]=function(_0x78088d,_0x19380f){return db['FreshdeskField'][_0xd75b('0x44')](_0x78088d[_0xd75b('0x45')],{})[_0xd75b('0x20')](respondWithResult(_0x19380f,0xc9))['catch'](handleError(_0x19380f,null));};exports['update']=function(_0x441b7b,_0x33a782){if(_0x441b7b[_0xd75b('0x45')]['id']){delete _0x441b7b[_0xd75b('0x45')]['id'];}return db[_0xd75b('0x25')][_0xd75b('0x43')]({'where':{'id':_0x441b7b[_0xd75b('0x41')]['id']}})['then'](handleEntityNotFound(_0x33a782,null))[_0xd75b('0x20')](saveUpdates(_0x441b7b[_0xd75b('0x45')],null))[_0xd75b('0x20')](respondWithResult(_0x33a782,null))[_0xd75b('0x40')](handleError(_0x33a782,null));};exports[_0xd75b('0x21')]=function(_0x2dd30a,_0x30b4c9){return db['FreshdeskField']['find']({'where':{'id':_0x2dd30a['params']['id']}})[_0xd75b('0x20')](handleEntityNotFound(_0x30b4c9,null))[_0xd75b('0x20')](removeEntity(_0x30b4c9,null))[_0xd75b('0x40')](handleError(_0x30b4c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index da2d52d..dc92b73 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 _0x388c=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x25d110,_0x50be7d){var _0x182baf=function(_0x10338e){while(--_0x10338e){_0x25d110['push'](_0x25d110['shift']());}};_0x182baf(++_0x50be7d);}(_0x388c,0x18c));var _0xc388=function(_0x450bbc,_0x1b7af3){_0x450bbc=_0x450bbc-0x0;var _0x3f558a=_0x388c[_0x450bbc];return _0x3f558a;};'use strict';var _=require(_0xc388('0x0'));var util=require(_0xc388('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc388('0x2'));var BPromise=require(_0xc388('0x3'));var rp=require(_0xc388('0x4'));var fs=require('fs');var path=require(_0xc388('0x5'));var rimraf=require('rimraf');var config=require(_0xc388('0x6'));var attributes=require(_0xc388('0x7'));module['exports']=function(_0x4421f8,_0x1724c7){return _0x4421f8['define'](_0xc388('0x8'),attributes,{'tableName':_0xc388('0x9'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xc388('0xa'),_0xc388('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0080=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId'];(function(_0x33f119,_0x5621e5){var _0x27c6b3=function(_0x24a76e){while(--_0x24a76e){_0x33f119['push'](_0x33f119['shift']());}};_0x27c6b3(++_0x5621e5);}(_0x0080,0x80));var _0x0008=function(_0xdade7d,_0x29203d){_0xdade7d=_0xdade7d-0x0;var _0x44817d=_0x0080[_0xdade7d];return _0x44817d;};'use strict';var _=require(_0x0008('0x0'));var util=require(_0x0008('0x1'));var logger=require(_0x0008('0x2'))(_0x0008('0x3'));var moment=require(_0x0008('0x4'));var BPromise=require(_0x0008('0x5'));var rp=require(_0x0008('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0008('0x7'));var config=require(_0x0008('0x8'));var attributes=require(_0x0008('0x9'));module[_0x0008('0xa')]=function(_0x1460fc,_0x233b5f){return _0x1460fc[_0x0008('0xb')](_0x0008('0xc'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x0008('0xd'),'fields':[_0x0008('0xe'),_0x0008('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 7c252c4..e6c0925 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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5df1f8,_0x49cffc){_0x5df1f8=_0x5df1f8-0x0;var _0xed191e=_0x7a54[_0x5df1f8];return _0xed191e;};'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 +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(_0x5ef5c6,_0x5363dd){var _0x3bb60d=function(_0x50cba6){while(--_0x50cba6){_0x5ef5c6['push'](_0x5ef5c6['shift']());}};_0x3bb60d(++_0x5363dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xb10b[_0x24875d];return _0x181471;};'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 diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 5a1dc0d..1b3f1d9 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 _0xe6ff=['/:id/configurations','/:id/fields','post','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','index','isAuthenticated','show'];(function(_0x392c04,_0x165501){var _0x5dddf4=function(_0x3f9972){while(--_0x3f9972){_0x392c04['push'](_0x392c04['shift']());}};_0x5dddf4(++_0x165501);}(_0xe6ff,0xa7));var _0xfe6f=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xe6ff[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xfe6f('0x0'));var util=require(_0xfe6f('0x1'));var path=require(_0xfe6f('0x2'));var timeout=require(_0xfe6f('0x3'));var express=require(_0xfe6f('0x4'));var router=express[_0xfe6f('0x5')]();var auth=require(_0xfe6f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfe6f('0x7'));var controller=require(_0xfe6f('0x8'));router[_0xfe6f('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe6f('0xa')]);router['get']('/:id',auth[_0xfe6f('0xb')](),controller[_0xfe6f('0xc')]);router[_0xfe6f('0x9')](_0xfe6f('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xfe6f('0xe'),auth[_0xfe6f('0xb')](),controller['getFields']);router[_0xfe6f('0xf')]('/',auth[_0xfe6f('0xb')](),controller[_0xfe6f('0x10')]);router['post'](_0xfe6f('0xd'),auth[_0xfe6f('0xb')](),controller['addConfiguration']);router[_0xfe6f('0x11')]('/:id',auth[_0xfe6f('0xb')](),controller['update']);router['delete'](_0xfe6f('0x12'),auth[_0xfe6f('0xb')](),controller['destroy']);module[_0xfe6f('0x13')]=router; \ No newline at end of file +var _0xd3e8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xd3e8,0x16b));var _0x8d3e=function(_0x16b042,_0x1ce781){_0x16b042=_0x16b042-0x0;var _0x49c89c=_0xd3e8[_0x16b042];return _0x49c89c;};'use strict';var multer=require(_0x8d3e('0x0'));var util=require('util');var path=require(_0x8d3e('0x1'));var timeout=require(_0x8d3e('0x2'));var express=require(_0x8d3e('0x3'));var router=express[_0x8d3e('0x4')]();var auth=require(_0x8d3e('0x5'));var interaction=require(_0x8d3e('0x6'));var config=require(_0x8d3e('0x7'));var controller=require(_0x8d3e('0x8'));router[_0x8d3e('0x9')]('/',auth[_0x8d3e('0xa')](),controller['index']);router[_0x8d3e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8d3e('0xb')]);router[_0x8d3e('0x9')](_0x8d3e('0xc'),auth[_0x8d3e('0xa')](),controller[_0x8d3e('0xd')]);router['get'](_0x8d3e('0xe'),auth[_0x8d3e('0xa')](),controller[_0x8d3e('0xf')]);router[_0x8d3e('0x10')]('/',auth[_0x8d3e('0xa')](),controller[_0x8d3e('0x11')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8d3e('0x12')]('/:id',auth[_0x8d3e('0xa')](),controller['update']);router[_0x8d3e('0x13')](_0x8d3e('0x14'),auth['isAuthenticated'](),controller[_0x8d3e('0x15')]);module[_0x8d3e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index e375194..fedac4b 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 _0x70e3=['username','sequelize','exports','STRING'];(function(_0x303051,_0x4943ac){var _0x51f377=function(_0x76b626){while(--_0x76b626){_0x303051['push'](_0x303051['shift']());}};_0x51f377(++_0x4943ac);}(_0x70e3,0x9d));var _0x370e=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x70e3[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x370e('0x0'));module[_0x370e('0x1')]={'name':{'type':Sequelize[_0x370e('0x2')]},'description':{'type':Sequelize[_0x370e('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x370e('0x3')},'apiKey':{'type':Sequelize[_0x370e('0x2')]},'remoteUri':{'type':Sequelize[_0x370e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x370e('0x2')]}}; \ No newline at end of file +var _0x341c=['sequelize','STRING','username','remoteUri'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x341c,0xcc));var _0xc341=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x341c[_0x212579];return _0x55d50e;};'use strict';var Sequelize=require(_0xc341('0x0'));module['exports']={'name':{'type':Sequelize[_0xc341('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc341('0x1')],'unique':_0xc341('0x2')},'apiKey':{'type':Sequelize[_0xc341('0x1')]},'remoteUri':{'type':Sequelize[_0xc341('0x1')],'unique':_0xc341('0x3')},'serverUrl':{'type':Sequelize[_0xc341('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 17fffa3..33c2f7a 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 _0xf2e3=['../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','includeAll','include','rows','show','attributes','options','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','remoteUri','apiKey','slice','GET','format','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields','test','Wrong\x20credentials','html-pdf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x3c498f,_0x1a9eef){var _0x2104b8=function(_0x2d8b1a){while(--_0x2d8b1a){_0x3c498f['push'](_0x3c498f['shift']());}};_0x2104b8(++_0x1a9eef);}(_0xf2e3,0xc8));var _0x3f2e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2e3[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x3f2e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3f2e('0x1'));var rp=require(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3f2e('0x5'));var sox=require(_0x3f2e('0x6'));var csv=require(_0x3f2e('0x7'));var ejs=require(_0x3f2e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3f2e('0x9'));var crypto=require('crypto');var jsforce=require(_0x3f2e('0xa'));var deskjs=require(_0x3f2e('0xb'));var toCsv=require(_0x3f2e('0x7'));var querystring=require(_0x3f2e('0xc'));var Papa=require('papaparse');var Redis=require(_0x3f2e('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f2e('0xe'));var logger=require(_0x3f2e('0xf'))('api');var utils=require(_0x3f2e('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x3f2e('0x11'));var jayson=require(_0x3f2e('0x12'));var client=jayson[_0x3f2e('0x13')][_0x3f2e('0x14')]({'port':0x232a});function checkPasswordPattern(_0x4943c5,_0x51c676,_0x54b832){if(_0x54b832){var _0x1a988f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a988f['test'](_0x51c676)){return _0x4943c5;}else{throw new db[(_0x3f2e('0x15'))][(_0x3f2e('0x16'))]('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 _0x4943c5;}}function respondWithRpcPromise(_0x5ba0b9,_0x534baa,_0x3ac049,_0x5a52d5){return new BPromise(function(_0x59c824,_0x8e90c1){var _0x3a3d51=_0x5a52d5||client;return _0x3a3d51[_0x3f2e('0x17')](_0x5ba0b9,_0x3ac049)[_0x3f2e('0x18')](function(_0x55fdd4){logger[_0x3f2e('0x19')](_0x3f2e('0x1a'),_0x534baa,_0x3f2e('0x1b'));logger[_0x3f2e('0x1c')](_0x3f2e('0x1d'),_0x534baa,_0x3f2e('0x1b'),JSON[_0x3f2e('0x1e')](_0x55fdd4));if(_0x55fdd4[_0x3f2e('0x1f')]){if(_0x55fdd4[_0x3f2e('0x1f')][_0x3f2e('0x20')]===0x1f4){logger[_0x3f2e('0x1f')](_0x3f2e('0x1a'),_0x534baa,_0x55fdd4[_0x3f2e('0x1f')]['message']);return _0x8e90c1(_0x55fdd4[_0x3f2e('0x1f')][_0x3f2e('0x21')]);}logger[_0x3f2e('0x1f')](_0x3f2e('0x1a'),_0x534baa,_0x55fdd4[_0x3f2e('0x1f')][_0x3f2e('0x21')]);return _0x59c824(_0x55fdd4[_0x3f2e('0x1f')][_0x3f2e('0x21')]);}else{logger[_0x3f2e('0x19')]('FreshsalesAccount,\x20%s,\x20%s',_0x534baa,_0x3f2e('0x1b'));_0x59c824(_0x55fdd4['result'][_0x3f2e('0x21')]);}})[_0x3f2e('0x22')](function(_0x1d3a83){logger[_0x3f2e('0x1f')](_0x3f2e('0x1a'),_0x534baa,_0x1d3a83);_0x8e90c1(_0x1d3a83);});});}function respondWithStatusCode(_0x871642,_0x490e90){_0x490e90=_0x490e90||0xcc;return function(_0x1bae33){if(_0x1bae33){return _0x871642[_0x3f2e('0x23')](_0x490e90);}return _0x871642[_0x3f2e('0x24')](_0x490e90)[_0x3f2e('0x25')]();};}function respondWithResult(_0x2c83bf,_0x57899c){_0x57899c=_0x57899c||0xc8;return function(_0x5e52f4){if(_0x5e52f4){return _0x2c83bf[_0x3f2e('0x24')](_0x57899c)[_0x3f2e('0x26')](_0x5e52f4);}};}function respondWithFilteredResult(_0x2c3012,_0x1c56ec){return function(_0x4cc63f){if(_0x4cc63f){var _0x1ebede=_0x4cc63f[_0x3f2e('0x27')],_0x5c95ea=_0x1c56ec[_0x3f2e('0x28')],_0x186833=_0x1c56ec[_0x3f2e('0x28')]+_0x1c56ec['limit'],_0x1bf694;if(_0x186833>=_0x1ebede){_0x186833=_0x1ebede;_0x1bf694=0xc8;}else{_0x1bf694=0xce;}_0x2c3012[_0x3f2e('0x24')](_0x1bf694);return _0x2c3012[_0x3f2e('0x29')](_0x3f2e('0x2a'),_0x5c95ea+'-'+_0x186833+'/'+_0x1ebede)[_0x3f2e('0x26')](_0x4cc63f);}return null;};}function patchUpdates(_0x46e047){return function(_0x2ac1de){try{jsonpatch[_0x3f2e('0x2b')](_0x2ac1de,_0x46e047,!![]);}catch(_0xbb01d6){return BPromise[_0x3f2e('0x2c')](_0xbb01d6);}return _0x2ac1de[_0x3f2e('0x2d')]();};}function saveUpdates(_0x122831,_0x1bede2){return function(_0x27933e){if(_0x27933e){return _0x27933e[_0x3f2e('0x2e')](_0x122831)[_0x3f2e('0x18')](function(_0x59b745){return _0x59b745;});}return null;};}function removeEntity(_0x2c4e90,_0x4e2363){return function(_0x36f76f){if(_0x36f76f){return _0x36f76f[_0x3f2e('0x2f')]()[_0x3f2e('0x18')](function(){_0x2c4e90[_0x3f2e('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc76f93,_0x52378a){return function(_0x40a139){if(!_0x40a139){_0xc76f93[_0x3f2e('0x23')](0x194);}return _0x40a139;};}function handleError(_0x4b5f66,_0x1fd634){_0x1fd634=_0x1fd634||0x1f4;return function(_0x5b1ccf){logger[_0x3f2e('0x1f')](_0x5b1ccf[_0x3f2e('0x30')]);if(_0x5b1ccf['name']){delete _0x5b1ccf['name'];}_0x4b5f66['status'](_0x1fd634)[_0x3f2e('0x31')](_0x5b1ccf);};}exports[_0x3f2e('0x32')]=function(_0x1097cd,_0x4ac4d4){var _0x3c08b9={},_0x44a29c={},_0x468c0a={'count':0x0,'rows':[]};var _0x10ca59=_[_0x3f2e('0x33')](db[_0x3f2e('0x34')][_0x3f2e('0x35')],function(_0x7c4ec8){return{'name':_0x7c4ec8[_0x3f2e('0x36')],'type':_0x7c4ec8[_0x3f2e('0x37')][_0x3f2e('0x38')]};});_0x44a29c['model']=_[_0x3f2e('0x33')](_0x10ca59,_0x3f2e('0x39'));_0x44a29c[_0x3f2e('0x3a')]=_[_0x3f2e('0x3b')](_0x1097cd[_0x3f2e('0x3a')]);_0x44a29c[_0x3f2e('0x3c')]=_[_0x3f2e('0x3d')](_0x44a29c[_0x3f2e('0x3e')],_0x44a29c[_0x3f2e('0x3a')]);_0x3c08b9['attributes']=_[_0x3f2e('0x3d')](_0x44a29c[_0x3f2e('0x3e')],qs[_0x3f2e('0x3f')](_0x1097cd[_0x3f2e('0x3a')][_0x3f2e('0x3f')]));_0x3c08b9['attributes']=_0x3c08b9['attributes'][_0x3f2e('0x40')]?_0x3c08b9['attributes']:_0x44a29c['model'];if(!_0x1097cd['query'][_0x3f2e('0x41')](_0x3f2e('0x42'))){_0x3c08b9[_0x3f2e('0x43')]=qs[_0x3f2e('0x43')](_0x1097cd['query']['limit']);_0x3c08b9[_0x3f2e('0x28')]=qs[_0x3f2e('0x28')](_0x1097cd[_0x3f2e('0x3a')][_0x3f2e('0x28')]);}_0x3c08b9['order']=qs['sort'](_0x1097cd['query'][_0x3f2e('0x44')]);_0x3c08b9[_0x3f2e('0x45')]=qs[_0x3f2e('0x3c')](_['pick'](_0x1097cd['query'],_0x44a29c[_0x3f2e('0x3c')]),_0x10ca59);if(_0x1097cd[_0x3f2e('0x3a')][_0x3f2e('0x46')]){_0x3c08b9[_0x3f2e('0x45')]=_[_0x3f2e('0x47')](_0x3c08b9[_0x3f2e('0x45')],{'$or':_[_0x3f2e('0x33')](_0x10ca59,function(_0x2f390e){if(_0x2f390e['type']!=='VIRTUAL'){var _0x584bc4={};_0x584bc4[_0x2f390e[_0x3f2e('0x39')]]={'$like':'%'+_0x1097cd[_0x3f2e('0x3a')][_0x3f2e('0x46')]+'%'};return _0x584bc4;}})});}_0x3c08b9=_[_0x3f2e('0x47')]({},_0x3c08b9,_0x1097cd['options']);var _0x5b7368={'where':_0x3c08b9[_0x3f2e('0x45')]};return db['FreshsalesAccount']['count'](_0x5b7368)[_0x3f2e('0x18')](function(_0x28e9d4){_0x468c0a[_0x3f2e('0x27')]=_0x28e9d4;if(_0x1097cd[_0x3f2e('0x3a')][_0x3f2e('0x48')]){_0x3c08b9[_0x3f2e('0x49')]=[{'all':!![]}];}return db[_0x3f2e('0x34')]['findAll'](_0x3c08b9);})[_0x3f2e('0x18')](function(_0x317acb){_0x468c0a[_0x3f2e('0x4a')]=_0x317acb;return _0x468c0a;})[_0x3f2e('0x18')](respondWithFilteredResult(_0x4ac4d4,_0x3c08b9))[_0x3f2e('0x22')](handleError(_0x4ac4d4,null));};exports[_0x3f2e('0x4b')]=function(_0x1aaf1b,_0x50df15){var _0x47190f={'raw':![],'where':{'id':_0x1aaf1b['params']['id']}},_0x13c435={};_0x13c435['model']=_[_0x3f2e('0x3b')](db[_0x3f2e('0x34')][_0x3f2e('0x35')]);_0x13c435[_0x3f2e('0x3a')]=_[_0x3f2e('0x3b')](_0x1aaf1b['query']);_0x13c435[_0x3f2e('0x3c')]=_['intersection'](_0x13c435[_0x3f2e('0x3e')],_0x13c435['query']);_0x47190f['attributes']=_['intersection'](_0x13c435[_0x3f2e('0x3e')],qs['fields'](_0x1aaf1b[_0x3f2e('0x3a')]['fields']));_0x47190f[_0x3f2e('0x4c')]=_0x47190f['attributes'][_0x3f2e('0x40')]?_0x47190f[_0x3f2e('0x4c')]:_0x13c435['model'];if(_0x1aaf1b['query']['includeAll']){_0x47190f[_0x3f2e('0x49')]=[{'all':!![]}];}_0x47190f=_['merge']({},_0x47190f,_0x1aaf1b[_0x3f2e('0x4d')]);return db[_0x3f2e('0x34')][_0x3f2e('0x4e')](_0x47190f)[_0x3f2e('0x18')](handleEntityNotFound(_0x50df15,null))[_0x3f2e('0x18')](respondWithResult(_0x50df15,null))[_0x3f2e('0x22')](handleError(_0x50df15,null));};exports['create']=function(_0x57a4f9,_0x553b29){return db[_0x3f2e('0x34')][_0x3f2e('0x4f')](_0x57a4f9[_0x3f2e('0x50')],{})[_0x3f2e('0x18')](respondWithResult(_0x553b29,0xc9))[_0x3f2e('0x22')](handleError(_0x553b29,null));};exports[_0x3f2e('0x2e')]=function(_0x5abcb8,_0x3faffc){if(_0x5abcb8[_0x3f2e('0x50')]['id']){delete _0x5abcb8['body']['id'];}return db[_0x3f2e('0x34')]['find']({'where':{'id':_0x5abcb8['params']['id']}})[_0x3f2e('0x18')](handleEntityNotFound(_0x3faffc,null))[_0x3f2e('0x18')](saveUpdates(_0x5abcb8['body'],null))['then'](respondWithResult(_0x3faffc,null))[_0x3f2e('0x22')](handleError(_0x3faffc,null));};exports[_0x3f2e('0x2f')]=function(_0x1402f5,_0x368c07){return db[_0x3f2e('0x34')]['find']({'where':{'id':_0x1402f5[_0x3f2e('0x51')]['id']}})[_0x3f2e('0x18')](handleEntityNotFound(_0x368c07,null))[_0x3f2e('0x18')](removeEntity(_0x368c07,null))[_0x3f2e('0x22')](handleError(_0x368c07,null));};exports[_0x3f2e('0x52')]=function(_0x526a8a,_0x4fa458,_0x549d2e){var _0x2ae135={};var _0x28d839={};var _0x3824e9;var _0xa1dd89;return db['FreshsalesAccount'][_0x3f2e('0x53')]({'where':{'id':_0x526a8a['params']['id']}})[_0x3f2e('0x18')](handleEntityNotFound(_0x4fa458,null))[_0x3f2e('0x18')](function(_0x25ecfd){if(_0x25ecfd){_0x3824e9=_0x25ecfd;_0x28d839[_0x3f2e('0x3e')]=_[_0x3f2e('0x3b')](db[_0x3f2e('0x54')]['rawAttributes']);_0x28d839[_0x3f2e('0x3a')]=_['keys'](_0x526a8a['query']);_0x28d839[_0x3f2e('0x3c')]=_[_0x3f2e('0x3d')](_0x28d839[_0x3f2e('0x3e')],_0x28d839[_0x3f2e('0x3a')]);_0x2ae135['attributes']=_[_0x3f2e('0x3d')](_0x28d839[_0x3f2e('0x3e')],qs[_0x3f2e('0x3f')](_0x526a8a['query'][_0x3f2e('0x3f')]));_0x2ae135['attributes']=_0x2ae135[_0x3f2e('0x4c')][_0x3f2e('0x40')]?_0x2ae135[_0x3f2e('0x4c')]:_0x28d839[_0x3f2e('0x3e')];_0x2ae135['order']=qs[_0x3f2e('0x44')](_0x526a8a[_0x3f2e('0x3a')][_0x3f2e('0x44')]);_0x2ae135[_0x3f2e('0x45')]=qs['filters'](_[_0x3f2e('0x55')](_0x526a8a['query'],_0x28d839['filters']));if(_0x526a8a[_0x3f2e('0x3a')][_0x3f2e('0x46')]){_0x2ae135[_0x3f2e('0x45')]=_['merge'](_0x2ae135[_0x3f2e('0x45')],{'$or':_['map'](_0x2ae135['attributes'],function(_0x77f1bc){var _0x2d9c7f={};_0x2d9c7f[_0x77f1bc]={'$like':'%'+_0x526a8a['query']['filter']+'%'};return _0x2d9c7f;})});}_0x2ae135=_[_0x3f2e('0x47')]({},_0x2ae135,_0x526a8a['options']);return _0x3824e9[_0x3f2e('0x52')](_0x2ae135);}})[_0x3f2e('0x18')](function(_0x1e89c6){if(_0x1e89c6){_0xa1dd89=_0x1e89c6['length'];if(!_0x526a8a['query'][_0x3f2e('0x41')](_0x3f2e('0x42'))){_0x2ae135['limit']=qs[_0x3f2e('0x43')](_0x526a8a['query'][_0x3f2e('0x43')]);_0x2ae135[_0x3f2e('0x28')]=qs[_0x3f2e('0x28')](_0x526a8a[_0x3f2e('0x3a')][_0x3f2e('0x28')]);}return _0x3824e9['getConfigurations'](_0x2ae135);}})[_0x3f2e('0x18')](function(_0x1fbc48){if(_0x1fbc48){return _0x1fbc48?{'count':_0xa1dd89,'rows':_0x1fbc48}:null;}})[_0x3f2e('0x18')](respondWithResult(_0x4fa458,null))['catch'](handleError(_0x4fa458,null));};exports[_0x3f2e('0x56')]=function(_0x375546,_0x39c0c7,_0x220f29){if(_0x375546[_0x3f2e('0x50')]['id']){delete _0x375546[_0x3f2e('0x50')]['id'];}return db[_0x3f2e('0x34')][_0x3f2e('0x53')]({'where':{'id':_0x375546[_0x3f2e('0x51')]['id']}})[_0x3f2e('0x18')](handleEntityNotFound(_0x39c0c7,null))[_0x3f2e('0x18')](function(_0x259372){if(_0x259372){_0x375546[_0x3f2e('0x50')][_0x3f2e('0x57')]=_0x259372['id'];_0x375546['body'][_0x3f2e('0x58')]=integrations[_0x3f2e('0x59')](_0x375546[_0x3f2e('0x50')][_0x3f2e('0x5a')],_0x375546[_0x3f2e('0x50')][_0x3f2e('0x37')]);_0x375546['body'][_0x3f2e('0x5b')]=integrations[_0x3f2e('0x5c')](_0x375546[_0x3f2e('0x50')][_0x3f2e('0x5a')],_0x375546[_0x3f2e('0x50')][_0x3f2e('0x37')]);return db[_0x3f2e('0x54')][_0x3f2e('0x4f')](_0x375546[_0x3f2e('0x50')],{'include':[{'model':db[_0x3f2e('0x5d')],'as':_0x3f2e('0x58')},{'model':db[_0x3f2e('0x5d')],'as':_0x3f2e('0x5b')}]});}return null;})[_0x3f2e('0x18')](respondWithResult(_0x39c0c7,null))[_0x3f2e('0x22')](handleError(_0x39c0c7,null));};exports['getFields']=function(_0x4b70b6,_0x52b293,_0x243fb4){var _0x2c6a78='';var _0x4a817e='';return db[_0x3f2e('0x34')][_0x3f2e('0x53')]({'where':{'id':_0x4b70b6['params']['id']},'attributes':['id',_0x3f2e('0x5e'),_0x3f2e('0x5f'),_0x3f2e('0x60')]})[_0x3f2e('0x18')](handleEntityNotFound(_0x52b293,null))['then'](function(_0x44a51e){if(_0x44a51e){_0x4a817e=_0x44a51e['username'];_0x2c6a78=_0x44a51e[_0x3f2e('0x5f')];var _0x328b0c=_0x44a51e[_0x3f2e('0x5f')][_0x3f2e('0x61')](-0x1);if(_0x328b0c==='/'){_0x2c6a78=_0x2c6a78['substring'](0x0,_0x2c6a78['lastIndexOf'](_0x328b0c));}return rp({'method':_0x3f2e('0x62'),'uri':util[_0x3f2e('0x63')]('%s%s',_0x2c6a78,_0x3f2e('0x64')),'headers':{'Authorization':_0x3f2e('0x65')+_0x44a51e[_0x3f2e('0x60')]},'json':!![]});}})[_0x3f2e('0x18')](function(_0x99ede4){if(_0x99ede4){var _0x3ad8b4=_0x99ede4['users'];var _0x47da96=![];var _0x1e1cb8=null;for(_0x1e1cb8=0x0;_0x1e1cb8<_0x3ad8b4[_0x3f2e('0x40')];_0x1e1cb8++){if(_0x3ad8b4[_0x1e1cb8][_0x3f2e('0x66')]===_0x4a817e){_0x47da96=!![];}}if(_0x47da96){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3f2e('0x67')});}}})[_0x3f2e('0x18')](respondWithResult(_0x52b293,null))[_0x3f2e('0x22')](function(_0x25c992){var _0x196c7a=_0x4b70b6[_0x3f2e('0x3a')]['test']?0x1f4:_0x25c992[_0x3f2e('0x68')]||0x1f4;logger[_0x3f2e('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x3f2e('0x69'),_0x196c7a,JSON[_0x3f2e('0x1e')](_0x25c992));delete _0x25c992[_0x3f2e('0x39')];if(_0x196c7a===0x191){_0x196c7a=0x190;}_0x52b293[_0x3f2e('0x24')](_0x196c7a)[_0x3f2e('0x31')](_0x4b70b6['query'][_0x3f2e('0x6a')]?{'message':_0x3f2e('0x6b'),'statusCode':_0x25c992[_0x3f2e('0x68')]}:_0x25c992);});}; \ No newline at end of file +var _0xecce=['lastIndexOf','format','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','stringify','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','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','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','destroy','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','getFields','apiKey','username','remoteUri','slice','substring'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xecce,0x7c));var _0xeecc=function(_0x227bfa,_0x51bedc){_0x227bfa=_0x227bfa-0x0;var _0x331aba=_0xecce[_0x227bfa];return _0x331aba;};'use strict';var pdf=require(_0xeecc('0x0'));var emlformat=require(_0xeecc('0x1'));var rimraf=require(_0xeecc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeecc('0x3'));var rp=require(_0xeecc('0x4'));var moment=require(_0xeecc('0x5'));var BPromise=require(_0xeecc('0x6'));var Mustache=require(_0xeecc('0x7'));var util=require(_0xeecc('0x8'));var path=require(_0xeecc('0x9'));var sox=require(_0xeecc('0xa'));var csv=require(_0xeecc('0xb'));var ejs=require(_0xeecc('0xc'));var fs=require('fs');var _=require(_0xeecc('0xd'));var squel=require(_0xeecc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeecc('0xf'));var toCsv=require(_0xeecc('0xb'));var querystring=require(_0xeecc('0x10'));var Papa=require(_0xeecc('0x11'));var Redis=require('ioredis');var authService=require(_0xeecc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeecc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeecc('0x14'))('api');var utils=require(_0xeecc('0x15'));var config=require(_0xeecc('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeecc('0x17'));var jayson=require(_0xeecc('0x18'));var client=jayson[_0xeecc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x15f404,_0x1c04e8,_0x6b1164){if(_0x6b1164){var _0x24b5e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24b5e4[_0xeecc('0x1a')](_0x1c04e8)){return _0x15f404;}else{throw new db['Sequelize'][(_0xeecc('0x1b'))](_0xeecc('0x1c'));}}else{return _0x15f404;}}function respondWithRpcPromise(_0x4c5704,_0x487b1a,_0x1e84e2,_0x1aa970){return new BPromise(function(_0xe6b060,_0x49d89a){var _0x112aad=_0x1aa970||client;return _0x112aad[_0xeecc('0x1d')](_0x4c5704,_0x1e84e2)[_0xeecc('0x1e')](function(_0x3a7921){logger[_0xeecc('0x1f')](_0xeecc('0x20'),_0x487b1a,_0xeecc('0x21'));logger['debug'](_0xeecc('0x22'),_0x487b1a,'request\x20sent',JSON['stringify'](_0x3a7921));if(_0x3a7921[_0xeecc('0x23')]){if(_0x3a7921['error'][_0xeecc('0x24')]===0x1f4){logger[_0xeecc('0x23')](_0xeecc('0x20'),_0x487b1a,_0x3a7921[_0xeecc('0x23')]['message']);return _0x49d89a(_0x3a7921['error'][_0xeecc('0x25')]);}logger[_0xeecc('0x23')](_0xeecc('0x20'),_0x487b1a,_0x3a7921[_0xeecc('0x23')]['message']);return _0xe6b060(_0x3a7921['error'][_0xeecc('0x25')]);}else{logger[_0xeecc('0x1f')](_0xeecc('0x20'),_0x487b1a,_0xeecc('0x21'));_0xe6b060(_0x3a7921[_0xeecc('0x26')][_0xeecc('0x25')]);}})['catch'](function(_0xb7fdd2){logger[_0xeecc('0x23')](_0xeecc('0x20'),_0x487b1a,_0xb7fdd2);_0x49d89a(_0xb7fdd2);});});}function respondWithStatusCode(_0xfc27ad,_0x20d631){_0x20d631=_0x20d631||0xcc;return function(_0x81236c){if(_0x81236c){return _0xfc27ad[_0xeecc('0x27')](_0x20d631);}return _0xfc27ad['status'](_0x20d631)['end']();};}function respondWithResult(_0x7b618,_0x546e73){_0x546e73=_0x546e73||0xc8;return function(_0x59dffe){if(_0x59dffe){return _0x7b618[_0xeecc('0x28')](_0x546e73)[_0xeecc('0x29')](_0x59dffe);}};}function respondWithFilteredResult(_0x5022c5,_0x2d7cbf){return function(_0x4fc840){if(_0x4fc840){var _0x30ab56=_0x4fc840[_0xeecc('0x2a')],_0x1a39bf=_0x2d7cbf[_0xeecc('0x2b')],_0x2b1a98=_0x2d7cbf[_0xeecc('0x2b')]+_0x2d7cbf['limit'],_0x4ab6b2;if(_0x2b1a98>=_0x30ab56){_0x2b1a98=_0x30ab56;_0x4ab6b2=0xc8;}else{_0x4ab6b2=0xce;}_0x5022c5[_0xeecc('0x28')](_0x4ab6b2);return _0x5022c5[_0xeecc('0x2c')](_0xeecc('0x2d'),_0x1a39bf+'-'+_0x2b1a98+'/'+_0x30ab56)['json'](_0x4fc840);}return null;};}function patchUpdates(_0x4d298d){return function(_0x109e1b){try{jsonpatch['apply'](_0x109e1b,_0x4d298d,!![]);}catch(_0x4e59a9){return BPromise[_0xeecc('0x2e')](_0x4e59a9);}return _0x109e1b[_0xeecc('0x2f')]();};}function saveUpdates(_0x438410,_0x423612){return function(_0x4419f8){if(_0x4419f8){return _0x4419f8[_0xeecc('0x30')](_0x438410)[_0xeecc('0x1e')](function(_0x52c9ba){return _0x52c9ba;});}return null;};}function removeEntity(_0x156674,_0xb6be6d){return function(_0x4ddb7a){if(_0x4ddb7a){return _0x4ddb7a[_0xeecc('0x31')]()['then'](function(){_0x156674['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f9411,_0x1c532b){return function(_0x3a4242){if(!_0x3a4242){_0x3f9411[_0xeecc('0x27')](0x194);}return _0x3a4242;};}function handleError(_0x1cb84c,_0x10141a){_0x10141a=_0x10141a||0x1f4;return function(_0x18f7ca){logger['error'](_0x18f7ca['stack']);if(_0x18f7ca['name']){delete _0x18f7ca['name'];}_0x1cb84c[_0xeecc('0x28')](_0x10141a)['send'](_0x18f7ca);};}exports[_0xeecc('0x32')]=function(_0xf7d75b,_0x32975c){var _0x51763d={},_0x41442e={},_0x20c864={'count':0x0,'rows':[]};var _0xb5256c=_[_0xeecc('0x33')](db[_0xeecc('0x34')][_0xeecc('0x35')],function(_0xef95e7){return{'name':_0xef95e7[_0xeecc('0x36')],'type':_0xef95e7[_0xeecc('0x37')][_0xeecc('0x38')]};});_0x41442e[_0xeecc('0x39')]=_[_0xeecc('0x33')](_0xb5256c,_0xeecc('0x3a'));_0x41442e[_0xeecc('0x3b')]=_[_0xeecc('0x3c')](_0xf7d75b['query']);_0x41442e[_0xeecc('0x3d')]=_[_0xeecc('0x3e')](_0x41442e[_0xeecc('0x39')],_0x41442e[_0xeecc('0x3b')]);_0x51763d[_0xeecc('0x3f')]=_[_0xeecc('0x3e')](_0x41442e[_0xeecc('0x39')],qs[_0xeecc('0x40')](_0xf7d75b[_0xeecc('0x3b')]['fields']));_0x51763d[_0xeecc('0x3f')]=_0x51763d[_0xeecc('0x3f')][_0xeecc('0x41')]?_0x51763d['attributes']:_0x41442e['model'];if(!_0xf7d75b['query'][_0xeecc('0x42')](_0xeecc('0x43'))){_0x51763d['limit']=qs[_0xeecc('0x44')](_0xf7d75b['query'][_0xeecc('0x44')]);_0x51763d[_0xeecc('0x2b')]=qs[_0xeecc('0x2b')](_0xf7d75b['query'][_0xeecc('0x2b')]);}_0x51763d[_0xeecc('0x45')]=qs[_0xeecc('0x46')](_0xf7d75b['query'][_0xeecc('0x46')]);_0x51763d[_0xeecc('0x47')]=qs[_0xeecc('0x3d')](_['pick'](_0xf7d75b['query'],_0x41442e['filters']),_0xb5256c);if(_0xf7d75b[_0xeecc('0x3b')][_0xeecc('0x48')]){_0x51763d[_0xeecc('0x47')]=_[_0xeecc('0x49')](_0x51763d[_0xeecc('0x47')],{'$or':_[_0xeecc('0x33')](_0xb5256c,function(_0x35f2aa){if(_0x35f2aa[_0xeecc('0x37')]!==_0xeecc('0x4a')){var _0x50aaed={};_0x50aaed[_0x35f2aa['name']]={'$like':'%'+_0xf7d75b['query'][_0xeecc('0x48')]+'%'};return _0x50aaed;}})});}_0x51763d=_['merge']({},_0x51763d,_0xf7d75b[_0xeecc('0x4b')]);var _0x5d4745={'where':_0x51763d[_0xeecc('0x47')]};return db[_0xeecc('0x34')][_0xeecc('0x2a')](_0x5d4745)[_0xeecc('0x1e')](function(_0x5799e2){_0x20c864['count']=_0x5799e2;if(_0xf7d75b[_0xeecc('0x3b')][_0xeecc('0x4c')]){_0x51763d[_0xeecc('0x4d')]=[{'all':!![]}];}return db[_0xeecc('0x34')]['findAll'](_0x51763d);})[_0xeecc('0x1e')](function(_0x2dcdd5){_0x20c864[_0xeecc('0x4e')]=_0x2dcdd5;return _0x20c864;})['then'](respondWithFilteredResult(_0x32975c,_0x51763d))[_0xeecc('0x4f')](handleError(_0x32975c,null));};exports[_0xeecc('0x50')]=function(_0xf56207,_0x35d511){var _0x1732ec={'raw':![],'where':{'id':_0xf56207[_0xeecc('0x51')]['id']}},_0x220fb6={};_0x220fb6['model']=_['keys'](db['FreshsalesAccount'][_0xeecc('0x35')]);_0x220fb6[_0xeecc('0x3b')]=_[_0xeecc('0x3c')](_0xf56207[_0xeecc('0x3b')]);_0x220fb6['filters']=_[_0xeecc('0x3e')](_0x220fb6['model'],_0x220fb6[_0xeecc('0x3b')]);_0x1732ec['attributes']=_['intersection'](_0x220fb6[_0xeecc('0x39')],qs['fields'](_0xf56207['query'][_0xeecc('0x40')]));_0x1732ec['attributes']=_0x1732ec[_0xeecc('0x3f')][_0xeecc('0x41')]?_0x1732ec['attributes']:_0x220fb6[_0xeecc('0x39')];if(_0xf56207[_0xeecc('0x3b')][_0xeecc('0x4c')]){_0x1732ec[_0xeecc('0x4d')]=[{'all':!![]}];}_0x1732ec=_[_0xeecc('0x49')]({},_0x1732ec,_0xf56207[_0xeecc('0x4b')]);return db[_0xeecc('0x34')]['find'](_0x1732ec)['then'](handleEntityNotFound(_0x35d511,null))[_0xeecc('0x1e')](respondWithResult(_0x35d511,null))['catch'](handleError(_0x35d511,null));};exports[_0xeecc('0x52')]=function(_0x441d20,_0x3f408b){return db[_0xeecc('0x34')][_0xeecc('0x52')](_0x441d20[_0xeecc('0x53')],{})[_0xeecc('0x1e')](respondWithResult(_0x3f408b,0xc9))[_0xeecc('0x4f')](handleError(_0x3f408b,null));};exports[_0xeecc('0x30')]=function(_0x15578d,_0x38694f){if(_0x15578d['body']['id']){delete _0x15578d[_0xeecc('0x53')]['id'];}return db['FreshsalesAccount'][_0xeecc('0x54')]({'where':{'id':_0x15578d[_0xeecc('0x51')]['id']}})[_0xeecc('0x1e')](handleEntityNotFound(_0x38694f,null))[_0xeecc('0x1e')](saveUpdates(_0x15578d[_0xeecc('0x53')],null))['then'](respondWithResult(_0x38694f,null))[_0xeecc('0x4f')](handleError(_0x38694f,null));};exports[_0xeecc('0x31')]=function(_0x292c0e,_0x372805){return db['FreshsalesAccount'][_0xeecc('0x54')]({'where':{'id':_0x292c0e['params']['id']}})['then'](handleEntityNotFound(_0x372805,null))['then'](removeEntity(_0x372805,null))[_0xeecc('0x4f')](handleError(_0x372805,null));};exports[_0xeecc('0x55')]=function(_0x1bfde0,_0x3c1229,_0x4a0f55){var _0x43fd1c={};var _0x4448e8={};var _0x3d2323;var _0xb644ad;return db[_0xeecc('0x34')][_0xeecc('0x56')]({'where':{'id':_0x1bfde0[_0xeecc('0x51')]['id']}})[_0xeecc('0x1e')](handleEntityNotFound(_0x3c1229,null))['then'](function(_0x3ad2f1){if(_0x3ad2f1){_0x3d2323=_0x3ad2f1;_0x4448e8[_0xeecc('0x39')]=_['keys'](db[_0xeecc('0x57')]['rawAttributes']);_0x4448e8[_0xeecc('0x3b')]=_['keys'](_0x1bfde0[_0xeecc('0x3b')]);_0x4448e8[_0xeecc('0x3d')]=_[_0xeecc('0x3e')](_0x4448e8[_0xeecc('0x39')],_0x4448e8[_0xeecc('0x3b')]);_0x43fd1c[_0xeecc('0x3f')]=_[_0xeecc('0x3e')](_0x4448e8['model'],qs['fields'](_0x1bfde0['query'][_0xeecc('0x40')]));_0x43fd1c[_0xeecc('0x3f')]=_0x43fd1c['attributes'][_0xeecc('0x41')]?_0x43fd1c['attributes']:_0x4448e8[_0xeecc('0x39')];_0x43fd1c['order']=qs['sort'](_0x1bfde0[_0xeecc('0x3b')][_0xeecc('0x46')]);_0x43fd1c[_0xeecc('0x47')]=qs[_0xeecc('0x3d')](_[_0xeecc('0x58')](_0x1bfde0[_0xeecc('0x3b')],_0x4448e8[_0xeecc('0x3d')]));if(_0x1bfde0[_0xeecc('0x3b')][_0xeecc('0x48')]){_0x43fd1c[_0xeecc('0x47')]=_[_0xeecc('0x49')](_0x43fd1c[_0xeecc('0x47')],{'$or':_['map'](_0x43fd1c[_0xeecc('0x3f')],function(_0x5fb6d8){var _0x2ba752={};_0x2ba752[_0x5fb6d8]={'$like':'%'+_0x1bfde0[_0xeecc('0x3b')][_0xeecc('0x48')]+'%'};return _0x2ba752;})});}_0x43fd1c=_[_0xeecc('0x49')]({},_0x43fd1c,_0x1bfde0[_0xeecc('0x4b')]);return _0x3d2323[_0xeecc('0x55')](_0x43fd1c);}})['then'](function(_0xef047){if(_0xef047){_0xb644ad=_0xef047[_0xeecc('0x41')];if(!_0x1bfde0[_0xeecc('0x3b')]['hasOwnProperty'](_0xeecc('0x43'))){_0x43fd1c['limit']=qs['limit'](_0x1bfde0[_0xeecc('0x3b')][_0xeecc('0x44')]);_0x43fd1c[_0xeecc('0x2b')]=qs[_0xeecc('0x2b')](_0x1bfde0[_0xeecc('0x3b')][_0xeecc('0x2b')]);}return _0x3d2323[_0xeecc('0x55')](_0x43fd1c);}})['then'](function(_0xda6f25){if(_0xda6f25){return _0xda6f25?{'count':_0xb644ad,'rows':_0xda6f25}:null;}})[_0xeecc('0x1e')](respondWithResult(_0x3c1229,null))[_0xeecc('0x4f')](handleError(_0x3c1229,null));};exports[_0xeecc('0x59')]=function(_0x3cb5ba,_0x4d8545,_0x21eb2e){if(_0x3cb5ba[_0xeecc('0x53')]['id']){delete _0x3cb5ba['body']['id'];}return db[_0xeecc('0x34')]['findOne']({'where':{'id':_0x3cb5ba[_0xeecc('0x51')]['id']}})['then'](handleEntityNotFound(_0x4d8545,null))[_0xeecc('0x1e')](function(_0x2f93c9){if(_0x2f93c9){_0x3cb5ba[_0xeecc('0x53')][_0xeecc('0x5a')]=_0x2f93c9['id'];_0x3cb5ba['body']['Subjects']=integrations[_0xeecc('0x5b')](_0x3cb5ba[_0xeecc('0x53')][_0xeecc('0x5c')],_0x3cb5ba['body']['type']);_0x3cb5ba[_0xeecc('0x53')]['Descriptions']=integrations[_0xeecc('0x5d')](_0x3cb5ba[_0xeecc('0x53')][_0xeecc('0x5c')],_0x3cb5ba[_0xeecc('0x53')]['type']);return db[_0xeecc('0x57')][_0xeecc('0x52')](_0x3cb5ba[_0xeecc('0x53')],{'include':[{'model':db[_0xeecc('0x5e')],'as':_0xeecc('0x5f')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4d8545,null))[_0xeecc('0x4f')](handleError(_0x4d8545,null));};exports[_0xeecc('0x60')]=function(_0x5716c9,_0x271eea,_0x5a2e81){var _0x33e7eb='';var _0x3bb5da='';return db['FreshsalesAccount'][_0xeecc('0x56')]({'where':{'id':_0x5716c9[_0xeecc('0x51')]['id']},'attributes':['id','username','remoteUri',_0xeecc('0x61')]})[_0xeecc('0x1e')](handleEntityNotFound(_0x271eea,null))['then'](function(_0x3c8ace){if(_0x3c8ace){_0x3bb5da=_0x3c8ace[_0xeecc('0x62')];_0x33e7eb=_0x3c8ace['remoteUri'];var _0x3c7d7a=_0x3c8ace[_0xeecc('0x63')][_0xeecc('0x64')](-0x1);if(_0x3c7d7a==='/'){_0x33e7eb=_0x33e7eb[_0xeecc('0x65')](0x0,_0x33e7eb[_0xeecc('0x66')](_0x3c7d7a));}return rp({'method':'GET','uri':util[_0xeecc('0x67')]('%s%s',_0x33e7eb,_0xeecc('0x68')),'headers':{'Authorization':_0xeecc('0x69')+_0x3c8ace[_0xeecc('0x61')]},'json':!![]});}})[_0xeecc('0x1e')](function(_0xaab06){if(_0xaab06){var _0x750718=_0xaab06[_0xeecc('0x6a')];var _0x513ed2=![];var _0x52f171=null;for(_0x52f171=0x0;_0x52f171<_0x750718[_0xeecc('0x41')];_0x52f171++){if(_0x750718[_0x52f171][_0xeecc('0x6b')]===_0x3bb5da){_0x513ed2=!![];}}if(_0x513ed2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xeecc('0x6c')});}}})[_0xeecc('0x1e')](respondWithResult(_0x271eea,null))[_0xeecc('0x4f')](function(_0x1d3dbf){var _0x1ea5a3=_0x5716c9[_0xeecc('0x3b')][_0xeecc('0x1a')]?0x1f4:_0x1d3dbf[_0xeecc('0x6d')]||0x1f4;logger[_0xeecc('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xeecc('0x60'),_0x1ea5a3,JSON[_0xeecc('0x6e')](_0x1d3dbf));delete _0x1d3dbf[_0xeecc('0x3a')];if(_0x1ea5a3===0x191){_0x1ea5a3=0x190;}_0x271eea[_0xeecc('0x28')](_0x1ea5a3)[_0xeecc('0x6f')](_0x5716c9[_0xeecc('0x3b')][_0xeecc('0x1a')]?{'message':_0xeecc('0x70'),'statusCode':_0x1d3dbf[_0xeecc('0x6d')]}:_0x1d3dbf);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b307889..4b58a23 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 _0x1ebb=['int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1ebb,0x1d2));var _0xb1eb=function(_0x216d4c,_0x5c989d){_0x216d4c=_0x216d4c-0x0;var _0x51dd62=_0x1ebb[_0x216d4c];return _0x51dd62;};'use strict';var _=require(_0xb1eb('0x0'));var util=require(_0xb1eb('0x1'));var logger=require(_0xb1eb('0x2'))(_0xb1eb('0x3'));var moment=require('moment');var BPromise=require(_0xb1eb('0x4'));var rp=require(_0xb1eb('0x5'));var fs=require('fs');var path=require(_0xb1eb('0x6'));var rimraf=require(_0xb1eb('0x7'));var config=require(_0xb1eb('0x8'));var attributes=require(_0xb1eb('0x9'));var integrations=require(_0xb1eb('0xa'));module[_0xb1eb('0xb')]=function(_0x3865ef,_0x539a64){return _0x3865ef[_0xb1eb('0xc')](_0xb1eb('0xd'),attributes,{'tableName':_0xb1eb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2895=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util'];(function(_0x18468f,_0x28573a){var _0x3c19a0=function(_0x2d7687){while(--_0x2d7687){_0x18468f['push'](_0x18468f['shift']());}};_0x3c19a0(++_0x28573a);}(_0x2895,0x82));var _0x5289=function(_0xd83f67,_0xbb3470){_0xd83f67=_0xd83f67-0x0;var _0x2242f1=_0x2895[_0xd83f67];return _0x2242f1;};'use strict';var _=require(_0x5289('0x0'));var util=require(_0x5289('0x1'));var logger=require(_0x5289('0x2'))('api');var moment=require(_0x5289('0x3'));var BPromise=require(_0x5289('0x4'));var rp=require(_0x5289('0x5'));var fs=require('fs');var path=require(_0x5289('0x6'));var rimraf=require('rimraf');var config=require(_0x5289('0x7'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x5289('0x8'));module[_0x5289('0x9')]=function(_0x172b41,_0x38bcf2){return _0x172b41[_0x5289('0xa')](_0x5289('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 558448f..bfca852 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 _0xdab3=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','map','include','model','ShowFreshsalesAccount','find','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0xa931db,_0x38d04f){var _0x384a50=function(_0x41baa1){while(--_0x41baa1){_0xa931db['push'](_0xa931db['shift']());}};_0x384a50(++_0x38d04f);}(_0xdab3,0xeb));var _0x3dab=function(_0x78c768,_0x3c59f5){_0x78c768=_0x78c768-0x0;var _0x542828=_0xdab3[_0x78c768];return _0x542828;};'use strict';var _=require(_0x3dab('0x0'));var util=require(_0x3dab('0x1'));var moment=require('moment');var BPromise=require(_0x3dab('0x2'));var rs=require(_0x3dab('0x3'));var fs=require('fs');var Redis=require(_0x3dab('0x4'));var db=require(_0x3dab('0x5'))['db'];var utils=require(_0x3dab('0x6'));var logger=require(_0x3dab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3dab('0x8'));var client=jayson[_0x3dab('0x9')][_0x3dab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x415608,_0x3bdacb,_0x2d6b5c){return new BPromise(function(_0x5ae18c,_0x46a6d7){return client[_0x3dab('0xb')](_0x415608,_0x2d6b5c)[_0x3dab('0xc')](function(_0x2ab58a){logger[_0x3dab('0xd')](_0x3dab('0xe'),_0x3bdacb,_0x3dab('0xf'));logger['debug'](_0x3dab('0x10'),_0x3bdacb,_0x3dab('0xf'),JSON[_0x3dab('0x11')](_0x2ab58a));if(_0x2ab58a[_0x3dab('0x12')]){if(_0x2ab58a[_0x3dab('0x12')]['code']===0x1f4){logger['error'](_0x3dab('0xe'),_0x3bdacb,_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);return _0x46a6d7(_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);}logger[_0x3dab('0x12')](_0x3dab('0xe'),_0x3bdacb,_0x2ab58a[_0x3dab('0x12')]['message']);return _0x5ae18c(_0x2ab58a[_0x3dab('0x12')][_0x3dab('0x13')]);}else{logger[_0x3dab('0xd')](_0x3dab('0xe'),_0x3bdacb,_0x3dab('0xf'));_0x5ae18c(_0x2ab58a['result']['message']);}})[_0x3dab('0x14')](function(_0x2e9933){logger[_0x3dab('0x12')](_0x3dab('0xe'),_0x3bdacb,_0x2e9933);_0x46a6d7(_0x2e9933);});});}exports[_0x3dab('0x15')]=function(_0x4f71e1){var _0x83a01c=this;return new Promise(function(_0x2cca19,_0x578c5e){return db[_0x3dab('0x16')][_0x3dab('0x17')]({'raw':_0x4f71e1[_0x3dab('0x18')]?_0x4f71e1[_0x3dab('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f71e1[_0x3dab('0x18')]?_0x4f71e1[_0x3dab('0x18')][_0x3dab('0x19')]||null:null,'attributes':_0x4f71e1[_0x3dab('0x18')]?_0x4f71e1[_0x3dab('0x18')][_0x3dab('0x1a')]||null:null,'limit':_0x4f71e1[_0x3dab('0x18')]?_0x4f71e1[_0x3dab('0x18')][_0x3dab('0x1b')]||null:null,'include':_0x4f71e1['options']?_0x4f71e1[_0x3dab('0x18')]['include']?_[_0x3dab('0x1c')](_0x4f71e1[_0x3dab('0x18')][_0x3dab('0x1d')],function(_0x227c86){return{'model':db[_0x227c86[_0x3dab('0x1e')]],'as':_0x227c86['as'],'attributes':_0x227c86[_0x3dab('0x1a')],'include':_0x227c86['include']?_['map'](_0x227c86[_0x3dab('0x1d')],function(_0x10f848){return{'model':db[_0x10f848['model']],'as':_0x10f848['as'],'attributes':_0x10f848[_0x3dab('0x1a')],'include':_0x10f848[_0x3dab('0x1d')]?_[_0x3dab('0x1c')](_0x10f848[_0x3dab('0x1d')],function(_0x5acc7b){return{'model':db[_0x5acc7b[_0x3dab('0x1e')]],'as':_0x5acc7b['as'],'attributes':_0x5acc7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3dab('0xc')](function(_0x1ed38d){logger[_0x3dab('0xd')](_0x3dab('0x15'),_0x4f71e1);logger['debug']('GetFreshsalesAccount',_0x4f71e1,JSON[_0x3dab('0x11')](_0x1ed38d));_0x2cca19(_0x1ed38d);})['catch'](function(_0x483bce){logger['error']('GetFreshsalesAccount',_0x483bce[_0x3dab('0x13')],_0x4f71e1);_0x578c5e(_0x83a01c[_0x3dab('0x12')](0x1f4,_0x483bce[_0x3dab('0x13')]));});});};exports[_0x3dab('0x1f')]=function(_0x2088cc){var _0x3f612a=this;return new Promise(function(_0xf2c487,_0x9d2420){return db[_0x3dab('0x16')][_0x3dab('0x20')]({'raw':_0x2088cc[_0x3dab('0x18')]?_0x2088cc[_0x3dab('0x18')][_0x3dab('0x21')]===undefined?!![]:![]:!![],'where':_0x2088cc[_0x3dab('0x18')]?_0x2088cc[_0x3dab('0x18')][_0x3dab('0x19')]||null:null,'attributes':_0x2088cc[_0x3dab('0x18')]?_0x2088cc[_0x3dab('0x18')][_0x3dab('0x1a')]||null:null,'include':_0x2088cc[_0x3dab('0x18')]?_0x2088cc['options']['include']?_[_0x3dab('0x1c')](_0x2088cc['options'][_0x3dab('0x1d')],function(_0x457d80){return{'model':db[_0x457d80['model']],'as':_0x457d80['as'],'attributes':_0x457d80[_0x3dab('0x1a')],'include':_0x457d80[_0x3dab('0x1d')]?_[_0x3dab('0x1c')](_0x457d80[_0x3dab('0x1d')],function(_0x5430e3){return{'model':db[_0x5430e3['model']],'as':_0x5430e3['as'],'attributes':_0x5430e3[_0x3dab('0x1a')],'include':_0x5430e3['include']?_[_0x3dab('0x1c')](_0x5430e3[_0x3dab('0x1d')],function(_0x414dba){return{'model':db[_0x414dba['model']],'as':_0x414dba['as'],'attributes':_0x414dba['attributes']};}):[]};}):[]};}):[]:[]})[_0x3dab('0xc')](function(_0x20ab66){logger[_0x3dab('0xd')]('ShowFreshsalesAccount',_0x2088cc);logger[_0x3dab('0x22')](_0x3dab('0x1f'),_0x2088cc,JSON[_0x3dab('0x11')](_0x20ab66));_0xf2c487(_0x20ab66);})[_0x3dab('0x14')](function(_0xc2e1f7){logger['error'](_0x3dab('0x1f'),_0xc2e1f7[_0x3dab('0x13')],_0x2088cc);_0x9d2420(_0x3f612a[_0x3dab('0x12')](0x1f4,_0xc2e1f7[_0x3dab('0x13')]));});});}; \ No newline at end of file +var _0x0c19=['message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','map','attributes','include','model','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x23d4bb,_0x5e5301){var _0x5758b1=function(_0x403bef){while(--_0x403bef){_0x23d4bb['push'](_0x23d4bb['shift']());}};_0x5758b1(++_0x5e5301);}(_0x0c19,0xf5));var _0x90c1=function(_0x43cb30,_0x20b884){_0x43cb30=_0x43cb30-0x0;var _0x4dbf55=_0x0c19[_0x43cb30];return _0x4dbf55;};'use strict';var _=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var moment=require(_0x90c1('0x2'));var BPromise=require(_0x90c1('0x3'));var rs=require(_0x90c1('0x4'));var fs=require('fs');var Redis=require(_0x90c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x90c1('0x6'));var logger=require(_0x90c1('0x7'))(_0x90c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x90c1('0x9'));var client=jayson[_0x90c1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440f7a,_0x954ac4,_0x37d247){return new BPromise(function(_0x2ed328,_0x351d07){return client[_0x90c1('0xb')](_0x440f7a,_0x37d247)[_0x90c1('0xc')](function(_0x4895b5){logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,'request\x20sent');logger[_0x90c1('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x954ac4,'request\x20sent',JSON[_0x90c1('0x10')](_0x4895b5));if(_0x4895b5['error']){if(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x12')]===0x1f4){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error']['message']);return _0x351d07(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x4895b5['error'][_0x90c1('0x13')]);return _0x2ed328(_0x4895b5[_0x90c1('0x11')][_0x90c1('0x13')]);}else{logger[_0x90c1('0xd')](_0x90c1('0xe'),_0x954ac4,_0x90c1('0x14'));_0x2ed328(_0x4895b5['result'][_0x90c1('0x13')]);}})[_0x90c1('0x15')](function(_0x45a64c){logger[_0x90c1('0x11')](_0x90c1('0xe'),_0x954ac4,_0x45a64c);_0x351d07(_0x45a64c);});});}exports[_0x90c1('0x16')]=function(_0x3b6671){var _0x2960f2=this;return new Promise(function(_0x372949,_0x112aa4){return db[_0x90c1('0x17')]['findAll']({'raw':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x3b6671[_0x90c1('0x18')]?_0x3b6671[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x3b6671['options']?_0x3b6671[_0x90c1('0x18')]['attributes']||null:null,'limit':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['limit']||null:null,'include':_0x3b6671[_0x90c1('0x18')]?_0x3b6671['options']['include']?_[_0x90c1('0x1b')](_0x3b6671['options']['include'],function(_0x36fe37){return{'model':db[_0x36fe37['model']],'as':_0x36fe37['as'],'attributes':_0x36fe37[_0x90c1('0x1c')],'include':_0x36fe37['include']?_[_0x90c1('0x1b')](_0x36fe37[_0x90c1('0x1d')],function(_0x309f83){return{'model':db[_0x309f83[_0x90c1('0x1e')]],'as':_0x309f83['as'],'attributes':_0x309f83[_0x90c1('0x1c')],'include':_0x309f83[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x309f83['include'],function(_0x26ee39){return{'model':db[_0x26ee39[_0x90c1('0x1e')]],'as':_0x26ee39['as'],'attributes':_0x26ee39[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x3c3a20){logger[_0x90c1('0xd')](_0x90c1('0x16'),_0x3b6671);logger[_0x90c1('0xf')](_0x90c1('0x16'),_0x3b6671,JSON[_0x90c1('0x10')](_0x3c3a20));_0x372949(_0x3c3a20);})[_0x90c1('0x15')](function(_0x2f85dc){logger[_0x90c1('0x11')](_0x90c1('0x16'),_0x2f85dc[_0x90c1('0x13')],_0x3b6671);_0x112aa4(_0x2960f2['error'](0x1f4,_0x2f85dc[_0x90c1('0x13')]));});});};exports[_0x90c1('0x1f')]=function(_0x40c2f1){var _0x5be73c=this;return new Promise(function(_0x305e68,_0x578316){return db[_0x90c1('0x17')][_0x90c1('0x20')]({'raw':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x19')]===undefined?!![]:![]:!![],'where':_0x40c2f1['options']?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1a')]||null:null,'attributes':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1['options'][_0x90c1('0x1c')]||null:null,'include':_0x40c2f1[_0x90c1('0x18')]?_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x40c2f1[_0x90c1('0x18')][_0x90c1('0x1d')],function(_0x36e431){return{'model':db[_0x36e431[_0x90c1('0x1e')]],'as':_0x36e431['as'],'attributes':_0x36e431[_0x90c1('0x1c')],'include':_0x36e431[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x36e431[_0x90c1('0x1d')],function(_0x3a130f){return{'model':db[_0x3a130f['model']],'as':_0x3a130f['as'],'attributes':_0x3a130f[_0x90c1('0x1c')],'include':_0x3a130f[_0x90c1('0x1d')]?_[_0x90c1('0x1b')](_0x3a130f[_0x90c1('0x1d')],function(_0x5c62a4){return{'model':db[_0x5c62a4['model']],'as':_0x5c62a4['as'],'attributes':_0x5c62a4[_0x90c1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x90c1('0xc')](function(_0x1aa105){logger[_0x90c1('0xd')]('ShowFreshsalesAccount',_0x40c2f1);logger['debug'](_0x90c1('0x1f'),_0x40c2f1,JSON[_0x90c1('0x10')](_0x1aa105));_0x305e68(_0x1aa105);})[_0x90c1('0x15')](function(_0x23bb5a){logger[_0x90c1('0x11')]('ShowFreshsalesAccount',_0x23bb5a['message'],_0x40c2f1);_0x578316(_0x5be73c['error'](0x1f4,_0x23bb5a[_0x90c1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b5145dd..14a3d91 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 _0xba1b=['/:id','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','multer','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x446b3f,_0x1921e4){var _0x5f0ab1=function(_0x5b1775){while(--_0x5b1775){_0x446b3f['push'](_0x446b3f['shift']());}};_0x5f0ab1(++_0x1921e4);}(_0xba1b,0x1ba));var _0xbba1=function(_0x49cd29,_0x5c0d30){_0x49cd29=_0x49cd29-0x0;var _0x556ab9=_0xba1b[_0x49cd29];return _0x556ab9;};'use strict';var multer=require(_0xbba1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbba1('0x1'));var router=express[_0xbba1('0x2')]();var auth=require(_0xbba1('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xbba1('0x4')]('/',auth[_0xbba1('0x5')](),controller['index']);router['get'](_0xbba1('0x6'),auth[_0xbba1('0x5')](),controller['show']);router[_0xbba1('0x4')]('/:id/subjects',auth[_0xbba1('0x5')](),controller[_0xbba1('0x7')]);router['get'](_0xbba1('0x8'),auth[_0xbba1('0x5')](),controller[_0xbba1('0x9')]);router[_0xbba1('0x4')](_0xbba1('0xa'),auth[_0xbba1('0x5')](),controller[_0xbba1('0xb')]);router[_0xbba1('0xc')]('/',auth[_0xbba1('0x5')](),controller[_0xbba1('0xd')]);router[_0xbba1('0xe')]('/:id',auth[_0xbba1('0x5')](),controller['update']);router[_0xbba1('0xf')](_0xbba1('0x6'),auth[_0xbba1('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4a34=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x41fde7,_0xdc22e0){var _0x5eb960=function(_0xf5306c){while(--_0xf5306c){_0x41fde7['push'](_0x41fde7['shift']());}};_0x5eb960(++_0xdc22e0);}(_0x4a34,0x1ae));var _0x44a3=function(_0x52b663,_0x20a937){_0x52b663=_0x52b663-0x0;var _0x22d7d8=_0x4a34[_0x52b663];return _0x22d7d8;};'use strict';var multer=require(_0x44a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x44a3('0x1'));var express=require(_0x44a3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44a3('0x3'));var config=require(_0x44a3('0x4'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x44a3('0x5')]('/',auth[_0x44a3('0x6')](),controller[_0x44a3('0x7')]);router[_0x44a3('0x5')](_0x44a3('0x8'),auth[_0x44a3('0x6')](),controller[_0x44a3('0x9')]);router[_0x44a3('0x5')](_0x44a3('0xa'),auth[_0x44a3('0x6')](),controller[_0x44a3('0xb')]);router[_0x44a3('0x5')](_0x44a3('0xc'),auth['isAuthenticated'](),controller[_0x44a3('0xd')]);router[_0x44a3('0x5')](_0x44a3('0xe'),auth['isAuthenticated'](),controller[_0x44a3('0xf')]);router[_0x44a3('0x10')]('/',auth[_0x44a3('0x6')](),controller['create']);router[_0x44a3('0x11')](_0x44a3('0x8'),auth[_0x44a3('0x6')](),controller[_0x44a3('0x12')]);router[_0x44a3('0x13')]('/:id',auth[_0x44a3('0x6')](),controller[_0x44a3('0x14')]);module[_0x44a3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 496302f..4b10a5f 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 _0xf0e9=['STRING','sequelize','exports'];(function(_0x4436e1,_0x282b67){var _0x2d7637=function(_0x4f13dc){while(--_0x4f13dc){_0x4436e1['push'](_0x4436e1['shift']());}};_0x2d7637(++_0x282b67);}(_0xf0e9,0x64));var _0x9f0e=function(_0x29a028,_0x40b2de){_0x29a028=_0x29a028-0x0;var _0x7ec863=_0xf0e9[_0x29a028];return _0x7ec863;};'use strict';var Sequelize=require(_0x9f0e('0x0'));module[_0x9f0e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f0e('0x2')]}}; \ No newline at end of file +var _0xd8be=['sequelize','exports','STRING'];(function(_0xe00f4c,_0x59ba20){var _0x5dfa97=function(_0xe557dc){while(--_0xe557dc){_0xe00f4c['push'](_0xe00f4c['shift']());}};_0x5dfa97(++_0x59ba20);}(_0xd8be,0xe1));var _0xed8b=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xd8be[_0x50aa2e];return _0x5e07f0;};'use strict';var Sequelize=require(_0xed8b('0x0'));module[_0xed8b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xed8b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 5a03532..65fe90c 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 _0x08f2=['sendStatus','stack','name','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','update','body','getSubjects','findOne','FreshsalesField','filter','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','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','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','count','offset','limit','set','json','apply','destroy'];(function(_0x31ab8c,_0xebf305){var _0x4f7acc=function(_0x597573){while(--_0x597573){_0x31ab8c['push'](_0x31ab8c['shift']());}};_0x4f7acc(++_0xebf305);}(_0x08f2,0xd6));var _0x208f=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x08f2[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x208f('0x0'));var rimraf=require(_0x208f('0x1'));var zipdir=require(_0x208f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x208f('0x3'));var moment=require(_0x208f('0x4'));var BPromise=require(_0x208f('0x5'));var Mustache=require(_0x208f('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x208f('0x7'));var ejs=require(_0x208f('0x8'));var fs=require('fs');var _=require(_0x208f('0x9'));var squel=require(_0x208f('0xa'));var crypto=require(_0x208f('0xb'));var jsforce=require(_0x208f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x208f('0x7'));var querystring=require(_0x208f('0xd'));var Papa=require('papaparse');var Redis=require(_0x208f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x208f('0xf'));var hardwareService=require(_0x208f('0x10'));var logger=require(_0x208f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x208f('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x208f('0x13'));var client=jayson['client'][_0x208f('0x14')]({'port':0x232a});function checkPasswordPattern(_0x27df4f,_0x55c4fa,_0x3c745c){if(_0x3c745c){var _0x308cbf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x308cbf[_0x208f('0x15')](_0x55c4fa)){return _0x27df4f;}else{throw new db['Sequelize']['ValidationError'](_0x208f('0x16'));}}else{return _0x27df4f;}}function respondWithRpcPromise(_0x49b27a,_0x28ac76,_0x3214a5,_0xbba3a3){return new BPromise(function(_0x36c26a,_0x34e11f){var _0x14eee1=_0xbba3a3||client;return _0x14eee1[_0x208f('0x17')](_0x49b27a,_0x3214a5)[_0x208f('0x18')](function(_0xc83cb){logger[_0x208f('0x19')](_0x208f('0x1a'),_0x28ac76,'request\x20sent');logger[_0x208f('0x1b')](_0x208f('0x1c'),_0x28ac76,_0x208f('0x1d'),JSON[_0x208f('0x1e')](_0xc83cb));if(_0xc83cb[_0x208f('0x1f')]){if(_0xc83cb['error'][_0x208f('0x20')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x28ac76,_0xc83cb[_0x208f('0x1f')]['message']);return _0x34e11f(_0xc83cb['error'][_0x208f('0x21')]);}logger[_0x208f('0x1f')](_0x208f('0x1a'),_0x28ac76,_0xc83cb[_0x208f('0x1f')][_0x208f('0x21')]);return _0x36c26a(_0xc83cb['error'][_0x208f('0x21')]);}else{logger[_0x208f('0x19')](_0x208f('0x1a'),_0x28ac76,_0x208f('0x1d'));_0x36c26a(_0xc83cb[_0x208f('0x22')][_0x208f('0x21')]);}})['catch'](function(_0x464596){logger[_0x208f('0x1f')](_0x208f('0x1a'),_0x28ac76,_0x464596);_0x34e11f(_0x464596);});});}function respondWithStatusCode(_0x3bf2b3,_0x31d77a){_0x31d77a=_0x31d77a||0xcc;return function(_0x1f93be){if(_0x1f93be){return _0x3bf2b3['sendStatus'](_0x31d77a);}return _0x3bf2b3[_0x208f('0x23')](_0x31d77a)[_0x208f('0x24')]();};}function respondWithResult(_0x10a0b1,_0x4bfbda){_0x4bfbda=_0x4bfbda||0xc8;return function(_0x2fcf38){if(_0x2fcf38){return _0x10a0b1['status'](_0x4bfbda)['json'](_0x2fcf38);}};}function respondWithFilteredResult(_0x5e429c,_0x1b35dc){return function(_0x4312b2){if(_0x4312b2){var _0x1bf863=_0x4312b2[_0x208f('0x25')],_0x5c5bed=_0x1b35dc[_0x208f('0x26')],_0x227e7d=_0x1b35dc[_0x208f('0x26')]+_0x1b35dc[_0x208f('0x27')],_0x39d527;if(_0x227e7d>=_0x1bf863){_0x227e7d=_0x1bf863;_0x39d527=0xc8;}else{_0x39d527=0xce;}_0x5e429c[_0x208f('0x23')](_0x39d527);return _0x5e429c[_0x208f('0x28')]('Content-Range',_0x5c5bed+'-'+_0x227e7d+'/'+_0x1bf863)[_0x208f('0x29')](_0x4312b2);}return null;};}function patchUpdates(_0x767ea0){return function(_0x5cb12b){try{jsonpatch[_0x208f('0x2a')](_0x5cb12b,_0x767ea0,!![]);}catch(_0x4f8a80){return BPromise['reject'](_0x4f8a80);}return _0x5cb12b['save']();};}function saveUpdates(_0x477b03,_0x2320c8){return function(_0x3c55f3){if(_0x3c55f3){return _0x3c55f3['update'](_0x477b03)[_0x208f('0x18')](function(_0x40bed8){return _0x40bed8;});}return null;};}function removeEntity(_0x1bfca0,_0xfac890){return function(_0x3131a3){if(_0x3131a3){return _0x3131a3[_0x208f('0x2b')]()[_0x208f('0x18')](function(){_0x1bfca0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4973ec,_0x137d19){return function(_0x523f79){if(!_0x523f79){_0x4973ec[_0x208f('0x2c')](0x194);}return _0x523f79;};}function handleError(_0x3fca25,_0x512201){_0x512201=_0x512201||0x1f4;return function(_0x2361ab){logger[_0x208f('0x1f')](_0x2361ab[_0x208f('0x2d')]);if(_0x2361ab[_0x208f('0x2e')]){delete _0x2361ab['name'];}_0x3fca25[_0x208f('0x23')](_0x512201)['send'](_0x2361ab);};}exports['index']=function(_0x4ada58,_0x3278aa){var _0x2f3edc={},_0xd4da81={},_0x1f4dd1={'count':0x0,'rows':[]};var _0x26d671=_[_0x208f('0x2f')](db[_0x208f('0x30')][_0x208f('0x31')],function(_0x5bbbe3){return{'name':_0x5bbbe3[_0x208f('0x32')],'type':_0x5bbbe3[_0x208f('0x33')][_0x208f('0x34')]};});_0xd4da81['model']=_['map'](_0x26d671,_0x208f('0x2e'));_0xd4da81['query']=_[_0x208f('0x35')](_0x4ada58[_0x208f('0x36')]);_0xd4da81[_0x208f('0x37')]=_[_0x208f('0x38')](_0xd4da81[_0x208f('0x39')],_0xd4da81[_0x208f('0x36')]);_0x2f3edc['attributes']=_[_0x208f('0x38')](_0xd4da81[_0x208f('0x39')],qs['fields'](_0x4ada58['query']['fields']));_0x2f3edc[_0x208f('0x3a')]=_0x2f3edc[_0x208f('0x3a')][_0x208f('0x3b')]?_0x2f3edc[_0x208f('0x3a')]:_0xd4da81['model'];if(!_0x4ada58[_0x208f('0x36')][_0x208f('0x3c')](_0x208f('0x3d'))){_0x2f3edc[_0x208f('0x27')]=qs[_0x208f('0x27')](_0x4ada58[_0x208f('0x36')][_0x208f('0x27')]);_0x2f3edc[_0x208f('0x26')]=qs[_0x208f('0x26')](_0x4ada58[_0x208f('0x36')]['offset']);}_0x2f3edc[_0x208f('0x3e')]=qs[_0x208f('0x3f')](_0x4ada58['query'][_0x208f('0x3f')]);_0x2f3edc[_0x208f('0x40')]=qs[_0x208f('0x37')](_[_0x208f('0x41')](_0x4ada58[_0x208f('0x36')],_0xd4da81[_0x208f('0x37')]),_0x26d671);if(_0x4ada58[_0x208f('0x36')]['filter']){_0x2f3edc[_0x208f('0x40')]=_[_0x208f('0x42')](_0x2f3edc[_0x208f('0x40')],{'$or':_[_0x208f('0x2f')](_0x26d671,function(_0x2984ad){if(_0x2984ad[_0x208f('0x33')]!==_0x208f('0x43')){var _0x53219a={};_0x53219a[_0x2984ad[_0x208f('0x2e')]]={'$like':'%'+_0x4ada58[_0x208f('0x36')]['filter']+'%'};return _0x53219a;}})});}_0x2f3edc=_[_0x208f('0x42')]({},_0x2f3edc,_0x4ada58[_0x208f('0x44')]);var _0xbc39a3={'where':_0x2f3edc[_0x208f('0x40')]};return db[_0x208f('0x30')][_0x208f('0x25')](_0xbc39a3)[_0x208f('0x18')](function(_0x28bf73){_0x1f4dd1[_0x208f('0x25')]=_0x28bf73;if(_0x4ada58[_0x208f('0x36')][_0x208f('0x45')]){_0x2f3edc[_0x208f('0x46')]=[{'all':!![]}];}return db[_0x208f('0x30')][_0x208f('0x47')](_0x2f3edc);})['then'](function(_0x426ff2){_0x1f4dd1[_0x208f('0x48')]=_0x426ff2;return _0x1f4dd1;})['then'](respondWithFilteredResult(_0x3278aa,_0x2f3edc))[_0x208f('0x49')](handleError(_0x3278aa,null));};exports['show']=function(_0x4ca3ce,_0x499fce){var _0xebd522={'raw':![],'where':{'id':_0x4ca3ce[_0x208f('0x4a')]['id']}},_0x3b89cf={};_0x3b89cf[_0x208f('0x39')]=_[_0x208f('0x35')](db[_0x208f('0x30')][_0x208f('0x31')]);_0x3b89cf[_0x208f('0x36')]=_['keys'](_0x4ca3ce[_0x208f('0x36')]);_0x3b89cf[_0x208f('0x37')]=_[_0x208f('0x38')](_0x3b89cf[_0x208f('0x39')],_0x3b89cf[_0x208f('0x36')]);_0xebd522[_0x208f('0x3a')]=_[_0x208f('0x38')](_0x3b89cf['model'],qs[_0x208f('0x4b')](_0x4ca3ce[_0x208f('0x36')]['fields']));_0xebd522[_0x208f('0x3a')]=_0xebd522[_0x208f('0x3a')][_0x208f('0x3b')]?_0xebd522[_0x208f('0x3a')]:_0x3b89cf['model'];if(_0x4ca3ce[_0x208f('0x36')]['includeAll']){_0xebd522[_0x208f('0x46')]=[{'all':!![]}];}_0xebd522=_[_0x208f('0x42')]({},_0xebd522,_0x4ca3ce[_0x208f('0x44')]);return db[_0x208f('0x30')][_0x208f('0x4c')](_0xebd522)['then'](handleEntityNotFound(_0x499fce,null))[_0x208f('0x18')](respondWithResult(_0x499fce,null))[_0x208f('0x49')](handleError(_0x499fce,null));};exports[_0x208f('0x4d')]=function(_0x225dcd,_0x1b865b){return db[_0x208f('0x30')][_0x208f('0x4d')](_0x225dcd['body'],{})[_0x208f('0x18')](respondWithResult(_0x1b865b,0xc9))[_0x208f('0x49')](handleError(_0x1b865b,null));};exports[_0x208f('0x4e')]=function(_0x9afdef,_0x7da4de){if(_0x9afdef[_0x208f('0x4f')]['id']){delete _0x9afdef['body']['id'];}return db[_0x208f('0x30')][_0x208f('0x4c')]({'where':{'id':_0x9afdef[_0x208f('0x4a')]['id']}})[_0x208f('0x18')](handleEntityNotFound(_0x7da4de,null))[_0x208f('0x18')](saveUpdates(_0x9afdef[_0x208f('0x4f')],null))[_0x208f('0x18')](respondWithResult(_0x7da4de,null))[_0x208f('0x49')](handleError(_0x7da4de,null));};exports['destroy']=function(_0x1c9692,_0x4035c8){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x1c9692[_0x208f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4035c8,null))['then'](removeEntity(_0x4035c8,null))[_0x208f('0x49')](handleError(_0x4035c8,null));};exports[_0x208f('0x50')]=function(_0x16ffe0,_0x5cd2f5,_0xc146b7){var _0x131bcf={};var _0xab45ae={};var _0x2ba56b;var _0x3dac1a;return db[_0x208f('0x30')][_0x208f('0x51')]({'where':{'id':_0x16ffe0[_0x208f('0x4a')]['id']}})[_0x208f('0x18')](handleEntityNotFound(_0x5cd2f5,null))[_0x208f('0x18')](function(_0x54faa2){if(_0x54faa2){_0x2ba56b=_0x54faa2;_0xab45ae[_0x208f('0x39')]=_[_0x208f('0x35')](db[_0x208f('0x52')][_0x208f('0x31')]);_0xab45ae[_0x208f('0x36')]=_[_0x208f('0x35')](_0x16ffe0[_0x208f('0x36')]);_0xab45ae[_0x208f('0x37')]=_[_0x208f('0x38')](_0xab45ae[_0x208f('0x39')],_0xab45ae[_0x208f('0x36')]);_0x131bcf[_0x208f('0x3a')]=_[_0x208f('0x38')](_0xab45ae[_0x208f('0x39')],qs[_0x208f('0x4b')](_0x16ffe0['query'][_0x208f('0x4b')]));_0x131bcf[_0x208f('0x3a')]=_0x131bcf[_0x208f('0x3a')][_0x208f('0x3b')]?_0x131bcf[_0x208f('0x3a')]:_0xab45ae[_0x208f('0x39')];_0x131bcf['order']=qs[_0x208f('0x3f')](_0x16ffe0[_0x208f('0x36')][_0x208f('0x3f')]);_0x131bcf['where']=qs[_0x208f('0x37')](_[_0x208f('0x41')](_0x16ffe0[_0x208f('0x36')],_0xab45ae[_0x208f('0x37')]));if(_0x16ffe0['query'][_0x208f('0x53')]){_0x131bcf[_0x208f('0x40')]=_[_0x208f('0x42')](_0x131bcf['where'],{'$or':_['map'](_0x131bcf['attributes'],function(_0x41cb75){var _0x16a3db={};_0x16a3db[_0x41cb75]={'$like':'%'+_0x16ffe0[_0x208f('0x36')][_0x208f('0x53')]+'%'};return _0x16a3db;})});}_0x131bcf=_[_0x208f('0x42')]({},_0x131bcf,_0x16ffe0['options']);return _0x2ba56b['getSubjects'](_0x131bcf);}})['then'](function(_0x44f5fb){if(_0x44f5fb){_0x3dac1a=_0x44f5fb[_0x208f('0x3b')];if(!_0x16ffe0['query'][_0x208f('0x3c')](_0x208f('0x3d'))){_0x131bcf[_0x208f('0x27')]=qs[_0x208f('0x27')](_0x16ffe0[_0x208f('0x36')]['limit']);_0x131bcf[_0x208f('0x26')]=qs['offset'](_0x16ffe0[_0x208f('0x36')][_0x208f('0x26')]);}return _0x2ba56b[_0x208f('0x50')](_0x131bcf);}})['then'](function(_0x1bf7b9){if(_0x1bf7b9){return _0x1bf7b9?{'count':_0x3dac1a,'rows':_0x1bf7b9}:null;}})[_0x208f('0x18')](respondWithResult(_0x5cd2f5,null))[_0x208f('0x49')](handleError(_0x5cd2f5,null));};exports[_0x208f('0x54')]=function(_0xcbdc10,_0x208967,_0x4bcec5){var _0x17dd79={};var _0x55cd19={};var _0x5bd1c8;var _0x2a9e8e;return db[_0x208f('0x30')][_0x208f('0x51')]({'where':{'id':_0xcbdc10[_0x208f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x208967,null))[_0x208f('0x18')](function(_0x1efbf6){if(_0x1efbf6){_0x5bd1c8=_0x1efbf6;_0x55cd19[_0x208f('0x39')]=_[_0x208f('0x35')](db['FreshsalesField'][_0x208f('0x31')]);_0x55cd19[_0x208f('0x36')]=_[_0x208f('0x35')](_0xcbdc10[_0x208f('0x36')]);_0x55cd19['filters']=_[_0x208f('0x38')](_0x55cd19[_0x208f('0x39')],_0x55cd19[_0x208f('0x36')]);_0x17dd79['attributes']=_[_0x208f('0x38')](_0x55cd19[_0x208f('0x39')],qs['fields'](_0xcbdc10['query']['fields']));_0x17dd79[_0x208f('0x3a')]=_0x17dd79[_0x208f('0x3a')][_0x208f('0x3b')]?_0x17dd79[_0x208f('0x3a')]:_0x55cd19[_0x208f('0x39')];_0x17dd79[_0x208f('0x3e')]=qs[_0x208f('0x3f')](_0xcbdc10[_0x208f('0x36')]['sort']);_0x17dd79['where']=qs[_0x208f('0x37')](_[_0x208f('0x41')](_0xcbdc10[_0x208f('0x36')],_0x55cd19[_0x208f('0x37')]));if(_0xcbdc10[_0x208f('0x36')][_0x208f('0x53')]){_0x17dd79[_0x208f('0x40')]=_[_0x208f('0x42')](_0x17dd79['where'],{'$or':_[_0x208f('0x2f')](_0x17dd79[_0x208f('0x3a')],function(_0x247a95){var _0x3ccf2d={};_0x3ccf2d[_0x247a95]={'$like':'%'+_0xcbdc10[_0x208f('0x36')][_0x208f('0x53')]+'%'};return _0x3ccf2d;})});}_0x17dd79=_[_0x208f('0x42')]({},_0x17dd79,_0xcbdc10[_0x208f('0x44')]);return _0x5bd1c8[_0x208f('0x54')](_0x17dd79);}})[_0x208f('0x18')](function(_0xf0d348){if(_0xf0d348){_0x2a9e8e=_0xf0d348[_0x208f('0x3b')];if(!_0xcbdc10[_0x208f('0x36')]['hasOwnProperty'](_0x208f('0x3d'))){_0x17dd79['limit']=qs[_0x208f('0x27')](_0xcbdc10[_0x208f('0x36')][_0x208f('0x27')]);_0x17dd79['offset']=qs[_0x208f('0x26')](_0xcbdc10['query'][_0x208f('0x26')]);}return _0x5bd1c8[_0x208f('0x54')](_0x17dd79);}})['then'](function(_0x3f7be3){if(_0x3f7be3){return _0x3f7be3?{'count':_0x2a9e8e,'rows':_0x3f7be3}:null;}})['then'](respondWithResult(_0x208967,null))[_0x208f('0x49')](handleError(_0x208967,null));};exports[_0x208f('0x55')]=function(_0xdbf70e,_0xf322ba,_0x55c2a9){var _0x2f4e26={};var _0x19fc03={};var _0x15e04e;var _0x2dc68d;return db[_0x208f('0x30')][_0x208f('0x51')]({'where':{'id':_0xdbf70e[_0x208f('0x4a')]['id']}})[_0x208f('0x18')](handleEntityNotFound(_0xf322ba,null))[_0x208f('0x18')](function(_0x169cca){if(_0x169cca){_0x15e04e=_0x169cca;_0x19fc03[_0x208f('0x39')]=_[_0x208f('0x35')](db['FreshsalesField'][_0x208f('0x31')]);_0x19fc03['query']=_[_0x208f('0x35')](_0xdbf70e[_0x208f('0x36')]);_0x19fc03[_0x208f('0x37')]=_['intersection'](_0x19fc03[_0x208f('0x39')],_0x19fc03[_0x208f('0x36')]);_0x2f4e26[_0x208f('0x3a')]=_[_0x208f('0x38')](_0x19fc03[_0x208f('0x39')],qs[_0x208f('0x4b')](_0xdbf70e[_0x208f('0x36')]['fields']));_0x2f4e26['attributes']=_0x2f4e26['attributes'][_0x208f('0x3b')]?_0x2f4e26[_0x208f('0x3a')]:_0x19fc03[_0x208f('0x39')];_0x2f4e26[_0x208f('0x3e')]=qs[_0x208f('0x3f')](_0xdbf70e['query'][_0x208f('0x3f')]);_0x2f4e26[_0x208f('0x40')]=qs['filters'](_[_0x208f('0x41')](_0xdbf70e['query'],_0x19fc03[_0x208f('0x37')]));if(_0xdbf70e['query'][_0x208f('0x53')]){_0x2f4e26[_0x208f('0x40')]=_[_0x208f('0x42')](_0x2f4e26[_0x208f('0x40')],{'$or':_[_0x208f('0x2f')](_0x2f4e26['attributes'],function(_0x1bf5b4){var _0x5843a1={};_0x5843a1[_0x1bf5b4]={'$like':'%'+_0xdbf70e[_0x208f('0x36')][_0x208f('0x53')]+'%'};return _0x5843a1;})});}_0x2f4e26=_[_0x208f('0x42')]({},_0x2f4e26,_0xdbf70e[_0x208f('0x44')]);return _0x15e04e[_0x208f('0x55')](_0x2f4e26);}})[_0x208f('0x18')](function(_0x462a7e){if(_0x462a7e){_0x2dc68d=_0x462a7e[_0x208f('0x3b')];if(!_0xdbf70e[_0x208f('0x36')][_0x208f('0x3c')](_0x208f('0x3d'))){_0x2f4e26[_0x208f('0x27')]=qs[_0x208f('0x27')](_0xdbf70e['query'][_0x208f('0x27')]);_0x2f4e26[_0x208f('0x26')]=qs[_0x208f('0x26')](_0xdbf70e[_0x208f('0x36')]['offset']);}return _0x15e04e[_0x208f('0x55')](_0x2f4e26);}})[_0x208f('0x18')](function(_0x1f7eb7){if(_0x1f7eb7){return _0x1f7eb7?{'count':_0x2dc68d,'rows':_0x1f7eb7}:null;}})['then'](respondWithResult(_0xf322ba,null))['catch'](handleError(_0xf322ba,null));}; \ No newline at end of file +var _0x3871=['include','show','params','length','find','create','body','getSubjects','FreshsalesField','sort','hasOwnProperty','nolimit','findOne','rawAttributes','getDescriptions','getFields','html-pdf','rimraf','fast-json-patch','moment','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','limit','order','where','filters','pick','filter','type','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll'];(function(_0x47b374,_0x1d93db){var _0x572fa0=function(_0x22ee19){while(--_0x22ee19){_0x47b374['push'](_0x47b374['shift']());}};_0x572fa0(++_0x1d93db);}(_0x3871,0x1d2));var _0x1387=function(_0x1b0d31,_0x3dc6b4){_0x1b0d31=_0x1b0d31-0x0;var _0x3604c4=_0x3871[_0x1b0d31];return _0x3604c4;};'use strict';var pdf=require(_0x1387('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1387('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1387('0x2'));var rp=require('request-promise');var moment=require(_0x1387('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1387('0x4'));var csv=require('to-csv');var ejs=require(_0x1387('0x5'));var fs=require('fs');var _=require(_0x1387('0x6'));var squel=require(_0x1387('0x7'));var crypto=require(_0x1387('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1387('0x9'));var toCsv=require(_0x1387('0xa'));var querystring=require(_0x1387('0xb'));var Papa=require(_0x1387('0xc'));var Redis=require('ioredis');var authService=require(_0x1387('0xd'));var qs=require(_0x1387('0xe'));var as=require(_0x1387('0xf'));var hardwareService=require(_0x1387('0x10'));var logger=require(_0x1387('0x11'))(_0x1387('0x12'));var utils=require(_0x1387('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x1387('0x14'));var client=jayson[_0x1387('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x11e40c,_0x2a8b39,_0x24d47b){if(_0x24d47b){var _0xe48aaa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe48aaa[_0x1387('0x16')](_0x2a8b39)){return _0x11e40c;}else{throw new db[(_0x1387('0x17'))][(_0x1387('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 _0x11e40c;}}function respondWithRpcPromise(_0x190cb6,_0x47292b,_0x1cdb89,_0x3bdf63){return new BPromise(function(_0x3fe7f7,_0x11bbd3){var _0xc1822d=_0x3bdf63||client;return _0xc1822d[_0x1387('0x19')](_0x190cb6,_0x1cdb89)[_0x1387('0x1a')](function(_0x96a389){logger[_0x1387('0x1b')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x47292b,'request\x20sent');logger[_0x1387('0x1c')](_0x1387('0x1d'),_0x47292b,_0x1387('0x1e'),JSON[_0x1387('0x1f')](_0x96a389));if(_0x96a389[_0x1387('0x20')]){if(_0x96a389[_0x1387('0x20')][_0x1387('0x21')]===0x1f4){logger[_0x1387('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x47292b,_0x96a389['error'][_0x1387('0x22')]);return _0x11bbd3(_0x96a389[_0x1387('0x20')][_0x1387('0x22')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x47292b,_0x96a389[_0x1387('0x20')][_0x1387('0x22')]);return _0x3fe7f7(_0x96a389[_0x1387('0x20')][_0x1387('0x22')]);}else{logger[_0x1387('0x1b')](_0x1387('0x23'),_0x47292b,'request\x20sent');_0x3fe7f7(_0x96a389[_0x1387('0x24')][_0x1387('0x22')]);}})[_0x1387('0x25')](function(_0x348422){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x47292b,_0x348422);_0x11bbd3(_0x348422);});});}function respondWithStatusCode(_0x1a267d,_0x2a61b7){_0x2a61b7=_0x2a61b7||0xcc;return function(_0x4d9ea2){if(_0x4d9ea2){return _0x1a267d['sendStatus'](_0x2a61b7);}return _0x1a267d[_0x1387('0x26')](_0x2a61b7)[_0x1387('0x27')]();};}function respondWithResult(_0x552190,_0x2b09c8){_0x2b09c8=_0x2b09c8||0xc8;return function(_0x3b594c){if(_0x3b594c){return _0x552190['status'](_0x2b09c8)[_0x1387('0x28')](_0x3b594c);}};}function respondWithFilteredResult(_0x22cef6,_0x182b2d){return function(_0x35fa81){if(_0x35fa81){var _0xe4b355=_0x35fa81[_0x1387('0x29')],_0x3ecead=_0x182b2d['offset'],_0x27ba29=_0x182b2d[_0x1387('0x2a')]+_0x182b2d['limit'],_0x3517d8;if(_0x27ba29>=_0xe4b355){_0x27ba29=_0xe4b355;_0x3517d8=0xc8;}else{_0x3517d8=0xce;}_0x22cef6[_0x1387('0x26')](_0x3517d8);return _0x22cef6[_0x1387('0x2b')](_0x1387('0x2c'),_0x3ecead+'-'+_0x27ba29+'/'+_0xe4b355)[_0x1387('0x28')](_0x35fa81);}return null;};}function patchUpdates(_0x386e3a){return function(_0x52b334){try{jsonpatch['apply'](_0x52b334,_0x386e3a,!![]);}catch(_0x51c5d7){return BPromise[_0x1387('0x2d')](_0x51c5d7);}return _0x52b334[_0x1387('0x2e')]();};}function saveUpdates(_0x5914d7,_0x4dd88a){return function(_0x4469b8){if(_0x4469b8){return _0x4469b8[_0x1387('0x2f')](_0x5914d7)[_0x1387('0x1a')](function(_0x3a3af9){return _0x3a3af9;});}return null;};}function removeEntity(_0x202ccb,_0x11b8b3){return function(_0x877f2){if(_0x877f2){return _0x877f2[_0x1387('0x30')]()[_0x1387('0x1a')](function(){_0x202ccb[_0x1387('0x26')](0xcc)[_0x1387('0x27')]();});}};}function handleEntityNotFound(_0x33d768,_0x5d722b){return function(_0x5ba3ca){if(!_0x5ba3ca){_0x33d768['sendStatus'](0x194);}return _0x5ba3ca;};}function handleError(_0x42795f,_0x3092a1){_0x3092a1=_0x3092a1||0x1f4;return function(_0x4a07a7){logger['error'](_0x4a07a7[_0x1387('0x31')]);if(_0x4a07a7[_0x1387('0x32')]){delete _0x4a07a7[_0x1387('0x32')];}_0x42795f[_0x1387('0x26')](_0x3092a1)[_0x1387('0x33')](_0x4a07a7);};}exports[_0x1387('0x34')]=function(_0x16e03e,_0x430487){var _0x2c4b95={},_0x4ed805={},_0x10b7a1={'count':0x0,'rows':[]};var _0x2ba95b=_[_0x1387('0x35')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x17ba63){return{'name':_0x17ba63[_0x1387('0x36')],'type':_0x17ba63['type'][_0x1387('0x37')]};});_0x4ed805[_0x1387('0x38')]=_[_0x1387('0x35')](_0x2ba95b,_0x1387('0x32'));_0x4ed805[_0x1387('0x39')]=_[_0x1387('0x3a')](_0x16e03e[_0x1387('0x39')]);_0x4ed805['filters']=_[_0x1387('0x3b')](_0x4ed805[_0x1387('0x38')],_0x4ed805[_0x1387('0x39')]);_0x2c4b95['attributes']=_['intersection'](_0x4ed805[_0x1387('0x38')],qs[_0x1387('0x3c')](_0x16e03e[_0x1387('0x39')][_0x1387('0x3c')]));_0x2c4b95[_0x1387('0x3d')]=_0x2c4b95[_0x1387('0x3d')]['length']?_0x2c4b95['attributes']:_0x4ed805[_0x1387('0x38')];if(!_0x16e03e[_0x1387('0x39')]['hasOwnProperty']('nolimit')){_0x2c4b95[_0x1387('0x3e')]=qs['limit'](_0x16e03e[_0x1387('0x39')][_0x1387('0x3e')]);_0x2c4b95[_0x1387('0x2a')]=qs['offset'](_0x16e03e['query']['offset']);}_0x2c4b95[_0x1387('0x3f')]=qs['sort'](_0x16e03e[_0x1387('0x39')]['sort']);_0x2c4b95[_0x1387('0x40')]=qs[_0x1387('0x41')](_[_0x1387('0x42')](_0x16e03e[_0x1387('0x39')],_0x4ed805[_0x1387('0x41')]),_0x2ba95b);if(_0x16e03e[_0x1387('0x39')][_0x1387('0x43')]){_0x2c4b95[_0x1387('0x40')]=_['merge'](_0x2c4b95['where'],{'$or':_['map'](_0x2ba95b,function(_0x291686){if(_0x291686[_0x1387('0x44')]!==_0x1387('0x45')){var _0x5c36b0={};_0x5c36b0[_0x291686[_0x1387('0x32')]]={'$like':'%'+_0x16e03e['query'][_0x1387('0x43')]+'%'};return _0x5c36b0;}})});}_0x2c4b95=_[_0x1387('0x46')]({},_0x2c4b95,_0x16e03e[_0x1387('0x47')]);var _0x5333df={'where':_0x2c4b95[_0x1387('0x40')]};return db[_0x1387('0x48')]['count'](_0x5333df)['then'](function(_0x513918){_0x10b7a1[_0x1387('0x29')]=_0x513918;if(_0x16e03e[_0x1387('0x39')][_0x1387('0x49')]){_0x2c4b95[_0x1387('0x4a')]=[{'all':!![]}];}return db[_0x1387('0x48')]['findAll'](_0x2c4b95);})['then'](function(_0x5c8859){_0x10b7a1['rows']=_0x5c8859;return _0x10b7a1;})[_0x1387('0x1a')](respondWithFilteredResult(_0x430487,_0x2c4b95))[_0x1387('0x25')](handleError(_0x430487,null));};exports[_0x1387('0x4b')]=function(_0x14541c,_0x538c2e){var _0x556f11={'raw':![],'where':{'id':_0x14541c[_0x1387('0x4c')]['id']}},_0x20abb7={};_0x20abb7[_0x1387('0x38')]=_[_0x1387('0x3a')](db[_0x1387('0x48')]['rawAttributes']);_0x20abb7[_0x1387('0x39')]=_[_0x1387('0x3a')](_0x14541c[_0x1387('0x39')]);_0x20abb7[_0x1387('0x41')]=_['intersection'](_0x20abb7['model'],_0x20abb7[_0x1387('0x39')]);_0x556f11[_0x1387('0x3d')]=_[_0x1387('0x3b')](_0x20abb7[_0x1387('0x38')],qs[_0x1387('0x3c')](_0x14541c['query'][_0x1387('0x3c')]));_0x556f11[_0x1387('0x3d')]=_0x556f11[_0x1387('0x3d')][_0x1387('0x4d')]?_0x556f11[_0x1387('0x3d')]:_0x20abb7[_0x1387('0x38')];if(_0x14541c[_0x1387('0x39')][_0x1387('0x49')]){_0x556f11[_0x1387('0x4a')]=[{'all':!![]}];}_0x556f11=_[_0x1387('0x46')]({},_0x556f11,_0x14541c[_0x1387('0x47')]);return db['FreshsalesConfiguration'][_0x1387('0x4e')](_0x556f11)[_0x1387('0x1a')](handleEntityNotFound(_0x538c2e,null))[_0x1387('0x1a')](respondWithResult(_0x538c2e,null))[_0x1387('0x25')](handleError(_0x538c2e,null));};exports['create']=function(_0x3245b4,_0x388fac){return db['FreshsalesConfiguration'][_0x1387('0x4f')](_0x3245b4[_0x1387('0x50')],{})[_0x1387('0x1a')](respondWithResult(_0x388fac,0xc9))[_0x1387('0x25')](handleError(_0x388fac,null));};exports[_0x1387('0x2f')]=function(_0x240d20,_0x425005){if(_0x240d20[_0x1387('0x50')]['id']){delete _0x240d20[_0x1387('0x50')]['id'];}return db[_0x1387('0x48')][_0x1387('0x4e')]({'where':{'id':_0x240d20[_0x1387('0x4c')]['id']}})[_0x1387('0x1a')](handleEntityNotFound(_0x425005,null))[_0x1387('0x1a')](saveUpdates(_0x240d20[_0x1387('0x50')],null))[_0x1387('0x1a')](respondWithResult(_0x425005,null))[_0x1387('0x25')](handleError(_0x425005,null));};exports[_0x1387('0x30')]=function(_0x42b295,_0xb461af){return db['FreshsalesConfiguration'][_0x1387('0x4e')]({'where':{'id':_0x42b295['params']['id']}})[_0x1387('0x1a')](handleEntityNotFound(_0xb461af,null))[_0x1387('0x1a')](removeEntity(_0xb461af,null))[_0x1387('0x25')](handleError(_0xb461af,null));};exports[_0x1387('0x51')]=function(_0x1e5c16,_0x2791c9,_0x17acdf){var _0x156277={};var _0x1d4d4e={};var _0x3f716f;var _0x4ded86;return db[_0x1387('0x48')]['findOne']({'where':{'id':_0x1e5c16[_0x1387('0x4c')]['id']}})[_0x1387('0x1a')](handleEntityNotFound(_0x2791c9,null))[_0x1387('0x1a')](function(_0xc26f5c){if(_0xc26f5c){_0x3f716f=_0xc26f5c;_0x1d4d4e[_0x1387('0x38')]=_[_0x1387('0x3a')](db[_0x1387('0x52')]['rawAttributes']);_0x1d4d4e[_0x1387('0x39')]=_[_0x1387('0x3a')](_0x1e5c16[_0x1387('0x39')]);_0x1d4d4e[_0x1387('0x41')]=_[_0x1387('0x3b')](_0x1d4d4e[_0x1387('0x38')],_0x1d4d4e[_0x1387('0x39')]);_0x156277['attributes']=_[_0x1387('0x3b')](_0x1d4d4e[_0x1387('0x38')],qs['fields'](_0x1e5c16[_0x1387('0x39')][_0x1387('0x3c')]));_0x156277[_0x1387('0x3d')]=_0x156277[_0x1387('0x3d')][_0x1387('0x4d')]?_0x156277[_0x1387('0x3d')]:_0x1d4d4e[_0x1387('0x38')];_0x156277['order']=qs[_0x1387('0x53')](_0x1e5c16[_0x1387('0x39')][_0x1387('0x53')]);_0x156277[_0x1387('0x40')]=qs[_0x1387('0x41')](_[_0x1387('0x42')](_0x1e5c16[_0x1387('0x39')],_0x1d4d4e[_0x1387('0x41')]));if(_0x1e5c16[_0x1387('0x39')]['filter']){_0x156277[_0x1387('0x40')]=_[_0x1387('0x46')](_0x156277['where'],{'$or':_[_0x1387('0x35')](_0x156277['attributes'],function(_0x15de11){var _0x2ab620={};_0x2ab620[_0x15de11]={'$like':'%'+_0x1e5c16['query'][_0x1387('0x43')]+'%'};return _0x2ab620;})});}_0x156277=_['merge']({},_0x156277,_0x1e5c16[_0x1387('0x47')]);return _0x3f716f[_0x1387('0x51')](_0x156277);}})[_0x1387('0x1a')](function(_0x5f59ac){if(_0x5f59ac){_0x4ded86=_0x5f59ac[_0x1387('0x4d')];if(!_0x1e5c16[_0x1387('0x39')][_0x1387('0x54')](_0x1387('0x55'))){_0x156277[_0x1387('0x3e')]=qs[_0x1387('0x3e')](_0x1e5c16[_0x1387('0x39')][_0x1387('0x3e')]);_0x156277[_0x1387('0x2a')]=qs[_0x1387('0x2a')](_0x1e5c16['query']['offset']);}return _0x3f716f[_0x1387('0x51')](_0x156277);}})[_0x1387('0x1a')](function(_0x386913){if(_0x386913){return _0x386913?{'count':_0x4ded86,'rows':_0x386913}:null;}})['then'](respondWithResult(_0x2791c9,null))['catch'](handleError(_0x2791c9,null));};exports['getDescriptions']=function(_0x223729,_0x310468,_0x5821da){var _0x59c830={};var _0x3b8b8d={};var _0x54bf48;var _0x4c7d59;return db['FreshsalesConfiguration'][_0x1387('0x56')]({'where':{'id':_0x223729[_0x1387('0x4c')]['id']}})['then'](handleEntityNotFound(_0x310468,null))[_0x1387('0x1a')](function(_0x5304f8){if(_0x5304f8){_0x54bf48=_0x5304f8;_0x3b8b8d[_0x1387('0x38')]=_[_0x1387('0x3a')](db[_0x1387('0x52')][_0x1387('0x57')]);_0x3b8b8d[_0x1387('0x39')]=_[_0x1387('0x3a')](_0x223729[_0x1387('0x39')]);_0x3b8b8d[_0x1387('0x41')]=_[_0x1387('0x3b')](_0x3b8b8d[_0x1387('0x38')],_0x3b8b8d[_0x1387('0x39')]);_0x59c830[_0x1387('0x3d')]=_['intersection'](_0x3b8b8d[_0x1387('0x38')],qs[_0x1387('0x3c')](_0x223729[_0x1387('0x39')][_0x1387('0x3c')]));_0x59c830[_0x1387('0x3d')]=_0x59c830['attributes'][_0x1387('0x4d')]?_0x59c830['attributes']:_0x3b8b8d['model'];_0x59c830[_0x1387('0x3f')]=qs['sort'](_0x223729['query']['sort']);_0x59c830[_0x1387('0x40')]=qs[_0x1387('0x41')](_[_0x1387('0x42')](_0x223729['query'],_0x3b8b8d[_0x1387('0x41')]));if(_0x223729['query']['filter']){_0x59c830[_0x1387('0x40')]=_['merge'](_0x59c830[_0x1387('0x40')],{'$or':_[_0x1387('0x35')](_0x59c830[_0x1387('0x3d')],function(_0x584308){var _0x2ebb4d={};_0x2ebb4d[_0x584308]={'$like':'%'+_0x223729[_0x1387('0x39')]['filter']+'%'};return _0x2ebb4d;})});}_0x59c830=_[_0x1387('0x46')]({},_0x59c830,_0x223729[_0x1387('0x47')]);return _0x54bf48[_0x1387('0x58')](_0x59c830);}})[_0x1387('0x1a')](function(_0x2f35fa){if(_0x2f35fa){_0x4c7d59=_0x2f35fa[_0x1387('0x4d')];if(!_0x223729[_0x1387('0x39')][_0x1387('0x54')](_0x1387('0x55'))){_0x59c830[_0x1387('0x3e')]=qs[_0x1387('0x3e')](_0x223729[_0x1387('0x39')]['limit']);_0x59c830[_0x1387('0x2a')]=qs[_0x1387('0x2a')](_0x223729[_0x1387('0x39')][_0x1387('0x2a')]);}return _0x54bf48[_0x1387('0x58')](_0x59c830);}})[_0x1387('0x1a')](function(_0x169e26){if(_0x169e26){return _0x169e26?{'count':_0x4c7d59,'rows':_0x169e26}:null;}})[_0x1387('0x1a')](respondWithResult(_0x310468,null))[_0x1387('0x25')](handleError(_0x310468,null));};exports['getFields']=function(_0x2e1533,_0x211d47,_0x4dcfa8){var _0x31a827={};var _0x5793dc={};var _0x5f3b3b;var _0x5bf905;return db[_0x1387('0x48')]['findOne']({'where':{'id':_0x2e1533[_0x1387('0x4c')]['id']}})['then'](handleEntityNotFound(_0x211d47,null))['then'](function(_0x20b770){if(_0x20b770){_0x5f3b3b=_0x20b770;_0x5793dc[_0x1387('0x38')]=_['keys'](db[_0x1387('0x52')][_0x1387('0x57')]);_0x5793dc[_0x1387('0x39')]=_['keys'](_0x2e1533[_0x1387('0x39')]);_0x5793dc[_0x1387('0x41')]=_[_0x1387('0x3b')](_0x5793dc[_0x1387('0x38')],_0x5793dc[_0x1387('0x39')]);_0x31a827[_0x1387('0x3d')]=_[_0x1387('0x3b')](_0x5793dc[_0x1387('0x38')],qs[_0x1387('0x3c')](_0x2e1533[_0x1387('0x39')][_0x1387('0x3c')]));_0x31a827[_0x1387('0x3d')]=_0x31a827['attributes']['length']?_0x31a827[_0x1387('0x3d')]:_0x5793dc[_0x1387('0x38')];_0x31a827['order']=qs[_0x1387('0x53')](_0x2e1533[_0x1387('0x39')][_0x1387('0x53')]);_0x31a827[_0x1387('0x40')]=qs[_0x1387('0x41')](_[_0x1387('0x42')](_0x2e1533[_0x1387('0x39')],_0x5793dc[_0x1387('0x41')]));if(_0x2e1533[_0x1387('0x39')][_0x1387('0x43')]){_0x31a827[_0x1387('0x40')]=_[_0x1387('0x46')](_0x31a827[_0x1387('0x40')],{'$or':_[_0x1387('0x35')](_0x31a827['attributes'],function(_0x364528){var _0x540438={};_0x540438[_0x364528]={'$like':'%'+_0x2e1533['query'][_0x1387('0x43')]+'%'};return _0x540438;})});}_0x31a827=_['merge']({},_0x31a827,_0x2e1533['options']);return _0x5f3b3b[_0x1387('0x59')](_0x31a827);}})[_0x1387('0x1a')](function(_0x5f0e26){if(_0x5f0e26){_0x5bf905=_0x5f0e26[_0x1387('0x4d')];if(!_0x2e1533[_0x1387('0x39')][_0x1387('0x54')]('nolimit')){_0x31a827['limit']=qs[_0x1387('0x3e')](_0x2e1533['query']['limit']);_0x31a827[_0x1387('0x2a')]=qs[_0x1387('0x2a')](_0x2e1533[_0x1387('0x39')][_0x1387('0x2a')]);}return _0x5f3b3b['getFields'](_0x31a827);}})['then'](function(_0x2f4b5f){if(_0x2f4b5f){return _0x2f4b5f?{'count':_0x5bf905,'rows':_0x2f4b5f}:null;}})[_0x1387('0x1a')](respondWithResult(_0x211d47,null))[_0x1387('0x25')](handleError(_0x211d47,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 446fe77..a994176 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 _0xfccd=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x2eacf4,_0x214ca7){var _0x2e3361=function(_0x5486ff){while(--_0x5486ff){_0x2eacf4['push'](_0x2eacf4['shift']());}};_0x2e3361(++_0x214ca7);}(_0xfccd,0xc2));var _0xdfcc=function(_0x27f88b,_0x526bad){_0x27f88b=_0x27f88b-0x0;var _0x2114f4=_0xfccd[_0x27f88b];return _0x2114f4;};'use strict';var _=require(_0xdfcc('0x0'));var util=require(_0xdfcc('0x1'));var logger=require(_0xdfcc('0x2'))('api');var moment=require(_0xdfcc('0x3'));var BPromise=require(_0xdfcc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfcc('0x5'));var rimraf=require(_0xdfcc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdfcc('0x7'));module[_0xdfcc('0x8')]=function(_0x447008,_0x7f9ad6){return _0x447008[_0xdfcc('0x9')](_0xdfcc('0xa'),attributes,{'tableName':_0xdfcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc112=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc112,0xec));var _0x2c11=function(_0x5330e2,_0x50f2e1){_0x5330e2=_0x5330e2-0x0;var _0x3aa07a=_0xc112[_0x5330e2];return _0x3aa07a;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index cbc91f0..dbf5851 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 _0xd523=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0xd523,0x153));var _0x3d52=function(_0x2ec041,_0xdd86b2){_0x2ec041=_0x2ec041-0x0;var _0x2ae0cc=_0xd523[_0x2ec041];return _0x2ae0cc;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcc92,_0x189147,_0x2f3ebc){return new BPromise(function(_0x232bd4,_0x2e03c0){return client[_0x3d52('0xb')](_0x4fcc92,_0x2f3ebc)[_0x3d52('0xc')](function(_0x34c184){logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,'request\x20sent');logger[_0x3d52('0xf')](_0x3d52('0x10'),_0x189147,_0x3d52('0x11'),JSON[_0x3d52('0x12')](_0x34c184));if(_0x34c184[_0x3d52('0x13')]){if(_0x34c184['error'][_0x3d52('0x14')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x2e03c0(_0x34c184['error']['message']);}logger['error'](_0x3d52('0xe'),_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x232bd4(_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);}else{logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,_0x3d52('0x11'));_0x232bd4(_0x34c184[_0x3d52('0x16')][_0x3d52('0x15')]);}})[_0x3d52('0x17')](function(_0x15cc02){logger[_0x3d52('0x13')](_0x3d52('0xe'),_0x189147,_0x15cc02);_0x2e03c0(_0x15cc02);});});} \ No newline at end of file +var _0x74f4=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3a1e6b,_0x11b50a){var _0x2611ee=function(_0x4f8a49){while(--_0x4f8a49){_0x3a1e6b['push'](_0x3a1e6b['shift']());}};_0x2611ee(++_0x11b50a);}(_0x74f4,0xaa));var _0x474f=function(_0x39c745,_0xa4b72a){_0x39c745=_0x39c745-0x0;var _0x3b4c9c=_0x74f4[_0x39c745];return _0x3b4c9c;};'use strict';var _=require(_0x474f('0x0'));var util=require(_0x474f('0x1'));var moment=require('moment');var BPromise=require(_0x474f('0x2'));var rs=require(_0x474f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x474f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x474f('0x5'))(_0x474f('0x6'));var config=require(_0x474f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x474f('0x8')][_0x474f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3344a5,_0x23c5ce,_0x25e3f2){return new BPromise(function(_0x461707,_0x18fdc1){return client[_0x474f('0xa')](_0x3344a5,_0x25e3f2)[_0x474f('0xb')](function(_0x322d95){logger[_0x474f('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x23c5ce,_0x474f('0xd'));logger[_0x474f('0xe')](_0x474f('0xf'),_0x23c5ce,'request\x20sent',JSON[_0x474f('0x10')](_0x322d95));if(_0x322d95[_0x474f('0x11')]){if(_0x322d95[_0x474f('0x11')]['code']===0x1f4){logger[_0x474f('0x11')](_0x474f('0x12'),_0x23c5ce,_0x322d95['error'][_0x474f('0x13')]);return _0x18fdc1(_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);}logger['error'](_0x474f('0x12'),_0x23c5ce,_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);return _0x461707(_0x322d95[_0x474f('0x11')][_0x474f('0x13')]);}else{logger[_0x474f('0xc')](_0x474f('0x12'),_0x23c5ce,'request\x20sent');_0x461707(_0x322d95[_0x474f('0x14')]['message']);}})[_0x474f('0x15')](function(_0xb8d368){logger['error'](_0x474f('0x12'),_0x23c5ce,_0xb8d368);_0x18fdc1(_0xb8d368);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a3a17b9..49284ed 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 _0x9fa8=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show'];(function(_0x5a6916,_0x4e0d40){var _0x8cba91=function(_0x1670ed){while(--_0x1670ed){_0x5a6916['push'](_0x5a6916['shift']());}};_0x8cba91(++_0x4e0d40);}(_0x9fa8,0x193));var _0x89fa=function(_0x3a221b,_0x17f700){_0x3a221b=_0x3a221b-0x0;var _0x119e82=_0x9fa8[_0x3a221b];return _0x119e82;};'use strict';var multer=require('multer');var util=require(_0x89fa('0x0'));var path=require(_0x89fa('0x1'));var timeout=require(_0x89fa('0x2'));var express=require(_0x89fa('0x3'));var router=express['Router']();var auth=require(_0x89fa('0x4'));var interaction=require(_0x89fa('0x5'));var config=require(_0x89fa('0x6'));var controller=require('./intFreshsalesField.controller');router[_0x89fa('0x7')]('/',auth['isAuthenticated'](),controller[_0x89fa('0x8')]);router[_0x89fa('0x7')](_0x89fa('0x9'),auth['isAuthenticated'](),controller[_0x89fa('0xa')]);router[_0x89fa('0xb')]('/',auth[_0x89fa('0xc')](),controller[_0x89fa('0xd')]);router[_0x89fa('0xe')](_0x89fa('0x9'),auth['isAuthenticated'](),controller[_0x89fa('0xf')]);router['delete'](_0x89fa('0x9'),auth['isAuthenticated'](),controller[_0x89fa('0x10')]);module[_0x89fa('0x11')]=router; \ No newline at end of file +var _0x6609=['get','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller'];(function(_0xe3839f,_0x555463){var _0x43c987=function(_0x4a592f){while(--_0x4a592f){_0xe3839f['push'](_0xe3839f['shift']());}};_0x43c987(++_0x555463);}(_0x6609,0x6f));var _0x9660=function(_0x62502c,_0x449075){_0x62502c=_0x62502c-0x0;var _0x27b804=_0x6609[_0x62502c];return _0x27b804;};'use strict';var multer=require(_0x9660('0x0'));var util=require(_0x9660('0x1'));var path=require(_0x9660('0x2'));var timeout=require('connect-timeout');var express=require(_0x9660('0x3'));var router=express[_0x9660('0x4')]();var auth=require(_0x9660('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9660('0x6'));var controller=require(_0x9660('0x7'));router[_0x9660('0x8')]('/',auth[_0x9660('0x9')](),controller[_0x9660('0xa')]);router[_0x9660('0x8')](_0x9660('0xb'),auth['isAuthenticated'](),controller[_0x9660('0xc')]);router['post']('/',auth[_0x9660('0x9')](),controller[_0x9660('0xd')]);router['put'](_0x9660('0xb'),auth['isAuthenticated'](),controller[_0x9660('0xe')]);router[_0x9660('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9660('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4943ae8..2a4791a 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 _0x765e=['STRING','variable','BOOLEAN','sequelize','ENUM','customVariable','string'];(function(_0x5ed70a,_0x5c3eeb){var _0x4eb166=function(_0x3e7ef9){while(--_0x3e7ef9){_0x5ed70a['push'](_0x5ed70a['shift']());}};_0x4eb166(++_0x5c3eeb);}(_0x765e,0x153));var _0xe765=function(_0x5c38f4,_0x5e0d4c){_0x5c38f4=_0x5c38f4-0x0;var _0x1a8d84=_0x765e[_0x5c38f4];return _0x1a8d84;};'use strict';var Sequelize=require(_0xe765('0x0'));module['exports']={'type':{'type':Sequelize[_0xe765('0x1')]('string','variable',_0xe765('0x2'),'keyValue'),'defaultValue':_0xe765('0x3')},'content':{'type':Sequelize[_0xe765('0x4')]},'key':{'type':Sequelize[_0xe765('0x4')]},'keyType':{'type':Sequelize[_0xe765('0x1')](_0xe765('0x3'),_0xe765('0x5'),_0xe765('0x2'))},'keyContent':{'type':Sequelize[_0xe765('0x4')]},'idField':{'type':Sequelize[_0xe765('0x4')]},'nameField':{'type':Sequelize[_0xe765('0x4')]},'customField':{'type':Sequelize[_0xe765('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x69a1=['string','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x69a1,0x95));var _0x169a=function(_0x428565,_0x5790b6){_0x428565=_0x428565-0x0;var _0x4e6fcc=_0x69a1[_0x428565];return _0x4e6fcc;};'use strict';var Sequelize=require(_0x169a('0x0'));module[_0x169a('0x1')]={'type':{'type':Sequelize[_0x169a('0x2')](_0x169a('0x3'),'variable',_0x169a('0x4'),_0x169a('0x5')),'defaultValue':_0x169a('0x3')},'content':{'type':Sequelize[_0x169a('0x6')]},'key':{'type':Sequelize[_0x169a('0x6')]},'keyType':{'type':Sequelize[_0x169a('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x169a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x169a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x169a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 9fc569c..09a3503 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 _0x5fd7=['offset','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesField','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x28f579,_0x4778a0){var _0xdbda7=function(_0x347432){while(--_0x347432){_0x28f579['push'](_0x28f579['shift']());}};_0xdbda7(++_0x4778a0);}(_0x5fd7,0x19b));var _0x75fd=function(_0x3f3127,_0xb3d6bd){_0x3f3127=_0x3f3127-0x0;var _0x1fcbcd=_0x5fd7[_0x3f3127];return _0x1fcbcd;};'use strict';var pdf=require(_0x75fd('0x0'));var emlformat=require(_0x75fd('0x1'));var rimraf=require(_0x75fd('0x2'));var zipdir=require(_0x75fd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75fd('0x4'));var moment=require(_0x75fd('0x5'));var BPromise=require(_0x75fd('0x6'));var Mustache=require(_0x75fd('0x7'));var util=require(_0x75fd('0x8'));var path=require(_0x75fd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x75fd('0xa'));var squel=require('squel');var crypto=require(_0x75fd('0xb'));var jsforce=require(_0x75fd('0xc'));var deskjs=require(_0x75fd('0xd'));var toCsv=require(_0x75fd('0xe'));var querystring=require('querystring');var Papa=require(_0x75fd('0xf'));var Redis=require(_0x75fd('0x10'));var authService=require(_0x75fd('0x11'));var qs=require(_0x75fd('0x12'));var as=require(_0x75fd('0x13'));var hardwareService=require(_0x75fd('0x14'));var logger=require(_0x75fd('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x75fd('0x16'));var db=require(_0x75fd('0x17'))['db'];function respondWithStatusCode(_0x3525ae,_0x9e3ef){_0x9e3ef=_0x9e3ef||0xcc;return function(_0x42c7e2){if(_0x42c7e2){return _0x3525ae[_0x75fd('0x18')](_0x9e3ef);}return _0x3525ae[_0x75fd('0x19')](_0x9e3ef)['end']();};}function respondWithResult(_0x54ae4a,_0x3b24f4){_0x3b24f4=_0x3b24f4||0xc8;return function(_0x402ab0){if(_0x402ab0){return _0x54ae4a[_0x75fd('0x19')](_0x3b24f4)[_0x75fd('0x1a')](_0x402ab0);}};}function respondWithFilteredResult(_0x59dd64,_0x100f50){return function(_0x581eb1){if(_0x581eb1){var _0x3ac12b=_0x581eb1['count'],_0x5125f8=_0x100f50['offset'],_0x50fef0=_0x100f50[_0x75fd('0x1b')]+_0x100f50['limit'],_0x80620c;if(_0x50fef0>=_0x3ac12b){_0x50fef0=_0x3ac12b;_0x80620c=0xc8;}else{_0x80620c=0xce;}_0x59dd64[_0x75fd('0x19')](_0x80620c);return _0x59dd64['set'](_0x75fd('0x1c'),_0x5125f8+'-'+_0x50fef0+'/'+_0x3ac12b)[_0x75fd('0x1a')](_0x581eb1);}return null;};}function patchUpdates(_0x1d57ef){return function(_0x2ad529){try{jsonpatch[_0x75fd('0x1d')](_0x2ad529,_0x1d57ef,!![]);}catch(_0x597d62){return BPromise[_0x75fd('0x1e')](_0x597d62);}return _0x2ad529['save']();};}function saveUpdates(_0x29f7e4,_0x848ff5){return function(_0x106cb4){if(_0x106cb4){return _0x106cb4[_0x75fd('0x1f')](_0x29f7e4)[_0x75fd('0x20')](function(_0x515bc1){return _0x515bc1;});}return null;};}function removeEntity(_0x11edf1,_0x9f3541){return function(_0x4582c9){if(_0x4582c9){return _0x4582c9[_0x75fd('0x21')]()[_0x75fd('0x20')](function(){_0x11edf1[_0x75fd('0x19')](0xcc)[_0x75fd('0x22')]();});}};}function handleEntityNotFound(_0x4a4abd,_0x23637f){return function(_0x54f78d){if(!_0x54f78d){_0x4a4abd[_0x75fd('0x18')](0x194);}return _0x54f78d;};}function handleError(_0x317b86,_0x1645ed){_0x1645ed=_0x1645ed||0x1f4;return function(_0x5b87ea){logger[_0x75fd('0x23')](_0x5b87ea[_0x75fd('0x24')]);if(_0x5b87ea[_0x75fd('0x25')]){delete _0x5b87ea['name'];}_0x317b86[_0x75fd('0x19')](_0x1645ed)[_0x75fd('0x26')](_0x5b87ea);};}exports[_0x75fd('0x27')]=function(_0x4f184f,_0x5830e6){var _0x218845={},_0x20869a={},_0x271986={'count':0x0,'rows':[]};var _0x1e9d13=_[_0x75fd('0x28')](db[_0x75fd('0x29')]['rawAttributes'],function(_0x22bbeb){return{'name':_0x22bbeb[_0x75fd('0x2a')],'type':_0x22bbeb['type'][_0x75fd('0x2b')]};});_0x20869a['model']=_[_0x75fd('0x28')](_0x1e9d13,'name');_0x20869a[_0x75fd('0x2c')]=_[_0x75fd('0x2d')](_0x4f184f['query']);_0x20869a[_0x75fd('0x2e')]=_['intersection'](_0x20869a[_0x75fd('0x2f')],_0x20869a[_0x75fd('0x2c')]);_0x218845[_0x75fd('0x30')]=_[_0x75fd('0x31')](_0x20869a['model'],qs[_0x75fd('0x32')](_0x4f184f[_0x75fd('0x2c')][_0x75fd('0x32')]));_0x218845[_0x75fd('0x30')]=_0x218845[_0x75fd('0x30')][_0x75fd('0x33')]?_0x218845[_0x75fd('0x30')]:_0x20869a[_0x75fd('0x2f')];if(!_0x4f184f[_0x75fd('0x2c')][_0x75fd('0x34')]('nolimit')){_0x218845[_0x75fd('0x35')]=qs['limit'](_0x4f184f['query'][_0x75fd('0x35')]);_0x218845[_0x75fd('0x1b')]=qs[_0x75fd('0x1b')](_0x4f184f[_0x75fd('0x2c')][_0x75fd('0x1b')]);}_0x218845['order']=qs[_0x75fd('0x36')](_0x4f184f[_0x75fd('0x2c')]['sort']);_0x218845[_0x75fd('0x37')]=qs[_0x75fd('0x2e')](_[_0x75fd('0x38')](_0x4f184f['query'],_0x20869a[_0x75fd('0x2e')]),_0x1e9d13);if(_0x4f184f[_0x75fd('0x2c')][_0x75fd('0x39')]){_0x218845[_0x75fd('0x37')]=_[_0x75fd('0x3a')](_0x218845[_0x75fd('0x37')],{'$or':_[_0x75fd('0x28')](_0x1e9d13,function(_0x52f74a){if(_0x52f74a[_0x75fd('0x3b')]!==_0x75fd('0x3c')){var _0x163e6f={};_0x163e6f[_0x52f74a['name']]={'$like':'%'+_0x4f184f['query'][_0x75fd('0x39')]+'%'};return _0x163e6f;}})});}_0x218845=_[_0x75fd('0x3a')]({},_0x218845,_0x4f184f[_0x75fd('0x3d')]);var _0x26150c={'where':_0x218845[_0x75fd('0x37')]};return db[_0x75fd('0x29')][_0x75fd('0x3e')](_0x26150c)[_0x75fd('0x20')](function(_0x10ee62){_0x271986[_0x75fd('0x3e')]=_0x10ee62;if(_0x4f184f[_0x75fd('0x2c')][_0x75fd('0x3f')]){_0x218845['include']=[{'all':!![]}];}return db[_0x75fd('0x29')][_0x75fd('0x40')](_0x218845);})[_0x75fd('0x20')](function(_0x5b8a82){_0x271986[_0x75fd('0x41')]=_0x5b8a82;return _0x271986;})[_0x75fd('0x20')](respondWithFilteredResult(_0x5830e6,_0x218845))[_0x75fd('0x42')](handleError(_0x5830e6,null));};exports[_0x75fd('0x43')]=function(_0x48663f,_0xef9f32){var _0x17193c={'raw':!![],'where':{'id':_0x48663f[_0x75fd('0x44')]['id']}},_0x1062c4={};_0x1062c4[_0x75fd('0x2f')]=_[_0x75fd('0x2d')](db[_0x75fd('0x29')][_0x75fd('0x45')]);_0x1062c4['query']=_[_0x75fd('0x2d')](_0x48663f[_0x75fd('0x2c')]);_0x1062c4['filters']=_['intersection'](_0x1062c4[_0x75fd('0x2f')],_0x1062c4[_0x75fd('0x2c')]);_0x17193c[_0x75fd('0x30')]=_[_0x75fd('0x31')](_0x1062c4[_0x75fd('0x2f')],qs[_0x75fd('0x32')](_0x48663f[_0x75fd('0x2c')]['fields']));_0x17193c[_0x75fd('0x30')]=_0x17193c[_0x75fd('0x30')]['length']?_0x17193c['attributes']:_0x1062c4['model'];if(_0x48663f[_0x75fd('0x2c')][_0x75fd('0x3f')]){_0x17193c[_0x75fd('0x46')]=[{'all':!![]}];}_0x17193c=_[_0x75fd('0x3a')]({},_0x17193c,_0x48663f[_0x75fd('0x3d')]);return db['FreshsalesField'][_0x75fd('0x47')](_0x17193c)[_0x75fd('0x20')](handleEntityNotFound(_0xef9f32,null))[_0x75fd('0x20')](respondWithResult(_0xef9f32,null))[_0x75fd('0x42')](handleError(_0xef9f32,null));};exports['create']=function(_0x56bf32,_0x53b2d0){return db[_0x75fd('0x29')]['create'](_0x56bf32[_0x75fd('0x48')],{})[_0x75fd('0x20')](respondWithResult(_0x53b2d0,0xc9))[_0x75fd('0x42')](handleError(_0x53b2d0,null));};exports['update']=function(_0x21175e,_0xb92cb3){if(_0x21175e[_0x75fd('0x48')]['id']){delete _0x21175e[_0x75fd('0x48')]['id'];}return db[_0x75fd('0x29')][_0x75fd('0x47')]({'where':{'id':_0x21175e['params']['id']}})['then'](handleEntityNotFound(_0xb92cb3,null))['then'](saveUpdates(_0x21175e[_0x75fd('0x48')],null))[_0x75fd('0x20')](respondWithResult(_0xb92cb3,null))[_0x75fd('0x42')](handleError(_0xb92cb3,null));};exports[_0x75fd('0x21')]=function(_0x8b524f,_0x408871){return db[_0x75fd('0x29')][_0x75fd('0x47')]({'where':{'id':_0x8b524f['params']['id']}})[_0x75fd('0x20')](handleEntityNotFound(_0x408871,null))[_0x75fd('0x20')](removeEntity(_0x408871,null))[_0x75fd('0x42')](handleError(_0x408871,null));}; \ No newline at end of file +var _0x78a9=['../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','keys','find','create','update','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0xb21c94,_0xe3ef87){var _0x4bfab5=function(_0x5b6f7){while(--_0x5b6f7){_0xb21c94['push'](_0xb21c94['shift']());}};_0x4bfab5(++_0xe3ef87);}(_0x78a9,0x112));var _0x978a=function(_0x4f1101,_0x5eea42){_0x4f1101=_0x4f1101-0x0;var _0x55f79a=_0x78a9[_0x4f1101];return _0x55f79a;};'use strict';var pdf=require(_0x978a('0x0'));var emlformat=require(_0x978a('0x1'));var rimraf=require(_0x978a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x978a('0x3'));var rp=require(_0x978a('0x4'));var moment=require(_0x978a('0x5'));var BPromise=require(_0x978a('0x6'));var Mustache=require(_0x978a('0x7'));var util=require(_0x978a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x978a('0x9'));var ejs=require(_0x978a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x978a('0xb'));var crypto=require('crypto');var jsforce=require(_0x978a('0xc'));var deskjs=require(_0x978a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x978a('0xe'));var Papa=require(_0x978a('0xf'));var Redis=require(_0x978a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x978a('0x11'));var hardwareService=require(_0x978a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x978a('0x13'));var config=require(_0x978a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ef9d,_0x18e826){_0x18e826=_0x18e826||0xcc;return function(_0x16604e){if(_0x16604e){return _0x28ef9d[_0x978a('0x15')](_0x18e826);}return _0x28ef9d[_0x978a('0x16')](_0x18e826)[_0x978a('0x17')]();};}function respondWithResult(_0x268335,_0x50ffe1){_0x50ffe1=_0x50ffe1||0xc8;return function(_0x4dac47){if(_0x4dac47){return _0x268335['status'](_0x50ffe1)[_0x978a('0x18')](_0x4dac47);}};}function respondWithFilteredResult(_0x2c219b,_0x300159){return function(_0x56602e){if(_0x56602e){var _0x198584=_0x56602e[_0x978a('0x19')],_0x5c1f43=_0x300159[_0x978a('0x1a')],_0x5c852f=_0x300159['offset']+_0x300159[_0x978a('0x1b')],_0x41536d;if(_0x5c852f>=_0x198584){_0x5c852f=_0x198584;_0x41536d=0xc8;}else{_0x41536d=0xce;}_0x2c219b[_0x978a('0x16')](_0x41536d);return _0x2c219b[_0x978a('0x1c')](_0x978a('0x1d'),_0x5c1f43+'-'+_0x5c852f+'/'+_0x198584)[_0x978a('0x18')](_0x56602e);}return null;};}function patchUpdates(_0x41a5ee){return function(_0x3ebce8){try{jsonpatch[_0x978a('0x1e')](_0x3ebce8,_0x41a5ee,!![]);}catch(_0x185c94){return BPromise[_0x978a('0x1f')](_0x185c94);}return _0x3ebce8[_0x978a('0x20')]();};}function saveUpdates(_0x2b6f09,_0x5cc99e){return function(_0x1b99f5){if(_0x1b99f5){return _0x1b99f5['update'](_0x2b6f09)[_0x978a('0x21')](function(_0x280cb7){return _0x280cb7;});}return null;};}function removeEntity(_0x2aacef,_0x49993b){return function(_0xa45de8){if(_0xa45de8){return _0xa45de8[_0x978a('0x22')]()[_0x978a('0x21')](function(){_0x2aacef[_0x978a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32baab,_0x57bd98){return function(_0x3e070e){if(!_0x3e070e){_0x32baab[_0x978a('0x15')](0x194);}return _0x3e070e;};}function handleError(_0x27c86b,_0x46934d){_0x46934d=_0x46934d||0x1f4;return function(_0x3601fe){logger[_0x978a('0x23')](_0x3601fe[_0x978a('0x24')]);if(_0x3601fe[_0x978a('0x25')]){delete _0x3601fe[_0x978a('0x25')];}_0x27c86b[_0x978a('0x16')](_0x46934d)[_0x978a('0x26')](_0x3601fe);};}exports['index']=function(_0x445ae0,_0x38235b){var _0x1594f2={},_0x43e646={},_0x19f410={'count':0x0,'rows':[]};var _0xc040e9=_[_0x978a('0x27')](db[_0x978a('0x28')][_0x978a('0x29')],function(_0x51ecf0){return{'name':_0x51ecf0[_0x978a('0x2a')],'type':_0x51ecf0[_0x978a('0x2b')][_0x978a('0x2c')]};});_0x43e646[_0x978a('0x2d')]=_[_0x978a('0x27')](_0xc040e9,_0x978a('0x25'));_0x43e646[_0x978a('0x2e')]=_['keys'](_0x445ae0['query']);_0x43e646[_0x978a('0x2f')]=_[_0x978a('0x30')](_0x43e646['model'],_0x43e646['query']);_0x1594f2[_0x978a('0x31')]=_[_0x978a('0x30')](_0x43e646[_0x978a('0x2d')],qs[_0x978a('0x32')](_0x445ae0['query'][_0x978a('0x32')]));_0x1594f2[_0x978a('0x31')]=_0x1594f2[_0x978a('0x31')][_0x978a('0x33')]?_0x1594f2[_0x978a('0x31')]:_0x43e646[_0x978a('0x2d')];if(!_0x445ae0[_0x978a('0x2e')][_0x978a('0x34')](_0x978a('0x35'))){_0x1594f2['limit']=qs['limit'](_0x445ae0[_0x978a('0x2e')][_0x978a('0x1b')]);_0x1594f2[_0x978a('0x1a')]=qs[_0x978a('0x1a')](_0x445ae0[_0x978a('0x2e')][_0x978a('0x1a')]);}_0x1594f2[_0x978a('0x36')]=qs[_0x978a('0x37')](_0x445ae0[_0x978a('0x2e')][_0x978a('0x37')]);_0x1594f2['where']=qs[_0x978a('0x2f')](_[_0x978a('0x38')](_0x445ae0[_0x978a('0x2e')],_0x43e646[_0x978a('0x2f')]),_0xc040e9);if(_0x445ae0['query']['filter']){_0x1594f2[_0x978a('0x39')]=_['merge'](_0x1594f2[_0x978a('0x39')],{'$or':_[_0x978a('0x27')](_0xc040e9,function(_0x11cb00){if(_0x11cb00[_0x978a('0x2b')]!==_0x978a('0x3a')){var _0x1c16f0={};_0x1c16f0[_0x11cb00[_0x978a('0x25')]]={'$like':'%'+_0x445ae0[_0x978a('0x2e')][_0x978a('0x3b')]+'%'};return _0x1c16f0;}})});}_0x1594f2=_[_0x978a('0x3c')]({},_0x1594f2,_0x445ae0[_0x978a('0x3d')]);var _0x152584={'where':_0x1594f2[_0x978a('0x39')]};return db[_0x978a('0x28')]['count'](_0x152584)[_0x978a('0x21')](function(_0x477953){_0x19f410[_0x978a('0x19')]=_0x477953;if(_0x445ae0[_0x978a('0x2e')][_0x978a('0x3e')]){_0x1594f2[_0x978a('0x3f')]=[{'all':!![]}];}return db[_0x978a('0x28')]['findAll'](_0x1594f2);})[_0x978a('0x21')](function(_0x1e3ea9){_0x19f410[_0x978a('0x40')]=_0x1e3ea9;return _0x19f410;})['then'](respondWithFilteredResult(_0x38235b,_0x1594f2))[_0x978a('0x41')](handleError(_0x38235b,null));};exports[_0x978a('0x42')]=function(_0x1e5d46,_0x22bad0){var _0x5a90e5={'raw':!![],'where':{'id':_0x1e5d46['params']['id']}},_0x379e93={};_0x379e93[_0x978a('0x2d')]=_[_0x978a('0x43')](db[_0x978a('0x28')]['rawAttributes']);_0x379e93[_0x978a('0x2e')]=_[_0x978a('0x43')](_0x1e5d46[_0x978a('0x2e')]);_0x379e93[_0x978a('0x2f')]=_[_0x978a('0x30')](_0x379e93['model'],_0x379e93['query']);_0x5a90e5[_0x978a('0x31')]=_[_0x978a('0x30')](_0x379e93[_0x978a('0x2d')],qs[_0x978a('0x32')](_0x1e5d46[_0x978a('0x2e')]['fields']));_0x5a90e5[_0x978a('0x31')]=_0x5a90e5[_0x978a('0x31')][_0x978a('0x33')]?_0x5a90e5[_0x978a('0x31')]:_0x379e93[_0x978a('0x2d')];if(_0x1e5d46[_0x978a('0x2e')]['includeAll']){_0x5a90e5[_0x978a('0x3f')]=[{'all':!![]}];}_0x5a90e5=_[_0x978a('0x3c')]({},_0x5a90e5,_0x1e5d46['options']);return db[_0x978a('0x28')][_0x978a('0x44')](_0x5a90e5)[_0x978a('0x21')](handleEntityNotFound(_0x22bad0,null))[_0x978a('0x21')](respondWithResult(_0x22bad0,null))[_0x978a('0x41')](handleError(_0x22bad0,null));};exports[_0x978a('0x45')]=function(_0x24e861,_0xf4987a){return db[_0x978a('0x28')]['create'](_0x24e861['body'],{})[_0x978a('0x21')](respondWithResult(_0xf4987a,0xc9))['catch'](handleError(_0xf4987a,null));};exports[_0x978a('0x46')]=function(_0x22c180,_0x23e8ed){if(_0x22c180['body']['id']){delete _0x22c180[_0x978a('0x47')]['id'];}return db[_0x978a('0x28')][_0x978a('0x44')]({'where':{'id':_0x22c180[_0x978a('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e8ed,null))[_0x978a('0x21')](saveUpdates(_0x22c180[_0x978a('0x47')],null))['then'](respondWithResult(_0x23e8ed,null))[_0x978a('0x41')](handleError(_0x23e8ed,null));};exports[_0x978a('0x22')]=function(_0x1292f0,_0x4a28fb){return db[_0x978a('0x28')]['find']({'where':{'id':_0x1292f0[_0x978a('0x48')]['id']}})[_0x978a('0x21')](handleEntityNotFound(_0x4a28fb,null))[_0x978a('0x21')](removeEntity(_0x4a28fb,null))['catch'](handleError(_0x4a28fb,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 93c98d8..d31eb32 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 _0xd9b9=['api','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','idField','FieldId','util','../../config/logger'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xd9b9,0x111));var _0x9d9b=function(_0x6f7ebb,_0xb330f5){_0x6f7ebb=_0x6f7ebb-0x0;var _0x2f32dd=_0xd9b9[_0x6f7ebb];return _0x2f32dd;};'use strict';var _=require('lodash');var util=require(_0x9d9b('0x0'));var logger=require(_0x9d9b('0x1'))(_0x9d9b('0x2'));var moment=require('moment');var BPromise=require(_0x9d9b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d9b('0x4'));var config=require(_0x9d9b('0x5'));var attributes=require(_0x9d9b('0x6'));module[_0x9d9b('0x7')]=function(_0x442aba,_0x1cbf4e){return _0x442aba[_0x9d9b('0x8')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9d9b('0x9'),_0x9d9b('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79ad=['idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x79ad,0x16e));var _0xd79a=function(_0x34dd0e,_0x1f965b){_0x34dd0e=_0x34dd0e-0x0;var _0x7ac476=_0x79ad[_0x34dd0e];return _0x7ac476;};'use strict';var _=require(_0xd79a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd79a('0x1'));var moment=require(_0xd79a('0x2'));var BPromise=require(_0xd79a('0x3'));var rp=require(_0xd79a('0x4'));var fs=require('fs');var path=require(_0xd79a('0x5'));var rimraf=require(_0xd79a('0x6'));var config=require(_0xd79a('0x7'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x261e3e,_0x370f0c){return _0x261e3e[_0xd79a('0x8')](_0xd79a('0x9'),attributes,{'tableName':_0xd79a('0xa'),'paranoid':![],'indexes':[{'name':_0xd79a('0xb'),'fields':[_0xd79a('0xc'),_0xd79a('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 25bae71..47f194c 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 _0x347a=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x1c448d,_0x54a98d){var _0x171650=function(_0x14321d){while(--_0x14321d){_0x1c448d['push'](_0x1c448d['shift']());}};_0x171650(++_0x54a98d);}(_0x347a,0x153));var _0xa347=function(_0x39a99d,_0x36fdec){_0x39a99d=_0x39a99d-0x0;var _0x229fd5=_0x347a[_0x39a99d];return _0x229fd5;};'use strict';var _=require(_0xa347('0x0'));var util=require(_0xa347('0x1'));var moment=require('moment');var BPromise=require(_0xa347('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa347('0x3'));var db=require(_0xa347('0x4'))['db'];var utils=require(_0xa347('0x5'));var logger=require(_0xa347('0x6'))(_0xa347('0x7'));var config=require(_0xa347('0x8'));var jayson=require(_0xa347('0x9'));var client=jayson[_0xa347('0xa')][_0xa347('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3191f2,_0x3edeca,_0x211fbe){return new BPromise(function(_0x2e71c3,_0x3f83c3){return client['request'](_0x3191f2,_0x211fbe)['then'](function(_0x694643){logger[_0xa347('0xc')](_0xa347('0xd'),_0x3edeca,_0xa347('0xe'));logger[_0xa347('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3edeca,_0xa347('0xe'),JSON[_0xa347('0x10')](_0x694643));if(_0x694643[_0xa347('0x11')]){if(_0x694643[_0xa347('0x11')][_0xa347('0x12')]===0x1f4){logger[_0xa347('0x11')](_0xa347('0xd'),_0x3edeca,_0x694643[_0xa347('0x11')][_0xa347('0x13')]);return _0x3f83c3(_0x694643['error'][_0xa347('0x13')]);}logger[_0xa347('0x11')](_0xa347('0xd'),_0x3edeca,_0x694643[_0xa347('0x11')][_0xa347('0x13')]);return _0x2e71c3(_0x694643[_0xa347('0x11')][_0xa347('0x13')]);}else{logger['info'](_0xa347('0xd'),_0x3edeca,'request\x20sent');_0x2e71c3(_0x694643['result'][_0xa347('0x13')]);}})['catch'](function(_0x2e89be){logger[_0xa347('0x11')](_0xa347('0xd'),_0x3edeca,_0x2e89be);_0x3f83c3(_0x2e89be);});});} \ No newline at end of file +var _0x0a0e=['rpc','../../config/environment','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x18b7f2,_0xbd3294){var _0x4c685b=function(_0x44d7e5){while(--_0x44d7e5){_0x18b7f2['push'](_0x18b7f2['shift']());}};_0x4c685b(++_0xbd3294);}(_0x0a0e,0xae));var _0xe0a0=function(_0x2872c5,_0x362506){_0x2872c5=_0x2872c5-0x0;var _0x5a3d07=_0x0a0e[_0x2872c5];return _0x5a3d07;};'use strict';var _=require(_0xe0a0('0x0'));var util=require(_0xe0a0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0a0('0x2'));var fs=require('fs');var Redis=require(_0xe0a0('0x3'));var db=require(_0xe0a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0a0('0x5'))(_0xe0a0('0x6'));var config=require(_0xe0a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe0a0('0x8')][_0xe0a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445dc8,_0x19112b,_0x366c54){return new BPromise(function(_0x424fad,_0xd26baf){return client['request'](_0x445dc8,_0x366c54)[_0xe0a0('0xa')](function(_0x1d0d3c){logger[_0xe0a0('0xb')](_0xe0a0('0xc'),_0x19112b,'request\x20sent');logger[_0xe0a0('0xd')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x19112b,_0xe0a0('0xe'),JSON[_0xe0a0('0xf')](_0x1d0d3c));if(_0x1d0d3c[_0xe0a0('0x10')]){if(_0x1d0d3c['error']['code']===0x1f4){logger[_0xe0a0('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x19112b,_0x1d0d3c[_0xe0a0('0x10')][_0xe0a0('0x11')]);return _0xd26baf(_0x1d0d3c[_0xe0a0('0x10')][_0xe0a0('0x11')]);}logger[_0xe0a0('0x10')](_0xe0a0('0xc'),_0x19112b,_0x1d0d3c[_0xe0a0('0x10')][_0xe0a0('0x11')]);return _0x424fad(_0x1d0d3c['error'][_0xe0a0('0x11')]);}else{logger[_0xe0a0('0xb')](_0xe0a0('0xc'),_0x19112b,'request\x20sent');_0x424fad(_0x1d0d3c[_0xe0a0('0x12')]['message']);}})[_0xe0a0('0x13')](function(_0x3db66a){logger[_0xe0a0('0x10')](_0xe0a0('0xc'),_0x19112b,_0x3db66a);_0xd26baf(_0x3db66a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ee25fbe..e3b6adb 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 _0xa5fc=['isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceAccount.controller','get'];(function(_0x524c6d,_0x40e4f7){var _0x266c61=function(_0x4a7e24){while(--_0x4a7e24){_0x524c6d['push'](_0x524c6d['shift']());}};_0x266c61(++_0x40e4f7);}(_0xa5fc,0x146));var _0xca5f=function(_0x3ff600,_0x2af9f2){_0x3ff600=_0x3ff600-0x0;var _0x4c749f=_0xa5fc[_0x3ff600];return _0x4c749f;};'use strict';var multer=require(_0xca5f('0x0'));var util=require(_0xca5f('0x1'));var path=require(_0xca5f('0x2'));var timeout=require(_0xca5f('0x3'));var express=require(_0xca5f('0x4'));var router=express[_0xca5f('0x5')]();var auth=require(_0xca5f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca5f('0x7'));var controller=require(_0xca5f('0x8'));router[_0xca5f('0x9')]('/',auth[_0xca5f('0xa')](),controller[_0xca5f('0xb')]);router['get']('/:id',auth[_0xca5f('0xa')](),controller[_0xca5f('0xc')]);router[_0xca5f('0x9')](_0xca5f('0xd'),auth[_0xca5f('0xa')](),controller[_0xca5f('0xe')]);router[_0xca5f('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xca5f('0xf')]);router['post']('/',auth[_0xca5f('0xa')](),controller[_0xca5f('0x10')]);router[_0xca5f('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xca5f('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xca5f('0x13')]);router[_0xca5f('0x14')](_0xca5f('0x15'),auth[_0xca5f('0xa')](),controller[_0xca5f('0x16')]);module[_0xca5f('0x17')]=router; \ No newline at end of file +var _0x9772=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','isAuthenticated','index','/:id','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x9772,0x189));var _0x2977=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9772[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x2977('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2977('0x1'));var express=require('express');var router=express[_0x2977('0x2')]();var auth=require(_0x2977('0x3'));var interaction=require(_0x2977('0x4'));var config=require(_0x2977('0x5'));var controller=require(_0x2977('0x6'));router['get']('/',auth[_0x2977('0x7')](),controller[_0x2977('0x8')]);router['get'](_0x2977('0x9'),auth[_0x2977('0x7')](),controller['show']);router[_0x2977('0xa')](_0x2977('0xb'),auth[_0x2977('0x7')](),controller[_0x2977('0xc')]);router[_0x2977('0xa')](_0x2977('0xd'),auth[_0x2977('0x7')](),controller[_0x2977('0xe')]);router[_0x2977('0xf')]('/',auth[_0x2977('0x7')](),controller[_0x2977('0x10')]);router[_0x2977('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x2977('0x11')]('/:id',auth[_0x2977('0x7')](),controller[_0x2977('0x12')]);router[_0x2977('0x13')]('/:id',auth[_0x2977('0x7')](),controller[_0x2977('0x14')]);module[_0x2977('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0537828..224f9d7 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 _0xc4aa=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')]},'description':{'type':Sequelize[_0xac4a('0x2')]},'username':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xac4a('0x2')]},'securityToken':{'type':Sequelize[_0xac4a('0x2')]},'serverUrl':{'type':Sequelize[_0xac4a('0x2')]},'type':{'type':Sequelize[_0xac4a('0x4')](_0xac4a('0x5'),_0xac4a('0x6')),'defaultValue':_0xac4a('0x5')}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x187454,_0x69cd05){var _0x4a203a=function(_0x157324){while(--_0x157324){_0x187454['push'](_0x187454['shift']());}};_0x4a203a(++_0x69cd05);}(_0x7217,0x19e));var _0x7721=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7217[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'description':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')],'unique':_0x7721('0x2')},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x7721('0x1')]},'securityToken':{'type':Sequelize[_0x7721('0x1')]},'serverUrl':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize[_0x7721('0x3')](_0x7721('0x4'),_0x7721('0x5')),'defaultValue':_0x7721('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3184762..1af5f25 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 _0x014d=['name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','length','create','body','update','find','params','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','SalesforceField','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallType','IsArchived','Priority','Status','Type','Case','Origin','SuppliedName','SuppliedCompany','remove','custom','label','value','boolean','True','true','False','false','statusCode','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','test','Sequelize','ValidationError','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','stack'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x014d,0x159));var _0xd014=function(_0x49a3e2,_0x19aecb){_0x49a3e2=_0x49a3e2-0x0;var _0x3c6500=_0x014d[_0x49a3e2];return _0x3c6500;};'use strict';var pdf=require(_0xd014('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd014('0x1'));var zipdir=require(_0xd014('0x2'));var jsonpatch=require(_0xd014('0x3'));var rp=require('request-promise');var moment=require(_0xd014('0x4'));var BPromise=require(_0xd014('0x5'));var Mustache=require(_0xd014('0x6'));var util=require('util');var path=require(_0xd014('0x7'));var sox=require(_0xd014('0x8'));var csv=require(_0xd014('0x9'));var ejs=require(_0xd014('0xa'));var fs=require('fs');var _=require(_0xd014('0xb'));var squel=require(_0xd014('0xc'));var crypto=require('crypto');var jsforce=require(_0xd014('0xd'));var deskjs=require(_0xd014('0xe'));var toCsv=require(_0xd014('0x9'));var querystring=require(_0xd014('0xf'));var Papa=require('papaparse');var Redis=require(_0xd014('0x10'));var authService=require(_0xd014('0x11'));var qs=require(_0xd014('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd014('0x13'));var logger=require(_0xd014('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd014('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5d7d39,_0x393bb4,_0x305a0f){if(_0x305a0f){var _0x5eeddc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5eeddc[_0xd014('0x16')](_0x393bb4)){return _0x5d7d39;}else{throw new db[(_0xd014('0x17'))][(_0xd014('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 _0x5d7d39;}}function respondWithRpcPromise(_0x2faef4,_0x462578,_0x56cacd,_0x4b25a4){return new BPromise(function(_0x23043e,_0x4c39f4){var _0xfff186=_0x4b25a4||client;return _0xfff186[_0xd014('0x19')](_0x2faef4,_0x56cacd)['then'](function(_0x3ba248){logger[_0xd014('0x1a')](_0xd014('0x1b'),_0x462578,_0xd014('0x1c'));logger['debug'](_0xd014('0x1d'),_0x462578,'request\x20sent',JSON[_0xd014('0x1e')](_0x3ba248));if(_0x3ba248[_0xd014('0x1f')]){if(_0x3ba248[_0xd014('0x1f')][_0xd014('0x20')]===0x1f4){logger[_0xd014('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x462578,_0x3ba248[_0xd014('0x1f')]['message']);return _0x4c39f4(_0x3ba248[_0xd014('0x1f')][_0xd014('0x21')]);}logger[_0xd014('0x1f')](_0xd014('0x1b'),_0x462578,_0x3ba248[_0xd014('0x1f')][_0xd014('0x21')]);return _0x23043e(_0x3ba248['error'][_0xd014('0x21')]);}else{logger[_0xd014('0x1a')](_0xd014('0x1b'),_0x462578,_0xd014('0x1c'));_0x23043e(_0x3ba248['result']['message']);}})['catch'](function(_0x25ca20){logger[_0xd014('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x462578,_0x25ca20);_0x4c39f4(_0x25ca20);});});}function respondWithStatusCode(_0x3fb426,_0x128912){_0x128912=_0x128912||0xcc;return function(_0x270145){if(_0x270145){return _0x3fb426['sendStatus'](_0x128912);}return _0x3fb426[_0xd014('0x22')](_0x128912)['end']();};}function respondWithResult(_0x3d6e8d,_0x2c0b34){_0x2c0b34=_0x2c0b34||0xc8;return function(_0x3df8ea){if(_0x3df8ea){return _0x3d6e8d[_0xd014('0x22')](_0x2c0b34)[_0xd014('0x23')](_0x3df8ea);}};}function respondWithFilteredResult(_0x3e9dfb,_0x9b241b){return function(_0x2c44c1){if(_0x2c44c1){var _0x33bcd8=_0x2c44c1['count'],_0x47b722=_0x9b241b['offset'],_0x13b043=_0x9b241b['offset']+_0x9b241b[_0xd014('0x24')],_0x315798;if(_0x13b043>=_0x33bcd8){_0x13b043=_0x33bcd8;_0x315798=0xc8;}else{_0x315798=0xce;}_0x3e9dfb['status'](_0x315798);return _0x3e9dfb[_0xd014('0x25')](_0xd014('0x26'),_0x47b722+'-'+_0x13b043+'/'+_0x33bcd8)[_0xd014('0x23')](_0x2c44c1);}return null;};}function patchUpdates(_0x3e6075){return function(_0x3e4431){try{jsonpatch[_0xd014('0x27')](_0x3e4431,_0x3e6075,!![]);}catch(_0x568ccc){return BPromise[_0xd014('0x28')](_0x568ccc);}return _0x3e4431['save']();};}function saveUpdates(_0x1d17c9,_0xf0573){return function(_0x595262){if(_0x595262){return _0x595262['update'](_0x1d17c9)[_0xd014('0x29')](function(_0x21a49f){return _0x21a49f;});}return null;};}function removeEntity(_0x4e5b3f,_0x114dff){return function(_0x48fee3){if(_0x48fee3){return _0x48fee3[_0xd014('0x2a')]()[_0xd014('0x29')](function(){_0x4e5b3f[_0xd014('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de349,_0x26995d){return function(_0xd3a076){if(!_0xd3a076){_0x1de349[_0xd014('0x2b')](0x194);}return _0xd3a076;};}function handleError(_0x154368,_0xddfac6){_0xddfac6=_0xddfac6||0x1f4;return function(_0x51a272){logger[_0xd014('0x1f')](_0x51a272[_0xd014('0x2c')]);if(_0x51a272[_0xd014('0x2d')]){delete _0x51a272['name'];}_0x154368[_0xd014('0x22')](_0xddfac6)[_0xd014('0x2e')](_0x51a272);};}exports[_0xd014('0x2f')]=function(_0xcb8980,_0x5b0194){var _0xf051c4={},_0x333359={},_0xc76d45={'count':0x0,'rows':[]};var _0x4215e9=_[_0xd014('0x30')](db[_0xd014('0x31')]['rawAttributes'],function(_0x4c4995){return{'name':_0x4c4995[_0xd014('0x32')],'type':_0x4c4995[_0xd014('0x33')][_0xd014('0x34')]};});_0x333359[_0xd014('0x35')]=_[_0xd014('0x30')](_0x4215e9,_0xd014('0x2d'));_0x333359[_0xd014('0x36')]=_[_0xd014('0x37')](_0xcb8980[_0xd014('0x36')]);_0x333359[_0xd014('0x38')]=_[_0xd014('0x39')](_0x333359[_0xd014('0x35')],_0x333359[_0xd014('0x36')]);_0xf051c4[_0xd014('0x3a')]=_[_0xd014('0x39')](_0x333359[_0xd014('0x35')],qs[_0xd014('0x3b')](_0xcb8980[_0xd014('0x36')][_0xd014('0x3b')]));_0xf051c4[_0xd014('0x3a')]=_0xf051c4[_0xd014('0x3a')]['length']?_0xf051c4['attributes']:_0x333359[_0xd014('0x35')];if(!_0xcb8980[_0xd014('0x36')][_0xd014('0x3c')]('nolimit')){_0xf051c4[_0xd014('0x24')]=qs['limit'](_0xcb8980[_0xd014('0x36')][_0xd014('0x24')]);_0xf051c4['offset']=qs[_0xd014('0x3d')](_0xcb8980[_0xd014('0x36')][_0xd014('0x3d')]);}_0xf051c4[_0xd014('0x3e')]=qs[_0xd014('0x3f')](_0xcb8980[_0xd014('0x36')]['sort']);_0xf051c4[_0xd014('0x40')]=qs[_0xd014('0x38')](_[_0xd014('0x41')](_0xcb8980[_0xd014('0x36')],_0x333359[_0xd014('0x38')]),_0x4215e9);if(_0xcb8980[_0xd014('0x36')][_0xd014('0x42')]){_0xf051c4[_0xd014('0x40')]=_[_0xd014('0x43')](_0xf051c4['where'],{'$or':_[_0xd014('0x30')](_0x4215e9,function(_0x49f481){if(_0x49f481[_0xd014('0x33')]!==_0xd014('0x44')){var _0x5d350e={};_0x5d350e[_0x49f481['name']]={'$like':'%'+_0xcb8980[_0xd014('0x36')]['filter']+'%'};return _0x5d350e;}})});}_0xf051c4=_[_0xd014('0x43')]({},_0xf051c4,_0xcb8980[_0xd014('0x45')]);var _0x5d2bbc={'where':_0xf051c4[_0xd014('0x40')]};return db[_0xd014('0x31')]['count'](_0x5d2bbc)[_0xd014('0x29')](function(_0xa3e0eb){_0xc76d45[_0xd014('0x46')]=_0xa3e0eb;if(_0xcb8980['query'][_0xd014('0x47')]){_0xf051c4[_0xd014('0x48')]=[{'all':!![]}];}return db[_0xd014('0x31')][_0xd014('0x49')](_0xf051c4);})[_0xd014('0x29')](function(_0x1373d9){_0xc76d45[_0xd014('0x4a')]=_0x1373d9;return _0xc76d45;})[_0xd014('0x29')](respondWithFilteredResult(_0x5b0194,_0xf051c4))[_0xd014('0x4b')](handleError(_0x5b0194,null));};exports['show']=function(_0x30b13e,_0x4c828a){var _0x4c365d={'raw':![],'where':{'id':_0x30b13e['params']['id']}},_0x4a47d1={};_0x4a47d1[_0xd014('0x35')]=_[_0xd014('0x37')](db[_0xd014('0x31')][_0xd014('0x4c')]);_0x4a47d1['query']=_[_0xd014('0x37')](_0x30b13e[_0xd014('0x36')]);_0x4a47d1[_0xd014('0x38')]=_[_0xd014('0x39')](_0x4a47d1[_0xd014('0x35')],_0x4a47d1['query']);_0x4c365d['attributes']=_[_0xd014('0x39')](_0x4a47d1['model'],qs['fields'](_0x30b13e['query'][_0xd014('0x3b')]));_0x4c365d[_0xd014('0x3a')]=_0x4c365d[_0xd014('0x3a')][_0xd014('0x4d')]?_0x4c365d[_0xd014('0x3a')]:_0x4a47d1[_0xd014('0x35')];if(_0x30b13e[_0xd014('0x36')]['includeAll']){_0x4c365d['include']=[{'all':!![]}];}_0x4c365d=_[_0xd014('0x43')]({},_0x4c365d,_0x30b13e[_0xd014('0x45')]);return db[_0xd014('0x31')]['find'](_0x4c365d)[_0xd014('0x29')](handleEntityNotFound(_0x4c828a,null))[_0xd014('0x29')](respondWithResult(_0x4c828a,null))['catch'](handleError(_0x4c828a,null));};exports[_0xd014('0x4e')]=function(_0x23c85a,_0x145b99){return db[_0xd014('0x31')][_0xd014('0x4e')](_0x23c85a[_0xd014('0x4f')],{})['then'](respondWithResult(_0x145b99,0xc9))[_0xd014('0x4b')](handleError(_0x145b99,null));};exports[_0xd014('0x50')]=function(_0x172bbb,_0x409c15){if(_0x172bbb[_0xd014('0x4f')]['id']){delete _0x172bbb[_0xd014('0x4f')]['id'];}return db[_0xd014('0x31')][_0xd014('0x51')]({'where':{'id':_0x172bbb[_0xd014('0x52')]['id']}})[_0xd014('0x29')](handleEntityNotFound(_0x409c15,null))['then'](saveUpdates(_0x172bbb[_0xd014('0x4f')],null))[_0xd014('0x29')](respondWithResult(_0x409c15,null))['catch'](handleError(_0x409c15,null));};exports[_0xd014('0x2a')]=function(_0x2ebc2d,_0x5efca6){return db[_0xd014('0x31')]['find']({'where':{'id':_0x2ebc2d[_0xd014('0x52')]['id']}})[_0xd014('0x29')](handleEntityNotFound(_0x5efca6,null))['then'](removeEntity(_0x5efca6,null))[_0xd014('0x4b')](handleError(_0x5efca6,null));};exports[_0xd014('0x53')]=function(_0x4f3181,_0x1739da,_0x2b6c61){var _0x21ded9={};var _0x582603={};var _0x15ed40;var _0x7b1e50;return db[_0xd014('0x31')][_0xd014('0x54')]({'where':{'id':_0x4f3181[_0xd014('0x52')]['id']}})[_0xd014('0x29')](handleEntityNotFound(_0x1739da,null))[_0xd014('0x29')](function(_0x1bb749){if(_0x1bb749){_0x15ed40=_0x1bb749;_0x582603[_0xd014('0x35')]=_[_0xd014('0x37')](db[_0xd014('0x55')]['rawAttributes']);_0x582603['query']=_[_0xd014('0x37')](_0x4f3181['query']);_0x582603[_0xd014('0x38')]=_[_0xd014('0x39')](_0x582603[_0xd014('0x35')],_0x582603['query']);_0x21ded9[_0xd014('0x3a')]=_[_0xd014('0x39')](_0x582603[_0xd014('0x35')],qs['fields'](_0x4f3181['query'][_0xd014('0x3b')]));_0x21ded9[_0xd014('0x3a')]=_0x21ded9['attributes'][_0xd014('0x4d')]?_0x21ded9[_0xd014('0x3a')]:_0x582603[_0xd014('0x35')];_0x21ded9[_0xd014('0x3e')]=qs['sort'](_0x4f3181[_0xd014('0x36')][_0xd014('0x3f')]);_0x21ded9[_0xd014('0x40')]=qs[_0xd014('0x38')](_['pick'](_0x4f3181[_0xd014('0x36')],_0x582603['filters']));if(_0x4f3181['query'][_0xd014('0x42')]){_0x21ded9[_0xd014('0x40')]=_[_0xd014('0x43')](_0x21ded9[_0xd014('0x40')],{'$or':_[_0xd014('0x30')](_0x21ded9['attributes'],function(_0x2d8bb4){var _0x89ddb8={};_0x89ddb8[_0x2d8bb4]={'$like':'%'+_0x4f3181[_0xd014('0x36')][_0xd014('0x42')]+'%'};return _0x89ddb8;})});}_0x21ded9=_[_0xd014('0x43')]({},_0x21ded9,_0x4f3181[_0xd014('0x45')]);return _0x15ed40[_0xd014('0x53')](_0x21ded9);}})[_0xd014('0x29')](function(_0x465000){if(_0x465000){_0x7b1e50=_0x465000[_0xd014('0x4d')];if(!_0x4f3181[_0xd014('0x36')][_0xd014('0x3c')](_0xd014('0x56'))){_0x21ded9[_0xd014('0x24')]=qs[_0xd014('0x24')](_0x4f3181[_0xd014('0x36')]['limit']);_0x21ded9[_0xd014('0x3d')]=qs[_0xd014('0x3d')](_0x4f3181['query'][_0xd014('0x3d')]);}return _0x15ed40[_0xd014('0x53')](_0x21ded9);}})[_0xd014('0x29')](function(_0x48829c){if(_0x48829c){return _0x48829c?{'count':_0x7b1e50,'rows':_0x48829c}:null;}})['then'](respondWithResult(_0x1739da,null))[_0xd014('0x4b')](handleError(_0x1739da,null));};exports[_0xd014('0x57')]=function(_0x2c11ab,_0x49373d,_0x1b2276){if(_0x2c11ab[_0xd014('0x4f')]['id']){delete _0x2c11ab[_0xd014('0x4f')]['id'];}return db['SalesforceAccount'][_0xd014('0x54')]({'where':{'id':_0x2c11ab[_0xd014('0x52')]['id']}})[_0xd014('0x29')](handleEntityNotFound(_0x49373d,null))['then'](function(_0x5b953a){if(_0x5b953a){_0x2c11ab[_0xd014('0x4f')]['AccountId']=_0x5b953a['id'];_0x2c11ab[_0xd014('0x4f')][_0xd014('0x58')]=integrations[_0xd014('0x59')](_0x2c11ab[_0xd014('0x4f')][_0xd014('0x5a')],_0x2c11ab['body'][_0xd014('0x33')]);_0x2c11ab[_0xd014('0x4f')][_0xd014('0x5b')]=integrations['getDescriptions'](_0x2c11ab['body'][_0xd014('0x5a')],_0x2c11ab[_0xd014('0x4f')][_0xd014('0x33')]);return db[_0xd014('0x55')]['create'](_0x2c11ab['body'],{'include':[{'model':db['SalesforceField'],'as':_0xd014('0x58')},{'model':db[_0xd014('0x5c')],'as':_0xd014('0x5b')}]});}return null;})[_0xd014('0x29')](respondWithResult(_0x49373d,null))[_0xd014('0x4b')](handleError(_0x49373d,null));};exports['getFields']=function(_0x560a6e,_0x105c46,_0x19e995){var _0x3cac19;var _0x1886bf='';var _0x39148b='Task';return db[_0xd014('0x31')][_0xd014('0x54')]({'where':{'id':_0x560a6e['params']['id']},'attributes':['id',_0xd014('0x5d'),_0xd014('0x5e'),_0xd014('0x5f'),_0xd014('0x60'),'password',_0xd014('0x61')]})[_0xd014('0x29')](handleEntityNotFound(_0x105c46,null))[_0xd014('0x29')](function(_0x4a0c29){if(_0x4a0c29){_0x1886bf=_0x4a0c29[_0xd014('0x5d')];var _0x9f7d80=_0x1886bf[_0xd014('0x62')](-0x1);if(_0x9f7d80==='/'){_0x1886bf=_0x1886bf[_0xd014('0x63')](0x0,_0x1886bf[_0xd014('0x64')](_0x9f7d80));}_0x3cac19=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1886bf,'clientId':_0x4a0c29[_0xd014('0x5e')],'clientSecret':_0x4a0c29['clientSecret']}});return _0x3cac19['login'](_0x4a0c29[_0xd014('0x60')],_0x4a0c29[_0xd014('0x65')][_0xd014('0x66')](_0x4a0c29['securityToken']));}})[_0xd014('0x29')](function(_0x20ef95){if(_0x20ef95){if(!_[_0xd014('0x67')](_0x560a6e['query'][_0xd014('0x68')])){_0x39148b=_0x560a6e[_0xd014('0x36')][_0xd014('0x68')];}return _0x3cac19[_0xd014('0x69')](_0x39148b)[_0xd014('0x6a')]();}})[_0xd014('0x29')](function(_0x23525f){var _0x157470=[_0xd014('0x6b'),_0xd014('0x6c'),'CallObject',_0xd014('0x6d'),_0xd014('0x6e'),_0xd014('0x6f'),_0xd014('0x70'),_0xd014('0x71')];if(!_[_0xd014('0x67')](_0x560a6e['query'][_0xd014('0x68')])&&_0x560a6e[_0xd014('0x36')][_0xd014('0x68')]===_0xd014('0x72')){_0x157470=[_0xd014('0x71'),_0xd014('0x73'),'Reason',_0xd014('0x70'),_0xd014('0x6f'),'IsEscalated',_0xd014('0x74'),_0xd014('0x75')];}if(_0x23525f){_[_0xd014('0x76')](_0x23525f['fields'],function(_0x18be6e){return _0x18be6e[_0xd014('0x77')]===![]&&!_0x157470['includes'](_0x18be6e[_0xd014('0x2d')]);});return{'count':_0x23525f[_0xd014('0x3b')]['length'],'rows':_['map'](_0x23525f[_0xd014('0x3b')],function(_0x98d070){return{'id':_0x98d070[_0xd014('0x2d')],'name':_0x98d070[_0xd014('0x78')],'custom':_0x98d070[_0xd014('0x77')],'options':_0x98d070['picklistValues'][_0xd014('0x4d')]>0x0?_[_0xd014('0x30')](_0x98d070['picklistValues'],function(_0x449a63){return{'name':_0x449a63[_0xd014('0x78')],'value':_0x449a63[_0xd014('0x79')]};}):_0x98d070['type']==_0xd014('0x7a')?[{'name':_0xd014('0x7b'),'value':_0xd014('0x7c')},{'name':_0xd014('0x7d'),'value':_0xd014('0x7e')}]:[]};})};}})[_0xd014('0x29')](respondWithResult(_0x105c46,null))['catch'](function(_0x3066c2){var _0x246b6c=_0x560a6e[_0xd014('0x36')][_0xd014('0x16')]?0x1f4:_0x3066c2[_0xd014('0x7f')]||0x1f4;logger[_0xd014('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xd014('0x80'),_0x246b6c,JSON[_0xd014('0x1e')](_0x3066c2));delete _0x3066c2['name'];if(_0x246b6c===0x191){_0x246b6c=0x190;}_0x105c46['status'](_0x246b6c)['send'](_0x560a6e[_0xd014('0x36')]['test']?{'message':_0xd014('0x81'),'statusCode':_0x3066c2[_0xd014('0x7f')]}:_0x3066c2);});}; \ No newline at end of file +var _0xd57a=['sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','merge','create','body','find','params','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId','clientSecret','login','concat','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','isNil','Origin','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','value','boolean','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x30ad27,_0x750e0f){var _0x42242a=function(_0x352f81){while(--_0x352f81){_0x30ad27['push'](_0x30ad27['shift']());}};_0x42242a(++_0x750e0f);}(_0xd57a,0x117));var _0xad57=function(_0x131c2a,_0x159914){_0x131c2a=_0x131c2a-0x0;var _0x4f9f3c=_0xd57a[_0x131c2a];return _0x4f9f3c;};'use strict';var pdf=require(_0xad57('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad57('0x1'));var jsonpatch=require(_0xad57('0x2'));var rp=require(_0xad57('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad57('0x4'));var util=require(_0xad57('0x5'));var path=require(_0xad57('0x6'));var sox=require(_0xad57('0x7'));var csv=require(_0xad57('0x8'));var ejs=require(_0xad57('0x9'));var fs=require('fs');var _=require(_0xad57('0xa'));var squel=require(_0xad57('0xb'));var crypto=require('crypto');var jsforce=require(_0xad57('0xc'));var deskjs=require(_0xad57('0xd'));var toCsv=require(_0xad57('0x8'));var querystring=require(_0xad57('0xe'));var Papa=require(_0xad57('0xf'));var Redis=require(_0xad57('0x10'));var authService=require(_0xad57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xad57('0x12'));var hardwareService=require(_0xad57('0x13'));var logger=require(_0xad57('0x14'))('api');var utils=require(_0xad57('0x15'));var config=require(_0xad57('0x16'));var db=require(_0xad57('0x17'))['db'];var integrations=require(_0xad57('0x18'));var jayson=require(_0xad57('0x19'));var client=jayson[_0xad57('0x1a')][_0xad57('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x15599f,_0x572b50,_0x37c142){if(_0x37c142){var _0x38e46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38e46[_0xad57('0x1c')](_0x572b50)){return _0x15599f;}else{throw new db['Sequelize'][(_0xad57('0x1d'))](_0xad57('0x1e'));}}else{return _0x15599f;}}function respondWithRpcPromise(_0x823170,_0x512bac,_0x200593,_0x5ec430){return new BPromise(function(_0xcecdfb,_0x3a3add){var _0x391f2a=_0x5ec430||client;return _0x391f2a[_0xad57('0x1f')](_0x823170,_0x200593)[_0xad57('0x20')](function(_0x402153){logger[_0xad57('0x21')](_0xad57('0x22'),_0x512bac,_0xad57('0x23'));logger[_0xad57('0x24')](_0xad57('0x25'),_0x512bac,'request\x20sent',JSON['stringify'](_0x402153));if(_0x402153['error']){if(_0x402153[_0xad57('0x26')][_0xad57('0x27')]===0x1f4){logger[_0xad57('0x26')](_0xad57('0x22'),_0x512bac,_0x402153[_0xad57('0x26')][_0xad57('0x28')]);return _0x3a3add(_0x402153[_0xad57('0x26')][_0xad57('0x28')]);}logger[_0xad57('0x26')](_0xad57('0x22'),_0x512bac,_0x402153[_0xad57('0x26')]['message']);return _0xcecdfb(_0x402153[_0xad57('0x26')][_0xad57('0x28')]);}else{logger[_0xad57('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x512bac,_0xad57('0x23'));_0xcecdfb(_0x402153[_0xad57('0x29')]['message']);}})[_0xad57('0x2a')](function(_0x53ccf9){logger[_0xad57('0x26')]('SalesforceAccount,\x20%s,\x20%s',_0x512bac,_0x53ccf9);_0x3a3add(_0x53ccf9);});});}function respondWithStatusCode(_0x159a1f,_0x22f39f){_0x22f39f=_0x22f39f||0xcc;return function(_0x586486){if(_0x586486){return _0x159a1f[_0xad57('0x2b')](_0x22f39f);}return _0x159a1f[_0xad57('0x2c')](_0x22f39f)[_0xad57('0x2d')]();};}function respondWithResult(_0x515cd4,_0x4eb026){_0x4eb026=_0x4eb026||0xc8;return function(_0x24ffd9){if(_0x24ffd9){return _0x515cd4[_0xad57('0x2c')](_0x4eb026)[_0xad57('0x2e')](_0x24ffd9);}};}function respondWithFilteredResult(_0x2bb616,_0x3033a3){return function(_0xd7b95d){if(_0xd7b95d){var _0x373e40=_0xd7b95d[_0xad57('0x2f')],_0x3df190=_0x3033a3[_0xad57('0x30')],_0x138d02=_0x3033a3[_0xad57('0x30')]+_0x3033a3[_0xad57('0x31')],_0x46fe8a;if(_0x138d02>=_0x373e40){_0x138d02=_0x373e40;_0x46fe8a=0xc8;}else{_0x46fe8a=0xce;}_0x2bb616['status'](_0x46fe8a);return _0x2bb616[_0xad57('0x32')](_0xad57('0x33'),_0x3df190+'-'+_0x138d02+'/'+_0x373e40)[_0xad57('0x2e')](_0xd7b95d);}return null;};}function patchUpdates(_0x44139){return function(_0x5658f7){try{jsonpatch[_0xad57('0x34')](_0x5658f7,_0x44139,!![]);}catch(_0x3bde89){return BPromise[_0xad57('0x35')](_0x3bde89);}return _0x5658f7[_0xad57('0x36')]();};}function saveUpdates(_0x5b3e78,_0x30e8d4){return function(_0x1375c4){if(_0x1375c4){return _0x1375c4[_0xad57('0x37')](_0x5b3e78)[_0xad57('0x20')](function(_0x3eede6){return _0x3eede6;});}return null;};}function removeEntity(_0x197bdb,_0x1ef5da){return function(_0x685755){if(_0x685755){return _0x685755[_0xad57('0x38')]()[_0xad57('0x20')](function(){_0x197bdb[_0xad57('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb169,_0x461a3a){return function(_0x393bd4){if(!_0x393bd4){_0x4fb169['sendStatus'](0x194);}return _0x393bd4;};}function handleError(_0x5015e9,_0x231cb4){_0x231cb4=_0x231cb4||0x1f4;return function(_0x5c8a91){logger[_0xad57('0x26')](_0x5c8a91[_0xad57('0x39')]);if(_0x5c8a91[_0xad57('0x3a')]){delete _0x5c8a91[_0xad57('0x3a')];}_0x5015e9[_0xad57('0x2c')](_0x231cb4)[_0xad57('0x3b')](_0x5c8a91);};}exports[_0xad57('0x3c')]=function(_0x386398,_0x16aed8){var _0x40eaa3={},_0x347443={},_0x12bbbc={'count':0x0,'rows':[]};var _0x1d7c6e=_[_0xad57('0x3d')](db[_0xad57('0x3e')][_0xad57('0x3f')],function(_0xe79840){return{'name':_0xe79840[_0xad57('0x40')],'type':_0xe79840[_0xad57('0x41')]['key']};});_0x347443['model']=_['map'](_0x1d7c6e,_0xad57('0x3a'));_0x347443[_0xad57('0x42')]=_['keys'](_0x386398[_0xad57('0x42')]);_0x347443[_0xad57('0x43')]=_['intersection'](_0x347443[_0xad57('0x44')],_0x347443[_0xad57('0x42')]);_0x40eaa3[_0xad57('0x45')]=_[_0xad57('0x46')](_0x347443[_0xad57('0x44')],qs[_0xad57('0x47')](_0x386398[_0xad57('0x42')]['fields']));_0x40eaa3[_0xad57('0x45')]=_0x40eaa3['attributes'][_0xad57('0x48')]?_0x40eaa3[_0xad57('0x45')]:_0x347443[_0xad57('0x44')];if(!_0x386398[_0xad57('0x42')][_0xad57('0x49')](_0xad57('0x4a'))){_0x40eaa3['limit']=qs[_0xad57('0x31')](_0x386398[_0xad57('0x42')][_0xad57('0x31')]);_0x40eaa3[_0xad57('0x30')]=qs['offset'](_0x386398[_0xad57('0x42')][_0xad57('0x30')]);}_0x40eaa3[_0xad57('0x4b')]=qs[_0xad57('0x4c')](_0x386398[_0xad57('0x42')][_0xad57('0x4c')]);_0x40eaa3[_0xad57('0x4d')]=qs[_0xad57('0x43')](_[_0xad57('0x4e')](_0x386398[_0xad57('0x42')],_0x347443[_0xad57('0x43')]),_0x1d7c6e);if(_0x386398['query'][_0xad57('0x4f')]){_0x40eaa3['where']=_['merge'](_0x40eaa3[_0xad57('0x4d')],{'$or':_[_0xad57('0x3d')](_0x1d7c6e,function(_0x23da4){if(_0x23da4[_0xad57('0x41')]!==_0xad57('0x50')){var _0x36222c={};_0x36222c[_0x23da4[_0xad57('0x3a')]]={'$like':'%'+_0x386398[_0xad57('0x42')]['filter']+'%'};return _0x36222c;}})});}_0x40eaa3=_['merge']({},_0x40eaa3,_0x386398[_0xad57('0x51')]);var _0xb888d5={'where':_0x40eaa3['where']};return db['SalesforceAccount'][_0xad57('0x2f')](_0xb888d5)[_0xad57('0x20')](function(_0x3a0648){_0x12bbbc['count']=_0x3a0648;if(_0x386398[_0xad57('0x42')][_0xad57('0x52')]){_0x40eaa3[_0xad57('0x53')]=[{'all':!![]}];}return db[_0xad57('0x3e')][_0xad57('0x54')](_0x40eaa3);})[_0xad57('0x20')](function(_0x5d9b32){_0x12bbbc[_0xad57('0x55')]=_0x5d9b32;return _0x12bbbc;})[_0xad57('0x20')](respondWithFilteredResult(_0x16aed8,_0x40eaa3))['catch'](handleError(_0x16aed8,null));};exports[_0xad57('0x56')]=function(_0x2c5a6a,_0x58f6dc){var _0x3ec065={'raw':![],'where':{'id':_0x2c5a6a['params']['id']}},_0x1bdd7c={};_0x1bdd7c[_0xad57('0x44')]=_[_0xad57('0x57')](db[_0xad57('0x3e')]['rawAttributes']);_0x1bdd7c[_0xad57('0x42')]=_[_0xad57('0x57')](_0x2c5a6a[_0xad57('0x42')]);_0x1bdd7c['filters']=_[_0xad57('0x46')](_0x1bdd7c[_0xad57('0x44')],_0x1bdd7c[_0xad57('0x42')]);_0x3ec065[_0xad57('0x45')]=_[_0xad57('0x46')](_0x1bdd7c[_0xad57('0x44')],qs['fields'](_0x2c5a6a['query']['fields']));_0x3ec065['attributes']=_0x3ec065[_0xad57('0x45')][_0xad57('0x48')]?_0x3ec065['attributes']:_0x1bdd7c[_0xad57('0x44')];if(_0x2c5a6a[_0xad57('0x42')][_0xad57('0x52')]){_0x3ec065[_0xad57('0x53')]=[{'all':!![]}];}_0x3ec065=_[_0xad57('0x58')]({},_0x3ec065,_0x2c5a6a[_0xad57('0x51')]);return db['SalesforceAccount']['find'](_0x3ec065)['then'](handleEntityNotFound(_0x58f6dc,null))['then'](respondWithResult(_0x58f6dc,null))[_0xad57('0x2a')](handleError(_0x58f6dc,null));};exports[_0xad57('0x59')]=function(_0x141f59,_0x49076e){return db[_0xad57('0x3e')]['create'](_0x141f59[_0xad57('0x5a')],{})[_0xad57('0x20')](respondWithResult(_0x49076e,0xc9))['catch'](handleError(_0x49076e,null));};exports[_0xad57('0x37')]=function(_0x115d00,_0x212ac9){if(_0x115d00['body']['id']){delete _0x115d00[_0xad57('0x5a')]['id'];}return db[_0xad57('0x3e')][_0xad57('0x5b')]({'where':{'id':_0x115d00[_0xad57('0x5c')]['id']}})[_0xad57('0x20')](handleEntityNotFound(_0x212ac9,null))[_0xad57('0x20')](saveUpdates(_0x115d00[_0xad57('0x5a')],null))['then'](respondWithResult(_0x212ac9,null))[_0xad57('0x2a')](handleError(_0x212ac9,null));};exports[_0xad57('0x38')]=function(_0x3cc8e8,_0x51927d){return db[_0xad57('0x3e')][_0xad57('0x5b')]({'where':{'id':_0x3cc8e8[_0xad57('0x5c')]['id']}})[_0xad57('0x20')](handleEntityNotFound(_0x51927d,null))[_0xad57('0x20')](removeEntity(_0x51927d,null))[_0xad57('0x2a')](handleError(_0x51927d,null));};exports[_0xad57('0x5d')]=function(_0x54b332,_0x1d0bfc,_0x112ec4){var _0x5d9726={};var _0x5c8f16={};var _0x44feb9;var _0x56bed1;return db[_0xad57('0x3e')][_0xad57('0x5e')]({'where':{'id':_0x54b332[_0xad57('0x5c')]['id']}})[_0xad57('0x20')](handleEntityNotFound(_0x1d0bfc,null))['then'](function(_0x2dfe6f){if(_0x2dfe6f){_0x44feb9=_0x2dfe6f;_0x5c8f16[_0xad57('0x44')]=_[_0xad57('0x57')](db[_0xad57('0x5f')][_0xad57('0x3f')]);_0x5c8f16[_0xad57('0x42')]=_['keys'](_0x54b332['query']);_0x5c8f16[_0xad57('0x43')]=_[_0xad57('0x46')](_0x5c8f16[_0xad57('0x44')],_0x5c8f16[_0xad57('0x42')]);_0x5d9726['attributes']=_[_0xad57('0x46')](_0x5c8f16[_0xad57('0x44')],qs['fields'](_0x54b332[_0xad57('0x42')][_0xad57('0x47')]));_0x5d9726[_0xad57('0x45')]=_0x5d9726['attributes'][_0xad57('0x48')]?_0x5d9726[_0xad57('0x45')]:_0x5c8f16[_0xad57('0x44')];_0x5d9726[_0xad57('0x4b')]=qs['sort'](_0x54b332[_0xad57('0x42')][_0xad57('0x4c')]);_0x5d9726['where']=qs[_0xad57('0x43')](_['pick'](_0x54b332[_0xad57('0x42')],_0x5c8f16[_0xad57('0x43')]));if(_0x54b332['query']['filter']){_0x5d9726[_0xad57('0x4d')]=_[_0xad57('0x58')](_0x5d9726[_0xad57('0x4d')],{'$or':_[_0xad57('0x3d')](_0x5d9726[_0xad57('0x45')],function(_0x146f3e){var _0x475449={};_0x475449[_0x146f3e]={'$like':'%'+_0x54b332[_0xad57('0x42')][_0xad57('0x4f')]+'%'};return _0x475449;})});}_0x5d9726=_['merge']({},_0x5d9726,_0x54b332[_0xad57('0x51')]);return _0x44feb9['getConfigurations'](_0x5d9726);}})[_0xad57('0x20')](function(_0x268e4a){if(_0x268e4a){_0x56bed1=_0x268e4a['length'];if(!_0x54b332[_0xad57('0x42')][_0xad57('0x49')](_0xad57('0x4a'))){_0x5d9726[_0xad57('0x31')]=qs[_0xad57('0x31')](_0x54b332[_0xad57('0x42')][_0xad57('0x31')]);_0x5d9726[_0xad57('0x30')]=qs[_0xad57('0x30')](_0x54b332[_0xad57('0x42')][_0xad57('0x30')]);}return _0x44feb9[_0xad57('0x5d')](_0x5d9726);}})[_0xad57('0x20')](function(_0x4274a2){if(_0x4274a2){return _0x4274a2?{'count':_0x56bed1,'rows':_0x4274a2}:null;}})[_0xad57('0x20')](respondWithResult(_0x1d0bfc,null))['catch'](handleError(_0x1d0bfc,null));};exports[_0xad57('0x60')]=function(_0x5b81bb,_0x3a0a7a,_0x54c3b5){if(_0x5b81bb[_0xad57('0x5a')]['id']){delete _0x5b81bb['body']['id'];}return db[_0xad57('0x3e')][_0xad57('0x5e')]({'where':{'id':_0x5b81bb[_0xad57('0x5c')]['id']}})[_0xad57('0x20')](handleEntityNotFound(_0x3a0a7a,null))['then'](function(_0x3f92ab){if(_0x3f92ab){_0x5b81bb['body'][_0xad57('0x61')]=_0x3f92ab['id'];_0x5b81bb['body'][_0xad57('0x62')]=integrations[_0xad57('0x63')](_0x5b81bb[_0xad57('0x5a')][_0xad57('0x64')],_0x5b81bb[_0xad57('0x5a')][_0xad57('0x41')]);_0x5b81bb['body'][_0xad57('0x65')]=integrations[_0xad57('0x66')](_0x5b81bb[_0xad57('0x5a')][_0xad57('0x64')],_0x5b81bb[_0xad57('0x5a')][_0xad57('0x41')]);return db[_0xad57('0x5f')]['create'](_0x5b81bb[_0xad57('0x5a')],{'include':[{'model':db[_0xad57('0x67')],'as':_0xad57('0x62')},{'model':db[_0xad57('0x67')],'as':_0xad57('0x65')}]});}return null;})['then'](respondWithResult(_0x3a0a7a,null))[_0xad57('0x2a')](handleError(_0x3a0a7a,null));};exports['getFields']=function(_0x5b14a3,_0x172599,_0x4c3745){var _0x31f636;var _0x164ed4='';var _0x36571a=_0xad57('0x68');return db['SalesforceAccount'][_0xad57('0x5e')]({'where':{'id':_0x5b14a3[_0xad57('0x5c')]['id']},'attributes':['id',_0xad57('0x69'),'clientId','clientSecret',_0xad57('0x6a'),_0xad57('0x6b'),_0xad57('0x6c')]})[_0xad57('0x20')](handleEntityNotFound(_0x172599,null))[_0xad57('0x20')](function(_0x46e424){if(_0x46e424){_0x164ed4=_0x46e424[_0xad57('0x69')];var _0x26bea2=_0x164ed4[_0xad57('0x6d')](-0x1);if(_0x26bea2==='/'){_0x164ed4=_0x164ed4[_0xad57('0x6e')](0x0,_0x164ed4[_0xad57('0x6f')](_0x26bea2));}_0x31f636=new jsforce[(_0xad57('0x70'))]({'oauth2':{'loginUrl':_0x164ed4,'clientId':_0x46e424[_0xad57('0x71')],'clientSecret':_0x46e424[_0xad57('0x72')]}});return _0x31f636[_0xad57('0x73')](_0x46e424[_0xad57('0x6a')],_0x46e424[_0xad57('0x6b')][_0xad57('0x74')](_0x46e424[_0xad57('0x6c')]));}})['then'](function(_0x155f54){if(_0x155f54){if(!_['isNil'](_0x5b14a3['query'][_0xad57('0x75')])){_0x36571a=_0x5b14a3[_0xad57('0x42')]['ticketType'];}return _0x31f636['sobject'](_0x36571a)[_0xad57('0x76')]();}})[_0xad57('0x20')](function(_0x55e0ff){var _0x19cbd5=[_0xad57('0x77'),_0xad57('0x78'),_0xad57('0x79'),'CallType',_0xad57('0x7a'),_0xad57('0x7b'),_0xad57('0x7c'),'Type'];if(!_[_0xad57('0x7d')](_0x5b14a3[_0xad57('0x42')][_0xad57('0x75')])&&_0x5b14a3[_0xad57('0x42')][_0xad57('0x75')]==='Case'){_0x19cbd5=['Type',_0xad57('0x7e'),_0xad57('0x7f'),_0xad57('0x7c'),_0xad57('0x7b'),_0xad57('0x80'),_0xad57('0x81'),_0xad57('0x82')];}if(_0x55e0ff){_[_0xad57('0x83')](_0x55e0ff[_0xad57('0x47')],function(_0x4a79db){return _0x4a79db[_0xad57('0x84')]===![]&&!_0x19cbd5[_0xad57('0x85')](_0x4a79db[_0xad57('0x3a')]);});return{'count':_0x55e0ff[_0xad57('0x47')][_0xad57('0x48')],'rows':_[_0xad57('0x3d')](_0x55e0ff[_0xad57('0x47')],function(_0x20e463){return{'id':_0x20e463[_0xad57('0x3a')],'name':_0x20e463[_0xad57('0x86')],'custom':_0x20e463[_0xad57('0x84')],'options':_0x20e463['picklistValues']['length']>0x0?_[_0xad57('0x3d')](_0x20e463['picklistValues'],function(_0x556097){return{'name':_0x556097[_0xad57('0x86')],'value':_0x556097[_0xad57('0x87')]};}):_0x20e463[_0xad57('0x41')]==_0xad57('0x88')?[{'name':'True','value':_0xad57('0x89')},{'name':_0xad57('0x8a'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x172599,null))[_0xad57('0x2a')](function(_0x30ee6a){var _0x2c3b7d=_0x5b14a3[_0xad57('0x42')][_0xad57('0x1c')]?0x1f4:_0x30ee6a[_0xad57('0x8b')]||0x1f4;logger[_0xad57('0x26')](_0xad57('0x8c'),_0xad57('0x8d'),_0x2c3b7d,JSON[_0xad57('0x8e')](_0x30ee6a));delete _0x30ee6a[_0xad57('0x3a')];if(_0x2c3b7d===0x191){_0x2c3b7d=0x190;}_0x172599[_0xad57('0x2c')](_0x2c3b7d)['send'](_0x5b14a3[_0xad57('0x42')][_0xad57('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x30ee6a[_0xad57('0x8b')]}:_0x30ee6a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c487288..e06be27 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 _0xa469=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','request-promise','path'];(function(_0x36587e,_0x4fdd5e){var _0x73e98d=function(_0x345401){while(--_0x345401){_0x36587e['push'](_0x36587e['shift']());}};_0x73e98d(++_0x4fdd5e);}(_0xa469,0x133));var _0x9a46=function(_0xde67b8,_0x47d99e){_0xde67b8=_0xde67b8-0x0;var _0x5e06a5=_0xa469[_0xde67b8];return _0x5e06a5;};'use strict';var _=require(_0x9a46('0x0'));var util=require(_0x9a46('0x1'));var logger=require(_0x9a46('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a46('0x3'));var fs=require('fs');var path=require(_0x9a46('0x4'));var rimraf=require(_0x9a46('0x5'));var config=require('../../config/environment');var attributes=require(_0x9a46('0x6'));var integrations=require(_0x9a46('0x7'));module[_0x9a46('0x8')]=function(_0x22c9d7,_0x1c200c){return _0x22c9d7[_0x9a46('0x9')](_0x9a46('0xa'),attributes,{'tableName':_0x9a46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80fc=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3712e2,_0x32d752){var _0x1faff4=function(_0x550dc0){while(--_0x550dc0){_0x3712e2['push'](_0x3712e2['shift']());}};_0x1faff4(++_0x32d752);}(_0x80fc,0x1bf));var _0xc80f=function(_0x43f638,_0x45397c){_0x43f638=_0x43f638-0x0;var _0x30d91f=_0x80fc[_0x43f638];return _0x30d91f;};'use strict';var _=require(_0xc80f('0x0'));var util=require(_0xc80f('0x1'));var logger=require(_0xc80f('0x2'))(_0xc80f('0x3'));var moment=require('moment');var BPromise=require(_0xc80f('0x4'));var rp=require(_0xc80f('0x5'));var fs=require('fs');var path=require(_0xc80f('0x6'));var rimraf=require(_0xc80f('0x7'));var config=require(_0xc80f('0x8'));var attributes=require(_0xc80f('0x9'));var integrations=require(_0xc80f('0xa'));module[_0xc80f('0xb')]=function(_0x59e6cf,_0x593cc6){return _0x59e6cf[_0xc80f('0xc')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 47eb696..ff80331 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 _0xe205=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','include','map','model','attributes','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xe205,0xa7));var _0x5e20=function(_0x5c431d,_0x303e10){_0x5c431d=_0x5c431d-0x0;var _0x2e5734=_0xe205[_0x5c431d];return _0x2e5734;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['findAll']({'raw':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706['options'][_0x5e20('0x1c')]||null:null,'attributes':_0x1cc706['options']?_0x1cc706['options']['attributes']||null:null,'limit':_0x1cc706['options']?_0x1cc706[_0x5e20('0x1a')]['limit']||null:null,'include':_0x1cc706[_0x5e20('0x1a')]?_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x1cc706[_0x5e20('0x1a')][_0x5e20('0x1d')],function(_0x4c5732){return{'model':db[_0x4c5732[_0x5e20('0x1f')]],'as':_0x4c5732['as'],'attributes':_0x4c5732['attributes'],'include':_0x4c5732['include']?_[_0x5e20('0x1e')](_0x4c5732[_0x5e20('0x1d')],function(_0x2bae08){return{'model':db[_0x2bae08[_0x5e20('0x1f')]],'as':_0x2bae08['as'],'attributes':_0x2bae08[_0x5e20('0x20')],'include':_0x2bae08[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2bae08['include'],function(_0x3bf4f4){return{'model':db[_0x3bf4f4[_0x5e20('0x1f')]],'as':_0x3bf4f4['as'],'attributes':_0x3bf4f4[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5e20('0xe')](function(_0x4c799d){logger[_0x5e20('0xf')](_0x5e20('0x18'),_0x1cc706);logger[_0x5e20('0x12')](_0x5e20('0x18'),_0x1cc706,JSON[_0x5e20('0x13')](_0x4c799d));_0x4d3e4a(_0x4c799d);})[_0x5e20('0x17')](function(_0x5ec45b){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x5ec45b['message'],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x5ec45b[_0x5e20('0x16')]));});});};exports[_0x5e20('0x21')]=function(_0x4196a3){var _0x1548c8=this;return new Promise(function(_0x395a27,_0x4ff715){return db[_0x5e20('0x19')][_0x5e20('0x22')]({'raw':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1b')]===undefined?!![]:![]:!![],'where':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1c')]||null:null,'attributes':_0x4196a3[_0x5e20('0x1a')]?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x20')]||null:null,'include':_0x4196a3['options']?_0x4196a3[_0x5e20('0x1a')][_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x4196a3['options'][_0x5e20('0x1d')],function(_0x2d397b){return{'model':db[_0x2d397b[_0x5e20('0x1f')]],'as':_0x2d397b['as'],'attributes':_0x2d397b[_0x5e20('0x20')],'include':_0x2d397b[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x2d397b[_0x5e20('0x1d')],function(_0x173165){return{'model':db[_0x173165[_0x5e20('0x1f')]],'as':_0x173165['as'],'attributes':_0x173165[_0x5e20('0x20')],'include':_0x173165[_0x5e20('0x1d')]?_[_0x5e20('0x1e')](_0x173165[_0x5e20('0x1d')],function(_0x255b67){return{'model':db[_0x255b67['model']],'as':_0x255b67['as'],'attributes':_0x255b67[_0x5e20('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549f01){logger[_0x5e20('0xf')](_0x5e20('0x21'),_0x4196a3);logger['debug'](_0x5e20('0x21'),_0x4196a3,JSON[_0x5e20('0x13')](_0x549f01));_0x395a27(_0x549f01);})['catch'](function(_0x3f3908){logger[_0x5e20('0x14')](_0x5e20('0x21'),_0x3f3908[_0x5e20('0x16')],_0x4196a3);_0x4ff715(_0x1548c8[_0x5e20('0x14')](0x1f4,_0x3f3908[_0x5e20('0x16')]));});});}; \ No newline at end of file +var _0x00bb=['map','then','GetSalesforceAccount','ShowSalesforceAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SalesforceAccount','options','attributes','limit','include','model'];(function(_0x2c2911,_0x507026){var _0x32f829=function(_0x246540){while(--_0x246540){_0x2c2911['push'](_0x2c2911['shift']());}};_0x32f829(++_0x507026);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}exports['GetSalesforceAccount']=function(_0x2a7231){var _0x599347=this;return new Promise(function(_0x415f91,_0x5aa9a0){return db[_0xb00b('0x12')]['findAll']({'raw':_0x2a7231[_0xb00b('0x13')]?_0x2a7231[_0xb00b('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2a7231['options']?_0x2a7231[_0xb00b('0x13')]['where']||null:null,'attributes':_0x2a7231[_0xb00b('0x13')]?_0x2a7231[_0xb00b('0x13')][_0xb00b('0x14')]||null:null,'limit':_0x2a7231[_0xb00b('0x13')]?_0x2a7231['options'][_0xb00b('0x15')]||null:null,'include':_0x2a7231['options']?_0x2a7231[_0xb00b('0x13')][_0xb00b('0x16')]?_['map'](_0x2a7231[_0xb00b('0x13')][_0xb00b('0x16')],function(_0x520444){return{'model':db[_0x520444[_0xb00b('0x17')]],'as':_0x520444['as'],'attributes':_0x520444[_0xb00b('0x14')],'include':_0x520444['include']?_[_0xb00b('0x18')](_0x520444[_0xb00b('0x16')],function(_0x3c9500){return{'model':db[_0x3c9500[_0xb00b('0x17')]],'as':_0x3c9500['as'],'attributes':_0x3c9500['attributes'],'include':_0x3c9500['include']?_[_0xb00b('0x18')](_0x3c9500['include'],function(_0x550587){return{'model':db[_0x550587['model']],'as':_0x550587['as'],'attributes':_0x550587[_0xb00b('0x14')]};}):[]};}):[]};}):[]:[]})[_0xb00b('0x19')](function(_0x2592cf){logger[_0xb00b('0x9')](_0xb00b('0x1a'),_0x2a7231);logger[_0xb00b('0xc')](_0xb00b('0x1a'),_0x2a7231,JSON['stringify'](_0x2592cf));_0x415f91(_0x2592cf);})[_0xb00b('0x11')](function(_0x503c9c){logger[_0xb00b('0xf')](_0xb00b('0x1a'),_0x503c9c[_0xb00b('0x10')],_0x2a7231);_0x5aa9a0(_0x599347['error'](0x1f4,_0x503c9c[_0xb00b('0x10')]));});});};exports[_0xb00b('0x1b')]=function(_0x16fbd5){var _0x183233=this;return new Promise(function(_0x303625,_0x2b9824){return db[_0xb00b('0x12')][_0xb00b('0x1c')]({'raw':_0x16fbd5[_0xb00b('0x13')]?_0x16fbd5['options'][_0xb00b('0x1d')]===undefined?!![]:![]:!![],'where':_0x16fbd5[_0xb00b('0x13')]?_0x16fbd5['options'][_0xb00b('0x1e')]||null:null,'attributes':_0x16fbd5[_0xb00b('0x13')]?_0x16fbd5['options'][_0xb00b('0x14')]||null:null,'include':_0x16fbd5['options']?_0x16fbd5[_0xb00b('0x13')][_0xb00b('0x16')]?_[_0xb00b('0x18')](_0x16fbd5[_0xb00b('0x13')][_0xb00b('0x16')],function(_0x1436ad){return{'model':db[_0x1436ad[_0xb00b('0x17')]],'as':_0x1436ad['as'],'attributes':_0x1436ad['attributes'],'include':_0x1436ad['include']?_['map'](_0x1436ad[_0xb00b('0x16')],function(_0xc21102){return{'model':db[_0xc21102[_0xb00b('0x17')]],'as':_0xc21102['as'],'attributes':_0xc21102[_0xb00b('0x14')],'include':_0xc21102['include']?_[_0xb00b('0x18')](_0xc21102[_0xb00b('0x16')],function(_0x341f46){return{'model':db[_0x341f46[_0xb00b('0x17')]],'as':_0x341f46['as'],'attributes':_0x341f46[_0xb00b('0x14')]};}):[]};}):[]};}):[]:[]})[_0xb00b('0x19')](function(_0x8785ec){logger[_0xb00b('0x9')]('ShowSalesforceAccount',_0x16fbd5);logger['debug'](_0xb00b('0x1b'),_0x16fbd5,JSON['stringify'](_0x8785ec));_0x303625(_0x8785ec);})[_0xb00b('0x11')](function(_0x1c5400){logger[_0xb00b('0xf')](_0xb00b('0x1b'),_0x1c5400[_0xb00b('0x10')],_0x16fbd5);_0x2b9824(_0x183233[_0xb00b('0xf')](0x1f4,_0x1c5400[_0xb00b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index ef82e81..02c8c19 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 _0x32aa=['get','/:id','show','/:id/subjects','getSubjects','create','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index'];(function(_0x203597,_0x16acd8){var _0x5ea0ce=function(_0x466105){while(--_0x466105){_0x203597['push'](_0x203597['shift']());}};_0x5ea0ce(++_0x16acd8);}(_0x32aa,0x127));var _0xa32a=function(_0x3ae516,_0x4b97c5){_0x3ae516=_0x3ae516-0x0;var _0x2b257a=_0x32aa[_0x3ae516];return _0x2b257a;};'use strict';var multer=require(_0xa32a('0x0'));var util=require(_0xa32a('0x1'));var path=require('path');var timeout=require(_0xa32a('0x2'));var express=require('express');var router=express[_0xa32a('0x3')]();var auth=require(_0xa32a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa32a('0x5'));var controller=require(_0xa32a('0x6'));router['get']('/',auth[_0xa32a('0x7')](),controller[_0xa32a('0x8')]);router[_0xa32a('0x9')](_0xa32a('0xa'),auth['isAuthenticated'](),controller[_0xa32a('0xb')]);router[_0xa32a('0x9')]('/:id/fields',auth[_0xa32a('0x7')](),controller['getFields']);router[_0xa32a('0x9')](_0xa32a('0xc'),auth[_0xa32a('0x7')](),controller[_0xa32a('0xd')]);router['get']('/:id/descriptions',auth[_0xa32a('0x7')](),controller['getDescriptions']);router['post']('/',auth[_0xa32a('0x7')](),controller[_0xa32a('0xe')]);router[_0xa32a('0xf')](_0xa32a('0xa'),auth['isAuthenticated'](),controller[_0xa32a('0x10')]);router[_0xa32a('0x11')](_0xa32a('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xa32a('0x12')]=router; \ No newline at end of file +var _0x15f1=['../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x9540b6,_0x23d466){var _0x289eba=function(_0x1f6d83){while(--_0x1f6d83){_0x9540b6['push'](_0x9540b6['shift']());}};_0x289eba(++_0x23d466);}(_0x15f1,0x1c6));var _0x115f=function(_0x39507c,_0x260989){_0x39507c=_0x39507c-0x0;var _0x312f97=_0x15f1[_0x39507c];return _0x312f97;};'use strict';var multer=require(_0x115f('0x0'));var util=require(_0x115f('0x1'));var path=require(_0x115f('0x2'));var timeout=require(_0x115f('0x3'));var express=require(_0x115f('0x4'));var router=express[_0x115f('0x5')]();var auth=require(_0x115f('0x6'));var interaction=require(_0x115f('0x7'));var config=require('../../config/environment');var controller=require(_0x115f('0x8'));router[_0x115f('0x9')]('/',auth[_0x115f('0xa')](),controller['index']);router['get'](_0x115f('0xb'),auth[_0x115f('0xa')](),controller[_0x115f('0xc')]);router[_0x115f('0x9')](_0x115f('0xd'),auth[_0x115f('0xa')](),controller[_0x115f('0xe')]);router[_0x115f('0x9')](_0x115f('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x115f('0x9')]('/:id/descriptions',auth[_0x115f('0xa')](),controller[_0x115f('0x10')]);router[_0x115f('0x11')]('/',auth[_0x115f('0xa')](),controller[_0x115f('0x12')]);router[_0x115f('0x13')](_0x115f('0xb'),auth['isAuthenticated'](),controller[_0x115f('0x14')]);router[_0x115f('0x15')]('/:id',auth[_0x115f('0xa')](),controller['destroy']);module[_0x115f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index be45802..889d677 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 _0x9551=['Task','contact_lead','contact','lead','nothing','sequelize','STRING','ENUM'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x9551,0x1cd));var _0x1955=function(_0x124c75,_0x332013){_0x124c75=_0x124c75-0x0;var _0x5c5471=_0x9551[_0x124c75];return _0x5c5471;};'use strict';var Sequelize=require(_0x1955('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1955('0x1')]},'ticketType':{'type':Sequelize[_0x1955('0x2')](_0x1955('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x1955('0x2')](_0x1955('0x4'),_0x1955('0x5'),_0x1955('0x6')),'defaultValue':_0x1955('0x4')},'moduleCreate':{'type':Sequelize[_0x1955('0x2')](_0x1955('0x7'),_0x1955('0x5'),_0x1955('0x6')),'defaultValue':_0x1955('0x6')}}; \ No newline at end of file +var _0xd9d4=['contact_lead','lead','contact','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd9d4,0x16b));var _0x4d9d=function(_0x28fbe3,_0x4ac6f8){_0x28fbe3=_0x28fbe3-0x0;var _0x45db6a=_0xd9d4[_0x28fbe3];return _0x45db6a;};'use strict';var Sequelize=require(_0x4d9d('0x0'));module[_0x4d9d('0x1')]={'name':{'type':Sequelize[_0x4d9d('0x2')]},'description':{'type':Sequelize[_0x4d9d('0x2')]},'ticketType':{'type':Sequelize[_0x4d9d('0x3')](_0x4d9d('0x4'),_0x4d9d('0x5')),'defaultValue':_0x4d9d('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x4d9d('0x6'),'contact',_0x4d9d('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x4d9d('0x8'),_0x4d9d('0x7')),'defaultValue':_0x4d9d('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e377e3d..ce892d0 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 _0x2cc1=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','show','keys','includeAll','options','find','create','body','params','SalesforceField','getFields','nolimit','getSubjects','findOne','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/environment','../../mysqldb','jayson/promise','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','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x19d3a2,_0x285f13){var _0x58dcb2=function(_0x58a669){while(--_0x58a669){_0x19d3a2['push'](_0x19d3a2['shift']());}};_0x58dcb2(++_0x285f13);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0x2cc1[_0x30a956];return _0x2ac17d;};'use strict';var pdf=require(_0x12cc('0x0'));var emlformat=require(_0x12cc('0x1'));var rimraf=require(_0x12cc('0x2'));var zipdir=require(_0x12cc('0x3'));var jsonpatch=require(_0x12cc('0x4'));var rp=require(_0x12cc('0x5'));var moment=require(_0x12cc('0x6'));var BPromise=require(_0x12cc('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x12cc('0x8'));var sox=require(_0x12cc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x12cc('0xa'));var squel=require(_0x12cc('0xb'));var crypto=require(_0x12cc('0xc'));var jsforce=require(_0x12cc('0xd'));var deskjs=require(_0x12cc('0xe'));var toCsv=require(_0x12cc('0xf'));var querystring=require(_0x12cc('0x10'));var Papa=require(_0x12cc('0x11'));var Redis=require(_0x12cc('0x12'));var authService=require(_0x12cc('0x13'));var qs=require(_0x12cc('0x14'));var as=require(_0x12cc('0x15'));var hardwareService=require(_0x12cc('0x16'));var logger=require('../../config/logger')(_0x12cc('0x17'));var utils=require('../../config/utils');var config=require(_0x12cc('0x18'));var db=require(_0x12cc('0x19'))['db'];var jayson=require(_0x12cc('0x1a'));var client=jayson[_0x12cc('0x1b')][_0x12cc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x7bf7fc,_0x5f3fb6,_0x5909d3){if(_0x5909d3){var _0x45e5aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45e5aa['test'](_0x5f3fb6)){return _0x7bf7fc;}else{throw new db[(_0x12cc('0x1d'))]['ValidationError'](_0x12cc('0x1e'));}}else{return _0x7bf7fc;}}function respondWithRpcPromise(_0xcc08c2,_0x3d9e6f,_0xc0a469,_0x10e22a){return new BPromise(function(_0x33753a,_0x511857){var _0x47fa45=_0x10e22a||client;return _0x47fa45[_0x12cc('0x1f')](_0xcc08c2,_0xc0a469)['then'](function(_0x16a709){logger[_0x12cc('0x20')](_0x12cc('0x21'),_0x3d9e6f,_0x12cc('0x22'));logger[_0x12cc('0x23')](_0x12cc('0x24'),_0x3d9e6f,_0x12cc('0x22'),JSON[_0x12cc('0x25')](_0x16a709));if(_0x16a709[_0x12cc('0x26')]){if(_0x16a709['error']['code']===0x1f4){logger['error'](_0x12cc('0x21'),_0x3d9e6f,_0x16a709[_0x12cc('0x26')][_0x12cc('0x27')]);return _0x511857(_0x16a709[_0x12cc('0x26')][_0x12cc('0x27')]);}logger[_0x12cc('0x26')](_0x12cc('0x21'),_0x3d9e6f,_0x16a709[_0x12cc('0x26')][_0x12cc('0x27')]);return _0x33753a(_0x16a709['error'][_0x12cc('0x27')]);}else{logger['info'](_0x12cc('0x21'),_0x3d9e6f,_0x12cc('0x22'));_0x33753a(_0x16a709[_0x12cc('0x28')][_0x12cc('0x27')]);}})[_0x12cc('0x29')](function(_0x5170ec){logger['error'](_0x12cc('0x21'),_0x3d9e6f,_0x5170ec);_0x511857(_0x5170ec);});});}function respondWithStatusCode(_0x5ab109,_0x3769b2){_0x3769b2=_0x3769b2||0xcc;return function(_0x11d4bc){if(_0x11d4bc){return _0x5ab109[_0x12cc('0x2a')](_0x3769b2);}return _0x5ab109[_0x12cc('0x2b')](_0x3769b2)[_0x12cc('0x2c')]();};}function respondWithResult(_0x281da6,_0x30439d){_0x30439d=_0x30439d||0xc8;return function(_0x17a66b){if(_0x17a66b){return _0x281da6[_0x12cc('0x2b')](_0x30439d)[_0x12cc('0x2d')](_0x17a66b);}};}function respondWithFilteredResult(_0x283977,_0x102654){return function(_0x420222){if(_0x420222){var _0x435a28=_0x420222[_0x12cc('0x2e')],_0x214f24=_0x102654[_0x12cc('0x2f')],_0x1c8bca=_0x102654[_0x12cc('0x2f')]+_0x102654[_0x12cc('0x30')],_0x5cb159;if(_0x1c8bca>=_0x435a28){_0x1c8bca=_0x435a28;_0x5cb159=0xc8;}else{_0x5cb159=0xce;}_0x283977[_0x12cc('0x2b')](_0x5cb159);return _0x283977[_0x12cc('0x31')](_0x12cc('0x32'),_0x214f24+'-'+_0x1c8bca+'/'+_0x435a28)['json'](_0x420222);}return null;};}function patchUpdates(_0x307f91){return function(_0x290586){try{jsonpatch[_0x12cc('0x33')](_0x290586,_0x307f91,!![]);}catch(_0xfdb7a3){return BPromise[_0x12cc('0x34')](_0xfdb7a3);}return _0x290586['save']();};}function saveUpdates(_0x312c38,_0x41e969){return function(_0x3f27be){if(_0x3f27be){return _0x3f27be[_0x12cc('0x35')](_0x312c38)[_0x12cc('0x36')](function(_0x32778c){return _0x32778c;});}return null;};}function removeEntity(_0x14b661,_0x30e694){return function(_0x3d72c8){if(_0x3d72c8){return _0x3d72c8[_0x12cc('0x37')]()[_0x12cc('0x36')](function(){_0x14b661[_0x12cc('0x2b')](0xcc)[_0x12cc('0x2c')]();});}};}function handleEntityNotFound(_0xeff133,_0x1f4b80){return function(_0x4c8b42){if(!_0x4c8b42){_0xeff133[_0x12cc('0x2a')](0x194);}return _0x4c8b42;};}function handleError(_0x70e25b,_0x310b96){_0x310b96=_0x310b96||0x1f4;return function(_0x1d51ea){logger[_0x12cc('0x26')](_0x1d51ea[_0x12cc('0x38')]);if(_0x1d51ea['name']){delete _0x1d51ea[_0x12cc('0x39')];}_0x70e25b[_0x12cc('0x2b')](_0x310b96)[_0x12cc('0x3a')](_0x1d51ea);};}exports['index']=function(_0x34bf5a,_0x30ddb9){var _0x1f6aba={},_0x46f6a3={},_0x158209={'count':0x0,'rows':[]};var _0x5e9cf4=_[_0x12cc('0x3b')](db[_0x12cc('0x3c')][_0x12cc('0x3d')],function(_0x1c17f8){return{'name':_0x1c17f8[_0x12cc('0x3e')],'type':_0x1c17f8[_0x12cc('0x3f')][_0x12cc('0x40')]};});_0x46f6a3[_0x12cc('0x41')]=_[_0x12cc('0x3b')](_0x5e9cf4,_0x12cc('0x39'));_0x46f6a3[_0x12cc('0x42')]=_['keys'](_0x34bf5a[_0x12cc('0x42')]);_0x46f6a3[_0x12cc('0x43')]=_[_0x12cc('0x44')](_0x46f6a3[_0x12cc('0x41')],_0x46f6a3[_0x12cc('0x42')]);_0x1f6aba['attributes']=_[_0x12cc('0x44')](_0x46f6a3['model'],qs[_0x12cc('0x45')](_0x34bf5a[_0x12cc('0x42')][_0x12cc('0x45')]));_0x1f6aba[_0x12cc('0x46')]=_0x1f6aba[_0x12cc('0x46')][_0x12cc('0x47')]?_0x1f6aba[_0x12cc('0x46')]:_0x46f6a3[_0x12cc('0x41')];if(!_0x34bf5a['query']['hasOwnProperty']('nolimit')){_0x1f6aba['limit']=qs[_0x12cc('0x30')](_0x34bf5a[_0x12cc('0x42')][_0x12cc('0x30')]);_0x1f6aba[_0x12cc('0x2f')]=qs[_0x12cc('0x2f')](_0x34bf5a[_0x12cc('0x42')][_0x12cc('0x2f')]);}_0x1f6aba[_0x12cc('0x48')]=qs[_0x12cc('0x49')](_0x34bf5a['query'][_0x12cc('0x49')]);_0x1f6aba[_0x12cc('0x4a')]=qs[_0x12cc('0x43')](_[_0x12cc('0x4b')](_0x34bf5a['query'],_0x46f6a3['filters']),_0x5e9cf4);if(_0x34bf5a[_0x12cc('0x42')][_0x12cc('0x4c')]){_0x1f6aba[_0x12cc('0x4a')]=_[_0x12cc('0x4d')](_0x1f6aba[_0x12cc('0x4a')],{'$or':_[_0x12cc('0x3b')](_0x5e9cf4,function(_0x123905){if(_0x123905[_0x12cc('0x3f')]!==_0x12cc('0x4e')){var _0x59269d={};_0x59269d[_0x123905[_0x12cc('0x39')]]={'$like':'%'+_0x34bf5a[_0x12cc('0x42')]['filter']+'%'};return _0x59269d;}})});}_0x1f6aba=_[_0x12cc('0x4d')]({},_0x1f6aba,_0x34bf5a['options']);var _0x370749={'where':_0x1f6aba[_0x12cc('0x4a')]};return db['SalesforceConfiguration'][_0x12cc('0x2e')](_0x370749)['then'](function(_0x133aac){_0x158209['count']=_0x133aac;if(_0x34bf5a[_0x12cc('0x42')]['includeAll']){_0x1f6aba[_0x12cc('0x4f')]=[{'all':!![]}];}return db[_0x12cc('0x3c')]['findAll'](_0x1f6aba);})[_0x12cc('0x36')](function(_0x8e888d){_0x158209[_0x12cc('0x50')]=_0x8e888d;return _0x158209;})[_0x12cc('0x36')](respondWithFilteredResult(_0x30ddb9,_0x1f6aba))[_0x12cc('0x29')](handleError(_0x30ddb9,null));};exports[_0x12cc('0x51')]=function(_0x16c44e,_0x426ec5){var _0x37baac={'raw':![],'where':{'id':_0x16c44e['params']['id']}},_0x2b3462={};_0x2b3462[_0x12cc('0x41')]=_['keys'](db[_0x12cc('0x3c')]['rawAttributes']);_0x2b3462[_0x12cc('0x42')]=_[_0x12cc('0x52')](_0x16c44e[_0x12cc('0x42')]);_0x2b3462[_0x12cc('0x43')]=_[_0x12cc('0x44')](_0x2b3462[_0x12cc('0x41')],_0x2b3462[_0x12cc('0x42')]);_0x37baac[_0x12cc('0x46')]=_[_0x12cc('0x44')](_0x2b3462[_0x12cc('0x41')],qs[_0x12cc('0x45')](_0x16c44e[_0x12cc('0x42')][_0x12cc('0x45')]));_0x37baac[_0x12cc('0x46')]=_0x37baac['attributes']['length']?_0x37baac[_0x12cc('0x46')]:_0x2b3462[_0x12cc('0x41')];if(_0x16c44e['query'][_0x12cc('0x53')]){_0x37baac[_0x12cc('0x4f')]=[{'all':!![]}];}_0x37baac=_[_0x12cc('0x4d')]({},_0x37baac,_0x16c44e[_0x12cc('0x54')]);return db[_0x12cc('0x3c')][_0x12cc('0x55')](_0x37baac)[_0x12cc('0x36')](handleEntityNotFound(_0x426ec5,null))[_0x12cc('0x36')](respondWithResult(_0x426ec5,null))[_0x12cc('0x29')](handleError(_0x426ec5,null));};exports[_0x12cc('0x56')]=function(_0xb651dd,_0x2740b2){return db[_0x12cc('0x3c')][_0x12cc('0x56')](_0xb651dd[_0x12cc('0x57')],{})[_0x12cc('0x36')](respondWithResult(_0x2740b2,0xc9))[_0x12cc('0x29')](handleError(_0x2740b2,null));};exports[_0x12cc('0x35')]=function(_0x592958,_0x202613){if(_0x592958[_0x12cc('0x57')]['id']){delete _0x592958[_0x12cc('0x57')]['id'];}return db[_0x12cc('0x3c')][_0x12cc('0x55')]({'where':{'id':_0x592958[_0x12cc('0x58')]['id']}})[_0x12cc('0x36')](handleEntityNotFound(_0x202613,null))[_0x12cc('0x36')](saveUpdates(_0x592958[_0x12cc('0x57')],null))[_0x12cc('0x36')](respondWithResult(_0x202613,null))[_0x12cc('0x29')](handleError(_0x202613,null));};exports['destroy']=function(_0x4af4b9,_0x504180){return db[_0x12cc('0x3c')][_0x12cc('0x55')]({'where':{'id':_0x4af4b9[_0x12cc('0x58')]['id']}})['then'](handleEntityNotFound(_0x504180,null))[_0x12cc('0x36')](removeEntity(_0x504180,null))[_0x12cc('0x29')](handleError(_0x504180,null));};exports['getFields']=function(_0x5abd95,_0x449e62,_0x280a71){var _0xa7fea6={};var _0x255ed9={};var _0x5bd031;var _0x547a19;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5abd95[_0x12cc('0x58')]['id']}})[_0x12cc('0x36')](handleEntityNotFound(_0x449e62,null))[_0x12cc('0x36')](function(_0x3520b7){if(_0x3520b7){_0x5bd031=_0x3520b7;_0x255ed9[_0x12cc('0x41')]=_[_0x12cc('0x52')](db[_0x12cc('0x59')][_0x12cc('0x3d')]);_0x255ed9[_0x12cc('0x42')]=_['keys'](_0x5abd95[_0x12cc('0x42')]);_0x255ed9[_0x12cc('0x43')]=_['intersection'](_0x255ed9[_0x12cc('0x41')],_0x255ed9[_0x12cc('0x42')]);_0xa7fea6[_0x12cc('0x46')]=_[_0x12cc('0x44')](_0x255ed9['model'],qs['fields'](_0x5abd95[_0x12cc('0x42')][_0x12cc('0x45')]));_0xa7fea6[_0x12cc('0x46')]=_0xa7fea6[_0x12cc('0x46')]['length']?_0xa7fea6['attributes']:_0x255ed9['model'];_0xa7fea6['order']=qs[_0x12cc('0x49')](_0x5abd95[_0x12cc('0x42')]['sort']);_0xa7fea6[_0x12cc('0x4a')]=qs[_0x12cc('0x43')](_[_0x12cc('0x4b')](_0x5abd95[_0x12cc('0x42')],_0x255ed9['filters']));if(_0x5abd95[_0x12cc('0x42')]['filter']){_0xa7fea6[_0x12cc('0x4a')]=_[_0x12cc('0x4d')](_0xa7fea6[_0x12cc('0x4a')],{'$or':_['map'](_0xa7fea6['attributes'],function(_0xeee115){var _0x52cfd9={};_0x52cfd9[_0xeee115]={'$like':'%'+_0x5abd95[_0x12cc('0x42')][_0x12cc('0x4c')]+'%'};return _0x52cfd9;})});}_0xa7fea6=_['merge']({},_0xa7fea6,_0x5abd95[_0x12cc('0x54')]);return _0x5bd031[_0x12cc('0x5a')](_0xa7fea6);}})[_0x12cc('0x36')](function(_0x52b9c0){if(_0x52b9c0){_0x547a19=_0x52b9c0[_0x12cc('0x47')];if(!_0x5abd95[_0x12cc('0x42')]['hasOwnProperty'](_0x12cc('0x5b'))){_0xa7fea6[_0x12cc('0x30')]=qs[_0x12cc('0x30')](_0x5abd95[_0x12cc('0x42')][_0x12cc('0x30')]);_0xa7fea6[_0x12cc('0x2f')]=qs[_0x12cc('0x2f')](_0x5abd95[_0x12cc('0x42')][_0x12cc('0x2f')]);}return _0x5bd031[_0x12cc('0x5a')](_0xa7fea6);}})['then'](function(_0x414966){if(_0x414966){return _0x414966?{'count':_0x547a19,'rows':_0x414966}:null;}})[_0x12cc('0x36')](respondWithResult(_0x449e62,null))[_0x12cc('0x29')](handleError(_0x449e62,null));};exports[_0x12cc('0x5c')]=function(_0x27d08d,_0x3f0b68,_0x12a187){var _0x301fb8={};var _0x54a876={};var _0x390ef9;var _0x2c4402;return db['SalesforceConfiguration'][_0x12cc('0x5d')]({'where':{'id':_0x27d08d[_0x12cc('0x58')]['id']}})[_0x12cc('0x36')](handleEntityNotFound(_0x3f0b68,null))['then'](function(_0x1492ae){if(_0x1492ae){_0x390ef9=_0x1492ae;_0x54a876[_0x12cc('0x41')]=_[_0x12cc('0x52')](db[_0x12cc('0x59')][_0x12cc('0x3d')]);_0x54a876['query']=_[_0x12cc('0x52')](_0x27d08d[_0x12cc('0x42')]);_0x54a876[_0x12cc('0x43')]=_[_0x12cc('0x44')](_0x54a876['model'],_0x54a876['query']);_0x301fb8[_0x12cc('0x46')]=_['intersection'](_0x54a876[_0x12cc('0x41')],qs['fields'](_0x27d08d['query'][_0x12cc('0x45')]));_0x301fb8['attributes']=_0x301fb8[_0x12cc('0x46')][_0x12cc('0x47')]?_0x301fb8[_0x12cc('0x46')]:_0x54a876[_0x12cc('0x41')];_0x301fb8[_0x12cc('0x48')]=qs[_0x12cc('0x49')](_0x27d08d[_0x12cc('0x42')][_0x12cc('0x49')]);_0x301fb8[_0x12cc('0x4a')]=qs[_0x12cc('0x43')](_[_0x12cc('0x4b')](_0x27d08d[_0x12cc('0x42')],_0x54a876[_0x12cc('0x43')]));if(_0x27d08d['query'][_0x12cc('0x4c')]){_0x301fb8['where']=_[_0x12cc('0x4d')](_0x301fb8[_0x12cc('0x4a')],{'$or':_[_0x12cc('0x3b')](_0x301fb8[_0x12cc('0x46')],function(_0x52df66){var _0xc150e1={};_0xc150e1[_0x52df66]={'$like':'%'+_0x27d08d[_0x12cc('0x42')][_0x12cc('0x4c')]+'%'};return _0xc150e1;})});}_0x301fb8=_['merge']({},_0x301fb8,_0x27d08d[_0x12cc('0x54')]);return _0x390ef9[_0x12cc('0x5c')](_0x301fb8);}})['then'](function(_0x2169dd){if(_0x2169dd){_0x2c4402=_0x2169dd[_0x12cc('0x47')];if(!_0x27d08d['query'][_0x12cc('0x5e')](_0x12cc('0x5b'))){_0x301fb8[_0x12cc('0x30')]=qs[_0x12cc('0x30')](_0x27d08d[_0x12cc('0x42')][_0x12cc('0x30')]);_0x301fb8[_0x12cc('0x2f')]=qs[_0x12cc('0x2f')](_0x27d08d[_0x12cc('0x42')]['offset']);}return _0x390ef9[_0x12cc('0x5c')](_0x301fb8);}})[_0x12cc('0x36')](function(_0x137ebd){if(_0x137ebd){return _0x137ebd?{'count':_0x2c4402,'rows':_0x137ebd}:null;}})['then'](respondWithResult(_0x3f0b68,null))['catch'](handleError(_0x3f0b68,null));};exports[_0x12cc('0x5f')]=function(_0xee4ab4,_0x4059cd,_0x51f36f){var _0x2570ed={};var _0x9b273e={};var _0xd29bd2;var _0xe1079b;return db[_0x12cc('0x3c')]['findOne']({'where':{'id':_0xee4ab4[_0x12cc('0x58')]['id']}})[_0x12cc('0x36')](handleEntityNotFound(_0x4059cd,null))['then'](function(_0x1630aa){if(_0x1630aa){_0xd29bd2=_0x1630aa;_0x9b273e[_0x12cc('0x41')]=_[_0x12cc('0x52')](db[_0x12cc('0x59')][_0x12cc('0x3d')]);_0x9b273e[_0x12cc('0x42')]=_['keys'](_0xee4ab4[_0x12cc('0x42')]);_0x9b273e[_0x12cc('0x43')]=_[_0x12cc('0x44')](_0x9b273e[_0x12cc('0x41')],_0x9b273e[_0x12cc('0x42')]);_0x2570ed[_0x12cc('0x46')]=_[_0x12cc('0x44')](_0x9b273e['model'],qs[_0x12cc('0x45')](_0xee4ab4['query'][_0x12cc('0x45')]));_0x2570ed[_0x12cc('0x46')]=_0x2570ed[_0x12cc('0x46')][_0x12cc('0x47')]?_0x2570ed[_0x12cc('0x46')]:_0x9b273e['model'];_0x2570ed[_0x12cc('0x48')]=qs[_0x12cc('0x49')](_0xee4ab4[_0x12cc('0x42')][_0x12cc('0x49')]);_0x2570ed[_0x12cc('0x4a')]=qs['filters'](_[_0x12cc('0x4b')](_0xee4ab4[_0x12cc('0x42')],_0x9b273e[_0x12cc('0x43')]));if(_0xee4ab4[_0x12cc('0x42')][_0x12cc('0x4c')]){_0x2570ed[_0x12cc('0x4a')]=_[_0x12cc('0x4d')](_0x2570ed[_0x12cc('0x4a')],{'$or':_[_0x12cc('0x3b')](_0x2570ed[_0x12cc('0x46')],function(_0x4b8671){var _0x2153f3={};_0x2153f3[_0x4b8671]={'$like':'%'+_0xee4ab4['query'][_0x12cc('0x4c')]+'%'};return _0x2153f3;})});}_0x2570ed=_[_0x12cc('0x4d')]({},_0x2570ed,_0xee4ab4['options']);return _0xd29bd2['getDescriptions'](_0x2570ed);}})[_0x12cc('0x36')](function(_0x31471b){if(_0x31471b){_0xe1079b=_0x31471b[_0x12cc('0x47')];if(!_0xee4ab4[_0x12cc('0x42')][_0x12cc('0x5e')]('nolimit')){_0x2570ed[_0x12cc('0x30')]=qs[_0x12cc('0x30')](_0xee4ab4[_0x12cc('0x42')][_0x12cc('0x30')]);_0x2570ed[_0x12cc('0x2f')]=qs[_0x12cc('0x2f')](_0xee4ab4[_0x12cc('0x42')][_0x12cc('0x2f')]);}return _0xd29bd2[_0x12cc('0x5f')](_0x2570ed);}})[_0x12cc('0x36')](function(_0x33b1d3){if(_0x33b1d3){return _0x33b1d3?{'count':_0xe1079b,'rows':_0x33b1d3}:null;}})[_0x12cc('0x36')](respondWithResult(_0x4059cd,null))[_0x12cc('0x29')](handleError(_0x4059cd,null));}; \ No newline at end of file +var _0xa482=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','options','find','create','body','getFields','findOne','SalesforceField','where','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa482,0x181));var _0x2a48=function(_0x14cd83,_0x64b65f){_0x14cd83=_0x14cd83-0x0;var _0x171f39=_0xa482[_0x14cd83];return _0x171f39;};'use strict';var pdf=require(_0x2a48('0x0'));var emlformat=require(_0x2a48('0x1'));var rimraf=require(_0x2a48('0x2'));var zipdir=require(_0x2a48('0x3'));var jsonpatch=require(_0x2a48('0x4'));var rp=require(_0x2a48('0x5'));var moment=require('moment');var BPromise=require(_0x2a48('0x6'));var Mustache=require(_0x2a48('0x7'));var util=require(_0x2a48('0x8'));var path=require(_0x2a48('0x9'));var sox=require(_0x2a48('0xa'));var csv=require(_0x2a48('0xb'));var ejs=require(_0x2a48('0xc'));var fs=require('fs');var _=require(_0x2a48('0xd'));var squel=require(_0x2a48('0xe'));var crypto=require(_0x2a48('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2a48('0x10'));var toCsv=require(_0x2a48('0xb'));var querystring=require('querystring');var Papa=require(_0x2a48('0x11'));var Redis=require(_0x2a48('0x12'));var authService=require(_0x2a48('0x13'));var qs=require(_0x2a48('0x14'));var as=require(_0x2a48('0x15'));var hardwareService=require(_0x2a48('0x16'));var logger=require(_0x2a48('0x17'))('api');var utils=require(_0x2a48('0x18'));var config=require(_0x2a48('0x19'));var db=require(_0x2a48('0x1a'))['db'];var jayson=require(_0x2a48('0x1b'));var client=jayson['client'][_0x2a48('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5a2972,_0x56ee1c,_0x413cf9){if(_0x413cf9){var _0x1739bb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1739bb[_0x2a48('0x1d')](_0x56ee1c)){return _0x5a2972;}else{throw new db[(_0x2a48('0x1e'))][(_0x2a48('0x1f'))](_0x2a48('0x20'));}}else{return _0x5a2972;}}function respondWithRpcPromise(_0x32b77a,_0x45e125,_0x20301d,_0x4ac4d7){return new BPromise(function(_0x5416dc,_0x22dfcc){var _0x3aa358=_0x4ac4d7||client;return _0x3aa358[_0x2a48('0x21')](_0x32b77a,_0x20301d)[_0x2a48('0x22')](function(_0x57b662){logger[_0x2a48('0x23')](_0x2a48('0x24'),_0x45e125,_0x2a48('0x25'));logger[_0x2a48('0x26')](_0x2a48('0x27'),_0x45e125,'request\x20sent',JSON[_0x2a48('0x28')](_0x57b662));if(_0x57b662[_0x2a48('0x29')]){if(_0x57b662[_0x2a48('0x29')][_0x2a48('0x2a')]===0x1f4){logger[_0x2a48('0x29')](_0x2a48('0x24'),_0x45e125,_0x57b662['error'][_0x2a48('0x2b')]);return _0x22dfcc(_0x57b662[_0x2a48('0x29')][_0x2a48('0x2b')]);}logger[_0x2a48('0x29')](_0x2a48('0x24'),_0x45e125,_0x57b662['error']['message']);return _0x5416dc(_0x57b662[_0x2a48('0x29')]['message']);}else{logger[_0x2a48('0x23')](_0x2a48('0x24'),_0x45e125,_0x2a48('0x25'));_0x5416dc(_0x57b662[_0x2a48('0x2c')]['message']);}})[_0x2a48('0x2d')](function(_0xa3c05){logger[_0x2a48('0x29')]('SalesforceConfiguration,\x20%s,\x20%s',_0x45e125,_0xa3c05);_0x22dfcc(_0xa3c05);});});}function respondWithStatusCode(_0x4207d4,_0x33a77c){_0x33a77c=_0x33a77c||0xcc;return function(_0x55a735){if(_0x55a735){return _0x4207d4[_0x2a48('0x2e')](_0x33a77c);}return _0x4207d4['status'](_0x33a77c)['end']();};}function respondWithResult(_0x15549e,_0x5cb5ee){_0x5cb5ee=_0x5cb5ee||0xc8;return function(_0xe59d24){if(_0xe59d24){return _0x15549e[_0x2a48('0x2f')](_0x5cb5ee)[_0x2a48('0x30')](_0xe59d24);}};}function respondWithFilteredResult(_0x546c33,_0x5a1250){return function(_0x11f03d){if(_0x11f03d){var _0x4d8889=_0x11f03d[_0x2a48('0x31')],_0x415499=_0x5a1250[_0x2a48('0x32')],_0x5f12fe=_0x5a1250[_0x2a48('0x32')]+_0x5a1250['limit'],_0x152b2d;if(_0x5f12fe>=_0x4d8889){_0x5f12fe=_0x4d8889;_0x152b2d=0xc8;}else{_0x152b2d=0xce;}_0x546c33[_0x2a48('0x2f')](_0x152b2d);return _0x546c33[_0x2a48('0x33')](_0x2a48('0x34'),_0x415499+'-'+_0x5f12fe+'/'+_0x4d8889)[_0x2a48('0x30')](_0x11f03d);}return null;};}function patchUpdates(_0x1eaad2){return function(_0x592e04){try{jsonpatch[_0x2a48('0x35')](_0x592e04,_0x1eaad2,!![]);}catch(_0x339eed){return BPromise[_0x2a48('0x36')](_0x339eed);}return _0x592e04[_0x2a48('0x37')]();};}function saveUpdates(_0x278640,_0x163801){return function(_0x41c592){if(_0x41c592){return _0x41c592[_0x2a48('0x38')](_0x278640)['then'](function(_0x4745fd){return _0x4745fd;});}return null;};}function removeEntity(_0x22a090,_0x57910e){return function(_0x4680ab){if(_0x4680ab){return _0x4680ab[_0x2a48('0x39')]()[_0x2a48('0x22')](function(){_0x22a090[_0x2a48('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x261a80,_0x26fa5c){return function(_0x353b0b){if(!_0x353b0b){_0x261a80[_0x2a48('0x2e')](0x194);}return _0x353b0b;};}function handleError(_0x22d42c,_0x28733c){_0x28733c=_0x28733c||0x1f4;return function(_0x2c5749){logger['error'](_0x2c5749[_0x2a48('0x3a')]);if(_0x2c5749[_0x2a48('0x3b')]){delete _0x2c5749['name'];}_0x22d42c['status'](_0x28733c)[_0x2a48('0x3c')](_0x2c5749);};}exports[_0x2a48('0x3d')]=function(_0x4767d0,_0x3ce308){var _0x33069f={},_0x46c08a={},_0x4da3d5={'count':0x0,'rows':[]};var _0x41bad1=_[_0x2a48('0x3e')](db[_0x2a48('0x3f')][_0x2a48('0x40')],function(_0x59b23e){return{'name':_0x59b23e[_0x2a48('0x41')],'type':_0x59b23e['type'][_0x2a48('0x42')]};});_0x46c08a[_0x2a48('0x43')]=_[_0x2a48('0x3e')](_0x41bad1,_0x2a48('0x3b'));_0x46c08a[_0x2a48('0x44')]=_[_0x2a48('0x45')](_0x4767d0['query']);_0x46c08a[_0x2a48('0x46')]=_[_0x2a48('0x47')](_0x46c08a['model'],_0x46c08a[_0x2a48('0x44')]);_0x33069f['attributes']=_[_0x2a48('0x47')](_0x46c08a[_0x2a48('0x43')],qs['fields'](_0x4767d0['query'][_0x2a48('0x48')]));_0x33069f[_0x2a48('0x49')]=_0x33069f[_0x2a48('0x49')][_0x2a48('0x4a')]?_0x33069f['attributes']:_0x46c08a[_0x2a48('0x43')];if(!_0x4767d0['query'][_0x2a48('0x4b')](_0x2a48('0x4c'))){_0x33069f['limit']=qs[_0x2a48('0x4d')](_0x4767d0[_0x2a48('0x44')][_0x2a48('0x4d')]);_0x33069f['offset']=qs[_0x2a48('0x32')](_0x4767d0['query'][_0x2a48('0x32')]);}_0x33069f[_0x2a48('0x4e')]=qs['sort'](_0x4767d0[_0x2a48('0x44')][_0x2a48('0x4f')]);_0x33069f['where']=qs[_0x2a48('0x46')](_[_0x2a48('0x50')](_0x4767d0[_0x2a48('0x44')],_0x46c08a[_0x2a48('0x46')]),_0x41bad1);if(_0x4767d0[_0x2a48('0x44')][_0x2a48('0x51')]){_0x33069f['where']=_[_0x2a48('0x52')](_0x33069f['where'],{'$or':_['map'](_0x41bad1,function(_0x1e5fd9){if(_0x1e5fd9[_0x2a48('0x53')]!==_0x2a48('0x54')){var _0x55a965={};_0x55a965[_0x1e5fd9[_0x2a48('0x3b')]]={'$like':'%'+_0x4767d0[_0x2a48('0x44')][_0x2a48('0x51')]+'%'};return _0x55a965;}})});}_0x33069f=_[_0x2a48('0x52')]({},_0x33069f,_0x4767d0['options']);var _0x1d8210={'where':_0x33069f['where']};return db['SalesforceConfiguration']['count'](_0x1d8210)['then'](function(_0x129847){_0x4da3d5[_0x2a48('0x31')]=_0x129847;if(_0x4767d0['query'][_0x2a48('0x55')]){_0x33069f[_0x2a48('0x56')]=[{'all':!![]}];}return db[_0x2a48('0x3f')]['findAll'](_0x33069f);})[_0x2a48('0x22')](function(_0x5a5d30){_0x4da3d5[_0x2a48('0x57')]=_0x5a5d30;return _0x4da3d5;})[_0x2a48('0x22')](respondWithFilteredResult(_0x3ce308,_0x33069f))[_0x2a48('0x2d')](handleError(_0x3ce308,null));};exports[_0x2a48('0x58')]=function(_0x5de5fb,_0x1e8987){var _0x1c74ab={'raw':![],'where':{'id':_0x5de5fb[_0x2a48('0x59')]['id']}},_0xeedd08={};_0xeedd08[_0x2a48('0x43')]=_[_0x2a48('0x45')](db[_0x2a48('0x3f')]['rawAttributes']);_0xeedd08['query']=_[_0x2a48('0x45')](_0x5de5fb[_0x2a48('0x44')]);_0xeedd08[_0x2a48('0x46')]=_[_0x2a48('0x47')](_0xeedd08[_0x2a48('0x43')],_0xeedd08[_0x2a48('0x44')]);_0x1c74ab[_0x2a48('0x49')]=_[_0x2a48('0x47')](_0xeedd08['model'],qs[_0x2a48('0x48')](_0x5de5fb['query'][_0x2a48('0x48')]));_0x1c74ab[_0x2a48('0x49')]=_0x1c74ab[_0x2a48('0x49')][_0x2a48('0x4a')]?_0x1c74ab[_0x2a48('0x49')]:_0xeedd08[_0x2a48('0x43')];if(_0x5de5fb[_0x2a48('0x44')][_0x2a48('0x55')]){_0x1c74ab[_0x2a48('0x56')]=[{'all':!![]}];}_0x1c74ab=_[_0x2a48('0x52')]({},_0x1c74ab,_0x5de5fb[_0x2a48('0x5a')]);return db[_0x2a48('0x3f')][_0x2a48('0x5b')](_0x1c74ab)[_0x2a48('0x22')](handleEntityNotFound(_0x1e8987,null))[_0x2a48('0x22')](respondWithResult(_0x1e8987,null))[_0x2a48('0x2d')](handleError(_0x1e8987,null));};exports[_0x2a48('0x5c')]=function(_0x285380,_0xdaf4c5){return db['SalesforceConfiguration'][_0x2a48('0x5c')](_0x285380['body'],{})[_0x2a48('0x22')](respondWithResult(_0xdaf4c5,0xc9))[_0x2a48('0x2d')](handleError(_0xdaf4c5,null));};exports[_0x2a48('0x38')]=function(_0x227718,_0x4b9893){if(_0x227718[_0x2a48('0x5d')]['id']){delete _0x227718[_0x2a48('0x5d')]['id'];}return db[_0x2a48('0x3f')][_0x2a48('0x5b')]({'where':{'id':_0x227718['params']['id']}})['then'](handleEntityNotFound(_0x4b9893,null))['then'](saveUpdates(_0x227718[_0x2a48('0x5d')],null))[_0x2a48('0x22')](respondWithResult(_0x4b9893,null))[_0x2a48('0x2d')](handleError(_0x4b9893,null));};exports['destroy']=function(_0x2e9591,_0x3af753){return db['SalesforceConfiguration']['find']({'where':{'id':_0x2e9591['params']['id']}})['then'](handleEntityNotFound(_0x3af753,null))[_0x2a48('0x22')](removeEntity(_0x3af753,null))[_0x2a48('0x2d')](handleError(_0x3af753,null));};exports[_0x2a48('0x5e')]=function(_0x2a32be,_0x4ad1fa,_0x656ea6){var _0x5b634d={};var _0x4e89c1={};var _0xb82f28;var _0x3c191a;return db[_0x2a48('0x3f')][_0x2a48('0x5f')]({'where':{'id':_0x2a32be[_0x2a48('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ad1fa,null))['then'](function(_0x2d5307){if(_0x2d5307){_0xb82f28=_0x2d5307;_0x4e89c1['model']=_[_0x2a48('0x45')](db[_0x2a48('0x60')][_0x2a48('0x40')]);_0x4e89c1[_0x2a48('0x44')]=_[_0x2a48('0x45')](_0x2a32be[_0x2a48('0x44')]);_0x4e89c1[_0x2a48('0x46')]=_[_0x2a48('0x47')](_0x4e89c1[_0x2a48('0x43')],_0x4e89c1[_0x2a48('0x44')]);_0x5b634d[_0x2a48('0x49')]=_[_0x2a48('0x47')](_0x4e89c1[_0x2a48('0x43')],qs[_0x2a48('0x48')](_0x2a32be['query'][_0x2a48('0x48')]));_0x5b634d['attributes']=_0x5b634d[_0x2a48('0x49')]['length']?_0x5b634d[_0x2a48('0x49')]:_0x4e89c1[_0x2a48('0x43')];_0x5b634d[_0x2a48('0x4e')]=qs[_0x2a48('0x4f')](_0x2a32be[_0x2a48('0x44')]['sort']);_0x5b634d[_0x2a48('0x61')]=qs['filters'](_[_0x2a48('0x50')](_0x2a32be[_0x2a48('0x44')],_0x4e89c1[_0x2a48('0x46')]));if(_0x2a32be[_0x2a48('0x44')][_0x2a48('0x51')]){_0x5b634d[_0x2a48('0x61')]=_[_0x2a48('0x52')](_0x5b634d[_0x2a48('0x61')],{'$or':_['map'](_0x5b634d[_0x2a48('0x49')],function(_0x5f3022){var _0x150a01={};_0x150a01[_0x5f3022]={'$like':'%'+_0x2a32be[_0x2a48('0x44')][_0x2a48('0x51')]+'%'};return _0x150a01;})});}_0x5b634d=_['merge']({},_0x5b634d,_0x2a32be[_0x2a48('0x5a')]);return _0xb82f28['getFields'](_0x5b634d);}})[_0x2a48('0x22')](function(_0x3fbbf5){if(_0x3fbbf5){_0x3c191a=_0x3fbbf5[_0x2a48('0x4a')];if(!_0x2a32be[_0x2a48('0x44')]['hasOwnProperty'](_0x2a48('0x4c'))){_0x5b634d[_0x2a48('0x4d')]=qs[_0x2a48('0x4d')](_0x2a32be[_0x2a48('0x44')][_0x2a48('0x4d')]);_0x5b634d[_0x2a48('0x32')]=qs[_0x2a48('0x32')](_0x2a32be[_0x2a48('0x44')]['offset']);}return _0xb82f28[_0x2a48('0x5e')](_0x5b634d);}})[_0x2a48('0x22')](function(_0x4bba8c){if(_0x4bba8c){return _0x4bba8c?{'count':_0x3c191a,'rows':_0x4bba8c}:null;}})[_0x2a48('0x22')](respondWithResult(_0x4ad1fa,null))[_0x2a48('0x2d')](handleError(_0x4ad1fa,null));};exports[_0x2a48('0x62')]=function(_0x1d9ec8,_0x20eaa4,_0x10bf2c){var _0x2bcf14={};var _0x3d6839={};var _0x58f8fb;var _0x356c31;return db[_0x2a48('0x3f')][_0x2a48('0x5f')]({'where':{'id':_0x1d9ec8[_0x2a48('0x59')]['id']}})[_0x2a48('0x22')](handleEntityNotFound(_0x20eaa4,null))[_0x2a48('0x22')](function(_0x197818){if(_0x197818){_0x58f8fb=_0x197818;_0x3d6839[_0x2a48('0x43')]=_[_0x2a48('0x45')](db[_0x2a48('0x60')][_0x2a48('0x40')]);_0x3d6839[_0x2a48('0x44')]=_['keys'](_0x1d9ec8[_0x2a48('0x44')]);_0x3d6839[_0x2a48('0x46')]=_['intersection'](_0x3d6839[_0x2a48('0x43')],_0x3d6839['query']);_0x2bcf14[_0x2a48('0x49')]=_['intersection'](_0x3d6839['model'],qs[_0x2a48('0x48')](_0x1d9ec8['query'][_0x2a48('0x48')]));_0x2bcf14[_0x2a48('0x49')]=_0x2bcf14['attributes'][_0x2a48('0x4a')]?_0x2bcf14['attributes']:_0x3d6839['model'];_0x2bcf14[_0x2a48('0x4e')]=qs[_0x2a48('0x4f')](_0x1d9ec8[_0x2a48('0x44')][_0x2a48('0x4f')]);_0x2bcf14[_0x2a48('0x61')]=qs[_0x2a48('0x46')](_[_0x2a48('0x50')](_0x1d9ec8[_0x2a48('0x44')],_0x3d6839[_0x2a48('0x46')]));if(_0x1d9ec8['query'][_0x2a48('0x51')]){_0x2bcf14[_0x2a48('0x61')]=_['merge'](_0x2bcf14[_0x2a48('0x61')],{'$or':_['map'](_0x2bcf14['attributes'],function(_0x3ea9d0){var _0x4d4403={};_0x4d4403[_0x3ea9d0]={'$like':'%'+_0x1d9ec8[_0x2a48('0x44')]['filter']+'%'};return _0x4d4403;})});}_0x2bcf14=_[_0x2a48('0x52')]({},_0x2bcf14,_0x1d9ec8[_0x2a48('0x5a')]);return _0x58f8fb[_0x2a48('0x62')](_0x2bcf14);}})[_0x2a48('0x22')](function(_0x37aa4f){if(_0x37aa4f){_0x356c31=_0x37aa4f[_0x2a48('0x4a')];if(!_0x1d9ec8[_0x2a48('0x44')][_0x2a48('0x4b')](_0x2a48('0x4c'))){_0x2bcf14[_0x2a48('0x4d')]=qs['limit'](_0x1d9ec8['query'][_0x2a48('0x4d')]);_0x2bcf14['offset']=qs[_0x2a48('0x32')](_0x1d9ec8[_0x2a48('0x44')][_0x2a48('0x32')]);}return _0x58f8fb[_0x2a48('0x62')](_0x2bcf14);}})[_0x2a48('0x22')](function(_0xf05160){if(_0xf05160){return _0xf05160?{'count':_0x356c31,'rows':_0xf05160}:null;}})[_0x2a48('0x22')](respondWithResult(_0x20eaa4,null))[_0x2a48('0x2d')](handleError(_0x20eaa4,null));};exports['getDescriptions']=function(_0x183bfe,_0x320234,_0xda80ea){var _0x59a027={};var _0x5d1cc1={};var _0x59c7fe;var _0x443a6a;return db[_0x2a48('0x3f')][_0x2a48('0x5f')]({'where':{'id':_0x183bfe[_0x2a48('0x59')]['id']}})[_0x2a48('0x22')](handleEntityNotFound(_0x320234,null))[_0x2a48('0x22')](function(_0x5afda0){if(_0x5afda0){_0x59c7fe=_0x5afda0;_0x5d1cc1['model']=_[_0x2a48('0x45')](db[_0x2a48('0x60')][_0x2a48('0x40')]);_0x5d1cc1[_0x2a48('0x44')]=_[_0x2a48('0x45')](_0x183bfe[_0x2a48('0x44')]);_0x5d1cc1[_0x2a48('0x46')]=_[_0x2a48('0x47')](_0x5d1cc1[_0x2a48('0x43')],_0x5d1cc1[_0x2a48('0x44')]);_0x59a027[_0x2a48('0x49')]=_['intersection'](_0x5d1cc1[_0x2a48('0x43')],qs[_0x2a48('0x48')](_0x183bfe[_0x2a48('0x44')][_0x2a48('0x48')]));_0x59a027[_0x2a48('0x49')]=_0x59a027['attributes']['length']?_0x59a027[_0x2a48('0x49')]:_0x5d1cc1[_0x2a48('0x43')];_0x59a027['order']=qs[_0x2a48('0x4f')](_0x183bfe['query']['sort']);_0x59a027[_0x2a48('0x61')]=qs['filters'](_[_0x2a48('0x50')](_0x183bfe[_0x2a48('0x44')],_0x5d1cc1['filters']));if(_0x183bfe[_0x2a48('0x44')][_0x2a48('0x51')]){_0x59a027[_0x2a48('0x61')]=_[_0x2a48('0x52')](_0x59a027[_0x2a48('0x61')],{'$or':_[_0x2a48('0x3e')](_0x59a027[_0x2a48('0x49')],function(_0x5d37d1){var _0x147ad7={};_0x147ad7[_0x5d37d1]={'$like':'%'+_0x183bfe[_0x2a48('0x44')][_0x2a48('0x51')]+'%'};return _0x147ad7;})});}_0x59a027=_[_0x2a48('0x52')]({},_0x59a027,_0x183bfe[_0x2a48('0x5a')]);return _0x59c7fe['getDescriptions'](_0x59a027);}})[_0x2a48('0x22')](function(_0x18cbb0){if(_0x18cbb0){_0x443a6a=_0x18cbb0['length'];if(!_0x183bfe[_0x2a48('0x44')][_0x2a48('0x4b')]('nolimit')){_0x59a027['limit']=qs[_0x2a48('0x4d')](_0x183bfe[_0x2a48('0x44')][_0x2a48('0x4d')]);_0x59a027['offset']=qs['offset'](_0x183bfe[_0x2a48('0x44')][_0x2a48('0x32')]);}return _0x59c7fe[_0x2a48('0x63')](_0x59a027);}})[_0x2a48('0x22')](function(_0xf8c867){if(_0xf8c867){return _0xf8c867?{'count':_0x443a6a,'rows':_0xf8c867}:null;}})[_0x2a48('0x22')](respondWithResult(_0x320234,null))[_0x2a48('0x2d')](handleError(_0x320234,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 16ce7fa..794987a 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 _0x6b1e=['path','rimraf','../../config/environment','SalesforceConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1c6873,_0x96f1aa){var _0x31dac9=function(_0x33f51c){while(--_0x33f51c){_0x1c6873['push'](_0x1c6873['shift']());}};_0x31dac9(++_0x96f1aa);}(_0x6b1e,0x162));var _0xe6b1=function(_0x475839,_0x226b5e){_0x475839=_0x475839-0x0;var _0x449022=_0x6b1e[_0x475839];return _0x449022;};'use strict';var _=require(_0xe6b1('0x0'));var util=require(_0xe6b1('0x1'));var logger=require(_0xe6b1('0x2'))('api');var moment=require(_0xe6b1('0x3'));var BPromise=require(_0xe6b1('0x4'));var rp=require(_0xe6b1('0x5'));var fs=require('fs');var path=require(_0xe6b1('0x6'));var rimraf=require(_0xe6b1('0x7'));var config=require(_0xe6b1('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x296c91,_0x3747d9){return _0x296c91['define'](_0xe6b1('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7799=['define','SalesforceConfiguration','lodash','util','../../config/logger','api','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0xb27f0d,_0x2a387b){var _0x17b400=function(_0x3e4d40){while(--_0x3e4d40){_0xb27f0d['push'](_0xb27f0d['shift']());}};_0x17b400(++_0x2a387b);}(_0x7799,0x17e));var _0x9779=function(_0x14674d,_0x88c7ff){_0x14674d=_0x14674d-0x0;var _0x556c64=_0x7799[_0x14674d];return _0x556c64;};'use strict';var _=require(_0x9779('0x0'));var util=require(_0x9779('0x1'));var logger=require(_0x9779('0x2'))(_0x9779('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9779('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9779('0x5'));var config=require('../../config/environment');var attributes=require(_0x9779('0x6'));module[_0x9779('0x7')]=function(_0xf0a292,_0x2274b6){return _0xf0a292[_0x9779('0x8')](_0x9779('0x9'),attributes,{'tableName':'int_salesforce_configurations','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 172cce1..f0f82c7 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 _0x5e8a=['info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/environment','client','http','request','then'];(function(_0x50e07,_0x1879a7){var _0x2ac2db=function(_0x17c30c){while(--_0x17c30c){_0x50e07['push'](_0x50e07['shift']());}};_0x2ac2db(++_0x1879a7);}(_0x5e8a,0xe5));var _0xa5e8=function(_0xd150a1,_0x2ae22d){_0xd150a1=_0xd150a1-0x0;var _0x275488=_0x5e8a[_0xd150a1];return _0x275488;};'use strict';var _=require(_0xa5e8('0x0'));var util=require('util');var moment=require(_0xa5e8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5e8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5e8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5e8('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xa5e8('0x5')][_0xa5e8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4b01ed,_0xb537df,_0x3473b3){return new BPromise(function(_0x341d9e,_0x456a8d){return client[_0xa5e8('0x7')](_0x4b01ed,_0x3473b3)[_0xa5e8('0x8')](function(_0x307324){logger[_0xa5e8('0x9')](_0xa5e8('0xa'),_0xb537df,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xb537df,_0xa5e8('0xb'),JSON['stringify'](_0x307324));if(_0x307324[_0xa5e8('0xc')]){if(_0x307324[_0xa5e8('0xc')][_0xa5e8('0xd')]===0x1f4){logger[_0xa5e8('0xc')](_0xa5e8('0xa'),_0xb537df,_0x307324[_0xa5e8('0xc')][_0xa5e8('0xe')]);return _0x456a8d(_0x307324[_0xa5e8('0xc')][_0xa5e8('0xe')]);}logger[_0xa5e8('0xc')](_0xa5e8('0xa'),_0xb537df,_0x307324[_0xa5e8('0xc')][_0xa5e8('0xe')]);return _0x341d9e(_0x307324['error'][_0xa5e8('0xe')]);}else{logger[_0xa5e8('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0xb537df,_0xa5e8('0xb'));_0x341d9e(_0x307324[_0xa5e8('0xf')]['message']);}})[_0xa5e8('0x10')](function(_0x611c7c){logger[_0xa5e8('0xc')](_0xa5e8('0xa'),_0xb537df,_0x611c7c);_0x456a8d(_0x611c7c);});});} \ No newline at end of file +var _0x52d9=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x3e8c4c,_0x271745){var _0x3ad976=function(_0x21b8e2){while(--_0x21b8e2){_0x3e8c4c['push'](_0x3e8c4c['shift']());}};_0x3ad976(++_0x271745);}(_0x52d9,0x17a));var _0x952d=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0x52d9[_0x2649e2];return _0x4797d4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x952d('0x0'));var BPromise=require(_0x952d('0x1'));var rs=require(_0x952d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x952d('0x3'));var logger=require(_0x952d('0x4'))(_0x952d('0x5'));var config=require(_0x952d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x952d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40b745,_0x3773f9,_0x70a6c5){return new BPromise(function(_0x227d6a,_0x2c3ad0){return client[_0x952d('0x8')](_0x40b745,_0x70a6c5)['then'](function(_0x4019f8){logger[_0x952d('0x9')](_0x952d('0xa'),_0x3773f9,_0x952d('0xb'));logger[_0x952d('0xc')](_0x952d('0xd'),_0x3773f9,'request\x20sent',JSON[_0x952d('0xe')](_0x4019f8));if(_0x4019f8[_0x952d('0xf')]){if(_0x4019f8[_0x952d('0xf')]['code']===0x1f4){logger[_0x952d('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3773f9,_0x4019f8['error'][_0x952d('0x10')]);return _0x2c3ad0(_0x4019f8[_0x952d('0xf')][_0x952d('0x10')]);}logger[_0x952d('0xf')](_0x952d('0xa'),_0x3773f9,_0x4019f8[_0x952d('0xf')]['message']);return _0x227d6a(_0x4019f8[_0x952d('0xf')][_0x952d('0x10')]);}else{logger[_0x952d('0x9')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3773f9,_0x952d('0xb'));_0x227d6a(_0x4019f8['result']['message']);}})[_0x952d('0x11')](function(_0x380767){logger[_0x952d('0xf')](_0x952d('0xa'),_0x3773f9,_0x380767);_0x2c3ad0(_0x380767);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index c09a01b..60be0fa 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 _0x81c6=['index','/:id','create','put','update','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x2adfb1,_0x406e6e){var _0xa52d45=function(_0x2de16c){while(--_0x2de16c){_0x2adfb1['push'](_0x2adfb1['shift']());}};_0xa52d45(++_0x406e6e);}(_0x81c6,0x1d5));var _0x681c=function(_0x2f6799,_0x4e7f00){_0x2f6799=_0x2f6799-0x0;var _0x3cb26f=_0x81c6[_0x2f6799];return _0x3cb26f;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var auth=require(_0x681c('0x2'));var interaction=require(_0x681c('0x3'));var config=require('../../config/environment');var controller=require(_0x681c('0x4'));router[_0x681c('0x5')]('/',auth[_0x681c('0x6')](),controller[_0x681c('0x7')]);router['get'](_0x681c('0x8'),auth[_0x681c('0x6')](),controller['show']);router['post']('/',auth[_0x681c('0x6')](),controller[_0x681c('0x9')]);router[_0x681c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x681c('0xb')]);router['delete'](_0x681c('0x8'),auth[_0x681c('0x6')](),controller[_0x681c('0xc')]);module[_0x681c('0xd')]=router; \ No newline at end of file +var _0xcd59=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x1faf34,_0x5a96e7){var _0x294624=function(_0x9679ec){while(--_0x9679ec){_0x1faf34['push'](_0x1faf34['shift']());}};_0x294624(++_0x5a96e7);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4c74f4,_0x2f93c4){_0x4c74f4=_0x4c74f4-0x0;var _0x5aaee1=_0xcd59[_0x4c74f4];return _0x5aaee1;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9cd5('0x6'));var config=require(_0x9cd5('0x7'));var controller=require(_0x9cd5('0x8'));router[_0x9cd5('0x9')]('/',auth[_0x9cd5('0xa')](),controller[_0x9cd5('0xb')]);router[_0x9cd5('0x9')](_0x9cd5('0xc'),auth[_0x9cd5('0xa')](),controller[_0x9cd5('0xd')]);router['post']('/',auth[_0x9cd5('0xa')](),controller[_0x9cd5('0xe')]);router[_0x9cd5('0xf')](_0x9cd5('0xc'),auth[_0x9cd5('0xa')](),controller[_0x9cd5('0x10')]);router[_0x9cd5('0x11')](_0x9cd5('0xc'),auth['isAuthenticated'](),controller[_0x9cd5('0x12')]);module[_0x9cd5('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1c6f66b..1f6c384 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 _0xdcbf=['ENUM','string','variable','customVariable','STRING','sequelize','exports'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xdcbf,0x6e));var _0xfdcb=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdcbf[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xfdcb('0x0'));module[_0xfdcb('0x1')]={'type':{'type':Sequelize[_0xfdcb('0x2')](_0xfdcb('0x3'),'variable','customVariable','keyValue'),'defaultValue':_0xfdcb('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xfdcb('0x3'),_0xfdcb('0x4'),_0xfdcb('0x5'))},'keyContent':{'type':Sequelize[_0xfdcb('0x6')]},'idField':{'type':Sequelize[_0xfdcb('0x6')]},'variableName':{'type':Sequelize[_0xfdcb('0x6')]}}; \ No newline at end of file +var _0xf090=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x302e77,_0x10b50a){var _0x5283f3=function(_0x34ecc3){while(--_0x34ecc3){_0x302e77['push'](_0x302e77['shift']());}};_0x5283f3(++_0x10b50a);}(_0xf090,0xf9));var _0x0f09=function(_0x5c5135,_0x3af41e){_0x5c5135=_0x5c5135-0x0;var _0x2f50d7=_0xf090[_0x5c5135];return _0x2f50d7;};'use strict';var Sequelize=require(_0x0f09('0x0'));module[_0x0f09('0x1')]={'type':{'type':Sequelize[_0x0f09('0x2')](_0x0f09('0x3'),_0x0f09('0x4'),'customVariable',_0x0f09('0x5')),'defaultValue':_0x0f09('0x3')},'content':{'type':Sequelize[_0x0f09('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0f09('0x2')](_0x0f09('0x3'),_0x0f09('0x4'),_0x0f09('0x7'))},'keyContent':{'type':Sequelize[_0x0f09('0x6')]},'idField':{'type':Sequelize[_0x0f09('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 2c1ca8c..29bd310 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 _0xc3c9=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','SalesforceField','rawAttributes','length','options','find','create','body','catch','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','update','then','destroy','end','stack','name','send','index','fieldName','type','key','model','map'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc3c9,0x1c6));var _0x9c3c=function(_0x1e63f1,_0xe3c3cc){_0x1e63f1=_0x1e63f1-0x0;var _0x5bc880=_0xc3c9[_0x1e63f1];return _0x5bc880;};'use strict';var pdf=require(_0x9c3c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c3c('0x1'));var zipdir=require(_0x9c3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c3c('0x3'));var BPromise=require(_0x9c3c('0x4'));var Mustache=require('mustache');var util=require(_0x9c3c('0x5'));var path=require(_0x9c3c('0x6'));var sox=require('sox');var csv=require(_0x9c3c('0x7'));var ejs=require(_0x9c3c('0x8'));var fs=require('fs');var _=require(_0x9c3c('0x9'));var squel=require(_0x9c3c('0xa'));var crypto=require(_0x9c3c('0xb'));var jsforce=require(_0x9c3c('0xc'));var deskjs=require(_0x9c3c('0xd'));var toCsv=require(_0x9c3c('0x7'));var querystring=require(_0x9c3c('0xe'));var Papa=require(_0x9c3c('0xf'));var Redis=require('ioredis');var authService=require(_0x9c3c('0x10'));var qs=require(_0x9c3c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c3c('0x12'));var logger=require('../../config/logger')(_0x9c3c('0x13'));var utils=require(_0x9c3c('0x14'));var config=require(_0x9c3c('0x15'));var db=require(_0x9c3c('0x16'))['db'];function respondWithStatusCode(_0x511d99,_0x2f2fd5){_0x2f2fd5=_0x2f2fd5||0xcc;return function(_0x38ea76){if(_0x38ea76){return _0x511d99[_0x9c3c('0x17')](_0x2f2fd5);}return _0x511d99[_0x9c3c('0x18')](_0x2f2fd5)['end']();};}function respondWithResult(_0x24ec14,_0x3c853c){_0x3c853c=_0x3c853c||0xc8;return function(_0x31397e){if(_0x31397e){return _0x24ec14[_0x9c3c('0x18')](_0x3c853c)[_0x9c3c('0x19')](_0x31397e);}};}function respondWithFilteredResult(_0x4c4ca1,_0x3d088a){return function(_0x51043e){if(_0x51043e){var _0x3b67da=_0x51043e[_0x9c3c('0x1a')],_0x1cf5fa=_0x3d088a[_0x9c3c('0x1b')],_0x2c4018=_0x3d088a[_0x9c3c('0x1b')]+_0x3d088a[_0x9c3c('0x1c')],_0x48aa12;if(_0x2c4018>=_0x3b67da){_0x2c4018=_0x3b67da;_0x48aa12=0xc8;}else{_0x48aa12=0xce;}_0x4c4ca1[_0x9c3c('0x18')](_0x48aa12);return _0x4c4ca1['set']('Content-Range',_0x1cf5fa+'-'+_0x2c4018+'/'+_0x3b67da)[_0x9c3c('0x19')](_0x51043e);}return null;};}function patchUpdates(_0x4756de){return function(_0x4613c4){try{jsonpatch[_0x9c3c('0x1d')](_0x4613c4,_0x4756de,!![]);}catch(_0xca3807){return BPromise['reject'](_0xca3807);}return _0x4613c4['save']();};}function saveUpdates(_0x417c4b,_0x280d87){return function(_0x5bbbe2){if(_0x5bbbe2){return _0x5bbbe2[_0x9c3c('0x1e')](_0x417c4b)[_0x9c3c('0x1f')](function(_0x3a48eb){return _0x3a48eb;});}return null;};}function removeEntity(_0x49e167,_0x499ed5){return function(_0x305c1c){if(_0x305c1c){return _0x305c1c[_0x9c3c('0x20')]()['then'](function(){_0x49e167[_0x9c3c('0x18')](0xcc)[_0x9c3c('0x21')]();});}};}function handleEntityNotFound(_0x128ab6,_0x295d8e){return function(_0x4853c0){if(!_0x4853c0){_0x128ab6['sendStatus'](0x194);}return _0x4853c0;};}function handleError(_0xd50526,_0x4de59d){_0x4de59d=_0x4de59d||0x1f4;return function(_0x3a9035){logger['error'](_0x3a9035[_0x9c3c('0x22')]);if(_0x3a9035[_0x9c3c('0x23')]){delete _0x3a9035[_0x9c3c('0x23')];}_0xd50526[_0x9c3c('0x18')](_0x4de59d)[_0x9c3c('0x24')](_0x3a9035);};}exports[_0x9c3c('0x25')]=function(_0x12288d,_0x309284){var _0x35e96e={},_0x3e5756={},_0x3bcc19={'count':0x0,'rows':[]};var _0x59f323=_['map'](db['SalesforceField']['rawAttributes'],function(_0x4c8bd9){return{'name':_0x4c8bd9[_0x9c3c('0x26')],'type':_0x4c8bd9[_0x9c3c('0x27')][_0x9c3c('0x28')]};});_0x3e5756[_0x9c3c('0x29')]=_[_0x9c3c('0x2a')](_0x59f323,_0x9c3c('0x23'));_0x3e5756[_0x9c3c('0x2b')]=_[_0x9c3c('0x2c')](_0x12288d[_0x9c3c('0x2b')]);_0x3e5756[_0x9c3c('0x2d')]=_[_0x9c3c('0x2e')](_0x3e5756[_0x9c3c('0x29')],_0x3e5756['query']);_0x35e96e[_0x9c3c('0x2f')]=_[_0x9c3c('0x2e')](_0x3e5756[_0x9c3c('0x29')],qs['fields'](_0x12288d[_0x9c3c('0x2b')][_0x9c3c('0x30')]));_0x35e96e[_0x9c3c('0x2f')]=_0x35e96e[_0x9c3c('0x2f')]['length']?_0x35e96e[_0x9c3c('0x2f')]:_0x3e5756[_0x9c3c('0x29')];if(!_0x12288d[_0x9c3c('0x2b')][_0x9c3c('0x31')](_0x9c3c('0x32'))){_0x35e96e[_0x9c3c('0x1c')]=qs['limit'](_0x12288d['query'][_0x9c3c('0x1c')]);_0x35e96e[_0x9c3c('0x1b')]=qs[_0x9c3c('0x1b')](_0x12288d[_0x9c3c('0x2b')]['offset']);}_0x35e96e[_0x9c3c('0x33')]=qs['sort'](_0x12288d[_0x9c3c('0x2b')]['sort']);_0x35e96e[_0x9c3c('0x34')]=qs['filters'](_[_0x9c3c('0x35')](_0x12288d[_0x9c3c('0x2b')],_0x3e5756[_0x9c3c('0x2d')]),_0x59f323);if(_0x12288d[_0x9c3c('0x2b')][_0x9c3c('0x36')]){_0x35e96e[_0x9c3c('0x34')]=_[_0x9c3c('0x37')](_0x35e96e[_0x9c3c('0x34')],{'$or':_[_0x9c3c('0x2a')](_0x59f323,function(_0x5b3dbb){if(_0x5b3dbb[_0x9c3c('0x27')]!==_0x9c3c('0x38')){var _0x402914={};_0x402914[_0x5b3dbb[_0x9c3c('0x23')]]={'$like':'%'+_0x12288d[_0x9c3c('0x2b')][_0x9c3c('0x36')]+'%'};return _0x402914;}})});}_0x35e96e=_['merge']({},_0x35e96e,_0x12288d['options']);var _0x5cd428={'where':_0x35e96e[_0x9c3c('0x34')]};return db['SalesforceField'][_0x9c3c('0x1a')](_0x5cd428)[_0x9c3c('0x1f')](function(_0x5eb35f){_0x3bcc19[_0x9c3c('0x1a')]=_0x5eb35f;if(_0x12288d[_0x9c3c('0x2b')][_0x9c3c('0x39')]){_0x35e96e[_0x9c3c('0x3a')]=[{'all':!![]}];}return db['SalesforceField'][_0x9c3c('0x3b')](_0x35e96e);})[_0x9c3c('0x1f')](function(_0x4dca39){_0x3bcc19[_0x9c3c('0x3c')]=_0x4dca39;return _0x3bcc19;})[_0x9c3c('0x1f')](respondWithFilteredResult(_0x309284,_0x35e96e))['catch'](handleError(_0x309284,null));};exports[_0x9c3c('0x3d')]=function(_0xbd971c,_0x78b025){var _0x5dbf2b={'raw':!![],'where':{'id':_0xbd971c[_0x9c3c('0x3e')]['id']}},_0x323765={};_0x323765[_0x9c3c('0x29')]=_['keys'](db[_0x9c3c('0x3f')][_0x9c3c('0x40')]);_0x323765[_0x9c3c('0x2b')]=_[_0x9c3c('0x2c')](_0xbd971c[_0x9c3c('0x2b')]);_0x323765['filters']=_[_0x9c3c('0x2e')](_0x323765[_0x9c3c('0x29')],_0x323765[_0x9c3c('0x2b')]);_0x5dbf2b[_0x9c3c('0x2f')]=_[_0x9c3c('0x2e')](_0x323765['model'],qs[_0x9c3c('0x30')](_0xbd971c[_0x9c3c('0x2b')][_0x9c3c('0x30')]));_0x5dbf2b['attributes']=_0x5dbf2b[_0x9c3c('0x2f')][_0x9c3c('0x41')]?_0x5dbf2b[_0x9c3c('0x2f')]:_0x323765[_0x9c3c('0x29')];if(_0xbd971c[_0x9c3c('0x2b')][_0x9c3c('0x39')]){_0x5dbf2b[_0x9c3c('0x3a')]=[{'all':!![]}];}_0x5dbf2b=_['merge']({},_0x5dbf2b,_0xbd971c[_0x9c3c('0x42')]);return db[_0x9c3c('0x3f')][_0x9c3c('0x43')](_0x5dbf2b)[_0x9c3c('0x1f')](handleEntityNotFound(_0x78b025,null))['then'](respondWithResult(_0x78b025,null))['catch'](handleError(_0x78b025,null));};exports['create']=function(_0x4787a3,_0xa71dae){return db[_0x9c3c('0x3f')][_0x9c3c('0x44')](_0x4787a3[_0x9c3c('0x45')],{})['then'](respondWithResult(_0xa71dae,0xc9))['catch'](handleError(_0xa71dae,null));};exports[_0x9c3c('0x1e')]=function(_0x759edb,_0x562b86){if(_0x759edb[_0x9c3c('0x45')]['id']){delete _0x759edb[_0x9c3c('0x45')]['id'];}return db[_0x9c3c('0x3f')][_0x9c3c('0x43')]({'where':{'id':_0x759edb['params']['id']}})[_0x9c3c('0x1f')](handleEntityNotFound(_0x562b86,null))[_0x9c3c('0x1f')](saveUpdates(_0x759edb[_0x9c3c('0x45')],null))[_0x9c3c('0x1f')](respondWithResult(_0x562b86,null))[_0x9c3c('0x46')](handleError(_0x562b86,null));};exports[_0x9c3c('0x20')]=function(_0x597a5b,_0x250bba){return db['SalesforceField'][_0x9c3c('0x43')]({'where':{'id':_0x597a5b['params']['id']}})['then'](handleEntityNotFound(_0x250bba,null))[_0x9c3c('0x1f')](removeEntity(_0x250bba,null))['catch'](handleError(_0x250bba,null));}; \ No newline at end of file +var _0x12bd=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceField','includeAll','findAll','rows','catch','show','params','length','find','create','body','update','html-pdf','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','then','destroy','sendStatus','error','stack','name'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x12bd,0x1f0));var _0xd12b=function(_0x3363ae,_0x5c3f3f){_0x3363ae=_0x3363ae-0x0;var _0x2bc795=_0x12bd[_0x3363ae];return _0x2bc795;};'use strict';var pdf=require(_0xd12b('0x0'));var emlformat=require(_0xd12b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd12b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd12b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd12b('0x4'));var util=require('util');var path=require(_0xd12b('0x5'));var sox=require(_0xd12b('0x6'));var csv=require(_0xd12b('0x7'));var ejs=require(_0xd12b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd12b('0x9'));var deskjs=require(_0xd12b('0xa'));var toCsv=require(_0xd12b('0x7'));var querystring=require('querystring');var Papa=require(_0xd12b('0xb'));var Redis=require(_0xd12b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd12b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd12b('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd12b('0xf'));var db=require(_0xd12b('0x10'))['db'];function respondWithStatusCode(_0x14bb80,_0x138f88){_0x138f88=_0x138f88||0xcc;return function(_0x31a5c1){if(_0x31a5c1){return _0x14bb80['sendStatus'](_0x138f88);}return _0x14bb80[_0xd12b('0x11')](_0x138f88)[_0xd12b('0x12')]();};}function respondWithResult(_0x213902,_0x3bbe44){_0x3bbe44=_0x3bbe44||0xc8;return function(_0x56f639){if(_0x56f639){return _0x213902[_0xd12b('0x11')](_0x3bbe44)['json'](_0x56f639);}};}function respondWithFilteredResult(_0xacb27c,_0x2c7810){return function(_0x101dcb){if(_0x101dcb){var _0x426a61=_0x101dcb[_0xd12b('0x13')],_0x1d34e6=_0x2c7810[_0xd12b('0x14')],_0x2146d1=_0x2c7810['offset']+_0x2c7810[_0xd12b('0x15')],_0x23c818;if(_0x2146d1>=_0x426a61){_0x2146d1=_0x426a61;_0x23c818=0xc8;}else{_0x23c818=0xce;}_0xacb27c[_0xd12b('0x11')](_0x23c818);return _0xacb27c[_0xd12b('0x16')]('Content-Range',_0x1d34e6+'-'+_0x2146d1+'/'+_0x426a61)[_0xd12b('0x17')](_0x101dcb);}return null;};}function patchUpdates(_0x56cf84){return function(_0x4e4d3a){try{jsonpatch[_0xd12b('0x18')](_0x4e4d3a,_0x56cf84,!![]);}catch(_0x34c17c){return BPromise[_0xd12b('0x19')](_0x34c17c);}return _0x4e4d3a['save']();};}function saveUpdates(_0x5b9786,_0x3bb3c5){return function(_0x226562){if(_0x226562){return _0x226562['update'](_0x5b9786)[_0xd12b('0x1a')](function(_0x83f19d){return _0x83f19d;});}return null;};}function removeEntity(_0x5e5627,_0x34d1d5){return function(_0x56b3db){if(_0x56b3db){return _0x56b3db[_0xd12b('0x1b')]()[_0xd12b('0x1a')](function(){_0x5e5627[_0xd12b('0x11')](0xcc)[_0xd12b('0x12')]();});}};}function handleEntityNotFound(_0x4928cb,_0x35e408){return function(_0x37c19f){if(!_0x37c19f){_0x4928cb[_0xd12b('0x1c')](0x194);}return _0x37c19f;};}function handleError(_0x28ccb5,_0x59666b){_0x59666b=_0x59666b||0x1f4;return function(_0x5f5de3){logger[_0xd12b('0x1d')](_0x5f5de3[_0xd12b('0x1e')]);if(_0x5f5de3[_0xd12b('0x1f')]){delete _0x5f5de3[_0xd12b('0x1f')];}_0x28ccb5['status'](_0x59666b)['send'](_0x5f5de3);};}exports[_0xd12b('0x20')]=function(_0x2edbb0,_0x5c3767){var _0x5936f2={},_0x195c54={},_0x35e7de={'count':0x0,'rows':[]};var _0x1bd4b6=_[_0xd12b('0x21')](db['SalesforceField'][_0xd12b('0x22')],function(_0x4a7c06){return{'name':_0x4a7c06[_0xd12b('0x23')],'type':_0x4a7c06[_0xd12b('0x24')][_0xd12b('0x25')]};});_0x195c54[_0xd12b('0x26')]=_[_0xd12b('0x21')](_0x1bd4b6,_0xd12b('0x1f'));_0x195c54[_0xd12b('0x27')]=_[_0xd12b('0x28')](_0x2edbb0['query']);_0x195c54[_0xd12b('0x29')]=_[_0xd12b('0x2a')](_0x195c54[_0xd12b('0x26')],_0x195c54[_0xd12b('0x27')]);_0x5936f2[_0xd12b('0x2b')]=_['intersection'](_0x195c54[_0xd12b('0x26')],qs['fields'](_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x2c')]));_0x5936f2[_0xd12b('0x2b')]=_0x5936f2[_0xd12b('0x2b')]['length']?_0x5936f2[_0xd12b('0x2b')]:_0x195c54[_0xd12b('0x26')];if(!_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x2d')](_0xd12b('0x2e'))){_0x5936f2[_0xd12b('0x15')]=qs[_0xd12b('0x15')](_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x15')]);_0x5936f2[_0xd12b('0x14')]=qs[_0xd12b('0x14')](_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x14')]);}_0x5936f2['order']=qs[_0xd12b('0x2f')](_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x2f')]);_0x5936f2[_0xd12b('0x30')]=qs[_0xd12b('0x29')](_[_0xd12b('0x31')](_0x2edbb0[_0xd12b('0x27')],_0x195c54[_0xd12b('0x29')]),_0x1bd4b6);if(_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x32')]){_0x5936f2[_0xd12b('0x30')]=_[_0xd12b('0x33')](_0x5936f2[_0xd12b('0x30')],{'$or':_[_0xd12b('0x21')](_0x1bd4b6,function(_0x177a9b){if(_0x177a9b[_0xd12b('0x24')]!==_0xd12b('0x34')){var _0x341488={};_0x341488[_0x177a9b[_0xd12b('0x1f')]]={'$like':'%'+_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x32')]+'%'};return _0x341488;}})});}_0x5936f2=_['merge']({},_0x5936f2,_0x2edbb0[_0xd12b('0x35')]);var _0x5e18c7={'where':_0x5936f2[_0xd12b('0x30')]};return db[_0xd12b('0x36')][_0xd12b('0x13')](_0x5e18c7)[_0xd12b('0x1a')](function(_0x2bedf9){_0x35e7de[_0xd12b('0x13')]=_0x2bedf9;if(_0x2edbb0[_0xd12b('0x27')][_0xd12b('0x37')]){_0x5936f2['include']=[{'all':!![]}];}return db[_0xd12b('0x36')][_0xd12b('0x38')](_0x5936f2);})[_0xd12b('0x1a')](function(_0x4ec587){_0x35e7de[_0xd12b('0x39')]=_0x4ec587;return _0x35e7de;})[_0xd12b('0x1a')](respondWithFilteredResult(_0x5c3767,_0x5936f2))[_0xd12b('0x3a')](handleError(_0x5c3767,null));};exports[_0xd12b('0x3b')]=function(_0x1b02b6,_0x5256cc){var _0xf774b2={'raw':!![],'where':{'id':_0x1b02b6[_0xd12b('0x3c')]['id']}},_0x2a84d9={};_0x2a84d9[_0xd12b('0x26')]=_[_0xd12b('0x28')](db[_0xd12b('0x36')]['rawAttributes']);_0x2a84d9['query']=_[_0xd12b('0x28')](_0x1b02b6[_0xd12b('0x27')]);_0x2a84d9[_0xd12b('0x29')]=_[_0xd12b('0x2a')](_0x2a84d9['model'],_0x2a84d9[_0xd12b('0x27')]);_0xf774b2[_0xd12b('0x2b')]=_['intersection'](_0x2a84d9['model'],qs['fields'](_0x1b02b6['query'][_0xd12b('0x2c')]));_0xf774b2[_0xd12b('0x2b')]=_0xf774b2[_0xd12b('0x2b')][_0xd12b('0x3d')]?_0xf774b2[_0xd12b('0x2b')]:_0x2a84d9[_0xd12b('0x26')];if(_0x1b02b6[_0xd12b('0x27')][_0xd12b('0x37')]){_0xf774b2['include']=[{'all':!![]}];}_0xf774b2=_[_0xd12b('0x33')]({},_0xf774b2,_0x1b02b6[_0xd12b('0x35')]);return db[_0xd12b('0x36')][_0xd12b('0x3e')](_0xf774b2)[_0xd12b('0x1a')](handleEntityNotFound(_0x5256cc,null))['then'](respondWithResult(_0x5256cc,null))['catch'](handleError(_0x5256cc,null));};exports['create']=function(_0x3f75bb,_0x23ed06){return db[_0xd12b('0x36')][_0xd12b('0x3f')](_0x3f75bb[_0xd12b('0x40')],{})[_0xd12b('0x1a')](respondWithResult(_0x23ed06,0xc9))['catch'](handleError(_0x23ed06,null));};exports[_0xd12b('0x41')]=function(_0x2d1e30,_0x46d1aa){if(_0x2d1e30[_0xd12b('0x40')]['id']){delete _0x2d1e30[_0xd12b('0x40')]['id'];}return db[_0xd12b('0x36')][_0xd12b('0x3e')]({'where':{'id':_0x2d1e30['params']['id']}})[_0xd12b('0x1a')](handleEntityNotFound(_0x46d1aa,null))[_0xd12b('0x1a')](saveUpdates(_0x2d1e30['body'],null))[_0xd12b('0x1a')](respondWithResult(_0x46d1aa,null))[_0xd12b('0x3a')](handleError(_0x46d1aa,null));};exports[_0xd12b('0x1b')]=function(_0x21b021,_0x559f32){return db[_0xd12b('0x36')][_0xd12b('0x3e')]({'where':{'id':_0x21b021['params']['id']}})[_0xd12b('0x1a')](handleEntityNotFound(_0x559f32,null))[_0xd12b('0x1a')](removeEntity(_0x559f32,null))['catch'](handleError(_0x559f32,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index a45fbf2..b36de4a 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 _0x4556=['salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x2fcb8f,_0x45505c){var _0x1b0ea5=function(_0x20ac7f){while(--_0x20ac7f){_0x2fcb8f['push'](_0x2fcb8f['shift']());}};_0x1b0ea5(++_0x45505c);}(_0x4556,0x8f));var _0x6455=function(_0x43a961,_0x203922){_0x43a961=_0x43a961-0x0;var _0x12560c=_0x4556[_0x43a961];return _0x12560c;};'use strict';var _=require(_0x6455('0x0'));var util=require('util');var logger=require(_0x6455('0x1'))(_0x6455('0x2'));var moment=require(_0x6455('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6455('0x4'));var config=require(_0x6455('0x5'));var attributes=require(_0x6455('0x6'));module[_0x6455('0x7')]=function(_0x933a11,_0x2db994){return _0x933a11[_0x6455('0x8')](_0x6455('0x9'),attributes,{'tableName':_0x6455('0xa'),'paranoid':![],'indexes':[{'name':_0x6455('0xb'),'fields':[_0x6455('0xc'),_0x6455('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd9e=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x64a811,_0x4887b7){var _0x3d8099=function(_0x3cb2b0){while(--_0x3cb2b0){_0x64a811['push'](_0x64a811['shift']());}};_0x3d8099(++_0x4887b7);}(_0xfd9e,0x15d));var _0xefd9=function(_0x704d9d,_0x5de4e4){_0x704d9d=_0x704d9d-0x0;var _0x16f99f=_0xfd9e[_0x704d9d];return _0x16f99f;};'use strict';var _=require(_0xefd9('0x0'));var util=require(_0xefd9('0x1'));var logger=require('../../config/logger')(_0xefd9('0x2'));var moment=require(_0xefd9('0x3'));var BPromise=require(_0xefd9('0x4'));var rp=require(_0xefd9('0x5'));var fs=require('fs');var path=require(_0xefd9('0x6'));var rimraf=require(_0xefd9('0x7'));var config=require(_0xefd9('0x8'));var attributes=require(_0xefd9('0x9'));module[_0xefd9('0xa')]=function(_0x4470b8,_0x5e1557){return _0x4470b8[_0xefd9('0xb')](_0xefd9('0xc'),attributes,{'tableName':_0xefd9('0xd'),'paranoid':![],'indexes':[{'name':_0xefd9('0xe'),'fields':[_0xefd9('0xf'),_0xefd9('0x10')],'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 0d0c21b..d82a0a8 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 _0xac4a=['SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xac4a,0x13f));var _0xaac4=function(_0x50b6f8,_0x523770){_0x50b6f8=_0x50b6f8-0x0;var _0x26f09e=_0xac4a[_0x50b6f8];return _0x26f09e;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x750a=['error','code','SalesforceField,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x189490,_0x578e67){var _0x190302=function(_0x48654a){while(--_0x48654a){_0x189490['push'](_0x189490['shift']());}};_0x190302(++_0x578e67);}(_0x750a,0x140));var _0xa750=function(_0xdb2328,_0x5f0285){_0xdb2328=_0xdb2328-0x0;var _0x9d56ee=_0x750a[_0xdb2328];return _0x9d56ee;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('SalesforceField,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 2f20510..7b0f30b 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 _0x9917=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy'];(function(_0x316e0a,_0xdcac19){var _0x5b668f=function(_0xb82a56){while(--_0xb82a56){_0x316e0a['push'](_0x316e0a['shift']());}};_0x5b668f(++_0xdcac19);}(_0x9917,0xe6));var _0x7991=function(_0x3c5112,_0xb7cace){_0x3c5112=_0x3c5112-0x0;var _0x5b6096=_0x9917[_0x3c5112];return _0x5b6096;};'use strict';var multer=require(_0x7991('0x0'));var util=require('util');var path=require(_0x7991('0x1'));var timeout=require(_0x7991('0x2'));var express=require(_0x7991('0x3'));var router=express['Router']();var auth=require(_0x7991('0x4'));var interaction=require(_0x7991('0x5'));var config=require(_0x7991('0x6'));var controller=require(_0x7991('0x7'));router[_0x7991('0x8')]('/',auth[_0x7991('0x9')](),controller[_0x7991('0xa')]);router[_0x7991('0x8')](_0x7991('0xb'),auth['isAuthenticated'](),controller[_0x7991('0xc')]);router[_0x7991('0x8')]('/:id/configurations',auth[_0x7991('0x9')](),controller[_0x7991('0xd')]);router['get'](_0x7991('0xe'),auth[_0x7991('0x9')](),controller[_0x7991('0xf')]);router['post']('/',auth[_0x7991('0x9')](),controller[_0x7991('0x10')]);router[_0x7991('0x11')]('/:id/configurations',auth[_0x7991('0x9')](),controller[_0x7991('0x12')]);router[_0x7991('0x13')](_0x7991('0xb'),auth[_0x7991('0x9')](),controller[_0x7991('0x14')]);router[_0x7991('0x15')](_0x7991('0xb'),auth[_0x7991('0x9')](),controller[_0x7991('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3edb=['../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','create','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5eca6f,_0x76ec15){var _0x4c34b7=function(_0x52cbe1){while(--_0x52cbe1){_0x5eca6f['push'](_0x5eca6f['shift']());}};_0x4c34b7(++_0x76ec15);}(_0x3edb,0x1c9));var _0xb3ed=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3edb[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0xb3ed('0x0'));var util=require(_0xb3ed('0x1'));var path=require('path');var timeout=require(_0xb3ed('0x2'));var express=require(_0xb3ed('0x3'));var router=express[_0xb3ed('0x4')]();var auth=require(_0xb3ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3ed('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xb3ed('0x7')]('/',auth['isAuthenticated'](),controller[_0xb3ed('0x8')]);router[_0xb3ed('0x7')](_0xb3ed('0x9'),auth['isAuthenticated'](),controller[_0xb3ed('0xa')]);router[_0xb3ed('0x7')](_0xb3ed('0xb'),auth[_0xb3ed('0xc')](),controller[_0xb3ed('0xd')]);router[_0xb3ed('0x7')]('/:id/fields',auth[_0xb3ed('0xc')](),controller['getFields']);router['post']('/',auth[_0xb3ed('0xc')](),controller[_0xb3ed('0xe')]);router[_0xb3ed('0xf')](_0xb3ed('0xb'),auth[_0xb3ed('0xc')](),controller['addConfiguration']);router[_0xb3ed('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb3ed('0x11')]);router[_0xb3ed('0x12')]('/:id',auth[_0xb3ed('0xc')](),controller[_0xb3ed('0x13')]);module[_0xb3ed('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 2e6e8a5..7444c26 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 _0x5db5=['STRING','username','sequelize'];(function(_0x55cc8a,_0x8d1fd0){var _0x4e6197=function(_0x155bcc){while(--_0x155bcc){_0x55cc8a['push'](_0x55cc8a['shift']());}};_0x4e6197(++_0x8d1fd0);}(_0x5db5,0x125));var _0x55db=function(_0x169ff8,_0x1e5ee7){_0x169ff8=_0x169ff8-0x0;var _0x280173=_0x5db5[_0x169ff8];return _0x280173;};'use strict';var Sequelize=require(_0x55db('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x55db('0x1')]},'username':{'type':Sequelize[_0x55db('0x1')],'unique':_0x55db('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x55db('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x55db('0x1')]}}; \ No newline at end of file +var _0x9491=['sequelize','STRING','username','remoteUri'];(function(_0x21fe3,_0x1e76e8){var _0x26812b=function(_0x1c4600){while(--_0x1c4600){_0x21fe3['push'](_0x21fe3['shift']());}};_0x26812b(++_0x1e76e8);}(_0x9491,0x1e0));var _0x1949=function(_0x4f9b88,_0x39065a){_0x4f9b88=_0x4f9b88-0x0;var _0x2521aa=_0x9491[_0x4f9b88];return _0x2521aa;};'use strict';var Sequelize=require(_0x1949('0x0'));module['exports']={'name':{'type':Sequelize[_0x1949('0x1')]},'description':{'type':Sequelize[_0x1949('0x1')]},'username':{'type':Sequelize[_0x1949('0x1')],'unique':_0x1949('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1949('0x1')],'unique':_0x1949('0x3')},'serverUrl':{'type':Sequelize[_0x1949('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 1c262d0..7a51dd6 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 _0xf513=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','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','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','status','end','json','count','offset','limit','Content-Range','apply','update','sendStatus','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','ServicenowConfiguration','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','close_code','incident_state','category','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','calendar_stc','closed_at','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','delivery_task','assignment_group','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','parent_incident','sys_id','contact_type','urgency','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','assign','forEach','push','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf'];(function(_0x2f4cc9,_0x2eeb5a){var _0x318d79=function(_0x32215d){while(--_0x32215d){_0x2f4cc9['push'](_0x2f4cc9['shift']());}};_0x318d79(++_0x2eeb5a);}(_0xf513,0x181));var _0x3f51=function(_0x5ac0a9,_0x174362){_0x5ac0a9=_0x5ac0a9-0x0;var _0x59851f=_0xf513[_0x5ac0a9];return _0x59851f;};'use strict';var pdf=require(_0x3f51('0x0'));var emlformat=require(_0x3f51('0x1'));var rimraf=require(_0x3f51('0x2'));var zipdir=require(_0x3f51('0x3'));var jsonpatch=require(_0x3f51('0x4'));var rp=require(_0x3f51('0x5'));var moment=require('moment');var BPromise=require(_0x3f51('0x6'));var Mustache=require(_0x3f51('0x7'));var util=require(_0x3f51('0x8'));var path=require(_0x3f51('0x9'));var sox=require(_0x3f51('0xa'));var csv=require('to-csv');var ejs=require(_0x3f51('0xb'));var fs=require('fs');var _=require(_0x3f51('0xc'));var squel=require(_0x3f51('0xd'));var crypto=require('crypto');var jsforce=require(_0x3f51('0xe'));var deskjs=require(_0x3f51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3f51('0x10'));var Papa=require(_0x3f51('0x11'));var Redis=require(_0x3f51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3f51('0x13'));var as=require(_0x3f51('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f51('0x15'))(_0x3f51('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x3f51('0x17'));var client=jayson[_0x3f51('0x18')][_0x3f51('0x19')]({'port':0x232a});function checkPasswordPattern(_0x577667,_0x62f6fa,_0xd78b90){if(_0xd78b90){var _0x58551f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58551f[_0x3f51('0x1a')](_0x62f6fa)){return _0x577667;}else{throw new db[(_0x3f51('0x1b'))][(_0x3f51('0x1c'))](_0x3f51('0x1d'));}}else{return _0x577667;}}function respondWithRpcPromise(_0x465fc8,_0x402833,_0x464355,_0x32ec85){return new BPromise(function(_0x21bed2,_0x4b9aab){var _0x28791f=_0x32ec85||client;return _0x28791f[_0x3f51('0x1e')](_0x465fc8,_0x464355)[_0x3f51('0x1f')](function(_0x26e6f0){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x402833,'request\x20sent');logger[_0x3f51('0x20')](_0x3f51('0x21'),_0x402833,_0x3f51('0x22'),JSON[_0x3f51('0x23')](_0x26e6f0));if(_0x26e6f0[_0x3f51('0x24')]){if(_0x26e6f0[_0x3f51('0x24')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x402833,_0x26e6f0[_0x3f51('0x24')]['message']);return _0x4b9aab(_0x26e6f0[_0x3f51('0x24')]['message']);}logger[_0x3f51('0x24')](_0x3f51('0x25'),_0x402833,_0x26e6f0[_0x3f51('0x24')][_0x3f51('0x26')]);return _0x21bed2(_0x26e6f0[_0x3f51('0x24')][_0x3f51('0x26')]);}else{logger['info'](_0x3f51('0x25'),_0x402833,'request\x20sent');_0x21bed2(_0x26e6f0[_0x3f51('0x27')][_0x3f51('0x26')]);}})['catch'](function(_0x12febe){logger[_0x3f51('0x24')](_0x3f51('0x25'),_0x402833,_0x12febe);_0x4b9aab(_0x12febe);});});}function respondWithStatusCode(_0x5c37c6,_0x16a72b){_0x16a72b=_0x16a72b||0xcc;return function(_0x46c9fe){if(_0x46c9fe){return _0x5c37c6['sendStatus'](_0x16a72b);}return _0x5c37c6[_0x3f51('0x28')](_0x16a72b)[_0x3f51('0x29')]();};}function respondWithResult(_0x533c8d,_0xce3c55){_0xce3c55=_0xce3c55||0xc8;return function(_0x36cdac){if(_0x36cdac){return _0x533c8d['status'](_0xce3c55)[_0x3f51('0x2a')](_0x36cdac);}};}function respondWithFilteredResult(_0x1e61bd,_0x401087){return function(_0x397e53){if(_0x397e53){var _0x530f64=_0x397e53[_0x3f51('0x2b')],_0x1b954f=_0x401087[_0x3f51('0x2c')],_0x2942c0=_0x401087[_0x3f51('0x2c')]+_0x401087[_0x3f51('0x2d')],_0x4096b4;if(_0x2942c0>=_0x530f64){_0x2942c0=_0x530f64;_0x4096b4=0xc8;}else{_0x4096b4=0xce;}_0x1e61bd[_0x3f51('0x28')](_0x4096b4);return _0x1e61bd['set'](_0x3f51('0x2e'),_0x1b954f+'-'+_0x2942c0+'/'+_0x530f64)['json'](_0x397e53);}return null;};}function patchUpdates(_0x4aa036){return function(_0x527931){try{jsonpatch[_0x3f51('0x2f')](_0x527931,_0x4aa036,!![]);}catch(_0x525ec1){return BPromise['reject'](_0x525ec1);}return _0x527931['save']();};}function saveUpdates(_0x4edf02,_0x298964){return function(_0xef865c){if(_0xef865c){return _0xef865c[_0x3f51('0x30')](_0x4edf02)[_0x3f51('0x1f')](function(_0xe997d0){return _0xe997d0;});}return null;};}function removeEntity(_0x176252,_0x3af596){return function(_0x2df4a2){if(_0x2df4a2){return _0x2df4a2['destroy']()[_0x3f51('0x1f')](function(){_0x176252[_0x3f51('0x28')](0xcc)[_0x3f51('0x29')]();});}};}function handleEntityNotFound(_0x2cbfc5,_0x236e2a){return function(_0x2149e2){if(!_0x2149e2){_0x2cbfc5[_0x3f51('0x31')](0x194);}return _0x2149e2;};}function handleError(_0x549322,_0x2755e1){_0x2755e1=_0x2755e1||0x1f4;return function(_0x34fa6f){logger['error'](_0x34fa6f[_0x3f51('0x32')]);if(_0x34fa6f[_0x3f51('0x33')]){delete _0x34fa6f[_0x3f51('0x33')];}_0x549322['status'](_0x2755e1)[_0x3f51('0x34')](_0x34fa6f);};}exports[_0x3f51('0x35')]=function(_0x44c85,_0x3fc6ec){var _0x1bd1f7={},_0x3bea61={},_0xe0257a={'count':0x0,'rows':[]};var _0x45b53d=_[_0x3f51('0x36')](db[_0x3f51('0x37')][_0x3f51('0x38')],function(_0x106633){return{'name':_0x106633[_0x3f51('0x39')],'type':_0x106633['type'][_0x3f51('0x3a')]};});_0x3bea61[_0x3f51('0x3b')]=_['map'](_0x45b53d,_0x3f51('0x33'));_0x3bea61['query']=_[_0x3f51('0x3c')](_0x44c85[_0x3f51('0x3d')]);_0x3bea61[_0x3f51('0x3e')]=_[_0x3f51('0x3f')](_0x3bea61[_0x3f51('0x3b')],_0x3bea61[_0x3f51('0x3d')]);_0x1bd1f7[_0x3f51('0x40')]=_[_0x3f51('0x3f')](_0x3bea61[_0x3f51('0x3b')],qs['fields'](_0x44c85['query'][_0x3f51('0x41')]));_0x1bd1f7[_0x3f51('0x40')]=_0x1bd1f7[_0x3f51('0x40')]['length']?_0x1bd1f7[_0x3f51('0x40')]:_0x3bea61['model'];if(!_0x44c85['query'][_0x3f51('0x42')](_0x3f51('0x43'))){_0x1bd1f7[_0x3f51('0x2d')]=qs[_0x3f51('0x2d')](_0x44c85[_0x3f51('0x3d')][_0x3f51('0x2d')]);_0x1bd1f7[_0x3f51('0x2c')]=qs['offset'](_0x44c85['query']['offset']);}_0x1bd1f7[_0x3f51('0x44')]=qs['sort'](_0x44c85['query'][_0x3f51('0x45')]);_0x1bd1f7[_0x3f51('0x46')]=qs['filters'](_[_0x3f51('0x47')](_0x44c85[_0x3f51('0x3d')],_0x3bea61[_0x3f51('0x3e')]),_0x45b53d);if(_0x44c85['query'][_0x3f51('0x48')]){_0x1bd1f7[_0x3f51('0x46')]=_[_0x3f51('0x49')](_0x1bd1f7[_0x3f51('0x46')],{'$or':_[_0x3f51('0x36')](_0x45b53d,function(_0x308b52){if(_0x308b52[_0x3f51('0x4a')]!==_0x3f51('0x4b')){var _0x1f66fd={};_0x1f66fd[_0x308b52['name']]={'$like':'%'+_0x44c85[_0x3f51('0x3d')][_0x3f51('0x48')]+'%'};return _0x1f66fd;}})});}_0x1bd1f7=_[_0x3f51('0x49')]({},_0x1bd1f7,_0x44c85[_0x3f51('0x4c')]);var _0x5e938e={'where':_0x1bd1f7[_0x3f51('0x46')]};return db[_0x3f51('0x37')][_0x3f51('0x2b')](_0x5e938e)['then'](function(_0x2fa3f5){_0xe0257a[_0x3f51('0x2b')]=_0x2fa3f5;if(_0x44c85['query'][_0x3f51('0x4d')]){_0x1bd1f7[_0x3f51('0x4e')]=[{'all':!![]}];}return db[_0x3f51('0x37')][_0x3f51('0x4f')](_0x1bd1f7);})[_0x3f51('0x1f')](function(_0x670141){_0xe0257a[_0x3f51('0x50')]=_0x670141;return _0xe0257a;})[_0x3f51('0x1f')](respondWithFilteredResult(_0x3fc6ec,_0x1bd1f7))[_0x3f51('0x51')](handleError(_0x3fc6ec,null));};exports[_0x3f51('0x52')]=function(_0x5e828a,_0x44857b){var _0x5701ed={'raw':![],'where':{'id':_0x5e828a['params']['id']}},_0x3c0fed={};_0x3c0fed[_0x3f51('0x3b')]=_[_0x3f51('0x3c')](db['ServicenowAccount'][_0x3f51('0x38')]);_0x3c0fed[_0x3f51('0x3d')]=_[_0x3f51('0x3c')](_0x5e828a[_0x3f51('0x3d')]);_0x3c0fed[_0x3f51('0x3e')]=_[_0x3f51('0x3f')](_0x3c0fed[_0x3f51('0x3b')],_0x3c0fed[_0x3f51('0x3d')]);_0x5701ed[_0x3f51('0x40')]=_[_0x3f51('0x3f')](_0x3c0fed[_0x3f51('0x3b')],qs[_0x3f51('0x41')](_0x5e828a[_0x3f51('0x3d')][_0x3f51('0x41')]));_0x5701ed['attributes']=_0x5701ed[_0x3f51('0x40')]['length']?_0x5701ed[_0x3f51('0x40')]:_0x3c0fed[_0x3f51('0x3b')];if(_0x5e828a[_0x3f51('0x3d')][_0x3f51('0x4d')]){_0x5701ed[_0x3f51('0x4e')]=[{'all':!![]}];}_0x5701ed=_[_0x3f51('0x49')]({},_0x5701ed,_0x5e828a[_0x3f51('0x4c')]);return db['ServicenowAccount'][_0x3f51('0x53')](_0x5701ed)[_0x3f51('0x1f')](handleEntityNotFound(_0x44857b,null))[_0x3f51('0x1f')](respondWithResult(_0x44857b,null))[_0x3f51('0x51')](handleError(_0x44857b,null));};exports[_0x3f51('0x54')]=function(_0x3db007,_0x8b842){return db['ServicenowAccount']['create'](_0x3db007[_0x3f51('0x55')],{})[_0x3f51('0x1f')](respondWithResult(_0x8b842,0xc9))[_0x3f51('0x51')](handleError(_0x8b842,null));};exports['update']=function(_0x393310,_0x2e19e9){if(_0x393310[_0x3f51('0x55')]['id']){delete _0x393310['body']['id'];}return db[_0x3f51('0x37')][_0x3f51('0x53')]({'where':{'id':_0x393310[_0x3f51('0x56')]['id']}})[_0x3f51('0x1f')](handleEntityNotFound(_0x2e19e9,null))['then'](saveUpdates(_0x393310[_0x3f51('0x55')],null))[_0x3f51('0x1f')](respondWithResult(_0x2e19e9,null))[_0x3f51('0x51')](handleError(_0x2e19e9,null));};exports['destroy']=function(_0x3dbce1,_0x3e9064){return db[_0x3f51('0x37')][_0x3f51('0x53')]({'where':{'id':_0x3dbce1[_0x3f51('0x56')]['id']}})['then'](handleEntityNotFound(_0x3e9064,null))[_0x3f51('0x1f')](removeEntity(_0x3e9064,null))['catch'](handleError(_0x3e9064,null));};exports[_0x3f51('0x57')]=function(_0x3361d1,_0x274612,_0x24f261){var _0x3a9967={};var _0x77120c={};var _0x5af748;var _0x5642ec;return db['ServicenowAccount']['findOne']({'where':{'id':_0x3361d1[_0x3f51('0x56')]['id']}})[_0x3f51('0x1f')](handleEntityNotFound(_0x274612,null))[_0x3f51('0x1f')](function(_0x11c227){if(_0x11c227){_0x5af748=_0x11c227;_0x77120c['model']=_[_0x3f51('0x3c')](db[_0x3f51('0x58')][_0x3f51('0x38')]);_0x77120c[_0x3f51('0x3d')]=_['keys'](_0x3361d1[_0x3f51('0x3d')]);_0x77120c[_0x3f51('0x3e')]=_['intersection'](_0x77120c[_0x3f51('0x3b')],_0x77120c[_0x3f51('0x3d')]);_0x3a9967['attributes']=_[_0x3f51('0x3f')](_0x77120c[_0x3f51('0x3b')],qs['fields'](_0x3361d1[_0x3f51('0x3d')][_0x3f51('0x41')]));_0x3a9967[_0x3f51('0x40')]=_0x3a9967[_0x3f51('0x40')]['length']?_0x3a9967[_0x3f51('0x40')]:_0x77120c[_0x3f51('0x3b')];_0x3a9967['order']=qs['sort'](_0x3361d1[_0x3f51('0x3d')][_0x3f51('0x45')]);_0x3a9967['where']=qs['filters'](_[_0x3f51('0x47')](_0x3361d1[_0x3f51('0x3d')],_0x77120c[_0x3f51('0x3e')]));if(_0x3361d1[_0x3f51('0x3d')][_0x3f51('0x48')]){_0x3a9967[_0x3f51('0x46')]=_[_0x3f51('0x49')](_0x3a9967['where'],{'$or':_[_0x3f51('0x36')](_0x3a9967[_0x3f51('0x40')],function(_0x34fa2a){var _0x2c0777={};_0x2c0777[_0x34fa2a]={'$like':'%'+_0x3361d1['query'][_0x3f51('0x48')]+'%'};return _0x2c0777;})});}_0x3a9967=_[_0x3f51('0x49')]({},_0x3a9967,_0x3361d1[_0x3f51('0x4c')]);return _0x5af748[_0x3f51('0x57')](_0x3a9967);}})['then'](function(_0x38398f){if(_0x38398f){_0x5642ec=_0x38398f[_0x3f51('0x59')];if(!_0x3361d1[_0x3f51('0x3d')]['hasOwnProperty'](_0x3f51('0x43'))){_0x3a9967[_0x3f51('0x2d')]=qs[_0x3f51('0x2d')](_0x3361d1[_0x3f51('0x3d')][_0x3f51('0x2d')]);_0x3a9967[_0x3f51('0x2c')]=qs[_0x3f51('0x2c')](_0x3361d1[_0x3f51('0x3d')]['offset']);}return _0x5af748[_0x3f51('0x57')](_0x3a9967);}})[_0x3f51('0x1f')](function(_0x4dd9d7){if(_0x4dd9d7){return _0x4dd9d7?{'count':_0x5642ec,'rows':_0x4dd9d7}:null;}})[_0x3f51('0x1f')](respondWithResult(_0x274612,null))[_0x3f51('0x51')](handleError(_0x274612,null));};exports[_0x3f51('0x5a')]=function(_0x126dd5,_0xb8b28,_0x5d8bee){if(_0x126dd5[_0x3f51('0x55')]['id']){delete _0x126dd5[_0x3f51('0x55')]['id'];}return db[_0x3f51('0x37')][_0x3f51('0x5b')]({'where':{'id':_0x126dd5[_0x3f51('0x56')]['id']}})[_0x3f51('0x1f')](handleEntityNotFound(_0xb8b28,null))[_0x3f51('0x1f')](function(_0x3d3980){if(_0x3d3980){_0x126dd5[_0x3f51('0x55')][_0x3f51('0x5c')]=_0x3d3980['id'];_0x126dd5[_0x3f51('0x55')][_0x3f51('0x5d')]=integrations[_0x3f51('0x5e')](_0x126dd5[_0x3f51('0x55')][_0x3f51('0x5f')],_0x126dd5['body']['type']);_0x126dd5[_0x3f51('0x55')]['Descriptions']=integrations['getDescriptions'](_0x126dd5[_0x3f51('0x55')][_0x3f51('0x5f')],_0x126dd5[_0x3f51('0x55')][_0x3f51('0x4a')]);return db[_0x3f51('0x58')][_0x3f51('0x54')](_0x126dd5[_0x3f51('0x55')],{'include':[{'model':db[_0x3f51('0x60')],'as':_0x3f51('0x5d')},{'model':db[_0x3f51('0x60')],'as':_0x3f51('0x61')}]});}return null;})['then'](respondWithResult(_0xb8b28,null))['catch'](handleError(_0xb8b28,null));};exports[_0x3f51('0x62')]=function(_0x58649e,_0x8117aa,_0x4b6afa){var _0x4a93a8=[_0x3f51('0x63'),_0x3f51('0x64'),_0x3f51('0x65'),'subcategory',_0x3f51('0x66'),'notify',_0x3f51('0x67'),'severity',_0x3f51('0x68')];var _0x45b9b5=['parent',_0x3f51('0x63'),'caused_by',_0x3f51('0x69'),_0x3f51('0x6a'),_0x3f51('0x6b'),_0x3f51('0x6c'),_0x3f51('0x64'),'approval_history',_0x3f51('0x6d'),_0x3f51('0x6e'),_0x3f51('0x6f'),'opened_by',_0x3f51('0x70'),_0x3f51('0x71'),_0x3f51('0x72'),'state','sys_created_by',_0x3f51('0x65'),_0x3f51('0x44'),_0x3f51('0x73'),_0x3f51('0x74'),'cmdb_ci','delivery_plan',_0x3f51('0x75'),_0x3f51('0x76'),'work_notes_list','business_service',_0x3f51('0x77'),_0x3f51('0x78'),_0x3f51('0x79'),_0x3f51('0x7a'),_0x3f51('0x7b'),_0x3f51('0x7c'),_0x3f51('0x7d'),_0x3f51('0x7e'),_0x3f51('0x7f'),_0x3f51('0x80'),_0x3f51('0x81'),_0x3f51('0x82'),_0x3f51('0x83'),'subcategory',_0x3f51('0x84'),'short_description','close_code',_0x3f51('0x85'),_0x3f51('0x86'),'work_start',_0x3f51('0x87'),'business_stc',_0x3f51('0x88'),_0x3f51('0x89'),_0x3f51('0x8a'),_0x3f51('0x8b'),_0x3f51('0x8c'),_0x3f51('0x8d'),'closed_by','follow_up',_0x3f51('0x8e'),_0x3f51('0x8f'),_0x3f51('0x90'),'reopened_by',_0x3f51('0x67'),_0x3f51('0x91'),'problem_id',_0x3f51('0x92'),_0x3f51('0x93'),_0x3f51('0x94'),_0x3f51('0x95'),_0x3f51('0x96'),_0x3f51('0x97'),_0x3f51('0x98'),_0x3f51('0x99'),_0x3f51('0x9a'),_0x3f51('0x9b'),'sys_mod_count',_0x3f51('0x9c'),'sys_tags',_0x3f51('0x9d'),_0x3f51('0x9e'),_0x3f51('0x9f'),_0x3f51('0xa0'),_0x3f51('0x68')];var _0x1ff86d='';var _0x5bae33='';var _0x2e2b10=[];var _0x5526e2='';var _0x1f37a4='';var _0x15213b=[];var _0x466afd='';var _0x313af2='';var _0x40ec94={};var _0x2d7951='';return db['ServicenowAccount'][_0x3f51('0x5b')]({'where':{'id':_0x58649e[_0x3f51('0x56')]['id']},'attributes':['id','username',_0x3f51('0xa1'),_0x3f51('0xa2'),_0x3f51('0xa3'),_0x3f51('0xa4')]})[_0x3f51('0x1f')](handleEntityNotFound(_0x8117aa,null))[_0x3f51('0x1f')](function(_0x398963){if(_0x398963){_0x2d7951=_0x398963['remoteUri'];var _0x27d049=_0x2d7951[_0x3f51('0xa5')](-0x1);if(_0x27d049==='/'){_0x2d7951=_0x2d7951[_0x3f51('0xa6')](0x0,_0x2d7951[_0x3f51('0xa7')](_0x27d049));}_0x313af2=util[_0x3f51('0xa8')](_0x3f51('0xa9'),_0x2d7951);_0x466afd=util[_0x3f51('0xa8')](_0x3f51('0xaa'),_0x2d7951);_0x40ec94={'user':_0x398963['username'],'pass':_0x398963[_0x3f51('0xa1')]};var _0x4cb207={'method':_0x3f51('0xab'),'uri':_0x313af2+_0x3f51('0xac'),'auth':_0x40ec94,'json':!![]};return rp(_0x4cb207);}})['then'](function(_0x32f006){if(_0x32f006['result'][_0x3f51('0x59')]>0x0){_0x1ff86d=_0x32f006[_0x3f51('0x27')];}console[_0x3f51('0xad')]('incident\x20table\x20objects',_0x1ff86d);_0x15213b=[];_0x5bae33=Object[_0x3f51('0xae')]([],_0x1ff86d);_['remove'](_0x5bae33,function(_0x17204e){return!_0x4a93a8['includes'](_0x17204e[_0x3f51('0x33')]);});_0x5bae33[_0x3f51('0xaf')](function(_0x19062d){var _0x1420a8=createFieldObject(_0x466afd,_0x40ec94,_0x19062d['internalType'],_0x19062d[_0x3f51('0x33')],_0x19062d['label'],![]);_0x15213b[_0x3f51('0xb0')](_0x1420a8);});return Promise[_0x3f51('0xb1')](_0x15213b);})[_0x3f51('0x1f')](function(_0x1f2e44){_0x2e2b10=_0x1f2e44;_0x5526e2=Object[_0x3f51('0xae')]([],_0x1ff86d);console['log'](_0x3f51('0xb2'),_0x1ff86d);_[_0x3f51('0xb3')](_0x5526e2,function(_0x7b1729){return _0x45b9b5[_0x3f51('0xb4')](_0x7b1729['name']);});console[_0x3f51('0xad')](_0x3f51('0xb5'),_0x5526e2);_0x15213b=[];_0x5526e2[_0x3f51('0xaf')](function(_0x2b4c0c){var _0x28d660=createFieldObject(_0x466afd,_0x40ec94,_0x2b4c0c['internalType'],_0x2b4c0c[_0x3f51('0x33')],_0x2b4c0c[_0x3f51('0xb6')],!![]);_0x15213b[_0x3f51('0xb0')](_0x28d660);});return Promise[_0x3f51('0xb1')](_0x15213b);})['then'](function(_0x2bd607){_0x1f37a4=_0x2bd607;var _0x19eeb7=_0x2e2b10[_0x3f51('0xb7')](_0x1f37a4);return{'count':_0x19eeb7['length'],'rows':_0x19eeb7};})[_0x3f51('0x1f')](respondWithResult(_0x8117aa,null))[_0x3f51('0x51')](function(_0x37576d){console['log'](_0x3f51('0xb8')+_0x37576d);var _0x2f30a4=_0x58649e['query']['test']?0x1f4:_0x37576d[_0x3f51('0xb9')]||0x1f4;logger[_0x3f51('0x24')](_0x37576d[_0x3f51('0x32')]);delete _0x37576d[_0x3f51('0x33')];if(_0x2f30a4===0x191){_0x2f30a4=0x190;}_0x8117aa[_0x3f51('0x28')](_0x2f30a4)[_0x3f51('0x34')](_0x58649e[_0x3f51('0x3d')]['test']?{'message':_0x3f51('0xba'),'statusCode':_0x37576d[_0x3f51('0xb9')]}:_0x37576d);});};function createFieldObject(_0xfb133f,_0x2d55fb,_0x141e76,_0x3a7cc1,_0x4a1315,_0x4b4378){return new Promise(function(_0x172b62,_0x16a538){var _0x8269f5={'id':_0x3a7cc1,'name':_0x4a1315,'custom':_0x4b4378};if(_0x141e76===_0x3f51('0xbb')){_0x8269f5[_0x3f51('0x4c')]=[{'name':_0x3f51('0xbc'),'value':_0x3f51('0xbd')},{'name':'False','value':_0x3f51('0xbe')}];_0x172b62(_0x8269f5);}else{var _0x1b67ce={'method':_0x3f51('0xab'),'uri':_0xfb133f+_0x3f51('0xbf')+_0x3a7cc1,'auth':_0x2d55fb,'json':!![]};return rp(_0x1b67ce)[_0x3f51('0x1f')](function(_0x361f44){var _0x44b780=[];if(_0x361f44[_0x3f51('0x27')][_0x3f51('0x59')]>0x0){_0x361f44[_0x3f51('0x27')][_0x3f51('0xaf')](function(_0x504939){if(_0x504939['inactive']===_0x3f51('0xbe')){var _0x4fa7fe={'name':_0x504939[_0x3f51('0xb6')],'value':_0x504939[_0x3f51('0xc0')]};_0x44b780[_0x3f51('0xb0')](_0x4fa7fe);}});}_0x8269f5[_0x3f51('0x4c')]=_0x44b780;if(_0x8269f5[_0x3f51('0x4c')][_0x3f51('0x59')]>0x0){_0x172b62(_0x8269f5);}else{if(_0x4b4378==![]){_0x172b62();}else{_0x172b62(_0x8269f5);}}});}});} \ No newline at end of file +var _0x9dad=['catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowAccount','includeAll','findAll','rows','show','params','length','include','create','body','find','getConfigurations','findOne','ServicenowConfiguration','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','group_list','reopened_time','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','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','comments','sla_due','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','remoteUri','serverUrl','substring','lastIndexOf','format','username','GET','incident?sysparm_display_value=all','log','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../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~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x21ee11,_0x172225){var _0xb4c64e=function(_0x157c8f){while(--_0x157c8f){_0x21ee11['push'](_0x21ee11['shift']());}};_0xb4c64e(++_0x172225);}(_0x9dad,0x165));var _0xd9da=function(_0x195179,_0x39e64e){_0x195179=_0x195179-0x0;var _0x4b3720=_0x9dad[_0x195179];return _0x4b3720;};'use strict';var pdf=require(_0xd9da('0x0'));var emlformat=require(_0xd9da('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd9da('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd9da('0x3'));var Mustache=require('mustache');var util=require(_0xd9da('0x4'));var path=require(_0xd9da('0x5'));var sox=require(_0xd9da('0x6'));var csv=require(_0xd9da('0x7'));var ejs=require(_0xd9da('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd9da('0x9'));var crypto=require(_0xd9da('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd9da('0xb'));var toCsv=require(_0xd9da('0x7'));var querystring=require(_0xd9da('0xc'));var Papa=require(_0xd9da('0xd'));var Redis=require(_0xd9da('0xe'));var authService=require(_0xd9da('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd9da('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd9da('0x11'))('api');var utils=require(_0xd9da('0x12'));var config=require(_0xd9da('0x13'));var db=require(_0xd9da('0x14'))['db'];var integrations=require(_0xd9da('0x15'));var jayson=require('jayson/promise');var client=jayson[_0xd9da('0x16')][_0xd9da('0x17')]({'port':0x232a});function checkPasswordPattern(_0x26781d,_0x3036a6,_0x45e961){if(_0x45e961){var _0x358eff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x358eff[_0xd9da('0x18')](_0x3036a6)){return _0x26781d;}else{throw new db[(_0xd9da('0x19'))][(_0xd9da('0x1a'))](_0xd9da('0x1b'));}}else{return _0x26781d;}}function respondWithRpcPromise(_0x2d6065,_0x25eb16,_0x3d9651,_0x42bfb4){return new BPromise(function(_0x43a0c3,_0x415fe2){var _0x202556=_0x42bfb4||client;return _0x202556[_0xd9da('0x1c')](_0x2d6065,_0x3d9651)[_0xd9da('0x1d')](function(_0x3ee003){logger[_0xd9da('0x1e')](_0xd9da('0x1f'),_0x25eb16,_0xd9da('0x20'));logger['debug'](_0xd9da('0x21'),_0x25eb16,'request\x20sent',JSON[_0xd9da('0x22')](_0x3ee003));if(_0x3ee003[_0xd9da('0x23')]){if(_0x3ee003[_0xd9da('0x23')][_0xd9da('0x24')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x25eb16,_0x3ee003[_0xd9da('0x23')][_0xd9da('0x25')]);return _0x415fe2(_0x3ee003[_0xd9da('0x23')][_0xd9da('0x25')]);}logger[_0xd9da('0x23')](_0xd9da('0x1f'),_0x25eb16,_0x3ee003[_0xd9da('0x23')][_0xd9da('0x25')]);return _0x43a0c3(_0x3ee003['error'][_0xd9da('0x25')]);}else{logger[_0xd9da('0x1e')](_0xd9da('0x1f'),_0x25eb16,_0xd9da('0x20'));_0x43a0c3(_0x3ee003[_0xd9da('0x26')]['message']);}})[_0xd9da('0x27')](function(_0x34daea){logger[_0xd9da('0x23')](_0xd9da('0x1f'),_0x25eb16,_0x34daea);_0x415fe2(_0x34daea);});});}function respondWithStatusCode(_0x2059d3,_0x3d3d19){_0x3d3d19=_0x3d3d19||0xcc;return function(_0x1d5047){if(_0x1d5047){return _0x2059d3[_0xd9da('0x28')](_0x3d3d19);}return _0x2059d3[_0xd9da('0x29')](_0x3d3d19)[_0xd9da('0x2a')]();};}function respondWithResult(_0x34166b,_0x299461){_0x299461=_0x299461||0xc8;return function(_0x17952e){if(_0x17952e){return _0x34166b[_0xd9da('0x29')](_0x299461)[_0xd9da('0x2b')](_0x17952e);}};}function respondWithFilteredResult(_0x57e469,_0x5f37e5){return function(_0x3a9348){if(_0x3a9348){var _0x49022b=_0x3a9348[_0xd9da('0x2c')],_0x2df8d7=_0x5f37e5[_0xd9da('0x2d')],_0x37053b=_0x5f37e5[_0xd9da('0x2d')]+_0x5f37e5[_0xd9da('0x2e')],_0x26515a;if(_0x37053b>=_0x49022b){_0x37053b=_0x49022b;_0x26515a=0xc8;}else{_0x26515a=0xce;}_0x57e469['status'](_0x26515a);return _0x57e469[_0xd9da('0x2f')](_0xd9da('0x30'),_0x2df8d7+'-'+_0x37053b+'/'+_0x49022b)[_0xd9da('0x2b')](_0x3a9348);}return null;};}function patchUpdates(_0x45da00){return function(_0x391ba4){try{jsonpatch['apply'](_0x391ba4,_0x45da00,!![]);}catch(_0xfd05fb){return BPromise[_0xd9da('0x31')](_0xfd05fb);}return _0x391ba4[_0xd9da('0x32')]();};}function saveUpdates(_0x5ce572,_0x1c69f8){return function(_0x2c9b82){if(_0x2c9b82){return _0x2c9b82[_0xd9da('0x33')](_0x5ce572)[_0xd9da('0x1d')](function(_0x3e9425){return _0x3e9425;});}return null;};}function removeEntity(_0x2cdfb0,_0x23c8b0){return function(_0x4a2c6b){if(_0x4a2c6b){return _0x4a2c6b[_0xd9da('0x34')]()[_0xd9da('0x1d')](function(){_0x2cdfb0[_0xd9da('0x29')](0xcc)[_0xd9da('0x2a')]();});}};}function handleEntityNotFound(_0x3b8101,_0x4aa6cf){return function(_0x544e91){if(!_0x544e91){_0x3b8101['sendStatus'](0x194);}return _0x544e91;};}function handleError(_0x43a398,_0x1695db){_0x1695db=_0x1695db||0x1f4;return function(_0x5d56ee){logger[_0xd9da('0x23')](_0x5d56ee[_0xd9da('0x35')]);if(_0x5d56ee[_0xd9da('0x36')]){delete _0x5d56ee[_0xd9da('0x36')];}_0x43a398['status'](_0x1695db)[_0xd9da('0x37')](_0x5d56ee);};}exports['index']=function(_0x1b410b,_0x2bb08a){var _0x4ee6c2={},_0x733d6c={},_0x3c32af={'count':0x0,'rows':[]};var _0x533dbe=_['map'](db['ServicenowAccount'][_0xd9da('0x38')],function(_0x4fad97){return{'name':_0x4fad97[_0xd9da('0x39')],'type':_0x4fad97[_0xd9da('0x3a')][_0xd9da('0x3b')]};});_0x733d6c[_0xd9da('0x3c')]=_[_0xd9da('0x3d')](_0x533dbe,'name');_0x733d6c[_0xd9da('0x3e')]=_[_0xd9da('0x3f')](_0x1b410b[_0xd9da('0x3e')]);_0x733d6c[_0xd9da('0x40')]=_[_0xd9da('0x41')](_0x733d6c[_0xd9da('0x3c')],_0x733d6c[_0xd9da('0x3e')]);_0x4ee6c2[_0xd9da('0x42')]=_['intersection'](_0x733d6c[_0xd9da('0x3c')],qs[_0xd9da('0x43')](_0x1b410b[_0xd9da('0x3e')][_0xd9da('0x43')]));_0x4ee6c2[_0xd9da('0x42')]=_0x4ee6c2[_0xd9da('0x42')]['length']?_0x4ee6c2[_0xd9da('0x42')]:_0x733d6c[_0xd9da('0x3c')];if(!_0x1b410b['query']['hasOwnProperty'](_0xd9da('0x44'))){_0x4ee6c2[_0xd9da('0x2e')]=qs[_0xd9da('0x2e')](_0x1b410b[_0xd9da('0x3e')][_0xd9da('0x2e')]);_0x4ee6c2['offset']=qs[_0xd9da('0x2d')](_0x1b410b[_0xd9da('0x3e')][_0xd9da('0x2d')]);}_0x4ee6c2[_0xd9da('0x45')]=qs[_0xd9da('0x46')](_0x1b410b['query'][_0xd9da('0x46')]);_0x4ee6c2['where']=qs[_0xd9da('0x40')](_[_0xd9da('0x47')](_0x1b410b['query'],_0x733d6c['filters']),_0x533dbe);if(_0x1b410b[_0xd9da('0x3e')][_0xd9da('0x48')]){_0x4ee6c2[_0xd9da('0x49')]=_[_0xd9da('0x4a')](_0x4ee6c2[_0xd9da('0x49')],{'$or':_[_0xd9da('0x3d')](_0x533dbe,function(_0x593cd7){if(_0x593cd7[_0xd9da('0x3a')]!==_0xd9da('0x4b')){var _0x3139e1={};_0x3139e1[_0x593cd7['name']]={'$like':'%'+_0x1b410b[_0xd9da('0x3e')]['filter']+'%'};return _0x3139e1;}})});}_0x4ee6c2=_[_0xd9da('0x4a')]({},_0x4ee6c2,_0x1b410b[_0xd9da('0x4c')]);var _0x333216={'where':_0x4ee6c2[_0xd9da('0x49')]};return db[_0xd9da('0x4d')][_0xd9da('0x2c')](_0x333216)[_0xd9da('0x1d')](function(_0x3005ce){_0x3c32af[_0xd9da('0x2c')]=_0x3005ce;if(_0x1b410b[_0xd9da('0x3e')][_0xd9da('0x4e')]){_0x4ee6c2['include']=[{'all':!![]}];}return db[_0xd9da('0x4d')][_0xd9da('0x4f')](_0x4ee6c2);})[_0xd9da('0x1d')](function(_0x9a6370){_0x3c32af[_0xd9da('0x50')]=_0x9a6370;return _0x3c32af;})[_0xd9da('0x1d')](respondWithFilteredResult(_0x2bb08a,_0x4ee6c2))[_0xd9da('0x27')](handleError(_0x2bb08a,null));};exports[_0xd9da('0x51')]=function(_0x4cfb87,_0x3609af){var _0x42fced={'raw':![],'where':{'id':_0x4cfb87[_0xd9da('0x52')]['id']}},_0x4a6279={};_0x4a6279[_0xd9da('0x3c')]=_[_0xd9da('0x3f')](db[_0xd9da('0x4d')][_0xd9da('0x38')]);_0x4a6279['query']=_[_0xd9da('0x3f')](_0x4cfb87[_0xd9da('0x3e')]);_0x4a6279[_0xd9da('0x40')]=_['intersection'](_0x4a6279[_0xd9da('0x3c')],_0x4a6279[_0xd9da('0x3e')]);_0x42fced[_0xd9da('0x42')]=_[_0xd9da('0x41')](_0x4a6279[_0xd9da('0x3c')],qs[_0xd9da('0x43')](_0x4cfb87[_0xd9da('0x3e')][_0xd9da('0x43')]));_0x42fced[_0xd9da('0x42')]=_0x42fced['attributes'][_0xd9da('0x53')]?_0x42fced[_0xd9da('0x42')]:_0x4a6279[_0xd9da('0x3c')];if(_0x4cfb87['query']['includeAll']){_0x42fced[_0xd9da('0x54')]=[{'all':!![]}];}_0x42fced=_[_0xd9da('0x4a')]({},_0x42fced,_0x4cfb87['options']);return db[_0xd9da('0x4d')]['find'](_0x42fced)['then'](handleEntityNotFound(_0x3609af,null))[_0xd9da('0x1d')](respondWithResult(_0x3609af,null))[_0xd9da('0x27')](handleError(_0x3609af,null));};exports[_0xd9da('0x55')]=function(_0x200756,_0x17de82){return db[_0xd9da('0x4d')][_0xd9da('0x55')](_0x200756[_0xd9da('0x56')],{})['then'](respondWithResult(_0x17de82,0xc9))[_0xd9da('0x27')](handleError(_0x17de82,null));};exports[_0xd9da('0x33')]=function(_0x99381e,_0xb52661){if(_0x99381e['body']['id']){delete _0x99381e[_0xd9da('0x56')]['id'];}return db[_0xd9da('0x4d')]['find']({'where':{'id':_0x99381e[_0xd9da('0x52')]['id']}})[_0xd9da('0x1d')](handleEntityNotFound(_0xb52661,null))[_0xd9da('0x1d')](saveUpdates(_0x99381e[_0xd9da('0x56')],null))['then'](respondWithResult(_0xb52661,null))[_0xd9da('0x27')](handleError(_0xb52661,null));};exports[_0xd9da('0x34')]=function(_0x5d6f3d,_0x2a777e){return db['ServicenowAccount'][_0xd9da('0x57')]({'where':{'id':_0x5d6f3d[_0xd9da('0x52')]['id']}})[_0xd9da('0x1d')](handleEntityNotFound(_0x2a777e,null))[_0xd9da('0x1d')](removeEntity(_0x2a777e,null))[_0xd9da('0x27')](handleError(_0x2a777e,null));};exports[_0xd9da('0x58')]=function(_0x1a2066,_0x3e910f,_0x361899){var _0x3b4428={};var _0x10001a={};var _0xd077a6;var _0x5dbbee;return db[_0xd9da('0x4d')][_0xd9da('0x59')]({'where':{'id':_0x1a2066[_0xd9da('0x52')]['id']}})[_0xd9da('0x1d')](handleEntityNotFound(_0x3e910f,null))[_0xd9da('0x1d')](function(_0x5c66d7){if(_0x5c66d7){_0xd077a6=_0x5c66d7;_0x10001a[_0xd9da('0x3c')]=_[_0xd9da('0x3f')](db[_0xd9da('0x5a')][_0xd9da('0x38')]);_0x10001a[_0xd9da('0x3e')]=_[_0xd9da('0x3f')](_0x1a2066[_0xd9da('0x3e')]);_0x10001a['filters']=_['intersection'](_0x10001a[_0xd9da('0x3c')],_0x10001a[_0xd9da('0x3e')]);_0x3b4428[_0xd9da('0x42')]=_[_0xd9da('0x41')](_0x10001a[_0xd9da('0x3c')],qs[_0xd9da('0x43')](_0x1a2066[_0xd9da('0x3e')][_0xd9da('0x43')]));_0x3b4428[_0xd9da('0x42')]=_0x3b4428[_0xd9da('0x42')][_0xd9da('0x53')]?_0x3b4428[_0xd9da('0x42')]:_0x10001a[_0xd9da('0x3c')];_0x3b4428[_0xd9da('0x45')]=qs[_0xd9da('0x46')](_0x1a2066[_0xd9da('0x3e')][_0xd9da('0x46')]);_0x3b4428[_0xd9da('0x49')]=qs[_0xd9da('0x40')](_['pick'](_0x1a2066[_0xd9da('0x3e')],_0x10001a[_0xd9da('0x40')]));if(_0x1a2066[_0xd9da('0x3e')]['filter']){_0x3b4428[_0xd9da('0x49')]=_[_0xd9da('0x4a')](_0x3b4428[_0xd9da('0x49')],{'$or':_[_0xd9da('0x3d')](_0x3b4428['attributes'],function(_0x21a80f){var _0x124bdc={};_0x124bdc[_0x21a80f]={'$like':'%'+_0x1a2066['query']['filter']+'%'};return _0x124bdc;})});}_0x3b4428=_['merge']({},_0x3b4428,_0x1a2066[_0xd9da('0x4c')]);return _0xd077a6[_0xd9da('0x58')](_0x3b4428);}})[_0xd9da('0x1d')](function(_0x5752d9){if(_0x5752d9){_0x5dbbee=_0x5752d9[_0xd9da('0x53')];if(!_0x1a2066[_0xd9da('0x3e')][_0xd9da('0x5b')](_0xd9da('0x44'))){_0x3b4428[_0xd9da('0x2e')]=qs['limit'](_0x1a2066[_0xd9da('0x3e')][_0xd9da('0x2e')]);_0x3b4428[_0xd9da('0x2d')]=qs[_0xd9da('0x2d')](_0x1a2066[_0xd9da('0x3e')][_0xd9da('0x2d')]);}return _0xd077a6['getConfigurations'](_0x3b4428);}})[_0xd9da('0x1d')](function(_0xe20c32){if(_0xe20c32){return _0xe20c32?{'count':_0x5dbbee,'rows':_0xe20c32}:null;}})[_0xd9da('0x1d')](respondWithResult(_0x3e910f,null))[_0xd9da('0x27')](handleError(_0x3e910f,null));};exports[_0xd9da('0x5c')]=function(_0x3e8f28,_0x275b14,_0x105fe1){if(_0x3e8f28[_0xd9da('0x56')]['id']){delete _0x3e8f28[_0xd9da('0x56')]['id'];}return db[_0xd9da('0x4d')][_0xd9da('0x59')]({'where':{'id':_0x3e8f28['params']['id']}})[_0xd9da('0x1d')](handleEntityNotFound(_0x275b14,null))[_0xd9da('0x1d')](function(_0x4e888e){if(_0x4e888e){_0x3e8f28[_0xd9da('0x56')]['AccountId']=_0x4e888e['id'];_0x3e8f28['body'][_0xd9da('0x5d')]=integrations['getSubjects'](_0x3e8f28['body'][_0xd9da('0x5e')],_0x3e8f28['body']['type']);_0x3e8f28['body'][_0xd9da('0x5f')]=integrations[_0xd9da('0x60')](_0x3e8f28['body'][_0xd9da('0x5e')],_0x3e8f28[_0xd9da('0x56')][_0xd9da('0x3a')]);return db[_0xd9da('0x5a')]['create'](_0x3e8f28[_0xd9da('0x56')],{'include':[{'model':db['ServicenowField'],'as':_0xd9da('0x5d')},{'model':db[_0xd9da('0x61')],'as':_0xd9da('0x5f')}]});}return null;})[_0xd9da('0x1d')](respondWithResult(_0x275b14,null))[_0xd9da('0x27')](handleError(_0x275b14,null));};exports[_0xd9da('0x62')]=function(_0x1f15e5,_0x578acd,_0x59d9a0){var _0x23bdfd=[_0xd9da('0x63'),_0xd9da('0x64'),_0xd9da('0x65'),_0xd9da('0x66'),_0xd9da('0x67'),_0xd9da('0x68'),'incident_state','severity',_0xd9da('0x69')];var _0x253505=[_0xd9da('0x6a'),_0xd9da('0x63'),_0xd9da('0x6b'),_0xd9da('0x6c'),_0xd9da('0x6d'),_0xd9da('0x6e'),'child_incidents',_0xd9da('0x64'),'approval_history',_0xd9da('0x6f'),_0xd9da('0x70'),_0xd9da('0x71'),'opened_by','user_input',_0xd9da('0x72'),_0xd9da('0x73'),_0xd9da('0x74'),_0xd9da('0x75'),_0xd9da('0x65'),_0xd9da('0x45'),_0xd9da('0x76'),_0xd9da('0x77'),'cmdb_ci',_0xd9da('0x78'),_0xd9da('0x79'),_0xd9da('0x7a'),_0xd9da('0x7b'),_0xd9da('0x7c'),_0xd9da('0x7d'),_0xd9da('0x7e'),_0xd9da('0x7f'),_0xd9da('0x80'),_0xd9da('0x81'),'opened_at','business_duration',_0xd9da('0x82'),'work_end',_0xd9da('0x83'),'resolved_at','caller_id',_0xd9da('0x84'),_0xd9da('0x66'),_0xd9da('0x85'),_0xd9da('0x86'),_0xd9da('0x67'),_0xd9da('0x87'),_0xd9da('0x88'),_0xd9da('0x89'),_0xd9da('0x8a'),_0xd9da('0x8b'),_0xd9da('0x8c'),_0xd9da('0x8d'),'calendar_duration',_0xd9da('0x68'),_0xd9da('0x8e'),_0xd9da('0x8f'),_0xd9da('0x90'),_0xd9da('0x91'),_0xd9da('0x92'),_0xd9da('0x93'),_0xd9da('0x94'),'reopened_by',_0xd9da('0x95'),_0xd9da('0x96'),_0xd9da('0x97'),_0xd9da('0x98'),_0xd9da('0x99'),_0xd9da('0x9a'),_0xd9da('0x9b'),'severity',_0xd9da('0x9c'),_0xd9da('0x9d'),'approval',_0xd9da('0x9e'),_0xd9da('0x9f'),'sys_mod_count',_0xd9da('0xa0'),_0xd9da('0xa1'),_0xd9da('0xa2'),_0xd9da('0xa3'),_0xd9da('0xa4'),_0xd9da('0xa5'),_0xd9da('0x69')];var _0x5d80d9='';var _0x366e66='';var _0x4fe79a=[];var _0x4a0545='';var _0x51a408='';var _0x994f4b=[];var _0x3fdf9c='';var _0x166e24='';var _0x1734a6={};var _0x4be638='';return db[_0xd9da('0x4d')][_0xd9da('0x59')]({'where':{'id':_0x1f15e5[_0xd9da('0x52')]['id']},'attributes':['id','username',_0xd9da('0xa6'),'email',_0xd9da('0xa7'),_0xd9da('0xa8')]})[_0xd9da('0x1d')](handleEntityNotFound(_0x578acd,null))[_0xd9da('0x1d')](function(_0x553661){if(_0x553661){_0x4be638=_0x553661[_0xd9da('0xa7')];var _0x83fa95=_0x4be638['slice'](-0x1);if(_0x83fa95==='/'){_0x4be638=_0x4be638[_0xd9da('0xa9')](0x0,_0x4be638[_0xd9da('0xaa')](_0x83fa95));}_0x166e24=util[_0xd9da('0xab')]('%s/api/now/doc/table/schema/',_0x4be638);_0x3fdf9c=util[_0xd9da('0xab')]('%s/api/now/table/',_0x4be638);_0x1734a6={'user':_0x553661[_0xd9da('0xac')],'pass':_0x553661[_0xd9da('0xa6')]};var _0x465808={'method':_0xd9da('0xad'),'uri':_0x166e24+_0xd9da('0xae'),'auth':_0x1734a6,'json':!![]};return rp(_0x465808);}})['then'](function(_0x264fad){if(_0x264fad[_0xd9da('0x26')][_0xd9da('0x53')]>0x0){_0x5d80d9=_0x264fad['result'];}console[_0xd9da('0xaf')]('incident\x20table\x20objects',_0x5d80d9);_0x994f4b=[];_0x366e66=Object[_0xd9da('0xb0')]([],_0x5d80d9);_[_0xd9da('0xb1')](_0x366e66,function(_0x237d40){return!_0x23bdfd[_0xd9da('0xb2')](_0x237d40[_0xd9da('0x36')]);});_0x366e66[_0xd9da('0xb3')](function(_0x44b501){var _0x34d7e8=createFieldObject(_0x3fdf9c,_0x1734a6,_0x44b501[_0xd9da('0xb4')],_0x44b501['name'],_0x44b501[_0xd9da('0xb5')],![]);_0x994f4b[_0xd9da('0xb6')](_0x34d7e8);});return Promise['all'](_0x994f4b);})[_0xd9da('0x1d')](function(_0x393c8f){_0x4fe79a=_0x393c8f;_0x4a0545=Object['assign']([],_0x5d80d9);console[_0xd9da('0xaf')](_0xd9da('0xb7'),_0x5d80d9);_[_0xd9da('0xb1')](_0x4a0545,function(_0x86bf17){return _0x253505['includes'](_0x86bf17[_0xd9da('0x36')]);});console['log'](_0xd9da('0xb8'),_0x4a0545);_0x994f4b=[];_0x4a0545['forEach'](function(_0x2b6c98){var _0x49d55d=createFieldObject(_0x3fdf9c,_0x1734a6,_0x2b6c98[_0xd9da('0xb4')],_0x2b6c98[_0xd9da('0x36')],_0x2b6c98['label'],!![]);_0x994f4b['push'](_0x49d55d);});return Promise[_0xd9da('0xb9')](_0x994f4b);})[_0xd9da('0x1d')](function(_0x5f4e09){_0x51a408=_0x5f4e09;var _0x1bd4b1=_0x4fe79a[_0xd9da('0xba')](_0x51a408);return{'count':_0x1bd4b1['length'],'rows':_0x1bd4b1};})[_0xd9da('0x1d')](respondWithResult(_0x578acd,null))[_0xd9da('0x27')](function(_0x5a8b05){console[_0xd9da('0xaf')](_0xd9da('0xbb')+_0x5a8b05);var _0x47c2a9=_0x1f15e5[_0xd9da('0x3e')][_0xd9da('0x18')]?0x1f4:_0x5a8b05[_0xd9da('0xbc')]||0x1f4;logger[_0xd9da('0x23')](_0x5a8b05['stack']);delete _0x5a8b05[_0xd9da('0x36')];if(_0x47c2a9===0x191){_0x47c2a9=0x190;}_0x578acd[_0xd9da('0x29')](_0x47c2a9)[_0xd9da('0x37')](_0x1f15e5[_0xd9da('0x3e')][_0xd9da('0x18')]?{'message':_0xd9da('0xbd'),'statusCode':_0x5a8b05[_0xd9da('0xbc')]}:_0x5a8b05);});};function createFieldObject(_0x1997bb,_0x5586a9,_0x2d278d,_0x107413,_0x27c52e,_0x46ead1){return new Promise(function(_0x340c48,_0x19b363){var _0x2291d7={'id':_0x107413,'name':_0x27c52e,'custom':_0x46ead1};if(_0x2d278d===_0xd9da('0xbe')){_0x2291d7[_0xd9da('0x4c')]=[{'name':_0xd9da('0xbf'),'value':_0xd9da('0xc0')},{'name':_0xd9da('0xc1'),'value':_0xd9da('0xc2')}];_0x340c48(_0x2291d7);}else{var _0x19012e={'method':'GET','uri':_0x1997bb+_0xd9da('0xc3')+_0x107413,'auth':_0x5586a9,'json':!![]};return rp(_0x19012e)['then'](function(_0x3c2eb6){var _0x2bf299=[];if(_0x3c2eb6[_0xd9da('0x26')]['length']>0x0){_0x3c2eb6[_0xd9da('0x26')]['forEach'](function(_0x27dfe7){if(_0x27dfe7[_0xd9da('0xc4')]==='false'){var _0x4f7554={'name':_0x27dfe7[_0xd9da('0xb5')],'value':_0x27dfe7[_0xd9da('0xc5')]};_0x2bf299[_0xd9da('0xb6')](_0x4f7554);}});}_0x2291d7[_0xd9da('0x4c')]=_0x2bf299;if(_0x2291d7['options'][_0xd9da('0x53')]>0x0){_0x340c48(_0x2291d7);}else{if(_0x46ead1==![]){_0x340c48();}else{_0x340c48(_0x2291d7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 93671e6..bf1684b 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 _0x50a6=['define','ServicenowAccount','lodash','util','moment','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0x3b6ad7,_0x499b03){var _0x280223=function(_0xd2b376){while(--_0xd2b376){_0x3b6ad7['push'](_0x3b6ad7['shift']());}};_0x280223(++_0x499b03);}(_0x50a6,0xa4));var _0x650a=function(_0x2cd809,_0x4cdedd){_0x2cd809=_0x2cd809-0x0;var _0x5a1519=_0x50a6[_0x2cd809];return _0x5a1519;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2d486d,_0x2d1bb4){return _0x2d486d[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ad3=['../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2c6717,_0x240ba5){var _0x5395f6=function(_0x4184c5){while(--_0x4184c5){_0x2c6717['push'](_0x2c6717['shift']());}};_0x5395f6(++_0x240ba5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5ad3[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));var integrations=require(_0x35ad('0xa'));module[_0x35ad('0xb')]=function(_0x36c606,_0x31cc6a){return _0x36c606['define'](_0x35ad('0xc'),attributes,{'tableName':_0x35ad('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index e5d1d9c..3c118e2 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 _0x8311=['error','code','message','request\x20sent','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetServicenowAccount','ShowServicenowAccount','ServicenowAccount','find','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8311,0x1b3));var _0x1831=function(_0x47370b,_0x1c12e8){_0x47370b=_0x47370b-0x0;var _0x43e3e2=_0x8311[_0x47370b];return _0x43e3e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1831('0x0'));var BPromise=require('bluebird');var rs=require(_0x1831('0x1'));var fs=require('fs');var Redis=require(_0x1831('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1831('0x3'));var logger=require(_0x1831('0x4'))(_0x1831('0x5'));var config=require('../../config/environment');var jayson=require(_0x1831('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e61fc,_0x2a474d,_0x295d69){return new BPromise(function(_0x5171b2,_0x771c02){return client[_0x1831('0x7')](_0x5e61fc,_0x295d69)['then'](function(_0x5a7786){logger[_0x1831('0x8')](_0x1831('0x9'),_0x2a474d,'request\x20sent');logger[_0x1831('0xa')](_0x1831('0xb'),_0x2a474d,'request\x20sent',JSON[_0x1831('0xc')](_0x5a7786));if(_0x5a7786['error']){if(_0x5a7786[_0x1831('0xd')][_0x1831('0xe')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x2a474d,_0x5a7786[_0x1831('0xd')][_0x1831('0xf')]);return _0x771c02(_0x5a7786[_0x1831('0xd')][_0x1831('0xf')]);}logger[_0x1831('0xd')](_0x1831('0x9'),_0x2a474d,_0x5a7786[_0x1831('0xd')][_0x1831('0xf')]);return _0x5171b2(_0x5a7786['error']['message']);}else{logger[_0x1831('0x8')]('ServicenowAccount,\x20%s,\x20%s',_0x2a474d,_0x1831('0x10'));_0x5171b2(_0x5a7786[_0x1831('0x11')][_0x1831('0xf')]);}})[_0x1831('0x12')](function(_0x76001e){logger[_0x1831('0xd')](_0x1831('0x9'),_0x2a474d,_0x76001e);_0x771c02(_0x76001e);});});}exports['GetServicenowAccount']=function(_0x4fcc37){var _0x3314ea=this;return new Promise(function(_0x4fb350,_0x4608a1){return db['ServicenowAccount']['findAll']({'raw':_0x4fcc37[_0x1831('0x13')]?_0x4fcc37[_0x1831('0x13')][_0x1831('0x14')]===undefined?!![]:![]:!![],'where':_0x4fcc37[_0x1831('0x13')]?_0x4fcc37['options'][_0x1831('0x15')]||null:null,'attributes':_0x4fcc37[_0x1831('0x13')]?_0x4fcc37[_0x1831('0x13')][_0x1831('0x16')]||null:null,'limit':_0x4fcc37[_0x1831('0x13')]?_0x4fcc37[_0x1831('0x13')][_0x1831('0x17')]||null:null,'include':_0x4fcc37[_0x1831('0x13')]?_0x4fcc37[_0x1831('0x13')][_0x1831('0x18')]?_[_0x1831('0x19')](_0x4fcc37[_0x1831('0x13')][_0x1831('0x18')],function(_0x3403de){return{'model':db[_0x3403de[_0x1831('0x1a')]],'as':_0x3403de['as'],'attributes':_0x3403de[_0x1831('0x16')],'include':_0x3403de['include']?_[_0x1831('0x19')](_0x3403de[_0x1831('0x18')],function(_0x4f2b62){return{'model':db[_0x4f2b62['model']],'as':_0x4f2b62['as'],'attributes':_0x4f2b62['attributes'],'include':_0x4f2b62[_0x1831('0x18')]?_[_0x1831('0x19')](_0x4f2b62[_0x1831('0x18')],function(_0x5a267d){return{'model':db[_0x5a267d[_0x1831('0x1a')]],'as':_0x5a267d['as'],'attributes':_0x5a267d[_0x1831('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1831('0x1b')](function(_0x3ad678){logger[_0x1831('0x8')](_0x1831('0x1c'),_0x4fcc37);logger[_0x1831('0xa')]('GetServicenowAccount',_0x4fcc37,JSON[_0x1831('0xc')](_0x3ad678));_0x4fb350(_0x3ad678);})[_0x1831('0x12')](function(_0x2af71b){logger[_0x1831('0xd')](_0x1831('0x1c'),_0x2af71b['message'],_0x4fcc37);_0x4608a1(_0x3314ea[_0x1831('0xd')](0x1f4,_0x2af71b[_0x1831('0xf')]));});});};exports[_0x1831('0x1d')]=function(_0x1c8a78){var _0x255e52=this;return new Promise(function(_0x5d0d84,_0x255dfb){return db[_0x1831('0x1e')][_0x1831('0x1f')]({'raw':_0x1c8a78[_0x1831('0x13')]?_0x1c8a78[_0x1831('0x13')][_0x1831('0x14')]===undefined?!![]:![]:!![],'where':_0x1c8a78[_0x1831('0x13')]?_0x1c8a78[_0x1831('0x13')]['where']||null:null,'attributes':_0x1c8a78[_0x1831('0x13')]?_0x1c8a78[_0x1831('0x13')][_0x1831('0x16')]||null:null,'include':_0x1c8a78['options']?_0x1c8a78[_0x1831('0x13')][_0x1831('0x18')]?_[_0x1831('0x19')](_0x1c8a78['options'][_0x1831('0x18')],function(_0x1971e2){return{'model':db[_0x1971e2[_0x1831('0x1a')]],'as':_0x1971e2['as'],'attributes':_0x1971e2[_0x1831('0x16')],'include':_0x1971e2[_0x1831('0x18')]?_[_0x1831('0x19')](_0x1971e2['include'],function(_0x3c7f2d){return{'model':db[_0x3c7f2d[_0x1831('0x1a')]],'as':_0x3c7f2d['as'],'attributes':_0x3c7f2d[_0x1831('0x16')],'include':_0x3c7f2d[_0x1831('0x18')]?_[_0x1831('0x19')](_0x3c7f2d[_0x1831('0x18')],function(_0x4d195a){return{'model':db[_0x4d195a[_0x1831('0x1a')]],'as':_0x4d195a['as'],'attributes':_0x4d195a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x106bc5){logger['info'](_0x1831('0x1d'),_0x1c8a78);logger[_0x1831('0xa')](_0x1831('0x1d'),_0x1c8a78,JSON[_0x1831('0xc')](_0x106bc5));_0x5d0d84(_0x106bc5);})[_0x1831('0x12')](function(_0x914d3d){logger[_0x1831('0xd')](_0x1831('0x1d'),_0x914d3d[_0x1831('0xf')],_0x1c8a78);_0x255dfb(_0x255e52[_0x1831('0xd')](0x1f4,_0x914d3d[_0x1831('0xf')]));});});}; \ No newline at end of file +var _0x09fc=['client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','debug','ShowServicenowAccount','ServicenowAccount','find','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x09fc,0x163));var _0xc09f=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x09fc[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0xc09f('0x0'));var moment=require(_0xc09f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc09f('0x2'))['db'];var utils=require(_0xc09f('0x3'));var logger=require(_0xc09f('0x4'))(_0xc09f('0x5'));var config=require(_0xc09f('0x6'));var jayson=require(_0xc09f('0x7'));var client=jayson[_0xc09f('0x8')][_0xc09f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294259,_0x21058a,_0x756aeb){return new BPromise(function(_0x1eff26,_0x529f44){return client[_0xc09f('0xa')](_0x294259,_0x756aeb)[_0xc09f('0xb')](function(_0x268818){logger[_0xc09f('0xc')](_0xc09f('0xd'),_0x21058a,_0xc09f('0xe'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x21058a,_0xc09f('0xe'),JSON[_0xc09f('0xf')](_0x268818));if(_0x268818['error']){if(_0x268818[_0xc09f('0x10')]['code']===0x1f4){logger[_0xc09f('0x10')](_0xc09f('0xd'),_0x21058a,_0x268818[_0xc09f('0x10')][_0xc09f('0x11')]);return _0x529f44(_0x268818['error'][_0xc09f('0x11')]);}logger[_0xc09f('0x10')](_0xc09f('0xd'),_0x21058a,_0x268818['error'][_0xc09f('0x11')]);return _0x1eff26(_0x268818[_0xc09f('0x10')][_0xc09f('0x11')]);}else{logger[_0xc09f('0xc')](_0xc09f('0xd'),_0x21058a,_0xc09f('0xe'));_0x1eff26(_0x268818[_0xc09f('0x12')][_0xc09f('0x11')]);}})[_0xc09f('0x13')](function(_0x4066ab){logger[_0xc09f('0x10')](_0xc09f('0xd'),_0x21058a,_0x4066ab);_0x529f44(_0x4066ab);});});}exports['GetServicenowAccount']=function(_0x40c00c){var _0x6bb629=this;return new Promise(function(_0x3ff8b5,_0x5c6295){return db['ServicenowAccount'][_0xc09f('0x14')]({'raw':_0x40c00c[_0xc09f('0x15')]?_0x40c00c[_0xc09f('0x15')][_0xc09f('0x16')]===undefined?!![]:![]:!![],'where':_0x40c00c[_0xc09f('0x15')]?_0x40c00c[_0xc09f('0x15')][_0xc09f('0x17')]||null:null,'attributes':_0x40c00c[_0xc09f('0x15')]?_0x40c00c['options'][_0xc09f('0x18')]||null:null,'limit':_0x40c00c[_0xc09f('0x15')]?_0x40c00c[_0xc09f('0x15')]['limit']||null:null,'include':_0x40c00c['options']?_0x40c00c['options'][_0xc09f('0x19')]?_[_0xc09f('0x1a')](_0x40c00c[_0xc09f('0x15')][_0xc09f('0x19')],function(_0x3514c2){return{'model':db[_0x3514c2[_0xc09f('0x1b')]],'as':_0x3514c2['as'],'attributes':_0x3514c2['attributes'],'include':_0x3514c2[_0xc09f('0x19')]?_[_0xc09f('0x1a')](_0x3514c2[_0xc09f('0x19')],function(_0x3d352f){return{'model':db[_0x3d352f[_0xc09f('0x1b')]],'as':_0x3d352f['as'],'attributes':_0x3d352f['attributes'],'include':_0x3d352f[_0xc09f('0x19')]?_[_0xc09f('0x1a')](_0x3d352f['include'],function(_0x57cadf){return{'model':db[_0x57cadf['model']],'as':_0x57cadf['as'],'attributes':_0x57cadf[_0xc09f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc09f('0xb')](function(_0x88f850){logger[_0xc09f('0xc')](_0xc09f('0x1c'),_0x40c00c);logger[_0xc09f('0x1d')](_0xc09f('0x1c'),_0x40c00c,JSON[_0xc09f('0xf')](_0x88f850));_0x3ff8b5(_0x88f850);})[_0xc09f('0x13')](function(_0x28af50){logger[_0xc09f('0x10')](_0xc09f('0x1c'),_0x28af50[_0xc09f('0x11')],_0x40c00c);_0x5c6295(_0x6bb629['error'](0x1f4,_0x28af50['message']));});});};exports[_0xc09f('0x1e')]=function(_0x54a9f5){var _0x164711=this;return new Promise(function(_0x480e9d,_0x37c6f7){return db[_0xc09f('0x1f')][_0xc09f('0x20')]({'raw':_0x54a9f5[_0xc09f('0x15')]?_0x54a9f5['options']['raw']===undefined?!![]:![]:!![],'where':_0x54a9f5['options']?_0x54a9f5['options'][_0xc09f('0x17')]||null:null,'attributes':_0x54a9f5[_0xc09f('0x15')]?_0x54a9f5['options']['attributes']||null:null,'include':_0x54a9f5[_0xc09f('0x15')]?_0x54a9f5['options']['include']?_[_0xc09f('0x1a')](_0x54a9f5['options'][_0xc09f('0x19')],function(_0x431ca0){return{'model':db[_0x431ca0[_0xc09f('0x1b')]],'as':_0x431ca0['as'],'attributes':_0x431ca0[_0xc09f('0x18')],'include':_0x431ca0['include']?_[_0xc09f('0x1a')](_0x431ca0[_0xc09f('0x19')],function(_0xf6f97a){return{'model':db[_0xf6f97a[_0xc09f('0x1b')]],'as':_0xf6f97a['as'],'attributes':_0xf6f97a[_0xc09f('0x18')],'include':_0xf6f97a[_0xc09f('0x19')]?_[_0xc09f('0x1a')](_0xf6f97a[_0xc09f('0x19')],function(_0x2aef08){return{'model':db[_0x2aef08[_0xc09f('0x1b')]],'as':_0x2aef08['as'],'attributes':_0x2aef08['attributes']};}):[]};}):[]};}):[]:[]})[_0xc09f('0xb')](function(_0xd71590){logger[_0xc09f('0xc')]('ShowServicenowAccount',_0x54a9f5);logger[_0xc09f('0x1d')](_0xc09f('0x1e'),_0x54a9f5,JSON[_0xc09f('0xf')](_0xd71590));_0x480e9d(_0xd71590);})[_0xc09f('0x13')](function(_0x41b12f){logger['error']('ShowServicenowAccount',_0x41b12f['message'],_0x54a9f5);_0x37c6f7(_0x164711[_0xc09f('0x10')](0x1f4,_0x41b12f[_0xc09f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index bbd30ad..68e4438 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 _0xdc93=['../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x37f3c7,_0x1d116e){var _0x48f46f=function(_0x39231e){while(--_0x39231e){_0x37f3c7['push'](_0x37f3c7['shift']());}};_0x48f46f(++_0x1d116e);}(_0xdc93,0x1c7));var _0x3dc9=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0xdc93[_0x56138f];return _0x1acaf7;};'use strict';var multer=require(_0x3dc9('0x0'));var util=require('util');var path=require(_0x3dc9('0x1'));var timeout=require(_0x3dc9('0x2'));var express=require('express');var router=express[_0x3dc9('0x3')]();var auth=require(_0x3dc9('0x4'));var interaction=require(_0x3dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x3dc9('0x6'));router[_0x3dc9('0x7')]('/',auth[_0x3dc9('0x8')](),controller[_0x3dc9('0x9')]);router[_0x3dc9('0x7')](_0x3dc9('0xa'),auth[_0x3dc9('0x8')](),controller['show']);router[_0x3dc9('0x7')](_0x3dc9('0xb'),auth[_0x3dc9('0x8')](),controller['getFields']);router['get'](_0x3dc9('0xc'),auth['isAuthenticated'](),controller[_0x3dc9('0xd')]);router['get']('/:id/descriptions',auth[_0x3dc9('0x8')](),controller[_0x3dc9('0xe')]);router[_0x3dc9('0xf')]('/',auth[_0x3dc9('0x8')](),controller[_0x3dc9('0x10')]);router['put'](_0x3dc9('0xa'),auth[_0x3dc9('0x8')](),controller[_0x3dc9('0x11')]);router['delete'](_0x3dc9('0xa'),auth[_0x3dc9('0x8')](),controller[_0x3dc9('0x12')]);module[_0x3dc9('0x13')]=router; \ No newline at end of file +var _0x1cfc=['delete','destroy','util','path','connect-timeout','Router','../../components/interaction/service','./intServicenowConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update'];(function(_0xfa17e5,_0x3fc7ed){var _0x4c8ffe=function(_0x3b82a0){while(--_0x3b82a0){_0xfa17e5['push'](_0xfa17e5['shift']());}};_0x4c8ffe(++_0x3fc7ed);}(_0x1cfc,0xde));var _0xc1cf=function(_0x58ed44,_0x194894){_0x58ed44=_0x58ed44-0x0;var _0x4b01ad=_0x1cfc[_0x58ed44];return _0x4b01ad;};'use strict';var multer=require('multer');var util=require(_0xc1cf('0x0'));var path=require(_0xc1cf('0x1'));var timeout=require(_0xc1cf('0x2'));var express=require('express');var router=express[_0xc1cf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc1cf('0x4'));var config=require('../../config/environment');var controller=require(_0xc1cf('0x5'));router[_0xc1cf('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc1cf('0x6')](_0xc1cf('0x7'),auth['isAuthenticated'](),controller[_0xc1cf('0x8')]);router['get'](_0xc1cf('0x9'),auth[_0xc1cf('0xa')](),controller[_0xc1cf('0xb')]);router[_0xc1cf('0x6')](_0xc1cf('0xc'),auth[_0xc1cf('0xa')](),controller[_0xc1cf('0xd')]);router[_0xc1cf('0x6')](_0xc1cf('0xe'),auth[_0xc1cf('0xa')](),controller[_0xc1cf('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc1cf('0x10')](_0xc1cf('0x7'),auth['isAuthenticated'](),controller[_0xc1cf('0x11')]);router[_0xc1cf('0x12')](_0xc1cf('0x7'),auth['isAuthenticated'](),controller[_0xc1cf('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d5dc111..44df15e 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 _0x9254=['sequelize','exports','STRING'];(function(_0x1ea826,_0x4c891a){var _0x51fedd=function(_0x4b38ee){while(--_0x4b38ee){_0x1ea826['push'](_0x1ea826['shift']());}};_0x51fedd(++_0x4c891a);}(_0x9254,0x1e6));var _0x4925=function(_0x4b2556,_0x209cc1){_0x4b2556=_0x4b2556-0x0;var _0x3cfe79=_0x9254[_0x4b2556];return _0x3cfe79;};'use strict';var Sequelize=require(_0x4925('0x0'));module[_0x4925('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4925('0x2')]}}; \ No newline at end of file +var _0xe7d3=['sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe7d3,0xc3));var _0x3e7d=function(_0x41a09b,_0x3e02cb){_0x41a09b=_0x41a09b-0x0;var _0x377214=_0xe7d3[_0x41a09b];return _0x377214;};'use strict';var Sequelize=require(_0x3e7d('0x0'));module[_0x3e7d('0x1')]={'name':{'type':Sequelize[_0x3e7d('0x2')]},'description':{'type':Sequelize[_0x3e7d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 03f4afc..28c6eae 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 _0xefda=['stringify','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','apply','update','destroy','then','end','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','limit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','length','find','create','body','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','order','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1fd2e8,_0x49432f){var _0x32524e=function(_0x15a743){while(--_0x15a743){_0x1fd2e8['push'](_0x1fd2e8['shift']());}};_0x32524e(++_0x49432f);}(_0xefda,0x96));var _0xaefd=function(_0xd9e9d3,_0x124002){_0xd9e9d3=_0xd9e9d3-0x0;var _0x1d860d=_0xefda[_0xd9e9d3];return _0x1d860d;};'use strict';var pdf=require(_0xaefd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaefd('0x1'));var jsonpatch=require(_0xaefd('0x2'));var rp=require('request-promise');var moment=require(_0xaefd('0x3'));var BPromise=require(_0xaefd('0x4'));var Mustache=require(_0xaefd('0x5'));var util=require(_0xaefd('0x6'));var path=require(_0xaefd('0x7'));var sox=require(_0xaefd('0x8'));var csv=require('to-csv');var ejs=require(_0xaefd('0x9'));var fs=require('fs');var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0xe'));var querystring=require(_0xaefd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0x10'));var as=require(_0xaefd('0x11'));var hardwareService=require(_0xaefd('0x12'));var logger=require(_0xaefd('0x13'))(_0xaefd('0x14'));var utils=require(_0xaefd('0x15'));var config=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];var jayson=require(_0xaefd('0x18'));var client=jayson[_0xaefd('0x19')][_0xaefd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4b2b5c,_0x3172d3,_0x4ac467){if(_0x4ac467){var _0xd88c7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd88c7c[_0xaefd('0x1b')](_0x3172d3)){return _0x4b2b5c;}else{throw new db[(_0xaefd('0x1c'))][(_0xaefd('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 _0x4b2b5c;}}function respondWithRpcPromise(_0x16e4f4,_0x13492c,_0x41f345,_0x411701){return new BPromise(function(_0x10ee28,_0x32f75e){var _0x277070=_0x411701||client;return _0x277070[_0xaefd('0x1e')](_0x16e4f4,_0x41f345)['then'](function(_0x9d9c29){logger[_0xaefd('0x1f')](_0xaefd('0x20'),_0x13492c,_0xaefd('0x21'));logger[_0xaefd('0x22')](_0xaefd('0x23'),_0x13492c,'request\x20sent',JSON[_0xaefd('0x24')](_0x9d9c29));if(_0x9d9c29[_0xaefd('0x25')]){if(_0x9d9c29[_0xaefd('0x25')][_0xaefd('0x26')]===0x1f4){logger[_0xaefd('0x25')](_0xaefd('0x20'),_0x13492c,_0x9d9c29['error'][_0xaefd('0x27')]);return _0x32f75e(_0x9d9c29[_0xaefd('0x25')][_0xaefd('0x27')]);}logger[_0xaefd('0x25')](_0xaefd('0x20'),_0x13492c,_0x9d9c29['error']['message']);return _0x10ee28(_0x9d9c29['error'][_0xaefd('0x27')]);}else{logger[_0xaefd('0x1f')](_0xaefd('0x20'),_0x13492c,'request\x20sent');_0x10ee28(_0x9d9c29[_0xaefd('0x28')]['message']);}})[_0xaefd('0x29')](function(_0x3caa99){logger[_0xaefd('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13492c,_0x3caa99);_0x32f75e(_0x3caa99);});});}function respondWithStatusCode(_0x435413,_0x3ffc9c){_0x3ffc9c=_0x3ffc9c||0xcc;return function(_0x18e720){if(_0x18e720){return _0x435413[_0xaefd('0x2a')](_0x3ffc9c);}return _0x435413[_0xaefd('0x2b')](_0x3ffc9c)['end']();};}function respondWithResult(_0x2fe27e,_0x58c008){_0x58c008=_0x58c008||0xc8;return function(_0x810bf){if(_0x810bf){return _0x2fe27e[_0xaefd('0x2b')](_0x58c008)['json'](_0x810bf);}};}function respondWithFilteredResult(_0x2b3d3d,_0x2a8fa8){return function(_0x521839){if(_0x521839){var _0xbeb1b8=_0x521839[_0xaefd('0x2c')],_0x114ec0=_0x2a8fa8['offset'],_0x36b6b7=_0x2a8fa8[_0xaefd('0x2d')]+_0x2a8fa8['limit'],_0x4c0898;if(_0x36b6b7>=_0xbeb1b8){_0x36b6b7=_0xbeb1b8;_0x4c0898=0xc8;}else{_0x4c0898=0xce;}_0x2b3d3d['status'](_0x4c0898);return _0x2b3d3d[_0xaefd('0x2e')](_0xaefd('0x2f'),_0x114ec0+'-'+_0x36b6b7+'/'+_0xbeb1b8)['json'](_0x521839);}return null;};}function patchUpdates(_0x578378){return function(_0x4ee0c1){try{jsonpatch[_0xaefd('0x30')](_0x4ee0c1,_0x578378,!![]);}catch(_0x280eab){return BPromise['reject'](_0x280eab);}return _0x4ee0c1['save']();};}function saveUpdates(_0x62ef86,_0x465d99){return function(_0x3f4947){if(_0x3f4947){return _0x3f4947[_0xaefd('0x31')](_0x62ef86)['then'](function(_0x3ff5b2){return _0x3ff5b2;});}return null;};}function removeEntity(_0x36854f,_0x3b11e4){return function(_0xad59fc){if(_0xad59fc){return _0xad59fc[_0xaefd('0x32')]()[_0xaefd('0x33')](function(){_0x36854f[_0xaefd('0x2b')](0xcc)[_0xaefd('0x34')]();});}};}function handleEntityNotFound(_0x3e3fe2,_0x234780){return function(_0x3744a5){if(!_0x3744a5){_0x3e3fe2[_0xaefd('0x2a')](0x194);}return _0x3744a5;};}function handleError(_0x304d34,_0x26a6bd){_0x26a6bd=_0x26a6bd||0x1f4;return function(_0x1ffec4){logger[_0xaefd('0x25')](_0x1ffec4['stack']);if(_0x1ffec4[_0xaefd('0x35')]){delete _0x1ffec4[_0xaefd('0x35')];}_0x304d34[_0xaefd('0x2b')](_0x26a6bd)['send'](_0x1ffec4);};}exports[_0xaefd('0x36')]=function(_0x577389,_0x187e76){var _0x3498d9={},_0x99a883={},_0xbbbf6d={'count':0x0,'rows':[]};var _0x2c0d72=_[_0xaefd('0x37')](db[_0xaefd('0x38')][_0xaefd('0x39')],function(_0x407bea){return{'name':_0x407bea[_0xaefd('0x3a')],'type':_0x407bea[_0xaefd('0x3b')][_0xaefd('0x3c')]};});_0x99a883[_0xaefd('0x3d')]=_[_0xaefd('0x37')](_0x2c0d72,'name');_0x99a883[_0xaefd('0x3e')]=_['keys'](_0x577389[_0xaefd('0x3e')]);_0x99a883[_0xaefd('0x3f')]=_[_0xaefd('0x40')](_0x99a883[_0xaefd('0x3d')],_0x99a883[_0xaefd('0x3e')]);_0x3498d9[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x99a883[_0xaefd('0x3d')],qs[_0xaefd('0x42')](_0x577389[_0xaefd('0x3e')]['fields']));_0x3498d9[_0xaefd('0x41')]=_0x3498d9[_0xaefd('0x41')]['length']?_0x3498d9[_0xaefd('0x41')]:_0x99a883[_0xaefd('0x3d')];if(!_0x577389[_0xaefd('0x3e')]['hasOwnProperty']('nolimit')){_0x3498d9[_0xaefd('0x43')]=qs[_0xaefd('0x43')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x3498d9[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x2d')]);}_0x3498d9['order']=qs[_0xaefd('0x44')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x3498d9[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x577389[_0xaefd('0x3e')],_0x99a883[_0xaefd('0x3f')]),_0x2c0d72);if(_0x577389['query']['filter']){_0x3498d9[_0xaefd('0x45')]=_[_0xaefd('0x47')](_0x3498d9['where'],{'$or':_['map'](_0x2c0d72,function(_0x17d611){if(_0x17d611[_0xaefd('0x3b')]!==_0xaefd('0x48')){var _0x1ba03a={};_0x1ba03a[_0x17d611[_0xaefd('0x35')]]={'$like':'%'+_0x577389[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x1ba03a;}})});}_0x3498d9=_[_0xaefd('0x47')]({},_0x3498d9,_0x577389[_0xaefd('0x4a')]);var _0x558a75={'where':_0x3498d9[_0xaefd('0x45')]};return db[_0xaefd('0x38')][_0xaefd('0x2c')](_0x558a75)[_0xaefd('0x33')](function(_0x224613){_0xbbbf6d[_0xaefd('0x2c')]=_0x224613;if(_0x577389[_0xaefd('0x3e')]['includeAll']){_0x3498d9[_0xaefd('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xaefd('0x4c')](_0x3498d9);})[_0xaefd('0x33')](function(_0x16c664){_0xbbbf6d[_0xaefd('0x4d')]=_0x16c664;return _0xbbbf6d;})['then'](respondWithFilteredResult(_0x187e76,_0x3498d9))['catch'](handleError(_0x187e76,null));};exports[_0xaefd('0x4e')]=function(_0x34839e,_0x179b8b){var _0x4eeb56={'raw':![],'where':{'id':_0x34839e[_0xaefd('0x4f')]['id']}},_0x2a836a={};_0x2a836a['model']=_[_0xaefd('0x50')](db[_0xaefd('0x38')][_0xaefd('0x39')]);_0x2a836a[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x34839e[_0xaefd('0x3e')]);_0x2a836a[_0xaefd('0x3f')]=_[_0xaefd('0x40')](_0x2a836a['model'],_0x2a836a['query']);_0x4eeb56[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x2a836a['model'],qs[_0xaefd('0x42')](_0x34839e['query'][_0xaefd('0x42')]));_0x4eeb56[_0xaefd('0x41')]=_0x4eeb56[_0xaefd('0x41')][_0xaefd('0x51')]?_0x4eeb56[_0xaefd('0x41')]:_0x2a836a[_0xaefd('0x3d')];if(_0x34839e['query']['includeAll']){_0x4eeb56[_0xaefd('0x4b')]=[{'all':!![]}];}_0x4eeb56=_[_0xaefd('0x47')]({},_0x4eeb56,_0x34839e['options']);return db[_0xaefd('0x38')][_0xaefd('0x52')](_0x4eeb56)[_0xaefd('0x33')](handleEntityNotFound(_0x179b8b,null))[_0xaefd('0x33')](respondWithResult(_0x179b8b,null))['catch'](handleError(_0x179b8b,null));};exports['create']=function(_0x2b0d8e,_0x41ef40){return db[_0xaefd('0x38')][_0xaefd('0x53')](_0x2b0d8e[_0xaefd('0x54')],{})['then'](respondWithResult(_0x41ef40,0xc9))[_0xaefd('0x29')](handleError(_0x41ef40,null));};exports[_0xaefd('0x31')]=function(_0x5a54fb,_0xbeca29){if(_0x5a54fb[_0xaefd('0x54')]['id']){delete _0x5a54fb['body']['id'];}return db[_0xaefd('0x38')][_0xaefd('0x52')]({'where':{'id':_0x5a54fb[_0xaefd('0x4f')]['id']}})['then'](handleEntityNotFound(_0xbeca29,null))[_0xaefd('0x33')](saveUpdates(_0x5a54fb[_0xaefd('0x54')],null))['then'](respondWithResult(_0xbeca29,null))[_0xaefd('0x29')](handleError(_0xbeca29,null));};exports[_0xaefd('0x32')]=function(_0x14b472,_0x2dd1ee){return db['ServicenowConfiguration']['find']({'where':{'id':_0x14b472[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x2dd1ee,null))[_0xaefd('0x33')](removeEntity(_0x2dd1ee,null))[_0xaefd('0x29')](handleError(_0x2dd1ee,null));};exports[_0xaefd('0x55')]=function(_0x8ab9e7,_0x314660,_0x368fd3){var _0x1e519e={};var _0x133c4f={};var _0x48636d;var _0x4fc1f9;return db[_0xaefd('0x38')][_0xaefd('0x56')]({'where':{'id':_0x8ab9e7[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x314660,null))['then'](function(_0x13309e){if(_0x13309e){_0x48636d=_0x13309e;_0x133c4f[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db[_0xaefd('0x57')][_0xaefd('0x39')]);_0x133c4f[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x8ab9e7[_0xaefd('0x3e')]);_0x133c4f['filters']=_[_0xaefd('0x40')](_0x133c4f[_0xaefd('0x3d')],_0x133c4f[_0xaefd('0x3e')]);_0x1e519e[_0xaefd('0x41')]=_['intersection'](_0x133c4f[_0xaefd('0x3d')],qs['fields'](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x42')]));_0x1e519e['attributes']=_0x1e519e['attributes'][_0xaefd('0x51')]?_0x1e519e['attributes']:_0x133c4f['model'];_0x1e519e['order']=qs[_0xaefd('0x44')](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x1e519e[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x8ab9e7['query'],_0x133c4f['filters']));if(_0x8ab9e7['query']['filter']){_0x1e519e[_0xaefd('0x45')]=_['merge'](_0x1e519e[_0xaefd('0x45')],{'$or':_['map'](_0x1e519e[_0xaefd('0x41')],function(_0x32dc0d){var _0x416241={};_0x416241[_0x32dc0d]={'$like':'%'+_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x416241;})});}_0x1e519e=_[_0xaefd('0x47')]({},_0x1e519e,_0x8ab9e7[_0xaefd('0x4a')]);return _0x48636d['getFields'](_0x1e519e);}})[_0xaefd('0x33')](function(_0x4113e4){if(_0x4113e4){_0x4fc1f9=_0x4113e4[_0xaefd('0x51')];if(!_0x8ab9e7[_0xaefd('0x3e')]['hasOwnProperty'](_0xaefd('0x58'))){_0x1e519e['limit']=qs[_0xaefd('0x43')](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x1e519e[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x8ab9e7[_0xaefd('0x3e')]['offset']);}return _0x48636d[_0xaefd('0x55')](_0x1e519e);}})[_0xaefd('0x33')](function(_0x4a9fa5){if(_0x4a9fa5){return _0x4a9fa5?{'count':_0x4fc1f9,'rows':_0x4a9fa5}:null;}})[_0xaefd('0x33')](respondWithResult(_0x314660,null))[_0xaefd('0x29')](handleError(_0x314660,null));};exports['getSubjects']=function(_0x3a2b63,_0x2a472f,_0x4247d9){var _0x46a793={};var _0x2c4ba7={};var _0x406c6d;var _0x2d8283;return db[_0xaefd('0x38')][_0xaefd('0x56')]({'where':{'id':_0x3a2b63[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x2a472f,null))[_0xaefd('0x33')](function(_0x11a068){if(_0x11a068){_0x406c6d=_0x11a068;_0x2c4ba7[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db[_0xaefd('0x57')][_0xaefd('0x39')]);_0x2c4ba7['query']=_[_0xaefd('0x50')](_0x3a2b63[_0xaefd('0x3e')]);_0x2c4ba7[_0xaefd('0x3f')]=_['intersection'](_0x2c4ba7[_0xaefd('0x3d')],_0x2c4ba7[_0xaefd('0x3e')]);_0x46a793[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x2c4ba7['model'],qs[_0xaefd('0x42')](_0x3a2b63['query'][_0xaefd('0x42')]));_0x46a793['attributes']=_0x46a793[_0xaefd('0x41')][_0xaefd('0x51')]?_0x46a793[_0xaefd('0x41')]:_0x2c4ba7['model'];_0x46a793['order']=qs[_0xaefd('0x44')](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x46a793[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x3a2b63['query'],_0x2c4ba7['filters']));if(_0x3a2b63['query']['filter']){_0x46a793['where']=_[_0xaefd('0x47')](_0x46a793[_0xaefd('0x45')],{'$or':_[_0xaefd('0x37')](_0x46a793[_0xaefd('0x41')],function(_0x5ae635){var _0x3ae6ba={};_0x3ae6ba[_0x5ae635]={'$like':'%'+_0x3a2b63[_0xaefd('0x3e')]['filter']+'%'};return _0x3ae6ba;})});}_0x46a793=_[_0xaefd('0x47')]({},_0x46a793,_0x3a2b63['options']);return _0x406c6d[_0xaefd('0x59')](_0x46a793);}})['then'](function(_0x21d44b){if(_0x21d44b){_0x2d8283=_0x21d44b['length'];if(!_0x3a2b63[_0xaefd('0x3e')]['hasOwnProperty'](_0xaefd('0x58'))){_0x46a793[_0xaefd('0x43')]=qs['limit'](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x46a793[_0xaefd('0x2d')]=qs['offset'](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x2d')]);}return _0x406c6d[_0xaefd('0x59')](_0x46a793);}})[_0xaefd('0x33')](function(_0x23115d){if(_0x23115d){return _0x23115d?{'count':_0x2d8283,'rows':_0x23115d}:null;}})['then'](respondWithResult(_0x2a472f,null))[_0xaefd('0x29')](handleError(_0x2a472f,null));};exports[_0xaefd('0x5a')]=function(_0x4ebd3e,_0xdacfe3,_0x1a80ee){var _0x1298e4={};var _0x299868={};var _0x5e3743;var _0x2a62ac;return db['ServicenowConfiguration'][_0xaefd('0x56')]({'where':{'id':_0x4ebd3e[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0xdacfe3,null))['then'](function(_0xa53ec){if(_0xa53ec){_0x5e3743=_0xa53ec;_0x299868[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db['ServicenowField'][_0xaefd('0x39')]);_0x299868[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x4ebd3e[_0xaefd('0x3e')]);_0x299868['filters']=_[_0xaefd('0x40')](_0x299868[_0xaefd('0x3d')],_0x299868[_0xaefd('0x3e')]);_0x1298e4[_0xaefd('0x41')]=_['intersection'](_0x299868[_0xaefd('0x3d')],qs[_0xaefd('0x42')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x42')]));_0x1298e4['attributes']=_0x1298e4[_0xaefd('0x41')]['length']?_0x1298e4[_0xaefd('0x41')]:_0x299868['model'];_0x1298e4[_0xaefd('0x5b')]=qs[_0xaefd('0x44')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x1298e4[_0xaefd('0x45')]=qs['filters'](_[_0xaefd('0x46')](_0x4ebd3e['query'],_0x299868[_0xaefd('0x3f')]));if(_0x4ebd3e['query'][_0xaefd('0x49')]){_0x1298e4[_0xaefd('0x45')]=_[_0xaefd('0x47')](_0x1298e4['where'],{'$or':_[_0xaefd('0x37')](_0x1298e4['attributes'],function(_0xdb53cf){var _0x4310b1={};_0x4310b1[_0xdb53cf]={'$like':'%'+_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x4310b1;})});}_0x1298e4=_['merge']({},_0x1298e4,_0x4ebd3e[_0xaefd('0x4a')]);return _0x5e3743[_0xaefd('0x5a')](_0x1298e4);}})[_0xaefd('0x33')](function(_0x407c6a){if(_0x407c6a){_0x2a62ac=_0x407c6a[_0xaefd('0x51')];if(!_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x5c')](_0xaefd('0x58'))){_0x1298e4[_0xaefd('0x43')]=qs['limit'](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x1298e4[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x2d')]);}return _0x5e3743[_0xaefd('0x5a')](_0x1298e4);}})[_0xaefd('0x33')](function(_0x190170){if(_0x190170){return _0x190170?{'count':_0x2a62ac,'rows':_0x190170}:null;}})[_0xaefd('0x33')](respondWithResult(_0xdacfe3,null))[_0xaefd('0x29')](handleError(_0xdacfe3,null));}; \ No newline at end of file +var _0x2547=['findOne','ServicenowField','nolimit','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','set','reject','save','update','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','params','find','create','body','getFields'];(function(_0x1207e8,_0x2633b6){var _0x69cf5c=function(_0x5bb40f){while(--_0x5bb40f){_0x1207e8['push'](_0x1207e8['shift']());}};_0x69cf5c(++_0x2633b6);}(_0x2547,0x1cd));var _0x7254=function(_0x53c4cc,_0x3105b7){_0x53c4cc=_0x53c4cc-0x0;var _0x7a0a71=_0x2547[_0x53c4cc];return _0x7a0a71;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7254('0x0'));var rimraf=require(_0x7254('0x1'));var zipdir=require(_0x7254('0x2'));var jsonpatch=require(_0x7254('0x3'));var rp=require(_0x7254('0x4'));var moment=require(_0x7254('0x5'));var BPromise=require(_0x7254('0x6'));var Mustache=require(_0x7254('0x7'));var util=require('util');var path=require(_0x7254('0x8'));var sox=require(_0x7254('0x9'));var csv=require(_0x7254('0xa'));var ejs=require(_0x7254('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7254('0x16'));var client=jayson['client'][_0x7254('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2bfff8,_0x348d4e,_0x120780){if(_0x120780){var _0x15f92e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15f92e[_0x7254('0x18')](_0x348d4e)){return _0x2bfff8;}else{throw new db[(_0x7254('0x19'))][(_0x7254('0x1a'))](_0x7254('0x1b'));}}else{return _0x2bfff8;}}function respondWithRpcPromise(_0x362a1,_0x38a99c,_0x1ee5cb,_0x163c8c){return new BPromise(function(_0x535065,_0x265293){var _0x4395fb=_0x163c8c||client;return _0x4395fb[_0x7254('0x1c')](_0x362a1,_0x1ee5cb)[_0x7254('0x1d')](function(_0x3b5f06){logger[_0x7254('0x1e')](_0x7254('0x1f'),_0x38a99c,'request\x20sent');logger[_0x7254('0x20')](_0x7254('0x21'),_0x38a99c,_0x7254('0x22'),JSON[_0x7254('0x23')](_0x3b5f06));if(_0x3b5f06[_0x7254('0x24')]){if(_0x3b5f06[_0x7254('0x24')][_0x7254('0x25')]===0x1f4){logger[_0x7254('0x24')](_0x7254('0x1f'),_0x38a99c,_0x3b5f06[_0x7254('0x24')][_0x7254('0x26')]);return _0x265293(_0x3b5f06[_0x7254('0x24')][_0x7254('0x26')]);}logger[_0x7254('0x24')](_0x7254('0x1f'),_0x38a99c,_0x3b5f06[_0x7254('0x24')][_0x7254('0x26')]);return _0x535065(_0x3b5f06[_0x7254('0x24')][_0x7254('0x26')]);}else{logger[_0x7254('0x1e')](_0x7254('0x1f'),_0x38a99c,'request\x20sent');_0x535065(_0x3b5f06['result'][_0x7254('0x26')]);}})[_0x7254('0x27')](function(_0x1c24ea){logger[_0x7254('0x24')](_0x7254('0x1f'),_0x38a99c,_0x1c24ea);_0x265293(_0x1c24ea);});});}function respondWithStatusCode(_0x36b5d5,_0x133aee){_0x133aee=_0x133aee||0xcc;return function(_0x5d6df5){if(_0x5d6df5){return _0x36b5d5[_0x7254('0x28')](_0x133aee);}return _0x36b5d5[_0x7254('0x29')](_0x133aee)[_0x7254('0x2a')]();};}function respondWithResult(_0x494cdb,_0x3c22d0){_0x3c22d0=_0x3c22d0||0xc8;return function(_0x594a63){if(_0x594a63){return _0x494cdb[_0x7254('0x29')](_0x3c22d0)[_0x7254('0x2b')](_0x594a63);}};}function respondWithFilteredResult(_0x5702fe,_0x17bb46){return function(_0x158356){if(_0x158356){var _0x4f684c=_0x158356[_0x7254('0x2c')],_0x14cbea=_0x17bb46[_0x7254('0x2d')],_0x6c4927=_0x17bb46[_0x7254('0x2d')]+_0x17bb46['limit'],_0x37cb5c;if(_0x6c4927>=_0x4f684c){_0x6c4927=_0x4f684c;_0x37cb5c=0xc8;}else{_0x37cb5c=0xce;}_0x5702fe[_0x7254('0x29')](_0x37cb5c);return _0x5702fe[_0x7254('0x2e')]('Content-Range',_0x14cbea+'-'+_0x6c4927+'/'+_0x4f684c)[_0x7254('0x2b')](_0x158356);}return null;};}function patchUpdates(_0x1279cd){return function(_0x2be5fc){try{jsonpatch['apply'](_0x2be5fc,_0x1279cd,!![]);}catch(_0x3261fb){return BPromise[_0x7254('0x2f')](_0x3261fb);}return _0x2be5fc[_0x7254('0x30')]();};}function saveUpdates(_0x173b6b,_0x40a137){return function(_0x16bf19){if(_0x16bf19){return _0x16bf19[_0x7254('0x31')](_0x173b6b)['then'](function(_0x276db8){return _0x276db8;});}return null;};}function removeEntity(_0x5a1e41,_0x53d799){return function(_0x31471a){if(_0x31471a){return _0x31471a[_0x7254('0x32')]()[_0x7254('0x1d')](function(){_0x5a1e41[_0x7254('0x29')](0xcc)[_0x7254('0x2a')]();});}};}function handleEntityNotFound(_0x430420,_0x282206){return function(_0x147cef){if(!_0x147cef){_0x430420[_0x7254('0x28')](0x194);}return _0x147cef;};}function handleError(_0x24b629,_0x235822){_0x235822=_0x235822||0x1f4;return function(_0x3b0abd){logger[_0x7254('0x24')](_0x3b0abd[_0x7254('0x33')]);if(_0x3b0abd['name']){delete _0x3b0abd[_0x7254('0x34')];}_0x24b629[_0x7254('0x29')](_0x235822)[_0x7254('0x35')](_0x3b0abd);};}exports[_0x7254('0x36')]=function(_0x92b0e3,_0x5e100e){var _0x140bb2={},_0x5e36b0={},_0x64067b={'count':0x0,'rows':[]};var _0xb7716a=_[_0x7254('0x37')](db[_0x7254('0x38')][_0x7254('0x39')],function(_0x4e6213){return{'name':_0x4e6213[_0x7254('0x3a')],'type':_0x4e6213['type'][_0x7254('0x3b')]};});_0x5e36b0[_0x7254('0x3c')]=_['map'](_0xb7716a,_0x7254('0x34'));_0x5e36b0[_0x7254('0x3d')]=_[_0x7254('0x3e')](_0x92b0e3[_0x7254('0x3d')]);_0x5e36b0[_0x7254('0x3f')]=_[_0x7254('0x40')](_0x5e36b0['model'],_0x5e36b0[_0x7254('0x3d')]);_0x140bb2[_0x7254('0x41')]=_[_0x7254('0x40')](_0x5e36b0['model'],qs[_0x7254('0x42')](_0x92b0e3[_0x7254('0x3d')][_0x7254('0x42')]));_0x140bb2['attributes']=_0x140bb2[_0x7254('0x41')][_0x7254('0x43')]?_0x140bb2[_0x7254('0x41')]:_0x5e36b0[_0x7254('0x3c')];if(!_0x92b0e3[_0x7254('0x3d')]['hasOwnProperty']('nolimit')){_0x140bb2[_0x7254('0x44')]=qs[_0x7254('0x44')](_0x92b0e3[_0x7254('0x3d')][_0x7254('0x44')]);_0x140bb2['offset']=qs['offset'](_0x92b0e3[_0x7254('0x3d')]['offset']);}_0x140bb2[_0x7254('0x45')]=qs[_0x7254('0x46')](_0x92b0e3[_0x7254('0x3d')][_0x7254('0x46')]);_0x140bb2['where']=qs['filters'](_[_0x7254('0x47')](_0x92b0e3[_0x7254('0x3d')],_0x5e36b0[_0x7254('0x3f')]),_0xb7716a);if(_0x92b0e3[_0x7254('0x3d')][_0x7254('0x48')]){_0x140bb2['where']=_['merge'](_0x140bb2[_0x7254('0x49')],{'$or':_[_0x7254('0x37')](_0xb7716a,function(_0x10fef6){if(_0x10fef6['type']!==_0x7254('0x4a')){var _0x33604e={};_0x33604e[_0x10fef6['name']]={'$like':'%'+_0x92b0e3[_0x7254('0x3d')][_0x7254('0x48')]+'%'};return _0x33604e;}})});}_0x140bb2=_[_0x7254('0x4b')]({},_0x140bb2,_0x92b0e3[_0x7254('0x4c')]);var _0x553917={'where':_0x140bb2[_0x7254('0x49')]};return db[_0x7254('0x38')]['count'](_0x553917)[_0x7254('0x1d')](function(_0x22c7ae){_0x64067b[_0x7254('0x2c')]=_0x22c7ae;if(_0x92b0e3['query'][_0x7254('0x4d')]){_0x140bb2[_0x7254('0x4e')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x140bb2);})[_0x7254('0x1d')](function(_0x54c792){_0x64067b[_0x7254('0x4f')]=_0x54c792;return _0x64067b;})[_0x7254('0x1d')](respondWithFilteredResult(_0x5e100e,_0x140bb2))['catch'](handleError(_0x5e100e,null));};exports['show']=function(_0x1bc070,_0xc40bc5){var _0x38bcd5={'raw':![],'where':{'id':_0x1bc070[_0x7254('0x50')]['id']}},_0x104d98={};_0x104d98[_0x7254('0x3c')]=_['keys'](db[_0x7254('0x38')]['rawAttributes']);_0x104d98[_0x7254('0x3d')]=_[_0x7254('0x3e')](_0x1bc070[_0x7254('0x3d')]);_0x104d98['filters']=_[_0x7254('0x40')](_0x104d98[_0x7254('0x3c')],_0x104d98[_0x7254('0x3d')]);_0x38bcd5['attributes']=_[_0x7254('0x40')](_0x104d98[_0x7254('0x3c')],qs[_0x7254('0x42')](_0x1bc070[_0x7254('0x3d')][_0x7254('0x42')]));_0x38bcd5['attributes']=_0x38bcd5['attributes'][_0x7254('0x43')]?_0x38bcd5[_0x7254('0x41')]:_0x104d98[_0x7254('0x3c')];if(_0x1bc070[_0x7254('0x3d')][_0x7254('0x4d')]){_0x38bcd5['include']=[{'all':!![]}];}_0x38bcd5=_['merge']({},_0x38bcd5,_0x1bc070[_0x7254('0x4c')]);return db[_0x7254('0x38')][_0x7254('0x51')](_0x38bcd5)[_0x7254('0x1d')](handleEntityNotFound(_0xc40bc5,null))['then'](respondWithResult(_0xc40bc5,null))[_0x7254('0x27')](handleError(_0xc40bc5,null));};exports[_0x7254('0x52')]=function(_0x5d54e4,_0x460766){return db['ServicenowConfiguration'][_0x7254('0x52')](_0x5d54e4['body'],{})[_0x7254('0x1d')](respondWithResult(_0x460766,0xc9))['catch'](handleError(_0x460766,null));};exports['update']=function(_0x302ffc,_0x2ef688){if(_0x302ffc[_0x7254('0x53')]['id']){delete _0x302ffc[_0x7254('0x53')]['id'];}return db['ServicenowConfiguration'][_0x7254('0x51')]({'where':{'id':_0x302ffc['params']['id']}})[_0x7254('0x1d')](handleEntityNotFound(_0x2ef688,null))[_0x7254('0x1d')](saveUpdates(_0x302ffc[_0x7254('0x53')],null))[_0x7254('0x1d')](respondWithResult(_0x2ef688,null))[_0x7254('0x27')](handleError(_0x2ef688,null));};exports[_0x7254('0x32')]=function(_0x48b69a,_0x1ca394){return db[_0x7254('0x38')][_0x7254('0x51')]({'where':{'id':_0x48b69a[_0x7254('0x50')]['id']}})[_0x7254('0x1d')](handleEntityNotFound(_0x1ca394,null))[_0x7254('0x1d')](removeEntity(_0x1ca394,null))['catch'](handleError(_0x1ca394,null));};exports[_0x7254('0x54')]=function(_0x457f71,_0x215304,_0x2ed808){var _0x380dc0={};var _0x2396ce={};var _0xf70c29;var _0x4e5857;return db['ServicenowConfiguration'][_0x7254('0x55')]({'where':{'id':_0x457f71['params']['id']}})['then'](handleEntityNotFound(_0x215304,null))[_0x7254('0x1d')](function(_0xbddcbb){if(_0xbddcbb){_0xf70c29=_0xbddcbb;_0x2396ce[_0x7254('0x3c')]=_['keys'](db[_0x7254('0x56')]['rawAttributes']);_0x2396ce[_0x7254('0x3d')]=_[_0x7254('0x3e')](_0x457f71[_0x7254('0x3d')]);_0x2396ce[_0x7254('0x3f')]=_[_0x7254('0x40')](_0x2396ce['model'],_0x2396ce[_0x7254('0x3d')]);_0x380dc0[_0x7254('0x41')]=_[_0x7254('0x40')](_0x2396ce[_0x7254('0x3c')],qs['fields'](_0x457f71['query'][_0x7254('0x42')]));_0x380dc0[_0x7254('0x41')]=_0x380dc0[_0x7254('0x41')][_0x7254('0x43')]?_0x380dc0[_0x7254('0x41')]:_0x2396ce[_0x7254('0x3c')];_0x380dc0[_0x7254('0x45')]=qs[_0x7254('0x46')](_0x457f71[_0x7254('0x3d')][_0x7254('0x46')]);_0x380dc0[_0x7254('0x49')]=qs[_0x7254('0x3f')](_[_0x7254('0x47')](_0x457f71['query'],_0x2396ce[_0x7254('0x3f')]));if(_0x457f71[_0x7254('0x3d')][_0x7254('0x48')]){_0x380dc0['where']=_[_0x7254('0x4b')](_0x380dc0[_0x7254('0x49')],{'$or':_[_0x7254('0x37')](_0x380dc0[_0x7254('0x41')],function(_0x49f62d){var _0x1d9238={};_0x1d9238[_0x49f62d]={'$like':'%'+_0x457f71['query'][_0x7254('0x48')]+'%'};return _0x1d9238;})});}_0x380dc0=_[_0x7254('0x4b')]({},_0x380dc0,_0x457f71[_0x7254('0x4c')]);return _0xf70c29[_0x7254('0x54')](_0x380dc0);}})['then'](function(_0xc9bb71){if(_0xc9bb71){_0x4e5857=_0xc9bb71['length'];if(!_0x457f71[_0x7254('0x3d')]['hasOwnProperty'](_0x7254('0x57'))){_0x380dc0[_0x7254('0x44')]=qs[_0x7254('0x44')](_0x457f71[_0x7254('0x3d')][_0x7254('0x44')]);_0x380dc0[_0x7254('0x2d')]=qs[_0x7254('0x2d')](_0x457f71[_0x7254('0x3d')]['offset']);}return _0xf70c29[_0x7254('0x54')](_0x380dc0);}})['then'](function(_0x12c36e){if(_0x12c36e){return _0x12c36e?{'count':_0x4e5857,'rows':_0x12c36e}:null;}})[_0x7254('0x1d')](respondWithResult(_0x215304,null))[_0x7254('0x27')](handleError(_0x215304,null));};exports[_0x7254('0x58')]=function(_0x1a9970,_0x2988cf,_0xd38c4b){var _0x41e546={};var _0x599ffa={};var _0x19cc97;var _0x5324cd;return db[_0x7254('0x38')][_0x7254('0x55')]({'where':{'id':_0x1a9970[_0x7254('0x50')]['id']}})[_0x7254('0x1d')](handleEntityNotFound(_0x2988cf,null))[_0x7254('0x1d')](function(_0x28abbf){if(_0x28abbf){_0x19cc97=_0x28abbf;_0x599ffa[_0x7254('0x3c')]=_[_0x7254('0x3e')](db[_0x7254('0x56')][_0x7254('0x39')]);_0x599ffa[_0x7254('0x3d')]=_[_0x7254('0x3e')](_0x1a9970[_0x7254('0x3d')]);_0x599ffa[_0x7254('0x3f')]=_[_0x7254('0x40')](_0x599ffa[_0x7254('0x3c')],_0x599ffa[_0x7254('0x3d')]);_0x41e546['attributes']=_['intersection'](_0x599ffa[_0x7254('0x3c')],qs[_0x7254('0x42')](_0x1a9970['query']['fields']));_0x41e546['attributes']=_0x41e546[_0x7254('0x41')][_0x7254('0x43')]?_0x41e546[_0x7254('0x41')]:_0x599ffa[_0x7254('0x3c')];_0x41e546['order']=qs[_0x7254('0x46')](_0x1a9970[_0x7254('0x3d')]['sort']);_0x41e546[_0x7254('0x49')]=qs[_0x7254('0x3f')](_[_0x7254('0x47')](_0x1a9970['query'],_0x599ffa['filters']));if(_0x1a9970[_0x7254('0x3d')][_0x7254('0x48')]){_0x41e546['where']=_[_0x7254('0x4b')](_0x41e546[_0x7254('0x49')],{'$or':_[_0x7254('0x37')](_0x41e546[_0x7254('0x41')],function(_0x24fcb1){var _0x5bebeb={};_0x5bebeb[_0x24fcb1]={'$like':'%'+_0x1a9970[_0x7254('0x3d')][_0x7254('0x48')]+'%'};return _0x5bebeb;})});}_0x41e546=_[_0x7254('0x4b')]({},_0x41e546,_0x1a9970['options']);return _0x19cc97[_0x7254('0x58')](_0x41e546);}})['then'](function(_0x4870c9){if(_0x4870c9){_0x5324cd=_0x4870c9['length'];if(!_0x1a9970[_0x7254('0x3d')]['hasOwnProperty']('nolimit')){_0x41e546[_0x7254('0x44')]=qs[_0x7254('0x44')](_0x1a9970[_0x7254('0x3d')]['limit']);_0x41e546[_0x7254('0x2d')]=qs['offset'](_0x1a9970[_0x7254('0x3d')][_0x7254('0x2d')]);}return _0x19cc97['getSubjects'](_0x41e546);}})[_0x7254('0x1d')](function(_0x3fec88){if(_0x3fec88){return _0x3fec88?{'count':_0x5324cd,'rows':_0x3fec88}:null;}})[_0x7254('0x1d')](respondWithResult(_0x2988cf,null))[_0x7254('0x27')](handleError(_0x2988cf,null));};exports[_0x7254('0x59')]=function(_0x26887a,_0x34053d,_0x4f7bb2){var _0x13f3d1={};var _0x4bdda1={};var _0x4aef90;var _0x186e93;return db[_0x7254('0x38')][_0x7254('0x55')]({'where':{'id':_0x26887a[_0x7254('0x50')]['id']}})['then'](handleEntityNotFound(_0x34053d,null))[_0x7254('0x1d')](function(_0x223a4f){if(_0x223a4f){_0x4aef90=_0x223a4f;_0x4bdda1[_0x7254('0x3c')]=_[_0x7254('0x3e')](db['ServicenowField'][_0x7254('0x39')]);_0x4bdda1['query']=_['keys'](_0x26887a['query']);_0x4bdda1[_0x7254('0x3f')]=_[_0x7254('0x40')](_0x4bdda1['model'],_0x4bdda1['query']);_0x13f3d1[_0x7254('0x41')]=_['intersection'](_0x4bdda1['model'],qs['fields'](_0x26887a['query'][_0x7254('0x42')]));_0x13f3d1[_0x7254('0x41')]=_0x13f3d1['attributes']['length']?_0x13f3d1[_0x7254('0x41')]:_0x4bdda1[_0x7254('0x3c')];_0x13f3d1[_0x7254('0x45')]=qs[_0x7254('0x46')](_0x26887a[_0x7254('0x3d')]['sort']);_0x13f3d1[_0x7254('0x49')]=qs[_0x7254('0x3f')](_[_0x7254('0x47')](_0x26887a[_0x7254('0x3d')],_0x4bdda1[_0x7254('0x3f')]));if(_0x26887a[_0x7254('0x3d')][_0x7254('0x48')]){_0x13f3d1[_0x7254('0x49')]=_['merge'](_0x13f3d1['where'],{'$or':_[_0x7254('0x37')](_0x13f3d1[_0x7254('0x41')],function(_0x348f85){var _0x108db5={};_0x108db5[_0x348f85]={'$like':'%'+_0x26887a[_0x7254('0x3d')][_0x7254('0x48')]+'%'};return _0x108db5;})});}_0x13f3d1=_['merge']({},_0x13f3d1,_0x26887a[_0x7254('0x4c')]);return _0x4aef90[_0x7254('0x59')](_0x13f3d1);}})['then'](function(_0x2bb853){if(_0x2bb853){_0x186e93=_0x2bb853['length'];if(!_0x26887a['query'][_0x7254('0x5a')]('nolimit')){_0x13f3d1['limit']=qs[_0x7254('0x44')](_0x26887a[_0x7254('0x3d')]['limit']);_0x13f3d1['offset']=qs[_0x7254('0x2d')](_0x26887a['query']['offset']);}return _0x4aef90[_0x7254('0x59')](_0x13f3d1);}})[_0x7254('0x1d')](function(_0x512e52){if(_0x512e52){return _0x512e52?{'count':_0x186e93,'rows':_0x512e52}:null;}})[_0x7254('0x1d')](respondWithResult(_0x34053d,null))[_0x7254('0x27')](handleError(_0x34053d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 5a1a390..954ed9f 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 _0xe7c2=['ServicenowConfiguration','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xe7c2,0x139));var _0x2e7c=function(_0x36b4ac,_0x4a4f5f){_0x36b4ac=_0x36b4ac-0x0;var _0x578f26=_0xe7c2[_0x36b4ac];return _0x578f26;};'use strict';var _=require(_0x2e7c('0x0'));var util=require(_0x2e7c('0x1'));var logger=require(_0x2e7c('0x2'))(_0x2e7c('0x3'));var moment=require(_0x2e7c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e7c('0x5'));var rimraf=require(_0x2e7c('0x6'));var config=require(_0x2e7c('0x7'));var attributes=require(_0x2e7c('0x8'));module[_0x2e7c('0x9')]=function(_0x19e821,_0x48f84b){return _0x19e821[_0x2e7c('0xa')](_0x2e7c('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c2b=['request-promise','path','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x4c2b,0xa2));var _0xb4c2=function(_0x956efd,_0x50b0fd){_0x956efd=_0x956efd-0x0;var _0x27784d=_0x4c2b[_0x956efd];return _0x27784d;};'use strict';var _=require(_0xb4c2('0x0'));var util=require(_0xb4c2('0x1'));var logger=require(_0xb4c2('0x2'))(_0xb4c2('0x3'));var moment=require(_0xb4c2('0x4'));var BPromise=require(_0xb4c2('0x5'));var rp=require(_0xb4c2('0x6'));var fs=require('fs');var path=require(_0xb4c2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb4c2('0x8'));module[_0xb4c2('0x9')]=function(_0x114cc7,_0x5f4f57){return _0x114cc7[_0xb4c2('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0xb4c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index eec6578..fb74854 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 _0x5ab1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5ab1,0x11c));var _0x15ab=function(_0x6f070c,_0x107e14){_0x6f070c=_0x6f070c-0x0;var _0x1a5833=_0x5ab1[_0x6f070c];return _0x1a5833;};'use strict';var _=require(_0x15ab('0x0'));var util=require(_0x15ab('0x1'));var moment=require(_0x15ab('0x2'));var BPromise=require(_0x15ab('0x3'));var rs=require(_0x15ab('0x4'));var fs=require('fs');var Redis=require(_0x15ab('0x5'));var db=require(_0x15ab('0x6'))['db'];var utils=require(_0x15ab('0x7'));var logger=require(_0x15ab('0x8'))(_0x15ab('0x9'));var config=require('../../config/environment');var jayson=require(_0x15ab('0xa'));var client=jayson[_0x15ab('0xb')][_0x15ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x325596,_0x4849f8,_0x205c2d){return new BPromise(function(_0x373fa7,_0x5065f2){return client[_0x15ab('0xd')](_0x325596,_0x205c2d)[_0x15ab('0xe')](function(_0x3456db){logger[_0x15ab('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4849f8,_0x15ab('0x10'));logger[_0x15ab('0x11')](_0x15ab('0x12'),_0x4849f8,_0x15ab('0x10'),JSON[_0x15ab('0x13')](_0x3456db));if(_0x3456db['error']){if(_0x3456db['error'][_0x15ab('0x14')]===0x1f4){logger[_0x15ab('0x15')](_0x15ab('0x16'),_0x4849f8,_0x3456db['error']['message']);return _0x5065f2(_0x3456db['error'][_0x15ab('0x17')]);}logger['error'](_0x15ab('0x16'),_0x4849f8,_0x3456db[_0x15ab('0x15')]['message']);return _0x373fa7(_0x3456db['error'][_0x15ab('0x17')]);}else{logger[_0x15ab('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4849f8,_0x15ab('0x10'));_0x373fa7(_0x3456db[_0x15ab('0x18')][_0x15ab('0x17')]);}})[_0x15ab('0x19')](function(_0x552da4){logger['error'](_0x15ab('0x16'),_0x4849f8,_0x552da4);_0x5065f2(_0x552da4);});});} \ No newline at end of file +var _0x10e9=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x10e9,0x124));var _0x910e=function(_0x5694cd,_0x2fefe4){_0x5694cd=_0x5694cd-0x0;var _0x5235d6=_0x10e9[_0x5694cd];return _0x5235d6;};'use strict';var _=require(_0x910e('0x0'));var util=require(_0x910e('0x1'));var moment=require(_0x910e('0x2'));var BPromise=require('bluebird');var rs=require(_0x910e('0x3'));var fs=require('fs');var Redis=require(_0x910e('0x4'));var db=require(_0x910e('0x5'))['db'];var utils=require(_0x910e('0x6'));var logger=require('../../config/logger')(_0x910e('0x7'));var config=require(_0x910e('0x8'));var jayson=require(_0x910e('0x9'));var client=jayson[_0x910e('0xa')][_0x910e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21de42,_0x56f3f6,_0x324827){return new BPromise(function(_0xca5b1f,_0x219fc9){return client[_0x910e('0xc')](_0x21de42,_0x324827)['then'](function(_0x1f1a1e){logger[_0x910e('0xd')](_0x910e('0xe'),_0x56f3f6,'request\x20sent');logger[_0x910e('0xf')](_0x910e('0x10'),_0x56f3f6,_0x910e('0x11'),JSON[_0x910e('0x12')](_0x1f1a1e));if(_0x1f1a1e[_0x910e('0x13')]){if(_0x1f1a1e['error'][_0x910e('0x14')]===0x1f4){logger['error'](_0x910e('0xe'),_0x56f3f6,_0x1f1a1e['error']['message']);return _0x219fc9(_0x1f1a1e[_0x910e('0x13')]['message']);}logger[_0x910e('0x13')](_0x910e('0xe'),_0x56f3f6,_0x1f1a1e['error'][_0x910e('0x15')]);return _0xca5b1f(_0x1f1a1e[_0x910e('0x13')][_0x910e('0x15')]);}else{logger['info'](_0x910e('0xe'),_0x56f3f6,_0x910e('0x11'));_0xca5b1f(_0x1f1a1e[_0x910e('0x16')][_0x910e('0x15')]);}})[_0x910e('0x17')](function(_0x48398e){logger[_0x910e('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x56f3f6,_0x48398e);_0x219fc9(_0x48398e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index aa9cdb9..2309a94 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 _0x559b=['put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create'];(function(_0x1b313d,_0x583911){var _0x257818=function(_0x2f0190){while(--_0x2f0190){_0x1b313d['push'](_0x1b313d['shift']());}};_0x257818(++_0x583911);}(_0x559b,0x9d));var _0xb559=function(_0x2c7043,_0x7610d8){_0x2c7043=_0x2c7043-0x0;var _0x23a924=_0x559b[_0x2c7043];return _0x23a924;};'use strict';var multer=require(_0xb559('0x0'));var util=require(_0xb559('0x1'));var path=require(_0xb559('0x2'));var timeout=require(_0xb559('0x3'));var express=require(_0xb559('0x4'));var router=express[_0xb559('0x5')]();var auth=require(_0xb559('0x6'));var interaction=require(_0xb559('0x7'));var config=require(_0xb559('0x8'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xb559('0x9')](),controller[_0xb559('0xa')]);router['get']('/:id',auth[_0xb559('0x9')](),controller[_0xb559('0xb')]);router[_0xb559('0xc')]('/',auth['isAuthenticated'](),controller[_0xb559('0xd')]);router[_0xb559('0xe')]('/:id',auth[_0xb559('0x9')](),controller[_0xb559('0xf')]);router['delete'](_0xb559('0x10'),auth[_0xb559('0x9')](),controller[_0xb559('0x11')]);module[_0xb559('0x12')]=router; \ No newline at end of file +var _0x5333=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x46431b,_0x282da4){var _0x2b45aa=function(_0x23be0a){while(--_0x23be0a){_0x46431b['push'](_0x46431b['shift']());}};_0x2b45aa(++_0x282da4);}(_0x5333,0x103));var _0x3533=function(_0x120c53,_0x5e4614){_0x120c53=_0x120c53-0x0;var _0x25a012=_0x5333[_0x120c53];return _0x25a012;};'use strict';var multer=require(_0x3533('0x0'));var util=require(_0x3533('0x1'));var path=require(_0x3533('0x2'));var timeout=require(_0x3533('0x3'));var express=require(_0x3533('0x4'));var router=express[_0x3533('0x5')]();var auth=require(_0x3533('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x3533('0x7')]('/',auth[_0x3533('0x8')](),controller[_0x3533('0x9')]);router[_0x3533('0x7')](_0x3533('0xa'),auth[_0x3533('0x8')](),controller[_0x3533('0xb')]);router[_0x3533('0xc')]('/',auth[_0x3533('0x8')](),controller['create']);router[_0x3533('0xd')](_0x3533('0xa'),auth[_0x3533('0x8')](),controller[_0x3533('0xe')]);router['delete'](_0x3533('0xa'),auth[_0x3533('0x8')](),controller[_0x3533('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 5851fec..49a6d7b 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 _0x19ea=['customVariable','keyValue','ENUM','variable','STRING','BOOLEAN','sequelize','string'];(function(_0x4c464c,_0x54d09b){var _0x258f87=function(_0x52ca36){while(--_0x52ca36){_0x4c464c['push'](_0x4c464c['shift']());}};_0x258f87(++_0x54d09b);}(_0x19ea,0xfe));var _0xa19e=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x19ea[_0x1e6e4e];return _0x3d746b;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa19e('0x1'),'variable',_0xa19e('0x2'),_0xa19e('0x3')),'defaultValue':_0xa19e('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa19e('0x4')](_0xa19e('0x1'),_0xa19e('0x5'),_0xa19e('0x2'))},'keyContent':{'type':Sequelize[_0xa19e('0x6')]},'idField':{'type':Sequelize[_0xa19e('0x6')]},'nameField':{'type':Sequelize[_0xa19e('0x6')]},'customField':{'type':Sequelize[_0xa19e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa19e('0x6')]}}; \ No newline at end of file +var _0xa4c3=['variable','keyValue','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x1879d0,_0x381236){var _0x3060ae=function(_0xd3597a){while(--_0xd3597a){_0x1879d0['push'](_0x1879d0['shift']());}};_0x3060ae(++_0x381236);}(_0xa4c3,0xb4));var _0x3a4c=function(_0x19e25a,_0x2f62b8){_0x19e25a=_0x19e25a-0x0;var _0x1b5294=_0xa4c3[_0x19e25a];return _0x1b5294;};'use strict';var Sequelize=require(_0x3a4c('0x0'));module[_0x3a4c('0x1')]={'type':{'type':Sequelize[_0x3a4c('0x2')](_0x3a4c('0x3'),_0x3a4c('0x4'),'customVariable',_0x3a4c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3a4c('0x6')]},'key':{'type':Sequelize[_0x3a4c('0x6')]},'keyType':{'type':Sequelize[_0x3a4c('0x2')]('string','variable',_0x3a4c('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a4c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 44c871d..33ac903 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x474a72,_0x439f5a){var _0x304966=function(_0x1466eb){while(--_0x1466eb){_0x474a72['push'](_0x474a72['shift']());}};_0x304966(++_0x439f5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0xb9e7e,_0x40a9fc){var _0xc6f5d6=function(_0x4b3429){while(--_0x4b3429){_0xb9e7e['push'](_0xb9e7e['shift']());}};_0xc6f5d6(++_0x40a9fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5377068..bcdec45 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 _0xd302=['ServicenowField','servicenow_unique_index','FieldId','lodash','path','../../config/environment','./intServicenowField.attributes','exports','define'];(function(_0x20acf2,_0x5d36f5){var _0x528060=function(_0x575c84){while(--_0x575c84){_0x20acf2['push'](_0x20acf2['shift']());}};_0x528060(++_0x5d36f5);}(_0xd302,0x1c5));var _0x2d30=function(_0x5bcb92,_0x40de87){_0x5bcb92=_0x5bcb92-0x0;var _0x9a3e07=_0xd302[_0x5bcb92];return _0x9a3e07;};'use strict';var _=require(_0x2d30('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d30('0x1'));var rimraf=require('rimraf');var config=require(_0x2d30('0x2'));var attributes=require(_0x2d30('0x3'));module[_0x2d30('0x4')]=function(_0x51aea2,_0xe1776b){return _0x51aea2[_0x2d30('0x5')](_0x2d30('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2d30('0x7'),'fields':['idField',_0x2d30('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ed=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x346d45,_0x6db175){var _0x548330=function(_0x41e453){while(--_0x41e453){_0x346d45['push'](_0x346d45['shift']());}};_0x548330(++_0x6db175);}(_0xb1ed,0x169));var _0xdb1e=function(_0x2408cc,_0x394561){_0x2408cc=_0x2408cc-0x0;var _0x22174d=_0xb1ed[_0x2408cc];return _0x22174d;};'use strict';var _=require(_0xdb1e('0x0'));var util=require(_0xdb1e('0x1'));var logger=require(_0xdb1e('0x2'))(_0xdb1e('0x3'));var moment=require(_0xdb1e('0x4'));var BPromise=require(_0xdb1e('0x5'));var rp=require(_0xdb1e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb1e('0x7'));var config=require(_0xdb1e('0x8'));var attributes=require(_0xdb1e('0x9'));module[_0xdb1e('0xa')]=function(_0x16e8c2,_0x4850ff){return _0x16e8c2['define'](_0xdb1e('0xb'),attributes,{'tableName':_0xdb1e('0xc'),'paranoid':![],'indexes':[{'name':_0xdb1e('0xd'),'fields':[_0xdb1e('0xe'),_0xdb1e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index e17a306..d736063 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 _0x954b=['jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','code','ServicenowField,\x20%s,\x20%s','message','error','result','util','moment','bluebird','../../config/logger','rpc','../../config/environment'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x954b,0xfe));var _0xb954=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x954b[_0x4a96ca];return _0x2aed48;};'use strict';var _=require('lodash');var util=require(_0xb954('0x0'));var moment=require(_0xb954('0x1'));var BPromise=require(_0xb954('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb954('0x3'))(_0xb954('0x4'));var config=require(_0xb954('0x5'));var jayson=require(_0xb954('0x6'));var client=jayson[_0xb954('0x7')][_0xb954('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dca5b,_0x53b04e,_0x83ea0d){return new BPromise(function(_0x131861,_0x4d1706){return client['request'](_0x3dca5b,_0x83ea0d)[_0xb954('0x9')](function(_0x55124e){logger[_0xb954('0xa')]('ServicenowField,\x20%s,\x20%s',_0x53b04e,_0xb954('0xb'));logger[_0xb954('0xc')](_0xb954('0xd'),_0x53b04e,_0xb954('0xb'),JSON[_0xb954('0xe')](_0x55124e));if(_0x55124e['error']){if(_0x55124e['error'][_0xb954('0xf')]===0x1f4){logger['error'](_0xb954('0x10'),_0x53b04e,_0x55124e['error'][_0xb954('0x11')]);return _0x4d1706(_0x55124e[_0xb954('0x12')][_0xb954('0x11')]);}logger[_0xb954('0x12')](_0xb954('0x10'),_0x53b04e,_0x55124e['error'][_0xb954('0x11')]);return _0x131861(_0x55124e[_0xb954('0x12')][_0xb954('0x11')]);}else{logger[_0xb954('0xa')]('ServicenowField,\x20%s,\x20%s',_0x53b04e,_0xb954('0xb'));_0x131861(_0x55124e[_0xb954('0x13')]['message']);}})['catch'](function(_0x598ec2){logger[_0xb954('0x12')]('ServicenowField,\x20%s,\x20%s',_0x53b04e,_0x598ec2);_0x4d1706(_0x598ec2);});});} \ No newline at end of file +var _0x8198=['error','message','ServicenowField,\x20%s,\x20%s','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x36a79c,_0x478fdd){var _0x7b198d=function(_0x5c952c){while(--_0x5c952c){_0x36a79c['push'](_0x36a79c['shift']());}};_0x7b198d(++_0x478fdd);}(_0x8198,0x198));var _0x8819=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x8198[_0x3817a9];return _0x443f30;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8819('0x0'));var rs=require(_0x8819('0x1'));var fs=require('fs');var Redis=require(_0x8819('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8819('0x3'));var config=require('../../config/environment');var jayson=require(_0x8819('0x4'));var client=jayson[_0x8819('0x5')][_0x8819('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1e8992,_0x3edb83,_0x106280){return new BPromise(function(_0x1d15c1,_0x18ae9e){return client[_0x8819('0x7')](_0x1e8992,_0x106280)['then'](function(_0x353876){logger[_0x8819('0x8')]('ServicenowField,\x20%s,\x20%s',_0x3edb83,_0x8819('0x9'));logger[_0x8819('0xa')](_0x8819('0xb'),_0x3edb83,_0x8819('0x9'),JSON['stringify'](_0x353876));if(_0x353876[_0x8819('0xc')]){if(_0x353876[_0x8819('0xc')]['code']===0x1f4){logger[_0x8819('0xc')]('ServicenowField,\x20%s,\x20%s',_0x3edb83,_0x353876['error'][_0x8819('0xd')]);return _0x18ae9e(_0x353876[_0x8819('0xc')][_0x8819('0xd')]);}logger[_0x8819('0xc')]('ServicenowField,\x20%s,\x20%s',_0x3edb83,_0x353876[_0x8819('0xc')][_0x8819('0xd')]);return _0x1d15c1(_0x353876[_0x8819('0xc')][_0x8819('0xd')]);}else{logger[_0x8819('0x8')](_0x8819('0xe'),_0x3edb83,_0x8819('0x9'));_0x1d15c1(_0x353876['result'][_0x8819('0xd')]);}})['catch'](function(_0x10551f){logger['error'](_0x8819('0xe'),_0x3edb83,_0x10551f);_0x18ae9e(_0x10551f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c9e7209..90a5cb8 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 _0x8b27=['../../config/environment','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x223a3f,_0x1f0236){var _0x28cf62=function(_0x2a9592){while(--_0x2a9592){_0x223a3f['push'](_0x223a3f['shift']());}};_0x28cf62(++_0x1f0236);}(_0x8b27,0x1ad));var _0x78b2=function(_0xc3ee2c,_0x301459){_0xc3ee2c=_0xc3ee2c-0x0;var _0x24925d=_0x8b27[_0xc3ee2c];return _0x24925d;};'use strict';var multer=require(_0x78b2('0x0'));var util=require(_0x78b2('0x1'));var path=require(_0x78b2('0x2'));var timeout=require(_0x78b2('0x3'));var express=require(_0x78b2('0x4'));var router=express[_0x78b2('0x5')]();var auth=require(_0x78b2('0x6'));var interaction=require(_0x78b2('0x7'));var config=require(_0x78b2('0x8'));var controller=require('./intSugarcrmAccount.controller');router[_0x78b2('0x9')]('/',auth[_0x78b2('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x78b2('0x9')](_0x78b2('0xb'),auth[_0x78b2('0xa')](),controller[_0x78b2('0xc')]);router[_0x78b2('0x9')](_0x78b2('0xd'),auth[_0x78b2('0xa')](),controller[_0x78b2('0xe')]);router[_0x78b2('0xf')]('/',auth[_0x78b2('0xa')](),controller[_0x78b2('0x10')]);router[_0x78b2('0xf')](_0x78b2('0xb'),auth[_0x78b2('0xa')](),controller[_0x78b2('0x11')]);router[_0x78b2('0x12')](_0x78b2('0x13'),auth['isAuthenticated'](),controller[_0x78b2('0x14')]);router[_0x78b2('0x15')](_0x78b2('0x13'),auth[_0x78b2('0xa')](),controller[_0x78b2('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6e76=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','delete'];(function(_0x4a9959,_0x32ff35){var _0x5b788e=function(_0xca151c){while(--_0xca151c){_0x4a9959['push'](_0x4a9959['shift']());}};_0x5b788e(++_0x32ff35);}(_0x6e76,0x86));var _0x66e7=function(_0x9b7386,_0x130ff1){_0x9b7386=_0x9b7386-0x0;var _0x3366db=_0x6e76[_0x9b7386];return _0x3366db;};'use strict';var multer=require(_0x66e7('0x0'));var util=require(_0x66e7('0x1'));var path=require(_0x66e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66e7('0x3'));var router=express[_0x66e7('0x4')]();var auth=require(_0x66e7('0x5'));var interaction=require(_0x66e7('0x6'));var config=require('../../config/environment');var controller=require(_0x66e7('0x7'));router[_0x66e7('0x8')]('/',auth[_0x66e7('0x9')](),controller[_0x66e7('0xa')]);router['get'](_0x66e7('0xb'),auth[_0x66e7('0x9')](),controller[_0x66e7('0xc')]);router[_0x66e7('0x8')](_0x66e7('0xd'),auth[_0x66e7('0x9')](),controller[_0x66e7('0xe')]);router['get'](_0x66e7('0xf'),auth[_0x66e7('0x9')](),controller['getFields']);router[_0x66e7('0x10')]('/',auth['isAuthenticated'](),controller[_0x66e7('0x11')]);router[_0x66e7('0x10')](_0x66e7('0xd'),auth[_0x66e7('0x9')](),controller[_0x66e7('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x66e7('0x13')](_0x66e7('0xb'),auth[_0x66e7('0x9')](),controller[_0x66e7('0x14')]);module[_0x66e7('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 cda0f07..2a694be 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 _0xac83=['username','remoteUri','sequelize','exports','STRING'];(function(_0x1df874,_0x283771){var _0x1672dc=function(_0xcf1431){while(--_0xcf1431){_0x1df874['push'](_0x1df874['shift']());}};_0x1672dc(++_0x283771);}(_0xac83,0xd9));var _0x3ac8=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xac83[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0x3ac8('0x0'));module[_0x3ac8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3ac8('0x2')]},'username':{'type':Sequelize[_0x3ac8('0x2')],'unique':_0x3ac8('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3ac8('0x2')],'unique':_0x3ac8('0x4')},'serverUrl':{'type':Sequelize[_0x3ac8('0x2')]}}; \ No newline at end of file +var _0x9c5b=['STRING','sequelize','exports'];(function(_0x363a40,_0x48feb8){var _0x55a7fa=function(_0x4230c3){while(--_0x4230c3){_0x363a40['push'](_0x363a40['shift']());}};_0x55a7fa(++_0x48feb8);}(_0x9c5b,0x127));var _0xb9c5=function(_0x23648b,_0x51a25f){_0x23648b=_0x23648b-0x0;var _0x2b5a63=_0x9c5b[_0x23648b];return _0x2b5a63;};'use strict';var Sequelize=require(_0xb9c5('0x0'));module[_0xb9c5('0x1')]={'name':{'type':Sequelize[_0xb9c5('0x2')]},'description':{'type':Sequelize[_0xb9c5('0x2')]},'username':{'type':Sequelize[_0xb9c5('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xb9c5('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb9c5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d747ba0..6c4c3ee 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 _0xec1d=['mustache','util','sox','to-csv','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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~!@#$%^&-_=+[{]}.','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','params','fields','length','find','create','body','findOne','SugarcrmConfiguration','pick','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','values','module_fields','remove','includes','label','endsWith','value','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x34c2d7,_0x116767){var _0x29674d=function(_0x20fd58){while(--_0x20fd58){_0x34c2d7['push'](_0x34c2d7['shift']());}};_0x29674d(++_0x116767);}(_0xec1d,0x7c));var _0xdec1=function(_0x24ccda,_0x1c3018){_0x24ccda=_0x24ccda-0x0;var _0x383213=_0xec1d[_0x24ccda];return _0x383213;};'use strict';var pdf=require(_0xdec1('0x0'));var emlformat=require(_0xdec1('0x1'));var rimraf=require(_0xdec1('0x2'));var zipdir=require(_0xdec1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdec1('0x4'));var moment=require(_0xdec1('0x5'));var BPromise=require(_0xdec1('0x6'));var Mustache=require(_0xdec1('0x7'));var util=require(_0xdec1('0x8'));var path=require('path');var sox=require(_0xdec1('0x9'));var csv=require(_0xdec1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdec1('0xb'));var crypto=require('crypto');var jsforce=require(_0xdec1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdec1('0xd'));var Redis=require(_0xdec1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdec1('0xf'));var as=require(_0xdec1('0x10'));var hardwareService=require(_0xdec1('0x11'));var logger=require(_0xdec1('0x12'))(_0xdec1('0x13'));var utils=require(_0xdec1('0x14'));var config=require('../../config/environment');var db=require(_0xdec1('0x15'))['db'];var integrations=require(_0xdec1('0x16'));var jayson=require(_0xdec1('0x17'));var client=jayson[_0xdec1('0x18')][_0xdec1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2c30e8,_0x191dc7,_0x4ec36e){if(_0x4ec36e){var _0x48d457=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48d457[_0xdec1('0x1a')](_0x191dc7)){return _0x2c30e8;}else{throw new db['Sequelize'][(_0xdec1('0x1b'))](_0xdec1('0x1c'));}}else{return _0x2c30e8;}}function respondWithRpcPromise(_0xb9244a,_0x35fefd,_0x29aaec,_0x11e1ab){return new BPromise(function(_0x1b5162,_0x223019){var _0x271a7f=_0x11e1ab||client;return _0x271a7f['request'](_0xb9244a,_0x29aaec)['then'](function(_0x374e89){logger[_0xdec1('0x1d')](_0xdec1('0x1e'),_0x35fefd,'request\x20sent');logger[_0xdec1('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x35fefd,'request\x20sent',JSON[_0xdec1('0x20')](_0x374e89));if(_0x374e89[_0xdec1('0x21')]){if(_0x374e89[_0xdec1('0x21')][_0xdec1('0x22')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x35fefd,_0x374e89[_0xdec1('0x21')][_0xdec1('0x23')]);return _0x223019(_0x374e89[_0xdec1('0x21')]['message']);}logger['error'](_0xdec1('0x1e'),_0x35fefd,_0x374e89[_0xdec1('0x21')]['message']);return _0x1b5162(_0x374e89[_0xdec1('0x21')][_0xdec1('0x23')]);}else{logger[_0xdec1('0x1d')](_0xdec1('0x1e'),_0x35fefd,_0xdec1('0x24'));_0x1b5162(_0x374e89['result'][_0xdec1('0x23')]);}})[_0xdec1('0x25')](function(_0x182146){logger[_0xdec1('0x21')](_0xdec1('0x1e'),_0x35fefd,_0x182146);_0x223019(_0x182146);});});}function respondWithStatusCode(_0x5f15d7,_0xc25456){_0xc25456=_0xc25456||0xcc;return function(_0x2e858c){if(_0x2e858c){return _0x5f15d7[_0xdec1('0x26')](_0xc25456);}return _0x5f15d7[_0xdec1('0x27')](_0xc25456)[_0xdec1('0x28')]();};}function respondWithResult(_0x28f2b3,_0xa25f81){_0xa25f81=_0xa25f81||0xc8;return function(_0x25bdc9){if(_0x25bdc9){return _0x28f2b3['status'](_0xa25f81)[_0xdec1('0x29')](_0x25bdc9);}};}function respondWithFilteredResult(_0x592a7f,_0x77089c){return function(_0x425a1f){if(_0x425a1f){var _0x4e8858=_0x425a1f['count'],_0x4afbd1=_0x77089c[_0xdec1('0x2a')],_0x2ea547=_0x77089c[_0xdec1('0x2a')]+_0x77089c[_0xdec1('0x2b')],_0x5b19b9;if(_0x2ea547>=_0x4e8858){_0x2ea547=_0x4e8858;_0x5b19b9=0xc8;}else{_0x5b19b9=0xce;}_0x592a7f[_0xdec1('0x27')](_0x5b19b9);return _0x592a7f[_0xdec1('0x2c')](_0xdec1('0x2d'),_0x4afbd1+'-'+_0x2ea547+'/'+_0x4e8858)[_0xdec1('0x29')](_0x425a1f);}return null;};}function patchUpdates(_0x434185){return function(_0x32c699){try{jsonpatch[_0xdec1('0x2e')](_0x32c699,_0x434185,!![]);}catch(_0x23812b){return BPromise[_0xdec1('0x2f')](_0x23812b);}return _0x32c699[_0xdec1('0x30')]();};}function saveUpdates(_0x1a1806,_0x554aae){return function(_0x5c1ddb){if(_0x5c1ddb){return _0x5c1ddb['update'](_0x1a1806)[_0xdec1('0x31')](function(_0x181fcf){return _0x181fcf;});}return null;};}function removeEntity(_0x33b25a,_0x4817f9){return function(_0x5b583c){if(_0x5b583c){return _0x5b583c[_0xdec1('0x32')]()[_0xdec1('0x31')](function(){_0x33b25a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1501b2,_0x162dbc){return function(_0x5345d4){if(!_0x5345d4){_0x1501b2['sendStatus'](0x194);}return _0x5345d4;};}function handleError(_0x172dd9,_0x2523ac){_0x2523ac=_0x2523ac||0x1f4;return function(_0x2f704b){logger[_0xdec1('0x21')](_0x2f704b[_0xdec1('0x33')]);if(_0x2f704b['name']){delete _0x2f704b[_0xdec1('0x34')];}_0x172dd9[_0xdec1('0x27')](_0x2523ac)[_0xdec1('0x35')](_0x2f704b);};}exports[_0xdec1('0x36')]=function(_0x5e68d8,_0x549994){var _0x16fadf={},_0x1c209d={},_0x2b781e={'count':0x0,'rows':[]};var _0x3e80c4=_[_0xdec1('0x37')](db[_0xdec1('0x38')][_0xdec1('0x39')],function(_0x413783){return{'name':_0x413783[_0xdec1('0x3a')],'type':_0x413783['type']['key']};});_0x1c209d[_0xdec1('0x3b')]=_[_0xdec1('0x37')](_0x3e80c4,_0xdec1('0x34'));_0x1c209d[_0xdec1('0x3c')]=_[_0xdec1('0x3d')](_0x5e68d8['query']);_0x1c209d[_0xdec1('0x3e')]=_[_0xdec1('0x3f')](_0x1c209d[_0xdec1('0x3b')],_0x1c209d[_0xdec1('0x3c')]);_0x16fadf['attributes']=_[_0xdec1('0x3f')](_0x1c209d[_0xdec1('0x3b')],qs['fields'](_0x5e68d8[_0xdec1('0x3c')]['fields']));_0x16fadf[_0xdec1('0x40')]=_0x16fadf[_0xdec1('0x40')]['length']?_0x16fadf[_0xdec1('0x40')]:_0x1c209d[_0xdec1('0x3b')];if(!_0x5e68d8[_0xdec1('0x3c')][_0xdec1('0x41')]('nolimit')){_0x16fadf[_0xdec1('0x2b')]=qs[_0xdec1('0x2b')](_0x5e68d8['query'][_0xdec1('0x2b')]);_0x16fadf[_0xdec1('0x2a')]=qs[_0xdec1('0x2a')](_0x5e68d8[_0xdec1('0x3c')][_0xdec1('0x2a')]);}_0x16fadf[_0xdec1('0x42')]=qs[_0xdec1('0x43')](_0x5e68d8[_0xdec1('0x3c')]['sort']);_0x16fadf[_0xdec1('0x44')]=qs[_0xdec1('0x3e')](_['pick'](_0x5e68d8[_0xdec1('0x3c')],_0x1c209d[_0xdec1('0x3e')]),_0x3e80c4);if(_0x5e68d8[_0xdec1('0x3c')][_0xdec1('0x45')]){_0x16fadf[_0xdec1('0x44')]=_['merge'](_0x16fadf[_0xdec1('0x44')],{'$or':_[_0xdec1('0x37')](_0x3e80c4,function(_0x19d924){if(_0x19d924[_0xdec1('0x46')]!==_0xdec1('0x47')){var _0x5627f1={};_0x5627f1[_0x19d924[_0xdec1('0x34')]]={'$like':'%'+_0x5e68d8['query']['filter']+'%'};return _0x5627f1;}})});}_0x16fadf=_[_0xdec1('0x48')]({},_0x16fadf,_0x5e68d8[_0xdec1('0x49')]);var _0x196c3b={'where':_0x16fadf[_0xdec1('0x44')]};return db[_0xdec1('0x38')][_0xdec1('0x4a')](_0x196c3b)[_0xdec1('0x31')](function(_0x5a61a8){_0x2b781e[_0xdec1('0x4a')]=_0x5a61a8;if(_0x5e68d8[_0xdec1('0x3c')][_0xdec1('0x4b')]){_0x16fadf[_0xdec1('0x4c')]=[{'all':!![]}];}return db[_0xdec1('0x38')][_0xdec1('0x4d')](_0x16fadf);})[_0xdec1('0x31')](function(_0x4d63a4){_0x2b781e[_0xdec1('0x4e')]=_0x4d63a4;return _0x2b781e;})['then'](respondWithFilteredResult(_0x549994,_0x16fadf))[_0xdec1('0x25')](handleError(_0x549994,null));};exports['show']=function(_0x448811,_0xc85144){var _0x4f3b67={'raw':![],'where':{'id':_0x448811[_0xdec1('0x4f')]['id']}},_0xb1283d={};_0xb1283d[_0xdec1('0x3b')]=_[_0xdec1('0x3d')](db[_0xdec1('0x38')][_0xdec1('0x39')]);_0xb1283d[_0xdec1('0x3c')]=_[_0xdec1('0x3d')](_0x448811[_0xdec1('0x3c')]);_0xb1283d[_0xdec1('0x3e')]=_['intersection'](_0xb1283d[_0xdec1('0x3b')],_0xb1283d[_0xdec1('0x3c')]);_0x4f3b67[_0xdec1('0x40')]=_[_0xdec1('0x3f')](_0xb1283d[_0xdec1('0x3b')],qs[_0xdec1('0x50')](_0x448811[_0xdec1('0x3c')][_0xdec1('0x50')]));_0x4f3b67[_0xdec1('0x40')]=_0x4f3b67[_0xdec1('0x40')][_0xdec1('0x51')]?_0x4f3b67[_0xdec1('0x40')]:_0xb1283d[_0xdec1('0x3b')];if(_0x448811[_0xdec1('0x3c')][_0xdec1('0x4b')]){_0x4f3b67['include']=[{'all':!![]}];}_0x4f3b67=_[_0xdec1('0x48')]({},_0x4f3b67,_0x448811['options']);return db['SugarcrmAccount'][_0xdec1('0x52')](_0x4f3b67)[_0xdec1('0x31')](handleEntityNotFound(_0xc85144,null))['then'](respondWithResult(_0xc85144,null))['catch'](handleError(_0xc85144,null));};exports[_0xdec1('0x53')]=function(_0x3f2cdb,_0x2d57a4){return db[_0xdec1('0x38')][_0xdec1('0x53')](_0x3f2cdb['body'],{})[_0xdec1('0x31')](respondWithResult(_0x2d57a4,0xc9))[_0xdec1('0x25')](handleError(_0x2d57a4,null));};exports['update']=function(_0x2a3246,_0x2c24b6){if(_0x2a3246[_0xdec1('0x54')]['id']){delete _0x2a3246[_0xdec1('0x54')]['id'];}return db[_0xdec1('0x38')][_0xdec1('0x52')]({'where':{'id':_0x2a3246['params']['id']}})[_0xdec1('0x31')](handleEntityNotFound(_0x2c24b6,null))[_0xdec1('0x31')](saveUpdates(_0x2a3246[_0xdec1('0x54')],null))['then'](respondWithResult(_0x2c24b6,null))['catch'](handleError(_0x2c24b6,null));};exports[_0xdec1('0x32')]=function(_0x17737e,_0xde0c9c){return db[_0xdec1('0x38')][_0xdec1('0x52')]({'where':{'id':_0x17737e[_0xdec1('0x4f')]['id']}})[_0xdec1('0x31')](handleEntityNotFound(_0xde0c9c,null))[_0xdec1('0x31')](removeEntity(_0xde0c9c,null))[_0xdec1('0x25')](handleError(_0xde0c9c,null));};exports['getConfigurations']=function(_0x22a519,_0x25e292,_0x2b130c){var _0x1fd1ef={};var _0x39dd28={};var _0x241d48;var _0x4b8f92;return db[_0xdec1('0x38')][_0xdec1('0x55')]({'where':{'id':_0x22a519[_0xdec1('0x4f')]['id']}})['then'](handleEntityNotFound(_0x25e292,null))[_0xdec1('0x31')](function(_0x13fe16){if(_0x13fe16){_0x241d48=_0x13fe16;_0x39dd28[_0xdec1('0x3b')]=_['keys'](db[_0xdec1('0x56')]['rawAttributes']);_0x39dd28[_0xdec1('0x3c')]=_[_0xdec1('0x3d')](_0x22a519[_0xdec1('0x3c')]);_0x39dd28['filters']=_[_0xdec1('0x3f')](_0x39dd28[_0xdec1('0x3b')],_0x39dd28[_0xdec1('0x3c')]);_0x1fd1ef[_0xdec1('0x40')]=_[_0xdec1('0x3f')](_0x39dd28['model'],qs['fields'](_0x22a519['query']['fields']));_0x1fd1ef[_0xdec1('0x40')]=_0x1fd1ef[_0xdec1('0x40')][_0xdec1('0x51')]?_0x1fd1ef[_0xdec1('0x40')]:_0x39dd28[_0xdec1('0x3b')];_0x1fd1ef[_0xdec1('0x42')]=qs['sort'](_0x22a519['query']['sort']);_0x1fd1ef[_0xdec1('0x44')]=qs[_0xdec1('0x3e')](_[_0xdec1('0x57')](_0x22a519[_0xdec1('0x3c')],_0x39dd28[_0xdec1('0x3e')]));if(_0x22a519[_0xdec1('0x3c')][_0xdec1('0x45')]){_0x1fd1ef[_0xdec1('0x44')]=_[_0xdec1('0x48')](_0x1fd1ef[_0xdec1('0x44')],{'$or':_[_0xdec1('0x37')](_0x1fd1ef[_0xdec1('0x40')],function(_0x4dc4f5){var _0x39ecbc={};_0x39ecbc[_0x4dc4f5]={'$like':'%'+_0x22a519['query'][_0xdec1('0x45')]+'%'};return _0x39ecbc;})});}_0x1fd1ef=_[_0xdec1('0x48')]({},_0x1fd1ef,_0x22a519['options']);return _0x241d48[_0xdec1('0x58')](_0x1fd1ef);}})[_0xdec1('0x31')](function(_0x415f80){if(_0x415f80){_0x4b8f92=_0x415f80[_0xdec1('0x51')];if(!_0x22a519[_0xdec1('0x3c')]['hasOwnProperty'](_0xdec1('0x59'))){_0x1fd1ef[_0xdec1('0x2b')]=qs[_0xdec1('0x2b')](_0x22a519[_0xdec1('0x3c')]['limit']);_0x1fd1ef[_0xdec1('0x2a')]=qs['offset'](_0x22a519['query'][_0xdec1('0x2a')]);}return _0x241d48[_0xdec1('0x58')](_0x1fd1ef);}})[_0xdec1('0x31')](function(_0x3d8eab){if(_0x3d8eab){return _0x3d8eab?{'count':_0x4b8f92,'rows':_0x3d8eab}:null;}})[_0xdec1('0x31')](respondWithResult(_0x25e292,null))['catch'](handleError(_0x25e292,null));};exports[_0xdec1('0x5a')]=function(_0x59637e,_0x589a84,_0x40ec2d){if(_0x59637e['body']['id']){delete _0x59637e[_0xdec1('0x54')]['id'];}return db[_0xdec1('0x38')]['findOne']({'where':{'id':_0x59637e[_0xdec1('0x4f')]['id']}})[_0xdec1('0x31')](handleEntityNotFound(_0x589a84,null))[_0xdec1('0x31')](function(_0x52d162){if(_0x52d162){_0x59637e[_0xdec1('0x54')][_0xdec1('0x5b')]=_0x52d162['id'];_0x59637e[_0xdec1('0x54')]['Subjects']=integrations[_0xdec1('0x5c')](_0x59637e[_0xdec1('0x54')][_0xdec1('0x5d')],_0x59637e['body'][_0xdec1('0x46')]);_0x59637e[_0xdec1('0x54')][_0xdec1('0x5e')]=integrations[_0xdec1('0x5f')](_0x59637e[_0xdec1('0x54')][_0xdec1('0x5d')],_0x59637e[_0xdec1('0x54')]['type']);return db['SugarcrmConfiguration'][_0xdec1('0x53')](_0x59637e['body'],{'include':[{'model':db[_0xdec1('0x60')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xdec1('0x5e')}]});}return null;})[_0xdec1('0x31')](respondWithResult(_0x589a84,null))[_0xdec1('0x25')](handleError(_0x589a84,null));};exports[_0xdec1('0x61')]=function(_0x5a9d73,_0x1829d8,_0x5ba384){var _0x37887c='';var _0x273422=['id',_0xdec1('0x34'),_0xdec1('0x62'),_0xdec1('0x63'),_0xdec1('0x64'),_0xdec1('0x65'),_0xdec1('0x66'),_0xdec1('0x67'),_0xdec1('0x68'),_0xdec1('0x69'),_0xdec1('0x6a'),_0xdec1('0x6b')];return db[_0xdec1('0x38')][_0xdec1('0x55')]({'where':{'id':_0x5a9d73[_0xdec1('0x4f')]['id']},'attributes':['id',_0xdec1('0x6c'),_0xdec1('0x6d'),_0xdec1('0x6e')]})[_0xdec1('0x31')](handleEntityNotFound(_0x1829d8,null))[_0xdec1('0x31')](function(_0x22277d){if(_0x22277d){_0x37887c=_0x22277d[_0xdec1('0x6e')];var _0x4465e4=_0x37887c[_0xdec1('0x6f')](-0x1);if(_0x4465e4==='/'){_0x37887c=_0x37887c[_0xdec1('0x70')](0x0,_0x37887c['lastIndexOf'](_0x4465e4));}return rp({'method':'POST','uri':util[_0xdec1('0x71')](_0xdec1('0x72'),_0x37887c,_0xdec1('0x73')),'json':!![],'form':{'method':_0xdec1('0x74'),'input_type':_0xdec1('0x75'),'response_type':_0xdec1('0x75'),'rest_data':JSON[_0xdec1('0x20')]({'user_auth':{'user_name':_0x22277d[_0xdec1('0x6c')],'password':_0x22277d[_0xdec1('0x6d')],'encryption':_0xdec1('0x76')},'application':_0xdec1('0x77')})}});}})[_0xdec1('0x31')](function(_0x22db4d){if(_0x22db4d&&_0x22db4d[_0xdec1('0x34')]!==_0xdec1('0x78')&&_0x22db4d['name']!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xdec1('0x71')](_0xdec1('0x72'),_0x37887c,_0xdec1('0x73')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xdec1('0x75'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x22db4d['id'],'module_name':'Calls'})}})[_0xdec1('0x31')](function(_0x272863){if(_0x272863){var _0x112074=_[_0xdec1('0x79')](_0x272863[_0xdec1('0x7a')]);_[_0xdec1('0x7b')](_0x112074,function(_0x4f1fe6){return _0x273422[_0xdec1('0x7c')](_0x4f1fe6[_0xdec1('0x34')]);});return{'count':_0x112074[_0xdec1('0x51')],'rows':_[_0xdec1('0x37')](_0x112074,function(_0x4fb54b){return{'id':_0x4fb54b[_0xdec1('0x34')],'name':_0x4fb54b[_0xdec1('0x7d')],'custom':_[_0xdec1('0x7e')](_0x4fb54b[_0xdec1('0x34')],'_c')?!![]:![],'options':_0x4fb54b[_0xdec1('0x49')]?_[_0xdec1('0x37')](_[_0xdec1('0x79')](_0x4fb54b[_0xdec1('0x49')]),function(_0x3b230f){return{'name':_0x3b230f[_0xdec1('0x7f')],'value':_0x3b230f['name']};}):[]};})};}})[_0xdec1('0x31')](respondWithResult(_0x1829d8,null))[_0xdec1('0x25')](function(_0x89ce8a){var _0x4a1337=_0x5a9d73[_0xdec1('0x3c')]['test']?0x1f4:_0x89ce8a['statusCode']||0x1f4;logger[_0xdec1('0x21')](_0xdec1('0x80'),_0xdec1('0x61'),_0x4a1337,JSON[_0xdec1('0x20')](_0x89ce8a));delete _0x89ce8a[_0xdec1('0x34')];if(_0x4a1337===0x191){_0x4a1337=0x190;}_0x1829d8['status'](_0x4a1337)[_0xdec1('0x35')](_0x5a9d73[_0xdec1('0x3c')][_0xdec1('0x1a')]?{'message':_0xdec1('0x81'),'statusCode':_0x89ce8a[_0xdec1('0x82')]}:_0x89ce8a);});}else{var _0x199a00=0x1f4;_0x1829d8[_0xdec1('0x27')](_0x199a00)[_0xdec1('0x35')]({'message':_0xdec1('0x81'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa848=['debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','show','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','pick','findOne','AccountId','channel','getDescriptions','SugarcrmField','Descriptions','getFields','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','includes','label','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../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','request\x20sent'];(function(_0x5e71a9,_0x3c8fe8){var _0x2240df=function(_0x1b1a4d){while(--_0x1b1a4d){_0x5e71a9['push'](_0x5e71a9['shift']());}};_0x2240df(++_0x3c8fe8);}(_0xa848,0x169));var _0x8a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa848[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x8a84('0x0'));var emlformat=require(_0x8a84('0x1'));var rimraf=require(_0x8a84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a84('0x3'));var rp=require(_0x8a84('0x4'));var moment=require(_0x8a84('0x5'));var BPromise=require(_0x8a84('0x6'));var Mustache=require(_0x8a84('0x7'));var util=require(_0x8a84('0x8'));var path=require(_0x8a84('0x9'));var sox=require(_0x8a84('0xa'));var csv=require(_0x8a84('0xb'));var ejs=require(_0x8a84('0xc'));var fs=require('fs');var _=require(_0x8a84('0xd'));var squel=require('squel');var crypto=require(_0x8a84('0xe'));var jsforce=require(_0x8a84('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8a84('0xb'));var querystring=require('querystring');var Papa=require(_0x8a84('0x10'));var Redis=require(_0x8a84('0x11'));var authService=require(_0x8a84('0x12'));var qs=require(_0x8a84('0x13'));var as=require(_0x8a84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a84('0x15'))(_0x8a84('0x16'));var utils=require(_0x8a84('0x17'));var config=require('../../config/environment');var db=require(_0x8a84('0x18'))['db'];var integrations=require(_0x8a84('0x19'));var jayson=require(_0x8a84('0x1a'));var client=jayson[_0x8a84('0x1b')][_0x8a84('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x6e279e,_0x2bfcf6,_0x52d654){if(_0x52d654){var _0x4301a1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4301a1['test'](_0x2bfcf6)){return _0x6e279e;}else{throw new db[(_0x8a84('0x1d'))][(_0x8a84('0x1e'))](_0x8a84('0x1f'));}}else{return _0x6e279e;}}function respondWithRpcPromise(_0x4b09b2,_0x31aedf,_0x152a39,_0x178129){return new BPromise(function(_0x4fed07,_0x4df547){var _0x287cea=_0x178129||client;return _0x287cea[_0x8a84('0x20')](_0x4b09b2,_0x152a39)['then'](function(_0x356460){logger[_0x8a84('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x31aedf,_0x8a84('0x22'));logger[_0x8a84('0x23')](_0x8a84('0x24'),_0x31aedf,_0x8a84('0x22'),JSON[_0x8a84('0x25')](_0x356460));if(_0x356460[_0x8a84('0x26')]){if(_0x356460['error']['code']===0x1f4){logger[_0x8a84('0x26')]('SugarcrmAccount,\x20%s,\x20%s',_0x31aedf,_0x356460['error'][_0x8a84('0x27')]);return _0x4df547(_0x356460['error'][_0x8a84('0x27')]);}logger[_0x8a84('0x26')](_0x8a84('0x28'),_0x31aedf,_0x356460[_0x8a84('0x26')][_0x8a84('0x27')]);return _0x4fed07(_0x356460[_0x8a84('0x26')][_0x8a84('0x27')]);}else{logger[_0x8a84('0x21')](_0x8a84('0x28'),_0x31aedf,_0x8a84('0x22'));_0x4fed07(_0x356460[_0x8a84('0x29')][_0x8a84('0x27')]);}})[_0x8a84('0x2a')](function(_0x4abd7c){logger[_0x8a84('0x26')]('SugarcrmAccount,\x20%s,\x20%s',_0x31aedf,_0x4abd7c);_0x4df547(_0x4abd7c);});});}function respondWithStatusCode(_0x44f4c6,_0x3a329b){_0x3a329b=_0x3a329b||0xcc;return function(_0x51c151){if(_0x51c151){return _0x44f4c6[_0x8a84('0x2b')](_0x3a329b);}return _0x44f4c6[_0x8a84('0x2c')](_0x3a329b)[_0x8a84('0x2d')]();};}function respondWithResult(_0x876dc8,_0x5ded84){_0x5ded84=_0x5ded84||0xc8;return function(_0x57c9c9){if(_0x57c9c9){return _0x876dc8[_0x8a84('0x2c')](_0x5ded84)[_0x8a84('0x2e')](_0x57c9c9);}};}function respondWithFilteredResult(_0x170bd6,_0x8a571f){return function(_0x3eba6e){if(_0x3eba6e){var _0x27bf55=_0x3eba6e[_0x8a84('0x2f')],_0x1178ab=_0x8a571f['offset'],_0x3c24f7=_0x8a571f[_0x8a84('0x30')]+_0x8a571f[_0x8a84('0x31')],_0x5614e3;if(_0x3c24f7>=_0x27bf55){_0x3c24f7=_0x27bf55;_0x5614e3=0xc8;}else{_0x5614e3=0xce;}_0x170bd6[_0x8a84('0x2c')](_0x5614e3);return _0x170bd6[_0x8a84('0x32')](_0x8a84('0x33'),_0x1178ab+'-'+_0x3c24f7+'/'+_0x27bf55)[_0x8a84('0x2e')](_0x3eba6e);}return null;};}function patchUpdates(_0x2c78c5){return function(_0x25ef19){try{jsonpatch[_0x8a84('0x34')](_0x25ef19,_0x2c78c5,!![]);}catch(_0x437345){return BPromise[_0x8a84('0x35')](_0x437345);}return _0x25ef19[_0x8a84('0x36')]();};}function saveUpdates(_0x22a6e9,_0x9b2f6f){return function(_0x20550b){if(_0x20550b){return _0x20550b[_0x8a84('0x37')](_0x22a6e9)[_0x8a84('0x38')](function(_0x1d65c4){return _0x1d65c4;});}return null;};}function removeEntity(_0xe660f7,_0x3a8ac2){return function(_0x1845c5){if(_0x1845c5){return _0x1845c5['destroy']()[_0x8a84('0x38')](function(){_0xe660f7['status'](0xcc)[_0x8a84('0x2d')]();});}};}function handleEntityNotFound(_0xf1e024,_0x5145d2){return function(_0x19e0bf){if(!_0x19e0bf){_0xf1e024[_0x8a84('0x2b')](0x194);}return _0x19e0bf;};}function handleError(_0x1151e6,_0x4ad27c){_0x4ad27c=_0x4ad27c||0x1f4;return function(_0x5e4e70){logger[_0x8a84('0x26')](_0x5e4e70[_0x8a84('0x39')]);if(_0x5e4e70[_0x8a84('0x3a')]){delete _0x5e4e70[_0x8a84('0x3a')];}_0x1151e6[_0x8a84('0x2c')](_0x4ad27c)[_0x8a84('0x3b')](_0x5e4e70);};}exports[_0x8a84('0x3c')]=function(_0x5ae3d5,_0x4a2614){var _0x1a13b3={},_0x3cac22={},_0xc4731a={'count':0x0,'rows':[]};var _0x463b99=_[_0x8a84('0x3d')](db[_0x8a84('0x3e')][_0x8a84('0x3f')],function(_0x3b46b4){return{'name':_0x3b46b4[_0x8a84('0x40')],'type':_0x3b46b4[_0x8a84('0x41')][_0x8a84('0x42')]};});_0x3cac22['model']=_['map'](_0x463b99,_0x8a84('0x3a'));_0x3cac22[_0x8a84('0x43')]=_[_0x8a84('0x44')](_0x5ae3d5[_0x8a84('0x43')]);_0x3cac22[_0x8a84('0x45')]=_[_0x8a84('0x46')](_0x3cac22[_0x8a84('0x47')],_0x3cac22['query']);_0x1a13b3['attributes']=_[_0x8a84('0x46')](_0x3cac22[_0x8a84('0x47')],qs[_0x8a84('0x48')](_0x5ae3d5[_0x8a84('0x43')][_0x8a84('0x48')]));_0x1a13b3['attributes']=_0x1a13b3[_0x8a84('0x49')][_0x8a84('0x4a')]?_0x1a13b3[_0x8a84('0x49')]:_0x3cac22['model'];if(!_0x5ae3d5[_0x8a84('0x43')][_0x8a84('0x4b')](_0x8a84('0x4c'))){_0x1a13b3[_0x8a84('0x31')]=qs['limit'](_0x5ae3d5[_0x8a84('0x43')][_0x8a84('0x31')]);_0x1a13b3[_0x8a84('0x30')]=qs[_0x8a84('0x30')](_0x5ae3d5['query'][_0x8a84('0x30')]);}_0x1a13b3['order']=qs['sort'](_0x5ae3d5[_0x8a84('0x43')][_0x8a84('0x4d')]);_0x1a13b3['where']=qs['filters'](_['pick'](_0x5ae3d5[_0x8a84('0x43')],_0x3cac22['filters']),_0x463b99);if(_0x5ae3d5['query'][_0x8a84('0x4e')]){_0x1a13b3[_0x8a84('0x4f')]=_[_0x8a84('0x50')](_0x1a13b3[_0x8a84('0x4f')],{'$or':_['map'](_0x463b99,function(_0x7de2eb){if(_0x7de2eb[_0x8a84('0x41')]!==_0x8a84('0x51')){var _0x19b6cf={};_0x19b6cf[_0x7de2eb['name']]={'$like':'%'+_0x5ae3d5['query'][_0x8a84('0x4e')]+'%'};return _0x19b6cf;}})});}_0x1a13b3=_['merge']({},_0x1a13b3,_0x5ae3d5[_0x8a84('0x52')]);var _0x995765={'where':_0x1a13b3[_0x8a84('0x4f')]};return db[_0x8a84('0x3e')][_0x8a84('0x2f')](_0x995765)[_0x8a84('0x38')](function(_0x3318be){_0xc4731a[_0x8a84('0x2f')]=_0x3318be;if(_0x5ae3d5[_0x8a84('0x43')][_0x8a84('0x53')]){_0x1a13b3['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x1a13b3);})[_0x8a84('0x38')](function(_0x4418d9){_0xc4731a[_0x8a84('0x54')]=_0x4418d9;return _0xc4731a;})[_0x8a84('0x38')](respondWithFilteredResult(_0x4a2614,_0x1a13b3))[_0x8a84('0x2a')](handleError(_0x4a2614,null));};exports[_0x8a84('0x55')]=function(_0x348651,_0x4ea096){var _0x3053a0={'raw':![],'where':{'id':_0x348651['params']['id']}},_0x7d11c0={};_0x7d11c0['model']=_[_0x8a84('0x44')](db[_0x8a84('0x3e')][_0x8a84('0x3f')]);_0x7d11c0[_0x8a84('0x43')]=_[_0x8a84('0x44')](_0x348651['query']);_0x7d11c0[_0x8a84('0x45')]=_['intersection'](_0x7d11c0['model'],_0x7d11c0[_0x8a84('0x43')]);_0x3053a0[_0x8a84('0x49')]=_[_0x8a84('0x46')](_0x7d11c0[_0x8a84('0x47')],qs['fields'](_0x348651[_0x8a84('0x43')][_0x8a84('0x48')]));_0x3053a0[_0x8a84('0x49')]=_0x3053a0[_0x8a84('0x49')][_0x8a84('0x4a')]?_0x3053a0['attributes']:_0x7d11c0[_0x8a84('0x47')];if(_0x348651['query']['includeAll']){_0x3053a0['include']=[{'all':!![]}];}_0x3053a0=_['merge']({},_0x3053a0,_0x348651[_0x8a84('0x52')]);return db[_0x8a84('0x3e')]['find'](_0x3053a0)[_0x8a84('0x38')](handleEntityNotFound(_0x4ea096,null))[_0x8a84('0x38')](respondWithResult(_0x4ea096,null))['catch'](handleError(_0x4ea096,null));};exports['create']=function(_0xfe67c0,_0x269264){return db[_0x8a84('0x3e')][_0x8a84('0x56')](_0xfe67c0[_0x8a84('0x57')],{})[_0x8a84('0x38')](respondWithResult(_0x269264,0xc9))[_0x8a84('0x2a')](handleError(_0x269264,null));};exports[_0x8a84('0x37')]=function(_0x734e0e,_0x4d5afb){if(_0x734e0e[_0x8a84('0x57')]['id']){delete _0x734e0e[_0x8a84('0x57')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x734e0e[_0x8a84('0x58')]['id']}})[_0x8a84('0x38')](handleEntityNotFound(_0x4d5afb,null))['then'](saveUpdates(_0x734e0e['body'],null))[_0x8a84('0x38')](respondWithResult(_0x4d5afb,null))[_0x8a84('0x2a')](handleError(_0x4d5afb,null));};exports[_0x8a84('0x59')]=function(_0x1046ac,_0x59ea55){return db[_0x8a84('0x3e')]['find']({'where':{'id':_0x1046ac[_0x8a84('0x58')]['id']}})[_0x8a84('0x38')](handleEntityNotFound(_0x59ea55,null))['then'](removeEntity(_0x59ea55,null))[_0x8a84('0x2a')](handleError(_0x59ea55,null));};exports[_0x8a84('0x5a')]=function(_0x154ac8,_0x11a7f5,_0x8d00d5){var _0x477c3f={};var _0x5cde26={};var _0x33125e;var _0x76a806;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x154ac8[_0x8a84('0x58')]['id']}})[_0x8a84('0x38')](handleEntityNotFound(_0x11a7f5,null))[_0x8a84('0x38')](function(_0x349e6f){if(_0x349e6f){_0x33125e=_0x349e6f;_0x5cde26[_0x8a84('0x47')]=_[_0x8a84('0x44')](db[_0x8a84('0x5b')]['rawAttributes']);_0x5cde26[_0x8a84('0x43')]=_['keys'](_0x154ac8[_0x8a84('0x43')]);_0x5cde26[_0x8a84('0x45')]=_[_0x8a84('0x46')](_0x5cde26[_0x8a84('0x47')],_0x5cde26[_0x8a84('0x43')]);_0x477c3f[_0x8a84('0x49')]=_['intersection'](_0x5cde26[_0x8a84('0x47')],qs[_0x8a84('0x48')](_0x154ac8['query'][_0x8a84('0x48')]));_0x477c3f[_0x8a84('0x49')]=_0x477c3f[_0x8a84('0x49')][_0x8a84('0x4a')]?_0x477c3f[_0x8a84('0x49')]:_0x5cde26[_0x8a84('0x47')];_0x477c3f['order']=qs[_0x8a84('0x4d')](_0x154ac8[_0x8a84('0x43')][_0x8a84('0x4d')]);_0x477c3f[_0x8a84('0x4f')]=qs[_0x8a84('0x45')](_[_0x8a84('0x5c')](_0x154ac8['query'],_0x5cde26['filters']));if(_0x154ac8[_0x8a84('0x43')][_0x8a84('0x4e')]){_0x477c3f[_0x8a84('0x4f')]=_[_0x8a84('0x50')](_0x477c3f['where'],{'$or':_['map'](_0x477c3f[_0x8a84('0x49')],function(_0x5b0fbe){var _0x34d3e6={};_0x34d3e6[_0x5b0fbe]={'$like':'%'+_0x154ac8[_0x8a84('0x43')][_0x8a84('0x4e')]+'%'};return _0x34d3e6;})});}_0x477c3f=_[_0x8a84('0x50')]({},_0x477c3f,_0x154ac8[_0x8a84('0x52')]);return _0x33125e[_0x8a84('0x5a')](_0x477c3f);}})[_0x8a84('0x38')](function(_0x1cdb49){if(_0x1cdb49){_0x76a806=_0x1cdb49[_0x8a84('0x4a')];if(!_0x154ac8['query']['hasOwnProperty'](_0x8a84('0x4c'))){_0x477c3f[_0x8a84('0x31')]=qs[_0x8a84('0x31')](_0x154ac8[_0x8a84('0x43')][_0x8a84('0x31')]);_0x477c3f['offset']=qs[_0x8a84('0x30')](_0x154ac8[_0x8a84('0x43')][_0x8a84('0x30')]);}return _0x33125e[_0x8a84('0x5a')](_0x477c3f);}})['then'](function(_0x5c7e69){if(_0x5c7e69){return _0x5c7e69?{'count':_0x76a806,'rows':_0x5c7e69}:null;}})[_0x8a84('0x38')](respondWithResult(_0x11a7f5,null))[_0x8a84('0x2a')](handleError(_0x11a7f5,null));};exports['addConfiguration']=function(_0x3335a6,_0x105614,_0x8a9607){if(_0x3335a6[_0x8a84('0x57')]['id']){delete _0x3335a6[_0x8a84('0x57')]['id'];}return db[_0x8a84('0x3e')][_0x8a84('0x5d')]({'where':{'id':_0x3335a6[_0x8a84('0x58')]['id']}})[_0x8a84('0x38')](handleEntityNotFound(_0x105614,null))['then'](function(_0x2542c9){if(_0x2542c9){_0x3335a6[_0x8a84('0x57')][_0x8a84('0x5e')]=_0x2542c9['id'];_0x3335a6[_0x8a84('0x57')]['Subjects']=integrations['getSubjects'](_0x3335a6[_0x8a84('0x57')][_0x8a84('0x5f')],_0x3335a6['body'][_0x8a84('0x41')]);_0x3335a6[_0x8a84('0x57')]['Descriptions']=integrations[_0x8a84('0x60')](_0x3335a6[_0x8a84('0x57')][_0x8a84('0x5f')],_0x3335a6[_0x8a84('0x57')][_0x8a84('0x41')]);return db[_0x8a84('0x5b')][_0x8a84('0x56')](_0x3335a6[_0x8a84('0x57')],{'include':[{'model':db[_0x8a84('0x61')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x8a84('0x62')}]});}return null;})[_0x8a84('0x38')](respondWithResult(_0x105614,null))['catch'](handleError(_0x105614,null));};exports[_0x8a84('0x63')]=function(_0xead7dc,_0x4dee5f,_0x543aa4){var _0x1bbafa='';var _0x547802=['id',_0x8a84('0x3a'),'assigned_user_id','created_by',_0x8a84('0x64'),_0x8a84('0x65'),_0x8a84('0x66'),'duration_minutes',_0x8a84('0x67'),_0x8a84('0x68'),_0x8a84('0x69'),_0x8a84('0x6a')];return db[_0x8a84('0x3e')][_0x8a84('0x5d')]({'where':{'id':_0xead7dc[_0x8a84('0x58')]['id']},'attributes':['id',_0x8a84('0x6b'),'password',_0x8a84('0x6c')]})[_0x8a84('0x38')](handleEntityNotFound(_0x4dee5f,null))[_0x8a84('0x38')](function(_0x5577d5){if(_0x5577d5){_0x1bbafa=_0x5577d5['remoteUri'];var _0x4c1bb8=_0x1bbafa[_0x8a84('0x6d')](-0x1);if(_0x4c1bb8==='/'){_0x1bbafa=_0x1bbafa['substring'](0x0,_0x1bbafa[_0x8a84('0x6e')](_0x4c1bb8));}return rp({'method':_0x8a84('0x6f'),'uri':util[_0x8a84('0x70')](_0x8a84('0x71'),_0x1bbafa,_0x8a84('0x72')),'json':!![],'form':{'method':_0x8a84('0x73'),'input_type':_0x8a84('0x74'),'response_type':_0x8a84('0x74'),'rest_data':JSON[_0x8a84('0x25')]({'user_auth':{'user_name':_0x5577d5[_0x8a84('0x6b')],'password':_0x5577d5[_0x8a84('0x75')],'encryption':_0x8a84('0x76')},'application':_0x8a84('0x77')})}});}})['then'](function(_0x397aca){if(_0x397aca&&_0x397aca['name']!==_0x8a84('0x78')&&_0x397aca[_0x8a84('0x3a')]!==_0x8a84('0x79')){return rp({'method':_0x8a84('0x6f'),'uri':util[_0x8a84('0x70')]('%s%s',_0x1bbafa,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8a84('0x7a'),'input_type':_0x8a84('0x74'),'response_type':_0x8a84('0x74'),'rest_data':JSON[_0x8a84('0x25')]({'session':_0x397aca['id'],'module_name':_0x8a84('0x7b')})}})['then'](function(_0x3de9a3){if(_0x3de9a3){var _0x347553=_['values'](_0x3de9a3[_0x8a84('0x7c')]);_['remove'](_0x347553,function(_0x5f44ac){return _0x547802[_0x8a84('0x7d')](_0x5f44ac[_0x8a84('0x3a')]);});return{'count':_0x347553[_0x8a84('0x4a')],'rows':_[_0x8a84('0x3d')](_0x347553,function(_0x537091){return{'id':_0x537091[_0x8a84('0x3a')],'name':_0x537091[_0x8a84('0x7e')],'custom':_['endsWith'](_0x537091[_0x8a84('0x3a')],'_c')?!![]:![],'options':_0x537091[_0x8a84('0x52')]?_[_0x8a84('0x3d')](_[_0x8a84('0x7f')](_0x537091[_0x8a84('0x52')]),function(_0x45cff0){return{'name':_0x45cff0['value'],'value':_0x45cff0[_0x8a84('0x3a')]};}):[]};})};}})[_0x8a84('0x38')](respondWithResult(_0x4dee5f,null))['catch'](function(_0x4ce7e6){var _0x229635=_0xead7dc[_0x8a84('0x43')][_0x8a84('0x80')]?0x1f4:_0x4ce7e6[_0x8a84('0x81')]||0x1f4;logger[_0x8a84('0x26')](_0x8a84('0x82'),_0x8a84('0x63'),_0x229635,JSON[_0x8a84('0x25')](_0x4ce7e6));delete _0x4ce7e6[_0x8a84('0x3a')];if(_0x229635===0x191){_0x229635=0x190;}_0x4dee5f[_0x8a84('0x2c')](_0x229635)[_0x8a84('0x3b')](_0xead7dc[_0x8a84('0x43')]['test']?{'message':_0x8a84('0x83'),'statusCode':_0x4ce7e6[_0x8a84('0x81')]}:_0x4ce7e6);});}else{var _0x4304c0=0x1f4;_0x4dee5f[_0x8a84('0x2c')](_0x4304c0)[_0x8a84('0x3b')]({'message':_0x8a84('0x83'),'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 1c03233..42b3a9b 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 _0x8301=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x28a41a,_0x206f94){var _0x1c83cb=function(_0x528ffb){while(--_0x528ffb){_0x28a41a['push'](_0x28a41a['shift']());}};_0x1c83cb(++_0x206f94);}(_0x8301,0x104));var _0x1830=function(_0x1e8eb4,_0x53a726){_0x1e8eb4=_0x1e8eb4-0x0;var _0x3e3e6e=_0x8301[_0x1e8eb4];return _0x3e3e6e;};'use strict';var _=require(_0x1830('0x0'));var util=require(_0x1830('0x1'));var logger=require(_0x1830('0x2'))(_0x1830('0x3'));var moment=require(_0x1830('0x4'));var BPromise=require('bluebird');var rp=require(_0x1830('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1830('0x6'));var attributes=require(_0x1830('0x7'));var integrations=require(_0x1830('0x8'));module[_0x1830('0x9')]=function(_0x1eaa32,_0xab7635){return _0x1eaa32[_0x1830('0xa')](_0x1830('0xb'),attributes,{'tableName':_0x1830('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf730=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xf730,0xbb));var _0x0f73=function(_0xd5f8c9,_0xdf425b){_0xd5f8c9=_0xd5f8c9-0x0;var _0x5ae8f6=_0xf730[_0xd5f8c9];return _0x5ae8f6;};'use strict';var _=require(_0x0f73('0x0'));var util=require(_0x0f73('0x1'));var logger=require(_0x0f73('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f73('0x3'));var rp=require(_0x0f73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f73('0x5'));var config=require(_0x0f73('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0f73('0x7'));module[_0x0f73('0x8')]=function(_0x525d7d,_0x3c5ccc){return _0x525d7d[_0x0f73('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x0f73('0xa'),'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 6ed6537..e110cee 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 _0x691a=['result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x691a,0xe0));var _0xa691=function(_0x1a6a20,_0x288d87){_0x1a6a20=_0x1a6a20-0x0;var _0x4c75d9=_0x691a[_0x1a6a20];return _0x4c75d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa691('0x0'));var BPromise=require(_0xa691('0x1'));var rs=require(_0xa691('0x2'));var fs=require('fs');var Redis=require(_0xa691('0x3'));var db=require(_0xa691('0x4'))['db'];var utils=require(_0xa691('0x5'));var logger=require(_0xa691('0x6'))(_0xa691('0x7'));var config=require(_0xa691('0x8'));var jayson=require(_0xa691('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x894ea4,_0x45a608,_0x2ebb45){return new BPromise(function(_0x50e38f,_0x1fe627){return client[_0xa691('0xa')](_0x894ea4,_0x2ebb45)[_0xa691('0xb')](function(_0x326566){logger[_0xa691('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x45a608,_0xa691('0xd'));logger[_0xa691('0xe')](_0xa691('0xf'),_0x45a608,_0xa691('0xd'),JSON[_0xa691('0x10')](_0x326566));if(_0x326566[_0xa691('0x11')]){if(_0x326566[_0xa691('0x11')][_0xa691('0x12')]===0x1f4){logger[_0xa691('0x11')](_0xa691('0x13'),_0x45a608,_0x326566['error'][_0xa691('0x14')]);return _0x1fe627(_0x326566[_0xa691('0x11')][_0xa691('0x14')]);}logger[_0xa691('0x11')](_0xa691('0x13'),_0x45a608,_0x326566[_0xa691('0x11')][_0xa691('0x14')]);return _0x50e38f(_0x326566[_0xa691('0x11')][_0xa691('0x14')]);}else{logger[_0xa691('0xc')](_0xa691('0x13'),_0x45a608,'request\x20sent');_0x50e38f(_0x326566[_0xa691('0x15')][_0xa691('0x14')]);}})[_0xa691('0x16')](function(_0x4eee3a){logger[_0xa691('0x11')](_0xa691('0x13'),_0x45a608,_0x4eee3a);_0x1fe627(_0x4eee3a);});});}exports[_0xa691('0x17')]=function(_0x12ef5c){var _0x231543=this;return new Promise(function(_0x168a4b,_0x12ddc6){return db[_0xa691('0x18')]['findAll']({'raw':_0x12ef5c[_0xa691('0x19')]?_0x12ef5c['options'][_0xa691('0x1a')]===undefined?!![]:![]:!![],'where':_0x12ef5c[_0xa691('0x19')]?_0x12ef5c[_0xa691('0x19')][_0xa691('0x1b')]||null:null,'attributes':_0x12ef5c[_0xa691('0x19')]?_0x12ef5c[_0xa691('0x19')][_0xa691('0x1c')]||null:null,'limit':_0x12ef5c[_0xa691('0x19')]?_0x12ef5c[_0xa691('0x19')][_0xa691('0x1d')]||null:null,'include':_0x12ef5c['options']?_0x12ef5c['options']['include']?_[_0xa691('0x1e')](_0x12ef5c['options'][_0xa691('0x1f')],function(_0x33ee4b){return{'model':db[_0x33ee4b[_0xa691('0x20')]],'as':_0x33ee4b['as'],'attributes':_0x33ee4b[_0xa691('0x1c')],'include':_0x33ee4b[_0xa691('0x1f')]?_[_0xa691('0x1e')](_0x33ee4b[_0xa691('0x1f')],function(_0x52c49e){return{'model':db[_0x52c49e[_0xa691('0x20')]],'as':_0x52c49e['as'],'attributes':_0x52c49e[_0xa691('0x1c')],'include':_0x52c49e[_0xa691('0x1f')]?_[_0xa691('0x1e')](_0x52c49e[_0xa691('0x1f')],function(_0x5b5f3a){return{'model':db[_0x5b5f3a['model']],'as':_0x5b5f3a['as'],'attributes':_0x5b5f3a[_0xa691('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa691('0xb')](function(_0x4d190b){logger[_0xa691('0xc')](_0xa691('0x17'),_0x12ef5c);logger[_0xa691('0xe')](_0xa691('0x17'),_0x12ef5c,JSON[_0xa691('0x10')](_0x4d190b));_0x168a4b(_0x4d190b);})['catch'](function(_0x386355){logger[_0xa691('0x11')]('GetSugarcrmAccount',_0x386355[_0xa691('0x14')],_0x12ef5c);_0x12ddc6(_0x231543['error'](0x1f4,_0x386355[_0xa691('0x14')]));});});};exports[_0xa691('0x21')]=function(_0x15d3c0){var _0x9ead74=this;return new Promise(function(_0x562829,_0xbbbcca){return db[_0xa691('0x18')][_0xa691('0x22')]({'raw':_0x15d3c0[_0xa691('0x19')]?_0x15d3c0[_0xa691('0x19')][_0xa691('0x1a')]===undefined?!![]:![]:!![],'where':_0x15d3c0[_0xa691('0x19')]?_0x15d3c0[_0xa691('0x19')][_0xa691('0x1b')]||null:null,'attributes':_0x15d3c0[_0xa691('0x19')]?_0x15d3c0[_0xa691('0x19')][_0xa691('0x1c')]||null:null,'include':_0x15d3c0[_0xa691('0x19')]?_0x15d3c0[_0xa691('0x19')]['include']?_['map'](_0x15d3c0['options'][_0xa691('0x1f')],function(_0x5cdf5d){return{'model':db[_0x5cdf5d[_0xa691('0x20')]],'as':_0x5cdf5d['as'],'attributes':_0x5cdf5d[_0xa691('0x1c')],'include':_0x5cdf5d[_0xa691('0x1f')]?_[_0xa691('0x1e')](_0x5cdf5d[_0xa691('0x1f')],function(_0x9435b7){return{'model':db[_0x9435b7[_0xa691('0x20')]],'as':_0x9435b7['as'],'attributes':_0x9435b7[_0xa691('0x1c')],'include':_0x9435b7['include']?_[_0xa691('0x1e')](_0x9435b7[_0xa691('0x1f')],function(_0x306511){return{'model':db[_0x306511[_0xa691('0x20')]],'as':_0x306511['as'],'attributes':_0x306511[_0xa691('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26b692){logger[_0xa691('0xc')](_0xa691('0x21'),_0x15d3c0);logger[_0xa691('0xe')](_0xa691('0x21'),_0x15d3c0,JSON[_0xa691('0x10')](_0x26b692));_0x562829(_0x26b692);})[_0xa691('0x16')](function(_0xe14d86){logger[_0xa691('0x11')]('ShowSugarcrmAccount',_0xe14d86[_0xa691('0x14')],_0x15d3c0);_0xbbbcca(_0x9ead74[_0xa691('0x11')](0x1f4,_0xe14d86[_0xa691('0x14')]));});});}; \ No newline at end of file +var _0x63f6=['../../config/logger','rpc','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5948dc,_0x4e17e0){var _0x5424cf=function(_0x37ddee){while(--_0x37ddee){_0x5948dc['push'](_0x5948dc['shift']());}};_0x5424cf(++_0x4e17e0);}(_0x63f6,0x14e));var _0x663f=function(_0x4a0f62,_0x19f781){_0x4a0f62=_0x4a0f62-0x0;var _0x3ffcc1=_0x63f6[_0x4a0f62];return _0x3ffcc1;};'use strict';var _=require(_0x663f('0x0'));var util=require(_0x663f('0x1'));var moment=require(_0x663f('0x2'));var BPromise=require(_0x663f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x663f('0x4'));var db=require(_0x663f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x663f('0x6'))(_0x663f('0x7'));var config=require('../../config/environment');var jayson=require(_0x663f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12e9da,_0x1522af,_0x2cfe5e){return new BPromise(function(_0x22a87d,_0x75ac11){return client[_0x663f('0x9')](_0x12e9da,_0x2cfe5e)[_0x663f('0xa')](function(_0x30c217){logger[_0x663f('0xb')](_0x663f('0xc'),_0x1522af,'request\x20sent');logger[_0x663f('0xd')](_0x663f('0xe'),_0x1522af,_0x663f('0xf'),JSON[_0x663f('0x10')](_0x30c217));if(_0x30c217[_0x663f('0x11')]){if(_0x30c217['error'][_0x663f('0x12')]===0x1f4){logger[_0x663f('0x11')](_0x663f('0xc'),_0x1522af,_0x30c217[_0x663f('0x11')][_0x663f('0x13')]);return _0x75ac11(_0x30c217['error'][_0x663f('0x13')]);}logger[_0x663f('0x11')](_0x663f('0xc'),_0x1522af,_0x30c217[_0x663f('0x11')][_0x663f('0x13')]);return _0x22a87d(_0x30c217[_0x663f('0x11')][_0x663f('0x13')]);}else{logger[_0x663f('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x1522af,'request\x20sent');_0x22a87d(_0x30c217['result']['message']);}})[_0x663f('0x14')](function(_0x581f3b){logger[_0x663f('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x1522af,_0x581f3b);_0x75ac11(_0x581f3b);});});}exports['GetSugarcrmAccount']=function(_0x44559b){var _0x1f7cda=this;return new Promise(function(_0x329e1e,_0x40d44d){return db['SugarcrmAccount'][_0x663f('0x15')]({'raw':_0x44559b[_0x663f('0x16')]?_0x44559b[_0x663f('0x16')][_0x663f('0x17')]===undefined?!![]:![]:!![],'where':_0x44559b[_0x663f('0x16')]?_0x44559b[_0x663f('0x16')][_0x663f('0x18')]||null:null,'attributes':_0x44559b['options']?_0x44559b['options']['attributes']||null:null,'limit':_0x44559b['options']?_0x44559b[_0x663f('0x16')][_0x663f('0x19')]||null:null,'include':_0x44559b[_0x663f('0x16')]?_0x44559b[_0x663f('0x16')][_0x663f('0x1a')]?_[_0x663f('0x1b')](_0x44559b[_0x663f('0x16')][_0x663f('0x1a')],function(_0x59f119){return{'model':db[_0x59f119[_0x663f('0x1c')]],'as':_0x59f119['as'],'attributes':_0x59f119[_0x663f('0x1d')],'include':_0x59f119[_0x663f('0x1a')]?_['map'](_0x59f119[_0x663f('0x1a')],function(_0x1f033c){return{'model':db[_0x1f033c[_0x663f('0x1c')]],'as':_0x1f033c['as'],'attributes':_0x1f033c[_0x663f('0x1d')],'include':_0x1f033c[_0x663f('0x1a')]?_[_0x663f('0x1b')](_0x1f033c[_0x663f('0x1a')],function(_0x55ba87){return{'model':db[_0x55ba87[_0x663f('0x1c')]],'as':_0x55ba87['as'],'attributes':_0x55ba87[_0x663f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x663f('0xa')](function(_0x380f6){logger[_0x663f('0xb')](_0x663f('0x1e'),_0x44559b);logger[_0x663f('0xd')](_0x663f('0x1e'),_0x44559b,JSON[_0x663f('0x10')](_0x380f6));_0x329e1e(_0x380f6);})[_0x663f('0x14')](function(_0x652382){logger['error'](_0x663f('0x1e'),_0x652382['message'],_0x44559b);_0x40d44d(_0x1f7cda[_0x663f('0x11')](0x1f4,_0x652382['message']));});});};exports[_0x663f('0x1f')]=function(_0x247eb9){var _0x512eec=this;return new Promise(function(_0x3e4191,_0x2446b3){return db[_0x663f('0x20')][_0x663f('0x21')]({'raw':_0x247eb9[_0x663f('0x16')]?_0x247eb9[_0x663f('0x16')][_0x663f('0x17')]===undefined?!![]:![]:!![],'where':_0x247eb9[_0x663f('0x16')]?_0x247eb9[_0x663f('0x16')]['where']||null:null,'attributes':_0x247eb9[_0x663f('0x16')]?_0x247eb9[_0x663f('0x16')][_0x663f('0x1d')]||null:null,'include':_0x247eb9['options']?_0x247eb9[_0x663f('0x16')][_0x663f('0x1a')]?_[_0x663f('0x1b')](_0x247eb9[_0x663f('0x16')][_0x663f('0x1a')],function(_0x2d111a){return{'model':db[_0x2d111a[_0x663f('0x1c')]],'as':_0x2d111a['as'],'attributes':_0x2d111a['attributes'],'include':_0x2d111a[_0x663f('0x1a')]?_[_0x663f('0x1b')](_0x2d111a[_0x663f('0x1a')],function(_0x59544a){return{'model':db[_0x59544a['model']],'as':_0x59544a['as'],'attributes':_0x59544a[_0x663f('0x1d')],'include':_0x59544a['include']?_[_0x663f('0x1b')](_0x59544a[_0x663f('0x1a')],function(_0x17dd9e){return{'model':db[_0x17dd9e[_0x663f('0x1c')]],'as':_0x17dd9e['as'],'attributes':_0x17dd9e[_0x663f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x663f('0xa')](function(_0x3c0743){logger[_0x663f('0xb')](_0x663f('0x1f'),_0x247eb9);logger['debug']('ShowSugarcrmAccount',_0x247eb9,JSON[_0x663f('0x10')](_0x3c0743));_0x3e4191(_0x3c0743);})['catch'](function(_0x2d83b3){logger['error'](_0x663f('0x1f'),_0x2d83b3['message'],_0x247eb9);_0x2446b3(_0x512eec[_0x663f('0x11')](0x1f4,_0x2d83b3[_0x663f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8137b25..1c62236 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 _0x976b=['isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','post','create','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get'];(function(_0x4b713d,_0x10779b){var _0x391704=function(_0x4213db){while(--_0x4213db){_0x4b713d['push'](_0x4b713d['shift']());}};_0x391704(++_0x10779b);}(_0x976b,0x1af));var _0xb976=function(_0x13c84b,_0x328daf){_0x13c84b=_0x13c84b-0x0;var _0x2094ce=_0x976b[_0x13c84b];return _0x2094ce;};'use strict';var multer=require('multer');var util=require(_0xb976('0x0'));var path=require('path');var timeout=require(_0xb976('0x1'));var express=require(_0xb976('0x2'));var router=express[_0xb976('0x3')]();var auth=require(_0xb976('0x4'));var interaction=require(_0xb976('0x5'));var config=require(_0xb976('0x6'));var controller=require(_0xb976('0x7'));router[_0xb976('0x8')]('/',auth[_0xb976('0x9')](),controller[_0xb976('0xa')]);router[_0xb976('0x8')](_0xb976('0xb'),auth['isAuthenticated'](),controller[_0xb976('0xc')]);router[_0xb976('0x8')](_0xb976('0xd'),auth[_0xb976('0x9')](),controller[_0xb976('0xe')]);router[_0xb976('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xb976('0xf')]);router[_0xb976('0x8')]('/:id/descriptions',auth[_0xb976('0x9')](),controller['getDescriptions']);router[_0xb976('0x10')]('/',auth[_0xb976('0x9')](),controller[_0xb976('0x11')]);router['put'](_0xb976('0xb'),auth[_0xb976('0x9')](),controller['update']);router['delete']('/:id',auth[_0xb976('0x9')](),controller[_0xb976('0x12')]);module[_0xb976('0x13')]=router; \ No newline at end of file +var _0x9b86=['update','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','isAuthenticated','index','get','show','/:id/fields','/:id/subjects','/:id/descriptions','create','put'];(function(_0x22f11e,_0x23d641){var _0x322fc6=function(_0x2b6ced){while(--_0x2b6ced){_0x22f11e['push'](_0x22f11e['shift']());}};_0x322fc6(++_0x23d641);}(_0x9b86,0xb8));var _0x69b8=function(_0x4a52b2,_0x2f21b6){_0x4a52b2=_0x4a52b2-0x0;var _0x1ce864=_0x9b86[_0x4a52b2];return _0x1ce864;};'use strict';var multer=require('multer');var util=require(_0x69b8('0x0'));var path=require(_0x69b8('0x1'));var timeout=require(_0x69b8('0x2'));var express=require('express');var router=express[_0x69b8('0x3')]();var auth=require(_0x69b8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0x69b8('0x5')](),controller[_0x69b8('0x6')]);router[_0x69b8('0x7')]('/:id',auth[_0x69b8('0x5')](),controller[_0x69b8('0x8')]);router[_0x69b8('0x7')](_0x69b8('0x9'),auth[_0x69b8('0x5')](),controller['getFields']);router[_0x69b8('0x7')](_0x69b8('0xa'),auth[_0x69b8('0x5')](),controller['getSubjects']);router['get'](_0x69b8('0xb'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x69b8('0x5')](),controller[_0x69b8('0xc')]);router[_0x69b8('0xd')]('/:id',auth[_0x69b8('0x5')](),controller[_0x69b8('0xe')]);router['delete'](_0x69b8('0xf'),auth[_0x69b8('0x5')](),controller[_0x69b8('0x10')]);module[_0x69b8('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 24ec024..2be282a 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 _0xed35=['sequelize','exports'];(function(_0x4a62dd,_0x4d6d52){var _0x290167=function(_0x5efada){while(--_0x5efada){_0x4a62dd['push'](_0x4a62dd['shift']());}};_0x290167(++_0x4d6d52);}(_0xed35,0x1d2));var _0x5ed3=function(_0x55d5ce,_0x543b5b){_0x55d5ce=_0x55d5ce-0x0;var _0x4091b9=_0xed35[_0x55d5ce];return _0x4091b9;};'use strict';var Sequelize=require(_0x5ed3('0x0'));module[_0x5ed3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf914=['exports','STRING','sequelize'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0xf914,0x7a));var _0x4f91=function(_0x736eb,_0x345088){_0x736eb=_0x736eb-0x0;var _0x30ea13=_0xf914[_0x736eb];return _0x30ea13;};'use strict';var Sequelize=require(_0x4f91('0x0'));module[_0x4f91('0x1')]={'name':{'type':Sequelize[_0x4f91('0x2')]},'description':{'type':Sequelize[_0x4f91('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5835db3..297b409 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 _0x881f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','update','then','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','SugarcrmConfiguration','show','params','length','options','find','create','body','destroy','getFields','SugarcrmField','pick','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis'];(function(_0x45ffaa,_0x42daa5){var _0x562432=function(_0x133ee5){while(--_0x133ee5){_0x45ffaa['push'](_0x45ffaa['shift']());}};_0x562432(++_0x42daa5);}(_0x881f,0xea));var _0xf881=function(_0x2718f0,_0x3b4e6f){_0x2718f0=_0x2718f0-0x0;var _0x392037=_0x881f[_0x2718f0];return _0x392037;};'use strict';var pdf=require(_0xf881('0x0'));var emlformat=require(_0xf881('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf881('0x2'));var rp=require(_0xf881('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf881('0x4'));var util=require(_0xf881('0x5'));var path=require(_0xf881('0x6'));var sox=require(_0xf881('0x7'));var csv=require(_0xf881('0x8'));var ejs=require(_0xf881('0x9'));var fs=require('fs');var _=require(_0xf881('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf881('0xb'));var deskjs=require(_0xf881('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf881('0xd'));var Redis=require(_0xf881('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf881('0xf'));var as=require(_0xf881('0x10'));var hardwareService=require(_0xf881('0x11'));var logger=require('../../config/logger')(_0xf881('0x12'));var utils=require(_0xf881('0x13'));var config=require(_0xf881('0x14'));var db=require(_0xf881('0x15'))['db'];var jayson=require(_0xf881('0x16'));var client=jayson[_0xf881('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x4947da,_0x312ac2,_0x48857d){if(_0x48857d){var _0x395dac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x395dac[_0xf881('0x18')](_0x312ac2)){return _0x4947da;}else{throw new db['Sequelize']['ValidationError'](_0xf881('0x19'));}}else{return _0x4947da;}}function respondWithRpcPromise(_0x3b55f2,_0x1cda50,_0x57638c,_0x2ec80a){return new BPromise(function(_0x394ab1,_0x31af69){var _0x34946d=_0x2ec80a||client;return _0x34946d['request'](_0x3b55f2,_0x57638c)['then'](function(_0x57a595){logger[_0xf881('0x1a')](_0xf881('0x1b'),_0x1cda50,'request\x20sent');logger['debug'](_0xf881('0x1c'),_0x1cda50,_0xf881('0x1d'),JSON['stringify'](_0x57a595));if(_0x57a595[_0xf881('0x1e')]){if(_0x57a595['error']['code']===0x1f4){logger[_0xf881('0x1e')](_0xf881('0x1b'),_0x1cda50,_0x57a595[_0xf881('0x1e')]['message']);return _0x31af69(_0x57a595['error'][_0xf881('0x1f')]);}logger[_0xf881('0x1e')](_0xf881('0x1b'),_0x1cda50,_0x57a595[_0xf881('0x1e')][_0xf881('0x1f')]);return _0x394ab1(_0x57a595[_0xf881('0x1e')][_0xf881('0x1f')]);}else{logger[_0xf881('0x1a')](_0xf881('0x1b'),_0x1cda50,_0xf881('0x1d'));_0x394ab1(_0x57a595[_0xf881('0x20')][_0xf881('0x1f')]);}})[_0xf881('0x21')](function(_0x1ae08f){logger[_0xf881('0x1e')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1cda50,_0x1ae08f);_0x31af69(_0x1ae08f);});});}function respondWithStatusCode(_0x2db980,_0x5e35eb){_0x5e35eb=_0x5e35eb||0xcc;return function(_0x44b60d){if(_0x44b60d){return _0x2db980[_0xf881('0x22')](_0x5e35eb);}return _0x2db980['status'](_0x5e35eb)[_0xf881('0x23')]();};}function respondWithResult(_0x547214,_0x102b10){_0x102b10=_0x102b10||0xc8;return function(_0x3fe2cd){if(_0x3fe2cd){return _0x547214[_0xf881('0x24')](_0x102b10)[_0xf881('0x25')](_0x3fe2cd);}};}function respondWithFilteredResult(_0x10128e,_0x425ed4){return function(_0x2978af){if(_0x2978af){var _0x4ab5e4=_0x2978af[_0xf881('0x26')],_0x346992=_0x425ed4[_0xf881('0x27')],_0x344d7b=_0x425ed4[_0xf881('0x27')]+_0x425ed4[_0xf881('0x28')],_0x17e6a1;if(_0x344d7b>=_0x4ab5e4){_0x344d7b=_0x4ab5e4;_0x17e6a1=0xc8;}else{_0x17e6a1=0xce;}_0x10128e[_0xf881('0x24')](_0x17e6a1);return _0x10128e[_0xf881('0x29')]('Content-Range',_0x346992+'-'+_0x344d7b+'/'+_0x4ab5e4)[_0xf881('0x25')](_0x2978af);}return null;};}function patchUpdates(_0x2a92a7){return function(_0x14ab27){try{jsonpatch[_0xf881('0x2a')](_0x14ab27,_0x2a92a7,!![]);}catch(_0x3be2f3){return BPromise['reject'](_0x3be2f3);}return _0x14ab27['save']();};}function saveUpdates(_0x4366ff,_0x55310e){return function(_0x518df5){if(_0x518df5){return _0x518df5[_0xf881('0x2b')](_0x4366ff)[_0xf881('0x2c')](function(_0x2f5a0d){return _0x2f5a0d;});}return null;};}function removeEntity(_0x3579d7,_0x40c0f0){return function(_0x305bdb){if(_0x305bdb){return _0x305bdb['destroy']()['then'](function(){_0x3579d7[_0xf881('0x24')](0xcc)[_0xf881('0x23')]();});}};}function handleEntityNotFound(_0x12c288,_0x71604b){return function(_0x2cebc9){if(!_0x2cebc9){_0x12c288['sendStatus'](0x194);}return _0x2cebc9;};}function handleError(_0x3d9ebc,_0x1409de){_0x1409de=_0x1409de||0x1f4;return function(_0x4e7329){logger[_0xf881('0x1e')](_0x4e7329['stack']);if(_0x4e7329['name']){delete _0x4e7329[_0xf881('0x2d')];}_0x3d9ebc[_0xf881('0x24')](_0x1409de)['send'](_0x4e7329);};}exports[_0xf881('0x2e')]=function(_0x32e454,_0x3cff73){var _0x110ce8={},_0x764a57={},_0x492a9f={'count':0x0,'rows':[]};var _0x1cb7bc=_[_0xf881('0x2f')](db['SugarcrmConfiguration'][_0xf881('0x30')],function(_0x18abe5){return{'name':_0x18abe5[_0xf881('0x31')],'type':_0x18abe5[_0xf881('0x32')][_0xf881('0x33')]};});_0x764a57[_0xf881('0x34')]=_[_0xf881('0x2f')](_0x1cb7bc,'name');_0x764a57['query']=_[_0xf881('0x35')](_0x32e454[_0xf881('0x36')]);_0x764a57[_0xf881('0x37')]=_[_0xf881('0x38')](_0x764a57[_0xf881('0x34')],_0x764a57[_0xf881('0x36')]);_0x110ce8[_0xf881('0x39')]=_[_0xf881('0x38')](_0x764a57[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x32e454['query']['fields']));_0x110ce8[_0xf881('0x39')]=_0x110ce8[_0xf881('0x39')]['length']?_0x110ce8[_0xf881('0x39')]:_0x764a57['model'];if(!_0x32e454[_0xf881('0x36')][_0xf881('0x3b')](_0xf881('0x3c'))){_0x110ce8[_0xf881('0x28')]=qs[_0xf881('0x28')](_0x32e454[_0xf881('0x36')][_0xf881('0x28')]);_0x110ce8[_0xf881('0x27')]=qs['offset'](_0x32e454[_0xf881('0x36')][_0xf881('0x27')]);}_0x110ce8[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x32e454[_0xf881('0x36')]['sort']);_0x110ce8[_0xf881('0x3f')]=qs[_0xf881('0x37')](_['pick'](_0x32e454['query'],_0x764a57[_0xf881('0x37')]),_0x1cb7bc);if(_0x32e454['query'][_0xf881('0x40')]){_0x110ce8[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x110ce8[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x1cb7bc,function(_0x1f0efd){if(_0x1f0efd['type']!==_0xf881('0x42')){var _0x41b160={};_0x41b160[_0x1f0efd[_0xf881('0x2d')]]={'$like':'%'+_0x32e454[_0xf881('0x36')][_0xf881('0x40')]+'%'};return _0x41b160;}})});}_0x110ce8=_[_0xf881('0x41')]({},_0x110ce8,_0x32e454['options']);var _0x4b884c={'where':_0x110ce8[_0xf881('0x3f')]};return db['SugarcrmConfiguration'][_0xf881('0x26')](_0x4b884c)[_0xf881('0x2c')](function(_0x1fb452){_0x492a9f[_0xf881('0x26')]=_0x1fb452;if(_0x32e454[_0xf881('0x36')][_0xf881('0x43')]){_0x110ce8[_0xf881('0x44')]=[{'all':!![]}];}return db[_0xf881('0x45')]['findAll'](_0x110ce8);})['then'](function(_0x21c111){_0x492a9f['rows']=_0x21c111;return _0x492a9f;})[_0xf881('0x2c')](respondWithFilteredResult(_0x3cff73,_0x110ce8))[_0xf881('0x21')](handleError(_0x3cff73,null));};exports[_0xf881('0x46')]=function(_0x4a0cfc,_0x1dc4c7){var _0x4b3dfa={'raw':![],'where':{'id':_0x4a0cfc[_0xf881('0x47')]['id']}},_0x1da685={};_0x1da685[_0xf881('0x34')]=_[_0xf881('0x35')](db['SugarcrmConfiguration']['rawAttributes']);_0x1da685[_0xf881('0x36')]=_[_0xf881('0x35')](_0x4a0cfc[_0xf881('0x36')]);_0x1da685[_0xf881('0x37')]=_[_0xf881('0x38')](_0x1da685['model'],_0x1da685[_0xf881('0x36')]);_0x4b3dfa[_0xf881('0x39')]=_[_0xf881('0x38')](_0x1da685[_0xf881('0x34')],qs['fields'](_0x4a0cfc[_0xf881('0x36')][_0xf881('0x3a')]));_0x4b3dfa[_0xf881('0x39')]=_0x4b3dfa[_0xf881('0x39')][_0xf881('0x48')]?_0x4b3dfa[_0xf881('0x39')]:_0x1da685['model'];if(_0x4a0cfc['query'][_0xf881('0x43')]){_0x4b3dfa[_0xf881('0x44')]=[{'all':!![]}];}_0x4b3dfa=_[_0xf881('0x41')]({},_0x4b3dfa,_0x4a0cfc[_0xf881('0x49')]);return db[_0xf881('0x45')][_0xf881('0x4a')](_0x4b3dfa)[_0xf881('0x2c')](handleEntityNotFound(_0x1dc4c7,null))['then'](respondWithResult(_0x1dc4c7,null))[_0xf881('0x21')](handleError(_0x1dc4c7,null));};exports[_0xf881('0x4b')]=function(_0x24b1e1,_0x55e12d){return db['SugarcrmConfiguration'][_0xf881('0x4b')](_0x24b1e1['body'],{})[_0xf881('0x2c')](respondWithResult(_0x55e12d,0xc9))['catch'](handleError(_0x55e12d,null));};exports[_0xf881('0x2b')]=function(_0x2339e2,_0x3e9229){if(_0x2339e2['body']['id']){delete _0x2339e2[_0xf881('0x4c')]['id'];}return db[_0xf881('0x45')][_0xf881('0x4a')]({'where':{'id':_0x2339e2['params']['id']}})[_0xf881('0x2c')](handleEntityNotFound(_0x3e9229,null))['then'](saveUpdates(_0x2339e2['body'],null))[_0xf881('0x2c')](respondWithResult(_0x3e9229,null))['catch'](handleError(_0x3e9229,null));};exports[_0xf881('0x4d')]=function(_0x1ae880,_0x104a64){return db[_0xf881('0x45')]['find']({'where':{'id':_0x1ae880[_0xf881('0x47')]['id']}})[_0xf881('0x2c')](handleEntityNotFound(_0x104a64,null))['then'](removeEntity(_0x104a64,null))[_0xf881('0x21')](handleError(_0x104a64,null));};exports[_0xf881('0x4e')]=function(_0x5b7cb1,_0xcd838a,_0x1c001a){var _0x370c92={};var _0x4fb335={};var _0x539e1d;var _0x3a1ead;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x5b7cb1[_0xf881('0x47')]['id']}})[_0xf881('0x2c')](handleEntityNotFound(_0xcd838a,null))[_0xf881('0x2c')](function(_0x43f4cb){if(_0x43f4cb){_0x539e1d=_0x43f4cb;_0x4fb335[_0xf881('0x34')]=_[_0xf881('0x35')](db[_0xf881('0x4f')][_0xf881('0x30')]);_0x4fb335[_0xf881('0x36')]=_[_0xf881('0x35')](_0x5b7cb1[_0xf881('0x36')]);_0x4fb335[_0xf881('0x37')]=_[_0xf881('0x38')](_0x4fb335[_0xf881('0x34')],_0x4fb335[_0xf881('0x36')]);_0x370c92[_0xf881('0x39')]=_[_0xf881('0x38')](_0x4fb335['model'],qs['fields'](_0x5b7cb1[_0xf881('0x36')][_0xf881('0x3a')]));_0x370c92[_0xf881('0x39')]=_0x370c92[_0xf881('0x39')]['length']?_0x370c92[_0xf881('0x39')]:_0x4fb335['model'];_0x370c92[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x5b7cb1['query'][_0xf881('0x3e')]);_0x370c92[_0xf881('0x3f')]=qs[_0xf881('0x37')](_[_0xf881('0x50')](_0x5b7cb1[_0xf881('0x36')],_0x4fb335[_0xf881('0x37')]));if(_0x5b7cb1['query'][_0xf881('0x40')]){_0x370c92[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x370c92[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x370c92[_0xf881('0x39')],function(_0x1261a3){var _0xce1f14={};_0xce1f14[_0x1261a3]={'$like':'%'+_0x5b7cb1[_0xf881('0x36')]['filter']+'%'};return _0xce1f14;})});}_0x370c92=_[_0xf881('0x41')]({},_0x370c92,_0x5b7cb1['options']);return _0x539e1d['getFields'](_0x370c92);}})[_0xf881('0x2c')](function(_0x2c7e0){if(_0x2c7e0){_0x3a1ead=_0x2c7e0[_0xf881('0x48')];if(!_0x5b7cb1[_0xf881('0x36')]['hasOwnProperty'](_0xf881('0x3c'))){_0x370c92[_0xf881('0x28')]=qs['limit'](_0x5b7cb1['query'][_0xf881('0x28')]);_0x370c92[_0xf881('0x27')]=qs[_0xf881('0x27')](_0x5b7cb1[_0xf881('0x36')][_0xf881('0x27')]);}return _0x539e1d[_0xf881('0x4e')](_0x370c92);}})[_0xf881('0x2c')](function(_0x268a5e){if(_0x268a5e){return _0x268a5e?{'count':_0x3a1ead,'rows':_0x268a5e}:null;}})['then'](respondWithResult(_0xcd838a,null))['catch'](handleError(_0xcd838a,null));};exports[_0xf881('0x51')]=function(_0x4b487a,_0x320409,_0x5636a7){var _0x47e3d6={};var _0x354d36={};var _0x193aa3;var _0xbe38da;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4b487a['params']['id']}})[_0xf881('0x2c')](handleEntityNotFound(_0x320409,null))[_0xf881('0x2c')](function(_0x586ad2){if(_0x586ad2){_0x193aa3=_0x586ad2;_0x354d36[_0xf881('0x34')]=_['keys'](db['SugarcrmField'][_0xf881('0x30')]);_0x354d36[_0xf881('0x36')]=_[_0xf881('0x35')](_0x4b487a[_0xf881('0x36')]);_0x354d36[_0xf881('0x37')]=_[_0xf881('0x38')](_0x354d36['model'],_0x354d36[_0xf881('0x36')]);_0x47e3d6[_0xf881('0x39')]=_[_0xf881('0x38')](_0x354d36[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x4b487a[_0xf881('0x36')]['fields']));_0x47e3d6['attributes']=_0x47e3d6[_0xf881('0x39')]['length']?_0x47e3d6['attributes']:_0x354d36[_0xf881('0x34')];_0x47e3d6['order']=qs[_0xf881('0x3e')](_0x4b487a[_0xf881('0x36')]['sort']);_0x47e3d6[_0xf881('0x3f')]=qs[_0xf881('0x37')](_[_0xf881('0x50')](_0x4b487a[_0xf881('0x36')],_0x354d36[_0xf881('0x37')]));if(_0x4b487a[_0xf881('0x36')][_0xf881('0x40')]){_0x47e3d6['where']=_[_0xf881('0x41')](_0x47e3d6['where'],{'$or':_[_0xf881('0x2f')](_0x47e3d6[_0xf881('0x39')],function(_0x26c6f5){var _0x32d564={};_0x32d564[_0x26c6f5]={'$like':'%'+_0x4b487a['query'][_0xf881('0x40')]+'%'};return _0x32d564;})});}_0x47e3d6=_[_0xf881('0x41')]({},_0x47e3d6,_0x4b487a['options']);return _0x193aa3[_0xf881('0x51')](_0x47e3d6);}})['then'](function(_0x46b2a7){if(_0x46b2a7){_0xbe38da=_0x46b2a7[_0xf881('0x48')];if(!_0x4b487a['query'][_0xf881('0x3b')]('nolimit')){_0x47e3d6[_0xf881('0x28')]=qs[_0xf881('0x28')](_0x4b487a[_0xf881('0x36')][_0xf881('0x28')]);_0x47e3d6[_0xf881('0x27')]=qs['offset'](_0x4b487a['query'][_0xf881('0x27')]);}return _0x193aa3[_0xf881('0x51')](_0x47e3d6);}})[_0xf881('0x2c')](function(_0x293fcb){if(_0x293fcb){return _0x293fcb?{'count':_0xbe38da,'rows':_0x293fcb}:null;}})[_0xf881('0x2c')](respondWithResult(_0x320409,null))[_0xf881('0x21')](handleError(_0x320409,null));};exports[_0xf881('0x52')]=function(_0x3c5172,_0x25f42e,_0x4ed43c){var _0x48390a={};var _0x1c459c={};var _0x24fcd8;var _0x5417c3;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x3c5172[_0xf881('0x47')]['id']}})['then'](handleEntityNotFound(_0x25f42e,null))[_0xf881('0x2c')](function(_0x51ff99){if(_0x51ff99){_0x24fcd8=_0x51ff99;_0x1c459c[_0xf881('0x34')]=_['keys'](db[_0xf881('0x4f')][_0xf881('0x30')]);_0x1c459c[_0xf881('0x36')]=_[_0xf881('0x35')](_0x3c5172[_0xf881('0x36')]);_0x1c459c['filters']=_[_0xf881('0x38')](_0x1c459c[_0xf881('0x34')],_0x1c459c[_0xf881('0x36')]);_0x48390a[_0xf881('0x39')]=_['intersection'](_0x1c459c[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x3c5172['query'][_0xf881('0x3a')]));_0x48390a[_0xf881('0x39')]=_0x48390a[_0xf881('0x39')][_0xf881('0x48')]?_0x48390a[_0xf881('0x39')]:_0x1c459c['model'];_0x48390a[_0xf881('0x3d')]=qs['sort'](_0x3c5172[_0xf881('0x36')]['sort']);_0x48390a['where']=qs[_0xf881('0x37')](_[_0xf881('0x50')](_0x3c5172[_0xf881('0x36')],_0x1c459c['filters']));if(_0x3c5172[_0xf881('0x36')][_0xf881('0x40')]){_0x48390a[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x48390a['where'],{'$or':_[_0xf881('0x2f')](_0x48390a[_0xf881('0x39')],function(_0x285c7f){var _0x62a969={};_0x62a969[_0x285c7f]={'$like':'%'+_0x3c5172['query'][_0xf881('0x40')]+'%'};return _0x62a969;})});}_0x48390a=_[_0xf881('0x41')]({},_0x48390a,_0x3c5172[_0xf881('0x49')]);return _0x24fcd8[_0xf881('0x52')](_0x48390a);}})[_0xf881('0x2c')](function(_0x302502){if(_0x302502){_0x5417c3=_0x302502[_0xf881('0x48')];if(!_0x3c5172[_0xf881('0x36')][_0xf881('0x3b')]('nolimit')){_0x48390a['limit']=qs[_0xf881('0x28')](_0x3c5172[_0xf881('0x36')][_0xf881('0x28')]);_0x48390a[_0xf881('0x27')]=qs['offset'](_0x3c5172[_0xf881('0x36')]['offset']);}return _0x24fcd8['getDescriptions'](_0x48390a);}})[_0xf881('0x2c')](function(_0x291dda){if(_0x291dda){return _0x291dda?{'count':_0x5417c3,'rows':_0x291dda}:null;}})['then'](respondWithResult(_0x25f42e,null))[_0xf881('0x21')](handleError(_0x25f42e,null));}; \ No newline at end of file +var _0xc4c4=['../../config/license/hardware','../../config/logger','../../config/utils','../../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','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','status','count','offset','set','Content-Range','reject','save','update','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','catch','show','params','length','create','body','find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xc4c4,0xfb));var _0x4c4c=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xc4c4[_0x24697b];return _0x585b99;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4c4c('0x0'));var zipdir=require(_0x4c4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c4c('0x2'));var moment=require(_0x4c4c('0x3'));var BPromise=require(_0x4c4c('0x4'));var Mustache=require('mustache');var util=require(_0x4c4c('0x5'));var path=require(_0x4c4c('0x6'));var sox=require(_0x4c4c('0x7'));var csv=require(_0x4c4c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c4c('0x9'));var squel=require(_0x4c4c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c4c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4c4c('0xc'));var Papa=require('papaparse');var Redis=require(_0x4c4c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4c4c('0xe'));var as=require(_0x4c4c('0xf'));var hardwareService=require(_0x4c4c('0x10'));var logger=require(_0x4c4c('0x11'))('api');var utils=require(_0x4c4c('0x12'));var config=require('../../config/environment');var db=require(_0x4c4c('0x13'))['db'];var jayson=require(_0x4c4c('0x14'));var client=jayson['client'][_0x4c4c('0x15')]({'port':0x232a});function checkPasswordPattern(_0xa68994,_0x2007b9,_0x402652){if(_0x402652){var _0x3d647b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d647b[_0x4c4c('0x16')](_0x2007b9)){return _0xa68994;}else{throw new db[(_0x4c4c('0x17'))][(_0x4c4c('0x18'))](_0x4c4c('0x19'));}}else{return _0xa68994;}}function respondWithRpcPromise(_0x1bf115,_0x426c21,_0x467942,_0x3f9bf0){return new BPromise(function(_0x4cd114,_0x2ff8af){var _0x3c5591=_0x3f9bf0||client;return _0x3c5591[_0x4c4c('0x1a')](_0x1bf115,_0x467942)[_0x4c4c('0x1b')](function(_0x92a223){logger[_0x4c4c('0x1c')](_0x4c4c('0x1d'),_0x426c21,_0x4c4c('0x1e'));logger[_0x4c4c('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x426c21,_0x4c4c('0x1e'),JSON[_0x4c4c('0x20')](_0x92a223));if(_0x92a223['error']){if(_0x92a223['error'][_0x4c4c('0x21')]===0x1f4){logger[_0x4c4c('0x22')](_0x4c4c('0x1d'),_0x426c21,_0x92a223[_0x4c4c('0x22')][_0x4c4c('0x23')]);return _0x2ff8af(_0x92a223['error'][_0x4c4c('0x23')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x426c21,_0x92a223[_0x4c4c('0x22')][_0x4c4c('0x23')]);return _0x4cd114(_0x92a223[_0x4c4c('0x22')][_0x4c4c('0x23')]);}else{logger[_0x4c4c('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x426c21,'request\x20sent');_0x4cd114(_0x92a223[_0x4c4c('0x24')][_0x4c4c('0x23')]);}})['catch'](function(_0x4497a1){logger['error'](_0x4c4c('0x1d'),_0x426c21,_0x4497a1);_0x2ff8af(_0x4497a1);});});}function respondWithStatusCode(_0x456359,_0x428c7e){_0x428c7e=_0x428c7e||0xcc;return function(_0x1b59bb){if(_0x1b59bb){return _0x456359['sendStatus'](_0x428c7e);}return _0x456359[_0x4c4c('0x25')](_0x428c7e)['end']();};}function respondWithResult(_0x53fa73,_0xc5ec3a){_0xc5ec3a=_0xc5ec3a||0xc8;return function(_0x23b466){if(_0x23b466){return _0x53fa73[_0x4c4c('0x25')](_0xc5ec3a)['json'](_0x23b466);}};}function respondWithFilteredResult(_0x439043,_0x4ba702){return function(_0x550301){if(_0x550301){var _0x313de3=_0x550301[_0x4c4c('0x26')],_0x16ca08=_0x4ba702[_0x4c4c('0x27')],_0x5e307e=_0x4ba702[_0x4c4c('0x27')]+_0x4ba702['limit'],_0x169a25;if(_0x5e307e>=_0x313de3){_0x5e307e=_0x313de3;_0x169a25=0xc8;}else{_0x169a25=0xce;}_0x439043[_0x4c4c('0x25')](_0x169a25);return _0x439043[_0x4c4c('0x28')](_0x4c4c('0x29'),_0x16ca08+'-'+_0x5e307e+'/'+_0x313de3)['json'](_0x550301);}return null;};}function patchUpdates(_0x43cc95){return function(_0x5f0fbe){try{jsonpatch['apply'](_0x5f0fbe,_0x43cc95,!![]);}catch(_0x1eab24){return BPromise[_0x4c4c('0x2a')](_0x1eab24);}return _0x5f0fbe[_0x4c4c('0x2b')]();};}function saveUpdates(_0x2aa2de,_0x539758){return function(_0x5f2e81){if(_0x5f2e81){return _0x5f2e81[_0x4c4c('0x2c')](_0x2aa2de)['then'](function(_0x22f434){return _0x22f434;});}return null;};}function removeEntity(_0x47863c,_0x28911a){return function(_0x21f6a1){if(_0x21f6a1){return _0x21f6a1['destroy']()[_0x4c4c('0x1b')](function(){_0x47863c[_0x4c4c('0x25')](0xcc)[_0x4c4c('0x2d')]();});}};}function handleEntityNotFound(_0x3556b0,_0x294e54){return function(_0xa98232){if(!_0xa98232){_0x3556b0[_0x4c4c('0x2e')](0x194);}return _0xa98232;};}function handleError(_0x2be7d3,_0x1d2942){_0x1d2942=_0x1d2942||0x1f4;return function(_0x3da1ec){logger[_0x4c4c('0x22')](_0x3da1ec[_0x4c4c('0x2f')]);if(_0x3da1ec[_0x4c4c('0x30')]){delete _0x3da1ec[_0x4c4c('0x30')];}_0x2be7d3[_0x4c4c('0x25')](_0x1d2942)[_0x4c4c('0x31')](_0x3da1ec);};}exports[_0x4c4c('0x32')]=function(_0x5b4249,_0xc81825){var _0x4eb6ef={},_0x45803f={},_0xe8ea84={'count':0x0,'rows':[]};var _0x1d02e5=_[_0x4c4c('0x33')](db['SugarcrmConfiguration'][_0x4c4c('0x34')],function(_0x1c43c1){return{'name':_0x1c43c1[_0x4c4c('0x35')],'type':_0x1c43c1[_0x4c4c('0x36')][_0x4c4c('0x37')]};});_0x45803f[_0x4c4c('0x38')]=_['map'](_0x1d02e5,_0x4c4c('0x30'));_0x45803f[_0x4c4c('0x39')]=_[_0x4c4c('0x3a')](_0x5b4249[_0x4c4c('0x39')]);_0x45803f[_0x4c4c('0x3b')]=_['intersection'](_0x45803f[_0x4c4c('0x38')],_0x45803f[_0x4c4c('0x39')]);_0x4eb6ef[_0x4c4c('0x3c')]=_[_0x4c4c('0x3d')](_0x45803f[_0x4c4c('0x38')],qs[_0x4c4c('0x3e')](_0x5b4249[_0x4c4c('0x39')]['fields']));_0x4eb6ef['attributes']=_0x4eb6ef[_0x4c4c('0x3c')]['length']?_0x4eb6ef['attributes']:_0x45803f[_0x4c4c('0x38')];if(!_0x5b4249['query'][_0x4c4c('0x3f')]('nolimit')){_0x4eb6ef[_0x4c4c('0x40')]=qs[_0x4c4c('0x40')](_0x5b4249[_0x4c4c('0x39')][_0x4c4c('0x40')]);_0x4eb6ef[_0x4c4c('0x27')]=qs['offset'](_0x5b4249['query'][_0x4c4c('0x27')]);}_0x4eb6ef[_0x4c4c('0x41')]=qs[_0x4c4c('0x42')](_0x5b4249[_0x4c4c('0x39')][_0x4c4c('0x42')]);_0x4eb6ef[_0x4c4c('0x43')]=qs['filters'](_[_0x4c4c('0x44')](_0x5b4249[_0x4c4c('0x39')],_0x45803f[_0x4c4c('0x3b')]),_0x1d02e5);if(_0x5b4249[_0x4c4c('0x39')][_0x4c4c('0x45')]){_0x4eb6ef['where']=_[_0x4c4c('0x46')](_0x4eb6ef[_0x4c4c('0x43')],{'$or':_[_0x4c4c('0x33')](_0x1d02e5,function(_0x42ee4b){if(_0x42ee4b[_0x4c4c('0x36')]!==_0x4c4c('0x47')){var _0x4ed756={};_0x4ed756[_0x42ee4b[_0x4c4c('0x30')]]={'$like':'%'+_0x5b4249[_0x4c4c('0x39')][_0x4c4c('0x45')]+'%'};return _0x4ed756;}})});}_0x4eb6ef=_['merge']({},_0x4eb6ef,_0x5b4249[_0x4c4c('0x48')]);var _0xc1b2c2={'where':_0x4eb6ef[_0x4c4c('0x43')]};return db[_0x4c4c('0x49')]['count'](_0xc1b2c2)['then'](function(_0x3a5208){_0xe8ea84[_0x4c4c('0x26')]=_0x3a5208;if(_0x5b4249[_0x4c4c('0x39')][_0x4c4c('0x4a')]){_0x4eb6ef[_0x4c4c('0x4b')]=[{'all':!![]}];}return db[_0x4c4c('0x49')][_0x4c4c('0x4c')](_0x4eb6ef);})[_0x4c4c('0x1b')](function(_0x410da1){_0xe8ea84['rows']=_0x410da1;return _0xe8ea84;})[_0x4c4c('0x1b')](respondWithFilteredResult(_0xc81825,_0x4eb6ef))[_0x4c4c('0x4d')](handleError(_0xc81825,null));};exports[_0x4c4c('0x4e')]=function(_0xefad7e,_0x575495){var _0x8c9fd2={'raw':![],'where':{'id':_0xefad7e[_0x4c4c('0x4f')]['id']}},_0x778b75={};_0x778b75[_0x4c4c('0x38')]=_[_0x4c4c('0x3a')](db[_0x4c4c('0x49')]['rawAttributes']);_0x778b75[_0x4c4c('0x39')]=_[_0x4c4c('0x3a')](_0xefad7e[_0x4c4c('0x39')]);_0x778b75[_0x4c4c('0x3b')]=_[_0x4c4c('0x3d')](_0x778b75[_0x4c4c('0x38')],_0x778b75[_0x4c4c('0x39')]);_0x8c9fd2[_0x4c4c('0x3c')]=_[_0x4c4c('0x3d')](_0x778b75[_0x4c4c('0x38')],qs[_0x4c4c('0x3e')](_0xefad7e[_0x4c4c('0x39')][_0x4c4c('0x3e')]));_0x8c9fd2['attributes']=_0x8c9fd2[_0x4c4c('0x3c')][_0x4c4c('0x50')]?_0x8c9fd2[_0x4c4c('0x3c')]:_0x778b75['model'];if(_0xefad7e[_0x4c4c('0x39')]['includeAll']){_0x8c9fd2[_0x4c4c('0x4b')]=[{'all':!![]}];}_0x8c9fd2=_[_0x4c4c('0x46')]({},_0x8c9fd2,_0xefad7e[_0x4c4c('0x48')]);return db[_0x4c4c('0x49')]['find'](_0x8c9fd2)[_0x4c4c('0x1b')](handleEntityNotFound(_0x575495,null))[_0x4c4c('0x1b')](respondWithResult(_0x575495,null))[_0x4c4c('0x4d')](handleError(_0x575495,null));};exports[_0x4c4c('0x51')]=function(_0x4d450b,_0x55c1f1){return db[_0x4c4c('0x49')][_0x4c4c('0x51')](_0x4d450b[_0x4c4c('0x52')],{})[_0x4c4c('0x1b')](respondWithResult(_0x55c1f1,0xc9))[_0x4c4c('0x4d')](handleError(_0x55c1f1,null));};exports[_0x4c4c('0x2c')]=function(_0x2c0695,_0x4c0961){if(_0x2c0695[_0x4c4c('0x52')]['id']){delete _0x2c0695['body']['id'];}return db[_0x4c4c('0x49')][_0x4c4c('0x53')]({'where':{'id':_0x2c0695[_0x4c4c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4c0961,null))[_0x4c4c('0x1b')](saveUpdates(_0x2c0695[_0x4c4c('0x52')],null))[_0x4c4c('0x1b')](respondWithResult(_0x4c0961,null))[_0x4c4c('0x4d')](handleError(_0x4c0961,null));};exports['destroy']=function(_0x3aed24,_0x562e2e){return db[_0x4c4c('0x49')]['find']({'where':{'id':_0x3aed24[_0x4c4c('0x4f')]['id']}})[_0x4c4c('0x1b')](handleEntityNotFound(_0x562e2e,null))[_0x4c4c('0x1b')](removeEntity(_0x562e2e,null))[_0x4c4c('0x4d')](handleError(_0x562e2e,null));};exports[_0x4c4c('0x54')]=function(_0x3ca25c,_0x54357f,_0x5bf06d){var _0x206651={};var _0x3ece58={};var _0x6101fc;var _0x50aea7;return db['SugarcrmConfiguration'][_0x4c4c('0x55')]({'where':{'id':_0x3ca25c['params']['id']}})[_0x4c4c('0x1b')](handleEntityNotFound(_0x54357f,null))['then'](function(_0x330fe1){if(_0x330fe1){_0x6101fc=_0x330fe1;_0x3ece58[_0x4c4c('0x38')]=_[_0x4c4c('0x3a')](db[_0x4c4c('0x56')][_0x4c4c('0x34')]);_0x3ece58[_0x4c4c('0x39')]=_[_0x4c4c('0x3a')](_0x3ca25c['query']);_0x3ece58['filters']=_[_0x4c4c('0x3d')](_0x3ece58['model'],_0x3ece58[_0x4c4c('0x39')]);_0x206651[_0x4c4c('0x3c')]=_[_0x4c4c('0x3d')](_0x3ece58['model'],qs[_0x4c4c('0x3e')](_0x3ca25c[_0x4c4c('0x39')][_0x4c4c('0x3e')]));_0x206651[_0x4c4c('0x3c')]=_0x206651[_0x4c4c('0x3c')][_0x4c4c('0x50')]?_0x206651[_0x4c4c('0x3c')]:_0x3ece58[_0x4c4c('0x38')];_0x206651[_0x4c4c('0x41')]=qs[_0x4c4c('0x42')](_0x3ca25c['query']['sort']);_0x206651['where']=qs['filters'](_['pick'](_0x3ca25c[_0x4c4c('0x39')],_0x3ece58['filters']));if(_0x3ca25c[_0x4c4c('0x39')][_0x4c4c('0x45')]){_0x206651[_0x4c4c('0x43')]=_[_0x4c4c('0x46')](_0x206651[_0x4c4c('0x43')],{'$or':_[_0x4c4c('0x33')](_0x206651['attributes'],function(_0x590606){var _0x5767aa={};_0x5767aa[_0x590606]={'$like':'%'+_0x3ca25c[_0x4c4c('0x39')][_0x4c4c('0x45')]+'%'};return _0x5767aa;})});}_0x206651=_[_0x4c4c('0x46')]({},_0x206651,_0x3ca25c[_0x4c4c('0x48')]);return _0x6101fc[_0x4c4c('0x54')](_0x206651);}})[_0x4c4c('0x1b')](function(_0x5e0988){if(_0x5e0988){_0x50aea7=_0x5e0988[_0x4c4c('0x50')];if(!_0x3ca25c['query'][_0x4c4c('0x3f')]('nolimit')){_0x206651[_0x4c4c('0x40')]=qs[_0x4c4c('0x40')](_0x3ca25c[_0x4c4c('0x39')][_0x4c4c('0x40')]);_0x206651[_0x4c4c('0x27')]=qs['offset'](_0x3ca25c['query'][_0x4c4c('0x27')]);}return _0x6101fc['getFields'](_0x206651);}})[_0x4c4c('0x1b')](function(_0x39b796){if(_0x39b796){return _0x39b796?{'count':_0x50aea7,'rows':_0x39b796}:null;}})[_0x4c4c('0x1b')](respondWithResult(_0x54357f,null))[_0x4c4c('0x4d')](handleError(_0x54357f,null));};exports[_0x4c4c('0x57')]=function(_0x5e08bc,_0x79c292,_0x28f321){var _0x131682={};var _0x1648ac={};var _0x5c21d0;var _0x1cef8a;return db[_0x4c4c('0x49')][_0x4c4c('0x55')]({'where':{'id':_0x5e08bc[_0x4c4c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x79c292,null))[_0x4c4c('0x1b')](function(_0x2f7d8d){if(_0x2f7d8d){_0x5c21d0=_0x2f7d8d;_0x1648ac[_0x4c4c('0x38')]=_['keys'](db[_0x4c4c('0x56')][_0x4c4c('0x34')]);_0x1648ac['query']=_[_0x4c4c('0x3a')](_0x5e08bc['query']);_0x1648ac[_0x4c4c('0x3b')]=_[_0x4c4c('0x3d')](_0x1648ac['model'],_0x1648ac[_0x4c4c('0x39')]);_0x131682['attributes']=_['intersection'](_0x1648ac[_0x4c4c('0x38')],qs[_0x4c4c('0x3e')](_0x5e08bc[_0x4c4c('0x39')][_0x4c4c('0x3e')]));_0x131682['attributes']=_0x131682[_0x4c4c('0x3c')][_0x4c4c('0x50')]?_0x131682[_0x4c4c('0x3c')]:_0x1648ac[_0x4c4c('0x38')];_0x131682['order']=qs[_0x4c4c('0x42')](_0x5e08bc[_0x4c4c('0x39')][_0x4c4c('0x42')]);_0x131682[_0x4c4c('0x43')]=qs[_0x4c4c('0x3b')](_[_0x4c4c('0x44')](_0x5e08bc[_0x4c4c('0x39')],_0x1648ac[_0x4c4c('0x3b')]));if(_0x5e08bc[_0x4c4c('0x39')][_0x4c4c('0x45')]){_0x131682[_0x4c4c('0x43')]=_[_0x4c4c('0x46')](_0x131682[_0x4c4c('0x43')],{'$or':_[_0x4c4c('0x33')](_0x131682[_0x4c4c('0x3c')],function(_0x19fb92){var _0x30acb4={};_0x30acb4[_0x19fb92]={'$like':'%'+_0x5e08bc['query'][_0x4c4c('0x45')]+'%'};return _0x30acb4;})});}_0x131682=_[_0x4c4c('0x46')]({},_0x131682,_0x5e08bc[_0x4c4c('0x48')]);return _0x5c21d0[_0x4c4c('0x57')](_0x131682);}})[_0x4c4c('0x1b')](function(_0xa19e07){if(_0xa19e07){_0x1cef8a=_0xa19e07[_0x4c4c('0x50')];if(!_0x5e08bc[_0x4c4c('0x39')][_0x4c4c('0x3f')]('nolimit')){_0x131682[_0x4c4c('0x40')]=qs[_0x4c4c('0x40')](_0x5e08bc[_0x4c4c('0x39')]['limit']);_0x131682[_0x4c4c('0x27')]=qs[_0x4c4c('0x27')](_0x5e08bc[_0x4c4c('0x39')][_0x4c4c('0x27')]);}return _0x5c21d0[_0x4c4c('0x57')](_0x131682);}})[_0x4c4c('0x1b')](function(_0x251e12){if(_0x251e12){return _0x251e12?{'count':_0x1cef8a,'rows':_0x251e12}:null;}})[_0x4c4c('0x1b')](respondWithResult(_0x79c292,null))['catch'](handleError(_0x79c292,null));};exports['getDescriptions']=function(_0x5c15b0,_0x6bf1c0,_0x20f7c1){var _0x22aaa6={};var _0x16211f={};var _0x5ab9d5;var _0x28508e;return db[_0x4c4c('0x49')][_0x4c4c('0x55')]({'where':{'id':_0x5c15b0[_0x4c4c('0x4f')]['id']}})[_0x4c4c('0x1b')](handleEntityNotFound(_0x6bf1c0,null))[_0x4c4c('0x1b')](function(_0x399fff){if(_0x399fff){_0x5ab9d5=_0x399fff;_0x16211f['model']=_[_0x4c4c('0x3a')](db[_0x4c4c('0x56')][_0x4c4c('0x34')]);_0x16211f[_0x4c4c('0x39')]=_[_0x4c4c('0x3a')](_0x5c15b0[_0x4c4c('0x39')]);_0x16211f[_0x4c4c('0x3b')]=_[_0x4c4c('0x3d')](_0x16211f[_0x4c4c('0x38')],_0x16211f[_0x4c4c('0x39')]);_0x22aaa6[_0x4c4c('0x3c')]=_[_0x4c4c('0x3d')](_0x16211f[_0x4c4c('0x38')],qs['fields'](_0x5c15b0[_0x4c4c('0x39')][_0x4c4c('0x3e')]));_0x22aaa6[_0x4c4c('0x3c')]=_0x22aaa6[_0x4c4c('0x3c')][_0x4c4c('0x50')]?_0x22aaa6['attributes']:_0x16211f[_0x4c4c('0x38')];_0x22aaa6[_0x4c4c('0x41')]=qs[_0x4c4c('0x42')](_0x5c15b0[_0x4c4c('0x39')][_0x4c4c('0x42')]);_0x22aaa6[_0x4c4c('0x43')]=qs[_0x4c4c('0x3b')](_[_0x4c4c('0x44')](_0x5c15b0[_0x4c4c('0x39')],_0x16211f[_0x4c4c('0x3b')]));if(_0x5c15b0['query']['filter']){_0x22aaa6[_0x4c4c('0x43')]=_['merge'](_0x22aaa6['where'],{'$or':_[_0x4c4c('0x33')](_0x22aaa6[_0x4c4c('0x3c')],function(_0x22d22b){var _0x4cda29={};_0x4cda29[_0x22d22b]={'$like':'%'+_0x5c15b0[_0x4c4c('0x39')]['filter']+'%'};return _0x4cda29;})});}_0x22aaa6=_[_0x4c4c('0x46')]({},_0x22aaa6,_0x5c15b0['options']);return _0x5ab9d5[_0x4c4c('0x58')](_0x22aaa6);}})[_0x4c4c('0x1b')](function(_0x2c7c7c){if(_0x2c7c7c){_0x28508e=_0x2c7c7c[_0x4c4c('0x50')];if(!_0x5c15b0['query'][_0x4c4c('0x3f')]('nolimit')){_0x22aaa6[_0x4c4c('0x40')]=qs[_0x4c4c('0x40')](_0x5c15b0[_0x4c4c('0x39')][_0x4c4c('0x40')]);_0x22aaa6[_0x4c4c('0x27')]=qs['offset'](_0x5c15b0[_0x4c4c('0x39')][_0x4c4c('0x27')]);}return _0x5ab9d5[_0x4c4c('0x58')](_0x22aaa6);}})[_0x4c4c('0x1b')](function(_0x454527){if(_0x454527){return _0x454527?{'count':_0x28508e,'rows':_0x454527}:null;}})[_0x4c4c('0x1b')](respondWithResult(_0x6bf1c0,null))[_0x4c4c('0x4d')](handleError(_0x6bf1c0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6a77266..2722b36 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 _0xadde=['util','../../config/logger','api','moment','bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0xadde,0x15b));var _0xeadd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xadde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeadd('0x0'));var util=require(_0xeadd('0x1'));var logger=require(_0xeadd('0x2'))(_0xeadd('0x3'));var moment=require(_0xeadd('0x4'));var BPromise=require(_0xeadd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeadd('0x6'));var rimraf=require(_0xeadd('0x7'));var config=require('../../config/environment');var attributes=require(_0xeadd('0x8'));module['exports']=function(_0x51165e,_0x168efd){return _0x51165e[_0xeadd('0x9')](_0xeadd('0xa'),attributes,{'tableName':_0xeadd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62e6=['util','../../config/logger','bluebird','request-promise','../../config/environment','define','SugarcrmConfiguration','lodash'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x62e6,0xff));var _0x662e=function(_0x28ee74,_0x289441){_0x28ee74=_0x28ee74-0x0;var _0x6cc80c=_0x62e6[_0x28ee74];return _0x6cc80c;};'use strict';var _=require(_0x662e('0x0'));var util=require(_0x662e('0x1'));var logger=require(_0x662e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x662e('0x3'));var rp=require(_0x662e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x662e('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0xa9be6,_0x3f041d){return _0xa9be6[_0x662e('0x6')](_0x662e('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','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 11fb36d..79066e8 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 _0x5f6c=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3f3026,_0x35d62a){var _0x4e87bf=function(_0x174109){while(--_0x174109){_0x3f3026['push'](_0x3f3026['shift']());}};_0x4e87bf(++_0x35d62a);}(_0x5f6c,0x12e));var _0xc5f6=function(_0x4ff15a,_0x1fd975){_0x4ff15a=_0x4ff15a-0x0;var _0x135ca3=_0x5f6c[_0x4ff15a];return _0x135ca3;};'use strict';var _=require(_0xc5f6('0x0'));var util=require(_0xc5f6('0x1'));var moment=require(_0xc5f6('0x2'));var BPromise=require(_0xc5f6('0x3'));var rs=require(_0xc5f6('0x4'));var fs=require('fs');var Redis=require(_0xc5f6('0x5'));var db=require(_0xc5f6('0x6'))['db'];var utils=require(_0xc5f6('0x7'));var logger=require(_0xc5f6('0x8'))(_0xc5f6('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5f6('0xa')][_0xc5f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x328573,_0x5cac01,_0x5916ce){return new BPromise(function(_0x282160,_0x33f600){return client[_0xc5f6('0xc')](_0x328573,_0x5916ce)[_0xc5f6('0xd')](function(_0x213c4c){logger[_0xc5f6('0xe')](_0xc5f6('0xf'),_0x5cac01,_0xc5f6('0x10'));logger[_0xc5f6('0x11')](_0xc5f6('0x12'),_0x5cac01,_0xc5f6('0x10'),JSON[_0xc5f6('0x13')](_0x213c4c));if(_0x213c4c['error']){if(_0x213c4c[_0xc5f6('0x14')][_0xc5f6('0x15')]===0x1f4){logger['error'](_0xc5f6('0xf'),_0x5cac01,_0x213c4c[_0xc5f6('0x14')][_0xc5f6('0x16')]);return _0x33f600(_0x213c4c['error'][_0xc5f6('0x16')]);}logger[_0xc5f6('0x14')](_0xc5f6('0xf'),_0x5cac01,_0x213c4c[_0xc5f6('0x14')][_0xc5f6('0x16')]);return _0x282160(_0x213c4c[_0xc5f6('0x14')][_0xc5f6('0x16')]);}else{logger['info'](_0xc5f6('0xf'),_0x5cac01,_0xc5f6('0x10'));_0x282160(_0x213c4c[_0xc5f6('0x17')]['message']);}})[_0xc5f6('0x18')](function(_0x5d170e){logger[_0xc5f6('0x14')](_0xc5f6('0xf'),_0x5cac01,_0x5d170e);_0x33f600(_0x5d170e);});});} \ No newline at end of file +var _0x386a=['../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','debug','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x55cbf9,_0x38f1ec){var _0x582a5b=function(_0xd968f2){while(--_0xd968f2){_0x55cbf9['push'](_0x55cbf9['shift']());}};_0x582a5b(++_0x38f1ec);}(_0x386a,0x126));var _0xa386=function(_0x574f47,_0x2e649a){_0x574f47=_0x574f47-0x0;var _0x74d1ca=_0x386a[_0x574f47];return _0x74d1ca;};'use strict';var _=require(_0xa386('0x0'));var util=require(_0xa386('0x1'));var moment=require(_0xa386('0x2'));var BPromise=require(_0xa386('0x3'));var rs=require(_0xa386('0x4'));var fs=require('fs');var Redis=require(_0xa386('0x5'));var db=require(_0xa386('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa386('0x7'))(_0xa386('0x8'));var config=require(_0xa386('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c47dc,_0x2ae52f,_0x2db17d){return new BPromise(function(_0x5abad7,_0x49b0ab){return client[_0xa386('0xa')](_0x4c47dc,_0x2db17d)[_0xa386('0xb')](function(_0x318654){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ae52f,'request\x20sent');logger[_0xa386('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2ae52f,_0xa386('0xd'),JSON['stringify'](_0x318654));if(_0x318654['error']){if(_0x318654[_0xa386('0xe')][_0xa386('0xf')]===0x1f4){logger[_0xa386('0xe')](_0xa386('0x10'),_0x2ae52f,_0x318654[_0xa386('0xe')][_0xa386('0x11')]);return _0x49b0ab(_0x318654[_0xa386('0xe')][_0xa386('0x11')]);}logger[_0xa386('0xe')](_0xa386('0x10'),_0x2ae52f,_0x318654[_0xa386('0xe')][_0xa386('0x11')]);return _0x5abad7(_0x318654[_0xa386('0xe')]['message']);}else{logger[_0xa386('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2ae52f,_0xa386('0xd'));_0x5abad7(_0x318654[_0xa386('0x13')][_0xa386('0x11')]);}})['catch'](function(_0x1cd189){logger['error'](_0xa386('0x10'),_0x2ae52f,_0x1cd189);_0x49b0ab(_0x1cd189);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e01ba10..e129e5e 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 _0xc46a=['destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x33092d,_0x54304e){var _0x4ff011=function(_0x1aabe5){while(--_0x1aabe5){_0x33092d['push'](_0x33092d['shift']());}};_0x4ff011(++_0x54304e);}(_0xc46a,0x1b2));var _0xac46=function(_0x1109db,_0x5c6dc7){_0x1109db=_0x1109db-0x0;var _0x27d529=_0xc46a[_0x1109db];return _0x27d529;};'use strict';var multer=require(_0xac46('0x0'));var util=require(_0xac46('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xac46('0x2')]();var auth=require(_0xac46('0x3'));var interaction=require(_0xac46('0x4'));var config=require('../../config/environment');var controller=require(_0xac46('0x5'));router[_0xac46('0x6')]('/',auth[_0xac46('0x7')](),controller[_0xac46('0x8')]);router[_0xac46('0x6')](_0xac46('0x9'),auth[_0xac46('0x7')](),controller[_0xac46('0xa')]);router[_0xac46('0xb')]('/',auth[_0xac46('0x7')](),controller[_0xac46('0xc')]);router[_0xac46('0xd')](_0xac46('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xac46('0xe')]);module[_0xac46('0xf')]=router; \ No newline at end of file +var _0x5776=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','create','update'];(function(_0x338728,_0x4d1f3a){var _0x396bb7=function(_0x2f107c){while(--_0x2f107c){_0x338728['push'](_0x338728['shift']());}};_0x396bb7(++_0x4d1f3a);}(_0x5776,0x10c));var _0x6577=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5776[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x6577('0x0'));var util=require('util');var path=require(_0x6577('0x1'));var timeout=require(_0x6577('0x2'));var express=require(_0x6577('0x3'));var router=express[_0x6577('0x4')]();var auth=require(_0x6577('0x5'));var interaction=require(_0x6577('0x6'));var config=require(_0x6577('0x7'));var controller=require(_0x6577('0x8'));router[_0x6577('0x9')]('/',auth['isAuthenticated'](),controller[_0x6577('0xa')]);router[_0x6577('0x9')](_0x6577('0xb'),auth[_0x6577('0xc')](),controller[_0x6577('0xd')]);router[_0x6577('0xe')]('/',auth[_0x6577('0xc')](),controller[_0x6577('0xf')]);router['put'](_0x6577('0xb'),auth[_0x6577('0xc')](),controller[_0x6577('0x10')]);router[_0x6577('0x11')](_0x6577('0xb'),auth[_0x6577('0xc')](),controller['destroy']);module[_0x6577('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e50b3dc..24da881 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 _0x668b=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x55f60e,_0x3e5581){var _0x2a5965=function(_0x3acd59){while(--_0x3acd59){_0x55f60e['push'](_0x55f60e['shift']());}};_0x2a5965(++_0x3e5581);}(_0x668b,0x8d));var _0xb668=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x668b[_0x2f3d29];return _0x53d69d;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'type':{'type':Sequelize[_0xb668('0x2')](_0xb668('0x3'),_0xb668('0x4'),_0xb668('0x5'),_0xb668('0x6')),'defaultValue':_0xb668('0x3')},'content':{'type':Sequelize[_0xb668('0x7')]},'key':{'type':Sequelize[_0xb668('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb668('0x3'),_0xb668('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xb668('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb668('0x7')]},'customField':{'type':Sequelize[_0xb668('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb668('0x7')]}}; \ No newline at end of file +var _0x3e25=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','STRING','string'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x3e25,0x14f));var _0x53e2=function(_0x23d9b0,_0x174e84){_0x23d9b0=_0x23d9b0-0x0;var _0x26651a=_0x3e25[_0x23d9b0];return _0x26651a;};'use strict';var Sequelize=require(_0x53e2('0x0'));module[_0x53e2('0x1')]={'type':{'type':Sequelize[_0x53e2('0x2')]('string',_0x53e2('0x3'),'customVariable',_0x53e2('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x53e2('0x5')]},'key':{'type':Sequelize[_0x53e2('0x5')]},'keyType':{'type':Sequelize[_0x53e2('0x2')](_0x53e2('0x6'),_0x53e2('0x3'),_0x53e2('0x7'))},'keyContent':{'type':Sequelize[_0x53e2('0x5')]},'idField':{'type':Sequelize[_0x53e2('0x5')]},'nameField':{'type':Sequelize[_0x53e2('0x5')]},'customField':{'type':Sequelize[_0x53e2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x53e2('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 26c7704..338a6ef 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 _0xa10e=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','count','includeAll','include','findAll','rows','params','catch','create','body','find','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x5a1a5b,_0x1c8fb9){var _0x36eccd=function(_0x55f735){while(--_0x55f735){_0x5a1a5b['push'](_0x5a1a5b['shift']());}};_0x36eccd(++_0x1c8fb9);}(_0xa10e,0x7b));var _0xea10=function(_0x32eb6e,_0x384dc7){_0x32eb6e=_0x32eb6e-0x0;var _0x1fef62=_0xa10e[_0x32eb6e];return _0x1fef62;};'use strict';var pdf=require(_0xea10('0x0'));var emlformat=require(_0xea10('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea10('0x3'));var moment=require(_0xea10('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea10('0x5'));var util=require(_0xea10('0x6'));var path=require(_0xea10('0x7'));var sox=require(_0xea10('0x8'));var csv=require(_0xea10('0x9'));var ejs=require(_0xea10('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea10('0xb'));var crypto=require(_0xea10('0xc'));var jsforce=require(_0xea10('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xea10('0x9'));var querystring=require(_0xea10('0xe'));var Papa=require('papaparse');var Redis=require(_0xea10('0xf'));var authService=require(_0xea10('0x10'));var qs=require(_0xea10('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea10('0x12'))(_0xea10('0x13'));var utils=require(_0xea10('0x14'));var config=require(_0xea10('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31ac46,_0x276365){_0x276365=_0x276365||0xcc;return function(_0x26c791){if(_0x26c791){return _0x31ac46[_0xea10('0x16')](_0x276365);}return _0x31ac46[_0xea10('0x17')](_0x276365)[_0xea10('0x18')]();};}function respondWithResult(_0xa5e1f7,_0x505b01){_0x505b01=_0x505b01||0xc8;return function(_0x96d2c2){if(_0x96d2c2){return _0xa5e1f7[_0xea10('0x17')](_0x505b01)['json'](_0x96d2c2);}};}function respondWithFilteredResult(_0x125d90,_0x576ce6){return function(_0x50c428){if(_0x50c428){var _0x1fa6ee=_0x50c428['count'],_0x53b23c=_0x576ce6[_0xea10('0x19')],_0x34d9ce=_0x576ce6[_0xea10('0x19')]+_0x576ce6[_0xea10('0x1a')],_0x445516;if(_0x34d9ce>=_0x1fa6ee){_0x34d9ce=_0x1fa6ee;_0x445516=0xc8;}else{_0x445516=0xce;}_0x125d90['status'](_0x445516);return _0x125d90[_0xea10('0x1b')](_0xea10('0x1c'),_0x53b23c+'-'+_0x34d9ce+'/'+_0x1fa6ee)[_0xea10('0x1d')](_0x50c428);}return null;};}function patchUpdates(_0x1262ab){return function(_0x473f52){try{jsonpatch[_0xea10('0x1e')](_0x473f52,_0x1262ab,!![]);}catch(_0x3a7cd2){return BPromise['reject'](_0x3a7cd2);}return _0x473f52[_0xea10('0x1f')]();};}function saveUpdates(_0x1d4e52,_0x53ce7c){return function(_0x365409){if(_0x365409){return _0x365409[_0xea10('0x20')](_0x1d4e52)['then'](function(_0x2a2516){return _0x2a2516;});}return null;};}function removeEntity(_0x4ad99f,_0xb13384){return function(_0x35baa7){if(_0x35baa7){return _0x35baa7[_0xea10('0x21')]()[_0xea10('0x22')](function(){_0x4ad99f[_0xea10('0x17')](0xcc)[_0xea10('0x18')]();});}};}function handleEntityNotFound(_0x52d9ba,_0x2b5efc){return function(_0x383c9f){if(!_0x383c9f){_0x52d9ba['sendStatus'](0x194);}return _0x383c9f;};}function handleError(_0x2d1ccc,_0x355d01){_0x355d01=_0x355d01||0x1f4;return function(_0x1f974f){logger[_0xea10('0x23')](_0x1f974f[_0xea10('0x24')]);if(_0x1f974f[_0xea10('0x25')]){delete _0x1f974f['name'];}_0x2d1ccc['status'](_0x355d01)['send'](_0x1f974f);};}exports[_0xea10('0x26')]=function(_0x660ec3,_0x54465c){var _0x355dbb={},_0x141fa6={},_0x566cef={'count':0x0,'rows':[]};var _0x5a0fc0=_[_0xea10('0x27')](db[_0xea10('0x28')][_0xea10('0x29')],function(_0x4fb9d8){return{'name':_0x4fb9d8[_0xea10('0x2a')],'type':_0x4fb9d8['type']['key']};});_0x141fa6['model']=_['map'](_0x5a0fc0,_0xea10('0x25'));_0x141fa6[_0xea10('0x2b')]=_[_0xea10('0x2c')](_0x660ec3[_0xea10('0x2b')]);_0x141fa6[_0xea10('0x2d')]=_['intersection'](_0x141fa6[_0xea10('0x2e')],_0x141fa6[_0xea10('0x2b')]);_0x355dbb[_0xea10('0x2f')]=_[_0xea10('0x30')](_0x141fa6[_0xea10('0x2e')],qs[_0xea10('0x31')](_0x660ec3['query'][_0xea10('0x31')]));_0x355dbb['attributes']=_0x355dbb['attributes'][_0xea10('0x32')]?_0x355dbb[_0xea10('0x2f')]:_0x141fa6[_0xea10('0x2e')];if(!_0x660ec3[_0xea10('0x2b')]['hasOwnProperty'](_0xea10('0x33'))){_0x355dbb['limit']=qs[_0xea10('0x1a')](_0x660ec3[_0xea10('0x2b')][_0xea10('0x1a')]);_0x355dbb[_0xea10('0x19')]=qs[_0xea10('0x19')](_0x660ec3['query'][_0xea10('0x19')]);}_0x355dbb[_0xea10('0x34')]=qs[_0xea10('0x35')](_0x660ec3[_0xea10('0x2b')][_0xea10('0x35')]);_0x355dbb[_0xea10('0x36')]=qs['filters'](_[_0xea10('0x37')](_0x660ec3[_0xea10('0x2b')],_0x141fa6[_0xea10('0x2d')]),_0x5a0fc0);if(_0x660ec3[_0xea10('0x2b')][_0xea10('0x38')]){_0x355dbb[_0xea10('0x36')]=_['merge'](_0x355dbb[_0xea10('0x36')],{'$or':_[_0xea10('0x27')](_0x5a0fc0,function(_0x4c2754){if(_0x4c2754[_0xea10('0x39')]!=='VIRTUAL'){var _0x3438f5={};_0x3438f5[_0x4c2754[_0xea10('0x25')]]={'$like':'%'+_0x660ec3[_0xea10('0x2b')]['filter']+'%'};return _0x3438f5;}})});}_0x355dbb=_[_0xea10('0x3a')]({},_0x355dbb,_0x660ec3[_0xea10('0x3b')]);var _0x5eb98d={'where':_0x355dbb[_0xea10('0x36')]};return db['SugarcrmField'][_0xea10('0x3c')](_0x5eb98d)['then'](function(_0x4720d4){_0x566cef[_0xea10('0x3c')]=_0x4720d4;if(_0x660ec3[_0xea10('0x2b')][_0xea10('0x3d')]){_0x355dbb[_0xea10('0x3e')]=[{'all':!![]}];}return db['SugarcrmField'][_0xea10('0x3f')](_0x355dbb);})[_0xea10('0x22')](function(_0x363a93){_0x566cef[_0xea10('0x40')]=_0x363a93;return _0x566cef;})[_0xea10('0x22')](respondWithFilteredResult(_0x54465c,_0x355dbb))['catch'](handleError(_0x54465c,null));};exports['show']=function(_0x3012ef,_0x156805){var _0x2c8e06={'raw':!![],'where':{'id':_0x3012ef[_0xea10('0x41')]['id']}},_0x219d6e={};_0x219d6e[_0xea10('0x2e')]=_[_0xea10('0x2c')](db[_0xea10('0x28')][_0xea10('0x29')]);_0x219d6e[_0xea10('0x2b')]=_[_0xea10('0x2c')](_0x3012ef[_0xea10('0x2b')]);_0x219d6e[_0xea10('0x2d')]=_['intersection'](_0x219d6e['model'],_0x219d6e[_0xea10('0x2b')]);_0x2c8e06[_0xea10('0x2f')]=_[_0xea10('0x30')](_0x219d6e[_0xea10('0x2e')],qs[_0xea10('0x31')](_0x3012ef[_0xea10('0x2b')]['fields']));_0x2c8e06['attributes']=_0x2c8e06['attributes'][_0xea10('0x32')]?_0x2c8e06['attributes']:_0x219d6e[_0xea10('0x2e')];if(_0x3012ef[_0xea10('0x2b')][_0xea10('0x3d')]){_0x2c8e06[_0xea10('0x3e')]=[{'all':!![]}];}_0x2c8e06=_[_0xea10('0x3a')]({},_0x2c8e06,_0x3012ef[_0xea10('0x3b')]);return db[_0xea10('0x28')]['find'](_0x2c8e06)[_0xea10('0x22')](handleEntityNotFound(_0x156805,null))['then'](respondWithResult(_0x156805,null))[_0xea10('0x42')](handleError(_0x156805,null));};exports[_0xea10('0x43')]=function(_0x1187e4,_0x72c926){return db['SugarcrmField'][_0xea10('0x43')](_0x1187e4[_0xea10('0x44')],{})['then'](respondWithResult(_0x72c926,0xc9))[_0xea10('0x42')](handleError(_0x72c926,null));};exports[_0xea10('0x20')]=function(_0x195273,_0x3c930d){if(_0x195273[_0xea10('0x44')]['id']){delete _0x195273[_0xea10('0x44')]['id'];}return db[_0xea10('0x28')]['find']({'where':{'id':_0x195273['params']['id']}})[_0xea10('0x22')](handleEntityNotFound(_0x3c930d,null))['then'](saveUpdates(_0x195273['body'],null))[_0xea10('0x22')](respondWithResult(_0x3c930d,null))[_0xea10('0x42')](handleError(_0x3c930d,null));};exports[_0xea10('0x21')]=function(_0x238203,_0x131ae7){return db[_0xea10('0x28')][_0xea10('0x45')]({'where':{'id':_0x238203['params']['id']}})['then'](handleEntityNotFound(_0x131ae7,null))['then'](removeEntity(_0x131ae7,null))[_0xea10('0x42')](handleError(_0x131ae7,null));}; \ No newline at end of file +var _0xff34=['VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','keys','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick'];(function(_0x3c5c61,_0x496f54){var _0x21f8a2=function(_0x36b99c){while(--_0x36b99c){_0x3c5c61['push'](_0x3c5c61['shift']());}};_0x21f8a2(++_0x496f54);}(_0xff34,0xec));var _0x4ff3=function(_0x4737a0,_0x36520e){_0x4737a0=_0x4737a0-0x0;var _0x4d558b=_0xff34[_0x4737a0];return _0x4d558b;};'use strict';var pdf=require(_0x4ff3('0x0'));var emlformat=require(_0x4ff3('0x1'));var rimraf=require(_0x4ff3('0x2'));var zipdir=require(_0x4ff3('0x3'));var jsonpatch=require(_0x4ff3('0x4'));var rp=require('request-promise');var moment=require(_0x4ff3('0x5'));var BPromise=require(_0x4ff3('0x6'));var Mustache=require(_0x4ff3('0x7'));var util=require('util');var path=require(_0x4ff3('0x8'));var sox=require(_0x4ff3('0x9'));var csv=require(_0x4ff3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ff3('0xb'));var squel=require('squel');var crypto=require(_0x4ff3('0xc'));var jsforce=require(_0x4ff3('0xd'));var deskjs=require(_0x4ff3('0xe'));var toCsv=require(_0x4ff3('0xa'));var querystring=require(_0x4ff3('0xf'));var Papa=require(_0x4ff3('0x10'));var Redis=require(_0x4ff3('0x11'));var authService=require(_0x4ff3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4ff3('0x13'));var hardwareService=require(_0x4ff3('0x14'));var logger=require(_0x4ff3('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4ff3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x179def,_0x4b10e1){_0x4b10e1=_0x4b10e1||0xcc;return function(_0x543631){if(_0x543631){return _0x179def['sendStatus'](_0x4b10e1);}return _0x179def[_0x4ff3('0x17')](_0x4b10e1)['end']();};}function respondWithResult(_0x30c35d,_0x41eda4){_0x41eda4=_0x41eda4||0xc8;return function(_0x16e61c){if(_0x16e61c){return _0x30c35d[_0x4ff3('0x17')](_0x41eda4)['json'](_0x16e61c);}};}function respondWithFilteredResult(_0x31ea7e,_0x3769e0){return function(_0x4a7245){if(_0x4a7245){var _0x355f2a=_0x4a7245['count'],_0xad666d=_0x3769e0[_0x4ff3('0x18')],_0x1c5c8b=_0x3769e0['offset']+_0x3769e0['limit'],_0x4c3821;if(_0x1c5c8b>=_0x355f2a){_0x1c5c8b=_0x355f2a;_0x4c3821=0xc8;}else{_0x4c3821=0xce;}_0x31ea7e[_0x4ff3('0x17')](_0x4c3821);return _0x31ea7e[_0x4ff3('0x19')](_0x4ff3('0x1a'),_0xad666d+'-'+_0x1c5c8b+'/'+_0x355f2a)[_0x4ff3('0x1b')](_0x4a7245);}return null;};}function patchUpdates(_0x268039){return function(_0x256b65){try{jsonpatch[_0x4ff3('0x1c')](_0x256b65,_0x268039,!![]);}catch(_0x16cf5){return BPromise[_0x4ff3('0x1d')](_0x16cf5);}return _0x256b65[_0x4ff3('0x1e')]();};}function saveUpdates(_0x151463,_0x53c452){return function(_0xceec96){if(_0xceec96){return _0xceec96[_0x4ff3('0x1f')](_0x151463)['then'](function(_0x2903f8){return _0x2903f8;});}return null;};}function removeEntity(_0x306479,_0x596c4f){return function(_0x4c9ab5){if(_0x4c9ab5){return _0x4c9ab5[_0x4ff3('0x20')]()[_0x4ff3('0x21')](function(){_0x306479[_0x4ff3('0x17')](0xcc)[_0x4ff3('0x22')]();});}};}function handleEntityNotFound(_0x4d1ba3,_0x586e94){return function(_0x37a2c){if(!_0x37a2c){_0x4d1ba3[_0x4ff3('0x23')](0x194);}return _0x37a2c;};}function handleError(_0x3fdc9d,_0x319adf){_0x319adf=_0x319adf||0x1f4;return function(_0x1061a4){logger[_0x4ff3('0x24')](_0x1061a4[_0x4ff3('0x25')]);if(_0x1061a4[_0x4ff3('0x26')]){delete _0x1061a4[_0x4ff3('0x26')];}_0x3fdc9d['status'](_0x319adf)[_0x4ff3('0x27')](_0x1061a4);};}exports[_0x4ff3('0x28')]=function(_0x3a2800,_0x58721e){var _0x50be1f={},_0x1abfd4={},_0x4ef59f={'count':0x0,'rows':[]};var _0x1197f8=_[_0x4ff3('0x29')](db[_0x4ff3('0x2a')][_0x4ff3('0x2b')],function(_0x473e98){return{'name':_0x473e98[_0x4ff3('0x2c')],'type':_0x473e98[_0x4ff3('0x2d')][_0x4ff3('0x2e')]};});_0x1abfd4[_0x4ff3('0x2f')]=_[_0x4ff3('0x29')](_0x1197f8,'name');_0x1abfd4[_0x4ff3('0x30')]=_['keys'](_0x3a2800[_0x4ff3('0x30')]);_0x1abfd4['filters']=_[_0x4ff3('0x31')](_0x1abfd4[_0x4ff3('0x2f')],_0x1abfd4['query']);_0x50be1f['attributes']=_[_0x4ff3('0x31')](_0x1abfd4[_0x4ff3('0x2f')],qs[_0x4ff3('0x32')](_0x3a2800[_0x4ff3('0x30')][_0x4ff3('0x32')]));_0x50be1f[_0x4ff3('0x33')]=_0x50be1f[_0x4ff3('0x33')][_0x4ff3('0x34')]?_0x50be1f[_0x4ff3('0x33')]:_0x1abfd4[_0x4ff3('0x2f')];if(!_0x3a2800['query'][_0x4ff3('0x35')](_0x4ff3('0x36'))){_0x50be1f[_0x4ff3('0x37')]=qs[_0x4ff3('0x37')](_0x3a2800['query'][_0x4ff3('0x37')]);_0x50be1f[_0x4ff3('0x18')]=qs[_0x4ff3('0x18')](_0x3a2800[_0x4ff3('0x30')][_0x4ff3('0x18')]);}_0x50be1f['order']=qs['sort'](_0x3a2800[_0x4ff3('0x30')][_0x4ff3('0x38')]);_0x50be1f[_0x4ff3('0x39')]=qs[_0x4ff3('0x3a')](_[_0x4ff3('0x3b')](_0x3a2800[_0x4ff3('0x30')],_0x1abfd4[_0x4ff3('0x3a')]),_0x1197f8);if(_0x3a2800['query']['filter']){_0x50be1f[_0x4ff3('0x39')]=_['merge'](_0x50be1f[_0x4ff3('0x39')],{'$or':_[_0x4ff3('0x29')](_0x1197f8,function(_0x49a573){if(_0x49a573[_0x4ff3('0x2d')]!==_0x4ff3('0x3c')){var _0x30da53={};_0x30da53[_0x49a573['name']]={'$like':'%'+_0x3a2800[_0x4ff3('0x30')]['filter']+'%'};return _0x30da53;}})});}_0x50be1f=_[_0x4ff3('0x3d')]({},_0x50be1f,_0x3a2800[_0x4ff3('0x3e')]);var _0x3a725f={'where':_0x50be1f['where']};return db['SugarcrmField'][_0x4ff3('0x3f')](_0x3a725f)[_0x4ff3('0x21')](function(_0x52c817){_0x4ef59f['count']=_0x52c817;if(_0x3a2800[_0x4ff3('0x30')][_0x4ff3('0x40')]){_0x50be1f[_0x4ff3('0x41')]=[{'all':!![]}];}return db[_0x4ff3('0x2a')][_0x4ff3('0x42')](_0x50be1f);})[_0x4ff3('0x21')](function(_0x35f719){_0x4ef59f['rows']=_0x35f719;return _0x4ef59f;})[_0x4ff3('0x21')](respondWithFilteredResult(_0x58721e,_0x50be1f))[_0x4ff3('0x43')](handleError(_0x58721e,null));};exports[_0x4ff3('0x44')]=function(_0xbbaa7,_0x108015){var _0x2d7c1a={'raw':!![],'where':{'id':_0xbbaa7['params']['id']}},_0x486f63={};_0x486f63[_0x4ff3('0x2f')]=_['keys'](db['SugarcrmField'][_0x4ff3('0x2b')]);_0x486f63['query']=_[_0x4ff3('0x45')](_0xbbaa7[_0x4ff3('0x30')]);_0x486f63[_0x4ff3('0x3a')]=_['intersection'](_0x486f63[_0x4ff3('0x2f')],_0x486f63[_0x4ff3('0x30')]);_0x2d7c1a[_0x4ff3('0x33')]=_[_0x4ff3('0x31')](_0x486f63['model'],qs[_0x4ff3('0x32')](_0xbbaa7['query']['fields']));_0x2d7c1a[_0x4ff3('0x33')]=_0x2d7c1a[_0x4ff3('0x33')][_0x4ff3('0x34')]?_0x2d7c1a[_0x4ff3('0x33')]:_0x486f63[_0x4ff3('0x2f')];if(_0xbbaa7[_0x4ff3('0x30')]['includeAll']){_0x2d7c1a[_0x4ff3('0x41')]=[{'all':!![]}];}_0x2d7c1a=_['merge']({},_0x2d7c1a,_0xbbaa7['options']);return db[_0x4ff3('0x2a')][_0x4ff3('0x46')](_0x2d7c1a)[_0x4ff3('0x21')](handleEntityNotFound(_0x108015,null))['then'](respondWithResult(_0x108015,null))[_0x4ff3('0x43')](handleError(_0x108015,null));};exports['create']=function(_0x16ac88,_0x174a29){return db['SugarcrmField'][_0x4ff3('0x47')](_0x16ac88['body'],{})[_0x4ff3('0x21')](respondWithResult(_0x174a29,0xc9))[_0x4ff3('0x43')](handleError(_0x174a29,null));};exports[_0x4ff3('0x1f')]=function(_0x1d1a06,_0x1cc17d){if(_0x1d1a06['body']['id']){delete _0x1d1a06[_0x4ff3('0x48')]['id'];}return db[_0x4ff3('0x2a')][_0x4ff3('0x46')]({'where':{'id':_0x1d1a06[_0x4ff3('0x49')]['id']}})[_0x4ff3('0x21')](handleEntityNotFound(_0x1cc17d,null))[_0x4ff3('0x21')](saveUpdates(_0x1d1a06[_0x4ff3('0x48')],null))[_0x4ff3('0x21')](respondWithResult(_0x1cc17d,null))[_0x4ff3('0x43')](handleError(_0x1cc17d,null));};exports[_0x4ff3('0x20')]=function(_0x2c8d5f,_0x2b9eb5){return db[_0x4ff3('0x2a')]['find']({'where':{'id':_0x2c8d5f[_0x4ff3('0x49')]['id']}})[_0x4ff3('0x21')](handleEntityNotFound(_0x2b9eb5,null))[_0x4ff3('0x21')](removeEntity(_0x2b9eb5,null))[_0x4ff3('0x43')](handleError(_0x2b9eb5,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 007755f..db6abfb 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 _0xe403=['../../config/environment','define','SugarcrmField','sugarcrm_unique_index','idField','api','moment','bluebird','request-promise','rimraf'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xe403,0xff));var _0x3e40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe403[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3e40('0x0'));var moment=require(_0x3e40('0x1'));var BPromise=require(_0x3e40('0x2'));var rp=require(_0x3e40('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e40('0x4'));var config=require(_0x3e40('0x5'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x49bfb8,_0x47c837){return _0x49bfb8[_0x3e40('0x6')](_0x3e40('0x7'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x3e40('0x8'),'fields':[_0x3e40('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdd10=['moment','rimraf','./intSugarcrmField.attributes','exports','define','sugarcrm_unique_index','idField','../../config/logger','api'];(function(_0x27596e,_0x579f83){var _0x1cb6ad=function(_0x1581a5){while(--_0x1581a5){_0x27596e['push'](_0x27596e['shift']());}};_0x1cb6ad(++_0x579f83);}(_0xdd10,0x178));var _0x0dd1=function(_0x2baac2,_0x1d7a00){_0x2baac2=_0x2baac2-0x0;var _0x565870=_0xdd10[_0x2baac2];return _0x565870;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0dd1('0x0'))(_0x0dd1('0x1'));var moment=require(_0x0dd1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0dd1('0x3'));var config=require('../../config/environment');var attributes=require(_0x0dd1('0x4'));module[_0x0dd1('0x5')]=function(_0x13788a,_0x263783){return _0x13788a[_0x0dd1('0x6')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x0dd1('0x7'),'fields':[_0x0dd1('0x8'),'FieldId'],'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 11ef36b..52f0811 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x538a9f,_0x436b09){var _0x310d21=function(_0x56ba6d){while(--_0x56ba6d){_0x538a9f['push'](_0x538a9f['shift']());}};_0x310d21(++_0x436b09);}(_0xdb28,0x106));var _0x8db2=function(_0x5a6f98,_0x367587){_0x5a6f98=_0x5a6f98-0x0;var _0x3ccf76=_0xdb28[_0x5a6f98];return _0x3ccf76;};'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')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _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(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var 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 34feb9b..aec2c1f 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 _0x9a5d=['delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x9a5d,0x1f0));var _0xd9a5=function(_0x56db0a,_0x142c9a){_0x56db0a=_0x56db0a-0x0;var _0x1702a1=_0x9a5d[_0x56db0a];return _0x1702a1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd9a5('0x0'));var timeout=require(_0xd9a5('0x1'));var express=require(_0xd9a5('0x2'));var router=express[_0xd9a5('0x3')]();var auth=require(_0xd9a5('0x4'));var interaction=require(_0xd9a5('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0xd9a5('0x6')]('/',auth[_0xd9a5('0x7')](),controller['index']);router[_0xd9a5('0x6')](_0xd9a5('0x8'),auth[_0xd9a5('0x7')](),controller['show']);router[_0xd9a5('0x6')](_0xd9a5('0x9'),auth[_0xd9a5('0x7')](),controller[_0xd9a5('0xa')]);router[_0xd9a5('0x6')](_0xd9a5('0xb'),auth[_0xd9a5('0x7')](),controller[_0xd9a5('0xc')]);router[_0xd9a5('0xd')]('/',auth[_0xd9a5('0x7')](),controller['create']);router[_0xd9a5('0xd')](_0xd9a5('0x9'),auth[_0xd9a5('0x7')](),controller[_0xd9a5('0xe')]);router[_0xd9a5('0xf')]('/:id',auth[_0xd9a5('0x7')](),controller[_0xd9a5('0x10')]);router[_0xd9a5('0x11')](_0xd9a5('0x8'),auth[_0xd9a5('0x7')](),controller[_0xd9a5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x21c8=['/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','exports','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show'];(function(_0x8c9741,_0x1362c8){var _0x580e3e=function(_0x31ee83){while(--_0x31ee83){_0x8c9741['push'](_0x8c9741['shift']());}};_0x580e3e(++_0x1362c8);}(_0x21c8,0x113));var _0x821c=function(_0x42b030,_0x252cb6){_0x42b030=_0x42b030-0x0;var _0x112303=_0x21c8[_0x42b030];return _0x112303;};'use strict';var multer=require(_0x821c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x821c('0x1'));var express=require('express');var router=express[_0x821c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x821c('0x3'));var config=require(_0x821c('0x4'));var controller=require('./intVtigerAccount.controller');router[_0x821c('0x5')]('/',auth['isAuthenticated'](),controller[_0x821c('0x6')]);router[_0x821c('0x5')](_0x821c('0x7'),auth[_0x821c('0x8')](),controller[_0x821c('0x9')]);router[_0x821c('0x5')]('/:id/configurations',auth[_0x821c('0x8')](),controller['getConfigurations']);router['get'](_0x821c('0xa'),auth[_0x821c('0x8')](),controller[_0x821c('0xb')]);router[_0x821c('0xc')]('/',auth['isAuthenticated'](),controller[_0x821c('0xd')]);router[_0x821c('0xc')](_0x821c('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x821c('0xf')]('/:id',auth[_0x821c('0x8')](),controller[_0x821c('0x10')]);router[_0x821c('0x11')]('/:id',auth[_0x821c('0x8')](),controller['destroy']);module[_0x821c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index fd05561..4c2e7fb 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 _0x0a89=['exports','STRING','HelpDesk','sequelize'];(function(_0x49fb86,_0xe7dcd9){var _0x535b41=function(_0x574546){while(--_0x574546){_0x49fb86['push'](_0x49fb86['shift']());}};_0x535b41(++_0xe7dcd9);}(_0x0a89,0xdb));var _0x90a8=function(_0x591e49,_0x355a7c){_0x591e49=_0x591e49-0x0;var _0x3c105d=_0x0a89[_0x591e49];return _0x3c105d;};'use strict';var Sequelize=require(_0x90a8('0x0'));module[_0x90a8('0x1')]={'name':{'type':Sequelize[_0x90a8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x90a8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x90a8('0x3')},'remoteUri':{'type':Sequelize[_0x90a8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x90a8('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7338=['HelpDesk','exports','STRING'];(function(_0x436943,_0x4d9536){var _0x33963e=function(_0x1c6fec){while(--_0x1c6fec){_0x436943['push'](_0x436943['shift']());}};_0x33963e(++_0x4d9536);}(_0x7338,0x148));var _0x8733=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x7338[_0x616290];return _0x453879;};'use strict';var Sequelize=require('sequelize');module[_0x8733('0x0')]={'name':{'type':Sequelize[_0x8733('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8733('0x1')]},'username':{'type':Sequelize[_0x8733('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8733('0x2')},'remoteUri':{'type':Sequelize[_0x8733('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8733('0x1')]},'accessKey':{'type':Sequelize[_0x8733('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index e8c8b01..1a507da 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 _0x9025=['send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','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~!@#$%^&-_=+[{]}.','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','set','Content-Range','apply','reject','save','destroy','end','stack','name','index','VtigerAccount','rawAttributes','key','map','query','filters','model','intersection','fields','attributes','length','nolimit','limit','offset','sort','filter','where','type','VIRTUAL','merge','options','then','includeAll','rows','show','params','keys','include','create','body','update','find','findOne','order','pick','hasOwnProperty','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','owner','remove','editable','false','label','startsWith','picklist','picklistValues','log','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9025,0x17c));var _0x5902=function(_0x551032,_0x17f7cd){_0x551032=_0x551032-0x0;var _0x4a8c99=_0x9025[_0x551032];return _0x4a8c99;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5902('0x0'));var jsonpatch=require(_0x5902('0x1'));var rp=require(_0x5902('0x2'));var moment=require('moment');var BPromise=require(_0x5902('0x3'));var Mustache=require(_0x5902('0x4'));var util=require(_0x5902('0x5'));var path=require(_0x5902('0x6'));var sox=require(_0x5902('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5902('0x8'));var jsforce=require(_0x5902('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5902('0xa'));var querystring=require(_0x5902('0xb'));var Papa=require(_0x5902('0xc'));var Redis=require(_0x5902('0xd'));var authService=require(_0x5902('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5902('0xf'));var hardwareService=require(_0x5902('0x10'));var logger=require(_0x5902('0x11'))(_0x5902('0x12'));var utils=require(_0x5902('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5902('0x14'));var client=jayson['client'][_0x5902('0x15')]({'port':0x232a});function checkPasswordPattern(_0x399a74,_0x4836c8,_0x2c692a){if(_0x2c692a){var _0x5b4fcd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b4fcd[_0x5902('0x16')](_0x4836c8)){return _0x399a74;}else{throw new db[(_0x5902('0x17'))][(_0x5902('0x18'))](_0x5902('0x19'));}}else{return _0x399a74;}}function respondWithRpcPromise(_0x78ccf4,_0x5e867d,_0x58cfb9,_0x1a3aee){return new BPromise(function(_0x1ec7c1,_0x2173f4){var _0x39151c=_0x1a3aee||client;return _0x39151c['request'](_0x78ccf4,_0x58cfb9)['then'](function(_0x5b02b0){logger[_0x5902('0x1a')](_0x5902('0x1b'),_0x5e867d,_0x5902('0x1c'));logger['debug'](_0x5902('0x1d'),_0x5e867d,_0x5902('0x1c'),JSON[_0x5902('0x1e')](_0x5b02b0));if(_0x5b02b0[_0x5902('0x1f')]){if(_0x5b02b0[_0x5902('0x1f')][_0x5902('0x20')]===0x1f4){logger[_0x5902('0x1f')](_0x5902('0x1b'),_0x5e867d,_0x5b02b0['error'][_0x5902('0x21')]);return _0x2173f4(_0x5b02b0[_0x5902('0x1f')][_0x5902('0x21')]);}logger[_0x5902('0x1f')](_0x5902('0x1b'),_0x5e867d,_0x5b02b0[_0x5902('0x1f')][_0x5902('0x21')]);return _0x1ec7c1(_0x5b02b0[_0x5902('0x1f')][_0x5902('0x21')]);}else{logger[_0x5902('0x1a')]('VtigerAccount,\x20%s,\x20%s',_0x5e867d,_0x5902('0x1c'));_0x1ec7c1(_0x5b02b0[_0x5902('0x22')]['message']);}})[_0x5902('0x23')](function(_0x11175d){logger[_0x5902('0x1f')](_0x5902('0x1b'),_0x5e867d,_0x11175d);_0x2173f4(_0x11175d);});});}function respondWithStatusCode(_0x5b403d,_0x347fab){_0x347fab=_0x347fab||0xcc;return function(_0x5d9caf){if(_0x5d9caf){return _0x5b403d[_0x5902('0x24')](_0x347fab);}return _0x5b403d[_0x5902('0x25')](_0x347fab)['end']();};}function respondWithResult(_0x13e0c3,_0x541069){_0x541069=_0x541069||0xc8;return function(_0x51ef56){if(_0x51ef56){return _0x13e0c3[_0x5902('0x25')](_0x541069)[_0x5902('0x26')](_0x51ef56);}};}function respondWithFilteredResult(_0x312cd5,_0x468871){return function(_0x26c9f8){if(_0x26c9f8){var _0xff4cbd=_0x26c9f8[_0x5902('0x27')],_0x497370=_0x468871['offset'],_0x137987=_0x468871['offset']+_0x468871['limit'],_0x1f7915;if(_0x137987>=_0xff4cbd){_0x137987=_0xff4cbd;_0x1f7915=0xc8;}else{_0x1f7915=0xce;}_0x312cd5[_0x5902('0x25')](_0x1f7915);return _0x312cd5[_0x5902('0x28')](_0x5902('0x29'),_0x497370+'-'+_0x137987+'/'+_0xff4cbd)['json'](_0x26c9f8);}return null;};}function patchUpdates(_0x346d1b){return function(_0x46782a){try{jsonpatch[_0x5902('0x2a')](_0x46782a,_0x346d1b,!![]);}catch(_0x48f3eb){return BPromise[_0x5902('0x2b')](_0x48f3eb);}return _0x46782a[_0x5902('0x2c')]();};}function saveUpdates(_0x420b64,_0x581d60){return function(_0x15d5d7){if(_0x15d5d7){return _0x15d5d7['update'](_0x420b64)['then'](function(_0x5c5872){return _0x5c5872;});}return null;};}function removeEntity(_0x511cad,_0x5921ad){return function(_0x533493){if(_0x533493){return _0x533493[_0x5902('0x2d')]()['then'](function(){_0x511cad[_0x5902('0x25')](0xcc)[_0x5902('0x2e')]();});}};}function handleEntityNotFound(_0x246d76,_0x31b5f5){return function(_0x363ecd){if(!_0x363ecd){_0x246d76[_0x5902('0x24')](0x194);}return _0x363ecd;};}function handleError(_0x2f91e1,_0x3d78fd){_0x3d78fd=_0x3d78fd||0x1f4;return function(_0x423adf){logger['error'](_0x423adf[_0x5902('0x2f')]);if(_0x423adf[_0x5902('0x30')]){delete _0x423adf[_0x5902('0x30')];}_0x2f91e1['status'](_0x3d78fd)['send'](_0x423adf);};}exports[_0x5902('0x31')]=function(_0x1f1d99,_0x5568e9){var _0x3a9dd0={},_0x26c612={},_0x6febf2={'count':0x0,'rows':[]};var _0x2ef48f=_['map'](db[_0x5902('0x32')][_0x5902('0x33')],function(_0x297212){return{'name':_0x297212['fieldName'],'type':_0x297212['type'][_0x5902('0x34')]};});_0x26c612['model']=_[_0x5902('0x35')](_0x2ef48f,_0x5902('0x30'));_0x26c612[_0x5902('0x36')]=_['keys'](_0x1f1d99[_0x5902('0x36')]);_0x26c612[_0x5902('0x37')]=_['intersection'](_0x26c612[_0x5902('0x38')],_0x26c612['query']);_0x3a9dd0['attributes']=_[_0x5902('0x39')](_0x26c612[_0x5902('0x38')],qs[_0x5902('0x3a')](_0x1f1d99[_0x5902('0x36')][_0x5902('0x3a')]));_0x3a9dd0[_0x5902('0x3b')]=_0x3a9dd0[_0x5902('0x3b')][_0x5902('0x3c')]?_0x3a9dd0[_0x5902('0x3b')]:_0x26c612[_0x5902('0x38')];if(!_0x1f1d99[_0x5902('0x36')]['hasOwnProperty'](_0x5902('0x3d'))){_0x3a9dd0[_0x5902('0x3e')]=qs[_0x5902('0x3e')](_0x1f1d99[_0x5902('0x36')][_0x5902('0x3e')]);_0x3a9dd0['offset']=qs[_0x5902('0x3f')](_0x1f1d99[_0x5902('0x36')][_0x5902('0x3f')]);}_0x3a9dd0['order']=qs[_0x5902('0x40')](_0x1f1d99[_0x5902('0x36')][_0x5902('0x40')]);_0x3a9dd0['where']=qs['filters'](_['pick'](_0x1f1d99[_0x5902('0x36')],_0x26c612['filters']),_0x2ef48f);if(_0x1f1d99[_0x5902('0x36')][_0x5902('0x41')]){_0x3a9dd0[_0x5902('0x42')]=_['merge'](_0x3a9dd0[_0x5902('0x42')],{'$or':_[_0x5902('0x35')](_0x2ef48f,function(_0x3cc414){if(_0x3cc414[_0x5902('0x43')]!==_0x5902('0x44')){var _0xc3f59e={};_0xc3f59e[_0x3cc414[_0x5902('0x30')]]={'$like':'%'+_0x1f1d99[_0x5902('0x36')][_0x5902('0x41')]+'%'};return _0xc3f59e;}})});}_0x3a9dd0=_[_0x5902('0x45')]({},_0x3a9dd0,_0x1f1d99[_0x5902('0x46')]);var _0x1de2ba={'where':_0x3a9dd0['where']};return db['VtigerAccount']['count'](_0x1de2ba)[_0x5902('0x47')](function(_0xeb6cd3){_0x6febf2['count']=_0xeb6cd3;if(_0x1f1d99[_0x5902('0x36')][_0x5902('0x48')]){_0x3a9dd0['include']=[{'all':!![]}];}return db[_0x5902('0x32')]['findAll'](_0x3a9dd0);})[_0x5902('0x47')](function(_0x1159b0){_0x6febf2[_0x5902('0x49')]=_0x1159b0;return _0x6febf2;})[_0x5902('0x47')](respondWithFilteredResult(_0x5568e9,_0x3a9dd0))[_0x5902('0x23')](handleError(_0x5568e9,null));};exports[_0x5902('0x4a')]=function(_0x96d719,_0x155009){var _0x2b98d9={'raw':![],'where':{'id':_0x96d719[_0x5902('0x4b')]['id']}},_0x196095={};_0x196095[_0x5902('0x38')]=_[_0x5902('0x4c')](db[_0x5902('0x32')][_0x5902('0x33')]);_0x196095[_0x5902('0x36')]=_[_0x5902('0x4c')](_0x96d719['query']);_0x196095[_0x5902('0x37')]=_['intersection'](_0x196095[_0x5902('0x38')],_0x196095[_0x5902('0x36')]);_0x2b98d9[_0x5902('0x3b')]=_['intersection'](_0x196095['model'],qs['fields'](_0x96d719['query']['fields']));_0x2b98d9['attributes']=_0x2b98d9['attributes'][_0x5902('0x3c')]?_0x2b98d9[_0x5902('0x3b')]:_0x196095[_0x5902('0x38')];if(_0x96d719[_0x5902('0x36')][_0x5902('0x48')]){_0x2b98d9[_0x5902('0x4d')]=[{'all':!![]}];}_0x2b98d9=_[_0x5902('0x45')]({},_0x2b98d9,_0x96d719[_0x5902('0x46')]);return db['VtigerAccount']['find'](_0x2b98d9)[_0x5902('0x47')](handleEntityNotFound(_0x155009,null))[_0x5902('0x47')](respondWithResult(_0x155009,null))['catch'](handleError(_0x155009,null));};exports['create']=function(_0x23cde7,_0x3c2570){return db[_0x5902('0x32')][_0x5902('0x4e')](_0x23cde7[_0x5902('0x4f')],{})[_0x5902('0x47')](respondWithResult(_0x3c2570,0xc9))['catch'](handleError(_0x3c2570,null));};exports[_0x5902('0x50')]=function(_0x3963b4,_0x4013a3){if(_0x3963b4[_0x5902('0x4f')]['id']){delete _0x3963b4[_0x5902('0x4f')]['id'];}return db[_0x5902('0x32')][_0x5902('0x51')]({'where':{'id':_0x3963b4[_0x5902('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4013a3,null))[_0x5902('0x47')](saveUpdates(_0x3963b4['body'],null))[_0x5902('0x47')](respondWithResult(_0x4013a3,null))['catch'](handleError(_0x4013a3,null));};exports[_0x5902('0x2d')]=function(_0x38ca04,_0xada237){return db[_0x5902('0x32')][_0x5902('0x51')]({'where':{'id':_0x38ca04['params']['id']}})[_0x5902('0x47')](handleEntityNotFound(_0xada237,null))[_0x5902('0x47')](removeEntity(_0xada237,null))[_0x5902('0x23')](handleError(_0xada237,null));};exports['getConfigurations']=function(_0xa6e182,_0x483f66,_0x9af726){var _0x56455e={};var _0x4f529b={};var _0x173a78;var _0x23f3e1;return db['VtigerAccount'][_0x5902('0x52')]({'where':{'id':_0xa6e182[_0x5902('0x4b')]['id']}})[_0x5902('0x47')](handleEntityNotFound(_0x483f66,null))[_0x5902('0x47')](function(_0x51fcb1){if(_0x51fcb1){_0x173a78=_0x51fcb1;_0x4f529b[_0x5902('0x38')]=_[_0x5902('0x4c')](db['VtigerConfiguration'][_0x5902('0x33')]);_0x4f529b[_0x5902('0x36')]=_[_0x5902('0x4c')](_0xa6e182[_0x5902('0x36')]);_0x4f529b['filters']=_['intersection'](_0x4f529b['model'],_0x4f529b[_0x5902('0x36')]);_0x56455e[_0x5902('0x3b')]=_[_0x5902('0x39')](_0x4f529b[_0x5902('0x38')],qs[_0x5902('0x3a')](_0xa6e182[_0x5902('0x36')][_0x5902('0x3a')]));_0x56455e[_0x5902('0x3b')]=_0x56455e['attributes'][_0x5902('0x3c')]?_0x56455e[_0x5902('0x3b')]:_0x4f529b['model'];_0x56455e[_0x5902('0x53')]=qs[_0x5902('0x40')](_0xa6e182['query']['sort']);_0x56455e[_0x5902('0x42')]=qs[_0x5902('0x37')](_[_0x5902('0x54')](_0xa6e182['query'],_0x4f529b[_0x5902('0x37')]));if(_0xa6e182[_0x5902('0x36')][_0x5902('0x41')]){_0x56455e['where']=_['merge'](_0x56455e['where'],{'$or':_[_0x5902('0x35')](_0x56455e[_0x5902('0x3b')],function(_0x509026){var _0x179a16={};_0x179a16[_0x509026]={'$like':'%'+_0xa6e182['query'][_0x5902('0x41')]+'%'};return _0x179a16;})});}_0x56455e=_[_0x5902('0x45')]({},_0x56455e,_0xa6e182['options']);return _0x173a78['getConfigurations'](_0x56455e);}})[_0x5902('0x47')](function(_0x191a74){if(_0x191a74){_0x23f3e1=_0x191a74[_0x5902('0x3c')];if(!_0xa6e182['query'][_0x5902('0x55')](_0x5902('0x3d'))){_0x56455e[_0x5902('0x3e')]=qs[_0x5902('0x3e')](_0xa6e182['query']['limit']);_0x56455e[_0x5902('0x3f')]=qs[_0x5902('0x3f')](_0xa6e182['query'][_0x5902('0x3f')]);}return _0x173a78[_0x5902('0x56')](_0x56455e);}})[_0x5902('0x47')](function(_0x5c147f){if(_0x5c147f){return _0x5c147f?{'count':_0x23f3e1,'rows':_0x5c147f}:null;}})[_0x5902('0x47')](respondWithResult(_0x483f66,null))[_0x5902('0x23')](handleError(_0x483f66,null));};exports[_0x5902('0x57')]=function(_0x591771,_0x38b666,_0x261d50){if(_0x591771[_0x5902('0x4f')]['id']){delete _0x591771['body']['id'];}return db[_0x5902('0x32')][_0x5902('0x52')]({'where':{'id':_0x591771[_0x5902('0x4b')]['id']}})[_0x5902('0x47')](handleEntityNotFound(_0x38b666,null))[_0x5902('0x47')](function(_0x28c1f3){if(_0x28c1f3){_0x591771['body'][_0x5902('0x58')]=_0x28c1f3['id'];_0x591771[_0x5902('0x4f')]['Subjects']=integrations[_0x5902('0x59')](_0x591771[_0x5902('0x4f')][_0x5902('0x5a')],_0x591771['body'][_0x5902('0x43')]);_0x591771[_0x5902('0x4f')][_0x5902('0x5b')]=integrations['getDescriptions'](_0x591771[_0x5902('0x4f')][_0x5902('0x5a')],_0x591771[_0x5902('0x4f')][_0x5902('0x43')]);return db[_0x5902('0x5c')][_0x5902('0x4e')](_0x591771[_0x5902('0x4f')],{'include':[{'model':db[_0x5902('0x5d')],'as':'Subjects'},{'model':db[_0x5902('0x5d')],'as':_0x5902('0x5b')}]});}return null;})[_0x5902('0x47')](respondWithResult(_0x38b666,null))['catch'](handleError(_0x38b666,null));};var md5=require('md5');exports[_0x5902('0x5e')]=function(_0x815ee1,_0x38053a,_0x13fa5c){var _0x2c0dad=null;var _0x1f83b2=null;var _0x28c944=null;var _0x26e383=null;var _0xb8a079='';return db['VtigerAccount'][_0x5902('0x52')]({'where':{'id':_0x815ee1[_0x5902('0x4b')]['id']},'attributes':['id','name',_0x5902('0x5f'),_0x5902('0x60'),_0x5902('0x61'),_0x5902('0x62'),_0x5902('0x63'),_0x5902('0x64')]})[_0x5902('0x47')](handleEntityNotFound(_0x38053a,null))[_0x5902('0x47')](function(_0x55a9cc){if(_0x55a9cc){_0x2c0dad=_0x55a9cc[_0x5902('0x5f')];_0x1f83b2=_0x55a9cc['accessKey'];_0x28c944=_0x55a9cc[_0x5902('0x61')];_0xb8a079=_0x55a9cc['remoteUri'];var _0x2308b3=_0xb8a079['slice'](-0x1);if(_0x2308b3==='/'){_0xb8a079=_0xb8a079['substring'](0x0,_0xb8a079[_0x5902('0x65')](_0x2308b3));}_0x26e383=util[_0x5902('0x66')](_0x5902('0x67'),_0xb8a079);var _0x525f2e={'method':_0x5902('0x68'),'uri':_0x26e383,'qs':{'operation':_0x5902('0x69'),'username':_0x55a9cc['username']},'json':!![]};return rp(_0x525f2e);}})[_0x5902('0x47')](function(_0x3c70d9){if(_0x3c70d9[_0x5902('0x6a')]){var _0x5bc1a4={'method':_0x5902('0x6b'),'uri':_0x26e383,'form':{'operation':_0x5902('0x6c'),'username':_0x2c0dad,'accessKey':md5(_0x3c70d9[_0x5902('0x22')][_0x5902('0x6d')]+_0x1f83b2)},'json':!![]};return rp(_0x5bc1a4);}})['then'](function(_0x283eda){if(_0x283eda[_0x5902('0x6a')]){var _0x4c3b21={'method':'GET','uri':_0x26e383,'qs':{'operation':_0x5902('0x6e'),'username':_0x2c0dad,'sessionName':_0x283eda['result'][_0x5902('0x6f')],'elementType':_0x28c944},'json':!![]};return rp(_0x4c3b21);}})['then'](function(_0x3a641f){if(_0x3a641f['success']){var _0x3966f6=[_0x5902('0x70'),'reference',_0x5902('0x71')];_[_0x5902('0x72')](_0x3a641f[_0x5902('0x22')][_0x5902('0x3a')],function(_0x1f7eb4){return _0x3966f6['includes'](_0x1f7eb4['type'][_0x5902('0x30')]);});_['remove'](_0x3a641f[_0x5902('0x22')]['fields'],function(_0x41dfdf){return _0x41dfdf[_0x5902('0x73')]===_0x5902('0x74');});return{'count':_0x3a641f[_0x5902('0x22')]['fields']['length'],'rows':_[_0x5902('0x35')](_0x3a641f[_0x5902('0x22')][_0x5902('0x3a')],function(_0x25cf26){return{'id':_0x25cf26['name'],'name':_0x25cf26[_0x5902('0x75')],'custom':_[_0x5902('0x76')](_0x25cf26[_0x5902('0x30')],'cf_')?!![]:![],'options':_0x25cf26['type'][_0x5902('0x30')]===_0x5902('0x77')&&_0x25cf26[_0x5902('0x43')][_0x5902('0x78')][_0x5902('0x3c')]>0x0?_[_0x5902('0x35')](_0x25cf26[_0x5902('0x43')][_0x5902('0x78')],function(_0x1e9cda){return{'name':_0x1e9cda[_0x5902('0x75')],'value':_0x1e9cda['value']};}):[]};})};}})[_0x5902('0x47')](respondWithResult(_0x38053a,null))[_0x5902('0x23')](function(_0xe39c6c){console[_0x5902('0x79')]('vTiger\x20error:\x20'+_0xe39c6c);var _0x3dce81=_0x815ee1[_0x5902('0x36')][_0x5902('0x16')]?0x1f4:_0xe39c6c[_0x5902('0x7a')]||0x1f4;logger[_0x5902('0x1f')](_0x5902('0x7b'),'getFields',_0x3dce81,JSON['stringify'](_0xe39c6c));delete _0xe39c6c[_0x5902('0x30')];if(_0x3dce81===0x191){_0x3dce81=0x190;}_0x38053a[_0x5902('0x25')](_0x3dce81)[_0x5902('0x7c')](_0x815ee1[_0x5902('0x36')][_0x5902('0x16')]?{'message':_0x5902('0x7d'),'statusCode':_0xe39c6c[_0x5902('0x7a')]}:_0xe39c6c);});}; \ No newline at end of file +var _0x57d2=['send','index','VtigerAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','type','merge','count','includeAll','findAll','rows','params','rawAttributes','include','options','find','create','body','getConfigurations','pick','filter','hasOwnProperty','getSubjects','Descriptions','getDescriptions','channel','VtigerConfiguration','VtigerField','Subjects','md5','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','POST','login','result','success','GET','describe','sessionName','autogenerated','owner','remove','includes','editable','false','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','status','json','offset','limit','set','Content-Range','reject','update','destroy','sendStatus','stack','name'];(function(_0x385dbf,_0x5c27f5){var _0x239097=function(_0x34338f){while(--_0x34338f){_0x385dbf['push'](_0x385dbf['shift']());}};_0x239097(++_0x5c27f5);}(_0x57d2,0xcf));var _0x257d=function(_0x4f2be1,_0xea1319){_0x4f2be1=_0x4f2be1-0x0;var _0x846f9b=_0x57d2[_0x4f2be1];return _0x846f9b;};'use strict';var pdf=require(_0x257d('0x0'));var emlformat=require(_0x257d('0x1'));var rimraf=require(_0x257d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x257d('0x3'));var moment=require(_0x257d('0x4'));var BPromise=require(_0x257d('0x5'));var Mustache=require(_0x257d('0x6'));var util=require(_0x257d('0x7'));var path=require(_0x257d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x257d('0x9'));var fs=require('fs');var _=require(_0x257d('0xa'));var squel=require('squel');var crypto=require(_0x257d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x257d('0xc'));var toCsv=require(_0x257d('0xd'));var querystring=require(_0x257d('0xe'));var Papa=require(_0x257d('0xf'));var Redis=require(_0x257d('0x10'));var authService=require(_0x257d('0x11'));var qs=require(_0x257d('0x12'));var as=require(_0x257d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x257d('0x14'));var utils=require('../../config/utils');var config=require(_0x257d('0x15'));var db=require(_0x257d('0x16'))['db'];var integrations=require(_0x257d('0x17'));var jayson=require(_0x257d('0x18'));var client=jayson[_0x257d('0x19')][_0x257d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2a9146,_0x356600,_0x445eb8){if(_0x445eb8){var _0x5efe72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5efe72[_0x257d('0x1b')](_0x356600)){return _0x2a9146;}else{throw new db[(_0x257d('0x1c'))][(_0x257d('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 _0x2a9146;}}function respondWithRpcPromise(_0x5e7900,_0xf4bf2d,_0x6f1bb3,_0xbde14){return new BPromise(function(_0x29f70a,_0x2be7d2){var _0x323e40=_0xbde14||client;return _0x323e40[_0x257d('0x1e')](_0x5e7900,_0x6f1bb3)[_0x257d('0x1f')](function(_0x104978){logger[_0x257d('0x20')](_0x257d('0x21'),_0xf4bf2d,_0x257d('0x22'));logger[_0x257d('0x23')](_0x257d('0x24'),_0xf4bf2d,_0x257d('0x22'),JSON[_0x257d('0x25')](_0x104978));if(_0x104978['error']){if(_0x104978[_0x257d('0x26')][_0x257d('0x27')]===0x1f4){logger['error'](_0x257d('0x21'),_0xf4bf2d,_0x104978[_0x257d('0x26')]['message']);return _0x2be7d2(_0x104978[_0x257d('0x26')][_0x257d('0x28')]);}logger[_0x257d('0x26')](_0x257d('0x21'),_0xf4bf2d,_0x104978['error'][_0x257d('0x28')]);return _0x29f70a(_0x104978['error'][_0x257d('0x28')]);}else{logger[_0x257d('0x20')]('VtigerAccount,\x20%s,\x20%s',_0xf4bf2d,_0x257d('0x22'));_0x29f70a(_0x104978['result'][_0x257d('0x28')]);}})[_0x257d('0x29')](function(_0x330c8c){logger[_0x257d('0x26')](_0x257d('0x21'),_0xf4bf2d,_0x330c8c);_0x2be7d2(_0x330c8c);});});}function respondWithStatusCode(_0x10fcfe,_0x36d798){_0x36d798=_0x36d798||0xcc;return function(_0x1eb29f){if(_0x1eb29f){return _0x10fcfe['sendStatus'](_0x36d798);}return _0x10fcfe['status'](_0x36d798)[_0x257d('0x2a')]();};}function respondWithResult(_0x3d3794,_0xa3c772){_0xa3c772=_0xa3c772||0xc8;return function(_0x129d9e){if(_0x129d9e){return _0x3d3794[_0x257d('0x2b')](_0xa3c772)[_0x257d('0x2c')](_0x129d9e);}};}function respondWithFilteredResult(_0x4bfd58,_0x1b93a7){return function(_0x37ab32){if(_0x37ab32){var _0x110486=_0x37ab32['count'],_0x1c87cc=_0x1b93a7['offset'],_0x31afcb=_0x1b93a7[_0x257d('0x2d')]+_0x1b93a7[_0x257d('0x2e')],_0x2dee03;if(_0x31afcb>=_0x110486){_0x31afcb=_0x110486;_0x2dee03=0xc8;}else{_0x2dee03=0xce;}_0x4bfd58[_0x257d('0x2b')](_0x2dee03);return _0x4bfd58[_0x257d('0x2f')](_0x257d('0x30'),_0x1c87cc+'-'+_0x31afcb+'/'+_0x110486)[_0x257d('0x2c')](_0x37ab32);}return null;};}function patchUpdates(_0xf99b41){return function(_0x3a7639){try{jsonpatch['apply'](_0x3a7639,_0xf99b41,!![]);}catch(_0x49f16e){return BPromise[_0x257d('0x31')](_0x49f16e);}return _0x3a7639['save']();};}function saveUpdates(_0x117a44,_0x221435){return function(_0x589789){if(_0x589789){return _0x589789[_0x257d('0x32')](_0x117a44)[_0x257d('0x1f')](function(_0x43fa37){return _0x43fa37;});}return null;};}function removeEntity(_0x20f98e,_0x36806e){return function(_0x5628fc){if(_0x5628fc){return _0x5628fc[_0x257d('0x33')]()[_0x257d('0x1f')](function(){_0x20f98e[_0x257d('0x2b')](0xcc)[_0x257d('0x2a')]();});}};}function handleEntityNotFound(_0x16db82,_0x387442){return function(_0x889076){if(!_0x889076){_0x16db82[_0x257d('0x34')](0x194);}return _0x889076;};}function handleError(_0x1b6b29,_0x20fed9){_0x20fed9=_0x20fed9||0x1f4;return function(_0x294128){logger['error'](_0x294128[_0x257d('0x35')]);if(_0x294128[_0x257d('0x36')]){delete _0x294128[_0x257d('0x36')];}_0x1b6b29[_0x257d('0x2b')](_0x20fed9)[_0x257d('0x37')](_0x294128);};}exports[_0x257d('0x38')]=function(_0x30b01c,_0x2bfe56){var _0x544c86={},_0x45654d={},_0x17d890={'count':0x0,'rows':[]};var _0x361619=_['map'](db[_0x257d('0x39')]['rawAttributes'],function(_0x373b7a){return{'name':_0x373b7a[_0x257d('0x3a')],'type':_0x373b7a['type'][_0x257d('0x3b')]};});_0x45654d[_0x257d('0x3c')]=_[_0x257d('0x3d')](_0x361619,_0x257d('0x36'));_0x45654d[_0x257d('0x3e')]=_[_0x257d('0x3f')](_0x30b01c[_0x257d('0x3e')]);_0x45654d[_0x257d('0x40')]=_[_0x257d('0x41')](_0x45654d['model'],_0x45654d['query']);_0x544c86[_0x257d('0x42')]=_['intersection'](_0x45654d[_0x257d('0x3c')],qs[_0x257d('0x43')](_0x30b01c[_0x257d('0x3e')][_0x257d('0x43')]));_0x544c86[_0x257d('0x42')]=_0x544c86['attributes'][_0x257d('0x44')]?_0x544c86[_0x257d('0x42')]:_0x45654d[_0x257d('0x3c')];if(!_0x30b01c[_0x257d('0x3e')]['hasOwnProperty'](_0x257d('0x45'))){_0x544c86['limit']=qs[_0x257d('0x2e')](_0x30b01c[_0x257d('0x3e')][_0x257d('0x2e')]);_0x544c86[_0x257d('0x2d')]=qs['offset'](_0x30b01c[_0x257d('0x3e')][_0x257d('0x2d')]);}_0x544c86[_0x257d('0x46')]=qs[_0x257d('0x47')](_0x30b01c['query']['sort']);_0x544c86[_0x257d('0x48')]=qs['filters'](_['pick'](_0x30b01c[_0x257d('0x3e')],_0x45654d[_0x257d('0x40')]),_0x361619);if(_0x30b01c['query']['filter']){_0x544c86[_0x257d('0x48')]=_['merge'](_0x544c86[_0x257d('0x48')],{'$or':_[_0x257d('0x3d')](_0x361619,function(_0x25614d){if(_0x25614d[_0x257d('0x49')]!=='VIRTUAL'){var _0x19c606={};_0x19c606[_0x25614d[_0x257d('0x36')]]={'$like':'%'+_0x30b01c[_0x257d('0x3e')]['filter']+'%'};return _0x19c606;}})});}_0x544c86=_[_0x257d('0x4a')]({},_0x544c86,_0x30b01c['options']);var _0x581184={'where':_0x544c86['where']};return db['VtigerAccount'][_0x257d('0x4b')](_0x581184)[_0x257d('0x1f')](function(_0x3a0bec){_0x17d890[_0x257d('0x4b')]=_0x3a0bec;if(_0x30b01c[_0x257d('0x3e')][_0x257d('0x4c')]){_0x544c86['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x257d('0x4d')](_0x544c86);})['then'](function(_0xdfb397){_0x17d890[_0x257d('0x4e')]=_0xdfb397;return _0x17d890;})['then'](respondWithFilteredResult(_0x2bfe56,_0x544c86))[_0x257d('0x29')](handleError(_0x2bfe56,null));};exports['show']=function(_0x18510f,_0x1748f1){var _0x344546={'raw':![],'where':{'id':_0x18510f[_0x257d('0x4f')]['id']}},_0x5af75c={};_0x5af75c[_0x257d('0x3c')]=_[_0x257d('0x3f')](db[_0x257d('0x39')][_0x257d('0x50')]);_0x5af75c[_0x257d('0x3e')]=_[_0x257d('0x3f')](_0x18510f[_0x257d('0x3e')]);_0x5af75c['filters']=_[_0x257d('0x41')](_0x5af75c['model'],_0x5af75c[_0x257d('0x3e')]);_0x344546[_0x257d('0x42')]=_['intersection'](_0x5af75c[_0x257d('0x3c')],qs[_0x257d('0x43')](_0x18510f[_0x257d('0x3e')]['fields']));_0x344546[_0x257d('0x42')]=_0x344546[_0x257d('0x42')][_0x257d('0x44')]?_0x344546[_0x257d('0x42')]:_0x5af75c[_0x257d('0x3c')];if(_0x18510f[_0x257d('0x3e')]['includeAll']){_0x344546[_0x257d('0x51')]=[{'all':!![]}];}_0x344546=_['merge']({},_0x344546,_0x18510f[_0x257d('0x52')]);return db['VtigerAccount'][_0x257d('0x53')](_0x344546)[_0x257d('0x1f')](handleEntityNotFound(_0x1748f1,null))[_0x257d('0x1f')](respondWithResult(_0x1748f1,null))[_0x257d('0x29')](handleError(_0x1748f1,null));};exports[_0x257d('0x54')]=function(_0x3eef53,_0x91d4df){return db['VtigerAccount']['create'](_0x3eef53[_0x257d('0x55')],{})[_0x257d('0x1f')](respondWithResult(_0x91d4df,0xc9))[_0x257d('0x29')](handleError(_0x91d4df,null));};exports['update']=function(_0x5a0699,_0x1efec3){if(_0x5a0699[_0x257d('0x55')]['id']){delete _0x5a0699[_0x257d('0x55')]['id'];}return db[_0x257d('0x39')][_0x257d('0x53')]({'where':{'id':_0x5a0699[_0x257d('0x4f')]['id']}})[_0x257d('0x1f')](handleEntityNotFound(_0x1efec3,null))[_0x257d('0x1f')](saveUpdates(_0x5a0699[_0x257d('0x55')],null))[_0x257d('0x1f')](respondWithResult(_0x1efec3,null))['catch'](handleError(_0x1efec3,null));};exports['destroy']=function(_0x480884,_0x14351b){return db['VtigerAccount'][_0x257d('0x53')]({'where':{'id':_0x480884[_0x257d('0x4f')]['id']}})[_0x257d('0x1f')](handleEntityNotFound(_0x14351b,null))[_0x257d('0x1f')](removeEntity(_0x14351b,null))[_0x257d('0x29')](handleError(_0x14351b,null));};exports[_0x257d('0x56')]=function(_0x4fe848,_0x2c5d05,_0x3433e1){var _0x321a7d={};var _0x24473d={};var _0x14f6e9;var _0x1c1699;return db['VtigerAccount']['findOne']({'where':{'id':_0x4fe848['params']['id']}})[_0x257d('0x1f')](handleEntityNotFound(_0x2c5d05,null))['then'](function(_0xfb1338){if(_0xfb1338){_0x14f6e9=_0xfb1338;_0x24473d[_0x257d('0x3c')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x24473d[_0x257d('0x3e')]=_['keys'](_0x4fe848['query']);_0x24473d['filters']=_[_0x257d('0x41')](_0x24473d[_0x257d('0x3c')],_0x24473d[_0x257d('0x3e')]);_0x321a7d[_0x257d('0x42')]=_[_0x257d('0x41')](_0x24473d[_0x257d('0x3c')],qs[_0x257d('0x43')](_0x4fe848[_0x257d('0x3e')][_0x257d('0x43')]));_0x321a7d[_0x257d('0x42')]=_0x321a7d[_0x257d('0x42')][_0x257d('0x44')]?_0x321a7d[_0x257d('0x42')]:_0x24473d[_0x257d('0x3c')];_0x321a7d[_0x257d('0x46')]=qs[_0x257d('0x47')](_0x4fe848[_0x257d('0x3e')][_0x257d('0x47')]);_0x321a7d[_0x257d('0x48')]=qs['filters'](_[_0x257d('0x57')](_0x4fe848[_0x257d('0x3e')],_0x24473d['filters']));if(_0x4fe848[_0x257d('0x3e')][_0x257d('0x58')]){_0x321a7d['where']=_[_0x257d('0x4a')](_0x321a7d[_0x257d('0x48')],{'$or':_[_0x257d('0x3d')](_0x321a7d['attributes'],function(_0x452c97){var _0xef3943={};_0xef3943[_0x452c97]={'$like':'%'+_0x4fe848[_0x257d('0x3e')]['filter']+'%'};return _0xef3943;})});}_0x321a7d=_['merge']({},_0x321a7d,_0x4fe848[_0x257d('0x52')]);return _0x14f6e9[_0x257d('0x56')](_0x321a7d);}})[_0x257d('0x1f')](function(_0xcbda47){if(_0xcbda47){_0x1c1699=_0xcbda47[_0x257d('0x44')];if(!_0x4fe848[_0x257d('0x3e')][_0x257d('0x59')](_0x257d('0x45'))){_0x321a7d[_0x257d('0x2e')]=qs[_0x257d('0x2e')](_0x4fe848[_0x257d('0x3e')][_0x257d('0x2e')]);_0x321a7d[_0x257d('0x2d')]=qs[_0x257d('0x2d')](_0x4fe848[_0x257d('0x3e')][_0x257d('0x2d')]);}return _0x14f6e9[_0x257d('0x56')](_0x321a7d);}})[_0x257d('0x1f')](function(_0x1e2e99){if(_0x1e2e99){return _0x1e2e99?{'count':_0x1c1699,'rows':_0x1e2e99}:null;}})[_0x257d('0x1f')](respondWithResult(_0x2c5d05,null))[_0x257d('0x29')](handleError(_0x2c5d05,null));};exports['addConfiguration']=function(_0x94a74b,_0x1edc2a,_0x4e52d4){if(_0x94a74b[_0x257d('0x55')]['id']){delete _0x94a74b[_0x257d('0x55')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x94a74b['params']['id']}})['then'](handleEntityNotFound(_0x1edc2a,null))[_0x257d('0x1f')](function(_0xe5da1c){if(_0xe5da1c){_0x94a74b[_0x257d('0x55')]['AccountId']=_0xe5da1c['id'];_0x94a74b[_0x257d('0x55')]['Subjects']=integrations[_0x257d('0x5a')](_0x94a74b[_0x257d('0x55')]['channel'],_0x94a74b['body'][_0x257d('0x49')]);_0x94a74b['body'][_0x257d('0x5b')]=integrations[_0x257d('0x5c')](_0x94a74b['body'][_0x257d('0x5d')],_0x94a74b[_0x257d('0x55')][_0x257d('0x49')]);return db[_0x257d('0x5e')][_0x257d('0x54')](_0x94a74b[_0x257d('0x55')],{'include':[{'model':db[_0x257d('0x5f')],'as':_0x257d('0x60')},{'model':db[_0x257d('0x5f')],'as':_0x257d('0x5b')}]});}return null;})[_0x257d('0x1f')](respondWithResult(_0x1edc2a,null))['catch'](handleError(_0x1edc2a,null));};var md5=require(_0x257d('0x61'));exports[_0x257d('0x62')]=function(_0x5d64f0,_0x495bd5,_0x3893fa){var _0x2f59b7=null;var _0x5d27b9=null;var _0x17c83c=null;var _0x2f117c=null;var _0x1f7e43='';return db[_0x257d('0x39')][_0x257d('0x63')]({'where':{'id':_0x5d64f0['params']['id']},'attributes':['id',_0x257d('0x36'),_0x257d('0x64'),_0x257d('0x65'),_0x257d('0x66'),_0x257d('0x67'),_0x257d('0x68'),_0x257d('0x69')]})[_0x257d('0x1f')](handleEntityNotFound(_0x495bd5,null))['then'](function(_0x4e77a4){if(_0x4e77a4){_0x2f59b7=_0x4e77a4[_0x257d('0x64')];_0x5d27b9=_0x4e77a4[_0x257d('0x69')];_0x17c83c=_0x4e77a4[_0x257d('0x66')];_0x1f7e43=_0x4e77a4[_0x257d('0x67')];var _0x3fe2c6=_0x1f7e43[_0x257d('0x6a')](-0x1);if(_0x3fe2c6==='/'){_0x1f7e43=_0x1f7e43['substring'](0x0,_0x1f7e43[_0x257d('0x6b')](_0x3fe2c6));}_0x2f117c=util[_0x257d('0x6c')](_0x257d('0x6d'),_0x1f7e43);var _0x467b2a={'method':'GET','uri':_0x2f117c,'qs':{'operation':'getchallenge','username':_0x4e77a4['username']},'json':!![]};return rp(_0x467b2a);}})[_0x257d('0x1f')](function(_0x382970){if(_0x382970['success']){var _0x51a7b2={'method':_0x257d('0x6e'),'uri':_0x2f117c,'form':{'operation':_0x257d('0x6f'),'username':_0x2f59b7,'accessKey':md5(_0x382970[_0x257d('0x70')]['token']+_0x5d27b9)},'json':!![]};return rp(_0x51a7b2);}})[_0x257d('0x1f')](function(_0x5bee8c){if(_0x5bee8c[_0x257d('0x71')]){var _0x2771f3={'method':_0x257d('0x72'),'uri':_0x2f117c,'qs':{'operation':_0x257d('0x73'),'username':_0x2f59b7,'sessionName':_0x5bee8c[_0x257d('0x70')][_0x257d('0x74')],'elementType':_0x17c83c},'json':!![]};return rp(_0x2771f3);}})['then'](function(_0xfe9a3d){if(_0xfe9a3d['success']){var _0x2e53f6=[_0x257d('0x75'),'reference',_0x257d('0x76')];_[_0x257d('0x77')](_0xfe9a3d[_0x257d('0x70')][_0x257d('0x43')],function(_0x46ec76){return _0x2e53f6[_0x257d('0x78')](_0x46ec76[_0x257d('0x49')][_0x257d('0x36')]);});_[_0x257d('0x77')](_0xfe9a3d[_0x257d('0x70')][_0x257d('0x43')],function(_0x10c750){return _0x10c750[_0x257d('0x79')]===_0x257d('0x7a');});return{'count':_0xfe9a3d[_0x257d('0x70')][_0x257d('0x43')][_0x257d('0x44')],'rows':_[_0x257d('0x3d')](_0xfe9a3d[_0x257d('0x70')][_0x257d('0x43')],function(_0x2b9294){return{'id':_0x2b9294[_0x257d('0x36')],'name':_0x2b9294['label'],'custom':_['startsWith'](_0x2b9294['name'],_0x257d('0x7b'))?!![]:![],'options':_0x2b9294[_0x257d('0x49')][_0x257d('0x36')]===_0x257d('0x7c')&&_0x2b9294['type'][_0x257d('0x7d')][_0x257d('0x44')]>0x0?_[_0x257d('0x3d')](_0x2b9294['type']['picklistValues'],function(_0x3bdfa1){return{'name':_0x3bdfa1[_0x257d('0x7e')],'value':_0x3bdfa1[_0x257d('0x7f')]};}):[]};})};}})[_0x257d('0x1f')](respondWithResult(_0x495bd5,null))['catch'](function(_0x36136d){console['log'](_0x257d('0x80')+_0x36136d);var _0x327c20=_0x5d64f0[_0x257d('0x3e')][_0x257d('0x1b')]?0x1f4:_0x36136d[_0x257d('0x81')]||0x1f4;logger[_0x257d('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x257d('0x62'),_0x327c20,JSON[_0x257d('0x25')](_0x36136d));delete _0x36136d[_0x257d('0x36')];if(_0x327c20===0x191){_0x327c20=0x190;}_0x495bd5[_0x257d('0x2b')](_0x327c20)[_0x257d('0x37')](_0x5d64f0[_0x257d('0x3e')][_0x257d('0x1b')]?{'message':_0x257d('0x82'),'statusCode':_0x36136d[_0x257d('0x81')]}:_0x36136d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 9ce36a2..3fd8750 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 _0x8778=['moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','../../config/logger'];(function(_0x2cb5b3,_0x591ac7){var _0xfa822e=function(_0x493658){while(--_0x493658){_0x2cb5b3['push'](_0x2cb5b3['shift']());}};_0xfa822e(++_0x591ac7);}(_0x8778,0x1a1));var _0x8877=function(_0x26f29f,_0x399888){_0x26f29f=_0x26f29f-0x0;var _0x3e64de=_0x8778[_0x26f29f];return _0x3e64de;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8877('0x0'))('api');var moment=require(_0x8877('0x1'));var BPromise=require(_0x8877('0x2'));var rp=require(_0x8877('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8877('0x4'));var config=require(_0x8877('0x5'));var attributes=require(_0x8877('0x6'));var integrations=require(_0x8877('0x7'));module[_0x8877('0x8')]=function(_0x502f60,_0x3d8e4b){return _0x502f60[_0x8877('0x9')]('VtigerAccount',attributes,{'tableName':_0x8877('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1774=['../../components/integrations/configuration','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x5dd31e,_0x1fed2f){var _0x5d6230=function(_0x7a514b){while(--_0x7a514b){_0x5dd31e['push'](_0x5dd31e['shift']());}};_0x5d6230(++_0x1fed2f);}(_0x1774,0x1bf));var _0x4177=function(_0xe25f69,_0x189354){_0xe25f69=_0xe25f69-0x0;var _0x4d4507=_0x1774[_0xe25f69];return _0x4d4507;};'use strict';var _=require(_0x4177('0x0'));var util=require('util');var logger=require(_0x4177('0x1'))('api');var moment=require(_0x4177('0x2'));var BPromise=require(_0x4177('0x3'));var rp=require(_0x4177('0x4'));var fs=require('fs');var path=require(_0x4177('0x5'));var rimraf=require(_0x4177('0x6'));var config=require(_0x4177('0x7'));var attributes=require(_0x4177('0x8'));var integrations=require(_0x4177('0x9'));module['exports']=function(_0x39dfb5,_0x5c02f7){return _0x39dfb5['define'](_0x4177('0xa'),attributes,{'tableName':_0x4177('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 8a81190..67154cc 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 _0x21c5=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVtigerAccount','VtigerAccount','options','raw','attributes','limit','map','model','include','ShowVtigerAccount','find','where','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x435501,_0x44dbd0){var _0x4b6bcf=function(_0x1b0844){while(--_0x1b0844){_0x435501['push'](_0x435501['shift']());}};_0x4b6bcf(++_0x44dbd0);}(_0x21c5,0x172));var _0x521c=function(_0x2c0630,_0x18a3f7){_0x2c0630=_0x2c0630-0x0;var _0x4ca516=_0x21c5[_0x2c0630];return _0x4ca516;};'use strict';var _=require(_0x521c('0x0'));var util=require('util');var moment=require(_0x521c('0x1'));var BPromise=require(_0x521c('0x2'));var rs=require(_0x521c('0x3'));var fs=require('fs');var Redis=require(_0x521c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x521c('0x5'));var logger=require(_0x521c('0x6'))(_0x521c('0x7'));var config=require(_0x521c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x521c('0x9')][_0x521c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcf55a2,_0x58957c,_0x124446){return new BPromise(function(_0x13b9ff,_0x178b86){return client[_0x521c('0xb')](_0xcf55a2,_0x124446)[_0x521c('0xc')](function(_0x41b7e8){logger[_0x521c('0xd')](_0x521c('0xe'),_0x58957c,_0x521c('0xf'));logger[_0x521c('0x10')](_0x521c('0x11'),_0x58957c,_0x521c('0xf'),JSON[_0x521c('0x12')](_0x41b7e8));if(_0x41b7e8[_0x521c('0x13')]){if(_0x41b7e8['error'][_0x521c('0x14')]===0x1f4){logger[_0x521c('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58957c,_0x41b7e8[_0x521c('0x13')][_0x521c('0x15')]);return _0x178b86(_0x41b7e8[_0x521c('0x13')][_0x521c('0x15')]);}logger[_0x521c('0x13')](_0x521c('0xe'),_0x58957c,_0x41b7e8['error'][_0x521c('0x15')]);return _0x13b9ff(_0x41b7e8[_0x521c('0x13')][_0x521c('0x15')]);}else{logger[_0x521c('0xd')](_0x521c('0xe'),_0x58957c,_0x521c('0xf'));_0x13b9ff(_0x41b7e8['result'][_0x521c('0x15')]);}})['catch'](function(_0x82eee0){logger['error'](_0x521c('0xe'),_0x58957c,_0x82eee0);_0x178b86(_0x82eee0);});});}exports[_0x521c('0x16')]=function(_0x35bbf5){var _0x2e790b=this;return new Promise(function(_0x40e24f,_0x5a6453){return db[_0x521c('0x17')]['findAll']({'raw':_0x35bbf5['options']?_0x35bbf5[_0x521c('0x18')][_0x521c('0x19')]===undefined?!![]:![]:!![],'where':_0x35bbf5['options']?_0x35bbf5[_0x521c('0x18')]['where']||null:null,'attributes':_0x35bbf5[_0x521c('0x18')]?_0x35bbf5[_0x521c('0x18')][_0x521c('0x1a')]||null:null,'limit':_0x35bbf5[_0x521c('0x18')]?_0x35bbf5[_0x521c('0x18')][_0x521c('0x1b')]||null:null,'include':_0x35bbf5[_0x521c('0x18')]?_0x35bbf5[_0x521c('0x18')]['include']?_[_0x521c('0x1c')](_0x35bbf5[_0x521c('0x18')]['include'],function(_0x5ab282){return{'model':db[_0x5ab282[_0x521c('0x1d')]],'as':_0x5ab282['as'],'attributes':_0x5ab282['attributes'],'include':_0x5ab282[_0x521c('0x1e')]?_['map'](_0x5ab282[_0x521c('0x1e')],function(_0x45d6dd){return{'model':db[_0x45d6dd[_0x521c('0x1d')]],'as':_0x45d6dd['as'],'attributes':_0x45d6dd[_0x521c('0x1a')],'include':_0x45d6dd[_0x521c('0x1e')]?_[_0x521c('0x1c')](_0x45d6dd[_0x521c('0x1e')],function(_0x11d4e5){return{'model':db[_0x11d4e5[_0x521c('0x1d')]],'as':_0x11d4e5['as'],'attributes':_0x11d4e5[_0x521c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bf08c){logger['info'](_0x521c('0x16'),_0x35bbf5);logger[_0x521c('0x10')](_0x521c('0x16'),_0x35bbf5,JSON[_0x521c('0x12')](_0x1bf08c));_0x40e24f(_0x1bf08c);})['catch'](function(_0x5eb7fe){logger[_0x521c('0x13')]('GetVtigerAccount',_0x5eb7fe[_0x521c('0x15')],_0x35bbf5);_0x5a6453(_0x2e790b['error'](0x1f4,_0x5eb7fe[_0x521c('0x15')]));});});};exports[_0x521c('0x1f')]=function(_0x36f1ef){var _0x3c19f4=this;return new Promise(function(_0x3bb411,_0x22b7e2){return db[_0x521c('0x17')][_0x521c('0x20')]({'raw':_0x36f1ef[_0x521c('0x18')]?_0x36f1ef[_0x521c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x36f1ef[_0x521c('0x18')]?_0x36f1ef[_0x521c('0x18')][_0x521c('0x21')]||null:null,'attributes':_0x36f1ef[_0x521c('0x18')]?_0x36f1ef[_0x521c('0x18')]['attributes']||null:null,'include':_0x36f1ef[_0x521c('0x18')]?_0x36f1ef['options']['include']?_[_0x521c('0x1c')](_0x36f1ef[_0x521c('0x18')]['include'],function(_0x291154){return{'model':db[_0x291154[_0x521c('0x1d')]],'as':_0x291154['as'],'attributes':_0x291154[_0x521c('0x1a')],'include':_0x291154[_0x521c('0x1e')]?_[_0x521c('0x1c')](_0x291154[_0x521c('0x1e')],function(_0x347666){return{'model':db[_0x347666[_0x521c('0x1d')]],'as':_0x347666['as'],'attributes':_0x347666[_0x521c('0x1a')],'include':_0x347666[_0x521c('0x1e')]?_['map'](_0x347666[_0x521c('0x1e')],function(_0x306775){return{'model':db[_0x306775['model']],'as':_0x306775['as'],'attributes':_0x306775[_0x521c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x521c('0xc')](function(_0x35c594){logger[_0x521c('0xd')](_0x521c('0x1f'),_0x36f1ef);logger[_0x521c('0x10')](_0x521c('0x1f'),_0x36f1ef,JSON[_0x521c('0x12')](_0x35c594));_0x3bb411(_0x35c594);})[_0x521c('0x22')](function(_0x37d6dd){logger[_0x521c('0x13')](_0x521c('0x1f'),_0x37d6dd[_0x521c('0x15')],_0x36f1ef);_0x22b7e2(_0x3c19f4['error'](0x1f4,_0x37d6dd['message']));});});}; \ No newline at end of file +var _0x5729=['attributes','limit','include','model','map','GetVtigerAccount','find','raw','where','ShowVtigerAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VtigerAccount','findAll','options'];(function(_0x42cd21,_0x5454a8){var _0x563dc3=function(_0x2ee443){while(--_0x2ee443){_0x42cd21['push'](_0x42cd21['shift']());}};_0x563dc3(++_0x5454a8);}(_0x5729,0x1a1));var _0x9572=function(_0x484195,_0x25a4d2){_0x484195=_0x484195-0x0;var _0xd057ff=_0x5729[_0x484195];return _0xd057ff;};'use strict';var _=require(_0x9572('0x0'));var util=require(_0x9572('0x1'));var moment=require('moment');var BPromise=require(_0x9572('0x2'));var rs=require(_0x9572('0x3'));var fs=require('fs');var Redis=require(_0x9572('0x4'));var db=require(_0x9572('0x5'))['db'];var utils=require(_0x9572('0x6'));var logger=require('../../config/logger')(_0x9572('0x7'));var config=require(_0x9572('0x8'));var jayson=require(_0x9572('0x9'));var client=jayson[_0x9572('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x404a82,_0xb3743b,_0x4a31de){return new BPromise(function(_0x35d2dd,_0x1666b0){return client[_0x9572('0xb')](_0x404a82,_0x4a31de)[_0x9572('0xc')](function(_0x1b2893){logger['info'](_0x9572('0xd'),_0xb3743b,_0x9572('0xe'));logger[_0x9572('0xf')](_0x9572('0x10'),_0xb3743b,_0x9572('0xe'),JSON[_0x9572('0x11')](_0x1b2893));if(_0x1b2893[_0x9572('0x12')]){if(_0x1b2893[_0x9572('0x12')][_0x9572('0x13')]===0x1f4){logger[_0x9572('0x12')](_0x9572('0xd'),_0xb3743b,_0x1b2893[_0x9572('0x12')][_0x9572('0x14')]);return _0x1666b0(_0x1b2893[_0x9572('0x12')][_0x9572('0x14')]);}logger[_0x9572('0x12')](_0x9572('0xd'),_0xb3743b,_0x1b2893[_0x9572('0x12')][_0x9572('0x14')]);return _0x35d2dd(_0x1b2893[_0x9572('0x12')]['message']);}else{logger[_0x9572('0x15')](_0x9572('0xd'),_0xb3743b,_0x9572('0xe'));_0x35d2dd(_0x1b2893[_0x9572('0x16')][_0x9572('0x14')]);}})[_0x9572('0x17')](function(_0x77903b){logger[_0x9572('0x12')](_0x9572('0xd'),_0xb3743b,_0x77903b);_0x1666b0(_0x77903b);});});}exports['GetVtigerAccount']=function(_0x58df9a){var _0x1807f0=this;return new Promise(function(_0xc86f2c,_0x1a4bff){return db[_0x9572('0x18')][_0x9572('0x19')]({'raw':_0x58df9a[_0x9572('0x1a')]?_0x58df9a[_0x9572('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x58df9a['options']?_0x58df9a['options']['where']||null:null,'attributes':_0x58df9a[_0x9572('0x1a')]?_0x58df9a[_0x9572('0x1a')][_0x9572('0x1b')]||null:null,'limit':_0x58df9a['options']?_0x58df9a[_0x9572('0x1a')][_0x9572('0x1c')]||null:null,'include':_0x58df9a[_0x9572('0x1a')]?_0x58df9a[_0x9572('0x1a')][_0x9572('0x1d')]?_['map'](_0x58df9a['options'][_0x9572('0x1d')],function(_0x175e23){return{'model':db[_0x175e23[_0x9572('0x1e')]],'as':_0x175e23['as'],'attributes':_0x175e23[_0x9572('0x1b')],'include':_0x175e23[_0x9572('0x1d')]?_[_0x9572('0x1f')](_0x175e23[_0x9572('0x1d')],function(_0x4f8f43){return{'model':db[_0x4f8f43[_0x9572('0x1e')]],'as':_0x4f8f43['as'],'attributes':_0x4f8f43['attributes'],'include':_0x4f8f43[_0x9572('0x1d')]?_[_0x9572('0x1f')](_0x4f8f43['include'],function(_0xafc181){return{'model':db[_0xafc181[_0x9572('0x1e')]],'as':_0xafc181['as'],'attributes':_0xafc181['attributes']};}):[]};}):[]};}):[]:[]})[_0x9572('0xc')](function(_0x4983ab){logger[_0x9572('0x15')]('GetVtigerAccount',_0x58df9a);logger[_0x9572('0xf')](_0x9572('0x20'),_0x58df9a,JSON[_0x9572('0x11')](_0x4983ab));_0xc86f2c(_0x4983ab);})[_0x9572('0x17')](function(_0x808784){logger[_0x9572('0x12')]('GetVtigerAccount',_0x808784[_0x9572('0x14')],_0x58df9a);_0x1a4bff(_0x1807f0['error'](0x1f4,_0x808784['message']));});});};exports['ShowVtigerAccount']=function(_0x4d1d14){var _0x50abc9=this;return new Promise(function(_0x4d4b61,_0x28e74a){return db[_0x9572('0x18')][_0x9572('0x21')]({'raw':_0x4d1d14[_0x9572('0x1a')]?_0x4d1d14['options'][_0x9572('0x22')]===undefined?!![]:![]:!![],'where':_0x4d1d14[_0x9572('0x1a')]?_0x4d1d14[_0x9572('0x1a')][_0x9572('0x23')]||null:null,'attributes':_0x4d1d14[_0x9572('0x1a')]?_0x4d1d14[_0x9572('0x1a')][_0x9572('0x1b')]||null:null,'include':_0x4d1d14[_0x9572('0x1a')]?_0x4d1d14['options'][_0x9572('0x1d')]?_[_0x9572('0x1f')](_0x4d1d14['options']['include'],function(_0x47bdef){return{'model':db[_0x47bdef[_0x9572('0x1e')]],'as':_0x47bdef['as'],'attributes':_0x47bdef[_0x9572('0x1b')],'include':_0x47bdef['include']?_[_0x9572('0x1f')](_0x47bdef[_0x9572('0x1d')],function(_0x37a505){return{'model':db[_0x37a505[_0x9572('0x1e')]],'as':_0x37a505['as'],'attributes':_0x37a505[_0x9572('0x1b')],'include':_0x37a505['include']?_['map'](_0x37a505[_0x9572('0x1d')],function(_0x4188d1){return{'model':db[_0x4188d1[_0x9572('0x1e')]],'as':_0x4188d1['as'],'attributes':_0x4188d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x9572('0xc')](function(_0x16217f){logger[_0x9572('0x15')]('ShowVtigerAccount',_0x4d1d14);logger['debug'](_0x9572('0x24'),_0x4d1d14,JSON[_0x9572('0x11')](_0x16217f));_0x4d4b61(_0x16217f);})['catch'](function(_0x43e568){logger['error'](_0x9572('0x24'),_0x43e568['message'],_0x4d1d14);_0x28e74a(_0x50abc9[_0x9572('0x12')](0x1f4,_0x43e568[_0x9572('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ea34b39..16a943f 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(_0x526fa1,_0x972edc){var _0x3a4983=function(_0x4756eb){while(--_0x4756eb){_0x526fa1['push'](_0x526fa1['shift']());}};_0x3a4983(++_0x972edc);}(_0xb10b,0x12a));var _0xbb10=function(_0x16df8f,_0x3dbe15){_0x16df8f=_0x16df8f-0x0;var _0x56ffee=_0xb10b[_0x16df8f];return _0x56ffee;};'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(_0x34466a,_0x31c8ca){var _0x579cda=function(_0xc5846d){while(--_0xc5846d){_0x34466a['push'](_0x34466a['shift']());}};_0x579cda(++_0x31c8ca);}(_0xb10b,0x12a));var _0xbb10=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0xb10b[_0x576d8a];return _0x3dc3ef;};'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 1594b95..f467062 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 _0x1982=['exports','STRING','sequelize'];(function(_0x1ced6b,_0x50f476){var _0xeb19e3=function(_0x14c470){while(--_0x14c470){_0x1ced6b['push'](_0x1ced6b['shift']());}};_0xeb19e3(++_0x50f476);}(_0x1982,0x77));var _0x2198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1982[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2198('0x0'));module[_0x2198('0x1')]={'name':{'type':Sequelize[_0x2198('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc1d2=['STRING','sequelize'];(function(_0x4fab1a,_0x2a819b){var _0xdd4a=function(_0x4a7cb1){while(--_0x4a7cb1){_0x4fab1a['push'](_0x4fab1a['shift']());}};_0xdd4a(++_0x2a819b);}(_0xc1d2,0x129));var _0x2c1d=function(_0x545c84,_0x1ad760){_0x545c84=_0x545c84-0x0;var _0xc0de48=_0xc1d2[_0x545c84];return _0xc0de48;};'use strict';var Sequelize=require(_0x2c1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c1d('0x1')]},'description':{'type':Sequelize[_0x2c1d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 90b1ada..185a710 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 _0xb5b1=['query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','catch','params','find','create','body','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','html-pdf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','model'];(function(_0x24f722,_0x28379b){var _0x43acf5=function(_0x6986d3){while(--_0x6986d3){_0x24f722['push'](_0x24f722['shift']());}};_0x43acf5(++_0x28379b);}(_0xb5b1,0xcb));var _0x1b5b=function(_0x1f90e0,_0x187800){_0x1f90e0=_0x1f90e0-0x0;var _0x3e2013=_0xb5b1[_0x1f90e0];return _0x3e2013;};'use strict';var pdf=require(_0x1b5b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1b5b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1b5b('0x2'));var Mustache=require(_0x1b5b('0x3'));var util=require('util');var path=require('path');var sox=require(_0x1b5b('0x4'));var csv=require(_0x1b5b('0x5'));var ejs=require(_0x1b5b('0x6'));var fs=require('fs');var _=require(_0x1b5b('0x7'));var squel=require('squel');var crypto=require(_0x1b5b('0x8'));var jsforce=require(_0x1b5b('0x9'));var deskjs=require(_0x1b5b('0xa'));var toCsv=require(_0x1b5b('0x5'));var querystring=require(_0x1b5b('0xb'));var Papa=require(_0x1b5b('0xc'));var Redis=require(_0x1b5b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1b5b('0xe'));var as=require(_0x1b5b('0xf'));var hardwareService=require(_0x1b5b('0x10'));var logger=require(_0x1b5b('0x11'))('api');var utils=require(_0x1b5b('0x12'));var config=require(_0x1b5b('0x13'));var db=require(_0x1b5b('0x14'))['db'];var jayson=require(_0x1b5b('0x15'));var client=jayson[_0x1b5b('0x16')][_0x1b5b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x592053,_0x1de84c,_0x484e83){if(_0x484e83){var _0x5e26dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e26dc[_0x1b5b('0x18')](_0x1de84c)){return _0x592053;}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 _0x592053;}}function respondWithRpcPromise(_0x1cbd35,_0x4ee7a1,_0x4ebb64,_0x246ba0){return new BPromise(function(_0x5e98c4,_0x12dcc9){var _0x3a421a=_0x246ba0||client;return _0x3a421a[_0x1b5b('0x19')](_0x1cbd35,_0x4ebb64)['then'](function(_0x3743f8){logger[_0x1b5b('0x1a')](_0x1b5b('0x1b'),_0x4ee7a1,_0x1b5b('0x1c'));logger['debug'](_0x1b5b('0x1d'),_0x4ee7a1,_0x1b5b('0x1c'),JSON[_0x1b5b('0x1e')](_0x3743f8));if(_0x3743f8['error']){if(_0x3743f8['error'][_0x1b5b('0x1f')]===0x1f4){logger[_0x1b5b('0x20')](_0x1b5b('0x1b'),_0x4ee7a1,_0x3743f8['error'][_0x1b5b('0x21')]);return _0x12dcc9(_0x3743f8[_0x1b5b('0x20')]['message']);}logger[_0x1b5b('0x20')](_0x1b5b('0x1b'),_0x4ee7a1,_0x3743f8[_0x1b5b('0x20')][_0x1b5b('0x21')]);return _0x5e98c4(_0x3743f8[_0x1b5b('0x20')]['message']);}else{logger[_0x1b5b('0x1a')](_0x1b5b('0x1b'),_0x4ee7a1,'request\x20sent');_0x5e98c4(_0x3743f8['result'][_0x1b5b('0x21')]);}})['catch'](function(_0x5df74e){logger['error'](_0x1b5b('0x1b'),_0x4ee7a1,_0x5df74e);_0x12dcc9(_0x5df74e);});});}function respondWithStatusCode(_0x19999a,_0x336511){_0x336511=_0x336511||0xcc;return function(_0x46dacd){if(_0x46dacd){return _0x19999a['sendStatus'](_0x336511);}return _0x19999a[_0x1b5b('0x22')](_0x336511)[_0x1b5b('0x23')]();};}function respondWithResult(_0x103db9,_0x3aa9e4){_0x3aa9e4=_0x3aa9e4||0xc8;return function(_0x24688e){if(_0x24688e){return _0x103db9[_0x1b5b('0x22')](_0x3aa9e4)[_0x1b5b('0x24')](_0x24688e);}};}function respondWithFilteredResult(_0x1b0822,_0x25dd40){return function(_0x5ec28f){if(_0x5ec28f){var _0x353d0d=_0x5ec28f['count'],_0x3db10f=_0x25dd40[_0x1b5b('0x25')],_0x11ce93=_0x25dd40[_0x1b5b('0x25')]+_0x25dd40['limit'],_0x1b70d6;if(_0x11ce93>=_0x353d0d){_0x11ce93=_0x353d0d;_0x1b70d6=0xc8;}else{_0x1b70d6=0xce;}_0x1b0822[_0x1b5b('0x22')](_0x1b70d6);return _0x1b0822[_0x1b5b('0x26')](_0x1b5b('0x27'),_0x3db10f+'-'+_0x11ce93+'/'+_0x353d0d)[_0x1b5b('0x24')](_0x5ec28f);}return null;};}function patchUpdates(_0x3cbbd6){return function(_0x8ba71e){try{jsonpatch[_0x1b5b('0x28')](_0x8ba71e,_0x3cbbd6,!![]);}catch(_0x29e44f){return BPromise[_0x1b5b('0x29')](_0x29e44f);}return _0x8ba71e[_0x1b5b('0x2a')]();};}function saveUpdates(_0x3b9759,_0x21111e){return function(_0x2ef8d7){if(_0x2ef8d7){return _0x2ef8d7[_0x1b5b('0x2b')](_0x3b9759)[_0x1b5b('0x2c')](function(_0x349edf){return _0x349edf;});}return null;};}function removeEntity(_0x2cafe0,_0x2a4bd8){return function(_0x52ff6d){if(_0x52ff6d){return _0x52ff6d['destroy']()[_0x1b5b('0x2c')](function(){_0x2cafe0['status'](0xcc)[_0x1b5b('0x23')]();});}};}function handleEntityNotFound(_0xe7cff9,_0x589d7a){return function(_0x2b28ba){if(!_0x2b28ba){_0xe7cff9[_0x1b5b('0x2d')](0x194);}return _0x2b28ba;};}function handleError(_0x17af1e,_0x1affa5){_0x1affa5=_0x1affa5||0x1f4;return function(_0x49cab4){logger['error'](_0x49cab4[_0x1b5b('0x2e')]);if(_0x49cab4[_0x1b5b('0x2f')]){delete _0x49cab4[_0x1b5b('0x2f')];}_0x17af1e['status'](_0x1affa5)[_0x1b5b('0x30')](_0x49cab4);};}exports[_0x1b5b('0x31')]=function(_0x5827de,_0x164472){var _0x30f232={},_0x5ee94a={},_0x82e596={'count':0x0,'rows':[]};var _0x114f86=_[_0x1b5b('0x32')](db[_0x1b5b('0x33')][_0x1b5b('0x34')],function(_0x246af9){return{'name':_0x246af9[_0x1b5b('0x35')],'type':_0x246af9['type']['key']};});_0x5ee94a[_0x1b5b('0x36')]=_[_0x1b5b('0x32')](_0x114f86,_0x1b5b('0x2f'));_0x5ee94a[_0x1b5b('0x37')]=_[_0x1b5b('0x38')](_0x5827de[_0x1b5b('0x37')]);_0x5ee94a['filters']=_[_0x1b5b('0x39')](_0x5ee94a[_0x1b5b('0x36')],_0x5ee94a[_0x1b5b('0x37')]);_0x30f232[_0x1b5b('0x3a')]=_[_0x1b5b('0x39')](_0x5ee94a[_0x1b5b('0x36')],qs[_0x1b5b('0x3b')](_0x5827de[_0x1b5b('0x37')][_0x1b5b('0x3b')]));_0x30f232[_0x1b5b('0x3a')]=_0x30f232['attributes'][_0x1b5b('0x3c')]?_0x30f232[_0x1b5b('0x3a')]:_0x5ee94a['model'];if(!_0x5827de[_0x1b5b('0x37')][_0x1b5b('0x3d')]('nolimit')){_0x30f232['limit']=qs['limit'](_0x5827de[_0x1b5b('0x37')][_0x1b5b('0x3e')]);_0x30f232['offset']=qs[_0x1b5b('0x25')](_0x5827de['query']['offset']);}_0x30f232[_0x1b5b('0x3f')]=qs[_0x1b5b('0x40')](_0x5827de[_0x1b5b('0x37')][_0x1b5b('0x40')]);_0x30f232[_0x1b5b('0x41')]=qs[_0x1b5b('0x42')](_[_0x1b5b('0x43')](_0x5827de[_0x1b5b('0x37')],_0x5ee94a[_0x1b5b('0x42')]),_0x114f86);if(_0x5827de['query'][_0x1b5b('0x44')]){_0x30f232[_0x1b5b('0x41')]=_[_0x1b5b('0x45')](_0x30f232[_0x1b5b('0x41')],{'$or':_[_0x1b5b('0x32')](_0x114f86,function(_0x309166){if(_0x309166['type']!=='VIRTUAL'){var _0x2d7734={};_0x2d7734[_0x309166[_0x1b5b('0x2f')]]={'$like':'%'+_0x5827de['query'][_0x1b5b('0x44')]+'%'};return _0x2d7734;}})});}_0x30f232=_[_0x1b5b('0x45')]({},_0x30f232,_0x5827de[_0x1b5b('0x46')]);var _0x1735c0={'where':_0x30f232[_0x1b5b('0x41')]};return db['VtigerConfiguration'][_0x1b5b('0x47')](_0x1735c0)['then'](function(_0x3a24eb){_0x82e596[_0x1b5b('0x47')]=_0x3a24eb;if(_0x5827de[_0x1b5b('0x37')][_0x1b5b('0x48')]){_0x30f232[_0x1b5b('0x49')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x30f232);})[_0x1b5b('0x2c')](function(_0xd74e4f){_0x82e596[_0x1b5b('0x4a')]=_0xd74e4f;return _0x82e596;})[_0x1b5b('0x2c')](respondWithFilteredResult(_0x164472,_0x30f232))[_0x1b5b('0x4b')](handleError(_0x164472,null));};exports['show']=function(_0x26445b,_0x334ce0){var _0x40e677={'raw':![],'where':{'id':_0x26445b[_0x1b5b('0x4c')]['id']}},_0x33d2e8={};_0x33d2e8[_0x1b5b('0x36')]=_[_0x1b5b('0x38')](db[_0x1b5b('0x33')][_0x1b5b('0x34')]);_0x33d2e8[_0x1b5b('0x37')]=_[_0x1b5b('0x38')](_0x26445b[_0x1b5b('0x37')]);_0x33d2e8[_0x1b5b('0x42')]=_[_0x1b5b('0x39')](_0x33d2e8[_0x1b5b('0x36')],_0x33d2e8[_0x1b5b('0x37')]);_0x40e677['attributes']=_[_0x1b5b('0x39')](_0x33d2e8[_0x1b5b('0x36')],qs[_0x1b5b('0x3b')](_0x26445b['query'][_0x1b5b('0x3b')]));_0x40e677['attributes']=_0x40e677[_0x1b5b('0x3a')][_0x1b5b('0x3c')]?_0x40e677['attributes']:_0x33d2e8[_0x1b5b('0x36')];if(_0x26445b[_0x1b5b('0x37')][_0x1b5b('0x48')]){_0x40e677[_0x1b5b('0x49')]=[{'all':!![]}];}_0x40e677=_[_0x1b5b('0x45')]({},_0x40e677,_0x26445b[_0x1b5b('0x46')]);return db['VtigerConfiguration'][_0x1b5b('0x4d')](_0x40e677)[_0x1b5b('0x2c')](handleEntityNotFound(_0x334ce0,null))[_0x1b5b('0x2c')](respondWithResult(_0x334ce0,null))['catch'](handleError(_0x334ce0,null));};exports[_0x1b5b('0x4e')]=function(_0x525281,_0x2e7262){return db[_0x1b5b('0x33')]['create'](_0x525281[_0x1b5b('0x4f')],{})[_0x1b5b('0x2c')](respondWithResult(_0x2e7262,0xc9))[_0x1b5b('0x4b')](handleError(_0x2e7262,null));};exports[_0x1b5b('0x2b')]=function(_0x24cc91,_0x259bdc){if(_0x24cc91[_0x1b5b('0x4f')]['id']){delete _0x24cc91['body']['id'];}return db[_0x1b5b('0x33')][_0x1b5b('0x4d')]({'where':{'id':_0x24cc91[_0x1b5b('0x4c')]['id']}})[_0x1b5b('0x2c')](handleEntityNotFound(_0x259bdc,null))[_0x1b5b('0x2c')](saveUpdates(_0x24cc91[_0x1b5b('0x4f')],null))['then'](respondWithResult(_0x259bdc,null))[_0x1b5b('0x4b')](handleError(_0x259bdc,null));};exports['destroy']=function(_0xee4d19,_0x4a7965){return db[_0x1b5b('0x33')][_0x1b5b('0x4d')]({'where':{'id':_0xee4d19[_0x1b5b('0x4c')]['id']}})[_0x1b5b('0x2c')](handleEntityNotFound(_0x4a7965,null))[_0x1b5b('0x2c')](removeEntity(_0x4a7965,null))[_0x1b5b('0x4b')](handleError(_0x4a7965,null));};exports[_0x1b5b('0x50')]=function(_0x4e7414,_0x543099,_0x1e2cad){var _0x59a4c4={};var _0x2b27f1={};var _0x432160;var _0x4f322c;return db['VtigerConfiguration'][_0x1b5b('0x51')]({'where':{'id':_0x4e7414[_0x1b5b('0x4c')]['id']}})[_0x1b5b('0x2c')](handleEntityNotFound(_0x543099,null))[_0x1b5b('0x2c')](function(_0x22023f){if(_0x22023f){_0x432160=_0x22023f;_0x2b27f1['model']=_[_0x1b5b('0x38')](db[_0x1b5b('0x52')][_0x1b5b('0x34')]);_0x2b27f1[_0x1b5b('0x37')]=_[_0x1b5b('0x38')](_0x4e7414[_0x1b5b('0x37')]);_0x2b27f1[_0x1b5b('0x42')]=_[_0x1b5b('0x39')](_0x2b27f1[_0x1b5b('0x36')],_0x2b27f1['query']);_0x59a4c4[_0x1b5b('0x3a')]=_[_0x1b5b('0x39')](_0x2b27f1[_0x1b5b('0x36')],qs['fields'](_0x4e7414[_0x1b5b('0x37')][_0x1b5b('0x3b')]));_0x59a4c4[_0x1b5b('0x3a')]=_0x59a4c4[_0x1b5b('0x3a')]['length']?_0x59a4c4[_0x1b5b('0x3a')]:_0x2b27f1[_0x1b5b('0x36')];_0x59a4c4[_0x1b5b('0x3f')]=qs['sort'](_0x4e7414[_0x1b5b('0x37')][_0x1b5b('0x40')]);_0x59a4c4['where']=qs['filters'](_[_0x1b5b('0x43')](_0x4e7414[_0x1b5b('0x37')],_0x2b27f1[_0x1b5b('0x42')]));if(_0x4e7414['query'][_0x1b5b('0x44')]){_0x59a4c4['where']=_[_0x1b5b('0x45')](_0x59a4c4[_0x1b5b('0x41')],{'$or':_[_0x1b5b('0x32')](_0x59a4c4['attributes'],function(_0x4a6709){var _0x13e167={};_0x13e167[_0x4a6709]={'$like':'%'+_0x4e7414[_0x1b5b('0x37')][_0x1b5b('0x44')]+'%'};return _0x13e167;})});}_0x59a4c4=_[_0x1b5b('0x45')]({},_0x59a4c4,_0x4e7414[_0x1b5b('0x46')]);return _0x432160[_0x1b5b('0x50')](_0x59a4c4);}})[_0x1b5b('0x2c')](function(_0x334fa2){if(_0x334fa2){_0x4f322c=_0x334fa2[_0x1b5b('0x3c')];if(!_0x4e7414[_0x1b5b('0x37')][_0x1b5b('0x3d')](_0x1b5b('0x53'))){_0x59a4c4[_0x1b5b('0x3e')]=qs[_0x1b5b('0x3e')](_0x4e7414['query'][_0x1b5b('0x3e')]);_0x59a4c4['offset']=qs['offset'](_0x4e7414['query']['offset']);}return _0x432160[_0x1b5b('0x50')](_0x59a4c4);}})['then'](function(_0x1e232f){if(_0x1e232f){return _0x1e232f?{'count':_0x4f322c,'rows':_0x1e232f}:null;}})[_0x1b5b('0x2c')](respondWithResult(_0x543099,null))['catch'](handleError(_0x543099,null));};exports[_0x1b5b('0x54')]=function(_0x398d8a,_0x25b36c,_0x1bb43e){var _0x3d7979={};var _0x14bd39={};var _0x193b05;var _0x42ab50;return db[_0x1b5b('0x33')][_0x1b5b('0x51')]({'where':{'id':_0x398d8a[_0x1b5b('0x4c')]['id']}})[_0x1b5b('0x2c')](handleEntityNotFound(_0x25b36c,null))[_0x1b5b('0x2c')](function(_0x4b2272){if(_0x4b2272){_0x193b05=_0x4b2272;_0x14bd39[_0x1b5b('0x36')]=_[_0x1b5b('0x38')](db[_0x1b5b('0x52')][_0x1b5b('0x34')]);_0x14bd39[_0x1b5b('0x37')]=_[_0x1b5b('0x38')](_0x398d8a[_0x1b5b('0x37')]);_0x14bd39[_0x1b5b('0x42')]=_[_0x1b5b('0x39')](_0x14bd39['model'],_0x14bd39[_0x1b5b('0x37')]);_0x3d7979[_0x1b5b('0x3a')]=_['intersection'](_0x14bd39[_0x1b5b('0x36')],qs[_0x1b5b('0x3b')](_0x398d8a[_0x1b5b('0x37')][_0x1b5b('0x3b')]));_0x3d7979['attributes']=_0x3d7979['attributes']['length']?_0x3d7979['attributes']:_0x14bd39[_0x1b5b('0x36')];_0x3d7979[_0x1b5b('0x3f')]=qs[_0x1b5b('0x40')](_0x398d8a[_0x1b5b('0x37')][_0x1b5b('0x40')]);_0x3d7979[_0x1b5b('0x41')]=qs[_0x1b5b('0x42')](_[_0x1b5b('0x43')](_0x398d8a[_0x1b5b('0x37')],_0x14bd39[_0x1b5b('0x42')]));if(_0x398d8a[_0x1b5b('0x37')][_0x1b5b('0x44')]){_0x3d7979[_0x1b5b('0x41')]=_['merge'](_0x3d7979[_0x1b5b('0x41')],{'$or':_[_0x1b5b('0x32')](_0x3d7979[_0x1b5b('0x3a')],function(_0x22af8c){var _0x3ce7cc={};_0x3ce7cc[_0x22af8c]={'$like':'%'+_0x398d8a[_0x1b5b('0x37')]['filter']+'%'};return _0x3ce7cc;})});}_0x3d7979=_[_0x1b5b('0x45')]({},_0x3d7979,_0x398d8a['options']);return _0x193b05[_0x1b5b('0x54')](_0x3d7979);}})[_0x1b5b('0x2c')](function(_0x46ea45){if(_0x46ea45){_0x42ab50=_0x46ea45[_0x1b5b('0x3c')];if(!_0x398d8a[_0x1b5b('0x37')][_0x1b5b('0x3d')](_0x1b5b('0x53'))){_0x3d7979[_0x1b5b('0x3e')]=qs[_0x1b5b('0x3e')](_0x398d8a[_0x1b5b('0x37')][_0x1b5b('0x3e')]);_0x3d7979['offset']=qs[_0x1b5b('0x25')](_0x398d8a[_0x1b5b('0x37')]['offset']);}return _0x193b05[_0x1b5b('0x54')](_0x3d7979);}})[_0x1b5b('0x2c')](function(_0x30fe7b){if(_0x30fe7b){return _0x30fe7b?{'count':_0x42ab50,'rows':_0x30fe7b}:null;}})['then'](respondWithResult(_0x25b36c,null))[_0x1b5b('0x4b')](handleError(_0x25b36c,null));};exports['getDescriptions']=function(_0x3c7a71,_0x33d44c,_0x44dad9){var _0xf584cc={};var _0x47a90f={};var _0x16a20d;var _0x2e64fb;return db[_0x1b5b('0x33')][_0x1b5b('0x51')]({'where':{'id':_0x3c7a71[_0x1b5b('0x4c')]['id']}})[_0x1b5b('0x2c')](handleEntityNotFound(_0x33d44c,null))[_0x1b5b('0x2c')](function(_0xb29267){if(_0xb29267){_0x16a20d=_0xb29267;_0x47a90f[_0x1b5b('0x36')]=_[_0x1b5b('0x38')](db['VtigerField'][_0x1b5b('0x34')]);_0x47a90f[_0x1b5b('0x37')]=_[_0x1b5b('0x38')](_0x3c7a71[_0x1b5b('0x37')]);_0x47a90f[_0x1b5b('0x42')]=_[_0x1b5b('0x39')](_0x47a90f[_0x1b5b('0x36')],_0x47a90f['query']);_0xf584cc['attributes']=_[_0x1b5b('0x39')](_0x47a90f['model'],qs[_0x1b5b('0x3b')](_0x3c7a71[_0x1b5b('0x37')][_0x1b5b('0x3b')]));_0xf584cc[_0x1b5b('0x3a')]=_0xf584cc['attributes'][_0x1b5b('0x3c')]?_0xf584cc[_0x1b5b('0x3a')]:_0x47a90f['model'];_0xf584cc[_0x1b5b('0x3f')]=qs[_0x1b5b('0x40')](_0x3c7a71[_0x1b5b('0x37')][_0x1b5b('0x40')]);_0xf584cc['where']=qs['filters'](_[_0x1b5b('0x43')](_0x3c7a71[_0x1b5b('0x37')],_0x47a90f['filters']));if(_0x3c7a71[_0x1b5b('0x37')]['filter']){_0xf584cc['where']=_[_0x1b5b('0x45')](_0xf584cc[_0x1b5b('0x41')],{'$or':_[_0x1b5b('0x32')](_0xf584cc[_0x1b5b('0x3a')],function(_0x3c8b42){var _0x47c7a4={};_0x47c7a4[_0x3c8b42]={'$like':'%'+_0x3c7a71[_0x1b5b('0x37')][_0x1b5b('0x44')]+'%'};return _0x47c7a4;})});}_0xf584cc=_['merge']({},_0xf584cc,_0x3c7a71[_0x1b5b('0x46')]);return _0x16a20d[_0x1b5b('0x55')](_0xf584cc);}})['then'](function(_0x39e82c){if(_0x39e82c){_0x2e64fb=_0x39e82c['length'];if(!_0x3c7a71['query'][_0x1b5b('0x3d')](_0x1b5b('0x53'))){_0xf584cc[_0x1b5b('0x3e')]=qs['limit'](_0x3c7a71[_0x1b5b('0x37')][_0x1b5b('0x3e')]);_0xf584cc[_0x1b5b('0x25')]=qs[_0x1b5b('0x25')](_0x3c7a71['query'][_0x1b5b('0x25')]);}return _0x16a20d[_0x1b5b('0x55')](_0xf584cc);}})['then'](function(_0x1cc6a7){if(_0x1cc6a7){return _0x1cc6a7?{'count':_0x2e64fb,'rows':_0x1cc6a7}:null;}})[_0x1b5b('0x2c')](respondWithResult(_0x33d44c,null))[_0x1b5b('0x4b')](handleError(_0x33d44c,null));}; \ No newline at end of file +var _0x5c1b=['map','options','includeAll','include','rows','catch','create','body','find','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','save','update','destroy','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5c1b,0x65));var _0xb5c1=function(_0x54f8ee,_0x1c0493){_0x54f8ee=_0x54f8ee-0x0;var _0x3c50c7=_0x5c1b[_0x54f8ee];return _0x3c50c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb5c1('0x0'));var rimraf=require(_0xb5c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5c1('0x2'));var rp=require(_0xb5c1('0x3'));var moment=require('moment');var BPromise=require(_0xb5c1('0x4'));var Mustache=require('mustache');var util=require(_0xb5c1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb5c1('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5c1('0x7'));var squel=require(_0xb5c1('0x8'));var crypto=require(_0xb5c1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb5c1('0xa'));var toCsv=require(_0xb5c1('0x6'));var querystring=require('querystring');var Papa=require(_0xb5c1('0xb'));var Redis=require(_0xb5c1('0xc'));var authService=require(_0xb5c1('0xd'));var qs=require(_0xb5c1('0xe'));var as=require(_0xb5c1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5c1('0x10'))('api');var utils=require(_0xb5c1('0x11'));var config=require(_0xb5c1('0x12'));var db=require(_0xb5c1('0x13'))['db'];var jayson=require(_0xb5c1('0x14'));var client=jayson['client'][_0xb5c1('0x15')]({'port':0x232a});function checkPasswordPattern(_0x380d82,_0x11ea2e,_0x109da2){if(_0x109da2){var _0x4e63b2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e63b2['test'](_0x11ea2e)){return _0x380d82;}else{throw new db['Sequelize'][(_0xb5c1('0x16'))](_0xb5c1('0x17'));}}else{return _0x380d82;}}function respondWithRpcPromise(_0x258769,_0x2f3893,_0x34658b,_0x17964e){return new BPromise(function(_0x4906ac,_0x339bb9){var _0x5c9c9a=_0x17964e||client;return _0x5c9c9a[_0xb5c1('0x18')](_0x258769,_0x34658b)[_0xb5c1('0x19')](function(_0x4c2332){logger[_0xb5c1('0x1a')]('VtigerConfiguration,\x20%s,\x20%s',_0x2f3893,_0xb5c1('0x1b'));logger['debug'](_0xb5c1('0x1c'),_0x2f3893,_0xb5c1('0x1b'),JSON[_0xb5c1('0x1d')](_0x4c2332));if(_0x4c2332[_0xb5c1('0x1e')]){if(_0x4c2332['error'][_0xb5c1('0x1f')]===0x1f4){logger[_0xb5c1('0x1e')](_0xb5c1('0x20'),_0x2f3893,_0x4c2332[_0xb5c1('0x1e')][_0xb5c1('0x21')]);return _0x339bb9(_0x4c2332[_0xb5c1('0x1e')]['message']);}logger[_0xb5c1('0x1e')](_0xb5c1('0x20'),_0x2f3893,_0x4c2332[_0xb5c1('0x1e')][_0xb5c1('0x21')]);return _0x4906ac(_0x4c2332[_0xb5c1('0x1e')][_0xb5c1('0x21')]);}else{logger[_0xb5c1('0x1a')](_0xb5c1('0x20'),_0x2f3893,_0xb5c1('0x1b'));_0x4906ac(_0x4c2332[_0xb5c1('0x22')][_0xb5c1('0x21')]);}})['catch'](function(_0x33f3c7){logger['error'](_0xb5c1('0x20'),_0x2f3893,_0x33f3c7);_0x339bb9(_0x33f3c7);});});}function respondWithStatusCode(_0x184209,_0x38594d){_0x38594d=_0x38594d||0xcc;return function(_0x41a920){if(_0x41a920){return _0x184209[_0xb5c1('0x23')](_0x38594d);}return _0x184209['status'](_0x38594d)[_0xb5c1('0x24')]();};}function respondWithResult(_0x55745d,_0x1b8ef5){_0x1b8ef5=_0x1b8ef5||0xc8;return function(_0x2a2095){if(_0x2a2095){return _0x55745d['status'](_0x1b8ef5)[_0xb5c1('0x25')](_0x2a2095);}};}function respondWithFilteredResult(_0x123608,_0x27692e){return function(_0x1924f4){if(_0x1924f4){var _0x135c8b=_0x1924f4[_0xb5c1('0x26')],_0x4b4d2a=_0x27692e[_0xb5c1('0x27')],_0x5e1e90=_0x27692e[_0xb5c1('0x27')]+_0x27692e[_0xb5c1('0x28')],_0x34c9f5;if(_0x5e1e90>=_0x135c8b){_0x5e1e90=_0x135c8b;_0x34c9f5=0xc8;}else{_0x34c9f5=0xce;}_0x123608[_0xb5c1('0x29')](_0x34c9f5);return _0x123608['set'](_0xb5c1('0x2a'),_0x4b4d2a+'-'+_0x5e1e90+'/'+_0x135c8b)[_0xb5c1('0x25')](_0x1924f4);}return null;};}function patchUpdates(_0x54df17){return function(_0x80b507){try{jsonpatch[_0xb5c1('0x2b')](_0x80b507,_0x54df17,!![]);}catch(_0x33c86f){return BPromise['reject'](_0x33c86f);}return _0x80b507[_0xb5c1('0x2c')]();};}function saveUpdates(_0x397311,_0x3c6d53){return function(_0x57b516){if(_0x57b516){return _0x57b516[_0xb5c1('0x2d')](_0x397311)[_0xb5c1('0x19')](function(_0x40017d){return _0x40017d;});}return null;};}function removeEntity(_0x166b40,_0x33f44f){return function(_0x50e694){if(_0x50e694){return _0x50e694[_0xb5c1('0x2e')]()[_0xb5c1('0x19')](function(){_0x166b40[_0xb5c1('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32196c,_0x17f822){return function(_0x283eb3){if(!_0x283eb3){_0x32196c[_0xb5c1('0x23')](0x194);}return _0x283eb3;};}function handleError(_0x5b594b,_0x58607c){_0x58607c=_0x58607c||0x1f4;return function(_0x35fe20){logger[_0xb5c1('0x1e')](_0x35fe20[_0xb5c1('0x2f')]);if(_0x35fe20['name']){delete _0x35fe20[_0xb5c1('0x30')];}_0x5b594b[_0xb5c1('0x29')](_0x58607c)[_0xb5c1('0x31')](_0x35fe20);};}exports['index']=function(_0x5eaa6f,_0x1ce00e){var _0xee10ee={},_0x544aaf={},_0x1dae83={'count':0x0,'rows':[]};var _0x106ad8=_['map'](db[_0xb5c1('0x32')][_0xb5c1('0x33')],function(_0x17fa88){return{'name':_0x17fa88[_0xb5c1('0x34')],'type':_0x17fa88[_0xb5c1('0x35')][_0xb5c1('0x36')]};});_0x544aaf['model']=_['map'](_0x106ad8,_0xb5c1('0x30'));_0x544aaf['query']=_[_0xb5c1('0x37')](_0x5eaa6f[_0xb5c1('0x38')]);_0x544aaf[_0xb5c1('0x39')]=_[_0xb5c1('0x3a')](_0x544aaf['model'],_0x544aaf[_0xb5c1('0x38')]);_0xee10ee[_0xb5c1('0x3b')]=_[_0xb5c1('0x3a')](_0x544aaf['model'],qs[_0xb5c1('0x3c')](_0x5eaa6f['query']['fields']));_0xee10ee[_0xb5c1('0x3b')]=_0xee10ee[_0xb5c1('0x3b')][_0xb5c1('0x3d')]?_0xee10ee[_0xb5c1('0x3b')]:_0x544aaf[_0xb5c1('0x3e')];if(!_0x5eaa6f[_0xb5c1('0x38')][_0xb5c1('0x3f')](_0xb5c1('0x40'))){_0xee10ee[_0xb5c1('0x28')]=qs[_0xb5c1('0x28')](_0x5eaa6f[_0xb5c1('0x38')]['limit']);_0xee10ee[_0xb5c1('0x27')]=qs['offset'](_0x5eaa6f[_0xb5c1('0x38')][_0xb5c1('0x27')]);}_0xee10ee[_0xb5c1('0x41')]=qs[_0xb5c1('0x42')](_0x5eaa6f[_0xb5c1('0x38')][_0xb5c1('0x42')]);_0xee10ee[_0xb5c1('0x43')]=qs['filters'](_[_0xb5c1('0x44')](_0x5eaa6f[_0xb5c1('0x38')],_0x544aaf[_0xb5c1('0x39')]),_0x106ad8);if(_0x5eaa6f[_0xb5c1('0x38')][_0xb5c1('0x45')]){_0xee10ee[_0xb5c1('0x43')]=_[_0xb5c1('0x46')](_0xee10ee[_0xb5c1('0x43')],{'$or':_[_0xb5c1('0x47')](_0x106ad8,function(_0x214caf){if(_0x214caf[_0xb5c1('0x35')]!=='VIRTUAL'){var _0x40f529={};_0x40f529[_0x214caf[_0xb5c1('0x30')]]={'$like':'%'+_0x5eaa6f['query'][_0xb5c1('0x45')]+'%'};return _0x40f529;}})});}_0xee10ee=_[_0xb5c1('0x46')]({},_0xee10ee,_0x5eaa6f[_0xb5c1('0x48')]);var _0x462b43={'where':_0xee10ee[_0xb5c1('0x43')]};return db['VtigerConfiguration']['count'](_0x462b43)[_0xb5c1('0x19')](function(_0x461036){_0x1dae83['count']=_0x461036;if(_0x5eaa6f[_0xb5c1('0x38')][_0xb5c1('0x49')]){_0xee10ee[_0xb5c1('0x4a')]=[{'all':!![]}];}return db[_0xb5c1('0x32')]['findAll'](_0xee10ee);})['then'](function(_0x1f2a2c){_0x1dae83[_0xb5c1('0x4b')]=_0x1f2a2c;return _0x1dae83;})[_0xb5c1('0x19')](respondWithFilteredResult(_0x1ce00e,_0xee10ee))[_0xb5c1('0x4c')](handleError(_0x1ce00e,null));};exports['show']=function(_0x20b489,_0x3c05ce){var _0x79cc02={'raw':![],'where':{'id':_0x20b489['params']['id']}},_0x5129eb={};_0x5129eb[_0xb5c1('0x3e')]=_[_0xb5c1('0x37')](db[_0xb5c1('0x32')][_0xb5c1('0x33')]);_0x5129eb['query']=_[_0xb5c1('0x37')](_0x20b489['query']);_0x5129eb[_0xb5c1('0x39')]=_['intersection'](_0x5129eb[_0xb5c1('0x3e')],_0x5129eb[_0xb5c1('0x38')]);_0x79cc02['attributes']=_[_0xb5c1('0x3a')](_0x5129eb[_0xb5c1('0x3e')],qs['fields'](_0x20b489['query']['fields']));_0x79cc02[_0xb5c1('0x3b')]=_0x79cc02[_0xb5c1('0x3b')]['length']?_0x79cc02[_0xb5c1('0x3b')]:_0x5129eb[_0xb5c1('0x3e')];if(_0x20b489[_0xb5c1('0x38')][_0xb5c1('0x49')]){_0x79cc02['include']=[{'all':!![]}];}_0x79cc02=_[_0xb5c1('0x46')]({},_0x79cc02,_0x20b489['options']);return db[_0xb5c1('0x32')]['find'](_0x79cc02)[_0xb5c1('0x19')](handleEntityNotFound(_0x3c05ce,null))['then'](respondWithResult(_0x3c05ce,null))[_0xb5c1('0x4c')](handleError(_0x3c05ce,null));};exports[_0xb5c1('0x4d')]=function(_0x2a05d7,_0x474632){return db[_0xb5c1('0x32')]['create'](_0x2a05d7[_0xb5c1('0x4e')],{})['then'](respondWithResult(_0x474632,0xc9))[_0xb5c1('0x4c')](handleError(_0x474632,null));};exports[_0xb5c1('0x2d')]=function(_0x3bbe7e,_0x1a043b){if(_0x3bbe7e[_0xb5c1('0x4e')]['id']){delete _0x3bbe7e[_0xb5c1('0x4e')]['id'];}return db[_0xb5c1('0x32')][_0xb5c1('0x4f')]({'where':{'id':_0x3bbe7e[_0xb5c1('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a043b,null))[_0xb5c1('0x19')](saveUpdates(_0x3bbe7e['body'],null))[_0xb5c1('0x19')](respondWithResult(_0x1a043b,null))['catch'](handleError(_0x1a043b,null));};exports['destroy']=function(_0x1881aa,_0x250fc9){return db[_0xb5c1('0x32')][_0xb5c1('0x4f')]({'where':{'id':_0x1881aa[_0xb5c1('0x50')]['id']}})[_0xb5c1('0x19')](handleEntityNotFound(_0x250fc9,null))[_0xb5c1('0x19')](removeEntity(_0x250fc9,null))['catch'](handleError(_0x250fc9,null));};exports[_0xb5c1('0x51')]=function(_0x1305f1,_0x1aeab7,_0x5e6d31){var _0x5c543c={};var _0x24a8e0={};var _0x563012;var _0x1299e9;return db['VtigerConfiguration'][_0xb5c1('0x52')]({'where':{'id':_0x1305f1['params']['id']}})['then'](handleEntityNotFound(_0x1aeab7,null))['then'](function(_0x2f67e8){if(_0x2f67e8){_0x563012=_0x2f67e8;_0x24a8e0[_0xb5c1('0x3e')]=_[_0xb5c1('0x37')](db[_0xb5c1('0x53')][_0xb5c1('0x33')]);_0x24a8e0[_0xb5c1('0x38')]=_[_0xb5c1('0x37')](_0x1305f1[_0xb5c1('0x38')]);_0x24a8e0[_0xb5c1('0x39')]=_[_0xb5c1('0x3a')](_0x24a8e0['model'],_0x24a8e0['query']);_0x5c543c['attributes']=_['intersection'](_0x24a8e0[_0xb5c1('0x3e')],qs[_0xb5c1('0x3c')](_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x3c')]));_0x5c543c[_0xb5c1('0x3b')]=_0x5c543c[_0xb5c1('0x3b')][_0xb5c1('0x3d')]?_0x5c543c[_0xb5c1('0x3b')]:_0x24a8e0[_0xb5c1('0x3e')];_0x5c543c['order']=qs['sort'](_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x42')]);_0x5c543c[_0xb5c1('0x43')]=qs['filters'](_[_0xb5c1('0x44')](_0x1305f1[_0xb5c1('0x38')],_0x24a8e0[_0xb5c1('0x39')]));if(_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x45')]){_0x5c543c['where']=_['merge'](_0x5c543c[_0xb5c1('0x43')],{'$or':_[_0xb5c1('0x47')](_0x5c543c['attributes'],function(_0x113ee5){var _0x14f38e={};_0x14f38e[_0x113ee5]={'$like':'%'+_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x45')]+'%'};return _0x14f38e;})});}_0x5c543c=_[_0xb5c1('0x46')]({},_0x5c543c,_0x1305f1['options']);return _0x563012[_0xb5c1('0x51')](_0x5c543c);}})['then'](function(_0x82a29f){if(_0x82a29f){_0x1299e9=_0x82a29f['length'];if(!_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x3f')]('nolimit')){_0x5c543c[_0xb5c1('0x28')]=qs[_0xb5c1('0x28')](_0x1305f1[_0xb5c1('0x38')][_0xb5c1('0x28')]);_0x5c543c[_0xb5c1('0x27')]=qs[_0xb5c1('0x27')](_0x1305f1['query'][_0xb5c1('0x27')]);}return _0x563012['getFields'](_0x5c543c);}})[_0xb5c1('0x19')](function(_0x29d602){if(_0x29d602){return _0x29d602?{'count':_0x1299e9,'rows':_0x29d602}:null;}})[_0xb5c1('0x19')](respondWithResult(_0x1aeab7,null))['catch'](handleError(_0x1aeab7,null));};exports[_0xb5c1('0x54')]=function(_0x3ec084,_0x8150f4,_0xb5499d){var _0x11000c={};var _0x37ab14={};var _0x5347c5;var _0x2dcb09;return db['VtigerConfiguration'][_0xb5c1('0x52')]({'where':{'id':_0x3ec084['params']['id']}})[_0xb5c1('0x19')](handleEntityNotFound(_0x8150f4,null))[_0xb5c1('0x19')](function(_0x311e6e){if(_0x311e6e){_0x5347c5=_0x311e6e;_0x37ab14[_0xb5c1('0x3e')]=_[_0xb5c1('0x37')](db[_0xb5c1('0x53')]['rawAttributes']);_0x37ab14[_0xb5c1('0x38')]=_['keys'](_0x3ec084[_0xb5c1('0x38')]);_0x37ab14[_0xb5c1('0x39')]=_[_0xb5c1('0x3a')](_0x37ab14['model'],_0x37ab14[_0xb5c1('0x38')]);_0x11000c[_0xb5c1('0x3b')]=_[_0xb5c1('0x3a')](_0x37ab14['model'],qs[_0xb5c1('0x3c')](_0x3ec084['query'][_0xb5c1('0x3c')]));_0x11000c[_0xb5c1('0x3b')]=_0x11000c[_0xb5c1('0x3b')][_0xb5c1('0x3d')]?_0x11000c[_0xb5c1('0x3b')]:_0x37ab14[_0xb5c1('0x3e')];_0x11000c[_0xb5c1('0x41')]=qs[_0xb5c1('0x42')](_0x3ec084[_0xb5c1('0x38')][_0xb5c1('0x42')]);_0x11000c[_0xb5c1('0x43')]=qs[_0xb5c1('0x39')](_[_0xb5c1('0x44')](_0x3ec084['query'],_0x37ab14[_0xb5c1('0x39')]));if(_0x3ec084[_0xb5c1('0x38')][_0xb5c1('0x45')]){_0x11000c[_0xb5c1('0x43')]=_['merge'](_0x11000c[_0xb5c1('0x43')],{'$or':_[_0xb5c1('0x47')](_0x11000c[_0xb5c1('0x3b')],function(_0x669106){var _0x33cb9b={};_0x33cb9b[_0x669106]={'$like':'%'+_0x3ec084[_0xb5c1('0x38')]['filter']+'%'};return _0x33cb9b;})});}_0x11000c=_['merge']({},_0x11000c,_0x3ec084[_0xb5c1('0x48')]);return _0x5347c5[_0xb5c1('0x54')](_0x11000c);}})['then'](function(_0x960a3f){if(_0x960a3f){_0x2dcb09=_0x960a3f[_0xb5c1('0x3d')];if(!_0x3ec084['query'][_0xb5c1('0x3f')](_0xb5c1('0x40'))){_0x11000c['limit']=qs['limit'](_0x3ec084['query']['limit']);_0x11000c['offset']=qs[_0xb5c1('0x27')](_0x3ec084['query'][_0xb5c1('0x27')]);}return _0x5347c5[_0xb5c1('0x54')](_0x11000c);}})[_0xb5c1('0x19')](function(_0x28b2dc){if(_0x28b2dc){return _0x28b2dc?{'count':_0x2dcb09,'rows':_0x28b2dc}:null;}})[_0xb5c1('0x19')](respondWithResult(_0x8150f4,null))[_0xb5c1('0x4c')](handleError(_0x8150f4,null));};exports[_0xb5c1('0x55')]=function(_0x56d67f,_0x476aee,_0x14a1a0){var _0x307b24={};var _0x33ad4d={};var _0x438220;var _0x5415c3;return db[_0xb5c1('0x32')][_0xb5c1('0x52')]({'where':{'id':_0x56d67f['params']['id']}})[_0xb5c1('0x19')](handleEntityNotFound(_0x476aee,null))[_0xb5c1('0x19')](function(_0x5348d4){if(_0x5348d4){_0x438220=_0x5348d4;_0x33ad4d[_0xb5c1('0x3e')]=_[_0xb5c1('0x37')](db[_0xb5c1('0x53')][_0xb5c1('0x33')]);_0x33ad4d['query']=_[_0xb5c1('0x37')](_0x56d67f['query']);_0x33ad4d[_0xb5c1('0x39')]=_['intersection'](_0x33ad4d['model'],_0x33ad4d[_0xb5c1('0x38')]);_0x307b24[_0xb5c1('0x3b')]=_['intersection'](_0x33ad4d[_0xb5c1('0x3e')],qs[_0xb5c1('0x3c')](_0x56d67f['query']['fields']));_0x307b24[_0xb5c1('0x3b')]=_0x307b24['attributes'][_0xb5c1('0x3d')]?_0x307b24['attributes']:_0x33ad4d[_0xb5c1('0x3e')];_0x307b24[_0xb5c1('0x41')]=qs[_0xb5c1('0x42')](_0x56d67f['query'][_0xb5c1('0x42')]);_0x307b24['where']=qs['filters'](_[_0xb5c1('0x44')](_0x56d67f[_0xb5c1('0x38')],_0x33ad4d['filters']));if(_0x56d67f[_0xb5c1('0x38')]['filter']){_0x307b24['where']=_[_0xb5c1('0x46')](_0x307b24[_0xb5c1('0x43')],{'$or':_[_0xb5c1('0x47')](_0x307b24[_0xb5c1('0x3b')],function(_0x7ef461){var _0x42c40c={};_0x42c40c[_0x7ef461]={'$like':'%'+_0x56d67f[_0xb5c1('0x38')][_0xb5c1('0x45')]+'%'};return _0x42c40c;})});}_0x307b24=_['merge']({},_0x307b24,_0x56d67f['options']);return _0x438220[_0xb5c1('0x55')](_0x307b24);}})[_0xb5c1('0x19')](function(_0x28d916){if(_0x28d916){_0x5415c3=_0x28d916[_0xb5c1('0x3d')];if(!_0x56d67f['query']['hasOwnProperty'](_0xb5c1('0x40'))){_0x307b24[_0xb5c1('0x28')]=qs[_0xb5c1('0x28')](_0x56d67f['query'][_0xb5c1('0x28')]);_0x307b24['offset']=qs[_0xb5c1('0x27')](_0x56d67f[_0xb5c1('0x38')][_0xb5c1('0x27')]);}return _0x438220[_0xb5c1('0x55')](_0x307b24);}})[_0xb5c1('0x19')](function(_0x41fb16){if(_0x41fb16){return _0x41fb16?{'count':_0x5415c3,'rows':_0x41fb16}:null;}})['then'](respondWithResult(_0x476aee,null))['catch'](handleError(_0x476aee,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d95fd2d..0b625a7 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 _0x3117=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','util','api','moment','bluebird'];(function(_0x50d285,_0x8f2995){var _0x3cdc18=function(_0x3e7bb0){while(--_0x3e7bb0){_0x50d285['push'](_0x50d285['shift']());}};_0x3cdc18(++_0x8f2995);}(_0x3117,0x132));var _0x7311=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x3117[_0x15ea09];return _0x3e9c78;};'use strict';var _=require('lodash');var util=require(_0x7311('0x0'));var logger=require('../../config/logger')(_0x7311('0x1'));var moment=require(_0x7311('0x2'));var BPromise=require(_0x7311('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7311('0x4'));var rimraf=require(_0x7311('0x5'));var config=require(_0x7311('0x6'));var attributes=require(_0x7311('0x7'));module['exports']=function(_0xc58e0f,_0x1210e6){return _0xc58e0f['define'](_0x7311('0x8'),attributes,{'tableName':_0x7311('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb85f=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb85f,0x1c3));var _0xfb85=function(_0x1aa8e4,_0x422beb){_0x1aa8e4=_0x1aa8e4-0x0;var _0x335a4d=_0xb85f[_0x1aa8e4];return _0x335a4d;};'use strict';var _=require(_0xfb85('0x0'));var util=require(_0xfb85('0x1'));var logger=require(_0xfb85('0x2'))(_0xfb85('0x3'));var moment=require(_0xfb85('0x4'));var BPromise=require(_0xfb85('0x5'));var rp=require(_0xfb85('0x6'));var fs=require('fs');var path=require(_0xfb85('0x7'));var rimraf=require(_0xfb85('0x8'));var config=require(_0xfb85('0x9'));var attributes=require(_0xfb85('0xa'));module[_0xfb85('0xb')]=function(_0x51c9a5,_0x1452ae){return _0x51c9a5[_0xfb85('0xc')](_0xfb85('0xd'),attributes,{'tableName':_0xfb85('0xe'),'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 c2d9712..0fee7a1 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 _0x7673=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2034e2,_0x147430){var _0x3e7c6d=function(_0x789f76){while(--_0x789f76){_0x2034e2['push'](_0x2034e2['shift']());}};_0x3e7c6d(++_0x147430);}(_0x7673,0x13f));var _0x3767=function(_0x2162e0,_0xd18181){_0x2162e0=_0x2162e0-0x0;var _0x162d05=_0x7673[_0x2162e0];return _0x162d05;};'use strict';var _=require(_0x3767('0x0'));var util=require(_0x3767('0x1'));var moment=require('moment');var BPromise=require(_0x3767('0x2'));var rs=require(_0x3767('0x3'));var fs=require('fs');var Redis=require(_0x3767('0x4'));var db=require(_0x3767('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3767('0x6'))(_0x3767('0x7'));var config=require(_0x3767('0x8'));var jayson=require(_0x3767('0x9'));var client=jayson[_0x3767('0xa')][_0x3767('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a574d,_0x1af44d,_0x2a69aa){return new BPromise(function(_0x225105,_0x1255af){return client[_0x3767('0xc')](_0x2a574d,_0x2a69aa)['then'](function(_0x5613db){logger[_0x3767('0xd')](_0x3767('0xe'),_0x1af44d,_0x3767('0xf'));logger['debug'](_0x3767('0x10'),_0x1af44d,_0x3767('0xf'),JSON[_0x3767('0x11')](_0x5613db));if(_0x5613db['error']){if(_0x5613db[_0x3767('0x12')][_0x3767('0x13')]===0x1f4){logger[_0x3767('0x12')](_0x3767('0xe'),_0x1af44d,_0x5613db[_0x3767('0x12')][_0x3767('0x14')]);return _0x1255af(_0x5613db[_0x3767('0x12')][_0x3767('0x14')]);}logger[_0x3767('0x12')](_0x3767('0xe'),_0x1af44d,_0x5613db[_0x3767('0x12')][_0x3767('0x14')]);return _0x225105(_0x5613db[_0x3767('0x12')][_0x3767('0x14')]);}else{logger[_0x3767('0xd')](_0x3767('0xe'),_0x1af44d,_0x3767('0xf'));_0x225105(_0x5613db[_0x3767('0x15')][_0x3767('0x14')]);}})[_0x3767('0x16')](function(_0x557f39){logger[_0x3767('0x12')](_0x3767('0xe'),_0x1af44d,_0x557f39);_0x1255af(_0x557f39);});});} \ No newline at end of file +var _0xa410=['error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa410,0x89));var _0x0a41=function(_0x128e3b,_0x17564f){_0x128e3b=_0x128e3b-0x0;var _0x25cb51=_0xa410[_0x128e3b];return _0x25cb51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0a41('0x0'));var BPromise=require(_0x0a41('0x1'));var rs=require(_0x0a41('0x2'));var fs=require('fs');var Redis=require(_0x0a41('0x3'));var db=require(_0x0a41('0x4'))['db'];var utils=require(_0x0a41('0x5'));var logger=require(_0x0a41('0x6'))('rpc');var config=require(_0x0a41('0x7'));var jayson=require(_0x0a41('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5bd0fb,_0xe68597,_0x471e6d){return new BPromise(function(_0x48de58,_0x16977f){return client[_0x0a41('0x9')](_0x5bd0fb,_0x471e6d)['then'](function(_0x4d7d32){logger[_0x0a41('0xa')](_0x0a41('0xb'),_0xe68597,'request\x20sent');logger['debug'](_0x0a41('0xc'),_0xe68597,_0x0a41('0xd'),JSON[_0x0a41('0xe')](_0x4d7d32));if(_0x4d7d32[_0x0a41('0xf')]){if(_0x4d7d32[_0x0a41('0xf')][_0x0a41('0x10')]===0x1f4){logger[_0x0a41('0xf')](_0x0a41('0xb'),_0xe68597,_0x4d7d32[_0x0a41('0xf')]['message']);return _0x16977f(_0x4d7d32[_0x0a41('0xf')][_0x0a41('0x11')]);}logger[_0x0a41('0xf')](_0x0a41('0xb'),_0xe68597,_0x4d7d32['error'][_0x0a41('0x11')]);return _0x48de58(_0x4d7d32[_0x0a41('0xf')][_0x0a41('0x11')]);}else{logger['info'](_0x0a41('0xb'),_0xe68597,_0x0a41('0xd'));_0x48de58(_0x4d7d32[_0x0a41('0x12')]['message']);}})['catch'](function(_0x118553){logger[_0x0a41('0xf')](_0x0a41('0xb'),_0xe68597,_0x118553);_0x16977f(_0x118553);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5b90de8..14ec53e 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 _0x3270=['isAuthenticated','index','/:id','post','create','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x292037,_0x3fbd07){var _0x4e3bff=function(_0x43e77e){while(--_0x43e77e){_0x292037['push'](_0x292037['shift']());}};_0x4e3bff(++_0x3fbd07);}(_0x3270,0x188));var _0x0327=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x3270[_0x5519a9];return _0x32f2cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0327('0x0'));var timeout=require(_0x0327('0x1'));var express=require(_0x0327('0x2'));var router=express[_0x0327('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0327('0x4'));var config=require(_0x0327('0x5'));var controller=require(_0x0327('0x6'));router[_0x0327('0x7')]('/',auth[_0x0327('0x8')](),controller[_0x0327('0x9')]);router[_0x0327('0x7')](_0x0327('0xa'),auth[_0x0327('0x8')](),controller['show']);router[_0x0327('0xb')]('/',auth[_0x0327('0x8')](),controller[_0x0327('0xc')]);router[_0x0327('0xd')](_0x0327('0xa'),auth[_0x0327('0x8')](),controller['update']);router[_0x0327('0xe')](_0x0327('0xa'),auth[_0x0327('0x8')](),controller[_0x0327('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1729=['multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x42a584,_0x2d9ee3){var _0x56be59=function(_0x5809dd){while(--_0x5809dd){_0x42a584['push'](_0x42a584['shift']());}};_0x56be59(++_0x2d9ee3);}(_0x1729,0x1dc));var _0x9172=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x1729[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x9172('0x0'));var util=require('util');var path=require(_0x9172('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9172('0x2')]();var auth=require(_0x9172('0x3'));var interaction=require(_0x9172('0x4'));var config=require(_0x9172('0x5'));var controller=require(_0x9172('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9172('0x7')](_0x9172('0x8'),auth[_0x9172('0x9')](),controller['show']);router[_0x9172('0xa')]('/',auth[_0x9172('0x9')](),controller[_0x9172('0xb')]);router[_0x9172('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x9172('0xd')]);router[_0x9172('0xe')]('/:id',auth[_0x9172('0x9')](),controller[_0x9172('0xf')]);module[_0x9172('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 917d508..d77e43c 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 _0x872a=['sequelize','exports','ENUM','string','STRING','variable','customVariable','BOOLEAN'];(function(_0x3dae18,_0x90036c){var _0x294ba1=function(_0x4b555b){while(--_0x4b555b){_0x3dae18['push'](_0x3dae18['shift']());}};_0x294ba1(++_0x90036c);}(_0x872a,0x100));var _0xa872=function(_0x3feded,_0x3307f0){_0x3feded=_0x3feded-0x0;var _0x472635=_0x872a[_0x3feded];return _0x472635;};'use strict';var Sequelize=require(_0xa872('0x0'));module[_0xa872('0x1')]={'type':{'type':Sequelize[_0xa872('0x2')](_0xa872('0x3'),'variable','customVariable','keyValue'),'defaultValue':_0xa872('0x3')},'content':{'type':Sequelize[_0xa872('0x4')]},'key':{'type':Sequelize[_0xa872('0x4')]},'keyType':{'type':Sequelize[_0xa872('0x2')](_0xa872('0x3'),_0xa872('0x5'),_0xa872('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa872('0x4')]},'nameField':{'type':Sequelize[_0xa872('0x4')]},'customField':{'type':Sequelize[_0xa872('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa872('0x4')]}}; \ No newline at end of file +var _0xcc92=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','STRING'];(function(_0x2da8af,_0x439eb1){var _0x21bee1=function(_0x2d021e){while(--_0x2d021e){_0x2da8af['push'](_0x2da8af['shift']());}};_0x21bee1(++_0x439eb1);}(_0xcc92,0x141));var _0x2cc9=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xcc92[_0x17784a];return _0x41aded;};'use strict';var Sequelize=require(_0x2cc9('0x0'));module[_0x2cc9('0x1')]={'type':{'type':Sequelize[_0x2cc9('0x2')]('string',_0x2cc9('0x3'),_0x2cc9('0x4'),_0x2cc9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2cc9('0x6')]},'keyType':{'type':Sequelize[_0x2cc9('0x2')]('string',_0x2cc9('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x2cc9('0x6')]},'idField':{'type':Sequelize[_0x2cc9('0x6')]},'nameField':{'type':Sequelize[_0x2cc9('0x6')]},'customField':{'type':Sequelize[_0x2cc9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 517b7b1..321dd51 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 _0x3e9e=['desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','request-promise','bluebird','util','path','lodash','jsforce'];(function(_0x56a943,_0xf3808e){var _0x274632=function(_0x244a4c){while(--_0x244a4c){_0x56a943['push'](_0x56a943['shift']());}};_0x274632(++_0xf3808e);}(_0x3e9e,0x13d));var _0xe3e9=function(_0x25e242,_0x340537){_0x25e242=_0x25e242-0x0;var _0x356cff=_0x3e9e[_0x25e242];return _0x356cff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe3e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3e9('0x2'));var moment=require('moment');var BPromise=require(_0xe3e9('0x3'));var Mustache=require('mustache');var util=require(_0xe3e9('0x4'));var path=require(_0xe3e9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3e9('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe3e9('0x7'));var deskjs=require(_0xe3e9('0x8'));var toCsv=require(_0xe3e9('0x9'));var querystring=require(_0xe3e9('0xa'));var Papa=require(_0xe3e9('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe3e9('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3e9('0xd'));var logger=require('../../config/logger')(_0xe3e9('0xe'));var utils=require('../../config/utils');var config=require(_0xe3e9('0xf'));var db=require(_0xe3e9('0x10'))['db'];function respondWithStatusCode(_0x1f4af1,_0x2f0a87){_0x2f0a87=_0x2f0a87||0xcc;return function(_0x49becd){if(_0x49becd){return _0x1f4af1[_0xe3e9('0x11')](_0x2f0a87);}return _0x1f4af1[_0xe3e9('0x12')](_0x2f0a87)['end']();};}function respondWithResult(_0x480753,_0x151642){_0x151642=_0x151642||0xc8;return function(_0x17f3ad){if(_0x17f3ad){return _0x480753['status'](_0x151642)[_0xe3e9('0x13')](_0x17f3ad);}};}function respondWithFilteredResult(_0x21bc5c,_0x4d6f6c){return function(_0x268baa){if(_0x268baa){var _0x174cd5=_0x268baa[_0xe3e9('0x14')],_0x725e78=_0x4d6f6c['offset'],_0x474ff5=_0x4d6f6c['offset']+_0x4d6f6c[_0xe3e9('0x15')],_0x47b876;if(_0x474ff5>=_0x174cd5){_0x474ff5=_0x174cd5;_0x47b876=0xc8;}else{_0x47b876=0xce;}_0x21bc5c[_0xe3e9('0x12')](_0x47b876);return _0x21bc5c[_0xe3e9('0x16')]('Content-Range',_0x725e78+'-'+_0x474ff5+'/'+_0x174cd5)[_0xe3e9('0x13')](_0x268baa);}return null;};}function patchUpdates(_0x3436c6){return function(_0xd41842){try{jsonpatch['apply'](_0xd41842,_0x3436c6,!![]);}catch(_0xb72cfe){return BPromise['reject'](_0xb72cfe);}return _0xd41842[_0xe3e9('0x17')]();};}function saveUpdates(_0x488df4,_0x27c37e){return function(_0x340619){if(_0x340619){return _0x340619[_0xe3e9('0x18')](_0x488df4)[_0xe3e9('0x19')](function(_0x40de91){return _0x40de91;});}return null;};}function removeEntity(_0x1e0ba5,_0x1ee0b1){return function(_0x57543e){if(_0x57543e){return _0x57543e[_0xe3e9('0x1a')]()[_0xe3e9('0x19')](function(){_0x1e0ba5[_0xe3e9('0x12')](0xcc)[_0xe3e9('0x1b')]();});}};}function handleEntityNotFound(_0x456986,_0x12013c){return function(_0x5be66a){if(!_0x5be66a){_0x456986[_0xe3e9('0x11')](0x194);}return _0x5be66a;};}function handleError(_0x6c95fe,_0x190d19){_0x190d19=_0x190d19||0x1f4;return function(_0x514c52){logger[_0xe3e9('0x1c')](_0x514c52[_0xe3e9('0x1d')]);if(_0x514c52[_0xe3e9('0x1e')]){delete _0x514c52[_0xe3e9('0x1e')];}_0x6c95fe[_0xe3e9('0x12')](_0x190d19)[_0xe3e9('0x1f')](_0x514c52);};}exports[_0xe3e9('0x20')]=function(_0x4b2f80,_0xbb266){var _0x113369={},_0x281589={},_0x54fe24={'count':0x0,'rows':[]};var _0x599fdd=_[_0xe3e9('0x21')](db[_0xe3e9('0x22')][_0xe3e9('0x23')],function(_0x54741b){return{'name':_0x54741b[_0xe3e9('0x24')],'type':_0x54741b[_0xe3e9('0x25')]['key']};});_0x281589[_0xe3e9('0x26')]=_[_0xe3e9('0x21')](_0x599fdd,_0xe3e9('0x1e'));_0x281589[_0xe3e9('0x27')]=_[_0xe3e9('0x28')](_0x4b2f80[_0xe3e9('0x27')]);_0x281589[_0xe3e9('0x29')]=_[_0xe3e9('0x2a')](_0x281589['model'],_0x281589[_0xe3e9('0x27')]);_0x113369['attributes']=_['intersection'](_0x281589[_0xe3e9('0x26')],qs[_0xe3e9('0x2b')](_0x4b2f80['query'][_0xe3e9('0x2b')]));_0x113369[_0xe3e9('0x2c')]=_0x113369[_0xe3e9('0x2c')][_0xe3e9('0x2d')]?_0x113369[_0xe3e9('0x2c')]:_0x281589[_0xe3e9('0x26')];if(!_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x2e')]('nolimit')){_0x113369[_0xe3e9('0x15')]=qs[_0xe3e9('0x15')](_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x15')]);_0x113369[_0xe3e9('0x2f')]=qs[_0xe3e9('0x2f')](_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x2f')]);}_0x113369['order']=qs[_0xe3e9('0x30')](_0x4b2f80[_0xe3e9('0x27')]['sort']);_0x113369[_0xe3e9('0x31')]=qs[_0xe3e9('0x29')](_[_0xe3e9('0x32')](_0x4b2f80['query'],_0x281589['filters']),_0x599fdd);if(_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x33')]){_0x113369['where']=_[_0xe3e9('0x34')](_0x113369[_0xe3e9('0x31')],{'$or':_[_0xe3e9('0x21')](_0x599fdd,function(_0x27aca9){if(_0x27aca9[_0xe3e9('0x25')]!==_0xe3e9('0x35')){var _0x5f2150={};_0x5f2150[_0x27aca9[_0xe3e9('0x1e')]]={'$like':'%'+_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x33')]+'%'};return _0x5f2150;}})});}_0x113369=_['merge']({},_0x113369,_0x4b2f80[_0xe3e9('0x36')]);var _0x2f1d60={'where':_0x113369[_0xe3e9('0x31')]};return db[_0xe3e9('0x22')][_0xe3e9('0x14')](_0x2f1d60)['then'](function(_0x2458c7){_0x54fe24[_0xe3e9('0x14')]=_0x2458c7;if(_0x4b2f80[_0xe3e9('0x27')][_0xe3e9('0x37')]){_0x113369[_0xe3e9('0x38')]=[{'all':!![]}];}return db[_0xe3e9('0x22')][_0xe3e9('0x39')](_0x113369);})['then'](function(_0x59b112){_0x54fe24[_0xe3e9('0x3a')]=_0x59b112;return _0x54fe24;})[_0xe3e9('0x19')](respondWithFilteredResult(_0xbb266,_0x113369))[_0xe3e9('0x3b')](handleError(_0xbb266,null));};exports[_0xe3e9('0x3c')]=function(_0x281701,_0x3e5830){var _0x2114a7={'raw':!![],'where':{'id':_0x281701[_0xe3e9('0x3d')]['id']}},_0x485207={};_0x485207[_0xe3e9('0x26')]=_[_0xe3e9('0x28')](db[_0xe3e9('0x22')][_0xe3e9('0x23')]);_0x485207[_0xe3e9('0x27')]=_[_0xe3e9('0x28')](_0x281701['query']);_0x485207[_0xe3e9('0x29')]=_[_0xe3e9('0x2a')](_0x485207['model'],_0x485207[_0xe3e9('0x27')]);_0x2114a7[_0xe3e9('0x2c')]=_['intersection'](_0x485207['model'],qs[_0xe3e9('0x2b')](_0x281701[_0xe3e9('0x27')]['fields']));_0x2114a7[_0xe3e9('0x2c')]=_0x2114a7[_0xe3e9('0x2c')]['length']?_0x2114a7['attributes']:_0x485207[_0xe3e9('0x26')];if(_0x281701[_0xe3e9('0x27')][_0xe3e9('0x37')]){_0x2114a7['include']=[{'all':!![]}];}_0x2114a7=_[_0xe3e9('0x34')]({},_0x2114a7,_0x281701[_0xe3e9('0x36')]);return db['VtigerField'][_0xe3e9('0x3e')](_0x2114a7)[_0xe3e9('0x19')](handleEntityNotFound(_0x3e5830,null))[_0xe3e9('0x19')](respondWithResult(_0x3e5830,null))['catch'](handleError(_0x3e5830,null));};exports[_0xe3e9('0x3f')]=function(_0x2917ef,_0x3e0208){return db[_0xe3e9('0x22')][_0xe3e9('0x3f')](_0x2917ef[_0xe3e9('0x40')],{})[_0xe3e9('0x19')](respondWithResult(_0x3e0208,0xc9))[_0xe3e9('0x3b')](handleError(_0x3e0208,null));};exports[_0xe3e9('0x18')]=function(_0x2d11e2,_0xd9cca2){if(_0x2d11e2[_0xe3e9('0x40')]['id']){delete _0x2d11e2[_0xe3e9('0x40')]['id'];}return db[_0xe3e9('0x22')][_0xe3e9('0x3e')]({'where':{'id':_0x2d11e2[_0xe3e9('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd9cca2,null))[_0xe3e9('0x19')](saveUpdates(_0x2d11e2['body'],null))[_0xe3e9('0x19')](respondWithResult(_0xd9cca2,null))[_0xe3e9('0x3b')](handleError(_0xd9cca2,null));};exports[_0xe3e9('0x1a')]=function(_0x3dbf0a,_0x542ae2){return db[_0xe3e9('0x22')]['find']({'where':{'id':_0x3dbf0a[_0xe3e9('0x3d')]['id']}})[_0xe3e9('0x19')](handleEntityNotFound(_0x542ae2,null))[_0xe3e9('0x19')](removeEntity(_0x542ae2,null))[_0xe3e9('0x3b')](handleError(_0x542ae2,null));}; \ No newline at end of file +var _0xa090=['error','stack','name','index','VtigerField','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy'];(function(_0x42962d,_0x5e58de){var _0x1e768c=function(_0x23e827){while(--_0x23e827){_0x42962d['push'](_0x42962d['shift']());}};_0x1e768c(++_0x5e58de);}(_0xa090,0x6c));var _0x0a09=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0xa090[_0x52f1e6];return _0x21f104;};'use strict';var pdf=require(_0x0a09('0x0'));var emlformat=require(_0x0a09('0x1'));var rimraf=require(_0x0a09('0x2'));var zipdir=require(_0x0a09('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a09('0x4'));var moment=require(_0x0a09('0x5'));var BPromise=require(_0x0a09('0x6'));var Mustache=require(_0x0a09('0x7'));var util=require(_0x0a09('0x8'));var path=require(_0x0a09('0x9'));var sox=require(_0x0a09('0xa'));var csv=require(_0x0a09('0xb'));var ejs=require(_0x0a09('0xc'));var fs=require('fs');var _=require(_0x0a09('0xd'));var squel=require('squel');var crypto=require(_0x0a09('0xe'));var jsforce=require(_0x0a09('0xf'));var deskjs=require(_0x0a09('0x10'));var toCsv=require(_0x0a09('0xb'));var querystring=require(_0x0a09('0x11'));var Papa=require(_0x0a09('0x12'));var Redis=require(_0x0a09('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0a09('0x14'));var hardwareService=require(_0x0a09('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0a09('0x16'));var config=require(_0x0a09('0x17'));var db=require(_0x0a09('0x18'))['db'];function respondWithStatusCode(_0x2ed63d,_0x4169c4){_0x4169c4=_0x4169c4||0xcc;return function(_0x35ea6a){if(_0x35ea6a){return _0x2ed63d[_0x0a09('0x19')](_0x4169c4);}return _0x2ed63d[_0x0a09('0x1a')](_0x4169c4)[_0x0a09('0x1b')]();};}function respondWithResult(_0x2f53e4,_0xfe2c49){_0xfe2c49=_0xfe2c49||0xc8;return function(_0x16750a){if(_0x16750a){return _0x2f53e4['status'](_0xfe2c49)[_0x0a09('0x1c')](_0x16750a);}};}function respondWithFilteredResult(_0x439f16,_0x41fbe0){return function(_0x51378b){if(_0x51378b){var _0x10d321=_0x51378b[_0x0a09('0x1d')],_0x2818ab=_0x41fbe0[_0x0a09('0x1e')],_0x1bcc31=_0x41fbe0[_0x0a09('0x1e')]+_0x41fbe0[_0x0a09('0x1f')],_0xe1a665;if(_0x1bcc31>=_0x10d321){_0x1bcc31=_0x10d321;_0xe1a665=0xc8;}else{_0xe1a665=0xce;}_0x439f16[_0x0a09('0x1a')](_0xe1a665);return _0x439f16[_0x0a09('0x20')]('Content-Range',_0x2818ab+'-'+_0x1bcc31+'/'+_0x10d321)['json'](_0x51378b);}return null;};}function patchUpdates(_0x3b573a){return function(_0x3e4971){try{jsonpatch[_0x0a09('0x21')](_0x3e4971,_0x3b573a,!![]);}catch(_0x4dd1db){return BPromise['reject'](_0x4dd1db);}return _0x3e4971[_0x0a09('0x22')]();};}function saveUpdates(_0x250c91,_0x33a735){return function(_0x590e67){if(_0x590e67){return _0x590e67[_0x0a09('0x23')](_0x250c91)[_0x0a09('0x24')](function(_0xd53a19){return _0xd53a19;});}return null;};}function removeEntity(_0x1f5fcb,_0x43f6c4){return function(_0x524013){if(_0x524013){return _0x524013[_0x0a09('0x25')]()[_0x0a09('0x24')](function(){_0x1f5fcb[_0x0a09('0x1a')](0xcc)[_0x0a09('0x1b')]();});}};}function handleEntityNotFound(_0x3de3a0,_0x53efc7){return function(_0x3b9524){if(!_0x3b9524){_0x3de3a0['sendStatus'](0x194);}return _0x3b9524;};}function handleError(_0x3f132d,_0x3cd2a4){_0x3cd2a4=_0x3cd2a4||0x1f4;return function(_0x894541){logger[_0x0a09('0x26')](_0x894541[_0x0a09('0x27')]);if(_0x894541['name']){delete _0x894541[_0x0a09('0x28')];}_0x3f132d[_0x0a09('0x1a')](_0x3cd2a4)['send'](_0x894541);};}exports[_0x0a09('0x29')]=function(_0x4d6939,_0x3db7fb){var _0x30b277={},_0x2bc64d={},_0x4069f1={'count':0x0,'rows':[]};var _0x19f14a=_['map'](db[_0x0a09('0x2a')][_0x0a09('0x2b')],function(_0xe4b7d8){return{'name':_0xe4b7d8[_0x0a09('0x2c')],'type':_0xe4b7d8[_0x0a09('0x2d')][_0x0a09('0x2e')]};});_0x2bc64d['model']=_[_0x0a09('0x2f')](_0x19f14a,_0x0a09('0x28'));_0x2bc64d[_0x0a09('0x30')]=_[_0x0a09('0x31')](_0x4d6939[_0x0a09('0x30')]);_0x2bc64d[_0x0a09('0x32')]=_['intersection'](_0x2bc64d[_0x0a09('0x33')],_0x2bc64d[_0x0a09('0x30')]);_0x30b277[_0x0a09('0x34')]=_[_0x0a09('0x35')](_0x2bc64d[_0x0a09('0x33')],qs['fields'](_0x4d6939[_0x0a09('0x30')]['fields']));_0x30b277[_0x0a09('0x34')]=_0x30b277[_0x0a09('0x34')][_0x0a09('0x36')]?_0x30b277[_0x0a09('0x34')]:_0x2bc64d[_0x0a09('0x33')];if(!_0x4d6939[_0x0a09('0x30')][_0x0a09('0x37')]('nolimit')){_0x30b277[_0x0a09('0x1f')]=qs[_0x0a09('0x1f')](_0x4d6939[_0x0a09('0x30')]['limit']);_0x30b277['offset']=qs[_0x0a09('0x1e')](_0x4d6939[_0x0a09('0x30')][_0x0a09('0x1e')]);}_0x30b277[_0x0a09('0x38')]=qs['sort'](_0x4d6939[_0x0a09('0x30')][_0x0a09('0x39')]);_0x30b277['where']=qs['filters'](_['pick'](_0x4d6939[_0x0a09('0x30')],_0x2bc64d[_0x0a09('0x32')]),_0x19f14a);if(_0x4d6939[_0x0a09('0x30')]['filter']){_0x30b277[_0x0a09('0x3a')]=_['merge'](_0x30b277[_0x0a09('0x3a')],{'$or':_['map'](_0x19f14a,function(_0x20c1c3){if(_0x20c1c3[_0x0a09('0x2d')]!==_0x0a09('0x3b')){var _0x5fd7e4={};_0x5fd7e4[_0x20c1c3[_0x0a09('0x28')]]={'$like':'%'+_0x4d6939[_0x0a09('0x30')][_0x0a09('0x3c')]+'%'};return _0x5fd7e4;}})});}_0x30b277=_[_0x0a09('0x3d')]({},_0x30b277,_0x4d6939[_0x0a09('0x3e')]);var _0x366851={'where':_0x30b277[_0x0a09('0x3a')]};return db[_0x0a09('0x2a')]['count'](_0x366851)[_0x0a09('0x24')](function(_0x486fa7){_0x4069f1[_0x0a09('0x1d')]=_0x486fa7;if(_0x4d6939[_0x0a09('0x30')][_0x0a09('0x3f')]){_0x30b277[_0x0a09('0x40')]=[{'all':!![]}];}return db[_0x0a09('0x2a')]['findAll'](_0x30b277);})[_0x0a09('0x24')](function(_0x56207b){_0x4069f1[_0x0a09('0x41')]=_0x56207b;return _0x4069f1;})[_0x0a09('0x24')](respondWithFilteredResult(_0x3db7fb,_0x30b277))[_0x0a09('0x42')](handleError(_0x3db7fb,null));};exports[_0x0a09('0x43')]=function(_0x32ae7d,_0x4a7dad){var _0x56b7ef={'raw':!![],'where':{'id':_0x32ae7d[_0x0a09('0x44')]['id']}},_0x2139ef={};_0x2139ef['model']=_['keys'](db[_0x0a09('0x2a')][_0x0a09('0x2b')]);_0x2139ef[_0x0a09('0x30')]=_[_0x0a09('0x31')](_0x32ae7d[_0x0a09('0x30')]);_0x2139ef['filters']=_['intersection'](_0x2139ef[_0x0a09('0x33')],_0x2139ef['query']);_0x56b7ef['attributes']=_[_0x0a09('0x35')](_0x2139ef[_0x0a09('0x33')],qs[_0x0a09('0x45')](_0x32ae7d['query'][_0x0a09('0x45')]));_0x56b7ef['attributes']=_0x56b7ef['attributes'][_0x0a09('0x36')]?_0x56b7ef[_0x0a09('0x34')]:_0x2139ef[_0x0a09('0x33')];if(_0x32ae7d[_0x0a09('0x30')][_0x0a09('0x3f')]){_0x56b7ef[_0x0a09('0x40')]=[{'all':!![]}];}_0x56b7ef=_['merge']({},_0x56b7ef,_0x32ae7d[_0x0a09('0x3e')]);return db[_0x0a09('0x2a')][_0x0a09('0x46')](_0x56b7ef)['then'](handleEntityNotFound(_0x4a7dad,null))[_0x0a09('0x24')](respondWithResult(_0x4a7dad,null))[_0x0a09('0x42')](handleError(_0x4a7dad,null));};exports['create']=function(_0x2a49e5,_0x218400){return db[_0x0a09('0x2a')][_0x0a09('0x47')](_0x2a49e5[_0x0a09('0x48')],{})[_0x0a09('0x24')](respondWithResult(_0x218400,0xc9))['catch'](handleError(_0x218400,null));};exports[_0x0a09('0x23')]=function(_0x5156fd,_0x4d6ef3){if(_0x5156fd[_0x0a09('0x48')]['id']){delete _0x5156fd[_0x0a09('0x48')]['id'];}return db[_0x0a09('0x2a')]['find']({'where':{'id':_0x5156fd[_0x0a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d6ef3,null))[_0x0a09('0x24')](saveUpdates(_0x5156fd[_0x0a09('0x48')],null))[_0x0a09('0x24')](respondWithResult(_0x4d6ef3,null))[_0x0a09('0x42')](handleError(_0x4d6ef3,null));};exports['destroy']=function(_0x1860ca,_0xc7e195){return db[_0x0a09('0x2a')][_0x0a09('0x46')]({'where':{'id':_0x1860ca[_0x0a09('0x44')]['id']}})[_0x0a09('0x24')](handleEntityNotFound(_0xc7e195,null))[_0x0a09('0x24')](removeEntity(_0xc7e195,null))['catch'](handleError(_0xc7e195,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 33450e2..3e63ed6 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(_0x344ffb,_0x2ec6ce){var _0x51e806=function(_0x4328e7){while(--_0x4328e7){_0x344ffb['push'](_0x344ffb['shift']());}};_0x51e806(++_0x2ec6ce);}(_0x7a54,0x106));var _0x47a5=function(_0x470239,_0xb3b15b){_0x470239=_0x470239-0x0;var _0x57c987=_0x7a54[_0x470239];return _0x57c987;};'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(_0x219400,_0x30e814){var _0xad55cf=function(_0x394b01){while(--_0x394b01){_0x219400['push'](_0x219400['shift']());}};_0xad55cf(++_0x30e814);}(_0x7a54,0x106));var _0x47a5=function(_0x17f157,_0x2ef9da){_0x17f157=_0x17f157-0x0;var _0x455418=_0x7a54[_0x17f157];return _0x455418;};'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 d8266b0..b6f0b42 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 _0xcac2=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x5ea743,_0x43c1d9){var _0xb77687=function(_0x488de4){while(--_0x488de4){_0x5ea743['push'](_0x5ea743['shift']());}};_0xb77687(++_0x43c1d9);}(_0xcac2,0x1e8));var _0x2cac=function(_0x6de7af,_0x20cfe7){_0x6de7af=_0x6de7af-0x0;var _0x13e2f6=_0xcac2[_0x6de7af];return _0x13e2f6;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var moment=require(_0x2cac('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cac('0x3'));var fs=require('fs');var Redis=require(_0x2cac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2cac('0x5'));var jayson=require(_0x2cac('0x6'));var client=jayson[_0x2cac('0x7')][_0x2cac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f996c,_0x703f11,_0x1920cf){return new BPromise(function(_0x56b4f9,_0x5df249){return client[_0x2cac('0x9')](_0x2f996c,_0x1920cf)['then'](function(_0x361260){logger[_0x2cac('0xa')]('VtigerField,\x20%s,\x20%s',_0x703f11,'request\x20sent');logger[_0x2cac('0xb')](_0x2cac('0xc'),_0x703f11,'request\x20sent',JSON[_0x2cac('0xd')](_0x361260));if(_0x361260['error']){if(_0x361260[_0x2cac('0xe')][_0x2cac('0xf')]===0x1f4){logger[_0x2cac('0xe')](_0x2cac('0x10'),_0x703f11,_0x361260[_0x2cac('0xe')]['message']);return _0x5df249(_0x361260[_0x2cac('0xe')][_0x2cac('0x11')]);}logger['error'](_0x2cac('0x10'),_0x703f11,_0x361260[_0x2cac('0xe')][_0x2cac('0x11')]);return _0x56b4f9(_0x361260['error'][_0x2cac('0x11')]);}else{logger[_0x2cac('0xa')](_0x2cac('0x10'),_0x703f11,'request\x20sent');_0x56b4f9(_0x361260[_0x2cac('0x12')][_0x2cac('0x11')]);}})[_0x2cac('0x13')](function(_0x4d4646){logger['error'](_0x2cac('0x10'),_0x703f11,_0x4d4646);_0x5df249(_0x4d4646);});});} \ No newline at end of file +var _0xae60=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0xeb2a27,_0x56f6bd){var _0xdd48ba=function(_0x3ce62b){while(--_0x3ce62b){_0xeb2a27['push'](_0xeb2a27['shift']());}};_0xdd48ba(++_0x56f6bd);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xae60[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('VtigerField,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 84eccae..6c4b42f 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 _0xfbd5=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x64fb9b,_0x3b9d41){var _0x29c090=function(_0x4b2f4f){while(--_0x4b2f4f){_0x64fb9b['push'](_0x64fb9b['shift']());}};_0x29c090(++_0x3b9d41);}(_0xfbd5,0xcc));var _0x5fbd=function(_0x28da3a,_0x195b57){_0x28da3a=_0x28da3a-0x0;var _0x1c70b3=_0xfbd5[_0x28da3a];return _0x1c70b3;};'use strict';var multer=require('multer');var util=require(_0x5fbd('0x0'));var path=require(_0x5fbd('0x1'));var timeout=require(_0x5fbd('0x2'));var express=require(_0x5fbd('0x3'));var router=express[_0x5fbd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5fbd('0x5'));var config=require(_0x5fbd('0x6'));var controller=require(_0x5fbd('0x7'));router[_0x5fbd('0x8')]('/',auth[_0x5fbd('0x9')](),controller[_0x5fbd('0xa')]);router[_0x5fbd('0x8')](_0x5fbd('0xb'),auth[_0x5fbd('0x9')](),controller[_0x5fbd('0xc')]);router[_0x5fbd('0x8')](_0x5fbd('0xd'),auth[_0x5fbd('0x9')](),controller[_0x5fbd('0xe')]);router[_0x5fbd('0x8')](_0x5fbd('0xf'),auth[_0x5fbd('0x9')](),controller[_0x5fbd('0x10')]);router[_0x5fbd('0x11')]('/',auth[_0x5fbd('0x9')](),controller[_0x5fbd('0x12')]);router[_0x5fbd('0x11')](_0x5fbd('0xd'),auth['isAuthenticated'](),controller[_0x5fbd('0x13')]);router[_0x5fbd('0x14')](_0x5fbd('0xb'),auth[_0x5fbd('0x9')](),controller[_0x5fbd('0x15')]);router[_0x5fbd('0x16')]('/:id',auth[_0x5fbd('0x9')](),controller[_0x5fbd('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2700=['index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x2700,0x1d0));var _0x0270=function(_0x4c399,_0x53188f){_0x4c399=_0x4c399-0x0;var _0x240111=_0x2700[_0x4c399];return _0x240111;};'use strict';var multer=require(_0x0270('0x0'));var util=require('util');var path=require(_0x0270('0x1'));var timeout=require(_0x0270('0x2'));var express=require(_0x0270('0x3'));var router=express[_0x0270('0x4')]();var auth=require(_0x0270('0x5'));var interaction=require(_0x0270('0x6'));var config=require(_0x0270('0x7'));var controller=require(_0x0270('0x8'));router[_0x0270('0x9')]('/',auth[_0x0270('0xa')](),controller[_0x0270('0xb')]);router[_0x0270('0x9')](_0x0270('0xc'),auth['isAuthenticated'](),controller[_0x0270('0xd')]);router[_0x0270('0x9')](_0x0270('0xe'),auth[_0x0270('0xa')](),controller[_0x0270('0xf')]);router['get']('/:id/fields',auth[_0x0270('0xa')](),controller[_0x0270('0x10')]);router[_0x0270('0x11')]('/',auth[_0x0270('0xa')](),controller[_0x0270('0x12')]);router[_0x0270('0x11')]('/:id/configurations',auth[_0x0270('0xa')](),controller[_0x0270('0x13')]);router[_0x0270('0x14')](_0x0270('0xc'),auth[_0x0270('0xa')](),controller[_0x0270('0x15')]);router[_0x0270('0x16')](_0x0270('0xc'),auth[_0x0270('0xa')](),controller[_0x0270('0x17')]);module[_0x0270('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 791873b..fc00177 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 _0xb70d=['password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x1e58ad,_0x52ea33){var _0x37f189=function(_0x166943){while(--_0x166943){_0x1e58ad['push'](_0x1e58ad['shift']());}};_0x37f189(++_0x52ea33);}(_0xb70d,0x1c6));var _0xdb70=function(_0x17fdcf,_0xe2acee){_0x17fdcf=_0x17fdcf-0x0;var _0x938038=_0xb70d[_0x17fdcf];return _0x938038;};'use strict';var Sequelize=require(_0xdb70('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb70('0x1')]},'description':{'type':Sequelize[_0xdb70('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdb70('0x2')},'password':{'type':Sequelize[_0xdb70('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdb70('0x3')},'authType':{'type':Sequelize[_0xdb70('0x4')](_0xdb70('0x5'),_0xdb70('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xdb70('0x1')]},'type':{'type':Sequelize[_0xdb70('0x4')](_0xdb70('0x7'),_0xdb70('0x8')),'defaultValue':_0xdb70('0x7')}}; \ No newline at end of file +var _0x1bc3=['token','newTab','integrationTab','sequelize','STRING','username','remoteUri','ENUM','password'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x1bc3,0x81));var _0x31bc=function(_0x3bfd96,_0x1e6de6){_0x3bfd96=_0x3bfd96-0x0;var _0x143a8c=_0x1bc3[_0x3bfd96];return _0x143a8c;};'use strict';var Sequelize=require(_0x31bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x31bc('0x1')]},'description':{'type':Sequelize[_0x31bc('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x31bc('0x2')},'password':{'type':Sequelize[_0x31bc('0x1')]},'token':{'type':Sequelize[_0x31bc('0x1')]},'remoteUri':{'type':Sequelize[_0x31bc('0x1')],'unique':_0x31bc('0x3')},'authType':{'type':Sequelize[_0x31bc('0x4')](_0x31bc('0x5'),_0x31bc('0x6')),'defaultValue':_0x31bc('0x5')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x31bc('0x4')]('integrationTab',_0x31bc('0x7')),'defaultValue':_0x31bc('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 0e4b2e0..2c282a9 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 _0xd12c=['ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','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','request\x20sent','debug','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','create','body','find','findOne','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','password','%s:%s','toString','base64','token','headers','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','group','assignee','remove','includes'];(function(_0x2c3fd3,_0x5f30dd){var _0x2c1b00=function(_0x2354d7){while(--_0x2354d7){_0x2c3fd3['push'](_0x2c3fd3['shift']());}};_0x2c1b00(++_0x5f30dd);}(_0xd12c,0x113));var _0xcd12=function(_0x3b9aef,_0x3ebe27){_0x3b9aef=_0x3b9aef-0x0;var _0x56c2ce=_0xd12c[_0x3b9aef];return _0x56c2ce;};'use strict';var pdf=require(_0xcd12('0x0'));var emlformat=require(_0xcd12('0x1'));var rimraf=require(_0xcd12('0x2'));var zipdir=require(_0xcd12('0x3'));var jsonpatch=require(_0xcd12('0x4'));var rp=require(_0xcd12('0x5'));var moment=require(_0xcd12('0x6'));var BPromise=require(_0xcd12('0x7'));var Mustache=require(_0xcd12('0x8'));var util=require(_0xcd12('0x9'));var path=require(_0xcd12('0xa'));var sox=require(_0xcd12('0xb'));var csv=require('to-csv');var ejs=require(_0xcd12('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcd12('0xd'));var crypto=require(_0xcd12('0xe'));var jsforce=require(_0xcd12('0xf'));var deskjs=require(_0xcd12('0x10'));var toCsv=require(_0xcd12('0x11'));var querystring=require(_0xcd12('0x12'));var Papa=require(_0xcd12('0x13'));var Redis=require(_0xcd12('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xcd12('0x15'));var as=require(_0xcd12('0x16'));var hardwareService=require(_0xcd12('0x17'));var logger=require(_0xcd12('0x18'))(_0xcd12('0x19'));var utils=require(_0xcd12('0x1a'));var config=require(_0xcd12('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcd12('0x1c'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcd12('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4c614b,_0x4f56ac,_0xacdf12){if(_0xacdf12){var _0x1ce32c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ce32c['test'](_0x4f56ac)){return _0x4c614b;}else{throw new db[(_0xcd12('0x1e'))][(_0xcd12('0x1f'))](_0xcd12('0x20'));}}else{return _0x4c614b;}}function respondWithRpcPromise(_0xe106ed,_0x46fc16,_0x3e2695,_0x323298){return new BPromise(function(_0x31a0ff,_0x47318f){var _0x3d60fb=_0x323298||client;return _0x3d60fb['request'](_0xe106ed,_0x3e2695)[_0xcd12('0x21')](function(_0x2c663d){logger[_0xcd12('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x46fc16,_0xcd12('0x23'));logger[_0xcd12('0x24')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x46fc16,_0xcd12('0x23'),JSON[_0xcd12('0x25')](_0x2c663d));if(_0x2c663d[_0xcd12('0x26')]){if(_0x2c663d[_0xcd12('0x26')][_0xcd12('0x27')]===0x1f4){logger['error'](_0xcd12('0x28'),_0x46fc16,_0x2c663d[_0xcd12('0x26')][_0xcd12('0x29')]);return _0x47318f(_0x2c663d[_0xcd12('0x26')][_0xcd12('0x29')]);}logger[_0xcd12('0x26')](_0xcd12('0x28'),_0x46fc16,_0x2c663d[_0xcd12('0x26')][_0xcd12('0x29')]);return _0x31a0ff(_0x2c663d[_0xcd12('0x26')][_0xcd12('0x29')]);}else{logger[_0xcd12('0x22')](_0xcd12('0x28'),_0x46fc16,'request\x20sent');_0x31a0ff(_0x2c663d[_0xcd12('0x2a')]['message']);}})[_0xcd12('0x2b')](function(_0x31ddab){logger[_0xcd12('0x26')](_0xcd12('0x28'),_0x46fc16,_0x31ddab);_0x47318f(_0x31ddab);});});}function respondWithStatusCode(_0x4b9bb8,_0x529710){_0x529710=_0x529710||0xcc;return function(_0x13dc03){if(_0x13dc03){return _0x4b9bb8['sendStatus'](_0x529710);}return _0x4b9bb8[_0xcd12('0x2c')](_0x529710)[_0xcd12('0x2d')]();};}function respondWithResult(_0x14918e,_0x281d57){_0x281d57=_0x281d57||0xc8;return function(_0x2e4cc4){if(_0x2e4cc4){return _0x14918e[_0xcd12('0x2c')](_0x281d57)[_0xcd12('0x2e')](_0x2e4cc4);}};}function respondWithFilteredResult(_0x4e3de3,_0x380e6b){return function(_0x467a86){if(_0x467a86){var _0x56e645=_0x467a86['count'],_0x320eea=_0x380e6b[_0xcd12('0x2f')],_0x1ee59c=_0x380e6b[_0xcd12('0x2f')]+_0x380e6b[_0xcd12('0x30')],_0x203939;if(_0x1ee59c>=_0x56e645){_0x1ee59c=_0x56e645;_0x203939=0xc8;}else{_0x203939=0xce;}_0x4e3de3[_0xcd12('0x2c')](_0x203939);return _0x4e3de3[_0xcd12('0x31')](_0xcd12('0x32'),_0x320eea+'-'+_0x1ee59c+'/'+_0x56e645)[_0xcd12('0x2e')](_0x467a86);}return null;};}function patchUpdates(_0x36ec40){return function(_0x32c8da){try{jsonpatch[_0xcd12('0x33')](_0x32c8da,_0x36ec40,!![]);}catch(_0x3f14ec){return BPromise[_0xcd12('0x34')](_0x3f14ec);}return _0x32c8da[_0xcd12('0x35')]();};}function saveUpdates(_0x48fe76,_0x35249b){return function(_0x55dca7){if(_0x55dca7){return _0x55dca7['update'](_0x48fe76)['then'](function(_0x24759f){return _0x24759f;});}return null;};}function removeEntity(_0x44a96c,_0x5e8957){return function(_0x2750db){if(_0x2750db){return _0x2750db[_0xcd12('0x36')]()[_0xcd12('0x21')](function(){_0x44a96c[_0xcd12('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d94b0,_0x5af17f){return function(_0x2169ca){if(!_0x2169ca){_0x4d94b0[_0xcd12('0x37')](0x194);}return _0x2169ca;};}function handleError(_0x45d1a7,_0x1ae10c){_0x1ae10c=_0x1ae10c||0x1f4;return function(_0x42e0ce){logger[_0xcd12('0x26')](_0x42e0ce[_0xcd12('0x38')]);if(_0x42e0ce[_0xcd12('0x39')]){delete _0x42e0ce[_0xcd12('0x39')];}_0x45d1a7[_0xcd12('0x2c')](_0x1ae10c)[_0xcd12('0x3a')](_0x42e0ce);};}exports[_0xcd12('0x3b')]=function(_0x36f450,_0x5b4737){var _0xefd324={},_0x4f7a7a={},_0x461d0f={'count':0x0,'rows':[]};var _0x1919a6=_[_0xcd12('0x3c')](db[_0xcd12('0x3d')][_0xcd12('0x3e')],function(_0x113b66){return{'name':_0x113b66[_0xcd12('0x3f')],'type':_0x113b66[_0xcd12('0x40')][_0xcd12('0x41')]};});_0x4f7a7a[_0xcd12('0x42')]=_[_0xcd12('0x3c')](_0x1919a6,_0xcd12('0x39'));_0x4f7a7a[_0xcd12('0x43')]=_[_0xcd12('0x44')](_0x36f450['query']);_0x4f7a7a[_0xcd12('0x45')]=_[_0xcd12('0x46')](_0x4f7a7a[_0xcd12('0x42')],_0x4f7a7a['query']);_0xefd324[_0xcd12('0x47')]=_[_0xcd12('0x46')](_0x4f7a7a[_0xcd12('0x42')],qs[_0xcd12('0x48')](_0x36f450[_0xcd12('0x43')][_0xcd12('0x48')]));_0xefd324[_0xcd12('0x47')]=_0xefd324[_0xcd12('0x47')][_0xcd12('0x49')]?_0xefd324[_0xcd12('0x47')]:_0x4f7a7a[_0xcd12('0x42')];if(!_0x36f450[_0xcd12('0x43')][_0xcd12('0x4a')](_0xcd12('0x4b'))){_0xefd324['limit']=qs['limit'](_0x36f450[_0xcd12('0x43')]['limit']);_0xefd324[_0xcd12('0x2f')]=qs[_0xcd12('0x2f')](_0x36f450[_0xcd12('0x43')][_0xcd12('0x2f')]);}_0xefd324[_0xcd12('0x4c')]=qs[_0xcd12('0x4d')](_0x36f450[_0xcd12('0x43')]['sort']);_0xefd324[_0xcd12('0x4e')]=qs['filters'](_[_0xcd12('0x4f')](_0x36f450[_0xcd12('0x43')],_0x4f7a7a[_0xcd12('0x45')]),_0x1919a6);if(_0x36f450[_0xcd12('0x43')][_0xcd12('0x50')]){_0xefd324['where']=_[_0xcd12('0x51')](_0xefd324['where'],{'$or':_['map'](_0x1919a6,function(_0x56d6f7){if(_0x56d6f7[_0xcd12('0x40')]!==_0xcd12('0x52')){var _0xd50fba={};_0xd50fba[_0x56d6f7[_0xcd12('0x39')]]={'$like':'%'+_0x36f450[_0xcd12('0x43')][_0xcd12('0x50')]+'%'};return _0xd50fba;}})});}_0xefd324=_['merge']({},_0xefd324,_0x36f450[_0xcd12('0x53')]);var _0x299b53={'where':_0xefd324['where']};return db[_0xcd12('0x3d')][_0xcd12('0x54')](_0x299b53)[_0xcd12('0x21')](function(_0x3c9df8){_0x461d0f[_0xcd12('0x54')]=_0x3c9df8;if(_0x36f450[_0xcd12('0x43')][_0xcd12('0x55')]){_0xefd324[_0xcd12('0x56')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xcd12('0x57')](_0xefd324);})['then'](function(_0x2319a7){_0x461d0f[_0xcd12('0x58')]=_0x2319a7;return _0x461d0f;})['then'](respondWithFilteredResult(_0x5b4737,_0xefd324))[_0xcd12('0x2b')](handleError(_0x5b4737,null));};exports[_0xcd12('0x59')]=function(_0x59804d,_0x3cded5){var _0x2d6c14={'raw':![],'where':{'id':_0x59804d[_0xcd12('0x5a')]['id']}},_0x13dc94={};_0x13dc94[_0xcd12('0x42')]=_[_0xcd12('0x44')](db[_0xcd12('0x3d')][_0xcd12('0x3e')]);_0x13dc94['query']=_[_0xcd12('0x44')](_0x59804d[_0xcd12('0x43')]);_0x13dc94[_0xcd12('0x45')]=_[_0xcd12('0x46')](_0x13dc94[_0xcd12('0x42')],_0x13dc94['query']);_0x2d6c14[_0xcd12('0x47')]=_[_0xcd12('0x46')](_0x13dc94[_0xcd12('0x42')],qs[_0xcd12('0x48')](_0x59804d[_0xcd12('0x43')][_0xcd12('0x48')]));_0x2d6c14[_0xcd12('0x47')]=_0x2d6c14[_0xcd12('0x47')]['length']?_0x2d6c14[_0xcd12('0x47')]:_0x13dc94[_0xcd12('0x42')];if(_0x59804d[_0xcd12('0x43')][_0xcd12('0x55')]){_0x2d6c14[_0xcd12('0x56')]=[{'all':!![]}];}_0x2d6c14=_[_0xcd12('0x51')]({},_0x2d6c14,_0x59804d[_0xcd12('0x53')]);return db[_0xcd12('0x3d')]['find'](_0x2d6c14)[_0xcd12('0x21')](handleEntityNotFound(_0x3cded5,null))[_0xcd12('0x21')](respondWithResult(_0x3cded5,null))[_0xcd12('0x2b')](handleError(_0x3cded5,null));};exports[_0xcd12('0x5b')]=function(_0x57f2a9,_0x176e2a){return db[_0xcd12('0x3d')][_0xcd12('0x5b')](_0x57f2a9[_0xcd12('0x5c')],{})[_0xcd12('0x21')](respondWithResult(_0x176e2a,0xc9))['catch'](handleError(_0x176e2a,null));};exports['update']=function(_0xca08f4,_0x37b1e0){if(_0xca08f4[_0xcd12('0x5c')]['id']){delete _0xca08f4[_0xcd12('0x5c')]['id'];}return db['ZendeskAccount'][_0xcd12('0x5d')]({'where':{'id':_0xca08f4['params']['id']}})['then'](handleEntityNotFound(_0x37b1e0,null))[_0xcd12('0x21')](saveUpdates(_0xca08f4[_0xcd12('0x5c')],null))[_0xcd12('0x21')](respondWithResult(_0x37b1e0,null))[_0xcd12('0x2b')](handleError(_0x37b1e0,null));};exports['destroy']=function(_0x4861e1,_0x1af03b){return db[_0xcd12('0x3d')]['find']({'where':{'id':_0x4861e1['params']['id']}})[_0xcd12('0x21')](handleEntityNotFound(_0x1af03b,null))['then'](removeEntity(_0x1af03b,null))[_0xcd12('0x2b')](handleError(_0x1af03b,null));};exports['getConfigurations']=function(_0x31ff93,_0x478e75,_0xee5099){var _0x5391aa={};var _0x203a44={};var _0x2df62e;var _0x1fc6d6;return db[_0xcd12('0x3d')][_0xcd12('0x5e')]({'where':{'id':_0x31ff93['params']['id']}})['then'](handleEntityNotFound(_0x478e75,null))[_0xcd12('0x21')](function(_0x2a6bc6){if(_0x2a6bc6){_0x2df62e=_0x2a6bc6;_0x203a44[_0xcd12('0x42')]=_[_0xcd12('0x44')](db['ZendeskConfiguration']['rawAttributes']);_0x203a44[_0xcd12('0x43')]=_['keys'](_0x31ff93[_0xcd12('0x43')]);_0x203a44['filters']=_[_0xcd12('0x46')](_0x203a44[_0xcd12('0x42')],_0x203a44[_0xcd12('0x43')]);_0x5391aa['attributes']=_[_0xcd12('0x46')](_0x203a44[_0xcd12('0x42')],qs[_0xcd12('0x48')](_0x31ff93[_0xcd12('0x43')][_0xcd12('0x48')]));_0x5391aa[_0xcd12('0x47')]=_0x5391aa[_0xcd12('0x47')][_0xcd12('0x49')]?_0x5391aa[_0xcd12('0x47')]:_0x203a44[_0xcd12('0x42')];_0x5391aa['order']=qs['sort'](_0x31ff93[_0xcd12('0x43')][_0xcd12('0x4d')]);_0x5391aa[_0xcd12('0x4e')]=qs[_0xcd12('0x45')](_[_0xcd12('0x4f')](_0x31ff93[_0xcd12('0x43')],_0x203a44['filters']));if(_0x31ff93[_0xcd12('0x43')][_0xcd12('0x50')]){_0x5391aa['where']=_[_0xcd12('0x51')](_0x5391aa[_0xcd12('0x4e')],{'$or':_[_0xcd12('0x3c')](_0x5391aa[_0xcd12('0x47')],function(_0x3a7835){var _0x3658c2={};_0x3658c2[_0x3a7835]={'$like':'%'+_0x31ff93[_0xcd12('0x43')]['filter']+'%'};return _0x3658c2;})});}_0x5391aa=_[_0xcd12('0x51')]({},_0x5391aa,_0x31ff93[_0xcd12('0x53')]);return _0x2df62e[_0xcd12('0x5f')](_0x5391aa);}})[_0xcd12('0x21')](function(_0x374b44){if(_0x374b44){_0x1fc6d6=_0x374b44['length'];if(!_0x31ff93[_0xcd12('0x43')][_0xcd12('0x4a')](_0xcd12('0x4b'))){_0x5391aa[_0xcd12('0x30')]=qs['limit'](_0x31ff93[_0xcd12('0x43')][_0xcd12('0x30')]);_0x5391aa['offset']=qs[_0xcd12('0x2f')](_0x31ff93['query'][_0xcd12('0x2f')]);}return _0x2df62e[_0xcd12('0x5f')](_0x5391aa);}})[_0xcd12('0x21')](function(_0x362e77){if(_0x362e77){return _0x362e77?{'count':_0x1fc6d6,'rows':_0x362e77}:null;}})[_0xcd12('0x21')](respondWithResult(_0x478e75,null))[_0xcd12('0x2b')](handleError(_0x478e75,null));};exports['addConfiguration']=function(_0x315b7b,_0x3c2a3a,_0x584936){if(_0x315b7b[_0xcd12('0x5c')]['id']){delete _0x315b7b[_0xcd12('0x5c')]['id'];}return db['ZendeskAccount'][_0xcd12('0x5e')]({'where':{'id':_0x315b7b['params']['id']}})['then'](handleEntityNotFound(_0x3c2a3a,null))['then'](function(_0x4f3540){if(_0x4f3540){_0x315b7b[_0xcd12('0x5c')]['AccountId']=_0x4f3540['id'];_0x315b7b[_0xcd12('0x5c')][_0xcd12('0x60')]=integrations[_0xcd12('0x61')](_0x315b7b[_0xcd12('0x5c')][_0xcd12('0x62')],_0x315b7b['body'][_0xcd12('0x40')]);_0x315b7b[_0xcd12('0x5c')][_0xcd12('0x63')]=integrations[_0xcd12('0x64')](_0x315b7b['body'][_0xcd12('0x62')],_0x315b7b['body'][_0xcd12('0x40')]);return db[_0xcd12('0x65')][_0xcd12('0x5b')](_0x315b7b[_0xcd12('0x5c')],{'include':[{'model':db['ZendeskField'],'as':_0xcd12('0x60')},{'model':db[_0xcd12('0x66')],'as':'Descriptions'}]});}return null;})[_0xcd12('0x21')](respondWithResult(_0x3c2a3a,null))[_0xcd12('0x2b')](handleError(_0x3c2a3a,null));};exports[_0xcd12('0x67')]=function(_0x11bbcb,_0x22507e,_0x5d972a){var _0x1040cc='';return db[_0xcd12('0x3d')]['findOne']({'where':{'id':_0x11bbcb[_0xcd12('0x5a')]['id']},'attributes':['id',_0xcd12('0x68'),'password','token',_0xcd12('0x69'),'remoteUri']})['then'](handleEntityNotFound(_0x22507e,null))[_0xcd12('0x21')](function(_0x5317e0){if(_0x5317e0){_0x1040cc=_0x5317e0[_0xcd12('0x6a')];var _0x12daad=_0x1040cc[_0xcd12('0x6b')](-0x1);if(_0x12daad==='/'){_0x1040cc=_0x1040cc[_0xcd12('0x6c')](0x0,_0x1040cc[_0xcd12('0x6d')](_0x12daad));}var _0x4f17c5={'method':_0xcd12('0x6e'),'uri':util[_0xcd12('0x6f')](_0xcd12('0x70'),_0x1040cc,'ticket_fields'),'json':!![]};switch(_0x5317e0[_0xcd12('0x69')]){case _0xcd12('0x71'):_0x4f17c5['headers']={'Authorization':util[_0xcd12('0x6f')]('Basic\x20%s',new Buffer(util[_0xcd12('0x6f')](_0xcd12('0x72'),_0x5317e0[_0xcd12('0x68')],_0x5317e0[_0xcd12('0x71')]))[_0xcd12('0x73')](_0xcd12('0x74')))};break;case _0xcd12('0x75'):_0x4f17c5[_0xcd12('0x76')]={'Authorization':util[_0xcd12('0x6f')](_0xcd12('0x77'),new Buffer(util[_0xcd12('0x6f')](_0xcd12('0x78'),_0x5317e0[_0xcd12('0x68')],_0x5317e0[_0xcd12('0x75')]))['toString'](_0xcd12('0x74')))};break;default:throw new db[(_0xcd12('0x1e'))][(_0xcd12('0x1f'))](_0xcd12('0x79'));}return rp(_0x4f17c5);}})[_0xcd12('0x21')](function(_0xb574de){if(_0xb574de){var _0x9b0cef=[_0xcd12('0x7a'),'description',_0xcd12('0x7b'),_0xcd12('0x7c')];_[_0xcd12('0x7d')](_0xb574de['ticket_fields'],function(_0x36b097){return _0x9b0cef[_0xcd12('0x7e')](_0x36b097[_0xcd12('0x40')]);});return{'count':_0xb574de[_0xcd12('0x7f')][_0xcd12('0x49')],'rows':_[_0xcd12('0x3c')](_0xb574de[_0xcd12('0x7f')],function(_0x43a61){return{'id':_0x43a61['id'],'name':_0x43a61['position']>0x7?_0x43a61[_0xcd12('0x80')]:_0x43a61['type'],'custom':_0x43a61[_0xcd12('0x81')]>0x7?!![]:![],'options':_0x43a61[_0xcd12('0x82')]?_0x43a61[_0xcd12('0x82')]:_0x43a61[_0xcd12('0x83')]?_0x43a61[_0xcd12('0x83')]:[]};})};}})[_0xcd12('0x21')](respondWithResult(_0x22507e,null))[_0xcd12('0x2b')](function(_0x2e11ac){var _0x22631e=_0x11bbcb['query'][_0xcd12('0x84')]?0x1f4:_0x2e11ac['statusCode']||0x1f4;logger[_0xcd12('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xcd12('0x67'),_0x22631e,JSON[_0xcd12('0x25')](_0x2e11ac));delete _0x2e11ac[_0xcd12('0x39')];if(_0x22631e===0x191){_0x22631e=0x190;}_0x22507e['status'](_0x22631e)[_0xcd12('0x3a')](_0x11bbcb[_0xcd12('0x43')][_0xcd12('0x84')]?{'message':'Wrong\x20credentials','statusCode':_0x2e11ac[_0xcd12('0x85')]}:_0x2e11ac);});}; \ No newline at end of file +var _0x1687=['stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','order','sort','pick','hasOwnProperty','findOne','channel','Descriptions','getDescriptions','ZendeskField','Subjects','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','token','Unknown\x20authentication\x20type','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','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','info','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ZendeskAccount,\x20%s,\x20%s','sendStatus','end','status','count','offset','limit','set','apply','reject','save','update','destroy'];(function(_0x1591f7,_0x5aedd6){var _0x4e1517=function(_0x544aff){while(--_0x544aff){_0x1591f7['push'](_0x1591f7['shift']());}};_0x4e1517(++_0x5aedd6);}(_0x1687,0x145));var _0x7168=function(_0x282393,_0x3b2b82){_0x282393=_0x282393-0x0;var _0x206507=_0x1687[_0x282393];return _0x206507;};'use strict';var pdf=require(_0x7168('0x0'));var emlformat=require(_0x7168('0x1'));var rimraf=require(_0x7168('0x2'));var zipdir=require(_0x7168('0x3'));var jsonpatch=require(_0x7168('0x4'));var rp=require(_0x7168('0x5'));var moment=require('moment');var BPromise=require(_0x7168('0x6'));var Mustache=require(_0x7168('0x7'));var util=require('util');var path=require(_0x7168('0x8'));var sox=require(_0x7168('0x9'));var csv=require(_0x7168('0xa'));var ejs=require(_0x7168('0xb'));var fs=require('fs');var _=require(_0x7168('0xc'));var squel=require(_0x7168('0xd'));var crypto=require(_0x7168('0xe'));var jsforce=require(_0x7168('0xf'));var deskjs=require(_0x7168('0x10'));var toCsv=require(_0x7168('0xa'));var querystring=require(_0x7168('0x11'));var Papa=require('papaparse');var Redis=require(_0x7168('0x12'));var authService=require(_0x7168('0x13'));var qs=require(_0x7168('0x14'));var as=require(_0x7168('0x15'));var hardwareService=require(_0x7168('0x16'));var logger=require(_0x7168('0x17'))(_0x7168('0x18'));var utils=require('../../config/utils');var config=require(_0x7168('0x19'));var db=require(_0x7168('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x7168('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x1afe72,_0x2ad3d0,_0xcf0fd5){if(_0xcf0fd5){var _0x1326fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1326fd[_0x7168('0x1c')](_0x2ad3d0)){return _0x1afe72;}else{throw new db[(_0x7168('0x1d'))][(_0x7168('0x1e'))](_0x7168('0x1f'));}}else{return _0x1afe72;}}function respondWithRpcPromise(_0x727dce,_0x3a402f,_0x1daf68,_0x36bc40){return new BPromise(function(_0xacabd7,_0x3afe9b){var _0x2cc543=_0x36bc40||client;return _0x2cc543[_0x7168('0x20')](_0x727dce,_0x1daf68)[_0x7168('0x21')](function(_0x1d142c){logger[_0x7168('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x3a402f,_0x7168('0x23'));logger['debug'](_0x7168('0x24'),_0x3a402f,_0x7168('0x23'),JSON[_0x7168('0x25')](_0x1d142c));if(_0x1d142c['error']){if(_0x1d142c[_0x7168('0x26')]['code']===0x1f4){logger[_0x7168('0x26')]('ZendeskAccount,\x20%s,\x20%s',_0x3a402f,_0x1d142c[_0x7168('0x26')][_0x7168('0x27')]);return _0x3afe9b(_0x1d142c[_0x7168('0x26')][_0x7168('0x27')]);}logger[_0x7168('0x26')]('ZendeskAccount,\x20%s,\x20%s',_0x3a402f,_0x1d142c['error']['message']);return _0xacabd7(_0x1d142c[_0x7168('0x26')][_0x7168('0x27')]);}else{logger['info'](_0x7168('0x28'),_0x3a402f,_0x7168('0x23'));_0xacabd7(_0x1d142c['result'][_0x7168('0x27')]);}})['catch'](function(_0x36e4fc){logger[_0x7168('0x26')](_0x7168('0x28'),_0x3a402f,_0x36e4fc);_0x3afe9b(_0x36e4fc);});});}function respondWithStatusCode(_0x1a4045,_0xb354bc){_0xb354bc=_0xb354bc||0xcc;return function(_0x1de8f0){if(_0x1de8f0){return _0x1a4045[_0x7168('0x29')](_0xb354bc);}return _0x1a4045['status'](_0xb354bc)[_0x7168('0x2a')]();};}function respondWithResult(_0x27071d,_0x2e134f){_0x2e134f=_0x2e134f||0xc8;return function(_0x4d9873){if(_0x4d9873){return _0x27071d[_0x7168('0x2b')](_0x2e134f)['json'](_0x4d9873);}};}function respondWithFilteredResult(_0x415d83,_0x396018){return function(_0x1aa620){if(_0x1aa620){var _0x42c6ff=_0x1aa620[_0x7168('0x2c')],_0x4f6d25=_0x396018[_0x7168('0x2d')],_0x1ff8af=_0x396018[_0x7168('0x2d')]+_0x396018[_0x7168('0x2e')],_0x4b924b;if(_0x1ff8af>=_0x42c6ff){_0x1ff8af=_0x42c6ff;_0x4b924b=0xc8;}else{_0x4b924b=0xce;}_0x415d83[_0x7168('0x2b')](_0x4b924b);return _0x415d83[_0x7168('0x2f')]('Content-Range',_0x4f6d25+'-'+_0x1ff8af+'/'+_0x42c6ff)['json'](_0x1aa620);}return null;};}function patchUpdates(_0x439efb){return function(_0x56ef45){try{jsonpatch[_0x7168('0x30')](_0x56ef45,_0x439efb,!![]);}catch(_0xc0811c){return BPromise[_0x7168('0x31')](_0xc0811c);}return _0x56ef45[_0x7168('0x32')]();};}function saveUpdates(_0xf348f9,_0x3ccef3){return function(_0x15274b){if(_0x15274b){return _0x15274b[_0x7168('0x33')](_0xf348f9)['then'](function(_0x2836ae){return _0x2836ae;});}return null;};}function removeEntity(_0x5d232d,_0xbacd18){return function(_0x661734){if(_0x661734){return _0x661734[_0x7168('0x34')]()['then'](function(){_0x5d232d[_0x7168('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f41a4,_0x2036ab){return function(_0x4badcc){if(!_0x4badcc){_0x3f41a4[_0x7168('0x29')](0x194);}return _0x4badcc;};}function handleError(_0x1915c1,_0x4d9478){_0x4d9478=_0x4d9478||0x1f4;return function(_0x5621c5){logger[_0x7168('0x26')](_0x5621c5[_0x7168('0x35')]);if(_0x5621c5[_0x7168('0x36')]){delete _0x5621c5[_0x7168('0x36')];}_0x1915c1['status'](_0x4d9478)[_0x7168('0x37')](_0x5621c5);};}exports[_0x7168('0x38')]=function(_0x137be4,_0x374791){var _0xbf7a62={},_0x4f7f19={},_0x23e020={'count':0x0,'rows':[]};var _0x213741=_[_0x7168('0x39')](db[_0x7168('0x3a')][_0x7168('0x3b')],function(_0x447581){return{'name':_0x447581['fieldName'],'type':_0x447581['type'][_0x7168('0x3c')]};});_0x4f7f19[_0x7168('0x3d')]=_[_0x7168('0x39')](_0x213741,_0x7168('0x36'));_0x4f7f19[_0x7168('0x3e')]=_[_0x7168('0x3f')](_0x137be4[_0x7168('0x3e')]);_0x4f7f19[_0x7168('0x40')]=_[_0x7168('0x41')](_0x4f7f19[_0x7168('0x3d')],_0x4f7f19[_0x7168('0x3e')]);_0xbf7a62[_0x7168('0x42')]=_[_0x7168('0x41')](_0x4f7f19['model'],qs[_0x7168('0x43')](_0x137be4['query'][_0x7168('0x43')]));_0xbf7a62['attributes']=_0xbf7a62[_0x7168('0x42')][_0x7168('0x44')]?_0xbf7a62[_0x7168('0x42')]:_0x4f7f19[_0x7168('0x3d')];if(!_0x137be4[_0x7168('0x3e')]['hasOwnProperty'](_0x7168('0x45'))){_0xbf7a62['limit']=qs[_0x7168('0x2e')](_0x137be4['query'][_0x7168('0x2e')]);_0xbf7a62['offset']=qs[_0x7168('0x2d')](_0x137be4[_0x7168('0x3e')]['offset']);}_0xbf7a62['order']=qs['sort'](_0x137be4['query']['sort']);_0xbf7a62[_0x7168('0x46')]=qs['filters'](_['pick'](_0x137be4[_0x7168('0x3e')],_0x4f7f19[_0x7168('0x40')]),_0x213741);if(_0x137be4[_0x7168('0x3e')][_0x7168('0x47')]){_0xbf7a62[_0x7168('0x46')]=_[_0x7168('0x48')](_0xbf7a62[_0x7168('0x46')],{'$or':_[_0x7168('0x39')](_0x213741,function(_0x43bff7){if(_0x43bff7[_0x7168('0x49')]!=='VIRTUAL'){var _0x4a43ec={};_0x4a43ec[_0x43bff7[_0x7168('0x36')]]={'$like':'%'+_0x137be4[_0x7168('0x3e')][_0x7168('0x47')]+'%'};return _0x4a43ec;}})});}_0xbf7a62=_[_0x7168('0x48')]({},_0xbf7a62,_0x137be4[_0x7168('0x4a')]);var _0x10b96a={'where':_0xbf7a62[_0x7168('0x46')]};return db[_0x7168('0x3a')]['count'](_0x10b96a)[_0x7168('0x21')](function(_0x3d332e){_0x23e020['count']=_0x3d332e;if(_0x137be4[_0x7168('0x3e')][_0x7168('0x4b')]){_0xbf7a62['include']=[{'all':!![]}];}return db[_0x7168('0x3a')][_0x7168('0x4c')](_0xbf7a62);})[_0x7168('0x21')](function(_0x576bf1){_0x23e020[_0x7168('0x4d')]=_0x576bf1;return _0x23e020;})[_0x7168('0x21')](respondWithFilteredResult(_0x374791,_0xbf7a62))[_0x7168('0x4e')](handleError(_0x374791,null));};exports[_0x7168('0x4f')]=function(_0x4131d8,_0x40aabc){var _0x2b26df={'raw':![],'where':{'id':_0x4131d8[_0x7168('0x50')]['id']}},_0x4de3e4={};_0x4de3e4[_0x7168('0x3d')]=_['keys'](db[_0x7168('0x3a')][_0x7168('0x3b')]);_0x4de3e4[_0x7168('0x3e')]=_[_0x7168('0x3f')](_0x4131d8[_0x7168('0x3e')]);_0x4de3e4['filters']=_['intersection'](_0x4de3e4['model'],_0x4de3e4[_0x7168('0x3e')]);_0x2b26df[_0x7168('0x42')]=_[_0x7168('0x41')](_0x4de3e4['model'],qs[_0x7168('0x43')](_0x4131d8[_0x7168('0x3e')]['fields']));_0x2b26df[_0x7168('0x42')]=_0x2b26df[_0x7168('0x42')][_0x7168('0x44')]?_0x2b26df['attributes']:_0x4de3e4[_0x7168('0x3d')];if(_0x4131d8[_0x7168('0x3e')][_0x7168('0x4b')]){_0x2b26df[_0x7168('0x51')]=[{'all':!![]}];}_0x2b26df=_[_0x7168('0x48')]({},_0x2b26df,_0x4131d8[_0x7168('0x4a')]);return db[_0x7168('0x3a')][_0x7168('0x52')](_0x2b26df)[_0x7168('0x21')](handleEntityNotFound(_0x40aabc,null))[_0x7168('0x21')](respondWithResult(_0x40aabc,null))[_0x7168('0x4e')](handleError(_0x40aabc,null));};exports[_0x7168('0x53')]=function(_0x306c92,_0x28969a){return db[_0x7168('0x3a')][_0x7168('0x53')](_0x306c92[_0x7168('0x54')],{})[_0x7168('0x21')](respondWithResult(_0x28969a,0xc9))[_0x7168('0x4e')](handleError(_0x28969a,null));};exports[_0x7168('0x33')]=function(_0x4ed3fa,_0x37bd80){if(_0x4ed3fa[_0x7168('0x54')]['id']){delete _0x4ed3fa[_0x7168('0x54')]['id'];}return db[_0x7168('0x3a')][_0x7168('0x52')]({'where':{'id':_0x4ed3fa[_0x7168('0x50')]['id']}})['then'](handleEntityNotFound(_0x37bd80,null))[_0x7168('0x21')](saveUpdates(_0x4ed3fa[_0x7168('0x54')],null))[_0x7168('0x21')](respondWithResult(_0x37bd80,null))[_0x7168('0x4e')](handleError(_0x37bd80,null));};exports[_0x7168('0x34')]=function(_0xe6961b,_0x20b53b){return db[_0x7168('0x3a')][_0x7168('0x52')]({'where':{'id':_0xe6961b['params']['id']}})['then'](handleEntityNotFound(_0x20b53b,null))[_0x7168('0x21')](removeEntity(_0x20b53b,null))['catch'](handleError(_0x20b53b,null));};exports[_0x7168('0x55')]=function(_0x51bab8,_0x169917,_0x2c2f0f){var _0x2508ca={};var _0x436b62={};var _0x155329;var _0x5f1979;return db[_0x7168('0x3a')]['findOne']({'where':{'id':_0x51bab8[_0x7168('0x50')]['id']}})[_0x7168('0x21')](handleEntityNotFound(_0x169917,null))['then'](function(_0x5f54fd){if(_0x5f54fd){_0x155329=_0x5f54fd;_0x436b62[_0x7168('0x3d')]=_[_0x7168('0x3f')](db['ZendeskConfiguration'][_0x7168('0x3b')]);_0x436b62[_0x7168('0x3e')]=_[_0x7168('0x3f')](_0x51bab8['query']);_0x436b62[_0x7168('0x40')]=_[_0x7168('0x41')](_0x436b62[_0x7168('0x3d')],_0x436b62[_0x7168('0x3e')]);_0x2508ca[_0x7168('0x42')]=_['intersection'](_0x436b62[_0x7168('0x3d')],qs[_0x7168('0x43')](_0x51bab8['query']['fields']));_0x2508ca['attributes']=_0x2508ca['attributes'][_0x7168('0x44')]?_0x2508ca['attributes']:_0x436b62[_0x7168('0x3d')];_0x2508ca[_0x7168('0x56')]=qs[_0x7168('0x57')](_0x51bab8[_0x7168('0x3e')][_0x7168('0x57')]);_0x2508ca[_0x7168('0x46')]=qs['filters'](_[_0x7168('0x58')](_0x51bab8[_0x7168('0x3e')],_0x436b62[_0x7168('0x40')]));if(_0x51bab8['query'][_0x7168('0x47')]){_0x2508ca[_0x7168('0x46')]=_['merge'](_0x2508ca[_0x7168('0x46')],{'$or':_[_0x7168('0x39')](_0x2508ca[_0x7168('0x42')],function(_0x5e0197){var _0x3ff203={};_0x3ff203[_0x5e0197]={'$like':'%'+_0x51bab8[_0x7168('0x3e')]['filter']+'%'};return _0x3ff203;})});}_0x2508ca=_[_0x7168('0x48')]({},_0x2508ca,_0x51bab8[_0x7168('0x4a')]);return _0x155329[_0x7168('0x55')](_0x2508ca);}})[_0x7168('0x21')](function(_0x3aa5d3){if(_0x3aa5d3){_0x5f1979=_0x3aa5d3[_0x7168('0x44')];if(!_0x51bab8[_0x7168('0x3e')][_0x7168('0x59')](_0x7168('0x45'))){_0x2508ca[_0x7168('0x2e')]=qs[_0x7168('0x2e')](_0x51bab8[_0x7168('0x3e')][_0x7168('0x2e')]);_0x2508ca[_0x7168('0x2d')]=qs[_0x7168('0x2d')](_0x51bab8[_0x7168('0x3e')][_0x7168('0x2d')]);}return _0x155329[_0x7168('0x55')](_0x2508ca);}})[_0x7168('0x21')](function(_0x4326d4){if(_0x4326d4){return _0x4326d4?{'count':_0x5f1979,'rows':_0x4326d4}:null;}})[_0x7168('0x21')](respondWithResult(_0x169917,null))[_0x7168('0x4e')](handleError(_0x169917,null));};exports['addConfiguration']=function(_0x81b06b,_0xeb232a,_0x44e498){if(_0x81b06b[_0x7168('0x54')]['id']){delete _0x81b06b[_0x7168('0x54')]['id'];}return db['ZendeskAccount'][_0x7168('0x5a')]({'where':{'id':_0x81b06b[_0x7168('0x50')]['id']}})[_0x7168('0x21')](handleEntityNotFound(_0xeb232a,null))[_0x7168('0x21')](function(_0x21c8fc){if(_0x21c8fc){_0x81b06b[_0x7168('0x54')]['AccountId']=_0x21c8fc['id'];_0x81b06b[_0x7168('0x54')]['Subjects']=integrations['getSubjects'](_0x81b06b[_0x7168('0x54')][_0x7168('0x5b')],_0x81b06b[_0x7168('0x54')][_0x7168('0x49')]);_0x81b06b[_0x7168('0x54')][_0x7168('0x5c')]=integrations[_0x7168('0x5d')](_0x81b06b[_0x7168('0x54')][_0x7168('0x5b')],_0x81b06b[_0x7168('0x54')][_0x7168('0x49')]);return db['ZendeskConfiguration'][_0x7168('0x53')](_0x81b06b[_0x7168('0x54')],{'include':[{'model':db[_0x7168('0x5e')],'as':_0x7168('0x5f')},{'model':db[_0x7168('0x5e')],'as':_0x7168('0x5c')}]});}return null;})[_0x7168('0x21')](respondWithResult(_0xeb232a,null))[_0x7168('0x4e')](handleError(_0xeb232a,null));};exports['getFields']=function(_0x50ef61,_0x370603,_0x734e41){var _0x66477='';return db[_0x7168('0x3a')][_0x7168('0x5a')]({'where':{'id':_0x50ef61['params']['id']},'attributes':['id',_0x7168('0x60'),_0x7168('0x61'),'token',_0x7168('0x62'),_0x7168('0x63')]})[_0x7168('0x21')](handleEntityNotFound(_0x370603,null))[_0x7168('0x21')](function(_0x3ae5ec){if(_0x3ae5ec){_0x66477=_0x3ae5ec[_0x7168('0x63')];var _0x5a3f61=_0x66477[_0x7168('0x64')](-0x1);if(_0x5a3f61==='/'){_0x66477=_0x66477[_0x7168('0x65')](0x0,_0x66477[_0x7168('0x66')](_0x5a3f61));}var _0x1267d={'method':_0x7168('0x67'),'uri':util[_0x7168('0x68')](_0x7168('0x69'),_0x66477,_0x7168('0x6a')),'json':!![]};switch(_0x3ae5ec['authType']){case _0x7168('0x61'):_0x1267d[_0x7168('0x6b')]={'Authorization':util[_0x7168('0x68')](_0x7168('0x6c'),new Buffer(util[_0x7168('0x68')](_0x7168('0x6d'),_0x3ae5ec[_0x7168('0x60')],_0x3ae5ec[_0x7168('0x61')]))[_0x7168('0x6e')](_0x7168('0x6f')))};break;case _0x7168('0x70'):_0x1267d[_0x7168('0x6b')]={'Authorization':util[_0x7168('0x68')](_0x7168('0x6c'),new Buffer(util[_0x7168('0x68')]('%s/token:%s',_0x3ae5ec[_0x7168('0x60')],_0x3ae5ec[_0x7168('0x70')]))[_0x7168('0x6e')](_0x7168('0x6f')))};break;default:throw new db[(_0x7168('0x1d'))][(_0x7168('0x1e'))](_0x7168('0x71'));}return rp(_0x1267d);}})['then'](function(_0x5c6446){if(_0x5c6446){var _0xe81936=['subject',_0x7168('0x72'),'group',_0x7168('0x73')];_[_0x7168('0x74')](_0x5c6446['ticket_fields'],function(_0x4d0b42){return _0xe81936[_0x7168('0x75')](_0x4d0b42['type']);});return{'count':_0x5c6446[_0x7168('0x6a')][_0x7168('0x44')],'rows':_[_0x7168('0x39')](_0x5c6446['ticket_fields'],function(_0x45bfce){return{'id':_0x45bfce['id'],'name':_0x45bfce[_0x7168('0x76')]>0x7?_0x45bfce[_0x7168('0x77')]:_0x45bfce[_0x7168('0x49')],'custom':_0x45bfce[_0x7168('0x76')]>0x7?!![]:![],'options':_0x45bfce[_0x7168('0x78')]?_0x45bfce[_0x7168('0x78')]:_0x45bfce['custom_field_options']?_0x45bfce[_0x7168('0x79')]:[]};})};}})[_0x7168('0x21')](respondWithResult(_0x370603,null))[_0x7168('0x4e')](function(_0x5de158){var _0x2e3364=_0x50ef61[_0x7168('0x3e')][_0x7168('0x1c')]?0x1f4:_0x5de158[_0x7168('0x7a')]||0x1f4;logger[_0x7168('0x26')](_0x7168('0x7b'),_0x7168('0x7c'),_0x2e3364,JSON['stringify'](_0x5de158));delete _0x5de158[_0x7168('0x36')];if(_0x2e3364===0x191){_0x2e3364=0x190;}_0x370603['status'](_0x2e3364)['send'](_0x50ef61[_0x7168('0x3e')]['test']?{'message':_0x7168('0x7d'),'statusCode':_0x5de158[_0x7168('0x7a')]}:_0x5de158);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 0c217c7..6057878 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 _0x85aa=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x459395,_0x39372d){var _0x123a21=function(_0x3bf63e){while(--_0x3bf63e){_0x459395['push'](_0x459395['shift']());}};_0x123a21(++_0x39372d);}(_0x85aa,0xdb));var _0xa85a=function(_0x115a49,_0x57069c){_0x115a49=_0x115a49-0x0;var _0x32aaea=_0x85aa[_0x115a49];return _0x32aaea;};'use strict';var _=require(_0xa85a('0x0'));var util=require(_0xa85a('0x1'));var logger=require(_0xa85a('0x2'))(_0xa85a('0x3'));var moment=require(_0xa85a('0x4'));var BPromise=require('bluebird');var rp=require(_0xa85a('0x5'));var fs=require('fs');var path=require(_0xa85a('0x6'));var rimraf=require(_0xa85a('0x7'));var config=require(_0xa85a('0x8'));var attributes=require(_0xa85a('0x9'));var integrations=require(_0xa85a('0xa'));module[_0xa85a('0xb')]=function(_0x5486e8,_0x3de01d){return _0x5486e8['define'](_0xa85a('0xc'),attributes,{'tableName':_0xa85a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x341c=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','../../config/logger','path','rimraf'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x341c,0x165));var _0xc341=function(_0x554b32,_0x577efd){_0x554b32=_0x554b32-0x0;var _0x2d896d=_0x341c[_0x554b32];return _0x2d896d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc341('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc341('0x1'));var rimraf=require(_0xc341('0x2'));var config=require(_0xc341('0x3'));var attributes=require(_0xc341('0x4'));var integrations=require(_0xc341('0x5'));module['exports']=function(_0x3944df,_0x31f0c1){return _0x3944df[_0xc341('0x6')](_0xc341('0x7'),attributes,{'tableName':_0xc341('0x8'),'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 37df2d8..de09b5e 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 _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','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'];(function(_0x562ef9,_0x2d4efe){var _0x25b03d=function(_0x4af0b4){while(--_0x4af0b4){_0x562ef9['push'](_0x562ef9['shift']());}};_0x25b03d(++_0x2d4efe);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file +var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0x4379a4,_0x54e696){var _0x44ba8c=function(_0x24ae2d){while(--_0x24ae2d){_0x4379a4['push'](_0x4379a4['shift']());}};_0x44ba8c(++_0x54e696);}(_0xe706,0xa3));var _0x6e70=function(_0x5089ea,_0x3d8378){_0x5089ea=_0x5089ea-0x0;var _0xabe953=_0xe706[_0x5089ea];return _0xabe953;};'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']('ZendeskAccount,\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']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7df2e51..f72156b 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 _0x79c7=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','setTags','/:id','delete','destroy','util','path','express','../../components/auth/service'];(function(_0x301f7c,_0x462f8b){var _0xc05c41=function(_0x20e539){while(--_0x20e539){_0x301f7c['push'](_0x301f7c['shift']());}};_0xc05c41(++_0x462f8b);}(_0x79c7,0x96));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x779c('0x0'));var path=require(_0x779c('0x1'));var timeout=require('connect-timeout');var express=require(_0x779c('0x2'));var router=express['Router']();var auth=require(_0x779c('0x3'));var interaction=require(_0x779c('0x4'));var config=require(_0x779c('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0x779c('0x6')]('/',auth['isAuthenticated'](),controller[_0x779c('0x7')]);router[_0x779c('0x6')]('/:id',auth[_0x779c('0x8')](),controller['show']);router[_0x779c('0x6')](_0x779c('0x9'),auth[_0x779c('0x8')](),controller['getFields']);router[_0x779c('0x6')](_0x779c('0xa'),auth[_0x779c('0x8')](),controller[_0x779c('0xb')]);router['get'](_0x779c('0xc'),auth[_0x779c('0x8')](),controller[_0x779c('0xd')]);router[_0x779c('0x6')]('/:id/tags',auth['isAuthenticated'](),controller[_0x779c('0xe')]);router['post']('/',auth[_0x779c('0x8')](),controller[_0x779c('0xf')]);router[_0x779c('0x10')](_0x779c('0x11'),auth[_0x779c('0x8')](),controller[_0x779c('0x12')]);router['put'](_0x779c('0x13'),auth[_0x779c('0x8')](),controller['update']);router[_0x779c('0x14')]('/:id',auth[_0x779c('0x8')](),controller[_0x779c('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4637=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','/:id','show','get','/:id/fields','/:id/subjects','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4637,0x1ac));var _0x7463=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4637[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x7463('0x0'));var util=require(_0x7463('0x1'));var path=require(_0x7463('0x2'));var timeout=require(_0x7463('0x3'));var express=require(_0x7463('0x4'));var router=express[_0x7463('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7463('0x6'));var config=require(_0x7463('0x7'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7463('0x8'),auth['isAuthenticated'](),controller[_0x7463('0x9')]);router[_0x7463('0xa')](_0x7463('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x7463('0xa')](_0x7463('0xc'),auth[_0x7463('0xd')](),controller[_0x7463('0xe')]);router[_0x7463('0xa')](_0x7463('0xf'),auth[_0x7463('0xd')](),controller[_0x7463('0x10')]);router[_0x7463('0xa')]('/:id/tags',auth[_0x7463('0xd')](),controller[_0x7463('0x11')]);router[_0x7463('0x12')]('/',auth[_0x7463('0xd')](),controller[_0x7463('0x13')]);router['post'](_0x7463('0x14'),auth['isAuthenticated'](),controller[_0x7463('0x15')]);router[_0x7463('0x16')]('/:id',auth[_0x7463('0xd')](),controller['update']);router[_0x7463('0x17')](_0x7463('0x8'),auth[_0x7463('0xd')](),controller[_0x7463('0x18')]);module[_0x7463('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 3075131..51f16e5 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 _0xfc11=['exports','STRING'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0xfc11,0xc2));var _0x1fc1=function(_0x160457,_0x56169d){_0x160457=_0x160457-0x0;var _0x1522a3=_0xfc11[_0x160457];return _0x1522a3;};'use strict';var Sequelize=require('sequelize');module[_0x1fc1('0x0')]={'name':{'type':Sequelize[_0x1fc1('0x1')]},'description':{'type':Sequelize[_0x1fc1('0x1')]}}; \ No newline at end of file +var _0xe9c5=['STRING','sequelize'];(function(_0x25e647,_0x55bb46){var _0x10c43a=function(_0x304bef){while(--_0x304bef){_0x25e647['push'](_0x25e647['shift']());}};_0x10c43a(++_0x55bb46);}(_0xe9c5,0x85));var _0x5e9c=function(_0x3763cb,_0x3fdc1b){_0x3763cb=_0x3763cb-0x0;var _0x13a588=_0xe9c5[_0x3763cb];return _0x13a588;};'use strict';var Sequelize=require(_0x5e9c('0x0'));module['exports']={'name':{'type':Sequelize[_0x5e9c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b439412..81cb466 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 _0xe2c6=['http','test','Sequelize','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','reject','save','update','end','stack','name','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','destroy','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client'];(function(_0x4d06f2,_0x2d3e51){var _0x1e5262=function(_0x59611c){while(--_0x59611c){_0x4d06f2['push'](_0x4d06f2['shift']());}};_0x1e5262(++_0x2d3e51);}(_0xe2c6,0x1c8));var _0x6e2c=function(_0x8e4d38,_0xcda9cc){_0x8e4d38=_0x8e4d38-0x0;var _0x264499=_0xe2c6[_0x8e4d38];return _0x264499;};'use strict';var pdf=require(_0x6e2c('0x0'));var emlformat=require(_0x6e2c('0x1'));var rimraf=require(_0x6e2c('0x2'));var zipdir=require(_0x6e2c('0x3'));var jsonpatch=require(_0x6e2c('0x4'));var rp=require(_0x6e2c('0x5'));var moment=require(_0x6e2c('0x6'));var BPromise=require(_0x6e2c('0x7'));var Mustache=require(_0x6e2c('0x8'));var util=require(_0x6e2c('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x6e2c('0xa'));var ejs=require(_0x6e2c('0xb'));var fs=require('fs');var _=require(_0x6e2c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6e2c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6e2c('0xa'));var querystring=require(_0x6e2c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e2c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6e2c('0x10'));var hardwareService=require(_0x6e2c('0x11'));var logger=require(_0x6e2c('0x12'))(_0x6e2c('0x13'));var utils=require(_0x6e2c('0x14'));var config=require('../../config/environment');var db=require(_0x6e2c('0x15'))['db'];var jayson=require(_0x6e2c('0x16'));var client=jayson[_0x6e2c('0x17')][_0x6e2c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x19aded,_0x99e5b2,_0x33e7a6){if(_0x33e7a6){var _0x5116b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5116b0[_0x6e2c('0x19')](_0x99e5b2)){return _0x19aded;}else{throw new db[(_0x6e2c('0x1a'))][(_0x6e2c('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 _0x19aded;}}function respondWithRpcPromise(_0x474a85,_0x316020,_0x2849af,_0x119544){return new BPromise(function(_0x503d2c,_0x58ac24){var _0x251ebc=_0x119544||client;return _0x251ebc[_0x6e2c('0x1c')](_0x474a85,_0x2849af)[_0x6e2c('0x1d')](function(_0xf67219){logger[_0x6e2c('0x1e')](_0x6e2c('0x1f'),_0x316020,_0x6e2c('0x20'));logger[_0x6e2c('0x21')](_0x6e2c('0x22'),_0x316020,'request\x20sent',JSON[_0x6e2c('0x23')](_0xf67219));if(_0xf67219[_0x6e2c('0x24')]){if(_0xf67219[_0x6e2c('0x24')][_0x6e2c('0x25')]===0x1f4){logger[_0x6e2c('0x24')](_0x6e2c('0x1f'),_0x316020,_0xf67219['error'][_0x6e2c('0x26')]);return _0x58ac24(_0xf67219[_0x6e2c('0x24')][_0x6e2c('0x26')]);}logger[_0x6e2c('0x24')](_0x6e2c('0x1f'),_0x316020,_0xf67219[_0x6e2c('0x24')][_0x6e2c('0x26')]);return _0x503d2c(_0xf67219[_0x6e2c('0x24')][_0x6e2c('0x26')]);}else{logger['info'](_0x6e2c('0x1f'),_0x316020,_0x6e2c('0x20'));_0x503d2c(_0xf67219[_0x6e2c('0x27')][_0x6e2c('0x26')]);}})[_0x6e2c('0x28')](function(_0x122b93){logger[_0x6e2c('0x24')](_0x6e2c('0x1f'),_0x316020,_0x122b93);_0x58ac24(_0x122b93);});});}function respondWithStatusCode(_0x2781b0,_0x5b5132){_0x5b5132=_0x5b5132||0xcc;return function(_0x569df3){if(_0x569df3){return _0x2781b0[_0x6e2c('0x29')](_0x5b5132);}return _0x2781b0[_0x6e2c('0x2a')](_0x5b5132)['end']();};}function respondWithResult(_0x50b647,_0x2b9252){_0x2b9252=_0x2b9252||0xc8;return function(_0x30253d){if(_0x30253d){return _0x50b647[_0x6e2c('0x2a')](_0x2b9252)[_0x6e2c('0x2b')](_0x30253d);}};}function respondWithFilteredResult(_0x5793d3,_0x5cee52){return function(_0x5fc525){if(_0x5fc525){var _0x8d2501=_0x5fc525[_0x6e2c('0x2c')],_0x34623a=_0x5cee52[_0x6e2c('0x2d')],_0x2b09db=_0x5cee52[_0x6e2c('0x2d')]+_0x5cee52['limit'],_0x4262b9;if(_0x2b09db>=_0x8d2501){_0x2b09db=_0x8d2501;_0x4262b9=0xc8;}else{_0x4262b9=0xce;}_0x5793d3[_0x6e2c('0x2a')](_0x4262b9);return _0x5793d3[_0x6e2c('0x2e')]('Content-Range',_0x34623a+'-'+_0x2b09db+'/'+_0x8d2501)[_0x6e2c('0x2b')](_0x5fc525);}return null;};}function patchUpdates(_0xf5fbca){return function(_0x19db14){try{jsonpatch['apply'](_0x19db14,_0xf5fbca,!![]);}catch(_0x393ce8){return BPromise[_0x6e2c('0x2f')](_0x393ce8);}return _0x19db14[_0x6e2c('0x30')]();};}function saveUpdates(_0x368231,_0x48e60b){return function(_0x4a9952){if(_0x4a9952){return _0x4a9952[_0x6e2c('0x31')](_0x368231)[_0x6e2c('0x1d')](function(_0x2871d1){return _0x2871d1;});}return null;};}function removeEntity(_0xcda5f5,_0x4513b3){return function(_0x2f1e5a){if(_0x2f1e5a){return _0x2f1e5a['destroy']()[_0x6e2c('0x1d')](function(){_0xcda5f5['status'](0xcc)[_0x6e2c('0x32')]();});}};}function handleEntityNotFound(_0x10fdbf,_0x12a1c3){return function(_0x3e62c9){if(!_0x3e62c9){_0x10fdbf[_0x6e2c('0x29')](0x194);}return _0x3e62c9;};}function handleError(_0x191078,_0x426abc){_0x426abc=_0x426abc||0x1f4;return function(_0x36c3b7){logger[_0x6e2c('0x24')](_0x36c3b7[_0x6e2c('0x33')]);if(_0x36c3b7[_0x6e2c('0x34')]){delete _0x36c3b7[_0x6e2c('0x34')];}_0x191078[_0x6e2c('0x2a')](_0x426abc)['send'](_0x36c3b7);};}exports['index']=function(_0x4a1b48,_0x276786){var _0x4d7a28={},_0x4d0471={},_0xfb2e23={'count':0x0,'rows':[]};var _0x281b51=_[_0x6e2c('0x35')](db['ZendeskConfiguration']['rawAttributes'],function(_0x2662a4){return{'name':_0x2662a4[_0x6e2c('0x36')],'type':_0x2662a4[_0x6e2c('0x37')][_0x6e2c('0x38')]};});_0x4d0471[_0x6e2c('0x39')]=_[_0x6e2c('0x35')](_0x281b51,_0x6e2c('0x34'));_0x4d0471['query']=_[_0x6e2c('0x3a')](_0x4a1b48[_0x6e2c('0x3b')]);_0x4d0471[_0x6e2c('0x3c')]=_[_0x6e2c('0x3d')](_0x4d0471[_0x6e2c('0x39')],_0x4d0471[_0x6e2c('0x3b')]);_0x4d7a28['attributes']=_['intersection'](_0x4d0471[_0x6e2c('0x39')],qs[_0x6e2c('0x3e')](_0x4a1b48[_0x6e2c('0x3b')][_0x6e2c('0x3e')]));_0x4d7a28[_0x6e2c('0x3f')]=_0x4d7a28[_0x6e2c('0x3f')][_0x6e2c('0x40')]?_0x4d7a28['attributes']:_0x4d0471[_0x6e2c('0x39')];if(!_0x4a1b48[_0x6e2c('0x3b')]['hasOwnProperty'](_0x6e2c('0x41'))){_0x4d7a28[_0x6e2c('0x42')]=qs[_0x6e2c('0x42')](_0x4a1b48['query'][_0x6e2c('0x42')]);_0x4d7a28[_0x6e2c('0x2d')]=qs[_0x6e2c('0x2d')](_0x4a1b48[_0x6e2c('0x3b')][_0x6e2c('0x2d')]);}_0x4d7a28[_0x6e2c('0x43')]=qs[_0x6e2c('0x44')](_0x4a1b48[_0x6e2c('0x3b')][_0x6e2c('0x44')]);_0x4d7a28[_0x6e2c('0x45')]=qs[_0x6e2c('0x3c')](_[_0x6e2c('0x46')](_0x4a1b48[_0x6e2c('0x3b')],_0x4d0471[_0x6e2c('0x3c')]),_0x281b51);if(_0x4a1b48[_0x6e2c('0x3b')][_0x6e2c('0x47')]){_0x4d7a28[_0x6e2c('0x45')]=_[_0x6e2c('0x48')](_0x4d7a28[_0x6e2c('0x45')],{'$or':_['map'](_0x281b51,function(_0x5660de){if(_0x5660de[_0x6e2c('0x37')]!==_0x6e2c('0x49')){var _0x20363c={};_0x20363c[_0x5660de['name']]={'$like':'%'+_0x4a1b48['query'][_0x6e2c('0x47')]+'%'};return _0x20363c;}})});}_0x4d7a28=_[_0x6e2c('0x48')]({},_0x4d7a28,_0x4a1b48[_0x6e2c('0x4a')]);var _0x51ac42={'where':_0x4d7a28[_0x6e2c('0x45')]};return db[_0x6e2c('0x4b')][_0x6e2c('0x2c')](_0x51ac42)[_0x6e2c('0x1d')](function(_0x17a6c8){_0xfb2e23[_0x6e2c('0x2c')]=_0x17a6c8;if(_0x4a1b48[_0x6e2c('0x3b')][_0x6e2c('0x4c')]){_0x4d7a28[_0x6e2c('0x4d')]=[{'all':!![]}];}return db[_0x6e2c('0x4b')][_0x6e2c('0x4e')](_0x4d7a28);})[_0x6e2c('0x1d')](function(_0x45f553){_0xfb2e23[_0x6e2c('0x4f')]=_0x45f553;return _0xfb2e23;})[_0x6e2c('0x1d')](respondWithFilteredResult(_0x276786,_0x4d7a28))[_0x6e2c('0x28')](handleError(_0x276786,null));};exports[_0x6e2c('0x50')]=function(_0x159d59,_0x37dab0){var _0x293934={'raw':![],'where':{'id':_0x159d59['params']['id']}},_0x2e1888={};_0x2e1888[_0x6e2c('0x39')]=_[_0x6e2c('0x3a')](db[_0x6e2c('0x4b')][_0x6e2c('0x51')]);_0x2e1888[_0x6e2c('0x3b')]=_[_0x6e2c('0x3a')](_0x159d59[_0x6e2c('0x3b')]);_0x2e1888[_0x6e2c('0x3c')]=_[_0x6e2c('0x3d')](_0x2e1888[_0x6e2c('0x39')],_0x2e1888[_0x6e2c('0x3b')]);_0x293934[_0x6e2c('0x3f')]=_[_0x6e2c('0x3d')](_0x2e1888[_0x6e2c('0x39')],qs['fields'](_0x159d59[_0x6e2c('0x3b')][_0x6e2c('0x3e')]));_0x293934[_0x6e2c('0x3f')]=_0x293934[_0x6e2c('0x3f')][_0x6e2c('0x40')]?_0x293934['attributes']:_0x2e1888[_0x6e2c('0x39')];if(_0x159d59['query'][_0x6e2c('0x4c')]){_0x293934[_0x6e2c('0x4d')]=[{'all':!![]}];}_0x293934=_[_0x6e2c('0x48')]({},_0x293934,_0x159d59[_0x6e2c('0x4a')]);return db[_0x6e2c('0x4b')][_0x6e2c('0x52')](_0x293934)[_0x6e2c('0x1d')](handleEntityNotFound(_0x37dab0,null))[_0x6e2c('0x1d')](respondWithResult(_0x37dab0,null))[_0x6e2c('0x28')](handleError(_0x37dab0,null));};exports[_0x6e2c('0x53')]=function(_0x1a5bf3,_0x5b1808){return db[_0x6e2c('0x4b')][_0x6e2c('0x53')](_0x1a5bf3[_0x6e2c('0x54')],{})[_0x6e2c('0x1d')](respondWithResult(_0x5b1808,0xc9))[_0x6e2c('0x28')](handleError(_0x5b1808,null));};exports['update']=function(_0x248db2,_0x11ae6d){if(_0x248db2[_0x6e2c('0x54')]['id']){delete _0x248db2[_0x6e2c('0x54')]['id'];}return db[_0x6e2c('0x4b')][_0x6e2c('0x52')]({'where':{'id':_0x248db2[_0x6e2c('0x55')]['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x11ae6d,null))['then'](saveUpdates(_0x248db2[_0x6e2c('0x54')],null))[_0x6e2c('0x1d')](respondWithResult(_0x11ae6d,null))[_0x6e2c('0x28')](handleError(_0x11ae6d,null));};exports[_0x6e2c('0x56')]=function(_0x1836a6,_0x3bb0e2){return db[_0x6e2c('0x4b')][_0x6e2c('0x52')]({'where':{'id':_0x1836a6[_0x6e2c('0x55')]['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x3bb0e2,null))[_0x6e2c('0x1d')](removeEntity(_0x3bb0e2,null))[_0x6e2c('0x28')](handleError(_0x3bb0e2,null));};exports[_0x6e2c('0x57')]=function(_0x626c29,_0x50e90a,_0x2c0c3b){var _0x1bcaef={};var _0x2e06a7={};var _0xe9f1db;var _0x59b52d;return db[_0x6e2c('0x4b')][_0x6e2c('0x58')]({'where':{'id':_0x626c29[_0x6e2c('0x55')]['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x50e90a,null))[_0x6e2c('0x1d')](function(_0x440453){if(_0x440453){_0xe9f1db=_0x440453;_0x2e06a7['model']=_['keys'](db[_0x6e2c('0x59')][_0x6e2c('0x51')]);_0x2e06a7['query']=_[_0x6e2c('0x3a')](_0x626c29['query']);_0x2e06a7[_0x6e2c('0x3c')]=_[_0x6e2c('0x3d')](_0x2e06a7['model'],_0x2e06a7[_0x6e2c('0x3b')]);_0x1bcaef[_0x6e2c('0x3f')]=_[_0x6e2c('0x3d')](_0x2e06a7[_0x6e2c('0x39')],qs[_0x6e2c('0x3e')](_0x626c29[_0x6e2c('0x3b')][_0x6e2c('0x3e')]));_0x1bcaef[_0x6e2c('0x3f')]=_0x1bcaef[_0x6e2c('0x3f')][_0x6e2c('0x40')]?_0x1bcaef[_0x6e2c('0x3f')]:_0x2e06a7[_0x6e2c('0x39')];_0x1bcaef['order']=qs[_0x6e2c('0x44')](_0x626c29[_0x6e2c('0x3b')][_0x6e2c('0x44')]);_0x1bcaef['where']=qs[_0x6e2c('0x3c')](_[_0x6e2c('0x46')](_0x626c29[_0x6e2c('0x3b')],_0x2e06a7[_0x6e2c('0x3c')]));if(_0x626c29[_0x6e2c('0x3b')]['filter']){_0x1bcaef[_0x6e2c('0x45')]=_[_0x6e2c('0x48')](_0x1bcaef[_0x6e2c('0x45')],{'$or':_[_0x6e2c('0x35')](_0x1bcaef[_0x6e2c('0x3f')],function(_0x3e4719){var _0x2b3995={};_0x2b3995[_0x3e4719]={'$like':'%'+_0x626c29['query']['filter']+'%'};return _0x2b3995;})});}_0x1bcaef=_[_0x6e2c('0x48')]({},_0x1bcaef,_0x626c29[_0x6e2c('0x4a')]);return _0xe9f1db[_0x6e2c('0x57')](_0x1bcaef);}})['then'](function(_0x7e65a7){if(_0x7e65a7){_0x59b52d=_0x7e65a7['length'];if(!_0x626c29['query'][_0x6e2c('0x5a')](_0x6e2c('0x41'))){_0x1bcaef[_0x6e2c('0x42')]=qs['limit'](_0x626c29[_0x6e2c('0x3b')][_0x6e2c('0x42')]);_0x1bcaef[_0x6e2c('0x2d')]=qs[_0x6e2c('0x2d')](_0x626c29['query'][_0x6e2c('0x2d')]);}return _0xe9f1db[_0x6e2c('0x57')](_0x1bcaef);}})[_0x6e2c('0x1d')](function(_0xbd3439){if(_0xbd3439){return _0xbd3439?{'count':_0x59b52d,'rows':_0xbd3439}:null;}})[_0x6e2c('0x1d')](respondWithResult(_0x50e90a,null))[_0x6e2c('0x28')](handleError(_0x50e90a,null));};exports[_0x6e2c('0x5b')]=function(_0x1fcbc9,_0x44994b,_0x54b3d2){var _0x131408={};var _0x301f14={};var _0x53d7f5;var _0x44403b;return db['ZendeskConfiguration'][_0x6e2c('0x58')]({'where':{'id':_0x1fcbc9['params']['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x44994b,null))['then'](function(_0x2a5aff){if(_0x2a5aff){_0x53d7f5=_0x2a5aff;_0x301f14['model']=_[_0x6e2c('0x3a')](db[_0x6e2c('0x59')][_0x6e2c('0x51')]);_0x301f14['query']=_['keys'](_0x1fcbc9[_0x6e2c('0x3b')]);_0x301f14[_0x6e2c('0x3c')]=_[_0x6e2c('0x3d')](_0x301f14[_0x6e2c('0x39')],_0x301f14[_0x6e2c('0x3b')]);_0x131408[_0x6e2c('0x3f')]=_[_0x6e2c('0x3d')](_0x301f14['model'],qs['fields'](_0x1fcbc9['query'][_0x6e2c('0x3e')]));_0x131408[_0x6e2c('0x3f')]=_0x131408[_0x6e2c('0x3f')][_0x6e2c('0x40')]?_0x131408[_0x6e2c('0x3f')]:_0x301f14[_0x6e2c('0x39')];_0x131408['order']=qs['sort'](_0x1fcbc9[_0x6e2c('0x3b')][_0x6e2c('0x44')]);_0x131408[_0x6e2c('0x45')]=qs[_0x6e2c('0x3c')](_[_0x6e2c('0x46')](_0x1fcbc9[_0x6e2c('0x3b')],_0x301f14[_0x6e2c('0x3c')]));if(_0x1fcbc9[_0x6e2c('0x3b')][_0x6e2c('0x47')]){_0x131408[_0x6e2c('0x45')]=_[_0x6e2c('0x48')](_0x131408['where'],{'$or':_[_0x6e2c('0x35')](_0x131408['attributes'],function(_0x1670c9){var _0x1ea2ff={};_0x1ea2ff[_0x1670c9]={'$like':'%'+_0x1fcbc9['query'][_0x6e2c('0x47')]+'%'};return _0x1ea2ff;})});}_0x131408=_[_0x6e2c('0x48')]({},_0x131408,_0x1fcbc9['options']);return _0x53d7f5[_0x6e2c('0x5b')](_0x131408);}})[_0x6e2c('0x1d')](function(_0x196360){if(_0x196360){_0x44403b=_0x196360[_0x6e2c('0x40')];if(!_0x1fcbc9[_0x6e2c('0x3b')][_0x6e2c('0x5a')](_0x6e2c('0x41'))){_0x131408['limit']=qs[_0x6e2c('0x42')](_0x1fcbc9[_0x6e2c('0x3b')][_0x6e2c('0x42')]);_0x131408[_0x6e2c('0x2d')]=qs[_0x6e2c('0x2d')](_0x1fcbc9[_0x6e2c('0x3b')][_0x6e2c('0x2d')]);}return _0x53d7f5[_0x6e2c('0x5b')](_0x131408);}})[_0x6e2c('0x1d')](function(_0x5daeb1){if(_0x5daeb1){return _0x5daeb1?{'count':_0x44403b,'rows':_0x5daeb1}:null;}})['then'](respondWithResult(_0x44994b,null))[_0x6e2c('0x28')](handleError(_0x44994b,null));};exports[_0x6e2c('0x5c')]=function(_0x3b6158,_0x45a949,_0x5dc752){var _0x160762={};var _0x3c3592={};var _0x47912c;var _0x220175;return db['ZendeskConfiguration'][_0x6e2c('0x58')]({'where':{'id':_0x3b6158['params']['id']}})['then'](handleEntityNotFound(_0x45a949,null))[_0x6e2c('0x1d')](function(_0x502c94){if(_0x502c94){_0x47912c=_0x502c94;_0x3c3592['model']=_[_0x6e2c('0x3a')](db[_0x6e2c('0x59')][_0x6e2c('0x51')]);_0x3c3592[_0x6e2c('0x3b')]=_[_0x6e2c('0x3a')](_0x3b6158[_0x6e2c('0x3b')]);_0x3c3592[_0x6e2c('0x3c')]=_[_0x6e2c('0x3d')](_0x3c3592[_0x6e2c('0x39')],_0x3c3592[_0x6e2c('0x3b')]);_0x160762[_0x6e2c('0x3f')]=_[_0x6e2c('0x3d')](_0x3c3592[_0x6e2c('0x39')],qs[_0x6e2c('0x3e')](_0x3b6158[_0x6e2c('0x3b')][_0x6e2c('0x3e')]));_0x160762[_0x6e2c('0x3f')]=_0x160762[_0x6e2c('0x3f')][_0x6e2c('0x40')]?_0x160762[_0x6e2c('0x3f')]:_0x3c3592[_0x6e2c('0x39')];_0x160762['order']=qs['sort'](_0x3b6158[_0x6e2c('0x3b')][_0x6e2c('0x44')]);_0x160762['where']=qs[_0x6e2c('0x3c')](_[_0x6e2c('0x46')](_0x3b6158[_0x6e2c('0x3b')],_0x3c3592[_0x6e2c('0x3c')]));if(_0x3b6158['query']['filter']){_0x160762[_0x6e2c('0x45')]=_[_0x6e2c('0x48')](_0x160762[_0x6e2c('0x45')],{'$or':_['map'](_0x160762[_0x6e2c('0x3f')],function(_0x405df3){var _0x1c1b14={};_0x1c1b14[_0x405df3]={'$like':'%'+_0x3b6158[_0x6e2c('0x3b')][_0x6e2c('0x47')]+'%'};return _0x1c1b14;})});}_0x160762=_[_0x6e2c('0x48')]({},_0x160762,_0x3b6158[_0x6e2c('0x4a')]);return _0x47912c[_0x6e2c('0x5c')](_0x160762);}})[_0x6e2c('0x1d')](function(_0x108e1c){if(_0x108e1c){_0x220175=_0x108e1c['length'];if(!_0x3b6158[_0x6e2c('0x3b')]['hasOwnProperty'](_0x6e2c('0x41'))){_0x160762[_0x6e2c('0x42')]=qs[_0x6e2c('0x42')](_0x3b6158[_0x6e2c('0x3b')]['limit']);_0x160762[_0x6e2c('0x2d')]=qs['offset'](_0x3b6158[_0x6e2c('0x3b')][_0x6e2c('0x2d')]);}return _0x47912c['getDescriptions'](_0x160762);}})[_0x6e2c('0x1d')](function(_0x43a1b0){if(_0x43a1b0){return _0x43a1b0?{'count':_0x220175,'rows':_0x43a1b0}:null;}})[_0x6e2c('0x1d')](respondWithResult(_0x45a949,null))[_0x6e2c('0x28')](handleError(_0x45a949,null));};exports[_0x6e2c('0x5d')]=function(_0x2d937f,_0x54ce71,_0x2f5e0f){var _0x120e2c={};var _0x564153={};var _0x5c7872;var _0x8887b5;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2d937f[_0x6e2c('0x55')]['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x54ce71,null))['then'](function(_0x43594e){if(_0x43594e){_0x5c7872=_0x43594e;_0x564153[_0x6e2c('0x39')]=_[_0x6e2c('0x3a')](db[_0x6e2c('0x5e')]['rawAttributes']);_0x564153[_0x6e2c('0x3b')]=_[_0x6e2c('0x3a')](_0x2d937f['query']);_0x564153[_0x6e2c('0x3c')]=_['intersection'](_0x564153[_0x6e2c('0x39')],_0x564153[_0x6e2c('0x3b')]);_0x120e2c[_0x6e2c('0x3f')]=_[_0x6e2c('0x3d')](_0x564153[_0x6e2c('0x39')],qs[_0x6e2c('0x3e')](_0x2d937f[_0x6e2c('0x3b')][_0x6e2c('0x3e')]));_0x120e2c[_0x6e2c('0x3f')]=_0x120e2c['attributes'][_0x6e2c('0x40')]?_0x120e2c[_0x6e2c('0x3f')]:_0x564153[_0x6e2c('0x39')];_0x120e2c[_0x6e2c('0x43')]=qs[_0x6e2c('0x44')](_0x2d937f['query'][_0x6e2c('0x44')]);_0x120e2c[_0x6e2c('0x45')]=qs[_0x6e2c('0x3c')](_[_0x6e2c('0x46')](_0x2d937f[_0x6e2c('0x3b')],_0x564153[_0x6e2c('0x3c')]));if(_0x2d937f[_0x6e2c('0x3b')][_0x6e2c('0x47')]){_0x120e2c[_0x6e2c('0x45')]=_[_0x6e2c('0x48')](_0x120e2c['where'],{'$or':_[_0x6e2c('0x35')](_0x120e2c[_0x6e2c('0x3f')],function(_0x7cf4bd){var _0x2e1b7c={};_0x2e1b7c[_0x7cf4bd]={'$like':'%'+_0x2d937f[_0x6e2c('0x3b')]['filter']+'%'};return _0x2e1b7c;})});}_0x120e2c=_[_0x6e2c('0x48')]({},_0x120e2c,_0x2d937f['options']);return _0x5c7872[_0x6e2c('0x5d')](_0x120e2c);}})['then'](function(_0xcfc4ef){if(_0xcfc4ef){_0x8887b5=_0xcfc4ef[_0x6e2c('0x40')];if(!_0x2d937f[_0x6e2c('0x3b')][_0x6e2c('0x5a')](_0x6e2c('0x41'))){_0x120e2c[_0x6e2c('0x42')]=qs[_0x6e2c('0x42')](_0x2d937f[_0x6e2c('0x3b')][_0x6e2c('0x42')]);_0x120e2c['offset']=qs[_0x6e2c('0x2d')](_0x2d937f[_0x6e2c('0x3b')][_0x6e2c('0x2d')]);}return _0x5c7872[_0x6e2c('0x5d')](_0x120e2c);}})[_0x6e2c('0x1d')](function(_0x1c8fa7){if(_0x1c8fa7){return _0x1c8fa7?{'count':_0x8887b5,'rows':_0x1c8fa7}:null;}})[_0x6e2c('0x1d')](respondWithResult(_0x54ce71,null))[_0x6e2c('0x28')](handleError(_0x54ce71,null));};exports[_0x6e2c('0x5f')]=function(_0x249217,_0x25af33,_0xccbf4e){if(_0x249217[_0x6e2c('0x54')]['id']){delete _0x249217['body']['id'];}return db[_0x6e2c('0x4b')][_0x6e2c('0x58')]({'where':{'id':_0x249217[_0x6e2c('0x55')]['id']}})[_0x6e2c('0x1d')](handleEntityNotFound(_0x25af33,null))[_0x6e2c('0x1d')](function(_0xaf4159){if(_0xaf4159){return _0xaf4159['setTags'](_0x249217[_0x6e2c('0x54')]['ids']||[]);}return null;})[_0x6e2c('0x1d')](respondWithResult(_0x25af33,null))[_0x6e2c('0x28')](handleError(_0x25af33,null));}; \ No newline at end of file +var _0x4f02=['crypto','jsforce','desk.js','papaparse','../../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','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','includeAll','find','create','body','params','getFields','findOne','ZendeskField','fields','sort','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x1e250b,_0x2320e3){var _0x35928d=function(_0x1adcbb){while(--_0x1adcbb){_0x1e250b['push'](_0x1e250b['shift']());}};_0x35928d(++_0x2320e3);}(_0x4f02,0x173));var _0x24f0=function(_0x165ba3,_0x312607){_0x165ba3=_0x165ba3-0x0;var _0x22f74d=_0x4f02[_0x165ba3];return _0x22f74d;};'use strict';var pdf=require(_0x24f0('0x0'));var emlformat=require(_0x24f0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x24f0('0x2'));var jsonpatch=require(_0x24f0('0x3'));var rp=require('request-promise');var moment=require(_0x24f0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24f0('0x5'));var util=require(_0x24f0('0x6'));var path=require(_0x24f0('0x7'));var sox=require(_0x24f0('0x8'));var csv=require(_0x24f0('0x9'));var ejs=require(_0x24f0('0xa'));var fs=require('fs');var _=require(_0x24f0('0xb'));var squel=require(_0x24f0('0xc'));var crypto=require(_0x24f0('0xd'));var jsforce=require(_0x24f0('0xe'));var deskjs=require(_0x24f0('0xf'));var toCsv=require(_0x24f0('0x9'));var querystring=require('querystring');var Papa=require(_0x24f0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24f0('0x11'));var logger=require(_0x24f0('0x12'))('api');var utils=require(_0x24f0('0x13'));var config=require('../../config/environment');var db=require(_0x24f0('0x14'))['db'];var jayson=require(_0x24f0('0x15'));var client=jayson[_0x24f0('0x16')][_0x24f0('0x17')]({'port':0x232a});function checkPasswordPattern(_0x494426,_0x2b5644,_0x3560e4){if(_0x3560e4){var _0x1f6556=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f6556[_0x24f0('0x18')](_0x2b5644)){return _0x494426;}else{throw new db[(_0x24f0('0x19'))][(_0x24f0('0x1a'))](_0x24f0('0x1b'));}}else{return _0x494426;}}function respondWithRpcPromise(_0x47eedc,_0x366422,_0x485943,_0x4c0001){return new BPromise(function(_0x2bc9f5,_0x3a0878){var _0x1fb4f9=_0x4c0001||client;return _0x1fb4f9[_0x24f0('0x1c')](_0x47eedc,_0x485943)[_0x24f0('0x1d')](function(_0x21bc54){logger[_0x24f0('0x1e')](_0x24f0('0x1f'),_0x366422,_0x24f0('0x20'));logger[_0x24f0('0x21')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x366422,'request\x20sent',JSON[_0x24f0('0x22')](_0x21bc54));if(_0x21bc54[_0x24f0('0x23')]){if(_0x21bc54[_0x24f0('0x23')][_0x24f0('0x24')]===0x1f4){logger[_0x24f0('0x23')](_0x24f0('0x1f'),_0x366422,_0x21bc54['error']['message']);return _0x3a0878(_0x21bc54['error'][_0x24f0('0x25')]);}logger[_0x24f0('0x23')](_0x24f0('0x1f'),_0x366422,_0x21bc54['error'][_0x24f0('0x25')]);return _0x2bc9f5(_0x21bc54[_0x24f0('0x23')]['message']);}else{logger['info'](_0x24f0('0x1f'),_0x366422,_0x24f0('0x20'));_0x2bc9f5(_0x21bc54[_0x24f0('0x26')][_0x24f0('0x25')]);}})[_0x24f0('0x27')](function(_0x4110de){logger[_0x24f0('0x23')](_0x24f0('0x1f'),_0x366422,_0x4110de);_0x3a0878(_0x4110de);});});}function respondWithStatusCode(_0x5ca0e7,_0x1282e9){_0x1282e9=_0x1282e9||0xcc;return function(_0x44261a){if(_0x44261a){return _0x5ca0e7[_0x24f0('0x28')](_0x1282e9);}return _0x5ca0e7[_0x24f0('0x29')](_0x1282e9)[_0x24f0('0x2a')]();};}function respondWithResult(_0x337f64,_0x59e740){_0x59e740=_0x59e740||0xc8;return function(_0x3a1d85){if(_0x3a1d85){return _0x337f64[_0x24f0('0x29')](_0x59e740)[_0x24f0('0x2b')](_0x3a1d85);}};}function respondWithFilteredResult(_0x43ac03,_0x15dff9){return function(_0x14b37c){if(_0x14b37c){var _0x2ab44e=_0x14b37c[_0x24f0('0x2c')],_0x45e20b=_0x15dff9['offset'],_0x2fca53=_0x15dff9['offset']+_0x15dff9[_0x24f0('0x2d')],_0x171dd3;if(_0x2fca53>=_0x2ab44e){_0x2fca53=_0x2ab44e;_0x171dd3=0xc8;}else{_0x171dd3=0xce;}_0x43ac03[_0x24f0('0x29')](_0x171dd3);return _0x43ac03[_0x24f0('0x2e')](_0x24f0('0x2f'),_0x45e20b+'-'+_0x2fca53+'/'+_0x2ab44e)['json'](_0x14b37c);}return null;};}function patchUpdates(_0x5a78e0){return function(_0x4af8a9){try{jsonpatch[_0x24f0('0x30')](_0x4af8a9,_0x5a78e0,!![]);}catch(_0x246ed4){return BPromise[_0x24f0('0x31')](_0x246ed4);}return _0x4af8a9['save']();};}function saveUpdates(_0x386fca,_0x34c72e){return function(_0x5ecd56){if(_0x5ecd56){return _0x5ecd56[_0x24f0('0x32')](_0x386fca)['then'](function(_0x5dfcfd){return _0x5dfcfd;});}return null;};}function removeEntity(_0x30dc62,_0x2f78ec){return function(_0x459ad0){if(_0x459ad0){return _0x459ad0[_0x24f0('0x33')]()[_0x24f0('0x1d')](function(){_0x30dc62[_0x24f0('0x29')](0xcc)[_0x24f0('0x2a')]();});}};}function handleEntityNotFound(_0x5d77e0,_0x3d04c5){return function(_0x295bf2){if(!_0x295bf2){_0x5d77e0[_0x24f0('0x28')](0x194);}return _0x295bf2;};}function handleError(_0x44cc32,_0x1192ac){_0x1192ac=_0x1192ac||0x1f4;return function(_0x3e18a1){logger[_0x24f0('0x23')](_0x3e18a1[_0x24f0('0x34')]);if(_0x3e18a1[_0x24f0('0x35')]){delete _0x3e18a1[_0x24f0('0x35')];}_0x44cc32[_0x24f0('0x29')](_0x1192ac)[_0x24f0('0x36')](_0x3e18a1);};}exports[_0x24f0('0x37')]=function(_0x324c23,_0x43d746){var _0x1459f5={},_0x4fbaaf={},_0x5cd3f8={'count':0x0,'rows':[]};var _0x373c48=_[_0x24f0('0x38')](db[_0x24f0('0x39')][_0x24f0('0x3a')],function(_0x46715f){return{'name':_0x46715f['fieldName'],'type':_0x46715f[_0x24f0('0x3b')]['key']};});_0x4fbaaf['model']=_[_0x24f0('0x38')](_0x373c48,_0x24f0('0x35'));_0x4fbaaf[_0x24f0('0x3c')]=_[_0x24f0('0x3d')](_0x324c23[_0x24f0('0x3c')]);_0x4fbaaf['filters']=_[_0x24f0('0x3e')](_0x4fbaaf[_0x24f0('0x3f')],_0x4fbaaf['query']);_0x1459f5[_0x24f0('0x40')]=_[_0x24f0('0x3e')](_0x4fbaaf[_0x24f0('0x3f')],qs['fields'](_0x324c23[_0x24f0('0x3c')]['fields']));_0x1459f5['attributes']=_0x1459f5[_0x24f0('0x40')][_0x24f0('0x41')]?_0x1459f5[_0x24f0('0x40')]:_0x4fbaaf[_0x24f0('0x3f')];if(!_0x324c23[_0x24f0('0x3c')][_0x24f0('0x42')](_0x24f0('0x43'))){_0x1459f5[_0x24f0('0x2d')]=qs[_0x24f0('0x2d')](_0x324c23['query']['limit']);_0x1459f5[_0x24f0('0x44')]=qs[_0x24f0('0x44')](_0x324c23[_0x24f0('0x3c')]['offset']);}_0x1459f5[_0x24f0('0x45')]=qs['sort'](_0x324c23['query']['sort']);_0x1459f5[_0x24f0('0x46')]=qs[_0x24f0('0x47')](_[_0x24f0('0x48')](_0x324c23[_0x24f0('0x3c')],_0x4fbaaf[_0x24f0('0x47')]),_0x373c48);if(_0x324c23[_0x24f0('0x3c')][_0x24f0('0x49')]){_0x1459f5[_0x24f0('0x46')]=_[_0x24f0('0x4a')](_0x1459f5['where'],{'$or':_[_0x24f0('0x38')](_0x373c48,function(_0x421e97){if(_0x421e97[_0x24f0('0x3b')]!==_0x24f0('0x4b')){var _0xe8fc68={};_0xe8fc68[_0x421e97[_0x24f0('0x35')]]={'$like':'%'+_0x324c23[_0x24f0('0x3c')][_0x24f0('0x49')]+'%'};return _0xe8fc68;}})});}_0x1459f5=_[_0x24f0('0x4a')]({},_0x1459f5,_0x324c23[_0x24f0('0x4c')]);var _0x54ee7f={'where':_0x1459f5[_0x24f0('0x46')]};return db[_0x24f0('0x39')][_0x24f0('0x2c')](_0x54ee7f)['then'](function(_0x557b15){_0x5cd3f8['count']=_0x557b15;if(_0x324c23['query']['includeAll']){_0x1459f5[_0x24f0('0x4d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x24f0('0x4e')](_0x1459f5);})[_0x24f0('0x1d')](function(_0x38aace){_0x5cd3f8[_0x24f0('0x4f')]=_0x38aace;return _0x5cd3f8;})[_0x24f0('0x1d')](respondWithFilteredResult(_0x43d746,_0x1459f5))[_0x24f0('0x27')](handleError(_0x43d746,null));};exports['show']=function(_0x246cd1,_0x5b5e10){var _0x21c333={'raw':![],'where':{'id':_0x246cd1['params']['id']}},_0x236265={};_0x236265[_0x24f0('0x3f')]=_[_0x24f0('0x3d')](db[_0x24f0('0x39')][_0x24f0('0x3a')]);_0x236265[_0x24f0('0x3c')]=_[_0x24f0('0x3d')](_0x246cd1[_0x24f0('0x3c')]);_0x236265['filters']=_[_0x24f0('0x3e')](_0x236265[_0x24f0('0x3f')],_0x236265[_0x24f0('0x3c')]);_0x21c333[_0x24f0('0x40')]=_[_0x24f0('0x3e')](_0x236265[_0x24f0('0x3f')],qs['fields'](_0x246cd1[_0x24f0('0x3c')]['fields']));_0x21c333[_0x24f0('0x40')]=_0x21c333[_0x24f0('0x40')][_0x24f0('0x41')]?_0x21c333[_0x24f0('0x40')]:_0x236265[_0x24f0('0x3f')];if(_0x246cd1['query'][_0x24f0('0x50')]){_0x21c333['include']=[{'all':!![]}];}_0x21c333=_[_0x24f0('0x4a')]({},_0x21c333,_0x246cd1[_0x24f0('0x4c')]);return db[_0x24f0('0x39')][_0x24f0('0x51')](_0x21c333)['then'](handleEntityNotFound(_0x5b5e10,null))[_0x24f0('0x1d')](respondWithResult(_0x5b5e10,null))[_0x24f0('0x27')](handleError(_0x5b5e10,null));};exports[_0x24f0('0x52')]=function(_0x19da8f,_0x5bc12d){return db[_0x24f0('0x39')][_0x24f0('0x52')](_0x19da8f['body'],{})[_0x24f0('0x1d')](respondWithResult(_0x5bc12d,0xc9))[_0x24f0('0x27')](handleError(_0x5bc12d,null));};exports['update']=function(_0x1bcc49,_0x3c0a87){if(_0x1bcc49[_0x24f0('0x53')]['id']){delete _0x1bcc49[_0x24f0('0x53')]['id'];}return db[_0x24f0('0x39')][_0x24f0('0x51')]({'where':{'id':_0x1bcc49[_0x24f0('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c0a87,null))[_0x24f0('0x1d')](saveUpdates(_0x1bcc49[_0x24f0('0x53')],null))[_0x24f0('0x1d')](respondWithResult(_0x3c0a87,null))[_0x24f0('0x27')](handleError(_0x3c0a87,null));};exports[_0x24f0('0x33')]=function(_0x2a28d8,_0x45884c){return db[_0x24f0('0x39')][_0x24f0('0x51')]({'where':{'id':_0x2a28d8['params']['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x45884c,null))[_0x24f0('0x1d')](removeEntity(_0x45884c,null))['catch'](handleError(_0x45884c,null));};exports[_0x24f0('0x55')]=function(_0x305501,_0x18c30a,_0x109d51){var _0x6deabe={};var _0x165901={};var _0x20a1fe;var _0x48dac4;return db['ZendeskConfiguration'][_0x24f0('0x56')]({'where':{'id':_0x305501[_0x24f0('0x54')]['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x18c30a,null))[_0x24f0('0x1d')](function(_0x99670e){if(_0x99670e){_0x20a1fe=_0x99670e;_0x165901['model']=_['keys'](db[_0x24f0('0x57')]['rawAttributes']);_0x165901[_0x24f0('0x3c')]=_[_0x24f0('0x3d')](_0x305501[_0x24f0('0x3c')]);_0x165901['filters']=_[_0x24f0('0x3e')](_0x165901[_0x24f0('0x3f')],_0x165901[_0x24f0('0x3c')]);_0x6deabe[_0x24f0('0x40')]=_[_0x24f0('0x3e')](_0x165901[_0x24f0('0x3f')],qs['fields'](_0x305501[_0x24f0('0x3c')][_0x24f0('0x58')]));_0x6deabe['attributes']=_0x6deabe[_0x24f0('0x40')][_0x24f0('0x41')]?_0x6deabe[_0x24f0('0x40')]:_0x165901[_0x24f0('0x3f')];_0x6deabe['order']=qs['sort'](_0x305501['query'][_0x24f0('0x59')]);_0x6deabe[_0x24f0('0x46')]=qs[_0x24f0('0x47')](_[_0x24f0('0x48')](_0x305501['query'],_0x165901['filters']));if(_0x305501[_0x24f0('0x3c')][_0x24f0('0x49')]){_0x6deabe['where']=_['merge'](_0x6deabe[_0x24f0('0x46')],{'$or':_[_0x24f0('0x38')](_0x6deabe[_0x24f0('0x40')],function(_0x2e7fda){var _0x3db0c9={};_0x3db0c9[_0x2e7fda]={'$like':'%'+_0x305501[_0x24f0('0x3c')]['filter']+'%'};return _0x3db0c9;})});}_0x6deabe=_[_0x24f0('0x4a')]({},_0x6deabe,_0x305501[_0x24f0('0x4c')]);return _0x20a1fe[_0x24f0('0x55')](_0x6deabe);}})[_0x24f0('0x1d')](function(_0x29555e){if(_0x29555e){_0x48dac4=_0x29555e['length'];if(!_0x305501['query'][_0x24f0('0x42')](_0x24f0('0x43'))){_0x6deabe[_0x24f0('0x2d')]=qs[_0x24f0('0x2d')](_0x305501[_0x24f0('0x3c')][_0x24f0('0x2d')]);_0x6deabe[_0x24f0('0x44')]=qs[_0x24f0('0x44')](_0x305501[_0x24f0('0x3c')]['offset']);}return _0x20a1fe[_0x24f0('0x55')](_0x6deabe);}})[_0x24f0('0x1d')](function(_0x20ea5c){if(_0x20ea5c){return _0x20ea5c?{'count':_0x48dac4,'rows':_0x20ea5c}:null;}})['then'](respondWithResult(_0x18c30a,null))[_0x24f0('0x27')](handleError(_0x18c30a,null));};exports['getSubjects']=function(_0x1b90f5,_0x219ad0,_0x592ecb){var _0x580d96={};var _0x55c403={};var _0x21a485;var _0x396dd4;return db[_0x24f0('0x39')][_0x24f0('0x56')]({'where':{'id':_0x1b90f5[_0x24f0('0x54')]['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x219ad0,null))[_0x24f0('0x1d')](function(_0x3fe6b0){if(_0x3fe6b0){_0x21a485=_0x3fe6b0;_0x55c403[_0x24f0('0x3f')]=_[_0x24f0('0x3d')](db[_0x24f0('0x57')][_0x24f0('0x3a')]);_0x55c403['query']=_[_0x24f0('0x3d')](_0x1b90f5[_0x24f0('0x3c')]);_0x55c403[_0x24f0('0x47')]=_[_0x24f0('0x3e')](_0x55c403[_0x24f0('0x3f')],_0x55c403[_0x24f0('0x3c')]);_0x580d96['attributes']=_[_0x24f0('0x3e')](_0x55c403['model'],qs[_0x24f0('0x58')](_0x1b90f5[_0x24f0('0x3c')]['fields']));_0x580d96[_0x24f0('0x40')]=_0x580d96[_0x24f0('0x40')][_0x24f0('0x41')]?_0x580d96[_0x24f0('0x40')]:_0x55c403[_0x24f0('0x3f')];_0x580d96['order']=qs['sort'](_0x1b90f5['query'][_0x24f0('0x59')]);_0x580d96[_0x24f0('0x46')]=qs[_0x24f0('0x47')](_['pick'](_0x1b90f5['query'],_0x55c403['filters']));if(_0x1b90f5[_0x24f0('0x3c')][_0x24f0('0x49')]){_0x580d96['where']=_['merge'](_0x580d96[_0x24f0('0x46')],{'$or':_[_0x24f0('0x38')](_0x580d96[_0x24f0('0x40')],function(_0x3cd8de){var _0x512560={};_0x512560[_0x3cd8de]={'$like':'%'+_0x1b90f5['query']['filter']+'%'};return _0x512560;})});}_0x580d96=_[_0x24f0('0x4a')]({},_0x580d96,_0x1b90f5['options']);return _0x21a485[_0x24f0('0x5a')](_0x580d96);}})[_0x24f0('0x1d')](function(_0x2ccbda){if(_0x2ccbda){_0x396dd4=_0x2ccbda[_0x24f0('0x41')];if(!_0x1b90f5[_0x24f0('0x3c')][_0x24f0('0x42')](_0x24f0('0x43'))){_0x580d96[_0x24f0('0x2d')]=qs[_0x24f0('0x2d')](_0x1b90f5['query'][_0x24f0('0x2d')]);_0x580d96[_0x24f0('0x44')]=qs[_0x24f0('0x44')](_0x1b90f5[_0x24f0('0x3c')][_0x24f0('0x44')]);}return _0x21a485[_0x24f0('0x5a')](_0x580d96);}})[_0x24f0('0x1d')](function(_0x13da1f){if(_0x13da1f){return _0x13da1f?{'count':_0x396dd4,'rows':_0x13da1f}:null;}})[_0x24f0('0x1d')](respondWithResult(_0x219ad0,null))[_0x24f0('0x27')](handleError(_0x219ad0,null));};exports[_0x24f0('0x5b')]=function(_0x58f0d2,_0x4e1025,_0x57b7c6){var _0x4e2a0a={};var _0x40f2e6={};var _0x32a304;var _0x48e228;return db[_0x24f0('0x39')]['findOne']({'where':{'id':_0x58f0d2[_0x24f0('0x54')]['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x4e1025,null))['then'](function(_0x3d397b){if(_0x3d397b){_0x32a304=_0x3d397b;_0x40f2e6[_0x24f0('0x3f')]=_['keys'](db['ZendeskField'][_0x24f0('0x3a')]);_0x40f2e6[_0x24f0('0x3c')]=_[_0x24f0('0x3d')](_0x58f0d2[_0x24f0('0x3c')]);_0x40f2e6[_0x24f0('0x47')]=_[_0x24f0('0x3e')](_0x40f2e6[_0x24f0('0x3f')],_0x40f2e6[_0x24f0('0x3c')]);_0x4e2a0a[_0x24f0('0x40')]=_[_0x24f0('0x3e')](_0x40f2e6['model'],qs[_0x24f0('0x58')](_0x58f0d2[_0x24f0('0x3c')][_0x24f0('0x58')]));_0x4e2a0a['attributes']=_0x4e2a0a['attributes'][_0x24f0('0x41')]?_0x4e2a0a[_0x24f0('0x40')]:_0x40f2e6[_0x24f0('0x3f')];_0x4e2a0a['order']=qs['sort'](_0x58f0d2[_0x24f0('0x3c')][_0x24f0('0x59')]);_0x4e2a0a[_0x24f0('0x46')]=qs['filters'](_[_0x24f0('0x48')](_0x58f0d2[_0x24f0('0x3c')],_0x40f2e6[_0x24f0('0x47')]));if(_0x58f0d2['query'][_0x24f0('0x49')]){_0x4e2a0a[_0x24f0('0x46')]=_[_0x24f0('0x4a')](_0x4e2a0a[_0x24f0('0x46')],{'$or':_[_0x24f0('0x38')](_0x4e2a0a['attributes'],function(_0x4d82af){var _0x457034={};_0x457034[_0x4d82af]={'$like':'%'+_0x58f0d2['query'][_0x24f0('0x49')]+'%'};return _0x457034;})});}_0x4e2a0a=_[_0x24f0('0x4a')]({},_0x4e2a0a,_0x58f0d2[_0x24f0('0x4c')]);return _0x32a304[_0x24f0('0x5b')](_0x4e2a0a);}})[_0x24f0('0x1d')](function(_0x690355){if(_0x690355){_0x48e228=_0x690355[_0x24f0('0x41')];if(!_0x58f0d2[_0x24f0('0x3c')][_0x24f0('0x42')](_0x24f0('0x43'))){_0x4e2a0a[_0x24f0('0x2d')]=qs[_0x24f0('0x2d')](_0x58f0d2[_0x24f0('0x3c')][_0x24f0('0x2d')]);_0x4e2a0a[_0x24f0('0x44')]=qs[_0x24f0('0x44')](_0x58f0d2[_0x24f0('0x3c')]['offset']);}return _0x32a304[_0x24f0('0x5b')](_0x4e2a0a);}})['then'](function(_0x216333){if(_0x216333){return _0x216333?{'count':_0x48e228,'rows':_0x216333}:null;}})[_0x24f0('0x1d')](respondWithResult(_0x4e1025,null))['catch'](handleError(_0x4e1025,null));};exports[_0x24f0('0x5c')]=function(_0x91ae68,_0x4a274e,_0x218b7c){var _0x330e2f={};var _0x3f0d67={};var _0x1556f3;var _0x5247d0;return db[_0x24f0('0x39')]['findOne']({'where':{'id':_0x91ae68['params']['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x4a274e,null))[_0x24f0('0x1d')](function(_0x3d0ca3){if(_0x3d0ca3){_0x1556f3=_0x3d0ca3;_0x3f0d67[_0x24f0('0x3f')]=_['keys'](db[_0x24f0('0x5d')][_0x24f0('0x3a')]);_0x3f0d67['query']=_[_0x24f0('0x3d')](_0x91ae68['query']);_0x3f0d67[_0x24f0('0x47')]=_[_0x24f0('0x3e')](_0x3f0d67[_0x24f0('0x3f')],_0x3f0d67[_0x24f0('0x3c')]);_0x330e2f[_0x24f0('0x40')]=_['intersection'](_0x3f0d67[_0x24f0('0x3f')],qs[_0x24f0('0x58')](_0x91ae68[_0x24f0('0x3c')]['fields']));_0x330e2f[_0x24f0('0x40')]=_0x330e2f[_0x24f0('0x40')][_0x24f0('0x41')]?_0x330e2f[_0x24f0('0x40')]:_0x3f0d67[_0x24f0('0x3f')];_0x330e2f[_0x24f0('0x45')]=qs[_0x24f0('0x59')](_0x91ae68[_0x24f0('0x3c')][_0x24f0('0x59')]);_0x330e2f[_0x24f0('0x46')]=qs[_0x24f0('0x47')](_['pick'](_0x91ae68['query'],_0x3f0d67[_0x24f0('0x47')]));if(_0x91ae68['query']['filter']){_0x330e2f[_0x24f0('0x46')]=_[_0x24f0('0x4a')](_0x330e2f[_0x24f0('0x46')],{'$or':_[_0x24f0('0x38')](_0x330e2f[_0x24f0('0x40')],function(_0x2743a3){var _0x5481d0={};_0x5481d0[_0x2743a3]={'$like':'%'+_0x91ae68[_0x24f0('0x3c')][_0x24f0('0x49')]+'%'};return _0x5481d0;})});}_0x330e2f=_[_0x24f0('0x4a')]({},_0x330e2f,_0x91ae68[_0x24f0('0x4c')]);return _0x1556f3[_0x24f0('0x5c')](_0x330e2f);}})['then'](function(_0x39c6fa){if(_0x39c6fa){_0x5247d0=_0x39c6fa['length'];if(!_0x91ae68[_0x24f0('0x3c')][_0x24f0('0x42')](_0x24f0('0x43'))){_0x330e2f[_0x24f0('0x2d')]=qs[_0x24f0('0x2d')](_0x91ae68[_0x24f0('0x3c')][_0x24f0('0x2d')]);_0x330e2f[_0x24f0('0x44')]=qs[_0x24f0('0x44')](_0x91ae68[_0x24f0('0x3c')]['offset']);}return _0x1556f3[_0x24f0('0x5c')](_0x330e2f);}})[_0x24f0('0x1d')](function(_0x5798df){if(_0x5798df){return _0x5798df?{'count':_0x5247d0,'rows':_0x5798df}:null;}})[_0x24f0('0x1d')](respondWithResult(_0x4a274e,null))[_0x24f0('0x27')](handleError(_0x4a274e,null));};exports[_0x24f0('0x5e')]=function(_0xdc485,_0x41cd80,_0x46b169){if(_0xdc485[_0x24f0('0x53')]['id']){delete _0xdc485[_0x24f0('0x53')]['id'];}return db['ZendeskConfiguration'][_0x24f0('0x56')]({'where':{'id':_0xdc485[_0x24f0('0x54')]['id']}})[_0x24f0('0x1d')](handleEntityNotFound(_0x41cd80,null))[_0x24f0('0x1d')](function(_0x9dfda2){if(_0x9dfda2){return _0x9dfda2[_0x24f0('0x5e')](_0xdc485[_0x24f0('0x53')][_0x24f0('0x5f')]||[]);}return null;})[_0x24f0('0x1d')](respondWithResult(_0x41cd80,null))[_0x24f0('0x27')](handleError(_0x41cd80,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 25af3c4..6741a2f 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 _0x878c=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x4ab100,_0x5aa08c){var _0xf17f9=function(_0x278ba0){while(--_0x278ba0){_0x4ab100['push'](_0x4ab100['shift']());}};_0xf17f9(++_0x5aa08c);}(_0x878c,0x1a4));var _0xc878=function(_0x1c7ddb,_0x134bb6){_0x1c7ddb=_0x1c7ddb-0x0;var _0xcee80f=_0x878c[_0x1c7ddb];return _0xcee80f;};'use strict';var _=require(_0xc878('0x0'));var util=require(_0xc878('0x1'));var logger=require(_0xc878('0x2'))('api');var moment=require(_0xc878('0x3'));var BPromise=require(_0xc878('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc878('0x5'));var rimraf=require('rimraf');var config=require(_0xc878('0x6'));var attributes=require(_0xc878('0x7'));module[_0xc878('0x8')]=function(_0x53c78d,_0x22237c){return _0x53c78d[_0xc878('0x9')](_0xc878('0xa'),attributes,{'tableName':_0xc878('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7019=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x7019,0x194));var _0x9701=function(_0xd09418,_0x5aaa65){_0xd09418=_0xd09418-0x0;var _0x41db75=_0x7019[_0xd09418];return _0x41db75;};'use strict';var _=require(_0x9701('0x0'));var util=require(_0x9701('0x1'));var logger=require(_0x9701('0x2'))(_0x9701('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9701('0x4'));var fs=require('fs');var path=require(_0x9701('0x5'));var rimraf=require('rimraf');var config=require(_0x9701('0x6'));var attributes=require(_0x9701('0x7'));module[_0x9701('0x8')]=function(_0x52278d,_0x22d24a){return _0x52278d[_0x9701('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index abbf237..b515e12 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 _0xc15b=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc15b,0x130));var _0xbc15=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc15b[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbc15('0x1'));var rs=require(_0xbc15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc15('0x3'))['db'];var utils=require(_0xbc15('0x4'));var logger=require('../../config/logger')(_0xbc15('0x5'));var config=require(_0xbc15('0x6'));var jayson=require(_0xbc15('0x7'));var client=jayson['client'][_0xbc15('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46900d,_0x439b92,_0x939efc){return new BPromise(function(_0x202a57,_0x2961dd){return client['request'](_0x46900d,_0x939efc)['then'](function(_0x419188){logger['info'](_0xbc15('0x9'),_0x439b92,_0xbc15('0xa'));logger[_0xbc15('0xb')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x439b92,_0xbc15('0xa'),JSON[_0xbc15('0xc')](_0x419188));if(_0x419188[_0xbc15('0xd')]){if(_0x419188[_0xbc15('0xd')][_0xbc15('0xe')]===0x1f4){logger[_0xbc15('0xd')](_0xbc15('0x9'),_0x439b92,_0x419188['error'][_0xbc15('0xf')]);return _0x2961dd(_0x419188[_0xbc15('0xd')][_0xbc15('0xf')]);}logger['error'](_0xbc15('0x9'),_0x439b92,_0x419188['error'][_0xbc15('0xf')]);return _0x202a57(_0x419188[_0xbc15('0xd')][_0xbc15('0xf')]);}else{logger['info'](_0xbc15('0x9'),_0x439b92,_0xbc15('0xa'));_0x202a57(_0x419188['result'][_0xbc15('0xf')]);}})[_0xbc15('0x10')](function(_0x168bd7){logger[_0xbc15('0xd')](_0xbc15('0x9'),_0x439b92,_0x168bd7);_0x2961dd(_0x168bd7);});});} \ No newline at end of file +var _0xd9c7=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0xd9c7,0x103));var _0x7d9c=function(_0x2159dd,_0x2f894e){_0x2159dd=_0x2159dd-0x0;var _0x3c6274=_0xd9c7[_0x2159dd];return _0x3c6274;};'use strict';var _=require(_0x7d9c('0x0'));var util=require('util');var moment=require(_0x7d9c('0x1'));var BPromise=require(_0x7d9c('0x2'));var rs=require(_0x7d9c('0x3'));var fs=require('fs');var Redis=require(_0x7d9c('0x4'));var db=require(_0x7d9c('0x5'))['db'];var utils=require(_0x7d9c('0x6'));var logger=require('../../config/logger')(_0x7d9c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d9c('0x8')][_0x7d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379b82,_0x315401,_0x1e197f){return new BPromise(function(_0x966142,_0x45bc8d){return client[_0x7d9c('0xa')](_0x379b82,_0x1e197f)[_0x7d9c('0xb')](function(_0x2f5fe8){logger[_0x7d9c('0xc')](_0x7d9c('0xd'),_0x315401,_0x7d9c('0xe'));logger[_0x7d9c('0xf')](_0x7d9c('0x10'),_0x315401,_0x7d9c('0xe'),JSON[_0x7d9c('0x11')](_0x2f5fe8));if(_0x2f5fe8[_0x7d9c('0x12')]){if(_0x2f5fe8[_0x7d9c('0x12')][_0x7d9c('0x13')]===0x1f4){logger[_0x7d9c('0x12')](_0x7d9c('0xd'),_0x315401,_0x2f5fe8[_0x7d9c('0x12')][_0x7d9c('0x14')]);return _0x45bc8d(_0x2f5fe8[_0x7d9c('0x12')][_0x7d9c('0x14')]);}logger[_0x7d9c('0x12')](_0x7d9c('0xd'),_0x315401,_0x2f5fe8[_0x7d9c('0x12')][_0x7d9c('0x14')]);return _0x966142(_0x2f5fe8[_0x7d9c('0x12')]['message']);}else{logger['info'](_0x7d9c('0xd'),_0x315401,_0x7d9c('0xe'));_0x966142(_0x2f5fe8[_0x7d9c('0x15')][_0x7d9c('0x14')]);}})[_0x7d9c('0x16')](function(_0x5f028f){logger[_0x7d9c('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x315401,_0x5f028f);_0x45bc8d(_0x5f028f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 09a8e2a..5f603ac 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 _0x15be=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','post','isAuthenticated','create','put','/:id','update','delete','destroy'];(function(_0x1dd997,_0x578bf5){var _0x440e4b=function(_0x55f83d){while(--_0x55f83d){_0x1dd997['push'](_0x1dd997['shift']());}};_0x440e4b(++_0x578bf5);}(_0x15be,0x65));var _0xe15b=function(_0x3ff76e,_0x2fca0c){_0x3ff76e=_0x3ff76e-0x0;var _0x187d77=_0x15be[_0x3ff76e];return _0x187d77;};'use strict';var multer=require(_0xe15b('0x0'));var util=require(_0xe15b('0x1'));var path=require('path');var timeout=require(_0xe15b('0x2'));var express=require(_0xe15b('0x3'));var router=express[_0xe15b('0x4')]();var auth=require(_0xe15b('0x5'));var interaction=require(_0xe15b('0x6'));var config=require(_0xe15b('0x7'));var controller=require(_0xe15b('0x8'));router[_0xe15b('0x9')]('/',auth['isAuthenticated'](),controller[_0xe15b('0xa')]);router[_0xe15b('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe15b('0xb')]('/',auth[_0xe15b('0xc')](),controller[_0xe15b('0xd')]);router[_0xe15b('0xe')](_0xe15b('0xf'),auth[_0xe15b('0xc')](),controller[_0xe15b('0x10')]);router[_0xe15b('0x11')]('/:id',auth[_0xe15b('0xc')](),controller[_0xe15b('0x12')]);module[_0xe15b('0x13')]=router; \ No newline at end of file +var _0x11a0=['Router','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','connect-timeout'];(function(_0x22f2eb,_0xed5647){var _0xc0256d=function(_0x3c1d31){while(--_0x3c1d31){_0x22f2eb['push'](_0x22f2eb['shift']());}};_0xc0256d(++_0xed5647);}(_0x11a0,0x84));var _0x011a=function(_0x2e2e0d,_0xa2a795){_0x2e2e0d=_0x2e2e0d-0x0;var _0x1f3914=_0x11a0[_0x2e2e0d];return _0x1f3914;};'use strict';var multer=require(_0x011a('0x0'));var util=require('util');var path=require(_0x011a('0x1'));var timeout=require(_0x011a('0x2'));var express=require('express');var router=express[_0x011a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x011a('0x4'));var config=require('../../config/environment');var controller=require(_0x011a('0x5'));router[_0x011a('0x6')]('/',auth[_0x011a('0x7')](),controller[_0x011a('0x8')]);router[_0x011a('0x6')]('/:id',auth[_0x011a('0x7')](),controller[_0x011a('0x9')]);router[_0x011a('0xa')]('/',auth[_0x011a('0x7')](),controller['create']);router[_0x011a('0xb')](_0x011a('0xc'),auth[_0x011a('0x7')](),controller[_0x011a('0xd')]);router['delete'](_0x011a('0xc'),auth[_0x011a('0x7')](),controller['destroy']);module[_0x011a('0xe')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index c8e77d7..8d7e87b 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 _0x4f82=['STRING','ENUM','variable','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x4f82,0xbc));var _0x24f8=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x4f82[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0x24f8('0x0'));module[_0x24f8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x24f8('0x2'),'variable',_0x24f8('0x3'),'keyValue'),'defaultValue':_0x24f8('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x24f8('0x4')]},'keyType':{'type':Sequelize[_0x24f8('0x5')](_0x24f8('0x2'),_0x24f8('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x24f8('0x4')]},'idField':{'type':Sequelize[_0x24f8('0x4')]},'nameField':{'type':Sequelize[_0x24f8('0x4')]},'customField':{'type':Sequelize[_0x24f8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x24f8('0x4')]}}; \ No newline at end of file +var _0xe9b9=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x503da5,_0x36cdd8){var _0x227228=function(_0x404734){while(--_0x404734){_0x503da5['push'](_0x503da5['shift']());}};_0x227228(++_0x36cdd8);}(_0xe9b9,0xd4));var _0x9e9b=function(_0x2cac2e,_0x59d4c3){_0x2cac2e=_0x2cac2e-0x0;var _0x19ffe8=_0xe9b9[_0x2cac2e];return _0x19ffe8;};'use strict';var Sequelize=require(_0x9e9b('0x0'));module[_0x9e9b('0x1')]={'type':{'type':Sequelize[_0x9e9b('0x2')](_0x9e9b('0x3'),_0x9e9b('0x4'),_0x9e9b('0x5'),_0x9e9b('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9e9b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x9e9b('0x3'),_0x9e9b('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9e9b('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9e9b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e9b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 0cbc891..690e75d 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 _0x2477=['name','query','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','ZendeskField','find','create','body','destroy','html-pdf','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','error','send','index','map','rawAttributes','type'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x2477,0x138));var _0x7247=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x2477[_0x954b3a];return _0x3a313e;};'use strict';var pdf=require(_0x7247('0x0'));var emlformat=require(_0x7247('0x1'));var rimraf=require(_0x7247('0x2'));var zipdir=require(_0x7247('0x3'));var jsonpatch=require(_0x7247('0x4'));var rp=require(_0x7247('0x5'));var moment=require('moment');var BPromise=require(_0x7247('0x6'));var Mustache=require(_0x7247('0x7'));var util=require('util');var path=require(_0x7247('0x8'));var sox=require(_0x7247('0x9'));var csv=require(_0x7247('0xa'));var ejs=require(_0x7247('0xb'));var fs=require('fs');var _=require(_0x7247('0xc'));var squel=require(_0x7247('0xd'));var crypto=require(_0x7247('0xe'));var jsforce=require(_0x7247('0xf'));var deskjs=require(_0x7247('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7247('0x11'));var Papa=require(_0x7247('0x12'));var Redis=require(_0x7247('0x13'));var authService=require(_0x7247('0x14'));var qs=require(_0x7247('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7247('0x16'))('api');var utils=require(_0x7247('0x17'));var config=require('../../config/environment');var db=require(_0x7247('0x18'))['db'];function respondWithStatusCode(_0x10d15b,_0x2db839){_0x2db839=_0x2db839||0xcc;return function(_0x47b907){if(_0x47b907){return _0x10d15b[_0x7247('0x19')](_0x2db839);}return _0x10d15b[_0x7247('0x1a')](_0x2db839)[_0x7247('0x1b')]();};}function respondWithResult(_0x583c5d,_0x255eea){_0x255eea=_0x255eea||0xc8;return function(_0x4ebc0b){if(_0x4ebc0b){return _0x583c5d[_0x7247('0x1a')](_0x255eea)[_0x7247('0x1c')](_0x4ebc0b);}};}function respondWithFilteredResult(_0x3e2f36,_0x3e7215){return function(_0x456715){if(_0x456715){var _0x44d689=_0x456715[_0x7247('0x1d')],_0x386781=_0x3e7215['offset'],_0x25c3de=_0x3e7215[_0x7247('0x1e')]+_0x3e7215[_0x7247('0x1f')],_0x3d966b;if(_0x25c3de>=_0x44d689){_0x25c3de=_0x44d689;_0x3d966b=0xc8;}else{_0x3d966b=0xce;}_0x3e2f36[_0x7247('0x1a')](_0x3d966b);return _0x3e2f36['set'](_0x7247('0x20'),_0x386781+'-'+_0x25c3de+'/'+_0x44d689)[_0x7247('0x1c')](_0x456715);}return null;};}function patchUpdates(_0x2eec1f){return function(_0x35a96a){try{jsonpatch[_0x7247('0x21')](_0x35a96a,_0x2eec1f,!![]);}catch(_0x143ad9){return BPromise['reject'](_0x143ad9);}return _0x35a96a[_0x7247('0x22')]();};}function saveUpdates(_0x195cea,_0x52d38a){return function(_0x5ace00){if(_0x5ace00){return _0x5ace00[_0x7247('0x23')](_0x195cea)['then'](function(_0x976bb5){return _0x976bb5;});}return null;};}function removeEntity(_0x317ef8,_0x56ab66){return function(_0x2f226b){if(_0x2f226b){return _0x2f226b['destroy']()[_0x7247('0x24')](function(){_0x317ef8[_0x7247('0x1a')](0xcc)[_0x7247('0x1b')]();});}};}function handleEntityNotFound(_0x18c0f6,_0x498d00){return function(_0x296d27){if(!_0x296d27){_0x18c0f6[_0x7247('0x19')](0x194);}return _0x296d27;};}function handleError(_0x549392,_0x53a8ff){_0x53a8ff=_0x53a8ff||0x1f4;return function(_0x179328){logger[_0x7247('0x25')](_0x179328['stack']);if(_0x179328['name']){delete _0x179328['name'];}_0x549392[_0x7247('0x1a')](_0x53a8ff)[_0x7247('0x26')](_0x179328);};}exports[_0x7247('0x27')]=function(_0x56632c,_0x48d822){var _0x365845={},_0x16ced6={},_0x13928b={'count':0x0,'rows':[]};var _0x3f7c79=_[_0x7247('0x28')](db['ZendeskField'][_0x7247('0x29')],function(_0xff9377){return{'name':_0xff9377['fieldName'],'type':_0xff9377[_0x7247('0x2a')]['key']};});_0x16ced6['model']=_[_0x7247('0x28')](_0x3f7c79,_0x7247('0x2b'));_0x16ced6[_0x7247('0x2c')]=_['keys'](_0x56632c[_0x7247('0x2c')]);_0x16ced6[_0x7247('0x2d')]=_[_0x7247('0x2e')](_0x16ced6[_0x7247('0x2f')],_0x16ced6['query']);_0x365845[_0x7247('0x30')]=_[_0x7247('0x2e')](_0x16ced6[_0x7247('0x2f')],qs[_0x7247('0x31')](_0x56632c[_0x7247('0x2c')][_0x7247('0x31')]));_0x365845[_0x7247('0x30')]=_0x365845['attributes'][_0x7247('0x32')]?_0x365845[_0x7247('0x30')]:_0x16ced6[_0x7247('0x2f')];if(!_0x56632c[_0x7247('0x2c')]['hasOwnProperty']('nolimit')){_0x365845[_0x7247('0x1f')]=qs[_0x7247('0x1f')](_0x56632c[_0x7247('0x2c')][_0x7247('0x1f')]);_0x365845[_0x7247('0x1e')]=qs['offset'](_0x56632c[_0x7247('0x2c')][_0x7247('0x1e')]);}_0x365845[_0x7247('0x33')]=qs[_0x7247('0x34')](_0x56632c[_0x7247('0x2c')][_0x7247('0x34')]);_0x365845[_0x7247('0x35')]=qs[_0x7247('0x2d')](_['pick'](_0x56632c[_0x7247('0x2c')],_0x16ced6[_0x7247('0x2d')]),_0x3f7c79);if(_0x56632c[_0x7247('0x2c')][_0x7247('0x36')]){_0x365845[_0x7247('0x35')]=_[_0x7247('0x37')](_0x365845[_0x7247('0x35')],{'$or':_[_0x7247('0x28')](_0x3f7c79,function(_0x53c154){if(_0x53c154['type']!==_0x7247('0x38')){var _0x9e6595={};_0x9e6595[_0x53c154[_0x7247('0x2b')]]={'$like':'%'+_0x56632c['query'][_0x7247('0x36')]+'%'};return _0x9e6595;}})});}_0x365845=_[_0x7247('0x37')]({},_0x365845,_0x56632c[_0x7247('0x39')]);var _0x16ee39={'where':_0x365845[_0x7247('0x35')]};return db['ZendeskField'][_0x7247('0x1d')](_0x16ee39)['then'](function(_0x4eef8e){_0x13928b[_0x7247('0x1d')]=_0x4eef8e;if(_0x56632c['query'][_0x7247('0x3a')]){_0x365845[_0x7247('0x3b')]=[{'all':!![]}];}return db['ZendeskField'][_0x7247('0x3c')](_0x365845);})[_0x7247('0x24')](function(_0x4ba96b){_0x13928b[_0x7247('0x3d')]=_0x4ba96b;return _0x13928b;})[_0x7247('0x24')](respondWithFilteredResult(_0x48d822,_0x365845))[_0x7247('0x3e')](handleError(_0x48d822,null));};exports[_0x7247('0x3f')]=function(_0x3e25e9,_0x3a4914){var _0x5abf6b={'raw':!![],'where':{'id':_0x3e25e9[_0x7247('0x40')]['id']}},_0x1185a8={};_0x1185a8[_0x7247('0x2f')]=_[_0x7247('0x41')](db['ZendeskField'][_0x7247('0x29')]);_0x1185a8[_0x7247('0x2c')]=_[_0x7247('0x41')](_0x3e25e9[_0x7247('0x2c')]);_0x1185a8[_0x7247('0x2d')]=_['intersection'](_0x1185a8[_0x7247('0x2f')],_0x1185a8['query']);_0x5abf6b[_0x7247('0x30')]=_[_0x7247('0x2e')](_0x1185a8[_0x7247('0x2f')],qs[_0x7247('0x31')](_0x3e25e9[_0x7247('0x2c')][_0x7247('0x31')]));_0x5abf6b[_0x7247('0x30')]=_0x5abf6b[_0x7247('0x30')][_0x7247('0x32')]?_0x5abf6b['attributes']:_0x1185a8[_0x7247('0x2f')];if(_0x3e25e9[_0x7247('0x2c')]['includeAll']){_0x5abf6b[_0x7247('0x3b')]=[{'all':!![]}];}_0x5abf6b=_[_0x7247('0x37')]({},_0x5abf6b,_0x3e25e9['options']);return db[_0x7247('0x42')][_0x7247('0x43')](_0x5abf6b)['then'](handleEntityNotFound(_0x3a4914,null))[_0x7247('0x24')](respondWithResult(_0x3a4914,null))['catch'](handleError(_0x3a4914,null));};exports['create']=function(_0x7bc76d,_0xaba8e7){return db[_0x7247('0x42')][_0x7247('0x44')](_0x7bc76d[_0x7247('0x45')],{})[_0x7247('0x24')](respondWithResult(_0xaba8e7,0xc9))[_0x7247('0x3e')](handleError(_0xaba8e7,null));};exports[_0x7247('0x23')]=function(_0x5308b6,_0x5cd617){if(_0x5308b6[_0x7247('0x45')]['id']){delete _0x5308b6['body']['id'];}return db[_0x7247('0x42')][_0x7247('0x43')]({'where':{'id':_0x5308b6['params']['id']}})[_0x7247('0x24')](handleEntityNotFound(_0x5cd617,null))[_0x7247('0x24')](saveUpdates(_0x5308b6[_0x7247('0x45')],null))[_0x7247('0x24')](respondWithResult(_0x5cd617,null))['catch'](handleError(_0x5cd617,null));};exports[_0x7247('0x46')]=function(_0x696b59,_0x30628c){return db[_0x7247('0x42')][_0x7247('0x43')]({'where':{'id':_0x696b59[_0x7247('0x40')]['id']}})[_0x7247('0x24')](handleEntityNotFound(_0x30628c,null))[_0x7247('0x24')](removeEntity(_0x30628c,null))[_0x7247('0x3e')](handleError(_0x30628c,null));}; \ No newline at end of file +var _0x51a6=['create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','ZendeskField','includeAll','include','findAll','rows','catch','params','keys','length','find'];(function(_0x253cdb,_0x142a36){var _0x1ae7f4=function(_0x476a82){while(--_0x476a82){_0x253cdb['push'](_0x253cdb['shift']());}};_0x1ae7f4(++_0x142a36);}(_0x51a6,0x166));var _0x651a=function(_0x17158c,_0x58cb92){_0x17158c=_0x17158c-0x0;var _0x734f31=_0x51a6[_0x17158c];return _0x734f31;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x651a('0x0'));var zipdir=require(_0x651a('0x1'));var jsonpatch=require(_0x651a('0x2'));var rp=require(_0x651a('0x3'));var moment=require(_0x651a('0x4'));var BPromise=require(_0x651a('0x5'));var Mustache=require(_0x651a('0x6'));var util=require(_0x651a('0x7'));var path=require(_0x651a('0x8'));var sox=require('sox');var csv=require(_0x651a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x651a('0xa'));var deskjs=require(_0x651a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x651a('0xc'));var Papa=require(_0x651a('0xd'));var Redis=require(_0x651a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x651a('0xf'));var as=require(_0x651a('0x10'));var hardwareService=require(_0x651a('0x11'));var logger=require(_0x651a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x651a('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2348a9,_0x302411){_0x302411=_0x302411||0xcc;return function(_0x2c07e0){if(_0x2c07e0){return _0x2348a9[_0x651a('0x14')](_0x302411);}return _0x2348a9[_0x651a('0x15')](_0x302411)[_0x651a('0x16')]();};}function respondWithResult(_0x1613b4,_0x279f45){_0x279f45=_0x279f45||0xc8;return function(_0x3dc0b7){if(_0x3dc0b7){return _0x1613b4[_0x651a('0x15')](_0x279f45)['json'](_0x3dc0b7);}};}function respondWithFilteredResult(_0xaf2ae,_0x13967a){return function(_0xd0bafd){if(_0xd0bafd){var _0x1f010b=_0xd0bafd[_0x651a('0x17')],_0x153d68=_0x13967a[_0x651a('0x18')],_0x40f76b=_0x13967a[_0x651a('0x18')]+_0x13967a[_0x651a('0x19')],_0x438e36;if(_0x40f76b>=_0x1f010b){_0x40f76b=_0x1f010b;_0x438e36=0xc8;}else{_0x438e36=0xce;}_0xaf2ae['status'](_0x438e36);return _0xaf2ae[_0x651a('0x1a')](_0x651a('0x1b'),_0x153d68+'-'+_0x40f76b+'/'+_0x1f010b)[_0x651a('0x1c')](_0xd0bafd);}return null;};}function patchUpdates(_0x4c7dd4){return function(_0x1970d1){try{jsonpatch[_0x651a('0x1d')](_0x1970d1,_0x4c7dd4,!![]);}catch(_0x260f6c){return BPromise[_0x651a('0x1e')](_0x260f6c);}return _0x1970d1[_0x651a('0x1f')]();};}function saveUpdates(_0x3aaea3,_0x565544){return function(_0xb02ca0){if(_0xb02ca0){return _0xb02ca0['update'](_0x3aaea3)['then'](function(_0x41d1cc){return _0x41d1cc;});}return null;};}function removeEntity(_0x5e615a,_0x12da2a){return function(_0x226b0f){if(_0x226b0f){return _0x226b0f[_0x651a('0x20')]()[_0x651a('0x21')](function(){_0x5e615a[_0x651a('0x15')](0xcc)[_0x651a('0x16')]();});}};}function handleEntityNotFound(_0x2f8602,_0x3e3b8a){return function(_0x2d3960){if(!_0x2d3960){_0x2f8602['sendStatus'](0x194);}return _0x2d3960;};}function handleError(_0xa5e8f7,_0x10d5f8){_0x10d5f8=_0x10d5f8||0x1f4;return function(_0x5de277){logger['error'](_0x5de277[_0x651a('0x22')]);if(_0x5de277[_0x651a('0x23')]){delete _0x5de277['name'];}_0xa5e8f7[_0x651a('0x15')](_0x10d5f8)[_0x651a('0x24')](_0x5de277);};}exports[_0x651a('0x25')]=function(_0x422148,_0x527c03){var _0x1d5ef9={},_0x363a89={},_0xc643f1={'count':0x0,'rows':[]};var _0x5d81df=_['map'](db['ZendeskField'][_0x651a('0x26')],function(_0x36a9ba){return{'name':_0x36a9ba[_0x651a('0x27')],'type':_0x36a9ba[_0x651a('0x28')][_0x651a('0x29')]};});_0x363a89[_0x651a('0x2a')]=_['map'](_0x5d81df,_0x651a('0x23'));_0x363a89[_0x651a('0x2b')]=_['keys'](_0x422148[_0x651a('0x2b')]);_0x363a89['filters']=_[_0x651a('0x2c')](_0x363a89[_0x651a('0x2a')],_0x363a89['query']);_0x1d5ef9[_0x651a('0x2d')]=_[_0x651a('0x2c')](_0x363a89['model'],qs[_0x651a('0x2e')](_0x422148['query']['fields']));_0x1d5ef9[_0x651a('0x2d')]=_0x1d5ef9[_0x651a('0x2d')]['length']?_0x1d5ef9['attributes']:_0x363a89[_0x651a('0x2a')];if(!_0x422148[_0x651a('0x2b')]['hasOwnProperty'](_0x651a('0x2f'))){_0x1d5ef9[_0x651a('0x19')]=qs[_0x651a('0x19')](_0x422148[_0x651a('0x2b')][_0x651a('0x19')]);_0x1d5ef9[_0x651a('0x18')]=qs[_0x651a('0x18')](_0x422148[_0x651a('0x2b')][_0x651a('0x18')]);}_0x1d5ef9[_0x651a('0x30')]=qs[_0x651a('0x31')](_0x422148[_0x651a('0x2b')][_0x651a('0x31')]);_0x1d5ef9['where']=qs[_0x651a('0x32')](_[_0x651a('0x33')](_0x422148[_0x651a('0x2b')],_0x363a89['filters']),_0x5d81df);if(_0x422148[_0x651a('0x2b')][_0x651a('0x34')]){_0x1d5ef9[_0x651a('0x35')]=_[_0x651a('0x36')](_0x1d5ef9[_0x651a('0x35')],{'$or':_[_0x651a('0x37')](_0x5d81df,function(_0x1d7d47){if(_0x1d7d47[_0x651a('0x28')]!==_0x651a('0x38')){var _0x4a422b={};_0x4a422b[_0x1d7d47[_0x651a('0x23')]]={'$like':'%'+_0x422148[_0x651a('0x2b')][_0x651a('0x34')]+'%'};return _0x4a422b;}})});}_0x1d5ef9=_[_0x651a('0x36')]({},_0x1d5ef9,_0x422148[_0x651a('0x39')]);var _0x3cf986={'where':_0x1d5ef9[_0x651a('0x35')]};return db[_0x651a('0x3a')][_0x651a('0x17')](_0x3cf986)['then'](function(_0x4f09ba){_0xc643f1[_0x651a('0x17')]=_0x4f09ba;if(_0x422148[_0x651a('0x2b')][_0x651a('0x3b')]){_0x1d5ef9[_0x651a('0x3c')]=[{'all':!![]}];}return db[_0x651a('0x3a')][_0x651a('0x3d')](_0x1d5ef9);})['then'](function(_0x57caac){_0xc643f1[_0x651a('0x3e')]=_0x57caac;return _0xc643f1;})[_0x651a('0x21')](respondWithFilteredResult(_0x527c03,_0x1d5ef9))[_0x651a('0x3f')](handleError(_0x527c03,null));};exports['show']=function(_0x34a283,_0x511a8b){var _0x57797f={'raw':!![],'where':{'id':_0x34a283[_0x651a('0x40')]['id']}},_0x420e6e={};_0x420e6e[_0x651a('0x2a')]=_[_0x651a('0x41')](db[_0x651a('0x3a')][_0x651a('0x26')]);_0x420e6e[_0x651a('0x2b')]=_[_0x651a('0x41')](_0x34a283['query']);_0x420e6e['filters']=_[_0x651a('0x2c')](_0x420e6e['model'],_0x420e6e[_0x651a('0x2b')]);_0x57797f[_0x651a('0x2d')]=_[_0x651a('0x2c')](_0x420e6e[_0x651a('0x2a')],qs[_0x651a('0x2e')](_0x34a283[_0x651a('0x2b')]['fields']));_0x57797f[_0x651a('0x2d')]=_0x57797f[_0x651a('0x2d')][_0x651a('0x42')]?_0x57797f['attributes']:_0x420e6e['model'];if(_0x34a283[_0x651a('0x2b')][_0x651a('0x3b')]){_0x57797f[_0x651a('0x3c')]=[{'all':!![]}];}_0x57797f=_[_0x651a('0x36')]({},_0x57797f,_0x34a283['options']);return db[_0x651a('0x3a')][_0x651a('0x43')](_0x57797f)['then'](handleEntityNotFound(_0x511a8b,null))[_0x651a('0x21')](respondWithResult(_0x511a8b,null))['catch'](handleError(_0x511a8b,null));};exports[_0x651a('0x44')]=function(_0x13980d,_0x8a26b4){return db[_0x651a('0x3a')][_0x651a('0x44')](_0x13980d[_0x651a('0x45')],{})['then'](respondWithResult(_0x8a26b4,0xc9))[_0x651a('0x3f')](handleError(_0x8a26b4,null));};exports[_0x651a('0x46')]=function(_0x5d0c85,_0x5cb0b0){if(_0x5d0c85['body']['id']){delete _0x5d0c85[_0x651a('0x45')]['id'];}return db['ZendeskField'][_0x651a('0x43')]({'where':{'id':_0x5d0c85[_0x651a('0x40')]['id']}})[_0x651a('0x21')](handleEntityNotFound(_0x5cb0b0,null))[_0x651a('0x21')](saveUpdates(_0x5d0c85[_0x651a('0x45')],null))[_0x651a('0x21')](respondWithResult(_0x5cb0b0,null))[_0x651a('0x3f')](handleError(_0x5cb0b0,null));};exports[_0x651a('0x20')]=function(_0x512bdd,_0xac541e){return db[_0x651a('0x3a')][_0x651a('0x43')]({'where':{'id':_0x512bdd[_0x651a('0x40')]['id']}})[_0x651a('0x21')](handleEntityNotFound(_0xac541e,null))['then'](removeEntity(_0xac541e,null))[_0x651a('0x3f')](handleError(_0xac541e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 39440ef..2142aba 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 _0xa249=['zendesk_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','rimraf','define','ZendeskField','int_zendesk_fields'];(function(_0x33dbcc,_0x3070c1){var _0x5b0a8b=function(_0x15f845){while(--_0x15f845){_0x33dbcc['push'](_0x33dbcc['shift']());}};_0x5b0a8b(++_0x3070c1);}(_0xa249,0x183));var _0x9a24=function(_0x5a773e,_0x239ea8){_0x5a773e=_0x5a773e-0x0;var _0x5290b8=_0xa249[_0x5a773e];return _0x5290b8;};'use strict';var _=require(_0x9a24('0x0'));var util=require(_0x9a24('0x1'));var logger=require('../../config/logger')(_0x9a24('0x2'));var moment=require(_0x9a24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a24('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a24('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x1b0728,_0x167980){return _0x1b0728[_0x9a24('0x6')](_0x9a24('0x7'),attributes,{'tableName':_0x9a24('0x8'),'paranoid':![],'indexes':[{'name':_0x9a24('0x9'),'fields':[_0x9a24('0xa'),_0x9a24('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91a7=['util','../../config/logger','api','bluebird','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','idField','FieldId'];(function(_0x444ec3,_0x177e63){var _0x4f10fa=function(_0x4d45e9){while(--_0x4d45e9){_0x444ec3['push'](_0x444ec3['shift']());}};_0x4f10fa(++_0x177e63);}(_0x91a7,0xe7));var _0x791a=function(_0x17cb67,_0x5e7b03){_0x17cb67=_0x17cb67-0x0;var _0x324e8f=_0x91a7[_0x17cb67];return _0x324e8f;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x791a('0x9'),_0x791a('0xa')],'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 0878a5e..7edb6bd 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 _0xe59d=['ioredis','../../mysqldb','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x439420,_0x54dfb2){var _0x1085e9=function(_0x1889fd){while(--_0x1889fd){_0x439420['push'](_0x439420['shift']());}};_0x1085e9(++_0x54dfb2);}(_0xe59d,0x145));var _0xde59=function(_0x3e35e9,_0x343705){_0x3e35e9=_0x3e35e9-0x0;var _0x5a9829=_0xe59d[_0x3e35e9];return _0x5a9829;};'use strict';var _=require(_0xde59('0x0'));var util=require(_0xde59('0x1'));var moment=require(_0xde59('0x2'));var BPromise=require(_0xde59('0x3'));var rs=require(_0xde59('0x4'));var fs=require('fs');var Redis=require(_0xde59('0x5'));var db=require(_0xde59('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xde59('0x7'));var client=jayson[_0xde59('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x916a7d,_0x5d6fdf,_0x503550){return new BPromise(function(_0xc27605,_0x4dbd3c){return client[_0xde59('0x9')](_0x916a7d,_0x503550)[_0xde59('0xa')](function(_0x25a6a9){logger[_0xde59('0xb')](_0xde59('0xc'),_0x5d6fdf,_0xde59('0xd'));logger[_0xde59('0xe')](_0xde59('0xf'),_0x5d6fdf,_0xde59('0xd'),JSON[_0xde59('0x10')](_0x25a6a9));if(_0x25a6a9[_0xde59('0x11')]){if(_0x25a6a9[_0xde59('0x11')][_0xde59('0x12')]===0x1f4){logger[_0xde59('0x11')]('ZendeskField,\x20%s,\x20%s',_0x5d6fdf,_0x25a6a9['error'][_0xde59('0x13')]);return _0x4dbd3c(_0x25a6a9['error'][_0xde59('0x13')]);}logger[_0xde59('0x11')](_0xde59('0xc'),_0x5d6fdf,_0x25a6a9[_0xde59('0x11')]['message']);return _0xc27605(_0x25a6a9[_0xde59('0x11')]['message']);}else{logger[_0xde59('0xb')](_0xde59('0xc'),_0x5d6fdf,_0xde59('0xd'));_0xc27605(_0x25a6a9[_0xde59('0x14')][_0xde59('0x13')]);}})[_0xde59('0x15')](function(_0x104515){logger[_0xde59('0x11')](_0xde59('0xc'),_0x5d6fdf,_0x104515);_0x4dbd3c(_0x104515);});});} \ No newline at end of file +var _0x92ab=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x92ab,0xfb));var _0xb92a=function(_0x19ee96,_0x446b40){_0x19ee96=_0x19ee96-0x0;var _0x295cda=_0x92ab[_0x19ee96];return _0x295cda;};'use strict';var _=require(_0xb92a('0x0'));var util=require(_0xb92a('0x1'));var moment=require(_0xb92a('0x2'));var BPromise=require(_0xb92a('0x3'));var rs=require(_0xb92a('0x4'));var fs=require('fs');var Redis=require(_0xb92a('0x5'));var db=require(_0xb92a('0x6'))['db'];var utils=require(_0xb92a('0x7'));var logger=require(_0xb92a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb92a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae81c,_0x2da1ba,_0xb441c2){return new BPromise(function(_0x275515,_0x3e8f10){return client['request'](_0x1ae81c,_0xb441c2)[_0xb92a('0xa')](function(_0x4aca1a){logger[_0xb92a('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2da1ba,_0xb92a('0xc'));logger[_0xb92a('0xd')](_0xb92a('0xe'),_0x2da1ba,_0xb92a('0xc'),JSON[_0xb92a('0xf')](_0x4aca1a));if(_0x4aca1a[_0xb92a('0x10')]){if(_0x4aca1a[_0xb92a('0x10')][_0xb92a('0x11')]===0x1f4){logger[_0xb92a('0x10')](_0xb92a('0x12'),_0x2da1ba,_0x4aca1a[_0xb92a('0x10')][_0xb92a('0x13')]);return _0x3e8f10(_0x4aca1a[_0xb92a('0x10')][_0xb92a('0x13')]);}logger['error'](_0xb92a('0x12'),_0x2da1ba,_0x4aca1a[_0xb92a('0x10')][_0xb92a('0x13')]);return _0x275515(_0x4aca1a['error'][_0xb92a('0x13')]);}else{logger[_0xb92a('0xb')]('ZendeskField,\x20%s,\x20%s',_0x2da1ba,_0xb92a('0xc'));_0x275515(_0x4aca1a[_0xb92a('0x14')]['message']);}})[_0xb92a('0x15')](function(_0x37d292){logger[_0xb92a('0x10')](_0xb92a('0x12'),_0x2da1ba,_0x37d292);_0x3e8f10(_0x37d292);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2c83879..2e19db1 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 _0x8903=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x15566c,_0x210665){var _0x6f4ca0=function(_0x27c75d){while(--_0x27c75d){_0x15566c['push'](_0x15566c['shift']());}};_0x6f4ca0(++_0x210665);}(_0x8903,0x188));var _0x3890=function(_0x2a8255,_0x2ab6cb){_0x2a8255=_0x2a8255-0x0;var _0x20d7a5=_0x8903[_0x2a8255];return _0x20d7a5;};'use strict';var multer=require(_0x3890('0x0'));var util=require(_0x3890('0x1'));var path=require(_0x3890('0x2'));var timeout=require('connect-timeout');var express=require(_0x3890('0x3'));var router=express['Router']();var auth=require(_0x3890('0x4'));var interaction=require(_0x3890('0x5'));var config=require(_0x3890('0x6'));var controller=require('./intZohoAccount.controller');router[_0x3890('0x7')]('/',auth[_0x3890('0x8')](),controller[_0x3890('0x9')]);router['get'](_0x3890('0xa'),auth[_0x3890('0x8')](),controller[_0x3890('0xb')]);router[_0x3890('0x7')](_0x3890('0xc'),auth[_0x3890('0x8')](),controller['getConfigurations']);router['get'](_0x3890('0xd'),auth[_0x3890('0x8')](),controller['getFields']);router[_0x3890('0xe')]('/',auth[_0x3890('0x8')](),controller[_0x3890('0xf')]);router[_0x3890('0xe')](_0x3890('0xc'),auth[_0x3890('0x8')](),controller[_0x3890('0x10')]);router[_0x3890('0x11')]('/:id',auth[_0x3890('0x8')](),controller[_0x3890('0x12')]);router[_0x3890('0x13')](_0x3890('0xa'),auth[_0x3890('0x8')](),controller[_0x3890('0x14')]);module[_0x3890('0x15')]=router; \ No newline at end of file +var _0xcb2a=['../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xcb2a,0xee));var _0xacb2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcb2a[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xacb2('0x0'));var timeout=require(_0xacb2('0x1'));var express=require(_0xacb2('0x2'));var router=express[_0xacb2('0x3')]();var auth=require(_0xacb2('0x4'));var interaction=require(_0xacb2('0x5'));var config=require('../../config/environment');var controller=require(_0xacb2('0x6'));router[_0xacb2('0x7')]('/',auth['isAuthenticated'](),controller[_0xacb2('0x8')]);router[_0xacb2('0x7')](_0xacb2('0x9'),auth[_0xacb2('0xa')](),controller[_0xacb2('0xb')]);router[_0xacb2('0x7')](_0xacb2('0xc'),auth['isAuthenticated'](),controller[_0xacb2('0xd')]);router[_0xacb2('0x7')](_0xacb2('0xe'),auth['isAuthenticated'](),controller[_0xacb2('0xf')]);router[_0xacb2('0x10')]('/',auth[_0xacb2('0xa')](),controller['create']);router[_0xacb2('0x10')](_0xacb2('0xc'),auth['isAuthenticated'](),controller[_0xacb2('0x11')]);router[_0xacb2('0x12')](_0xacb2('0x9'),auth[_0xacb2('0xa')](),controller[_0xacb2('0x13')]);router[_0xacb2('0x14')]('/:id',auth[_0xacb2('0xa')](),controller[_0xacb2('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 3bce1cb..1bed1f7 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 _0xfe38=['STRING','sequelize'];(function(_0x5e5c4c,_0x21abba){var _0x176148=function(_0x59522a){while(--_0x59522a){_0x5e5c4c['push'](_0x5e5c4c['shift']());}};_0x176148(++_0x21abba);}(_0xfe38,0x1b7));var _0x8fe3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfe38[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x8fe3('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fe3('0x1')]},'description':{'type':Sequelize[_0x8fe3('0x1')]},'host':{'type':Sequelize[_0x8fe3('0x1')]},'zone':{'type':Sequelize[_0x8fe3('0x1')]},'clientId':{'type':Sequelize[_0x8fe3('0x1')]},'clientSecret':{'type':Sequelize[_0x8fe3('0x1')]},'serverUrl':{'type':Sequelize[_0x8fe3('0x1')]},'code':{'type':Sequelize[_0x8fe3('0x1')]},'refreshToken':{'type':Sequelize[_0x8fe3('0x1')]}}; \ No newline at end of file +var _0x58ea=['STRING','sequelize','exports'];(function(_0x5b8230,_0x1242eb){var _0x379f8e=function(_0xf8f669){while(--_0xf8f669){_0x5b8230['push'](_0x5b8230['shift']());}};_0x379f8e(++_0x1242eb);}(_0x58ea,0x190));var _0xa58e=function(_0x3ca9c1,_0x5c99b7){_0x3ca9c1=_0x3ca9c1-0x0;var _0x37a3da=_0x58ea[_0x3ca9c1];return _0x37a3da;};'use strict';var Sequelize=require(_0xa58e('0x0'));module[_0xa58e('0x1')]={'name':{'type':Sequelize[_0xa58e('0x2')]},'description':{'type':Sequelize[_0xa58e('0x2')]},'host':{'type':Sequelize[_0xa58e('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa58e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xa58e('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 05983a0..8d0d51e 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 _0x6292=['Subject','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../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~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','update','stack','name','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','order','sort','where','pick','VIRTUAL','filter','includeAll','findAll','rows','show','params','keys','length','merge','options','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','host','serverUrl','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','response'];(function(_0x1e7716,_0x48e426){var _0xd61a23=function(_0x28667b){while(--_0x28667b){_0x1e7716['push'](_0x1e7716['shift']());}};_0xd61a23(++_0x48e426);}(_0x6292,0x11e));var _0x2629=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x6292[_0x36dfbd];return _0x4ecad9;};'use strict';var pdf=require(_0x2629('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2629('0x1'));var rp=require(_0x2629('0x2'));var moment=require(_0x2629('0x3'));var BPromise=require(_0x2629('0x4'));var Mustache=require(_0x2629('0x5'));var util=require(_0x2629('0x6'));var path=require(_0x2629('0x7'));var sox=require(_0x2629('0x8'));var csv=require(_0x2629('0x9'));var ejs=require(_0x2629('0xa'));var fs=require('fs');var _=require(_0x2629('0xb'));var squel=require(_0x2629('0xc'));var crypto=require('crypto');var jsforce=require(_0x2629('0xd'));var deskjs=require(_0x2629('0xe'));var toCsv=require(_0x2629('0x9'));var querystring=require(_0x2629('0xf'));var Papa=require(_0x2629('0x10'));var Redis=require(_0x2629('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2629('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2629('0x13'))('api');var utils=require(_0x2629('0x14'));var config=require(_0x2629('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2629('0x16'));var jayson=require(_0x2629('0x17'));var client=jayson[_0x2629('0x18')][_0x2629('0x19')]({'port':0x232a});function checkPasswordPattern(_0x12e370,_0x31e8e1,_0x5ae25b){if(_0x5ae25b){var _0x1018d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1018d8[_0x2629('0x1a')](_0x31e8e1)){return _0x12e370;}else{throw new db[(_0x2629('0x1b'))][(_0x2629('0x1c'))](_0x2629('0x1d'));}}else{return _0x12e370;}}function respondWithRpcPromise(_0xeb01c9,_0x54eca9,_0x5396c7,_0x108408){return new BPromise(function(_0x130352,_0x4fe3cc){var _0x29695f=_0x108408||client;return _0x29695f[_0x2629('0x1e')](_0xeb01c9,_0x5396c7)[_0x2629('0x1f')](function(_0x5ef8bf){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x54eca9,_0x2629('0x20'));logger[_0x2629('0x21')](_0x2629('0x22'),_0x54eca9,_0x2629('0x20'),JSON['stringify'](_0x5ef8bf));if(_0x5ef8bf[_0x2629('0x23')]){if(_0x5ef8bf[_0x2629('0x23')][_0x2629('0x24')]===0x1f4){logger[_0x2629('0x23')](_0x2629('0x25'),_0x54eca9,_0x5ef8bf['error'][_0x2629('0x26')]);return _0x4fe3cc(_0x5ef8bf[_0x2629('0x23')][_0x2629('0x26')]);}logger[_0x2629('0x23')](_0x2629('0x25'),_0x54eca9,_0x5ef8bf[_0x2629('0x23')]['message']);return _0x130352(_0x5ef8bf[_0x2629('0x23')][_0x2629('0x26')]);}else{logger['info'](_0x2629('0x25'),_0x54eca9,_0x2629('0x20'));_0x130352(_0x5ef8bf[_0x2629('0x27')][_0x2629('0x26')]);}})[_0x2629('0x28')](function(_0xb4995f){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x54eca9,_0xb4995f);_0x4fe3cc(_0xb4995f);});});}function respondWithStatusCode(_0xea9175,_0x1b6584){_0x1b6584=_0x1b6584||0xcc;return function(_0x131200){if(_0x131200){return _0xea9175[_0x2629('0x29')](_0x1b6584);}return _0xea9175[_0x2629('0x2a')](_0x1b6584)[_0x2629('0x2b')]();};}function respondWithResult(_0x4a136d,_0x5cdf56){_0x5cdf56=_0x5cdf56||0xc8;return function(_0x139250){if(_0x139250){return _0x4a136d['status'](_0x5cdf56)[_0x2629('0x2c')](_0x139250);}};}function respondWithFilteredResult(_0x447954,_0x85f229){return function(_0x573f92){if(_0x573f92){var _0xf38cfc=_0x573f92[_0x2629('0x2d')],_0x533ec4=_0x85f229[_0x2629('0x2e')],_0x31db33=_0x85f229[_0x2629('0x2e')]+_0x85f229[_0x2629('0x2f')],_0x28f9b3;if(_0x31db33>=_0xf38cfc){_0x31db33=_0xf38cfc;_0x28f9b3=0xc8;}else{_0x28f9b3=0xce;}_0x447954[_0x2629('0x2a')](_0x28f9b3);return _0x447954[_0x2629('0x30')]('Content-Range',_0x533ec4+'-'+_0x31db33+'/'+_0xf38cfc)[_0x2629('0x2c')](_0x573f92);}return null;};}function patchUpdates(_0x6f63ba){return function(_0x52bb17){try{jsonpatch[_0x2629('0x31')](_0x52bb17,_0x6f63ba,!![]);}catch(_0x15b397){return BPromise['reject'](_0x15b397);}return _0x52bb17['save']();};}function saveUpdates(_0x2bd50f,_0x313b29){return function(_0x497d76){if(_0x497d76){return _0x497d76[_0x2629('0x32')](_0x2bd50f)['then'](function(_0x117091){return _0x117091;});}return null;};}function removeEntity(_0xf5e4d,_0x863d3c){return function(_0x3ddc37){if(_0x3ddc37){return _0x3ddc37['destroy']()[_0x2629('0x1f')](function(){_0xf5e4d[_0x2629('0x2a')](0xcc)[_0x2629('0x2b')]();});}};}function handleEntityNotFound(_0x3be9aa,_0xeeb456){return function(_0x53ef25){if(!_0x53ef25){_0x3be9aa[_0x2629('0x29')](0x194);}return _0x53ef25;};}function handleError(_0x189b44,_0x5528d6){_0x5528d6=_0x5528d6||0x1f4;return function(_0x439b9f){logger[_0x2629('0x23')](_0x439b9f[_0x2629('0x33')]);if(_0x439b9f['name']){delete _0x439b9f[_0x2629('0x34')];}_0x189b44[_0x2629('0x2a')](_0x5528d6)['send'](_0x439b9f);};}exports['index']=function(_0x28e3bd,_0x198a71){var _0x523b79={},_0x758252={},_0xac8b78={'count':0x0,'rows':[]};var _0x425377=_[_0x2629('0x35')](db[_0x2629('0x36')][_0x2629('0x37')],function(_0x5cb0ac){return{'name':_0x5cb0ac[_0x2629('0x38')],'type':_0x5cb0ac[_0x2629('0x39')][_0x2629('0x3a')]};});_0x758252[_0x2629('0x3b')]=_[_0x2629('0x35')](_0x425377,_0x2629('0x34'));_0x758252[_0x2629('0x3c')]=_['keys'](_0x28e3bd[_0x2629('0x3c')]);_0x758252[_0x2629('0x3d')]=_['intersection'](_0x758252[_0x2629('0x3b')],_0x758252[_0x2629('0x3c')]);_0x523b79['attributes']=_[_0x2629('0x3e')](_0x758252[_0x2629('0x3b')],qs[_0x2629('0x3f')](_0x28e3bd[_0x2629('0x3c')]['fields']));_0x523b79[_0x2629('0x40')]=_0x523b79[_0x2629('0x40')]['length']?_0x523b79[_0x2629('0x40')]:_0x758252[_0x2629('0x3b')];if(!_0x28e3bd[_0x2629('0x3c')]['hasOwnProperty']('nolimit')){_0x523b79['limit']=qs[_0x2629('0x2f')](_0x28e3bd['query'][_0x2629('0x2f')]);_0x523b79[_0x2629('0x2e')]=qs[_0x2629('0x2e')](_0x28e3bd['query'][_0x2629('0x2e')]);}_0x523b79[_0x2629('0x41')]=qs['sort'](_0x28e3bd['query'][_0x2629('0x42')]);_0x523b79[_0x2629('0x43')]=qs[_0x2629('0x3d')](_[_0x2629('0x44')](_0x28e3bd[_0x2629('0x3c')],_0x758252[_0x2629('0x3d')]),_0x425377);if(_0x28e3bd[_0x2629('0x3c')]['filter']){_0x523b79[_0x2629('0x43')]=_['merge'](_0x523b79[_0x2629('0x43')],{'$or':_['map'](_0x425377,function(_0x29e05c){if(_0x29e05c[_0x2629('0x39')]!==_0x2629('0x45')){var _0x1246e9={};_0x1246e9[_0x29e05c['name']]={'$like':'%'+_0x28e3bd['query'][_0x2629('0x46')]+'%'};return _0x1246e9;}})});}_0x523b79=_['merge']({},_0x523b79,_0x28e3bd['options']);var _0x2fe428={'where':_0x523b79[_0x2629('0x43')]};return db['ZohoAccount'][_0x2629('0x2d')](_0x2fe428)['then'](function(_0x231ee2){_0xac8b78[_0x2629('0x2d')]=_0x231ee2;if(_0x28e3bd[_0x2629('0x3c')][_0x2629('0x47')]){_0x523b79['include']=[{'all':!![]}];}return db[_0x2629('0x36')][_0x2629('0x48')](_0x523b79);})[_0x2629('0x1f')](function(_0x3d166c){_0xac8b78[_0x2629('0x49')]=_0x3d166c;return _0xac8b78;})[_0x2629('0x1f')](respondWithFilteredResult(_0x198a71,_0x523b79))[_0x2629('0x28')](handleError(_0x198a71,null));};exports[_0x2629('0x4a')]=function(_0x1cec43,_0x250d31){var _0x46ec6d={'raw':![],'where':{'id':_0x1cec43[_0x2629('0x4b')]['id']}},_0x58fb22={};_0x58fb22[_0x2629('0x3b')]=_['keys'](db[_0x2629('0x36')][_0x2629('0x37')]);_0x58fb22['query']=_[_0x2629('0x4c')](_0x1cec43['query']);_0x58fb22[_0x2629('0x3d')]=_[_0x2629('0x3e')](_0x58fb22['model'],_0x58fb22[_0x2629('0x3c')]);_0x46ec6d[_0x2629('0x40')]=_[_0x2629('0x3e')](_0x58fb22[_0x2629('0x3b')],qs[_0x2629('0x3f')](_0x1cec43['query']['fields']));_0x46ec6d['attributes']=_0x46ec6d[_0x2629('0x40')][_0x2629('0x4d')]?_0x46ec6d[_0x2629('0x40')]:_0x58fb22[_0x2629('0x3b')];if(_0x1cec43[_0x2629('0x3c')][_0x2629('0x47')]){_0x46ec6d['include']=[{'all':!![]}];}_0x46ec6d=_[_0x2629('0x4e')]({},_0x46ec6d,_0x1cec43[_0x2629('0x4f')]);return db[_0x2629('0x36')][_0x2629('0x50')](_0x46ec6d)[_0x2629('0x1f')](handleEntityNotFound(_0x250d31,null))[_0x2629('0x1f')](respondWithResult(_0x250d31,null))[_0x2629('0x28')](handleError(_0x250d31,null));};exports[_0x2629('0x51')]=function(_0x38e190,_0x1cc075){return db[_0x2629('0x36')][_0x2629('0x51')](_0x38e190[_0x2629('0x52')],{})[_0x2629('0x1f')](respondWithResult(_0x1cc075,0xc9))[_0x2629('0x28')](handleError(_0x1cc075,null));};exports[_0x2629('0x32')]=function(_0x555dcf,_0x2f3783){if(_0x555dcf[_0x2629('0x52')]['id']){delete _0x555dcf[_0x2629('0x52')]['id'];}return db[_0x2629('0x36')][_0x2629('0x50')]({'where':{'id':_0x555dcf['params']['id']}})[_0x2629('0x1f')](handleEntityNotFound(_0x2f3783,null))[_0x2629('0x1f')](saveUpdates(_0x555dcf[_0x2629('0x52')],null))['then'](respondWithResult(_0x2f3783,null))[_0x2629('0x28')](handleError(_0x2f3783,null));};exports[_0x2629('0x53')]=function(_0x85c18b,_0x1f28f8){return db['ZohoAccount'][_0x2629('0x50')]({'where':{'id':_0x85c18b[_0x2629('0x4b')]['id']}})[_0x2629('0x1f')](handleEntityNotFound(_0x1f28f8,null))[_0x2629('0x1f')](removeEntity(_0x1f28f8,null))[_0x2629('0x28')](handleError(_0x1f28f8,null));};exports[_0x2629('0x54')]=function(_0x5b47d2,_0x556147,_0x11c67d){var _0x20c646={};var _0x3d29f6={};var _0x31c324;var _0x591caf;return db[_0x2629('0x36')][_0x2629('0x55')]({'where':{'id':_0x5b47d2[_0x2629('0x4b')]['id']}})[_0x2629('0x1f')](handleEntityNotFound(_0x556147,null))[_0x2629('0x1f')](function(_0x4ddf8a){if(_0x4ddf8a){_0x31c324=_0x4ddf8a;_0x3d29f6[_0x2629('0x3b')]=_['keys'](db[_0x2629('0x56')][_0x2629('0x37')]);_0x3d29f6[_0x2629('0x3c')]=_[_0x2629('0x4c')](_0x5b47d2[_0x2629('0x3c')]);_0x3d29f6[_0x2629('0x3d')]=_['intersection'](_0x3d29f6[_0x2629('0x3b')],_0x3d29f6[_0x2629('0x3c')]);_0x20c646[_0x2629('0x40')]=_[_0x2629('0x3e')](_0x3d29f6['model'],qs[_0x2629('0x3f')](_0x5b47d2[_0x2629('0x3c')][_0x2629('0x3f')]));_0x20c646[_0x2629('0x40')]=_0x20c646[_0x2629('0x40')][_0x2629('0x4d')]?_0x20c646[_0x2629('0x40')]:_0x3d29f6[_0x2629('0x3b')];_0x20c646[_0x2629('0x41')]=qs['sort'](_0x5b47d2[_0x2629('0x3c')][_0x2629('0x42')]);_0x20c646[_0x2629('0x43')]=qs[_0x2629('0x3d')](_['pick'](_0x5b47d2[_0x2629('0x3c')],_0x3d29f6[_0x2629('0x3d')]));if(_0x5b47d2[_0x2629('0x3c')][_0x2629('0x46')]){_0x20c646[_0x2629('0x43')]=_[_0x2629('0x4e')](_0x20c646[_0x2629('0x43')],{'$or':_['map'](_0x20c646['attributes'],function(_0x5300e7){var _0x12ccd5={};_0x12ccd5[_0x5300e7]={'$like':'%'+_0x5b47d2[_0x2629('0x3c')]['filter']+'%'};return _0x12ccd5;})});}_0x20c646=_[_0x2629('0x4e')]({},_0x20c646,_0x5b47d2[_0x2629('0x4f')]);return _0x31c324[_0x2629('0x54')](_0x20c646);}})['then'](function(_0x267ac1){if(_0x267ac1){_0x591caf=_0x267ac1[_0x2629('0x4d')];if(!_0x5b47d2[_0x2629('0x3c')][_0x2629('0x57')](_0x2629('0x58'))){_0x20c646[_0x2629('0x2f')]=qs[_0x2629('0x2f')](_0x5b47d2[_0x2629('0x3c')][_0x2629('0x2f')]);_0x20c646[_0x2629('0x2e')]=qs[_0x2629('0x2e')](_0x5b47d2['query'][_0x2629('0x2e')]);}return _0x31c324[_0x2629('0x54')](_0x20c646);}})[_0x2629('0x1f')](function(_0x1b83c1){if(_0x1b83c1){return _0x1b83c1?{'count':_0x591caf,'rows':_0x1b83c1}:null;}})[_0x2629('0x1f')](respondWithResult(_0x556147,null))[_0x2629('0x28')](handleError(_0x556147,null));};exports[_0x2629('0x59')]=function(_0x286c45,_0x3af446,_0x5913b6){if(_0x286c45[_0x2629('0x52')]['id']){delete _0x286c45[_0x2629('0x52')]['id'];}return db[_0x2629('0x36')][_0x2629('0x55')]({'where':{'id':_0x286c45[_0x2629('0x4b')]['id']}})[_0x2629('0x1f')](handleEntityNotFound(_0x3af446,null))[_0x2629('0x1f')](function(_0x46daa6){if(_0x46daa6){_0x286c45[_0x2629('0x52')][_0x2629('0x5a')]=_0x46daa6['id'];_0x286c45[_0x2629('0x52')][_0x2629('0x5b')]=integrations[_0x2629('0x5c')](_0x286c45[_0x2629('0x52')]['channel'],_0x286c45[_0x2629('0x52')]['type']);_0x286c45[_0x2629('0x52')][_0x2629('0x5d')]=integrations['getDescriptions'](_0x286c45[_0x2629('0x52')][_0x2629('0x5e')],_0x286c45[_0x2629('0x52')][_0x2629('0x39')]);return db[_0x2629('0x56')][_0x2629('0x51')](_0x286c45[_0x2629('0x52')],{'include':[{'model':db[_0x2629('0x5f')],'as':_0x2629('0x5b')},{'model':db[_0x2629('0x5f')],'as':_0x2629('0x5d')}]});}return null;})[_0x2629('0x1f')](respondWithResult(_0x3af446,null))[_0x2629('0x28')](handleError(_0x3af446,null));};function getAccessToken(_0x478a57){return new Promise(function(_0x28d389,_0x39f037){var _0x4f8da6;switch(_0x478a57[_0x2629('0x60')]){case'US':_0x4f8da6=_0x2629('0x61');break;case'AU':_0x4f8da6='https://accounts.zoho.com.au';break;case'EU':_0x4f8da6=_0x2629('0x62');break;case'IN':_0x4f8da6='https://accounts.zoho.in';break;case'CN':_0x4f8da6=_0x2629('0x63');break;default:_0x4f8da6=_0x2629('0x62');break;}var _0x4d7c79={'method':'POST','uri':_0x4f8da6+_0x2629('0x64'),'qs':{'refresh_token':_0x478a57[_0x2629('0x65')],'client_id':_0x478a57[_0x2629('0x66')],'client_secret':_0x478a57['clientSecret'],'grant_type':_0x2629('0x67')},'json':!![]};return rp(_0x4d7c79)['then'](function(_0x1a4530){if(_0x1a4530[_0x2629('0x68')]){_0x28d389(_0x1a4530[_0x2629('0x68')]);}else{_0x39f037('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2629('0x28')](function(_0x45da16){_0x39f037(_0x45da16);});});}exports[_0x2629('0x69')]=function(_0x395b70,_0x30f37c,_0x2e11db){var _0x2cb545,_0x8c54f6,_0x25deee,_0x4f7dff,_0x29350e;return db['ZohoAccount']['findOne']({'where':{'id':_0x395b70[_0x2629('0x4b')]['id']},'attributes':['id',_0x2629('0x6a'),_0x2629('0x60'),_0x2629('0x66'),'clientSecret',_0x2629('0x6b'),'code',_0x2629('0x65')]})[_0x2629('0x1f')](handleEntityNotFound(_0x30f37c,null))[_0x2629('0x1f')](function(_0x19698e){_0x29350e=_0x19698e;_0x2cb545=_0x29350e[_0x2629('0x6a')];_0x8c54f6=_0x2cb545===_0x2629('0x6c')?'eu':_0x2629('0x6d');_0x25deee=_0x29350e['serverUrl'];var _0x3ca8c2=_0x25deee['slice'](-0x1);if(_0x3ca8c2==='/'||_0x3ca8c2==='\x5c'||_0x3ca8c2===':'){_0x25deee=_0x25deee[_0x2629('0x6e')](0x0,_0x25deee[_0x2629('0x6f')](_0x3ca8c2));}if(!_0x29350e[_0x2629('0x65')]){throw new Error(_0x2629('0x70'));}return getAccessToken(_0x29350e);})[_0x2629('0x1f')](function(_0x5871fe){if(_0x5871fe){return rp({'method':'GET','uri':util[_0x2629('0x71')](_0x2629('0x72'),_0x8c54f6),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5871fe},'json':!![]});}})['then'](function(_0x5b4794){if(_0x5b4794){if(_0x5b4794['response']&&_0x5b4794['response'][_0x2629('0x23')]){throw new Error(_0x5b4794[_0x2629('0x73')][_0x2629('0x23')][_0x2629('0x26')]);}var _0x323ef0=[];var _0xcc5371=[];var _0x45d3d8=['Owner',_0x2629('0x74'),'Description','WhoId',_0x2629('0x75'),_0x2629('0x76'),'Call_Start_Time',_0x2629('0x77')];_0xcc5371=_[_0x2629('0x78')](_0x5b4794[_0x2629('0x3f')],function(_0x255d34){return _0x45d3d8[_0x2629('0x79')](_0x255d34[_0x2629('0x7a')]);});for(var _0x1fbe71=0x0;_0x1fbe71<_0xcc5371[_0x2629('0x4d')];_0x1fbe71++){if(_0xcc5371[_0x1fbe71]['system_mandatory']===![]){_0x323ef0[_0x2629('0x7b')]({'id':_0xcc5371[_0x1fbe71]['id'],'name':_0xcc5371[_0x1fbe71][_0x2629('0x7c')],'custom':_0xcc5371[_0x1fbe71][_0x2629('0x7d')],'options':_0xcc5371[_0x1fbe71][_0x2629('0x7e')]===_0x2629('0x7f')&&_0xcc5371[_0x1fbe71][_0x2629('0x80')][_0x2629('0x4d')]>-0x1?_[_0x2629('0x35')](_0xcc5371[_0x1fbe71][_0x2629('0x80')],function(_0x42210a){return{'name':_0x42210a,'value':_0x42210a};}):[]});}}return{'count':_0x323ef0[_0x2629('0x4d')],'rows':_0x323ef0};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x30f37c,null))[_0x2629('0x28')](function(_0x4e610c){var _0x2e8f8a=_0x395b70[_0x2629('0x3c')][_0x2629('0x1a')]?0x1f4:_0x4e610c['statusCode']||0x1f4;logger['error'](_0x2629('0x81'),'getFields',_0x2e8f8a,JSON[_0x2629('0x82')](_0x4e610c));delete _0x4e610c[_0x2629('0x34')];if(_0x2e8f8a===0x191){_0x2e8f8a=0x190;}_0x30f37c[_0x2629('0x2a')](_0x2e8f8a)[_0x2629('0x83')](_0x395b70['query'][_0x2629('0x1a')]?{'message':_0x2629('0x84'),'statusCode':_0x4e610c[_0x2629('0x85')]}:_0x4e610c);});}; \ No newline at end of file +var _0xe6f7=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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~!@#$%^&-_=+[{]}.','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','name','send','index','map','ZohoAccount','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','type','filter','merge','options','includeAll','include','show','params','rawAttributes','find','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getSubjects','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Subject','Description','Call_Duration','Call_Type','remove','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0xe6f7,0x1e6));var _0x7e6f=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xe6f7[_0x47e549];return _0x251374;};'use strict';var pdf=require(_0x7e6f('0x0'));var emlformat=require(_0x7e6f('0x1'));var rimraf=require(_0x7e6f('0x2'));var zipdir=require(_0x7e6f('0x3'));var jsonpatch=require(_0x7e6f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e6f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e6f('0x6'));var sox=require(_0x7e6f('0x7'));var csv=require(_0x7e6f('0x8'));var ejs=require(_0x7e6f('0x9'));var fs=require('fs');var _=require(_0x7e6f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e6f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e6f('0xb'));var qs=require(_0x7e6f('0xc'));var as=require(_0x7e6f('0xd'));var hardwareService=require(_0x7e6f('0xe'));var logger=require(_0x7e6f('0xf'))('api');var utils=require(_0x7e6f('0x10'));var config=require(_0x7e6f('0x11'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x7e6f('0x12'));var client=jayson['client'][_0x7e6f('0x13')]({'port':0x232a});function checkPasswordPattern(_0x4ea34d,_0x1815bb,_0x5ce6ba){if(_0x5ce6ba){var _0x4b0f54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b0f54[_0x7e6f('0x14')](_0x1815bb)){return _0x4ea34d;}else{throw new db[(_0x7e6f('0x15'))][(_0x7e6f('0x16'))](_0x7e6f('0x17'));}}else{return _0x4ea34d;}}function respondWithRpcPromise(_0x45210c,_0x512a02,_0x4d91ec,_0x223e9a){return new BPromise(function(_0x177522,_0x24ce35){var _0x1ad636=_0x223e9a||client;return _0x1ad636['request'](_0x45210c,_0x4d91ec)[_0x7e6f('0x18')](function(_0x458584){logger['info'](_0x7e6f('0x19'),_0x512a02,_0x7e6f('0x1a'));logger[_0x7e6f('0x1b')](_0x7e6f('0x1c'),_0x512a02,'request\x20sent',JSON[_0x7e6f('0x1d')](_0x458584));if(_0x458584['error']){if(_0x458584[_0x7e6f('0x1e')][_0x7e6f('0x1f')]===0x1f4){logger[_0x7e6f('0x1e')](_0x7e6f('0x19'),_0x512a02,_0x458584[_0x7e6f('0x1e')][_0x7e6f('0x20')]);return _0x24ce35(_0x458584[_0x7e6f('0x1e')][_0x7e6f('0x20')]);}logger[_0x7e6f('0x1e')](_0x7e6f('0x19'),_0x512a02,_0x458584[_0x7e6f('0x1e')][_0x7e6f('0x20')]);return _0x177522(_0x458584['error'][_0x7e6f('0x20')]);}else{logger['info'](_0x7e6f('0x19'),_0x512a02,'request\x20sent');_0x177522(_0x458584['result']['message']);}})[_0x7e6f('0x21')](function(_0x576b40){logger[_0x7e6f('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0x512a02,_0x576b40);_0x24ce35(_0x576b40);});});}function respondWithStatusCode(_0x40f3d7,_0x3cc33b){_0x3cc33b=_0x3cc33b||0xcc;return function(_0x4cc88d){if(_0x4cc88d){return _0x40f3d7[_0x7e6f('0x22')](_0x3cc33b);}return _0x40f3d7[_0x7e6f('0x23')](_0x3cc33b)[_0x7e6f('0x24')]();};}function respondWithResult(_0x375023,_0xe1c9e0){_0xe1c9e0=_0xe1c9e0||0xc8;return function(_0x43e1a9){if(_0x43e1a9){return _0x375023[_0x7e6f('0x23')](_0xe1c9e0)['json'](_0x43e1a9);}};}function respondWithFilteredResult(_0x594ada,_0x2ec9a9){return function(_0x45cdb2){if(_0x45cdb2){var _0x507715=_0x45cdb2[_0x7e6f('0x25')],_0x5a0162=_0x2ec9a9[_0x7e6f('0x26')],_0x20fa3a=_0x2ec9a9[_0x7e6f('0x26')]+_0x2ec9a9[_0x7e6f('0x27')],_0x1255da;if(_0x20fa3a>=_0x507715){_0x20fa3a=_0x507715;_0x1255da=0xc8;}else{_0x1255da=0xce;}_0x594ada[_0x7e6f('0x23')](_0x1255da);return _0x594ada[_0x7e6f('0x28')](_0x7e6f('0x29'),_0x5a0162+'-'+_0x20fa3a+'/'+_0x507715)[_0x7e6f('0x2a')](_0x45cdb2);}return null;};}function patchUpdates(_0x435de0){return function(_0x1e4dcb){try{jsonpatch[_0x7e6f('0x2b')](_0x1e4dcb,_0x435de0,!![]);}catch(_0x47c43b){return BPromise[_0x7e6f('0x2c')](_0x47c43b);}return _0x1e4dcb['save']();};}function saveUpdates(_0x1c7fcc,_0x570516){return function(_0x266802){if(_0x266802){return _0x266802[_0x7e6f('0x2d')](_0x1c7fcc)[_0x7e6f('0x18')](function(_0xb2ee02){return _0xb2ee02;});}return null;};}function removeEntity(_0x4acfaf,_0x20cacb){return function(_0x5e27e2){if(_0x5e27e2){return _0x5e27e2[_0x7e6f('0x2e')]()[_0x7e6f('0x18')](function(){_0x4acfaf['status'](0xcc)[_0x7e6f('0x24')]();});}};}function handleEntityNotFound(_0x4af899,_0x466188){return function(_0x2fdb9c){if(!_0x2fdb9c){_0x4af899[_0x7e6f('0x22')](0x194);}return _0x2fdb9c;};}function handleError(_0x263b74,_0x2c9db0){_0x2c9db0=_0x2c9db0||0x1f4;return function(_0x1a1518){logger[_0x7e6f('0x1e')](_0x1a1518['stack']);if(_0x1a1518[_0x7e6f('0x2f')]){delete _0x1a1518[_0x7e6f('0x2f')];}_0x263b74[_0x7e6f('0x23')](_0x2c9db0)[_0x7e6f('0x30')](_0x1a1518);};}exports[_0x7e6f('0x31')]=function(_0x3305ad,_0x3f45a2){var _0x227eaa={},_0x1dec6c={},_0x3bffaf={'count':0x0,'rows':[]};var _0xefc612=_[_0x7e6f('0x32')](db[_0x7e6f('0x33')]['rawAttributes'],function(_0x4725be){return{'name':_0x4725be[_0x7e6f('0x34')],'type':_0x4725be['type'][_0x7e6f('0x35')]};});_0x1dec6c[_0x7e6f('0x36')]=_[_0x7e6f('0x32')](_0xefc612,_0x7e6f('0x2f'));_0x1dec6c['query']=_[_0x7e6f('0x37')](_0x3305ad[_0x7e6f('0x38')]);_0x1dec6c[_0x7e6f('0x39')]=_[_0x7e6f('0x3a')](_0x1dec6c[_0x7e6f('0x36')],_0x1dec6c[_0x7e6f('0x38')]);_0x227eaa['attributes']=_[_0x7e6f('0x3a')](_0x1dec6c[_0x7e6f('0x36')],qs['fields'](_0x3305ad[_0x7e6f('0x38')][_0x7e6f('0x3b')]));_0x227eaa[_0x7e6f('0x3c')]=_0x227eaa[_0x7e6f('0x3c')][_0x7e6f('0x3d')]?_0x227eaa[_0x7e6f('0x3c')]:_0x1dec6c['model'];if(!_0x3305ad[_0x7e6f('0x38')][_0x7e6f('0x3e')](_0x7e6f('0x3f'))){_0x227eaa[_0x7e6f('0x27')]=qs[_0x7e6f('0x27')](_0x3305ad['query']['limit']);_0x227eaa['offset']=qs[_0x7e6f('0x26')](_0x3305ad[_0x7e6f('0x38')]['offset']);}_0x227eaa['order']=qs[_0x7e6f('0x40')](_0x3305ad[_0x7e6f('0x38')]['sort']);_0x227eaa['where']=qs[_0x7e6f('0x39')](_[_0x7e6f('0x41')](_0x3305ad[_0x7e6f('0x38')],_0x1dec6c['filters']),_0xefc612);if(_0x3305ad[_0x7e6f('0x38')]['filter']){_0x227eaa[_0x7e6f('0x42')]=_['merge'](_0x227eaa[_0x7e6f('0x42')],{'$or':_[_0x7e6f('0x32')](_0xefc612,function(_0x6b36b1){if(_0x6b36b1[_0x7e6f('0x43')]!=='VIRTUAL'){var _0x3ab6be={};_0x3ab6be[_0x6b36b1[_0x7e6f('0x2f')]]={'$like':'%'+_0x3305ad[_0x7e6f('0x38')][_0x7e6f('0x44')]+'%'};return _0x3ab6be;}})});}_0x227eaa=_[_0x7e6f('0x45')]({},_0x227eaa,_0x3305ad[_0x7e6f('0x46')]);var _0x54e5cb={'where':_0x227eaa[_0x7e6f('0x42')]};return db['ZohoAccount']['count'](_0x54e5cb)[_0x7e6f('0x18')](function(_0x32c7e7){_0x3bffaf[_0x7e6f('0x25')]=_0x32c7e7;if(_0x3305ad[_0x7e6f('0x38')][_0x7e6f('0x47')]){_0x227eaa[_0x7e6f('0x48')]=[{'all':!![]}];}return db[_0x7e6f('0x33')]['findAll'](_0x227eaa);})[_0x7e6f('0x18')](function(_0x2155c8){_0x3bffaf['rows']=_0x2155c8;return _0x3bffaf;})[_0x7e6f('0x18')](respondWithFilteredResult(_0x3f45a2,_0x227eaa))[_0x7e6f('0x21')](handleError(_0x3f45a2,null));};exports[_0x7e6f('0x49')]=function(_0x5d4b9a,_0x2f9f8){var _0x2c1cbe={'raw':![],'where':{'id':_0x5d4b9a[_0x7e6f('0x4a')]['id']}},_0x3aa7bf={};_0x3aa7bf[_0x7e6f('0x36')]=_[_0x7e6f('0x37')](db[_0x7e6f('0x33')][_0x7e6f('0x4b')]);_0x3aa7bf[_0x7e6f('0x38')]=_[_0x7e6f('0x37')](_0x5d4b9a[_0x7e6f('0x38')]);_0x3aa7bf['filters']=_['intersection'](_0x3aa7bf[_0x7e6f('0x36')],_0x3aa7bf['query']);_0x2c1cbe[_0x7e6f('0x3c')]=_[_0x7e6f('0x3a')](_0x3aa7bf[_0x7e6f('0x36')],qs[_0x7e6f('0x3b')](_0x5d4b9a['query']['fields']));_0x2c1cbe[_0x7e6f('0x3c')]=_0x2c1cbe[_0x7e6f('0x3c')][_0x7e6f('0x3d')]?_0x2c1cbe[_0x7e6f('0x3c')]:_0x3aa7bf['model'];if(_0x5d4b9a['query'][_0x7e6f('0x47')]){_0x2c1cbe[_0x7e6f('0x48')]=[{'all':!![]}];}_0x2c1cbe=_['merge']({},_0x2c1cbe,_0x5d4b9a[_0x7e6f('0x46')]);return db['ZohoAccount'][_0x7e6f('0x4c')](_0x2c1cbe)['then'](handleEntityNotFound(_0x2f9f8,null))[_0x7e6f('0x18')](respondWithResult(_0x2f9f8,null))['catch'](handleError(_0x2f9f8,null));};exports[_0x7e6f('0x4d')]=function(_0x9262a,_0x529460){return db[_0x7e6f('0x33')][_0x7e6f('0x4d')](_0x9262a[_0x7e6f('0x4e')],{})[_0x7e6f('0x18')](respondWithResult(_0x529460,0xc9))[_0x7e6f('0x21')](handleError(_0x529460,null));};exports['update']=function(_0x16be08,_0x5bdedf){if(_0x16be08[_0x7e6f('0x4e')]['id']){delete _0x16be08[_0x7e6f('0x4e')]['id'];}return db['ZohoAccount'][_0x7e6f('0x4c')]({'where':{'id':_0x16be08[_0x7e6f('0x4a')]['id']}})[_0x7e6f('0x18')](handleEntityNotFound(_0x5bdedf,null))[_0x7e6f('0x18')](saveUpdates(_0x16be08[_0x7e6f('0x4e')],null))[_0x7e6f('0x18')](respondWithResult(_0x5bdedf,null))[_0x7e6f('0x21')](handleError(_0x5bdedf,null));};exports[_0x7e6f('0x2e')]=function(_0x23e2ce,_0x12a08a){return db['ZohoAccount'][_0x7e6f('0x4c')]({'where':{'id':_0x23e2ce[_0x7e6f('0x4a')]['id']}})[_0x7e6f('0x18')](handleEntityNotFound(_0x12a08a,null))[_0x7e6f('0x18')](removeEntity(_0x12a08a,null))[_0x7e6f('0x21')](handleError(_0x12a08a,null));};exports[_0x7e6f('0x4f')]=function(_0x1ec59d,_0x493edd,_0x1caf0e){var _0x4ce570={};var _0xecf860={};var _0x2f792b;var _0x43e081;return db[_0x7e6f('0x33')][_0x7e6f('0x50')]({'where':{'id':_0x1ec59d[_0x7e6f('0x4a')]['id']}})[_0x7e6f('0x18')](handleEntityNotFound(_0x493edd,null))[_0x7e6f('0x18')](function(_0x3048fb){if(_0x3048fb){_0x2f792b=_0x3048fb;_0xecf860['model']=_['keys'](db[_0x7e6f('0x51')]['rawAttributes']);_0xecf860[_0x7e6f('0x38')]=_['keys'](_0x1ec59d[_0x7e6f('0x38')]);_0xecf860['filters']=_[_0x7e6f('0x3a')](_0xecf860['model'],_0xecf860[_0x7e6f('0x38')]);_0x4ce570['attributes']=_[_0x7e6f('0x3a')](_0xecf860[_0x7e6f('0x36')],qs[_0x7e6f('0x3b')](_0x1ec59d[_0x7e6f('0x38')][_0x7e6f('0x3b')]));_0x4ce570[_0x7e6f('0x3c')]=_0x4ce570['attributes'][_0x7e6f('0x3d')]?_0x4ce570[_0x7e6f('0x3c')]:_0xecf860[_0x7e6f('0x36')];_0x4ce570['order']=qs[_0x7e6f('0x40')](_0x1ec59d['query'][_0x7e6f('0x40')]);_0x4ce570[_0x7e6f('0x42')]=qs[_0x7e6f('0x39')](_[_0x7e6f('0x41')](_0x1ec59d[_0x7e6f('0x38')],_0xecf860[_0x7e6f('0x39')]));if(_0x1ec59d['query'][_0x7e6f('0x44')]){_0x4ce570[_0x7e6f('0x42')]=_[_0x7e6f('0x45')](_0x4ce570[_0x7e6f('0x42')],{'$or':_['map'](_0x4ce570[_0x7e6f('0x3c')],function(_0x23bdc9){var _0x5d1318={};_0x5d1318[_0x23bdc9]={'$like':'%'+_0x1ec59d[_0x7e6f('0x38')][_0x7e6f('0x44')]+'%'};return _0x5d1318;})});}_0x4ce570=_[_0x7e6f('0x45')]({},_0x4ce570,_0x1ec59d['options']);return _0x2f792b[_0x7e6f('0x4f')](_0x4ce570);}})[_0x7e6f('0x18')](function(_0x41e2c1){if(_0x41e2c1){_0x43e081=_0x41e2c1['length'];if(!_0x1ec59d[_0x7e6f('0x38')][_0x7e6f('0x3e')](_0x7e6f('0x3f'))){_0x4ce570[_0x7e6f('0x27')]=qs[_0x7e6f('0x27')](_0x1ec59d['query'][_0x7e6f('0x27')]);_0x4ce570['offset']=qs[_0x7e6f('0x26')](_0x1ec59d[_0x7e6f('0x38')][_0x7e6f('0x26')]);}return _0x2f792b['getConfigurations'](_0x4ce570);}})[_0x7e6f('0x18')](function(_0x5cc3a6){if(_0x5cc3a6){return _0x5cc3a6?{'count':_0x43e081,'rows':_0x5cc3a6}:null;}})[_0x7e6f('0x18')](respondWithResult(_0x493edd,null))[_0x7e6f('0x21')](handleError(_0x493edd,null));};exports[_0x7e6f('0x52')]=function(_0x297f6e,_0x3474b5,_0x41d848){if(_0x297f6e[_0x7e6f('0x4e')]['id']){delete _0x297f6e['body']['id'];}return db[_0x7e6f('0x33')][_0x7e6f('0x50')]({'where':{'id':_0x297f6e['params']['id']}})[_0x7e6f('0x18')](handleEntityNotFound(_0x3474b5,null))[_0x7e6f('0x18')](function(_0x5e981a){if(_0x5e981a){_0x297f6e['body']['AccountId']=_0x5e981a['id'];_0x297f6e[_0x7e6f('0x4e')][_0x7e6f('0x53')]=integrations[_0x7e6f('0x54')](_0x297f6e[_0x7e6f('0x4e')]['channel'],_0x297f6e[_0x7e6f('0x4e')][_0x7e6f('0x43')]);_0x297f6e[_0x7e6f('0x4e')]['Descriptions']=integrations['getDescriptions'](_0x297f6e[_0x7e6f('0x4e')]['channel'],_0x297f6e['body'][_0x7e6f('0x43')]);return db['ZohoConfiguration'][_0x7e6f('0x4d')](_0x297f6e[_0x7e6f('0x4e')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x7e6f('0x55')],'as':_0x7e6f('0x56')}]});}return null;})[_0x7e6f('0x18')](respondWithResult(_0x3474b5,null))[_0x7e6f('0x21')](handleError(_0x3474b5,null));};function getAccessToken(_0x4e04f3){return new Promise(function(_0x2b3b3f,_0x2830f5){var _0x6edbdd;switch(_0x4e04f3[_0x7e6f('0x57')]){case'US':_0x6edbdd='https://accounts.zoho.com';break;case'AU':_0x6edbdd=_0x7e6f('0x58');break;case'EU':_0x6edbdd=_0x7e6f('0x59');break;case'IN':_0x6edbdd=_0x7e6f('0x5a');break;case'CN':_0x6edbdd='https://accounts.zoho.com.cn';break;default:_0x6edbdd='https://accounts.zoho.eu';break;}var _0x5236c3={'method':_0x7e6f('0x5b'),'uri':_0x6edbdd+_0x7e6f('0x5c'),'qs':{'refresh_token':_0x4e04f3[_0x7e6f('0x5d')],'client_id':_0x4e04f3[_0x7e6f('0x5e')],'client_secret':_0x4e04f3[_0x7e6f('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5236c3)[_0x7e6f('0x18')](function(_0x18f935){if(_0x18f935[_0x7e6f('0x60')]){_0x2b3b3f(_0x18f935[_0x7e6f('0x60')]);}else{_0x2830f5('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x7e6f('0x21')](function(_0x2502a1){_0x2830f5(_0x2502a1);});});}exports[_0x7e6f('0x61')]=function(_0x476346,_0xcb40e,_0x577c37){var _0xb54372,_0x49194e,_0x1ae9df,_0x3ef434,_0x553d9a;return db[_0x7e6f('0x33')]['findOne']({'where':{'id':_0x476346[_0x7e6f('0x4a')]['id']},'attributes':['id',_0x7e6f('0x62'),'zone','clientId',_0x7e6f('0x5f'),_0x7e6f('0x63'),_0x7e6f('0x1f'),_0x7e6f('0x5d')]})[_0x7e6f('0x18')](handleEntityNotFound(_0xcb40e,null))[_0x7e6f('0x18')](function(_0x4fd429){_0x553d9a=_0x4fd429;_0xb54372=_0x553d9a[_0x7e6f('0x62')];_0x49194e=_0xb54372===_0x7e6f('0x64')?'eu':_0x7e6f('0x65');_0x1ae9df=_0x553d9a[_0x7e6f('0x63')];var _0xb23d83=_0x1ae9df[_0x7e6f('0x66')](-0x1);if(_0xb23d83==='/'||_0xb23d83==='\x5c'||_0xb23d83===':'){_0x1ae9df=_0x1ae9df[_0x7e6f('0x67')](0x0,_0x1ae9df[_0x7e6f('0x68')](_0xb23d83));}if(!_0x553d9a['refreshToken']){throw new Error(_0x7e6f('0x69'));}return getAccessToken(_0x553d9a);})[_0x7e6f('0x18')](function(_0x35cac8){if(_0x35cac8){return rp({'method':_0x7e6f('0x6a'),'uri':util[_0x7e6f('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x49194e),'qs':{'module':_0x7e6f('0x6c')},'headers':{'Authorization':_0x7e6f('0x6d')+_0x35cac8},'json':!![]});}})[_0x7e6f('0x18')](function(_0x2901cc){if(_0x2901cc){if(_0x2901cc[_0x7e6f('0x6e')]&&_0x2901cc['response'][_0x7e6f('0x1e')]){throw new Error(_0x2901cc[_0x7e6f('0x6e')]['error']['message']);}var _0x3a024a=[];var _0x338119=[];var _0x24d441=['Owner',_0x7e6f('0x6f'),_0x7e6f('0x70'),'WhoId',_0x7e6f('0x71'),'Call_Result','Call_Start_Time',_0x7e6f('0x72')];_0x338119=_[_0x7e6f('0x73')](_0x2901cc[_0x7e6f('0x3b')],function(_0x16c758){return _0x24d441['includes'](_0x16c758['api_name']);});for(var _0x202e24=0x0;_0x202e24<_0x338119[_0x7e6f('0x3d')];_0x202e24++){if(_0x338119[_0x202e24][_0x7e6f('0x74')]===![]){_0x3a024a[_0x7e6f('0x75')]({'id':_0x338119[_0x202e24]['id'],'name':_0x338119[_0x202e24][_0x7e6f('0x76')],'custom':_0x338119[_0x202e24][_0x7e6f('0x77')],'options':_0x338119[_0x202e24][_0x7e6f('0x78')]===_0x7e6f('0x79')&&_0x338119[_0x202e24][_0x7e6f('0x7a')][_0x7e6f('0x3d')]>-0x1?_[_0x7e6f('0x32')](_0x338119[_0x202e24][_0x7e6f('0x7a')],function(_0x429cdd){return{'name':_0x429cdd,'value':_0x429cdd};}):[]});}}return{'count':_0x3a024a[_0x7e6f('0x3d')],'rows':_0x3a024a};}else{return{'count':0x0,'rows':[]};}})[_0x7e6f('0x18')](respondWithResult(_0xcb40e,null))[_0x7e6f('0x21')](function(_0xb4049c){var _0x423811=_0x476346[_0x7e6f('0x38')]['test']?0x1f4:_0xb4049c['statusCode']||0x1f4;logger['error'](_0x7e6f('0x7b'),_0x7e6f('0x61'),_0x423811,JSON['stringify'](_0xb4049c));delete _0xb4049c[_0x7e6f('0x2f')];if(_0x423811===0x191){_0x423811=0x190;}_0xcb40e[_0x7e6f('0x23')](_0x423811)[_0x7e6f('0x30')](_0x476346[_0x7e6f('0x38')][_0x7e6f('0x14')]?{'message':'Wrong\x20credentials','statusCode':_0xb4049c[_0x7e6f('0x7c')]}:_0xb4049c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 8191892..d0bafb7 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 _0x87f9=['code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','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.com.cn','parse','info','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x87f9,0x162));var _0x987f=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x87f9[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x987f('0x0'));var util=require('util');var logger=require(_0x987f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x987f('0x2'));var fs=require('fs');var path=require(_0x987f('0x3'));var rimraf=require(_0x987f('0x4'));var config=require(_0x987f('0x5'));var attributes=require(_0x987f('0x6'));var integrations=require(_0x987f('0x7'));module['exports']=function(_0x538541,_0x31ffc7){return _0x538541[_0x987f('0x8')](_0x987f('0x9'),attributes,{'tableName':_0x987f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17d6aa,_0x2a0be7,_0xc1055d){if(_0x17d6aa['changed'](_0x987f('0xb'))||_0x17d6aa[_0x987f('0xc')](_0x987f('0xd'))||_0x17d6aa[_0x987f('0xc')]('clientId')||_0x17d6aa[_0x987f('0xc')](_0x987f('0xe'))||_0x17d6aa['changed'](_0x987f('0xf'))||_0x17d6aa[_0x987f('0xc')](_0x987f('0x10'))){var _0x2c9c5a,_0x5da82c;_0x2c9c5a=_0x17d6aa[_0x987f('0xd')];var _0x2a5272=_0x2c9c5a['slice'](-0x1);if(_0x2a5272==='/'||_0x2a5272==='\x5c'||_0x2a5272===':'){_0x2c9c5a=_0x2c9c5a[_0x987f('0x11')](0x0,_0x2c9c5a[_0x987f('0x12')](_0x2a5272));}switch(_0x17d6aa[_0x987f('0xb')]){case'US':_0x5da82c=_0x987f('0x13');break;case'AU':_0x5da82c=_0x987f('0x14');break;case'IN':_0x5da82c=_0x987f('0x15');break;case'CN':_0x5da82c='https://accounts.zoho.com.cn';break;default:_0x5da82c='https://accounts.zoho.eu';break;}var _0x442227={'method':_0x987f('0x16'),'uri':_0x5da82c+_0x987f('0x17'),'form':{'grant_type':_0x987f('0x18'),'client_id':_0x17d6aa[_0x987f('0x19')],'client_secret':_0x17d6aa[_0x987f('0xe')],'redirect_uri':_0x17d6aa[_0x987f('0xd')],'code':_0x17d6aa[_0x987f('0xf')]},'headers':{'Content-Type':_0x987f('0x1a')}};return rp(_0x442227)[_0x987f('0x1b')](function(_0x16bc43){var _0x40cff2=JSON['parse'](_0x16bc43);if(_0x40cff2[_0x987f('0x1c')]){_0x17d6aa[_0x987f('0x1d')]=_0x40cff2[_0x987f('0x1c')];logger['info'](util[_0x987f('0x1e')](_0x987f('0x1f'),_0x17d6aa[_0x987f('0x20')],_0x17d6aa['id']));}else{logger[_0x987f('0x21')](util[_0x987f('0x1e')](_0x987f('0x22'),_0x17d6aa['name'],_0x17d6aa['id']),util[_0x987f('0x23')](_0x40cff2,{'showHidden':![],'depth':null}));}return _0xc1055d(null,_0x2a0be7);})[_0x987f('0x24')](function(_0x1cf4c7){logger[_0x987f('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x17d6aa[_0x987f('0x20')],_0x17d6aa['id']),util[_0x987f('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xc1055d(_0x1cf4c7);});}else{return _0xc1055d(null,_0x2a0be7);}},'beforeUpdate':function(_0x56123f,_0x426e71,_0x4a1e43){if(_0x56123f['changed']('zone')||_0x56123f[_0x987f('0xc')](_0x987f('0xd'))||_0x56123f[_0x987f('0xc')](_0x987f('0x19'))||_0x56123f['changed'](_0x987f('0xe'))||_0x56123f[_0x987f('0xc')](_0x987f('0xf'))||_0x56123f[_0x987f('0xc')](_0x987f('0x10'))){var _0xde0a2d,_0x25bda5;_0xde0a2d=_0x56123f[_0x987f('0xd')];var _0x2437a4=_0xde0a2d[_0x987f('0x25')](-0x1);if(_0x2437a4==='/'||_0x2437a4==='\x5c'||_0x2437a4===':'){_0xde0a2d=_0xde0a2d[_0x987f('0x11')](0x0,_0xde0a2d[_0x987f('0x12')](_0x2437a4));}switch(_0x56123f[_0x987f('0xb')]){case'US':_0x25bda5=_0x987f('0x13');break;case'AU':_0x25bda5=_0x987f('0x14');break;case'IN':_0x25bda5=_0x987f('0x15');break;case'CN':_0x25bda5=_0x987f('0x26');break;default:_0x25bda5='https://accounts.zoho.eu';break;}var _0x2074c4={'method':_0x987f('0x16'),'uri':_0x25bda5+_0x987f('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x56123f['clientId'],'client_secret':_0x56123f[_0x987f('0xe')],'redirect_uri':_0x56123f[_0x987f('0xd')],'code':_0x56123f['code']},'headers':{'Content-Type':_0x987f('0x1a')}};return rp(_0x2074c4)[_0x987f('0x1b')](function(_0x10b38c){var _0x36d0b7=JSON[_0x987f('0x27')](_0x10b38c);if(_0x36d0b7['refresh_token']){_0x56123f['refreshToken']=_0x36d0b7[_0x987f('0x1c')];logger[_0x987f('0x28')](util[_0x987f('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x56123f[_0x987f('0x20')],_0x56123f['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x56123f[_0x987f('0x20')],_0x56123f['id']),util['inspect'](_0x36d0b7,{'showHidden':![],'depth':null}));}return _0x4a1e43(null,_0x426e71);})[_0x987f('0x24')](function(_0x2a9d82){logger[_0x987f('0x21')](util[_0x987f('0x1e')](_0x987f('0x22'),_0x56123f[_0x987f('0x20')],_0x56123f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4a1e43(_0x2a9d82);});}else{return _0x4a1e43(null,_0x426e71);}}}});}; \ No newline at end of file +var _0x8ba9=['format','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','info','name','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','clientId','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.in','POST','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded','then','refresh_token','refreshToken'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x8ba9,0x14a));var _0x98ba=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x8ba9[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x98ba('0x0'));var util=require(_0x98ba('0x1'));var logger=require(_0x98ba('0x2'))(_0x98ba('0x3'));var moment=require('moment');var BPromise=require(_0x98ba('0x4'));var rp=require(_0x98ba('0x5'));var fs=require('fs');var path=require(_0x98ba('0x6'));var rimraf=require('rimraf');var config=require(_0x98ba('0x7'));var attributes=require(_0x98ba('0x8'));var integrations=require(_0x98ba('0x9'));module[_0x98ba('0xa')]=function(_0x38170b,_0x3f280f){return _0x38170b[_0x98ba('0xb')](_0x98ba('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x429f6d,_0x286a68,_0x1dc553){if(_0x429f6d[_0x98ba('0xd')](_0x98ba('0xe'))||_0x429f6d[_0x98ba('0xd')]('serverUrl')||_0x429f6d[_0x98ba('0xd')](_0x98ba('0xf'))||_0x429f6d[_0x98ba('0xd')]('clientSecret')||_0x429f6d[_0x98ba('0xd')]('code')||_0x429f6d[_0x98ba('0xd')](_0x98ba('0x10'))){var _0x550f57,_0x5f3ab1;_0x550f57=_0x429f6d[_0x98ba('0x11')];var _0x55ec57=_0x550f57['slice'](-0x1);if(_0x55ec57==='/'||_0x55ec57==='\x5c'||_0x55ec57===':'){_0x550f57=_0x550f57[_0x98ba('0x12')](0x0,_0x550f57[_0x98ba('0x13')](_0x55ec57));}switch(_0x429f6d[_0x98ba('0xe')]){case'US':_0x5f3ab1='https://accounts.zoho.com';break;case'AU':_0x5f3ab1='https://accounts.zoho.com.au';break;case'IN':_0x5f3ab1=_0x98ba('0x14');break;case'CN':_0x5f3ab1='https://accounts.zoho.com.cn';break;default:_0x5f3ab1='https://accounts.zoho.eu';break;}var _0x1d6bd3={'method':_0x98ba('0x15'),'uri':_0x5f3ab1+_0x98ba('0x16'),'form':{'grant_type':_0x98ba('0x17'),'client_id':_0x429f6d[_0x98ba('0xf')],'client_secret':_0x429f6d[_0x98ba('0x18')],'redirect_uri':_0x429f6d[_0x98ba('0x11')],'code':_0x429f6d[_0x98ba('0x19')]},'headers':{'Content-Type':_0x98ba('0x1a')}};return rp(_0x1d6bd3)[_0x98ba('0x1b')](function(_0x1c1ab2){var _0x58aa07=JSON['parse'](_0x1c1ab2);if(_0x58aa07[_0x98ba('0x1c')]){_0x429f6d[_0x98ba('0x1d')]=_0x58aa07[_0x98ba('0x1c')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x429f6d['name'],_0x429f6d['id']));}else{logger['error'](util[_0x98ba('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x429f6d['name'],_0x429f6d['id']),util[_0x98ba('0x1f')](_0x58aa07,{'showHidden':![],'depth':null}));}return _0x1dc553(null,_0x286a68);})[_0x98ba('0x20')](function(_0x22c715){logger['error'](util['format'](_0x98ba('0x21'),_0x429f6d['name'],_0x429f6d['id']),util[_0x98ba('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x1dc553(_0x22c715);});}else{return _0x1dc553(null,_0x286a68);}},'beforeUpdate':function(_0x591d42,_0x17aeac,_0x54046f){if(_0x591d42[_0x98ba('0xd')](_0x98ba('0xe'))||_0x591d42['changed']('serverUrl')||_0x591d42[_0x98ba('0xd')](_0x98ba('0xf'))||_0x591d42[_0x98ba('0xd')]('clientSecret')||_0x591d42[_0x98ba('0xd')](_0x98ba('0x19'))||_0x591d42['changed']('host')){var _0x3fd058,_0x21018e;_0x3fd058=_0x591d42[_0x98ba('0x11')];var _0x5da904=_0x3fd058[_0x98ba('0x22')](-0x1);if(_0x5da904==='/'||_0x5da904==='\x5c'||_0x5da904===':'){_0x3fd058=_0x3fd058['substring'](0x0,_0x3fd058[_0x98ba('0x13')](_0x5da904));}switch(_0x591d42['zone']){case'US':_0x21018e='https://accounts.zoho.com';break;case'AU':_0x21018e=_0x98ba('0x23');break;case'IN':_0x21018e=_0x98ba('0x14');break;case'CN':_0x21018e=_0x98ba('0x24');break;default:_0x21018e=_0x98ba('0x25');break;}var _0x40881f={'method':'POST','uri':_0x21018e+_0x98ba('0x16'),'form':{'grant_type':'authorization_code','client_id':_0x591d42[_0x98ba('0xf')],'client_secret':_0x591d42[_0x98ba('0x18')],'redirect_uri':_0x591d42[_0x98ba('0x11')],'code':_0x591d42[_0x98ba('0x19')]},'headers':{'Content-Type':_0x98ba('0x1a')}};return rp(_0x40881f)[_0x98ba('0x1b')](function(_0x5b749f){var _0x173621=JSON['parse'](_0x5b749f);if(_0x173621['refresh_token']){_0x591d42[_0x98ba('0x1d')]=_0x173621[_0x98ba('0x1c')];logger[_0x98ba('0x26')](util[_0x98ba('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x591d42[_0x98ba('0x27')],_0x591d42['id']));}else{logger['error'](util[_0x98ba('0x1e')](_0x98ba('0x21'),_0x591d42[_0x98ba('0x27')],_0x591d42['id']),util[_0x98ba('0x1f')](_0x173621,{'showHidden':![],'depth':null}));}return _0x54046f(null,_0x17aeac);})[_0x98ba('0x20')](function(_0x404283){logger['error'](util[_0x98ba('0x1e')](_0x98ba('0x21'),_0x591d42['name'],_0x591d42['id']),util[_0x98ba('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x54046f(_0x404283);});}else{return _0x54046f(null,_0x17aeac);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 5b78f52..fbabb04 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 _0xf934=['jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','map','include','model','attributes','then','ShowZohoAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xf934,0x7d));var _0x4f93=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf934[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x4f93('0x0'));var util=require(_0x4f93('0x1'));var moment=require(_0x4f93('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f93('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f93('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f93('0x5'))(_0x4f93('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f93('0x7'));var client=jayson[_0x4f93('0x8')][_0x4f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453196,_0x357791,_0x3c0062){return new BPromise(function(_0x1af1c0,_0x5be9cb){return client[_0x4f93('0xa')](_0x453196,_0x3c0062)['then'](function(_0x42fc2e){logger[_0x4f93('0xb')](_0x4f93('0xc'),_0x357791,_0x4f93('0xd'));logger[_0x4f93('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x357791,_0x4f93('0xd'),JSON[_0x4f93('0xf')](_0x42fc2e));if(_0x42fc2e[_0x4f93('0x10')]){if(_0x42fc2e[_0x4f93('0x10')][_0x4f93('0x11')]===0x1f4){logger[_0x4f93('0x10')](_0x4f93('0xc'),_0x357791,_0x42fc2e['error'][_0x4f93('0x12')]);return _0x5be9cb(_0x42fc2e[_0x4f93('0x10')]['message']);}logger[_0x4f93('0x10')](_0x4f93('0xc'),_0x357791,_0x42fc2e[_0x4f93('0x10')][_0x4f93('0x12')]);return _0x1af1c0(_0x42fc2e[_0x4f93('0x10')]['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x357791,_0x4f93('0xd'));_0x1af1c0(_0x42fc2e['result'][_0x4f93('0x12')]);}})[_0x4f93('0x13')](function(_0x4741fd){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x357791,_0x4741fd);_0x5be9cb(_0x4741fd);});});}exports[_0x4f93('0x14')]=function(_0x3c3285){var _0x4c983a=this;return new Promise(function(_0x474d0e,_0x48c43d){return db[_0x4f93('0x15')][_0x4f93('0x16')]({'raw':_0x3c3285[_0x4f93('0x17')]?_0x3c3285[_0x4f93('0x17')][_0x4f93('0x18')]===undefined?!![]:![]:!![],'where':_0x3c3285[_0x4f93('0x17')]?_0x3c3285[_0x4f93('0x17')][_0x4f93('0x19')]||null:null,'attributes':_0x3c3285[_0x4f93('0x17')]?_0x3c3285[_0x4f93('0x17')]['attributes']||null:null,'limit':_0x3c3285[_0x4f93('0x17')]?_0x3c3285[_0x4f93('0x17')]['limit']||null:null,'include':_0x3c3285[_0x4f93('0x17')]?_0x3c3285[_0x4f93('0x17')]['include']?_[_0x4f93('0x1a')](_0x3c3285['options'][_0x4f93('0x1b')],function(_0x1432d3){return{'model':db[_0x1432d3[_0x4f93('0x1c')]],'as':_0x1432d3['as'],'attributes':_0x1432d3[_0x4f93('0x1d')],'include':_0x1432d3[_0x4f93('0x1b')]?_['map'](_0x1432d3['include'],function(_0x5f416b){return{'model':db[_0x5f416b[_0x4f93('0x1c')]],'as':_0x5f416b['as'],'attributes':_0x5f416b[_0x4f93('0x1d')],'include':_0x5f416b[_0x4f93('0x1b')]?_['map'](_0x5f416b['include'],function(_0x2229e7){return{'model':db[_0x2229e7[_0x4f93('0x1c')]],'as':_0x2229e7['as'],'attributes':_0x2229e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f93('0x1e')](function(_0x54c7ea){logger[_0x4f93('0xb')]('GetZohoAccount',_0x3c3285);logger[_0x4f93('0xe')](_0x4f93('0x14'),_0x3c3285,JSON[_0x4f93('0xf')](_0x54c7ea));_0x474d0e(_0x54c7ea);})['catch'](function(_0x20ce02){logger[_0x4f93('0x10')]('GetZohoAccount',_0x20ce02[_0x4f93('0x12')],_0x3c3285);_0x48c43d(_0x4c983a[_0x4f93('0x10')](0x1f4,_0x20ce02[_0x4f93('0x12')]));});});};exports[_0x4f93('0x1f')]=function(_0x49abae){var _0x19d06b=this;return new Promise(function(_0x78ad73,_0x3581c3){return db[_0x4f93('0x15')][_0x4f93('0x20')]({'raw':_0x49abae[_0x4f93('0x17')]?_0x49abae[_0x4f93('0x17')][_0x4f93('0x18')]===undefined?!![]:![]:!![],'where':_0x49abae[_0x4f93('0x17')]?_0x49abae['options'][_0x4f93('0x19')]||null:null,'attributes':_0x49abae[_0x4f93('0x17')]?_0x49abae['options']['attributes']||null:null,'include':_0x49abae['options']?_0x49abae[_0x4f93('0x17')]['include']?_['map'](_0x49abae[_0x4f93('0x17')][_0x4f93('0x1b')],function(_0xc9954f){return{'model':db[_0xc9954f[_0x4f93('0x1c')]],'as':_0xc9954f['as'],'attributes':_0xc9954f[_0x4f93('0x1d')],'include':_0xc9954f[_0x4f93('0x1b')]?_[_0x4f93('0x1a')](_0xc9954f[_0x4f93('0x1b')],function(_0x234394){return{'model':db[_0x234394[_0x4f93('0x1c')]],'as':_0x234394['as'],'attributes':_0x234394[_0x4f93('0x1d')],'include':_0x234394['include']?_[_0x4f93('0x1a')](_0x234394['include'],function(_0x167959){return{'model':db[_0x167959[_0x4f93('0x1c')]],'as':_0x167959['as'],'attributes':_0x167959[_0x4f93('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4f93('0x1e')](function(_0x26f6e5){logger[_0x4f93('0xb')](_0x4f93('0x1f'),_0x49abae);logger['debug'](_0x4f93('0x1f'),_0x49abae,JSON['stringify'](_0x26f6e5));_0x78ad73(_0x26f6e5);})['catch'](function(_0x3e8c7c){logger[_0x4f93('0x10')](_0x4f93('0x1f'),_0x3e8c7c[_0x4f93('0x12')],_0x49abae);_0x3581c3(_0x19d06b[_0x4f93('0x10')](0x1f4,_0x3e8c7c[_0x4f93('0x12')]));});});}; \ No newline at end of file +var _0x4128=['GetZohoAccount','ZohoAccount','findAll','options','raw','where','include','model','attributes','then','find','map','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4128,0x1a5));var _0x8412=function(_0x395e49,_0x390eac){_0x395e49=_0x395e49-0x0;var _0x5b9e39=_0x4128[_0x395e49];return _0x5b9e39;};'use strict';var _=require(_0x8412('0x0'));var util=require(_0x8412('0x1'));var moment=require(_0x8412('0x2'));var BPromise=require(_0x8412('0x3'));var rs=require(_0x8412('0x4'));var fs=require('fs');var Redis=require(_0x8412('0x5'));var db=require(_0x8412('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8412('0x7'))('rpc');var config=require(_0x8412('0x8'));var jayson=require(_0x8412('0x9'));var client=jayson['client'][_0x8412('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c017,_0x49b9bb,_0x2b6c91){return new BPromise(function(_0x259221,_0x3d86a8){return client[_0x8412('0xb')](_0x58c017,_0x2b6c91)['then'](function(_0x348845){logger[_0x8412('0xc')](_0x8412('0xd'),_0x49b9bb,_0x8412('0xe'));logger[_0x8412('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x49b9bb,_0x8412('0xe'),JSON[_0x8412('0x10')](_0x348845));if(_0x348845[_0x8412('0x11')]){if(_0x348845[_0x8412('0x11')]['code']===0x1f4){logger['error'](_0x8412('0xd'),_0x49b9bb,_0x348845[_0x8412('0x11')][_0x8412('0x12')]);return _0x3d86a8(_0x348845[_0x8412('0x11')]['message']);}logger[_0x8412('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x49b9bb,_0x348845[_0x8412('0x11')][_0x8412('0x12')]);return _0x259221(_0x348845[_0x8412('0x11')]['message']);}else{logger['info'](_0x8412('0xd'),_0x49b9bb,_0x8412('0xe'));_0x259221(_0x348845[_0x8412('0x13')]['message']);}})[_0x8412('0x14')](function(_0x11667b){logger[_0x8412('0x11')](_0x8412('0xd'),_0x49b9bb,_0x11667b);_0x3d86a8(_0x11667b);});});}exports[_0x8412('0x15')]=function(_0x55fabf){var _0x409c6a=this;return new Promise(function(_0x5eb565,_0x402c6f){return db[_0x8412('0x16')][_0x8412('0x17')]({'raw':_0x55fabf[_0x8412('0x18')]?_0x55fabf[_0x8412('0x18')][_0x8412('0x19')]===undefined?!![]:![]:!![],'where':_0x55fabf[_0x8412('0x18')]?_0x55fabf[_0x8412('0x18')][_0x8412('0x1a')]||null:null,'attributes':_0x55fabf[_0x8412('0x18')]?_0x55fabf['options']['attributes']||null:null,'limit':_0x55fabf[_0x8412('0x18')]?_0x55fabf[_0x8412('0x18')]['limit']||null:null,'include':_0x55fabf['options']?_0x55fabf['options'][_0x8412('0x1b')]?_['map'](_0x55fabf[_0x8412('0x18')][_0x8412('0x1b')],function(_0x4c512c){return{'model':db[_0x4c512c[_0x8412('0x1c')]],'as':_0x4c512c['as'],'attributes':_0x4c512c[_0x8412('0x1d')],'include':_0x4c512c[_0x8412('0x1b')]?_['map'](_0x4c512c['include'],function(_0x132065){return{'model':db[_0x132065[_0x8412('0x1c')]],'as':_0x132065['as'],'attributes':_0x132065[_0x8412('0x1d')],'include':_0x132065[_0x8412('0x1b')]?_['map'](_0x132065[_0x8412('0x1b')],function(_0x2d32cf){return{'model':db[_0x2d32cf['model']],'as':_0x2d32cf['as'],'attributes':_0x2d32cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x8412('0x1e')](function(_0x174c6c){logger['info']('GetZohoAccount',_0x55fabf);logger[_0x8412('0xf')](_0x8412('0x15'),_0x55fabf,JSON[_0x8412('0x10')](_0x174c6c));_0x5eb565(_0x174c6c);})[_0x8412('0x14')](function(_0x19e3a6){logger[_0x8412('0x11')](_0x8412('0x15'),_0x19e3a6[_0x8412('0x12')],_0x55fabf);_0x402c6f(_0x409c6a['error'](0x1f4,_0x19e3a6[_0x8412('0x12')]));});});};exports['ShowZohoAccount']=function(_0x3054a3){var _0x2ef3b5=this;return new Promise(function(_0x317f7a,_0x3ce9ca){return db[_0x8412('0x16')][_0x8412('0x1f')]({'raw':_0x3054a3[_0x8412('0x18')]?_0x3054a3[_0x8412('0x18')][_0x8412('0x19')]===undefined?!![]:![]:!![],'where':_0x3054a3[_0x8412('0x18')]?_0x3054a3[_0x8412('0x18')][_0x8412('0x1a')]||null:null,'attributes':_0x3054a3[_0x8412('0x18')]?_0x3054a3[_0x8412('0x18')][_0x8412('0x1d')]||null:null,'include':_0x3054a3[_0x8412('0x18')]?_0x3054a3['options'][_0x8412('0x1b')]?_['map'](_0x3054a3[_0x8412('0x18')][_0x8412('0x1b')],function(_0x58eb3f){return{'model':db[_0x58eb3f[_0x8412('0x1c')]],'as':_0x58eb3f['as'],'attributes':_0x58eb3f[_0x8412('0x1d')],'include':_0x58eb3f['include']?_['map'](_0x58eb3f[_0x8412('0x1b')],function(_0x18a24b){return{'model':db[_0x18a24b[_0x8412('0x1c')]],'as':_0x18a24b['as'],'attributes':_0x18a24b[_0x8412('0x1d')],'include':_0x18a24b['include']?_[_0x8412('0x20')](_0x18a24b['include'],function(_0x192c26){return{'model':db[_0x192c26['model']],'as':_0x192c26['as'],'attributes':_0x192c26['attributes']};}):[]};}):[]};}):[]:[]})[_0x8412('0x1e')](function(_0x492853){logger[_0x8412('0xc')](_0x8412('0x21'),_0x3054a3);logger[_0x8412('0xf')](_0x8412('0x21'),_0x3054a3,JSON['stringify'](_0x492853));_0x317f7a(_0x492853);})[_0x8412('0x14')](function(_0x2e44fb){logger[_0x8412('0x11')](_0x8412('0x21'),_0x2e44fb['message'],_0x3054a3);_0x3ce9ca(_0x2ef3b5['error'](0x1f4,_0x2e44fb[_0x8412('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ffd2d56..667ea99 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 _0xd3a0=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x285e4f,_0x531eae){_0x285e4f=_0x285e4f-0x0;var _0x3e2160=_0xd3a0[_0x285e4f];return _0x3e2160;};'use strict';var multer=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var path=require(_0x0d3a('0x2'));var timeout=require(_0x0d3a('0x3'));var express=require('express');var router=express[_0x0d3a('0x4')]();var auth=require(_0x0d3a('0x5'));var interaction=require(_0x0d3a('0x6'));var config=require(_0x0d3a('0x7'));var controller=require(_0x0d3a('0x8'));router['get']('/',auth[_0x0d3a('0x9')](),controller[_0x0d3a('0xa')]);router[_0x0d3a('0xb')](_0x0d3a('0xc'),auth[_0x0d3a('0x9')](),controller['show']);router[_0x0d3a('0xb')](_0x0d3a('0xd'),auth[_0x0d3a('0x9')](),controller[_0x0d3a('0xe')]);router[_0x0d3a('0xb')](_0x0d3a('0xf'),auth[_0x0d3a('0x9')](),controller['getSubjects']);router[_0x0d3a('0xb')](_0x0d3a('0x10'),auth['isAuthenticated'](),controller[_0x0d3a('0x11')]);router[_0x0d3a('0x12')]('/',auth[_0x0d3a('0x9')](),controller[_0x0d3a('0x13')]);router['put']('/:id',auth[_0x0d3a('0x9')](),controller[_0x0d3a('0x14')]);router[_0x0d3a('0x15')](_0x0d3a('0xc'),auth[_0x0d3a('0x9')](),controller[_0x0d3a('0x16')]);module[_0x0d3a('0x17')]=router; \ No newline at end of file +var _0x049e=['show','getFields','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x1db6e1,_0x27673b){var _0x2f53ab=function(_0x4947c2){while(--_0x4947c2){_0x1db6e1['push'](_0x1db6e1['shift']());}};_0x2f53ab(++_0x27673b);}(_0x049e,0x16a));var _0xe049=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x049e[_0x5ed54b];return _0x4b58c7;};'use strict';var multer=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var path=require('path');var timeout=require(_0xe049('0x2'));var express=require('express');var router=express[_0xe049('0x3')]();var auth=require(_0xe049('0x4'));var interaction=require(_0xe049('0x5'));var config=require(_0xe049('0x6'));var controller=require(_0xe049('0x7'));router['get']('/',auth[_0xe049('0x8')](),controller[_0xe049('0x9')]);router[_0xe049('0xa')](_0xe049('0xb'),auth[_0xe049('0x8')](),controller[_0xe049('0xc')]);router[_0xe049('0xa')]('/:id/fields',auth[_0xe049('0x8')](),controller[_0xe049('0xd')]);router[_0xe049('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xe049('0xe')]);router[_0xe049('0xa')](_0xe049('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xe049('0x8')](),controller[_0xe049('0x10')]);router[_0xe049('0x11')](_0xe049('0xb'),auth[_0xe049('0x8')](),controller[_0xe049('0x12')]);router[_0xe049('0x13')](_0xe049('0xb'),auth['isAuthenticated'](),controller[_0xe049('0x14')]);module[_0xe049('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 4910169..95c8cbb 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 _0xac81=['STRING','exports','lead','contact','nothing','ENUM','contact_lead'];(function(_0x264a76,_0x3d1d8e){var _0x597faf=function(_0x410529){while(--_0x410529){_0x264a76['push'](_0x264a76['shift']());}};_0x597faf(++_0x3d1d8e);}(_0xac81,0x10b));var _0x1ac8=function(_0x5dff3f,_0x40c176){_0x5dff3f=_0x5dff3f-0x0;var _0x328d33=_0xac81[_0x5dff3f];return _0x328d33;};'use strict';var Sequelize=require('sequelize');module[_0x1ac8('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x1ac8('0x1'),_0x1ac8('0x2'),_0x1ac8('0x3')),'defaultValue':_0x1ac8('0x1')},'moduleSearch':{'type':Sequelize[_0x1ac8('0x4')](_0x1ac8('0x5'),_0x1ac8('0x2'),_0x1ac8('0x1')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x1ac8('0x6')]}}; \ No newline at end of file +var _0xae5b=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x446142,_0x977d0e){var _0xf58be2=function(_0x586abd){while(--_0x586abd){_0x446142['push'](_0x446142['shift']());}};_0xf58be2(++_0x977d0e);}(_0xae5b,0x1b0));var _0xbae5=function(_0x3938b6,_0x651004){_0x3938b6=_0x3938b6-0x0;var _0x3d2f63=_0xae5b[_0x3938b6];return _0x3d2f63;};'use strict';var Sequelize=require(_0xbae5('0x0'));module[_0xbae5('0x1')]={'name':{'type':Sequelize[_0xbae5('0x2')]},'moduleCreate':{'type':Sequelize[_0xbae5('0x3')](_0xbae5('0x4'),_0xbae5('0x5'),_0xbae5('0x6')),'defaultValue':_0xbae5('0x4')},'moduleSearch':{'type':Sequelize[_0xbae5('0x3')](_0xbae5('0x7'),'contact',_0xbae5('0x4')),'defaultValue':_0xbae5('0x7')},'description':{'type':Sequelize[_0xbae5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 1ce18e9..e20bac3 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 _0xcc4a=['../../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','debug','request\x20sent','stringify','code','error','ZohoConfiguration,\x20%s,\x20%s','message','info','catch','status','end','offset','limit','set','apply','update','destroy','sendStatus','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','ZohoConfiguration','rows','show','params','create','body','find','getFields','findOne','ZohoField','pick','options','getSubjects','rawAttributes','getDescriptions','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1ff8ef,_0x36aeb3){var _0x76cfd7=function(_0x5980f3){while(--_0x5980f3){_0x1ff8ef['push'](_0x1ff8ef['shift']());}};_0x76cfd7(++_0x36aeb3);}(_0xcc4a,0x1a2));var _0xacc4=function(_0xabc969,_0x3be113){_0xabc969=_0xabc969-0x0;var _0x436f3c=_0xcc4a[_0xabc969];return _0x436f3c;};'use strict';var pdf=require(_0xacc4('0x0'));var emlformat=require(_0xacc4('0x1'));var rimraf=require(_0xacc4('0x2'));var zipdir=require(_0xacc4('0x3'));var jsonpatch=require(_0xacc4('0x4'));var rp=require('request-promise');var moment=require(_0xacc4('0x5'));var BPromise=require(_0xacc4('0x6'));var Mustache=require('mustache');var util=require(_0xacc4('0x7'));var path=require('path');var sox=require(_0xacc4('0x8'));var csv=require('to-csv');var ejs=require(_0xacc4('0x9'));var fs=require('fs');var _=require(_0xacc4('0xa'));var squel=require('squel');var crypto=require(_0xacc4('0xb'));var jsforce=require(_0xacc4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xacc4('0xd'));var querystring=require(_0xacc4('0xe'));var Papa=require(_0xacc4('0xf'));var Redis=require(_0xacc4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xacc4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacc4('0x12'));var logger=require(_0xacc4('0x13'))(_0xacc4('0x14'));var utils=require(_0xacc4('0x15'));var config=require(_0xacc4('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xacc4('0x17'));var client=jayson['client'][_0xacc4('0x18')]({'port':0x232a});function checkPasswordPattern(_0x175421,_0x53635e,_0x16e44c){if(_0x16e44c){var _0x397478=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x397478[_0xacc4('0x19')](_0x53635e)){return _0x175421;}else{throw new db[(_0xacc4('0x1a'))]['ValidationError'](_0xacc4('0x1b'));}}else{return _0x175421;}}function respondWithRpcPromise(_0x593f9a,_0x3db256,_0x4ff3ab,_0x145f0c){return new BPromise(function(_0x12c055,_0x4ad0ab){var _0x36abd8=_0x145f0c||client;return _0x36abd8[_0xacc4('0x1c')](_0x593f9a,_0x4ff3ab)[_0xacc4('0x1d')](function(_0x2427fa){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3db256,'request\x20sent');logger[_0xacc4('0x1e')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3db256,_0xacc4('0x1f'),JSON[_0xacc4('0x20')](_0x2427fa));if(_0x2427fa['error']){if(_0x2427fa['error'][_0xacc4('0x21')]===0x1f4){logger[_0xacc4('0x22')](_0xacc4('0x23'),_0x3db256,_0x2427fa[_0xacc4('0x22')][_0xacc4('0x24')]);return _0x4ad0ab(_0x2427fa['error'][_0xacc4('0x24')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3db256,_0x2427fa[_0xacc4('0x22')][_0xacc4('0x24')]);return _0x12c055(_0x2427fa['error'][_0xacc4('0x24')]);}else{logger[_0xacc4('0x25')](_0xacc4('0x23'),_0x3db256,_0xacc4('0x1f'));_0x12c055(_0x2427fa['result'][_0xacc4('0x24')]);}})[_0xacc4('0x26')](function(_0x476568){logger[_0xacc4('0x22')](_0xacc4('0x23'),_0x3db256,_0x476568);_0x4ad0ab(_0x476568);});});}function respondWithStatusCode(_0x1f58f1,_0x14670c){_0x14670c=_0x14670c||0xcc;return function(_0x51d18c){if(_0x51d18c){return _0x1f58f1['sendStatus'](_0x14670c);}return _0x1f58f1[_0xacc4('0x27')](_0x14670c)[_0xacc4('0x28')]();};}function respondWithResult(_0xc3871a,_0x132908){_0x132908=_0x132908||0xc8;return function(_0x3334b9){if(_0x3334b9){return _0xc3871a[_0xacc4('0x27')](_0x132908)['json'](_0x3334b9);}};}function respondWithFilteredResult(_0x257fa9,_0x38364d){return function(_0x2eb012){if(_0x2eb012){var _0x551022=_0x2eb012['count'],_0xcbb0b0=_0x38364d[_0xacc4('0x29')],_0x44dfa4=_0x38364d[_0xacc4('0x29')]+_0x38364d[_0xacc4('0x2a')],_0x136326;if(_0x44dfa4>=_0x551022){_0x44dfa4=_0x551022;_0x136326=0xc8;}else{_0x136326=0xce;}_0x257fa9[_0xacc4('0x27')](_0x136326);return _0x257fa9[_0xacc4('0x2b')]('Content-Range',_0xcbb0b0+'-'+_0x44dfa4+'/'+_0x551022)['json'](_0x2eb012);}return null;};}function patchUpdates(_0x2be3f4){return function(_0x41042f){try{jsonpatch[_0xacc4('0x2c')](_0x41042f,_0x2be3f4,!![]);}catch(_0x59dd5b){return BPromise['reject'](_0x59dd5b);}return _0x41042f['save']();};}function saveUpdates(_0x445db0,_0x2f8443){return function(_0x9f2376){if(_0x9f2376){return _0x9f2376[_0xacc4('0x2d')](_0x445db0)[_0xacc4('0x1d')](function(_0x13abb0){return _0x13abb0;});}return null;};}function removeEntity(_0x203857,_0x5d37b0){return function(_0x57c823){if(_0x57c823){return _0x57c823[_0xacc4('0x2e')]()[_0xacc4('0x1d')](function(){_0x203857['status'](0xcc)[_0xacc4('0x28')]();});}};}function handleEntityNotFound(_0x3cc133,_0x500914){return function(_0xf17a79){if(!_0xf17a79){_0x3cc133[_0xacc4('0x2f')](0x194);}return _0xf17a79;};}function handleError(_0x311670,_0x1c7b70){_0x1c7b70=_0x1c7b70||0x1f4;return function(_0x2d30d3){logger[_0xacc4('0x22')](_0x2d30d3['stack']);if(_0x2d30d3['name']){delete _0x2d30d3[_0xacc4('0x30')];}_0x311670[_0xacc4('0x27')](_0x1c7b70)['send'](_0x2d30d3);};}exports[_0xacc4('0x31')]=function(_0x3ff60c,_0x42adc9){var _0x52276f={},_0x524bf3={},_0x150eb1={'count':0x0,'rows':[]};var _0x4b1e4f=_[_0xacc4('0x32')](db['ZohoConfiguration']['rawAttributes'],function(_0x37504d){return{'name':_0x37504d[_0xacc4('0x33')],'type':_0x37504d[_0xacc4('0x34')][_0xacc4('0x35')]};});_0x524bf3[_0xacc4('0x36')]=_[_0xacc4('0x32')](_0x4b1e4f,_0xacc4('0x30'));_0x524bf3[_0xacc4('0x37')]=_[_0xacc4('0x38')](_0x3ff60c[_0xacc4('0x37')]);_0x524bf3[_0xacc4('0x39')]=_['intersection'](_0x524bf3['model'],_0x524bf3[_0xacc4('0x37')]);_0x52276f[_0xacc4('0x3a')]=_[_0xacc4('0x3b')](_0x524bf3[_0xacc4('0x36')],qs['fields'](_0x3ff60c[_0xacc4('0x37')][_0xacc4('0x3c')]));_0x52276f[_0xacc4('0x3a')]=_0x52276f[_0xacc4('0x3a')][_0xacc4('0x3d')]?_0x52276f['attributes']:_0x524bf3[_0xacc4('0x36')];if(!_0x3ff60c[_0xacc4('0x37')]['hasOwnProperty'](_0xacc4('0x3e'))){_0x52276f[_0xacc4('0x2a')]=qs[_0xacc4('0x2a')](_0x3ff60c['query']['limit']);_0x52276f[_0xacc4('0x29')]=qs['offset'](_0x3ff60c[_0xacc4('0x37')][_0xacc4('0x29')]);}_0x52276f[_0xacc4('0x3f')]=qs['sort'](_0x3ff60c[_0xacc4('0x37')][_0xacc4('0x40')]);_0x52276f[_0xacc4('0x41')]=qs['filters'](_['pick'](_0x3ff60c['query'],_0x524bf3['filters']),_0x4b1e4f);if(_0x3ff60c[_0xacc4('0x37')][_0xacc4('0x42')]){_0x52276f[_0xacc4('0x41')]=_[_0xacc4('0x43')](_0x52276f['where'],{'$or':_[_0xacc4('0x32')](_0x4b1e4f,function(_0x3483e9){if(_0x3483e9[_0xacc4('0x34')]!==_0xacc4('0x44')){var _0x3d794f={};_0x3d794f[_0x3483e9[_0xacc4('0x30')]]={'$like':'%'+_0x3ff60c['query'][_0xacc4('0x42')]+'%'};return _0x3d794f;}})});}_0x52276f=_['merge']({},_0x52276f,_0x3ff60c['options']);var _0x432579={'where':_0x52276f['where']};return db['ZohoConfiguration'][_0xacc4('0x45')](_0x432579)[_0xacc4('0x1d')](function(_0x3b4253){_0x150eb1[_0xacc4('0x45')]=_0x3b4253;if(_0x3ff60c[_0xacc4('0x37')][_0xacc4('0x46')]){_0x52276f[_0xacc4('0x47')]=[{'all':!![]}];}return db[_0xacc4('0x48')]['findAll'](_0x52276f);})['then'](function(_0x4a5bea){_0x150eb1[_0xacc4('0x49')]=_0x4a5bea;return _0x150eb1;})['then'](respondWithFilteredResult(_0x42adc9,_0x52276f))[_0xacc4('0x26')](handleError(_0x42adc9,null));};exports[_0xacc4('0x4a')]=function(_0x2ac2cc,_0x142e54){var _0x4f0616={'raw':![],'where':{'id':_0x2ac2cc[_0xacc4('0x4b')]['id']}},_0x589629={};_0x589629[_0xacc4('0x36')]=_['keys'](db[_0xacc4('0x48')]['rawAttributes']);_0x589629[_0xacc4('0x37')]=_['keys'](_0x2ac2cc[_0xacc4('0x37')]);_0x589629['filters']=_['intersection'](_0x589629[_0xacc4('0x36')],_0x589629['query']);_0x4f0616[_0xacc4('0x3a')]=_[_0xacc4('0x3b')](_0x589629[_0xacc4('0x36')],qs[_0xacc4('0x3c')](_0x2ac2cc[_0xacc4('0x37')][_0xacc4('0x3c')]));_0x4f0616[_0xacc4('0x3a')]=_0x4f0616[_0xacc4('0x3a')]['length']?_0x4f0616['attributes']:_0x589629['model'];if(_0x2ac2cc[_0xacc4('0x37')][_0xacc4('0x46')]){_0x4f0616[_0xacc4('0x47')]=[{'all':!![]}];}_0x4f0616=_['merge']({},_0x4f0616,_0x2ac2cc['options']);return db[_0xacc4('0x48')]['find'](_0x4f0616)[_0xacc4('0x1d')](handleEntityNotFound(_0x142e54,null))[_0xacc4('0x1d')](respondWithResult(_0x142e54,null))[_0xacc4('0x26')](handleError(_0x142e54,null));};exports[_0xacc4('0x4c')]=function(_0x10f7f6,_0x42d978){return db[_0xacc4('0x48')]['create'](_0x10f7f6[_0xacc4('0x4d')],{})[_0xacc4('0x1d')](respondWithResult(_0x42d978,0xc9))[_0xacc4('0x26')](handleError(_0x42d978,null));};exports[_0xacc4('0x2d')]=function(_0xe9af7d,_0x17c911){if(_0xe9af7d[_0xacc4('0x4d')]['id']){delete _0xe9af7d['body']['id'];}return db[_0xacc4('0x48')][_0xacc4('0x4e')]({'where':{'id':_0xe9af7d[_0xacc4('0x4b')]['id']}})[_0xacc4('0x1d')](handleEntityNotFound(_0x17c911,null))[_0xacc4('0x1d')](saveUpdates(_0xe9af7d['body'],null))[_0xacc4('0x1d')](respondWithResult(_0x17c911,null))[_0xacc4('0x26')](handleError(_0x17c911,null));};exports[_0xacc4('0x2e')]=function(_0x13232f,_0x42253b){return db[_0xacc4('0x48')][_0xacc4('0x4e')]({'where':{'id':_0x13232f[_0xacc4('0x4b')]['id']}})[_0xacc4('0x1d')](handleEntityNotFound(_0x42253b,null))['then'](removeEntity(_0x42253b,null))[_0xacc4('0x26')](handleError(_0x42253b,null));};exports[_0xacc4('0x4f')]=function(_0x3e57b7,_0x79c25a,_0x3b9e97){var _0x5d04e6={};var _0x252be5={};var _0x413979;var _0x189693;return db[_0xacc4('0x48')][_0xacc4('0x50')]({'where':{'id':_0x3e57b7[_0xacc4('0x4b')]['id']}})[_0xacc4('0x1d')](handleEntityNotFound(_0x79c25a,null))[_0xacc4('0x1d')](function(_0x26cdae){if(_0x26cdae){_0x413979=_0x26cdae;_0x252be5['model']=_[_0xacc4('0x38')](db[_0xacc4('0x51')]['rawAttributes']);_0x252be5[_0xacc4('0x37')]=_[_0xacc4('0x38')](_0x3e57b7['query']);_0x252be5[_0xacc4('0x39')]=_['intersection'](_0x252be5[_0xacc4('0x36')],_0x252be5[_0xacc4('0x37')]);_0x5d04e6['attributes']=_[_0xacc4('0x3b')](_0x252be5['model'],qs['fields'](_0x3e57b7[_0xacc4('0x37')]['fields']));_0x5d04e6['attributes']=_0x5d04e6[_0xacc4('0x3a')][_0xacc4('0x3d')]?_0x5d04e6[_0xacc4('0x3a')]:_0x252be5[_0xacc4('0x36')];_0x5d04e6['order']=qs[_0xacc4('0x40')](_0x3e57b7[_0xacc4('0x37')][_0xacc4('0x40')]);_0x5d04e6[_0xacc4('0x41')]=qs['filters'](_[_0xacc4('0x52')](_0x3e57b7[_0xacc4('0x37')],_0x252be5[_0xacc4('0x39')]));if(_0x3e57b7['query'][_0xacc4('0x42')]){_0x5d04e6[_0xacc4('0x41')]=_[_0xacc4('0x43')](_0x5d04e6[_0xacc4('0x41')],{'$or':_[_0xacc4('0x32')](_0x5d04e6['attributes'],function(_0x462b6f){var _0x5c7bcf={};_0x5c7bcf[_0x462b6f]={'$like':'%'+_0x3e57b7[_0xacc4('0x37')]['filter']+'%'};return _0x5c7bcf;})});}_0x5d04e6=_['merge']({},_0x5d04e6,_0x3e57b7[_0xacc4('0x53')]);return _0x413979['getFields'](_0x5d04e6);}})[_0xacc4('0x1d')](function(_0x13c12d){if(_0x13c12d){_0x189693=_0x13c12d[_0xacc4('0x3d')];if(!_0x3e57b7[_0xacc4('0x37')]['hasOwnProperty'](_0xacc4('0x3e'))){_0x5d04e6[_0xacc4('0x2a')]=qs[_0xacc4('0x2a')](_0x3e57b7[_0xacc4('0x37')]['limit']);_0x5d04e6[_0xacc4('0x29')]=qs[_0xacc4('0x29')](_0x3e57b7[_0xacc4('0x37')][_0xacc4('0x29')]);}return _0x413979['getFields'](_0x5d04e6);}})[_0xacc4('0x1d')](function(_0x378963){if(_0x378963){return _0x378963?{'count':_0x189693,'rows':_0x378963}:null;}})[_0xacc4('0x1d')](respondWithResult(_0x79c25a,null))[_0xacc4('0x26')](handleError(_0x79c25a,null));};exports[_0xacc4('0x54')]=function(_0x23c16f,_0x57a0eb,_0x53cfb9){var _0x2f6c48={};var _0x19c07b={};var _0x25a683;var _0x45a27a;return db[_0xacc4('0x48')]['findOne']({'where':{'id':_0x23c16f[_0xacc4('0x4b')]['id']}})[_0xacc4('0x1d')](handleEntityNotFound(_0x57a0eb,null))[_0xacc4('0x1d')](function(_0x593ad0){if(_0x593ad0){_0x25a683=_0x593ad0;_0x19c07b[_0xacc4('0x36')]=_[_0xacc4('0x38')](db[_0xacc4('0x51')][_0xacc4('0x55')]);_0x19c07b[_0xacc4('0x37')]=_[_0xacc4('0x38')](_0x23c16f['query']);_0x19c07b['filters']=_[_0xacc4('0x3b')](_0x19c07b['model'],_0x19c07b[_0xacc4('0x37')]);_0x2f6c48[_0xacc4('0x3a')]=_['intersection'](_0x19c07b[_0xacc4('0x36')],qs[_0xacc4('0x3c')](_0x23c16f[_0xacc4('0x37')][_0xacc4('0x3c')]));_0x2f6c48['attributes']=_0x2f6c48[_0xacc4('0x3a')][_0xacc4('0x3d')]?_0x2f6c48[_0xacc4('0x3a')]:_0x19c07b[_0xacc4('0x36')];_0x2f6c48[_0xacc4('0x3f')]=qs[_0xacc4('0x40')](_0x23c16f[_0xacc4('0x37')][_0xacc4('0x40')]);_0x2f6c48[_0xacc4('0x41')]=qs[_0xacc4('0x39')](_[_0xacc4('0x52')](_0x23c16f[_0xacc4('0x37')],_0x19c07b[_0xacc4('0x39')]));if(_0x23c16f[_0xacc4('0x37')][_0xacc4('0x42')]){_0x2f6c48[_0xacc4('0x41')]=_[_0xacc4('0x43')](_0x2f6c48[_0xacc4('0x41')],{'$or':_[_0xacc4('0x32')](_0x2f6c48[_0xacc4('0x3a')],function(_0x58dc0d){var _0x419397={};_0x419397[_0x58dc0d]={'$like':'%'+_0x23c16f[_0xacc4('0x37')][_0xacc4('0x42')]+'%'};return _0x419397;})});}_0x2f6c48=_[_0xacc4('0x43')]({},_0x2f6c48,_0x23c16f[_0xacc4('0x53')]);return _0x25a683[_0xacc4('0x54')](_0x2f6c48);}})[_0xacc4('0x1d')](function(_0xae613f){if(_0xae613f){_0x45a27a=_0xae613f[_0xacc4('0x3d')];if(!_0x23c16f['query']['hasOwnProperty'](_0xacc4('0x3e'))){_0x2f6c48[_0xacc4('0x2a')]=qs[_0xacc4('0x2a')](_0x23c16f['query'][_0xacc4('0x2a')]);_0x2f6c48['offset']=qs[_0xacc4('0x29')](_0x23c16f[_0xacc4('0x37')]['offset']);}return _0x25a683[_0xacc4('0x54')](_0x2f6c48);}})['then'](function(_0x335fe5){if(_0x335fe5){return _0x335fe5?{'count':_0x45a27a,'rows':_0x335fe5}:null;}})[_0xacc4('0x1d')](respondWithResult(_0x57a0eb,null))[_0xacc4('0x26')](handleError(_0x57a0eb,null));};exports[_0xacc4('0x56')]=function(_0xd1268c,_0x530009,_0x1dbc6e){var _0x7f9b6={};var _0x3740b3={};var _0x10767e;var _0x434b2d;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xd1268c[_0xacc4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x530009,null))['then'](function(_0x541f1c){if(_0x541f1c){_0x10767e=_0x541f1c;_0x3740b3[_0xacc4('0x36')]=_[_0xacc4('0x38')](db[_0xacc4('0x51')][_0xacc4('0x55')]);_0x3740b3[_0xacc4('0x37')]=_['keys'](_0xd1268c[_0xacc4('0x37')]);_0x3740b3['filters']=_[_0xacc4('0x3b')](_0x3740b3['model'],_0x3740b3[_0xacc4('0x37')]);_0x7f9b6[_0xacc4('0x3a')]=_[_0xacc4('0x3b')](_0x3740b3[_0xacc4('0x36')],qs[_0xacc4('0x3c')](_0xd1268c[_0xacc4('0x37')]['fields']));_0x7f9b6[_0xacc4('0x3a')]=_0x7f9b6[_0xacc4('0x3a')][_0xacc4('0x3d')]?_0x7f9b6[_0xacc4('0x3a')]:_0x3740b3['model'];_0x7f9b6[_0xacc4('0x3f')]=qs['sort'](_0xd1268c[_0xacc4('0x37')]['sort']);_0x7f9b6['where']=qs[_0xacc4('0x39')](_[_0xacc4('0x52')](_0xd1268c[_0xacc4('0x37')],_0x3740b3[_0xacc4('0x39')]));if(_0xd1268c['query']['filter']){_0x7f9b6[_0xacc4('0x41')]=_['merge'](_0x7f9b6[_0xacc4('0x41')],{'$or':_[_0xacc4('0x32')](_0x7f9b6[_0xacc4('0x3a')],function(_0x48b785){var _0x4af16d={};_0x4af16d[_0x48b785]={'$like':'%'+_0xd1268c['query']['filter']+'%'};return _0x4af16d;})});}_0x7f9b6=_['merge']({},_0x7f9b6,_0xd1268c['options']);return _0x10767e[_0xacc4('0x56')](_0x7f9b6);}})['then'](function(_0x2ce931){if(_0x2ce931){_0x434b2d=_0x2ce931['length'];if(!_0xd1268c[_0xacc4('0x37')][_0xacc4('0x57')](_0xacc4('0x3e'))){_0x7f9b6['limit']=qs[_0xacc4('0x2a')](_0xd1268c[_0xacc4('0x37')]['limit']);_0x7f9b6['offset']=qs[_0xacc4('0x29')](_0xd1268c[_0xacc4('0x37')][_0xacc4('0x29')]);}return _0x10767e[_0xacc4('0x56')](_0x7f9b6);}})[_0xacc4('0x1d')](function(_0x5d286c){if(_0x5d286c){return _0x5d286c?{'count':_0x434b2d,'rows':_0x5d286c}:null;}})['then'](respondWithResult(_0x530009,null))[_0xacc4('0x26')](handleError(_0x530009,null));}; \ No newline at end of file +var _0x9156=['error','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','length','find','create','body','params','getFields','ZohoField','pick','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','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','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2df5e9,_0x3f8482){var _0x44aac3=function(_0x4fbbf4){while(--_0x4fbbf4){_0x2df5e9['push'](_0x2df5e9['shift']());}};_0x44aac3(++_0x3f8482);}(_0x9156,0xef));var _0x6915=function(_0x46c538,_0x551641){_0x46c538=_0x46c538-0x0;var _0x519290=_0x9156[_0x46c538];return _0x519290;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6915('0x0'));var jsonpatch=require(_0x6915('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6915('0x2'));var Mustache=require(_0x6915('0x3'));var util=require(_0x6915('0x4'));var path=require('path');var sox=require(_0x6915('0x5'));var csv=require(_0x6915('0x6'));var ejs=require(_0x6915('0x7'));var fs=require('fs');var _=require(_0x6915('0x8'));var squel=require(_0x6915('0x9'));var crypto=require(_0x6915('0xa'));var jsforce=require(_0x6915('0xb'));var deskjs=require(_0x6915('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6915('0xd'));var Papa=require(_0x6915('0xe'));var Redis=require(_0x6915('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6915('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6915('0x11'));var logger=require(_0x6915('0x12'))('api');var utils=require(_0x6915('0x13'));var config=require('../../config/environment');var db=require(_0x6915('0x14'))['db'];var jayson=require(_0x6915('0x15'));var client=jayson[_0x6915('0x16')][_0x6915('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5a143a,_0x327e73,_0x5f4bda){if(_0x5f4bda){var _0x1ec5a4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ec5a4[_0x6915('0x18')](_0x327e73)){return _0x5a143a;}else{throw new db[(_0x6915('0x19'))]['ValidationError'](_0x6915('0x1a'));}}else{return _0x5a143a;}}function respondWithRpcPromise(_0x1a7884,_0x200316,_0x592e,_0x5c25ec){return new BPromise(function(_0x3774e8,_0x56f6dc){var _0x2328d0=_0x5c25ec||client;return _0x2328d0[_0x6915('0x1b')](_0x1a7884,_0x592e)[_0x6915('0x1c')](function(_0x20a78e){logger[_0x6915('0x1d')](_0x6915('0x1e'),_0x200316,_0x6915('0x1f'));logger[_0x6915('0x20')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x200316,_0x6915('0x1f'),JSON[_0x6915('0x21')](_0x20a78e));if(_0x20a78e[_0x6915('0x22')]){if(_0x20a78e[_0x6915('0x22')]['code']===0x1f4){logger[_0x6915('0x22')](_0x6915('0x1e'),_0x200316,_0x20a78e[_0x6915('0x22')]['message']);return _0x56f6dc(_0x20a78e['error']['message']);}logger[_0x6915('0x22')](_0x6915('0x1e'),_0x200316,_0x20a78e['error'][_0x6915('0x23')]);return _0x3774e8(_0x20a78e['error']['message']);}else{logger[_0x6915('0x1d')](_0x6915('0x1e'),_0x200316,_0x6915('0x1f'));_0x3774e8(_0x20a78e[_0x6915('0x24')][_0x6915('0x23')]);}})[_0x6915('0x25')](function(_0x11bf33){logger[_0x6915('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x200316,_0x11bf33);_0x56f6dc(_0x11bf33);});});}function respondWithStatusCode(_0x1a6085,_0x1c5e08){_0x1c5e08=_0x1c5e08||0xcc;return function(_0x3a6be6){if(_0x3a6be6){return _0x1a6085[_0x6915('0x26')](_0x1c5e08);}return _0x1a6085[_0x6915('0x27')](_0x1c5e08)[_0x6915('0x28')]();};}function respondWithResult(_0xb4bdd8,_0x145e2b){_0x145e2b=_0x145e2b||0xc8;return function(_0x24cbcc){if(_0x24cbcc){return _0xb4bdd8[_0x6915('0x27')](_0x145e2b)['json'](_0x24cbcc);}};}function respondWithFilteredResult(_0x6cb5a4,_0x17f358){return function(_0x465b2a){if(_0x465b2a){var _0x457750=_0x465b2a[_0x6915('0x29')],_0x1cbb7b=_0x17f358[_0x6915('0x2a')],_0x4f06ed=_0x17f358['offset']+_0x17f358['limit'],_0x5d8e91;if(_0x4f06ed>=_0x457750){_0x4f06ed=_0x457750;_0x5d8e91=0xc8;}else{_0x5d8e91=0xce;}_0x6cb5a4['status'](_0x5d8e91);return _0x6cb5a4[_0x6915('0x2b')](_0x6915('0x2c'),_0x1cbb7b+'-'+_0x4f06ed+'/'+_0x457750)[_0x6915('0x2d')](_0x465b2a);}return null;};}function patchUpdates(_0x1becb8){return function(_0x550f16){try{jsonpatch[_0x6915('0x2e')](_0x550f16,_0x1becb8,!![]);}catch(_0x2deb15){return BPromise[_0x6915('0x2f')](_0x2deb15);}return _0x550f16[_0x6915('0x30')]();};}function saveUpdates(_0x1fe2b2,_0x3efc00){return function(_0x4ad5e3){if(_0x4ad5e3){return _0x4ad5e3[_0x6915('0x31')](_0x1fe2b2)['then'](function(_0x1bff29){return _0x1bff29;});}return null;};}function removeEntity(_0x40ca16,_0x4a65e1){return function(_0x209028){if(_0x209028){return _0x209028[_0x6915('0x32')]()[_0x6915('0x1c')](function(){_0x40ca16[_0x6915('0x27')](0xcc)[_0x6915('0x28')]();});}};}function handleEntityNotFound(_0x57d215,_0x35d3a0){return function(_0x407bf3){if(!_0x407bf3){_0x57d215[_0x6915('0x26')](0x194);}return _0x407bf3;};}function handleError(_0x57279d,_0x30937c){_0x30937c=_0x30937c||0x1f4;return function(_0x3103ae){logger[_0x6915('0x22')](_0x3103ae[_0x6915('0x33')]);if(_0x3103ae[_0x6915('0x34')]){delete _0x3103ae['name'];}_0x57279d[_0x6915('0x27')](_0x30937c)[_0x6915('0x35')](_0x3103ae);};}exports[_0x6915('0x36')]=function(_0x1724a1,_0x558823){var _0x5e76bf={},_0x111fcf={},_0x583322={'count':0x0,'rows':[]};var _0x49c7ee=_[_0x6915('0x37')](db[_0x6915('0x38')][_0x6915('0x39')],function(_0x413d0e){return{'name':_0x413d0e['fieldName'],'type':_0x413d0e[_0x6915('0x3a')]['key']};});_0x111fcf[_0x6915('0x3b')]=_[_0x6915('0x37')](_0x49c7ee,_0x6915('0x34'));_0x111fcf[_0x6915('0x3c')]=_[_0x6915('0x3d')](_0x1724a1['query']);_0x111fcf[_0x6915('0x3e')]=_[_0x6915('0x3f')](_0x111fcf[_0x6915('0x3b')],_0x111fcf[_0x6915('0x3c')]);_0x5e76bf[_0x6915('0x40')]=_[_0x6915('0x3f')](_0x111fcf[_0x6915('0x3b')],qs[_0x6915('0x41')](_0x1724a1['query']['fields']));_0x5e76bf[_0x6915('0x40')]=_0x5e76bf[_0x6915('0x40')]['length']?_0x5e76bf[_0x6915('0x40')]:_0x111fcf[_0x6915('0x3b')];if(!_0x1724a1[_0x6915('0x3c')][_0x6915('0x42')](_0x6915('0x43'))){_0x5e76bf[_0x6915('0x44')]=qs[_0x6915('0x44')](_0x1724a1[_0x6915('0x3c')][_0x6915('0x44')]);_0x5e76bf[_0x6915('0x2a')]=qs[_0x6915('0x2a')](_0x1724a1[_0x6915('0x3c')][_0x6915('0x2a')]);}_0x5e76bf[_0x6915('0x45')]=qs[_0x6915('0x46')](_0x1724a1[_0x6915('0x3c')][_0x6915('0x46')]);_0x5e76bf[_0x6915('0x47')]=qs[_0x6915('0x3e')](_['pick'](_0x1724a1['query'],_0x111fcf['filters']),_0x49c7ee);if(_0x1724a1[_0x6915('0x3c')][_0x6915('0x48')]){_0x5e76bf['where']=_[_0x6915('0x49')](_0x5e76bf[_0x6915('0x47')],{'$or':_['map'](_0x49c7ee,function(_0x32c548){if(_0x32c548['type']!==_0x6915('0x4a')){var _0x2cd023={};_0x2cd023[_0x32c548['name']]={'$like':'%'+_0x1724a1[_0x6915('0x3c')][_0x6915('0x48')]+'%'};return _0x2cd023;}})});}_0x5e76bf=_[_0x6915('0x49')]({},_0x5e76bf,_0x1724a1[_0x6915('0x4b')]);var _0x33d448={'where':_0x5e76bf[_0x6915('0x47')]};return db[_0x6915('0x38')]['count'](_0x33d448)[_0x6915('0x1c')](function(_0x13ae58){_0x583322[_0x6915('0x29')]=_0x13ae58;if(_0x1724a1['query']['includeAll']){_0x5e76bf[_0x6915('0x4c')]=[{'all':!![]}];}return db[_0x6915('0x38')][_0x6915('0x4d')](_0x5e76bf);})['then'](function(_0x241eb2){_0x583322[_0x6915('0x4e')]=_0x241eb2;return _0x583322;})[_0x6915('0x1c')](respondWithFilteredResult(_0x558823,_0x5e76bf))['catch'](handleError(_0x558823,null));};exports[_0x6915('0x4f')]=function(_0x3efcd0,_0x2029f6){var _0x1a8f0b={'raw':![],'where':{'id':_0x3efcd0['params']['id']}},_0x1b4100={};_0x1b4100[_0x6915('0x3b')]=_[_0x6915('0x3d')](db[_0x6915('0x38')][_0x6915('0x39')]);_0x1b4100[_0x6915('0x3c')]=_[_0x6915('0x3d')](_0x3efcd0[_0x6915('0x3c')]);_0x1b4100['filters']=_[_0x6915('0x3f')](_0x1b4100['model'],_0x1b4100[_0x6915('0x3c')]);_0x1a8f0b['attributes']=_[_0x6915('0x3f')](_0x1b4100[_0x6915('0x3b')],qs[_0x6915('0x41')](_0x3efcd0['query'][_0x6915('0x41')]));_0x1a8f0b[_0x6915('0x40')]=_0x1a8f0b['attributes'][_0x6915('0x50')]?_0x1a8f0b[_0x6915('0x40')]:_0x1b4100['model'];if(_0x3efcd0['query']['includeAll']){_0x1a8f0b[_0x6915('0x4c')]=[{'all':!![]}];}_0x1a8f0b=_['merge']({},_0x1a8f0b,_0x3efcd0['options']);return db[_0x6915('0x38')][_0x6915('0x51')](_0x1a8f0b)[_0x6915('0x1c')](handleEntityNotFound(_0x2029f6,null))['then'](respondWithResult(_0x2029f6,null))[_0x6915('0x25')](handleError(_0x2029f6,null));};exports[_0x6915('0x52')]=function(_0x56f008,_0x33cd76){return db['ZohoConfiguration']['create'](_0x56f008[_0x6915('0x53')],{})[_0x6915('0x1c')](respondWithResult(_0x33cd76,0xc9))[_0x6915('0x25')](handleError(_0x33cd76,null));};exports[_0x6915('0x31')]=function(_0x19eda1,_0x517b5f){if(_0x19eda1[_0x6915('0x53')]['id']){delete _0x19eda1[_0x6915('0x53')]['id'];}return db[_0x6915('0x38')][_0x6915('0x51')]({'where':{'id':_0x19eda1['params']['id']}})['then'](handleEntityNotFound(_0x517b5f,null))[_0x6915('0x1c')](saveUpdates(_0x19eda1[_0x6915('0x53')],null))[_0x6915('0x1c')](respondWithResult(_0x517b5f,null))[_0x6915('0x25')](handleError(_0x517b5f,null));};exports[_0x6915('0x32')]=function(_0x2e2eeb,_0x80191c){return db[_0x6915('0x38')]['find']({'where':{'id':_0x2e2eeb[_0x6915('0x54')]['id']}})[_0x6915('0x1c')](handleEntityNotFound(_0x80191c,null))['then'](removeEntity(_0x80191c,null))[_0x6915('0x25')](handleError(_0x80191c,null));};exports[_0x6915('0x55')]=function(_0x244cbb,_0x48cdfb,_0x570b5a){var _0x327db9={};var _0x471363={};var _0x374260;var _0x5e52d1;return db[_0x6915('0x38')]['findOne']({'where':{'id':_0x244cbb[_0x6915('0x54')]['id']}})[_0x6915('0x1c')](handleEntityNotFound(_0x48cdfb,null))['then'](function(_0x472b4c){if(_0x472b4c){_0x374260=_0x472b4c;_0x471363[_0x6915('0x3b')]=_[_0x6915('0x3d')](db[_0x6915('0x56')][_0x6915('0x39')]);_0x471363[_0x6915('0x3c')]=_[_0x6915('0x3d')](_0x244cbb['query']);_0x471363['filters']=_[_0x6915('0x3f')](_0x471363[_0x6915('0x3b')],_0x471363[_0x6915('0x3c')]);_0x327db9[_0x6915('0x40')]=_['intersection'](_0x471363[_0x6915('0x3b')],qs[_0x6915('0x41')](_0x244cbb[_0x6915('0x3c')]['fields']));_0x327db9[_0x6915('0x40')]=_0x327db9[_0x6915('0x40')][_0x6915('0x50')]?_0x327db9[_0x6915('0x40')]:_0x471363[_0x6915('0x3b')];_0x327db9[_0x6915('0x45')]=qs['sort'](_0x244cbb[_0x6915('0x3c')][_0x6915('0x46')]);_0x327db9[_0x6915('0x47')]=qs['filters'](_[_0x6915('0x57')](_0x244cbb['query'],_0x471363['filters']));if(_0x244cbb[_0x6915('0x3c')][_0x6915('0x48')]){_0x327db9['where']=_['merge'](_0x327db9[_0x6915('0x47')],{'$or':_[_0x6915('0x37')](_0x327db9['attributes'],function(_0x17d0ae){var _0x38bc45={};_0x38bc45[_0x17d0ae]={'$like':'%'+_0x244cbb[_0x6915('0x3c')][_0x6915('0x48')]+'%'};return _0x38bc45;})});}_0x327db9=_['merge']({},_0x327db9,_0x244cbb[_0x6915('0x4b')]);return _0x374260[_0x6915('0x55')](_0x327db9);}})['then'](function(_0x130e63){if(_0x130e63){_0x5e52d1=_0x130e63[_0x6915('0x50')];if(!_0x244cbb[_0x6915('0x3c')][_0x6915('0x42')]('nolimit')){_0x327db9[_0x6915('0x44')]=qs['limit'](_0x244cbb['query'][_0x6915('0x44')]);_0x327db9['offset']=qs[_0x6915('0x2a')](_0x244cbb[_0x6915('0x3c')]['offset']);}return _0x374260[_0x6915('0x55')](_0x327db9);}})[_0x6915('0x1c')](function(_0x4f1b01){if(_0x4f1b01){return _0x4f1b01?{'count':_0x5e52d1,'rows':_0x4f1b01}:null;}})[_0x6915('0x1c')](respondWithResult(_0x48cdfb,null))['catch'](handleError(_0x48cdfb,null));};exports['getSubjects']=function(_0x44af90,_0x7cd09a,_0x42115c){var _0x3eb603={};var _0x3ef554={};var _0x597e19;var _0x3f0ef1;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x44af90['params']['id']}})[_0x6915('0x1c')](handleEntityNotFound(_0x7cd09a,null))[_0x6915('0x1c')](function(_0x25813a){if(_0x25813a){_0x597e19=_0x25813a;_0x3ef554[_0x6915('0x3b')]=_['keys'](db[_0x6915('0x56')][_0x6915('0x39')]);_0x3ef554[_0x6915('0x3c')]=_['keys'](_0x44af90[_0x6915('0x3c')]);_0x3ef554['filters']=_['intersection'](_0x3ef554[_0x6915('0x3b')],_0x3ef554['query']);_0x3eb603[_0x6915('0x40')]=_[_0x6915('0x3f')](_0x3ef554[_0x6915('0x3b')],qs[_0x6915('0x41')](_0x44af90[_0x6915('0x3c')][_0x6915('0x41')]));_0x3eb603['attributes']=_0x3eb603[_0x6915('0x40')][_0x6915('0x50')]?_0x3eb603['attributes']:_0x3ef554[_0x6915('0x3b')];_0x3eb603[_0x6915('0x45')]=qs[_0x6915('0x46')](_0x44af90[_0x6915('0x3c')][_0x6915('0x46')]);_0x3eb603['where']=qs[_0x6915('0x3e')](_[_0x6915('0x57')](_0x44af90[_0x6915('0x3c')],_0x3ef554[_0x6915('0x3e')]));if(_0x44af90[_0x6915('0x3c')][_0x6915('0x48')]){_0x3eb603[_0x6915('0x47')]=_[_0x6915('0x49')](_0x3eb603[_0x6915('0x47')],{'$or':_[_0x6915('0x37')](_0x3eb603[_0x6915('0x40')],function(_0x2be883){var _0x56c962={};_0x56c962[_0x2be883]={'$like':'%'+_0x44af90['query'][_0x6915('0x48')]+'%'};return _0x56c962;})});}_0x3eb603=_['merge']({},_0x3eb603,_0x44af90[_0x6915('0x4b')]);return _0x597e19[_0x6915('0x58')](_0x3eb603);}})[_0x6915('0x1c')](function(_0x52fc09){if(_0x52fc09){_0x3f0ef1=_0x52fc09[_0x6915('0x50')];if(!_0x44af90[_0x6915('0x3c')]['hasOwnProperty'](_0x6915('0x43'))){_0x3eb603['limit']=qs[_0x6915('0x44')](_0x44af90[_0x6915('0x3c')][_0x6915('0x44')]);_0x3eb603[_0x6915('0x2a')]=qs[_0x6915('0x2a')](_0x44af90[_0x6915('0x3c')]['offset']);}return _0x597e19[_0x6915('0x58')](_0x3eb603);}})['then'](function(_0x9f0fb2){if(_0x9f0fb2){return _0x9f0fb2?{'count':_0x3f0ef1,'rows':_0x9f0fb2}:null;}})[_0x6915('0x1c')](respondWithResult(_0x7cd09a,null))['catch'](handleError(_0x7cd09a,null));};exports[_0x6915('0x59')]=function(_0x2424c6,_0x300e93,_0xd06b90){var _0x23ab91={};var _0xa99d6f={};var _0x21ac38;var _0x41b8f7;return db['ZohoConfiguration'][_0x6915('0x5a')]({'where':{'id':_0x2424c6[_0x6915('0x54')]['id']}})[_0x6915('0x1c')](handleEntityNotFound(_0x300e93,null))[_0x6915('0x1c')](function(_0x47c0d0){if(_0x47c0d0){_0x21ac38=_0x47c0d0;_0xa99d6f['model']=_[_0x6915('0x3d')](db['ZohoField'][_0x6915('0x39')]);_0xa99d6f[_0x6915('0x3c')]=_[_0x6915('0x3d')](_0x2424c6[_0x6915('0x3c')]);_0xa99d6f[_0x6915('0x3e')]=_[_0x6915('0x3f')](_0xa99d6f[_0x6915('0x3b')],_0xa99d6f[_0x6915('0x3c')]);_0x23ab91[_0x6915('0x40')]=_['intersection'](_0xa99d6f['model'],qs[_0x6915('0x41')](_0x2424c6[_0x6915('0x3c')][_0x6915('0x41')]));_0x23ab91[_0x6915('0x40')]=_0x23ab91['attributes'][_0x6915('0x50')]?_0x23ab91[_0x6915('0x40')]:_0xa99d6f[_0x6915('0x3b')];_0x23ab91[_0x6915('0x45')]=qs[_0x6915('0x46')](_0x2424c6['query'][_0x6915('0x46')]);_0x23ab91['where']=qs[_0x6915('0x3e')](_[_0x6915('0x57')](_0x2424c6[_0x6915('0x3c')],_0xa99d6f[_0x6915('0x3e')]));if(_0x2424c6[_0x6915('0x3c')][_0x6915('0x48')]){_0x23ab91['where']=_['merge'](_0x23ab91[_0x6915('0x47')],{'$or':_[_0x6915('0x37')](_0x23ab91[_0x6915('0x40')],function(_0x46f70c){var _0x87f859={};_0x87f859[_0x46f70c]={'$like':'%'+_0x2424c6[_0x6915('0x3c')]['filter']+'%'};return _0x87f859;})});}_0x23ab91=_[_0x6915('0x49')]({},_0x23ab91,_0x2424c6['options']);return _0x21ac38[_0x6915('0x59')](_0x23ab91);}})[_0x6915('0x1c')](function(_0x220475){if(_0x220475){_0x41b8f7=_0x220475[_0x6915('0x50')];if(!_0x2424c6['query']['hasOwnProperty'](_0x6915('0x43'))){_0x23ab91['limit']=qs['limit'](_0x2424c6[_0x6915('0x3c')]['limit']);_0x23ab91[_0x6915('0x2a')]=qs[_0x6915('0x2a')](_0x2424c6[_0x6915('0x3c')][_0x6915('0x2a')]);}return _0x21ac38[_0x6915('0x59')](_0x23ab91);}})['then'](function(_0x44fe29){if(_0x44fe29){return _0x44fe29?{'count':_0x41b8f7,'rows':_0x44fe29}:null;}})[_0x6915('0x1c')](respondWithResult(_0x300e93,null))['catch'](handleError(_0x300e93,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c83780d..48b3add 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 _0xbfc6=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x30f1f5,_0x3d2b0c){var _0x2427ab=function(_0x13a71b){while(--_0x13a71b){_0x30f1f5['push'](_0x30f1f5['shift']());}};_0x2427ab(++_0x3d2b0c);}(_0xbfc6,0x176));var _0x6bfc=function(_0x4636c3,_0x4ebaba){_0x4636c3=_0x4636c3-0x0;var _0x44811c=_0xbfc6[_0x4636c3];return _0x44811c;};'use strict';var _=require(_0x6bfc('0x0'));var util=require(_0x6bfc('0x1'));var logger=require(_0x6bfc('0x2'))(_0x6bfc('0x3'));var moment=require('moment');var BPromise=require(_0x6bfc('0x4'));var rp=require(_0x6bfc('0x5'));var fs=require('fs');var path=require(_0x6bfc('0x6'));var rimraf=require(_0x6bfc('0x7'));var config=require(_0x6bfc('0x8'));var attributes=require(_0x6bfc('0x9'));module[_0x6bfc('0xa')]=function(_0x5a55fd,_0x58f557){return _0x5a55fd[_0x6bfc('0xb')](_0x6bfc('0xc'),attributes,{'tableName':_0x6bfc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd98=['define','ZohoConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x1e70ad,_0xa167c4){var _0x3ff82a=function(_0x402615){while(--_0x402615){_0x1e70ad['push'](_0x1e70ad['shift']());}};_0x3ff82a(++_0xa167c4);}(_0xbd98,0x1ee));var _0x8bd9=function(_0x3cdbef,_0x3b0d10){_0x3cdbef=_0x3cdbef-0x0;var _0x1d05d6=_0xbd98[_0x3cdbef];return _0x1d05d6;};'use strict';var _=require(_0x8bd9('0x0'));var util=require(_0x8bd9('0x1'));var logger=require(_0x8bd9('0x2'))('api');var moment=require(_0x8bd9('0x3'));var BPromise=require(_0x8bd9('0x4'));var rp=require(_0x8bd9('0x5'));var fs=require('fs');var path=require(_0x8bd9('0x6'));var rimraf=require('rimraf');var config=require(_0x8bd9('0x7'));var attributes=require(_0x8bd9('0x8'));module[_0x8bd9('0x9')]=function(_0x40eeb4,_0x680b3){return _0x40eeb4[_0x8bd9('0xa')](_0x8bd9('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 1ce8999..a5bd0eb 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 _0x98e7=['moment','randomstring','../../config/logger','../../config/environment','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','util'];(function(_0x19af41,_0x598931){var _0x3ec287=function(_0x4395a7){while(--_0x4395a7){_0x19af41['push'](_0x19af41['shift']());}};_0x3ec287(++_0x598931);}(_0x98e7,0xb3));var _0x798e=function(_0x292891,_0x426567){_0x292891=_0x292891-0x0;var _0x5913aa=_0x98e7[_0x292891];return _0x5913aa;};'use strict';var _=require('lodash');var util=require(_0x798e('0x0'));var moment=require(_0x798e('0x1'));var BPromise=require('bluebird');var rs=require(_0x798e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x798e('0x3'))('rpc');var config=require(_0x798e('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x798e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0xd7da48,_0x134689,_0x3accfe){return new BPromise(function(_0x5311d8,_0xd9384e){return client[_0x798e('0x6')](_0xd7da48,_0x3accfe)[_0x798e('0x7')](function(_0x50da18){logger['info'](_0x798e('0x8'),_0x134689,_0x798e('0x9'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x134689,_0x798e('0x9'),JSON[_0x798e('0xa')](_0x50da18));if(_0x50da18[_0x798e('0xb')]){if(_0x50da18[_0x798e('0xb')]['code']===0x1f4){logger[_0x798e('0xb')](_0x798e('0x8'),_0x134689,_0x50da18['error'][_0x798e('0xc')]);return _0xd9384e(_0x50da18['error'][_0x798e('0xc')]);}logger[_0x798e('0xb')](_0x798e('0x8'),_0x134689,_0x50da18['error'][_0x798e('0xc')]);return _0x5311d8(_0x50da18['error'][_0x798e('0xc')]);}else{logger[_0x798e('0xd')](_0x798e('0x8'),_0x134689,_0x798e('0x9'));_0x5311d8(_0x50da18['result'][_0x798e('0xc')]);}})[_0x798e('0xe')](function(_0x5b231d){logger[_0x798e('0xb')](_0x798e('0x8'),_0x134689,_0x5b231d);_0xd9384e(_0x5b231d);});});} \ No newline at end of file +var _0x3706=['jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2a802f,_0x267939){var _0x38fbd8=function(_0x17fc82){while(--_0x17fc82){_0x2a802f['push'](_0x2a802f['shift']());}};_0x38fbd8(++_0x267939);}(_0x3706,0x1dc));var _0x6370=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x3706[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x6370('0x0'));var util=require(_0x6370('0x1'));var moment=require('moment');var BPromise=require(_0x6370('0x2'));var rs=require(_0x6370('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6370('0x4'))['db'];var utils=require(_0x6370('0x5'));var logger=require(_0x6370('0x6'))('rpc');var config=require(_0x6370('0x7'));var jayson=require(_0x6370('0x8'));var client=jayson[_0x6370('0x9')][_0x6370('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23c872,_0x175041,_0x3137ab){return new BPromise(function(_0x3b8ed7,_0x5a7401){return client['request'](_0x23c872,_0x3137ab)[_0x6370('0xb')](function(_0x192810){logger[_0x6370('0xc')](_0x6370('0xd'),_0x175041,_0x6370('0xe'));logger[_0x6370('0xf')](_0x6370('0x10'),_0x175041,_0x6370('0xe'),JSON[_0x6370('0x11')](_0x192810));if(_0x192810[_0x6370('0x12')]){if(_0x192810[_0x6370('0x12')]['code']===0x1f4){logger[_0x6370('0x12')](_0x6370('0xd'),_0x175041,_0x192810[_0x6370('0x12')]['message']);return _0x5a7401(_0x192810[_0x6370('0x12')]['message']);}logger[_0x6370('0x12')](_0x6370('0xd'),_0x175041,_0x192810[_0x6370('0x12')][_0x6370('0x13')]);return _0x3b8ed7(_0x192810[_0x6370('0x12')][_0x6370('0x13')]);}else{logger[_0x6370('0xc')](_0x6370('0xd'),_0x175041,_0x6370('0xe'));_0x3b8ed7(_0x192810[_0x6370('0x14')][_0x6370('0x13')]);}})[_0x6370('0x15')](function(_0x331eb0){logger[_0x6370('0x12')](_0x6370('0xd'),_0x175041,_0x331eb0);_0x5a7401(_0x331eb0);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 58725d3..41b0be6 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 _0x4991=['get','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x58fc31,_0x782e52){var _0x467a82=function(_0x3fe8b9){while(--_0x3fe8b9){_0x58fc31['push'](_0x58fc31['shift']());}};_0x467a82(++_0x782e52);}(_0x4991,0xf7));var _0x1499=function(_0x2c8829,_0x3a656b){_0x2c8829=_0x2c8829-0x0;var _0x4189ee=_0x4991[_0x2c8829];return _0x4189ee;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var auth=require(_0x1499('0x4'));var interaction=require(_0x1499('0x5'));var config=require(_0x1499('0x6'));var controller=require(_0x1499('0x7'));router[_0x1499('0x8')]('/',auth[_0x1499('0x9')](),controller['index']);router[_0x1499('0x8')](_0x1499('0xa'),auth[_0x1499('0x9')](),controller[_0x1499('0xb')]);router[_0x1499('0xc')]('/',auth[_0x1499('0x9')](),controller[_0x1499('0xd')]);router[_0x1499('0xe')]('/:id',auth[_0x1499('0x9')](),controller[_0x1499('0xf')]);router['delete'](_0x1499('0xa'),auth[_0x1499('0x9')](),controller['destroy']);module[_0x1499('0x10')]=router; \ No newline at end of file +var _0x1c9a=['path','express','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x2c0767,_0x444da4){var _0x22962a=function(_0x1238f1){while(--_0x1238f1){_0x2c0767['push'](_0x2c0767['shift']());}};_0x22962a(++_0x444da4);}(_0x1c9a,0x98));var _0xa1c9=function(_0x41535c,_0x21cb69){_0x41535c=_0x41535c-0x0;var _0x2dad7c=_0x1c9a[_0x41535c];return _0x2dad7c;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1c9('0xb')]);router[_0xa1c9('0xc')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller['update']);router[_0xa1c9('0xe')](_0xa1c9('0xd'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);module[_0xa1c9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 88258c0..3d52b11 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 _0x54da=['string','STRING','sequelize','ENUM','customVariable'];(function(_0x4c4986,_0x5ed332){var _0x496d43=function(_0x40dac2){while(--_0x40dac2){_0x4c4986['push'](_0x4c4986['shift']());}};_0x496d43(++_0x5ed332);}(_0x54da,0x9d));var _0xa54d=function(_0x21d246,_0x4888f1){_0x21d246=_0x21d246-0x0;var _0x8656f0=_0x54da[_0x21d246];return _0x8656f0;};'use strict';var Sequelize=require(_0xa54d('0x0'));module['exports']={'type':{'type':Sequelize[_0xa54d('0x1')]('string','variable',_0xa54d('0x2'),'keyValue'),'defaultValue':_0xa54d('0x3')},'content':{'type':Sequelize[_0xa54d('0x4')]},'key':{'type':Sequelize[_0xa54d('0x4')]},'keyType':{'type':Sequelize[_0xa54d('0x1')]('string','variable',_0xa54d('0x2'))},'keyContent':{'type':Sequelize[_0xa54d('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa54d('0x4')]}}; \ No newline at end of file +var _0x8137=['customVariable','keyValue','string','variable','STRING','BOOLEAN','sequelize'];(function(_0x4dfddb,_0x1ca382){var _0x5f5962=function(_0x139992){while(--_0x139992){_0x4dfddb['push'](_0x4dfddb['shift']());}};_0x5f5962(++_0x1ca382);}(_0x8137,0x16b));var _0x7813=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x8137[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x7813('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0x7813('0x1'),_0x7813('0x2')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7813('0x3'),_0x7813('0x4'),_0x7813('0x1'))},'keyContent':{'type':Sequelize[_0x7813('0x5')]},'idField':{'type':Sequelize[_0x7813('0x5')]},'nameField':{'type':Sequelize[_0x7813('0x5')]},'customField':{'type':Sequelize[_0x7813('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7813('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f770d5a..a0d7465 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x50c674,_0x3e5bb4){var _0x5453b5=function(_0x5efaba){while(--_0x5efaba){_0x50c674['push'](_0x50c674['shift']());}};_0x5453b5(++_0x3e5bb4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','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','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x5e58f5,_0x16896a){var _0x5e3df3=function(_0x23114d){while(--_0x23114d){_0x5e58f5['push'](_0x5e58f5['shift']());}};_0x5e3df3(++_0x16896a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 49dc836..53de464 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 _0x3c96=['lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField'];(function(_0x8550b9,_0x101b46){var _0x1cacce=function(_0x24092c){while(--_0x24092c){_0x8550b9['push'](_0x8550b9['shift']());}};_0x1cacce(++_0x101b46);}(_0x3c96,0xf7));var _0x63c9=function(_0x76bf32,_0x58c9a1){_0x76bf32=_0x76bf32-0x0;var _0x46c2fd=_0x3c96[_0x76bf32];return _0x46c2fd;};'use strict';var _=require(_0x63c9('0x0'));var util=require('util');var logger=require(_0x63c9('0x1'))(_0x63c9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x63c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63c9('0x4'));var config=require(_0x63c9('0x5'));var attributes=require(_0x63c9('0x6'));module[_0x63c9('0x7')]=function(_0x2095af,_0x4c9778){return _0x2095af[_0x63c9('0x8')](_0x63c9('0x9'),attributes,{'tableName':_0x63c9('0xa'),'paranoid':![],'indexes':[{'name':_0x63c9('0xb'),'fields':[_0x63c9('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7e4=['bluebird','request-promise','path','rimraf','define','ZohoField','zoho_unique_index','lodash','util','api','moment'];(function(_0x30f8c9,_0x34068e){var _0x5caa4f=function(_0x3f8f5a){while(--_0x3f8f5a){_0x30f8c9['push'](_0x30f8c9['shift']());}};_0x5caa4f(++_0x34068e);}(_0xa7e4,0xc2));var _0x4a7e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xa7e4[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x4a7e('0x0'));var util=require(_0x4a7e('0x1'));var logger=require('../../config/logger')(_0x4a7e('0x2'));var moment=require(_0x4a7e('0x3'));var BPromise=require(_0x4a7e('0x4'));var rp=require(_0x4a7e('0x5'));var fs=require('fs');var path=require(_0x4a7e('0x6'));var rimraf=require(_0x4a7e('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module['exports']=function(_0x546ba7,_0x34db52){return _0x546ba7[_0x4a7e('0x8')](_0x4a7e('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x4a7e('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 1ecc616..1ea243b 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 _0x5636=['code','ZohoField,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5636,0x102));var _0x6563=function(_0x5eefad,_0x472be5){_0x5eefad=_0x5eefad-0x0;var _0x4103d2=_0x5636[_0x5eefad];return _0x4103d2;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5a5af6,_0x1859de){var _0xddbe9b=function(_0x10be7c){while(--_0x10be7c){_0x5a5af6['push'](_0x5a5af6['shift']());}};_0xddbe9b(++_0x1859de);}(_0xe14d,0x1ee));var _0xde14=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xe14d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('ZohoField,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 69c7af5..c17c312 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 _0x9cbb=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x550613,_0x257643){var _0x6f7662=function(_0x56d98d){while(--_0x56d98d){_0x550613['push'](_0x550613['shift']());}};_0x6f7662(++_0x257643);}(_0x9cbb,0xf6));var _0xb9cb=function(_0x19fb2b,_0x212bd8){_0x19fb2b=_0x19fb2b-0x0;var _0x3be612=_0x9cbb[_0x19fb2b];return _0x3be612;};'use strict';var multer=require(_0xb9cb('0x0'));var util=require(_0xb9cb('0x1'));var path=require(_0xb9cb('0x2'));var timeout=require(_0xb9cb('0x3'));var express=require(_0xb9cb('0x4'));var router=express['Router']();var auth=require(_0xb9cb('0x5'));var interaction=require(_0xb9cb('0x6'));var config=require(_0xb9cb('0x7'));module[_0xb9cb('0x8')]=router; \ No newline at end of file +var _0x2e4d=['connect-timeout','express','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0xe22c2c,_0x191d1e){var _0x2792e4=function(_0x4fb703){while(--_0x4fb703){_0xe22c2c['push'](_0xe22c2c['shift']());}};_0x2792e4(++_0x191d1e);}(_0x2e4d,0x1ed));var _0xd2e4=function(_0x43f528,_0x3471f2){_0x43f528=_0x43f528-0x0;var _0x309445=_0x2e4d[_0x43f528];return _0x309445;};'use strict';var multer=require(_0xd2e4('0x0'));var util=require(_0xd2e4('0x1'));var path=require(_0xd2e4('0x2'));var timeout=require(_0xd2e4('0x3'));var express=require(_0xd2e4('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd2e4('0x5'));var config=require(_0xd2e4('0x6'));module[_0xd2e4('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index bc3f4a1..643a6aa 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 _0x9de3=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER'];(function(_0x1a710d,_0x28023f){var _0x2b2621=function(_0x5b5eb4){while(--_0x5b5eb4){_0x1a710d['push'](_0x1a710d['shift']());}};_0x2b2621(++_0x28023f);}(_0x9de3,0x7a));var _0x39de=function(_0x2bcea7,_0xb981bb){_0x2bcea7=_0x2bcea7-0x0;var _0x33fe90=_0x9de3[_0x2bcea7];return _0x33fe90;};'use strict';var Sequelize=require(_0x39de('0x0'));module[_0x39de('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x39de('0x2')},'version':{'type':Sequelize[_0x39de('0x3')],'allowNull':![],'unique':_0x39de('0x2')},'main':{'type':Sequelize[_0x39de('0x3')],'defaultValue':_0x39de('0x4')},'filename':{'type':Sequelize[_0x39de('0x3')]},'path':{'type':Sequelize[_0x39de('0x3')]},'type':{'type':Sequelize[_0x39de('0x3')]},'size':{'type':Sequelize[_0x39de('0x5')]},'active':{'type':Sequelize[_0x39de('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x39de('0x3')]},'state':{'type':Sequelize[_0x39de('0x3')],'unique':_0x39de('0x7')},'description':{'type':Sequelize[_0x39de('0x3')]},'title':{'type':Sequelize[_0x39de('0x3')]},'remoteUri':{'type':Sequelize[_0x39de('0x3')]},'link':{'type':Sequelize[_0x39de('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc7be=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x41456d,_0x464b02){var _0x136775=function(_0x20327e){while(--_0x20327e){_0x41456d['push'](_0x41456d['shift']());}};_0x136775(++_0x464b02);}(_0xc7be,0x1f3));var _0xec7b=function(_0x61b761,_0x4ef502){_0x61b761=_0x61b761-0x0;var _0x535a54=_0xc7be[_0x61b761];return _0x535a54;};'use strict';var Sequelize=require(_0xec7b('0x0'));module[_0xec7b('0x1')]={'name':{'type':Sequelize[_0xec7b('0x2')],'allowNull':![],'unique':_0xec7b('0x3')},'version':{'type':Sequelize[_0xec7b('0x2')],'allowNull':![],'unique':_0xec7b('0x3')},'main':{'type':Sequelize[_0xec7b('0x2')],'defaultValue':_0xec7b('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xec7b('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xec7b('0x5')]},'active':{'type':Sequelize[_0xec7b('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xec7b('0x2')]},'state':{'type':Sequelize[_0xec7b('0x2')],'unique':_0xec7b('0x7')},'description':{'type':Sequelize[_0xec7b('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xec7b('0x2')]},'link':{'type':Sequelize[_0xec7b('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2d85f90..5859521 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 _0x160a=['hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','Integration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1369cb,_0x2aab65){var _0xe6a0ee=function(_0x39708d){while(--_0x39708d){_0x1369cb['push'](_0x1369cb['shift']());}};_0xe6a0ee(++_0x2aab65);}(_0x160a,0x1ca));var _0xa160=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x160a[_0x42bc91];return _0x3f5507;};'use strict';var pdf=require(_0xa160('0x0'));var emlformat=require(_0xa160('0x1'));var rimraf=require(_0xa160('0x2'));var zipdir=require(_0xa160('0x3'));var jsonpatch=require(_0xa160('0x4'));var rp=require(_0xa160('0x5'));var moment=require('moment');var BPromise=require(_0xa160('0x6'));var Mustache=require(_0xa160('0x7'));var util=require(_0xa160('0x8'));var path=require(_0xa160('0x9'));var sox=require(_0xa160('0xa'));var csv=require(_0xa160('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa160('0xc'));var squel=require(_0xa160('0xd'));var crypto=require('crypto');var jsforce=require(_0xa160('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa160('0xb'));var querystring=require(_0xa160('0xf'));var Papa=require(_0xa160('0x10'));var Redis=require(_0xa160('0x11'));var authService=require(_0xa160('0x12'));var qs=require(_0xa160('0x13'));var as=require(_0xa160('0x14'));var hardwareService=require(_0xa160('0x15'));var logger=require('../../config/logger')(_0xa160('0x16'));var utils=require(_0xa160('0x17'));var config=require(_0xa160('0x18'));var db=require(_0xa160('0x19'))['db'];function respondWithStatusCode(_0x218acf,_0x59ec46){_0x59ec46=_0x59ec46||0xcc;return function(_0x57fc33){if(_0x57fc33){return _0x218acf['sendStatus'](_0x59ec46);}return _0x218acf[_0xa160('0x1a')](_0x59ec46)['end']();};}function respondWithResult(_0x52a03d,_0x52c9ec){_0x52c9ec=_0x52c9ec||0xc8;return function(_0x3b4a5d){if(_0x3b4a5d){return _0x52a03d[_0xa160('0x1a')](_0x52c9ec)['json'](_0x3b4a5d);}};}function respondWithFilteredResult(_0x500984,_0x3d762a){return function(_0x11fdac){if(_0x11fdac){var _0x1672b2=_0x11fdac[_0xa160('0x1b')],_0x348073=_0x3d762a['offset'],_0x154f87=_0x3d762a[_0xa160('0x1c')]+_0x3d762a[_0xa160('0x1d')],_0x2ad662;if(_0x154f87>=_0x1672b2){_0x154f87=_0x1672b2;_0x2ad662=0xc8;}else{_0x2ad662=0xce;}_0x500984['status'](_0x2ad662);return _0x500984[_0xa160('0x1e')](_0xa160('0x1f'),_0x348073+'-'+_0x154f87+'/'+_0x1672b2)['json'](_0x11fdac);}return null;};}function patchUpdates(_0x3f4cca){return function(_0x51b7a8){try{jsonpatch[_0xa160('0x20')](_0x51b7a8,_0x3f4cca,!![]);}catch(_0x53b9bf){return BPromise['reject'](_0x53b9bf);}return _0x51b7a8[_0xa160('0x21')]();};}function saveUpdates(_0x54a48f,_0x323a7a){return function(_0x398254){if(_0x398254){return _0x398254['update'](_0x54a48f)[_0xa160('0x22')](function(_0xd87e91){return _0xd87e91;});}return null;};}function removeEntity(_0x4f8847,_0x30c634){return function(_0x1ed944){if(_0x1ed944){return _0x1ed944[_0xa160('0x23')]()[_0xa160('0x22')](function(){_0x4f8847[_0xa160('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494640,_0x566ad4){return function(_0x4c91b0){if(!_0x4c91b0){_0x494640[_0xa160('0x24')](0x194);}return _0x4c91b0;};}function handleError(_0x46fb54,_0x568d3e){_0x568d3e=_0x568d3e||0x1f4;return function(_0xfd865f){logger['error'](_0xfd865f[_0xa160('0x25')]);if(_0xfd865f[_0xa160('0x26')]){delete _0xfd865f[_0xa160('0x26')];}_0x46fb54['status'](_0x568d3e)[_0xa160('0x27')](_0xfd865f);};}exports[_0xa160('0x28')]=function(_0x321294,_0x333954){var _0x300edf={},_0x4c7f08={},_0xe2a877={'count':0x0,'rows':[]};var _0xf36a9=_['map'](db['Integration']['rawAttributes'],function(_0x27e965){return{'name':_0x27e965[_0xa160('0x29')],'type':_0x27e965[_0xa160('0x2a')][_0xa160('0x2b')]};});_0x4c7f08[_0xa160('0x2c')]=_[_0xa160('0x2d')](_0xf36a9,_0xa160('0x26'));_0x4c7f08[_0xa160('0x2e')]=_[_0xa160('0x2f')](_0x321294['query']);_0x4c7f08[_0xa160('0x30')]=_[_0xa160('0x31')](_0x4c7f08[_0xa160('0x2c')],_0x4c7f08[_0xa160('0x2e')]);_0x300edf[_0xa160('0x32')]=_[_0xa160('0x31')](_0x4c7f08[_0xa160('0x2c')],qs[_0xa160('0x33')](_0x321294[_0xa160('0x2e')][_0xa160('0x33')]));_0x300edf[_0xa160('0x32')]=_0x300edf[_0xa160('0x32')][_0xa160('0x34')]?_0x300edf[_0xa160('0x32')]:_0x4c7f08[_0xa160('0x2c')];if(!_0x321294[_0xa160('0x2e')][_0xa160('0x35')](_0xa160('0x36'))){_0x300edf[_0xa160('0x1d')]=qs[_0xa160('0x1d')](_0x321294['query'][_0xa160('0x1d')]);_0x300edf[_0xa160('0x1c')]=qs['offset'](_0x321294['query']['offset']);}_0x300edf['order']=qs[_0xa160('0x37')](_0x321294['query'][_0xa160('0x37')]);_0x300edf['where']=qs[_0xa160('0x30')](_['pick'](_0x321294[_0xa160('0x2e')],_0x4c7f08[_0xa160('0x30')]),_0xf36a9);if(_0x321294['query'][_0xa160('0x38')]){_0x300edf['where']=_['merge'](_0x300edf[_0xa160('0x39')],{'$or':_[_0xa160('0x2d')](_0xf36a9,function(_0x18232b){if(_0x18232b[_0xa160('0x2a')]!==_0xa160('0x3a')){var _0x17d00c={};_0x17d00c[_0x18232b[_0xa160('0x26')]]={'$like':'%'+_0x321294[_0xa160('0x2e')][_0xa160('0x38')]+'%'};return _0x17d00c;}})});}_0x300edf=_[_0xa160('0x3b')]({},_0x300edf,_0x321294['options']);var _0x1d1059={'where':_0x300edf[_0xa160('0x39')]};return db[_0xa160('0x3c')][_0xa160('0x1b')](_0x1d1059)[_0xa160('0x22')](function(_0x22cfce){_0xe2a877[_0xa160('0x1b')]=_0x22cfce;if(_0x321294[_0xa160('0x2e')][_0xa160('0x3d')]){_0x300edf[_0xa160('0x3e')]=[{'all':!![]}];}return db[_0xa160('0x3c')][_0xa160('0x3f')](_0x300edf);})[_0xa160('0x22')](function(_0x3aa17b){_0xe2a877[_0xa160('0x40')]=_0x3aa17b;return _0xe2a877;})['then'](respondWithFilteredResult(_0x333954,_0x300edf))[_0xa160('0x41')](handleError(_0x333954,null));};exports[_0xa160('0x42')]=function(_0x453516,_0x15c65d){var _0xf7a763={'raw':![],'where':{'id':_0x453516[_0xa160('0x43')]['id']}},_0x4c4bbe={};_0x4c4bbe['model']=_['keys'](db[_0xa160('0x3c')][_0xa160('0x44')]);_0x4c4bbe['query']=_[_0xa160('0x2f')](_0x453516[_0xa160('0x2e')]);_0x4c4bbe[_0xa160('0x30')]=_[_0xa160('0x31')](_0x4c4bbe['model'],_0x4c4bbe[_0xa160('0x2e')]);_0xf7a763[_0xa160('0x32')]=_['intersection'](_0x4c4bbe['model'],qs[_0xa160('0x33')](_0x453516['query']['fields']));_0xf7a763[_0xa160('0x32')]=_0xf7a763['attributes'][_0xa160('0x34')]?_0xf7a763[_0xa160('0x32')]:_0x4c4bbe[_0xa160('0x2c')];if(_0x453516['query'][_0xa160('0x3d')]){_0xf7a763[_0xa160('0x3e')]=[{'all':!![]}];}_0xf7a763=_[_0xa160('0x3b')]({},_0xf7a763,_0x453516[_0xa160('0x45')]);return db[_0xa160('0x3c')][_0xa160('0x46')](_0xf7a763)[_0xa160('0x22')](handleEntityNotFound(_0x15c65d,null))[_0xa160('0x22')](respondWithResult(_0x15c65d,null))[_0xa160('0x41')](handleError(_0x15c65d,null));};exports[_0xa160('0x47')]=function(_0xaab702,_0x5aaf4d){return db[_0xa160('0x3c')][_0xa160('0x47')](_0xaab702[_0xa160('0x48')],{})[_0xa160('0x22')](respondWithResult(_0x5aaf4d,0xc9))['catch'](handleError(_0x5aaf4d,null));};exports['update']=function(_0x1f7508,_0x235f93){if(_0x1f7508[_0xa160('0x48')]['id']){delete _0x1f7508[_0xa160('0x48')]['id'];}return db[_0xa160('0x3c')][_0xa160('0x46')]({'where':{'id':_0x1f7508['params']['id']}})['then'](handleEntityNotFound(_0x235f93,null))[_0xa160('0x22')](saveUpdates(_0x1f7508[_0xa160('0x48')],null))['then'](respondWithResult(_0x235f93,null))['catch'](handleError(_0x235f93,null));};exports[_0xa160('0x23')]=function(_0x3589e1,_0x3db974){return db[_0xa160('0x3c')][_0xa160('0x46')]({'where':{'id':_0x3589e1[_0xa160('0x43')]['id']}})[_0xa160('0x22')](handleEntityNotFound(_0x3db974,null))[_0xa160('0x22')](removeEntity(_0x3db974,null))[_0xa160('0x41')](handleError(_0x3db974,null));}; \ No newline at end of file +var _0xb2e6=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','reject','save','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','update','body'];(function(_0x2186bb,_0x2804bd){var _0x4afbfa=function(_0xc45745){while(--_0xc45745){_0x2186bb['push'](_0x2186bb['shift']());}};_0x4afbfa(++_0x2804bd);}(_0xb2e6,0x1a4));var _0x6b2e=function(_0x566929,_0x498e41){_0x566929=_0x566929-0x0;var _0x55b33c=_0xb2e6[_0x566929];return _0x55b33c;};'use strict';var pdf=require(_0x6b2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b2e('0x1'));var zipdir=require(_0x6b2e('0x2'));var jsonpatch=require(_0x6b2e('0x3'));var rp=require(_0x6b2e('0x4'));var moment=require(_0x6b2e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b2e('0x6'));var util=require(_0x6b2e('0x7'));var path=require(_0x6b2e('0x8'));var sox=require(_0x6b2e('0x9'));var csv=require(_0x6b2e('0xa'));var ejs=require(_0x6b2e('0xb'));var fs=require('fs');var _=require(_0x6b2e('0xc'));var squel=require(_0x6b2e('0xd'));var crypto=require(_0x6b2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6b2e('0xf'));var toCsv=require(_0x6b2e('0xa'));var querystring=require(_0x6b2e('0x10'));var Papa=require(_0x6b2e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b2e('0x12'));var as=require(_0x6b2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b2e('0x14'))(_0x6b2e('0x15'));var utils=require(_0x6b2e('0x16'));var config=require(_0x6b2e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40721d,_0x4ecdd8){_0x4ecdd8=_0x4ecdd8||0xcc;return function(_0x5ea4e6){if(_0x5ea4e6){return _0x40721d[_0x6b2e('0x18')](_0x4ecdd8);}return _0x40721d['status'](_0x4ecdd8)['end']();};}function respondWithResult(_0x262451,_0x14063c){_0x14063c=_0x14063c||0xc8;return function(_0x3a1ad8){if(_0x3a1ad8){return _0x262451[_0x6b2e('0x19')](_0x14063c)['json'](_0x3a1ad8);}};}function respondWithFilteredResult(_0x13e728,_0x59e93e){return function(_0x3791b7){if(_0x3791b7){var _0x1e48a6=_0x3791b7[_0x6b2e('0x1a')],_0x204d71=_0x59e93e[_0x6b2e('0x1b')],_0xbb7dc1=_0x59e93e['offset']+_0x59e93e[_0x6b2e('0x1c')],_0x336078;if(_0xbb7dc1>=_0x1e48a6){_0xbb7dc1=_0x1e48a6;_0x336078=0xc8;}else{_0x336078=0xce;}_0x13e728[_0x6b2e('0x19')](_0x336078);return _0x13e728[_0x6b2e('0x1d')]('Content-Range',_0x204d71+'-'+_0xbb7dc1+'/'+_0x1e48a6)['json'](_0x3791b7);}return null;};}function patchUpdates(_0x457964){return function(_0x28a733){try{jsonpatch['apply'](_0x28a733,_0x457964,!![]);}catch(_0x27d48a){return BPromise[_0x6b2e('0x1e')](_0x27d48a);}return _0x28a733[_0x6b2e('0x1f')]();};}function saveUpdates(_0x285d3a,_0x4c5193){return function(_0x2eaf9e){if(_0x2eaf9e){return _0x2eaf9e['update'](_0x285d3a)[_0x6b2e('0x20')](function(_0x23492d){return _0x23492d;});}return null;};}function removeEntity(_0x3d23ad,_0x53cef1){return function(_0x22555c){if(_0x22555c){return _0x22555c[_0x6b2e('0x21')]()[_0x6b2e('0x20')](function(){_0x3d23ad[_0x6b2e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0616,_0x32563a){return function(_0x1e0a30){if(!_0x1e0a30){_0x5d0616[_0x6b2e('0x18')](0x194);}return _0x1e0a30;};}function handleError(_0x65fc95,_0x1cd6bd){_0x1cd6bd=_0x1cd6bd||0x1f4;return function(_0x36b7ca){logger[_0x6b2e('0x22')](_0x36b7ca['stack']);if(_0x36b7ca[_0x6b2e('0x23')]){delete _0x36b7ca['name'];}_0x65fc95[_0x6b2e('0x19')](_0x1cd6bd)[_0x6b2e('0x24')](_0x36b7ca);};}exports[_0x6b2e('0x25')]=function(_0x58ea55,_0x1d2802){var _0x3a814a={},_0x595985={},_0x88a988={'count':0x0,'rows':[]};var _0x586827=_[_0x6b2e('0x26')](db[_0x6b2e('0x27')][_0x6b2e('0x28')],function(_0x40c7f3){return{'name':_0x40c7f3[_0x6b2e('0x29')],'type':_0x40c7f3['type'][_0x6b2e('0x2a')]};});_0x595985[_0x6b2e('0x2b')]=_[_0x6b2e('0x26')](_0x586827,'name');_0x595985[_0x6b2e('0x2c')]=_[_0x6b2e('0x2d')](_0x58ea55[_0x6b2e('0x2c')]);_0x595985[_0x6b2e('0x2e')]=_['intersection'](_0x595985[_0x6b2e('0x2b')],_0x595985['query']);_0x3a814a[_0x6b2e('0x2f')]=_[_0x6b2e('0x30')](_0x595985['model'],qs[_0x6b2e('0x31')](_0x58ea55[_0x6b2e('0x2c')]['fields']));_0x3a814a['attributes']=_0x3a814a[_0x6b2e('0x2f')][_0x6b2e('0x32')]?_0x3a814a[_0x6b2e('0x2f')]:_0x595985[_0x6b2e('0x2b')];if(!_0x58ea55[_0x6b2e('0x2c')][_0x6b2e('0x33')](_0x6b2e('0x34'))){_0x3a814a['limit']=qs[_0x6b2e('0x1c')](_0x58ea55['query'][_0x6b2e('0x1c')]);_0x3a814a['offset']=qs['offset'](_0x58ea55['query'][_0x6b2e('0x1b')]);}_0x3a814a[_0x6b2e('0x35')]=qs[_0x6b2e('0x36')](_0x58ea55[_0x6b2e('0x2c')][_0x6b2e('0x36')]);_0x3a814a[_0x6b2e('0x37')]=qs[_0x6b2e('0x2e')](_['pick'](_0x58ea55[_0x6b2e('0x2c')],_0x595985[_0x6b2e('0x2e')]),_0x586827);if(_0x58ea55[_0x6b2e('0x2c')][_0x6b2e('0x38')]){_0x3a814a['where']=_['merge'](_0x3a814a[_0x6b2e('0x37')],{'$or':_['map'](_0x586827,function(_0x26821a){if(_0x26821a['type']!==_0x6b2e('0x39')){var _0x5c1842={};_0x5c1842[_0x26821a[_0x6b2e('0x23')]]={'$like':'%'+_0x58ea55[_0x6b2e('0x2c')][_0x6b2e('0x38')]+'%'};return _0x5c1842;}})});}_0x3a814a=_[_0x6b2e('0x3a')]({},_0x3a814a,_0x58ea55[_0x6b2e('0x3b')]);var _0x4a266d={'where':_0x3a814a[_0x6b2e('0x37')]};return db['Integration'][_0x6b2e('0x1a')](_0x4a266d)['then'](function(_0x393937){_0x88a988[_0x6b2e('0x1a')]=_0x393937;if(_0x58ea55['query'][_0x6b2e('0x3c')]){_0x3a814a[_0x6b2e('0x3d')]=[{'all':!![]}];}return db[_0x6b2e('0x27')][_0x6b2e('0x3e')](_0x3a814a);})[_0x6b2e('0x20')](function(_0x2538c3){_0x88a988['rows']=_0x2538c3;return _0x88a988;})[_0x6b2e('0x20')](respondWithFilteredResult(_0x1d2802,_0x3a814a))[_0x6b2e('0x3f')](handleError(_0x1d2802,null));};exports[_0x6b2e('0x40')]=function(_0x1c4eca,_0x4121ef){var _0x22971b={'raw':![],'where':{'id':_0x1c4eca[_0x6b2e('0x41')]['id']}},_0x25ce11={};_0x25ce11[_0x6b2e('0x2b')]=_['keys'](db[_0x6b2e('0x27')][_0x6b2e('0x28')]);_0x25ce11[_0x6b2e('0x2c')]=_[_0x6b2e('0x2d')](_0x1c4eca[_0x6b2e('0x2c')]);_0x25ce11[_0x6b2e('0x2e')]=_[_0x6b2e('0x30')](_0x25ce11[_0x6b2e('0x2b')],_0x25ce11[_0x6b2e('0x2c')]);_0x22971b[_0x6b2e('0x2f')]=_[_0x6b2e('0x30')](_0x25ce11[_0x6b2e('0x2b')],qs[_0x6b2e('0x31')](_0x1c4eca[_0x6b2e('0x2c')][_0x6b2e('0x31')]));_0x22971b[_0x6b2e('0x2f')]=_0x22971b[_0x6b2e('0x2f')][_0x6b2e('0x32')]?_0x22971b[_0x6b2e('0x2f')]:_0x25ce11[_0x6b2e('0x2b')];if(_0x1c4eca[_0x6b2e('0x2c')][_0x6b2e('0x3c')]){_0x22971b[_0x6b2e('0x3d')]=[{'all':!![]}];}_0x22971b=_[_0x6b2e('0x3a')]({},_0x22971b,_0x1c4eca[_0x6b2e('0x3b')]);return db[_0x6b2e('0x27')][_0x6b2e('0x42')](_0x22971b)[_0x6b2e('0x20')](handleEntityNotFound(_0x4121ef,null))[_0x6b2e('0x20')](respondWithResult(_0x4121ef,null))['catch'](handleError(_0x4121ef,null));};exports[_0x6b2e('0x43')]=function(_0xf9d551,_0x226846){return db[_0x6b2e('0x27')][_0x6b2e('0x43')](_0xf9d551['body'],{})[_0x6b2e('0x20')](respondWithResult(_0x226846,0xc9))[_0x6b2e('0x3f')](handleError(_0x226846,null));};exports[_0x6b2e('0x44')]=function(_0x338c90,_0x216324){if(_0x338c90[_0x6b2e('0x45')]['id']){delete _0x338c90[_0x6b2e('0x45')]['id'];}return db[_0x6b2e('0x27')]['find']({'where':{'id':_0x338c90[_0x6b2e('0x41')]['id']}})[_0x6b2e('0x20')](handleEntityNotFound(_0x216324,null))[_0x6b2e('0x20')](saveUpdates(_0x338c90[_0x6b2e('0x45')],null))[_0x6b2e('0x20')](respondWithResult(_0x216324,null))[_0x6b2e('0x3f')](handleError(_0x216324,null));};exports[_0x6b2e('0x21')]=function(_0x363f46,_0x10d471){return db[_0x6b2e('0x27')]['find']({'where':{'id':_0x363f46[_0x6b2e('0x41')]['id']}})[_0x6b2e('0x20')](handleEntityNotFound(_0x10d471,null))[_0x6b2e('0x20')](removeEntity(_0x10d471,null))[_0x6b2e('0x3f')](handleError(_0x10d471,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d0f906a..91885aa 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 _0xf181=['define','Integration','integrations','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf181,0xf3));var _0x1f18=function(_0x41d684,_0x52f976){_0x41d684=_0x41d684-0x0;var _0x83b011=_0xf181[_0x41d684];return _0x83b011;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1f18('0x0'));var moment=require(_0x1f18('0x1'));var BPromise=require(_0x1f18('0x2'));var rp=require(_0x1f18('0x3'));var fs=require('fs');var path=require(_0x1f18('0x4'));var rimraf=require(_0x1f18('0x5'));var config=require(_0x1f18('0x6'));var attributes=require(_0x1f18('0x7'));module[_0x1f18('0x8')]=function(_0x3fb15d,_0x19721e){return _0x3fb15d[_0x1f18('0x9')](_0x1f18('0xa'),attributes,{'tableName':_0x1f18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb061=['request-promise','path','rimraf','../../config/environment','./integration.attributes','define','Integration','lodash','../../config/logger','api','bluebird'];(function(_0x361c74,_0x11d6ff){var _0x279933=function(_0x206368){while(--_0x206368){_0x361c74['push'](_0x361c74['shift']());}};_0x279933(++_0x11d6ff);}(_0xb061,0x8b));var _0x1b06=function(_0xffdd08,_0x5cfdbc){_0xffdd08=_0xffdd08-0x0;var _0x2cb77f=_0xb061[_0xffdd08];return _0x2cb77f;};'use strict';var _=require(_0x1b06('0x0'));var util=require('util');var logger=require(_0x1b06('0x1'))(_0x1b06('0x2'));var moment=require('moment');var BPromise=require(_0x1b06('0x3'));var rp=require(_0x1b06('0x4'));var fs=require('fs');var path=require(_0x1b06('0x5'));var rimraf=require(_0x1b06('0x6'));var config=require(_0x1b06('0x7'));var attributes=require(_0x1b06('0x8'));module['exports']=function(_0x3aaa0f,_0x32dfdb){return _0x3aaa0f[_0x1b06('0x9')](_0x1b06('0xa'),attributes,{'tableName':'integrations','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 005fa04..3240916 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 _0xbf07=['request','then','info','Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0x5e93b4,_0x3efbea){var _0x42321c=function(_0x83e3d){while(--_0x83e3d){_0x5e93b4['push'](_0x5e93b4['shift']());}};_0x42321c(++_0x3efbea);}(_0xbf07,0x77));var _0x7bf0=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xbf07[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var moment=require(_0x7bf0('0x2'));var BPromise=require(_0x7bf0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf0('0x4'));var db=require(_0x7bf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7bf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44f656,_0x50e680,_0x263964){return new BPromise(function(_0x536214,_0x415291){return client[_0x7bf0('0x7')](_0x44f656,_0x263964)[_0x7bf0('0x8')](function(_0x2565c7){logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,'request\x20sent');logger[_0x7bf0('0xb')]('Integration,\x20%s,\x20%s,\x20%s',_0x50e680,_0x7bf0('0xc'),JSON[_0x7bf0('0xd')](_0x2565c7));if(_0x2565c7[_0x7bf0('0xe')]){if(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0xf')]===0x1f4){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x415291(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x536214(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}else{logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,_0x7bf0('0xc'));_0x536214(_0x2565c7['result'][_0x7bf0('0x10')]);}})[_0x7bf0('0x11')](function(_0x187489){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x187489);_0x415291(_0x187489);});});} \ No newline at end of file +var _0xab29=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4808fd,_0x409407){var _0x2aa850=function(_0x10cd03){while(--_0x10cd03){_0x4808fd['push'](_0x4808fd['shift']());}};_0x2aa850(++_0x409407);}(_0xab29,0x145));var _0x9ab2=function(_0x44a8ef,_0x55b134){_0x44a8ef=_0x44a8ef-0x0;var _0x36ea0f=_0xab29[_0x44a8ef];return _0x36ea0f;};'use strict';var _=require(_0x9ab2('0x0'));var util=require(_0x9ab2('0x1'));var moment=require(_0x9ab2('0x2'));var BPromise=require(_0x9ab2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ab2('0x5'));var logger=require(_0x9ab2('0x6'))(_0x9ab2('0x7'));var config=require(_0x9ab2('0x8'));var jayson=require(_0x9ab2('0x9'));var client=jayson['client'][_0x9ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3739c8,_0x42d544,_0x3c73e5){return new BPromise(function(_0x3a3553,_0x564109){return client[_0x9ab2('0xb')](_0x3739c8,_0x3c73e5)[_0x9ab2('0xc')](function(_0x398547){logger[_0x9ab2('0xd')](_0x9ab2('0xe'),_0x42d544,_0x9ab2('0xf'));logger[_0x9ab2('0x10')](_0x9ab2('0x11'),_0x42d544,_0x9ab2('0xf'),JSON['stringify'](_0x398547));if(_0x398547[_0x9ab2('0x12')]){if(_0x398547[_0x9ab2('0x12')]['code']===0x1f4){logger['error'](_0x9ab2('0xe'),_0x42d544,_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);return _0x564109(_0x398547['error'][_0x9ab2('0x13')]);}logger[_0x9ab2('0x12')]('Integration,\x20%s,\x20%s',_0x42d544,_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);return _0x3a3553(_0x398547[_0x9ab2('0x12')][_0x9ab2('0x13')]);}else{logger[_0x9ab2('0xd')](_0x9ab2('0xe'),_0x42d544,_0x9ab2('0xf'));_0x3a3553(_0x398547[_0x9ab2('0x14')]['message']);}})[_0x9ab2('0x15')](function(_0x273e07){logger[_0x9ab2('0x12')](_0x9ab2('0xe'),_0x42d544,_0x273e07);_0x564109(_0x273e07);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8d48af9..3322168 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 _0x242f=['update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x242f,0x129));var _0xf242=function(_0x4af23c,_0x50e294){_0x4af23c=_0x4af23c-0x0;var _0x194b63=_0x242f[_0x4af23c];return _0x194b63;};'use strict';var multer=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var path=require(_0xf242('0x2'));var timeout=require('connect-timeout');var express=require(_0xf242('0x3'));var router=express[_0xf242('0x4')]();var auth=require(_0xf242('0x5'));var interaction=require(_0xf242('0x6'));var config=require(_0xf242('0x7'));var controller=require(_0xf242('0x8'));router[_0xf242('0x9')]('/',auth[_0xf242('0xa')](),controller[_0xf242('0xb')]);router[_0xf242('0x9')](_0xf242('0xc'),auth[_0xf242('0xa')](),controller[_0xf242('0xd')]);router[_0xf242('0x9')](_0xf242('0xe'),auth[_0xf242('0xa')](),controller['show']);router[_0xf242('0xf')]('/',auth[_0xf242('0xa')](),controller[_0xf242('0x10')]);router[_0xf242('0x11')](_0xf242('0xe'),auth[_0xf242('0xa')](),controller[_0xf242('0x12')]);router[_0xf242('0x13')]('/:id',auth[_0xf242('0xa')](),controller['destroy']);module[_0xf242('0x14')]=router; \ No newline at end of file +var _0x80c7=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x460bac,_0x1f11b1){var _0x17b493=function(_0x3dee94){while(--_0x3dee94){_0x460bac['push'](_0x460bac['shift']());}};_0x17b493(++_0x1f11b1);}(_0x80c7,0x8d));var _0x780c=function(_0x546f4b,_0x471ce5){_0x546f4b=_0x546f4b-0x0;var _0x5897b4=_0x80c7[_0x546f4b];return _0x5897b4;};'use strict';var multer=require(_0x780c('0x0'));var util=require(_0x780c('0x1'));var path=require(_0x780c('0x2'));var timeout=require(_0x780c('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x780c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x780c('0x5'));var controller=require(_0x780c('0x6'));router[_0x780c('0x7')]('/',auth[_0x780c('0x8')](),controller[_0x780c('0x9')]);router[_0x780c('0x7')](_0x780c('0xa'),auth[_0x780c('0x8')](),controller[_0x780c('0xb')]);router[_0x780c('0x7')](_0x780c('0xc'),auth['isAuthenticated'](),controller[_0x780c('0xd')]);router[_0x780c('0xe')]('/',auth['isAuthenticated'](),controller[_0x780c('0xf')]);router[_0x780c('0x10')](_0x780c('0xc'),auth['isAuthenticated'](),controller[_0x780c('0x11')]);router[_0x780c('0x12')](_0x780c('0xc'),auth[_0x780c('0x8')](),controller[_0x780c('0x13')]);module[_0x780c('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f88d123..b456ab6 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 _0x7172=['DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','STRING','INTEGER'];(function(_0x44c3ce,_0x47c19a){var _0x34a648=function(_0x369129){while(--_0x369129){_0x44c3ce['push'](_0x44c3ce['shift']());}};_0x34a648(++_0x47c19a);}(_0x7172,0x1ed));var _0x2717=function(_0x1e9cb8,_0x3a9b29){_0x1e9cb8=_0x1e9cb8-0x0;var _0x380780=_0x7172[_0x1e9cb8];return _0x380780;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x2717('0x0')]},'eventChannel':{'type':Sequelize[_0x2717('0x0')]},'exitStatus':{'type':Sequelize[_0x2717('0x0')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x2717('0x1')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2717('0x0')]},'calleridnum':{'type':Sequelize[_0x2717('0x0')]},'calleridname':{'type':Sequelize[_0x2717('0x0')]},'queue':{'type':Sequelize[_0x2717('0x0')]},'interface':{'type':Sequelize[_0x2717('0x0')]},'membername':{'type':Sequelize[_0x2717('0x0')]},'agentcalledAt':{'type':Sequelize[_0x2717('0x2')]},'agentconnectAt':{'type':Sequelize[_0x2717('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2717('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x2717('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2717('0x1')]},'reason':{'type':Sequelize[_0x2717('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x2717('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2717('0x2')]},'agentdump':{'type':Sequelize[_0x2717('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2717('0x2')]},'lastevent':{'type':Sequelize[_0x2717('0x0')]},'channel':{'type':Sequelize[_0x2717('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2717('0x0')]},'connectedlinename':{'type':Sequelize[_0x2717('0x0')]},'language':{'type':Sequelize[_0x2717('0x0')]},'accountcode':{'type':Sequelize[_0x2717('0x0')]},'context':{'type':Sequelize[_0x2717('0x0')]},'exten':{'type':Sequelize[_0x2717('0x0')]},'priority':{'type':Sequelize[_0x2717('0x0')]},'destchannel':{'type':Sequelize[_0x2717('0x0')]},'destchannelstate':{'type':Sequelize[_0x2717('0x1')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2717('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x2717('0x0')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2717('0x0')]},'destcontext':{'type':Sequelize[_0x2717('0x0')]},'destexten':{'type':Sequelize[_0x2717('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x2717('0x0')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x2717('0x0')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x2717('0x0')]},'to':{'type':Sequelize[_0x2717('0x0')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x2717('0x4')]},'text':{'type':Sequelize[_0x2717('0x4')]},'status':{'type':Sequelize[_0x2717('0x5')]('SENT',_0x2717('0x6'),_0x2717('0x7'),_0x2717('0x8'))},'url':{'type':Sequelize[_0x2717('0x0')]},'app':{'type':Sequelize[_0x2717('0x0')]},'appdata':{'type':Sequelize[_0x2717('0x0')]},'projectId':{'type':Sequelize[_0x2717('0x1')]}}; \ No newline at end of file +var _0x3a96=['SENT','SENDING','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x56cffb,_0x1328f4){var _0xcf62b1=function(_0x2f0a83){while(--_0x2f0a83){_0x56cffb['push'](_0x56cffb['shift']());}};_0xcf62b1(++_0x1328f4);}(_0x3a96,0xf2));var _0x63a9=function(_0x9ef177,_0x3eb331){_0x9ef177=_0x9ef177-0x0;var _0x32fa65=_0x3a96[_0x9ef177];return _0x32fa65;};'use strict';var Sequelize=require(_0x63a9('0x0'));module[_0x63a9('0x1')]={'integration':{'type':Sequelize[_0x63a9('0x2')]},'eventChannel':{'type':Sequelize[_0x63a9('0x2')]},'exitStatus':{'type':Sequelize[_0x63a9('0x2')]},'ticketId':{'type':Sequelize[_0x63a9('0x2')]},'integrationId':{'type':Sequelize[_0x63a9('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x63a9('0x2')]},'calleridnum':{'type':Sequelize[_0x63a9('0x2')]},'calleridname':{'type':Sequelize[_0x63a9('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x63a9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x63a9('0x4')]},'agentconnectAt':{'type':Sequelize[_0x63a9('0x4')]},'holdtime':{'type':Sequelize[_0x63a9('0x3')]},'agentcomplete':{'type':Sequelize[_0x63a9('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x63a9('0x4')]},'talktime':{'type':Sequelize[_0x63a9('0x3')]},'agentacw':{'type':Sequelize[_0x63a9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x63a9('0x3')]},'reason':{'type':Sequelize[_0x63a9('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x63a9('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x63a9('0x4')]},'agentdump':{'type':Sequelize[_0x63a9('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x63a9('0x4')]},'lastevent':{'type':Sequelize[_0x63a9('0x2')]},'channel':{'type':Sequelize[_0x63a9('0x2')]},'channelstate':{'type':Sequelize[_0x63a9('0x3')]},'channelstatedesc':{'type':Sequelize[_0x63a9('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x63a9('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x63a9('0x2')]},'exten':{'type':Sequelize[_0x63a9('0x2')]},'priority':{'type':Sequelize[_0x63a9('0x2')]},'destchannel':{'type':Sequelize[_0x63a9('0x2')]},'destchannelstate':{'type':Sequelize[_0x63a9('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x63a9('0x2')]},'destcalleridnum':{'type':Sequelize[_0x63a9('0x2')]},'destcalleridname':{'type':Sequelize[_0x63a9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x63a9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x63a9('0x2')]},'destlanguage':{'type':Sequelize[_0x63a9('0x2')]},'destaccountcode':{'type':Sequelize[_0x63a9('0x2')]},'destcontext':{'type':Sequelize[_0x63a9('0x2')]},'destexten':{'type':Sequelize[_0x63a9('0x2')]},'destpriority':{'type':Sequelize[_0x63a9('0x2')]},'destuniqueid':{'type':Sequelize[_0x63a9('0x2')]},'messageId':{'type':Sequelize[_0x63a9('0x2')]},'inReplyTo':{'type':Sequelize[_0x63a9('0x2')]},'subject':{'type':Sequelize[_0x63a9('0x2')]},'from':{'type':Sequelize[_0x63a9('0x2')]},'to':{'type':Sequelize[_0x63a9('0x2')]},'cc':{'type':Sequelize[_0x63a9('0x2')]},'attachment':{'type':Sequelize[_0x63a9('0x6')]},'html':{'type':Sequelize[_0x63a9('0x6')]},'text':{'type':Sequelize[_0x63a9('0x6')]},'status':{'type':Sequelize[_0x63a9('0x7')](_0x63a9('0x8'),_0x63a9('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x63a9('0x2')]},'app':{'type':Sequelize[_0x63a9('0x2')]},'appdata':{'type':Sequelize[_0x63a9('0x2')]},'projectId':{'type':Sequelize[_0x63a9('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 9da9d4e..151cc0c 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 _0xd510=['../../config/logger','api','../../config/utils','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','then','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x484af5,_0x2b07ad){var _0xa895df=function(_0x5e9846){while(--_0x5e9846){_0x484af5['push'](_0x484af5['shift']());}};_0xa895df(++_0x2b07ad);}(_0xd510,0x1cc));var _0x0d51=function(_0x42fb66,_0x2f7f7e){_0x42fb66=_0x42fb66-0x0;var _0x197e2a=_0xd510[_0x42fb66];return _0x197e2a;};'use strict';var pdf=require(_0x0d51('0x0'));var emlformat=require(_0x0d51('0x1'));var rimraf=require(_0x0d51('0x2'));var zipdir=require(_0x0d51('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d51('0x4'));var moment=require(_0x0d51('0x5'));var BPromise=require(_0x0d51('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0d51('0x7'));var sox=require(_0x0d51('0x8'));var csv=require(_0x0d51('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0d51('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0d51('0x9'));var querystring=require(_0x0d51('0xb'));var Papa=require(_0x0d51('0xc'));var Redis=require(_0x0d51('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0d51('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d51('0xf'));var logger=require(_0x0d51('0x10'))(_0x0d51('0x11'));var utils=require(_0x0d51('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5203ba,_0x439d30){_0x439d30=_0x439d30||0xcc;return function(_0xe05336){if(_0xe05336){return _0x5203ba[_0x0d51('0x13')](_0x439d30);}return _0x5203ba['status'](_0x439d30)['end']();};}function respondWithResult(_0x4d2911,_0x4599d2){_0x4599d2=_0x4599d2||0xc8;return function(_0x447274){if(_0x447274){return _0x4d2911[_0x0d51('0x14')](_0x4599d2)['json'](_0x447274);}};}function respondWithFilteredResult(_0x4e2c29,_0x43c464){return function(_0xf38740){if(_0xf38740){var _0x5b5e5d=_0xf38740[_0x0d51('0x15')],_0x1c0d66=_0x43c464[_0x0d51('0x16')],_0x2174fd=_0x43c464[_0x0d51('0x16')]+_0x43c464[_0x0d51('0x17')],_0x2ba02c;if(_0x2174fd>=_0x5b5e5d){_0x2174fd=_0x5b5e5d;_0x2ba02c=0xc8;}else{_0x2ba02c=0xce;}_0x4e2c29[_0x0d51('0x14')](_0x2ba02c);return _0x4e2c29[_0x0d51('0x18')](_0x0d51('0x19'),_0x1c0d66+'-'+_0x2174fd+'/'+_0x5b5e5d)[_0x0d51('0x1a')](_0xf38740);}return null;};}function patchUpdates(_0x959b02){return function(_0x4c0b17){try{jsonpatch['apply'](_0x4c0b17,_0x959b02,!![]);}catch(_0x1cd8fc){return BPromise[_0x0d51('0x1b')](_0x1cd8fc);}return _0x4c0b17[_0x0d51('0x1c')]();};}function saveUpdates(_0x4ed6ff,_0xcbbd9a){return function(_0x17add9){if(_0x17add9){return _0x17add9['update'](_0x4ed6ff)[_0x0d51('0x1d')](function(_0x3709c7){return _0x3709c7;});}return null;};}function removeEntity(_0x4f7640,_0x38edf7){return function(_0x5d7181){if(_0x5d7181){return _0x5d7181['destroy']()['then'](function(){_0x4f7640['status'](0xcc)[_0x0d51('0x1e')]();});}};}function handleEntityNotFound(_0x59b996,_0x1ef3e4){return function(_0x77af2a){if(!_0x77af2a){_0x59b996[_0x0d51('0x13')](0x194);}return _0x77af2a;};}function handleError(_0x16222f,_0x19d790){_0x19d790=_0x19d790||0x1f4;return function(_0x586973){logger[_0x0d51('0x1f')](_0x586973[_0x0d51('0x20')]);if(_0x586973['name']){delete _0x586973[_0x0d51('0x21')];}_0x16222f[_0x0d51('0x14')](_0x19d790)[_0x0d51('0x22')](_0x586973);};}exports[_0x0d51('0x23')]=function(_0x58b851,_0x557bbb){var _0x58e21f={},_0x4b3046={},_0xee8ae5={'count':0x0,'rows':[]};var _0x19be36=_[_0x0d51('0x24')](db[_0x0d51('0x25')][_0x0d51('0x26')],function(_0x4a0ce5){return{'name':_0x4a0ce5['fieldName'],'type':_0x4a0ce5[_0x0d51('0x27')]['key']};});_0x4b3046[_0x0d51('0x28')]=_[_0x0d51('0x24')](_0x19be36,_0x0d51('0x21'));_0x4b3046[_0x0d51('0x29')]=_['keys'](_0x58b851[_0x0d51('0x29')]);_0x4b3046[_0x0d51('0x2a')]=_[_0x0d51('0x2b')](_0x4b3046[_0x0d51('0x28')],_0x4b3046[_0x0d51('0x29')]);_0x58e21f['attributes']=_[_0x0d51('0x2b')](_0x4b3046[_0x0d51('0x28')],qs['fields'](_0x58b851[_0x0d51('0x29')]['fields']));_0x58e21f[_0x0d51('0x2c')]=_0x58e21f['attributes'][_0x0d51('0x2d')]?_0x58e21f[_0x0d51('0x2c')]:_0x4b3046['model'];if(!_0x58b851['query'][_0x0d51('0x2e')](_0x0d51('0x2f'))){_0x58e21f[_0x0d51('0x17')]=qs[_0x0d51('0x17')](_0x58b851[_0x0d51('0x29')][_0x0d51('0x17')]);_0x58e21f[_0x0d51('0x16')]=qs[_0x0d51('0x16')](_0x58b851[_0x0d51('0x29')][_0x0d51('0x16')]);}_0x58e21f[_0x0d51('0x30')]=qs[_0x0d51('0x31')](_0x58b851[_0x0d51('0x29')][_0x0d51('0x31')]);_0x58e21f[_0x0d51('0x32')]=qs['filters'](_['pick'](_0x58b851[_0x0d51('0x29')],_0x4b3046[_0x0d51('0x2a')]),_0x19be36);if(_0x58b851[_0x0d51('0x29')]['filter']){_0x58e21f[_0x0d51('0x32')]=_[_0x0d51('0x33')](_0x58e21f['where'],{'$or':_[_0x0d51('0x24')](_0x19be36,function(_0x54f19e){if(_0x54f19e[_0x0d51('0x27')]!==_0x0d51('0x34')){var _0xe38f66={};_0xe38f66[_0x54f19e['name']]={'$like':'%'+_0x58b851[_0x0d51('0x29')]['filter']+'%'};return _0xe38f66;}})});}_0x58e21f=_[_0x0d51('0x33')]({},_0x58e21f,_0x58b851[_0x0d51('0x35')]);var _0x2dd37b={'where':_0x58e21f[_0x0d51('0x32')]};return db['IntegrationReport']['count'](_0x2dd37b)['then'](function(_0x32dfbd){_0xee8ae5['count']=_0x32dfbd;if(_0x58b851[_0x0d51('0x29')][_0x0d51('0x36')]){_0x58e21f[_0x0d51('0x37')]=[{'all':!![]}];}return db[_0x0d51('0x25')][_0x0d51('0x38')](_0x58e21f);})[_0x0d51('0x1d')](function(_0x3cfc4d){_0xee8ae5['rows']=_0x3cfc4d;return _0xee8ae5;})[_0x0d51('0x1d')](respondWithFilteredResult(_0x557bbb,_0x58e21f))[_0x0d51('0x39')](handleError(_0x557bbb,null));};exports[_0x0d51('0x3a')]=function(_0x1b8cc5,_0x51188e){var _0x5a6be3={'raw':![],'where':{'id':_0x1b8cc5[_0x0d51('0x3b')]['id']}},_0x514ab0={};_0x514ab0[_0x0d51('0x28')]=_['keys'](db[_0x0d51('0x25')][_0x0d51('0x26')]);_0x514ab0[_0x0d51('0x29')]=_[_0x0d51('0x3c')](_0x1b8cc5['query']);_0x514ab0[_0x0d51('0x2a')]=_['intersection'](_0x514ab0[_0x0d51('0x28')],_0x514ab0[_0x0d51('0x29')]);_0x5a6be3[_0x0d51('0x2c')]=_[_0x0d51('0x2b')](_0x514ab0['model'],qs['fields'](_0x1b8cc5[_0x0d51('0x29')][_0x0d51('0x3d')]));_0x5a6be3['attributes']=_0x5a6be3[_0x0d51('0x2c')][_0x0d51('0x2d')]?_0x5a6be3[_0x0d51('0x2c')]:_0x514ab0[_0x0d51('0x28')];if(_0x1b8cc5[_0x0d51('0x29')][_0x0d51('0x36')]){_0x5a6be3[_0x0d51('0x37')]=[{'all':!![]}];}_0x5a6be3=_[_0x0d51('0x33')]({},_0x5a6be3,_0x1b8cc5['options']);return db['IntegrationReport'][_0x0d51('0x3e')](_0x5a6be3)[_0x0d51('0x1d')](handleEntityNotFound(_0x51188e,null))['then'](respondWithResult(_0x51188e,null))[_0x0d51('0x39')](handleError(_0x51188e,null));};exports[_0x0d51('0x3f')]=function(_0x3b7734,_0x4c12d8){return db[_0x0d51('0x25')]['create'](_0x3b7734[_0x0d51('0x40')],{})['then'](respondWithResult(_0x4c12d8,0xc9))[_0x0d51('0x39')](handleError(_0x4c12d8,null));};exports[_0x0d51('0x41')]=function(_0x3b7ef7,_0x3d6efc){if(_0x3b7ef7[_0x0d51('0x40')]['id']){delete _0x3b7ef7['body']['id'];}return db[_0x0d51('0x25')][_0x0d51('0x3e')]({'where':{'id':_0x3b7ef7['params']['id']}})[_0x0d51('0x1d')](handleEntityNotFound(_0x3d6efc,null))[_0x0d51('0x1d')](saveUpdates(_0x3b7ef7['body'],null))[_0x0d51('0x1d')](respondWithResult(_0x3d6efc,null))[_0x0d51('0x39')](handleError(_0x3d6efc,null));};exports[_0x0d51('0x42')]=function(_0xda57d3,_0x1db57b){return db['IntegrationReport'][_0x0d51('0x3e')]({'where':{'id':_0xda57d3[_0x0d51('0x3b')]['id']}})[_0x0d51('0x1d')](handleEntityNotFound(_0x1db57b,null))[_0x0d51('0x1d')](removeEntity(_0x1db57b,null))[_0x0d51('0x39')](handleError(_0x1db57b,null));};exports[_0x0d51('0x43')]=function(_0x5d636a,_0x1e2ae8){return db[_0x0d51('0x25')][_0x0d51('0x43')]()['then'](respondWithResult(_0x1e2ae8,null))['catch'](handleError(_0x1e2ae8,null));}; \ No newline at end of file +var _0x8e65=['save','then','destroy','error','stack','name','send','IntegrationReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','show','params','fields','include','find','body','catch','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject'];(function(_0x4f665f,_0x22745e){var _0x4994eb=function(_0x578885){while(--_0x578885){_0x4f665f['push'](_0x4f665f['shift']());}};_0x4994eb(++_0x22745e);}(_0x8e65,0x1a0));var _0x58e6=function(_0x80578c,_0x1a7499){_0x80578c=_0x80578c-0x0;var _0x1389a3=_0x8e65[_0x80578c];return _0x1389a3;};'use strict';var pdf=require(_0x58e6('0x0'));var emlformat=require(_0x58e6('0x1'));var rimraf=require(_0x58e6('0x2'));var zipdir=require(_0x58e6('0x3'));var jsonpatch=require(_0x58e6('0x4'));var rp=require('request-promise');var moment=require(_0x58e6('0x5'));var BPromise=require(_0x58e6('0x6'));var Mustache=require(_0x58e6('0x7'));var util=require(_0x58e6('0x8'));var path=require(_0x58e6('0x9'));var sox=require(_0x58e6('0xa'));var csv=require(_0x58e6('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x58e6('0xc'));var squel=require(_0x58e6('0xd'));var crypto=require('crypto');var jsforce=require(_0x58e6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x58e6('0xb'));var querystring=require(_0x58e6('0xf'));var Papa=require(_0x58e6('0x10'));var Redis=require(_0x58e6('0x11'));var authService=require(_0x58e6('0x12'));var qs=require(_0x58e6('0x13'));var as=require(_0x58e6('0x14'));var hardwareService=require(_0x58e6('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x58e6('0x16'));var config=require(_0x58e6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e7e6,_0xc66776){_0xc66776=_0xc66776||0xcc;return function(_0x386513){if(_0x386513){return _0x24e7e6[_0x58e6('0x18')](_0xc66776);}return _0x24e7e6[_0x58e6('0x19')](_0xc66776)[_0x58e6('0x1a')]();};}function respondWithResult(_0x21564c,_0x55a9ee){_0x55a9ee=_0x55a9ee||0xc8;return function(_0x1cc5df){if(_0x1cc5df){return _0x21564c['status'](_0x55a9ee)[_0x58e6('0x1b')](_0x1cc5df);}};}function respondWithFilteredResult(_0x1d33de,_0x19c0ae){return function(_0x1bab9c){if(_0x1bab9c){var _0x4ed4e3=_0x1bab9c[_0x58e6('0x1c')],_0x4e2c2f=_0x19c0ae[_0x58e6('0x1d')],_0x3a026f=_0x19c0ae[_0x58e6('0x1d')]+_0x19c0ae['limit'],_0x59fce5;if(_0x3a026f>=_0x4ed4e3){_0x3a026f=_0x4ed4e3;_0x59fce5=0xc8;}else{_0x59fce5=0xce;}_0x1d33de['status'](_0x59fce5);return _0x1d33de[_0x58e6('0x1e')](_0x58e6('0x1f'),_0x4e2c2f+'-'+_0x3a026f+'/'+_0x4ed4e3)[_0x58e6('0x1b')](_0x1bab9c);}return null;};}function patchUpdates(_0x4f1acc){return function(_0xcd4b1c){try{jsonpatch[_0x58e6('0x20')](_0xcd4b1c,_0x4f1acc,!![]);}catch(_0x57386b){return BPromise[_0x58e6('0x21')](_0x57386b);}return _0xcd4b1c[_0x58e6('0x22')]();};}function saveUpdates(_0x169b73,_0x557ec4){return function(_0x2f4b7b){if(_0x2f4b7b){return _0x2f4b7b['update'](_0x169b73)[_0x58e6('0x23')](function(_0xd1585a){return _0xd1585a;});}return null;};}function removeEntity(_0x3ee06f,_0x376798){return function(_0xdaff3){if(_0xdaff3){return _0xdaff3[_0x58e6('0x24')]()[_0x58e6('0x23')](function(){_0x3ee06f['status'](0xcc)[_0x58e6('0x1a')]();});}};}function handleEntityNotFound(_0x13c3e6,_0x2d1e4b){return function(_0x5af00f){if(!_0x5af00f){_0x13c3e6[_0x58e6('0x18')](0x194);}return _0x5af00f;};}function handleError(_0x1915ef,_0x410ecb){_0x410ecb=_0x410ecb||0x1f4;return function(_0x4fff60){logger[_0x58e6('0x25')](_0x4fff60[_0x58e6('0x26')]);if(_0x4fff60['name']){delete _0x4fff60[_0x58e6('0x27')];}_0x1915ef['status'](_0x410ecb)[_0x58e6('0x28')](_0x4fff60);};}exports['index']=function(_0x36e54d,_0xa366a6){var _0x5cbe40={},_0x31a305={},_0x269b68={'count':0x0,'rows':[]};var _0x2a3951=_['map'](db[_0x58e6('0x29')][_0x58e6('0x2a')],function(_0x526d44){return{'name':_0x526d44[_0x58e6('0x2b')],'type':_0x526d44[_0x58e6('0x2c')][_0x58e6('0x2d')]};});_0x31a305[_0x58e6('0x2e')]=_[_0x58e6('0x2f')](_0x2a3951,_0x58e6('0x27'));_0x31a305['query']=_[_0x58e6('0x30')](_0x36e54d[_0x58e6('0x31')]);_0x31a305[_0x58e6('0x32')]=_[_0x58e6('0x33')](_0x31a305[_0x58e6('0x2e')],_0x31a305[_0x58e6('0x31')]);_0x5cbe40[_0x58e6('0x34')]=_[_0x58e6('0x33')](_0x31a305['model'],qs['fields'](_0x36e54d[_0x58e6('0x31')]['fields']));_0x5cbe40[_0x58e6('0x34')]=_0x5cbe40['attributes'][_0x58e6('0x35')]?_0x5cbe40[_0x58e6('0x34')]:_0x31a305['model'];if(!_0x36e54d[_0x58e6('0x31')][_0x58e6('0x36')](_0x58e6('0x37'))){_0x5cbe40[_0x58e6('0x38')]=qs[_0x58e6('0x38')](_0x36e54d['query']['limit']);_0x5cbe40[_0x58e6('0x1d')]=qs[_0x58e6('0x1d')](_0x36e54d[_0x58e6('0x31')]['offset']);}_0x5cbe40[_0x58e6('0x39')]=qs[_0x58e6('0x3a')](_0x36e54d[_0x58e6('0x31')][_0x58e6('0x3a')]);_0x5cbe40[_0x58e6('0x3b')]=qs['filters'](_[_0x58e6('0x3c')](_0x36e54d[_0x58e6('0x31')],_0x31a305[_0x58e6('0x32')]),_0x2a3951);if(_0x36e54d[_0x58e6('0x31')][_0x58e6('0x3d')]){_0x5cbe40['where']=_['merge'](_0x5cbe40['where'],{'$or':_[_0x58e6('0x2f')](_0x2a3951,function(_0x3ad2b0){if(_0x3ad2b0[_0x58e6('0x2c')]!==_0x58e6('0x3e')){var _0x61096c={};_0x61096c[_0x3ad2b0[_0x58e6('0x27')]]={'$like':'%'+_0x36e54d['query'][_0x58e6('0x3d')]+'%'};return _0x61096c;}})});}_0x5cbe40=_[_0x58e6('0x3f')]({},_0x5cbe40,_0x36e54d[_0x58e6('0x40')]);var _0x3ce46a={'where':_0x5cbe40[_0x58e6('0x3b')]};return db[_0x58e6('0x29')]['count'](_0x3ce46a)['then'](function(_0x3d800e){_0x269b68[_0x58e6('0x1c')]=_0x3d800e;if(_0x36e54d[_0x58e6('0x31')]['includeAll']){_0x5cbe40['include']=[{'all':!![]}];}return db[_0x58e6('0x29')]['findAll'](_0x5cbe40);})['then'](function(_0x50719d){_0x269b68[_0x58e6('0x41')]=_0x50719d;return _0x269b68;})[_0x58e6('0x23')](respondWithFilteredResult(_0xa366a6,_0x5cbe40))['catch'](handleError(_0xa366a6,null));};exports[_0x58e6('0x42')]=function(_0x2e2f8b,_0x2df1e2){var _0x17202e={'raw':![],'where':{'id':_0x2e2f8b[_0x58e6('0x43')]['id']}},_0x1390df={};_0x1390df[_0x58e6('0x2e')]=_['keys'](db[_0x58e6('0x29')][_0x58e6('0x2a')]);_0x1390df[_0x58e6('0x31')]=_[_0x58e6('0x30')](_0x2e2f8b[_0x58e6('0x31')]);_0x1390df[_0x58e6('0x32')]=_[_0x58e6('0x33')](_0x1390df[_0x58e6('0x2e')],_0x1390df[_0x58e6('0x31')]);_0x17202e['attributes']=_[_0x58e6('0x33')](_0x1390df['model'],qs[_0x58e6('0x44')](_0x2e2f8b[_0x58e6('0x31')][_0x58e6('0x44')]));_0x17202e[_0x58e6('0x34')]=_0x17202e['attributes']['length']?_0x17202e['attributes']:_0x1390df[_0x58e6('0x2e')];if(_0x2e2f8b[_0x58e6('0x31')]['includeAll']){_0x17202e[_0x58e6('0x45')]=[{'all':!![]}];}_0x17202e=_[_0x58e6('0x3f')]({},_0x17202e,_0x2e2f8b['options']);return db[_0x58e6('0x29')][_0x58e6('0x46')](_0x17202e)[_0x58e6('0x23')](handleEntityNotFound(_0x2df1e2,null))[_0x58e6('0x23')](respondWithResult(_0x2df1e2,null))['catch'](handleError(_0x2df1e2,null));};exports['create']=function(_0xc133cb,_0x5b51de){return db['IntegrationReport']['create'](_0xc133cb[_0x58e6('0x47')],{})['then'](respondWithResult(_0x5b51de,0xc9))[_0x58e6('0x48')](handleError(_0x5b51de,null));};exports[_0x58e6('0x49')]=function(_0x53b018,_0x4a0a16){if(_0x53b018[_0x58e6('0x47')]['id']){delete _0x53b018[_0x58e6('0x47')]['id'];}return db[_0x58e6('0x29')]['find']({'where':{'id':_0x53b018['params']['id']}})[_0x58e6('0x23')](handleEntityNotFound(_0x4a0a16,null))[_0x58e6('0x23')](saveUpdates(_0x53b018[_0x58e6('0x47')],null))[_0x58e6('0x23')](respondWithResult(_0x4a0a16,null))[_0x58e6('0x48')](handleError(_0x4a0a16,null));};exports[_0x58e6('0x24')]=function(_0x4116c2,_0x3039c5){return db[_0x58e6('0x29')][_0x58e6('0x46')]({'where':{'id':_0x4116c2[_0x58e6('0x43')]['id']}})[_0x58e6('0x23')](handleEntityNotFound(_0x3039c5,null))[_0x58e6('0x23')](removeEntity(_0x3039c5,null))[_0x58e6('0x48')](handleError(_0x3039c5,null));};exports['describe']=function(_0x423f01,_0x3e056c){return db[_0x58e6('0x29')][_0x58e6('0x4a')]()[_0x58e6('0x23')](respondWithResult(_0x3e056c,null))['catch'](handleError(_0x3e056c,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 33878de..c90fc71 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 _0xa0ee=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x3ad46a,_0x420179){var _0x1f6cfc=function(_0x539f2b){while(--_0x539f2b){_0x3ad46a['push'](_0x3ad46a['shift']());}};_0x1f6cfc(++_0x420179);}(_0xa0ee,0xc8));var _0xea0e=function(_0xdf13c9,_0x5da43f){_0xdf13c9=_0xdf13c9-0x0;var _0x302aaa=_0xa0ee[_0xdf13c9];return _0x302aaa;};'use strict';var _=require(_0xea0e('0x0'));var util=require(_0xea0e('0x1'));var logger=require(_0xea0e('0x2'))(_0xea0e('0x3'));var moment=require(_0xea0e('0x4'));var BPromise=require(_0xea0e('0x5'));var rp=require(_0xea0e('0x6'));var fs=require('fs');var path=require(_0xea0e('0x7'));var rimraf=require('rimraf');var config=require(_0xea0e('0x8'));var attributes=require(_0xea0e('0x9'));module[_0xea0e('0xa')]=function(_0x388e68,_0x3ff8d8){return _0x388e68[_0xea0e('0xb')](_0xea0e('0xc'),attributes,{'tableName':_0xea0e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e7c=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define','IntegrationReport','report_integration'];(function(_0x438e18,_0x52e2c5){var _0x50c6ea=function(_0x7ae358){while(--_0x7ae358){_0x438e18['push'](_0x438e18['shift']());}};_0x50c6ea(++_0x52e2c5);}(_0x4e7c,0x13f));var _0xc4e7=function(_0x31f89b,_0x146f7e){_0x31f89b=_0x31f89b-0x0;var _0x1ee03c=_0x4e7c[_0x31f89b];return _0x1ee03c;};'use strict';var _=require(_0xc4e7('0x0'));var util=require(_0xc4e7('0x1'));var logger=require(_0xc4e7('0x2'))(_0xc4e7('0x3'));var moment=require(_0xc4e7('0x4'));var BPromise=require('bluebird');var rp=require(_0xc4e7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4e7('0x6'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xc4e7('0x7')]=function(_0x4fd0a8,_0x4c595d){return _0x4fd0a8[_0xc4e7('0x8')](_0xc4e7('0x9'),attributes,{'tableName':_0xc4e7('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 7498d4f..818d494 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 _0x0b0e=['IntegrationReport,\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','IntegrationReport,\x20%s,\x20%s','debug'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x0b0e[_0x2d89ce];return _0x3fad10;};'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')]('IntegrationReport,\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 _0x0713=['IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x25ee8d,_0x437416){var _0x2b6757=function(_0xc607b){while(--_0xc607b){_0x25ee8d['push'](_0x25ee8d['shift']());}};_0x2b6757(++_0x437416);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 18ce680..4d370b5 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 _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x9ce42d,_0x153723){var _0xcb720e=function(_0x4f931d){while(--_0x4f931d){_0x9ce42d['push'](_0x9ce42d['shift']());}};_0xcb720e(++_0x153723);}(_0x3e74,0x175));var _0x43e7=function(_0x59e200,_0x4ced0d){_0x59e200=_0x59e200-0x0;var _0x5157fe=_0x3e74[_0x59e200];return _0x5157fe;};'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')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./interval.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['addInterval']);router[_0x7995('0xe')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 071748f..94f6f60 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 _0x0f18=['STRING','sequelize'];(function(_0x4cccb2,_0x165947){var _0x1f73f3=function(_0x409801){while(--_0x409801){_0x4cccb2['push'](_0x4cccb2['shift']());}};_0x1f73f3(++_0x165947);}(_0x0f18,0x163));var _0x80f1=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0x0f18[_0x51ab83];return _0x14b6de;};'use strict';var Sequelize=require(_0x80f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x80f1('0x1')]},'description':{'type':Sequelize[_0x80f1('0x1')]},'interval':{'type':Sequelize[_0x80f1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xeabb=['STRING','sequelize'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xeabb,0x103));var _0xbeab=function(_0x17516a,_0x2824c1){_0x17516a=_0x17516a-0x0;var _0x22e61f=_0xeabb[_0x17516a];return _0x22e61f;};'use strict';var Sequelize=require(_0xbeab('0x0'));module['exports']={'name':{'type':Sequelize[_0xbeab('0x1')]},'description':{'type':Sequelize[_0xbeab('0x1')]},'interval':{'type':Sequelize[_0xbeab('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 28cddc4..a679eea 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 _0xd368=['../../components/extensions/rewrite','sendStatus','end','json','offset','limit','set','update','then','destroy','get','Intervals','status','error','stack','name','index','Interval','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','order','pick','getIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb'];(function(_0xd2efdb,_0x2eca6e){var _0x5f17b1=function(_0x1de09a){while(--_0x1de09a){_0xd2efdb['push'](_0xd2efdb['shift']());}};_0x5f17b1(++_0x2eca6e);}(_0xd368,0xea));var _0x8d36=function(_0xa441b7,_0x2c3536){_0xa441b7=_0xa441b7-0x0;var _0x3cd1f9=_0xd368[_0xa441b7];return _0x3cd1f9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8d36('0x0'));var rimraf=require(_0x8d36('0x1'));var zipdir=require(_0x8d36('0x2'));var jsonpatch=require(_0x8d36('0x3'));var rp=require(_0x8d36('0x4'));var moment=require(_0x8d36('0x5'));var BPromise=require(_0x8d36('0x6'));var Mustache=require(_0x8d36('0x7'));var util=require(_0x8d36('0x8'));var path=require(_0x8d36('0x9'));var sox=require(_0x8d36('0xa'));var csv=require(_0x8d36('0xb'));var ejs=require(_0x8d36('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8d36('0xd'));var crypto=require('crypto');var jsforce=require(_0x8d36('0xe'));var deskjs=require(_0x8d36('0xf'));var toCsv=require(_0x8d36('0xb'));var querystring=require(_0x8d36('0x10'));var Papa=require(_0x8d36('0x11'));var Redis=require(_0x8d36('0x12'));var authService=require(_0x8d36('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d36('0x14'));var logger=require(_0x8d36('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x8d36('0x16'));var db=require(_0x8d36('0x17'))['db'];var extensions=require(_0x8d36('0x18'));function respondWithStatusCode(_0x4a8e5e,_0x449730){_0x449730=_0x449730||0xcc;return function(_0xa00b68){if(_0xa00b68){return _0x4a8e5e[_0x8d36('0x19')](_0x449730);}return _0x4a8e5e['status'](_0x449730)[_0x8d36('0x1a')]();};}function respondWithResult(_0x40545a,_0x39ab1a){_0x39ab1a=_0x39ab1a||0xc8;return function(_0xf82828){if(_0xf82828){return _0x40545a['status'](_0x39ab1a)[_0x8d36('0x1b')](_0xf82828);}};}function respondWithFilteredResult(_0x421a0d,_0x47d5fa){return function(_0x36ae4e){if(_0x36ae4e){var _0x3cf1b8=_0x36ae4e['count'],_0x4975d0=_0x47d5fa[_0x8d36('0x1c')],_0x1b224e=_0x47d5fa[_0x8d36('0x1c')]+_0x47d5fa[_0x8d36('0x1d')],_0x5235a1;if(_0x1b224e>=_0x3cf1b8){_0x1b224e=_0x3cf1b8;_0x5235a1=0xc8;}else{_0x5235a1=0xce;}_0x421a0d['status'](_0x5235a1);return _0x421a0d[_0x8d36('0x1e')]('Content-Range',_0x4975d0+'-'+_0x1b224e+'/'+_0x3cf1b8)[_0x8d36('0x1b')](_0x36ae4e);}return null;};}function patchUpdates(_0x5e7eb1){return function(_0x380b8c){try{jsonpatch['apply'](_0x380b8c,_0x5e7eb1,!![]);}catch(_0x513a8a){return BPromise['reject'](_0x513a8a);}return _0x380b8c['save']();};}function saveUpdates(_0x14f581,_0x699caa){return function(_0x50d4ae){if(_0x50d4ae){return _0x50d4ae[_0x8d36('0x1f')](_0x14f581)[_0x8d36('0x20')](function(_0xbee763){return _0xbee763;});}return null;};}function removeEntity(_0x5c3e70,_0x5c30d7){return function(_0x147390){if(_0x147390){return _0x147390[_0x8d36('0x21')]()[_0x8d36('0x20')](function(){var _0x115453=_0x147390[_0x8d36('0x22')]({'plain':!![]});var _0x3a7722=_0x8d36('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a7722,'resourceId':_0x115453['id']}})[_0x8d36('0x20')](function(){return _0x147390;});})[_0x8d36('0x20')](function(){_0x5c3e70[_0x8d36('0x24')](0xcc)[_0x8d36('0x1a')]();});}};}function handleEntityNotFound(_0xe1724e,_0x11570b){return function(_0x5a095f){if(!_0x5a095f){_0xe1724e[_0x8d36('0x19')](0x194);}return _0x5a095f;};}function handleError(_0x30d76e,_0x1deb66){_0x1deb66=_0x1deb66||0x1f4;return function(_0x18c1cc){logger[_0x8d36('0x25')](_0x18c1cc[_0x8d36('0x26')]);if(_0x18c1cc[_0x8d36('0x27')]){delete _0x18c1cc[_0x8d36('0x27')];}_0x30d76e[_0x8d36('0x24')](_0x1deb66)['send'](_0x18c1cc);};}exports[_0x8d36('0x28')]=function(_0x56db65,_0x38bd0b){var _0x421652={},_0x158ee4={},_0x2abab9={'count':0x0,'rows':[]};var _0x442325=_['map'](db[_0x8d36('0x29')][_0x8d36('0x2a')],function(_0x279c65){return{'name':_0x279c65[_0x8d36('0x2b')],'type':_0x279c65[_0x8d36('0x2c')]['key']};});_0x158ee4[_0x8d36('0x2d')]=_[_0x8d36('0x2e')](_0x442325,_0x8d36('0x27'));_0x158ee4[_0x8d36('0x2f')]=_[_0x8d36('0x30')](_0x56db65[_0x8d36('0x2f')]);_0x158ee4[_0x8d36('0x31')]=_['intersection'](_0x158ee4[_0x8d36('0x2d')],_0x158ee4[_0x8d36('0x2f')]);_0x421652[_0x8d36('0x32')]=_[_0x8d36('0x33')](_0x158ee4['model'],qs['fields'](_0x56db65[_0x8d36('0x2f')][_0x8d36('0x34')]));_0x421652['attributes']=_0x421652[_0x8d36('0x32')]['length']?_0x421652[_0x8d36('0x32')]:_0x158ee4[_0x8d36('0x2d')];if(!_0x56db65[_0x8d36('0x2f')][_0x8d36('0x35')](_0x8d36('0x36'))){_0x421652[_0x8d36('0x1d')]=qs['limit'](_0x56db65[_0x8d36('0x2f')]['limit']);_0x421652[_0x8d36('0x1c')]=qs[_0x8d36('0x1c')](_0x56db65['query'][_0x8d36('0x1c')]);}_0x421652['order']=qs['sort'](_0x56db65[_0x8d36('0x2f')][_0x8d36('0x37')]);_0x421652['where']=qs['filters'](_['pick'](_0x56db65[_0x8d36('0x2f')],_0x158ee4[_0x8d36('0x31')]),_0x442325);if(_0x56db65[_0x8d36('0x2f')][_0x8d36('0x38')]){_0x421652[_0x8d36('0x39')]=_['merge'](_0x421652[_0x8d36('0x39')],{'$or':_[_0x8d36('0x2e')](_0x442325,function(_0xc86ced){if(_0xc86ced[_0x8d36('0x2c')]!==_0x8d36('0x3a')){var _0x274ff0={};_0x274ff0[_0xc86ced[_0x8d36('0x27')]]={'$like':'%'+_0x56db65[_0x8d36('0x2f')][_0x8d36('0x38')]+'%'};return _0x274ff0;}})});}_0x421652=_[_0x8d36('0x3b')]({},_0x421652,_0x56db65[_0x8d36('0x3c')]);var _0x29989b={'where':_0x421652[_0x8d36('0x39')]};return db[_0x8d36('0x29')]['count'](_0x29989b)[_0x8d36('0x20')](function(_0x4cd51a){_0x2abab9['count']=_0x4cd51a;if(_0x56db65['query'][_0x8d36('0x3d')]){_0x421652[_0x8d36('0x3e')]=[{'all':!![]}];}return db[_0x8d36('0x29')][_0x8d36('0x3f')](_0x421652);})[_0x8d36('0x20')](function(_0x2cf573){_0x2abab9[_0x8d36('0x40')]=_0x2cf573;return _0x2abab9;})['then'](respondWithFilteredResult(_0x38bd0b,_0x421652))[_0x8d36('0x41')](handleError(_0x38bd0b,null));};exports[_0x8d36('0x42')]=function(_0x4f4d0e,_0x5714b2){var _0x193bbd={'raw':!![],'where':{'id':_0x4f4d0e[_0x8d36('0x43')]['id']}},_0x4903f6={};_0x4903f6['model']=_['keys'](db['Interval'][_0x8d36('0x2a')]);_0x4903f6[_0x8d36('0x2f')]=_[_0x8d36('0x30')](_0x4f4d0e['query']);_0x4903f6['filters']=_[_0x8d36('0x33')](_0x4903f6['model'],_0x4903f6[_0x8d36('0x2f')]);_0x193bbd['attributes']=_[_0x8d36('0x33')](_0x4903f6[_0x8d36('0x2d')],qs[_0x8d36('0x34')](_0x4f4d0e[_0x8d36('0x2f')][_0x8d36('0x34')]));_0x193bbd[_0x8d36('0x32')]=_0x193bbd['attributes'][_0x8d36('0x44')]?_0x193bbd[_0x8d36('0x32')]:_0x4903f6[_0x8d36('0x2d')];if(_0x4f4d0e[_0x8d36('0x2f')][_0x8d36('0x3d')]){_0x193bbd['include']=[{'all':!![]}];}_0x193bbd=_['merge']({},_0x193bbd,_0x4f4d0e[_0x8d36('0x3c')]);return db[_0x8d36('0x29')][_0x8d36('0x45')](_0x193bbd)['then'](handleEntityNotFound(_0x5714b2,null))[_0x8d36('0x20')](respondWithResult(_0x5714b2,null))[_0x8d36('0x41')](handleError(_0x5714b2,null));};exports['create']=function(_0x55e231,_0xf6cb53){return db[_0x8d36('0x29')][_0x8d36('0x46')](_0x55e231['body'],{})['then'](function(_0x594ab1){var _0x104606=_0x55e231[_0x8d36('0x47')]['get']({'plain':!![]});if(!_0x104606)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104606[_0x8d36('0x48')]==='user'){var _0x3f8376=_0x594ab1[_0x8d36('0x22')]({'plain':!![]});var _0x2b911f='Intervals';return db['UserProfileSection'][_0x8d36('0x45')]({'where':{'name':_0x2b911f,'userProfileId':_0x104606[_0x8d36('0x49')]},'raw':!![]})[_0x8d36('0x20')](function(_0x13134d){if(_0x13134d&&_0x13134d[_0x8d36('0x4a')]===0x0){return db[_0x8d36('0x4b')]['create']({'name':_0x3f8376['name'],'resourceId':_0x3f8376['id'],'type':_0x13134d[_0x8d36('0x27')],'sectionId':_0x13134d['id']},{})[_0x8d36('0x20')](function(){return _0x594ab1;});}else{return _0x594ab1;}})[_0x8d36('0x41')](function(_0x40d1d1){logger[_0x8d36('0x25')](_0x8d36('0x4c'),_0x40d1d1);throw _0x40d1d1;});}return _0x594ab1;})[_0x8d36('0x20')](respondWithResult(_0xf6cb53,0xc9))['catch'](handleError(_0xf6cb53,null));};exports[_0x8d36('0x1f')]=function(_0xfcf0a0,_0x18881c){if(_0xfcf0a0[_0x8d36('0x4d')]['id']){delete _0xfcf0a0[_0x8d36('0x4d')]['id'];}return db[_0x8d36('0x29')][_0x8d36('0x45')]({'where':{'id':_0xfcf0a0['params']['id']}})[_0x8d36('0x20')](handleEntityNotFound(_0x18881c,null))[_0x8d36('0x20')](saveUpdates(_0xfcf0a0[_0x8d36('0x4d')],null))['then'](respondWithResult(_0x18881c,null))[_0x8d36('0x41')](handleError(_0x18881c,null));};exports[_0x8d36('0x21')]=function(_0x4f475f,_0x438a95){return db['Interval'][_0x8d36('0x45')]({'where':{'id':_0x4f475f['params']['id']}})[_0x8d36('0x20')](handleEntityNotFound(_0x438a95,null))['then'](removeEntity(_0x438a95,null))[_0x8d36('0x41')](handleError(_0x438a95,null));};exports['addInterval']=function(_0x1e689d,_0x5264bd,_0x3ee17a){if(_0x1e689d[_0x8d36('0x4d')]['id']){delete _0x1e689d[_0x8d36('0x4d')]['id'];}return db[_0x8d36('0x29')][_0x8d36('0x45')]({'where':{'id':_0x1e689d[_0x8d36('0x43')]['id']}})[_0x8d36('0x20')](handleEntityNotFound(_0x5264bd,null))['then'](function(_0x45b4c9){if(_0x45b4c9){_0x1e689d['body']['IntervalId']=_0x45b4c9['id'];return db[_0x8d36('0x29')][_0x8d36('0x46')](_0x1e689d[_0x8d36('0x4d')]);}})[_0x8d36('0x20')](respondWithResult(_0x5264bd,null))[_0x8d36('0x41')](handleError(_0x5264bd,null));};exports['getIntervals']=function(_0xff45e,_0x37b206,_0x29c36a){var _0x18728b={};var _0x12d517={};var _0x1c1e70;var _0x47f96b;return db[_0x8d36('0x29')][_0x8d36('0x4e')]({'where':{'id':_0xff45e['params']['id']}})[_0x8d36('0x20')](handleEntityNotFound(_0x37b206,null))[_0x8d36('0x20')](function(_0x2661e){if(_0x2661e){_0x1c1e70=_0x2661e;_0x12d517[_0x8d36('0x2d')]=_['keys'](db[_0x8d36('0x29')][_0x8d36('0x2a')]);_0x12d517[_0x8d36('0x2f')]=_[_0x8d36('0x30')](_0xff45e[_0x8d36('0x2f')]);_0x12d517['filters']=_[_0x8d36('0x33')](_0x12d517[_0x8d36('0x2d')],_0x12d517[_0x8d36('0x2f')]);_0x18728b[_0x8d36('0x32')]=_[_0x8d36('0x33')](_0x12d517[_0x8d36('0x2d')],qs[_0x8d36('0x34')](_0xff45e[_0x8d36('0x2f')]['fields']));_0x18728b[_0x8d36('0x32')]=_0x18728b[_0x8d36('0x32')][_0x8d36('0x44')]?_0x18728b['attributes']:_0x12d517[_0x8d36('0x2d')];_0x18728b[_0x8d36('0x4f')]=qs['sort'](_0xff45e['query']['sort']);_0x18728b['where']=qs[_0x8d36('0x31')](_[_0x8d36('0x50')](_0xff45e['query'],_0x12d517[_0x8d36('0x31')]));if(_0xff45e[_0x8d36('0x2f')][_0x8d36('0x38')]){_0x18728b['where']=_[_0x8d36('0x3b')](_0x18728b[_0x8d36('0x39')],{'$or':_[_0x8d36('0x2e')](_0x18728b[_0x8d36('0x32')],function(_0x4863ab){var _0x11355b={};_0x11355b[_0x4863ab]={'$like':'%'+_0xff45e['query'][_0x8d36('0x38')]+'%'};return _0x11355b;})});}_0x18728b=_[_0x8d36('0x3b')]({},_0x18728b,_0xff45e[_0x8d36('0x3c')]);return _0x1c1e70[_0x8d36('0x51')](_0x18728b);}})[_0x8d36('0x20')](function(_0x14a7a2){if(_0x14a7a2){_0x47f96b=_0x14a7a2[_0x8d36('0x44')];if(!_0xff45e['query'][_0x8d36('0x35')](_0x8d36('0x36'))){_0x18728b[_0x8d36('0x1d')]=qs[_0x8d36('0x1d')](_0xff45e[_0x8d36('0x2f')][_0x8d36('0x1d')]);_0x18728b['offset']=qs[_0x8d36('0x1c')](_0xff45e[_0x8d36('0x2f')][_0x8d36('0x1c')]);}return _0x1c1e70[_0x8d36('0x51')](_0x18728b);}})[_0x8d36('0x20')](function(_0x4ac561){if(_0x4ac561){return _0x4ac561?{'count':_0x47f96b,'rows':_0x4ac561}:null;}})['then'](respondWithResult(_0x37b206,null))['catch'](handleError(_0x37b206,null));};exports['addIntervals']=function(_0x46dccd,_0x75cab8,_0x2fa332){return db[_0x8d36('0x29')][_0x8d36('0x4e')]({'where':{'id':_0x46dccd['params']['id']}})['then'](handleEntityNotFound(_0x75cab8,null))[_0x8d36('0x20')](function(_0x5ba8b3){if(_0x5ba8b3){return db[_0x8d36('0x52')][_0x8d36('0x53')](function(_0x23efac){return db['Interval'][_0x8d36('0x21')]({'where':{'IntervalId':_0x46dccd['params']['id']},'transaction':_0x23efac})[_0x8d36('0x20')](function(_0x1173c8){var _0x548b1e=_[_0x8d36('0x2e')](_0x46dccd['body'],function(_0x374732){delete _0x374732['id'];_0x374732[_0x8d36('0x54')]=_0x46dccd[_0x8d36('0x43')]['id'];return _0x374732;});return db[_0x8d36('0x29')][_0x8d36('0x55')](_0x548b1e,{'transaction':_0x23efac});});})[_0x8d36('0x20')](function(){return db['Interval'][_0x8d36('0x3f')]({'where':{'IntervalId':_0x46dccd['params']['id']}});});}})[_0x8d36('0x20')](respondWithResult(_0x75cab8,null))['catch'](handleError(_0x75cab8,null));}; \ No newline at end of file +var _0xf37f=['sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','Intervals','destroy','error','stack','name','send','index','map','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','include','Interval','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','length','pick','addIntervals','transaction','bulkCreate','findAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite'];(function(_0x5e7ddf,_0x3baba1){var _0x275d12=function(_0x515b65){while(--_0x515b65){_0x5e7ddf['push'](_0x5e7ddf['shift']());}};_0x275d12(++_0x3baba1);}(_0xf37f,0x15a));var _0xff37=function(_0x2e0979,_0x1d6067){_0x2e0979=_0x2e0979-0x0;var _0x486780=_0xf37f[_0x2e0979];return _0x486780;};'use strict';var pdf=require(_0xff37('0x0'));var emlformat=require(_0xff37('0x1'));var rimraf=require(_0xff37('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff37('0x3'));var rp=require(_0xff37('0x4'));var moment=require(_0xff37('0x5'));var BPromise=require(_0xff37('0x6'));var Mustache=require(_0xff37('0x7'));var util=require(_0xff37('0x8'));var path=require(_0xff37('0x9'));var sox=require(_0xff37('0xa'));var csv=require(_0xff37('0xb'));var ejs=require(_0xff37('0xc'));var fs=require('fs');var _=require(_0xff37('0xd'));var squel=require('squel');var crypto=require(_0xff37('0xe'));var jsforce=require(_0xff37('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xff37('0xb'));var querystring=require(_0xff37('0x10'));var Papa=require('papaparse');var Redis=require(_0xff37('0x11'));var authService=require(_0xff37('0x12'));var qs=require(_0xff37('0x13'));var as=require(_0xff37('0x14'));var hardwareService=require(_0xff37('0x15'));var logger=require('../../config/logger')(_0xff37('0x16'));var utils=require(_0xff37('0x17'));var config=require('../../config/environment');var db=require(_0xff37('0x18'))['db'];var extensions=require(_0xff37('0x19'));function respondWithStatusCode(_0x30f56e,_0x147cea){_0x147cea=_0x147cea||0xcc;return function(_0x49bfee){if(_0x49bfee){return _0x30f56e[_0xff37('0x1a')](_0x147cea);}return _0x30f56e[_0xff37('0x1b')](_0x147cea)[_0xff37('0x1c')]();};}function respondWithResult(_0x6e84f0,_0xa27f04){_0xa27f04=_0xa27f04||0xc8;return function(_0x1fbb3d){if(_0x1fbb3d){return _0x6e84f0['status'](_0xa27f04)[_0xff37('0x1d')](_0x1fbb3d);}};}function respondWithFilteredResult(_0x865f8d,_0x533c6f){return function(_0x1c1c30){if(_0x1c1c30){var _0x532193=_0x1c1c30[_0xff37('0x1e')],_0x1a6443=_0x533c6f[_0xff37('0x1f')],_0x89742=_0x533c6f['offset']+_0x533c6f['limit'],_0x330f9c;if(_0x89742>=_0x532193){_0x89742=_0x532193;_0x330f9c=0xc8;}else{_0x330f9c=0xce;}_0x865f8d[_0xff37('0x1b')](_0x330f9c);return _0x865f8d[_0xff37('0x20')](_0xff37('0x21'),_0x1a6443+'-'+_0x89742+'/'+_0x532193)['json'](_0x1c1c30);}return null;};}function patchUpdates(_0x5c8e75){return function(_0x338b26){try{jsonpatch[_0xff37('0x22')](_0x338b26,_0x5c8e75,!![]);}catch(_0x412439){return BPromise[_0xff37('0x23')](_0x412439);}return _0x338b26[_0xff37('0x24')]();};}function saveUpdates(_0x2be538,_0x151ea4){return function(_0x120788){if(_0x120788){return _0x120788[_0xff37('0x25')](_0x2be538)[_0xff37('0x26')](function(_0x4bc972){return _0x4bc972;});}return null;};}function removeEntity(_0x54f24e,_0x470e9a){return function(_0x2f47f1){if(_0x2f47f1){return _0x2f47f1['destroy']()[_0xff37('0x26')](function(){var _0xe82050=_0x2f47f1[_0xff37('0x27')]({'plain':!![]});var _0x578b1c=_0xff37('0x28');return db['UserProfileResource'][_0xff37('0x29')]({'where':{'type':_0x578b1c,'resourceId':_0xe82050['id']}})[_0xff37('0x26')](function(){return _0x2f47f1;});})[_0xff37('0x26')](function(){_0x54f24e['status'](0xcc)[_0xff37('0x1c')]();});}};}function handleEntityNotFound(_0x5e6de2,_0xe59c11){return function(_0x5e05d6){if(!_0x5e05d6){_0x5e6de2[_0xff37('0x1a')](0x194);}return _0x5e05d6;};}function handleError(_0x59d995,_0x12a554){_0x12a554=_0x12a554||0x1f4;return function(_0x20e609){logger[_0xff37('0x2a')](_0x20e609[_0xff37('0x2b')]);if(_0x20e609[_0xff37('0x2c')]){delete _0x20e609[_0xff37('0x2c')];}_0x59d995[_0xff37('0x1b')](_0x12a554)[_0xff37('0x2d')](_0x20e609);};}exports[_0xff37('0x2e')]=function(_0x3c40b4,_0x12f317){var _0x2bda2e={},_0x4428c2={},_0x9efab6={'count':0x0,'rows':[]};var _0x14f4d5=_[_0xff37('0x2f')](db['Interval']['rawAttributes'],function(_0x289f1c){return{'name':_0x289f1c['fieldName'],'type':_0x289f1c[_0xff37('0x30')][_0xff37('0x31')]};});_0x4428c2[_0xff37('0x32')]=_[_0xff37('0x2f')](_0x14f4d5,'name');_0x4428c2['query']=_['keys'](_0x3c40b4[_0xff37('0x33')]);_0x4428c2['filters']=_[_0xff37('0x34')](_0x4428c2[_0xff37('0x32')],_0x4428c2[_0xff37('0x33')]);_0x2bda2e[_0xff37('0x35')]=_[_0xff37('0x34')](_0x4428c2[_0xff37('0x32')],qs[_0xff37('0x36')](_0x3c40b4[_0xff37('0x33')]['fields']));_0x2bda2e[_0xff37('0x35')]=_0x2bda2e[_0xff37('0x35')]['length']?_0x2bda2e['attributes']:_0x4428c2['model'];if(!_0x3c40b4[_0xff37('0x33')][_0xff37('0x37')](_0xff37('0x38'))){_0x2bda2e[_0xff37('0x39')]=qs[_0xff37('0x39')](_0x3c40b4['query']['limit']);_0x2bda2e[_0xff37('0x1f')]=qs['offset'](_0x3c40b4[_0xff37('0x33')][_0xff37('0x1f')]);}_0x2bda2e[_0xff37('0x3a')]=qs[_0xff37('0x3b')](_0x3c40b4['query']['sort']);_0x2bda2e[_0xff37('0x3c')]=qs[_0xff37('0x3d')](_['pick'](_0x3c40b4[_0xff37('0x33')],_0x4428c2[_0xff37('0x3d')]),_0x14f4d5);if(_0x3c40b4[_0xff37('0x33')][_0xff37('0x3e')]){_0x2bda2e['where']=_['merge'](_0x2bda2e[_0xff37('0x3c')],{'$or':_['map'](_0x14f4d5,function(_0x27f7d6){if(_0x27f7d6[_0xff37('0x30')]!=='VIRTUAL'){var _0x4b1982={};_0x4b1982[_0x27f7d6[_0xff37('0x2c')]]={'$like':'%'+_0x3c40b4[_0xff37('0x33')]['filter']+'%'};return _0x4b1982;}})});}_0x2bda2e=_[_0xff37('0x3f')]({},_0x2bda2e,_0x3c40b4[_0xff37('0x40')]);var _0x245994={'where':_0x2bda2e['where']};return db['Interval'][_0xff37('0x1e')](_0x245994)[_0xff37('0x26')](function(_0x4db806){_0x9efab6[_0xff37('0x1e')]=_0x4db806;if(_0x3c40b4[_0xff37('0x33')][_0xff37('0x41')]){_0x2bda2e[_0xff37('0x42')]=[{'all':!![]}];}return db[_0xff37('0x43')]['findAll'](_0x2bda2e);})[_0xff37('0x26')](function(_0x24b81a){_0x9efab6[_0xff37('0x44')]=_0x24b81a;return _0x9efab6;})[_0xff37('0x26')](respondWithFilteredResult(_0x12f317,_0x2bda2e))[_0xff37('0x45')](handleError(_0x12f317,null));};exports[_0xff37('0x46')]=function(_0x44992b,_0x5d4835){var _0x1722dd={'raw':!![],'where':{'id':_0x44992b[_0xff37('0x47')]['id']}},_0x3e1f4b={};_0x3e1f4b[_0xff37('0x32')]=_[_0xff37('0x48')](db[_0xff37('0x43')][_0xff37('0x49')]);_0x3e1f4b[_0xff37('0x33')]=_['keys'](_0x44992b['query']);_0x3e1f4b[_0xff37('0x3d')]=_[_0xff37('0x34')](_0x3e1f4b['model'],_0x3e1f4b['query']);_0x1722dd['attributes']=_[_0xff37('0x34')](_0x3e1f4b['model'],qs[_0xff37('0x36')](_0x44992b['query'][_0xff37('0x36')]));_0x1722dd[_0xff37('0x35')]=_0x1722dd['attributes']['length']?_0x1722dd[_0xff37('0x35')]:_0x3e1f4b['model'];if(_0x44992b[_0xff37('0x33')][_0xff37('0x41')]){_0x1722dd[_0xff37('0x42')]=[{'all':!![]}];}_0x1722dd=_[_0xff37('0x3f')]({},_0x1722dd,_0x44992b['options']);return db['Interval'][_0xff37('0x4a')](_0x1722dd)['then'](handleEntityNotFound(_0x5d4835,null))[_0xff37('0x26')](respondWithResult(_0x5d4835,null))[_0xff37('0x45')](handleError(_0x5d4835,null));};exports[_0xff37('0x4b')]=function(_0x4400db,_0x386ec4){return db[_0xff37('0x43')][_0xff37('0x4b')](_0x4400db[_0xff37('0x4c')],{})[_0xff37('0x26')](function(_0x2cab19){var _0x1ea937=_0x4400db[_0xff37('0x4d')][_0xff37('0x27')]({'plain':!![]});if(!_0x1ea937)throw new Error(_0xff37('0x4e'));if(_0x1ea937[_0xff37('0x4f')]===_0xff37('0x4d')){var _0x56a314=_0x2cab19['get']({'plain':!![]});var _0xa4ef23='Intervals';return db[_0xff37('0x50')]['find']({'where':{'name':_0xa4ef23,'userProfileId':_0x1ea937['userProfileId']},'raw':!![]})[_0xff37('0x26')](function(_0x1dce0c){if(_0x1dce0c&&_0x1dce0c[_0xff37('0x51')]===0x0){return db[_0xff37('0x52')][_0xff37('0x4b')]({'name':_0x56a314[_0xff37('0x2c')],'resourceId':_0x56a314['id'],'type':_0x1dce0c['name'],'sectionId':_0x1dce0c['id']},{})[_0xff37('0x26')](function(){return _0x2cab19;});}else{return _0x2cab19;}})[_0xff37('0x45')](function(_0x16673b){logger[_0xff37('0x2a')](_0xff37('0x53'),_0x16673b);throw _0x16673b;});}return _0x2cab19;})[_0xff37('0x26')](respondWithResult(_0x386ec4,0xc9))[_0xff37('0x45')](handleError(_0x386ec4,null));};exports[_0xff37('0x25')]=function(_0x4e82a2,_0x2a1d09){if(_0x4e82a2[_0xff37('0x4c')]['id']){delete _0x4e82a2[_0xff37('0x4c')]['id'];}return db['Interval']['find']({'where':{'id':_0x4e82a2[_0xff37('0x47')]['id']}})[_0xff37('0x26')](handleEntityNotFound(_0x2a1d09,null))[_0xff37('0x26')](saveUpdates(_0x4e82a2[_0xff37('0x4c')],null))[_0xff37('0x26')](respondWithResult(_0x2a1d09,null))[_0xff37('0x45')](handleError(_0x2a1d09,null));};exports[_0xff37('0x29')]=function(_0x2aac1b,_0x14d736){return db[_0xff37('0x43')]['find']({'where':{'id':_0x2aac1b[_0xff37('0x47')]['id']}})[_0xff37('0x26')](handleEntityNotFound(_0x14d736,null))[_0xff37('0x26')](removeEntity(_0x14d736,null))[_0xff37('0x45')](handleError(_0x14d736,null));};exports[_0xff37('0x54')]=function(_0x3b5c51,_0x584a01,_0xf36c7f){if(_0x3b5c51[_0xff37('0x4c')]['id']){delete _0x3b5c51[_0xff37('0x4c')]['id'];}return db[_0xff37('0x43')][_0xff37('0x4a')]({'where':{'id':_0x3b5c51[_0xff37('0x47')]['id']}})[_0xff37('0x26')](handleEntityNotFound(_0x584a01,null))[_0xff37('0x26')](function(_0x564556){if(_0x564556){_0x3b5c51[_0xff37('0x4c')][_0xff37('0x55')]=_0x564556['id'];return db[_0xff37('0x43')][_0xff37('0x4b')](_0x3b5c51['body']);}})[_0xff37('0x26')](respondWithResult(_0x584a01,null))['catch'](handleError(_0x584a01,null));};exports[_0xff37('0x56')]=function(_0x308aa2,_0x4ab30e,_0x532a17){var _0x4784a1={};var _0x1852e7={};var _0x321601;var _0x5a92d9;return db[_0xff37('0x43')]['findOne']({'where':{'id':_0x308aa2[_0xff37('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ab30e,null))[_0xff37('0x26')](function(_0x3d8efe){if(_0x3d8efe){_0x321601=_0x3d8efe;_0x1852e7[_0xff37('0x32')]=_[_0xff37('0x48')](db[_0xff37('0x43')][_0xff37('0x49')]);_0x1852e7[_0xff37('0x33')]=_[_0xff37('0x48')](_0x308aa2['query']);_0x1852e7[_0xff37('0x3d')]=_[_0xff37('0x34')](_0x1852e7[_0xff37('0x32')],_0x1852e7[_0xff37('0x33')]);_0x4784a1[_0xff37('0x35')]=_[_0xff37('0x34')](_0x1852e7[_0xff37('0x32')],qs['fields'](_0x308aa2['query']['fields']));_0x4784a1[_0xff37('0x35')]=_0x4784a1[_0xff37('0x35')][_0xff37('0x57')]?_0x4784a1['attributes']:_0x1852e7['model'];_0x4784a1[_0xff37('0x3a')]=qs[_0xff37('0x3b')](_0x308aa2['query'][_0xff37('0x3b')]);_0x4784a1[_0xff37('0x3c')]=qs[_0xff37('0x3d')](_[_0xff37('0x58')](_0x308aa2[_0xff37('0x33')],_0x1852e7[_0xff37('0x3d')]));if(_0x308aa2[_0xff37('0x33')][_0xff37('0x3e')]){_0x4784a1['where']=_[_0xff37('0x3f')](_0x4784a1[_0xff37('0x3c')],{'$or':_[_0xff37('0x2f')](_0x4784a1['attributes'],function(_0xd77598){var _0x5ca440={};_0x5ca440[_0xd77598]={'$like':'%'+_0x308aa2[_0xff37('0x33')]['filter']+'%'};return _0x5ca440;})});}_0x4784a1=_[_0xff37('0x3f')]({},_0x4784a1,_0x308aa2[_0xff37('0x40')]);return _0x321601[_0xff37('0x56')](_0x4784a1);}})[_0xff37('0x26')](function(_0x3cc162){if(_0x3cc162){_0x5a92d9=_0x3cc162[_0xff37('0x57')];if(!_0x308aa2['query'][_0xff37('0x37')](_0xff37('0x38'))){_0x4784a1['limit']=qs[_0xff37('0x39')](_0x308aa2[_0xff37('0x33')][_0xff37('0x39')]);_0x4784a1[_0xff37('0x1f')]=qs[_0xff37('0x1f')](_0x308aa2[_0xff37('0x33')][_0xff37('0x1f')]);}return _0x321601[_0xff37('0x56')](_0x4784a1);}})[_0xff37('0x26')](function(_0x2e8a6e){if(_0x2e8a6e){return _0x2e8a6e?{'count':_0x5a92d9,'rows':_0x2e8a6e}:null;}})[_0xff37('0x26')](respondWithResult(_0x4ab30e,null))[_0xff37('0x45')](handleError(_0x4ab30e,null));};exports[_0xff37('0x59')]=function(_0x1f8030,_0x1331dc,_0x19fea0){return db[_0xff37('0x43')]['findOne']({'where':{'id':_0x1f8030[_0xff37('0x47')]['id']}})['then'](handleEntityNotFound(_0x1331dc,null))[_0xff37('0x26')](function(_0x15cb31){if(_0x15cb31){return db['sequelize'][_0xff37('0x5a')](function(_0x3f17d7){return db[_0xff37('0x43')][_0xff37('0x29')]({'where':{'IntervalId':_0x1f8030[_0xff37('0x47')]['id']},'transaction':_0x3f17d7})[_0xff37('0x26')](function(_0x28e23e){var _0x45fca9=_[_0xff37('0x2f')](_0x1f8030[_0xff37('0x4c')],function(_0x4c4ffe){delete _0x4c4ffe['id'];_0x4c4ffe[_0xff37('0x55')]=_0x1f8030[_0xff37('0x47')]['id'];return _0x4c4ffe;});return db[_0xff37('0x43')][_0xff37('0x5b')](_0x45fca9,{'transaction':_0x3f17d7});});})[_0xff37('0x26')](function(){return db[_0xff37('0x43')][_0xff37('0x5c')]({'where':{'IntervalId':_0x1f8030[_0xff37('0x47')]['id']}});});}})['then'](respondWithResult(_0x1331dc,null))[_0xff37('0x45')](handleError(_0x1331dc,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 2780002..de35908 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 _0xefdd=['bluebird','request-promise','path','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','util','api','moment'];(function(_0x815ac1,_0x29c8a4){var _0x4bf89a=function(_0x123c8c){while(--_0x123c8c){_0x815ac1['push'](_0x815ac1['shift']());}};_0x4bf89a(++_0x29c8a4);}(_0xefdd,0x75));var _0xdefd=function(_0x53735b,_0x2b9c21){_0x53735b=_0x53735b-0x0;var _0x558cc8=_0xefdd[_0x53735b];return _0x558cc8;};'use strict';var _=require(_0xdefd('0x0'));var util=require(_0xdefd('0x1'));var logger=require('../../config/logger')(_0xdefd('0x2'));var moment=require(_0xdefd('0x3'));var BPromise=require(_0xdefd('0x4'));var rp=require(_0xdefd('0x5'));var fs=require('fs');var path=require(_0xdefd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xdefd('0x7'));module[_0xdefd('0x8')]=function(_0x34eb0a,_0x525fc9){return _0x34eb0a['define'](_0xdefd('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x83c14e,_0x64bf77){extensions['rewrite'](_0x34eb0a,_0x83c14e);},'afterBulkCreate':function(_0x452a78,_0x3873b6,_0x4f644c){_0x4f644c();extensions[_0xdefd('0xa')](_0x34eb0a,_0x452a78[0x0]);},'afterUpdate':function(_0x124d0e,_0x46f07b){extensions[_0xdefd('0xa')](_0x34eb0a,_0x124d0e);},'afterDestroy':function(_0x249947,_0xa1dd4c){extensions['rewrite'](_0x34eb0a,_0x249947);}}});}; \ No newline at end of file +var _0x29c1=['bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite','util','../../config/logger','api'];(function(_0x4b4656,_0x59e985){var _0x2f0ac1=function(_0x104d9c){while(--_0x104d9c){_0x4b4656['push'](_0x4b4656['shift']());}};_0x2f0ac1(++_0x59e985);}(_0x29c1,0x72));var _0x129c=function(_0x5e8f9d,_0x578251){_0x5e8f9d=_0x5e8f9d-0x0;var _0x594f53=_0x29c1[_0x5e8f9d];return _0x594f53;};'use strict';var _=require('lodash');var util=require(_0x129c('0x0'));var logger=require(_0x129c('0x1'))(_0x129c('0x2'));var moment=require('moment');var BPromise=require(_0x129c('0x3'));var rp=require(_0x129c('0x4'));var fs=require('fs');var path=require(_0x129c('0x5'));var rimraf=require(_0x129c('0x6'));var config=require(_0x129c('0x7'));var attributes=require(_0x129c('0x8'));var extensions=require(_0x129c('0x9'));module['exports']=function(_0x3e241f,_0x1e146e){return _0x3e241f[_0x129c('0xa')](_0x129c('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x303ad7,_0x1e8f06){extensions[_0x129c('0xc')](_0x3e241f,_0x303ad7);},'afterBulkCreate':function(_0x59d810,_0x141347,_0x47ee8d){_0x47ee8d();extensions[_0x129c('0xc')](_0x3e241f,_0x59d810[0x0]);},'afterUpdate':function(_0x1bf4f2,_0x2f0a99){extensions[_0x129c('0xc')](_0x3e241f,_0x1bf4f2);},'afterDestroy':function(_0x11319b,_0x19722e){extensions[_0x129c('0xc')](_0x3e241f,_0x11319b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 3bc5f7c..43e5253 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 _0xbe41=['http','request','then','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','Interval','findAll','options','where','attributes','limit','map','include','model','GetInterval','debug','stringify','ShowInterval','find','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3ceabc,_0x37bbe4){var _0x4ad61f=function(_0x27946f){while(--_0x27946f){_0x3ceabc['push'](_0x3ceabc['shift']());}};_0x4ad61f(++_0x37bbe4);}(_0xbe41,0x1e1));var _0x1be4=function(_0x37bc3c,_0x30ec6e){_0x37bc3c=_0x37bc3c-0x0;var _0x2cecb3=_0xbe41[_0x37bc3c];return _0x2cecb3;};'use strict';var _=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var moment=require(_0x1be4('0x2'));var BPromise=require(_0x1be4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1be4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1be4('0x5'));var logger=require(_0x1be4('0x6'))(_0x1be4('0x7'));var config=require(_0x1be4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1be4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dfe3a,_0x2944ac,_0x343874){return new BPromise(function(_0x13c650,_0x1dbc60){return client[_0x1be4('0xa')](_0x3dfe3a,_0x343874)[_0x1be4('0xb')](function(_0x2cf6cc){logger['info'](_0x1be4('0xc'),_0x2944ac,_0x1be4('0xd'));logger['debug'](_0x1be4('0xe'),_0x2944ac,_0x1be4('0xd'),JSON['stringify'](_0x2cf6cc));if(_0x2cf6cc[_0x1be4('0xf')]){if(_0x2cf6cc['error'][_0x1be4('0x10')]===0x1f4){logger[_0x1be4('0xf')](_0x1be4('0xc'),_0x2944ac,_0x2cf6cc[_0x1be4('0xf')]['message']);return _0x1dbc60(_0x2cf6cc[_0x1be4('0xf')][_0x1be4('0x11')]);}logger[_0x1be4('0xf')](_0x1be4('0xc'),_0x2944ac,_0x2cf6cc[_0x1be4('0xf')][_0x1be4('0x11')]);return _0x13c650(_0x2cf6cc[_0x1be4('0xf')][_0x1be4('0x11')]);}else{logger[_0x1be4('0x12')](_0x1be4('0xc'),_0x2944ac,_0x1be4('0xd'));_0x13c650(_0x2cf6cc['result'][_0x1be4('0x11')]);}})[_0x1be4('0x13')](function(_0xf8782d){logger[_0x1be4('0xf')](_0x1be4('0xc'),_0x2944ac,_0xf8782d);_0x1dbc60(_0xf8782d);});});}exports['GetInterval']=function(_0x460c6a){var _0x1e82c9=this;return new Promise(function(_0x610b3f,_0x178800){return db[_0x1be4('0x14')][_0x1be4('0x15')]({'raw':_0x460c6a[_0x1be4('0x16')]?_0x460c6a['options']['raw']===undefined?!![]:![]:!![],'where':_0x460c6a[_0x1be4('0x16')]?_0x460c6a[_0x1be4('0x16')][_0x1be4('0x17')]||null:null,'attributes':_0x460c6a[_0x1be4('0x16')]?_0x460c6a[_0x1be4('0x16')][_0x1be4('0x18')]||null:null,'limit':_0x460c6a[_0x1be4('0x16')]?_0x460c6a[_0x1be4('0x16')][_0x1be4('0x19')]||null:null,'include':_0x460c6a[_0x1be4('0x16')]?_0x460c6a[_0x1be4('0x16')]['include']?_[_0x1be4('0x1a')](_0x460c6a[_0x1be4('0x16')][_0x1be4('0x1b')],function(_0x14da2f){return{'model':db[_0x14da2f['model']],'as':_0x14da2f['as'],'attributes':_0x14da2f['attributes'],'include':_0x14da2f[_0x1be4('0x1b')]?_[_0x1be4('0x1a')](_0x14da2f[_0x1be4('0x1b')],function(_0x1c2805){return{'model':db[_0x1c2805[_0x1be4('0x1c')]],'as':_0x1c2805['as'],'attributes':_0x1c2805['attributes'],'include':_0x1c2805['include']?_['map'](_0x1c2805[_0x1be4('0x1b')],function(_0x519b9c){return{'model':db[_0x519b9c[_0x1be4('0x1c')]],'as':_0x519b9c['as'],'attributes':_0x519b9c[_0x1be4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1be4('0xb')](function(_0x5db956){logger[_0x1be4('0x12')](_0x1be4('0x1d'),_0x460c6a);logger[_0x1be4('0x1e')](_0x1be4('0x1d'),_0x460c6a,JSON[_0x1be4('0x1f')](_0x5db956));_0x610b3f(_0x5db956);})[_0x1be4('0x13')](function(_0x13a118){logger[_0x1be4('0xf')](_0x1be4('0x1d'),_0x13a118[_0x1be4('0x11')],_0x460c6a);_0x178800(_0x1e82c9[_0x1be4('0xf')](0x1f4,_0x13a118[_0x1be4('0x11')]));});});};exports[_0x1be4('0x20')]=function(_0x182a2d){var _0x4f5b68=this;return new Promise(function(_0x42ca3d,_0x409d65){return db['Interval'][_0x1be4('0x21')]({'raw':_0x182a2d[_0x1be4('0x16')]?_0x182a2d[_0x1be4('0x16')][_0x1be4('0x22')]===undefined?!![]:![]:!![],'where':_0x182a2d[_0x1be4('0x16')]?_0x182a2d[_0x1be4('0x16')]['where']||null:null,'attributes':_0x182a2d['options']?_0x182a2d['options'][_0x1be4('0x18')]||null:null,'include':_0x182a2d[_0x1be4('0x16')]?_0x182a2d[_0x1be4('0x16')][_0x1be4('0x1b')]?_[_0x1be4('0x1a')](_0x182a2d[_0x1be4('0x16')][_0x1be4('0x1b')],function(_0x15a3ce){return{'model':db[_0x15a3ce[_0x1be4('0x1c')]],'as':_0x15a3ce['as'],'attributes':_0x15a3ce[_0x1be4('0x18')],'include':_0x15a3ce['include']?_[_0x1be4('0x1a')](_0x15a3ce['include'],function(_0x351515){return{'model':db[_0x351515['model']],'as':_0x351515['as'],'attributes':_0x351515['attributes'],'include':_0x351515[_0x1be4('0x1b')]?_[_0x1be4('0x1a')](_0x351515['include'],function(_0x4a464b){return{'model':db[_0x4a464b[_0x1be4('0x1c')]],'as':_0x4a464b['as'],'attributes':_0x4a464b[_0x1be4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1be4('0xb')](function(_0xff31eb){logger[_0x1be4('0x12')](_0x1be4('0x20'),_0x182a2d);logger[_0x1be4('0x1e')](_0x1be4('0x20'),_0x182a2d,JSON[_0x1be4('0x1f')](_0xff31eb));_0x42ca3d(_0xff31eb);})[_0x1be4('0x13')](function(_0x231f56){logger[_0x1be4('0xf')](_0x1be4('0x20'),_0x231f56[_0x1be4('0x11')],_0x182a2d);_0x409d65(_0x4f5b68[_0x1be4('0xf')](0x1f4,_0x231f56[_0x1be4('0x11')]));});});}; \ No newline at end of file +var _0x9674=['then','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','Interval,\x20%s,\x20%s','message','info','result','catch','GetInterval','Interval','findAll','options','raw','where','attributes','map','include','model','ShowInterval','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3ef7b5,_0x3c06e6){var _0x325acf=function(_0x34e915){while(--_0x34e915){_0x3ef7b5['push'](_0x3ef7b5['shift']());}};_0x325acf(++_0x3c06e6);}(_0x9674,0x104));var _0x4967=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0x9674[_0x1b4c04];return _0x374f5d;};'use strict';var _=require(_0x4967('0x0'));var util=require('util');var moment=require(_0x4967('0x1'));var BPromise=require(_0x4967('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4967('0x3'));var db=require(_0x4967('0x4'))['db'];var utils=require(_0x4967('0x5'));var logger=require(_0x4967('0x6'))(_0x4967('0x7'));var config=require(_0x4967('0x8'));var jayson=require(_0x4967('0x9'));var client=jayson['client'][_0x4967('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f3d02,_0x1dbeec,_0x28d363){return new BPromise(function(_0x30d0cd,_0x226079){return client[_0x4967('0xb')](_0x2f3d02,_0x28d363)[_0x4967('0xc')](function(_0x2742ef){logger['info']('Interval,\x20%s,\x20%s',_0x1dbeec,_0x4967('0xd'));logger[_0x4967('0xe')](_0x4967('0xf'),_0x1dbeec,'request\x20sent',JSON[_0x4967('0x10')](_0x2742ef));if(_0x2742ef[_0x4967('0x11')]){if(_0x2742ef[_0x4967('0x11')]['code']===0x1f4){logger[_0x4967('0x11')](_0x4967('0x12'),_0x1dbeec,_0x2742ef['error']['message']);return _0x226079(_0x2742ef[_0x4967('0x11')][_0x4967('0x13')]);}logger['error']('Interval,\x20%s,\x20%s',_0x1dbeec,_0x2742ef[_0x4967('0x11')][_0x4967('0x13')]);return _0x30d0cd(_0x2742ef[_0x4967('0x11')]['message']);}else{logger[_0x4967('0x14')]('Interval,\x20%s,\x20%s',_0x1dbeec,_0x4967('0xd'));_0x30d0cd(_0x2742ef[_0x4967('0x15')]['message']);}})[_0x4967('0x16')](function(_0x194912){logger[_0x4967('0x11')](_0x4967('0x12'),_0x1dbeec,_0x194912);_0x226079(_0x194912);});});}exports[_0x4967('0x17')]=function(_0x5643ae){var _0x5787ca=this;return new Promise(function(_0x2e905b,_0x2c3532){return db[_0x4967('0x18')][_0x4967('0x19')]({'raw':_0x5643ae[_0x4967('0x1a')]?_0x5643ae[_0x4967('0x1a')][_0x4967('0x1b')]===undefined?!![]:![]:!![],'where':_0x5643ae[_0x4967('0x1a')]?_0x5643ae[_0x4967('0x1a')][_0x4967('0x1c')]||null:null,'attributes':_0x5643ae[_0x4967('0x1a')]?_0x5643ae[_0x4967('0x1a')][_0x4967('0x1d')]||null:null,'limit':_0x5643ae[_0x4967('0x1a')]?_0x5643ae[_0x4967('0x1a')]['limit']||null:null,'include':_0x5643ae[_0x4967('0x1a')]?_0x5643ae[_0x4967('0x1a')]['include']?_[_0x4967('0x1e')](_0x5643ae[_0x4967('0x1a')][_0x4967('0x1f')],function(_0x50836d){return{'model':db[_0x50836d[_0x4967('0x20')]],'as':_0x50836d['as'],'attributes':_0x50836d['attributes'],'include':_0x50836d['include']?_[_0x4967('0x1e')](_0x50836d[_0x4967('0x1f')],function(_0x46bcc7){return{'model':db[_0x46bcc7[_0x4967('0x20')]],'as':_0x46bcc7['as'],'attributes':_0x46bcc7['attributes'],'include':_0x46bcc7['include']?_[_0x4967('0x1e')](_0x46bcc7[_0x4967('0x1f')],function(_0x18ff04){return{'model':db[_0x18ff04['model']],'as':_0x18ff04['as'],'attributes':_0x18ff04['attributes']};}):[]};}):[]};}):[]:[]})[_0x4967('0xc')](function(_0x100826){logger[_0x4967('0x14')]('GetInterval',_0x5643ae);logger[_0x4967('0xe')](_0x4967('0x17'),_0x5643ae,JSON[_0x4967('0x10')](_0x100826));_0x2e905b(_0x100826);})[_0x4967('0x16')](function(_0x42743b){logger[_0x4967('0x11')](_0x4967('0x17'),_0x42743b['message'],_0x5643ae);_0x2c3532(_0x5787ca[_0x4967('0x11')](0x1f4,_0x42743b[_0x4967('0x13')]));});});};exports[_0x4967('0x21')]=function(_0x265dcd){var _0x9ee4f4=this;return new Promise(function(_0x52cc95,_0x4d04a4){return db[_0x4967('0x18')]['find']({'raw':_0x265dcd[_0x4967('0x1a')]?_0x265dcd[_0x4967('0x1a')][_0x4967('0x1b')]===undefined?!![]:![]:!![],'where':_0x265dcd[_0x4967('0x1a')]?_0x265dcd[_0x4967('0x1a')]['where']||null:null,'attributes':_0x265dcd[_0x4967('0x1a')]?_0x265dcd[_0x4967('0x1a')][_0x4967('0x1d')]||null:null,'include':_0x265dcd['options']?_0x265dcd[_0x4967('0x1a')][_0x4967('0x1f')]?_['map'](_0x265dcd[_0x4967('0x1a')][_0x4967('0x1f')],function(_0x5ebda4){return{'model':db[_0x5ebda4[_0x4967('0x20')]],'as':_0x5ebda4['as'],'attributes':_0x5ebda4[_0x4967('0x1d')],'include':_0x5ebda4[_0x4967('0x1f')]?_[_0x4967('0x1e')](_0x5ebda4['include'],function(_0x29d5fc){return{'model':db[_0x29d5fc['model']],'as':_0x29d5fc['as'],'attributes':_0x29d5fc[_0x4967('0x1d')],'include':_0x29d5fc[_0x4967('0x1f')]?_[_0x4967('0x1e')](_0x29d5fc[_0x4967('0x1f')],function(_0x37548d){return{'model':db[_0x37548d[_0x4967('0x20')]],'as':_0x37548d['as'],'attributes':_0x37548d[_0x4967('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x261ec5){logger[_0x4967('0x14')](_0x4967('0x21'),_0x265dcd);logger[_0x4967('0xe')](_0x4967('0x21'),_0x265dcd,JSON[_0x4967('0x10')](_0x261ec5));_0x52cc95(_0x261ec5);})[_0x4967('0x16')](function(_0x54ea5f){logger[_0x4967('0x11')]('ShowInterval',_0x54ea5f[_0x4967('0x13')],_0x265dcd);_0x4d04a4(_0x9ee4f4[_0x4967('0x11')](0x1f4,_0x54ea5f[_0x4967('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index cf0a960..56a0f3a 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 _0xa525=['Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports','express'];(function(_0x36baf8,_0x315c4f){var _0x45b3cc=function(_0x4e3c08){while(--_0x4e3c08){_0x36baf8['push'](_0x36baf8['shift']());}};_0x45b3cc(++_0x315c4f);}(_0xa525,0x10f));var _0x5a52=function(_0x3dfb34,_0x3e8b10){_0x3dfb34=_0x3dfb34-0x0;var _0x4ceeb5=_0xa525[_0x3dfb34];return _0x4ceeb5;};'use strict';var express=require(_0x5a52('0x0'));var router=express[_0x5a52('0x1')]();var auth=require(_0x5a52('0x2'));var controller=require(_0x5a52('0x3'));router[_0x5a52('0x4')]('/',auth[_0x5a52('0x5')](),controller[_0x5a52('0x6')]);module[_0x5a52('0x7')]=router; \ No newline at end of file +var _0x44ed=['post','isAuthenticated','send','express','Router','./jira.controller'];(function(_0x23a9bc,_0x3f1a25){var _0x55d674=function(_0xa7fc73){while(--_0xa7fc73){_0x23a9bc['push'](_0x23a9bc['shift']());}};_0x55d674(++_0x3f1a25);}(_0x44ed,0x183));var _0xd44e=function(_0x124bfa,_0x257315){_0x124bfa=_0x124bfa-0x0;var _0x2a9424=_0x44ed[_0x124bfa];return _0x2a9424;};'use strict';var express=require(_0xd44e('0x0'));var router=express[_0xd44e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd44e('0x2'));router[_0xd44e('0x3')]('/',auth[_0xd44e('0x4')](),controller[_0xd44e('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 7c99d60..7d116d5 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 _0xaf85=['request','setEncoding','utf8','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','base64'];(function(_0x290cda,_0x265739){var _0x32229b=function(_0x2e01ab){while(--_0x2e01ab){_0x290cda['push'](_0x290cda['shift']());}};_0x32229b(++_0x265739);}(_0xaf85,0x8f));var _0x5af8=function(_0x4a2ba2,_0x5901b9){_0x4a2ba2=_0x4a2ba2-0x0;var _0x1d09fd=_0xaf85[_0x4a2ba2];return _0x1d09fd;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x5af8('0x0'))(_0x5af8('0x1'));var USERNAME=_0x5af8('0x2');var PASSWORD=_0x5af8('0x3');function openIssue(_0x1aac3c,_0x2eafc4){var _0x2ca634={'fields':{'project':{'key':_0x1aac3c[_0x5af8('0x4')]||_0x5af8('0x5')},'summary':(_0x1aac3c[_0x5af8('0x6')]||_0x5af8('0x7'))+_0x5af8('0x8')+_0x1aac3c['ip'],'description':_0x1aac3c[_0x5af8('0x9')]||JSON[_0x5af8('0xa')](_0x1aac3c),'issuetype':{'name':_0x1aac3c[_0x5af8('0xb')]||_0x5af8('0xc')}}};_0x2ca634[_0x5af8('0xd')]['customfield_11500']=_0x1aac3c['email'];_0x2ca634[_0x5af8('0xd')]['customfield_11501']=_0x1aac3c[_0x5af8('0xe')];_0x2ca634['fields'][_0x5af8('0xf')]=_0x1aac3c['newToken'];_0x2ca634[_0x5af8('0xd')]['customfield_11503']=_0x1aac3c[_0x5af8('0x10')];_0x2ca634[_0x5af8('0xd')][_0x5af8('0x11')]=_0x1aac3c[_0x5af8('0x12')];_0x2ca634['fields'][_0x5af8('0x13')]=_0x1aac3c['ip'];var _0x39e7cf={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x5af8('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x5af8('0x15'),'Authorization':_0x5af8('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x5af8('0x17')](_0x5af8('0x18'))}};var _0x516605=JSON['stringify'](_0x2ca634);var _0x30f3ef=https[_0x5af8('0x19')](_0x39e7cf,function(_0x25f074){_0x25f074[_0x5af8('0x1a')](_0x5af8('0x1b'));var _0x1a46dc='';_0x25f074['on']('data',function(_0x5995d6){_0x1a46dc+=_0x5995d6;});_0x25f074['on'](_0x5af8('0x1c'),function(){if(_0x2eafc4){return _0x2eafc4[_0x5af8('0x1d')](_0x25f074['statusCode'])[_0x5af8('0x1e')](JSON['parse'](_0x1a46dc));}});});_0x30f3ef['on'](_0x5af8('0x1f'),function(_0x403f61){if(_0x2eafc4){return _0x2eafc4['status'](0x1f4)['json']({'errors':[{'message':_0x5af8('0x20'),'type':_0x5af8('0x21')}]});}});_0x30f3ef[_0x5af8('0x22')](_0x516605);_0x30f3ef[_0x5af8('0x1c')]();}exports[_0x5af8('0x23')]=openIssue;exports[_0x5af8('0x24')]=function(_0x3f50f3,_0x1aaa53){_0x3f50f3[_0x5af8('0x25')]['ip']=_0x3f50f3['headers'][_0x5af8('0x26')]||_0x3f50f3[_0x5af8('0x27')]['remoteAddress']||_0x3f50f3[_0x5af8('0x28')][_0x5af8('0x29')]||_0x3f50f3[_0x5af8('0x27')][_0x5af8('0x28')][_0x5af8('0x29')];return openIssue(_0x3f50f3[_0x5af8('0x25')],_0x1aaa53);}; \ No newline at end of file +var _0xc0db=['POST','application/json','toString','request','setEncoding','utf8','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','key','MOTGUI','\x20from\x20','stringify','issuetype','customfield_11500','email','customfield_11501','oldToken','fields','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue'];(function(_0x4d669e,_0x868e40){var _0x484ff3=function(_0x51ecec){while(--_0x51ecec){_0x4d669e['push'](_0x4d669e['shift']());}};_0x484ff3(++_0x868e40);}(_0xc0db,0x1f4));var _0xbc0d=function(_0x4663d3,_0x23b246){_0x4663d3=_0x4663d3-0x0;var _0xc4b1e6=_0xc0db[_0x4663d3];return _0xc4b1e6;};'use strict';var BPromise=require('bluebird');var https=require(_0xbc0d('0x0'));var logger=require(_0xbc0d('0x1'))('api');var USERNAME=_0xbc0d('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x282458,_0x345408){var _0x1259e7={'fields':{'project':{'key':_0x282458[_0xbc0d('0x3')]||_0xbc0d('0x4')},'summary':(_0x282458['summary']||'Report')+_0xbc0d('0x5')+_0x282458['ip'],'description':_0x282458['description']||JSON[_0xbc0d('0x6')](_0x282458),'issuetype':{'name':_0x282458[_0xbc0d('0x7')]||'Bug'}}};_0x1259e7['fields'][_0xbc0d('0x8')]=_0x282458[_0xbc0d('0x9')];_0x1259e7['fields'][_0xbc0d('0xa')]=_0x282458[_0xbc0d('0xb')];_0x1259e7[_0xbc0d('0xc')][_0xbc0d('0xd')]=_0x282458['newToken'];_0x1259e7[_0xbc0d('0xc')][_0xbc0d('0xe')]=_0x282458[_0xbc0d('0xf')];_0x1259e7[_0xbc0d('0xc')][_0xbc0d('0x10')]=_0x282458['reason'];_0x1259e7['fields'][_0xbc0d('0x11')]=_0x282458['ip'];var _0x32e7ec={'host':_0xbc0d('0x12'),'port':0x1bb,'path':_0xbc0d('0x13'),'method':_0xbc0d('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xbc0d('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xbc0d('0x16')]('base64')}};var _0x10b94d=JSON[_0xbc0d('0x6')](_0x1259e7);var _0x222efc=https[_0xbc0d('0x17')](_0x32e7ec,function(_0x274154){_0x274154[_0xbc0d('0x18')](_0xbc0d('0x19'));var _0x110590='';_0x274154['on']('data',function(_0x5beae7){_0x110590+=_0x5beae7;});_0x274154['on']('end',function(){if(_0x345408){return _0x345408['status'](_0x274154['statusCode'])[_0xbc0d('0x1a')](JSON['parse'](_0x110590));}});});_0x222efc['on'](_0xbc0d('0x1b'),function(_0x247f9e){if(_0x345408){return _0x345408[_0xbc0d('0x1c')](0x1f4)[_0xbc0d('0x1a')]({'errors':[{'message':_0xbc0d('0x1d'),'type':_0xbc0d('0x1e')}]});}});_0x222efc['write'](_0x10b94d);_0x222efc[_0xbc0d('0x1f')]();}exports[_0xbc0d('0x20')]=openIssue;exports[_0xbc0d('0x21')]=function(_0x59069c,_0x2c2e30){_0x59069c[_0xbc0d('0x22')]['ip']=_0x59069c[_0xbc0d('0x23')][_0xbc0d('0x24')]||_0x59069c[_0xbc0d('0x25')]['remoteAddress']||_0x59069c['socket'][_0xbc0d('0x26')]||_0x59069c[_0xbc0d('0x25')][_0xbc0d('0x27')][_0xbc0d('0x26')];return openIssue(_0x59069c[_0xbc0d('0x22')],_0x2c2e30);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9b8fb8d..7770362 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 _0x0890=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','util','express','Router'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x0890,0x74));var _0x0089=function(_0x43464b,_0x3e1c7f){_0x43464b=_0x43464b-0x0;var _0x26dc35=_0x0890[_0x43464b];return _0x26dc35;};'use strict';var multer=require(_0x0089('0x0'));var util=require(_0x0089('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0089('0x2'));var router=express[_0x0089('0x3')]();var auth=require(_0x0089('0x4'));var interaction=require(_0x0089('0x5'));var config=require(_0x0089('0x6'));var controller=require(_0x0089('0x7'));router[_0x0089('0x8')]('/',auth[_0x0089('0x9')](),controller[_0x0089('0xa')]);router[_0x0089('0x8')](_0x0089('0xb'),auth[_0x0089('0x9')](),controller[_0x0089('0xc')]);router[_0x0089('0x8')](_0x0089('0xd'),auth[_0x0089('0x9')](),controller[_0x0089('0xe')]);router['post']('/',auth[_0x0089('0x9')](),controller[_0x0089('0xf')]);router[_0x0089('0x10')](_0x0089('0xd'),auth[_0x0089('0x9')](),controller[_0x0089('0x11')]);router['delete'](_0x0089('0xd'),auth[_0x0089('0x9')](),controller[_0x0089('0x12')]);module[_0x0089('0x13')]=router; \ No newline at end of file +var _0x6a7c=['/:id','show','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x6a7c,0xc3));var _0xc6a7=function(_0x998263,_0x485b47){_0x998263=_0x998263-0x0;var _0x26fabe=_0x6a7c[_0x998263];return _0x26fabe;};'use strict';var multer=require(_0xc6a7('0x0'));var util=require(_0xc6a7('0x1'));var path=require(_0xc6a7('0x2'));var timeout=require(_0xc6a7('0x3'));var express=require(_0xc6a7('0x4'));var router=express['Router']();var auth=require(_0xc6a7('0x5'));var interaction=require(_0xc6a7('0x6'));var config=require(_0xc6a7('0x7'));var controller=require(_0xc6a7('0x8'));router[_0xc6a7('0x9')]('/',auth[_0xc6a7('0xa')](),controller[_0xc6a7('0xb')]);router[_0xc6a7('0x9')](_0xc6a7('0xc'),auth[_0xc6a7('0xa')](),controller[_0xc6a7('0xd')]);router[_0xc6a7('0x9')](_0xc6a7('0xe'),auth['isAuthenticated'](),controller[_0xc6a7('0xf')]);router['post']('/',auth[_0xc6a7('0xa')](),controller['create']);router[_0xc6a7('0x10')](_0xc6a7('0xe'),auth[_0xc6a7('0xa')](),controller['update']);router[_0xc6a7('0x11')](_0xc6a7('0xe'),auth[_0xc6a7('0xa')](),controller['destroy']);module[_0xc6a7('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index c5e4fa1..86672c9 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 _0x12a7=['long','STRING','sequelize','TEXT'];(function(_0x51727d,_0x306252){var _0x54c249=function(_0x2aad2d){while(--_0x2aad2d){_0x51727d['push'](_0x51727d['shift']());}};_0x54c249(++_0x306252);}(_0x12a7,0x112));var _0x712a=function(_0x648409,_0x4312be){_0x648409=_0x648409-0x0;var _0x37d2c8=_0x12a7[_0x648409];return _0x37d2c8;};'use strict';var Sequelize=require(_0x712a('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x712a('0x1')](_0x712a('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x712a('0x3')]},'queue':{'type':Sequelize[_0x712a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x712a('0x3')]},'calleridnum':{'type':Sequelize[_0x712a('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5384=['long','sequelize','STRING'];(function(_0x49cd9,_0x3c937f){var _0x5c0a00=function(_0x53b601){while(--_0x53b601){_0x49cd9['push'](_0x49cd9['shift']());}};_0x5c0a00(++_0x3c937f);}(_0x5384,0x17b));var _0x4538=function(_0xaea167,_0x1c04f2){_0xaea167=_0xaea167-0x0;var _0x43d12d=_0x5384[_0xaea167];return _0x43d12d;};'use strict';var Sequelize=require(_0x4538('0x0'));module['exports']={'question':{'type':Sequelize[_0x4538('0x1')]},'answer':{'type':Sequelize['TEXT'](_0x4538('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x4538('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4538('0x1')]},'calleridname':{'type':Sequelize[_0x4538('0x1')]},'calleridnum':{'type':Sequelize[_0x4538('0x1')]},'questionId':{'type':Sequelize[_0x4538('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 84bc5b5..c614944 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 _0xa77a=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','save','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','JscriptyAnswerReport','includeAll','include','rows','catch','show','find','create','body','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xa77a,0x10f));var _0xaa77=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0xa77a[_0x450bf9];return _0x268350;};'use strict';var pdf=require(_0xaa77('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa77('0x1'));var jsonpatch=require(_0xaa77('0x2'));var rp=require(_0xaa77('0x3'));var moment=require(_0xaa77('0x4'));var BPromise=require(_0xaa77('0x5'));var Mustache=require(_0xaa77('0x6'));var util=require('util');var path=require(_0xaa77('0x7'));var sox=require(_0xaa77('0x8'));var csv=require(_0xaa77('0x9'));var ejs=require(_0xaa77('0xa'));var fs=require('fs');var _=require(_0xaa77('0xb'));var squel=require('squel');var crypto=require(_0xaa77('0xc'));var jsforce=require(_0xaa77('0xd'));var deskjs=require(_0xaa77('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa77('0xf'));var Papa=require(_0xaa77('0x10'));var Redis=require(_0xaa77('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaa77('0x12'));var as=require(_0xaa77('0x13'));var hardwareService=require(_0xaa77('0x14'));var logger=require('../../config/logger')(_0xaa77('0x15'));var utils=require(_0xaa77('0x16'));var config=require(_0xaa77('0x17'));var db=require(_0xaa77('0x18'))['db'];function respondWithStatusCode(_0x1feaf2,_0x2c95b3){_0x2c95b3=_0x2c95b3||0xcc;return function(_0x55d24d){if(_0x55d24d){return _0x1feaf2[_0xaa77('0x19')](_0x2c95b3);}return _0x1feaf2[_0xaa77('0x1a')](_0x2c95b3)[_0xaa77('0x1b')]();};}function respondWithResult(_0x181d7d,_0x8f8b85){_0x8f8b85=_0x8f8b85||0xc8;return function(_0x5b472f){if(_0x5b472f){return _0x181d7d[_0xaa77('0x1a')](_0x8f8b85)[_0xaa77('0x1c')](_0x5b472f);}};}function respondWithFilteredResult(_0x145d07,_0x2aa60a){return function(_0x2b8c5a){if(_0x2b8c5a){var _0x391de7=_0x2b8c5a[_0xaa77('0x1d')],_0x2f05d2=_0x2aa60a[_0xaa77('0x1e')],_0x1f4fe=_0x2aa60a[_0xaa77('0x1e')]+_0x2aa60a[_0xaa77('0x1f')],_0x22b6bb;if(_0x1f4fe>=_0x391de7){_0x1f4fe=_0x391de7;_0x22b6bb=0xc8;}else{_0x22b6bb=0xce;}_0x145d07[_0xaa77('0x1a')](_0x22b6bb);return _0x145d07['set'](_0xaa77('0x20'),_0x2f05d2+'-'+_0x1f4fe+'/'+_0x391de7)[_0xaa77('0x1c')](_0x2b8c5a);}return null;};}function patchUpdates(_0x3fe714){return function(_0x59de32){try{jsonpatch['apply'](_0x59de32,_0x3fe714,!![]);}catch(_0x35f8c7){return BPromise['reject'](_0x35f8c7);}return _0x59de32[_0xaa77('0x21')]();};}function saveUpdates(_0x1b1920,_0x4e3e7a){return function(_0xb622a3){if(_0xb622a3){return _0xb622a3['update'](_0x1b1920)[_0xaa77('0x22')](function(_0x503f84){return _0x503f84;});}return null;};}function removeEntity(_0x473cfd,_0x4a695b){return function(_0x4d268d){if(_0x4d268d){return _0x4d268d[_0xaa77('0x23')]()[_0xaa77('0x22')](function(){_0x473cfd[_0xaa77('0x1a')](0xcc)[_0xaa77('0x1b')]();});}};}function handleEntityNotFound(_0x55a364,_0xb0871f){return function(_0x425d41){if(!_0x425d41){_0x55a364['sendStatus'](0x194);}return _0x425d41;};}function handleError(_0x230a18,_0x2a1e97){_0x2a1e97=_0x2a1e97||0x1f4;return function(_0x29aa13){logger[_0xaa77('0x24')](_0x29aa13['stack']);if(_0x29aa13[_0xaa77('0x25')]){delete _0x29aa13['name'];}_0x230a18[_0xaa77('0x1a')](_0x2a1e97)[_0xaa77('0x26')](_0x29aa13);};}exports[_0xaa77('0x27')]=function(_0x5c383b,_0x271076){var _0x31b890={},_0x37aff1={},_0x84a22d={'count':0x0,'rows':[]};var _0x3e051e=_[_0xaa77('0x28')](db['JscriptyAnswerReport'][_0xaa77('0x29')],function(_0x59d438){return{'name':_0x59d438['fieldName'],'type':_0x59d438[_0xaa77('0x2a')][_0xaa77('0x2b')]};});_0x37aff1[_0xaa77('0x2c')]=_['map'](_0x3e051e,_0xaa77('0x25'));_0x37aff1[_0xaa77('0x2d')]=_[_0xaa77('0x2e')](_0x5c383b[_0xaa77('0x2d')]);_0x37aff1[_0xaa77('0x2f')]=_[_0xaa77('0x30')](_0x37aff1['model'],_0x37aff1[_0xaa77('0x2d')]);_0x31b890[_0xaa77('0x31')]=_[_0xaa77('0x30')](_0x37aff1[_0xaa77('0x2c')],qs[_0xaa77('0x32')](_0x5c383b[_0xaa77('0x2d')][_0xaa77('0x32')]));_0x31b890['attributes']=_0x31b890[_0xaa77('0x31')][_0xaa77('0x33')]?_0x31b890['attributes']:_0x37aff1[_0xaa77('0x2c')];if(!_0x5c383b['query'][_0xaa77('0x34')](_0xaa77('0x35'))){_0x31b890[_0xaa77('0x1f')]=qs[_0xaa77('0x1f')](_0x5c383b['query'][_0xaa77('0x1f')]);_0x31b890['offset']=qs[_0xaa77('0x1e')](_0x5c383b[_0xaa77('0x2d')][_0xaa77('0x1e')]);}_0x31b890['order']=qs['sort'](_0x5c383b['query'][_0xaa77('0x36')]);_0x31b890[_0xaa77('0x37')]=qs['filters'](_[_0xaa77('0x38')](_0x5c383b[_0xaa77('0x2d')],_0x37aff1['filters']),_0x3e051e);if(_0x5c383b[_0xaa77('0x2d')][_0xaa77('0x39')]){_0x31b890[_0xaa77('0x37')]=_['merge'](_0x31b890[_0xaa77('0x37')],{'$or':_['map'](_0x3e051e,function(_0x5562fc){if(_0x5562fc[_0xaa77('0x2a')]!==_0xaa77('0x3a')){var _0x2a9591={};_0x2a9591[_0x5562fc[_0xaa77('0x25')]]={'$like':'%'+_0x5c383b['query'][_0xaa77('0x39')]+'%'};return _0x2a9591;}})});}_0x31b890=_[_0xaa77('0x3b')]({},_0x31b890,_0x5c383b[_0xaa77('0x3c')]);var _0x23f190={'where':_0x31b890[_0xaa77('0x37')]};return db[_0xaa77('0x3d')]['count'](_0x23f190)[_0xaa77('0x22')](function(_0x152b3e){_0x84a22d[_0xaa77('0x1d')]=_0x152b3e;if(_0x5c383b[_0xaa77('0x2d')][_0xaa77('0x3e')]){_0x31b890[_0xaa77('0x3f')]=[{'all':!![]}];}return db[_0xaa77('0x3d')]['findAll'](_0x31b890);})[_0xaa77('0x22')](function(_0x5a9449){_0x84a22d[_0xaa77('0x40')]=_0x5a9449;return _0x84a22d;})[_0xaa77('0x22')](respondWithFilteredResult(_0x271076,_0x31b890))[_0xaa77('0x41')](handleError(_0x271076,null));};exports[_0xaa77('0x42')]=function(_0x3d8acb,_0x2b5528){var _0x4c53fc={'raw':!![],'where':{'id':_0x3d8acb['params']['id']}},_0x59ee43={};_0x59ee43[_0xaa77('0x2c')]=_[_0xaa77('0x2e')](db['JscriptyAnswerReport']['rawAttributes']);_0x59ee43['query']=_[_0xaa77('0x2e')](_0x3d8acb[_0xaa77('0x2d')]);_0x59ee43[_0xaa77('0x2f')]=_[_0xaa77('0x30')](_0x59ee43['model'],_0x59ee43[_0xaa77('0x2d')]);_0x4c53fc[_0xaa77('0x31')]=_[_0xaa77('0x30')](_0x59ee43[_0xaa77('0x2c')],qs[_0xaa77('0x32')](_0x3d8acb[_0xaa77('0x2d')]['fields']));_0x4c53fc['attributes']=_0x4c53fc[_0xaa77('0x31')][_0xaa77('0x33')]?_0x4c53fc[_0xaa77('0x31')]:_0x59ee43[_0xaa77('0x2c')];if(_0x3d8acb[_0xaa77('0x2d')][_0xaa77('0x3e')]){_0x4c53fc[_0xaa77('0x3f')]=[{'all':!![]}];}_0x4c53fc=_[_0xaa77('0x3b')]({},_0x4c53fc,_0x3d8acb[_0xaa77('0x3c')]);return db[_0xaa77('0x3d')][_0xaa77('0x43')](_0x4c53fc)[_0xaa77('0x22')](handleEntityNotFound(_0x2b5528,null))[_0xaa77('0x22')](respondWithResult(_0x2b5528,null))[_0xaa77('0x41')](handleError(_0x2b5528,null));};exports[_0xaa77('0x44')]=function(_0x499e3f,_0x5cd849){return db[_0xaa77('0x3d')]['create'](_0x499e3f[_0xaa77('0x45')],{})[_0xaa77('0x22')](respondWithResult(_0x5cd849,0xc9))['catch'](handleError(_0x5cd849,null));};exports['update']=function(_0x576c38,_0x2d664e){if(_0x576c38['body']['id']){delete _0x576c38[_0xaa77('0x45')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x576c38[_0xaa77('0x46')]['id']}})[_0xaa77('0x22')](handleEntityNotFound(_0x2d664e,null))[_0xaa77('0x22')](saveUpdates(_0x576c38[_0xaa77('0x45')],null))[_0xaa77('0x22')](respondWithResult(_0x2d664e,null))[_0xaa77('0x41')](handleError(_0x2d664e,null));};exports[_0xaa77('0x23')]=function(_0x39763c,_0x1acb0a){return db[_0xaa77('0x3d')][_0xaa77('0x43')]({'where':{'id':_0x39763c[_0xaa77('0x46')]['id']}})['then'](handleEntityNotFound(_0x1acb0a,null))[_0xaa77('0x22')](removeEntity(_0x1acb0a,null))[_0xaa77('0x41')](handleError(_0x1acb0a,null));};exports[_0xaa77('0x47')]=function(_0x478fd1,_0x17caab){return db['JscriptyAnswerReport'][_0xaa77('0x47')]()['then'](respondWithResult(_0x17caab,null))['catch'](handleError(_0x17caab,null));}; \ No newline at end of file +var _0x2287=['findAll','rows','catch','show','rawAttributes','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','reject','save','update','then','destroy','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','JscriptyAnswerReport','includeAll','include'];(function(_0x4e8ae2,_0x4e310b){var _0x4b763f=function(_0x1275c9){while(--_0x1275c9){_0x4e8ae2['push'](_0x4e8ae2['shift']());}};_0x4b763f(++_0x4e310b);}(_0x2287,0xe3));var _0x7228=function(_0x5bff80,_0x35c63d){_0x5bff80=_0x5bff80-0x0;var _0x54b465=_0x2287[_0x5bff80];return _0x54b465;};'use strict';var pdf=require(_0x7228('0x0'));var emlformat=require(_0x7228('0x1'));var rimraf=require(_0x7228('0x2'));var zipdir=require(_0x7228('0x3'));var jsonpatch=require(_0x7228('0x4'));var rp=require('request-promise');var moment=require(_0x7228('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7228('0x6'));var util=require(_0x7228('0x7'));var path=require(_0x7228('0x8'));var sox=require(_0x7228('0x9'));var csv=require(_0x7228('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7228('0xb'));var squel=require('squel');var crypto=require(_0x7228('0xc'));var jsforce=require(_0x7228('0xd'));var deskjs=require(_0x7228('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7228('0xf'));var Papa=require('papaparse');var Redis=require(_0x7228('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7228('0x11'));var as=require(_0x7228('0x12'));var hardwareService=require(_0x7228('0x13'));var logger=require('../../config/logger')(_0x7228('0x14'));var utils=require(_0x7228('0x15'));var config=require(_0x7228('0x16'));var db=require(_0x7228('0x17'))['db'];function respondWithStatusCode(_0x5e2709,_0x1454c1){_0x1454c1=_0x1454c1||0xcc;return function(_0x44aa6a){if(_0x44aa6a){return _0x5e2709[_0x7228('0x18')](_0x1454c1);}return _0x5e2709[_0x7228('0x19')](_0x1454c1)[_0x7228('0x1a')]();};}function respondWithResult(_0x308620,_0x1ab4ba){_0x1ab4ba=_0x1ab4ba||0xc8;return function(_0x3b60ca){if(_0x3b60ca){return _0x308620[_0x7228('0x19')](_0x1ab4ba)['json'](_0x3b60ca);}};}function respondWithFilteredResult(_0x56242f,_0x5d6227){return function(_0x1003b7){if(_0x1003b7){var _0x5bbb86=_0x1003b7[_0x7228('0x1b')],_0x184ede=_0x5d6227[_0x7228('0x1c')],_0x5e1560=_0x5d6227[_0x7228('0x1c')]+_0x5d6227[_0x7228('0x1d')],_0x48a841;if(_0x5e1560>=_0x5bbb86){_0x5e1560=_0x5bbb86;_0x48a841=0xc8;}else{_0x48a841=0xce;}_0x56242f['status'](_0x48a841);return _0x56242f['set']('Content-Range',_0x184ede+'-'+_0x5e1560+'/'+_0x5bbb86)['json'](_0x1003b7);}return null;};}function patchUpdates(_0x2e85ca){return function(_0x135b70){try{jsonpatch['apply'](_0x135b70,_0x2e85ca,!![]);}catch(_0x38ac16){return BPromise[_0x7228('0x1e')](_0x38ac16);}return _0x135b70[_0x7228('0x1f')]();};}function saveUpdates(_0x3dd7f9,_0x4c071c){return function(_0x22ae9c){if(_0x22ae9c){return _0x22ae9c[_0x7228('0x20')](_0x3dd7f9)[_0x7228('0x21')](function(_0x41073c){return _0x41073c;});}return null;};}function removeEntity(_0x1f209e,_0x2983a8){return function(_0x469045){if(_0x469045){return _0x469045[_0x7228('0x22')]()[_0x7228('0x21')](function(){_0x1f209e[_0x7228('0x19')](0xcc)[_0x7228('0x1a')]();});}};}function handleEntityNotFound(_0x56f184,_0x492397){return function(_0xa5cfe4){if(!_0xa5cfe4){_0x56f184[_0x7228('0x18')](0x194);}return _0xa5cfe4;};}function handleError(_0x8fecd4,_0x63b022){_0x63b022=_0x63b022||0x1f4;return function(_0x179e35){logger['error'](_0x179e35[_0x7228('0x23')]);if(_0x179e35[_0x7228('0x24')]){delete _0x179e35['name'];}_0x8fecd4[_0x7228('0x19')](_0x63b022)[_0x7228('0x25')](_0x179e35);};}exports[_0x7228('0x26')]=function(_0x3b7b09,_0x17ad16){var _0x40ad91={},_0x3f8b1b={},_0x150ba0={'count':0x0,'rows':[]};var _0x443590=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x3c3639){return{'name':_0x3c3639[_0x7228('0x27')],'type':_0x3c3639[_0x7228('0x28')][_0x7228('0x29')]};});_0x3f8b1b[_0x7228('0x2a')]=_[_0x7228('0x2b')](_0x443590,_0x7228('0x24'));_0x3f8b1b[_0x7228('0x2c')]=_[_0x7228('0x2d')](_0x3b7b09[_0x7228('0x2c')]);_0x3f8b1b[_0x7228('0x2e')]=_[_0x7228('0x2f')](_0x3f8b1b['model'],_0x3f8b1b[_0x7228('0x2c')]);_0x40ad91[_0x7228('0x30')]=_[_0x7228('0x2f')](_0x3f8b1b[_0x7228('0x2a')],qs[_0x7228('0x31')](_0x3b7b09[_0x7228('0x2c')]['fields']));_0x40ad91[_0x7228('0x30')]=_0x40ad91['attributes'][_0x7228('0x32')]?_0x40ad91['attributes']:_0x3f8b1b[_0x7228('0x2a')];if(!_0x3b7b09[_0x7228('0x2c')][_0x7228('0x33')]('nolimit')){_0x40ad91[_0x7228('0x1d')]=qs['limit'](_0x3b7b09['query'][_0x7228('0x1d')]);_0x40ad91[_0x7228('0x1c')]=qs[_0x7228('0x1c')](_0x3b7b09[_0x7228('0x2c')][_0x7228('0x1c')]);}_0x40ad91[_0x7228('0x34')]=qs[_0x7228('0x35')](_0x3b7b09['query'][_0x7228('0x35')]);_0x40ad91[_0x7228('0x36')]=qs[_0x7228('0x2e')](_['pick'](_0x3b7b09[_0x7228('0x2c')],_0x3f8b1b['filters']),_0x443590);if(_0x3b7b09[_0x7228('0x2c')][_0x7228('0x37')]){_0x40ad91[_0x7228('0x36')]=_['merge'](_0x40ad91[_0x7228('0x36')],{'$or':_['map'](_0x443590,function(_0x210314){if(_0x210314[_0x7228('0x28')]!==_0x7228('0x38')){var _0x2cf6b6={};_0x2cf6b6[_0x210314[_0x7228('0x24')]]={'$like':'%'+_0x3b7b09['query'][_0x7228('0x37')]+'%'};return _0x2cf6b6;}})});}_0x40ad91=_[_0x7228('0x39')]({},_0x40ad91,_0x3b7b09['options']);var _0x188c1a={'where':_0x40ad91[_0x7228('0x36')]};return db[_0x7228('0x3a')][_0x7228('0x1b')](_0x188c1a)['then'](function(_0x45e780){_0x150ba0[_0x7228('0x1b')]=_0x45e780;if(_0x3b7b09[_0x7228('0x2c')][_0x7228('0x3b')]){_0x40ad91[_0x7228('0x3c')]=[{'all':!![]}];}return db[_0x7228('0x3a')][_0x7228('0x3d')](_0x40ad91);})['then'](function(_0x11d0e8){_0x150ba0[_0x7228('0x3e')]=_0x11d0e8;return _0x150ba0;})['then'](respondWithFilteredResult(_0x17ad16,_0x40ad91))[_0x7228('0x3f')](handleError(_0x17ad16,null));};exports[_0x7228('0x40')]=function(_0x878b53,_0x4a4a2c){var _0x377957={'raw':!![],'where':{'id':_0x878b53['params']['id']}},_0x29be99={};_0x29be99[_0x7228('0x2a')]=_['keys'](db[_0x7228('0x3a')][_0x7228('0x41')]);_0x29be99[_0x7228('0x2c')]=_[_0x7228('0x2d')](_0x878b53[_0x7228('0x2c')]);_0x29be99['filters']=_[_0x7228('0x2f')](_0x29be99['model'],_0x29be99['query']);_0x377957['attributes']=_[_0x7228('0x2f')](_0x29be99['model'],qs[_0x7228('0x31')](_0x878b53['query']['fields']));_0x377957['attributes']=_0x377957[_0x7228('0x30')]['length']?_0x377957[_0x7228('0x30')]:_0x29be99[_0x7228('0x2a')];if(_0x878b53[_0x7228('0x2c')][_0x7228('0x3b')]){_0x377957[_0x7228('0x3c')]=[{'all':!![]}];}_0x377957=_[_0x7228('0x39')]({},_0x377957,_0x878b53[_0x7228('0x42')]);return db[_0x7228('0x3a')]['find'](_0x377957)[_0x7228('0x21')](handleEntityNotFound(_0x4a4a2c,null))[_0x7228('0x21')](respondWithResult(_0x4a4a2c,null))[_0x7228('0x3f')](handleError(_0x4a4a2c,null));};exports['create']=function(_0x3d0642,_0xd51a92){return db[_0x7228('0x3a')][_0x7228('0x43')](_0x3d0642[_0x7228('0x44')],{})[_0x7228('0x21')](respondWithResult(_0xd51a92,0xc9))['catch'](handleError(_0xd51a92,null));};exports[_0x7228('0x20')]=function(_0x44152d,_0x1a4377){if(_0x44152d[_0x7228('0x44')]['id']){delete _0x44152d[_0x7228('0x44')]['id'];}return db[_0x7228('0x3a')][_0x7228('0x45')]({'where':{'id':_0x44152d[_0x7228('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a4377,null))[_0x7228('0x21')](saveUpdates(_0x44152d[_0x7228('0x44')],null))[_0x7228('0x21')](respondWithResult(_0x1a4377,null))[_0x7228('0x3f')](handleError(_0x1a4377,null));};exports['destroy']=function(_0x2412f6,_0x2fe6fc){return db[_0x7228('0x3a')][_0x7228('0x45')]({'where':{'id':_0x2412f6['params']['id']}})[_0x7228('0x21')](handleEntityNotFound(_0x2fe6fc,null))[_0x7228('0x21')](removeEntity(_0x2fe6fc,null))[_0x7228('0x3f')](handleError(_0x2fe6fc,null));};exports['describe']=function(_0x37fd26,_0x199f0a){return db[_0x7228('0x3a')][_0x7228('0x47')]()['then'](respondWithResult(_0x199f0a,null))[_0x7228('0x3f')](handleError(_0x199f0a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2e725a4..771da84 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 _0x0318=['JscriptyAnswerReport','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4d3a2b,_0x32a224){var _0xdd32c8=function(_0x18f96f){while(--_0x18f96f){_0x4d3a2b['push'](_0x4d3a2b['shift']());}};_0xdd32c8(++_0x32a224);}(_0x0318,0x15f));var _0x8031=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0318[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x8031('0x0'));var logger=require(_0x8031('0x1'))('api');var moment=require(_0x8031('0x2'));var BPromise=require(_0x8031('0x3'));var rp=require(_0x8031('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8031('0x5'));var config=require(_0x8031('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x8031('0x7')]=function(_0x28e2b2,_0x3f59d1){return _0x28e2b2[_0x8031('0x8')](_0x8031('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf19f=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xf19f,0x18c));var _0xff19=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xf19f[_0x3e5bc8];return _0xfd84bc;};'use strict';var _=require(_0xff19('0x0'));var util=require(_0xff19('0x1'));var logger=require(_0xff19('0x2'))('api');var moment=require(_0xff19('0x3'));var BPromise=require('bluebird');var rp=require(_0xff19('0x4'));var fs=require('fs');var path=require(_0xff19('0x5'));var rimraf=require(_0xff19('0x6'));var config=require(_0xff19('0x7'));var attributes=require(_0xff19('0x8'));module[_0xff19('0x9')]=function(_0x2687be,_0x481689){return _0x2687be[_0xff19('0xa')](_0xff19('0xb'),attributes,{'tableName':_0xff19('0xc'),'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 f7bffb2..c1022af 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 _0x1b07=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x28467d,_0x2ac2bf){var _0x22cbbd=function(_0x3288ec){while(--_0x3288ec){_0x28467d['push'](_0x28467d['shift']());}};_0x22cbbd(++_0x2ac2bf);}(_0x1b07,0x17f));var _0x71b0=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x1b07[_0x40015a];return _0x42f8a4;};'use strict';var _=require(_0x71b0('0x0'));var util=require(_0x71b0('0x1'));var moment=require(_0x71b0('0x2'));var BPromise=require(_0x71b0('0x3'));var rs=require(_0x71b0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x71b0('0x5'));var logger=require(_0x71b0('0x6'))(_0x71b0('0x7'));var config=require(_0x71b0('0x8'));var jayson=require(_0x71b0('0x9'));var client=jayson[_0x71b0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2551ae,_0x5216d4,_0x3de993){return new BPromise(function(_0x3f1adb,_0x44b004){return client['request'](_0x2551ae,_0x3de993)[_0x71b0('0xb')](function(_0x2f89ac){logger[_0x71b0('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5216d4,_0x71b0('0xd'));logger[_0x71b0('0xe')](_0x71b0('0xf'),_0x5216d4,_0x71b0('0xd'),JSON[_0x71b0('0x10')](_0x2f89ac));if(_0x2f89ac[_0x71b0('0x11')]){if(_0x2f89ac['error'][_0x71b0('0x12')]===0x1f4){logger[_0x71b0('0x11')](_0x71b0('0x13'),_0x5216d4,_0x2f89ac[_0x71b0('0x11')][_0x71b0('0x14')]);return _0x44b004(_0x2f89ac['error']['message']);}logger[_0x71b0('0x11')](_0x71b0('0x13'),_0x5216d4,_0x2f89ac[_0x71b0('0x11')][_0x71b0('0x14')]);return _0x3f1adb(_0x2f89ac[_0x71b0('0x11')][_0x71b0('0x14')]);}else{logger[_0x71b0('0xc')](_0x71b0('0x13'),_0x5216d4,_0x71b0('0xd'));_0x3f1adb(_0x2f89ac[_0x71b0('0x15')]['message']);}})[_0x71b0('0x16')](function(_0x118fe1){logger[_0x71b0('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5216d4,_0x118fe1);_0x44b004(_0x118fe1);});});} \ No newline at end of file +var _0x461f=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x5366c7,_0x10430b){var _0x3022cf=function(_0x484bfc){while(--_0x484bfc){_0x5366c7['push'](_0x5366c7['shift']());}};_0x3022cf(++_0x10430b);}(_0x461f,0x198));var _0xf461=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0x461f[_0x250071];return _0x34e574;};'use strict';var _=require('lodash');var util=require(_0xf461('0x0'));var moment=require('moment');var BPromise=require(_0xf461('0x1'));var rs=require(_0xf461('0x2'));var fs=require('fs');var Redis=require(_0xf461('0x3'));var db=require(_0xf461('0x4'))['db'];var utils=require(_0xf461('0x5'));var logger=require(_0xf461('0x6'))(_0xf461('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf461('0x8')][_0xf461('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d91e,_0x5a8918,_0x2f93d1){return new BPromise(function(_0x36a52c,_0x23d66f){return client['request'](_0x16d91e,_0x2f93d1)[_0xf461('0xa')](function(_0x1c03ad){logger[_0xf461('0xb')](_0xf461('0xc'),_0x5a8918,_0xf461('0xd'));logger[_0xf461('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5a8918,_0xf461('0xd'),JSON[_0xf461('0xf')](_0x1c03ad));if(_0x1c03ad['error']){if(_0x1c03ad['error'][_0xf461('0x10')]===0x1f4){logger['error'](_0xf461('0xc'),_0x5a8918,_0x1c03ad[_0xf461('0x11')]['message']);return _0x23d66f(_0x1c03ad[_0xf461('0x11')]['message']);}logger['error'](_0xf461('0xc'),_0x5a8918,_0x1c03ad[_0xf461('0x11')][_0xf461('0x12')]);return _0x36a52c(_0x1c03ad[_0xf461('0x11')]['message']);}else{logger[_0xf461('0xb')](_0xf461('0xc'),_0x5a8918,_0xf461('0xd'));_0x36a52c(_0x1c03ad[_0xf461('0x13')][_0xf461('0x12')]);}})[_0xf461('0x14')](function(_0x5d061c){logger[_0xf461('0x11')](_0xf461('0xc'),_0x5a8918,_0x5d061c);_0x23d66f(_0x5d061c);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 16ce61e..6e6a0ff 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 _0xfaad=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','destroy','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x1674ae,_0x10ac2d){var _0x5c7c69=function(_0x2783c7){while(--_0x2783c7){_0x1674ae['push'](_0x1674ae['shift']());}};_0x5c7c69(++_0x10ac2d);}(_0xfaad,0x1a0));var _0xdfaa=function(_0x1dc818,_0x40934e){_0x1dc818=_0x1dc818-0x0;var _0x4389bf=_0xfaad[_0x1dc818];return _0x4389bf;};'use strict';var multer=require('multer');var util=require(_0xdfaa('0x0'));var path=require('path');var timeout=require(_0xdfaa('0x1'));var express=require(_0xdfaa('0x2'));var router=express['Router']();var auth=require(_0xdfaa('0x3'));var interaction=require(_0xdfaa('0x4'));var config=require(_0xdfaa('0x5'));var controller=require('./jscriptyProject.controller');router[_0xdfaa('0x6')]('/',auth[_0xdfaa('0x7')](),controller['index']);router[_0xdfaa('0x6')](_0xdfaa('0x8'),auth[_0xdfaa('0x7')](),controller[_0xdfaa('0x9')]);router[_0xdfaa('0x6')]('/:id/sessions',auth[_0xdfaa('0x7')](),controller[_0xdfaa('0xa')]);router['get']('/:id/answers',auth[_0xdfaa('0x7')](),controller[_0xdfaa('0xb')]);router[_0xdfaa('0x6')](_0xdfaa('0xc'),auth[_0xdfaa('0x7')](),timeout(_0xdfaa('0xd')),controller[_0xdfaa('0xe')]);router[_0xdfaa('0xf')]('/',auth[_0xdfaa('0x7')](),controller[_0xdfaa('0x10')]);router[_0xdfaa('0xf')]('/:id/clone',auth[_0xdfaa('0x7')](),controller[_0xdfaa('0x11')]);router[_0xdfaa('0x12')](_0xdfaa('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdfaa('0x8'),auth['isAuthenticated'](),controller[_0xdfaa('0x13')]);module[_0xdfaa('0x14')]=router; \ No newline at end of file +var _0x36be=['30s','getSummary','create','clone','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','getSessions','/:id/summary'];(function(_0x485381,_0x4713fd){var _0x1f2550=function(_0x941e64){while(--_0x941e64){_0x485381['push'](_0x485381['shift']());}};_0x1f2550(++_0x4713fd);}(_0x36be,0x198));var _0xe36b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x36be[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xe36b('0x0'));var util=require(_0xe36b('0x1'));var path=require('path');var timeout=require(_0xe36b('0x2'));var express=require(_0xe36b('0x3'));var router=express[_0xe36b('0x4')]();var auth=require(_0xe36b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe36b('0x6'));var controller=require('./jscriptyProject.controller');router[_0xe36b('0x7')]('/',auth[_0xe36b('0x8')](),controller[_0xe36b('0x9')]);router[_0xe36b('0x7')]('/:id',auth[_0xe36b('0x8')](),controller['show']);router[_0xe36b('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller[_0xe36b('0xa')]);router[_0xe36b('0x7')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xe36b('0x7')](_0xe36b('0xb'),auth['isAuthenticated'](),timeout(_0xe36b('0xc')),controller[_0xe36b('0xd')]);router['post']('/',auth[_0xe36b('0x8')](),controller[_0xe36b('0xe')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xe36b('0xf')]);router['put'](_0xe36b('0x10'),auth[_0xe36b('0x8')](),controller[_0xe36b('0x11')]);router[_0xe36b('0x12')](_0xe36b('0x10'),auth[_0xe36b('0x8')](),controller[_0xe36b('0x13')]);module[_0xe36b('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4d70d04..490fa19 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 _0x51ef=['exports','STRING','name','TEXT','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x588427,_0x416033){var _0x282027=function(_0x5b2a7e){while(--_0x5b2a7e){_0x588427['push'](_0x588427['shift']());}};_0x282027(++_0x416033);}(_0x51ef,0x1cc));var _0xf51e=function(_0xc54915,_0x216d2a){_0xc54915=_0xc54915-0x0;var _0x698434=_0x51ef[_0xc54915];return _0x698434;};'use strict';var Sequelize=require(_0xf51e('0x0'));var _=require(_0xf51e('0x1'));var util=require('util');module[_0xf51e('0x2')]={'name':{'type':Sequelize[_0xf51e('0x3')],'unique':_0xf51e('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xf51e('0x5')]('long'),'set':function(_0xa522be){if(_['isObjectLike'](_0xa522be)){this[_0xf51e('0x6')](_0xf51e('0x7'),JSON[_0xf51e('0x8')](_0xa522be));}else if(_[_0xf51e('0x9')](_0xa522be)){this[_0xf51e('0x6')]('formData',_0xa522be);}else{this['setDataValue'](_0xf51e('0x7'),util['format'](_0xf51e('0xa'),this[_0xf51e('0xb')](_0xf51e('0x4'))||'',this[_0xf51e('0xb')](_0xf51e('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf51e('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf51e('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x200e=['setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','util','exports','STRING','name','TEXT','long','isObjectLike','formData','isString'];(function(_0x26d993,_0x559ddb){var _0x1807e0=function(_0xa71bbb){while(--_0xa71bbb){_0x26d993['push'](_0x26d993['shift']());}};_0x1807e0(++_0x559ddb);}(_0x200e,0x1ef));var _0xe200=function(_0x2f2b55,_0x474fa2){_0x2f2b55=_0x2f2b55-0x0;var _0x4060cb=_0x200e[_0x2f2b55];return _0x4060cb;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xe200('0x0'));module[_0xe200('0x1')]={'name':{'type':Sequelize[_0xe200('0x2')],'unique':_0xe200('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xe200('0x4')](_0xe200('0x5')),'set':function(_0x1a3945){if(_[_0xe200('0x6')](_0x1a3945)){this['setDataValue'](_0xe200('0x7'),JSON['stringify'](_0x1a3945));}else if(_[_0xe200('0x8')](_0x1a3945)){this[_0xe200('0x9')]('formData',_0x1a3945);}else{this[_0xe200('0x9')](_0xe200('0x7'),util[_0xe200('0xa')](_0xe200('0xb'),this['getDataValue'](_0xe200('0x3'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e77c951..701059b 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 _0x540f=['offset','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','getAnswers','JscriptyAnswerReport','order','ProjectId','number','fromCharCode','toString','indexOf','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','reject','update','then','destroy','Projects','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit'];(function(_0x29118b,_0x1bb64f){var _0x321aad=function(_0x6bcc87){while(--_0x6bcc87){_0x29118b['push'](_0x29118b['shift']());}};_0x321aad(++_0x1bb64f);}(_0x540f,0x12e));var _0xf540=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x540f[_0xac151d];return _0x111dba;};'use strict';var pdf=require(_0xf540('0x0'));var emlformat=require(_0xf540('0x1'));var rimraf=require(_0xf540('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf540('0x3'));var rp=require('request-promise');var moment=require(_0xf540('0x4'));var BPromise=require(_0xf540('0x5'));var Mustache=require(_0xf540('0x6'));var util=require(_0xf540('0x7'));var path=require(_0xf540('0x8'));var sox=require(_0xf540('0x9'));var csv=require(_0xf540('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf540('0xb'));var crypto=require(_0xf540('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf540('0xd'));var toCsv=require(_0xf540('0xa'));var querystring=require(_0xf540('0xe'));var Papa=require(_0xf540('0xf'));var Redis=require('ioredis');var authService=require(_0xf540('0x10'));var qs=require(_0xf540('0x11'));var as=require(_0xf540('0x12'));var hardwareService=require(_0xf540('0x13'));var logger=require(_0xf540('0x14'))('api');var utils=require(_0xf540('0x15'));var config=require('../../config/environment');var db=require(_0xf540('0x16'))['db'];function respondWithStatusCode(_0x20db3f,_0x131250){_0x131250=_0x131250||0xcc;return function(_0xeb105c){if(_0xeb105c){return _0x20db3f[_0xf540('0x17')](_0x131250);}return _0x20db3f[_0xf540('0x18')](_0x131250)[_0xf540('0x19')]();};}function respondWithResult(_0x3a464d,_0x26df62){_0x26df62=_0x26df62||0xc8;return function(_0x456d56){if(_0x456d56){return _0x3a464d[_0xf540('0x18')](_0x26df62)['json'](_0x456d56);}};}function respondWithFilteredResult(_0xab3fcd,_0x11293f){return function(_0xd3b924){if(_0xd3b924){var _0x5a5f3a=_0xd3b924[_0xf540('0x1a')],_0x36d210=_0x11293f['offset'],_0x304839=_0x11293f['offset']+_0x11293f[_0xf540('0x1b')],_0x191e35;if(_0x304839>=_0x5a5f3a){_0x304839=_0x5a5f3a;_0x191e35=0xc8;}else{_0x191e35=0xce;}_0xab3fcd[_0xf540('0x18')](_0x191e35);return _0xab3fcd[_0xf540('0x1c')](_0xf540('0x1d'),_0x36d210+'-'+_0x304839+'/'+_0x5a5f3a)[_0xf540('0x1e')](_0xd3b924);}return null;};}function patchUpdates(_0x24ebc7){return function(_0x31c69b){try{jsonpatch['apply'](_0x31c69b,_0x24ebc7,!![]);}catch(_0x4c149e){return BPromise[_0xf540('0x1f')](_0x4c149e);}return _0x31c69b['save']();};}function saveUpdates(_0x3992b8,_0x5eaddd){return function(_0x4c5538){if(_0x4c5538){return _0x4c5538[_0xf540('0x20')](_0x3992b8)[_0xf540('0x21')](function(_0x128b0b){return _0x128b0b;});}return null;};}function removeEntity(_0x6dec21,_0xb113d6){return function(_0x29b65c){if(_0x29b65c){return _0x29b65c[_0xf540('0x22')]()['then'](function(){var _0x517df4=_0x29b65c['get']({'plain':!![]});var _0x3ca26a=_0xf540('0x23');return db['UserProfileResource'][_0xf540('0x22')]({'where':{'type':_0x3ca26a,'resourceId':_0x517df4['id']}})[_0xf540('0x21')](function(){return _0x29b65c;});})['then'](function(){_0x6dec21['status'](0xcc)[_0xf540('0x19')]();});}};}function handleEntityNotFound(_0x365017,_0x16978d){return function(_0x4c62f5){if(!_0x4c62f5){_0x365017[_0xf540('0x17')](0x194);}return _0x4c62f5;};}function handleError(_0x223f38,_0xe7c5f1){_0xe7c5f1=_0xe7c5f1||0x1f4;return function(_0x5f1205){logger[_0xf540('0x24')](_0x5f1205[_0xf540('0x25')]);if(_0x5f1205[_0xf540('0x26')]){delete _0x5f1205[_0xf540('0x26')];}_0x223f38[_0xf540('0x18')](_0xe7c5f1)[_0xf540('0x27')](_0x5f1205);};}exports[_0xf540('0x28')]=function(_0x16749a,_0x27fe13){var _0x236c79={},_0x402d67={},_0x2de632={'count':0x0,'rows':[]};var _0x39b9c=_[_0xf540('0x29')](db['JscriptyProject'][_0xf540('0x2a')],function(_0x11fd08){return{'name':_0x11fd08[_0xf540('0x2b')],'type':_0x11fd08[_0xf540('0x2c')][_0xf540('0x2d')]};});_0x402d67['model']=_[_0xf540('0x29')](_0x39b9c,'name');_0x402d67['query']=_[_0xf540('0x2e')](_0x16749a[_0xf540('0x2f')]);_0x402d67[_0xf540('0x30')]=_[_0xf540('0x31')](_0x402d67[_0xf540('0x32')],_0x402d67[_0xf540('0x2f')]);_0x236c79['attributes']=_[_0xf540('0x31')](_0x402d67[_0xf540('0x32')],qs[_0xf540('0x33')](_0x16749a['query'][_0xf540('0x33')]));_0x236c79[_0xf540('0x34')]=_0x236c79[_0xf540('0x34')]['length']?_0x236c79[_0xf540('0x34')]:_0x402d67[_0xf540('0x32')];if(!_0x16749a[_0xf540('0x2f')][_0xf540('0x35')](_0xf540('0x36'))){_0x236c79[_0xf540('0x1b')]=qs[_0xf540('0x1b')](_0x16749a[_0xf540('0x2f')][_0xf540('0x1b')]);_0x236c79['offset']=qs[_0xf540('0x37')](_0x16749a[_0xf540('0x2f')]['offset']);}_0x236c79['order']=qs[_0xf540('0x38')](_0x16749a[_0xf540('0x2f')][_0xf540('0x38')]);_0x236c79['where']=qs[_0xf540('0x30')](_[_0xf540('0x39')](_0x16749a['query'],_0x402d67[_0xf540('0x30')]),_0x39b9c);if(_0x16749a[_0xf540('0x2f')][_0xf540('0x3a')]){_0x236c79[_0xf540('0x3b')]=_[_0xf540('0x3c')](_0x236c79['where'],{'$or':_[_0xf540('0x29')](_0x39b9c,function(_0x220af2){if(_0x220af2[_0xf540('0x2c')]!==_0xf540('0x3d')){var _0x412dfa={};_0x412dfa[_0x220af2[_0xf540('0x26')]]={'$like':'%'+_0x16749a[_0xf540('0x2f')][_0xf540('0x3a')]+'%'};return _0x412dfa;}})});}_0x236c79=_['merge']({},_0x236c79,_0x16749a[_0xf540('0x3e')]);var _0x4638ee={'where':_0x236c79[_0xf540('0x3b')]};return db[_0xf540('0x3f')]['count'](_0x4638ee)['then'](function(_0x2b3c77){_0x2de632[_0xf540('0x1a')]=_0x2b3c77;if(_0x16749a['query'][_0xf540('0x40')]){_0x236c79['include']=[{'all':!![]}];}return db[_0xf540('0x3f')][_0xf540('0x41')](_0x236c79);})[_0xf540('0x21')](function(_0x19b09f){_0x2de632[_0xf540('0x42')]=_0x19b09f;return _0x2de632;})[_0xf540('0x21')](respondWithFilteredResult(_0x27fe13,_0x236c79))[_0xf540('0x43')](handleError(_0x27fe13,null));};exports[_0xf540('0x44')]=function(_0x213ee8,_0x3e4093){var _0x19c9d5={'raw':![],'where':{'id':_0x213ee8[_0xf540('0x45')]['id']}},_0x2f0336={};_0x2f0336[_0xf540('0x32')]=_[_0xf540('0x2e')](db[_0xf540('0x3f')][_0xf540('0x2a')]);_0x2f0336['query']=_[_0xf540('0x2e')](_0x213ee8[_0xf540('0x2f')]);_0x2f0336[_0xf540('0x30')]=_[_0xf540('0x31')](_0x2f0336['model'],_0x2f0336['query']);_0x19c9d5[_0xf540('0x34')]=_[_0xf540('0x31')](_0x2f0336[_0xf540('0x32')],qs[_0xf540('0x33')](_0x213ee8[_0xf540('0x2f')]['fields']));_0x19c9d5[_0xf540('0x34')]=_0x19c9d5[_0xf540('0x34')][_0xf540('0x46')]?_0x19c9d5[_0xf540('0x34')]:_0x2f0336[_0xf540('0x32')];if(_0x213ee8['query'][_0xf540('0x40')]){_0x19c9d5[_0xf540('0x47')]=[{'all':!![]}];}_0x19c9d5=_[_0xf540('0x3c')]({},_0x19c9d5,_0x213ee8[_0xf540('0x3e')]);return db[_0xf540('0x3f')][_0xf540('0x48')](_0x19c9d5)[_0xf540('0x21')](handleEntityNotFound(_0x3e4093,null))[_0xf540('0x21')](respondWithResult(_0x3e4093,null))[_0xf540('0x43')](handleError(_0x3e4093,null));};exports[_0xf540('0x49')]=function(_0x4ba25c,_0x241a39){return db[_0xf540('0x3f')][_0xf540('0x49')](_0x4ba25c[_0xf540('0x4a')],{})[_0xf540('0x21')](function(_0x2e3203){var _0x55cc52=_0x4ba25c[_0xf540('0x4b')][_0xf540('0x4c')]({'plain':!![]});if(!_0x55cc52)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55cc52[_0xf540('0x4d')]==='user'){var _0x292b78=_0x2e3203[_0xf540('0x4c')]({'plain':!![]});var _0x113d92=_0xf540('0x23');return db[_0xf540('0x4e')][_0xf540('0x48')]({'where':{'name':_0x113d92,'userProfileId':_0x55cc52[_0xf540('0x4f')]},'raw':!![]})[_0xf540('0x21')](function(_0x25bd1c){if(_0x25bd1c&&_0x25bd1c[_0xf540('0x50')]===0x0){return db[_0xf540('0x51')][_0xf540('0x49')]({'name':_0x292b78[_0xf540('0x26')],'resourceId':_0x292b78['id'],'type':_0x25bd1c[_0xf540('0x26')],'sectionId':_0x25bd1c['id']},{})[_0xf540('0x21')](function(){return _0x2e3203;});}else{return _0x2e3203;}})[_0xf540('0x43')](function(_0xa310e5){logger['error'](_0xf540('0x52'),_0xa310e5);throw _0xa310e5;});}return _0x2e3203;})[_0xf540('0x21')](respondWithResult(_0x241a39,0xc9))[_0xf540('0x43')](handleError(_0x241a39,null));};exports[_0xf540('0x53')]=function(_0x9d85f0,_0x50fa7b){var _0x145090={'where':{'id':_0x9d85f0[_0xf540('0x45')]['id']}},_0x17700b={};_0x17700b[_0xf540('0x32')]=_['keys'](db[_0xf540('0x3f')][_0xf540('0x2a')]);_0x145090[_0xf540('0x34')]=_[_0xf540('0x31')](_0x17700b[_0xf540('0x32')],qs[_0xf540('0x33')](_0x9d85f0[_0xf540('0x2f')][_0xf540('0x33')]));_0x145090[_0xf540('0x34')]=_0x145090[_0xf540('0x34')][_0xf540('0x46')]?_0x145090[_0xf540('0x34')]:_0x17700b[_0xf540('0x32')];if(_0x9d85f0[_0xf540('0x2f')][_0xf540('0x40')]){_0x145090[_0xf540('0x47')]=[{'all':!![]}];}_0x145090=_[_0xf540('0x3c')]({},_0x145090,_0x9d85f0[_0xf540('0x3e')]);return db['JscriptyProject'][_0xf540('0x48')](_0x145090)[_0xf540('0x21')](handleEntityNotFound(_0x50fa7b,null))[_0xf540('0x21')](function(_0x3be478){if(_0x3be478){var _0x4988f0=_0x3be478['get']({'plain':!![]});_0x4988f0=qs[_0xf540('0x54')](_0x4988f0,['id',_0xf540('0x55'),_0xf540('0x56')]);_0x9d85f0[_0xf540('0x4a')]=_['omit'](_0x9d85f0[_0xf540('0x4a')],['id','createdAt','updatedAt']);return db[_0xf540('0x3f')][_0xf540('0x49')](_[_0xf540('0x3c')](_0x4988f0,_0x9d85f0[_0xf540('0x4a')]),{'include':_0x9d85f0['query'][_0xf540('0x40')]?[{'all':!![]}]:undefined})[_0xf540('0x21')](function(_0x364082){var _0x5e68eb=_0x9d85f0[_0xf540('0x4b')][_0xf540('0x4c')]({'plain':!![]});if(!_0x5e68eb)throw new Error(_0xf540('0x57'));if(_0x5e68eb[_0xf540('0x4d')]==='user'){var _0x1196f0=_0x364082['get']({'plain':!![]});var _0x5f4cae=_0xf540('0x23');return db[_0xf540('0x4e')][_0xf540('0x48')]({'where':{'name':_0x5f4cae,'userProfileId':_0x5e68eb['userProfileId']},'raw':!![]})[_0xf540('0x21')](function(_0x462cda){if(_0x462cda&&_0x462cda[_0xf540('0x50')]===0x0){return db[_0xf540('0x51')][_0xf540('0x49')]({'name':_0x1196f0[_0xf540('0x26')],'resourceId':_0x1196f0['id'],'type':_0x462cda[_0xf540('0x26')],'sectionId':_0x462cda['id']},{})[_0xf540('0x21')](function(){return _0x364082;});}else{return _0x364082;}})[_0xf540('0x43')](function(_0x4b318b){logger['error'](_0xf540('0x52'),_0x4b318b);throw _0x4b318b;});}return _0x364082;});}})[_0xf540('0x21')](respondWithResult(_0x50fa7b,0xc9))[_0xf540('0x43')](handleError(_0x50fa7b,null));};exports[_0xf540('0x20')]=function(_0x4681f6,_0x211bf3){if(_0x4681f6[_0xf540('0x4a')]['id']){delete _0x4681f6[_0xf540('0x4a')]['id'];}return db[_0xf540('0x3f')][_0xf540('0x48')]({'where':{'id':_0x4681f6[_0xf540('0x45')]['id']}})[_0xf540('0x21')](handleEntityNotFound(_0x211bf3,null))[_0xf540('0x21')](saveUpdates(_0x4681f6[_0xf540('0x4a')],null))[_0xf540('0x21')](respondWithResult(_0x211bf3,null))[_0xf540('0x43')](handleError(_0x211bf3,null));};exports[_0xf540('0x22')]=function(_0x1a101e,_0x2739c3){return db['JscriptyProject'][_0xf540('0x48')]({'where':{'id':_0x1a101e['params']['id']}})[_0xf540('0x21')](handleEntityNotFound(_0x2739c3,null))['then'](removeEntity(_0x2739c3,null))[_0xf540('0x43')](handleError(_0x2739c3,null));};exports[_0xf540('0x58')]=function(_0x438c9f,_0x4afa16,_0x217c54){var _0x2857a9={'raw':!![],'where':{}};var _0x117be4={};var _0x176de5={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf540('0x59')]({'where':{'id':_0x438c9f['params']['id']}})[_0xf540('0x21')](handleEntityNotFound(_0x4afa16,null))[_0xf540('0x21')](function(_0x14c667){if(_0x14c667){_0x117be4[_0xf540('0x32')]=_[_0xf540('0x2e')](db[_0xf540('0x5a')][_0xf540('0x2a')]);_0x117be4[_0xf540('0x2f')]=_[_0xf540('0x2e')](_0x438c9f[_0xf540('0x2f')]);_0x117be4[_0xf540('0x30')]=_[_0xf540('0x31')](_0x117be4[_0xf540('0x32')],_0x117be4[_0xf540('0x2f')]);_0x2857a9['attributes']=_[_0xf540('0x31')](_0x117be4['model'],qs['fields'](_0x438c9f[_0xf540('0x2f')][_0xf540('0x33')]));_0x2857a9[_0xf540('0x34')]=_0x2857a9['attributes']['length']?_0x2857a9[_0xf540('0x34')]:_0x117be4['model'];if(!_0x438c9f[_0xf540('0x2f')][_0xf540('0x35')](_0xf540('0x36'))){_0x2857a9[_0xf540('0x1b')]=qs[_0xf540('0x1b')](_0x438c9f['query'][_0xf540('0x1b')]);_0x2857a9[_0xf540('0x37')]=qs[_0xf540('0x37')](_0x438c9f['query'][_0xf540('0x37')]);}_0x2857a9['order']=qs[_0xf540('0x38')](_0x438c9f[_0xf540('0x2f')][_0xf540('0x38')]);_0x2857a9['where']=qs[_0xf540('0x30')](_[_0xf540('0x39')](_0x438c9f['query'],_0x117be4['filters']));_0x2857a9['where']['ProjectId']=_0x14c667['id'];if(_0x438c9f['query'][_0xf540('0x3a')]){_0x2857a9[_0xf540('0x3b')]=_['merge'](_0x2857a9[_0xf540('0x3b')],{'$or':_[_0xf540('0x29')](_0x2857a9[_0xf540('0x34')],function(_0x3ec019){var _0x45e6b8={};_0x45e6b8[_0x3ec019]={'$like':'%'+_0x438c9f['query']['filter']+'%'};return _0x45e6b8;})});}_0x2857a9=_[_0xf540('0x3c')]({},_0x2857a9,_0x438c9f[_0xf540('0x3e')]);return db['JscriptySessionReport']['count']({'where':_0x2857a9[_0xf540('0x3b')]})[_0xf540('0x21')](function(_0x3d1af6){_0x176de5['count']=_0x3d1af6;if(_0x438c9f[_0xf540('0x2f')]['includeAll']){_0x2857a9[_0xf540('0x47')]=[{'all':!![]}];}return db[_0xf540('0x5a')][_0xf540('0x41')](_0x2857a9);})[_0xf540('0x21')](function(_0x3c974b){_0x176de5[_0xf540('0x42')]=_0x3c974b;return _0x176de5;});}})[_0xf540('0x21')](respondWithFilteredResult(_0x4afa16,_0x2857a9))['catch'](handleError(_0x4afa16,null));};exports[_0xf540('0x5b')]=function(_0x3cf2da,_0x5aa6d4,_0x39e990){var _0x9fc7f5={'raw':!![],'where':{}};var _0x163fd2={};var _0x318507={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf540('0x59')]({'where':{'id':_0x3cf2da[_0xf540('0x45')]['id']}})['then'](handleEntityNotFound(_0x5aa6d4,null))[_0xf540('0x21')](function(_0x4f468c){if(_0x4f468c){_0x163fd2[_0xf540('0x32')]=_[_0xf540('0x2e')](db[_0xf540('0x5c')][_0xf540('0x2a')]);_0x163fd2[_0xf540('0x2f')]=_[_0xf540('0x2e')](_0x3cf2da[_0xf540('0x2f')]);_0x163fd2[_0xf540('0x30')]=_[_0xf540('0x31')](_0x163fd2[_0xf540('0x32')],_0x163fd2[_0xf540('0x2f')]);_0x9fc7f5['attributes']=_[_0xf540('0x31')](_0x163fd2[_0xf540('0x32')],qs[_0xf540('0x33')](_0x3cf2da[_0xf540('0x2f')][_0xf540('0x33')]));_0x9fc7f5[_0xf540('0x34')]=_0x9fc7f5[_0xf540('0x34')]['length']?_0x9fc7f5['attributes']:_0x163fd2['model'];if(!_0x3cf2da['query'][_0xf540('0x35')](_0xf540('0x36'))){_0x9fc7f5[_0xf540('0x1b')]=qs[_0xf540('0x1b')](_0x3cf2da[_0xf540('0x2f')][_0xf540('0x1b')]);_0x9fc7f5[_0xf540('0x37')]=qs[_0xf540('0x37')](_0x3cf2da[_0xf540('0x2f')][_0xf540('0x37')]);}_0x9fc7f5[_0xf540('0x5d')]=qs[_0xf540('0x38')](_0x3cf2da[_0xf540('0x2f')][_0xf540('0x38')]);_0x9fc7f5[_0xf540('0x3b')]=qs['filters'](_[_0xf540('0x39')](_0x3cf2da[_0xf540('0x2f')],_0x163fd2[_0xf540('0x30')]));_0x9fc7f5['where'][_0xf540('0x5e')]=_0x4f468c['id'];if(_0x3cf2da[_0xf540('0x2f')][_0xf540('0x3a')]){_0x9fc7f5[_0xf540('0x3b')]=_[_0xf540('0x3c')](_0x9fc7f5['where'],{'$or':_[_0xf540('0x29')](_0x9fc7f5['attributes'],function(_0x9591b1){var _0xe6062a={};_0xe6062a[_0x9591b1]={'$like':'%'+_0x3cf2da['query'][_0xf540('0x3a')]+'%'};return _0xe6062a;})});}_0x9fc7f5=_['merge']({},_0x9fc7f5,_0x3cf2da[_0xf540('0x3e')]);return db[_0xf540('0x5c')][_0xf540('0x1a')]({'where':_0x9fc7f5[_0xf540('0x3b')]})[_0xf540('0x21')](function(_0x3cbcca){_0x318507[_0xf540('0x1a')]=_0x3cbcca;if(_0x3cf2da['query']['includeAll']){_0x9fc7f5[_0xf540('0x47')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf540('0x41')](_0x9fc7f5);})[_0xf540('0x21')](function(_0x377c81){_0x318507[_0xf540('0x42')]=_0x377c81;return _0x318507;});}})[_0xf540('0x21')](respondWithFilteredResult(_0x5aa6d4,_0x9fc7f5))[_0xf540('0x43')](handleError(_0x5aa6d4,null));};function char(_0x337e04){return _0xf540('0x5f')===typeof _0x337e04?String[_0xf540('0x60')]['apply'](null,arguments):_0x337e04;}function needsEncapsulation(_0x58964f){return!!_0x58964f&&(_0x58964f[_0xf540('0x61')]()['indexOf'](char(0xd))>=0x0||_0x58964f[_0xf540('0x61')]()['indexOf'](char(0xa))>=0x0||_0x58964f[_0xf540('0x61')]()[_0xf540('0x62')](char(0x2c))>=0x0||_0x58964f[_0xf540('0x61')]()[_0xf540('0x62')](char(0x22))>=0x0);}function encapsulate(_0x4be9ae){var _0x30b564=char(0x22),_0x2ca349='\x5c'+char(0x22),_0x330949=_0x4be9ae['toString']()['replace'](new RegExp(_0x30b564,'g'),_0x2ca349);return _0x30b564+_0x330949+_0x30b564;}exports[_0xf540('0x63')]=function(_0x290f5a,_0x466d12,_0x5bff18){var _0x334760,_0x4ee359;var _0x148ed7={'where':{'ProjectId':_0x290f5a[_0xf540('0x45')]['id']}};if(_0x290f5a[_0xf540('0x2f')][_0xf540('0x64')]){_0x148ed7[_0xf540('0x3b')][_0xf540('0x65')]=JSON['parse'](_0x290f5a[_0xf540('0x2f')][_0xf540('0x64')]);}return db[_0xf540('0x5a')][_0xf540('0x41')](_0x148ed7)[_0xf540('0x21')](handleEntityNotFound(_0x466d12,null))[_0xf540('0x21')](function(_0x52cf11){if(_0x52cf11){_0x334760=_0x52cf11;return db[_0xf540('0x66')][_0xf540('0x41')]({'where':{'SessionId':{'$in':_[_0xf540('0x29')](_0x334760,'id')},'ProjectId':_0x290f5a[_0xf540('0x45')]['id']},'order':_0xf540('0x67')});}})[_0xf540('0x21')](handleEntityNotFound(_0x466d12,null))['then'](function(_0x1f2dcf){if(_0x1f2dcf){_0x4ee359=_0x1f2dcf;var _0x1e1fed={};for(var _0xf6c043=0x0,_0x17beae=_0x4ee359[_0xf540('0x46')];_0xf6c043<_0x17beae;_0xf6c043++){if(!_0x1e1fed[_0xf540('0x35')](_0x4ee359[_0xf6c043][_0xf540('0x68')])){_0x1e1fed[_0x4ee359[_0xf6c043]['questionId']]=needsEncapsulation(_0x4ee359[_0xf6c043][_0xf540('0x69')])?encapsulate(_0x4ee359[_0xf6c043][_0xf540('0x69')]):_0x4ee359[_0xf6c043][_0xf540('0x69')];}}var _0x13d6d6=[],_0xb57259={};for(var _0x1c289d=0x0,_0x5b7b5b=_0x334760[_0xf540('0x46')];_0x1c289d<_0x5b7b5b;_0x1c289d++){_0xb57259={'ProjectId':_0x290f5a[_0xf540('0x45')]['id'],'SessionId':_0x334760[_0x1c289d]['id'],'StartTime':moment(_0x334760[_0x1c289d][_0xf540('0x65')])[_0xf540('0x6a')](_0xf540('0x6b'))};for(var _0x3d9a09=0x0,_0x2287fb=_0x4ee359[_0xf540('0x46')];_0x3d9a09<_0x2287fb;_0x3d9a09++){if(_0x4ee359[_0x3d9a09][_0xf540('0x6c')]==_0x334760[_0x1c289d]['id']&&_0x1e1fed[_0xf540('0x35')](_0x4ee359[_0x3d9a09][_0xf540('0x68')])){_0xb57259[_0x1e1fed[_0x4ee359[_0x3d9a09][_0xf540('0x68')]]]=_0x4ee359[_0x3d9a09][_0xf540('0x6d')];}}for(var _0x4e4a03 in _0x1e1fed){if(!_0xb57259['hasOwnProperty'](_0x1e1fed[_0x4e4a03])){_0xb57259[_0x1e1fed[_0x4e4a03]]=null;}}_0x13d6d6[_0xf540('0x6e')](_0xb57259);}return _0x13d6d6;}})[_0xf540('0x21')](function(_0x13d5d1){if(!_[_0xf540('0x6f')](_0x13d5d1)){var _0x190e62=toCsv(_0x13d5d1);var _0x6d745a=Date['now']();fs[_0xf540('0x70')](util[_0xf540('0x6a')](_0xf540('0x71'),_0x290f5a[_0xf540('0x45')]['id'],_0x6d745a),_0x190e62);_0x466d12[_0xf540('0x72')](_0xf540('0x73'),'attachment;\x20filename='+util[_0xf540('0x6a')](_0xf540('0x74'),_0x290f5a[_0xf540('0x45')]['id'],_0x6d745a));_0x466d12[_0xf540('0x72')](_0xf540('0x75'),'text/csv');return _0x466d12[_0xf540('0x76')](util[_0xf540('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x290f5a[_0xf540('0x45')]['id'],_0x6d745a));}else{return _0x466d12[_0xf540('0x17')](0xcc);}})['catch'](handleError(_0x466d12,null));}; \ No newline at end of file +var _0x2416=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','end','error','name','send','JscriptyProject','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','options','omit','updatedAt','getSessions','JscriptySessionReport','ProjectId','map','findOne','JscriptyAnswerReport','number','toString','indexOf','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type'];(function(_0xb8fdcf,_0x4257fe){var _0x46da7e=function(_0x4e9e2a){while(--_0x4e9e2a){_0xb8fdcf['push'](_0xb8fdcf['shift']());}};_0x46da7e(++_0x4257fe);}(_0x2416,0x72));var _0x6241=function(_0x38cec3,_0x45da59){_0x38cec3=_0x38cec3-0x0;var _0x774574=_0x2416[_0x38cec3];return _0x774574;};'use strict';var pdf=require(_0x6241('0x0'));var emlformat=require(_0x6241('0x1'));var rimraf=require(_0x6241('0x2'));var zipdir=require(_0x6241('0x3'));var jsonpatch=require(_0x6241('0x4'));var rp=require(_0x6241('0x5'));var moment=require(_0x6241('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6241('0x7'));var util=require('util');var path=require(_0x6241('0x8'));var sox=require(_0x6241('0x9'));var csv=require(_0x6241('0xa'));var ejs=require(_0x6241('0xb'));var fs=require('fs');var _=require(_0x6241('0xc'));var squel=require(_0x6241('0xd'));var crypto=require(_0x6241('0xe'));var jsforce=require(_0x6241('0xf'));var deskjs=require(_0x6241('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6241('0x11'));var authService=require(_0x6241('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6241('0x13'));var hardwareService=require(_0x6241('0x14'));var logger=require(_0x6241('0x15'))('api');var utils=require(_0x6241('0x16'));var config=require(_0x6241('0x17'));var db=require(_0x6241('0x18'))['db'];function respondWithStatusCode(_0x297bd0,_0x228750){_0x228750=_0x228750||0xcc;return function(_0x20dc13){if(_0x20dc13){return _0x297bd0[_0x6241('0x19')](_0x228750);}return _0x297bd0[_0x6241('0x1a')](_0x228750)['end']();};}function respondWithResult(_0x349684,_0x129b28){_0x129b28=_0x129b28||0xc8;return function(_0x37e729){if(_0x37e729){return _0x349684['status'](_0x129b28)[_0x6241('0x1b')](_0x37e729);}};}function respondWithFilteredResult(_0x277225,_0x2e7f48){return function(_0x136fc1){if(_0x136fc1){var _0x558712=_0x136fc1[_0x6241('0x1c')],_0x1655d3=_0x2e7f48[_0x6241('0x1d')],_0x404d5a=_0x2e7f48[_0x6241('0x1d')]+_0x2e7f48[_0x6241('0x1e')],_0x3295dc;if(_0x404d5a>=_0x558712){_0x404d5a=_0x558712;_0x3295dc=0xc8;}else{_0x3295dc=0xce;}_0x277225['status'](_0x3295dc);return _0x277225[_0x6241('0x1f')](_0x6241('0x20'),_0x1655d3+'-'+_0x404d5a+'/'+_0x558712)[_0x6241('0x1b')](_0x136fc1);}return null;};}function patchUpdates(_0x50573f){return function(_0x4ddfae){try{jsonpatch[_0x6241('0x21')](_0x4ddfae,_0x50573f,!![]);}catch(_0x3f9d40){return BPromise['reject'](_0x3f9d40);}return _0x4ddfae['save']();};}function saveUpdates(_0x46456c,_0x22118e){return function(_0x3e68df){if(_0x3e68df){return _0x3e68df[_0x6241('0x22')](_0x46456c)[_0x6241('0x23')](function(_0x2bac9e){return _0x2bac9e;});}return null;};}function removeEntity(_0x2032e6,_0x47be8d){return function(_0x3d44ea){if(_0x3d44ea){return _0x3d44ea[_0x6241('0x24')]()[_0x6241('0x23')](function(){var _0x18ae8f=_0x3d44ea[_0x6241('0x25')]({'plain':!![]});var _0x52f3eb='Projects';return db[_0x6241('0x26')][_0x6241('0x24')]({'where':{'type':_0x52f3eb,'resourceId':_0x18ae8f['id']}})[_0x6241('0x23')](function(){return _0x3d44ea;});})[_0x6241('0x23')](function(){_0x2032e6[_0x6241('0x1a')](0xcc)[_0x6241('0x27')]();});}};}function handleEntityNotFound(_0x28199a,_0x12e819){return function(_0x4f1c7d){if(!_0x4f1c7d){_0x28199a[_0x6241('0x19')](0x194);}return _0x4f1c7d;};}function handleError(_0x178616,_0xe68382){_0xe68382=_0xe68382||0x1f4;return function(_0x372a43){logger[_0x6241('0x28')](_0x372a43['stack']);if(_0x372a43[_0x6241('0x29')]){delete _0x372a43[_0x6241('0x29')];}_0x178616[_0x6241('0x1a')](_0xe68382)[_0x6241('0x2a')](_0x372a43);};}exports['index']=function(_0x2783c3,_0x382249){var _0x192b4f={},_0x3f858a={},_0x3373ab={'count':0x0,'rows':[]};var _0x430c87=_['map'](db[_0x6241('0x2b')][_0x6241('0x2c')],function(_0xc15a41){return{'name':_0xc15a41['fieldName'],'type':_0xc15a41[_0x6241('0x2d')][_0x6241('0x2e')]};});_0x3f858a[_0x6241('0x2f')]=_['map'](_0x430c87,_0x6241('0x29'));_0x3f858a[_0x6241('0x30')]=_[_0x6241('0x31')](_0x2783c3[_0x6241('0x30')]);_0x3f858a[_0x6241('0x32')]=_[_0x6241('0x33')](_0x3f858a[_0x6241('0x2f')],_0x3f858a[_0x6241('0x30')]);_0x192b4f[_0x6241('0x34')]=_[_0x6241('0x33')](_0x3f858a[_0x6241('0x2f')],qs[_0x6241('0x35')](_0x2783c3[_0x6241('0x30')][_0x6241('0x35')]));_0x192b4f['attributes']=_0x192b4f[_0x6241('0x34')][_0x6241('0x36')]?_0x192b4f[_0x6241('0x34')]:_0x3f858a[_0x6241('0x2f')];if(!_0x2783c3[_0x6241('0x30')][_0x6241('0x37')](_0x6241('0x38'))){_0x192b4f[_0x6241('0x1e')]=qs[_0x6241('0x1e')](_0x2783c3[_0x6241('0x30')][_0x6241('0x1e')]);_0x192b4f[_0x6241('0x1d')]=qs['offset'](_0x2783c3[_0x6241('0x30')][_0x6241('0x1d')]);}_0x192b4f[_0x6241('0x39')]=qs[_0x6241('0x3a')](_0x2783c3['query'][_0x6241('0x3a')]);_0x192b4f[_0x6241('0x3b')]=qs[_0x6241('0x32')](_[_0x6241('0x3c')](_0x2783c3[_0x6241('0x30')],_0x3f858a[_0x6241('0x32')]),_0x430c87);if(_0x2783c3[_0x6241('0x30')][_0x6241('0x3d')]){_0x192b4f[_0x6241('0x3b')]=_[_0x6241('0x3e')](_0x192b4f[_0x6241('0x3b')],{'$or':_['map'](_0x430c87,function(_0x5e70c1){if(_0x5e70c1[_0x6241('0x2d')]!==_0x6241('0x3f')){var _0x4a19e0={};_0x4a19e0[_0x5e70c1[_0x6241('0x29')]]={'$like':'%'+_0x2783c3[_0x6241('0x30')][_0x6241('0x3d')]+'%'};return _0x4a19e0;}})});}_0x192b4f=_['merge']({},_0x192b4f,_0x2783c3['options']);var _0x12f8aa={'where':_0x192b4f['where']};return db[_0x6241('0x2b')][_0x6241('0x1c')](_0x12f8aa)[_0x6241('0x23')](function(_0x35508a){_0x3373ab['count']=_0x35508a;if(_0x2783c3[_0x6241('0x30')][_0x6241('0x40')]){_0x192b4f[_0x6241('0x41')]=[{'all':!![]}];}return db[_0x6241('0x2b')][_0x6241('0x42')](_0x192b4f);})[_0x6241('0x23')](function(_0x44d6bd){_0x3373ab[_0x6241('0x43')]=_0x44d6bd;return _0x3373ab;})['then'](respondWithFilteredResult(_0x382249,_0x192b4f))[_0x6241('0x44')](handleError(_0x382249,null));};exports['show']=function(_0x43821e,_0x5e8238){var _0x198ceb={'raw':![],'where':{'id':_0x43821e[_0x6241('0x45')]['id']}},_0xf6131b={};_0xf6131b[_0x6241('0x2f')]=_[_0x6241('0x31')](db[_0x6241('0x2b')][_0x6241('0x2c')]);_0xf6131b[_0x6241('0x30')]=_[_0x6241('0x31')](_0x43821e['query']);_0xf6131b['filters']=_[_0x6241('0x33')](_0xf6131b[_0x6241('0x2f')],_0xf6131b[_0x6241('0x30')]);_0x198ceb[_0x6241('0x34')]=_[_0x6241('0x33')](_0xf6131b['model'],qs[_0x6241('0x35')](_0x43821e[_0x6241('0x30')][_0x6241('0x35')]));_0x198ceb[_0x6241('0x34')]=_0x198ceb[_0x6241('0x34')][_0x6241('0x36')]?_0x198ceb[_0x6241('0x34')]:_0xf6131b[_0x6241('0x2f')];if(_0x43821e['query'][_0x6241('0x40')]){_0x198ceb[_0x6241('0x41')]=[{'all':!![]}];}_0x198ceb=_[_0x6241('0x3e')]({},_0x198ceb,_0x43821e['options']);return db[_0x6241('0x2b')][_0x6241('0x46')](_0x198ceb)[_0x6241('0x23')](handleEntityNotFound(_0x5e8238,null))[_0x6241('0x23')](respondWithResult(_0x5e8238,null))[_0x6241('0x44')](handleError(_0x5e8238,null));};exports['create']=function(_0x5df24e,_0x18ad47){return db[_0x6241('0x2b')][_0x6241('0x47')](_0x5df24e[_0x6241('0x48')],{})[_0x6241('0x23')](function(_0x1aa02d){var _0x265e9c=_0x5df24e[_0x6241('0x49')][_0x6241('0x25')]({'plain':!![]});if(!_0x265e9c)throw new Error(_0x6241('0x4a'));if(_0x265e9c[_0x6241('0x4b')]===_0x6241('0x49')){var _0x47136e=_0x1aa02d['get']({'plain':!![]});var _0x197eb5=_0x6241('0x4c');return db[_0x6241('0x4d')][_0x6241('0x46')]({'where':{'name':_0x197eb5,'userProfileId':_0x265e9c[_0x6241('0x4e')]},'raw':!![]})[_0x6241('0x23')](function(_0x127786){if(_0x127786&&_0x127786[_0x6241('0x4f')]===0x0){return db[_0x6241('0x26')][_0x6241('0x47')]({'name':_0x47136e['name'],'resourceId':_0x47136e['id'],'type':_0x127786[_0x6241('0x29')],'sectionId':_0x127786['id']},{})[_0x6241('0x23')](function(){return _0x1aa02d;});}else{return _0x1aa02d;}})[_0x6241('0x44')](function(_0xf63613){logger[_0x6241('0x28')](_0x6241('0x50'),_0xf63613);throw _0xf63613;});}return _0x1aa02d;})[_0x6241('0x23')](respondWithResult(_0x18ad47,0xc9))[_0x6241('0x44')](handleError(_0x18ad47,null));};exports['clone']=function(_0x3bcb66,_0x74842c){var _0xb3cf0c={'where':{'id':_0x3bcb66['params']['id']}},_0x13cbc7={};_0x13cbc7[_0x6241('0x2f')]=_[_0x6241('0x31')](db[_0x6241('0x2b')][_0x6241('0x2c')]);_0xb3cf0c['attributes']=_[_0x6241('0x33')](_0x13cbc7[_0x6241('0x2f')],qs['fields'](_0x3bcb66[_0x6241('0x30')][_0x6241('0x35')]));_0xb3cf0c[_0x6241('0x34')]=_0xb3cf0c[_0x6241('0x34')]['length']?_0xb3cf0c[_0x6241('0x34')]:_0x13cbc7['model'];if(_0x3bcb66[_0x6241('0x30')][_0x6241('0x40')]){_0xb3cf0c['include']=[{'all':!![]}];}_0xb3cf0c=_[_0x6241('0x3e')]({},_0xb3cf0c,_0x3bcb66[_0x6241('0x51')]);return db[_0x6241('0x2b')][_0x6241('0x46')](_0xb3cf0c)['then'](handleEntityNotFound(_0x74842c,null))[_0x6241('0x23')](function(_0x21e701){if(_0x21e701){var _0x3b2305=_0x21e701[_0x6241('0x25')]({'plain':!![]});_0x3b2305=qs[_0x6241('0x52')](_0x3b2305,['id','createdAt',_0x6241('0x53')]);_0x3bcb66[_0x6241('0x48')]=_[_0x6241('0x52')](_0x3bcb66[_0x6241('0x48')],['id','createdAt',_0x6241('0x53')]);return db[_0x6241('0x2b')]['create'](_[_0x6241('0x3e')](_0x3b2305,_0x3bcb66['body']),{'include':_0x3bcb66['query'][_0x6241('0x40')]?[{'all':!![]}]:undefined})[_0x6241('0x23')](function(_0x302abb){var _0x4d4aeb=_0x3bcb66[_0x6241('0x49')][_0x6241('0x25')]({'plain':!![]});if(!_0x4d4aeb)throw new Error(_0x6241('0x4a'));if(_0x4d4aeb[_0x6241('0x4b')]===_0x6241('0x49')){var _0xae26af=_0x302abb[_0x6241('0x25')]({'plain':!![]});var _0x5265cd=_0x6241('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x5265cd,'userProfileId':_0x4d4aeb[_0x6241('0x4e')]},'raw':!![]})[_0x6241('0x23')](function(_0x3e348a){if(_0x3e348a&&_0x3e348a[_0x6241('0x4f')]===0x0){return db[_0x6241('0x26')][_0x6241('0x47')]({'name':_0xae26af[_0x6241('0x29')],'resourceId':_0xae26af['id'],'type':_0x3e348a[_0x6241('0x29')],'sectionId':_0x3e348a['id']},{})[_0x6241('0x23')](function(){return _0x302abb;});}else{return _0x302abb;}})[_0x6241('0x44')](function(_0x5c71ce){logger[_0x6241('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c71ce);throw _0x5c71ce;});}return _0x302abb;});}})[_0x6241('0x23')](respondWithResult(_0x74842c,0xc9))[_0x6241('0x44')](handleError(_0x74842c,null));};exports[_0x6241('0x22')]=function(_0xdda896,_0xa3fe8){if(_0xdda896['body']['id']){delete _0xdda896['body']['id'];}return db[_0x6241('0x2b')][_0x6241('0x46')]({'where':{'id':_0xdda896[_0x6241('0x45')]['id']}})[_0x6241('0x23')](handleEntityNotFound(_0xa3fe8,null))['then'](saveUpdates(_0xdda896[_0x6241('0x48')],null))['then'](respondWithResult(_0xa3fe8,null))[_0x6241('0x44')](handleError(_0xa3fe8,null));};exports[_0x6241('0x24')]=function(_0x18c1c2,_0x488db5){return db['JscriptyProject']['find']({'where':{'id':_0x18c1c2[_0x6241('0x45')]['id']}})[_0x6241('0x23')](handleEntityNotFound(_0x488db5,null))[_0x6241('0x23')](removeEntity(_0x488db5,null))[_0x6241('0x44')](handleError(_0x488db5,null));};exports[_0x6241('0x54')]=function(_0x2cec50,_0x5b7c1f,_0x35383a){var _0x17e793={'raw':!![],'where':{}};var _0x58d5d6={};var _0x52562c={'count':0x0,'rows':[]};return db[_0x6241('0x2b')]['findOne']({'where':{'id':_0x2cec50['params']['id']}})[_0x6241('0x23')](handleEntityNotFound(_0x5b7c1f,null))[_0x6241('0x23')](function(_0x2f462d){if(_0x2f462d){_0x58d5d6['model']=_[_0x6241('0x31')](db[_0x6241('0x55')]['rawAttributes']);_0x58d5d6['query']=_[_0x6241('0x31')](_0x2cec50[_0x6241('0x30')]);_0x58d5d6['filters']=_[_0x6241('0x33')](_0x58d5d6[_0x6241('0x2f')],_0x58d5d6['query']);_0x17e793['attributes']=_[_0x6241('0x33')](_0x58d5d6[_0x6241('0x2f')],qs[_0x6241('0x35')](_0x2cec50[_0x6241('0x30')][_0x6241('0x35')]));_0x17e793[_0x6241('0x34')]=_0x17e793[_0x6241('0x34')][_0x6241('0x36')]?_0x17e793[_0x6241('0x34')]:_0x58d5d6[_0x6241('0x2f')];if(!_0x2cec50[_0x6241('0x30')][_0x6241('0x37')]('nolimit')){_0x17e793[_0x6241('0x1e')]=qs[_0x6241('0x1e')](_0x2cec50['query'][_0x6241('0x1e')]);_0x17e793[_0x6241('0x1d')]=qs[_0x6241('0x1d')](_0x2cec50[_0x6241('0x30')][_0x6241('0x1d')]);}_0x17e793[_0x6241('0x39')]=qs['sort'](_0x2cec50['query']['sort']);_0x17e793['where']=qs[_0x6241('0x32')](_[_0x6241('0x3c')](_0x2cec50[_0x6241('0x30')],_0x58d5d6[_0x6241('0x32')]));_0x17e793[_0x6241('0x3b')][_0x6241('0x56')]=_0x2f462d['id'];if(_0x2cec50[_0x6241('0x30')][_0x6241('0x3d')]){_0x17e793[_0x6241('0x3b')]=_['merge'](_0x17e793[_0x6241('0x3b')],{'$or':_[_0x6241('0x57')](_0x17e793[_0x6241('0x34')],function(_0x37b0ed){var _0x31c713={};_0x31c713[_0x37b0ed]={'$like':'%'+_0x2cec50[_0x6241('0x30')][_0x6241('0x3d')]+'%'};return _0x31c713;})});}_0x17e793=_['merge']({},_0x17e793,_0x2cec50['options']);return db[_0x6241('0x55')][_0x6241('0x1c')]({'where':_0x17e793[_0x6241('0x3b')]})['then'](function(_0x5ba60c){_0x52562c[_0x6241('0x1c')]=_0x5ba60c;if(_0x2cec50[_0x6241('0x30')][_0x6241('0x40')]){_0x17e793[_0x6241('0x41')]=[{'all':!![]}];}return db[_0x6241('0x55')]['findAll'](_0x17e793);})[_0x6241('0x23')](function(_0x56bf7a){_0x52562c[_0x6241('0x43')]=_0x56bf7a;return _0x52562c;});}})[_0x6241('0x23')](respondWithFilteredResult(_0x5b7c1f,_0x17e793))[_0x6241('0x44')](handleError(_0x5b7c1f,null));};exports['getAnswers']=function(_0x5a566f,_0x572009,_0x3dae07){var _0x4d7018={'raw':!![],'where':{}};var _0x4af564={};var _0x2c13ae={'count':0x0,'rows':[]};return db[_0x6241('0x2b')][_0x6241('0x58')]({'where':{'id':_0x5a566f['params']['id']}})['then'](handleEntityNotFound(_0x572009,null))[_0x6241('0x23')](function(_0x156430){if(_0x156430){_0x4af564['model']=_[_0x6241('0x31')](db['JscriptyAnswerReport'][_0x6241('0x2c')]);_0x4af564[_0x6241('0x30')]=_[_0x6241('0x31')](_0x5a566f[_0x6241('0x30')]);_0x4af564['filters']=_[_0x6241('0x33')](_0x4af564[_0x6241('0x2f')],_0x4af564[_0x6241('0x30')]);_0x4d7018[_0x6241('0x34')]=_[_0x6241('0x33')](_0x4af564['model'],qs[_0x6241('0x35')](_0x5a566f['query'][_0x6241('0x35')]));_0x4d7018['attributes']=_0x4d7018[_0x6241('0x34')][_0x6241('0x36')]?_0x4d7018['attributes']:_0x4af564[_0x6241('0x2f')];if(!_0x5a566f[_0x6241('0x30')][_0x6241('0x37')](_0x6241('0x38'))){_0x4d7018['limit']=qs[_0x6241('0x1e')](_0x5a566f[_0x6241('0x30')][_0x6241('0x1e')]);_0x4d7018[_0x6241('0x1d')]=qs[_0x6241('0x1d')](_0x5a566f['query'][_0x6241('0x1d')]);}_0x4d7018[_0x6241('0x39')]=qs[_0x6241('0x3a')](_0x5a566f[_0x6241('0x30')][_0x6241('0x3a')]);_0x4d7018[_0x6241('0x3b')]=qs[_0x6241('0x32')](_[_0x6241('0x3c')](_0x5a566f['query'],_0x4af564[_0x6241('0x32')]));_0x4d7018[_0x6241('0x3b')]['ProjectId']=_0x156430['id'];if(_0x5a566f[_0x6241('0x30')]['filter']){_0x4d7018[_0x6241('0x3b')]=_['merge'](_0x4d7018[_0x6241('0x3b')],{'$or':_[_0x6241('0x57')](_0x4d7018[_0x6241('0x34')],function(_0x4568c9){var _0x490dda={};_0x490dda[_0x4568c9]={'$like':'%'+_0x5a566f[_0x6241('0x30')][_0x6241('0x3d')]+'%'};return _0x490dda;})});}_0x4d7018=_[_0x6241('0x3e')]({},_0x4d7018,_0x5a566f['options']);return db[_0x6241('0x59')][_0x6241('0x1c')]({'where':_0x4d7018[_0x6241('0x3b')]})[_0x6241('0x23')](function(_0x40f8c7){_0x2c13ae['count']=_0x40f8c7;if(_0x5a566f[_0x6241('0x30')]['includeAll']){_0x4d7018['include']=[{'all':!![]}];}return db[_0x6241('0x59')][_0x6241('0x42')](_0x4d7018);})[_0x6241('0x23')](function(_0x19260b){_0x2c13ae['rows']=_0x19260b;return _0x2c13ae;});}})['then'](respondWithFilteredResult(_0x572009,_0x4d7018))[_0x6241('0x44')](handleError(_0x572009,null));};function char(_0x1e3b46){return _0x6241('0x5a')===typeof _0x1e3b46?String['fromCharCode']['apply'](null,arguments):_0x1e3b46;}function needsEncapsulation(_0x164994){return!!_0x164994&&(_0x164994[_0x6241('0x5b')]()[_0x6241('0x5c')](char(0xd))>=0x0||_0x164994[_0x6241('0x5b')]()[_0x6241('0x5c')](char(0xa))>=0x0||_0x164994[_0x6241('0x5b')]()['indexOf'](char(0x2c))>=0x0||_0x164994[_0x6241('0x5b')]()[_0x6241('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x44c65e){var _0x335fca=char(0x22),_0x585075='\x5c'+char(0x22),_0x3d803b=_0x44c65e[_0x6241('0x5b')]()['replace'](new RegExp(_0x335fca,'g'),_0x585075);return _0x335fca+_0x3d803b+_0x335fca;}exports[_0x6241('0x5d')]=function(_0x5e4c7c,_0x460b2e,_0x238a97){var _0x202211,_0x359e45;var _0x406afb={'where':{'ProjectId':_0x5e4c7c[_0x6241('0x45')]['id']}};if(_0x5e4c7c[_0x6241('0x30')][_0x6241('0x5e')]){_0x406afb[_0x6241('0x3b')][_0x6241('0x5f')]=JSON[_0x6241('0x60')](_0x5e4c7c[_0x6241('0x30')][_0x6241('0x5e')]);}return db[_0x6241('0x55')][_0x6241('0x42')](_0x406afb)[_0x6241('0x23')](handleEntityNotFound(_0x460b2e,null))['then'](function(_0x527352){if(_0x527352){_0x202211=_0x527352;return db['JscriptyQuestionReport'][_0x6241('0x42')]({'where':{'SessionId':{'$in':_[_0x6241('0x57')](_0x202211,'id')},'ProjectId':_0x5e4c7c['params']['id']},'order':_0x6241('0x61')});}})[_0x6241('0x23')](handleEntityNotFound(_0x460b2e,null))[_0x6241('0x23')](function(_0x2f73e7){if(_0x2f73e7){_0x359e45=_0x2f73e7;var _0x57efc1={};for(var _0x1c4794=0x0,_0x47a885=_0x359e45[_0x6241('0x36')];_0x1c4794<_0x47a885;_0x1c4794++){if(!_0x57efc1[_0x6241('0x37')](_0x359e45[_0x1c4794]['questionId'])){_0x57efc1[_0x359e45[_0x1c4794][_0x6241('0x62')]]=needsEncapsulation(_0x359e45[_0x1c4794][_0x6241('0x63')])?encapsulate(_0x359e45[_0x1c4794][_0x6241('0x63')]):_0x359e45[_0x1c4794][_0x6241('0x63')];}}var _0x4a25d7=[],_0x3544ad={};for(var _0x35d5c7=0x0,_0x399b41=_0x202211[_0x6241('0x36')];_0x35d5c7<_0x399b41;_0x35d5c7++){_0x3544ad={'ProjectId':_0x5e4c7c[_0x6241('0x45')]['id'],'SessionId':_0x202211[_0x35d5c7]['id'],'StartTime':moment(_0x202211[_0x35d5c7][_0x6241('0x5f')])[_0x6241('0x64')](_0x6241('0x65'))};for(var _0x5d42ec=0x0,_0x3a714f=_0x359e45['length'];_0x5d42ec<_0x3a714f;_0x5d42ec++){if(_0x359e45[_0x5d42ec][_0x6241('0x66')]==_0x202211[_0x35d5c7]['id']&&_0x57efc1[_0x6241('0x37')](_0x359e45[_0x5d42ec][_0x6241('0x62')])){_0x3544ad[_0x57efc1[_0x359e45[_0x5d42ec][_0x6241('0x62')]]]=_0x359e45[_0x5d42ec][_0x6241('0x67')];}}for(var _0x33277e in _0x57efc1){if(!_0x3544ad[_0x6241('0x37')](_0x57efc1[_0x33277e])){_0x3544ad[_0x57efc1[_0x33277e]]=null;}}_0x4a25d7[_0x6241('0x68')](_0x3544ad);}return _0x4a25d7;}})['then'](function(_0x536c2f){if(!_[_0x6241('0x69')](_0x536c2f)){var _0x853ac2=toCsv(_0x536c2f);var _0x27ac34=Date[_0x6241('0x6a')]();fs[_0x6241('0x6b')](util[_0x6241('0x64')](_0x6241('0x6c'),_0x5e4c7c[_0x6241('0x45')]['id'],_0x27ac34),_0x853ac2);_0x460b2e[_0x6241('0x6d')](_0x6241('0x6e'),_0x6241('0x6f')+util[_0x6241('0x64')](_0x6241('0x70'),_0x5e4c7c[_0x6241('0x45')]['id'],_0x27ac34));_0x460b2e[_0x6241('0x6d')](_0x6241('0x71'),'text/csv');return _0x460b2e['download'](util[_0x6241('0x64')](_0x6241('0x6c'),_0x5e4c7c[_0x6241('0x45')]['id'],_0x27ac34));}else{return _0x460b2e[_0x6241('0x19')](0xcc);}})[_0x6241('0x44')](handleError(_0x460b2e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 403b9e6..9181034 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 _0x574f=['bluebird','request-promise','path','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','api'];(function(_0x1ccf8c,_0x2ac930){var _0x102db4=function(_0xd489eb){while(--_0xd489eb){_0x1ccf8c['push'](_0x1ccf8c['shift']());}};_0x102db4(++_0x2ac930);}(_0x574f,0x93));var _0xf574=function(_0x4ea209,_0x5acf24){_0x4ea209=_0x4ea209-0x0;var _0x438d12=_0x574f[_0x4ea209];return _0x438d12;};'use strict';var _=require(_0xf574('0x0'));var util=require(_0xf574('0x1'));var logger=require('../../config/logger')(_0xf574('0x2'));var moment=require('moment');var BPromise=require(_0xf574('0x3'));var rp=require(_0xf574('0x4'));var fs=require('fs');var path=require(_0xf574('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf574('0x6'));module[_0xf574('0x7')]=function(_0x26caf4,_0x2f05a8){return _0x26caf4[_0xf574('0x8')]('JscriptyProject',attributes,{'tableName':_0xf574('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdac3=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger'];(function(_0xfb949e,_0x384f65){var _0x14dcef=function(_0x41dbbe){while(--_0x41dbbe){_0xfb949e['push'](_0xfb949e['shift']());}};_0x14dcef(++_0x384f65);}(_0xdac3,0x1ec));var _0x3dac=function(_0x5dcbf0,_0x101d9d){_0x5dcbf0=_0x5dcbf0-0x0;var _0xcf87aa=_0xdac3[_0x5dcbf0];return _0xcf87aa;};'use strict';var _=require(_0x3dac('0x0'));var util=require(_0x3dac('0x1'));var logger=require(_0x3dac('0x2'))('api');var moment=require(_0x3dac('0x3'));var BPromise=require(_0x3dac('0x4'));var rp=require(_0x3dac('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3dac('0x6'));var config=require(_0x3dac('0x7'));var attributes=require(_0x3dac('0x8'));module[_0x3dac('0x9')]=function(_0x466516,_0x4bca4c){return _0x466516['define'](_0x3dac('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 76d2c20..7d8561a 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 _0xe846=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','info'];(function(_0x3261a8,_0x407ce9){var _0x3e39bd=function(_0x24bb35){while(--_0x24bb35){_0x3261a8['push'](_0x3261a8['shift']());}};_0x3e39bd(++_0x407ce9);}(_0xe846,0x198));var _0x6e84=function(_0x351ed8,_0xae88ed){_0x351ed8=_0x351ed8-0x0;var _0x3cf99a=_0xe846[_0x351ed8];return _0x3cf99a;};'use strict';var _=require(_0x6e84('0x0'));var util=require(_0x6e84('0x1'));var moment=require(_0x6e84('0x2'));var BPromise=require(_0x6e84('0x3'));var rs=require(_0x6e84('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e84('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6e84('0x6'));var config=require(_0x6e84('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6e84('0x8')][_0x6e84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xceed96,_0x14b9bb,_0x24b064){return new BPromise(function(_0x40fe3d,_0x54dab6){return client[_0x6e84('0xa')](_0xceed96,_0x24b064)['then'](function(_0x2a1abc){logger[_0x6e84('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x14b9bb,_0x6e84('0xc'));logger[_0x6e84('0xd')](_0x6e84('0xe'),_0x14b9bb,'request\x20sent',JSON[_0x6e84('0xf')](_0x2a1abc));if(_0x2a1abc[_0x6e84('0x10')]){if(_0x2a1abc['error'][_0x6e84('0x11')]===0x1f4){logger['error'](_0x6e84('0x12'),_0x14b9bb,_0x2a1abc['error']['message']);return _0x54dab6(_0x2a1abc[_0x6e84('0x10')][_0x6e84('0x13')]);}logger[_0x6e84('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x14b9bb,_0x2a1abc[_0x6e84('0x10')][_0x6e84('0x13')]);return _0x40fe3d(_0x2a1abc[_0x6e84('0x10')][_0x6e84('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x14b9bb,_0x6e84('0xc'));_0x40fe3d(_0x2a1abc['result']['message']);}})[_0x6e84('0x14')](function(_0x3f6aec){logger[_0x6e84('0x10')](_0x6e84('0x12'),_0x14b9bb,_0x3f6aec);_0x54dab6(_0x3f6aec);});});} \ No newline at end of file +var _0xea5b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea5b,0x172));var _0xbea5=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xea5b[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var moment=require(_0xbea5('0x2'));var BPromise=require(_0xbea5('0x3'));var rs=require(_0xbea5('0x4'));var fs=require('fs');var Redis=require(_0xbea5('0x5'));var db=require(_0xbea5('0x6'))['db'];var utils=require(_0xbea5('0x7'));var logger=require('../../config/logger')(_0xbea5('0x8'));var config=require(_0xbea5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbea5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b7a0,_0x573bbc,_0x25a26b){return new BPromise(function(_0x2002ba,_0x47717c){return client[_0xbea5('0xb')](_0x46b7a0,_0x25a26b)[_0xbea5('0xc')](function(_0xdff8fc){logger[_0xbea5('0xd')](_0xbea5('0xe'),_0x573bbc,_0xbea5('0xf'));logger[_0xbea5('0x10')](_0xbea5('0x11'),_0x573bbc,_0xbea5('0xf'),JSON['stringify'](_0xdff8fc));if(_0xdff8fc[_0xbea5('0x12')]){if(_0xdff8fc[_0xbea5('0x12')]['code']===0x1f4){logger[_0xbea5('0x12')](_0xbea5('0xe'),_0x573bbc,_0xdff8fc[_0xbea5('0x12')][_0xbea5('0x13')]);return _0x47717c(_0xdff8fc[_0xbea5('0x12')]['message']);}logger[_0xbea5('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x573bbc,_0xdff8fc[_0xbea5('0x12')][_0xbea5('0x13')]);return _0x2002ba(_0xdff8fc[_0xbea5('0x12')][_0xbea5('0x13')]);}else{logger[_0xbea5('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x573bbc,_0xbea5('0xf'));_0x2002ba(_0xdff8fc[_0xbea5('0x14')][_0xbea5('0x13')]);}})[_0xbea5('0x15')](function(_0x2b8c0e){logger[_0xbea5('0x12')](_0xbea5('0xe'),_0x573bbc,_0x2b8c0e);_0x47717c(_0x2b8c0e);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2918a44..108a6b9 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 _0x9dbd=['isAuthenticated','index','/describe','describe','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x8a7e38,_0x473a5d){var _0x228609=function(_0x5dcb5c){while(--_0x5dcb5c){_0x8a7e38['push'](_0x8a7e38['shift']());}};_0x228609(++_0x473a5d);}(_0x9dbd,0x121));var _0xd9db=function(_0x1c9d2f,_0x35fb85){_0x1c9d2f=_0x1c9d2f-0x0;var _0x16bc21=_0x9dbd[_0x1c9d2f];return _0x16bc21;};'use strict';var multer=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var path=require(_0xd9db('0x2'));var timeout=require(_0xd9db('0x3'));var express=require(_0xd9db('0x4'));var router=express[_0xd9db('0x5')]();var auth=require(_0xd9db('0x6'));var interaction=require(_0xd9db('0x7'));var config=require(_0xd9db('0x8'));var controller=require(_0xd9db('0x9'));router['get']('/',auth[_0xd9db('0xa')](),controller[_0xd9db('0xb')]);router['get'](_0xd9db('0xc'),auth[_0xd9db('0xa')](),controller[_0xd9db('0xd')]);router[_0xd9db('0xe')](_0xd9db('0xf'),auth[_0xd9db('0xa')](),controller[_0xd9db('0x10')]);router['post']('/',auth[_0xd9db('0xa')](),controller[_0xd9db('0x11')]);router[_0xd9db('0x12')](_0xd9db('0xf'),auth[_0xd9db('0xa')](),controller[_0xd9db('0x13')]);router[_0xd9db('0x14')](_0xd9db('0xf'),auth['isAuthenticated'](),controller[_0xd9db('0x15')]);module[_0xd9db('0x16')]=router; \ No newline at end of file +var _0xefc6=['destroy','multer','util','path','connect-timeout','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0xefc6,0x166));var _0x6efc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xefc6[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x6efc('0x0'));var util=require(_0x6efc('0x1'));var path=require(_0x6efc('0x2'));var timeout=require(_0x6efc('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6efc('0x4'));var controller=require(_0x6efc('0x5'));router[_0x6efc('0x6')]('/',auth[_0x6efc('0x7')](),controller[_0x6efc('0x8')]);router['get'](_0x6efc('0x9'),auth['isAuthenticated'](),controller[_0x6efc('0xa')]);router[_0x6efc('0x6')](_0x6efc('0xb'),auth['isAuthenticated'](),controller[_0x6efc('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6efc('0xd')](_0x6efc('0xb'),auth[_0x6efc('0x7')](),controller[_0x6efc('0xe')]);router[_0x6efc('0xf')]('/:id',auth[_0x6efc('0x7')](),controller[_0x6efc('0x10')]);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 788efc2..9b1e23c 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 _0xbbf3=['long','sequelize','STRING','TEXT'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xbbf3,0xa1));var _0x3bbf=function(_0x36bf9e,_0x12f518){_0x36bf9e=_0x36bf9e-0x0;var _0x19795f=_0xbbf3[_0x36bf9e];return _0x19795f;};'use strict';var Sequelize=require(_0x3bbf('0x0'));module['exports']={'question':{'type':Sequelize[_0x3bbf('0x1')]},'answer':{'type':Sequelize[_0x3bbf('0x2')](_0x3bbf('0x3'))},'membername':{'type':Sequelize[_0x3bbf('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3bbf('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3bbf('0x1')]},'calleridnum':{'type':Sequelize[_0x3bbf('0x1')]},'questionId':{'type':Sequelize[_0x3bbf('0x1')]}}; \ No newline at end of file +var _0x32c2=['sequelize','STRING'];(function(_0x57f855,_0x17b5bc){var _0x4f7c3e=function(_0x347d53){while(--_0x347d53){_0x57f855['push'](_0x57f855['shift']());}};_0x4f7c3e(++_0x17b5bc);}(_0x32c2,0xd4));var _0x232c=function(_0x1791b0,_0x3c82f6){_0x1791b0=_0x1791b0-0x0;var _0x23974e=_0x32c2[_0x1791b0];return _0x23974e;};'use strict';var Sequelize=require(_0x232c('0x0'));module['exports']={'question':{'type':Sequelize[_0x232c('0x1')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0x232c('0x1')]},'projectname':{'type':Sequelize[_0x232c('0x1')]},'queue':{'type':Sequelize[_0x232c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x232c('0x1')]},'questionId':{'type':Sequelize[_0x232c('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 356629f..0f17aca 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 _0x1068=['save','destroy','then','error','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','JscriptyQuestionReport','include','findAll','rows','catch','show','params','includeAll','options','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x1068,0x10a));var _0x8106=function(_0x50c53f,_0x6b5572){_0x50c53f=_0x50c53f-0x0;var _0x10218b=_0x1068[_0x50c53f];return _0x10218b;};'use strict';var pdf=require(_0x8106('0x0'));var emlformat=require(_0x8106('0x1'));var rimraf=require(_0x8106('0x2'));var zipdir=require(_0x8106('0x3'));var jsonpatch=require(_0x8106('0x4'));var rp=require(_0x8106('0x5'));var moment=require('moment');var BPromise=require(_0x8106('0x6'));var Mustache=require(_0x8106('0x7'));var util=require(_0x8106('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8106('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8106('0xa'));var squel=require('squel');var crypto=require(_0x8106('0xb'));var jsforce=require(_0x8106('0xc'));var deskjs=require(_0x8106('0xd'));var toCsv=require(_0x8106('0x9'));var querystring=require(_0x8106('0xe'));var Papa=require(_0x8106('0xf'));var Redis=require(_0x8106('0x10'));var authService=require(_0x8106('0x11'));var qs=require(_0x8106('0x12'));var as=require(_0x8106('0x13'));var hardwareService=require(_0x8106('0x14'));var logger=require('../../config/logger')(_0x8106('0x15'));var utils=require(_0x8106('0x16'));var config=require(_0x8106('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd90c26,_0x17fb04){_0x17fb04=_0x17fb04||0xcc;return function(_0x589a72){if(_0x589a72){return _0xd90c26[_0x8106('0x18')](_0x17fb04);}return _0xd90c26[_0x8106('0x19')](_0x17fb04)[_0x8106('0x1a')]();};}function respondWithResult(_0x15b756,_0x105441){_0x105441=_0x105441||0xc8;return function(_0x341382){if(_0x341382){return _0x15b756[_0x8106('0x19')](_0x105441)[_0x8106('0x1b')](_0x341382);}};}function respondWithFilteredResult(_0x13d380,_0x20a0ed){return function(_0x27127f){if(_0x27127f){var _0x5c89bd=_0x27127f[_0x8106('0x1c')],_0xe40d2a=_0x20a0ed['offset'],_0x4d415b=_0x20a0ed[_0x8106('0x1d')]+_0x20a0ed[_0x8106('0x1e')],_0xe5a4c2;if(_0x4d415b>=_0x5c89bd){_0x4d415b=_0x5c89bd;_0xe5a4c2=0xc8;}else{_0xe5a4c2=0xce;}_0x13d380[_0x8106('0x19')](_0xe5a4c2);return _0x13d380['set'](_0x8106('0x1f'),_0xe40d2a+'-'+_0x4d415b+'/'+_0x5c89bd)[_0x8106('0x1b')](_0x27127f);}return null;};}function patchUpdates(_0x1dd489){return function(_0x571dad){try{jsonpatch[_0x8106('0x20')](_0x571dad,_0x1dd489,!![]);}catch(_0x212071){return BPromise[_0x8106('0x21')](_0x212071);}return _0x571dad[_0x8106('0x22')]();};}function saveUpdates(_0x198283,_0xb5542c){return function(_0x1933bd){if(_0x1933bd){return _0x1933bd['update'](_0x198283)['then'](function(_0x940a1b){return _0x940a1b;});}return null;};}function removeEntity(_0xbbbdde,_0x1b634a){return function(_0x2ff6a2){if(_0x2ff6a2){return _0x2ff6a2[_0x8106('0x23')]()[_0x8106('0x24')](function(){_0xbbbdde[_0x8106('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x504047,_0x4362f6){return function(_0x2298d4){if(!_0x2298d4){_0x504047[_0x8106('0x18')](0x194);}return _0x2298d4;};}function handleError(_0x38bafe,_0x2efe7b){_0x2efe7b=_0x2efe7b||0x1f4;return function(_0x3bb6bb){logger[_0x8106('0x25')](_0x3bb6bb['stack']);if(_0x3bb6bb['name']){delete _0x3bb6bb['name'];}_0x38bafe[_0x8106('0x19')](_0x2efe7b)[_0x8106('0x26')](_0x3bb6bb);};}exports[_0x8106('0x27')]=function(_0x318c31,_0x553631){var _0x1ab4d5={},_0x5e0365={},_0xe48108={'count':0x0,'rows':[]};var _0x5ad81d=_[_0x8106('0x28')](db['JscriptyQuestionReport'][_0x8106('0x29')],function(_0x3085ec){return{'name':_0x3085ec[_0x8106('0x2a')],'type':_0x3085ec[_0x8106('0x2b')][_0x8106('0x2c')]};});_0x5e0365['model']=_[_0x8106('0x28')](_0x5ad81d,'name');_0x5e0365[_0x8106('0x2d')]=_[_0x8106('0x2e')](_0x318c31[_0x8106('0x2d')]);_0x5e0365['filters']=_[_0x8106('0x2f')](_0x5e0365[_0x8106('0x30')],_0x5e0365['query']);_0x1ab4d5[_0x8106('0x31')]=_['intersection'](_0x5e0365[_0x8106('0x30')],qs[_0x8106('0x32')](_0x318c31[_0x8106('0x2d')][_0x8106('0x32')]));_0x1ab4d5['attributes']=_0x1ab4d5[_0x8106('0x31')]['length']?_0x1ab4d5[_0x8106('0x31')]:_0x5e0365[_0x8106('0x30')];if(!_0x318c31['query'][_0x8106('0x33')]('nolimit')){_0x1ab4d5[_0x8106('0x1e')]=qs[_0x8106('0x1e')](_0x318c31[_0x8106('0x2d')][_0x8106('0x1e')]);_0x1ab4d5['offset']=qs[_0x8106('0x1d')](_0x318c31[_0x8106('0x2d')][_0x8106('0x1d')]);}_0x1ab4d5[_0x8106('0x34')]=qs[_0x8106('0x35')](_0x318c31[_0x8106('0x2d')][_0x8106('0x35')]);_0x1ab4d5[_0x8106('0x36')]=qs[_0x8106('0x37')](_[_0x8106('0x38')](_0x318c31[_0x8106('0x2d')],_0x5e0365['filters']),_0x5ad81d);if(_0x318c31[_0x8106('0x2d')][_0x8106('0x39')]){_0x1ab4d5[_0x8106('0x36')]=_[_0x8106('0x3a')](_0x1ab4d5[_0x8106('0x36')],{'$or':_[_0x8106('0x28')](_0x5ad81d,function(_0x1e3270){if(_0x1e3270[_0x8106('0x2b')]!==_0x8106('0x3b')){var _0x1bd4d6={};_0x1bd4d6[_0x1e3270[_0x8106('0x3c')]]={'$like':'%'+_0x318c31[_0x8106('0x2d')][_0x8106('0x39')]+'%'};return _0x1bd4d6;}})});}_0x1ab4d5=_[_0x8106('0x3a')]({},_0x1ab4d5,_0x318c31['options']);var _0x4a96b6={'where':_0x1ab4d5[_0x8106('0x36')]};return db[_0x8106('0x3d')][_0x8106('0x1c')](_0x4a96b6)[_0x8106('0x24')](function(_0xfeeff8){_0xe48108['count']=_0xfeeff8;if(_0x318c31[_0x8106('0x2d')]['includeAll']){_0x1ab4d5[_0x8106('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8106('0x3f')](_0x1ab4d5);})[_0x8106('0x24')](function(_0x10d186){_0xe48108[_0x8106('0x40')]=_0x10d186;return _0xe48108;})[_0x8106('0x24')](respondWithFilteredResult(_0x553631,_0x1ab4d5))[_0x8106('0x41')](handleError(_0x553631,null));};exports[_0x8106('0x42')]=function(_0x14f3f8,_0x410718){var _0x2f155b={'raw':!![],'where':{'id':_0x14f3f8[_0x8106('0x43')]['id']}},_0x3ed7b8={};_0x3ed7b8[_0x8106('0x30')]=_['keys'](db[_0x8106('0x3d')][_0x8106('0x29')]);_0x3ed7b8[_0x8106('0x2d')]=_['keys'](_0x14f3f8['query']);_0x3ed7b8[_0x8106('0x37')]=_[_0x8106('0x2f')](_0x3ed7b8[_0x8106('0x30')],_0x3ed7b8['query']);_0x2f155b['attributes']=_[_0x8106('0x2f')](_0x3ed7b8[_0x8106('0x30')],qs[_0x8106('0x32')](_0x14f3f8[_0x8106('0x2d')][_0x8106('0x32')]));_0x2f155b['attributes']=_0x2f155b['attributes']['length']?_0x2f155b[_0x8106('0x31')]:_0x3ed7b8['model'];if(_0x14f3f8[_0x8106('0x2d')][_0x8106('0x44')]){_0x2f155b[_0x8106('0x3e')]=[{'all':!![]}];}_0x2f155b=_[_0x8106('0x3a')]({},_0x2f155b,_0x14f3f8[_0x8106('0x45')]);return db[_0x8106('0x3d')]['find'](_0x2f155b)[_0x8106('0x24')](handleEntityNotFound(_0x410718,null))['then'](respondWithResult(_0x410718,null))[_0x8106('0x41')](handleError(_0x410718,null));};exports[_0x8106('0x46')]=function(_0xd0fee6,_0xd721d2){return db[_0x8106('0x3d')][_0x8106('0x46')](_0xd0fee6[_0x8106('0x47')],{})[_0x8106('0x24')](respondWithResult(_0xd721d2,0xc9))[_0x8106('0x41')](handleError(_0xd721d2,null));};exports[_0x8106('0x48')]=function(_0x5f243f,_0x1f116f){if(_0x5f243f['body']['id']){delete _0x5f243f[_0x8106('0x47')]['id'];}return db[_0x8106('0x3d')][_0x8106('0x49')]({'where':{'id':_0x5f243f[_0x8106('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f116f,null))[_0x8106('0x24')](saveUpdates(_0x5f243f[_0x8106('0x47')],null))[_0x8106('0x24')](respondWithResult(_0x1f116f,null))[_0x8106('0x41')](handleError(_0x1f116f,null));};exports[_0x8106('0x23')]=function(_0x1ce27d,_0x3a8b72){return db[_0x8106('0x3d')][_0x8106('0x49')]({'where':{'id':_0x1ce27d[_0x8106('0x43')]['id']}})[_0x8106('0x24')](handleEntityNotFound(_0x3a8b72,null))[_0x8106('0x24')](removeEntity(_0x3a8b72,null))[_0x8106('0x41')](handleError(_0x3a8b72,null));};exports[_0x8106('0x4a')]=function(_0x1a7ae5,_0xe4e1c7){return db[_0x8106('0x3d')]['describe']()[_0x8106('0x24')](respondWithResult(_0xe4e1c7,null))['catch'](handleError(_0xe4e1c7,null));}; \ No newline at end of file +var _0xaa5a=['Content-Range','apply','reject','update','then','stack','name','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','destroy','describe','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set'];(function(_0x5d1f03,_0x206425){var _0x366fa2=function(_0x5b0b6d){while(--_0x5b0b6d){_0x5d1f03['push'](_0x5d1f03['shift']());}};_0x366fa2(++_0x206425);}(_0xaa5a,0x109));var _0xaaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5a[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaaa5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaaa5('0x1'));var jsonpatch=require(_0xaaa5('0x2'));var rp=require(_0xaaa5('0x3'));var moment=require(_0xaaa5('0x4'));var BPromise=require(_0xaaa5('0x5'));var Mustache=require(_0xaaa5('0x6'));var util=require(_0xaaa5('0x7'));var path=require('path');var sox=require(_0xaaa5('0x8'));var csv=require(_0xaaa5('0x9'));var ejs=require(_0xaaa5('0xa'));var fs=require('fs');var _=require(_0xaaa5('0xb'));var squel=require(_0xaaa5('0xc'));var crypto=require('crypto');var jsforce=require(_0xaaa5('0xd'));var deskjs=require(_0xaaa5('0xe'));var toCsv=require(_0xaaa5('0x9'));var querystring=require(_0xaaa5('0xf'));var Papa=require(_0xaaa5('0x10'));var Redis=require(_0xaaa5('0x11'));var authService=require(_0xaaa5('0x12'));var qs=require(_0xaaa5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaaa5('0x14'));var logger=require(_0xaaa5('0x15'))(_0xaaa5('0x16'));var utils=require('../../config/utils');var config=require(_0xaaa5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35d83c,_0x46e11f){_0x46e11f=_0x46e11f||0xcc;return function(_0x496516){if(_0x496516){return _0x35d83c[_0xaaa5('0x18')](_0x46e11f);}return _0x35d83c[_0xaaa5('0x19')](_0x46e11f)['end']();};}function respondWithResult(_0x243c35,_0x18566d){_0x18566d=_0x18566d||0xc8;return function(_0x28d522){if(_0x28d522){return _0x243c35[_0xaaa5('0x19')](_0x18566d)[_0xaaa5('0x1a')](_0x28d522);}};}function respondWithFilteredResult(_0x4be044,_0x62dd40){return function(_0x3d788a){if(_0x3d788a){var _0x3e1ff6=_0x3d788a[_0xaaa5('0x1b')],_0x6f17c0=_0x62dd40[_0xaaa5('0x1c')],_0x4d6f17=_0x62dd40['offset']+_0x62dd40[_0xaaa5('0x1d')],_0x5c55a8;if(_0x4d6f17>=_0x3e1ff6){_0x4d6f17=_0x3e1ff6;_0x5c55a8=0xc8;}else{_0x5c55a8=0xce;}_0x4be044[_0xaaa5('0x19')](_0x5c55a8);return _0x4be044[_0xaaa5('0x1e')](_0xaaa5('0x1f'),_0x6f17c0+'-'+_0x4d6f17+'/'+_0x3e1ff6)[_0xaaa5('0x1a')](_0x3d788a);}return null;};}function patchUpdates(_0x3de085){return function(_0x2b1ed3){try{jsonpatch[_0xaaa5('0x20')](_0x2b1ed3,_0x3de085,!![]);}catch(_0xeb6226){return BPromise[_0xaaa5('0x21')](_0xeb6226);}return _0x2b1ed3['save']();};}function saveUpdates(_0x420dd6,_0x4c2861){return function(_0x4db045){if(_0x4db045){return _0x4db045[_0xaaa5('0x22')](_0x420dd6)[_0xaaa5('0x23')](function(_0xe87fc){return _0xe87fc;});}return null;};}function removeEntity(_0x1a8f02,_0x18a234){return function(_0x1e9ebf){if(_0x1e9ebf){return _0x1e9ebf['destroy']()[_0xaaa5('0x23')](function(){_0x1a8f02[_0xaaa5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2faa5f,_0x2072ae){return function(_0x1847fb){if(!_0x1847fb){_0x2faa5f['sendStatus'](0x194);}return _0x1847fb;};}function handleError(_0x245ee4,_0x5a588d){_0x5a588d=_0x5a588d||0x1f4;return function(_0x295f4c){logger['error'](_0x295f4c[_0xaaa5('0x24')]);if(_0x295f4c['name']){delete _0x295f4c[_0xaaa5('0x25')];}_0x245ee4[_0xaaa5('0x19')](_0x5a588d)['send'](_0x295f4c);};}exports[_0xaaa5('0x26')]=function(_0x1b926c,_0x574146){var _0x3d46e6={},_0x13258e={},_0x4e5fca={'count':0x0,'rows':[]};var _0x220fc1=_['map'](db[_0xaaa5('0x27')][_0xaaa5('0x28')],function(_0x20d270){return{'name':_0x20d270[_0xaaa5('0x29')],'type':_0x20d270[_0xaaa5('0x2a')][_0xaaa5('0x2b')]};});_0x13258e['model']=_[_0xaaa5('0x2c')](_0x220fc1,'name');_0x13258e[_0xaaa5('0x2d')]=_['keys'](_0x1b926c[_0xaaa5('0x2d')]);_0x13258e['filters']=_[_0xaaa5('0x2e')](_0x13258e[_0xaaa5('0x2f')],_0x13258e[_0xaaa5('0x2d')]);_0x3d46e6[_0xaaa5('0x30')]=_[_0xaaa5('0x2e')](_0x13258e[_0xaaa5('0x2f')],qs[_0xaaa5('0x31')](_0x1b926c[_0xaaa5('0x2d')]['fields']));_0x3d46e6[_0xaaa5('0x30')]=_0x3d46e6[_0xaaa5('0x30')][_0xaaa5('0x32')]?_0x3d46e6[_0xaaa5('0x30')]:_0x13258e[_0xaaa5('0x2f')];if(!_0x1b926c['query'][_0xaaa5('0x33')](_0xaaa5('0x34'))){_0x3d46e6[_0xaaa5('0x1d')]=qs[_0xaaa5('0x1d')](_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x1d')]);_0x3d46e6[_0xaaa5('0x1c')]=qs['offset'](_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x1c')]);}_0x3d46e6[_0xaaa5('0x35')]=qs[_0xaaa5('0x36')](_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x36')]);_0x3d46e6['where']=qs[_0xaaa5('0x37')](_['pick'](_0x1b926c[_0xaaa5('0x2d')],_0x13258e[_0xaaa5('0x37')]),_0x220fc1);if(_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x38')]){_0x3d46e6[_0xaaa5('0x39')]=_[_0xaaa5('0x3a')](_0x3d46e6['where'],{'$or':_[_0xaaa5('0x2c')](_0x220fc1,function(_0x18fcb8){if(_0x18fcb8[_0xaaa5('0x2a')]!==_0xaaa5('0x3b')){var _0x2039a9={};_0x2039a9[_0x18fcb8[_0xaaa5('0x25')]]={'$like':'%'+_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x38')]+'%'};return _0x2039a9;}})});}_0x3d46e6=_[_0xaaa5('0x3a')]({},_0x3d46e6,_0x1b926c[_0xaaa5('0x3c')]);var _0x463547={'where':_0x3d46e6['where']};return db['JscriptyQuestionReport'][_0xaaa5('0x1b')](_0x463547)['then'](function(_0xce50e1){_0x4e5fca[_0xaaa5('0x1b')]=_0xce50e1;if(_0x1b926c[_0xaaa5('0x2d')][_0xaaa5('0x3d')]){_0x3d46e6[_0xaaa5('0x3e')]=[{'all':!![]}];}return db[_0xaaa5('0x27')][_0xaaa5('0x3f')](_0x3d46e6);})[_0xaaa5('0x23')](function(_0x103397){_0x4e5fca[_0xaaa5('0x40')]=_0x103397;return _0x4e5fca;})[_0xaaa5('0x23')](respondWithFilteredResult(_0x574146,_0x3d46e6))[_0xaaa5('0x41')](handleError(_0x574146,null));};exports[_0xaaa5('0x42')]=function(_0x110f3d,_0x1d12ef){var _0xf606f3={'raw':!![],'where':{'id':_0x110f3d['params']['id']}},_0x41fc89={};_0x41fc89['model']=_[_0xaaa5('0x43')](db[_0xaaa5('0x27')][_0xaaa5('0x28')]);_0x41fc89['query']=_[_0xaaa5('0x43')](_0x110f3d[_0xaaa5('0x2d')]);_0x41fc89['filters']=_[_0xaaa5('0x2e')](_0x41fc89[_0xaaa5('0x2f')],_0x41fc89[_0xaaa5('0x2d')]);_0xf606f3[_0xaaa5('0x30')]=_['intersection'](_0x41fc89[_0xaaa5('0x2f')],qs[_0xaaa5('0x31')](_0x110f3d[_0xaaa5('0x2d')]['fields']));_0xf606f3['attributes']=_0xf606f3[_0xaaa5('0x30')][_0xaaa5('0x32')]?_0xf606f3[_0xaaa5('0x30')]:_0x41fc89[_0xaaa5('0x2f')];if(_0x110f3d[_0xaaa5('0x2d')]['includeAll']){_0xf606f3[_0xaaa5('0x3e')]=[{'all':!![]}];}_0xf606f3=_['merge']({},_0xf606f3,_0x110f3d['options']);return db[_0xaaa5('0x27')][_0xaaa5('0x44')](_0xf606f3)['then'](handleEntityNotFound(_0x1d12ef,null))['then'](respondWithResult(_0x1d12ef,null))[_0xaaa5('0x41')](handleError(_0x1d12ef,null));};exports[_0xaaa5('0x45')]=function(_0x4fe99a,_0x5a77b2){return db[_0xaaa5('0x27')][_0xaaa5('0x45')](_0x4fe99a[_0xaaa5('0x46')],{})[_0xaaa5('0x23')](respondWithResult(_0x5a77b2,0xc9))[_0xaaa5('0x41')](handleError(_0x5a77b2,null));};exports['update']=function(_0x366ecf,_0x1aa989){if(_0x366ecf[_0xaaa5('0x46')]['id']){delete _0x366ecf['body']['id'];}return db[_0xaaa5('0x27')][_0xaaa5('0x44')]({'where':{'id':_0x366ecf[_0xaaa5('0x47')]['id']}})[_0xaaa5('0x23')](handleEntityNotFound(_0x1aa989,null))[_0xaaa5('0x23')](saveUpdates(_0x366ecf[_0xaaa5('0x46')],null))['then'](respondWithResult(_0x1aa989,null))[_0xaaa5('0x41')](handleError(_0x1aa989,null));};exports[_0xaaa5('0x48')]=function(_0x4ce20f,_0x40bdef){return db[_0xaaa5('0x27')][_0xaaa5('0x44')]({'where':{'id':_0x4ce20f['params']['id']}})[_0xaaa5('0x23')](handleEntityNotFound(_0x40bdef,null))[_0xaaa5('0x23')](removeEntity(_0x40bdef,null))[_0xaaa5('0x41')](handleError(_0x40bdef,null));};exports[_0xaaa5('0x49')]=function(_0x316aee,_0x2ac5a0){return db['JscriptyQuestionReport']['describe']()[_0xaaa5('0x23')](respondWithResult(_0x2ac5a0,null))[_0xaaa5('0x41')](handleError(_0x2ac5a0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4173503..e663bcc 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 _0x4a04=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x4a04,0x17f));var _0x44a0=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4a04[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0x44a0('0x0'));var util=require(_0x44a0('0x1'));var logger=require(_0x44a0('0x2'))(_0x44a0('0x3'));var moment=require(_0x44a0('0x4'));var BPromise=require(_0x44a0('0x5'));var rp=require(_0x44a0('0x6'));var fs=require('fs');var path=require(_0x44a0('0x7'));var rimraf=require(_0x44a0('0x8'));var config=require(_0x44a0('0x9'));var attributes=require(_0x44a0('0xa'));module[_0x44a0('0xb')]=function(_0x98adf,_0x5906db){return _0x98adf[_0x44a0('0xc')](_0x44a0('0xd'),attributes,{'tableName':_0x44a0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf0c=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','bluebird','path','../../config/environment','exports','define'];(function(_0x4855a5,_0x2b95a3){var _0x5b5bf3=function(_0x5b4974){while(--_0x5b4974){_0x4855a5['push'](_0x4855a5['shift']());}};_0x5b5bf3(++_0x2b95a3);}(_0xaf0c,0x12b));var _0xcaf0=function(_0x3f1a8a,_0x5e6b68){_0x3f1a8a=_0x3f1a8a-0x0;var _0x3e34da=_0xaf0c[_0x3f1a8a];return _0x3e34da;};'use strict';var _=require(_0xcaf0('0x0'));var util=require(_0xcaf0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcaf0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaf0('0x3'));var rimraf=require('rimraf');var config=require(_0xcaf0('0x4'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xcaf0('0x5')]=function(_0x47a96,_0x134a89){return _0x47a96[_0xcaf0('0x6')](_0xcaf0('0x7'),attributes,{'tableName':_0xcaf0('0x8'),'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 cbc41fb..72585c7 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 _0x9d98=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x187d30,_0x3b0146){var _0x2abffe=function(_0x141c5f){while(--_0x141c5f){_0x187d30['push'](_0x187d30['shift']());}};_0x2abffe(++_0x3b0146);}(_0x9d98,0xb1));var _0x89d9=function(_0x478d69,_0x4bf921){_0x478d69=_0x478d69-0x0;var _0x3e95bc=_0x9d98[_0x478d69];return _0x3e95bc;};'use strict';var _=require(_0x89d9('0x0'));var util=require(_0x89d9('0x1'));var moment=require(_0x89d9('0x2'));var BPromise=require(_0x89d9('0x3'));var rs=require(_0x89d9('0x4'));var fs=require('fs');var Redis=require(_0x89d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x89d9('0x6'));var logger=require(_0x89d9('0x7'))(_0x89d9('0x8'));var config=require(_0x89d9('0x9'));var jayson=require(_0x89d9('0xa'));var client=jayson[_0x89d9('0xb')][_0x89d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ff9e4,_0x131833,_0x2902f0){return new BPromise(function(_0x1e1778,_0x4db90c){return client[_0x89d9('0xd')](_0x4ff9e4,_0x2902f0)['then'](function(_0x36799b){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x131833,_0x89d9('0xe'));logger[_0x89d9('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x131833,_0x89d9('0xe'),JSON[_0x89d9('0x10')](_0x36799b));if(_0x36799b[_0x89d9('0x11')]){if(_0x36799b[_0x89d9('0x11')][_0x89d9('0x12')]===0x1f4){logger[_0x89d9('0x11')](_0x89d9('0x13'),_0x131833,_0x36799b['error']['message']);return _0x4db90c(_0x36799b[_0x89d9('0x11')][_0x89d9('0x14')]);}logger['error'](_0x89d9('0x13'),_0x131833,_0x36799b[_0x89d9('0x11')]['message']);return _0x1e1778(_0x36799b['error']['message']);}else{logger[_0x89d9('0x15')](_0x89d9('0x13'),_0x131833,'request\x20sent');_0x1e1778(_0x36799b['result'][_0x89d9('0x14')]);}})[_0x89d9('0x16')](function(_0x29f440){logger[_0x89d9('0x11')](_0x89d9('0x13'),_0x131833,_0x29f440);_0x4db90c(_0x29f440);});});} \ No newline at end of file +var _0x2b35=['../../config/environment','jayson/promise','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x2b35,0x1ee));var _0x52b3=function(_0x4e2301,_0x5373d5){_0x4e2301=_0x4e2301-0x0;var _0xcd0a9=_0x2b35[_0x4e2301];return _0xcd0a9;};'use strict';var _=require(_0x52b3('0x0'));var util=require(_0x52b3('0x1'));var moment=require(_0x52b3('0x2'));var BPromise=require(_0x52b3('0x3'));var rs=require(_0x52b3('0x4'));var fs=require('fs');var Redis=require(_0x52b3('0x5'));var db=require(_0x52b3('0x6'))['db'];var utils=require(_0x52b3('0x7'));var logger=require(_0x52b3('0x8'))(_0x52b3('0x9'));var config=require(_0x52b3('0xa'));var jayson=require(_0x52b3('0xb'));var client=jayson['client'][_0x52b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x688b6f,_0x584b2f,_0x454f33){return new BPromise(function(_0x11547d,_0x58f12f){return client[_0x52b3('0xd')](_0x688b6f,_0x454f33)['then'](function(_0x49a9bd){logger[_0x52b3('0xe')](_0x52b3('0xf'),_0x584b2f,_0x52b3('0x10'));logger[_0x52b3('0x11')](_0x52b3('0x12'),_0x584b2f,_0x52b3('0x10'),JSON[_0x52b3('0x13')](_0x49a9bd));if(_0x49a9bd['error']){if(_0x49a9bd[_0x52b3('0x14')]['code']===0x1f4){logger[_0x52b3('0x14')](_0x52b3('0xf'),_0x584b2f,_0x49a9bd[_0x52b3('0x14')][_0x52b3('0x15')]);return _0x58f12f(_0x49a9bd[_0x52b3('0x14')][_0x52b3('0x15')]);}logger[_0x52b3('0x14')](_0x52b3('0xf'),_0x584b2f,_0x49a9bd[_0x52b3('0x14')][_0x52b3('0x15')]);return _0x11547d(_0x49a9bd['error'][_0x52b3('0x15')]);}else{logger[_0x52b3('0xe')](_0x52b3('0xf'),_0x584b2f,'request\x20sent');_0x11547d(_0x49a9bd[_0x52b3('0x16')][_0x52b3('0x15')]);}})[_0x52b3('0x17')](function(_0x5ea982){logger['error'](_0x52b3('0xf'),_0x584b2f,_0x5ea982);_0x58f12f(_0x5ea982);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ea8d429..c31fe6d 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 _0x3937=['isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions','/:id','update','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./jscriptySessionReport.controller','get'];(function(_0x117ffa,_0xac9c1f){var _0x21c64d=function(_0x5b4c38){while(--_0x5b4c38){_0x117ffa['push'](_0x117ffa['shift']());}};_0x21c64d(++_0xac9c1f);}(_0x3937,0xbf));var _0x7393=function(_0x407aa0,_0x5ea282){_0x407aa0=_0x407aa0-0x0;var _0x117c8d=_0x3937[_0x407aa0];return _0x117c8d;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7393('0x4'));var config=require('../../config/environment');var controller=require(_0x7393('0x5'));router[_0x7393('0x6')]('/',auth[_0x7393('0x7')](),controller[_0x7393('0x8')]);router[_0x7393('0x6')](_0x7393('0x9'),auth[_0x7393('0x7')](),controller[_0x7393('0xa')]);router[_0x7393('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7393('0xb')]);router[_0x7393('0x6')](_0x7393('0xc'),auth['isAuthenticated'](),controller[_0x7393('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7393('0xe'),auth[_0x7393('0x7')](),controller[_0x7393('0xf')]);router['delete'](_0x7393('0xe'),auth[_0x7393('0x7')](),controller[_0x7393('0x10')]);module[_0x7393('0x11')]=router; \ No newline at end of file +var _0x6108=['show','/:id/questions','getQuestions','post','create','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x14dc63,_0x557137){var _0x2084cd=function(_0x34869f){while(--_0x34869f){_0x14dc63['push'](_0x14dc63['shift']());}};_0x2084cd(++_0x557137);}(_0x6108,0xbc));var _0x8610=function(_0xeb972f,_0x3076be){_0xeb972f=_0xeb972f-0x0;var _0x27b39b=_0x6108[_0xeb972f];return _0x27b39b;};'use strict';var multer=require(_0x8610('0x0'));var util=require('util');var path=require(_0x8610('0x1'));var timeout=require(_0x8610('0x2'));var express=require(_0x8610('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8610('0x4'));var config=require(_0x8610('0x5'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x8610('0x6')](),controller[_0x8610('0x7')]);router[_0x8610('0x8')](_0x8610('0x9'),auth['isAuthenticated'](),controller[_0x8610('0xa')]);router['get'](_0x8610('0xb'),auth[_0x8610('0x6')](),controller[_0x8610('0xc')]);router['get'](_0x8610('0xd'),auth[_0x8610('0x6')](),controller[_0x8610('0xe')]);router[_0x8610('0xf')]('/',auth[_0x8610('0x6')](),controller[_0x8610('0x10')]);router['put'](_0x8610('0xb'),auth[_0x8610('0x6')](),controller[_0x8610('0x11')]);router['delete'](_0x8610('0xb'),auth['isAuthenticated'](),controller[_0x8610('0x12')]);module[_0x8610('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3e81bfd..27155ab 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 _0xf4a3=['setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x533ea0,_0x87114b){var _0xe1adfa=function(_0x5463aa){while(--_0x5463aa){_0x533ea0['push'](_0x533ea0['shift']());}};_0xe1adfa(++_0x87114b);}(_0xf4a3,0x18c));var _0x3f4a=function(_0x4518cb,_0x59ebdf){_0x4518cb=_0x4518cb-0x0;var _0x153e5c=_0xf4a3[_0x4518cb];return _0x153e5c;};'use strict';var moment=require(_0x3f4a('0x0'));var Sequelize=require(_0x3f4a('0x1'));module[_0x3f4a('0x2')]={'starttime':{'type':Sequelize[_0x3f4a('0x3')],'set':function(_0xadfed0){this['setDataValue']('starttime',_0xadfed0);this[_0x3f4a('0x4')](_0x3f4a('0x5'),moment()[_0x3f4a('0x6')](_0x3f4a('0x7')));}},'endtime':{'type':Sequelize[_0x3f4a('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x3f4a('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3f4a('0x8')]},'calleridname':{'type':Sequelize[_0x3f4a('0x8')]},'calleridnum':{'type':Sequelize[_0x3f4a('0x8')]},'completed':{'type':Sequelize[_0x3f4a('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x683f=['sequelize','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x551e8f,_0x47b713){var _0x5295a0=function(_0x4d4863){while(--_0x4d4863){_0x551e8f['push'](_0x551e8f['shift']());}};_0x5295a0(++_0x47b713);}(_0x683f,0xc7));var _0xf683=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x683f[_0x2fa1c6];return _0x5f3257;};'use strict';var moment=require(_0xf683('0x0'));var Sequelize=require(_0xf683('0x1'));module[_0xf683('0x2')]={'starttime':{'type':Sequelize[_0xf683('0x3')],'set':function(_0x3f8f64){this[_0xf683('0x4')]('starttime',_0x3f8f64);this['setDataValue'](_0xf683('0x5'),moment()[_0xf683('0x6')](_0xf683('0x7')));}},'endtime':{'type':Sequelize[_0xf683('0x3')]},'membername':{'type':Sequelize[_0xf683('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf683('0x8')]},'uniqueid':{'type':Sequelize[_0xf683('0x8')]},'calleridname':{'type':Sequelize[_0xf683('0x8')]},'calleridnum':{'type':Sequelize[_0xf683('0x8')]},'completed':{'type':Sequelize[_0xf683('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 18f3987..b06c31b 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 _0x0c24=['stack','send','index','map','JscriptySessionReport','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','describe','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','eml-format','rimraf','fast-json-patch','request-promise','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','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error'];(function(_0x27777a,_0x10f141){var _0x54a565=function(_0x3e619c){while(--_0x3e619c){_0x27777a['push'](_0x27777a['shift']());}};_0x54a565(++_0x10f141);}(_0x0c24,0xc2));var _0x40c2=function(_0x586837,_0x4f9ed1){_0x586837=_0x586837-0x0;var _0xea18c3=_0x0c24[_0x586837];return _0xea18c3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x40c2('0x0'));var rimraf=require(_0x40c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40c2('0x2'));var rp=require(_0x40c2('0x3'));var moment=require('moment');var BPromise=require(_0x40c2('0x4'));var Mustache=require(_0x40c2('0x5'));var util=require(_0x40c2('0x6'));var path=require('path');var sox=require(_0x40c2('0x7'));var csv=require(_0x40c2('0x8'));var ejs=require(_0x40c2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x40c2('0xa'));var crypto=require(_0x40c2('0xb'));var jsforce=require(_0x40c2('0xc'));var deskjs=require(_0x40c2('0xd'));var toCsv=require(_0x40c2('0x8'));var querystring=require(_0x40c2('0xe'));var Papa=require(_0x40c2('0xf'));var Redis=require('ioredis');var authService=require(_0x40c2('0x10'));var qs=require(_0x40c2('0x11'));var as=require(_0x40c2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40c2('0x13'))(_0x40c2('0x14'));var utils=require(_0x40c2('0x15'));var config=require('../../config/environment');var db=require(_0x40c2('0x16'))['db'];function respondWithStatusCode(_0x26e195,_0x30b3bc){_0x30b3bc=_0x30b3bc||0xcc;return function(_0x1caacb){if(_0x1caacb){return _0x26e195[_0x40c2('0x17')](_0x30b3bc);}return _0x26e195[_0x40c2('0x18')](_0x30b3bc)['end']();};}function respondWithResult(_0x142bb3,_0x5679d2){_0x5679d2=_0x5679d2||0xc8;return function(_0x456184){if(_0x456184){return _0x142bb3[_0x40c2('0x18')](_0x5679d2)['json'](_0x456184);}};}function respondWithFilteredResult(_0x4ac640,_0x1e24c2){return function(_0x33d8b1){if(_0x33d8b1){var _0x10a7a8=_0x33d8b1[_0x40c2('0x19')],_0xed9f44=_0x1e24c2['offset'],_0x27ace2=_0x1e24c2[_0x40c2('0x1a')]+_0x1e24c2[_0x40c2('0x1b')],_0x1ecdb4;if(_0x27ace2>=_0x10a7a8){_0x27ace2=_0x10a7a8;_0x1ecdb4=0xc8;}else{_0x1ecdb4=0xce;}_0x4ac640[_0x40c2('0x18')](_0x1ecdb4);return _0x4ac640[_0x40c2('0x1c')](_0x40c2('0x1d'),_0xed9f44+'-'+_0x27ace2+'/'+_0x10a7a8)[_0x40c2('0x1e')](_0x33d8b1);}return null;};}function patchUpdates(_0x35015e){return function(_0x54c4cf){try{jsonpatch[_0x40c2('0x1f')](_0x54c4cf,_0x35015e,!![]);}catch(_0x4608d1){return BPromise[_0x40c2('0x20')](_0x4608d1);}return _0x54c4cf['save']();};}function saveUpdates(_0x5b9880,_0x440cb5){return function(_0x9e5d70){if(_0x9e5d70){return _0x9e5d70[_0x40c2('0x21')](_0x5b9880)[_0x40c2('0x22')](function(_0x3cbc44){return _0x3cbc44;});}return null;};}function removeEntity(_0x2c0004,_0x5b9f78){return function(_0x4f46b5){if(_0x4f46b5){return _0x4f46b5[_0x40c2('0x23')]()[_0x40c2('0x22')](function(){_0x2c0004[_0x40c2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x69e44d,_0x59dfa3){return function(_0xb31d28){if(!_0xb31d28){_0x69e44d['sendStatus'](0x194);}return _0xb31d28;};}function handleError(_0xb542fa,_0x3f53b7){_0x3f53b7=_0x3f53b7||0x1f4;return function(_0x2cfc9f){logger[_0x40c2('0x24')](_0x2cfc9f[_0x40c2('0x25')]);if(_0x2cfc9f['name']){delete _0x2cfc9f['name'];}_0xb542fa[_0x40c2('0x18')](_0x3f53b7)[_0x40c2('0x26')](_0x2cfc9f);};}exports[_0x40c2('0x27')]=function(_0x227287,_0x349c75){var _0x50a0d7={},_0x468e82={},_0x570a49={'count':0x0,'rows':[]};var _0x3fcc82=_[_0x40c2('0x28')](db[_0x40c2('0x29')]['rawAttributes'],function(_0x57da88){return{'name':_0x57da88[_0x40c2('0x2a')],'type':_0x57da88[_0x40c2('0x2b')][_0x40c2('0x2c')]};});_0x468e82[_0x40c2('0x2d')]=_['map'](_0x3fcc82,_0x40c2('0x2e'));_0x468e82[_0x40c2('0x2f')]=_[_0x40c2('0x30')](_0x227287[_0x40c2('0x2f')]);_0x468e82[_0x40c2('0x31')]=_[_0x40c2('0x32')](_0x468e82[_0x40c2('0x2d')],_0x468e82['query']);_0x50a0d7[_0x40c2('0x33')]=_[_0x40c2('0x32')](_0x468e82[_0x40c2('0x2d')],qs[_0x40c2('0x34')](_0x227287['query'][_0x40c2('0x34')]));_0x50a0d7[_0x40c2('0x33')]=_0x50a0d7[_0x40c2('0x33')][_0x40c2('0x35')]?_0x50a0d7['attributes']:_0x468e82[_0x40c2('0x2d')];if(!_0x227287[_0x40c2('0x2f')]['hasOwnProperty'](_0x40c2('0x36'))){_0x50a0d7[_0x40c2('0x1b')]=qs[_0x40c2('0x1b')](_0x227287[_0x40c2('0x2f')][_0x40c2('0x1b')]);_0x50a0d7[_0x40c2('0x1a')]=qs[_0x40c2('0x1a')](_0x227287[_0x40c2('0x2f')][_0x40c2('0x1a')]);}_0x50a0d7[_0x40c2('0x37')]=qs[_0x40c2('0x38')](_0x227287[_0x40c2('0x2f')]['sort']);_0x50a0d7[_0x40c2('0x39')]=qs[_0x40c2('0x31')](_[_0x40c2('0x3a')](_0x227287[_0x40c2('0x2f')],_0x468e82['filters']),_0x3fcc82);if(_0x227287[_0x40c2('0x2f')][_0x40c2('0x3b')]){_0x50a0d7[_0x40c2('0x39')]=_[_0x40c2('0x3c')](_0x50a0d7[_0x40c2('0x39')],{'$or':_['map'](_0x3fcc82,function(_0x595b48){if(_0x595b48[_0x40c2('0x2b')]!=='VIRTUAL'){var _0x55ef15={};_0x55ef15[_0x595b48[_0x40c2('0x2e')]]={'$like':'%'+_0x227287[_0x40c2('0x2f')][_0x40c2('0x3b')]+'%'};return _0x55ef15;}})});}_0x50a0d7=_['merge']({},_0x50a0d7,_0x227287[_0x40c2('0x3d')]);var _0x52a28d={'where':_0x50a0d7[_0x40c2('0x39')]};return db['JscriptySessionReport'][_0x40c2('0x19')](_0x52a28d)[_0x40c2('0x22')](function(_0x3e92a0){_0x570a49[_0x40c2('0x19')]=_0x3e92a0;if(_0x227287['query']['includeAll']){_0x50a0d7['include']=[{'all':!![]}];}return db[_0x40c2('0x29')][_0x40c2('0x3e')](_0x50a0d7);})['then'](function(_0x552a1e){_0x570a49[_0x40c2('0x3f')]=_0x552a1e;return _0x570a49;})[_0x40c2('0x22')](respondWithFilteredResult(_0x349c75,_0x50a0d7))[_0x40c2('0x40')](handleError(_0x349c75,null));};exports['show']=function(_0x549754,_0x2880ca){var _0x24e7b1={'raw':!![],'where':{'id':_0x549754[_0x40c2('0x41')]['id']}},_0x176494={};_0x176494[_0x40c2('0x2d')]=_[_0x40c2('0x30')](db[_0x40c2('0x29')][_0x40c2('0x42')]);_0x176494[_0x40c2('0x2f')]=_[_0x40c2('0x30')](_0x549754[_0x40c2('0x2f')]);_0x176494['filters']=_[_0x40c2('0x32')](_0x176494[_0x40c2('0x2d')],_0x176494[_0x40c2('0x2f')]);_0x24e7b1[_0x40c2('0x33')]=_[_0x40c2('0x32')](_0x176494[_0x40c2('0x2d')],qs[_0x40c2('0x34')](_0x549754['query'][_0x40c2('0x34')]));_0x24e7b1[_0x40c2('0x33')]=_0x24e7b1['attributes'][_0x40c2('0x35')]?_0x24e7b1[_0x40c2('0x33')]:_0x176494[_0x40c2('0x2d')];if(_0x549754['query'][_0x40c2('0x43')]){_0x24e7b1['include']=[{'all':!![]}];}_0x24e7b1=_[_0x40c2('0x3c')]({},_0x24e7b1,_0x549754[_0x40c2('0x3d')]);return db[_0x40c2('0x29')][_0x40c2('0x44')](_0x24e7b1)[_0x40c2('0x22')](handleEntityNotFound(_0x2880ca,null))[_0x40c2('0x22')](respondWithResult(_0x2880ca,null))[_0x40c2('0x40')](handleError(_0x2880ca,null));};exports[_0x40c2('0x45')]=function(_0x233b77,_0x25574b){return db[_0x40c2('0x29')][_0x40c2('0x45')](_0x233b77[_0x40c2('0x46')],{})['then'](respondWithResult(_0x25574b,0xc9))[_0x40c2('0x40')](handleError(_0x25574b,null));};exports['update']=function(_0x49dc9e,_0x247f02){if(_0x49dc9e[_0x40c2('0x46')]['id']){delete _0x49dc9e[_0x40c2('0x46')]['id'];}return db[_0x40c2('0x29')][_0x40c2('0x44')]({'where':{'id':_0x49dc9e[_0x40c2('0x41')]['id']}})[_0x40c2('0x22')](handleEntityNotFound(_0x247f02,null))['then'](saveUpdates(_0x49dc9e[_0x40c2('0x46')],null))['then'](respondWithResult(_0x247f02,null))[_0x40c2('0x40')](handleError(_0x247f02,null));};exports[_0x40c2('0x23')]=function(_0xdeed5b,_0x4e4116){return db[_0x40c2('0x29')][_0x40c2('0x44')]({'where':{'id':_0xdeed5b[_0x40c2('0x41')]['id']}})[_0x40c2('0x22')](handleEntityNotFound(_0x4e4116,null))[_0x40c2('0x22')](removeEntity(_0x4e4116,null))[_0x40c2('0x40')](handleError(_0x4e4116,null));};exports[_0x40c2('0x47')]=function(_0x24b772,_0xffc1c8){return db[_0x40c2('0x29')][_0x40c2('0x47')]()[_0x40c2('0x22')](respondWithResult(_0xffc1c8,null))[_0x40c2('0x40')](handleError(_0xffc1c8,null));};exports[_0x40c2('0x48')]=function(_0x457583,_0x44d44e,_0x30c6b3){var _0x4c0441={'raw':!![],'where':{}};var _0x5d3f08={};var _0x3396ea={'count':0x0,'rows':[]};return db[_0x40c2('0x29')][_0x40c2('0x49')]({'where':{'id':_0x457583[_0x40c2('0x41')]['id']}})[_0x40c2('0x22')](handleEntityNotFound(_0x44d44e,null))[_0x40c2('0x22')](function(_0x578c30){if(_0x578c30){_0x5d3f08[_0x40c2('0x2d')]=_[_0x40c2('0x30')](db['JscriptyQuestionReport'][_0x40c2('0x42')]);_0x5d3f08[_0x40c2('0x2f')]=_[_0x40c2('0x30')](_0x457583[_0x40c2('0x2f')]);_0x5d3f08[_0x40c2('0x31')]=_[_0x40c2('0x32')](_0x5d3f08[_0x40c2('0x2d')],_0x5d3f08[_0x40c2('0x2f')]);_0x4c0441['attributes']=_[_0x40c2('0x32')](_0x5d3f08[_0x40c2('0x2d')],qs['fields'](_0x457583[_0x40c2('0x2f')][_0x40c2('0x34')]));_0x4c0441[_0x40c2('0x33')]=_0x4c0441[_0x40c2('0x33')][_0x40c2('0x35')]?_0x4c0441[_0x40c2('0x33')]:_0x5d3f08[_0x40c2('0x2d')];if(!_0x457583[_0x40c2('0x2f')][_0x40c2('0x4a')](_0x40c2('0x36'))){_0x4c0441['limit']=qs[_0x40c2('0x1b')](_0x457583[_0x40c2('0x2f')]['limit']);_0x4c0441[_0x40c2('0x1a')]=qs[_0x40c2('0x1a')](_0x457583[_0x40c2('0x2f')][_0x40c2('0x1a')]);}_0x4c0441[_0x40c2('0x37')]=qs['sort'](_0x457583['query'][_0x40c2('0x38')]);_0x4c0441[_0x40c2('0x39')]=qs[_0x40c2('0x31')](_['pick'](_0x457583[_0x40c2('0x2f')],_0x5d3f08[_0x40c2('0x31')]));_0x4c0441[_0x40c2('0x39')][_0x40c2('0x4b')]=_0x578c30['id'];if(_0x457583['query'][_0x40c2('0x3b')]){_0x4c0441['where']=_[_0x40c2('0x3c')](_0x4c0441['where'],{'$or':_[_0x40c2('0x28')](_0x4c0441['attributes'],function(_0x24ced6){var _0x3dbab8={};_0x3dbab8[_0x24ced6]={'$like':'%'+_0x457583[_0x40c2('0x2f')][_0x40c2('0x3b')]+'%'};return _0x3dbab8;})});}_0x4c0441=_[_0x40c2('0x3c')]({},_0x4c0441,_0x457583[_0x40c2('0x3d')]);return db[_0x40c2('0x4c')][_0x40c2('0x19')]({'where':_0x4c0441[_0x40c2('0x39')]})[_0x40c2('0x22')](function(_0x519795){_0x3396ea['count']=_0x519795;if(_0x457583[_0x40c2('0x2f')][_0x40c2('0x43')]){_0x4c0441['include']=[{'all':!![]}];}return db[_0x40c2('0x4c')][_0x40c2('0x3e')](_0x4c0441);})['then'](function(_0x49a627){_0x3396ea[_0x40c2('0x3f')]=_0x49a627;return _0x3396ea;});}})[_0x40c2('0x22')](respondWithFilteredResult(_0x44d44e,_0x4c0441))[_0x40c2('0x40')](handleError(_0x44d44e,null));}; \ No newline at end of file +var _0xde3a=['params','includeAll','find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','SessionId','map','eml-format','zip-dir','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch'];(function(_0x5c257f,_0x54cbd5){var _0x1e3cde=function(_0x36da08){while(--_0x36da08){_0x5c257f['push'](_0x5c257f['shift']());}};_0x1e3cde(++_0x54cbd5);}(_0xde3a,0xa1));var _0xade3=function(_0x402895,_0x1beae7){_0x402895=_0x402895-0x0;var _0x1e3c81=_0xde3a[_0x402895];return _0x1e3c81;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xade3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xade3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xade3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xade3('0x3'));var csv=require(_0xade3('0x4'));var ejs=require(_0xade3('0x5'));var fs=require('fs');var _=require(_0xade3('0x6'));var squel=require(_0xade3('0x7'));var crypto=require(_0xade3('0x8'));var jsforce=require(_0xade3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xade3('0x4'));var querystring=require('querystring');var Papa=require(_0xade3('0xa'));var Redis=require(_0xade3('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xade3('0xc'));var as=require(_0xade3('0xd'));var hardwareService=require(_0xade3('0xe'));var logger=require(_0xade3('0xf'))(_0xade3('0x10'));var utils=require(_0xade3('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa0d664,_0x43f21e){_0x43f21e=_0x43f21e||0xcc;return function(_0x275ab9){if(_0x275ab9){return _0xa0d664[_0xade3('0x12')](_0x43f21e);}return _0xa0d664[_0xade3('0x13')](_0x43f21e)['end']();};}function respondWithResult(_0x3751a5,_0x256109){_0x256109=_0x256109||0xc8;return function(_0x31e2c0){if(_0x31e2c0){return _0x3751a5[_0xade3('0x13')](_0x256109)[_0xade3('0x14')](_0x31e2c0);}};}function respondWithFilteredResult(_0x397d8f,_0x178922){return function(_0x535c6e){if(_0x535c6e){var _0x108d16=_0x535c6e['count'],_0x4f36fa=_0x178922[_0xade3('0x15')],_0x176083=_0x178922[_0xade3('0x15')]+_0x178922['limit'],_0x205d13;if(_0x176083>=_0x108d16){_0x176083=_0x108d16;_0x205d13=0xc8;}else{_0x205d13=0xce;}_0x397d8f[_0xade3('0x13')](_0x205d13);return _0x397d8f['set'](_0xade3('0x16'),_0x4f36fa+'-'+_0x176083+'/'+_0x108d16)['json'](_0x535c6e);}return null;};}function patchUpdates(_0x293cb7){return function(_0xd16bd3){try{jsonpatch[_0xade3('0x17')](_0xd16bd3,_0x293cb7,!![]);}catch(_0x497888){return BPromise['reject'](_0x497888);}return _0xd16bd3[_0xade3('0x18')]();};}function saveUpdates(_0x3528ab,_0x570a97){return function(_0x531674){if(_0x531674){return _0x531674['update'](_0x3528ab)[_0xade3('0x19')](function(_0x292e91){return _0x292e91;});}return null;};}function removeEntity(_0x3f8bbf,_0x3c6668){return function(_0x33854a){if(_0x33854a){return _0x33854a[_0xade3('0x1a')]()['then'](function(){_0x3f8bbf['status'](0xcc)[_0xade3('0x1b')]();});}};}function handleEntityNotFound(_0x5745c3,_0x4785e5){return function(_0x5c5371){if(!_0x5c5371){_0x5745c3[_0xade3('0x12')](0x194);}return _0x5c5371;};}function handleError(_0x265525,_0x239cfd){_0x239cfd=_0x239cfd||0x1f4;return function(_0x635267){logger[_0xade3('0x1c')](_0x635267[_0xade3('0x1d')]);if(_0x635267[_0xade3('0x1e')]){delete _0x635267[_0xade3('0x1e')];}_0x265525[_0xade3('0x13')](_0x239cfd)[_0xade3('0x1f')](_0x635267);};}exports[_0xade3('0x20')]=function(_0x2fd89f,_0x4742fe){var _0x1e22d1={},_0x181ff0={},_0x1f03ff={'count':0x0,'rows':[]};var _0x3345b2=_['map'](db[_0xade3('0x21')][_0xade3('0x22')],function(_0x3b386f){return{'name':_0x3b386f[_0xade3('0x23')],'type':_0x3b386f[_0xade3('0x24')][_0xade3('0x25')]};});_0x181ff0[_0xade3('0x26')]=_['map'](_0x3345b2,'name');_0x181ff0[_0xade3('0x27')]=_[_0xade3('0x28')](_0x2fd89f['query']);_0x181ff0[_0xade3('0x29')]=_[_0xade3('0x2a')](_0x181ff0[_0xade3('0x26')],_0x181ff0[_0xade3('0x27')]);_0x1e22d1[_0xade3('0x2b')]=_['intersection'](_0x181ff0[_0xade3('0x26')],qs['fields'](_0x2fd89f[_0xade3('0x27')][_0xade3('0x2c')]));_0x1e22d1[_0xade3('0x2b')]=_0x1e22d1[_0xade3('0x2b')][_0xade3('0x2d')]?_0x1e22d1[_0xade3('0x2b')]:_0x181ff0[_0xade3('0x26')];if(!_0x2fd89f[_0xade3('0x27')][_0xade3('0x2e')]('nolimit')){_0x1e22d1[_0xade3('0x2f')]=qs[_0xade3('0x2f')](_0x2fd89f['query'][_0xade3('0x2f')]);_0x1e22d1[_0xade3('0x15')]=qs[_0xade3('0x15')](_0x2fd89f[_0xade3('0x27')][_0xade3('0x15')]);}_0x1e22d1[_0xade3('0x30')]=qs[_0xade3('0x31')](_0x2fd89f['query'][_0xade3('0x31')]);_0x1e22d1[_0xade3('0x32')]=qs[_0xade3('0x29')](_[_0xade3('0x33')](_0x2fd89f['query'],_0x181ff0[_0xade3('0x29')]),_0x3345b2);if(_0x2fd89f[_0xade3('0x27')][_0xade3('0x34')]){_0x1e22d1[_0xade3('0x32')]=_['merge'](_0x1e22d1['where'],{'$or':_['map'](_0x3345b2,function(_0x5c623a){if(_0x5c623a[_0xade3('0x24')]!==_0xade3('0x35')){var _0x2e8a8a={};_0x2e8a8a[_0x5c623a[_0xade3('0x1e')]]={'$like':'%'+_0x2fd89f['query'][_0xade3('0x34')]+'%'};return _0x2e8a8a;}})});}_0x1e22d1=_[_0xade3('0x36')]({},_0x1e22d1,_0x2fd89f[_0xade3('0x37')]);var _0x2dcb43={'where':_0x1e22d1[_0xade3('0x32')]};return db['JscriptySessionReport']['count'](_0x2dcb43)['then'](function(_0x5d3dc2){_0x1f03ff[_0xade3('0x38')]=_0x5d3dc2;if(_0x2fd89f[_0xade3('0x27')]['includeAll']){_0x1e22d1[_0xade3('0x39')]=[{'all':!![]}];}return db[_0xade3('0x21')][_0xade3('0x3a')](_0x1e22d1);})['then'](function(_0x41b05c){_0x1f03ff[_0xade3('0x3b')]=_0x41b05c;return _0x1f03ff;})['then'](respondWithFilteredResult(_0x4742fe,_0x1e22d1))[_0xade3('0x3c')](handleError(_0x4742fe,null));};exports['show']=function(_0x55bfbc,_0x365ee0){var _0x2d08b0={'raw':!![],'where':{'id':_0x55bfbc[_0xade3('0x3d')]['id']}},_0x328d37={};_0x328d37[_0xade3('0x26')]=_['keys'](db[_0xade3('0x21')][_0xade3('0x22')]);_0x328d37[_0xade3('0x27')]=_[_0xade3('0x28')](_0x55bfbc[_0xade3('0x27')]);_0x328d37[_0xade3('0x29')]=_[_0xade3('0x2a')](_0x328d37[_0xade3('0x26')],_0x328d37[_0xade3('0x27')]);_0x2d08b0['attributes']=_[_0xade3('0x2a')](_0x328d37['model'],qs[_0xade3('0x2c')](_0x55bfbc[_0xade3('0x27')]['fields']));_0x2d08b0[_0xade3('0x2b')]=_0x2d08b0[_0xade3('0x2b')][_0xade3('0x2d')]?_0x2d08b0[_0xade3('0x2b')]:_0x328d37[_0xade3('0x26')];if(_0x55bfbc[_0xade3('0x27')][_0xade3('0x3e')]){_0x2d08b0[_0xade3('0x39')]=[{'all':!![]}];}_0x2d08b0=_['merge']({},_0x2d08b0,_0x55bfbc['options']);return db['JscriptySessionReport'][_0xade3('0x3f')](_0x2d08b0)['then'](handleEntityNotFound(_0x365ee0,null))[_0xade3('0x19')](respondWithResult(_0x365ee0,null))[_0xade3('0x3c')](handleError(_0x365ee0,null));};exports[_0xade3('0x40')]=function(_0x5473fe,_0x2d0a9c){return db[_0xade3('0x21')][_0xade3('0x40')](_0x5473fe[_0xade3('0x41')],{})[_0xade3('0x19')](respondWithResult(_0x2d0a9c,0xc9))[_0xade3('0x3c')](handleError(_0x2d0a9c,null));};exports[_0xade3('0x42')]=function(_0x195593,_0x4fd77e){if(_0x195593[_0xade3('0x41')]['id']){delete _0x195593[_0xade3('0x41')]['id'];}return db[_0xade3('0x21')]['find']({'where':{'id':_0x195593[_0xade3('0x3d')]['id']}})[_0xade3('0x19')](handleEntityNotFound(_0x4fd77e,null))[_0xade3('0x19')](saveUpdates(_0x195593[_0xade3('0x41')],null))['then'](respondWithResult(_0x4fd77e,null))['catch'](handleError(_0x4fd77e,null));};exports[_0xade3('0x1a')]=function(_0x316426,_0x543e5a){return db[_0xade3('0x21')][_0xade3('0x3f')]({'where':{'id':_0x316426[_0xade3('0x3d')]['id']}})[_0xade3('0x19')](handleEntityNotFound(_0x543e5a,null))['then'](removeEntity(_0x543e5a,null))[_0xade3('0x3c')](handleError(_0x543e5a,null));};exports[_0xade3('0x43')]=function(_0x5052f5,_0x2d1f3b){return db[_0xade3('0x21')][_0xade3('0x43')]()[_0xade3('0x19')](respondWithResult(_0x2d1f3b,null))[_0xade3('0x3c')](handleError(_0x2d1f3b,null));};exports[_0xade3('0x44')]=function(_0x5f12f7,_0x44c539,_0x5cc9b2){var _0x45928a={'raw':!![],'where':{}};var _0xab9a42={};var _0x14d88a={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xade3('0x45')]({'where':{'id':_0x5f12f7['params']['id']}})[_0xade3('0x19')](handleEntityNotFound(_0x44c539,null))[_0xade3('0x19')](function(_0x1ca5e6){if(_0x1ca5e6){_0xab9a42[_0xade3('0x26')]=_[_0xade3('0x28')](db[_0xade3('0x46')][_0xade3('0x22')]);_0xab9a42['query']=_[_0xade3('0x28')](_0x5f12f7[_0xade3('0x27')]);_0xab9a42['filters']=_['intersection'](_0xab9a42[_0xade3('0x26')],_0xab9a42[_0xade3('0x27')]);_0x45928a['attributes']=_['intersection'](_0xab9a42[_0xade3('0x26')],qs[_0xade3('0x2c')](_0x5f12f7[_0xade3('0x27')][_0xade3('0x2c')]));_0x45928a[_0xade3('0x2b')]=_0x45928a[_0xade3('0x2b')][_0xade3('0x2d')]?_0x45928a[_0xade3('0x2b')]:_0xab9a42[_0xade3('0x26')];if(!_0x5f12f7[_0xade3('0x27')]['hasOwnProperty'](_0xade3('0x47'))){_0x45928a[_0xade3('0x2f')]=qs[_0xade3('0x2f')](_0x5f12f7['query']['limit']);_0x45928a[_0xade3('0x15')]=qs[_0xade3('0x15')](_0x5f12f7[_0xade3('0x27')][_0xade3('0x15')]);}_0x45928a[_0xade3('0x30')]=qs[_0xade3('0x31')](_0x5f12f7[_0xade3('0x27')][_0xade3('0x31')]);_0x45928a[_0xade3('0x32')]=qs['filters'](_['pick'](_0x5f12f7[_0xade3('0x27')],_0xab9a42['filters']));_0x45928a[_0xade3('0x32')][_0xade3('0x48')]=_0x1ca5e6['id'];if(_0x5f12f7['query'][_0xade3('0x34')]){_0x45928a[_0xade3('0x32')]=_[_0xade3('0x36')](_0x45928a['where'],{'$or':_[_0xade3('0x49')](_0x45928a[_0xade3('0x2b')],function(_0x43638e){var _0x93f49={};_0x93f49[_0x43638e]={'$like':'%'+_0x5f12f7[_0xade3('0x27')][_0xade3('0x34')]+'%'};return _0x93f49;})});}_0x45928a=_[_0xade3('0x36')]({},_0x45928a,_0x5f12f7[_0xade3('0x37')]);return db['JscriptyQuestionReport'][_0xade3('0x38')]({'where':_0x45928a[_0xade3('0x32')]})[_0xade3('0x19')](function(_0x322801){_0x14d88a[_0xade3('0x38')]=_0x322801;if(_0x5f12f7[_0xade3('0x27')][_0xade3('0x3e')]){_0x45928a[_0xade3('0x39')]=[{'all':!![]}];}return db[_0xade3('0x46')][_0xade3('0x3a')](_0x45928a);})[_0xade3('0x19')](function(_0x237cde){_0x14d88a[_0xade3('0x3b')]=_0x237cde;return _0x14d88a;});}})[_0xade3('0x19')](respondWithFilteredResult(_0x44c539,_0x45928a))[_0xade3('0x3c')](handleError(_0x44c539,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3d4173a..9149a0b 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 _0xf3d4=['../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e67ea,_0x1c8613){var _0x302ad0=function(_0x2d09d1){while(--_0x2d09d1){_0x3e67ea['push'](_0x3e67ea['shift']());}};_0x302ad0(++_0x1c8613);}(_0xf3d4,0x125));var _0x4f3d=function(_0x1da168,_0x331710){_0x1da168=_0x1da168-0x0;var _0x2eaf6f=_0xf3d4[_0x1da168];return _0x2eaf6f;};'use strict';var _=require(_0x4f3d('0x0'));var util=require(_0x4f3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4f3d('0x2'));var BPromise=require(_0x4f3d('0x3'));var rp=require(_0x4f3d('0x4'));var fs=require('fs');var path=require(_0x4f3d('0x5'));var rimraf=require(_0x4f3d('0x6'));var config=require(_0x4f3d('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x4f3d('0x8')]=function(_0x17d521,_0x58009c){return _0x17d521[_0x4f3d('0x9')](_0x4f3d('0xa'),attributes,{'tableName':_0x4f3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7430=['../../config/logger','moment','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7430,0xfb));var _0x0743=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7430[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0743('0x0'));var util=require(_0x0743('0x1'));var logger=require(_0x0743('0x2'))('api');var moment=require(_0x0743('0x3'));var BPromise=require('bluebird');var rp=require(_0x0743('0x4'));var fs=require('fs');var path=require(_0x0743('0x5'));var rimraf=require('rimraf');var config=require(_0x0743('0x6'));var attributes=require(_0x0743('0x7'));module[_0x0743('0x8')]=function(_0x33336f,_0x440dd2){return _0x33336f['define'](_0x0743('0x9'),attributes,{'tableName':_0x0743('0xa'),'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 57f7483..710b4ad 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 _0xd8fb=['catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','JscriptySessionReport,\x20%s,\x20%s','result'];(function(_0x105892,_0x3f07f3){var _0x4ad83e=function(_0x269e17){while(--_0x269e17){_0x105892['push'](_0x105892['shift']());}};_0x4ad83e(++_0x3f07f3);}(_0xd8fb,0x79));var _0xbd8f=function(_0x6f9c56,_0x1ce9dc){_0x6f9c56=_0x6f9c56-0x0;var _0x3bc932=_0xd8fb[_0x6f9c56];return _0x3bc932;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require('moment');var BPromise=require(_0xbd8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd8f('0x3'))['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))(_0xbd8f('0x6'));var config=require(_0xbd8f('0x7'));var jayson=require(_0xbd8f('0x8'));var client=jayson[_0xbd8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541cc6,_0x35a18f,_0x1435da){return new BPromise(function(_0x1da2ab,_0x34e83f){return client[_0xbd8f('0xa')](_0x541cc6,_0x1435da)[_0xbd8f('0xb')](function(_0x2cc18f){logger[_0xbd8f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x35a18f,_0xbd8f('0xd'));logger['debug'](_0xbd8f('0xe'),_0x35a18f,_0xbd8f('0xd'),JSON['stringify'](_0x2cc18f));if(_0x2cc18f[_0xbd8f('0xf')]){if(_0x2cc18f[_0xbd8f('0xf')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x35a18f,_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);return _0x34e83f(_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);}logger[_0xbd8f('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x35a18f,_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);return _0x1da2ab(_0x2cc18f[_0xbd8f('0xf')]['message']);}else{logger['info'](_0xbd8f('0x11'),_0x35a18f,'request\x20sent');_0x1da2ab(_0x2cc18f[_0xbd8f('0x12')][_0xbd8f('0x10')]);}})[_0xbd8f('0x13')](function(_0x4ece3d){logger[_0xbd8f('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x35a18f,_0x4ece3d);_0x34e83f(_0x4ece3d);});});} \ No newline at end of file +var _0xfc84=['request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','client','http'];(function(_0x25a6a7,_0x1986cb){var _0x20cfd1=function(_0x520e35){while(--_0x520e35){_0x25a6a7['push'](_0x25a6a7['shift']());}};_0x20cfd1(++_0x1986cb);}(_0xfc84,0x184));var _0x4fc8=function(_0x29f9ac,_0x2444e8){_0x29f9ac=_0x29f9ac-0x0;var _0x5d8328=_0xfc84[_0x29f9ac];return _0x5d8328;};'use strict';var _=require(_0x4fc8('0x0'));var util=require(_0x4fc8('0x1'));var moment=require('moment');var BPromise=require(_0x4fc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fc8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fc8('0x4'));var logger=require('../../config/logger')(_0x4fc8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4fc8('0x6')][_0x4fc8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x495be0,_0x36af17,_0x5e57ae){return new BPromise(function(_0x12d75c,_0x586802){return client[_0x4fc8('0x8')](_0x495be0,_0x5e57ae)[_0x4fc8('0x9')](function(_0x1cdc74){logger[_0x4fc8('0xa')](_0x4fc8('0xb'),_0x36af17,_0x4fc8('0xc'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x36af17,_0x4fc8('0xc'),JSON['stringify'](_0x1cdc74));if(_0x1cdc74[_0x4fc8('0xd')]){if(_0x1cdc74[_0x4fc8('0xd')][_0x4fc8('0xe')]===0x1f4){logger[_0x4fc8('0xd')](_0x4fc8('0xb'),_0x36af17,_0x1cdc74['error'][_0x4fc8('0xf')]);return _0x586802(_0x1cdc74[_0x4fc8('0xd')]['message']);}logger[_0x4fc8('0xd')](_0x4fc8('0xb'),_0x36af17,_0x1cdc74[_0x4fc8('0xd')][_0x4fc8('0xf')]);return _0x12d75c(_0x1cdc74[_0x4fc8('0xd')][_0x4fc8('0xf')]);}else{logger[_0x4fc8('0xa')](_0x4fc8('0xb'),_0x36af17,'request\x20sent');_0x12d75c(_0x1cdc74[_0x4fc8('0x10')][_0x4fc8('0xf')]);}})[_0x4fc8('0x11')](function(_0x56ed69){logger[_0x4fc8('0xd')](_0x4fc8('0xb'),_0x36af17,_0x56ed69);_0x586802(_0x56ed69);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b295a94..08e3c51 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 _0xc63d=['Router','../../components/auth/service','../../components/interaction/service','index','put','/:id','isAuthenticated','exports','util','path','connect-timeout'];(function(_0x1ba09e,_0x5f53af){var _0x1edb9c=function(_0x9b02cf){while(--_0x9b02cf){_0x1ba09e['push'](_0x1ba09e['shift']());}};_0x1edb9c(++_0x5f53af);}(_0xc63d,0x189));var _0xdc63=function(_0x23161e,_0x332f01){_0x23161e=_0x23161e-0x0;var _0x16b4ff=_0xc63d[_0x23161e];return _0x16b4ff;};'use strict';var multer=require('multer');var util=require(_0xdc63('0x0'));var path=require(_0xdc63('0x1'));var timeout=require(_0xdc63('0x2'));var express=require('express');var router=express[_0xdc63('0x3')]();var auth=require(_0xdc63('0x4'));var interaction=require(_0xdc63('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router['get']('/',controller[_0xdc63('0x6')]);router[_0xdc63('0x7')](_0xdc63('0x8'),auth[_0xdc63('0x9')](),controller['update']);module[_0xdc63('0xa')]=router; \ No newline at end of file +var _0xf378=['/:id','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','put'];(function(_0x38c5a5,_0x30842e){var _0x26315f=function(_0x46de5a){while(--_0x46de5a){_0x38c5a5['push'](_0x38c5a5['shift']());}};_0x26315f(++_0x30842e);}(_0xf378,0x1f0));var _0x8f37=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xf378[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x8f37('0x0'));var util=require(_0x8f37('0x1'));var path=require(_0x8f37('0x2'));var timeout=require(_0x8f37('0x3'));var express=require(_0x8f37('0x4'));var router=express[_0x8f37('0x5')]();var auth=require(_0x8f37('0x6'));var interaction=require(_0x8f37('0x7'));var config=require(_0x8f37('0x8'));var controller=require('./license.controller');router[_0x8f37('0x9')]('/',controller['index']);router[_0x8f37('0xa')](_0x8f37('0xb'),auth['isAuthenticated'](),controller[_0x8f37('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 361864e..4c692af 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 _0x687b=['TEXT','STRING','sequelize','exports'];(function(_0x34f537,_0x2b4b63){var _0x45b8f5=function(_0x56b752){while(--_0x56b752){_0x34f537['push'](_0x34f537['shift']());}};_0x45b8f5(++_0x2b4b63);}(_0x687b,0x14a));var _0xb687=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0x687b[_0x3b56c0];return _0x377efe;};'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 +var _0x46ed=['sequelize','exports','STRING','INTEGER'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x46ed,0x168));var _0xd46e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x46ed[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd46e('0x2')]},'data2':{'type':Sequelize[_0xd46e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd46e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index e2cc9fe..663c7e8 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 _0x7705=['bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','apply','save','update','then','destroy','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','body','params','demo','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x7705,0x93));var _0x5770=function(_0x552914,_0x55a169){_0x552914=_0x552914-0x0;var _0x56dc4c=_0x7705[_0x552914];return _0x56dc4c;};'use strict';var pdf=require(_0x5770('0x0'));var emlformat=require(_0x5770('0x1'));var rimraf=require(_0x5770('0x2'));var zipdir=require(_0x5770('0x3'));var jsonpatch=require(_0x5770('0x4'));var rp=require('request-promise');var moment=require(_0x5770('0x5'));var BPromise=require(_0x5770('0x6'));var Mustache=require(_0x5770('0x7'));var util=require(_0x5770('0x8'));var path=require('path');var sox=require(_0x5770('0x9'));var csv=require(_0x5770('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5770('0xb'));var crypto=require(_0x5770('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5770('0xd'));var Papa=require('papaparse');var Redis=require(_0x5770('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5770('0xf'));var as=require(_0x5770('0x10'));var hardwareService=require(_0x5770('0x11'));var logger=require(_0x5770('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x5770('0x13'));var db=require(_0x5770('0x14'))['db'];function respondWithStatusCode(_0x2e2652,_0x59a6c0){_0x59a6c0=_0x59a6c0||0xcc;return function(_0x2a4c30){if(_0x2a4c30){return _0x2e2652[_0x5770('0x15')](_0x59a6c0);}return _0x2e2652['status'](_0x59a6c0)[_0x5770('0x16')]();};}function respondWithResult(_0x408566,_0x36ffec){_0x36ffec=_0x36ffec||0xc8;return function(_0x1c6473){if(_0x1c6473){return _0x408566[_0x5770('0x17')](_0x36ffec)[_0x5770('0x18')](_0x1c6473);}};}function respondWithFilteredResult(_0x46a4d4,_0x2c7307){return function(_0x11860e){if(_0x11860e){var _0x54ae77=_0x11860e[_0x5770('0x19')],_0x30f86b=_0x2c7307[_0x5770('0x1a')],_0x205cb0=_0x2c7307[_0x5770('0x1a')]+_0x2c7307['limit'],_0xcc4176;if(_0x205cb0>=_0x54ae77){_0x205cb0=_0x54ae77;_0xcc4176=0xc8;}else{_0xcc4176=0xce;}_0x46a4d4[_0x5770('0x17')](_0xcc4176);return _0x46a4d4['set']('Content-Range',_0x30f86b+'-'+_0x205cb0+'/'+_0x54ae77)['json'](_0x11860e);}return null;};}function patchUpdates(_0x206ff9){return function(_0x234d8a){try{jsonpatch[_0x5770('0x1b')](_0x234d8a,_0x206ff9,!![]);}catch(_0x1fd06d){return BPromise['reject'](_0x1fd06d);}return _0x234d8a[_0x5770('0x1c')]();};}function saveUpdates(_0x5bafd7,_0x2d3979){return function(_0x2ed9ea){if(_0x2ed9ea){return _0x2ed9ea[_0x5770('0x1d')](_0x5bafd7)[_0x5770('0x1e')](function(_0x2cda44){return _0x2cda44;});}return null;};}function removeEntity(_0x18dc4e,_0x4030a5){return function(_0x341e72){if(_0x341e72){return _0x341e72[_0x5770('0x1f')]()[_0x5770('0x1e')](function(){_0x18dc4e['status'](0xcc)[_0x5770('0x16')]();});}};}function handleEntityNotFound(_0x560dc2,_0x1cba64){return function(_0x51974c){if(!_0x51974c){_0x560dc2[_0x5770('0x15')](0x194);}return _0x51974c;};}function handleError(_0x480f77,_0x5c5fa2){_0x5c5fa2=_0x5c5fa2||0x1f4;return function(_0x1f6f25){logger['error'](_0x1f6f25[_0x5770('0x20')]);if(_0x1f6f25[_0x5770('0x21')]){delete _0x1f6f25['name'];}_0x480f77[_0x5770('0x17')](_0x5c5fa2)[_0x5770('0x22')](_0x1f6f25);};}var utilLicense=require('../../config/license/util');exports[_0x5770('0x23')]=function(_0x5ac200,_0x588fd4){var _0x341826={'raw':!![],'where':{'id':0x1}},_0x50d958={};_0x50d958[_0x5770('0x24')]=_[_0x5770('0x25')](db['License'][_0x5770('0x26')]);_0x50d958[_0x5770('0x27')]=_[_0x5770('0x25')](_0x5ac200[_0x5770('0x27')]);_0x50d958[_0x5770('0x28')]=_[_0x5770('0x29')](_0x50d958[_0x5770('0x24')],_0x50d958[_0x5770('0x27')]);_0x341826['attributes']=_['intersection'](_0x50d958['model'],qs[_0x5770('0x2a')](_0x5ac200[_0x5770('0x27')]['fields']));_0x341826['attributes']=_0x341826[_0x5770('0x2b')][_0x5770('0x2c')]?_0x341826[_0x5770('0x2b')]:_0x50d958['model'];_0x341826=_[_0x5770('0x2d')]({},_0x341826,_0x5ac200[_0x5770('0x2e')]);return utilLicense['getLicense'](_0x341826)['then'](respondWithResult(_0x588fd4,null))['catch'](handleError(_0x588fd4,null));};exports[_0x5770('0x1d')]=function(_0x39bb18,_0x2401b8){if(_0x39bb18[_0x5770('0x2f')]['id']){delete _0x39bb18[_0x5770('0x2f')]['id'];}return db['License']['find']({'where':{'id':_0x39bb18[_0x5770('0x30')]['id']}})['then'](handleEntityNotFound(_0x2401b8,null))[_0x5770('0x1e')](function(_0xdb20ad){var _0x2b55f3=_0xdb20ad['get']({'plain':!![]});return utilLicense['checkLicense'](_0x2b55f3,_0x39bb18[_0x5770('0x2f')]['key']);})[_0x5770('0x1e')](function(_0x4f9b9e){if(!_0x4f9b9e[_0x5770('0x31')]){return saveUpdates(_0x39bb18['body'],null);}return _0x4f9b9e;})[_0x5770('0x1e')](respondWithResult(_0x2401b8,null))[_0x5770('0x32')](handleError(_0x2401b8,null));}; \ No newline at end of file +var _0x052f=['ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','model','keys','rawAttributes','query','filters','attributes','intersection','fields','length','options','catch','body','License','find','params','checkLicense','key','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x243871,_0x2369ce){var _0x1baee1=function(_0x4e19ad){while(--_0x4e19ad){_0x243871['push'](_0x243871['shift']());}};_0x1baee1(++_0x2369ce);}(_0x052f,0x6b));var _0xf052=function(_0x16df5d,_0xb082bf){_0x16df5d=_0x16df5d-0x0;var _0x5d5694=_0x052f[_0x16df5d];return _0x5d5694;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf052('0x0'));var rimraf=require(_0xf052('0x1'));var zipdir=require(_0xf052('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf052('0x3'));var moment=require('moment');var BPromise=require(_0xf052('0x4'));var Mustache=require(_0xf052('0x5'));var util=require(_0xf052('0x6'));var path=require(_0xf052('0x7'));var sox=require(_0xf052('0x8'));var csv=require('to-csv');var ejs=require(_0xf052('0x9'));var fs=require('fs');var _=require(_0xf052('0xa'));var squel=require(_0xf052('0xb'));var crypto=require('crypto');var jsforce=require(_0xf052('0xc'));var deskjs=require(_0xf052('0xd'));var toCsv=require(_0xf052('0xe'));var querystring=require('querystring');var Papa=require(_0xf052('0xf'));var Redis=require(_0xf052('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf052('0x11'));var hardwareService=require(_0xf052('0x12'));var logger=require(_0xf052('0x13'))('api');var utils=require(_0xf052('0x14'));var config=require(_0xf052('0x15'));var db=require(_0xf052('0x16'))['db'];function respondWithStatusCode(_0x4c507e,_0x42734a){_0x42734a=_0x42734a||0xcc;return function(_0x52b4fb){if(_0x52b4fb){return _0x4c507e[_0xf052('0x17')](_0x42734a);}return _0x4c507e['status'](_0x42734a)[_0xf052('0x18')]();};}function respondWithResult(_0x32d1a1,_0x17b2f7){_0x17b2f7=_0x17b2f7||0xc8;return function(_0x1cd9ab){if(_0x1cd9ab){return _0x32d1a1[_0xf052('0x19')](_0x17b2f7)[_0xf052('0x1a')](_0x1cd9ab);}};}function respondWithFilteredResult(_0x3d2b4d,_0xd5ed75){return function(_0x2f15fe){if(_0x2f15fe){var _0x7cdef7=_0x2f15fe[_0xf052('0x1b')],_0x26754e=_0xd5ed75['offset'],_0x72d497=_0xd5ed75['offset']+_0xd5ed75[_0xf052('0x1c')],_0x4311ee;if(_0x72d497>=_0x7cdef7){_0x72d497=_0x7cdef7;_0x4311ee=0xc8;}else{_0x4311ee=0xce;}_0x3d2b4d['status'](_0x4311ee);return _0x3d2b4d[_0xf052('0x1d')](_0xf052('0x1e'),_0x26754e+'-'+_0x72d497+'/'+_0x7cdef7)[_0xf052('0x1a')](_0x2f15fe);}return null;};}function patchUpdates(_0x4bf2a){return function(_0xe3bfc9){try{jsonpatch[_0xf052('0x1f')](_0xe3bfc9,_0x4bf2a,!![]);}catch(_0x4b799c){return BPromise[_0xf052('0x20')](_0x4b799c);}return _0xe3bfc9[_0xf052('0x21')]();};}function saveUpdates(_0x98d12c,_0x1475db){return function(_0x140c73){if(_0x140c73){return _0x140c73[_0xf052('0x22')](_0x98d12c)[_0xf052('0x23')](function(_0x35a137){return _0x35a137;});}return null;};}function removeEntity(_0x2e4b24,_0x4b00e9){return function(_0x16bab4){if(_0x16bab4){return _0x16bab4[_0xf052('0x24')]()[_0xf052('0x23')](function(){_0x2e4b24[_0xf052('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223abf,_0x4f5cdd){return function(_0x4a9f1d){if(!_0x4a9f1d){_0x223abf[_0xf052('0x17')](0x194);}return _0x4a9f1d;};}function handleError(_0x420bc4,_0xa74d41){_0xa74d41=_0xa74d41||0x1f4;return function(_0x1d1baf){logger[_0xf052('0x25')](_0x1d1baf['stack']);if(_0x1d1baf[_0xf052('0x26')]){delete _0x1d1baf[_0xf052('0x26')];}_0x420bc4[_0xf052('0x19')](_0xa74d41)[_0xf052('0x27')](_0x1d1baf);};}var utilLicense=require('../../config/license/util');exports[_0xf052('0x28')]=function(_0x424a5c,_0x34a6df){var _0x4d2fac={'raw':!![],'where':{'id':0x1}},_0x189c1e={};_0x189c1e[_0xf052('0x29')]=_[_0xf052('0x2a')](db['License'][_0xf052('0x2b')]);_0x189c1e[_0xf052('0x2c')]=_[_0xf052('0x2a')](_0x424a5c['query']);_0x189c1e[_0xf052('0x2d')]=_['intersection'](_0x189c1e[_0xf052('0x29')],_0x189c1e['query']);_0x4d2fac[_0xf052('0x2e')]=_[_0xf052('0x2f')](_0x189c1e[_0xf052('0x29')],qs[_0xf052('0x30')](_0x424a5c[_0xf052('0x2c')][_0xf052('0x30')]));_0x4d2fac[_0xf052('0x2e')]=_0x4d2fac['attributes'][_0xf052('0x31')]?_0x4d2fac[_0xf052('0x2e')]:_0x189c1e[_0xf052('0x29')];_0x4d2fac=_['merge']({},_0x4d2fac,_0x424a5c[_0xf052('0x32')]);return utilLicense['getLicense'](_0x4d2fac)[_0xf052('0x23')](respondWithResult(_0x34a6df,null))[_0xf052('0x33')](handleError(_0x34a6df,null));};exports['update']=function(_0x351c3d,_0x22a37f){if(_0x351c3d[_0xf052('0x34')]['id']){delete _0x351c3d[_0xf052('0x34')]['id'];}return db[_0xf052('0x35')][_0xf052('0x36')]({'where':{'id':_0x351c3d[_0xf052('0x37')]['id']}})['then'](handleEntityNotFound(_0x22a37f,null))[_0xf052('0x23')](function(_0x9266ef){var _0x356f54=_0x9266ef['get']({'plain':!![]});return utilLicense[_0xf052('0x38')](_0x356f54,_0x351c3d['body'][_0xf052('0x39')]);})[_0xf052('0x23')](function(_0x4b48b2){if(!_0x4b48b2['demo']){return saveUpdates(_0x351c3d['body'],null);}return _0x4b48b2;})[_0xf052('0x23')](respondWithResult(_0x22a37f,null))['catch'](handleError(_0x22a37f,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d021d95..1092984 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 _0x3d9f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x3d9f[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xf3d9('0x0'));var util=require(_0xf3d9('0x1'));var logger=require(_0xf3d9('0x2'))(_0xf3d9('0x3'));var moment=require(_0xf3d9('0x4'));var BPromise=require(_0xf3d9('0x5'));var rp=require(_0xf3d9('0x6'));var fs=require('fs');var path=require(_0xf3d9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xf3d9('0x8')]=function(_0x5c3fe6,_0x6d83d7){return _0x5c3fe6[_0xf3d9('0x9')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc76=['license','util','../../config/logger','api','moment','bluebird','path','rimraf','./license.attributes','define'];(function(_0x5f4537,_0x278cc3){var _0x2e82f3=function(_0x493142){while(--_0x493142){_0x5f4537['push'](_0x5f4537['shift']());}};_0x2e82f3(++_0x278cc3);}(_0xfc76,0xb5));var _0x6fc7=function(_0x6dbdde,_0x47e1e3){_0x6dbdde=_0x6dbdde-0x0;var _0x55787a=_0xfc76[_0x6dbdde];return _0x55787a;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc7('0x5'));var rimraf=require(_0x6fc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fc7('0x7'));module['exports']=function(_0xe8177b,_0x82a35a){return _0xe8177b[_0x6fc7('0x8')]('License',attributes,{'tableName':_0x6fc7('0x9'),'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 04dff5f..1e2e8b7 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 _0xe027=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x52402c,_0x553d4d){var _0x57f23d=function(_0x18fe25){while(--_0x18fe25){_0x52402c['push'](_0x52402c['shift']());}};_0x57f23d(++_0x553d4d);}(_0xe027,0x106));var _0x7e02=function(_0x3395fd,_0x1a722e){_0x3395fd=_0x3395fd-0x0;var _0x1cc64f=_0xe027[_0x3395fd];return _0x1cc64f;};'use strict';var _=require(_0x7e02('0x0'));var util=require(_0x7e02('0x1'));var moment=require(_0x7e02('0x2'));var BPromise=require(_0x7e02('0x3'));var rs=require(_0x7e02('0x4'));var fs=require('fs');var Redis=require(_0x7e02('0x5'));var db=require(_0x7e02('0x6'))['db'];var utils=require(_0x7e02('0x7'));var logger=require(_0x7e02('0x8'))(_0x7e02('0x9'));var config=require(_0x7e02('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ebeca,_0x10ffc5,_0x53b91c){return new BPromise(function(_0x557349,_0x1533d0){return client['request'](_0x4ebeca,_0x53b91c)[_0x7e02('0xc')](function(_0x135555){logger[_0x7e02('0xd')](_0x7e02('0xe'),_0x10ffc5,_0x7e02('0xf'));logger[_0x7e02('0x10')]('License,\x20%s,\x20%s,\x20%s',_0x10ffc5,_0x7e02('0xf'),JSON['stringify'](_0x135555));if(_0x135555[_0x7e02('0x11')]){if(_0x135555[_0x7e02('0x11')][_0x7e02('0x12')]===0x1f4){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x1533d0(_0x135555['error'][_0x7e02('0x13')]);}logger['error'](_0x7e02('0xe'),_0x10ffc5,_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);return _0x557349(_0x135555[_0x7e02('0x11')][_0x7e02('0x13')]);}else{logger[_0x7e02('0xd')]('License,\x20%s,\x20%s',_0x10ffc5,'request\x20sent');_0x557349(_0x135555['result'][_0x7e02('0x13')]);}})['catch'](function(_0xc9e71c){logger[_0x7e02('0x11')](_0x7e02('0xe'),_0x10ffc5,_0xc9e71c);_0x1533d0(_0xc9e71c);});});} \ No newline at end of file +var _0x710e=['result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40f873,_0x361d57){var _0x3efb4a=function(_0x24695f){while(--_0x24695f){_0x40f873['push'](_0x40f873['shift']());}};_0x3efb4a(++_0x361d57);}(_0x710e,0xb6));var _0xe710=function(_0x345d4d,_0x203ce0){_0x345d4d=_0x345d4d-0x0;var _0x1fadf0=_0x710e[_0x345d4d];return _0x1fadf0;};'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/mailAccount/index.js b/server/api/mailAccount/index.js index 62e38e9..cc000ad 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 _0x6f68=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/:id','isAuthenticated','/:id/dispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','create','addImap','addInteraction','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f68,0xa0));var _0x86f6=function(_0x5b87b4,_0x130678){_0x5b87b4=_0x5b87b4-0x0;var _0x331b8c=_0x6f68[_0x5b87b4];return _0x331b8c;};'use strict';var multer=require(_0x86f6('0x0'));var util=require('util');var path=require(_0x86f6('0x1'));var timeout=require(_0x86f6('0x2'));var express=require(_0x86f6('0x3'));var router=express[_0x86f6('0x4')]();var auth=require(_0x86f6('0x5'));var interaction=require(_0x86f6('0x6'));var config=require(_0x86f6('0x7'));var controller=require(_0x86f6('0x8'));router[_0x86f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x86f6('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x86f6('0x9')](_0x86f6('0xa'),auth[_0x86f6('0xb')](),controller['show']);router[_0x86f6('0x9')](_0x86f6('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x86f6('0x9')](_0x86f6('0xd'),auth[_0x86f6('0xb')](),controller['getAnswers']);router[_0x86f6('0x9')](_0x86f6('0xe'),auth['isAuthenticated'](),controller['getImap']);router['get'](_0x86f6('0xf'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x10')]);router['get'](_0x86f6('0x11'),auth['isAuthenticated'](),controller[_0x86f6('0x12')]);router[_0x86f6('0x9')](_0x86f6('0x13'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x14')]);router[_0x86f6('0x9')](_0x86f6('0x15'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x16')]);router['get'](_0x86f6('0x17'),auth[_0x86f6('0xb')](),controller['verifySmtp']);router['get'](_0x86f6('0x18'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x19')]);router[_0x86f6('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x86f6('0x1b')]);router['post'](_0x86f6('0xd'),auth[_0x86f6('0xb')](),controller['addAnswer']);router[_0x86f6('0x1a')]('/',auth[_0x86f6('0xb')](),controller[_0x86f6('0x1c')]);router[_0x86f6('0x1a')]('/:id/in_servers',auth[_0x86f6('0xb')](),controller[_0x86f6('0x1d')]);router[_0x86f6('0x1a')](_0x86f6('0xf'),auth[_0x86f6('0xb')](),controller['addSmtp']);router[_0x86f6('0x1a')](_0x86f6('0x11'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x1e')]);router['post'](_0x86f6('0x13'),auth[_0x86f6('0xb')](),controller['addApplications']);router[_0x86f6('0x1a')]('/:id/send',auth['isAuthenticated'](),controller[_0x86f6('0x1f')]);router[_0x86f6('0x1a')]('/:id/users',auth[_0x86f6('0xb')](),controller[_0x86f6('0x20')]);router[_0x86f6('0x21')](_0x86f6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x86f6('0x22')](_0x86f6('0xc'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x23')]);router[_0x86f6('0x22')](_0x86f6('0xd'),auth['isAuthenticated'](),controller[_0x86f6('0x24')]);router[_0x86f6('0x22')](_0x86f6('0xe'),auth[_0x86f6('0xb')](),controller[_0x86f6('0x25')]);router[_0x86f6('0x22')](_0x86f6('0xf'),auth[_0x86f6('0xb')](),controller['removeSmtp']);router[_0x86f6('0x22')](_0x86f6('0xa'),auth['isAuthenticated'](),controller[_0x86f6('0x26')]);router['delete'](_0x86f6('0x18'),auth[_0x86f6('0xb')](),controller['removeAgents']);module[_0x86f6('0x27')]=router; \ No newline at end of file +var _0x5fda=['/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','/:id/out_servers','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x1fb312,_0x5984bd){var _0x3c1217=function(_0x5baa05){while(--_0x5baa05){_0x1fb312['push'](_0x1fb312['shift']());}};_0x3c1217(++_0x5984bd);}(_0x5fda,0x130));var _0xa5fd=function(_0x5b88f1,_0x9555f0){_0x5b88f1=_0x5b88f1-0x0;var _0x41f6c2=_0x5fda[_0x5b88f1];return _0x41f6c2;};'use strict';var multer=require(_0xa5fd('0x0'));var util=require(_0xa5fd('0x1'));var path=require('path');var timeout=require(_0xa5fd('0x2'));var express=require(_0xa5fd('0x3'));var router=express[_0xa5fd('0x4')]();var auth=require(_0xa5fd('0x5'));var interaction=require(_0xa5fd('0x6'));var config=require(_0xa5fd('0x7'));var controller=require(_0xa5fd('0x8'));router['get']('/',auth[_0xa5fd('0x9')](),controller[_0xa5fd('0xa')]);router[_0xa5fd('0xb')](_0xa5fd('0xc'),auth[_0xa5fd('0x9')](),controller['describe']);router[_0xa5fd('0xb')](_0xa5fd('0xd'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0xe')]);router[_0xa5fd('0xb')](_0xa5fd('0xf'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x10')]);router[_0xa5fd('0xb')](_0xa5fd('0x11'),auth['isAuthenticated'](),controller[_0xa5fd('0x12')]);router[_0xa5fd('0xb')](_0xa5fd('0x13'),auth['isAuthenticated'](),controller['getImap']);router['get']('/:id/out_servers',auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x14')]);router[_0xa5fd('0xb')](_0xa5fd('0x15'),auth['isAuthenticated'](),controller[_0xa5fd('0x16')]);router['get'](_0xa5fd('0x17'),auth['isAuthenticated'](),controller[_0xa5fd('0x18')]);router[_0xa5fd('0xb')](_0xa5fd('0x19'),auth['isAuthenticated'](),controller[_0xa5fd('0x1a')]);router['get'](_0xa5fd('0x1b'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x1c')]);router[_0xa5fd('0xb')](_0xa5fd('0x1d'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x1e')]);router[_0xa5fd('0x1f')](_0xa5fd('0xf'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x20')]);router[_0xa5fd('0x1f')](_0xa5fd('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x21')]);router[_0xa5fd('0x1f')](_0xa5fd('0x13'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x22')]);router[_0xa5fd('0x1f')](_0xa5fd('0x23'),auth[_0xa5fd('0x9')](),controller['addSmtp']);router[_0xa5fd('0x1f')](_0xa5fd('0x15'),auth[_0xa5fd('0x9')](),controller['addInteraction']);router[_0xa5fd('0x1f')]('/:id/applications',auth[_0xa5fd('0x9')](),controller['addApplications']);router[_0xa5fd('0x1f')]('/:id/send',auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x24')]);router['post'](_0xa5fd('0x1d'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x25')]);router[_0xa5fd('0x26')](_0xa5fd('0xd'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x27')]);router[_0xa5fd('0x28')]('/:id/dispositions',auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x29')]);router[_0xa5fd('0x28')](_0xa5fd('0x11'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x2a')]);router[_0xa5fd('0x28')]('/:id/in_servers',auth[_0xa5fd('0x9')](),controller['removeImap']);router[_0xa5fd('0x28')](_0xa5fd('0x23'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x2b')]);router[_0xa5fd('0x28')](_0xa5fd('0xd'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x2c')]);router[_0xa5fd('0x28')](_0xa5fd('0x1d'),auth[_0xa5fd('0x9')](),controller[_0xa5fd('0x2d')]);module[_0xa5fd('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 8a3291a..3cdd31e 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 _0xfbb6=['UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xfbb6,0xb1));var _0x6fbb=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xfbb6[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x6fbb('0x0'));module[_0x6fbb('0x1')]={'description':{'type':Sequelize[_0x6fbb('0x2')]},'name':{'type':Sequelize[_0x6fbb('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6fbb('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x6fbb('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x6fbb('0x4')]},'markAsUnread':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6fbb('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x6fbb('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6fbb('0x6');}},'notificationSound':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6fbb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6fbb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6fbb('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6fbb('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6fbb('0x3')],'defaultValue':![],'comment':_0x6fbb('0x9'),'set':function(_0x16e73b){if(!_0x16e73b)this[_0x6fbb('0xa')](_0x6fbb('0xb'),null);this[_0x6fbb('0xa')](_0x6fbb('0xc'),_0x16e73b);}}}; \ No newline at end of file +var _0x279c=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x2980c4,_0x3940ae){var _0xc5bb32=function(_0x42a599){while(--_0x42a599){_0x2980c4['push'](_0x2980c4['shift']());}};_0xc5bb32(++_0x3940ae);}(_0x279c,0x184));var _0xc279=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x279c[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0xc279('0x0'));module[_0xc279('0x1')]={'description':{'type':Sequelize[_0xc279('0x2')]},'name':{'type':Sequelize[_0xc279('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xc279('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc279('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xc279('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc279('0x5')},'fontSize':{'type':Sequelize[_0xc279('0x6')](0x2)[_0xc279('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc279('0x4')],'defaultValue':function(){return _0xc279('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc279('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc279('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc279('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc279('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc279('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xc279('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc279('0x3')],'defaultValue':![],'comment':_0xc279('0xa'),'set':function(_0x4ff0e4){if(!_0x4ff0e4)this[_0xc279('0xb')]('mandatoryDispositionPauseId',null);this[_0xc279('0xb')](_0xc279('0xc'),_0x4ff0e4);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index a84cd29..4ca1e1a 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 _0x8a5c=['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','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','destroy','get','MailAccounts','UserProfileResource','name','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','body','find','params','describe','addDisposition','Disposition','create','getDispositions','findOne','rawAttributes','hasOwnProperty','order','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','removeAnswers','email','ListId','isNil','active','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','send','CmList','List','Contacts','updatedAt','from','format','%s\x20<%s>','attachments','join','server/files/attachments','basename','secure','auth','SendMail','List\x20not\x20found','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','verifySmtp','VerifySmtp','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a5c,0x158));var _0xc8a5=function(_0x34cd06,_0x1c063b){_0x34cd06=_0x34cd06-0x0;var _0x32232b=_0x8a5c[_0x34cd06];return _0x32232b;};'use strict';var pdf=require(_0xc8a5('0x0'));var emlformat=require(_0xc8a5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc8a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8a5('0x3'));var moment=require(_0xc8a5('0x4'));var BPromise=require(_0xc8a5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc8a5('0x6'));var sox=require('sox');var csv=require(_0xc8a5('0x7'));var ejs=require(_0xc8a5('0x8'));var fs=require('fs');var _=require(_0xc8a5('0x9'));var squel=require('squel');var crypto=require(_0xc8a5('0xa'));var jsforce=require(_0xc8a5('0xb'));var deskjs=require(_0xc8a5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc8a5('0xd'));var Papa=require(_0xc8a5('0xe'));var Redis=require('ioredis');var authService=require(_0xc8a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc8a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8a5('0x11'))('api');var utils=require(_0xc8a5('0x12'));var config=require(_0xc8a5('0x13'));var db=require('../../mysqldb')['db'];config[_0xc8a5('0x14')]=_[_0xc8a5('0x15')](config[_0xc8a5('0x14')],{'host':_0xc8a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc8a5('0x14')]));require('./mailAccount.socket')[_0xc8a5('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc8a5('0x18')][_0xc8a5('0x19')]({'port':0x232b});function checkPasswordPattern(_0x27083b,_0x4bce95,_0x1f6465){if(_0x1f6465){var _0x32c0e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32c0e0[_0xc8a5('0x1a')](_0x4bce95)){return _0x27083b;}else{throw new db[(_0xc8a5('0x1b'))][(_0xc8a5('0x1c'))](_0xc8a5('0x1d'));}}else{return _0x27083b;}}function respondWithRpcPromise(_0x12b053,_0x1d7183,_0x463327,_0x287ac3){return new BPromise(function(_0x16af60,_0x29b073){var _0x58157c=_0x287ac3||client;return _0x58157c[_0xc8a5('0x1e')](_0x12b053,_0x463327)[_0xc8a5('0x1f')](function(_0x3b40e7){logger['info'](_0xc8a5('0x20'),_0x1d7183,_0xc8a5('0x21'));logger[_0xc8a5('0x22')](_0xc8a5('0x23'),_0x1d7183,_0xc8a5('0x21'),JSON['stringify'](_0x3b40e7));if(_0x3b40e7[_0xc8a5('0x24')]){if(_0x3b40e7[_0xc8a5('0x24')][_0xc8a5('0x25')]===0x1f4){logger[_0xc8a5('0x24')]('MailAccount,\x20%s,\x20%s',_0x1d7183,_0x3b40e7[_0xc8a5('0x24')][_0xc8a5('0x26')]);return _0x29b073(_0x3b40e7[_0xc8a5('0x24')][_0xc8a5('0x26')]);}logger['error'](_0xc8a5('0x20'),_0x1d7183,_0x3b40e7[_0xc8a5('0x24')]['message']);return _0x16af60(_0x3b40e7[_0xc8a5('0x24')][_0xc8a5('0x26')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x1d7183,_0xc8a5('0x21'));_0x16af60(_0x3b40e7[_0xc8a5('0x27')][_0xc8a5('0x26')]);}})[_0xc8a5('0x28')](function(_0x3504f1){logger[_0xc8a5('0x24')](_0xc8a5('0x20'),_0x1d7183,_0x3504f1);_0x29b073(_0x3504f1);});});}function respondWithStatusCode(_0x114a00,_0x3e3238){_0x3e3238=_0x3e3238||0xcc;return function(_0x15bd35){if(_0x15bd35){return _0x114a00[_0xc8a5('0x29')](_0x3e3238);}return _0x114a00[_0xc8a5('0x2a')](_0x3e3238)[_0xc8a5('0x2b')]();};}function respondWithResult(_0x27f2a4,_0x5c45ba){_0x5c45ba=_0x5c45ba||0xc8;return function(_0xf0b3d6){if(_0xf0b3d6){return _0x27f2a4[_0xc8a5('0x2a')](_0x5c45ba)['json'](_0xf0b3d6);}};}function respondWithFilteredResult(_0x269163,_0x4f12f6){return function(_0x462cfb){if(_0x462cfb){var _0x5451c1=_0x462cfb[_0xc8a5('0x2c')],_0x335cae=_0x4f12f6[_0xc8a5('0x2d')],_0x49da82=_0x4f12f6[_0xc8a5('0x2d')]+_0x4f12f6[_0xc8a5('0x2e')],_0x2b6681;if(_0x49da82>=_0x5451c1){_0x49da82=_0x5451c1;_0x2b6681=0xc8;}else{_0x2b6681=0xce;}_0x269163[_0xc8a5('0x2a')](_0x2b6681);return _0x269163[_0xc8a5('0x2f')]('Content-Range',_0x335cae+'-'+_0x49da82+'/'+_0x5451c1)[_0xc8a5('0x30')](_0x462cfb);}return null;};}function patchUpdates(_0xef421e){return function(_0x5473cd){try{jsonpatch['apply'](_0x5473cd,_0xef421e,!![]);}catch(_0x12045a){return BPromise[_0xc8a5('0x31')](_0x12045a);}return _0x5473cd[_0xc8a5('0x32')]();};}function saveUpdates(_0x44cd3c,_0x23781f){return function(_0x3c35cf){if(_0x3c35cf){return _0x3c35cf[_0xc8a5('0x33')](_0x44cd3c)['then'](function(_0x3230e0){return _0x3230e0;});}return null;};}function removeEntity(_0xae5880,_0x998ac1){return function(_0x412f44){if(_0x412f44){return _0x412f44[_0xc8a5('0x34')]()[_0xc8a5('0x1f')](function(){var _0x27b276=_0x412f44[_0xc8a5('0x35')]({'plain':!![]});var _0x34b1b5=_0xc8a5('0x36');return db[_0xc8a5('0x37')][_0xc8a5('0x34')]({'where':{'type':_0x34b1b5,'resourceId':_0x27b276['id']}})[_0xc8a5('0x1f')](function(){return _0x412f44;});})[_0xc8a5('0x1f')](function(){_0xae5880[_0xc8a5('0x2a')](0xcc)[_0xc8a5('0x2b')]();});}};}function handleEntityNotFound(_0x143689,_0x18a614){return function(_0x543129){if(!_0x543129){_0x143689[_0xc8a5('0x29')](0x194);}return _0x543129;};}function handleError(_0x39129c,_0x1be7e4){_0x1be7e4=_0x1be7e4||0x1f4;return function(_0x50a385){logger[_0xc8a5('0x24')](_0x50a385['stack']);if(_0x50a385[_0xc8a5('0x38')]){delete _0x50a385[_0xc8a5('0x38')];}_0x39129c['status'](_0x1be7e4)['send'](_0x50a385);};}exports[_0xc8a5('0x39')]=function(_0x1e5e29,_0x3c837e){var _0x22c8cd={'include':[{'model':db[_0xc8a5('0x3a')],'as':_0xc8a5('0x3b')},{'model':db[_0xc8a5('0x3c')],'as':_0xc8a5('0x3d')},{'model':db[_0xc8a5('0x3e')],'as':_0xc8a5('0x3f')}]},_0x528c16={},_0x3e1817={'count':0x0,'rows':[]};var _0x2429fc=_['map'](db[_0xc8a5('0x40')]['rawAttributes'],function(_0x5dfbc8){return{'name':_0x5dfbc8['fieldName'],'type':_0x5dfbc8[_0xc8a5('0x41')][_0xc8a5('0x42')]};});_0x528c16[_0xc8a5('0x43')]=_[_0xc8a5('0x44')](_0x2429fc,_0xc8a5('0x38'));_0x528c16[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x1e5e29[_0xc8a5('0x45')]);_0x528c16[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x528c16[_0xc8a5('0x43')],_0x528c16[_0xc8a5('0x45')]);_0x22c8cd[_0xc8a5('0x49')]=_[_0xc8a5('0x48')](_0x528c16[_0xc8a5('0x43')],qs[_0xc8a5('0x4a')](_0x1e5e29[_0xc8a5('0x45')]['fields']));_0x22c8cd[_0xc8a5('0x49')]=_0x22c8cd['attributes'][_0xc8a5('0x4b')]?_0x22c8cd['attributes']:_0x528c16[_0xc8a5('0x43')];if(!_0x1e5e29[_0xc8a5('0x45')]['hasOwnProperty'](_0xc8a5('0x4c'))){_0x22c8cd[_0xc8a5('0x2e')]=qs[_0xc8a5('0x2e')](_0x1e5e29[_0xc8a5('0x45')][_0xc8a5('0x2e')]);_0x22c8cd['offset']=qs[_0xc8a5('0x2d')](_0x1e5e29['query'][_0xc8a5('0x2d')]);}_0x22c8cd['order']=qs[_0xc8a5('0x4d')](_0x1e5e29[_0xc8a5('0x45')][_0xc8a5('0x4d')]);_0x22c8cd[_0xc8a5('0x4e')]=qs[_0xc8a5('0x47')](_[_0xc8a5('0x4f')](_0x1e5e29['query'],_0x528c16['filters']),_0x2429fc);if(_0x1e5e29[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x22c8cd[_0xc8a5('0x4e')]=_[_0xc8a5('0x51')](_0x22c8cd['where'],{'$or':_[_0xc8a5('0x44')](_0x2429fc,function(_0x4d05a3){if(_0x4d05a3[_0xc8a5('0x41')]!==_0xc8a5('0x52')){var _0x2de943={};_0x2de943[_0x4d05a3[_0xc8a5('0x38')]]={'$like':'%'+_0x1e5e29[_0xc8a5('0x45')]['filter']+'%'};return _0x2de943;}})});}_0x22c8cd=_[_0xc8a5('0x51')]({},_0x22c8cd,_0x1e5e29[_0xc8a5('0x53')]);var _0x2a904b={'where':_0x22c8cd[_0xc8a5('0x4e')]};return db[_0xc8a5('0x40')][_0xc8a5('0x2c')](_0x2a904b)[_0xc8a5('0x1f')](function(_0x3107df){_0x3e1817['count']=_0x3107df;if(_0x1e5e29[_0xc8a5('0x45')][_0xc8a5('0x54')]){_0x22c8cd['include']=[{'all':!![]}];}return db[_0xc8a5('0x40')][_0xc8a5('0x55')](_0x22c8cd);})[_0xc8a5('0x1f')](function(_0x46e91c){_0x3e1817[_0xc8a5('0x56')]=_0x46e91c;return _0x3e1817;})['then'](respondWithFilteredResult(_0x3c837e,_0x22c8cd))[_0xc8a5('0x28')](handleError(_0x3c837e,null));};exports[_0xc8a5('0x57')]=function(_0x1c94a5,_0x493fcd){var _0x23e81a={'raw':![],'where':{'id':_0x1c94a5['params']['id']},'include':[{'model':db[_0xc8a5('0x3a')],'as':_0xc8a5('0x3b')},{'model':db[_0xc8a5('0x3c')],'as':'Smtp'},{'model':db[_0xc8a5('0x3e')],'as':'mandatoryDispositionPause'}]},_0x3561bf={};_0x3561bf[_0xc8a5('0x43')]=_[_0xc8a5('0x46')](db[_0xc8a5('0x40')]['rawAttributes']);_0x3561bf[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x1c94a5['query']);_0x3561bf[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x3561bf[_0xc8a5('0x43')],_0x3561bf[_0xc8a5('0x45')]);_0x23e81a[_0xc8a5('0x49')]=_[_0xc8a5('0x48')](_0x3561bf[_0xc8a5('0x43')],qs[_0xc8a5('0x4a')](_0x1c94a5['query'][_0xc8a5('0x4a')]));_0x23e81a[_0xc8a5('0x49')]=_0x23e81a[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x23e81a[_0xc8a5('0x49')]:_0x3561bf[_0xc8a5('0x43')];if(_0x1c94a5['query'][_0xc8a5('0x54')]){_0x23e81a[_0xc8a5('0x58')]=[{'all':!![]}];}_0x23e81a=_['merge']({},_0x23e81a,_0x1c94a5[_0xc8a5('0x53')]);return db['MailAccount']['find'](_0x23e81a)[_0xc8a5('0x1f')](handleEntityNotFound(_0x493fcd,null))[_0xc8a5('0x1f')](respondWithResult(_0x493fcd,null))['catch'](handleError(_0x493fcd,null));};exports[_0xc8a5('0x33')]=function(_0x1a74bf,_0x39ae41){if(_0x1a74bf[_0xc8a5('0x59')]['id']){delete _0x1a74bf[_0xc8a5('0x59')]['id'];}return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x1a74bf[_0xc8a5('0x5b')]['id']},'include':[{'model':db[_0xc8a5('0x3a')],'as':_0xc8a5('0x3b')},{'model':db[_0xc8a5('0x3c')],'as':_0xc8a5('0x3d')},{'model':db[_0xc8a5('0x3e')],'as':_0xc8a5('0x3f')}]})['then'](handleEntityNotFound(_0x39ae41,null))[_0xc8a5('0x1f')](saveUpdates(_0x1a74bf[_0xc8a5('0x59')],null))[_0xc8a5('0x1f')](function(_0x16fbdb){if(_0x16fbdb&&_0x1a74bf[_0xc8a5('0x59')][_0xc8a5('0x3b')]){return db['MailServerIn'][_0xc8a5('0x33')](_0x1a74bf[_0xc8a5('0x59')][_0xc8a5('0x3b')],{'where':{'MailAccountId':_0x16fbdb['id']}})[_0xc8a5('0x1f')](function(){return _0x16fbdb;});}return _0x16fbdb;})[_0xc8a5('0x1f')](function(_0x543378){if(_0x543378&&_0x1a74bf[_0xc8a5('0x59')][_0xc8a5('0x3d')]){return db[_0xc8a5('0x3c')][_0xc8a5('0x33')](_0x1a74bf[_0xc8a5('0x59')]['Smtp'],{'where':{'MailAccountId':_0x543378['id']}})[_0xc8a5('0x1f')](function(){return _0x543378;});}return _0x543378;})[_0xc8a5('0x1f')](respondWithResult(_0x39ae41,null))[_0xc8a5('0x28')](handleError(_0x39ae41,null));};exports[_0xc8a5('0x5c')]=function(_0x2b5262,_0x438776){return db[_0xc8a5('0x40')][_0xc8a5('0x5c')]()[_0xc8a5('0x1f')](respondWithResult(_0x438776,null))[_0xc8a5('0x28')](handleError(_0x438776,null));};exports[_0xc8a5('0x5d')]=function(_0xf99b85,_0x18fbe5,_0x438149){if(_0xf99b85[_0xc8a5('0x59')]['id']){delete _0xf99b85[_0xc8a5('0x59')]['id'];}return db['MailAccount'][_0xc8a5('0x5a')]({'where':{'id':_0xf99b85[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x18fbe5,null))['then'](function(_0x23d442){if(_0x23d442){_0xf99b85[_0xc8a5('0x59')]['MailAccountId']=_0x23d442['id'];return db[_0xc8a5('0x5e')][_0xc8a5('0x5f')](_0xf99b85[_0xc8a5('0x59')]);}})['then'](respondWithResult(_0x18fbe5,null))[_0xc8a5('0x28')](handleError(_0x18fbe5,null));};exports[_0xc8a5('0x60')]=function(_0x19e62a,_0x462703,_0x5615e5){var _0x5d549a={'raw':![],'where':{}};var _0x2f9d96={};var _0x3c197d={'count':0x0,'rows':[]};return db['MailAccount'][_0xc8a5('0x61')]({'where':{'id':_0x19e62a[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x462703,null))[_0xc8a5('0x1f')](function(_0x113d5d){if(_0x113d5d){_0x2f9d96[_0xc8a5('0x43')]=_['keys'](db[_0xc8a5('0x5e')][_0xc8a5('0x62')]);_0x2f9d96[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x19e62a[_0xc8a5('0x45')]);_0x2f9d96[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x2f9d96[_0xc8a5('0x43')],_0x2f9d96[_0xc8a5('0x45')]);_0x5d549a['attributes']=_[_0xc8a5('0x48')](_0x2f9d96[_0xc8a5('0x43')],qs[_0xc8a5('0x4a')](_0x19e62a[_0xc8a5('0x45')][_0xc8a5('0x4a')]));_0x5d549a[_0xc8a5('0x49')]=_0x5d549a[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x5d549a[_0xc8a5('0x49')]:_0x2f9d96[_0xc8a5('0x43')];if(!_0x19e62a['query'][_0xc8a5('0x63')]('nolimit')){_0x5d549a[_0xc8a5('0x2e')]=qs[_0xc8a5('0x2e')](_0x19e62a['query'][_0xc8a5('0x2e')]);_0x5d549a['offset']=qs[_0xc8a5('0x2d')](_0x19e62a['query']['offset']);}_0x5d549a[_0xc8a5('0x64')]=qs['sort'](_0x19e62a[_0xc8a5('0x45')]['sort']);_0x5d549a[_0xc8a5('0x4e')]=qs[_0xc8a5('0x47')](_['pick'](_0x19e62a[_0xc8a5('0x45')],_0x2f9d96[_0xc8a5('0x47')]));_0x5d549a[_0xc8a5('0x4e')]['MailAccountId']=_0x113d5d['id'];if(_0x19e62a[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x5d549a[_0xc8a5('0x4e')]=_[_0xc8a5('0x51')](_0x5d549a[_0xc8a5('0x4e')],{'$or':_[_0xc8a5('0x44')](_0x5d549a['attributes'],function(_0x22725e){var _0x18fde5={};_0x18fde5[_0x22725e]={'$like':'%'+_0x19e62a[_0xc8a5('0x45')]['filter']+'%'};return _0x18fde5;})});}_0x5d549a=_[_0xc8a5('0x51')]({},_0x5d549a,_0x19e62a['options']);return db[_0xc8a5('0x5e')][_0xc8a5('0x2c')]({'where':_0x5d549a[_0xc8a5('0x4e')]})['then'](function(_0x3bda4a){_0x3c197d[_0xc8a5('0x2c')]=_0x3bda4a;if(_0x19e62a[_0xc8a5('0x45')][_0xc8a5('0x54')]){_0x5d549a[_0xc8a5('0x58')]=[{'all':!![]}];}return db[_0xc8a5('0x5e')][_0xc8a5('0x55')](_0x5d549a);})['then'](function(_0xbbb1c){_0x3c197d[_0xc8a5('0x56')]=_0xbbb1c;return _0x3c197d;});}})[_0xc8a5('0x1f')](respondWithFilteredResult(_0x462703,_0x5d549a))['catch'](handleError(_0x462703,null));};exports[_0xc8a5('0x65')]=function(_0x3bf262,_0x781819,_0x14c27f){return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x3bf262[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x781819,null))[_0xc8a5('0x1f')](function(_0x507cff){if(_0x507cff){return _0x507cff['removeDispositions'](_0x3bf262[_0xc8a5('0x45')][_0xc8a5('0x66')]);}})[_0xc8a5('0x1f')](respondWithStatusCode(_0x781819,null))[_0xc8a5('0x28')](handleError(_0x781819,null));};exports[_0xc8a5('0x67')]=function(_0x35a00d,_0x587df8,_0x1cc64e){if(_0x35a00d[_0xc8a5('0x59')]['id']){delete _0x35a00d[_0xc8a5('0x59')]['id'];}return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x35a00d[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x587df8,null))['then'](function(_0x2f2f63){if(_0x2f2f63){_0x35a00d[_0xc8a5('0x59')][_0xc8a5('0x68')]=_0x2f2f63['id'];return db[_0xc8a5('0x69')]['create'](_0x35a00d[_0xc8a5('0x59')]);}})['then'](respondWithResult(_0x587df8,null))[_0xc8a5('0x28')](handleError(_0x587df8,null));};exports['getAnswers']=function(_0x57a20f,_0x1e2d1e,_0x2ab3c3){var _0x3a4562={'raw':![],'where':{}};var _0x48ca5e={};var _0x6927d8={'count':0x0,'rows':[]};return db[_0xc8a5('0x40')][_0xc8a5('0x61')]({'where':{'id':_0x57a20f[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x1e2d1e,null))['then'](function(_0x3e5eec){if(_0x3e5eec){_0x48ca5e[_0xc8a5('0x43')]=_[_0xc8a5('0x46')](db[_0xc8a5('0x69')]['rawAttributes']);_0x48ca5e[_0xc8a5('0x45')]=_['keys'](_0x57a20f[_0xc8a5('0x45')]);_0x48ca5e[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x48ca5e[_0xc8a5('0x43')],_0x48ca5e[_0xc8a5('0x45')]);_0x3a4562['attributes']=_[_0xc8a5('0x48')](_0x48ca5e[_0xc8a5('0x43')],qs[_0xc8a5('0x4a')](_0x57a20f['query'][_0xc8a5('0x4a')]));_0x3a4562[_0xc8a5('0x49')]=_0x3a4562[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x3a4562[_0xc8a5('0x49')]:_0x48ca5e[_0xc8a5('0x43')];if(!_0x57a20f['query']['hasOwnProperty'](_0xc8a5('0x4c'))){_0x3a4562[_0xc8a5('0x2e')]=qs['limit'](_0x57a20f['query'][_0xc8a5('0x2e')]);_0x3a4562[_0xc8a5('0x2d')]=qs[_0xc8a5('0x2d')](_0x57a20f['query'][_0xc8a5('0x2d')]);}_0x3a4562[_0xc8a5('0x64')]=qs[_0xc8a5('0x4d')](_0x57a20f[_0xc8a5('0x45')][_0xc8a5('0x4d')]);_0x3a4562['where']=qs['filters'](_['pick'](_0x57a20f[_0xc8a5('0x45')],_0x48ca5e['filters']));_0x3a4562[_0xc8a5('0x4e')][_0xc8a5('0x68')]=_0x3e5eec['id'];if(_0x57a20f[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x3a4562[_0xc8a5('0x4e')]=_[_0xc8a5('0x51')](_0x3a4562[_0xc8a5('0x4e')],{'$or':_[_0xc8a5('0x44')](_0x3a4562[_0xc8a5('0x49')],function(_0x138fbc){var _0x5edabf={};_0x5edabf[_0x138fbc]={'$like':'%'+_0x57a20f[_0xc8a5('0x45')][_0xc8a5('0x50')]+'%'};return _0x5edabf;})});}_0x3a4562=_[_0xc8a5('0x51')]({},_0x3a4562,_0x57a20f[_0xc8a5('0x53')]);return db[_0xc8a5('0x69')][_0xc8a5('0x2c')]({'where':_0x3a4562['where']})[_0xc8a5('0x1f')](function(_0x18f819){_0x6927d8[_0xc8a5('0x2c')]=_0x18f819;if(_0x57a20f[_0xc8a5('0x45')]['includeAll']){_0x3a4562[_0xc8a5('0x58')]=[{'all':!![]}];}return db[_0xc8a5('0x69')]['findAll'](_0x3a4562);})[_0xc8a5('0x1f')](function(_0x135b2c){_0x6927d8['rows']=_0x135b2c;return _0x6927d8;});}})[_0xc8a5('0x1f')](respondWithFilteredResult(_0x1e2d1e,_0x3a4562))[_0xc8a5('0x28')](handleError(_0x1e2d1e,null));};exports[_0xc8a5('0x6a')]=function(_0x21e7bb,_0xe907dc,_0xe48ebb){return db[_0xc8a5('0x40')]['find']({'where':{'id':_0x21e7bb[_0xc8a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe907dc,null))[_0xc8a5('0x1f')](function(_0x1e1c01){if(_0x1e1c01){return _0x1e1c01['removeAnswers'](_0x21e7bb['query'][_0xc8a5('0x66')]);}})[_0xc8a5('0x1f')](respondWithStatusCode(_0xe907dc,null))[_0xc8a5('0x28')](handleError(_0xe907dc,null));};exports['create']=function(_0x3adf49,_0x435b64){var _0x55a872={'name':_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x38')],'key':_0x3adf49[_0xc8a5('0x59')]['key'],'email':_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x6b')],'ListId':_0x3adf49['body'][_0xc8a5('0x6c')],'active':!_[_0xc8a5('0x6d')](_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x6e')])?_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x6e')]:!![],'description':_0x3adf49[_0xc8a5('0x59')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xc8a5('0x6d')](_0x3adf49['body'][_0xc8a5('0x6f')])){if(_0x3adf49['body']['cauthentication']){_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x70')]=_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x70')]=_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x71')];_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x72')]=_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x73')]=_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x74')];}else{_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x75')]=_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x75')]=![];}_0x55a872['Imap']['host']=_0x3adf49['body'][_0xc8a5('0x3b')][_0xc8a5('0x76')];_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x77')]=_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x3b')][_0xc8a5('0x77')];_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x76')]=_0x3adf49[_0xc8a5('0x59')]['Smtp'][_0xc8a5('0x76')];_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x77')]=_0x3adf49[_0xc8a5('0x59')]['Smtp'][_0xc8a5('0x77')];}else{_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x78')]=_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x78')]=_0x3adf49[_0xc8a5('0x59')]['cservice'];_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x70')]=_0x55a872[_0xc8a5('0x3d')][_0xc8a5('0x70')]=_0x3adf49[_0xc8a5('0x59')]['cuser'];_0x55a872[_0xc8a5('0x3b')][_0xc8a5('0x72')]=_0x55a872['Smtp'][_0xc8a5('0x73')]=_0x3adf49[_0xc8a5('0x59')][_0xc8a5('0x74')];}return db[_0xc8a5('0x40')][_0xc8a5('0x5f')](_0x55a872,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xc8a5('0x3a')],'as':_0xc8a5('0x3b')}]})[_0xc8a5('0x1f')](function(_0x460324){var _0x20e6d4=_0x3adf49['user'][_0xc8a5('0x35')]({'plain':!![]});if(!_0x20e6d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e6d4[_0xc8a5('0x79')]===_0xc8a5('0x70')){var _0x1a0999=_0x460324['get']({'plain':!![]});return db[_0xc8a5('0x7a')]['find']({'where':{'name':_0xc8a5('0x36'),'userProfileId':_0x20e6d4[_0xc8a5('0x7b')]},'raw':!![]})['then'](function(_0x5d6989){if(_0x5d6989&&_0x5d6989['autoAssociation']===0x0){return db['UserProfileResource'][_0xc8a5('0x5f')]({'name':_0x1a0999['name'],'resourceId':_0x1a0999['id'],'type':_0x5d6989[_0xc8a5('0x38')],'sectionId':_0x5d6989['id']},{})[_0xc8a5('0x1f')](function(){return _0x460324;});}else{return _0x460324;}})['catch'](function(_0x49fe2f){logger['error'](_0xc8a5('0x7c'),_0x49fe2f);throw _0x49fe2f;});}return _0x460324;})[_0xc8a5('0x1f')](respondWithResult(_0x435b64,0xc9))['catch'](handleError(_0x435b64,null));};exports[_0xc8a5('0x7d')]=function(_0xabdf86,_0x5dfea5,_0x4a5b4d){return db[_0xc8a5('0x40')][_0xc8a5('0x61')]({'where':{'id':_0xabdf86[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x5dfea5,null))[_0xc8a5('0x1f')](function(_0x365e74){if(_0x365e74){return _0x365e74[_0xc8a5('0x7d')]();}return null;})[_0xc8a5('0x1f')](respondWithResult(_0x5dfea5,null))[_0xc8a5('0x28')](handleError(_0x5dfea5,null));};exports['addImap']=function(_0x3f0fc6,_0x851db1,_0x4539bc){if(_0x3f0fc6[_0xc8a5('0x59')]['id']){delete _0x3f0fc6[_0xc8a5('0x59')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3f0fc6['params']['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x851db1,null))['then'](function(_0x3d4466){if(_0x3d4466){_0x3f0fc6['body'][_0xc8a5('0x68')]=_0x3d4466['id'];return db['MailServerIn'][_0xc8a5('0x5f')](_0x3f0fc6[_0xc8a5('0x59')]);}})['then'](respondWithResult(_0x851db1,null))[_0xc8a5('0x28')](handleError(_0x851db1,null));};exports[_0xc8a5('0x7e')]=function(_0x3a4b11,_0x56b273,_0x3d4e7a){return db[_0xc8a5('0x40')][_0xc8a5('0x61')]({'where':{'id':_0x3a4b11['params']['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x56b273,null))[_0xc8a5('0x1f')](function(_0x45e342){if(_0x45e342){return _0x45e342[_0xc8a5('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x56b273,null))[_0xc8a5('0x28')](handleError(_0x56b273,null));};exports[_0xc8a5('0x80')]=function(_0x535c0c,_0x41c103,_0x6c3380){return db[_0xc8a5('0x40')]['findOne']({'where':{'id':_0x535c0c[_0xc8a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x41c103,null))[_0xc8a5('0x1f')](function(_0x489334){if(_0x489334){return _0x489334['getSmtp']();}return null;})['then'](respondWithResult(_0x41c103,null))[_0xc8a5('0x28')](handleError(_0x41c103,null));};exports[_0xc8a5('0x81')]=function(_0xc1fe06,_0x43a683,_0x34293d){if(_0xc1fe06['body']['id']){delete _0xc1fe06[_0xc8a5('0x59')]['id'];}return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0xc1fe06['params']['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x43a683,null))['then'](function(_0x21f6b1){if(_0x21f6b1){_0xc1fe06['body']['MailAccountId']=_0x21f6b1['id'];return db[_0xc8a5('0x3c')][_0xc8a5('0x5f')](_0xc1fe06[_0xc8a5('0x59')]);}})['then'](respondWithResult(_0x43a683,null))[_0xc8a5('0x28')](handleError(_0x43a683,null));};exports[_0xc8a5('0x82')]=function(_0x454409,_0x4bf7e5,_0x2c7834){return db[_0xc8a5('0x40')][_0xc8a5('0x61')]({'where':{'id':_0x454409[_0xc8a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4bf7e5,null))[_0xc8a5('0x1f')](function(_0x5508a1){if(_0x5508a1){return _0x5508a1['setSmtp'](null);}return null;})[_0xc8a5('0x1f')](respondWithStatusCode(_0x4bf7e5,null))[_0xc8a5('0x28')](handleError(_0x4bf7e5,null));};exports['addInteraction']=function(_0x1098a5,_0xd61738,_0x27289e){return db['MailInteraction']['find']({'where':{'id':_0x1098a5[_0xc8a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd61738,null))[_0xc8a5('0x1f')](function(_0x5483bd){if(_0x5483bd){return _0x5483bd[_0xc8a5('0x83')](_0x1098a5[_0xc8a5('0x59')][_0xc8a5('0x66')],_[_0xc8a5('0x84')](_0x1098a5[_0xc8a5('0x59')],[_0xc8a5('0x66'),'id'])||{});}})['then'](respondWithResult(_0xd61738,null))[_0xc8a5('0x28')](handleError(_0xd61738,null));};exports[_0xc8a5('0x85')]=function(_0x3b0d6f,_0x3fcdf9,_0x1eb464){var _0x4d2aa0={'raw':![],'where':{}};var _0x3104a4={};var _0x13c2b7={'count':0x0,'rows':[]};return db['MailAccount'][_0xc8a5('0x61')]({'where':{'id':_0x3b0d6f['params']['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x3fcdf9,null))[_0xc8a5('0x1f')](function(_0x16848e){if(_0x16848e){_0x3104a4[_0xc8a5('0x43')]=_['keys'](db[_0xc8a5('0x86')][_0xc8a5('0x62')]);_0x3104a4[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x3b0d6f[_0xc8a5('0x45')]);_0x3104a4[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x3104a4[_0xc8a5('0x43')],_0x3104a4['query']);_0x4d2aa0[_0xc8a5('0x49')]=_[_0xc8a5('0x48')](_0x3104a4['model'],qs[_0xc8a5('0x4a')](_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x4a')]));_0x4d2aa0['attributes']=_0x4d2aa0[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x4d2aa0[_0xc8a5('0x49')]:_0x3104a4[_0xc8a5('0x43')];if(!_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x63')](_0xc8a5('0x4c'))){_0x4d2aa0['limit']=qs[_0xc8a5('0x2e')](_0x3b0d6f['query']['limit']);_0x4d2aa0[_0xc8a5('0x2d')]=qs['offset'](_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x2d')]);}_0x4d2aa0[_0xc8a5('0x64')]=qs[_0xc8a5('0x4d')](_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x4d')]);_0x4d2aa0[_0xc8a5('0x4e')]=qs['filters'](_['pick'](_0x3b0d6f[_0xc8a5('0x45')],_0x3104a4[_0xc8a5('0x47')]));_0x4d2aa0[_0xc8a5('0x4e')]['MailAccountId']=_0x16848e['id'];if(_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x4d2aa0['where']=_[_0xc8a5('0x51')](_0x4d2aa0[_0xc8a5('0x4e')],{'$or':_[_0xc8a5('0x44')](_0x4d2aa0[_0xc8a5('0x49')],function(_0x547ab5){var _0x4e57e8={};_0x4e57e8[_0x547ab5]={'$like':'%'+_0x3b0d6f[_0xc8a5('0x45')]['filter']+'%'};return _0x4e57e8;})});}_0x4d2aa0=_[_0xc8a5('0x51')]({},_0x4d2aa0,_0x3b0d6f[_0xc8a5('0x53')]);return db[_0xc8a5('0x86')]['count']({'where':_0x4d2aa0['where']})[_0xc8a5('0x1f')](function(_0x1fd460){_0x13c2b7[_0xc8a5('0x2c')]=_0x1fd460;if(_0x3b0d6f[_0xc8a5('0x45')]['includeAll']){_0x4d2aa0['include']=[{'model':db[_0xc8a5('0x87')],'as':_0xc8a5('0x88'),'required':![]},{'model':db[_0xc8a5('0x89')],'as':_0xc8a5('0x8a'),'attributes':[_0xc8a5('0x38'),_0xc8a5('0x8b'),_0xc8a5('0x8c')],'required':![]},{'model':db[_0xc8a5('0x8d')],'as':_0xc8a5('0x8e'),'attributes':['id',_0xc8a5('0x38'),_0xc8a5('0x8f')],'where':_0x3b0d6f[_0xc8a5('0x45')]['tag']?{'id':_0x3b0d6f[_0xc8a5('0x45')][_0xc8a5('0x90')]}:undefined,'required':_0x3b0d6f[_0xc8a5('0x45')]['tag']?!![]:![]}];}return db[_0xc8a5('0x86')]['findAll'](_0x4d2aa0);})[_0xc8a5('0x1f')](function(_0x3950bd){_0x13c2b7[_0xc8a5('0x56')]=_0x3950bd;return _0x13c2b7;});}})['then'](respondWithFilteredResult(_0x3fcdf9,_0x4d2aa0))[_0xc8a5('0x28')](handleError(_0x3fcdf9,null));};exports['addApplications']=function(_0x145556,_0x3690d3,_0x523ce2){return db[_0xc8a5('0x40')][_0xc8a5('0x61')]({'where':{'id':_0x145556[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x3690d3,null))['then'](function(_0x5d1941){if(_0x5d1941){return db[_0xc8a5('0x91')][_0xc8a5('0x92')](function(_0x43de24){return db['MailApplication'][_0xc8a5('0x34')]({'where':{'MailAccountId':_0x145556[_0xc8a5('0x5b')]['id']},'transaction':_0x43de24})['then'](function(_0x12ef96){var _0x409e75=_[_0xc8a5('0x44')](_0x145556[_0xc8a5('0x59')],function(_0x3a21a6){_0x3a21a6[_0xc8a5('0x68')]=_0x145556['params']['id'];return _0x3a21a6;});return db[_0xc8a5('0x93')][_0xc8a5('0x94')](_0x409e75,{'transaction':_0x43de24});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x145556[_0xc8a5('0x5b')]['id']},'order':_0xc8a5('0x95')});});}})[_0xc8a5('0x1f')](respondWithResult(_0x3690d3,null))[_0xc8a5('0x28')](handleError(_0x3690d3,null));};exports[_0xc8a5('0x96')]=function(_0x2459c1,_0x11b943,_0x4b0ee8){var _0x58c6e3={};var _0x480c7c={};var _0x150302;var _0x1ca340;return db[_0xc8a5('0x40')]['findOne']({'where':{'id':_0x2459c1[_0xc8a5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11b943,null))[_0xc8a5('0x1f')](function(_0x529e2c){if(_0x529e2c){_0x150302=_0x529e2c;_0x480c7c['model']=_['keys'](db[_0xc8a5('0x93')]['rawAttributes']);_0x480c7c['query']=_[_0xc8a5('0x46')](_0x2459c1[_0xc8a5('0x45')]);_0x480c7c[_0xc8a5('0x47')]=_[_0xc8a5('0x48')](_0x480c7c[_0xc8a5('0x43')],_0x480c7c['query']);_0x58c6e3[_0xc8a5('0x49')]=_[_0xc8a5('0x48')](_0x480c7c[_0xc8a5('0x43')],qs['fields'](_0x2459c1['query']['fields']));_0x58c6e3[_0xc8a5('0x49')]=_0x58c6e3[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x58c6e3['attributes']:_0x480c7c['model'];_0x58c6e3[_0xc8a5('0x64')]=qs[_0xc8a5('0x4d')](_0x2459c1[_0xc8a5('0x45')][_0xc8a5('0x4d')]);_0x58c6e3[_0xc8a5('0x4e')]=qs[_0xc8a5('0x47')](_[_0xc8a5('0x4f')](_0x2459c1[_0xc8a5('0x45')],_0x480c7c['filters']));if(_0x2459c1[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x58c6e3[_0xc8a5('0x4e')]=_[_0xc8a5('0x51')](_0x58c6e3[_0xc8a5('0x4e')],{'$or':_['map'](_0x58c6e3[_0xc8a5('0x49')],function(_0x58815a){var _0x33ea69={};_0x33ea69[_0x58815a]={'$like':'%'+_0x2459c1['query'][_0xc8a5('0x50')]+'%'};return _0x33ea69;})});}_0x58c6e3=_[_0xc8a5('0x51')]({},_0x58c6e3,_0x2459c1[_0xc8a5('0x53')]);return _0x150302[_0xc8a5('0x96')](_0x58c6e3);}})[_0xc8a5('0x1f')](function(_0x459316){if(_0x459316){_0x1ca340=_0x459316[_0xc8a5('0x4b')];if(!_0x2459c1[_0xc8a5('0x45')]['hasOwnProperty']('nolimit')){_0x58c6e3[_0xc8a5('0x2e')]=qs[_0xc8a5('0x2e')](_0x2459c1[_0xc8a5('0x45')][_0xc8a5('0x2e')]);_0x58c6e3['offset']=qs[_0xc8a5('0x2d')](_0x2459c1[_0xc8a5('0x45')][_0xc8a5('0x2d')]);}return _0x150302['getApplications'](_0x58c6e3);}})[_0xc8a5('0x1f')](function(_0x2fb52b){if(_0x2fb52b){return _0x2fb52b?{'count':_0x1ca340,'rows':_0x2fb52b}:null;}})[_0xc8a5('0x1f')](respondWithResult(_0x11b943,null))[_0xc8a5('0x28')](handleError(_0x11b943,null));};exports['getMessages']=function(_0x527e00,_0x9153d,_0x20ca80){var _0x24e62e={'raw':!![],'where':{}};var _0x5ee425={};var _0x1dbf6b={'count':0x0,'rows':[]};return db[_0xc8a5('0x40')]['findOne']({'where':{'id':_0x527e00[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x9153d,null))[_0xc8a5('0x1f')](function(_0x2f3e13){if(_0x2f3e13){_0x5ee425[_0xc8a5('0x43')]=_[_0xc8a5('0x46')](db[_0xc8a5('0x97')][_0xc8a5('0x62')]);_0x5ee425[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x527e00[_0xc8a5('0x45')]);_0x5ee425[_0xc8a5('0x47')]=_['intersection'](_0x5ee425[_0xc8a5('0x43')],_0x5ee425[_0xc8a5('0x45')]);_0x24e62e[_0xc8a5('0x49')]=_['intersection'](_0x5ee425[_0xc8a5('0x43')],qs[_0xc8a5('0x4a')](_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x4a')]));_0x24e62e['attributes']=_0x24e62e[_0xc8a5('0x49')][_0xc8a5('0x4b')]?_0x24e62e[_0xc8a5('0x49')]:_0x5ee425['model'];if(!_0x527e00['query'][_0xc8a5('0x63')](_0xc8a5('0x4c'))){_0x24e62e[_0xc8a5('0x2e')]=qs['limit'](_0x527e00['query'][_0xc8a5('0x2e')]);_0x24e62e[_0xc8a5('0x2d')]=qs['offset'](_0x527e00['query']['offset']);}_0x24e62e[_0xc8a5('0x64')]=qs[_0xc8a5('0x4d')](_0x527e00['query']['sort']);_0x24e62e[_0xc8a5('0x4e')]=qs[_0xc8a5('0x47')](_['pick'](_0x527e00['query'],_0x5ee425['filters']));_0x24e62e[_0xc8a5('0x4e')]['MailAccountId']=_0x2f3e13['id'];if(_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x24e62e[_0xc8a5('0x4e')]=_[_0xc8a5('0x51')](_0x24e62e[_0xc8a5('0x4e')],{'$or':_[_0xc8a5('0x44')](_0x24e62e[_0xc8a5('0x49')],function(_0x461afa){var _0x3e8be1={};_0x3e8be1[_0x461afa]={'$like':'%'+_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x50')]+'%'};return _0x3e8be1;})});}if(_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x98')]){var _0x519177=_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x98')][_0xc8a5('0x99')](',');var _0x4cc5fe={};_0x4cc5fe[_0x519177[0x0]]={'$gte':moment(_0x519177[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x24e62e['where']=_[_0xc8a5('0x51')](_0x24e62e[_0xc8a5('0x4e')],_0x4cc5fe);}_0x24e62e=_[_0xc8a5('0x51')]({},_0x24e62e,_0x527e00['options']);return db[_0xc8a5('0x97')]['count']({'where':_0x24e62e[_0xc8a5('0x4e')]})['then'](function(_0xf9a9f8){_0x1dbf6b['count']=_0xf9a9f8;if(_0x527e00[_0xc8a5('0x45')][_0xc8a5('0x54')]){_0x24e62e[_0xc8a5('0x58')]=[{'all':!![]}];}return db[_0xc8a5('0x97')][_0xc8a5('0x55')](_0x24e62e);})[_0xc8a5('0x1f')](function(_0x49b236){_0x1dbf6b['rows']=_0x49b236;return _0x1dbf6b;});}})['then'](respondWithFilteredResult(_0x9153d,_0x24e62e))[_0xc8a5('0x28')](handleError(_0x9153d,null));};exports[_0xc8a5('0x9a')]=function(_0x169dcf,_0x2555e4,_0x3e7a76){var _0x53ab23,_0x7af89d={},_0x4fc20e;if(_0x169dcf['body']['to']){_0x4fc20e=_0x169dcf['body']['to'][_0xc8a5('0x99')](',')[0x0];}return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x169dcf[_0xc8a5('0x5b')]['id']},'include':[{'model':db[_0xc8a5('0x9b')],'as':_0xc8a5('0x9c'),'include':[{'model':db[_0xc8a5('0x87')],'as':_0xc8a5('0x9d'),'where':{'email':_0x4fc20e},'limit':0x1,'order':[[_0xc8a5('0x9e'),'DESC']]}]},{'model':db[_0xc8a5('0x3c')],'as':_0xc8a5('0x3d'),'raw':!![]}]})[_0xc8a5('0x1f')](handleEntityNotFound(_0x2555e4,null))[_0xc8a5('0x1f')](function(_0x4dd125){if(_0x4dd125){_0x53ab23=_0x4dd125;if(_0x4dd125[_0xc8a5('0x3d')]){if(_[_0xc8a5('0x6d')](_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0x9f')])){_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0x9f')]=util[_0xc8a5('0xa0')](_0xc8a5('0xa1'),_0x4dd125[_0xc8a5('0x38')],_0x4dd125[_0xc8a5('0x6b')]||_0x4dd125[_0xc8a5('0x3d')]['user']);}if(_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xa2')]&&_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xa2')][_0xc8a5('0x4b')]){for(var _0x2d8f1d=0x0;_0x2d8f1d<_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xa2')][_0xc8a5('0x4b')];_0x2d8f1d+=0x1){_0x169dcf['body'][_0xc8a5('0xa2')][_0x2d8f1d]={'filename':_0x169dcf[_0xc8a5('0x59')]['attachments'][_0x2d8f1d]['name'],'path':path[_0xc8a5('0xa3')](config['root'],_0xc8a5('0xa4'),_0x169dcf[_0xc8a5('0x59')]['attachments'][_0x2d8f1d][_0xc8a5('0xa5')])};}}var _0x5f18f2={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x78')])){if(_0x4dd125['Smtp']['authentication']){_0x5f18f2['auth']={'user':_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x70')],'pass':_0x4dd125['Smtp'][_0xc8a5('0x73')]};}_0x5f18f2['host']=_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x76')];_0x5f18f2[_0xc8a5('0x77')]=_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x77')];_0x5f18f2[_0xc8a5('0xa6')]=_0x4dd125[_0xc8a5('0x3d')]['secure'];}else{_0x5f18f2[_0xc8a5('0x78')]=_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x78')];_0x5f18f2[_0xc8a5('0xa7')]={'user':_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x70')],'pass':_0x4dd125[_0xc8a5('0x3d')][_0xc8a5('0x73')]};}return respondWithRpcPromise(_0xc8a5('0xa8'),'sendMail',{'account':_0x5f18f2,'message':_0x169dcf[_0xc8a5('0x59')]});}else{throw new Error(_0xc8a5('0xa9'));}}})['then'](function(_0x48a5ff){if(_0x48a5ff){_0x7af89d=_0x48a5ff;if(_0x53ab23['List']){if(_0x53ab23['List']['Contacts'][_0xc8a5('0x4b')]){return _0x53ab23[_0xc8a5('0x9c')][_0xc8a5('0x9d')][0x0];}else{return db[_0xc8a5('0x87')][_0xc8a5('0x5f')](_[_0xc8a5('0x15')](_0x169dcf['body'],{'firstName':_0x169dcf[_0xc8a5('0x59')]['to'],'email':_0x169dcf[_0xc8a5('0x59')]['to'],'phone':_0x169dcf[_0xc8a5('0x59')]['to'],'ListId':_0x53ab23[_0xc8a5('0x6c')]}));}}else{throw new Error(_0xc8a5('0xa9'));}}})[_0xc8a5('0x1f')](function(_0x24f6d8){if(_0x24f6d8){var _0x1f5de3={'UserId':_0x169dcf['user']['id'],'ContactId':_0x24f6d8['id'],'MailAccountId':_0x53ab23['id'],'inReplyTo':_0x7af89d['messageId'],'to':_0x169dcf['body'][_0xc8a5('0x9f')],'cc':_0x169dcf[_0xc8a5('0x59')]['cc'],'subject':_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xaa')],'attach':_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xab')],'firstMsgDirection':_0xc8a5('0xac'),'lastMsgAt':moment()[_0xc8a5('0xa0')](_0xc8a5('0xad')),'lastMsgDirection':_0xc8a5('0xac'),'lastMsgBody':_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0x59')],'Messages':[_[_0xc8a5('0x51')](_0x169dcf[_0xc8a5('0x59')],{'messageId':_0x7af89d[_0xc8a5('0xae')],'sentAt':moment()[_0xc8a5('0xa0')](_0xc8a5('0xad')),'read':!![],'MailAccountId':_0x53ab23['id'],'UserId':_0x169dcf[_0xc8a5('0x70')]['id'],'ContactId':_0x24f6d8['id']})]};if(_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xaf')]){_0x1f5de3=_[_0xc8a5('0x51')](_0x1f5de3,_0x169dcf[_0xc8a5('0x59')][_0xc8a5('0xaf')]);}return db[_0xc8a5('0x86')][_0xc8a5('0x5f')](_0x1f5de3,{'include':[{'model':db[_0xc8a5('0x97')],'as':_0xc8a5('0xb0')}]});}})['then'](respondWithResult(_0x2555e4,null))[_0xc8a5('0x28')](handleError(_0x2555e4,null));};exports[_0xc8a5('0xb1')]=function(_0x538788,_0x43c6a6,_0x38a82c){return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x538788[_0xc8a5('0x5b')]['id']},'include':[{'model':db[_0xc8a5('0x3c')],'as':_0xc8a5('0x3d'),'raw':!![]}]})['then'](handleEntityNotFound(_0x43c6a6,null))[_0xc8a5('0x1f')](function(_0x3b4296){if(_0x3b4296&&_0x3b4296[_0xc8a5('0x3d')]){var _0x1ab4f4={'id':_0x3b4296['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x78')]){_0x1ab4f4[_0xc8a5('0x78')]=_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x78')];}else{_0x1ab4f4['host']=_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x76')];_0x1ab4f4[_0xc8a5('0x77')]=_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x77')];_0x1ab4f4[_0xc8a5('0xa6')]=_0x3b4296['Smtp'][_0xc8a5('0xa6')];}if(_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x75')]){_0x1ab4f4[_0xc8a5('0xa7')]={'user':_0x3b4296[_0xc8a5('0x3d')]['user'],'pass':_0x3b4296[_0xc8a5('0x3d')][_0xc8a5('0x73')]};}return respondWithRpcPromise(_0xc8a5('0xb2'),_0xc8a5('0xb1'),{'account':_0x1ab4f4});}})['then'](respondWithResult(_0x43c6a6,null))['catch'](handleError(_0x43c6a6,null));};exports[_0xc8a5('0x34')]=function(_0xa35393,_0x240ccb){return db[_0xc8a5('0x40')]['find']({'where':{'id':_0xa35393[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x240ccb,null))[_0xc8a5('0x1f')](function(_0x5aa9a4){if(_0x5aa9a4&&_0x5aa9a4[_0xc8a5('0x78')]){throw new db[(_0xc8a5('0x1b'))][(_0xc8a5('0x1c'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5aa9a4;})[_0xc8a5('0x1f')](removeEntity(_0x240ccb,null))[_0xc8a5('0x28')](handleError(_0x240ccb,null));};exports['addAgents']=function(_0x5ec4ca,_0x13e08e,_0x3d0a9b){return db[_0xc8a5('0x40')][_0xc8a5('0x5a')]({'where':{'id':_0x5ec4ca[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0x13e08e,null))['then'](function(_0x1fa89c){if(_0x1fa89c){return _0x1fa89c['addAgents'](_0x5ec4ca[_0xc8a5('0x59')]['ids'],_[_0xc8a5('0x84')](_0x5ec4ca['body'],[_0xc8a5('0x66'),'id'])||{})['spread'](function(_0x345781){for(var _0x48b452=0x0;_0x48b452<_0x5ec4ca[_0xc8a5('0x59')][_0xc8a5('0x66')][_0xc8a5('0x4b')];_0x48b452+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x5ec4ca[_0xc8a5('0x59')][_0xc8a5('0x66')][_0x48b452],'MailAccountId':_0x5ec4ca[_0xc8a5('0x5b')]['id']});}return _0x345781;});}})['then'](respondWithResult(_0x13e08e,null))[_0xc8a5('0x28')](handleError(_0x13e08e,null));};exports[_0xc8a5('0xb3')]=function(_0x47389d,_0xecdcf6,_0x530f72){return db[_0xc8a5('0x40')]['find']({'where':{'id':_0x47389d[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0xecdcf6,null))['then'](function(_0x258b38){if(_0x258b38){return _0x258b38[_0xc8a5('0xb3')](_0x47389d[_0xc8a5('0x45')][_0xc8a5('0x66')])['then'](function(){if(_[_0xc8a5('0xb4')](_0x47389d[_0xc8a5('0x45')][_0xc8a5('0x66')])){for(var _0x3e418a=0x0;_0x3e418a<_0x47389d[_0xc8a5('0x45')][_0xc8a5('0x66')]['length'];_0x3e418a+=0x1){socket[_0xc8a5('0xb5')](_0xc8a5('0xb6'),{'UserId':Number(_0x47389d['query'][_0xc8a5('0x66')][_0x3e418a]),'MailAccountId':Number(_0x47389d[_0xc8a5('0x5b')]['id'])});}}else{socket['emit'](_0xc8a5('0xb6'),{'UserId':Number(_0x47389d[_0xc8a5('0x45')][_0xc8a5('0x66')]),'MailAccountId':Number(_0x47389d['params']['id'])});}});}})[_0xc8a5('0x1f')](respondWithStatusCode(_0xecdcf6,null))['catch'](handleError(_0xecdcf6,null));};exports['getAgents']=function(_0x2f7c48,_0xe93c19,_0x55fc63){var _0x4699a2={};var _0x1636da={};var _0x4422f9;var _0x5f44c3;return db['MailAccount'][_0xc8a5('0x61')]({'where':{'id':_0x2f7c48[_0xc8a5('0x5b')]['id']}})[_0xc8a5('0x1f')](handleEntityNotFound(_0xe93c19,null))[_0xc8a5('0x1f')](function(_0x20fcea){if(_0x20fcea){_0x4422f9=_0x20fcea;_0x1636da[_0xc8a5('0x43')]=_[_0xc8a5('0x46')](db[_0xc8a5('0x89')]['rawAttributes']);_0x1636da[_0xc8a5('0x45')]=_[_0xc8a5('0x46')](_0x2f7c48[_0xc8a5('0x45')]);_0x1636da['filters']=_[_0xc8a5('0x48')](_0x1636da[_0xc8a5('0x43')],_0x1636da[_0xc8a5('0x45')]);_0x4699a2[_0xc8a5('0x49')]=_[_0xc8a5('0x48')](_0x1636da['model'],qs[_0xc8a5('0x4a')](_0x2f7c48[_0xc8a5('0x45')][_0xc8a5('0x4a')]));_0x4699a2[_0xc8a5('0x49')]=_0x4699a2[_0xc8a5('0x49')]['length']?_0x4699a2[_0xc8a5('0x49')]:_0x1636da[_0xc8a5('0x43')];_0x4699a2[_0xc8a5('0x64')]=qs[_0xc8a5('0x4d')](_0x2f7c48[_0xc8a5('0x45')][_0xc8a5('0x4d')]);_0x4699a2[_0xc8a5('0x4e')]=qs[_0xc8a5('0x47')](_['pick'](_0x2f7c48[_0xc8a5('0x45')],_0x1636da[_0xc8a5('0x47')]));if(_0x2f7c48[_0xc8a5('0x45')][_0xc8a5('0x50')]){_0x4699a2[_0xc8a5('0x4e')]=_['merge'](_0x4699a2[_0xc8a5('0x4e')],{'$or':_[_0xc8a5('0x44')](_0x4699a2[_0xc8a5('0x49')],function(_0x1aa635){var _0x1552e9={};_0x1552e9[_0x1aa635]={'$like':'%'+_0x2f7c48[_0xc8a5('0x45')][_0xc8a5('0x50')]+'%'};return _0x1552e9;})});}_0x4699a2=_['merge']({},_0x4699a2,_0x2f7c48[_0xc8a5('0x53')]);return _0x4422f9['getAgents'](_0x4699a2);}})[_0xc8a5('0x1f')](function(_0x1ea3a7){if(_0x1ea3a7){_0x5f44c3=_0x1ea3a7[_0xc8a5('0x4b')];if(!_0x2f7c48['query'][_0xc8a5('0x63')]('nolimit')){_0x4699a2['limit']=qs[_0xc8a5('0x2e')](_0x2f7c48[_0xc8a5('0x45')][_0xc8a5('0x2e')]);_0x4699a2[_0xc8a5('0x2d')]=qs['offset'](_0x2f7c48[_0xc8a5('0x45')]['offset']);}return _0x4422f9[_0xc8a5('0xb7')](_0x4699a2);}})[_0xc8a5('0x1f')](function(_0x10029e){if(_0x10029e){return _0x10029e?{'count':_0x5f44c3,'rows':_0x10029e}:null;}})[_0xc8a5('0x1f')](respondWithResult(_0xe93c19,null))[_0xc8a5('0x28')](handleError(_0xe93c19,null));}; \ No newline at end of file +var _0x8bc4=['cpassword','authentication','host','port','service','cuser','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','fullname','Tag','Tags','color','tag','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','send','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','verifySmtp','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','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','MailAccount,\x20%s,\x20%s','debug','error','code','message','info','result','catch','end','status','json','offset','limit','save','update','MailAccounts','UserProfileResource','destroy','sendStatus','stack','name','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','rawAttributes','include','find','body','Smtp','Pause','describe','Disposition','create','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','MailAccountId','removeAnswers','email','ListId','isNil','active','cservice','cauthentication','user','password','pass'];(function(_0x4bee3c,_0xa3439b){var _0x44c98f=function(_0x4dbbe7){while(--_0x4dbbe7){_0x4bee3c['push'](_0x4bee3c['shift']());}};_0x44c98f(++_0xa3439b);}(_0x8bc4,0x1b0));var _0x48bc=function(_0x57562e,_0x5b5895){_0x57562e=_0x57562e-0x0;var _0x12d8f7=_0x8bc4[_0x57562e];return _0x12d8f7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x48bc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48bc('0x1'));var jsonpatch=require(_0x48bc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48bc('0x3'));var util=require(_0x48bc('0x4'));var path=require(_0x48bc('0x5'));var sox=require(_0x48bc('0x6'));var csv=require(_0x48bc('0x7'));var ejs=require(_0x48bc('0x8'));var fs=require('fs');var _=require(_0x48bc('0x9'));var squel=require(_0x48bc('0xa'));var crypto=require(_0x48bc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x48bc('0xc'));var toCsv=require(_0x48bc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x48bc('0xd'));var authService=require(_0x48bc('0xe'));var qs=require(_0x48bc('0xf'));var as=require(_0x48bc('0x10'));var hardwareService=require(_0x48bc('0x11'));var logger=require(_0x48bc('0x12'))(_0x48bc('0x13'));var utils=require(_0x48bc('0x14'));var config=require(_0x48bc('0x15'));var db=require(_0x48bc('0x16'))['db'];config[_0x48bc('0x17')]=_[_0x48bc('0x18')](config[_0x48bc('0x17')],{'host':_0x48bc('0x19'),'port':0x18eb});var socket=require(_0x48bc('0x1a'))(new Redis(config['redis']));require(_0x48bc('0x1b'))[_0x48bc('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x48bc('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x27053e,_0x53db19,_0x58bf7a){if(_0x58bf7a){var _0x2290ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2290ec[_0x48bc('0x1e')](_0x53db19)){return _0x27053e;}else{throw new db[(_0x48bc('0x1f'))][(_0x48bc('0x20'))](_0x48bc('0x21'));}}else{return _0x27053e;}}function respondWithRpcPromise(_0x1e9031,_0xd46832,_0x7d422c,_0x14926b){return new BPromise(function(_0x318147,_0x48ed63){var _0x11a5fc=_0x14926b||client;return _0x11a5fc[_0x48bc('0x22')](_0x1e9031,_0x7d422c)[_0x48bc('0x23')](function(_0x29dece){logger['info'](_0x48bc('0x24'),_0xd46832,'request\x20sent');logger[_0x48bc('0x25')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xd46832,'request\x20sent',JSON['stringify'](_0x29dece));if(_0x29dece[_0x48bc('0x26')]){if(_0x29dece[_0x48bc('0x26')][_0x48bc('0x27')]===0x1f4){logger[_0x48bc('0x26')](_0x48bc('0x24'),_0xd46832,_0x29dece[_0x48bc('0x26')][_0x48bc('0x28')]);return _0x48ed63(_0x29dece['error']['message']);}logger[_0x48bc('0x26')](_0x48bc('0x24'),_0xd46832,_0x29dece[_0x48bc('0x26')][_0x48bc('0x28')]);return _0x318147(_0x29dece[_0x48bc('0x26')][_0x48bc('0x28')]);}else{logger[_0x48bc('0x29')](_0x48bc('0x24'),_0xd46832,'request\x20sent');_0x318147(_0x29dece[_0x48bc('0x2a')][_0x48bc('0x28')]);}})[_0x48bc('0x2b')](function(_0x4c6d97){logger['error'](_0x48bc('0x24'),_0xd46832,_0x4c6d97);_0x48ed63(_0x4c6d97);});});}function respondWithStatusCode(_0x441213,_0x9bbab2){_0x9bbab2=_0x9bbab2||0xcc;return function(_0x1269b6){if(_0x1269b6){return _0x441213['sendStatus'](_0x9bbab2);}return _0x441213['status'](_0x9bbab2)[_0x48bc('0x2c')]();};}function respondWithResult(_0x33a2fe,_0x5c32e8){_0x5c32e8=_0x5c32e8||0xc8;return function(_0x157a20){if(_0x157a20){return _0x33a2fe[_0x48bc('0x2d')](_0x5c32e8)[_0x48bc('0x2e')](_0x157a20);}};}function respondWithFilteredResult(_0x111b1e,_0x269b02){return function(_0x2abe54){if(_0x2abe54){var _0x323c84=_0x2abe54['count'],_0x5d7c67=_0x269b02[_0x48bc('0x2f')],_0x252de9=_0x269b02['offset']+_0x269b02[_0x48bc('0x30')],_0x31fe7a;if(_0x252de9>=_0x323c84){_0x252de9=_0x323c84;_0x31fe7a=0xc8;}else{_0x31fe7a=0xce;}_0x111b1e[_0x48bc('0x2d')](_0x31fe7a);return _0x111b1e['set']('Content-Range',_0x5d7c67+'-'+_0x252de9+'/'+_0x323c84)[_0x48bc('0x2e')](_0x2abe54);}return null;};}function patchUpdates(_0x46812f){return function(_0x56787b){try{jsonpatch['apply'](_0x56787b,_0x46812f,!![]);}catch(_0x1a75b9){return BPromise['reject'](_0x1a75b9);}return _0x56787b[_0x48bc('0x31')]();};}function saveUpdates(_0x3334b6,_0x127a6){return function(_0x3e8616){if(_0x3e8616){return _0x3e8616[_0x48bc('0x32')](_0x3334b6)[_0x48bc('0x23')](function(_0x5428b0){return _0x5428b0;});}return null;};}function removeEntity(_0x404b61,_0x4e7c80){return function(_0x1a67b7){if(_0x1a67b7){return _0x1a67b7['destroy']()[_0x48bc('0x23')](function(){var _0x904d22=_0x1a67b7['get']({'plain':!![]});var _0x6b4577=_0x48bc('0x33');return db[_0x48bc('0x34')][_0x48bc('0x35')]({'where':{'type':_0x6b4577,'resourceId':_0x904d22['id']}})[_0x48bc('0x23')](function(){return _0x1a67b7;});})[_0x48bc('0x23')](function(){_0x404b61['status'](0xcc)[_0x48bc('0x2c')]();});}};}function handleEntityNotFound(_0x42f4ca,_0x55b4c2){return function(_0x1aceb2){if(!_0x1aceb2){_0x42f4ca[_0x48bc('0x36')](0x194);}return _0x1aceb2;};}function handleError(_0x191119,_0x5502a9){_0x5502a9=_0x5502a9||0x1f4;return function(_0x197167){logger['error'](_0x197167[_0x48bc('0x37')]);if(_0x197167[_0x48bc('0x38')]){delete _0x197167[_0x48bc('0x38')];}_0x191119[_0x48bc('0x2d')](_0x5502a9)['send'](_0x197167);};}exports[_0x48bc('0x39')]=function(_0x51c70d,_0x1547df){var _0x479bc5={'include':[{'model':db[_0x48bc('0x3a')],'as':_0x48bc('0x3b')},{'model':db[_0x48bc('0x3c')],'as':'Smtp'},{'model':db['Pause'],'as':_0x48bc('0x3d')}]},_0x5b1932={},_0x4a7b69={'count':0x0,'rows':[]};var _0x50451c=_[_0x48bc('0x3e')](db[_0x48bc('0x3f')]['rawAttributes'],function(_0x4e47c8){return{'name':_0x4e47c8[_0x48bc('0x40')],'type':_0x4e47c8[_0x48bc('0x41')][_0x48bc('0x42')]};});_0x5b1932['model']=_[_0x48bc('0x3e')](_0x50451c,'name');_0x5b1932[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x51c70d[_0x48bc('0x43')]);_0x5b1932[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0x5b1932['model'],_0x5b1932[_0x48bc('0x43')]);_0x479bc5[_0x48bc('0x47')]=_[_0x48bc('0x46')](_0x5b1932[_0x48bc('0x48')],qs['fields'](_0x51c70d[_0x48bc('0x43')][_0x48bc('0x49')]));_0x479bc5[_0x48bc('0x47')]=_0x479bc5[_0x48bc('0x47')][_0x48bc('0x4a')]?_0x479bc5[_0x48bc('0x47')]:_0x5b1932[_0x48bc('0x48')];if(!_0x51c70d[_0x48bc('0x43')][_0x48bc('0x4b')](_0x48bc('0x4c'))){_0x479bc5[_0x48bc('0x30')]=qs[_0x48bc('0x30')](_0x51c70d['query'][_0x48bc('0x30')]);_0x479bc5[_0x48bc('0x2f')]=qs[_0x48bc('0x2f')](_0x51c70d['query'][_0x48bc('0x2f')]);}_0x479bc5[_0x48bc('0x4d')]=qs[_0x48bc('0x4e')](_0x51c70d[_0x48bc('0x43')][_0x48bc('0x4e')]);_0x479bc5[_0x48bc('0x4f')]=qs[_0x48bc('0x45')](_[_0x48bc('0x50')](_0x51c70d[_0x48bc('0x43')],_0x5b1932[_0x48bc('0x45')]),_0x50451c);if(_0x51c70d[_0x48bc('0x43')][_0x48bc('0x51')]){_0x479bc5['where']=_[_0x48bc('0x52')](_0x479bc5[_0x48bc('0x4f')],{'$or':_[_0x48bc('0x3e')](_0x50451c,function(_0x3357bb){if(_0x3357bb['type']!==_0x48bc('0x53')){var _0x1ddd99={};_0x1ddd99[_0x3357bb[_0x48bc('0x38')]]={'$like':'%'+_0x51c70d[_0x48bc('0x43')][_0x48bc('0x51')]+'%'};return _0x1ddd99;}})});}_0x479bc5=_[_0x48bc('0x52')]({},_0x479bc5,_0x51c70d[_0x48bc('0x54')]);var _0x3087d6={'where':_0x479bc5[_0x48bc('0x4f')]};return db['MailAccount'][_0x48bc('0x55')](_0x3087d6)['then'](function(_0x3d8d09){_0x4a7b69[_0x48bc('0x55')]=_0x3d8d09;if(_0x51c70d[_0x48bc('0x43')][_0x48bc('0x56')]){_0x479bc5['include']=[{'all':!![]}];}return db[_0x48bc('0x3f')][_0x48bc('0x57')](_0x479bc5);})[_0x48bc('0x23')](function(_0x359e5f){_0x4a7b69[_0x48bc('0x58')]=_0x359e5f;return _0x4a7b69;})[_0x48bc('0x23')](respondWithFilteredResult(_0x1547df,_0x479bc5))[_0x48bc('0x2b')](handleError(_0x1547df,null));};exports[_0x48bc('0x59')]=function(_0x12fb90,_0x20d3b7){var _0x1fd047={'raw':![],'where':{'id':_0x12fb90[_0x48bc('0x5a')]['id']},'include':[{'model':db[_0x48bc('0x3a')],'as':_0x48bc('0x3b')},{'model':db[_0x48bc('0x3c')],'as':'Smtp'},{'model':db['Pause'],'as':_0x48bc('0x3d')}]},_0xe2f614={};_0xe2f614[_0x48bc('0x48')]=_[_0x48bc('0x44')](db['MailAccount'][_0x48bc('0x5b')]);_0xe2f614['query']=_['keys'](_0x12fb90[_0x48bc('0x43')]);_0xe2f614[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0xe2f614[_0x48bc('0x48')],_0xe2f614[_0x48bc('0x43')]);_0x1fd047[_0x48bc('0x47')]=_[_0x48bc('0x46')](_0xe2f614['model'],qs[_0x48bc('0x49')](_0x12fb90[_0x48bc('0x43')][_0x48bc('0x49')]));_0x1fd047[_0x48bc('0x47')]=_0x1fd047[_0x48bc('0x47')][_0x48bc('0x4a')]?_0x1fd047[_0x48bc('0x47')]:_0xe2f614[_0x48bc('0x48')];if(_0x12fb90['query'][_0x48bc('0x56')]){_0x1fd047[_0x48bc('0x5c')]=[{'all':!![]}];}_0x1fd047=_[_0x48bc('0x52')]({},_0x1fd047,_0x12fb90[_0x48bc('0x54')]);return db[_0x48bc('0x3f')][_0x48bc('0x5d')](_0x1fd047)['then'](handleEntityNotFound(_0x20d3b7,null))[_0x48bc('0x23')](respondWithResult(_0x20d3b7,null))[_0x48bc('0x2b')](handleError(_0x20d3b7,null));};exports['update']=function(_0x3bf11d,_0x48944b){if(_0x3bf11d['body']['id']){delete _0x3bf11d[_0x48bc('0x5e')]['id'];}return db[_0x48bc('0x3f')]['find']({'where':{'id':_0x3bf11d[_0x48bc('0x5a')]['id']},'include':[{'model':db[_0x48bc('0x3a')],'as':_0x48bc('0x3b')},{'model':db['MailServerOut'],'as':_0x48bc('0x5f')},{'model':db[_0x48bc('0x60')],'as':'mandatoryDispositionPause'}]})[_0x48bc('0x23')](handleEntityNotFound(_0x48944b,null))[_0x48bc('0x23')](saveUpdates(_0x3bf11d[_0x48bc('0x5e')],null))[_0x48bc('0x23')](function(_0x2459f3){if(_0x2459f3&&_0x3bf11d[_0x48bc('0x5e')][_0x48bc('0x3b')]){return db[_0x48bc('0x3a')][_0x48bc('0x32')](_0x3bf11d['body'][_0x48bc('0x3b')],{'where':{'MailAccountId':_0x2459f3['id']}})[_0x48bc('0x23')](function(){return _0x2459f3;});}return _0x2459f3;})[_0x48bc('0x23')](function(_0x4e151e){if(_0x4e151e&&_0x3bf11d[_0x48bc('0x5e')][_0x48bc('0x5f')]){return db[_0x48bc('0x3c')][_0x48bc('0x32')](_0x3bf11d[_0x48bc('0x5e')][_0x48bc('0x5f')],{'where':{'MailAccountId':_0x4e151e['id']}})['then'](function(){return _0x4e151e;});}return _0x4e151e;})[_0x48bc('0x23')](respondWithResult(_0x48944b,null))[_0x48bc('0x2b')](handleError(_0x48944b,null));};exports[_0x48bc('0x61')]=function(_0x3558ac,_0x23170c){return db['MailAccount']['describe']()[_0x48bc('0x23')](respondWithResult(_0x23170c,null))[_0x48bc('0x2b')](handleError(_0x23170c,null));};exports['addDisposition']=function(_0x4ff36e,_0x350f5e,_0x154530){if(_0x4ff36e[_0x48bc('0x5e')]['id']){delete _0x4ff36e[_0x48bc('0x5e')]['id'];}return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x4ff36e[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x350f5e,null))['then'](function(_0x2ad7a3){if(_0x2ad7a3){_0x4ff36e['body']['MailAccountId']=_0x2ad7a3['id'];return db[_0x48bc('0x62')][_0x48bc('0x63')](_0x4ff36e[_0x48bc('0x5e')]);}})[_0x48bc('0x23')](respondWithResult(_0x350f5e,null))[_0x48bc('0x2b')](handleError(_0x350f5e,null));};exports[_0x48bc('0x64')]=function(_0x146ca8,_0x3e49b5,_0x6e828c){var _0x4a7875={'raw':![],'where':{}};var _0x2f5490={};var _0xcf6634={'count':0x0,'rows':[]};return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x146ca8[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x3e49b5,null))['then'](function(_0x13bc01){if(_0x13bc01){_0x2f5490[_0x48bc('0x48')]=_[_0x48bc('0x44')](db[_0x48bc('0x62')][_0x48bc('0x5b')]);_0x2f5490[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x146ca8[_0x48bc('0x43')]);_0x2f5490[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0x2f5490[_0x48bc('0x48')],_0x2f5490[_0x48bc('0x43')]);_0x4a7875[_0x48bc('0x47')]=_['intersection'](_0x2f5490[_0x48bc('0x48')],qs[_0x48bc('0x49')](_0x146ca8[_0x48bc('0x43')][_0x48bc('0x49')]));_0x4a7875['attributes']=_0x4a7875['attributes'][_0x48bc('0x4a')]?_0x4a7875[_0x48bc('0x47')]:_0x2f5490[_0x48bc('0x48')];if(!_0x146ca8[_0x48bc('0x43')]['hasOwnProperty'](_0x48bc('0x4c'))){_0x4a7875[_0x48bc('0x30')]=qs[_0x48bc('0x30')](_0x146ca8[_0x48bc('0x43')]['limit']);_0x4a7875['offset']=qs['offset'](_0x146ca8['query'][_0x48bc('0x2f')]);}_0x4a7875[_0x48bc('0x4d')]=qs[_0x48bc('0x4e')](_0x146ca8[_0x48bc('0x43')][_0x48bc('0x4e')]);_0x4a7875[_0x48bc('0x4f')]=qs[_0x48bc('0x45')](_[_0x48bc('0x50')](_0x146ca8[_0x48bc('0x43')],_0x2f5490[_0x48bc('0x45')]));_0x4a7875['where']['MailAccountId']=_0x13bc01['id'];if(_0x146ca8[_0x48bc('0x43')][_0x48bc('0x51')]){_0x4a7875['where']=_['merge'](_0x4a7875[_0x48bc('0x4f')],{'$or':_['map'](_0x4a7875['attributes'],function(_0xad3e0d){var _0x46dc81={};_0x46dc81[_0xad3e0d]={'$like':'%'+_0x146ca8['query'][_0x48bc('0x51')]+'%'};return _0x46dc81;})});}_0x4a7875=_[_0x48bc('0x52')]({},_0x4a7875,_0x146ca8['options']);return db[_0x48bc('0x62')][_0x48bc('0x55')]({'where':_0x4a7875[_0x48bc('0x4f')]})[_0x48bc('0x23')](function(_0x1f9fc3){_0xcf6634['count']=_0x1f9fc3;if(_0x146ca8[_0x48bc('0x43')][_0x48bc('0x56')]){_0x4a7875[_0x48bc('0x5c')]=[{'all':!![]}];}return db[_0x48bc('0x62')]['findAll'](_0x4a7875);})['then'](function(_0x32a5b6){_0xcf6634['rows']=_0x32a5b6;return _0xcf6634;});}})[_0x48bc('0x23')](respondWithFilteredResult(_0x3e49b5,_0x4a7875))[_0x48bc('0x2b')](handleError(_0x3e49b5,null));};exports['removeDispositions']=function(_0x3dfe54,_0x29fabd,_0x5b0c1e){return db['MailAccount'][_0x48bc('0x5d')]({'where':{'id':_0x3dfe54[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x29fabd,null))['then'](function(_0x3b71e1){if(_0x3b71e1){return _0x3b71e1[_0x48bc('0x66')](_0x3dfe54[_0x48bc('0x43')][_0x48bc('0x67')]);}})['then'](respondWithStatusCode(_0x29fabd,null))[_0x48bc('0x2b')](handleError(_0x29fabd,null));};exports[_0x48bc('0x68')]=function(_0x2226b9,_0x4c6ada,_0x4b4349){if(_0x2226b9[_0x48bc('0x5e')]['id']){delete _0x2226b9['body']['id'];}return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x2226b9['params']['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x4c6ada,null))['then'](function(_0x41dfd5){if(_0x41dfd5){_0x2226b9[_0x48bc('0x5e')]['MailAccountId']=_0x41dfd5['id'];return db[_0x48bc('0x69')][_0x48bc('0x63')](_0x2226b9[_0x48bc('0x5e')]);}})['then'](respondWithResult(_0x4c6ada,null))[_0x48bc('0x2b')](handleError(_0x4c6ada,null));};exports['getAnswers']=function(_0x47b1dc,_0x5a911a,_0x23e320){var _0x4c54ac={'raw':![],'where':{}};var _0x1edad0={};var _0x3ab744={'count':0x0,'rows':[]};return db['MailAccount'][_0x48bc('0x65')]({'where':{'id':_0x47b1dc[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x5a911a,null))[_0x48bc('0x23')](function(_0x59654a){if(_0x59654a){_0x1edad0[_0x48bc('0x48')]=_[_0x48bc('0x44')](db[_0x48bc('0x69')][_0x48bc('0x5b')]);_0x1edad0['query']=_[_0x48bc('0x44')](_0x47b1dc['query']);_0x1edad0[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0x1edad0[_0x48bc('0x48')],_0x1edad0[_0x48bc('0x43')]);_0x4c54ac['attributes']=_[_0x48bc('0x46')](_0x1edad0['model'],qs[_0x48bc('0x49')](_0x47b1dc[_0x48bc('0x43')][_0x48bc('0x49')]));_0x4c54ac[_0x48bc('0x47')]=_0x4c54ac[_0x48bc('0x47')][_0x48bc('0x4a')]?_0x4c54ac[_0x48bc('0x47')]:_0x1edad0[_0x48bc('0x48')];if(!_0x47b1dc[_0x48bc('0x43')][_0x48bc('0x4b')](_0x48bc('0x4c'))){_0x4c54ac[_0x48bc('0x30')]=qs[_0x48bc('0x30')](_0x47b1dc['query'][_0x48bc('0x30')]);_0x4c54ac['offset']=qs[_0x48bc('0x2f')](_0x47b1dc[_0x48bc('0x43')][_0x48bc('0x2f')]);}_0x4c54ac[_0x48bc('0x4d')]=qs['sort'](_0x47b1dc['query'][_0x48bc('0x4e')]);_0x4c54ac[_0x48bc('0x4f')]=qs['filters'](_['pick'](_0x47b1dc['query'],_0x1edad0[_0x48bc('0x45')]));_0x4c54ac[_0x48bc('0x4f')][_0x48bc('0x6a')]=_0x59654a['id'];if(_0x47b1dc['query'][_0x48bc('0x51')]){_0x4c54ac[_0x48bc('0x4f')]=_[_0x48bc('0x52')](_0x4c54ac[_0x48bc('0x4f')],{'$or':_[_0x48bc('0x3e')](_0x4c54ac[_0x48bc('0x47')],function(_0x2e1986){var _0x5a76ce={};_0x5a76ce[_0x2e1986]={'$like':'%'+_0x47b1dc[_0x48bc('0x43')]['filter']+'%'};return _0x5a76ce;})});}_0x4c54ac=_[_0x48bc('0x52')]({},_0x4c54ac,_0x47b1dc[_0x48bc('0x54')]);return db[_0x48bc('0x69')]['count']({'where':_0x4c54ac[_0x48bc('0x4f')]})[_0x48bc('0x23')](function(_0xf082a7){_0x3ab744[_0x48bc('0x55')]=_0xf082a7;if(_0x47b1dc[_0x48bc('0x43')][_0x48bc('0x56')]){_0x4c54ac['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x48bc('0x57')](_0x4c54ac);})[_0x48bc('0x23')](function(_0x59390d){_0x3ab744[_0x48bc('0x58')]=_0x59390d;return _0x3ab744;});}})['then'](respondWithFilteredResult(_0x5a911a,_0x4c54ac))[_0x48bc('0x2b')](handleError(_0x5a911a,null));};exports['removeAnswers']=function(_0x23cbcf,_0x7a3dcf,_0x4a35fa){return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x23cbcf[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x7a3dcf,null))[_0x48bc('0x23')](function(_0x2358d0){if(_0x2358d0){return _0x2358d0[_0x48bc('0x6b')](_0x23cbcf[_0x48bc('0x43')][_0x48bc('0x67')]);}})[_0x48bc('0x23')](respondWithStatusCode(_0x7a3dcf,null))[_0x48bc('0x2b')](handleError(_0x7a3dcf,null));};exports['create']=function(_0xf536a,_0x5f12df){var _0x3fb0e1={'name':_0xf536a[_0x48bc('0x5e')][_0x48bc('0x38')],'key':_0xf536a[_0x48bc('0x5e')][_0x48bc('0x42')],'email':_0xf536a[_0x48bc('0x5e')][_0x48bc('0x6c')],'ListId':_0xf536a[_0x48bc('0x5e')][_0x48bc('0x6d')],'active':!_[_0x48bc('0x6e')](_0xf536a[_0x48bc('0x5e')][_0x48bc('0x6f')])?_0xf536a[_0x48bc('0x5e')][_0x48bc('0x6f')]:!![],'description':_0xf536a['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x48bc('0x6e')](_0xf536a['body'][_0x48bc('0x70')])){if(_0xf536a[_0x48bc('0x5e')][_0x48bc('0x71')]){_0x3fb0e1[_0x48bc('0x3b')]['user']=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x72')]=_0xf536a[_0x48bc('0x5e')]['cuser'];_0x3fb0e1[_0x48bc('0x3b')][_0x48bc('0x73')]=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x74')]=_0xf536a['body'][_0x48bc('0x75')];}else{_0x3fb0e1[_0x48bc('0x3b')]['authentication']=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x76')]=![];}_0x3fb0e1[_0x48bc('0x3b')][_0x48bc('0x77')]=_0xf536a[_0x48bc('0x5e')][_0x48bc('0x3b')][_0x48bc('0x77')];_0x3fb0e1[_0x48bc('0x3b')][_0x48bc('0x78')]=_0xf536a['body'][_0x48bc('0x3b')]['port'];_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x77')]=_0xf536a[_0x48bc('0x5e')][_0x48bc('0x5f')][_0x48bc('0x77')];_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x78')]=_0xf536a[_0x48bc('0x5e')]['Smtp'][_0x48bc('0x78')];}else{_0x3fb0e1[_0x48bc('0x3b')][_0x48bc('0x79')]=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x79')]=_0xf536a[_0x48bc('0x5e')][_0x48bc('0x70')];_0x3fb0e1[_0x48bc('0x3b')][_0x48bc('0x72')]=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x72')]=_0xf536a['body'][_0x48bc('0x7a')];_0x3fb0e1[_0x48bc('0x3b')]['password']=_0x3fb0e1[_0x48bc('0x5f')][_0x48bc('0x74')]=_0xf536a[_0x48bc('0x5e')]['cpassword'];}return db[_0x48bc('0x3f')]['create'](_0x3fb0e1,{'include':[{'model':db[_0x48bc('0x3c')],'as':'Smtp'},{'model':db[_0x48bc('0x3a')],'as':_0x48bc('0x3b')}]})[_0x48bc('0x23')](function(_0x30006d){var _0x26ab5a=_0xf536a[_0x48bc('0x72')]['get']({'plain':!![]});if(!_0x26ab5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ab5a[_0x48bc('0x7b')]===_0x48bc('0x72')){var _0x32d0a4=_0x30006d[_0x48bc('0x7c')]({'plain':!![]});return db[_0x48bc('0x7d')][_0x48bc('0x5d')]({'where':{'name':_0x48bc('0x33'),'userProfileId':_0x26ab5a['userProfileId']},'raw':!![]})[_0x48bc('0x23')](function(_0x3dc212){if(_0x3dc212&&_0x3dc212['autoAssociation']===0x0){return db[_0x48bc('0x34')][_0x48bc('0x63')]({'name':_0x32d0a4[_0x48bc('0x38')],'resourceId':_0x32d0a4['id'],'type':_0x3dc212[_0x48bc('0x38')],'sectionId':_0x3dc212['id']},{})[_0x48bc('0x23')](function(){return _0x30006d;});}else{return _0x30006d;}})[_0x48bc('0x2b')](function(_0x284709){logger[_0x48bc('0x26')](_0x48bc('0x7e'),_0x284709);throw _0x284709;});}return _0x30006d;})['then'](respondWithResult(_0x5f12df,0xc9))['catch'](handleError(_0x5f12df,null));};exports[_0x48bc('0x7f')]=function(_0x59bca6,_0x21a223,_0x587422){return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x59bca6[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x21a223,null))[_0x48bc('0x23')](function(_0x5bf26c){if(_0x5bf26c){return _0x5bf26c['getImap']();}return null;})['then'](respondWithResult(_0x21a223,null))[_0x48bc('0x2b')](handleError(_0x21a223,null));};exports['addImap']=function(_0x1821ad,_0x2c3f3d,_0x54ca6d){if(_0x1821ad[_0x48bc('0x5e')]['id']){delete _0x1821ad[_0x48bc('0x5e')]['id'];}return db[_0x48bc('0x3f')]['find']({'where':{'id':_0x1821ad['params']['id']}})['then'](handleEntityNotFound(_0x2c3f3d,null))[_0x48bc('0x23')](function(_0x261294){if(_0x261294){_0x1821ad[_0x48bc('0x5e')]['MailAccountId']=_0x261294['id'];return db[_0x48bc('0x3a')][_0x48bc('0x63')](_0x1821ad[_0x48bc('0x5e')]);}})['then'](respondWithResult(_0x2c3f3d,null))[_0x48bc('0x2b')](handleError(_0x2c3f3d,null));};exports['removeImap']=function(_0x5d5544,_0x688f60,_0x4c8ea2){return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x5d5544[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x688f60,null))[_0x48bc('0x23')](function(_0x5c67b8){if(_0x5c67b8){return _0x5c67b8[_0x48bc('0x80')](null);}return null;})[_0x48bc('0x23')](respondWithStatusCode(_0x688f60,null))[_0x48bc('0x2b')](handleError(_0x688f60,null));};exports[_0x48bc('0x81')]=function(_0xf1b784,_0x9b079b,_0x2d4b7e){return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0xf1b784['params']['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x9b079b,null))[_0x48bc('0x23')](function(_0x1065c2){if(_0x1065c2){return _0x1065c2[_0x48bc('0x81')]();}return null;})[_0x48bc('0x23')](respondWithResult(_0x9b079b,null))[_0x48bc('0x2b')](handleError(_0x9b079b,null));};exports[_0x48bc('0x82')]=function(_0x5b07ee,_0x5404e3,_0x35b9ee){if(_0x5b07ee[_0x48bc('0x5e')]['id']){delete _0x5b07ee[_0x48bc('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x5b07ee[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x5404e3,null))[_0x48bc('0x23')](function(_0x4e64d7){if(_0x4e64d7){_0x5b07ee[_0x48bc('0x5e')][_0x48bc('0x6a')]=_0x4e64d7['id'];return db[_0x48bc('0x3c')]['create'](_0x5b07ee['body']);}})[_0x48bc('0x23')](respondWithResult(_0x5404e3,null))[_0x48bc('0x2b')](handleError(_0x5404e3,null));};exports[_0x48bc('0x83')]=function(_0x5b7e45,_0x552927,_0x1dd3be){return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x5b7e45[_0x48bc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x552927,null))[_0x48bc('0x23')](function(_0x2813ce){if(_0x2813ce){return _0x2813ce[_0x48bc('0x84')](null);}return null;})[_0x48bc('0x23')](respondWithStatusCode(_0x552927,null))[_0x48bc('0x2b')](handleError(_0x552927,null));};exports[_0x48bc('0x85')]=function(_0x428ccb,_0x16a9c7,_0x2ec9f1){return db[_0x48bc('0x86')][_0x48bc('0x5d')]({'where':{'id':_0x428ccb[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x16a9c7,null))[_0x48bc('0x23')](function(_0x3d5604){if(_0x3d5604){return _0x3d5604[_0x48bc('0x85')](_0x428ccb[_0x48bc('0x5e')][_0x48bc('0x67')],_[_0x48bc('0x87')](_0x428ccb[_0x48bc('0x5e')],[_0x48bc('0x67'),'id'])||{});}})[_0x48bc('0x23')](respondWithResult(_0x16a9c7,null))[_0x48bc('0x2b')](handleError(_0x16a9c7,null));};exports['getInteractions']=function(_0x2367b2,_0x45ea9f,_0x2f2980){var _0x2f0fe0={'raw':![],'where':{}};var _0x1322d1={};var _0x106aab={'count':0x0,'rows':[]};return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x2367b2[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x45ea9f,null))[_0x48bc('0x23')](function(_0x37717e){if(_0x37717e){_0x1322d1['model']=_[_0x48bc('0x44')](db[_0x48bc('0x86')][_0x48bc('0x5b')]);_0x1322d1[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x2367b2[_0x48bc('0x43')]);_0x1322d1[_0x48bc('0x45')]=_['intersection'](_0x1322d1[_0x48bc('0x48')],_0x1322d1[_0x48bc('0x43')]);_0x2f0fe0[_0x48bc('0x47')]=_['intersection'](_0x1322d1['model'],qs[_0x48bc('0x49')](_0x2367b2['query'][_0x48bc('0x49')]));_0x2f0fe0[_0x48bc('0x47')]=_0x2f0fe0[_0x48bc('0x47')][_0x48bc('0x4a')]?_0x2f0fe0[_0x48bc('0x47')]:_0x1322d1['model'];if(!_0x2367b2[_0x48bc('0x43')][_0x48bc('0x4b')]('nolimit')){_0x2f0fe0[_0x48bc('0x30')]=qs[_0x48bc('0x30')](_0x2367b2[_0x48bc('0x43')][_0x48bc('0x30')]);_0x2f0fe0[_0x48bc('0x2f')]=qs['offset'](_0x2367b2[_0x48bc('0x43')]['offset']);}_0x2f0fe0[_0x48bc('0x4d')]=qs['sort'](_0x2367b2['query']['sort']);_0x2f0fe0[_0x48bc('0x4f')]=qs['filters'](_[_0x48bc('0x50')](_0x2367b2['query'],_0x1322d1[_0x48bc('0x45')]));_0x2f0fe0[_0x48bc('0x4f')][_0x48bc('0x6a')]=_0x37717e['id'];if(_0x2367b2[_0x48bc('0x43')][_0x48bc('0x51')]){_0x2f0fe0[_0x48bc('0x4f')]=_[_0x48bc('0x52')](_0x2f0fe0['where'],{'$or':_[_0x48bc('0x3e')](_0x2f0fe0[_0x48bc('0x47')],function(_0x32cee6){var _0x4f361e={};_0x4f361e[_0x32cee6]={'$like':'%'+_0x2367b2[_0x48bc('0x43')]['filter']+'%'};return _0x4f361e;})});}_0x2f0fe0=_['merge']({},_0x2f0fe0,_0x2367b2[_0x48bc('0x54')]);return db[_0x48bc('0x86')][_0x48bc('0x55')]({'where':_0x2f0fe0['where']})[_0x48bc('0x23')](function(_0x4c7112){_0x106aab[_0x48bc('0x55')]=_0x4c7112;if(_0x2367b2[_0x48bc('0x43')]['includeAll']){_0x2f0fe0[_0x48bc('0x5c')]=[{'model':db[_0x48bc('0x88')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x48bc('0x89'),'internal'],'required':![]},{'model':db[_0x48bc('0x8a')],'as':_0x48bc('0x8b'),'attributes':['id',_0x48bc('0x38'),_0x48bc('0x8c')],'where':_0x2367b2[_0x48bc('0x43')]['tag']?{'id':_0x2367b2[_0x48bc('0x43')]['tag']}:undefined,'required':_0x2367b2[_0x48bc('0x43')][_0x48bc('0x8d')]?!![]:![]}];}return db[_0x48bc('0x86')]['findAll'](_0x2f0fe0);})[_0x48bc('0x23')](function(_0x11c62c){_0x106aab[_0x48bc('0x58')]=_0x11c62c;return _0x106aab;});}})[_0x48bc('0x23')](respondWithFilteredResult(_0x45ea9f,_0x2f0fe0))[_0x48bc('0x2b')](handleError(_0x45ea9f,null));};exports['addApplications']=function(_0x33e67f,_0x3b0afd,_0x2385f6){return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x33e67f[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x3b0afd,null))[_0x48bc('0x23')](function(_0x4cd65f){if(_0x4cd65f){return db['sequelize'][_0x48bc('0x8e')](function(_0x3ba390){return db[_0x48bc('0x8f')]['destroy']({'where':{'MailAccountId':_0x33e67f['params']['id']},'transaction':_0x3ba390})[_0x48bc('0x23')](function(_0x444ba0){var _0x493f3e=_[_0x48bc('0x3e')](_0x33e67f['body'],function(_0x51a409){_0x51a409[_0x48bc('0x6a')]=_0x33e67f[_0x48bc('0x5a')]['id'];return _0x51a409;});return db['MailApplication'][_0x48bc('0x90')](_0x493f3e,{'transaction':_0x3ba390});});})[_0x48bc('0x23')](function(){return db[_0x48bc('0x8f')]['findAndCountAll']({'where':{'MailAccountId':_0x33e67f[_0x48bc('0x5a')]['id']},'order':_0x48bc('0x91')});});}})[_0x48bc('0x23')](respondWithResult(_0x3b0afd,null))['catch'](handleError(_0x3b0afd,null));};exports[_0x48bc('0x92')]=function(_0x2408bb,_0x546575,_0xe6b935){var _0x4519f4={};var _0x2c7402={};var _0x4d78ea;var _0x469559;return db[_0x48bc('0x3f')]['findOne']({'where':{'id':_0x2408bb['params']['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x546575,null))['then'](function(_0x385c05){if(_0x385c05){_0x4d78ea=_0x385c05;_0x2c7402[_0x48bc('0x48')]=_[_0x48bc('0x44')](db[_0x48bc('0x8f')]['rawAttributes']);_0x2c7402[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x2408bb['query']);_0x2c7402[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0x2c7402[_0x48bc('0x48')],_0x2c7402[_0x48bc('0x43')]);_0x4519f4['attributes']=_[_0x48bc('0x46')](_0x2c7402['model'],qs[_0x48bc('0x49')](_0x2408bb['query'][_0x48bc('0x49')]));_0x4519f4[_0x48bc('0x47')]=_0x4519f4[_0x48bc('0x47')]['length']?_0x4519f4[_0x48bc('0x47')]:_0x2c7402['model'];_0x4519f4[_0x48bc('0x4d')]=qs[_0x48bc('0x4e')](_0x2408bb[_0x48bc('0x43')]['sort']);_0x4519f4[_0x48bc('0x4f')]=qs[_0x48bc('0x45')](_[_0x48bc('0x50')](_0x2408bb['query'],_0x2c7402[_0x48bc('0x45')]));if(_0x2408bb['query']['filter']){_0x4519f4[_0x48bc('0x4f')]=_[_0x48bc('0x52')](_0x4519f4['where'],{'$or':_[_0x48bc('0x3e')](_0x4519f4[_0x48bc('0x47')],function(_0x5180d7){var _0x4bc230={};_0x4bc230[_0x5180d7]={'$like':'%'+_0x2408bb[_0x48bc('0x43')]['filter']+'%'};return _0x4bc230;})});}_0x4519f4=_[_0x48bc('0x52')]({},_0x4519f4,_0x2408bb[_0x48bc('0x54')]);return _0x4d78ea[_0x48bc('0x92')](_0x4519f4);}})[_0x48bc('0x23')](function(_0x5e0e09){if(_0x5e0e09){_0x469559=_0x5e0e09[_0x48bc('0x4a')];if(!_0x2408bb[_0x48bc('0x43')][_0x48bc('0x4b')]('nolimit')){_0x4519f4[_0x48bc('0x30')]=qs['limit'](_0x2408bb[_0x48bc('0x43')][_0x48bc('0x30')]);_0x4519f4[_0x48bc('0x2f')]=qs[_0x48bc('0x2f')](_0x2408bb[_0x48bc('0x43')][_0x48bc('0x2f')]);}return _0x4d78ea[_0x48bc('0x92')](_0x4519f4);}})['then'](function(_0x3c441d){if(_0x3c441d){return _0x3c441d?{'count':_0x469559,'rows':_0x3c441d}:null;}})[_0x48bc('0x23')](respondWithResult(_0x546575,null))[_0x48bc('0x2b')](handleError(_0x546575,null));};exports[_0x48bc('0x93')]=function(_0x5b578c,_0x19794d,_0xe6134a){var _0x30c9df={'raw':!![],'where':{}};var _0x22216e={};var _0x5f0bcf={'count':0x0,'rows':[]};return db[_0x48bc('0x3f')]['findOne']({'where':{'id':_0x5b578c[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x19794d,null))['then'](function(_0x348644){if(_0x348644){_0x22216e['model']=_[_0x48bc('0x44')](db['MailMessage'][_0x48bc('0x5b')]);_0x22216e[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x5b578c[_0x48bc('0x43')]);_0x22216e[_0x48bc('0x45')]=_[_0x48bc('0x46')](_0x22216e['model'],_0x22216e[_0x48bc('0x43')]);_0x30c9df[_0x48bc('0x47')]=_[_0x48bc('0x46')](_0x22216e[_0x48bc('0x48')],qs[_0x48bc('0x49')](_0x5b578c[_0x48bc('0x43')][_0x48bc('0x49')]));_0x30c9df[_0x48bc('0x47')]=_0x30c9df['attributes'][_0x48bc('0x4a')]?_0x30c9df['attributes']:_0x22216e[_0x48bc('0x48')];if(!_0x5b578c[_0x48bc('0x43')]['hasOwnProperty']('nolimit')){_0x30c9df[_0x48bc('0x30')]=qs[_0x48bc('0x30')](_0x5b578c[_0x48bc('0x43')][_0x48bc('0x30')]);_0x30c9df['offset']=qs[_0x48bc('0x2f')](_0x5b578c['query']['offset']);}_0x30c9df[_0x48bc('0x4d')]=qs[_0x48bc('0x4e')](_0x5b578c[_0x48bc('0x43')][_0x48bc('0x4e')]);_0x30c9df[_0x48bc('0x4f')]=qs[_0x48bc('0x45')](_[_0x48bc('0x50')](_0x5b578c[_0x48bc('0x43')],_0x22216e['filters']));_0x30c9df[_0x48bc('0x4f')]['MailAccountId']=_0x348644['id'];if(_0x5b578c[_0x48bc('0x43')]['filter']){_0x30c9df['where']=_['merge'](_0x30c9df[_0x48bc('0x4f')],{'$or':_['map'](_0x30c9df['attributes'],function(_0x278b57){var _0x2b5a69={};_0x2b5a69[_0x278b57]={'$like':'%'+_0x5b578c['query'][_0x48bc('0x51')]+'%'};return _0x2b5a69;})});}if(_0x5b578c[_0x48bc('0x43')][_0x48bc('0x94')]){var _0x3266c1=_0x5b578c[_0x48bc('0x43')]['$gte'][_0x48bc('0x95')](',');var _0x440f3f={};_0x440f3f[_0x3266c1[0x0]]={'$gte':moment(_0x3266c1[0x1])[_0x48bc('0x96')](_0x48bc('0x97'))};_0x30c9df[_0x48bc('0x4f')]=_[_0x48bc('0x52')](_0x30c9df[_0x48bc('0x4f')],_0x440f3f);}_0x30c9df=_[_0x48bc('0x52')]({},_0x30c9df,_0x5b578c[_0x48bc('0x54')]);return db['MailMessage'][_0x48bc('0x55')]({'where':_0x30c9df[_0x48bc('0x4f')]})['then'](function(_0x30aac2){_0x5f0bcf['count']=_0x30aac2;if(_0x5b578c[_0x48bc('0x43')][_0x48bc('0x56')]){_0x30c9df[_0x48bc('0x5c')]=[{'all':!![]}];}return db[_0x48bc('0x98')][_0x48bc('0x57')](_0x30c9df);})[_0x48bc('0x23')](function(_0x5428bf){_0x5f0bcf['rows']=_0x5428bf;return _0x5f0bcf;});}})[_0x48bc('0x23')](respondWithFilteredResult(_0x19794d,_0x30c9df))[_0x48bc('0x2b')](handleError(_0x19794d,null));};exports[_0x48bc('0x99')]=function(_0x50d8a2,_0x1eda53,_0x581099){var _0x498bc7,_0x30c25f={},_0x2366ac;if(_0x50d8a2[_0x48bc('0x5e')]['to']){_0x2366ac=_0x50d8a2['body']['to'][_0x48bc('0x95')](',')[0x0];}return db['MailAccount'][_0x48bc('0x5d')]({'where':{'id':_0x50d8a2[_0x48bc('0x5a')]['id']},'include':[{'model':db[_0x48bc('0x9a')],'as':'List','include':[{'model':db[_0x48bc('0x88')],'as':_0x48bc('0x9b'),'where':{'email':_0x2366ac},'limit':0x1,'order':[[_0x48bc('0x9c'),_0x48bc('0x9d')]]}]},{'model':db[_0x48bc('0x3c')],'as':_0x48bc('0x5f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1eda53,null))['then'](function(_0x317c8f){if(_0x317c8f){_0x498bc7=_0x317c8f;if(_0x317c8f['Smtp']){if(_[_0x48bc('0x6e')](_0x50d8a2['body']['from'])){_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0x9e')]=util[_0x48bc('0x96')](_0x48bc('0x9f'),_0x317c8f[_0x48bc('0x38')],_0x317c8f[_0x48bc('0x6c')]||_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x72')]);}if(_0x50d8a2[_0x48bc('0x5e')]['attachments']&&_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xa0')]['length']){for(var _0x434e22=0x0;_0x434e22<_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xa0')][_0x48bc('0x4a')];_0x434e22+=0x1){_0x50d8a2['body'][_0x48bc('0xa0')][_0x434e22]={'filename':_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xa0')][_0x434e22][_0x48bc('0x38')],'path':path[_0x48bc('0xa1')](config[_0x48bc('0xa2')],_0x48bc('0xa3'),_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xa0')][_0x434e22]['basename'])};}}var _0x9a4298={'tls':{'rejectUnauthorized':![]}};if(_[_0x48bc('0x6e')](_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x79')])){if(_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x76')]){_0x9a4298[_0x48bc('0xa4')]={'user':_0x317c8f[_0x48bc('0x5f')]['user'],'pass':_0x317c8f['Smtp']['pass']};}_0x9a4298['host']=_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x77')];_0x9a4298[_0x48bc('0x78')]=_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x78')];_0x9a4298[_0x48bc('0xa5')]=_0x317c8f[_0x48bc('0x5f')][_0x48bc('0xa5')];}else{_0x9a4298[_0x48bc('0x79')]=_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x79')];_0x9a4298[_0x48bc('0xa4')]={'user':_0x317c8f[_0x48bc('0x5f')][_0x48bc('0x72')],'pass':_0x317c8f['Smtp'][_0x48bc('0x74')]};}return respondWithRpcPromise(_0x48bc('0xa6'),_0x48bc('0xa7'),{'account':_0x9a4298,'message':_0x50d8a2[_0x48bc('0x5e')]});}else{throw new Error(_0x48bc('0xa8'));}}})['then'](function(_0x5406b5){if(_0x5406b5){_0x30c25f=_0x5406b5;if(_0x498bc7['List']){if(_0x498bc7[_0x48bc('0xa9')][_0x48bc('0x9b')]['length']){return _0x498bc7[_0x48bc('0xa9')][_0x48bc('0x9b')][0x0];}else{return db['CmContact'][_0x48bc('0x63')](_[_0x48bc('0x18')](_0x50d8a2[_0x48bc('0x5e')],{'firstName':_0x50d8a2[_0x48bc('0x5e')]['to'],'email':_0x50d8a2['body']['to'],'phone':_0x50d8a2[_0x48bc('0x5e')]['to'],'ListId':_0x498bc7[_0x48bc('0x6d')]}));}}else{throw new Error(_0x48bc('0xa8'));}}})[_0x48bc('0x23')](function(_0xe3f949){if(_0xe3f949){var _0x1e65b8={'UserId':_0x50d8a2[_0x48bc('0x72')]['id'],'ContactId':_0xe3f949['id'],'MailAccountId':_0x498bc7['id'],'inReplyTo':_0x30c25f[_0x48bc('0xaa')],'to':_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0x9e')],'cc':_0x50d8a2['body']['cc'],'subject':_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xab')],'attach':_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xac')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x48bc('0x96')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x48bc('0xad'),'lastMsgBody':_0x50d8a2[_0x48bc('0x5e')]['body'],'Messages':[_[_0x48bc('0x52')](_0x50d8a2['body'],{'messageId':_0x30c25f[_0x48bc('0xaa')],'sentAt':moment()['format'](_0x48bc('0x97')),'read':!![],'MailAccountId':_0x498bc7['id'],'UserId':_0x50d8a2[_0x48bc('0x72')]['id'],'ContactId':_0xe3f949['id']})]};if(_0x50d8a2['body'][_0x48bc('0xae')]){_0x1e65b8=_[_0x48bc('0x52')](_0x1e65b8,_0x50d8a2[_0x48bc('0x5e')][_0x48bc('0xae')]);}return db['MailInteraction'][_0x48bc('0x63')](_0x1e65b8,{'include':[{'model':db[_0x48bc('0x98')],'as':_0x48bc('0xaf')}]});}})['then'](respondWithResult(_0x1eda53,null))[_0x48bc('0x2b')](handleError(_0x1eda53,null));};exports[_0x48bc('0xb0')]=function(_0x4db5b3,_0x4be757,_0x812d50){return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x4db5b3[_0x48bc('0x5a')]['id']},'include':[{'model':db[_0x48bc('0x3c')],'as':_0x48bc('0x5f'),'raw':!![]}]})[_0x48bc('0x23')](handleEntityNotFound(_0x4be757,null))[_0x48bc('0x23')](function(_0x75d0){if(_0x75d0&&_0x75d0['Smtp']){var _0x234735={'id':_0x75d0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x75d0['Smtp'][_0x48bc('0x79')]){_0x234735['service']=_0x75d0[_0x48bc('0x5f')][_0x48bc('0x79')];}else{_0x234735['host']=_0x75d0[_0x48bc('0x5f')][_0x48bc('0x77')];_0x234735[_0x48bc('0x78')]=_0x75d0['Smtp'][_0x48bc('0x78')];_0x234735['secure']=_0x75d0['Smtp'][_0x48bc('0xa5')];}if(_0x75d0[_0x48bc('0x5f')][_0x48bc('0x76')]){_0x234735['auth']={'user':_0x75d0[_0x48bc('0x5f')][_0x48bc('0x72')],'pass':_0x75d0[_0x48bc('0x5f')][_0x48bc('0x74')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x234735});}})[_0x48bc('0x23')](respondWithResult(_0x4be757,null))[_0x48bc('0x2b')](handleError(_0x4be757,null));};exports[_0x48bc('0x35')]=function(_0x55a24e,_0x1836e1){return db['MailAccount'][_0x48bc('0x5d')]({'where':{'id':_0x55a24e[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x1836e1,null))[_0x48bc('0x23')](function(_0x237916){if(_0x237916&&_0x237916['service']){throw new db['Sequelize'][(_0x48bc('0x20'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x237916;})[_0x48bc('0x23')](removeEntity(_0x1836e1,null))[_0x48bc('0x2b')](handleError(_0x1836e1,null));};exports[_0x48bc('0xb1')]=function(_0x5529fc,_0x16ddef,_0x55fc0a){return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x5529fc[_0x48bc('0x5a')]['id']}})[_0x48bc('0x23')](handleEntityNotFound(_0x16ddef,null))[_0x48bc('0x23')](function(_0x2f1a97){if(_0x2f1a97){return _0x2f1a97[_0x48bc('0xb1')](_0x5529fc['body'][_0x48bc('0x67')],_[_0x48bc('0x87')](_0x5529fc['body'],[_0x48bc('0x67'),'id'])||{})['spread'](function(_0x7bf5ec){for(var _0x12debf=0x0;_0x12debf<_0x5529fc['body'][_0x48bc('0x67')][_0x48bc('0x4a')];_0x12debf+=0x1){socket[_0x48bc('0xb2')](_0x48bc('0xb3'),{'UserId':_0x5529fc[_0x48bc('0x5e')][_0x48bc('0x67')][_0x12debf],'MailAccountId':_0x5529fc['params']['id']});}return _0x7bf5ec;});}})[_0x48bc('0x23')](respondWithResult(_0x16ddef,null))['catch'](handleError(_0x16ddef,null));};exports[_0x48bc('0xb4')]=function(_0x52de96,_0x3a0aba,_0x1724d9){return db[_0x48bc('0x3f')][_0x48bc('0x5d')]({'where':{'id':_0x52de96[_0x48bc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a0aba,null))[_0x48bc('0x23')](function(_0x4b6585){if(_0x4b6585){return _0x4b6585['removeAgents'](_0x52de96[_0x48bc('0x43')][_0x48bc('0x67')])[_0x48bc('0x23')](function(){if(_['isArray'](_0x52de96['query'][_0x48bc('0x67')])){for(var _0xa63494=0x0;_0xa63494<_0x52de96[_0x48bc('0x43')][_0x48bc('0x67')][_0x48bc('0x4a')];_0xa63494+=0x1){socket[_0x48bc('0xb2')]('userMailAccount:remove',{'UserId':Number(_0x52de96[_0x48bc('0x43')]['ids'][_0xa63494]),'MailAccountId':Number(_0x52de96[_0x48bc('0x5a')]['id'])});}}else{socket[_0x48bc('0xb2')](_0x48bc('0xb5'),{'UserId':Number(_0x52de96[_0x48bc('0x43')]['ids']),'MailAccountId':Number(_0x52de96['params']['id'])});}});}})[_0x48bc('0x23')](respondWithStatusCode(_0x3a0aba,null))[_0x48bc('0x2b')](handleError(_0x3a0aba,null));};exports[_0x48bc('0xb6')]=function(_0x30d8df,_0x1cbc20,_0x2039ba){var _0x174670={};var _0x2471d0={};var _0x406b9a;var _0xdaa3c;return db[_0x48bc('0x3f')][_0x48bc('0x65')]({'where':{'id':_0x30d8df[_0x48bc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1cbc20,null))[_0x48bc('0x23')](function(_0x3a85b){if(_0x3a85b){_0x406b9a=_0x3a85b;_0x2471d0[_0x48bc('0x48')]=_[_0x48bc('0x44')](db['User']['rawAttributes']);_0x2471d0[_0x48bc('0x43')]=_[_0x48bc('0x44')](_0x30d8df[_0x48bc('0x43')]);_0x2471d0['filters']=_[_0x48bc('0x46')](_0x2471d0[_0x48bc('0x48')],_0x2471d0[_0x48bc('0x43')]);_0x174670['attributes']=_[_0x48bc('0x46')](_0x2471d0[_0x48bc('0x48')],qs[_0x48bc('0x49')](_0x30d8df[_0x48bc('0x43')][_0x48bc('0x49')]));_0x174670[_0x48bc('0x47')]=_0x174670[_0x48bc('0x47')][_0x48bc('0x4a')]?_0x174670[_0x48bc('0x47')]:_0x2471d0[_0x48bc('0x48')];_0x174670['order']=qs[_0x48bc('0x4e')](_0x30d8df[_0x48bc('0x43')]['sort']);_0x174670['where']=qs[_0x48bc('0x45')](_[_0x48bc('0x50')](_0x30d8df[_0x48bc('0x43')],_0x2471d0['filters']));if(_0x30d8df['query'][_0x48bc('0x51')]){_0x174670[_0x48bc('0x4f')]=_[_0x48bc('0x52')](_0x174670[_0x48bc('0x4f')],{'$or':_[_0x48bc('0x3e')](_0x174670[_0x48bc('0x47')],function(_0x25cf71){var _0x1d05db={};_0x1d05db[_0x25cf71]={'$like':'%'+_0x30d8df[_0x48bc('0x43')]['filter']+'%'};return _0x1d05db;})});}_0x174670=_[_0x48bc('0x52')]({},_0x174670,_0x30d8df[_0x48bc('0x54')]);return _0x406b9a['getAgents'](_0x174670);}})[_0x48bc('0x23')](function(_0x32363a){if(_0x32363a){_0xdaa3c=_0x32363a[_0x48bc('0x4a')];if(!_0x30d8df[_0x48bc('0x43')]['hasOwnProperty']('nolimit')){_0x174670['limit']=qs['limit'](_0x30d8df[_0x48bc('0x43')][_0x48bc('0x30')]);_0x174670[_0x48bc('0x2f')]=qs[_0x48bc('0x2f')](_0x30d8df[_0x48bc('0x43')]['offset']);}return _0x406b9a['getAgents'](_0x174670);}})[_0x48bc('0x23')](function(_0x1eaa4b){if(_0x1eaa4b){return _0x1eaa4b?{'count':_0xdaa3c,'rows':_0x1eaa4b}:null;}})['then'](respondWithResult(_0x1cbc20,null))[_0x48bc('0x2b')](handleError(_0x1cbc20,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index e1aa4ee..3beab63 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 _0x73bf=['update','remove','emit','hasOwnProperty','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x73bf,0x107));var _0xf73b=function(_0x354861,_0x450659){_0x354861=_0x354861-0x0;var _0x7fa747=_0x73bf[_0x354861];return _0x7fa747;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xf73b('0x0'))['db'][_0xf73b('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf73b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf73b('0x3'),'afterDestroy':_0xf73b('0x4')};function emitEvent(_0x4294c2){return function(_0x46501f,_0x341d58,_0x556980){MailAccountEvents['emit'](_0x4294c2+':'+_0x46501f['id'],_0x46501f);MailAccountEvents[_0xf73b('0x5')](_0x4294c2,_0x46501f);_0x556980(null);};}for(var e in events){if(events[_0xf73b('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x9c59=['../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c59,0x155));var _0x99c5=function(_0x33425d,_0x4204aa){_0x33425d=_0x33425d-0x0;var _0x2d926b=_0x9c59[_0x33425d];return _0x2d926b;};'use strict';var EventEmitter=require(_0x99c5('0x0'));var MailAccount=require(_0x99c5('0x1'))['db'][_0x99c5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x99c5('0x3'),'afterUpdate':_0x99c5('0x4'),'afterDestroy':_0x99c5('0x5')};function emitEvent(_0x1494f5){return function(_0x16e287,_0x3b2106,_0x12ad22){MailAccountEvents[_0x99c5('0x6')](_0x1494f5+':'+_0x16e287['id'],_0x16e287);MailAccountEvents['emit'](_0x1494f5,_0x16e287);_0x12ad22(null);};}for(var e in events){if(events[_0x99c5('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x99c5('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 897fd14..2ff638c 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 _0xe0db=['moment','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','../../config/logger','api'];(function(_0x2e3d68,_0x34266b){var _0x43db1d=function(_0x375ebe){while(--_0x375ebe){_0x2e3d68['push'](_0x2e3d68['shift']());}};_0x43db1d(++_0x34266b);}(_0xe0db,0x65));var _0xbe0d=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xe0db[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xbe0d('0x0'));var util=require('util');var logger=require(_0xbe0d('0x1'))(_0xbe0d('0x2'));var moment=require(_0xbe0d('0x3'));var BPromise=require(_0xbe0d('0x4'));var rp=require(_0xbe0d('0x5'));var fs=require('fs');var path=require(_0xbe0d('0x6'));var rimraf=require('rimraf');var config=require(_0xbe0d('0x7'));var attributes=require(_0xbe0d('0x8'));module[_0xbe0d('0x9')]=function(_0xcab340,_0x59b458){return _0xcab340[_0xbe0d('0xa')](_0xbe0d('0xb'),attributes,{'tableName':_0xbe0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b0c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b0c,0x1af));var _0xc6b0=function(_0x2eca15,_0x33be5d){_0x2eca15=_0x2eca15-0x0;var _0x5a2ed6=_0x6b0c[_0x2eca15];return _0x5a2ed6;};'use strict';var _=require(_0xc6b0('0x0'));var util=require(_0xc6b0('0x1'));var logger=require(_0xc6b0('0x2'))('api');var moment=require(_0xc6b0('0x3'));var BPromise=require(_0xc6b0('0x4'));var rp=require(_0xc6b0('0x5'));var fs=require('fs');var path=require(_0xc6b0('0x6'));var rimraf=require(_0xc6b0('0x7'));var config=require(_0xc6b0('0x8'));var attributes=require(_0xc6b0('0x9'));module[_0xc6b0('0xa')]=function(_0x1cb31b,_0xb9035c){return _0x1cb31b[_0xc6b0('0xb')](_0xc6b0('0xc'),attributes,{'tableName':_0xc6b0('0xd'),'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 d003fce..584647e 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 _0x1ddc=['spread','update','originTo','Attachment','Attachments','UserId','User','interaction','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','MailApplication','MailServerOut','Smtp','get','Applications','list','applications','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x12d117,_0x2b180a){_0x12d117=_0x12d117-0x0;var _0x1046bf=_0x1ddc[_0x12d117];return _0x1046bf;};'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':0x232c});config[_0xc1dd('0x9')]=_[_0xc1dd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc1dd('0xb'))(new Redis(config[_0xc1dd('0x9')]));require(_0xc1dd('0xc'))[_0xc1dd('0xd')](socket);function respondWithRpcPromise(_0x495e17,_0x38b62e,_0x1b4b3f){return new BPromise(function(_0xa720ed,_0xccdb4e){return client['request'](_0x495e17,_0x1b4b3f)[_0xc1dd('0xe')](function(_0x1d28a7){logger[_0xc1dd('0xf')](_0xc1dd('0x10'),_0x38b62e,_0xc1dd('0x11'));logger[_0xc1dd('0x12')](_0xc1dd('0x13'),_0x38b62e,_0xc1dd('0x11'),JSON[_0xc1dd('0x14')](_0x1d28a7));if(_0x1d28a7[_0xc1dd('0x15')]){if(_0x1d28a7[_0xc1dd('0x15')]['code']===0x1f4){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xccdb4e(_0x1d28a7[_0xc1dd('0x15')]['message']);}logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xa720ed(_0x1d28a7['error']['message']);}else{logger[_0xc1dd('0xf')]('MailAccount,\x20%s,\x20%s',_0x38b62e,_0xc1dd('0x11'));_0xa720ed(_0x1d28a7['result'][_0xc1dd('0x16')]);}})[_0xc1dd('0x17')](function(_0x288abd){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x288abd);_0xccdb4e(_0x288abd);});});}exports[_0xc1dd('0x18')]=function(_0x568a6b){var _0x459da6=this;return new Promise(function(_0x1ab21b,_0x5e99a6){return db[_0xc1dd('0x19')][_0xc1dd('0x1a')]({'raw':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1d')]||null:null,'attributes':_0x568a6b['options']?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1e')]||null:null,'limit':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')]['limit']||null:null,'include':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1f')]?_[_0xc1dd('0x20')](_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1f')],function(_0x3c3a32){return{'model':db[_0x3c3a32[_0xc1dd('0x21')]],'as':_0x3c3a32['as'],'attributes':_0x3c3a32[_0xc1dd('0x1e')],'include':_0x3c3a32[_0xc1dd('0x1f')]?_[_0xc1dd('0x20')](_0x3c3a32[_0xc1dd('0x1f')],function(_0x1d3b04){return{'model':db[_0x1d3b04[_0xc1dd('0x21')]],'as':_0x1d3b04['as'],'attributes':_0x1d3b04['attributes'],'include':_0x1d3b04['include']?_[_0xc1dd('0x20')](_0x1d3b04[_0xc1dd('0x1f')],function(_0x25a651){return{'model':db[_0x25a651[_0xc1dd('0x21')]],'as':_0x25a651['as'],'attributes':_0x25a651[_0xc1dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc1dd('0xe')](function(_0x16ee31){logger['info'](_0xc1dd('0x18'),_0x568a6b);logger[_0xc1dd('0x12')](_0xc1dd('0x18'),_0x568a6b,JSON[_0xc1dd('0x14')](_0x16ee31));_0x1ab21b(_0x16ee31);})['catch'](function(_0x14b1d4){logger[_0xc1dd('0x15')](_0xc1dd('0x18'),_0x14b1d4['message'],_0x568a6b);_0x5e99a6(_0x459da6[_0xc1dd('0x15')](0x1f4,_0x14b1d4['message']));});});};exports[_0xc1dd('0x22')]=function(_0x2b7eb0){var _0x3fe749=this;return new Promise(function(_0x5a60dd,_0x7541a2){return db[_0xc1dd('0x19')][_0xc1dd('0x23')]({'raw':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0['options'][_0xc1dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0[_0xc1dd('0x1b')]['where']||null:null,'attributes':_0x2b7eb0['options']?_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1e')]||null:null,'include':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1f')]?_['map'](_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1f')],function(_0x544b71){return{'model':db[_0x544b71[_0xc1dd('0x21')]],'as':_0x544b71['as'],'attributes':_0x544b71[_0xc1dd('0x1e')],'include':_0x544b71[_0xc1dd('0x1f')]?_['map'](_0x544b71[_0xc1dd('0x1f')],function(_0x537f1b){return{'model':db[_0x537f1b[_0xc1dd('0x21')]],'as':_0x537f1b['as'],'attributes':_0x537f1b[_0xc1dd('0x1e')],'include':_0x537f1b['include']?_[_0xc1dd('0x20')](_0x537f1b[_0xc1dd('0x1f')],function(_0x28723c){return{'model':db[_0x28723c[_0xc1dd('0x21')]],'as':_0x28723c['as'],'attributes':_0x28723c[_0xc1dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc1dd('0xe')](function(_0x257b69){logger[_0xc1dd('0xf')](_0xc1dd('0x22'),_0x2b7eb0);logger[_0xc1dd('0x12')](_0xc1dd('0x22'),_0x2b7eb0,JSON[_0xc1dd('0x14')](_0x257b69));_0x5a60dd(_0x257b69);})['catch'](function(_0x3f7a0f){logger['error'](_0xc1dd('0x22'),_0x3f7a0f[_0xc1dd('0x16')],_0x2b7eb0);_0x7541a2(_0x3fe749[_0xc1dd('0x15')](0x1f4,_0x3f7a0f[_0xc1dd('0x16')]));});});};exports[_0xc1dd('0x24')]=function(_0x45919b){var _0x17743b=this;return new Promise(function(_0x583688,_0x12c56d){var _0x5b5d76={'body':_0x45919b[_0xc1dd('0x25')],'channel':_0xc1dd('0x26')};var _0x6b416d=_[_0xc1dd('0x27')](_[_0xc1dd('0x28')](db[_0xc1dd('0x29')][_0xc1dd('0x2a')]),['createdAt',_0xc1dd('0x2b'),_0xc1dd('0x2c'),_0xc1dd('0x2d')]);var _0x5207f2=![];if(_0x45919b[_0xc1dd('0x25')]['id']){delete _0x45919b[_0xc1dd('0x25')]['id'];}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x30')));}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')]['body'])||_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x25')]===''){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x31')));}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b416d));}if(!_['includes'](_0x6b416d,_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x33')+_0x6b416d));}var _0x1c95f3={};_0x1c95f3[_0x45919b[_0xc1dd('0x25')]['mapKey']]=_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')];return db[_0xc1dd('0x19')][_0xc1dd('0x23')]({'where':{'id':_0x45919b[_0xc1dd('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xc1dd('0x35'),'include':[{'model':db[_0xc1dd('0x29')],'as':'Contacts','where':_0x1c95f3,'limit':0x1,'order':[[_0xc1dd('0x2b'),_0xc1dd('0x36')]]}]},{'model':db[_0xc1dd('0x37')],'as':'Applications'},{'model':db[_0xc1dd('0x38')],'as':_0xc1dd('0x39')}]})['then'](function(_0x32c086){if(_0x32c086&&_0x32c086[_0xc1dd('0x35')]){var _0x4188ae=_0x32c086[_0xc1dd('0x3a')]({'plain':!![]});_0x5b5d76['account']=_['omit'](_0x4188ae,[_0xc1dd('0x3b'),'List']);_0x5b5d76['applications']=_0x4188ae['Applications'];_0x5b5d76[_0xc1dd('0x3c')]=_0x4188ae[_0xc1dd('0x35')];_0x5b5d76[_0xc1dd('0x3d')]=_['orderBy'](_0x5b5d76[_0xc1dd('0x3d')],[_0xc1dd('0x3e')],[_0xc1dd('0x3f')]);if(_0x5b5d76[_0xc1dd('0x34')]&&_0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x40')]){_0x5b5d76[_0xc1dd('0x3d')][_0xc1dd('0x41')]({'id':0x0,'priority':_0x5b5d76[_0xc1dd('0x3d')][_0xc1dd('0x42')]+0x1,'app':_0xc1dd('0x43'),'appdata':'autoclose','interval':_0xc1dd('0x44')});}if(_0x5b5d76[_0xc1dd('0x34')]['Applications']){delete _0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x3b')];}if(_0x5b5d76[_0xc1dd('0x34')]['List']){delete _0x5b5d76[_0xc1dd('0x34')]['List'];}if(_0x4188ae[_0xc1dd('0x35')][_0xc1dd('0x45')][_0xc1dd('0x42')]){return _0x4188ae[_0xc1dd('0x35')][_0xc1dd('0x45')][0x0];}var _0x5980c8=_['defaults'](_0x45919b[_0xc1dd('0x25')],{'firstName':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')],'ListId':_0x4188ae[_0xc1dd('0x2d')]});_0x5980c8[_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')]]=_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')];return db[_0xc1dd('0x29')][_0xc1dd('0x46')](_0x5980c8);}else{throw new Error(_0xc1dd('0x47'));}})[_0xc1dd('0xe')](function(_0x1618c9){_0x5b5d76[_0xc1dd('0x48')]=_0x1618c9;if(_0x1618c9){if(!_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')]){_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')]=rs[_0xc1dd('0x4a')]()+'\x20'+_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x2f')];}var _0x523e99={'ContactId':_0x1618c9['id'],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id'],'inReplyTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'to':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x2f')],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4b')],'attach':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4c')],'lastMsgAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x25')]};return db[_0xc1dd('0x4f')][_0xc1dd('0x23')]({'where':{'closed':![],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id']},'include':[{'model':db[_0xc1dd('0x50')],'as':_0xc1dd('0x51'),'attributes':[_0xc1dd('0x49')],'where':{'messageId':_0x45919b['body'][_0xc1dd('0x16')][_0xc1dd('0x52')]}}]})[_0xc1dd('0xe')](function(_0x57891e){if(_0x57891e){return[_0x57891e,![]];}return db[_0xc1dd('0x4f')][_0xc1dd('0x46')](_0x523e99)[_0xc1dd('0xe')](function(_0x51ef0b){return[_0x51ef0b,!![]];});});}else{throw new Error(_0xc1dd('0x53'));}})[_0xc1dd('0x54')](function(_0x71e293,_0x2f306d){if(_0x71e293){_0x5207f2=_0x2f306d;if(!_0x2f306d){return _0x71e293[_0xc1dd('0x55')]({'inReplyTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'to':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['from'],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4b')],'attach':_0x71e293[_0xc1dd('0x4c')]?_0x71e293[_0xc1dd('0x4c')]:_0x45919b['body'][_0xc1dd('0x16')][_0xc1dd('0x4c')],'substatus':null,'substatusAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x45919b['body'][_0xc1dd('0x25')]});}else{return _0x71e293;}}})[_0xc1dd('0xe')](function(_0x36f969){_0x5b5d76['interaction']=_0x36f969[_0xc1dd('0x3a')]({'plain':!![]});_0x5b5d76['interaction']['created']=_0x5207f2;return db['MailMessage'][_0xc1dd('0x46')]({'body':_0x45919b['body'][_0xc1dd('0x25')],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id'],'MailInteractionId':_0x36f969['id'],'direction':'in','ContactId':_0x5b5d76[_0xc1dd('0x48')]['id'],'messageId':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'from':_0x45919b[_0xc1dd('0x25')]['message'][_0xc1dd('0x2f')],'to':_0x45919b[_0xc1dd('0x25')]['message']['to'],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')]['message']['subject'],'attach':_0x45919b[_0xc1dd('0x25')]['message'][_0xc1dd('0x4c')],'Attachments':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['attachments'],'originTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x56')],'originCc':_0x45919b[_0xc1dd('0x25')]['message']['originCc'],'bcc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['bcc']},{'include':[{'model':db[_0xc1dd('0x57')],'as':_0xc1dd('0x58')}]});})[_0xc1dd('0xe')](function(_0x181311){_0x5b5d76['message']=_0x181311;if(_0x5b5d76['interaction'][_0xc1dd('0x59')]){return db[_0xc1dd('0x5a')][_0xc1dd('0x23')]({'attributes':['id','name'],'where':{'id':_0x5b5d76[_0xc1dd('0x5b')]['UserId']}})[_0xc1dd('0xe')](function(_0x3cea20){if(_0x3cea20){_0x5b5d76['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xc1dd('0x5c'),'appdata':_0x3cea20[_0xc1dd('0x5d')]+','+(_0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x5e')]||0xa),'interval':_0xc1dd('0x44')});}return respondWithRpcPromise(_0xc1dd('0x5f'),_0xc1dd('0x60'),_0x5b5d76);});}return respondWithRpcPromise('Start',_0xc1dd('0x60'),_0x5b5d76);})[_0xc1dd('0xe')](function(_0x4ffb8c){_0x583688(_0x4ffb8c);})[_0xc1dd('0x17')](function(_0x558bd9){_0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0x558bd9[_0xc1dd('0x16')]));});});}; \ No newline at end of file +var _0x1ddc=['spread','update','originTo','Attachment','Attachments','UserId','User','interaction','agent','name','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','MailApplication','MailServerOut','Smtp','get','Applications','list','applications','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x213a03,_0x327412){_0x213a03=_0x213a03-0x0;var _0x2c7ff2=_0x1ddc[_0x213a03];return _0x2c7ff2;};'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':0x232c});config[_0xc1dd('0x9')]=_[_0xc1dd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc1dd('0xb'))(new Redis(config[_0xc1dd('0x9')]));require(_0xc1dd('0xc'))[_0xc1dd('0xd')](socket);function respondWithRpcPromise(_0x495e17,_0x38b62e,_0x1b4b3f){return new BPromise(function(_0xa720ed,_0xccdb4e){return client['request'](_0x495e17,_0x1b4b3f)[_0xc1dd('0xe')](function(_0x1d28a7){logger[_0xc1dd('0xf')](_0xc1dd('0x10'),_0x38b62e,_0xc1dd('0x11'));logger[_0xc1dd('0x12')](_0xc1dd('0x13'),_0x38b62e,_0xc1dd('0x11'),JSON[_0xc1dd('0x14')](_0x1d28a7));if(_0x1d28a7[_0xc1dd('0x15')]){if(_0x1d28a7[_0xc1dd('0x15')]['code']===0x1f4){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xccdb4e(_0x1d28a7[_0xc1dd('0x15')]['message']);}logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xa720ed(_0x1d28a7['error']['message']);}else{logger[_0xc1dd('0xf')]('MailAccount,\x20%s,\x20%s',_0x38b62e,_0xc1dd('0x11'));_0xa720ed(_0x1d28a7['result'][_0xc1dd('0x16')]);}})[_0xc1dd('0x17')](function(_0x288abd){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x288abd);_0xccdb4e(_0x288abd);});});}exports[_0xc1dd('0x18')]=function(_0x568a6b){var _0x459da6=this;return new Promise(function(_0x1ab21b,_0x5e99a6){return db[_0xc1dd('0x19')][_0xc1dd('0x1a')]({'raw':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1d')]||null:null,'attributes':_0x568a6b['options']?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1e')]||null:null,'limit':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')]['limit']||null:null,'include':_0x568a6b[_0xc1dd('0x1b')]?_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1f')]?_[_0xc1dd('0x20')](_0x568a6b[_0xc1dd('0x1b')][_0xc1dd('0x1f')],function(_0x3c3a32){return{'model':db[_0x3c3a32[_0xc1dd('0x21')]],'as':_0x3c3a32['as'],'attributes':_0x3c3a32[_0xc1dd('0x1e')],'include':_0x3c3a32[_0xc1dd('0x1f')]?_[_0xc1dd('0x20')](_0x3c3a32[_0xc1dd('0x1f')],function(_0x1d3b04){return{'model':db[_0x1d3b04[_0xc1dd('0x21')]],'as':_0x1d3b04['as'],'attributes':_0x1d3b04['attributes'],'include':_0x1d3b04['include']?_[_0xc1dd('0x20')](_0x1d3b04[_0xc1dd('0x1f')],function(_0x25a651){return{'model':db[_0x25a651[_0xc1dd('0x21')]],'as':_0x25a651['as'],'attributes':_0x25a651[_0xc1dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc1dd('0xe')](function(_0x16ee31){logger['info'](_0xc1dd('0x18'),_0x568a6b);logger[_0xc1dd('0x12')](_0xc1dd('0x18'),_0x568a6b,JSON[_0xc1dd('0x14')](_0x16ee31));_0x1ab21b(_0x16ee31);})['catch'](function(_0x14b1d4){logger[_0xc1dd('0x15')](_0xc1dd('0x18'),_0x14b1d4['message'],_0x568a6b);_0x5e99a6(_0x459da6[_0xc1dd('0x15')](0x1f4,_0x14b1d4['message']));});});};exports[_0xc1dd('0x22')]=function(_0x2b7eb0){var _0x3fe749=this;return new Promise(function(_0x5a60dd,_0x7541a2){return db[_0xc1dd('0x19')][_0xc1dd('0x23')]({'raw':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0['options'][_0xc1dd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0[_0xc1dd('0x1b')]['where']||null:null,'attributes':_0x2b7eb0['options']?_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1e')]||null:null,'include':_0x2b7eb0[_0xc1dd('0x1b')]?_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1f')]?_['map'](_0x2b7eb0[_0xc1dd('0x1b')][_0xc1dd('0x1f')],function(_0x544b71){return{'model':db[_0x544b71[_0xc1dd('0x21')]],'as':_0x544b71['as'],'attributes':_0x544b71[_0xc1dd('0x1e')],'include':_0x544b71[_0xc1dd('0x1f')]?_['map'](_0x544b71[_0xc1dd('0x1f')],function(_0x537f1b){return{'model':db[_0x537f1b[_0xc1dd('0x21')]],'as':_0x537f1b['as'],'attributes':_0x537f1b[_0xc1dd('0x1e')],'include':_0x537f1b['include']?_[_0xc1dd('0x20')](_0x537f1b[_0xc1dd('0x1f')],function(_0x28723c){return{'model':db[_0x28723c[_0xc1dd('0x21')]],'as':_0x28723c['as'],'attributes':_0x28723c[_0xc1dd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc1dd('0xe')](function(_0x257b69){logger[_0xc1dd('0xf')](_0xc1dd('0x22'),_0x2b7eb0);logger[_0xc1dd('0x12')](_0xc1dd('0x22'),_0x2b7eb0,JSON[_0xc1dd('0x14')](_0x257b69));_0x5a60dd(_0x257b69);})['catch'](function(_0x3f7a0f){logger['error'](_0xc1dd('0x22'),_0x3f7a0f[_0xc1dd('0x16')],_0x2b7eb0);_0x7541a2(_0x3fe749[_0xc1dd('0x15')](0x1f4,_0x3f7a0f[_0xc1dd('0x16')]));});});};exports[_0xc1dd('0x24')]=function(_0x45919b){var _0x17743b=this;return new Promise(function(_0x583688,_0x12c56d){var _0x5b5d76={'body':_0x45919b[_0xc1dd('0x25')],'channel':_0xc1dd('0x26')};var _0x6b416d=_[_0xc1dd('0x27')](_[_0xc1dd('0x28')](db[_0xc1dd('0x29')][_0xc1dd('0x2a')]),['createdAt',_0xc1dd('0x2b'),_0xc1dd('0x2c'),_0xc1dd('0x2d')]);var _0x5207f2=![];if(_0x45919b[_0xc1dd('0x25')]['id']){delete _0x45919b[_0xc1dd('0x25')]['id'];}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x30')));}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')]['body'])||_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x25')]===''){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x31')));}if(_[_0xc1dd('0x2e')](_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b416d));}if(!_['includes'](_0x6b416d,_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')])){return _0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0xc1dd('0x33')+_0x6b416d));}var _0x1c95f3={};_0x1c95f3[_0x45919b[_0xc1dd('0x25')]['mapKey']]=_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')];return db[_0xc1dd('0x19')][_0xc1dd('0x23')]({'where':{'id':_0x45919b[_0xc1dd('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xc1dd('0x35'),'include':[{'model':db[_0xc1dd('0x29')],'as':'Contacts','where':_0x1c95f3,'limit':0x1,'order':[[_0xc1dd('0x2b'),_0xc1dd('0x36')]]}]},{'model':db[_0xc1dd('0x37')],'as':'Applications'},{'model':db[_0xc1dd('0x38')],'as':_0xc1dd('0x39')}]})['then'](function(_0x32c086){if(_0x32c086&&_0x32c086[_0xc1dd('0x35')]){var _0x4188ae=_0x32c086[_0xc1dd('0x3a')]({'plain':!![]});_0x5b5d76['account']=_['omit'](_0x4188ae,[_0xc1dd('0x3b'),'List']);_0x5b5d76['applications']=_0x4188ae['Applications'];_0x5b5d76[_0xc1dd('0x3c')]=_0x4188ae[_0xc1dd('0x35')];_0x5b5d76[_0xc1dd('0x3d')]=_['orderBy'](_0x5b5d76[_0xc1dd('0x3d')],[_0xc1dd('0x3e')],[_0xc1dd('0x3f')]);if(_0x5b5d76[_0xc1dd('0x34')]&&_0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x40')]){_0x5b5d76[_0xc1dd('0x3d')][_0xc1dd('0x41')]({'id':0x0,'priority':_0x5b5d76[_0xc1dd('0x3d')][_0xc1dd('0x42')]+0x1,'app':_0xc1dd('0x43'),'appdata':'autoclose','interval':_0xc1dd('0x44')});}if(_0x5b5d76[_0xc1dd('0x34')]['Applications']){delete _0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x3b')];}if(_0x5b5d76[_0xc1dd('0x34')]['List']){delete _0x5b5d76[_0xc1dd('0x34')]['List'];}if(_0x4188ae[_0xc1dd('0x35')][_0xc1dd('0x45')][_0xc1dd('0x42')]){return _0x4188ae[_0xc1dd('0x35')][_0xc1dd('0x45')][0x0];}var _0x5980c8=_['defaults'](_0x45919b[_0xc1dd('0x25')],{'firstName':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')],'ListId':_0x4188ae[_0xc1dd('0x2d')]});_0x5980c8[_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x32')]]=_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x2f')];return db[_0xc1dd('0x29')][_0xc1dd('0x46')](_0x5980c8);}else{throw new Error(_0xc1dd('0x47'));}})[_0xc1dd('0xe')](function(_0x1618c9){_0x5b5d76[_0xc1dd('0x48')]=_0x1618c9;if(_0x1618c9){if(!_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')]){_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')]=rs[_0xc1dd('0x4a')]()+'\x20'+_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x2f')];}var _0x523e99={'ContactId':_0x1618c9['id'],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id'],'inReplyTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'to':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x2f')],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4b')],'attach':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4c')],'lastMsgAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x25')]};return db[_0xc1dd('0x4f')][_0xc1dd('0x23')]({'where':{'closed':![],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id']},'include':[{'model':db[_0xc1dd('0x50')],'as':_0xc1dd('0x51'),'attributes':[_0xc1dd('0x49')],'where':{'messageId':_0x45919b['body'][_0xc1dd('0x16')][_0xc1dd('0x52')]}}]})[_0xc1dd('0xe')](function(_0x57891e){if(_0x57891e){return[_0x57891e,![]];}return db[_0xc1dd('0x4f')][_0xc1dd('0x46')](_0x523e99)[_0xc1dd('0xe')](function(_0x51ef0b){return[_0x51ef0b,!![]];});});}else{throw new Error(_0xc1dd('0x53'));}})[_0xc1dd('0x54')](function(_0x71e293,_0x2f306d){if(_0x71e293){_0x5207f2=_0x2f306d;if(!_0x2f306d){return _0x71e293[_0xc1dd('0x55')]({'inReplyTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'to':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['from'],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x4b')],'attach':_0x71e293[_0xc1dd('0x4c')]?_0x71e293[_0xc1dd('0x4c')]:_0x45919b['body'][_0xc1dd('0x16')][_0xc1dd('0x4c')],'substatus':null,'substatusAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgAt':moment()[_0xc1dd('0x4d')](_0xc1dd('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0x45919b['body'][_0xc1dd('0x25')]});}else{return _0x71e293;}}})[_0xc1dd('0xe')](function(_0x36f969){_0x5b5d76['interaction']=_0x36f969[_0xc1dd('0x3a')]({'plain':!![]});_0x5b5d76['interaction']['created']=_0x5207f2;return db['MailMessage'][_0xc1dd('0x46')]({'body':_0x45919b['body'][_0xc1dd('0x25')],'MailAccountId':_0x45919b[_0xc1dd('0x34')]['id'],'MailInteractionId':_0x36f969['id'],'direction':'in','ContactId':_0x5b5d76[_0xc1dd('0x48')]['id'],'messageId':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x49')],'from':_0x45919b[_0xc1dd('0x25')]['message'][_0xc1dd('0x2f')],'to':_0x45919b[_0xc1dd('0x25')]['message']['to'],'cc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['cc'],'subject':_0x45919b[_0xc1dd('0x25')]['message']['subject'],'attach':_0x45919b[_0xc1dd('0x25')]['message'][_0xc1dd('0x4c')],'Attachments':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['attachments'],'originTo':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')][_0xc1dd('0x56')],'originCc':_0x45919b[_0xc1dd('0x25')]['message']['originCc'],'bcc':_0x45919b[_0xc1dd('0x25')][_0xc1dd('0x16')]['bcc']},{'include':[{'model':db[_0xc1dd('0x57')],'as':_0xc1dd('0x58')}]});})[_0xc1dd('0xe')](function(_0x181311){_0x5b5d76['message']=_0x181311;if(_0x5b5d76['interaction'][_0xc1dd('0x59')]){return db[_0xc1dd('0x5a')][_0xc1dd('0x23')]({'attributes':['id','name'],'where':{'id':_0x5b5d76[_0xc1dd('0x5b')]['UserId']}})[_0xc1dd('0xe')](function(_0x3cea20){if(_0x3cea20){_0x5b5d76['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xc1dd('0x5c'),'appdata':_0x3cea20[_0xc1dd('0x5d')]+','+(_0x5b5d76[_0xc1dd('0x34')][_0xc1dd('0x5e')]||0xa),'interval':_0xc1dd('0x44')});}return respondWithRpcPromise(_0xc1dd('0x5f'),_0xc1dd('0x60'),_0x5b5d76);});}return respondWithRpcPromise('Start',_0xc1dd('0x60'),_0x5b5d76);})[_0xc1dd('0xe')](function(_0x4ffb8c){_0x583688(_0x4ffb8c);})[_0xc1dd('0x17')](function(_0x558bd9){_0x12c56d(_0x17743b[_0xc1dd('0x15')](0x1f4,_0x558bd9[_0xc1dd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index de5a4d5..1913151 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 _0x46e1=['remove','update','emit','register','length','./mailAccount.events','save'];(function(_0x53fa83,_0x5a08a9){var _0x12f39e=function(_0x1b37a7){while(--_0x1b37a7){_0x53fa83['push'](_0x53fa83['shift']());}};_0x12f39e(++_0x5a08a9);}(_0x46e1,0x155));var _0x146e=function(_0x5f7dcb,_0x1dec53){_0x5f7dcb=_0x5f7dcb-0x0;var _0x10e913=_0x46e1[_0x5f7dcb];return _0x10e913;};'use strict';var MailAccountEvents=require(_0x146e('0x0'));var events=[_0x146e('0x1'),_0x146e('0x2'),_0x146e('0x3')];function createListener(_0x155784,_0x1ff284){return function(_0x3708b1){_0x1ff284[_0x146e('0x4')](_0x155784,_0x3708b1);};}function removeListener(_0x18dab9,_0x3bbaec){return function(){MailAccountEvents['removeListener'](_0x18dab9,_0x3bbaec);};}exports[_0x146e('0x5')]=function(_0x1f1f15){for(var _0x3de564=0x0,_0x228fe7=events[_0x146e('0x6')];_0x3de564<_0x228fe7;_0x3de564++){var _0x35e40e=events[_0x3de564];var _0x1c1398=createListener('mailAccount:'+_0x35e40e,_0x1f1f15);MailAccountEvents['on'](_0x35e40e,_0x1c1398);}}; \ No newline at end of file +var _0xd8fb=['./mailAccount.events','save','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x570ac8,_0x53ec66){var _0xe7632d=function(_0x410771){while(--_0x410771){_0x570ac8['push'](_0x570ac8['shift']());}};_0xe7632d(++_0x53ec66);}(_0xd8fb,0x99));var _0xbd8f=function(_0xffb6ab,_0x4ee9ea){_0xffb6ab=_0xffb6ab-0x0;var _0x572758=_0xd8fb[_0xffb6ab];return _0x572758;};'use strict';var MailAccountEvents=require(_0xbd8f('0x0'));var events=[_0xbd8f('0x1'),_0xbd8f('0x2'),_0xbd8f('0x3')];function createListener(_0x52724c,_0x5ea933){return function(_0x4e9545){_0x5ea933[_0xbd8f('0x4')](_0x52724c,_0x4e9545);};}function removeListener(_0x43d177,_0x53cccc){return function(){MailAccountEvents[_0xbd8f('0x5')](_0x43d177,_0x53cccc);};}exports[_0xbd8f('0x6')]=function(_0x5543b2){for(var _0x33d541=0x0,_0x4e97cf=events[_0xbd8f('0x7')];_0x33d541<_0x4e97cf;_0x33d541++){var _0x578499=events[_0x33d541];var _0x197827=createListener(_0xbd8f('0x8')+_0x578499,_0x5543b2);MailAccountEvents['on'](_0x578499,_0x197827);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2c9dd59..a7b702a 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 _0xd404=['update','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x4dbb73,_0x318daf){var _0x16c20b=function(_0x45706f){while(--_0x45706f){_0x4dbb73['push'](_0x4dbb73['shift']());}};_0x16c20b(++_0x318daf);}(_0xd404,0x15b));var _0x4d40=function(_0x447939,_0x5e65df){_0x447939=_0x447939-0x0;var _0x25a124=_0xd404[_0x447939];return _0x25a124;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')](_0x4d40('0x9'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0xc')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xd')]);router['delete'](_0x4d40('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d40('0xe')]=router; \ No newline at end of file +var _0xac4a=['../../config/environment','./mailApplication.controller','get','isAuthenticated','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xac4a,0x13f));var _0xaac4=function(_0x114037,_0x5c95d4){_0x114037=_0x114037-0x0;var _0x26d89d=_0xac4a[_0x114037];return _0x26d89d;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaac4('0x6'));var controller=require(_0xaac4('0x7'));router[_0xaac4('0x8')]('/:id',auth[_0xaac4('0x9')](),controller['show']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['delete']('/:id',auth[_0xaac4('0x9')](),controller['destroy']);module[_0xaac4('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6e0b5fc..295ae9e 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 _0x8f28=['exports','INTEGER','STRING','sequelize'];(function(_0x4cd258,_0x117909){var _0x18a20f=function(_0x218f8f){while(--_0x218f8f){_0x4cd258['push'](_0x4cd258['shift']());}};_0x18a20f(++_0x117909);}(_0x8f28,0xcb));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x88f2('0x0'));module[_0x88f2('0x1')]={'priority':{'type':Sequelize[_0x88f2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88f2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x88f2('0x3')]},'interval':{'type':Sequelize[_0x88f2('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x422a=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x219536,_0x8e0b9b){var _0x231e4d=function(_0x37b376){while(--_0x37b376){_0x219536['push'](_0x219536['shift']());}};_0x231e4d(++_0x8e0b9b);}(_0x422a,0x195));var _0xa422=function(_0x17e541,_0x4ca4dc){_0x17e541=_0x17e541-0x0;var _0x31b296=_0x422a[_0x17e541];return _0x31b296;};'use strict';var Sequelize=require(_0xa422('0x0'));module[_0xa422('0x1')]={'priority':{'type':Sequelize[_0xa422('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa422('0x3')},'appdata':{'type':Sequelize[_0xa422('0x4')]()},'description':{'type':Sequelize[_0xa422('0x5')]},'interval':{'type':Sequelize[_0xa422('0x5')],'defaultValue':_0xa422('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 23b2d40..7ae5004 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 _0xace5=['find','params','eml-format','rimraf','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','model','keys','query','filters','intersection','attributes','fields','includeAll','merge','catch','body','MailApplication'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0xace5,0x1df));var _0x5ace=function(_0x1bbbdf,_0x235087){_0x1bbbdf=_0x1bbbdf-0x0;var _0x3edb6e=_0xace5[_0x1bbbdf];return _0x3edb6e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ace('0x0'));var rimraf=require(_0x5ace('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ace('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5ace('0x3'));var util=require('util');var path=require(_0x5ace('0x4'));var sox=require(_0x5ace('0x5'));var csv=require(_0x5ace('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ace('0x7'));var squel=require(_0x5ace('0x8'));var crypto=require(_0x5ace('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5ace('0xa'));var toCsv=require(_0x5ace('0x6'));var querystring=require(_0x5ace('0xb'));var Papa=require(_0x5ace('0xc'));var Redis=require(_0x5ace('0xd'));var authService=require(_0x5ace('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5ace('0xf'));var hardwareService=require(_0x5ace('0x10'));var logger=require(_0x5ace('0x11'))(_0x5ace('0x12'));var utils=require(_0x5ace('0x13'));var config=require(_0x5ace('0x14'));var db=require(_0x5ace('0x15'))['db'];function respondWithStatusCode(_0xac1d27,_0x54cf58){_0x54cf58=_0x54cf58||0xcc;return function(_0x5a0789){if(_0x5a0789){return _0xac1d27[_0x5ace('0x16')](_0x54cf58);}return _0xac1d27[_0x5ace('0x17')](_0x54cf58)[_0x5ace('0x18')]();};}function respondWithResult(_0x5cd628,_0x238068){_0x238068=_0x238068||0xc8;return function(_0x2a4322){if(_0x2a4322){return _0x5cd628[_0x5ace('0x17')](_0x238068)[_0x5ace('0x19')](_0x2a4322);}};}function respondWithFilteredResult(_0x3baf06,_0x1d624a){return function(_0x330ebc){if(_0x330ebc){var _0x5c9761=_0x330ebc[_0x5ace('0x1a')],_0x7adcf3=_0x1d624a[_0x5ace('0x1b')],_0x224ed7=_0x1d624a[_0x5ace('0x1b')]+_0x1d624a['limit'],_0x3200f5;if(_0x224ed7>=_0x5c9761){_0x224ed7=_0x5c9761;_0x3200f5=0xc8;}else{_0x3200f5=0xce;}_0x3baf06[_0x5ace('0x17')](_0x3200f5);return _0x3baf06[_0x5ace('0x1c')](_0x5ace('0x1d'),_0x7adcf3+'-'+_0x224ed7+'/'+_0x5c9761)[_0x5ace('0x19')](_0x330ebc);}return null;};}function patchUpdates(_0x30a017){return function(_0x3137ba){try{jsonpatch[_0x5ace('0x1e')](_0x3137ba,_0x30a017,!![]);}catch(_0x2a3e84){return BPromise['reject'](_0x2a3e84);}return _0x3137ba[_0x5ace('0x1f')]();};}function saveUpdates(_0x57ff89,_0x452846){return function(_0x548c51){if(_0x548c51){return _0x548c51[_0x5ace('0x20')](_0x57ff89)[_0x5ace('0x21')](function(_0x38bec8){return _0x38bec8;});}return null;};}function removeEntity(_0x258fb3,_0x66740e){return function(_0x351796){if(_0x351796){return _0x351796[_0x5ace('0x22')]()[_0x5ace('0x21')](function(){_0x258fb3[_0x5ace('0x17')](0xcc)[_0x5ace('0x18')]();});}};}function handleEntityNotFound(_0x2cf881,_0x1db9dd){return function(_0x11ee77){if(!_0x11ee77){_0x2cf881[_0x5ace('0x16')](0x194);}return _0x11ee77;};}function handleError(_0x41d9e5,_0x5d72b5){_0x5d72b5=_0x5d72b5||0x1f4;return function(_0x42a0bd){logger['error'](_0x42a0bd[_0x5ace('0x23')]);if(_0x42a0bd['name']){delete _0x42a0bd[_0x5ace('0x24')];}_0x41d9e5[_0x5ace('0x17')](_0x5d72b5)[_0x5ace('0x25')](_0x42a0bd);};}exports[_0x5ace('0x26')]=function(_0x19fad9,_0x271cee){var _0x319d2d={'raw':!![],'where':{'id':_0x19fad9['params']['id']}},_0x22eecf={};_0x22eecf[_0x5ace('0x27')]=_[_0x5ace('0x28')](db['MailApplication']['rawAttributes']);_0x22eecf[_0x5ace('0x29')]=_[_0x5ace('0x28')](_0x19fad9[_0x5ace('0x29')]);_0x22eecf[_0x5ace('0x2a')]=_[_0x5ace('0x2b')](_0x22eecf[_0x5ace('0x27')],_0x22eecf[_0x5ace('0x29')]);_0x319d2d[_0x5ace('0x2c')]=_[_0x5ace('0x2b')](_0x22eecf[_0x5ace('0x27')],qs[_0x5ace('0x2d')](_0x19fad9[_0x5ace('0x29')]['fields']));_0x319d2d[_0x5ace('0x2c')]=_0x319d2d[_0x5ace('0x2c')]['length']?_0x319d2d[_0x5ace('0x2c')]:_0x22eecf['model'];if(_0x19fad9[_0x5ace('0x29')][_0x5ace('0x2e')]){_0x319d2d['include']=[{'all':!![]}];}_0x319d2d=_[_0x5ace('0x2f')]({},_0x319d2d,_0x19fad9['options']);return db['MailApplication']['find'](_0x319d2d)[_0x5ace('0x21')](handleEntityNotFound(_0x271cee,null))[_0x5ace('0x21')](respondWithResult(_0x271cee,null))[_0x5ace('0x30')](handleError(_0x271cee,null));};exports[_0x5ace('0x20')]=function(_0xf7a517,_0x9e904a){if(_0xf7a517['body']['id']){delete _0xf7a517[_0x5ace('0x31')]['id'];}return db[_0x5ace('0x32')][_0x5ace('0x33')]({'where':{'id':_0xf7a517[_0x5ace('0x34')]['id']}})[_0x5ace('0x21')](handleEntityNotFound(_0x9e904a,null))[_0x5ace('0x21')](saveUpdates(_0xf7a517[_0x5ace('0x31')],null))['then'](respondWithResult(_0x9e904a,null))[_0x5ace('0x30')](handleError(_0x9e904a,null));};exports[_0x5ace('0x22')]=function(_0x205496,_0x41aef8){return db[_0x5ace('0x32')]['find']({'where':{'id':_0x205496['params']['id']}})[_0x5ace('0x21')](handleEntityNotFound(_0x41aef8,null))[_0x5ace('0x21')](removeEntity(_0x41aef8,null))[_0x5ace('0x30')](handleError(_0x41aef8,null));}; \ No newline at end of file +var _0x5824=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','then','sendStatus','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','includeAll','include','merge','options','find','catch','body','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x4417b7,_0x5c9044){var _0x319dfd=function(_0x5b8177){while(--_0x5b8177){_0x4417b7['push'](_0x4417b7['shift']());}};_0x319dfd(++_0x5c9044);}(_0x5824,0x14c));var _0x4582=function(_0x2424a2,_0x594db4){_0x2424a2=_0x2424a2-0x0;var _0x5abcc7=_0x5824[_0x2424a2];return _0x5abcc7;};'use strict';var pdf=require(_0x4582('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4582('0x1'));var zipdir=require(_0x4582('0x2'));var jsonpatch=require(_0x4582('0x3'));var rp=require(_0x4582('0x4'));var moment=require(_0x4582('0x5'));var BPromise=require(_0x4582('0x6'));var Mustache=require(_0x4582('0x7'));var util=require(_0x4582('0x8'));var path=require(_0x4582('0x9'));var sox=require(_0x4582('0xa'));var csv=require(_0x4582('0xb'));var ejs=require(_0x4582('0xc'));var fs=require('fs');var _=require(_0x4582('0xd'));var squel=require('squel');var crypto=require(_0x4582('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4582('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4582('0x10'));var qs=require(_0x4582('0x11'));var as=require(_0x4582('0x12'));var hardwareService=require(_0x4582('0x13'));var logger=require(_0x4582('0x14'))(_0x4582('0x15'));var utils=require(_0x4582('0x16'));var config=require('../../config/environment');var db=require(_0x4582('0x17'))['db'];function respondWithStatusCode(_0xbf3a10,_0x7dbee7){_0x7dbee7=_0x7dbee7||0xcc;return function(_0x3c8883){if(_0x3c8883){return _0xbf3a10['sendStatus'](_0x7dbee7);}return _0xbf3a10[_0x4582('0x18')](_0x7dbee7)[_0x4582('0x19')]();};}function respondWithResult(_0x3f1ac4,_0x141b49){_0x141b49=_0x141b49||0xc8;return function(_0x27a4ef){if(_0x27a4ef){return _0x3f1ac4['status'](_0x141b49)[_0x4582('0x1a')](_0x27a4ef);}};}function respondWithFilteredResult(_0x51dd72,_0x9ec576){return function(_0x127e29){if(_0x127e29){var _0x140af7=_0x127e29[_0x4582('0x1b')],_0x19ae22=_0x9ec576[_0x4582('0x1c')],_0x201ac4=_0x9ec576['offset']+_0x9ec576['limit'],_0x278306;if(_0x201ac4>=_0x140af7){_0x201ac4=_0x140af7;_0x278306=0xc8;}else{_0x278306=0xce;}_0x51dd72[_0x4582('0x18')](_0x278306);return _0x51dd72[_0x4582('0x1d')](_0x4582('0x1e'),_0x19ae22+'-'+_0x201ac4+'/'+_0x140af7)[_0x4582('0x1a')](_0x127e29);}return null;};}function patchUpdates(_0xdc0c62){return function(_0x161658){try{jsonpatch['apply'](_0x161658,_0xdc0c62,!![]);}catch(_0x345758){return BPromise[_0x4582('0x1f')](_0x345758);}return _0x161658[_0x4582('0x20')]();};}function saveUpdates(_0x49981f,_0x355a3c){return function(_0x1368cc){if(_0x1368cc){return _0x1368cc[_0x4582('0x21')](_0x49981f)['then'](function(_0xa3ed38){return _0xa3ed38;});}return null;};}function removeEntity(_0x4af7ad,_0x52ceca){return function(_0x2c8110){if(_0x2c8110){return _0x2c8110[_0x4582('0x22')]()[_0x4582('0x23')](function(){_0x4af7ad[_0x4582('0x18')](0xcc)[_0x4582('0x19')]();});}};}function handleEntityNotFound(_0x258d96,_0x192004){return function(_0x46edbb){if(!_0x46edbb){_0x258d96[_0x4582('0x24')](0x194);}return _0x46edbb;};}function handleError(_0x292506,_0x2be989){_0x2be989=_0x2be989||0x1f4;return function(_0x570e6d){logger['error'](_0x570e6d['stack']);if(_0x570e6d['name']){delete _0x570e6d[_0x4582('0x25')];}_0x292506[_0x4582('0x18')](_0x2be989)[_0x4582('0x26')](_0x570e6d);};}exports[_0x4582('0x27')]=function(_0x4cbebf,_0x25abae){var _0x549437={'raw':!![],'where':{'id':_0x4cbebf[_0x4582('0x28')]['id']}},_0x3e5781={};_0x3e5781[_0x4582('0x29')]=_[_0x4582('0x2a')](db[_0x4582('0x2b')][_0x4582('0x2c')]);_0x3e5781[_0x4582('0x2d')]=_[_0x4582('0x2a')](_0x4cbebf['query']);_0x3e5781[_0x4582('0x2e')]=_[_0x4582('0x2f')](_0x3e5781[_0x4582('0x29')],_0x3e5781['query']);_0x549437[_0x4582('0x30')]=_[_0x4582('0x2f')](_0x3e5781[_0x4582('0x29')],qs['fields'](_0x4cbebf['query']['fields']));_0x549437[_0x4582('0x30')]=_0x549437[_0x4582('0x30')]['length']?_0x549437[_0x4582('0x30')]:_0x3e5781[_0x4582('0x29')];if(_0x4cbebf[_0x4582('0x2d')][_0x4582('0x31')]){_0x549437[_0x4582('0x32')]=[{'all':!![]}];}_0x549437=_[_0x4582('0x33')]({},_0x549437,_0x4cbebf[_0x4582('0x34')]);return db[_0x4582('0x2b')][_0x4582('0x35')](_0x549437)[_0x4582('0x23')](handleEntityNotFound(_0x25abae,null))[_0x4582('0x23')](respondWithResult(_0x25abae,null))[_0x4582('0x36')](handleError(_0x25abae,null));};exports['update']=function(_0x7feb36,_0x3f6d55){if(_0x7feb36[_0x4582('0x37')]['id']){delete _0x7feb36['body']['id'];}return db[_0x4582('0x2b')][_0x4582('0x35')]({'where':{'id':_0x7feb36[_0x4582('0x28')]['id']}})[_0x4582('0x23')](handleEntityNotFound(_0x3f6d55,null))[_0x4582('0x23')](saveUpdates(_0x7feb36[_0x4582('0x37')],null))[_0x4582('0x23')](respondWithResult(_0x3f6d55,null))[_0x4582('0x36')](handleError(_0x3f6d55,null));};exports[_0x4582('0x22')]=function(_0x32d8fc,_0x3c1896){return db[_0x4582('0x2b')][_0x4582('0x35')]({'where':{'id':_0x32d8fc[_0x4582('0x28')]['id']}})[_0x4582('0x23')](handleEntityNotFound(_0x3c1896,null))[_0x4582('0x23')](removeEntity(_0x3c1896,null))[_0x4582('0x36')](handleError(_0x3c1896,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index bf91934..5a508ff 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 _0x896e=['path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xef4402,_0x317685){var _0x1516cb=function(_0x2a8fb8){while(--_0x2a8fb8){_0xef4402['push'](_0xef4402['shift']());}};_0x1516cb(++_0x317685);}(_0x896e,0x1e9));var _0xe896=function(_0x14e1d8,_0x1e90a5){_0x14e1d8=_0x14e1d8-0x0;var _0x44f3dc=_0x896e[_0x14e1d8];return _0x44f3dc;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe896('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9219=['moment','path','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9219,0x19e));var _0x9921=function(_0x1aad04,_0x26420d){_0x1aad04=_0x1aad04-0x0;var _0x1f2dfe=_0x9219[_0x1aad04];return _0x1f2dfe;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9921('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9921('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9921('0x2'));module[_0x9921('0x3')]=function(_0x4f9708,_0x1f932b){return _0x4f9708[_0x9921('0x4')](_0x9921('0x5'),attributes,{'tableName':_0x9921('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9921('0x7'),'collate':_0x9921('0x8')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 2eddade..3bf55ef 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 _0x9905=['attributes','limit','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateMailApplication','MailApplication','update','body','options','raw','where'];(function(_0x22d445,_0x4f1d45){var _0x457153=function(_0x2d12e3){while(--_0x2d12e3){_0x22d445['push'](_0x22d445['shift']());}};_0x457153(++_0x4f1d45);}(_0x9905,0x1f3));var _0x5990=function(_0x3bd405,_0x2da8a2){_0x3bd405=_0x3bd405-0x0;var _0x3ad0b3=_0x9905[_0x3bd405];return _0x3ad0b3;};'use strict';var _=require(_0x5990('0x0'));var util=require(_0x5990('0x1'));var moment=require(_0x5990('0x2'));var BPromise=require('bluebird');var rs=require(_0x5990('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5990('0x4'))['db'];var utils=require(_0x5990('0x5'));var logger=require(_0x5990('0x6'))(_0x5990('0x7'));var config=require(_0x5990('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5990('0x9')][_0x5990('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xce07b7,_0x10aec9,_0x12c6cc){return new BPromise(function(_0x703038,_0x100d4a){return client['request'](_0xce07b7,_0x12c6cc)[_0x5990('0xb')](function(_0x123cb7){logger['info'](_0x5990('0xc'),_0x10aec9,_0x5990('0xd'));logger[_0x5990('0xe')](_0x5990('0xf'),_0x10aec9,'request\x20sent',JSON[_0x5990('0x10')](_0x123cb7));if(_0x123cb7[_0x5990('0x11')]){if(_0x123cb7[_0x5990('0x11')][_0x5990('0x12')]===0x1f4){logger['error'](_0x5990('0xc'),_0x10aec9,_0x123cb7[_0x5990('0x11')][_0x5990('0x13')]);return _0x100d4a(_0x123cb7[_0x5990('0x11')][_0x5990('0x13')]);}logger['error'](_0x5990('0xc'),_0x10aec9,_0x123cb7[_0x5990('0x11')][_0x5990('0x13')]);return _0x703038(_0x123cb7[_0x5990('0x11')][_0x5990('0x13')]);}else{logger[_0x5990('0x14')]('MailApplication,\x20%s,\x20%s',_0x10aec9,_0x5990('0xd'));_0x703038(_0x123cb7['result']['message']);}})['catch'](function(_0x1ac72d){logger[_0x5990('0x11')](_0x5990('0xc'),_0x10aec9,_0x1ac72d);_0x100d4a(_0x1ac72d);});});}exports[_0x5990('0x15')]=function(_0x324d2c){var _0x2ef859=this;return new Promise(function(_0x24d0c3,_0x51a092){return db[_0x5990('0x16')][_0x5990('0x17')](_0x324d2c[_0x5990('0x18')],{'raw':_0x324d2c[_0x5990('0x19')]?_0x324d2c[_0x5990('0x19')][_0x5990('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x324d2c[_0x5990('0x19')]?_0x324d2c[_0x5990('0x19')][_0x5990('0x1b')]||null:null,'attributes':_0x324d2c[_0x5990('0x19')]?_0x324d2c[_0x5990('0x19')][_0x5990('0x1c')]||null:null,'limit':_0x324d2c['options']?_0x324d2c['options'][_0x5990('0x1d')]||null:null})[_0x5990('0xb')](function(_0x5b1284){logger['info'](_0x5990('0x15'),_0x324d2c);logger[_0x5990('0xe')](_0x5990('0x15'),_0x324d2c,JSON[_0x5990('0x10')](_0x5b1284));_0x24d0c3(_0x5b1284);})[_0x5990('0x1e')](function(_0x1ef072){logger['error'](_0x5990('0x15'),_0x1ef072[_0x5990('0x13')],_0x324d2c);_0x51a092(_0x2ef859['error'](0x1f4,_0x1ef072[_0x5990('0x13')]));});});}; \ No newline at end of file +var _0xa24c=['../../config/logger','../../config/environment','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','raw','options','attributes','then','stringify','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xa24c,0x1f3));var _0xca24=function(_0x405835,_0x2a8aed){_0x405835=_0x405835-0x0;var _0x36ce23=_0xa24c[_0x405835];return _0x36ce23;};'use strict';var _=require(_0xca24('0x0'));var util=require('util');var moment=require(_0xca24('0x1'));var BPromise=require(_0xca24('0x2'));var rs=require(_0xca24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca24('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xca24('0x5'))('rpc');var config=require(_0xca24('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xca24('0x7')][_0xca24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d7bed,_0x30a77b,_0x4d88af){return new BPromise(function(_0x1a60c6,_0x4d59d8){return client[_0xca24('0x9')](_0x2d7bed,_0x4d88af)['then'](function(_0x387d46){logger[_0xca24('0xa')](_0xca24('0xb'),_0x30a77b,_0xca24('0xc'));logger[_0xca24('0xd')](_0xca24('0xe'),_0x30a77b,_0xca24('0xc'),JSON['stringify'](_0x387d46));if(_0x387d46[_0xca24('0xf')]){if(_0x387d46['error'][_0xca24('0x10')]===0x1f4){logger[_0xca24('0xf')]('MailApplication,\x20%s,\x20%s',_0x30a77b,_0x387d46['error'][_0xca24('0x11')]);return _0x4d59d8(_0x387d46[_0xca24('0xf')]['message']);}logger[_0xca24('0xf')](_0xca24('0xb'),_0x30a77b,_0x387d46[_0xca24('0xf')][_0xca24('0x11')]);return _0x1a60c6(_0x387d46[_0xca24('0xf')][_0xca24('0x11')]);}else{logger[_0xca24('0xa')](_0xca24('0xb'),_0x30a77b,'request\x20sent');_0x1a60c6(_0x387d46[_0xca24('0x12')]['message']);}})[_0xca24('0x13')](function(_0xeead6c){logger['error']('MailApplication,\x20%s,\x20%s',_0x30a77b,_0xeead6c);_0x4d59d8(_0xeead6c);});});}exports[_0xca24('0x14')]=function(_0x19aebc){var _0x2fa7f8=this;return new Promise(function(_0x51a2fe,_0x1880a3){return db[_0xca24('0x15')][_0xca24('0x16')](_0x19aebc['body'],{'raw':_0x19aebc['options']?_0x19aebc['options'][_0xca24('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19aebc['options']?_0x19aebc[_0xca24('0x18')]['where']||null:null,'attributes':_0x19aebc[_0xca24('0x18')]?_0x19aebc[_0xca24('0x18')][_0xca24('0x19')]||null:null,'limit':_0x19aebc[_0xca24('0x18')]?_0x19aebc[_0xca24('0x18')]['limit']||null:null})[_0xca24('0x1a')](function(_0x57c0b3){logger[_0xca24('0xa')](_0xca24('0x14'),_0x19aebc);logger[_0xca24('0xd')](_0xca24('0x14'),_0x19aebc,JSON[_0xca24('0x1b')](_0x57c0b3));_0x51a2fe(_0x57c0b3);})['catch'](function(_0x166ab0){logger[_0xca24('0xf')]('UpdateMailApplication',_0x166ab0[_0xca24('0x11')],_0x19aebc);_0x1880a3(_0x2fa7f8[_0xca24('0xf')](0x1f4,_0x166ab0[_0xca24('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index f94264d..494858a 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 _0x7e5b=['delete','mailinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','/:id','mail','mailinteraction:update','update'];(function(_0x381f21,_0x5dea54){var _0x45f14b=function(_0x5b220a){while(--_0x5b220a){_0x381f21['push'](_0x381f21['shift']());}};_0x45f14b(++_0x5dea54);}(_0x7e5b,0x1bf));var _0xb7e5=function(_0x3550e0,_0xb5bade){_0x3550e0=_0x3550e0-0x0;var _0x1b9a7a=_0x7e5b[_0x3550e0];return _0x1b9a7a;};'use strict';var multer=require(_0xb7e5('0x0'));var util=require('util');var path=require(_0xb7e5('0x1'));var timeout=require(_0xb7e5('0x2'));var express=require(_0xb7e5('0x3'));var router=express[_0xb7e5('0x4')]();var auth=require(_0xb7e5('0x5'));var interaction=require(_0xb7e5('0x6'));var config=require('../../config/environment');var controller=require(_0xb7e5('0x7'));router[_0xb7e5('0x8')]('/',auth[_0xb7e5('0x9')](),controller[_0xb7e5('0xa')]);router[_0xb7e5('0x8')](_0xb7e5('0xb'),auth[_0xb7e5('0x9')](),controller[_0xb7e5('0xc')]);router[_0xb7e5('0x8')]('/:id',auth[_0xb7e5('0x9')](),controller[_0xb7e5('0xd')]);router[_0xb7e5('0x8')](_0xb7e5('0xe'),auth[_0xb7e5('0x9')](),controller[_0xb7e5('0xf')]);router[_0xb7e5('0x8')](_0xb7e5('0x10'),auth[_0xb7e5('0x9')](),controller[_0xb7e5('0x11')]);router[_0xb7e5('0x12')]('/',auth[_0xb7e5('0x9')](),controller['create']);router[_0xb7e5('0x12')](_0xb7e5('0xe'),auth[_0xb7e5('0x9')](),controller[_0xb7e5('0x13')]);router[_0xb7e5('0x12')](_0xb7e5('0x14'),auth['isAuthenticated'](),interaction[_0xb7e5('0x15')]('mail',_0xb7e5('0x16')),controller[_0xb7e5('0x17')]);router[_0xb7e5('0x18')](_0xb7e5('0x19'),auth['isAuthenticated'](),interaction[_0xb7e5('0x15')](_0xb7e5('0x1a'),_0xb7e5('0x1b')),controller[_0xb7e5('0x1c')]);router[_0xb7e5('0x1d')](_0xb7e5('0x19'),auth[_0xb7e5('0x9')](),interaction[_0xb7e5('0x15')]('mail',_0xb7e5('0x1e')),controller[_0xb7e5('0x1f')]);router['delete'](_0xb7e5('0x14'),auth[_0xb7e5('0x9')](),controller[_0xb7e5('0x20')]);module[_0xb7e5('0x21')]=router; \ No newline at end of file +var _0xde7f=['describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','mail','addTags','put','update','delete','mailinteraction:destroy','destroy','removeTags','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x18f43e,_0x5dab38){var _0x5c33e4=function(_0x1d5cbd){while(--_0x1d5cbd){_0x18f43e['push'](_0x18f43e['shift']());}};_0x5c33e4(++_0x5dab38);}(_0xde7f,0xa4));var _0xfde7=function(_0x7cde6e,_0x65fc4){_0x7cde6e=_0x7cde6e-0x0;var _0x187e40=_0xde7f[_0x7cde6e];return _0x187e40;};'use strict';var multer=require(_0xfde7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfde7('0x1'));var express=require('express');var router=express[_0xfde7('0x2')]();var auth=require(_0xfde7('0x3'));var interaction=require(_0xfde7('0x4'));var config=require(_0xfde7('0x5'));var controller=require(_0xfde7('0x6'));router[_0xfde7('0x7')]('/',auth[_0xfde7('0x8')](),controller[_0xfde7('0x9')]);router['get']('/describe',auth[_0xfde7('0x8')](),controller[_0xfde7('0xa')]);router[_0xfde7('0x7')](_0xfde7('0xb'),auth[_0xfde7('0x8')](),controller[_0xfde7('0xc')]);router[_0xfde7('0x7')]('/:id/messages',auth[_0xfde7('0x8')](),controller[_0xfde7('0xd')]);router[_0xfde7('0x7')](_0xfde7('0xe'),auth[_0xfde7('0x8')](),controller[_0xfde7('0xf')]);router[_0xfde7('0x10')]('/',auth[_0xfde7('0x8')](),controller['create']);router['post'](_0xfde7('0x11'),auth[_0xfde7('0x8')](),controller[_0xfde7('0x12')]);router['post'](_0xfde7('0x13'),auth[_0xfde7('0x8')](),interaction[_0xfde7('0x14')](_0xfde7('0x15'),'mailinteraction:addtags'),controller[_0xfde7('0x16')]);router[_0xfde7('0x17')](_0xfde7('0xb'),auth['isAuthenticated'](),interaction[_0xfde7('0x14')](_0xfde7('0x15'),'mailinteraction:update'),controller[_0xfde7('0x18')]);router[_0xfde7('0x19')](_0xfde7('0xb'),auth[_0xfde7('0x8')](),interaction[_0xfde7('0x14')](_0xfde7('0x15'),_0xfde7('0x1a')),controller[_0xfde7('0x1b')]);router['delete'](_0xfde7('0x13'),auth[_0xfde7('0x8')](),controller[_0xfde7('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 56be92a..45044ad 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 _0x6080=['TEXT','long','BOOLEAN','out','sequelize','iconv','DATE','STRING'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x6080,0xb4));var _0x0608=function(_0x47453a,_0xa7caaa){_0x47453a=_0x47453a-0x0;var _0x285944=_0x6080[_0x47453a];return _0x285944;};'use strict';var Sequelize=require(_0x0608('0x0'));var iconv=require(_0x0608('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0608('0x2')]},'disposition':{'type':Sequelize[_0x0608('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0608('0x3')](0x1fe)},'to':{'type':Sequelize[_0x0608('0x3')]},'cc':{'type':Sequelize[_0x0608('0x4')](_0x0608('0x5'))},'subject':{'type':Sequelize[_0x0608('0x4')]()},'attach':{'type':Sequelize[_0x0608('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0608('0x2')]},'substatus':{'type':Sequelize[_0x0608('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0608('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x0608('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x0608('0x4')](_0x0608('0x5'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x0608('0x5'))}}; \ No newline at end of file +var _0x4770=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x799123,_0x4e7fbc){var _0x46d7bc=function(_0x2577c4){while(--_0x2577c4){_0x799123['push'](_0x799123['shift']());}};_0x46d7bc(++_0x4e7fbc);}(_0x4770,0x195));var _0x0477=function(_0x2e0cd5,_0xb9d51b){_0x2e0cd5=_0x2e0cd5-0x0;var _0x1da9c8=_0x4770[_0x2e0cd5];return _0x1da9c8;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x0477('0x0'));module[_0x0477('0x1')]={'closed':{'type':Sequelize[_0x0477('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0477('0x3')]},'disposition':{'type':Sequelize[_0x0477('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0477('0x4')](0x1fe)},'to':{'type':Sequelize[_0x0477('0x4')]},'cc':{'type':Sequelize[_0x0477('0x5')](_0x0477('0x6'))},'subject':{'type':Sequelize[_0x0477('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0477('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x0477('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0477('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0477('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0477('0x7')]('in',_0x0477('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x0477('0x5')](_0x0477('0x6'))},'lastMsgText':{'type':Sequelize[_0x0477('0x5')](_0x0477('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 373783e..a57e28f 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 _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x517b93,_0x52a90b){var _0x419579=function(_0x35c5eb){while(--_0x35c5eb){_0x517b93['push'](_0x517b93['shift']());}};_0x419579(++_0x52a90b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file +var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x3d107e,_0x303502){var _0x3f4171=function(_0x292c5c){while(--_0x292c5c){_0x3d107e['push'](_0x3d107e['shift']());}};_0x3f4171(++_0x303502);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index f4e0223..4acc641 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 _0x8728=['then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','setMaxListeners','save','update','getUsers'];(function(_0x45be3b,_0x1fea36){var _0x23af3a=function(_0x48c1f4){while(--_0x48c1f4){_0x45be3b['push'](_0x45be3b['shift']());}};_0x23af3a(++_0x1fea36);}(_0x8728,0x77));var _0x8872=function(_0x271607,_0x1cdaf2){_0x271607=_0x271607-0x0;var _0x2e87c1=_0x8728[_0x271607];return _0x2e87c1;};'use strict';var EventEmitter=require(_0x8872('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x8872('0x1')];var MailMessage=require(_0x8872('0x2'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x8872('0x3')](0x0);var events={'afterCreate':_0x8872('0x4'),'afterUpdate':_0x8872('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15ad55){return function(_0x13239a,_0x5106ed,_0x5b5222){_0x13239a[_0x8872('0x6')]({'attributes':['id'],'raw':!![]})[_0x8872('0x7')](function(_0x52dcf0){_0x13239a[_0x8872('0x8')]('Users',_0x52dcf0[_0x8872('0x9')](function(_0x366725){return{'id':_0x366725['id']};}));return MailMessage[_0x8872('0xa')]({'where':{'MailInteractionId':_0x13239a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43663e){_0x13239a[_0x8872('0x8')](_0x8872('0xb'),_0x43663e[_0x8872('0xc')]);MailInteractionEvents[_0x8872('0xd')](_0x15ad55+':'+_0x13239a['id'],_0x13239a);MailInteractionEvents['emit'](_0x15ad55,_0x13239a);_0x5b5222(null);})[_0x8872('0xe')](_0x5b5222(null));};}for(var e in events){if(events[_0x8872('0xf')](e)){var event=events[e];MailInteraction[_0x8872('0x10')](e,emitEvent(event));}}module[_0x8872('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x1f0f=['hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','update','remove','getUsers','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x1f0f,0x1e9));var _0xf1f0=function(_0x4f3eea,_0x3f3199){_0x4f3eea=_0x4f3eea-0x0;var _0x57808d=_0x1f0f[_0x4f3eea];return _0x57808d;};'use strict';var EventEmitter=require(_0xf1f0('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xf1f0('0x1')];var MailMessage=require(_0xf1f0('0x2'))['db'][_0xf1f0('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1f0('0x4'),'afterDestroy':_0xf1f0('0x5')};function emitEvent(_0x14a177){return function(_0x1f20f8,_0x4694dd,_0x22735f){_0x1f20f8[_0xf1f0('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50d210){_0x1f20f8['setDataValue'](_0xf1f0('0x7'),_0x50d210[_0xf1f0('0x8')](function(_0x5d9a57){return{'id':_0x5d9a57['id']};}));return MailMessage[_0xf1f0('0x9')]({'where':{'MailInteractionId':_0x1f20f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5ebdb1){_0x1f20f8[_0xf1f0('0xa')](_0xf1f0('0xb'),_0x5ebdb1[_0xf1f0('0xc')]);MailInteractionEvents[_0xf1f0('0xd')](_0x14a177+':'+_0x1f20f8['id'],_0x1f20f8);MailInteractionEvents[_0xf1f0('0xd')](_0x14a177,_0x1f20f8);_0x22735f(null);})[_0xf1f0('0xe')](_0x22735f(null));};}for(var e in events){if(events[_0xf1f0('0xf')](e)){var event=events[e];MailInteraction[_0xf1f0('0x10')](e,emitEvent(event));}}module[_0xf1f0('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index a78b80e..4980d0d 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 _0xefd7=['moment','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','get','MailMessage','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x48ca57,_0x47e175){var _0x5826cf=function(_0x42f28f){while(--_0x42f28f){_0x48ca57['push'](_0x48ca57['shift']());}};_0x5826cf(++_0x47e175);}(_0xefd7,0x99));var _0x7efd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xefd7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7efd('0x0'));var util=require('util');var logger=require(_0x7efd('0x1'))(_0x7efd('0x2'));var moment=require(_0x7efd('0x3'));var BPromise=require('bluebird');var rp=require(_0x7efd('0x4'));var fs=require('fs');var path=require(_0x7efd('0x5'));var rimraf=require(_0x7efd('0x6'));var config=require(_0x7efd('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x7efd('0x8')]=function(_0x308794,_0x3be366){return _0x308794[_0x7efd('0x9')](_0x7efd('0xa'),attributes,{'tableName':_0x7efd('0xb'),'paranoid':![],'indexes':[{'name':_0x7efd('0xc'),'fields':[_0x7efd('0xd'),'to'],'type':_0x7efd('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x49bb0a,_0x43b9f0,_0x297368){if(_0x49bb0a['substatus']){_0x49bb0a[_0x7efd('0xf')]=moment()[_0x7efd('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x49bb0a[_0x7efd('0x11')]){_0x49bb0a[_0x7efd('0x12')]=moment()['format'](_0x7efd('0x13'));}_0x297368(null,_0x43b9f0);},'beforeUpdate':function(_0x24732,_0x138544,_0x57269e){if(_0x24732['changed'](_0x7efd('0x14'))){_0x24732[_0x7efd('0xf')]=_0x24732[_0x7efd('0x14')]?moment()['format'](_0x7efd('0x13')):null;}if(_0x24732[_0x7efd('0x15')](_0x7efd('0x11'))){_0x24732['closedAt']=moment()[_0x7efd('0x10')](_0x7efd('0x13'));_0x24732['substatus']=null;_0x24732[_0x7efd('0xf')]=null;}_0x57269e(null,_0x24732);},'afterUpdate':function(_0x5affe3,_0x34d13f,_0x112555){var _0x1e6344=_0x308794['models'];var _0x2a91e1=_0x5affe3[_0x7efd('0x16')]({'plain':!![]});if(_0x2a91e1[_0x7efd('0x11')]){return _0x1e6344[_0x7efd('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x2a91e1['id']}})['then'](function(){_0x112555();})[_0x7efd('0x18')](function(_0x59ecda){_0x112555(_0x59ecda);});}else{_0x112555();}}},'charset':'utf8mb4','collate':_0x7efd('0x19')});}; \ No newline at end of file +var _0x12c9=['changed','substatus','substatusAt','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x56fe68,_0x40fdef){var _0x1eeb3b=function(_0x5a61a9){while(--_0x5a61a9){_0x56fe68['push'](_0x56fe68['shift']());}};_0x1eeb3b(++_0x40fdef);}(_0x12c9,0x10e));var _0x912c=function(_0x2667cf,_0x26d24f){_0x2667cf=_0x2667cf-0x0;var _0x33c5ff=_0x12c9[_0x2667cf];return _0x33c5ff;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var logger=require(_0x912c('0x1'))(_0x912c('0x2'));var moment=require(_0x912c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x912c('0x4'));var rimraf=require(_0x912c('0x5'));var config=require('../../config/environment');var attributes=require(_0x912c('0x6'));module[_0x912c('0x7')]=function(_0x51a277,_0x3c595c){return _0x51a277[_0x912c('0x8')](_0x912c('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x912c('0xa'),'to'],'type':_0x912c('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4eb1c5,_0x42e836,_0x5be932){if(_0x4eb1c5['substatus']){_0x4eb1c5['substatusAt']=moment()[_0x912c('0xc')](_0x912c('0xd'));}if(_0x4eb1c5[_0x912c('0xe')]){_0x4eb1c5[_0x912c('0xf')]=moment()['format'](_0x912c('0xd'));}_0x5be932(null,_0x42e836);},'beforeUpdate':function(_0x5737a5,_0x5f1093,_0x2b03aa){if(_0x5737a5[_0x912c('0x10')](_0x912c('0x11'))){_0x5737a5[_0x912c('0x12')]=_0x5737a5[_0x912c('0x11')]?moment()['format'](_0x912c('0xd')):null;}if(_0x5737a5[_0x912c('0x10')](_0x912c('0xe'))){_0x5737a5[_0x912c('0xf')]=moment()[_0x912c('0xc')](_0x912c('0xd'));_0x5737a5[_0x912c('0x11')]=null;_0x5737a5[_0x912c('0x12')]=null;}_0x2b03aa(null,_0x5737a5);},'afterUpdate':function(_0x361d2b,_0x54caf3,_0x3c6031){var _0x17855b=_0x51a277[_0x912c('0x13')];var _0x53fe72=_0x361d2b[_0x912c('0x14')]({'plain':!![]});if(_0x53fe72[_0x912c('0xe')]){return _0x17855b[_0x912c('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x53fe72['id']}})[_0x912c('0x16')](function(){_0x3c6031();})[_0x912c('0x17')](function(_0x51ca12){_0x3c6031(_0x51ca12);});}else{_0x3c6031();}}},'charset':_0x912c('0x18'),'collate':_0x912c('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c124e37..ecfeb33 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 _0x1ddc=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','find','addTags','omit','ids','AddTags','util'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x5ac969,_0x1221ad){_0x5ac969=_0x5ac969-0x0;var _0x29c618=_0x1ddc[_0x5ac969];return _0x29c618;};'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});config[_0xc1dd('0x9')]=_[_0xc1dd('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc1dd('0xb'))(new Redis(config[_0xc1dd('0x9')]));require(_0xc1dd('0xc'))[_0xc1dd('0xd')](socket);function respondWithRpcPromise(_0x495e17,_0x38b62e,_0x1b4b3f){return new BPromise(function(_0xa720ed,_0xccdb4e){return client['request'](_0x495e17,_0x1b4b3f)[_0xc1dd('0xe')](function(_0x1d28a7){logger[_0xc1dd('0xf')](_0xc1dd('0x10'),_0x38b62e,_0xc1dd('0x11'));logger[_0xc1dd('0x12')](_0xc1dd('0x13'),_0x38b62e,_0xc1dd('0x11'),JSON[_0xc1dd('0x14')](_0x1d28a7));if(_0x1d28a7[_0xc1dd('0x15')]){if(_0x1d28a7[_0xc1dd('0x15')]['code']===0x1f4){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xccdb4e(_0x1d28a7[_0xc1dd('0x15')]['message']);}logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x1d28a7[_0xc1dd('0x15')][_0xc1dd('0x16')]);return _0xa720ed(_0x1d28a7['error']['message']);}else{logger[_0xc1dd('0xf')]('MailInteraction,\x20%s,\x20%s',_0x38b62e,_0xc1dd('0x11'));_0xa720ed(_0x1d28a7['result'][_0xc1dd('0x16')]);}})[_0xc1dd('0x17')](function(_0x288abd){logger[_0xc1dd('0x15')](_0xc1dd('0x10'),_0x38b62e,_0x288abd);_0xccdb4e(_0x288abd);});});}exports[_0xc1dd('0x18')]=function(_0x568a6b){var _0x459da6=this;return new Promise(function(_0x1ab21b,_0x5e99a6){return db[_0xc1dd('0x19')][_0xc1dd('0x1a')](_0x568a6b[_0xc1dd('0x1b')],{'raw':_0x568a6b[_0xc1dd('0x1c')]?_0x568a6b[_0xc1dd('0x1c')][_0xc1dd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x568a6b[_0xc1dd('0x1c')]?_0x568a6b[_0xc1dd('0x1c')]['where']||null:null,'attributes':_0x568a6b[_0xc1dd('0x1c')]?_0x568a6b[_0xc1dd('0x1c')][_0xc1dd('0x1e')]||null:null,'limit':_0x568a6b[_0xc1dd('0x1c')]?_0x568a6b['options'][_0xc1dd('0x1f')]||null:null})[_0xc1dd('0xe')](function(_0x30b4b8){logger[_0xc1dd('0xf')](_0xc1dd('0x18'),_0x568a6b);logger[_0xc1dd('0x12')](_0xc1dd('0x18'),_0x568a6b,JSON[_0xc1dd('0x14')](_0x30b4b8));_0x1ab21b(_0x30b4b8);})[_0xc1dd('0x17')](function(_0x41d319){logger[_0xc1dd('0x15')](_0xc1dd('0x18'),_0x41d319[_0xc1dd('0x16')],_0x568a6b);_0x5e99a6(_0x459da6[_0xc1dd('0x15')](0x1f4,_0x41d319['message']));});});};exports['AddTagsToMailInteraction']=function(_0x388f35){return new Promise(function(_0x19d818,_0x25a651){return db[_0xc1dd('0x19')][_0xc1dd('0x20')]({'where':_0x388f35[_0xc1dd('0x1c')]?_0x388f35[_0xc1dd('0x1c')]['where']||null:null})[_0xc1dd('0xe')](function(_0x18077f){if(_0x18077f){return _0x18077f[_0xc1dd('0x21')](_0x388f35[_0xc1dd('0x1b')]['ids'],_[_0xc1dd('0x22')](_0x388f35[_0xc1dd('0x1b')],[_0xc1dd('0x23'),'id'])||{});}})['spread'](function(_0xa24253){logger['info'](_0xc1dd('0x24'),_0x388f35);logger[_0xc1dd('0x12')](_0xc1dd('0x24'),_0x388f35,JSON['stringify'](_0xa24253));_0x19d818(_0xa24253);})[_0xc1dd('0x17')](function(_0x3236ad){logger[_0xc1dd('0x15')](_0xc1dd('0x24'),_0x3236ad['message'],_0x388f35);_0x25a651(_this[_0xc1dd('0x15')](0x1f4,_0x3236ad[_0xc1dd('0x16')]));});});}; \ No newline at end of file +var _0xef38=['options','raw','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','where','addTags','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','update','body'];(function(_0x4b7461,_0x43e496){var _0x451c99=function(_0x14ae20){while(--_0x14ae20){_0x4b7461['push'](_0x4b7461['shift']());}};_0x451c99(++_0x43e496);}(_0xef38,0x122));var _0x8ef3=function(_0x553af2,_0x11ab02){_0x553af2=_0x553af2-0x0;var _0x157446=_0xef38[_0x553af2];return _0x157446;};'use strict';var _=require('lodash');var util=require(_0x8ef3('0x0'));var moment=require(_0x8ef3('0x1'));var BPromise=require(_0x8ef3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef3('0x3'))['db'];var utils=require(_0x8ef3('0x4'));var logger=require(_0x8ef3('0x5'))(_0x8ef3('0x6'));var config=require(_0x8ef3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ef3('0x8')][_0x8ef3('0x9')]({'port':0x232a});config['redis']=_[_0x8ef3('0xa')](config[_0x8ef3('0xb')],{'host':_0x8ef3('0xc'),'port':0x18eb});var socket=require(_0x8ef3('0xd'))(new Redis(config[_0x8ef3('0xb')]));require(_0x8ef3('0xe'))[_0x8ef3('0xf')](socket);function respondWithRpcPromise(_0x48d639,_0x3c4d82,_0x23533d){return new BPromise(function(_0x13a559,_0x37825a){return client[_0x8ef3('0x10')](_0x48d639,_0x23533d)[_0x8ef3('0x11')](function(_0x3664e4){logger[_0x8ef3('0x12')](_0x8ef3('0x13'),_0x3c4d82,_0x8ef3('0x14'));logger[_0x8ef3('0x15')](_0x8ef3('0x16'),_0x3c4d82,_0x8ef3('0x14'),JSON[_0x8ef3('0x17')](_0x3664e4));if(_0x3664e4[_0x8ef3('0x18')]){if(_0x3664e4[_0x8ef3('0x18')][_0x8ef3('0x19')]===0x1f4){logger[_0x8ef3('0x18')](_0x8ef3('0x13'),_0x3c4d82,_0x3664e4['error'][_0x8ef3('0x1a')]);return _0x37825a(_0x3664e4['error'][_0x8ef3('0x1a')]);}logger['error'](_0x8ef3('0x13'),_0x3c4d82,_0x3664e4[_0x8ef3('0x18')]['message']);return _0x13a559(_0x3664e4['error'][_0x8ef3('0x1a')]);}else{logger[_0x8ef3('0x12')](_0x8ef3('0x13'),_0x3c4d82,_0x8ef3('0x14'));_0x13a559(_0x3664e4['result']['message']);}})[_0x8ef3('0x1b')](function(_0x65e9f2){logger[_0x8ef3('0x18')](_0x8ef3('0x13'),_0x3c4d82,_0x65e9f2);_0x37825a(_0x65e9f2);});});}exports['UpdateMailInteraction']=function(_0xf6a763){var _0x185abf=this;return new Promise(function(_0x2a3e8c,_0x5856a0){return db['MailInteraction'][_0x8ef3('0x1c')](_0xf6a763[_0x8ef3('0x1d')],{'raw':_0xf6a763[_0x8ef3('0x1e')]?_0xf6a763[_0x8ef3('0x1e')][_0x8ef3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf6a763[_0x8ef3('0x1e')]?_0xf6a763[_0x8ef3('0x1e')]['where']||null:null,'attributes':_0xf6a763[_0x8ef3('0x1e')]?_0xf6a763[_0x8ef3('0x1e')]['attributes']||null:null,'limit':_0xf6a763[_0x8ef3('0x1e')]?_0xf6a763[_0x8ef3('0x1e')][_0x8ef3('0x20')]||null:null})[_0x8ef3('0x11')](function(_0x7d8a6c){logger['info'](_0x8ef3('0x21'),_0xf6a763);logger[_0x8ef3('0x15')](_0x8ef3('0x21'),_0xf6a763,JSON[_0x8ef3('0x17')](_0x7d8a6c));_0x2a3e8c(_0x7d8a6c);})['catch'](function(_0x3441ce){logger[_0x8ef3('0x18')](_0x8ef3('0x21'),_0x3441ce[_0x8ef3('0x1a')],_0xf6a763);_0x5856a0(_0x185abf[_0x8ef3('0x18')](0x1f4,_0x3441ce[_0x8ef3('0x1a')]));});});};exports[_0x8ef3('0x22')]=function(_0x39812d){return new Promise(function(_0x223f8e,_0xe4e2ba){return db[_0x8ef3('0x23')]['find']({'where':_0x39812d[_0x8ef3('0x1e')]?_0x39812d[_0x8ef3('0x1e')][_0x8ef3('0x24')]||null:null})[_0x8ef3('0x11')](function(_0x3b9d3a){if(_0x3b9d3a){return _0x3b9d3a[_0x8ef3('0x25')](_0x39812d[_0x8ef3('0x1d')]['ids'],_['omit'](_0x39812d[_0x8ef3('0x1d')],['ids','id'])||{});}})[_0x8ef3('0x26')](function(_0x182394){logger[_0x8ef3('0x12')]('AddTags',_0x39812d);logger['debug']('AddTags',_0x39812d,JSON['stringify'](_0x182394));_0x223f8e(_0x182394);})['catch'](function(_0x455da1){logger[_0x8ef3('0x18')](_0x8ef3('0x27'),_0x455da1['message'],_0x39812d);_0xe4e2ba(_this[_0x8ef3('0x18')](0x1f4,_0x455da1[_0x8ef3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 26962cd..fe08730 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 _0x20e6=['remove','removeListener','register','length','mailInteraction:'];(function(_0x42f237,_0x3e872c){var _0x2ee60b=function(_0x26c37e){while(--_0x26c37e){_0x42f237['push'](_0x42f237['shift']());}};_0x2ee60b(++_0x3e872c);}(_0x20e6,0xc8));var _0x620e=function(_0x5356c5,_0x36ccda){_0x5356c5=_0x5356c5-0x0;var _0x1691f6=_0x20e6[_0x5356c5];return _0x1691f6;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x620e('0x0'),'update'];function createListener(_0x4e258d,_0x547db1){return function(_0x364832){_0x547db1['emit'](_0x4e258d,_0x364832);};}function removeListener(_0x468a05,_0x137f43){return function(){MailInteractionEvents[_0x620e('0x1')](_0x468a05,_0x137f43);};}exports[_0x620e('0x2')]=function(_0x1f1297){for(var _0x3bd0cb=0x0,_0xc16042=events[_0x620e('0x3')];_0x3bd0cb<_0xc16042;_0x3bd0cb++){var _0x52e341=events[_0x3bd0cb];var _0x1a23fc=createListener(_0x620e('0x4')+_0x52e341,_0x1f1297);MailInteractionEvents['on'](_0x52e341,_0x1a23fc);}}; \ No newline at end of file +var _0x2b76=['length','mailInteraction:','save','remove','emit','removeListener'];(function(_0x7d74c4,_0x43664f){var _0x7e5b4d=function(_0x2ea614){while(--_0x2ea614){_0x7d74c4['push'](_0x7d74c4['shift']());}};_0x7e5b4d(++_0x43664f);}(_0x2b76,0x13a));var _0x62b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2b76[_0xfae23b];return _0x200640;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x62b7('0x0'),_0x62b7('0x1'),'update'];function createListener(_0x35071d,_0x1d5c11){return function(_0x44db87){_0x1d5c11[_0x62b7('0x2')](_0x35071d,_0x44db87);};}function removeListener(_0x483387,_0x578ff7){return function(){MailInteractionEvents[_0x62b7('0x3')](_0x483387,_0x578ff7);};}exports['register']=function(_0x3495dd){for(var _0x474495=0x0,_0x48720e=events[_0x62b7('0x4')];_0x474495<_0x48720e;_0x474495++){var _0x189794=events[_0x474495];var _0x18686d=createListener(_0x62b7('0x5')+_0x189794,_0x3495dd);MailInteractionEvents['on'](_0x189794,_0x18686d);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 85aa8db..1f71aa3 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 _0x00bb=['/:id','/:id/download','download','post','mail','update','put','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['get'](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')]('/',auth[_0xb00b('0x9')](),interaction['tracked'](_0xb00b('0xf'),'mailmessage:create'),controller['create']);router['put'](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller[_0xb00b('0x10')]);router[_0xb00b('0x11')](_0xb00b('0x12'),auth[_0xb00b('0x9')](),controller['accept']);router[_0xb00b('0x11')](_0xb00b('0x13'),auth['isAuthenticated'](),controller[_0xb00b('0x14')]);router[_0xb00b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xb00b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index bcd94d1..c8c430d 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 _0x5454=['long','DATE','INTEGER','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5454,0x15b));var _0x4545=function(_0x425ee1,_0xe4fef9){_0x425ee1=_0x425ee1-0x0;var _0x196421=_0x5454[_0x425ee1];return _0x196421;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x4545('0x0')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x4545('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4545('0x2')]('in',_0x4545('0x3')),'defaultValue':_0x4545('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4545('0x4')]},'to':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'cc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'bcc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'subject':{'type':Sequelize[_0x4545('0x0')]},'sentAt':{'type':Sequelize[_0x4545('0x6')]},'attach':{'type':Sequelize[_0x4545('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4545('0x1')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4545('0x6')]},'originTo':{'type':Sequelize[_0x4545('0x0')]('long')},'originCc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))}}; \ No newline at end of file +var _0xf567=['ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','long','TEXT','BOOLEAN'];(function(_0x3f8264,_0xa6bc29){var _0x2aa220=function(_0x49b5f4){while(--_0x49b5f4){_0x3f8264['push'](_0x3f8264['shift']());}};_0x2aa220(++_0xa6bc29);}(_0xf567,0x118));var _0x7f56=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf567[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x7f56('0x0'));var _=require(_0x7f56('0x1'));module[_0x7f56('0x2')]={'body':{'type':Sequelize['TEXT'](_0x7f56('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7f56('0x4')]('medium')},'read':{'type':Sequelize[_0x7f56('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f56('0x6')]('in',_0x7f56('0x7')),'defaultValue':_0x7f56('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x7f56('0x8')]},'to':{'type':Sequelize[_0x7f56('0x4')](_0x7f56('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x7f56('0x3'))},'bcc':{'type':Sequelize[_0x7f56('0x4')](_0x7f56('0x3'))},'subject':{'type':Sequelize[_0x7f56('0x4')]},'sentAt':{'type':Sequelize[_0x7f56('0x9')]},'attach':{'type':Sequelize[_0x7f56('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7f56('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7f56('0x9')]},'originTo':{'type':Sequelize[_0x7f56('0x4')](_0x7f56('0x3'))},'originCc':{'type':Sequelize[_0x7f56('0x4')](_0x7f56('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 43329ee..6fb2130 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 _0xcb81=['path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../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','./mailMessage.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','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailMessage','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','pass','service','user','attachments','length','join','root','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','server','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','headers','Bcc','basename','push','build','writeFileSync','log','unlinkSync','html-pdf','eml-format','zip-dir','bluebird','mustache','util'];(function(_0x3d0e70,_0x2ba218){var _0x31cad6=function(_0x229df3){while(--_0x229df3){_0x3d0e70['push'](_0x3d0e70['shift']());}};_0x31cad6(++_0x2ba218);}(_0xcb81,0x154));var _0x1cb8=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xcb81[_0x1c6089];return _0x4d97c1;};'use strict';var pdf=require(_0x1cb8('0x0'));var emlformat=require(_0x1cb8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1cb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cb8('0x3'));var Mustache=require(_0x1cb8('0x4'));var util=require(_0x1cb8('0x5'));var path=require(_0x1cb8('0x6'));var sox=require(_0x1cb8('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb8('0x8'));var fs=require('fs');var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var db=require('../../mysqldb')['db'];config[_0x1cb8('0x16')]=_[_0x1cb8('0x17')](config[_0x1cb8('0x16')],{'host':_0x1cb8('0x18'),'port':0x18eb});var socket=require(_0x1cb8('0x19'))(new Redis(config['redis']));require(_0x1cb8('0x1a'))[_0x1cb8('0x1b')](socket);var jayson=require(_0x1cb8('0x1c'));var client=jayson[_0x1cb8('0x1d')][_0x1cb8('0x1e')]({'port':0x232c});var client9003=jayson[_0x1cb8('0x1d')][_0x1cb8('0x1e')]({'port':0x232b});var client9002=jayson[_0x1cb8('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x17a95d,_0x4b4917,_0xf6b347){if(_0xf6b347){var _0x28b8ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28b8ff[_0x1cb8('0x1f')](_0x4b4917)){return _0x17a95d;}else{throw new db[(_0x1cb8('0x20'))][(_0x1cb8('0x21'))](_0x1cb8('0x22'));}}else{return _0x17a95d;}}function respondWithRpcPromise(_0x3bfbcf,_0x9f0adb,_0x2631db,_0x1f9fd7){return new BPromise(function(_0x11d9f4,_0x3cda27){var _0x5c403c=_0x1f9fd7||client;return _0x5c403c[_0x1cb8('0x23')](_0x3bfbcf,_0x2631db)[_0x1cb8('0x24')](function(_0x170f34){logger[_0x1cb8('0x25')]('MailMessage,\x20%s,\x20%s',_0x9f0adb,_0x1cb8('0x26'));logger['debug'](_0x1cb8('0x27'),_0x9f0adb,_0x1cb8('0x26'),JSON[_0x1cb8('0x28')](_0x170f34));if(_0x170f34[_0x1cb8('0x29')]){if(_0x170f34['error']['code']===0x1f4){logger[_0x1cb8('0x29')](_0x1cb8('0x2a'),_0x9f0adb,_0x170f34[_0x1cb8('0x29')][_0x1cb8('0x2b')]);return _0x3cda27(_0x170f34[_0x1cb8('0x29')][_0x1cb8('0x2b')]);}logger[_0x1cb8('0x29')]('MailMessage,\x20%s,\x20%s',_0x9f0adb,_0x170f34[_0x1cb8('0x29')][_0x1cb8('0x2b')]);return _0x11d9f4(_0x170f34[_0x1cb8('0x29')][_0x1cb8('0x2b')]);}else{logger[_0x1cb8('0x25')](_0x1cb8('0x2a'),_0x9f0adb,'request\x20sent');_0x11d9f4(_0x170f34[_0x1cb8('0x2c')][_0x1cb8('0x2b')]);}})[_0x1cb8('0x2d')](function(_0x3c1905){logger[_0x1cb8('0x29')]('MailMessage,\x20%s,\x20%s',_0x9f0adb,_0x3c1905);_0x3cda27(_0x3c1905);});});}function respondWithStatusCode(_0xed576b,_0x2e3adf){_0x2e3adf=_0x2e3adf||0xcc;return function(_0x3a8b53){if(_0x3a8b53){return _0xed576b[_0x1cb8('0x2e')](_0x2e3adf);}return _0xed576b['status'](_0x2e3adf)[_0x1cb8('0x2f')]();};}function respondWithResult(_0x2ba8c8,_0x3a6a67){_0x3a6a67=_0x3a6a67||0xc8;return function(_0x5bf630){if(_0x5bf630){return _0x2ba8c8[_0x1cb8('0x30')](_0x3a6a67)[_0x1cb8('0x31')](_0x5bf630);}};}function respondWithFilteredResult(_0x17abe1,_0x5558fe){return function(_0x73be67){if(_0x73be67){var _0x3e2af4=_0x73be67['count'],_0x239c62=_0x5558fe[_0x1cb8('0x32')],_0xca35f2=_0x5558fe[_0x1cb8('0x32')]+_0x5558fe[_0x1cb8('0x33')],_0x36f63d;if(_0xca35f2>=_0x3e2af4){_0xca35f2=_0x3e2af4;_0x36f63d=0xc8;}else{_0x36f63d=0xce;}_0x17abe1[_0x1cb8('0x30')](_0x36f63d);return _0x17abe1[_0x1cb8('0x34')](_0x1cb8('0x35'),_0x239c62+'-'+_0xca35f2+'/'+_0x3e2af4)[_0x1cb8('0x31')](_0x73be67);}return null;};}function patchUpdates(_0x18cc99){return function(_0x1aaae4){try{jsonpatch['apply'](_0x1aaae4,_0x18cc99,!![]);}catch(_0x5cd6bd){return BPromise[_0x1cb8('0x36')](_0x5cd6bd);}return _0x1aaae4[_0x1cb8('0x37')]();};}function saveUpdates(_0x18a003,_0x5be4b7){return function(_0x5f04e3){if(_0x5f04e3){return _0x5f04e3[_0x1cb8('0x38')](_0x18a003)[_0x1cb8('0x24')](function(_0x9cdbed){return _0x9cdbed;});}return null;};}function removeEntity(_0xb21715,_0x198848){return function(_0x63ee4e){if(_0x63ee4e){return _0x63ee4e[_0x1cb8('0x39')]()[_0x1cb8('0x24')](function(){_0xb21715['status'](0xcc)[_0x1cb8('0x2f')]();});}};}function handleEntityNotFound(_0x1a6518,_0x1f888e){return function(_0x328b7c){if(!_0x328b7c){_0x1a6518[_0x1cb8('0x2e')](0x194);}return _0x328b7c;};}function handleError(_0x421ce7,_0xb5bc3c){_0xb5bc3c=_0xb5bc3c||0x1f4;return function(_0x2ad7f6){logger[_0x1cb8('0x29')](_0x2ad7f6['stack']);if(_0x2ad7f6[_0x1cb8('0x3a')]){delete _0x2ad7f6[_0x1cb8('0x3a')];}_0x421ce7['status'](_0xb5bc3c)[_0x1cb8('0x3b')](_0x2ad7f6);};}exports[_0x1cb8('0x3c')]=function(_0x15d6fa,_0x28a016){var _0xedbbda={},_0x5dc4c0={},_0x385b4d={'count':0x0,'rows':[]};var _0x4666bc=_[_0x1cb8('0x3d')](db['MailMessage']['rawAttributes'],function(_0x532af0){return{'name':_0x532af0[_0x1cb8('0x3e')],'type':_0x532af0[_0x1cb8('0x3f')][_0x1cb8('0x40')]};});_0x5dc4c0[_0x1cb8('0x41')]=_['map'](_0x4666bc,'name');_0x5dc4c0[_0x1cb8('0x42')]=_[_0x1cb8('0x43')](_0x15d6fa[_0x1cb8('0x42')]);_0x5dc4c0[_0x1cb8('0x44')]=_[_0x1cb8('0x45')](_0x5dc4c0[_0x1cb8('0x41')],_0x5dc4c0[_0x1cb8('0x42')]);_0xedbbda[_0x1cb8('0x46')]=_['intersection'](_0x5dc4c0[_0x1cb8('0x41')],qs[_0x1cb8('0x47')](_0x15d6fa[_0x1cb8('0x42')][_0x1cb8('0x47')]));_0xedbbda['attributes']=_0xedbbda[_0x1cb8('0x46')]['length']?_0xedbbda[_0x1cb8('0x46')]:_0x5dc4c0[_0x1cb8('0x41')];if(!_0x15d6fa['query'][_0x1cb8('0x48')](_0x1cb8('0x49'))){_0xedbbda[_0x1cb8('0x33')]=qs['limit'](_0x15d6fa['query'][_0x1cb8('0x33')]);_0xedbbda['offset']=qs[_0x1cb8('0x32')](_0x15d6fa[_0x1cb8('0x42')][_0x1cb8('0x32')]);}_0xedbbda[_0x1cb8('0x4a')]=qs[_0x1cb8('0x4b')](_0x15d6fa[_0x1cb8('0x42')][_0x1cb8('0x4b')]);_0xedbbda['where']=qs[_0x1cb8('0x44')](_[_0x1cb8('0x4c')](_0x15d6fa[_0x1cb8('0x42')],_0x5dc4c0[_0x1cb8('0x44')]),_0x4666bc);if(_0x15d6fa['query'][_0x1cb8('0x4d')]){_0xedbbda[_0x1cb8('0x4e')]=_[_0x1cb8('0x4f')](_0xedbbda[_0x1cb8('0x4e')],{'$or':_[_0x1cb8('0x3d')](_0x4666bc,function(_0x4efbe2){if(_0x4efbe2[_0x1cb8('0x3f')]!==_0x1cb8('0x50')){var _0x3ae2d2={};_0x3ae2d2[_0x4efbe2[_0x1cb8('0x3a')]]={'$like':'%'+_0x15d6fa[_0x1cb8('0x42')]['filter']+'%'};return _0x3ae2d2;}})});}_0xedbbda=_[_0x1cb8('0x4f')]({},_0xedbbda,_0x15d6fa[_0x1cb8('0x51')]);var _0x5598b1={'where':_0xedbbda[_0x1cb8('0x4e')]};return db[_0x1cb8('0x52')][_0x1cb8('0x53')](_0x5598b1)[_0x1cb8('0x24')](function(_0xe8c8c7){_0x385b4d[_0x1cb8('0x53')]=_0xe8c8c7;if(_0x15d6fa[_0x1cb8('0x42')][_0x1cb8('0x54')]){_0xedbbda[_0x1cb8('0x55')]=[{'all':!![]}];}return db[_0x1cb8('0x52')][_0x1cb8('0x56')](_0xedbbda);})[_0x1cb8('0x24')](function(_0x3c9076){_0x385b4d[_0x1cb8('0x57')]=_0x3c9076;return _0x385b4d;})['then'](respondWithFilteredResult(_0x28a016,_0xedbbda))[_0x1cb8('0x2d')](handleError(_0x28a016,null));};exports[_0x1cb8('0x58')]=function(_0x366628,_0x41a57e){var _0x21aba7={'raw':!![],'where':{'id':_0x366628[_0x1cb8('0x59')]['id']}},_0x15f0ba={};_0x15f0ba['model']=_[_0x1cb8('0x43')](db[_0x1cb8('0x52')][_0x1cb8('0x5a')]);_0x15f0ba['query']=_['keys'](_0x366628[_0x1cb8('0x42')]);_0x15f0ba[_0x1cb8('0x44')]=_[_0x1cb8('0x45')](_0x15f0ba[_0x1cb8('0x41')],_0x15f0ba[_0x1cb8('0x42')]);_0x21aba7['attributes']=_[_0x1cb8('0x45')](_0x15f0ba[_0x1cb8('0x41')],qs[_0x1cb8('0x47')](_0x366628['query']['fields']));_0x21aba7['attributes']=_0x21aba7[_0x1cb8('0x46')]['length']?_0x21aba7[_0x1cb8('0x46')]:_0x15f0ba[_0x1cb8('0x41')];if(_0x366628[_0x1cb8('0x42')][_0x1cb8('0x54')]){_0x21aba7[_0x1cb8('0x55')]=[{'all':!![]}];}_0x21aba7=_['merge']({},_0x21aba7,_0x366628[_0x1cb8('0x51')]);return db[_0x1cb8('0x52')][_0x1cb8('0x5b')](_0x21aba7)[_0x1cb8('0x24')](handleEntityNotFound(_0x41a57e,null))[_0x1cb8('0x24')](respondWithResult(_0x41a57e,null))[_0x1cb8('0x2d')](handleError(_0x41a57e,null));};exports[_0x1cb8('0x38')]=function(_0x53e09e,_0x1f0dea){if(_0x53e09e[_0x1cb8('0x5c')]['id']){delete _0x53e09e[_0x1cb8('0x5c')]['id'];}return db[_0x1cb8('0x52')][_0x1cb8('0x5b')]({'where':{'id':_0x53e09e[_0x1cb8('0x59')]['id']}})[_0x1cb8('0x24')](handleEntityNotFound(_0x1f0dea,null))['then'](saveUpdates(_0x53e09e['body'],null))['then'](respondWithResult(_0x1f0dea,null))[_0x1cb8('0x2d')](handleError(_0x1f0dea,null));};exports['destroy']=function(_0x2f3daa,_0x23cea0){return db[_0x1cb8('0x52')][_0x1cb8('0x5b')]({'where':{'id':_0x2f3daa[_0x1cb8('0x59')]['id']}})['then'](handleEntityNotFound(_0x23cea0,null))['then'](removeEntity(_0x23cea0,null))['catch'](handleError(_0x23cea0,null));};exports[_0x1cb8('0x5d')]=function(_0x3f8cba,_0x482d4f){return db[_0x1cb8('0x52')]['describe']()[_0x1cb8('0x24')](respondWithResult(_0x482d4f,null))[_0x1cb8('0x2d')](handleError(_0x482d4f,null));};exports['create']=function(_0x340e8e,_0x19f3f0){return db[_0x1cb8('0x52')][_0x1cb8('0x5e')](_0x340e8e[_0x1cb8('0x5c')])[_0x1cb8('0x24')](function(_0x416817){if(_0x416817){if(_0x416817[_0x1cb8('0x5f')]===_0x1cb8('0x60')&&!_0x416817[_0x1cb8('0x61')]){var _0x2fb1a7,_0x46c27d,_0x379169;if(_0x340e8e['body']['to']){_0x46c27d=_0x340e8e[_0x1cb8('0x5c')]['to'][_0x1cb8('0x62')](',')[0x0];}return db[_0x1cb8('0x63')]['findOne']({'where':{'id':_0x416817[_0x1cb8('0x64')]},'include':[{'model':db[_0x1cb8('0x65')],'as':_0x1cb8('0x66'),'include':[{'model':db[_0x1cb8('0x67')],'as':'Contacts','where':{'email':_0x46c27d},'limit':0x1,'order':[[_0x1cb8('0x68'),_0x1cb8('0x69')]]}]},{'model':db['MailServerOut'],'as':_0x1cb8('0x6a'),'raw':!![]}]})[_0x1cb8('0x24')](function(_0x5db6d0){_0x2fb1a7=_0x5db6d0;if(_0x2fb1a7&&_0x2fb1a7[_0x1cb8('0x6a')]){var _0x46ed52={'tls':{'rejectUnauthorized':![]}};if(_[_0x1cb8('0x6b')](_0x2fb1a7[_0x1cb8('0x6a')]['service'])){_0x46ed52['host']=_0x2fb1a7['Smtp'][_0x1cb8('0x6c')];_0x46ed52[_0x1cb8('0x6d')]=_0x2fb1a7[_0x1cb8('0x6a')][_0x1cb8('0x6d')];_0x46ed52[_0x1cb8('0x6e')]=_0x2fb1a7[_0x1cb8('0x6a')][_0x1cb8('0x6e')];if(_0x2fb1a7['Smtp'][_0x1cb8('0x6f')]){_0x46ed52[_0x1cb8('0x70')]={'user':_0x2fb1a7[_0x1cb8('0x6a')]['user'],'pass':_0x2fb1a7[_0x1cb8('0x6a')][_0x1cb8('0x71')]};}}else{_0x46ed52[_0x1cb8('0x72')]=_0x2fb1a7[_0x1cb8('0x6a')][_0x1cb8('0x72')];_0x46ed52['auth']={'user':_0x2fb1a7[_0x1cb8('0x6a')][_0x1cb8('0x73')],'pass':_0x2fb1a7[_0x1cb8('0x6a')]['pass']};_0x46ed52[_0x1cb8('0x6e')]=_0x2fb1a7[_0x1cb8('0x6a')]['secure'];}if(_0x340e8e[_0x1cb8('0x5c')]['attachments']&&_0x340e8e['body'][_0x1cb8('0x74')][_0x1cb8('0x75')]){for(var _0x1b8b40=0x0;_0x1b8b40<_0x340e8e['body']['attachments']['length'];_0x1b8b40+=0x1){_0x340e8e[_0x1cb8('0x5c')][_0x1cb8('0x74')][_0x1b8b40]={'filename':_0x340e8e[_0x1cb8('0x5c')][_0x1cb8('0x74')][_0x1b8b40][_0x1cb8('0x3a')],'path':path[_0x1cb8('0x76')](config[_0x1cb8('0x77')],'server/files/attachments',_0x340e8e['body']['attachments'][_0x1b8b40]['basename'])};}}_0x379169={'account':_0x46ed52,'message':_0x340e8e[_0x1cb8('0x5c')]};return;}})['then'](function(){if(_0x2fb1a7[_0x1cb8('0x66')]){if(_0x2fb1a7['List']['Contacts']['length']){return _0x2fb1a7[_0x1cb8('0x66')][_0x1cb8('0x78')][0x0];}else{return db[_0x1cb8('0x67')][_0x1cb8('0x5e')](_[_0x1cb8('0x17')](_0x340e8e[_0x1cb8('0x5c')],{'firstName':_0x340e8e[_0x1cb8('0x5c')]['to'],'email':_0x340e8e[_0x1cb8('0x5c')]['to'],'phone':_0x340e8e[_0x1cb8('0x5c')]['to'],'ListId':_0x2fb1a7[_0x1cb8('0x79')]}));}}else{throw new Error(_0x1cb8('0x7a'));}})[_0x1cb8('0x24')](function(){if(_0x379169){return respondWithRpcPromise(_0x1cb8('0x7b'),_0x1cb8('0x7c'),_0x379169,client9003)[_0x1cb8('0x24')](function(_0x38aa03){return _0x416817['update']({'read':!![],'messageId':_0x38aa03[_0x1cb8('0x7d')],'sentAt':moment()[_0x1cb8('0x7e')](_0x1cb8('0x7f'))});})[_0x1cb8('0x2d')](function(_0x24a298){logger[_0x1cb8('0x29')]('%s',JSON['stringify'](_0x24a298));return _0x416817;});}return _0x416817;});}return _0x416817;}})[_0x1cb8('0x24')](respondWithResult(_0x19f3f0,0xc9))[_0x1cb8('0x2d')](handleError(_0x19f3f0,null));};var interaction_log=require(_0x1cb8('0x12'))(_0x1cb8('0x80'));exports[_0x1cb8('0x81')]=function(_0x48e593,_0x7e9918,_0x34094c){var _0x5bfe0c={'channel':_0x1cb8('0x82')};if(_0x48e593['body']['id']){delete _0x48e593[_0x1cb8('0x5c')]['id'];}_0x48e593[_0x1cb8('0x5c')][_0x1cb8('0x83')]=!![];_0x48e593['body'][_0x1cb8('0x84')]=moment()[_0x1cb8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x48e593['body'][_0x1cb8('0x85')]=_0x48e593[_0x1cb8('0x5c')]['UserId']||_0x48e593[_0x1cb8('0x73')]['id'];return db[_0x1cb8('0x52')][_0x1cb8('0x5b')]({'where':{'id':_0x48e593[_0x1cb8('0x59')]['id'],'UserId':null},'include':[{'model':db[_0x1cb8('0x67')],'as':_0x1cb8('0x86')}]})[_0x1cb8('0x24')](handleEntityNotFound(_0x7e9918,null))['then'](saveUpdates(_0x48e593[_0x1cb8('0x5c')],null))['then'](function(_0x5334c1){if(_0x5334c1){_0x5bfe0c['message']=_0x5334c1[_0x1cb8('0x87')]({'plain':!![]});return db[_0x1cb8('0x88')][_0x1cb8('0x5b')]({'where':{'id':_0x5334c1[_0x1cb8('0x89')]}});}return null;})[_0x1cb8('0x24')](handleEntityNotFound(_0x7e9918,null))[_0x1cb8('0x24')](function(_0x4822cc){if(_0x4822cc){return _0x4822cc['update']({'UserId':_0x48e593[_0x1cb8('0x5c')]['UserId'],'read1stAt':_[_0x1cb8('0x6b')](_0x4822cc[_0x1cb8('0x8a')])?moment()[_0x1cb8('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x7afd8f){if(_0x7afd8f){_0x5bfe0c['interaction']=_0x7afd8f[_0x1cb8('0x87')]({'plain':!![]});interaction_log[_0x1cb8('0x25')](_0x1cb8('0x8b'),_0x48e593[_0x1cb8('0x73')]['id'],_0x48e593[_0x1cb8('0x73')][_0x1cb8('0x3a')],_0x48e593[_0x1cb8('0x73')][_0x1cb8('0x8c')],_0x5bfe0c[_0x1cb8('0x8d')]['id'],_0x48e593[_0x1cb8('0x5c')]?JSON[_0x1cb8('0x28')](_0x48e593[_0x1cb8('0x5c')]):_0x1cb8('0x8e'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5bfe0c);}return null;})[_0x1cb8('0x24')](function(_0xf1a4cc){if(_0xf1a4cc){if(_0x48e593[_0x1cb8('0x5c')][_0x1cb8('0x8f')]){_0x5bfe0c['message'][_0x1cb8('0x90')]=util[_0x1cb8('0x7e')](_0x1cb8('0x91'),_0x48e593[_0x1cb8('0x73')][_0x1cb8('0x3a')]);_0x5bfe0c['message'][_0x1cb8('0x92')]=_0x5bfe0c[_0x1cb8('0x92')];_0x5bfe0c[_0x1cb8('0x2b')][_0x1cb8('0x93')]=_0x1cb8('0x81');return respondWithRpcPromise(_0x1cb8('0x94'),_0x1cb8('0x94'),{'event':_0x1cb8('0x95'),'message':_0x5bfe0c[_0x1cb8('0x2b')]},client9002)[_0x1cb8('0x24')](function(){return _0x5bfe0c;});}return _0x5bfe0c;}return null;})['then'](respondWithResult(_0x7e9918,null))[_0x1cb8('0x2d')](handleError(_0x7e9918,null));};var interaction_log=require(_0x1cb8('0x12'))('mail-interactions');exports['reject']=function(_0x1d03e1,_0x5bbb90,_0x55161c){var _0x3a786a={'agent':{},'channel':_0x1cb8('0x82')};if(_0x1d03e1['body']['id']){delete _0x1d03e1['body']['id'];}_0x1d03e1[_0x1cb8('0x5c')]['UserId']=_0x1d03e1[_0x1cb8('0x5c')]['UserId']||_0x1d03e1[_0x1cb8('0x73')]['id'];_0x3a786a[_0x1cb8('0x96')]['id']=_0x1d03e1['body'][_0x1cb8('0x85')];return db[_0x1cb8('0x52')][_0x1cb8('0x5b')]({'where':{'id':_0x1d03e1[_0x1cb8('0x59')]['id'],'UserId':null}})[_0x1cb8('0x24')](handleEntityNotFound(_0x5bbb90,null))[_0x1cb8('0x24')](function(_0xeea4ce){if(_0xeea4ce){_0x3a786a[_0x1cb8('0x2b')]=_0xeea4ce['get']({'plain':!![]});return db[_0x1cb8('0x88')]['find']({'where':{'id':_0xeea4ce[_0x1cb8('0x89')]}});}return null;})[_0x1cb8('0x24')](handleEntityNotFound(_0x5bbb90,null))[_0x1cb8('0x24')](function(_0x5bb08c){if(_0x5bb08c){_0x3a786a['interaction']=_0x5bb08c[_0x1cb8('0x87')]({'plain':!![]});interaction_log[_0x1cb8('0x25')](_0x1cb8('0x97'),_0x1d03e1['user']['id'],_0x1d03e1['user']['name'],_0x1d03e1['user'][_0x1cb8('0x8c')],_0x3a786a[_0x1cb8('0x8d')]['id'],_0x1d03e1[_0x1cb8('0x5c')]?JSON[_0x1cb8('0x28')](_0x1d03e1[_0x1cb8('0x5c')]):_0x1cb8('0x8e'));return respondWithRpcPromise('RejectMessage',_0x1cb8('0x98'),_0x3a786a);}return null;})[_0x1cb8('0x24')](function(_0x359a7d){if(_0x359a7d){_0x359a7d[_0x1cb8('0x2b')][_0x1cb8('0x90')]=util['format'](_0x1cb8('0x91'),_0x1d03e1[_0x1cb8('0x73')][_0x1cb8('0x3a')]);_0x359a7d[_0x1cb8('0x2b')][_0x1cb8('0x92')]=_0x3a786a[_0x1cb8('0x92')];_0x359a7d[_0x1cb8('0x2b')]['event']='reject';respondWithRpcPromise('EventManager',_0x1cb8('0x94'),{'event':_0x1cb8('0x99'),'message':_0x359a7d[_0x1cb8('0x2b')]},client9002);return _0x3a786a;}return null;})[_0x1cb8('0x24')](respondWithResult(_0x5bbb90,null))['catch'](handleError(_0x5bbb90,null));};exports[_0x1cb8('0x9a')]=function(_0x5829f3,_0xebe8da){var _0x107833=moment()[_0x1cb8('0x9b')]()['toString']();var _0x5e6b36=path[_0x1cb8('0x76')](config[_0x1cb8('0x77')],_0x1cb8('0x9c'),_0x1cb8('0x9d'),'tmp');var _0x457386=path[_0x1cb8('0x76')](config[_0x1cb8('0x77')],'server',_0x1cb8('0x9d'),_0x1cb8('0x74'));var _0x276126=util[_0x1cb8('0x7e')](_0x1cb8('0x9e'),_0x107833);return db['MailMessage']['find']({'where':{'id':_0x5829f3[_0x1cb8('0x59')]['id']},'attributes':['id','body',_0x1cb8('0x9f'),'to','cc',_0x1cb8('0xa0'),'subject',_0x1cb8('0xa1')],'include':_0x5829f3[_0x1cb8('0x42')][_0x1cb8('0x74')]?[{'model':db[_0x1cb8('0xa2')],'as':_0x1cb8('0xa3')}]:undefined})['then'](handleEntityNotFound(_0xebe8da,null))[_0x1cb8('0x24')](function(_0x1a700d){if(_0x1a700d){var _0x3c07b5=_0x1a700d;var _0xd6451e={'from':_0x3c07b5['from'],'to':_0x3c07b5['to'],'subject':_0x3c07b5[_0x1cb8('0xa4')],'html':_0x3c07b5[_0x1cb8('0x5c')],'headers':{'Date':moment(_0x3c07b5[_0x1cb8('0xa1')])[_0x1cb8('0x7e')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1a700d['cc']){_0xd6451e['headers']['Cc']=_0x1a700d['cc'];}if(_0x1a700d['bcc']){_0xd6451e[_0x1cb8('0xa5')][_0x1cb8('0xa6')]=_0x1a700d[_0x1cb8('0xa0')];}return new BPromise(function(_0x24ac20,_0x37ca01){if(_0x1a700d[_0x1cb8('0xa3')]){for(var _0x53bb05=0x0;_0x53bb05<_0x1a700d[_0x1cb8('0xa3')][_0x1cb8('0x75')];_0x53bb05++){var _0x9141ed=_0x1a700d[_0x1cb8('0xa3')][_0x53bb05];var _0x43c39c=path[_0x1cb8('0x76')](_0x457386,_0x9141ed[_0x1cb8('0xa7')]);if(fs['existsSync'](_0x43c39c)){_0xd6451e[_0x1cb8('0x74')][_0x1cb8('0xa8')]({'name':_0x9141ed[_0x1cb8('0x3a')],'contentType':_0x9141ed[_0x1cb8('0x3f')],'data':fs['readFileSync'](_0x43c39c)});}}}emlformat[_0x1cb8('0xa9')](_0xd6451e,function(_0x483c87,_0x3b4a20){if(_0x483c87)return _0x37ca01(_0x483c87);fs[_0x1cb8('0xaa')](path['join'](_0x5e6b36,_0x276126),_0x3b4a20);return _0x24ac20(_0x3b4a20);});});}})[_0x1cb8('0x24')](function(_0x2ecd2e){if(_0x2ecd2e){return _0xebe8da[_0x1cb8('0x9a')](path[_0x1cb8('0x76')](_0x5e6b36,_0x276126),_0x276126,function(_0x4b16d4){if(_0x4b16d4){console[_0x1cb8('0xab')]('err',_0x4b16d4);}else{fs[_0x1cb8('0xac')](path['join'](_0x5e6b36,_0x276126));}});}})[_0x1cb8('0x2d')](handleError(_0xebe8da,null));}; \ No newline at end of file +var _0x1b94=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','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','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','keys','length','find','body','params','catch','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','auth','user','pass','service','attachments','join','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','mail','read','readAt','UserId','Contact','MailInteraction','MailInteractionId','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','download','unix','root','server','files','tmp','bcc','subject','createdAt','Attachment','Attachments','from','headers','Bcc','push','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x220618,_0x30d97a){var _0x40cffb=function(_0x5d3d3f){while(--_0x5d3d3f){_0x220618['push'](_0x220618['shift']());}};_0x40cffb(++_0x30d97a);}(_0x1b94,0x1f2));var _0x41b9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1b94[_0x4fbfd9];return _0x31dc94;};'use strict';var pdf=require(_0x41b9('0x0'));var emlformat=require(_0x41b9('0x1'));var rimraf=require(_0x41b9('0x2'));var zipdir=require(_0x41b9('0x3'));var jsonpatch=require(_0x41b9('0x4'));var rp=require('request-promise');var moment=require(_0x41b9('0x5'));var BPromise=require(_0x41b9('0x6'));var Mustache=require(_0x41b9('0x7'));var util=require('util');var path=require(_0x41b9('0x8'));var sox=require(_0x41b9('0x9'));var csv=require(_0x41b9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x41b9('0xb'));var squel=require(_0x41b9('0xc'));var crypto=require(_0x41b9('0xd'));var jsforce=require(_0x41b9('0xe'));var deskjs=require(_0x41b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x41b9('0x10'));var Papa=require(_0x41b9('0x11'));var Redis=require('ioredis');var authService=require(_0x41b9('0x12'));var qs=require(_0x41b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41b9('0x14'));var logger=require(_0x41b9('0x15'))('api');var utils=require(_0x41b9('0x16'));var config=require('../../config/environment');var db=require(_0x41b9('0x17'))['db'];config['redis']=_[_0x41b9('0x18')](config[_0x41b9('0x19')],{'host':_0x41b9('0x1a'),'port':0x18eb});var socket=require(_0x41b9('0x1b'))(new Redis(config[_0x41b9('0x19')]));require('./mailMessage.socket')[_0x41b9('0x1c')](socket);var jayson=require(_0x41b9('0x1d'));var client=jayson['client'][_0x41b9('0x1e')]({'port':0x232c});var client9003=jayson[_0x41b9('0x1f')][_0x41b9('0x1e')]({'port':0x232b});var client9002=jayson[_0x41b9('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x5849aa,_0x4a6357,_0x2d7bf0){if(_0x2d7bf0){var _0x432cd7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x432cd7['test'](_0x4a6357)){return _0x5849aa;}else{throw new db['Sequelize'][(_0x41b9('0x20'))](_0x41b9('0x21'));}}else{return _0x5849aa;}}function respondWithRpcPromise(_0x17b811,_0x3ba9f3,_0x45b813,_0x475aa8){return new BPromise(function(_0x5d5828,_0x10bfdf){var _0x12cab8=_0x475aa8||client;return _0x12cab8['request'](_0x17b811,_0x45b813)[_0x41b9('0x22')](function(_0x2f6b69){logger[_0x41b9('0x23')](_0x41b9('0x24'),_0x3ba9f3,_0x41b9('0x25'));logger[_0x41b9('0x26')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3ba9f3,_0x41b9('0x25'),JSON['stringify'](_0x2f6b69));if(_0x2f6b69[_0x41b9('0x27')]){if(_0x2f6b69[_0x41b9('0x27')][_0x41b9('0x28')]===0x1f4){logger[_0x41b9('0x27')](_0x41b9('0x24'),_0x3ba9f3,_0x2f6b69['error'][_0x41b9('0x29')]);return _0x10bfdf(_0x2f6b69['error']['message']);}logger['error'](_0x41b9('0x24'),_0x3ba9f3,_0x2f6b69[_0x41b9('0x27')][_0x41b9('0x29')]);return _0x5d5828(_0x2f6b69[_0x41b9('0x27')][_0x41b9('0x29')]);}else{logger[_0x41b9('0x23')](_0x41b9('0x24'),_0x3ba9f3,_0x41b9('0x25'));_0x5d5828(_0x2f6b69[_0x41b9('0x2a')]['message']);}})['catch'](function(_0x1a3aee){logger[_0x41b9('0x27')](_0x41b9('0x24'),_0x3ba9f3,_0x1a3aee);_0x10bfdf(_0x1a3aee);});});}function respondWithStatusCode(_0x1b96a9,_0x3dffb2){_0x3dffb2=_0x3dffb2||0xcc;return function(_0x16d96e){if(_0x16d96e){return _0x1b96a9[_0x41b9('0x2b')](_0x3dffb2);}return _0x1b96a9[_0x41b9('0x2c')](_0x3dffb2)['end']();};}function respondWithResult(_0x5eeb51,_0x1ae013){_0x1ae013=_0x1ae013||0xc8;return function(_0x5463e1){if(_0x5463e1){return _0x5eeb51[_0x41b9('0x2c')](_0x1ae013)['json'](_0x5463e1);}};}function respondWithFilteredResult(_0x4592ac,_0x24f46d){return function(_0x4be093){if(_0x4be093){var _0x4d01d7=_0x4be093[_0x41b9('0x2d')],_0x60b1ca=_0x24f46d[_0x41b9('0x2e')],_0x12178a=_0x24f46d['offset']+_0x24f46d[_0x41b9('0x2f')],_0x5de50a;if(_0x12178a>=_0x4d01d7){_0x12178a=_0x4d01d7;_0x5de50a=0xc8;}else{_0x5de50a=0xce;}_0x4592ac['status'](_0x5de50a);return _0x4592ac['set'](_0x41b9('0x30'),_0x60b1ca+'-'+_0x12178a+'/'+_0x4d01d7)['json'](_0x4be093);}return null;};}function patchUpdates(_0xaeeefd){return function(_0x1579e6){try{jsonpatch[_0x41b9('0x31')](_0x1579e6,_0xaeeefd,!![]);}catch(_0x55d6db){return BPromise[_0x41b9('0x32')](_0x55d6db);}return _0x1579e6[_0x41b9('0x33')]();};}function saveUpdates(_0x1c6817,_0x241395){return function(_0x699060){if(_0x699060){return _0x699060[_0x41b9('0x34')](_0x1c6817)[_0x41b9('0x22')](function(_0x395c1e){return _0x395c1e;});}return null;};}function removeEntity(_0x341ebf,_0x1434b8){return function(_0x272dfe){if(_0x272dfe){return _0x272dfe[_0x41b9('0x35')]()['then'](function(){_0x341ebf[_0x41b9('0x2c')](0xcc)[_0x41b9('0x36')]();});}};}function handleEntityNotFound(_0x471fef,_0x1bf311){return function(_0x582053){if(!_0x582053){_0x471fef[_0x41b9('0x2b')](0x194);}return _0x582053;};}function handleError(_0x50cb25,_0x57ed46){_0x57ed46=_0x57ed46||0x1f4;return function(_0x37398e){logger['error'](_0x37398e[_0x41b9('0x37')]);if(_0x37398e['name']){delete _0x37398e[_0x41b9('0x38')];}_0x50cb25[_0x41b9('0x2c')](_0x57ed46)[_0x41b9('0x39')](_0x37398e);};}exports[_0x41b9('0x3a')]=function(_0x1bb4c9,_0x473389){var _0x5d0e70={},_0x498b9d={},_0x193c3a={'count':0x0,'rows':[]};var _0x32196e=_['map'](db[_0x41b9('0x3b')][_0x41b9('0x3c')],function(_0x26f9a4){return{'name':_0x26f9a4[_0x41b9('0x3d')],'type':_0x26f9a4[_0x41b9('0x3e')][_0x41b9('0x3f')]};});_0x498b9d[_0x41b9('0x40')]=_[_0x41b9('0x41')](_0x32196e,_0x41b9('0x38'));_0x498b9d[_0x41b9('0x42')]=_['keys'](_0x1bb4c9['query']);_0x498b9d[_0x41b9('0x43')]=_[_0x41b9('0x44')](_0x498b9d[_0x41b9('0x40')],_0x498b9d[_0x41b9('0x42')]);_0x5d0e70['attributes']=_['intersection'](_0x498b9d['model'],qs[_0x41b9('0x45')](_0x1bb4c9[_0x41b9('0x42')][_0x41b9('0x45')]));_0x5d0e70['attributes']=_0x5d0e70['attributes']['length']?_0x5d0e70[_0x41b9('0x46')]:_0x498b9d[_0x41b9('0x40')];if(!_0x1bb4c9[_0x41b9('0x42')]['hasOwnProperty'](_0x41b9('0x47'))){_0x5d0e70[_0x41b9('0x2f')]=qs[_0x41b9('0x2f')](_0x1bb4c9['query']['limit']);_0x5d0e70[_0x41b9('0x2e')]=qs[_0x41b9('0x2e')](_0x1bb4c9[_0x41b9('0x42')]['offset']);}_0x5d0e70[_0x41b9('0x48')]=qs[_0x41b9('0x49')](_0x1bb4c9[_0x41b9('0x42')]['sort']);_0x5d0e70[_0x41b9('0x4a')]=qs[_0x41b9('0x43')](_[_0x41b9('0x4b')](_0x1bb4c9[_0x41b9('0x42')],_0x498b9d['filters']),_0x32196e);if(_0x1bb4c9[_0x41b9('0x42')]['filter']){_0x5d0e70[_0x41b9('0x4a')]=_[_0x41b9('0x4c')](_0x5d0e70['where'],{'$or':_[_0x41b9('0x41')](_0x32196e,function(_0x4d0c2c){if(_0x4d0c2c[_0x41b9('0x3e')]!=='VIRTUAL'){var _0x5427f7={};_0x5427f7[_0x4d0c2c[_0x41b9('0x38')]]={'$like':'%'+_0x1bb4c9['query'][_0x41b9('0x4d')]+'%'};return _0x5427f7;}})});}_0x5d0e70=_['merge']({},_0x5d0e70,_0x1bb4c9[_0x41b9('0x4e')]);var _0x42c126={'where':_0x5d0e70[_0x41b9('0x4a')]};return db[_0x41b9('0x3b')][_0x41b9('0x2d')](_0x42c126)[_0x41b9('0x22')](function(_0x365970){_0x193c3a['count']=_0x365970;if(_0x1bb4c9[_0x41b9('0x42')][_0x41b9('0x4f')]){_0x5d0e70[_0x41b9('0x50')]=[{'all':!![]}];}return db[_0x41b9('0x3b')][_0x41b9('0x51')](_0x5d0e70);})[_0x41b9('0x22')](function(_0xcfa119){_0x193c3a[_0x41b9('0x52')]=_0xcfa119;return _0x193c3a;})[_0x41b9('0x22')](respondWithFilteredResult(_0x473389,_0x5d0e70))['catch'](handleError(_0x473389,null));};exports['show']=function(_0x547037,_0x45b03e){var _0xebbc7c={'raw':!![],'where':{'id':_0x547037['params']['id']}},_0x490a08={};_0x490a08[_0x41b9('0x40')]=_[_0x41b9('0x53')](db[_0x41b9('0x3b')][_0x41b9('0x3c')]);_0x490a08[_0x41b9('0x42')]=_[_0x41b9('0x53')](_0x547037[_0x41b9('0x42')]);_0x490a08['filters']=_[_0x41b9('0x44')](_0x490a08[_0x41b9('0x40')],_0x490a08[_0x41b9('0x42')]);_0xebbc7c[_0x41b9('0x46')]=_['intersection'](_0x490a08['model'],qs[_0x41b9('0x45')](_0x547037[_0x41b9('0x42')][_0x41b9('0x45')]));_0xebbc7c['attributes']=_0xebbc7c[_0x41b9('0x46')][_0x41b9('0x54')]?_0xebbc7c[_0x41b9('0x46')]:_0x490a08[_0x41b9('0x40')];if(_0x547037[_0x41b9('0x42')][_0x41b9('0x4f')]){_0xebbc7c['include']=[{'all':!![]}];}_0xebbc7c=_[_0x41b9('0x4c')]({},_0xebbc7c,_0x547037[_0x41b9('0x4e')]);return db[_0x41b9('0x3b')][_0x41b9('0x55')](_0xebbc7c)[_0x41b9('0x22')](handleEntityNotFound(_0x45b03e,null))[_0x41b9('0x22')](respondWithResult(_0x45b03e,null))['catch'](handleError(_0x45b03e,null));};exports['update']=function(_0x1f817d,_0x4e1548){if(_0x1f817d[_0x41b9('0x56')]['id']){delete _0x1f817d[_0x41b9('0x56')]['id'];}return db['MailMessage'][_0x41b9('0x55')]({'where':{'id':_0x1f817d[_0x41b9('0x57')]['id']}})[_0x41b9('0x22')](handleEntityNotFound(_0x4e1548,null))['then'](saveUpdates(_0x1f817d['body'],null))['then'](respondWithResult(_0x4e1548,null))[_0x41b9('0x58')](handleError(_0x4e1548,null));};exports['destroy']=function(_0x34b8a4,_0x2913a4){return db['MailMessage']['find']({'where':{'id':_0x34b8a4[_0x41b9('0x57')]['id']}})[_0x41b9('0x22')](handleEntityNotFound(_0x2913a4,null))[_0x41b9('0x22')](removeEntity(_0x2913a4,null))['catch'](handleError(_0x2913a4,null));};exports[_0x41b9('0x59')]=function(_0x3f8f5a,_0x811d92){return db[_0x41b9('0x3b')]['describe']()[_0x41b9('0x22')](respondWithResult(_0x811d92,null))[_0x41b9('0x58')](handleError(_0x811d92,null));};exports[_0x41b9('0x5a')]=function(_0x5510a3,_0x1e317c){return db[_0x41b9('0x3b')][_0x41b9('0x5a')](_0x5510a3[_0x41b9('0x56')])[_0x41b9('0x22')](function(_0x448677){if(_0x448677){if(_0x448677[_0x41b9('0x5b')]===_0x41b9('0x5c')&&!_0x448677[_0x41b9('0x5d')]){var _0x32602,_0x4c2f8b,_0x243b84;if(_0x5510a3['body']['to']){_0x4c2f8b=_0x5510a3[_0x41b9('0x56')]['to'][_0x41b9('0x5e')](',')[0x0];}return db[_0x41b9('0x5f')][_0x41b9('0x60')]({'where':{'id':_0x448677[_0x41b9('0x61')]},'include':[{'model':db[_0x41b9('0x62')],'as':_0x41b9('0x63'),'include':[{'model':db[_0x41b9('0x64')],'as':_0x41b9('0x65'),'where':{'email':_0x4c2f8b},'limit':0x1,'order':[[_0x41b9('0x66'),_0x41b9('0x67')]]}]},{'model':db[_0x41b9('0x68')],'as':_0x41b9('0x69'),'raw':!![]}]})['then'](function(_0x5e6caf){_0x32602=_0x5e6caf;if(_0x32602&&_0x32602[_0x41b9('0x69')]){var _0x22273a={'tls':{'rejectUnauthorized':![]}};if(_[_0x41b9('0x6a')](_0x32602[_0x41b9('0x69')]['service'])){_0x22273a[_0x41b9('0x6b')]=_0x32602[_0x41b9('0x69')]['host'];_0x22273a[_0x41b9('0x6c')]=_0x32602[_0x41b9('0x69')][_0x41b9('0x6c')];_0x22273a[_0x41b9('0x6d')]=_0x32602[_0x41b9('0x69')][_0x41b9('0x6d')];if(_0x32602[_0x41b9('0x69')]['authentication']){_0x22273a[_0x41b9('0x6e')]={'user':_0x32602[_0x41b9('0x69')][_0x41b9('0x6f')],'pass':_0x32602[_0x41b9('0x69')][_0x41b9('0x70')]};}}else{_0x22273a[_0x41b9('0x71')]=_0x32602[_0x41b9('0x69')]['service'];_0x22273a[_0x41b9('0x6e')]={'user':_0x32602['Smtp'][_0x41b9('0x6f')],'pass':_0x32602[_0x41b9('0x69')][_0x41b9('0x70')]};_0x22273a[_0x41b9('0x6d')]=_0x32602['Smtp'][_0x41b9('0x6d')];}if(_0x5510a3[_0x41b9('0x56')]['attachments']&&_0x5510a3[_0x41b9('0x56')][_0x41b9('0x72')][_0x41b9('0x54')]){for(var _0x50b5b3=0x0;_0x50b5b3<_0x5510a3[_0x41b9('0x56')][_0x41b9('0x72')][_0x41b9('0x54')];_0x50b5b3+=0x1){_0x5510a3[_0x41b9('0x56')][_0x41b9('0x72')][_0x50b5b3]={'filename':_0x5510a3[_0x41b9('0x56')][_0x41b9('0x72')][_0x50b5b3][_0x41b9('0x38')],'path':path[_0x41b9('0x73')](config['root'],_0x41b9('0x74'),_0x5510a3[_0x41b9('0x56')][_0x41b9('0x72')][_0x50b5b3][_0x41b9('0x75')])};}}_0x243b84={'account':_0x22273a,'message':_0x5510a3[_0x41b9('0x56')]};return;}})[_0x41b9('0x22')](function(){if(_0x32602['List']){if(_0x32602['List'][_0x41b9('0x65')][_0x41b9('0x54')]){return _0x32602['List'][_0x41b9('0x65')][0x0];}else{return db['CmContact'][_0x41b9('0x5a')](_[_0x41b9('0x18')](_0x5510a3[_0x41b9('0x56')],{'firstName':_0x5510a3[_0x41b9('0x56')]['to'],'email':_0x5510a3[_0x41b9('0x56')]['to'],'phone':_0x5510a3['body']['to'],'ListId':_0x32602[_0x41b9('0x76')]}));}}else{throw new Error(_0x41b9('0x77'));}})[_0x41b9('0x22')](function(){if(_0x243b84){return respondWithRpcPromise('SendMail',_0x41b9('0x78'),_0x243b84,client9003)[_0x41b9('0x22')](function(_0x290a28){return _0x448677[_0x41b9('0x34')]({'read':!![],'messageId':_0x290a28[_0x41b9('0x79')],'sentAt':moment()[_0x41b9('0x7a')](_0x41b9('0x7b'))});})[_0x41b9('0x58')](function(_0x1e1106){logger[_0x41b9('0x27')]('%s',JSON[_0x41b9('0x7c')](_0x1e1106));return _0x448677;});}return _0x448677;});}return _0x448677;}})[_0x41b9('0x22')](respondWithResult(_0x1e317c,0xc9))['catch'](handleError(_0x1e317c,null));};var interaction_log=require('../../config/logger')(_0x41b9('0x7d'));exports['accept']=function(_0x5517f8,_0x11a02f,_0x542c29){var _0xfadedd={'channel':_0x41b9('0x7e')};if(_0x5517f8[_0x41b9('0x56')]['id']){delete _0x5517f8[_0x41b9('0x56')]['id'];}_0x5517f8[_0x41b9('0x56')][_0x41b9('0x7f')]=!![];_0x5517f8[_0x41b9('0x56')][_0x41b9('0x80')]=moment()[_0x41b9('0x7a')](_0x41b9('0x7b'));_0x5517f8[_0x41b9('0x56')][_0x41b9('0x81')]=_0x5517f8[_0x41b9('0x56')][_0x41b9('0x81')]||_0x5517f8[_0x41b9('0x6f')]['id'];return db[_0x41b9('0x3b')]['find']({'where':{'id':_0x5517f8[_0x41b9('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x41b9('0x82')}]})[_0x41b9('0x22')](handleEntityNotFound(_0x11a02f,null))[_0x41b9('0x22')](saveUpdates(_0x5517f8['body'],null))[_0x41b9('0x22')](function(_0x250da0){if(_0x250da0){_0xfadedd[_0x41b9('0x29')]=_0x250da0['get']({'plain':!![]});return db[_0x41b9('0x83')][_0x41b9('0x55')]({'where':{'id':_0x250da0[_0x41b9('0x84')]}});}return null;})[_0x41b9('0x22')](handleEntityNotFound(_0x11a02f,null))[_0x41b9('0x22')](function(_0x234722){if(_0x234722){return _0x234722[_0x41b9('0x34')]({'UserId':_0x5517f8[_0x41b9('0x56')][_0x41b9('0x81')],'read1stAt':_['isNil'](_0x234722['read1stAt'])?moment()[_0x41b9('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x41b9('0x22')](function(_0x3343cb){if(_0x3343cb){_0xfadedd[_0x41b9('0x85')]=_0x3343cb[_0x41b9('0x86')]({'plain':!![]});interaction_log[_0x41b9('0x23')](_0x41b9('0x87'),_0x5517f8['user']['id'],_0x5517f8[_0x41b9('0x6f')][_0x41b9('0x38')],_0x5517f8[_0x41b9('0x6f')][_0x41b9('0x88')],_0xfadedd[_0x41b9('0x85')]['id'],_0x5517f8[_0x41b9('0x56')]?JSON['stringify'](_0x5517f8[_0x41b9('0x56')]):_0x41b9('0x89'));return respondWithRpcPromise(_0x41b9('0x8a'),_0x41b9('0x8b'),_0xfadedd);}return null;})[_0x41b9('0x22')](function(_0x274f6e){if(_0x274f6e){if(_0x5517f8['body']['manual']){_0xfadedd['message']['interface']=util[_0x41b9('0x7a')](_0x41b9('0x8c'),_0x5517f8[_0x41b9('0x6f')]['name']);_0xfadedd['message'][_0x41b9('0x8d')]=_0xfadedd[_0x41b9('0x8d')];_0xfadedd[_0x41b9('0x29')]['event']='accept';return respondWithRpcPromise(_0x41b9('0x8e'),'EventManager',{'event':_0x41b9('0x8f'),'message':_0xfadedd['message']},client9002)[_0x41b9('0x22')](function(){return _0xfadedd;});}return _0xfadedd;}return null;})[_0x41b9('0x22')](respondWithResult(_0x11a02f,null))[_0x41b9('0x58')](handleError(_0x11a02f,null));};var interaction_log=require(_0x41b9('0x15'))('mail-interactions');exports['reject']=function(_0x1d5a4e,_0x43d548,_0x375e3e){var _0x47bb9a={'agent':{},'channel':_0x41b9('0x7e')};if(_0x1d5a4e[_0x41b9('0x56')]['id']){delete _0x1d5a4e[_0x41b9('0x56')]['id'];}_0x1d5a4e[_0x41b9('0x56')]['UserId']=_0x1d5a4e[_0x41b9('0x56')][_0x41b9('0x81')]||_0x1d5a4e[_0x41b9('0x6f')]['id'];_0x47bb9a[_0x41b9('0x90')]['id']=_0x1d5a4e['body'][_0x41b9('0x81')];return db['MailMessage'][_0x41b9('0x55')]({'where':{'id':_0x1d5a4e['params']['id'],'UserId':null}})[_0x41b9('0x22')](handleEntityNotFound(_0x43d548,null))[_0x41b9('0x22')](function(_0x5d8464){if(_0x5d8464){_0x47bb9a[_0x41b9('0x29')]=_0x5d8464['get']({'plain':!![]});return db[_0x41b9('0x83')]['find']({'where':{'id':_0x5d8464[_0x41b9('0x84')]}});}return null;})[_0x41b9('0x22')](handleEntityNotFound(_0x43d548,null))[_0x41b9('0x22')](function(_0x55fbef){if(_0x55fbef){_0x47bb9a['interaction']=_0x55fbef[_0x41b9('0x86')]({'plain':!![]});interaction_log[_0x41b9('0x23')](_0x41b9('0x91'),_0x1d5a4e['user']['id'],_0x1d5a4e['user'][_0x41b9('0x38')],_0x1d5a4e[_0x41b9('0x6f')]['role'],_0x47bb9a[_0x41b9('0x85')]['id'],_0x1d5a4e['body']?JSON['stringify'](_0x1d5a4e[_0x41b9('0x56')]):_0x41b9('0x89'));return respondWithRpcPromise(_0x41b9('0x92'),_0x41b9('0x93'),_0x47bb9a);}return null;})['then'](function(_0x22a8ac){if(_0x22a8ac){_0x22a8ac[_0x41b9('0x29')]['interface']=util[_0x41b9('0x7a')]('SIP/%s',_0x1d5a4e[_0x41b9('0x6f')][_0x41b9('0x38')]);_0x22a8ac[_0x41b9('0x29')][_0x41b9('0x8d')]=_0x47bb9a[_0x41b9('0x8d')];_0x22a8ac[_0x41b9('0x29')][_0x41b9('0x94')]=_0x41b9('0x32');respondWithRpcPromise(_0x41b9('0x8e'),_0x41b9('0x8e'),{'event':_0x41b9('0x95'),'message':_0x22a8ac[_0x41b9('0x29')]},client9002);return _0x47bb9a;}return null;})[_0x41b9('0x22')](respondWithResult(_0x43d548,null))[_0x41b9('0x58')](handleError(_0x43d548,null));};exports[_0x41b9('0x96')]=function(_0x380366,_0x188795){var _0x36ab37=moment()[_0x41b9('0x97')]()['toString']();var _0xf85cad=path['join'](config[_0x41b9('0x98')],_0x41b9('0x99'),_0x41b9('0x9a'),_0x41b9('0x9b'));var _0xe7e7d1=path['join'](config[_0x41b9('0x98')],'server','files','attachments');var _0x2f6080=util[_0x41b9('0x7a')]('message-%s.eml',_0x36ab37);return db['MailMessage'][_0x41b9('0x55')]({'where':{'id':_0x380366[_0x41b9('0x57')]['id']},'attributes':['id','body','from','to','cc',_0x41b9('0x9c'),_0x41b9('0x9d'),_0x41b9('0x9e')],'include':_0x380366[_0x41b9('0x42')][_0x41b9('0x72')]?[{'model':db[_0x41b9('0x9f')],'as':_0x41b9('0xa0')}]:undefined})[_0x41b9('0x22')](handleEntityNotFound(_0x188795,null))[_0x41b9('0x22')](function(_0xafe1b8){if(_0xafe1b8){var _0x40365f=_0xafe1b8;var _0xccf928={'from':_0x40365f[_0x41b9('0xa1')],'to':_0x40365f['to'],'subject':_0x40365f['subject'],'html':_0x40365f[_0x41b9('0x56')],'headers':{'Date':moment(_0x40365f[_0x41b9('0x9e')])[_0x41b9('0x7a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xafe1b8['cc']){_0xccf928[_0x41b9('0xa2')]['Cc']=_0xafe1b8['cc'];}if(_0xafe1b8[_0x41b9('0x9c')]){_0xccf928[_0x41b9('0xa2')][_0x41b9('0xa3')]=_0xafe1b8['bcc'];}return new BPromise(function(_0x238c74,_0x437026){if(_0xafe1b8[_0x41b9('0xa0')]){for(var _0x146c35=0x0;_0x146c35<_0xafe1b8[_0x41b9('0xa0')][_0x41b9('0x54')];_0x146c35++){var _0x4ea14b=_0xafe1b8['Attachments'][_0x146c35];var _0x1210b6=path[_0x41b9('0x73')](_0xe7e7d1,_0x4ea14b[_0x41b9('0x75')]);if(fs['existsSync'](_0x1210b6)){_0xccf928['attachments'][_0x41b9('0xa4')]({'name':_0x4ea14b[_0x41b9('0x38')],'contentType':_0x4ea14b[_0x41b9('0x3e')],'data':fs[_0x41b9('0xa5')](_0x1210b6)});}}}emlformat[_0x41b9('0xa6')](_0xccf928,function(_0x509c04,_0x55e04e){if(_0x509c04)return _0x437026(_0x509c04);fs[_0x41b9('0xa7')](path[_0x41b9('0x73')](_0xf85cad,_0x2f6080),_0x55e04e);return _0x238c74(_0x55e04e);});});}})[_0x41b9('0x22')](function(_0x570af3){if(_0x570af3){return _0x188795['download'](path[_0x41b9('0x73')](_0xf85cad,_0x2f6080),_0x2f6080,function(_0x16f9e5){if(_0x16f9e5){console[_0x41b9('0xa8')](_0x41b9('0xa9'),_0x16f9e5);}else{fs[_0x41b9('0xaa')](path['join'](_0xf85cad,_0x2f6080));}});}})['catch'](handleError(_0x188795,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 200ba08..f70fde7 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 _0x337d=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save'];(function(_0x2ed9ae,_0x5536f8){var _0x488c33=function(_0x1c37ee){while(--_0x1c37ee){_0x2ed9ae['push'](_0x2ed9ae['shift']());}};_0x488c33(++_0x5536f8);}(_0x337d,0xba));var _0xd337=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x337d[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xd337('0x0'));var MailMessage=require(_0xd337('0x1'))['db'][_0xd337('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd337('0x3'),'afterUpdate':_0xd337('0x4'),'afterDestroy':_0xd337('0x5')};function emitEvent(_0x43e26e){return function(_0x446c47,_0x5777bb,_0x15fd5c){MailMessageEvents['emit'](_0x43e26e+':'+_0x446c47['id'],_0x446c47);MailMessageEvents[_0xd337('0x6')](_0x43e26e,_0x446c47);_0x15fd5c(null);};}for(var e in events){if(events[_0xd337('0x7')](e)){var event=events[e];MailMessage[_0xd337('0x8')](e,emitEvent(event));}}module[_0xd337('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x74a3=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x510f1b,_0x30fbf2){var _0x51917d=function(_0x2552fe){while(--_0x2552fe){_0x510f1b['push'](_0x510f1b['shift']());}};_0x51917d(++_0x30fbf2);}(_0x74a3,0xf2));var _0x374a=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x74a3[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0x374a('0x0'));var MailMessage=require(_0x374a('0x1'))['db'][_0x374a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x374a('0x3')](0x0);var events={'afterCreate':_0x374a('0x4'),'afterUpdate':_0x374a('0x5'),'afterDestroy':_0x374a('0x6')};function emitEvent(_0x30a720){return function(_0xb423db,_0x178798,_0x4d7025){MailMessageEvents[_0x374a('0x7')](_0x30a720+':'+_0xb423db['id'],_0xb423db);MailMessageEvents[_0x374a('0x7')](_0x30a720,_0xb423db);_0x4d7025(null);};}for(var e in events){if(events[_0x374a('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 65f4b2c..e54c411 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 _0x31a2=['rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','plainBody','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','html-to-text','path'];(function(_0x5826a2,_0x1eafb9){var _0x56dc2a=function(_0x3af1fa){while(--_0x3af1fa){_0x5826a2['push'](_0x5826a2['shift']());}};_0x56dc2a(++_0x1eafb9);}(_0x31a2,0x119));var _0x231a=function(_0x78e146,_0x7a4e79){_0x78e146=_0x78e146-0x0;var _0xcfc60f=_0x31a2[_0x78e146];return _0xcfc60f;};'use strict';var _=require(_0x231a('0x0'));var util=require('util');var logger=require(_0x231a('0x1'))(_0x231a('0x2'));var moment=require(_0x231a('0x3'));var BPromise=require('bluebird');var rp=require(_0x231a('0x4'));var htmlToText=require(_0x231a('0x5'));var fs=require('fs');var path=require(_0x231a('0x6'));var rimraf=require(_0x231a('0x7'));var config=require(_0x231a('0x8'));var attributes=require('./mailMessage.attributes');module[_0x231a('0x9')]=function(_0x51439e,_0xce1e8b){return _0x51439e['define'](_0x231a('0xa'),attributes,{'tableName':_0x231a('0xb'),'paranoid':![],'indexes':[{'name':_0x231a('0xc'),'fields':['messageId']},{'name':'fti_mail_messages','fields':['plainBody',_0x231a('0xd')],'type':_0x231a('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2baa77,_0x390bc4,_0x5775d5){if(_0x2baa77[_0x231a('0xf')]){_0x2baa77[_0x231a('0x10')]=htmlToText['fromString'](_0x2baa77[_0x231a('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5775d5(null,_0x390bc4);},'afterCreate':function(_0x49b9ce,_0x24b317,_0x48e6fe){var _0x17db09=_0x51439e[_0x231a('0x11')];var _0x534fc8=_0x49b9ce[_0x231a('0x12')]({'plain':!![]});if(_0x534fc8[_0x231a('0x13')][_0x231a('0x14')]()==='in'||_0x534fc8[_0x231a('0x13')][_0x231a('0x14')]()===_0x231a('0x15')&&!_0x534fc8[_0x231a('0x16')]&&!_[_0x231a('0x17')](_0x534fc8[_0x231a('0x18')])){_0x17db09[_0x231a('0x19')][_0x231a('0x1a')]({'where':{'id':_0x534fc8['MailInteractionId']}})[_0x231a('0x1b')](function(_0x56a36d){if(_0x56a36d){_0x56a36d[_0x231a('0x1c')]({'lastMsgAt':_0x534fc8[_0x231a('0x1d')],'lastMsgDirection':_0x534fc8[_0x231a('0x13')][_0x231a('0x14')](),'lastMsgBody':_0x534fc8[_0x231a('0xf')]});}})[_0x231a('0x1e')](function(_0x3f4ec3){console['error'](_0x3f4ec3);});}_0x48e6fe();}},'charset':'utf8mb4','collate':_0x231a('0x1f')});}; \ No newline at end of file +var _0x6e43=['path','rimraf','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x316f63,_0x4c784c){var _0x3557ec=function(_0x2c1a86){while(--_0x2c1a86){_0x316f63['push'](_0x316f63['shift']());}};_0x3557ec(++_0x4c784c);}(_0x6e43,0x10f));var _0x36e4=function(_0x55455b,_0x31cdae){_0x55455b=_0x55455b-0x0;var _0x2c12e4=_0x6e43[_0x55455b];return _0x2c12e4;};'use strict';var _=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var logger=require(_0x36e4('0x2'))(_0x36e4('0x3'));var moment=require(_0x36e4('0x4'));var BPromise=require(_0x36e4('0x5'));var rp=require(_0x36e4('0x6'));var htmlToText=require(_0x36e4('0x7'));var fs=require('fs');var path=require(_0x36e4('0x8'));var rimraf=require(_0x36e4('0x9'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module['exports']=function(_0x1b9219,_0x20927e){return _0x1b9219['define'](_0x36e4('0xa'),attributes,{'tableName':_0x36e4('0xb'),'paranoid':![],'indexes':[{'name':_0x36e4('0xc'),'fields':['messageId']},{'name':_0x36e4('0xd'),'fields':[_0x36e4('0xe'),_0x36e4('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x623569,_0x2802e9,_0x1edfad){if(_0x623569[_0x36e4('0x10')]){_0x623569['plainBody']=htmlToText['fromString'](_0x623569['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1edfad(null,_0x2802e9);},'afterCreate':function(_0x348c04,_0x5b29f4,_0x3acf40){var _0x39d630=_0x1b9219[_0x36e4('0x11')];var _0x59e7e9=_0x348c04[_0x36e4('0x12')]({'plain':!![]});if(_0x59e7e9[_0x36e4('0x13')]['toLowerCase']()==='in'||_0x59e7e9[_0x36e4('0x13')][_0x36e4('0x14')]()===_0x36e4('0x15')&&!_0x59e7e9[_0x36e4('0x16')]&&!_[_0x36e4('0x17')](_0x59e7e9[_0x36e4('0x18')])){_0x39d630['MailInteraction']['findOne']({'where':{'id':_0x59e7e9[_0x36e4('0x19')]}})[_0x36e4('0x1a')](function(_0x4b9547){if(_0x4b9547){_0x4b9547[_0x36e4('0x1b')]({'lastMsgAt':_0x59e7e9[_0x36e4('0x1c')],'lastMsgDirection':_0x59e7e9['direction'][_0x36e4('0x14')](),'lastMsgBody':_0x59e7e9[_0x36e4('0x10')]});}})[_0x36e4('0x1d')](function(_0x9c7143){console[_0x36e4('0x1e')](_0x9c7143);});}_0x3acf40();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index b7df765..b58dbcf 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 _0x9b09=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','stringify','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9b09,0x1ad));var _0x99b0=function(_0x5ba46a,_0x582fe0){_0x5ba46a=_0x5ba46a-0x0;var _0x5cbf4f=_0x9b09[_0x5ba46a];return _0x5cbf4f;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var moment=require('moment');var BPromise=require(_0x99b0('0x2'));var rs=require(_0x99b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99b0('0x5'))('rpc');var config=require(_0x99b0('0x6'));var jayson=require(_0x99b0('0x7'));var client=jayson['client'][_0x99b0('0x8')]({'port':0x232a});config[_0x99b0('0x9')]=_['defaults'](config[_0x99b0('0x9')],{'host':_0x99b0('0xa'),'port':0x18eb});var socket=require(_0x99b0('0xb'))(new Redis(config[_0x99b0('0x9')]));require(_0x99b0('0xc'))['register'](socket);function respondWithRpcPromise(_0x16bb51,_0x3ff7df,_0x23f567){return new BPromise(function(_0x443f52,_0xff8662){return client['request'](_0x16bb51,_0x23f567)[_0x99b0('0xd')](function(_0x263d8e){logger[_0x99b0('0xe')](_0x99b0('0xf'),_0x3ff7df,_0x99b0('0x10'));logger[_0x99b0('0x11')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3ff7df,_0x99b0('0x10'),JSON['stringify'](_0x263d8e));if(_0x263d8e[_0x99b0('0x12')]){if(_0x263d8e[_0x99b0('0x12')]['code']===0x1f4){logger['error'](_0x99b0('0xf'),_0x3ff7df,_0x263d8e[_0x99b0('0x12')][_0x99b0('0x13')]);return _0xff8662(_0x263d8e['error']['message']);}logger['error'](_0x99b0('0xf'),_0x3ff7df,_0x263d8e[_0x99b0('0x12')]['message']);return _0x443f52(_0x263d8e[_0x99b0('0x12')][_0x99b0('0x13')]);}else{logger[_0x99b0('0xe')](_0x99b0('0xf'),_0x3ff7df,_0x99b0('0x10'));_0x443f52(_0x263d8e[_0x99b0('0x14')][_0x99b0('0x13')]);}})['catch'](function(_0x1a2521){logger[_0x99b0('0x12')](_0x99b0('0xf'),_0x3ff7df,_0x1a2521);_0xff8662(_0x1a2521);});});}exports[_0x99b0('0x15')]=function(_0x1a5863){var _0x15b7fd=this;return new Promise(function(_0x3b303b,_0x1783ca){return db[_0x99b0('0x16')][_0x99b0('0x17')](_0x1a5863[_0x99b0('0x18')],{'raw':_0x1a5863[_0x99b0('0x19')]?_0x1a5863[_0x99b0('0x19')][_0x99b0('0x1a')]===undefined?!![]:![]:!![]})[_0x99b0('0xd')](function(_0x93dcb1){logger[_0x99b0('0xe')](_0x99b0('0x15'),_0x1a5863);logger[_0x99b0('0x11')](_0x99b0('0x15'),_0x1a5863,JSON[_0x99b0('0x1b')](_0x93dcb1));_0x3b303b(_0x93dcb1);})[_0x99b0('0x1c')](function(_0x3be9fc){logger[_0x99b0('0x12')]('CreateMailMessage',_0x3be9fc[_0x99b0('0x13')],_0x1a5863);_0x1783ca(_0x15b7fd['error'](0x1f4,_0x3be9fc['message']));});});}; \ No newline at end of file +var _0x1fcc=['then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request'];(function(_0x81fa30,_0x335716){var _0x241675=function(_0x1085f7){while(--_0x1085f7){_0x81fa30['push'](_0x81fa30['shift']());}};_0x241675(++_0x335716);}(_0x1fcc,0x125));var _0xc1fc=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x1fcc[_0x256e32];return _0x464070;};'use strict';var _=require(_0xc1fc('0x0'));var util=require(_0xc1fc('0x1'));var moment=require('moment');var BPromise=require(_0xc1fc('0x2'));var rs=require(_0xc1fc('0x3'));var fs=require('fs');var Redis=require(_0xc1fc('0x4'));var db=require(_0xc1fc('0x5'))['db'];var utils=require(_0xc1fc('0x6'));var logger=require(_0xc1fc('0x7'))(_0xc1fc('0x8'));var config=require('../../config/environment');var jayson=require(_0xc1fc('0x9'));var client=jayson[_0xc1fc('0xa')][_0xc1fc('0xb')]({'port':0x232a});config['redis']=_[_0xc1fc('0xc')](config[_0xc1fc('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1fc('0xe'))(new Redis(config[_0xc1fc('0xd')]));require('./mailMessage.socket')[_0xc1fc('0xf')](socket);function respondWithRpcPromise(_0x57df7c,_0x2bbfe7,_0x17a845){return new BPromise(function(_0x5a2fa3,_0x432861){return client[_0xc1fc('0x10')](_0x57df7c,_0x17a845)[_0xc1fc('0x11')](function(_0x119d27){logger[_0xc1fc('0x12')]('MailMessage,\x20%s,\x20%s',_0x2bbfe7,_0xc1fc('0x13'));logger[_0xc1fc('0x14')](_0xc1fc('0x15'),_0x2bbfe7,'request\x20sent',JSON[_0xc1fc('0x16')](_0x119d27));if(_0x119d27[_0xc1fc('0x17')]){if(_0x119d27[_0xc1fc('0x17')]['code']===0x1f4){logger[_0xc1fc('0x17')](_0xc1fc('0x18'),_0x2bbfe7,_0x119d27[_0xc1fc('0x17')][_0xc1fc('0x19')]);return _0x432861(_0x119d27[_0xc1fc('0x17')][_0xc1fc('0x19')]);}logger[_0xc1fc('0x17')](_0xc1fc('0x18'),_0x2bbfe7,_0x119d27[_0xc1fc('0x17')][_0xc1fc('0x19')]);return _0x5a2fa3(_0x119d27['error'][_0xc1fc('0x19')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x2bbfe7,_0xc1fc('0x13'));_0x5a2fa3(_0x119d27[_0xc1fc('0x1a')][_0xc1fc('0x19')]);}})[_0xc1fc('0x1b')](function(_0x364589){logger[_0xc1fc('0x17')](_0xc1fc('0x18'),_0x2bbfe7,_0x364589);_0x432861(_0x364589);});});}exports[_0xc1fc('0x1c')]=function(_0x2042b8){var _0x4fa5bd=this;return new Promise(function(_0x278721,_0x36122b){return db['MailMessage']['create'](_0x2042b8[_0xc1fc('0x1d')],{'raw':_0x2042b8[_0xc1fc('0x1e')]?_0x2042b8[_0xc1fc('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xc1fc('0x11')](function(_0x54d500){logger['info'](_0xc1fc('0x1c'),_0x2042b8);logger[_0xc1fc('0x14')](_0xc1fc('0x1c'),_0x2042b8,JSON[_0xc1fc('0x16')](_0x54d500));_0x278721(_0x54d500);})[_0xc1fc('0x1b')](function(_0x44236a){logger['error'](_0xc1fc('0x1c'),_0x44236a['message'],_0x2042b8);_0x36122b(_0x4fa5bd[_0xc1fc('0x17')](0x1f4,_0x44236a[_0xc1fc('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8680994..07cc34f 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 _0xf0db=['save','update','emit','register','mailMessage:','./mailMessage.events'];(function(_0x1098e3,_0x97af9a){var _0x4a4f1d=function(_0x58d0de){while(--_0x58d0de){_0x1098e3['push'](_0x1098e3['shift']());}};_0x4a4f1d(++_0x97af9a);}(_0xf0db,0x12b));var _0xbf0d=function(_0x7074d5,_0x427953){_0x7074d5=_0x7074d5-0x0;var _0xced075=_0xf0db[_0x7074d5];return _0xced075;};'use strict';var MailMessageEvents=require(_0xbf0d('0x0'));var events=[_0xbf0d('0x1'),'remove',_0xbf0d('0x2')];function createListener(_0x1a6fea,_0x2bf55a){return function(_0x5db968){_0x2bf55a[_0xbf0d('0x3')](_0x1a6fea,_0x5db968);};}function removeListener(_0x2ccd6c,_0x56f648){return function(){MailMessageEvents['removeListener'](_0x2ccd6c,_0x56f648);};}exports[_0xbf0d('0x4')]=function(_0x1e4a49){for(var _0x28586b=0x0,_0x2dc074=events['length'];_0x28586b<_0x2dc074;_0x28586b++){var _0x1ebf0c=events[_0x28586b];var _0x2fbc2b=createListener(_0xbf0d('0x5')+_0x1ebf0c,_0x1e4a49);MailMessageEvents['on'](_0x1ebf0c,_0x2fbc2b);}}; \ No newline at end of file +var _0x3442=['./mailMessage.events','save','update','emit','removeListener','register','length','mailMessage:'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x3442,0x118));var _0x2344=function(_0x376bb5,_0x25f4df){_0x376bb5=_0x376bb5-0x0;var _0x146740=_0x3442[_0x376bb5];return _0x146740;};'use strict';var MailMessageEvents=require(_0x2344('0x0'));var events=[_0x2344('0x1'),'remove',_0x2344('0x2')];function createListener(_0x29d4c1,_0x30a30d){return function(_0x43462d){_0x30a30d[_0x2344('0x3')](_0x29d4c1,_0x43462d);};}function removeListener(_0x1903b9,_0xd13499){return function(){MailMessageEvents[_0x2344('0x4')](_0x1903b9,_0xd13499);};}exports[_0x2344('0x5')]=function(_0x4f1b1d){for(var _0x3dadde=0x0,_0x551057=events[_0x2344('0x6')];_0x3dadde<_0x551057;_0x3dadde++){var _0x522d36=events[_0x3dadde];var _0x13f55c=createListener(_0x2344('0x7')+_0x522d36,_0x4f1b1d);MailMessageEvents['on'](_0x522d36,_0x13f55c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9ee9088..0c661fb 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 _0x9bce=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x51c6bb,_0x5a6288){var _0x5229d5=function(_0x2ab708){while(--_0x2ab708){_0x51c6bb['push'](_0x51c6bb['shift']());}};_0x5229d5(++_0x5a6288);}(_0x9bce,0x184));var _0xe9bc=function(_0x5c2198,_0x1c7ec2){_0x5c2198=_0x5c2198-0x0;var _0x34b574=_0x9bce[_0x5c2198];return _0x34b574;};'use strict';var multer=require(_0xe9bc('0x0'));var util=require(_0xe9bc('0x1'));var path=require(_0xe9bc('0x2'));var timeout=require(_0xe9bc('0x3'));var express=require('express');var router=express[_0xe9bc('0x4')]();var auth=require(_0xe9bc('0x5'));var interaction=require(_0xe9bc('0x6'));var config=require(_0xe9bc('0x7'));var controller=require(_0xe9bc('0x8'));router[_0xe9bc('0x9')]('/',auth[_0xe9bc('0xa')](),controller['index']);router['get'](_0xe9bc('0xb'),auth[_0xe9bc('0xa')](),controller['describe']);router[_0xe9bc('0x9')](_0xe9bc('0xc'),auth[_0xe9bc('0xa')](),controller[_0xe9bc('0xd')]);router[_0xe9bc('0x9')](_0xe9bc('0xe'),auth[_0xe9bc('0xa')](),controller['getMembers']);router[_0xe9bc('0x9')](_0xe9bc('0xf'),auth[_0xe9bc('0xa')](),controller['getTeams']);router['get'](_0xe9bc('0x10'),auth[_0xe9bc('0xa')](),controller[_0xe9bc('0x11')]);router[_0xe9bc('0x12')]('/',auth['isAuthenticated'](),controller[_0xe9bc('0x13')]);router['post'](_0xe9bc('0xf'),auth[_0xe9bc('0xa')](),controller['addTeams']);router[_0xe9bc('0x12')](_0xe9bc('0x10'),auth['isAuthenticated'](),controller[_0xe9bc('0x14')]);router[_0xe9bc('0x15')]('/:id',auth[_0xe9bc('0xa')](),controller['update']);router[_0xe9bc('0x16')](_0xe9bc('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xe9bc('0x16')](_0xe9bc('0xf'),auth[_0xe9bc('0xa')](),controller[_0xe9bc('0x17')]);router[_0xe9bc('0x16')](_0xe9bc('0x10'),auth[_0xe9bc('0xa')](),controller[_0xe9bc('0x18')]);module[_0xe9bc('0x19')]=router; \ No newline at end of file +var _0x4cfe=['delete','removeTeams','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents','put'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x4cfe,0x70));var _0xe4cf=function(_0x4b9b76,_0x2cd722){_0x4b9b76=_0x4b9b76-0x0;var _0x175747=_0x4cfe[_0x4b9b76];return _0x175747;};'use strict';var multer=require(_0xe4cf('0x0'));var util=require(_0xe4cf('0x1'));var path=require(_0xe4cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4cf('0x3'));var router=express['Router']();var auth=require(_0xe4cf('0x4'));var interaction=require(_0xe4cf('0x5'));var config=require(_0xe4cf('0x6'));var controller=require(_0xe4cf('0x7'));router['get']('/',auth[_0xe4cf('0x8')](),controller[_0xe4cf('0x9')]);router[_0xe4cf('0xa')](_0xe4cf('0xb'),auth[_0xe4cf('0x8')](),controller[_0xe4cf('0xc')]);router[_0xe4cf('0xa')](_0xe4cf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4cf('0xa')](_0xe4cf('0xe'),auth[_0xe4cf('0x8')](),controller[_0xe4cf('0xf')]);router[_0xe4cf('0xa')](_0xe4cf('0x10'),auth[_0xe4cf('0x8')](),controller['getTeams']);router['get']('/:id/users',auth[_0xe4cf('0x8')](),controller['getAgents']);router[_0xe4cf('0x11')]('/',auth['isAuthenticated'](),controller[_0xe4cf('0x12')]);router[_0xe4cf('0x11')](_0xe4cf('0x10'),auth[_0xe4cf('0x8')](),controller[_0xe4cf('0x13')]);router[_0xe4cf('0x11')](_0xe4cf('0x14'),auth[_0xe4cf('0x8')](),controller[_0xe4cf('0x15')]);router[_0xe4cf('0x16')](_0xe4cf('0xd'),auth[_0xe4cf('0x8')](),controller['update']);router[_0xe4cf('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe4cf('0x17')]('/:id/teams',auth[_0xe4cf('0x8')](),controller[_0xe4cf('0x18')]);router[_0xe4cf('0x17')](_0xe4cf('0x14'),auth[_0xe4cf('0x8')](),controller[_0xe4cf('0x19')]);module[_0xe4cf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index e4e4b90..98b6405 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 _0x391f=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0xaf02d7,_0xc1fc89){var _0x4bfcf0=function(_0x4ad9d7){while(--_0x4ad9d7){_0xaf02d7['push'](_0xaf02d7['shift']());}};_0x4bfcf0(++_0xc1fc89);}(_0x391f,0x10c));var _0xf391=function(_0x253ec8,_0x4fd820){_0x253ec8=_0x253ec8-0x0;var _0x7150d0=_0x391f[_0x253ec8];return _0x7150d0;};'use strict';var Sequelize=require(_0xf391('0x0'));module[_0xf391('0x1')]={'name':{'type':Sequelize[_0xf391('0x2')],'unique':_0xf391('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf391('0x2')]},'timeout':{'type':Sequelize[_0xf391('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf391('0x5')]('rrmemory',_0xf391('0x6'),_0xf391('0x7'))}}; \ No newline at end of file +var _0x9231=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1c48d7,_0x12efeb){var _0x19d284=function(_0x26d73f){while(--_0x26d73f){_0x1c48d7['push'](_0x1c48d7['shift']());}};_0x19d284(++_0x12efeb);}(_0x9231,0x66));var _0x1923=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9231[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1923('0x0'));module[_0x1923('0x1')]={'name':{'type':Sequelize[_0x1923('0x2')],'unique':_0x1923('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1923('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1923('0x5')](_0x1923('0x6'),_0x1923('0x7'),_0x1923('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index ed94f29..f7bd459 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 _0x3184=['catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserMailQueue','pick','MailQueueId','merge','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','User','Agents','voicePause','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','ids','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','getAgents','html-pdf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','MailQueues','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','show','params','find'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3184,0xc8));var _0x4318=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x3184[_0x33ebf5];return _0x66957b;};'use strict';var pdf=require(_0x4318('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4318('0x1'));var jsonpatch=require(_0x4318('0x2'));var rp=require('request-promise');var moment=require(_0x4318('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4318('0x4'));var util=require('util');var path=require(_0x4318('0x5'));var sox=require(_0x4318('0x6'));var csv=require(_0x4318('0x7'));var ejs=require(_0x4318('0x8'));var fs=require('fs');var _=require(_0x4318('0x9'));var squel=require('squel');var crypto=require(_0x4318('0xa'));var jsforce=require(_0x4318('0xb'));var deskjs=require(_0x4318('0xc'));var toCsv=require(_0x4318('0x7'));var querystring=require(_0x4318('0xd'));var Papa=require(_0x4318('0xe'));var Redis=require(_0x4318('0xf'));var authService=require(_0x4318('0x10'));var qs=require(_0x4318('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4318('0x12'))('api');var utils=require(_0x4318('0x13'));var config=require(_0x4318('0x14'));var db=require(_0x4318('0x15'))['db'];config[_0x4318('0x16')]=_[_0x4318('0x17')](config['redis'],{'host':_0x4318('0x18'),'port':0x18eb});var socket=require(_0x4318('0x19'))(new Redis(config[_0x4318('0x16')]));require(_0x4318('0x1a'))[_0x4318('0x1b')](socket);function respondWithStatusCode(_0x3509dc,_0x323ff4){_0x323ff4=_0x323ff4||0xcc;return function(_0x5aa371){if(_0x5aa371){return _0x3509dc[_0x4318('0x1c')](_0x323ff4);}return _0x3509dc[_0x4318('0x1d')](_0x323ff4)[_0x4318('0x1e')]();};}function respondWithResult(_0x4baeda,_0x1fc165){_0x1fc165=_0x1fc165||0xc8;return function(_0x4334ec){if(_0x4334ec){return _0x4baeda[_0x4318('0x1d')](_0x1fc165)[_0x4318('0x1f')](_0x4334ec);}};}function respondWithFilteredResult(_0x4f825d,_0x11fc28){return function(_0x445ed8){if(_0x445ed8){var _0x47c1ad=_0x445ed8[_0x4318('0x20')],_0x2c7c9d=_0x11fc28['offset'],_0x3eb759=_0x11fc28[_0x4318('0x21')]+_0x11fc28[_0x4318('0x22')],_0x5131e1;if(_0x3eb759>=_0x47c1ad){_0x3eb759=_0x47c1ad;_0x5131e1=0xc8;}else{_0x5131e1=0xce;}_0x4f825d[_0x4318('0x1d')](_0x5131e1);return _0x4f825d[_0x4318('0x23')](_0x4318('0x24'),_0x2c7c9d+'-'+_0x3eb759+'/'+_0x47c1ad)[_0x4318('0x1f')](_0x445ed8);}return null;};}function patchUpdates(_0xb546d1){return function(_0xfb4c4e){try{jsonpatch[_0x4318('0x25')](_0xfb4c4e,_0xb546d1,!![]);}catch(_0x26ffd3){return BPromise['reject'](_0x26ffd3);}return _0xfb4c4e[_0x4318('0x26')]();};}function saveUpdates(_0x1b02ac,_0x592477){return function(_0x54b6e7){if(_0x54b6e7){return _0x54b6e7['update'](_0x1b02ac)[_0x4318('0x27')](function(_0x3d5ea0){return _0x3d5ea0;});}return null;};}function removeEntity(_0x2bcea9,_0x2c7371){return function(_0x431133){if(_0x431133){return _0x431133[_0x4318('0x28')]()[_0x4318('0x27')](function(){var _0x384c14=_0x431133[_0x4318('0x29')]({'plain':!![]});var _0x4e2a4a=_0x4318('0x2a');return db['UserProfileResource'][_0x4318('0x28')]({'where':{'type':_0x4e2a4a,'resourceId':_0x384c14['id']}})['then'](function(){return _0x431133;});})[_0x4318('0x27')](function(){_0x2bcea9[_0x4318('0x1d')](0xcc)[_0x4318('0x1e')]();});}};}function handleEntityNotFound(_0x573d94,_0x12c01b){return function(_0x1e3a83){if(!_0x1e3a83){_0x573d94['sendStatus'](0x194);}return _0x1e3a83;};}function handleError(_0x550230,_0x585419){_0x585419=_0x585419||0x1f4;return function(_0x34533d){logger[_0x4318('0x2b')](_0x34533d[_0x4318('0x2c')]);if(_0x34533d['name']){delete _0x34533d[_0x4318('0x2d')];}_0x550230[_0x4318('0x1d')](_0x585419)[_0x4318('0x2e')](_0x34533d);};}exports[_0x4318('0x2f')]=function(_0x3a9d4a,_0x54bfef){var _0x41ea72={},_0x2e589c={},_0x3f31df={'count':0x0,'rows':[]};var _0x374076=_[_0x4318('0x30')](db[_0x4318('0x31')][_0x4318('0x32')],function(_0x303da0){return{'name':_0x303da0[_0x4318('0x33')],'type':_0x303da0[_0x4318('0x34')][_0x4318('0x35')]};});_0x2e589c[_0x4318('0x36')]=_[_0x4318('0x30')](_0x374076,_0x4318('0x2d'));_0x2e589c[_0x4318('0x37')]=_[_0x4318('0x38')](_0x3a9d4a[_0x4318('0x37')]);_0x2e589c[_0x4318('0x39')]=_[_0x4318('0x3a')](_0x2e589c[_0x4318('0x36')],_0x2e589c[_0x4318('0x37')]);_0x41ea72[_0x4318('0x3b')]=_[_0x4318('0x3a')](_0x2e589c[_0x4318('0x36')],qs['fields'](_0x3a9d4a[_0x4318('0x37')][_0x4318('0x3c')]));_0x41ea72[_0x4318('0x3b')]=_0x41ea72[_0x4318('0x3b')][_0x4318('0x3d')]?_0x41ea72[_0x4318('0x3b')]:_0x2e589c[_0x4318('0x36')];if(!_0x3a9d4a[_0x4318('0x37')][_0x4318('0x3e')](_0x4318('0x3f'))){_0x41ea72[_0x4318('0x22')]=qs['limit'](_0x3a9d4a[_0x4318('0x37')][_0x4318('0x22')]);_0x41ea72[_0x4318('0x21')]=qs[_0x4318('0x21')](_0x3a9d4a['query'][_0x4318('0x21')]);}_0x41ea72[_0x4318('0x40')]=qs[_0x4318('0x41')](_0x3a9d4a[_0x4318('0x37')][_0x4318('0x41')]);_0x41ea72[_0x4318('0x42')]=qs[_0x4318('0x39')](_['pick'](_0x3a9d4a[_0x4318('0x37')],_0x2e589c[_0x4318('0x39')]),_0x374076);if(_0x3a9d4a[_0x4318('0x37')][_0x4318('0x43')]){_0x41ea72['where']=_['merge'](_0x41ea72[_0x4318('0x42')],{'$or':_['map'](_0x374076,function(_0x2d0833){if(_0x2d0833[_0x4318('0x34')]!==_0x4318('0x44')){var _0x3c225c={};_0x3c225c[_0x2d0833[_0x4318('0x2d')]]={'$like':'%'+_0x3a9d4a['query']['filter']+'%'};return _0x3c225c;}})});}_0x41ea72=_['merge']({},_0x41ea72,_0x3a9d4a[_0x4318('0x45')]);var _0x394900={'where':_0x41ea72[_0x4318('0x42')]};return db['MailQueue']['count'](_0x394900)[_0x4318('0x27')](function(_0x2023ec){_0x3f31df[_0x4318('0x20')]=_0x2023ec;if(_0x3a9d4a[_0x4318('0x37')][_0x4318('0x46')]){_0x41ea72[_0x4318('0x47')]=[{'all':!![]}];}return db[_0x4318('0x31')][_0x4318('0x48')](_0x41ea72);})[_0x4318('0x27')](function(_0x355771){_0x3f31df['rows']=_0x355771;return _0x3f31df;})[_0x4318('0x27')](respondWithFilteredResult(_0x54bfef,_0x41ea72))['catch'](handleError(_0x54bfef,null));};exports[_0x4318('0x49')]=function(_0x5ac5c7,_0x1d3cfb){var _0x4375b9={'raw':!![],'where':{'id':_0x5ac5c7[_0x4318('0x4a')]['id']}},_0x4c2ba0={};_0x4c2ba0[_0x4318('0x36')]=_[_0x4318('0x38')](db[_0x4318('0x31')][_0x4318('0x32')]);_0x4c2ba0[_0x4318('0x37')]=_[_0x4318('0x38')](_0x5ac5c7['query']);_0x4c2ba0['filters']=_[_0x4318('0x3a')](_0x4c2ba0[_0x4318('0x36')],_0x4c2ba0[_0x4318('0x37')]);_0x4375b9[_0x4318('0x3b')]=_['intersection'](_0x4c2ba0[_0x4318('0x36')],qs[_0x4318('0x3c')](_0x5ac5c7[_0x4318('0x37')][_0x4318('0x3c')]));_0x4375b9[_0x4318('0x3b')]=_0x4375b9[_0x4318('0x3b')]['length']?_0x4375b9[_0x4318('0x3b')]:_0x4c2ba0[_0x4318('0x36')];if(_0x5ac5c7[_0x4318('0x37')][_0x4318('0x46')]){_0x4375b9[_0x4318('0x47')]=[{'all':!![]}];}_0x4375b9=_['merge']({},_0x4375b9,_0x5ac5c7[_0x4318('0x45')]);return db[_0x4318('0x31')][_0x4318('0x4b')](_0x4375b9)[_0x4318('0x27')](handleEntityNotFound(_0x1d3cfb,null))[_0x4318('0x27')](respondWithResult(_0x1d3cfb,null))[_0x4318('0x4c')](handleError(_0x1d3cfb,null));};exports[_0x4318('0x4d')]=function(_0x41fc0f,_0x5dc650){return db['MailQueue'][_0x4318('0x4d')](_0x41fc0f[_0x4318('0x4e')],{})[_0x4318('0x27')](function(_0xbf5361){var _0x48b5b0=_0x41fc0f['user']['get']({'plain':!![]});if(!_0x48b5b0)throw new Error(_0x4318('0x4f'));if(_0x48b5b0[_0x4318('0x50')]===_0x4318('0x51')){var _0x18861c=_0xbf5361[_0x4318('0x29')]({'plain':!![]});var _0x59dbf1=_0x4318('0x2a');return db['UserProfileSection'][_0x4318('0x4b')]({'where':{'name':_0x59dbf1,'userProfileId':_0x48b5b0[_0x4318('0x52')]},'raw':!![]})['then'](function(_0x46acf1){if(_0x46acf1&&_0x46acf1[_0x4318('0x53')]===0x0){return db['UserProfileResource'][_0x4318('0x4d')]({'name':_0x18861c[_0x4318('0x2d')],'resourceId':_0x18861c['id'],'type':_0x46acf1[_0x4318('0x2d')],'sectionId':_0x46acf1['id']},{})[_0x4318('0x27')](function(){return _0xbf5361;});}else{return _0xbf5361;}})[_0x4318('0x4c')](function(_0x4fbd95){logger[_0x4318('0x2b')](_0x4318('0x54'),_0x4fbd95);throw _0x4fbd95;});}return _0xbf5361;})[_0x4318('0x27')](respondWithResult(_0x5dc650,0xc9))[_0x4318('0x4c')](handleError(_0x5dc650,null));};exports[_0x4318('0x55')]=function(_0x586c05,_0x57505f){if(_0x586c05[_0x4318('0x4e')]['id']){delete _0x586c05['body']['id'];}return db[_0x4318('0x31')]['find']({'where':{'id':_0x586c05['params']['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x57505f,null))[_0x4318('0x27')](saveUpdates(_0x586c05[_0x4318('0x4e')],null))[_0x4318('0x27')](respondWithResult(_0x57505f,null))[_0x4318('0x4c')](handleError(_0x57505f,null));};exports['destroy']=function(_0xd63be9,_0x7b7381){return db[_0x4318('0x31')][_0x4318('0x4b')]({'where':{'id':_0xd63be9[_0x4318('0x4a')]['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x7b7381,null))[_0x4318('0x27')](removeEntity(_0x7b7381,null))['catch'](handleError(_0x7b7381,null));};exports[_0x4318('0x56')]=function(_0x2c370b,_0x10c321){return db[_0x4318('0x31')][_0x4318('0x56')]()[_0x4318('0x27')](respondWithResult(_0x10c321,null))['catch'](handleError(_0x10c321,null));};exports['getMembers']=function(_0xb0972e,_0x20baab,_0x1ab4eb){var _0x105cef={'raw':!![],'where':{}},_0x5665e2={},_0x4fbadb;return db['MailQueue'][_0x4318('0x57')]({'where':{'id':_0xb0972e['params']['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x20baab,null))['then'](function(_0x46d133){if(_0x46d133){_0x4fbadb=_0x46d133['get']({'plain':!![]});_0x5665e2[_0x4318('0x36')]=_[_0x4318('0x38')](db[_0x4318('0x58')][_0x4318('0x32')]);_0x5665e2[_0x4318('0x37')]=_[_0x4318('0x38')](_0xb0972e['query']);_0x5665e2[_0x4318('0x39')]=_[_0x4318('0x3a')](_0x5665e2[_0x4318('0x36')],_0x5665e2['query']);_0x105cef['attributes']=_[_0x4318('0x3a')](_0x5665e2[_0x4318('0x36')],qs['fields'](_0xb0972e[_0x4318('0x37')][_0x4318('0x3c')]));_0x105cef[_0x4318('0x3b')]=_0x105cef[_0x4318('0x3b')]['length']?_0x105cef[_0x4318('0x3b')]:_0x5665e2[_0x4318('0x36')];if(!_0xb0972e['query'][_0x4318('0x3e')](_0x4318('0x3f'))){_0x105cef[_0x4318('0x22')]=qs[_0x4318('0x22')](_0xb0972e[_0x4318('0x37')]['limit']);_0x105cef[_0x4318('0x21')]=qs[_0x4318('0x21')](_0xb0972e[_0x4318('0x37')][_0x4318('0x21')]);}_0x105cef[_0x4318('0x40')]=qs[_0x4318('0x41')](_0xb0972e['query'][_0x4318('0x41')]);_0x105cef[_0x4318('0x42')]=qs[_0x4318('0x39')](_[_0x4318('0x59')](_0xb0972e[_0x4318('0x37')],_0x5665e2[_0x4318('0x39')]));_0x105cef['where'][_0x4318('0x5a')]=_0x46d133['id'];if(_0xb0972e['query'][_0x4318('0x43')]){_0x105cef[_0x4318('0x42')]=_[_0x4318('0x5b')](_0x105cef[_0x4318('0x42')],{'$or':_['map'](_0x105cef[_0x4318('0x3b')],function(_0x81be4b){var _0x1eca15={};_0x1eca15[_0x81be4b]={'$like':'%'+_0xb0972e[_0x4318('0x37')][_0x4318('0x43')]+'%'};return _0x1eca15;})});}_0x105cef=_[_0x4318('0x5b')]({},_0x105cef,_0xb0972e[_0x4318('0x45')]);return db['UserMailQueue'][_0x4318('0x48')](_0x105cef);}})['then'](function(_0x3ea82c){if(_0x3ea82c){return db['User'][_0x4318('0x5c')]({'where':{'id':_[_0x4318('0x30')](_0x3ea82c,_0x4318('0x5d')),'role':_0x4318('0x5e')},'attributes':['id',_0x4318('0x2d'),_0x4318('0x5f'),_0x4318('0x60'),_0x4318('0x61')]});}})[_0x4318('0x27')](function(_0x5c1cf4){if(_0x5c1cf4){return{'count':_0x5c1cf4[_0x4318('0x20')],'rows':_[_0x4318('0x30')](_0x5c1cf4[_0x4318('0x62')],function(_0x10e2d7){return{'membername':_0x10e2d7[_0x4318('0x2d')],'UserId':_0x10e2d7['id'],'queue_name':_0x4fbadb[_0x4318('0x2d')],'MailQueueId':_0x4fbadb['id'],'interface':util[_0x4318('0x63')](_0x4318('0x64'),'SIP',_0x10e2d7['name']),'penalty':0x0,'paused':_0x10e2d7[_0x4318('0x5f')],'createdAt':_0x10e2d7[_0x4318('0x61')],'updatedAt':_0x10e2d7[_0x4318('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4318('0x27')](respondWithFilteredResult(_0x20baab,_0x105cef))[_0x4318('0x4c')](handleError(_0x20baab,null));};exports[_0x4318('0x65')]=function(_0x5bf8c3,_0x376cc3,_0x25f976){var _0x237cf3={};var _0x120738={};var _0x2db404;var _0x173687;return db[_0x4318('0x31')][_0x4318('0x57')]({'where':{'id':_0x5bf8c3[_0x4318('0x4a')]['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x376cc3,null))['then'](function(_0x16993b){if(_0x16993b){_0x2db404=_0x16993b;_0x120738['model']=_[_0x4318('0x38')](db[_0x4318('0x66')][_0x4318('0x32')]);_0x120738[_0x4318('0x37')]=_[_0x4318('0x38')](_0x5bf8c3[_0x4318('0x37')]);_0x120738['filters']=_[_0x4318('0x3a')](_0x120738[_0x4318('0x36')],_0x120738[_0x4318('0x37')]);_0x237cf3[_0x4318('0x3b')]=_[_0x4318('0x3a')](_0x120738[_0x4318('0x36')],qs[_0x4318('0x3c')](_0x5bf8c3[_0x4318('0x37')]['fields']));_0x237cf3[_0x4318('0x3b')]=_0x237cf3[_0x4318('0x3b')][_0x4318('0x3d')]?_0x237cf3['attributes']:_0x120738[_0x4318('0x36')];_0x237cf3[_0x4318('0x40')]=qs[_0x4318('0x41')](_0x5bf8c3[_0x4318('0x37')]['sort']);_0x237cf3['where']=qs[_0x4318('0x39')](_[_0x4318('0x59')](_0x5bf8c3[_0x4318('0x37')],_0x120738[_0x4318('0x39')]));if(_0x5bf8c3['query'][_0x4318('0x43')]){_0x237cf3['where']=_[_0x4318('0x5b')](_0x237cf3[_0x4318('0x42')],{'$or':_[_0x4318('0x30')](_0x237cf3['attributes'],function(_0x3b01c5){var _0x322b42={};_0x322b42[_0x3b01c5]={'$like':'%'+_0x5bf8c3['query'][_0x4318('0x43')]+'%'};return _0x322b42;})});}_0x237cf3=_['merge']({},_0x237cf3,_0x5bf8c3[_0x4318('0x45')]);return _0x2db404['getTeams'](_0x237cf3);}})[_0x4318('0x27')](function(_0x717b61){if(_0x717b61){_0x173687=_0x717b61[_0x4318('0x3d')];if(!_0x5bf8c3['query'][_0x4318('0x3e')](_0x4318('0x3f'))){_0x237cf3['limit']=qs[_0x4318('0x22')](_0x5bf8c3[_0x4318('0x37')][_0x4318('0x22')]);_0x237cf3[_0x4318('0x21')]=qs[_0x4318('0x21')](_0x5bf8c3[_0x4318('0x37')][_0x4318('0x21')]);}return _0x2db404['getTeams'](_0x237cf3);}})[_0x4318('0x27')](function(_0x3a0791){if(_0x3a0791){return _0x3a0791?{'count':_0x173687,'rows':_0x3a0791}:null;}})['then'](respondWithResult(_0x376cc3,null))[_0x4318('0x4c')](handleError(_0x376cc3,null));};exports['addTeams']=function(_0x58e127,_0x497d10,_0x1d1752){var _0x83b0a0=_0x58e127[_0x4318('0x4e')]['ids'];return db[_0x4318('0x66')][_0x4318('0x48')]({'where':{'id':_0x83b0a0},'attributes':['id'],'include':[{'model':db[_0x4318('0x67')],'as':_0x4318('0x68'),'attributes':['id',_0x4318('0x2d'),'online',_0x4318('0x69'),'interface'],'raw':!![]}]})[_0x4318('0x27')](function(_0x5f3671){if(_0x5f3671){var _0x5134fa=_['flatMap'](_0x5f3671,function(_0x9d2c22){var _0x301cab=_0x9d2c22[_0x4318('0x29')]({'plain':!![]});return _0x301cab[_0x4318('0x68')];});return db[_0x4318('0x31')]['find']({'where':{'id':_0x58e127[_0x4318('0x4a')]['id']}})[_0x4318('0x27')](function(_0x165353){return db[_0x4318('0x6a')][_0x4318('0x6b')](function(_0x15330e){return _0x165353['addTeams'](_0x83b0a0,{'transaction':_0x15330e})['then'](function(){return BPromise['each'](_0x5134fa,function(_0x831f96){return db[_0x4318('0x58')][_0x4318('0x6c')]({'where':{'UserId':_0x831f96['id'],'MailQueueId':_0x58e127[_0x4318('0x4a')]['id']},'transaction':_0x15330e});});})[_0x4318('0x27')](function(){_0x5134fa[_0x4318('0x6d')](function(_0x17a5e2){socket[_0x4318('0x6e')]('userMailQueue:save',{'UserId':_0x17a5e2['id'],'MailQueueId':_0x165353['id']});});});});});}})[_0x4318('0x27')](respondWithStatusCode(_0x497d10,null))['catch'](handleError(_0x497d10,null));};exports[_0x4318('0x6f')]=function(_0xda055b,_0x5821bf,_0x237e6d){return db[_0x4318('0x66')][_0x4318('0x48')]({'where':{'id':_0xda055b[_0x4318('0x37')][_0x4318('0x70')]},'attributes':['id'],'include':[{'model':db[_0x4318('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5821bf,null))['then'](function(_0x58abed){var _0x3938b8=_['map'](_0x58abed,'id');var _0x5f7457=[];var _0x192fc5=[];var _0x5d9fa0=squel['select']();_0x5d9fa0[_0x4318('0x71')]('tq.TeamId')[_0x4318('0x72')](_0x4318('0x73'),'tq')[_0x4318('0x74')](_0x4318('0x75'),'ut',_0x4318('0x76'))[_0x4318('0x42')](_0x4318('0x77'),_0xda055b[_0x4318('0x4a')]['id']);for(var _0x4fad53=0x0;_0x4fad53<_0x58abed[_0x4318('0x3d')];_0x4fad53+=0x1){let _0x30af04=_0x58abed[_0x4fad53];for(var _0x16690f=0x0;_0x16690f<_0x30af04['Agents'][_0x4318('0x3d')];_0x16690f+=0x1){let _0x2beb0e=_0x30af04[_0x4318('0x68')][_0x16690f];var _0x562870=_0x5d9fa0[_0x4318('0x78')]();_0x562870[_0x4318('0x42')](_0x4318('0x79'),_0x2beb0e['id']);_0x192fc5[_0x4318('0x7a')](db[_0x4318('0x6a')]['query'](_0x562870[_0x4318('0x7b')](),{'type':db[_0x4318('0x6a')][_0x4318('0x7c')][_0x4318('0x7d')]})[_0x4318('0x27')](function(_0x330131){if(_0x330131['length']===0x1){return _0x2beb0e['id'];}else{var _0x3148be=_['every'](_[_0x4318('0x30')](_0x330131,_0x4318('0x7e')),function(_0x1dc554){return _[_0x4318('0x7f')](_0x3938b8,_0x1dc554);});if(_0x3148be){return _0x2beb0e['id'];}}}));}}return BPromise[_0x4318('0x80')](_0x192fc5)['then'](function(_0x7e690e){_0x5f7457=_(_0x5f7457)['union'](_0x7e690e)[_0x4318('0x81')]()['value']();return db['MailQueue']['find']({'where':{'id':_0xda055b[_0x4318('0x4a')]['id']}})['then'](function(_0x4bfbf2){return db[_0x4318('0x6a')][_0x4318('0x6b')](function(_0x135696){return _0x4bfbf2[_0x4318('0x6f')](_0xda055b['query'][_0x4318('0x70')],{'transaction':_0x135696})[_0x4318('0x27')](function(){if(!_[_0x4318('0x82')](_0x5f7457)){return _0x4bfbf2[_0x4318('0x83')](_0x5f7457,{'transaction':_0x135696});}})[_0x4318('0x27')](function(){_0x5f7457[_0x4318('0x6d')](function(_0x1ff34c){socket[_0x4318('0x6e')](_0x4318('0x84'),{'UserId':_0x1ff34c,'MailQueueId':_0x4bfbf2['id']});});});});});});})[_0x4318('0x27')](respondWithStatusCode(_0x5821bf,null))[_0x4318('0x4c')](handleError(_0x5821bf,null));};exports[_0x4318('0x85')]=function(_0x4bf3b6,_0x3bd854,_0x2968ae){return db[_0x4318('0x31')][_0x4318('0x4b')]({'where':{'id':_0x4bf3b6[_0x4318('0x4a')]['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x3bd854,null))[_0x4318('0x27')](function(_0x436735){if(_0x436735){return _0x436735['addAgents'](_0x4bf3b6[_0x4318('0x4e')][_0x4318('0x70')],_[_0x4318('0x86')](_0x4bf3b6['body'],[_0x4318('0x70'),'id'])||{})[_0x4318('0x87')](function(_0x42c9b7){for(var _0x359466=0x0;_0x359466<_0x4bf3b6['body'][_0x4318('0x70')]['length'];_0x359466+=0x1){socket[_0x4318('0x6e')](_0x4318('0x88'),{'UserId':_0x4bf3b6[_0x4318('0x4e')][_0x4318('0x70')][_0x359466],'MailQueueId':_0x4bf3b6['params']['id']});}return _0x42c9b7;});}})[_0x4318('0x27')](respondWithResult(_0x3bd854,null))[_0x4318('0x4c')](handleError(_0x3bd854,null));};exports[_0x4318('0x83')]=function(_0x109dfd,_0xfa6055,_0x349965){return db['MailQueue']['find']({'where':{'id':_0x109dfd[_0x4318('0x4a')]['id']}})[_0x4318('0x27')](handleEntityNotFound(_0xfa6055,null))[_0x4318('0x27')](function(_0x3526ba){if(_0x3526ba){return _0x3526ba[_0x4318('0x83')](_0x109dfd[_0x4318('0x37')][_0x4318('0x70')])[_0x4318('0x27')](function(){if(_['isArray'](_0x109dfd['query'][_0x4318('0x70')])){for(var _0x3678a4=0x0;_0x3678a4<_0x109dfd[_0x4318('0x37')]['ids']['length'];_0x3678a4+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x109dfd[_0x4318('0x37')][_0x4318('0x70')][_0x3678a4]),'MailQueueId':Number(_0x109dfd[_0x4318('0x4a')]['id'])});}}else{socket[_0x4318('0x6e')](_0x4318('0x84'),{'UserId':Number(_0x109dfd[_0x4318('0x37')]['ids']),'MailQueueId':Number(_0x109dfd['params']['id'])});}});}})[_0x4318('0x27')](respondWithStatusCode(_0xfa6055,null))['catch'](handleError(_0xfa6055,null));};exports[_0x4318('0x89')]=function(_0x4af4aa,_0x25ac94,_0x54ed47){var _0x4f54db={};var _0x161c6d={};var _0x2bdbbd;var _0x40d390;return db[_0x4318('0x31')][_0x4318('0x57')]({'where':{'id':_0x4af4aa['params']['id']}})[_0x4318('0x27')](handleEntityNotFound(_0x25ac94,null))[_0x4318('0x27')](function(_0x1d0c26){if(_0x1d0c26){_0x2bdbbd=_0x1d0c26;_0x161c6d[_0x4318('0x36')]=_[_0x4318('0x38')](db[_0x4318('0x67')][_0x4318('0x32')]);_0x161c6d['query']=_['keys'](_0x4af4aa[_0x4318('0x37')]);_0x161c6d[_0x4318('0x39')]=_[_0x4318('0x3a')](_0x161c6d[_0x4318('0x36')],_0x161c6d[_0x4318('0x37')]);_0x4f54db[_0x4318('0x3b')]=_['intersection'](_0x161c6d['model'],qs[_0x4318('0x3c')](_0x4af4aa[_0x4318('0x37')]['fields']));_0x4f54db['attributes']=_0x4f54db[_0x4318('0x3b')][_0x4318('0x3d')]?_0x4f54db['attributes']:_0x161c6d[_0x4318('0x36')];_0x4f54db['order']=qs[_0x4318('0x41')](_0x4af4aa['query'][_0x4318('0x41')]);_0x4f54db['where']=qs[_0x4318('0x39')](_[_0x4318('0x59')](_0x4af4aa['query'],_0x161c6d[_0x4318('0x39')]));if(_0x4af4aa[_0x4318('0x37')][_0x4318('0x43')]){_0x4f54db[_0x4318('0x42')]=_['merge'](_0x4f54db[_0x4318('0x42')],{'$or':_[_0x4318('0x30')](_0x4f54db[_0x4318('0x3b')],function(_0x285f1e){var _0x5934c6={};_0x5934c6[_0x285f1e]={'$like':'%'+_0x4af4aa[_0x4318('0x37')]['filter']+'%'};return _0x5934c6;})});}_0x4f54db=_['merge']({},_0x4f54db,_0x4af4aa['options']);return _0x2bdbbd['getAgents'](_0x4f54db);}})[_0x4318('0x27')](function(_0x14ffd8){if(_0x14ffd8){_0x40d390=_0x14ffd8['length'];if(!_0x4af4aa[_0x4318('0x37')][_0x4318('0x3e')](_0x4318('0x3f'))){_0x4f54db[_0x4318('0x22')]=qs[_0x4318('0x22')](_0x4af4aa[_0x4318('0x37')][_0x4318('0x22')]);_0x4f54db[_0x4318('0x21')]=qs[_0x4318('0x21')](_0x4af4aa[_0x4318('0x37')][_0x4318('0x21')]);}return _0x2bdbbd[_0x4318('0x89')](_0x4f54db);}})['then'](function(_0x1c6e2b){if(_0x1c6e2b){return _0x1c6e2b?{'count':_0x40d390,'rows':_0x1c6e2b}:null;}})['then'](respondWithResult(_0x25ac94,null))['catch'](handleError(_0x25ac94,null));}; \ No newline at end of file +var _0x0c08=['clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','./mailQueue.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','MailQueues','UserProfileResource','error','name','send','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','findOne','UserMailQueue','nolimit','MailQueueId','User','UserId','agent','updatedAt','format','%s/%s','SIP','mailPause','createdAt','getTeams','Team','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','forEach','emit','userMailQueue:save','removeTeams','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?'];(function(_0x3f9f9d,_0x923a36){var _0x3f9fc9=function(_0x1b0e3d){while(--_0x1b0e3d){_0x3f9f9d['push'](_0x3f9f9d['shift']());}};_0x3f9fc9(++_0x923a36);}(_0x0c08,0x9a));var _0x80c0=function(_0x11ba46,_0x1d6752){_0x11ba46=_0x11ba46-0x0;var _0x1c8c6f=_0x0c08[_0x11ba46];return _0x1c8c6f;};'use strict';var pdf=require(_0x80c0('0x0'));var emlformat=require(_0x80c0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x80c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x80c0('0x3'));var moment=require(_0x80c0('0x4'));var BPromise=require(_0x80c0('0x5'));var Mustache=require(_0x80c0('0x6'));var util=require(_0x80c0('0x7'));var path=require('path');var sox=require(_0x80c0('0x8'));var csv=require(_0x80c0('0x9'));var ejs=require(_0x80c0('0xa'));var fs=require('fs');var _=require(_0x80c0('0xb'));var squel=require(_0x80c0('0xc'));var crypto=require(_0x80c0('0xd'));var jsforce=require(_0x80c0('0xe'));var deskjs=require(_0x80c0('0xf'));var toCsv=require(_0x80c0('0x9'));var querystring=require('querystring');var Papa=require(_0x80c0('0x10'));var Redis=require(_0x80c0('0x11'));var authService=require(_0x80c0('0x12'));var qs=require(_0x80c0('0x13'));var as=require(_0x80c0('0x14'));var hardwareService=require(_0x80c0('0x15'));var logger=require('../../config/logger')(_0x80c0('0x16'));var utils=require(_0x80c0('0x17'));var config=require('../../config/environment');var db=require(_0x80c0('0x18'))['db'];config[_0x80c0('0x19')]=_[_0x80c0('0x1a')](config[_0x80c0('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80c0('0x19')]));require(_0x80c0('0x1b'))['register'](socket);function respondWithStatusCode(_0x59561f,_0x13dc2a){_0x13dc2a=_0x13dc2a||0xcc;return function(_0x17be65){if(_0x17be65){return _0x59561f[_0x80c0('0x1c')](_0x13dc2a);}return _0x59561f['status'](_0x13dc2a)[_0x80c0('0x1d')]();};}function respondWithResult(_0x1f2798,_0x6b1ea6){_0x6b1ea6=_0x6b1ea6||0xc8;return function(_0x4b8845){if(_0x4b8845){return _0x1f2798[_0x80c0('0x1e')](_0x6b1ea6)[_0x80c0('0x1f')](_0x4b8845);}};}function respondWithFilteredResult(_0xf35b86,_0x406a1a){return function(_0x4f8f0f){if(_0x4f8f0f){var _0x42e91f=_0x4f8f0f[_0x80c0('0x20')],_0x5c2715=_0x406a1a['offset'],_0x3a73b8=_0x406a1a[_0x80c0('0x21')]+_0x406a1a[_0x80c0('0x22')],_0xabb789;if(_0x3a73b8>=_0x42e91f){_0x3a73b8=_0x42e91f;_0xabb789=0xc8;}else{_0xabb789=0xce;}_0xf35b86[_0x80c0('0x1e')](_0xabb789);return _0xf35b86[_0x80c0('0x23')](_0x80c0('0x24'),_0x5c2715+'-'+_0x3a73b8+'/'+_0x42e91f)[_0x80c0('0x1f')](_0x4f8f0f);}return null;};}function patchUpdates(_0x2b3a77){return function(_0x161f19){try{jsonpatch[_0x80c0('0x25')](_0x161f19,_0x2b3a77,!![]);}catch(_0x112337){return BPromise[_0x80c0('0x26')](_0x112337);}return _0x161f19[_0x80c0('0x27')]();};}function saveUpdates(_0xe47bec,_0x33258d){return function(_0x456027){if(_0x456027){return _0x456027['update'](_0xe47bec)[_0x80c0('0x28')](function(_0x132592){return _0x132592;});}return null;};}function removeEntity(_0x50d3ae,_0x5b85ba){return function(_0x3c29d1){if(_0x3c29d1){return _0x3c29d1['destroy']()['then'](function(){var _0xc81ff6=_0x3c29d1[_0x80c0('0x29')]({'plain':!![]});var _0x55a918=_0x80c0('0x2a');return db[_0x80c0('0x2b')]['destroy']({'where':{'type':_0x55a918,'resourceId':_0xc81ff6['id']}})['then'](function(){return _0x3c29d1;});})[_0x80c0('0x28')](function(){_0x50d3ae[_0x80c0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425433,_0x24d203){return function(_0x301ba9){if(!_0x301ba9){_0x425433[_0x80c0('0x1c')](0x194);}return _0x301ba9;};}function handleError(_0x11f3b7,_0x1b07b4){_0x1b07b4=_0x1b07b4||0x1f4;return function(_0x4e3226){logger[_0x80c0('0x2c')](_0x4e3226['stack']);if(_0x4e3226[_0x80c0('0x2d')]){delete _0x4e3226[_0x80c0('0x2d')];}_0x11f3b7['status'](_0x1b07b4)[_0x80c0('0x2e')](_0x4e3226);};}exports['index']=function(_0x1d506b,_0x1681a9){var _0x4d6f96={},_0x4d1e5b={},_0x3777e9={'count':0x0,'rows':[]};var _0x24159c=_[_0x80c0('0x2f')](db[_0x80c0('0x30')][_0x80c0('0x31')],function(_0x430827){return{'name':_0x430827[_0x80c0('0x32')],'type':_0x430827[_0x80c0('0x33')][_0x80c0('0x34')]};});_0x4d1e5b[_0x80c0('0x35')]=_[_0x80c0('0x2f')](_0x24159c,_0x80c0('0x2d'));_0x4d1e5b['query']=_[_0x80c0('0x36')](_0x1d506b[_0x80c0('0x37')]);_0x4d1e5b[_0x80c0('0x38')]=_['intersection'](_0x4d1e5b[_0x80c0('0x35')],_0x4d1e5b[_0x80c0('0x37')]);_0x4d6f96[_0x80c0('0x39')]=_[_0x80c0('0x3a')](_0x4d1e5b[_0x80c0('0x35')],qs[_0x80c0('0x3b')](_0x1d506b[_0x80c0('0x37')][_0x80c0('0x3b')]));_0x4d6f96[_0x80c0('0x39')]=_0x4d6f96[_0x80c0('0x39')]['length']?_0x4d6f96['attributes']:_0x4d1e5b[_0x80c0('0x35')];if(!_0x1d506b['query'][_0x80c0('0x3c')]('nolimit')){_0x4d6f96[_0x80c0('0x22')]=qs[_0x80c0('0x22')](_0x1d506b[_0x80c0('0x37')][_0x80c0('0x22')]);_0x4d6f96[_0x80c0('0x21')]=qs[_0x80c0('0x21')](_0x1d506b[_0x80c0('0x37')][_0x80c0('0x21')]);}_0x4d6f96[_0x80c0('0x3d')]=qs[_0x80c0('0x3e')](_0x1d506b[_0x80c0('0x37')][_0x80c0('0x3e')]);_0x4d6f96[_0x80c0('0x3f')]=qs[_0x80c0('0x38')](_[_0x80c0('0x40')](_0x1d506b[_0x80c0('0x37')],_0x4d1e5b[_0x80c0('0x38')]),_0x24159c);if(_0x1d506b[_0x80c0('0x37')]['filter']){_0x4d6f96[_0x80c0('0x3f')]=_[_0x80c0('0x41')](_0x4d6f96[_0x80c0('0x3f')],{'$or':_[_0x80c0('0x2f')](_0x24159c,function(_0x2ef4f){if(_0x2ef4f['type']!==_0x80c0('0x42')){var _0x26ceee={};_0x26ceee[_0x2ef4f['name']]={'$like':'%'+_0x1d506b[_0x80c0('0x37')][_0x80c0('0x43')]+'%'};return _0x26ceee;}})});}_0x4d6f96=_[_0x80c0('0x41')]({},_0x4d6f96,_0x1d506b[_0x80c0('0x44')]);var _0x3f2c29={'where':_0x4d6f96['where']};return db['MailQueue'][_0x80c0('0x20')](_0x3f2c29)[_0x80c0('0x28')](function(_0x23a33f){_0x3777e9[_0x80c0('0x20')]=_0x23a33f;if(_0x1d506b['query'][_0x80c0('0x45')]){_0x4d6f96[_0x80c0('0x46')]=[{'all':!![]}];}return db[_0x80c0('0x30')][_0x80c0('0x47')](_0x4d6f96);})[_0x80c0('0x28')](function(_0x540a41){_0x3777e9[_0x80c0('0x48')]=_0x540a41;return _0x3777e9;})[_0x80c0('0x28')](respondWithFilteredResult(_0x1681a9,_0x4d6f96))[_0x80c0('0x49')](handleError(_0x1681a9,null));};exports[_0x80c0('0x4a')]=function(_0x300359,_0x4ad353){var _0x2b2082={'raw':!![],'where':{'id':_0x300359[_0x80c0('0x4b')]['id']}},_0x21e9b6={};_0x21e9b6['model']=_[_0x80c0('0x36')](db[_0x80c0('0x30')]['rawAttributes']);_0x21e9b6[_0x80c0('0x37')]=_['keys'](_0x300359['query']);_0x21e9b6['filters']=_['intersection'](_0x21e9b6[_0x80c0('0x35')],_0x21e9b6[_0x80c0('0x37')]);_0x2b2082[_0x80c0('0x39')]=_[_0x80c0('0x3a')](_0x21e9b6[_0x80c0('0x35')],qs[_0x80c0('0x3b')](_0x300359[_0x80c0('0x37')][_0x80c0('0x3b')]));_0x2b2082[_0x80c0('0x39')]=_0x2b2082[_0x80c0('0x39')][_0x80c0('0x4c')]?_0x2b2082[_0x80c0('0x39')]:_0x21e9b6['model'];if(_0x300359[_0x80c0('0x37')][_0x80c0('0x45')]){_0x2b2082[_0x80c0('0x46')]=[{'all':!![]}];}_0x2b2082=_[_0x80c0('0x41')]({},_0x2b2082,_0x300359['options']);return db[_0x80c0('0x30')][_0x80c0('0x4d')](_0x2b2082)[_0x80c0('0x28')](handleEntityNotFound(_0x4ad353,null))[_0x80c0('0x28')](respondWithResult(_0x4ad353,null))[_0x80c0('0x49')](handleError(_0x4ad353,null));};exports[_0x80c0('0x4e')]=function(_0x29a698,_0x48e8a6){return db[_0x80c0('0x30')][_0x80c0('0x4e')](_0x29a698[_0x80c0('0x4f')],{})[_0x80c0('0x28')](function(_0x518491){var _0x4da34b=_0x29a698[_0x80c0('0x50')][_0x80c0('0x29')]({'plain':!![]});if(!_0x4da34b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4da34b[_0x80c0('0x51')]===_0x80c0('0x50')){var _0x117268=_0x518491[_0x80c0('0x29')]({'plain':!![]});var _0x3bc30d=_0x80c0('0x2a');return db[_0x80c0('0x52')][_0x80c0('0x4d')]({'where':{'name':_0x3bc30d,'userProfileId':_0x4da34b[_0x80c0('0x53')]},'raw':!![]})['then'](function(_0x3b652b){if(_0x3b652b&&_0x3b652b[_0x80c0('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x117268[_0x80c0('0x2d')],'resourceId':_0x117268['id'],'type':_0x3b652b[_0x80c0('0x2d')],'sectionId':_0x3b652b['id']},{})[_0x80c0('0x28')](function(){return _0x518491;});}else{return _0x518491;}})[_0x80c0('0x49')](function(_0x16c146){logger[_0x80c0('0x2c')](_0x80c0('0x55'),_0x16c146);throw _0x16c146;});}return _0x518491;})[_0x80c0('0x28')](respondWithResult(_0x48e8a6,0xc9))[_0x80c0('0x49')](handleError(_0x48e8a6,null));};exports[_0x80c0('0x56')]=function(_0x273396,_0x2960f3){if(_0x273396[_0x80c0('0x4f')]['id']){delete _0x273396[_0x80c0('0x4f')]['id'];}return db[_0x80c0('0x30')]['find']({'where':{'id':_0x273396[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x2960f3,null))[_0x80c0('0x28')](saveUpdates(_0x273396[_0x80c0('0x4f')],null))[_0x80c0('0x28')](respondWithResult(_0x2960f3,null))[_0x80c0('0x49')](handleError(_0x2960f3,null));};exports[_0x80c0('0x57')]=function(_0xfd8b4e,_0x1590c4){return db[_0x80c0('0x30')]['find']({'where':{'id':_0xfd8b4e[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x1590c4,null))['then'](removeEntity(_0x1590c4,null))[_0x80c0('0x49')](handleError(_0x1590c4,null));};exports[_0x80c0('0x58')]=function(_0x1fd025,_0x3b8bb9){return db[_0x80c0('0x30')]['describe']()[_0x80c0('0x28')](respondWithResult(_0x3b8bb9,null))[_0x80c0('0x49')](handleError(_0x3b8bb9,null));};exports['getMembers']=function(_0x249f16,_0x5a78af,_0x54e407){var _0x4e3b4f={'raw':!![],'where':{}},_0x12b655={},_0x11cc80;return db['MailQueue'][_0x80c0('0x59')]({'where':{'id':_0x249f16[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x5a78af,null))[_0x80c0('0x28')](function(_0x377b20){if(_0x377b20){_0x11cc80=_0x377b20[_0x80c0('0x29')]({'plain':!![]});_0x12b655[_0x80c0('0x35')]=_['keys'](db[_0x80c0('0x5a')]['rawAttributes']);_0x12b655[_0x80c0('0x37')]=_[_0x80c0('0x36')](_0x249f16['query']);_0x12b655[_0x80c0('0x38')]=_[_0x80c0('0x3a')](_0x12b655[_0x80c0('0x35')],_0x12b655['query']);_0x4e3b4f[_0x80c0('0x39')]=_[_0x80c0('0x3a')](_0x12b655[_0x80c0('0x35')],qs[_0x80c0('0x3b')](_0x249f16[_0x80c0('0x37')][_0x80c0('0x3b')]));_0x4e3b4f['attributes']=_0x4e3b4f[_0x80c0('0x39')][_0x80c0('0x4c')]?_0x4e3b4f['attributes']:_0x12b655[_0x80c0('0x35')];if(!_0x249f16[_0x80c0('0x37')][_0x80c0('0x3c')](_0x80c0('0x5b'))){_0x4e3b4f[_0x80c0('0x22')]=qs[_0x80c0('0x22')](_0x249f16[_0x80c0('0x37')][_0x80c0('0x22')]);_0x4e3b4f['offset']=qs[_0x80c0('0x21')](_0x249f16[_0x80c0('0x37')][_0x80c0('0x21')]);}_0x4e3b4f['order']=qs[_0x80c0('0x3e')](_0x249f16[_0x80c0('0x37')][_0x80c0('0x3e')]);_0x4e3b4f[_0x80c0('0x3f')]=qs[_0x80c0('0x38')](_['pick'](_0x249f16['query'],_0x12b655[_0x80c0('0x38')]));_0x4e3b4f[_0x80c0('0x3f')][_0x80c0('0x5c')]=_0x377b20['id'];if(_0x249f16['query'][_0x80c0('0x43')]){_0x4e3b4f['where']=_[_0x80c0('0x41')](_0x4e3b4f['where'],{'$or':_['map'](_0x4e3b4f['attributes'],function(_0x51afb7){var _0x2b3f2c={};_0x2b3f2c[_0x51afb7]={'$like':'%'+_0x249f16[_0x80c0('0x37')][_0x80c0('0x43')]+'%'};return _0x2b3f2c;})});}_0x4e3b4f=_[_0x80c0('0x41')]({},_0x4e3b4f,_0x249f16['options']);return db[_0x80c0('0x5a')]['findAll'](_0x4e3b4f);}})[_0x80c0('0x28')](function(_0x293506){if(_0x293506){return db[_0x80c0('0x5d')]['findAndCountAll']({'where':{'id':_[_0x80c0('0x2f')](_0x293506,_0x80c0('0x5e')),'role':_0x80c0('0x5f')},'attributes':['id',_0x80c0('0x2d'),'mailPause',_0x80c0('0x60'),'createdAt']});}})[_0x80c0('0x28')](function(_0x2e1fd9){if(_0x2e1fd9){return{'count':_0x2e1fd9['count'],'rows':_['map'](_0x2e1fd9[_0x80c0('0x48')],function(_0x4762ea){return{'membername':_0x4762ea['name'],'UserId':_0x4762ea['id'],'queue_name':_0x11cc80[_0x80c0('0x2d')],'MailQueueId':_0x11cc80['id'],'interface':util[_0x80c0('0x61')](_0x80c0('0x62'),_0x80c0('0x63'),_0x4762ea[_0x80c0('0x2d')]),'penalty':0x0,'paused':_0x4762ea[_0x80c0('0x64')],'createdAt':_0x4762ea[_0x80c0('0x65')],'updatedAt':_0x4762ea[_0x80c0('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x80c0('0x28')](respondWithFilteredResult(_0x5a78af,_0x4e3b4f))['catch'](handleError(_0x5a78af,null));};exports[_0x80c0('0x66')]=function(_0x19204f,_0x23e353,_0x4a5a73){var _0x56ec6b={};var _0x33807c={};var _0x174d82;var _0x14da59;return db[_0x80c0('0x30')]['findOne']({'where':{'id':_0x19204f['params']['id']}})['then'](handleEntityNotFound(_0x23e353,null))[_0x80c0('0x28')](function(_0x28820e){if(_0x28820e){_0x174d82=_0x28820e;_0x33807c[_0x80c0('0x35')]=_[_0x80c0('0x36')](db[_0x80c0('0x67')][_0x80c0('0x31')]);_0x33807c[_0x80c0('0x37')]=_[_0x80c0('0x36')](_0x19204f['query']);_0x33807c[_0x80c0('0x38')]=_[_0x80c0('0x3a')](_0x33807c['model'],_0x33807c['query']);_0x56ec6b[_0x80c0('0x39')]=_[_0x80c0('0x3a')](_0x33807c[_0x80c0('0x35')],qs[_0x80c0('0x3b')](_0x19204f['query'][_0x80c0('0x3b')]));_0x56ec6b[_0x80c0('0x39')]=_0x56ec6b['attributes']['length']?_0x56ec6b[_0x80c0('0x39')]:_0x33807c[_0x80c0('0x35')];_0x56ec6b[_0x80c0('0x3d')]=qs[_0x80c0('0x3e')](_0x19204f['query']['sort']);_0x56ec6b[_0x80c0('0x3f')]=qs['filters'](_[_0x80c0('0x40')](_0x19204f[_0x80c0('0x37')],_0x33807c[_0x80c0('0x38')]));if(_0x19204f['query']['filter']){_0x56ec6b[_0x80c0('0x3f')]=_['merge'](_0x56ec6b[_0x80c0('0x3f')],{'$or':_[_0x80c0('0x2f')](_0x56ec6b[_0x80c0('0x39')],function(_0x46b9bd){var _0x28183f={};_0x28183f[_0x46b9bd]={'$like':'%'+_0x19204f[_0x80c0('0x37')][_0x80c0('0x43')]+'%'};return _0x28183f;})});}_0x56ec6b=_[_0x80c0('0x41')]({},_0x56ec6b,_0x19204f[_0x80c0('0x44')]);return _0x174d82['getTeams'](_0x56ec6b);}})['then'](function(_0x4cf789){if(_0x4cf789){_0x14da59=_0x4cf789[_0x80c0('0x4c')];if(!_0x19204f[_0x80c0('0x37')][_0x80c0('0x3c')](_0x80c0('0x5b'))){_0x56ec6b['limit']=qs['limit'](_0x19204f[_0x80c0('0x37')][_0x80c0('0x22')]);_0x56ec6b[_0x80c0('0x21')]=qs[_0x80c0('0x21')](_0x19204f['query']['offset']);}return _0x174d82['getTeams'](_0x56ec6b);}})[_0x80c0('0x28')](function(_0x2e1527){if(_0x2e1527){return _0x2e1527?{'count':_0x14da59,'rows':_0x2e1527}:null;}})[_0x80c0('0x28')](respondWithResult(_0x23e353,null))[_0x80c0('0x49')](handleError(_0x23e353,null));};exports[_0x80c0('0x68')]=function(_0x36b35e,_0x572e34,_0xbc849){var _0x4cbe20=_0x36b35e['body'][_0x80c0('0x69')];return db[_0x80c0('0x67')]['findAll']({'where':{'id':_0x4cbe20},'attributes':['id'],'include':[{'model':db[_0x80c0('0x5d')],'as':'Agents','attributes':['id',_0x80c0('0x2d'),'online',_0x80c0('0x6a'),_0x80c0('0x6b')],'raw':!![]}]})[_0x80c0('0x28')](function(_0xc98274){if(_0xc98274){var _0xa164df=_[_0x80c0('0x6c')](_0xc98274,function(_0x4bb3eb){var _0x387911=_0x4bb3eb['get']({'plain':!![]});return _0x387911[_0x80c0('0x6d')];});return db[_0x80c0('0x30')][_0x80c0('0x4d')]({'where':{'id':_0x36b35e['params']['id']}})[_0x80c0('0x28')](function(_0x1d71ef){return db[_0x80c0('0x6e')][_0x80c0('0x6f')](function(_0x32b132){return _0x1d71ef['addTeams'](_0x4cbe20,{'transaction':_0x32b132})[_0x80c0('0x28')](function(){return BPromise['each'](_0xa164df,function(_0x332a84){return db[_0x80c0('0x5a')]['findOrCreate']({'where':{'UserId':_0x332a84['id'],'MailQueueId':_0x36b35e[_0x80c0('0x4b')]['id']},'transaction':_0x32b132});});})[_0x80c0('0x28')](function(){_0xa164df[_0x80c0('0x70')](function(_0x2501a2){socket[_0x80c0('0x71')](_0x80c0('0x72'),{'UserId':_0x2501a2['id'],'MailQueueId':_0x1d71ef['id']});});});});});}})[_0x80c0('0x28')](respondWithStatusCode(_0x572e34,null))['catch'](handleError(_0x572e34,null));};exports[_0x80c0('0x73')]=function(_0x2576fd,_0x4b6f3e,_0x1e2c07){return db[_0x80c0('0x67')][_0x80c0('0x47')]({'where':{'id':_0x2576fd[_0x80c0('0x37')][_0x80c0('0x69')]},'attributes':['id'],'include':[{'model':db[_0x80c0('0x5d')],'as':_0x80c0('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4b6f3e,null))[_0x80c0('0x28')](function(_0x587f97){var _0x2c9e2d=_[_0x80c0('0x2f')](_0x587f97,'id');var _0x53bdac=[];var _0x371ebe=[];var _0x421656=squel['select']();_0x421656['field'](_0x80c0('0x74'))[_0x80c0('0x75')](_0x80c0('0x76'),'tq')[_0x80c0('0x77')](_0x80c0('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x80c0('0x79'),_0x2576fd[_0x80c0('0x4b')]['id']);for(var _0x1a99d5=0x0;_0x1a99d5<_0x587f97['length'];_0x1a99d5+=0x1){let _0x4cd8c9=_0x587f97[_0x1a99d5];for(var _0x93bcf6=0x0;_0x93bcf6<_0x4cd8c9[_0x80c0('0x6d')][_0x80c0('0x4c')];_0x93bcf6+=0x1){let _0x1245fc=_0x4cd8c9[_0x80c0('0x6d')][_0x93bcf6];var _0x215e23=_0x421656[_0x80c0('0x7a')]();_0x215e23[_0x80c0('0x3f')](_0x80c0('0x7b'),_0x1245fc['id']);_0x371ebe[_0x80c0('0x7c')](db[_0x80c0('0x6e')]['query'](_0x215e23[_0x80c0('0x7d')](),{'type':db['sequelize'][_0x80c0('0x7e')][_0x80c0('0x7f')]})[_0x80c0('0x28')](function(_0x11a357){if(_0x11a357[_0x80c0('0x4c')]===0x1){return _0x1245fc['id'];}else{var _0xeff41d=_[_0x80c0('0x80')](_[_0x80c0('0x2f')](_0x11a357,_0x80c0('0x81')),function(_0x128117){return _[_0x80c0('0x82')](_0x2c9e2d,_0x128117);});if(_0xeff41d){return _0x1245fc['id'];}}}));}}return BPromise[_0x80c0('0x83')](_0x371ebe)[_0x80c0('0x28')](function(_0x2f359b){_0x53bdac=_(_0x53bdac)['union'](_0x2f359b)['compact']()['value']();return db[_0x80c0('0x30')][_0x80c0('0x4d')]({'where':{'id':_0x2576fd[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](function(_0x4b3872){return db['sequelize'][_0x80c0('0x6f')](function(_0x4a7fd5){return _0x4b3872['removeTeams'](_0x2576fd[_0x80c0('0x37')]['ids'],{'transaction':_0x4a7fd5})[_0x80c0('0x28')](function(){if(!_['isEmpty'](_0x53bdac)){return _0x4b3872[_0x80c0('0x84')](_0x53bdac,{'transaction':_0x4a7fd5});}})[_0x80c0('0x28')](function(){_0x53bdac['forEach'](function(_0x37edce){socket[_0x80c0('0x71')](_0x80c0('0x85'),{'UserId':_0x37edce,'MailQueueId':_0x4b3872['id']});});});});});});})[_0x80c0('0x28')](respondWithStatusCode(_0x4b6f3e,null))['catch'](handleError(_0x4b6f3e,null));};exports[_0x80c0('0x86')]=function(_0x1616ac,_0x5c96e6,_0x17fd29){return db['MailQueue'][_0x80c0('0x4d')]({'where':{'id':_0x1616ac[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x5c96e6,null))[_0x80c0('0x28')](function(_0x2777ad){if(_0x2777ad){return _0x2777ad[_0x80c0('0x86')](_0x1616ac[_0x80c0('0x4f')]['ids'],_[_0x80c0('0x87')](_0x1616ac[_0x80c0('0x4f')],[_0x80c0('0x69'),'id'])||{})[_0x80c0('0x88')](function(_0x19149b){for(var _0x55ae13=0x0;_0x55ae13<_0x1616ac[_0x80c0('0x4f')][_0x80c0('0x69')][_0x80c0('0x4c')];_0x55ae13+=0x1){socket[_0x80c0('0x71')](_0x80c0('0x72'),{'UserId':_0x1616ac[_0x80c0('0x4f')][_0x80c0('0x69')][_0x55ae13],'MailQueueId':_0x1616ac[_0x80c0('0x4b')]['id']});}return _0x19149b;});}})[_0x80c0('0x28')](respondWithResult(_0x5c96e6,null))[_0x80c0('0x49')](handleError(_0x5c96e6,null));};exports[_0x80c0('0x84')]=function(_0x3bc270,_0x4ad9d4,_0x12b316){return db[_0x80c0('0x30')]['find']({'where':{'id':_0x3bc270[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x4ad9d4,null))[_0x80c0('0x28')](function(_0x8ed394){if(_0x8ed394){return _0x8ed394[_0x80c0('0x84')](_0x3bc270[_0x80c0('0x37')][_0x80c0('0x69')])['then'](function(){if(_['isArray'](_0x3bc270[_0x80c0('0x37')][_0x80c0('0x69')])){for(var _0x4dfb46=0x0;_0x4dfb46<_0x3bc270['query'][_0x80c0('0x69')]['length'];_0x4dfb46+=0x1){socket[_0x80c0('0x71')](_0x80c0('0x85'),{'UserId':Number(_0x3bc270[_0x80c0('0x37')]['ids'][_0x4dfb46]),'MailQueueId':Number(_0x3bc270[_0x80c0('0x4b')]['id'])});}}else{socket[_0x80c0('0x71')](_0x80c0('0x85'),{'UserId':Number(_0x3bc270['query'][_0x80c0('0x69')]),'MailQueueId':Number(_0x3bc270[_0x80c0('0x4b')]['id'])});}});}})[_0x80c0('0x28')](respondWithStatusCode(_0x4ad9d4,null))[_0x80c0('0x49')](handleError(_0x4ad9d4,null));};exports[_0x80c0('0x89')]=function(_0x197575,_0x2b2999,_0x571a92){var _0x1ae452={};var _0x2387ba={};var _0x139bef;var _0x469160;return db[_0x80c0('0x30')][_0x80c0('0x59')]({'where':{'id':_0x197575[_0x80c0('0x4b')]['id']}})[_0x80c0('0x28')](handleEntityNotFound(_0x2b2999,null))['then'](function(_0x54bd3c){if(_0x54bd3c){_0x139bef=_0x54bd3c;_0x2387ba[_0x80c0('0x35')]=_['keys'](db[_0x80c0('0x5d')][_0x80c0('0x31')]);_0x2387ba['query']=_[_0x80c0('0x36')](_0x197575[_0x80c0('0x37')]);_0x2387ba['filters']=_[_0x80c0('0x3a')](_0x2387ba['model'],_0x2387ba[_0x80c0('0x37')]);_0x1ae452[_0x80c0('0x39')]=_['intersection'](_0x2387ba[_0x80c0('0x35')],qs[_0x80c0('0x3b')](_0x197575[_0x80c0('0x37')][_0x80c0('0x3b')]));_0x1ae452[_0x80c0('0x39')]=_0x1ae452['attributes'][_0x80c0('0x4c')]?_0x1ae452['attributes']:_0x2387ba[_0x80c0('0x35')];_0x1ae452[_0x80c0('0x3d')]=qs['sort'](_0x197575['query'][_0x80c0('0x3e')]);_0x1ae452[_0x80c0('0x3f')]=qs['filters'](_[_0x80c0('0x40')](_0x197575[_0x80c0('0x37')],_0x2387ba[_0x80c0('0x38')]));if(_0x197575[_0x80c0('0x37')]['filter']){_0x1ae452[_0x80c0('0x3f')]=_[_0x80c0('0x41')](_0x1ae452['where'],{'$or':_[_0x80c0('0x2f')](_0x1ae452[_0x80c0('0x39')],function(_0x284381){var _0x4bcb73={};_0x4bcb73[_0x284381]={'$like':'%'+_0x197575[_0x80c0('0x37')][_0x80c0('0x43')]+'%'};return _0x4bcb73;})});}_0x1ae452=_[_0x80c0('0x41')]({},_0x1ae452,_0x197575['options']);return _0x139bef[_0x80c0('0x89')](_0x1ae452);}})[_0x80c0('0x28')](function(_0x2a6b92){if(_0x2a6b92){_0x469160=_0x2a6b92[_0x80c0('0x4c')];if(!_0x197575[_0x80c0('0x37')][_0x80c0('0x3c')](_0x80c0('0x5b'))){_0x1ae452[_0x80c0('0x22')]=qs['limit'](_0x197575['query'][_0x80c0('0x22')]);_0x1ae452[_0x80c0('0x21')]=qs[_0x80c0('0x21')](_0x197575[_0x80c0('0x37')][_0x80c0('0x21')]);}return _0x139bef[_0x80c0('0x89')](_0x1ae452);}})['then'](function(_0x24fc0a){if(_0x24fc0a){return _0x24fc0a?{'count':_0x469160,'rows':_0x24fc0a}:null;}})['then'](respondWithResult(_0x2b2999,null))[_0x80c0('0x49')](handleError(_0x2b2999,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f18bac8..41984e5 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 _0xf853=['MailQueue','setMaxListeners','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x58a058,_0x5965eb){var _0x347664=function(_0x2d24db){while(--_0x2d24db){_0x58a058['push'](_0x58a058['shift']());}};_0x347664(++_0x5965eb);}(_0xf853,0x154));var _0x3f85=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xf853[_0x9b3efc];return _0x200f05;};'use strict';var EventEmitter=require(_0x3f85('0x0'));var MailQueue=require(_0x3f85('0x1'))['db'][_0x3f85('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3f85('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x136a3b){return function(_0x20742c,_0x2902fc,_0x16e63c){MailQueueEvents['emit'](_0x136a3b+':'+_0x20742c['id'],_0x20742c);MailQueueEvents['emit'](_0x136a3b,_0x20742c);_0x16e63c(null);};}for(var e in events){if(events[_0x3f85('0x4')](e)){var event=events[e];MailQueue[_0x3f85('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x4400=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x40eadc,_0x37af8d){var _0x6963b4=function(_0x4c2c9){while(--_0x4c2c9){_0x40eadc['push'](_0x40eadc['shift']());}};_0x6963b4(++_0x37af8d);}(_0x4400,0x18a));var _0x0440=function(_0x1ba92f,_0x767383){_0x1ba92f=_0x1ba92f-0x0;var _0x227a84=_0x4400[_0x1ba92f];return _0x227a84;};'use strict';var EventEmitter=require(_0x0440('0x0'));var MailQueue=require(_0x0440('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0440('0x2')](0x0);var events={'afterCreate':_0x0440('0x3'),'afterUpdate':_0x0440('0x4'),'afterDestroy':_0x0440('0x5')};function emitEvent(_0x257a5){return function(_0x4eff1e,_0x4a3b3a,_0x5475e8){MailQueueEvents[_0x0440('0x6')](_0x257a5+':'+_0x4eff1e['id'],_0x4eff1e);MailQueueEvents[_0x0440('0x6')](_0x257a5,_0x4eff1e);_0x5475e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x0440('0x7')](e,emitEvent(event));}}module[_0x0440('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 4d43310..acad277 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 _0x57af=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f3ecd,_0x57976b){var _0xffdc44=function(_0xf21bc6){while(--_0xf21bc6){_0x2f3ecd['push'](_0x2f3ecd['shift']());}};_0xffdc44(++_0x57976b);}(_0x57af,0x76));var _0xf57a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x57af[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xf57a('0x0'));var util=require(_0xf57a('0x1'));var logger=require('../../config/logger')(_0xf57a('0x2'));var moment=require(_0xf57a('0x3'));var BPromise=require(_0xf57a('0x4'));var rp=require(_0xf57a('0x5'));var fs=require('fs');var path=require(_0xf57a('0x6'));var rimraf=require(_0xf57a('0x7'));var config=require(_0xf57a('0x8'));var attributes=require(_0xf57a('0x9'));module[_0xf57a('0xa')]=function(_0x5d6388,_0xdf0098){return _0x5d6388[_0xf57a('0xb')](_0xf57a('0xc'),attributes,{'tableName':_0xf57a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa18e=['rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','moment','bluebird','request-promise','path'];(function(_0x288ba7,_0x511651){var _0x127f4d=function(_0x38950e){while(--_0x38950e){_0x288ba7['push'](_0x288ba7['shift']());}};_0x127f4d(++_0x511651);}(_0xa18e,0x103));var _0xea18=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xa18e[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xea18('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xea18('0x1'));var BPromise=require(_0xea18('0x2'));var rp=require(_0xea18('0x3'));var fs=require('fs');var path=require(_0xea18('0x4'));var rimraf=require(_0xea18('0x5'));var config=require(_0xea18('0x6'));var attributes=require(_0xea18('0x7'));module['exports']=function(_0x32b693,_0x2773e8){return _0x32b693[_0xea18('0x8')](_0xea18('0x9'),attributes,{'tableName':_0xea18('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 61a7252..ab3f545 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 _0x6c24=['attributes','limit','include','map','model','debug','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where'];(function(_0x1093c0,_0x5b0e21){var _0x5cc0b8=function(_0x1d24b8){while(--_0x1d24b8){_0x1093c0['push'](_0x1093c0['shift']());}};_0x5cc0b8(++_0x5b0e21);}(_0x6c24,0x1cb));var _0x46c2=function(_0x248fcd,_0x2aa7cd){_0x248fcd=_0x248fcd-0x0;var _0x56a9ce=_0x6c24[_0x248fcd];return _0x56a9ce;};'use strict';var _=require(_0x46c2('0x0'));var util=require(_0x46c2('0x1'));var moment=require(_0x46c2('0x2'));var BPromise=require(_0x46c2('0x3'));var rs=require(_0x46c2('0x4'));var fs=require('fs');var Redis=require(_0x46c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x46c2('0x6'));var logger=require(_0x46c2('0x7'))(_0x46c2('0x8'));var config=require('../../config/environment');var jayson=require(_0x46c2('0x9'));var client=jayson[_0x46c2('0xa')][_0x46c2('0xb')]({'port':0x232a});config[_0x46c2('0xc')]=_[_0x46c2('0xd')](config[_0x46c2('0xc')],{'host':_0x46c2('0xe'),'port':0x18eb});var socket=require(_0x46c2('0xf'))(new Redis(config['redis']));require(_0x46c2('0x10'))[_0x46c2('0x11')](socket);function respondWithRpcPromise(_0x5b4a49,_0x283d76,_0x3823e2){return new BPromise(function(_0x4e6ef8,_0x1bc8f8){return client['request'](_0x5b4a49,_0x3823e2)[_0x46c2('0x12')](function(_0x4d343f){logger[_0x46c2('0x13')](_0x46c2('0x14'),_0x283d76,_0x46c2('0x15'));logger['debug'](_0x46c2('0x16'),_0x283d76,'request\x20sent',JSON[_0x46c2('0x17')](_0x4d343f));if(_0x4d343f[_0x46c2('0x18')]){if(_0x4d343f['error']['code']===0x1f4){logger[_0x46c2('0x18')]('MailQueue,\x20%s,\x20%s',_0x283d76,_0x4d343f[_0x46c2('0x18')][_0x46c2('0x19')]);return _0x1bc8f8(_0x4d343f[_0x46c2('0x18')][_0x46c2('0x19')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x283d76,_0x4d343f[_0x46c2('0x18')][_0x46c2('0x19')]);return _0x4e6ef8(_0x4d343f[_0x46c2('0x18')][_0x46c2('0x19')]);}else{logger[_0x46c2('0x13')]('MailQueue,\x20%s,\x20%s',_0x283d76,_0x46c2('0x15'));_0x4e6ef8(_0x4d343f[_0x46c2('0x1a')][_0x46c2('0x19')]);}})[_0x46c2('0x1b')](function(_0x2aa4a7){logger[_0x46c2('0x18')](_0x46c2('0x14'),_0x283d76,_0x2aa4a7);_0x1bc8f8(_0x2aa4a7);});});}exports[_0x46c2('0x1c')]=function(_0x3b57e0){var _0x145ad2=this;return new Promise(function(_0x3d9670,_0x282155){return db[_0x46c2('0x1d')]['findAll']({'raw':_0x3b57e0['options']?_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x1f')]===undefined?!![]:![]:!![],'where':_0x3b57e0[_0x46c2('0x1e')]?_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x20')]||null:null,'attributes':_0x3b57e0[_0x46c2('0x1e')]?_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x21')]||null:null,'limit':_0x3b57e0[_0x46c2('0x1e')]?_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x22')]||null:null,'include':_0x3b57e0[_0x46c2('0x1e')]?_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x23')]?_[_0x46c2('0x24')](_0x3b57e0[_0x46c2('0x1e')][_0x46c2('0x23')],function(_0x5667d1){return{'model':db[_0x5667d1[_0x46c2('0x25')]],'as':_0x5667d1['as'],'attributes':_0x5667d1[_0x46c2('0x21')],'include':_0x5667d1[_0x46c2('0x23')]?_[_0x46c2('0x24')](_0x5667d1['include'],function(_0x1f421b){return{'model':db[_0x1f421b[_0x46c2('0x25')]],'as':_0x1f421b['as'],'attributes':_0x1f421b[_0x46c2('0x21')],'include':_0x1f421b[_0x46c2('0x23')]?_[_0x46c2('0x24')](_0x1f421b[_0x46c2('0x23')],function(_0x53e242){return{'model':db[_0x53e242['model']],'as':_0x53e242['as'],'attributes':_0x53e242[_0x46c2('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16b407){logger[_0x46c2('0x13')]('GetMailQueue',_0x3b57e0);logger[_0x46c2('0x26')](_0x46c2('0x1c'),_0x3b57e0,JSON[_0x46c2('0x17')](_0x16b407));_0x3d9670(_0x16b407);})[_0x46c2('0x1b')](function(_0x6e7f){logger['error'](_0x46c2('0x1c'),_0x6e7f[_0x46c2('0x19')],_0x3b57e0);_0x282155(_0x145ad2[_0x46c2('0x18')](0x1f4,_0x6e7f[_0x46c2('0x19')]));});});};exports[_0x46c2('0x27')]=function(_0x5a817b){var _0x35b3e9=this;return new Promise(function(_0x497018,_0x3efc2e){return db['MailQueue'][_0x46c2('0x28')]({'raw':_0x5a817b[_0x46c2('0x1e')]?_0x5a817b[_0x46c2('0x1e')][_0x46c2('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a817b[_0x46c2('0x1e')]?_0x5a817b['options']['where']||null:null,'attributes':_0x5a817b[_0x46c2('0x1e')]?_0x5a817b[_0x46c2('0x1e')][_0x46c2('0x21')]||null:null,'include':_0x5a817b['options']?_0x5a817b['options'][_0x46c2('0x23')]?_[_0x46c2('0x24')](_0x5a817b[_0x46c2('0x1e')]['include'],function(_0x1a5eb8){return{'model':db[_0x1a5eb8[_0x46c2('0x25')]],'as':_0x1a5eb8['as'],'attributes':_0x1a5eb8['attributes'],'include':_0x1a5eb8[_0x46c2('0x23')]?_[_0x46c2('0x24')](_0x1a5eb8[_0x46c2('0x23')],function(_0x18aba4){return{'model':db[_0x18aba4[_0x46c2('0x25')]],'as':_0x18aba4['as'],'attributes':_0x18aba4[_0x46c2('0x21')],'include':_0x18aba4[_0x46c2('0x23')]?_['map'](_0x18aba4[_0x46c2('0x23')],function(_0x59468b){return{'model':db[_0x59468b['model']],'as':_0x59468b['as'],'attributes':_0x59468b[_0x46c2('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b465f){logger[_0x46c2('0x13')](_0x46c2('0x27'),_0x5a817b);logger['debug'](_0x46c2('0x27'),_0x5a817b,JSON[_0x46c2('0x17')](_0x4b465f));_0x497018(_0x4b465f);})[_0x46c2('0x1b')](function(_0x4e11bb){logger[_0x46c2('0x18')]('ShowMailQueue',_0x4e11bb['message'],_0x5a817b);_0x3efc2e(_0x35b3e9['error'](0x1f4,_0x4e11bb[_0x46c2('0x19')]));});});}; \ No newline at end of file +var _0xea49=['where','info','ShowMailQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','raw','attributes','limit','include','map','model','then','GetMailQueue'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xea49,0x14b));var _0x9ea4=function(_0x54904e,_0x5647ff){_0x54904e=_0x54904e-0x0;var _0x179c42=_0xea49[_0x54904e];return _0x179c42;};'use strict';var _=require(_0x9ea4('0x0'));var util=require(_0x9ea4('0x1'));var moment=require('moment');var BPromise=require(_0x9ea4('0x2'));var rs=require(_0x9ea4('0x3'));var fs=require('fs');var Redis=require(_0x9ea4('0x4'));var db=require(_0x9ea4('0x5'))['db'];var utils=require(_0x9ea4('0x6'));var logger=require(_0x9ea4('0x7'))('rpc');var config=require(_0x9ea4('0x8'));var jayson=require(_0x9ea4('0x9'));var client=jayson[_0x9ea4('0xa')][_0x9ea4('0xb')]({'port':0x232a});config[_0x9ea4('0xc')]=_['defaults'](config['redis'],{'host':_0x9ea4('0xd'),'port':0x18eb});var socket=require(_0x9ea4('0xe'))(new Redis(config[_0x9ea4('0xc')]));require(_0x9ea4('0xf'))[_0x9ea4('0x10')](socket);function respondWithRpcPromise(_0x3e81b8,_0x4fbdf0,_0x7a0a1e){return new BPromise(function(_0x2f8309,_0xc82666){return client[_0x9ea4('0x11')](_0x3e81b8,_0x7a0a1e)['then'](function(_0x258d6e){logger['info'](_0x9ea4('0x12'),_0x4fbdf0,_0x9ea4('0x13'));logger[_0x9ea4('0x14')](_0x9ea4('0x15'),_0x4fbdf0,_0x9ea4('0x13'),JSON[_0x9ea4('0x16')](_0x258d6e));if(_0x258d6e['error']){if(_0x258d6e[_0x9ea4('0x17')]['code']===0x1f4){logger['error'](_0x9ea4('0x12'),_0x4fbdf0,_0x258d6e[_0x9ea4('0x17')][_0x9ea4('0x18')]);return _0xc82666(_0x258d6e[_0x9ea4('0x17')][_0x9ea4('0x18')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x4fbdf0,_0x258d6e[_0x9ea4('0x17')][_0x9ea4('0x18')]);return _0x2f8309(_0x258d6e[_0x9ea4('0x17')][_0x9ea4('0x18')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x4fbdf0,_0x9ea4('0x13'));_0x2f8309(_0x258d6e[_0x9ea4('0x19')]['message']);}})[_0x9ea4('0x1a')](function(_0x250e7f){logger[_0x9ea4('0x17')](_0x9ea4('0x12'),_0x4fbdf0,_0x250e7f);_0xc82666(_0x250e7f);});});}exports['GetMailQueue']=function(_0x5a0870){var _0x12867b=this;return new Promise(function(_0x2cbd87,_0x4599d3){return db[_0x9ea4('0x1b')][_0x9ea4('0x1c')]({'raw':_0x5a0870['options']?_0x5a0870[_0x9ea4('0x1d')][_0x9ea4('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a0870[_0x9ea4('0x1d')]?_0x5a0870[_0x9ea4('0x1d')]['where']||null:null,'attributes':_0x5a0870[_0x9ea4('0x1d')]?_0x5a0870['options'][_0x9ea4('0x1f')]||null:null,'limit':_0x5a0870[_0x9ea4('0x1d')]?_0x5a0870[_0x9ea4('0x1d')][_0x9ea4('0x20')]||null:null,'include':_0x5a0870[_0x9ea4('0x1d')]?_0x5a0870[_0x9ea4('0x1d')][_0x9ea4('0x21')]?_[_0x9ea4('0x22')](_0x5a0870[_0x9ea4('0x1d')][_0x9ea4('0x21')],function(_0x1c456c){return{'model':db[_0x1c456c[_0x9ea4('0x23')]],'as':_0x1c456c['as'],'attributes':_0x1c456c[_0x9ea4('0x1f')],'include':_0x1c456c['include']?_[_0x9ea4('0x22')](_0x1c456c[_0x9ea4('0x21')],function(_0x283713){return{'model':db[_0x283713[_0x9ea4('0x23')]],'as':_0x283713['as'],'attributes':_0x283713[_0x9ea4('0x1f')],'include':_0x283713[_0x9ea4('0x21')]?_[_0x9ea4('0x22')](_0x283713['include'],function(_0x1b51bc){return{'model':db[_0x1b51bc[_0x9ea4('0x23')]],'as':_0x1b51bc['as'],'attributes':_0x1b51bc[_0x9ea4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9ea4('0x24')](function(_0x3bd439){logger['info'](_0x9ea4('0x25'),_0x5a0870);logger[_0x9ea4('0x14')](_0x9ea4('0x25'),_0x5a0870,JSON[_0x9ea4('0x16')](_0x3bd439));_0x2cbd87(_0x3bd439);})['catch'](function(_0x1cbe54){logger['error'](_0x9ea4('0x25'),_0x1cbe54[_0x9ea4('0x18')],_0x5a0870);_0x4599d3(_0x12867b[_0x9ea4('0x17')](0x1f4,_0x1cbe54[_0x9ea4('0x18')]));});});};exports['ShowMailQueue']=function(_0x505d03){var _0x305001=this;return new Promise(function(_0x3df288,_0x3ca2a3){return db['MailQueue']['find']({'raw':_0x505d03[_0x9ea4('0x1d')]?_0x505d03[_0x9ea4('0x1d')][_0x9ea4('0x1e')]===undefined?!![]:![]:!![],'where':_0x505d03['options']?_0x505d03[_0x9ea4('0x1d')][_0x9ea4('0x26')]||null:null,'attributes':_0x505d03['options']?_0x505d03[_0x9ea4('0x1d')][_0x9ea4('0x1f')]||null:null,'include':_0x505d03[_0x9ea4('0x1d')]?_0x505d03[_0x9ea4('0x1d')][_0x9ea4('0x21')]?_[_0x9ea4('0x22')](_0x505d03[_0x9ea4('0x1d')][_0x9ea4('0x21')],function(_0x361988){return{'model':db[_0x361988[_0x9ea4('0x23')]],'as':_0x361988['as'],'attributes':_0x361988[_0x9ea4('0x1f')],'include':_0x361988[_0x9ea4('0x21')]?_[_0x9ea4('0x22')](_0x361988[_0x9ea4('0x21')],function(_0x5e03b9){return{'model':db[_0x5e03b9['model']],'as':_0x5e03b9['as'],'attributes':_0x5e03b9[_0x9ea4('0x1f')],'include':_0x5e03b9[_0x9ea4('0x21')]?_[_0x9ea4('0x22')](_0x5e03b9[_0x9ea4('0x21')],function(_0xcb1bd9){return{'model':db[_0xcb1bd9[_0x9ea4('0x23')]],'as':_0xcb1bd9['as'],'attributes':_0xcb1bd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ea4('0x24')](function(_0x45af32){logger[_0x9ea4('0x27')](_0x9ea4('0x28'),_0x505d03);logger['debug'](_0x9ea4('0x28'),_0x505d03,JSON[_0x9ea4('0x16')](_0x45af32));_0x3df288(_0x45af32);})[_0x9ea4('0x1a')](function(_0x36d1dd){logger[_0x9ea4('0x17')]('ShowMailQueue',_0x36d1dd[_0x9ea4('0x18')],_0x505d03);_0x3ca2a3(_0x305001[_0x9ea4('0x17')](0x1f4,_0x36d1dd[_0x9ea4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index e6e16e7..4d80c5b 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 _0xc3fe=['emit','length','mailQueue:','./mailQueue.events','update'];(function(_0x2a7a0e,_0x217e41){var _0x3eaeaf=function(_0x125c2c){while(--_0x125c2c){_0x2a7a0e['push'](_0x2a7a0e['shift']());}};_0x3eaeaf(++_0x217e41);}(_0xc3fe,0x116));var _0xec3f=function(_0x3f0042,_0x28f8af){_0x3f0042=_0x3f0042-0x0;var _0x52554c=_0xc3fe[_0x3f0042];return _0x52554c;};'use strict';var MailQueueEvents=require(_0xec3f('0x0'));var events=['save','remove',_0xec3f('0x1')];function createListener(_0x507df8,_0xaaccee){return function(_0x228867){_0xaaccee[_0xec3f('0x2')](_0x507df8,_0x228867);};}function removeListener(_0x39dcce,_0x1b9f23){return function(){MailQueueEvents['removeListener'](_0x39dcce,_0x1b9f23);};}exports['register']=function(_0x378c6f){for(var _0x47ee64=0x0,_0x1ae7e8=events[_0xec3f('0x3')];_0x47ee64<_0x1ae7e8;_0x47ee64++){var _0xb78b2e=events[_0x47ee64];var _0x588130=createListener(_0xec3f('0x4')+_0xb78b2e,_0x378c6f);MailQueueEvents['on'](_0xb78b2e,_0x588130);}}; \ No newline at end of file +var _0x64c8=['removeListener','register','length','mailQueue:','save','remove','update','emit'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0x64c8,0x13c));var _0x864c=function(_0x5849af,_0x4f28c8){_0x5849af=_0x5849af-0x0;var _0x3ce263=_0x64c8[_0x5849af];return _0x3ce263;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x864c('0x0'),_0x864c('0x1'),_0x864c('0x2')];function createListener(_0x4b9dd4,_0x273185){return function(_0x14e936){_0x273185[_0x864c('0x3')](_0x4b9dd4,_0x14e936);};}function removeListener(_0xbb02,_0x225323){return function(){MailQueueEvents[_0x864c('0x4')](_0xbb02,_0x225323);};}exports[_0x864c('0x5')]=function(_0x1b110c){for(var _0x56ca20=0x0,_0x33ec0c=events[_0x864c('0x6')];_0x56ca20<_0x33ec0c;_0x56ca20++){var _0x4fbdfd=events[_0x56ca20];var _0x495ff5=createListener(_0x864c('0x7')+_0x4fbdfd,_0x1b110c);MailQueueEvents['on'](_0x4fbdfd,_0x495ff5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 1f17b2f..128ad1b 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 _0x68b9=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x564c46,_0xd7012){var _0x5a2ec7=function(_0x4191c5){while(--_0x4191c5){_0x564c46['push'](_0x564c46['shift']());}};_0x5a2ec7(++_0xd7012);}(_0x68b9,0x142));var _0x968b=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0x68b9[_0x1876b2];return _0x9fb1e0;};'use strict';var multer=require(_0x968b('0x0'));var util=require(_0x968b('0x1'));var path=require(_0x968b('0x2'));var timeout=require(_0x968b('0x3'));var express=require(_0x968b('0x4'));var router=express[_0x968b('0x5')]();var auth=require(_0x968b('0x6'));var interaction=require(_0x968b('0x7'));var config=require(_0x968b('0x8'));var controller=require(_0x968b('0x9'));router[_0x968b('0xa')]('/',auth[_0x968b('0xb')](),controller[_0x968b('0xc')]);router['get'](_0x968b('0xd'),auth[_0x968b('0xb')](),controller[_0x968b('0xe')]);router[_0x968b('0xa')](_0x968b('0xf'),auth['isAuthenticated'](),controller[_0x968b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x968b('0x11')]);router[_0x968b('0x12')](_0x968b('0xf'),auth[_0x968b('0xb')](),controller[_0x968b('0x13')]);router[_0x968b('0x14')](_0x968b('0xf'),auth[_0x968b('0xb')](),controller[_0x968b('0x15')]);module[_0x968b('0x16')]=router; \ No newline at end of file +var _0x601c=['destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x5b5817,_0x2e8f7f){var _0x4d60e9=function(_0x51f8ec){while(--_0x51f8ec){_0x5b5817['push'](_0x5b5817['shift']());}};_0x4d60e9(++_0x2e8f7f);}(_0x601c,0x11f));var _0xc601=function(_0x857c02,_0x3cc0b3){_0x857c02=_0x857c02-0x0;var _0x5bbbab=_0x601c[_0x857c02];return _0x5bbbab;};'use strict';var multer=require('multer');var util=require(_0xc601('0x0'));var path=require('path');var timeout=require(_0xc601('0x1'));var express=require(_0xc601('0x2'));var router=express[_0xc601('0x3')]();var auth=require(_0xc601('0x4'));var interaction=require(_0xc601('0x5'));var config=require(_0xc601('0x6'));var controller=require(_0xc601('0x7'));router[_0xc601('0x8')]('/',auth[_0xc601('0x9')](),controller['index']);router['get']('/describe',auth[_0xc601('0x9')](),controller[_0xc601('0xa')]);router[_0xc601('0x8')](_0xc601('0xb'),auth[_0xc601('0x9')](),controller['show']);router[_0xc601('0xc')]('/',auth[_0xc601('0x9')](),controller[_0xc601('0xd')]);router[_0xc601('0xe')](_0xc601('0xb'),auth['isAuthenticated'](),controller[_0xc601('0xf')]);router[_0xc601('0x10')](_0xc601('0xb'),auth[_0xc601('0x9')](),controller[_0xc601('0x11')]);module[_0xc601('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 71136d5..b40575b 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 _0xd45a=['sequelize','STRING','DATE','moment'];(function(_0x13b85f,_0x3ea073){var _0x5ed0c7=function(_0x2aaeb1){while(--_0x2aaeb1){_0x13b85f['push'](_0x13b85f['shift']());}};_0x5ed0c7(++_0x3ea073);}(_0xd45a,0x7f));var _0xad45=function(_0x43eb6c,_0x4991be){_0x43eb6c=_0x43eb6c-0x0;var _0x3d4113=_0xd45a[_0x43eb6c];return _0x3d4113;};'use strict';var moment=require(_0xad45('0x0'));var Sequelize=require(_0xad45('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xad45('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xad45('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xad45('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xad45('0x3')]},'reason':{'type':Sequelize[_0xad45('0x2')]}}; \ No newline at end of file +var _0x2ae3=['exports','STRING','DATE','moment','sequelize'];(function(_0x4934e3,_0x124098){var _0x86a0c3=function(_0x59da73){while(--_0x59da73){_0x4934e3['push'](_0x4934e3['shift']());}};_0x86a0c3(++_0x124098);}(_0x2ae3,0x6c));var _0x32ae=function(_0x3146e7,_0x1e5cda){_0x3146e7=_0x3146e7-0x0;var _0x440624=_0x2ae3[_0x3146e7];return _0x440624;};'use strict';var moment=require(_0x32ae('0x0'));var Sequelize=require(_0x32ae('0x1'));module[_0x32ae('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x32ae('0x3')]},'joinAt':{'type':Sequelize[_0x32ae('0x4')]},'leaveAt':{'type':Sequelize[_0x32ae('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x32ae('0x4')]},'reason':{'type':Sequelize[_0x32ae('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 6729257..fc04862 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 _0x749a=['key','keys','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','catch','show','params','MailQueueReport','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','type'];(function(_0x3422d3,_0x42d94d){var _0x42be94=function(_0x57ec9c){while(--_0x57ec9c){_0x3422d3['push'](_0x3422d3['shift']());}};_0x42be94(++_0x42d94d);}(_0x749a,0xbe));var _0xa749=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x749a[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0xa749('0x0'));var emlformat=require(_0xa749('0x1'));var rimraf=require(_0xa749('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa749('0x3'));var rp=require('request-promise');var moment=require(_0xa749('0x4'));var BPromise=require(_0xa749('0x5'));var Mustache=require(_0xa749('0x6'));var util=require(_0xa749('0x7'));var path=require('path');var sox=require(_0xa749('0x8'));var csv=require(_0xa749('0x9'));var ejs=require(_0xa749('0xa'));var fs=require('fs');var _=require(_0xa749('0xb'));var squel=require(_0xa749('0xc'));var crypto=require(_0xa749('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa749('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa749('0xf'));var Papa=require(_0xa749('0x10'));var Redis=require(_0xa749('0x11'));var authService=require(_0xa749('0x12'));var qs=require(_0xa749('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa749('0x14'));var logger=require(_0xa749('0x15'))(_0xa749('0x16'));var utils=require(_0xa749('0x17'));var config=require(_0xa749('0x18'));var db=require(_0xa749('0x19'))['db'];function respondWithStatusCode(_0x400db4,_0x45e3d9){_0x45e3d9=_0x45e3d9||0xcc;return function(_0x1a1379){if(_0x1a1379){return _0x400db4[_0xa749('0x1a')](_0x45e3d9);}return _0x400db4[_0xa749('0x1b')](_0x45e3d9)[_0xa749('0x1c')]();};}function respondWithResult(_0x3f9e30,_0x5eae34){_0x5eae34=_0x5eae34||0xc8;return function(_0x450f6d){if(_0x450f6d){return _0x3f9e30[_0xa749('0x1b')](_0x5eae34)[_0xa749('0x1d')](_0x450f6d);}};}function respondWithFilteredResult(_0x2cacaa,_0x2e46e7){return function(_0x3bcf79){if(_0x3bcf79){var _0x4fc2ff=_0x3bcf79['count'],_0xaf116c=_0x2e46e7[_0xa749('0x1e')],_0x274152=_0x2e46e7[_0xa749('0x1e')]+_0x2e46e7[_0xa749('0x1f')],_0x4935f3;if(_0x274152>=_0x4fc2ff){_0x274152=_0x4fc2ff;_0x4935f3=0xc8;}else{_0x4935f3=0xce;}_0x2cacaa[_0xa749('0x1b')](_0x4935f3);return _0x2cacaa[_0xa749('0x20')](_0xa749('0x21'),_0xaf116c+'-'+_0x274152+'/'+_0x4fc2ff)[_0xa749('0x1d')](_0x3bcf79);}return null;};}function patchUpdates(_0x367957){return function(_0x501893){try{jsonpatch[_0xa749('0x22')](_0x501893,_0x367957,!![]);}catch(_0x399d88){return BPromise[_0xa749('0x23')](_0x399d88);}return _0x501893[_0xa749('0x24')]();};}function saveUpdates(_0x474c60,_0x572237){return function(_0x2ee317){if(_0x2ee317){return _0x2ee317[_0xa749('0x25')](_0x474c60)[_0xa749('0x26')](function(_0x4b9244){return _0x4b9244;});}return null;};}function removeEntity(_0x1d2a8c,_0x444522){return function(_0x250ce1){if(_0x250ce1){return _0x250ce1[_0xa749('0x27')]()[_0xa749('0x26')](function(){_0x1d2a8c[_0xa749('0x1b')](0xcc)[_0xa749('0x1c')]();});}};}function handleEntityNotFound(_0x35b7dc,_0xc3e2e4){return function(_0x2b349a){if(!_0x2b349a){_0x35b7dc['sendStatus'](0x194);}return _0x2b349a;};}function handleError(_0x3d556f,_0x1c21f4){_0x1c21f4=_0x1c21f4||0x1f4;return function(_0x46c014){logger[_0xa749('0x28')](_0x46c014['stack']);if(_0x46c014[_0xa749('0x29')]){delete _0x46c014['name'];}_0x3d556f[_0xa749('0x1b')](_0x1c21f4)[_0xa749('0x2a')](_0x46c014);};}exports[_0xa749('0x2b')]=function(_0x1f5d67,_0x41c122){var _0xec7ad0={},_0x380192={},_0x355399={'count':0x0,'rows':[]};var _0x5e94f4=_[_0xa749('0x2c')](db['MailQueueReport']['rawAttributes'],function(_0x2f592d){return{'name':_0x2f592d[_0xa749('0x2d')],'type':_0x2f592d[_0xa749('0x2e')][_0xa749('0x2f')]};});_0x380192['model']=_[_0xa749('0x2c')](_0x5e94f4,_0xa749('0x29'));_0x380192['query']=_[_0xa749('0x30')](_0x1f5d67['query']);_0x380192['filters']=_[_0xa749('0x31')](_0x380192['model'],_0x380192[_0xa749('0x32')]);_0xec7ad0[_0xa749('0x33')]=_['intersection'](_0x380192[_0xa749('0x34')],qs[_0xa749('0x35')](_0x1f5d67[_0xa749('0x32')][_0xa749('0x35')]));_0xec7ad0[_0xa749('0x33')]=_0xec7ad0['attributes'][_0xa749('0x36')]?_0xec7ad0[_0xa749('0x33')]:_0x380192[_0xa749('0x34')];if(!_0x1f5d67[_0xa749('0x32')][_0xa749('0x37')](_0xa749('0x38'))){_0xec7ad0[_0xa749('0x1f')]=qs[_0xa749('0x1f')](_0x1f5d67['query'][_0xa749('0x1f')]);_0xec7ad0[_0xa749('0x1e')]=qs[_0xa749('0x1e')](_0x1f5d67[_0xa749('0x32')]['offset']);}_0xec7ad0[_0xa749('0x39')]=qs[_0xa749('0x3a')](_0x1f5d67[_0xa749('0x32')][_0xa749('0x3a')]);_0xec7ad0['where']=qs[_0xa749('0x3b')](_[_0xa749('0x3c')](_0x1f5d67[_0xa749('0x32')],_0x380192['filters']),_0x5e94f4);if(_0x1f5d67[_0xa749('0x32')][_0xa749('0x3d')]){_0xec7ad0[_0xa749('0x3e')]=_[_0xa749('0x3f')](_0xec7ad0['where'],{'$or':_['map'](_0x5e94f4,function(_0x3f5a09){if(_0x3f5a09['type']!=='VIRTUAL'){var _0x14e8fc={};_0x14e8fc[_0x3f5a09[_0xa749('0x29')]]={'$like':'%'+_0x1f5d67['query'][_0xa749('0x3d')]+'%'};return _0x14e8fc;}})});}_0xec7ad0=_[_0xa749('0x3f')]({},_0xec7ad0,_0x1f5d67[_0xa749('0x40')]);var _0x54a66b={'where':_0xec7ad0[_0xa749('0x3e')]};return db['MailQueueReport'][_0xa749('0x41')](_0x54a66b)[_0xa749('0x26')](function(_0x10ea69){_0x355399[_0xa749('0x41')]=_0x10ea69;if(_0x1f5d67[_0xa749('0x32')][_0xa749('0x42')]){_0xec7ad0[_0xa749('0x43')]=[{'all':!![]}];}return db['MailQueueReport'][_0xa749('0x44')](_0xec7ad0);})[_0xa749('0x26')](function(_0x364ae1){_0x355399[_0xa749('0x45')]=_0x364ae1;return _0x355399;})[_0xa749('0x26')](respondWithFilteredResult(_0x41c122,_0xec7ad0))[_0xa749('0x46')](handleError(_0x41c122,null));};exports[_0xa749('0x47')]=function(_0x2be992,_0x3dfb34){var _0x548e66={'raw':!![],'where':{'id':_0x2be992[_0xa749('0x48')]['id']}},_0x202cf1={};_0x202cf1[_0xa749('0x34')]=_[_0xa749('0x30')](db[_0xa749('0x49')][_0xa749('0x4a')]);_0x202cf1[_0xa749('0x32')]=_[_0xa749('0x30')](_0x2be992[_0xa749('0x32')]);_0x202cf1['filters']=_[_0xa749('0x31')](_0x202cf1['model'],_0x202cf1[_0xa749('0x32')]);_0x548e66[_0xa749('0x33')]=_[_0xa749('0x31')](_0x202cf1[_0xa749('0x34')],qs[_0xa749('0x35')](_0x2be992[_0xa749('0x32')]['fields']));_0x548e66[_0xa749('0x33')]=_0x548e66[_0xa749('0x33')][_0xa749('0x36')]?_0x548e66[_0xa749('0x33')]:_0x202cf1[_0xa749('0x34')];if(_0x2be992[_0xa749('0x32')]['includeAll']){_0x548e66[_0xa749('0x43')]=[{'all':!![]}];}_0x548e66=_[_0xa749('0x3f')]({},_0x548e66,_0x2be992['options']);return db[_0xa749('0x49')][_0xa749('0x4b')](_0x548e66)[_0xa749('0x26')](handleEntityNotFound(_0x3dfb34,null))[_0xa749('0x26')](respondWithResult(_0x3dfb34,null))[_0xa749('0x46')](handleError(_0x3dfb34,null));};exports[_0xa749('0x4c')]=function(_0x562410,_0x2180cd){return db['MailQueueReport'][_0xa749('0x4c')](_0x562410[_0xa749('0x4d')],{})[_0xa749('0x26')](respondWithResult(_0x2180cd,0xc9))['catch'](handleError(_0x2180cd,null));};exports[_0xa749('0x25')]=function(_0x2afb3c,_0x490861){if(_0x2afb3c[_0xa749('0x4d')]['id']){delete _0x2afb3c[_0xa749('0x4d')]['id'];}return db[_0xa749('0x49')][_0xa749('0x4b')]({'where':{'id':_0x2afb3c[_0xa749('0x48')]['id']}})[_0xa749('0x26')](handleEntityNotFound(_0x490861,null))[_0xa749('0x26')](saveUpdates(_0x2afb3c[_0xa749('0x4d')],null))[_0xa749('0x26')](respondWithResult(_0x490861,null))[_0xa749('0x46')](handleError(_0x490861,null));};exports['destroy']=function(_0xb3617e,_0x53dae9){return db[_0xa749('0x49')][_0xa749('0x4b')]({'where':{'id':_0xb3617e[_0xa749('0x48')]['id']}})[_0xa749('0x26')](handleEntityNotFound(_0x53dae9,null))[_0xa749('0x26')](removeEntity(_0x53dae9,null))[_0xa749('0x46')](handleError(_0x53dae9,null));};exports[_0xa749('0x4e')]=function(_0x464d09,_0x4f0baf){return db[_0xa749('0x49')][_0xa749('0x4e')]()['then'](respondWithResult(_0x4f0baf,null))[_0xa749('0x46')](handleError(_0x4f0baf,null));}; \ No newline at end of file +var _0x9438=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','then','destroy','end','name','send','index','map','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','MailQueueReport','includeAll','include','findAll','show','params','keys','options','find','catch','create','body','update','describe','html-pdf'];(function(_0x195224,_0x129ac3){var _0xc4a4c0=function(_0x1c1326){while(--_0x1c1326){_0x195224['push'](_0x195224['shift']());}};_0xc4a4c0(++_0x129ac3);}(_0x9438,0x8d));var _0x8943=function(_0x2f566f,_0x6bc94a){_0x2f566f=_0x2f566f-0x0;var _0x3f7fb0=_0x9438[_0x2f566f];return _0x3f7fb0;};'use strict';var pdf=require(_0x8943('0x0'));var emlformat=require(_0x8943('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8943('0x2'));var jsonpatch=require(_0x8943('0x3'));var rp=require('request-promise');var moment=require(_0x8943('0x4'));var BPromise=require(_0x8943('0x5'));var Mustache=require(_0x8943('0x6'));var util=require(_0x8943('0x7'));var path=require(_0x8943('0x8'));var sox=require('sox');var csv=require(_0x8943('0x9'));var ejs=require(_0x8943('0xa'));var fs=require('fs');var _=require(_0x8943('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8943('0xc'));var deskjs=require(_0x8943('0xd'));var toCsv=require(_0x8943('0x9'));var querystring=require(_0x8943('0xe'));var Papa=require(_0x8943('0xf'));var Redis=require(_0x8943('0x10'));var authService=require(_0x8943('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8943('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8943('0x13'))(_0x8943('0x14'));var utils=require('../../config/utils');var config=require(_0x8943('0x15'));var db=require(_0x8943('0x16'))['db'];function respondWithStatusCode(_0x585dec,_0x38c7c6){_0x38c7c6=_0x38c7c6||0xcc;return function(_0x4e97b6){if(_0x4e97b6){return _0x585dec[_0x8943('0x17')](_0x38c7c6);}return _0x585dec['status'](_0x38c7c6)['end']();};}function respondWithResult(_0x2851ae,_0x573b27){_0x573b27=_0x573b27||0xc8;return function(_0x1d406d){if(_0x1d406d){return _0x2851ae[_0x8943('0x18')](_0x573b27)[_0x8943('0x19')](_0x1d406d);}};}function respondWithFilteredResult(_0x2846e0,_0x48a182){return function(_0x1fc5f4){if(_0x1fc5f4){var _0x2bb699=_0x1fc5f4[_0x8943('0x1a')],_0x1123b3=_0x48a182[_0x8943('0x1b')],_0x28baaa=_0x48a182[_0x8943('0x1b')]+_0x48a182['limit'],_0x17cc55;if(_0x28baaa>=_0x2bb699){_0x28baaa=_0x2bb699;_0x17cc55=0xc8;}else{_0x17cc55=0xce;}_0x2846e0[_0x8943('0x18')](_0x17cc55);return _0x2846e0[_0x8943('0x1c')]('Content-Range',_0x1123b3+'-'+_0x28baaa+'/'+_0x2bb699)[_0x8943('0x19')](_0x1fc5f4);}return null;};}function patchUpdates(_0x4a4396){return function(_0x174f55){try{jsonpatch[_0x8943('0x1d')](_0x174f55,_0x4a4396,!![]);}catch(_0x271f45){return BPromise[_0x8943('0x1e')](_0x271f45);}return _0x174f55[_0x8943('0x1f')]();};}function saveUpdates(_0x43b957,_0x57ca0b){return function(_0x22793b){if(_0x22793b){return _0x22793b['update'](_0x43b957)[_0x8943('0x20')](function(_0x1cb2b4){return _0x1cb2b4;});}return null;};}function removeEntity(_0xbc3dcc,_0x3ed907){return function(_0x15b5e6){if(_0x15b5e6){return _0x15b5e6[_0x8943('0x21')]()[_0x8943('0x20')](function(){_0xbc3dcc[_0x8943('0x18')](0xcc)[_0x8943('0x22')]();});}};}function handleEntityNotFound(_0xf08de2,_0xfbb66c){return function(_0x160463){if(!_0x160463){_0xf08de2[_0x8943('0x17')](0x194);}return _0x160463;};}function handleError(_0x824646,_0x3ec561){_0x3ec561=_0x3ec561||0x1f4;return function(_0x224701){logger['error'](_0x224701['stack']);if(_0x224701[_0x8943('0x23')]){delete _0x224701[_0x8943('0x23')];}_0x824646[_0x8943('0x18')](_0x3ec561)[_0x8943('0x24')](_0x224701);};}exports[_0x8943('0x25')]=function(_0x44dc55,_0x19eca5){var _0x13b4c2={},_0x30d92f={},_0x41ad7e={'count':0x0,'rows':[]};var _0x1f5963=_[_0x8943('0x26')](db['MailQueueReport']['rawAttributes'],function(_0x19f42a){return{'name':_0x19f42a[_0x8943('0x27')],'type':_0x19f42a[_0x8943('0x28')]['key']};});_0x30d92f[_0x8943('0x29')]=_[_0x8943('0x26')](_0x1f5963,_0x8943('0x23'));_0x30d92f[_0x8943('0x2a')]=_['keys'](_0x44dc55[_0x8943('0x2a')]);_0x30d92f[_0x8943('0x2b')]=_[_0x8943('0x2c')](_0x30d92f[_0x8943('0x29')],_0x30d92f[_0x8943('0x2a')]);_0x13b4c2['attributes']=_[_0x8943('0x2c')](_0x30d92f[_0x8943('0x29')],qs['fields'](_0x44dc55['query'][_0x8943('0x2d')]));_0x13b4c2[_0x8943('0x2e')]=_0x13b4c2[_0x8943('0x2e')][_0x8943('0x2f')]?_0x13b4c2[_0x8943('0x2e')]:_0x30d92f['model'];if(!_0x44dc55[_0x8943('0x2a')]['hasOwnProperty'](_0x8943('0x30'))){_0x13b4c2[_0x8943('0x31')]=qs['limit'](_0x44dc55[_0x8943('0x2a')]['limit']);_0x13b4c2[_0x8943('0x1b')]=qs['offset'](_0x44dc55[_0x8943('0x2a')]['offset']);}_0x13b4c2[_0x8943('0x32')]=qs['sort'](_0x44dc55[_0x8943('0x2a')][_0x8943('0x33')]);_0x13b4c2[_0x8943('0x34')]=qs[_0x8943('0x2b')](_[_0x8943('0x35')](_0x44dc55[_0x8943('0x2a')],_0x30d92f[_0x8943('0x2b')]),_0x1f5963);if(_0x44dc55[_0x8943('0x2a')][_0x8943('0x36')]){_0x13b4c2[_0x8943('0x34')]=_[_0x8943('0x37')](_0x13b4c2['where'],{'$or':_['map'](_0x1f5963,function(_0x18d996){if(_0x18d996[_0x8943('0x28')]!==_0x8943('0x38')){var _0x28cd5b={};_0x28cd5b[_0x18d996[_0x8943('0x23')]]={'$like':'%'+_0x44dc55[_0x8943('0x2a')][_0x8943('0x36')]+'%'};return _0x28cd5b;}})});}_0x13b4c2=_[_0x8943('0x37')]({},_0x13b4c2,_0x44dc55['options']);var _0x56a4da={'where':_0x13b4c2[_0x8943('0x34')]};return db[_0x8943('0x39')][_0x8943('0x1a')](_0x56a4da)[_0x8943('0x20')](function(_0x56e4b5){_0x41ad7e[_0x8943('0x1a')]=_0x56e4b5;if(_0x44dc55[_0x8943('0x2a')][_0x8943('0x3a')]){_0x13b4c2[_0x8943('0x3b')]=[{'all':!![]}];}return db['MailQueueReport'][_0x8943('0x3c')](_0x13b4c2);})[_0x8943('0x20')](function(_0x3f4410){_0x41ad7e['rows']=_0x3f4410;return _0x41ad7e;})[_0x8943('0x20')](respondWithFilteredResult(_0x19eca5,_0x13b4c2))['catch'](handleError(_0x19eca5,null));};exports[_0x8943('0x3d')]=function(_0x1d5997,_0x5b91e7){var _0x39d480={'raw':!![],'where':{'id':_0x1d5997[_0x8943('0x3e')]['id']}},_0x5c494a={};_0x5c494a[_0x8943('0x29')]=_[_0x8943('0x3f')](db[_0x8943('0x39')]['rawAttributes']);_0x5c494a[_0x8943('0x2a')]=_[_0x8943('0x3f')](_0x1d5997['query']);_0x5c494a['filters']=_[_0x8943('0x2c')](_0x5c494a[_0x8943('0x29')],_0x5c494a[_0x8943('0x2a')]);_0x39d480['attributes']=_[_0x8943('0x2c')](_0x5c494a[_0x8943('0x29')],qs[_0x8943('0x2d')](_0x1d5997[_0x8943('0x2a')][_0x8943('0x2d')]));_0x39d480[_0x8943('0x2e')]=_0x39d480['attributes'][_0x8943('0x2f')]?_0x39d480[_0x8943('0x2e')]:_0x5c494a[_0x8943('0x29')];if(_0x1d5997[_0x8943('0x2a')][_0x8943('0x3a')]){_0x39d480[_0x8943('0x3b')]=[{'all':!![]}];}_0x39d480=_[_0x8943('0x37')]({},_0x39d480,_0x1d5997[_0x8943('0x40')]);return db[_0x8943('0x39')][_0x8943('0x41')](_0x39d480)['then'](handleEntityNotFound(_0x5b91e7,null))[_0x8943('0x20')](respondWithResult(_0x5b91e7,null))[_0x8943('0x42')](handleError(_0x5b91e7,null));};exports[_0x8943('0x43')]=function(_0x1d432f,_0x31d515){return db[_0x8943('0x39')][_0x8943('0x43')](_0x1d432f[_0x8943('0x44')],{})[_0x8943('0x20')](respondWithResult(_0x31d515,0xc9))[_0x8943('0x42')](handleError(_0x31d515,null));};exports[_0x8943('0x45')]=function(_0x336576,_0x860956){if(_0x336576[_0x8943('0x44')]['id']){delete _0x336576[_0x8943('0x44')]['id'];}return db[_0x8943('0x39')]['find']({'where':{'id':_0x336576['params']['id']}})[_0x8943('0x20')](handleEntityNotFound(_0x860956,null))['then'](saveUpdates(_0x336576['body'],null))[_0x8943('0x20')](respondWithResult(_0x860956,null))[_0x8943('0x42')](handleError(_0x860956,null));};exports['destroy']=function(_0x5bd0a0,_0x328b6e){return db[_0x8943('0x39')]['find']({'where':{'id':_0x5bd0a0[_0x8943('0x3e')]['id']}})['then'](handleEntityNotFound(_0x328b6e,null))[_0x8943('0x20')](removeEntity(_0x328b6e,null))[_0x8943('0x42')](handleError(_0x328b6e,null));};exports['describe']=function(_0x2fa949,_0x4567e1){return db[_0x8943('0x39')][_0x8943('0x46')]()[_0x8943('0x20')](respondWithResult(_0x4567e1,null))[_0x8943('0x42')](handleError(_0x4567e1,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 70b43ca..e6c80d0 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 _0xcc20=['exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xcc20,0x108));var _0x0cc2=function(_0x2deb38,_0xe86ff8){_0x2deb38=_0x2deb38-0x0;var _0x560599=_0xcc20[_0x2deb38];return _0x560599;};'use strict';var _=require(_0x0cc2('0x0'));var util=require(_0x0cc2('0x1'));var logger=require('../../config/logger')(_0x0cc2('0x2'));var moment=require(_0x0cc2('0x3'));var BPromise=require(_0x0cc2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cc2('0x5'));var rimraf=require(_0x0cc2('0x6'));var config=require(_0x0cc2('0x7'));var attributes=require(_0x0cc2('0x8'));module[_0x0cc2('0x9')]=function(_0x5bdc26,_0x142802){return _0x5bdc26['define'](_0x0cc2('0xa'),attributes,{'tableName':_0x0cc2('0xb'),'paranoid':![],'indexes':[{'name':_0x0cc2('0xc'),'fields':[_0x0cc2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38ca=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','report_mail_queue','uniqueid'];(function(_0x5a25b3,_0x2ea39f){var _0x5e5938=function(_0x10853e){while(--_0x10853e){_0x5a25b3['push'](_0x5a25b3['shift']());}};_0x5e5938(++_0x2ea39f);}(_0x38ca,0xb0));var _0xa38c=function(_0x4e82eb,_0x48201a){_0x4e82eb=_0x4e82eb-0x0;var _0x312271=_0x38ca[_0x4e82eb];return _0x312271;};'use strict';var _=require(_0xa38c('0x0'));var util=require('util');var logger=require(_0xa38c('0x1'))(_0xa38c('0x2'));var moment=require(_0xa38c('0x3'));var BPromise=require(_0xa38c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa38c('0x5'));var rimraf=require(_0xa38c('0x6'));var config=require(_0xa38c('0x7'));var attributes=require(_0xa38c('0x8'));module['exports']=function(_0xe4cde2,_0x4487ef){return _0xe4cde2['define']('MailQueueReport',attributes,{'tableName':_0xa38c('0x9'),'paranoid':![],'indexes':[{'name':_0xa38c('0xa'),'fields':[_0xa38c('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 6c64c62..1f9b2a3 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x87a98a,_0x4a2144){var _0x45b7cd=function(_0x3f779a){while(--_0x3f779a){_0x87a98a['push'](_0x87a98a['shift']());}};_0x45b7cd(++_0x4a2144);}(_0xadb5,0xad));var _0x5adb=function(_0x22015e,_0x4513a4){_0x22015e=_0x22015e-0x0;var _0x393ee4=_0xadb5[_0x22015e];return _0x393ee4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x781d=['request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5271b1,_0x184f54){var _0x5c460d=function(_0x49ed66){while(--_0x49ed66){_0x5271b1['push'](_0x5271b1['shift']());}};_0x5c460d(++_0x184f54);}(_0x781d,0x14a));var _0xd781=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x781d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['CreateMailQueueReport']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')](_0x1407fc[_0xd781('0x19')],{'raw':_0x1407fc[_0xd781('0x1a')]?_0x1407fc['options'][_0xd781('0x1b')]===undefined?!![]:![]:!![]})[_0xd781('0xc')](function(_0x1036d3){logger[_0xd781('0xd')](_0xd781('0x1c'),_0x1407fc);logger[_0xd781('0xf')](_0xd781('0x1c'),_0x1407fc,JSON['stringify'](_0x1036d3));_0x395d9c(_0x1036d3);})[_0xd781('0x16')](function(_0x4e2c56){logger['error'](_0xd781('0x1c'),_0x4e2c56['message'],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x4e2c56[_0xd781('0x13')]));});});};exports[_0xd781('0x1d')]=function(_0x31bf57){var _0x391461=this;return new Promise(function(_0x28f4fe,_0x221f14){return db[_0xd781('0x17')][_0xd781('0x1e')](_0x31bf57['body'],{'raw':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31bf57[_0xd781('0x1a')]?_0x31bf57['options'][_0xd781('0x1f')]||null:null,'attributes':_0x31bf57['options']?_0x31bf57['options'][_0xd781('0x20')]||null:null,'limit':_0x31bf57['options']?_0x31bf57[_0xd781('0x1a')][_0xd781('0x21')]||null:null})['then'](function(_0x5b6b9d){logger[_0xd781('0xd')]('UpdateMailQueueReport',_0x31bf57);logger[_0xd781('0xf')]('UpdateMailQueueReport',_0x31bf57,JSON[_0xd781('0x22')](_0x5b6b9d));_0x28f4fe(_0x5b6b9d);})[_0xd781('0x16')](function(_0x556127){logger['error'](_0xd781('0x1d'),_0x556127[_0xd781('0x13')],_0x31bf57);_0x221f14(_0x391461[_0xd781('0x11')](0x1f4,_0x556127['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 6f1694a..f3b66fc 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 _0xed98=['util','../../components/auth/service','../../config/environment','exports'];(function(_0x3c8d6c,_0x51ae3a){var _0x146521=function(_0x4cd1ed){while(--_0x4cd1ed){_0x3c8d6c['push'](_0x3c8d6c['shift']());}};_0x146521(++_0x51ae3a);}(_0xed98,0xb4));var _0x8ed9=function(_0x268c14,_0x2ed2a3){_0x268c14=_0x268c14-0x0;var _0x498731=_0xed98[_0x268c14];return _0x498731;};'use strict';var multer=require('multer');var util=require(_0x8ed9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8ed9('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x8ed9('0x2'));module[_0x8ed9('0x3')]=router; \ No newline at end of file +var _0x1a2b=['Router','../../components/interaction/service','../../config/environment','exports','multer','connect-timeout','express'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x1a2b,0xa5));var _0xb1a2=function(_0x2584bc,_0x35d9f5){_0x2584bc=_0x2584bc-0x0;var _0x405f2c=_0x1a2b[_0x2584bc];return _0x405f2c;};'use strict';var multer=require(_0xb1a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb1a2('0x1'));var express=require(_0xb1a2('0x2'));var router=express[_0xb1a2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb1a2('0x4'));var config=require(_0xb1a2('0x5'));module[_0xb1a2('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 51a360b..cf25182 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 _0xf1ba=['username','INTEGER','INBOX','sequelize','exports','BOOLEAN','STRING'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf1ba,0x1ed));var _0xaf1b=function(_0x2cb92,_0x32adc8){_0x2cb92=_0x2cb92-0x0;var _0x37b20f=_0xf1ba[_0x2cb92];return _0x37b20f;};'use strict';var Sequelize=require(_0xaf1b('0x0'));module[_0xaf1b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xaf1b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xaf1b('0x3')],'unique':_0xaf1b('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xaf1b('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xaf1b('0x6')},'connTimeout':{'type':Sequelize[_0xaf1b('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaf1b('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xaf1b('0x3')]}}; \ No newline at end of file +var _0x1e2a=['INTEGER','INBOX','sequelize','STRING','BOOLEAN','username'];(function(_0x2a5160,_0x5f068d){var _0x2b42c5=function(_0x350590){while(--_0x350590){_0x2a5160['push'](_0x2a5160['shift']());}};_0x2b42c5(++_0x5f068d);}(_0x1e2a,0x188));var _0xa1e2=function(_0x14a049,_0x1886e0){_0x14a049=_0x14a049-0x0;var _0x396605=_0x1e2a[_0x14a049];return _0x396605;};'use strict';var Sequelize=require(_0xa1e2('0x0'));module['exports']={'description':{'type':Sequelize[_0xa1e2('0x1')]},'host':{'type':Sequelize[_0xa1e2('0x1')]},'authentication':{'type':Sequelize[_0xa1e2('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0xa1e2('0x3')},'password':{'type':Sequelize[_0xa1e2('0x1')]},'port':{'type':Sequelize[_0xa1e2('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xa1e2('0x1')],'defaultValue':_0xa1e2('0x5')},'connTimeout':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa1e2('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c0a6cca..13bb7f6 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 _0xae60=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x3929e1,_0x53fa82){var _0x80cc2f=function(_0x564d79){while(--_0x564d79){_0x3929e1['push'](_0x3929e1['shift']());}};_0x80cc2f(++_0x53fa82);}(_0xae60,0x1c7));var _0x0ae6=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xae60[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var logger=require(_0x0ae6('0x2'))('api');var moment=require(_0x0ae6('0x3'));var BPromise=require(_0x0ae6('0x4'));var rp=require(_0x0ae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var attributes=require('./mailServerIn.attributes');module[_0x0ae6('0x8')]=function(_0x25ac7c,_0x30e000){return _0x25ac7c[_0x0ae6('0x9')](_0x0ae6('0xa'),attributes,{'tableName':_0x0ae6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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(_0x4ed8d4,_0x4d8e44){_0x4ed8d4=_0x4ed8d4-0x0;var _0x3cbf02=_0xd523[_0x4ed8d4];return _0x3cbf02;};'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 diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 2f24d49..2a7873e 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 _0xe32e=['limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn','findAll','raw','options','where','attributes'];(function(_0x2ed4f4,_0x56f24f){var _0x58f9a0=function(_0x2519c9){while(--_0x2519c9){_0x2ed4f4['push'](_0x2ed4f4['shift']());}};_0x58f9a0(++_0x56f24f);}(_0xe32e,0x84));var _0xee32=function(_0x21f716,_0x869f33){_0x21f716=_0x21f716-0x0;var _0x416577=_0xe32e[_0x21f716];return _0x416577;};'use strict';var _=require(_0xee32('0x0'));var util=require('util');var moment=require(_0xee32('0x1'));var BPromise=require(_0xee32('0x2'));var rs=require(_0xee32('0x3'));var fs=require('fs');var Redis=require(_0xee32('0x4'));var db=require(_0xee32('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xee32('0x6'));var config=require(_0xee32('0x7'));var jayson=require(_0xee32('0x8'));var client=jayson[_0xee32('0x9')][_0xee32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x594bb3,_0x516eb1,_0x5da266){return new BPromise(function(_0x50786f,_0x5d0804){return client[_0xee32('0xb')](_0x594bb3,_0x5da266)[_0xee32('0xc')](function(_0x2cfa02){logger[_0xee32('0xd')](_0xee32('0xe'),_0x516eb1,_0xee32('0xf'));logger[_0xee32('0x10')](_0xee32('0x11'),_0x516eb1,_0xee32('0xf'),JSON[_0xee32('0x12')](_0x2cfa02));if(_0x2cfa02[_0xee32('0x13')]){if(_0x2cfa02[_0xee32('0x13')]['code']===0x1f4){logger[_0xee32('0x13')](_0xee32('0xe'),_0x516eb1,_0x2cfa02['error'][_0xee32('0x14')]);return _0x5d0804(_0x2cfa02[_0xee32('0x13')][_0xee32('0x14')]);}logger[_0xee32('0x13')](_0xee32('0xe'),_0x516eb1,_0x2cfa02[_0xee32('0x13')][_0xee32('0x14')]);return _0x50786f(_0x2cfa02[_0xee32('0x13')][_0xee32('0x14')]);}else{logger[_0xee32('0xd')](_0xee32('0xe'),_0x516eb1,'request\x20sent');_0x50786f(_0x2cfa02['result'][_0xee32('0x14')]);}})[_0xee32('0x15')](function(_0x4e0376){logger['error'](_0xee32('0xe'),_0x516eb1,_0x4e0376);_0x5d0804(_0x4e0376);});});}exports[_0xee32('0x16')]=function(_0x1ca480){var _0x52a0e6=this;return new Promise(function(_0x132030,_0x3d13aa){return db['MailServerIn'][_0xee32('0x17')]({'raw':_0x1ca480['options']?_0x1ca480['options'][_0xee32('0x18')]===undefined?!![]:![]:!![],'where':_0x1ca480[_0xee32('0x19')]?_0x1ca480['options'][_0xee32('0x1a')]||null:null,'attributes':_0x1ca480[_0xee32('0x19')]?_0x1ca480[_0xee32('0x19')][_0xee32('0x1b')]||null:null,'limit':_0x1ca480[_0xee32('0x19')]?_0x1ca480[_0xee32('0x19')][_0xee32('0x1c')]||null:null,'include':_0x1ca480['options']?_0x1ca480['options'][_0xee32('0x1d')]?_[_0xee32('0x1e')](_0x1ca480[_0xee32('0x19')]['include'],function(_0x5e4512){return{'model':db[_0x5e4512[_0xee32('0x1f')]],'as':_0x5e4512['as'],'attributes':_0x5e4512[_0xee32('0x1b')],'include':_0x5e4512[_0xee32('0x1d')]?_[_0xee32('0x1e')](_0x5e4512[_0xee32('0x1d')],function(_0xaa4977){return{'model':db[_0xaa4977[_0xee32('0x1f')]],'as':_0xaa4977['as'],'attributes':_0xaa4977['attributes'],'include':_0xaa4977[_0xee32('0x1d')]?_[_0xee32('0x1e')](_0xaa4977['include'],function(_0x2e753b){return{'model':db[_0x2e753b[_0xee32('0x1f')]],'as':_0x2e753b['as'],'attributes':_0x2e753b[_0xee32('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xee32('0xc')](function(_0x19661a){logger['info'](_0xee32('0x16'),_0x1ca480);logger[_0xee32('0x10')](_0xee32('0x16'),_0x1ca480,JSON[_0xee32('0x12')](_0x19661a));_0x132030(_0x19661a);})[_0xee32('0x15')](function(_0x68bc4){logger['error'](_0xee32('0x16'),_0x68bc4[_0xee32('0x14')],_0x1ca480);_0x3d13aa(_0x52a0e6[_0xee32('0x13')](0x1f4,_0x68bc4[_0xee32('0x14')]));});});}; \ No newline at end of file +var _0x54b7=['raw','where','limit','include','map','model','attributes','GetMailServerIn','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','MailServerIn,\x20%s,\x20%s','message','info','result','MailServerIn','findAll','options'];(function(_0x485b01,_0x513b86){var _0x56388b=function(_0x5906e6){while(--_0x5906e6){_0x485b01['push'](_0x485b01['shift']());}};_0x56388b(++_0x513b86);}(_0x54b7,0xe1));var _0x754b=function(_0x4a0f87,_0x448d44){_0x4a0f87=_0x4a0f87-0x0;var _0x1b2544=_0x54b7[_0x4a0f87];return _0x1b2544;};'use strict';var _=require(_0x754b('0x0'));var util=require(_0x754b('0x1'));var moment=require(_0x754b('0x2'));var BPromise=require(_0x754b('0x3'));var rs=require(_0x754b('0x4'));var fs=require('fs');var Redis=require(_0x754b('0x5'));var db=require(_0x754b('0x6'))['db'];var utils=require(_0x754b('0x7'));var logger=require(_0x754b('0x8'))(_0x754b('0x9'));var config=require(_0x754b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x754b('0xb')][_0x754b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29bbb6,_0x131543,_0x580a70){return new BPromise(function(_0x17d599,_0x26a181){return client[_0x754b('0xd')](_0x29bbb6,_0x580a70)[_0x754b('0xe')](function(_0x87622){logger['info']('MailServerIn,\x20%s,\x20%s',_0x131543,_0x754b('0xf'));logger[_0x754b('0x10')](_0x754b('0x11'),_0x131543,_0x754b('0xf'),JSON[_0x754b('0x12')](_0x87622));if(_0x87622[_0x754b('0x13')]){if(_0x87622[_0x754b('0x13')]['code']===0x1f4){logger[_0x754b('0x13')](_0x754b('0x14'),_0x131543,_0x87622[_0x754b('0x13')][_0x754b('0x15')]);return _0x26a181(_0x87622[_0x754b('0x13')][_0x754b('0x15')]);}logger[_0x754b('0x13')]('MailServerIn,\x20%s,\x20%s',_0x131543,_0x87622['error'][_0x754b('0x15')]);return _0x17d599(_0x87622[_0x754b('0x13')][_0x754b('0x15')]);}else{logger[_0x754b('0x16')](_0x754b('0x14'),_0x131543,_0x754b('0xf'));_0x17d599(_0x87622[_0x754b('0x17')]['message']);}})['catch'](function(_0x5025b5){logger[_0x754b('0x13')](_0x754b('0x14'),_0x131543,_0x5025b5);_0x26a181(_0x5025b5);});});}exports['GetMailServerIn']=function(_0x13e96c){var _0x27b9f7=this;return new Promise(function(_0x192e0b,_0x8831dc){return db[_0x754b('0x18')][_0x754b('0x19')]({'raw':_0x13e96c[_0x754b('0x1a')]?_0x13e96c['options'][_0x754b('0x1b')]===undefined?!![]:![]:!![],'where':_0x13e96c[_0x754b('0x1a')]?_0x13e96c[_0x754b('0x1a')][_0x754b('0x1c')]||null:null,'attributes':_0x13e96c[_0x754b('0x1a')]?_0x13e96c[_0x754b('0x1a')]['attributes']||null:null,'limit':_0x13e96c[_0x754b('0x1a')]?_0x13e96c['options'][_0x754b('0x1d')]||null:null,'include':_0x13e96c[_0x754b('0x1a')]?_0x13e96c['options'][_0x754b('0x1e')]?_[_0x754b('0x1f')](_0x13e96c[_0x754b('0x1a')]['include'],function(_0x4dbd42){return{'model':db[_0x4dbd42[_0x754b('0x20')]],'as':_0x4dbd42['as'],'attributes':_0x4dbd42[_0x754b('0x21')],'include':_0x4dbd42['include']?_[_0x754b('0x1f')](_0x4dbd42[_0x754b('0x1e')],function(_0x5a7a8d){return{'model':db[_0x5a7a8d['model']],'as':_0x5a7a8d['as'],'attributes':_0x5a7a8d[_0x754b('0x21')],'include':_0x5a7a8d['include']?_[_0x754b('0x1f')](_0x5a7a8d[_0x754b('0x1e')],function(_0x3bd49e){return{'model':db[_0x3bd49e[_0x754b('0x20')]],'as':_0x3bd49e['as'],'attributes':_0x3bd49e[_0x754b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x754b('0xe')](function(_0x4bca32){logger[_0x754b('0x16')](_0x754b('0x22'),_0x13e96c);logger[_0x754b('0x10')](_0x754b('0x22'),_0x13e96c,JSON[_0x754b('0x12')](_0x4bca32));_0x192e0b(_0x4bca32);})[_0x754b('0x23')](function(_0x14f538){logger[_0x754b('0x13')]('GetMailServerIn',_0x14f538[_0x754b('0x15')],_0x13e96c);_0x8831dc(_0x27b9f7['error'](0x1f4,_0x14f538[_0x754b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c92fe48..9f4f522 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 _0x4fe9=['create','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post'];(function(_0x109001,_0x4d19c7){var _0x4f3e91=function(_0x199b8e){while(--_0x199b8e){_0x109001['push'](_0x109001['shift']());}};_0x4f3e91(++_0x4d19c7);}(_0x4fe9,0x1e4));var _0x94fe=function(_0x194650,_0x234632){_0x194650=_0x194650-0x0;var _0x1aa406=_0x4fe9[_0x194650];return _0x1aa406;};'use strict';var multer=require(_0x94fe('0x0'));var util=require(_0x94fe('0x1'));var path=require(_0x94fe('0x2'));var timeout=require(_0x94fe('0x3'));var express=require('express');var router=express[_0x94fe('0x4')]();var auth=require(_0x94fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x94fe('0x6'));var controller=require('./mailServerOut.controller');router[_0x94fe('0x7')]('/',auth[_0x94fe('0x8')](),controller['index']);router[_0x94fe('0x7')]('/:id',auth[_0x94fe('0x8')](),controller[_0x94fe('0x9')]);router[_0x94fe('0xa')]('/',auth[_0x94fe('0x8')](),controller[_0x94fe('0xb')]);router['put'](_0x94fe('0xc'),auth['isAuthenticated'](),controller[_0x94fe('0xd')]);router[_0x94fe('0xe')](_0x94fe('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x420f=['create','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x5cb2a3,_0x3ad870){var _0x17c539=function(_0x1462d3){while(--_0x1462d3){_0x5cb2a3['push'](_0x5cb2a3['shift']());}};_0x17c539(++_0x3ad870);}(_0x420f,0xa5));var _0xf420=function(_0x2f0971,_0x14a986){_0x2f0971=_0x2f0971-0x0;var _0x3cb533=_0x420f[_0x2f0971];return _0x3cb533;};'use strict';var multer=require(_0xf420('0x0'));var util=require('util');var path=require(_0xf420('0x1'));var timeout=require(_0xf420('0x2'));var express=require(_0xf420('0x3'));var router=express[_0xf420('0x4')]();var auth=require(_0xf420('0x5'));var interaction=require(_0xf420('0x6'));var config=require(_0xf420('0x7'));var controller=require(_0xf420('0x8'));router['get']('/',auth[_0xf420('0x9')](),controller[_0xf420('0xa')]);router[_0xf420('0xb')](_0xf420('0xc'),auth[_0xf420('0x9')](),controller[_0xf420('0xd')]);router[_0xf420('0xe')]('/',auth[_0xf420('0x9')](),controller[_0xf420('0xf')]);router['put']('/:id',auth[_0xf420('0x9')](),controller['update']);router[_0xf420('0x10')](_0xf420('0xc'),auth[_0xf420('0x9')](),controller[_0xf420('0x11')]);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 6e10c0d..17c7a7c 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 _0xcf71=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x32333f,_0x39d253){var _0x2bf86d=function(_0x3438ba){while(--_0x3438ba){_0x32333f['push'](_0x32333f['shift']());}};_0x2bf86d(++_0x39d253);}(_0xcf71,0xba));var _0x1cf7=function(_0x49fb87,_0x5d65bb){_0x49fb87=_0x49fb87-0x0;var _0x17db71=_0xcf71[_0x49fb87];return _0x17db71;};'use strict';var Sequelize=require(_0x1cf7('0x0'));module[_0x1cf7('0x1')]={'description':{'type':Sequelize[_0x1cf7('0x2')]},'host':{'type':Sequelize[_0x1cf7('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1cf7('0x2')]},'port':{'type':Sequelize[_0x1cf7('0x3')]},'secure':{'type':Sequelize[_0x1cf7('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x1cf7('0x2')]},'authentication':{'type':Sequelize[_0x1cf7('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x49e5=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x2ff238,_0x1811d2){var _0x204a56=function(_0x5bf2e1){while(--_0x5bf2e1){_0x2ff238['push'](_0x2ff238['shift']());}};_0x204a56(++_0x1811d2);}(_0x49e5,0x71));var _0x549e=function(_0x229745,_0x170522){_0x229745=_0x229745-0x0;var _0x25e7f7=_0x49e5[_0x229745];return _0x25e7f7;};'use strict';var Sequelize=require(_0x549e('0x0'));module[_0x549e('0x1')]={'description':{'type':Sequelize[_0x549e('0x2')]},'host':{'type':Sequelize[_0x549e('0x2')]},'user':{'type':Sequelize[_0x549e('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x549e('0x3')]},'secure':{'type':Sequelize[_0x549e('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x549e('0x2')]},'authentication':{'type':Sequelize[_0x549e('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d9edba7..9c9b86a 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 _0x887b=['then','destroy','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update'];(function(_0x6b5efb,_0x5391cc){var _0x22962a=function(_0x49474e){while(--_0x49474e){_0x6b5efb['push'](_0x6b5efb['shift']());}};_0x22962a(++_0x5391cc);}(_0x887b,0x185));var _0xb887=function(_0x152628,_0x51c835){_0x152628=_0x152628-0x0;var _0x51ebb4=_0x887b[_0x152628];return _0x51ebb4;};'use strict';var pdf=require(_0xb887('0x0'));var emlformat=require(_0xb887('0x1'));var rimraf=require(_0xb887('0x2'));var zipdir=require(_0xb887('0x3'));var jsonpatch=require(_0xb887('0x4'));var rp=require(_0xb887('0x5'));var moment=require(_0xb887('0x6'));var BPromise=require(_0xb887('0x7'));var Mustache=require(_0xb887('0x8'));var util=require('util');var path=require(_0xb887('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb887('0xa'));var squel=require(_0xb887('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb887('0xc'));var toCsv=require(_0xb887('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb887('0xe'));var qs=require(_0xb887('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb887('0x10'));var logger=require('../../config/logger')(_0xb887('0x11'));var utils=require(_0xb887('0x12'));var config=require(_0xb887('0x13'));var db=require(_0xb887('0x14'))['db'];function respondWithStatusCode(_0x4a028f,_0x582f11){_0x582f11=_0x582f11||0xcc;return function(_0x2380d2){if(_0x2380d2){return _0x4a028f[_0xb887('0x15')](_0x582f11);}return _0x4a028f[_0xb887('0x16')](_0x582f11)[_0xb887('0x17')]();};}function respondWithResult(_0x1579b7,_0x5899bb){_0x5899bb=_0x5899bb||0xc8;return function(_0x387367){if(_0x387367){return _0x1579b7[_0xb887('0x16')](_0x5899bb)[_0xb887('0x18')](_0x387367);}};}function respondWithFilteredResult(_0x34174a,_0x7bac36){return function(_0x1b193c){if(_0x1b193c){var _0x2008e4=_0x1b193c[_0xb887('0x19')],_0x2b0f05=_0x7bac36[_0xb887('0x1a')],_0x36f47b=_0x7bac36['offset']+_0x7bac36['limit'],_0xcb6e66;if(_0x36f47b>=_0x2008e4){_0x36f47b=_0x2008e4;_0xcb6e66=0xc8;}else{_0xcb6e66=0xce;}_0x34174a[_0xb887('0x16')](_0xcb6e66);return _0x34174a[_0xb887('0x1b')]('Content-Range',_0x2b0f05+'-'+_0x36f47b+'/'+_0x2008e4)[_0xb887('0x18')](_0x1b193c);}return null;};}function patchUpdates(_0xde13de){return function(_0x334636){try{jsonpatch[_0xb887('0x1c')](_0x334636,_0xde13de,!![]);}catch(_0x25e5bc){return BPromise['reject'](_0x25e5bc);}return _0x334636[_0xb887('0x1d')]();};}function saveUpdates(_0x4c82e0,_0x5a9e68){return function(_0x68ef0a){if(_0x68ef0a){return _0x68ef0a[_0xb887('0x1e')](_0x4c82e0)[_0xb887('0x1f')](function(_0x5f3791){return _0x5f3791;});}return null;};}function removeEntity(_0x5e7e60,_0x101f64){return function(_0x4af881){if(_0x4af881){return _0x4af881[_0xb887('0x20')]()[_0xb887('0x1f')](function(){_0x5e7e60[_0xb887('0x16')](0xcc)[_0xb887('0x17')]();});}};}function handleEntityNotFound(_0x49a401,_0x17dd2f){return function(_0x4653c7){if(!_0x4653c7){_0x49a401[_0xb887('0x15')](0x194);}return _0x4653c7;};}function handleError(_0x4d290c,_0x297225){_0x297225=_0x297225||0x1f4;return function(_0x4b2a1f){logger[_0xb887('0x21')](_0x4b2a1f[_0xb887('0x22')]);if(_0x4b2a1f[_0xb887('0x23')]){delete _0x4b2a1f['name'];}_0x4d290c['status'](_0x297225)[_0xb887('0x24')](_0x4b2a1f);};}exports[_0xb887('0x25')]=function(_0x468b3f,_0x33113c){var _0x1300cf={},_0x233e78={},_0x4d1c2d={'count':0x0,'rows':[]};var _0xa5aab2=_[_0xb887('0x26')](db[_0xb887('0x27')][_0xb887('0x28')],function(_0x52585e){return{'name':_0x52585e[_0xb887('0x29')],'type':_0x52585e['type'][_0xb887('0x2a')]};});_0x233e78[_0xb887('0x2b')]=_[_0xb887('0x26')](_0xa5aab2,_0xb887('0x23'));_0x233e78['query']=_[_0xb887('0x2c')](_0x468b3f[_0xb887('0x2d')]);_0x233e78['filters']=_[_0xb887('0x2e')](_0x233e78[_0xb887('0x2b')],_0x233e78[_0xb887('0x2d')]);_0x1300cf['attributes']=_[_0xb887('0x2e')](_0x233e78['model'],qs[_0xb887('0x2f')](_0x468b3f['query'][_0xb887('0x2f')]));_0x1300cf[_0xb887('0x30')]=_0x1300cf[_0xb887('0x30')][_0xb887('0x31')]?_0x1300cf['attributes']:_0x233e78[_0xb887('0x2b')];if(!_0x468b3f[_0xb887('0x2d')][_0xb887('0x32')](_0xb887('0x33'))){_0x1300cf['limit']=qs[_0xb887('0x34')](_0x468b3f[_0xb887('0x2d')][_0xb887('0x34')]);_0x1300cf[_0xb887('0x1a')]=qs[_0xb887('0x1a')](_0x468b3f[_0xb887('0x2d')][_0xb887('0x1a')]);}_0x1300cf['order']=qs[_0xb887('0x35')](_0x468b3f[_0xb887('0x2d')]['sort']);_0x1300cf[_0xb887('0x36')]=qs[_0xb887('0x37')](_['pick'](_0x468b3f[_0xb887('0x2d')],_0x233e78[_0xb887('0x37')]),_0xa5aab2);if(_0x468b3f[_0xb887('0x2d')]['filter']){_0x1300cf['where']=_['merge'](_0x1300cf['where'],{'$or':_[_0xb887('0x26')](_0xa5aab2,function(_0x234afe){if(_0x234afe['type']!==_0xb887('0x38')){var _0x97c275={};_0x97c275[_0x234afe[_0xb887('0x23')]]={'$like':'%'+_0x468b3f['query'][_0xb887('0x39')]+'%'};return _0x97c275;}})});}_0x1300cf=_[_0xb887('0x3a')]({},_0x1300cf,_0x468b3f[_0xb887('0x3b')]);var _0x1e942f={'where':_0x1300cf[_0xb887('0x36')]};return db[_0xb887('0x27')][_0xb887('0x19')](_0x1e942f)[_0xb887('0x1f')](function(_0x293362){_0x4d1c2d[_0xb887('0x19')]=_0x293362;if(_0x468b3f[_0xb887('0x2d')][_0xb887('0x3c')]){_0x1300cf['include']=[{'all':!![]}];}return db['MailServerOut'][_0xb887('0x3d')](_0x1300cf);})[_0xb887('0x1f')](function(_0x1e93d1){_0x4d1c2d[_0xb887('0x3e')]=_0x1e93d1;return _0x4d1c2d;})[_0xb887('0x1f')](respondWithFilteredResult(_0x33113c,_0x1300cf))[_0xb887('0x3f')](handleError(_0x33113c,null));};exports[_0xb887('0x40')]=function(_0x4c9cf2,_0x4acfe7){var _0x3d2014={'raw':!![],'where':{'id':_0x4c9cf2[_0xb887('0x41')]['id']}},_0x15c20b={};_0x15c20b[_0xb887('0x2b')]=_['keys'](db['MailServerOut'][_0xb887('0x28')]);_0x15c20b[_0xb887('0x2d')]=_[_0xb887('0x2c')](_0x4c9cf2[_0xb887('0x2d')]);_0x15c20b[_0xb887('0x37')]=_[_0xb887('0x2e')](_0x15c20b[_0xb887('0x2b')],_0x15c20b[_0xb887('0x2d')]);_0x3d2014['attributes']=_[_0xb887('0x2e')](_0x15c20b['model'],qs[_0xb887('0x2f')](_0x4c9cf2[_0xb887('0x2d')]['fields']));_0x3d2014['attributes']=_0x3d2014[_0xb887('0x30')][_0xb887('0x31')]?_0x3d2014[_0xb887('0x30')]:_0x15c20b[_0xb887('0x2b')];if(_0x4c9cf2[_0xb887('0x2d')][_0xb887('0x3c')]){_0x3d2014[_0xb887('0x42')]=[{'all':!![]}];}_0x3d2014=_[_0xb887('0x3a')]({},_0x3d2014,_0x4c9cf2[_0xb887('0x3b')]);return db[_0xb887('0x27')][_0xb887('0x43')](_0x3d2014)['then'](handleEntityNotFound(_0x4acfe7,null))[_0xb887('0x1f')](respondWithResult(_0x4acfe7,null))['catch'](handleError(_0x4acfe7,null));};exports['create']=function(_0x459865,_0x9c4384){return db[_0xb887('0x27')][_0xb887('0x44')](_0x459865[_0xb887('0x45')],{})[_0xb887('0x1f')](respondWithResult(_0x9c4384,0xc9))['catch'](handleError(_0x9c4384,null));};exports['update']=function(_0x5a1457,_0x270db2){if(_0x5a1457[_0xb887('0x45')]['id']){delete _0x5a1457[_0xb887('0x45')]['id'];}return db[_0xb887('0x27')]['find']({'where':{'id':_0x5a1457['params']['id']}})[_0xb887('0x1f')](handleEntityNotFound(_0x270db2,null))[_0xb887('0x1f')](saveUpdates(_0x5a1457[_0xb887('0x45')],null))[_0xb887('0x1f')](respondWithResult(_0x270db2,null))[_0xb887('0x3f')](handleError(_0x270db2,null));};exports['destroy']=function(_0x4310f2,_0x3d1af4){return db[_0xb887('0x27')][_0xb887('0x43')]({'where':{'id':_0x4310f2[_0xb887('0x41')]['id']}})[_0xb887('0x1f')](handleEntityNotFound(_0x3d1af4,null))[_0xb887('0x1f')](removeEntity(_0x3d1af4,null))['catch'](handleError(_0x3d1af4,null));}; \ No newline at end of file +var _0x4abd=['../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','MailServerOut','then','rows','show','params','find','catch','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils'];(function(_0x5d455e,_0x33a90d){var _0x95f642=function(_0x447ae2){while(--_0x447ae2){_0x5d455e['push'](_0x5d455e['shift']());}};_0x95f642(++_0x33a90d);}(_0x4abd,0x1b9));var _0xd4ab=function(_0x7d4dc8,_0x14d70e){_0x7d4dc8=_0x7d4dc8-0x0;var _0x20b216=_0x4abd[_0x7d4dc8];return _0x20b216;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd4ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4ab('0x1'));var rp=require(_0xd4ab('0x2'));var moment=require(_0xd4ab('0x3'));var BPromise=require(_0xd4ab('0x4'));var Mustache=require(_0xd4ab('0x5'));var util=require('util');var path=require(_0xd4ab('0x6'));var sox=require(_0xd4ab('0x7'));var csv=require(_0xd4ab('0x8'));var ejs=require(_0xd4ab('0x9'));var fs=require('fs');var _=require(_0xd4ab('0xa'));var squel=require(_0xd4ab('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd4ab('0xc'));var toCsv=require(_0xd4ab('0x8'));var querystring=require(_0xd4ab('0xd'));var Papa=require(_0xd4ab('0xe'));var Redis=require(_0xd4ab('0xf'));var authService=require(_0xd4ab('0x10'));var qs=require(_0xd4ab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4ab('0x12'))(_0xd4ab('0x13'));var utils=require(_0xd4ab('0x14'));var config=require('../../config/environment');var db=require(_0xd4ab('0x15'))['db'];function respondWithStatusCode(_0x3439bf,_0x2908dc){_0x2908dc=_0x2908dc||0xcc;return function(_0x1463fd){if(_0x1463fd){return _0x3439bf[_0xd4ab('0x16')](_0x2908dc);}return _0x3439bf[_0xd4ab('0x17')](_0x2908dc)[_0xd4ab('0x18')]();};}function respondWithResult(_0x1451a3,_0xc2fdad){_0xc2fdad=_0xc2fdad||0xc8;return function(_0x4cc545){if(_0x4cc545){return _0x1451a3[_0xd4ab('0x17')](_0xc2fdad)[_0xd4ab('0x19')](_0x4cc545);}};}function respondWithFilteredResult(_0x45e628,_0x2dc45f){return function(_0x568508){if(_0x568508){var _0x332e41=_0x568508[_0xd4ab('0x1a')],_0x528c53=_0x2dc45f[_0xd4ab('0x1b')],_0x1d550b=_0x2dc45f[_0xd4ab('0x1b')]+_0x2dc45f['limit'],_0x38b71d;if(_0x1d550b>=_0x332e41){_0x1d550b=_0x332e41;_0x38b71d=0xc8;}else{_0x38b71d=0xce;}_0x45e628[_0xd4ab('0x17')](_0x38b71d);return _0x45e628['set'](_0xd4ab('0x1c'),_0x528c53+'-'+_0x1d550b+'/'+_0x332e41)['json'](_0x568508);}return null;};}function patchUpdates(_0x428b78){return function(_0x26d382){try{jsonpatch[_0xd4ab('0x1d')](_0x26d382,_0x428b78,!![]);}catch(_0x528e5f){return BPromise['reject'](_0x528e5f);}return _0x26d382['save']();};}function saveUpdates(_0x4c085c,_0x14ff47){return function(_0x12d631){if(_0x12d631){return _0x12d631['update'](_0x4c085c)['then'](function(_0xfced84){return _0xfced84;});}return null;};}function removeEntity(_0x5eea15,_0x5b2bd6){return function(_0x3c2a52){if(_0x3c2a52){return _0x3c2a52['destroy']()['then'](function(){_0x5eea15[_0xd4ab('0x17')](0xcc)[_0xd4ab('0x18')]();});}};}function handleEntityNotFound(_0x5c5ba4,_0x23125d){return function(_0x475f50){if(!_0x475f50){_0x5c5ba4[_0xd4ab('0x16')](0x194);}return _0x475f50;};}function handleError(_0x53eff0,_0x5b3c67){_0x5b3c67=_0x5b3c67||0x1f4;return function(_0x475724){logger[_0xd4ab('0x1e')](_0x475724[_0xd4ab('0x1f')]);if(_0x475724['name']){delete _0x475724[_0xd4ab('0x20')];}_0x53eff0['status'](_0x5b3c67)['send'](_0x475724);};}exports[_0xd4ab('0x21')]=function(_0xce04cd,_0x573ee7){var _0xfb45cc={},_0x51d35a={},_0x572b2c={'count':0x0,'rows':[]};var _0x32d1d8=_[_0xd4ab('0x22')](db['MailServerOut'][_0xd4ab('0x23')],function(_0x5f1980){return{'name':_0x5f1980[_0xd4ab('0x24')],'type':_0x5f1980[_0xd4ab('0x25')]['key']};});_0x51d35a[_0xd4ab('0x26')]=_[_0xd4ab('0x22')](_0x32d1d8,_0xd4ab('0x20'));_0x51d35a[_0xd4ab('0x27')]=_[_0xd4ab('0x28')](_0xce04cd['query']);_0x51d35a[_0xd4ab('0x29')]=_['intersection'](_0x51d35a['model'],_0x51d35a[_0xd4ab('0x27')]);_0xfb45cc[_0xd4ab('0x2a')]=_[_0xd4ab('0x2b')](_0x51d35a[_0xd4ab('0x26')],qs[_0xd4ab('0x2c')](_0xce04cd[_0xd4ab('0x27')]['fields']));_0xfb45cc[_0xd4ab('0x2a')]=_0xfb45cc[_0xd4ab('0x2a')]['length']?_0xfb45cc['attributes']:_0x51d35a[_0xd4ab('0x26')];if(!_0xce04cd[_0xd4ab('0x27')][_0xd4ab('0x2d')](_0xd4ab('0x2e'))){_0xfb45cc[_0xd4ab('0x2f')]=qs[_0xd4ab('0x2f')](_0xce04cd[_0xd4ab('0x27')]['limit']);_0xfb45cc[_0xd4ab('0x1b')]=qs[_0xd4ab('0x1b')](_0xce04cd[_0xd4ab('0x27')][_0xd4ab('0x1b')]);}_0xfb45cc[_0xd4ab('0x30')]=qs[_0xd4ab('0x31')](_0xce04cd[_0xd4ab('0x27')][_0xd4ab('0x31')]);_0xfb45cc[_0xd4ab('0x32')]=qs[_0xd4ab('0x29')](_[_0xd4ab('0x33')](_0xce04cd[_0xd4ab('0x27')],_0x51d35a[_0xd4ab('0x29')]),_0x32d1d8);if(_0xce04cd[_0xd4ab('0x27')]['filter']){_0xfb45cc[_0xd4ab('0x32')]=_[_0xd4ab('0x34')](_0xfb45cc['where'],{'$or':_[_0xd4ab('0x22')](_0x32d1d8,function(_0x17c333){if(_0x17c333[_0xd4ab('0x25')]!==_0xd4ab('0x35')){var _0x4b80c4={};_0x4b80c4[_0x17c333[_0xd4ab('0x20')]]={'$like':'%'+_0xce04cd[_0xd4ab('0x27')][_0xd4ab('0x36')]+'%'};return _0x4b80c4;}})});}_0xfb45cc=_['merge']({},_0xfb45cc,_0xce04cd['options']);var _0x25f159={'where':_0xfb45cc[_0xd4ab('0x32')]};return db['MailServerOut']['count'](_0x25f159)['then'](function(_0x24e64c){_0x572b2c[_0xd4ab('0x1a')]=_0x24e64c;if(_0xce04cd['query'][_0xd4ab('0x37')]){_0xfb45cc[_0xd4ab('0x38')]=[{'all':!![]}];}return db[_0xd4ab('0x39')]['findAll'](_0xfb45cc);})[_0xd4ab('0x3a')](function(_0x2907a1){_0x572b2c[_0xd4ab('0x3b')]=_0x2907a1;return _0x572b2c;})[_0xd4ab('0x3a')](respondWithFilteredResult(_0x573ee7,_0xfb45cc))['catch'](handleError(_0x573ee7,null));};exports[_0xd4ab('0x3c')]=function(_0x32aff8,_0x26a84b){var _0x3f2777={'raw':!![],'where':{'id':_0x32aff8[_0xd4ab('0x3d')]['id']}},_0x3a9323={};_0x3a9323[_0xd4ab('0x26')]=_[_0xd4ab('0x28')](db['MailServerOut'][_0xd4ab('0x23')]);_0x3a9323[_0xd4ab('0x27')]=_['keys'](_0x32aff8[_0xd4ab('0x27')]);_0x3a9323[_0xd4ab('0x29')]=_['intersection'](_0x3a9323[_0xd4ab('0x26')],_0x3a9323[_0xd4ab('0x27')]);_0x3f2777[_0xd4ab('0x2a')]=_[_0xd4ab('0x2b')](_0x3a9323[_0xd4ab('0x26')],qs[_0xd4ab('0x2c')](_0x32aff8[_0xd4ab('0x27')][_0xd4ab('0x2c')]));_0x3f2777[_0xd4ab('0x2a')]=_0x3f2777[_0xd4ab('0x2a')]['length']?_0x3f2777['attributes']:_0x3a9323['model'];if(_0x32aff8[_0xd4ab('0x27')][_0xd4ab('0x37')]){_0x3f2777[_0xd4ab('0x38')]=[{'all':!![]}];}_0x3f2777=_[_0xd4ab('0x34')]({},_0x3f2777,_0x32aff8['options']);return db[_0xd4ab('0x39')][_0xd4ab('0x3e')](_0x3f2777)['then'](handleEntityNotFound(_0x26a84b,null))[_0xd4ab('0x3a')](respondWithResult(_0x26a84b,null))[_0xd4ab('0x3f')](handleError(_0x26a84b,null));};exports['create']=function(_0x3878cd,_0x1cfb02){return db['MailServerOut']['create'](_0x3878cd[_0xd4ab('0x40')],{})[_0xd4ab('0x3a')](respondWithResult(_0x1cfb02,0xc9))['catch'](handleError(_0x1cfb02,null));};exports['update']=function(_0x10e1eb,_0x354367){if(_0x10e1eb[_0xd4ab('0x40')]['id']){delete _0x10e1eb[_0xd4ab('0x40')]['id'];}return db['MailServerOut']['find']({'where':{'id':_0x10e1eb[_0xd4ab('0x3d')]['id']}})[_0xd4ab('0x3a')](handleEntityNotFound(_0x354367,null))['then'](saveUpdates(_0x10e1eb[_0xd4ab('0x40')],null))[_0xd4ab('0x3a')](respondWithResult(_0x354367,null))[_0xd4ab('0x3f')](handleError(_0x354367,null));};exports[_0xd4ab('0x41')]=function(_0x2f96c9,_0x10454d){return db['MailServerOut'][_0xd4ab('0x3e')]({'where':{'id':_0x2f96c9[_0xd4ab('0x3d')]['id']}})['then'](handleEntityNotFound(_0x10454d,null))[_0xd4ab('0x3a')](removeEntity(_0x10454d,null))['catch'](handleError(_0x10454d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index f974052..52ea730 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util'];(function(_0x458ff6,_0x2561cf){var _0x3bb9a8=function(_0x4970f3){while(--_0x4970f3){_0x458ff6['push'](_0x458ff6['shift']());}};_0x3bb9a8(++_0x2561cf);}(_0xf494,0x1c6));var _0x4f49=function(_0x561e40,_0x4fca89){_0x561e40=_0x561e40-0x0;var _0x3c8865=_0xf494[_0x561e40];return _0x3c8865;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x239df9,_0x13d9d1){var _0x11df94=function(_0x4cdc05){while(--_0x4cdc05){_0x239df9['push'](_0x239df9['shift']());}};_0x11df94(++_0x13d9d1);}(_0x187d,0x93));var _0xd187=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x187d[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 74d0b60..e1f947b 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 _0x3321=['MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x160a3b,_0x52b3af){var _0x49a7a5=function(_0x1f774){while(--_0x1f774){_0x160a3b['push'](_0x160a3b['shift']());}};_0x49a7a5(++_0x52b3af);}(_0x3321,0x100));var _0x1332=function(_0x5acebe,_0x1f2c20){_0x5acebe=_0x5acebe-0x0;var _0x4a5136=_0x3321[_0x5acebe];return _0x4a5136;};'use strict';var _=require(_0x1332('0x0'));var util=require('util');var moment=require(_0x1332('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1332('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1332('0x3'))(_0x1332('0x4'));var config=require(_0x1332('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1332('0x6')][_0x1332('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x498adb,_0x28c3a2,_0x4b409e){return new BPromise(function(_0x48d623,_0x4e382b){return client[_0x1332('0x8')](_0x498adb,_0x4b409e)[_0x1332('0x9')](function(_0x4cedc2){logger[_0x1332('0xa')](_0x1332('0xb'),_0x28c3a2,_0x1332('0xc'));logger[_0x1332('0xd')](_0x1332('0xe'),_0x28c3a2,_0x1332('0xc'),JSON[_0x1332('0xf')](_0x4cedc2));if(_0x4cedc2[_0x1332('0x10')]){if(_0x4cedc2[_0x1332('0x10')]['code']===0x1f4){logger[_0x1332('0x10')](_0x1332('0xb'),_0x28c3a2,_0x4cedc2[_0x1332('0x10')][_0x1332('0x11')]);return _0x4e382b(_0x4cedc2[_0x1332('0x10')][_0x1332('0x11')]);}logger[_0x1332('0x10')](_0x1332('0xb'),_0x28c3a2,_0x4cedc2[_0x1332('0x10')][_0x1332('0x11')]);return _0x48d623(_0x4cedc2['error'][_0x1332('0x11')]);}else{logger['info'](_0x1332('0xb'),_0x28c3a2,_0x1332('0xc'));_0x48d623(_0x4cedc2['result'][_0x1332('0x11')]);}})['catch'](function(_0x1f4b27){logger[_0x1332('0x10')](_0x1332('0xb'),_0x28c3a2,_0x1f4b27);_0x4e382b(_0x1f4b27);});});} \ No newline at end of file +var _0xa259=['MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xa259,0x11a));var _0x9a25=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xa259[_0x4cbf20];return _0x582ae4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a25('0x0'));var BPromise=require(_0x9a25('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a25('0x2'));var db=require(_0x9a25('0x3'))['db'];var utils=require(_0x9a25('0x4'));var logger=require(_0x9a25('0x5'))(_0x9a25('0x6'));var config=require('../../config/environment');var jayson=require(_0x9a25('0x7'));var client=jayson[_0x9a25('0x8')][_0x9a25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27037e,_0x4a5a7e,_0x6f5fdb){return new BPromise(function(_0x3283cc,_0x2cd96c){return client['request'](_0x27037e,_0x6f5fdb)[_0x9a25('0xa')](function(_0xfba739){logger[_0x9a25('0xb')](_0x9a25('0xc'),_0x4a5a7e,'request\x20sent');logger[_0x9a25('0xd')](_0x9a25('0xe'),_0x4a5a7e,_0x9a25('0xf'),JSON[_0x9a25('0x10')](_0xfba739));if(_0xfba739['error']){if(_0xfba739['error'][_0x9a25('0x11')]===0x1f4){logger['error'](_0x9a25('0xc'),_0x4a5a7e,_0xfba739[_0x9a25('0x12')]['message']);return _0x2cd96c(_0xfba739[_0x9a25('0x12')][_0x9a25('0x13')]);}logger[_0x9a25('0x12')](_0x9a25('0xc'),_0x4a5a7e,_0xfba739[_0x9a25('0x12')][_0x9a25('0x13')]);return _0x3283cc(_0xfba739[_0x9a25('0x12')][_0x9a25('0x13')]);}else{logger[_0x9a25('0xb')](_0x9a25('0xc'),_0x4a5a7e,_0x9a25('0xf'));_0x3283cc(_0xfba739['result'][_0x9a25('0x13')]);}})[_0x9a25('0x14')](function(_0x9776c0){logger[_0x9a25('0x12')](_0x9a25('0xc'),_0x4a5a7e,_0x9776c0);_0x2cd96c(_0x9776c0);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 2dceaf7..77e626e 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 _0x5b0d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','create','put'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x5b0d,0xee));var _0xd5b0=function(_0x13583c,_0x498c30){_0x13583c=_0x13583c-0x0;var _0x1df527=_0x5b0d[_0x13583c];return _0x1df527;};'use strict';var multer=require(_0xd5b0('0x0'));var util=require(_0xd5b0('0x1'));var path=require(_0xd5b0('0x2'));var timeout=require(_0xd5b0('0x3'));var express=require(_0xd5b0('0x4'));var router=express[_0xd5b0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5b0('0x6'));var config=require(_0xd5b0('0x7'));var controller=require('./mailSubstatus.controller');router[_0xd5b0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd5b0('0x8')](_0xd5b0('0x9'),auth[_0xd5b0('0xa')](),controller['describe']);router[_0xd5b0('0x8')](_0xd5b0('0xb'),auth[_0xd5b0('0xa')](),controller['show']);router['post']('/',auth[_0xd5b0('0xa')](),controller[_0xd5b0('0xc')]);router[_0xd5b0('0xd')](_0xd5b0('0xb'),auth[_0xd5b0('0xa')](),controller[_0xd5b0('0xe')]);router[_0xd5b0('0xf')](_0xd5b0('0xb'),auth[_0xd5b0('0xa')](),controller[_0xd5b0('0x10')]);module[_0xd5b0('0x11')]=router; \ No newline at end of file +var _0x10e3=['/describe','describe','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x36400b,_0x9ad645){var _0x425f1f=function(_0x1fcfe7){while(--_0x1fcfe7){_0x36400b['push'](_0x36400b['shift']());}};_0x425f1f(++_0x9ad645);}(_0x10e3,0x1d1));var _0x310e=function(_0x8864dd,_0x120434){_0x8864dd=_0x8864dd-0x0;var _0x4c1074=_0x10e3[_0x8864dd];return _0x4c1074;};'use strict';var multer=require(_0x310e('0x0'));var util=require('util');var path=require(_0x310e('0x1'));var timeout=require(_0x310e('0x2'));var express=require(_0x310e('0x3'));var router=express[_0x310e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x310e('0x5'));var config=require(_0x310e('0x6'));var controller=require('./mailSubstatus.controller');router[_0x310e('0x7')]('/',auth[_0x310e('0x8')](),controller[_0x310e('0x9')]);router[_0x310e('0x7')](_0x310e('0xa'),auth[_0x310e('0x8')](),controller[_0x310e('0xb')]);router[_0x310e('0x7')]('/:id',auth[_0x310e('0x8')](),controller[_0x310e('0xc')]);router[_0x310e('0xd')]('/',auth[_0x310e('0x8')](),controller[_0x310e('0xe')]);router[_0x310e('0xf')](_0x310e('0x10'),auth[_0x310e('0x8')](),controller['update']);router['delete'](_0x310e('0x10'),auth[_0x310e('0x8')](),controller[_0x310e('0x11')]);module[_0x310e('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 026a485..4637963 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 _0x5232=['name','sequelize','exports','STRING'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x5232,0x1c9));var _0x2523=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x5232[_0x313df3];return _0x241d59;};'use strict';var Sequelize=require(_0x2523('0x0'));module[_0x2523('0x1')]={'name':{'type':Sequelize[_0x2523('0x2')],'unique':_0x2523('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2523('0x2')]}}; \ No newline at end of file +var _0xb7ae=['exports','STRING','name','sequelize'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x10599d,_0x5f4787){_0x10599d=_0x10599d-0x0;var _0x29ef53=_0xb7ae[_0x10599d];return _0x29ef53;};'use strict';var Sequelize=require(_0xeb7a('0x0'));module[_0xeb7a('0x1')]={'name':{'type':Sequelize[_0xeb7a('0x2')],'unique':_0xeb7a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeb7a('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index eeadc6a..3162a41 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 _0xa23c=['findAll','rows','show','model','include','find','catch','create','body','destroy','params','describe','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','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','error','stack','name','send','index','MailSubstatus','rawAttributes','key','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa23c,0x13c));var _0xca23=function(_0x52c684,_0x5bf3a4){_0x52c684=_0x52c684-0x0;var _0x254acd=_0xa23c[_0x52c684];return _0x254acd;};'use strict';var pdf=require(_0xca23('0x0'));var emlformat=require(_0xca23('0x1'));var rimraf=require(_0xca23('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca23('0x3'));var rp=require(_0xca23('0x4'));var moment=require(_0xca23('0x5'));var BPromise=require(_0xca23('0x6'));var Mustache=require(_0xca23('0x7'));var util=require(_0xca23('0x8'));var path=require(_0xca23('0x9'));var sox=require(_0xca23('0xa'));var csv=require(_0xca23('0xb'));var ejs=require(_0xca23('0xc'));var fs=require('fs');var _=require(_0xca23('0xd'));var squel=require(_0xca23('0xe'));var crypto=require(_0xca23('0xf'));var jsforce=require(_0xca23('0x10'));var deskjs=require(_0xca23('0x11'));var toCsv=require(_0xca23('0xb'));var querystring=require(_0xca23('0x12'));var Papa=require(_0xca23('0x13'));var Redis=require(_0xca23('0x14'));var authService=require(_0xca23('0x15'));var qs=require(_0xca23('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca23('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xca23('0x18'));var config=require(_0xca23('0x19'));var db=require(_0xca23('0x1a'))['db'];function respondWithStatusCode(_0x117b43,_0x262d9e){_0x262d9e=_0x262d9e||0xcc;return function(_0x4da307){if(_0x4da307){return _0x117b43[_0xca23('0x1b')](_0x262d9e);}return _0x117b43[_0xca23('0x1c')](_0x262d9e)[_0xca23('0x1d')]();};}function respondWithResult(_0x427316,_0x4968b2){_0x4968b2=_0x4968b2||0xc8;return function(_0xcbf7ed){if(_0xcbf7ed){return _0x427316['status'](_0x4968b2)[_0xca23('0x1e')](_0xcbf7ed);}};}function respondWithFilteredResult(_0x16294d,_0x403680){return function(_0x5957c3){if(_0x5957c3){var _0x5ef66c=_0x5957c3['count'],_0x13dbcb=_0x403680['offset'],_0x1dee6d=_0x403680[_0xca23('0x1f')]+_0x403680['limit'],_0x35ff42;if(_0x1dee6d>=_0x5ef66c){_0x1dee6d=_0x5ef66c;_0x35ff42=0xc8;}else{_0x35ff42=0xce;}_0x16294d[_0xca23('0x1c')](_0x35ff42);return _0x16294d[_0xca23('0x20')](_0xca23('0x21'),_0x13dbcb+'-'+_0x1dee6d+'/'+_0x5ef66c)[_0xca23('0x1e')](_0x5957c3);}return null;};}function patchUpdates(_0x3770d0){return function(_0x345efa){try{jsonpatch['apply'](_0x345efa,_0x3770d0,!![]);}catch(_0x13b794){return BPromise[_0xca23('0x22')](_0x13b794);}return _0x345efa[_0xca23('0x23')]();};}function saveUpdates(_0x39bbef,_0x375d7c){return function(_0x99eff8){if(_0x99eff8){return _0x99eff8['update'](_0x39bbef)[_0xca23('0x24')](function(_0x1ad8a3){return _0x1ad8a3;});}return null;};}function removeEntity(_0x3c7182,_0x5dbe33){return function(_0x32f50d){if(_0x32f50d){return _0x32f50d['destroy']()[_0xca23('0x24')](function(){_0x3c7182['status'](0xcc)[_0xca23('0x1d')]();});}};}function handleEntityNotFound(_0x14ec1f,_0x29e9b7){return function(_0x32a720){if(!_0x32a720){_0x14ec1f[_0xca23('0x1b')](0x194);}return _0x32a720;};}function handleError(_0x436af4,_0x3b931d){_0x3b931d=_0x3b931d||0x1f4;return function(_0xbac4be){logger[_0xca23('0x25')](_0xbac4be[_0xca23('0x26')]);if(_0xbac4be[_0xca23('0x27')]){delete _0xbac4be['name'];}_0x436af4[_0xca23('0x1c')](_0x3b931d)[_0xca23('0x28')](_0xbac4be);};}exports[_0xca23('0x29')]=function(_0x1f02d0,_0x479a47){var _0x5647ce={},_0x433e02={},_0x4682d2={'count':0x0,'rows':[]};var _0x1eba77=_['map'](db[_0xca23('0x2a')][_0xca23('0x2b')],function(_0x2e24e5){return{'name':_0x2e24e5['fieldName'],'type':_0x2e24e5['type'][_0xca23('0x2c')]};});_0x433e02['model']=_[_0xca23('0x2d')](_0x1eba77,_0xca23('0x27'));_0x433e02[_0xca23('0x2e')]=_[_0xca23('0x2f')](_0x1f02d0[_0xca23('0x2e')]);_0x433e02[_0xca23('0x30')]=_[_0xca23('0x31')](_0x433e02['model'],_0x433e02[_0xca23('0x2e')]);_0x5647ce[_0xca23('0x32')]=_[_0xca23('0x31')](_0x433e02['model'],qs[_0xca23('0x33')](_0x1f02d0[_0xca23('0x2e')][_0xca23('0x33')]));_0x5647ce['attributes']=_0x5647ce['attributes']['length']?_0x5647ce[_0xca23('0x32')]:_0x433e02['model'];if(!_0x1f02d0[_0xca23('0x2e')][_0xca23('0x34')]('nolimit')){_0x5647ce[_0xca23('0x35')]=qs['limit'](_0x1f02d0[_0xca23('0x2e')][_0xca23('0x35')]);_0x5647ce['offset']=qs[_0xca23('0x1f')](_0x1f02d0[_0xca23('0x2e')][_0xca23('0x1f')]);}_0x5647ce[_0xca23('0x36')]=qs['sort'](_0x1f02d0['query'][_0xca23('0x37')]);_0x5647ce[_0xca23('0x38')]=qs['filters'](_[_0xca23('0x39')](_0x1f02d0['query'],_0x433e02[_0xca23('0x30')]),_0x1eba77);if(_0x1f02d0[_0xca23('0x2e')][_0xca23('0x3a')]){_0x5647ce[_0xca23('0x38')]=_[_0xca23('0x3b')](_0x5647ce['where'],{'$or':_[_0xca23('0x2d')](_0x1eba77,function(_0x3c16be){if(_0x3c16be['type']!==_0xca23('0x3c')){var _0x2e1723={};_0x2e1723[_0x3c16be[_0xca23('0x27')]]={'$like':'%'+_0x1f02d0[_0xca23('0x2e')]['filter']+'%'};return _0x2e1723;}})});}_0x5647ce=_[_0xca23('0x3b')]({},_0x5647ce,_0x1f02d0[_0xca23('0x3d')]);var _0x2bdf04={'where':_0x5647ce['where']};return db[_0xca23('0x2a')][_0xca23('0x3e')](_0x2bdf04)['then'](function(_0x324975){_0x4682d2[_0xca23('0x3e')]=_0x324975;if(_0x1f02d0['query'][_0xca23('0x3f')]){_0x5647ce['include']=[{'all':!![]}];}return db[_0xca23('0x2a')][_0xca23('0x40')](_0x5647ce);})['then'](function(_0x5cff6e){_0x4682d2[_0xca23('0x41')]=_0x5cff6e;return _0x4682d2;})[_0xca23('0x24')](respondWithFilteredResult(_0x479a47,_0x5647ce))['catch'](handleError(_0x479a47,null));};exports[_0xca23('0x42')]=function(_0x26a1d3,_0x12db9d){var _0x125989={'raw':!![],'where':{'id':_0x26a1d3['params']['id']}},_0x1d71fb={};_0x1d71fb['model']=_[_0xca23('0x2f')](db['MailSubstatus'][_0xca23('0x2b')]);_0x1d71fb[_0xca23('0x2e')]=_[_0xca23('0x2f')](_0x26a1d3[_0xca23('0x2e')]);_0x1d71fb[_0xca23('0x30')]=_[_0xca23('0x31')](_0x1d71fb['model'],_0x1d71fb[_0xca23('0x2e')]);_0x125989[_0xca23('0x32')]=_[_0xca23('0x31')](_0x1d71fb[_0xca23('0x43')],qs['fields'](_0x26a1d3[_0xca23('0x2e')][_0xca23('0x33')]));_0x125989[_0xca23('0x32')]=_0x125989[_0xca23('0x32')]['length']?_0x125989['attributes']:_0x1d71fb[_0xca23('0x43')];if(_0x26a1d3[_0xca23('0x2e')][_0xca23('0x3f')]){_0x125989[_0xca23('0x44')]=[{'all':!![]}];}_0x125989=_[_0xca23('0x3b')]({},_0x125989,_0x26a1d3[_0xca23('0x3d')]);return db[_0xca23('0x2a')][_0xca23('0x45')](_0x125989)['then'](handleEntityNotFound(_0x12db9d,null))[_0xca23('0x24')](respondWithResult(_0x12db9d,null))[_0xca23('0x46')](handleError(_0x12db9d,null));};exports[_0xca23('0x47')]=function(_0x4c6439,_0x57e18b){return db[_0xca23('0x2a')]['create'](_0x4c6439[_0xca23('0x48')],{})[_0xca23('0x24')](respondWithResult(_0x57e18b,0xc9))[_0xca23('0x46')](handleError(_0x57e18b,null));};exports['update']=function(_0x143c43,_0x5f3f27){if(_0x143c43[_0xca23('0x48')]['id']){delete _0x143c43[_0xca23('0x48')]['id'];}return db[_0xca23('0x2a')][_0xca23('0x45')]({'where':{'id':_0x143c43['params']['id']}})['then'](handleEntityNotFound(_0x5f3f27,null))[_0xca23('0x24')](saveUpdates(_0x143c43[_0xca23('0x48')],null))[_0xca23('0x24')](respondWithResult(_0x5f3f27,null))[_0xca23('0x46')](handleError(_0x5f3f27,null));};exports[_0xca23('0x49')]=function(_0x22653a,_0x3a53af){return db[_0xca23('0x2a')]['find']({'where':{'id':_0x22653a[_0xca23('0x4a')]['id']}})[_0xca23('0x24')](handleEntityNotFound(_0x3a53af,null))[_0xca23('0x24')](removeEntity(_0x3a53af,null))['catch'](handleError(_0x3a53af,null));};exports[_0xca23('0x4b')]=function(_0x3a66ac,_0x1bf3c6){return db[_0xca23('0x2a')][_0xca23('0x4b')]()[_0xca23('0x24')](respondWithResult(_0x1bf3c6,null))[_0xca23('0x46')](handleError(_0x1bf3c6,null));}; \ No newline at end of file +var _0xac52=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x50059f,_0x1b78ed){var _0x1a06df=function(_0x3cfb82){while(--_0x3cfb82){_0x50059f['push'](_0x50059f['shift']());}};_0x1a06df(++_0x1b78ed);}(_0xac52,0x1a4));var _0x2ac5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xac52[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x2ac5('0x0'));var emlformat=require(_0x2ac5('0x1'));var rimraf=require(_0x2ac5('0x2'));var zipdir=require(_0x2ac5('0x3'));var jsonpatch=require(_0x2ac5('0x4'));var rp=require('request-promise');var moment=require(_0x2ac5('0x5'));var BPromise=require(_0x2ac5('0x6'));var Mustache=require(_0x2ac5('0x7'));var util=require('util');var path=require(_0x2ac5('0x8'));var sox=require(_0x2ac5('0x9'));var csv=require(_0x2ac5('0xa'));var ejs=require(_0x2ac5('0xb'));var fs=require('fs');var _=require(_0x2ac5('0xc'));var squel=require('squel');var crypto=require(_0x2ac5('0xd'));var jsforce=require(_0x2ac5('0xe'));var deskjs=require(_0x2ac5('0xf'));var toCsv=require(_0x2ac5('0xa'));var querystring=require(_0x2ac5('0x10'));var Papa=require('papaparse');var Redis=require(_0x2ac5('0x11'));var authService=require(_0x2ac5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ac5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2ac5('0x14'));var config=require(_0x2ac5('0x15'));var db=require(_0x2ac5('0x16'))['db'];function respondWithStatusCode(_0x3b42c3,_0x35b1e3){_0x35b1e3=_0x35b1e3||0xcc;return function(_0x3a9ac8){if(_0x3a9ac8){return _0x3b42c3[_0x2ac5('0x17')](_0x35b1e3);}return _0x3b42c3[_0x2ac5('0x18')](_0x35b1e3)[_0x2ac5('0x19')]();};}function respondWithResult(_0x21e3d7,_0x55e565){_0x55e565=_0x55e565||0xc8;return function(_0x4592fe){if(_0x4592fe){return _0x21e3d7[_0x2ac5('0x18')](_0x55e565)[_0x2ac5('0x1a')](_0x4592fe);}};}function respondWithFilteredResult(_0x566c13,_0x1fbb7c){return function(_0x14d3ee){if(_0x14d3ee){var _0x56dfc0=_0x14d3ee[_0x2ac5('0x1b')],_0x380369=_0x1fbb7c[_0x2ac5('0x1c')],_0x56650=_0x1fbb7c[_0x2ac5('0x1c')]+_0x1fbb7c['limit'],_0x593b29;if(_0x56650>=_0x56dfc0){_0x56650=_0x56dfc0;_0x593b29=0xc8;}else{_0x593b29=0xce;}_0x566c13[_0x2ac5('0x18')](_0x593b29);return _0x566c13[_0x2ac5('0x1d')](_0x2ac5('0x1e'),_0x380369+'-'+_0x56650+'/'+_0x56dfc0)[_0x2ac5('0x1a')](_0x14d3ee);}return null;};}function patchUpdates(_0x2bee9a){return function(_0x551100){try{jsonpatch['apply'](_0x551100,_0x2bee9a,!![]);}catch(_0x534dc2){return BPromise['reject'](_0x534dc2);}return _0x551100['save']();};}function saveUpdates(_0x8819b2,_0x5829cc){return function(_0x6e3b9b){if(_0x6e3b9b){return _0x6e3b9b[_0x2ac5('0x1f')](_0x8819b2)[_0x2ac5('0x20')](function(_0x5eba46){return _0x5eba46;});}return null;};}function removeEntity(_0x14a915,_0x20cb53){return function(_0x125ad2){if(_0x125ad2){return _0x125ad2[_0x2ac5('0x21')]()['then'](function(){_0x14a915['status'](0xcc)[_0x2ac5('0x19')]();});}};}function handleEntityNotFound(_0x2f572d,_0x4e9c5d){return function(_0x3e3694){if(!_0x3e3694){_0x2f572d['sendStatus'](0x194);}return _0x3e3694;};}function handleError(_0x1a037b,_0x2ffb04){_0x2ffb04=_0x2ffb04||0x1f4;return function(_0x1b19c0){logger[_0x2ac5('0x22')](_0x1b19c0[_0x2ac5('0x23')]);if(_0x1b19c0['name']){delete _0x1b19c0[_0x2ac5('0x24')];}_0x1a037b[_0x2ac5('0x18')](_0x2ffb04)[_0x2ac5('0x25')](_0x1b19c0);};}exports['index']=function(_0x4aea43,_0x1c8b91){var _0x1ee430={},_0x61233c={},_0xe83ef3={'count':0x0,'rows':[]};var _0x24a80a=_[_0x2ac5('0x26')](db[_0x2ac5('0x27')][_0x2ac5('0x28')],function(_0x270673){return{'name':_0x270673[_0x2ac5('0x29')],'type':_0x270673[_0x2ac5('0x2a')][_0x2ac5('0x2b')]};});_0x61233c[_0x2ac5('0x2c')]=_[_0x2ac5('0x26')](_0x24a80a,_0x2ac5('0x24'));_0x61233c[_0x2ac5('0x2d')]=_['keys'](_0x4aea43[_0x2ac5('0x2d')]);_0x61233c['filters']=_[_0x2ac5('0x2e')](_0x61233c[_0x2ac5('0x2c')],_0x61233c[_0x2ac5('0x2d')]);_0x1ee430[_0x2ac5('0x2f')]=_[_0x2ac5('0x2e')](_0x61233c[_0x2ac5('0x2c')],qs[_0x2ac5('0x30')](_0x4aea43['query'][_0x2ac5('0x30')]));_0x1ee430[_0x2ac5('0x2f')]=_0x1ee430[_0x2ac5('0x2f')][_0x2ac5('0x31')]?_0x1ee430[_0x2ac5('0x2f')]:_0x61233c[_0x2ac5('0x2c')];if(!_0x4aea43['query'][_0x2ac5('0x32')](_0x2ac5('0x33'))){_0x1ee430['limit']=qs['limit'](_0x4aea43[_0x2ac5('0x2d')][_0x2ac5('0x34')]);_0x1ee430['offset']=qs[_0x2ac5('0x1c')](_0x4aea43[_0x2ac5('0x2d')][_0x2ac5('0x1c')]);}_0x1ee430[_0x2ac5('0x35')]=qs['sort'](_0x4aea43[_0x2ac5('0x2d')][_0x2ac5('0x36')]);_0x1ee430[_0x2ac5('0x37')]=qs[_0x2ac5('0x38')](_['pick'](_0x4aea43[_0x2ac5('0x2d')],_0x61233c[_0x2ac5('0x38')]),_0x24a80a);if(_0x4aea43[_0x2ac5('0x2d')]['filter']){_0x1ee430[_0x2ac5('0x37')]=_[_0x2ac5('0x39')](_0x1ee430[_0x2ac5('0x37')],{'$or':_[_0x2ac5('0x26')](_0x24a80a,function(_0xbb3ca1){if(_0xbb3ca1['type']!==_0x2ac5('0x3a')){var _0x110e82={};_0x110e82[_0xbb3ca1[_0x2ac5('0x24')]]={'$like':'%'+_0x4aea43[_0x2ac5('0x2d')]['filter']+'%'};return _0x110e82;}})});}_0x1ee430=_[_0x2ac5('0x39')]({},_0x1ee430,_0x4aea43[_0x2ac5('0x3b')]);var _0x454bbf={'where':_0x1ee430[_0x2ac5('0x37')]};return db['MailSubstatus'][_0x2ac5('0x1b')](_0x454bbf)[_0x2ac5('0x20')](function(_0x168410){_0xe83ef3[_0x2ac5('0x1b')]=_0x168410;if(_0x4aea43[_0x2ac5('0x2d')][_0x2ac5('0x3c')]){_0x1ee430[_0x2ac5('0x3d')]=[{'all':!![]}];}return db[_0x2ac5('0x27')][_0x2ac5('0x3e')](_0x1ee430);})['then'](function(_0x566396){_0xe83ef3[_0x2ac5('0x3f')]=_0x566396;return _0xe83ef3;})[_0x2ac5('0x20')](respondWithFilteredResult(_0x1c8b91,_0x1ee430))['catch'](handleError(_0x1c8b91,null));};exports[_0x2ac5('0x40')]=function(_0x122f5a,_0x16cd94){var _0x23bc99={'raw':!![],'where':{'id':_0x122f5a[_0x2ac5('0x41')]['id']}},_0x58a90c={};_0x58a90c['model']=_[_0x2ac5('0x42')](db[_0x2ac5('0x27')][_0x2ac5('0x28')]);_0x58a90c[_0x2ac5('0x2d')]=_[_0x2ac5('0x42')](_0x122f5a[_0x2ac5('0x2d')]);_0x58a90c[_0x2ac5('0x38')]=_[_0x2ac5('0x2e')](_0x58a90c[_0x2ac5('0x2c')],_0x58a90c[_0x2ac5('0x2d')]);_0x23bc99[_0x2ac5('0x2f')]=_['intersection'](_0x58a90c['model'],qs[_0x2ac5('0x30')](_0x122f5a[_0x2ac5('0x2d')][_0x2ac5('0x30')]));_0x23bc99[_0x2ac5('0x2f')]=_0x23bc99['attributes']['length']?_0x23bc99[_0x2ac5('0x2f')]:_0x58a90c[_0x2ac5('0x2c')];if(_0x122f5a[_0x2ac5('0x2d')]['includeAll']){_0x23bc99[_0x2ac5('0x3d')]=[{'all':!![]}];}_0x23bc99=_[_0x2ac5('0x39')]({},_0x23bc99,_0x122f5a['options']);return db['MailSubstatus'][_0x2ac5('0x43')](_0x23bc99)[_0x2ac5('0x20')](handleEntityNotFound(_0x16cd94,null))[_0x2ac5('0x20')](respondWithResult(_0x16cd94,null))[_0x2ac5('0x44')](handleError(_0x16cd94,null));};exports[_0x2ac5('0x45')]=function(_0x2b444f,_0x2c0b3c){return db[_0x2ac5('0x27')][_0x2ac5('0x45')](_0x2b444f[_0x2ac5('0x46')],{})[_0x2ac5('0x20')](respondWithResult(_0x2c0b3c,0xc9))['catch'](handleError(_0x2c0b3c,null));};exports[_0x2ac5('0x1f')]=function(_0x1c135f,_0x231c4d){if(_0x1c135f['body']['id']){delete _0x1c135f[_0x2ac5('0x46')]['id'];}return db[_0x2ac5('0x27')][_0x2ac5('0x43')]({'where':{'id':_0x1c135f[_0x2ac5('0x41')]['id']}})['then'](handleEntityNotFound(_0x231c4d,null))['then'](saveUpdates(_0x1c135f['body'],null))[_0x2ac5('0x20')](respondWithResult(_0x231c4d,null))['catch'](handleError(_0x231c4d,null));};exports[_0x2ac5('0x21')]=function(_0x12e6fd,_0x11a377){return db[_0x2ac5('0x27')][_0x2ac5('0x43')]({'where':{'id':_0x12e6fd['params']['id']}})[_0x2ac5('0x20')](handleEntityNotFound(_0x11a377,null))[_0x2ac5('0x20')](removeEntity(_0x11a377,null))[_0x2ac5('0x44')](handleError(_0x11a377,null));};exports[_0x2ac5('0x47')]=function(_0x4ce791,_0x57f390){return db[_0x2ac5('0x27')]['describe']()[_0x2ac5('0x20')](respondWithResult(_0x57f390,null))[_0x2ac5('0x44')](handleError(_0x57f390,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1a9b04e..928ffb3 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 _0xcefd=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','lodash','util','../../config/logger'];(function(_0x2167f3,_0x43e9d2){var _0x47360b=function(_0x3e043e){while(--_0x3e043e){_0x2167f3['push'](_0x2167f3['shift']());}};_0x47360b(++_0x43e9d2);}(_0xcefd,0x126));var _0xdcef=function(_0x380501,_0x3babe6){_0x380501=_0x380501-0x0;var _0x1950d1=_0xcefd[_0x380501];return _0x1950d1;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var logger=require(_0xdcef('0x2'))('api');var moment=require(_0xdcef('0x3'));var BPromise=require(_0xdcef('0x4'));var rp=require(_0xdcef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcef('0x6'));var config=require(_0xdcef('0x7'));var attributes=require(_0xdcef('0x8'));module['exports']=function(_0x2043a4,_0xcaa40a){return _0x2043a4[_0xdcef('0x9')](_0xdcef('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x253d=['exports','define','MailSubstatus','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x253d,0x1b3));var _0xd253=function(_0x3a4949,_0x3dffa6){_0x3a4949=_0x3a4949-0x0;var _0xcdadf=_0x253d[_0x3a4949];return _0xcdadf;};'use strict';var _=require(_0xd253('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd253('0x1'));var rp=require(_0xd253('0x2'));var fs=require('fs');var path=require(_0xd253('0x3'));var rimraf=require(_0xd253('0x4'));var config=require(_0xd253('0x5'));var attributes=require('./mailSubstatus.attributes');module[_0xd253('0x6')]=function(_0x42d36c,_0x3dca3d){return _0x42d36c[_0xd253('0x7')](_0xd253('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 05a0525..c1a3e15 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x27e242,_0x48b753){var _0x5a07d4=function(_0x162df5){while(--_0x162df5){_0x27e242['push'](_0x27e242['shift']());}};_0x5a07d4(++_0x48b753);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4424b0,_0x4e5641){_0x4424b0=_0x4424b0-0x0;var _0x49340=_0xd2ea[_0x4424b0];return _0x49340;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0x0713=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x245414,_0x2915dc){var _0x14c2a5=function(_0x204928){while(--_0x204928){_0x245414['push'](_0x245414['shift']());}};_0x14c2a5(++_0x2915dc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 348032c..8083933 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 _0xf91b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ca891,_0x134385){var _0x3c4979=function(_0x4a99d3){while(--_0x4a99d3){_0x3ca891['push'](_0x3ca891['shift']());}};_0x3c4979(++_0x134385);}(_0xf91b,0x1e3));var _0xbf91=function(_0x4889f9,_0x28a8b9){_0x4889f9=_0x4889f9-0x0;var _0x1be12d=_0xf91b[_0x4889f9];return _0x1be12d;};'use strict';var multer=require('multer');var util=require(_0xbf91('0x0'));var path=require(_0xbf91('0x1'));var timeout=require(_0xbf91('0x2'));var express=require(_0xbf91('0x3'));var router=express[_0xbf91('0x4')]();var auth=require(_0xbf91('0x5'));var interaction=require(_0xbf91('0x6'));var config=require('../../config/environment');var controller=require(_0xbf91('0x7'));router[_0xbf91('0x8')]('/',auth['isAuthenticated'](),controller[_0xbf91('0x9')]);router[_0xbf91('0x8')](_0xbf91('0xa'),auth[_0xbf91('0xb')](),controller['describe']);router[_0xbf91('0x8')](_0xbf91('0xc'),auth['isAuthenticated'](),controller[_0xbf91('0xd')]);router[_0xbf91('0xe')]('/',auth[_0xbf91('0xb')](),controller[_0xbf91('0xf')]);router[_0xbf91('0x10')](_0xbf91('0xc'),auth[_0xbf91('0xb')](),controller[_0xbf91('0x11')]);router[_0xbf91('0x12')](_0xbf91('0xc'),auth['isAuthenticated'](),controller[_0xbf91('0x13')]);module[_0xbf91('0x14')]=router; \ No newline at end of file +var _0x560e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x4f8b6a,_0x2ead69){var _0x192d31=function(_0x43058f){while(--_0x43058f){_0x4f8b6a['push'](_0x4f8b6a['shift']());}};_0x192d31(++_0x2ead69);}(_0x560e,0xdb));var _0xe560=function(_0x15bbdd,_0x2ffbcb){_0x15bbdd=_0x15bbdd-0x0;var _0x3fff9c=_0x560e[_0x15bbdd];return _0x3fff9c;};'use strict';var multer=require(_0xe560('0x0'));var util=require('util');var path=require(_0xe560('0x1'));var timeout=require(_0xe560('0x2'));var express=require(_0xe560('0x3'));var router=express[_0xe560('0x4')]();var auth=require(_0xe560('0x5'));var interaction=require(_0xe560('0x6'));var config=require(_0xe560('0x7'));var controller=require(_0xe560('0x8'));router[_0xe560('0x9')]('/',auth[_0xe560('0xa')](),controller[_0xe560('0xb')]);router[_0xe560('0x9')](_0xe560('0xc'),auth[_0xe560('0xa')](),controller[_0xe560('0xd')]);router['get'](_0xe560('0xe'),auth[_0xe560('0xa')](),controller[_0xe560('0xf')]);router[_0xe560('0x10')]('/',auth['isAuthenticated'](),controller[_0xe560('0x11')]);router['put'](_0xe560('0xe'),auth[_0xe560('0xa')](),controller[_0xe560('0x12')]);router[_0xe560('0x13')](_0xe560('0xe'),auth['isAuthenticated'](),controller[_0xe560('0x14')]);module[_0xe560('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 0960416..1a18184 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 _0xf5df=['moment','sequelize','exports','ENUM','agent','queue','DATE'];(function(_0x47ced5,_0x2e038a){var _0x1d6d37=function(_0x53c612){while(--_0x53c612){_0x47ced5['push'](_0x47ced5['shift']());}};_0x1d6d37(++_0x2e038a);}(_0xf5df,0x126));var _0xff5d=function(_0x1fb6d6,_0x1f3fe3){_0x1fb6d6=_0x1fb6d6-0x0;var _0x2730d8=_0xf5df[_0x1fb6d6];return _0x2730d8;};'use strict';var moment=require(_0xff5d('0x0'));var Sequelize=require(_0xff5d('0x1'));module[_0xff5d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xff5d('0x3')]('account',_0xff5d('0x4'),'queue'),'allowNull':![],'defaultValue':_0xff5d('0x5')},'transferredAt':{'type':Sequelize[_0xff5d('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x71d7=['ENUM','account','queue','DATE','moment','STRING'];(function(_0x5661e6,_0x5cd714){var _0x3d456d=function(_0x409291){while(--_0x409291){_0x5661e6['push'](_0x5661e6['shift']());}};_0x3d456d(++_0x5cd714);}(_0x71d7,0x148));var _0x771d=function(_0x1ece97,_0x1b135d){_0x1ece97=_0x1ece97-0x0;var _0x4e4b91=_0x71d7[_0x1ece97];return _0x4e4b91;};'use strict';var moment=require(_0x771d('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x771d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x771d('0x2')](_0x771d('0x3'),'agent',_0x771d('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x771d('0x5')],'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 b2ce846..67b6600 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 _0xb5e1=['rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','count','include','findAll','rows','catch','length','includeAll','options','create','body','params','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','end','error','name','send','index','map','MailTransferReport'];(function(_0x4ec216,_0xa8ac4d){var _0x24d4d5=function(_0x166eb7){while(--_0x166eb7){_0x4ec216['push'](_0x4ec216['shift']());}};_0x24d4d5(++_0xa8ac4d);}(_0xb5e1,0x1e2));var _0x1b5e=function(_0x3b050f,_0x163d0){_0x3b050f=_0x3b050f-0x0;var _0x10637d=_0xb5e1[_0x3b050f];return _0x10637d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b5e('0x0'));var rimraf=require(_0x1b5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b5e('0x2'));var moment=require(_0x1b5e('0x3'));var BPromise=require(_0x1b5e('0x4'));var Mustache=require(_0x1b5e('0x5'));var util=require(_0x1b5e('0x6'));var path=require(_0x1b5e('0x7'));var sox=require(_0x1b5e('0x8'));var csv=require(_0x1b5e('0x9'));var ejs=require(_0x1b5e('0xa'));var fs=require('fs');var _=require(_0x1b5e('0xb'));var squel=require('squel');var crypto=require(_0x1b5e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1b5e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1b5e('0xe'));var Papa=require(_0x1b5e('0xf'));var Redis=require('ioredis');var authService=require(_0x1b5e('0x10'));var qs=require(_0x1b5e('0x11'));var as=require(_0x1b5e('0x12'));var hardwareService=require(_0x1b5e('0x13'));var logger=require(_0x1b5e('0x14'))(_0x1b5e('0x15'));var utils=require(_0x1b5e('0x16'));var config=require(_0x1b5e('0x17'));var db=require(_0x1b5e('0x18'))['db'];function respondWithStatusCode(_0x53d4ae,_0x57d7b8){_0x57d7b8=_0x57d7b8||0xcc;return function(_0x42e496){if(_0x42e496){return _0x53d4ae[_0x1b5e('0x19')](_0x57d7b8);}return _0x53d4ae[_0x1b5e('0x1a')](_0x57d7b8)['end']();};}function respondWithResult(_0x4d10d5,_0x57cb34){_0x57cb34=_0x57cb34||0xc8;return function(_0x431455){if(_0x431455){return _0x4d10d5[_0x1b5e('0x1a')](_0x57cb34)[_0x1b5e('0x1b')](_0x431455);}};}function respondWithFilteredResult(_0x597423,_0x23353a){return function(_0x2e4b64){if(_0x2e4b64){var _0x24d5dd=_0x2e4b64['count'],_0x2ab1c6=_0x23353a[_0x1b5e('0x1c')],_0x2c558d=_0x23353a['offset']+_0x23353a[_0x1b5e('0x1d')],_0x42d32d;if(_0x2c558d>=_0x24d5dd){_0x2c558d=_0x24d5dd;_0x42d32d=0xc8;}else{_0x42d32d=0xce;}_0x597423[_0x1b5e('0x1a')](_0x42d32d);return _0x597423[_0x1b5e('0x1e')](_0x1b5e('0x1f'),_0x2ab1c6+'-'+_0x2c558d+'/'+_0x24d5dd)[_0x1b5e('0x1b')](_0x2e4b64);}return null;};}function patchUpdates(_0x53dc21){return function(_0x4a539b){try{jsonpatch[_0x1b5e('0x20')](_0x4a539b,_0x53dc21,!![]);}catch(_0xf50c3e){return BPromise[_0x1b5e('0x21')](_0xf50c3e);}return _0x4a539b['save']();};}function saveUpdates(_0x5a24ec,_0xe9e4fc){return function(_0x48f95b){if(_0x48f95b){return _0x48f95b[_0x1b5e('0x22')](_0x5a24ec)[_0x1b5e('0x23')](function(_0x504c21){return _0x504c21;});}return null;};}function removeEntity(_0x57a69c,_0x271fd5){return function(_0x1b20e8){if(_0x1b20e8){return _0x1b20e8['destroy']()[_0x1b5e('0x23')](function(){_0x57a69c[_0x1b5e('0x1a')](0xcc)[_0x1b5e('0x24')]();});}};}function handleEntityNotFound(_0x56c844,_0x1b58ce){return function(_0x2d3217){if(!_0x2d3217){_0x56c844[_0x1b5e('0x19')](0x194);}return _0x2d3217;};}function handleError(_0xdc36e8,_0x135db8){_0x135db8=_0x135db8||0x1f4;return function(_0x17d776){logger[_0x1b5e('0x25')](_0x17d776['stack']);if(_0x17d776['name']){delete _0x17d776[_0x1b5e('0x26')];}_0xdc36e8[_0x1b5e('0x1a')](_0x135db8)[_0x1b5e('0x27')](_0x17d776);};}exports[_0x1b5e('0x28')]=function(_0x518c36,_0x43d85a){var _0x5e921e={},_0x1d5bcf={},_0x40a04f={'count':0x0,'rows':[]};var _0x42e0ff=_[_0x1b5e('0x29')](db[_0x1b5e('0x2a')][_0x1b5e('0x2b')],function(_0x4b32ab){return{'name':_0x4b32ab[_0x1b5e('0x2c')],'type':_0x4b32ab['type'][_0x1b5e('0x2d')]};});_0x1d5bcf['model']=_[_0x1b5e('0x29')](_0x42e0ff,_0x1b5e('0x26'));_0x1d5bcf['query']=_[_0x1b5e('0x2e')](_0x518c36[_0x1b5e('0x2f')]);_0x1d5bcf[_0x1b5e('0x30')]=_[_0x1b5e('0x31')](_0x1d5bcf[_0x1b5e('0x32')],_0x1d5bcf[_0x1b5e('0x2f')]);_0x5e921e[_0x1b5e('0x33')]=_[_0x1b5e('0x31')](_0x1d5bcf[_0x1b5e('0x32')],qs[_0x1b5e('0x34')](_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x34')]));_0x5e921e[_0x1b5e('0x33')]=_0x5e921e['attributes']['length']?_0x5e921e[_0x1b5e('0x33')]:_0x1d5bcf[_0x1b5e('0x32')];if(!_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x35')]('nolimit')){_0x5e921e['limit']=qs[_0x1b5e('0x1d')](_0x518c36['query'][_0x1b5e('0x1d')]);_0x5e921e[_0x1b5e('0x1c')]=qs['offset'](_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x1c')]);}_0x5e921e[_0x1b5e('0x36')]=qs[_0x1b5e('0x37')](_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x37')]);_0x5e921e['where']=qs[_0x1b5e('0x30')](_[_0x1b5e('0x38')](_0x518c36[_0x1b5e('0x2f')],_0x1d5bcf[_0x1b5e('0x30')]),_0x42e0ff);if(_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x39')]){_0x5e921e[_0x1b5e('0x3a')]=_[_0x1b5e('0x3b')](_0x5e921e[_0x1b5e('0x3a')],{'$or':_[_0x1b5e('0x29')](_0x42e0ff,function(_0x285f4d){if(_0x285f4d[_0x1b5e('0x3c')]!==_0x1b5e('0x3d')){var _0x2cd2f8={};_0x2cd2f8[_0x285f4d[_0x1b5e('0x26')]]={'$like':'%'+_0x518c36[_0x1b5e('0x2f')][_0x1b5e('0x39')]+'%'};return _0x2cd2f8;}})});}_0x5e921e=_['merge']({},_0x5e921e,_0x518c36['options']);var _0x9e18dc={'where':_0x5e921e[_0x1b5e('0x3a')]};return db[_0x1b5e('0x2a')][_0x1b5e('0x3e')](_0x9e18dc)[_0x1b5e('0x23')](function(_0x17d02){_0x40a04f[_0x1b5e('0x3e')]=_0x17d02;if(_0x518c36['query']['includeAll']){_0x5e921e[_0x1b5e('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0x1b5e('0x40')](_0x5e921e);})[_0x1b5e('0x23')](function(_0x29256e){_0x40a04f[_0x1b5e('0x41')]=_0x29256e;return _0x40a04f;})[_0x1b5e('0x23')](respondWithFilteredResult(_0x43d85a,_0x5e921e))[_0x1b5e('0x42')](handleError(_0x43d85a,null));};exports['show']=function(_0x18a54c,_0x1305d9){var _0x292e00={'raw':!![],'where':{'id':_0x18a54c['params']['id']}},_0x3347a6={};_0x3347a6[_0x1b5e('0x32')]=_[_0x1b5e('0x2e')](db['MailTransferReport']['rawAttributes']);_0x3347a6[_0x1b5e('0x2f')]=_[_0x1b5e('0x2e')](_0x18a54c[_0x1b5e('0x2f')]);_0x3347a6['filters']=_['intersection'](_0x3347a6[_0x1b5e('0x32')],_0x3347a6['query']);_0x292e00[_0x1b5e('0x33')]=_[_0x1b5e('0x31')](_0x3347a6[_0x1b5e('0x32')],qs[_0x1b5e('0x34')](_0x18a54c[_0x1b5e('0x2f')]['fields']));_0x292e00[_0x1b5e('0x33')]=_0x292e00[_0x1b5e('0x33')][_0x1b5e('0x43')]?_0x292e00[_0x1b5e('0x33')]:_0x3347a6[_0x1b5e('0x32')];if(_0x18a54c['query'][_0x1b5e('0x44')]){_0x292e00[_0x1b5e('0x3f')]=[{'all':!![]}];}_0x292e00=_[_0x1b5e('0x3b')]({},_0x292e00,_0x18a54c[_0x1b5e('0x45')]);return db[_0x1b5e('0x2a')]['find'](_0x292e00)[_0x1b5e('0x23')](handleEntityNotFound(_0x1305d9,null))['then'](respondWithResult(_0x1305d9,null))[_0x1b5e('0x42')](handleError(_0x1305d9,null));};exports[_0x1b5e('0x46')]=function(_0x37b4f4,_0x38d6fc){return db['MailTransferReport'][_0x1b5e('0x46')](_0x37b4f4[_0x1b5e('0x47')],{})[_0x1b5e('0x23')](respondWithResult(_0x38d6fc,0xc9))[_0x1b5e('0x42')](handleError(_0x38d6fc,null));};exports[_0x1b5e('0x22')]=function(_0x34a6f7,_0x4b1380){if(_0x34a6f7[_0x1b5e('0x47')]['id']){delete _0x34a6f7['body']['id'];}return db[_0x1b5e('0x2a')]['find']({'where':{'id':_0x34a6f7[_0x1b5e('0x48')]['id']}})[_0x1b5e('0x23')](handleEntityNotFound(_0x4b1380,null))[_0x1b5e('0x23')](saveUpdates(_0x34a6f7[_0x1b5e('0x47')],null))[_0x1b5e('0x23')](respondWithResult(_0x4b1380,null))[_0x1b5e('0x42')](handleError(_0x4b1380,null));};exports['destroy']=function(_0x253f17,_0x2d5d54){return db[_0x1b5e('0x2a')][_0x1b5e('0x49')]({'where':{'id':_0x253f17[_0x1b5e('0x48')]['id']}})[_0x1b5e('0x23')](handleEntityNotFound(_0x2d5d54,null))[_0x1b5e('0x23')](removeEntity(_0x2d5d54,null))['catch'](handleError(_0x2d5d54,null));};exports[_0x1b5e('0x4a')]=function(_0x594f36,_0x1e7253){return db[_0x1b5e('0x2a')][_0x1b5e('0x4a')]()[_0x1b5e('0x23')](respondWithResult(_0x1e7253,null))[_0x1b5e('0x42')](handleError(_0x1e7253,null));}; \ No newline at end of file +var _0x315b=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','update','body','params','describe','eml-format','rimraf','zip-dir','moment','mustache','util'];(function(_0x1c0781,_0x4a19f1){var _0x1f577e=function(_0x396577){while(--_0x396577){_0x1c0781['push'](_0x1c0781['shift']());}};_0x1f577e(++_0x4a19f1);}(_0x315b,0x88));var _0xb315=function(_0x160eb5,_0x191ca9){_0x160eb5=_0x160eb5-0x0;var _0x33d9f5=_0x315b[_0x160eb5];return _0x33d9f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb315('0x0'));var rimraf=require(_0xb315('0x1'));var zipdir=require(_0xb315('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb315('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb315('0x4'));var util=require(_0xb315('0x5'));var path=require('path');var sox=require(_0xb315('0x6'));var csv=require(_0xb315('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb315('0x8'));var squel=require(_0xb315('0x9'));var crypto=require(_0xb315('0xa'));var jsforce=require(_0xb315('0xb'));var deskjs=require(_0xb315('0xc'));var toCsv=require(_0xb315('0x7'));var querystring=require(_0xb315('0xd'));var Papa=require('papaparse');var Redis=require(_0xb315('0xe'));var authService=require(_0xb315('0xf'));var qs=require(_0xb315('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb315('0x11'));var logger=require(_0xb315('0x12'))('api');var utils=require(_0xb315('0x13'));var config=require('../../config/environment');var db=require(_0xb315('0x14'))['db'];function respondWithStatusCode(_0x446585,_0x4cd375){_0x4cd375=_0x4cd375||0xcc;return function(_0x413ed7){if(_0x413ed7){return _0x446585[_0xb315('0x15')](_0x4cd375);}return _0x446585['status'](_0x4cd375)[_0xb315('0x16')]();};}function respondWithResult(_0x42fc30,_0x1a09a1){_0x1a09a1=_0x1a09a1||0xc8;return function(_0x1b1abb){if(_0x1b1abb){return _0x42fc30[_0xb315('0x17')](_0x1a09a1)['json'](_0x1b1abb);}};}function respondWithFilteredResult(_0x3716c0,_0xaa8789){return function(_0x2c15eb){if(_0x2c15eb){var _0x288d7d=_0x2c15eb[_0xb315('0x18')],_0x37ca92=_0xaa8789[_0xb315('0x19')],_0x467343=_0xaa8789['offset']+_0xaa8789[_0xb315('0x1a')],_0x5145b6;if(_0x467343>=_0x288d7d){_0x467343=_0x288d7d;_0x5145b6=0xc8;}else{_0x5145b6=0xce;}_0x3716c0[_0xb315('0x17')](_0x5145b6);return _0x3716c0[_0xb315('0x1b')](_0xb315('0x1c'),_0x37ca92+'-'+_0x467343+'/'+_0x288d7d)['json'](_0x2c15eb);}return null;};}function patchUpdates(_0x4aa69f){return function(_0x4b2e00){try{jsonpatch[_0xb315('0x1d')](_0x4b2e00,_0x4aa69f,!![]);}catch(_0x43af9e){return BPromise[_0xb315('0x1e')](_0x43af9e);}return _0x4b2e00[_0xb315('0x1f')]();};}function saveUpdates(_0x36a6e4,_0x24d048){return function(_0x16246a){if(_0x16246a){return _0x16246a['update'](_0x36a6e4)['then'](function(_0x42a984){return _0x42a984;});}return null;};}function removeEntity(_0x20b50b,_0x1496d6){return function(_0x59045b){if(_0x59045b){return _0x59045b[_0xb315('0x20')]()[_0xb315('0x21')](function(){_0x20b50b[_0xb315('0x17')](0xcc)[_0xb315('0x16')]();});}};}function handleEntityNotFound(_0x27260b,_0x545656){return function(_0x1d8039){if(!_0x1d8039){_0x27260b['sendStatus'](0x194);}return _0x1d8039;};}function handleError(_0x1bd635,_0x5ecf88){_0x5ecf88=_0x5ecf88||0x1f4;return function(_0x55fe25){logger[_0xb315('0x22')](_0x55fe25[_0xb315('0x23')]);if(_0x55fe25[_0xb315('0x24')]){delete _0x55fe25[_0xb315('0x24')];}_0x1bd635['status'](_0x5ecf88)[_0xb315('0x25')](_0x55fe25);};}exports[_0xb315('0x26')]=function(_0x2bfc43,_0x1d4f10){var _0x255b48={},_0x292e03={},_0x455be5={'count':0x0,'rows':[]};var _0x48b5d3=_[_0xb315('0x27')](db[_0xb315('0x28')][_0xb315('0x29')],function(_0x5db011){return{'name':_0x5db011[_0xb315('0x2a')],'type':_0x5db011[_0xb315('0x2b')][_0xb315('0x2c')]};});_0x292e03['model']=_['map'](_0x48b5d3,_0xb315('0x24'));_0x292e03[_0xb315('0x2d')]=_[_0xb315('0x2e')](_0x2bfc43['query']);_0x292e03[_0xb315('0x2f')]=_[_0xb315('0x30')](_0x292e03[_0xb315('0x31')],_0x292e03[_0xb315('0x2d')]);_0x255b48[_0xb315('0x32')]=_[_0xb315('0x30')](_0x292e03[_0xb315('0x31')],qs[_0xb315('0x33')](_0x2bfc43[_0xb315('0x2d')][_0xb315('0x33')]));_0x255b48[_0xb315('0x32')]=_0x255b48['attributes'][_0xb315('0x34')]?_0x255b48[_0xb315('0x32')]:_0x292e03[_0xb315('0x31')];if(!_0x2bfc43[_0xb315('0x2d')][_0xb315('0x35')]('nolimit')){_0x255b48['limit']=qs[_0xb315('0x1a')](_0x2bfc43['query'][_0xb315('0x1a')]);_0x255b48[_0xb315('0x19')]=qs['offset'](_0x2bfc43[_0xb315('0x2d')][_0xb315('0x19')]);}_0x255b48['order']=qs[_0xb315('0x36')](_0x2bfc43['query']['sort']);_0x255b48[_0xb315('0x37')]=qs[_0xb315('0x2f')](_[_0xb315('0x38')](_0x2bfc43[_0xb315('0x2d')],_0x292e03[_0xb315('0x2f')]),_0x48b5d3);if(_0x2bfc43[_0xb315('0x2d')][_0xb315('0x39')]){_0x255b48[_0xb315('0x37')]=_['merge'](_0x255b48[_0xb315('0x37')],{'$or':_[_0xb315('0x27')](_0x48b5d3,function(_0x4f4732){if(_0x4f4732[_0xb315('0x2b')]!==_0xb315('0x3a')){var _0x487823={};_0x487823[_0x4f4732[_0xb315('0x24')]]={'$like':'%'+_0x2bfc43[_0xb315('0x2d')]['filter']+'%'};return _0x487823;}})});}_0x255b48=_[_0xb315('0x3b')]({},_0x255b48,_0x2bfc43['options']);var _0x2a67fe={'where':_0x255b48['where']};return db['MailTransferReport'][_0xb315('0x18')](_0x2a67fe)[_0xb315('0x21')](function(_0x307989){_0x455be5['count']=_0x307989;if(_0x2bfc43['query'][_0xb315('0x3c')]){_0x255b48[_0xb315('0x3d')]=[{'all':!![]}];}return db[_0xb315('0x28')][_0xb315('0x3e')](_0x255b48);})[_0xb315('0x21')](function(_0x1c30b2){_0x455be5[_0xb315('0x3f')]=_0x1c30b2;return _0x455be5;})[_0xb315('0x21')](respondWithFilteredResult(_0x1d4f10,_0x255b48))[_0xb315('0x40')](handleError(_0x1d4f10,null));};exports[_0xb315('0x41')]=function(_0x317b25,_0xc9866a){var _0x208252={'raw':!![],'where':{'id':_0x317b25['params']['id']}},_0x331055={};_0x331055[_0xb315('0x31')]=_['keys'](db[_0xb315('0x28')]['rawAttributes']);_0x331055[_0xb315('0x2d')]=_[_0xb315('0x2e')](_0x317b25['query']);_0x331055[_0xb315('0x2f')]=_[_0xb315('0x30')](_0x331055[_0xb315('0x31')],_0x331055['query']);_0x208252[_0xb315('0x32')]=_[_0xb315('0x30')](_0x331055[_0xb315('0x31')],qs[_0xb315('0x33')](_0x317b25[_0xb315('0x2d')][_0xb315('0x33')]));_0x208252['attributes']=_0x208252['attributes'][_0xb315('0x34')]?_0x208252[_0xb315('0x32')]:_0x331055['model'];if(_0x317b25[_0xb315('0x2d')]['includeAll']){_0x208252[_0xb315('0x3d')]=[{'all':!![]}];}_0x208252=_['merge']({},_0x208252,_0x317b25['options']);return db[_0xb315('0x28')][_0xb315('0x42')](_0x208252)[_0xb315('0x21')](handleEntityNotFound(_0xc9866a,null))[_0xb315('0x21')](respondWithResult(_0xc9866a,null))['catch'](handleError(_0xc9866a,null));};exports['create']=function(_0x4d896d,_0x5800ba){return db[_0xb315('0x28')]['create'](_0x4d896d['body'],{})['then'](respondWithResult(_0x5800ba,0xc9))[_0xb315('0x40')](handleError(_0x5800ba,null));};exports[_0xb315('0x43')]=function(_0x1a41e3,_0x3825bd){if(_0x1a41e3[_0xb315('0x44')]['id']){delete _0x1a41e3[_0xb315('0x44')]['id'];}return db[_0xb315('0x28')][_0xb315('0x42')]({'where':{'id':_0x1a41e3[_0xb315('0x45')]['id']}})[_0xb315('0x21')](handleEntityNotFound(_0x3825bd,null))['then'](saveUpdates(_0x1a41e3[_0xb315('0x44')],null))[_0xb315('0x21')](respondWithResult(_0x3825bd,null))['catch'](handleError(_0x3825bd,null));};exports[_0xb315('0x20')]=function(_0x16c44f,_0x2337e7){return db['MailTransferReport'][_0xb315('0x42')]({'where':{'id':_0x16c44f[_0xb315('0x45')]['id']}})['then'](handleEntityNotFound(_0x2337e7,null))[_0xb315('0x21')](removeEntity(_0x2337e7,null))[_0xb315('0x40')](handleError(_0x2337e7,null));};exports[_0xb315('0x46')]=function(_0x31214b,_0xad6b5b){return db['MailTransferReport'][_0xb315('0x46')]()[_0xb315('0x21')](respondWithResult(_0xad6b5b,null))[_0xb315('0x40')](handleError(_0xad6b5b,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 3359d89..9a4b0fb 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 _0x9ab8=['./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xe44d26,_0x106176){var _0x20cd35=function(_0x43c795){while(--_0x43c795){_0xe44d26['push'](_0xe44d26['shift']());}};_0x20cd35(++_0x106176);}(_0x9ab8,0x10d));var _0x89ab=function(_0xc47f48,_0x57254a){_0xc47f48=_0xc47f48-0x0;var _0x5e4f71=_0x9ab8[_0xc47f48];return _0x5e4f71;};'use strict';var _=require(_0x89ab('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x89ab('0x1'));var BPromise=require(_0x89ab('0x2'));var rp=require(_0x89ab('0x3'));var fs=require('fs');var path=require(_0x89ab('0x4'));var rimraf=require(_0x89ab('0x5'));var config=require(_0x89ab('0x6'));var attributes=require(_0x89ab('0x7'));module[_0x89ab('0x8')]=function(_0x2c35a3,_0x4f7d46){return _0x2c35a3['define'](_0x89ab('0x9'),attributes,{'tableName':_0x89ab('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x89ab('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x321b=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailTransferReport.attributes','exports','define'];(function(_0x241422,_0x309162){var _0x3cd5d1=function(_0x3dbd59){while(--_0x3dbd59){_0x241422['push'](_0x241422['shift']());}};_0x3cd5d1(++_0x309162);}(_0x321b,0x6b));var _0xb321=function(_0xafb198,_0xc62598){_0xafb198=_0xafb198-0x0;var _0x1d5a7f=_0x321b[_0xafb198];return _0x1d5a7f;};'use strict';var _=require(_0xb321('0x0'));var util=require(_0xb321('0x1'));var logger=require(_0xb321('0x2'))(_0xb321('0x3'));var moment=require('moment');var BPromise=require(_0xb321('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb321('0x5'));var rimraf=require(_0xb321('0x6'));var config=require('../../config/environment');var attributes=require(_0xb321('0x7'));module[_0xb321('0x8')]=function(_0x37f407,_0x209679){return _0x37f407[_0xb321('0x9')](_0xb321('0xa'),attributes,{'tableName':_0xb321('0xb'),'paranoid':![],'indexes':[{'name':_0xb321('0xc'),'fields':[_0xb321('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 67dacf5..9ab0f77 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 _0x5897=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3c9639,_0x4643dc){var _0x2a1aaf=function(_0xe7e7e4){while(--_0xe7e7e4){_0x3c9639['push'](_0x3c9639['shift']());}};_0x2a1aaf(++_0x4643dc);}(_0x5897,0x66));var _0x7589=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x5897[_0x47a40b];return _0x19610c;};'use strict';var _=require(_0x7589('0x0'));var util=require(_0x7589('0x1'));var moment=require(_0x7589('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7589('0x3'));var db=require(_0x7589('0x4'))['db'];var utils=require(_0x7589('0x5'));var logger=require(_0x7589('0x6'))(_0x7589('0x7'));var config=require(_0x7589('0x8'));var jayson=require(_0x7589('0x9'));var client=jayson['client'][_0x7589('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e777d,_0x1f005f,_0x420754){return new BPromise(function(_0x9c4683,_0x4ce3e){return client[_0x7589('0xb')](_0x2e777d,_0x420754)[_0x7589('0xc')](function(_0x489f8e){logger[_0x7589('0xd')](_0x7589('0xe'),_0x1f005f,_0x7589('0xf'));logger[_0x7589('0x10')](_0x7589('0x11'),_0x1f005f,_0x7589('0xf'),JSON[_0x7589('0x12')](_0x489f8e));if(_0x489f8e[_0x7589('0x13')]){if(_0x489f8e[_0x7589('0x13')][_0x7589('0x14')]===0x1f4){logger[_0x7589('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x1f005f,_0x489f8e[_0x7589('0x13')]['message']);return _0x4ce3e(_0x489f8e[_0x7589('0x13')][_0x7589('0x15')]);}logger[_0x7589('0x13')](_0x7589('0xe'),_0x1f005f,_0x489f8e[_0x7589('0x13')][_0x7589('0x15')]);return _0x9c4683(_0x489f8e[_0x7589('0x13')][_0x7589('0x15')]);}else{logger['info'](_0x7589('0xe'),_0x1f005f,_0x7589('0xf'));_0x9c4683(_0x489f8e['result']['message']);}})[_0x7589('0x16')](function(_0x1f23c6){logger[_0x7589('0x13')](_0x7589('0xe'),_0x1f005f,_0x1f23c6);_0x4ce3e(_0x1f23c6);});});} \ No newline at end of file +var _0x8ba4=['rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1408d1,_0x17ae0d){var _0x54cb69=function(_0x20db9f){while(--_0x20db9f){_0x1408d1['push'](_0x1408d1['shift']());}};_0x54cb69(++_0x17ae0d);}(_0x8ba4,0x19d));var _0x48ba=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x8ba4[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x48ba('0x0'));var util=require(_0x48ba('0x1'));var moment=require('moment');var BPromise=require(_0x48ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48ba('0x3'));var db=require(_0x48ba('0x4'))['db'];var utils=require(_0x48ba('0x5'));var logger=require(_0x48ba('0x6'))(_0x48ba('0x7'));var config=require(_0x48ba('0x8'));var jayson=require(_0x48ba('0x9'));var client=jayson[_0x48ba('0xa')][_0x48ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbfbaff,_0x4e0186,_0x2903ec){return new BPromise(function(_0x14d3b0,_0x51b991){return client['request'](_0xbfbaff,_0x2903ec)[_0x48ba('0xc')](function(_0x155825){logger[_0x48ba('0xd')](_0x48ba('0xe'),_0x4e0186,'request\x20sent');logger[_0x48ba('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4e0186,_0x48ba('0x10'),JSON['stringify'](_0x155825));if(_0x155825[_0x48ba('0x11')]){if(_0x155825[_0x48ba('0x11')][_0x48ba('0x12')]===0x1f4){logger['error'](_0x48ba('0xe'),_0x4e0186,_0x155825[_0x48ba('0x11')][_0x48ba('0x13')]);return _0x51b991(_0x155825['error'][_0x48ba('0x13')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4e0186,_0x155825['error']['message']);return _0x14d3b0(_0x155825[_0x48ba('0x11')][_0x48ba('0x13')]);}else{logger[_0x48ba('0xd')](_0x48ba('0xe'),_0x4e0186,_0x48ba('0x10'));_0x14d3b0(_0x155825[_0x48ba('0x14')][_0x48ba('0x13')]);}})['catch'](function(_0x429418){logger[_0x48ba('0x11')](_0x48ba('0xe'),_0x4e0186,_0x429418);_0x51b991(_0x429418);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 9eb4678..0551ae2 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 _0x4d60=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x4d60,0x1e3));var _0x04d6=function(_0x3a2725,_0x450b72){_0x3a2725=_0x3a2725-0x0;var _0x3121fb=_0x4d60[_0x3a2725];return _0x3121fb;};'use strict';var multer=require(_0x04d6('0x0'));var util=require(_0x04d6('0x1'));var path=require(_0x04d6('0x2'));var timeout=require(_0x04d6('0x3'));var express=require(_0x04d6('0x4'));var router=express[_0x04d6('0x5')]();var auth=require(_0x04d6('0x6'));var interaction=require(_0x04d6('0x7'));var config=require(_0x04d6('0x8'));var controller=require(_0x04d6('0x9'));router[_0x04d6('0xa')]('/',auth[_0x04d6('0xb')](),controller[_0x04d6('0xc')]);router[_0x04d6('0xa')](_0x04d6('0xd'),auth[_0x04d6('0xb')](),controller['describe']);router[_0x04d6('0xa')](_0x04d6('0xe'),auth[_0x04d6('0xb')](),controller[_0x04d6('0xf')]);router[_0x04d6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x04d6('0x11')]('/:id',auth[_0x04d6('0xb')](),controller[_0x04d6('0x12')]);router['delete'](_0x04d6('0xe'),auth[_0x04d6('0xb')](),controller[_0x04d6('0x13')]);module[_0x04d6('0x14')]=router; \ No newline at end of file +var _0x09f3=['update','delete','destroy','exports','path','express','../../components/auth/service','./memberReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create'];(function(_0x6c0950,_0x3886d3){var _0x421637=function(_0x1ebfc7){while(--_0x1ebfc7){_0x6c0950['push'](_0x6c0950['shift']());}};_0x421637(++_0x3886d3);}(_0x09f3,0x8c));var _0x309f=function(_0x209803,_0x205d7e){_0x209803=_0x209803-0x0;var _0x53ef29=_0x09f3[_0x209803];return _0x53ef29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x309f('0x0'));var timeout=require('connect-timeout');var express=require(_0x309f('0x1'));var router=express['Router']();var auth=require(_0x309f('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x309f('0x3'));router['get']('/',auth[_0x309f('0x4')](),controller[_0x309f('0x5')]);router['get'](_0x309f('0x6'),auth[_0x309f('0x4')](),controller[_0x309f('0x7')]);router[_0x309f('0x8')](_0x309f('0x9'),auth[_0x309f('0x4')](),controller[_0x309f('0xa')]);router[_0x309f('0xb')]('/',auth[_0x309f('0x4')](),controller[_0x309f('0xc')]);router['put'](_0x309f('0x9'),auth[_0x309f('0x4')](),controller[_0x309f('0xd')]);router[_0x309f('0xe')](_0x309f('0x9'),auth['isAuthenticated'](),controller[_0x309f('0xf')]);module[_0x309f('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 beecb0a..a82827e 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 _0x92a1=['STRING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x419a34,_0x524629){var _0x35f54c=function(_0x2c4df9){while(--_0x2c4df9){_0x419a34['push'](_0x419a34['shift']());}};_0x35f54c(++_0x524629);}(_0x92a1,0x1ec));var _0x192a=function(_0x3e165e,_0x83305d){_0x3e165e=_0x3e165e-0x0;var _0x466814=_0x92a1[_0x3e165e];return _0x466814;};'use strict';var Sequelize=require(_0x192a('0x0'));var moment=require(_0x192a('0x1'));module[_0x192a('0x2')]={'channel':{'type':Sequelize[_0x192a('0x3')]},'membername':{'type':Sequelize[_0x192a('0x3')]},'interface':{'type':Sequelize[_0x192a('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x192a('0x4')]},'enterAt':{'type':Sequelize[_0x192a('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2173f8){var _0x5bd7dd=moment(_0x2173f8);var _0x560052=moment(this[_0x192a('0x6')](_0x192a('0x7')));var _0x45567a=_0x5bd7dd[_0x192a('0x8')](_0x560052,_0x192a('0x9'));this[_0x192a('0xa')]('exitAt',_0x2173f8);this[_0x192a('0xa')](_0x192a('0xb'),_0x45567a||null);}},'data1':{'type':Sequelize[_0x192a('0x3')],'comment':_0x192a('0xc')},'data2':{'type':Sequelize[_0x192a('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x192a('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x192a('0x3')],'comment':_0x192a('0xd')},'data5':{'type':Sequelize[_0x192a('0x3')],'comment':_0x192a('0xe')},'role':{'type':Sequelize[_0x192a('0x3')]},'internal':{'type':Sequelize[_0x192a('0x4')]},'uniqueid':{'type':Sequelize[_0x192a('0x3')]}}; \ No newline at end of file +var _0x5b23=['DATE','getDataValue','enterAt','seconds','setDataValue','duration','talk:[start]','sequelize','STRING','DEFAULT\x20PAUSE','INTEGER'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5b23,0x1eb));var _0x35b2=function(_0x518189,_0x280941){_0x518189=_0x518189-0x0;var _0x14f749=_0x5b23[_0x518189];return _0x14f749;};'use strict';var Sequelize=require(_0x35b2('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0x35b2('0x1')]},'membername':{'type':Sequelize[_0x35b2('0x1')]},'interface':{'type':Sequelize[_0x35b2('0x1')]},'type':{'type':Sequelize[_0x35b2('0x1')],'defaultValue':_0x35b2('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x35b2('0x3')]},'enterAt':{'type':Sequelize[_0x35b2('0x4')]},'exitAt':{'type':Sequelize[_0x35b2('0x4')],'set':function(_0x4ce1aa){var _0x202cb8=moment(_0x4ce1aa);var _0x331014=moment(this[_0x35b2('0x5')](_0x35b2('0x6')));var _0x47ec63=_0x202cb8['diff'](_0x331014,_0x35b2('0x7'));this[_0x35b2('0x8')]('exitAt',_0x4ce1aa);this[_0x35b2('0x8')](_0x35b2('0x9'),_0x47ec63||null);}},'data1':{'type':Sequelize[_0x35b2('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x35b2('0x1')],'comment':_0x35b2('0xa')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x35b2('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x35b2('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x35b2('0x1')]},'internal':{'type':Sequelize[_0x35b2('0x3')]},'uniqueid':{'type':Sequelize[_0x35b2('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index e0be562..032576e 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 _0x1397=['keys','create','body','find','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','MemberReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x1397,0xdb));var _0x7139=function(_0xa23369,_0x1b7895){_0xa23369=_0xa23369-0x0;var _0x48b0e2=_0x1397[_0xa23369];return _0x48b0e2;};'use strict';var pdf=require(_0x7139('0x0'));var emlformat=require(_0x7139('0x1'));var rimraf=require(_0x7139('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7139('0x3'));var moment=require(_0x7139('0x4'));var BPromise=require(_0x7139('0x5'));var Mustache=require(_0x7139('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7139('0x7'));var csv=require(_0x7139('0x8'));var ejs=require(_0x7139('0x9'));var fs=require('fs');var _=require(_0x7139('0xa'));var squel=require(_0x7139('0xb'));var crypto=require(_0x7139('0xc'));var jsforce=require(_0x7139('0xd'));var deskjs=require(_0x7139('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7139('0xf'));var authService=require(_0x7139('0x10'));var qs=require(_0x7139('0x11'));var as=require(_0x7139('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7139('0x13'))(_0x7139('0x14'));var utils=require(_0x7139('0x15'));var config=require('../../config/environment');var db=require(_0x7139('0x16'))['db'];function respondWithStatusCode(_0x3a2854,_0x434245){_0x434245=_0x434245||0xcc;return function(_0x5723fc){if(_0x5723fc){return _0x3a2854['sendStatus'](_0x434245);}return _0x3a2854[_0x7139('0x17')](_0x434245)[_0x7139('0x18')]();};}function respondWithResult(_0x37fc71,_0x80a014){_0x80a014=_0x80a014||0xc8;return function(_0x468f9b){if(_0x468f9b){return _0x37fc71['status'](_0x80a014)[_0x7139('0x19')](_0x468f9b);}};}function respondWithFilteredResult(_0x52542,_0x34ddc0){return function(_0x244ed8){if(_0x244ed8){var _0x55559d=_0x244ed8[_0x7139('0x1a')],_0x54f567=_0x34ddc0['offset'],_0xd93efe=_0x34ddc0[_0x7139('0x1b')]+_0x34ddc0[_0x7139('0x1c')],_0x3d023d;if(_0xd93efe>=_0x55559d){_0xd93efe=_0x55559d;_0x3d023d=0xc8;}else{_0x3d023d=0xce;}_0x52542['status'](_0x3d023d);return _0x52542['set'](_0x7139('0x1d'),_0x54f567+'-'+_0xd93efe+'/'+_0x55559d)[_0x7139('0x19')](_0x244ed8);}return null;};}function patchUpdates(_0xd1c735){return function(_0x4e1a60){try{jsonpatch[_0x7139('0x1e')](_0x4e1a60,_0xd1c735,!![]);}catch(_0xdefbdf){return BPromise[_0x7139('0x1f')](_0xdefbdf);}return _0x4e1a60['save']();};}function saveUpdates(_0x54a177,_0x258cb5){return function(_0x99ffd3){if(_0x99ffd3){return _0x99ffd3[_0x7139('0x20')](_0x54a177)[_0x7139('0x21')](function(_0x371e12){return _0x371e12;});}return null;};}function removeEntity(_0x513d9f,_0x3a461e){return function(_0x5224fc){if(_0x5224fc){return _0x5224fc[_0x7139('0x22')]()[_0x7139('0x21')](function(){_0x513d9f[_0x7139('0x17')](0xcc)[_0x7139('0x18')]();});}};}function handleEntityNotFound(_0x512f36,_0x5104c6){return function(_0x37b330){if(!_0x37b330){_0x512f36[_0x7139('0x23')](0x194);}return _0x37b330;};}function handleError(_0x11cb5d,_0x366d6d){_0x366d6d=_0x366d6d||0x1f4;return function(_0x8bd243){logger[_0x7139('0x24')](_0x8bd243[_0x7139('0x25')]);if(_0x8bd243[_0x7139('0x26')]){delete _0x8bd243[_0x7139('0x26')];}_0x11cb5d[_0x7139('0x17')](_0x366d6d)['send'](_0x8bd243);};}exports['index']=function(_0x1107d8,_0x3f7307){var _0x5610d2={},_0x5d4980={},_0x53bfbc={'count':0x0,'rows':[]};var _0x556b25=_[_0x7139('0x27')](db[_0x7139('0x28')][_0x7139('0x29')],function(_0x22b252){return{'name':_0x22b252[_0x7139('0x2a')],'type':_0x22b252['type'][_0x7139('0x2b')]};});_0x5d4980[_0x7139('0x2c')]=_[_0x7139('0x27')](_0x556b25,'name');_0x5d4980[_0x7139('0x2d')]=_['keys'](_0x1107d8['query']);_0x5d4980['filters']=_[_0x7139('0x2e')](_0x5d4980[_0x7139('0x2c')],_0x5d4980['query']);_0x5610d2['attributes']=_['intersection'](_0x5d4980[_0x7139('0x2c')],qs[_0x7139('0x2f')](_0x1107d8['query'][_0x7139('0x2f')]));_0x5610d2['attributes']=_0x5610d2[_0x7139('0x30')][_0x7139('0x31')]?_0x5610d2[_0x7139('0x30')]:_0x5d4980[_0x7139('0x2c')];if(!_0x1107d8[_0x7139('0x2d')]['hasOwnProperty'](_0x7139('0x32'))){_0x5610d2['limit']=qs[_0x7139('0x1c')](_0x1107d8['query'][_0x7139('0x1c')]);_0x5610d2[_0x7139('0x1b')]=qs[_0x7139('0x1b')](_0x1107d8['query'][_0x7139('0x1b')]);}_0x5610d2[_0x7139('0x33')]=qs[_0x7139('0x34')](_0x1107d8[_0x7139('0x2d')][_0x7139('0x34')]);_0x5610d2[_0x7139('0x35')]=qs[_0x7139('0x36')](_[_0x7139('0x37')](_0x1107d8[_0x7139('0x2d')],_0x5d4980[_0x7139('0x36')]),_0x556b25);if(_0x1107d8[_0x7139('0x2d')][_0x7139('0x38')]){_0x5610d2[_0x7139('0x35')]=_[_0x7139('0x39')](_0x5610d2['where'],{'$or':_['map'](_0x556b25,function(_0x3050fa){if(_0x3050fa[_0x7139('0x3a')]!==_0x7139('0x3b')){var _0xc16941={};_0xc16941[_0x3050fa[_0x7139('0x26')]]={'$like':'%'+_0x1107d8[_0x7139('0x2d')][_0x7139('0x38')]+'%'};return _0xc16941;}})});}_0x5610d2=_['merge']({},_0x5610d2,_0x1107d8[_0x7139('0x3c')]);var _0x3d7917={'where':_0x5610d2[_0x7139('0x35')]};return db[_0x7139('0x28')]['count'](_0x3d7917)['then'](function(_0x2629aa){_0x53bfbc[_0x7139('0x1a')]=_0x2629aa;if(_0x1107d8['query']['includeAll']){_0x5610d2['include']=[{'all':!![]}];}return db[_0x7139('0x28')][_0x7139('0x3d')](_0x5610d2);})[_0x7139('0x21')](function(_0x4c30f0){_0x53bfbc[_0x7139('0x3e')]=_0x4c30f0;return _0x53bfbc;})[_0x7139('0x21')](respondWithFilteredResult(_0x3f7307,_0x5610d2))[_0x7139('0x3f')](handleError(_0x3f7307,null));};exports[_0x7139('0x40')]=function(_0x3fb8a4,_0x2097e2){var _0x446d5b={'raw':!![],'where':{'id':_0x3fb8a4['params']['id']}},_0x3c5727={};_0x3c5727['model']=_[_0x7139('0x41')](db[_0x7139('0x28')][_0x7139('0x29')]);_0x3c5727['query']=_[_0x7139('0x41')](_0x3fb8a4[_0x7139('0x2d')]);_0x3c5727[_0x7139('0x36')]=_[_0x7139('0x2e')](_0x3c5727['model'],_0x3c5727['query']);_0x446d5b['attributes']=_[_0x7139('0x2e')](_0x3c5727[_0x7139('0x2c')],qs[_0x7139('0x2f')](_0x3fb8a4[_0x7139('0x2d')][_0x7139('0x2f')]));_0x446d5b['attributes']=_0x446d5b['attributes'][_0x7139('0x31')]?_0x446d5b[_0x7139('0x30')]:_0x3c5727['model'];if(_0x3fb8a4[_0x7139('0x2d')]['includeAll']){_0x446d5b['include']=[{'all':!![]}];}_0x446d5b=_[_0x7139('0x39')]({},_0x446d5b,_0x3fb8a4['options']);return db[_0x7139('0x28')]['find'](_0x446d5b)[_0x7139('0x21')](handleEntityNotFound(_0x2097e2,null))[_0x7139('0x21')](respondWithResult(_0x2097e2,null))[_0x7139('0x3f')](handleError(_0x2097e2,null));};exports['create']=function(_0x433340,_0x57ae40){return db[_0x7139('0x28')][_0x7139('0x42')](_0x433340['body'],{})[_0x7139('0x21')](respondWithResult(_0x57ae40,0xc9))[_0x7139('0x3f')](handleError(_0x57ae40,null));};exports[_0x7139('0x20')]=function(_0x42dd8b,_0x50a218){if(_0x42dd8b[_0x7139('0x43')]['id']){delete _0x42dd8b[_0x7139('0x43')]['id'];}return db[_0x7139('0x28')][_0x7139('0x44')]({'where':{'id':_0x42dd8b[_0x7139('0x45')]['id']}})['then'](handleEntityNotFound(_0x50a218,null))[_0x7139('0x21')](saveUpdates(_0x42dd8b[_0x7139('0x43')],null))['then'](respondWithResult(_0x50a218,null))[_0x7139('0x3f')](handleError(_0x50a218,null));};exports[_0x7139('0x22')]=function(_0xf9122,_0x3d0047){return db['MemberReport'][_0x7139('0x44')]({'where':{'id':_0xf9122[_0x7139('0x45')]['id']}})[_0x7139('0x21')](handleEntityNotFound(_0x3d0047,null))[_0x7139('0x21')](removeEntity(_0x3d0047,null))[_0x7139('0x3f')](handleError(_0x3d0047,null));};exports[_0x7139('0x46')]=function(_0x54aa21,_0x10d32d){return db[_0x7139('0x28')][_0x7139('0x46')]()[_0x7139('0x21')](respondWithResult(_0x10d32d,null))[_0x7139('0x3f')](handleError(_0x10d32d,null));}; \ No newline at end of file +var _0x1666=['attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','MemberReport','includeAll','include','findAll','rows','show','params','length','create','body','catch','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','reject','then','destroy','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x1acc03,_0x1794d6){var _0x51bc63=function(_0x5bbd7a){while(--_0x5bbd7a){_0x1acc03['push'](_0x1acc03['shift']());}};_0x51bc63(++_0x1794d6);}(_0x1666,0x133));var _0x6166=function(_0x1d4db6,_0x4173a9){_0x1d4db6=_0x1d4db6-0x0;var _0xdedcf3=_0x1666[_0x1d4db6];return _0xdedcf3;};'use strict';var pdf=require(_0x6166('0x0'));var emlformat=require(_0x6166('0x1'));var rimraf=require(_0x6166('0x2'));var zipdir=require(_0x6166('0x3'));var jsonpatch=require(_0x6166('0x4'));var rp=require('request-promise');var moment=require(_0x6166('0x5'));var BPromise=require(_0x6166('0x6'));var Mustache=require(_0x6166('0x7'));var util=require(_0x6166('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6166('0x9'));var ejs=require(_0x6166('0xa'));var fs=require('fs');var _=require(_0x6166('0xb'));var squel=require(_0x6166('0xc'));var crypto=require(_0x6166('0xd'));var jsforce=require(_0x6166('0xe'));var deskjs=require(_0x6166('0xf'));var toCsv=require(_0x6166('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6166('0x10'));var qs=require(_0x6166('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6166('0x12'))('api');var utils=require(_0x6166('0x13'));var config=require(_0x6166('0x14'));var db=require(_0x6166('0x15'))['db'];function respondWithStatusCode(_0xb4477b,_0x58e6cd){_0x58e6cd=_0x58e6cd||0xcc;return function(_0x4e4a54){if(_0x4e4a54){return _0xb4477b[_0x6166('0x16')](_0x58e6cd);}return _0xb4477b[_0x6166('0x17')](_0x58e6cd)[_0x6166('0x18')]();};}function respondWithResult(_0x32c3a9,_0x2a489){_0x2a489=_0x2a489||0xc8;return function(_0x1f1e05){if(_0x1f1e05){return _0x32c3a9[_0x6166('0x17')](_0x2a489)['json'](_0x1f1e05);}};}function respondWithFilteredResult(_0x2792c4,_0x17960c){return function(_0x358ed5){if(_0x358ed5){var _0x41ad51=_0x358ed5[_0x6166('0x19')],_0x543b74=_0x17960c[_0x6166('0x1a')],_0x308cff=_0x17960c[_0x6166('0x1a')]+_0x17960c[_0x6166('0x1b')],_0x1209b3;if(_0x308cff>=_0x41ad51){_0x308cff=_0x41ad51;_0x1209b3=0xc8;}else{_0x1209b3=0xce;}_0x2792c4[_0x6166('0x17')](_0x1209b3);return _0x2792c4['set'](_0x6166('0x1c'),_0x543b74+'-'+_0x308cff+'/'+_0x41ad51)['json'](_0x358ed5);}return null;};}function patchUpdates(_0x2414bb){return function(_0x843aab){try{jsonpatch['apply'](_0x843aab,_0x2414bb,!![]);}catch(_0x5be79b){return BPromise[_0x6166('0x1d')](_0x5be79b);}return _0x843aab['save']();};}function saveUpdates(_0x30d532,_0x123e49){return function(_0x98ff2f){if(_0x98ff2f){return _0x98ff2f['update'](_0x30d532)[_0x6166('0x1e')](function(_0x369a08){return _0x369a08;});}return null;};}function removeEntity(_0x5d82e2,_0xcb1e0){return function(_0x32819c){if(_0x32819c){return _0x32819c[_0x6166('0x1f')]()[_0x6166('0x1e')](function(){_0x5d82e2['status'](0xcc)[_0x6166('0x18')]();});}};}function handleEntityNotFound(_0x2d863c,_0x36a056){return function(_0x487219){if(!_0x487219){_0x2d863c[_0x6166('0x16')](0x194);}return _0x487219;};}function handleError(_0x3d23a7,_0x3e95c7){_0x3e95c7=_0x3e95c7||0x1f4;return function(_0x5c7699){logger[_0x6166('0x20')](_0x5c7699['stack']);if(_0x5c7699['name']){delete _0x5c7699[_0x6166('0x21')];}_0x3d23a7[_0x6166('0x17')](_0x3e95c7)[_0x6166('0x22')](_0x5c7699);};}exports['index']=function(_0x20f762,_0x37b69a){var _0xde5866={},_0x596fc0={},_0x5a5384={'count':0x0,'rows':[]};var _0x1f318a=_['map'](db['MemberReport'][_0x6166('0x23')],function(_0x3c241f){return{'name':_0x3c241f[_0x6166('0x24')],'type':_0x3c241f[_0x6166('0x25')][_0x6166('0x26')]};});_0x596fc0[_0x6166('0x27')]=_[_0x6166('0x28')](_0x1f318a,_0x6166('0x21'));_0x596fc0[_0x6166('0x29')]=_[_0x6166('0x2a')](_0x20f762[_0x6166('0x29')]);_0x596fc0['filters']=_['intersection'](_0x596fc0[_0x6166('0x27')],_0x596fc0['query']);_0xde5866[_0x6166('0x2b')]=_[_0x6166('0x2c')](_0x596fc0[_0x6166('0x27')],qs[_0x6166('0x2d')](_0x20f762[_0x6166('0x29')][_0x6166('0x2d')]));_0xde5866['attributes']=_0xde5866[_0x6166('0x2b')]['length']?_0xde5866[_0x6166('0x2b')]:_0x596fc0[_0x6166('0x27')];if(!_0x20f762[_0x6166('0x29')]['hasOwnProperty'](_0x6166('0x2e'))){_0xde5866[_0x6166('0x1b')]=qs['limit'](_0x20f762[_0x6166('0x29')]['limit']);_0xde5866[_0x6166('0x1a')]=qs[_0x6166('0x1a')](_0x20f762['query'][_0x6166('0x1a')]);}_0xde5866[_0x6166('0x2f')]=qs[_0x6166('0x30')](_0x20f762[_0x6166('0x29')][_0x6166('0x30')]);_0xde5866[_0x6166('0x31')]=qs[_0x6166('0x32')](_[_0x6166('0x33')](_0x20f762[_0x6166('0x29')],_0x596fc0[_0x6166('0x32')]),_0x1f318a);if(_0x20f762['query'][_0x6166('0x34')]){_0xde5866[_0x6166('0x31')]=_[_0x6166('0x35')](_0xde5866[_0x6166('0x31')],{'$or':_[_0x6166('0x28')](_0x1f318a,function(_0x348866){if(_0x348866[_0x6166('0x25')]!==_0x6166('0x36')){var _0x4060b3={};_0x4060b3[_0x348866[_0x6166('0x21')]]={'$like':'%'+_0x20f762[_0x6166('0x29')][_0x6166('0x34')]+'%'};return _0x4060b3;}})});}_0xde5866=_['merge']({},_0xde5866,_0x20f762[_0x6166('0x37')]);var _0x214f3b={'where':_0xde5866['where']};return db[_0x6166('0x38')][_0x6166('0x19')](_0x214f3b)[_0x6166('0x1e')](function(_0x561136){_0x5a5384[_0x6166('0x19')]=_0x561136;if(_0x20f762[_0x6166('0x29')][_0x6166('0x39')]){_0xde5866[_0x6166('0x3a')]=[{'all':!![]}];}return db[_0x6166('0x38')][_0x6166('0x3b')](_0xde5866);})['then'](function(_0x49ea08){_0x5a5384[_0x6166('0x3c')]=_0x49ea08;return _0x5a5384;})[_0x6166('0x1e')](respondWithFilteredResult(_0x37b69a,_0xde5866))['catch'](handleError(_0x37b69a,null));};exports[_0x6166('0x3d')]=function(_0x4e0dc5,_0x24c7c5){var _0x53c72e={'raw':!![],'where':{'id':_0x4e0dc5[_0x6166('0x3e')]['id']}},_0x45f06d={};_0x45f06d['model']=_['keys'](db[_0x6166('0x38')][_0x6166('0x23')]);_0x45f06d[_0x6166('0x29')]=_['keys'](_0x4e0dc5[_0x6166('0x29')]);_0x45f06d['filters']=_['intersection'](_0x45f06d[_0x6166('0x27')],_0x45f06d[_0x6166('0x29')]);_0x53c72e[_0x6166('0x2b')]=_[_0x6166('0x2c')](_0x45f06d['model'],qs[_0x6166('0x2d')](_0x4e0dc5[_0x6166('0x29')][_0x6166('0x2d')]));_0x53c72e[_0x6166('0x2b')]=_0x53c72e[_0x6166('0x2b')][_0x6166('0x3f')]?_0x53c72e[_0x6166('0x2b')]:_0x45f06d[_0x6166('0x27')];if(_0x4e0dc5[_0x6166('0x29')]['includeAll']){_0x53c72e[_0x6166('0x3a')]=[{'all':!![]}];}_0x53c72e=_[_0x6166('0x35')]({},_0x53c72e,_0x4e0dc5[_0x6166('0x37')]);return db[_0x6166('0x38')]['find'](_0x53c72e)[_0x6166('0x1e')](handleEntityNotFound(_0x24c7c5,null))[_0x6166('0x1e')](respondWithResult(_0x24c7c5,null))['catch'](handleError(_0x24c7c5,null));};exports[_0x6166('0x40')]=function(_0x37e593,_0x262707){return db['MemberReport'][_0x6166('0x40')](_0x37e593[_0x6166('0x41')],{})['then'](respondWithResult(_0x262707,0xc9))[_0x6166('0x42')](handleError(_0x262707,null));};exports[_0x6166('0x43')]=function(_0x2eda14,_0x3dbff2){if(_0x2eda14[_0x6166('0x41')]['id']){delete _0x2eda14[_0x6166('0x41')]['id'];}return db[_0x6166('0x38')][_0x6166('0x44')]({'where':{'id':_0x2eda14[_0x6166('0x3e')]['id']}})[_0x6166('0x1e')](handleEntityNotFound(_0x3dbff2,null))[_0x6166('0x1e')](saveUpdates(_0x2eda14[_0x6166('0x41')],null))[_0x6166('0x1e')](respondWithResult(_0x3dbff2,null))[_0x6166('0x42')](handleError(_0x3dbff2,null));};exports[_0x6166('0x1f')]=function(_0x25384e,_0x47b9a4){return db[_0x6166('0x38')]['find']({'where':{'id':_0x25384e[_0x6166('0x3e')]['id']}})[_0x6166('0x1e')](handleEntityNotFound(_0x47b9a4,null))[_0x6166('0x1e')](removeEntity(_0x47b9a4,null))[_0x6166('0x42')](handleError(_0x47b9a4,null));};exports[_0x6166('0x45')]=function(_0x161033,_0x1d2098){return db[_0x6166('0x38')][_0x6166('0x45')]()[_0x6166('0x1e')](respondWithResult(_0x1d2098,null))[_0x6166('0x42')](handleError(_0x1d2098,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 1fc47bb..fcf43bd 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 _0xa025=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','../../config/logger'];(function(_0x299a42,_0x3fe47e){var _0x54d658=function(_0x3434db){while(--_0x3434db){_0x299a42['push'](_0x299a42['shift']());}};_0x54d658(++_0x3fe47e);}(_0xa025,0x1db));var _0x5a02=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xa025[_0x3b1b23];return _0x1efc85;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a02('0x0'))(_0x5a02('0x1'));var moment=require(_0x5a02('0x2'));var BPromise=require(_0x5a02('0x3'));var rp=require(_0x5a02('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a02('0x5'));var config=require(_0x5a02('0x6'));var attributes=require(_0x5a02('0x7'));module[_0x5a02('0x8')]=function(_0x448f4a,_0x20e82a){return _0x448f4a['define'](_0x5a02('0x9'),attributes,{'tableName':_0x5a02('0xa'),'paranoid':![],'indexes':[{'name':_0x5a02('0xb'),'fields':[_0x5a02('0xc'),_0x5a02('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4887=['./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4f9c1c,_0x3b8ea1){var _0x53d914=function(_0x2d0511){while(--_0x2d0511){_0x4f9c1c['push'](_0x4f9c1c['shift']());}};_0x53d914(++_0x3b8ea1);}(_0x4887,0x198));var _0x7488=function(_0x214a08,_0xe13a1){_0x214a08=_0x214a08-0x0;var _0x3472bb=_0x4887[_0x214a08];return _0x3472bb;};'use strict';var _=require(_0x7488('0x0'));var util=require(_0x7488('0x1'));var logger=require(_0x7488('0x2'))('api');var moment=require(_0x7488('0x3'));var BPromise=require('bluebird');var rp=require(_0x7488('0x4'));var fs=require('fs');var path=require(_0x7488('0x5'));var rimraf=require(_0x7488('0x6'));var config=require(_0x7488('0x7'));var attributes=require(_0x7488('0x8'));module[_0x7488('0x9')]=function(_0x28497f,_0x4c9813){return _0x28497f[_0x7488('0xa')](_0x7488('0xb'),attributes,{'tableName':_0x7488('0xc'),'paranoid':![],'indexes':[{'name':_0x7488('0xd'),'fields':[_0x7488('0xe'),_0x7488('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 27712e8..6d728f7 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 _0x4d50=['code','error','message','info','result','catch','GetMemberReport','MemberReport','options','raw','where','limit','map','include','model','attributes','CreateMemberReport','body','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x153e97,_0x5a9b38){var _0x5e7141=function(_0x10b682){while(--_0x10b682){_0x153e97['push'](_0x153e97['shift']());}};_0x5e7141(++_0x5a9b38);}(_0x4d50,0x157));var _0x04d5=function(_0x4464e6,_0xa741e4){_0x4464e6=_0x4464e6-0x0;var _0x3e256d=_0x4d50[_0x4464e6];return _0x3e256d;};'use strict';var _=require('lodash');var util=require(_0x04d5('0x0'));var moment=require(_0x04d5('0x1'));var BPromise=require(_0x04d5('0x2'));var rs=require(_0x04d5('0x3'));var fs=require('fs');var Redis=require(_0x04d5('0x4'));var db=require(_0x04d5('0x5'))['db'];var utils=require(_0x04d5('0x6'));var logger=require(_0x04d5('0x7'))('rpc');var config=require(_0x04d5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x04d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd671b,_0xd29b20,_0x3f4727){return new BPromise(function(_0x4d69c7,_0x9c57db){return client[_0x04d5('0xa')](_0xd671b,_0x3f4727)[_0x04d5('0xb')](function(_0x5113fd){logger['info'](_0x04d5('0xc'),_0xd29b20,_0x04d5('0xd'));logger[_0x04d5('0xe')](_0x04d5('0xf'),_0xd29b20,_0x04d5('0xd'),JSON[_0x04d5('0x10')](_0x5113fd));if(_0x5113fd['error']){if(_0x5113fd['error'][_0x04d5('0x11')]===0x1f4){logger[_0x04d5('0x12')](_0x04d5('0xc'),_0xd29b20,_0x5113fd[_0x04d5('0x12')][_0x04d5('0x13')]);return _0x9c57db(_0x5113fd[_0x04d5('0x12')][_0x04d5('0x13')]);}logger[_0x04d5('0x12')](_0x04d5('0xc'),_0xd29b20,_0x5113fd[_0x04d5('0x12')][_0x04d5('0x13')]);return _0x4d69c7(_0x5113fd[_0x04d5('0x12')][_0x04d5('0x13')]);}else{logger[_0x04d5('0x14')](_0x04d5('0xc'),_0xd29b20,_0x04d5('0xd'));_0x4d69c7(_0x5113fd[_0x04d5('0x15')]['message']);}})[_0x04d5('0x16')](function(_0x2cbfca){logger[_0x04d5('0x12')]('MemberReport,\x20%s,\x20%s',_0xd29b20,_0x2cbfca);_0x9c57db(_0x2cbfca);});});}exports[_0x04d5('0x17')]=function(_0x1a091a){var _0x3ca033=this;return new Promise(function(_0x4017b3,_0x3efc4d){return db[_0x04d5('0x18')]['findAll']({'raw':_0x1a091a[_0x04d5('0x19')]?_0x1a091a[_0x04d5('0x19')][_0x04d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a091a[_0x04d5('0x19')]?_0x1a091a['options'][_0x04d5('0x1b')]||null:null,'attributes':_0x1a091a['options']?_0x1a091a[_0x04d5('0x19')]['attributes']||null:null,'limit':_0x1a091a[_0x04d5('0x19')]?_0x1a091a[_0x04d5('0x19')][_0x04d5('0x1c')]||null:null,'include':_0x1a091a[_0x04d5('0x19')]?_0x1a091a[_0x04d5('0x19')]['include']?_[_0x04d5('0x1d')](_0x1a091a[_0x04d5('0x19')][_0x04d5('0x1e')],function(_0x23650e){return{'model':db[_0x23650e[_0x04d5('0x1f')]],'as':_0x23650e['as'],'attributes':_0x23650e[_0x04d5('0x20')],'include':_0x23650e[_0x04d5('0x1e')]?_[_0x04d5('0x1d')](_0x23650e[_0x04d5('0x1e')],function(_0x418fc4){return{'model':db[_0x418fc4[_0x04d5('0x1f')]],'as':_0x418fc4['as'],'attributes':_0x418fc4[_0x04d5('0x20')],'include':_0x418fc4[_0x04d5('0x1e')]?_[_0x04d5('0x1d')](_0x418fc4[_0x04d5('0x1e')],function(_0x1ab424){return{'model':db[_0x1ab424[_0x04d5('0x1f')]],'as':_0x1ab424['as'],'attributes':_0x1ab424[_0x04d5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x04d5('0xb')](function(_0x1dd6e2){logger[_0x04d5('0x14')]('GetMemberReport',_0x1a091a);logger[_0x04d5('0xe')]('GetMemberReport',_0x1a091a,JSON[_0x04d5('0x10')](_0x1dd6e2));_0x4017b3(_0x1dd6e2);})[_0x04d5('0x16')](function(_0xaa45bd){logger[_0x04d5('0x12')]('GetMemberReport',_0xaa45bd[_0x04d5('0x13')],_0x1a091a);_0x3efc4d(_0x3ca033[_0x04d5('0x12')](0x1f4,_0xaa45bd[_0x04d5('0x13')]));});});};exports[_0x04d5('0x21')]=function(_0x318450){var _0x3d2d7d=this;return new Promise(function(_0x5ed983,_0xa3f43f){return db[_0x04d5('0x18')]['create'](_0x318450[_0x04d5('0x22')],{'raw':_0x318450[_0x04d5('0x19')]?_0x318450['options']['raw']===undefined?!![]:![]:!![]})[_0x04d5('0xb')](function(_0x54e267){logger[_0x04d5('0x14')]('CreateMemberReport',_0x318450);logger['debug'](_0x04d5('0x21'),_0x318450,JSON['stringify'](_0x54e267));_0x5ed983(_0x54e267);})[_0x04d5('0x16')](function(_0xb6a688){logger['error'](_0x04d5('0x21'),_0xb6a688['message'],_0x318450);_0xa3f43f(_0x3d2d7d[_0x04d5('0x12')](0x1f4,_0xb6a688[_0x04d5('0x13')]));});});};exports[_0x04d5('0x23')]=function(_0xfd9c40){var _0x4a0a2e=this;return new Promise(function(_0x3d7320,_0x4375ae){return db[_0x04d5('0x18')]['update'](_0xfd9c40[_0x04d5('0x22')],{'raw':_0xfd9c40[_0x04d5('0x19')]?_0xfd9c40['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfd9c40[_0x04d5('0x19')]?_0xfd9c40[_0x04d5('0x19')][_0x04d5('0x1b')]||null:null,'attributes':_0xfd9c40[_0x04d5('0x19')]?_0xfd9c40[_0x04d5('0x19')][_0x04d5('0x20')]||null:null,'limit':_0xfd9c40['options']?_0xfd9c40[_0x04d5('0x19')][_0x04d5('0x1c')]||null:null})[_0x04d5('0xb')](function(_0x4964d0){logger[_0x04d5('0x14')]('UpdateMemberReport',_0xfd9c40);logger[_0x04d5('0xe')](_0x04d5('0x23'),_0xfd9c40,JSON[_0x04d5('0x10')](_0x4964d0));_0x3d7320(_0x4964d0);})[_0x04d5('0x16')](function(_0x2d9c19){logger[_0x04d5('0x12')]('UpdateMemberReport',_0x2d9c19['message'],_0xfd9c40);_0x4375ae(_0x4a0a2e['error'](0x1f4,_0x2d9c19['message']));});});}; \ No newline at end of file +var _0xf6da=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','MemberReport,\x20%s,\x20%s','message','info','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','CreateMemberReport','create','body','update','UpdateMemberReport','lodash','moment'];(function(_0x10dce2,_0x28d201){var _0x6926bd=function(_0x2cfeca){while(--_0x2cfeca){_0x10dce2['push'](_0x10dce2['shift']());}};_0x6926bd(++_0x28d201);}(_0xf6da,0xbc));var _0xaf6d=function(_0x3d72e5,_0x141c52){_0x3d72e5=_0x3d72e5-0x0;var _0xa79005=_0xf6da[_0x3d72e5];return _0xa79005;};'use strict';var _=require(_0xaf6d('0x0'));var util=require('util');var moment=require(_0xaf6d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf6d('0x2'));var db=require(_0xaf6d('0x3'))['db'];var utils=require(_0xaf6d('0x4'));var logger=require(_0xaf6d('0x5'))(_0xaf6d('0x6'));var config=require(_0xaf6d('0x7'));var jayson=require(_0xaf6d('0x8'));var client=jayson[_0xaf6d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ada97,_0x156036,_0x117cce){return new BPromise(function(_0x3effec,_0x4f76b3){return client[_0xaf6d('0xa')](_0x5ada97,_0x117cce)[_0xaf6d('0xb')](function(_0x5a683d){logger['info']('MemberReport,\x20%s,\x20%s',_0x156036,_0xaf6d('0xc'));logger[_0xaf6d('0xd')](_0xaf6d('0xe'),_0x156036,_0xaf6d('0xc'),JSON['stringify'](_0x5a683d));if(_0x5a683d[_0xaf6d('0xf')]){if(_0x5a683d[_0xaf6d('0xf')][_0xaf6d('0x10')]===0x1f4){logger['error'](_0xaf6d('0x11'),_0x156036,_0x5a683d['error'][_0xaf6d('0x12')]);return _0x4f76b3(_0x5a683d[_0xaf6d('0xf')][_0xaf6d('0x12')]);}logger[_0xaf6d('0xf')](_0xaf6d('0x11'),_0x156036,_0x5a683d[_0xaf6d('0xf')]['message']);return _0x3effec(_0x5a683d[_0xaf6d('0xf')][_0xaf6d('0x12')]);}else{logger[_0xaf6d('0x13')]('MemberReport,\x20%s,\x20%s',_0x156036,_0xaf6d('0xc'));_0x3effec(_0x5a683d['result'][_0xaf6d('0x12')]);}})['catch'](function(_0x3a0cfb){logger[_0xaf6d('0xf')](_0xaf6d('0x11'),_0x156036,_0x3a0cfb);_0x4f76b3(_0x3a0cfb);});});}exports[_0xaf6d('0x14')]=function(_0x37bac2){var _0x142be1=this;return new Promise(function(_0x528e19,_0x35f292){return db[_0xaf6d('0x15')][_0xaf6d('0x16')]({'raw':_0x37bac2[_0xaf6d('0x17')]?_0x37bac2['options'][_0xaf6d('0x18')]===undefined?!![]:![]:!![],'where':_0x37bac2[_0xaf6d('0x17')]?_0x37bac2[_0xaf6d('0x17')][_0xaf6d('0x19')]||null:null,'attributes':_0x37bac2[_0xaf6d('0x17')]?_0x37bac2[_0xaf6d('0x17')][_0xaf6d('0x1a')]||null:null,'limit':_0x37bac2[_0xaf6d('0x17')]?_0x37bac2[_0xaf6d('0x17')][_0xaf6d('0x1b')]||null:null,'include':_0x37bac2['options']?_0x37bac2[_0xaf6d('0x17')][_0xaf6d('0x1c')]?_[_0xaf6d('0x1d')](_0x37bac2[_0xaf6d('0x17')][_0xaf6d('0x1c')],function(_0x2c7b7f){return{'model':db[_0x2c7b7f['model']],'as':_0x2c7b7f['as'],'attributes':_0x2c7b7f[_0xaf6d('0x1a')],'include':_0x2c7b7f['include']?_[_0xaf6d('0x1d')](_0x2c7b7f[_0xaf6d('0x1c')],function(_0x58b9c9){return{'model':db[_0x58b9c9[_0xaf6d('0x1e')]],'as':_0x58b9c9['as'],'attributes':_0x58b9c9[_0xaf6d('0x1a')],'include':_0x58b9c9[_0xaf6d('0x1c')]?_['map'](_0x58b9c9[_0xaf6d('0x1c')],function(_0x4743a8){return{'model':db[_0x4743a8[_0xaf6d('0x1e')]],'as':_0x4743a8['as'],'attributes':_0x4743a8[_0xaf6d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xaf6d('0xb')](function(_0x3540ef){logger[_0xaf6d('0x13')](_0xaf6d('0x14'),_0x37bac2);logger[_0xaf6d('0xd')](_0xaf6d('0x14'),_0x37bac2,JSON[_0xaf6d('0x1f')](_0x3540ef));_0x528e19(_0x3540ef);})[_0xaf6d('0x20')](function(_0x1d8021){logger[_0xaf6d('0xf')](_0xaf6d('0x14'),_0x1d8021[_0xaf6d('0x12')],_0x37bac2);_0x35f292(_0x142be1[_0xaf6d('0xf')](0x1f4,_0x1d8021[_0xaf6d('0x12')]));});});};exports[_0xaf6d('0x21')]=function(_0x4d0c0a){var _0xa2d815=this;return new Promise(function(_0x1c96ef,_0x46b03b){return db['MemberReport'][_0xaf6d('0x22')](_0x4d0c0a[_0xaf6d('0x23')],{'raw':_0x4d0c0a[_0xaf6d('0x17')]?_0x4d0c0a['options'][_0xaf6d('0x18')]===undefined?!![]:![]:!![]})[_0xaf6d('0xb')](function(_0xa287a0){logger['info'](_0xaf6d('0x21'),_0x4d0c0a);logger['debug'](_0xaf6d('0x21'),_0x4d0c0a,JSON[_0xaf6d('0x1f')](_0xa287a0));_0x1c96ef(_0xa287a0);})[_0xaf6d('0x20')](function(_0x76114){logger[_0xaf6d('0xf')]('CreateMemberReport',_0x76114[_0xaf6d('0x12')],_0x4d0c0a);_0x46b03b(_0xa2d815[_0xaf6d('0xf')](0x1f4,_0x76114[_0xaf6d('0x12')]));});});};exports['UpdateMemberReport']=function(_0x15e4b3){var _0x3be8ef=this;return new Promise(function(_0x2abf05,_0x57ab2a){return db['MemberReport'][_0xaf6d('0x24')](_0x15e4b3[_0xaf6d('0x23')],{'raw':_0x15e4b3['options']?_0x15e4b3[_0xaf6d('0x17')][_0xaf6d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15e4b3['options']?_0x15e4b3['options'][_0xaf6d('0x19')]||null:null,'attributes':_0x15e4b3[_0xaf6d('0x17')]?_0x15e4b3[_0xaf6d('0x17')][_0xaf6d('0x1a')]||null:null,'limit':_0x15e4b3[_0xaf6d('0x17')]?_0x15e4b3[_0xaf6d('0x17')]['limit']||null:null})[_0xaf6d('0xb')](function(_0x52019e){logger[_0xaf6d('0x13')]('UpdateMemberReport',_0x15e4b3);logger[_0xaf6d('0xd')](_0xaf6d('0x25'),_0x15e4b3,JSON[_0xaf6d('0x1f')](_0x52019e));_0x2abf05(_0x52019e);})[_0xaf6d('0x20')](function(_0xff4131){logger[_0xaf6d('0xf')](_0xaf6d('0x25'),_0xff4131[_0xaf6d('0x12')],_0x15e4b3);_0x57ab2a(_0x3be8ef['error'](0x1f4,_0xff4131[_0xaf6d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f34a735..17704ad 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 _0xc900=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','path'];(function(_0x43e581,_0x31880b){var _0x10a92f=function(_0x272ffd){while(--_0x272ffd){_0x43e581['push'](_0x43e581['shift']());}};_0x10a92f(++_0x31880b);}(_0xc900,0xb3));var _0x0c90=function(_0x160237,_0x1b4d85){_0x160237=_0x160237-0x0;var _0x45df6a=_0xc900[_0x160237];return _0x45df6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var auth=require(_0x0c90('0x3'));var interaction=require(_0x0c90('0x4'));var config=require('../../config/environment');var controller=require(_0x0c90('0x5'));router[_0x0c90('0x6')]('/',controller[_0x0c90('0x7')]);module[_0x0c90('0x8')]=router; \ No newline at end of file +var _0x9348=['../../components/interaction/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9348,0x10d));var _0x8934=function(_0x3d46e5,_0x565392){_0x3d46e5=_0x3d46e5-0x0;var _0x5b9e42=_0x9348[_0x3d46e5];return _0x5b9e42;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var auth=require(_0x8934('0x5'));var interaction=require(_0x8934('0x6'));var config=require('../../config/environment');var controller=require(_0x8934('0x7'));router[_0x8934('0x8')]('/',controller[_0x8934('0x9')]);module[_0x8934('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 1b5df8c..46c6a80 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 _0x214d=['version','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x214d,0x1ed));var _0xd214=function(_0x2106a9,_0x2567e8){_0x2106a9=_0x2106a9-0x0;var _0x35d365=_0x214d[_0x2106a9];return _0x35d365;};'use strict';var Sequelize=require('sequelize');module[_0xd214('0x0')]={'version':{'type':Sequelize[_0xd214('0x1')],'unique':_0xd214('0x2')}}; \ No newline at end of file +var _0x83a8=['STRING','version','sequelize','exports'];(function(_0x372811,_0x204cf8){var _0x3dee6f=function(_0x3e42b9){while(--_0x3e42b9){_0x372811['push'](_0x372811['shift']());}};_0x3dee6f(++_0x204cf8);}(_0x83a8,0x9a));var _0x883a=function(_0x32a09f,_0x5b91a4){_0x32a09f=_0x32a09f-0x0;var _0x3fc5a2=_0x83a8[_0x32a09f];return _0x3fc5a2;};'use strict';var Sequelize=require(_0x883a('0x0'));module[_0x883a('0x1')]={'version':{'type':Sequelize[_0x883a('0x2')],'unique':_0x883a('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 44c11df..9ed64e6 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 _0xcb91=['lodash','crypto','jsforce','to-csv','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','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','Migration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs'];(function(_0x392d46,_0xac920a){var _0x14b9dd=function(_0x2aa4d2){while(--_0x2aa4d2){_0x392d46['push'](_0x392d46['shift']());}};_0x14b9dd(++_0xac920a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xcb91[_0xb4cc12];return _0x8593b5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['index']=function(_0xd6891c,_0x21effa){var _0x41a9a0={},_0x1804fd={},_0x406821={'count':0x0,'rows':[]};var _0x21d6f5=_[_0x1cb9('0x26')](db[_0x1cb9('0x27')][_0x1cb9('0x28')],function(_0x9de64b){return{'name':_0x9de64b['fieldName'],'type':_0x9de64b[_0x1cb9('0x29')]['key']};});_0x1804fd[_0x1cb9('0x2a')]=_['map'](_0x21d6f5,_0x1cb9('0x24'));_0x1804fd[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2d')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x1804fd['model'],qs[_0x1cb9('0x2f')](_0xd6891c['query'][_0x1cb9('0x2f')]));_0x41a9a0['attributes']=_0x41a9a0[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x41a9a0[_0x1cb9('0x2e')]:_0x1804fd[_0x1cb9('0x2a')];if(!_0xd6891c['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x41a9a0[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1b')]);_0x41a9a0[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1a')]);}_0x41a9a0[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0xd6891c[_0x1cb9('0x2b')]['sort']);_0x41a9a0['where']=qs[_0x1cb9('0x35')](_[_0x1cb9('0x36')](_0xd6891c[_0x1cb9('0x2b')],_0x1804fd[_0x1cb9('0x35')]),_0x21d6f5);if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x37')]){_0x41a9a0[_0x1cb9('0x38')]=_[_0x1cb9('0x39')](_0x41a9a0['where'],{'$or':_[_0x1cb9('0x26')](_0x21d6f5,function(_0x1482c4){if(_0x1482c4[_0x1cb9('0x29')]!=='VIRTUAL'){var _0x2a5aac={};_0x2a5aac[_0x1482c4['name']]={'$like':'%'+_0xd6891c[_0x1cb9('0x2b')]['filter']+'%'};return _0x2a5aac;}})});}_0x41a9a0=_[_0x1cb9('0x39')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x3a')]);var _0x289b73={'where':_0x41a9a0[_0x1cb9('0x38')]};return db[_0x1cb9('0x27')][_0x1cb9('0x19')](_0x289b73)[_0x1cb9('0x1f')](function(_0x4a4788){_0x406821['count']=_0x4a4788;if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x41a9a0[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')][_0x1cb9('0x3d')](_0x41a9a0);})[_0x1cb9('0x1f')](function(_0x32130b){_0x406821['rows']=_0x32130b;return _0x406821;})[_0x1cb9('0x1f')](respondWithFilteredResult(_0x21effa,_0x41a9a0))['catch'](handleError(_0x21effa,null));}; \ No newline at end of file +var _0x70e0=['desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','index','map','Migration','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','name','merge','options','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x70e0,0x17b));var _0x070e=function(_0x4fae5c,_0x30df4d){_0x4fae5c=_0x4fae5c-0x0;var _0x43b149=_0x70e0[_0x4fae5c];return _0x43b149;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={},_0x374c54={},_0x219e48={'count':0x0,'rows':[]};var _0x1d72d6=_[_0x070e('0x26')](db[_0x070e('0x27')][_0x070e('0x28')],function(_0x1a1892){return{'name':_0x1a1892[_0x070e('0x29')],'type':_0x1a1892['type'][_0x070e('0x2a')]};});_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x26')](_0x1d72d6,'name');_0x374c54['query']=_[_0x070e('0x2c')](_0x1743cc[_0x070e('0x2d')]);_0x374c54[_0x070e('0x2e')]=_['intersection'](_0x374c54[_0x070e('0x2b')],_0x374c54[_0x070e('0x2d')]);_0x497f58[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x374c54['model'],qs['fields'](_0x1743cc['query']['fields']));_0x497f58[_0x070e('0x2f')]=_0x497f58['attributes'][_0x070e('0x31')]?_0x497f58[_0x070e('0x2f')]:_0x374c54['model'];if(!_0x1743cc['query'][_0x070e('0x32')](_0x070e('0x33'))){_0x497f58['limit']=qs['limit'](_0x1743cc[_0x070e('0x2d')][_0x070e('0x19')]);_0x497f58[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x1743cc[_0x070e('0x2d')]['offset']);}_0x497f58['order']=qs[_0x070e('0x34')](_0x1743cc[_0x070e('0x2d')][_0x070e('0x34')]);_0x497f58[_0x070e('0x35')]=qs[_0x070e('0x2e')](_['pick'](_0x1743cc[_0x070e('0x2d')],_0x374c54[_0x070e('0x2e')]),_0x1d72d6);if(_0x1743cc['query'][_0x070e('0x36')]){_0x497f58[_0x070e('0x35')]=_['merge'](_0x497f58['where'],{'$or':_['map'](_0x1d72d6,function(_0x363bff){if(_0x363bff[_0x070e('0x37')]!==_0x070e('0x38')){var _0x334733={};_0x334733[_0x363bff[_0x070e('0x39')]]={'$like':'%'+_0x1743cc['query'][_0x070e('0x36')]+'%'};return _0x334733;}})});}_0x497f58=_[_0x070e('0x3a')]({},_0x497f58,_0x1743cc[_0x070e('0x3b')]);var _0x487276={'where':_0x497f58[_0x070e('0x35')]};return db[_0x070e('0x27')][_0x070e('0x3c')](_0x487276)['then'](function(_0x13982f){_0x219e48[_0x070e('0x3c')]=_0x13982f;if(_0x1743cc['query'][_0x070e('0x3d')]){_0x497f58['include']=[{'all':!![]}];}return db[_0x070e('0x27')][_0x070e('0x3e')](_0x497f58);})[_0x070e('0x20')](function(_0x30319c){_0x219e48[_0x070e('0x3f')]=_0x30319c;return _0x219e48;})['then'](respondWithFilteredResult(_0x4763c6,_0x497f58))[_0x070e('0x40')](handleError(_0x4763c6,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index e36e309..d77b462 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 _0xafb0=['bluebird','request-promise','path','rimraf','../../config/environment','migrations','util','moment'];(function(_0x33a61e,_0x159e28){var _0xc6a2e3=function(_0x51b464){while(--_0x51b464){_0x33a61e['push'](_0x33a61e['shift']());}};_0xc6a2e3(++_0x159e28);}(_0xafb0,0x166));var _0x0afb=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xafb0[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require('lodash');var util=require(_0x0afb('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0afb('0x1'));var BPromise=require(_0x0afb('0x2'));var rp=require(_0x0afb('0x3'));var fs=require('fs');var path=require(_0x0afb('0x4'));var rimraf=require(_0x0afb('0x5'));var config=require(_0x0afb('0x6'));var attributes=require('./migration.attributes');module['exports']=function(_0x150996,_0xedaf7b){return _0x150996['define']('Migration',attributes,{'tableName':_0x0afb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x096d=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','moment','request-promise','path'];(function(_0xf3c843,_0x8ff24e){var _0x3191c6=function(_0x2f1ef7){while(--_0x2f1ef7){_0xf3c843['push'](_0xf3c843['shift']());}};_0x3191c6(++_0x8ff24e);}(_0x096d,0x15b));var _0xd096=function(_0x150bbe,_0x412085){_0x150bbe=_0x150bbe-0x0;var _0x3418d5=_0x096d[_0x150bbe];return _0x3418d5;};'use strict';var _=require('lodash');var util=require(_0xd096('0x0'));var logger=require(_0xd096('0x1'))('api');var moment=require(_0xd096('0x2'));var BPromise=require('bluebird');var rp=require(_0xd096('0x3'));var fs=require('fs');var path=require(_0xd096('0x4'));var rimraf=require('rimraf');var config=require(_0xd096('0x5'));var attributes=require(_0xd096('0x6'));module[_0xd096('0x7')]=function(_0x3e4a20,_0x3be181){return _0x3e4a20[_0xd096('0x8')](_0xd096('0x9'),attributes,{'tableName':_0xd096('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 6f3dab7..9965abd 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 _0xcd7a=['error','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x221d7b,_0x44da0c){var _0x24d492=function(_0x1a4fa){while(--_0x1a4fa){_0x221d7b['push'](_0x221d7b['shift']());}};_0x24d492(++_0x44da0c);}(_0xcd7a,0x115));var _0xacd7=function(_0x8a02d8,_0x5d4de2){_0x8a02d8=_0x8a02d8-0x0;var _0x36af1a=_0xcd7a[_0x8a02d8];return _0x36af1a;};'use strict';var _=require(_0xacd7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xacd7('0x1'));var rs=require(_0xacd7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacd7('0x3'));var logger=require(_0xacd7('0x4'))(_0xacd7('0x5'));var config=require(_0xacd7('0x6'));var jayson=require(_0xacd7('0x7'));var client=jayson[_0xacd7('0x8')][_0xacd7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45b633,_0xa86e61,_0x46ccfe){return new BPromise(function(_0x3cf191,_0x311bc8){return client[_0xacd7('0xa')](_0x45b633,_0x46ccfe)[_0xacd7('0xb')](function(_0x567262){logger[_0xacd7('0xc')](_0xacd7('0xd'),_0xa86e61,_0xacd7('0xe'));logger[_0xacd7('0xf')](_0xacd7('0x10'),_0xa86e61,_0xacd7('0xe'),JSON['stringify'](_0x567262));if(_0x567262[_0xacd7('0x11')]){if(_0x567262[_0xacd7('0x11')]['code']===0x1f4){logger[_0xacd7('0x11')](_0xacd7('0xd'),_0xa86e61,_0x567262[_0xacd7('0x11')]['message']);return _0x311bc8(_0x567262['error'][_0xacd7('0x12')]);}logger[_0xacd7('0x11')](_0xacd7('0xd'),_0xa86e61,_0x567262['error']['message']);return _0x3cf191(_0x567262[_0xacd7('0x11')][_0xacd7('0x12')]);}else{logger[_0xacd7('0xc')](_0xacd7('0xd'),_0xa86e61,_0xacd7('0xe'));_0x3cf191(_0x567262[_0xacd7('0x13')][_0xacd7('0x12')]);}})[_0xacd7('0x14')](function(_0x37a6c7){logger[_0xacd7('0x11')](_0xacd7('0xd'),_0xa86e61,_0x37a6c7);_0x311bc8(_0x37a6c7);});});} \ No newline at end of file +var _0x7610=['moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3cfb49,_0x466add){var _0x3b1fc5=function(_0x3d8dc1){while(--_0x3d8dc1){_0x3cfb49['push'](_0x3cfb49['shift']());}};_0x3b1fc5(++_0x466add);}(_0x7610,0x167));var _0x0761=function(_0x4bd737,_0x2eaea5){_0x4bd737=_0x4bd737-0x0;var _0x5e170a=_0x7610[_0x4bd737];return _0x5e170a;};'use strict';var _=require(_0x0761('0x0'));var util=require('util');var moment=require(_0x0761('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0761('0x2'));var db=require(_0x0761('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0761('0x4'));var config=require(_0x0761('0x5'));var jayson=require(_0x0761('0x6'));var client=jayson['client'][_0x0761('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1741a4,_0x4e1816,_0x464c67){return new BPromise(function(_0x1cb241,_0x332704){return client[_0x0761('0x8')](_0x1741a4,_0x464c67)[_0x0761('0x9')](function(_0x596bda){logger[_0x0761('0xa')](_0x0761('0xb'),_0x4e1816,_0x0761('0xc'));logger[_0x0761('0xd')](_0x0761('0xe'),_0x4e1816,'request\x20sent',JSON[_0x0761('0xf')](_0x596bda));if(_0x596bda['error']){if(_0x596bda[_0x0761('0x10')][_0x0761('0x11')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x4e1816,_0x596bda['error']['message']);return _0x332704(_0x596bda['error'][_0x0761('0x12')]);}logger[_0x0761('0x10')](_0x0761('0xb'),_0x4e1816,_0x596bda[_0x0761('0x10')]['message']);return _0x1cb241(_0x596bda[_0x0761('0x10')][_0x0761('0x12')]);}else{logger[_0x0761('0xa')]('Migration,\x20%s,\x20%s',_0x4e1816,'request\x20sent');_0x1cb241(_0x596bda['result']['message']);}})[_0x0761('0x13')](function(_0x1c379f){logger[_0x0761('0x10')](_0x0761('0xb'),_0x4e1816,_0x1c379f);_0x332704(_0x1c379f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d37fd76..3988494 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 _0x8802=['./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25393c,_0x409722){var _0x253ce0=function(_0x294905){while(--_0x294905){_0x25393c['push'](_0x25393c['shift']());}};_0x253ce0(++_0x409722);}(_0x8802,0x7e));var _0x2880=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0x8802[_0x13945b];return _0x1b1643;};'use strict';var multer=require(_0x2880('0x0'));var util=require('util');var path=require(_0x2880('0x1'));var timeout=require('connect-timeout');var express=require(_0x2880('0x2'));var router=express[_0x2880('0x3')]();var auth=require(_0x2880('0x4'));var interaction=require(_0x2880('0x5'));var config=require(_0x2880('0x6'));var controller=require(_0x2880('0x7'));router[_0x2880('0x8')]('/',auth[_0x2880('0x9')](),controller[_0x2880('0xa')]);router[_0x2880('0x8')](_0x2880('0xb'),auth[_0x2880('0x9')](),controller[_0x2880('0xc')]);router[_0x2880('0xd')]('/',auth['isAuthenticated'](),controller[_0x2880('0xe')]);router[_0x2880('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2880('0x10')]);router['delete'](_0x2880('0xb'),auth[_0x2880('0x9')](),controller[_0x2880('0x11')]);module[_0x2880('0x12')]=router; \ No newline at end of file +var _0x1d3c=['isAuthenticated','index','/:id','show','create','put','multer','util','path','connect-timeout','express','Router','../../config/environment','./network.controller','get'];(function(_0x3819f4,_0x1e1b98){var _0x32166e=function(_0xb77a03){while(--_0xb77a03){_0x3819f4['push'](_0x3819f4['shift']());}};_0x32166e(++_0x1e1b98);}(_0x1d3c,0x6f));var _0xc1d3=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x1d3c[_0x258fb0];return _0x4d1afe;};'use strict';var multer=require(_0xc1d3('0x0'));var util=require(_0xc1d3('0x1'));var path=require(_0xc1d3('0x2'));var timeout=require(_0xc1d3('0x3'));var express=require(_0xc1d3('0x4'));var router=express[_0xc1d3('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc1d3('0x6'));var controller=require(_0xc1d3('0x7'));router[_0xc1d3('0x8')]('/',auth[_0xc1d3('0x9')](),controller[_0xc1d3('0xa')]);router[_0xc1d3('0x8')](_0xc1d3('0xb'),auth[_0xc1d3('0x9')](),controller[_0xc1d3('0xc')]);router['post']('/',auth[_0xc1d3('0x9')](),controller[_0xc1d3('0xd')]);router[_0xc1d3('0xe')](_0xc1d3('0xb'),auth[_0xc1d3('0x9')](),controller['update']);router['delete'](_0xc1d3('0xb'),auth[_0xc1d3('0x9')](),controller['destroy']);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 2f6d762..b3a8e8f 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x9fe83d,_0x4bec2a){var _0x14668b=function(_0x15c1ae){while(--_0x15c1ae){_0x9fe83d['push'](_0x9fe83d['shift']());}};_0x14668b(++_0x4bec2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x5270ec,_0x43e2f4){var _0x3a6b14=function(_0x42e76d){while(--_0x42e76d){_0x5270ec['push'](_0x5270ec['shift']());}};_0x3a6b14(++_0x43e2f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d6795a7..e766d26 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 _0x3cef=['STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','end','name','send','index','map','Network','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','findAll','rows','show','params','keys','include','options','catch','create','sequelize','transaction','body','toUpperCase'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3cef,0xe2));var _0xf3ce=function(_0x12f6ce,_0x28e57f){_0x12f6ce=_0x12f6ce-0x0;var _0x107d79=_0x3cef[_0x12f6ce];return _0x107d79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf3ce('0x0'));var rimraf=require(_0xf3ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3ce('0x2'));var rp=require(_0xf3ce('0x3'));var moment=require(_0xf3ce('0x4'));var BPromise=require(_0xf3ce('0x5'));var Mustache=require(_0xf3ce('0x6'));var util=require(_0xf3ce('0x7'));var path=require(_0xf3ce('0x8'));var sox=require(_0xf3ce('0x9'));var csv=require('to-csv');var ejs=require(_0xf3ce('0xa'));var fs=require('fs');var _=require(_0xf3ce('0xb'));var squel=require('squel');var crypto=require(_0xf3ce('0xc'));var jsforce=require(_0xf3ce('0xd'));var deskjs=require(_0xf3ce('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf3ce('0xf'));var Papa=require(_0xf3ce('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf3ce('0x11'));var as=require(_0xf3ce('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3ce('0x13'))('api');var utils=require(_0xf3ce('0x14'));var config=require(_0xf3ce('0x15'));var db=require(_0xf3ce('0x16'))['db'];var jayson=require(_0xf3ce('0x17'));var client=jayson[_0xf3ce('0x18')][_0xf3ce('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1dd9e4,_0x3b442c,_0x2b90ee){if(_0x2b90ee){var _0x489d00=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x489d00[_0xf3ce('0x1a')](_0x3b442c)){return _0x1dd9e4;}else{throw new db['Sequelize'][(_0xf3ce('0x1b'))](_0xf3ce('0x1c'));}}else{return _0x1dd9e4;}}function respondWithRpcPromise(_0x5a9280,_0x11b90c,_0x5e85fa,_0x1efcf7){return new BPromise(function(_0x526ef2,_0x55f94f){var _0x2327da=_0x1efcf7||client;return _0x2327da[_0xf3ce('0x1d')](_0x5a9280,_0x5e85fa)['then'](function(_0x5da8a1){logger[_0xf3ce('0x1e')](_0xf3ce('0x1f'),_0x11b90c,_0xf3ce('0x20'));logger[_0xf3ce('0x21')]('Network,\x20%s,\x20%s,\x20%s',_0x11b90c,_0xf3ce('0x20'),JSON[_0xf3ce('0x22')](_0x5da8a1));if(_0x5da8a1[_0xf3ce('0x23')]){if(_0x5da8a1[_0xf3ce('0x23')]['code']===0x1f4){logger['error'](_0xf3ce('0x1f'),_0x11b90c,_0x5da8a1[_0xf3ce('0x23')]['message']);return _0x55f94f(_0x5da8a1[_0xf3ce('0x23')][_0xf3ce('0x24')]);}logger[_0xf3ce('0x23')](_0xf3ce('0x1f'),_0x11b90c,_0x5da8a1[_0xf3ce('0x23')][_0xf3ce('0x24')]);return _0x526ef2(_0x5da8a1[_0xf3ce('0x23')]['message']);}else{logger[_0xf3ce('0x1e')]('Network,\x20%s,\x20%s',_0x11b90c,_0xf3ce('0x20'));_0x526ef2(_0x5da8a1['result'][_0xf3ce('0x24')]);}})['catch'](function(_0x499361){logger[_0xf3ce('0x23')](_0xf3ce('0x1f'),_0x11b90c,_0x499361);_0x55f94f(_0x499361);});});}function respondWithStatusCode(_0x11f79b,_0x4a9f29){_0x4a9f29=_0x4a9f29||0xcc;return function(_0xe55e5b){if(_0xe55e5b){return _0x11f79b[_0xf3ce('0x25')](_0x4a9f29);}return _0x11f79b[_0xf3ce('0x26')](_0x4a9f29)['end']();};}function respondWithResult(_0x3e5b59,_0x438e6c){_0x438e6c=_0x438e6c||0xc8;return function(_0x7a441d){if(_0x7a441d){return _0x3e5b59['status'](_0x438e6c)[_0xf3ce('0x27')](_0x7a441d);}};}function respondWithFilteredResult(_0x139984,_0x24e08d){return function(_0x2cf474){if(_0x2cf474){var _0x738a62=_0x2cf474[_0xf3ce('0x28')],_0x2af99e=_0x24e08d[_0xf3ce('0x29')],_0x1ac6bd=_0x24e08d[_0xf3ce('0x29')]+_0x24e08d[_0xf3ce('0x2a')],_0x23a04e;if(_0x1ac6bd>=_0x738a62){_0x1ac6bd=_0x738a62;_0x23a04e=0xc8;}else{_0x23a04e=0xce;}_0x139984[_0xf3ce('0x26')](_0x23a04e);return _0x139984[_0xf3ce('0x2b')]('Content-Range',_0x2af99e+'-'+_0x1ac6bd+'/'+_0x738a62)[_0xf3ce('0x27')](_0x2cf474);}return null;};}function patchUpdates(_0x48b6d3){return function(_0x9de9b1){try{jsonpatch[_0xf3ce('0x2c')](_0x9de9b1,_0x48b6d3,!![]);}catch(_0xe0f3ff){return BPromise['reject'](_0xe0f3ff);}return _0x9de9b1[_0xf3ce('0x2d')]();};}function saveUpdates(_0x5e03c3,_0x3dc3df){return function(_0xd8744e){if(_0xd8744e){return _0xd8744e[_0xf3ce('0x2e')](_0x5e03c3)[_0xf3ce('0x2f')](function(_0x3bf712){return _0x3bf712;});}return null;};}function removeEntity(_0x187775,_0x573dc3){return function(_0x1a226e){if(_0x1a226e){return _0x1a226e['destroy']()[_0xf3ce('0x2f')](function(){_0x187775[_0xf3ce('0x26')](0xcc)[_0xf3ce('0x30')]();});}};}function handleEntityNotFound(_0x2c776f,_0x2d2407){return function(_0x1a1677){if(!_0x1a1677){_0x2c776f[_0xf3ce('0x25')](0x194);}return _0x1a1677;};}function handleError(_0x4ccb1e,_0x570363){_0x570363=_0x570363||0x1f4;return function(_0x63c58c){logger['error'](_0x63c58c['stack']);if(_0x63c58c[_0xf3ce('0x31')]){delete _0x63c58c['name'];}_0x4ccb1e[_0xf3ce('0x26')](_0x570363)[_0xf3ce('0x32')](_0x63c58c);};}exports[_0xf3ce('0x33')]=function(_0x28df0c,_0x4c2ff7){var _0x29f48a={},_0x3b2833={},_0x24a8d1={'count':0x0,'rows':[]};var _0x3681ab=_[_0xf3ce('0x34')](db[_0xf3ce('0x35')][_0xf3ce('0x36')],function(_0x56d6ac){return{'name':_0x56d6ac['fieldName'],'type':_0x56d6ac[_0xf3ce('0x37')][_0xf3ce('0x38')]};});_0x3b2833[_0xf3ce('0x39')]=_[_0xf3ce('0x34')](_0x3681ab,_0xf3ce('0x31'));_0x3b2833['query']=_['keys'](_0x28df0c[_0xf3ce('0x3a')]);_0x3b2833[_0xf3ce('0x3b')]=_[_0xf3ce('0x3c')](_0x3b2833['model'],_0x3b2833[_0xf3ce('0x3a')]);_0x29f48a[_0xf3ce('0x3d')]=_['intersection'](_0x3b2833[_0xf3ce('0x39')],qs['fields'](_0x28df0c[_0xf3ce('0x3a')][_0xf3ce('0x3e')]));_0x29f48a['attributes']=_0x29f48a[_0xf3ce('0x3d')][_0xf3ce('0x3f')]?_0x29f48a[_0xf3ce('0x3d')]:_0x3b2833[_0xf3ce('0x39')];if(!_0x28df0c[_0xf3ce('0x3a')][_0xf3ce('0x40')](_0xf3ce('0x41'))){_0x29f48a['limit']=qs['limit'](_0x28df0c['query'][_0xf3ce('0x2a')]);_0x29f48a[_0xf3ce('0x29')]=qs[_0xf3ce('0x29')](_0x28df0c[_0xf3ce('0x3a')]['offset']);}_0x29f48a['order']=qs['sort'](_0x28df0c[_0xf3ce('0x3a')]['sort']);_0x29f48a[_0xf3ce('0x42')]=qs[_0xf3ce('0x3b')](_[_0xf3ce('0x43')](_0x28df0c[_0xf3ce('0x3a')],_0x3b2833[_0xf3ce('0x3b')]),_0x3681ab);if(_0x28df0c[_0xf3ce('0x3a')][_0xf3ce('0x44')]){_0x29f48a[_0xf3ce('0x42')]=_[_0xf3ce('0x45')](_0x29f48a[_0xf3ce('0x42')],{'$or':_[_0xf3ce('0x34')](_0x3681ab,function(_0x20f792){if(_0x20f792[_0xf3ce('0x37')]!=='VIRTUAL'){var _0x5af81f={};_0x5af81f[_0x20f792[_0xf3ce('0x31')]]={'$like':'%'+_0x28df0c[_0xf3ce('0x3a')][_0xf3ce('0x44')]+'%'};return _0x5af81f;}})});}_0x29f48a=_[_0xf3ce('0x45')]({},_0x29f48a,_0x28df0c['options']);var _0x591e75={'where':_0x29f48a[_0xf3ce('0x42')]};return db[_0xf3ce('0x35')][_0xf3ce('0x28')](_0x591e75)[_0xf3ce('0x2f')](function(_0x57b10f){_0x24a8d1['count']=_0x57b10f;if(_0x28df0c[_0xf3ce('0x3a')]['includeAll']){_0x29f48a['include']=[{'all':!![]}];}return db['Network'][_0xf3ce('0x46')](_0x29f48a);})[_0xf3ce('0x2f')](function(_0x264100){_0x24a8d1[_0xf3ce('0x47')]=_0x264100;return _0x24a8d1;})[_0xf3ce('0x2f')](respondWithFilteredResult(_0x4c2ff7,_0x29f48a))['catch'](handleError(_0x4c2ff7,null));};exports[_0xf3ce('0x48')]=function(_0xfb2467,_0x17154e){var _0xa414d8={'raw':!![],'where':{'id':_0xfb2467[_0xf3ce('0x49')]['id']}},_0x5d76fd={};_0x5d76fd['model']=_[_0xf3ce('0x4a')](db[_0xf3ce('0x35')]['rawAttributes']);_0x5d76fd['query']=_[_0xf3ce('0x4a')](_0xfb2467[_0xf3ce('0x3a')]);_0x5d76fd[_0xf3ce('0x3b')]=_[_0xf3ce('0x3c')](_0x5d76fd['model'],_0x5d76fd[_0xf3ce('0x3a')]);_0xa414d8['attributes']=_[_0xf3ce('0x3c')](_0x5d76fd[_0xf3ce('0x39')],qs[_0xf3ce('0x3e')](_0xfb2467[_0xf3ce('0x3a')][_0xf3ce('0x3e')]));_0xa414d8[_0xf3ce('0x3d')]=_0xa414d8['attributes'][_0xf3ce('0x3f')]?_0xa414d8[_0xf3ce('0x3d')]:_0x5d76fd[_0xf3ce('0x39')];if(_0xfb2467[_0xf3ce('0x3a')]['includeAll']){_0xa414d8[_0xf3ce('0x4b')]=[{'all':!![]}];}_0xa414d8=_[_0xf3ce('0x45')]({},_0xa414d8,_0xfb2467[_0xf3ce('0x4c')]);return db[_0xf3ce('0x35')]['find'](_0xa414d8)[_0xf3ce('0x2f')](handleEntityNotFound(_0x17154e,null))['then'](respondWithResult(_0x17154e,null))[_0xf3ce('0x4d')](handleError(_0x17154e,null));};exports[_0xf3ce('0x4e')]=function(_0x317642,_0x33dda3,_0x3ac54d){var _0x38c7f5;return db[_0xf3ce('0x4f')][_0xf3ce('0x50')](function(_0xe62fc1){return db['Network'][_0xf3ce('0x4e')](_0x317642['body'],{'raw':!![]})[_0xf3ce('0x2f')](function(_0x24c2a5){_0x38c7f5=_0x24c2a5;return db[_0xf3ce('0x35')][_0xf3ce('0x46')]({'where':{'type':_0x317642[_0xf3ce('0x51')][_0xf3ce('0x37')]},'raw':!![]});})[_0xf3ce('0x2f')](function(_0x3eaf26){if(_0x38c7f5[_0xf3ce('0x37')][_0xf3ce('0x52')]()==_0xf3ce('0x53')){var _0x1d16bc=fs['readFileSync'](path[_0xf3ce('0x54')](config[_0xf3ce('0x55')],_0xf3ce('0x56')),_0xf3ce('0x57'));var _0x481b77=ejs[_0xf3ce('0x58')](_0x1d16bc,{'networks':_0x3eaf26||[]});fs[_0xf3ce('0x59')](_0xf3ce('0x5a'),_0x481b77);return respondWithRpcPromise(_0xf3ce('0x5b'),'create',{'module':_0xf3ce('0x5c')});}else if(_0x38c7f5['type'][_0xf3ce('0x52')]()==_0xf3ce('0x5d')){var _0x1f2794=fs['readFileSync'](path[_0xf3ce('0x54')](config[_0xf3ce('0x55')],_0xf3ce('0x5e')),_0xf3ce('0x57'));var _0x427231=ejs['render'](_0x1f2794,{'networks':_0x3eaf26||[]});fs['writeFileSync'](_0xf3ce('0x5f'),_0x427231);return respondWithRpcPromise(_0xf3ce('0x5b'),_0xf3ce('0x4e'),{'module':'res_stun_monitor.so'});}else{var _0x511675=fs['readFileSync'](path[_0xf3ce('0x54')](config[_0xf3ce('0x55')],_0xf3ce('0x60')),'utf8');var _0x919171=ejs[_0xf3ce('0x58')](_0x511675,{'networks':_0x3eaf26||[]});fs['writeFileSync'](util[_0xf3ce('0x61')](_0xf3ce('0x62'),_0x317642[_0xf3ce('0x51')][_0xf3ce('0x37')][_0xf3ce('0x63')]()),_0x919171);return respondWithRpcPromise(_0xf3ce('0x5b'),_0xf3ce('0x4e'),{'module':_0xf3ce('0x64')});}return null;})[_0xf3ce('0x2f')](function(){return _0x38c7f5;});})[_0xf3ce('0x2f')](respondWithResult(_0x33dda3,0xc9))[_0xf3ce('0x4d')](handleError(_0x33dda3,null));};exports[_0xf3ce('0x2e')]=function(_0x4a90ce,_0x14cae6,_0x106b46){var _0x4adb82;return db[_0xf3ce('0x4f')][_0xf3ce('0x50')](function(_0x865f11){return db[_0xf3ce('0x35')][_0xf3ce('0x65')]({'where':{'id':_0x4a90ce[_0xf3ce('0x49')]['id']}})[_0xf3ce('0x2f')](handleEntityNotFound(_0x14cae6,null))[_0xf3ce('0x2f')](saveUpdates(_0x4a90ce[_0xf3ce('0x51')],null))['then'](function(_0x5c8663){if(_0x5c8663){_0x4adb82=_0x5c8663;return db[_0xf3ce('0x35')][_0xf3ce('0x46')]({'where':{'type':_0x4adb82[_0xf3ce('0x37')]},'raw':!![]});}return null;})[_0xf3ce('0x2f')](function(_0x276770){if(_0x4adb82[_0xf3ce('0x37')][_0xf3ce('0x52')]()==_0xf3ce('0x53')){var _0x276388=fs['readFileSync'](path[_0xf3ce('0x54')](config['root'],_0xf3ce('0x56')),_0xf3ce('0x57'));var _0x3d0d24=ejs[_0xf3ce('0x58')](_0x276388,{'networks':_0x276770||[]});fs[_0xf3ce('0x59')]('/etc/asterisk/stun_xcally.conf',_0x3d0d24);return respondWithRpcPromise(_0xf3ce('0x5b'),'update',{'module':_0xf3ce('0x5c')});}else if(_0x4adb82[_0xf3ce('0x37')][_0xf3ce('0x52')]()==_0xf3ce('0x5d')){var _0x417e9e=fs['readFileSync'](path[_0xf3ce('0x54')](config[_0xf3ce('0x55')],_0xf3ce('0x5e')),_0xf3ce('0x57'));var _0x5239c6=ejs['render'](_0x417e9e,{'networks':_0x276770||[]});fs[_0xf3ce('0x59')](_0xf3ce('0x5f'),_0x5239c6);return respondWithRpcPromise('Reload',_0xf3ce('0x2e'),{'module':'res_stun_monitor.so'});}else{var _0x196fb0=fs['readFileSync'](path['join'](config[_0xf3ce('0x55')],_0xf3ce('0x60')),_0xf3ce('0x57'));var _0x50831d=ejs['render'](_0x196fb0,{'networks':_0x276770||[]});fs[_0xf3ce('0x59')](util[_0xf3ce('0x61')](_0xf3ce('0x62'),_0x4a90ce[_0xf3ce('0x51')][_0xf3ce('0x37')]['toLowerCase']()),_0x50831d);return respondWithRpcPromise('Reload','update',{'module':_0xf3ce('0x64')});}return null;})[_0xf3ce('0x2f')](function(_0x52d4b5){if(_0x52d4b5){return _0x4adb82;}return null;});})[_0xf3ce('0x2f')](respondWithResult(_0x14cae6,null))[_0xf3ce('0x4d')](handleError(_0x14cae6,null));};exports['destroy']=function(_0xde116a,_0x5a7479,_0x58b8c8){var _0x2f96b2;return db[_0xf3ce('0x35')][_0xf3ce('0x65')]({'where':{'id':_0xde116a[_0xf3ce('0x49')]['id']}})['then'](function(_0x326e4c){_0x2f96b2=_0x326e4c;return _0x326e4c;})[_0xf3ce('0x2f')](handleEntityNotFound(_0x5a7479,null))[_0xf3ce('0x2f')](removeEntity(_0x5a7479,null))[_0xf3ce('0x2f')](function(){if(_0x2f96b2){return db[_0xf3ce('0x35')][_0xf3ce('0x46')]({'where':{'type':_0x2f96b2[_0xf3ce('0x37')]},'raw':!![]});}})[_0xf3ce('0x2f')](function(_0x23d29f){if(_0x2f96b2[_0xf3ce('0x37')][_0xf3ce('0x52')]()=='STUN'){var _0x5bd030=fs['readFileSync'](path[_0xf3ce('0x54')](config[_0xf3ce('0x55')],_0xf3ce('0x56')),'utf8');var _0x15fb75=ejs[_0xf3ce('0x58')](_0x5bd030,{'networks':_0x23d29f||[]});fs['writeFileSync'](_0xf3ce('0x5a'),_0x15fb75);return respondWithRpcPromise(_0xf3ce('0x5b'),_0xf3ce('0x66'),{'module':'res_stun_monitor.so'});}else if(_0x2f96b2[_0xf3ce('0x37')][_0xf3ce('0x52')]()==_0xf3ce('0x5d')){var _0x38ae5e=fs['readFileSync'](path['join'](config[_0xf3ce('0x55')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x760aaa=ejs[_0xf3ce('0x58')](_0x38ae5e,{'networks':_0x23d29f||[]});fs[_0xf3ce('0x59')]('/etc/asterisk/turn_xcally.conf',_0x760aaa);return respondWithRpcPromise(_0xf3ce('0x5b'),_0xf3ce('0x66'),{'module':_0xf3ce('0x5c')});}else{var _0x32608c=fs['readFileSync'](path[_0xf3ce('0x54')](config['root'],_0xf3ce('0x60')),_0xf3ce('0x57'));var _0xac67d1=ejs[_0xf3ce('0x58')](_0x32608c,{'networks':_0x23d29f||[]});fs[_0xf3ce('0x59')](util[_0xf3ce('0x61')](_0xf3ce('0x62'),_0xde116a[_0xf3ce('0x51')]['type'][_0xf3ce('0x63')]()),_0xac67d1);return respondWithRpcPromise('Reload',_0xf3ce('0x66'),{'module':_0xf3ce('0x64')});}return null;})['catch'](handleError(_0x5a7479,null));}; \ No newline at end of file +var _0x427f=['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','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','Network','intersection','length','includeAll','options','find','sequelize','create','body','toUpperCase','STUN','utf8','render','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','join','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','destroy','/etc/asterisk/stun_xcally.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize'];(function(_0x1110a2,_0x8a69de){var _0x12b069=function(_0x3c239f){while(--_0x3c239f){_0x1110a2['push'](_0x1110a2['shift']());}};_0x12b069(++_0x8a69de);}(_0x427f,0xc4));var _0xf427=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x427f[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0xf427('0x0'));var emlformat=require(_0xf427('0x1'));var rimraf=require(_0xf427('0x2'));var zipdir=require(_0xf427('0x3'));var jsonpatch=require(_0xf427('0x4'));var rp=require(_0xf427('0x5'));var moment=require(_0xf427('0x6'));var BPromise=require(_0xf427('0x7'));var Mustache=require('mustache');var util=require(_0xf427('0x8'));var path=require(_0xf427('0x9'));var sox=require(_0xf427('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf427('0xb'));var squel=require(_0xf427('0xc'));var crypto=require(_0xf427('0xd'));var jsforce=require(_0xf427('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf427('0xf'));var Papa=require(_0xf427('0x10'));var Redis=require(_0xf427('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf427('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf427('0x13'));var logger=require(_0xf427('0x14'))(_0xf427('0x15'));var utils=require(_0xf427('0x16'));var config=require(_0xf427('0x17'));var db=require(_0xf427('0x18'))['db'];var jayson=require(_0xf427('0x19'));var client=jayson[_0xf427('0x1a')][_0xf427('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x558096,_0x46657e,_0x4ea2e1){if(_0x4ea2e1){var _0x1ba0f1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ba0f1[_0xf427('0x1c')](_0x46657e)){return _0x558096;}else{throw new db[(_0xf427('0x1d'))][(_0xf427('0x1e'))](_0xf427('0x1f'));}}else{return _0x558096;}}function respondWithRpcPromise(_0x397fce,_0x20a92a,_0x2f0c5b,_0x5ed5a8){return new BPromise(function(_0x5e5ec8,_0x1a512a){var _0x5a762e=_0x5ed5a8||client;return _0x5a762e[_0xf427('0x20')](_0x397fce,_0x2f0c5b)[_0xf427('0x21')](function(_0x4133a2){logger[_0xf427('0x22')](_0xf427('0x23'),_0x20a92a,'request\x20sent');logger['debug'](_0xf427('0x24'),_0x20a92a,_0xf427('0x25'),JSON[_0xf427('0x26')](_0x4133a2));if(_0x4133a2[_0xf427('0x27')]){if(_0x4133a2[_0xf427('0x27')]['code']===0x1f4){logger[_0xf427('0x27')]('Network,\x20%s,\x20%s',_0x20a92a,_0x4133a2[_0xf427('0x27')][_0xf427('0x28')]);return _0x1a512a(_0x4133a2['error'][_0xf427('0x28')]);}logger[_0xf427('0x27')](_0xf427('0x23'),_0x20a92a,_0x4133a2[_0xf427('0x27')]['message']);return _0x5e5ec8(_0x4133a2[_0xf427('0x27')][_0xf427('0x28')]);}else{logger[_0xf427('0x22')](_0xf427('0x23'),_0x20a92a,_0xf427('0x25'));_0x5e5ec8(_0x4133a2[_0xf427('0x29')][_0xf427('0x28')]);}})[_0xf427('0x2a')](function(_0x570e1c){logger[_0xf427('0x27')](_0xf427('0x23'),_0x20a92a,_0x570e1c);_0x1a512a(_0x570e1c);});});}function respondWithStatusCode(_0x305325,_0x12ee6d){_0x12ee6d=_0x12ee6d||0xcc;return function(_0x1cac3a){if(_0x1cac3a){return _0x305325[_0xf427('0x2b')](_0x12ee6d);}return _0x305325[_0xf427('0x2c')](_0x12ee6d)[_0xf427('0x2d')]();};}function respondWithResult(_0x17975e,_0x1bc62d){_0x1bc62d=_0x1bc62d||0xc8;return function(_0x41979c){if(_0x41979c){return _0x17975e[_0xf427('0x2c')](_0x1bc62d)[_0xf427('0x2e')](_0x41979c);}};}function respondWithFilteredResult(_0x3ae464,_0x1edfb4){return function(_0x157f22){if(_0x157f22){var _0x28c012=_0x157f22[_0xf427('0x2f')],_0x5909d5=_0x1edfb4['offset'],_0x3eabde=_0x1edfb4[_0xf427('0x30')]+_0x1edfb4[_0xf427('0x31')],_0xc5d0cd;if(_0x3eabde>=_0x28c012){_0x3eabde=_0x28c012;_0xc5d0cd=0xc8;}else{_0xc5d0cd=0xce;}_0x3ae464[_0xf427('0x2c')](_0xc5d0cd);return _0x3ae464[_0xf427('0x32')](_0xf427('0x33'),_0x5909d5+'-'+_0x3eabde+'/'+_0x28c012)['json'](_0x157f22);}return null;};}function patchUpdates(_0x339331){return function(_0x3aa827){try{jsonpatch['apply'](_0x3aa827,_0x339331,!![]);}catch(_0x43115c){return BPromise['reject'](_0x43115c);}return _0x3aa827[_0xf427('0x34')]();};}function saveUpdates(_0x35b344,_0x2c2345){return function(_0x2c109f){if(_0x2c109f){return _0x2c109f[_0xf427('0x35')](_0x35b344)[_0xf427('0x21')](function(_0x23327e){return _0x23327e;});}return null;};}function removeEntity(_0x5f458a,_0x59a89d){return function(_0x85d395){if(_0x85d395){return _0x85d395['destroy']()[_0xf427('0x21')](function(){_0x5f458a[_0xf427('0x2c')](0xcc)[_0xf427('0x2d')]();});}};}function handleEntityNotFound(_0x14571a,_0x196976){return function(_0x300346){if(!_0x300346){_0x14571a[_0xf427('0x2b')](0x194);}return _0x300346;};}function handleError(_0x2b1cef,_0x3f733a){_0x3f733a=_0x3f733a||0x1f4;return function(_0x53cb96){logger[_0xf427('0x27')](_0x53cb96[_0xf427('0x36')]);if(_0x53cb96['name']){delete _0x53cb96[_0xf427('0x37')];}_0x2b1cef['status'](_0x3f733a)[_0xf427('0x38')](_0x53cb96);};}exports[_0xf427('0x39')]=function(_0x26f029,_0x293c96){var _0x356085={},_0x32cf36={},_0x1f26fc={'count':0x0,'rows':[]};var _0x529a89=_['map'](db['Network'][_0xf427('0x3a')],function(_0x5d9ac7){return{'name':_0x5d9ac7[_0xf427('0x3b')],'type':_0x5d9ac7[_0xf427('0x3c')][_0xf427('0x3d')]};});_0x32cf36[_0xf427('0x3e')]=_[_0xf427('0x3f')](_0x529a89,'name');_0x32cf36[_0xf427('0x40')]=_[_0xf427('0x41')](_0x26f029[_0xf427('0x40')]);_0x32cf36[_0xf427('0x42')]=_['intersection'](_0x32cf36[_0xf427('0x3e')],_0x32cf36[_0xf427('0x40')]);_0x356085['attributes']=_['intersection'](_0x32cf36[_0xf427('0x3e')],qs[_0xf427('0x43')](_0x26f029[_0xf427('0x40')]['fields']));_0x356085[_0xf427('0x44')]=_0x356085[_0xf427('0x44')]['length']?_0x356085['attributes']:_0x32cf36['model'];if(!_0x26f029[_0xf427('0x40')][_0xf427('0x45')](_0xf427('0x46'))){_0x356085[_0xf427('0x31')]=qs[_0xf427('0x31')](_0x26f029['query'][_0xf427('0x31')]);_0x356085[_0xf427('0x30')]=qs[_0xf427('0x30')](_0x26f029[_0xf427('0x40')][_0xf427('0x30')]);}_0x356085[_0xf427('0x47')]=qs[_0xf427('0x48')](_0x26f029[_0xf427('0x40')][_0xf427('0x48')]);_0x356085['where']=qs[_0xf427('0x42')](_[_0xf427('0x49')](_0x26f029[_0xf427('0x40')],_0x32cf36[_0xf427('0x42')]),_0x529a89);if(_0x26f029[_0xf427('0x40')][_0xf427('0x4a')]){_0x356085[_0xf427('0x4b')]=_[_0xf427('0x4c')](_0x356085[_0xf427('0x4b')],{'$or':_[_0xf427('0x3f')](_0x529a89,function(_0x2a7a1f){if(_0x2a7a1f[_0xf427('0x3c')]!==_0xf427('0x4d')){var _0x22ab77={};_0x22ab77[_0x2a7a1f['name']]={'$like':'%'+_0x26f029[_0xf427('0x40')][_0xf427('0x4a')]+'%'};return _0x22ab77;}})});}_0x356085=_[_0xf427('0x4c')]({},_0x356085,_0x26f029['options']);var _0x59cb59={'where':_0x356085['where']};return db['Network'][_0xf427('0x2f')](_0x59cb59)[_0xf427('0x21')](function(_0xb0a8f4){_0x1f26fc['count']=_0xb0a8f4;if(_0x26f029[_0xf427('0x40')]['includeAll']){_0x356085[_0xf427('0x4e')]=[{'all':!![]}];}return db['Network'][_0xf427('0x4f')](_0x356085);})[_0xf427('0x21')](function(_0x207dac){_0x1f26fc[_0xf427('0x50')]=_0x207dac;return _0x1f26fc;})[_0xf427('0x21')](respondWithFilteredResult(_0x293c96,_0x356085))[_0xf427('0x2a')](handleError(_0x293c96,null));};exports[_0xf427('0x51')]=function(_0x5c2cce,_0x2ca267){var _0x197856={'raw':!![],'where':{'id':_0x5c2cce[_0xf427('0x52')]['id']}},_0x45500a={};_0x45500a[_0xf427('0x3e')]=_[_0xf427('0x41')](db[_0xf427('0x53')][_0xf427('0x3a')]);_0x45500a[_0xf427('0x40')]=_['keys'](_0x5c2cce[_0xf427('0x40')]);_0x45500a['filters']=_[_0xf427('0x54')](_0x45500a[_0xf427('0x3e')],_0x45500a['query']);_0x197856['attributes']=_[_0xf427('0x54')](_0x45500a[_0xf427('0x3e')],qs[_0xf427('0x43')](_0x5c2cce['query'][_0xf427('0x43')]));_0x197856[_0xf427('0x44')]=_0x197856[_0xf427('0x44')][_0xf427('0x55')]?_0x197856[_0xf427('0x44')]:_0x45500a[_0xf427('0x3e')];if(_0x5c2cce[_0xf427('0x40')][_0xf427('0x56')]){_0x197856[_0xf427('0x4e')]=[{'all':!![]}];}_0x197856=_[_0xf427('0x4c')]({},_0x197856,_0x5c2cce[_0xf427('0x57')]);return db[_0xf427('0x53')][_0xf427('0x58')](_0x197856)['then'](handleEntityNotFound(_0x2ca267,null))['then'](respondWithResult(_0x2ca267,null))[_0xf427('0x2a')](handleError(_0x2ca267,null));};exports['create']=function(_0x2d9cfb,_0x4a2835,_0x2af7fa){var _0x12c54c;return db[_0xf427('0x59')]['transaction'](function(_0x372be5){return db['Network'][_0xf427('0x5a')](_0x2d9cfb[_0xf427('0x5b')],{'raw':!![]})['then'](function(_0x50f66f){_0x12c54c=_0x50f66f;return db['Network'][_0xf427('0x4f')]({'where':{'type':_0x2d9cfb[_0xf427('0x5b')][_0xf427('0x3c')]},'raw':!![]});})[_0xf427('0x21')](function(_0x274a3f){if(_0x12c54c['type'][_0xf427('0x5c')]()==_0xf427('0x5d')){var _0x46b1ca=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xf427('0x5e'));var _0x5b8927=ejs[_0xf427('0x5f')](_0x46b1ca,{'networks':_0x274a3f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x5b8927);return respondWithRpcPromise('Reload','create',{'module':_0xf427('0x60')});}else if(_0x12c54c[_0xf427('0x3c')]['toUpperCase']()==_0xf427('0x61')){var _0x32f3f1=fs[_0xf427('0x62')](path['join'](config[_0xf427('0x63')],_0xf427('0x64')),_0xf427('0x5e'));var _0x1e15f8=ejs[_0xf427('0x5f')](_0x32f3f1,{'networks':_0x274a3f||[]});fs[_0xf427('0x65')](_0xf427('0x66'),_0x1e15f8);return respondWithRpcPromise(_0xf427('0x67'),_0xf427('0x5a'),{'module':_0xf427('0x60')});}else{var _0x4af236=fs[_0xf427('0x62')](path[_0xf427('0x68')](config[_0xf427('0x63')],'server/files/templates/network.ejs'),_0xf427('0x5e'));var _0x83a989=ejs[_0xf427('0x5f')](_0x4af236,{'networks':_0x274a3f||[]});fs[_0xf427('0x65')](util[_0xf427('0x69')](_0xf427('0x6a'),_0x2d9cfb['body'][_0xf427('0x3c')][_0xf427('0x6b')]()),_0x83a989);return respondWithRpcPromise('Reload',_0xf427('0x5a'),{'module':_0xf427('0x6c')});}return null;})[_0xf427('0x21')](function(){return _0x12c54c;});})['then'](respondWithResult(_0x4a2835,0xc9))[_0xf427('0x2a')](handleError(_0x4a2835,null));};exports[_0xf427('0x35')]=function(_0x331a3e,_0x3c1b4f,_0x3973aa){var _0x40bac0;return db[_0xf427('0x59')]['transaction'](function(_0x432cb9){return db['Network'][_0xf427('0x58')]({'where':{'id':_0x331a3e['params']['id']}})[_0xf427('0x21')](handleEntityNotFound(_0x3c1b4f,null))[_0xf427('0x21')](saveUpdates(_0x331a3e[_0xf427('0x5b')],null))[_0xf427('0x21')](function(_0x4a1067){if(_0x4a1067){_0x40bac0=_0x4a1067;return db[_0xf427('0x53')][_0xf427('0x4f')]({'where':{'type':_0x40bac0[_0xf427('0x3c')]},'raw':!![]});}return null;})[_0xf427('0x21')](function(_0x3cf752){if(_0x40bac0['type'][_0xf427('0x5c')]()==_0xf427('0x5d')){var _0x1cd96e=fs[_0xf427('0x62')](path[_0xf427('0x68')](config['root'],_0xf427('0x6d')),_0xf427('0x5e'));var _0x5ced40=ejs[_0xf427('0x5f')](_0x1cd96e,{'networks':_0x3cf752||[]});fs[_0xf427('0x65')]('/etc/asterisk/stun_xcally.conf',_0x5ced40);return respondWithRpcPromise(_0xf427('0x67'),_0xf427('0x35'),{'module':_0xf427('0x60')});}else if(_0x40bac0[_0xf427('0x3c')][_0xf427('0x5c')]()=='TURN'){var _0x5f485f=fs[_0xf427('0x62')](path['join'](config[_0xf427('0x63')],_0xf427('0x64')),_0xf427('0x5e'));var _0x51c9ea=ejs[_0xf427('0x5f')](_0x5f485f,{'networks':_0x3cf752||[]});fs[_0xf427('0x65')](_0xf427('0x66'),_0x51c9ea);return respondWithRpcPromise('Reload',_0xf427('0x35'),{'module':'res_stun_monitor.so'});}else{var _0x2650a9=fs[_0xf427('0x62')](path['join'](config[_0xf427('0x63')],_0xf427('0x6e')),_0xf427('0x5e'));var _0x27e05e=ejs['render'](_0x2650a9,{'networks':_0x3cf752||[]});fs[_0xf427('0x65')](util[_0xf427('0x69')](_0xf427('0x6a'),_0x331a3e['body'][_0xf427('0x3c')]['toLowerCase']()),_0x27e05e);return respondWithRpcPromise('Reload','update',{'module':_0xf427('0x6c')});}return null;})[_0xf427('0x21')](function(_0x13902b){if(_0x13902b){return _0x40bac0;}return null;});})[_0xf427('0x21')](respondWithResult(_0x3c1b4f,null))[_0xf427('0x2a')](handleError(_0x3c1b4f,null));};exports[_0xf427('0x6f')]=function(_0x4e8f2b,_0x4ed2a9,_0xd1559a){var _0x43ab78;return db[_0xf427('0x53')][_0xf427('0x58')]({'where':{'id':_0x4e8f2b[_0xf427('0x52')]['id']}})['then'](function(_0x5e942f){_0x43ab78=_0x5e942f;return _0x5e942f;})[_0xf427('0x21')](handleEntityNotFound(_0x4ed2a9,null))[_0xf427('0x21')](removeEntity(_0x4ed2a9,null))[_0xf427('0x21')](function(){if(_0x43ab78){return db[_0xf427('0x53')][_0xf427('0x4f')]({'where':{'type':_0x43ab78[_0xf427('0x3c')]},'raw':!![]});}})['then'](function(_0x7746e){if(_0x43ab78['type'][_0xf427('0x5c')]()==_0xf427('0x5d')){var _0x5d148=fs[_0xf427('0x62')](path[_0xf427('0x68')](config[_0xf427('0x63')],_0xf427('0x6d')),_0xf427('0x5e'));var _0x346b18=ejs[_0xf427('0x5f')](_0x5d148,{'networks':_0x7746e||[]});fs[_0xf427('0x65')](_0xf427('0x70'),_0x346b18);return respondWithRpcPromise(_0xf427('0x67'),_0xf427('0x6f'),{'module':'res_stun_monitor.so'});}else if(_0x43ab78[_0xf427('0x3c')][_0xf427('0x5c')]()==_0xf427('0x61')){var _0x166d24=fs['readFileSync'](path[_0xf427('0x68')](config[_0xf427('0x63')],'server/files/templates/turn_multiple.ejs'),_0xf427('0x5e'));var _0x42893f=ejs[_0xf427('0x5f')](_0x166d24,{'networks':_0x7746e||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x42893f);return respondWithRpcPromise(_0xf427('0x67'),_0xf427('0x6f'),{'module':'res_stun_monitor.so'});}else{var _0x1c9732=fs['readFileSync'](path[_0xf427('0x68')](config[_0xf427('0x63')],_0xf427('0x6e')),_0xf427('0x5e'));var _0xe097ad=ejs['render'](_0x1c9732,{'networks':_0x7746e||[]});fs['writeFileSync'](util[_0xf427('0x69')](_0xf427('0x6a'),_0x4e8f2b[_0xf427('0x5b')]['type'][_0xf427('0x6b')]()),_0xe097ad);return respondWithRpcPromise(_0xf427('0x67'),'destroy',{'module':_0xf427('0x6c')});}return null;})['catch'](handleError(_0x4ed2a9,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8940268..8990209 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 _0xcb79=['exports','define','Network','network','lodash','util','../../config/logger','api','bluebird','rimraf'];(function(_0x4ed3c3,_0x44ccc1){var _0x6215b9=function(_0x381cb3){while(--_0x381cb3){_0x4ed3c3['push'](_0x4ed3c3['shift']());}};_0x6215b9(++_0x44ccc1);}(_0xcb79,0xe0));var _0x9cb7=function(_0x4cbe23,_0x53c1aa){_0x4cbe23=_0x4cbe23-0x0;var _0x2045d=_0xcb79[_0x4cbe23];return _0x2045d;};'use strict';var _=require(_0x9cb7('0x0'));var util=require(_0x9cb7('0x1'));var logger=require(_0x9cb7('0x2'))(_0x9cb7('0x3'));var moment=require('moment');var BPromise=require(_0x9cb7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9cb7('0x5'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0x9cb7('0x6')]=function(_0x221900,_0x39c7b6){return _0x221900[_0x9cb7('0x7')](_0x9cb7('0x8'),attributes,{'tableName':_0x9cb7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fc6=['network','lodash','util','request-promise','rimraf','./network.attributes','exports','define'];(function(_0x5166d2,_0x327d63){var _0x46a9f1=function(_0x542d20){while(--_0x542d20){_0x5166d2['push'](_0x5166d2['shift']());}};_0x46a9f1(++_0x327d63);}(_0x1fc6,0xe1));var _0x61fc=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x1fc6[_0x11f249];return _0x5c3656;};'use strict';var _=require(_0x61fc('0x0'));var util=require(_0x61fc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x61fc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61fc('0x3'));var config=require('../../config/environment');var attributes=require(_0x61fc('0x4'));module[_0x61fc('0x5')]=function(_0x260b92,_0xb9c712){return _0x260b92[_0x61fc('0x6')]('Network',attributes,{'tableName':_0x61fc('0x7'),'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 fd614f3..bc1e1dc 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 _0x1401=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1401,0x138));var _0x1140=function(_0x18a47f,_0x46c322){_0x18a47f=_0x18a47f-0x0;var _0x321c5c=_0x1401[_0x18a47f];return _0x321c5c;};'use strict';var _=require(_0x1140('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1140('0x1'));var rs=require(_0x1140('0x2'));var fs=require('fs');var Redis=require(_0x1140('0x3'));var db=require(_0x1140('0x4'))['db'];var utils=require(_0x1140('0x5'));var logger=require(_0x1140('0x6'))('rpc');var config=require(_0x1140('0x7'));var jayson=require(_0x1140('0x8'));var client=jayson['client'][_0x1140('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2750a1,_0xdf8302,_0x57780){return new BPromise(function(_0x2a8e83,_0x453fc8){return client[_0x1140('0xa')](_0x2750a1,_0x57780)['then'](function(_0x5f49ef){logger[_0x1140('0xb')](_0x1140('0xc'),_0xdf8302,_0x1140('0xd'));logger[_0x1140('0xe')](_0x1140('0xf'),_0xdf8302,'request\x20sent',JSON[_0x1140('0x10')](_0x5f49ef));if(_0x5f49ef[_0x1140('0x11')]){if(_0x5f49ef[_0x1140('0x11')][_0x1140('0x12')]===0x1f4){logger[_0x1140('0x11')]('Network,\x20%s,\x20%s',_0xdf8302,_0x5f49ef[_0x1140('0x11')]['message']);return _0x453fc8(_0x5f49ef[_0x1140('0x11')][_0x1140('0x13')]);}logger['error'](_0x1140('0xc'),_0xdf8302,_0x5f49ef[_0x1140('0x11')][_0x1140('0x13')]);return _0x2a8e83(_0x5f49ef[_0x1140('0x11')][_0x1140('0x13')]);}else{logger['info'](_0x1140('0xc'),_0xdf8302,_0x1140('0xd'));_0x2a8e83(_0x5f49ef['result']['message']);}})[_0x1140('0x14')](function(_0x12ab1e){logger[_0x1140('0x11')](_0x1140('0xc'),_0xdf8302,_0x12ab1e);_0x453fc8(_0x12ab1e);});});} \ No newline at end of file +var _0x38e7=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29678a,_0xd09044){var _0xd762b6=function(_0x4c6944){while(--_0x4c6944){_0x29678a['push'](_0x29678a['shift']());}};_0xd762b6(++_0xd09044);}(_0x38e7,0x163));var _0x738e=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x38e7[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x738e('0x0'));var util=require('util');var moment=require(_0x738e('0x1'));var BPromise=require(_0x738e('0x2'));var rs=require(_0x738e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x738e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x738e('0x5'))(_0x738e('0x6'));var config=require(_0x738e('0x7'));var jayson=require(_0x738e('0x8'));var client=jayson[_0x738e('0x9')][_0x738e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x458eb2,_0x1eb253,_0x4b92c5){return new BPromise(function(_0x699efe,_0x340679){return client[_0x738e('0xb')](_0x458eb2,_0x4b92c5)['then'](function(_0x388c84){logger['info'](_0x738e('0xc'),_0x1eb253,_0x738e('0xd'));logger[_0x738e('0xe')](_0x738e('0xf'),_0x1eb253,_0x738e('0xd'),JSON[_0x738e('0x10')](_0x388c84));if(_0x388c84[_0x738e('0x11')]){if(_0x388c84[_0x738e('0x11')][_0x738e('0x12')]===0x1f4){logger[_0x738e('0x11')]('Network,\x20%s,\x20%s',_0x1eb253,_0x388c84[_0x738e('0x11')]['message']);return _0x340679(_0x388c84[_0x738e('0x11')][_0x738e('0x13')]);}logger[_0x738e('0x11')](_0x738e('0xc'),_0x1eb253,_0x388c84[_0x738e('0x11')][_0x738e('0x13')]);return _0x699efe(_0x388c84[_0x738e('0x11')][_0x738e('0x13')]);}else{logger['info'](_0x738e('0xc'),_0x1eb253,_0x738e('0xd'));_0x699efe(_0x388c84[_0x738e('0x14')][_0x738e('0x13')]);}})[_0x738e('0x15')](function(_0x3a7125){logger[_0x738e('0x11')]('Network,\x20%s,\x20%s',_0x1eb253,_0x3a7125);_0x340679(_0x3a7125);});});} \ No newline at end of file diff --git a/server/api/notification/index.js b/server/api/notification/index.js index fd69c73..df5f495 100644 --- a/server/api/notification/index.js +++ b/server/api/notification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8293=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./notification.controller','post','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8293,0x18b));var _0x3829=function(_0x62fb19,_0x4cdf40){_0x62fb19=_0x62fb19-0x0;var _0x36becf=_0x8293[_0x62fb19];return _0x36becf;};'use strict';var multer=require(_0x3829('0x0'));var util=require(_0x3829('0x1'));var path=require(_0x3829('0x2'));var timeout=require(_0x3829('0x3'));var express=require(_0x3829('0x4'));var router=express[_0x3829('0x5')]();var auth=require(_0x3829('0x6'));var interaction=require(_0x3829('0x7'));var config=require(_0x3829('0x8'));var controller=require(_0x3829('0x9'));router[_0x3829('0xa')]('/',auth['isAuthenticated'](),controller['sendNotification']);module['exports']=router; \ No newline at end of file +var _0x1cde=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./notification.controller','post','isAuthenticated','sendNotification','exports'];(function(_0x31eadf,_0x504e95){var _0x1ed651=function(_0x516330){while(--_0x516330){_0x31eadf['push'](_0x31eadf['shift']());}};_0x1ed651(++_0x504e95);}(_0x1cde,0x1dc));var _0xe1cd=function(_0x1ff9cf,_0x410efd){_0x1ff9cf=_0x1ff9cf-0x0;var _0x45f8ff=_0x1cde[_0x1ff9cf];return _0x45f8ff;};'use strict';var multer=require(_0xe1cd('0x0'));var util=require(_0xe1cd('0x1'));var path=require(_0xe1cd('0x2'));var timeout=require(_0xe1cd('0x3'));var express=require(_0xe1cd('0x4'));var router=express[_0xe1cd('0x5')]();var auth=require(_0xe1cd('0x6'));var interaction=require(_0xe1cd('0x7'));var config=require(_0xe1cd('0x8'));var controller=require(_0xe1cd('0x9'));router[_0xe1cd('0xa')]('/',auth[_0xe1cd('0xb')](),controller[_0xe1cd('0xc')]);module[_0xe1cd('0xd')]=router; \ No newline at end of file diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js index 7c70a1a..eff7043 100644 --- a/server/api/notification/notification.attributes.js +++ b/server/api/notification/notification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf57c=['TEXT','STRING','BOOLEAN','exports'];(function(_0x48aaca,_0x140945){var _0xac5ed9=function(_0x180b19){while(--_0x180b19){_0x48aaca['push'](_0x48aaca['shift']());}};_0xac5ed9(++_0x140945);}(_0xf57c,0xb7));var _0xcf57=function(_0x4e7a0d,_0xb49b8c){_0x4e7a0d=_0x4e7a0d-0x0;var _0x3ed3d1=_0xf57c[_0x4e7a0d];return _0x3ed3d1;};'use strict';var Sequelize=require('sequelize');module[_0xcf57('0x0')]={'body':{'type':Sequelize[_0xcf57('0x1')]},'senderName':{'type':Sequelize[_0xcf57('0x2')]},'recipientsId':{'type':Sequelize[_0xcf57('0x1')]},'recipientsDescription':{'type':Sequelize[_0xcf57('0x2')]},'beep':{'type':Sequelize[_0xcf57('0x3')]}}; \ No newline at end of file +var _0x1bb6=['exports','TEXT','STRING','sequelize'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x1bb6,0x10f));var _0x61bb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1bb6[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x61bb('0x0'));module[_0x61bb('0x1')]={'body':{'type':Sequelize[_0x61bb('0x2')]},'senderName':{'type':Sequelize[_0x61bb('0x3')]},'recipientsId':{'type':Sequelize[_0x61bb('0x2')]},'recipientsDescription':{'type':Sequelize[_0x61bb('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js index a277b7f..26fe8bf 100644 --- a/server/api/notification/notification.controller.js +++ b/server/api/notification/notification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x522b=['sortBy','join','sequelize','transaction','Notification','create','recipient','emit','notification:send','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','forEach','User','ids','queue','replace','Queue','push','getAgents','map','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','name','send','sendNotification','hasOwnProperty','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','user','recipientsId'];(function(_0x1bba4c,_0x2d2378){var _0x4780a7=function(_0x57613d){while(--_0x57613d){_0x1bba4c['push'](_0x1bba4c['shift']());}};_0x4780a7(++_0x2d2378);}(_0x522b,0x1a0));var _0xb522=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x522b[_0x1e4f2f];return _0xccea89;};'use strict';var pdf=require(_0xb522('0x0'));var emlformat=require(_0xb522('0x1'));var rimraf=require(_0xb522('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb522('0x3'));var rp=require(_0xb522('0x4'));var moment=require(_0xb522('0x5'));var BPromise=require(_0xb522('0x6'));var Mustache=require(_0xb522('0x7'));var util=require(_0xb522('0x8'));var path=require(_0xb522('0x9'));var sox=require(_0xb522('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb522('0xb'));var squel=require('squel');var crypto=require(_0xb522('0xc'));var jsforce=require(_0xb522('0xd'));var deskjs=require(_0xb522('0xe'));var toCsv=require(_0xb522('0xf'));var querystring=require(_0xb522('0x10'));var Papa=require('papaparse');var Redis=require(_0xb522('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb522('0x12'));var as=require(_0xb522('0x13'));var hardwareService=require(_0xb522('0x14'));var logger=require(_0xb522('0x15'))('api');var utils=require(_0xb522('0x16'));var config=require(_0xb522('0x17'));var db=require(_0xb522('0x18'))['db'];config[_0xb522('0x19')]=_[_0xb522('0x1a')](config[_0xb522('0x19')],{'host':_0xb522('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./notification.socket')[_0xb522('0x1c')](socket);function respondWithStatusCode(_0x562af4,_0x5d13e7){_0x5d13e7=_0x5d13e7||0xcc;return function(_0x505b44){if(_0x505b44){return _0x562af4[_0xb522('0x1d')](_0x5d13e7);}return _0x562af4[_0xb522('0x1e')](_0x5d13e7)[_0xb522('0x1f')]();};}function respondWithResult(_0x136c90,_0x3b864f){_0x3b864f=_0x3b864f||0xc8;return function(_0x6b3e77){if(_0x6b3e77){return _0x136c90[_0xb522('0x1e')](_0x3b864f)[_0xb522('0x20')](_0x6b3e77);}};}function respondWithFilteredResult(_0x40b8b8,_0x1b4cb2){return function(_0xae5b1){if(_0xae5b1){var _0x1f0748=_0xae5b1[_0xb522('0x21')],_0x559917=_0x1b4cb2['offset'],_0x2840e0=_0x1b4cb2[_0xb522('0x22')]+_0x1b4cb2[_0xb522('0x23')],_0x240f9a;if(_0x2840e0>=_0x1f0748){_0x2840e0=_0x1f0748;_0x240f9a=0xc8;}else{_0x240f9a=0xce;}_0x40b8b8[_0xb522('0x1e')](_0x240f9a);return _0x40b8b8[_0xb522('0x24')](_0xb522('0x25'),_0x559917+'-'+_0x2840e0+'/'+_0x1f0748)[_0xb522('0x20')](_0xae5b1);}return null;};}function patchUpdates(_0x593f8e){return function(_0x1c5613){try{jsonpatch[_0xb522('0x26')](_0x1c5613,_0x593f8e,!![]);}catch(_0x25fa15){return BPromise['reject'](_0x25fa15);}return _0x1c5613[_0xb522('0x27')]();};}function saveUpdates(_0x43aadc,_0x13e9c6){return function(_0x19bff2){if(_0x19bff2){return _0x19bff2[_0xb522('0x28')](_0x43aadc)['then'](function(_0xb812d2){return _0xb812d2;});}return null;};}function removeEntity(_0x389e69,_0x32c9d4){return function(_0x554eba){if(_0x554eba){return _0x554eba[_0xb522('0x29')]()[_0xb522('0x2a')](function(){_0x389e69[_0xb522('0x1e')](0xcc)[_0xb522('0x1f')]();});}};}function handleEntityNotFound(_0x390875,_0x1f05b0){return function(_0x3a9f54){if(!_0x3a9f54){_0x390875[_0xb522('0x1d')](0x194);}return _0x3a9f54;};}function handleError(_0x5790c5,_0x4699d8){_0x4699d8=_0x4699d8||0x1f4;return function(_0x541992){logger[_0xb522('0x2b')](_0x541992['stack']);if(_0x541992['name']){delete _0x541992[_0xb522('0x2c')];}_0x5790c5[_0xb522('0x1e')](_0x4699d8)[_0xb522('0x2d')](_0x541992);};}exports[_0xb522('0x2e')]=function(_0x59d25f,_0x246e03,_0x1a7ecd){if(!_0x59d25f['body'][_0xb522('0x2f')]('text')&&!_0x59d25f[_0xb522('0x30')]['hasOwnProperty'](_0xb522('0x31'))){throw new db[(_0xb522('0x32'))]['ValidationError'](_0xb522('0x33'));}else{if(_0x59d25f['body'][_0xb522('0x2f')]('TemplateId')&&!_0x59d25f['body'][_0xb522('0x2f')](_0xb522('0x34'))){throw new db[(_0xb522('0x32'))][(_0xb522('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x59d25f[_0xb522('0x30')][_0xb522('0x2f')](_0xb522('0x36'))){throw new db[(_0xb522('0x32'))][(_0xb522('0x35'))](_0xb522('0x37'));}else{try{var _0x4c6251=JSON[_0xb522('0x38')](_0x59d25f['body']['recipients']);}catch(_0x380660){logger[_0xb522('0x2b')](_0x380660);throw new db['Sequelize'][(_0xb522('0x35'))](_0xb522('0x39'));}var _0x2776e9=[_0xb522('0x3a'),_0xb522('0x3b'),_0xb522('0x3c'),_0xb522('0x3d'),'smsqueue',_0xb522('0x3e'),_0xb522('0x3f'),'team','user'];if(_[_0xb522('0x40')](_0x4c6251,function(_0x18de7d){return!_[_0xb522('0x41')](_0x2776e9,_0x18de7d[_0xb522('0x42')]['toLowerCase']());})){throw new db[(_0xb522('0x32'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4f6d71={};_0x4f6d71[_0xb522('0x43')]=_0x59d25f[_0xb522('0x30')][_0xb522('0x2f')](_0xb522('0x43'))?_0x59d25f[_0xb522('0x30')][_0xb522('0x43')]:_0x59d25f['user'][_0xb522('0x44')];_0x4f6d71[_0xb522('0x45')]=_[_0xb522('0x46')](_0x59d25f[_0xb522('0x30')]['recipientsDescription'])?null:_0x59d25f['body'][_0xb522('0x45')];_0x4f6d71[_0xb522('0x47')]=_0x59d25f[_0xb522('0x30')][_0xb522('0x47')]||![];_0x4f6d71['SenderId']=_0x59d25f[_0xb522('0x48')]['id'];return getContent(_0x59d25f[_0xb522('0x30')])[_0xb522('0x2a')](function(_0x3b4be2){_0x4f6d71[_0xb522('0x30')]=_0x3b4be2;return getRecipients(_0x4c6251);})[_0xb522('0x2a')](function(_0x68b847){_0x4f6d71[_0xb522('0x49')]=_[_0xb522('0x4a')](_0x68b847)[_0xb522('0x4b')](',');return db[_0xb522('0x4c')][_0xb522('0x4d')](function(_0x53e2f0){return db[_0xb522('0x4e')][_0xb522('0x4f')](_0x4f6d71,{'raw':!![],'transaction':_0x53e2f0})[_0xb522('0x2a')](function(_0x293e83){var _0x187460={'sender':_0x4f6d71[_0xb522('0x43')],'description':_0x4f6d71['recipientsDescription'],'content':_0x4f6d71[_0xb522('0x30')],'beep':_0x4f6d71['beep']};_0x68b847['forEach'](function(_0x5e545c){_0x187460[_0xb522('0x50')]=_0x5e545c;socket[_0xb522('0x51')](_0xb522('0x52'),_0x187460);});return _0x293e83;});});})[_0xb522('0x2a')](respondWithResult(_0x246e03,0xc9))['catch'](handleError(_0x246e03,null));};function getContent(_0xd22336){return new BPromise(function(_0x48ab64,_0x4dfe7e){if(_0xd22336[_0xb522('0x53')]){_0x48ab64(_0xd22336['text']);return;}return db[_0xb522('0x54')][_0xb522('0x55')]({'attributes':['html'],'where':{'id':_0xd22336['TemplateId']},'raw':!![]})[_0xb522('0x2a')](function(_0x2ce92a){if(!_0x2ce92a)throw new db[(_0xb522('0x32'))][(_0xb522('0x35'))](_0xb522('0x56'));var _0x128bf4=Mustache[_0xb522('0x57')](_0x2ce92a['html'],_0xd22336[_0xb522('0x34')]);_0x48ab64(_0x128bf4);})[_0xb522('0x58')](function(_0x1786d7){_0x4dfe7e(_0x1786d7);});});}function getRecipients(_0x3e19b5){return new BPromise(function(_0xb25d48,_0x430349){var _0x4d0110=[];var _0x4ec757=[];_0x3e19b5[_0xb522('0x59')](function(_0x5ab63e){var _0x298608=_['startCase'](_0x5ab63e[_0xb522('0x42')]['toLowerCase']());if(_0x298608===_0xb522('0x5a')){_0x4d0110=_['union'](_0x4d0110,_0x5ab63e[_0xb522('0x5b')]);}else{if(_[_0xb522('0x41')](_0x298608,_0xb522('0x5c')))_0x298608=_0x298608[_0xb522('0x5d')](_0xb522('0x5c'),_0xb522('0x5e'));_0x5ab63e[_0xb522('0x5b')][_0xb522('0x59')](function(_0x48b45c){_0x4ec757[_0xb522('0x5f')](getAgents(_0x298608,_0x48b45c));});}});return BPromise['all'](_0x4ec757)[_0xb522('0x2a')](function(_0xc215e9){_0x4d0110=_['union'](_0x4d0110,_['flatten'](_0xc215e9));_0xb25d48(_0x4d0110);})['catch'](function(_0x45d05f){_0x430349(_0x45d05f);});});}function getAgents(_0x4de672,_0x4db67e){return new BPromise(function(_0x4647d6,_0x46aecc){return db[_0x4de672]['findOne']({'where':{'id':_0x4db67e}})[_0xb522('0x2a')](function(_0x264e3f){return _0x264e3f[_0xb522('0x60')]({'attributes':['id'],'raw':!![]})[_0xb522('0x2a')](function(_0x10eed2){var _0x50e0ea=_[_0xb522('0x61')](_0x10eed2,'id');_0x4647d6(_0x50e0ea);});})[_0xb522('0x58')](function(_0x536815){_0x46aecc(_0x536815);});});} \ No newline at end of file +var _0x15c8=['model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','forEach','recipient','emit','notification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','User','queue','replace','Queue','ids','all','union','flatten','getAgents','map','html-pdf','eml-format','rimraf','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./notification.socket','register','sendStatus','json','offset','set','Content-Range','reject','update','then','destroy','end','error','name','status','send','sendNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','includes'];(function(_0x4d7169,_0x558b4e){var _0x59f92e=function(_0x586d7d){while(--_0x586d7d){_0x4d7169['push'](_0x4d7169['shift']());}};_0x59f92e(++_0x558b4e);}(_0x15c8,0x1a2));var _0x815c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x15c8[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x815c('0x0'));var emlformat=require(_0x815c('0x1'));var rimraf=require(_0x815c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x815c('0x3'));var BPromise=require(_0x815c('0x4'));var Mustache=require('mustache');var util=require(_0x815c('0x5'));var path=require(_0x815c('0x6'));var sox=require(_0x815c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x815c('0x8'));var squel=require(_0x815c('0x9'));var crypto=require('crypto');var jsforce=require(_0x815c('0xa'));var deskjs=require(_0x815c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x815c('0xc'));var Papa=require('papaparse');var Redis=require(_0x815c('0xd'));var authService=require(_0x815c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x815c('0xf'));var hardwareService=require(_0x815c('0x10'));var logger=require(_0x815c('0x11'))(_0x815c('0x12'));var utils=require(_0x815c('0x13'));var config=require(_0x815c('0x14'));var db=require(_0x815c('0x15'))['db'];config[_0x815c('0x16')]=_[_0x815c('0x17')](config['redis'],{'host':_0x815c('0x18'),'port':0x18eb});var socket=require(_0x815c('0x19'))(new Redis(config[_0x815c('0x16')]));require(_0x815c('0x1a'))[_0x815c('0x1b')](socket);function respondWithStatusCode(_0x1b4203,_0x42090c){_0x42090c=_0x42090c||0xcc;return function(_0x777c58){if(_0x777c58){return _0x1b4203[_0x815c('0x1c')](_0x42090c);}return _0x1b4203['status'](_0x42090c)['end']();};}function respondWithResult(_0x586443,_0x4e2403){_0x4e2403=_0x4e2403||0xc8;return function(_0xafba3b){if(_0xafba3b){return _0x586443['status'](_0x4e2403)[_0x815c('0x1d')](_0xafba3b);}};}function respondWithFilteredResult(_0x40b536,_0x32cb57){return function(_0x3f61f6){if(_0x3f61f6){var _0x1e9742=_0x3f61f6['count'],_0x1c7d1e=_0x32cb57[_0x815c('0x1e')],_0x13c4d3=_0x32cb57[_0x815c('0x1e')]+_0x32cb57['limit'],_0x492b88;if(_0x13c4d3>=_0x1e9742){_0x13c4d3=_0x1e9742;_0x492b88=0xc8;}else{_0x492b88=0xce;}_0x40b536['status'](_0x492b88);return _0x40b536[_0x815c('0x1f')](_0x815c('0x20'),_0x1c7d1e+'-'+_0x13c4d3+'/'+_0x1e9742)[_0x815c('0x1d')](_0x3f61f6);}return null;};}function patchUpdates(_0x1f29fe){return function(_0x4b0787){try{jsonpatch['apply'](_0x4b0787,_0x1f29fe,!![]);}catch(_0x46f01e){return BPromise[_0x815c('0x21')](_0x46f01e);}return _0x4b0787['save']();};}function saveUpdates(_0x2ca2c2,_0x407533){return function(_0x3ebb0c){if(_0x3ebb0c){return _0x3ebb0c[_0x815c('0x22')](_0x2ca2c2)[_0x815c('0x23')](function(_0x187d09){return _0x187d09;});}return null;};}function removeEntity(_0x5268cd,_0x19a00b){return function(_0x310444){if(_0x310444){return _0x310444[_0x815c('0x24')]()[_0x815c('0x23')](function(){_0x5268cd['status'](0xcc)[_0x815c('0x25')]();});}};}function handleEntityNotFound(_0x5efa3e,_0x47c3f0){return function(_0x1366af){if(!_0x1366af){_0x5efa3e[_0x815c('0x1c')](0x194);}return _0x1366af;};}function handleError(_0x2bcba3,_0x53e658){_0x53e658=_0x53e658||0x1f4;return function(_0x42ce7d){logger[_0x815c('0x26')](_0x42ce7d['stack']);if(_0x42ce7d[_0x815c('0x27')]){delete _0x42ce7d[_0x815c('0x27')];}_0x2bcba3[_0x815c('0x28')](_0x53e658)[_0x815c('0x29')](_0x42ce7d);};}exports[_0x815c('0x2a')]=function(_0x40c09b,_0x2cae21,_0x83f495){if(!_0x40c09b[_0x815c('0x2b')][_0x815c('0x2c')](_0x815c('0x2d'))&&!_0x40c09b['body'][_0x815c('0x2c')](_0x815c('0x2e'))){throw new db[(_0x815c('0x2f'))][(_0x815c('0x30'))](_0x815c('0x31'));}else{if(_0x40c09b['body'][_0x815c('0x2c')](_0x815c('0x2e'))&&!_0x40c09b[_0x815c('0x2b')]['hasOwnProperty']('view')){throw new db[(_0x815c('0x2f'))][(_0x815c('0x30'))](_0x815c('0x32'));}if(!_0x40c09b[_0x815c('0x2b')]['hasOwnProperty'](_0x815c('0x33'))){throw new db[(_0x815c('0x2f'))][(_0x815c('0x30'))](_0x815c('0x34'));}else{try{var _0x786a36=JSON[_0x815c('0x35')](_0x40c09b[_0x815c('0x2b')][_0x815c('0x33')]);}catch(_0x5e9b91){logger[_0x815c('0x26')](_0x5e9b91);throw new db[(_0x815c('0x2f'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x1dfc86=[_0x815c('0x36'),_0x815c('0x37'),_0x815c('0x38'),_0x815c('0x39'),_0x815c('0x3a'),'voicequeue',_0x815c('0x3b'),_0x815c('0x3c'),'user'];if(_['some'](_0x786a36,function(_0x4b8a9d){return!_[_0x815c('0x3d')](_0x1dfc86,_0x4b8a9d[_0x815c('0x3e')][_0x815c('0x3f')]());})){throw new db[(_0x815c('0x2f'))][(_0x815c('0x30'))](_0x815c('0x40'));}}}var _0x31cb1e={};_0x31cb1e[_0x815c('0x41')]=_0x40c09b['body'][_0x815c('0x2c')](_0x815c('0x41'))?_0x40c09b[_0x815c('0x2b')][_0x815c('0x41')]:_0x40c09b['user'][_0x815c('0x42')];_0x31cb1e['recipientsDescription']=_['isEmpty'](_0x40c09b[_0x815c('0x2b')][_0x815c('0x43')])?null:_0x40c09b[_0x815c('0x2b')]['recipientsDescription'];_0x31cb1e['beep']=_0x40c09b[_0x815c('0x2b')][_0x815c('0x44')]||![];_0x31cb1e[_0x815c('0x45')]=_0x40c09b['user']['id'];return getContent(_0x40c09b['body'])[_0x815c('0x23')](function(_0x283156){_0x31cb1e[_0x815c('0x2b')]=_0x283156;return getRecipients(_0x786a36);})[_0x815c('0x23')](function(_0x2111cd){_0x31cb1e[_0x815c('0x46')]=_[_0x815c('0x47')](_0x2111cd)[_0x815c('0x48')](',');return db[_0x815c('0x49')][_0x815c('0x4a')](function(_0x4ed2f7){return db['Notification'][_0x815c('0x4b')](_0x31cb1e,{'raw':!![],'transaction':_0x4ed2f7})[_0x815c('0x23')](function(_0x75998c){var _0x3ded79={'sender':_0x31cb1e[_0x815c('0x41')],'description':_0x31cb1e['recipientsDescription'],'content':_0x31cb1e[_0x815c('0x2b')],'beep':_0x31cb1e[_0x815c('0x44')]};_0x2111cd[_0x815c('0x4c')](function(_0x374b0d){_0x3ded79[_0x815c('0x4d')]=_0x374b0d;socket[_0x815c('0x4e')](_0x815c('0x4f'),_0x3ded79);});return _0x75998c;});});})[_0x815c('0x23')](respondWithResult(_0x2cae21,0xc9))[_0x815c('0x50')](handleError(_0x2cae21,null));};function getContent(_0x175f0e){return new BPromise(function(_0x178c10,_0x6b8ac6){if(_0x175f0e[_0x815c('0x2d')]){_0x178c10(_0x175f0e[_0x815c('0x2d')]);return;}return db[_0x815c('0x51')]['findOne']({'attributes':[_0x815c('0x52')],'where':{'id':_0x175f0e[_0x815c('0x2e')]},'raw':!![]})['then'](function(_0x53aa16){if(!_0x53aa16)throw new db['Sequelize'][(_0x815c('0x30'))](_0x815c('0x53'));var _0x561ab5=Mustache['render'](_0x53aa16[_0x815c('0x52')],_0x175f0e[_0x815c('0x54')]);_0x178c10(_0x561ab5);})[_0x815c('0x50')](function(_0x45ca2e){_0x6b8ac6(_0x45ca2e);});});}function getRecipients(_0x162b9a){return new BPromise(function(_0x368d5e,_0x157dc7){var _0x242021=[];var _0x644ce8=[];_0x162b9a[_0x815c('0x4c')](function(_0x1e25a3){var _0x35ddaa=_[_0x815c('0x55')](_0x1e25a3[_0x815c('0x3e')][_0x815c('0x3f')]());if(_0x35ddaa===_0x815c('0x56')){_0x242021=_['union'](_0x242021,_0x1e25a3['ids']);}else{if(_[_0x815c('0x3d')](_0x35ddaa,_0x815c('0x57')))_0x35ddaa=_0x35ddaa[_0x815c('0x58')](_0x815c('0x57'),_0x815c('0x59'));_0x1e25a3[_0x815c('0x5a')][_0x815c('0x4c')](function(_0x41b6e2){_0x644ce8['push'](getAgents(_0x35ddaa,_0x41b6e2));});}});return BPromise[_0x815c('0x5b')](_0x644ce8)[_0x815c('0x23')](function(_0x11cd3d){_0x242021=_[_0x815c('0x5c')](_0x242021,_[_0x815c('0x5d')](_0x11cd3d));_0x368d5e(_0x242021);})[_0x815c('0x50')](function(_0x523efd){_0x157dc7(_0x523efd);});});}function getAgents(_0x1e85ef,_0x49c27f){return new BPromise(function(_0x4b6b8d,_0x33937f){return db[_0x1e85ef]['findOne']({'where':{'id':_0x49c27f}})[_0x815c('0x23')](function(_0x25534b){return _0x25534b[_0x815c('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0xefad60){var _0x5392f5=_[_0x815c('0x5f')](_0xefad60,'id');_0x4b6b8d(_0x5392f5);});})[_0x815c('0x50')](function(_0x7c3d42){_0x33937f(_0x7c3d42);});});} \ No newline at end of file diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js index e530bf3..37e5747 100644 --- a/server/api/notification/notification.events.js +++ b/server/api/notification/notification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','../../mysqldb','Notification','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x2032,0xd9));var _0x2203=function(_0x5dcfb1,_0x5659f3){_0x5dcfb1=_0x5dcfb1-0x0;var _0x5b08da=_0x2032[_0x5dcfb1];return _0x5b08da;};'use strict';var EventEmitter=require('events');var Notification=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){NotificationEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);NotificationEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];Notification[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=NotificationEvents; \ No newline at end of file +var _0x757a=['../../mysqldb','Notification','remove','emit','hasOwnProperty','hook'];(function(_0x491e09,_0xee12f3){var _0x2a9218=function(_0x57a635){while(--_0x57a635){_0x491e09['push'](_0x491e09['shift']());}};_0x2a9218(++_0xee12f3);}(_0x757a,0xde));var _0xa757=function(_0x2c347e,_0x29b29a){_0x2c347e=_0x2c347e-0x0;var _0x29603a=_0x757a[_0x2c347e];return _0x29603a;};'use strict';var EventEmitter=require('events');var Notification=require(_0xa757('0x0'))['db'][_0xa757('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa757('0x2')};function emitEvent(_0x1721c6){return function(_0x1c2932,_0x453d07,_0x32630d){NotificationEvents[_0xa757('0x3')](_0x1721c6+':'+_0x1c2932['id'],_0x1c2932);NotificationEvents['emit'](_0x1721c6,_0x1c2932);_0x32630d(null);};}for(var e in events){if(events[_0xa757('0x4')](e)){var event=events[e];Notification[_0xa757('0x5')](e,emitEvent(event));}}module['exports']=NotificationEvents; \ No newline at end of file diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js index 1ee0921..8ffa8b7 100644 --- a/server/api/notification/notification.model.js +++ b/server/api/notification/notification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d18=['path','./notification.attributes','exports','define','Notification','notifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ada78,_0x104fb7){var _0x38f686=function(_0x5d094c){while(--_0x5d094c){_0x3ada78['push'](_0x3ada78['shift']());}};_0x38f686(++_0x104fb7);}(_0x2d18,0x1e8));var _0x82d1=function(_0x5ef1a3,_0x399b81){_0x5ef1a3=_0x5ef1a3-0x0;var _0x18331b=_0x2d18[_0x5ef1a3];return _0x18331b;};'use strict';var _=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var logger=require(_0x82d1('0x2'))(_0x82d1('0x3'));var moment=require(_0x82d1('0x4'));var BPromise=require(_0x82d1('0x5'));var rp=require(_0x82d1('0x6'));var fs=require('fs');var path=require(_0x82d1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x82d1('0x8'));module[_0x82d1('0x9')]=function(_0x3bc656,_0x50f997){return _0x3bc656[_0x82d1('0xa')](_0x82d1('0xb'),attributes,{'tableName':_0x82d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x82d1('0xd'),'collate':_0x82d1('0xe')});}; \ No newline at end of file +var _0x2fc1=['request-promise','../../config/environment','define','notifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0x2fc1,0xa6));var _0x12fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x12fc('0x0'));var util=require(_0x12fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x12fc('0x2'));var BPromise=require(_0x12fc('0x3'));var rp=require(_0x12fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12fc('0x5'));var attributes=require('./notification.attributes');module['exports']=function(_0x172dcd,_0x1b2bde){return _0x172dcd[_0x12fc('0x6')]('Notification',attributes,{'tableName':_0x12fc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12fc('0x8'),'collate':_0x12fc('0x9')});}; \ No newline at end of file diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js index 0ec09e8..70cff00 100644 --- a/server/api/notification/notification.rpc.js +++ b/server/api/notification/notification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05c2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./notification.socket','request','then','info','Notification,\x20%s,\x20%s','Notification,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x05c2,0x1b8));var _0x205c=function(_0x451dea,_0x20874f){_0x451dea=_0x451dea-0x0;var _0x185d38=_0x05c2[_0x451dea];return _0x185d38;};'use strict';var _=require('lodash');var util=require(_0x205c('0x0'));var moment=require(_0x205c('0x1'));var BPromise=require(_0x205c('0x2'));var rs=require(_0x205c('0x3'));var fs=require('fs');var Redis=require(_0x205c('0x4'));var db=require(_0x205c('0x5'))['db'];var utils=require(_0x205c('0x6'));var logger=require(_0x205c('0x7'))('rpc');var config=require(_0x205c('0x8'));var jayson=require(_0x205c('0x9'));var client=jayson[_0x205c('0xa')][_0x205c('0xb')]({'port':0x232a});config[_0x205c('0xc')]=_[_0x205c('0xd')](config[_0x205c('0xc')],{'host':_0x205c('0xe'),'port':0x18eb});var socket=require(_0x205c('0xf'))(new Redis(config[_0x205c('0xc')]));require(_0x205c('0x10'))['register'](socket);function respondWithRpcPromise(_0x1b9ca1,_0x4c2188,_0x8c7d47){return new BPromise(function(_0x29e6ad,_0x1510a1){return client[_0x205c('0x11')](_0x1b9ca1,_0x8c7d47)[_0x205c('0x12')](function(_0x4af896){logger[_0x205c('0x13')](_0x205c('0x14'),_0x4c2188,'request\x20sent');logger['debug'](_0x205c('0x15'),_0x4c2188,'request\x20sent',JSON['stringify'](_0x4af896));if(_0x4af896[_0x205c('0x16')]){if(_0x4af896[_0x205c('0x16')]['code']===0x1f4){logger['error'](_0x205c('0x14'),_0x4c2188,_0x4af896['error'][_0x205c('0x17')]);return _0x1510a1(_0x4af896[_0x205c('0x16')]['message']);}logger['error'](_0x205c('0x14'),_0x4c2188,_0x4af896[_0x205c('0x16')][_0x205c('0x17')]);return _0x29e6ad(_0x4af896[_0x205c('0x16')][_0x205c('0x17')]);}else{logger[_0x205c('0x13')](_0x205c('0x14'),_0x4c2188,'request\x20sent');_0x29e6ad(_0x4af896[_0x205c('0x18')][_0x205c('0x17')]);}})[_0x205c('0x19')](function(_0x39cf22){logger['error'](_0x205c('0x14'),_0x4c2188,_0x39cf22);_0x1510a1(_0x39cf22);});});} \ No newline at end of file +var _0x33f0=['lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./notification.socket','register','request','Notification,\x20%s,\x20%s','debug','Notification,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x482c95,_0x504190){var _0x38c2e8=function(_0x5685df){while(--_0x5685df){_0x482c95['push'](_0x482c95['shift']());}};_0x38c2e8(++_0x504190);}(_0x33f0,0x1c2));var _0x033f=function(_0x5d1617,_0x105414){_0x5d1617=_0x5d1617-0x0;var _0x2ae921=_0x33f0[_0x5d1617];return _0x2ae921;};'use strict';var _=require(_0x033f('0x0'));var util=require('util');var moment=require(_0x033f('0x1'));var BPromise=require('bluebird');var rs=require(_0x033f('0x2'));var fs=require('fs');var Redis=require(_0x033f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x033f('0x4'));var logger=require(_0x033f('0x5'))(_0x033f('0x6'));var config=require(_0x033f('0x7'));var jayson=require(_0x033f('0x8'));var client=jayson[_0x033f('0x9')][_0x033f('0xa')]({'port':0x232a});config[_0x033f('0xb')]=_['defaults'](config[_0x033f('0xb')],{'host':_0x033f('0xc'),'port':0x18eb});var socket=require(_0x033f('0xd'))(new Redis(config[_0x033f('0xb')]));require(_0x033f('0xe'))[_0x033f('0xf')](socket);function respondWithRpcPromise(_0x4cea78,_0x300310,_0xe81f73){return new BPromise(function(_0x24b821,_0x54fa63){return client[_0x033f('0x10')](_0x4cea78,_0xe81f73)['then'](function(_0x59792c){logger['info'](_0x033f('0x11'),_0x300310,'request\x20sent');logger[_0x033f('0x12')](_0x033f('0x13'),_0x300310,'request\x20sent',JSON[_0x033f('0x14')](_0x59792c));if(_0x59792c[_0x033f('0x15')]){if(_0x59792c['error']['code']===0x1f4){logger[_0x033f('0x15')]('Notification,\x20%s,\x20%s',_0x300310,_0x59792c[_0x033f('0x15')][_0x033f('0x16')]);return _0x54fa63(_0x59792c[_0x033f('0x15')][_0x033f('0x16')]);}logger['error'](_0x033f('0x11'),_0x300310,_0x59792c[_0x033f('0x15')]['message']);return _0x24b821(_0x59792c[_0x033f('0x15')][_0x033f('0x16')]);}else{logger[_0x033f('0x17')](_0x033f('0x11'),_0x300310,'request\x20sent');_0x24b821(_0x59792c['result']['message']);}})[_0x033f('0x18')](function(_0x59c97e){logger[_0x033f('0x15')](_0x033f('0x11'),_0x300310,_0x59c97e);_0x54fa63(_0x59c97e);});});} \ No newline at end of file diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js index 82ddfe5..1e82ae6 100644 --- a/server/api/notification/notification.socket.js +++ b/server/api/notification/notification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd36=['update','emit','register','length','notification:','./notification.events','remove'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xdd36,0xfa));var _0x6dd3=function(_0x691be6,_0x24ca8d){_0x691be6=_0x691be6-0x0;var _0x259a51=_0xdd36[_0x691be6];return _0x259a51;};'use strict';var NotificationEvents=require(_0x6dd3('0x0'));var events=['save',_0x6dd3('0x1'),_0x6dd3('0x2')];function createListener(_0x5191aa,_0x5b0c7b){return function(_0x2ae041){_0x5b0c7b[_0x6dd3('0x3')](_0x5191aa,_0x2ae041);};}function removeListener(_0x2428d4,_0x20487e){return function(){NotificationEvents['removeListener'](_0x2428d4,_0x20487e);};}exports[_0x6dd3('0x4')]=function(_0x58ec2c){for(var _0x4e6dc0=0x0,_0x2de678=events[_0x6dd3('0x5')];_0x4e6dc0<_0x2de678;_0x4e6dc0++){var _0xd1398f=events[_0x4e6dc0];var _0x14896a=createListener(_0x6dd3('0x6')+_0xd1398f,_0x58ec2c);NotificationEvents['on'](_0xd1398f,_0x14896a);}}; \ No newline at end of file +var _0xa687=['remove','update','emit','removeListener','register','length','notification:','./notification.events','save'];(function(_0x22a6f6,_0x5d6ea9){var _0x464440=function(_0x147c88){while(--_0x147c88){_0x22a6f6['push'](_0x22a6f6['shift']());}};_0x464440(++_0x5d6ea9);}(_0xa687,0x1e4));var _0x7a68=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xa687[_0x6dd5c];return _0x5a87fa;};'use strict';var NotificationEvents=require(_0x7a68('0x0'));var events=[_0x7a68('0x1'),_0x7a68('0x2'),_0x7a68('0x3')];function createListener(_0xf3992e,_0x399524){return function(_0x118578){_0x399524[_0x7a68('0x4')](_0xf3992e,_0x118578);};}function removeListener(_0x5ddcb3,_0x1f899c){return function(){NotificationEvents[_0x7a68('0x5')](_0x5ddcb3,_0x1f899c);};}exports[_0x7a68('0x6')]=function(_0x42e2a5){for(var _0x18fbec=0x0,_0x2eb106=events[_0x7a68('0x7')];_0x18fbec<_0x2eb106;_0x18fbec++){var _0x2b9a17=events[_0x18fbec];var _0x19ad11=createListener(_0x7a68('0x8')+_0x2b9a17,_0x42e2a5);NotificationEvents['on'](_0x2b9a17,_0x19ad11);}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index e0dfee4..fc2fbee 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 _0x972f=['/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAgents','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0xf2682d,_0x48f012){var _0x53dea0=function(_0x47235e){while(--_0x47235e){_0xf2682d['push'](_0xf2682d['shift']());}};_0x53dea0(++_0x48f012);}(_0x972f,0xcf));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf972('0x0'));var util=require(_0xf972('0x1'));var path=require('path');var timeout=require(_0xf972('0x2'));var express=require('express');var router=express[_0xf972('0x3')]();var auth=require(_0xf972('0x4'));var interaction=require(_0xf972('0x5'));var config=require(_0xf972('0x6'));var controller=require(_0xf972('0x7'));router['get']('/',auth[_0xf972('0x8')](),controller[_0xf972('0x9')]);router[_0xf972('0xa')](_0xf972('0xb'),auth[_0xf972('0x8')](),controller[_0xf972('0xc')]);router[_0xf972('0xa')](_0xf972('0xd'),auth[_0xf972('0x8')](),controller[_0xf972('0xe')]);router[_0xf972('0xa')](_0xf972('0xf'),auth[_0xf972('0x8')](),controller[_0xf972('0x10')]);router[_0xf972('0xa')](_0xf972('0x11'),auth[_0xf972('0x8')](),controller['getAnswers']);router[_0xf972('0xa')]('/:id/applications',auth[_0xf972('0x8')](),controller[_0xf972('0x12')]);router['get'](_0xf972('0x13'),auth[_0xf972('0x8')](),controller['getInteractions']);router['get'](_0xf972('0x14'),auth[_0xf972('0x8')](),controller[_0xf972('0x15')]);router[_0xf972('0x16')]('/',auth['isAuthenticated'](),controller[_0xf972('0x17')]);router['post'](_0xf972('0xf'),auth['isAuthenticated'](),controller[_0xf972('0x18')]);router[_0xf972('0x16')](_0xf972('0x11'),auth[_0xf972('0x8')](),controller[_0xf972('0x19')]);router[_0xf972('0x16')]('/:id/notify',controller[_0xf972('0x1a')]);router['post'](_0xf972('0x1b'),auth[_0xf972('0x8')](),controller[_0xf972('0x1c')]);router[_0xf972('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xf972('0x1d')]);router[_0xf972('0x16')](_0xf972('0x1e'),auth[_0xf972('0x8')](),controller[_0xf972('0x1f')]);router[_0xf972('0x20')](_0xf972('0xd'),auth[_0xf972('0x8')](),controller['update']);router[_0xf972('0x21')]('/:id',auth[_0xf972('0x8')](),controller[_0xf972('0x22')]);router[_0xf972('0x21')](_0xf972('0xf'),auth[_0xf972('0x8')](),controller[_0xf972('0x23')]);router['delete'](_0xf972('0x11'),auth[_0xf972('0x8')](),controller['removeAnswers']);router[_0xf972('0x21')](_0xf972('0x14'),auth[_0xf972('0x8')](),controller[_0xf972('0x24')]);module['exports']=router; \ No newline at end of file +var _0x946d=['addApplications','send','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','/:id/applications'];(function(_0xeacdd0,_0x413eb9){var _0x224d1f=function(_0x2131b3){while(--_0x2131b3){_0xeacdd0['push'](_0xeacdd0['shift']());}};_0x224d1f(++_0x413eb9);}(_0x946d,0x170));var _0xd946=function(_0xe85c7f,_0x5c4c1e){_0xe85c7f=_0xe85c7f-0x0;var _0x1ce111=_0x946d[_0xe85c7f];return _0x1ce111;};'use strict';var multer=require(_0xd946('0x0'));var util=require('util');var path=require(_0xd946('0x1'));var timeout=require(_0xd946('0x2'));var express=require(_0xd946('0x3'));var router=express[_0xd946('0x4')]();var auth=require(_0xd946('0x5'));var interaction=require(_0xd946('0x6'));var config=require('../../config/environment');var controller=require(_0xd946('0x7'));router[_0xd946('0x8')]('/',auth[_0xd946('0x9')](),controller[_0xd946('0xa')]);router[_0xd946('0x8')](_0xd946('0xb'),auth['isAuthenticated'](),controller[_0xd946('0xc')]);router[_0xd946('0x8')](_0xd946('0xd'),auth[_0xd946('0x9')](),controller[_0xd946('0xe')]);router[_0xd946('0x8')](_0xd946('0xf'),auth['isAuthenticated'](),controller[_0xd946('0x10')]);router[_0xd946('0x8')](_0xd946('0x11'),auth[_0xd946('0x9')](),controller[_0xd946('0x12')]);router['get']('/:id/applications',auth[_0xd946('0x9')](),controller[_0xd946('0x13')]);router['get']('/:id/interactions',auth[_0xd946('0x9')](),controller[_0xd946('0x14')]);router[_0xd946('0x8')](_0xd946('0x15'),auth[_0xd946('0x9')](),controller[_0xd946('0x16')]);router[_0xd946('0x17')]('/',auth[_0xd946('0x9')](),controller[_0xd946('0x18')]);router[_0xd946('0x17')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xd946('0x19')]);router['post'](_0xd946('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xd946('0x17')](_0xd946('0x1a'),controller['notify']);router[_0xd946('0x17')](_0xd946('0x1b'),auth[_0xd946('0x9')](),controller[_0xd946('0x1c')]);router[_0xd946('0x17')](_0xd946('0x15'),auth[_0xd946('0x9')](),controller['addAgents']);router[_0xd946('0x17')]('/:id/send',auth[_0xd946('0x9')](),controller[_0xd946('0x1d')]);router[_0xd946('0x1e')](_0xd946('0xd'),auth[_0xd946('0x9')](),controller[_0xd946('0x1f')]);router[_0xd946('0x20')]('/:id',auth[_0xd946('0x9')](),controller[_0xd946('0x21')]);router['delete'](_0xd946('0xf'),auth['isAuthenticated'](),controller[_0xd946('0x22')]);router[_0xd946('0x20')](_0xd946('0x11'),auth[_0xd946('0x9')](),controller['removeAnswers']);router[_0xd946('0x20')](_0xd946('0x15'),auth[_0xd946('0x9')](),controller['removeAgents']);module[_0xd946('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 5f36bf0..fa7d891 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 _0x686c=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING'];(function(_0xcc5bbb,_0x24e724){var _0x24874e=function(_0x4df2b3){while(--_0x4df2b3){_0xcc5bbb['push'](_0xcc5bbb['shift']());}};_0x24874e(++_0x24e724);}(_0x686c,0xcf));var _0xc686=function(_0x18eeb7,_0x3af8d2){_0x18eeb7=_0x18eeb7-0x0;var _0x177221=_0x686c[_0x18eeb7];return _0x177221;};'use strict';var Sequelize=require(_0xc686('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xc686('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xc686('0x1')]},'token':{'type':Sequelize[_0xc686('0x1')],'defaultValue':function(){return rs[_0xc686('0x2')]();}},'replyUri':{'type':Sequelize[_0xc686('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc686('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc686('0x3')],'defaultValue':function(){return _0xc686('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc686('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc686('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc686('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc686('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc686('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc686('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc686('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xc686('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xc686('0x5')],'defaultValue':![],'comment':_0xc686('0x8'),'set':function(_0x478f62){if(!_0x478f62)this['setDataValue'](_0xc686('0x9'),null);this['setDataValue'](_0xc686('0xa'),_0x478f62);}}}; \ No newline at end of file +var _0xdb75=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x59069b,_0x2f3ac0){var _0x37b657=function(_0x2f9329){while(--_0x2f9329){_0x59069b['push'](_0x59069b['shift']());}};_0x37b657(++_0x2f3ac0);}(_0xdb75,0x14d));var _0x5db7=function(_0x20fb90,_0x4c9e4e){_0x20fb90=_0x20fb90-0x0;var _0x25cba1=_0xdb75[_0x20fb90];return _0x25cba1;};'use strict';var Sequelize=require(_0x5db7('0x0'));var rs=require(_0x5db7('0x1'));module[_0x5db7('0x2')]={'name':{'type':Sequelize[_0x5db7('0x3')],'unique':_0x5db7('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x5db7('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5db7('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x5db7('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5db7('0x6')],'defaultValue':function(){return _0x5db7('0x7');}},'notificationSound':{'type':Sequelize[_0x5db7('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5db7('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5db7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x5db7('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5db7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5db7('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5db7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5db7('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x5db7('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x5db7('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x171cb4){if(!_0x171cb4)this[_0x5db7('0xb')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5db7('0xc'),_0x171cb4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ca1b7fa..a9dddfd 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 _0xa35b=['end','count','offset','Content-Range','json','apply','save','update','get','OpenchannelAccounts','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','length','limit','pick','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','OpenchannelAccountId','findAll','removeAnswers','notify','openchannel','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','applications','Applications','list','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','created','interaction','autoclose','push','close','OpenchannelMessage','User','UserId','unshift','agent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.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','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status'];(function(_0x5408c5,_0x317c67){var _0x2c9fe0=function(_0x4cbd5a){while(--_0x4cbd5a){_0x5408c5['push'](_0x5408c5['shift']());}};_0x2c9fe0(++_0x317c67);}(_0xa35b,0x14e));var _0xba35=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa35b[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0xba35('0x0'));var emlformat=require(_0xba35('0x1'));var rimraf=require(_0xba35('0x2'));var zipdir=require(_0xba35('0x3'));var jsonpatch=require(_0xba35('0x4'));var rp=require(_0xba35('0x5'));var moment=require(_0xba35('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xba35('0x7'));var path=require(_0xba35('0x8'));var sox=require(_0xba35('0x9'));var csv=require(_0xba35('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba35('0xb'));var squel=require('squel');var crypto=require(_0xba35('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba35('0xa'));var querystring=require(_0xba35('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba35('0xe'));var qs=require(_0xba35('0xf'));var as=require(_0xba35('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba35('0x11'));var utils=require(_0xba35('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xba35('0x13')]=_[_0xba35('0x14')](config['redis'],{'host':_0xba35('0x15'),'port':0x18eb});var socket=require(_0xba35('0x16'))(new Redis(config[_0xba35('0x13')]));require(_0xba35('0x17'))[_0xba35('0x18')](socket);var jayson=require(_0xba35('0x19'));var client=jayson[_0xba35('0x1a')][_0xba35('0x1b')]({'port':0x232c});var client9002=jayson[_0xba35('0x1a')][_0xba35('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x359c8a,_0x58d451,_0x1025d8){if(_0x1025d8){var _0xe83efa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe83efa[_0xba35('0x1c')](_0x58d451)){return _0x359c8a;}else{throw new db[(_0xba35('0x1d'))][(_0xba35('0x1e'))](_0xba35('0x1f'));}}else{return _0x359c8a;}}function respondWithRpcPromise(_0x1894c4,_0x3f4b4c,_0x3224d0,_0x1b61a0){return new BPromise(function(_0x511412,_0x573eda){var _0x56e0cf=_0x1b61a0||client;return _0x56e0cf[_0xba35('0x20')](_0x1894c4,_0x3224d0)[_0xba35('0x21')](function(_0x26d980){logger['info'](_0xba35('0x22'),_0x3f4b4c,_0xba35('0x23'));logger['debug'](_0xba35('0x24'),_0x3f4b4c,_0xba35('0x23'),JSON[_0xba35('0x25')](_0x26d980));if(_0x26d980[_0xba35('0x26')]){if(_0x26d980[_0xba35('0x26')][_0xba35('0x27')]===0x1f4){logger['error'](_0xba35('0x22'),_0x3f4b4c,_0x26d980['error'][_0xba35('0x28')]);return _0x573eda(_0x26d980[_0xba35('0x26')][_0xba35('0x28')]);}logger['error'](_0xba35('0x22'),_0x3f4b4c,_0x26d980[_0xba35('0x26')]['message']);return _0x511412(_0x26d980[_0xba35('0x26')][_0xba35('0x28')]);}else{logger[_0xba35('0x29')](_0xba35('0x22'),_0x3f4b4c,_0xba35('0x23'));_0x511412(_0x26d980[_0xba35('0x2a')][_0xba35('0x28')]);}})['catch'](function(_0x4562e5){logger['error'](_0xba35('0x22'),_0x3f4b4c,_0x4562e5);_0x573eda(_0x4562e5);});});}function respondWithStatusCode(_0x7bfcf2,_0x2d4be3){_0x2d4be3=_0x2d4be3||0xcc;return function(_0xbd9186){if(_0xbd9186){return _0x7bfcf2['sendStatus'](_0x2d4be3);}return _0x7bfcf2[_0xba35('0x2b')](_0x2d4be3)[_0xba35('0x2c')]();};}function respondWithResult(_0x5d8fb2,_0x5db180){_0x5db180=_0x5db180||0xc8;return function(_0x92887a){if(_0x92887a){return _0x5d8fb2[_0xba35('0x2b')](_0x5db180)['json'](_0x92887a);}};}function respondWithFilteredResult(_0x54501a,_0x574372){return function(_0x31f7fb){if(_0x31f7fb){var _0xc0c9c4=_0x31f7fb[_0xba35('0x2d')],_0xd0594=_0x574372['offset'],_0x18b50f=_0x574372[_0xba35('0x2e')]+_0x574372['limit'],_0x14dea7;if(_0x18b50f>=_0xc0c9c4){_0x18b50f=_0xc0c9c4;_0x14dea7=0xc8;}else{_0x14dea7=0xce;}_0x54501a[_0xba35('0x2b')](_0x14dea7);return _0x54501a['set'](_0xba35('0x2f'),_0xd0594+'-'+_0x18b50f+'/'+_0xc0c9c4)[_0xba35('0x30')](_0x31f7fb);}return null;};}function patchUpdates(_0x1a5424){return function(_0x15bb20){try{jsonpatch[_0xba35('0x31')](_0x15bb20,_0x1a5424,!![]);}catch(_0x5918de){return BPromise['reject'](_0x5918de);}return _0x15bb20[_0xba35('0x32')]();};}function saveUpdates(_0x57d811,_0x1e15d9){return function(_0x47ea7f){if(_0x47ea7f){return _0x47ea7f[_0xba35('0x33')](_0x57d811)['then'](function(_0x2273ae){return _0x2273ae;});}return null;};}function removeEntity(_0x51cf7b,_0x27429e){return function(_0x20d6a3){if(_0x20d6a3){return _0x20d6a3['destroy']()[_0xba35('0x21')](function(){var _0x3f3c01=_0x20d6a3[_0xba35('0x34')]({'plain':!![]});var _0x70c45e=_0xba35('0x35');return db['UserProfileResource'][_0xba35('0x36')]({'where':{'type':_0x70c45e,'resourceId':_0x3f3c01['id']}})[_0xba35('0x21')](function(){return _0x20d6a3;});})[_0xba35('0x21')](function(){_0x51cf7b['status'](0xcc)[_0xba35('0x2c')]();});}};}function handleEntityNotFound(_0xd96f61,_0x261232){return function(_0x28ea4a){if(!_0x28ea4a){_0xd96f61[_0xba35('0x37')](0x194);}return _0x28ea4a;};}function handleError(_0x1a85b6,_0x342885){_0x342885=_0x342885||0x1f4;return function(_0x438eef){logger[_0xba35('0x26')](_0x438eef[_0xba35('0x38')]);if(_0x438eef[_0xba35('0x39')]){delete _0x438eef['name'];}_0x1a85b6[_0xba35('0x2b')](_0x342885)[_0xba35('0x3a')](_0x438eef);};}exports[_0xba35('0x3b')]=function(_0x4824b0,_0x3879a6){var _0x46e32e={'include':[{'model':db[_0xba35('0x3c')],'as':_0xba35('0x3d')}]},_0x49fb41={},_0x586e35={'count':0x0,'rows':[]};var _0x3ec369=_[_0xba35('0x3e')](db[_0xba35('0x3f')][_0xba35('0x40')],function(_0x593020){return{'name':_0x593020[_0xba35('0x41')],'type':_0x593020['type'][_0xba35('0x42')]};});_0x49fb41[_0xba35('0x43')]=_[_0xba35('0x3e')](_0x3ec369,_0xba35('0x39'));_0x49fb41['query']=_[_0xba35('0x44')](_0x4824b0['query']);_0x49fb41[_0xba35('0x45')]=_[_0xba35('0x46')](_0x49fb41['model'],_0x49fb41[_0xba35('0x47')]);_0x46e32e['attributes']=_[_0xba35('0x46')](_0x49fb41['model'],qs[_0xba35('0x48')](_0x4824b0[_0xba35('0x47')][_0xba35('0x48')]));_0x46e32e[_0xba35('0x49')]=_0x46e32e[_0xba35('0x49')]['length']?_0x46e32e[_0xba35('0x49')]:_0x49fb41[_0xba35('0x43')];if(!_0x4824b0['query'][_0xba35('0x4a')](_0xba35('0x4b'))){_0x46e32e['limit']=qs['limit'](_0x4824b0[_0xba35('0x47')]['limit']);_0x46e32e['offset']=qs[_0xba35('0x2e')](_0x4824b0[_0xba35('0x47')][_0xba35('0x2e')]);}_0x46e32e[_0xba35('0x4c')]=qs[_0xba35('0x4d')](_0x4824b0['query']['sort']);_0x46e32e[_0xba35('0x4e')]=qs[_0xba35('0x45')](_['pick'](_0x4824b0[_0xba35('0x47')],_0x49fb41[_0xba35('0x45')]),_0x3ec369);if(_0x4824b0[_0xba35('0x47')][_0xba35('0x4f')]){_0x46e32e[_0xba35('0x4e')]=_['merge'](_0x46e32e[_0xba35('0x4e')],{'$or':_['map'](_0x3ec369,function(_0x58c7b5){if(_0x58c7b5[_0xba35('0x50')]!=='VIRTUAL'){var _0x3483eb={};_0x3483eb[_0x58c7b5[_0xba35('0x39')]]={'$like':'%'+_0x4824b0[_0xba35('0x47')][_0xba35('0x4f')]+'%'};return _0x3483eb;}})});}_0x46e32e=_[_0xba35('0x51')]({},_0x46e32e,_0x4824b0[_0xba35('0x52')]);var _0x2e5f27={'where':_0x46e32e[_0xba35('0x4e')]};return db[_0xba35('0x3f')][_0xba35('0x2d')](_0x2e5f27)[_0xba35('0x21')](function(_0x815b7d){_0x586e35['count']=_0x815b7d;if(_0x4824b0[_0xba35('0x47')][_0xba35('0x53')]){_0x46e32e[_0xba35('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x46e32e);})[_0xba35('0x21')](function(_0x11c596){_0x586e35[_0xba35('0x55')]=_0x11c596;return _0x586e35;})['then'](respondWithFilteredResult(_0x3879a6,_0x46e32e))[_0xba35('0x56')](handleError(_0x3879a6,null));};exports[_0xba35('0x57')]=function(_0x18cda8,_0x773a24){var _0x27ed25={'raw':![],'where':{'id':_0x18cda8[_0xba35('0x58')]['id']},'include':[{'model':db[_0xba35('0x3c')],'as':_0xba35('0x3d')}]},_0x2aee3f={};_0x2aee3f[_0xba35('0x43')]=_[_0xba35('0x44')](db[_0xba35('0x3f')][_0xba35('0x40')]);_0x2aee3f[_0xba35('0x47')]=_[_0xba35('0x44')](_0x18cda8['query']);_0x2aee3f[_0xba35('0x45')]=_[_0xba35('0x46')](_0x2aee3f[_0xba35('0x43')],_0x2aee3f['query']);_0x27ed25[_0xba35('0x49')]=_[_0xba35('0x46')](_0x2aee3f[_0xba35('0x43')],qs[_0xba35('0x48')](_0x18cda8[_0xba35('0x47')][_0xba35('0x48')]));_0x27ed25['attributes']=_0x27ed25['attributes']['length']?_0x27ed25['attributes']:_0x2aee3f[_0xba35('0x43')];if(_0x18cda8['query'][_0xba35('0x53')]){_0x27ed25['include']=[{'all':!![]}];}_0x27ed25=_[_0xba35('0x51')]({},_0x27ed25,_0x18cda8[_0xba35('0x52')]);return db[_0xba35('0x3f')][_0xba35('0x59')](_0x27ed25)[_0xba35('0x21')](handleEntityNotFound(_0x773a24,null))['then'](respondWithResult(_0x773a24,null))[_0xba35('0x56')](handleError(_0x773a24,null));};exports[_0xba35('0x5a')]=function(_0x56c94f,_0xe52f3e){return db[_0xba35('0x3f')][_0xba35('0x5a')](_0x56c94f[_0xba35('0x5b')],{})[_0xba35('0x21')](function(_0x2d3009){var _0x1da43e=_0x56c94f[_0xba35('0x5c')]['get']({'plain':!![]});if(!_0x1da43e)throw new Error(_0xba35('0x5d'));if(_0x1da43e[_0xba35('0x5e')]==='user'){var _0x3f5525=_0x2d3009['get']({'plain':!![]});var _0x561db2=_0xba35('0x35');return db['UserProfileSection'][_0xba35('0x59')]({'where':{'name':_0x561db2,'userProfileId':_0x1da43e[_0xba35('0x5f')]},'raw':!![]})[_0xba35('0x21')](function(_0x1b865a){if(_0x1b865a&&_0x1b865a[_0xba35('0x60')]===0x0){return db[_0xba35('0x61')][_0xba35('0x5a')]({'name':_0x3f5525[_0xba35('0x39')],'resourceId':_0x3f5525['id'],'type':_0x1b865a[_0xba35('0x39')],'sectionId':_0x1b865a['id']},{})[_0xba35('0x21')](function(){return _0x2d3009;});}else{return _0x2d3009;}})[_0xba35('0x56')](function(_0x24da5d){logger[_0xba35('0x26')](_0xba35('0x62'),_0x24da5d);throw _0x24da5d;});}return _0x2d3009;})[_0xba35('0x21')](respondWithResult(_0xe52f3e,0xc9))['catch'](handleError(_0xe52f3e,null));};exports[_0xba35('0x33')]=function(_0x3d8aaa,_0x19dec7){if(_0x3d8aaa['body']['id']){delete _0x3d8aaa[_0xba35('0x5b')]['id'];}return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x3d8aaa['params']['id']},'include':[{'model':db[_0xba35('0x3c')],'as':_0xba35('0x3d')}]})[_0xba35('0x21')](handleEntityNotFound(_0x19dec7,null))['then'](saveUpdates(_0x3d8aaa[_0xba35('0x5b')],null))['then'](respondWithResult(_0x19dec7,null))[_0xba35('0x56')](handleError(_0x19dec7,null));};exports[_0xba35('0x36')]=function(_0x180651,_0x3712af){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x180651[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x3712af,null))[_0xba35('0x21')](removeEntity(_0x3712af,null))[_0xba35('0x56')](handleError(_0x3712af,null));};exports[_0xba35('0x63')]=function(_0x269f25,_0xe8f696){return db[_0xba35('0x3f')][_0xba35('0x63')]()['then'](respondWithResult(_0xe8f696,null))['catch'](handleError(_0xe8f696,null));};exports[_0xba35('0x64')]=function(_0x52324e,_0x128535,_0x478575){if(_0x52324e[_0xba35('0x5b')]['id']){delete _0x52324e[_0xba35('0x5b')]['id'];}return db[_0xba35('0x3f')]['find']({'where':{'id':_0x52324e['params']['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x128535,null))['then'](function(_0xa98f98){if(_0xa98f98){_0x52324e[_0xba35('0x5b')][_0xba35('0x65')]=_0xa98f98['id'];return db['Disposition']['create'](_0x52324e[_0xba35('0x5b')]);}})[_0xba35('0x21')](respondWithResult(_0x128535,null))[_0xba35('0x56')](handleError(_0x128535,null));};exports[_0xba35('0x66')]=function(_0x374ae9,_0x18aeba,_0x248864){var _0x408a5a={'raw':![],'where':{}};var _0xe1ef5f={};var _0x14a5bd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xba35('0x67')]({'where':{'id':_0x374ae9[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x18aeba,null))[_0xba35('0x21')](function(_0x5d4f46){if(_0x5d4f46){_0xe1ef5f[_0xba35('0x43')]=_['keys'](db['Disposition'][_0xba35('0x40')]);_0xe1ef5f[_0xba35('0x47')]=_['keys'](_0x374ae9['query']);_0xe1ef5f[_0xba35('0x45')]=_[_0xba35('0x46')](_0xe1ef5f[_0xba35('0x43')],_0xe1ef5f[_0xba35('0x47')]);_0x408a5a[_0xba35('0x49')]=_[_0xba35('0x46')](_0xe1ef5f[_0xba35('0x43')],qs['fields'](_0x374ae9[_0xba35('0x47')][_0xba35('0x48')]));_0x408a5a[_0xba35('0x49')]=_0x408a5a[_0xba35('0x49')][_0xba35('0x68')]?_0x408a5a[_0xba35('0x49')]:_0xe1ef5f['model'];if(!_0x374ae9['query']['hasOwnProperty'](_0xba35('0x4b'))){_0x408a5a[_0xba35('0x69')]=qs[_0xba35('0x69')](_0x374ae9[_0xba35('0x47')][_0xba35('0x69')]);_0x408a5a[_0xba35('0x2e')]=qs[_0xba35('0x2e')](_0x374ae9[_0xba35('0x47')]['offset']);}_0x408a5a[_0xba35('0x4c')]=qs[_0xba35('0x4d')](_0x374ae9[_0xba35('0x47')][_0xba35('0x4d')]);_0x408a5a[_0xba35('0x4e')]=qs['filters'](_[_0xba35('0x6a')](_0x374ae9[_0xba35('0x47')],_0xe1ef5f[_0xba35('0x45')]));_0x408a5a[_0xba35('0x4e')]['OpenchannelAccountId']=_0x5d4f46['id'];if(_0x374ae9[_0xba35('0x47')]['filter']){_0x408a5a[_0xba35('0x4e')]=_[_0xba35('0x51')](_0x408a5a[_0xba35('0x4e')],{'$or':_[_0xba35('0x3e')](_0x408a5a[_0xba35('0x49')],function(_0x53105b){var _0x375dca={};_0x375dca[_0x53105b]={'$like':'%'+_0x374ae9['query']['filter']+'%'};return _0x375dca;})});}_0x408a5a=_['merge']({},_0x408a5a,_0x374ae9[_0xba35('0x52')]);return db[_0xba35('0x6b')]['count']({'where':_0x408a5a[_0xba35('0x4e')]})['then'](function(_0x2a4884){_0x14a5bd[_0xba35('0x2d')]=_0x2a4884;if(_0x374ae9[_0xba35('0x47')]['includeAll']){_0x408a5a['include']=[{'all':!![]}];}return db[_0xba35('0x6b')]['findAll'](_0x408a5a);})['then'](function(_0x3f92ac){_0x14a5bd['rows']=_0x3f92ac;return _0x14a5bd;});}})[_0xba35('0x21')](respondWithFilteredResult(_0x18aeba,_0x408a5a))[_0xba35('0x56')](handleError(_0x18aeba,null));};exports[_0xba35('0x6c')]=function(_0x241b36,_0x18a798,_0x23e81d){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x241b36[_0xba35('0x58')]['id']}})['then'](handleEntityNotFound(_0x18a798,null))[_0xba35('0x21')](function(_0x8b59e0){if(_0x8b59e0){return _0x8b59e0[_0xba35('0x6c')](_0x241b36[_0xba35('0x47')][_0xba35('0x6d')]);}})[_0xba35('0x21')](respondWithStatusCode(_0x18a798,null))['catch'](handleError(_0x18a798,null));};exports['addAnswer']=function(_0x412833,_0x1fd4d2,_0x46600a){if(_0x412833[_0xba35('0x5b')]['id']){delete _0x412833[_0xba35('0x5b')]['id'];}return db[_0xba35('0x3f')]['find']({'where':{'id':_0x412833[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x1fd4d2,null))[_0xba35('0x21')](function(_0x384afc){if(_0x384afc){_0x412833[_0xba35('0x5b')]['OpenchannelAccountId']=_0x384afc['id'];return db[_0xba35('0x6e')][_0xba35('0x5a')](_0x412833[_0xba35('0x5b')]);}})['then'](respondWithResult(_0x1fd4d2,null))['catch'](handleError(_0x1fd4d2,null));};exports[_0xba35('0x6f')]=function(_0x5a5447,_0x24eee2,_0x3550a3){var _0x4b5cb2={'raw':![],'where':{}};var _0x4bcc6a={};var _0x50ef6a={'count':0x0,'rows':[]};return db[_0xba35('0x3f')][_0xba35('0x67')]({'where':{'id':_0x5a5447[_0xba35('0x58')]['id']}})['then'](handleEntityNotFound(_0x24eee2,null))[_0xba35('0x21')](function(_0x16ca3e){if(_0x16ca3e){_0x4bcc6a['model']=_[_0xba35('0x44')](db['CannedAnswer'][_0xba35('0x40')]);_0x4bcc6a[_0xba35('0x47')]=_['keys'](_0x5a5447[_0xba35('0x47')]);_0x4bcc6a[_0xba35('0x45')]=_[_0xba35('0x46')](_0x4bcc6a[_0xba35('0x43')],_0x4bcc6a[_0xba35('0x47')]);_0x4b5cb2[_0xba35('0x49')]=_[_0xba35('0x46')](_0x4bcc6a['model'],qs[_0xba35('0x48')](_0x5a5447['query']['fields']));_0x4b5cb2[_0xba35('0x49')]=_0x4b5cb2['attributes'][_0xba35('0x68')]?_0x4b5cb2[_0xba35('0x49')]:_0x4bcc6a[_0xba35('0x43')];if(!_0x5a5447[_0xba35('0x47')][_0xba35('0x4a')](_0xba35('0x4b'))){_0x4b5cb2[_0xba35('0x69')]=qs[_0xba35('0x69')](_0x5a5447[_0xba35('0x47')][_0xba35('0x69')]);_0x4b5cb2[_0xba35('0x2e')]=qs[_0xba35('0x2e')](_0x5a5447[_0xba35('0x47')][_0xba35('0x2e')]);}_0x4b5cb2['order']=qs[_0xba35('0x4d')](_0x5a5447[_0xba35('0x47')][_0xba35('0x4d')]);_0x4b5cb2[_0xba35('0x4e')]=qs[_0xba35('0x45')](_[_0xba35('0x6a')](_0x5a5447[_0xba35('0x47')],_0x4bcc6a[_0xba35('0x45')]));_0x4b5cb2[_0xba35('0x4e')][_0xba35('0x70')]=_0x16ca3e['id'];if(_0x5a5447[_0xba35('0x47')][_0xba35('0x4f')]){_0x4b5cb2[_0xba35('0x4e')]=_[_0xba35('0x51')](_0x4b5cb2[_0xba35('0x4e')],{'$or':_[_0xba35('0x3e')](_0x4b5cb2[_0xba35('0x49')],function(_0xb6f408){var _0x472dde={};_0x472dde[_0xb6f408]={'$like':'%'+_0x5a5447[_0xba35('0x47')][_0xba35('0x4f')]+'%'};return _0x472dde;})});}_0x4b5cb2=_[_0xba35('0x51')]({},_0x4b5cb2,_0x5a5447['options']);return db[_0xba35('0x6e')][_0xba35('0x2d')]({'where':_0x4b5cb2[_0xba35('0x4e')]})[_0xba35('0x21')](function(_0x4f5686){_0x50ef6a[_0xba35('0x2d')]=_0x4f5686;if(_0x5a5447[_0xba35('0x47')][_0xba35('0x53')]){_0x4b5cb2['include']=[{'all':!![]}];}return db[_0xba35('0x6e')][_0xba35('0x71')](_0x4b5cb2);})[_0xba35('0x21')](function(_0x4ccad9){_0x50ef6a['rows']=_0x4ccad9;return _0x50ef6a;});}})['then'](respondWithFilteredResult(_0x24eee2,_0x4b5cb2))[_0xba35('0x56')](handleError(_0x24eee2,null));};exports['removeAnswers']=function(_0x3fd914,_0x4532d1,_0x1a177b){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x3fd914[_0xba35('0x58')]['id']}})['then'](handleEntityNotFound(_0x4532d1,null))[_0xba35('0x21')](function(_0x4029d3){if(_0x4029d3){return _0x4029d3[_0xba35('0x72')](_0x3fd914[_0xba35('0x47')][_0xba35('0x6d')]);}})['then'](respondWithStatusCode(_0x4532d1,null))[_0xba35('0x56')](handleError(_0x4532d1,null));};exports[_0xba35('0x73')]=function(_0x50bf7f,_0x1b2695,_0x26c6a4){var _0x1002f4={'body':_0x50bf7f['body'],'channel':_0xba35('0x74')};var _0x980901=[];var _0x5bca67=[];var _0x492fe4={};var _0x473dfc=![];return db[_0xba35('0x75')][_0xba35('0x63')]()[_0xba35('0x21')](function(_0x5293ce){if(!_0x5293ce){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x980901=_[_0xba35('0x76')](_[_0xba35('0x44')](_0x5293ce),[_0xba35('0x77'),_0xba35('0x78')]);_0x5bca67=_[_0xba35('0x76')](_['keys'](_0x5293ce),['createdAt',_0xba35('0x78'),_0xba35('0x79'),_0xba35('0x7a')]);if(_0x50bf7f[_0xba35('0x5b')]['id']){delete _0x50bf7f['body']['id'];}if(_['isNil'](_0x50bf7f[_0xba35('0x5b')][_0xba35('0x7b')])){throw new db[(_0xba35('0x1d'))][(_0xba35('0x1e'))](_0xba35('0x7c'));}if(_[_0xba35('0x7d')](_0x50bf7f[_0xba35('0x5b')][_0xba35('0x5b')])||_0x50bf7f['body']['body']===''){throw new db[(_0xba35('0x1d'))][(_0xba35('0x1e'))](_0xba35('0x7e'));}if(_[_0xba35('0x7d')](_0x50bf7f[_0xba35('0x5b')][_0xba35('0x7f')])){throw new db['Sequelize']['ValidationError'](_0xba35('0x80')+_0x5bca67);}if(!_[_0xba35('0x81')](_0x5bca67,_0x50bf7f[_0xba35('0x5b')][_0xba35('0x7f')])){throw new db[(_0xba35('0x1d'))]['ValidationError'](_0xba35('0x82')+_0x5bca67);}_0x492fe4[_0x50bf7f[_0xba35('0x5b')][_0xba35('0x7f')]]=_0x50bf7f['body'][_0xba35('0x7b')];})[_0xba35('0x21')](function(){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x50bf7f[_0xba35('0x58')]['id']},'include':[{'model':db[_0xba35('0x83')],'as':_0xba35('0x84'),'include':[{'model':db[_0xba35('0x75')],'as':_0xba35('0x85'),'where':_0x492fe4,'limit':0x1,'order':[[_0xba35('0x78'),'DESC']]}]},{'model':db[_0xba35('0x86')],'as':'Applications'}]});})[_0xba35('0x21')](handleEntityNotFound(_0x1b2695,null))[_0xba35('0x21')](function(_0x4c38d0){if(_0x4c38d0&&_0x4c38d0['List']){_0x1002f4['account']=_0x4c38d0;_0x1002f4[_0xba35('0x87')]=_0x4c38d0[_0xba35('0x88')];_0x1002f4[_0xba35('0x89')]=_0x4c38d0[_0xba35('0x84')];_0x1002f4[_0xba35('0x87')]=_[_0xba35('0x8a')](_0x1002f4[_0xba35('0x87')],[_0xba35('0x8b')],[_0xba35('0x8c')]);if(_0x1002f4[_0xba35('0x8d')][_0xba35('0x88')]){delete _0x1002f4['account']['Applications'];}if(_0x1002f4[_0xba35('0x8d')]['List']&&_0x1002f4[_0xba35('0x8d')][_0xba35('0x84')]['Contacts']['length']){return _0x1002f4[_0xba35('0x8d')]['List']['Contacts'][0x0];}var _0x3dd403=_[_0xba35('0x14')](_0x50bf7f[_0xba35('0x5b')],{'firstName':_0x50bf7f[_0xba35('0x5b')]['from'],'ListId':_0x4c38d0[_0xba35('0x7a')]});_0x3dd403[_0x50bf7f[_0xba35('0x5b')][_0xba35('0x7f')]]=_0x50bf7f['body'][_0xba35('0x7b')];return db[_0xba35('0x75')][_0xba35('0x5a')](_0x3dd403,{'fields':_0x980901,'raw':!![]});}})[_0xba35('0x21')](handleEntityNotFound(_0x1b2695,null))[_0xba35('0x21')](function(_0x232440){_0x1002f4[_0xba35('0x8e')]=_0x232440;if(_0x232440){var _0x3b482d={'ContactId':_0x232440['id'],'OpenchannelAccountId':_0x50bf7f['params']['id'],'from':(_0x232440[_0xba35('0x8f')]||'')+'\x20'+(_0x232440[_0xba35('0x90')]||'')};var _0x35fe09={'OpenchannelAccountId':_0x50bf7f[_0xba35('0x58')]['id'],'closed':![]};if(_0x50bf7f['body'][_0xba35('0x91')]){_0x35fe09['threadId']=_0x50bf7f[_0xba35('0x5b')][_0xba35('0x91')];return db[_0xba35('0x92')]['find']({'where':_0x35fe09})['then'](function(_0x223f97){if(_0x223f97){return[_0x223f97,![]];}_0x3b482d[_0xba35('0x91')]=_0x50bf7f['body'][_0xba35('0x91')];_0x3b482d[_0xba35('0x93')]=_0x50bf7f[_0xba35('0x5b')]['externalUrl'];return db[_0xba35('0x92')][_0xba35('0x5a')](_0x3b482d)[_0xba35('0x21')](function(_0x33a6eb){return[_0x33a6eb,!![]];});});}else{_0x35fe09[_0xba35('0x91')]=null;}_0x35fe09['ContactId']=_0x232440['id'];return db['OpenchannelInteraction'][_0xba35('0x59')]({'where':_0x35fe09})['then'](function(_0x37db93){if(_0x37db93){return[_0x37db93,![]];}return db[_0xba35('0x92')][_0xba35('0x5a')](_0x3b482d)['then'](function(_0x4f3e4e){return[_0x4f3e4e,!![]];});});}})['spread'](function(_0x52793b,_0x410f6a){if(_0x52793b){_0x473dfc=_0x410f6a;if(!_0x410f6a){var _0x4cd67a={'from':(_0x1002f4[_0xba35('0x8e')][_0xba35('0x8f')]||'')+'\x20'+(_0x1002f4['contact']['lastName']||'')};if(_0x50bf7f['body'][_0xba35('0x91')]&&_0x50bf7f['body'][_0xba35('0x94')]&&_0x50bf7f[_0xba35('0x5b')][_0xba35('0x91')]!=_0x50bf7f[_0xba35('0x5b')][_0xba35('0x94')]){_0x4cd67a[_0xba35('0x91')]=_0x50bf7f[_0xba35('0x5b')]['messageId'];}return _0x52793b['update'](_0x4cd67a);}else{return _0x52793b;}}})['then'](function(_0x286575){_0x1002f4['interaction']=_0x286575[_0xba35('0x34')]({'plain':!![]});_0x1002f4['interaction'][_0xba35('0x95')]=_0x473dfc;if(_0x1002f4[_0xba35('0x96')][_0xba35('0x95')]){if(_0x1002f4[_0xba35('0x8d')][_0xba35('0x97')]){_0x1002f4[_0xba35('0x87')][_0xba35('0x98')]({'id':0x0,'priority':_0x1002f4['applications'][_0xba35('0x68')]+0x1,'app':_0xba35('0x99'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xba35('0x9a')][_0xba35('0x5a')]({'body':_0x50bf7f[_0xba35('0x5b')][_0xba35('0x5b')],'OpenchannelAccountId':_0x50bf7f[_0xba35('0x58')]['id'],'OpenchannelInteractionId':_0x286575['id'],'direction':'in','ContactId':_0x1002f4[_0xba35('0x8e')]['id'],'AttachmentId':_0x50bf7f[_0xba35('0x5b')]['AttachmentId']});})[_0xba35('0x21')](function(_0xc57cd0){_0x1002f4[_0xba35('0x28')]=_0xc57cd0;if(_0x1002f4['interaction']['UserId']){return db[_0xba35('0x9b')]['find']({'attributes':['id','name'],'where':{'id':_0x1002f4['interaction'][_0xba35('0x9c')]}})[_0xba35('0x21')](function(_0x1094a7){if(_0x1094a7){_0x1002f4[_0xba35('0x87')][_0xba35('0x9d')]({'id':0x0,'priority':0x0,'app':_0xba35('0x9e'),'appdata':_0x1094a7[_0xba35('0x39')]+','+(_0x1002f4[_0xba35('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':_0xba35('0x9f')});_0x1002f4['forcedOwnership']=![];}return respondWithRpcPromise(_0xba35('0xa0'),_0xba35('0xa1'),_0x1002f4);});}return respondWithRpcPromise(_0xba35('0xa0'),_0xba35('0xa1'),_0x1002f4);})[_0xba35('0x21')](function(_0x283774){respondWithRpcPromise(_0xba35('0xa2'),_0xba35('0xa2'),{'event':_0xba35('0x73'),'message':_0x283774},client9002);return _0x283774;})[_0xba35('0x21')](respondWithResult(_0x1b2695,null))[_0xba35('0x56')](handleError(_0x1b2695,null));};exports[_0xba35('0xa3')]=function(_0x30646b,_0x4b9158,_0x35d89c){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x30646b[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x4b9158,null))['then'](function(_0x1690bc){if(_0x1690bc){return db[_0xba35('0xa4')][_0xba35('0xa5')](function(_0x424b45){return db[_0xba35('0x86')][_0xba35('0x36')]({'where':{'OpenchannelAccountId':_0x30646b[_0xba35('0x58')]['id']},'transaction':_0x424b45})[_0xba35('0x21')](function(_0x5e6106){var _0x3b4757=_['map'](_0x30646b['body'],function(_0x30563d){_0x30563d[_0xba35('0x70')]=_0x30646b[_0xba35('0x58')]['id'];return _0x30563d;});return db[_0xba35('0x86')][_0xba35('0xa6')](_0x3b4757,{'transaction':_0x424b45});});})[_0xba35('0x21')](function(){return db[_0xba35('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x30646b['params']['id']},'order':_0xba35('0x8b')});});}})['then'](respondWithResult(_0x4b9158,null))[_0xba35('0x56')](handleError(_0x4b9158,null));};exports[_0xba35('0xa7')]=function(_0x561ce6,_0xb05484,_0x57887f){var _0x31b139={};var _0x46b71e={};var _0x430c05;var _0x38d50a;return db[_0xba35('0x3f')][_0xba35('0x67')]({'where':{'id':_0x561ce6[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0xb05484,null))[_0xba35('0x21')](function(_0x25e879){if(_0x25e879){_0x430c05=_0x25e879;_0x46b71e['model']=_[_0xba35('0x44')](db[_0xba35('0x86')][_0xba35('0x40')]);_0x46b71e[_0xba35('0x47')]=_['keys'](_0x561ce6[_0xba35('0x47')]);_0x46b71e[_0xba35('0x45')]=_[_0xba35('0x46')](_0x46b71e['model'],_0x46b71e[_0xba35('0x47')]);_0x31b139[_0xba35('0x49')]=_[_0xba35('0x46')](_0x46b71e[_0xba35('0x43')],qs[_0xba35('0x48')](_0x561ce6[_0xba35('0x47')][_0xba35('0x48')]));_0x31b139[_0xba35('0x49')]=_0x31b139[_0xba35('0x49')][_0xba35('0x68')]?_0x31b139[_0xba35('0x49')]:_0x46b71e[_0xba35('0x43')];_0x31b139['order']=qs['sort'](_0x561ce6[_0xba35('0x47')][_0xba35('0x4d')]);_0x31b139[_0xba35('0x4e')]=qs[_0xba35('0x45')](_[_0xba35('0x6a')](_0x561ce6[_0xba35('0x47')],_0x46b71e[_0xba35('0x45')]));if(_0x561ce6['query']['filter']){_0x31b139[_0xba35('0x4e')]=_[_0xba35('0x51')](_0x31b139[_0xba35('0x4e')],{'$or':_[_0xba35('0x3e')](_0x31b139[_0xba35('0x49')],function(_0x5c5222){var _0x207ad5={};_0x207ad5[_0x5c5222]={'$like':'%'+_0x561ce6['query'][_0xba35('0x4f')]+'%'};return _0x207ad5;})});}_0x31b139=_[_0xba35('0x51')]({},_0x31b139,_0x561ce6[_0xba35('0x52')]);return _0x430c05['getApplications'](_0x31b139);}})['then'](function(_0x4a5711){if(_0x4a5711){_0x38d50a=_0x4a5711[_0xba35('0x68')];if(!_0x561ce6[_0xba35('0x47')][_0xba35('0x4a')]('nolimit')){_0x31b139[_0xba35('0x69')]=qs[_0xba35('0x69')](_0x561ce6[_0xba35('0x47')][_0xba35('0x69')]);_0x31b139[_0xba35('0x2e')]=qs[_0xba35('0x2e')](_0x561ce6[_0xba35('0x47')][_0xba35('0x2e')]);}return _0x430c05['getApplications'](_0x31b139);}})[_0xba35('0x21')](function(_0x5161a8){if(_0x5161a8){return _0x5161a8?{'count':_0x38d50a,'rows':_0x5161a8}:null;}})['then'](respondWithResult(_0xb05484,null))[_0xba35('0x56')](handleError(_0xb05484,null));};exports['getInteractions']=function(_0x41c408,_0x590924,_0x150128){var _0x17cc42={'raw':![],'where':{}};var _0x47037c={};var _0x1657f9={'count':0x0,'rows':[]};return db[_0xba35('0x3f')][_0xba35('0x67')]({'where':{'id':_0x41c408[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x590924,null))[_0xba35('0x21')](function(_0x331760){if(_0x331760){_0x47037c[_0xba35('0x43')]=_['keys'](db[_0xba35('0x92')][_0xba35('0x40')]);_0x47037c[_0xba35('0x47')]=_[_0xba35('0x44')](_0x41c408['query']);_0x47037c[_0xba35('0x45')]=_[_0xba35('0x46')](_0x47037c[_0xba35('0x43')],_0x47037c[_0xba35('0x47')]);_0x17cc42['attributes']=_[_0xba35('0x46')](_0x47037c[_0xba35('0x43')],qs[_0xba35('0x48')](_0x41c408[_0xba35('0x47')]['fields']));_0x17cc42[_0xba35('0x49')]=_0x17cc42[_0xba35('0x49')][_0xba35('0x68')]?_0x17cc42['attributes']:_0x47037c[_0xba35('0x43')];if(!_0x41c408[_0xba35('0x47')]['hasOwnProperty'](_0xba35('0x4b'))){_0x17cc42[_0xba35('0x69')]=qs[_0xba35('0x69')](_0x41c408[_0xba35('0x47')][_0xba35('0x69')]);_0x17cc42['offset']=qs['offset'](_0x41c408[_0xba35('0x47')][_0xba35('0x2e')]);}_0x17cc42['order']=qs['sort'](_0x41c408[_0xba35('0x47')]['sort']);_0x17cc42[_0xba35('0x4e')]=qs[_0xba35('0x45')](_[_0xba35('0x6a')](_0x41c408['query'],_0x47037c['filters']));_0x17cc42['where'][_0xba35('0x70')]=_0x331760['id'];if(_0x41c408[_0xba35('0x47')][_0xba35('0x4f')]){_0x17cc42[_0xba35('0x4e')]=_[_0xba35('0x51')](_0x17cc42[_0xba35('0x4e')],{'$or':_['map'](_0x17cc42[_0xba35('0x49')],function(_0x566057){var _0x5c9574={};_0x5c9574[_0x566057]={'$like':'%'+_0x41c408['query'][_0xba35('0x4f')]+'%'};return _0x5c9574;})});}_0x17cc42=_[_0xba35('0x51')]({},_0x17cc42,_0x41c408[_0xba35('0x52')]);return db[_0xba35('0x92')][_0xba35('0x2d')]({'where':_0x17cc42[_0xba35('0x4e')]})[_0xba35('0x21')](function(_0x5a1337){_0x1657f9[_0xba35('0x2d')]=_0x5a1337;if(_0x41c408['query'][_0xba35('0x53')]){_0x17cc42['include']=[{'model':db[_0xba35('0x75')],'as':_0xba35('0xa8'),'required':![]},{'model':db[_0xba35('0x9b')],'as':_0xba35('0xa9'),'attributes':[_0xba35('0x39'),_0xba35('0xaa'),_0xba35('0xab')],'required':![]},{'model':db[_0xba35('0xac')],'as':_0xba35('0xad'),'attributes':['id',_0xba35('0x39'),_0xba35('0xae')],'where':_0x41c408[_0xba35('0x47')][_0xba35('0xaf')]?{'id':_0x41c408[_0xba35('0x47')][_0xba35('0xaf')]}:undefined,'required':_0x41c408[_0xba35('0x47')][_0xba35('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xba35('0x71')](_0x17cc42);})[_0xba35('0x21')](function(_0x1db318){_0x1657f9[_0xba35('0x55')]=_0x1db318;return _0x1657f9;});}})[_0xba35('0x21')](respondWithFilteredResult(_0x590924,_0x17cc42))[_0xba35('0x56')](handleError(_0x590924,null));};exports[_0xba35('0xb0')]=function(_0x21ac63,_0x2ff37b,_0x1083ad){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x21ac63['params']['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x2ff37b,null))[_0xba35('0x21')](function(_0x5192d1){if(_0x5192d1){return _0x5192d1[_0xba35('0xb0')](_0x21ac63['body'][_0xba35('0x6d')],_[_0xba35('0xb1')](_0x21ac63[_0xba35('0x5b')],['ids','id'])||{})[_0xba35('0xb2')](function(_0x207b3c){for(var _0x409b33=0x0;_0x409b33<_0x21ac63[_0xba35('0x5b')]['ids']['length'];_0x409b33+=0x1){socket[_0xba35('0xb3')](_0xba35('0xb4'),{'UserId':_0x21ac63[_0xba35('0x5b')]['ids'][_0x409b33],'OpenchannelAccountId':_0x21ac63[_0xba35('0x58')]['id']});}return _0x207b3c;});}})[_0xba35('0x21')](respondWithResult(_0x2ff37b,null))[_0xba35('0x56')](handleError(_0x2ff37b,null));};exports[_0xba35('0xb5')]=function(_0x3192a8,_0x80705c,_0x5c368a){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x3192a8[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x80705c,null))['then'](function(_0x361ddc){if(_0x361ddc){return _0x361ddc[_0xba35('0xb5')](_0x3192a8[_0xba35('0x47')][_0xba35('0x6d')])[_0xba35('0x21')](function(){if(_[_0xba35('0xb6')](_0x3192a8[_0xba35('0x47')]['ids'])){for(var _0x3c863f=0x0;_0x3c863f<_0x3192a8['query'][_0xba35('0x6d')][_0xba35('0x68')];_0x3c863f+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x3192a8[_0xba35('0x47')][_0xba35('0x6d')][_0x3c863f]),'OpenchannelAccountId':Number(_0x3192a8[_0xba35('0x58')]['id'])});}}else{socket[_0xba35('0xb3')](_0xba35('0xb7'),{'UserId':Number(_0x3192a8[_0xba35('0x47')][_0xba35('0x6d')]),'OpenchannelAccountId':Number(_0x3192a8[_0xba35('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x80705c,null))['catch'](handleError(_0x80705c,null));};exports['getAgents']=function(_0x1cecd6,_0x13aad0,_0x252018){var _0x399a86={};var _0x1c34e1={};var _0x3b88d5;var _0x37d408;return db['OpenchannelAccount'][_0xba35('0x67')]({'where':{'id':_0x1cecd6['params']['id']}})['then'](handleEntityNotFound(_0x13aad0,null))['then'](function(_0x462ec8){if(_0x462ec8){_0x3b88d5=_0x462ec8;_0x1c34e1[_0xba35('0x43')]=_[_0xba35('0x44')](db[_0xba35('0x9b')][_0xba35('0x40')]);_0x1c34e1[_0xba35('0x47')]=_['keys'](_0x1cecd6[_0xba35('0x47')]);_0x1c34e1[_0xba35('0x45')]=_[_0xba35('0x46')](_0x1c34e1[_0xba35('0x43')],_0x1c34e1[_0xba35('0x47')]);_0x399a86[_0xba35('0x49')]=_[_0xba35('0x46')](_0x1c34e1[_0xba35('0x43')],qs['fields'](_0x1cecd6[_0xba35('0x47')][_0xba35('0x48')]));_0x399a86[_0xba35('0x49')]=_0x399a86['attributes'][_0xba35('0x68')]?_0x399a86[_0xba35('0x49')]:_0x1c34e1['model'];_0x399a86[_0xba35('0x4c')]=qs['sort'](_0x1cecd6['query']['sort']);_0x399a86[_0xba35('0x4e')]=qs[_0xba35('0x45')](_['pick'](_0x1cecd6[_0xba35('0x47')],_0x1c34e1[_0xba35('0x45')]));if(_0x1cecd6[_0xba35('0x47')][_0xba35('0x4f')]){_0x399a86[_0xba35('0x4e')]=_[_0xba35('0x51')](_0x399a86[_0xba35('0x4e')],{'$or':_['map'](_0x399a86[_0xba35('0x49')],function(_0x5c4a90){var _0x190ce2={};_0x190ce2[_0x5c4a90]={'$like':'%'+_0x1cecd6[_0xba35('0x47')][_0xba35('0x4f')]+'%'};return _0x190ce2;})});}_0x399a86=_[_0xba35('0x51')]({},_0x399a86,_0x1cecd6['options']);return _0x3b88d5['getAgents'](_0x399a86);}})['then'](function(_0x1f2a85){if(_0x1f2a85){_0x37d408=_0x1f2a85['length'];if(!_0x1cecd6[_0xba35('0x47')][_0xba35('0x4a')](_0xba35('0x4b'))){_0x399a86[_0xba35('0x69')]=qs['limit'](_0x1cecd6[_0xba35('0x47')][_0xba35('0x69')]);_0x399a86[_0xba35('0x2e')]=qs[_0xba35('0x2e')](_0x1cecd6[_0xba35('0x47')][_0xba35('0x2e')]);}return _0x3b88d5[_0xba35('0xb8')](_0x399a86);}})[_0xba35('0x21')](function(_0x578e3e){if(_0x578e3e){return _0x578e3e?{'count':_0x37d408,'rows':_0x578e3e}:null;}})['then'](respondWithResult(_0x13aad0,null))[_0xba35('0x56')](handleError(_0x13aad0,null));};exports[_0xba35('0x3a')]=function(_0x232a84,_0x5b1d6c,_0x356e8e){var _0xee4d78,_0x3127a2,_0x4b365f;if(_[_0xba35('0x7d')](_0x232a84[_0xba35('0x5b')][_0xba35('0x5b')])||_0x232a84[_0xba35('0x5b')][_0xba35('0x5b')]===''){throw new db[(_0xba35('0x1d'))]['ValidationError'](_0xba35('0x7e'));}if(_[_0xba35('0x7d')](_0x232a84[_0xba35('0x5b')]['to'])){}_0xee4d78=_0x232a84[_0xba35('0x5b')]['to'];return db[_0xba35('0x3f')][_0xba35('0x67')]({'where':{'id':_0x232a84[_0xba35('0x58')]['id']}})[_0xba35('0x21')](handleEntityNotFound(_0x5b1d6c,null))[_0xba35('0x21')](function(_0x396764){if(_0x396764){return db[_0xba35('0x3f')][_0xba35('0x59')]({'where':{'id':_0x396764['id']},'include':[{'model':db[_0xba35('0x83')],'as':_0xba35('0x84'),'include':[{'model':db['CmContact'],'as':_0xba35('0x85'),'where':{[_0x396764[_0xba35('0x7f')]]:_0xee4d78},'limit':0x1,'order':[[_0xba35('0x78'),_0xba35('0xb9')]]}]}]})[_0xba35('0x21')](handleEntityNotFound(_0x5b1d6c,null))[_0xba35('0x21')](function(_0x2d3f7f){if(_0x2d3f7f&&_0x2d3f7f[_0xba35('0x84')]){_0x3127a2=_0x2d3f7f['get']({'plain':!![]});if(_0x3127a2['List']&&_0x3127a2['List']['Contacts'][_0xba35('0x68')]){return _0x3127a2[_0xba35('0x84')][_0xba35('0x85')][0x0];}return db['CmContact'][_0xba35('0x5a')](_['defaults'](_0x232a84['body'],{'firstName':_0xee4d78,[_0x2d3f7f[_0xba35('0x7f')]]:_0xee4d78,'phone':_0xee4d78,'ListId':_0x3127a2[_0xba35('0x7a')]}));}})['then'](handleEntityNotFound(_0x5b1d6c,null))[_0xba35('0x21')](function(_0x2639b5){if(_0x2639b5){_0x4b365f=_0x2639b5;return db[_0xba35('0x92')][_0xba35('0x59')]({'where':{'ContactId':_0x4b365f['id'],'closed':![],'OpenchannelAccountId':_0x3127a2['id']}})[_0xba35('0x21')](function(_0x17eec2){if(_0x17eec2){return[_0x17eec2,![]];}return db[_0xba35('0x92')][_0xba35('0x5a')]({'UserId':_0x232a84[_0xba35('0x5c')]['id'],'ContactId':_0x4b365f['id'],'OpenchannelAccountId':_0x3127a2['id'],'lastMsgDirection':_0xba35('0xba'),'Messages':[_[_0xba35('0x51')](_0x232a84[_0xba35('0x5b')],{'read':![],'body':_0x232a84['body'][_0xba35('0x5b')],'OpenchannelAccountId':_0x3127a2['id'],'UserId':_0x232a84[_0xba35('0x5c')]['id'],'ContactId':_0x4b365f['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xba35('0x21')](function(_0x53e1c3){return[_0x53e1c3,!![]];});});}})[_0xba35('0xb2')](function(_0x440cd8,_0xf0df9){if(_0xf0df9){return _0x440cd8;}return db[_0xba35('0x9a')][_0xba35('0x5a')](_['merge'](_0x232a84[_0xba35('0x5b')],{'read':![],'body':_0x232a84[_0xba35('0x5b')][_0xba35('0x5b')],'OpenchannelAccountId':_0x3127a2['id'],'OpenchannelInteractionId':_0x440cd8['id'],'UserId':_0x232a84[_0xba35('0x5c')]['id'],'ContactId':_0x4b365f['id']}))[_0xba35('0x21')](function(_0x2bbf02){_0x440cd8[_0xba35('0xbb')][_0xba35('0xbc')]=[];_0x440cd8[_0xba35('0xbb')]['Messages']['push'](_0x2bbf02[_0xba35('0xbb')]);return _0x440cd8;});});}})['then'](respondWithResult(_0x5b1d6c,null))[_0xba35('0x56')](handleError(_0x5b1d6c,null));}; \ No newline at end of file +var _0xffef=['body','destroy','describe','OpnechannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','OpenchannelAccountId','CannedAnswer','removeAnswers','ids','notify','openchannel','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','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','List','CmContact','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','priority','asc','contact','firstName','threadId','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','*,*,*,*','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','Content-Range','reject','save','update','get','UserProfileResource','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','type','model','query','keys','filters','fields','attributes','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xffef,0x1cb));var _0xfffe=function(_0x14d0d5,_0x5d25ac){_0x14d0d5=_0x14d0d5-0x0;var _0x2946b1=_0xffef[_0x14d0d5];return _0x2946b1;};'use strict';var pdf=require(_0xfffe('0x0'));var emlformat=require(_0xfffe('0x1'));var rimraf=require(_0xfffe('0x2'));var zipdir=require(_0xfffe('0x3'));var jsonpatch=require(_0xfffe('0x4'));var rp=require(_0xfffe('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfffe('0x6'));var util=require(_0xfffe('0x7'));var path=require(_0xfffe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfffe('0x9'));var fs=require('fs');var _=require(_0xfffe('0xa'));var squel=require(_0xfffe('0xb'));var crypto=require(_0xfffe('0xc'));var jsforce=require(_0xfffe('0xd'));var deskjs=require(_0xfffe('0xe'));var toCsv=require(_0xfffe('0xf'));var querystring=require(_0xfffe('0x10'));var Papa=require(_0xfffe('0x11'));var Redis=require('ioredis');var authService=require(_0xfffe('0x12'));var qs=require(_0xfffe('0x13'));var as=require(_0xfffe('0x14'));var hardwareService=require(_0xfffe('0x15'));var logger=require(_0xfffe('0x16'))(_0xfffe('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfffe('0x18'))['db'];config[_0xfffe('0x19')]=_[_0xfffe('0x1a')](config['redis'],{'host':_0xfffe('0x1b'),'port':0x18eb});var socket=require(_0xfffe('0x1c'))(new Redis(config[_0xfffe('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xfffe('0x1d'));var client=jayson['client'][_0xfffe('0x1e')]({'port':0x232c});var client9002=jayson[_0xfffe('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f2769,_0x2fe068,_0xaf3baf){if(_0xaf3baf){var _0x2a5641=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a5641[_0xfffe('0x20')](_0x2fe068)){return _0x3f2769;}else{throw new db[(_0xfffe('0x21'))][(_0xfffe('0x22'))](_0xfffe('0x23'));}}else{return _0x3f2769;}}function respondWithRpcPromise(_0x57e96e,_0x469513,_0x22c8c6,_0x2c3a9e){return new BPromise(function(_0x2de60a,_0xb60a58){var _0x3eef7a=_0x2c3a9e||client;return _0x3eef7a[_0xfffe('0x24')](_0x57e96e,_0x22c8c6)[_0xfffe('0x25')](function(_0x7c7eca){logger[_0xfffe('0x26')](_0xfffe('0x27'),_0x469513,'request\x20sent');logger[_0xfffe('0x28')](_0xfffe('0x29'),_0x469513,_0xfffe('0x2a'),JSON[_0xfffe('0x2b')](_0x7c7eca));if(_0x7c7eca[_0xfffe('0x2c')]){if(_0x7c7eca[_0xfffe('0x2c')][_0xfffe('0x2d')]===0x1f4){logger['error'](_0xfffe('0x27'),_0x469513,_0x7c7eca['error'][_0xfffe('0x2e')]);return _0xb60a58(_0x7c7eca['error'][_0xfffe('0x2e')]);}logger[_0xfffe('0x2c')]('OpenchannelAccount,\x20%s,\x20%s',_0x469513,_0x7c7eca['error'][_0xfffe('0x2e')]);return _0x2de60a(_0x7c7eca['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x469513,_0xfffe('0x2a'));_0x2de60a(_0x7c7eca[_0xfffe('0x2f')][_0xfffe('0x2e')]);}})[_0xfffe('0x30')](function(_0x1b90d6){logger[_0xfffe('0x2c')](_0xfffe('0x27'),_0x469513,_0x1b90d6);_0xb60a58(_0x1b90d6);});});}function respondWithStatusCode(_0x44b9d5,_0x2e8eae){_0x2e8eae=_0x2e8eae||0xcc;return function(_0x2f32cd){if(_0x2f32cd){return _0x44b9d5['sendStatus'](_0x2e8eae);}return _0x44b9d5[_0xfffe('0x31')](_0x2e8eae)[_0xfffe('0x32')]();};}function respondWithResult(_0x196d02,_0x16af9c){_0x16af9c=_0x16af9c||0xc8;return function(_0x4b325f){if(_0x4b325f){return _0x196d02['status'](_0x16af9c)[_0xfffe('0x33')](_0x4b325f);}};}function respondWithFilteredResult(_0x30eceb,_0x1f0a8d){return function(_0x4b8181){if(_0x4b8181){var _0x2ccce8=_0x4b8181[_0xfffe('0x34')],_0x328343=_0x1f0a8d[_0xfffe('0x35')],_0x285abc=_0x1f0a8d[_0xfffe('0x35')]+_0x1f0a8d['limit'],_0x5d9f60;if(_0x285abc>=_0x2ccce8){_0x285abc=_0x2ccce8;_0x5d9f60=0xc8;}else{_0x5d9f60=0xce;}_0x30eceb[_0xfffe('0x31')](_0x5d9f60);return _0x30eceb['set'](_0xfffe('0x36'),_0x328343+'-'+_0x285abc+'/'+_0x2ccce8)[_0xfffe('0x33')](_0x4b8181);}return null;};}function patchUpdates(_0x3919fd){return function(_0xcf9cbd){try{jsonpatch['apply'](_0xcf9cbd,_0x3919fd,!![]);}catch(_0x591b7a){return BPromise[_0xfffe('0x37')](_0x591b7a);}return _0xcf9cbd[_0xfffe('0x38')]();};}function saveUpdates(_0xf0b37c,_0x3c7b6b){return function(_0x256883){if(_0x256883){return _0x256883[_0xfffe('0x39')](_0xf0b37c)[_0xfffe('0x25')](function(_0x5f3917){return _0x5f3917;});}return null;};}function removeEntity(_0x471454,_0x371a49){return function(_0x12bed5){if(_0x12bed5){return _0x12bed5['destroy']()[_0xfffe('0x25')](function(){var _0xa259fe=_0x12bed5[_0xfffe('0x3a')]({'plain':!![]});var _0xab914d='OpenchannelAccounts';return db[_0xfffe('0x3b')]['destroy']({'where':{'type':_0xab914d,'resourceId':_0xa259fe['id']}})[_0xfffe('0x25')](function(){return _0x12bed5;});})['then'](function(){_0x471454[_0xfffe('0x31')](0xcc)[_0xfffe('0x32')]();});}};}function handleEntityNotFound(_0x2ff04d,_0x4e4988){return function(_0x41831b){if(!_0x41831b){_0x2ff04d[_0xfffe('0x3c')](0x194);}return _0x41831b;};}function handleError(_0x1d6771,_0x507964){_0x507964=_0x507964||0x1f4;return function(_0x5a2624){logger[_0xfffe('0x2c')](_0x5a2624[_0xfffe('0x3d')]);if(_0x5a2624[_0xfffe('0x3e')]){delete _0x5a2624[_0xfffe('0x3e')];}_0x1d6771['status'](_0x507964)['send'](_0x5a2624);};}exports['index']=function(_0x1329d6,_0x1cbf92){var _0x542dbf={'include':[{'model':db[_0xfffe('0x3f')],'as':_0xfffe('0x40')}]},_0x2b6e93={},_0x343ab9={'count':0x0,'rows':[]};var _0x47e353=_[_0xfffe('0x41')](db['OpenchannelAccount']['rawAttributes'],function(_0xe8d602){return{'name':_0xe8d602['fieldName'],'type':_0xe8d602[_0xfffe('0x42')]['key']};});_0x2b6e93[_0xfffe('0x43')]=_[_0xfffe('0x41')](_0x47e353,_0xfffe('0x3e'));_0x2b6e93[_0xfffe('0x44')]=_[_0xfffe('0x45')](_0x1329d6[_0xfffe('0x44')]);_0x2b6e93[_0xfffe('0x46')]=_['intersection'](_0x2b6e93[_0xfffe('0x43')],_0x2b6e93[_0xfffe('0x44')]);_0x542dbf['attributes']=_['intersection'](_0x2b6e93['model'],qs[_0xfffe('0x47')](_0x1329d6['query']['fields']));_0x542dbf[_0xfffe('0x48')]=_0x542dbf[_0xfffe('0x48')][_0xfffe('0x49')]?_0x542dbf[_0xfffe('0x48')]:_0x2b6e93[_0xfffe('0x43')];if(!_0x1329d6[_0xfffe('0x44')]['hasOwnProperty'](_0xfffe('0x4a'))){_0x542dbf['limit']=qs[_0xfffe('0x4b')](_0x1329d6[_0xfffe('0x44')][_0xfffe('0x4b')]);_0x542dbf[_0xfffe('0x35')]=qs[_0xfffe('0x35')](_0x1329d6[_0xfffe('0x44')][_0xfffe('0x35')]);}_0x542dbf[_0xfffe('0x4c')]=qs[_0xfffe('0x4d')](_0x1329d6[_0xfffe('0x44')]['sort']);_0x542dbf[_0xfffe('0x4e')]=qs[_0xfffe('0x46')](_[_0xfffe('0x4f')](_0x1329d6[_0xfffe('0x44')],_0x2b6e93[_0xfffe('0x46')]),_0x47e353);if(_0x1329d6[_0xfffe('0x44')]['filter']){_0x542dbf[_0xfffe('0x4e')]=_[_0xfffe('0x50')](_0x542dbf[_0xfffe('0x4e')],{'$or':_[_0xfffe('0x41')](_0x47e353,function(_0x16cf17){if(_0x16cf17[_0xfffe('0x42')]!==_0xfffe('0x51')){var _0x350c51={};_0x350c51[_0x16cf17[_0xfffe('0x3e')]]={'$like':'%'+_0x1329d6[_0xfffe('0x44')][_0xfffe('0x52')]+'%'};return _0x350c51;}})});}_0x542dbf=_[_0xfffe('0x50')]({},_0x542dbf,_0x1329d6[_0xfffe('0x53')]);var _0x104ec4={'where':_0x542dbf[_0xfffe('0x4e')]};return db[_0xfffe('0x54')][_0xfffe('0x34')](_0x104ec4)[_0xfffe('0x25')](function(_0x5430ef){_0x343ab9[_0xfffe('0x34')]=_0x5430ef;if(_0x1329d6[_0xfffe('0x44')][_0xfffe('0x55')]){_0x542dbf[_0xfffe('0x56')]=[{'all':!![]}];}return db[_0xfffe('0x54')][_0xfffe('0x57')](_0x542dbf);})['then'](function(_0x55326f){_0x343ab9[_0xfffe('0x58')]=_0x55326f;return _0x343ab9;})[_0xfffe('0x25')](respondWithFilteredResult(_0x1cbf92,_0x542dbf))[_0xfffe('0x30')](handleError(_0x1cbf92,null));};exports[_0xfffe('0x59')]=function(_0x47bdab,_0x346692){var _0x230f31={'raw':![],'where':{'id':_0x47bdab[_0xfffe('0x5a')]['id']},'include':[{'model':db[_0xfffe('0x3f')],'as':_0xfffe('0x40')}]},_0x358419={};_0x358419[_0xfffe('0x43')]=_['keys'](db['OpenchannelAccount'][_0xfffe('0x5b')]);_0x358419[_0xfffe('0x44')]=_['keys'](_0x47bdab[_0xfffe('0x44')]);_0x358419[_0xfffe('0x46')]=_[_0xfffe('0x5c')](_0x358419['model'],_0x358419[_0xfffe('0x44')]);_0x230f31[_0xfffe('0x48')]=_[_0xfffe('0x5c')](_0x358419['model'],qs[_0xfffe('0x47')](_0x47bdab[_0xfffe('0x44')][_0xfffe('0x47')]));_0x230f31[_0xfffe('0x48')]=_0x230f31['attributes']['length']?_0x230f31[_0xfffe('0x48')]:_0x358419[_0xfffe('0x43')];if(_0x47bdab[_0xfffe('0x44')]['includeAll']){_0x230f31['include']=[{'all':!![]}];}_0x230f31=_[_0xfffe('0x50')]({},_0x230f31,_0x47bdab[_0xfffe('0x53')]);return db[_0xfffe('0x54')][_0xfffe('0x5d')](_0x230f31)[_0xfffe('0x25')](handleEntityNotFound(_0x346692,null))[_0xfffe('0x25')](respondWithResult(_0x346692,null))['catch'](handleError(_0x346692,null));};exports[_0xfffe('0x5e')]=function(_0x378f6d,_0x3718e5){return db[_0xfffe('0x54')][_0xfffe('0x5e')](_0x378f6d['body'],{})['then'](function(_0x26defd){var _0x208d54=_0x378f6d[_0xfffe('0x5f')][_0xfffe('0x3a')]({'plain':!![]});if(!_0x208d54)throw new Error(_0xfffe('0x60'));if(_0x208d54['role']===_0xfffe('0x5f')){var _0x20c74b=_0x26defd['get']({'plain':!![]});var _0xa5546d='OpenchannelAccounts';return db['UserProfileSection'][_0xfffe('0x5d')]({'where':{'name':_0xa5546d,'userProfileId':_0x208d54['userProfileId']},'raw':!![]})['then'](function(_0xbb2e0a){if(_0xbb2e0a&&_0xbb2e0a[_0xfffe('0x61')]===0x0){return db[_0xfffe('0x3b')][_0xfffe('0x5e')]({'name':_0x20c74b[_0xfffe('0x3e')],'resourceId':_0x20c74b['id'],'type':_0xbb2e0a[_0xfffe('0x3e')],'sectionId':_0xbb2e0a['id']},{})[_0xfffe('0x25')](function(){return _0x26defd;});}else{return _0x26defd;}})[_0xfffe('0x30')](function(_0x46c672){logger[_0xfffe('0x2c')](_0xfffe('0x62'),_0x46c672);throw _0x46c672;});}return _0x26defd;})[_0xfffe('0x25')](respondWithResult(_0x3718e5,0xc9))[_0xfffe('0x30')](handleError(_0x3718e5,null));};exports[_0xfffe('0x39')]=function(_0x573652,_0x394b5d){if(_0x573652['body']['id']){delete _0x573652[_0xfffe('0x63')]['id'];}return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x573652[_0xfffe('0x5a')]['id']},'include':[{'model':db[_0xfffe('0x3f')],'as':_0xfffe('0x40')}]})[_0xfffe('0x25')](handleEntityNotFound(_0x394b5d,null))[_0xfffe('0x25')](saveUpdates(_0x573652[_0xfffe('0x63')],null))[_0xfffe('0x25')](respondWithResult(_0x394b5d,null))[_0xfffe('0x30')](handleError(_0x394b5d,null));};exports[_0xfffe('0x64')]=function(_0x35663a,_0x12c5be){return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x35663a['params']['id']}})['then'](handleEntityNotFound(_0x12c5be,null))[_0xfffe('0x25')](removeEntity(_0x12c5be,null))[_0xfffe('0x30')](handleError(_0x12c5be,null));};exports[_0xfffe('0x65')]=function(_0x24db5f,_0x16b683){return db[_0xfffe('0x54')][_0xfffe('0x65')]()[_0xfffe('0x25')](respondWithResult(_0x16b683,null))[_0xfffe('0x30')](handleError(_0x16b683,null));};exports['addDisposition']=function(_0x12387e,_0x5562a9,_0x5bce7d){if(_0x12387e['body']['id']){delete _0x12387e[_0xfffe('0x63')]['id'];}return db['OpenchannelAccount'][_0xfffe('0x5d')]({'where':{'id':_0x12387e['params']['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x5562a9,null))[_0xfffe('0x25')](function(_0x211da8){if(_0x211da8){_0x12387e[_0xfffe('0x63')][_0xfffe('0x66')]=_0x211da8['id'];return db['Disposition']['create'](_0x12387e[_0xfffe('0x63')]);}})[_0xfffe('0x25')](respondWithResult(_0x5562a9,null))[_0xfffe('0x30')](handleError(_0x5562a9,null));};exports[_0xfffe('0x67')]=function(_0x466b7b,_0x309978,_0x4d9dfe){var _0x59a25e={'raw':![],'where':{}};var _0x15397c={};var _0x264508={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfffe('0x68')]({'where':{'id':_0x466b7b[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x309978,null))[_0xfffe('0x25')](function(_0x5a18a7){if(_0x5a18a7){_0x15397c[_0xfffe('0x43')]=_['keys'](db[_0xfffe('0x69')]['rawAttributes']);_0x15397c[_0xfffe('0x44')]=_[_0xfffe('0x45')](_0x466b7b[_0xfffe('0x44')]);_0x15397c[_0xfffe('0x46')]=_['intersection'](_0x15397c[_0xfffe('0x43')],_0x15397c['query']);_0x59a25e[_0xfffe('0x48')]=_[_0xfffe('0x5c')](_0x15397c[_0xfffe('0x43')],qs[_0xfffe('0x47')](_0x466b7b[_0xfffe('0x44')][_0xfffe('0x47')]));_0x59a25e[_0xfffe('0x48')]=_0x59a25e['attributes'][_0xfffe('0x49')]?_0x59a25e[_0xfffe('0x48')]:_0x15397c[_0xfffe('0x43')];if(!_0x466b7b[_0xfffe('0x44')][_0xfffe('0x6a')]('nolimit')){_0x59a25e[_0xfffe('0x4b')]=qs[_0xfffe('0x4b')](_0x466b7b[_0xfffe('0x44')][_0xfffe('0x4b')]);_0x59a25e[_0xfffe('0x35')]=qs[_0xfffe('0x35')](_0x466b7b['query'][_0xfffe('0x35')]);}_0x59a25e[_0xfffe('0x4c')]=qs[_0xfffe('0x4d')](_0x466b7b[_0xfffe('0x44')][_0xfffe('0x4d')]);_0x59a25e[_0xfffe('0x4e')]=qs[_0xfffe('0x46')](_[_0xfffe('0x4f')](_0x466b7b[_0xfffe('0x44')],_0x15397c[_0xfffe('0x46')]));_0x59a25e[_0xfffe('0x4e')]['OpenchannelAccountId']=_0x5a18a7['id'];if(_0x466b7b[_0xfffe('0x44')][_0xfffe('0x52')]){_0x59a25e[_0xfffe('0x4e')]=_[_0xfffe('0x50')](_0x59a25e[_0xfffe('0x4e')],{'$or':_['map'](_0x59a25e[_0xfffe('0x48')],function(_0x19f82a){var _0x4e461f={};_0x4e461f[_0x19f82a]={'$like':'%'+_0x466b7b[_0xfffe('0x44')][_0xfffe('0x52')]+'%'};return _0x4e461f;})});}_0x59a25e=_[_0xfffe('0x50')]({},_0x59a25e,_0x466b7b['options']);return db[_0xfffe('0x69')]['count']({'where':_0x59a25e[_0xfffe('0x4e')]})[_0xfffe('0x25')](function(_0x24b8fd){_0x264508[_0xfffe('0x34')]=_0x24b8fd;if(_0x466b7b[_0xfffe('0x44')][_0xfffe('0x55')]){_0x59a25e[_0xfffe('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xfffe('0x57')](_0x59a25e);})[_0xfffe('0x25')](function(_0xe661d1){_0x264508[_0xfffe('0x58')]=_0xe661d1;return _0x264508;});}})[_0xfffe('0x25')](respondWithFilteredResult(_0x309978,_0x59a25e))[_0xfffe('0x30')](handleError(_0x309978,null));};exports[_0xfffe('0x6b')]=function(_0x1fe12c,_0x4e0077,_0x38012c){return db['OpenchannelAccount']['find']({'where':{'id':_0x1fe12c[_0xfffe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e0077,null))[_0xfffe('0x25')](function(_0x372272){if(_0x372272){return _0x372272['removeDispositions'](_0x1fe12c['query']['ids']);}})[_0xfffe('0x25')](respondWithStatusCode(_0x4e0077,null))[_0xfffe('0x30')](handleError(_0x4e0077,null));};exports['addAnswer']=function(_0x56ba0a,_0x56066f,_0x243115){if(_0x56ba0a[_0xfffe('0x63')]['id']){delete _0x56ba0a['body']['id'];}return db[_0xfffe('0x54')]['find']({'where':{'id':_0x56ba0a[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x56066f,null))['then'](function(_0x166059){if(_0x166059){_0x56ba0a[_0xfffe('0x63')][_0xfffe('0x6c')]=_0x166059['id'];return db[_0xfffe('0x6d')][_0xfffe('0x5e')](_0x56ba0a['body']);}})[_0xfffe('0x25')](respondWithResult(_0x56066f,null))[_0xfffe('0x30')](handleError(_0x56066f,null));};exports['getAnswers']=function(_0x162191,_0x586712,_0x396e3b){var _0x18bfec={'raw':![],'where':{}};var _0x457edc={};var _0x1ecfd5={'count':0x0,'rows':[]};return db[_0xfffe('0x54')][_0xfffe('0x68')]({'where':{'id':_0x162191['params']['id']}})['then'](handleEntityNotFound(_0x586712,null))[_0xfffe('0x25')](function(_0x5627c9){if(_0x5627c9){_0x457edc[_0xfffe('0x43')]=_[_0xfffe('0x45')](db[_0xfffe('0x6d')]['rawAttributes']);_0x457edc[_0xfffe('0x44')]=_[_0xfffe('0x45')](_0x162191[_0xfffe('0x44')]);_0x457edc[_0xfffe('0x46')]=_[_0xfffe('0x5c')](_0x457edc['model'],_0x457edc['query']);_0x18bfec[_0xfffe('0x48')]=_[_0xfffe('0x5c')](_0x457edc['model'],qs[_0xfffe('0x47')](_0x162191[_0xfffe('0x44')]['fields']));_0x18bfec[_0xfffe('0x48')]=_0x18bfec[_0xfffe('0x48')][_0xfffe('0x49')]?_0x18bfec[_0xfffe('0x48')]:_0x457edc[_0xfffe('0x43')];if(!_0x162191['query'][_0xfffe('0x6a')]('nolimit')){_0x18bfec[_0xfffe('0x4b')]=qs[_0xfffe('0x4b')](_0x162191[_0xfffe('0x44')]['limit']);_0x18bfec[_0xfffe('0x35')]=qs['offset'](_0x162191[_0xfffe('0x44')]['offset']);}_0x18bfec['order']=qs['sort'](_0x162191['query'][_0xfffe('0x4d')]);_0x18bfec['where']=qs['filters'](_[_0xfffe('0x4f')](_0x162191['query'],_0x457edc[_0xfffe('0x46')]));_0x18bfec[_0xfffe('0x4e')][_0xfffe('0x6c')]=_0x5627c9['id'];if(_0x162191[_0xfffe('0x44')][_0xfffe('0x52')]){_0x18bfec[_0xfffe('0x4e')]=_[_0xfffe('0x50')](_0x18bfec[_0xfffe('0x4e')],{'$or':_[_0xfffe('0x41')](_0x18bfec[_0xfffe('0x48')],function(_0x1219ab){var _0x1b1bb1={};_0x1b1bb1[_0x1219ab]={'$like':'%'+_0x162191[_0xfffe('0x44')][_0xfffe('0x52')]+'%'};return _0x1b1bb1;})});}_0x18bfec=_[_0xfffe('0x50')]({},_0x18bfec,_0x162191[_0xfffe('0x53')]);return db[_0xfffe('0x6d')][_0xfffe('0x34')]({'where':_0x18bfec[_0xfffe('0x4e')]})[_0xfffe('0x25')](function(_0x3e8707){_0x1ecfd5[_0xfffe('0x34')]=_0x3e8707;if(_0x162191[_0xfffe('0x44')][_0xfffe('0x55')]){_0x18bfec[_0xfffe('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfffe('0x57')](_0x18bfec);})[_0xfffe('0x25')](function(_0x5bb568){_0x1ecfd5[_0xfffe('0x58')]=_0x5bb568;return _0x1ecfd5;});}})[_0xfffe('0x25')](respondWithFilteredResult(_0x586712,_0x18bfec))['catch'](handleError(_0x586712,null));};exports['removeAnswers']=function(_0x569cc5,_0x119dd2,_0x545b54){return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x569cc5[_0xfffe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x119dd2,null))[_0xfffe('0x25')](function(_0x1ce729){if(_0x1ce729){return _0x1ce729[_0xfffe('0x6e')](_0x569cc5[_0xfffe('0x44')][_0xfffe('0x6f')]);}})[_0xfffe('0x25')](respondWithStatusCode(_0x119dd2,null))[_0xfffe('0x30')](handleError(_0x119dd2,null));};exports[_0xfffe('0x70')]=function(_0x28aa8e,_0x17d464,_0x3e6706){var _0x4c68fd={'body':_0x28aa8e[_0xfffe('0x63')],'channel':_0xfffe('0x71')};var _0x58a61a=[];var _0x5b12a1=[];var _0x3e7b57={};var _0x562b69=![];return db['CmContact'][_0xfffe('0x65')]()[_0xfffe('0x25')](function(_0x19de43){if(!_0x19de43){throw new db[(_0xfffe('0x21'))][(_0xfffe('0x22'))](_0xfffe('0x72'));}_0x58a61a=_['difference'](_[_0xfffe('0x45')](_0x19de43),[_0xfffe('0x73'),_0xfffe('0x74')]);_0x5b12a1=_[_0xfffe('0x75')](_[_0xfffe('0x45')](_0x19de43),['createdAt',_0xfffe('0x74'),_0xfffe('0x76'),_0xfffe('0x77')]);if(_0x28aa8e[_0xfffe('0x63')]['id']){delete _0x28aa8e[_0xfffe('0x63')]['id'];}if(_[_0xfffe('0x78')](_0x28aa8e['body'][_0xfffe('0x79')])){throw new db[(_0xfffe('0x21'))][(_0xfffe('0x22'))](_0xfffe('0x7a'));}if(_['isNil'](_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x63')])||_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x63')]===''){throw new db[(_0xfffe('0x21'))][(_0xfffe('0x22'))](_0xfffe('0x7b'));}if(_[_0xfffe('0x78')](_0x28aa8e['body']['mapKey'])){throw new db[(_0xfffe('0x21'))][(_0xfffe('0x22'))](_0xfffe('0x7c')+_0x5b12a1);}if(!_[_0xfffe('0x7d')](_0x5b12a1,_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x7e')])){throw new db[(_0xfffe('0x21'))]['ValidationError'](_0xfffe('0x7f')+_0x5b12a1);}_0x3e7b57[_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x7e')]]=_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x79')];})[_0xfffe('0x25')](function(){return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x28aa8e[_0xfffe('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0xfffe('0x80'),'include':[{'model':db[_0xfffe('0x81')],'as':_0xfffe('0x82'),'where':_0x3e7b57,'limit':0x1,'order':[[_0xfffe('0x74'),_0xfffe('0x83')]]}]},{'model':db[_0xfffe('0x84')],'as':'Applications'}]});})[_0xfffe('0x25')](handleEntityNotFound(_0x17d464,null))[_0xfffe('0x25')](function(_0x189669){if(_0x189669&&_0x189669[_0xfffe('0x80')]){_0x4c68fd[_0xfffe('0x85')]=_0x189669;_0x4c68fd[_0xfffe('0x86')]=_0x189669[_0xfffe('0x87')];_0x4c68fd[_0xfffe('0x88')]=_0x189669[_0xfffe('0x80')];_0x4c68fd[_0xfffe('0x86')]=_['orderBy'](_0x4c68fd['applications'],[_0xfffe('0x89')],[_0xfffe('0x8a')]);if(_0x4c68fd['account'][_0xfffe('0x87')]){delete _0x4c68fd[_0xfffe('0x85')]['Applications'];}if(_0x4c68fd[_0xfffe('0x85')][_0xfffe('0x80')]&&_0x4c68fd[_0xfffe('0x85')][_0xfffe('0x80')][_0xfffe('0x82')][_0xfffe('0x49')]){return _0x4c68fd[_0xfffe('0x85')]['List'][_0xfffe('0x82')][0x0];}var _0x435f76=_[_0xfffe('0x1a')](_0x28aa8e[_0xfffe('0x63')],{'firstName':_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x79')],'ListId':_0x189669['ListId']});_0x435f76[_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x7e')]]=_0x28aa8e[_0xfffe('0x63')]['from'];return db[_0xfffe('0x81')][_0xfffe('0x5e')](_0x435f76,{'fields':_0x58a61a,'raw':!![]});}})[_0xfffe('0x25')](handleEntityNotFound(_0x17d464,null))[_0xfffe('0x25')](function(_0x98172c){_0x4c68fd[_0xfffe('0x8b')]=_0x98172c;if(_0x98172c){var _0x2e426e={'ContactId':_0x98172c['id'],'OpenchannelAccountId':_0x28aa8e['params']['id'],'from':(_0x98172c[_0xfffe('0x8c')]||'')+'\x20'+(_0x98172c['lastName']||'')};var _0x2875e3={'OpenchannelAccountId':_0x28aa8e['params']['id'],'closed':![]};if(_0x28aa8e[_0xfffe('0x63')]['threadId']){_0x2875e3[_0xfffe('0x8d')]=_0x28aa8e['body']['threadId'];return db[_0xfffe('0x8e')][_0xfffe('0x5d')]({'where':_0x2875e3})[_0xfffe('0x25')](function(_0x53bb06){if(_0x53bb06){return[_0x53bb06,![]];}_0x2e426e[_0xfffe('0x8d')]=_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x8d')];_0x2e426e['externalUrl']=_0x28aa8e[_0xfffe('0x63')]['externalUrl'];return db[_0xfffe('0x8e')][_0xfffe('0x5e')](_0x2e426e)[_0xfffe('0x25')](function(_0x54c027){return[_0x54c027,!![]];});});}else{_0x2875e3[_0xfffe('0x8d')]=null;}_0x2875e3[_0xfffe('0x8f')]=_0x98172c['id'];return db[_0xfffe('0x8e')][_0xfffe('0x5d')]({'where':_0x2875e3})[_0xfffe('0x25')](function(_0x45ded9){if(_0x45ded9){return[_0x45ded9,![]];}return db[_0xfffe('0x8e')]['create'](_0x2e426e)['then'](function(_0x5c0e4b){return[_0x5c0e4b,!![]];});});}})[_0xfffe('0x90')](function(_0x558005,_0x398892){if(_0x558005){_0x562b69=_0x398892;if(!_0x398892){var _0x17cdac={'from':(_0x4c68fd['contact'][_0xfffe('0x8c')]||'')+'\x20'+(_0x4c68fd[_0xfffe('0x8b')]['lastName']||'')};if(_0x28aa8e[_0xfffe('0x63')]['threadId']&&_0x28aa8e['body']['messageId']&&_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x8d')]!=_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x91')]){_0x17cdac[_0xfffe('0x8d')]=_0x28aa8e['body'][_0xfffe('0x91')];}return _0x558005[_0xfffe('0x39')](_0x17cdac);}else{return _0x558005;}}})[_0xfffe('0x25')](function(_0x371b64){_0x4c68fd[_0xfffe('0x92')]=_0x371b64[_0xfffe('0x3a')]({'plain':!![]});_0x4c68fd['interaction'][_0xfffe('0x93')]=_0x562b69;if(_0x4c68fd[_0xfffe('0x92')][_0xfffe('0x93')]){if(_0x4c68fd[_0xfffe('0x85')][_0xfffe('0x94')]){_0x4c68fd[_0xfffe('0x86')][_0xfffe('0x95')]({'id':0x0,'priority':_0x4c68fd[_0xfffe('0x86')][_0xfffe('0x49')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xfffe('0x96')});}}return db['OpenchannelMessage']['create']({'body':_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x63')],'OpenchannelAccountId':_0x28aa8e['params']['id'],'OpenchannelInteractionId':_0x371b64['id'],'direction':'in','ContactId':_0x4c68fd[_0xfffe('0x8b')]['id'],'AttachmentId':_0x28aa8e[_0xfffe('0x63')][_0xfffe('0x97')]});})[_0xfffe('0x25')](function(_0x175087){_0x4c68fd[_0xfffe('0x2e')]=_0x175087;if(_0x4c68fd[_0xfffe('0x92')][_0xfffe('0x98')]){return db[_0xfffe('0x99')][_0xfffe('0x5d')]({'attributes':['id',_0xfffe('0x3e')],'where':{'id':_0x4c68fd[_0xfffe('0x92')]['UserId']}})[_0xfffe('0x25')](function(_0x29ca07){if(_0x29ca07){_0x4c68fd[_0xfffe('0x86')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfffe('0x9a'),'appdata':_0x29ca07[_0xfffe('0x3e')]+','+(_0x4c68fd[_0xfffe('0x85')][_0xfffe('0x9b')]||0xa),'interval':'*,*,*,*'});_0x4c68fd['forcedOwnership']=![];}return respondWithRpcPromise(_0xfffe('0x9c'),_0xfffe('0x9d'),_0x4c68fd);});}return respondWithRpcPromise(_0xfffe('0x9c'),_0xfffe('0x9d'),_0x4c68fd);})[_0xfffe('0x25')](function(_0x2f48d5){respondWithRpcPromise(_0xfffe('0x9e'),'EventManager',{'event':'notify','message':_0x2f48d5},client9002);return _0x2f48d5;})['then'](respondWithResult(_0x17d464,null))['catch'](handleError(_0x17d464,null));};exports[_0xfffe('0x9f')]=function(_0x797b5b,_0x53c93f,_0x5ce1d8){return db[_0xfffe('0x54')][_0xfffe('0x68')]({'where':{'id':_0x797b5b[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x53c93f,null))[_0xfffe('0x25')](function(_0x4e2426){if(_0x4e2426){return db[_0xfffe('0xa0')][_0xfffe('0xa1')](function(_0x361031){return db['OpenchannelApplication'][_0xfffe('0x64')]({'where':{'OpenchannelAccountId':_0x797b5b[_0xfffe('0x5a')]['id']},'transaction':_0x361031})[_0xfffe('0x25')](function(_0x2697ae){var _0x43210e=_[_0xfffe('0x41')](_0x797b5b['body'],function(_0xc5d3eb){_0xc5d3eb[_0xfffe('0x6c')]=_0x797b5b['params']['id'];return _0xc5d3eb;});return db[_0xfffe('0x84')][_0xfffe('0xa2')](_0x43210e,{'transaction':_0x361031});});})[_0xfffe('0x25')](function(){return db[_0xfffe('0x84')][_0xfffe('0xa3')]({'where':{'OpenchannelAccountId':_0x797b5b[_0xfffe('0x5a')]['id']},'order':_0xfffe('0x89')});});}})['then'](respondWithResult(_0x53c93f,null))[_0xfffe('0x30')](handleError(_0x53c93f,null));};exports[_0xfffe('0xa4')]=function(_0x37d2d1,_0x21bc00,_0x1bcc18){var _0x554912={};var _0x116618={};var _0x4f39d4;var _0x4449b2;return db[_0xfffe('0x54')]['findOne']({'where':{'id':_0x37d2d1[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x21bc00,null))[_0xfffe('0x25')](function(_0x1da333){if(_0x1da333){_0x4f39d4=_0x1da333;_0x116618[_0xfffe('0x43')]=_[_0xfffe('0x45')](db[_0xfffe('0x84')][_0xfffe('0x5b')]);_0x116618['query']=_[_0xfffe('0x45')](_0x37d2d1[_0xfffe('0x44')]);_0x116618[_0xfffe('0x46')]=_[_0xfffe('0x5c')](_0x116618[_0xfffe('0x43')],_0x116618[_0xfffe('0x44')]);_0x554912[_0xfffe('0x48')]=_[_0xfffe('0x5c')](_0x116618[_0xfffe('0x43')],qs[_0xfffe('0x47')](_0x37d2d1['query']['fields']));_0x554912[_0xfffe('0x48')]=_0x554912[_0xfffe('0x48')][_0xfffe('0x49')]?_0x554912[_0xfffe('0x48')]:_0x116618['model'];_0x554912['order']=qs[_0xfffe('0x4d')](_0x37d2d1[_0xfffe('0x44')]['sort']);_0x554912['where']=qs[_0xfffe('0x46')](_[_0xfffe('0x4f')](_0x37d2d1['query'],_0x116618['filters']));if(_0x37d2d1[_0xfffe('0x44')][_0xfffe('0x52')]){_0x554912['where']=_[_0xfffe('0x50')](_0x554912[_0xfffe('0x4e')],{'$or':_[_0xfffe('0x41')](_0x554912[_0xfffe('0x48')],function(_0x37d6c1){var _0x5b9c48={};_0x5b9c48[_0x37d6c1]={'$like':'%'+_0x37d2d1['query'][_0xfffe('0x52')]+'%'};return _0x5b9c48;})});}_0x554912=_[_0xfffe('0x50')]({},_0x554912,_0x37d2d1[_0xfffe('0x53')]);return _0x4f39d4[_0xfffe('0xa4')](_0x554912);}})['then'](function(_0x3e5c48){if(_0x3e5c48){_0x4449b2=_0x3e5c48[_0xfffe('0x49')];if(!_0x37d2d1[_0xfffe('0x44')][_0xfffe('0x6a')](_0xfffe('0x4a'))){_0x554912[_0xfffe('0x4b')]=qs[_0xfffe('0x4b')](_0x37d2d1[_0xfffe('0x44')]['limit']);_0x554912[_0xfffe('0x35')]=qs['offset'](_0x37d2d1[_0xfffe('0x44')][_0xfffe('0x35')]);}return _0x4f39d4[_0xfffe('0xa4')](_0x554912);}})[_0xfffe('0x25')](function(_0x15aba5){if(_0x15aba5){return _0x15aba5?{'count':_0x4449b2,'rows':_0x15aba5}:null;}})[_0xfffe('0x25')](respondWithResult(_0x21bc00,null))[_0xfffe('0x30')](handleError(_0x21bc00,null));};exports[_0xfffe('0xa5')]=function(_0x8318bf,_0x47a0f7,_0x29a008){var _0x2438ad={'raw':![],'where':{}};var _0x314851={};var _0x1766ad={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xfffe('0x68')]({'where':{'id':_0x8318bf[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x47a0f7,null))['then'](function(_0x1fdbf6){if(_0x1fdbf6){_0x314851[_0xfffe('0x43')]=_[_0xfffe('0x45')](db[_0xfffe('0x8e')]['rawAttributes']);_0x314851[_0xfffe('0x44')]=_[_0xfffe('0x45')](_0x8318bf[_0xfffe('0x44')]);_0x314851[_0xfffe('0x46')]=_[_0xfffe('0x5c')](_0x314851['model'],_0x314851[_0xfffe('0x44')]);_0x2438ad[_0xfffe('0x48')]=_['intersection'](_0x314851[_0xfffe('0x43')],qs[_0xfffe('0x47')](_0x8318bf['query']['fields']));_0x2438ad[_0xfffe('0x48')]=_0x2438ad[_0xfffe('0x48')]['length']?_0x2438ad[_0xfffe('0x48')]:_0x314851[_0xfffe('0x43')];if(!_0x8318bf[_0xfffe('0x44')][_0xfffe('0x6a')](_0xfffe('0x4a'))){_0x2438ad[_0xfffe('0x4b')]=qs['limit'](_0x8318bf[_0xfffe('0x44')][_0xfffe('0x4b')]);_0x2438ad['offset']=qs[_0xfffe('0x35')](_0x8318bf['query'][_0xfffe('0x35')]);}_0x2438ad[_0xfffe('0x4c')]=qs[_0xfffe('0x4d')](_0x8318bf[_0xfffe('0x44')][_0xfffe('0x4d')]);_0x2438ad[_0xfffe('0x4e')]=qs['filters'](_[_0xfffe('0x4f')](_0x8318bf[_0xfffe('0x44')],_0x314851[_0xfffe('0x46')]));_0x2438ad[_0xfffe('0x4e')][_0xfffe('0x6c')]=_0x1fdbf6['id'];if(_0x8318bf['query'][_0xfffe('0x52')]){_0x2438ad[_0xfffe('0x4e')]=_[_0xfffe('0x50')](_0x2438ad[_0xfffe('0x4e')],{'$or':_[_0xfffe('0x41')](_0x2438ad[_0xfffe('0x48')],function(_0x4d1826){var _0x506607={};_0x506607[_0x4d1826]={'$like':'%'+_0x8318bf[_0xfffe('0x44')]['filter']+'%'};return _0x506607;})});}_0x2438ad=_[_0xfffe('0x50')]({},_0x2438ad,_0x8318bf[_0xfffe('0x53')]);return db[_0xfffe('0x8e')]['count']({'where':_0x2438ad[_0xfffe('0x4e')]})[_0xfffe('0x25')](function(_0x5d8126){_0x1766ad[_0xfffe('0x34')]=_0x5d8126;if(_0x8318bf[_0xfffe('0x44')][_0xfffe('0x55')]){_0x2438ad['include']=[{'model':db['CmContact'],'as':_0xfffe('0xa6'),'required':![]},{'model':db[_0xfffe('0x99')],'as':_0xfffe('0xa7'),'attributes':['name',_0xfffe('0xa8'),_0xfffe('0xa9')],'required':![]},{'model':db[_0xfffe('0xaa')],'as':_0xfffe('0xab'),'attributes':['id',_0xfffe('0x3e'),_0xfffe('0xac')],'where':_0x8318bf[_0xfffe('0x44')][_0xfffe('0xad')]?{'id':_0x8318bf[_0xfffe('0x44')][_0xfffe('0xad')]}:undefined,'required':_0x8318bf['query'][_0xfffe('0xad')]?!![]:![]}];}return db[_0xfffe('0x8e')][_0xfffe('0x57')](_0x2438ad);})['then'](function(_0x5adf80){_0x1766ad[_0xfffe('0x58')]=_0x5adf80;return _0x1766ad;});}})[_0xfffe('0x25')](respondWithFilteredResult(_0x47a0f7,_0x2438ad))['catch'](handleError(_0x47a0f7,null));};exports[_0xfffe('0xae')]=function(_0x165eda,_0x47cd99,_0x4ca5a2){return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x165eda[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x47cd99,null))[_0xfffe('0x25')](function(_0xd15424){if(_0xd15424){return _0xd15424[_0xfffe('0xae')](_0x165eda['body'][_0xfffe('0x6f')],_['omit'](_0x165eda[_0xfffe('0x63')],['ids','id'])||{})[_0xfffe('0x90')](function(_0x587085){for(var _0x15ca80=0x0;_0x15ca80<_0x165eda['body'][_0xfffe('0x6f')]['length'];_0x15ca80+=0x1){socket[_0xfffe('0xaf')](_0xfffe('0xb0'),{'UserId':_0x165eda['body'][_0xfffe('0x6f')][_0x15ca80],'OpenchannelAccountId':_0x165eda[_0xfffe('0x5a')]['id']});}return _0x587085;});}})[_0xfffe('0x25')](respondWithResult(_0x47cd99,null))[_0xfffe('0x30')](handleError(_0x47cd99,null));};exports[_0xfffe('0xb1')]=function(_0x52d8ed,_0x8ba67b,_0x28c3f6){return db[_0xfffe('0x54')][_0xfffe('0x5d')]({'where':{'id':_0x52d8ed[_0xfffe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x8ba67b,null))[_0xfffe('0x25')](function(_0x468e52){if(_0x468e52){return _0x468e52['removeAgents'](_0x52d8ed[_0xfffe('0x44')][_0xfffe('0x6f')])[_0xfffe('0x25')](function(){if(_[_0xfffe('0xb2')](_0x52d8ed[_0xfffe('0x44')][_0xfffe('0x6f')])){for(var _0x11f99e=0x0;_0x11f99e<_0x52d8ed['query']['ids'][_0xfffe('0x49')];_0x11f99e+=0x1){socket['emit'](_0xfffe('0xb3'),{'UserId':Number(_0x52d8ed['query']['ids'][_0x11f99e]),'OpenchannelAccountId':Number(_0x52d8ed[_0xfffe('0x5a')]['id'])});}}else{socket['emit'](_0xfffe('0xb3'),{'UserId':Number(_0x52d8ed[_0xfffe('0x44')][_0xfffe('0x6f')]),'OpenchannelAccountId':Number(_0x52d8ed[_0xfffe('0x5a')]['id'])});}});}})[_0xfffe('0x25')](respondWithStatusCode(_0x8ba67b,null))[_0xfffe('0x30')](handleError(_0x8ba67b,null));};exports[_0xfffe('0xb4')]=function(_0x10893a,_0x537220,_0xc884c3){var _0x33b092={};var _0x19dad4={};var _0xd71b63;var _0x5a30e0;return db[_0xfffe('0x54')][_0xfffe('0x68')]({'where':{'id':_0x10893a[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x537220,null))[_0xfffe('0x25')](function(_0x596022){if(_0x596022){_0xd71b63=_0x596022;_0x19dad4[_0xfffe('0x43')]=_[_0xfffe('0x45')](db[_0xfffe('0x99')][_0xfffe('0x5b')]);_0x19dad4[_0xfffe('0x44')]=_[_0xfffe('0x45')](_0x10893a[_0xfffe('0x44')]);_0x19dad4[_0xfffe('0x46')]=_[_0xfffe('0x5c')](_0x19dad4['model'],_0x19dad4[_0xfffe('0x44')]);_0x33b092['attributes']=_[_0xfffe('0x5c')](_0x19dad4[_0xfffe('0x43')],qs[_0xfffe('0x47')](_0x10893a[_0xfffe('0x44')][_0xfffe('0x47')]));_0x33b092['attributes']=_0x33b092[_0xfffe('0x48')][_0xfffe('0x49')]?_0x33b092['attributes']:_0x19dad4['model'];_0x33b092[_0xfffe('0x4c')]=qs['sort'](_0x10893a[_0xfffe('0x44')][_0xfffe('0x4d')]);_0x33b092[_0xfffe('0x4e')]=qs[_0xfffe('0x46')](_[_0xfffe('0x4f')](_0x10893a[_0xfffe('0x44')],_0x19dad4[_0xfffe('0x46')]));if(_0x10893a[_0xfffe('0x44')][_0xfffe('0x52')]){_0x33b092['where']=_[_0xfffe('0x50')](_0x33b092['where'],{'$or':_[_0xfffe('0x41')](_0x33b092[_0xfffe('0x48')],function(_0x5a1ce8){var _0x4d4a40={};_0x4d4a40[_0x5a1ce8]={'$like':'%'+_0x10893a[_0xfffe('0x44')][_0xfffe('0x52')]+'%'};return _0x4d4a40;})});}_0x33b092=_[_0xfffe('0x50')]({},_0x33b092,_0x10893a[_0xfffe('0x53')]);return _0xd71b63[_0xfffe('0xb4')](_0x33b092);}})[_0xfffe('0x25')](function(_0x5557f3){if(_0x5557f3){_0x5a30e0=_0x5557f3[_0xfffe('0x49')];if(!_0x10893a[_0xfffe('0x44')][_0xfffe('0x6a')]('nolimit')){_0x33b092[_0xfffe('0x4b')]=qs[_0xfffe('0x4b')](_0x10893a['query']['limit']);_0x33b092[_0xfffe('0x35')]=qs[_0xfffe('0x35')](_0x10893a[_0xfffe('0x44')][_0xfffe('0x35')]);}return _0xd71b63[_0xfffe('0xb4')](_0x33b092);}})['then'](function(_0x46da98){if(_0x46da98){return _0x46da98?{'count':_0x5a30e0,'rows':_0x46da98}:null;}})['then'](respondWithResult(_0x537220,null))[_0xfffe('0x30')](handleError(_0x537220,null));};exports['send']=function(_0x34abbb,_0x3502fd,_0xd65021){var _0x35d73c,_0x363c60,_0x11b5c4;if(_[_0xfffe('0x78')](_0x34abbb[_0xfffe('0x63')][_0xfffe('0x63')])||_0x34abbb[_0xfffe('0x63')]['body']===''){throw new db['Sequelize'][(_0xfffe('0x22'))](_0xfffe('0x7b'));}if(_[_0xfffe('0x78')](_0x34abbb[_0xfffe('0x63')]['to'])){}_0x35d73c=_0x34abbb['body']['to'];return db[_0xfffe('0x54')][_0xfffe('0x68')]({'where':{'id':_0x34abbb[_0xfffe('0x5a')]['id']}})[_0xfffe('0x25')](handleEntityNotFound(_0x3502fd,null))[_0xfffe('0x25')](function(_0x5bda18){if(_0x5bda18){return db[_0xfffe('0x54')]['find']({'where':{'id':_0x5bda18['id']},'include':[{'model':db[_0xfffe('0xb5')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x5bda18[_0xfffe('0x7e')]]:_0x35d73c},'limit':0x1,'order':[[_0xfffe('0x74'),_0xfffe('0x83')]]}]}]})[_0xfffe('0x25')](handleEntityNotFound(_0x3502fd,null))[_0xfffe('0x25')](function(_0x208cfb){if(_0x208cfb&&_0x208cfb[_0xfffe('0x80')]){_0x363c60=_0x208cfb[_0xfffe('0x3a')]({'plain':!![]});if(_0x363c60[_0xfffe('0x80')]&&_0x363c60[_0xfffe('0x80')][_0xfffe('0x82')][_0xfffe('0x49')]){return _0x363c60[_0xfffe('0x80')]['Contacts'][0x0];}return db[_0xfffe('0x81')][_0xfffe('0x5e')](_[_0xfffe('0x1a')](_0x34abbb[_0xfffe('0x63')],{'firstName':_0x35d73c,[_0x208cfb['mapKey']]:_0x35d73c,'phone':_0x35d73c,'ListId':_0x363c60['ListId']}));}})['then'](handleEntityNotFound(_0x3502fd,null))[_0xfffe('0x25')](function(_0xe3570b){if(_0xe3570b){_0x11b5c4=_0xe3570b;return db[_0xfffe('0x8e')][_0xfffe('0x5d')]({'where':{'ContactId':_0x11b5c4['id'],'closed':![],'OpenchannelAccountId':_0x363c60['id']}})[_0xfffe('0x25')](function(_0x13c00b){if(_0x13c00b){return[_0x13c00b,![]];}return db[_0xfffe('0x8e')][_0xfffe('0x5e')]({'UserId':_0x34abbb[_0xfffe('0x5f')]['id'],'ContactId':_0x11b5c4['id'],'OpenchannelAccountId':_0x363c60['id'],'lastMsgDirection':_0xfffe('0xb6'),'Messages':[_[_0xfffe('0x50')](_0x34abbb[_0xfffe('0x63')],{'read':![],'body':_0x34abbb['body']['body'],'OpenchannelAccountId':_0x363c60['id'],'UserId':_0x34abbb['user']['id'],'ContactId':_0x11b5c4['id']})]},{'include':[{'model':db[_0xfffe('0xb7')],'as':_0xfffe('0xb8')}]})[_0xfffe('0x25')](function(_0x5527e4){return[_0x5527e4,!![]];});});}})[_0xfffe('0x90')](function(_0x284c2f,_0x35723){if(_0x35723){return _0x284c2f;}return db[_0xfffe('0xb7')][_0xfffe('0x5e')](_['merge'](_0x34abbb['body'],{'read':![],'body':_0x34abbb['body'][_0xfffe('0x63')],'OpenchannelAccountId':_0x363c60['id'],'OpenchannelInteractionId':_0x284c2f['id'],'UserId':_0x34abbb[_0xfffe('0x5f')]['id'],'ContactId':_0x11b5c4['id']}))[_0xfffe('0x25')](function(_0x186605){_0x284c2f['dataValues']['Messages']=[];_0x284c2f[_0xfffe('0xb9')][_0xfffe('0xb8')]['push'](_0x186605[_0xfffe('0xb9')]);return _0x284c2f;});});}})[_0xfffe('0x25')](respondWithResult(_0x3502fd,null))[_0xfffe('0x30')](handleError(_0x3502fd,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index af8be1e..6bcf830 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 _0x2f4f=['hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x10784b,_0x59bd34){var _0x3123b4=function(_0x2a58a5){while(--_0x2a58a5){_0x10784b['push'](_0x10784b['shift']());}};_0x3123b4(++_0x59bd34);}(_0x2f4f,0x1d8));var _0xf2f4=function(_0x3aca52,_0x6c028e){_0x3aca52=_0x3aca52-0x0;var _0x4b2fc3=_0x2f4f[_0x3aca52];return _0x4b2fc3;};'use strict';var EventEmitter=require(_0xf2f4('0x0'));var OpenchannelAccount=require(_0xf2f4('0x1'))['db'][_0xf2f4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf2f4('0x3')](0x0);var events={'afterCreate':_0xf2f4('0x4'),'afterUpdate':_0xf2f4('0x5'),'afterDestroy':_0xf2f4('0x6')};function emitEvent(_0x3fd958){return function(_0x43d7d7,_0x6511b4,_0x12d19a){OpenchannelAccountEvents[_0xf2f4('0x7')](_0x3fd958+':'+_0x43d7d7['id'],_0x43d7d7);OpenchannelAccountEvents[_0xf2f4('0x7')](_0x3fd958,_0x43d7d7);_0x12d19a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf2f4('0x8')](e,emitEvent(event));}}module[_0xf2f4('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x0d56=['exports','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4ade33,_0x103537){var _0x162cc1=function(_0x1c52ab){while(--_0x1c52ab){_0x4ade33['push'](_0x4ade33['shift']());}};_0x162cc1(++_0x103537);}(_0x0d56,0x181));var _0x60d5=function(_0x58d90a,_0x1a2ea6){_0x58d90a=_0x58d90a-0x0;var _0x3938a9=_0x0d56[_0x58d90a];return _0x3938a9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x60d5('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x60d5('0x1')](0x0);var events={'afterCreate':_0x60d5('0x2'),'afterUpdate':_0x60d5('0x3'),'afterDestroy':_0x60d5('0x4')};function emitEvent(_0x3ccacd){return function(_0x33a1e2,_0xc96171,_0x1bf58e){OpenchannelAccountEvents[_0x60d5('0x5')](_0x3ccacd+':'+_0x33a1e2['id'],_0x33a1e2);OpenchannelAccountEvents[_0x60d5('0x5')](_0x3ccacd,_0x33a1e2);_0x1bf58e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x60d5('0x6')](e,emitEvent(event));}}module[_0x60d5('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 b30745a..2362220 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 _0xea5d=['define','OpenchannelAccount','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3155bb,_0xf49694){var _0x36ef57=function(_0x226b82){while(--_0x226b82){_0x3155bb['push'](_0x3155bb['shift']());}};_0x36ef57(++_0xf49694);}(_0xea5d,0x132));var _0xdea5=function(_0x5b8b8c,_0x4cd81f){_0x5b8b8c=_0x5b8b8c-0x0;var _0x535c38=_0xea5d[_0x5b8b8c];return _0x535c38;};'use strict';var _=require('lodash');var util=require(_0xdea5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdea5('0x1'));var BPromise=require(_0xdea5('0x2'));var rp=require(_0xdea5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdea5('0x4'));var config=require(_0xdea5('0x5'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x58cdb8,_0x53a52a){return _0x58cdb8[_0xdea5('0x6')](_0xdea5('0x7'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63b7=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x13f2b7,_0x224502){var _0x59c0d6=function(_0x2c60ce){while(--_0x2c60ce){_0x13f2b7['push'](_0x13f2b7['shift']());}};_0x59c0d6(++_0x224502);}(_0x63b7,0x12c));var _0x763b=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0x63b7[_0x559a80];return _0x42f555;};'use strict';var _=require(_0x763b('0x0'));var util=require(_0x763b('0x1'));var logger=require(_0x763b('0x2'))(_0x763b('0x3'));var moment=require(_0x763b('0x4'));var BPromise=require(_0x763b('0x5'));var rp=require(_0x763b('0x6'));var fs=require('fs');var path=require(_0x763b('0x7'));var rimraf=require('rimraf');var config=require(_0x763b('0x8'));var attributes=require(_0x763b('0x9'));module[_0x763b('0xa')]=function(_0x433d11,_0x32ddf1){return _0x433d11[_0x763b('0xb')](_0x763b('0xc'),attributes,{'tableName':_0x763b('0xd'),'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 43e3cc2..b467a10 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 _0x751a=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x751a,0x102));var _0xa751=function(_0x3fb166,_0x4eb985){_0x3fb166=_0x3fb166-0x0;var _0x5e91be=_0x751a[_0x3fb166];return _0x5e91be;};'use strict';var _=require(_0xa751('0x0'));var util=require(_0xa751('0x1'));var moment=require(_0xa751('0x2'));var BPromise=require(_0xa751('0x3'));var rs=require(_0xa751('0x4'));var fs=require('fs');var Redis=require(_0xa751('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa751('0x6'));var logger=require(_0xa751('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa751('0x8'));var client=jayson[_0xa751('0x9')][_0xa751('0xa')]({'port':0x232a});config[_0xa751('0xb')]=_['defaults'](config[_0xa751('0xb')],{'host':_0xa751('0xc'),'port':0x18eb});var socket=require(_0xa751('0xd'))(new Redis(config[_0xa751('0xb')]));require('./openchannelAccount.socket')[_0xa751('0xe')](socket);function respondWithRpcPromise(_0x3ac873,_0x1b4099,_0x5eb884){return new BPromise(function(_0x3d2e04,_0x3fc0be){return client[_0xa751('0xf')](_0x3ac873,_0x5eb884)[_0xa751('0x10')](function(_0xae5dd1){logger['info'](_0xa751('0x11'),_0x1b4099,_0xa751('0x12'));logger[_0xa751('0x13')](_0xa751('0x14'),_0x1b4099,'request\x20sent',JSON[_0xa751('0x15')](_0xae5dd1));if(_0xae5dd1[_0xa751('0x16')]){if(_0xae5dd1[_0xa751('0x16')]['code']===0x1f4){logger['error'](_0xa751('0x11'),_0x1b4099,_0xae5dd1[_0xa751('0x16')][_0xa751('0x17')]);return _0x3fc0be(_0xae5dd1[_0xa751('0x16')][_0xa751('0x17')]);}logger['error'](_0xa751('0x11'),_0x1b4099,_0xae5dd1[_0xa751('0x16')]['message']);return _0x3d2e04(_0xae5dd1[_0xa751('0x16')][_0xa751('0x17')]);}else{logger['info'](_0xa751('0x11'),_0x1b4099,_0xa751('0x12'));_0x3d2e04(_0xae5dd1[_0xa751('0x18')][_0xa751('0x17')]);}})[_0xa751('0x19')](function(_0x20869e){logger[_0xa751('0x16')](_0xa751('0x11'),_0x1b4099,_0x20869e);_0x3fc0be(_0x20869e);});});} \ No newline at end of file +var _0x7ecc=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3270cf,_0x2c29fb){var _0x139188=function(_0x2886fd){while(--_0x2886fd){_0x3270cf['push'](_0x3270cf['shift']());}};_0x139188(++_0x2c29fb);}(_0x7ecc,0xe3));var _0xc7ec=function(_0x5b1da2,_0x1b7bea){_0x5b1da2=_0x5b1da2-0x0;var _0x75bb6a=_0x7ecc[_0x5b1da2];return _0x75bb6a;};'use strict';var _=require(_0xc7ec('0x0'));var util=require(_0xc7ec('0x1'));var moment=require(_0xc7ec('0x2'));var BPromise=require(_0xc7ec('0x3'));var rs=require(_0xc7ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7ec('0x5'))['db'];var utils=require(_0xc7ec('0x6'));var logger=require(_0xc7ec('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc7ec('0x8'));var client=jayson[_0xc7ec('0x9')][_0xc7ec('0xa')]({'port':0x232a});config[_0xc7ec('0xb')]=_[_0xc7ec('0xc')](config['redis'],{'host':_0xc7ec('0xd'),'port':0x18eb});var socket=require(_0xc7ec('0xe'))(new Redis(config[_0xc7ec('0xb')]));require(_0xc7ec('0xf'))['register'](socket);function respondWithRpcPromise(_0xd8e712,_0x5139a5,_0x236fd8){return new BPromise(function(_0x20de72,_0x52e3b6){return client[_0xc7ec('0x10')](_0xd8e712,_0x236fd8)[_0xc7ec('0x11')](function(_0x54826a){logger[_0xc7ec('0x12')](_0xc7ec('0x13'),_0x5139a5,_0xc7ec('0x14'));logger[_0xc7ec('0x15')](_0xc7ec('0x16'),_0x5139a5,_0xc7ec('0x14'),JSON['stringify'](_0x54826a));if(_0x54826a[_0xc7ec('0x17')]){if(_0x54826a[_0xc7ec('0x17')][_0xc7ec('0x18')]===0x1f4){logger[_0xc7ec('0x17')](_0xc7ec('0x13'),_0x5139a5,_0x54826a['error'][_0xc7ec('0x19')]);return _0x52e3b6(_0x54826a['error']['message']);}logger[_0xc7ec('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x5139a5,_0x54826a['error']['message']);return _0x20de72(_0x54826a[_0xc7ec('0x17')][_0xc7ec('0x19')]);}else{logger[_0xc7ec('0x12')](_0xc7ec('0x13'),_0x5139a5,_0xc7ec('0x14'));_0x20de72(_0x54826a[_0xc7ec('0x1a')]['message']);}})[_0xc7ec('0x1b')](function(_0x436a5c){logger[_0xc7ec('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x5139a5,_0x436a5c);_0x52e3b6(_0x436a5c);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9fc5f64..3333d7e 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 _0xfa7d=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x7668e5,_0x17d8d3){var _0x5e1208=function(_0x5b0588){while(--_0x5b0588){_0x7668e5['push'](_0x7668e5['shift']());}};_0x5e1208(++_0x17d8d3);}(_0xfa7d,0x162));var _0xdfa7=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xfa7d[_0x24237f];return _0x48298e;};'use strict';var OpenchannelAccountEvents=require(_0xdfa7('0x0'));var events=[_0xdfa7('0x1'),_0xdfa7('0x2'),_0xdfa7('0x3')];function createListener(_0x429743,_0x2192b8){return function(_0x457a16){_0x2192b8[_0xdfa7('0x4')](_0x429743,_0x457a16);};}function removeListener(_0x2908ff,_0x5ebeb7){return function(){OpenchannelAccountEvents[_0xdfa7('0x5')](_0x2908ff,_0x5ebeb7);};}exports[_0xdfa7('0x6')]=function(_0x65b8b6){for(var _0x1d1510=0x0,_0x4cb637=events[_0xdfa7('0x7')];_0x1d1510<_0x4cb637;_0x1d1510++){var _0x4b3fba=events[_0x1d1510];var _0x12781c=createListener(_0xdfa7('0x8')+_0x4b3fba,_0x65b8b6);OpenchannelAccountEvents['on'](_0x4b3fba,_0x12781c);}}; \ No newline at end of file +var _0xf657=['save','remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x44e5f6,_0x1cdb43){var _0x350e0e=function(_0x329ed1){while(--_0x329ed1){_0x44e5f6['push'](_0x44e5f6['shift']());}};_0x350e0e(++_0x1cdb43);}(_0xf657,0x1a6));var _0x7f65=function(_0x3236cd,_0xddb386){_0x3236cd=_0x3236cd-0x0;var _0x538d66=_0xf657[_0x3236cd];return _0x538d66;};'use strict';var OpenchannelAccountEvents=require(_0x7f65('0x0'));var events=[_0x7f65('0x1'),_0x7f65('0x2'),_0x7f65('0x3')];function createListener(_0x474029,_0x42b724){return function(_0x25cdab){_0x42b724[_0x7f65('0x4')](_0x474029,_0x25cdab);};}function removeListener(_0x1eaa11,_0x384a59){return function(){OpenchannelAccountEvents[_0x7f65('0x5')](_0x1eaa11,_0x384a59);};}exports[_0x7f65('0x6')]=function(_0x353e7a){for(var _0xc87b43=0x0,_0x25ab91=events[_0x7f65('0x7')];_0xc87b43<_0x25ab91;_0xc87b43++){var _0x4bad85=events[_0xc87b43];var _0x1f6be1=createListener(_0x7f65('0x8')+_0x4bad85,_0x353e7a);OpenchannelAccountEvents['on'](_0x4bad85,_0x1f6be1);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index be4f0e1..3ef686d 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 _0x0d8b=['../../config/environment','./openchannelApplication.controller','index','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x37eb6a,_0x5a3a52){var _0x15da93=function(_0x8995d9){while(--_0x8995d9){_0x37eb6a['push'](_0x37eb6a['shift']());}};_0x15da93(++_0x5a3a52);}(_0x0d8b,0x92));var _0xb0d8=function(_0x24679e,_0x22d9d7){_0x24679e=_0x24679e-0x0;var _0x291f21=_0x0d8b[_0x24679e];return _0x291f21;};'use strict';var multer=require(_0xb0d8('0x0'));var util=require('util');var path=require(_0xb0d8('0x1'));var timeout=require(_0xb0d8('0x2'));var express=require(_0xb0d8('0x3'));var router=express[_0xb0d8('0x4')]();var auth=require(_0xb0d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0d8('0x6'));var controller=require(_0xb0d8('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb0d8('0x8')]);router[_0xb0d8('0x9')](_0xb0d8('0xa'),auth[_0xb0d8('0xb')](),controller[_0xb0d8('0xc')]);router['post']('/',auth[_0xb0d8('0xb')](),controller[_0xb0d8('0xd')]);router[_0xb0d8('0xe')](_0xb0d8('0xa'),auth['isAuthenticated'](),controller[_0xb0d8('0xf')]);router[_0xb0d8('0x10')](_0xb0d8('0xa'),auth['isAuthenticated'](),controller[_0xb0d8('0x11')]);module[_0xb0d8('0x12')]=router; \ No newline at end of file +var _0xca86=['update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x39c006,_0x19f547){var _0x48061a=function(_0x2f364b){while(--_0x2f364b){_0x39c006['push'](_0x39c006['shift']());}};_0x48061a(++_0x19f547);}(_0xca86,0xc8));var _0x6ca8=function(_0x484f24,_0x5d4b8c){_0x484f24=_0x484f24-0x0;var _0xa4077d=_0xca86[_0x484f24];return _0xa4077d;};'use strict';var multer=require(_0x6ca8('0x0'));var util=require(_0x6ca8('0x1'));var path=require('path');var timeout=require(_0x6ca8('0x2'));var express=require(_0x6ca8('0x3'));var router=express[_0x6ca8('0x4')]();var auth=require(_0x6ca8('0x5'));var interaction=require(_0x6ca8('0x6'));var config=require(_0x6ca8('0x7'));var controller=require(_0x6ca8('0x8'));router[_0x6ca8('0x9')]('/',auth[_0x6ca8('0xa')](),controller['index']);router['get'](_0x6ca8('0xb'),auth[_0x6ca8('0xa')](),controller[_0x6ca8('0xc')]);router[_0x6ca8('0xd')]('/',auth[_0x6ca8('0xa')](),controller[_0x6ca8('0xe')]);router[_0x6ca8('0xf')]('/:id',auth[_0x6ca8('0xa')](),controller[_0x6ca8('0x10')]);router[_0x6ca8('0x11')](_0x6ca8('0xb'),auth[_0x6ca8('0xa')](),controller['destroy']);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 2d620ab..95b80b1 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 _0x4381=['INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x2bc1e6,_0x1c3ce4){var _0x78a662=function(_0x2b1b41){while(--_0x2b1b41){_0x2bc1e6['push'](_0x2bc1e6['shift']());}};_0x78a662(++_0x1c3ce4);}(_0x4381,0x1d4));var _0x1438=function(_0x15a913,_0x1a077c){_0x15a913=_0x15a913-0x0;var _0xa1483f=_0x4381[_0x15a913];return _0xa1483f;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x1438('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x1438('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1438('0x2')]()},'description':{'type':Sequelize[_0x1438('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1438('0x3')}}; \ No newline at end of file +var _0x5d09=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x5d09,0xe0));var _0x95d0=function(_0x2e846f,_0x57929a){_0x2e846f=_0x2e846f-0x0;var _0x42f147=_0x5d09[_0x2e846f];return _0x42f147;};'use strict';var Sequelize=require(_0x95d0('0x0'));module['exports']={'priority':{'type':Sequelize[_0x95d0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x95d0('0x2')],'allowNull':![],'defaultValue':_0x95d0('0x3')},'appdata':{'type':Sequelize[_0x95d0('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x95d0('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 93f4f14..424e3dc 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 _0x7621=['rows','catch','params','includeAll','include','options','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','apply','save','update','destroy','then','stack','name','send','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x314fbc,_0x53d5bd){var _0x4117cf=function(_0x25c4f5){while(--_0x25c4f5){_0x314fbc['push'](_0x314fbc['shift']());}};_0x4117cf(++_0x53d5bd);}(_0x7621,0x91));var _0x1762=function(_0x173bf6,_0x2d2f5c){_0x173bf6=_0x173bf6-0x0;var _0x2504f8=_0x7621[_0x173bf6];return _0x2504f8;};'use strict';var pdf=require(_0x1762('0x0'));var emlformat=require(_0x1762('0x1'));var rimraf=require(_0x1762('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1762('0x3'));var rp=require(_0x1762('0x4'));var moment=require(_0x1762('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1762('0x6'));var util=require(_0x1762('0x7'));var path=require(_0x1762('0x8'));var sox=require(_0x1762('0x9'));var csv=require('to-csv');var ejs=require(_0x1762('0xa'));var fs=require('fs');var _=require(_0x1762('0xb'));var squel=require('squel');var crypto=require(_0x1762('0xc'));var jsforce=require(_0x1762('0xd'));var deskjs=require(_0x1762('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1762('0xf'));var Redis=require(_0x1762('0x10'));var authService=require(_0x1762('0x11'));var qs=require(_0x1762('0x12'));var as=require(_0x1762('0x13'));var hardwareService=require(_0x1762('0x14'));var logger=require(_0x1762('0x15'))(_0x1762('0x16'));var utils=require(_0x1762('0x17'));var config=require(_0x1762('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d18b7,_0x36435d){_0x36435d=_0x36435d||0xcc;return function(_0x21c9e2){if(_0x21c9e2){return _0x5d18b7[_0x1762('0x19')](_0x36435d);}return _0x5d18b7['status'](_0x36435d)[_0x1762('0x1a')]();};}function respondWithResult(_0x3a0602,_0x14867a){_0x14867a=_0x14867a||0xc8;return function(_0x45ee0a){if(_0x45ee0a){return _0x3a0602[_0x1762('0x1b')](_0x14867a)['json'](_0x45ee0a);}};}function respondWithFilteredResult(_0xae7de6,_0x106d3e){return function(_0x2cb80b){if(_0x2cb80b){var _0x4a637b=_0x2cb80b[_0x1762('0x1c')],_0x462a9a=_0x106d3e[_0x1762('0x1d')],_0x11135d=_0x106d3e[_0x1762('0x1d')]+_0x106d3e[_0x1762('0x1e')],_0x25cf86;if(_0x11135d>=_0x4a637b){_0x11135d=_0x4a637b;_0x25cf86=0xc8;}else{_0x25cf86=0xce;}_0xae7de6['status'](_0x25cf86);return _0xae7de6['set']('Content-Range',_0x462a9a+'-'+_0x11135d+'/'+_0x4a637b)['json'](_0x2cb80b);}return null;};}function patchUpdates(_0x3d008d){return function(_0x9bcea2){try{jsonpatch[_0x1762('0x1f')](_0x9bcea2,_0x3d008d,!![]);}catch(_0x435ce9){return BPromise['reject'](_0x435ce9);}return _0x9bcea2[_0x1762('0x20')]();};}function saveUpdates(_0x72c9fd,_0x2d80cb){return function(_0x113c96){if(_0x113c96){return _0x113c96[_0x1762('0x21')](_0x72c9fd)['then'](function(_0x54246f){return _0x54246f;});}return null;};}function removeEntity(_0x425972,_0x2defbc){return function(_0x24e020){if(_0x24e020){return _0x24e020[_0x1762('0x22')]()[_0x1762('0x23')](function(){_0x425972[_0x1762('0x1b')](0xcc)[_0x1762('0x1a')]();});}};}function handleEntityNotFound(_0x47d6bd,_0x3a0418){return function(_0x406ffe){if(!_0x406ffe){_0x47d6bd[_0x1762('0x19')](0x194);}return _0x406ffe;};}function handleError(_0x1e29e7,_0x47a5cb){_0x47a5cb=_0x47a5cb||0x1f4;return function(_0x451403){logger['error'](_0x451403[_0x1762('0x24')]);if(_0x451403[_0x1762('0x25')]){delete _0x451403[_0x1762('0x25')];}_0x1e29e7['status'](_0x47a5cb)[_0x1762('0x26')](_0x451403);};}exports['index']=function(_0x3b29b6,_0x46825e){var _0x1d1c2b={},_0x3a4cd1={},_0x4e9373={'count':0x0,'rows':[]};var _0x333e60=_[_0x1762('0x27')](db[_0x1762('0x28')][_0x1762('0x29')],function(_0x48ed96){return{'name':_0x48ed96['fieldName'],'type':_0x48ed96[_0x1762('0x2a')][_0x1762('0x2b')]};});_0x3a4cd1[_0x1762('0x2c')]=_[_0x1762('0x27')](_0x333e60,_0x1762('0x25'));_0x3a4cd1[_0x1762('0x2d')]=_[_0x1762('0x2e')](_0x3b29b6[_0x1762('0x2d')]);_0x3a4cd1[_0x1762('0x2f')]=_['intersection'](_0x3a4cd1[_0x1762('0x2c')],_0x3a4cd1[_0x1762('0x2d')]);_0x1d1c2b[_0x1762('0x30')]=_[_0x1762('0x31')](_0x3a4cd1[_0x1762('0x2c')],qs[_0x1762('0x32')](_0x3b29b6['query']['fields']));_0x1d1c2b['attributes']=_0x1d1c2b[_0x1762('0x30')][_0x1762('0x33')]?_0x1d1c2b['attributes']:_0x3a4cd1[_0x1762('0x2c')];if(!_0x3b29b6['query'][_0x1762('0x34')]('nolimit')){_0x1d1c2b['limit']=qs['limit'](_0x3b29b6[_0x1762('0x2d')][_0x1762('0x1e')]);_0x1d1c2b[_0x1762('0x1d')]=qs[_0x1762('0x1d')](_0x3b29b6['query'][_0x1762('0x1d')]);}_0x1d1c2b[_0x1762('0x35')]=qs['sort'](_0x3b29b6[_0x1762('0x2d')][_0x1762('0x36')]);_0x1d1c2b[_0x1762('0x37')]=qs['filters'](_['pick'](_0x3b29b6[_0x1762('0x2d')],_0x3a4cd1['filters']),_0x333e60);if(_0x3b29b6[_0x1762('0x2d')][_0x1762('0x38')]){_0x1d1c2b['where']=_[_0x1762('0x39')](_0x1d1c2b[_0x1762('0x37')],{'$or':_[_0x1762('0x27')](_0x333e60,function(_0x4d1f4d){if(_0x4d1f4d[_0x1762('0x2a')]!==_0x1762('0x3a')){var _0x5417cf={};_0x5417cf[_0x4d1f4d[_0x1762('0x25')]]={'$like':'%'+_0x3b29b6[_0x1762('0x2d')]['filter']+'%'};return _0x5417cf;}})});}_0x1d1c2b=_['merge']({},_0x1d1c2b,_0x3b29b6['options']);var _0x294247={'where':_0x1d1c2b['where']};return db[_0x1762('0x28')]['count'](_0x294247)[_0x1762('0x23')](function(_0x4f0138){_0x4e9373[_0x1762('0x1c')]=_0x4f0138;if(_0x3b29b6[_0x1762('0x2d')]['includeAll']){_0x1d1c2b['include']=[{'all':!![]}];}return db[_0x1762('0x28')]['findAll'](_0x1d1c2b);})[_0x1762('0x23')](function(_0x11055c){_0x4e9373[_0x1762('0x3b')]=_0x11055c;return _0x4e9373;})['then'](respondWithFilteredResult(_0x46825e,_0x1d1c2b))[_0x1762('0x3c')](handleError(_0x46825e,null));};exports['show']=function(_0x52898e,_0x51bf7f){var _0x5d64fb={'raw':!![],'where':{'id':_0x52898e[_0x1762('0x3d')]['id']}},_0xa9e61b={};_0xa9e61b[_0x1762('0x2c')]=_[_0x1762('0x2e')](db[_0x1762('0x28')]['rawAttributes']);_0xa9e61b['query']=_['keys'](_0x52898e[_0x1762('0x2d')]);_0xa9e61b[_0x1762('0x2f')]=_[_0x1762('0x31')](_0xa9e61b[_0x1762('0x2c')],_0xa9e61b[_0x1762('0x2d')]);_0x5d64fb[_0x1762('0x30')]=_['intersection'](_0xa9e61b['model'],qs['fields'](_0x52898e['query']['fields']));_0x5d64fb[_0x1762('0x30')]=_0x5d64fb[_0x1762('0x30')][_0x1762('0x33')]?_0x5d64fb[_0x1762('0x30')]:_0xa9e61b['model'];if(_0x52898e[_0x1762('0x2d')][_0x1762('0x3e')]){_0x5d64fb[_0x1762('0x3f')]=[{'all':!![]}];}_0x5d64fb=_[_0x1762('0x39')]({},_0x5d64fb,_0x52898e[_0x1762('0x40')]);return db[_0x1762('0x28')][_0x1762('0x41')](_0x5d64fb)[_0x1762('0x23')](handleEntityNotFound(_0x51bf7f,null))[_0x1762('0x23')](respondWithResult(_0x51bf7f,null))['catch'](handleError(_0x51bf7f,null));};exports['create']=function(_0x36e6d5,_0x303c80){return db[_0x1762('0x28')][_0x1762('0x42')](_0x36e6d5[_0x1762('0x43')],{})[_0x1762('0x23')](respondWithResult(_0x303c80,0xc9))[_0x1762('0x3c')](handleError(_0x303c80,null));};exports[_0x1762('0x21')]=function(_0x5abfd4,_0x29c0fc){if(_0x5abfd4[_0x1762('0x43')]['id']){delete _0x5abfd4['body']['id'];}return db['OpenchannelApplication'][_0x1762('0x41')]({'where':{'id':_0x5abfd4[_0x1762('0x3d')]['id']}})[_0x1762('0x23')](handleEntityNotFound(_0x29c0fc,null))['then'](saveUpdates(_0x5abfd4[_0x1762('0x43')],null))[_0x1762('0x23')](respondWithResult(_0x29c0fc,null))[_0x1762('0x3c')](handleError(_0x29c0fc,null));};exports[_0x1762('0x22')]=function(_0x23325b,_0x47a8de){return db[_0x1762('0x28')][_0x1762('0x41')]({'where':{'id':_0x23325b[_0x1762('0x3d')]['id']}})[_0x1762('0x23')](handleEntityNotFound(_0x47a8de,null))[_0x1762('0x23')](removeEntity(_0x47a8de,null))[_0x1762('0x3c')](handleError(_0x47a8de,null));}; \ No newline at end of file +var _0x06d8=['sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','index','map','OpenchannelApplication','fieldName','type','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','rawAttributes','intersection','include','find','catch','create','body','update','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1b2047,_0xabdf3b){var _0x3a8489=function(_0x1954b7){while(--_0x1954b7){_0x1b2047['push'](_0x1b2047['shift']());}};_0x3a8489(++_0xabdf3b);}(_0x06d8,0x7c));var _0x806d=function(_0x212971,_0x56bc42){_0x212971=_0x212971-0x0;var _0x220c2c=_0x06d8[_0x212971];return _0x220c2c;};'use strict';var pdf=require(_0x806d('0x0'));var emlformat=require(_0x806d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x806d('0x2'));var jsonpatch=require(_0x806d('0x3'));var rp=require(_0x806d('0x4'));var moment=require('moment');var BPromise=require(_0x806d('0x5'));var Mustache=require(_0x806d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x806d('0x7'));var csv=require(_0x806d('0x8'));var ejs=require(_0x806d('0x9'));var fs=require('fs');var _=require(_0x806d('0xa'));var squel=require(_0x806d('0xb'));var crypto=require('crypto');var jsforce=require(_0x806d('0xc'));var deskjs=require(_0x806d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x806d('0xe'));var Papa=require(_0x806d('0xf'));var Redis=require('ioredis');var authService=require(_0x806d('0x10'));var qs=require(_0x806d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x806d('0x12'));var logger=require(_0x806d('0x13'))(_0x806d('0x14'));var utils=require(_0x806d('0x15'));var config=require(_0x806d('0x16'));var db=require(_0x806d('0x17'))['db'];function respondWithStatusCode(_0x863642,_0x22fc53){_0x22fc53=_0x22fc53||0xcc;return function(_0x17cc8e){if(_0x17cc8e){return _0x863642[_0x806d('0x18')](_0x22fc53);}return _0x863642['status'](_0x22fc53)[_0x806d('0x19')]();};}function respondWithResult(_0x571459,_0x2f53b8){_0x2f53b8=_0x2f53b8||0xc8;return function(_0x45ee20){if(_0x45ee20){return _0x571459[_0x806d('0x1a')](_0x2f53b8)[_0x806d('0x1b')](_0x45ee20);}};}function respondWithFilteredResult(_0x1ad6ae,_0x260876){return function(_0x34b23b){if(_0x34b23b){var _0x4cdab0=_0x34b23b[_0x806d('0x1c')],_0x14a0e8=_0x260876[_0x806d('0x1d')],_0x2d53ee=_0x260876[_0x806d('0x1d')]+_0x260876[_0x806d('0x1e')],_0x4934c6;if(_0x2d53ee>=_0x4cdab0){_0x2d53ee=_0x4cdab0;_0x4934c6=0xc8;}else{_0x4934c6=0xce;}_0x1ad6ae[_0x806d('0x1a')](_0x4934c6);return _0x1ad6ae[_0x806d('0x1f')]('Content-Range',_0x14a0e8+'-'+_0x2d53ee+'/'+_0x4cdab0)['json'](_0x34b23b);}return null;};}function patchUpdates(_0x44b8ed){return function(_0xab7536){try{jsonpatch[_0x806d('0x20')](_0xab7536,_0x44b8ed,!![]);}catch(_0x5e585b){return BPromise[_0x806d('0x21')](_0x5e585b);}return _0xab7536[_0x806d('0x22')]();};}function saveUpdates(_0x491594,_0x22482c){return function(_0x4b0dc4){if(_0x4b0dc4){return _0x4b0dc4['update'](_0x491594)[_0x806d('0x23')](function(_0x4a54e5){return _0x4a54e5;});}return null;};}function removeEntity(_0x42f7e1,_0x5082ef){return function(_0x55b40d){if(_0x55b40d){return _0x55b40d['destroy']()[_0x806d('0x23')](function(){_0x42f7e1['status'](0xcc)[_0x806d('0x19')]();});}};}function handleEntityNotFound(_0x179746,_0x538513){return function(_0x21ecf4){if(!_0x21ecf4){_0x179746[_0x806d('0x18')](0x194);}return _0x21ecf4;};}function handleError(_0x3f6735,_0x593fbe){_0x593fbe=_0x593fbe||0x1f4;return function(_0x28e7ea){logger['error'](_0x28e7ea[_0x806d('0x24')]);if(_0x28e7ea[_0x806d('0x25')]){delete _0x28e7ea[_0x806d('0x25')];}_0x3f6735[_0x806d('0x1a')](_0x593fbe)[_0x806d('0x26')](_0x28e7ea);};}exports[_0x806d('0x27')]=function(_0x52a89b,_0x56fae8){var _0x57e83b={},_0x4eec09={},_0x59ecfc={'count':0x0,'rows':[]};var _0x4c8628=_[_0x806d('0x28')](db[_0x806d('0x29')]['rawAttributes'],function(_0x5235cb){return{'name':_0x5235cb[_0x806d('0x2a')],'type':_0x5235cb[_0x806d('0x2b')]['key']};});_0x4eec09[_0x806d('0x2c')]=_[_0x806d('0x28')](_0x4c8628,_0x806d('0x25'));_0x4eec09[_0x806d('0x2d')]=_[_0x806d('0x2e')](_0x52a89b[_0x806d('0x2d')]);_0x4eec09[_0x806d('0x2f')]=_['intersection'](_0x4eec09[_0x806d('0x2c')],_0x4eec09[_0x806d('0x2d')]);_0x57e83b['attributes']=_['intersection'](_0x4eec09[_0x806d('0x2c')],qs[_0x806d('0x30')](_0x52a89b[_0x806d('0x2d')][_0x806d('0x30')]));_0x57e83b[_0x806d('0x31')]=_0x57e83b[_0x806d('0x31')][_0x806d('0x32')]?_0x57e83b['attributes']:_0x4eec09['model'];if(!_0x52a89b['query'][_0x806d('0x33')](_0x806d('0x34'))){_0x57e83b[_0x806d('0x1e')]=qs['limit'](_0x52a89b['query']['limit']);_0x57e83b[_0x806d('0x1d')]=qs[_0x806d('0x1d')](_0x52a89b[_0x806d('0x2d')][_0x806d('0x1d')]);}_0x57e83b[_0x806d('0x35')]=qs[_0x806d('0x36')](_0x52a89b[_0x806d('0x2d')][_0x806d('0x36')]);_0x57e83b[_0x806d('0x37')]=qs[_0x806d('0x2f')](_[_0x806d('0x38')](_0x52a89b[_0x806d('0x2d')],_0x4eec09[_0x806d('0x2f')]),_0x4c8628);if(_0x52a89b[_0x806d('0x2d')][_0x806d('0x39')]){_0x57e83b[_0x806d('0x37')]=_['merge'](_0x57e83b['where'],{'$or':_['map'](_0x4c8628,function(_0x153568){if(_0x153568[_0x806d('0x2b')]!==_0x806d('0x3a')){var _0x44c79b={};_0x44c79b[_0x153568[_0x806d('0x25')]]={'$like':'%'+_0x52a89b[_0x806d('0x2d')][_0x806d('0x39')]+'%'};return _0x44c79b;}})});}_0x57e83b=_[_0x806d('0x3b')]({},_0x57e83b,_0x52a89b['options']);var _0x11ea84={'where':_0x57e83b[_0x806d('0x37')]};return db[_0x806d('0x29')][_0x806d('0x1c')](_0x11ea84)['then'](function(_0x2d1763){_0x59ecfc[_0x806d('0x1c')]=_0x2d1763;if(_0x52a89b[_0x806d('0x2d')][_0x806d('0x3c')]){_0x57e83b['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x806d('0x3d')](_0x57e83b);})['then'](function(_0x5493f0){_0x59ecfc[_0x806d('0x3e')]=_0x5493f0;return _0x59ecfc;})[_0x806d('0x23')](respondWithFilteredResult(_0x56fae8,_0x57e83b))['catch'](handleError(_0x56fae8,null));};exports[_0x806d('0x3f')]=function(_0x57220f,_0x7606a3){var _0x4765b8={'raw':!![],'where':{'id':_0x57220f[_0x806d('0x40')]['id']}},_0x2f6102={};_0x2f6102[_0x806d('0x2c')]=_['keys'](db[_0x806d('0x29')][_0x806d('0x41')]);_0x2f6102[_0x806d('0x2d')]=_[_0x806d('0x2e')](_0x57220f[_0x806d('0x2d')]);_0x2f6102[_0x806d('0x2f')]=_[_0x806d('0x42')](_0x2f6102[_0x806d('0x2c')],_0x2f6102[_0x806d('0x2d')]);_0x4765b8['attributes']=_['intersection'](_0x2f6102[_0x806d('0x2c')],qs[_0x806d('0x30')](_0x57220f[_0x806d('0x2d')]['fields']));_0x4765b8[_0x806d('0x31')]=_0x4765b8[_0x806d('0x31')][_0x806d('0x32')]?_0x4765b8[_0x806d('0x31')]:_0x2f6102[_0x806d('0x2c')];if(_0x57220f['query'][_0x806d('0x3c')]){_0x4765b8[_0x806d('0x43')]=[{'all':!![]}];}_0x4765b8=_[_0x806d('0x3b')]({},_0x4765b8,_0x57220f['options']);return db[_0x806d('0x29')][_0x806d('0x44')](_0x4765b8)[_0x806d('0x23')](handleEntityNotFound(_0x7606a3,null))['then'](respondWithResult(_0x7606a3,null))[_0x806d('0x45')](handleError(_0x7606a3,null));};exports[_0x806d('0x46')]=function(_0x432677,_0x2e8cae){return db[_0x806d('0x29')]['create'](_0x432677[_0x806d('0x47')],{})[_0x806d('0x23')](respondWithResult(_0x2e8cae,0xc9))['catch'](handleError(_0x2e8cae,null));};exports[_0x806d('0x48')]=function(_0x336cd7,_0x29e120){if(_0x336cd7['body']['id']){delete _0x336cd7['body']['id'];}return db['OpenchannelApplication'][_0x806d('0x44')]({'where':{'id':_0x336cd7['params']['id']}})[_0x806d('0x23')](handleEntityNotFound(_0x29e120,null))['then'](saveUpdates(_0x336cd7[_0x806d('0x47')],null))[_0x806d('0x23')](respondWithResult(_0x29e120,null))['catch'](handleError(_0x29e120,null));};exports[_0x806d('0x49')]=function(_0x544aae,_0x5870d7){return db[_0x806d('0x29')][_0x806d('0x44')]({'where':{'id':_0x544aae[_0x806d('0x40')]['id']}})[_0x806d('0x23')](handleEntityNotFound(_0x5870d7,null))['then'](removeEntity(_0x5870d7,null))[_0x806d('0x45')](handleError(_0x5870d7,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 75bb6a1..f8b44e9 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 _0x402d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x15033b,_0xbc9e85){var _0x5ad13d=function(_0xd08815){while(--_0xd08815){_0x15033b['push'](_0x15033b['shift']());}};_0x5ad13d(++_0xbc9e85);}(_0x402d,0x142));var _0xd402=function(_0x39fdd7,_0x4e509a){_0x39fdd7=_0x39fdd7-0x0;var _0x183c41=_0x402d[_0x39fdd7];return _0x183c41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd402('0x0'))(_0xd402('0x1'));var moment=require(_0xd402('0x2'));var BPromise=require(_0xd402('0x3'));var rp=require(_0xd402('0x4'));var fs=require('fs');var path=require(_0xd402('0x5'));var rimraf=require(_0xd402('0x6'));var config=require(_0xd402('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xd402('0x8')]=function(_0x3bd17c,_0x5f2ca6){return _0x3bd17c[_0xd402('0x9')](_0xd402('0xa'),attributes,{'tableName':_0xd402('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd402('0xc')});}; \ No newline at end of file +var _0xbd26=['request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x97f80e,_0x6ab038){var _0x4195cc=function(_0x1821d0){while(--_0x1821d0){_0x97f80e['push'](_0x97f80e['shift']());}};_0x4195cc(++_0x6ab038);}(_0xbd26,0xfa));var _0x6bd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd26[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6bd2('0x0'));var util=require(_0x6bd2('0x1'));var logger=require('../../config/logger')(_0x6bd2('0x2'));var moment=require(_0x6bd2('0x3'));var BPromise=require(_0x6bd2('0x4'));var rp=require(_0x6bd2('0x5'));var fs=require('fs');var path=require(_0x6bd2('0x6'));var rimraf=require(_0x6bd2('0x7'));var config=require(_0x6bd2('0x8'));var attributes=require(_0x6bd2('0x9'));module[_0x6bd2('0xa')]=function(_0xc77257,_0x3821de){return _0xc77257[_0x6bd2('0xb')](_0x6bd2('0xc'),attributes,{'tableName':_0x6bd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6bd2('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d81a7d8..daf2c42 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(_0xf11596,_0x18bfb1){var _0x3459cf=function(_0x4f893b){while(--_0x4f893b){_0xf11596['push'](_0xf11596['shift']());}};_0x3459cf(++_0x18bfb1);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xb10b[_0x1ca890];return _0x3f8e01;};'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 _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x187045,_0x27442a){var _0x228241=function(_0x3c2a4f){while(--_0x3c2a4f){_0x187045['push'](_0x187045['shift']());}};_0x228241(++_0x27442a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x401531,_0x582a70){_0x401531=_0x401531-0x0;var _0x51b83c=_0x5f2f[_0x401531];return _0x51b83c;};'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')]('OpenchannelApplication,\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')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0f61a66..7cc3f58 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 _0x188c=['download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x5090f4,_0x4c771f){var _0x5586dd=function(_0x2887e6){while(--_0x2887e6){_0x5090f4['push'](_0x5090f4['shift']());}};_0x5586dd(++_0x4c771f);}(_0x188c,0x1bb));var _0xc188=function(_0x4ba102,_0x3dc213){_0x4ba102=_0x4ba102-0x0;var _0x1f35e7=_0x188c[_0x4ba102];return _0x1f35e7;};'use strict';var multer=require(_0xc188('0x0'));var util=require(_0xc188('0x1'));var path=require(_0xc188('0x2'));var timeout=require(_0xc188('0x3'));var express=require(_0xc188('0x4'));var router=express[_0xc188('0x5')]();var auth=require(_0xc188('0x6'));var interaction=require(_0xc188('0x7'));var config=require(_0xc188('0x8'));var controller=require(_0xc188('0x9'));router['get']('/',auth[_0xc188('0xa')](),controller['index']);router[_0xc188('0xb')](_0xc188('0xc'),auth[_0xc188('0xa')](),controller[_0xc188('0xd')]);router['get'](_0xc188('0xe'),auth[_0xc188('0xa')](),controller[_0xc188('0xf')]);router[_0xc188('0xb')](_0xc188('0x10'),auth[_0xc188('0xa')](),controller[_0xc188('0x11')]);router[_0xc188('0xb')](_0xc188('0x12'),auth[_0xc188('0xa')](),controller[_0xc188('0x13')]);router[_0xc188('0x14')]('/',auth[_0xc188('0xa')](),controller['create']);router[_0xc188('0x14')](_0xc188('0x10'),auth['isAuthenticated'](),controller[_0xc188('0x15')]);router['post'](_0xc188('0x16'),auth[_0xc188('0xa')](),interaction[_0xc188('0x17')](_0xc188('0x18'),_0xc188('0x19')),controller['addTags']);router[_0xc188('0x1a')](_0xc188('0xe'),auth[_0xc188('0xa')](),interaction[_0xc188('0x17')](_0xc188('0x18'),_0xc188('0x1b')),controller[_0xc188('0x1c')]);router[_0xc188('0x1d')](_0xc188('0xe'),auth['isAuthenticated'](),interaction[_0xc188('0x17')](_0xc188('0x18'),_0xc188('0x1e')),controller[_0xc188('0x1f')]);router[_0xc188('0x1d')](_0xc188('0x16'),auth[_0xc188('0xa')](),controller['removeTags']);module[_0xc188('0x20')]=router; \ No newline at end of file +var _0x82dc=['/describe','describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','tracked','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x82dc,0x103));var _0xc82d=function(_0x429054,_0x353e19){_0x429054=_0x429054-0x0;var _0x155448=_0x82dc[_0x429054];return _0x155448;};'use strict';var multer=require(_0xc82d('0x0'));var util=require(_0xc82d('0x1'));var path=require(_0xc82d('0x2'));var timeout=require(_0xc82d('0x3'));var express=require(_0xc82d('0x4'));var router=express[_0xc82d('0x5')]();var auth=require(_0xc82d('0x6'));var interaction=require(_0xc82d('0x7'));var config=require(_0xc82d('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xc82d('0x9')]('/',auth[_0xc82d('0xa')](),controller['index']);router[_0xc82d('0x9')](_0xc82d('0xb'),auth[_0xc82d('0xa')](),controller[_0xc82d('0xc')]);router[_0xc82d('0x9')](_0xc82d('0xd'),auth[_0xc82d('0xa')](),controller[_0xc82d('0xe')]);router[_0xc82d('0x9')](_0xc82d('0xf'),auth[_0xc82d('0xa')](),controller['getMessages']);router[_0xc82d('0x9')]('/:id/download',auth[_0xc82d('0xa')](),controller[_0xc82d('0x10')]);router[_0xc82d('0x11')]('/',auth[_0xc82d('0xa')](),controller[_0xc82d('0x12')]);router[_0xc82d('0x11')](_0xc82d('0xf'),auth[_0xc82d('0xa')](),controller[_0xc82d('0x13')]);router[_0xc82d('0x11')](_0xc82d('0x14'),auth[_0xc82d('0xa')](),interaction['tracked'](_0xc82d('0x15'),_0xc82d('0x16')),controller[_0xc82d('0x17')]);router['put'](_0xc82d('0xd'),auth[_0xc82d('0xa')](),interaction[_0xc82d('0x18')](_0xc82d('0x15'),'openchannelinteraction:update'),controller['update']);router['delete'](_0xc82d('0xd'),auth[_0xc82d('0xa')](),interaction['tracked']('openchannel',_0xc82d('0x19')),controller[_0xc82d('0x1a')]);router[_0xc82d('0x1b')](_0xc82d('0x14'),auth[_0xc82d('0xa')](),controller[_0xc82d('0x1c')]);module[_0xc82d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index fff3e4a..7123439 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 _0x1323=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x1323,0x114));var _0x3132=function(_0x2fa25a,_0x3fecd8){_0x2fa25a=_0x2fa25a-0x0;var _0x1f80ef=_0x1323[_0x2fa25a];return _0x1f80ef;};'use strict';var Sequelize=require(_0x3132('0x0'));module[_0x3132('0x1')]={'closed':{'type':Sequelize[_0x3132('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3132('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x3132('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x3132('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3132('0x5')]('in',_0x3132('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3132('0x3')]}}; \ No newline at end of file +var _0x3df8=['ENUM','out','exports','DATE','STRING'];(function(_0x129c27,_0x333c44){var _0x5a8017=function(_0x5c5083){while(--_0x5c5083){_0x129c27['push'](_0x129c27['shift']());}};_0x5a8017(++_0x333c44);}(_0x3df8,0xed));var _0x83df=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x3df8[_0x52c4e9];return _0x252a03;};'use strict';var Sequelize=require('sequelize');module[_0x83df('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x83df('0x1')]},'disposition':{'type':Sequelize[_0x83df('0x2')]},'note':{'type':Sequelize[_0x83df('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x83df('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x83df('0x3')]('in',_0x83df('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x83df('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 55353e6..8c3bdae 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 _0x704c=['Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','catch','params','includeAll','create','body','destroy','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','attachments','join','transcript-%d-%s.zip','firstName','lastName','secret','get','mkdirSync','\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
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','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\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\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%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\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\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{{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\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\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%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\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','format','YYYY-MM-DD','N.A.','closed','closedAt','disposition','threadId','Public','Private','Messages','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','direction','renderFile','views','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','Tags','split','forEach','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','start','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','text','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','toString','count','sequelize','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*'];(function(_0x36df0b,_0x461795){var _0x326ed7=function(_0x12e8b2){while(--_0x12e8b2){_0x36df0b['push'](_0x36df0b['shift']());}};_0x326ed7(++_0x461795);}(_0x704c,0x143));var _0xc704=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x704c[_0xbe200f];return _0x192597;};'use strict';var pdf=require(_0xc704('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc704('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc704('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc704('0x3'));var Mustache=require(_0xc704('0x4'));var util=require('util');var path=require(_0xc704('0x5'));var sox=require(_0xc704('0x6'));var csv=require(_0xc704('0x7'));var ejs=require(_0xc704('0x8'));var fs=require('fs');var _=require(_0xc704('0x9'));var squel=require('squel');var crypto=require(_0xc704('0xa'));var jsforce=require(_0xc704('0xb'));var deskjs=require(_0xc704('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc704('0xd'));var Papa=require(_0xc704('0xe'));var Redis=require(_0xc704('0xf'));var authService=require(_0xc704('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc704('0x11'));var hardwareService=require(_0xc704('0x12'));var logger=require('../../config/logger')(_0xc704('0x13'));var utils=require(_0xc704('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc704('0x15')]=_[_0xc704('0x16')](config['redis'],{'host':_0xc704('0x17'),'port':0x18eb});var socket=require(_0xc704('0x18'))(new Redis(config['redis']));require(_0xc704('0x19'))[_0xc704('0x1a')](socket);function respondWithStatusCode(_0x749ae0,_0x10c3cc){_0x10c3cc=_0x10c3cc||0xcc;return function(_0x5e3c59){if(_0x5e3c59){return _0x749ae0[_0xc704('0x1b')](_0x10c3cc);}return _0x749ae0[_0xc704('0x1c')](_0x10c3cc)[_0xc704('0x1d')]();};}function respondWithResult(_0x134585,_0x2657a3){_0x2657a3=_0x2657a3||0xc8;return function(_0xbf0de1){if(_0xbf0de1){return _0x134585['status'](_0x2657a3)[_0xc704('0x1e')](_0xbf0de1);}};}function respondWithFilteredResult(_0x5f4ee1,_0x51fbcf){return function(_0x582bcb){if(_0x582bcb){var _0x4bdeaf=_0x582bcb['count'],_0x16e675=_0x51fbcf[_0xc704('0x1f')],_0x3781e0=_0x51fbcf[_0xc704('0x1f')]+_0x51fbcf[_0xc704('0x20')],_0x3965bb;if(_0x3781e0>=_0x4bdeaf){_0x3781e0=_0x4bdeaf;_0x3965bb=0xc8;}else{_0x3965bb=0xce;}_0x5f4ee1['status'](_0x3965bb);return _0x5f4ee1[_0xc704('0x21')](_0xc704('0x22'),_0x16e675+'-'+_0x3781e0+'/'+_0x4bdeaf)['json'](_0x582bcb);}return null;};}function patchUpdates(_0x20d0a7){return function(_0x199d4c){try{jsonpatch[_0xc704('0x23')](_0x199d4c,_0x20d0a7,!![]);}catch(_0x3008b8){return BPromise[_0xc704('0x24')](_0x3008b8);}return _0x199d4c[_0xc704('0x25')]();};}function saveUpdates(_0x42c5ca,_0x28e38f){return function(_0x1575c0){if(_0x1575c0){return _0x1575c0[_0xc704('0x26')](_0x42c5ca)[_0xc704('0x27')](function(_0x961339){return _0x961339;});}return null;};}function removeEntity(_0x562e47,_0x2f9c77){return function(_0x41f6cf){if(_0x41f6cf){return _0x41f6cf['destroy']()[_0xc704('0x27')](function(){_0x562e47[_0xc704('0x1c')](0xcc)[_0xc704('0x1d')]();});}};}function handleEntityNotFound(_0x4d21d9,_0x2b6c21){return function(_0x2f7ed2){if(!_0x2f7ed2){_0x4d21d9[_0xc704('0x1b')](0x194);}return _0x2f7ed2;};}function handleError(_0x29b8ca,_0x52171f){_0x52171f=_0x52171f||0x1f4;return function(_0x4d0b4d){logger[_0xc704('0x28')](_0x4d0b4d[_0xc704('0x29')]);if(_0x4d0b4d[_0xc704('0x2a')]){delete _0x4d0b4d[_0xc704('0x2a')];}_0x29b8ca[_0xc704('0x1c')](_0x52171f)[_0xc704('0x2b')](_0x4d0b4d);};}function getInteractionUsers(_0x23952c,_0x16bb27){return new BPromise(function(_0x4829bc,_0x25c197){try{if(_0x16bb27[_0x23952c['id']]){_0x23952c[_0xc704('0x2c')]=_[_0xc704('0x2d')](_0x16bb27[_0x23952c['id']],function(_0x2b857b){return{'id':_0x2b857b['id'],'fullname':_0x2b857b[_0xc704('0x2e')]};});}}catch(_0xe6cd06){_0x25c197(_0xe6cd06);}_0x4829bc(_0x23952c);});}function getInteractionTags(_0x2d7c51,_0x5a091b){return new BPromise(function(_0x8bff3f,_0x4f8c6e){try{if(_0x2d7c51['TagIds']){_0x2d7c51[_0xc704('0x2f')]=[];_0x2d7c51['TagIds'][_0xc704('0x30')](',')[_0xc704('0x31')](function(_0x27d8ed){_0x2d7c51[_0xc704('0x2f')]['push'](_0x5a091b[_0x27d8ed]);});}delete _0x2d7c51['TagIds'];}catch(_0xc63f95){_0x4f8c6e(_0xc63f95);}_0x8bff3f(_0x2d7c51);});}function updateOpenchannelInteraction(_0x1d0dc8,_0x5644b6,_0x463e68){return new BPromise(function(_0x3dc113,_0x3b94b3){return getInteractionUsers(_0x1d0dc8,_0x463e68)[_0xc704('0x27')](function(_0x2b4835){return getInteractionTags(_0x2b4835,_0x5644b6);})[_0xc704('0x27')](function(_0x437345){_0x3dc113(_0x437345);})['catch'](function(_0x197140){_0x3b94b3(_0x197140);});});}exports['index']=function(_0x18af47,_0x463885){var _0x51aa49={},_0x1f4c7c={},_0x55a74f={'count':0x0,'rows':[]};var _0x231603=_[_0xc704('0x2d')](db[_0xc704('0x32')][_0xc704('0x33')],function(_0x3fe0e4){return{'name':_0x3fe0e4[_0xc704('0x34')],'type':_0x3fe0e4[_0xc704('0x35')][_0xc704('0x36')]};});_0x1f4c7c[_0xc704('0x37')]=_['map'](_0x231603,_0xc704('0x2a'));_0x1f4c7c['query']=_[_0xc704('0x38')](_0x18af47[_0xc704('0x39')]);_0x1f4c7c['filters']=_[_0xc704('0x3a')](_0x1f4c7c[_0xc704('0x37')],_0x1f4c7c[_0xc704('0x39')]);_0x51aa49['attributes']=_[_0xc704('0x3a')](_0x1f4c7c[_0xc704('0x37')],qs['fields'](_0x18af47['query'][_0xc704('0x3b')]));_0x51aa49[_0xc704('0x3c')]=_0x51aa49[_0xc704('0x3c')][_0xc704('0x3d')]?_0x51aa49[_0xc704('0x3c')]:_0x1f4c7c[_0xc704('0x37')];if(!_0x18af47[_0xc704('0x39')][_0xc704('0x3e')](_0xc704('0x3f'))){_0x51aa49[_0xc704('0x20')]=qs[_0xc704('0x20')](_0x18af47[_0xc704('0x39')][_0xc704('0x20')]);_0x51aa49['offset']=qs[_0xc704('0x1f')](_0x18af47['query'][_0xc704('0x1f')]);}_0x51aa49[_0xc704('0x40')]=qs[_0xc704('0x41')](_0x18af47[_0xc704('0x39')][_0xc704('0x41')]);_0x51aa49[_0xc704('0x42')]=qs[_0xc704('0x43')](_[_0xc704('0x44')](_0x18af47['query'],_0x1f4c7c[_0xc704('0x43')]),_0x231603);var _0x2caa2b=[];var _0x5553b2=squel[_0xc704('0x45')]()[_0xc704('0x46')]('id')['field'](_0xc704('0x2a'))[_0xc704('0x46')]('color')[_0xc704('0x47')](_0xc704('0x48'));var _0x5c5db7=squel[_0xc704('0x45')]()['field']('u.id')[_0xc704('0x46')](_0xc704('0x49'))[_0xc704('0x46')](_0xc704('0x4a'))[_0xc704('0x47')](_0xc704('0x4b'),'ui')[_0xc704('0x4c')](_0xc704('0x4d'),'u',_0xc704('0x4e'));var _0x1845a2=squel[_0xc704('0x45')]()[_0xc704('0x47')](_0xc704('0x4f'),'i')[_0xc704('0x4c')](_0xc704('0x50'),'c',_0xc704('0x51'))[_0xc704('0x4c')](_0xc704('0x4d'),'o',_0xc704('0x52'))['left_join'](_0xc704('0x53'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0xc704('0x54'),'me',_0xc704('0x55'))[_0xc704('0x4c')](_0xc704('0x56'),'it',_0xc704('0x57'))[_0xc704('0x4c')](_0xc704('0x48'),'t',_0xc704('0x58'));var _0x1e7284=squel[_0xc704('0x59')]();var _0x32ed11=[];var _0x3aff6f=squel['expr']();var _0x5d584d;if(_0x18af47[_0xc704('0x39')][_0xc704('0x5a')]){_0x5d584d=as['parseSearch'](_0x18af47[_0xc704('0x39')][_0xc704('0x5a')]);var _0xd042c0=_0x5d584d[_0xc704('0x5b')];for(var _0x578c25=0x0;_0x578c25<_0x5d584d[_0xc704('0x5c')]['length'];_0x578c25++){var _0xf95d07=_0x5d584d[_0xc704('0x5c')][_0x578c25];var _0x127a8a='i';var _0x23bb85=_['find'](_0x231603,[_0xc704('0x2a'),_0xf95d07['field']]);if(!_0x23bb85){switch(_0xf95d07['field']){case _0xc704('0x5d'):if(_0xf95d07[_0xc704('0x5e')]==0x1){_0x1845a2['having']('`'+_0xf95d07[_0xc704('0x46')]+'`\x20=\x200');}else{_0x1845a2[_0xc704('0x5f')]('`'+_0xf95d07[_0xc704('0x46')]+_0xc704('0x60'));}break;case _0xc704('0x61'):if(_0xf95d07[_0xc704('0x62')]==='$substring'){if(_0xf95d07['value'][_0xc704('0x30')]('\x20')[_0xc704('0x3d')]>0x1){_0x1e7284[_0xd042c0](_0xc704('0x63'),qs[_0xc704('0x64')](_0xf95d07[_0xc704('0x5e')]),null);}else{var _0xa1af3a='%'+_0xf95d07[_0xc704('0x5e')]+'%';_0x1e7284[_0xd042c0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xa1af3a,_0xa1af3a,_0xa1af3a);}}else{_0x23bb85=_[_0xc704('0x65')](_0x231603,[_0xc704('0x2a'),_0xc704('0x66')]);_0xf95d07[_0xc704('0x46')]=_0xc704('0x66');_0x5ca3bf=as[_0xc704('0x67')](_0x127a8a,_0x23bb85[_0xc704('0x35')],_0xf95d07);_0x1e7284[_0xd042c0](_0x5ca3bf['text'],_0x5ca3bf['value'][_0xc704('0x68')],_0x5ca3bf[_0xc704('0x5e')]['end']);}break;case'Tag':var _0x1835c1=_0xf95d07['value'][_0xc704('0x30')](',')[_0xc704('0x2d')](function(_0x2e0230){return Number(_0x2e0230);});_0x1835c1[_0xc704('0x31')](function(_0x45924b){_0x3aff6f['or'](_0xc704('0x69'),'%,'+_0x45924b+',%');});_0x32ed11=_[_0xc704('0x6a')](_0x32ed11,_0x1835c1);break;case _0xc704('0x6b'):if(_0xf95d07[_0xc704('0x62')]===_0xc704('0x6c')){_0x1e7284[_0xd042c0](_0xc704('0x6d'),'%'+_0xf95d07[_0xc704('0x5e')]+'%',null);}else{_0x23bb85=_[_0xc704('0x65')](_0x231603,[_0xc704('0x2a'),_0xc704('0x6e')]);_0xf95d07[_0xc704('0x46')]=_0xc704('0x6e');_0x5ca3bf=as[_0xc704('0x67')](_0x127a8a,_0x23bb85[_0xc704('0x35')],_0xf95d07);_0x1e7284[_0xd042c0](_0x5ca3bf[_0xc704('0x6f')],_0x5ca3bf[_0xc704('0x5e')][_0xc704('0x68')],_0x5ca3bf[_0xc704('0x5e')][_0xc704('0x1d')]);}break;case'body':_0x5ca3bf=as[_0xc704('0x67')]('me',null,_0xf95d07);_0x1e7284[_0xd042c0](_0x5ca3bf[_0xc704('0x6f')],_0x5ca3bf[_0xc704('0x5e')][_0xc704('0x68')],_0x5ca3bf[_0xc704('0x5e')][_0xc704('0x1d')]);break;}}else{var _0x5ca3bf=as['buildExpression'](_0x127a8a,_0x23bb85['type'],_0xf95d07);_0x1e7284[_0xd042c0](_0x5ca3bf[_0xc704('0x6f')],_0x5ca3bf['value'][_0xc704('0x68')],_0x5ca3bf[_0xc704('0x5e')][_0xc704('0x1d')]);}}}else{var _0x130c98=_(_0x18af47[_0xc704('0x39')])[_0xc704('0x38')]()[_0xc704('0x2d')](function(_0x4e33d6){return _[_0xc704('0x70')](_0x231603,[_0xc704('0x2a'),_0x4e33d6])?_0x4e33d6:undefined;})['compact']()['value']();if(!_[_0xc704('0x71')](_0x130c98)){_0x130c98[_0xc704('0x31')](function(_0x1fac96){if(_0x1fac96===_0xc704('0x72')){_0x1845a2['where'](_0xc704('0x73'),[][_0xc704('0x74')](_0x18af47[_0xc704('0x39')][_0x1fac96]));}else if(_0x1fac96===_0xc704('0x75')){var _0x1cd95d=JSON[_0xc704('0x76')](_0x18af47[_0xc704('0x39')][_0x1fac96])[_0xc704('0x77')];var _0x4aa81c=JSON[_0xc704('0x76')](_0x18af47[_0xc704('0x39')][_0x1fac96])[_0xc704('0x78')];_0x1845a2['where'](_0xc704('0x79'),_0x1cd95d,_0x4aa81c);}else{if(_0x18af47['query'][_0x1fac96]===_0xc704('0x7a')){_0x1845a2[_0xc704('0x42')]('i.'+_0x1fac96+_0xc704('0x7b'));}else{_0x1845a2[_0xc704('0x42')]('i.'+_0x1fac96+'\x20=\x20?',_0x18af47[_0xc704('0x39')][_0x1fac96]);}}});}if(_0x18af47[_0xc704('0x39')]['read']){if(_0x18af47[_0xc704('0x39')][_0xc704('0x7c')]==0x1){_0x1845a2[_0xc704('0x5f')](_0xc704('0x7d'));}else{_0x1845a2[_0xc704('0x5f')](_0xc704('0x7e'));}}if(_0x18af47['query'][_0xc704('0x7f')]){_0x32ed11=_[_0xc704('0x80')](_0x18af47['query'][_0xc704('0x7f')])?_0x18af47[_0xc704('0x39')][_0xc704('0x7f')]:new Array(_0x18af47[_0xc704('0x39')][_0xc704('0x7f')]);_0x32ed11[_0xc704('0x31')](function(_0x13e055){_0x3aff6f['or'](_0xc704('0x69'),'%,'+_0x13e055+',%');});}if(_0x18af47[_0xc704('0x39')][_0xc704('0x81')]){var _0x478da0=_0x18af47[_0xc704('0x39')][_0xc704('0x81')][_0xc704('0x82')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0xc704('0x83')](_0x478da0)){_0x1e7284['or'](_0xc704('0x84'),_0x478da0+'%');}else{_0x1e7284['or'](_0xc704('0x85'),qs['getFullTextValue'](_0x478da0))['or'](_0xc704('0x86'),_0x478da0+'%')['or'](_0xc704('0x87'),_0x478da0+'%');}}}_0x1845a2[_0xc704('0x42')](_0x1e7284);_0x1845a2[_0xc704('0x88')](_0xc704('0x89'));var _0x53f10e={'type':db[_0xc704('0x8a')][_0xc704('0x8b')]['SELECT'],'raw':!![]};var _0x4d7824=_0x1845a2[_0xc704('0x8c')]();_0x4d7824[_0xc704('0x46')]('i.id');_0x4d7824[_0xc704('0x46')](_0xc704('0x8d'),_0xc704('0x5d'));if(_0x51aa49[_0xc704('0x40')]){_0x51aa49[_0xc704('0x40')][_0xc704('0x31')](function(_0x1e62bf){_0x1845a2[_0xc704('0x40')]('i.'+_0x1e62bf[0x0],_0x1e62bf[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc704('0x71')](_0x32ed11)){_0x1845a2['having'](_0x3aff6f);_0x4d7824['where'](_0xc704('0x8e'),_0x32ed11);}BPromise['resolve']()[_0xc704('0x27')](function(){if(!_0x5d584d){if(_0x18af47['query'][_0xc704('0x72')]||_0x18af47[_0xc704('0x39')][_0xc704('0x8f')])return;_0x4d7824[_0xc704('0x42')](_0xc704('0x90'));_0x1845a2[_0xc704('0x42')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x18af47[_0xc704('0x91')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xc704('0x27')](function(_0x2dc14b){if(_['isEmpty'](_0x2dc14b)){_0x4d7824[_0xc704('0x42')](_0xc704('0x92'));_0x1845a2[_0xc704('0x42')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4d7824[_0xc704('0x42')](_0xc704('0x73'),_['map'](_0x2dc14b,'id'));_0x1845a2[_0xc704('0x42')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x2dc14b,'id'));}});})['then'](function(){db['sequelize'][_0xc704('0x39')](_0x4d7824[_0xc704('0x93')](),_0x53f10e)[_0xc704('0x27')](function(_0x3174bf){_0x55a74f[_0xc704('0x94')]=_0x3174bf['length'];if(_0x55a74f[_0xc704('0x94')]===0x0)return[];return db[_0xc704('0x95')]['query'](_0x5553b2[_0xc704('0x93')](),_0x53f10e)['then'](function(_0x312f8c){_0x2caa2b=_[_0xc704('0x96')](_0x312f8c,'id');_0x53f10e=_[_0xc704('0x97')](_0x53f10e,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18af47[_0xc704('0x39')][_0xc704('0x3b')]){_0x51aa49[_0xc704('0x3c')][_0xc704('0x31')](function(_0x4abc36){_0x1845a2[_0xc704('0x46')]('i.'+_0x4abc36);});}else{_0x1845a2['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc704('0x5d'));_0x1845a2[_0xc704('0x46')]('a.key',_0xc704('0x98'));_0x1845a2['field']('a.mandatoryDisposition',_0xc704('0x99'));_0x1845a2['field'](_0xc704('0x9a'));_0x1845a2[_0xc704('0x46')]('c.firstName',_0xc704('0x9b'));_0x1845a2[_0xc704('0x46')](_0xc704('0x9c'),_0xc704('0x9d'));_0x1845a2['field'](_0xc704('0x9e'),_0xc704('0x9f'));_0x1845a2[_0xc704('0x46')](_0xc704('0xa0'),_0xc704('0xa1'));_0x1845a2[_0xc704('0x46')](_0xc704('0xa2'),_0xc704('0xa3'));_0x1845a2[_0xc704('0x46')]('c.fax','Contact.fax');_0x1845a2[_0xc704('0x46')](_0xc704('0xa4'),_0xc704('0xa5'));_0x1845a2[_0xc704('0x46')](_0xc704('0xa6'),_0xc704('0xa7'));_0x1845a2[_0xc704('0x46')](_0xc704('0xa8'),'TagIds');}if(_0x51aa49[_0xc704('0x20')])_0x1845a2[_0xc704('0x20')](_0x51aa49[_0xc704('0x20')]);if(_0x51aa49[_0xc704('0x1f')])_0x1845a2[_0xc704('0x1f')](_0x51aa49[_0xc704('0x1f')]);return db[_0xc704('0x95')]['query'](_0x1845a2['toString'](),_0x53f10e);})['then'](function(_0x55be10){_0x5c5db7[_0xc704('0x42')](_0xc704('0xa9'),_[_0xc704('0x2d')](_0x55be10,'id'));return db[_0xc704('0x95')]['query'](_0x5c5db7[_0xc704('0x93')](),_0x53f10e)['then'](function(_0x2146f7){var _0x5bd302=_[_0xc704('0xaa')](_0x2146f7,_0xc704('0xab'));var _0x47de21=[];_0x55be10[_0xc704('0x31')](function(_0x9af07a){_0x47de21[_0xc704('0xac')](updateOpenchannelInteraction(_0x9af07a,_0x2caa2b,_0x5bd302));});return BPromise[_0xc704('0xad')](_0x47de21);});});})[_0xc704('0x27')](function(_0x5639da){_0x55a74f[_0xc704('0xae')]=_0x5639da;return _0x55a74f;})[_0xc704('0x27')](respondWithFilteredResult(_0x463885,_0x51aa49));})[_0xc704('0xaf')](handleError(_0x463885,null));};exports['show']=function(_0x35d6d7,_0x517cfa){var _0x3d8d1e={'raw':![],'where':{'id':_0x35d6d7[_0xc704('0xb0')]['id']}},_0x4b33ab={};_0x4b33ab[_0xc704('0x37')]=_[_0xc704('0x38')](db[_0xc704('0x32')][_0xc704('0x33')]);_0x4b33ab[_0xc704('0x39')]=_[_0xc704('0x38')](_0x35d6d7[_0xc704('0x39')]);_0x4b33ab[_0xc704('0x43')]=_[_0xc704('0x3a')](_0x4b33ab[_0xc704('0x37')],_0x4b33ab['query']);_0x3d8d1e[_0xc704('0x3c')]=_[_0xc704('0x3a')](_0x4b33ab[_0xc704('0x37')],qs[_0xc704('0x3b')](_0x35d6d7[_0xc704('0x39')]['fields']));_0x3d8d1e[_0xc704('0x3c')]=_0x3d8d1e[_0xc704('0x3c')][_0xc704('0x3d')]?_0x3d8d1e['attributes']:_0x4b33ab[_0xc704('0x37')];if(_0x35d6d7[_0xc704('0x39')][_0xc704('0xb1')]){_0x3d8d1e['include']=[{'all':!![]}];}_0x3d8d1e=_[_0xc704('0x97')]({},_0x3d8d1e,_0x35d6d7['options']);return db[_0xc704('0x32')][_0xc704('0x65')](_0x3d8d1e)['then'](handleEntityNotFound(_0x517cfa,null))[_0xc704('0x27')](respondWithResult(_0x517cfa,null))['catch'](handleError(_0x517cfa,null));};exports[_0xc704('0xb2')]=function(_0x35edc3,_0x390ae3){return db[_0xc704('0x32')][_0xc704('0xb2')](_0x35edc3[_0xc704('0xb3')],{})['then'](respondWithResult(_0x390ae3,0xc9))['catch'](handleError(_0x390ae3,null));};exports['update']=function(_0x52627d,_0x1e6bff){if(_0x52627d['body']['id']){delete _0x52627d[_0xc704('0xb3')]['id'];}return db[_0xc704('0x32')]['find']({'where':{'id':_0x52627d[_0xc704('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1e6bff,null))[_0xc704('0x27')](saveUpdates(_0x52627d['body'],null))[_0xc704('0x27')](respondWithResult(_0x1e6bff,null))['catch'](handleError(_0x1e6bff,null));};exports[_0xc704('0xb4')]=function(_0x530270,_0x34e096){return db[_0xc704('0x32')]['find']({'where':{'id':_0x530270['params']['id']}})[_0xc704('0x27')](handleEntityNotFound(_0x34e096,null))[_0xc704('0x27')](removeEntity(_0x34e096,null))['catch'](handleError(_0x34e096,null));};exports['describe']=function(_0x4f51e5,_0x33723a){return db[_0xc704('0x32')]['describe']()[_0xc704('0x27')](respondWithResult(_0x33723a,null))[_0xc704('0xaf')](handleError(_0x33723a,null));};exports[_0xc704('0xb5')]=function(_0x3041c1,_0x493b95,_0x278600){return db[_0xc704('0xb6')][_0xc704('0x65')]({'where':{'id':_0x3041c1[_0xc704('0xb0')]['id']}})['then'](handleEntityNotFound(_0x493b95,null))[_0xc704('0x27')](function(_0x3ed71a){if(_0x3ed71a){return _0x3ed71a['addMessage'](_0x3041c1[_0xc704('0xb3')][_0xc704('0xb7')],_[_0xc704('0xb8')](_0x3041c1[_0xc704('0xb3')],['ids','id'])||{});}})[_0xc704('0x27')](respondWithResult(_0x493b95,null))[_0xc704('0xaf')](handleError(_0x493b95,null));};exports[_0xc704('0xb9')]=function(_0x25ea20,_0x19205c,_0x39b508){var _0x12ee0e={'raw':![],'where':{}};var _0x1de01f={};var _0x13b597={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xc704('0xba')]({'where':{'id':_0x25ea20['params']['id']}})[_0xc704('0x27')](handleEntityNotFound(_0x19205c,null))['then'](function(_0x36b945){if(_0x36b945){_0x1de01f['model']=_[_0xc704('0x38')](db['OpenchannelMessage'][_0xc704('0x33')]);_0x1de01f[_0xc704('0x39')]=_[_0xc704('0x38')](_0x25ea20[_0xc704('0x39')]);_0x1de01f[_0xc704('0x43')]=_[_0xc704('0x3a')](_0x1de01f[_0xc704('0x37')],_0x1de01f[_0xc704('0x39')]);_0x12ee0e[_0xc704('0x3c')]=_[_0xc704('0x3a')](_0x1de01f[_0xc704('0x37')],qs[_0xc704('0x3b')](_0x25ea20[_0xc704('0x39')][_0xc704('0x3b')]));_0x12ee0e[_0xc704('0x3c')]=_0x12ee0e['attributes'][_0xc704('0x3d')]?_0x12ee0e['attributes']:_0x1de01f['model'];if(!_0x25ea20['query'][_0xc704('0x3e')](_0xc704('0x3f'))){_0x12ee0e[_0xc704('0x20')]=qs[_0xc704('0x20')](_0x25ea20['query']['limit']);_0x12ee0e[_0xc704('0x1f')]=qs[_0xc704('0x1f')](_0x25ea20['query'][_0xc704('0x1f')]);}_0x12ee0e['order']=qs[_0xc704('0x41')](_0x25ea20['query'][_0xc704('0x41')]);_0x12ee0e['where']=qs[_0xc704('0x43')](_[_0xc704('0x44')](_0x25ea20['query'],_0x1de01f[_0xc704('0x43')]));_0x12ee0e['where'][_0xc704('0xab')]=_0x36b945['id'];if(_0x25ea20[_0xc704('0x39')]['filter']){_0x12ee0e['where']=_[_0xc704('0x97')](_0x12ee0e['where'],{'$or':_[_0xc704('0x2d')](_0x12ee0e['attributes'],function(_0x325f44){var _0x4f3692={};_0x4f3692[_0x325f44]={'$like':'%'+_0x25ea20[_0xc704('0x39')]['filter']+'%'};return _0x4f3692;})});}if(_0x25ea20['query'][_0xc704('0x77')]){var _0x3a75e1=_0x25ea20[_0xc704('0x39')][_0xc704('0x77')]['split'](',');var _0x1778db={};_0x1778db[_0x3a75e1[0x0]]={'$gte':moment(_0x3a75e1[0x1])['format'](_0xc704('0xbb'))};_0x12ee0e[_0xc704('0x42')]=_[_0xc704('0x97')](_0x12ee0e[_0xc704('0x42')],_0x1778db);}_0x12ee0e=_['merge']({},_0x12ee0e,_0x25ea20[_0xc704('0xbc')]);return db['OpenchannelMessage'][_0xc704('0x94')]({'where':_0x12ee0e[_0xc704('0x42')]})['then'](function(_0x14989f){_0x13b597[_0xc704('0x94')]=_0x14989f;if(_0x25ea20[_0xc704('0x39')][_0xc704('0xb1')]){_0x12ee0e[_0xc704('0xbd')]=[{'all':!![]}];}return db[_0xc704('0xb6')][_0xc704('0xbe')](_0x12ee0e);})[_0xc704('0x27')](function(_0x2414e2){_0x13b597[_0xc704('0xae')]=_0x2414e2;return _0x13b597;});}})['then'](respondWithFilteredResult(_0x19205c,_0x12ee0e))[_0xc704('0xaf')](handleError(_0x19205c,null));};exports['addTags']=function(_0x200d24,_0x13de1f,_0x4d07b2){return db[_0xc704('0x32')][_0xc704('0x65')]({'where':{'id':_0x200d24[_0xc704('0xb0')]['id']}})[_0xc704('0x27')](handleEntityNotFound(_0x13de1f,null))[_0xc704('0x27')](function(_0x5a280d){if(_0x5a280d){return _0x5a280d['setTags'](_0x200d24[_0xc704('0xb3')][_0xc704('0xb7')],_['omit'](_0x200d24[_0xc704('0xb3')],[_0xc704('0xb7'),'id'])||{})[_0xc704('0xbf')](function(){return db['Tag'][_0xc704('0xbe')]({'attributes':['id',_0xc704('0x2a'),_0xc704('0xc0')],'where':{'id':_0x200d24[_0xc704('0xb3')][_0xc704('0xb7')]}});})[_0xc704('0x27')](function(_0x2be78d){socket[_0xc704('0xc1')](_0xc704('0xc2'),{'id':Number(_0x200d24[_0xc704('0xb0')]['id']),'tags':_0x2be78d||[]});return{'id':Number(_0x200d24[_0xc704('0xb0')]['id']),'tags':_0x2be78d||[]};});}})['then'](respondWithResult(_0x13de1f,null))['catch'](handleError(_0x13de1f,null));};exports[_0xc704('0xc3')]=function(_0xfffcf8,_0x214b1b,_0x38ce34){return db[_0xc704('0x32')][_0xc704('0x65')]({'where':{'id':_0xfffcf8[_0xc704('0xb0')]['id']}})[_0xc704('0x27')](handleEntityNotFound(_0x214b1b,null))[_0xc704('0x27')](function(_0x14471b){if(_0x14471b){return _0x14471b[_0xc704('0xc3')](_0xfffcf8['query']['ids']);}})[_0xc704('0x27')](respondWithStatusCode(_0x214b1b,null))[_0xc704('0xaf')](handleError(_0x214b1b,null));};exports[_0xc704('0xc4')]=function(_0x10134e,_0x16cdc1){var _0xa219e0=moment()[_0xc704('0xc5')]()['toString']();var _0x2d2826=path['join'](config[_0xc704('0xc6')],_0xc704('0xc7'),'files',_0xc704('0xc8'));var _0x51c823=path['join'](config[_0xc704('0xc6')],'server','files',_0xc704('0xc9'));var _0x321b99=path[_0xc704('0xca')](_0x2d2826,_0xa219e0);var _0x567d83=util['format'](_0xc704('0xcb'),_0x10134e[_0xc704('0xb0')]['id'],_0xa219e0);var _0xfbba99=path['join'](_0x2d2826,_0x567d83);var _0xeda700=[];_0xeda700[_0xc704('0xac')]({'model':db[_0xc704('0x6b')],'as':_0xc704('0x6b'),'attributes':['id',_0xc704('0x2e')],'raw':!![]});_0xeda700['push']({'model':db['CmContact'],'as':_0xc704('0x61'),'attributes':['id',_0xc704('0xcc'),_0xc704('0xcd')],'raw':!![]});if(_0x10134e['query'][_0xc704('0xc9')]){_0xeda700[_0xc704('0xac')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3cefbd=[{'model':db[_0xc704('0xb6')],'as':'Messages','attributes':['id',_0xc704('0xb3'),_0xc704('0x75'),'direction',_0xc704('0xce'),_0xc704('0x7c')],'include':_0xeda700}];_0x3cefbd['push']({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xc704('0x2a')]});_0x3cefbd['push']({'model':db['User'],'as':'Owner','attributes':['id',_0xc704('0x2e')]});return db['OpenchannelInteraction'][_0xc704('0x65')]({'where':{'id':_0x10134e['params']['id']},'include':_0x3cefbd})[_0xc704('0x27')](handleEntityNotFound(_0x16cdc1,null))[_0xc704('0x27')](function(_0x37f44a){if(_0x37f44a){var _0x728c1e=_0x37f44a[_0xc704('0xcf')]({'plain':!![]});fs[_0xc704('0xd0')](_0x321b99);var _0x2a1e91={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0xc704('0xd1')}},'footer':{'height':_0xc704('0xd2'),'contents':{'default':util['format'](_0xc704('0xd3'),util[_0xc704('0xd4')]('%s\x20#%d','Openchannel',_0x728c1e['id']),moment()[_0xc704('0xd4')](_0xc704('0xd5'))[_0xc704('0x93')]())}}};var _0x46855e={'channel':'Openchannel','account':_0x728c1e['Account'][_0xc704('0x2a')],'agent':_0x728c1e['Owner']?_0x728c1e['Owner'][_0xc704('0x2e')]:_0xc704('0xd6'),'createdAt':moment(_0x728c1e[_0xc704('0x75')])['format'](_0xc704('0xbb'))[_0xc704('0x93')](),'closedAt':_0x728c1e[_0xc704('0xd7')]?moment(_0x728c1e[_0xc704('0xd8')])[_0xc704('0xd4')](_0xc704('0xbb'))[_0xc704('0x93')]():'','disposition':_0x728c1e[_0xc704('0xd9')],'visibility':_0x728c1e[_0xc704('0xda')]?_0xc704('0xdb'):_0xc704('0xdc'),'messages':_(_0x728c1e[_0xc704('0xdd')])['filter']({'secret':![]})['map'](function(_0x169a64){if(_0x169a64['Attachment']){var _0x2193a5=path[_0xc704('0xca')](_0x51c823,_0x169a64[_0xc704('0xde')][_0xc704('0xdf')]);if(fs[_0xc704('0xe0')](_0x2193a5)){fs[_0xc704('0xe1')](_0x2193a5)[_0xc704('0xe2')](fs[_0xc704('0xe3')](path['join'](_0x321b99,_0x169a64[_0xc704('0xde')][_0xc704('0xdf')])));}}return{'date':moment(_0x169a64[_0xc704('0x75')])[_0xc704('0xd4')](_0xc704('0xbb'))[_0xc704('0x93')](),'sender':_0x169a64['direction']===_0xc704('0xe4')?_0x169a64['User']?_0x169a64[_0xc704('0x6b')][_0xc704('0x2e')]:_0xc704('0xe5'):_0x169a64['Contact']['firstName']+(_0x169a64[_0xc704('0x61')][_0xc704('0xcd')]?'\x20'+_0x169a64[_0xc704('0x61')][_0xc704('0xcd')]:''),'body':_0x169a64[_0xc704('0xde')]?_0x169a64[_0xc704('0xde')][_0xc704('0xdf')]:_0x169a64[_0xc704('0xb3')],'direction':_0x169a64[_0xc704('0xe6')]===_0xc704('0xe4')?'A':'C','secret':_0x169a64[_0xc704('0xce')],'read':_0x169a64['read'],'attachment':_0x169a64[_0xc704('0xde')]};})[_0xc704('0x5e')]()};return ejs[_0xc704('0xe7')](path[_0xc704('0xca')](config[_0xc704('0xc6')],_0xc704('0xc7'),_0xc704('0xe8'),_0xc704('0xe9')),{'interaction':_0x46855e})[_0xc704('0x27')](function(_0x4dd4d6){return new BPromise(function(_0x89155c,_0x25251c){pdf[_0xc704('0xb2')](_0x4dd4d6,_0x2a1e91)[_0xc704('0xea')](path[_0xc704('0xca')](_0x321b99,'transcript-'+_0x728c1e['id']+'-'+_0xa219e0+_0xc704('0xeb')),function(_0xf7300d,_0x186a88){if(_0xf7300d)return _0x25251c(_0xf7300d);_0x89155c(_0x186a88);});});})[_0xc704('0x27')](function(){return new BPromise(function(_0x580713,_0x4174fc){zipdir(_0x321b99,{'saveTo':_0xfbba99},function(_0x2c7879,_0xbaf58a){if(_0x2c7879)return _0x4174fc(_0x2c7879);return _0x580713(_0xbaf58a);});})[_0xc704('0x27')](function(){return new BPromise(function(_0x32af23,_0x290a0e){rimraf(_0x321b99,function(_0x4e9910){if(_0x4e9910)_0x290a0e(_0x4e9910);return _0x32af23();});});})[_0xc704('0x27')](function(){return _0x16cdc1[_0xc704('0xc4')](_0xfbba99,_0x567d83,function(_0x2714fc){if(_0x2714fc){console[_0xc704('0xec')](_0xc704('0xed'),_0x2714fc);}else{fs[_0xc704('0xee')](_0xfbba99);}});});});}else{return _0x16cdc1[_0xc704('0x1b')](0xc8);}})[_0xc704('0xaf')](handleError(_0x16cdc1,null));}; \ No newline at end of file +var _0xc8bf=['search','parseSearch','length','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','rawAttributes','hasOwnProperty','$gte','format','setTags','spread','Tag','findAll','color','removeTags','download','unix','server','files','tmp','join','root','attachments','transcript-%d-%s.zip','fullname','CmContact','lastName','Attachment','direction','secret','Account','Owner','get','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
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','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\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\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%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\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\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{{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\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\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%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\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','%s\x20#%d','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','views','downloadInteraction.html','toFile','.pdf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','count','offset','limit','json','apply','reject','save','update','destroy','error','stack','name','send','Users','map','TagIds','forEach','Tags','push','then','catch','index','OpenchannelInteraction','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','openchannel_interactions','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr'];(function(_0x3153d8,_0x2586e6){var _0x20cd53=function(_0xc4bb1d){while(--_0xc4bb1d){_0x3153d8['push'](_0x3153d8['shift']());}};_0x20cd53(++_0x2586e6);}(_0xc8bf,0x181));var _0xfc8b=function(_0x1cb690,_0x57f491){_0x1cb690=_0x1cb690-0x0;var _0x221e97=_0xc8bf[_0x1cb690];return _0x221e97;};'use strict';var pdf=require(_0xfc8b('0x0'));var emlformat=require(_0xfc8b('0x1'));var rimraf=require(_0xfc8b('0x2'));var zipdir=require(_0xfc8b('0x3'));var jsonpatch=require(_0xfc8b('0x4'));var rp=require(_0xfc8b('0x5'));var moment=require(_0xfc8b('0x6'));var BPromise=require(_0xfc8b('0x7'));var Mustache=require('mustache');var util=require(_0xfc8b('0x8'));var path=require(_0xfc8b('0x9'));var sox=require(_0xfc8b('0xa'));var csv=require(_0xfc8b('0xb'));var ejs=require(_0xfc8b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfc8b('0xd'));var crypto=require('crypto');var jsforce=require(_0xfc8b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfc8b('0xb'));var querystring=require('querystring');var Papa=require(_0xfc8b('0xf'));var Redis=require(_0xfc8b('0x10'));var authService=require(_0xfc8b('0x11'));var qs=require(_0xfc8b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc8b('0x13'));var logger=require('../../config/logger')(_0xfc8b('0x14'));var utils=require(_0xfc8b('0x15'));var config=require(_0xfc8b('0x16'));var db=require(_0xfc8b('0x17'))['db'];config[_0xfc8b('0x18')]=_[_0xfc8b('0x19')](config[_0xfc8b('0x18')],{'host':_0xfc8b('0x1a'),'port':0x18eb});var socket=require(_0xfc8b('0x1b'))(new Redis(config['redis']));require(_0xfc8b('0x1c'))[_0xfc8b('0x1d')](socket);function respondWithStatusCode(_0x5c7958,_0x78eb76){_0x78eb76=_0x78eb76||0xcc;return function(_0x4a06fc){if(_0x4a06fc){return _0x5c7958[_0xfc8b('0x1e')](_0x78eb76);}return _0x5c7958[_0xfc8b('0x1f')](_0x78eb76)[_0xfc8b('0x20')]();};}function respondWithResult(_0x1a32a0,_0x4bfee8){_0x4bfee8=_0x4bfee8||0xc8;return function(_0xdc5cd){if(_0xdc5cd){return _0x1a32a0[_0xfc8b('0x1f')](_0x4bfee8)['json'](_0xdc5cd);}};}function respondWithFilteredResult(_0x33a944,_0x3e4bc5){return function(_0x665416){if(_0x665416){var _0x49a80f=_0x665416[_0xfc8b('0x21')],_0x1957df=_0x3e4bc5[_0xfc8b('0x22')],_0x3ef7c5=_0x3e4bc5[_0xfc8b('0x22')]+_0x3e4bc5[_0xfc8b('0x23')],_0x56f1ee;if(_0x3ef7c5>=_0x49a80f){_0x3ef7c5=_0x49a80f;_0x56f1ee=0xc8;}else{_0x56f1ee=0xce;}_0x33a944[_0xfc8b('0x1f')](_0x56f1ee);return _0x33a944['set']('Content-Range',_0x1957df+'-'+_0x3ef7c5+'/'+_0x49a80f)[_0xfc8b('0x24')](_0x665416);}return null;};}function patchUpdates(_0x348b06){return function(_0x3e0998){try{jsonpatch[_0xfc8b('0x25')](_0x3e0998,_0x348b06,!![]);}catch(_0x349999){return BPromise[_0xfc8b('0x26')](_0x349999);}return _0x3e0998[_0xfc8b('0x27')]();};}function saveUpdates(_0x3ad123,_0x50ac51){return function(_0x4a7efe){if(_0x4a7efe){return _0x4a7efe[_0xfc8b('0x28')](_0x3ad123)['then'](function(_0x9ca658){return _0x9ca658;});}return null;};}function removeEntity(_0x416f04,_0x38add3){return function(_0x5cd101){if(_0x5cd101){return _0x5cd101[_0xfc8b('0x29')]()['then'](function(){_0x416f04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b2bf,_0x5345ed){return function(_0x118153){if(!_0x118153){_0x59b2bf[_0xfc8b('0x1e')](0x194);}return _0x118153;};}function handleError(_0x44514c,_0x59c0dd){_0x59c0dd=_0x59c0dd||0x1f4;return function(_0x1cc011){logger[_0xfc8b('0x2a')](_0x1cc011[_0xfc8b('0x2b')]);if(_0x1cc011[_0xfc8b('0x2c')]){delete _0x1cc011['name'];}_0x44514c[_0xfc8b('0x1f')](_0x59c0dd)[_0xfc8b('0x2d')](_0x1cc011);};}function getInteractionUsers(_0x52b3ba,_0x346578){return new BPromise(function(_0x2f468c,_0x5837bb){try{if(_0x346578[_0x52b3ba['id']]){_0x52b3ba[_0xfc8b('0x2e')]=_[_0xfc8b('0x2f')](_0x346578[_0x52b3ba['id']],function(_0x4cf781){return{'id':_0x4cf781['id'],'fullname':_0x4cf781['fullname']};});}}catch(_0xf0d853){_0x5837bb(_0xf0d853);}_0x2f468c(_0x52b3ba);});}function getInteractionTags(_0x5821e0,_0x2912ba){return new BPromise(function(_0x28d045,_0x274f1d){try{if(_0x5821e0[_0xfc8b('0x30')]){_0x5821e0['Tags']=[];_0x5821e0[_0xfc8b('0x30')]['split'](',')[_0xfc8b('0x31')](function(_0xb55a29){_0x5821e0[_0xfc8b('0x32')][_0xfc8b('0x33')](_0x2912ba[_0xb55a29]);});}delete _0x5821e0[_0xfc8b('0x30')];}catch(_0x1cbb09){_0x274f1d(_0x1cbb09);}_0x28d045(_0x5821e0);});}function updateOpenchannelInteraction(_0x4dcd68,_0x51963a,_0x104a0b){return new BPromise(function(_0xc49e28,_0x47ec7d){return getInteractionUsers(_0x4dcd68,_0x104a0b)[_0xfc8b('0x34')](function(_0x5b62cf){return getInteractionTags(_0x5b62cf,_0x51963a);})[_0xfc8b('0x34')](function(_0x591030){_0xc49e28(_0x591030);})[_0xfc8b('0x35')](function(_0x11c972){_0x47ec7d(_0x11c972);});});}exports[_0xfc8b('0x36')]=function(_0x36f3a4,_0x174b9d){var _0x4759d7={},_0x5917dd={},_0x1a1623={'count':0x0,'rows':[]};var _0x5b5661=_[_0xfc8b('0x2f')](db[_0xfc8b('0x37')]['rawAttributes'],function(_0x162d39){return{'name':_0x162d39[_0xfc8b('0x38')],'type':_0x162d39[_0xfc8b('0x39')]['key']};});_0x5917dd['model']=_[_0xfc8b('0x2f')](_0x5b5661,_0xfc8b('0x2c'));_0x5917dd[_0xfc8b('0x3a')]=_['keys'](_0x36f3a4[_0xfc8b('0x3a')]);_0x5917dd[_0xfc8b('0x3b')]=_[_0xfc8b('0x3c')](_0x5917dd[_0xfc8b('0x3d')],_0x5917dd['query']);_0x4759d7[_0xfc8b('0x3e')]=_[_0xfc8b('0x3c')](_0x5917dd[_0xfc8b('0x3d')],qs[_0xfc8b('0x3f')](_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x3f')]));_0x4759d7['attributes']=_0x4759d7[_0xfc8b('0x3e')]['length']?_0x4759d7[_0xfc8b('0x3e')]:_0x5917dd[_0xfc8b('0x3d')];if(!_0x36f3a4[_0xfc8b('0x3a')]['hasOwnProperty'](_0xfc8b('0x40'))){_0x4759d7['limit']=qs[_0xfc8b('0x23')](_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x23')]);_0x4759d7[_0xfc8b('0x22')]=qs[_0xfc8b('0x22')](_0x36f3a4['query']['offset']);}_0x4759d7[_0xfc8b('0x41')]=qs[_0xfc8b('0x42')](_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x42')]);_0x4759d7[_0xfc8b('0x43')]=qs[_0xfc8b('0x3b')](_[_0xfc8b('0x44')](_0x36f3a4['query'],_0x5917dd[_0xfc8b('0x3b')]),_0x5b5661);var _0x5c9d7d=[];var _0x287b2c=squel[_0xfc8b('0x45')]()['field']('id')[_0xfc8b('0x46')](_0xfc8b('0x2c'))['field']('color')[_0xfc8b('0x47')](_0xfc8b('0x48'));var _0x4ce14b=squel['select']()[_0xfc8b('0x46')](_0xfc8b('0x49'))[_0xfc8b('0x46')](_0xfc8b('0x4a'))[_0xfc8b('0x46')](_0xfc8b('0x4b'))[_0xfc8b('0x47')](_0xfc8b('0x4c'),'ui')['left_join'](_0xfc8b('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x412245=squel[_0xfc8b('0x45')]()[_0xfc8b('0x47')](_0xfc8b('0x4e'),'i')[_0xfc8b('0x4f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xfc8b('0x4f')](_0xfc8b('0x4d'),'o',_0xfc8b('0x50'))[_0xfc8b('0x4f')]('openchannel_accounts','a',_0xfc8b('0x51'))['left_join'](_0xfc8b('0x52'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xfc8b('0x4f')](_0xfc8b('0x53'),'it',_0xfc8b('0x54'))[_0xfc8b('0x4f')](_0xfc8b('0x48'),'t',_0xfc8b('0x55'));var _0x310bbd=squel[_0xfc8b('0x56')]();var _0x542466=[];var _0x4aa1fa=squel[_0xfc8b('0x56')]();var _0x188c76;if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x57')]){_0x188c76=as[_0xfc8b('0x58')](_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x57')]);var _0x6290cd=_0x188c76['sqlOperator'];for(var _0x20fc8b=0x0;_0x20fc8b<_0x188c76['conditions'][_0xfc8b('0x59')];_0x20fc8b++){var _0x235ecd=_0x188c76[_0xfc8b('0x5a')][_0x20fc8b];var _0x4acbb7='i';var _0x23c923=_['find'](_0x5b5661,[_0xfc8b('0x2c'),_0x235ecd[_0xfc8b('0x46')]]);if(!_0x23c923){switch(_0x235ecd['field']){case'unreadMessages':if(_0x235ecd[_0xfc8b('0x5b')]==0x1){_0x412245[_0xfc8b('0x5c')]('`'+_0x235ecd['field']+_0xfc8b('0x5d'));}else{_0x412245['having']('`'+_0x235ecd[_0xfc8b('0x46')]+_0xfc8b('0x5e'));}break;case _0xfc8b('0x5f'):if(_0x235ecd['operator']===_0xfc8b('0x60')){if(_0x235ecd['value'][_0xfc8b('0x61')]('\x20')[_0xfc8b('0x59')]>0x1){_0x310bbd[_0x6290cd]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfc8b('0x62')](_0x235ecd[_0xfc8b('0x5b')]),null);}else{var _0x2c5dfc='%'+_0x235ecd['value']+'%';_0x310bbd[_0x6290cd](_0xfc8b('0x63'),_0x2c5dfc,_0x2c5dfc,_0x2c5dfc);}}else{_0x23c923=_[_0xfc8b('0x64')](_0x5b5661,['name',_0xfc8b('0x65')]);_0x235ecd['field']='ContactId';_0x166fa9=as[_0xfc8b('0x66')](_0x4acbb7,_0x23c923['type'],_0x235ecd);_0x310bbd[_0x6290cd](_0x166fa9[_0xfc8b('0x67')],_0x166fa9[_0xfc8b('0x5b')][_0xfc8b('0x68')],_0x166fa9[_0xfc8b('0x5b')][_0xfc8b('0x20')]);}break;case'Tag':var _0x131931=_0x235ecd[_0xfc8b('0x5b')][_0xfc8b('0x61')](',')[_0xfc8b('0x2f')](function(_0x2bdbf2){return Number(_0x2bdbf2);});_0x131931[_0xfc8b('0x31')](function(_0x342612){_0x4aa1fa['or'](_0xfc8b('0x69'),'%,'+_0x342612+',%');});_0x542466=_[_0xfc8b('0x6a')](_0x542466,_0x131931);break;case _0xfc8b('0x6b'):if(_0x235ecd[_0xfc8b('0x6c')]===_0xfc8b('0x60')){_0x310bbd[_0x6290cd](_0xfc8b('0x6d'),'%'+_0x235ecd[_0xfc8b('0x5b')]+'%',null);}else{_0x23c923=_[_0xfc8b('0x64')](_0x5b5661,[_0xfc8b('0x2c'),_0xfc8b('0x6e')]);_0x235ecd[_0xfc8b('0x46')]='UserId';_0x166fa9=as[_0xfc8b('0x66')](_0x4acbb7,_0x23c923[_0xfc8b('0x39')],_0x235ecd);_0x310bbd[_0x6290cd](_0x166fa9['text'],_0x166fa9[_0xfc8b('0x5b')][_0xfc8b('0x68')],_0x166fa9[_0xfc8b('0x5b')][_0xfc8b('0x20')]);}break;case'body':_0x166fa9=as[_0xfc8b('0x66')]('me',null,_0x235ecd);_0x310bbd[_0x6290cd](_0x166fa9[_0xfc8b('0x67')],_0x166fa9['value'][_0xfc8b('0x68')],_0x166fa9[_0xfc8b('0x5b')]['end']);break;}}else{var _0x166fa9=as[_0xfc8b('0x66')](_0x4acbb7,_0x23c923[_0xfc8b('0x39')],_0x235ecd);_0x310bbd[_0x6290cd](_0x166fa9['text'],_0x166fa9[_0xfc8b('0x5b')][_0xfc8b('0x68')],_0x166fa9[_0xfc8b('0x5b')]['end']);}}}else{var _0x4fccda=_(_0x36f3a4[_0xfc8b('0x3a')])[_0xfc8b('0x6f')]()[_0xfc8b('0x2f')](function(_0x4fd995){return _[_0xfc8b('0x70')](_0x5b5661,['name',_0x4fd995])?_0x4fd995:undefined;})['compact']()[_0xfc8b('0x5b')]();if(!_[_0xfc8b('0x71')](_0x4fccda)){_0x4fccda[_0xfc8b('0x31')](function(_0x159a3b){if(_0x159a3b==='OpenchannelAccountId'){_0x412245['where'](_0xfc8b('0x72'),[][_0xfc8b('0x73')](_0x36f3a4['query'][_0x159a3b]));}else if(_0x159a3b===_0xfc8b('0x74')){var _0x3e0a0e=JSON[_0xfc8b('0x75')](_0x36f3a4[_0xfc8b('0x3a')][_0x159a3b])['$gte'];var _0x2a673e=JSON[_0xfc8b('0x75')](_0x36f3a4[_0xfc8b('0x3a')][_0x159a3b])[_0xfc8b('0x76')];_0x412245['where'](_0xfc8b('0x77'),_0x3e0a0e,_0x2a673e);}else{if(_0x36f3a4[_0xfc8b('0x3a')][_0x159a3b]===_0xfc8b('0x78')){_0x412245[_0xfc8b('0x43')]('i.'+_0x159a3b+'\x20IS\x20NULL');}else{_0x412245['where']('i.'+_0x159a3b+_0xfc8b('0x79'),_0x36f3a4[_0xfc8b('0x3a')][_0x159a3b]);}}});}if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7a')]){if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7a')]==0x1){_0x412245[_0xfc8b('0x5c')](_0xfc8b('0x7b'));}else{_0x412245[_0xfc8b('0x5c')](_0xfc8b('0x7c'));}}if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7d')]){_0x542466=_[_0xfc8b('0x7e')](_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7d')])?_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7d')]:new Array(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7d')]);_0x542466[_0xfc8b('0x31')](function(_0x598ea8){_0x4aa1fa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x598ea8+',%');});}if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x7f')]){var _0x47410d=_0x36f3a4['query'][_0xfc8b('0x7f')][_0xfc8b('0x80')]('\x5c','\x5c\x5c')[_0xfc8b('0x80')]('\x27\x27',_0xfc8b('0x81'));if(qs['isNumeric'](_0x47410d)){_0x310bbd['or'](_0xfc8b('0x82'),_0x47410d+'%');}else{_0x310bbd['or'](_0xfc8b('0x83'),qs['getFullTextValue'](_0x47410d))['or']('i.from\x20LIKE\x20?',_0x47410d+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x47410d+'%');}}}_0x412245[_0xfc8b('0x43')](_0x310bbd);_0x412245[_0xfc8b('0x84')](_0xfc8b('0x85'));var _0x73ea7={'type':db[_0xfc8b('0x86')][_0xfc8b('0x87')][_0xfc8b('0x88')],'raw':!![]};var _0x594269=_0x412245[_0xfc8b('0x89')]();_0x594269['field'](_0xfc8b('0x85'));_0x594269[_0xfc8b('0x46')](_0xfc8b('0x8a'),_0xfc8b('0x8b'));if(_0x4759d7[_0xfc8b('0x41')]){_0x4759d7['order'][_0xfc8b('0x31')](function(_0x2d0910){_0x412245[_0xfc8b('0x41')]('i.'+_0x2d0910[0x0],_0x2d0910[0x1]===_0xfc8b('0x8c')?![]:!![]);});}if(!_[_0xfc8b('0x71')](_0x542466)){_0x412245[_0xfc8b('0x5c')](_0x4aa1fa);_0x594269[_0xfc8b('0x43')](_0xfc8b('0x8d'),_0x542466);}BPromise[_0xfc8b('0x8e')]()[_0xfc8b('0x34')](function(){if(!_0x188c76){if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x8f')]||_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x90')])return;_0x594269[_0xfc8b('0x43')](_0xfc8b('0x91'));_0x412245[_0xfc8b('0x43')](_0xfc8b('0x91'));return;}return _0x36f3a4['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xfc8b('0x34')](function(_0x58b0a8){if(_[_0xfc8b('0x71')](_0x58b0a8)){_0x594269[_0xfc8b('0x43')](_0xfc8b('0x92'));_0x412245[_0xfc8b('0x43')](_0xfc8b('0x92'));}else{_0x594269['where'](_0xfc8b('0x72'),_[_0xfc8b('0x2f')](_0x58b0a8,'id'));_0x412245[_0xfc8b('0x43')](_0xfc8b('0x72'),_[_0xfc8b('0x2f')](_0x58b0a8,'id'));}});})['then'](function(){db[_0xfc8b('0x93')]['query'](_0x594269[_0xfc8b('0x94')](),_0x73ea7)['then'](function(_0x1bac78){_0x1a1623[_0xfc8b('0x21')]=_0x1bac78[_0xfc8b('0x59')];if(_0x1a1623[_0xfc8b('0x21')]===0x0)return[];return db[_0xfc8b('0x93')][_0xfc8b('0x3a')](_0x287b2c['toString'](),_0x73ea7)[_0xfc8b('0x34')](function(_0x56441c){_0x5c9d7d=_['keyBy'](_0x56441c,'id');_0x73ea7=_[_0xfc8b('0x95')](_0x73ea7,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36f3a4[_0xfc8b('0x3a')][_0xfc8b('0x3f')]){_0x4759d7['attributes']['forEach'](function(_0x44e0f3){_0x412245[_0xfc8b('0x46')]('i.'+_0x44e0f3);});}else{_0x412245[_0xfc8b('0x46')](_0xfc8b('0x8a'),_0xfc8b('0x8b'));_0x412245[_0xfc8b('0x46')]('a.key',_0xfc8b('0x96'));_0x412245[_0xfc8b('0x46')](_0xfc8b('0x97'),'Account.mandatoryDisposition');_0x412245[_0xfc8b('0x46')](_0xfc8b('0x98'));_0x412245['field'](_0xfc8b('0x99'),_0xfc8b('0x9a'));_0x412245[_0xfc8b('0x46')]('c.lastName',_0xfc8b('0x9b'));_0x412245[_0xfc8b('0x46')]('c.email',_0xfc8b('0x9c'));_0x412245[_0xfc8b('0x46')](_0xfc8b('0x9d'),_0xfc8b('0x9e'));_0x412245[_0xfc8b('0x46')](_0xfc8b('0x9f'),_0xfc8b('0xa0'));_0x412245['field'](_0xfc8b('0xa1'),'Contact.fax');_0x412245['field'](_0xfc8b('0xa2'),'Owner.fullname');_0x412245[_0xfc8b('0x46')](_0xfc8b('0xa3'),_0xfc8b('0xa4'));_0x412245['field'](_0xfc8b('0xa5'),_0xfc8b('0x30'));}if(_0x4759d7['limit'])_0x412245['limit'](_0x4759d7[_0xfc8b('0x23')]);if(_0x4759d7[_0xfc8b('0x22')])_0x412245['offset'](_0x4759d7[_0xfc8b('0x22')]);return db[_0xfc8b('0x93')][_0xfc8b('0x3a')](_0x412245[_0xfc8b('0x94')](),_0x73ea7);})[_0xfc8b('0x34')](function(_0x3226ba){_0x4ce14b['where'](_0xfc8b('0xa6'),_['map'](_0x3226ba,'id'));return db['sequelize'][_0xfc8b('0x3a')](_0x4ce14b['toString'](),_0x73ea7)[_0xfc8b('0x34')](function(_0x3527d9){var _0x2434cd=_[_0xfc8b('0xa7')](_0x3527d9,_0xfc8b('0xa8'));var _0x1e1d14=[];_0x3226ba[_0xfc8b('0x31')](function(_0x388e0f){_0x1e1d14[_0xfc8b('0x33')](updateOpenchannelInteraction(_0x388e0f,_0x5c9d7d,_0x2434cd));});return BPromise[_0xfc8b('0xa9')](_0x1e1d14);});});})['then'](function(_0x4eeb9e){_0x1a1623[_0xfc8b('0xaa')]=_0x4eeb9e;return _0x1a1623;})[_0xfc8b('0x34')](respondWithFilteredResult(_0x174b9d,_0x4759d7));})[_0xfc8b('0x35')](handleError(_0x174b9d,null));};exports[_0xfc8b('0xab')]=function(_0x5d0039,_0x35f54b){var _0x4314ed={'raw':![],'where':{'id':_0x5d0039[_0xfc8b('0xac')]['id']}},_0x59673={};_0x59673['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x59673[_0xfc8b('0x3a')]=_[_0xfc8b('0x6f')](_0x5d0039[_0xfc8b('0x3a')]);_0x59673[_0xfc8b('0x3b')]=_[_0xfc8b('0x3c')](_0x59673[_0xfc8b('0x3d')],_0x59673[_0xfc8b('0x3a')]);_0x4314ed['attributes']=_[_0xfc8b('0x3c')](_0x59673['model'],qs[_0xfc8b('0x3f')](_0x5d0039[_0xfc8b('0x3a')]['fields']));_0x4314ed[_0xfc8b('0x3e')]=_0x4314ed[_0xfc8b('0x3e')][_0xfc8b('0x59')]?_0x4314ed[_0xfc8b('0x3e')]:_0x59673['model'];if(_0x5d0039[_0xfc8b('0x3a')][_0xfc8b('0xad')]){_0x4314ed[_0xfc8b('0xae')]=[{'all':!![]}];}_0x4314ed=_[_0xfc8b('0x95')]({},_0x4314ed,_0x5d0039[_0xfc8b('0xaf')]);return db[_0xfc8b('0x37')][_0xfc8b('0x64')](_0x4314ed)['then'](handleEntityNotFound(_0x35f54b,null))[_0xfc8b('0x34')](respondWithResult(_0x35f54b,null))['catch'](handleError(_0x35f54b,null));};exports['create']=function(_0x57dd3e,_0x14e86d){return db['OpenchannelInteraction'][_0xfc8b('0xb0')](_0x57dd3e[_0xfc8b('0xb1')],{})[_0xfc8b('0x34')](respondWithResult(_0x14e86d,0xc9))['catch'](handleError(_0x14e86d,null));};exports['update']=function(_0x19fb10,_0x47875f){if(_0x19fb10[_0xfc8b('0xb1')]['id']){delete _0x19fb10[_0xfc8b('0xb1')]['id'];}return db[_0xfc8b('0x37')][_0xfc8b('0x64')]({'where':{'id':_0x19fb10[_0xfc8b('0xac')]['id']}})[_0xfc8b('0x34')](handleEntityNotFound(_0x47875f,null))[_0xfc8b('0x34')](saveUpdates(_0x19fb10[_0xfc8b('0xb1')],null))[_0xfc8b('0x34')](respondWithResult(_0x47875f,null))['catch'](handleError(_0x47875f,null));};exports['destroy']=function(_0x561d5f,_0x1b65b4){return db[_0xfc8b('0x37')][_0xfc8b('0x64')]({'where':{'id':_0x561d5f[_0xfc8b('0xac')]['id']}})[_0xfc8b('0x34')](handleEntityNotFound(_0x1b65b4,null))[_0xfc8b('0x34')](removeEntity(_0x1b65b4,null))[_0xfc8b('0x35')](handleError(_0x1b65b4,null));};exports[_0xfc8b('0xb2')]=function(_0x414195,_0x1cc56f){return db['OpenchannelInteraction'][_0xfc8b('0xb2')]()[_0xfc8b('0x34')](respondWithResult(_0x1cc56f,null))[_0xfc8b('0x35')](handleError(_0x1cc56f,null));};exports[_0xfc8b('0xb3')]=function(_0x51f8d4,_0x5d2288,_0x3688ec){return db[_0xfc8b('0xb4')]['find']({'where':{'id':_0x51f8d4[_0xfc8b('0xac')]['id']}})[_0xfc8b('0x34')](handleEntityNotFound(_0x5d2288,null))[_0xfc8b('0x34')](function(_0x39bc7c){if(_0x39bc7c){return _0x39bc7c[_0xfc8b('0xb3')](_0x51f8d4[_0xfc8b('0xb1')][_0xfc8b('0xb5')],_[_0xfc8b('0xb6')](_0x51f8d4[_0xfc8b('0xb1')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d2288,null))[_0xfc8b('0x35')](handleError(_0x5d2288,null));};exports[_0xfc8b('0xb7')]=function(_0x468ea5,_0x3de772,_0xe3ca63){var _0x161680={'raw':![],'where':{}};var _0x37e80f={};var _0x1a7387={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x468ea5[_0xfc8b('0xac')]['id']}})['then'](handleEntityNotFound(_0x3de772,null))[_0xfc8b('0x34')](function(_0x331f24){if(_0x331f24){_0x37e80f[_0xfc8b('0x3d')]=_[_0xfc8b('0x6f')](db[_0xfc8b('0xb4')][_0xfc8b('0xb8')]);_0x37e80f[_0xfc8b('0x3a')]=_[_0xfc8b('0x6f')](_0x468ea5[_0xfc8b('0x3a')]);_0x37e80f['filters']=_[_0xfc8b('0x3c')](_0x37e80f[_0xfc8b('0x3d')],_0x37e80f['query']);_0x161680['attributes']=_[_0xfc8b('0x3c')](_0x37e80f[_0xfc8b('0x3d')],qs[_0xfc8b('0x3f')](_0x468ea5[_0xfc8b('0x3a')][_0xfc8b('0x3f')]));_0x161680[_0xfc8b('0x3e')]=_0x161680[_0xfc8b('0x3e')][_0xfc8b('0x59')]?_0x161680['attributes']:_0x37e80f[_0xfc8b('0x3d')];if(!_0x468ea5['query'][_0xfc8b('0xb9')](_0xfc8b('0x40'))){_0x161680[_0xfc8b('0x23')]=qs[_0xfc8b('0x23')](_0x468ea5['query']['limit']);_0x161680['offset']=qs[_0xfc8b('0x22')](_0x468ea5[_0xfc8b('0x3a')][_0xfc8b('0x22')]);}_0x161680[_0xfc8b('0x41')]=qs[_0xfc8b('0x42')](_0x468ea5[_0xfc8b('0x3a')]['sort']);_0x161680[_0xfc8b('0x43')]=qs[_0xfc8b('0x3b')](_[_0xfc8b('0x44')](_0x468ea5['query'],_0x37e80f[_0xfc8b('0x3b')]));_0x161680['where'][_0xfc8b('0xa8')]=_0x331f24['id'];if(_0x468ea5[_0xfc8b('0x3a')][_0xfc8b('0x7f')]){_0x161680[_0xfc8b('0x43')]=_['merge'](_0x161680[_0xfc8b('0x43')],{'$or':_[_0xfc8b('0x2f')](_0x161680[_0xfc8b('0x3e')],function(_0x21d074){var _0x505568={};_0x505568[_0x21d074]={'$like':'%'+_0x468ea5[_0xfc8b('0x3a')][_0xfc8b('0x7f')]+'%'};return _0x505568;})});}if(_0x468ea5[_0xfc8b('0x3a')][_0xfc8b('0xba')]){var _0x22879a=_0x468ea5[_0xfc8b('0x3a')]['$gte'][_0xfc8b('0x61')](',');var _0x63245={};_0x63245[_0x22879a[0x0]]={'$gte':moment(_0x22879a[0x1])[_0xfc8b('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x161680[_0xfc8b('0x43')]=_[_0xfc8b('0x95')](_0x161680[_0xfc8b('0x43')],_0x63245);}_0x161680=_['merge']({},_0x161680,_0x468ea5[_0xfc8b('0xaf')]);return db[_0xfc8b('0xb4')][_0xfc8b('0x21')]({'where':_0x161680['where']})[_0xfc8b('0x34')](function(_0x2a7f7b){_0x1a7387[_0xfc8b('0x21')]=_0x2a7f7b;if(_0x468ea5['query'][_0xfc8b('0xad')]){_0x161680['include']=[{'all':!![]}];}return db[_0xfc8b('0xb4')]['findAll'](_0x161680);})[_0xfc8b('0x34')](function(_0x4c92bc){_0x1a7387[_0xfc8b('0xaa')]=_0x4c92bc;return _0x1a7387;});}})[_0xfc8b('0x34')](respondWithFilteredResult(_0x3de772,_0x161680))['catch'](handleError(_0x3de772,null));};exports['addTags']=function(_0x37a171,_0x245dfb,_0x3e4e54){return db[_0xfc8b('0x37')]['find']({'where':{'id':_0x37a171[_0xfc8b('0xac')]['id']}})[_0xfc8b('0x34')](handleEntityNotFound(_0x245dfb,null))[_0xfc8b('0x34')](function(_0x38984e){if(_0x38984e){return _0x38984e[_0xfc8b('0xbc')](_0x37a171[_0xfc8b('0xb1')][_0xfc8b('0xb5')],_[_0xfc8b('0xb6')](_0x37a171[_0xfc8b('0xb1')],[_0xfc8b('0xb5'),'id'])||{})[_0xfc8b('0xbd')](function(){return db[_0xfc8b('0xbe')][_0xfc8b('0xbf')]({'attributes':['id',_0xfc8b('0x2c'),_0xfc8b('0xc0')],'where':{'id':_0x37a171[_0xfc8b('0xb1')][_0xfc8b('0xb5')]}});})[_0xfc8b('0x34')](function(_0x26abc1){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x37a171[_0xfc8b('0xac')]['id']),'tags':_0x26abc1||[]});return{'id':Number(_0x37a171['params']['id']),'tags':_0x26abc1||[]};});}})['then'](respondWithResult(_0x245dfb,null))[_0xfc8b('0x35')](handleError(_0x245dfb,null));};exports[_0xfc8b('0xc1')]=function(_0x430d74,_0x35299f,_0x56c32d){return db[_0xfc8b('0x37')][_0xfc8b('0x64')]({'where':{'id':_0x430d74[_0xfc8b('0xac')]['id']}})[_0xfc8b('0x34')](handleEntityNotFound(_0x35299f,null))[_0xfc8b('0x34')](function(_0x4ad6fb){if(_0x4ad6fb){return _0x4ad6fb[_0xfc8b('0xc1')](_0x430d74[_0xfc8b('0x3a')]['ids']);}})[_0xfc8b('0x34')](respondWithStatusCode(_0x35299f,null))[_0xfc8b('0x35')](handleError(_0x35299f,null));};exports[_0xfc8b('0xc2')]=function(_0x5b0d66,_0x151046){var _0x234862=moment()[_0xfc8b('0xc3')]()[_0xfc8b('0x94')]();var _0x3359ca=path['join'](config['root'],_0xfc8b('0xc4'),_0xfc8b('0xc5'),_0xfc8b('0xc6'));var _0x3c2fe7=path[_0xfc8b('0xc7')](config[_0xfc8b('0xc8')],_0xfc8b('0xc4'),_0xfc8b('0xc5'),_0xfc8b('0xc9'));var _0x4ae600=path[_0xfc8b('0xc7')](_0x3359ca,_0x234862);var _0x275122=util[_0xfc8b('0xbb')](_0xfc8b('0xca'),_0x5b0d66[_0xfc8b('0xac')]['id'],_0x234862);var _0xb09b9d=path['join'](_0x3359ca,_0x275122);var _0x582bb2=[];_0x582bb2[_0xfc8b('0x33')]({'model':db[_0xfc8b('0x6b')],'as':'User','attributes':['id',_0xfc8b('0xcb')],'raw':!![]});_0x582bb2['push']({'model':db[_0xfc8b('0xcc')],'as':_0xfc8b('0x5f'),'attributes':['id','firstName',_0xfc8b('0xcd')],'raw':!![]});if(_0x5b0d66[_0xfc8b('0x3a')][_0xfc8b('0xc9')]){_0x582bb2[_0xfc8b('0x33')]({'model':db[_0xfc8b('0xce')],'as':'Attachment','raw':!![]});}var _0x27d99e=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xfc8b('0xb1'),'createdAt',_0xfc8b('0xcf'),_0xfc8b('0xd0'),_0xfc8b('0x7a')],'include':_0x582bb2}];_0x27d99e[_0xfc8b('0x33')]({'model':db['OpenchannelAccount'],'as':_0xfc8b('0xd1'),'attributes':['id',_0xfc8b('0x2c')]});_0x27d99e[_0xfc8b('0x33')]({'model':db[_0xfc8b('0x6b')],'as':_0xfc8b('0xd2'),'attributes':['id',_0xfc8b('0xcb')]});return db[_0xfc8b('0x37')][_0xfc8b('0x64')]({'where':{'id':_0x5b0d66[_0xfc8b('0xac')]['id']},'include':_0x27d99e})[_0xfc8b('0x34')](handleEntityNotFound(_0x151046,null))[_0xfc8b('0x34')](function(_0x16b5db){if(_0x16b5db){var _0x214948=_0x16b5db[_0xfc8b('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x4ae600);var _0x11ca4f={'format':'A4','border':_0xfc8b('0xd4'),'header':{'height':_0xfc8b('0xd5'),'contents':{'first':_0xfc8b('0xd6')}},'footer':{'height':_0xfc8b('0xd7'),'contents':{'default':util[_0xfc8b('0xbb')](_0xfc8b('0xd8'),util[_0xfc8b('0xbb')](_0xfc8b('0xd9'),_0xfc8b('0xda'),_0x214948['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};var _0xd5b9b6={'channel':_0xfc8b('0xda'),'account':_0x214948[_0xfc8b('0xd1')][_0xfc8b('0x2c')],'agent':_0x214948[_0xfc8b('0xd2')]?_0x214948[_0xfc8b('0xd2')][_0xfc8b('0xcb')]:_0xfc8b('0xdb'),'createdAt':moment(_0x214948[_0xfc8b('0x74')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xfc8b('0x94')](),'closedAt':_0x214948['closed']?moment(_0x214948['closedAt'])['format'](_0xfc8b('0xdc'))[_0xfc8b('0x94')]():'','disposition':_0x214948[_0xfc8b('0xdd')],'visibility':_0x214948['threadId']?'Public':_0xfc8b('0xde'),'messages':_(_0x214948[_0xfc8b('0xdf')])[_0xfc8b('0x7f')]({'secret':![]})['map'](function(_0x291715){if(_0x291715['Attachment']){var _0x23a045=path['join'](_0x3c2fe7,_0x291715[_0xfc8b('0xce')][_0xfc8b('0xe0')]);if(fs['existsSync'](_0x23a045)){fs[_0xfc8b('0xe1')](_0x23a045)[_0xfc8b('0xe2')](fs[_0xfc8b('0xe3')](path[_0xfc8b('0xc7')](_0x4ae600,_0x291715[_0xfc8b('0xce')]['basename'])));}}return{'date':moment(_0x291715[_0xfc8b('0x74')])[_0xfc8b('0xbb')](_0xfc8b('0xdc'))['toString'](),'sender':_0x291715['direction']===_0xfc8b('0xe4')?_0x291715['User']?_0x291715[_0xfc8b('0x6b')][_0xfc8b('0xcb')]:_0xfc8b('0xe5'):_0x291715[_0xfc8b('0x5f')][_0xfc8b('0xe6')]+(_0x291715[_0xfc8b('0x5f')][_0xfc8b('0xcd')]?'\x20'+_0x291715['Contact'][_0xfc8b('0xcd')]:''),'body':_0x291715[_0xfc8b('0xce')]?_0x291715['Attachment']['basename']:_0x291715[_0xfc8b('0xb1')],'direction':_0x291715[_0xfc8b('0xcf')]===_0xfc8b('0xe4')?'A':'C','secret':_0x291715['secret'],'read':_0x291715['read'],'attachment':_0x291715[_0xfc8b('0xce')]};})[_0xfc8b('0x5b')]()};return ejs[_0xfc8b('0xe7')](path[_0xfc8b('0xc7')](config[_0xfc8b('0xc8')],'server',_0xfc8b('0xe8'),_0xfc8b('0xe9')),{'interaction':_0xd5b9b6})[_0xfc8b('0x34')](function(_0x3ac5a0){return new BPromise(function(_0x28edc6,_0x4ecb80){pdf[_0xfc8b('0xb0')](_0x3ac5a0,_0x11ca4f)[_0xfc8b('0xea')](path[_0xfc8b('0xc7')](_0x4ae600,'transcript-'+_0x214948['id']+'-'+_0x234862+_0xfc8b('0xeb')),function(_0xbc75b8,_0x125a6d){if(_0xbc75b8)return _0x4ecb80(_0xbc75b8);_0x28edc6(_0x125a6d);});});})[_0xfc8b('0x34')](function(){return new BPromise(function(_0x282685,_0x3cdad3){zipdir(_0x4ae600,{'saveTo':_0xb09b9d},function(_0x50f694,_0x301fd1){if(_0x50f694)return _0x3cdad3(_0x50f694);return _0x282685(_0x301fd1);});})[_0xfc8b('0x34')](function(){return new BPromise(function(_0x3ccca6,_0xfa5c60){rimraf(_0x4ae600,function(_0x53e55e){if(_0x53e55e)_0xfa5c60(_0x53e55e);return _0x3ccca6();});});})[_0xfc8b('0x34')](function(){return _0x151046[_0xfc8b('0xc2')](_0xb09b9d,_0x275122,function(_0x44ce64){if(_0x44ce64){console['log']('err',_0x44ce64);}else{fs['unlinkSync'](_0xb09b9d);}});});});}else{return _0x151046['sendStatus'](0xc8);}})[_0xfc8b('0x35')](handleError(_0x151046,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 01e76af..2c735ef 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 _0x7955=['findAll','then','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','setDataValue','Users','map'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x7955,0x127));var _0x5795=function(_0x104209,_0x59e25e){_0x104209=_0x104209-0x0;var _0x100749=_0x7955[_0x104209];return _0x100749;};'use strict';var EventEmitter=require(_0x5795('0x0'));var OpenchannelInteraction=require(_0x5795('0x1'))['db'][_0x5795('0x2')];var OpenchannelMessage=require(_0x5795('0x1'))['db'][_0x5795('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x5795('0x4')](0x0);var events={'afterCreate':_0x5795('0x5'),'afterUpdate':_0x5795('0x6'),'afterDestroy':_0x5795('0x7')};function emitEvent(_0x218aa9){return function(_0x5143cd,_0x4ce6d8,_0x194344){_0x5143cd['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x383c6d){_0x5143cd[_0x5795('0x8')](_0x5795('0x9'),_0x383c6d[_0x5795('0xa')](function(_0x4cf993){return{'id':_0x4cf993['id']};}));return OpenchannelMessage[_0x5795('0xb')]({'where':{'OpenchannelInteractionId':_0x5143cd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5795('0xc')](function(_0x56d1ff){_0x5143cd['setDataValue']('unreadMessages',_0x56d1ff[_0x5795('0xd')]);OpenchannelInteractionEvents[_0x5795('0xe')](_0x218aa9+':'+_0x5143cd['id'],_0x5143cd);OpenchannelInteractionEvents[_0x5795('0xe')](_0x218aa9,_0x5143cd);_0x194344(null);})['catch'](_0x194344(null));};}for(var e in events){if(events[_0x5795('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x5795('0x10')](e,emitEvent(event));}}module[_0x5795('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x6a51=['emit','catch','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','setDataValue','Users','map','then','unreadMessages'];(function(_0x2e71c5,_0x1aff5d){var _0x3bc153=function(_0xcd6378){while(--_0xcd6378){_0x2e71c5['push'](_0x2e71c5['shift']());}};_0x3bc153(++_0x1aff5d);}(_0x6a51,0x1f3));var _0x16a5=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x6a51[_0x33c9f8];return _0x2d7004;};'use strict';var EventEmitter=require(_0x16a5('0x0'));var OpenchannelInteraction=require(_0x16a5('0x1'))['db'][_0x16a5('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x16a5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x16a5('0x4')](0x0);var events={'afterCreate':_0x16a5('0x5'),'afterUpdate':_0x16a5('0x6'),'afterDestroy':'remove'};function emitEvent(_0x3134da){return function(_0x1a2599,_0x334825,_0x48004e){_0x1a2599[_0x16a5('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5f1f3f){_0x1a2599[_0x16a5('0x8')](_0x16a5('0x9'),_0x5f1f3f[_0x16a5('0xa')](function(_0x367b88){return{'id':_0x367b88['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1a2599['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16a5('0xb')](function(_0x14302e){_0x1a2599[_0x16a5('0x8')](_0x16a5('0xc'),_0x14302e['length']);OpenchannelInteractionEvents[_0x16a5('0xd')](_0x3134da+':'+_0x1a2599['id'],_0x1a2599);OpenchannelInteractionEvents['emit'](_0x3134da,_0x1a2599);_0x48004e(null);})[_0x16a5('0xe')](_0x48004e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x16a5('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5ba73de..0068aab 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 _0x99c9=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x27f704,_0x369a80){var _0x389f0a=function(_0x613c2e){while(--_0x613c2e){_0x27f704['push'](_0x27f704['shift']());}};_0x389f0a(++_0x369a80);}(_0x99c9,0x13c));var _0x999c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x99c9[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb88ec1,_0x329252,_0x3c58ba){if(_0xb88ec1[_0x999c('0xe')](_0x999c('0xf'))){_0xb88ec1['closedAt']=moment()[_0x999c('0x10')](_0x999c('0x11'));}_0x3c58ba(null,_0xb88ec1);}}});}; \ No newline at end of file +var _0x106f=['openchannel_interactions','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0x469361,_0x42f6ab){var _0x418e39=function(_0x3b519f){while(--_0x3b519f){_0x469361['push'](_0x469361['shift']());}};_0x418e39(++_0x42f6ab);}(_0x106f,0x162));var _0xf106=function(_0x50d867,_0x27b599){_0x50d867=_0x50d867-0x0;var _0xb6674b=_0x106f[_0x50d867];return _0xb6674b;};'use strict';var _=require(_0xf106('0x0'));var util=require(_0xf106('0x1'));var logger=require('../../config/logger')(_0xf106('0x2'));var moment=require(_0xf106('0x3'));var BPromise=require('bluebird');var rp=require(_0xf106('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf106('0x5'));var config=require(_0xf106('0x6'));var attributes=require(_0xf106('0x7'));module[_0xf106('0x8')]=function(_0x253f6d,_0x282fd4){return _0x253f6d[_0xf106('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0xf106('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ac1bd,_0x5ea4f0,_0x4a35bc){if(_0x3ac1bd['changed']('closed')){_0x3ac1bd['closedAt']=moment()[_0xf106('0xb')](_0xf106('0xc'));}_0x4a35bc(null,_0x3ac1bd);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 915d35a..b86f2df 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 _0xd15b=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x488982,_0x3e260c){var _0xfe389c=function(_0x2f8670){while(--_0x2f8670){_0x488982['push'](_0x488982['shift']());}};_0xfe389c(++_0x3e260c);}(_0xd15b,0x1e2));var _0xbd15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd15b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbd15('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbd15('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd15('0x2'));var db=require(_0xbd15('0x3'))['db'];var utils=require(_0xbd15('0x4'));var logger=require(_0xbd15('0x5'))(_0xbd15('0x6'));var config=require(_0xbd15('0x7'));var jayson=require(_0xbd15('0x8'));var client=jayson[_0xbd15('0x9')]['http']({'port':0x232a});config[_0xbd15('0xa')]=_[_0xbd15('0xb')](config[_0xbd15('0xa')],{'host':_0xbd15('0xc'),'port':0x18eb});var socket=require(_0xbd15('0xd'))(new Redis(config[_0xbd15('0xa')]));require('./openchannelInteraction.socket')[_0xbd15('0xe')](socket);function respondWithRpcPromise(_0x52ae4a,_0x2857d7,_0x1d3ca7){return new BPromise(function(_0x575d77,_0x169fd8){return client[_0xbd15('0xf')](_0x52ae4a,_0x1d3ca7)[_0xbd15('0x10')](function(_0x2dadc8){logger[_0xbd15('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2857d7,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x2857d7,_0xbd15('0x12'),JSON[_0xbd15('0x13')](_0x2dadc8));if(_0x2dadc8[_0xbd15('0x14')]){if(_0x2dadc8[_0xbd15('0x14')][_0xbd15('0x15')]===0x1f4){logger[_0xbd15('0x14')](_0xbd15('0x16'),_0x2857d7,_0x2dadc8[_0xbd15('0x14')]['message']);return _0x169fd8(_0x2dadc8[_0xbd15('0x14')][_0xbd15('0x17')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2857d7,_0x2dadc8[_0xbd15('0x14')]['message']);return _0x575d77(_0x2dadc8['error'][_0xbd15('0x17')]);}else{logger['info'](_0xbd15('0x16'),_0x2857d7,_0xbd15('0x12'));_0x575d77(_0x2dadc8[_0xbd15('0x18')][_0xbd15('0x17')]);}})[_0xbd15('0x19')](function(_0xd1c07a){logger['error'](_0xbd15('0x16'),_0x2857d7,_0xd1c07a);_0x169fd8(_0xd1c07a);});});}exports[_0xbd15('0x1a')]=function(_0x3dfc73){var _0x44cd4c=this;return new Promise(function(_0x390690,_0x1ad0c0){return db[_0xbd15('0x1b')][_0xbd15('0x1c')](_0x3dfc73[_0xbd15('0x1d')],{'raw':_0x3dfc73[_0xbd15('0x1e')]?_0x3dfc73[_0xbd15('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dfc73[_0xbd15('0x1e')]?_0x3dfc73['options'][_0xbd15('0x1f')]||null:null,'attributes':_0x3dfc73[_0xbd15('0x1e')]?_0x3dfc73['options'][_0xbd15('0x20')]||null:null,'limit':_0x3dfc73[_0xbd15('0x1e')]?_0x3dfc73['options'][_0xbd15('0x21')]||null:null})[_0xbd15('0x10')](function(_0x561bec){logger[_0xbd15('0x11')](_0xbd15('0x1a'),_0x3dfc73);logger[_0xbd15('0x22')](_0xbd15('0x1a'),_0x3dfc73,JSON[_0xbd15('0x13')](_0x561bec));_0x390690(_0x561bec);})[_0xbd15('0x19')](function(_0x4ecbc2){logger[_0xbd15('0x14')](_0xbd15('0x1a'),_0x4ecbc2[_0xbd15('0x17')],_0x3dfc73);_0x1ad0c0(_0x44cd4c[_0xbd15('0x14')](0x1f4,_0x4ecbc2[_0xbd15('0x17')]));});});};exports[_0xbd15('0x23')]=function(_0x13b37b){return new Promise(function(_0x5745c5,_0x506441){return db[_0xbd15('0x1b')][_0xbd15('0x24')]({'where':_0x13b37b[_0xbd15('0x1e')]?_0x13b37b[_0xbd15('0x1e')][_0xbd15('0x1f')]||null:null})[_0xbd15('0x10')](function(_0x4c77b8){if(_0x4c77b8){return _0x4c77b8[_0xbd15('0x25')](_0x13b37b['body'][_0xbd15('0x26')],_['omit'](_0x13b37b['body'],['ids','id'])||{});}})[_0xbd15('0x27')](function(_0x3b58b2){logger['info'](_0xbd15('0x28'),_0x13b37b);logger['debug'](_0xbd15('0x28'),_0x13b37b,JSON[_0xbd15('0x13')](_0x3b58b2));_0x5745c5(_0x3b58b2);})[_0xbd15('0x19')](function(_0x4b3cbf){logger[_0xbd15('0x14')](_0xbd15('0x28'),_0x4b3cbf[_0xbd15('0x17')],_0x13b37b);_0x506441(_this[_0xbd15('0x14')](0x1f4,_0x4b3cbf[_0xbd15('0x17')]));});});}; \ No newline at end of file +var _0xbf1f=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./openchannelInteraction.socket','register','request','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','options','raw','where','attributes','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','then','body','ids','spread','lodash','util','moment','bluebird'];(function(_0x673b8e,_0x105f4c){var _0xee868d=function(_0x21534d){while(--_0x21534d){_0x673b8e['push'](_0x673b8e['shift']());}};_0xee868d(++_0x105f4c);}(_0xbf1f,0x15b));var _0xfbf1=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xbf1f[_0x2e3107];return _0x833d69;};'use strict';var _=require(_0xfbf1('0x0'));var util=require(_0xfbf1('0x1'));var moment=require(_0xfbf1('0x2'));var BPromise=require(_0xfbf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbf1('0x4'));var db=require(_0xfbf1('0x5'))['db'];var utils=require(_0xfbf1('0x6'));var logger=require('../../config/logger')(_0xfbf1('0x7'));var config=require(_0xfbf1('0x8'));var jayson=require(_0xfbf1('0x9'));var client=jayson['client'][_0xfbf1('0xa')]({'port':0x232a});config[_0xfbf1('0xb')]=_[_0xfbf1('0xc')](config[_0xfbf1('0xb')],{'host':_0xfbf1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbf1('0xb')]));require(_0xfbf1('0xe'))[_0xfbf1('0xf')](socket);function respondWithRpcPromise(_0x3fc47f,_0x5a4240,_0x375fd5){return new BPromise(function(_0x1d8506,_0x20abf4){return client[_0xfbf1('0x10')](_0x3fc47f,_0x375fd5)['then'](function(_0x5b3b62){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x5a4240,_0xfbf1('0x11'));logger[_0xfbf1('0x12')](_0xfbf1('0x13'),_0x5a4240,_0xfbf1('0x11'),JSON[_0xfbf1('0x14')](_0x5b3b62));if(_0x5b3b62[_0xfbf1('0x15')]){if(_0x5b3b62[_0xfbf1('0x15')][_0xfbf1('0x16')]===0x1f4){logger['error'](_0xfbf1('0x17'),_0x5a4240,_0x5b3b62[_0xfbf1('0x15')][_0xfbf1('0x18')]);return _0x20abf4(_0x5b3b62[_0xfbf1('0x15')][_0xfbf1('0x18')]);}logger[_0xfbf1('0x15')](_0xfbf1('0x17'),_0x5a4240,_0x5b3b62[_0xfbf1('0x15')]['message']);return _0x1d8506(_0x5b3b62[_0xfbf1('0x15')][_0xfbf1('0x18')]);}else{logger[_0xfbf1('0x19')](_0xfbf1('0x17'),_0x5a4240,_0xfbf1('0x11'));_0x1d8506(_0x5b3b62[_0xfbf1('0x1a')]['message']);}})['catch'](function(_0x1ce562){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x5a4240,_0x1ce562);_0x20abf4(_0x1ce562);});});}exports['UpdateOpenchannelInteraction']=function(_0x2cee98){var _0x21c11a=this;return new Promise(function(_0x43d01c,_0x2573ed){return db['OpenchannelInteraction']['update'](_0x2cee98['body'],{'raw':_0x2cee98[_0xfbf1('0x1b')]?_0x2cee98['options'][_0xfbf1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cee98[_0xfbf1('0x1b')]?_0x2cee98['options'][_0xfbf1('0x1d')]||null:null,'attributes':_0x2cee98[_0xfbf1('0x1b')]?_0x2cee98[_0xfbf1('0x1b')][_0xfbf1('0x1e')]||null:null,'limit':_0x2cee98[_0xfbf1('0x1b')]?_0x2cee98['options']['limit']||null:null})['then'](function(_0x3b5052){logger[_0xfbf1('0x19')](_0xfbf1('0x1f'),_0x2cee98);logger[_0xfbf1('0x12')]('UpdateOpenchannelInteraction',_0x2cee98,JSON['stringify'](_0x3b5052));_0x43d01c(_0x3b5052);})[_0xfbf1('0x20')](function(_0x1ee687){logger['error'](_0xfbf1('0x1f'),_0x1ee687['message'],_0x2cee98);_0x2573ed(_0x21c11a[_0xfbf1('0x15')](0x1f4,_0x1ee687[_0xfbf1('0x18')]));});});};exports[_0xfbf1('0x21')]=function(_0x1e04ea){return new Promise(function(_0x2ac0f7,_0x2b6f82){return db[_0xfbf1('0x22')]['find']({'where':_0x1e04ea['options']?_0x1e04ea[_0xfbf1('0x1b')][_0xfbf1('0x1d')]||null:null})[_0xfbf1('0x23')](function(_0x3f9595){if(_0x3f9595){return _0x3f9595['addTags'](_0x1e04ea[_0xfbf1('0x24')][_0xfbf1('0x25')],_['omit'](_0x1e04ea['body'],[_0xfbf1('0x25'),'id'])||{});}})[_0xfbf1('0x26')](function(_0x12985b){logger['info']('AddTags',_0x1e04ea);logger[_0xfbf1('0x12')]('AddTags',_0x1e04ea,JSON[_0xfbf1('0x14')](_0x12985b));_0x2ac0f7(_0x12985b);})[_0xfbf1('0x20')](function(_0x496694){logger[_0xfbf1('0x15')]('AddTags',_0x496694[_0xfbf1('0x18')],_0x1e04ea);_0x2b6f82(_this[_0xfbf1('0x15')](0x1f4,_0x496694[_0xfbf1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 7390032..11622da 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 _0x15b5=['register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener'];(function(_0x13fc6a,_0x2ec04d){var _0x1f5e1f=function(_0x102c6d){while(--_0x102c6d){_0x13fc6a['push'](_0x13fc6a['shift']());}};_0x1f5e1f(++_0x2ec04d);}(_0x15b5,0x7b));var _0x515b=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x15b5[_0x4bb66f];return _0xf2772f;};'use strict';var OpenchannelInteractionEvents=require(_0x515b('0x0'));var events=['save',_0x515b('0x1'),_0x515b('0x2')];function createListener(_0x4128b0,_0x35a1cf){return function(_0xf8d734){_0x35a1cf[_0x515b('0x3')](_0x4128b0,_0xf8d734);};}function removeListener(_0x5e04ae,_0x503305){return function(){OpenchannelInteractionEvents[_0x515b('0x4')](_0x5e04ae,_0x503305);};}exports[_0x515b('0x5')]=function(_0x13cf37){for(var _0x17e0c6=0x0,_0x484010=events[_0x515b('0x6')];_0x17e0c6<_0x484010;_0x17e0c6++){var _0x1eb652=events[_0x17e0c6];var _0x22defc=createListener(_0x515b('0x7')+_0x1eb652,_0x13cf37);OpenchannelInteractionEvents['on'](_0x1eb652,_0x22defc);}}; \ No newline at end of file +var _0x0ffa=['remove','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x3625d6,_0x57f4c4){var _0x8df4d8=function(_0x7ba668){while(--_0x7ba668){_0x3625d6['push'](_0x3625d6['shift']());}};_0x8df4d8(++_0x57f4c4);}(_0x0ffa,0xbf));var _0xa0ff=function(_0x5bfba9,_0xe833c7){_0x5bfba9=_0x5bfba9-0x0;var _0x186754=_0x0ffa[_0x5bfba9];return _0x186754;};'use strict';var OpenchannelInteractionEvents=require(_0xa0ff('0x0'));var events=['save',_0xa0ff('0x1'),'update'];function createListener(_0x164c09,_0xd1d845){return function(_0x502aa6){_0xd1d845[_0xa0ff('0x2')](_0x164c09,_0x502aa6);};}function removeListener(_0x5771f0,_0x255ff9){return function(){OpenchannelInteractionEvents[_0xa0ff('0x3')](_0x5771f0,_0x255ff9);};}exports['register']=function(_0xdd652){for(var _0x4b847c=0x0,_0x27aa27=events[_0xa0ff('0x4')];_0x4b847c<_0x27aa27;_0x4b847c++){var _0x3f8796=events[_0x4b847c];var _0x6bb042=createListener(_0xa0ff('0x5')+_0x3f8796,_0xdd652);OpenchannelInteractionEvents['on'](_0x3f8796,_0x6bb042);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index de05f8e..631acfb 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 _0x81df=['show','tracked','openchannel','openchannelmessage:create','create','/:id','update','put','/:id/accept','reject','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x509239,_0x4fab00){var _0x39eae0=function(_0x5b4cf4){while(--_0x5b4cf4){_0x509239['push'](_0x509239['shift']());}};_0x39eae0(++_0x4fab00);}(_0x81df,0x170));var _0xf81d=function(_0x51c940,_0x2ca1c4){_0x51c940=_0x51c940-0x0;var _0x4d7029=_0x81df[_0x51c940];return _0x4d7029;};'use strict';var multer=require(_0xf81d('0x0'));var util=require('util');var path=require(_0xf81d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf81d('0x2')]();var auth=require(_0xf81d('0x3'));var interaction=require(_0xf81d('0x4'));var config=require(_0xf81d('0x5'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0xf81d('0x6')](),controller['index']);router[_0xf81d('0x7')](_0xf81d('0x8'),auth[_0xf81d('0x6')](),controller[_0xf81d('0x9')]);router[_0xf81d('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf81d('0xa')]);router['post']('/',auth[_0xf81d('0x6')](),interaction[_0xf81d('0xb')](_0xf81d('0xc'),_0xf81d('0xd')),controller[_0xf81d('0xe')]);router['put'](_0xf81d('0xf'),auth[_0xf81d('0x6')](),controller[_0xf81d('0x10')]);router[_0xf81d('0x11')](_0xf81d('0x12'),auth[_0xf81d('0x6')](),controller['accept']);router[_0xf81d('0x11')]('/:id/reject',auth[_0xf81d('0x6')](),controller[_0xf81d('0x13')]);router['delete'](_0xf81d('0xf'),auth[_0xf81d('0x6')](),controller[_0xf81d('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb9d8=['destroy','path','express','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','get','describe','/:id','show','post','create','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x38d354,_0x322ab7){var _0x2eeb1a=function(_0xba8b8e){while(--_0xba8b8e){_0x38d354['push'](_0x38d354['shift']());}};_0x2eeb1a(++_0x322ab7);}(_0xb9d8,0x166));var _0x8b9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b9d('0x0'));var timeout=require('connect-timeout');var express=require(_0x8b9d('0x1'));var router=express[_0x8b9d('0x2')]();var auth=require(_0x8b9d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8b9d('0x4'));var controller=require(_0x8b9d('0x5'));router['get']('/',auth[_0x8b9d('0x6')](),controller['index']);router[_0x8b9d('0x7')]('/describe',auth[_0x8b9d('0x6')](),controller[_0x8b9d('0x8')]);router[_0x8b9d('0x7')](_0x8b9d('0x9'),auth[_0x8b9d('0x6')](),controller[_0x8b9d('0xa')]);router[_0x8b9d('0xb')]('/',auth[_0x8b9d('0x6')](),interaction['tracked']('openchannel','openchannelmessage:create'),controller[_0x8b9d('0xc')]);router[_0x8b9d('0xd')]('/:id',auth[_0x8b9d('0x6')](),controller[_0x8b9d('0xe')]);router[_0x8b9d('0xd')](_0x8b9d('0xf'),auth['isAuthenticated'](),controller[_0x8b9d('0x10')]);router[_0x8b9d('0xd')](_0x8b9d('0x11'),auth[_0x8b9d('0x6')](),controller[_0x8b9d('0x12')]);router[_0x8b9d('0x13')](_0x8b9d('0x9'),auth[_0x8b9d('0x6')](),controller[_0x8b9d('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 431172f..6fd6f0b 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 _0xd9d2=['sequelize','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x970ecf,_0x5f35ad){var _0x3dec37=function(_0x105993){while(--_0x105993){_0x970ecf['push'](_0x970ecf['shift']());}};_0x3dec37(++_0x5f35ad);}(_0xd9d2,0x17a));var _0x2d9d=function(_0x3bc188,_0x374a54){_0x3bc188=_0x3bc188-0x0;var _0x50306f=_0xd9d2[_0x3bc188];return _0x50306f;};'use strict';var Sequelize=require(_0x2d9d('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2d9d('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x2d9d('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2d9d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d9d('0x3')]('in',_0x2d9d('0x4')),'defaultValue':_0x2d9d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2d9d('0x5')]}}; \ No newline at end of file +var _0x1ef4=['medium','BOOLEAN','ENUM','out','exports'];(function(_0x5bc9c3,_0x4168c4){var _0x758fa6=function(_0x5d99f6){while(--_0x5d99f6){_0x5bc9c3['push'](_0x5bc9c3['shift']());}};_0x758fa6(++_0x4168c4);}(_0x1ef4,0xfe));var _0x41ef=function(_0x28f634,_0x35386f){_0x28f634=_0x28f634-0x0;var _0x10872d=_0x1ef4[_0x28f634];return _0x10872d;};'use strict';var Sequelize=require('sequelize');module[_0x41ef('0x0')]={'body':{'type':Sequelize['TEXT'](_0x41ef('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x41ef('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x41ef('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x41ef('0x3')]('in',_0x41ef('0x4')),'defaultValue':_0x41ef('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 82560fb..ffebe72 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 _0xedd9=['socket.io-emitter','register','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~!@#$%^&-_=+[{]}.','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','catch','show','params','find','create','body','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','openchannel','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x283386,_0x195525){var _0x2ddd75=function(_0x160b29){while(--_0x160b29){_0x283386['push'](_0x283386['shift']());}};_0x2ddd75(++_0x195525);}(_0xedd9,0x1c5));var _0x9edd=function(_0x28f4c2,_0x1479c4){_0x28f4c2=_0x28f4c2-0x0;var _0x12d573=_0xedd9[_0x28f4c2];return _0x12d573;};'use strict';var pdf=require(_0x9edd('0x0'));var emlformat=require(_0x9edd('0x1'));var rimraf=require(_0x9edd('0x2'));var zipdir=require(_0x9edd('0x3'));var jsonpatch=require(_0x9edd('0x4'));var rp=require('request-promise');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(_0x9edd('0xc'));var squel=require(_0x9edd('0xd'));var crypto=require(_0x9edd('0xe'));var jsforce=require(_0x9edd('0xf'));var deskjs=require(_0x9edd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9edd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9edd('0x12'));var hardwareService=require(_0x9edd('0x13'));var logger=require(_0x9edd('0x14'))('api');var utils=require(_0x9edd('0x15'));var config=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];config[_0x9edd('0x18')]=_[_0x9edd('0x19')](config[_0x9edd('0x18')],{'host':_0x9edd('0x1a'),'port':0x18eb});var socket=require(_0x9edd('0x1b'))(new Redis(config[_0x9edd('0x18')]));require('./openchannelMessage.socket')[_0x9edd('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9edd('0x1d')][_0x9edd('0x1e')]({'port':0x232c});var client9002=jayson[_0x9edd('0x1d')][_0x9edd('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x139afe,_0x1e29aa,_0x245f00){if(_0x245f00){var _0x2654ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2654ad[_0x9edd('0x1f')](_0x1e29aa)){return _0x139afe;}else{throw new db[(_0x9edd('0x20'))][(_0x9edd('0x21'))](_0x9edd('0x22'));}}else{return _0x139afe;}}function respondWithRpcPromise(_0xed4a93,_0x4d0447,_0x49fd20,_0x364b69){return new BPromise(function(_0x356a23,_0x4ca261){var _0x4af725=_0x364b69||client;return _0x4af725['request'](_0xed4a93,_0x49fd20)['then'](function(_0xe67958){logger[_0x9edd('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d0447,_0x9edd('0x24'));logger['debug'](_0x9edd('0x25'),_0x4d0447,_0x9edd('0x24'),JSON[_0x9edd('0x26')](_0xe67958));if(_0xe67958[_0x9edd('0x27')]){if(_0xe67958[_0x9edd('0x27')][_0x9edd('0x28')]===0x1f4){logger[_0x9edd('0x27')](_0x9edd('0x29'),_0x4d0447,_0xe67958[_0x9edd('0x27')][_0x9edd('0x2a')]);return _0x4ca261(_0xe67958[_0x9edd('0x27')][_0x9edd('0x2a')]);}logger['error'](_0x9edd('0x29'),_0x4d0447,_0xe67958['error'][_0x9edd('0x2a')]);return _0x356a23(_0xe67958[_0x9edd('0x27')][_0x9edd('0x2a')]);}else{logger[_0x9edd('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d0447,_0x9edd('0x24'));_0x356a23(_0xe67958['result']['message']);}})['catch'](function(_0x56e7a1){logger['error'](_0x9edd('0x29'),_0x4d0447,_0x56e7a1);_0x4ca261(_0x56e7a1);});});}function respondWithStatusCode(_0x524c99,_0x4f3b1d){_0x4f3b1d=_0x4f3b1d||0xcc;return function(_0x3f78db){if(_0x3f78db){return _0x524c99[_0x9edd('0x2b')](_0x4f3b1d);}return _0x524c99[_0x9edd('0x2c')](_0x4f3b1d)[_0x9edd('0x2d')]();};}function respondWithResult(_0x5b9716,_0x232f2f){_0x232f2f=_0x232f2f||0xc8;return function(_0x3aec6d){if(_0x3aec6d){return _0x5b9716['status'](_0x232f2f)['json'](_0x3aec6d);}};}function respondWithFilteredResult(_0x3f4894,_0x1dbdac){return function(_0x1ec855){if(_0x1ec855){var _0x12dd91=_0x1ec855[_0x9edd('0x2e')],_0x5a30f0=_0x1dbdac[_0x9edd('0x2f')],_0x34715f=_0x1dbdac['offset']+_0x1dbdac[_0x9edd('0x30')],_0x151991;if(_0x34715f>=_0x12dd91){_0x34715f=_0x12dd91;_0x151991=0xc8;}else{_0x151991=0xce;}_0x3f4894['status'](_0x151991);return _0x3f4894[_0x9edd('0x31')](_0x9edd('0x32'),_0x5a30f0+'-'+_0x34715f+'/'+_0x12dd91)['json'](_0x1ec855);}return null;};}function patchUpdates(_0x3fd477){return function(_0x1f8766){try{jsonpatch[_0x9edd('0x33')](_0x1f8766,_0x3fd477,!![]);}catch(_0x3a4041){return BPromise[_0x9edd('0x34')](_0x3a4041);}return _0x1f8766[_0x9edd('0x35')]();};}function saveUpdates(_0x459ba7,_0x371bf2){return function(_0x194d35){if(_0x194d35){return _0x194d35[_0x9edd('0x36')](_0x459ba7)[_0x9edd('0x37')](function(_0x28c87a){return _0x28c87a;});}return null;};}function removeEntity(_0x2537db,_0x561361){return function(_0x346741){if(_0x346741){return _0x346741[_0x9edd('0x38')]()['then'](function(){_0x2537db[_0x9edd('0x2c')](0xcc)[_0x9edd('0x2d')]();});}};}function handleEntityNotFound(_0x581903,_0x1385d0){return function(_0x4bc3cc){if(!_0x4bc3cc){_0x581903[_0x9edd('0x2b')](0x194);}return _0x4bc3cc;};}function handleError(_0x22f5fe,_0x128573){_0x128573=_0x128573||0x1f4;return function(_0x19744d){logger[_0x9edd('0x27')](_0x19744d[_0x9edd('0x39')]);if(_0x19744d[_0x9edd('0x3a')]){delete _0x19744d['name'];}_0x22f5fe[_0x9edd('0x2c')](_0x128573)[_0x9edd('0x3b')](_0x19744d);};}exports['index']=function(_0x45def9,_0x4ff6d7){var _0xde8a42={},_0x7574f6={},_0x2a5c39={'count':0x0,'rows':[]};var _0xf7176c=_[_0x9edd('0x3c')](db[_0x9edd('0x3d')][_0x9edd('0x3e')],function(_0x5be513){return{'name':_0x5be513[_0x9edd('0x3f')],'type':_0x5be513['type'][_0x9edd('0x40')]};});_0x7574f6[_0x9edd('0x41')]=_[_0x9edd('0x3c')](_0xf7176c,'name');_0x7574f6[_0x9edd('0x42')]=_[_0x9edd('0x43')](_0x45def9['query']);_0x7574f6[_0x9edd('0x44')]=_[_0x9edd('0x45')](_0x7574f6[_0x9edd('0x41')],_0x7574f6[_0x9edd('0x42')]);_0xde8a42[_0x9edd('0x46')]=_[_0x9edd('0x45')](_0x7574f6[_0x9edd('0x41')],qs[_0x9edd('0x47')](_0x45def9[_0x9edd('0x42')]['fields']));_0xde8a42[_0x9edd('0x46')]=_0xde8a42[_0x9edd('0x46')][_0x9edd('0x48')]?_0xde8a42[_0x9edd('0x46')]:_0x7574f6[_0x9edd('0x41')];if(!_0x45def9[_0x9edd('0x42')][_0x9edd('0x49')](_0x9edd('0x4a'))){_0xde8a42[_0x9edd('0x30')]=qs['limit'](_0x45def9['query'][_0x9edd('0x30')]);_0xde8a42[_0x9edd('0x2f')]=qs[_0x9edd('0x2f')](_0x45def9[_0x9edd('0x42')]['offset']);}_0xde8a42[_0x9edd('0x4b')]=qs[_0x9edd('0x4c')](_0x45def9[_0x9edd('0x42')]['sort']);_0xde8a42[_0x9edd('0x4d')]=qs[_0x9edd('0x44')](_[_0x9edd('0x4e')](_0x45def9[_0x9edd('0x42')],_0x7574f6[_0x9edd('0x44')]),_0xf7176c);if(_0x45def9[_0x9edd('0x42')][_0x9edd('0x4f')]){_0xde8a42[_0x9edd('0x4d')]=_[_0x9edd('0x50')](_0xde8a42['where'],{'$or':_[_0x9edd('0x3c')](_0xf7176c,function(_0x157dc0){if(_0x157dc0[_0x9edd('0x51')]!=='VIRTUAL'){var _0x4ed1ab={};_0x4ed1ab[_0x157dc0['name']]={'$like':'%'+_0x45def9[_0x9edd('0x42')][_0x9edd('0x4f')]+'%'};return _0x4ed1ab;}})});}_0xde8a42=_['merge']({},_0xde8a42,_0x45def9[_0x9edd('0x52')]);var _0x3aacd3={'where':_0xde8a42[_0x9edd('0x4d')]};return db['OpenchannelMessage'][_0x9edd('0x2e')](_0x3aacd3)[_0x9edd('0x37')](function(_0x58a5f7){_0x2a5c39[_0x9edd('0x2e')]=_0x58a5f7;if(_0x45def9['query'][_0x9edd('0x53')]){_0xde8a42[_0x9edd('0x54')]=[{'all':!![]}];}return db[_0x9edd('0x3d')]['findAll'](_0xde8a42);})[_0x9edd('0x37')](function(_0x53adae){_0x2a5c39['rows']=_0x53adae;return _0x2a5c39;})[_0x9edd('0x37')](respondWithFilteredResult(_0x4ff6d7,_0xde8a42))[_0x9edd('0x55')](handleError(_0x4ff6d7,null));};exports[_0x9edd('0x56')]=function(_0x7a518f,_0x330960){var _0x1761ed={'raw':!![],'where':{'id':_0x7a518f[_0x9edd('0x57')]['id']}},_0x4f29b6={};_0x4f29b6[_0x9edd('0x41')]=_[_0x9edd('0x43')](db[_0x9edd('0x3d')]['rawAttributes']);_0x4f29b6['query']=_[_0x9edd('0x43')](_0x7a518f[_0x9edd('0x42')]);_0x4f29b6[_0x9edd('0x44')]=_[_0x9edd('0x45')](_0x4f29b6['model'],_0x4f29b6['query']);_0x1761ed[_0x9edd('0x46')]=_[_0x9edd('0x45')](_0x4f29b6[_0x9edd('0x41')],qs['fields'](_0x7a518f[_0x9edd('0x42')][_0x9edd('0x47')]));_0x1761ed['attributes']=_0x1761ed[_0x9edd('0x46')][_0x9edd('0x48')]?_0x1761ed[_0x9edd('0x46')]:_0x4f29b6[_0x9edd('0x41')];if(_0x7a518f['query'][_0x9edd('0x53')]){_0x1761ed[_0x9edd('0x54')]=[{'all':!![]}];}_0x1761ed=_[_0x9edd('0x50')]({},_0x1761ed,_0x7a518f['options']);return db[_0x9edd('0x3d')][_0x9edd('0x58')](_0x1761ed)[_0x9edd('0x37')](handleEntityNotFound(_0x330960,null))['then'](respondWithResult(_0x330960,null))[_0x9edd('0x55')](handleError(_0x330960,null));};exports['create']=function(_0x15a8d2,_0xa3eb90){return db['OpenchannelMessage'][_0x9edd('0x59')](_0x15a8d2[_0x9edd('0x5a')],{})[_0x9edd('0x37')](respondWithResult(_0xa3eb90,0xc9))[_0x9edd('0x55')](handleError(_0xa3eb90,null));};exports[_0x9edd('0x36')]=function(_0x9b25ea,_0x19586e){if(_0x9b25ea[_0x9edd('0x5a')]['id']){delete _0x9b25ea[_0x9edd('0x5a')]['id'];}return db[_0x9edd('0x3d')][_0x9edd('0x58')]({'where':{'id':_0x9b25ea['params']['id']}})['then'](handleEntityNotFound(_0x19586e,null))[_0x9edd('0x37')](saveUpdates(_0x9b25ea[_0x9edd('0x5a')],null))[_0x9edd('0x37')](respondWithResult(_0x19586e,null))[_0x9edd('0x55')](handleError(_0x19586e,null));};exports[_0x9edd('0x38')]=function(_0x1728ed,_0x568352){return db[_0x9edd('0x3d')][_0x9edd('0x58')]({'where':{'id':_0x1728ed[_0x9edd('0x57')]['id']}})[_0x9edd('0x37')](handleEntityNotFound(_0x568352,null))[_0x9edd('0x37')](removeEntity(_0x568352,null))['catch'](handleError(_0x568352,null));};exports[_0x9edd('0x5b')]=function(_0x1bf6ad,_0x5b4103){return db[_0x9edd('0x3d')][_0x9edd('0x5b')]()['then'](respondWithResult(_0x5b4103,null))['catch'](handleError(_0x5b4103,null));};var interaction_log=require(_0x9edd('0x14'))(_0x9edd('0x5c'));exports[_0x9edd('0x5d')]=function(_0x1ac8b0,_0x496c1d,_0x4e34a5){var _0x26b7ac={'channel':'openchannel'};if(_0x1ac8b0['body']['id']){delete _0x1ac8b0[_0x9edd('0x5a')]['id'];}_0x1ac8b0['body'][_0x9edd('0x5e')]=!![];_0x1ac8b0[_0x9edd('0x5a')]['readAt']=moment()[_0x9edd('0x5f')](_0x9edd('0x60'));_0x1ac8b0[_0x9edd('0x5a')]['UserId']=_0x1ac8b0['body'][_0x9edd('0x61')]||_0x1ac8b0[_0x9edd('0x62')]['id'];return db[_0x9edd('0x3d')]['find']({'where':{'id':_0x1ac8b0['params']['id'],'UserId':null},'include':[{'model':db[_0x9edd('0x63')],'as':_0x9edd('0x64')}]})[_0x9edd('0x37')](handleEntityNotFound(_0x496c1d,null))[_0x9edd('0x37')](saveUpdates(_0x1ac8b0[_0x9edd('0x5a')],null))[_0x9edd('0x37')](function(_0x5f14e1){if(_0x5f14e1){_0x26b7ac[_0x9edd('0x2a')]=_0x5f14e1[_0x9edd('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x9edd('0x58')]({'where':{'id':_0x5f14e1['OpenchannelInteractionId']}});}return null;})[_0x9edd('0x37')](handleEntityNotFound(_0x496c1d,null))['then'](function(_0x15b2f6){if(_0x15b2f6){return _0x15b2f6[_0x9edd('0x36')]({'UserId':_0x1ac8b0[_0x9edd('0x5a')][_0x9edd('0x61')],'read1stAt':_[_0x9edd('0x66')](_0x15b2f6[_0x9edd('0x67')])?moment()[_0x9edd('0x5f')](_0x9edd('0x60')):undefined});}return null;})[_0x9edd('0x37')](function(_0x210a1b){if(_0x210a1b){_0x26b7ac[_0x9edd('0x68')]=_0x210a1b['get']({'plain':!![]});interaction_log[_0x9edd('0x23')](_0x9edd('0x69'),_0x1ac8b0[_0x9edd('0x62')]['id'],_0x1ac8b0[_0x9edd('0x62')][_0x9edd('0x3a')],_0x1ac8b0[_0x9edd('0x62')][_0x9edd('0x6a')],_0x26b7ac['interaction']['id'],_0x1ac8b0[_0x9edd('0x5a')]?JSON['stringify'](_0x1ac8b0[_0x9edd('0x5a')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9edd('0x6b'),_0x26b7ac);}return null;})[_0x9edd('0x37')](function(_0x4e3d02){if(_0x4e3d02){if(_0x1ac8b0[_0x9edd('0x5a')][_0x9edd('0x6c')]){_0x26b7ac[_0x9edd('0x2a')][_0x9edd('0x6d')]=util[_0x9edd('0x5f')](_0x9edd('0x6e'),_0x1ac8b0[_0x9edd('0x62')][_0x9edd('0x3a')]);_0x26b7ac['message']['channel']=_0x26b7ac[_0x9edd('0x6f')];_0x26b7ac[_0x9edd('0x2a')][_0x9edd('0x70')]=_0x9edd('0x5d');return respondWithRpcPromise('EventManager',_0x9edd('0x71'),{'event':'acceptmessage','message':_0x26b7ac[_0x9edd('0x2a')]},client9002)[_0x9edd('0x37')](function(){return _0x26b7ac;});}return _0x26b7ac;}return null;})[_0x9edd('0x37')](respondWithResult(_0x496c1d,null))[_0x9edd('0x55')](handleError(_0x496c1d,null));};var interaction_log=require(_0x9edd('0x14'))('openchannel-interactions');exports[_0x9edd('0x34')]=function(_0x3e186a,_0x2cf96d,_0x19863d){var _0x57aa51={'agent':{},'channel':_0x9edd('0x72')};if(_0x3e186a[_0x9edd('0x5a')]['id']){delete _0x3e186a[_0x9edd('0x5a')]['id'];}_0x3e186a[_0x9edd('0x5a')][_0x9edd('0x61')]=_0x3e186a[_0x9edd('0x5a')][_0x9edd('0x61')]||_0x3e186a[_0x9edd('0x62')]['id'];_0x57aa51[_0x9edd('0x73')]['id']=_0x3e186a['body'][_0x9edd('0x61')];return db[_0x9edd('0x3d')][_0x9edd('0x58')]({'where':{'id':_0x3e186a[_0x9edd('0x57')]['id'],'UserId':null}})[_0x9edd('0x37')](handleEntityNotFound(_0x2cf96d,null))[_0x9edd('0x37')](function(_0x282843){if(_0x282843){_0x57aa51[_0x9edd('0x2a')]=_0x282843['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x9edd('0x58')]({'where':{'id':_0x282843[_0x9edd('0x74')]}});}return null;})[_0x9edd('0x37')](handleEntityNotFound(_0x2cf96d,null))['then'](function(_0x238ec4){if(_0x238ec4){_0x57aa51['interaction']=_0x238ec4['get']({'plain':!![]});interaction_log[_0x9edd('0x23')](_0x9edd('0x75'),_0x3e186a['user']['id'],_0x3e186a['user'][_0x9edd('0x3a')],_0x3e186a[_0x9edd('0x62')][_0x9edd('0x6a')],_0x57aa51[_0x9edd('0x68')]['id'],_0x3e186a[_0x9edd('0x5a')]?JSON[_0x9edd('0x26')](_0x3e186a[_0x9edd('0x5a')]):'null');return respondWithRpcPromise(_0x9edd('0x76'),'rejectMessage',_0x57aa51);}return null;})[_0x9edd('0x37')](function(_0x5088a8){if(_0x5088a8){_0x5088a8['message']['interface']=util[_0x9edd('0x5f')]('SIP/%s',_0x3e186a['user'][_0x9edd('0x3a')]);_0x5088a8[_0x9edd('0x2a')]['channel']=_0x57aa51[_0x9edd('0x6f')];_0x5088a8['message']['event']=_0x9edd('0x34');respondWithRpcPromise(_0x9edd('0x71'),_0x9edd('0x71'),{'event':_0x9edd('0x77'),'message':_0x5088a8['message']},client9002);return _0x57aa51;}return null;})['then'](respondWithResult(_0x2cf96d,null))[_0x9edd('0x55')](handleError(_0x2cf96d,null));}; \ No newline at end of file +var _0x05ce=['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','redis','defaults','localhost','socket.io-emitter','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','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','pick','filter','where','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','rows','params','merge','find','create','body','destroy','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','update','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','openchannel-interactions','OpenchannelInteractionId','RejectMessage','rejectMessage','EventManager','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto'];(function(_0x455dd2,_0x56e6ef){var _0x13d632=function(_0x4f5a00){while(--_0x4f5a00){_0x455dd2['push'](_0x455dd2['shift']());}};_0x13d632(++_0x56e6ef);}(_0x05ce,0x15b));var _0xe05c=function(_0x426bb4,_0x49edf3){_0x426bb4=_0x426bb4-0x0;var _0x43a334=_0x05ce[_0x426bb4];return _0x43a334;};'use strict';var pdf=require(_0xe05c('0x0'));var emlformat=require(_0xe05c('0x1'));var rimraf=require(_0xe05c('0x2'));var zipdir=require(_0xe05c('0x3'));var jsonpatch=require(_0xe05c('0x4'));var rp=require(_0xe05c('0x5'));var moment=require('moment');var BPromise=require(_0xe05c('0x6'));var Mustache=require(_0xe05c('0x7'));var util=require(_0xe05c('0x8'));var path=require('path');var sox=require(_0xe05c('0x9'));var csv=require(_0xe05c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe05c('0xb'));var squel=require('squel');var crypto=require(_0xe05c('0xc'));var jsforce=require(_0xe05c('0xd'));var deskjs=require(_0xe05c('0xe'));var toCsv=require(_0xe05c('0xa'));var querystring=require(_0xe05c('0xf'));var Papa=require(_0xe05c('0x10'));var Redis=require(_0xe05c('0x11'));var authService=require(_0xe05c('0x12'));var qs=require(_0xe05c('0x13'));var as=require(_0xe05c('0x14'));var hardwareService=require(_0xe05c('0x15'));var logger=require(_0xe05c('0x16'))(_0xe05c('0x17'));var utils=require(_0xe05c('0x18'));var config=require(_0xe05c('0x19'));var db=require(_0xe05c('0x1a'))['db'];config[_0xe05c('0x1b')]=_[_0xe05c('0x1c')](config[_0xe05c('0x1b')],{'host':_0xe05c('0x1d'),'port':0x18eb});var socket=require(_0xe05c('0x1e'))(new Redis(config[_0xe05c('0x1b')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xe05c('0x1f'));var client=jayson[_0xe05c('0x20')][_0xe05c('0x21')]({'port':0x232c});var client9002=jayson[_0xe05c('0x20')][_0xe05c('0x21')]({'port':0x232a});function checkPasswordPattern(_0x3e4da2,_0x24056d,_0x155c27){if(_0x155c27){var _0x2ae336=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae336[_0xe05c('0x22')](_0x24056d)){return _0x3e4da2;}else{throw new db[(_0xe05c('0x23'))][(_0xe05c('0x24'))](_0xe05c('0x25'));}}else{return _0x3e4da2;}}function respondWithRpcPromise(_0x267836,_0x5592bd,_0x20c16a,_0x192edf){return new BPromise(function(_0x29e064,_0x527bdc){var _0x29ae32=_0x192edf||client;return _0x29ae32[_0xe05c('0x26')](_0x267836,_0x20c16a)[_0xe05c('0x27')](function(_0x3815b5){logger[_0xe05c('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x5592bd,_0xe05c('0x29'));logger[_0xe05c('0x2a')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5592bd,_0xe05c('0x29'),JSON['stringify'](_0x3815b5));if(_0x3815b5[_0xe05c('0x2b')]){if(_0x3815b5['error']['code']===0x1f4){logger['error'](_0xe05c('0x2c'),_0x5592bd,_0x3815b5[_0xe05c('0x2b')]['message']);return _0x527bdc(_0x3815b5['error'][_0xe05c('0x2d')]);}logger[_0xe05c('0x2b')](_0xe05c('0x2c'),_0x5592bd,_0x3815b5[_0xe05c('0x2b')][_0xe05c('0x2d')]);return _0x29e064(_0x3815b5[_0xe05c('0x2b')][_0xe05c('0x2d')]);}else{logger[_0xe05c('0x28')](_0xe05c('0x2c'),_0x5592bd,'request\x20sent');_0x29e064(_0x3815b5[_0xe05c('0x2e')]['message']);}})[_0xe05c('0x2f')](function(_0x3b3c5e){logger['error'](_0xe05c('0x2c'),_0x5592bd,_0x3b3c5e);_0x527bdc(_0x3b3c5e);});});}function respondWithStatusCode(_0x59a90e,_0x6cfb52){_0x6cfb52=_0x6cfb52||0xcc;return function(_0x56ff89){if(_0x56ff89){return _0x59a90e[_0xe05c('0x30')](_0x6cfb52);}return _0x59a90e[_0xe05c('0x31')](_0x6cfb52)[_0xe05c('0x32')]();};}function respondWithResult(_0x213c65,_0xf0df31){_0xf0df31=_0xf0df31||0xc8;return function(_0x13d819){if(_0x13d819){return _0x213c65[_0xe05c('0x31')](_0xf0df31)[_0xe05c('0x33')](_0x13d819);}};}function respondWithFilteredResult(_0x5bbc66,_0x392db8){return function(_0xa21146){if(_0xa21146){var _0x1ac7f4=_0xa21146[_0xe05c('0x34')],_0x580f00=_0x392db8['offset'],_0x2dbcac=_0x392db8[_0xe05c('0x35')]+_0x392db8[_0xe05c('0x36')],_0x4965a5;if(_0x2dbcac>=_0x1ac7f4){_0x2dbcac=_0x1ac7f4;_0x4965a5=0xc8;}else{_0x4965a5=0xce;}_0x5bbc66[_0xe05c('0x31')](_0x4965a5);return _0x5bbc66[_0xe05c('0x37')](_0xe05c('0x38'),_0x580f00+'-'+_0x2dbcac+'/'+_0x1ac7f4)[_0xe05c('0x33')](_0xa21146);}return null;};}function patchUpdates(_0x2ea97a){return function(_0x28f40c){try{jsonpatch[_0xe05c('0x39')](_0x28f40c,_0x2ea97a,!![]);}catch(_0x4d194f){return BPromise[_0xe05c('0x3a')](_0x4d194f);}return _0x28f40c['save']();};}function saveUpdates(_0x4c5bbc,_0x17831d){return function(_0x8f29ea){if(_0x8f29ea){return _0x8f29ea['update'](_0x4c5bbc)['then'](function(_0x5ac4f3){return _0x5ac4f3;});}return null;};}function removeEntity(_0x379800,_0x3a05c3){return function(_0x24f8c9){if(_0x24f8c9){return _0x24f8c9['destroy']()[_0xe05c('0x27')](function(){_0x379800['status'](0xcc)[_0xe05c('0x32')]();});}};}function handleEntityNotFound(_0x81c197,_0x434abd){return function(_0x588ce6){if(!_0x588ce6){_0x81c197[_0xe05c('0x30')](0x194);}return _0x588ce6;};}function handleError(_0x1a1d5f,_0x2a8960){_0x2a8960=_0x2a8960||0x1f4;return function(_0x2dc3ac){logger[_0xe05c('0x2b')](_0x2dc3ac['stack']);if(_0x2dc3ac['name']){delete _0x2dc3ac[_0xe05c('0x3b')];}_0x1a1d5f[_0xe05c('0x31')](_0x2a8960)[_0xe05c('0x3c')](_0x2dc3ac);};}exports['index']=function(_0x2e2ef5,_0x13217a){var _0x54c4d={},_0x30ad56={},_0x34f65e={'count':0x0,'rows':[]};var _0x106d60=_[_0xe05c('0x3d')](db['OpenchannelMessage'][_0xe05c('0x3e')],function(_0x5a4755){return{'name':_0x5a4755[_0xe05c('0x3f')],'type':_0x5a4755[_0xe05c('0x40')]['key']};});_0x30ad56[_0xe05c('0x41')]=_[_0xe05c('0x3d')](_0x106d60,_0xe05c('0x3b'));_0x30ad56[_0xe05c('0x42')]=_[_0xe05c('0x43')](_0x2e2ef5[_0xe05c('0x42')]);_0x30ad56[_0xe05c('0x44')]=_[_0xe05c('0x45')](_0x30ad56[_0xe05c('0x41')],_0x30ad56[_0xe05c('0x42')]);_0x54c4d[_0xe05c('0x46')]=_[_0xe05c('0x45')](_0x30ad56[_0xe05c('0x41')],qs[_0xe05c('0x47')](_0x2e2ef5['query'][_0xe05c('0x47')]));_0x54c4d['attributes']=_0x54c4d[_0xe05c('0x46')][_0xe05c('0x48')]?_0x54c4d[_0xe05c('0x46')]:_0x30ad56[_0xe05c('0x41')];if(!_0x2e2ef5[_0xe05c('0x42')]['hasOwnProperty']('nolimit')){_0x54c4d['limit']=qs[_0xe05c('0x36')](_0x2e2ef5[_0xe05c('0x42')][_0xe05c('0x36')]);_0x54c4d[_0xe05c('0x35')]=qs[_0xe05c('0x35')](_0x2e2ef5[_0xe05c('0x42')][_0xe05c('0x35')]);}_0x54c4d[_0xe05c('0x49')]=qs['sort'](_0x2e2ef5[_0xe05c('0x42')]['sort']);_0x54c4d['where']=qs['filters'](_[_0xe05c('0x4a')](_0x2e2ef5['query'],_0x30ad56[_0xe05c('0x44')]),_0x106d60);if(_0x2e2ef5[_0xe05c('0x42')][_0xe05c('0x4b')]){_0x54c4d['where']=_['merge'](_0x54c4d[_0xe05c('0x4c')],{'$or':_[_0xe05c('0x3d')](_0x106d60,function(_0x5dec80){if(_0x5dec80[_0xe05c('0x40')]!==_0xe05c('0x4d')){var _0x381317={};_0x381317[_0x5dec80['name']]={'$like':'%'+_0x2e2ef5[_0xe05c('0x42')][_0xe05c('0x4b')]+'%'};return _0x381317;}})});}_0x54c4d=_['merge']({},_0x54c4d,_0x2e2ef5[_0xe05c('0x4e')]);var _0x22ac5a={'where':_0x54c4d[_0xe05c('0x4c')]};return db[_0xe05c('0x4f')][_0xe05c('0x34')](_0x22ac5a)[_0xe05c('0x27')](function(_0x43065f){_0x34f65e[_0xe05c('0x34')]=_0x43065f;if(_0x2e2ef5[_0xe05c('0x42')][_0xe05c('0x50')]){_0x54c4d[_0xe05c('0x51')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe05c('0x52')](_0x54c4d);})[_0xe05c('0x27')](function(_0x528b89){_0x34f65e[_0xe05c('0x53')]=_0x528b89;return _0x34f65e;})[_0xe05c('0x27')](respondWithFilteredResult(_0x13217a,_0x54c4d))[_0xe05c('0x2f')](handleError(_0x13217a,null));};exports['show']=function(_0x5c1a01,_0x5bc6f9){var _0x30b3d2={'raw':!![],'where':{'id':_0x5c1a01[_0xe05c('0x54')]['id']}},_0x533a44={};_0x533a44[_0xe05c('0x41')]=_[_0xe05c('0x43')](db[_0xe05c('0x4f')][_0xe05c('0x3e')]);_0x533a44[_0xe05c('0x42')]=_['keys'](_0x5c1a01[_0xe05c('0x42')]);_0x533a44[_0xe05c('0x44')]=_[_0xe05c('0x45')](_0x533a44[_0xe05c('0x41')],_0x533a44[_0xe05c('0x42')]);_0x30b3d2[_0xe05c('0x46')]=_[_0xe05c('0x45')](_0x533a44[_0xe05c('0x41')],qs[_0xe05c('0x47')](_0x5c1a01[_0xe05c('0x42')][_0xe05c('0x47')]));_0x30b3d2[_0xe05c('0x46')]=_0x30b3d2['attributes'][_0xe05c('0x48')]?_0x30b3d2[_0xe05c('0x46')]:_0x533a44[_0xe05c('0x41')];if(_0x5c1a01['query'][_0xe05c('0x50')]){_0x30b3d2[_0xe05c('0x51')]=[{'all':!![]}];}_0x30b3d2=_[_0xe05c('0x55')]({},_0x30b3d2,_0x5c1a01[_0xe05c('0x4e')]);return db[_0xe05c('0x4f')][_0xe05c('0x56')](_0x30b3d2)[_0xe05c('0x27')](handleEntityNotFound(_0x5bc6f9,null))['then'](respondWithResult(_0x5bc6f9,null))[_0xe05c('0x2f')](handleError(_0x5bc6f9,null));};exports[_0xe05c('0x57')]=function(_0x3381bd,_0x2fb6fa){return db[_0xe05c('0x4f')][_0xe05c('0x57')](_0x3381bd[_0xe05c('0x58')],{})[_0xe05c('0x27')](respondWithResult(_0x2fb6fa,0xc9))[_0xe05c('0x2f')](handleError(_0x2fb6fa,null));};exports['update']=function(_0x413e98,_0x595f33){if(_0x413e98[_0xe05c('0x58')]['id']){delete _0x413e98[_0xe05c('0x58')]['id'];}return db[_0xe05c('0x4f')][_0xe05c('0x56')]({'where':{'id':_0x413e98[_0xe05c('0x54')]['id']}})[_0xe05c('0x27')](handleEntityNotFound(_0x595f33,null))[_0xe05c('0x27')](saveUpdates(_0x413e98[_0xe05c('0x58')],null))[_0xe05c('0x27')](respondWithResult(_0x595f33,null))['catch'](handleError(_0x595f33,null));};exports[_0xe05c('0x59')]=function(_0x56ffb3,_0xe4d4bc){return db[_0xe05c('0x4f')]['find']({'where':{'id':_0x56ffb3[_0xe05c('0x54')]['id']}})['then'](handleEntityNotFound(_0xe4d4bc,null))[_0xe05c('0x27')](removeEntity(_0xe4d4bc,null))[_0xe05c('0x2f')](handleError(_0xe4d4bc,null));};exports[_0xe05c('0x5a')]=function(_0x229bf4,_0x2371dc){return db['OpenchannelMessage'][_0xe05c('0x5a')]()[_0xe05c('0x27')](respondWithResult(_0x2371dc,null))['catch'](handleError(_0x2371dc,null));};var interaction_log=require(_0xe05c('0x16'))('openchannel-interactions');exports[_0xe05c('0x5b')]=function(_0x26948b,_0x2e0312,_0x1d9030){var _0x5ae510={'channel':_0xe05c('0x5c')};if(_0x26948b[_0xe05c('0x58')]['id']){delete _0x26948b[_0xe05c('0x58')]['id'];}_0x26948b['body'][_0xe05c('0x5d')]=!![];_0x26948b['body'][_0xe05c('0x5e')]=moment()[_0xe05c('0x5f')](_0xe05c('0x60'));_0x26948b[_0xe05c('0x58')][_0xe05c('0x61')]=_0x26948b[_0xe05c('0x58')]['UserId']||_0x26948b[_0xe05c('0x62')]['id'];return db[_0xe05c('0x4f')][_0xe05c('0x56')]({'where':{'id':_0x26948b[_0xe05c('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xe05c('0x27')](handleEntityNotFound(_0x2e0312,null))['then'](saveUpdates(_0x26948b[_0xe05c('0x58')],null))[_0xe05c('0x27')](function(_0x455f1e){if(_0x455f1e){_0x5ae510[_0xe05c('0x2d')]=_0x455f1e[_0xe05c('0x63')]({'plain':!![]});return db[_0xe05c('0x64')][_0xe05c('0x56')]({'where':{'id':_0x455f1e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2e0312,null))['then'](function(_0x318b09){if(_0x318b09){return _0x318b09[_0xe05c('0x65')]({'UserId':_0x26948b[_0xe05c('0x58')][_0xe05c('0x61')],'read1stAt':_[_0xe05c('0x66')](_0x318b09[_0xe05c('0x67')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe05c('0x27')](function(_0x19bcab){if(_0x19bcab){_0x5ae510[_0xe05c('0x68')]=_0x19bcab[_0xe05c('0x63')]({'plain':!![]});interaction_log[_0xe05c('0x28')](_0xe05c('0x69'),_0x26948b['user']['id'],_0x26948b[_0xe05c('0x62')][_0xe05c('0x3b')],_0x26948b[_0xe05c('0x62')][_0xe05c('0x6a')],_0x5ae510[_0xe05c('0x68')]['id'],_0x26948b[_0xe05c('0x58')]?JSON[_0xe05c('0x6b')](_0x26948b[_0xe05c('0x58')]):_0xe05c('0x6c'));return respondWithRpcPromise(_0xe05c('0x6d'),_0xe05c('0x6e'),_0x5ae510);}return null;})[_0xe05c('0x27')](function(_0x3d099c){if(_0x3d099c){if(_0x26948b[_0xe05c('0x58')]['manual']){_0x5ae510[_0xe05c('0x2d')][_0xe05c('0x6f')]=util[_0xe05c('0x5f')](_0xe05c('0x70'),_0x26948b['user'][_0xe05c('0x3b')]);_0x5ae510['message'][_0xe05c('0x71')]=_0x5ae510[_0xe05c('0x71')];_0x5ae510[_0xe05c('0x2d')][_0xe05c('0x72')]=_0xe05c('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5ae510[_0xe05c('0x2d')]},client9002)[_0xe05c('0x27')](function(){return _0x5ae510;});}return _0x5ae510;}return null;})['then'](respondWithResult(_0x2e0312,null))[_0xe05c('0x2f')](handleError(_0x2e0312,null));};var interaction_log=require('../../config/logger')(_0xe05c('0x73'));exports[_0xe05c('0x3a')]=function(_0x3c10c7,_0x365644,_0x533019){var _0x1acb5c={'agent':{},'channel':_0xe05c('0x5c')};if(_0x3c10c7[_0xe05c('0x58')]['id']){delete _0x3c10c7[_0xe05c('0x58')]['id'];}_0x3c10c7[_0xe05c('0x58')]['UserId']=_0x3c10c7[_0xe05c('0x58')][_0xe05c('0x61')]||_0x3c10c7[_0xe05c('0x62')]['id'];_0x1acb5c['agent']['id']=_0x3c10c7[_0xe05c('0x58')][_0xe05c('0x61')];return db[_0xe05c('0x4f')][_0xe05c('0x56')]({'where':{'id':_0x3c10c7['params']['id'],'UserId':null}})[_0xe05c('0x27')](handleEntityNotFound(_0x365644,null))['then'](function(_0x3d6bf0){if(_0x3d6bf0){_0x1acb5c[_0xe05c('0x2d')]=_0x3d6bf0['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xe05c('0x56')]({'where':{'id':_0x3d6bf0[_0xe05c('0x74')]}});}return null;})[_0xe05c('0x27')](handleEntityNotFound(_0x365644,null))[_0xe05c('0x27')](function(_0x5c4d58){if(_0x5c4d58){_0x1acb5c[_0xe05c('0x68')]=_0x5c4d58[_0xe05c('0x63')]({'plain':!![]});interaction_log[_0xe05c('0x28')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c10c7[_0xe05c('0x62')]['id'],_0x3c10c7[_0xe05c('0x62')]['name'],_0x3c10c7['user'][_0xe05c('0x6a')],_0x1acb5c[_0xe05c('0x68')]['id'],_0x3c10c7[_0xe05c('0x58')]?JSON['stringify'](_0x3c10c7['body']):'null');return respondWithRpcPromise(_0xe05c('0x75'),_0xe05c('0x76'),_0x1acb5c);}return null;})[_0xe05c('0x27')](function(_0x293bd9){if(_0x293bd9){_0x293bd9[_0xe05c('0x2d')][_0xe05c('0x6f')]=util[_0xe05c('0x5f')](_0xe05c('0x70'),_0x3c10c7[_0xe05c('0x62')][_0xe05c('0x3b')]);_0x293bd9['message'][_0xe05c('0x71')]=_0x1acb5c[_0xe05c('0x71')];_0x293bd9[_0xe05c('0x2d')][_0xe05c('0x72')]=_0xe05c('0x3a');respondWithRpcPromise(_0xe05c('0x77'),_0xe05c('0x77'),{'event':'rejectmessage','message':_0x293bd9[_0xe05c('0x2d')]},client9002);return _0x1acb5c;}return null;})['then'](respondWithResult(_0x365644,null))['catch'](handleError(_0x365644,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 720b8a7..ad9db55 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 _0x4d24=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3c5e3f,_0x4da46f){var _0x5cd134=function(_0x353ac1){while(--_0x353ac1){_0x3c5e3f['push'](_0x3c5e3f['shift']());}};_0x5cd134(++_0x4da46f);}(_0x4d24,0x135));var _0x44d2=function(_0x23574a,_0x56231a){_0x23574a=_0x23574a-0x0;var _0x155559=_0x4d24[_0x23574a];return _0x155559;};'use strict';var EventEmitter=require(_0x44d2('0x0'));var OpenchannelMessage=require(_0x44d2('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x44d2('0x2')](0x0);var events={'afterCreate':_0x44d2('0x3'),'afterUpdate':_0x44d2('0x4'),'afterDestroy':_0x44d2('0x5')};function emitEvent(_0x3a1a9c){return function(_0x57f4f6,_0x1f6bee,_0x59700b){OpenchannelMessageEvents['emit'](_0x3a1a9c+':'+_0x57f4f6['id'],_0x57f4f6);OpenchannelMessageEvents[_0x44d2('0x6')](_0x3a1a9c,_0x57f4f6);_0x59700b(null);};}for(var e in events){if(events[_0x44d2('0x7')](e)){var event=events[e];OpenchannelMessage[_0x44d2('0x8')](e,emitEvent(event));}}module[_0x44d2('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x270f=['OpenchannelMessage','save','update','remove','emit','hasOwnProperty','events'];(function(_0x701566,_0x7de6cb){var _0x64b6c9=function(_0x7481f7){while(--_0x7481f7){_0x701566['push'](_0x701566['shift']());}};_0x64b6c9(++_0x7de6cb);}(_0x270f,0xe6));var _0xf270=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x270f[_0x5ef55a];return _0x20ae40;};'use strict';var EventEmitter=require(_0xf270('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0xf270('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf270('0x2'),'afterUpdate':_0xf270('0x3'),'afterDestroy':_0xf270('0x4')};function emitEvent(_0x56b58b){return function(_0x180186,_0x10c35f,_0xb7d3c5){OpenchannelMessageEvents[_0xf270('0x5')](_0x56b58b+':'+_0x180186['id'],_0x180186);OpenchannelMessageEvents[_0xf270('0x5')](_0x56b58b,_0x180186);_0xb7d3c5(null);};}for(var e in events){if(events[_0xf270('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 3526c8b..3c8df31 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 _0xfa75=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','out','secret','UserId','findOne','OpenchannelInteractionId','then','update','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','error','inspect','finally'];(function(_0x2c90c1,_0x446eda){var _0xcb55d4=function(_0x30e230){while(--_0x30e230){_0x2c90c1['push'](_0x2c90c1['shift']());}};_0xcb55d4(++_0x446eda);}(_0xfa75,0x101));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5fa7('0x0'));var util=require(_0x5fa7('0x1'));var logger=require(_0x5fa7('0x2'))('api');var moment=require(_0x5fa7('0x3'));var BPromise=require(_0x5fa7('0x4'));var rp=require(_0x5fa7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fa7('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fa7('0x7'));module['exports']=function(_0x215885,_0xb09ee9){return _0x215885['define'](_0x5fa7('0x8'),attributes,{'tableName':_0x5fa7('0x9'),'paranoid':![],'indexes':[{'name':_0x5fa7('0xa'),'fields':[_0x5fa7('0xb')],'type':_0x5fa7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ef61d,_0x8d0a27,_0xfb8c33){var _0x31fa06=_0x215885[_0x5fa7('0xd')];var _0x22e684=_0x2ef61d[_0x5fa7('0xe')]({'plain':!![]});if(_0x22e684[_0x5fa7('0xf')]['toLowerCase']()==='in'||_0x22e684['direction']['toLowerCase']()===_0x5fa7('0x10')&&!_0x22e684[_0x5fa7('0x11')]&&!_['isNil'](_0x22e684[_0x5fa7('0x12')])){_0x31fa06['OpenchannelInteraction'][_0x5fa7('0x13')]({'where':{'id':_0x22e684[_0x5fa7('0x14')]}})[_0x5fa7('0x15')](function(_0x4947ec){if(_0x4947ec){_0x4947ec[_0x5fa7('0x16')]({'lastMsgAt':_0x22e684['createdAt'],'lastMsgDirection':_0x22e684[_0x5fa7('0xf')]['toLowerCase']()});}})['catch'](function(_0x298894){console['error'](_0x298894);});}if(_0x22e684[_0x5fa7('0xf')]==='out'&&!_0x22e684[_0x5fa7('0x11')]){var _0x2c720c;_0x31fa06[_0x5fa7('0x17')][_0x5fa7('0x18')]()[_0x5fa7('0x15')](function(_0x3edccb){return _0x31fa06[_0x5fa7('0x19')][_0x5fa7('0x1a')]({'where':{'id':_0x22e684[_0x5fa7('0x1b')]},'include':[{'model':_0x31fa06[_0x5fa7('0x1c')],'as':'Interactions','where':{'id':_0x22e684[_0x5fa7('0x14')]},'limit':0x1,'include':[{'model':_0x31fa06[_0x5fa7('0x17')],'as':_0x5fa7('0x1d'),'attributes':_[_0x5fa7('0x1e')](_0x3edccb)}]}]});})[_0x5fa7('0x15')](function(_0x5b97e8){_0x2c720c=_0x5b97e8['get']({'plain':!![]});if(_0x2c720c&&_0x2c720c[_0x5fa7('0x1f')]){logger[_0x5fa7('0x20')](_0x5fa7('0x21'),_0x5fa7('0x22'),util[_0x5fa7('0x23')](_0x5fa7('0x24'),_0x22e684['id'],_0x2c720c[_0x5fa7('0x1f')]));if(_0x2c720c[_0x5fa7('0x25')]&&_0x2c720c[_0x5fa7('0x25')][_0x5fa7('0x26')]){_0x22e684[_0x5fa7('0x27')]=_[_0x5fa7('0x28')](_0x2c720c['Interactions'][0x0],_0x5fa7('0x1d'));_0x22e684[_0x5fa7('0x1d')]=_0x2c720c[_0x5fa7('0x25')][0x0][_0x5fa7('0x1d')];}var _0x8d0a27={'method':'POST','uri':encodeURI(_0x2c720c['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x8d0a27[_0x5fa7('0x29')]){case _0x5fa7('0x2a'):_0x8d0a27['qs']=_0x22e684;break;case'POST':_0x8d0a27[_0x5fa7('0xb')]=_0x22e684;break;}return rp(_0x8d0a27)[_0x5fa7('0x15')](function(_0x6fb55){logger[_0x5fa7('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x5fa7('0x22'),util['format'](_0x5fa7('0x2b'),_0x22e684['id'],_0x2c720c[_0x5fa7('0x1f')]));if(_0x6fb55[_0x5fa7('0xb')][_0x5fa7('0x2c')]&&_0x6fb55[_0x5fa7('0xb')][_0x5fa7('0x2c')]!=_0x22e684[_0x5fa7('0x27')][_0x5fa7('0x2c')]){return _0x31fa06['OpenchannelInteraction'][_0x5fa7('0x16')]({'threadId':_0x6fb55[_0x5fa7('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x22e684['Interaction']['id']}});}else{return;}})[_0x5fa7('0x15')](function(){return _0x2ef61d[_0x5fa7('0x16')]({'read':!![]});})[_0x5fa7('0x2d')](function(_0x18ea80){logger[_0x5fa7('0x2e')](_0x5fa7('0x21'),'afterCreate',util[_0x5fa7('0x2f')](_0x18ea80,{'showHidden':![],'depth':null}));_0xfb8c33();});}else{_0xfb8c33();}})[_0x5fa7('0x30')](function(){_0xfb8c33();});}else{_0xfb8c33();}}},'charset':_0x5fa7('0x31'),'collate':_0x5fa7('0x32')});}; \ No newline at end of file +var _0x700f=['describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteractionId','error','CmContact'];(function(_0x5e5cf1,_0x449311){var _0x5a3465=function(_0x564746){while(--_0x564746){_0x5e5cf1['push'](_0x5e5cf1['shift']());}};_0x5a3465(++_0x449311);}(_0x700f,0x1c8));var _0xf700=function(_0x49ac8f,_0x2ea640){_0x49ac8f=_0x49ac8f-0x0;var _0x4a92cc=_0x700f[_0x49ac8f];return _0x4a92cc;};'use strict';var _=require('lodash');var util=require(_0xf700('0x0'));var logger=require(_0xf700('0x1'))(_0xf700('0x2'));var moment=require(_0xf700('0x3'));var BPromise=require(_0xf700('0x4'));var rp=require(_0xf700('0x5'));var fs=require('fs');var path=require(_0xf700('0x6'));var rimraf=require('rimraf');var config=require(_0xf700('0x7'));var attributes=require(_0xf700('0x8'));module[_0xf700('0x9')]=function(_0x7e1c95,_0x3d2420){return _0x7e1c95[_0xf700('0xa')](_0xf700('0xb'),attributes,{'tableName':_0xf700('0xc'),'paranoid':![],'indexes':[{'name':_0xf700('0xd'),'fields':[_0xf700('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x399021,_0x211620,_0x49dfbb){var _0x285a1f=_0x7e1c95['models'];var _0xcacf0a=_0x399021[_0xf700('0xf')]({'plain':!![]});if(_0xcacf0a[_0xf700('0x10')][_0xf700('0x11')]()==='in'||_0xcacf0a[_0xf700('0x10')][_0xf700('0x11')]()===_0xf700('0x12')&&!_0xcacf0a[_0xf700('0x13')]&&!_['isNil'](_0xcacf0a[_0xf700('0x14')])){_0x285a1f['OpenchannelInteraction']['findOne']({'where':{'id':_0xcacf0a[_0xf700('0x15')]}})['then'](function(_0x36e261){if(_0x36e261){_0x36e261['update']({'lastMsgAt':_0xcacf0a['createdAt'],'lastMsgDirection':_0xcacf0a[_0xf700('0x10')][_0xf700('0x11')]()});}})['catch'](function(_0x8add57){console[_0xf700('0x16')](_0x8add57);});}if(_0xcacf0a[_0xf700('0x10')]==='out'&&!_0xcacf0a['secret']){var _0x31debb;_0x285a1f[_0xf700('0x17')][_0xf700('0x18')]()['then'](function(_0x5bc0bc){return _0x285a1f['OpenchannelAccount'][_0xf700('0x19')]({'where':{'id':_0xcacf0a[_0xf700('0x1a')]},'include':[{'model':_0x285a1f[_0xf700('0x1b')],'as':_0xf700('0x1c'),'where':{'id':_0xcacf0a[_0xf700('0x15')]},'limit':0x1,'include':[{'model':_0x285a1f[_0xf700('0x17')],'as':_0xf700('0x1d'),'attributes':_[_0xf700('0x1e')](_0x5bc0bc)}]}]});})['then'](function(_0x238237){_0x31debb=_0x238237[_0xf700('0xf')]({'plain':!![]});if(_0x31debb&&_0x31debb[_0xf700('0x1f')]){logger[_0xf700('0x20')](_0xf700('0x21'),_0xf700('0x22'),util[_0xf700('0x23')](_0xf700('0x24'),_0xcacf0a['id'],_0x31debb['replyUri']));if(_0x31debb[_0xf700('0x1c')]&&_0x31debb[_0xf700('0x1c')][_0xf700('0x25')]){_0xcacf0a[_0xf700('0x26')]=_[_0xf700('0x27')](_0x31debb[_0xf700('0x1c')][0x0],'Contact');_0xcacf0a[_0xf700('0x1d')]=_0x31debb['Interactions'][0x0][_0xf700('0x1d')];}var _0x211620={'method':'POST','uri':encodeURI(_0x31debb[_0xf700('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x211620[_0xf700('0x28')]){case _0xf700('0x29'):_0x211620['qs']=_0xcacf0a;break;case _0xf700('0x2a'):_0x211620[_0xf700('0xe')]=_0xcacf0a;break;}return rp(_0x211620)['then'](function(_0xc62130){logger[_0xf700('0x20')](_0xf700('0x21'),'afterCreate',util[_0xf700('0x23')](_0xf700('0x2b'),_0xcacf0a['id'],_0x31debb[_0xf700('0x1f')]));if(_0xc62130[_0xf700('0xe')][_0xf700('0x2c')]&&_0xc62130[_0xf700('0xe')]['threadId']!=_0xcacf0a['Interaction'][_0xf700('0x2c')]){return _0x285a1f[_0xf700('0x1b')][_0xf700('0x2d')]({'threadId':_0xc62130[_0xf700('0xe')][_0xf700('0x2c')]},{'logging':!![],'where':{'id':_0xcacf0a[_0xf700('0x26')]['id']}});}else{return;}})['then'](function(){return _0x399021[_0xf700('0x2d')]({'read':!![]});})['catch'](function(_0x3536fe){logger[_0xf700('0x16')](_0xf700('0x21'),'afterCreate',util['inspect'](_0x3536fe,{'showHidden':![],'depth':null}));_0x49dfbb();});}else{_0x49dfbb();}})['finally'](function(){_0x49dfbb();});}else{_0x49dfbb();}}},'charset':_0xf700('0x2e'),'collate':_0xf700('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e14081c..41c27f2 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 _0xcd2f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','CreateOpenchannelMessage','create','body','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcd2f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfcd2('0x0'));var rs=require(_0xfcd2('0x1'));var fs=require('fs');var Redis=require(_0xfcd2('0x2'));var db=require(_0xfcd2('0x3'))['db'];var utils=require(_0xfcd2('0x4'));var logger=require(_0xfcd2('0x5'))(_0xfcd2('0x6'));var config=require(_0xfcd2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfcd2('0x8')][_0xfcd2('0x9')]({'port':0x232a});config[_0xfcd2('0xa')]=_[_0xfcd2('0xb')](config[_0xfcd2('0xa')],{'host':_0xfcd2('0xc'),'port':0x18eb});var socket=require(_0xfcd2('0xd'))(new Redis(config[_0xfcd2('0xa')]));require(_0xfcd2('0xe'))[_0xfcd2('0xf')](socket);function respondWithRpcPromise(_0x3c4880,_0x53999a,_0x5994cf){return new BPromise(function(_0x18fa4d,_0x24cd5d){return client[_0xfcd2('0x10')](_0x3c4880,_0x5994cf)[_0xfcd2('0x11')](function(_0x53777e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x53999a,'request\x20sent');logger['debug'](_0xfcd2('0x12'),_0x53999a,_0xfcd2('0x13'),JSON['stringify'](_0x53777e));if(_0x53777e[_0xfcd2('0x14')]){if(_0x53777e[_0xfcd2('0x14')]['code']===0x1f4){logger['error'](_0xfcd2('0x15'),_0x53999a,_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);return _0x24cd5d(_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);}logger['error'](_0xfcd2('0x15'),_0x53999a,_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);return _0x18fa4d(_0x53777e[_0xfcd2('0x14')][_0xfcd2('0x16')]);}else{logger[_0xfcd2('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x53999a,_0xfcd2('0x13'));_0x18fa4d(_0x53777e[_0xfcd2('0x18')][_0xfcd2('0x16')]);}})[_0xfcd2('0x19')](function(_0x580184){logger[_0xfcd2('0x14')](_0xfcd2('0x15'),_0x53999a,_0x580184);_0x24cd5d(_0x580184);});});}exports[_0xfcd2('0x1a')]=function(_0x6bfdfc){var _0x40666e=this;return new Promise(function(_0x273a2a,_0x266c86){return db['OpenchannelMessage'][_0xfcd2('0x1b')](_0x6bfdfc[_0xfcd2('0x1c')],{'raw':_0x6bfdfc[_0xfcd2('0x1d')]?_0x6bfdfc[_0xfcd2('0x1d')][_0xfcd2('0x1e')]===undefined?!![]:![]:!![]})[_0xfcd2('0x11')](function(_0x19ea4a){logger[_0xfcd2('0x17')](_0xfcd2('0x1a'),_0x6bfdfc);logger['debug'](_0xfcd2('0x1a'),_0x6bfdfc,JSON['stringify'](_0x19ea4a));_0x273a2a(_0x19ea4a);})[_0xfcd2('0x19')](function(_0x9baa91){logger['error']('CreateOpenchannelMessage',_0x9baa91[_0xfcd2('0x16')],_0x6bfdfc);_0x266c86(_0x40666e[_0xfcd2('0x14')](0x1f4,_0x9baa91[_0xfcd2('0x16')]));});});}; \ No newline at end of file +var _0xbbbc=['CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','request','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x24a60f,_0x5ec8de){_0x24a60f=_0x24a60f-0x0;var _0x2ca7ea=_0xbbbc[_0x24a60f];return _0x2ca7ea;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')](_0x25e92f[_0xcbbb('0x1d')],{'raw':_0x25e92f['options']?_0x25e92f[_0xcbbb('0x1e')][_0xcbbb('0x1f')]===undefined?!![]:![]:!![]})[_0xcbbb('0x20')](function(_0x42aaf1){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x21')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x42aaf1));_0x1cca90(_0x42aaf1);})['catch'](function(_0xf39ddd){logger[_0xcbbb('0x16')]('CreateOpenchannelMessage',_0xf39ddd[_0xcbbb('0x18')],_0x25e92f);_0x45de5f(_0x658337['error'](0x1f4,_0xf39ddd['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 712a06c..1dc6871 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 _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xe706,0xa3));var _0x6e70=function(_0x353d3d,_0xc7ebc){_0x353d3d=_0x353d3d-0x0;var _0x1c5409=_0xe706[_0x353d3d];return _0x1c5409;};'use strict';var OpenchannelMessageEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){OpenchannelMessageEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);OpenchannelMessageEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file +var _0xb43b=['./openchannelMessage.events','save','update','emit','removeListener','length','openchannelMessage:'];(function(_0x116c04,_0x4963da){var _0x9e011d=function(_0x143880){while(--_0x143880){_0x116c04['push'](_0x116c04['shift']());}};_0x9e011d(++_0x4963da);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3e4def,_0x12301a){_0x3e4def=_0x3e4def-0x0;var _0x7360cb=_0xb43b[_0x3e4def];return _0x7360cb;};'use strict';var OpenchannelMessageEvents=require(_0xbb43('0x0'));var events=[_0xbb43('0x1'),'remove',_0xbb43('0x2')];function createListener(_0x1995f8,_0x22bc86){return function(_0x4cf605){_0x22bc86[_0xbb43('0x3')](_0x1995f8,_0x4cf605);};}function removeListener(_0x41aff6,_0x351254){return function(){OpenchannelMessageEvents[_0xbb43('0x4')](_0x41aff6,_0x351254);};}exports['register']=function(_0x491fb9){for(var _0x378df5=0x0,_0x553520=events[_0xbb43('0x5')];_0x378df5<_0x553520;_0x378df5++){var _0x1ccd49=events[_0x378df5];var _0x2a2f11=createListener(_0xbb43('0x6')+_0x1ccd49,_0x491fb9);OpenchannelMessageEvents['on'](_0x1ccd49,_0x2a2f11);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 451deb9..00b4843 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 _0xaeab=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','delete','destroy','removeTeams','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index'];(function(_0x1c7334,_0x69ec11){var _0x3bc5c6=function(_0x2e8634){while(--_0x2e8634){_0x1c7334['push'](_0x1c7334['shift']());}};_0x3bc5c6(++_0x69ec11);}(_0xaeab,0x91));var _0xbaea=function(_0x5c928b,_0x43cc19){_0x5c928b=_0x5c928b-0x0;var _0x579f4b=_0xaeab[_0x5c928b];return _0x579f4b;};'use strict';var multer=require(_0xbaea('0x0'));var util=require('util');var path=require(_0xbaea('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaea('0x2'));var router=express[_0xbaea('0x3')]();var auth=require(_0xbaea('0x4'));var interaction=require(_0xbaea('0x5'));var config=require(_0xbaea('0x6'));var controller=require(_0xbaea('0x7'));router[_0xbaea('0x8')]('/',auth[_0xbaea('0x9')](),controller[_0xbaea('0xa')]);router[_0xbaea('0x8')]('/describe',auth[_0xbaea('0x9')](),controller[_0xbaea('0xb')]);router[_0xbaea('0x8')](_0xbaea('0xc'),auth[_0xbaea('0x9')](),controller[_0xbaea('0xd')]);router[_0xbaea('0x8')](_0xbaea('0xe'),auth['isAuthenticated'](),controller[_0xbaea('0xf')]);router[_0xbaea('0x8')](_0xbaea('0x10'),auth[_0xbaea('0x9')](),controller[_0xbaea('0x11')]);router['get'](_0xbaea('0x12'),auth[_0xbaea('0x9')](),controller['getAgents']);router[_0xbaea('0x13')]('/',auth[_0xbaea('0x9')](),controller[_0xbaea('0x14')]);router[_0xbaea('0x13')](_0xbaea('0x10'),auth[_0xbaea('0x9')](),controller['addTeams']);router['post'](_0xbaea('0x12'),auth[_0xbaea('0x9')](),controller[_0xbaea('0x15')]);router[_0xbaea('0x16')](_0xbaea('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbaea('0x17')](_0xbaea('0xc'),auth['isAuthenticated'](),controller[_0xbaea('0x18')]);router[_0xbaea('0x17')](_0xbaea('0x10'),auth[_0xbaea('0x9')](),controller[_0xbaea('0x19')]);router[_0xbaea('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x8ef6=['../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3c9ff9,_0x3255a0){var _0x34a960=function(_0x36e310){while(--_0x36e310){_0x3c9ff9['push'](_0x3c9ff9['shift']());}};_0x34a960(++_0x3255a0);}(_0x8ef6,0xf2));var _0x68ef=function(_0x8c8b0e,_0x58cdb4){_0x8c8b0e=_0x8c8b0e-0x0;var _0xfc9e21=_0x8ef6[_0x8c8b0e];return _0xfc9e21;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['get'](_0x68ef('0xd'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xe')]);router[_0x68ef('0x9')](_0x68ef('0xf'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x9')](_0x68ef('0x11'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x9')]('/:id/users',auth[_0x68ef('0xa')](),controller[_0x68ef('0x13')]);router[_0x68ef('0x14')]('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0x15')]);router[_0x68ef('0x14')]('/:id/teams',auth[_0x68ef('0xa')](),controller[_0x68ef('0x16')]);router[_0x68ef('0x14')]('/:id/users',auth[_0x68ef('0xa')](),controller[_0x68ef('0x17')]);router[_0x68ef('0x18')]('/:id',auth[_0x68ef('0xa')](),controller[_0x68ef('0x19')]);router[_0x68ef('0x1a')](_0x68ef('0xd'),auth['isAuthenticated'](),controller[_0x68ef('0x1b')]);router['delete']('/:id/teams',auth[_0x68ef('0xa')](),controller[_0x68ef('0x1c')]);router['delete']('/:id/users',auth[_0x68ef('0xa')](),controller[_0x68ef('0x1d')]);module[_0x68ef('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index a758e95..d395637 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 _0x7f86=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7f86,0xea));var _0x67f8=function(_0x245b14,_0x4ecfd5){_0x245b14=_0x245b14-0x0;var _0x31dd58=_0x7f86[_0x245b14];return _0x31dd58;};'use strict';var Sequelize=require(_0x67f8('0x0'));module[_0x67f8('0x1')]={'name':{'type':Sequelize[_0x67f8('0x2')],'unique':_0x67f8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x67f8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x67f8('0x4')](_0x67f8('0x5'),_0x67f8('0x6'),_0x67f8('0x7'))}}; \ No newline at end of file +var _0xa5ab=['STRING','INTEGER','ENUM','roundrobin','sequelize','exports','name'];(function(_0x308e65,_0x50dd49){var _0x187503=function(_0x35fb84){while(--_0x35fb84){_0x308e65['push'](_0x308e65['shift']());}};_0x187503(++_0x50dd49);}(_0xa5ab,0xf2));var _0xba5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ab[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xba5a('0x0'));module[_0xba5a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xba5a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xba5a('0x3')]},'timeout':{'type':Sequelize[_0xba5a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba5a('0x5')]('rrmemory','beepall',_0xba5a('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index caa835e..b211726 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 _0x41c1=['fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','send','map','OpenchannelQueue','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserOpenchannelQueue','filter','agent','updatedAt','createdAt','format','%s/%s','openchannelPause','getTeams','addTeams','ids','Team','User','Agents','online','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format'];(function(_0xfef5e4,_0x1b049c){var _0x3a38d7=function(_0xabd1b7){while(--_0xabd1b7){_0xfef5e4['push'](_0xfef5e4['shift']());}};_0x3a38d7(++_0x1b049c);}(_0x41c1,0x199));var _0x141c=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x41c1[_0x2fdce0];return _0x36f07e;};'use strict';var pdf=require(_0x141c('0x0'));var emlformat=require(_0x141c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x141c('0x2'));var rp=require(_0x141c('0x3'));var moment=require(_0x141c('0x4'));var BPromise=require(_0x141c('0x5'));var Mustache=require(_0x141c('0x6'));var util=require(_0x141c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x141c('0x8'));var ejs=require(_0x141c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x141c('0xa'));var crypto=require('crypto');var jsforce=require(_0x141c('0xb'));var deskjs=require(_0x141c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x141c('0xd'));var Papa=require(_0x141c('0xe'));var Redis=require('ioredis');var authService=require(_0x141c('0xf'));var qs=require(_0x141c('0x10'));var as=require(_0x141c('0x11'));var hardwareService=require(_0x141c('0x12'));var logger=require(_0x141c('0x13'))(_0x141c('0x14'));var utils=require('../../config/utils');var config=require(_0x141c('0x15'));var db=require(_0x141c('0x16'))['db'];config['redis']=_[_0x141c('0x17')](config['redis'],{'host':_0x141c('0x18'),'port':0x18eb});var socket=require(_0x141c('0x19'))(new Redis(config[_0x141c('0x1a')]));require(_0x141c('0x1b'))['register'](socket);function respondWithStatusCode(_0x504d55,_0x1e365d){_0x1e365d=_0x1e365d||0xcc;return function(_0x2f5a17){if(_0x2f5a17){return _0x504d55['sendStatus'](_0x1e365d);}return _0x504d55[_0x141c('0x1c')](_0x1e365d)[_0x141c('0x1d')]();};}function respondWithResult(_0x306145,_0x44bd2e){_0x44bd2e=_0x44bd2e||0xc8;return function(_0x6c9592){if(_0x6c9592){return _0x306145[_0x141c('0x1c')](_0x44bd2e)[_0x141c('0x1e')](_0x6c9592);}};}function respondWithFilteredResult(_0x5ba362,_0x5c10c1){return function(_0x5a367e){if(_0x5a367e){var _0x4316b8=_0x5a367e[_0x141c('0x1f')],_0x1b13af=_0x5c10c1[_0x141c('0x20')],_0x12e28d=_0x5c10c1['offset']+_0x5c10c1['limit'],_0x2b59b8;if(_0x12e28d>=_0x4316b8){_0x12e28d=_0x4316b8;_0x2b59b8=0xc8;}else{_0x2b59b8=0xce;}_0x5ba362[_0x141c('0x1c')](_0x2b59b8);return _0x5ba362[_0x141c('0x21')](_0x141c('0x22'),_0x1b13af+'-'+_0x12e28d+'/'+_0x4316b8)[_0x141c('0x1e')](_0x5a367e);}return null;};}function patchUpdates(_0x13758c){return function(_0x482652){try{jsonpatch['apply'](_0x482652,_0x13758c,!![]);}catch(_0x5006f1){return BPromise[_0x141c('0x23')](_0x5006f1);}return _0x482652[_0x141c('0x24')]();};}function saveUpdates(_0x4abbde,_0x519483){return function(_0x3341a4){if(_0x3341a4){return _0x3341a4['update'](_0x4abbde)[_0x141c('0x25')](function(_0x5c62e2){return _0x5c62e2;});}return null;};}function removeEntity(_0x34924e,_0x422ea3){return function(_0x1697d6){if(_0x1697d6){return _0x1697d6[_0x141c('0x26')]()['then'](function(){var _0x3266e3=_0x1697d6[_0x141c('0x27')]({'plain':!![]});var _0x4c3b43=_0x141c('0x28');return db[_0x141c('0x29')][_0x141c('0x26')]({'where':{'type':_0x4c3b43,'resourceId':_0x3266e3['id']}})[_0x141c('0x25')](function(){return _0x1697d6;});})['then'](function(){_0x34924e[_0x141c('0x1c')](0xcc)[_0x141c('0x1d')]();});}};}function handleEntityNotFound(_0x28d17a,_0x1381f9){return function(_0x95413d){if(!_0x95413d){_0x28d17a[_0x141c('0x2a')](0x194);}return _0x95413d;};}function handleError(_0x3f5a7b,_0x1d91ff){_0x1d91ff=_0x1d91ff||0x1f4;return function(_0x32fba9){logger[_0x141c('0x2b')](_0x32fba9['stack']);if(_0x32fba9[_0x141c('0x2c')]){delete _0x32fba9[_0x141c('0x2c')];}_0x3f5a7b['status'](_0x1d91ff)[_0x141c('0x2d')](_0x32fba9);};}exports['index']=function(_0x379850,_0x29c684){var _0x40a319={},_0x26d3a4={},_0x2d716c={'count':0x0,'rows':[]};var _0x4dfa7f=_[_0x141c('0x2e')](db[_0x141c('0x2f')][_0x141c('0x30')],function(_0x6ad6d3){return{'name':_0x6ad6d3[_0x141c('0x31')],'type':_0x6ad6d3[_0x141c('0x32')]['key']};});_0x26d3a4[_0x141c('0x33')]=_[_0x141c('0x2e')](_0x4dfa7f,_0x141c('0x2c'));_0x26d3a4[_0x141c('0x34')]=_['keys'](_0x379850[_0x141c('0x34')]);_0x26d3a4['filters']=_['intersection'](_0x26d3a4['model'],_0x26d3a4[_0x141c('0x34')]);_0x40a319[_0x141c('0x35')]=_[_0x141c('0x36')](_0x26d3a4[_0x141c('0x33')],qs[_0x141c('0x37')](_0x379850['query']['fields']));_0x40a319[_0x141c('0x35')]=_0x40a319['attributes']['length']?_0x40a319[_0x141c('0x35')]:_0x26d3a4[_0x141c('0x33')];if(!_0x379850[_0x141c('0x34')][_0x141c('0x38')](_0x141c('0x39'))){_0x40a319[_0x141c('0x3a')]=qs[_0x141c('0x3a')](_0x379850[_0x141c('0x34')][_0x141c('0x3a')]);_0x40a319[_0x141c('0x20')]=qs['offset'](_0x379850[_0x141c('0x34')]['offset']);}_0x40a319[_0x141c('0x3b')]=qs[_0x141c('0x3c')](_0x379850[_0x141c('0x34')][_0x141c('0x3c')]);_0x40a319[_0x141c('0x3d')]=qs[_0x141c('0x3e')](_[_0x141c('0x3f')](_0x379850[_0x141c('0x34')],_0x26d3a4['filters']),_0x4dfa7f);if(_0x379850[_0x141c('0x34')]['filter']){_0x40a319[_0x141c('0x3d')]=_[_0x141c('0x40')](_0x40a319[_0x141c('0x3d')],{'$or':_[_0x141c('0x2e')](_0x4dfa7f,function(_0x7f3819){if(_0x7f3819['type']!==_0x141c('0x41')){var _0x353e8a={};_0x353e8a[_0x7f3819[_0x141c('0x2c')]]={'$like':'%'+_0x379850[_0x141c('0x34')]['filter']+'%'};return _0x353e8a;}})});}_0x40a319=_['merge']({},_0x40a319,_0x379850[_0x141c('0x42')]);var _0x52d9b4={'where':_0x40a319['where']};return db[_0x141c('0x2f')][_0x141c('0x1f')](_0x52d9b4)['then'](function(_0x1817dd){_0x2d716c['count']=_0x1817dd;if(_0x379850[_0x141c('0x34')][_0x141c('0x43')]){_0x40a319[_0x141c('0x44')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x141c('0x45')](_0x40a319);})[_0x141c('0x25')](function(_0xee1716){_0x2d716c[_0x141c('0x46')]=_0xee1716;return _0x2d716c;})[_0x141c('0x25')](respondWithFilteredResult(_0x29c684,_0x40a319))[_0x141c('0x47')](handleError(_0x29c684,null));};exports[_0x141c('0x48')]=function(_0xd71fd8,_0x3bdf56){var _0x10ee9a={'raw':!![],'where':{'id':_0xd71fd8['params']['id']}},_0x210ed2={};_0x210ed2[_0x141c('0x33')]=_[_0x141c('0x49')](db[_0x141c('0x2f')]['rawAttributes']);_0x210ed2[_0x141c('0x34')]=_['keys'](_0xd71fd8[_0x141c('0x34')]);_0x210ed2[_0x141c('0x3e')]=_['intersection'](_0x210ed2[_0x141c('0x33')],_0x210ed2[_0x141c('0x34')]);_0x10ee9a['attributes']=_['intersection'](_0x210ed2[_0x141c('0x33')],qs[_0x141c('0x37')](_0xd71fd8['query'][_0x141c('0x37')]));_0x10ee9a[_0x141c('0x35')]=_0x10ee9a['attributes'][_0x141c('0x4a')]?_0x10ee9a['attributes']:_0x210ed2['model'];if(_0xd71fd8[_0x141c('0x34')][_0x141c('0x43')]){_0x10ee9a[_0x141c('0x44')]=[{'all':!![]}];}_0x10ee9a=_['merge']({},_0x10ee9a,_0xd71fd8[_0x141c('0x42')]);return db['OpenchannelQueue'][_0x141c('0x4b')](_0x10ee9a)[_0x141c('0x25')](handleEntityNotFound(_0x3bdf56,null))[_0x141c('0x25')](respondWithResult(_0x3bdf56,null))[_0x141c('0x47')](handleError(_0x3bdf56,null));};exports['create']=function(_0xab8527,_0x23eb76){return db[_0x141c('0x2f')]['create'](_0xab8527[_0x141c('0x4c')],{})[_0x141c('0x25')](function(_0x37cc1e){var _0x10bff4=_0xab8527[_0x141c('0x4d')]['get']({'plain':!![]});if(!_0x10bff4)throw new Error(_0x141c('0x4e'));if(_0x10bff4[_0x141c('0x4f')]===_0x141c('0x4d')){var _0x9d6892=_0x37cc1e[_0x141c('0x27')]({'plain':!![]});var _0x2e1d99=_0x141c('0x28');return db[_0x141c('0x50')][_0x141c('0x4b')]({'where':{'name':_0x2e1d99,'userProfileId':_0x10bff4[_0x141c('0x51')]},'raw':!![]})['then'](function(_0x4e93fa){if(_0x4e93fa&&_0x4e93fa[_0x141c('0x52')]===0x0){return db[_0x141c('0x29')][_0x141c('0x53')]({'name':_0x9d6892['name'],'resourceId':_0x9d6892['id'],'type':_0x4e93fa['name'],'sectionId':_0x4e93fa['id']},{})[_0x141c('0x25')](function(){return _0x37cc1e;});}else{return _0x37cc1e;}})['catch'](function(_0x329543){logger[_0x141c('0x2b')](_0x141c('0x54'),_0x329543);throw _0x329543;});}return _0x37cc1e;})[_0x141c('0x25')](respondWithResult(_0x23eb76,0xc9))[_0x141c('0x47')](handleError(_0x23eb76,null));};exports[_0x141c('0x55')]=function(_0x3590ef,_0x39c192){if(_0x3590ef[_0x141c('0x4c')]['id']){delete _0x3590ef[_0x141c('0x4c')]['id'];}return db[_0x141c('0x2f')]['find']({'where':{'id':_0x3590ef[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x39c192,null))[_0x141c('0x25')](saveUpdates(_0x3590ef[_0x141c('0x4c')],null))[_0x141c('0x25')](respondWithResult(_0x39c192,null))['catch'](handleError(_0x39c192,null));};exports[_0x141c('0x26')]=function(_0x283177,_0x23f8e4){return db[_0x141c('0x2f')]['find']({'where':{'id':_0x283177[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x23f8e4,null))[_0x141c('0x25')](removeEntity(_0x23f8e4,null))[_0x141c('0x47')](handleError(_0x23f8e4,null));};exports['describe']=function(_0x59d824,_0x5dfa32){return db[_0x141c('0x2f')][_0x141c('0x57')]()[_0x141c('0x25')](respondWithResult(_0x5dfa32,null))[_0x141c('0x47')](handleError(_0x5dfa32,null));};exports[_0x141c('0x58')]=function(_0x4920a1,_0x48cc86,_0x15f5c8){var _0x377c24={'raw':!![],'where':{}},_0x5ba12b={},_0x210e32;return db[_0x141c('0x2f')][_0x141c('0x59')]({'where':{'id':_0x4920a1[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x48cc86,null))[_0x141c('0x25')](function(_0x5c8524){if(_0x5c8524){_0x210e32=_0x5c8524['get']({'plain':!![]});_0x5ba12b[_0x141c('0x33')]=_[_0x141c('0x49')](db[_0x141c('0x5a')][_0x141c('0x30')]);_0x5ba12b[_0x141c('0x34')]=_[_0x141c('0x49')](_0x4920a1[_0x141c('0x34')]);_0x5ba12b[_0x141c('0x3e')]=_[_0x141c('0x36')](_0x5ba12b['model'],_0x5ba12b['query']);_0x377c24[_0x141c('0x35')]=_[_0x141c('0x36')](_0x5ba12b[_0x141c('0x33')],qs[_0x141c('0x37')](_0x4920a1[_0x141c('0x34')]['fields']));_0x377c24[_0x141c('0x35')]=_0x377c24[_0x141c('0x35')][_0x141c('0x4a')]?_0x377c24[_0x141c('0x35')]:_0x5ba12b[_0x141c('0x33')];if(!_0x4920a1[_0x141c('0x34')][_0x141c('0x38')](_0x141c('0x39'))){_0x377c24['limit']=qs[_0x141c('0x3a')](_0x4920a1[_0x141c('0x34')][_0x141c('0x3a')]);_0x377c24[_0x141c('0x20')]=qs['offset'](_0x4920a1[_0x141c('0x34')]['offset']);}_0x377c24[_0x141c('0x3b')]=qs[_0x141c('0x3c')](_0x4920a1[_0x141c('0x34')][_0x141c('0x3c')]);_0x377c24[_0x141c('0x3d')]=qs['filters'](_[_0x141c('0x3f')](_0x4920a1['query'],_0x5ba12b[_0x141c('0x3e')]));_0x377c24[_0x141c('0x3d')]['OpenchannelQueueId']=_0x5c8524['id'];if(_0x4920a1[_0x141c('0x34')][_0x141c('0x5b')]){_0x377c24[_0x141c('0x3d')]=_[_0x141c('0x40')](_0x377c24[_0x141c('0x3d')],{'$or':_[_0x141c('0x2e')](_0x377c24['attributes'],function(_0x2be6bf){var _0x196c8b={};_0x196c8b[_0x2be6bf]={'$like':'%'+_0x4920a1['query'][_0x141c('0x5b')]+'%'};return _0x196c8b;})});}_0x377c24=_['merge']({},_0x377c24,_0x4920a1['options']);return db[_0x141c('0x5a')][_0x141c('0x45')](_0x377c24);}})['then'](function(_0x3a87fe){if(_0x3a87fe){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x3a87fe,'UserId'),'role':_0x141c('0x5c')},'attributes':['id',_0x141c('0x2c'),'openchannelPause',_0x141c('0x5d'),_0x141c('0x5e')]});}})[_0x141c('0x25')](function(_0x639fb0){if(_0x639fb0){return{'count':_0x639fb0['count'],'rows':_[_0x141c('0x2e')](_0x639fb0[_0x141c('0x46')],function(_0x5e6f5a){return{'membername':_0x5e6f5a[_0x141c('0x2c')],'UserId':_0x5e6f5a['id'],'queue_name':_0x210e32[_0x141c('0x2c')],'OpenchannelQueueId':_0x210e32['id'],'interface':util[_0x141c('0x5f')](_0x141c('0x60'),'SIP',_0x5e6f5a['name']),'penalty':0x0,'paused':_0x5e6f5a[_0x141c('0x61')],'createdAt':_0x5e6f5a[_0x141c('0x5e')],'updatedAt':_0x5e6f5a[_0x141c('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x141c('0x25')](respondWithFilteredResult(_0x48cc86,_0x377c24))[_0x141c('0x47')](handleError(_0x48cc86,null));};exports[_0x141c('0x62')]=function(_0x24d8e6,_0x203c1a,_0x2cf102){var _0x3c4156={};var _0x3298e1={};var _0x560db6;var _0x58f581;return db[_0x141c('0x2f')][_0x141c('0x59')]({'where':{'id':_0x24d8e6['params']['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x203c1a,null))[_0x141c('0x25')](function(_0x2bbd07){if(_0x2bbd07){_0x560db6=_0x2bbd07;_0x3298e1[_0x141c('0x33')]=_['keys'](db['Team'][_0x141c('0x30')]);_0x3298e1[_0x141c('0x34')]=_[_0x141c('0x49')](_0x24d8e6[_0x141c('0x34')]);_0x3298e1[_0x141c('0x3e')]=_[_0x141c('0x36')](_0x3298e1[_0x141c('0x33')],_0x3298e1['query']);_0x3c4156[_0x141c('0x35')]=_[_0x141c('0x36')](_0x3298e1[_0x141c('0x33')],qs[_0x141c('0x37')](_0x24d8e6[_0x141c('0x34')][_0x141c('0x37')]));_0x3c4156[_0x141c('0x35')]=_0x3c4156['attributes'][_0x141c('0x4a')]?_0x3c4156[_0x141c('0x35')]:_0x3298e1[_0x141c('0x33')];_0x3c4156[_0x141c('0x3b')]=qs[_0x141c('0x3c')](_0x24d8e6[_0x141c('0x34')][_0x141c('0x3c')]);_0x3c4156[_0x141c('0x3d')]=qs[_0x141c('0x3e')](_['pick'](_0x24d8e6[_0x141c('0x34')],_0x3298e1[_0x141c('0x3e')]));if(_0x24d8e6['query'][_0x141c('0x5b')]){_0x3c4156[_0x141c('0x3d')]=_[_0x141c('0x40')](_0x3c4156[_0x141c('0x3d')],{'$or':_[_0x141c('0x2e')](_0x3c4156[_0x141c('0x35')],function(_0x2ac55d){var _0x22942a={};_0x22942a[_0x2ac55d]={'$like':'%'+_0x24d8e6[_0x141c('0x34')][_0x141c('0x5b')]+'%'};return _0x22942a;})});}_0x3c4156=_[_0x141c('0x40')]({},_0x3c4156,_0x24d8e6[_0x141c('0x42')]);return _0x560db6[_0x141c('0x62')](_0x3c4156);}})['then'](function(_0x1eb7d7){if(_0x1eb7d7){_0x58f581=_0x1eb7d7[_0x141c('0x4a')];if(!_0x24d8e6['query'][_0x141c('0x38')](_0x141c('0x39'))){_0x3c4156[_0x141c('0x3a')]=qs['limit'](_0x24d8e6[_0x141c('0x34')][_0x141c('0x3a')]);_0x3c4156[_0x141c('0x20')]=qs[_0x141c('0x20')](_0x24d8e6[_0x141c('0x34')][_0x141c('0x20')]);}return _0x560db6[_0x141c('0x62')](_0x3c4156);}})[_0x141c('0x25')](function(_0x3f21e5){if(_0x3f21e5){return _0x3f21e5?{'count':_0x58f581,'rows':_0x3f21e5}:null;}})[_0x141c('0x25')](respondWithResult(_0x203c1a,null))[_0x141c('0x47')](handleError(_0x203c1a,null));};exports[_0x141c('0x63')]=function(_0x4ad3ad,_0x335cd5,_0x93dbae){var _0x4387d5=_0x4ad3ad[_0x141c('0x4c')][_0x141c('0x64')];return db[_0x141c('0x65')][_0x141c('0x45')]({'where':{'id':_0x4387d5},'attributes':['id'],'include':[{'model':db[_0x141c('0x66')],'as':_0x141c('0x67'),'attributes':['id','name',_0x141c('0x68'),'voicePause',_0x141c('0x69')],'raw':!![]}]})[_0x141c('0x25')](function(_0x27694a){if(_0x27694a){var _0x370c72=_[_0x141c('0x6a')](_0x27694a,function(_0x4f403a){var _0xda2283=_0x4f403a[_0x141c('0x27')]({'plain':!![]});return _0xda2283[_0x141c('0x67')];});return db[_0x141c('0x2f')][_0x141c('0x4b')]({'where':{'id':_0x4ad3ad[_0x141c('0x56')]['id']}})[_0x141c('0x25')](function(_0x47d4e9){return db[_0x141c('0x6b')][_0x141c('0x6c')](function(_0x483857){return _0x47d4e9['addTeams'](_0x4387d5,{'transaction':_0x483857})['then'](function(){return BPromise['each'](_0x370c72,function(_0x283b62){return db[_0x141c('0x5a')]['findOrCreate']({'where':{'UserId':_0x283b62['id'],'OpenchannelQueueId':_0x4ad3ad['params']['id']},'transaction':_0x483857});});})['then'](function(){_0x370c72[_0x141c('0x6d')](function(_0x43a58a){socket[_0x141c('0x6e')](_0x141c('0x6f'),{'UserId':_0x43a58a['id'],'OpenchannelQueueId':_0x47d4e9['id']});});});});});}})[_0x141c('0x25')](respondWithStatusCode(_0x335cd5,null))['catch'](handleError(_0x335cd5,null));};exports['removeTeams']=function(_0x21d201,_0x3af237,_0x3315db){return db[_0x141c('0x65')][_0x141c('0x45')]({'where':{'id':_0x21d201[_0x141c('0x34')][_0x141c('0x64')]},'attributes':['id'],'include':[{'model':db[_0x141c('0x66')],'as':_0x141c('0x67'),'attributes':['id'],'raw':!![]}]})[_0x141c('0x25')](handleEntityNotFound(_0x3af237,null))[_0x141c('0x25')](function(_0x5c220a){var _0x4a4dd8=_[_0x141c('0x2e')](_0x5c220a,'id');var _0x454296=[];var _0x15770f=[];var _0x50e90e=squel[_0x141c('0x70')]();_0x50e90e[_0x141c('0x71')]('tq.TeamId')[_0x141c('0x72')](_0x141c('0x73'),'tq')[_0x141c('0x74')](_0x141c('0x75'),'ut',_0x141c('0x76'))['where'](_0x141c('0x77'),_0x21d201[_0x141c('0x56')]['id']);for(var _0xdeb7d4=0x0;_0xdeb7d4<_0x5c220a[_0x141c('0x4a')];_0xdeb7d4+=0x1){let _0x1bed26=_0x5c220a[_0xdeb7d4];for(var _0x27b61c=0x0;_0x27b61c<_0x1bed26[_0x141c('0x67')][_0x141c('0x4a')];_0x27b61c+=0x1){let _0x5b3f35=_0x1bed26[_0x141c('0x67')][_0x27b61c];var _0x4e771e=_0x50e90e[_0x141c('0x78')]();_0x4e771e['where'](_0x141c('0x79'),_0x5b3f35['id']);_0x15770f[_0x141c('0x7a')](db[_0x141c('0x6b')]['query'](_0x4e771e[_0x141c('0x7b')](),{'type':db['sequelize'][_0x141c('0x7c')]['SELECT']})[_0x141c('0x25')](function(_0x5a26d3){if(_0x5a26d3['length']===0x1){return _0x5b3f35['id'];}else{var _0x456f4d=_['every'](_['map'](_0x5a26d3,_0x141c('0x7d')),function(_0x2746e3){return _['includes'](_0x4a4dd8,_0x2746e3);});if(_0x456f4d){return _0x5b3f35['id'];}}}));}}return BPromise[_0x141c('0x7e')](_0x15770f)[_0x141c('0x25')](function(_0x22763e){_0x454296=_(_0x454296)[_0x141c('0x7f')](_0x22763e)[_0x141c('0x80')]()[_0x141c('0x81')]();return db[_0x141c('0x2f')][_0x141c('0x4b')]({'where':{'id':_0x21d201[_0x141c('0x56')]['id']}})[_0x141c('0x25')](function(_0x5f36c6){return db[_0x141c('0x6b')][_0x141c('0x6c')](function(_0x1b63cf){return _0x5f36c6['removeTeams'](_0x21d201['query'][_0x141c('0x64')],{'transaction':_0x1b63cf})[_0x141c('0x25')](function(){if(!_[_0x141c('0x82')](_0x454296)){return _0x5f36c6[_0x141c('0x83')](_0x454296,{'transaction':_0x1b63cf});}})['then'](function(){_0x454296[_0x141c('0x6d')](function(_0x302157){socket[_0x141c('0x6e')](_0x141c('0x84'),{'UserId':_0x302157,'OpenchannelQueueId':_0x5f36c6['id']});});});});});});})[_0x141c('0x25')](respondWithStatusCode(_0x3af237,null))[_0x141c('0x47')](handleError(_0x3af237,null));};exports[_0x141c('0x85')]=function(_0x44c768,_0x2c1900,_0x412ce9){return db[_0x141c('0x2f')][_0x141c('0x4b')]({'where':{'id':_0x44c768[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x2c1900,null))[_0x141c('0x25')](function(_0x2e52f2){if(_0x2e52f2){return _0x2e52f2[_0x141c('0x85')](_0x44c768[_0x141c('0x4c')][_0x141c('0x64')],_['omit'](_0x44c768[_0x141c('0x4c')],[_0x141c('0x64'),'id'])||{})[_0x141c('0x86')](function(_0x1f4c9c){for(var _0x48d1cb=0x0;_0x48d1cb<_0x44c768[_0x141c('0x4c')][_0x141c('0x64')][_0x141c('0x4a')];_0x48d1cb+=0x1){socket[_0x141c('0x6e')](_0x141c('0x6f'),{'UserId':_0x44c768[_0x141c('0x4c')][_0x141c('0x64')][_0x48d1cb],'OpenchannelQueueId':_0x44c768[_0x141c('0x56')]['id']});}return _0x1f4c9c;});}})[_0x141c('0x25')](respondWithResult(_0x2c1900,null))[_0x141c('0x47')](handleError(_0x2c1900,null));};exports[_0x141c('0x83')]=function(_0x445240,_0x1303a2,_0x1a8398){return db[_0x141c('0x2f')][_0x141c('0x4b')]({'where':{'id':_0x445240[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x1303a2,null))['then'](function(_0x17ca79){if(_0x17ca79){return _0x17ca79['removeAgents'](_0x445240[_0x141c('0x34')][_0x141c('0x64')])[_0x141c('0x25')](function(){if(_[_0x141c('0x87')](_0x445240[_0x141c('0x34')][_0x141c('0x64')])){for(var _0x2606bd=0x0;_0x2606bd<_0x445240[_0x141c('0x34')][_0x141c('0x64')]['length'];_0x2606bd+=0x1){socket[_0x141c('0x6e')](_0x141c('0x84'),{'UserId':Number(_0x445240[_0x141c('0x34')]['ids'][_0x2606bd]),'OpenchannelQueueId':Number(_0x445240[_0x141c('0x56')]['id'])});}}else{socket[_0x141c('0x6e')](_0x141c('0x84'),{'UserId':Number(_0x445240[_0x141c('0x34')][_0x141c('0x64')]),'OpenchannelQueueId':Number(_0x445240[_0x141c('0x56')]['id'])});}});}})[_0x141c('0x25')](respondWithStatusCode(_0x1303a2,null))[_0x141c('0x47')](handleError(_0x1303a2,null));};exports[_0x141c('0x88')]=function(_0x163f71,_0x1d802e,_0x102b9c){var _0x25e30d={};var _0x502ff6={};var _0x510f60;var _0x4ae838;return db['OpenchannelQueue'][_0x141c('0x59')]({'where':{'id':_0x163f71[_0x141c('0x56')]['id']}})[_0x141c('0x25')](handleEntityNotFound(_0x1d802e,null))[_0x141c('0x25')](function(_0x574b6f){if(_0x574b6f){_0x510f60=_0x574b6f;_0x502ff6[_0x141c('0x33')]=_['keys'](db[_0x141c('0x66')]['rawAttributes']);_0x502ff6['query']=_['keys'](_0x163f71['query']);_0x502ff6[_0x141c('0x3e')]=_[_0x141c('0x36')](_0x502ff6['model'],_0x502ff6[_0x141c('0x34')]);_0x25e30d[_0x141c('0x35')]=_[_0x141c('0x36')](_0x502ff6[_0x141c('0x33')],qs[_0x141c('0x37')](_0x163f71[_0x141c('0x34')]['fields']));_0x25e30d[_0x141c('0x35')]=_0x25e30d[_0x141c('0x35')]['length']?_0x25e30d[_0x141c('0x35')]:_0x502ff6[_0x141c('0x33')];_0x25e30d['order']=qs[_0x141c('0x3c')](_0x163f71[_0x141c('0x34')]['sort']);_0x25e30d['where']=qs[_0x141c('0x3e')](_[_0x141c('0x3f')](_0x163f71[_0x141c('0x34')],_0x502ff6[_0x141c('0x3e')]));if(_0x163f71[_0x141c('0x34')][_0x141c('0x5b')]){_0x25e30d['where']=_['merge'](_0x25e30d[_0x141c('0x3d')],{'$or':_[_0x141c('0x2e')](_0x25e30d[_0x141c('0x35')],function(_0x37fe04){var _0x18815d={};_0x18815d[_0x37fe04]={'$like':'%'+_0x163f71[_0x141c('0x34')]['filter']+'%'};return _0x18815d;})});}_0x25e30d=_[_0x141c('0x40')]({},_0x25e30d,_0x163f71[_0x141c('0x42')]);return _0x510f60[_0x141c('0x88')](_0x25e30d);}})[_0x141c('0x25')](function(_0x3a8a93){if(_0x3a8a93){_0x4ae838=_0x3a8a93[_0x141c('0x4a')];if(!_0x163f71[_0x141c('0x34')][_0x141c('0x38')](_0x141c('0x39'))){_0x25e30d[_0x141c('0x3a')]=qs[_0x141c('0x3a')](_0x163f71[_0x141c('0x34')]['limit']);_0x25e30d['offset']=qs[_0x141c('0x20')](_0x163f71[_0x141c('0x34')][_0x141c('0x20')]);}return _0x510f60[_0x141c('0x88')](_0x25e30d);}})['then'](function(_0x5b752b){if(_0x5b752b){return _0x5b752b?{'count':_0x4ae838,'rows':_0x5b752b}:null;}})['then'](respondWithResult(_0x1d802e,null))[_0x141c('0x47')](handleError(_0x1d802e,null));}; \ No newline at end of file +var _0x3304=['fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','OpenchannelQueues','UserProfileResource','then','end','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','body','params','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','Team','getTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','userOpenchannelQueue:save','isArray','getAgents','html-pdf','eml-format','zip-dir'];(function(_0x271973,_0x610a4b){var _0x4cc73f=function(_0x318856){while(--_0x318856){_0x271973['push'](_0x271973['shift']());}};_0x4cc73f(++_0x610a4b);}(_0x3304,0x1a1));var _0x4330=function(_0x5eb729,_0x282b42){_0x5eb729=_0x5eb729-0x0;var _0x432683=_0x3304[_0x5eb729];return _0x432683;};'use strict';var pdf=require(_0x4330('0x0'));var emlformat=require(_0x4330('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4330('0x2'));var jsonpatch=require(_0x4330('0x3'));var rp=require(_0x4330('0x4'));var moment=require(_0x4330('0x5'));var BPromise=require(_0x4330('0x6'));var Mustache=require(_0x4330('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4330('0x8'));var csv=require(_0x4330('0x9'));var ejs=require(_0x4330('0xa'));var fs=require('fs');var _=require(_0x4330('0xb'));var squel=require(_0x4330('0xc'));var crypto=require('crypto');var jsforce=require(_0x4330('0xd'));var deskjs=require(_0x4330('0xe'));var toCsv=require(_0x4330('0x9'));var querystring=require('querystring');var Papa=require(_0x4330('0xf'));var Redis=require(_0x4330('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4330('0x11'));var as=require(_0x4330('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4330('0x13'))(_0x4330('0x14'));var utils=require(_0x4330('0x15'));var config=require('../../config/environment');var db=require(_0x4330('0x16'))['db'];config['redis']=_[_0x4330('0x17')](config[_0x4330('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x4330('0x19'))(new Redis(config[_0x4330('0x18')]));require(_0x4330('0x1a'))[_0x4330('0x1b')](socket);function respondWithStatusCode(_0x590096,_0x1c7147){_0x1c7147=_0x1c7147||0xcc;return function(_0x15f313){if(_0x15f313){return _0x590096[_0x4330('0x1c')](_0x1c7147);}return _0x590096[_0x4330('0x1d')](_0x1c7147)['end']();};}function respondWithResult(_0x555284,_0x26ff5f){_0x26ff5f=_0x26ff5f||0xc8;return function(_0xb8a4e5){if(_0xb8a4e5){return _0x555284[_0x4330('0x1d')](_0x26ff5f)[_0x4330('0x1e')](_0xb8a4e5);}};}function respondWithFilteredResult(_0x3da76b,_0x462427){return function(_0x928374){if(_0x928374){var _0x3b21c8=_0x928374[_0x4330('0x1f')],_0x5be06c=_0x462427[_0x4330('0x20')],_0x84ceaf=_0x462427[_0x4330('0x20')]+_0x462427[_0x4330('0x21')],_0x39d757;if(_0x84ceaf>=_0x3b21c8){_0x84ceaf=_0x3b21c8;_0x39d757=0xc8;}else{_0x39d757=0xce;}_0x3da76b[_0x4330('0x1d')](_0x39d757);return _0x3da76b[_0x4330('0x22')](_0x4330('0x23'),_0x5be06c+'-'+_0x84ceaf+'/'+_0x3b21c8)[_0x4330('0x1e')](_0x928374);}return null;};}function patchUpdates(_0x3be7f3){return function(_0x3647c9){try{jsonpatch['apply'](_0x3647c9,_0x3be7f3,!![]);}catch(_0x540855){return BPromise['reject'](_0x540855);}return _0x3647c9[_0x4330('0x24')]();};}function saveUpdates(_0x136c66,_0x34436d){return function(_0x189c21){if(_0x189c21){return _0x189c21[_0x4330('0x25')](_0x136c66)['then'](function(_0x4943b6){return _0x4943b6;});}return null;};}function removeEntity(_0x3a823a,_0x4439b8){return function(_0x17af9b){if(_0x17af9b){return _0x17af9b[_0x4330('0x26')]()['then'](function(){var _0x580532=_0x17af9b[_0x4330('0x27')]({'plain':!![]});var _0x16aa35=_0x4330('0x28');return db[_0x4330('0x29')][_0x4330('0x26')]({'where':{'type':_0x16aa35,'resourceId':_0x580532['id']}})[_0x4330('0x2a')](function(){return _0x17af9b;});})[_0x4330('0x2a')](function(){_0x3a823a[_0x4330('0x1d')](0xcc)[_0x4330('0x2b')]();});}};}function handleEntityNotFound(_0x3b0959,_0x4358ba){return function(_0x14992c){if(!_0x14992c){_0x3b0959['sendStatus'](0x194);}return _0x14992c;};}function handleError(_0x2add35,_0x558409){_0x558409=_0x558409||0x1f4;return function(_0x119eeb){logger['error'](_0x119eeb[_0x4330('0x2c')]);if(_0x119eeb[_0x4330('0x2d')]){delete _0x119eeb[_0x4330('0x2d')];}_0x2add35[_0x4330('0x1d')](_0x558409)[_0x4330('0x2e')](_0x119eeb);};}exports[_0x4330('0x2f')]=function(_0x20c53c,_0x25d687){var _0x42b1d9={},_0x1259ad={},_0x22b9f7={'count':0x0,'rows':[]};var _0xe2b595=_[_0x4330('0x30')](db[_0x4330('0x31')][_0x4330('0x32')],function(_0x12ed67){return{'name':_0x12ed67[_0x4330('0x33')],'type':_0x12ed67[_0x4330('0x34')]['key']};});_0x1259ad['model']=_[_0x4330('0x30')](_0xe2b595,'name');_0x1259ad[_0x4330('0x35')]=_['keys'](_0x20c53c[_0x4330('0x35')]);_0x1259ad[_0x4330('0x36')]=_[_0x4330('0x37')](_0x1259ad[_0x4330('0x38')],_0x1259ad['query']);_0x42b1d9['attributes']=_[_0x4330('0x37')](_0x1259ad[_0x4330('0x38')],qs[_0x4330('0x39')](_0x20c53c['query'][_0x4330('0x39')]));_0x42b1d9[_0x4330('0x3a')]=_0x42b1d9[_0x4330('0x3a')][_0x4330('0x3b')]?_0x42b1d9[_0x4330('0x3a')]:_0x1259ad[_0x4330('0x38')];if(!_0x20c53c[_0x4330('0x35')][_0x4330('0x3c')](_0x4330('0x3d'))){_0x42b1d9[_0x4330('0x21')]=qs[_0x4330('0x21')](_0x20c53c[_0x4330('0x35')]['limit']);_0x42b1d9[_0x4330('0x20')]=qs['offset'](_0x20c53c[_0x4330('0x35')]['offset']);}_0x42b1d9[_0x4330('0x3e')]=qs[_0x4330('0x3f')](_0x20c53c['query'][_0x4330('0x3f')]);_0x42b1d9['where']=qs[_0x4330('0x36')](_['pick'](_0x20c53c['query'],_0x1259ad[_0x4330('0x36')]),_0xe2b595);if(_0x20c53c[_0x4330('0x35')][_0x4330('0x40')]){_0x42b1d9[_0x4330('0x41')]=_[_0x4330('0x42')](_0x42b1d9['where'],{'$or':_[_0x4330('0x30')](_0xe2b595,function(_0x2842a0){if(_0x2842a0[_0x4330('0x34')]!==_0x4330('0x43')){var _0x1bb771={};_0x1bb771[_0x2842a0[_0x4330('0x2d')]]={'$like':'%'+_0x20c53c[_0x4330('0x35')][_0x4330('0x40')]+'%'};return _0x1bb771;}})});}_0x42b1d9=_[_0x4330('0x42')]({},_0x42b1d9,_0x20c53c['options']);var _0x3100c8={'where':_0x42b1d9[_0x4330('0x41')]};return db['OpenchannelQueue'][_0x4330('0x1f')](_0x3100c8)[_0x4330('0x2a')](function(_0x17ea7c){_0x22b9f7[_0x4330('0x1f')]=_0x17ea7c;if(_0x20c53c[_0x4330('0x35')][_0x4330('0x44')]){_0x42b1d9[_0x4330('0x45')]=[{'all':!![]}];}return db[_0x4330('0x31')][_0x4330('0x46')](_0x42b1d9);})['then'](function(_0xe90515){_0x22b9f7[_0x4330('0x47')]=_0xe90515;return _0x22b9f7;})[_0x4330('0x2a')](respondWithFilteredResult(_0x25d687,_0x42b1d9))['catch'](handleError(_0x25d687,null));};exports[_0x4330('0x48')]=function(_0x9dc95b,_0x3e3cb2){var _0x389262={'raw':!![],'where':{'id':_0x9dc95b['params']['id']}},_0x22b5df={};_0x22b5df['model']=_[_0x4330('0x49')](db[_0x4330('0x31')]['rawAttributes']);_0x22b5df['query']=_[_0x4330('0x49')](_0x9dc95b[_0x4330('0x35')]);_0x22b5df['filters']=_['intersection'](_0x22b5df[_0x4330('0x38')],_0x22b5df[_0x4330('0x35')]);_0x389262[_0x4330('0x3a')]=_[_0x4330('0x37')](_0x22b5df[_0x4330('0x38')],qs[_0x4330('0x39')](_0x9dc95b[_0x4330('0x35')][_0x4330('0x39')]));_0x389262['attributes']=_0x389262[_0x4330('0x3a')][_0x4330('0x3b')]?_0x389262['attributes']:_0x22b5df[_0x4330('0x38')];if(_0x9dc95b[_0x4330('0x35')][_0x4330('0x44')]){_0x389262['include']=[{'all':!![]}];}_0x389262=_[_0x4330('0x42')]({},_0x389262,_0x9dc95b[_0x4330('0x4a')]);return db[_0x4330('0x31')][_0x4330('0x4b')](_0x389262)[_0x4330('0x2a')](handleEntityNotFound(_0x3e3cb2,null))['then'](respondWithResult(_0x3e3cb2,null))[_0x4330('0x4c')](handleError(_0x3e3cb2,null));};exports[_0x4330('0x4d')]=function(_0x3ea336,_0x27f8c7){return db[_0x4330('0x31')][_0x4330('0x4d')](_0x3ea336['body'],{})[_0x4330('0x2a')](function(_0x2b3482){var _0x29927c=_0x3ea336[_0x4330('0x4e')][_0x4330('0x27')]({'plain':!![]});if(!_0x29927c)throw new Error(_0x4330('0x4f'));if(_0x29927c['role']==='user'){var _0x18593c=_0x2b3482[_0x4330('0x27')]({'plain':!![]});var _0x3e874b=_0x4330('0x28');return db[_0x4330('0x50')][_0x4330('0x4b')]({'where':{'name':_0x3e874b,'userProfileId':_0x29927c[_0x4330('0x51')]},'raw':!![]})[_0x4330('0x2a')](function(_0x116138){if(_0x116138&&_0x116138['autoAssociation']===0x0){return db[_0x4330('0x29')]['create']({'name':_0x18593c['name'],'resourceId':_0x18593c['id'],'type':_0x116138[_0x4330('0x2d')],'sectionId':_0x116138['id']},{})[_0x4330('0x2a')](function(){return _0x2b3482;});}else{return _0x2b3482;}})[_0x4330('0x4c')](function(_0x883a03){logger[_0x4330('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x883a03);throw _0x883a03;});}return _0x2b3482;})[_0x4330('0x2a')](respondWithResult(_0x27f8c7,0xc9))['catch'](handleError(_0x27f8c7,null));};exports[_0x4330('0x25')]=function(_0x21d1a1,_0x2f6e3a){if(_0x21d1a1[_0x4330('0x53')]['id']){delete _0x21d1a1[_0x4330('0x53')]['id'];}return db[_0x4330('0x31')][_0x4330('0x4b')]({'where':{'id':_0x21d1a1['params']['id']}})['then'](handleEntityNotFound(_0x2f6e3a,null))['then'](saveUpdates(_0x21d1a1[_0x4330('0x53')],null))['then'](respondWithResult(_0x2f6e3a,null))[_0x4330('0x4c')](handleError(_0x2f6e3a,null));};exports[_0x4330('0x26')]=function(_0x5c156f,_0x28d2b5){return db[_0x4330('0x31')][_0x4330('0x4b')]({'where':{'id':_0x5c156f[_0x4330('0x54')]['id']}})[_0x4330('0x2a')](handleEntityNotFound(_0x28d2b5,null))[_0x4330('0x2a')](removeEntity(_0x28d2b5,null))[_0x4330('0x4c')](handleError(_0x28d2b5,null));};exports[_0x4330('0x55')]=function(_0x52aa7c,_0x103221){return db[_0x4330('0x31')][_0x4330('0x55')]()[_0x4330('0x2a')](respondWithResult(_0x103221,null))[_0x4330('0x4c')](handleError(_0x103221,null));};exports[_0x4330('0x56')]=function(_0x97744d,_0x3c2618,_0x38c48d){var _0x1ee4c9={'raw':!![],'where':{}},_0x57bde1={},_0xdbc22b;return db['OpenchannelQueue'][_0x4330('0x57')]({'where':{'id':_0x97744d['params']['id']}})[_0x4330('0x2a')](handleEntityNotFound(_0x3c2618,null))[_0x4330('0x2a')](function(_0x3d1cfb){if(_0x3d1cfb){_0xdbc22b=_0x3d1cfb[_0x4330('0x27')]({'plain':!![]});_0x57bde1[_0x4330('0x38')]=_[_0x4330('0x49')](db[_0x4330('0x58')][_0x4330('0x32')]);_0x57bde1[_0x4330('0x35')]=_[_0x4330('0x49')](_0x97744d[_0x4330('0x35')]);_0x57bde1[_0x4330('0x36')]=_[_0x4330('0x37')](_0x57bde1[_0x4330('0x38')],_0x57bde1[_0x4330('0x35')]);_0x1ee4c9['attributes']=_[_0x4330('0x37')](_0x57bde1[_0x4330('0x38')],qs[_0x4330('0x39')](_0x97744d[_0x4330('0x35')]['fields']));_0x1ee4c9[_0x4330('0x3a')]=_0x1ee4c9[_0x4330('0x3a')]['length']?_0x1ee4c9[_0x4330('0x3a')]:_0x57bde1[_0x4330('0x38')];if(!_0x97744d[_0x4330('0x35')][_0x4330('0x3c')](_0x4330('0x3d'))){_0x1ee4c9[_0x4330('0x21')]=qs[_0x4330('0x21')](_0x97744d[_0x4330('0x35')][_0x4330('0x21')]);_0x1ee4c9[_0x4330('0x20')]=qs[_0x4330('0x20')](_0x97744d[_0x4330('0x35')][_0x4330('0x20')]);}_0x1ee4c9[_0x4330('0x3e')]=qs[_0x4330('0x3f')](_0x97744d[_0x4330('0x35')][_0x4330('0x3f')]);_0x1ee4c9[_0x4330('0x41')]=qs[_0x4330('0x36')](_[_0x4330('0x59')](_0x97744d[_0x4330('0x35')],_0x57bde1[_0x4330('0x36')]));_0x1ee4c9[_0x4330('0x41')][_0x4330('0x5a')]=_0x3d1cfb['id'];if(_0x97744d['query']['filter']){_0x1ee4c9[_0x4330('0x41')]=_['merge'](_0x1ee4c9['where'],{'$or':_['map'](_0x1ee4c9[_0x4330('0x3a')],function(_0x3b18d9){var _0x203892={};_0x203892[_0x3b18d9]={'$like':'%'+_0x97744d[_0x4330('0x35')][_0x4330('0x40')]+'%'};return _0x203892;})});}_0x1ee4c9=_[_0x4330('0x42')]({},_0x1ee4c9,_0x97744d[_0x4330('0x4a')]);return db[_0x4330('0x58')]['findAll'](_0x1ee4c9);}})['then'](function(_0x2952be){if(_0x2952be){return db[_0x4330('0x5b')][_0x4330('0x5c')]({'where':{'id':_[_0x4330('0x30')](_0x2952be,_0x4330('0x5d')),'role':_0x4330('0x5e')},'attributes':['id',_0x4330('0x2d'),'openchannelPause',_0x4330('0x5f'),_0x4330('0x60')]});}})['then'](function(_0x5ec185){if(_0x5ec185){return{'count':_0x5ec185['count'],'rows':_['map'](_0x5ec185[_0x4330('0x47')],function(_0xed3d55){return{'membername':_0xed3d55[_0x4330('0x2d')],'UserId':_0xed3d55['id'],'queue_name':_0xdbc22b[_0x4330('0x2d')],'OpenchannelQueueId':_0xdbc22b['id'],'interface':util[_0x4330('0x61')](_0x4330('0x62'),'SIP',_0xed3d55[_0x4330('0x2d')]),'penalty':0x0,'paused':_0xed3d55['openchannelPause'],'createdAt':_0xed3d55[_0x4330('0x60')],'updatedAt':_0xed3d55[_0x4330('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4330('0x2a')](respondWithFilteredResult(_0x3c2618,_0x1ee4c9))['catch'](handleError(_0x3c2618,null));};exports['getTeams']=function(_0x294ea7,_0xfb7a8c,_0x21f19d){var _0x114a66={};var _0x1e51bb={};var _0x2b9146;var _0x22529a;return db[_0x4330('0x31')]['findOne']({'where':{'id':_0x294ea7[_0x4330('0x54')]['id']}})[_0x4330('0x2a')](handleEntityNotFound(_0xfb7a8c,null))[_0x4330('0x2a')](function(_0x239ad8){if(_0x239ad8){_0x2b9146=_0x239ad8;_0x1e51bb[_0x4330('0x38')]=_[_0x4330('0x49')](db[_0x4330('0x63')][_0x4330('0x32')]);_0x1e51bb['query']=_[_0x4330('0x49')](_0x294ea7[_0x4330('0x35')]);_0x1e51bb['filters']=_[_0x4330('0x37')](_0x1e51bb[_0x4330('0x38')],_0x1e51bb[_0x4330('0x35')]);_0x114a66[_0x4330('0x3a')]=_[_0x4330('0x37')](_0x1e51bb[_0x4330('0x38')],qs['fields'](_0x294ea7[_0x4330('0x35')][_0x4330('0x39')]));_0x114a66[_0x4330('0x3a')]=_0x114a66[_0x4330('0x3a')][_0x4330('0x3b')]?_0x114a66[_0x4330('0x3a')]:_0x1e51bb[_0x4330('0x38')];_0x114a66['order']=qs[_0x4330('0x3f')](_0x294ea7[_0x4330('0x35')]['sort']);_0x114a66[_0x4330('0x41')]=qs[_0x4330('0x36')](_[_0x4330('0x59')](_0x294ea7[_0x4330('0x35')],_0x1e51bb[_0x4330('0x36')]));if(_0x294ea7[_0x4330('0x35')][_0x4330('0x40')]){_0x114a66[_0x4330('0x41')]=_[_0x4330('0x42')](_0x114a66[_0x4330('0x41')],{'$or':_[_0x4330('0x30')](_0x114a66[_0x4330('0x3a')],function(_0x5df827){var _0x1f9a9e={};_0x1f9a9e[_0x5df827]={'$like':'%'+_0x294ea7[_0x4330('0x35')][_0x4330('0x40')]+'%'};return _0x1f9a9e;})});}_0x114a66=_[_0x4330('0x42')]({},_0x114a66,_0x294ea7[_0x4330('0x4a')]);return _0x2b9146['getTeams'](_0x114a66);}})[_0x4330('0x2a')](function(_0xee64b1){if(_0xee64b1){_0x22529a=_0xee64b1[_0x4330('0x3b')];if(!_0x294ea7[_0x4330('0x35')]['hasOwnProperty'](_0x4330('0x3d'))){_0x114a66[_0x4330('0x21')]=qs[_0x4330('0x21')](_0x294ea7['query'][_0x4330('0x21')]);_0x114a66['offset']=qs['offset'](_0x294ea7[_0x4330('0x35')][_0x4330('0x20')]);}return _0x2b9146[_0x4330('0x64')](_0x114a66);}})['then'](function(_0x16f014){if(_0x16f014){return _0x16f014?{'count':_0x22529a,'rows':_0x16f014}:null;}})[_0x4330('0x2a')](respondWithResult(_0xfb7a8c,null))[_0x4330('0x4c')](handleError(_0xfb7a8c,null));};exports['addTeams']=function(_0x3a7416,_0x21c802,_0x4cbc42){var _0x5b5328=_0x3a7416[_0x4330('0x53')][_0x4330('0x65')];return db[_0x4330('0x63')][_0x4330('0x46')]({'where':{'id':_0x5b5328},'attributes':['id'],'include':[{'model':db[_0x4330('0x5b')],'as':_0x4330('0x66'),'attributes':['id',_0x4330('0x2d'),_0x4330('0x67'),_0x4330('0x68'),_0x4330('0x69')],'raw':!![]}]})[_0x4330('0x2a')](function(_0x52316e){if(_0x52316e){var _0x36012c=_['flatMap'](_0x52316e,function(_0x18ab56){var _0x4aa522=_0x18ab56[_0x4330('0x27')]({'plain':!![]});return _0x4aa522['Agents'];});return db[_0x4330('0x31')][_0x4330('0x4b')]({'where':{'id':_0x3a7416[_0x4330('0x54')]['id']}})['then'](function(_0x64508){return db['sequelize'][_0x4330('0x6a')](function(_0x5d987a){return _0x64508['addTeams'](_0x5b5328,{'transaction':_0x5d987a})['then'](function(){return BPromise[_0x4330('0x6b')](_0x36012c,function(_0x2b9cbb){return db[_0x4330('0x58')][_0x4330('0x6c')]({'where':{'UserId':_0x2b9cbb['id'],'OpenchannelQueueId':_0x3a7416[_0x4330('0x54')]['id']},'transaction':_0x5d987a});});})[_0x4330('0x2a')](function(){_0x36012c[_0x4330('0x6d')](function(_0x4b79f7){socket[_0x4330('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x4b79f7['id'],'OpenchannelQueueId':_0x64508['id']});});});});});}})[_0x4330('0x2a')](respondWithStatusCode(_0x21c802,null))[_0x4330('0x4c')](handleError(_0x21c802,null));};exports['removeTeams']=function(_0x26e64e,_0x1ec40d,_0x168b85){return db['Team'][_0x4330('0x46')]({'where':{'id':_0x26e64e[_0x4330('0x35')][_0x4330('0x65')]},'attributes':['id'],'include':[{'model':db[_0x4330('0x5b')],'as':_0x4330('0x66'),'attributes':['id'],'raw':!![]}]})[_0x4330('0x2a')](handleEntityNotFound(_0x1ec40d,null))[_0x4330('0x2a')](function(_0x24294f){var _0xc553b0=_[_0x4330('0x30')](_0x24294f,'id');var _0x40ba5b=[];var _0x1c1e33=[];var _0x468c5f=squel[_0x4330('0x6f')]();_0x468c5f[_0x4330('0x70')](_0x4330('0x71'))[_0x4330('0x72')](_0x4330('0x73'),'tq')[_0x4330('0x74')](_0x4330('0x75'),'ut',_0x4330('0x76'))[_0x4330('0x41')]('OpenchannelQueueId\x20=\x20?',_0x26e64e['params']['id']);for(var _0x51b4b1=0x0;_0x51b4b1<_0x24294f[_0x4330('0x3b')];_0x51b4b1+=0x1){let _0x2bac22=_0x24294f[_0x51b4b1];for(var _0x5b9a88=0x0;_0x5b9a88<_0x2bac22[_0x4330('0x66')][_0x4330('0x3b')];_0x5b9a88+=0x1){let _0x471557=_0x2bac22[_0x4330('0x66')][_0x5b9a88];var _0xa23c0b=_0x468c5f[_0x4330('0x77')]();_0xa23c0b[_0x4330('0x41')](_0x4330('0x78'),_0x471557['id']);_0x1c1e33[_0x4330('0x79')](db[_0x4330('0x7a')][_0x4330('0x35')](_0xa23c0b[_0x4330('0x7b')](),{'type':db['sequelize'][_0x4330('0x7c')][_0x4330('0x7d')]})[_0x4330('0x2a')](function(_0x3ccc61){if(_0x3ccc61['length']===0x1){return _0x471557['id'];}else{var _0x2fb9a7=_[_0x4330('0x7e')](_[_0x4330('0x30')](_0x3ccc61,_0x4330('0x7f')),function(_0xd692a0){return _[_0x4330('0x80')](_0xc553b0,_0xd692a0);});if(_0x2fb9a7){return _0x471557['id'];}}}));}}return BPromise[_0x4330('0x81')](_0x1c1e33)[_0x4330('0x2a')](function(_0x15168a){_0x40ba5b=_(_0x40ba5b)[_0x4330('0x82')](_0x15168a)[_0x4330('0x83')]()[_0x4330('0x84')]();return db[_0x4330('0x31')][_0x4330('0x4b')]({'where':{'id':_0x26e64e[_0x4330('0x54')]['id']}})[_0x4330('0x2a')](function(_0xcd38d){return db[_0x4330('0x7a')]['transaction'](function(_0x1c26ed){return _0xcd38d['removeTeams'](_0x26e64e[_0x4330('0x35')]['ids'],{'transaction':_0x1c26ed})['then'](function(){if(!_[_0x4330('0x85')](_0x40ba5b)){return _0xcd38d[_0x4330('0x86')](_0x40ba5b,{'transaction':_0x1c26ed});}})[_0x4330('0x2a')](function(){_0x40ba5b[_0x4330('0x6d')](function(_0x255f82){socket[_0x4330('0x6e')](_0x4330('0x87'),{'UserId':_0x255f82,'OpenchannelQueueId':_0xcd38d['id']});});});});});});})[_0x4330('0x2a')](respondWithStatusCode(_0x1ec40d,null))['catch'](handleError(_0x1ec40d,null));};exports[_0x4330('0x88')]=function(_0x3a789e,_0x371ba5,_0x56dd1c){return db[_0x4330('0x31')][_0x4330('0x4b')]({'where':{'id':_0x3a789e[_0x4330('0x54')]['id']}})['then'](handleEntityNotFound(_0x371ba5,null))[_0x4330('0x2a')](function(_0x22d1fd){if(_0x22d1fd){return _0x22d1fd['addAgents'](_0x3a789e[_0x4330('0x53')]['ids'],_['omit'](_0x3a789e[_0x4330('0x53')],['ids','id'])||{})['spread'](function(_0x1e7a49){for(var _0x56da94=0x0;_0x56da94<_0x3a789e[_0x4330('0x53')][_0x4330('0x65')][_0x4330('0x3b')];_0x56da94+=0x1){socket['emit'](_0x4330('0x89'),{'UserId':_0x3a789e['body']['ids'][_0x56da94],'OpenchannelQueueId':_0x3a789e[_0x4330('0x54')]['id']});}return _0x1e7a49;});}})[_0x4330('0x2a')](respondWithResult(_0x371ba5,null))[_0x4330('0x4c')](handleError(_0x371ba5,null));};exports['removeAgents']=function(_0x57b17c,_0x111b76,_0x4fb4a4){return db['OpenchannelQueue'][_0x4330('0x4b')]({'where':{'id':_0x57b17c[_0x4330('0x54')]['id']}})[_0x4330('0x2a')](handleEntityNotFound(_0x111b76,null))[_0x4330('0x2a')](function(_0x5b0969){if(_0x5b0969){return _0x5b0969['removeAgents'](_0x57b17c[_0x4330('0x35')][_0x4330('0x65')])['then'](function(){if(_[_0x4330('0x8a')](_0x57b17c[_0x4330('0x35')]['ids'])){for(var _0x54b393=0x0;_0x54b393<_0x57b17c[_0x4330('0x35')]['ids'][_0x4330('0x3b')];_0x54b393+=0x1){socket['emit'](_0x4330('0x87'),{'UserId':Number(_0x57b17c[_0x4330('0x35')]['ids'][_0x54b393]),'OpenchannelQueueId':Number(_0x57b17c[_0x4330('0x54')]['id'])});}}else{socket[_0x4330('0x6e')](_0x4330('0x87'),{'UserId':Number(_0x57b17c['query'][_0x4330('0x65')]),'OpenchannelQueueId':Number(_0x57b17c[_0x4330('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x111b76,null))[_0x4330('0x4c')](handleError(_0x111b76,null));};exports[_0x4330('0x8b')]=function(_0x4b6206,_0x299177,_0x19af3c){var _0x145a03={};var _0x238e28={};var _0x40d5f5;var _0x4086e7;return db[_0x4330('0x31')][_0x4330('0x57')]({'where':{'id':_0x4b6206['params']['id']}})[_0x4330('0x2a')](handleEntityNotFound(_0x299177,null))['then'](function(_0x3c97ae){if(_0x3c97ae){_0x40d5f5=_0x3c97ae;_0x238e28['model']=_['keys'](db['User'][_0x4330('0x32')]);_0x238e28['query']=_[_0x4330('0x49')](_0x4b6206[_0x4330('0x35')]);_0x238e28[_0x4330('0x36')]=_[_0x4330('0x37')](_0x238e28[_0x4330('0x38')],_0x238e28[_0x4330('0x35')]);_0x145a03[_0x4330('0x3a')]=_[_0x4330('0x37')](_0x238e28['model'],qs[_0x4330('0x39')](_0x4b6206[_0x4330('0x35')][_0x4330('0x39')]));_0x145a03['attributes']=_0x145a03['attributes'][_0x4330('0x3b')]?_0x145a03[_0x4330('0x3a')]:_0x238e28[_0x4330('0x38')];_0x145a03[_0x4330('0x3e')]=qs['sort'](_0x4b6206[_0x4330('0x35')][_0x4330('0x3f')]);_0x145a03[_0x4330('0x41')]=qs['filters'](_[_0x4330('0x59')](_0x4b6206[_0x4330('0x35')],_0x238e28[_0x4330('0x36')]));if(_0x4b6206[_0x4330('0x35')]['filter']){_0x145a03[_0x4330('0x41')]=_[_0x4330('0x42')](_0x145a03['where'],{'$or':_[_0x4330('0x30')](_0x145a03[_0x4330('0x3a')],function(_0x5c33f4){var _0x220b12={};_0x220b12[_0x5c33f4]={'$like':'%'+_0x4b6206[_0x4330('0x35')][_0x4330('0x40')]+'%'};return _0x220b12;})});}_0x145a03=_[_0x4330('0x42')]({},_0x145a03,_0x4b6206[_0x4330('0x4a')]);return _0x40d5f5['getAgents'](_0x145a03);}})[_0x4330('0x2a')](function(_0x4524ca){if(_0x4524ca){_0x4086e7=_0x4524ca[_0x4330('0x3b')];if(!_0x4b6206[_0x4330('0x35')][_0x4330('0x3c')](_0x4330('0x3d'))){_0x145a03[_0x4330('0x21')]=qs[_0x4330('0x21')](_0x4b6206[_0x4330('0x35')]['limit']);_0x145a03['offset']=qs[_0x4330('0x20')](_0x4b6206[_0x4330('0x35')][_0x4330('0x20')]);}return _0x40d5f5[_0x4330('0x8b')](_0x145a03);}})[_0x4330('0x2a')](function(_0x19b6a4){if(_0x19b6a4){return _0x19b6a4?{'count':_0x4086e7,'rows':_0x19b6a4}:null;}})[_0x4330('0x2a')](respondWithResult(_0x299177,null))['catch'](handleError(_0x299177,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b9c9b98..2750828 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 _0xe42c=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x1238b4,_0x502ecb){var _0x1b61e2=function(_0x1ab529){while(--_0x1ab529){_0x1238b4['push'](_0x1238b4['shift']());}};_0x1b61e2(++_0x502ecb);}(_0xe42c,0x17f));var _0xce42=function(_0x124b11,_0xbf7eb8){_0x124b11=_0x124b11-0x0;var _0x1b7766=_0xe42c[_0x124b11];return _0x1b7766;};'use strict';var EventEmitter=require(_0xce42('0x0'));var OpenchannelQueue=require(_0xce42('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xce42('0x2')](0x0);var events={'afterCreate':_0xce42('0x3'),'afterUpdate':_0xce42('0x4'),'afterDestroy':_0xce42('0x5')};function emitEvent(_0x1ce311){return function(_0x485cfe,_0x46f2ca,_0x2ff21c){OpenchannelQueueEvents[_0xce42('0x6')](_0x1ce311+':'+_0x485cfe['id'],_0x485cfe);OpenchannelQueueEvents[_0xce42('0x6')](_0x1ce311,_0x485cfe);_0x2ff21c(null);};}for(var e in events){if(events[_0xce42('0x7')](e)){var event=events[e];OpenchannelQueue[_0xce42('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xb4d9=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1de215,_0x5e57b7){var _0x58bf22=function(_0x396c9a){while(--_0x396c9a){_0x1de215['push'](_0x1de215['shift']());}};_0x58bf22(++_0x5e57b7);}(_0xb4d9,0x84));var _0x9b4d=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb4d9[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0x9b4d('0x0'));var OpenchannelQueue=require(_0x9b4d('0x1'))['db'][_0x9b4d('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9b4d('0x3')](0x0);var events={'afterCreate':_0x9b4d('0x4'),'afterUpdate':_0x9b4d('0x5'),'afterDestroy':_0x9b4d('0x6')};function emitEvent(_0x5ce6f8){return function(_0x828a8e,_0x1f9e2e,_0x17fae9){OpenchannelQueueEvents[_0x9b4d('0x7')](_0x5ce6f8+':'+_0x828a8e['id'],_0x828a8e);OpenchannelQueueEvents['emit'](_0x5ce6f8,_0x828a8e);_0x17fae9(null);};}for(var e in events){if(events[_0x9b4d('0x8')](e)){var event=events[e];OpenchannelQueue[_0x9b4d('0x9')](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 f7e85b3..78d89eb 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 _0xe71e=['api','moment','request-promise','path','rimraf','./openchannelQueue.attributes','openchannel_queues','lodash','../../config/logger'];(function(_0x15d827,_0x3476c7){var _0x1875df=function(_0x2a4968){while(--_0x2a4968){_0x15d827['push'](_0x15d827['shift']());}};_0x1875df(++_0x3476c7);}(_0xe71e,0x103));var _0xee71=function(_0xf52322,_0x4e2427){_0xf52322=_0xf52322-0x0;var _0x528e53=_0xe71e[_0xf52322];return _0x528e53;};'use strict';var _=require(_0xee71('0x0'));var util=require('util');var logger=require(_0xee71('0x1'))(_0xee71('0x2'));var moment=require(_0xee71('0x3'));var BPromise=require('bluebird');var rp=require(_0xee71('0x4'));var fs=require('fs');var path=require(_0xee71('0x5'));var rimraf=require(_0xee71('0x6'));var config=require('../../config/environment');var attributes=require(_0xee71('0x7'));module['exports']=function(_0x58f350,_0xdcc84f){return _0x58f350['define']('OpenchannelQueue',attributes,{'tableName':_0xee71('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a7b=['./openchannelQueue.attributes','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55dc08,_0x48f8db){var _0x12d70a=function(_0x222dc9){while(--_0x222dc9){_0x55dc08['push'](_0x55dc08['shift']());}};_0x12d70a(++_0x48f8db);}(_0x6a7b,0x9d));var _0xb6a7=function(_0x29cb11,_0x51b883){_0x29cb11=_0x29cb11-0x0;var _0x4ec483=_0x6a7b[_0x29cb11];return _0x4ec483;};'use strict';var _=require(_0xb6a7('0x0'));var util=require('util');var logger=require(_0xb6a7('0x1'))(_0xb6a7('0x2'));var moment=require('moment');var BPromise=require(_0xb6a7('0x3'));var rp=require(_0xb6a7('0x4'));var fs=require('fs');var path=require(_0xb6a7('0x5'));var rimraf=require(_0xb6a7('0x6'));var config=require(_0xb6a7('0x7'));var attributes=require(_0xb6a7('0x8'));module['exports']=function(_0xcd6d17,_0x1157a4){return _0xcd6d17['define'](_0xb6a7('0x9'),attributes,{'tableName':_0xb6a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 563625b..d77f0e7 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 _0x40d3=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','include','model','map','find','raw','ShowOpenchannelQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd20f67,_0x1e1be0){var _0x211f4f=function(_0x339239){while(--_0x339239){_0xd20f67['push'](_0xd20f67['shift']());}};_0x211f4f(++_0x1e1be0);}(_0x40d3,0x144));var _0x340d=function(_0x40f0c4,_0xacceb9){_0x40f0c4=_0x40f0c4-0x0;var _0x1aeaac=_0x40d3[_0x40f0c4];return _0x1aeaac;};'use strict';var _=require(_0x340d('0x0'));var util=require(_0x340d('0x1'));var moment=require(_0x340d('0x2'));var BPromise=require('bluebird');var rs=require(_0x340d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340d('0x4'))['db'];var utils=require(_0x340d('0x5'));var logger=require(_0x340d('0x6'))(_0x340d('0x7'));var config=require(_0x340d('0x8'));var jayson=require(_0x340d('0x9'));var client=jayson[_0x340d('0xa')][_0x340d('0xb')]({'port':0x232a});config[_0x340d('0xc')]=_[_0x340d('0xd')](config[_0x340d('0xc')],{'host':_0x340d('0xe'),'port':0x18eb});var socket=require(_0x340d('0xf'))(new Redis(config[_0x340d('0xc')]));require(_0x340d('0x10'))[_0x340d('0x11')](socket);function respondWithRpcPromise(_0x561739,_0x1c7a22,_0x61a8c8){return new BPromise(function(_0x37ad42,_0x4bbf1a){return client[_0x340d('0x12')](_0x561739,_0x61a8c8)[_0x340d('0x13')](function(_0x56a53d){logger['info'](_0x340d('0x14'),_0x1c7a22,_0x340d('0x15'));logger[_0x340d('0x16')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1c7a22,'request\x20sent',JSON[_0x340d('0x17')](_0x56a53d));if(_0x56a53d[_0x340d('0x18')]){if(_0x56a53d[_0x340d('0x18')][_0x340d('0x19')]===0x1f4){logger[_0x340d('0x18')](_0x340d('0x14'),_0x1c7a22,_0x56a53d[_0x340d('0x18')][_0x340d('0x1a')]);return _0x4bbf1a(_0x56a53d[_0x340d('0x18')][_0x340d('0x1a')]);}logger[_0x340d('0x18')](_0x340d('0x14'),_0x1c7a22,_0x56a53d[_0x340d('0x18')][_0x340d('0x1a')]);return _0x37ad42(_0x56a53d['error']['message']);}else{logger[_0x340d('0x1b')](_0x340d('0x14'),_0x1c7a22,'request\x20sent');_0x37ad42(_0x56a53d[_0x340d('0x1c')]['message']);}})[_0x340d('0x1d')](function(_0x5718ae){logger[_0x340d('0x18')](_0x340d('0x14'),_0x1c7a22,_0x5718ae);_0x4bbf1a(_0x5718ae);});});}exports[_0x340d('0x1e')]=function(_0x45dede){var _0x177c04=this;return new Promise(function(_0x32cd28,_0x168334){return db['OpenchannelQueue'][_0x340d('0x1f')]({'raw':_0x45dede[_0x340d('0x20')]?_0x45dede[_0x340d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x45dede[_0x340d('0x20')]?_0x45dede['options'][_0x340d('0x21')]||null:null,'attributes':_0x45dede[_0x340d('0x20')]?_0x45dede[_0x340d('0x20')][_0x340d('0x22')]||null:null,'limit':_0x45dede[_0x340d('0x20')]?_0x45dede['options'][_0x340d('0x23')]||null:null,'include':_0x45dede[_0x340d('0x20')]?_0x45dede[_0x340d('0x20')][_0x340d('0x24')]?_['map'](_0x45dede[_0x340d('0x20')][_0x340d('0x24')],function(_0x3fe430){return{'model':db[_0x3fe430[_0x340d('0x25')]],'as':_0x3fe430['as'],'attributes':_0x3fe430[_0x340d('0x22')],'include':_0x3fe430[_0x340d('0x24')]?_[_0x340d('0x26')](_0x3fe430[_0x340d('0x24')],function(_0x495a70){return{'model':db[_0x495a70[_0x340d('0x25')]],'as':_0x495a70['as'],'attributes':_0x495a70[_0x340d('0x22')],'include':_0x495a70[_0x340d('0x24')]?_[_0x340d('0x26')](_0x495a70[_0x340d('0x24')],function(_0x1e26af){return{'model':db[_0x1e26af[_0x340d('0x25')]],'as':_0x1e26af['as'],'attributes':_0x1e26af[_0x340d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x340d('0x13')](function(_0x1e0a6a){logger['info'](_0x340d('0x1e'),_0x45dede);logger[_0x340d('0x16')](_0x340d('0x1e'),_0x45dede,JSON[_0x340d('0x17')](_0x1e0a6a));_0x32cd28(_0x1e0a6a);})[_0x340d('0x1d')](function(_0x9f2bb6){logger[_0x340d('0x18')](_0x340d('0x1e'),_0x9f2bb6['message'],_0x45dede);_0x168334(_0x177c04[_0x340d('0x18')](0x1f4,_0x9f2bb6[_0x340d('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x17505a){var _0x2c6df1=this;return new Promise(function(_0x4fda65,_0x194805){return db['OpenchannelQueue'][_0x340d('0x27')]({'raw':_0x17505a[_0x340d('0x20')]?_0x17505a[_0x340d('0x20')][_0x340d('0x28')]===undefined?!![]:![]:!![],'where':_0x17505a['options']?_0x17505a[_0x340d('0x20')][_0x340d('0x21')]||null:null,'attributes':_0x17505a[_0x340d('0x20')]?_0x17505a[_0x340d('0x20')][_0x340d('0x22')]||null:null,'include':_0x17505a[_0x340d('0x20')]?_0x17505a[_0x340d('0x20')][_0x340d('0x24')]?_[_0x340d('0x26')](_0x17505a[_0x340d('0x20')][_0x340d('0x24')],function(_0x2ab98f){return{'model':db[_0x2ab98f[_0x340d('0x25')]],'as':_0x2ab98f['as'],'attributes':_0x2ab98f[_0x340d('0x22')],'include':_0x2ab98f['include']?_[_0x340d('0x26')](_0x2ab98f[_0x340d('0x24')],function(_0x140ac2){return{'model':db[_0x140ac2[_0x340d('0x25')]],'as':_0x140ac2['as'],'attributes':_0x140ac2[_0x340d('0x22')],'include':_0x140ac2['include']?_[_0x340d('0x26')](_0x140ac2[_0x340d('0x24')],function(_0x15b855){return{'model':db[_0x15b855[_0x340d('0x25')]],'as':_0x15b855['as'],'attributes':_0x15b855[_0x340d('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22dae5){logger[_0x340d('0x1b')](_0x340d('0x29'),_0x17505a);logger['debug'](_0x340d('0x29'),_0x17505a,JSON[_0x340d('0x17')](_0x22dae5));_0x4fda65(_0x22dae5);})['catch'](function(_0x23511f){logger[_0x340d('0x18')]('ShowOpenchannelQueue',_0x23511f['message'],_0x17505a);_0x194805(_0x2c6df1[_0x340d('0x18')](0x1f4,_0x23511f['message']));});});}; \ No newline at end of file +var _0x1873=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','options','include','map','model','attributes','then','catch','ShowOpenchannelQueue','OpenchannelQueue','raw','where','lodash','util','moment','randomstring'];(function(_0x3dde9b,_0x384897){var _0x3a3e8f=function(_0x1adb48){while(--_0x1adb48){_0x3dde9b['push'](_0x3dde9b['shift']());}};_0x3a3e8f(++_0x384897);}(_0x1873,0x10d));var _0x3187=function(_0x503916,_0xaaf27a){_0x503916=_0x503916-0x0;var _0x3c4e1d=_0x1873[_0x503916];return _0x3c4e1d;};'use strict';var _=require(_0x3187('0x0'));var util=require(_0x3187('0x1'));var moment=require(_0x3187('0x2'));var BPromise=require('bluebird');var rs=require(_0x3187('0x3'));var fs=require('fs');var Redis=require(_0x3187('0x4'));var db=require(_0x3187('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3187('0x6'));var config=require(_0x3187('0x7'));var jayson=require(_0x3187('0x8'));var client=jayson[_0x3187('0x9')][_0x3187('0xa')]({'port':0x232a});config['redis']=_[_0x3187('0xb')](config[_0x3187('0xc')],{'host':_0x3187('0xd'),'port':0x18eb});var socket=require(_0x3187('0xe'))(new Redis(config['redis']));require(_0x3187('0xf'))['register'](socket);function respondWithRpcPromise(_0x47bcf3,_0x4a46fe,_0x56494f){return new BPromise(function(_0x552316,_0x1dafff){return client[_0x3187('0x10')](_0x47bcf3,_0x56494f)['then'](function(_0x23ddcc){logger[_0x3187('0x11')](_0x3187('0x12'),_0x4a46fe,_0x3187('0x13'));logger[_0x3187('0x14')](_0x3187('0x15'),_0x4a46fe,_0x3187('0x13'),JSON[_0x3187('0x16')](_0x23ddcc));if(_0x23ddcc['error']){if(_0x23ddcc[_0x3187('0x17')][_0x3187('0x18')]===0x1f4){logger['error'](_0x3187('0x12'),_0x4a46fe,_0x23ddcc['error'][_0x3187('0x19')]);return _0x1dafff(_0x23ddcc['error'][_0x3187('0x19')]);}logger[_0x3187('0x17')](_0x3187('0x12'),_0x4a46fe,_0x23ddcc[_0x3187('0x17')][_0x3187('0x19')]);return _0x552316(_0x23ddcc[_0x3187('0x17')][_0x3187('0x19')]);}else{logger[_0x3187('0x11')](_0x3187('0x12'),_0x4a46fe,_0x3187('0x13'));_0x552316(_0x23ddcc[_0x3187('0x1a')][_0x3187('0x19')]);}})['catch'](function(_0x335ed7){logger[_0x3187('0x17')](_0x3187('0x12'),_0x4a46fe,_0x335ed7);_0x1dafff(_0x335ed7);});});}exports[_0x3187('0x1b')]=function(_0x4e11e0){var _0x1df6d2=this;return new Promise(function(_0x217d60,_0x57c2ab){return db['OpenchannelQueue']['findAll']({'raw':_0x4e11e0[_0x3187('0x1c')]?_0x4e11e0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4e11e0['options']?_0x4e11e0[_0x3187('0x1c')]['where']||null:null,'attributes':_0x4e11e0[_0x3187('0x1c')]?_0x4e11e0[_0x3187('0x1c')]['attributes']||null:null,'limit':_0x4e11e0[_0x3187('0x1c')]?_0x4e11e0[_0x3187('0x1c')]['limit']||null:null,'include':_0x4e11e0[_0x3187('0x1c')]?_0x4e11e0[_0x3187('0x1c')][_0x3187('0x1d')]?_[_0x3187('0x1e')](_0x4e11e0[_0x3187('0x1c')]['include'],function(_0x50c828){return{'model':db[_0x50c828[_0x3187('0x1f')]],'as':_0x50c828['as'],'attributes':_0x50c828['attributes'],'include':_0x50c828[_0x3187('0x1d')]?_[_0x3187('0x1e')](_0x50c828[_0x3187('0x1d')],function(_0xc43a65){return{'model':db[_0xc43a65['model']],'as':_0xc43a65['as'],'attributes':_0xc43a65[_0x3187('0x20')],'include':_0xc43a65[_0x3187('0x1d')]?_['map'](_0xc43a65[_0x3187('0x1d')],function(_0x308e51){return{'model':db[_0x308e51[_0x3187('0x1f')]],'as':_0x308e51['as'],'attributes':_0x308e51[_0x3187('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3187('0x21')](function(_0x5c660c){logger[_0x3187('0x11')]('GetOpenchannelQueue',_0x4e11e0);logger[_0x3187('0x14')](_0x3187('0x1b'),_0x4e11e0,JSON[_0x3187('0x16')](_0x5c660c));_0x217d60(_0x5c660c);})[_0x3187('0x22')](function(_0x4c4871){logger[_0x3187('0x17')](_0x3187('0x1b'),_0x4c4871[_0x3187('0x19')],_0x4e11e0);_0x57c2ab(_0x1df6d2['error'](0x1f4,_0x4c4871[_0x3187('0x19')]));});});};exports[_0x3187('0x23')]=function(_0x30c97a){var _0x486826=this;return new Promise(function(_0x40c04b,_0x4cbaba){return db[_0x3187('0x24')]['find']({'raw':_0x30c97a['options']?_0x30c97a[_0x3187('0x1c')][_0x3187('0x25')]===undefined?!![]:![]:!![],'where':_0x30c97a['options']?_0x30c97a[_0x3187('0x1c')][_0x3187('0x26')]||null:null,'attributes':_0x30c97a[_0x3187('0x1c')]?_0x30c97a['options'][_0x3187('0x20')]||null:null,'include':_0x30c97a[_0x3187('0x1c')]?_0x30c97a[_0x3187('0x1c')][_0x3187('0x1d')]?_['map'](_0x30c97a['options'][_0x3187('0x1d')],function(_0x4dc921){return{'model':db[_0x4dc921[_0x3187('0x1f')]],'as':_0x4dc921['as'],'attributes':_0x4dc921[_0x3187('0x20')],'include':_0x4dc921[_0x3187('0x1d')]?_[_0x3187('0x1e')](_0x4dc921['include'],function(_0x362a5c){return{'model':db[_0x362a5c['model']],'as':_0x362a5c['as'],'attributes':_0x362a5c[_0x3187('0x20')],'include':_0x362a5c[_0x3187('0x1d')]?_[_0x3187('0x1e')](_0x362a5c[_0x3187('0x1d')],function(_0x4ee78e){return{'model':db[_0x4ee78e[_0x3187('0x1f')]],'as':_0x4ee78e['as'],'attributes':_0x4ee78e[_0x3187('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4562b6){logger[_0x3187('0x11')]('ShowOpenchannelQueue',_0x30c97a);logger[_0x3187('0x14')]('ShowOpenchannelQueue',_0x30c97a,JSON[_0x3187('0x16')](_0x4562b6));_0x40c04b(_0x4562b6);})[_0x3187('0x22')](function(_0x2856b2){logger[_0x3187('0x17')](_0x3187('0x23'),_0x2856b2[_0x3187('0x19')],_0x30c97a);_0x4cbaba(_0x486826[_0x3187('0x17')](0x1f4,_0x2856b2[_0x3187('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b8004d0..8bb0557 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 _0x194f=['length','openchannelQueue:','./openchannelQueue.events','remove','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x194f,0x164));var _0xf194=function(_0x314414,_0x578618){_0x314414=_0x314414-0x0;var _0x586ae8=_0x194f[_0x314414];return _0x586ae8;};'use strict';var OpenchannelQueueEvents=require(_0xf194('0x0'));var events=['save',_0xf194('0x1'),'update'];function createListener(_0x3efa2b,_0x5de10c){return function(_0x4c1be6){_0x5de10c[_0xf194('0x2')](_0x3efa2b,_0x4c1be6);};}function removeListener(_0x320aa9,_0x5d5b73){return function(){OpenchannelQueueEvents['removeListener'](_0x320aa9,_0x5d5b73);};}exports[_0xf194('0x3')]=function(_0x632cb7){for(var _0x513d43=0x0,_0x5b65e3=events[_0xf194('0x4')];_0x513d43<_0x5b65e3;_0x513d43++){var _0x1d0de5=events[_0x513d43];var _0x354319=createListener(_0xf194('0x5')+_0x1d0de5,_0x632cb7);OpenchannelQueueEvents['on'](_0x1d0de5,_0x354319);}}; \ No newline at end of file +var _0xfa92=['length','openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0x264060,_0x4781ed){var _0x59fa32=function(_0x478a93){while(--_0x478a93){_0x264060['push'](_0x264060['shift']());}};_0x59fa32(++_0x4781ed);}(_0xfa92,0x192));var _0x2fa9=function(_0x167f19,_0x12b72c){_0x167f19=_0x167f19-0x0;var _0xc9699=_0xfa92[_0x167f19];return _0xc9699;};'use strict';var OpenchannelQueueEvents=require(_0x2fa9('0x0'));var events=[_0x2fa9('0x1'),'remove',_0x2fa9('0x2')];function createListener(_0x2ab0de,_0x4daaea){return function(_0x70a595){_0x4daaea[_0x2fa9('0x3')](_0x2ab0de,_0x70a595);};}function removeListener(_0x54cdc6,_0x269fed){return function(){OpenchannelQueueEvents[_0x2fa9('0x4')](_0x54cdc6,_0x269fed);};}exports[_0x2fa9('0x5')]=function(_0x1e74b8){for(var _0x2f1c82=0x0,_0x286792=events[_0x2fa9('0x6')];_0x2f1c82<_0x286792;_0x2f1c82++){var _0x2b855f=events[_0x2f1c82];var _0x4a6ae0=createListener(_0x2fa9('0x7')+_0x2b855f,_0x1e74b8);OpenchannelQueueEvents['on'](_0x2b855f,_0x4a6ae0);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 59c009a..aa7bf17 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 _0x8a48=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','/describe','describe','/:id'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x8a48,0x171));var _0x88a4=function(_0x46ffe2,_0x46c452){_0x46ffe2=_0x46ffe2-0x0;var _0x5b6ebe=_0x8a48[_0x46ffe2];return _0x5b6ebe;};'use strict';var multer=require(_0x88a4('0x0'));var util=require('util');var path=require(_0x88a4('0x1'));var timeout=require(_0x88a4('0x2'));var express=require(_0x88a4('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x88a4('0x4'));var config=require(_0x88a4('0x5'));var controller=require(_0x88a4('0x6'));router['get']('/',auth[_0x88a4('0x7')](),controller['index']);router['get'](_0x88a4('0x8'),auth[_0x88a4('0x7')](),controller[_0x88a4('0x9')]);router['get'](_0x88a4('0xa'),auth[_0x88a4('0x7')](),controller[_0x88a4('0xb')]);router[_0x88a4('0xc')]('/',auth[_0x88a4('0x7')](),controller[_0x88a4('0xd')]);router[_0x88a4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x88a4('0xf')]);router[_0x88a4('0x10')](_0x88a4('0xa'),auth['isAuthenticated'](),controller[_0x88a4('0x11')]);module[_0x88a4('0x12')]=router; \ No newline at end of file +var _0x6c67=['get','/describe','describe','/:id','put','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0x6c67,0xd9));var _0x76c6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x6c67[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0x76c6('0x0'));var util=require(_0x76c6('0x1'));var path=require(_0x76c6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x76c6('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x76c6('0x4'));var config=require(_0x76c6('0x5'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x76c6('0x6')](),controller['index']);router[_0x76c6('0x7')](_0x76c6('0x8'),auth['isAuthenticated'](),controller[_0x76c6('0x9')]);router['get'](_0x76c6('0xa'),auth[_0x76c6('0x6')](),controller['show']);router['post']('/',auth[_0x76c6('0x6')](),controller['create']);router[_0x76c6('0xb')](_0x76c6('0xa'),auth[_0x76c6('0x6')](),controller['update']);router[_0x76c6('0xc')](_0x76c6('0xa'),auth[_0x76c6('0x6')](),controller['destroy']);module[_0x76c6('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 1029b3e..8db6260 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 _0xa9d3=['STRING','DATE','moment'];(function(_0x3b154c,_0xeb1aba){var _0x5f4488=function(_0x59c1c1){while(--_0x59c1c1){_0x3b154c['push'](_0x3b154c['shift']());}};_0x5f4488(++_0xeb1aba);}(_0xa9d3,0xad));var _0x3a9d=function(_0x406eed,_0xca9500){_0x406eed=_0x406eed-0x0;var _0x3ef1fc=_0xa9d3[_0x406eed];return _0x3ef1fc;};'use strict';var moment=require(_0x3a9d('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3a9d('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3a9d('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3a9d('0x2')]},'exitAt':{'type':Sequelize[_0x3a9d('0x2')]},'reason':{'type':Sequelize[_0x3a9d('0x1')]}}; \ No newline at end of file +var _0xf839=['STRING','DATE','moment','sequelize'];(function(_0x4efa74,_0xacde8d){var _0xc92b1f=function(_0x43ac6c){while(--_0x43ac6c){_0x4efa74['push'](_0x4efa74['shift']());}};_0xc92b1f(++_0xacde8d);}(_0xf839,0x66));var _0x9f83=function(_0x54c500,_0x496b00){_0x54c500=_0x54c500-0x0;var _0x4aae64=_0xf839[_0x54c500];return _0x4aae64;};'use strict';var moment=require(_0x9f83('0x0'));var Sequelize=require(_0x9f83('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9f83('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9f83('0x3')]},'exitAt':{'type':Sequelize[_0x9f83('0x3')]},'reason':{'type':Sequelize[_0x9f83('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cafdeba..698975c 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 _0x05d0=['error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then'];(function(_0x5c5d46,_0x56794c){var _0x2de47d=function(_0x532d39){while(--_0x532d39){_0x5c5d46['push'](_0x5c5d46['shift']());}};_0x2de47d(++_0x56794c);}(_0x05d0,0x101));var _0x005d=function(_0x1fa18d,_0x2dc169){_0x1fa18d=_0x1fa18d-0x0;var _0x5934a6=_0x05d0[_0x1fa18d];return _0x5934a6;};'use strict';var pdf=require(_0x005d('0x0'));var emlformat=require(_0x005d('0x1'));var rimraf=require(_0x005d('0x2'));var zipdir=require(_0x005d('0x3'));var jsonpatch=require(_0x005d('0x4'));var rp=require(_0x005d('0x5'));var moment=require(_0x005d('0x6'));var BPromise=require(_0x005d('0x7'));var Mustache=require(_0x005d('0x8'));var util=require('util');var path=require(_0x005d('0x9'));var sox=require(_0x005d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x005d('0xb'));var squel=require(_0x005d('0xc'));var crypto=require('crypto');var jsforce=require(_0x005d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x005d('0xe'));var Papa=require(_0x005d('0xf'));var Redis=require('ioredis');var authService=require(_0x005d('0x10'));var qs=require(_0x005d('0x11'));var as=require(_0x005d('0x12'));var hardwareService=require(_0x005d('0x13'));var logger=require(_0x005d('0x14'))(_0x005d('0x15'));var utils=require(_0x005d('0x16'));var config=require('../../config/environment');var db=require(_0x005d('0x17'))['db'];function respondWithStatusCode(_0x2bbc4a,_0x490c15){_0x490c15=_0x490c15||0xcc;return function(_0x3be168){if(_0x3be168){return _0x2bbc4a[_0x005d('0x18')](_0x490c15);}return _0x2bbc4a[_0x005d('0x19')](_0x490c15)['end']();};}function respondWithResult(_0x3bdfd6,_0x30e3d2){_0x30e3d2=_0x30e3d2||0xc8;return function(_0x1705a3){if(_0x1705a3){return _0x3bdfd6[_0x005d('0x19')](_0x30e3d2)[_0x005d('0x1a')](_0x1705a3);}};}function respondWithFilteredResult(_0x5b79e2,_0xb2fd54){return function(_0x5595b5){if(_0x5595b5){var _0x2dd11e=_0x5595b5[_0x005d('0x1b')],_0x3ed459=_0xb2fd54[_0x005d('0x1c')],_0x35571d=_0xb2fd54['offset']+_0xb2fd54[_0x005d('0x1d')],_0xd0fbf4;if(_0x35571d>=_0x2dd11e){_0x35571d=_0x2dd11e;_0xd0fbf4=0xc8;}else{_0xd0fbf4=0xce;}_0x5b79e2[_0x005d('0x19')](_0xd0fbf4);return _0x5b79e2['set'](_0x005d('0x1e'),_0x3ed459+'-'+_0x35571d+'/'+_0x2dd11e)['json'](_0x5595b5);}return null;};}function patchUpdates(_0x1c2c54){return function(_0x52e0f2){try{jsonpatch['apply'](_0x52e0f2,_0x1c2c54,!![]);}catch(_0x11d0f3){return BPromise[_0x005d('0x1f')](_0x11d0f3);}return _0x52e0f2[_0x005d('0x20')]();};}function saveUpdates(_0x323682,_0x458537){return function(_0x38aba2){if(_0x38aba2){return _0x38aba2[_0x005d('0x21')](_0x323682)[_0x005d('0x22')](function(_0x1b988d){return _0x1b988d;});}return null;};}function removeEntity(_0x511329,_0x24196c){return function(_0x510cf3){if(_0x510cf3){return _0x510cf3['destroy']()[_0x005d('0x22')](function(){_0x511329[_0x005d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53d2b1,_0x484ad4){return function(_0x50d76f){if(!_0x50d76f){_0x53d2b1[_0x005d('0x18')](0x194);}return _0x50d76f;};}function handleError(_0x24161b,_0x31bc21){_0x31bc21=_0x31bc21||0x1f4;return function(_0x432cca){logger[_0x005d('0x23')](_0x432cca[_0x005d('0x24')]);if(_0x432cca[_0x005d('0x25')]){delete _0x432cca[_0x005d('0x25')];}_0x24161b[_0x005d('0x19')](_0x31bc21)[_0x005d('0x26')](_0x432cca);};}exports[_0x005d('0x27')]=function(_0x3eac08,_0x26c748){var _0x25d536={},_0x596892={},_0x135477={'count':0x0,'rows':[]};var _0x39554a=_['map'](db[_0x005d('0x28')][_0x005d('0x29')],function(_0x3046c3){return{'name':_0x3046c3[_0x005d('0x2a')],'type':_0x3046c3[_0x005d('0x2b')]['key']};});_0x596892[_0x005d('0x2c')]=_[_0x005d('0x2d')](_0x39554a,_0x005d('0x25'));_0x596892[_0x005d('0x2e')]=_[_0x005d('0x2f')](_0x3eac08[_0x005d('0x2e')]);_0x596892[_0x005d('0x30')]=_['intersection'](_0x596892[_0x005d('0x2c')],_0x596892[_0x005d('0x2e')]);_0x25d536['attributes']=_[_0x005d('0x31')](_0x596892[_0x005d('0x2c')],qs[_0x005d('0x32')](_0x3eac08[_0x005d('0x2e')][_0x005d('0x32')]));_0x25d536[_0x005d('0x33')]=_0x25d536[_0x005d('0x33')][_0x005d('0x34')]?_0x25d536['attributes']:_0x596892[_0x005d('0x2c')];if(!_0x3eac08[_0x005d('0x2e')][_0x005d('0x35')](_0x005d('0x36'))){_0x25d536[_0x005d('0x1d')]=qs['limit'](_0x3eac08[_0x005d('0x2e')][_0x005d('0x1d')]);_0x25d536[_0x005d('0x1c')]=qs['offset'](_0x3eac08[_0x005d('0x2e')][_0x005d('0x1c')]);}_0x25d536[_0x005d('0x37')]=qs[_0x005d('0x38')](_0x3eac08[_0x005d('0x2e')][_0x005d('0x38')]);_0x25d536[_0x005d('0x39')]=qs[_0x005d('0x30')](_[_0x005d('0x3a')](_0x3eac08[_0x005d('0x2e')],_0x596892[_0x005d('0x30')]),_0x39554a);if(_0x3eac08['query'][_0x005d('0x3b')]){_0x25d536[_0x005d('0x39')]=_[_0x005d('0x3c')](_0x25d536[_0x005d('0x39')],{'$or':_[_0x005d('0x2d')](_0x39554a,function(_0x28914d){if(_0x28914d['type']!=='VIRTUAL'){var _0x4e3ef5={};_0x4e3ef5[_0x28914d['name']]={'$like':'%'+_0x3eac08[_0x005d('0x2e')][_0x005d('0x3b')]+'%'};return _0x4e3ef5;}})});}_0x25d536=_['merge']({},_0x25d536,_0x3eac08[_0x005d('0x3d')]);var _0x1bd8b6={'where':_0x25d536[_0x005d('0x39')]};return db[_0x005d('0x28')][_0x005d('0x1b')](_0x1bd8b6)['then'](function(_0xa96b96){_0x135477[_0x005d('0x1b')]=_0xa96b96;if(_0x3eac08[_0x005d('0x2e')][_0x005d('0x3e')]){_0x25d536[_0x005d('0x3f')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x005d('0x40')](_0x25d536);})[_0x005d('0x22')](function(_0x18485a){_0x135477[_0x005d('0x41')]=_0x18485a;return _0x135477;})[_0x005d('0x22')](respondWithFilteredResult(_0x26c748,_0x25d536))[_0x005d('0x42')](handleError(_0x26c748,null));};exports['show']=function(_0x301bbd,_0x1096d1){var _0x2cfeb5={'raw':!![],'where':{'id':_0x301bbd['params']['id']}},_0x26d235={};_0x26d235[_0x005d('0x2c')]=_[_0x005d('0x2f')](db[_0x005d('0x28')]['rawAttributes']);_0x26d235[_0x005d('0x2e')]=_[_0x005d('0x2f')](_0x301bbd[_0x005d('0x2e')]);_0x26d235[_0x005d('0x30')]=_[_0x005d('0x31')](_0x26d235['model'],_0x26d235[_0x005d('0x2e')]);_0x2cfeb5[_0x005d('0x33')]=_[_0x005d('0x31')](_0x26d235[_0x005d('0x2c')],qs[_0x005d('0x32')](_0x301bbd[_0x005d('0x2e')][_0x005d('0x32')]));_0x2cfeb5[_0x005d('0x33')]=_0x2cfeb5[_0x005d('0x33')][_0x005d('0x34')]?_0x2cfeb5[_0x005d('0x33')]:_0x26d235[_0x005d('0x2c')];if(_0x301bbd[_0x005d('0x2e')][_0x005d('0x3e')]){_0x2cfeb5[_0x005d('0x3f')]=[{'all':!![]}];}_0x2cfeb5=_['merge']({},_0x2cfeb5,_0x301bbd['options']);return db[_0x005d('0x28')][_0x005d('0x43')](_0x2cfeb5)[_0x005d('0x22')](handleEntityNotFound(_0x1096d1,null))['then'](respondWithResult(_0x1096d1,null))[_0x005d('0x42')](handleError(_0x1096d1,null));};exports[_0x005d('0x44')]=function(_0x45b7f3,_0x4c895b){return db['OpenchannelQueueReport']['create'](_0x45b7f3[_0x005d('0x45')],{})[_0x005d('0x22')](respondWithResult(_0x4c895b,0xc9))[_0x005d('0x42')](handleError(_0x4c895b,null));};exports[_0x005d('0x21')]=function(_0x53ed02,_0x55c5ba){if(_0x53ed02[_0x005d('0x45')]['id']){delete _0x53ed02[_0x005d('0x45')]['id'];}return db['OpenchannelQueueReport'][_0x005d('0x43')]({'where':{'id':_0x53ed02[_0x005d('0x46')]['id']}})[_0x005d('0x22')](handleEntityNotFound(_0x55c5ba,null))[_0x005d('0x22')](saveUpdates(_0x53ed02[_0x005d('0x45')],null))[_0x005d('0x22')](respondWithResult(_0x55c5ba,null))[_0x005d('0x42')](handleError(_0x55c5ba,null));};exports[_0x005d('0x47')]=function(_0x3e3e30,_0x5ccb13){return db[_0x005d('0x28')][_0x005d('0x43')]({'where':{'id':_0x3e3e30[_0x005d('0x46')]['id']}})[_0x005d('0x22')](handleEntityNotFound(_0x5ccb13,null))['then'](removeEntity(_0x5ccb13,null))['catch'](handleError(_0x5ccb13,null));};exports[_0x005d('0x48')]=function(_0x3f7376,_0x2da8d9){return db['OpenchannelQueueReport'][_0x005d('0x48')]()[_0x005d('0x22')](respondWithResult(_0x2da8d9,null))['catch'](handleError(_0x2da8d9,null));}; \ No newline at end of file +var _0x37a7=['key','model','map','query','keys','attributes','intersection','fields','length','nolimit','limit','order','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','status','json','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','rawAttributes','type'];(function(_0x35c14a,_0x1b9dc0){var _0x302d92=function(_0x401808){while(--_0x401808){_0x35c14a['push'](_0x35c14a['shift']());}};_0x302d92(++_0x1b9dc0);}(_0x37a7,0xe1));var _0x737a=function(_0x2d6aff,_0x175425){_0x2d6aff=_0x2d6aff-0x0;var _0x332d6d=_0x37a7[_0x2d6aff];return _0x332d6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x737a('0x0'));var rimraf=require(_0x737a('0x1'));var zipdir=require(_0x737a('0x2'));var jsonpatch=require(_0x737a('0x3'));var rp=require('request-promise');var moment=require(_0x737a('0x4'));var BPromise=require(_0x737a('0x5'));var Mustache=require('mustache');var util=require(_0x737a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x737a('0x7'));var fs=require('fs');var _=require(_0x737a('0x8'));var squel=require(_0x737a('0x9'));var crypto=require(_0x737a('0xa'));var jsforce=require(_0x737a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x737a('0xc'));var Papa=require(_0x737a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x737a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x737a('0xf'));var config=require(_0x737a('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc7a7,_0x10d015){_0x10d015=_0x10d015||0xcc;return function(_0x280306){if(_0x280306){return _0x3dc7a7['sendStatus'](_0x10d015);}return _0x3dc7a7[_0x737a('0x11')](_0x10d015)['end']();};}function respondWithResult(_0x225b1f,_0xadf5ba){_0xadf5ba=_0xadf5ba||0xc8;return function(_0x33d59e){if(_0x33d59e){return _0x225b1f[_0x737a('0x11')](_0xadf5ba)[_0x737a('0x12')](_0x33d59e);}};}function respondWithFilteredResult(_0x582f07,_0x3d28c2){return function(_0x20513f){if(_0x20513f){var _0x4a61ce=_0x20513f[_0x737a('0x13')],_0x4f6dba=_0x3d28c2[_0x737a('0x14')],_0x381cd5=_0x3d28c2['offset']+_0x3d28c2['limit'],_0x25d064;if(_0x381cd5>=_0x4a61ce){_0x381cd5=_0x4a61ce;_0x25d064=0xc8;}else{_0x25d064=0xce;}_0x582f07[_0x737a('0x11')](_0x25d064);return _0x582f07[_0x737a('0x15')](_0x737a('0x16'),_0x4f6dba+'-'+_0x381cd5+'/'+_0x4a61ce)['json'](_0x20513f);}return null;};}function patchUpdates(_0x2ece79){return function(_0xa1c2ac){try{jsonpatch[_0x737a('0x17')](_0xa1c2ac,_0x2ece79,!![]);}catch(_0xb96247){return BPromise[_0x737a('0x18')](_0xb96247);}return _0xa1c2ac['save']();};}function saveUpdates(_0x56116e,_0x2b0e91){return function(_0x1d3833){if(_0x1d3833){return _0x1d3833[_0x737a('0x19')](_0x56116e)[_0x737a('0x1a')](function(_0x3c39c8){return _0x3c39c8;});}return null;};}function removeEntity(_0x23e5f0,_0x3b5cbd){return function(_0x868d2a){if(_0x868d2a){return _0x868d2a['destroy']()[_0x737a('0x1a')](function(){_0x23e5f0[_0x737a('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1581be,_0x546535){return function(_0x232d62){if(!_0x232d62){_0x1581be[_0x737a('0x1b')](0x194);}return _0x232d62;};}function handleError(_0x55438a,_0x1cc36c){_0x1cc36c=_0x1cc36c||0x1f4;return function(_0x96ef2f){logger[_0x737a('0x1c')](_0x96ef2f[_0x737a('0x1d')]);if(_0x96ef2f[_0x737a('0x1e')]){delete _0x96ef2f[_0x737a('0x1e')];}_0x55438a['status'](_0x1cc36c)[_0x737a('0x1f')](_0x96ef2f);};}exports[_0x737a('0x20')]=function(_0x11420a,_0x390006){var _0xae1fd1={},_0x1f27f5={},_0x430772={'count':0x0,'rows':[]};var _0x5092d2=_['map'](db['OpenchannelQueueReport'][_0x737a('0x21')],function(_0x2b6983){return{'name':_0x2b6983['fieldName'],'type':_0x2b6983[_0x737a('0x22')][_0x737a('0x23')]};});_0x1f27f5[_0x737a('0x24')]=_[_0x737a('0x25')](_0x5092d2,_0x737a('0x1e'));_0x1f27f5[_0x737a('0x26')]=_[_0x737a('0x27')](_0x11420a[_0x737a('0x26')]);_0x1f27f5['filters']=_['intersection'](_0x1f27f5[_0x737a('0x24')],_0x1f27f5[_0x737a('0x26')]);_0xae1fd1[_0x737a('0x28')]=_[_0x737a('0x29')](_0x1f27f5[_0x737a('0x24')],qs[_0x737a('0x2a')](_0x11420a['query'][_0x737a('0x2a')]));_0xae1fd1[_0x737a('0x28')]=_0xae1fd1[_0x737a('0x28')][_0x737a('0x2b')]?_0xae1fd1[_0x737a('0x28')]:_0x1f27f5['model'];if(!_0x11420a['query']['hasOwnProperty'](_0x737a('0x2c'))){_0xae1fd1[_0x737a('0x2d')]=qs[_0x737a('0x2d')](_0x11420a['query'][_0x737a('0x2d')]);_0xae1fd1['offset']=qs['offset'](_0x11420a[_0x737a('0x26')]['offset']);}_0xae1fd1[_0x737a('0x2e')]=qs['sort'](_0x11420a[_0x737a('0x26')]['sort']);_0xae1fd1[_0x737a('0x2f')]=qs[_0x737a('0x30')](_[_0x737a('0x31')](_0x11420a[_0x737a('0x26')],_0x1f27f5[_0x737a('0x30')]),_0x5092d2);if(_0x11420a[_0x737a('0x26')][_0x737a('0x32')]){_0xae1fd1['where']=_[_0x737a('0x33')](_0xae1fd1[_0x737a('0x2f')],{'$or':_[_0x737a('0x25')](_0x5092d2,function(_0x4923e0){if(_0x4923e0[_0x737a('0x22')]!==_0x737a('0x34')){var _0x3bb67c={};_0x3bb67c[_0x4923e0[_0x737a('0x1e')]]={'$like':'%'+_0x11420a[_0x737a('0x26')][_0x737a('0x32')]+'%'};return _0x3bb67c;}})});}_0xae1fd1=_[_0x737a('0x33')]({},_0xae1fd1,_0x11420a[_0x737a('0x35')]);var _0x35b6ad={'where':_0xae1fd1[_0x737a('0x2f')]};return db[_0x737a('0x36')][_0x737a('0x13')](_0x35b6ad)['then'](function(_0x17f34f){_0x430772[_0x737a('0x13')]=_0x17f34f;if(_0x11420a['query'][_0x737a('0x37')]){_0xae1fd1[_0x737a('0x38')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x737a('0x39')](_0xae1fd1);})[_0x737a('0x1a')](function(_0x10622a){_0x430772[_0x737a('0x3a')]=_0x10622a;return _0x430772;})[_0x737a('0x1a')](respondWithFilteredResult(_0x390006,_0xae1fd1))[_0x737a('0x3b')](handleError(_0x390006,null));};exports['show']=function(_0x19c889,_0x145c3b){var _0x244acd={'raw':!![],'where':{'id':_0x19c889[_0x737a('0x3c')]['id']}},_0x1667fa={};_0x1667fa[_0x737a('0x24')]=_[_0x737a('0x27')](db['OpenchannelQueueReport'][_0x737a('0x21')]);_0x1667fa[_0x737a('0x26')]=_[_0x737a('0x27')](_0x19c889[_0x737a('0x26')]);_0x1667fa[_0x737a('0x30')]=_['intersection'](_0x1667fa[_0x737a('0x24')],_0x1667fa['query']);_0x244acd[_0x737a('0x28')]=_[_0x737a('0x29')](_0x1667fa[_0x737a('0x24')],qs[_0x737a('0x2a')](_0x19c889[_0x737a('0x26')][_0x737a('0x2a')]));_0x244acd['attributes']=_0x244acd['attributes'][_0x737a('0x2b')]?_0x244acd['attributes']:_0x1667fa['model'];if(_0x19c889[_0x737a('0x26')][_0x737a('0x37')]){_0x244acd['include']=[{'all':!![]}];}_0x244acd=_[_0x737a('0x33')]({},_0x244acd,_0x19c889[_0x737a('0x35')]);return db[_0x737a('0x36')][_0x737a('0x3d')](_0x244acd)[_0x737a('0x1a')](handleEntityNotFound(_0x145c3b,null))[_0x737a('0x1a')](respondWithResult(_0x145c3b,null))['catch'](handleError(_0x145c3b,null));};exports[_0x737a('0x3e')]=function(_0x35a326,_0x29bb03){return db['OpenchannelQueueReport']['create'](_0x35a326[_0x737a('0x3f')],{})['then'](respondWithResult(_0x29bb03,0xc9))[_0x737a('0x3b')](handleError(_0x29bb03,null));};exports[_0x737a('0x19')]=function(_0x1bd76c,_0xc9a497){if(_0x1bd76c[_0x737a('0x3f')]['id']){delete _0x1bd76c['body']['id'];}return db[_0x737a('0x36')][_0x737a('0x3d')]({'where':{'id':_0x1bd76c[_0x737a('0x3c')]['id']}})[_0x737a('0x1a')](handleEntityNotFound(_0xc9a497,null))['then'](saveUpdates(_0x1bd76c[_0x737a('0x3f')],null))[_0x737a('0x1a')](respondWithResult(_0xc9a497,null))['catch'](handleError(_0xc9a497,null));};exports[_0x737a('0x40')]=function(_0x3d0a80,_0x404fba){return db[_0x737a('0x36')][_0x737a('0x3d')]({'where':{'id':_0x3d0a80[_0x737a('0x3c')]['id']}})[_0x737a('0x1a')](handleEntityNotFound(_0x404fba,null))['then'](removeEntity(_0x404fba,null))[_0x737a('0x3b')](handleError(_0x404fba,null));};exports['describe']=function(_0x5472dc,_0x33630b){return db[_0x737a('0x36')]['describe']()['then'](respondWithResult(_0x33630b,null))[_0x737a('0x3b')](handleError(_0x33630b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 9a8754d..b442dc5 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 _0xd28c=['moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','util','../../config/logger','api'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xd28c,0x72));var _0xcd28=function(_0x3eeb72,_0x2956ba){_0x3eeb72=_0x3eeb72-0x0;var _0x1d2261=_0xd28c[_0x3eeb72];return _0x1d2261;};'use strict';var _=require('lodash');var util=require(_0xcd28('0x0'));var logger=require(_0xcd28('0x1'))(_0xcd28('0x2'));var moment=require(_0xcd28('0x3'));var BPromise=require(_0xcd28('0x4'));var rp=require(_0xcd28('0x5'));var fs=require('fs');var path=require(_0xcd28('0x6'));var rimraf=require(_0xcd28('0x7'));var config=require('../../config/environment');var attributes=require(_0xcd28('0x8'));module[_0xcd28('0x9')]=function(_0x4ddfda,_0x71e64a){return _0x4ddfda[_0xcd28('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0xcd28('0xb'),'paranoid':![],'indexes':[{'name':_0xcd28('0xc'),'fields':[_0xcd28('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe02=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','report_openchannel_queue'];(function(_0x1f864e,_0x332753){var _0x2370b2=function(_0x40bedd){while(--_0x40bedd){_0x1f864e['push'](_0x1f864e['shift']());}};_0x2370b2(++_0x332753);}(_0xbe02,0x146));var _0x2be0=function(_0x4b350b,_0x24bd15){_0x4b350b=_0x4b350b-0x0;var _0x63f720=_0xbe02[_0x4b350b];return _0x63f720;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var logger=require(_0x2be0('0x2'))(_0x2be0('0x3'));var moment=require('moment');var BPromise=require(_0x2be0('0x4'));var rp=require(_0x2be0('0x5'));var fs=require('fs');var path=require(_0x2be0('0x6'));var rimraf=require(_0x2be0('0x7'));var config=require(_0x2be0('0x8'));var attributes=require(_0x2be0('0x9'));module[_0x2be0('0xa')]=function(_0x474a35,_0x39a2ca){return _0x474a35['define']('OpenchannelQueueReport',attributes,{'tableName':_0x2be0('0xb'),'paranoid':![],'indexes':[{'name':_0x2be0('0xc'),'fields':[_0x2be0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 379675f..1ef02df 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 _0xc6ac=['http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','catch','update','where','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ccfe2,_0x5c4561){var _0x3bbfca=function(_0x34a9be){while(--_0x34a9be){_0x2ccfe2['push'](_0x2ccfe2['shift']());}};_0x3bbfca(++_0x5c4561);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3e6db9,_0x51d66c){_0x3e6db9=_0x3e6db9-0x0;var _0x24ad42=_0xc6ac[_0x3e6db9];return _0x24ad42;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}exports[_0xcc6a('0x18')]=function(_0x33079c){var _0x12ef33=this;return new Promise(function(_0x2d9585,_0x412bc7){return db[_0xcc6a('0x19')][_0xcc6a('0x1a')](_0x33079c[_0xcc6a('0x1b')],{'raw':_0x33079c['options']?_0x33079c[_0xcc6a('0x1c')][_0xcc6a('0x1d')]===undefined?!![]:![]:!![]})[_0xcc6a('0xf')](function(_0x368a6e){logger[_0xcc6a('0x10')](_0xcc6a('0x18'),_0x33079c);logger[_0xcc6a('0x12')](_0xcc6a('0x18'),_0x33079c,JSON[_0xcc6a('0x1e')](_0x368a6e));_0x2d9585(_0x368a6e);})[_0xcc6a('0x1f')](function(_0x329d17){logger[_0xcc6a('0x15')]('CreateOpenchannelQueueReport',_0x329d17[_0xcc6a('0x17')],_0x33079c);_0x412bc7(_0x12ef33[_0xcc6a('0x15')](0x1f4,_0x329d17[_0xcc6a('0x17')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x10016a){var _0x294486=this;return new Promise(function(_0x3a00e5,_0x3ed7ce){return db[_0xcc6a('0x19')][_0xcc6a('0x20')](_0x10016a['body'],{'raw':_0x10016a[_0xcc6a('0x1c')]?_0x10016a[_0xcc6a('0x1c')][_0xcc6a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10016a['options']?_0x10016a[_0xcc6a('0x1c')][_0xcc6a('0x21')]||null:null,'attributes':_0x10016a['options']?_0x10016a[_0xcc6a('0x1c')][_0xcc6a('0x22')]||null:null,'limit':_0x10016a[_0xcc6a('0x1c')]?_0x10016a[_0xcc6a('0x1c')]['limit']||null:null})[_0xcc6a('0xf')](function(_0x3cf14c){logger[_0xcc6a('0x10')]('UpdateOpenchannelQueueReport',_0x10016a);logger[_0xcc6a('0x12')]('UpdateOpenchannelQueueReport',_0x10016a,JSON['stringify'](_0x3cf14c));_0x3a00e5(_0x3cf14c);})[_0xcc6a('0x1f')](function(_0x2e9f41){logger[_0xcc6a('0x15')](_0xcc6a('0x23'),_0x2e9f41[_0xcc6a('0x17')],_0x10016a);_0x3ed7ce(_0x294486[_0xcc6a('0x15')](0x1f4,_0x2e9f41['message']));});});}; \ No newline at end of file +var _0x5ed9=['create','body','options','raw','then','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x4f5a88,_0x51eedf){var _0x38d3a4=function(_0x48278c){while(--_0x48278c){_0x4f5a88['push'](_0x4f5a88['shift']());}};_0x38d3a4(++_0x51eedf);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5ed9[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require('moment');var BPromise=require(_0x95ed('0x2'));var rs=require(_0x95ed('0x3'));var fs=require('fs');var Redis=require(_0x95ed('0x4'));var db=require(_0x95ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x6'))(_0x95ed('0x7'));var config=require(_0x95ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf25,_0xaa1eb1,_0x3753b5){return new BPromise(function(_0x1df51f,_0x46ed43){return client[_0x95ed('0xa')](_0x32bf25,_0x3753b5)['then'](function(_0x2b59f5){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,'request\x20sent');logger[_0x95ed('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xaa1eb1,_0x95ed('0xe'),JSON[_0x95ed('0xf')](_0x2b59f5));if(_0x2b59f5[_0x95ed('0x10')]){if(_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x11')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x46ed43(_0x2b59f5['error']['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x1df51f(_0x2b59f5['error'][_0x95ed('0x12')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,_0x95ed('0xe'));_0x1df51f(_0x2b59f5[_0x95ed('0x13')]['message']);}})[_0x95ed('0x14')](function(_0x54ad78){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xaa1eb1,_0x54ad78);_0x46ed43(_0x54ad78);});});}exports[_0x95ed('0x15')]=function(_0x58fb9e){var _0x421ab9=this;return new Promise(function(_0x1bc47c,_0x4ad26d){return db[_0x95ed('0x16')][_0x95ed('0x17')](_0x58fb9e[_0x95ed('0x18')],{'raw':_0x58fb9e[_0x95ed('0x19')]?_0x58fb9e[_0x95ed('0x19')][_0x95ed('0x1a')]===undefined?!![]:![]:!![]})[_0x95ed('0x1b')](function(_0x3e05cf){logger[_0x95ed('0xb')](_0x95ed('0x15'),_0x58fb9e);logger['debug'](_0x95ed('0x15'),_0x58fb9e,JSON[_0x95ed('0xf')](_0x3e05cf));_0x1bc47c(_0x3e05cf);})['catch'](function(_0x5d5afe){logger['error'](_0x95ed('0x15'),_0x5d5afe[_0x95ed('0x12')],_0x58fb9e);_0x4ad26d(_0x421ab9[_0x95ed('0x10')](0x1f4,_0x5d5afe[_0x95ed('0x12')]));});});};exports[_0x95ed('0x1c')]=function(_0x19b664){var _0x3ef74c=this;return new Promise(function(_0x416d23,_0x146f74){return db[_0x95ed('0x16')][_0x95ed('0x1d')](_0x19b664[_0x95ed('0x18')],{'raw':_0x19b664[_0x95ed('0x19')]?_0x19b664[_0x95ed('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19b664[_0x95ed('0x19')]?_0x19b664['options']['where']||null:null,'attributes':_0x19b664[_0x95ed('0x19')]?_0x19b664[_0x95ed('0x19')][_0x95ed('0x1e')]||null:null,'limit':_0x19b664[_0x95ed('0x19')]?_0x19b664[_0x95ed('0x19')][_0x95ed('0x1f')]||null:null})[_0x95ed('0x1b')](function(_0x190620){logger[_0x95ed('0xb')](_0x95ed('0x1c'),_0x19b664);logger[_0x95ed('0xd')](_0x95ed('0x1c'),_0x19b664,JSON['stringify'](_0x190620));_0x416d23(_0x190620);})[_0x95ed('0x14')](function(_0xf73b6f){logger['error'](_0x95ed('0x1c'),_0xf73b6f['message'],_0x19b664);_0x146f74(_0x3ef74c['error'](0x1f4,_0xf73b6f['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index c626ef9..eec0618 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(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var 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 49717b4..2a34299 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 _0x4680=['account','queue','DATE','NOW','moment','sequelize','STRING','ENUM'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x4680,0xc4));var _0x0468=function(_0x3a190,_0xa45a01){_0x3a190=_0x3a190-0x0;var _0x233687=_0x4680[_0x3a190];return _0x233687;};'use strict';var moment=require(_0x0468('0x0'));var Sequelize=require(_0x0468('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0468('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0468('0x3')](_0x0468('0x4'),'agent',_0x0468('0x5')),'allowNull':![],'defaultValue':_0x0468('0x5')},'transferredAt':{'type':Sequelize[_0x0468('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x0468('0x7')]}}; \ No newline at end of file +var _0x4b63=['agent','queue','DATE','moment','sequelize','exports','STRING','ENUM'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4b63,0x18b));var _0x34b6=function(_0x3edc22,_0x243990){_0x3edc22=_0x3edc22-0x0;var _0x1ddf50=_0x4b63[_0x3edc22];return _0x1ddf50;};'use strict';var moment=require(_0x34b6('0x0'));var Sequelize=require(_0x34b6('0x1'));module[_0x34b6('0x2')]={'uniqueid':{'type':Sequelize[_0x34b6('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x34b6('0x4')]('account',_0x34b6('0x5'),_0x34b6('0x6')),'allowNull':![],'defaultValue':_0x34b6('0x6')},'transferredAt':{'type':Sequelize[_0x34b6('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 3d58c67..22ed6c2 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 _0xeb30=['filters','model','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','keys'];(function(_0x2ecff3,_0x38b472){var _0x38b67e=function(_0x227206){while(--_0x227206){_0x2ecff3['push'](_0x2ecff3['shift']());}};_0x38b67e(++_0x38b472);}(_0xeb30,0xb0));var _0x0eb3=function(_0x8a0ba2,_0x14e3ce){_0x8a0ba2=_0x8a0ba2-0x0;var _0x5d6c97=_0xeb30[_0x8a0ba2];return _0x5d6c97;};'use strict';var pdf=require(_0x0eb3('0x0'));var emlformat=require(_0x0eb3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0eb3('0x2'));var jsonpatch=require(_0x0eb3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0eb3('0x4'));var Mustache=require('mustache');var util=require(_0x0eb3('0x5'));var path=require(_0x0eb3('0x6'));var sox=require(_0x0eb3('0x7'));var csv=require(_0x0eb3('0x8'));var ejs=require(_0x0eb3('0x9'));var fs=require('fs');var _=require(_0x0eb3('0xa'));var squel=require(_0x0eb3('0xb'));var crypto=require(_0x0eb3('0xc'));var jsforce=require(_0x0eb3('0xd'));var deskjs=require(_0x0eb3('0xe'));var toCsv=require(_0x0eb3('0x8'));var querystring=require('querystring');var Papa=require(_0x0eb3('0xf'));var Redis=require(_0x0eb3('0x10'));var authService=require(_0x0eb3('0x11'));var qs=require(_0x0eb3('0x12'));var as=require(_0x0eb3('0x13'));var hardwareService=require(_0x0eb3('0x14'));var logger=require('../../config/logger')(_0x0eb3('0x15'));var utils=require(_0x0eb3('0x16'));var config=require(_0x0eb3('0x17'));var db=require(_0x0eb3('0x18'))['db'];function respondWithStatusCode(_0x5b213b,_0x586bbc){_0x586bbc=_0x586bbc||0xcc;return function(_0x449d71){if(_0x449d71){return _0x5b213b[_0x0eb3('0x19')](_0x586bbc);}return _0x5b213b[_0x0eb3('0x1a')](_0x586bbc)[_0x0eb3('0x1b')]();};}function respondWithResult(_0x284e1f,_0x16d1ed){_0x16d1ed=_0x16d1ed||0xc8;return function(_0x5dee5d){if(_0x5dee5d){return _0x284e1f[_0x0eb3('0x1a')](_0x16d1ed)[_0x0eb3('0x1c')](_0x5dee5d);}};}function respondWithFilteredResult(_0x3fb588,_0x1141bd){return function(_0x2aae53){if(_0x2aae53){var _0x460075=_0x2aae53[_0x0eb3('0x1d')],_0x11d92c=_0x1141bd[_0x0eb3('0x1e')],_0x16712c=_0x1141bd[_0x0eb3('0x1e')]+_0x1141bd['limit'],_0x54e01d;if(_0x16712c>=_0x460075){_0x16712c=_0x460075;_0x54e01d=0xc8;}else{_0x54e01d=0xce;}_0x3fb588[_0x0eb3('0x1a')](_0x54e01d);return _0x3fb588[_0x0eb3('0x1f')](_0x0eb3('0x20'),_0x11d92c+'-'+_0x16712c+'/'+_0x460075)[_0x0eb3('0x1c')](_0x2aae53);}return null;};}function patchUpdates(_0x5c5507){return function(_0x1812a7){try{jsonpatch['apply'](_0x1812a7,_0x5c5507,!![]);}catch(_0x4cc136){return BPromise[_0x0eb3('0x21')](_0x4cc136);}return _0x1812a7[_0x0eb3('0x22')]();};}function saveUpdates(_0x535a47,_0x2a29fe){return function(_0x1b3d45){if(_0x1b3d45){return _0x1b3d45[_0x0eb3('0x23')](_0x535a47)[_0x0eb3('0x24')](function(_0x5f2d21){return _0x5f2d21;});}return null;};}function removeEntity(_0x3edd30,_0x141072){return function(_0x3d78b9){if(_0x3d78b9){return _0x3d78b9['destroy']()[_0x0eb3('0x24')](function(){_0x3edd30[_0x0eb3('0x1a')](0xcc)[_0x0eb3('0x1b')]();});}};}function handleEntityNotFound(_0x3f1499,_0xf4fe17){return function(_0x821941){if(!_0x821941){_0x3f1499['sendStatus'](0x194);}return _0x821941;};}function handleError(_0x55f9fc,_0x19093c){_0x19093c=_0x19093c||0x1f4;return function(_0x3a4c50){logger['error'](_0x3a4c50[_0x0eb3('0x25')]);if(_0x3a4c50[_0x0eb3('0x26')]){delete _0x3a4c50[_0x0eb3('0x26')];}_0x55f9fc[_0x0eb3('0x1a')](_0x19093c)[_0x0eb3('0x27')](_0x3a4c50);};}exports[_0x0eb3('0x28')]=function(_0x208831,_0x62d6d3){var _0x4ff7b={},_0x28f640={},_0x1b6b7f={'count':0x0,'rows':[]};var _0x479262=_[_0x0eb3('0x29')](db[_0x0eb3('0x2a')][_0x0eb3('0x2b')],function(_0x4d2829){return{'name':_0x4d2829[_0x0eb3('0x2c')],'type':_0x4d2829[_0x0eb3('0x2d')][_0x0eb3('0x2e')]};});_0x28f640['model']=_[_0x0eb3('0x29')](_0x479262,'name');_0x28f640[_0x0eb3('0x2f')]=_[_0x0eb3('0x30')](_0x208831[_0x0eb3('0x2f')]);_0x28f640[_0x0eb3('0x31')]=_['intersection'](_0x28f640[_0x0eb3('0x32')],_0x28f640[_0x0eb3('0x2f')]);_0x4ff7b['attributes']=_[_0x0eb3('0x33')](_0x28f640['model'],qs[_0x0eb3('0x34')](_0x208831['query']['fields']));_0x4ff7b[_0x0eb3('0x35')]=_0x4ff7b[_0x0eb3('0x35')][_0x0eb3('0x36')]?_0x4ff7b[_0x0eb3('0x35')]:_0x28f640[_0x0eb3('0x32')];if(!_0x208831[_0x0eb3('0x2f')]['hasOwnProperty'](_0x0eb3('0x37'))){_0x4ff7b[_0x0eb3('0x38')]=qs[_0x0eb3('0x38')](_0x208831[_0x0eb3('0x2f')][_0x0eb3('0x38')]);_0x4ff7b['offset']=qs[_0x0eb3('0x1e')](_0x208831[_0x0eb3('0x2f')][_0x0eb3('0x1e')]);}_0x4ff7b[_0x0eb3('0x39')]=qs[_0x0eb3('0x3a')](_0x208831[_0x0eb3('0x2f')][_0x0eb3('0x3a')]);_0x4ff7b['where']=qs[_0x0eb3('0x31')](_[_0x0eb3('0x3b')](_0x208831[_0x0eb3('0x2f')],_0x28f640[_0x0eb3('0x31')]),_0x479262);if(_0x208831[_0x0eb3('0x2f')][_0x0eb3('0x3c')]){_0x4ff7b[_0x0eb3('0x3d')]=_['merge'](_0x4ff7b[_0x0eb3('0x3d')],{'$or':_['map'](_0x479262,function(_0x219ca3){if(_0x219ca3[_0x0eb3('0x2d')]!==_0x0eb3('0x3e')){var _0x4c891f={};_0x4c891f[_0x219ca3['name']]={'$like':'%'+_0x208831[_0x0eb3('0x2f')][_0x0eb3('0x3c')]+'%'};return _0x4c891f;}})});}_0x4ff7b=_[_0x0eb3('0x3f')]({},_0x4ff7b,_0x208831[_0x0eb3('0x40')]);var _0x2f80a8={'where':_0x4ff7b[_0x0eb3('0x3d')]};return db['OpenchannelTransferReport']['count'](_0x2f80a8)[_0x0eb3('0x24')](function(_0x2f2e2e){_0x1b6b7f['count']=_0x2f2e2e;if(_0x208831[_0x0eb3('0x2f')]['includeAll']){_0x4ff7b[_0x0eb3('0x41')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x0eb3('0x42')](_0x4ff7b);})['then'](function(_0x26a9db){_0x1b6b7f[_0x0eb3('0x43')]=_0x26a9db;return _0x1b6b7f;})['then'](respondWithFilteredResult(_0x62d6d3,_0x4ff7b))[_0x0eb3('0x44')](handleError(_0x62d6d3,null));};exports[_0x0eb3('0x45')]=function(_0x11367b,_0x36c9ca){var _0xfe3a4={'raw':!![],'where':{'id':_0x11367b[_0x0eb3('0x46')]['id']}},_0x43b25c={};_0x43b25c[_0x0eb3('0x32')]=_[_0x0eb3('0x30')](db['OpenchannelTransferReport'][_0x0eb3('0x2b')]);_0x43b25c[_0x0eb3('0x2f')]=_[_0x0eb3('0x30')](_0x11367b[_0x0eb3('0x2f')]);_0x43b25c[_0x0eb3('0x31')]=_[_0x0eb3('0x33')](_0x43b25c[_0x0eb3('0x32')],_0x43b25c[_0x0eb3('0x2f')]);_0xfe3a4[_0x0eb3('0x35')]=_[_0x0eb3('0x33')](_0x43b25c['model'],qs[_0x0eb3('0x34')](_0x11367b[_0x0eb3('0x2f')][_0x0eb3('0x34')]));_0xfe3a4[_0x0eb3('0x35')]=_0xfe3a4[_0x0eb3('0x35')][_0x0eb3('0x36')]?_0xfe3a4[_0x0eb3('0x35')]:_0x43b25c['model'];if(_0x11367b[_0x0eb3('0x2f')]['includeAll']){_0xfe3a4[_0x0eb3('0x41')]=[{'all':!![]}];}_0xfe3a4=_[_0x0eb3('0x3f')]({},_0xfe3a4,_0x11367b[_0x0eb3('0x40')]);return db[_0x0eb3('0x2a')][_0x0eb3('0x47')](_0xfe3a4)[_0x0eb3('0x24')](handleEntityNotFound(_0x36c9ca,null))['then'](respondWithResult(_0x36c9ca,null))[_0x0eb3('0x44')](handleError(_0x36c9ca,null));};exports['create']=function(_0x3879ea,_0x42b9a9){return db[_0x0eb3('0x2a')]['create'](_0x3879ea['body'],{})[_0x0eb3('0x24')](respondWithResult(_0x42b9a9,0xc9))[_0x0eb3('0x44')](handleError(_0x42b9a9,null));};exports[_0x0eb3('0x23')]=function(_0x19019e,_0x4a85a9){if(_0x19019e[_0x0eb3('0x48')]['id']){delete _0x19019e['body']['id'];}return db[_0x0eb3('0x2a')][_0x0eb3('0x47')]({'where':{'id':_0x19019e[_0x0eb3('0x46')]['id']}})[_0x0eb3('0x24')](handleEntityNotFound(_0x4a85a9,null))[_0x0eb3('0x24')](saveUpdates(_0x19019e['body'],null))[_0x0eb3('0x24')](respondWithResult(_0x4a85a9,null))['catch'](handleError(_0x4a85a9,null));};exports[_0x0eb3('0x49')]=function(_0x4a7434,_0xea297){return db[_0x0eb3('0x2a')][_0x0eb3('0x47')]({'where':{'id':_0x4a7434[_0x0eb3('0x46')]['id']}})['then'](handleEntityNotFound(_0xea297,null))['then'](removeEntity(_0xea297,null))[_0x0eb3('0x44')](handleError(_0xea297,null));};exports[_0x0eb3('0x4a')]=function(_0x5d6465,_0x310332){return db[_0x0eb3('0x2a')]['describe']()['then'](respondWithResult(_0x310332,null))[_0x0eb3('0x44')](handleError(_0x310332,null));}; \ No newline at end of file +var _0xa8b2=['name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','describe','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','destroy','end','error'];(function(_0x3391ec,_0xafa1ad){var _0x26c9d1=function(_0x32dd46){while(--_0x32dd46){_0x3391ec['push'](_0x3391ec['shift']());}};_0x26c9d1(++_0xafa1ad);}(_0xa8b2,0x159));var _0x2a8b=function(_0x852a89,_0x45e59b){_0x852a89=_0x852a89-0x0;var _0x1000c6=_0xa8b2[_0x852a89];return _0x1000c6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2a8b('0x0'));var moment=require(_0x2a8b('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x2a8b('0x2'));var util=require('util');var path=require('path');var sox=require(_0x2a8b('0x3'));var csv=require(_0x2a8b('0x4'));var ejs=require(_0x2a8b('0x5'));var fs=require('fs');var _=require(_0x2a8b('0x6'));var squel=require(_0x2a8b('0x7'));var crypto=require('crypto');var jsforce=require(_0x2a8b('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x2a8b('0x4'));var querystring=require(_0x2a8b('0x9'));var Papa=require('papaparse');var Redis=require(_0x2a8b('0xa'));var authService=require(_0x2a8b('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x2a8b('0xc'));var hardwareService=require(_0x2a8b('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f3fc4,_0x142944){_0x142944=_0x142944||0xcc;return function(_0x336982){if(_0x336982){return _0x3f3fc4[_0x2a8b('0xe')](_0x142944);}return _0x3f3fc4[_0x2a8b('0xf')](_0x142944)['end']();};}function respondWithResult(_0x242bfc,_0x2002ca){_0x2002ca=_0x2002ca||0xc8;return function(_0x2ac750){if(_0x2ac750){return _0x242bfc['status'](_0x2002ca)[_0x2a8b('0x10')](_0x2ac750);}};}function respondWithFilteredResult(_0x2090f0,_0x54c99f){return function(_0x4d97c7){if(_0x4d97c7){var _0x17a6f2=_0x4d97c7[_0x2a8b('0x11')],_0x1b1d9f=_0x54c99f[_0x2a8b('0x12')],_0x29d359=_0x54c99f[_0x2a8b('0x12')]+_0x54c99f['limit'],_0x4966ce;if(_0x29d359>=_0x17a6f2){_0x29d359=_0x17a6f2;_0x4966ce=0xc8;}else{_0x4966ce=0xce;}_0x2090f0[_0x2a8b('0xf')](_0x4966ce);return _0x2090f0[_0x2a8b('0x13')](_0x2a8b('0x14'),_0x1b1d9f+'-'+_0x29d359+'/'+_0x17a6f2)[_0x2a8b('0x10')](_0x4d97c7);}return null;};}function patchUpdates(_0x7a74f1){return function(_0x30439f){try{jsonpatch['apply'](_0x30439f,_0x7a74f1,!![]);}catch(_0xc8fa66){return BPromise[_0x2a8b('0x15')](_0xc8fa66);}return _0x30439f[_0x2a8b('0x16')]();};}function saveUpdates(_0x3e64f7,_0x643d77){return function(_0x345995){if(_0x345995){return _0x345995['update'](_0x3e64f7)[_0x2a8b('0x17')](function(_0x33f7e1){return _0x33f7e1;});}return null;};}function removeEntity(_0x35496c,_0x9cbccb){return function(_0x1fd693){if(_0x1fd693){return _0x1fd693[_0x2a8b('0x18')]()[_0x2a8b('0x17')](function(){_0x35496c[_0x2a8b('0xf')](0xcc)[_0x2a8b('0x19')]();});}};}function handleEntityNotFound(_0x316848,_0x5e988d){return function(_0x2310c8){if(!_0x2310c8){_0x316848[_0x2a8b('0xe')](0x194);}return _0x2310c8;};}function handleError(_0x3e066c,_0x38b456){_0x38b456=_0x38b456||0x1f4;return function(_0xa01869){logger[_0x2a8b('0x1a')](_0xa01869['stack']);if(_0xa01869['name']){delete _0xa01869[_0x2a8b('0x1b')];}_0x3e066c[_0x2a8b('0xf')](_0x38b456)[_0x2a8b('0x1c')](_0xa01869);};}exports[_0x2a8b('0x1d')]=function(_0x177def,_0x361ace){var _0x3fc6cc={},_0x1d28c7={},_0x27c1eb={'count':0x0,'rows':[]};var _0x1f2dbe=_[_0x2a8b('0x1e')](db[_0x2a8b('0x1f')][_0x2a8b('0x20')],function(_0x1fd590){return{'name':_0x1fd590[_0x2a8b('0x21')],'type':_0x1fd590['type'][_0x2a8b('0x22')]};});_0x1d28c7[_0x2a8b('0x23')]=_['map'](_0x1f2dbe,_0x2a8b('0x1b'));_0x1d28c7['query']=_[_0x2a8b('0x24')](_0x177def[_0x2a8b('0x25')]);_0x1d28c7[_0x2a8b('0x26')]=_['intersection'](_0x1d28c7[_0x2a8b('0x23')],_0x1d28c7['query']);_0x3fc6cc[_0x2a8b('0x27')]=_['intersection'](_0x1d28c7[_0x2a8b('0x23')],qs['fields'](_0x177def[_0x2a8b('0x25')][_0x2a8b('0x28')]));_0x3fc6cc[_0x2a8b('0x27')]=_0x3fc6cc['attributes'][_0x2a8b('0x29')]?_0x3fc6cc[_0x2a8b('0x27')]:_0x1d28c7[_0x2a8b('0x23')];if(!_0x177def[_0x2a8b('0x25')][_0x2a8b('0x2a')](_0x2a8b('0x2b'))){_0x3fc6cc[_0x2a8b('0x2c')]=qs[_0x2a8b('0x2c')](_0x177def[_0x2a8b('0x25')]['limit']);_0x3fc6cc['offset']=qs[_0x2a8b('0x12')](_0x177def[_0x2a8b('0x25')][_0x2a8b('0x12')]);}_0x3fc6cc[_0x2a8b('0x2d')]=qs['sort'](_0x177def[_0x2a8b('0x25')][_0x2a8b('0x2e')]);_0x3fc6cc['where']=qs[_0x2a8b('0x26')](_['pick'](_0x177def['query'],_0x1d28c7[_0x2a8b('0x26')]),_0x1f2dbe);if(_0x177def['query'][_0x2a8b('0x2f')]){_0x3fc6cc[_0x2a8b('0x30')]=_[_0x2a8b('0x31')](_0x3fc6cc['where'],{'$or':_['map'](_0x1f2dbe,function(_0x38da8b){if(_0x38da8b[_0x2a8b('0x32')]!==_0x2a8b('0x33')){var _0x44b732={};_0x44b732[_0x38da8b[_0x2a8b('0x1b')]]={'$like':'%'+_0x177def[_0x2a8b('0x25')][_0x2a8b('0x2f')]+'%'};return _0x44b732;}})});}_0x3fc6cc=_[_0x2a8b('0x31')]({},_0x3fc6cc,_0x177def[_0x2a8b('0x34')]);var _0x446a5f={'where':_0x3fc6cc[_0x2a8b('0x30')]};return db[_0x2a8b('0x1f')]['count'](_0x446a5f)[_0x2a8b('0x17')](function(_0x20a2a2){_0x27c1eb['count']=_0x20a2a2;if(_0x177def[_0x2a8b('0x25')][_0x2a8b('0x35')]){_0x3fc6cc['include']=[{'all':!![]}];}return db[_0x2a8b('0x1f')][_0x2a8b('0x36')](_0x3fc6cc);})['then'](function(_0x3d4768){_0x27c1eb['rows']=_0x3d4768;return _0x27c1eb;})['then'](respondWithFilteredResult(_0x361ace,_0x3fc6cc))[_0x2a8b('0x37')](handleError(_0x361ace,null));};exports['show']=function(_0x32e2e9,_0x1a42e7){var _0x500125={'raw':!![],'where':{'id':_0x32e2e9[_0x2a8b('0x38')]['id']}},_0x24edf8={};_0x24edf8[_0x2a8b('0x23')]=_[_0x2a8b('0x24')](db[_0x2a8b('0x1f')][_0x2a8b('0x20')]);_0x24edf8[_0x2a8b('0x25')]=_[_0x2a8b('0x24')](_0x32e2e9[_0x2a8b('0x25')]);_0x24edf8['filters']=_['intersection'](_0x24edf8[_0x2a8b('0x23')],_0x24edf8[_0x2a8b('0x25')]);_0x500125[_0x2a8b('0x27')]=_['intersection'](_0x24edf8['model'],qs[_0x2a8b('0x28')](_0x32e2e9[_0x2a8b('0x25')]['fields']));_0x500125[_0x2a8b('0x27')]=_0x500125[_0x2a8b('0x27')][_0x2a8b('0x29')]?_0x500125['attributes']:_0x24edf8['model'];if(_0x32e2e9['query']['includeAll']){_0x500125[_0x2a8b('0x39')]=[{'all':!![]}];}_0x500125=_[_0x2a8b('0x31')]({},_0x500125,_0x32e2e9[_0x2a8b('0x34')]);return db[_0x2a8b('0x1f')][_0x2a8b('0x3a')](_0x500125)[_0x2a8b('0x17')](handleEntityNotFound(_0x1a42e7,null))[_0x2a8b('0x17')](respondWithResult(_0x1a42e7,null))[_0x2a8b('0x37')](handleError(_0x1a42e7,null));};exports[_0x2a8b('0x3b')]=function(_0x513eec,_0x2e1806){return db[_0x2a8b('0x1f')][_0x2a8b('0x3b')](_0x513eec['body'],{})[_0x2a8b('0x17')](respondWithResult(_0x2e1806,0xc9))['catch'](handleError(_0x2e1806,null));};exports['update']=function(_0x33aa22,_0x560e1a){if(_0x33aa22[_0x2a8b('0x3c')]['id']){delete _0x33aa22[_0x2a8b('0x3c')]['id'];}return db['OpenchannelTransferReport'][_0x2a8b('0x3a')]({'where':{'id':_0x33aa22[_0x2a8b('0x38')]['id']}})['then'](handleEntityNotFound(_0x560e1a,null))[_0x2a8b('0x17')](saveUpdates(_0x33aa22[_0x2a8b('0x3c')],null))[_0x2a8b('0x17')](respondWithResult(_0x560e1a,null))['catch'](handleError(_0x560e1a,null));};exports['destroy']=function(_0x3927a0,_0x1033df){return db[_0x2a8b('0x1f')][_0x2a8b('0x3a')]({'where':{'id':_0x3927a0[_0x2a8b('0x38')]['id']}})[_0x2a8b('0x17')](handleEntityNotFound(_0x1033df,null))['then'](removeEntity(_0x1033df,null))['catch'](handleError(_0x1033df,null));};exports[_0x2a8b('0x3d')]=function(_0x11826f,_0x232087){return db[_0x2a8b('0x1f')][_0x2a8b('0x3d')]()[_0x2a8b('0x17')](respondWithResult(_0x232087,null))['catch'](handleError(_0x232087,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4c191eb..8e38cb0 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 _0xe60c=['moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x168a43,_0x5d0242){var _0x64a456=function(_0x562471){while(--_0x562471){_0x168a43['push'](_0x168a43['shift']());}};_0x64a456(++_0x5d0242);}(_0xe60c,0x1ca));var _0xce60=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xe60c[_0xacb1e2];return _0x463815;};'use strict';var _=require(_0xce60('0x0'));var util=require(_0xce60('0x1'));var logger=require(_0xce60('0x2'))(_0xce60('0x3'));var moment=require(_0xce60('0x4'));var BPromise=require(_0xce60('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce60('0x6'));var rimraf=require(_0xce60('0x7'));var config=require(_0xce60('0x8'));var attributes=require(_0xce60('0x9'));module[_0xce60('0xa')]=function(_0x35fd1e,_0x3b8377){return _0x35fd1e[_0xce60('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0xce60('0xc'),'paranoid':![],'indexes':[{'name':_0xce60('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x623a=['moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x623a,0x98));var _0xa623=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x623a[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xa623('0x0'));var util=require(_0xa623('0x1'));var logger=require(_0xa623('0x2'))(_0xa623('0x3'));var moment=require(_0xa623('0x4'));var BPromise=require(_0xa623('0x5'));var rp=require(_0xa623('0x6'));var fs=require('fs');var path=require(_0xa623('0x7'));var rimraf=require('rimraf');var config=require(_0xa623('0x8'));var attributes=require(_0xa623('0x9'));module['exports']=function(_0x154560,_0xcc500){return _0x154560[_0xa623('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0xa623('0xb'),'paranoid':![],'indexes':[{'name':_0xa623('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 8c63fcb..2c28252 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 _0xdcfa=['http','request','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xdcfa,0xad));var _0xadcf=function(_0x500d35,_0x3f5d69){_0x500d35=_0x500d35-0x0;var _0x383af4=_0xdcfa[_0x500d35];return _0x383af4;};'use strict';var _=require(_0xadcf('0x0'));var util=require('util');var moment=require(_0xadcf('0x1'));var BPromise=require('bluebird');var rs=require(_0xadcf('0x2'));var fs=require('fs');var Redis=require(_0xadcf('0x3'));var db=require(_0xadcf('0x4'))['db'];var utils=require(_0xadcf('0x5'));var logger=require(_0xadcf('0x6'))(_0xadcf('0x7'));var config=require(_0xadcf('0x8'));var jayson=require(_0xadcf('0x9'));var client=jayson[_0xadcf('0xa')][_0xadcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x182f1c,_0x381b4c,_0x5a98ab){return new BPromise(function(_0x41cdbf,_0x5db108){return client[_0xadcf('0xc')](_0x182f1c,_0x5a98ab)[_0xadcf('0xd')](function(_0x58be29){logger[_0xadcf('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x381b4c,_0xadcf('0xf'));logger['debug'](_0xadcf('0x10'),_0x381b4c,_0xadcf('0xf'),JSON['stringify'](_0x58be29));if(_0x58be29[_0xadcf('0x11')]){if(_0x58be29[_0xadcf('0x11')][_0xadcf('0x12')]===0x1f4){logger[_0xadcf('0x11')](_0xadcf('0x13'),_0x381b4c,_0x58be29[_0xadcf('0x11')]['message']);return _0x5db108(_0x58be29[_0xadcf('0x11')][_0xadcf('0x14')]);}logger[_0xadcf('0x11')](_0xadcf('0x13'),_0x381b4c,_0x58be29[_0xadcf('0x11')]['message']);return _0x41cdbf(_0x58be29[_0xadcf('0x11')][_0xadcf('0x14')]);}else{logger['info'](_0xadcf('0x13'),_0x381b4c,_0xadcf('0xf'));_0x41cdbf(_0x58be29[_0xadcf('0x15')][_0xadcf('0x14')]);}})[_0xadcf('0x16')](function(_0x4d9333){logger[_0xadcf('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x381b4c,_0x4d9333);_0x5db108(_0x4d9333);});});} \ No newline at end of file +var _0x6385=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x2c7d29,_0x519104){var _0x55ec63=function(_0x2e6aad){while(--_0x2e6aad){_0x2c7d29['push'](_0x2c7d29['shift']());}};_0x55ec63(++_0x519104);}(_0x6385,0xf9));var _0x5638=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x6385[_0x3cc9d9];return _0x1a425d;};'use strict';var _=require(_0x5638('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5638('0x1'));var rs=require(_0x5638('0x2'));var fs=require('fs');var Redis=require(_0x5638('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5638('0x4'));var logger=require(_0x5638('0x5'))(_0x5638('0x6'));var config=require(_0x5638('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5638('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x160031,_0x4c7d44,_0x50acdf){return new BPromise(function(_0x394a7d,_0x11f903){return client[_0x5638('0x9')](_0x160031,_0x50acdf)[_0x5638('0xa')](function(_0x4a9deb){logger['info'](_0x5638('0xb'),_0x4c7d44,_0x5638('0xc'));logger[_0x5638('0xd')](_0x5638('0xe'),_0x4c7d44,'request\x20sent',JSON[_0x5638('0xf')](_0x4a9deb));if(_0x4a9deb['error']){if(_0x4a9deb[_0x5638('0x10')][_0x5638('0x11')]===0x1f4){logger['error'](_0x5638('0xb'),_0x4c7d44,_0x4a9deb['error']['message']);return _0x11f903(_0x4a9deb['error'][_0x5638('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c7d44,_0x4a9deb[_0x5638('0x10')]['message']);return _0x394a7d(_0x4a9deb['error'][_0x5638('0x12')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x4c7d44,_0x5638('0xc'));_0x394a7d(_0x4a9deb['result'][_0x5638('0x12')]);}})[_0x5638('0x13')](function(_0x27c094){logger[_0x5638('0x10')](_0x5638('0xb'),_0x4c7d44,_0x27c094);_0x11f903(_0x27c094);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2549bd9..daf56d6 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 _0xca20=['../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x52e450,_0xb2cc86){var _0x2a5d4c=function(_0x2c1f4a){while(--_0x2c1f4a){_0x52e450['push'](_0x52e450['shift']());}};_0x2a5d4c(++_0xb2cc86);}(_0xca20,0xcc));var _0x0ca2=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0xca20[_0x112e2a];return _0x4f8af9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0ca2('0x0'));var express=require('express');var router=express[_0x0ca2('0x1')]();var auth=require(_0x0ca2('0x2'));var interaction=require(_0x0ca2('0x3'));var config=require(_0x0ca2('0x4'));var controller=require(_0x0ca2('0x5'));router[_0x0ca2('0x6')]('/',auth['isAuthenticated'](),controller[_0x0ca2('0x7')]);router[_0x0ca2('0x6')](_0x0ca2('0x8'),auth[_0x0ca2('0x9')](),controller[_0x0ca2('0xa')]);router[_0x0ca2('0xb')]('/',auth['isAuthenticated'](),controller[_0x0ca2('0xc')]);router[_0x0ca2('0xd')](_0x0ca2('0x8'),auth['isAuthenticated'](),controller[_0x0ca2('0xe')]);router[_0x0ca2('0xf')](_0x0ca2('0x8'),auth[_0x0ca2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6662=['/:id','isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get'];(function(_0x39854c,_0x35cfaf){var _0x8945cf=function(_0x2a7f43){while(--_0x2a7f43){_0x39854c['push'](_0x39854c['shift']());}};_0x8945cf(++_0x35cfaf);}(_0x6662,0x116));var _0x2666=function(_0x127c7e,_0x470192){_0x127c7e=_0x127c7e-0x0;var _0x45f955=_0x6662[_0x127c7e];return _0x45f955;};'use strict';var multer=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var path=require(_0x2666('0x2'));var timeout=require(_0x2666('0x3'));var express=require(_0x2666('0x4'));var router=express[_0x2666('0x5')]();var auth=require(_0x2666('0x6'));var interaction=require(_0x2666('0x7'));var config=require('../../config/environment');var controller=require(_0x2666('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2666('0x9')]);router[_0x2666('0xa')](_0x2666('0xb'),auth[_0x2666('0xc')](),controller[_0x2666('0xd')]);router['post']('/',auth[_0x2666('0xc')](),controller['create']);router['put']('/:id',auth[_0x2666('0xc')](),controller[_0x2666('0xe')]);router[_0x2666('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2666('0x10')]);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 aae827f..7e5d907 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 _0xb243=['exports','STRING','sequelize'];(function(_0x209d28,_0x1ee824){var _0x1be78d=function(_0x4a46f0){while(--_0x4a46f0){_0x209d28['push'](_0x209d28['shift']());}};_0x1be78d(++_0x1ee824);}(_0xb243,0xaa));var _0x3b24=function(_0x15844a,_0x492ebd){_0x15844a=_0x15844a-0x0;var _0x1922c7=_0xb243[_0x15844a];return _0x1922c7;};'use strict';var Sequelize=require(_0x3b24('0x0'));module[_0x3b24('0x1')]={'name':{'type':Sequelize[_0x3b24('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x50eb=['sequelize','exports','STRING'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x50eb,0x1aa));var _0xb50e=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x50eb[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require(_0xb50e('0x0'));module[_0xb50e('0x1')]={'name':{'type':Sequelize[_0xb50e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb50e('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 9bf9d14..7927343 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 _0x7243=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','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/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','stack','name','map','Pause','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','user','get'];(function(_0x86d62,_0x336d5c){var _0x430684=function(_0x4e3ccf){while(--_0x4e3ccf){_0x86d62['push'](_0x86d62['shift']());}};_0x430684(++_0x336d5c);}(_0x7243,0xfe));var _0x3724=function(_0x2fc53b,_0x2a5c18){_0x2fc53b=_0x2fc53b-0x0;var _0x536a35=_0x7243[_0x2fc53b];return _0x536a35;};'use strict';var pdf=require(_0x3724('0x0'));var emlformat=require(_0x3724('0x1'));var rimraf=require(_0x3724('0x2'));var zipdir=require(_0x3724('0x3'));var jsonpatch=require(_0x3724('0x4'));var rp=require('request-promise');var moment=require(_0x3724('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3724('0x6'));var util=require(_0x3724('0x7'));var path=require(_0x3724('0x8'));var sox=require(_0x3724('0x9'));var csv=require(_0x3724('0xa'));var ejs=require(_0x3724('0xb'));var fs=require('fs');var _=require(_0x3724('0xc'));var squel=require(_0x3724('0xd'));var crypto=require(_0x3724('0xe'));var jsforce=require(_0x3724('0xf'));var deskjs=require(_0x3724('0x10'));var toCsv=require(_0x3724('0xa'));var querystring=require(_0x3724('0x11'));var Papa=require(_0x3724('0x12'));var Redis=require(_0x3724('0x13'));var authService=require(_0x3724('0x14'));var qs=require(_0x3724('0x15'));var as=require(_0x3724('0x16'));var hardwareService=require(_0x3724('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3724('0x18'));var config=require('../../config/environment');var db=require(_0x3724('0x19'))['db'];function respondWithStatusCode(_0x5d7a52,_0x2d3fcb){_0x2d3fcb=_0x2d3fcb||0xcc;return function(_0x9ea002){if(_0x9ea002){return _0x5d7a52[_0x3724('0x1a')](_0x2d3fcb);}return _0x5d7a52[_0x3724('0x1b')](_0x2d3fcb)[_0x3724('0x1c')]();};}function respondWithResult(_0x475981,_0x334d4d){_0x334d4d=_0x334d4d||0xc8;return function(_0x217954){if(_0x217954){return _0x475981[_0x3724('0x1b')](_0x334d4d)[_0x3724('0x1d')](_0x217954);}};}function respondWithFilteredResult(_0x29f611,_0x406bef){return function(_0x3033eb){if(_0x3033eb){var _0x205aae=_0x3033eb[_0x3724('0x1e')],_0x2b7223=_0x406bef[_0x3724('0x1f')],_0x45606b=_0x406bef['offset']+_0x406bef['limit'],_0x18a372;if(_0x45606b>=_0x205aae){_0x45606b=_0x205aae;_0x18a372=0xc8;}else{_0x18a372=0xce;}_0x29f611[_0x3724('0x1b')](_0x18a372);return _0x29f611[_0x3724('0x20')](_0x3724('0x21'),_0x2b7223+'-'+_0x45606b+'/'+_0x205aae)[_0x3724('0x1d')](_0x3033eb);}return null;};}function patchUpdates(_0xed1c79){return function(_0x4c1dde){try{jsonpatch[_0x3724('0x22')](_0x4c1dde,_0xed1c79,!![]);}catch(_0x9fcf13){return BPromise[_0x3724('0x23')](_0x9fcf13);}return _0x4c1dde[_0x3724('0x24')]();};}function saveUpdates(_0x59fc5b,_0x161398){return function(_0x1ad0fe){if(_0x1ad0fe){return _0x1ad0fe['update'](_0x59fc5b)[_0x3724('0x25')](function(_0x507188){return _0x507188;});}return null;};}function removeEntity(_0x2bcfa4,_0x22d31a){return function(_0x54c0bf){if(_0x54c0bf){return _0x54c0bf[_0x3724('0x26')]()[_0x3724('0x25')](function(){var _0x51887d=_0x54c0bf['get']({'plain':!![]});var _0x5750ed='Pauses';return db[_0x3724('0x27')][_0x3724('0x26')]({'where':{'type':_0x5750ed,'resourceId':_0x51887d['id']}})[_0x3724('0x25')](function(){return _0x54c0bf;});})[_0x3724('0x25')](function(){_0x2bcfa4[_0x3724('0x1b')](0xcc)[_0x3724('0x1c')]();});}};}function handleEntityNotFound(_0x23fb6a,_0x371a45){return function(_0x4605fb){if(!_0x4605fb){_0x23fb6a[_0x3724('0x1a')](0x194);}return _0x4605fb;};}function handleError(_0x2cf028,_0x314354){_0x314354=_0x314354||0x1f4;return function(_0x4c9145){logger['error'](_0x4c9145[_0x3724('0x28')]);if(_0x4c9145[_0x3724('0x29')]){delete _0x4c9145['name'];}_0x2cf028['status'](_0x314354)['send'](_0x4c9145);};}exports['index']=function(_0x23fbca,_0x2b0de7){var _0x149a18={},_0x5a124d={},_0x165a73={'count':0x0,'rows':[]};var _0x1848f0=_[_0x3724('0x2a')](db[_0x3724('0x2b')][_0x3724('0x2c')],function(_0x332def){return{'name':_0x332def[_0x3724('0x2d')],'type':_0x332def[_0x3724('0x2e')][_0x3724('0x2f')]};});_0x5a124d[_0x3724('0x30')]=_[_0x3724('0x2a')](_0x1848f0,_0x3724('0x29'));_0x5a124d['query']=_[_0x3724('0x31')](_0x23fbca[_0x3724('0x32')]);_0x5a124d[_0x3724('0x33')]=_['intersection'](_0x5a124d[_0x3724('0x30')],_0x5a124d[_0x3724('0x32')]);_0x149a18[_0x3724('0x34')]=_['intersection'](_0x5a124d[_0x3724('0x30')],qs[_0x3724('0x35')](_0x23fbca[_0x3724('0x32')][_0x3724('0x35')]));_0x149a18[_0x3724('0x34')]=_0x149a18[_0x3724('0x34')][_0x3724('0x36')]?_0x149a18[_0x3724('0x34')]:_0x5a124d[_0x3724('0x30')];if(!_0x23fbca['query']['hasOwnProperty'](_0x3724('0x37'))){_0x149a18['limit']=qs[_0x3724('0x38')](_0x23fbca[_0x3724('0x32')][_0x3724('0x38')]);_0x149a18[_0x3724('0x1f')]=qs[_0x3724('0x1f')](_0x23fbca[_0x3724('0x32')]['offset']);}_0x149a18['order']=qs['sort'](_0x23fbca['query'][_0x3724('0x39')]);_0x149a18[_0x3724('0x3a')]=qs[_0x3724('0x33')](_[_0x3724('0x3b')](_0x23fbca[_0x3724('0x32')],_0x5a124d[_0x3724('0x33')]),_0x1848f0);if(_0x23fbca[_0x3724('0x32')][_0x3724('0x3c')]){_0x149a18['where']=_[_0x3724('0x3d')](_0x149a18[_0x3724('0x3a')],{'$or':_[_0x3724('0x2a')](_0x1848f0,function(_0x402c0a){if(_0x402c0a[_0x3724('0x2e')]!=='VIRTUAL'){var _0x2891e7={};_0x2891e7[_0x402c0a[_0x3724('0x29')]]={'$like':'%'+_0x23fbca[_0x3724('0x32')]['filter']+'%'};return _0x2891e7;}})});}_0x149a18=_[_0x3724('0x3d')]({},_0x149a18,_0x23fbca['options']);var _0x46d4df={'where':_0x149a18['where']};return db[_0x3724('0x2b')][_0x3724('0x1e')](_0x46d4df)['then'](function(_0x1aebb2){_0x165a73['count']=_0x1aebb2;if(_0x23fbca[_0x3724('0x32')]['includeAll']){_0x149a18['include']=[{'all':!![]}];}return db[_0x3724('0x2b')][_0x3724('0x3e')](_0x149a18);})[_0x3724('0x25')](function(_0x5498ed){_0x165a73[_0x3724('0x3f')]=_0x5498ed;return _0x165a73;})[_0x3724('0x25')](respondWithFilteredResult(_0x2b0de7,_0x149a18))[_0x3724('0x40')](handleError(_0x2b0de7,null));};exports[_0x3724('0x41')]=function(_0x1d8ad2,_0x1e8fe3){var _0xdae0b5={'raw':!![],'where':{'id':_0x1d8ad2[_0x3724('0x42')]['id']}},_0x126089={};_0x126089[_0x3724('0x30')]=_[_0x3724('0x31')](db[_0x3724('0x2b')][_0x3724('0x2c')]);_0x126089['query']=_['keys'](_0x1d8ad2[_0x3724('0x32')]);_0x126089['filters']=_['intersection'](_0x126089[_0x3724('0x30')],_0x126089[_0x3724('0x32')]);_0xdae0b5['attributes']=_[_0x3724('0x43')](_0x126089[_0x3724('0x30')],qs['fields'](_0x1d8ad2['query'][_0x3724('0x35')]));_0xdae0b5[_0x3724('0x34')]=_0xdae0b5['attributes'][_0x3724('0x36')]?_0xdae0b5['attributes']:_0x126089[_0x3724('0x30')];if(_0x1d8ad2[_0x3724('0x32')][_0x3724('0x44')]){_0xdae0b5['include']=[{'all':!![]}];}_0xdae0b5=_['merge']({},_0xdae0b5,_0x1d8ad2[_0x3724('0x45')]);return db['Pause'][_0x3724('0x46')](_0xdae0b5)[_0x3724('0x25')](handleEntityNotFound(_0x1e8fe3,null))['then'](respondWithResult(_0x1e8fe3,null))['catch'](handleError(_0x1e8fe3,null));};exports[_0x3724('0x47')]=function(_0x5e0d48,_0x5d7fcf){return db['Pause']['create'](_0x5e0d48['body'],{})[_0x3724('0x25')](function(_0x4d456d){var _0x474e6a=_0x5e0d48[_0x3724('0x48')][_0x3724('0x49')]({'plain':!![]});if(!_0x474e6a)throw new Error(_0x3724('0x4a'));if(_0x474e6a['role']===_0x3724('0x48')){var _0x3359dd=_0x4d456d['get']({'plain':!![]});var _0x11c26c='Pauses';return db[_0x3724('0x4b')][_0x3724('0x46')]({'where':{'name':_0x11c26c,'userProfileId':_0x474e6a[_0x3724('0x4c')]},'raw':!![]})['then'](function(_0x3c6b8d){if(_0x3c6b8d&&_0x3c6b8d[_0x3724('0x4d')]===0x0){return db[_0x3724('0x27')]['create']({'name':_0x3359dd[_0x3724('0x29')],'resourceId':_0x3359dd['id'],'type':_0x3c6b8d[_0x3724('0x29')],'sectionId':_0x3c6b8d['id']},{})[_0x3724('0x25')](function(){return _0x4d456d;});}else{return _0x4d456d;}})[_0x3724('0x40')](function(_0x495125){logger[_0x3724('0x4e')](_0x3724('0x4f'),_0x495125);throw _0x495125;});}return _0x4d456d;})[_0x3724('0x25')](respondWithResult(_0x5d7fcf,0xc9))[_0x3724('0x40')](handleError(_0x5d7fcf,null));};exports[_0x3724('0x50')]=function(_0xc5ba5d,_0x1897d5){if(_0xc5ba5d[_0x3724('0x51')]['id']){delete _0xc5ba5d['body']['id'];}return db[_0x3724('0x2b')]['find']({'where':{'id':_0xc5ba5d[_0x3724('0x42')]['id']}})['then'](handleEntityNotFound(_0x1897d5,null))[_0x3724('0x25')](saveUpdates(_0xc5ba5d['body'],null))[_0x3724('0x25')](respondWithResult(_0x1897d5,null))[_0x3724('0x40')](handleError(_0x1897d5,null));};exports[_0x3724('0x26')]=function(_0x2126f5,_0x29942f){return db[_0x3724('0x2b')]['find']({'where':{'id':_0x2126f5[_0x3724('0x42')]['id']}})[_0x3724('0x25')](handleEntityNotFound(_0x29942f,null))[_0x3724('0x25')](removeEntity(_0x29942f,null))[_0x3724('0x40')](handleError(_0x29942f,null));}; \ No newline at end of file +var _0xc7fd=['rows','catch','show','length','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','find','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','merge','options','includeAll','findAll'];(function(_0x2a18b5,_0x1851a1){var _0x3d3d7f=function(_0x31f571){while(--_0x31f571){_0x2a18b5['push'](_0x2a18b5['shift']());}};_0x3d3d7f(++_0x1851a1);}(_0xc7fd,0x14e));var _0xdc7f=function(_0x49dcf0,_0x4effb0){_0x49dcf0=_0x49dcf0-0x0;var _0x4d4d58=_0xc7fd[_0x49dcf0];return _0x4d4d58;};'use strict';var pdf=require(_0xdc7f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdc7f('0x1'));var zipdir=require(_0xdc7f('0x2'));var jsonpatch=require(_0xdc7f('0x3'));var rp=require(_0xdc7f('0x4'));var moment=require('moment');var BPromise=require(_0xdc7f('0x5'));var Mustache=require(_0xdc7f('0x6'));var util=require('util');var path=require(_0xdc7f('0x7'));var sox=require(_0xdc7f('0x8'));var csv=require('to-csv');var ejs=require(_0xdc7f('0x9'));var fs=require('fs');var _=require(_0xdc7f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdc7f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdc7f('0xc'));var querystring=require(_0xdc7f('0xd'));var Papa=require(_0xdc7f('0xe'));var Redis=require(_0xdc7f('0xf'));var authService=require(_0xdc7f('0x10'));var qs=require(_0xdc7f('0x11'));var as=require(_0xdc7f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc7f('0x13'))(_0xdc7f('0x14'));var utils=require(_0xdc7f('0x15'));var config=require(_0xdc7f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ff9c1,_0x3ec417){_0x3ec417=_0x3ec417||0xcc;return function(_0x55130b){if(_0x55130b){return _0x3ff9c1[_0xdc7f('0x17')](_0x3ec417);}return _0x3ff9c1['status'](_0x3ec417)[_0xdc7f('0x18')]();};}function respondWithResult(_0x56802d,_0x13eca5){_0x13eca5=_0x13eca5||0xc8;return function(_0x3eddf3){if(_0x3eddf3){return _0x56802d[_0xdc7f('0x19')](_0x13eca5)[_0xdc7f('0x1a')](_0x3eddf3);}};}function respondWithFilteredResult(_0x352707,_0xade325){return function(_0x17ed9e){if(_0x17ed9e){var _0x328803=_0x17ed9e[_0xdc7f('0x1b')],_0x4baa1b=_0xade325[_0xdc7f('0x1c')],_0x182f9a=_0xade325['offset']+_0xade325[_0xdc7f('0x1d')],_0x1f3dd2;if(_0x182f9a>=_0x328803){_0x182f9a=_0x328803;_0x1f3dd2=0xc8;}else{_0x1f3dd2=0xce;}_0x352707[_0xdc7f('0x19')](_0x1f3dd2);return _0x352707['set'](_0xdc7f('0x1e'),_0x4baa1b+'-'+_0x182f9a+'/'+_0x328803)['json'](_0x17ed9e);}return null;};}function patchUpdates(_0x26c63b){return function(_0x5622cc){try{jsonpatch[_0xdc7f('0x1f')](_0x5622cc,_0x26c63b,!![]);}catch(_0x539aca){return BPromise[_0xdc7f('0x20')](_0x539aca);}return _0x5622cc[_0xdc7f('0x21')]();};}function saveUpdates(_0x5c7530,_0x3889c6){return function(_0x1666ed){if(_0x1666ed){return _0x1666ed['update'](_0x5c7530)[_0xdc7f('0x22')](function(_0x4c4f54){return _0x4c4f54;});}return null;};}function removeEntity(_0x11e2d2,_0x692fd7){return function(_0x259d0c){if(_0x259d0c){return _0x259d0c[_0xdc7f('0x23')]()['then'](function(){var _0x5d084b=_0x259d0c[_0xdc7f('0x24')]({'plain':!![]});var _0x16c50a=_0xdc7f('0x25');return db[_0xdc7f('0x26')][_0xdc7f('0x23')]({'where':{'type':_0x16c50a,'resourceId':_0x5d084b['id']}})[_0xdc7f('0x22')](function(){return _0x259d0c;});})[_0xdc7f('0x22')](function(){_0x11e2d2[_0xdc7f('0x19')](0xcc)[_0xdc7f('0x18')]();});}};}function handleEntityNotFound(_0x6110,_0x57f86b){return function(_0x18eba6){if(!_0x18eba6){_0x6110[_0xdc7f('0x17')](0x194);}return _0x18eba6;};}function handleError(_0x18934a,_0x1156bb){_0x1156bb=_0x1156bb||0x1f4;return function(_0x588437){logger[_0xdc7f('0x27')](_0x588437[_0xdc7f('0x28')]);if(_0x588437[_0xdc7f('0x29')]){delete _0x588437[_0xdc7f('0x29')];}_0x18934a['status'](_0x1156bb)[_0xdc7f('0x2a')](_0x588437);};}exports[_0xdc7f('0x2b')]=function(_0x1d99d3,_0x1e2d60){var _0x3962c8={},_0x6ad49a={},_0x5315d1={'count':0x0,'rows':[]};var _0x5d00f4=_[_0xdc7f('0x2c')](db[_0xdc7f('0x2d')][_0xdc7f('0x2e')],function(_0x36cc95){return{'name':_0x36cc95['fieldName'],'type':_0x36cc95[_0xdc7f('0x2f')][_0xdc7f('0x30')]};});_0x6ad49a['model']=_[_0xdc7f('0x2c')](_0x5d00f4,_0xdc7f('0x29'));_0x6ad49a['query']=_[_0xdc7f('0x31')](_0x1d99d3[_0xdc7f('0x32')]);_0x6ad49a['filters']=_[_0xdc7f('0x33')](_0x6ad49a[_0xdc7f('0x34')],_0x6ad49a['query']);_0x3962c8[_0xdc7f('0x35')]=_[_0xdc7f('0x33')](_0x6ad49a[_0xdc7f('0x34')],qs[_0xdc7f('0x36')](_0x1d99d3[_0xdc7f('0x32')][_0xdc7f('0x36')]));_0x3962c8[_0xdc7f('0x35')]=_0x3962c8[_0xdc7f('0x35')]['length']?_0x3962c8[_0xdc7f('0x35')]:_0x6ad49a[_0xdc7f('0x34')];if(!_0x1d99d3['query'][_0xdc7f('0x37')](_0xdc7f('0x38'))){_0x3962c8[_0xdc7f('0x1d')]=qs['limit'](_0x1d99d3[_0xdc7f('0x32')][_0xdc7f('0x1d')]);_0x3962c8[_0xdc7f('0x1c')]=qs[_0xdc7f('0x1c')](_0x1d99d3[_0xdc7f('0x32')]['offset']);}_0x3962c8['order']=qs[_0xdc7f('0x39')](_0x1d99d3[_0xdc7f('0x32')][_0xdc7f('0x39')]);_0x3962c8[_0xdc7f('0x3a')]=qs['filters'](_[_0xdc7f('0x3b')](_0x1d99d3['query'],_0x6ad49a[_0xdc7f('0x3c')]),_0x5d00f4);if(_0x1d99d3[_0xdc7f('0x32')]['filter']){_0x3962c8[_0xdc7f('0x3a')]=_['merge'](_0x3962c8[_0xdc7f('0x3a')],{'$or':_[_0xdc7f('0x2c')](_0x5d00f4,function(_0x2aaf4a){if(_0x2aaf4a['type']!==_0xdc7f('0x3d')){var _0x224649={};_0x224649[_0x2aaf4a[_0xdc7f('0x29')]]={'$like':'%'+_0x1d99d3[_0xdc7f('0x32')]['filter']+'%'};return _0x224649;}})});}_0x3962c8=_[_0xdc7f('0x3e')]({},_0x3962c8,_0x1d99d3[_0xdc7f('0x3f')]);var _0x376b23={'where':_0x3962c8[_0xdc7f('0x3a')]};return db[_0xdc7f('0x2d')][_0xdc7f('0x1b')](_0x376b23)[_0xdc7f('0x22')](function(_0x235c77){_0x5315d1[_0xdc7f('0x1b')]=_0x235c77;if(_0x1d99d3[_0xdc7f('0x32')][_0xdc7f('0x40')]){_0x3962c8['include']=[{'all':!![]}];}return db[_0xdc7f('0x2d')][_0xdc7f('0x41')](_0x3962c8);})[_0xdc7f('0x22')](function(_0x271189){_0x5315d1[_0xdc7f('0x42')]=_0x271189;return _0x5315d1;})['then'](respondWithFilteredResult(_0x1e2d60,_0x3962c8))[_0xdc7f('0x43')](handleError(_0x1e2d60,null));};exports[_0xdc7f('0x44')]=function(_0x394c14,_0x460498){var _0x45caa6={'raw':!![],'where':{'id':_0x394c14['params']['id']}},_0x22afa2={};_0x22afa2[_0xdc7f('0x34')]=_[_0xdc7f('0x31')](db[_0xdc7f('0x2d')]['rawAttributes']);_0x22afa2['query']=_[_0xdc7f('0x31')](_0x394c14[_0xdc7f('0x32')]);_0x22afa2['filters']=_['intersection'](_0x22afa2['model'],_0x22afa2['query']);_0x45caa6[_0xdc7f('0x35')]=_[_0xdc7f('0x33')](_0x22afa2[_0xdc7f('0x34')],qs[_0xdc7f('0x36')](_0x394c14['query'][_0xdc7f('0x36')]));_0x45caa6[_0xdc7f('0x35')]=_0x45caa6[_0xdc7f('0x35')][_0xdc7f('0x45')]?_0x45caa6[_0xdc7f('0x35')]:_0x22afa2['model'];if(_0x394c14[_0xdc7f('0x32')][_0xdc7f('0x40')]){_0x45caa6[_0xdc7f('0x46')]=[{'all':!![]}];}_0x45caa6=_['merge']({},_0x45caa6,_0x394c14[_0xdc7f('0x3f')]);return db[_0xdc7f('0x2d')]['find'](_0x45caa6)['then'](handleEntityNotFound(_0x460498,null))[_0xdc7f('0x22')](respondWithResult(_0x460498,null))['catch'](handleError(_0x460498,null));};exports[_0xdc7f('0x47')]=function(_0x553d16,_0x2f2066){return db[_0xdc7f('0x2d')][_0xdc7f('0x47')](_0x553d16[_0xdc7f('0x48')],{})[_0xdc7f('0x22')](function(_0x5cb413){var _0x320d0d=_0x553d16[_0xdc7f('0x49')][_0xdc7f('0x24')]({'plain':!![]});if(!_0x320d0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x320d0d[_0xdc7f('0x4a')]===_0xdc7f('0x49')){var _0x22f3db=_0x5cb413[_0xdc7f('0x24')]({'plain':!![]});var _0x1be3df=_0xdc7f('0x25');return db[_0xdc7f('0x4b')]['find']({'where':{'name':_0x1be3df,'userProfileId':_0x320d0d[_0xdc7f('0x4c')]},'raw':!![]})[_0xdc7f('0x22')](function(_0x318241){if(_0x318241&&_0x318241[_0xdc7f('0x4d')]===0x0){return db[_0xdc7f('0x26')]['create']({'name':_0x22f3db[_0xdc7f('0x29')],'resourceId':_0x22f3db['id'],'type':_0x318241[_0xdc7f('0x29')],'sectionId':_0x318241['id']},{})['then'](function(){return _0x5cb413;});}else{return _0x5cb413;}})['catch'](function(_0x1e23a){logger[_0xdc7f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e23a);throw _0x1e23a;});}return _0x5cb413;})['then'](respondWithResult(_0x2f2066,0xc9))[_0xdc7f('0x43')](handleError(_0x2f2066,null));};exports['update']=function(_0x2f5481,_0xedbedb){if(_0x2f5481[_0xdc7f('0x48')]['id']){delete _0x2f5481[_0xdc7f('0x48')]['id'];}return db[_0xdc7f('0x2d')][_0xdc7f('0x4e')]({'where':{'id':_0x2f5481[_0xdc7f('0x4f')]['id']}})[_0xdc7f('0x22')](handleEntityNotFound(_0xedbedb,null))['then'](saveUpdates(_0x2f5481['body'],null))[_0xdc7f('0x22')](respondWithResult(_0xedbedb,null))[_0xdc7f('0x43')](handleError(_0xedbedb,null));};exports[_0xdc7f('0x23')]=function(_0x4e6582,_0x35810d){return db[_0xdc7f('0x2d')]['find']({'where':{'id':_0x4e6582['params']['id']}})['then'](handleEntityNotFound(_0x35810d,null))[_0xdc7f('0x22')](removeEntity(_0x35810d,null))[_0xdc7f('0x43')](handleError(_0x35810d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4522509..b64f822 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 _0x578c=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x578c,0x158));var _0xc578=function(_0x2987fd,_0x4e13c8){_0x2987fd=_0x2987fd-0x0;var _0x56587d=_0x578c[_0x2987fd];return _0x56587d;};'use strict';var _=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var logger=require(_0xc578('0x2'))('api');var moment=require(_0xc578('0x3'));var BPromise=require(_0xc578('0x4'));var rp=require(_0xc578('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc578('0x6'));var config=require(_0xc578('0x7'));var attributes=require(_0xc578('0x8'));module[_0xc578('0x9')]=function(_0x178786,_0x3305c9){return _0x178786[_0xc578('0xa')](_0xc578('0xb'),attributes,{'tableName':_0xc578('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8814=['api','bluebird','request-promise','path','rimraf','./pause.attributes','exports','Pause','lodash'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x8814,0x1b8));var _0x4881=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x8814[_0x38b14f];return _0x22a324;};'use strict';var _=require(_0x4881('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4881('0x1'));var moment=require('moment');var BPromise=require(_0x4881('0x2'));var rp=require(_0x4881('0x3'));var fs=require('fs');var path=require(_0x4881('0x4'));var rimraf=require(_0x4881('0x5'));var config=require('../../config/environment');var attributes=require(_0x4881('0x6'));module[_0x4881('0x7')]=function(_0x20bc6c,_0x1f292f){return _0x20bc6c['define'](_0x4881('0x8'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 161bbeb..f156290 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 _0x350a=['raw','where','attributes','map','include','model','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','find','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x350a,0xb1));var _0xa350=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x350a[_0x18afca];return _0x11603f;};'use strict';var _=require(_0xa350('0x0'));var util=require(_0xa350('0x1'));var moment=require(_0xa350('0x2'));var BPromise=require('bluebird');var rs=require(_0xa350('0x3'));var fs=require('fs');var Redis=require(_0xa350('0x4'));var db=require(_0xa350('0x5'))['db'];var utils=require(_0xa350('0x6'));var logger=require(_0xa350('0x7'))(_0xa350('0x8'));var config=require('../../config/environment');var jayson=require(_0xa350('0x9'));var client=jayson[_0xa350('0xa')][_0xa350('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x279c69,_0x578c99,_0x229c80){return new BPromise(function(_0x3973fc,_0x5b04af){return client[_0xa350('0xc')](_0x279c69,_0x229c80)[_0xa350('0xd')](function(_0xce8765){logger['info'](_0xa350('0xe'),_0x578c99,_0xa350('0xf'));logger[_0xa350('0x10')](_0xa350('0x11'),_0x578c99,_0xa350('0xf'),JSON[_0xa350('0x12')](_0xce8765));if(_0xce8765[_0xa350('0x13')]){if(_0xce8765[_0xa350('0x13')][_0xa350('0x14')]===0x1f4){logger['error'](_0xa350('0xe'),_0x578c99,_0xce8765[_0xa350('0x13')][_0xa350('0x15')]);return _0x5b04af(_0xce8765['error'][_0xa350('0x15')]);}logger['error'](_0xa350('0xe'),_0x578c99,_0xce8765[_0xa350('0x13')][_0xa350('0x15')]);return _0x3973fc(_0xce8765[_0xa350('0x13')]['message']);}else{logger['info']('Pause,\x20%s,\x20%s',_0x578c99,_0xa350('0xf'));_0x3973fc(_0xce8765[_0xa350('0x16')][_0xa350('0x15')]);}})[_0xa350('0x17')](function(_0x538d69){logger[_0xa350('0x13')]('Pause,\x20%s,\x20%s',_0x578c99,_0x538d69);_0x5b04af(_0x538d69);});});}exports[_0xa350('0x18')]=function(_0x1aec00){var _0x5bca8a=this;return new Promise(function(_0x1a7abd,_0x9cef1c){return db['Pause'][_0xa350('0x19')]({'raw':_0x1aec00[_0xa350('0x1a')]?_0x1aec00[_0xa350('0x1a')][_0xa350('0x1b')]===undefined?!![]:![]:!![],'where':_0x1aec00[_0xa350('0x1a')]?_0x1aec00[_0xa350('0x1a')][_0xa350('0x1c')]||null:null,'attributes':_0x1aec00['options']?_0x1aec00[_0xa350('0x1a')][_0xa350('0x1d')]||null:null,'include':_0x1aec00[_0xa350('0x1a')]?_0x1aec00['options']['include']?_[_0xa350('0x1e')](_0x1aec00['options'][_0xa350('0x1f')],function(_0x2b8b2f){return{'model':db[_0x2b8b2f[_0xa350('0x20')]],'as':_0x2b8b2f['as'],'attributes':_0x2b8b2f['attributes'],'include':_0x2b8b2f[_0xa350('0x1f')]?_['map'](_0x2b8b2f[_0xa350('0x1f')],function(_0x313a24){return{'model':db[_0x313a24[_0xa350('0x20')]],'as':_0x313a24['as'],'attributes':_0x313a24['attributes'],'include':_0x313a24[_0xa350('0x1f')]?_['map'](_0x313a24[_0xa350('0x1f')],function(_0x4328e3){return{'model':db[_0x4328e3[_0xa350('0x20')]],'as':_0x4328e3['as'],'attributes':_0x4328e3['attributes']};}):[]};}):[]};}):[]:[]})[_0xa350('0xd')](function(_0x5aa688){logger[_0xa350('0x21')](_0xa350('0x18'),_0x1aec00);logger[_0xa350('0x10')]('ShowPause',_0x1aec00,JSON[_0xa350('0x12')](_0x5aa688));_0x1a7abd(_0x5aa688);})[_0xa350('0x17')](function(_0x56e3d1){logger['error'](_0xa350('0x18'),_0x56e3d1['message'],_0x1aec00);_0x9cef1c(_0x5bca8a[_0xa350('0x13')](0x1f4,_0x56e3d1[_0xa350('0x15')]));});});}; \ No newline at end of file +var _0x8d59=['model','attributes','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ShowPause','find','options','raw','include','map'];(function(_0x4c4c28,_0xc8431c){var _0x45537b=function(_0x5168a4){while(--_0x5168a4){_0x4c4c28['push'](_0x4c4c28['shift']());}};_0x45537b(++_0xc8431c);}(_0x8d59,0xa5));var _0x98d5=function(_0x34ccbb,_0x4f3dbc){_0x34ccbb=_0x34ccbb-0x0;var _0x1aea87=_0x8d59[_0x34ccbb];return _0x1aea87;};'use strict';var _=require('lodash');var util=require(_0x98d5('0x0'));var moment=require(_0x98d5('0x1'));var BPromise=require(_0x98d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98d5('0x3'));var db=require(_0x98d5('0x4'))['db'];var utils=require(_0x98d5('0x5'));var logger=require('../../config/logger')(_0x98d5('0x6'));var config=require(_0x98d5('0x7'));var jayson=require(_0x98d5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x72678c,_0x3bae2f,_0x1206ad){return new BPromise(function(_0x4889ee,_0x9317b2){return client[_0x98d5('0x9')](_0x72678c,_0x1206ad)[_0x98d5('0xa')](function(_0x3e540c){logger[_0x98d5('0xb')](_0x98d5('0xc'),_0x3bae2f,'request\x20sent');logger['debug'](_0x98d5('0xd'),_0x3bae2f,_0x98d5('0xe'),JSON['stringify'](_0x3e540c));if(_0x3e540c[_0x98d5('0xf')]){if(_0x3e540c[_0x98d5('0xf')][_0x98d5('0x10')]===0x1f4){logger[_0x98d5('0xf')]('Pause,\x20%s,\x20%s',_0x3bae2f,_0x3e540c['error'][_0x98d5('0x11')]);return _0x9317b2(_0x3e540c['error'][_0x98d5('0x11')]);}logger['error']('Pause,\x20%s,\x20%s',_0x3bae2f,_0x3e540c[_0x98d5('0xf')]['message']);return _0x4889ee(_0x3e540c['error'][_0x98d5('0x11')]);}else{logger[_0x98d5('0xb')](_0x98d5('0xc'),_0x3bae2f,_0x98d5('0xe'));_0x4889ee(_0x3e540c['result']['message']);}})['catch'](function(_0x331e54){logger['error']('Pause,\x20%s,\x20%s',_0x3bae2f,_0x331e54);_0x9317b2(_0x331e54);});});}exports[_0x98d5('0x12')]=function(_0x3bb2e1){var _0x43426f=this;return new Promise(function(_0x42074d,_0x14ed3a){return db['Pause'][_0x98d5('0x13')]({'raw':_0x3bb2e1[_0x98d5('0x14')]?_0x3bb2e1['options'][_0x98d5('0x15')]===undefined?!![]:![]:!![],'where':_0x3bb2e1[_0x98d5('0x14')]?_0x3bb2e1[_0x98d5('0x14')]['where']||null:null,'attributes':_0x3bb2e1[_0x98d5('0x14')]?_0x3bb2e1[_0x98d5('0x14')]['attributes']||null:null,'include':_0x3bb2e1[_0x98d5('0x14')]?_0x3bb2e1[_0x98d5('0x14')][_0x98d5('0x16')]?_[_0x98d5('0x17')](_0x3bb2e1[_0x98d5('0x14')]['include'],function(_0x5bbc84){return{'model':db[_0x5bbc84[_0x98d5('0x18')]],'as':_0x5bbc84['as'],'attributes':_0x5bbc84[_0x98d5('0x19')],'include':_0x5bbc84[_0x98d5('0x16')]?_[_0x98d5('0x17')](_0x5bbc84[_0x98d5('0x16')],function(_0x1bd0ef){return{'model':db[_0x1bd0ef[_0x98d5('0x18')]],'as':_0x1bd0ef['as'],'attributes':_0x1bd0ef[_0x98d5('0x19')],'include':_0x1bd0ef[_0x98d5('0x16')]?_[_0x98d5('0x17')](_0x1bd0ef[_0x98d5('0x16')],function(_0x15c924){return{'model':db[_0x15c924[_0x98d5('0x18')]],'as':_0x15c924['as'],'attributes':_0x15c924['attributes']};}):[]};}):[]};}):[]:[]})[_0x98d5('0xa')](function(_0x3b03a7){logger['info'](_0x98d5('0x12'),_0x3bb2e1);logger[_0x98d5('0x1a')](_0x98d5('0x12'),_0x3bb2e1,JSON['stringify'](_0x3b03a7));_0x42074d(_0x3b03a7);})['catch'](function(_0x4d794b){logger[_0x98d5('0xf')](_0x98d5('0x12'),_0x4d794b['message'],_0x3bb2e1);_0x14ed3a(_0x43426f[_0x98d5('0xf')](0x1f4,_0x4d794b[_0x98d5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 269646e..d129dfb 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 _0x24c7=['join','root','originalname','replace','format','%s-%s%s','basename','extname','now','single','webhookPost','put','/:id','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','diskStorage'];(function(_0x5c8f3e,_0x33ba70){var _0xb55f35=function(_0x48f8ef){while(--_0x48f8ef){_0x5c8f3e['push'](_0x5c8f3e['shift']());}};_0xb55f35(++_0x33ba70);}(_0x24c7,0x182));var _0x724c=function(_0x1c7252,_0x2840e3){_0x1c7252=_0x1c7252-0x0;var _0x1f9dc6=_0x24c7[_0x1c7252];return _0x1f9dc6;};'use strict';var multer=require(_0x724c('0x0'));var util=require(_0x724c('0x1'));var path=require(_0x724c('0x2'));var timeout=require(_0x724c('0x3'));var express=require(_0x724c('0x4'));var router=express[_0x724c('0x5')]();var auth=require(_0x724c('0x6'));var interaction=require(_0x724c('0x7'));var config=require(_0x724c('0x8'));var controller=require('./plugin.controller');router[_0x724c('0x9')]('/',auth[_0x724c('0xa')](),controller[_0x724c('0xb')]);router[_0x724c('0x9')](_0x724c('0xc'),controller[_0x724c('0xd')]);router['get']('/:id',auth[_0x724c('0xa')](),controller[_0x724c('0xe')]);router[_0x724c('0x9')](_0x724c('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x724c('0x10')]({'destination':function(_0x328f26,_0x154de1,_0x322897){_0x322897(null,path[_0x724c('0x11')](config[_0x724c('0x12')],'server/files/plugins'));},'filename':function(_0x4f41cb,_0xa7f2a8,_0x41ca22){_0xa7f2a8[_0x724c('0x13')]=_0xa7f2a8[_0x724c('0x13')][_0x724c('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41ca22(null,util[_0x724c('0x15')](_0x724c('0x16'),path[_0x724c('0x17')](_0xa7f2a8[_0x724c('0x13')],path[_0x724c('0x18')](_0xa7f2a8[_0x724c('0x13')])),Date[_0x724c('0x19')](),path[_0x724c('0x18')](_0xa7f2a8[_0x724c('0x13')])));}})});router['post']('/',upload[_0x724c('0x1a')]('file'),controller['upload']);router['post']('/webhook',controller[_0x724c('0x1b')]);router[_0x724c('0x1c')](_0x724c('0x1d'),auth[_0x724c('0xa')](),controller['update']);router[_0x724c('0x1e')]('/:id',auth[_0x724c('0xa')](),controller[_0x724c('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xa58b=['Router','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','webhookGet','/:id','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','webhookPost','put','delete','exports','multer','util','path','express'];(function(_0x4cb4a3,_0x3936e6){var _0x504ab9=function(_0x58d969){while(--_0x58d969){_0x4cb4a3['push'](_0x4cb4a3['shift']());}};_0x504ab9(++_0x3936e6);}(_0xa58b,0x104));var _0xba58=function(_0x49a1ec,_0x4f4a0e){_0x49a1ec=_0x49a1ec-0x0;var _0x271b28=_0xa58b[_0x49a1ec];return _0x271b28;};'use strict';var multer=require(_0xba58('0x0'));var util=require(_0xba58('0x1'));var path=require(_0xba58('0x2'));var timeout=require('connect-timeout');var express=require(_0xba58('0x3'));var router=express[_0xba58('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xba58('0x5'));var config=require(_0xba58('0x6'));var controller=require(_0xba58('0x7'));router['get']('/',auth[_0xba58('0x8')](),controller[_0xba58('0x9')]);router[_0xba58('0xa')]('/webhook',controller[_0xba58('0xb')]);router[_0xba58('0xa')](_0xba58('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xba58('0xa')]('/:id/download',auth[_0xba58('0x8')](),controller[_0xba58('0xd')]);var upload=multer({'storage':multer[_0xba58('0xe')]({'destination':function(_0x577c92,_0x3d9312,_0x4a85bc){_0x4a85bc(null,path[_0xba58('0xf')](config['root'],_0xba58('0x10')));},'filename':function(_0x370656,_0x154335,_0x1ca7c8){_0x154335['originalname']=_0x154335[_0xba58('0x11')][_0xba58('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1ca7c8(null,util[_0xba58('0x13')](_0xba58('0x14'),path[_0xba58('0x15')](_0x154335[_0xba58('0x11')],path[_0xba58('0x16')](_0x154335['originalname'])),Date[_0xba58('0x17')](),path[_0xba58('0x16')](_0x154335[_0xba58('0x11')])));}})});router[_0xba58('0x18')]('/',upload[_0xba58('0x19')](_0xba58('0x1a')),controller[_0xba58('0x1b')]);router[_0xba58('0x18')](_0xba58('0x1c'),controller[_0xba58('0x1d')]);router[_0xba58('0x1e')](_0xba58('0xc'),auth[_0xba58('0x8')](),controller['update']);router['delete'](_0xba58('0xc'),auth['isAuthenticated'](),controller[_0xba58('0x1f')]);module[_0xba58('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8f2c62b..b1ddd0f 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 _0x67ee=['BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x47cdaa,_0x49ef2a){var _0x3d016d=function(_0x46001b){while(--_0x46001b){_0x47cdaa['push'](_0x47cdaa['shift']());}};_0x3d016d(++_0x49ef2a);}(_0x67ee,0xde));var _0xe67e=function(_0x3b5ec3,_0x580f19){_0x3b5ec3=_0x3b5ec3-0x0;var _0x1ccf86=_0x67ee[_0x3b5ec3];return _0x1ccf86;};'use strict';var Sequelize=require(_0xe67e('0x0'));module['exports']={'name':{'type':Sequelize[_0xe67e('0x1')]},'type':{'type':Sequelize[_0xe67e('0x2')]('html',_0xe67e('0x3'))},'description':{'type':Sequelize[_0xe67e('0x4')]},'version':{'type':Sequelize[_0xe67e('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0xe67e('0x5')},'active':{'type':Sequelize[_0xe67e('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xe67e('0x7'),_0xe67e('0x8'),_0xe67e('0x9'),_0xe67e('0xa')),'defaultValue':'always','comment':_0xe67e('0xb')},'icon':{'type':Sequelize[_0xe67e('0x1')]},'adminUrl':{'type':Sequelize[_0xe67e('0x1')]},'agentUrl':{'type':Sequelize[_0xe67e('0x1')]},'scriptName':{'type':Sequelize[_0xe67e('0x1')]},'scriptPath':{'type':Sequelize[_0xe67e('0x1')]}}; \ No newline at end of file +var _0xeff6=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never'];(function(_0x18d5d4,_0x53f71c){var _0x5582a9=function(_0x5893d9){while(--_0x5893d9){_0x18d5d4['push'](_0x18d5d4['shift']());}};_0x5582a9(++_0x53f71c);}(_0xeff6,0x139));var _0x6eff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeff6[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x6eff('0x0')]={'name':{'type':Sequelize[_0x6eff('0x1')]},'type':{'type':Sequelize[_0x6eff('0x2')](_0x6eff('0x3'),_0x6eff('0x4'))},'description':{'type':Sequelize[_0x6eff('0x5')]},'version':{'type':Sequelize[_0x6eff('0x5')]},'path':{'type':Sequelize[_0x6eff('0x1')],'comment':_0x6eff('0x6')},'active':{'type':Sequelize[_0x6eff('0x7')],'defaultValue':0x0,'comment':_0x6eff('0x8')},'sidebar':{'type':Sequelize[_0x6eff('0x2')](_0x6eff('0x9'),_0x6eff('0xa'),'always',_0x6eff('0xb')),'defaultValue':'always','comment':_0x6eff('0xc')},'icon':{'type':Sequelize[_0x6eff('0x1')]},'adminUrl':{'type':Sequelize[_0x6eff('0x1')]},'agentUrl':{'type':Sequelize[_0x6eff('0x1')]},'scriptName':{'type':Sequelize[_0x6eff('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 dd3dab1..723b272 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 _0x7a88=['hostname','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','params','includeAll','options','find','join','root','server/files/plugins','format','%s.zip','basename','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','path','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','scriptName','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x7a88,0x155));var _0x87a8=function(_0x27a7d3,_0x24ca5b){_0x27a7d3=_0x27a7d3-0x0;var _0x107ab8=_0x7a88[_0x27a7d3];return _0x107ab8;};'use strict';var pdf=require(_0x87a8('0x0'));var emlformat=require(_0x87a8('0x1'));var rimraf=require(_0x87a8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87a8('0x3'));var rp=require(_0x87a8('0x4'));var moment=require('moment');var BPromise=require(_0x87a8('0x5'));var Mustache=require('mustache');var util=require(_0x87a8('0x6'));var path=require('path');var sox=require(_0x87a8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x87a8('0x8'));var crypto=require(_0x87a8('0x9'));var jsforce=require(_0x87a8('0xa'));var deskjs=require(_0x87a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x87a8('0xc'));var Papa=require(_0x87a8('0xd'));var extract=require(_0x87a8('0xe'));var rimraf=require('rimraf');var archiver=require(_0x87a8('0xf'));var Redis=require(_0x87a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x87a8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87a8('0x12'))(_0x87a8('0x13'));var utils=require(_0x87a8('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x87a8('0x15')]=_[_0x87a8('0x16')](config['redis'],{'host':_0x87a8('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87a8('0x15')]));require(_0x87a8('0x18'))[_0x87a8('0x19')](socket);function respondWithStatusCode(_0x290d79,_0x5004c4){_0x5004c4=_0x5004c4||0xcc;return function(_0x2085d1){if(_0x2085d1){return _0x290d79[_0x87a8('0x1a')](_0x5004c4);}return _0x290d79[_0x87a8('0x1b')](_0x5004c4)['end']();};}function respondWithResult(_0x1e3065,_0x55fcb9){_0x55fcb9=_0x55fcb9||0xc8;return function(_0x2bc94d){if(_0x2bc94d){return _0x1e3065[_0x87a8('0x1b')](_0x55fcb9)[_0x87a8('0x1c')](_0x2bc94d);}};}function respondWithFilteredResult(_0x286071,_0x5eb5f7){return function(_0x487634){if(_0x487634){var _0x395fa2=_0x487634['count'],_0xada6fb=_0x5eb5f7['offset'],_0x20d137=_0x5eb5f7[_0x87a8('0x1d')]+_0x5eb5f7[_0x87a8('0x1e')],_0x148c5c;if(_0x20d137>=_0x395fa2){_0x20d137=_0x395fa2;_0x148c5c=0xc8;}else{_0x148c5c=0xce;}_0x286071['status'](_0x148c5c);return _0x286071[_0x87a8('0x1f')](_0x87a8('0x20'),_0xada6fb+'-'+_0x20d137+'/'+_0x395fa2)[_0x87a8('0x1c')](_0x487634);}return null;};}function patchUpdates(_0x1b4cb9){return function(_0x52cfb3){try{jsonpatch[_0x87a8('0x21')](_0x52cfb3,_0x1b4cb9,!![]);}catch(_0xe99bcb){return BPromise[_0x87a8('0x22')](_0xe99bcb);}return _0x52cfb3[_0x87a8('0x23')]();};}function saveUpdates(_0x5b8248,_0x464d30){return function(_0x1b2b29){if(_0x1b2b29){return _0x1b2b29[_0x87a8('0x24')](_0x5b8248)[_0x87a8('0x25')](function(_0x3bcf0d){return _0x3bcf0d;});}return null;};}function removeEntity(_0x59531a,_0x5b7263){return function(_0x5d3a1f){if(_0x5d3a1f){return _0x5d3a1f[_0x87a8('0x26')]()['then'](function(){var _0x5c793b=_0x5d3a1f[_0x87a8('0x27')]({'plain':!![]});var _0x39bd39=_0x87a8('0x28');return db[_0x87a8('0x29')][_0x87a8('0x26')]({'where':{'type':_0x39bd39,'resourceId':_0x5c793b['id']}})['then'](function(){return _0x5d3a1f;});})['then'](function(){_0x59531a[_0x87a8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ecc58,_0xb65df3){return function(_0x17fa2){if(!_0x17fa2){_0x4ecc58[_0x87a8('0x1a')](0x194);}return _0x17fa2;};}function handleError(_0x40fce2,_0x25dd9f){_0x25dd9f=_0x25dd9f||0x1f4;return function(_0x15038b){logger[_0x87a8('0x2a')](_0x15038b[_0x87a8('0x2b')]);if(_0x15038b[_0x87a8('0x2c')]){delete _0x15038b[_0x87a8('0x2c')];}_0x40fce2[_0x87a8('0x1b')](_0x25dd9f)[_0x87a8('0x2d')](_0x15038b);};}exports[_0x87a8('0x2e')]=function(_0x3aa513,_0x3b883e){var _0x4ef0d5={},_0x5b6d8a={},_0x281428={'count':0x0,'rows':[]};var _0x4aaa1e=_['map'](db[_0x87a8('0x2f')][_0x87a8('0x30')],function(_0x16c0a4){return{'name':_0x16c0a4[_0x87a8('0x31')],'type':_0x16c0a4[_0x87a8('0x32')][_0x87a8('0x33')]};});_0x5b6d8a[_0x87a8('0x34')]=_[_0x87a8('0x35')](_0x4aaa1e,_0x87a8('0x2c'));_0x5b6d8a[_0x87a8('0x36')]=_[_0x87a8('0x37')](_0x3aa513['query']);_0x5b6d8a['filters']=_[_0x87a8('0x38')](_0x5b6d8a[_0x87a8('0x34')],_0x5b6d8a[_0x87a8('0x36')]);_0x4ef0d5['attributes']=_['intersection'](_0x5b6d8a[_0x87a8('0x34')],qs[_0x87a8('0x39')](_0x3aa513['query']['fields']));_0x4ef0d5[_0x87a8('0x3a')]=_0x4ef0d5[_0x87a8('0x3a')][_0x87a8('0x3b')]?_0x4ef0d5[_0x87a8('0x3a')]:_0x5b6d8a[_0x87a8('0x34')];if(!_0x3aa513[_0x87a8('0x36')]['hasOwnProperty'](_0x87a8('0x3c'))){_0x4ef0d5['limit']=qs[_0x87a8('0x1e')](_0x3aa513['query'][_0x87a8('0x1e')]);_0x4ef0d5[_0x87a8('0x1d')]=qs[_0x87a8('0x1d')](_0x3aa513[_0x87a8('0x36')][_0x87a8('0x1d')]);}_0x4ef0d5[_0x87a8('0x3d')]=qs[_0x87a8('0x3e')](_0x3aa513['query'][_0x87a8('0x3e')]);_0x4ef0d5[_0x87a8('0x3f')]=qs[_0x87a8('0x40')](_[_0x87a8('0x41')](_0x3aa513[_0x87a8('0x36')],_0x5b6d8a[_0x87a8('0x40')]),_0x4aaa1e);if(_0x3aa513[_0x87a8('0x36')][_0x87a8('0x42')]){_0x4ef0d5['where']=_[_0x87a8('0x43')](_0x4ef0d5[_0x87a8('0x3f')],{'$or':_[_0x87a8('0x35')](_0x4aaa1e,function(_0x2e5068){if(_0x2e5068['type']!==_0x87a8('0x44')){var _0x469dd0={};_0x469dd0[_0x2e5068[_0x87a8('0x2c')]]={'$like':'%'+_0x3aa513['query']['filter']+'%'};return _0x469dd0;}})});}_0x4ef0d5=_[_0x87a8('0x43')]({},_0x4ef0d5,_0x3aa513['options']);var _0x3adc09={'where':_0x4ef0d5[_0x87a8('0x3f')]};return db[_0x87a8('0x2f')][_0x87a8('0x45')](_0x3adc09)[_0x87a8('0x25')](function(_0x558a84){_0x281428['count']=_0x558a84;if(_0x3aa513[_0x87a8('0x36')]['includeAll']){_0x4ef0d5['include']=[{'all':!![]}];}return db[_0x87a8('0x2f')][_0x87a8('0x46')](_0x4ef0d5);})['then'](function(_0x4f5073){_0x281428[_0x87a8('0x47')]=_0x4f5073;return _0x281428;})['then'](respondWithFilteredResult(_0x3b883e,_0x4ef0d5))[_0x87a8('0x48')](handleError(_0x3b883e,null));};exports['show']=function(_0x180292,_0x4229e5){var _0x3ca3aa={'raw':!![],'where':{'id':_0x180292[_0x87a8('0x49')]['id']}},_0x17f9b7={};_0x17f9b7['model']=_[_0x87a8('0x37')](db['Plugin'][_0x87a8('0x30')]);_0x17f9b7['query']=_[_0x87a8('0x37')](_0x180292['query']);_0x17f9b7[_0x87a8('0x40')]=_[_0x87a8('0x38')](_0x17f9b7[_0x87a8('0x34')],_0x17f9b7[_0x87a8('0x36')]);_0x3ca3aa['attributes']=_[_0x87a8('0x38')](_0x17f9b7[_0x87a8('0x34')],qs['fields'](_0x180292[_0x87a8('0x36')][_0x87a8('0x39')]));_0x3ca3aa[_0x87a8('0x3a')]=_0x3ca3aa[_0x87a8('0x3a')]['length']?_0x3ca3aa[_0x87a8('0x3a')]:_0x17f9b7[_0x87a8('0x34')];if(_0x180292[_0x87a8('0x36')][_0x87a8('0x4a')]){_0x3ca3aa['include']=[{'all':!![]}];}_0x3ca3aa=_[_0x87a8('0x43')]({},_0x3ca3aa,_0x180292[_0x87a8('0x4b')]);return db[_0x87a8('0x2f')][_0x87a8('0x4c')](_0x3ca3aa)[_0x87a8('0x25')](handleEntityNotFound(_0x4229e5,null))['then'](respondWithResult(_0x4229e5,null))[_0x87a8('0x48')](handleError(_0x4229e5,null));};exports['download']=function(_0x777f04,_0x2a4b4f,_0x27e159){return db[_0x87a8('0x2f')]['find']({'where':{'id':_0x777f04[_0x87a8('0x49')]['id']},'attributes':[_0x87a8('0x2c'),'path'],'raw':!![]})[_0x87a8('0x25')](handleEntityNotFound(_0x2a4b4f,null))[_0x87a8('0x25')](function(_0x39a96e){if(_0x39a96e){var _0x51e7c6=path[_0x87a8('0x4d')](config[_0x87a8('0x4e')],_0x87a8('0x4f'),util[_0x87a8('0x50')](_0x87a8('0x51'),path[_0x87a8('0x52')](_0x39a96e['path'])));var _0x4db288=fs['createWriteStream'](_0x51e7c6);var _0x173ce1=archiver('zip',{'zlib':{'level':0x9}});_0x173ce1['on'](_0x87a8('0x53'),function(_0x126faf){if(_0x126faf[_0x87a8('0x54')]===_0x87a8('0x55')){logger[_0x87a8('0x2a')](_0x126faf);}else{throw new db[(_0x87a8('0x56'))]['Error'](_0x87a8('0x57'));}});_0x173ce1['on'](_0x87a8('0x2a'),function(_0x499b89){throw new db[(_0x87a8('0x56'))]['Error'](_0x87a8('0x57'));});_0x173ce1[_0x87a8('0x58')](_0x4db288);_0x173ce1[_0x87a8('0x59')](_0x87a8('0x5a'),{'cwd':path[_0x87a8('0x4d')](config[_0x87a8('0x4e')],_0x87a8('0x4f'),path[_0x87a8('0x5b')](_0x39a96e[_0x87a8('0x5c')])),'ignore':[path[_0x87a8('0x4d')](path['basename'](_0x39a96e['path']),_0x87a8('0x5d')),path[_0x87a8('0x4d')](path[_0x87a8('0x52')](_0x39a96e[_0x87a8('0x5c')]),_0x87a8('0x5e'))],'nodir':!![]})[_0x87a8('0x5f')]();_0x4db288['on'](_0x87a8('0x60'),function(){if(!fs[_0x87a8('0x61')](_0x51e7c6)){throw new db[(_0x87a8('0x56'))]['Error'](_0x87a8('0x62'));}return _0x2a4b4f[_0x87a8('0x63')](_0x51e7c6,util['format'](_0x87a8('0x51'),path[_0x87a8('0x52')](_0x39a96e[_0x87a8('0x5c')])),function(_0xb601f6){if(_0xb601f6){throw new db[(_0x87a8('0x56'))][(_0x87a8('0x64'))](_0x87a8('0x65'));}fs[_0x87a8('0x66')](_0x51e7c6);logger[_0x87a8('0x67')](_0x87a8('0x68'));logger[_0x87a8('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0x87a8('0x48')](handleError(_0x2a4b4f,null));};exports['upload']=function(_0x1ffb22,_0x3151f2,_0x24e74e){var _0x365f15=path[_0x87a8('0x52')](_0x1ffb22[_0x87a8('0x69')][_0x87a8('0x6a')],path[_0x87a8('0x6b')](_0x1ffb22[_0x87a8('0x69')][_0x87a8('0x6a')]));var _0x6fb42a=path[_0x87a8('0x4d')](config['root'],_0x87a8('0x4f'),_0x1ffb22[_0x87a8('0x69')]['filename']);var _0x30f030=path['join'](config[_0x87a8('0x4e')],_0x87a8('0x4f'),_0x365f15);logger[_0x87a8('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x6fb42a);logger[_0x87a8('0x67')](_0x87a8('0x6c'),_0x30f030);try{fs[_0x87a8('0x6d')](_0x6fb42a,parseInt(_0x87a8('0x6e'),0x8));extract(_0x6fb42a,{'dir':_0x30f030},function(_0x1f5822){if(_0x1f5822){logger['error'](_0x1f5822);handleError(_0x1f5822,!![]);};var _0x5ad329=fs[_0x87a8('0x6f')](_0x30f030);if(_0x5ad329['length']>0x1){removeReferences(_0x6fb42a,_0x30f030);logger['error'](_0x87a8('0x70'));return _0x24e74e(new Error('Invalid\x20plugin\x20structure'));}var _0x184ad4=fs[_0x87a8('0x71')](path[_0x87a8('0x4d')](_0x30f030,_0x5ad329[0x0]));if(_0x184ad4['isFile']()){removeReferences(_0x6fb42a,_0x30f030);logger[_0x87a8('0x2a')]('Invalid\x20plugin\x20structure');return _0x24e74e(new Error('Invalid\x20plugin\x20structure'));}if(_0x184ad4[_0x87a8('0x72')]()){var _0x139f8e=fs[_0x87a8('0x6f')](path[_0x87a8('0x4d')](_0x30f030,_0x5ad329[0x0]));if(_0x139f8e[_0x87a8('0x3b')]===0x0){removeReferences(_0x6fb42a,_0x30f030);logger['error'](_0x87a8('0x70'));return _0x24e74e(new Error(_0x87a8('0x70')));}var _0xbf584a=_0x139f8e['some'](function(_0x28cbe0){return _0x28cbe0===_0x87a8('0x73');});if(!_0xbf584a){return _0x24e74e(new Error(_0x87a8('0x74')));}var _0x5047e6=fs[_0x87a8('0x75')](path[_0x87a8('0x4d')](_0x30f030,_0x5ad329[0x0],_0x87a8('0x73')));var _0x3ceeb0=JSON[_0x87a8('0x76')](_0x5047e6);if(_0x87a8('0x77')==typeof _0x3ceeb0[_0x87a8('0x2c')]){return _0x24e74e(new Error(_0x87a8('0x78')));}if(_0x87a8('0x77')==typeof _0x3ceeb0['type']){return _0x24e74e(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x87a8('0x77')==typeof _0x3ceeb0['version']){return _0x24e74e(new Error(_0x87a8('0x79')));}if('undefined'==typeof _0x3ceeb0['parameters']){return _0x24e74e(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x3ceeb0[_0x87a8('0x32')]===_0x87a8('0x7a')){if(_0x87a8('0x77')==typeof _0x3ceeb0[_0x87a8('0x7b')]['views']){return _0x24e74e(new Error(_0x87a8('0x7c')));}if(_0x87a8('0x77')==typeof _0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x7d')][_0x87a8('0x7e')]&&'undefined'==typeof _0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x7d')][_0x87a8('0x7f')]){return _0x24e74e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x3ceeb0[_0x87a8('0x32')]==='script'){if('undefined'==typeof _0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x80')]){return _0x24e74e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x3ceeb0[_0x87a8('0x7b')]['scriptPath']){return _0x24e74e(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x24e74e(new Error(_0x87a8('0x81')));}var _0x811040=_0x3ceeb0[_0x87a8('0x2c')];var _0x35695d=_0x3ceeb0[_0x87a8('0x82')];var _0x47cfeb=_0x3ceeb0['type'];var _0x12028c=_0x3ceeb0['sidebar']?_0x3ceeb0[_0x87a8('0x83')]:_0x87a8('0x84');var _0x3e0a54=_0x3ceeb0[_0x87a8('0x85')]?_0x3ceeb0['icon']:_0x87a8('0x86');var _0x24b38a='';var _0x131986='';var _0x23eea7='';var _0x58e5f7='';var _0x1343d7=_0x3ceeb0['version'];if(_0x47cfeb===_0x87a8('0x7a')){if(_0x87a8('0x77')!=typeof _0x3ceeb0['parameters'][_0x87a8('0x7d')][_0x87a8('0x7e')]){var _0x4ab499=_0x3ceeb0[_0x87a8('0x7b')]['views'][_0x87a8('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x87a8('0x87')](_0x4ab499)){_0x24b38a=path['join']('plugins',_0x365f15,_0x5ad329[0x0],_0x4ab499);}else{_0x24b38a=_0x4ab499;}}else{logger[_0x87a8('0x67')](_0x87a8('0x88'));}if(_0x87a8('0x77')!=typeof _0x3ceeb0[_0x87a8('0x7b')]['views'][_0x87a8('0x7f')]){var _0x59d50a=_0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x87a8('0x87')](_0x59d50a)){_0x131986=path[_0x87a8('0x4d')](_0x87a8('0x89'),_0x365f15,_0x5ad329[0x0],_0x59d50a);}else{_0x131986=_0x59d50a;}}else{logger[_0x87a8('0x67')](_0x87a8('0x8a'));}}else if(_0x47cfeb===_0x87a8('0x8b')){_0x23eea7=_0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x80')];_0x58e5f7=_0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x8c')];if(_0x87a8('0x77')!=typeof _0x3ceeb0[_0x87a8('0x7b')]['views']){if(_0x87a8('0x77')!=typeof _0x3ceeb0[_0x87a8('0x7b')]['views'][_0x87a8('0x7e')]){var _0x4ab499=_0x3ceeb0['parameters'][_0x87a8('0x7d')][_0x87a8('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x87a8('0x87')](_0x4ab499)){_0x24b38a=path['join'](_0x87a8('0x89'),_0x365f15,_0x5ad329[0x0],_0x4ab499);}else{_0x24b38a=_0x4ab499;}}if(_0x87a8('0x77')!=typeof _0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x7d')][_0x87a8('0x7f')]){var _0x59d50a=_0x3ceeb0[_0x87a8('0x7b')][_0x87a8('0x7d')][_0x87a8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x87a8('0x87')](_0x59d50a)){_0x131986=path[_0x87a8('0x4d')](_0x87a8('0x89'),_0x365f15,_0x5ad329[0x0],_0x59d50a);}else{_0x131986=_0x59d50a;}}}}var _0x5740e8={'name':_0x811040,'description':_0x35695d,'path':path[_0x87a8('0x4d')](_0x365f15,_0x5ad329[0x0]),'type':_0x47cfeb,'sidebar':_0x12028c,'icon':_0x3e0a54,'adminUrl':_0x24b38a,'agentUrl':_0x131986,'scriptName':_0x23eea7,'scriptPath':_0x58e5f7,'version':_0x1343d7};removeReferences(_0x6fb42a,null);return db['Plugin'][_0x87a8('0x8d')](_0x5740e8)['then'](function(_0x2bb00c){var _0x124ec0={'role':_0x1ffb22[_0x87a8('0x8e')][_0x87a8('0x8f')],'userProfileId':_0x1ffb22[_0x87a8('0x8e')][_0x87a8('0x90')]};if(!_0x124ec0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x124ec0[_0x87a8('0x8f')]===_0x87a8('0x91')){var _0x2e933a=_0x2bb00c[_0x87a8('0x27')]({'plain':!![]});return db[_0x87a8('0x92')][_0x87a8('0x4c')]({'where':{'name':_0x87a8('0x28'),'userProfileId':_0x124ec0['userProfileId']},'raw':!![]})['then'](function(_0x53b8c7){if(_0x53b8c7&&_0x53b8c7[_0x87a8('0x93')]===0x0){return db[_0x87a8('0x29')][_0x87a8('0x8d')]({'name':_0x2e933a[_0x87a8('0x2c')],'resourceId':_0x2e933a['id'],'type':_0x53b8c7['name'],'sectionId':_0x53b8c7['id']},{})[_0x87a8('0x25')](function(){return _0x2bb00c;});}else{return _0x2bb00c;}})[_0x87a8('0x48')](function(_0x4d90d4){logger[_0x87a8('0x2a')](_0x87a8('0x94'),_0x4d90d4);throw _0x4d90d4;});}return _0x2bb00c;})[_0x87a8('0x25')](respondWithResult(_0x3151f2,null))[_0x87a8('0x48')](handleError(_0x3151f2,null));}});}catch(_0x932b2a){_0x3151f2['status'](0x1f4)[_0x87a8('0x2d')](_0x932b2a);}};function removeReferences(_0x32930d,_0x5427d4){try{if(_0x32930d){fs[_0x87a8('0x66')](_0x32930d);logger[_0x87a8('0x67')]('Zip\x20archive\x20removed');}if(_0x5427d4){rimraf(_0x5427d4,function(){});logger['info'](_0x87a8('0x95'));}}catch(_0x4704fd){logger[_0x87a8('0x2a')](_0x4704fd);}}exports[_0x87a8('0x24')]=function(_0x534ef5,_0x5e3614,_0x2b944e){return db[_0x87a8('0x2f')]['find']({'where':{'id':_0x534ef5[_0x87a8('0x49')]['id']}})[_0x87a8('0x25')](handleEntityNotFound(_0x5e3614,null))['then'](saveUpdates(_0x534ef5[_0x87a8('0x8e')],null))[_0x87a8('0x25')](respondWithResult(_0x5e3614,null))[_0x87a8('0x48')](handleError(_0x5e3614,null));};exports[_0x87a8('0x96')]=function(_0x1e2a26,_0x500498,_0x4c03ce){return db[_0x87a8('0x2f')][_0x87a8('0x4c')]({'where':{'id':_0x1e2a26['params']['id']}})['then'](function(_0x101898){if(_0x101898){return _0x101898[_0x87a8('0x26')]();}})[_0x87a8('0x25')](function(_0x151a35){rimraf(path['join'](config[_0x87a8('0x4e')],_0x87a8('0x4f'),path[_0x87a8('0x5b')](_0x151a35['path'])),function(){});return _0x151a35;})[_0x87a8('0x25')](handleEntityNotFound(_0x500498,null))[_0x87a8('0x25')](respondWithStatusCode(_0x500498,null))[_0x87a8('0x48')](handleError(_0x500498,null));};exports['webhookGet']=function(_0x518bd7,_0x423c30,_0x56d895){return BPromise[_0x87a8('0x97')]()[_0x87a8('0x25')](function(){if(!_0x518bd7[_0x87a8('0x36')][_0x87a8('0x5c')]){throw new Error(_0x87a8('0x98'));}if(!_0x518bd7['query']['port']){throw new Error(_0x87a8('0x99'));}var _0x2a2ccd=_0x518bd7[_0x87a8('0x36')][_0x87a8('0x9a')]?_0x518bd7[_0x87a8('0x36')][_0x87a8('0x9a')]+':'+_0x518bd7['query']['port']:'http://localhost:'+_0x518bd7[_0x87a8('0x36')][_0x87a8('0x9b')];var _0x283f65=_0x518bd7['query'][_0x87a8('0x1c')]?_0x518bd7[_0x87a8('0x36')]['json']:!![];var _0x352785=_0x518bd7['query'][_0x87a8('0x9c')]?_0x518bd7[_0x87a8('0x36')][_0x87a8('0x9c')]:null;var _0x58c777={'method':_0x518bd7[_0x87a8('0x9d')],'uri':util['format'](_0x87a8('0x9e'),_0x2a2ccd,_0x518bd7[_0x87a8('0x36')][_0x87a8('0x5c')]),'json':_0x283f65,'resolveWithFullResponse':!![],'encoding':_0x352785,'qs':_0x518bd7[_0x87a8('0x36')]};if(_0x518bd7[_0x87a8('0x9f')]){_0x58c777['headers']=_0x518bd7[_0x87a8('0x9f')];if(_0x58c777[_0x87a8('0x9f')][_0x87a8('0xa0')]){delete _0x58c777[_0x87a8('0x9f')][_0x87a8('0xa0')];}}if(_0x58c777[_0x87a8('0x9f')][_0x87a8('0xa1')]){delete _0x58c777[_0x87a8('0x9f')][_0x87a8('0xa1')];}return rp(_0x58c777);})['then'](function(_0x43a862){if(_0x43a862){_0x423c30[_0x87a8('0x1f')](_0x43a862[_0x87a8('0x9f')]);logger[_0x87a8('0x67')](_0x43a862[_0x87a8('0x8e')]);if(_[_0x87a8('0xa2')](_0x518bd7[_0x87a8('0x36')][_0x87a8('0x5c')],'download')&&_0x43a862['statusCode']==0x1f4){return _0x423c30[_0x87a8('0x1a')](_0x43a862[_0x87a8('0xa3')]);}else{return _0x423c30[_0x87a8('0x1b')](_0x43a862[_0x87a8('0xa3')])[_0x87a8('0x2d')](_0x43a862[_0x87a8('0x8e')]);}}else{return _0x423c30[_0x87a8('0x1a')](0xc8);}})[_0x87a8('0x48')](handleError(_0x423c30,null));};exports[_0x87a8('0xa4')]=function(_0x976769,_0x100d36,_0x53d4e1){return BPromise[_0x87a8('0x97')]()['then'](function(){if(!_0x976769[_0x87a8('0x36')]['path']){throw new Error(_0x87a8('0x98'));}if(!_0x976769[_0x87a8('0x36')][_0x87a8('0x9b')]){throw new Error(_0x87a8('0x99'));}var _0x54b343=_0x976769['query'][_0x87a8('0x9a')]?_0x976769[_0x87a8('0x36')][_0x87a8('0x9a')]+':'+_0x976769['query'][_0x87a8('0x9b')]:'http://localhost:'+_0x976769[_0x87a8('0x36')]['port'];var _0x11e4ee=_0x976769[_0x87a8('0x36')][_0x87a8('0x1c')]?_0x976769[_0x87a8('0x36')][_0x87a8('0x1c')]:!![];var _0x21a8d7=_0x976769['query'][_0x87a8('0x9c')]?_0x976769[_0x87a8('0x36')][_0x87a8('0x9c')]:null;var _0x4948c0={'method':_0x976769['method'],'uri':util[_0x87a8('0x50')](_0x87a8('0x9e'),_0x54b343,_0x976769['query'][_0x87a8('0x5c')]),'json':_0x11e4ee,'resolveWithFullResponse':!![],'encoding':_0x21a8d7,'body':_0x976769['body']};if(_0x976769[_0x87a8('0x9f')]){_0x4948c0[_0x87a8('0x9f')]=_0x976769[_0x87a8('0x9f')];if(_0x4948c0['headers']['content-length']){delete _0x4948c0[_0x87a8('0x9f')]['content-length'];}}if(_0x4948c0['headers'][_0x87a8('0xa1')]){delete _0x4948c0['headers'][_0x87a8('0xa1')];}return rp(_0x4948c0);})[_0x87a8('0x25')](function(_0x4d98fd){if(_0x4d98fd){_0x100d36[_0x87a8('0x1f')](_0x4d98fd[_0x87a8('0x9f')]);logger['info'](_0x4d98fd[_0x87a8('0x8e')]);return _0x100d36[_0x87a8('0x1b')](_0x4d98fd[_0x87a8('0xa3')])[_0x87a8('0x2d')](_0x4d98fd[_0x87a8('0x8e')]);}else{return _0x100d36['sendStatus'](0xc8);}})[_0x87a8('0x48')](handleError(_0x100d36,null));}; \ No newline at end of file +var _0xca3c=['parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','role','userProfileId','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','body','delete','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','send','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','content-type','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','end','json','offset','limit','status','set','Content-Range','apply','reject','then','Plugins','sendStatus','error','stack','name','Plugin','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','download','format','%s.zip','createWriteStream','zip','warning','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','dirname','basename','join','attachments/**/*','finalize','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x5a7dcc,_0x45f1ad){var _0x351e41=function(_0x1abfb6){while(--_0x1abfb6){_0x5a7dcc['push'](_0x5a7dcc['shift']());}};_0x351e41(++_0x45f1ad);}(_0xca3c,0x199));var _0xcca3=function(_0x55ff7a,_0x22b248){_0x55ff7a=_0x55ff7a-0x0;var _0x65966d=_0xca3c[_0x55ff7a];return _0x65966d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcca3('0x0'));var rimraf=require(_0xcca3('0x1'));var zipdir=require(_0xcca3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcca3('0x3'));var moment=require(_0xcca3('0x4'));var BPromise=require(_0xcca3('0x5'));var Mustache=require(_0xcca3('0x6'));var util=require('util');var path=require(_0xcca3('0x7'));var sox=require(_0xcca3('0x8'));var csv=require(_0xcca3('0x9'));var ejs=require(_0xcca3('0xa'));var fs=require('fs');var _=require(_0xcca3('0xb'));var squel=require(_0xcca3('0xc'));var crypto=require(_0xcca3('0xd'));var jsforce=require(_0xcca3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcca3('0x9'));var querystring=require(_0xcca3('0xf'));var Papa=require(_0xcca3('0x10'));var extract=require(_0xcca3('0x11'));var rimraf=require(_0xcca3('0x1'));var archiver=require(_0xcca3('0x12'));var Redis=require(_0xcca3('0x13'));var authService=require(_0xcca3('0x14'));var qs=require(_0xcca3('0x15'));var as=require(_0xcca3('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcca3('0x17'))(_0xcca3('0x18'));var utils=require(_0xcca3('0x19'));var config=require('../../config/environment');var db=require(_0xcca3('0x1a'))['db'];config[_0xcca3('0x1b')]=_[_0xcca3('0x1c')](config[_0xcca3('0x1b')],{'host':_0xcca3('0x1d'),'port':0x18eb});var socket=require(_0xcca3('0x1e'))(new Redis(config['redis']));require(_0xcca3('0x1f'))[_0xcca3('0x20')](socket);function respondWithStatusCode(_0x3c453c,_0x45c36b){_0x45c36b=_0x45c36b||0xcc;return function(_0x363365){if(_0x363365){return _0x3c453c['sendStatus'](_0x45c36b);}return _0x3c453c['status'](_0x45c36b)[_0xcca3('0x21')]();};}function respondWithResult(_0x25d463,_0x20e0a5){_0x20e0a5=_0x20e0a5||0xc8;return function(_0x4a4006){if(_0x4a4006){return _0x25d463['status'](_0x20e0a5)[_0xcca3('0x22')](_0x4a4006);}};}function respondWithFilteredResult(_0x26ae33,_0x30d3af){return function(_0x46f73d){if(_0x46f73d){var _0x1dfd0f=_0x46f73d['count'],_0x3ccce6=_0x30d3af[_0xcca3('0x23')],_0x4483dc=_0x30d3af[_0xcca3('0x23')]+_0x30d3af[_0xcca3('0x24')],_0x36a108;if(_0x4483dc>=_0x1dfd0f){_0x4483dc=_0x1dfd0f;_0x36a108=0xc8;}else{_0x36a108=0xce;}_0x26ae33[_0xcca3('0x25')](_0x36a108);return _0x26ae33[_0xcca3('0x26')](_0xcca3('0x27'),_0x3ccce6+'-'+_0x4483dc+'/'+_0x1dfd0f)['json'](_0x46f73d);}return null;};}function patchUpdates(_0x21fd59){return function(_0x38b58f){try{jsonpatch[_0xcca3('0x28')](_0x38b58f,_0x21fd59,!![]);}catch(_0x28980f){return BPromise[_0xcca3('0x29')](_0x28980f);}return _0x38b58f['save']();};}function saveUpdates(_0x9c0e7b,_0x1e804d){return function(_0x7bc0ba){if(_0x7bc0ba){return _0x7bc0ba['update'](_0x9c0e7b)[_0xcca3('0x2a')](function(_0x5007b7){return _0x5007b7;});}return null;};}function removeEntity(_0x1c2bfc,_0x42eb67){return function(_0x439360){if(_0x439360){return _0x439360['destroy']()[_0xcca3('0x2a')](function(){var _0x10807a=_0x439360['get']({'plain':!![]});var _0x34472d=_0xcca3('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x34472d,'resourceId':_0x10807a['id']}})[_0xcca3('0x2a')](function(){return _0x439360;});})[_0xcca3('0x2a')](function(){_0x1c2bfc[_0xcca3('0x25')](0xcc)[_0xcca3('0x21')]();});}};}function handleEntityNotFound(_0x423984,_0x1c8f3c){return function(_0x400932){if(!_0x400932){_0x423984[_0xcca3('0x2c')](0x194);}return _0x400932;};}function handleError(_0x254a6c,_0x40c9cf){_0x40c9cf=_0x40c9cf||0x1f4;return function(_0x1a1649){logger[_0xcca3('0x2d')](_0x1a1649[_0xcca3('0x2e')]);if(_0x1a1649[_0xcca3('0x2f')]){delete _0x1a1649['name'];}_0x254a6c[_0xcca3('0x25')](_0x40c9cf)['send'](_0x1a1649);};}exports['index']=function(_0x241de4,_0x510e90){var _0x20a2e2={},_0x420785={},_0x558ddd={'count':0x0,'rows':[]};var _0x5dd3a6=_['map'](db[_0xcca3('0x30')]['rawAttributes'],function(_0x440924){return{'name':_0x440924['fieldName'],'type':_0x440924[_0xcca3('0x31')][_0xcca3('0x32')]};});_0x420785[_0xcca3('0x33')]=_[_0xcca3('0x34')](_0x5dd3a6,_0xcca3('0x2f'));_0x420785[_0xcca3('0x35')]=_[_0xcca3('0x36')](_0x241de4[_0xcca3('0x35')]);_0x420785[_0xcca3('0x37')]=_[_0xcca3('0x38')](_0x420785[_0xcca3('0x33')],_0x420785[_0xcca3('0x35')]);_0x20a2e2[_0xcca3('0x39')]=_[_0xcca3('0x38')](_0x420785[_0xcca3('0x33')],qs[_0xcca3('0x3a')](_0x241de4[_0xcca3('0x35')][_0xcca3('0x3a')]));_0x20a2e2[_0xcca3('0x39')]=_0x20a2e2['attributes']['length']?_0x20a2e2[_0xcca3('0x39')]:_0x420785[_0xcca3('0x33')];if(!_0x241de4[_0xcca3('0x35')][_0xcca3('0x3b')](_0xcca3('0x3c'))){_0x20a2e2['limit']=qs[_0xcca3('0x24')](_0x241de4[_0xcca3('0x35')][_0xcca3('0x24')]);_0x20a2e2['offset']=qs[_0xcca3('0x23')](_0x241de4['query'][_0xcca3('0x23')]);}_0x20a2e2[_0xcca3('0x3d')]=qs[_0xcca3('0x3e')](_0x241de4['query'][_0xcca3('0x3e')]);_0x20a2e2['where']=qs[_0xcca3('0x37')](_[_0xcca3('0x3f')](_0x241de4['query'],_0x420785[_0xcca3('0x37')]),_0x5dd3a6);if(_0x241de4[_0xcca3('0x35')][_0xcca3('0x40')]){_0x20a2e2[_0xcca3('0x41')]=_[_0xcca3('0x42')](_0x20a2e2['where'],{'$or':_[_0xcca3('0x34')](_0x5dd3a6,function(_0x3d1436){if(_0x3d1436[_0xcca3('0x31')]!==_0xcca3('0x43')){var _0x3e808a={};_0x3e808a[_0x3d1436[_0xcca3('0x2f')]]={'$like':'%'+_0x241de4[_0xcca3('0x35')][_0xcca3('0x40')]+'%'};return _0x3e808a;}})});}_0x20a2e2=_[_0xcca3('0x42')]({},_0x20a2e2,_0x241de4[_0xcca3('0x44')]);var _0x19b70d={'where':_0x20a2e2[_0xcca3('0x41')]};return db[_0xcca3('0x30')]['count'](_0x19b70d)[_0xcca3('0x2a')](function(_0x380e97){_0x558ddd[_0xcca3('0x45')]=_0x380e97;if(_0x241de4[_0xcca3('0x35')][_0xcca3('0x46')]){_0x20a2e2['include']=[{'all':!![]}];}return db[_0xcca3('0x30')][_0xcca3('0x47')](_0x20a2e2);})[_0xcca3('0x2a')](function(_0x251033){_0x558ddd[_0xcca3('0x48')]=_0x251033;return _0x558ddd;})[_0xcca3('0x2a')](respondWithFilteredResult(_0x510e90,_0x20a2e2))[_0xcca3('0x49')](handleError(_0x510e90,null));};exports[_0xcca3('0x4a')]=function(_0x2c82f7,_0xe4deaa){var _0x1c29be={'raw':!![],'where':{'id':_0x2c82f7[_0xcca3('0x4b')]['id']}},_0x5698c3={};_0x5698c3[_0xcca3('0x33')]=_[_0xcca3('0x36')](db[_0xcca3('0x30')]['rawAttributes']);_0x5698c3[_0xcca3('0x35')]=_[_0xcca3('0x36')](_0x2c82f7[_0xcca3('0x35')]);_0x5698c3['filters']=_[_0xcca3('0x38')](_0x5698c3[_0xcca3('0x33')],_0x5698c3[_0xcca3('0x35')]);_0x1c29be[_0xcca3('0x39')]=_[_0xcca3('0x38')](_0x5698c3[_0xcca3('0x33')],qs[_0xcca3('0x3a')](_0x2c82f7[_0xcca3('0x35')][_0xcca3('0x3a')]));_0x1c29be[_0xcca3('0x39')]=_0x1c29be[_0xcca3('0x39')][_0xcca3('0x4c')]?_0x1c29be[_0xcca3('0x39')]:_0x5698c3[_0xcca3('0x33')];if(_0x2c82f7[_0xcca3('0x35')]['includeAll']){_0x1c29be[_0xcca3('0x4d')]=[{'all':!![]}];}_0x1c29be=_['merge']({},_0x1c29be,_0x2c82f7[_0xcca3('0x44')]);return db['Plugin'][_0xcca3('0x4e')](_0x1c29be)[_0xcca3('0x2a')](handleEntityNotFound(_0xe4deaa,null))[_0xcca3('0x2a')](respondWithResult(_0xe4deaa,null))['catch'](handleError(_0xe4deaa,null));};exports[_0xcca3('0x4f')]=function(_0x52949b,_0x104c61,_0xd2a572){return db[_0xcca3('0x30')][_0xcca3('0x4e')]({'where':{'id':_0x52949b[_0xcca3('0x4b')]['id']},'attributes':['name','path'],'raw':!![]})[_0xcca3('0x2a')](handleEntityNotFound(_0x104c61,null))[_0xcca3('0x2a')](function(_0x22eab2){if(_0x22eab2){var _0x3c07d3=path['join'](config['root'],'server/files/plugins',util[_0xcca3('0x50')](_0xcca3('0x51'),path['basename'](_0x22eab2[_0xcca3('0x7')])));var _0x404cec=fs[_0xcca3('0x52')](_0x3c07d3);var _0x1236f3=archiver(_0xcca3('0x53'),{'zlib':{'level':0x9}});_0x1236f3['on'](_0xcca3('0x54'),function(_0x25df7a){if(_0x25df7a['code']==='ENOENT'){logger[_0xcca3('0x2d')](_0x25df7a);}else{throw new db[(_0xcca3('0x55'))][(_0xcca3('0x56'))](_0xcca3('0x57'));}});_0x1236f3['on'](_0xcca3('0x2d'),function(_0x1a6a9c){throw new db[(_0xcca3('0x55'))]['Error'](_0xcca3('0x57'));});_0x1236f3[_0xcca3('0x58')](_0x404cec);_0x1236f3[_0xcca3('0x59')](_0xcca3('0x5a'),{'cwd':path['join'](config[_0xcca3('0x5b')],_0xcca3('0x5c'),path[_0xcca3('0x5d')](_0x22eab2[_0xcca3('0x7')])),'ignore':[path['join'](path[_0xcca3('0x5e')](_0x22eab2['path']),'node_modules/**/*'),path[_0xcca3('0x5f')](path[_0xcca3('0x5e')](_0x22eab2[_0xcca3('0x7')]),_0xcca3('0x60'))],'nodir':!![]})[_0xcca3('0x61')]();_0x404cec['on']('close',function(){if(!fs[_0xcca3('0x62')](_0x3c07d3)){throw new db[(_0xcca3('0x55'))]['Error']('Plugin\x20not\x20found');}return _0x104c61[_0xcca3('0x4f')](_0x3c07d3,util[_0xcca3('0x50')](_0xcca3('0x51'),path[_0xcca3('0x5e')](_0x22eab2['path'])),function(_0x3ee5ac){if(_0x3ee5ac){throw new db[(_0xcca3('0x55'))][(_0xcca3('0x56'))](_0xcca3('0x63'));}fs[_0xcca3('0x64')](_0x3c07d3);logger[_0xcca3('0x65')](_0xcca3('0x66'));logger['info'](_0xcca3('0x67'));});});}return null;})[_0xcca3('0x49')](handleError(_0x104c61,null));};exports[_0xcca3('0x68')]=function(_0x52d5cb,_0x55355d,_0x29a03e){var _0x3e0dd4=path[_0xcca3('0x5e')](_0x52d5cb[_0xcca3('0x69')][_0xcca3('0x6a')],path[_0xcca3('0x6b')](_0x52d5cb[_0xcca3('0x69')][_0xcca3('0x6a')]));var _0x1d9beb=path[_0xcca3('0x5f')](config[_0xcca3('0x5b')],'server/files/plugins',_0x52d5cb['file'][_0xcca3('0x6a')]);var _0x2a5337=path['join'](config[_0xcca3('0x5b')],_0xcca3('0x5c'),_0x3e0dd4);logger[_0xcca3('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0x1d9beb);logger[_0xcca3('0x65')](_0xcca3('0x6c'),_0x2a5337);try{fs[_0xcca3('0x6d')](_0x1d9beb,parseInt(_0xcca3('0x6e'),0x8));extract(_0x1d9beb,{'dir':_0x2a5337},function(_0x4f376d){if(_0x4f376d){logger[_0xcca3('0x2d')](_0x4f376d);handleError(_0x4f376d,!![]);};var _0x288a6f=fs[_0xcca3('0x6f')](_0x2a5337);if(_0x288a6f[_0xcca3('0x4c')]>0x1){removeReferences(_0x1d9beb,_0x2a5337);logger[_0xcca3('0x2d')](_0xcca3('0x70'));return _0x29a03e(new Error(_0xcca3('0x70')));}var _0x4b1e16=fs[_0xcca3('0x71')](path[_0xcca3('0x5f')](_0x2a5337,_0x288a6f[0x0]));if(_0x4b1e16[_0xcca3('0x72')]()){removeReferences(_0x1d9beb,_0x2a5337);logger[_0xcca3('0x2d')](_0xcca3('0x70'));return _0x29a03e(new Error('Invalid\x20plugin\x20structure'));}if(_0x4b1e16[_0xcca3('0x73')]()){var _0x280a36=fs[_0xcca3('0x6f')](path[_0xcca3('0x5f')](_0x2a5337,_0x288a6f[0x0]));if(_0x280a36[_0xcca3('0x4c')]===0x0){removeReferences(_0x1d9beb,_0x2a5337);logger[_0xcca3('0x2d')](_0xcca3('0x70'));return _0x29a03e(new Error(_0xcca3('0x70')));}var _0x5e7610=_0x280a36[_0xcca3('0x74')](function(_0x4b0234){return _0x4b0234===_0xcca3('0x75');});if(!_0x5e7610){return _0x29a03e(new Error('Plugin\x20manifest\x20missing'));}var _0x9d1f85=fs[_0xcca3('0x76')](path['join'](_0x2a5337,_0x288a6f[0x0],'manifest.json'));var _0x3d5efa=JSON[_0xcca3('0x77')](_0x9d1f85);if(_0xcca3('0x78')==typeof _0x3d5efa['name']){return _0x29a03e(new Error(_0xcca3('0x79')));}if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x31')]){return _0x29a03e(new Error(_0xcca3('0x7a')));}if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x7b')]){return _0x29a03e(new Error(_0xcca3('0x7c')));}if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x7d')]){return _0x29a03e(new Error(_0xcca3('0x7e')));}if(_0x3d5efa[_0xcca3('0x31')]===_0xcca3('0x7f')){if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x80')]){return _0x29a03e(new Error(_0xcca3('0x81')));}if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x80')][_0xcca3('0x82')]&&_0xcca3('0x78')==typeof _0x3d5efa['parameters']['views'][_0xcca3('0x83')]){return _0x29a03e(new Error(_0xcca3('0x84')));}}else if(_0x3d5efa[_0xcca3('0x31')]===_0xcca3('0x85')){if('undefined'==typeof _0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x86')]){return _0x29a03e(new Error(_0xcca3('0x87')));}if(_0xcca3('0x78')==typeof _0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x88')]){return _0x29a03e(new Error(_0xcca3('0x89')));}}else{return _0x29a03e(new Error(_0xcca3('0x8a')));}var _0x1abcd7=_0x3d5efa[_0xcca3('0x2f')];var _0x378a51=_0x3d5efa[_0xcca3('0x8b')];var _0x460c4e=_0x3d5efa[_0xcca3('0x31')];var _0x2ec668=_0x3d5efa[_0xcca3('0x8c')]?_0x3d5efa['sidebar']:_0xcca3('0x8d');var _0x4caaa1=_0x3d5efa[_0xcca3('0x8e')]?_0x3d5efa['icon']:_0xcca3('0x8f');var _0x5d1794='';var _0x4ec1f5='';var _0x879b0e='';var _0x2c8d69='';var _0x519afe=_0x3d5efa[_0xcca3('0x7b')];if(_0x460c4e===_0xcca3('0x7f')){if(_0xcca3('0x78')!=typeof _0x3d5efa['parameters'][_0xcca3('0x80')][_0xcca3('0x82')]){var _0x425c2b=_0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x80')][_0xcca3('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xcca3('0x90')](_0x425c2b)){_0x5d1794=path[_0xcca3('0x5f')](_0xcca3('0x91'),_0x3e0dd4,_0x288a6f[0x0],_0x425c2b);}else{_0x5d1794=_0x425c2b;}}else{logger[_0xcca3('0x65')](_0xcca3('0x92'));}if(_0xcca3('0x78')!=typeof _0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x80')]['agent']){var _0x41c1f9=_0x3d5efa[_0xcca3('0x7d')]['views'][_0xcca3('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xcca3('0x90')](_0x41c1f9)){_0x4ec1f5=path[_0xcca3('0x5f')](_0xcca3('0x91'),_0x3e0dd4,_0x288a6f[0x0],_0x41c1f9);}else{_0x4ec1f5=_0x41c1f9;}}else{logger[_0xcca3('0x65')](_0xcca3('0x93'));}}else if(_0x460c4e===_0xcca3('0x85')){_0x879b0e=_0x3d5efa[_0xcca3('0x7d')]['scriptName'];_0x2c8d69=_0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x88')];if('undefined'!=typeof _0x3d5efa['parameters'][_0xcca3('0x80')]){if(_0xcca3('0x78')!=typeof _0x3d5efa[_0xcca3('0x7d')]['views'][_0xcca3('0x82')]){var _0x425c2b=_0x3d5efa['parameters'][_0xcca3('0x80')][_0xcca3('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xcca3('0x90')](_0x425c2b)){_0x5d1794=path[_0xcca3('0x5f')](_0xcca3('0x91'),_0x3e0dd4,_0x288a6f[0x0],_0x425c2b);}else{_0x5d1794=_0x425c2b;}}if(_0xcca3('0x78')!=typeof _0x3d5efa['parameters'][_0xcca3('0x80')][_0xcca3('0x83')]){var _0x41c1f9=_0x3d5efa[_0xcca3('0x7d')][_0xcca3('0x80')][_0xcca3('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xcca3('0x90')](_0x41c1f9)){_0x4ec1f5=path['join']('plugins',_0x3e0dd4,_0x288a6f[0x0],_0x41c1f9);}else{_0x4ec1f5=_0x41c1f9;}}}}var _0x13a662={'name':_0x1abcd7,'description':_0x378a51,'path':path[_0xcca3('0x5f')](_0x3e0dd4,_0x288a6f[0x0]),'type':_0x460c4e,'sidebar':_0x2ec668,'icon':_0x4caaa1,'adminUrl':_0x5d1794,'agentUrl':_0x4ec1f5,'scriptName':_0x879b0e,'scriptPath':_0x2c8d69,'version':_0x519afe};removeReferences(_0x1d9beb,null);return db[_0xcca3('0x30')][_0xcca3('0x94')](_0x13a662)[_0xcca3('0x2a')](function(_0x91f2ab){var _0x1cbee4={'role':_0x52d5cb['body'][_0xcca3('0x95')],'userProfileId':_0x52d5cb['body'][_0xcca3('0x96')]};if(!_0x1cbee4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cbee4[_0xcca3('0x95')]===_0xcca3('0x97')){var _0x3b9ded=_0x91f2ab['get']({'plain':!![]});return db[_0xcca3('0x98')]['find']({'where':{'name':_0xcca3('0x2b'),'userProfileId':_0x1cbee4[_0xcca3('0x96')]},'raw':!![]})['then'](function(_0x306e63){if(_0x306e63&&_0x306e63['autoAssociation']===0x0){return db[_0xcca3('0x99')][_0xcca3('0x94')]({'name':_0x3b9ded[_0xcca3('0x2f')],'resourceId':_0x3b9ded['id'],'type':_0x306e63['name'],'sectionId':_0x306e63['id']},{})[_0xcca3('0x2a')](function(){return _0x91f2ab;});}else{return _0x91f2ab;}})[_0xcca3('0x49')](function(_0x35bc1c){logger[_0xcca3('0x2d')](_0xcca3('0x9a'),_0x35bc1c);throw _0x35bc1c;});}return _0x91f2ab;})['then'](respondWithResult(_0x55355d,null))[_0xcca3('0x49')](handleError(_0x55355d,null));}});}catch(_0x5374a2){_0x55355d[_0xcca3('0x25')](0x1f4)['send'](_0x5374a2);}};function removeReferences(_0xdc2e07,_0x59e7d6){try{if(_0xdc2e07){fs['unlinkSync'](_0xdc2e07);logger[_0xcca3('0x65')](_0xcca3('0x9b'));}if(_0x59e7d6){rimraf(_0x59e7d6,function(){});logger[_0xcca3('0x65')](_0xcca3('0x9c'));}}catch(_0x56d991){logger['error'](_0x56d991);}}exports[_0xcca3('0x9d')]=function(_0x4a1fec,_0x1dd466,_0x51bb4e){return db[_0xcca3('0x30')][_0xcca3('0x4e')]({'where':{'id':_0x4a1fec[_0xcca3('0x4b')]['id']}})[_0xcca3('0x2a')](handleEntityNotFound(_0x1dd466,null))[_0xcca3('0x2a')](saveUpdates(_0x4a1fec[_0xcca3('0x9e')],null))[_0xcca3('0x2a')](respondWithResult(_0x1dd466,null))['catch'](handleError(_0x1dd466,null));};exports[_0xcca3('0x9f')]=function(_0x4ab604,_0x3eb390,_0xf7406c){return db[_0xcca3('0x30')][_0xcca3('0x4e')]({'where':{'id':_0x4ab604[_0xcca3('0x4b')]['id']}})[_0xcca3('0x2a')](function(_0x50e706){if(_0x50e706){return _0x50e706[_0xcca3('0xa0')]();}})[_0xcca3('0x2a')](function(_0x5c3ef5){rimraf(path[_0xcca3('0x5f')](config[_0xcca3('0x5b')],_0xcca3('0x5c'),path[_0xcca3('0x5d')](_0x5c3ef5['path'])),function(){});return _0x5c3ef5;})[_0xcca3('0x2a')](handleEntityNotFound(_0x3eb390,null))[_0xcca3('0x2a')](respondWithStatusCode(_0x3eb390,null))[_0xcca3('0x49')](handleError(_0x3eb390,null));};exports[_0xcca3('0xa1')]=function(_0x4b8097,_0x169912,_0x344c6e){return BPromise[_0xcca3('0xa2')]()['then'](function(){if(!_0x4b8097[_0xcca3('0x35')][_0xcca3('0x7')]){throw new Error(_0xcca3('0xa3'));}if(!_0x4b8097[_0xcca3('0x35')][_0xcca3('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x46ccc1=_0x4b8097['query'][_0xcca3('0xa5')]?_0x4b8097[_0xcca3('0x35')][_0xcca3('0xa5')]+':'+_0x4b8097[_0xcca3('0x35')][_0xcca3('0xa4')]:'http://localhost:'+_0x4b8097[_0xcca3('0x35')][_0xcca3('0xa4')];var _0x1c8af9=_0x4b8097[_0xcca3('0x35')][_0xcca3('0x22')]?_0x4b8097[_0xcca3('0x35')][_0xcca3('0x22')]:!![];var _0x518f9f=_0x4b8097['query'][_0xcca3('0xa6')]?_0x4b8097[_0xcca3('0x35')][_0xcca3('0xa6')]:null;var _0x1b60f3={'method':_0x4b8097[_0xcca3('0xa7')],'uri':util[_0xcca3('0x50')](_0xcca3('0xa8'),_0x46ccc1,_0x4b8097[_0xcca3('0x35')]['path']),'json':_0x1c8af9,'resolveWithFullResponse':!![],'encoding':_0x518f9f,'qs':_0x4b8097[_0xcca3('0x35')]};if(_0x4b8097[_0xcca3('0xa9')]){_0x1b60f3[_0xcca3('0xa9')]=_0x4b8097[_0xcca3('0xa9')];if(_0x1b60f3['headers'][_0xcca3('0xaa')]){delete _0x1b60f3['headers'][_0xcca3('0xaa')];}}if(_0x1b60f3[_0xcca3('0xa9')]['content-type']){delete _0x1b60f3['headers']['content-type'];}return rp(_0x1b60f3);})['then'](function(_0x5af249){if(_0x5af249){_0x169912[_0xcca3('0x26')](_0x5af249[_0xcca3('0xa9')]);logger[_0xcca3('0x65')](_0x5af249[_0xcca3('0x9e')]);if(_[_0xcca3('0xab')](_0x4b8097[_0xcca3('0x35')][_0xcca3('0x7')],_0xcca3('0x4f'))&&_0x5af249['statusCode']==0x1f4){return _0x169912[_0xcca3('0x2c')](_0x5af249[_0xcca3('0xac')]);}else{return _0x169912[_0xcca3('0x25')](_0x5af249[_0xcca3('0xac')])[_0xcca3('0xad')](_0x5af249[_0xcca3('0x9e')]);}}else{return _0x169912[_0xcca3('0x2c')](0xc8);}})[_0xcca3('0x49')](handleError(_0x169912,null));};exports[_0xcca3('0xae')]=function(_0x3ccda5,_0x4c35d0,_0x127577){return BPromise[_0xcca3('0xa2')]()[_0xcca3('0x2a')](function(){if(!_0x3ccda5[_0xcca3('0x35')]['path']){throw new Error(_0xcca3('0xa3'));}if(!_0x3ccda5[_0xcca3('0x35')]['port']){throw new Error(_0xcca3('0xaf'));}var _0x5e1b9f=_0x3ccda5['query']['hostname']?_0x3ccda5[_0xcca3('0x35')]['hostname']+':'+_0x3ccda5[_0xcca3('0x35')][_0xcca3('0xa4')]:_0xcca3('0xb0')+_0x3ccda5[_0xcca3('0x35')][_0xcca3('0xa4')];var _0x163d2b=_0x3ccda5[_0xcca3('0x35')][_0xcca3('0x22')]?_0x3ccda5[_0xcca3('0x35')][_0xcca3('0x22')]:!![];var _0x395a93=_0x3ccda5['query'][_0xcca3('0xa6')]?_0x3ccda5[_0xcca3('0x35')][_0xcca3('0xa6')]:null;var _0x3ee043={'method':_0x3ccda5[_0xcca3('0xa7')],'uri':util[_0xcca3('0x50')]('%s%s',_0x5e1b9f,_0x3ccda5[_0xcca3('0x35')][_0xcca3('0x7')]),'json':_0x163d2b,'resolveWithFullResponse':!![],'encoding':_0x395a93,'body':_0x3ccda5[_0xcca3('0x9e')]};if(_0x3ccda5[_0xcca3('0xa9')]){_0x3ee043[_0xcca3('0xa9')]=_0x3ccda5[_0xcca3('0xa9')];if(_0x3ee043['headers'][_0xcca3('0xaa')]){delete _0x3ee043['headers']['content-length'];}}if(_0x3ee043[_0xcca3('0xa9')][_0xcca3('0xb1')]){delete _0x3ee043[_0xcca3('0xa9')][_0xcca3('0xb1')];}return rp(_0x3ee043);})[_0xcca3('0x2a')](function(_0x51a7fa){if(_0x51a7fa){_0x4c35d0[_0xcca3('0x26')](_0x51a7fa['headers']);logger[_0xcca3('0x65')](_0x51a7fa[_0xcca3('0x9e')]);return _0x4c35d0[_0xcca3('0x25')](_0x51a7fa[_0xcca3('0xac')])['send'](_0x51a7fa[_0xcca3('0x9e')]);}else{return _0x4c35d0[_0xcca3('0x2c')](0xc8);}})[_0xcca3('0x49')](handleError(_0x4c35d0,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c5126e0..3ca4ab7 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 _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x271332,_0x4876dd){var _0x35f689=function(_0x16aeb9){while(--_0x16aeb9){_0x271332['push'](_0x271332['shift']());}};_0x35f689(++_0x4876dd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x65f6('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){PluginEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);PluginEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=PluginEvents; \ No newline at end of file +var _0x4888=['emit','hasOwnProperty','hook','../../mysqldb','Plugin','setMaxListeners','save','update','remove'];(function(_0x342b4c,_0x381e5d){var _0x4aa2dc=function(_0x22c3d1){while(--_0x22c3d1){_0x342b4c['push'](_0x342b4c['shift']());}};_0x4aa2dc(++_0x381e5d);}(_0x4888,0x198));var _0x8488=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0x4888[_0x10a1ac];return _0x45b99e;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x8488('0x0'))['db'][_0x8488('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x8488('0x2')](0x0);var events={'afterCreate':_0x8488('0x3'),'afterUpdate':_0x8488('0x4'),'afterDestroy':_0x8488('0x5')};function emitEvent(_0x19e51d){return function(_0x571e4b,_0x267093,_0xf45c3f){PluginEvents[_0x8488('0x6')](_0x19e51d+':'+_0x571e4b['id'],_0x571e4b);PluginEvents[_0x8488('0x6')](_0x19e51d,_0x571e4b);_0xf45c3f(null);};}for(var e in events){if(events[_0x8488('0x7')](e)){var event=events[e];Plugin[_0x8488('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 2eff931..eb6987d 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 _0x8ef6=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes'];(function(_0x28dbd6,_0x469c6d){var _0x583143=function(_0x2c7e8d){while(--_0x2c7e8d){_0x28dbd6['push'](_0x28dbd6['shift']());}};_0x583143(++_0x469c6d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58a61e,_0x44ef9f){_0x58a61e=_0x58a61e-0x0;var _0x27030d=_0x8ef6[_0x58a61e];return _0x27030d;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2b9d62,_0x4be267){var _0x34e95e=function(_0x5ee21d){while(--_0x5ee21d){_0x2b9d62['push'](_0x2b9d62['shift']());}};_0x34e95e(++_0x4be267);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5a07a1,_0x573582){_0x5a07a1=_0x5a07a1-0x0;var _0x362ac2=_0x9c5a[_0x5a07a1];return _0x362ac2;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./plugin.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 4f32976..51fc9fa 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 _0xf1fb=['defaults','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreatePlugin','Plugin','body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xf1fb,0x174));var _0xbf1f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xf1fb[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xbf1f('0x0'));var util=require(_0xbf1f('0x1'));var moment=require(_0xbf1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf1f('0x3'));var fs=require('fs');var Redis=require(_0xbf1f('0x4'));var db=require(_0xbf1f('0x5'))['db'];var utils=require(_0xbf1f('0x6'));var logger=require(_0xbf1f('0x7'))(_0xbf1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xbf1f('0x9'));var client=jayson[_0xbf1f('0xa')][_0xbf1f('0xb')]({'port':0x232a});config[_0xbf1f('0xc')]=_[_0xbf1f('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf1f('0xe'))(new Redis(config[_0xbf1f('0xc')]));require(_0xbf1f('0xf'))[_0xbf1f('0x10')](socket);function respondWithRpcPromise(_0x303f6d,_0x2cb60e,_0xbef57e){return new BPromise(function(_0x1cee6c,_0x414f57){return client[_0xbf1f('0x11')](_0x303f6d,_0xbef57e)[_0xbf1f('0x12')](function(_0x36bb2a){logger[_0xbf1f('0x13')](_0xbf1f('0x14'),_0x2cb60e,'request\x20sent');logger[_0xbf1f('0x15')](_0xbf1f('0x16'),_0x2cb60e,_0xbf1f('0x17'),JSON[_0xbf1f('0x18')](_0x36bb2a));if(_0x36bb2a[_0xbf1f('0x19')]){if(_0x36bb2a[_0xbf1f('0x19')][_0xbf1f('0x1a')]===0x1f4){logger[_0xbf1f('0x19')](_0xbf1f('0x14'),_0x2cb60e,_0x36bb2a['error']['message']);return _0x414f57(_0x36bb2a[_0xbf1f('0x19')][_0xbf1f('0x1b')]);}logger['error'](_0xbf1f('0x14'),_0x2cb60e,_0x36bb2a[_0xbf1f('0x19')]['message']);return _0x1cee6c(_0x36bb2a[_0xbf1f('0x19')]['message']);}else{logger[_0xbf1f('0x13')](_0xbf1f('0x14'),_0x2cb60e,'request\x20sent');_0x1cee6c(_0x36bb2a[_0xbf1f('0x1c')]['message']);}})['catch'](function(_0x241039){logger[_0xbf1f('0x19')]('Plugin,\x20%s,\x20%s',_0x2cb60e,_0x241039);_0x414f57(_0x241039);});});}exports[_0xbf1f('0x1d')]=function(_0x23b687){var _0x5bff90=this;return new Promise(function(_0x5e7913,_0x3c7554){return db[_0xbf1f('0x1e')]['create'](_0x23b687[_0xbf1f('0x1f')],{'raw':_0x23b687[_0xbf1f('0x20')]?_0x23b687['options'][_0xbf1f('0x21')]===undefined?!![]:![]:!![]})[_0xbf1f('0x12')](function(_0x2accfb){logger['info']('CreatePlugin',_0x23b687);logger[_0xbf1f('0x15')](_0xbf1f('0x1d'),_0x23b687,JSON[_0xbf1f('0x18')](_0x2accfb));_0x5e7913(_0x2accfb);})[_0xbf1f('0x22')](function(_0x1198d7){logger['error'](_0xbf1f('0x1d'),_0x1198d7[_0xbf1f('0x1b')],_0x23b687);_0x3c7554(_0x5bff90['error'](0x1f4,_0x1198d7['message']));});});}; \ No newline at end of file +var _0x2ea8=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./plugin.socket','request','info','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','request\x20sent','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring'];(function(_0x31ac36,_0x29cad6){var _0x2d7552=function(_0x519ec0){while(--_0x519ec0){_0x31ac36['push'](_0x31ac36['shift']());}};_0x2d7552(++_0x29cad6);}(_0x2ea8,0x7f));var _0x82ea=function(_0x410b26,_0x2d8194){_0x410b26=_0x410b26-0x0;var _0x39d86d=_0x2ea8[_0x410b26];return _0x39d86d;};'use strict';var _=require(_0x82ea('0x0'));var util=require(_0x82ea('0x1'));var moment=require(_0x82ea('0x2'));var BPromise=require(_0x82ea('0x3'));var rs=require(_0x82ea('0x4'));var fs=require('fs');var Redis=require(_0x82ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x82ea('0x6'))(_0x82ea('0x7'));var config=require(_0x82ea('0x8'));var jayson=require(_0x82ea('0x9'));var client=jayson[_0x82ea('0xa')]['http']({'port':0x232a});config[_0x82ea('0xb')]=_['defaults'](config[_0x82ea('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x82ea('0xc'))(new Redis(config[_0x82ea('0xb')]));require(_0x82ea('0xd'))['register'](socket);function respondWithRpcPromise(_0x1cef75,_0x491ee8,_0x24ea4e){return new BPromise(function(_0x48ecb8,_0x496583){return client[_0x82ea('0xe')](_0x1cef75,_0x24ea4e)['then'](function(_0x4163a7){logger[_0x82ea('0xf')]('Plugin,\x20%s,\x20%s',_0x491ee8,'request\x20sent');logger[_0x82ea('0x10')](_0x82ea('0x11'),_0x491ee8,'request\x20sent',JSON[_0x82ea('0x12')](_0x4163a7));if(_0x4163a7[_0x82ea('0x13')]){if(_0x4163a7['error'][_0x82ea('0x14')]===0x1f4){logger[_0x82ea('0x13')](_0x82ea('0x15'),_0x491ee8,_0x4163a7[_0x82ea('0x13')]['message']);return _0x496583(_0x4163a7[_0x82ea('0x13')]['message']);}logger[_0x82ea('0x13')](_0x82ea('0x15'),_0x491ee8,_0x4163a7['error'][_0x82ea('0x16')]);return _0x48ecb8(_0x4163a7[_0x82ea('0x13')][_0x82ea('0x16')]);}else{logger[_0x82ea('0xf')]('Plugin,\x20%s,\x20%s',_0x491ee8,_0x82ea('0x17'));_0x48ecb8(_0x4163a7[_0x82ea('0x18')]['message']);}})[_0x82ea('0x19')](function(_0x41c6af){logger['error']('Plugin,\x20%s,\x20%s',_0x491ee8,_0x41c6af);_0x496583(_0x41c6af);});});}exports[_0x82ea('0x1a')]=function(_0x3d12a7){var _0x167cec=this;return new Promise(function(_0x2b4dfd,_0x136199){return db[_0x82ea('0x1b')][_0x82ea('0x1c')](_0x3d12a7[_0x82ea('0x1d')],{'raw':_0x3d12a7['options']?_0x3d12a7[_0x82ea('0x1e')][_0x82ea('0x1f')]===undefined?!![]:![]:!![]})[_0x82ea('0x20')](function(_0x248956){logger[_0x82ea('0xf')](_0x82ea('0x1a'),_0x3d12a7);logger[_0x82ea('0x10')]('CreatePlugin',_0x3d12a7,JSON[_0x82ea('0x12')](_0x248956));_0x2b4dfd(_0x248956);})[_0x82ea('0x19')](function(_0x51e9b5){logger['error'](_0x82ea('0x1a'),_0x51e9b5[_0x82ea('0x16')],_0x3d12a7);_0x136199(_0x167cec[_0x82ea('0x13')](0x1f4,_0x51e9b5['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 278c79e..c8e9c57 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 _0xc0ef=['removeListener','register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x753dc7,_0x3f487f){var _0x2a109c=function(_0x238e48){while(--_0x238e48){_0x753dc7['push'](_0x753dc7['shift']());}};_0x2a109c(++_0x3f487f);}(_0xc0ef,0xee));var _0xfc0e=function(_0x37db66,_0x23b4ad){_0x37db66=_0x37db66-0x0;var _0x3fbaca=_0xc0ef[_0x37db66];return _0x3fbaca;};'use strict';var PluginEvents=require(_0xfc0e('0x0'));var events=[_0xfc0e('0x1'),_0xfc0e('0x2'),_0xfc0e('0x3')];function createListener(_0x204877,_0x18fdd9){return function(_0x5c1851){_0x18fdd9[_0xfc0e('0x4')](_0x204877,_0x5c1851);};}function removeListener(_0x1187cd,_0x2c13ed){return function(){PluginEvents[_0xfc0e('0x5')](_0x1187cd,_0x2c13ed);};}exports[_0xfc0e('0x6')]=function(_0x3b2cc0){for(var _0x5efd00=0x0,_0x11e8ed=events[_0xfc0e('0x7')];_0x5efd00<_0x11e8ed;_0x5efd00++){var _0x51d9bf=events[_0x5efd00];var _0x2d600d=createListener(_0xfc0e('0x8')+_0x51d9bf,_0x3b2cc0);PluginEvents['on'](_0x51d9bf,_0x2d600d);}}; \ No newline at end of file +var _0xeb3f=['./plugin.events','save','remove','update','emit','removeListener','register','plugin:'];(function(_0x201155,_0x465fe2){var _0x4fe9a8=function(_0x11fa93){while(--_0x11fa93){_0x201155['push'](_0x201155['shift']());}};_0x4fe9a8(++_0x465fe2);}(_0xeb3f,0xa8));var _0xfeb3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xeb3f[_0x502c7d];return _0x30b7ed;};'use strict';var PluginEvents=require(_0xfeb3('0x0'));var events=[_0xfeb3('0x1'),_0xfeb3('0x2'),_0xfeb3('0x3')];function createListener(_0x35e554,_0x48b70c){return function(_0x2c0229){_0x48b70c[_0xfeb3('0x4')](_0x35e554,_0x2c0229);};}function removeListener(_0x1f27f4,_0x125a2f){return function(){PluginEvents[_0xfeb3('0x5')](_0x1f27f4,_0x125a2f);};}exports[_0xfeb3('0x6')]=function(_0x455738){for(var _0x10fa12=0x0,_0x38379c=events['length'];_0x10fa12<_0x38379c;_0x10fa12++){var _0x20dfc4=events[_0x10fa12];var _0x1a4e9c=createListener(_0xfeb3('0x7')+_0x20dfc4,_0x455738);PluginEvents['on'](_0x20dfc4,_0x1a4e9c);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 8ccff7c..6aa9ecc 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 _0xd14e=['update','delete','destroy','exports','express','Router','./pm2.controller','get','isAuthenticated','create','put','/:id'];(function(_0x34aa84,_0x5ec2b6){var _0x5f4442=function(_0x5dc960){while(--_0x5dc960){_0x34aa84['push'](_0x34aa84['shift']());}};_0x5f4442(++_0x5ec2b6);}(_0xd14e,0x19c));var _0xed14=function(_0x5cd3b5,_0x3fda6d){_0x5cd3b5=_0x5cd3b5-0x0;var _0x508a31=_0xd14e[_0x5cd3b5];return _0x508a31;};'use strict';var express=require(_0xed14('0x0'));var router=express[_0xed14('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xed14('0x2'));router[_0xed14('0x3')]('/',auth[_0xed14('0x4')](),controller['index']);router[_0xed14('0x3')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xed14('0x4')](),controller[_0xed14('0x5')]);router[_0xed14('0x6')](_0xed14('0x7'),auth[_0xed14('0x4')](),controller[_0xed14('0x8')]);router[_0xed14('0x9')]('/:id',auth[_0xed14('0x4')](),controller[_0xed14('0xa')]);module[_0xed14('0xb')]=router; \ No newline at end of file +var _0xe235=['update','delete','exports','express','Router','./pm2.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5b2592,_0xe9ed0a){var _0xfb2545=function(_0x1928a6){while(--_0x1928a6){_0x5b2592['push'](_0x5b2592['shift']());}};_0xfb2545(++_0xe9ed0a);}(_0xe235,0x199));var _0x5e23=function(_0x5a0c37,_0x3aaa26){_0x5a0c37=_0x5a0c37-0x0;var _0x42d188=_0xe235[_0x5a0c37];return _0x42d188;};'use strict';var express=require(_0x5e23('0x0'));var router=express[_0x5e23('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5e23('0x2'));router[_0x5e23('0x3')]('/',auth[_0x5e23('0x4')](),controller[_0x5e23('0x5')]);router[_0x5e23('0x3')](_0x5e23('0x6'),auth['isAuthenticated'](),controller[_0x5e23('0x7')]);router[_0x5e23('0x8')]('/',auth[_0x5e23('0x4')](),controller[_0x5e23('0x9')]);router[_0x5e23('0xa')](_0x5e23('0x6'),auth[_0x5e23('0x4')](),controller[_0x5e23('0xb')]);router[_0x5e23('0xc')](_0x5e23('0x6'),auth[_0x5e23('0x4')](),controller['destroy']);module[_0x5e23('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 b6b99f5..936fa89 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 _0xb983=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','reject','catch','show','params','then','create','body','script','join','cwd','chdir','start','dump'];(function(_0x5440e5,_0x56fac9){var _0x6c5beb=function(_0x381227){while(--_0x381227){_0x5440e5['push'](_0x5440e5['shift']());}};_0x6c5beb(++_0x56fac9);}(_0xb983,0x19f));var _0x3b98=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0xb983[_0x53b594];return _0x1e616f;};'use strict';var _=require(_0x3b98('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x3b98('0x1'))(_0x3b98('0x2'));var path=require(_0x3b98('0x3'));var exec=require(_0x3b98('0x4'))[_0x3b98('0x5')];var BPromise=require(_0x3b98('0x6'));function handleEntityNotFound(_0x521bbb,_0x2373d6){return function(_0x5457b0){if(!_0x5457b0){_0x521bbb[_0x3b98('0x7')](0x194);;}return _0x5457b0;};}function respondWithResult(_0x134d27,_0x42901e){_0x42901e=_0x42901e||0xc8;return function(_0xbc272d){if(_0xbc272d){return _0x134d27[_0x3b98('0x8')](_0x42901e)[_0x3b98('0x9')](_0xbc272d);}return null;};}function handleError(_0x22eebc,_0x2fb257){_0x2fb257=_0x2fb257||0x1f4;return function(_0x25ce87){logger[_0x3b98('0xa')](_0x25ce87['stack']);if(_0x25ce87[_0x3b98('0xb')]){delete _0x25ce87[_0x3b98('0xb')];}_0x22eebc['status'](_0x2fb257)[_0x3b98('0xc')](_0x25ce87);};}function execChildProcess(){return new BPromise(function(_0x4946ca,_0x46f794){exec(_0x3b98('0xd'),function(_0x102735,_0x5cddf5,_0x20e6d7){logger['info'](_0x5cddf5);logger[_0x3b98('0xe')](_0x20e6d7);if(_0x102735){logger[_0x3b98('0xa')](_0x102735);return _0x46f794(_0x102735);}return _0x4946ca(_0x5cddf5);});});}exports['index']=function(_0x32f622,_0x3e0419){return pm2[_0x3b98('0xf')]()['then'](function(_0x1674a3){if(_0x1674a3){var _0x4edc88=_[_0x3b98('0x10')](_0x1674a3,function(_0x57f265){return _0x57f265[_0x3b98('0xb')]==='express'||_0x57f265[_0x3b98('0xb')]==='motion2';});return{'rows':_0x4edc88,'count':_0x4edc88['length']};}return null;})['then'](respondWithResult(_0x3e0419,null))[_0x3b98('0x11')](handleError(_0x3e0419,null));};exports[_0x3b98('0x12')]=function(_0xbddb91,_0x51f3aa){return pm2['describe'](_0xbddb91[_0x3b98('0x13')]['id'])['then'](respondWithResult(_0x51f3aa,null))[_0x3b98('0x14')](handleEntityNotFound(_0x51f3aa,null))['catch'](handleError(_0x51f3aa,null));};exports[_0x3b98('0x15')]=function(_0x1d2e83,_0x2950a9){if(_0x1d2e83[_0x3b98('0x16')][_0x3b98('0xb')]&&_0x1d2e83[_0x3b98('0x16')][_0x3b98('0x17')]){var _0x348fbd=path[_0x3b98('0x18')](__dirname,'../../files/plugins',_0x1d2e83['body'][_0x3b98('0x17')]);var _0x4de00e=process[_0x3b98('0x19')]();process['chdir'](path['dirname'](_0x348fbd));return execChildProcess()[_0x3b98('0x14')](function(_0x200a60){process[_0x3b98('0x1a')](_0x4de00e);return pm2[_0x3b98('0x1b')]({'name':_0x1d2e83[_0x3b98('0x16')][_0x3b98('0xb')],'script':_0x348fbd});})[_0x3b98('0x14')](function(_0x54c35e){pm2[_0x3b98('0x1c')]();return _0x54c35e[0x0];})[_0x3b98('0x14')](respondWithResult(_0x2950a9,0xc9))[_0x3b98('0x11')](handleError(_0x2950a9,null));}else{return _0x2950a9['status'](0x1f4)[_0x3b98('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x3b98('0x1d')]=function(_0x3edaec,_0x1be8e8){if(_0x3edaec[_0x3b98('0x16')]['id']){delete _0x3edaec[_0x3b98('0x16')]['id'];}var _0x42f036={'online':_0x3b98('0x1e'),'stopped':_0x3b98('0x1f')};if(_0x42f036[_0x3b98('0x20')](_0x3edaec[_0x3b98('0x16')][_0x3b98('0x8')])){return pm2[_0x42f036[_0x3edaec['body']['status']]](_0x3edaec[_0x3b98('0x13')]['id'])[_0x3b98('0x14')](respondWithResult(_0x1be8e8,0xc8))['catch'](handleError(_0x1be8e8,null));}else{return _0x1be8e8[_0x3b98('0x8')](0x1f4)[_0x3b98('0xc')]({'message':_0x3b98('0x21')});}};exports[_0x3b98('0x22')]=function(_0x50bd11,_0x3ad32b){if(_0x50bd11[_0x3b98('0x16')]['id']){delete _0x50bd11['body']['id'];}if(_0x50bd11[_0x3b98('0x13')]['id']){return pm2[_0x3b98('0x23')](_0x50bd11[_0x3b98('0x13')]['id'])[_0x3b98('0x14')](function(_0x4ebd9b){pm2[_0x3b98('0x1c')]();return _0x4ebd9b[0x0];})[_0x3b98('0x14')](respondWithResult(_0x3ad32b,null))[_0x3b98('0x11')](handleError(_0x3ad32b,null));}else{return _0x3ad32b[_0x3b98('0x8')](0x1f4)[_0x3b98('0xc')]({'message':_0x3b98('0x24')});}}; \ No newline at end of file +var _0xa5ff=['exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','reject','length','then','show','catch','create','body','../../files/plugins','cwd','chdir','start','dump','update','hasOwnProperty','Unknown\x20status','destroy','params','delete','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process'];(function(_0xc91b77,_0x2dd955){var _0x155aed=function(_0x116de5){while(--_0x116de5){_0xc91b77['push'](_0xc91b77['shift']());}};_0x155aed(++_0x2dd955);}(_0xa5ff,0xa6));var _0xfa5f=function(_0x5b6a6a,_0x193a87){_0x5b6a6a=_0x5b6a6a-0x0;var _0x3b3fc5=_0xa5ff[_0x5b6a6a];return _0x3b3fc5;};'use strict';var _=require('lodash');var pm2=require(_0xfa5f('0x0'));var logger=require(_0xfa5f('0x1'))('api');var path=require(_0xfa5f('0x2'));var exec=require(_0xfa5f('0x3'))[_0xfa5f('0x4')];var BPromise=require(_0xfa5f('0x5'));function handleEntityNotFound(_0x5b7b00,_0x4b247d){return function(_0x284fda){if(!_0x284fda){_0x5b7b00[_0xfa5f('0x6')](0x194);;}return _0x284fda;};}function respondWithResult(_0x330eda,_0x2e2ffb){_0x2e2ffb=_0x2e2ffb||0xc8;return function(_0x182016){if(_0x182016){return _0x330eda[_0xfa5f('0x7')](_0x2e2ffb)[_0xfa5f('0x8')](_0x182016);}return null;};}function handleError(_0x344253,_0x5ad6fc){_0x5ad6fc=_0x5ad6fc||0x1f4;return function(_0x590e14){logger['error'](_0x590e14[_0xfa5f('0x9')]);if(_0x590e14['name']){delete _0x590e14[_0xfa5f('0xa')];}_0x344253[_0xfa5f('0x7')](_0x5ad6fc)[_0xfa5f('0xb')](_0x590e14);};}function execChildProcess(){return new BPromise(function(_0x51cb84,_0x10c321){exec(_0xfa5f('0xc'),function(_0x596064,_0x190279,_0x14a071){logger[_0xfa5f('0xd')](_0x190279);logger[_0xfa5f('0xd')](_0x14a071);if(_0x596064){logger[_0xfa5f('0xe')](_0x596064);return _0x10c321(_0x596064);}return _0x51cb84(_0x190279);});});}exports['index']=function(_0x40100a,_0x96b759){return pm2['list']()['then'](function(_0x5bd8ee){if(_0x5bd8ee){var _0x34ae2f=_[_0xfa5f('0xf')](_0x5bd8ee,function(_0xc5891b){return _0xc5891b[_0xfa5f('0xa')]==='express'||_0xc5891b['name']==='motion2';});return{'rows':_0x34ae2f,'count':_0x34ae2f[_0xfa5f('0x10')]};}return null;})[_0xfa5f('0x11')](respondWithResult(_0x96b759,null))['catch'](handleError(_0x96b759,null));};exports[_0xfa5f('0x12')]=function(_0x53a015,_0x130855){return pm2['describe'](_0x53a015['params']['id'])[_0xfa5f('0x11')](respondWithResult(_0x130855,null))[_0xfa5f('0x11')](handleEntityNotFound(_0x130855,null))[_0xfa5f('0x13')](handleError(_0x130855,null));};exports[_0xfa5f('0x14')]=function(_0x1eea9b,_0x1d9166){if(_0x1eea9b[_0xfa5f('0x15')][_0xfa5f('0xa')]&&_0x1eea9b[_0xfa5f('0x15')]['script']){var _0x1c194b=path['join'](__dirname,_0xfa5f('0x16'),_0x1eea9b[_0xfa5f('0x15')]['script']);var _0x37eb0c=process[_0xfa5f('0x17')]();process['chdir'](path['dirname'](_0x1c194b));return execChildProcess()['then'](function(_0x4c1fea){process[_0xfa5f('0x18')](_0x37eb0c);return pm2[_0xfa5f('0x19')]({'name':_0x1eea9b[_0xfa5f('0x15')]['name'],'script':_0x1c194b});})[_0xfa5f('0x11')](function(_0x23be02){pm2[_0xfa5f('0x1a')]();return _0x23be02[0x0];})['then'](respondWithResult(_0x1d9166,0xc9))[_0xfa5f('0x13')](handleError(_0x1d9166,null));}else{return _0x1d9166['status'](0x1f4)[_0xfa5f('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xfa5f('0x1b')]=function(_0x3decd2,_0x3ca88c){if(_0x3decd2[_0xfa5f('0x15')]['id']){delete _0x3decd2['body']['id'];}var _0x55ace8={'online':'restart','stopped':'stop'};if(_0x55ace8[_0xfa5f('0x1c')](_0x3decd2['body'][_0xfa5f('0x7')])){return pm2[_0x55ace8[_0x3decd2['body'][_0xfa5f('0x7')]]](_0x3decd2['params']['id'])[_0xfa5f('0x11')](respondWithResult(_0x3ca88c,0xc8))[_0xfa5f('0x13')](handleError(_0x3ca88c,null));}else{return _0x3ca88c[_0xfa5f('0x7')](0x1f4)['send']({'message':_0xfa5f('0x1d')});}};exports[_0xfa5f('0x1e')]=function(_0x33c644,_0x4b189e){if(_0x33c644['body']['id']){delete _0x33c644[_0xfa5f('0x15')]['id'];}if(_0x33c644[_0xfa5f('0x1f')]['id']){return pm2[_0xfa5f('0x20')](_0x33c644[_0xfa5f('0x1f')]['id'])['then'](function(_0x3aa3ad){pm2[_0xfa5f('0x1a')]();return _0x3aa3ad[0x0];})[_0xfa5f('0x11')](respondWithResult(_0x4b189e,null))['catch'](handleError(_0x4b189e,null));}else{return _0x4b189e['status'](0x1f4)[_0xfa5f('0xb')]({'message':_0xfa5f('0x21')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 16d4ba9..9edbbd3 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 _0x386b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express'];(function(_0x1bc3dc,_0x48aa24){var _0x1b4af8=function(_0x365c85){while(--_0x365c85){_0x1bc3dc['push'](_0x1bc3dc['shift']());}};_0x1b4af8(++_0x48aa24);}(_0x386b,0xcb));var _0xb386=function(_0x5da4dd,_0x367f52){_0x5da4dd=_0x5da4dd-0x0;var _0x5d6cb5=_0x386b[_0x5da4dd];return _0x5d6cb5;};'use strict';var multer=require('multer');var util=require(_0xb386('0x0'));var path=require(_0xb386('0x1'));var timeout=require(_0xb386('0x2'));var express=require(_0xb386('0x3'));var router=express[_0xb386('0x4')]();var auth=require(_0xb386('0x5'));var interaction=require(_0xb386('0x6'));var config=require(_0xb386('0x7'));module[_0xb386('0x8')]=router; \ No newline at end of file +var _0x9c51=['express','Router','../../components/interaction/service','exports','util','connect-timeout'];(function(_0x1dece7,_0x18cf0e){var _0x584962=function(_0x58f4b6){while(--_0x58f4b6){_0x1dece7['push'](_0x1dece7['shift']());}};_0x584962(++_0x18cf0e);}(_0x9c51,0x13c));var _0x19c5=function(_0x273553,_0x6c88af){_0x273553=_0x273553-0x0;var _0x456527=_0x9c51[_0x273553];return _0x456527;};'use strict';var multer=require('multer');var util=require(_0x19c5('0x0'));var path=require('path');var timeout=require(_0x19c5('0x1'));var express=require(_0x19c5('0x2'));var router=express[_0x19c5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x19c5('0x4'));var config=require('../../config/environment');module[_0x19c5('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 b752c35..4dc2456 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 _0xbe58=['STRING','sequelize','exports','INTEGER','DATE'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0xbe58,0x196));var _0x8be5=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xbe58[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x8be5('0x0'));module[_0x8be5('0x1')]={'state':{'type':Sequelize[_0x8be5('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x8be5('0x3')]},'uniqueid':{'type':Sequelize[_0x8be5('0x4')]},'starttime':{'type':Sequelize[_0x8be5('0x3')]},'responsetime':{'type':Sequelize[_0x8be5('0x3')]},'ringtime':{'type':Sequelize[_0x8be5('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8be5('0x4')]},'campaigntype':{'type':Sequelize[_0x8be5('0x4')]},'membername':{'type':Sequelize[_0x8be5('0x4')]}}; \ No newline at end of file +var _0xaa66=['DATE','INTEGER','STRING'];(function(_0x4998e4,_0x47a4ed){var _0x1bef53=function(_0x458797){while(--_0x458797){_0x4998e4['push'](_0x4998e4['shift']());}};_0x1bef53(++_0x47a4ed);}(_0xaa66,0x73));var _0x6aa6=function(_0x4f56f4,_0x40fa78){_0x4f56f4=_0x4f56f4-0x0;var _0x2ef67f=_0xaa66[_0x4f56f4];return _0x2ef67f;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x6aa6('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x6aa6('0x1')]},'scheduledat':{'type':Sequelize[_0x6aa6('0x2')]},'uniqueid':{'type':Sequelize[_0x6aa6('0x1')]},'starttime':{'type':Sequelize[_0x6aa6('0x2')]},'responsetime':{'type':Sequelize[_0x6aa6('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6aa6('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 93d2435..a543136 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 _0xb41c=['define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','request-promise','./reportAgentPreview.attributes'];(function(_0x15cff2,_0x13bb7c){var _0x1ed7af=function(_0x35519f){while(--_0x35519f){_0x15cff2['push'](_0x15cff2['shift']());}};_0x1ed7af(++_0x13bb7c);}(_0xb41c,0x150));var _0xcb41=function(_0x3eea23,_0x3472b7){_0x3eea23=_0x3eea23-0x0;var _0x1dc63a=_0xb41c[_0x3eea23];return _0x1dc63a;};'use strict';var _=require(_0xcb41('0x0'));var util=require(_0xcb41('0x1'));var logger=require(_0xcb41('0x2'))(_0xcb41('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb41('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb41('0x5'));module['exports']=function(_0x18dd7c,_0x2e46a7){return _0x18dd7c[_0xcb41('0x6')](_0xcb41('0x7'),attributes,{'tableName':_0xcb41('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d71=['request-promise','path','rimraf','../../config/environment','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5425e2,_0x264270){var _0xe8616e=function(_0x39b971){while(--_0x39b971){_0x5425e2['push'](_0x5425e2['shift']());}};_0xe8616e(++_0x264270);}(_0x7d71,0x103));var _0x17d7=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x7d71[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x17d7('0x0'));var util=require('util');var logger=require(_0x17d7('0x1'))(_0x17d7('0x2'));var moment=require(_0x17d7('0x3'));var BPromise=require(_0x17d7('0x4'));var rp=require(_0x17d7('0x5'));var fs=require('fs');var path=require(_0x17d7('0x6'));var rimraf=require(_0x17d7('0x7'));var config=require(_0x17d7('0x8'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x4fd005,_0x540e18){return _0x4fd005[_0x17d7('0x9')](_0x17d7('0xa'),attributes,{'tableName':_0x17d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 26559b5..f8798f4 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 _0xb2e5=['rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xb2e5,0x89));var _0x5b2e=function(_0x21d02a,_0x2c1ebe){_0x21d02a=_0x21d02a-0x0;var _0x32307e=_0xb2e5[_0x21d02a];return _0x32307e;};'use strict';var _=require(_0x5b2e('0x0'));var util=require(_0x5b2e('0x1'));var moment=require(_0x5b2e('0x2'));var BPromise=require(_0x5b2e('0x3'));var rs=require(_0x5b2e('0x4'));var fs=require('fs');var Redis=require(_0x5b2e('0x5'));var db=require(_0x5b2e('0x6'))['db'];var utils=require(_0x5b2e('0x7'));var logger=require('../../config/logger')(_0x5b2e('0x8'));var config=require(_0x5b2e('0x9'));var jayson=require(_0x5b2e('0xa'));var client=jayson[_0x5b2e('0xb')][_0x5b2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x145a23,_0x5d3324,_0x2f4046){return new BPromise(function(_0xcebec3,_0x193356){return client['request'](_0x145a23,_0x2f4046)['then'](function(_0x34e123){logger[_0x5b2e('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d3324,_0x5b2e('0xe'));logger[_0x5b2e('0xf')](_0x5b2e('0x10'),_0x5d3324,'request\x20sent',JSON[_0x5b2e('0x11')](_0x34e123));if(_0x34e123['error']){if(_0x34e123[_0x5b2e('0x12')][_0x5b2e('0x13')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x5d3324,_0x34e123['error'][_0x5b2e('0x14')]);return _0x193356(_0x34e123[_0x5b2e('0x12')]['message']);}logger[_0x5b2e('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d3324,_0x34e123[_0x5b2e('0x12')]['message']);return _0xcebec3(_0x34e123[_0x5b2e('0x12')]['message']);}else{logger[_0x5b2e('0xd')](_0x5b2e('0x15'),_0x5d3324,_0x5b2e('0xe'));_0xcebec3(_0x34e123[_0x5b2e('0x16')][_0x5b2e('0x14')]);}})[_0x5b2e('0x17')](function(_0xdad0f4){logger[_0x5b2e('0x12')](_0x5b2e('0x15'),_0x5d3324,_0xdad0f4);_0x193356(_0xdad0f4);});});}exports[_0x5b2e('0x18')]=function(_0x3dc69a){var _0x453d8d=this;return new Promise(function(_0x154146,_0x590948){return db[_0x5b2e('0x19')][_0x5b2e('0x1a')](_0x3dc69a[_0x5b2e('0x1b')],{'raw':_0x3dc69a['options']?_0x3dc69a[_0x5b2e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21ea7a){logger['info']('CreateReportAgentPreview',_0x3dc69a);logger[_0x5b2e('0xf')](_0x5b2e('0x18'),_0x3dc69a,JSON[_0x5b2e('0x11')](_0x21ea7a));_0x154146(_0x21ea7a);})[_0x5b2e('0x17')](function(_0x33c82c){logger[_0x5b2e('0x12')]('CreateReportAgentPreview',_0x33c82c[_0x5b2e('0x14')],_0x3dc69a);_0x590948(_0x453d8d['error'](0x1f4,_0x33c82c[_0x5b2e('0x14')]));});});}; \ No newline at end of file +var _0x4177=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','create','body','options','raw','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x330571,_0x536e62){var _0xd418da=function(_0x1f611f){while(--_0x1f611f){_0x330571['push'](_0x330571['shift']());}};_0xd418da(++_0x536e62);}(_0x4177,0x130));var _0x7417=function(_0x19b6f4,_0x3e578e){_0x19b6f4=_0x19b6f4-0x0;var _0x1cda20=_0x4177[_0x19b6f4];return _0x1cda20;};'use strict';var _=require(_0x7417('0x0'));var util=require('util');var moment=require(_0x7417('0x1'));var BPromise=require(_0x7417('0x2'));var rs=require(_0x7417('0x3'));var fs=require('fs');var Redis=require(_0x7417('0x4'));var db=require(_0x7417('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7417('0x6'));var config=require('../../config/environment');var jayson=require(_0x7417('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x484f9d,_0x1138cf,_0x4e7b1d){return new BPromise(function(_0x2f440f,_0x2c7d92){return client['request'](_0x484f9d,_0x4e7b1d)[_0x7417('0x8')](function(_0x2034b9){logger[_0x7417('0x9')](_0x7417('0xa'),_0x1138cf,_0x7417('0xb'));logger[_0x7417('0xc')](_0x7417('0xd'),_0x1138cf,_0x7417('0xb'),JSON[_0x7417('0xe')](_0x2034b9));if(_0x2034b9['error']){if(_0x2034b9[_0x7417('0xf')]['code']===0x1f4){logger[_0x7417('0xf')](_0x7417('0xa'),_0x1138cf,_0x2034b9[_0x7417('0xf')]['message']);return _0x2c7d92(_0x2034b9[_0x7417('0xf')]['message']);}logger[_0x7417('0xf')](_0x7417('0xa'),_0x1138cf,_0x2034b9[_0x7417('0xf')][_0x7417('0x10')]);return _0x2f440f(_0x2034b9[_0x7417('0xf')][_0x7417('0x10')]);}else{logger['info'](_0x7417('0xa'),_0x1138cf,_0x7417('0xb'));_0x2f440f(_0x2034b9[_0x7417('0x11')]['message']);}})[_0x7417('0x12')](function(_0x39625c){logger['error'](_0x7417('0xa'),_0x1138cf,_0x39625c);_0x2c7d92(_0x39625c);});});}exports['CreateReportAgentPreview']=function(_0x5ccddf){var _0x13f036=this;return new Promise(function(_0x113751,_0x21ab8a){return db['ReportAgentPreview'][_0x7417('0x13')](_0x5ccddf[_0x7417('0x14')],{'raw':_0x5ccddf[_0x7417('0x15')]?_0x5ccddf[_0x7417('0x15')][_0x7417('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x2b960b){logger['info'](_0x7417('0x17'),_0x5ccddf);logger['debug']('CreateReportAgentPreview',_0x5ccddf,JSON[_0x7417('0xe')](_0x2b960b));_0x113751(_0x2b960b);})['catch'](function(_0x38fe20){logger[_0x7417('0xf')](_0x7417('0x17'),_0x38fe20['message'],_0x5ccddf);_0x21ab8a(_0x13f036[_0x7417('0xf')](0x1f4,_0x38fe20['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 6603cdb..a55fc64 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 _0xa288=['/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','queueNotify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','util','express','Router','../../components/auth/service','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outboundChannels','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','campaigns'];(function(_0x3b1a52,_0x82c312){var _0x2bfca1=function(_0x3fd338){while(--_0x3fd338){_0x3b1a52['push'](_0x3b1a52['shift']());}};_0x2bfca1(++_0x82c312);}(_0xa288,0x6b));var _0x8a28=function(_0x31a910,_0x1f87b5){_0x31a910=_0x31a910-0x0;var _0x5024df=_0xa288[_0x31a910];return _0x5024df;};'use strict';var multer=require('multer');var util=require(_0x8a28('0x0'));var path=require('path');var express=require(_0x8a28('0x1'));var router=express[_0x8a28('0x2')]();var auth=require(_0x8a28('0x3'));var controller=require('./rpc.controller');router[_0x8a28('0x4')]('/voice/channels',auth[_0x8a28('0x5')](),controller[_0x8a28('0x6')]);router[_0x8a28('0x4')](_0x8a28('0x7'),auth[_0x8a28('0x5')](),controller['voiceChannelMixMonitor']);router[_0x8a28('0x4')](_0x8a28('0x8'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x8a28('0x4')](_0x8a28('0x9'),auth['isAuthenticated'](),controller[_0x8a28('0xa')]);router[_0x8a28('0x4')]('/chat/queues',auth[_0x8a28('0x5')](),controller[_0x8a28('0xb')]);router[_0x8a28('0x4')](_0x8a28('0xc'),auth[_0x8a28('0x5')](),controller[_0x8a28('0xd')]);router[_0x8a28('0x4')](_0x8a28('0xe'),auth['isAuthenticated'](),controller[_0x8a28('0xf')]);router[_0x8a28('0x4')](_0x8a28('0x10'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x8a28('0x4')](_0x8a28('0x11'),auth['isAuthenticated'](),controller[_0x8a28('0x12')]);router['get'](_0x8a28('0x13'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x14')]);router[_0x8a28('0x4')](_0x8a28('0x15'),auth['isAuthenticated'](),controller['faxQueues']);router[_0x8a28('0x4')](_0x8a28('0x16'),auth['isAuthenticated'](),controller[_0x8a28('0x17')]);router[_0x8a28('0x4')](_0x8a28('0x18'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x19')]);router[_0x8a28('0x4')](_0x8a28('0x1a'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x1b')]);router[_0x8a28('0x4')](_0x8a28('0x1c'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x1d')]);router[_0x8a28('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x8a28('0x5')](),controller[_0x8a28('0x1e')]);router[_0x8a28('0x4')](_0x8a28('0x1f'),auth[_0x8a28('0x5')](),controller['showVoiceQueues']);router['get'](_0x8a28('0x20'),auth[_0x8a28('0x5')](),controller['outbound']);router[_0x8a28('0x4')]('/outbound/channels',auth[_0x8a28('0x5')](),controller[_0x8a28('0x21')]);router[_0x8a28('0x4')]('/agents',auth[_0x8a28('0x5')](),controller['agents']);router[_0x8a28('0x22')](_0x8a28('0x23'),auth[_0x8a28('0x5')](),controller['agentCapacity']);router['get'](_0x8a28('0x24'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x25')]);router['get'](_0x8a28('0x26'),auth['isAuthenticated'](),controller[_0x8a28('0x27')]);router[_0x8a28('0x4')]('/campaigns',auth[_0x8a28('0x5')](),controller[_0x8a28('0x28')]);router[_0x8a28('0x4')](_0x8a28('0x29'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x2a')]);router[_0x8a28('0x4')](_0x8a28('0x2b'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x2c')]);router[_0x8a28('0x4')](_0x8a28('0x2d'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x8a28('0x4')](_0x8a28('0x2e'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x2f')]);router[_0x8a28('0x4')](_0x8a28('0x30'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x31')]);router[_0x8a28('0x4')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x8a28('0x32')]);router['get']('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x8a28('0x33')]);router[_0x8a28('0x34')](_0x8a28('0x35'),auth[_0x8a28('0x5')](),controller['queueNotify'](_0x8a28('0x36')));router[_0x8a28('0x4')](_0x8a28('0x37'),auth['isAuthenticated'](),controller[_0x8a28('0x38')]);router[_0x8a28('0x34')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x8a28('0x39')](_0x8a28('0x3a')));router['get'](_0x8a28('0x3b'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x3c')]);router[_0x8a28('0x34')]('/fax/queues/:id/notify',auth[_0x8a28('0x5')](),controller['queueNotify'](_0x8a28('0x3d')));router['get'](_0x8a28('0x3e'),auth[_0x8a28('0x5')](),controller['showFaxQueues']);router[_0x8a28('0x34')](_0x8a28('0x3f'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x39')](_0x8a28('0x40')));router[_0x8a28('0x4')](_0x8a28('0x41'),auth[_0x8a28('0x5')](),controller['showOpenchannelQueues']);router[_0x8a28('0x34')](_0x8a28('0x42'),auth['isAuthenticated'](),controller[_0x8a28('0x39')]('sms'));router[_0x8a28('0x34')](_0x8a28('0x43'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x39')](_0x8a28('0x44')));router[_0x8a28('0x4')](_0x8a28('0x45'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x46')]);router['get'](_0x8a28('0x47'),auth[_0x8a28('0x5')](),controller[_0x8a28('0x48')]);router[_0x8a28('0x34')](_0x8a28('0x49'),auth[_0x8a28('0x5')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file +var _0xd99f=['mailAccounts','/openchannel/queues','openchannelQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','put','/telephones','telephones','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','post','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','multer','util','path','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0xd99f,0x17c));var _0xfd99=function(_0x374a99,_0x36d5d0){_0x374a99=_0x374a99-0x0;var _0x1bab09=_0xd99f[_0x374a99];return _0x1bab09;};'use strict';var multer=require(_0xfd99('0x0'));var util=require(_0xfd99('0x1'));var path=require(_0xfd99('0x2'));var express=require('express');var router=express[_0xfd99('0x3')]();var auth=require(_0xfd99('0x4'));var controller=require(_0xfd99('0x5'));router['get'](_0xfd99('0x6'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x8')]);router[_0xfd99('0x9')](_0xfd99('0xa'),auth[_0xfd99('0x7')](),controller[_0xfd99('0xb')]);router[_0xfd99('0x9')](_0xfd99('0xc'),auth[_0xfd99('0x7')](),controller[_0xfd99('0xd')]);router[_0xfd99('0x9')](_0xfd99('0xe'),auth[_0xfd99('0x7')](),controller[_0xfd99('0xf')]);router[_0xfd99('0x9')](_0xfd99('0x10'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x11')]);router[_0xfd99('0x9')](_0xfd99('0x12'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x13')]);router[_0xfd99('0x9')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xfd99('0x14')]);router[_0xfd99('0x9')](_0xfd99('0x15'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x16')]);router[_0xfd99('0x9')]('/sms/queues',auth[_0xfd99('0x7')](),controller['smsQueues']);router[_0xfd99('0x9')]('/whatsapp/queues',auth[_0xfd99('0x7')](),controller[_0xfd99('0x17')]);router['get'](_0xfd99('0x18'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x19')]);router[_0xfd99('0x9')](_0xfd99('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router['get'](_0xfd99('0x1b'),auth['isAuthenticated'](),controller[_0xfd99('0x1c')]);router[_0xfd99('0x9')](_0xfd99('0x1d'),auth[_0xfd99('0x7')](),controller['voiceQueuesChannel']);router[_0xfd99('0x9')](_0xfd99('0x1e'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x1f')]);router['get'](_0xfd99('0x20'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x21')]);router['get'](_0xfd99('0x22'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x23')]);router[_0xfd99('0x9')](_0xfd99('0x24'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x25')]);router['get']('/outbound/channels',auth[_0xfd99('0x7')](),controller[_0xfd99('0x26')]);router[_0xfd99('0x9')](_0xfd99('0x27'),auth['isAuthenticated'](),controller[_0xfd99('0x28')]);router[_0xfd99('0x29')]('/agents/:id/capacity',auth[_0xfd99('0x7')](),controller['agentCapacity']);router[_0xfd99('0x9')](_0xfd99('0x2a'),auth['isAuthenticated'](),controller[_0xfd99('0x2b')]);router['get']('/trunks',auth[_0xfd99('0x7')](),controller[_0xfd99('0x2c')]);router[_0xfd99('0x9')](_0xfd99('0x2d'),auth['isAuthenticated'](),controller[_0xfd99('0x2e')]);router[_0xfd99('0x9')]('/fax/accounts',auth[_0xfd99('0x7')](),controller[_0xfd99('0x2f')]);router['get'](_0xfd99('0x30'),auth[_0xfd99('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xfd99('0x9')]('/mail/queues/waitinginteractions',auth[_0xfd99('0x7')](),controller[_0xfd99('0x31')]);router['get'](_0xfd99('0x32'),auth['isAuthenticated'](),controller[_0xfd99('0x33')]);router[_0xfd99('0x9')](_0xfd99('0x34'),auth[_0xfd99('0x7')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0xfd99('0x7')](),controller[_0xfd99('0x35')]);router[_0xfd99('0x9')](_0xfd99('0x36'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x37')]);router['post'](_0xfd99('0x38'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x39')](_0xfd99('0x3a')));router[_0xfd99('0x9')](_0xfd99('0x3b'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x3c')]);router[_0xfd99('0x3d')](_0xfd99('0x3e'),auth[_0xfd99('0x7')](),controller['queueNotify']('chat'));router['get'](_0xfd99('0x3f'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x40')]);router['post']('/fax/queues/:id/notify',auth[_0xfd99('0x7')](),controller['queueNotify'](_0xfd99('0x41')));router[_0xfd99('0x9')](_0xfd99('0x42'),auth['isAuthenticated'](),controller[_0xfd99('0x43')]);router[_0xfd99('0x3d')](_0xfd99('0x44'),auth['isAuthenticated'](),controller['queueNotify'](_0xfd99('0x45')));router[_0xfd99('0x9')](_0xfd99('0x46'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x47')]);router[_0xfd99('0x3d')](_0xfd99('0x48'),auth[_0xfd99('0x7')](),controller['queueNotify'](_0xfd99('0x49')));router[_0xfd99('0x3d')](_0xfd99('0x4a'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x39')](_0xfd99('0x4b')));router[_0xfd99('0x9')](_0xfd99('0x4c'),auth[_0xfd99('0x7')](),controller[_0xfd99('0x4d')]);router['get']('/whatsapp/queues/:id',auth[_0xfd99('0x7')](),controller[_0xfd99('0x4e')]);router['post'](_0xfd99('0x4f'),auth[_0xfd99('0x7')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d052c58..c8bdfb3 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 _0xf0db=['WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','queue','MessageId','InteractionId','From','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','TransferReport','Start','agent','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','json','sendStatus','stack','name','status','isNil','find','voiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','params','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','interface','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xf0db,0x112));var _0xbf0d=function(_0x4d27da,_0x2648d5){_0x4d27da=_0x4d27da-0x0;var _0x19f779=_0xf0db[_0x4d27da];return _0x19f779;};'use strict';var BPromise=require('bluebird');var moment=require(_0xbf0d('0x0'));var _=require(_0xbf0d('0x1'));var util=require('util');var db=require(_0xbf0d('0x2'))['db'];var logger=require(_0xbf0d('0x3'))(_0xbf0d('0x4'));var jayson=require(_0xbf0d('0x5'));var amiClient=jayson[_0xbf0d('0x6')][_0xbf0d('0x7')]({'port':0x232a});var mailClient=jayson[_0xbf0d('0x6')][_0xbf0d('0x7')]({'port':0x232b});var routingClient=jayson[_0xbf0d('0x6')][_0xbf0d('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x24a46c,_0x2e10fb,_0x420a4c){return new BPromise(function(_0x44e6ec,_0x418976){var _0x322424=_0x420a4c?_0x420a4c:amiClient;return _0x322424[_0xbf0d('0x8')](_0x24a46c,_0x2e10fb)[_0xbf0d('0x9')](function(_0x1312f3){if(_0x1312f3[_0xbf0d('0xa')]){if(_0x1312f3[_0xbf0d('0xa')][_0xbf0d('0xb')]===0x1f4){return _0x418976(_0x1312f3[_0xbf0d('0xa')][_0xbf0d('0xc')]);}return _0x44e6ec(_0x1312f3[_0xbf0d('0xa')][_0xbf0d('0xc')]);}else{_0x44e6ec(_0x1312f3['result']);}})[_0xbf0d('0xd')](function(_0x433164){_0x418976(_0x433164);});});}function respondWithResult(_0x34a485,_0x2269dc){_0x2269dc=_0x2269dc||0xc8;return function(_0x21d3f3){if(_0x21d3f3){return _0x34a485['status'](_0x2269dc)[_0xbf0d('0xe')](_0x21d3f3);}return _0x34a485[_0xbf0d('0xf')](0x194);};}function handleError(_0x3bf110,_0xfe1e25){_0xfe1e25=_0xfe1e25||0x1f4;return function(_0x331a3d){logger['error'](_0x331a3d[_0xbf0d('0x10')]);if(_0x331a3d[_0xbf0d('0x11')]){delete _0x331a3d[_0xbf0d('0x11')];}_0x3bf110[_0xbf0d('0x12')](_0xfe1e25)['send'](_0x331a3d);};}function findById(_0x518f29){return function(_0xf7b86e){if(!_[_0xbf0d('0x13')](_0x518f29)&&!_[_0xbf0d('0x13')](_0xf7b86e)&&!_[_0xbf0d('0x13')](_0xf7b86e['rows'])){return _[_0xbf0d('0x14')](_0xf7b86e['rows'],function(_0x4ef290){return _0x4ef290['id']==_0x518f29;});}return null;};}exports[_0xbf0d('0x15')]=function(_0x2a78c4,_0x52d154){return respondWithRpcPromise('VoiceChannels',_0x2a78c4['query'])[_0xbf0d('0x9')](respondWithResult(_0x52d154,null))[_0xbf0d('0xd')](handleError(_0x52d154,null));};exports[_0xbf0d('0x16')]=function(_0x32c625,_0x898b75){return respondWithRpcPromise(_0xbf0d('0x17'),_[_0xbf0d('0x18')](_0x32c625['query'],_0x32c625['params']))[_0xbf0d('0x9')](respondWithResult(_0x898b75,null))[_0xbf0d('0xd')](handleError(_0x898b75,null));};exports[_0xbf0d('0x19')]=function(_0x26d604,_0x586f2c){return respondWithRpcPromise(_0xbf0d('0x1a'),_[_0xbf0d('0x18')](_0x26d604[_0xbf0d('0x1b')],_0x26d604[_0xbf0d('0x1c')]))[_0xbf0d('0x9')](respondWithResult(_0x586f2c,null))[_0xbf0d('0xd')](handleError(_0x586f2c,null));};exports[_0xbf0d('0x1d')]=function(_0x39e7c0,_0x184868){return respondWithRpcPromise(_0xbf0d('0x1e'),_0x39e7c0[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0x184868,null))['catch'](handleError(_0x184868,null));};exports[_0xbf0d('0x1f')]=function(_0x309eee,_0xad8fd3){return respondWithRpcPromise('VoiceQueues',_0x309eee[_0xbf0d('0x1b')])[_0xbf0d('0x9')](findById(_0x309eee['params']['id']))[_0xbf0d('0x9')](respondWithResult(_0xad8fd3,null))[_0xbf0d('0xd')](handleError(_0xad8fd3,null));};exports['voiceQueuesPreview']=function(_0x116e64,_0x4b12b5){return respondWithRpcPromise(_0xbf0d('0x20'),_['merge'](_0x116e64[_0xbf0d('0x1b')],_0x116e64[_0xbf0d('0x1c')]))['then'](respondWithResult(_0x4b12b5,null))[_0xbf0d('0xd')](handleError(_0x4b12b5,null));};exports[_0xbf0d('0x21')]=function(_0x2ae600,_0x365547){return respondWithRpcPromise('VoiceQueuesChannels',_0x2ae600[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0x365547,null))[_0xbf0d('0xd')](handleError(_0x365547,null));};exports[_0xbf0d('0x22')]=function(_0x429213,_0x4fe150){return respondWithRpcPromise(_0xbf0d('0x23'),_[_0xbf0d('0x18')](_0x429213[_0xbf0d('0x1b')],_0x429213[_0xbf0d('0x1c')]))['then'](respondWithResult(_0x4fe150,null))[_0xbf0d('0xd')](handleError(_0x4fe150,null));};exports[_0xbf0d('0x24')]=function(_0x5e1d30,_0x261ae4){return respondWithRpcPromise(_0xbf0d('0x25'),_['merge'](_0x5e1d30[_0xbf0d('0x1b')],_0x5e1d30[_0xbf0d('0x1c')]))[_0xbf0d('0x9')](respondWithResult(_0x261ae4,null))[_0xbf0d('0xd')](handleError(_0x261ae4,null));};exports[_0xbf0d('0x26')]=function(_0x5e8d09,_0x225fce){return respondWithRpcPromise(_0xbf0d('0x27'),_[_0xbf0d('0x18')](_0x5e8d09['query'],_0x5e8d09['params']))[_0xbf0d('0x9')](respondWithResult(_0x225fce,null))[_0xbf0d('0xd')](handleError(_0x225fce,null));};exports[_0xbf0d('0x28')]=function(_0x96a4ac,_0x3ed097){return respondWithRpcPromise('Outbound',_0x96a4ac['query'])[_0xbf0d('0x9')](respondWithResult(_0x3ed097,null))[_0xbf0d('0xd')](handleError(_0x3ed097,null));};exports[_0xbf0d('0x29')]=function(_0xb635f5,_0xc267e9){return respondWithRpcPromise(_0xbf0d('0x2a'),_0xb635f5[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0xc267e9,null))['catch'](handleError(_0xc267e9,null));};exports[_0xbf0d('0x2b')]=function(_0x399fc0,_0x12c4a2){var _0x50ceae;return respondWithRpcPromise(_0xbf0d('0x2c'),_0x399fc0['query'])['then'](function(_0x2cfa24){_0x50ceae=_0x2cfa24;return respondWithRpcPromise(_0xbf0d('0x2c'),_0x399fc0[_0xbf0d('0x1b')],routingClient);})[_0xbf0d('0x9')](function(_0x2b1e88){return _['merge']({},_0x2b1e88,_0x50ceae);})['then'](respondWithResult(_0x12c4a2,null))['catch'](handleError(_0x12c4a2,null));};exports[_0xbf0d('0x2d')]=function(_0x173a59,_0x862d84){if(_0x173a59[_0xbf0d('0x2e')]&&_0x173a59[_0xbf0d('0x2e')][_0xbf0d('0x2f')]&&_0x173a59[_0xbf0d('0x30')]&&_0x173a59[_0xbf0d('0x30')][_0xbf0d('0x11')]){for(var _0x383680 in _0x173a59[_0xbf0d('0x2e')]['interaction']){if(_0x173a59[_0xbf0d('0x2e')]['interaction'][_0xbf0d('0x31')](_0x383680)){db[_0xbf0d('0x32')]['findAll']({'where':{'channel':_0x383680,'membername':_0x173a59[_0xbf0d('0x30')]['name'],'type':_0xbf0d('0x33'),'exitAt':null,'uniqueid':_0x173a59['body'][_0xbf0d('0x2f')][_0x383680]&&_0x173a59['body'][_0xbf0d('0x2f')][_0x383680][_0xbf0d('0x34')]?{'$notIn':_0x173a59['body'][_0xbf0d('0x2f')][_0x383680]}:{'$ne':null}}})['then'](function(_0x6d8a60){var _0x102197=moment()[_0xbf0d('0x35')](_0xbf0d('0x36'));for(var _0x3c996b=0x0,_0x2d6c8d=_0x6d8a60[_0xbf0d('0x34')];_0x3c996b<_0x2d6c8d;_0x3c996b+=0x1){_0x6d8a60[_0x3c996b][_0xbf0d('0x37')]({'exitAt':_0x102197});}});for(var _0x5ec2c2=0x0;_0x5ec2c2<_0x173a59[_0xbf0d('0x2e')][_0xbf0d('0x2f')][_0x383680][_0xbf0d('0x34')];_0x5ec2c2+=0x1){db[_0xbf0d('0x32')][_0xbf0d('0x38')]({'where':{'channel':_0x383680,'membername':_0x173a59[_0xbf0d('0x30')][_0xbf0d('0x11')],'type':_0xbf0d('0x33'),'uniqueid':_0x173a59[_0xbf0d('0x2e')][_0xbf0d('0x2f')][_0x383680][_0x5ec2c2],'exitAt':null},'defaults':{'channel':_0x383680,'membername':_0x173a59['user'][_0xbf0d('0x11')],'interface':_[_0xbf0d('0x13')](_0x173a59['user']['interface'])?util['format'](_0xbf0d('0x39'),_0x173a59[_0xbf0d('0x30')][_0xbf0d('0x11')]):_0x173a59[_0xbf0d('0x30')][_0xbf0d('0x3a')],'type':'INTERACTION','enterAt':moment()[_0xbf0d('0x35')](_0xbf0d('0x36')),'role':'agent','internal':_0x173a59['user'][_0xbf0d('0x3b')],'uniqueid':_0x173a59[_0xbf0d('0x2e')]['interaction'][_0x383680][_0x5ec2c2]}});}}}}return respondWithRpcPromise(_0xbf0d('0x3c'),{'id':_0x173a59[_0xbf0d('0x1c')]['id'],'capacity':_0x173a59[_0xbf0d('0x2e')][_0xbf0d('0x3d')]},routingClient)[_0xbf0d('0x9')](respondWithResult(_0x862d84,null))[_0xbf0d('0xd')](handleError(_0x862d84,null));};exports[_0xbf0d('0x3e')]=function(_0x528304,_0x5a8e8c){return respondWithRpcPromise(_0xbf0d('0x3f'),_0x528304[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0x5a8e8c,null))['catch'](handleError(_0x5a8e8c,null));};exports[_0xbf0d('0x40')]=function(_0x34f7e1,_0x27232b){return respondWithRpcPromise(_0xbf0d('0x41'),_0x34f7e1[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0x27232b,null))[_0xbf0d('0xd')](handleError(_0x27232b,null));};exports['campaigns']=function(_0x113233,_0x1a253e){return respondWithRpcPromise(_0xbf0d('0x42'),_0x113233[_0xbf0d('0x1b')])[_0xbf0d('0x9')](respondWithResult(_0x1a253e,null))[_0xbf0d('0xd')](handleError(_0x1a253e,null));};exports[_0xbf0d('0x43')]=function(_0x4e2b38,_0xd46d91){return respondWithRpcPromise(_0xbf0d('0x44'),_0x4e2b38[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0xd46d91,null))[_0xbf0d('0xd')](handleError(_0xd46d91,null));};exports['showChatQueues']=function(_0x3218fe,_0xdc7fab){return respondWithRpcPromise(_0xbf0d('0x44'),_0x3218fe[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](findById(_0x3218fe[_0xbf0d('0x1c')]['id']))['then'](respondWithResult(_0xdc7fab,null))['catch'](handleError(_0xdc7fab,null));};exports[_0xbf0d('0x45')]=function(_0xd95760,_0x40c3e3){return respondWithRpcPromise(_0xbf0d('0x46'),_0xd95760[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x40c3e3,null))[_0xbf0d('0xd')](handleError(_0x40c3e3,null));};exports[_0xbf0d('0x47')]=function(_0x81cf29,_0x3e9c7d){return respondWithRpcPromise(_0xbf0d('0x46'),_0x81cf29[_0xbf0d('0x1b')],routingClient)['then'](findById(_0x81cf29[_0xbf0d('0x1c')]['id']))[_0xbf0d('0x9')](respondWithResult(_0x3e9c7d,null))[_0xbf0d('0xd')](handleError(_0x3e9c7d,null));};exports[_0xbf0d('0x48')]=function(_0x4d6c2e,_0x47b556){return respondWithRpcPromise(_0xbf0d('0x49'),_0x4d6c2e['query'],mailClient)['then'](respondWithResult(_0x47b556,null))[_0xbf0d('0xd')](handleError(_0x47b556,null));};exports['openchannelQueues']=function(_0x41b161,_0x40e068){return respondWithRpcPromise(_0xbf0d('0x4a'),_0x41b161['query'],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x40e068,null))['catch'](handleError(_0x40e068,null));};exports[_0xbf0d('0x4b')]=function(_0x23c6d6,_0x4feb20){return respondWithRpcPromise(_0xbf0d('0x4a'),_0x23c6d6[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](findById(_0x23c6d6['params']['id']))[_0xbf0d('0x9')](respondWithResult(_0x4feb20,null))[_0xbf0d('0xd')](handleError(_0x4feb20,null));};exports['smsQueues']=function(_0x3365ba,_0x451235){return respondWithRpcPromise('SmsQueues',_0x3365ba[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x451235,null))[_0xbf0d('0xd')](handleError(_0x451235,null));};exports['showSmsQueues']=function(_0x290b61,_0x181f1e){return respondWithRpcPromise(_0xbf0d('0x4c'),_0x290b61[_0xbf0d('0x1b')],routingClient)['then'](findById(_0x290b61['params']['id']))[_0xbf0d('0x9')](respondWithResult(_0x181f1e,null))['catch'](handleError(_0x181f1e,null));};exports['whatsappQueues']=function(_0x42ca12,_0x1e5768){return respondWithRpcPromise(_0xbf0d('0x4d'),_0x42ca12[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x1e5768,null))['catch'](handleError(_0x1e5768,null));};exports[_0xbf0d('0x4e')]=function(_0xbc29bd,_0x5eea4b){return respondWithRpcPromise(_0xbf0d('0x4d'),_0xbc29bd['query'],routingClient)[_0xbf0d('0x9')](findById(_0xbc29bd['params']['id']))[_0xbf0d('0x9')](respondWithResult(_0x5eea4b,null))['catch'](handleError(_0x5eea4b,null));};exports['faxQueues']=function(_0x535134,_0x24e906){return respondWithRpcPromise(_0xbf0d('0x4f'),_0x535134['query'],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x24e906,null))[_0xbf0d('0xd')](handleError(_0x24e906,null));};exports[_0xbf0d('0x50')]=function(_0x1a0258,_0x1a4335){return respondWithRpcPromise(_0xbf0d('0x4f'),_0x1a0258[_0xbf0d('0x1b')],routingClient)['then'](findById(_0x1a0258[_0xbf0d('0x1c')]['id']))[_0xbf0d('0x9')](respondWithResult(_0x1a4335,null))['catch'](handleError(_0x1a4335,null));};exports['faxAccounts']=function(_0x406f46,_0x569301){return respondWithRpcPromise(_0xbf0d('0x51'),_0x406f46['query'])[_0xbf0d('0x9')](respondWithResult(_0x569301,null))[_0xbf0d('0xd')](handleError(_0x569301,null));};exports['chatQueuesWaitingInteractions']=function(_0x15122e,_0x1b012b){return respondWithRpcPromise(_0xbf0d('0x52'),_0x15122e[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x1b012b,null))[_0xbf0d('0xd')](handleError(_0x1b012b,null));};exports[_0xbf0d('0x53')]=function(_0x1047fd,_0x33aa0a){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1047fd[_0xbf0d('0x1b')],routingClient)['then'](respondWithResult(_0x33aa0a,null))[_0xbf0d('0xd')](handleError(_0x33aa0a,null));};exports[_0xbf0d('0x54')]=function(_0x14ff50,_0x45ba40){return respondWithRpcPromise(_0xbf0d('0x55'),_0x14ff50[_0xbf0d('0x1b')],routingClient)['then'](respondWithResult(_0x45ba40,null))[_0xbf0d('0xd')](handleError(_0x45ba40,null));};exports['smsQueuesWaitingInteractions']=function(_0xd8e48f,_0x3c04b0){return respondWithRpcPromise(_0xbf0d('0x56'),_0xd8e48f[_0xbf0d('0x1b')],routingClient)['then'](respondWithResult(_0x3c04b0,null))[_0xbf0d('0xd')](handleError(_0x3c04b0,null));};exports[_0xbf0d('0x57')]=function(_0x1324cf,_0x1c1240){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x1324cf[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x1c1240,null))[_0xbf0d('0xd')](handleError(_0x1c1240,null));};exports['faxQueuesWaitingInteractions']=function(_0x23acbf,_0x491e3a){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x23acbf[_0xbf0d('0x1b')],routingClient)[_0xbf0d('0x9')](respondWithResult(_0x491e3a,null))[_0xbf0d('0xd')](handleError(_0x491e3a,null));};exports[_0xbf0d('0x58')]=function(_0x41e70c){return function(_0x7b98ce,_0x4235b4){var _0x239425,_0xf421ba;var _0x3d93f8=_['capitalize'](_0x41e70c);var _0x4d6938=_0x41e70c===_0xbf0d('0x59')?_0xbf0d('0x5a'):_0xbf0d('0x5b');return db[_0x3d93f8+_0xbf0d('0x5c')][_0xbf0d('0x5d')]({'raw':!![],'where':{'id':_0x7b98ce[_0xbf0d('0x1c')]['id']}})[_0xbf0d('0x9')](function(_0x4da820){if(_[_0xbf0d('0x13')](_0x4da820)){throw new Error(_0x3d93f8+_0xbf0d('0x5e'));}_0x239425=_0x4da820;return db[_0x3d93f8+'Message'][_0xbf0d('0x5d')]({'where':{'id':_0x7b98ce['body']['messageId']},'include':[{'model':db[_0x3d93f8+'Interaction'],'as':_0xbf0d('0x5f')},{'model':db[_0x3d93f8+_0x4d6938],'as':_0xbf0d('0x5b')}]});})[_0xbf0d('0x9')](function(_0xef944f){if(_['isNil'](_0xef944f)){throw new Error(_0x3d93f8+'\x20Message\x20not\x20found');}_0xf421ba=_0xef944f;return _0xef944f[_0xbf0d('0x60')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbf0d('0x9')](function(){var _0x35b2fb={'uniqueid':_0x41e70c+'.'+_0xf421ba['id']+'.'+_0xf421ba['Interaction']['id'],'FromUserId':_0x7b98ce[_0xbf0d('0x30')]['id'],'type':_0xbf0d('0x61')};_0x35b2fb[_0x3d93f8+_0xbf0d('0x62')]=_0xf421ba['id'];_0x35b2fb[_0x3d93f8+_0xbf0d('0x63')]=_0xf421ba['Interaction']['id'];_0x35b2fb[_0xbf0d('0x64')+_0x3d93f8+_0x4d6938+'Id']=_0xf421ba[_0xbf0d('0x5b')]['id'];_0x35b2fb['To'+_0x3d93f8+'QueueId']=_0x239425['id'];return db[_0x3d93f8+'TransferReport'][_0xbf0d('0x65')](_0x35b2fb);})[_0xbf0d('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x41e70c,'interaction':_0xf421ba['Interaction'],'message':_0xf421ba,'account':_0xf421ba[_0xbf0d('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbf0d('0x61'),'appdata':_0x239425[_0xbf0d('0x11')]+','+(_0xf421ba[_0xbf0d('0x5b')][_0xbf0d('0x66')]||0x12c),'interval':_0xbf0d('0x67')}]},routingClient);})[_0xbf0d('0x9')](respondWithResult(_0x4235b4,null))[_0xbf0d('0xd')](handleError(_0x4235b4,null));};};exports[_0xbf0d('0x68')]=function(_0x4c212e,_0x309edd){var _0x5bc3bb,_0x1ea941;if(_[_0xbf0d('0x13')](_0x4c212e['body'][_0xbf0d('0x69')])){throw new Error(_0xbf0d('0x6a'));}var _0x3cedde=_0x4c212e[_0xbf0d('0x2e')]['channel'];var _0x40ac1b=_[_0xbf0d('0x6b')](_0x3cedde);var _0x188a30=_0x3cedde===_0xbf0d('0x59')?_0xbf0d('0x5a'):_0xbf0d('0x5b');return db[_0xbf0d('0x6c')][_0xbf0d('0x5d')]({'raw':!![],'where':{'id':_0x4c212e[_0xbf0d('0x1c')]['id'],'role':'agent'}})[_0xbf0d('0x9')](function(_0x5427b9){if(_['isNil'](_0x5427b9)){throw new Error(_0xbf0d('0x6d'));}_0x5bc3bb=_0x5427b9;return db[_0x40ac1b+_0xbf0d('0x6e')][_0xbf0d('0x5d')]({'where':{'id':_0x4c212e[_0xbf0d('0x2e')][_0xbf0d('0x6f')]},'include':[{'model':db[_0x40ac1b+_0xbf0d('0x5f')],'as':_0xbf0d('0x5f')},{'model':db[_0x40ac1b+_0x188a30],'as':_0xbf0d('0x5b')}]});})[_0xbf0d('0x9')](function(_0x39bd15){if(_['isNil'](_0x39bd15)){throw new Error(_0x40ac1b+_0xbf0d('0x70'));}_0x1ea941=_0x39bd15;return _0x39bd15[_0xbf0d('0x60')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbf0d('0x9')](function(){var _0xe57d06={'uniqueid':_0x3cedde+'.'+_0x1ea941['id']+'.'+_0x1ea941[_0xbf0d('0x5f')]['id'],'FromUserId':_0x4c212e[_0xbf0d('0x30')]['id'],'type':'queue','ToUserId':_0x5bc3bb['id']};_0xe57d06[_0x40ac1b+_0xbf0d('0x62')]=_0x1ea941['id'];_0xe57d06[_0x40ac1b+'InteractionId']=_0x1ea941[_0xbf0d('0x5f')]['id'];_0xe57d06['From'+_0x40ac1b+_0x188a30+'Id']=_0x1ea941['Account']['id'];return db[_0x40ac1b+_0xbf0d('0x71')]['create'](_0xe57d06);})['then'](function(){return respondWithRpcPromise(_0xbf0d('0x72'),{'channel':_0x3cedde,'interaction':_0x1ea941[_0xbf0d('0x5f')],'message':_0x1ea941,'account':_0x1ea941[_0xbf0d('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbf0d('0x73'),'appdata':_0x5bc3bb[_0xbf0d('0x11')]+','+(_0x1ea941['Account'][_0xbf0d('0x74')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbf0d('0x9')](respondWithResult(_0x309edd,null))[_0xbf0d('0xd')](handleError(_0x309edd,null));}; \ No newline at end of file +var _0x6453=['outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','chat','Website','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','capitalize','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','send','isNil','find','rows','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','query','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6453,0x1c0));var _0x3645=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x6453[_0x261522];return _0x98a25a;};'use strict';var BPromise=require(_0x3645('0x0'));var moment=require(_0x3645('0x1'));var _=require(_0x3645('0x2'));var util=require(_0x3645('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x3645('0x4'))('api');var jayson=require(_0x3645('0x5'));var amiClient=jayson[_0x3645('0x6')][_0x3645('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x3645('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x3645('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x4e4ed6,_0x34c468,_0x2d2fbf){return new BPromise(function(_0x4342ea,_0x1f2ee3){var _0x59828d=_0x2d2fbf?_0x2d2fbf:amiClient;return _0x59828d[_0x3645('0x8')](_0x4e4ed6,_0x34c468)[_0x3645('0x9')](function(_0x19d681){if(_0x19d681[_0x3645('0xa')]){if(_0x19d681[_0x3645('0xa')][_0x3645('0xb')]===0x1f4){return _0x1f2ee3(_0x19d681['error'][_0x3645('0xc')]);}return _0x4342ea(_0x19d681[_0x3645('0xa')]['message']);}else{_0x4342ea(_0x19d681['result']);}})[_0x3645('0xd')](function(_0x1c1811){_0x1f2ee3(_0x1c1811);});});}function respondWithResult(_0x4a69dc,_0x138b93){_0x138b93=_0x138b93||0xc8;return function(_0x5d2735){if(_0x5d2735){return _0x4a69dc[_0x3645('0xe')](_0x138b93)[_0x3645('0xf')](_0x5d2735);}return _0x4a69dc[_0x3645('0x10')](0x194);};}function handleError(_0x529b8f,_0xd5d8b4){_0xd5d8b4=_0xd5d8b4||0x1f4;return function(_0xccefd5){logger[_0x3645('0xa')](_0xccefd5[_0x3645('0x11')]);if(_0xccefd5['name']){delete _0xccefd5['name'];}_0x529b8f[_0x3645('0xe')](_0xd5d8b4)[_0x3645('0x12')](_0xccefd5);};}function findById(_0x4cc6d6){return function(_0x25b4e0){if(!_[_0x3645('0x13')](_0x4cc6d6)&&!_[_0x3645('0x13')](_0x25b4e0)&&!_[_0x3645('0x13')](_0x25b4e0['rows'])){return _[_0x3645('0x14')](_0x25b4e0[_0x3645('0x15')],function(_0x2351fa){return _0x2351fa['id']==_0x4cc6d6;});}return null;};}exports['voiceChannels']=function(_0x525642,_0x1cfc03){return respondWithRpcPromise('VoiceChannels',_0x525642['query'])[_0x3645('0x9')](respondWithResult(_0x1cfc03,null))[_0x3645('0xd')](handleError(_0x1cfc03,null));};exports[_0x3645('0x16')]=function(_0x29cfde,_0x539c59){return respondWithRpcPromise(_0x3645('0x17'),_[_0x3645('0x18')](_0x29cfde['query'],_0x29cfde[_0x3645('0x19')]))[_0x3645('0x9')](respondWithResult(_0x539c59,null))['catch'](handleError(_0x539c59,null));};exports[_0x3645('0x1a')]=function(_0x3200de,_0x394a42){return respondWithRpcPromise(_0x3645('0x1b'),_[_0x3645('0x18')](_0x3200de['query'],_0x3200de[_0x3645('0x19')]))[_0x3645('0x9')](respondWithResult(_0x394a42,null))[_0x3645('0xd')](handleError(_0x394a42,null));};exports[_0x3645('0x1c')]=function(_0x11fb50,_0x35ea8e){return respondWithRpcPromise(_0x3645('0x1d'),_0x11fb50[_0x3645('0x1e')])[_0x3645('0x9')](respondWithResult(_0x35ea8e,null))[_0x3645('0xd')](handleError(_0x35ea8e,null));};exports[_0x3645('0x1f')]=function(_0x16ec45,_0x4686dd){return respondWithRpcPromise(_0x3645('0x1d'),_0x16ec45[_0x3645('0x1e')])['then'](findById(_0x16ec45[_0x3645('0x19')]['id']))[_0x3645('0x9')](respondWithResult(_0x4686dd,null))[_0x3645('0xd')](handleError(_0x4686dd,null));};exports[_0x3645('0x20')]=function(_0x98f9ee,_0x2bdeaa){return respondWithRpcPromise(_0x3645('0x21'),_[_0x3645('0x18')](_0x98f9ee['query'],_0x98f9ee[_0x3645('0x19')]))[_0x3645('0x9')](respondWithResult(_0x2bdeaa,null))[_0x3645('0xd')](handleError(_0x2bdeaa,null));};exports['voiceQueuesChannels']=function(_0x127462,_0x29adc1){return respondWithRpcPromise(_0x3645('0x22'),_0x127462[_0x3645('0x1e')])[_0x3645('0x9')](respondWithResult(_0x29adc1,null))['catch'](handleError(_0x29adc1,null));};exports[_0x3645('0x23')]=function(_0x480ca7,_0x4beebd){return respondWithRpcPromise(_0x3645('0x24'),_[_0x3645('0x18')](_0x480ca7[_0x3645('0x1e')],_0x480ca7['params']))['then'](respondWithResult(_0x4beebd,null))[_0x3645('0xd')](handleError(_0x4beebd,null));};exports[_0x3645('0x25')]=function(_0x38a3e6,_0x580d74){return respondWithRpcPromise(_0x3645('0x26'),_[_0x3645('0x18')](_0x38a3e6[_0x3645('0x1e')],_0x38a3e6[_0x3645('0x19')]))[_0x3645('0x9')](respondWithResult(_0x580d74,null))[_0x3645('0xd')](handleError(_0x580d74,null));};exports[_0x3645('0x27')]=function(_0xb721e5,_0x10403b){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0xb721e5[_0x3645('0x1e')],_0xb721e5[_0x3645('0x19')]))[_0x3645('0x9')](respondWithResult(_0x10403b,null))[_0x3645('0xd')](handleError(_0x10403b,null));};exports[_0x3645('0x28')]=function(_0x54c2ed,_0x521300){return respondWithRpcPromise(_0x3645('0x29'),_0x54c2ed[_0x3645('0x1e')])['then'](respondWithResult(_0x521300,null))['catch'](handleError(_0x521300,null));};exports[_0x3645('0x2a')]=function(_0x33a581,_0x124889){return respondWithRpcPromise(_0x3645('0x2b'),_0x33a581[_0x3645('0x1e')])[_0x3645('0x9')](respondWithResult(_0x124889,null))[_0x3645('0xd')](handleError(_0x124889,null));};exports[_0x3645('0x2c')]=function(_0x56b6c0,_0x7c382e){var _0x11c9f9;return respondWithRpcPromise(_0x3645('0x2d'),_0x56b6c0[_0x3645('0x1e')])[_0x3645('0x9')](function(_0x49a9e3){_0x11c9f9=_0x49a9e3;return respondWithRpcPromise(_0x3645('0x2d'),_0x56b6c0[_0x3645('0x1e')],routingClient);})[_0x3645('0x9')](function(_0x1be51d){return _[_0x3645('0x18')]({},_0x1be51d,_0x11c9f9);})[_0x3645('0x9')](respondWithResult(_0x7c382e,null))['catch'](handleError(_0x7c382e,null));};exports[_0x3645('0x2e')]=function(_0x546dda,_0x94ae4e){if(_0x546dda['body']&&_0x546dda[_0x3645('0x2f')][_0x3645('0x30')]&&_0x546dda[_0x3645('0x31')]&&_0x546dda[_0x3645('0x31')][_0x3645('0x32')]){for(var _0x34a6de in _0x546dda[_0x3645('0x2f')][_0x3645('0x30')]){if(_0x546dda[_0x3645('0x2f')][_0x3645('0x30')]['hasOwnProperty'](_0x34a6de)){db[_0x3645('0x33')][_0x3645('0x34')]({'where':{'channel':_0x34a6de,'membername':_0x546dda[_0x3645('0x31')][_0x3645('0x32')],'type':_0x3645('0x35'),'exitAt':null,'uniqueid':_0x546dda['body'][_0x3645('0x30')][_0x34a6de]&&_0x546dda[_0x3645('0x2f')][_0x3645('0x30')][_0x34a6de][_0x3645('0x36')]?{'$notIn':_0x546dda[_0x3645('0x2f')][_0x3645('0x30')][_0x34a6de]}:{'$ne':null}}})[_0x3645('0x9')](function(_0x4ef382){var _0x1a2b79=moment()[_0x3645('0x37')](_0x3645('0x38'));for(var _0x1fa29d=0x0,_0x255691=_0x4ef382[_0x3645('0x36')];_0x1fa29d<_0x255691;_0x1fa29d+=0x1){_0x4ef382[_0x1fa29d][_0x3645('0x39')]({'exitAt':_0x1a2b79});}});for(var _0x1349ad=0x0;_0x1349ad<_0x546dda[_0x3645('0x2f')][_0x3645('0x30')][_0x34a6de][_0x3645('0x36')];_0x1349ad+=0x1){db['MemberReport'][_0x3645('0x3a')]({'where':{'channel':_0x34a6de,'membername':_0x546dda[_0x3645('0x31')][_0x3645('0x32')],'type':'INTERACTION','uniqueid':_0x546dda[_0x3645('0x2f')][_0x3645('0x30')][_0x34a6de][_0x1349ad],'exitAt':null},'defaults':{'channel':_0x34a6de,'membername':_0x546dda['user'][_0x3645('0x32')],'interface':_[_0x3645('0x13')](_0x546dda[_0x3645('0x31')][_0x3645('0x3b')])?util[_0x3645('0x37')](_0x3645('0x3c'),_0x546dda['user'][_0x3645('0x32')]):_0x546dda[_0x3645('0x31')]['interface'],'type':_0x3645('0x35'),'enterAt':moment()[_0x3645('0x37')](_0x3645('0x38')),'role':'agent','internal':_0x546dda[_0x3645('0x31')][_0x3645('0x3d')],'uniqueid':_0x546dda['body']['interaction'][_0x34a6de][_0x1349ad]}});}}}}return respondWithRpcPromise(_0x3645('0x3e'),{'id':_0x546dda[_0x3645('0x19')]['id'],'capacity':_0x546dda['body'][_0x3645('0x3f')]},routingClient)[_0x3645('0x9')](respondWithResult(_0x94ae4e,null))['catch'](handleError(_0x94ae4e,null));};exports[_0x3645('0x40')]=function(_0x516947,_0x459b46){return respondWithRpcPromise('Telephones',_0x516947[_0x3645('0x1e')])[_0x3645('0x9')](respondWithResult(_0x459b46,null))[_0x3645('0xd')](handleError(_0x459b46,null));};exports[_0x3645('0x41')]=function(_0x2b6252,_0x90261b){return respondWithRpcPromise(_0x3645('0x42'),_0x2b6252['query'])['then'](respondWithResult(_0x90261b,null))['catch'](handleError(_0x90261b,null));};exports[_0x3645('0x43')]=function(_0x363c65,_0x4f8824){return respondWithRpcPromise(_0x3645('0x44'),_0x363c65[_0x3645('0x1e')])['then'](respondWithResult(_0x4f8824,null))[_0x3645('0xd')](handleError(_0x4f8824,null));};exports[_0x3645('0x45')]=function(_0x59398a,_0x2cbdea){return respondWithRpcPromise(_0x3645('0x46'),_0x59398a[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](respondWithResult(_0x2cbdea,null))['catch'](handleError(_0x2cbdea,null));};exports[_0x3645('0x47')]=function(_0x4f695f,_0x2aecd1){return respondWithRpcPromise(_0x3645('0x46'),_0x4f695f[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](findById(_0x4f695f[_0x3645('0x19')]['id']))['then'](respondWithResult(_0x2aecd1,null))[_0x3645('0xd')](handleError(_0x2aecd1,null));};exports[_0x3645('0x48')]=function(_0x5439e6,_0x5348bf){return respondWithRpcPromise(_0x3645('0x49'),_0x5439e6['query'],routingClient)[_0x3645('0x9')](respondWithResult(_0x5348bf,null))[_0x3645('0xd')](handleError(_0x5348bf,null));};exports['showMailQueues']=function(_0x4cee0b,_0x44867b){return respondWithRpcPromise(_0x3645('0x49'),_0x4cee0b[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](findById(_0x4cee0b[_0x3645('0x19')]['id']))[_0x3645('0x9')](respondWithResult(_0x44867b,null))[_0x3645('0xd')](handleError(_0x44867b,null));};exports[_0x3645('0x4a')]=function(_0x3211a2,_0x27c115){return respondWithRpcPromise('MailAccounts',_0x3211a2[_0x3645('0x1e')],mailClient)[_0x3645('0x9')](respondWithResult(_0x27c115,null))['catch'](handleError(_0x27c115,null));};exports[_0x3645('0x4b')]=function(_0x15a178,_0x48d1a1){return respondWithRpcPromise('OpenchannelQueues',_0x15a178[_0x3645('0x1e')],routingClient)['then'](respondWithResult(_0x48d1a1,null))[_0x3645('0xd')](handleError(_0x48d1a1,null));};exports[_0x3645('0x4c')]=function(_0x340c52,_0x1db856){return respondWithRpcPromise(_0x3645('0x4d'),_0x340c52[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](findById(_0x340c52[_0x3645('0x19')]['id']))['then'](respondWithResult(_0x1db856,null))['catch'](handleError(_0x1db856,null));};exports[_0x3645('0x4e')]=function(_0x503e41,_0x3c7180){return respondWithRpcPromise(_0x3645('0x4f'),_0x503e41['query'],routingClient)['then'](respondWithResult(_0x3c7180,null))[_0x3645('0xd')](handleError(_0x3c7180,null));};exports[_0x3645('0x50')]=function(_0x111331,_0xb5885c){return respondWithRpcPromise('SmsQueues',_0x111331['query'],routingClient)['then'](findById(_0x111331[_0x3645('0x19')]['id']))['then'](respondWithResult(_0xb5885c,null))['catch'](handleError(_0xb5885c,null));};exports[_0x3645('0x51')]=function(_0xeabc65,_0x2b9a4e){return respondWithRpcPromise(_0x3645('0x52'),_0xeabc65[_0x3645('0x1e')],routingClient)['then'](respondWithResult(_0x2b9a4e,null))[_0x3645('0xd')](handleError(_0x2b9a4e,null));};exports[_0x3645('0x53')]=function(_0x1c6fb3,_0x1db4ad){return respondWithRpcPromise(_0x3645('0x52'),_0x1c6fb3[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](findById(_0x1c6fb3[_0x3645('0x19')]['id']))['then'](respondWithResult(_0x1db4ad,null))[_0x3645('0xd')](handleError(_0x1db4ad,null));};exports[_0x3645('0x54')]=function(_0x420c47,_0x45b505){return respondWithRpcPromise(_0x3645('0x55'),_0x420c47[_0x3645('0x1e')],routingClient)['then'](respondWithResult(_0x45b505,null))['catch'](handleError(_0x45b505,null));};exports[_0x3645('0x56')]=function(_0x4d7603,_0x30804c){return respondWithRpcPromise('FaxQueues',_0x4d7603['query'],routingClient)[_0x3645('0x9')](findById(_0x4d7603[_0x3645('0x19')]['id']))[_0x3645('0x9')](respondWithResult(_0x30804c,null))['catch'](handleError(_0x30804c,null));};exports[_0x3645('0x57')]=function(_0x57f5ee,_0xf63124){return respondWithRpcPromise(_0x3645('0x58'),_0x57f5ee[_0x3645('0x1e')])['then'](respondWithResult(_0xf63124,null))[_0x3645('0xd')](handleError(_0xf63124,null));};exports['chatQueuesWaitingInteractions']=function(_0x42740d,_0x19e9e3){return respondWithRpcPromise(_0x3645('0x59'),_0x42740d[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](respondWithResult(_0x19e9e3,null))['catch'](handleError(_0x19e9e3,null));};exports[_0x3645('0x5a')]=function(_0x46b4c6,_0x1b61eb){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x46b4c6['query'],routingClient)[_0x3645('0x9')](respondWithResult(_0x1b61eb,null))['catch'](handleError(_0x1b61eb,null));};exports[_0x3645('0x5b')]=function(_0x5dabb3,_0x734d14){return respondWithRpcPromise(_0x3645('0x5c'),_0x5dabb3['query'],routingClient)['then'](respondWithResult(_0x734d14,null))[_0x3645('0xd')](handleError(_0x734d14,null));};exports[_0x3645('0x5d')]=function(_0x18861d,_0x23745d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x18861d['query'],routingClient)[_0x3645('0x9')](respondWithResult(_0x23745d,null))['catch'](handleError(_0x23745d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x28448d,_0x26ea7a){return respondWithRpcPromise(_0x3645('0x5e'),_0x28448d[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](respondWithResult(_0x26ea7a,null))[_0x3645('0xd')](handleError(_0x26ea7a,null));};exports['faxQueuesWaitingInteractions']=function(_0x25bdc7,_0x279fe4){return respondWithRpcPromise(_0x3645('0x5f'),_0x25bdc7[_0x3645('0x1e')],routingClient)[_0x3645('0x9')](respondWithResult(_0x279fe4,null))['catch'](handleError(_0x279fe4,null));};exports['queueNotify']=function(_0x2be71c){return function(_0x576ce8,_0xa6852){var _0x4730c5,_0xd67501;var _0x295c55=_['capitalize'](_0x2be71c);var _0x234e06=_0x2be71c===_0x3645('0x60')?_0x3645('0x61'):'Account';return db[_0x295c55+_0x3645('0x62')]['findOne']({'raw':!![],'where':{'id':_0x576ce8[_0x3645('0x19')]['id']}})[_0x3645('0x9')](function(_0x360623){if(_[_0x3645('0x13')](_0x360623)){throw new Error(_0x295c55+'\x20Queue\x20not\x20found');}_0x4730c5=_0x360623;return db[_0x295c55+'Message'][_0x3645('0x63')]({'where':{'id':_0x576ce8[_0x3645('0x2f')][_0x3645('0x64')]},'include':[{'model':db[_0x295c55+'Interaction'],'as':_0x3645('0x65')},{'model':db[_0x295c55+_0x234e06],'as':'Account'}]});})[_0x3645('0x9')](function(_0x58e563){if(_[_0x3645('0x13')](_0x58e563)){throw new Error(_0x295c55+_0x3645('0x66'));}_0xd67501=_0x58e563;return _0x58e563[_0x3645('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x3645('0x9')](function(){var _0x9da8e1={'uniqueid':_0x2be71c+'.'+_0xd67501['id']+'.'+_0xd67501[_0x3645('0x65')]['id'],'FromUserId':_0x576ce8[_0x3645('0x31')]['id'],'type':_0x3645('0x68')};_0x9da8e1[_0x295c55+_0x3645('0x69')]=_0xd67501['id'];_0x9da8e1[_0x295c55+_0x3645('0x6a')]=_0xd67501[_0x3645('0x65')]['id'];_0x9da8e1[_0x3645('0x6b')+_0x295c55+_0x234e06+'Id']=_0xd67501[_0x3645('0x6c')]['id'];_0x9da8e1['To'+_0x295c55+_0x3645('0x6d')]=_0x4730c5['id'];return db[_0x295c55+_0x3645('0x6e')][_0x3645('0x6f')](_0x9da8e1);})[_0x3645('0x9')](function(){return respondWithRpcPromise(_0x3645('0x70'),{'channel':_0x2be71c,'interaction':_0xd67501['Interaction'],'message':_0xd67501,'account':_0xd67501[_0x3645('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x3645('0x68'),'appdata':_0x4730c5[_0x3645('0x32')]+','+(_0xd67501[_0x3645('0x6c')][_0x3645('0x71')]||0x12c),'interval':_0x3645('0x72')}]},routingClient);})[_0x3645('0x9')](respondWithResult(_0xa6852,null))[_0x3645('0xd')](handleError(_0xa6852,null));};};exports['agentNotify']=function(_0x3b596c,_0x1a0c94){var _0x4118e8,_0x6e80e4;if(_[_0x3645('0x13')](_0x3b596c[_0x3645('0x2f')][_0x3645('0x73')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x5db326=_0x3b596c['body']['channel'];var _0x285bd6=_[_0x3645('0x74')](_0x5db326);var _0x43da11=_0x5db326===_0x3645('0x60')?_0x3645('0x61'):_0x3645('0x6c');return db[_0x3645('0x75')]['findOne']({'raw':!![],'where':{'id':_0x3b596c[_0x3645('0x19')]['id'],'role':_0x3645('0x76')}})['then'](function(_0x184dbc){if(_[_0x3645('0x13')](_0x184dbc)){throw new Error(_0x3645('0x77'));}_0x4118e8=_0x184dbc;return db[_0x285bd6+_0x3645('0x78')]['findOne']({'where':{'id':_0x3b596c[_0x3645('0x2f')]['messageId']},'include':[{'model':db[_0x285bd6+_0x3645('0x65')],'as':'Interaction'},{'model':db[_0x285bd6+_0x43da11],'as':'Account'}]});})[_0x3645('0x9')](function(_0x204b19){if(_[_0x3645('0x13')](_0x204b19)){throw new Error(_0x285bd6+_0x3645('0x66'));}_0x6e80e4=_0x204b19;return _0x204b19[_0x3645('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0x3645('0x9')](function(){var _0x1a06ca={'uniqueid':_0x5db326+'.'+_0x6e80e4['id']+'.'+_0x6e80e4[_0x3645('0x65')]['id'],'FromUserId':_0x3b596c[_0x3645('0x31')]['id'],'type':_0x3645('0x68'),'ToUserId':_0x4118e8['id']};_0x1a06ca[_0x285bd6+'MessageId']=_0x6e80e4['id'];_0x1a06ca[_0x285bd6+'InteractionId']=_0x6e80e4[_0x3645('0x65')]['id'];_0x1a06ca[_0x3645('0x6b')+_0x285bd6+_0x43da11+'Id']=_0x6e80e4[_0x3645('0x6c')]['id'];return db[_0x285bd6+'TransferReport'][_0x3645('0x6f')](_0x1a06ca);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x5db326,'interaction':_0x6e80e4['Interaction'],'message':_0x6e80e4,'account':_0x6e80e4[_0x3645('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4118e8[_0x3645('0x32')]+','+(_0x6e80e4[_0x3645('0x6c')][_0x3645('0x79')]||0x12c),'interval':_0x3645('0x72')}]},routingClient);})[_0x3645('0x9')](respondWithResult(_0x1a0c94,null))[_0x3645('0xd')](handleError(_0x1a0c94,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 66cac8a..ec42cd8 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 _0x26b3=['isAuthenticated','index','get','/:id/run','run','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x130e1e,_0x5b87bc){var _0x50e0cc=function(_0xc202ee){while(--_0xc202ee){_0x130e1e['push'](_0x130e1e['shift']());}};_0x50e0cc(++_0x5b87bc);}(_0x26b3,0x115));var _0x326b=function(_0x353e23,_0x9a9a75){_0x353e23=_0x353e23-0x0;var _0x422cab=_0x26b3[_0x353e23];return _0x422cab;};'use strict';var multer=require(_0x326b('0x0'));var util=require(_0x326b('0x1'));var path=require(_0x326b('0x2'));var timeout=require(_0x326b('0x3'));var express=require('express');var router=express[_0x326b('0x4')]();var auth=require(_0x326b('0x5'));var interaction=require(_0x326b('0x6'));var config=require(_0x326b('0x7'));var controller=require(_0x326b('0x8'));router['get']('/',auth[_0x326b('0x9')](),controller[_0x326b('0xa')]);router[_0x326b('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x326b('0xb')](_0x326b('0xc'),auth['isAuthenticated'](),controller[_0x326b('0xd')]);router[_0x326b('0xe')]('/',auth[_0x326b('0x9')](),controller[_0x326b('0xf')]);router[_0x326b('0x10')]('/:id',auth[_0x326b('0x9')](),controller[_0x326b('0x11')]);router[_0x326b('0x12')](_0x326b('0x13'),auth[_0x326b('0x9')](),controller[_0x326b('0x14')]);module[_0x326b('0x15')]=router; \ No newline at end of file +var _0xed18=['express','Router','./schedule.controller','get','isAuthenticated','index','show','/:id/run','run','post','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2519bc,_0x3ec718){var _0x2be753=function(_0x464ab4){while(--_0x464ab4){_0x2519bc['push'](_0x2519bc['shift']());}};_0x2be753(++_0x3ec718);}(_0xed18,0x1d0));var _0x8ed1=function(_0x3a465a,_0x3e8001){_0x3a465a=_0x3a465a-0x0;var _0x1ed244=_0xed18[_0x3a465a];return _0x1ed244;};'use strict';var multer=require(_0x8ed1('0x0'));var util=require(_0x8ed1('0x1'));var path=require(_0x8ed1('0x2'));var timeout=require(_0x8ed1('0x3'));var express=require(_0x8ed1('0x4'));var router=express[_0x8ed1('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8ed1('0x6'));router[_0x8ed1('0x7')]('/',auth[_0x8ed1('0x8')](),controller[_0x8ed1('0x9')]);router[_0x8ed1('0x7')]('/:id',auth[_0x8ed1('0x8')](),controller[_0x8ed1('0xa')]);router[_0x8ed1('0x7')](_0x8ed1('0xb'),auth[_0x8ed1('0x8')](),controller[_0x8ed1('0xc')]);router[_0x8ed1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8ed1('0xe'),auth[_0x8ed1('0x8')](),controller[_0x8ed1('0xf')]);router[_0x8ed1('0x10')](_0x8ed1('0xe'),auth[_0x8ed1('0x8')](),controller['destroy']);module[_0x8ed1('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 29986f5..a10f2ac 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 _0xdfa0=['hours','minutes','csv','pdf','xlsx','ENUM','default','custom','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','weeks','days'];(function(_0x4f1a18,_0x5e26cd){var _0x158bd7=function(_0x2bde23){while(--_0x2bde23){_0x4f1a18['push'](_0x4f1a18['shift']());}};_0x158bd7(++_0x5e26cd);}(_0xdfa0,0x69));var _0x0dfa=function(_0x2861f5,_0x4f83f3){_0x2861f5=_0x2861f5-0x0;var _0x4286f8=_0xdfa0[_0x2861f5];return _0x4286f8;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0dfa('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0dfa('0x1')],'allowNull':![],'defaultValue':_0x0dfa('0x2')},'startAt':{'type':Sequelize[_0x0dfa('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0dfa('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x0dfa('0x5'),_0x0dfa('0x6'),'months',_0x0dfa('0x7'),_0x0dfa('0x8'),_0x0dfa('0x9'),_0x0dfa('0xa')),'allowNull':![],'defaultValue':_0x0dfa('0x8')},'output':{'type':Sequelize['ENUM'](_0x0dfa('0xb'),_0x0dfa('0xc'),_0x0dfa('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x0dfa('0xe')]('custom',_0x0dfa('0xf')),'allowNull':![],'defaultValue':_0x0dfa('0x10')},'sendMail':{'type':Sequelize[_0x0dfa('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0dfa('0x12')]},'bcc':{'type':Sequelize[_0x0dfa('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x14b2=['csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','weeks','days','hours','minutes','ENUM','pdf'];(function(_0x26a80a,_0x48460d){var _0x3cf276=function(_0x29a291){while(--_0x29a291){_0x26a80a['push'](_0x26a80a['shift']());}};_0x3cf276(++_0x48460d);}(_0x14b2,0x1a1));var _0x214b=function(_0x1a1b4e,_0x15d0ee){_0x1a1b4e=_0x1a1b4e-0x0;var _0x5cc883=_0x14b2[_0x1a1b4e];return _0x5cc883;};'use strict';var Sequelize=require(_0x214b('0x0'));module[_0x214b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x214b('0x2')]},'active':{'type':Sequelize[_0x214b('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x214b('0x2')],'allowNull':![],'defaultValue':_0x214b('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x214b('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x214b('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x214b('0x7'),_0x214b('0x8'),_0x214b('0x9'),_0x214b('0xa'),_0x214b('0xb'),_0x214b('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x214b('0xd')]('csv',_0x214b('0xe'),'xlsx'),'allowNull':![],'defaultValue':_0x214b('0xf')},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':_0x214b('0x10')},'sendMail':{'type':Sequelize[_0x214b('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x214b('0x11')]},'bcc':{'type':Sequelize[_0x214b('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x214b('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a6c6c05..30f871a 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 _0xfdf4=['squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','Schedule','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash'];(function(_0x898ef8,_0x3d0ef9){var _0x3a55ed=function(_0x196629){while(--_0x196629){_0x898ef8['push'](_0x898ef8['shift']());}};_0x3a55ed(++_0x3d0ef9);}(_0xfdf4,0xef));var _0x4fdf=function(_0x1bd588,_0x3d22e9){_0x1bd588=_0x1bd588-0x0;var _0x2e3666=_0xfdf4[_0x1bd588];return _0x2e3666;};'use strict';var pdf=require(_0x4fdf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4fdf('0x1'));var jsonpatch=require(_0x4fdf('0x2'));var rp=require(_0x4fdf('0x3'));var moment=require('moment');var BPromise=require(_0x4fdf('0x4'));var Mustache=require(_0x4fdf('0x5'));var util=require(_0x4fdf('0x6'));var path=require('path');var sox=require(_0x4fdf('0x7'));var csv=require('to-csv');var ejs=require(_0x4fdf('0x8'));var fs=require('fs');var _=require(_0x4fdf('0x9'));var squel=require(_0x4fdf('0xa'));var crypto=require(_0x4fdf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4fdf('0xc'));var toCsv=require(_0x4fdf('0xd'));var querystring=require(_0x4fdf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4fdf('0xf'));var authService=require(_0x4fdf('0x10'));var qs=require(_0x4fdf('0x11'));var as=require(_0x4fdf('0x12'));var hardwareService=require(_0x4fdf('0x13'));var logger=require(_0x4fdf('0x14'))(_0x4fdf('0x15'));var utils=require('../../config/utils');var config=require(_0x4fdf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b5840,_0x2b646e){_0x2b646e=_0x2b646e||0xcc;return function(_0x281315){if(_0x281315){return _0x4b5840['sendStatus'](_0x2b646e);}return _0x4b5840[_0x4fdf('0x17')](_0x2b646e)[_0x4fdf('0x18')]();};}function respondWithResult(_0x36aa42,_0x530d55){_0x530d55=_0x530d55||0xc8;return function(_0x41ff59){if(_0x41ff59){return _0x36aa42[_0x4fdf('0x17')](_0x530d55)[_0x4fdf('0x19')](_0x41ff59);}};}function respondWithFilteredResult(_0x54e256,_0x4b51a4){return function(_0x5a9059){if(_0x5a9059){var _0x2e6a1e=_0x5a9059['count'],_0x3ab329=_0x4b51a4[_0x4fdf('0x1a')],_0x14685c=_0x4b51a4[_0x4fdf('0x1a')]+_0x4b51a4['limit'],_0x44869e;if(_0x14685c>=_0x2e6a1e){_0x14685c=_0x2e6a1e;_0x44869e=0xc8;}else{_0x44869e=0xce;}_0x54e256['status'](_0x44869e);return _0x54e256[_0x4fdf('0x1b')](_0x4fdf('0x1c'),_0x3ab329+'-'+_0x14685c+'/'+_0x2e6a1e)[_0x4fdf('0x19')](_0x5a9059);}return null;};}function patchUpdates(_0x28e7df){return function(_0x1ee4a1){try{jsonpatch['apply'](_0x1ee4a1,_0x28e7df,!![]);}catch(_0x913232){return BPromise[_0x4fdf('0x1d')](_0x913232);}return _0x1ee4a1[_0x4fdf('0x1e')]();};}function saveUpdates(_0xfab34,_0xa15656){return function(_0x3afc4f){if(_0x3afc4f){return _0x3afc4f[_0x4fdf('0x1f')](_0xfab34)[_0x4fdf('0x20')](function(_0x4617cf){return _0x4617cf;});}return null;};}function removeEntity(_0x33bd5d,_0x50d2bb){return function(_0xbbb040){if(_0xbbb040){return _0xbbb040[_0x4fdf('0x21')]()[_0x4fdf('0x20')](function(){var _0x4c4f1c=_0xbbb040[_0x4fdf('0x22')]({'plain':!![]});var _0x3638e8=_0x4fdf('0x23');return db[_0x4fdf('0x24')][_0x4fdf('0x21')]({'where':{'type':_0x3638e8,'resourceId':_0x4c4f1c['id']}})[_0x4fdf('0x20')](function(){return _0xbbb040;});})['then'](function(){_0x33bd5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f37aa,_0xfc2869){return function(_0x31534c){if(!_0x31534c){_0x2f37aa['sendStatus'](0x194);}return _0x31534c;};}function handleError(_0x4267a4,_0x467e29){_0x467e29=_0x467e29||0x1f4;return function(_0x6b04a8){logger[_0x4fdf('0x25')](_0x6b04a8[_0x4fdf('0x26')]);if(_0x6b04a8[_0x4fdf('0x27')]){delete _0x6b04a8['name'];}_0x4267a4[_0x4fdf('0x17')](_0x467e29)[_0x4fdf('0x28')](_0x6b04a8);};}exports[_0x4fdf('0x29')]=function(_0x4c3a4c,_0x12a6b1){var _0x16f61a={},_0x56e564={},_0x1013ad={'count':0x0,'rows':[]};var _0x39cbcf=_['map'](db[_0x4fdf('0x2a')][_0x4fdf('0x2b')],function(_0x49e79d){return{'name':_0x49e79d['fieldName'],'type':_0x49e79d[_0x4fdf('0x2c')][_0x4fdf('0x2d')]};});_0x56e564[_0x4fdf('0x2e')]=_['map'](_0x39cbcf,_0x4fdf('0x27'));_0x56e564[_0x4fdf('0x2f')]=_['keys'](_0x4c3a4c[_0x4fdf('0x2f')]);_0x56e564[_0x4fdf('0x30')]=_[_0x4fdf('0x31')](_0x56e564[_0x4fdf('0x2e')],_0x56e564[_0x4fdf('0x2f')]);_0x16f61a[_0x4fdf('0x32')]=_['intersection'](_0x56e564['model'],qs[_0x4fdf('0x33')](_0x4c3a4c[_0x4fdf('0x2f')][_0x4fdf('0x33')]));_0x16f61a[_0x4fdf('0x32')]=_0x16f61a[_0x4fdf('0x32')][_0x4fdf('0x34')]?_0x16f61a[_0x4fdf('0x32')]:_0x56e564[_0x4fdf('0x2e')];if(!_0x4c3a4c['query'][_0x4fdf('0x35')]('nolimit')){_0x16f61a[_0x4fdf('0x36')]=qs[_0x4fdf('0x36')](_0x4c3a4c[_0x4fdf('0x2f')]['limit']);_0x16f61a['offset']=qs[_0x4fdf('0x1a')](_0x4c3a4c['query'][_0x4fdf('0x1a')]);}_0x16f61a[_0x4fdf('0x37')]=qs[_0x4fdf('0x38')](_0x4c3a4c[_0x4fdf('0x2f')][_0x4fdf('0x38')]);_0x16f61a[_0x4fdf('0x39')]=qs[_0x4fdf('0x30')](_[_0x4fdf('0x3a')](_0x4c3a4c['query'],_0x56e564[_0x4fdf('0x30')]),_0x39cbcf);if(_0x4c3a4c[_0x4fdf('0x2f')][_0x4fdf('0x3b')]){_0x16f61a['where']=_[_0x4fdf('0x3c')](_0x16f61a[_0x4fdf('0x39')],{'$or':_[_0x4fdf('0x3d')](_0x39cbcf,function(_0x9ba55c){if(_0x9ba55c[_0x4fdf('0x2c')]!==_0x4fdf('0x3e')){var _0x47560c={};_0x47560c[_0x9ba55c[_0x4fdf('0x27')]]={'$like':'%'+_0x4c3a4c[_0x4fdf('0x2f')][_0x4fdf('0x3b')]+'%'};return _0x47560c;}})});}_0x16f61a=_[_0x4fdf('0x3c')]({},_0x16f61a,_0x4c3a4c[_0x4fdf('0x3f')]);var _0x5bf915={'where':_0x16f61a[_0x4fdf('0x39')]};return db[_0x4fdf('0x2a')][_0x4fdf('0x40')](_0x5bf915)[_0x4fdf('0x20')](function(_0x5d536d){_0x1013ad[_0x4fdf('0x40')]=_0x5d536d;if(_0x4c3a4c[_0x4fdf('0x2f')][_0x4fdf('0x41')]){_0x16f61a['include']=[{'all':!![]}];}return db[_0x4fdf('0x2a')][_0x4fdf('0x42')](_0x16f61a);})[_0x4fdf('0x20')](function(_0x203fcb){_0x1013ad[_0x4fdf('0x43')]=_0x203fcb;return _0x1013ad;})[_0x4fdf('0x20')](respondWithFilteredResult(_0x12a6b1,_0x16f61a))[_0x4fdf('0x44')](handleError(_0x12a6b1,null));};exports[_0x4fdf('0x45')]=function(_0x3ba2bc,_0x515065){var _0x428635={'raw':![],'where':{'id':_0x3ba2bc[_0x4fdf('0x46')]['id']}},_0x1e861f={};_0x1e861f[_0x4fdf('0x2e')]=_[_0x4fdf('0x47')](db[_0x4fdf('0x2a')]['rawAttributes']);_0x1e861f[_0x4fdf('0x2f')]=_['keys'](_0x3ba2bc['query']);_0x1e861f[_0x4fdf('0x30')]=_[_0x4fdf('0x31')](_0x1e861f[_0x4fdf('0x2e')],_0x1e861f[_0x4fdf('0x2f')]);_0x428635['attributes']=_[_0x4fdf('0x31')](_0x1e861f[_0x4fdf('0x2e')],qs[_0x4fdf('0x33')](_0x3ba2bc[_0x4fdf('0x2f')]['fields']));_0x428635[_0x4fdf('0x32')]=_0x428635[_0x4fdf('0x32')]['length']?_0x428635[_0x4fdf('0x32')]:_0x1e861f['model'];if(_0x3ba2bc[_0x4fdf('0x2f')][_0x4fdf('0x41')]){_0x428635[_0x4fdf('0x48')]=[{'all':!![]}];}_0x428635=_[_0x4fdf('0x3c')]({},_0x428635,_0x3ba2bc['options']);return db[_0x4fdf('0x2a')][_0x4fdf('0x49')](_0x428635)[_0x4fdf('0x20')](handleEntityNotFound(_0x515065,null))[_0x4fdf('0x20')](respondWithResult(_0x515065,null))[_0x4fdf('0x44')](handleError(_0x515065,null));};exports[_0x4fdf('0x4a')]=function(_0x2a0fcb,_0x345e07){return db[_0x4fdf('0x2a')][_0x4fdf('0x4a')](_0x2a0fcb[_0x4fdf('0x4b')],{})[_0x4fdf('0x20')](function(_0x59df79){var _0x591e8f=_0x2a0fcb[_0x4fdf('0x4c')][_0x4fdf('0x22')]({'plain':!![]});if(!_0x591e8f)throw new Error(_0x4fdf('0x4d'));if(_0x591e8f[_0x4fdf('0x4e')]===_0x4fdf('0x4c')){var _0x2223bb=_0x59df79[_0x4fdf('0x22')]({'plain':!![]});var _0x2e6e07=_0x4fdf('0x23');return db['UserProfileSection'][_0x4fdf('0x49')]({'where':{'name':_0x2e6e07,'userProfileId':_0x591e8f['userProfileId']},'raw':!![]})['then'](function(_0x5ef477){if(_0x5ef477&&_0x5ef477[_0x4fdf('0x4f')]===0x0){return db[_0x4fdf('0x24')][_0x4fdf('0x4a')]({'name':_0x2223bb[_0x4fdf('0x27')],'resourceId':_0x2223bb['id'],'type':_0x5ef477[_0x4fdf('0x27')],'sectionId':_0x5ef477['id']},{})[_0x4fdf('0x20')](function(){return _0x59df79;});}else{return _0x59df79;}})['catch'](function(_0x2c3106){logger['error'](_0x4fdf('0x50'),_0x2c3106);throw _0x2c3106;});}return _0x59df79;})['then'](respondWithResult(_0x345e07,0xc9))['catch'](handleError(_0x345e07,null));};exports[_0x4fdf('0x1f')]=function(_0x1c3ff8,_0x11e36e){if(_0x1c3ff8[_0x4fdf('0x4b')]['id']){delete _0x1c3ff8[_0x4fdf('0x4b')]['id'];}return db['Schedule'][_0x4fdf('0x49')]({'where':{'id':_0x1c3ff8[_0x4fdf('0x46')]['id']}})[_0x4fdf('0x20')](handleEntityNotFound(_0x11e36e,null))['then'](saveUpdates(_0x1c3ff8[_0x4fdf('0x4b')],null))[_0x4fdf('0x20')](respondWithResult(_0x11e36e,null))[_0x4fdf('0x44')](handleError(_0x11e36e,null));};exports[_0x4fdf('0x21')]=function(_0x515da7,_0x33bdf8){return db[_0x4fdf('0x2a')][_0x4fdf('0x49')]({'where':{'id':_0x515da7[_0x4fdf('0x46')]['id']}})[_0x4fdf('0x20')](handleEntityNotFound(_0x33bdf8,null))[_0x4fdf('0x20')](removeEntity(_0x33bdf8,null))[_0x4fdf('0x44')](handleError(_0x33bdf8,null));};exports[_0x4fdf('0x51')]=function(_0x40aa70,_0x4e2652,_0x50311e){var _0x494314=require(_0x4fdf('0x52'));return db[_0x4fdf('0x2a')][_0x4fdf('0x49')]({'where':{'id':_0x40aa70[_0x4fdf('0x46')]['id']},'raw':!![]})[_0x4fdf('0x20')](handleEntityNotFound(_0x4e2652,null))['then'](function(){_0x494314[_0x4fdf('0x51')](_0x40aa70[_0x4fdf('0x46')]['id']);})[_0x4fdf('0x20')](respondWithStatusCode(_0x4e2652,null))[_0x4fdf('0x44')](handleError(_0x4e2652,null));}; \ No newline at end of file +var _0x9314=['include','catch','show','params','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','body','run','html-pdf','rimraf','zip-dir','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/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','VIRTUAL','filter','Schedule','includeAll'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x9314,0xb2));var _0x4931=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9314[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x4931('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4931('0x1'));var zipdir=require(_0x4931('0x2'));var jsonpatch=require(_0x4931('0x3'));var rp=require(_0x4931('0x4'));var moment=require(_0x4931('0x5'));var BPromise=require(_0x4931('0x6'));var Mustache=require(_0x4931('0x7'));var util=require(_0x4931('0x8'));var path=require(_0x4931('0x9'));var sox=require(_0x4931('0xa'));var csv=require('to-csv');var ejs=require(_0x4931('0xb'));var fs=require('fs');var _=require(_0x4931('0xc'));var squel=require(_0x4931('0xd'));var crypto=require(_0x4931('0xe'));var jsforce=require(_0x4931('0xf'));var deskjs=require(_0x4931('0x10'));var toCsv=require(_0x4931('0x11'));var querystring=require(_0x4931('0x12'));var Papa=require(_0x4931('0x13'));var Redis=require(_0x4931('0x14'));var authService=require(_0x4931('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x4931('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4931('0x17'))(_0x4931('0x18'));var utils=require('../../config/utils');var config=require(_0x4931('0x19'));var db=require(_0x4931('0x1a'))['db'];function respondWithStatusCode(_0x45a95e,_0xd37a4f){_0xd37a4f=_0xd37a4f||0xcc;return function(_0x4278e7){if(_0x4278e7){return _0x45a95e[_0x4931('0x1b')](_0xd37a4f);}return _0x45a95e[_0x4931('0x1c')](_0xd37a4f)[_0x4931('0x1d')]();};}function respondWithResult(_0x3c6442,_0x1f2a66){_0x1f2a66=_0x1f2a66||0xc8;return function(_0x1a215a){if(_0x1a215a){return _0x3c6442['status'](_0x1f2a66)[_0x4931('0x1e')](_0x1a215a);}};}function respondWithFilteredResult(_0x231727,_0x149d32){return function(_0x1cbd48){if(_0x1cbd48){var _0x9cf636=_0x1cbd48[_0x4931('0x1f')],_0x19b80d=_0x149d32['offset'],_0x544e51=_0x149d32['offset']+_0x149d32[_0x4931('0x20')],_0x13851f;if(_0x544e51>=_0x9cf636){_0x544e51=_0x9cf636;_0x13851f=0xc8;}else{_0x13851f=0xce;}_0x231727['status'](_0x13851f);return _0x231727[_0x4931('0x21')](_0x4931('0x22'),_0x19b80d+'-'+_0x544e51+'/'+_0x9cf636)[_0x4931('0x1e')](_0x1cbd48);}return null;};}function patchUpdates(_0x219201){return function(_0x5771cf){try{jsonpatch[_0x4931('0x23')](_0x5771cf,_0x219201,!![]);}catch(_0x14d148){return BPromise[_0x4931('0x24')](_0x14d148);}return _0x5771cf['save']();};}function saveUpdates(_0x4cba9c,_0x8fa253){return function(_0x37c2b2){if(_0x37c2b2){return _0x37c2b2['update'](_0x4cba9c)[_0x4931('0x25')](function(_0x4c4d64){return _0x4c4d64;});}return null;};}function removeEntity(_0x48ca44,_0x3e9e2b){return function(_0x4fddc3){if(_0x4fddc3){return _0x4fddc3[_0x4931('0x26')]()['then'](function(){var _0x3029ae=_0x4fddc3[_0x4931('0x27')]({'plain':!![]});var _0x2bcca9=_0x4931('0x28');return db[_0x4931('0x29')][_0x4931('0x26')]({'where':{'type':_0x2bcca9,'resourceId':_0x3029ae['id']}})[_0x4931('0x25')](function(){return _0x4fddc3;});})[_0x4931('0x25')](function(){_0x48ca44[_0x4931('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc92044,_0x41fdb6){return function(_0x382a42){if(!_0x382a42){_0xc92044[_0x4931('0x1b')](0x194);}return _0x382a42;};}function handleError(_0x44a33f,_0x3b8592){_0x3b8592=_0x3b8592||0x1f4;return function(_0x52fb94){logger[_0x4931('0x2a')](_0x52fb94[_0x4931('0x2b')]);if(_0x52fb94['name']){delete _0x52fb94[_0x4931('0x2c')];}_0x44a33f['status'](_0x3b8592)[_0x4931('0x2d')](_0x52fb94);};}exports[_0x4931('0x2e')]=function(_0x17c504,_0x4598c4){var _0x459018={},_0x2acbe2={},_0x3f7f48={'count':0x0,'rows':[]};var _0x585c9a=_['map'](db['Schedule'][_0x4931('0x2f')],function(_0x407a8b){return{'name':_0x407a8b['fieldName'],'type':_0x407a8b[_0x4931('0x30')]['key']};});_0x2acbe2[_0x4931('0x31')]=_[_0x4931('0x32')](_0x585c9a,_0x4931('0x2c'));_0x2acbe2[_0x4931('0x33')]=_[_0x4931('0x34')](_0x17c504[_0x4931('0x33')]);_0x2acbe2['filters']=_['intersection'](_0x2acbe2['model'],_0x2acbe2['query']);_0x459018[_0x4931('0x35')]=_[_0x4931('0x36')](_0x2acbe2[_0x4931('0x31')],qs[_0x4931('0x37')](_0x17c504[_0x4931('0x33')][_0x4931('0x37')]));_0x459018[_0x4931('0x35')]=_0x459018[_0x4931('0x35')][_0x4931('0x38')]?_0x459018['attributes']:_0x2acbe2[_0x4931('0x31')];if(!_0x17c504[_0x4931('0x33')][_0x4931('0x39')]('nolimit')){_0x459018['limit']=qs[_0x4931('0x20')](_0x17c504['query']['limit']);_0x459018[_0x4931('0x3a')]=qs[_0x4931('0x3a')](_0x17c504[_0x4931('0x33')]['offset']);}_0x459018[_0x4931('0x3b')]=qs[_0x4931('0x3c')](_0x17c504[_0x4931('0x33')][_0x4931('0x3c')]);_0x459018[_0x4931('0x3d')]=qs[_0x4931('0x3e')](_[_0x4931('0x3f')](_0x17c504['query'],_0x2acbe2[_0x4931('0x3e')]),_0x585c9a);if(_0x17c504[_0x4931('0x33')]['filter']){_0x459018[_0x4931('0x3d')]=_['merge'](_0x459018[_0x4931('0x3d')],{'$or':_[_0x4931('0x32')](_0x585c9a,function(_0x4974af){if(_0x4974af[_0x4931('0x30')]!==_0x4931('0x40')){var _0x463fbd={};_0x463fbd[_0x4974af[_0x4931('0x2c')]]={'$like':'%'+_0x17c504[_0x4931('0x33')][_0x4931('0x41')]+'%'};return _0x463fbd;}})});}_0x459018=_['merge']({},_0x459018,_0x17c504['options']);var _0x4817d9={'where':_0x459018[_0x4931('0x3d')]};return db[_0x4931('0x42')]['count'](_0x4817d9)['then'](function(_0x52b9ab){_0x3f7f48[_0x4931('0x1f')]=_0x52b9ab;if(_0x17c504['query'][_0x4931('0x43')]){_0x459018[_0x4931('0x44')]=[{'all':!![]}];}return db[_0x4931('0x42')]['findAll'](_0x459018);})[_0x4931('0x25')](function(_0x17e547){_0x3f7f48['rows']=_0x17e547;return _0x3f7f48;})['then'](respondWithFilteredResult(_0x4598c4,_0x459018))[_0x4931('0x45')](handleError(_0x4598c4,null));};exports[_0x4931('0x46')]=function(_0x70407c,_0x12007e){var _0x12f8d7={'raw':![],'where':{'id':_0x70407c[_0x4931('0x47')]['id']}},_0x34d503={};_0x34d503[_0x4931('0x31')]=_[_0x4931('0x34')](db[_0x4931('0x42')][_0x4931('0x2f')]);_0x34d503[_0x4931('0x33')]=_[_0x4931('0x34')](_0x70407c[_0x4931('0x33')]);_0x34d503['filters']=_[_0x4931('0x36')](_0x34d503[_0x4931('0x31')],_0x34d503[_0x4931('0x33')]);_0x12f8d7[_0x4931('0x35')]=_[_0x4931('0x36')](_0x34d503[_0x4931('0x31')],qs['fields'](_0x70407c['query']['fields']));_0x12f8d7['attributes']=_0x12f8d7[_0x4931('0x35')][_0x4931('0x38')]?_0x12f8d7['attributes']:_0x34d503[_0x4931('0x31')];if(_0x70407c[_0x4931('0x33')][_0x4931('0x43')]){_0x12f8d7[_0x4931('0x44')]=[{'all':!![]}];}_0x12f8d7=_[_0x4931('0x48')]({},_0x12f8d7,_0x70407c['options']);return db[_0x4931('0x42')][_0x4931('0x49')](_0x12f8d7)[_0x4931('0x25')](handleEntityNotFound(_0x12007e,null))[_0x4931('0x25')](respondWithResult(_0x12007e,null))['catch'](handleError(_0x12007e,null));};exports[_0x4931('0x4a')]=function(_0x13d899,_0xd7d292){return db[_0x4931('0x42')][_0x4931('0x4a')](_0x13d899['body'],{})[_0x4931('0x25')](function(_0x299d4a){var _0x58fe2f=_0x13d899['user'][_0x4931('0x27')]({'plain':!![]});if(!_0x58fe2f)throw new Error(_0x4931('0x4b'));if(_0x58fe2f[_0x4931('0x4c')]==='user'){var _0x3b4bf0=_0x299d4a['get']({'plain':!![]});var _0x1c258a=_0x4931('0x28');return db['UserProfileSection'][_0x4931('0x49')]({'where':{'name':_0x1c258a,'userProfileId':_0x58fe2f[_0x4931('0x4d')]},'raw':!![]})[_0x4931('0x25')](function(_0x5bb46f){if(_0x5bb46f&&_0x5bb46f[_0x4931('0x4e')]===0x0){return db[_0x4931('0x29')][_0x4931('0x4a')]({'name':_0x3b4bf0[_0x4931('0x2c')],'resourceId':_0x3b4bf0['id'],'type':_0x5bb46f[_0x4931('0x2c')],'sectionId':_0x5bb46f['id']},{})[_0x4931('0x25')](function(){return _0x299d4a;});}else{return _0x299d4a;}})['catch'](function(_0x575280){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x575280);throw _0x575280;});}return _0x299d4a;})[_0x4931('0x25')](respondWithResult(_0xd7d292,0xc9))['catch'](handleError(_0xd7d292,null));};exports[_0x4931('0x4f')]=function(_0x28b55a,_0xa26fc5){if(_0x28b55a[_0x4931('0x50')]['id']){delete _0x28b55a['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x28b55a['params']['id']}})[_0x4931('0x25')](handleEntityNotFound(_0xa26fc5,null))[_0x4931('0x25')](saveUpdates(_0x28b55a['body'],null))[_0x4931('0x25')](respondWithResult(_0xa26fc5,null))[_0x4931('0x45')](handleError(_0xa26fc5,null));};exports['destroy']=function(_0x1462c0,_0x26d7be){return db[_0x4931('0x42')][_0x4931('0x49')]({'where':{'id':_0x1462c0[_0x4931('0x47')]['id']}})[_0x4931('0x25')](handleEntityNotFound(_0x26d7be,null))['then'](removeEntity(_0x26d7be,null))[_0x4931('0x45')](handleError(_0x26d7be,null));};exports[_0x4931('0x51')]=function(_0x103ec9,_0x4dd562,_0x49d28d){var _0x228158=require('../../config/schedule');return db[_0x4931('0x42')]['find']({'where':{'id':_0x103ec9[_0x4931('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4dd562,null))['then'](function(){_0x228158[_0x4931('0x51')](_0x103ec9[_0x4931('0x47')]['id']);})['then'](respondWithStatusCode(_0x4dd562,null))[_0x4931('0x45')](handleError(_0x4dd562,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 53f56d7..04fce58 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 _0x0f89=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x444396,_0x15fcd6){var _0x34bce4=function(_0x240afe){while(--_0x240afe){_0x444396['push'](_0x444396['shift']());}};_0x34bce4(++_0x15fcd6);}(_0x0f89,0x172));var _0x90f8=function(_0x236efb,_0x2bc7f9){_0x236efb=_0x236efb-0x0;var _0x3979c9=_0x0f89[_0x236efb];return _0x3979c9;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var logger=require('../../config/logger')(_0x90f8('0x2'));var moment=require(_0x90f8('0x3'));var BPromise=require(_0x90f8('0x4'));var rp=require(_0x90f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90f8('0x6'));var config=require(_0x90f8('0x7'));var attributes=require(_0x90f8('0x8'));module[_0x90f8('0x9')]=function(_0x5a7a91,_0x9c9360){return _0x5a7a91[_0x90f8('0xa')](_0x90f8('0xb'),attributes,{'tableName':_0x90f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a91=['tools_schedules','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x1b05cd,_0x56e905){var _0x548bb7=function(_0x32df8f){while(--_0x32df8f){_0x1b05cd['push'](_0x1b05cd['shift']());}};_0x548bb7(++_0x56e905);}(_0x4a91,0xb7));var _0x14a9=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x4a91[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x14a9('0x0'));var util=require(_0x14a9('0x1'));var logger=require(_0x14a9('0x2'))('api');var moment=require(_0x14a9('0x3'));var BPromise=require(_0x14a9('0x4'));var rp=require(_0x14a9('0x5'));var fs=require('fs');var path=require(_0x14a9('0x6'));var rimraf=require(_0x14a9('0x7'));var config=require(_0x14a9('0x8'));var attributes=require(_0x14a9('0x9'));module[_0x14a9('0xa')]=function(_0x327fd6,_0x33b036){return _0x327fd6[_0x14a9('0xb')](_0x14a9('0xc'),attributes,{'tableName':_0x14a9('0xd'),'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 5b3c111..454360b 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 _0xe6f8=['message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x13c436,_0x2d6d22){var _0x31cac5=function(_0x391288){while(--_0x391288){_0x13c436['push'](_0x13c436['shift']());}};_0x31cac5(++_0x2d6d22);}(_0xe6f8,0x115));var _0x8e6f=function(_0x118335,_0x13d68a){_0x118335=_0x118335-0x0;var _0x1e59d1=_0xe6f8[_0x118335];return _0x1e59d1;};'use strict';var _=require('lodash');var util=require(_0x8e6f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e6f('0x1'));var fs=require('fs');var Redis=require(_0x8e6f('0x2'));var db=require(_0x8e6f('0x3'))['db'];var utils=require(_0x8e6f('0x4'));var logger=require('../../config/logger')(_0x8e6f('0x5'));var config=require(_0x8e6f('0x6'));var jayson=require(_0x8e6f('0x7'));var client=jayson['client'][_0x8e6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x492769,_0x1a0a04,_0x3eb036){return new BPromise(function(_0x664c61,_0x2032ab){return client[_0x8e6f('0x9')](_0x492769,_0x3eb036)['then'](function(_0x15fcfe){logger['info'](_0x8e6f('0xa'),_0x1a0a04,'request\x20sent');logger[_0x8e6f('0xb')](_0x8e6f('0xc'),_0x1a0a04,_0x8e6f('0xd'),JSON[_0x8e6f('0xe')](_0x15fcfe));if(_0x15fcfe[_0x8e6f('0xf')]){if(_0x15fcfe[_0x8e6f('0xf')][_0x8e6f('0x10')]===0x1f4){logger[_0x8e6f('0xf')]('Schedule,\x20%s,\x20%s',_0x1a0a04,_0x15fcfe[_0x8e6f('0xf')][_0x8e6f('0x11')]);return _0x2032ab(_0x15fcfe[_0x8e6f('0xf')][_0x8e6f('0x11')]);}logger[_0x8e6f('0xf')](_0x8e6f('0xa'),_0x1a0a04,_0x15fcfe['error']['message']);return _0x664c61(_0x15fcfe[_0x8e6f('0xf')][_0x8e6f('0x11')]);}else{logger[_0x8e6f('0x12')](_0x8e6f('0xa'),_0x1a0a04,'request\x20sent');_0x664c61(_0x15fcfe[_0x8e6f('0x13')]['message']);}})[_0x8e6f('0x14')](function(_0x160459){logger[_0x8e6f('0xf')](_0x8e6f('0xa'),_0x1a0a04,_0x160459);_0x2032ab(_0x160459);});});} \ No newline at end of file +var _0x5a73=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring'];(function(_0x765050,_0x23b050){var _0x5a948e=function(_0x5dbe8e){while(--_0x5dbe8e){_0x765050['push'](_0x765050['shift']());}};_0x5a948e(++_0x23b050);}(_0x5a73,0x156));var _0x35a7=function(_0x15ae17,_0x5ee05c){_0x15ae17=_0x15ae17-0x0;var _0x4bea22=_0x5a73[_0x15ae17];return _0x4bea22;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x35a7('0x0'));var BPromise=require(_0x35a7('0x1'));var rs=require(_0x35a7('0x2'));var fs=require('fs');var Redis=require(_0x35a7('0x3'));var db=require(_0x35a7('0x4'))['db'];var utils=require(_0x35a7('0x5'));var logger=require(_0x35a7('0x6'))(_0x35a7('0x7'));var config=require(_0x35a7('0x8'));var jayson=require(_0x35a7('0x9'));var client=jayson[_0x35a7('0xa')][_0x35a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44d294,_0x167c8d,_0x43b8c5){return new BPromise(function(_0x513f92,_0x342e39){return client['request'](_0x44d294,_0x43b8c5)[_0x35a7('0xc')](function(_0x3a0f1d){logger[_0x35a7('0xd')]('Schedule,\x20%s,\x20%s',_0x167c8d,'request\x20sent');logger['debug'](_0x35a7('0xe'),_0x167c8d,_0x35a7('0xf'),JSON[_0x35a7('0x10')](_0x3a0f1d));if(_0x3a0f1d[_0x35a7('0x11')]){if(_0x3a0f1d['error'][_0x35a7('0x12')]===0x1f4){logger[_0x35a7('0x11')](_0x35a7('0x13'),_0x167c8d,_0x3a0f1d[_0x35a7('0x11')][_0x35a7('0x14')]);return _0x342e39(_0x3a0f1d[_0x35a7('0x11')][_0x35a7('0x14')]);}logger[_0x35a7('0x11')](_0x35a7('0x13'),_0x167c8d,_0x3a0f1d[_0x35a7('0x11')][_0x35a7('0x14')]);return _0x513f92(_0x3a0f1d[_0x35a7('0x11')][_0x35a7('0x14')]);}else{logger[_0x35a7('0xd')](_0x35a7('0x13'),_0x167c8d,_0x35a7('0xf'));_0x513f92(_0x3a0f1d[_0x35a7('0x15')][_0x35a7('0x14')]);}})[_0x35a7('0x16')](function(_0x347340){logger[_0x35a7('0x11')](_0x35a7('0x13'),_0x167c8d,_0x347340);_0x342e39(_0x347340);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8fb61c3..79e0b84 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 _0xc0fd=['get','/describe','/:id','show','/:id/download','download','create','put','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index'];(function(_0x3bbf26,_0xed9a38){var _0x57fc2e=function(_0x54b61d){while(--_0x54b61d){_0x3bbf26['push'](_0x3bbf26['shift']());}};_0x57fc2e(++_0xed9a38);}(_0xc0fd,0x1e5));var _0xdc0f=function(_0x1c8a99,_0x5c7fdc){_0x1c8a99=_0x1c8a99-0x0;var _0x528f40=_0xc0fd[_0x1c8a99];return _0x528f40;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc0f('0x0'));var timeout=require(_0xdc0f('0x1'));var express=require('express');var router=express[_0xdc0f('0x2')]();var auth=require(_0xdc0f('0x3'));var interaction=require(_0xdc0f('0x4'));var config=require(_0xdc0f('0x5'));var controller=require(_0xdc0f('0x6'));router['get']('/',auth[_0xdc0f('0x7')](),controller[_0xdc0f('0x8')]);router[_0xdc0f('0x9')](_0xdc0f('0xa'),auth[_0xdc0f('0x7')](),controller['describe']);router[_0xdc0f('0x9')](_0xdc0f('0xb'),auth[_0xdc0f('0x7')](),controller[_0xdc0f('0xc')]);router[_0xdc0f('0x9')](_0xdc0f('0xd'),auth['isAuthenticated'](),controller[_0xdc0f('0xe')]);router['post']('/',auth[_0xdc0f('0x7')](),controller[_0xdc0f('0xf')]);router[_0xdc0f('0x10')]('/:id',auth[_0xdc0f('0x7')](),controller['update']);router[_0xdc0f('0x11')]('/:id',auth[_0xdc0f('0x7')](),controller[_0xdc0f('0x12')]);module['exports']=router; \ No newline at end of file +var _0x660d=['index','/describe','describe','/:id','show','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated'];(function(_0x4e2ed7,_0x1f2a80){var _0x48b38a=function(_0x467256){while(--_0x467256){_0x4e2ed7['push'](_0x4e2ed7['shift']());}};_0x48b38a(++_0x1f2a80);}(_0x660d,0x1ef));var _0xd660=function(_0x1579c4,_0x189307){_0x1579c4=_0x1579c4-0x0;var _0x58e42d=_0x660d[_0x1579c4];return _0x58e42d;};'use strict';var multer=require(_0xd660('0x0'));var util=require(_0xd660('0x1'));var path=require(_0xd660('0x2'));var timeout=require(_0xd660('0x3'));var express=require(_0xd660('0x4'));var router=express[_0xd660('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd660('0x6'));var config=require(_0xd660('0x7'));var controller=require(_0xd660('0x8'));router[_0xd660('0x9')]('/',auth[_0xd660('0xa')](),controller[_0xd660('0xb')]);router[_0xd660('0x9')](_0xd660('0xc'),auth['isAuthenticated'](),controller[_0xd660('0xd')]);router[_0xd660('0x9')](_0xd660('0xe'),auth[_0xd660('0xa')](),controller[_0xd660('0xf')]);router[_0xd660('0x9')]('/:id/download',auth[_0xd660('0xa')](),controller[_0xd660('0x10')]);router[_0xd660('0x11')]('/',auth['isAuthenticated'](),controller[_0xd660('0x12')]);router[_0xd660('0x13')](_0xd660('0xe'),auth[_0xd660('0xa')](),controller[_0xd660('0x14')]);router[_0xd660('0x15')](_0xd660('0xe'),auth[_0xd660('0xa')](),controller[_0xd660('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 42a7b48..f88d0e0 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 _0x24ca=['format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE'];(function(_0x469100,_0x537385){var _0x26efb8=function(_0xa9898a){while(--_0xa9898a){_0x469100['push'](_0x469100['shift']());}};_0x26efb8(++_0x537385);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x24ca[_0x1602ef];return _0x5870ee;};'use strict';var Sequelize=require(_0xa24c('0x0'));var moment=require('moment');var path=require(_0xa24c('0x1'));var config=require(_0xa24c('0x2'));module[_0xa24c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa24c('0x4')](_0xa24c('0x5'))?path[_0xa24c('0x6')](this[_0xa24c('0x4')](_0xa24c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xa24c('0x7')]},'channel':{'type':Sequelize[_0xa24c('0x7')]},'value':{'type':Sequelize[_0xa24c('0x7')],'set':function(_0x2dd348){var _0x257264=_0x2dd348[_0xa24c('0x8')](/\\/g,'/');this['setDataValue'](_0xa24c('0x5'),_0x257264);}},'rating':{'type':Sequelize[_0xa24c('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa24c('0x9')],'set':function(_0x5eac78){this[_0xa24c('0xa')](_0xa24c('0xb'),moment()[_0xa24c('0xc')](_0x5eac78,'ms'));this[_0xa24c('0xa')](_0xa24c('0xd'),moment());this[_0xa24c('0xa')](_0xa24c('0xe'),_0x5eac78);}},'startedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this[_0xa24c('0x4')]('startedAt'))[_0xa24c('0x10')](_0xa24c('0x11'))[_0xa24c('0x12')]();}},'closedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this['getDataValue'](_0xa24c('0xd')))[_0xa24c('0x10')](_0xa24c('0x11'))[_0xa24c('0x12')]();}},'createdAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this[_0xa24c('0x4')](_0xa24c('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xa24c('0x12')]();}},'updatedAt':{'type':Sequelize[_0xa24c('0xf')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xa24c('0x10')](_0xa24c('0x11'))['toString']();}}}; \ No newline at end of file +var _0x032e=['duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','path','../../config/environment','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt'];(function(_0x3724e2,_0x41d318){var _0x5c5ab2=function(_0x4c57ae){while(--_0x4c57ae){_0x3724e2['push'](_0x3724e2['shift']());}};_0x5c5ab2(++_0x41d318);}(_0x032e,0x124));var _0xe032=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x032e[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0xe032('0x0'));var moment=require('moment');var path=require(_0xe032('0x1'));var config=require(_0xe032('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe032('0x3')](_0xe032('0x4'))?path[_0xe032('0x5')](this[_0xe032('0x3')](_0xe032('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xe032('0x6')]},'channel':{'type':Sequelize[_0xe032('0x6')]},'value':{'type':Sequelize[_0xe032('0x6')],'set':function(_0x37432f){var _0x1576c8=_0x37432f[_0xe032('0x7')](/\\/g,'/');this[_0xe032('0x8')](_0xe032('0x4'),_0x1576c8);}},'rating':{'type':Sequelize[_0xe032('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe032('0x9')],'set':function(_0x2d8a14){this[_0xe032('0x8')](_0xe032('0xa'),moment()['subtract'](_0x2d8a14,'ms'));this[_0xe032('0x8')](_0xe032('0xb'),moment());this[_0xe032('0x8')](_0xe032('0xc'),_0x2d8a14);}},'startedAt':{'type':Sequelize[_0xe032('0xd')],'get':function(){return moment(this[_0xe032('0x3')](_0xe032('0xa')))['format'](_0xe032('0xe'))[_0xe032('0xf')]();}},'closedAt':{'type':Sequelize[_0xe032('0xd')],'get':function(){return moment(this[_0xe032('0x3')]('closedAt'))[_0xe032('0x10')](_0xe032('0xe'))[_0xe032('0xf')]();}},'createdAt':{'type':Sequelize[_0xe032('0xd')],'get':function(){return moment(this[_0xe032('0x3')](_0xe032('0x11')))[_0xe032('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xe032('0xf')]();}},'updatedAt':{'type':Sequelize[_0xe032('0xd')],'get':function(){return moment(this[_0xe032('0x3')](_0xe032('0x12')))[_0xe032('0x10')](_0xe032('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 52c44f1..559e11c 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 _0x9981=['keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','name','options','include','rows','catch','show','params','includeAll','find','create','body','update','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','download','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','../../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','apply','save','then','end','sendStatus','error','stack','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query'];(function(_0x2b56d7,_0x35745a){var _0x1b48b3=function(_0xbc38b6){while(--_0xbc38b6){_0x2b56d7['push'](_0x2b56d7['shift']());}};_0x1b48b3(++_0x35745a);}(_0x9981,0x163));var _0x1998=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9981[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1998('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1998('0x1'));var BPromise=require(_0x1998('0x2'));var Mustache=require(_0x1998('0x3'));var util=require(_0x1998('0x4'));var path=require('path');var sox=require(_0x1998('0x5'));var csv=require('to-csv');var ejs=require(_0x1998('0x6'));var fs=require('fs');var _=require(_0x1998('0x7'));var squel=require(_0x1998('0x8'));var crypto=require('crypto');var jsforce=require(_0x1998('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1998('0xa'));var querystring=require(_0x1998('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1998('0xc'));var qs=require(_0x1998('0xd'));var as=require(_0x1998('0xe'));var hardwareService=require(_0x1998('0xf'));var logger=require(_0x1998('0x10'))(_0x1998('0x11'));var utils=require(_0x1998('0x12'));var config=require(_0x1998('0x13'));var db=require(_0x1998('0x14'))['db'];function respondWithStatusCode(_0x2bc60d,_0x42337f){_0x42337f=_0x42337f||0xcc;return function(_0x4b7557){if(_0x4b7557){return _0x2bc60d['sendStatus'](_0x42337f);}return _0x2bc60d[_0x1998('0x15')](_0x42337f)['end']();};}function respondWithResult(_0x577e11,_0x5ef0c8){_0x5ef0c8=_0x5ef0c8||0xc8;return function(_0x16b208){if(_0x16b208){return _0x577e11[_0x1998('0x15')](_0x5ef0c8)[_0x1998('0x16')](_0x16b208);}};}function respondWithFilteredResult(_0x20d361,_0x57cb73){return function(_0xcf4bff){if(_0xcf4bff){var _0x308266=_0xcf4bff[_0x1998('0x17')],_0x17b236=_0x57cb73['offset'],_0x526b77=_0x57cb73[_0x1998('0x18')]+_0x57cb73[_0x1998('0x19')],_0x4d7ede;if(_0x526b77>=_0x308266){_0x526b77=_0x308266;_0x4d7ede=0xc8;}else{_0x4d7ede=0xce;}_0x20d361[_0x1998('0x15')](_0x4d7ede);return _0x20d361[_0x1998('0x1a')](_0x1998('0x1b'),_0x17b236+'-'+_0x526b77+'/'+_0x308266)['json'](_0xcf4bff);}return null;};}function patchUpdates(_0x1d7ec9){return function(_0x501cb3){try{jsonpatch[_0x1998('0x1c')](_0x501cb3,_0x1d7ec9,!![]);}catch(_0x294f12){return BPromise['reject'](_0x294f12);}return _0x501cb3[_0x1998('0x1d')]();};}function saveUpdates(_0x1b42d5,_0x4d4e89){return function(_0x192d41){if(_0x192d41){return _0x192d41['update'](_0x1b42d5)[_0x1998('0x1e')](function(_0x2e592c){return _0x2e592c;});}return null;};}function removeEntity(_0x4dc4a7,_0x2eab3b){return function(_0x24b9e8){if(_0x24b9e8){return _0x24b9e8['destroy']()[_0x1998('0x1e')](function(){_0x4dc4a7[_0x1998('0x15')](0xcc)[_0x1998('0x1f')]();});}};}function handleEntityNotFound(_0x5228a7,_0x1e9a39){return function(_0x160fae){if(!_0x160fae){_0x5228a7[_0x1998('0x20')](0x194);}return _0x160fae;};}function handleError(_0x3ec875,_0x1a477a){_0x1a477a=_0x1a477a||0x1f4;return function(_0x4b3c13){logger[_0x1998('0x21')](_0x4b3c13[_0x1998('0x22')]);if(_0x4b3c13['name']){delete _0x4b3c13['name'];}_0x3ec875[_0x1998('0x15')](_0x1a477a)[_0x1998('0x23')](_0x4b3c13);};}exports[_0x1998('0x24')]=function(_0xcd422c,_0x31489c){var _0x284986={},_0x3de9c1={},_0x1a3e6f={'count':0x0,'rows':[]};var _0x5d441b=_[_0x1998('0x25')](db[_0x1998('0x26')][_0x1998('0x27')],function(_0x5b9764){return{'name':_0x5b9764['fieldName'],'type':_0x5b9764[_0x1998('0x28')]['key']};});_0x3de9c1[_0x1998('0x29')]=_[_0x1998('0x2a')](_['map'](_0x5d441b,'name'),[_0x1998('0x2b')]);_0x3de9c1[_0x1998('0x2c')]=_[_0x1998('0x2d')](_0xcd422c['query']);_0x3de9c1['filters']=_[_0x1998('0x2e')](_0x3de9c1['model'],_0x3de9c1[_0x1998('0x2c')]);_0x284986[_0x1998('0x2f')]=_[_0x1998('0x2e')](_0x3de9c1[_0x1998('0x29')],qs[_0x1998('0x30')](_0xcd422c['query'][_0x1998('0x30')]));_0x284986[_0x1998('0x2f')]=_0x284986[_0x1998('0x2f')][_0x1998('0x31')]?_0x284986[_0x1998('0x2f')]:_0x3de9c1[_0x1998('0x29')];if(!_0xcd422c[_0x1998('0x2c')][_0x1998('0x32')](_0x1998('0x33'))){_0x284986[_0x1998('0x19')]=qs[_0x1998('0x19')](_0xcd422c[_0x1998('0x2c')][_0x1998('0x19')]);_0x284986[_0x1998('0x18')]=qs[_0x1998('0x18')](_0xcd422c['query']['offset']);}_0x284986[_0x1998('0x34')]=qs[_0x1998('0x35')](_0xcd422c[_0x1998('0x2c')][_0x1998('0x35')]);_0x284986[_0x1998('0x36')]=qs['filters'](_['pick'](_0xcd422c[_0x1998('0x2c')],_0x3de9c1[_0x1998('0x37')]),_0x5d441b);if(_0xcd422c[_0x1998('0x2c')][_0x1998('0x38')]){_0x284986[_0x1998('0x36')]=_[_0x1998('0x39')](_0x284986[_0x1998('0x36')],{'$or':_[_0x1998('0x25')](_0x5d441b,function(_0xde017b){if(_0xde017b[_0x1998('0x28')]!=='VIRTUAL'){var _0x4aea9b={};_0x4aea9b[_0xde017b[_0x1998('0x3a')]]={'$like':'%'+_0xcd422c[_0x1998('0x2c')][_0x1998('0x38')]+'%'};return _0x4aea9b;}})});}_0x284986=_[_0x1998('0x39')]({},_0x284986,_0xcd422c[_0x1998('0x3b')]);var _0x2657b5={'where':_0x284986[_0x1998('0x36')]};return db[_0x1998('0x26')][_0x1998('0x17')](_0x2657b5)['then'](function(_0x5a323c){_0x1a3e6f[_0x1998('0x17')]=_0x5a323c;if(_0xcd422c['query']['includeAll']){_0x284986[_0x1998('0x3c')]=[{'all':!![]}];}return db[_0x1998('0x26')]['findAll'](_0x284986);})[_0x1998('0x1e')](function(_0x3fce62){_0x1a3e6f[_0x1998('0x3d')]=_0x3fce62;return _0x1a3e6f;})[_0x1998('0x1e')](respondWithFilteredResult(_0x31489c,_0x284986))[_0x1998('0x3e')](handleError(_0x31489c,null));};exports[_0x1998('0x3f')]=function(_0x1f8671,_0x4a82ba){var _0x3b866d={'raw':![],'where':{'id':_0x1f8671[_0x1998('0x40')]['id']}},_0x4cb1fa={};_0x4cb1fa[_0x1998('0x29')]=_[_0x1998('0x2d')](db[_0x1998('0x26')][_0x1998('0x27')]);_0x4cb1fa[_0x1998('0x2c')]=_[_0x1998('0x2d')](_0x1f8671['query']);_0x4cb1fa[_0x1998('0x37')]=_[_0x1998('0x2e')](_0x4cb1fa[_0x1998('0x29')],_0x4cb1fa[_0x1998('0x2c')]);_0x3b866d[_0x1998('0x2f')]=_[_0x1998('0x2e')](_0x4cb1fa['model'],qs['fields'](_0x1f8671['query']['fields']));_0x3b866d[_0x1998('0x2f')]=_0x3b866d[_0x1998('0x2f')]['length']?_0x3b866d[_0x1998('0x2f')]:_0x4cb1fa['model'];if(_0x1f8671['query'][_0x1998('0x41')]){_0x3b866d[_0x1998('0x3c')]=[{'all':!![]}];}_0x3b866d=_[_0x1998('0x39')]({},_0x3b866d,_0x1f8671['options']);return db[_0x1998('0x26')][_0x1998('0x42')](_0x3b866d)[_0x1998('0x1e')](handleEntityNotFound(_0x4a82ba,null))[_0x1998('0x1e')](respondWithResult(_0x4a82ba,null))['catch'](handleError(_0x4a82ba,null));};exports[_0x1998('0x43')]=function(_0x447fdd,_0xbd584d){return db[_0x1998('0x26')][_0x1998('0x43')](_0x447fdd[_0x1998('0x44')],{})[_0x1998('0x1e')](respondWithResult(_0xbd584d,0xc9))[_0x1998('0x3e')](handleError(_0xbd584d,null));};exports[_0x1998('0x45')]=function(_0x179e8d,_0x1a2246){if(_0x179e8d[_0x1998('0x44')]['id']){delete _0x179e8d[_0x1998('0x44')]['id'];}delete _0x179e8d[_0x1998('0x44')]['duration'];delete _0x179e8d[_0x1998('0x44')]['createdAt'];delete _0x179e8d['body'][_0x1998('0x46')];delete _0x179e8d[_0x1998('0x44')][_0x1998('0x47')];return db[_0x1998('0x26')][_0x1998('0x42')]({'where':{'id':_0x179e8d[_0x1998('0x40')]['id']}})[_0x1998('0x1e')](handleEntityNotFound(_0x1a2246,null))['then'](saveUpdates(_0x179e8d[_0x1998('0x44')],null))[_0x1998('0x1e')](respondWithResult(_0x1a2246,null))['catch'](handleError(_0x1a2246,null));};exports[_0x1998('0x48')]=function(_0x5bdbdf,_0x141d7d){return db[_0x1998('0x26')]['describe']()[_0x1998('0x1e')](respondWithResult(_0x141d7d,null))[_0x1998('0x3e')](handleError(_0x141d7d,null));};exports['download']=function(_0x38c2ce,_0x462331,_0x2bfdd6){var _0x55faab=require(_0x1998('0x49'));var _0x2c401b=![];var _0x4db1d7={};if(_0x38c2ce['query'][_0x1998('0x28')]&&_0x38c2ce[_0x1998('0x2c')]['type']===_0x1998('0x4a')){_0x4db1d7[_0x1998('0x4a')]=_0x38c2ce['params']['id'];}else{_0x4db1d7['id']=_0x38c2ce[_0x1998('0x40')]['id'];}return db[_0x1998('0x26')][_0x1998('0x42')]({'where':_0x4db1d7,'attributes':['id',_0x1998('0x47')],'raw':!![]})[_0x1998('0x1e')](handleEntityNotFound(_0x462331,null))['then'](function(_0x57a9cb){if(_0x57a9cb){var _0x456023=path[_0x1998('0x4b')](config[_0x1998('0x4c')],_0x1998('0x4d'),_0x57a9cb[_0x1998('0x47')]);var _0x44006e=util[_0x1998('0x2b')](_0x1998('0x4e'),_0x456023);if(fs['existsSync'](_0x44006e)){_0x2c401b=!![];return _0x55faab[_0x1998('0x4f')](_0x44006e,_0x456023,config[_0x1998('0x50')][_0x1998('0x51')])[_0x1998('0x1e')](function(){return _0x57a9cb;});}return _0x57a9cb;}})['then'](function(_0x1b9cab){if(_0x1b9cab){var _0x226c6e=path[_0x1998('0x4b')](config[_0x1998('0x4c')],_0x1998('0x4d'),_0x1b9cab['value']);if(!fs[_0x1998('0x52')](_0x226c6e)){throw new db[(_0x1998('0x53'))][(_0x1998('0x54'))](_0x1998('0x55'));}if(_0x1b9cab[_0x1998('0x56')]){return _0x462331['download'](_0x226c6e,_0x1b9cab['filename']+path[_0x1998('0x57')](_0x226c6e),function(){if(_0x2c401b){fs[_0x1998('0x58')](_0x226c6e);}});}else{return _0x462331[_0x1998('0x59')](_0x226c6e,function(_0x6bb568){if(_0x2c401b){fs['unlink'](_0x226c6e);}});}}})['catch'](function(_0x23e0b1){if(_0x23e0b1['message']===_0x1998('0x55')){_0x462331[_0x1998('0x15')](0x194)['send'](_0x1998('0x5a'));}else{return handleError(_0x462331,null);}});};exports[_0x1998('0x5b')]=function(_0x487105,_0x4c07a1){return db[_0x1998('0x26')]['find']({'where':{'id':_0x487105[_0x1998('0x40')]['id']}})[_0x1998('0x1e')](function(_0x58cb15){if(!_0x58cb15)throw new ReferenceError(_0x1998('0x5c'));return _0x58cb15;})[_0x1998('0x1e')](function(_0x3c0ca8){var _0x2e298d=path[_0x1998('0x4b')](config[_0x1998('0x4c')],'server/files/screen_recordings',_0x3c0ca8[_0x1998('0x47')]);logger[_0x1998('0x5d')](_0x1998('0x5e'),_0x2e298d);if(!_[_0x1998('0x5f')](_0x3c0ca8['value'])&&fs[_0x1998('0x52')](_0x2e298d)){logger[_0x1998('0x5d')](_0x1998('0x60')+_0x2e298d+_0x1998('0x61'));fs[_0x1998('0x62')](_0x2e298d);}_0x2e298d=_0x2e298d+_0x1998('0x63');if(!_[_0x1998('0x5f')](_0x3c0ca8[_0x1998('0x47')])&&fs[_0x1998('0x52')](_0x2e298d)){logger['info'](_0x1998('0x60')+_0x2e298d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2e298d);}return _0x3c0ca8;})['then'](function(_0x3f44e5){if(!_0x3f44e5)throw new InternalError();return _0x3f44e5[_0x1998('0x5b')]();})[_0x1998('0x1e')](function(){_0x4c07a1['status'](0xcc)['end']();})[_0x1998('0x3e')](handleError(_0x4c07a1,null));}; \ No newline at end of file +var _0x4fba=['../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','save','then','destroy','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','keys','include','create','body','update','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','find','join','root','%s.cypher','existsSync','recording','server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5482ec,_0x23f6cd){var _0x197283=function(_0x6f592a){while(--_0x6f592a){_0x5482ec['push'](_0x5482ec['shift']());}};_0x197283(++_0x23f6cd);}(_0x4fba,0x11e));var _0xa4fb=function(_0x4517b2,_0x11a01a){_0x4517b2=_0x4517b2-0x0;var _0x3ee454=_0x4fba[_0x4517b2];return _0x3ee454;};'use strict';var pdf=require(_0xa4fb('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa4fb('0x1'));var jsonpatch=require(_0xa4fb('0x2'));var rp=require(_0xa4fb('0x3'));var moment=require(_0xa4fb('0x4'));var BPromise=require(_0xa4fb('0x5'));var Mustache=require(_0xa4fb('0x6'));var util=require(_0xa4fb('0x7'));var path=require('path');var sox=require(_0xa4fb('0x8'));var csv=require(_0xa4fb('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa4fb('0xa'));var squel=require(_0xa4fb('0xb'));var crypto=require(_0xa4fb('0xc'));var jsforce=require(_0xa4fb('0xd'));var deskjs=require(_0xa4fb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa4fb('0xf'));var Papa=require(_0xa4fb('0x10'));var Redis=require(_0xa4fb('0x11'));var authService=require(_0xa4fb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa4fb('0x13'));var hardwareService=require(_0xa4fb('0x14'));var logger=require(_0xa4fb('0x15'))(_0xa4fb('0x16'));var utils=require(_0xa4fb('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26dbce,_0xadeb8f){_0xadeb8f=_0xadeb8f||0xcc;return function(_0x1f032f){if(_0x1f032f){return _0x26dbce[_0xa4fb('0x18')](_0xadeb8f);}return _0x26dbce['status'](_0xadeb8f)[_0xa4fb('0x19')]();};}function respondWithResult(_0x3fea02,_0x2fb990){_0x2fb990=_0x2fb990||0xc8;return function(_0x3b3383){if(_0x3b3383){return _0x3fea02[_0xa4fb('0x1a')](_0x2fb990)['json'](_0x3b3383);}};}function respondWithFilteredResult(_0x3ca782,_0x112594){return function(_0x4efbf5){if(_0x4efbf5){var _0x3969da=_0x4efbf5['count'],_0x8aa969=_0x112594[_0xa4fb('0x1b')],_0x3155cb=_0x112594[_0xa4fb('0x1b')]+_0x112594[_0xa4fb('0x1c')],_0x4ce68a;if(_0x3155cb>=_0x3969da){_0x3155cb=_0x3969da;_0x4ce68a=0xc8;}else{_0x4ce68a=0xce;}_0x3ca782[_0xa4fb('0x1a')](_0x4ce68a);return _0x3ca782[_0xa4fb('0x1d')](_0xa4fb('0x1e'),_0x8aa969+'-'+_0x3155cb+'/'+_0x3969da)[_0xa4fb('0x1f')](_0x4efbf5);}return null;};}function patchUpdates(_0x55e726){return function(_0x5baf45){try{jsonpatch[_0xa4fb('0x20')](_0x5baf45,_0x55e726,!![]);}catch(_0x1405ed){return BPromise['reject'](_0x1405ed);}return _0x5baf45[_0xa4fb('0x21')]();};}function saveUpdates(_0x4a32af,_0x318af4){return function(_0x17e721){if(_0x17e721){return _0x17e721['update'](_0x4a32af)[_0xa4fb('0x22')](function(_0x3847f4){return _0x3847f4;});}return null;};}function removeEntity(_0x23e411,_0x3b0864){return function(_0xb824c6){if(_0xb824c6){return _0xb824c6[_0xa4fb('0x23')]()[_0xa4fb('0x22')](function(){_0x23e411[_0xa4fb('0x1a')](0xcc)[_0xa4fb('0x19')]();});}};}function handleEntityNotFound(_0x93b16a,_0xb933e2){return function(_0x52fc90){if(!_0x52fc90){_0x93b16a['sendStatus'](0x194);}return _0x52fc90;};}function handleError(_0xe10d86,_0x5bb2f0){_0x5bb2f0=_0x5bb2f0||0x1f4;return function(_0x3a234f){logger['error'](_0x3a234f[_0xa4fb('0x24')]);if(_0x3a234f[_0xa4fb('0x25')]){delete _0x3a234f['name'];}_0xe10d86[_0xa4fb('0x1a')](_0x5bb2f0)[_0xa4fb('0x26')](_0x3a234f);};}exports[_0xa4fb('0x27')]=function(_0x2acc3e,_0x29293d){var _0x420f9d={},_0xa2c3e8={},_0x1a46b1={'count':0x0,'rows':[]};var _0x185d86=_[_0xa4fb('0x28')](db[_0xa4fb('0x29')][_0xa4fb('0x2a')],function(_0x465cfc){return{'name':_0x465cfc[_0xa4fb('0x2b')],'type':_0x465cfc[_0xa4fb('0x2c')]['key']};});_0xa2c3e8[_0xa4fb('0x2d')]=_[_0xa4fb('0x2e')](_[_0xa4fb('0x28')](_0x185d86,'name'),[_0xa4fb('0x2f')]);_0xa2c3e8[_0xa4fb('0x30')]=_['keys'](_0x2acc3e[_0xa4fb('0x30')]);_0xa2c3e8[_0xa4fb('0x31')]=_[_0xa4fb('0x32')](_0xa2c3e8[_0xa4fb('0x2d')],_0xa2c3e8['query']);_0x420f9d[_0xa4fb('0x33')]=_[_0xa4fb('0x32')](_0xa2c3e8[_0xa4fb('0x2d')],qs['fields'](_0x2acc3e[_0xa4fb('0x30')][_0xa4fb('0x34')]));_0x420f9d[_0xa4fb('0x33')]=_0x420f9d[_0xa4fb('0x33')][_0xa4fb('0x35')]?_0x420f9d[_0xa4fb('0x33')]:_0xa2c3e8['model'];if(!_0x2acc3e[_0xa4fb('0x30')][_0xa4fb('0x36')](_0xa4fb('0x37'))){_0x420f9d['limit']=qs[_0xa4fb('0x1c')](_0x2acc3e[_0xa4fb('0x30')]['limit']);_0x420f9d[_0xa4fb('0x1b')]=qs['offset'](_0x2acc3e[_0xa4fb('0x30')][_0xa4fb('0x1b')]);}_0x420f9d[_0xa4fb('0x38')]=qs[_0xa4fb('0x39')](_0x2acc3e[_0xa4fb('0x30')]['sort']);_0x420f9d[_0xa4fb('0x3a')]=qs['filters'](_[_0xa4fb('0x3b')](_0x2acc3e[_0xa4fb('0x30')],_0xa2c3e8[_0xa4fb('0x31')]),_0x185d86);if(_0x2acc3e[_0xa4fb('0x30')][_0xa4fb('0x3c')]){_0x420f9d[_0xa4fb('0x3a')]=_['merge'](_0x420f9d[_0xa4fb('0x3a')],{'$or':_[_0xa4fb('0x28')](_0x185d86,function(_0x210c56){if(_0x210c56[_0xa4fb('0x2c')]!==_0xa4fb('0x3d')){var _0x3dc969={};_0x3dc969[_0x210c56[_0xa4fb('0x25')]]={'$like':'%'+_0x2acc3e['query'][_0xa4fb('0x3c')]+'%'};return _0x3dc969;}})});}_0x420f9d=_[_0xa4fb('0x3e')]({},_0x420f9d,_0x2acc3e[_0xa4fb('0x3f')]);var _0x3bffe4={'where':_0x420f9d[_0xa4fb('0x3a')]};return db[_0xa4fb('0x29')][_0xa4fb('0x40')](_0x3bffe4)[_0xa4fb('0x22')](function(_0x459295){_0x1a46b1[_0xa4fb('0x40')]=_0x459295;if(_0x2acc3e[_0xa4fb('0x30')][_0xa4fb('0x41')]){_0x420f9d['include']=[{'all':!![]}];}return db[_0xa4fb('0x29')][_0xa4fb('0x42')](_0x420f9d);})[_0xa4fb('0x22')](function(_0x46230b){_0x1a46b1[_0xa4fb('0x43')]=_0x46230b;return _0x1a46b1;})[_0xa4fb('0x22')](respondWithFilteredResult(_0x29293d,_0x420f9d))[_0xa4fb('0x44')](handleError(_0x29293d,null));};exports[_0xa4fb('0x45')]=function(_0x213c49,_0x42daed){var _0x42644a={'raw':![],'where':{'id':_0x213c49['params']['id']}},_0x20ce34={};_0x20ce34[_0xa4fb('0x2d')]=_['keys'](db[_0xa4fb('0x29')][_0xa4fb('0x2a')]);_0x20ce34['query']=_[_0xa4fb('0x46')](_0x213c49[_0xa4fb('0x30')]);_0x20ce34['filters']=_[_0xa4fb('0x32')](_0x20ce34['model'],_0x20ce34['query']);_0x42644a['attributes']=_[_0xa4fb('0x32')](_0x20ce34[_0xa4fb('0x2d')],qs[_0xa4fb('0x34')](_0x213c49[_0xa4fb('0x30')][_0xa4fb('0x34')]));_0x42644a['attributes']=_0x42644a[_0xa4fb('0x33')][_0xa4fb('0x35')]?_0x42644a[_0xa4fb('0x33')]:_0x20ce34[_0xa4fb('0x2d')];if(_0x213c49[_0xa4fb('0x30')]['includeAll']){_0x42644a[_0xa4fb('0x47')]=[{'all':!![]}];}_0x42644a=_[_0xa4fb('0x3e')]({},_0x42644a,_0x213c49[_0xa4fb('0x3f')]);return db['ScreenRecording']['find'](_0x42644a)['then'](handleEntityNotFound(_0x42daed,null))['then'](respondWithResult(_0x42daed,null))[_0xa4fb('0x44')](handleError(_0x42daed,null));};exports[_0xa4fb('0x48')]=function(_0x33ca0e,_0x3889d8){return db['ScreenRecording'][_0xa4fb('0x48')](_0x33ca0e[_0xa4fb('0x49')],{})[_0xa4fb('0x22')](respondWithResult(_0x3889d8,0xc9))[_0xa4fb('0x44')](handleError(_0x3889d8,null));};exports[_0xa4fb('0x4a')]=function(_0x23880d,_0x124d57){if(_0x23880d[_0xa4fb('0x49')]['id']){delete _0x23880d['body']['id'];}delete _0x23880d[_0xa4fb('0x49')][_0xa4fb('0x4b')];delete _0x23880d['body'][_0xa4fb('0x4c')];delete _0x23880d['body']['closedAt'];delete _0x23880d[_0xa4fb('0x49')][_0xa4fb('0x4d')];return db[_0xa4fb('0x29')]['find']({'where':{'id':_0x23880d[_0xa4fb('0x4e')]['id']}})[_0xa4fb('0x22')](handleEntityNotFound(_0x124d57,null))[_0xa4fb('0x22')](saveUpdates(_0x23880d[_0xa4fb('0x49')],null))[_0xa4fb('0x22')](respondWithResult(_0x124d57,null))[_0xa4fb('0x44')](handleError(_0x124d57,null));};exports[_0xa4fb('0x4f')]=function(_0x529a4f,_0x2fcea3){return db['ScreenRecording'][_0xa4fb('0x4f')]()['then'](respondWithResult(_0x2fcea3,null))['catch'](handleError(_0x2fcea3,null));};exports[_0xa4fb('0x50')]=function(_0x19955b,_0x22cd89,_0x4e54c9){var _0x3fbf9c=require(_0xa4fb('0x51'));var _0x4d4541=![];var _0x493108={};if(_0x19955b[_0xa4fb('0x30')][_0xa4fb('0x2c')]&&_0x19955b[_0xa4fb('0x30')][_0xa4fb('0x2c')]===_0xa4fb('0x52')){_0x493108[_0xa4fb('0x52')]=_0x19955b[_0xa4fb('0x4e')]['id'];}else{_0x493108['id']=_0x19955b[_0xa4fb('0x4e')]['id'];}return db[_0xa4fb('0x29')][_0xa4fb('0x53')]({'where':_0x493108,'attributes':['id',_0xa4fb('0x4d')],'raw':!![]})[_0xa4fb('0x22')](handleEntityNotFound(_0x22cd89,null))[_0xa4fb('0x22')](function(_0x335fda){if(_0x335fda){var _0x299942=path[_0xa4fb('0x54')](config[_0xa4fb('0x55')],'server/files/screen_recordings',_0x335fda[_0xa4fb('0x4d')]);var _0x569fde=util[_0xa4fb('0x2f')](_0xa4fb('0x56'),_0x299942);if(fs[_0xa4fb('0x57')](_0x569fde)){_0x4d4541=!![];return _0x3fbf9c['decryptFile'](_0x569fde,_0x299942,config['secrets'][_0xa4fb('0x58')])[_0xa4fb('0x22')](function(){return _0x335fda;});}return _0x335fda;}})['then'](function(_0x6a78ea){if(_0x6a78ea){var _0x16ac5c=path[_0xa4fb('0x54')](config[_0xa4fb('0x55')],_0xa4fb('0x59'),_0x6a78ea[_0xa4fb('0x4d')]);if(!fs[_0xa4fb('0x57')](_0x16ac5c)){throw new db[(_0xa4fb('0x5a'))]['ValidationError'](_0xa4fb('0x5b'));}if(_0x6a78ea[_0xa4fb('0x5c')]){return _0x22cd89[_0xa4fb('0x50')](_0x16ac5c,_0x6a78ea[_0xa4fb('0x5c')]+path[_0xa4fb('0x5d')](_0x16ac5c),function(){if(_0x4d4541){fs['unlink'](_0x16ac5c);}});}else{return _0x22cd89['download'](_0x16ac5c,function(_0x4cdd8b){if(_0x4d4541){fs[_0xa4fb('0x5e')](_0x16ac5c);}});}}})['catch'](function(_0x2172c6){if(_0x2172c6[_0xa4fb('0x5f')]==='ScreenRecording\x20not\x20found'){_0x22cd89[_0xa4fb('0x1a')](0x194)[_0xa4fb('0x26')](_0xa4fb('0x60'));}else{return handleError(_0x22cd89,null);}});};exports['destroy']=function(_0x39ba1b,_0x4441a4){return db[_0xa4fb('0x29')][_0xa4fb('0x53')]({'where':{'id':_0x39ba1b['params']['id']}})[_0xa4fb('0x22')](function(_0xafe8ca){if(!_0xafe8ca)throw new ReferenceError('Entity\x20not\x20found');return _0xafe8ca;})[_0xa4fb('0x22')](function(_0x1975c0){var _0xdade81=path[_0xa4fb('0x54')](config[_0xa4fb('0x55')],_0xa4fb('0x59'),_0x1975c0[_0xa4fb('0x4d')]);logger['info'](_0xa4fb('0x61'),_0xdade81);if(!_[_0xa4fb('0x62')](_0x1975c0[_0xa4fb('0x4d')])&&fs['existsSync'](_0xdade81)){logger[_0xa4fb('0x63')](_0xa4fb('0x64')+_0xdade81+_0xa4fb('0x65'));fs[_0xa4fb('0x66')](_0xdade81);}_0xdade81=_0xdade81+'.cypher';if(!_['isNil'](_0x1975c0['value'])&&fs[_0xa4fb('0x57')](_0xdade81)){logger['info'](_0xa4fb('0x64')+_0xdade81+_0xa4fb('0x65'));fs[_0xa4fb('0x66')](_0xdade81);}return _0x1975c0;})[_0xa4fb('0x22')](function(_0xccf16b){if(!_0xccf16b)throw new InternalError();return _0xccf16b[_0xa4fb('0x23')]();})[_0xa4fb('0x22')](function(){_0x4441a4[_0xa4fb('0x1a')](0xcc)[_0xa4fb('0x19')]();})[_0xa4fb('0x44')](handleError(_0x4441a4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index bd665ef..47abb11 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 _0x799b=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1d53a8,_0x533494){var _0x2a3bbc=function(_0x127c2a){while(--_0x127c2a){_0x1d53a8['push'](_0x1d53a8['shift']());}};_0x2a3bbc(++_0x533494);}(_0x799b,0x18f));var _0xb799=function(_0x30463a,_0x154f4b){_0x30463a=_0x30463a-0x0;var _0x2b556b=_0x799b[_0x30463a];return _0x2b556b;};'use strict';var _=require(_0xb799('0x0'));var util=require(_0xb799('0x1'));var logger=require('../../config/logger')(_0xb799('0x2'));var moment=require(_0xb799('0x3'));var BPromise=require(_0xb799('0x4'));var rp=require(_0xb799('0x5'));var fs=require('fs');var path=require(_0xb799('0x6'));var rimraf=require(_0xb799('0x7'));var config=require(_0xb799('0x8'));var attributes=require(_0xb799('0x9'));module[_0xb799('0xa')]=function(_0x549bb8,_0x2eb9f5){return _0x549bb8[_0xb799('0xb')](_0xb799('0xc'),attributes,{'tableName':_0xb799('0xd'),'paranoid':![],'indexes':[{'name':_0xb799('0xe'),'fields':[_0xb799('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf144=['../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x451b60,_0x4dff45){var _0x2888fd=function(_0x25a6b2){while(--_0x25a6b2){_0x451b60['push'](_0x451b60['shift']());}};_0x2888fd(++_0x4dff45);}(_0xf144,0x7f));var _0x4f14=function(_0x27b59c,_0x560322){_0x27b59c=_0x27b59c-0x0;var _0xf5b383=_0xf144[_0x27b59c];return _0xf5b383;};'use strict';var _=require('lodash');var util=require(_0x4f14('0x0'));var logger=require(_0x4f14('0x1'))(_0x4f14('0x2'));var moment=require(_0x4f14('0x3'));var BPromise=require(_0x4f14('0x4'));var rp=require(_0x4f14('0x5'));var fs=require('fs');var path=require(_0x4f14('0x6'));var rimraf=require(_0x4f14('0x7'));var config=require(_0x4f14('0x8'));var attributes=require(_0x4f14('0x9'));module[_0x4f14('0xa')]=function(_0xf5e3d5,_0x511001){return _0xf5e3d5[_0x4f14('0xb')](_0x4f14('0xc'),attributes,{'tableName':_0x4f14('0xd'),'paranoid':![],'indexes':[{'name':_0x4f14('0xe'),'fields':[_0x4f14('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index ea956ff..f48319e 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(_0x58b5ad,_0x3136cc){var _0xb11e73=function(_0x42fe65){while(--_0x42fe65){_0x58b5ad['push'](_0x58b5ad['shift']());}};_0xb11e73(++_0x3136cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x1e0502,_0xebe366){var _0x5a267c=function(_0x529962){while(--_0x529962){_0x1e0502['push'](_0x1e0502['shift']());}};_0x5a267c(++_0xebe366);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 db6b94e..21bb040 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 _0x2a2b=['gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','file','logologin','post','single','addLogoLogin','favicon','/:id/favicon','isAuthenticated','update','exports','path','express','Router','../../components/interaction/service','../../config/environment','./setting.controller','index','get','/:id','show','/:id/logo','getLogo','/:id/logo_login'];(function(_0x44a2de,_0x1b7846){var _0xd465b6=function(_0x5258f5){while(--_0x5258f5){_0x44a2de['push'](_0x44a2de['shift']());}};_0xd465b6(++_0x1b7846);}(_0x2a2b,0xc5));var _0xb2a2=function(_0x673e91,_0x5066f8){_0x673e91=_0x673e91-0x0;var _0x3ee5cb=_0x2a2b[_0x673e91];return _0x3ee5cb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2a2('0x0'));var timeout=require('connect-timeout');var express=require(_0xb2a2('0x1'));var router=express[_0xb2a2('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb2a2('0x3'));var config=require(_0xb2a2('0x4'));var controller=require(_0xb2a2('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xb2a2('0x6')]);router[_0xb2a2('0x7')](_0xb2a2('0x8'),controller[_0xb2a2('0x9')]);router[_0xb2a2('0x7')](_0xb2a2('0xa'),controller[_0xb2a2('0xb')]);router[_0xb2a2('0x7')](_0xb2a2('0xc'),controller['getLogoLogin']);router[_0xb2a2('0x7')]('/:id/gdpr',controller[_0xb2a2('0xd')]);router[_0xb2a2('0x7')](_0xb2a2('0xe'),controller['getPreferred']);router[_0xb2a2('0x7')]('/:id/favicon',controller[_0xb2a2('0xf')]);var upload=multer({'storage':multer[_0xb2a2('0x10')]({'destination':function(_0x9f5e67,_0x2b7f5a,_0x115164){_0x115164(null,path[_0xb2a2('0x11')](config[_0xb2a2('0x12')],_0xb2a2('0x13')));},'filename':function(_0x107312,_0x1a659d,_0x3ccae0){_0x3ccae0(null,util[_0xb2a2('0x14')](_0xb2a2('0x15'),_0xb2a2('0x16'),path[_0xb2a2('0x17')](_0x1a659d[_0xb2a2('0x18')])));}})});router['post']('/:id/logo',upload['single'](_0xb2a2('0x19')),controller['addLogo']);var upload=multer({'storage':multer[_0xb2a2('0x10')]({'destination':function(_0x375ed6,_0x387a88,_0x115655){_0x115655(null,path[_0xb2a2('0x11')](config[_0xb2a2('0x12')],'server/files/images/logos/'));},'filename':function(_0x55a42d,_0x274468,_0x8a7b8f){_0x8a7b8f(null,util[_0xb2a2('0x14')](_0xb2a2('0x15'),_0xb2a2('0x1a'),path['extname'](_0x274468[_0xb2a2('0x18')])));}})});router[_0xb2a2('0x1b')]('/:id/logo_login',upload[_0xb2a2('0x1c')](_0xb2a2('0x19')),controller[_0xb2a2('0x1d')]);var upload=multer({'storage':multer[_0xb2a2('0x10')]({'destination':function(_0x4fa6c7,_0x270d01,_0x1677f5){_0x1677f5(null,path['join'](config[_0xb2a2('0x12')],_0xb2a2('0x13')));},'filename':function(_0x488207,_0x4cf597,_0x42cd42){_0x42cd42(null,util['format']('%s%s','preferred',path[_0xb2a2('0x17')](_0x4cf597[_0xb2a2('0x18')])));}})});router[_0xb2a2('0x1b')](_0xb2a2('0xe'),upload[_0xb2a2('0x1c')](_0xb2a2('0x19')),controller['addPreferred']);var upload=multer({'storage':multer[_0xb2a2('0x10')]({'destination':function(_0x1b9d31,_0x5a6c97,_0x38f2d9){_0x38f2d9(null,path[_0xb2a2('0x11')](config[_0xb2a2('0x12')],_0xb2a2('0x13')));},'filename':function(_0x27d35b,_0x25056b,_0x2669b6){_0x2669b6(null,util[_0xb2a2('0x14')]('%s%s',_0xb2a2('0x1e'),path[_0xb2a2('0x17')](_0x25056b[_0xb2a2('0x18')])));}})});router[_0xb2a2('0x1b')](_0xb2a2('0x1f'),upload['single'](_0xb2a2('0x19')),controller['addFavicon']);router['put'](_0xb2a2('0x8'),auth[_0xb2a2('0x20')](),controller[_0xb2a2('0x21')]);module[_0xb2a2('0x22')]=router; \ No newline at end of file +var _0x2830=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','file','addLogo','logologin','post','single','preferred','addPreferred','/:id/favicon','addFavicon','put','/:id','update'];(function(_0x1c335e,_0x482132){var _0x3c2ac8=function(_0x335a13){while(--_0x335a13){_0x1c335e['push'](_0x1c335e['shift']());}};_0x3c2ac8(++_0x482132);}(_0x2830,0x1d4));var _0x0283=function(_0x43caef,_0x5ea064){_0x43caef=_0x43caef-0x0;var _0x2f9fb2=_0x2830[_0x43caef];return _0x2f9fb2;};'use strict';var multer=require(_0x0283('0x0'));var util=require(_0x0283('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0283('0x2'));var router=express[_0x0283('0x3')]();var auth=require(_0x0283('0x4'));var interaction=require(_0x0283('0x5'));var config=require(_0x0283('0x6'));var controller=require('./setting.controller');router['get']('/',auth[_0x0283('0x7')](),controller[_0x0283('0x8')]);router[_0x0283('0x9')]('/:id',controller[_0x0283('0xa')]);router[_0x0283('0x9')](_0x0283('0xb'),controller[_0x0283('0xc')]);router[_0x0283('0x9')](_0x0283('0xd'),controller[_0x0283('0xe')]);router[_0x0283('0x9')](_0x0283('0xf'),controller[_0x0283('0x10')]);router[_0x0283('0x9')](_0x0283('0x11'),controller[_0x0283('0x12')]);router[_0x0283('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x0283('0x13')]({'destination':function(_0x2d4bb0,_0x39331e,_0x468b7f){_0x468b7f(null,path[_0x0283('0x14')](config['root'],_0x0283('0x15')));},'filename':function(_0x24d4b1,_0x591a02,_0x98fe5){_0x98fe5(null,util[_0x0283('0x16')](_0x0283('0x17'),_0x0283('0x18'),path[_0x0283('0x19')](_0x591a02[_0x0283('0x1a')])));}})});router['post']('/:id/logo',upload['single'](_0x0283('0x1b')),controller[_0x0283('0x1c')]);var upload=multer({'storage':multer[_0x0283('0x13')]({'destination':function(_0x926c2b,_0x41c030,_0x8c1712){_0x8c1712(null,path[_0x0283('0x14')](config['root'],_0x0283('0x15')));},'filename':function(_0x754056,_0x4b2924,_0x640f94){_0x640f94(null,util[_0x0283('0x16')](_0x0283('0x17'),_0x0283('0x1d'),path[_0x0283('0x19')](_0x4b2924[_0x0283('0x1a')])));}})});router[_0x0283('0x1e')](_0x0283('0xd'),upload[_0x0283('0x1f')](_0x0283('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x0283('0x13')]({'destination':function(_0x5cb443,_0xe7b828,_0x5e2030){_0x5e2030(null,path['join'](config['root'],_0x0283('0x15')));},'filename':function(_0x8c7545,_0x10be23,_0x1b297c){_0x1b297c(null,util[_0x0283('0x16')](_0x0283('0x17'),_0x0283('0x20'),path[_0x0283('0x19')](_0x10be23[_0x0283('0x1a')])));}})});router[_0x0283('0x1e')](_0x0283('0x11'),upload[_0x0283('0x1f')]('file'),controller[_0x0283('0x21')]);var upload=multer({'storage':multer[_0x0283('0x13')]({'destination':function(_0x8d1113,_0x45a6a1,_0x1c972c){_0x1c972c(null,path[_0x0283('0x14')](config['root'],_0x0283('0x15')));},'filename':function(_0x3e8034,_0x34d2cd,_0x1c23b5){_0x1c23b5(null,util[_0x0283('0x16')](_0x0283('0x17'),'favicon',path[_0x0283('0x19')](_0x34d2cd['originalname'])));}})});router[_0x0283('0x1e')](_0x0283('0x22'),upload[_0x0283('0x1f')]('file'),controller[_0x0283('0x23')]);router[_0x0283('0x24')](_0x0283('0x25'),auth['isAuthenticated'](),controller[_0x0283('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 0d71acc..f535b43 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 _0xb465=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x34178c,_0x10c45a){var _0x2fe800=function(_0x438262){while(--_0x438262){_0x34178c['push'](_0x34178c['shift']());}};_0x2fe800(++_0x10c45a);}(_0xb465,0x171));var _0x5b46=function(_0x472288,_0x224948){_0x472288=_0x472288-0x0;var _0x219f62=_0xb465[_0x472288];return _0x219f62;};'use strict';var Sequelize=require('sequelize');module[_0x5b46('0x0')]={'min_internal':{'type':Sequelize[_0x5b46('0x1')](0xb),'unique':_0x5b46('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5b46('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x5b46('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5b46('0x4')],'defaultValue':_0x5b46('0x5')},'logo':{'type':Sequelize[_0x5b46('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5b46('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5b46('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x5b46('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x5b46('0x4')]},'pageTitle':{'type':Sequelize[_0x5b46('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5b46('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x5b46('0x4')],'defaultValue':_0x5b46('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5b46('0x4')],'defaultValue':_0x5b46('0x8')},'chatTimeout':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5b46('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5b46('0x4')]},'defaultFavicon':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5b46('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5b46('0x1')]},'transcribeRegion':{'type':Sequelize[_0x5b46('0x4')]},'sentiment':{'type':Sequelize[_0x5b46('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5b46('0x1')]},'sentimentRegion':{'type':Sequelize[_0x5b46('0x4')]},'language':{'type':Sequelize[_0x5b46('0x4')]},'bucket':{'type':Sequelize[_0x5b46('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x547f=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING'];(function(_0x287ec1,_0x56a4f1){var _0x24e131=function(_0x3af62b){while(--_0x3af62b){_0x287ec1['push'](_0x287ec1['shift']());}};_0x24e131(++_0x56a4f1);}(_0x547f,0x1cd));var _0xf547=function(_0x2dc41f,_0x4697b6){_0x2dc41f=_0x2dc41f-0x0;var _0x11c331=_0x547f[_0x2dc41f];return _0x11c331;};'use strict';var Sequelize=require(_0xf547('0x0'));module[_0xf547('0x1')]={'min_internal':{'type':Sequelize[_0xf547('0x2')](0xb),'unique':_0xf547('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf547('0x2')](0xb),'unique':_0xf547('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf547('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xf547('0x5')},'logo':{'type':Sequelize[_0xf547('0x6')]},'defaultLogo':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf547('0x6')]},'defaultLoginLogo':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf547('0x6')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf547('0x6')]},'turnaddr':{'type':Sequelize[_0xf547('0x6')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf547('0x6')]},'defaultPageTitle':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xf547('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xf547('0x6')],'defaultValue':_0xf547('0x8')},'enableEmailPreview':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xf547('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf547('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf547('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf547('0x6')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xf547('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xf547('0x6')]},'defaultPreferred':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf547('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0xf547('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xf547('0x6')]},'defaultFavicon':{'type':Sequelize[_0xf547('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf547('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf547('0x6')]},'sentiment':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf547('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xf547('0x6')]},'language':{'type':Sequelize[_0xf547('0x6')]},'bucket':{'type':Sequelize[_0xf547('0x6')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index bd6b8b1..ddfd088 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 _0xc1a2=['keys','include','find','body','addLogo','file','filename','logo','params','addLogoLogin','../../config/license/util','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','download','getLicense','loginLogo','defaultLoginLogo','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','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~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x520b29,_0x312a4f){var _0xca8806=function(_0x4d7ca2){while(--_0x4d7ca2){_0x520b29['push'](_0x520b29['shift']());}};_0xca8806(++_0x312a4f);}(_0xc1a2,0x191));var _0x2c1a=function(_0x4649c4,_0x4c8c1a){_0x4649c4=_0x4649c4-0x0;var _0x4166e2=_0xc1a2[_0x4649c4];return _0x4166e2;};'use strict';var pdf=require(_0x2c1a('0x0'));var emlformat=require(_0x2c1a('0x1'));var rimraf=require(_0x2c1a('0x2'));var zipdir=require(_0x2c1a('0x3'));var jsonpatch=require(_0x2c1a('0x4'));var rp=require('request-promise');var moment=require(_0x2c1a('0x5'));var BPromise=require(_0x2c1a('0x6'));var Mustache=require(_0x2c1a('0x7'));var util=require('util');var path=require(_0x2c1a('0x8'));var sox=require(_0x2c1a('0x9'));var csv=require('to-csv');var ejs=require(_0x2c1a('0xa'));var fs=require('fs');var _=require(_0x2c1a('0xb'));var squel=require(_0x2c1a('0xc'));var crypto=require('crypto');var jsforce=require(_0x2c1a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2c1a('0xe'));var querystring=require(_0x2c1a('0xf'));var Papa=require(_0x2c1a('0x10'));var Redis=require('ioredis');var authService=require(_0x2c1a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c1a('0x12'));var hardwareService=require(_0x2c1a('0x13'));var logger=require('../../config/logger')(_0x2c1a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2c1a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2c1a('0x16')][_0x2c1a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x35a454,_0x21e810,_0x262377){if(_0x262377){var _0xc7788=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc7788[_0x2c1a('0x18')](_0x21e810)){return _0x35a454;}else{throw new db[(_0x2c1a('0x19'))][(_0x2c1a('0x1a'))](_0x2c1a('0x1b'));}}else{return _0x35a454;}}function respondWithRpcPromise(_0x14e420,_0x39e92b,_0x38ac8d,_0x3f67f5){return new BPromise(function(_0x47df44,_0x158b2d){var _0x2cb78a=_0x3f67f5||client;return _0x2cb78a[_0x2c1a('0x1c')](_0x14e420,_0x38ac8d)[_0x2c1a('0x1d')](function(_0x2d7910){logger[_0x2c1a('0x1e')](_0x2c1a('0x1f'),_0x39e92b,_0x2c1a('0x20'));logger[_0x2c1a('0x21')](_0x2c1a('0x22'),_0x39e92b,_0x2c1a('0x20'),JSON[_0x2c1a('0x23')](_0x2d7910));if(_0x2d7910[_0x2c1a('0x24')]){if(_0x2d7910['error'][_0x2c1a('0x25')]===0x1f4){logger['error'](_0x2c1a('0x1f'),_0x39e92b,_0x2d7910[_0x2c1a('0x24')]['message']);return _0x158b2d(_0x2d7910[_0x2c1a('0x24')][_0x2c1a('0x26')]);}logger[_0x2c1a('0x24')](_0x2c1a('0x1f'),_0x39e92b,_0x2d7910[_0x2c1a('0x24')]['message']);return _0x47df44(_0x2d7910[_0x2c1a('0x24')][_0x2c1a('0x26')]);}else{logger['info'](_0x2c1a('0x1f'),_0x39e92b,_0x2c1a('0x20'));_0x47df44(_0x2d7910[_0x2c1a('0x27')][_0x2c1a('0x26')]);}})['catch'](function(_0x4f6f2f){logger['error'](_0x2c1a('0x1f'),_0x39e92b,_0x4f6f2f);_0x158b2d(_0x4f6f2f);});});}function respondWithStatusCode(_0xb25ab1,_0x20e308){_0x20e308=_0x20e308||0xcc;return function(_0x33d291){if(_0x33d291){return _0xb25ab1[_0x2c1a('0x28')](_0x20e308);}return _0xb25ab1[_0x2c1a('0x29')](_0x20e308)[_0x2c1a('0x2a')]();};}function respondWithResult(_0x35762e,_0x80a5fd){_0x80a5fd=_0x80a5fd||0xc8;return function(_0x3cbd59){if(_0x3cbd59){return _0x35762e[_0x2c1a('0x29')](_0x80a5fd)[_0x2c1a('0x2b')](_0x3cbd59);}};}function respondWithFilteredResult(_0x3601e6,_0x3b1d2e){return function(_0x15ed31){if(_0x15ed31){var _0x3cbe41=_0x15ed31[_0x2c1a('0x2c')],_0x332e47=_0x3b1d2e[_0x2c1a('0x2d')],_0x131c93=_0x3b1d2e[_0x2c1a('0x2d')]+_0x3b1d2e['limit'],_0x1a6c36;if(_0x131c93>=_0x3cbe41){_0x131c93=_0x3cbe41;_0x1a6c36=0xc8;}else{_0x1a6c36=0xce;}_0x3601e6[_0x2c1a('0x29')](_0x1a6c36);return _0x3601e6['set'](_0x2c1a('0x2e'),_0x332e47+'-'+_0x131c93+'/'+_0x3cbe41)[_0x2c1a('0x2b')](_0x15ed31);}return null;};}function patchUpdates(_0x1eb662){return function(_0x1cb959){try{jsonpatch[_0x2c1a('0x2f')](_0x1cb959,_0x1eb662,!![]);}catch(_0x1beead){return BPromise[_0x2c1a('0x30')](_0x1beead);}return _0x1cb959[_0x2c1a('0x31')]();};}function saveUpdates(_0x4daac2,_0x2364c6){return function(_0x438684){if(_0x438684){return _0x438684[_0x2c1a('0x32')](_0x4daac2)[_0x2c1a('0x1d')](function(_0x45a6f1){return _0x45a6f1;});}return null;};}function removeEntity(_0x26b7dd,_0x3d55d4){return function(_0x467a17){if(_0x467a17){return _0x467a17[_0x2c1a('0x33')]()[_0x2c1a('0x1d')](function(){_0x26b7dd[_0x2c1a('0x29')](0xcc)[_0x2c1a('0x2a')]();});}};}function handleEntityNotFound(_0x11a7aa,_0x13a3af){return function(_0x5e11fa){if(!_0x5e11fa){_0x11a7aa[_0x2c1a('0x28')](0x194);}return _0x5e11fa;};}function handleError(_0x5f504e,_0x5f4053){_0x5f4053=_0x5f4053||0x1f4;return function(_0x147270){logger['error'](_0x147270['stack']);if(_0x147270[_0x2c1a('0x34')]){delete _0x147270[_0x2c1a('0x34')];}_0x5f504e['status'](_0x5f4053)[_0x2c1a('0x35')](_0x147270);};}exports[_0x2c1a('0x36')]=function(_0x223df0,_0x539aff){var _0x2c665b={},_0x295eee={},_0x4244de={'count':0x0,'rows':[]};var _0x5392a7=_[_0x2c1a('0x37')](db[_0x2c1a('0x38')][_0x2c1a('0x39')],function(_0x54e881){return{'name':_0x54e881[_0x2c1a('0x3a')],'type':_0x54e881[_0x2c1a('0x3b')][_0x2c1a('0x3c')]};});_0x295eee[_0x2c1a('0x3d')]=_['map'](_0x5392a7,_0x2c1a('0x34'));_0x295eee[_0x2c1a('0x3e')]=_['keys'](_0x223df0[_0x2c1a('0x3e')]);_0x295eee[_0x2c1a('0x3f')]=_[_0x2c1a('0x40')](_0x295eee[_0x2c1a('0x3d')],_0x295eee['query']);_0x2c665b[_0x2c1a('0x41')]=_['intersection'](_0x295eee[_0x2c1a('0x3d')],qs[_0x2c1a('0x42')](_0x223df0[_0x2c1a('0x3e')][_0x2c1a('0x42')]));_0x2c665b[_0x2c1a('0x41')]=_0x2c665b['attributes'][_0x2c1a('0x43')]?_0x2c665b['attributes']:_0x295eee[_0x2c1a('0x3d')];if(!_0x223df0['query'][_0x2c1a('0x44')](_0x2c1a('0x45'))){_0x2c665b[_0x2c1a('0x46')]=qs[_0x2c1a('0x46')](_0x223df0[_0x2c1a('0x3e')][_0x2c1a('0x46')]);_0x2c665b[_0x2c1a('0x2d')]=qs['offset'](_0x223df0[_0x2c1a('0x3e')]['offset']);}_0x2c665b[_0x2c1a('0x47')]=qs['sort'](_0x223df0[_0x2c1a('0x3e')][_0x2c1a('0x48')]);_0x2c665b[_0x2c1a('0x49')]=qs[_0x2c1a('0x3f')](_['pick'](_0x223df0[_0x2c1a('0x3e')],_0x295eee[_0x2c1a('0x3f')]),_0x5392a7);if(_0x223df0[_0x2c1a('0x3e')][_0x2c1a('0x4a')]){_0x2c665b['where']=_[_0x2c1a('0x4b')](_0x2c665b[_0x2c1a('0x49')],{'$or':_['map'](_0x5392a7,function(_0x830c59){if(_0x830c59[_0x2c1a('0x3b')]!==_0x2c1a('0x4c')){var _0x33bb74={};_0x33bb74[_0x830c59[_0x2c1a('0x34')]]={'$like':'%'+_0x223df0[_0x2c1a('0x3e')]['filter']+'%'};return _0x33bb74;}})});}_0x2c665b=_[_0x2c1a('0x4b')]({},_0x2c665b,_0x223df0[_0x2c1a('0x4d')]);var _0x235236={'where':_0x2c665b[_0x2c1a('0x49')]};return db[_0x2c1a('0x38')]['count'](_0x235236)[_0x2c1a('0x1d')](function(_0x4c4f82){_0x4244de[_0x2c1a('0x2c')]=_0x4c4f82;if(_0x223df0[_0x2c1a('0x3e')][_0x2c1a('0x4e')]){_0x2c665b['include']=[{'all':!![]}];}return db[_0x2c1a('0x38')][_0x2c1a('0x4f')](_0x2c665b);})[_0x2c1a('0x1d')](function(_0xd5c146){_0x4244de[_0x2c1a('0x50')]=_0xd5c146;return _0x4244de;})[_0x2c1a('0x1d')](respondWithFilteredResult(_0x539aff,_0x2c665b))[_0x2c1a('0x51')](handleError(_0x539aff,null));};exports[_0x2c1a('0x52')]=function(_0x45d194,_0x28d4a4){var _0x216919={'raw':![],'where':{'id':_0x45d194['params']['id']}},_0xc90c60={};_0xc90c60['model']=_[_0x2c1a('0x53')](db[_0x2c1a('0x38')][_0x2c1a('0x39')]);_0xc90c60['query']=_['keys'](_0x45d194['query']);_0xc90c60[_0x2c1a('0x3f')]=_['intersection'](_0xc90c60[_0x2c1a('0x3d')],_0xc90c60[_0x2c1a('0x3e')]);_0x216919[_0x2c1a('0x41')]=_[_0x2c1a('0x40')](_0xc90c60['model'],qs[_0x2c1a('0x42')](_0x45d194['query'][_0x2c1a('0x42')]));_0x216919[_0x2c1a('0x41')]=_0x216919[_0x2c1a('0x41')][_0x2c1a('0x43')]?_0x216919[_0x2c1a('0x41')]:_0xc90c60[_0x2c1a('0x3d')];if(_0x45d194['query'][_0x2c1a('0x4e')]){_0x216919[_0x2c1a('0x54')]=[{'all':!![]}];}_0x216919=_[_0x2c1a('0x4b')]({},_0x216919,_0x45d194[_0x2c1a('0x4d')]);return db['Setting'][_0x2c1a('0x55')](_0x216919)[_0x2c1a('0x1d')](handleEntityNotFound(_0x28d4a4,null))[_0x2c1a('0x1d')](respondWithResult(_0x28d4a4,null))[_0x2c1a('0x51')](handleError(_0x28d4a4,null));};exports[_0x2c1a('0x32')]=function(_0x59a850,_0x208a16){if(_0x59a850[_0x2c1a('0x56')]['id']){delete _0x59a850['body']['id'];}return db['Setting'][_0x2c1a('0x55')]({'where':{'id':_0x59a850['params']['id']}})[_0x2c1a('0x1d')](handleEntityNotFound(_0x208a16,null))['then'](saveUpdates(_0x59a850[_0x2c1a('0x56')],null))[_0x2c1a('0x1d')](respondWithResult(_0x208a16,null))['catch'](handleError(_0x208a16,null));};exports[_0x2c1a('0x57')]=function(_0x71d923,_0x635578,_0x5c76d2){if(_0x71d923['file']&&_0x71d923[_0x2c1a('0x58')][_0x2c1a('0x59')]){_0x71d923[_0x2c1a('0x56')][_0x2c1a('0x5a')]=_0x71d923[_0x2c1a('0x58')][_0x2c1a('0x59')];}return db['Setting']['find']({'where':{'id':_0x71d923[_0x2c1a('0x5b')]['id']}})[_0x2c1a('0x1d')](handleEntityNotFound(_0x635578,null))[_0x2c1a('0x1d')](saveUpdates(_0x71d923[_0x2c1a('0x56')],null))[_0x2c1a('0x1d')](respondWithResult(_0x635578,null))[_0x2c1a('0x51')](handleError(_0x635578,null));};exports[_0x2c1a('0x5c')]=function(_0x1ecb22,_0x1e39aa,_0x4ca7bc){if(_0x1ecb22[_0x2c1a('0x58')]&&_0x1ecb22[_0x2c1a('0x58')][_0x2c1a('0x59')]){_0x1ecb22[_0x2c1a('0x56')]['loginLogo']=_0x1ecb22[_0x2c1a('0x58')][_0x2c1a('0x59')];}return db['Setting'][_0x2c1a('0x55')]({'where':{'id':_0x1ecb22[_0x2c1a('0x5b')]['id']}})[_0x2c1a('0x1d')](handleEntityNotFound(_0x1e39aa,null))[_0x2c1a('0x1d')](saveUpdates(_0x1ecb22[_0x2c1a('0x56')],null))[_0x2c1a('0x1d')](respondWithResult(_0x1e39aa,null))[_0x2c1a('0x51')](handleError(_0x1e39aa,null));};var utilLicense=require(_0x2c1a('0x5d'));exports['getLogo']=function(_0x28f9cf,_0x2157bf,_0x59cd9b){var _0x3d365e=_0x2c1a('0x5e');var _0x2a2651={'custom':![]};return utilLicense['getLicense']()[_0x2c1a('0x1d')](function(_0x2fe44f){if(_0x2fe44f){_0x2a2651=_0x2fe44f;}return db[_0x2c1a('0x38')][_0x2c1a('0x55')]({'where':{'id':_0x28f9cf[_0x2c1a('0x5b')]['id']},'attributes':[_0x2c1a('0x5a'),'loginLogo',_0x2c1a('0x5f'),_0x2c1a('0x60'),_0x2c1a('0x61'),'defaultLoginLogo',_0x2c1a('0x62'),_0x2c1a('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x2157bf,null))[_0x2c1a('0x1d')](function(_0x36d3fa){if(_0x36d3fa){var _0x43c649=_0x36d3fa[_0x2c1a('0x5a')]&&fs[_0x2c1a('0x64')](path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x3d365e,_[_0x2c1a('0x67')](_0x36d3fa[_0x2c1a('0x5a')])))?path[_0x2c1a('0x65')](config['root'],_0x3d365e,_['toLower'](_0x36d3fa[_0x2c1a('0x5a')])):path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x3d365e,_[_0x2c1a('0x67')](_0x2c1a('0x68')));var _0x6c55d0=_0x2c1a('0x69')+_[_0x2c1a('0x6a')](_0x2c1a('0x5a'));if(_0x36d3fa[_0x6c55d0]||!_0x2a2651[_0x2c1a('0x6b')]){_0x43c649=path[_0x2c1a('0x65')](config['root'],_0x3d365e,_[_0x2c1a('0x67')](_0x2c1a('0x68')));}if(!fs[_0x2c1a('0x64')](_0x43c649)){throw new db[(_0x2c1a('0x19'))][(_0x2c1a('0x1a'))](_['upperFirst'](_0x2c1a('0x5a'))+'\x20not\x20found');}return _0x2157bf[_0x2c1a('0x6c')](_0x43c649);}})['catch'](handleError(_0x2157bf,null));};var utilLicense=require(_0x2c1a('0x5d'));exports['getLogoLogin']=function(_0x3bb16e,_0x2bb35e,_0x324cd4){var _0x13e4e4=_0x2c1a('0x5e');var _0x46136b={'custom':![]};return utilLicense[_0x2c1a('0x6d')]()[_0x2c1a('0x1d')](function(_0x2b6113){if(_0x2b6113){_0x46136b=_0x2b6113;}return db['Setting'][_0x2c1a('0x55')]({'where':{'id':_0x3bb16e[_0x2c1a('0x5b')]['id']},'attributes':[_0x2c1a('0x5a'),_0x2c1a('0x6e'),_0x2c1a('0x5f'),'favicon',_0x2c1a('0x61'),_0x2c1a('0x6f'),_0x2c1a('0x62'),_0x2c1a('0x63')],'raw':!![]});})[_0x2c1a('0x1d')](handleEntityNotFound(_0x2bb35e,null))['then'](function(_0x3a2de5){if(_0x3a2de5){var _0x588f94=_0x3a2de5[_0x2c1a('0x6e')]&&fs[_0x2c1a('0x64')](path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x13e4e4,_['toLower'](_0x3a2de5[_0x2c1a('0x6e')])))?path[_0x2c1a('0x65')](config['root'],_0x13e4e4,_['toLower'](_0x3a2de5['loginLogo'])):path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x13e4e4,_['toLower'](_0x2c1a('0x70')));var _0x121087=_0x2c1a('0x69')+_['upperFirst'](_0x2c1a('0x6e'));if(_0x3a2de5[_0x121087]||!_0x46136b['custom']){_0x588f94=path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x13e4e4,_[_0x2c1a('0x67')]('default_loginLogo.svg'));}if(!fs[_0x2c1a('0x64')](_0x588f94)){throw new db[(_0x2c1a('0x19'))][(_0x2c1a('0x1a'))](_[_0x2c1a('0x6a')]('loginLogo')+'\x20not\x20found');}return _0x2bb35e[_0x2c1a('0x6c')](_0x588f94);}})[_0x2c1a('0x51')](handleError(_0x2bb35e,null));};exports['gdpr']=function(_0x466db5,_0x4bf0b5){return db[_0x2c1a('0x38')][_0x2c1a('0x55')]({'where':{'id':_0x466db5[_0x2c1a('0x5b')]['id']},'attributes':[_0x2c1a('0x71')]})[_0x2c1a('0x1d')](respondWithResult(_0x4bf0b5,null))[_0x2c1a('0x51')](handleError(_0x4bf0b5,null));};exports[_0x2c1a('0x72')]=function(_0xf10bdc,_0x456065,_0x56efa9){if(_0xf10bdc[_0x2c1a('0x58')]&&_0xf10bdc['file']['filename']){_0xf10bdc['body']['preferred']=_0xf10bdc[_0x2c1a('0x58')][_0x2c1a('0x59')];}return db[_0x2c1a('0x38')][_0x2c1a('0x55')]({'where':{'id':_0xf10bdc[_0x2c1a('0x5b')]['id']}})[_0x2c1a('0x1d')](handleEntityNotFound(_0x456065,null))['then'](saveUpdates(_0xf10bdc[_0x2c1a('0x56')],null))[_0x2c1a('0x1d')](respondWithResult(_0x456065,null))['catch'](handleError(_0x456065,null));};var utilLicense=require('../../config/license/util');exports[_0x2c1a('0x73')]=function(_0x514ce7,_0x46f149,_0x2bfabe){var _0x100a32=_0x2c1a('0x5e');var _0x1a2905={'custom':![]};return utilLicense['getLicense']()[_0x2c1a('0x1d')](function(_0x5aec3b){if(_0x5aec3b){_0x1a2905=_0x5aec3b;}return db[_0x2c1a('0x38')]['find']({'where':{'id':_0x514ce7['params']['id']},'attributes':[_0x2c1a('0x5a'),_0x2c1a('0x6e'),_0x2c1a('0x5f'),_0x2c1a('0x60'),_0x2c1a('0x61'),_0x2c1a('0x6f'),_0x2c1a('0x62'),_0x2c1a('0x63')],'raw':!![]});})[_0x2c1a('0x1d')](handleEntityNotFound(_0x46f149,null))[_0x2c1a('0x1d')](function(_0xb905eb){if(_0xb905eb){var _0x757835=_0xb905eb[_0x2c1a('0x5f')]&&fs[_0x2c1a('0x64')](path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x100a32,_[_0x2c1a('0x67')](_0xb905eb[_0x2c1a('0x5f')])))?path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x100a32,_[_0x2c1a('0x67')](_0xb905eb[_0x2c1a('0x5f')])):path[_0x2c1a('0x65')](config['root'],_0x100a32,_['toLower'](_0x2c1a('0x74')));var _0x40698a=_0x2c1a('0x69')+_[_0x2c1a('0x6a')](_0x2c1a('0x5f'));if(_0xb905eb[_0x40698a]||!_0x1a2905[_0x2c1a('0x6b')]||!_0x1a2905[_0x2c1a('0x5f')]){_0x757835=path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x100a32,_[_0x2c1a('0x67')](_0x2c1a('0x74')));}if(!fs[_0x2c1a('0x64')](_0x757835)){throw new db[(_0x2c1a('0x19'))][(_0x2c1a('0x1a'))](_['upperFirst'](_0x2c1a('0x5f'))+_0x2c1a('0x75'));}return _0x46f149['download'](_0x757835);}})[_0x2c1a('0x51')](handleError(_0x46f149,null));};exports[_0x2c1a('0x76')]=function(_0x273cf1,_0x23112d,_0x3cc675){if(_0x273cf1[_0x2c1a('0x58')]&&_0x273cf1[_0x2c1a('0x58')]['filename']){_0x273cf1[_0x2c1a('0x56')][_0x2c1a('0x60')]=_0x273cf1[_0x2c1a('0x58')][_0x2c1a('0x59')];}return db[_0x2c1a('0x38')][_0x2c1a('0x55')]({'where':{'id':_0x273cf1['params']['id']}})[_0x2c1a('0x1d')](handleEntityNotFound(_0x23112d,null))[_0x2c1a('0x1d')](saveUpdates(_0x273cf1[_0x2c1a('0x56')],null))[_0x2c1a('0x1d')](respondWithResult(_0x23112d,null))[_0x2c1a('0x51')](handleError(_0x23112d,null));};var utilLicense=require('../../config/license/util');exports[_0x2c1a('0x77')]=function(_0x568621,_0x4a2ee8,_0xb62670){var _0x3df7d1=_0x2c1a('0x5e');var _0x35fc3d={'custom':![]};return utilLicense['getLicense']()[_0x2c1a('0x1d')](function(_0x1ee704){if(_0x1ee704){_0x35fc3d=_0x1ee704;}return db[_0x2c1a('0x38')][_0x2c1a('0x55')]({'where':{'id':_0x568621[_0x2c1a('0x5b')]['id']},'attributes':['logo',_0x2c1a('0x6e'),_0x2c1a('0x5f'),_0x2c1a('0x60'),_0x2c1a('0x61'),'defaultLoginLogo',_0x2c1a('0x62'),_0x2c1a('0x63')],'raw':!![]});})[_0x2c1a('0x1d')](handleEntityNotFound(_0x4a2ee8,null))[_0x2c1a('0x1d')](function(_0x796a2b){if(_0x796a2b){var _0x31df1b=_0x796a2b[_0x2c1a('0x60')]&&fs[_0x2c1a('0x64')](path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x3df7d1,_[_0x2c1a('0x67')](_0x796a2b[_0x2c1a('0x60')])))?path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x3df7d1,_[_0x2c1a('0x67')](_0x796a2b[_0x2c1a('0x60')])):path[_0x2c1a('0x65')](config[_0x2c1a('0x66')],_0x3df7d1,_['toLower'](_0x2c1a('0x78')));var _0x428ad1=_0x2c1a('0x69')+_[_0x2c1a('0x6a')]('favicon');if(_0x796a2b[_0x428ad1]||!_0x35fc3d[_0x2c1a('0x6b')]){_0x31df1b=path['join'](config[_0x2c1a('0x66')],_0x3df7d1,_[_0x2c1a('0x67')](_0x2c1a('0x78')));}if(!fs['existsSync'](_0x31df1b)){throw new db[(_0x2c1a('0x19'))][(_0x2c1a('0x1a'))](_[_0x2c1a('0x6a')](_0x2c1a('0x60'))+_0x2c1a('0x75'));}return _0x4a2ee8['download'](_0x31df1b);}})[_0x2c1a('0x51')](handleError(_0x4a2ee8,null));}; \ No newline at end of file +var _0x075c=['keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','show','find','body','params','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','getLicense','loginLogo','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','download','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','preferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','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~!@#$%^&-_=+[{]}.','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','Setting','rawAttributes','type','key','map'];(function(_0x118305,_0x392afe){var _0x528027=function(_0xf3962b){while(--_0xf3962b){_0x118305['push'](_0x118305['shift']());}};_0x528027(++_0x392afe);}(_0x075c,0x130));var _0xc075=function(_0xa899ba,_0x1e6462){_0xa899ba=_0xa899ba-0x0;var _0x562076=_0x075c[_0xa899ba];return _0x562076;};'use strict';var pdf=require(_0xc075('0x0'));var emlformat=require(_0xc075('0x1'));var rimraf=require(_0xc075('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc075('0x3'));var rp=require('request-promise');var moment=require(_0xc075('0x4'));var BPromise=require(_0xc075('0x5'));var Mustache=require(_0xc075('0x6'));var util=require(_0xc075('0x7'));var path=require(_0xc075('0x8'));var sox=require(_0xc075('0x9'));var csv=require(_0xc075('0xa'));var ejs=require(_0xc075('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc075('0xc'));var crypto=require(_0xc075('0xd'));var jsforce=require(_0xc075('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc075('0xa'));var querystring=require(_0xc075('0xf'));var Papa=require(_0xc075('0x10'));var Redis=require(_0xc075('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc075('0x12'));var hardwareService=require(_0xc075('0x13'));var logger=require(_0xc075('0x14'))('api');var utils=require(_0xc075('0x15'));var config=require('../../config/environment');var db=require(_0xc075('0x16'))['db'];var jayson=require(_0xc075('0x17'));var client=jayson['client'][_0xc075('0x18')]({'port':0x232a});function checkPasswordPattern(_0x26a627,_0x4d2736,_0x219f75){if(_0x219f75){var _0x16c53b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16c53b['test'](_0x4d2736)){return _0x26a627;}else{throw new db[(_0xc075('0x19'))]['ValidationError'](_0xc075('0x1a'));}}else{return _0x26a627;}}function respondWithRpcPromise(_0x2dc208,_0x19baf3,_0x3b5898,_0x199d0d){return new BPromise(function(_0x4a2a3e,_0x144030){var _0x182b12=_0x199d0d||client;return _0x182b12[_0xc075('0x1b')](_0x2dc208,_0x3b5898)[_0xc075('0x1c')](function(_0x5262d9){logger[_0xc075('0x1d')]('Setting,\x20%s,\x20%s',_0x19baf3,'request\x20sent');logger[_0xc075('0x1e')](_0xc075('0x1f'),_0x19baf3,'request\x20sent',JSON[_0xc075('0x20')](_0x5262d9));if(_0x5262d9[_0xc075('0x21')]){if(_0x5262d9[_0xc075('0x21')][_0xc075('0x22')]===0x1f4){logger[_0xc075('0x21')](_0xc075('0x23'),_0x19baf3,_0x5262d9['error'][_0xc075('0x24')]);return _0x144030(_0x5262d9[_0xc075('0x21')][_0xc075('0x24')]);}logger[_0xc075('0x21')](_0xc075('0x23'),_0x19baf3,_0x5262d9[_0xc075('0x21')][_0xc075('0x24')]);return _0x4a2a3e(_0x5262d9[_0xc075('0x21')][_0xc075('0x24')]);}else{logger[_0xc075('0x1d')](_0xc075('0x23'),_0x19baf3,_0xc075('0x25'));_0x4a2a3e(_0x5262d9[_0xc075('0x26')][_0xc075('0x24')]);}})[_0xc075('0x27')](function(_0x50cd44){logger[_0xc075('0x21')]('Setting,\x20%s,\x20%s',_0x19baf3,_0x50cd44);_0x144030(_0x50cd44);});});}function respondWithStatusCode(_0x1bbf44,_0x43054f){_0x43054f=_0x43054f||0xcc;return function(_0x2f0dc7){if(_0x2f0dc7){return _0x1bbf44[_0xc075('0x28')](_0x43054f);}return _0x1bbf44[_0xc075('0x29')](_0x43054f)[_0xc075('0x2a')]();};}function respondWithResult(_0x2883c0,_0x3b068d){_0x3b068d=_0x3b068d||0xc8;return function(_0x268be5){if(_0x268be5){return _0x2883c0[_0xc075('0x29')](_0x3b068d)[_0xc075('0x2b')](_0x268be5);}};}function respondWithFilteredResult(_0x3dbe34,_0x1a27aa){return function(_0x3e1b57){if(_0x3e1b57){var _0x4e9258=_0x3e1b57[_0xc075('0x2c')],_0x26e368=_0x1a27aa[_0xc075('0x2d')],_0x302ea4=_0x1a27aa[_0xc075('0x2d')]+_0x1a27aa[_0xc075('0x2e')],_0x19bf84;if(_0x302ea4>=_0x4e9258){_0x302ea4=_0x4e9258;_0x19bf84=0xc8;}else{_0x19bf84=0xce;}_0x3dbe34[_0xc075('0x29')](_0x19bf84);return _0x3dbe34[_0xc075('0x2f')](_0xc075('0x30'),_0x26e368+'-'+_0x302ea4+'/'+_0x4e9258)[_0xc075('0x2b')](_0x3e1b57);}return null;};}function patchUpdates(_0x404317){return function(_0x53aa4c){try{jsonpatch[_0xc075('0x31')](_0x53aa4c,_0x404317,!![]);}catch(_0x3bcb0a){return BPromise[_0xc075('0x32')](_0x3bcb0a);}return _0x53aa4c[_0xc075('0x33')]();};}function saveUpdates(_0x26b0a5,_0xb9720c){return function(_0x3ac5f3){if(_0x3ac5f3){return _0x3ac5f3[_0xc075('0x34')](_0x26b0a5)[_0xc075('0x1c')](function(_0x56940d){return _0x56940d;});}return null;};}function removeEntity(_0x4d5134,_0x21f1fd){return function(_0x16676b){if(_0x16676b){return _0x16676b[_0xc075('0x35')]()[_0xc075('0x1c')](function(){_0x4d5134[_0xc075('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x825a54,_0x3dd431){return function(_0x108fb3){if(!_0x108fb3){_0x825a54['sendStatus'](0x194);}return _0x108fb3;};}function handleError(_0x100c88,_0x5c2dd0){_0x5c2dd0=_0x5c2dd0||0x1f4;return function(_0x3f2f15){logger[_0xc075('0x21')](_0x3f2f15[_0xc075('0x36')]);if(_0x3f2f15['name']){delete _0x3f2f15[_0xc075('0x37')];}_0x100c88[_0xc075('0x29')](_0x5c2dd0)['send'](_0x3f2f15);};}exports[_0xc075('0x38')]=function(_0x3e51a3,_0x1ee9c0){var _0x146c02={},_0xca72b1={},_0x2c877a={'count':0x0,'rows':[]};var _0x4531f1=_['map'](db[_0xc075('0x39')][_0xc075('0x3a')],function(_0x5a3970){return{'name':_0x5a3970['fieldName'],'type':_0x5a3970[_0xc075('0x3b')][_0xc075('0x3c')]};});_0xca72b1['model']=_[_0xc075('0x3d')](_0x4531f1,_0xc075('0x37'));_0xca72b1['query']=_[_0xc075('0x3e')](_0x3e51a3[_0xc075('0x3f')]);_0xca72b1['filters']=_[_0xc075('0x40')](_0xca72b1[_0xc075('0x41')],_0xca72b1['query']);_0x146c02[_0xc075('0x42')]=_['intersection'](_0xca72b1[_0xc075('0x41')],qs[_0xc075('0x43')](_0x3e51a3[_0xc075('0x3f')][_0xc075('0x43')]));_0x146c02[_0xc075('0x42')]=_0x146c02[_0xc075('0x42')][_0xc075('0x44')]?_0x146c02['attributes']:_0xca72b1[_0xc075('0x41')];if(!_0x3e51a3[_0xc075('0x3f')][_0xc075('0x45')](_0xc075('0x46'))){_0x146c02['limit']=qs[_0xc075('0x2e')](_0x3e51a3['query'][_0xc075('0x2e')]);_0x146c02[_0xc075('0x2d')]=qs[_0xc075('0x2d')](_0x3e51a3[_0xc075('0x3f')]['offset']);}_0x146c02[_0xc075('0x47')]=qs[_0xc075('0x48')](_0x3e51a3[_0xc075('0x3f')][_0xc075('0x48')]);_0x146c02[_0xc075('0x49')]=qs[_0xc075('0x4a')](_['pick'](_0x3e51a3['query'],_0xca72b1['filters']),_0x4531f1);if(_0x3e51a3['query'][_0xc075('0x4b')]){_0x146c02[_0xc075('0x49')]=_['merge'](_0x146c02['where'],{'$or':_[_0xc075('0x3d')](_0x4531f1,function(_0x21b574){if(_0x21b574['type']!==_0xc075('0x4c')){var _0xdead9f={};_0xdead9f[_0x21b574['name']]={'$like':'%'+_0x3e51a3['query']['filter']+'%'};return _0xdead9f;}})});}_0x146c02=_[_0xc075('0x4d')]({},_0x146c02,_0x3e51a3[_0xc075('0x4e')]);var _0x3cf5f5={'where':_0x146c02[_0xc075('0x49')]};return db[_0xc075('0x39')][_0xc075('0x2c')](_0x3cf5f5)[_0xc075('0x1c')](function(_0x5b66fd){_0x2c877a[_0xc075('0x2c')]=_0x5b66fd;if(_0x3e51a3['query'][_0xc075('0x4f')]){_0x146c02[_0xc075('0x50')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x146c02);})['then'](function(_0x430ad7){_0x2c877a[_0xc075('0x51')]=_0x430ad7;return _0x2c877a;})[_0xc075('0x1c')](respondWithFilteredResult(_0x1ee9c0,_0x146c02))['catch'](handleError(_0x1ee9c0,null));};exports[_0xc075('0x52')]=function(_0x21c48a,_0x375ccf){var _0x1cdcde={'raw':![],'where':{'id':_0x21c48a['params']['id']}},_0xbf0551={};_0xbf0551[_0xc075('0x41')]=_[_0xc075('0x3e')](db[_0xc075('0x39')]['rawAttributes']);_0xbf0551['query']=_[_0xc075('0x3e')](_0x21c48a[_0xc075('0x3f')]);_0xbf0551['filters']=_[_0xc075('0x40')](_0xbf0551[_0xc075('0x41')],_0xbf0551[_0xc075('0x3f')]);_0x1cdcde[_0xc075('0x42')]=_[_0xc075('0x40')](_0xbf0551[_0xc075('0x41')],qs[_0xc075('0x43')](_0x21c48a[_0xc075('0x3f')]['fields']));_0x1cdcde[_0xc075('0x42')]=_0x1cdcde['attributes']['length']?_0x1cdcde[_0xc075('0x42')]:_0xbf0551[_0xc075('0x41')];if(_0x21c48a['query'][_0xc075('0x4f')]){_0x1cdcde[_0xc075('0x50')]=[{'all':!![]}];}_0x1cdcde=_[_0xc075('0x4d')]({},_0x1cdcde,_0x21c48a[_0xc075('0x4e')]);return db[_0xc075('0x39')][_0xc075('0x53')](_0x1cdcde)[_0xc075('0x1c')](handleEntityNotFound(_0x375ccf,null))[_0xc075('0x1c')](respondWithResult(_0x375ccf,null))[_0xc075('0x27')](handleError(_0x375ccf,null));};exports['update']=function(_0x5da3ad,_0x3abb9d){if(_0x5da3ad[_0xc075('0x54')]['id']){delete _0x5da3ad[_0xc075('0x54')]['id'];}return db[_0xc075('0x39')][_0xc075('0x53')]({'where':{'id':_0x5da3ad[_0xc075('0x55')]['id']}})['then'](handleEntityNotFound(_0x3abb9d,null))[_0xc075('0x1c')](saveUpdates(_0x5da3ad[_0xc075('0x54')],null))[_0xc075('0x1c')](respondWithResult(_0x3abb9d,null))[_0xc075('0x27')](handleError(_0x3abb9d,null));};exports[_0xc075('0x56')]=function(_0x5ab28d,_0x432780,_0x3f3506){if(_0x5ab28d[_0xc075('0x57')]&&_0x5ab28d[_0xc075('0x57')][_0xc075('0x58')]){_0x5ab28d[_0xc075('0x54')][_0xc075('0x59')]=_0x5ab28d[_0xc075('0x57')][_0xc075('0x58')];}return db[_0xc075('0x39')]['find']({'where':{'id':_0x5ab28d[_0xc075('0x55')]['id']}})[_0xc075('0x1c')](handleEntityNotFound(_0x432780,null))[_0xc075('0x1c')](saveUpdates(_0x5ab28d[_0xc075('0x54')],null))[_0xc075('0x1c')](respondWithResult(_0x432780,null))[_0xc075('0x27')](handleError(_0x432780,null));};exports[_0xc075('0x5a')]=function(_0x17b128,_0x7b667e,_0x3f3bf2){if(_0x17b128[_0xc075('0x57')]&&_0x17b128['file']['filename']){_0x17b128['body']['loginLogo']=_0x17b128['file'][_0xc075('0x58')];}return db['Setting'][_0xc075('0x53')]({'where':{'id':_0x17b128[_0xc075('0x55')]['id']}})['then'](handleEntityNotFound(_0x7b667e,null))[_0xc075('0x1c')](saveUpdates(_0x17b128['body'],null))[_0xc075('0x1c')](respondWithResult(_0x7b667e,null))[_0xc075('0x27')](handleError(_0x7b667e,null));};var utilLicense=require(_0xc075('0x5b'));exports[_0xc075('0x5c')]=function(_0x50fa25,_0x3dddda,_0x402e1f){var _0x4ebc01='server/files/images/logos';var _0x1ff602={'custom':![]};return utilLicense[_0xc075('0x5d')]()[_0xc075('0x1c')](function(_0x1e16ea){if(_0x1e16ea){_0x1ff602=_0x1e16ea;}return db['Setting'][_0xc075('0x53')]({'where':{'id':_0x50fa25[_0xc075('0x55')]['id']},'attributes':['logo',_0xc075('0x5e'),'preferred',_0xc075('0x5f'),_0xc075('0x60'),'defaultLoginLogo',_0xc075('0x61'),_0xc075('0x62')],'raw':!![]});})[_0xc075('0x1c')](handleEntityNotFound(_0x3dddda,null))[_0xc075('0x1c')](function(_0x5322d6){if(_0x5322d6){var _0x303e2f=_0x5322d6[_0xc075('0x59')]&&fs[_0xc075('0x63')](path[_0xc075('0x64')](config[_0xc075('0x65')],_0x4ebc01,_[_0xc075('0x66')](_0x5322d6['logo'])))?path[_0xc075('0x64')](config['root'],_0x4ebc01,_[_0xc075('0x66')](_0x5322d6[_0xc075('0x59')])):path[_0xc075('0x64')](config['root'],_0x4ebc01,_[_0xc075('0x66')](_0xc075('0x67')));var _0x583bc4=_0xc075('0x68')+_[_0xc075('0x69')](_0xc075('0x59'));if(_0x5322d6[_0x583bc4]||!_0x1ff602[_0xc075('0x6a')]){_0x303e2f=path[_0xc075('0x64')](config['root'],_0x4ebc01,_[_0xc075('0x66')](_0xc075('0x67')));}if(!fs[_0xc075('0x63')](_0x303e2f)){throw new db[(_0xc075('0x19'))][(_0xc075('0x6b'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x3dddda[_0xc075('0x6c')](_0x303e2f);}})['catch'](handleError(_0x3dddda,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x2a3138,_0x44d2c1,_0x1ce127){var _0x29b20e='server/files/images/logos';var _0x3354ad={'custom':![]};return utilLicense[_0xc075('0x5d')]()[_0xc075('0x1c')](function(_0x4f5a89){if(_0x4f5a89){_0x3354ad=_0x4f5a89;}return db[_0xc075('0x39')][_0xc075('0x53')]({'where':{'id':_0x2a3138[_0xc075('0x55')]['id']},'attributes':[_0xc075('0x59'),_0xc075('0x5e'),'preferred','favicon',_0xc075('0x60'),_0xc075('0x6d'),_0xc075('0x61'),_0xc075('0x62')],'raw':!![]});})[_0xc075('0x1c')](handleEntityNotFound(_0x44d2c1,null))['then'](function(_0xd5c697){if(_0xd5c697){var _0x366a16=_0xd5c697[_0xc075('0x5e')]&&fs['existsSync'](path['join'](config[_0xc075('0x65')],_0x29b20e,_[_0xc075('0x66')](_0xd5c697[_0xc075('0x5e')])))?path[_0xc075('0x64')](config['root'],_0x29b20e,_['toLower'](_0xd5c697[_0xc075('0x5e')])):path[_0xc075('0x64')](config[_0xc075('0x65')],_0x29b20e,_[_0xc075('0x66')](_0xc075('0x6e')));var _0x2b3e1c='default'+_[_0xc075('0x69')](_0xc075('0x5e'));if(_0xd5c697[_0x2b3e1c]||!_0x3354ad['custom']){_0x366a16=path[_0xc075('0x64')](config[_0xc075('0x65')],_0x29b20e,_[_0xc075('0x66')](_0xc075('0x6e')));}if(!fs['existsSync'](_0x366a16)){throw new db[(_0xc075('0x19'))][(_0xc075('0x6b'))](_['upperFirst'](_0xc075('0x5e'))+_0xc075('0x6f'));}return _0x44d2c1[_0xc075('0x6c')](_0x366a16);}})[_0xc075('0x27')](handleError(_0x44d2c1,null));};exports[_0xc075('0x70')]=function(_0x5e911c,_0x453d4d){return db[_0xc075('0x39')][_0xc075('0x53')]({'where':{'id':_0x5e911c[_0xc075('0x55')]['id']},'attributes':[_0xc075('0x71')]})[_0xc075('0x1c')](respondWithResult(_0x453d4d,null))[_0xc075('0x27')](handleError(_0x453d4d,null));};exports[_0xc075('0x72')]=function(_0x29038d,_0x399e95,_0x12e568){if(_0x29038d[_0xc075('0x57')]&&_0x29038d[_0xc075('0x57')]['filename']){_0x29038d['body']['preferred']=_0x29038d[_0xc075('0x57')]['filename'];}return db['Setting']['find']({'where':{'id':_0x29038d[_0xc075('0x55')]['id']}})[_0xc075('0x1c')](handleEntityNotFound(_0x399e95,null))[_0xc075('0x1c')](saveUpdates(_0x29038d[_0xc075('0x54')],null))['then'](respondWithResult(_0x399e95,null))['catch'](handleError(_0x399e95,null));};var utilLicense=require(_0xc075('0x5b'));exports[_0xc075('0x73')]=function(_0x88437,_0x1d41fa,_0x2890bf){var _0x812b13=_0xc075('0x74');var _0x12fd51={'custom':![]};return utilLicense[_0xc075('0x5d')]()[_0xc075('0x1c')](function(_0x3cabf3){if(_0x3cabf3){_0x12fd51=_0x3cabf3;}return db[_0xc075('0x39')]['find']({'where':{'id':_0x88437[_0xc075('0x55')]['id']},'attributes':[_0xc075('0x59'),_0xc075('0x5e'),'preferred',_0xc075('0x5f'),'defaultLogo',_0xc075('0x6d'),'defaultPreferred',_0xc075('0x62')],'raw':!![]});})[_0xc075('0x1c')](handleEntityNotFound(_0x1d41fa,null))[_0xc075('0x1c')](function(_0x339f4f){if(_0x339f4f){var _0x42de94=_0x339f4f[_0xc075('0x75')]&&fs[_0xc075('0x63')](path[_0xc075('0x64')](config[_0xc075('0x65')],_0x812b13,_[_0xc075('0x66')](_0x339f4f[_0xc075('0x75')])))?path[_0xc075('0x64')](config['root'],_0x812b13,_[_0xc075('0x66')](_0x339f4f[_0xc075('0x75')])):path[_0xc075('0x64')](config[_0xc075('0x65')],_0x812b13,_[_0xc075('0x66')](_0xc075('0x76')));var _0x17bc00=_0xc075('0x68')+_['upperFirst'](_0xc075('0x75'));if(_0x339f4f[_0x17bc00]||!_0x12fd51['custom']||!_0x12fd51[_0xc075('0x75')]){_0x42de94=path[_0xc075('0x64')](config[_0xc075('0x65')],_0x812b13,_[_0xc075('0x66')](_0xc075('0x76')));}if(!fs[_0xc075('0x63')](_0x42de94)){throw new db[(_0xc075('0x19'))][(_0xc075('0x6b'))](_[_0xc075('0x69')](_0xc075('0x75'))+'\x20not\x20found');}return _0x1d41fa['download'](_0x42de94);}})[_0xc075('0x27')](handleError(_0x1d41fa,null));};exports[_0xc075('0x77')]=function(_0x197c13,_0x26bcfd,_0x51fd72){if(_0x197c13[_0xc075('0x57')]&&_0x197c13[_0xc075('0x57')][_0xc075('0x58')]){_0x197c13[_0xc075('0x54')]['favicon']=_0x197c13['file'][_0xc075('0x58')];}return db[_0xc075('0x39')][_0xc075('0x53')]({'where':{'id':_0x197c13[_0xc075('0x55')]['id']}})[_0xc075('0x1c')](handleEntityNotFound(_0x26bcfd,null))[_0xc075('0x1c')](saveUpdates(_0x197c13[_0xc075('0x54')],null))[_0xc075('0x1c')](respondWithResult(_0x26bcfd,null))[_0xc075('0x27')](handleError(_0x26bcfd,null));};var utilLicense=require('../../config/license/util');exports[_0xc075('0x78')]=function(_0x21b38c,_0x223632,_0x370fb2){var _0x1ecb76=_0xc075('0x74');var _0x24c17d={'custom':![]};return utilLicense[_0xc075('0x5d')]()[_0xc075('0x1c')](function(_0x4f3a2f){if(_0x4f3a2f){_0x24c17d=_0x4f3a2f;}return db[_0xc075('0x39')][_0xc075('0x53')]({'where':{'id':_0x21b38c[_0xc075('0x55')]['id']},'attributes':['logo',_0xc075('0x5e'),_0xc075('0x75'),_0xc075('0x5f'),_0xc075('0x60'),_0xc075('0x6d'),_0xc075('0x61'),_0xc075('0x62')],'raw':!![]});})[_0xc075('0x1c')](handleEntityNotFound(_0x223632,null))[_0xc075('0x1c')](function(_0x57b04b){if(_0x57b04b){var _0x25ed7b=_0x57b04b[_0xc075('0x5f')]&&fs[_0xc075('0x63')](path[_0xc075('0x64')](config[_0xc075('0x65')],_0x1ecb76,_[_0xc075('0x66')](_0x57b04b[_0xc075('0x5f')])))?path['join'](config[_0xc075('0x65')],_0x1ecb76,_[_0xc075('0x66')](_0x57b04b['favicon'])):path[_0xc075('0x64')](config['root'],_0x1ecb76,_[_0xc075('0x66')](_0xc075('0x79')));var _0x5a6a2c=_0xc075('0x68')+_['upperFirst'](_0xc075('0x5f'));if(_0x57b04b[_0x5a6a2c]||!_0x24c17d['custom']){_0x25ed7b=path[_0xc075('0x64')](config[_0xc075('0x65')],_0x1ecb76,_[_0xc075('0x66')](_0xc075('0x79')));}if(!fs[_0xc075('0x63')](_0x25ed7b)){throw new db[(_0xc075('0x19'))][(_0xc075('0x6b'))](_[_0xc075('0x69')](_0xc075('0x5f'))+_0xc075('0x6f'));}return _0x223632[_0xc075('0x6c')](_0x25ed7b);}})[_0xc075('0x27')](handleError(_0x223632,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index eb2ab22..363333d 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 _0x1cbc=['util','moment','bluebird','request-promise','path','../../config/environment','./setting.attributes','exports','lodash'];(function(_0x369605,_0x4f5da9){var _0x48f6e3=function(_0x47ce1f){while(--_0x47ce1f){_0x369605['push'](_0x369605['shift']());}};_0x48f6e3(++_0x4f5da9);}(_0x1cbc,0x19d));var _0xc1cb=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x1cbc[_0x598efc];return _0x435e4f;};'use strict';var _=require(_0xc1cb('0x0'));var util=require(_0xc1cb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc1cb('0x2'));var BPromise=require(_0xc1cb('0x3'));var rp=require(_0xc1cb('0x4'));var fs=require('fs');var path=require(_0xc1cb('0x5'));var rimraf=require('rimraf');var config=require(_0xc1cb('0x6'));var attributes=require(_0xc1cb('0x7'));module[_0xc1cb('0x8')]=function(_0x25fe12,_0x40d18c){return _0x25fe12['define']('Setting',attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb62=['exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xeb62,0x149));var _0x2eb6=function(_0x43b512,_0x35f42b){_0x43b512=_0x43b512-0x0;var _0x370cb3=_0xeb62[_0x43b512];return _0x370cb3;};'use strict';var _=require(_0x2eb6('0x0'));var util=require('util');var logger=require(_0x2eb6('0x1'))(_0x2eb6('0x2'));var moment=require(_0x2eb6('0x3'));var BPromise=require(_0x2eb6('0x4'));var rp=require(_0x2eb6('0x5'));var fs=require('fs');var path=require(_0x2eb6('0x6'));var rimraf=require(_0x2eb6('0x7'));var config=require(_0x2eb6('0x8'));var attributes=require('./setting.attributes');module[_0x2eb6('0x9')]=function(_0x3bcb2b,_0x3a23d6){return _0x3bcb2b[_0x2eb6('0xa')](_0x2eb6('0xb'),attributes,{'tableName':_0x2eb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 47da89d..9e34db4 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 _0xf68e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0xdbc55a,_0x3e72d4){var _0x43f617=function(_0x3f9802){while(--_0x3f9802){_0xdbc55a['push'](_0xdbc55a['shift']());}};_0x43f617(++_0x3e72d4);}(_0xf68e,0x1b4));var _0xef68=function(_0x2588f0,_0x36455){_0x2588f0=_0x2588f0-0x0;var _0xe05c1=_0xf68e[_0x2588f0];return _0xe05c1;};'use strict';var _=require(_0xef68('0x0'));var util=require(_0xef68('0x1'));var moment=require(_0xef68('0x2'));var BPromise=require(_0xef68('0x3'));var rs=require(_0xef68('0x4'));var fs=require('fs');var Redis=require(_0xef68('0x5'));var db=require(_0xef68('0x6'))['db'];var utils=require(_0xef68('0x7'));var logger=require(_0xef68('0x8'))('rpc');var config=require(_0xef68('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21119a,_0x4866bd,_0x1c8c79){return new BPromise(function(_0x11a196,_0xc1b0a0){return client[_0xef68('0xa')](_0x21119a,_0x1c8c79)[_0xef68('0xb')](function(_0x7393c9){logger[_0xef68('0xc')]('Setting,\x20%s,\x20%s',_0x4866bd,_0xef68('0xd'));logger['debug'](_0xef68('0xe'),_0x4866bd,_0xef68('0xd'),JSON[_0xef68('0xf')](_0x7393c9));if(_0x7393c9['error']){if(_0x7393c9[_0xef68('0x10')]['code']===0x1f4){logger['error'](_0xef68('0x11'),_0x4866bd,_0x7393c9[_0xef68('0x10')][_0xef68('0x12')]);return _0xc1b0a0(_0x7393c9['error']['message']);}logger[_0xef68('0x10')](_0xef68('0x11'),_0x4866bd,_0x7393c9[_0xef68('0x10')][_0xef68('0x12')]);return _0x11a196(_0x7393c9[_0xef68('0x10')][_0xef68('0x12')]);}else{logger[_0xef68('0xc')](_0xef68('0x11'),_0x4866bd,_0xef68('0xd'));_0x11a196(_0x7393c9['result']['message']);}})[_0xef68('0x13')](function(_0x3f6782){logger['error']('Setting,\x20%s,\x20%s',_0x4866bd,_0x3f6782);_0xc1b0a0(_0x3f6782);});});} \ No newline at end of file +var _0xa204=['jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/environment'];(function(_0x48de9e,_0x144e00){var _0x20e60f=function(_0x2f65a3){while(--_0x2f65a3){_0x48de9e['push'](_0x48de9e['shift']());}};_0x20e60f(++_0x144e00);}(_0xa204,0x19c));var _0x4a20=function(_0xe13339,_0x5d1dc2){_0xe13339=_0xe13339-0x0;var _0x550e7c=_0xa204[_0xe13339];return _0x550e7c;};'use strict';var _=require('lodash');var util=require(_0x4a20('0x0'));var moment=require(_0x4a20('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a20('0x2'));var fs=require('fs');var Redis=require(_0x4a20('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a20('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4a20('0x5'));var jayson=require(_0x4a20('0x6'));var client=jayson[_0x4a20('0x7')][_0x4a20('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x121df4,_0x4b4b37,_0x665bee){return new BPromise(function(_0x225bd1,_0x2f13fe){return client[_0x4a20('0x9')](_0x121df4,_0x665bee)[_0x4a20('0xa')](function(_0x46a7f6){logger[_0x4a20('0xb')]('Setting,\x20%s,\x20%s',_0x4b4b37,_0x4a20('0xc'));logger[_0x4a20('0xd')](_0x4a20('0xe'),_0x4b4b37,_0x4a20('0xc'),JSON[_0x4a20('0xf')](_0x46a7f6));if(_0x46a7f6[_0x4a20('0x10')]){if(_0x46a7f6[_0x4a20('0x10')][_0x4a20('0x11')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x4b4b37,_0x46a7f6['error'][_0x4a20('0x12')]);return _0x2f13fe(_0x46a7f6[_0x4a20('0x10')][_0x4a20('0x12')]);}logger['error'](_0x4a20('0x13'),_0x4b4b37,_0x46a7f6[_0x4a20('0x10')][_0x4a20('0x12')]);return _0x225bd1(_0x46a7f6[_0x4a20('0x10')]['message']);}else{logger[_0x4a20('0xb')](_0x4a20('0x13'),_0x4b4b37,_0x4a20('0xc'));_0x225bd1(_0x46a7f6[_0x4a20('0x14')]['message']);}})[_0x4a20('0x15')](function(_0xc96516){logger[_0x4a20('0x10')]('Setting,\x20%s,\x20%s',_0x4b4b37,_0xc96516);_0x2f13fe(_0xc96516);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d527539..9c1fd62 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 _0x7a84=['getApplications','getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','send','/:id/status','status','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications'];(function(_0x145a54,_0x2cbcca){var _0x5ec128=function(_0x3d2f79){while(--_0x3d2f79){_0x145a54['push'](_0x145a54['shift']());}};_0x5ec128(++_0x2cbcca);}(_0x7a84,0x186));var _0x47a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a84[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x47a8('0x0'));var path=require(_0x47a8('0x1'));var timeout=require(_0x47a8('0x2'));var express=require('express');var router=express[_0x47a8('0x3')]();var auth=require(_0x47a8('0x4'));var interaction=require(_0x47a8('0x5'));var config=require('../../config/environment');var controller=require(_0x47a8('0x6'));router[_0x47a8('0x7')]('/',auth[_0x47a8('0x8')](),controller['index']);router['get']('/describe',auth[_0x47a8('0x8')](),controller[_0x47a8('0x9')]);router['get'](_0x47a8('0xa'),auth[_0x47a8('0x8')](),controller[_0x47a8('0xb')]);router[_0x47a8('0x7')](_0x47a8('0xc'),auth[_0x47a8('0x8')](),controller[_0x47a8('0xd')]);router['get'](_0x47a8('0xe'),auth['isAuthenticated'](),controller[_0x47a8('0xf')]);router[_0x47a8('0x7')](_0x47a8('0x10'),auth['isAuthenticated'](),controller[_0x47a8('0x11')]);router[_0x47a8('0x7')]('/:id/interactions',auth[_0x47a8('0x8')](),controller[_0x47a8('0x12')]);router[_0x47a8('0x7')]('/:id/status',controller[_0x47a8('0x13')]);router['get'](_0x47a8('0x14'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x15')]);router[_0x47a8('0x16')]('/',auth[_0x47a8('0x8')](),controller[_0x47a8('0x17')]);router[_0x47a8('0x16')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x47a8('0x18')]);router[_0x47a8('0x16')](_0x47a8('0xe'),auth[_0x47a8('0x8')](),controller['addAnswer']);router[_0x47a8('0x16')](_0x47a8('0x19'),controller[_0x47a8('0x1a')]);router[_0x47a8('0x16')]('/:id/applications',auth['isAuthenticated'](),controller[_0x47a8('0x1b')]);router[_0x47a8('0x16')]('/:id/send',auth[_0x47a8('0x8')](),controller[_0x47a8('0x1c')]);router['post'](_0x47a8('0x1d'),controller[_0x47a8('0x1e')]);router[_0x47a8('0x16')]('/:id/users',auth[_0x47a8('0x8')](),controller['addAgents']);router['put'](_0x47a8('0xa'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x1f')]);router['delete'](_0x47a8('0xa'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x20')]);router[_0x47a8('0x21')](_0x47a8('0xc'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x22')]);router[_0x47a8('0x21')](_0x47a8('0xe'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x23')]);router[_0x47a8('0x21')]('/:id/users',auth[_0x47a8('0x8')](),controller[_0x47a8('0x24')]);module['exports']=router; \ No newline at end of file +var _0xa16c=['getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','notify','addApplications','/:id/send','send','status','addAgents','put','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications'];(function(_0x3bbaf0,_0x10e62c){var _0x3be9f2=function(_0x1a5852){while(--_0x1a5852){_0x3bbaf0['push'](_0x3bbaf0['shift']());}};_0x3be9f2(++_0x10e62c);}(_0xa16c,0x66));var _0xca16=function(_0x475298,_0xa864e7){_0x475298=_0x475298-0x0;var _0x5ca4ba=_0xa16c[_0x475298];return _0x5ca4ba;};'use strict';var multer=require(_0xca16('0x0'));var util=require(_0xca16('0x1'));var path=require(_0xca16('0x2'));var timeout=require(_0xca16('0x3'));var express=require('express');var router=express[_0xca16('0x4')]();var auth=require(_0xca16('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca16('0x6'));var controller=require(_0xca16('0x7'));router[_0xca16('0x8')]('/',auth[_0xca16('0x9')](),controller['index']);router['get'](_0xca16('0xa'),auth[_0xca16('0x9')](),controller[_0xca16('0xb')]);router[_0xca16('0x8')](_0xca16('0xc'),auth['isAuthenticated'](),controller[_0xca16('0xd')]);router[_0xca16('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xca16('0xe')]);router[_0xca16('0x8')](_0xca16('0xf'),auth['isAuthenticated'](),controller[_0xca16('0x10')]);router[_0xca16('0x8')](_0xca16('0x11'),auth[_0xca16('0x9')](),controller[_0xca16('0x12')]);router[_0xca16('0x8')](_0xca16('0x13'),auth[_0xca16('0x9')](),controller['getInteractions']);router[_0xca16('0x8')](_0xca16('0x14'),controller[_0xca16('0x15')]);router[_0xca16('0x8')](_0xca16('0x16'),auth[_0xca16('0x9')](),controller[_0xca16('0x17')]);router[_0xca16('0x18')]('/',auth[_0xca16('0x9')](),controller[_0xca16('0x19')]);router[_0xca16('0x18')](_0xca16('0x1a'),auth['isAuthenticated'](),controller[_0xca16('0x1b')]);router[_0xca16('0x18')]('/:id/canned_answers',auth[_0xca16('0x9')](),controller['addAnswer']);router[_0xca16('0x18')]('/:id/notify',controller[_0xca16('0x1c')]);router[_0xca16('0x18')](_0xca16('0x11'),auth['isAuthenticated'](),controller[_0xca16('0x1d')]);router['post'](_0xca16('0x1e'),auth[_0xca16('0x9')](),controller[_0xca16('0x1f')]);router[_0xca16('0x18')](_0xca16('0x14'),controller[_0xca16('0x20')]);router[_0xca16('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xca16('0x21')]);router[_0xca16('0x22')](_0xca16('0xc'),auth[_0xca16('0x9')](),controller['update']);router[_0xca16('0x23')]('/:id',auth['isAuthenticated'](),controller[_0xca16('0x24')]);router[_0xca16('0x23')]('/:id/dispositions',auth[_0xca16('0x9')](),controller['removeDispositions']);router[_0xca16('0x23')](_0xca16('0xf'),auth['isAuthenticated'](),controller[_0xca16('0x25')]);router['delete'](_0xca16('0x16'),auth['isAuthenticated'](),controller[_0xca16('0x26')]);module[_0xca16('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index d52bd0b..a2e3297 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 _0xb0cf=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x4b5b68,_0x4ba484){var _0x364346=function(_0x29eb21){while(--_0x29eb21){_0x4b5b68['push'](_0x4b5b68['shift']());}};_0x364346(++_0x4ba484);}(_0xb0cf,0x107));var _0xfb0c=function(_0x3c6622,_0xeac315){_0x3c6622=_0x3c6622-0x0;var _0x4299a6=_0xb0cf[_0x3c6622];return _0x4299a6;};'use strict';var Sequelize=require(_0xfb0c('0x0'));var rs=require(_0xfb0c('0x1'));module[_0xfb0c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfb0c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfb0c('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xfb0c('0x4')],'defaultValue':function(){return rs[_0xfb0c('0x5')]();}},'phone':{'type':Sequelize[_0xfb0c('0x4')]},'type':{'type':Sequelize[_0xfb0c('0x6')](_0xfb0c('0x7'),'skebby','connectel',_0xfb0c('0x8'),_0xfb0c('0x9'),_0xfb0c('0xa'),_0xfb0c('0xb'),_0xfb0c('0xc'),_0xfb0c('0xd'))},'accountSid':{'type':Sequelize[_0xfb0c('0x4')]},'authId':{'type':Sequelize[_0xfb0c('0x4')]},'authToken':{'type':Sequelize[_0xfb0c('0x4')]},'smsMethod':{'type':Sequelize[_0xfb0c('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfb0c('0x4')]},'password':{'type':Sequelize[_0xfb0c('0x4')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xfb0c('0x4')]},'deliveryReport':{'type':Sequelize[_0xfb0c('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0xfb0c('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfb0c('0xf');}},'notificationSound':{'type':Sequelize[_0xfb0c('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb0c('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb0c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfb0c('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfb0c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfb0c('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb0c('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfb0c('0xe')],'defaultValue':![],'comment':_0xfb0c('0x11'),'set':function(_0x29382d){if(!_0x29382d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xfb0c('0x12')](_0xfb0c('0x13'),_0x29382d);}}}; \ No newline at end of file +var _0xe596=['csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','connectel','clicksend','plivo'];(function(_0x330d68,_0x8b3926){var _0x435ba=function(_0x57996f){while(--_0x57996f){_0x330d68['push'](_0x330d68['shift']());}};_0x435ba(++_0x8b3926);}(_0xe596,0x155));var _0x6e59=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xe596[_0x599f41];return _0x2e4d58;};'use strict';var Sequelize=require(_0x6e59('0x0'));var rs=require(_0x6e59('0x1'));module[_0x6e59('0x2')]={'name':{'type':Sequelize[_0x6e59('0x3')],'unique':_0x6e59('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6e59('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6e59('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6e59('0x3')],'defaultValue':function(){return rs[_0x6e59('0x5')]();}},'phone':{'type':Sequelize[_0x6e59('0x3')]},'type':{'type':Sequelize[_0x6e59('0x6')](_0x6e59('0x7'),'skebby',_0x6e59('0x8'),_0x6e59('0x9'),_0x6e59('0xa'),'clickatell',_0x6e59('0xb'),'infobip',_0x6e59('0xc'))},'accountSid':{'type':Sequelize[_0x6e59('0x3')]},'authId':{'type':Sequelize[_0x6e59('0x3')]},'authToken':{'type':Sequelize[_0x6e59('0x3')]},'smsMethod':{'type':Sequelize[_0x6e59('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6e59('0x3')]},'password':{'type':Sequelize[_0x6e59('0x3')]},'apiKey':{'type':Sequelize[_0x6e59('0x3')]},'senderString':{'type':Sequelize[_0x6e59('0x3')]},'deliveryReport':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e59('0xe')],'defaultValue':function(){return _0x6e59('0xf');}},'notificationSound':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e59('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e59('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x6e59('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e59('0x10')],'comment':_0x6e59('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x6e59('0xd')],'defaultValue':![],'comment':_0x6e59('0x12'),'set':function(_0x2e7a7e){if(!_0x2e7a7e)this['setDataValue'](_0x6e59('0x13'),null);this[_0x6e59('0x14')](_0x6e59('0x15'),_0x2e7a7e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8bc0410..1585c1a 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 _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','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','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','addApplications','sequelize','bulkCreate'];(function(_0x58c103,_0x151375){var _0x418962=function(_0xa23ac){while(--_0xa23ac){_0x58c103['push'](_0x58c103['shift']());}};_0x418962(++_0x151375);}(_0x7a54,0x106));var _0x47a5=function(_0x2a70ac,_0x5467f7){_0x2a70ac=_0x2a70ac-0x0;var _0x54ebb5=_0x7a54[_0x2a70ac];return _0x54ebb5;};'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'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('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 _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));}; \ No newline at end of file +var _0x9957=['show','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','sort','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','intelepeer','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','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','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','save','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x40b66c,_0x5c1d58){var _0x159671=function(_0x17a129){while(--_0x17a129){_0x40b66c['push'](_0x40b66c['shift']());}};_0x159671(++_0x5c1d58);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x7995('0x1e'));var client=jayson[_0x7995('0x1f')][_0x7995('0x20')]({'port':0x232c});function checkPasswordPattern(_0x321ae8,_0x3f1d3e,_0x1a5310){if(_0x1a5310){var _0x2202ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2202ce[_0x7995('0x21')](_0x3f1d3e)){return _0x321ae8;}else{throw new db['Sequelize'][(_0x7995('0x22'))]('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 _0x321ae8;}}function respondWithRpcPromise(_0x2f832e,_0x37f297,_0x43d4b8,_0x291317){return new BPromise(function(_0x1e1415,_0x37a7d4){var _0x4faa60=_0x291317||client;return _0x4faa60['request'](_0x2f832e,_0x43d4b8)[_0x7995('0x23')](function(_0x5e6f90){logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));logger['debug'](_0x7995('0x26'),_0x37f297,'request\x20sent',JSON['stringify'](_0x5e6f90));if(_0x5e6f90[_0x7995('0x27')]){if(_0x5e6f90[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')]['message']);return _0x37a7d4(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);return _0x1e1415(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}else{logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));_0x1e1415(_0x5e6f90[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x2a307e){logger['error'](_0x7995('0x24'),_0x37f297,_0x2a307e);_0x37a7d4(_0x2a307e);});});}function respondWithStatusCode(_0x5911c3,_0x229742){_0x229742=_0x229742||0xcc;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2c')](_0x229742);}return _0x5911c3[_0x7995('0x2d')](_0x229742)[_0x7995('0x2e')]();};}function respondWithResult(_0x4b6f99,_0x9b2a15){_0x9b2a15=_0x9b2a15||0xc8;return function(_0x514445){if(_0x514445){return _0x4b6f99[_0x7995('0x2d')](_0x9b2a15)[_0x7995('0x2f')](_0x514445);}};}function respondWithFilteredResult(_0x4253e5,_0x574574){return function(_0x530611){if(_0x530611){var _0x48e573=_0x530611[_0x7995('0x30')],_0x3573be=_0x574574[_0x7995('0x31')],_0xe6b0b3=_0x574574[_0x7995('0x31')]+_0x574574['limit'],_0x327a81;if(_0xe6b0b3>=_0x48e573){_0xe6b0b3=_0x48e573;_0x327a81=0xc8;}else{_0x327a81=0xce;}_0x4253e5['status'](_0x327a81);return _0x4253e5[_0x7995('0x32')]('Content-Range',_0x3573be+'-'+_0xe6b0b3+'/'+_0x48e573)[_0x7995('0x2f')](_0x530611);}return null;};}function patchUpdates(_0x3eb566){return function(_0x29fac5){try{jsonpatch[_0x7995('0x33')](_0x29fac5,_0x3eb566,!![]);}catch(_0x1f7d27){return BPromise['reject'](_0x1f7d27);}return _0x29fac5[_0x7995('0x34')]();};}function saveUpdates(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['update'](_0x33e24e)[_0x7995('0x23')](function(_0x3acfc3){return _0x3acfc3;});}return null;};}function removeEntity(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(_0x51b95d){return _0x51b95d[_0x7995('0x35')]()[_0x7995('0x23')](function(){var _0x177cb4=_0x51b95d['get']({'plain':!![]});var _0x52d76d=_0x7995('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x52d76d,'resourceId':_0x177cb4['id']}})[_0x7995('0x23')](function(){return _0x51b95d;});})[_0x7995('0x23')](function(){_0x4a176f['status'](0xcc)[_0x7995('0x2e')]();});}};}function handleEntityNotFound(_0x1922b4,_0x2b772f){return function(_0x18667c){if(!_0x18667c){_0x1922b4[_0x7995('0x2c')](0x194);}return _0x18667c;};}function handleError(_0x53002a,_0x2d4285){_0x2d4285=_0x2d4285||0x1f4;return function(_0x242713){logger[_0x7995('0x27')](_0x242713[_0x7995('0x37')]);if(_0x242713['name']){delete _0x242713[_0x7995('0x38')];}_0x53002a[_0x7995('0x2d')](_0x2d4285)[_0x7995('0x39')](_0x242713);};}exports[_0x7995('0x3a')]=function(_0x1f5bee,_0x1035dc){var _0x5688a1={'include':[{'model':db[_0x7995('0x3b')],'as':_0x7995('0x3c')}]},_0x183a68={},_0x3be298={'count':0x0,'rows':[]};var _0x2e04cd=_[_0x7995('0x3d')](db[_0x7995('0x3e')][_0x7995('0x3f')],function(_0x1234e1){return{'name':_0x1234e1[_0x7995('0x40')],'type':_0x1234e1[_0x7995('0x41')][_0x7995('0x42')]};});_0x183a68[_0x7995('0x43')]=_['map'](_0x2e04cd,'name');_0x183a68[_0x7995('0x44')]=_[_0x7995('0x45')](_0x1f5bee['query']);_0x183a68['filters']=_[_0x7995('0x46')](_0x183a68['model'],_0x183a68['query']);_0x5688a1[_0x7995('0x47')]=_[_0x7995('0x46')](_0x183a68[_0x7995('0x43')],qs['fields'](_0x1f5bee[_0x7995('0x44')]['fields']));_0x5688a1[_0x7995('0x47')]=_0x5688a1['attributes']['length']?_0x5688a1[_0x7995('0x47')]:_0x183a68[_0x7995('0x43')];if(!_0x1f5bee[_0x7995('0x44')][_0x7995('0x48')]('nolimit')){_0x5688a1[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x1f5bee[_0x7995('0x44')][_0x7995('0x49')]);_0x5688a1['offset']=qs['offset'](_0x1f5bee[_0x7995('0x44')]['offset']);}_0x5688a1[_0x7995('0x4a')]=qs['sort'](_0x1f5bee[_0x7995('0x44')]['sort']);_0x5688a1[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x1f5bee[_0x7995('0x44')],_0x183a68[_0x7995('0x4c')]),_0x2e04cd);if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x4d')]){_0x5688a1['where']=_[_0x7995('0x4e')](_0x5688a1[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x2e04cd,function(_0x491184){if(_0x491184[_0x7995('0x41')]!==_0x7995('0x4f')){var _0x511567={};_0x511567[_0x491184[_0x7995('0x38')]]={'$like':'%'+_0x1f5bee[_0x7995('0x44')]['filter']+'%'};return _0x511567;}})});}_0x5688a1=_[_0x7995('0x4e')]({},_0x5688a1,_0x1f5bee[_0x7995('0x50')]);var _0x5921b9={'where':_0x5688a1[_0x7995('0x4b')]};return db['SmsAccount'][_0x7995('0x30')](_0x5921b9)[_0x7995('0x23')](function(_0x1afab4){_0x3be298[_0x7995('0x30')]=_0x1afab4;if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x51')]){_0x5688a1[_0x7995('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0x7995('0x53')](_0x5688a1);})[_0x7995('0x23')](function(_0x418eb9){_0x3be298['rows']=_0x418eb9;return _0x3be298;})[_0x7995('0x23')](respondWithFilteredResult(_0x1035dc,_0x5688a1))[_0x7995('0x2b')](handleError(_0x1035dc,null));};exports[_0x7995('0x54')]=function(_0x47d1d8,_0x4ec548){var _0x5a592e={'raw':![],'where':{'id':_0x47d1d8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]},_0xb70620={};_0xb70620[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0x3e')][_0x7995('0x3f')]);_0xb70620['query']=_[_0x7995('0x45')](_0x47d1d8['query']);_0xb70620[_0x7995('0x4c')]=_[_0x7995('0x46')](_0xb70620[_0x7995('0x43')],_0xb70620['query']);_0x5a592e['attributes']=_['intersection'](_0xb70620['model'],qs[_0x7995('0x56')](_0x47d1d8[_0x7995('0x44')][_0x7995('0x56')]));_0x5a592e[_0x7995('0x47')]=_0x5a592e[_0x7995('0x47')][_0x7995('0x57')]?_0x5a592e[_0x7995('0x47')]:_0xb70620[_0x7995('0x43')];if(_0x47d1d8[_0x7995('0x44')][_0x7995('0x51')]){_0x5a592e[_0x7995('0x52')]=[{'all':!![]}];}_0x5a592e=_[_0x7995('0x4e')]({},_0x5a592e,_0x47d1d8[_0x7995('0x50')]);return db[_0x7995('0x3e')][_0x7995('0x58')](_0x5a592e)[_0x7995('0x23')](handleEntityNotFound(_0x4ec548,null))[_0x7995('0x23')](respondWithResult(_0x4ec548,null))[_0x7995('0x2b')](handleError(_0x4ec548,null));};exports[_0x7995('0x59')]=function(_0x50b7c2,_0x56a374){return db[_0x7995('0x3e')][_0x7995('0x59')](_0x50b7c2[_0x7995('0x5a')],{})['then'](function(_0x53125a){var _0x402fa0=_0x50b7c2[_0x7995('0x5b')][_0x7995('0x5c')]({'plain':!![]});if(!_0x402fa0)throw new Error(_0x7995('0x5d'));if(_0x402fa0['role']===_0x7995('0x5b')){var _0x74ff38=_0x53125a[_0x7995('0x5c')]({'plain':!![]});var _0x33c49c='SmsAccounts';return db['UserProfileSection'][_0x7995('0x58')]({'where':{'name':_0x33c49c,'userProfileId':_0x402fa0[_0x7995('0x5e')]},'raw':!![]})[_0x7995('0x23')](function(_0x1d69ce){if(_0x1d69ce&&_0x1d69ce[_0x7995('0x5f')]===0x0){return db[_0x7995('0x60')][_0x7995('0x59')]({'name':_0x74ff38[_0x7995('0x38')],'resourceId':_0x74ff38['id'],'type':_0x1d69ce[_0x7995('0x38')],'sectionId':_0x1d69ce['id']},{})['then'](function(){return _0x53125a;});}else{return _0x53125a;}})[_0x7995('0x2b')](function(_0x3ec5a8){logger[_0x7995('0x27')](_0x7995('0x61'),_0x3ec5a8);throw _0x3ec5a8;});}return _0x53125a;})['then'](respondWithResult(_0x56a374,0xc9))['catch'](handleError(_0x56a374,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7){if(_0xebb5c8[_0x7995('0x5a')]['id']){delete _0xebb5c8[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xebb5c8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]})['then'](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x23')](saveUpdates(_0xebb5c8[_0x7995('0x5a')],null))[_0x7995('0x23')](respondWithResult(_0x47d5d7,null))[_0x7995('0x2b')](handleError(_0x47d5d7,null));};exports[_0x7995('0x35')]=function(_0xeb8920,_0x2b3c1d){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xeb8920[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x2b3c1d,null))[_0x7995('0x23')](removeEntity(_0x2b3c1d,null))['catch'](handleError(_0x2b3c1d,null));};exports[_0x7995('0x63')]=function(_0x23bbc1,_0x293480){return db[_0x7995('0x3e')][_0x7995('0x63')]()['then'](respondWithResult(_0x293480,null))['catch'](handleError(_0x293480,null));};exports[_0x7995('0x64')]=function(_0x87e38d,_0x221542,_0xae6166){if(_0x87e38d['body']['id']){delete _0x87e38d[_0x7995('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x87e38d[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x221542,null))[_0x7995('0x23')](function(_0x44bf2b){if(_0x44bf2b){_0x87e38d[_0x7995('0x5a')][_0x7995('0x65')]=_0x44bf2b['id'];return db[_0x7995('0x66')][_0x7995('0x59')](_0x87e38d[_0x7995('0x5a')]);}})[_0x7995('0x23')](respondWithResult(_0x221542,null))['catch'](handleError(_0x221542,null));};exports[_0x7995('0x67')]=function(_0x8908cd,_0x3c5802,_0x4cc247){var _0x1fe1cb={'raw':![],'where':{}};var _0x1d2f9d={};var _0x705f0={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x8908cd[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3c5802,null))[_0x7995('0x23')](function(_0x2f94c4){if(_0x2f94c4){_0x1d2f9d[_0x7995('0x43')]=_[_0x7995('0x45')](db['Disposition']['rawAttributes']);_0x1d2f9d[_0x7995('0x44')]=_[_0x7995('0x45')](_0x8908cd[_0x7995('0x44')]);_0x1d2f9d[_0x7995('0x4c')]=_['intersection'](_0x1d2f9d[_0x7995('0x43')],_0x1d2f9d[_0x7995('0x44')]);_0x1fe1cb['attributes']=_['intersection'](_0x1d2f9d[_0x7995('0x43')],qs[_0x7995('0x56')](_0x8908cd['query'][_0x7995('0x56')]));_0x1fe1cb['attributes']=_0x1fe1cb[_0x7995('0x47')][_0x7995('0x57')]?_0x1fe1cb['attributes']:_0x1d2f9d['model'];if(!_0x8908cd[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x1fe1cb[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x8908cd[_0x7995('0x44')][_0x7995('0x49')]);_0x1fe1cb[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x8908cd[_0x7995('0x44')][_0x7995('0x31')]);}_0x1fe1cb[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x8908cd[_0x7995('0x44')][_0x7995('0x6a')]);_0x1fe1cb[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x8908cd[_0x7995('0x44')],_0x1d2f9d[_0x7995('0x4c')]));_0x1fe1cb[_0x7995('0x4b')][_0x7995('0x65')]=_0x2f94c4['id'];if(_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]){_0x1fe1cb[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x1fe1cb[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x1fe1cb[_0x7995('0x47')],function(_0x34724d){var _0x59efff={};_0x59efff[_0x34724d]={'$like':'%'+_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x59efff;})});}_0x1fe1cb=_['merge']({},_0x1fe1cb,_0x8908cd['options']);return db[_0x7995('0x66')][_0x7995('0x30')]({'where':_0x1fe1cb[_0x7995('0x4b')]})[_0x7995('0x23')](function(_0xe1ce4){_0x705f0[_0x7995('0x30')]=_0xe1ce4;if(_0x8908cd['query'][_0x7995('0x51')]){_0x1fe1cb[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x66')][_0x7995('0x53')](_0x1fe1cb);})[_0x7995('0x23')](function(_0x3f0bff){_0x705f0[_0x7995('0x6c')]=_0x3f0bff;return _0x705f0;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x3c5802,_0x1fe1cb))['catch'](handleError(_0x3c5802,null));};exports[_0x7995('0x6d')]=function(_0x2b8217,_0x5c04c9,_0x479271){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x2b8217[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x5c04c9,null))[_0x7995('0x23')](function(_0x4a02ea){if(_0x4a02ea){return _0x4a02ea[_0x7995('0x6d')](_0x2b8217[_0x7995('0x44')]['ids']);}})[_0x7995('0x23')](respondWithStatusCode(_0x5c04c9,null))[_0x7995('0x2b')](handleError(_0x5c04c9,null));};exports['addAnswer']=function(_0x1535a3,_0x4a5bc5,_0x135191){if(_0x1535a3[_0x7995('0x5a')]['id']){delete _0x1535a3[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x1535a3['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4a5bc5,null))[_0x7995('0x23')](function(_0x38b37f){if(_0x38b37f){_0x1535a3['body'][_0x7995('0x65')]=_0x38b37f['id'];return db[_0x7995('0x6e')][_0x7995('0x59')](_0x1535a3[_0x7995('0x5a')]);}})['then'](respondWithResult(_0x4a5bc5,null))[_0x7995('0x2b')](handleError(_0x4a5bc5,null));};exports[_0x7995('0x6f')]=function(_0x3a5f5e,_0x4aafa3,_0x5358d4){var _0x3fc10={'raw':![],'where':{}};var _0x333379={};var _0x4800a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x3a5f5e[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4aafa3,null))[_0x7995('0x23')](function(_0x2ba606){if(_0x2ba606){_0x333379['model']=_['keys'](db[_0x7995('0x6e')]['rawAttributes']);_0x333379['query']=_[_0x7995('0x45')](_0x3a5f5e[_0x7995('0x44')]);_0x333379[_0x7995('0x4c')]=_['intersection'](_0x333379[_0x7995('0x43')],_0x333379[_0x7995('0x44')]);_0x3fc10[_0x7995('0x47')]=_[_0x7995('0x46')](_0x333379[_0x7995('0x43')],qs['fields'](_0x3a5f5e[_0x7995('0x44')][_0x7995('0x56')]));_0x3fc10[_0x7995('0x47')]=_0x3fc10[_0x7995('0x47')]['length']?_0x3fc10[_0x7995('0x47')]:_0x333379[_0x7995('0x43')];if(!_0x3a5f5e['query'][_0x7995('0x48')](_0x7995('0x69'))){_0x3fc10['limit']=qs[_0x7995('0x49')](_0x3a5f5e['query'][_0x7995('0x49')]);_0x3fc10['offset']=qs[_0x7995('0x31')](_0x3a5f5e['query'][_0x7995('0x31')]);}_0x3fc10[_0x7995('0x4a')]=qs['sort'](_0x3a5f5e[_0x7995('0x44')]['sort']);_0x3fc10['where']=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x3a5f5e[_0x7995('0x44')],_0x333379[_0x7995('0x4c')]));_0x3fc10['where'][_0x7995('0x65')]=_0x2ba606['id'];if(_0x3a5f5e[_0x7995('0x44')]['filter']){_0x3fc10['where']=_[_0x7995('0x4e')](_0x3fc10['where'],{'$or':_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x47')],function(_0xfb4479){var _0x5b42be={};_0x5b42be[_0xfb4479]={'$like':'%'+_0x3a5f5e['query'][_0x7995('0x4d')]+'%'};return _0x5b42be;})});}_0x3fc10=_['merge']({},_0x3fc10,_0x3a5f5e[_0x7995('0x50')]);return db[_0x7995('0x6e')][_0x7995('0x30')]({'where':_0x3fc10[_0x7995('0x4b')]})['then'](function(_0x52d102){_0x4800a8['count']=_0x52d102;if(_0x3a5f5e[_0x7995('0x44')][_0x7995('0x51')]){_0x3fc10[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x6e')][_0x7995('0x53')](_0x3fc10);})[_0x7995('0x23')](function(_0x59a793){_0x4800a8['rows']=_0x59a793;return _0x4800a8;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x4aafa3,_0x3fc10))['catch'](handleError(_0x4aafa3,null));};exports['removeAnswers']=function(_0x17d00f,_0x5e95c0,_0x57a164){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x17d00f[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e95c0,null))[_0x7995('0x23')](function(_0xf604d9){if(_0xf604d9){return _0xf604d9[_0x7995('0x70')](_0x17d00f[_0x7995('0x44')][_0x7995('0x71')]);}})[_0x7995('0x23')](respondWithStatusCode(_0x5e95c0,null))[_0x7995('0x2b')](handleError(_0x5e95c0,null));};exports[_0x7995('0x72')]=function(_0x19d746,_0x570b71,_0x3eb3fa){var _0x87a539={'channel':_0x7995('0x73')};var _0x2056da=[];var _0x2a01d4=[];var _0x5a4695={};return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x19d746[_0x7995('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x17f7d6){_0x87a539[_0x7995('0x74')]=_0x17f7d6;_0x87a539[_0x7995('0x75')]=_[_0x7995('0x76')](_0x17f7d6[_0x7995('0x77')],['priority'],[_0x7995('0x78')]);if(_0x87a539['account'][_0x7995('0x77')]){delete _0x87a539[_0x7995('0x74')][_0x7995('0x77')];}return db[_0x7995('0x79')][_0x7995('0x63')]();})[_0x7995('0x23')](function(_0x4f929b){if(!_0x4f929b){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x7b'));}_0x2056da=_[_0x7995('0x7c')](_['keys'](_0x4f929b),[_0x7995('0x7d'),'updatedAt']);_0x2a01d4=_[_0x7995('0x7c')](_[_0x7995('0x45')](_0x4f929b),['createdAt','updatedAt',_0x7995('0x7e'),_0x7995('0x7f')]);_0x87a539[_0x7995('0x5a')]={'mapKey':_0x7995('0x80')};if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){switch(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){case _0x7995('0x81'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x83')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x85')];break;case _0x7995('0x86'):_0x87a539['body'][_0x7995('0x82')]='+'+_0x19d746['body'][_0x7995('0x87')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x88')];break;case _0x7995('0x89'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['message'];break;case _0x7995('0x8a'):_0x87a539[_0x7995('0x5a')]['from']=_0x19d746['body'][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['body'];_0x87a539['body'][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8b')];break;case _0x7995('0x8c'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')]['Text'];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x8d')];break;case _0x7995('0x8e'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]='+'+_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x88')];_0x87a539[_0x7995('0x5a')]['messageId']=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x84')];break;case _0x7995('0x90'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x91')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x92')][_0x7995('0x29')];break;case _0x7995('0x93'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746['body'][_0x7995('0x94')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x88')];_0x87a539['body'][_0x7995('0x84')]=_0x19d746['body']['replyMessageId'];break;case'intelepeer':_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['from'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x29')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x95')];break;}}if(_0x87a539['body']['id']){delete _0x87a539[_0x7995('0x5a')]['id'];}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x82')])){throw new db['Sequelize'][(_0x7995('0x22'))](_0x7995('0x97'));}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')])||_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x98'));}if(_['isNil'](_0x87a539[_0x7995('0x5a')]['mapKey'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x99')+_0x2a01d4);}if(!_['includes'](_0x2a01d4,_0x87a539['body'][_0x7995('0x9a')])){throw new db[(_0x7995('0x7a'))]['ValidationError'](_0x7995('0x9b')+_0x2a01d4);}_0x5a4695[_0x87a539['body'][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')][_0x7995('0x82')];return db[_0x7995('0x9c')]['find']({'where':{'id':_0x87a539['account'][_0x7995('0x7f')]},'include':[{'model':db[_0x7995('0x79')],'as':_0x7995('0x9d'),'where':_0x5a4695,'limit':0x1,'order':[[_0x7995('0x9e'),'DESC']]}]});})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x8b820b){if(_0x8b820b){_0x87a539[_0x7995('0x9f')]=_[_0x7995('0xa0')](_0x8b820b,['Contacts']);if(_0x8b820b['Contacts']['length']){return _0x8b820b[_0x7995('0x9d')][0x0];}var _0x24a3cf=_['defaults'](_0x87a539[_0x7995('0x5a')],{'firstName':_0x87a539['body'][_0x7995('0x82')],'ListId':_0x8b820b['id']});_0x24a3cf[_0x87a539[_0x7995('0x5a')][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')]['from'];return db[_0x7995('0x79')][_0x7995('0x59')](_0x24a3cf,{'fields':_0x2056da,'raw':!![]});}})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x2023a7){if(_0x2023a7){_0x87a539[_0x7995('0xa1')]=_0x2023a7;var _0x1d200d={'ContactId':_0x2023a7['id'],'phone':_0x87a539[_0x7995('0x5a')][_0x7995('0x82')],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id']};var _0x30893a={'ContactId':_0x2023a7['id'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'closed':![]};return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':_0x30893a})['then'](function(_0x764245){if(_0x764245){return[_0x764245,![]];}return db['SmsInteraction'][_0x7995('0x59')](_0x1d200d)[_0x7995('0x23')](function(_0x5cf7b2){return[_0x5cf7b2,!![]];});});}})[_0x7995('0xa3')](function(_0x55dc6c,_0x17c3f9){_0x87a539[_0x7995('0xa4')]=_0x55dc6c['get']({'plain':!![]});_0x87a539['interaction']['created']=![];if(_0x17c3f9){if(_0x87a539[_0x7995('0x74')][_0x7995('0xa5')]){_0x87a539[_0x7995('0x75')][_0x7995('0xa6')]({'id':0x0,'priority':_0x87a539['applications'][_0x7995('0x57')]+0x1,'app':_0x7995('0xa7'),'appdata':_0x7995('0xa8'),'interval':_0x7995('0xa9')});}_0x87a539[_0x7995('0xa4')][_0x7995('0xaa')]=!![];}return db[_0x7995('0xab')][_0x7995('0x59')]({'phone':_0x87a539['body'][_0x7995('0x82')],'messageId':_0x87a539[_0x7995('0x5a')][_0x7995('0x84')],'body':_0x87a539[_0x7995('0x5a')]['body'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'SmsInteractionId':_0x55dc6c['id'],'direction':'in','ContactId':_0x55dc6c[_0x7995('0xac')],'AttachmentId':_0x87a539[_0x7995('0x5a')][_0x7995('0xad')]});})[_0x7995('0x23')](function(_0x2e7416){_0x87a539['message']=_0x2e7416;if(_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]){return db[_0x7995('0xaf')][_0x7995('0x58')]({'attributes':['id',_0x7995('0x38')],'where':{'id':_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]}})[_0x7995('0x23')](function(_0xf76f46){if(_0xf76f46){_0x87a539[_0x7995('0x75')][_0x7995('0xb0')]({'id':0x0,'priority':0x0,'app':_0x7995('0xb1'),'appdata':_0xf76f46[_0x7995('0x38')]+','+(_0x87a539[_0x7995('0x74')][_0x7995('0xb2')]||0xa),'interval':_0x7995('0xa9')});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);})[_0x7995('0x23')](function(_0x51f854){if(_0x51f854){var _0x4cf7f1=0xc8;var _0x1a980b=_0x7995('0xb5');logger['info'](_0x7995('0x26'),_0x1a980b,_0x4cf7f1,'entity\x20found');logger[_0x7995('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1a980b,_0x4cf7f1,_0x7995('0xb7'),JSON[_0x7995('0xb8')](_0x51f854));if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]===_0x7995('0x81')){return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x32')](_0x7995('0xb9'),_0x7995('0xba'))[_0x7995('0x39')]('\x0a');}else{return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x2f')](_0x51f854);}}})[_0x7995('0x2b')](handleError(_0x570b71,null));};exports[_0x7995('0xbb')]=function(_0x54b803,_0x408c22,_0x1d2afe){return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x54b803['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x408c22,null))[_0x7995('0x23')](function(_0x31d0e9){if(_0x31d0e9){return db[_0x7995('0xbc')][_0x7995('0xbd')](function(_0x13dda4){return db[_0x7995('0xbe')][_0x7995('0x35')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'transaction':_0x13dda4})['then'](function(_0x3c81cc){var _0x5f5496=_[_0x7995('0x3d')](_0x54b803[_0x7995('0x5a')],function(_0x35b217){_0x35b217[_0x7995('0x65')]=_0x54b803['params']['id'];return _0x35b217;});return db[_0x7995('0xbe')][_0x7995('0xbf')](_0x5f5496,{'transaction':_0x13dda4});});})[_0x7995('0x23')](function(){return db[_0x7995('0xbe')][_0x7995('0xc0')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'order':_0x7995('0xc1')});});}})[_0x7995('0x23')](respondWithResult(_0x408c22,null))[_0x7995('0x2b')](handleError(_0x408c22,null));};exports[_0x7995('0xc2')]=function(_0x45f389,_0x44d6a8,_0x7d14e2){var _0x405711={};var _0x54e341={};var _0x5cb30e;var _0xdfc11d;return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x45f389['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x44d6a8,null))[_0x7995('0x23')](function(_0x610b81){if(_0x610b81){_0x5cb30e=_0x610b81;_0x54e341['model']=_[_0x7995('0x45')](db[_0x7995('0xbe')][_0x7995('0x3f')]);_0x54e341[_0x7995('0x44')]=_[_0x7995('0x45')](_0x45f389[_0x7995('0x44')]);_0x54e341[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x54e341[_0x7995('0x43')],_0x54e341[_0x7995('0x44')]);_0x405711[_0x7995('0x47')]=_['intersection'](_0x54e341['model'],qs[_0x7995('0x56')](_0x45f389['query'][_0x7995('0x56')]));_0x405711[_0x7995('0x47')]=_0x405711[_0x7995('0x47')][_0x7995('0x57')]?_0x405711[_0x7995('0x47')]:_0x54e341['model'];_0x405711['order']=qs[_0x7995('0x6a')](_0x45f389[_0x7995('0x44')][_0x7995('0x6a')]);_0x405711[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x45f389[_0x7995('0x44')],_0x54e341[_0x7995('0x4c')]));if(_0x45f389[_0x7995('0x44')][_0x7995('0x4d')]){_0x405711['where']=_[_0x7995('0x4e')](_0x405711[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x405711[_0x7995('0x47')],function(_0x511cf8){var _0x4d6da0={};_0x4d6da0[_0x511cf8]={'$like':'%'+_0x45f389['query']['filter']+'%'};return _0x4d6da0;})});}_0x405711=_['merge']({},_0x405711,_0x45f389[_0x7995('0x50')]);return _0x5cb30e['getApplications'](_0x405711);}})['then'](function(_0x32f19d){if(_0x32f19d){_0xdfc11d=_0x32f19d[_0x7995('0x57')];if(!_0x45f389[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x405711['limit']=qs[_0x7995('0x49')](_0x45f389[_0x7995('0x44')][_0x7995('0x49')]);_0x405711['offset']=qs[_0x7995('0x31')](_0x45f389[_0x7995('0x44')][_0x7995('0x31')]);}return _0x5cb30e['getApplications'](_0x405711);}})[_0x7995('0x23')](function(_0x15cfd3){if(_0x15cfd3){return _0x15cfd3?{'count':_0xdfc11d,'rows':_0x15cfd3}:null;}})[_0x7995('0x23')](respondWithResult(_0x44d6a8,null))[_0x7995('0x2b')](handleError(_0x44d6a8,null));};exports[_0x7995('0xc3')]=function(_0x574e2a,_0x1761e1,_0x2a4991){var _0xc8bbb4={'raw':![],'where':{}};var _0x484b6c={};var _0x20852c={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x574e2a[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1761e1,null))['then'](function(_0x2995a3){if(_0x2995a3){_0x484b6c[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xa2')][_0x7995('0x3f')]);_0x484b6c[_0x7995('0x44')]=_[_0x7995('0x45')](_0x574e2a['query']);_0x484b6c['filters']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],_0x484b6c['query']);_0xc8bbb4['attributes']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],qs[_0x7995('0x56')](_0x574e2a[_0x7995('0x44')][_0x7995('0x56')]));_0xc8bbb4[_0x7995('0x47')]=_0xc8bbb4[_0x7995('0x47')]['length']?_0xc8bbb4[_0x7995('0x47')]:_0x484b6c[_0x7995('0x43')];if(!_0x574e2a[_0x7995('0x44')][_0x7995('0x48')](_0x7995('0x69'))){_0xc8bbb4[_0x7995('0x49')]=qs['limit'](_0x574e2a[_0x7995('0x44')][_0x7995('0x49')]);_0xc8bbb4[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x574e2a[_0x7995('0x44')][_0x7995('0x31')]);}_0xc8bbb4[_0x7995('0x4a')]=qs['sort'](_0x574e2a[_0x7995('0x44')][_0x7995('0x6a')]);_0xc8bbb4[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x574e2a[_0x7995('0x44')],_0x484b6c['filters']));_0xc8bbb4[_0x7995('0x4b')][_0x7995('0x65')]=_0x2995a3['id'];if(_0x574e2a['query']['filter']){_0xc8bbb4['where']=_[_0x7995('0x4e')](_0xc8bbb4[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0xc8bbb4[_0x7995('0x47')],function(_0x503b32){var _0x2da21e={};_0x2da21e[_0x503b32]={'$like':'%'+_0x574e2a[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x2da21e;})});}_0xc8bbb4=_[_0x7995('0x4e')]({},_0xc8bbb4,_0x574e2a[_0x7995('0x50')]);return db[_0x7995('0xa2')][_0x7995('0x30')]({'where':_0xc8bbb4['where']})['then'](function(_0x2695eb){_0x20852c['count']=_0x2695eb;if(_0x574e2a['query'][_0x7995('0x51')]){_0xc8bbb4[_0x7995('0x52')]=[{'model':db[_0x7995('0x79')],'as':_0x7995('0xc4'),'required':![]},{'model':db[_0x7995('0xaf')],'as':_0x7995('0xc5'),'attributes':[_0x7995('0x38'),_0x7995('0xc6'),_0x7995('0xc7')],'required':![]},{'model':db[_0x7995('0xc8')],'as':_0x7995('0xc9'),'attributes':['id',_0x7995('0x38'),'color'],'where':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?{'id':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]}:undefined,'required':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?!![]:![]}];}return db[_0x7995('0xa2')]['findAll'](_0xc8bbb4);})[_0x7995('0x23')](function(_0x234832){_0x20852c[_0x7995('0x6c')]=_0x234832;return _0x20852c;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x1761e1,_0xc8bbb4))[_0x7995('0x2b')](handleError(_0x1761e1,null));};exports['send']=function(_0x2d1c14,_0x5e7fde,_0x156b65){var _0x12f4c5,_0x221be8,_0x5150aa;if(_[_0x7995('0x96')](_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')])||_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2d1c14[_0x7995('0x5a')]['to'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0xcb'));}_0x12f4c5=_0x2d1c14[_0x7995('0x5a')]['to'];return db[_0x7995('0x3e')]['find']({'where':{'id':_0x2d1c14[_0x7995('0x55')]['id']},'include':[{'model':db[_0x7995('0x9c')],'as':_0x7995('0xcc'),'include':[{'model':db[_0x7995('0x79')],'as':'Contacts','where':{'mobile':_0x12f4c5},'limit':0x1,'order':[['updatedAt',_0x7995('0xcd')]]}]}]})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0x3130f2){if(_0x3130f2&&_0x3130f2[_0x7995('0xcc')]){_0x221be8=_0x3130f2['get']({'plain':!![]});if(_0x221be8[_0x7995('0xcc')]&&_0x221be8[_0x7995('0xcc')][_0x7995('0x9d')][_0x7995('0x57')]){return _0x221be8[_0x7995('0xcc')]['Contacts'][0x0];}return db['CmContact'][_0x7995('0x59')](_[_0x7995('0x1b')](_0x2d1c14[_0x7995('0x5a')],{'firstName':_0x12f4c5,'mobile':_0x12f4c5,'phone':_0x12f4c5,'ListId':_0x221be8[_0x7995('0x7f')]}));}})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0xd0da6e){if(_0xd0da6e){_0x5150aa=_0xd0da6e;return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':{'ContactId':_0x5150aa['id'],'closed':![],'SmsAccountId':_0x221be8['id']}})[_0x7995('0x23')](function(_0x1949f5){if(_0x1949f5){return[_0x1949f5,![]];}return db['SmsInteraction']['create']({'UserId':_0x2d1c14['user']['id'],'ContactId':_0x5150aa['id'],'SmsAccountId':_0x221be8['id'],'phone':_0x12f4c5,'firstMsgDirection':'out','Messages':[_[_0x7995('0x4e')](_0x2d1c14[_0x7995('0x5a')],{'read':![],'body':_0x2d1c14['body'][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x7995('0x23')](function(_0x3ee80c){return[_0x3ee80c,!![]];});});}})[_0x7995('0xa3')](function(_0x8bd55,_0x20a056){if(_0x20a056){return _0x8bd55;}return db[_0x7995('0xab')][_0x7995('0x59')](_['merge'](_0x2d1c14['body'],{'read':![],'body':_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'SmsInteractionId':_0x8bd55['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']}))['then'](function(_0x2f96fd){_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')]=[];_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')][_0x7995('0xa6')](_0x2f96fd[_0x7995('0xce')]);return _0x8bd55;});})[_0x7995('0x23')](respondWithResult(_0x5e7fde,null))[_0x7995('0x2b')](handleError(_0x5e7fde,null));};exports['status']=function(_0x5136f5,_0x1161f2,_0x4bd222){if(_0x5136f5[_0x7995('0x5a')]['id']){delete _0x5136f5['body']['id'];}console[_0x7995('0xd0')](_0x7995('0xd1'),_0x5136f5[_0x7995('0x5a')]);var _0x4a75d2,_0x4c810d,_0x1401b4;return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x5136f5[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0xb0164a){if(_0xb0164a){_0x1401b4=_0xb0164a;logger[_0x7995('0xb6')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0xd2'),_0xb0164a['type'],util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb0164a[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x5136f5[_0x7995('0x5a')]['skebby_dispatch_id']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd4')]}});}break;case _0x7995('0x89'):if(_0x5136f5['body']['requestid']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd6')]}});}break;case _0x7995('0x8a'):if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]}});}break;case _0x7995('0x8e'):var _0x296643=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x296643[_0x7995('0x84')]&&_0x296643[_0x7995('0x2d')]['groupName']==='DELIVERED'){_0x4c810d=_0x296643[_0x7995('0x2d')][_0x7995('0xd8')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x296643['messageId']}});}break;case'clickatell':if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]}});}break;case _0x7995('0xd9'):if(_0x5136f5[_0x7995('0x5a')]['redif']&&_0x5136f5['body'][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')]['redif']}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0x308d0e){if(_0x308d0e){_0x4a75d2=_0x308d0e;switch(_0x1401b4[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x4c810d===_0x7995('0xda')){return _0x4a75d2['update']({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x86'),util['inspect'](_0x5136f5['body'],{'showHidden':![],'depth':null}));}break;case _0x7995('0x89'):if(_0x4c810d==='1'){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status',_0x7995('0x86'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5136f5[_0x7995('0x5a')][_0x7995('0xdb')]&&_0x4c810d>=0xc8&&_0x4c810d<=0xce){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x8a'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0x8e'):var _0x1f6c3e=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x1f6c3e['status'][_0x7995('0xd8')]===_0x7995('0xda')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7995('0x2d'),_0x7995('0x8e'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c810d==_0x7995('0xdc')||_0x4c810d==_0x7995('0xdd')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x93'),util['inspect'](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0xd9'):if(_0x4c810d===_0x7995('0xde')||_0x4c810d===_0x7995('0xdf')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),'status',_0x7995('0xd9'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4a75d2;}})['then'](respondWithResult(_0x1161f2,null))['catch'](handleError(_0x1161f2,null));};exports['statusGet']=function(_0x21ff84,_0x1763aa,_0x32e443){var _0x35b6f9,_0x17fab0,_0x4da0e8;return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x21ff84[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x5bc1b4){if(_0x5bc1b4){_0x4da0e8=_0x5bc1b4;logger[_0x7995('0xb6')](_0x7995('0x26'),'status',_0x7995('0xd2'),_0x5bc1b4['type'],util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));switch(_0x5bc1b4[_0x7995('0x41')]){case'csc':if(_0x21ff84['query'][_0x7995('0xe0')]&&_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')]){_0x17fab0=_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x21ff84[_0x7995('0x44')][_0x7995('0xe0')]}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x48c9fc){if(_0x48c9fc){_0x35b6f9=_0x48c9fc;switch(_0x4da0e8['type']){case _0x7995('0x90'):if(_0x17fab0==='2'||_0x17fab0==='6'){return _0x35b6f9[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status','csc',util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x35b6f9;}})['then'](respondWithResult(_0x1763aa,null))['catch'](handleError(_0x1763aa,null));};exports[_0x7995('0xe2')]=function(_0x469cd6,_0x3ad24,_0x17c27b){return db[_0x7995('0x3e')]['find']({'where':{'id':_0x469cd6[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3ad24,null))['then'](function(_0xf9859c){if(_0xf9859c){return _0xf9859c[_0x7995('0xe2')](_0x469cd6[_0x7995('0x5a')]['ids'],_[_0x7995('0xa0')](_0x469cd6[_0x7995('0x5a')],[_0x7995('0x71'),'id'])||{})[_0x7995('0xa3')](function(_0x113e03){for(var _0x5348b1=0x0;_0x5348b1<_0x469cd6['body'][_0x7995('0x71')]['length'];_0x5348b1+=0x1){socket[_0x7995('0xe3')]('userSmsAccount:save',{'UserId':_0x469cd6[_0x7995('0x5a')][_0x7995('0x71')][_0x5348b1],'SmsAccountId':_0x469cd6[_0x7995('0x55')]['id']});}return _0x113e03;});}})['then'](respondWithResult(_0x3ad24,null))['catch'](handleError(_0x3ad24,null));};exports['removeAgents']=function(_0x362580,_0x1da57f,_0x270ef3){return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x362580[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x1da57f,null))[_0x7995('0x23')](function(_0x39449e){if(_0x39449e){return _0x39449e[_0x7995('0xe4')](_0x362580[_0x7995('0x44')][_0x7995('0x71')])['then'](function(){if(_['isArray'](_0x362580[_0x7995('0x44')][_0x7995('0x71')])){for(var _0x134da2=0x0;_0x134da2<_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x7995('0x57')];_0x134da2+=0x1){socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x134da2]),'SmsAccountId':Number(_0x362580['params']['id'])});}}else{socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')]),'SmsAccountId':Number(_0x362580[_0x7995('0x55')]['id'])});}});}})[_0x7995('0x23')](respondWithStatusCode(_0x1da57f,null))[_0x7995('0x2b')](handleError(_0x1da57f,null));};exports['getAgents']=function(_0x5d0fe6,_0x43a8a4,_0x2aec8d){var _0x12df49={};var _0x1f4efc={};var _0x55ce63;var _0x572c53;return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x5d0fe6[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a8a4,null))[_0x7995('0x23')](function(_0x2265cf){if(_0x2265cf){_0x55ce63=_0x2265cf;_0x1f4efc[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xaf')][_0x7995('0x3f')]);_0x1f4efc[_0x7995('0x44')]=_[_0x7995('0x45')](_0x5d0fe6['query']);_0x1f4efc[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x1f4efc[_0x7995('0x43')],_0x1f4efc['query']);_0x12df49[_0x7995('0x47')]=_['intersection'](_0x1f4efc['model'],qs['fields'](_0x5d0fe6['query'][_0x7995('0x56')]));_0x12df49['attributes']=_0x12df49[_0x7995('0x47')][_0x7995('0x57')]?_0x12df49['attributes']:_0x1f4efc[_0x7995('0x43')];_0x12df49[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x5d0fe6[_0x7995('0x44')]['sort']);_0x12df49[_0x7995('0x4b')]=qs['filters'](_[_0x7995('0x6b')](_0x5d0fe6[_0x7995('0x44')],_0x1f4efc[_0x7995('0x4c')]));if(_0x5d0fe6[_0x7995('0x44')][_0x7995('0x4d')]){_0x12df49[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x12df49[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x12df49[_0x7995('0x47')],function(_0x4aa202){var _0x8c9b6f={};_0x8c9b6f[_0x4aa202]={'$like':'%'+_0x5d0fe6[_0x7995('0x44')]['filter']+'%'};return _0x8c9b6f;})});}_0x12df49=_[_0x7995('0x4e')]({},_0x12df49,_0x5d0fe6[_0x7995('0x50')]);return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x1a6f42){if(_0x1a6f42){_0x572c53=_0x1a6f42[_0x7995('0x57')];if(!_0x5d0fe6['query'][_0x7995('0x48')]('nolimit')){_0x12df49[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x5d0fe6[_0x7995('0x44')][_0x7995('0x49')]);_0x12df49[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x5d0fe6['query'][_0x7995('0x31')]);}return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x4c2faf){if(_0x4c2faf){return _0x4c2faf?{'count':_0x572c53,'rows':_0x4c2faf}:null;}})[_0x7995('0x23')](respondWithResult(_0x43a8a4,null))[_0x7995('0x2b')](handleError(_0x43a8a4,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 710d76d..1570172 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 _0x3165=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4a3094,_0x179b88){var _0x58105b=function(_0x4a661e){while(--_0x4a661e){_0x4a3094['push'](_0x4a3094['shift']());}};_0x58105b(++_0x179b88);}(_0x3165,0xbb));var _0x5316=function(_0x4409e6,_0x767847){_0x4409e6=_0x4409e6-0x0;var _0x348c46=_0x3165[_0x4409e6];return _0x348c46;};'use strict';var EventEmitter=require(_0x5316('0x0'));var SmsAccount=require(_0x5316('0x1'))['db'][_0x5316('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5316('0x3')](0x0);var events={'afterCreate':_0x5316('0x4'),'afterUpdate':_0x5316('0x5'),'afterDestroy':_0x5316('0x6')};function emitEvent(_0x49d016){return function(_0x2be3f6,_0x5b2c3a,_0x266eb8){SmsAccountEvents[_0x5316('0x7')](_0x49d016+':'+_0x2be3f6['id'],_0x2be3f6);SmsAccountEvents[_0x5316('0x7')](_0x49d016,_0x2be3f6);_0x266eb8(null);};}for(var e in events){if(events[_0x5316('0x8')](e)){var event=events[e];SmsAccount[_0x5316('0x9')](e,emitEvent(event));}}module[_0x5316('0xa')]=SmsAccountEvents; \ No newline at end of file +var _0x8873=['update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8873,0xc7));var _0x3887=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x8873[_0x39e283];return _0x7de89f;};'use strict';var EventEmitter=require(_0x3887('0x0'));var SmsAccount=require(_0x3887('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3887('0x2')](0x0);var events={'afterCreate':_0x3887('0x3'),'afterUpdate':_0x3887('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ba9f5){return function(_0x2b6466,_0x44a285,_0x241de6){SmsAccountEvents['emit'](_0x2ba9f5+':'+_0x2b6466['id'],_0x2b6466);SmsAccountEvents[_0x3887('0x5')](_0x2ba9f5,_0x2b6466);_0x241de6(null);};}for(var e in events){if(events[_0x3887('0x6')](e)){var event=events[e];SmsAccount['hook'](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 aa912c0..0107763 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 _0xe923=['bluebird','request-promise','./smsAccount.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x5737ab,_0x1c385c){var _0xcf4678=function(_0x5e5a6e){while(--_0x5e5a6e){_0x5737ab['push'](_0x5737ab['shift']());}};_0xcf4678(++_0x1c385c);}(_0xe923,0xd7));var _0x3e92=function(_0x22d1ef,_0x4a5152){_0x22d1ef=_0x22d1ef-0x0;var _0x47c5a3=_0xe923[_0x22d1ef];return _0x47c5a3;};'use strict';var _=require(_0x3e92('0x0'));var util=require(_0x3e92('0x1'));var logger=require(_0x3e92('0x2'))(_0x3e92('0x3'));var moment=require(_0x3e92('0x4'));var BPromise=require(_0x3e92('0x5'));var rp=require(_0x3e92('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e92('0x7'));module[_0x3e92('0x8')]=function(_0x3c92ce,_0x38eefe){return _0x3c92ce[_0x3e92('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03c4=['api','moment','request-promise','path','rimraf','exports','sms_accounts','../../config/logger'];(function(_0x1e231b,_0x3bdc83){var _0x204724=function(_0x4e4d22){while(--_0x4e4d22){_0x1e231b['push'](_0x1e231b['shift']());}};_0x204724(++_0x3bdc83);}(_0x03c4,0x1b7));var _0x403c=function(_0x24804d,_0x496c9d){_0x24804d=_0x24804d-0x0;var _0xde4ca9=_0x03c4[_0x24804d];return _0xde4ca9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x403c('0x0'))(_0x403c('0x1'));var moment=require(_0x403c('0x2'));var BPromise=require('bluebird');var rp=require(_0x403c('0x3'));var fs=require('fs');var path=require(_0x403c('0x4'));var rimraf=require(_0x403c('0x5'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x403c('0x6')]=function(_0x8ada7c,_0x14a2a9){return _0x8ada7c['define']('SmsAccount',attributes,{'tableName':_0x403c('0x7'),'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 7966200..2f4b9c0 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 _0x882f=['register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis','./smsAccount.socket'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0x882f,0xa8));var _0xf882=function(_0x1acefc,_0x5da0bf){_0x1acefc=_0x1acefc-0x0;var _0x543527=_0x882f[_0x1acefc];return _0x543527;};'use strict';var _=require(_0xf882('0x0'));var util=require(_0xf882('0x1'));var moment=require(_0xf882('0x2'));var BPromise=require(_0xf882('0x3'));var rs=require(_0xf882('0x4'));var fs=require('fs');var Redis=require(_0xf882('0x5'));var db=require(_0xf882('0x6'))['db'];var utils=require(_0xf882('0x7'));var logger=require(_0xf882('0x8'))(_0xf882('0x9'));var config=require(_0xf882('0xa'));var jayson=require(_0xf882('0xb'));var client=jayson['client'][_0xf882('0xc')]({'port':0x232a});config['redis']=_[_0xf882('0xd')](config['redis'],{'host':_0xf882('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf882('0xf')]));require(_0xf882('0x10'))[_0xf882('0x11')](socket);function respondWithRpcPromise(_0x5cf96c,_0x297ac8,_0x1e3ade){return new BPromise(function(_0x6e4a1,_0x317004){return client['request'](_0x5cf96c,_0x1e3ade)[_0xf882('0x12')](function(_0x201d14){logger[_0xf882('0x13')](_0xf882('0x14'),_0x297ac8,_0xf882('0x15'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x297ac8,_0xf882('0x15'),JSON[_0xf882('0x16')](_0x201d14));if(_0x201d14[_0xf882('0x17')]){if(_0x201d14[_0xf882('0x17')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x297ac8,_0x201d14['error'][_0xf882('0x18')]);return _0x317004(_0x201d14[_0xf882('0x17')]['message']);}logger['error'](_0xf882('0x14'),_0x297ac8,_0x201d14[_0xf882('0x17')][_0xf882('0x18')]);return _0x6e4a1(_0x201d14[_0xf882('0x17')][_0xf882('0x18')]);}else{logger[_0xf882('0x13')](_0xf882('0x14'),_0x297ac8,_0xf882('0x15'));_0x6e4a1(_0x201d14[_0xf882('0x19')][_0xf882('0x18')]);}})[_0xf882('0x1a')](function(_0x3372d6){logger[_0xf882('0x17')]('SmsAccount,\x20%s,\x20%s',_0x297ac8,_0x3372d6);_0x317004(_0x3372d6);});});}exports[_0xf882('0x1b')]=function(_0x2c3638){var _0xcaf07f=this;return new Promise(function(_0x46a97d,_0x316378){return db[_0xf882('0x1c')][_0xf882('0x1d')]({'raw':_0x2c3638[_0xf882('0x1e')]?_0x2c3638[_0xf882('0x1e')][_0xf882('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c3638['options']?_0x2c3638['options'][_0xf882('0x20')]||null:null,'attributes':_0x2c3638['options']?_0x2c3638['options'][_0xf882('0x21')]||null:null,'include':_0x2c3638[_0xf882('0x1e')]?_0x2c3638['options'][_0xf882('0x22')]?_['map'](_0x2c3638['options']['include'],function(_0x294013){return{'model':db[_0x294013[_0xf882('0x23')]],'as':_0x294013['as'],'attributes':_0x294013['attributes'],'include':_0x294013[_0xf882('0x22')]?_['map'](_0x294013['include'],function(_0x3dbe21){return{'model':db[_0x3dbe21[_0xf882('0x23')]],'as':_0x3dbe21['as'],'attributes':_0x3dbe21[_0xf882('0x21')],'include':_0x3dbe21['include']?_['map'](_0x3dbe21['include'],function(_0x1f3793){return{'model':db[_0x1f3793[_0xf882('0x23')]],'as':_0x1f3793['as'],'attributes':_0x1f3793['attributes']};}):[]};}):[]};}):[]:[]})[_0xf882('0x12')](function(_0x146a86){logger[_0xf882('0x13')]('ShowSmsAccount',_0x2c3638);logger[_0xf882('0x24')]('ShowSmsAccount',_0x2c3638,JSON[_0xf882('0x16')](_0x146a86));_0x46a97d(_0x146a86);})['catch'](function(_0x1bd403){logger[_0xf882('0x17')](_0xf882('0x1b'),_0x1bd403['message'],_0x2c3638);_0x316378(_0xcaf07f[_0xf882('0x17')](0x1f4,_0x1bd403[_0xf882('0x18')]));});});}; \ No newline at end of file +var _0x20f7=['message','catch','ShowSmsAccount','SmsAccount','find','options','include','map','model','attributes','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','register','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s'];(function(_0xbfa4ea,_0x1fd2af){var _0x36e21e=function(_0x885712){while(--_0x885712){_0xbfa4ea['push'](_0xbfa4ea['shift']());}};_0x36e21e(++_0x1fd2af);}(_0x20f7,0x177));var _0x720f=function(_0xe73228,_0x226565){_0xe73228=_0xe73228-0x0;var _0x3288ea=_0x20f7[_0xe73228];return _0x3288ea;};'use strict';var _=require(_0x720f('0x0'));var util=require(_0x720f('0x1'));var moment=require(_0x720f('0x2'));var BPromise=require(_0x720f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x720f('0x4'));var db=require(_0x720f('0x5'))['db'];var utils=require(_0x720f('0x6'));var logger=require('../../config/logger')(_0x720f('0x7'));var config=require(_0x720f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x720f('0x9')][_0x720f('0xa')]({'port':0x232a});config['redis']=_[_0x720f('0xb')](config[_0x720f('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x720f('0xc')]));require('./smsAccount.socket')[_0x720f('0xd')](socket);function respondWithRpcPromise(_0xc98cc,_0x56b904,_0x2a5ade){return new BPromise(function(_0x5882dc,_0x324450){return client['request'](_0xc98cc,_0x2a5ade)['then'](function(_0xdc783c){logger[_0x720f('0xe')]('SmsAccount,\x20%s,\x20%s',_0x56b904,_0x720f('0xf'));logger[_0x720f('0x10')](_0x720f('0x11'),_0x56b904,_0x720f('0xf'),JSON['stringify'](_0xdc783c));if(_0xdc783c[_0x720f('0x12')]){if(_0xdc783c[_0x720f('0x12')][_0x720f('0x13')]===0x1f4){logger[_0x720f('0x12')](_0x720f('0x14'),_0x56b904,_0xdc783c[_0x720f('0x12')][_0x720f('0x15')]);return _0x324450(_0xdc783c[_0x720f('0x12')]['message']);}logger['error'](_0x720f('0x14'),_0x56b904,_0xdc783c[_0x720f('0x12')][_0x720f('0x15')]);return _0x5882dc(_0xdc783c[_0x720f('0x12')][_0x720f('0x15')]);}else{logger[_0x720f('0xe')](_0x720f('0x14'),_0x56b904,_0x720f('0xf'));_0x5882dc(_0xdc783c['result'][_0x720f('0x15')]);}})[_0x720f('0x16')](function(_0x141da3){logger['error'](_0x720f('0x14'),_0x56b904,_0x141da3);_0x324450(_0x141da3);});});}exports[_0x720f('0x17')]=function(_0x25b6bc){var _0x334bc2=this;return new Promise(function(_0x178e49,_0x1ce216){return db[_0x720f('0x18')][_0x720f('0x19')]({'raw':_0x25b6bc[_0x720f('0x1a')]?_0x25b6bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x25b6bc[_0x720f('0x1a')]?_0x25b6bc[_0x720f('0x1a')]['where']||null:null,'attributes':_0x25b6bc[_0x720f('0x1a')]?_0x25b6bc[_0x720f('0x1a')]['attributes']||null:null,'include':_0x25b6bc[_0x720f('0x1a')]?_0x25b6bc[_0x720f('0x1a')][_0x720f('0x1b')]?_[_0x720f('0x1c')](_0x25b6bc[_0x720f('0x1a')][_0x720f('0x1b')],function(_0x555795){return{'model':db[_0x555795[_0x720f('0x1d')]],'as':_0x555795['as'],'attributes':_0x555795[_0x720f('0x1e')],'include':_0x555795[_0x720f('0x1b')]?_[_0x720f('0x1c')](_0x555795[_0x720f('0x1b')],function(_0x463e3e){return{'model':db[_0x463e3e[_0x720f('0x1d')]],'as':_0x463e3e['as'],'attributes':_0x463e3e['attributes'],'include':_0x463e3e[_0x720f('0x1b')]?_[_0x720f('0x1c')](_0x463e3e['include'],function(_0xc3afe2){return{'model':db[_0xc3afe2['model']],'as':_0xc3afe2['as'],'attributes':_0xc3afe2[_0x720f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x720f('0x1f')](function(_0x5dc10d){logger[_0x720f('0xe')](_0x720f('0x17'),_0x25b6bc);logger[_0x720f('0x10')]('ShowSmsAccount',_0x25b6bc,JSON[_0x720f('0x20')](_0x5dc10d));_0x178e49(_0x5dc10d);})['catch'](function(_0x2af552){logger[_0x720f('0x12')](_0x720f('0x17'),_0x2af552[_0x720f('0x15')],_0x25b6bc);_0x1ce216(_0x334bc2[_0x720f('0x12')](0x1f4,_0x2af552['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 529149b..4f098fb 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 _0xf35d=['register','length','./smsAccount.events','remove','emit','removeListener'];(function(_0x1bc00d,_0x4daebf){var _0xf61005=function(_0x1daadf){while(--_0x1daadf){_0x1bc00d['push'](_0x1bc00d['shift']());}};_0xf61005(++_0x4daebf);}(_0xf35d,0x17c));var _0xdf35=function(_0x17c3ea,_0x18f9a4){_0x17c3ea=_0x17c3ea-0x0;var _0x476d7f=_0xf35d[_0x17c3ea];return _0x476d7f;};'use strict';var SmsAccountEvents=require(_0xdf35('0x0'));var events=['save',_0xdf35('0x1'),'update'];function createListener(_0x1c77d6,_0x2c4abd){return function(_0x5a1692){_0x2c4abd[_0xdf35('0x2')](_0x1c77d6,_0x5a1692);};}function removeListener(_0x523d72,_0x222e83){return function(){SmsAccountEvents[_0xdf35('0x3')](_0x523d72,_0x222e83);};}exports[_0xdf35('0x4')]=function(_0x7cfe71){for(var _0x41036b=0x0,_0x30e2ee=events[_0xdf35('0x5')];_0x41036b<_0x30e2ee;_0x41036b++){var _0x5802cf=events[_0x41036b];var _0x49eb59=createListener('smsAccount:'+_0x5802cf,_0x7cfe71);SmsAccountEvents['on'](_0x5802cf,_0x49eb59);}}; \ No newline at end of file +var _0xc1a5=['register','length','./smsAccount.events','save','remove','update','emit','removeListener'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xc1a5,0x132));var _0x5c1a=function(_0x31c910,_0x18554){_0x31c910=_0x31c910-0x0;var _0x7d9a41=_0xc1a5[_0x31c910];return _0x7d9a41;};'use strict';var SmsAccountEvents=require(_0x5c1a('0x0'));var events=[_0x5c1a('0x1'),_0x5c1a('0x2'),_0x5c1a('0x3')];function createListener(_0x26c05d,_0x2444b8){return function(_0x2da0ad){_0x2444b8[_0x5c1a('0x4')](_0x26c05d,_0x2da0ad);};}function removeListener(_0x351fb4,_0x2dbc91){return function(){SmsAccountEvents[_0x5c1a('0x5')](_0x351fb4,_0x2dbc91);};}exports[_0x5c1a('0x6')]=function(_0x32ce42){for(var _0x3e3f86=0x0,_0x297bfc=events[_0x5c1a('0x7')];_0x3e3f86<_0x297bfc;_0x3e3f86++){var _0xf04148=events[_0x3e3f86];var _0x526e89=createListener('smsAccount:'+_0xf04148,_0x32ce42);SmsAccountEvents['on'](_0xf04148,_0x526e89);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 885f759..c45002e 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 _0xb7d2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','util'];(function(_0x2006b9,_0x4c8332){var _0x5ebfe7=function(_0x39c9e4){while(--_0x39c9e4){_0x2006b9['push'](_0x2006b9['shift']());}};_0x5ebfe7(++_0x4c8332);}(_0xb7d2,0x71));var _0x2b7d=function(_0x42f522,_0x594a2c){_0x42f522=_0x42f522-0x0;var _0x1a1377=_0xb7d2[_0x42f522];return _0x1a1377;};'use strict';var multer=require('multer');var util=require(_0x2b7d('0x0'));var path=require(_0x2b7d('0x1'));var timeout=require(_0x2b7d('0x2'));var express=require(_0x2b7d('0x3'));var router=express[_0x2b7d('0x4')]();var auth=require(_0x2b7d('0x5'));var interaction=require(_0x2b7d('0x6'));var config=require('../../config/environment');var controller=require(_0x2b7d('0x7'));router[_0x2b7d('0x8')]('/',auth[_0x2b7d('0x9')](),controller[_0x2b7d('0xa')]);router[_0x2b7d('0x8')]('/:id',auth[_0x2b7d('0x9')](),controller[_0x2b7d('0xb')]);router[_0x2b7d('0xc')]('/',auth[_0x2b7d('0x9')](),controller[_0x2b7d('0xd')]);router[_0x2b7d('0xe')](_0x2b7d('0xf'),auth[_0x2b7d('0x9')](),controller['update']);router[_0x2b7d('0x10')](_0x2b7d('0xf'),auth[_0x2b7d('0x9')](),controller[_0x2b7d('0x11')]);module[_0x2b7d('0x12')]=router; \ No newline at end of file +var _0x6f40=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x26b1bf,_0x1fd2cf){var _0x35311e=function(_0x1e303f){while(--_0x1e303f){_0x26b1bf['push'](_0x26b1bf['shift']());}};_0x35311e(++_0x1fd2cf);}(_0x6f40,0x6e));var _0x06f4=function(_0x55fbd9,_0x1acfa2){_0x55fbd9=_0x55fbd9-0x0;var _0x464cbf=_0x6f40[_0x55fbd9];return _0x464cbf;};'use strict';var multer=require('multer');var util=require(_0x06f4('0x0'));var path=require(_0x06f4('0x1'));var timeout=require(_0x06f4('0x2'));var express=require(_0x06f4('0x3'));var router=express[_0x06f4('0x4')]();var auth=require(_0x06f4('0x5'));var interaction=require(_0x06f4('0x6'));var config=require(_0x06f4('0x7'));var controller=require(_0x06f4('0x8'));router[_0x06f4('0x9')]('/',auth[_0x06f4('0xa')](),controller[_0x06f4('0xb')]);router[_0x06f4('0x9')](_0x06f4('0xc'),auth[_0x06f4('0xa')](),controller[_0x06f4('0xd')]);router[_0x06f4('0xe')]('/',auth['isAuthenticated'](),controller[_0x06f4('0xf')]);router['put'](_0x06f4('0xc'),auth[_0x06f4('0xa')](),controller[_0x06f4('0x10')]);router[_0x06f4('0x11')](_0x06f4('0xc'),auth[_0x06f4('0xa')](),controller[_0x06f4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index eae5130..af5c2f3 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 _0x2f15=['*,*,*,*','INTEGER','STRING','TEXT'];(function(_0x1b2e01,_0x174576){var _0x1425e5=function(_0x9b174f){while(--_0x9b174f){_0x1b2e01['push'](_0x1b2e01['shift']());}};_0x1425e5(++_0x174576);}(_0x2f15,0xad));var _0x52f1=function(_0x286892,_0xe74dd9){_0x286892=_0x286892-0x0;var _0x318e28=_0x2f15[_0x286892];return _0x318e28;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x52f1('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x52f1('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x52f1('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x52f1('0x1')],'defaultValue':_0x52f1('0x3')}}; \ No newline at end of file +var _0xcd00=['exports','INTEGER','TEXT','STRING','sequelize'];(function(_0x25dd67,_0x5612cf){var _0x242672=function(_0x2c6869){while(--_0x2c6869){_0x25dd67['push'](_0x25dd67['shift']());}};_0x242672(++_0x5612cf);}(_0xcd00,0x16c));var _0x0cd0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcd00[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x0cd0('0x0'));module[_0x0cd0('0x1')]={'priority':{'type':Sequelize[_0x0cd0('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0cd0('0x3')]()},'description':{'type':Sequelize[_0x0cd0('0x4')]},'interval':{'type':Sequelize[_0x0cd0('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index a26e261..5af9040 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 _0xb78e=['show','params','keys','length','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','update','then','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','include','rows','catch'];(function(_0x43b65f,_0xb59f1e){var _0x303772=function(_0x31a33e){while(--_0x31a33e){_0x43b65f['push'](_0x43b65f['shift']());}};_0x303772(++_0xb59f1e);}(_0xb78e,0x1c9));var _0xeb78=function(_0xaa72b3,_0xbd6780){_0xaa72b3=_0xaa72b3-0x0;var _0x3f7bf3=_0xb78e[_0xaa72b3];return _0x3f7bf3;};'use strict';var pdf=require(_0xeb78('0x0'));var emlformat=require(_0xeb78('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeb78('0x2'));var jsonpatch=require(_0xeb78('0x3'));var rp=require(_0xeb78('0x4'));var moment=require(_0xeb78('0x5'));var BPromise=require(_0xeb78('0x6'));var Mustache=require(_0xeb78('0x7'));var util=require(_0xeb78('0x8'));var path=require(_0xeb78('0x9'));var sox=require('sox');var csv=require(_0xeb78('0xa'));var ejs=require(_0xeb78('0xb'));var fs=require('fs');var _=require(_0xeb78('0xc'));var squel=require(_0xeb78('0xd'));var crypto=require(_0xeb78('0xe'));var jsforce=require(_0xeb78('0xf'));var deskjs=require(_0xeb78('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeb78('0x11'));var Papa=require(_0xeb78('0x12'));var Redis=require(_0xeb78('0x13'));var authService=require(_0xeb78('0x14'));var qs=require(_0xeb78('0x15'));var as=require(_0xeb78('0x16'));var hardwareService=require(_0xeb78('0x17'));var logger=require(_0xeb78('0x18'))(_0xeb78('0x19'));var utils=require('../../config/utils');var config=require(_0xeb78('0x1a'));var db=require(_0xeb78('0x1b'))['db'];function respondWithStatusCode(_0x3725e3,_0x259df2){_0x259df2=_0x259df2||0xcc;return function(_0x9dbe51){if(_0x9dbe51){return _0x3725e3[_0xeb78('0x1c')](_0x259df2);}return _0x3725e3[_0xeb78('0x1d')](_0x259df2)[_0xeb78('0x1e')]();};}function respondWithResult(_0x41bec0,_0x9bcc79){_0x9bcc79=_0x9bcc79||0xc8;return function(_0x5d50cf){if(_0x5d50cf){return _0x41bec0[_0xeb78('0x1d')](_0x9bcc79)[_0xeb78('0x1f')](_0x5d50cf);}};}function respondWithFilteredResult(_0x4e8b8c,_0x538485){return function(_0x53be89){if(_0x53be89){var _0x23a0d0=_0x53be89['count'],_0x50ebae=_0x538485[_0xeb78('0x20')],_0xa28d5e=_0x538485['offset']+_0x538485[_0xeb78('0x21')],_0x247cb1;if(_0xa28d5e>=_0x23a0d0){_0xa28d5e=_0x23a0d0;_0x247cb1=0xc8;}else{_0x247cb1=0xce;}_0x4e8b8c[_0xeb78('0x1d')](_0x247cb1);return _0x4e8b8c['set'](_0xeb78('0x22'),_0x50ebae+'-'+_0xa28d5e+'/'+_0x23a0d0)[_0xeb78('0x1f')](_0x53be89);}return null;};}function patchUpdates(_0x1cb338){return function(_0x5368ad){try{jsonpatch[_0xeb78('0x23')](_0x5368ad,_0x1cb338,!![]);}catch(_0x2c43c5){return BPromise['reject'](_0x2c43c5);}return _0x5368ad['save']();};}function saveUpdates(_0x455e30,_0x106c5d){return function(_0x42eacb){if(_0x42eacb){return _0x42eacb[_0xeb78('0x24')](_0x455e30)[_0xeb78('0x25')](function(_0x425de5){return _0x425de5;});}return null;};}function removeEntity(_0x2cf7cc,_0x3ea071){return function(_0x18f08d){if(_0x18f08d){return _0x18f08d['destroy']()['then'](function(){_0x2cf7cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8e66,_0x5b15d8){return function(_0x2159c1){if(!_0x2159c1){_0x3c8e66[_0xeb78('0x1c')](0x194);}return _0x2159c1;};}function handleError(_0x566336,_0x777ca3){_0x777ca3=_0x777ca3||0x1f4;return function(_0x4ac816){logger[_0xeb78('0x26')](_0x4ac816[_0xeb78('0x27')]);if(_0x4ac816[_0xeb78('0x28')]){delete _0x4ac816[_0xeb78('0x28')];}_0x566336['status'](_0x777ca3)[_0xeb78('0x29')](_0x4ac816);};}exports['index']=function(_0x31ad03,_0x23295a){var _0x4493bb={},_0x5263fc={},_0x1028ba={'count':0x0,'rows':[]};var _0x1e7d56=_[_0xeb78('0x2a')](db[_0xeb78('0x2b')][_0xeb78('0x2c')],function(_0x3516b8){return{'name':_0x3516b8[_0xeb78('0x2d')],'type':_0x3516b8[_0xeb78('0x2e')][_0xeb78('0x2f')]};});_0x5263fc[_0xeb78('0x30')]=_[_0xeb78('0x2a')](_0x1e7d56,'name');_0x5263fc['query']=_['keys'](_0x31ad03[_0xeb78('0x31')]);_0x5263fc[_0xeb78('0x32')]=_[_0xeb78('0x33')](_0x5263fc['model'],_0x5263fc[_0xeb78('0x31')]);_0x4493bb[_0xeb78('0x34')]=_[_0xeb78('0x33')](_0x5263fc[_0xeb78('0x30')],qs[_0xeb78('0x35')](_0x31ad03[_0xeb78('0x31')][_0xeb78('0x35')]));_0x4493bb[_0xeb78('0x34')]=_0x4493bb[_0xeb78('0x34')]['length']?_0x4493bb[_0xeb78('0x34')]:_0x5263fc['model'];if(!_0x31ad03[_0xeb78('0x31')][_0xeb78('0x36')](_0xeb78('0x37'))){_0x4493bb[_0xeb78('0x21')]=qs[_0xeb78('0x21')](_0x31ad03[_0xeb78('0x31')]['limit']);_0x4493bb['offset']=qs[_0xeb78('0x20')](_0x31ad03[_0xeb78('0x31')][_0xeb78('0x20')]);}_0x4493bb[_0xeb78('0x38')]=qs[_0xeb78('0x39')](_0x31ad03['query'][_0xeb78('0x39')]);_0x4493bb[_0xeb78('0x3a')]=qs[_0xeb78('0x32')](_[_0xeb78('0x3b')](_0x31ad03[_0xeb78('0x31')],_0x5263fc[_0xeb78('0x32')]),_0x1e7d56);if(_0x31ad03['query']['filter']){_0x4493bb['where']=_['merge'](_0x4493bb[_0xeb78('0x3a')],{'$or':_[_0xeb78('0x2a')](_0x1e7d56,function(_0x24a6e3){if(_0x24a6e3['type']!==_0xeb78('0x3c')){var _0x194cb5={};_0x194cb5[_0x24a6e3['name']]={'$like':'%'+_0x31ad03['query']['filter']+'%'};return _0x194cb5;}})});}_0x4493bb=_[_0xeb78('0x3d')]({},_0x4493bb,_0x31ad03[_0xeb78('0x3e')]);var _0x1ec55a={'where':_0x4493bb['where']};return db[_0xeb78('0x2b')][_0xeb78('0x3f')](_0x1ec55a)[_0xeb78('0x25')](function(_0x4fb001){_0x1028ba[_0xeb78('0x3f')]=_0x4fb001;if(_0x31ad03[_0xeb78('0x31')][_0xeb78('0x40')]){_0x4493bb[_0xeb78('0x41')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x4493bb);})[_0xeb78('0x25')](function(_0xa0284a){_0x1028ba[_0xeb78('0x42')]=_0xa0284a;return _0x1028ba;})[_0xeb78('0x25')](respondWithFilteredResult(_0x23295a,_0x4493bb))[_0xeb78('0x43')](handleError(_0x23295a,null));};exports[_0xeb78('0x44')]=function(_0x200600,_0x37d604){var _0x47567d={'raw':!![],'where':{'id':_0x200600[_0xeb78('0x45')]['id']}},_0x571552={};_0x571552[_0xeb78('0x30')]=_[_0xeb78('0x46')](db['SmsApplication'][_0xeb78('0x2c')]);_0x571552['query']=_[_0xeb78('0x46')](_0x200600[_0xeb78('0x31')]);_0x571552[_0xeb78('0x32')]=_['intersection'](_0x571552[_0xeb78('0x30')],_0x571552[_0xeb78('0x31')]);_0x47567d[_0xeb78('0x34')]=_[_0xeb78('0x33')](_0x571552[_0xeb78('0x30')],qs['fields'](_0x200600[_0xeb78('0x31')][_0xeb78('0x35')]));_0x47567d['attributes']=_0x47567d[_0xeb78('0x34')][_0xeb78('0x47')]?_0x47567d[_0xeb78('0x34')]:_0x571552['model'];if(_0x200600[_0xeb78('0x31')][_0xeb78('0x40')]){_0x47567d[_0xeb78('0x41')]=[{'all':!![]}];}_0x47567d=_[_0xeb78('0x3d')]({},_0x47567d,_0x200600[_0xeb78('0x3e')]);return db[_0xeb78('0x2b')]['find'](_0x47567d)['then'](handleEntityNotFound(_0x37d604,null))[_0xeb78('0x25')](respondWithResult(_0x37d604,null))[_0xeb78('0x43')](handleError(_0x37d604,null));};exports['create']=function(_0x108f8b,_0x3ee867){return db[_0xeb78('0x2b')][_0xeb78('0x48')](_0x108f8b[_0xeb78('0x49')],{})[_0xeb78('0x25')](respondWithResult(_0x3ee867,0xc9))[_0xeb78('0x43')](handleError(_0x3ee867,null));};exports[_0xeb78('0x24')]=function(_0x9d5b17,_0x2ba296){if(_0x9d5b17[_0xeb78('0x49')]['id']){delete _0x9d5b17[_0xeb78('0x49')]['id'];}return db[_0xeb78('0x2b')][_0xeb78('0x4a')]({'where':{'id':_0x9d5b17[_0xeb78('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ba296,null))[_0xeb78('0x25')](saveUpdates(_0x9d5b17[_0xeb78('0x49')],null))[_0xeb78('0x25')](respondWithResult(_0x2ba296,null))[_0xeb78('0x43')](handleError(_0x2ba296,null));};exports['destroy']=function(_0x35cedb,_0x135106){return db[_0xeb78('0x2b')][_0xeb78('0x4a')]({'where':{'id':_0x35cedb[_0xeb78('0x45')]['id']}})['then'](handleEntityNotFound(_0x135106,null))['then'](removeEntity(_0x135106,null))['catch'](handleError(_0x135106,null));}; \ No newline at end of file +var _0xe2cf=['rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','include','findAll','catch','show','params','includeAll','find','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','index','map','SmsApplication'];(function(_0x489641,_0x1be13e){var _0xb1e3de=function(_0x1f538a){while(--_0x1f538a){_0x489641['push'](_0x489641['shift']());}};_0xb1e3de(++_0x1be13e);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x411dc3,_0x47a8e4){_0x411dc3=_0x411dc3-0x0;var _0x5b870b=_0xe2cf[_0x411dc3];return _0x5b870b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe2c('0x2'));var moment=require(_0xfe2c('0x3'));var BPromise=require(_0xfe2c('0x4'));var Mustache=require(_0xfe2c('0x5'));var util=require('util');var path=require(_0xfe2c('0x6'));var sox=require(_0xfe2c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0xb'));var querystring=require(_0xfe2c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xd'));var qs=require(_0xfe2c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xf'));var logger=require(_0xfe2c('0x10'))(_0xfe2c('0x11'));var utils=require(_0xfe2c('0x12'));var config=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];function respondWithStatusCode(_0x39ce22,_0x4af8b7){_0x4af8b7=_0x4af8b7||0xcc;return function(_0x5e7389){if(_0x5e7389){return _0x39ce22['sendStatus'](_0x4af8b7);}return _0x39ce22['status'](_0x4af8b7)[_0xfe2c('0x15')]();};}function respondWithResult(_0x54d2d4,_0x5a6ad5){_0x5a6ad5=_0x5a6ad5||0xc8;return function(_0x38ba2c){if(_0x38ba2c){return _0x54d2d4[_0xfe2c('0x16')](_0x5a6ad5)[_0xfe2c('0x17')](_0x38ba2c);}};}function respondWithFilteredResult(_0x12e4c4,_0x522692){return function(_0x5039cb){if(_0x5039cb){var _0x1a4684=_0x5039cb['count'],_0x3b3ebd=_0x522692[_0xfe2c('0x18')],_0x1dbed4=_0x522692[_0xfe2c('0x18')]+_0x522692[_0xfe2c('0x19')],_0x56cebc;if(_0x1dbed4>=_0x1a4684){_0x1dbed4=_0x1a4684;_0x56cebc=0xc8;}else{_0x56cebc=0xce;}_0x12e4c4[_0xfe2c('0x16')](_0x56cebc);return _0x12e4c4[_0xfe2c('0x1a')](_0xfe2c('0x1b'),_0x3b3ebd+'-'+_0x1dbed4+'/'+_0x1a4684)['json'](_0x5039cb);}return null;};}function patchUpdates(_0x22481a){return function(_0xa9b1dc){try{jsonpatch[_0xfe2c('0x1c')](_0xa9b1dc,_0x22481a,!![]);}catch(_0x51086d){return BPromise['reject'](_0x51086d);}return _0xa9b1dc[_0xfe2c('0x1d')]();};}function saveUpdates(_0x59bdeb,_0x4e9137){return function(_0x408f31){if(_0x408f31){return _0x408f31[_0xfe2c('0x1e')](_0x59bdeb)['then'](function(_0xc42d82){return _0xc42d82;});}return null;};}function removeEntity(_0x1e2519,_0x5e609f){return function(_0x1bd50e){if(_0x1bd50e){return _0x1bd50e['destroy']()[_0xfe2c('0x1f')](function(){_0x1e2519[_0xfe2c('0x16')](0xcc)[_0xfe2c('0x15')]();});}};}function handleEntityNotFound(_0x298819,_0x360928){return function(_0x2ee3b3){if(!_0x2ee3b3){_0x298819['sendStatus'](0x194);}return _0x2ee3b3;};}function handleError(_0x41a545,_0x45a722){_0x45a722=_0x45a722||0x1f4;return function(_0xe74ca1){logger[_0xfe2c('0x20')](_0xe74ca1[_0xfe2c('0x21')]);if(_0xe74ca1[_0xfe2c('0x22')]){delete _0xe74ca1['name'];}_0x41a545[_0xfe2c('0x16')](_0x45a722)['send'](_0xe74ca1);};}exports[_0xfe2c('0x23')]=function(_0x2fcf5d,_0x1c35d3){var _0x54e356={},_0x377cc5={},_0x344ca0={'count':0x0,'rows':[]};var _0x59094a=_[_0xfe2c('0x24')](db[_0xfe2c('0x25')][_0xfe2c('0x26')],function(_0x53a8c1){return{'name':_0x53a8c1[_0xfe2c('0x27')],'type':_0x53a8c1[_0xfe2c('0x28')]['key']};});_0x377cc5['model']=_[_0xfe2c('0x24')](_0x59094a,_0xfe2c('0x22'));_0x377cc5[_0xfe2c('0x29')]=_[_0xfe2c('0x2a')](_0x2fcf5d[_0xfe2c('0x29')]);_0x377cc5['filters']=_[_0xfe2c('0x2b')](_0x377cc5[_0xfe2c('0x2c')],_0x377cc5[_0xfe2c('0x29')]);_0x54e356[_0xfe2c('0x2d')]=_[_0xfe2c('0x2b')](_0x377cc5[_0xfe2c('0x2c')],qs[_0xfe2c('0x2e')](_0x2fcf5d[_0xfe2c('0x29')][_0xfe2c('0x2e')]));_0x54e356[_0xfe2c('0x2d')]=_0x54e356[_0xfe2c('0x2d')][_0xfe2c('0x2f')]?_0x54e356['attributes']:_0x377cc5[_0xfe2c('0x2c')];if(!_0x2fcf5d[_0xfe2c('0x29')][_0xfe2c('0x30')]('nolimit')){_0x54e356[_0xfe2c('0x19')]=qs[_0xfe2c('0x19')](_0x2fcf5d['query'][_0xfe2c('0x19')]);_0x54e356[_0xfe2c('0x18')]=qs[_0xfe2c('0x18')](_0x2fcf5d['query'][_0xfe2c('0x18')]);}_0x54e356[_0xfe2c('0x31')]=qs[_0xfe2c('0x32')](_0x2fcf5d[_0xfe2c('0x29')][_0xfe2c('0x32')]);_0x54e356[_0xfe2c('0x33')]=qs[_0xfe2c('0x34')](_['pick'](_0x2fcf5d['query'],_0x377cc5[_0xfe2c('0x34')]),_0x59094a);if(_0x2fcf5d[_0xfe2c('0x29')][_0xfe2c('0x35')]){_0x54e356[_0xfe2c('0x33')]=_['merge'](_0x54e356[_0xfe2c('0x33')],{'$or':_['map'](_0x59094a,function(_0x35aaee){if(_0x35aaee[_0xfe2c('0x28')]!=='VIRTUAL'){var _0x1d5877={};_0x1d5877[_0x35aaee['name']]={'$like':'%'+_0x2fcf5d['query'][_0xfe2c('0x35')]+'%'};return _0x1d5877;}})});}_0x54e356=_[_0xfe2c('0x36')]({},_0x54e356,_0x2fcf5d[_0xfe2c('0x37')]);var _0x5e48bb={'where':_0x54e356[_0xfe2c('0x33')]};return db[_0xfe2c('0x25')][_0xfe2c('0x38')](_0x5e48bb)[_0xfe2c('0x1f')](function(_0x5d2811){_0x344ca0[_0xfe2c('0x38')]=_0x5d2811;if(_0x2fcf5d[_0xfe2c('0x29')]['includeAll']){_0x54e356[_0xfe2c('0x39')]=[{'all':!![]}];}return db[_0xfe2c('0x25')][_0xfe2c('0x3a')](_0x54e356);})['then'](function(_0x4c1e95){_0x344ca0['rows']=_0x4c1e95;return _0x344ca0;})[_0xfe2c('0x1f')](respondWithFilteredResult(_0x1c35d3,_0x54e356))[_0xfe2c('0x3b')](handleError(_0x1c35d3,null));};exports[_0xfe2c('0x3c')]=function(_0x1b9c5b,_0x5769f3){var _0x1ed30b={'raw':!![],'where':{'id':_0x1b9c5b[_0xfe2c('0x3d')]['id']}},_0x645585={};_0x645585[_0xfe2c('0x2c')]=_[_0xfe2c('0x2a')](db['SmsApplication'][_0xfe2c('0x26')]);_0x645585[_0xfe2c('0x29')]=_[_0xfe2c('0x2a')](_0x1b9c5b[_0xfe2c('0x29')]);_0x645585['filters']=_['intersection'](_0x645585[_0xfe2c('0x2c')],_0x645585[_0xfe2c('0x29')]);_0x1ed30b['attributes']=_[_0xfe2c('0x2b')](_0x645585[_0xfe2c('0x2c')],qs[_0xfe2c('0x2e')](_0x1b9c5b[_0xfe2c('0x29')]['fields']));_0x1ed30b[_0xfe2c('0x2d')]=_0x1ed30b[_0xfe2c('0x2d')][_0xfe2c('0x2f')]?_0x1ed30b[_0xfe2c('0x2d')]:_0x645585[_0xfe2c('0x2c')];if(_0x1b9c5b[_0xfe2c('0x29')][_0xfe2c('0x3e')]){_0x1ed30b[_0xfe2c('0x39')]=[{'all':!![]}];}_0x1ed30b=_['merge']({},_0x1ed30b,_0x1b9c5b[_0xfe2c('0x37')]);return db['SmsApplication'][_0xfe2c('0x3f')](_0x1ed30b)[_0xfe2c('0x1f')](handleEntityNotFound(_0x5769f3,null))[_0xfe2c('0x1f')](respondWithResult(_0x5769f3,null))[_0xfe2c('0x3b')](handleError(_0x5769f3,null));};exports['create']=function(_0x588e57,_0x47dfbc){return db['SmsApplication']['create'](_0x588e57[_0xfe2c('0x40')],{})['then'](respondWithResult(_0x47dfbc,0xc9))['catch'](handleError(_0x47dfbc,null));};exports[_0xfe2c('0x1e')]=function(_0x5d76be,_0x2c02d1){if(_0x5d76be['body']['id']){delete _0x5d76be[_0xfe2c('0x40')]['id'];}return db[_0xfe2c('0x25')][_0xfe2c('0x3f')]({'where':{'id':_0x5d76be[_0xfe2c('0x3d')]['id']}})[_0xfe2c('0x1f')](handleEntityNotFound(_0x2c02d1,null))['then'](saveUpdates(_0x5d76be[_0xfe2c('0x40')],null))[_0xfe2c('0x1f')](respondWithResult(_0x2c02d1,null))[_0xfe2c('0x3b')](handleError(_0x2c02d1,null));};exports['destroy']=function(_0x150762,_0x44f0ba){return db['SmsApplication']['find']({'where':{'id':_0x150762['params']['id']}})[_0xfe2c('0x1f')](handleEntityNotFound(_0x44f0ba,null))[_0xfe2c('0x1f')](removeEntity(_0x44f0ba,null))[_0xfe2c('0x3b')](handleError(_0x44f0ba,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6dcc603..55e3734 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 _0x86d5=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x86d5,0x1e3));var _0x586d=function(_0x3ed50d,_0x428212){_0x3ed50d=_0x3ed50d-0x0;var _0x41fdb5=_0x86d5[_0x3ed50d];return _0x41fdb5;};'use strict';var _=require(_0x586d('0x0'));var util=require('util');var logger=require(_0x586d('0x1'))(_0x586d('0x2'));var moment=require('moment');var BPromise=require(_0x586d('0x3'));var rp=require(_0x586d('0x4'));var fs=require('fs');var path=require(_0x586d('0x5'));var rimraf=require(_0x586d('0x6'));var config=require(_0x586d('0x7'));var attributes=require(_0x586d('0x8'));module[_0x586d('0x9')]=function(_0x51b8b0,_0x3fac92){return _0x51b8b0[_0x586d('0xa')](_0x586d('0xb'),attributes,{'tableName':_0x586d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x586d('0xd'),'collate':_0x586d('0xe')});}; \ No newline at end of file +var _0x5b76=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x5b76,0x118));var _0x65b7=function(_0x27e462,_0x6ba481){_0x27e462=_0x27e462-0x0;var _0x1520f7=_0x5b76[_0x27e462];return _0x1520f7;};'use strict';var _=require(_0x65b7('0x0'));var util=require(_0x65b7('0x1'));var logger=require(_0x65b7('0x2'))(_0x65b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x65b7('0x4'));var fs=require('fs');var path=require(_0x65b7('0x5'));var rimraf=require(_0x65b7('0x6'));var config=require(_0x65b7('0x7'));var attributes=require(_0x65b7('0x8'));module[_0x65b7('0x9')]=function(_0x4679a2,_0xe74d4){return _0x4679a2[_0x65b7('0xa')]('SmsApplication',attributes,{'tableName':_0x65b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x65b7('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5fb42bd..8aa477d 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 _0x04f1=['http','request','then','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x193a9f,_0x53bcc3){var _0x369b17=function(_0x304f91){while(--_0x304f91){_0x193a9f['push'](_0x193a9f['shift']());}};_0x369b17(++_0x53bcc3);}(_0x04f1,0x92));var _0x104f=function(_0x36b124,_0x43eaec){_0x36b124=_0x36b124-0x0;var _0x18a336=_0x04f1[_0x36b124];return _0x18a336;};'use strict';var _=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var moment=require(_0x104f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x104f('0x3'));var db=require(_0x104f('0x4'))['db'];var utils=require(_0x104f('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x104f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x289bb8,_0x5b7110,_0x1d5651){return new BPromise(function(_0x57acf5,_0x47582b){return client[_0x104f('0x7')](_0x289bb8,_0x1d5651)[_0x104f('0x8')](function(_0x37891c){logger['info']('SmsApplication,\x20%s,\x20%s',_0x5b7110,_0x104f('0x9'));logger[_0x104f('0xa')](_0x104f('0xb'),_0x5b7110,_0x104f('0x9'),JSON[_0x104f('0xc')](_0x37891c));if(_0x37891c[_0x104f('0xd')]){if(_0x37891c[_0x104f('0xd')][_0x104f('0xe')]===0x1f4){logger[_0x104f('0xd')](_0x104f('0xf'),_0x5b7110,_0x37891c['error'][_0x104f('0x10')]);return _0x47582b(_0x37891c[_0x104f('0xd')][_0x104f('0x10')]);}logger[_0x104f('0xd')](_0x104f('0xf'),_0x5b7110,_0x37891c[_0x104f('0xd')][_0x104f('0x10')]);return _0x57acf5(_0x37891c[_0x104f('0xd')][_0x104f('0x10')]);}else{logger[_0x104f('0x11')](_0x104f('0xf'),_0x5b7110,_0x104f('0x9'));_0x57acf5(_0x37891c[_0x104f('0x12')][_0x104f('0x10')]);}})['catch'](function(_0x12b9a6){logger[_0x104f('0xd')](_0x104f('0xf'),_0x5b7110,_0x12b9a6);_0x47582b(_0x12b9a6);});});} \ No newline at end of file +var _0x2e3b=['jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1cda82,_0x545bbe){var _0x5adf6e=function(_0x3adbce){while(--_0x3adbce){_0x1cda82['push'](_0x1cda82['shift']());}};_0x5adf6e(++_0x545bbe);}(_0x2e3b,0x81));var _0xb2e3=function(_0x4c859e,_0x5b048f){_0x4c859e=_0x4c859e-0x0;var _0xc8de25=_0x2e3b[_0x4c859e];return _0xc8de25;};'use strict';var _=require('lodash');var util=require(_0xb2e3('0x0'));var moment=require(_0xb2e3('0x1'));var BPromise=require(_0xb2e3('0x2'));var rs=require(_0xb2e3('0x3'));var fs=require('fs');var Redis=require(_0xb2e3('0x4'));var db=require(_0xb2e3('0x5'))['db'];var utils=require(_0xb2e3('0x6'));var logger=require(_0xb2e3('0x7'))('rpc');var config=require(_0xb2e3('0x8'));var jayson=require(_0xb2e3('0x9'));var client=jayson['client'][_0xb2e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x108b1c,_0x4c006a,_0x14758e){return new BPromise(function(_0x2d952,_0x4fbc94){return client[_0xb2e3('0xb')](_0x108b1c,_0x14758e)[_0xb2e3('0xc')](function(_0x412912){logger[_0xb2e3('0xd')](_0xb2e3('0xe'),_0x4c006a,'request\x20sent');logger[_0xb2e3('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x4c006a,_0xb2e3('0x10'),JSON[_0xb2e3('0x11')](_0x412912));if(_0x412912[_0xb2e3('0x12')]){if(_0x412912[_0xb2e3('0x12')][_0xb2e3('0x13')]===0x1f4){logger[_0xb2e3('0x12')](_0xb2e3('0xe'),_0x4c006a,_0x412912['error']['message']);return _0x4fbc94(_0x412912['error'][_0xb2e3('0x14')]);}logger[_0xb2e3('0x12')](_0xb2e3('0xe'),_0x4c006a,_0x412912[_0xb2e3('0x12')]['message']);return _0x2d952(_0x412912[_0xb2e3('0x12')][_0xb2e3('0x14')]);}else{logger[_0xb2e3('0xd')](_0xb2e3('0xe'),_0x4c006a,_0xb2e3('0x10'));_0x2d952(_0x412912[_0xb2e3('0x15')][_0xb2e3('0x14')]);}})[_0xb2e3('0x16')](function(_0xa90515){logger['error']('SmsApplication,\x20%s,\x20%s',_0x4c006a,_0xa90515);_0x4fbc94(_0xa90515);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 242b35b..c823c23 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 _0x8f22=['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','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','/:id','tracked'];(function(_0x3e9041,_0x58ab0e){var _0xf111fe=function(_0x2e9293){while(--_0x2e9293){_0x3e9041['push'](_0x3e9041['shift']());}};_0xf111fe(++_0x58ab0e);}(_0x8f22,0x1e3));var _0x28f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f22[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x28f2('0x0'));var util=require(_0x28f2('0x1'));var path=require(_0x28f2('0x2'));var timeout=require(_0x28f2('0x3'));var express=require(_0x28f2('0x4'));var router=express[_0x28f2('0x5')]();var auth=require(_0x28f2('0x6'));var interaction=require(_0x28f2('0x7'));var config=require(_0x28f2('0x8'));var controller=require(_0x28f2('0x9'));router[_0x28f2('0xa')]('/',auth[_0x28f2('0xb')](),controller[_0x28f2('0xc')]);router[_0x28f2('0xa')](_0x28f2('0xd'),auth[_0x28f2('0xb')](),controller['describe']);router['get']('/:id',auth[_0x28f2('0xb')](),controller[_0x28f2('0xe')]);router[_0x28f2('0xa')](_0x28f2('0xf'),auth[_0x28f2('0xb')](),controller[_0x28f2('0x10')]);router['get'](_0x28f2('0x11'),auth['isAuthenticated'](),controller[_0x28f2('0x12')]);router[_0x28f2('0x13')]('/',auth[_0x28f2('0xb')](),controller['create']);router[_0x28f2('0x13')](_0x28f2('0xf'),auth['isAuthenticated'](),controller[_0x28f2('0x14')]);router[_0x28f2('0x13')](_0x28f2('0x15'),auth[_0x28f2('0xb')](),interaction['tracked'](_0x28f2('0x16'),_0x28f2('0x17')),controller[_0x28f2('0x18')]);router['put'](_0x28f2('0x19'),auth['isAuthenticated'](),interaction[_0x28f2('0x1a')](_0x28f2('0x16'),_0x28f2('0x1b')),controller[_0x28f2('0x1c')]);router[_0x28f2('0x1d')](_0x28f2('0x19'),auth[_0x28f2('0xb')](),interaction[_0x28f2('0x1a')](_0x28f2('0x16'),_0x28f2('0x1e')),controller[_0x28f2('0x1f')]);router[_0x28f2('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x28f2('0x20')]);module[_0x28f2('0x21')]=router; \ No newline at end of file +var _0xa72d=['addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','destroy','removeTags','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','create'];(function(_0x3ab393,_0x50d9c5){var _0x39d838=function(_0x9c0b89){while(--_0x9c0b89){_0x3ab393['push'](_0x3ab393['shift']());}};_0x39d838(++_0x50d9c5);}(_0xa72d,0x1bf));var _0xda72=function(_0x5ed207,_0x1ea18f){_0x5ed207=_0x5ed207-0x0;var _0xf5377d=_0xa72d[_0x5ed207];return _0xf5377d;};'use strict';var multer=require(_0xda72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda72('0x1'));var express=require(_0xda72('0x2'));var router=express[_0xda72('0x3')]();var auth=require(_0xda72('0x4'));var interaction=require(_0xda72('0x5'));var config=require(_0xda72('0x6'));var controller=require(_0xda72('0x7'));router[_0xda72('0x8')]('/',auth['isAuthenticated'](),controller[_0xda72('0x9')]);router[_0xda72('0x8')](_0xda72('0xa'),auth['isAuthenticated'](),controller[_0xda72('0xb')]);router[_0xda72('0x8')](_0xda72('0xc'),auth[_0xda72('0xd')](),controller[_0xda72('0xe')]);router[_0xda72('0x8')](_0xda72('0xf'),auth[_0xda72('0xd')](),controller[_0xda72('0x10')]);router['get']('/:id/download',auth[_0xda72('0xd')](),controller['download']);router['post']('/',auth[_0xda72('0xd')](),controller[_0xda72('0x11')]);router['post'](_0xda72('0xf'),auth[_0xda72('0xd')](),controller[_0xda72('0x12')]);router[_0xda72('0x13')](_0xda72('0x14'),auth['isAuthenticated'](),interaction[_0xda72('0x15')](_0xda72('0x16'),_0xda72('0x17')),controller[_0xda72('0x18')]);router[_0xda72('0x19')](_0xda72('0xc'),auth[_0xda72('0xd')](),interaction[_0xda72('0x15')]('sms','smsinteraction:update'),controller[_0xda72('0x1a')]);router[_0xda72('0x1b')](_0xda72('0xc'),auth[_0xda72('0xd')](),interaction[_0xda72('0x15')](_0xda72('0x16'),'smsinteraction:destroy'),controller[_0xda72('0x1c')]);router[_0xda72('0x1b')](_0xda72('0x14'),auth[_0xda72('0xd')](),controller[_0xda72('0x1d')]);module[_0xda72('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8c349c4..9afa0b6 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 _0x0713=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3071('0x0')]={'closed':{'type':Sequelize[_0x3071('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3071('0x2')]},'disposition':{'type':Sequelize[_0x3071('0x3')]},'note':{'type':Sequelize[_0x3071('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3071('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3071('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x5b086e,_0x5eb6c0){var _0x3e2c2c=function(_0x1c5de7){while(--_0x1c5de7){_0x5b086e['push'](_0x5b086e['shift']());}};_0x3e2c2c(++_0x5eb6c0);}(_0x757a,0xde));var _0xa757=function(_0x4412de,_0x20fe95){_0x4412de=_0x4412de-0x0;var _0x2e1031=_0x757a[_0x4412de];return _0x2e1031;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'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 3b4fe31..d41c2ae 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 _0x70e0=['u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','start','end','keys','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','show','params','includeAll','include','create','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','files','tmp','join','server','transcript-%d-%s.zip','CmContact','lastName','Messages','SmsAccount','Account','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
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','\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\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\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%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\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\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{{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\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\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%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\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','%s\x20#%d','Sms','closed','direction','out','System','firstName','renderFile','root','views','toFile','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','sendStatus','status','count','offset','limit','apply','reject','update','then','destroy','error','name','send','map','fullname','Tags','TagIds','split','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','field','color','from','tools_tags','select'];(function(_0x4026d1,_0x53f826){var _0x4f978e=function(_0x1dd9f){while(--_0x1dd9f){_0x4026d1['push'](_0x4026d1['shift']());}};_0x4f978e(++_0x53f826);}(_0x70e0,0x17b));var _0x070e=function(_0x126a63,_0x25f4ec){_0x126a63=_0x126a63-0x0;var _0x1bf55d=_0x70e0[_0x126a63];return _0x1bf55d;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];config[_0x070e('0x16')]=_[_0x070e('0x17')](config[_0x070e('0x16')],{'host':_0x070e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x19'))['register'](socket);function respondWithStatusCode(_0x4a33d2,_0x5bae0f){_0x5bae0f=_0x5bae0f||0xcc;return function(_0x11d2ce){if(_0x11d2ce){return _0x4a33d2[_0x070e('0x1a')](_0x5bae0f);}return _0x4a33d2['status'](_0x5bae0f)['end']();};}function respondWithResult(_0x373d86,_0xeae1a5){_0xeae1a5=_0xeae1a5||0xc8;return function(_0x180897){if(_0x180897){return _0x373d86[_0x070e('0x1b')](_0xeae1a5)['json'](_0x180897);}};}function respondWithFilteredResult(_0x49861b,_0x17e2e4){return function(_0x2bd937){if(_0x2bd937){var _0x38f6e6=_0x2bd937[_0x070e('0x1c')],_0x2060cc=_0x17e2e4[_0x070e('0x1d')],_0x364b3f=_0x17e2e4[_0x070e('0x1d')]+_0x17e2e4[_0x070e('0x1e')],_0x5037eb;if(_0x364b3f>=_0x38f6e6){_0x364b3f=_0x38f6e6;_0x5037eb=0xc8;}else{_0x5037eb=0xce;}_0x49861b[_0x070e('0x1b')](_0x5037eb);return _0x49861b['set']('Content-Range',_0x2060cc+'-'+_0x364b3f+'/'+_0x38f6e6)['json'](_0x2bd937);}return null;};}function patchUpdates(_0x9907cf){return function(_0x3004f0){try{jsonpatch[_0x070e('0x1f')](_0x3004f0,_0x9907cf,!![]);}catch(_0x4be0d7){return BPromise[_0x070e('0x20')](_0x4be0d7);}return _0x3004f0['save']();};}function saveUpdates(_0xf8dd5d,_0x3f6985){return function(_0x27a01e){if(_0x27a01e){return _0x27a01e[_0x070e('0x21')](_0xf8dd5d)[_0x070e('0x22')](function(_0xa86797){return _0xa86797;});}return null;};}function removeEntity(_0xe405e,_0x164cdf){return function(_0x595c7e){if(_0x595c7e){return _0x595c7e[_0x070e('0x23')]()[_0x070e('0x22')](function(){_0xe405e[_0x070e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf17c56,_0x5f3e9d){return function(_0x4a2dbd){if(!_0x4a2dbd){_0xf17c56[_0x070e('0x1a')](0x194);}return _0x4a2dbd;};}function handleError(_0x25f6e,_0x41deb1){_0x41deb1=_0x41deb1||0x1f4;return function(_0x1743cc){logger[_0x070e('0x24')](_0x1743cc['stack']);if(_0x1743cc[_0x070e('0x25')]){delete _0x1743cc[_0x070e('0x25')];}_0x25f6e[_0x070e('0x1b')](_0x41deb1)[_0x070e('0x26')](_0x1743cc);};}function getInteractionUsers(_0x43dd96,_0x28d7f2){return new BPromise(function(_0x1a1892,_0x26373b){try{if(_0x28d7f2[_0x43dd96['id']]){_0x43dd96['Users']=_[_0x070e('0x27')](_0x28d7f2[_0x43dd96['id']],function(_0x351641){return{'id':_0x351641['id'],'fullname':_0x351641[_0x070e('0x28')]};});}}catch(_0x56fc12){_0x26373b(_0x56fc12);}_0x1a1892(_0x43dd96);});}function getInteractionTags(_0x5c5f0d,_0x13097f){return new BPromise(function(_0x46065c,_0xa6c0ab){try{if(_0x5c5f0d['TagIds']){_0x5c5f0d[_0x070e('0x29')]=[];_0x5c5f0d[_0x070e('0x2a')][_0x070e('0x2b')](',')[_0x070e('0x2c')](function(_0x53d473){_0x5c5f0d['Tags']['push'](_0x13097f[_0x53d473]);});}delete _0x5c5f0d['TagIds'];}catch(_0xdf8945){_0xa6c0ab(_0xdf8945);}_0x46065c(_0x5c5f0d);});}function updateSmsInteraction(_0x4e0a7d,_0x1dff97,_0x323cf1){return new BPromise(function(_0x4f8130,_0x47a739){return getInteractionUsers(_0x4e0a7d,_0x323cf1)[_0x070e('0x22')](function(_0x3454c7){return getInteractionTags(_0x3454c7,_0x1dff97);})['then'](function(_0x546a16){_0x4f8130(_0x546a16);})[_0x070e('0x2d')](function(_0x27dd1f){_0x47a739(_0x27dd1f);});});}exports[_0x070e('0x2e')]=function(_0x31fdc5,_0x18f0ad){var _0x5f530d={},_0x482cc2={},_0x24d17d={'count':0x0,'rows':[]};var _0x3011c4=_[_0x070e('0x27')](db[_0x070e('0x2f')][_0x070e('0x30')],function(_0x4deaf8){return{'name':_0x4deaf8[_0x070e('0x31')],'type':_0x4deaf8[_0x070e('0x32')]['key']};});_0x482cc2[_0x070e('0x33')]=_[_0x070e('0x27')](_0x3011c4,'name');_0x482cc2['query']=_['keys'](_0x31fdc5[_0x070e('0x34')]);_0x482cc2[_0x070e('0x35')]=_[_0x070e('0x36')](_0x482cc2[_0x070e('0x33')],_0x482cc2[_0x070e('0x34')]);_0x5f530d['attributes']=_[_0x070e('0x36')](_0x482cc2[_0x070e('0x33')],qs[_0x070e('0x37')](_0x31fdc5['query'][_0x070e('0x37')]));_0x5f530d[_0x070e('0x38')]=_0x5f530d[_0x070e('0x38')]['length']?_0x5f530d[_0x070e('0x38')]:_0x482cc2[_0x070e('0x33')];if(!_0x31fdc5['query'][_0x070e('0x39')]('nolimit')){_0x5f530d[_0x070e('0x1e')]=qs[_0x070e('0x1e')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x1e')]);_0x5f530d[_0x070e('0x1d')]=qs['offset'](_0x31fdc5[_0x070e('0x34')]['offset']);}_0x5f530d['order']=qs[_0x070e('0x3a')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x3a')]);_0x5f530d['where']=qs[_0x070e('0x35')](_[_0x070e('0x3b')](_0x31fdc5[_0x070e('0x34')],_0x482cc2[_0x070e('0x35')]),_0x3011c4);var _0x4a4ee3=[];var _0x13e4e0=squel['select']()['field']('id')['field'](_0x070e('0x25'))[_0x070e('0x3c')](_0x070e('0x3d'))[_0x070e('0x3e')](_0x070e('0x3f'));var _0x562aa4=squel[_0x070e('0x40')]()['field'](_0x070e('0x41'))[_0x070e('0x3c')](_0x070e('0x42'))['field']('ui.SmsInteractionId')[_0x070e('0x3e')]('user_has_sms_interactions','ui')[_0x070e('0x43')](_0x070e('0x44'),'u',_0x070e('0x45'));var _0x5f5675=squel[_0x070e('0x40')]()[_0x070e('0x3e')]('sms_interactions','i')['left_join'](_0x070e('0x46'),'c',_0x070e('0x47'))[_0x070e('0x43')](_0x070e('0x44'),'o',_0x070e('0x48'))['left_join'](_0x070e('0x49'),'a',_0x070e('0x4a'))[_0x070e('0x43')](_0x070e('0x4b'),'me',_0x070e('0x4c'))[_0x070e('0x43')](_0x070e('0x4d'),'it',_0x070e('0x4e'))[_0x070e('0x43')](_0x070e('0x3f'),'t',_0x070e('0x4f'));var _0x3be553=squel[_0x070e('0x50')]();var _0x216d27=[];var _0x402c82=squel['expr']();var _0x171621;if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x51')]){_0x171621=as[_0x070e('0x52')](_0x31fdc5[_0x070e('0x34')][_0x070e('0x51')]);var _0x3f0763=_0x171621[_0x070e('0x53')];for(var _0x1c64d2=0x0;_0x1c64d2<_0x171621['conditions'][_0x070e('0x54')];_0x1c64d2++){var _0x4c22da=_0x171621[_0x070e('0x55')][_0x1c64d2];var _0x2be643='i';var _0x4abbe9=_[_0x070e('0x56')](_0x3011c4,[_0x070e('0x25'),_0x4c22da[_0x070e('0x3c')]]);if(!_0x4abbe9){switch(_0x4c22da[_0x070e('0x3c')]){case _0x070e('0x57'):if(_0x4c22da[_0x070e('0x58')]==0x1){_0x5f5675[_0x070e('0x59')]('`'+_0x4c22da['field']+_0x070e('0x5a'));}else{_0x5f5675['having']('`'+_0x4c22da['field']+_0x070e('0x5b'));}break;case _0x070e('0x5c'):if(_0x4c22da[_0x070e('0x5d')]===_0x070e('0x5e')){if(_0x4c22da[_0x070e('0x58')][_0x070e('0x2b')]('\x20')[_0x070e('0x54')]>0x1){_0x3be553[_0x3f0763](_0x070e('0x5f'),qs['getFullTextValue'](_0x4c22da[_0x070e('0x58')]),null);}else{var _0x51d27d='%'+_0x4c22da['value']+'%';_0x3be553[_0x3f0763](_0x070e('0x60'),_0x51d27d,_0x51d27d,_0x51d27d);}}else{_0x4abbe9=_[_0x070e('0x56')](_0x3011c4,['name',_0x070e('0x61')]);_0x4c22da[_0x070e('0x3c')]=_0x070e('0x61');_0x841c89=as[_0x070e('0x62')](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89[_0x070e('0x63')],_0x841c89[_0x070e('0x58')]['start'],_0x841c89['value']['end']);}break;case _0x070e('0x64'):var _0x1948a5=_0x4c22da[_0x070e('0x58')][_0x070e('0x2b')](',')['map'](function(_0x25f34c){return Number(_0x25f34c);});_0x1948a5['forEach'](function(_0x212710){_0x402c82['or'](_0x070e('0x65'),'%,'+_0x212710+',%');});_0x216d27=_[_0x070e('0x66')](_0x216d27,_0x1948a5);break;case _0x070e('0x67'):if(_0x4c22da[_0x070e('0x5d')]===_0x070e('0x5e')){_0x3be553[_0x3f0763]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c22da[_0x070e('0x58')]+'%',null);}else{_0x4abbe9=_[_0x070e('0x56')](_0x3011c4,[_0x070e('0x25'),'UserId']);_0x4c22da[_0x070e('0x3c')]=_0x070e('0x68');_0x841c89=as['buildExpression'](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89['text'],_0x841c89[_0x070e('0x58')]['start'],_0x841c89['value']['end']);}break;case _0x070e('0x69'):_0x841c89=as[_0x070e('0x62')]('me',null,_0x4c22da);_0x3be553[_0x3f0763](_0x841c89[_0x070e('0x63')],_0x841c89[_0x070e('0x58')][_0x070e('0x6a')],_0x841c89[_0x070e('0x58')]['end']);break;}}else{var _0x841c89=as['buildExpression'](_0x2be643,_0x4abbe9[_0x070e('0x32')],_0x4c22da);_0x3be553[_0x3f0763](_0x841c89['text'],_0x841c89[_0x070e('0x58')][_0x070e('0x6a')],_0x841c89['value'][_0x070e('0x6b')]);}}}else{var _0x50399e=_(_0x31fdc5[_0x070e('0x34')])[_0x070e('0x6c')]()[_0x070e('0x27')](function(_0x2b172a){return _[_0x070e('0x6d')](_0x3011c4,[_0x070e('0x25'),_0x2b172a])?_0x2b172a:undefined;})[_0x070e('0x6e')]()[_0x070e('0x58')]();if(!_[_0x070e('0x6f')](_0x50399e)){_0x50399e[_0x070e('0x2c')](function(_0x40c560){if(_0x40c560===_0x070e('0x70')){_0x5f5675[_0x070e('0x71')](_0x070e('0x72'),[]['concat'](_0x31fdc5[_0x070e('0x34')][_0x40c560]));}else if(_0x40c560===_0x070e('0x73')){var _0x381c83=JSON[_0x070e('0x74')](_0x31fdc5['query'][_0x40c560])[_0x070e('0x75')];var _0x4e8e58=JSON[_0x070e('0x74')](_0x31fdc5[_0x070e('0x34')][_0x40c560])[_0x070e('0x76')];_0x5f5675[_0x070e('0x71')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x381c83,_0x4e8e58);}else{if(_0x31fdc5[_0x070e('0x34')][_0x40c560]===_0x070e('0x77')){_0x5f5675[_0x070e('0x71')]('i.'+_0x40c560+_0x070e('0x78'));}else{_0x5f5675['where']('i.'+_0x40c560+_0x070e('0x79'),_0x31fdc5['query'][_0x40c560]);}}});}if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7a')]){if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7a')]==0x1){_0x5f5675[_0x070e('0x59')]('`unreadMessages`\x20=\x200');}else{_0x5f5675[_0x070e('0x59')](_0x070e('0x7b'));}}if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x7c')]){_0x216d27=_['isArray'](_0x31fdc5[_0x070e('0x34')]['tag'])?_0x31fdc5[_0x070e('0x34')][_0x070e('0x7c')]:new Array(_0x31fdc5[_0x070e('0x34')]['tag']);_0x216d27[_0x070e('0x2c')](function(_0x4d344c){_0x402c82['or'](_0x070e('0x65'),'%,'+_0x4d344c+',%');});}if(_0x31fdc5['query'][_0x070e('0x7d')]){var _0x17b28c=_0x31fdc5['query'][_0x070e('0x7d')]['replace']('\x5c','\x5c\x5c')[_0x070e('0x7e')]('\x27\x27',_0x070e('0x7f'));if(qs['isNumeric'](_0x17b28c)){_0x3be553['or']('i.id\x20LIKE\x20?',_0x17b28c+'%')['or'](_0x070e('0x80'),_0x17b28c+'%');}else{_0x3be553['or'](_0x070e('0x81'),qs[_0x070e('0x82')](_0x17b28c))['or'](_0x070e('0x83'),_0x17b28c+'%');}}}_0x5f5675[_0x070e('0x71')](_0x3be553);_0x5f5675[_0x070e('0x84')](_0x070e('0x85'));var _0x332c8a={'type':db[_0x070e('0x86')][_0x070e('0x87')][_0x070e('0x88')],'raw':!![]};var _0x25670e=_0x5f5675[_0x070e('0x89')]();_0x25670e['field'](_0x070e('0x85'));_0x25670e[_0x070e('0x3c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5f530d[_0x070e('0x8a')]){_0x5f530d[_0x070e('0x8a')][_0x070e('0x2c')](function(_0x24bbc7){_0x5f5675[_0x070e('0x8a')]('i.'+_0x24bbc7[0x0],_0x24bbc7[0x1]===_0x070e('0x8b')?![]:!![]);});}if(!_[_0x070e('0x6f')](_0x216d27)){_0x5f5675[_0x070e('0x59')](_0x402c82);_0x25670e[_0x070e('0x71')](_0x070e('0x8c'),_0x216d27);}BPromise[_0x070e('0x8d')]()[_0x070e('0x22')](function(){if(!_0x171621){if(_0x31fdc5[_0x070e('0x34')]['SmsAccountId']||_0x31fdc5['query']['journey'])return;_0x25670e[_0x070e('0x71')](_0x070e('0x8e'));_0x5f5675[_0x070e('0x71')](_0x070e('0x8e'));return;}return _0x31fdc5['user'][_0x070e('0x8f')]({'attributes':['id'],'raw':!![]})[_0x070e('0x22')](function(_0x416dde){if(_[_0x070e('0x6f')](_0x416dde)){_0x25670e[_0x070e('0x71')](_0x070e('0x90'));_0x5f5675['where'](_0x070e('0x90'));}else{_0x25670e['where'](_0x070e('0x72'),_[_0x070e('0x27')](_0x416dde,'id'));_0x5f5675[_0x070e('0x71')](_0x070e('0x72'),_[_0x070e('0x27')](_0x416dde,'id'));}});})['then'](function(){db[_0x070e('0x91')][_0x070e('0x34')](_0x25670e['toString'](),_0x332c8a)[_0x070e('0x22')](function(_0x1e1d27){_0x24d17d['count']=_0x1e1d27[_0x070e('0x54')];if(_0x24d17d[_0x070e('0x1c')]===0x0)return[];return db[_0x070e('0x91')]['query'](_0x13e4e0[_0x070e('0x92')](),_0x332c8a)[_0x070e('0x22')](function(_0x134b72){_0x4a4ee3=_[_0x070e('0x93')](_0x134b72,'id');_0x332c8a=_[_0x070e('0x94')](_0x332c8a,{'model':db[_0x070e('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31fdc5[_0x070e('0x34')][_0x070e('0x37')]){_0x5f530d[_0x070e('0x38')][_0x070e('0x2c')](function(_0x1b1a0c){_0x5f5675[_0x070e('0x3c')]('i.'+_0x1b1a0c);});}else{_0x5f5675[_0x070e('0x3c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x070e('0x57'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x95'),_0x070e('0x96'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x97'),'Account.mandatoryDisposition');_0x5f5675['field']('i.*');_0x5f5675[_0x070e('0x3c')](_0x070e('0x98'),_0x070e('0x99'));_0x5f5675[_0x070e('0x3c')]('c.lastName',_0x070e('0x9a'));_0x5f5675[_0x070e('0x3c')](_0x070e('0x9b'),'Contact.email');_0x5f5675[_0x070e('0x3c')]('c.phone',_0x070e('0x9c'));_0x5f5675[_0x070e('0x3c')]('c.mobile','Contact.mobile');_0x5f5675[_0x070e('0x3c')](_0x070e('0x9d'),'Contact.fax');_0x5f5675[_0x070e('0x3c')]('o.fullname','Owner.fullname');_0x5f5675['field'](_0x070e('0x9e'),_0x070e('0x9f'));_0x5f5675[_0x070e('0x3c')](_0x070e('0xa0'),_0x070e('0x2a'));}if(_0x5f530d[_0x070e('0x1e')])_0x5f5675[_0x070e('0x1e')](_0x5f530d[_0x070e('0x1e')]);if(_0x5f530d[_0x070e('0x1d')])_0x5f5675[_0x070e('0x1d')](_0x5f530d[_0x070e('0x1d')]);return db[_0x070e('0x91')][_0x070e('0x34')](_0x5f5675[_0x070e('0x92')](),_0x332c8a);})[_0x070e('0x22')](function(_0x3f2bb5){_0x562aa4[_0x070e('0x71')](_0x070e('0xa1'),_[_0x070e('0x27')](_0x3f2bb5,'id'));return db[_0x070e('0x91')][_0x070e('0x34')](_0x562aa4[_0x070e('0x92')](),_0x332c8a)['then'](function(_0x4124cc){var _0x276e6e=_[_0x070e('0xa2')](_0x4124cc,_0x070e('0xa3'));var _0x495403=[];_0x3f2bb5[_0x070e('0x2c')](function(_0x32fa3b){_0x495403[_0x070e('0xa4')](updateSmsInteraction(_0x32fa3b,_0x4a4ee3,_0x276e6e));});return BPromise[_0x070e('0xa5')](_0x495403);});});})[_0x070e('0x22')](function(_0x2ceb4f){_0x24d17d['rows']=_0x2ceb4f;return _0x24d17d;})['then'](respondWithFilteredResult(_0x18f0ad,_0x5f530d));})['catch'](handleError(_0x18f0ad,null));};exports[_0x070e('0xa6')]=function(_0x5a482f,_0x26e9c1){var _0x42f6df={'raw':![],'where':{'id':_0x5a482f[_0x070e('0xa7')]['id']}},_0x4dba5f={};_0x4dba5f[_0x070e('0x33')]=_['keys'](db['SmsInteraction'][_0x070e('0x30')]);_0x4dba5f[_0x070e('0x34')]=_[_0x070e('0x6c')](_0x5a482f[_0x070e('0x34')]);_0x4dba5f[_0x070e('0x35')]=_['intersection'](_0x4dba5f[_0x070e('0x33')],_0x4dba5f['query']);_0x42f6df[_0x070e('0x38')]=_[_0x070e('0x36')](_0x4dba5f['model'],qs[_0x070e('0x37')](_0x5a482f[_0x070e('0x34')][_0x070e('0x37')]));_0x42f6df[_0x070e('0x38')]=_0x42f6df[_0x070e('0x38')][_0x070e('0x54')]?_0x42f6df['attributes']:_0x4dba5f[_0x070e('0x33')];if(_0x5a482f[_0x070e('0x34')][_0x070e('0xa8')]){_0x42f6df[_0x070e('0xa9')]=[{'all':!![]}];}_0x42f6df=_[_0x070e('0x94')]({},_0x42f6df,_0x5a482f['options']);return db[_0x070e('0x2f')][_0x070e('0x56')](_0x42f6df)[_0x070e('0x22')](handleEntityNotFound(_0x26e9c1,null))[_0x070e('0x22')](respondWithResult(_0x26e9c1,null))[_0x070e('0x2d')](handleError(_0x26e9c1,null));};exports[_0x070e('0xaa')]=function(_0x248347,_0x4546eb){return db[_0x070e('0x2f')][_0x070e('0xaa')](_0x248347[_0x070e('0x69')],{})[_0x070e('0x22')](respondWithResult(_0x4546eb,0xc9))[_0x070e('0x2d')](handleError(_0x4546eb,null));};exports[_0x070e('0x21')]=function(_0xf0fde5,_0x3ecfe5){if(_0xf0fde5['body']['id']){delete _0xf0fde5['body']['id'];}return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0xf0fde5['params']['id']}})['then'](handleEntityNotFound(_0x3ecfe5,null))['then'](saveUpdates(_0xf0fde5['body'],null))[_0x070e('0x22')](respondWithResult(_0x3ecfe5,null))[_0x070e('0x2d')](handleError(_0x3ecfe5,null));};exports[_0x070e('0x23')]=function(_0x12ea06,_0x409811){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x12ea06[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x409811,null))[_0x070e('0x22')](removeEntity(_0x409811,null))['catch'](handleError(_0x409811,null));};exports[_0x070e('0xab')]=function(_0x36cfe2,_0x49c66a){return db[_0x070e('0x2f')][_0x070e('0xab')]()[_0x070e('0x22')](respondWithResult(_0x49c66a,null))[_0x070e('0x2d')](handleError(_0x49c66a,null));};exports['addMessage']=function(_0x2d46fb,_0x36a689,_0x214bea){return db[_0x070e('0xac')]['find']({'where':{'id':_0x2d46fb[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x36a689,null))[_0x070e('0x22')](function(_0xebbb53){if(_0xebbb53){return _0xebbb53[_0x070e('0xad')](_0x2d46fb[_0x070e('0x69')][_0x070e('0xae')],_[_0x070e('0xaf')](_0x2d46fb[_0x070e('0x69')],[_0x070e('0xae'),'id'])||{});}})[_0x070e('0x22')](respondWithResult(_0x36a689,null))['catch'](handleError(_0x36a689,null));};exports[_0x070e('0xb0')]=function(_0x2b5210,_0x5e3263,_0x5ccb8d){var _0x6ac3c9={'raw':![],'where':{}};var _0x53f6e7={};var _0x2c759a={'count':0x0,'rows':[]};return db[_0x070e('0x2f')][_0x070e('0xb1')]({'where':{'id':_0x2b5210[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x5e3263,null))[_0x070e('0x22')](function(_0x3dc050){if(_0x3dc050){_0x53f6e7['model']=_[_0x070e('0x6c')](db[_0x070e('0xac')][_0x070e('0x30')]);_0x53f6e7[_0x070e('0x34')]=_['keys'](_0x2b5210['query']);_0x53f6e7[_0x070e('0x35')]=_[_0x070e('0x36')](_0x53f6e7[_0x070e('0x33')],_0x53f6e7['query']);_0x6ac3c9[_0x070e('0x38')]=_[_0x070e('0x36')](_0x53f6e7['model'],qs[_0x070e('0x37')](_0x2b5210[_0x070e('0x34')][_0x070e('0x37')]));_0x6ac3c9[_0x070e('0x38')]=_0x6ac3c9[_0x070e('0x38')][_0x070e('0x54')]?_0x6ac3c9['attributes']:_0x53f6e7['model'];if(!_0x2b5210[_0x070e('0x34')]['hasOwnProperty'](_0x070e('0xb2'))){_0x6ac3c9[_0x070e('0x1e')]=qs['limit'](_0x2b5210[_0x070e('0x34')]['limit']);_0x6ac3c9[_0x070e('0x1d')]=qs[_0x070e('0x1d')](_0x2b5210[_0x070e('0x34')][_0x070e('0x1d')]);}_0x6ac3c9[_0x070e('0x8a')]=qs[_0x070e('0x3a')](_0x2b5210['query'][_0x070e('0x3a')]);_0x6ac3c9[_0x070e('0x71')]=qs['filters'](_['pick'](_0x2b5210[_0x070e('0x34')],_0x53f6e7[_0x070e('0x35')]));_0x6ac3c9[_0x070e('0x71')][_0x070e('0xa3')]=_0x3dc050['id'];if(_0x2b5210[_0x070e('0x34')][_0x070e('0x7d')]){_0x6ac3c9[_0x070e('0x71')]=_[_0x070e('0x94')](_0x6ac3c9['where'],{'$or':_[_0x070e('0x27')](_0x6ac3c9[_0x070e('0x38')],function(_0x26a0be){var _0x2f5597={};_0x2f5597[_0x26a0be]={'$like':'%'+_0x2b5210[_0x070e('0x34')][_0x070e('0x7d')]+'%'};return _0x2f5597;})});}if(_0x2b5210[_0x070e('0x34')][_0x070e('0x75')]){var _0x522513=_0x2b5210[_0x070e('0x34')][_0x070e('0x75')][_0x070e('0x2b')](',');var _0xbc61f2={};_0xbc61f2[_0x522513[0x0]]={'$gte':moment(_0x522513[0x1])[_0x070e('0xb3')](_0x070e('0xb4'))};_0x6ac3c9[_0x070e('0x71')]=_[_0x070e('0x94')](_0x6ac3c9[_0x070e('0x71')],_0xbc61f2);}_0x6ac3c9=_[_0x070e('0x94')]({},_0x6ac3c9,_0x2b5210['options']);return db['SmsMessage'][_0x070e('0x1c')]({'where':_0x6ac3c9[_0x070e('0x71')]})[_0x070e('0x22')](function(_0x567202){_0x2c759a[_0x070e('0x1c')]=_0x567202;if(_0x2b5210[_0x070e('0x34')]['includeAll']){_0x6ac3c9[_0x070e('0xa9')]=[{'all':!![]}];}return db[_0x070e('0xac')][_0x070e('0xb5')](_0x6ac3c9);})[_0x070e('0x22')](function(_0x3af8fe){_0x2c759a[_0x070e('0xb6')]=_0x3af8fe;return _0x2c759a;});}})['then'](respondWithFilteredResult(_0x5e3263,_0x6ac3c9))['catch'](handleError(_0x5e3263,null));};exports[_0x070e('0xb7')]=function(_0x3f3d7e,_0x532f83,_0x4055ba){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x3f3d7e[_0x070e('0xa7')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x532f83,null))[_0x070e('0x22')](function(_0x4870da){if(_0x4870da){return _0x4870da[_0x070e('0xb8')](_0x3f3d7e[_0x070e('0x69')]['ids'],_[_0x070e('0xaf')](_0x3f3d7e[_0x070e('0x69')],[_0x070e('0xae'),'id'])||{})[_0x070e('0xb9')](function(){return db['Tag']['findAll']({'attributes':['id',_0x070e('0x25'),_0x070e('0x3d')],'where':{'id':_0x3f3d7e[_0x070e('0x69')][_0x070e('0xae')]}});})[_0x070e('0x22')](function(_0x32f1e7){socket[_0x070e('0xba')](_0x070e('0xbb'),{'id':Number(_0x3f3d7e[_0x070e('0xa7')]['id']),'tags':_0x32f1e7||[]});return{'id':Number(_0x3f3d7e[_0x070e('0xa7')]['id']),'tags':_0x32f1e7||[]};});}})['then'](respondWithResult(_0x532f83,null))[_0x070e('0x2d')](handleError(_0x532f83,null));};exports[_0x070e('0xbc')]=function(_0x1de175,_0x205fc7,_0x49f3df){return db[_0x070e('0x2f')][_0x070e('0x56')]({'where':{'id':_0x1de175['params']['id']}})['then'](handleEntityNotFound(_0x205fc7,null))[_0x070e('0x22')](function(_0x4684c7){if(_0x4684c7){return _0x4684c7[_0x070e('0xbc')](_0x1de175['query'][_0x070e('0xae')]);}})[_0x070e('0x22')](respondWithStatusCode(_0x205fc7,null))[_0x070e('0x2d')](handleError(_0x205fc7,null));};exports[_0x070e('0xbd')]=function(_0x34b5ae,_0x5605da){var _0x271bb9=moment()[_0x070e('0xbe')]()['toString']();var _0x2a94f9=path['join'](config['root'],'server',_0x070e('0xbf'),_0x070e('0xc0'));var _0x118a77=path[_0x070e('0xc1')](config['root'],_0x070e('0xc2'),_0x070e('0xbf'),'attachments');var _0x3c6a6e=path[_0x070e('0xc1')](_0x2a94f9,_0x271bb9);var _0x24448e=util[_0x070e('0xb3')](_0x070e('0xc3'),_0x34b5ae[_0x070e('0xa7')]['id'],_0x271bb9);var _0x50fbb4=path[_0x070e('0xc1')](_0x2a94f9,_0x24448e);var _0x4c35db=[];_0x4c35db[_0x070e('0xa4')]({'model':db[_0x070e('0x67')],'as':_0x070e('0x67'),'attributes':['id','fullname'],'raw':!![]});_0x4c35db[_0x070e('0xa4')]({'model':db[_0x070e('0xc4')],'as':_0x070e('0x5c'),'attributes':['id','firstName',_0x070e('0xc5')],'raw':!![]});var _0x3a5086=[{'model':db['SmsMessage'],'as':_0x070e('0xc6'),'attributes':['id',_0x070e('0x69'),'createdAt','direction','secret','read'],'include':_0x4c35db}];_0x3a5086[_0x070e('0xa4')]({'model':db[_0x070e('0xc7')],'as':_0x070e('0xc8'),'attributes':['id',_0x070e('0x25')]});_0x3a5086[_0x070e('0xa4')]({'model':db[_0x070e('0x67')],'as':_0x070e('0xc9'),'attributes':['id',_0x070e('0x28')]});return db['SmsInteraction']['find']({'where':{'id':_0x34b5ae['params']['id']},'include':_0x3a5086})['then'](handleEntityNotFound(_0x5605da,null))[_0x070e('0x22')](function(_0x41e59b){if(_0x41e59b){var _0x28208d=_0x41e59b[_0x070e('0xca')]({'plain':!![]});fs[_0x070e('0xcb')](_0x3c6a6e);var _0x4a07aa={'format':'A4','border':'10px','header':{'height':_0x070e('0xcc'),'contents':{'first':_0x070e('0xcd')}},'footer':{'height':'30px','contents':{'default':util[_0x070e('0xb3')](_0x070e('0xce'),util[_0x070e('0xb3')](_0x070e('0xcf'),_0x070e('0xd0'),_0x28208d['id']),moment()[_0x070e('0xb3')]('YYYY-MM-DD')[_0x070e('0x92')]())}}};var _0x1d48a9={'channel':_0x070e('0xd0'),'account':_0x28208d['Account'][_0x070e('0x25')],'agent':_0x28208d[_0x070e('0xc9')]?_0x28208d[_0x070e('0xc9')][_0x070e('0x28')]:'N.A.','createdAt':moment(_0x28208d[_0x070e('0x73')])[_0x070e('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x070e('0x92')](),'closedAt':_0x28208d[_0x070e('0xd1')]?moment(_0x28208d['closedAt'])[_0x070e('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x070e('0x92')]():'','disposition':_0x28208d['disposition'],'messages':_(_0x28208d[_0x070e('0xc6')])['filter']({'secret':![]})['map'](function(_0x1c4f6c){return{'date':moment(_0x1c4f6c['createdAt'])['format'](_0x070e('0xb4'))[_0x070e('0x92')](),'sender':_0x1c4f6c[_0x070e('0xd2')]===_0x070e('0xd3')?_0x1c4f6c[_0x070e('0x67')]?_0x1c4f6c['User'][_0x070e('0x28')]:_0x070e('0xd4'):_0x1c4f6c[_0x070e('0x5c')][_0x070e('0xd5')]+(_0x1c4f6c[_0x070e('0x5c')][_0x070e('0xc5')]?'\x20'+_0x1c4f6c['Contact'][_0x070e('0xc5')]:''),'body':_0x1c4f6c[_0x070e('0x69')],'direction':_0x1c4f6c[_0x070e('0xd2')]===_0x070e('0xd3')?'A':'C','secret':_0x1c4f6c['secret'],'read':_0x1c4f6c['read']};})[_0x070e('0x58')]()};return ejs[_0x070e('0xd6')](path[_0x070e('0xc1')](config[_0x070e('0xd7')],_0x070e('0xc2'),_0x070e('0xd8'),'downloadInteraction.html'),{'interaction':_0x1d48a9})[_0x070e('0x22')](function(_0x32f28b){return new BPromise(function(_0x1e05c9,_0x3a894e){pdf[_0x070e('0xaa')](_0x32f28b,_0x4a07aa)[_0x070e('0xd9')](path['join'](_0x3c6a6e,'transcript-'+_0x28208d['id']+'-'+_0x271bb9+_0x070e('0xda')),function(_0x43e514,_0x193c72){if(_0x43e514)return _0x3a894e(_0x43e514);_0x1e05c9(_0x193c72);});});})[_0x070e('0x22')](function(){return new BPromise(function(_0x3a8dd7,_0x167139){zipdir(_0x3c6a6e,{'saveTo':_0x50fbb4},function(_0x257569,_0x5d69bc){if(_0x257569)return _0x167139(_0x257569);return _0x3a8dd7(_0x5d69bc);});})[_0x070e('0x22')](function(){return new BPromise(function(_0x5e244a,_0xfe12a6){rimraf(_0x3c6a6e,function(_0x5dc059){if(_0x5dc059)_0xfe12a6(_0x5dc059);return _0x5e244a();});});})['then'](function(){return _0x5605da['download'](_0x50fbb4,_0x24448e,function(_0x383f39){if(_0x383f39){console[_0x070e('0xdb')](_0x070e('0xdc'),_0x383f39);}else{fs[_0x070e('0xdd')](_0x50fbb4);}});});});}else{return _0x5605da[_0x070e('0x1a')](0xc8);}})[_0x070e('0x2d')](handleError(_0x5605da,null));}; \ No newline at end of file +var _0xb903=['expr','search','parseSearch','sqlOperator','conditions','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','find','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','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','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','count','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','params','rawAttributes','include','options','create','destroy','describe','SmsMessage','addMessage','ids','omit','findOne','$gte','format','includeAll','findAll','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','CmContact','firstName','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
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','\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\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\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%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\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\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{{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\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\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%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\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','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','direction','out','System','lastName','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','index','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId'];(function(_0x3b7a6b,_0x2cf1c9){var _0x273b35=function(_0x359a24){while(--_0x359a24){_0x3b7a6b['push'](_0x3b7a6b['shift']());}};_0x273b35(++_0x2cf1c9);}(_0xb903,0x185));var _0x3b90=function(_0x30fa3e,_0x4fac93){_0x30fa3e=_0x30fa3e-0x0;var _0xca6401=_0xb903[_0x30fa3e];return _0xca6401;};'use strict';var pdf=require(_0x3b90('0x0'));var emlformat=require(_0x3b90('0x1'));var rimraf=require(_0x3b90('0x2'));var zipdir=require(_0x3b90('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b90('0x4'));var moment=require(_0x3b90('0x5'));var BPromise=require(_0x3b90('0x6'));var Mustache=require(_0x3b90('0x7'));var util=require(_0x3b90('0x8'));var path=require(_0x3b90('0x9'));var sox=require(_0x3b90('0xa'));var csv=require('to-csv');var ejs=require(_0x3b90('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b90('0xc'));var jsforce=require(_0x3b90('0xd'));var deskjs=require(_0x3b90('0xe'));var toCsv=require(_0x3b90('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b90('0x10'));var logger=require(_0x3b90('0x11'))('api');var utils=require(_0x3b90('0x12'));var config=require(_0x3b90('0x13'));var db=require('../../mysqldb')['db'];config[_0x3b90('0x14')]=_[_0x3b90('0x15')](config[_0x3b90('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b90('0x14')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3a0a55,_0x2c72fb){_0x2c72fb=_0x2c72fb||0xcc;return function(_0x4824f9){if(_0x4824f9){return _0x3a0a55['sendStatus'](_0x2c72fb);}return _0x3a0a55[_0x3b90('0x16')](_0x2c72fb)[_0x3b90('0x17')]();};}function respondWithResult(_0x381a9e,_0x1af265){_0x1af265=_0x1af265||0xc8;return function(_0x1efe01){if(_0x1efe01){return _0x381a9e['status'](_0x1af265)['json'](_0x1efe01);}};}function respondWithFilteredResult(_0xd83280,_0x5420dc){return function(_0x4e9120){if(_0x4e9120){var _0x269488=_0x4e9120['count'],_0x3cf281=_0x5420dc[_0x3b90('0x18')],_0x11ad7d=_0x5420dc['offset']+_0x5420dc[_0x3b90('0x19')],_0x131f3f;if(_0x11ad7d>=_0x269488){_0x11ad7d=_0x269488;_0x131f3f=0xc8;}else{_0x131f3f=0xce;}_0xd83280[_0x3b90('0x16')](_0x131f3f);return _0xd83280['set'](_0x3b90('0x1a'),_0x3cf281+'-'+_0x11ad7d+'/'+_0x269488)[_0x3b90('0x1b')](_0x4e9120);}return null;};}function patchUpdates(_0x3642c0){return function(_0x3ce411){try{jsonpatch[_0x3b90('0x1c')](_0x3ce411,_0x3642c0,!![]);}catch(_0x43deca){return BPromise[_0x3b90('0x1d')](_0x43deca);}return _0x3ce411[_0x3b90('0x1e')]();};}function saveUpdates(_0xa98414,_0x3e5bb8){return function(_0x4e2175){if(_0x4e2175){return _0x4e2175[_0x3b90('0x1f')](_0xa98414)[_0x3b90('0x20')](function(_0x175b42){return _0x175b42;});}return null;};}function removeEntity(_0x7faee,_0x1227ed){return function(_0x93b8e7){if(_0x93b8e7){return _0x93b8e7['destroy']()['then'](function(){_0x7faee[_0x3b90('0x16')](0xcc)[_0x3b90('0x17')]();});}};}function handleEntityNotFound(_0x103324,_0x2ffa1a){return function(_0x583523){if(!_0x583523){_0x103324[_0x3b90('0x21')](0x194);}return _0x583523;};}function handleError(_0x2936d7,_0x1787d1){_0x1787d1=_0x1787d1||0x1f4;return function(_0x4caead){logger[_0x3b90('0x22')](_0x4caead[_0x3b90('0x23')]);if(_0x4caead[_0x3b90('0x24')]){delete _0x4caead[_0x3b90('0x24')];}_0x2936d7[_0x3b90('0x16')](_0x1787d1)[_0x3b90('0x25')](_0x4caead);};}function getInteractionUsers(_0x4b4d33,_0x1a839d){return new BPromise(function(_0x595ac1,_0xaf453c){try{if(_0x1a839d[_0x4b4d33['id']]){_0x4b4d33[_0x3b90('0x26')]=_[_0x3b90('0x27')](_0x1a839d[_0x4b4d33['id']],function(_0x38eed0){return{'id':_0x38eed0['id'],'fullname':_0x38eed0[_0x3b90('0x28')]};});}}catch(_0x6704f){_0xaf453c(_0x6704f);}_0x595ac1(_0x4b4d33);});}function getInteractionTags(_0x290283,_0x2430ec){return new BPromise(function(_0x500ceb,_0x4d1f31){try{if(_0x290283[_0x3b90('0x29')]){_0x290283[_0x3b90('0x2a')]=[];_0x290283[_0x3b90('0x29')][_0x3b90('0x2b')](',')['forEach'](function(_0x543458){_0x290283[_0x3b90('0x2a')][_0x3b90('0x2c')](_0x2430ec[_0x543458]);});}delete _0x290283[_0x3b90('0x29')];}catch(_0x4f3ab5){_0x4d1f31(_0x4f3ab5);}_0x500ceb(_0x290283);});}function updateSmsInteraction(_0x41bd39,_0x4ca40e,_0x49b4d2){return new BPromise(function(_0x208f3e,_0x3fbc03){return getInteractionUsers(_0x41bd39,_0x49b4d2)['then'](function(_0x3e7c71){return getInteractionTags(_0x3e7c71,_0x4ca40e);})[_0x3b90('0x20')](function(_0x3e30b8){_0x208f3e(_0x3e30b8);})['catch'](function(_0x47cd8f){_0x3fbc03(_0x47cd8f);});});}exports[_0x3b90('0x2d')]=function(_0x143698,_0x64a5e){var _0x401dc5={},_0x5dacea={},_0x5a97fe={'count':0x0,'rows':[]};var _0x25ff34=_[_0x3b90('0x27')](db['SmsInteraction']['rawAttributes'],function(_0x201712){return{'name':_0x201712[_0x3b90('0x2e')],'type':_0x201712[_0x3b90('0x2f')][_0x3b90('0x30')]};});_0x5dacea['model']=_[_0x3b90('0x27')](_0x25ff34,'name');_0x5dacea[_0x3b90('0x31')]=_[_0x3b90('0x32')](_0x143698[_0x3b90('0x31')]);_0x5dacea[_0x3b90('0x33')]=_[_0x3b90('0x34')](_0x5dacea[_0x3b90('0x35')],_0x5dacea[_0x3b90('0x31')]);_0x401dc5['attributes']=_[_0x3b90('0x34')](_0x5dacea[_0x3b90('0x35')],qs[_0x3b90('0x36')](_0x143698[_0x3b90('0x31')][_0x3b90('0x36')]));_0x401dc5[_0x3b90('0x37')]=_0x401dc5[_0x3b90('0x37')][_0x3b90('0x38')]?_0x401dc5[_0x3b90('0x37')]:_0x5dacea['model'];if(!_0x143698[_0x3b90('0x31')][_0x3b90('0x39')](_0x3b90('0x3a'))){_0x401dc5[_0x3b90('0x19')]=qs[_0x3b90('0x19')](_0x143698[_0x3b90('0x31')][_0x3b90('0x19')]);_0x401dc5[_0x3b90('0x18')]=qs[_0x3b90('0x18')](_0x143698[_0x3b90('0x31')][_0x3b90('0x18')]);}_0x401dc5[_0x3b90('0x3b')]=qs[_0x3b90('0x3c')](_0x143698[_0x3b90('0x31')][_0x3b90('0x3c')]);_0x401dc5[_0x3b90('0x3d')]=qs[_0x3b90('0x33')](_[_0x3b90('0x3e')](_0x143698[_0x3b90('0x31')],_0x5dacea[_0x3b90('0x33')]),_0x25ff34);var _0x11698a=[];var _0x4d1157=squel[_0x3b90('0x3f')]()[_0x3b90('0x40')]('id')[_0x3b90('0x40')](_0x3b90('0x24'))['field'](_0x3b90('0x41'))['from']('tools_tags');var _0x283419=squel[_0x3b90('0x3f')]()['field'](_0x3b90('0x42'))[_0x3b90('0x40')](_0x3b90('0x43'))[_0x3b90('0x40')](_0x3b90('0x44'))[_0x3b90('0x45')](_0x3b90('0x46'),'ui')[_0x3b90('0x47')](_0x3b90('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x3f71b0=squel[_0x3b90('0x3f')]()['from'](_0x3b90('0x49'),'i')[_0x3b90('0x47')](_0x3b90('0x4a'),'c',_0x3b90('0x4b'))[_0x3b90('0x47')]('users','o','o.id\x20=\x20i.UserId')[_0x3b90('0x47')]('sms_accounts','a',_0x3b90('0x4c'))[_0x3b90('0x47')](_0x3b90('0x4d'),'me',_0x3b90('0x4e'))[_0x3b90('0x47')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x3b90('0x47')](_0x3b90('0x4f'),'t',_0x3b90('0x50'));var _0x5d7333=squel[_0x3b90('0x51')]();var _0x291279=[];var _0x18d59b=squel[_0x3b90('0x51')]();var _0x41e951;if(_0x143698[_0x3b90('0x31')][_0x3b90('0x52')]){_0x41e951=as[_0x3b90('0x53')](_0x143698[_0x3b90('0x31')]['search']);var _0xcc2f56=_0x41e951[_0x3b90('0x54')];for(var _0x2b5b6f=0x0;_0x2b5b6f<_0x41e951['conditions'][_0x3b90('0x38')];_0x2b5b6f++){var _0x4e9e75=_0x41e951[_0x3b90('0x55')][_0x2b5b6f];var _0x3fc270='i';var _0x98aeaf=_['find'](_0x25ff34,[_0x3b90('0x24'),_0x4e9e75[_0x3b90('0x40')]]);if(!_0x98aeaf){switch(_0x4e9e75['field']){case'unreadMessages':if(_0x4e9e75[_0x3b90('0x56')]==0x1){_0x3f71b0[_0x3b90('0x57')]('`'+_0x4e9e75[_0x3b90('0x40')]+_0x3b90('0x58'));}else{_0x3f71b0['having']('`'+_0x4e9e75['field']+_0x3b90('0x59'));}break;case _0x3b90('0x5a'):if(_0x4e9e75[_0x3b90('0x5b')]===_0x3b90('0x5c')){if(_0x4e9e75[_0x3b90('0x56')][_0x3b90('0x2b')]('\x20')[_0x3b90('0x38')]>0x1){_0x5d7333[_0xcc2f56](_0x3b90('0x5d'),qs[_0x3b90('0x5e')](_0x4e9e75['value']),null);}else{var _0x415a5d='%'+_0x4e9e75[_0x3b90('0x56')]+'%';_0x5d7333[_0xcc2f56]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x415a5d,_0x415a5d,_0x415a5d);}}else{_0x98aeaf=_[_0x3b90('0x5f')](_0x25ff34,[_0x3b90('0x24'),'ContactId']);_0x4e9e75[_0x3b90('0x40')]=_0x3b90('0x60');_0x536da7=as[_0x3b90('0x61')](_0x3fc270,_0x98aeaf[_0x3b90('0x2f')],_0x4e9e75);_0x5d7333[_0xcc2f56](_0x536da7[_0x3b90('0x62')],_0x536da7[_0x3b90('0x56')][_0x3b90('0x63')],_0x536da7['value'][_0x3b90('0x17')]);}break;case _0x3b90('0x64'):var _0x32a179=_0x4e9e75[_0x3b90('0x56')][_0x3b90('0x2b')](',')[_0x3b90('0x27')](function(_0x3ada12){return Number(_0x3ada12);});_0x32a179[_0x3b90('0x65')](function(_0x28ec05){_0x18d59b['or'](_0x3b90('0x66'),'%,'+_0x28ec05+',%');});_0x291279=_[_0x3b90('0x67')](_0x291279,_0x32a179);break;case _0x3b90('0x68'):if(_0x4e9e75[_0x3b90('0x5b')]===_0x3b90('0x5c')){_0x5d7333[_0xcc2f56](_0x3b90('0x69'),'%'+_0x4e9e75['value']+'%',null);}else{_0x98aeaf=_[_0x3b90('0x5f')](_0x25ff34,['name',_0x3b90('0x6a')]);_0x4e9e75[_0x3b90('0x40')]=_0x3b90('0x6a');_0x536da7=as[_0x3b90('0x61')](_0x3fc270,_0x98aeaf[_0x3b90('0x2f')],_0x4e9e75);_0x5d7333[_0xcc2f56](_0x536da7[_0x3b90('0x62')],_0x536da7['value'][_0x3b90('0x63')],_0x536da7[_0x3b90('0x56')][_0x3b90('0x17')]);}break;case _0x3b90('0x6b'):_0x536da7=as[_0x3b90('0x61')]('me',null,_0x4e9e75);_0x5d7333[_0xcc2f56](_0x536da7[_0x3b90('0x62')],_0x536da7['value'][_0x3b90('0x63')],_0x536da7[_0x3b90('0x56')][_0x3b90('0x17')]);break;}}else{var _0x536da7=as[_0x3b90('0x61')](_0x3fc270,_0x98aeaf[_0x3b90('0x2f')],_0x4e9e75);_0x5d7333[_0xcc2f56](_0x536da7[_0x3b90('0x62')],_0x536da7[_0x3b90('0x56')][_0x3b90('0x63')],_0x536da7[_0x3b90('0x56')][_0x3b90('0x17')]);}}}else{var _0x3e5bf7=_(_0x143698[_0x3b90('0x31')])['keys']()[_0x3b90('0x27')](function(_0x4a60f3){return _['some'](_0x25ff34,[_0x3b90('0x24'),_0x4a60f3])?_0x4a60f3:undefined;})[_0x3b90('0x6c')]()['value']();if(!_[_0x3b90('0x6d')](_0x3e5bf7)){_0x3e5bf7[_0x3b90('0x65')](function(_0x287be4){if(_0x287be4===_0x3b90('0x6e')){_0x3f71b0[_0x3b90('0x3d')](_0x3b90('0x6f'),[][_0x3b90('0x70')](_0x143698['query'][_0x287be4]));}else if(_0x287be4==='createdAt'){var _0x3e5532=JSON['parse'](_0x143698[_0x3b90('0x31')][_0x287be4])['$gte'];var _0x1a6d33=JSON['parse'](_0x143698['query'][_0x287be4])['$lte'];_0x3f71b0[_0x3b90('0x3d')](_0x3b90('0x71'),_0x3e5532,_0x1a6d33);}else{if(_0x143698[_0x3b90('0x31')][_0x287be4]===_0x3b90('0x72')){_0x3f71b0[_0x3b90('0x3d')]('i.'+_0x287be4+_0x3b90('0x73'));}else{_0x3f71b0[_0x3b90('0x3d')]('i.'+_0x287be4+'\x20=\x20?',_0x143698['query'][_0x287be4]);}}});}if(_0x143698['query'][_0x3b90('0x74')]){if(_0x143698[_0x3b90('0x31')]['read']==0x1){_0x3f71b0[_0x3b90('0x57')](_0x3b90('0x75'));}else{_0x3f71b0[_0x3b90('0x57')](_0x3b90('0x76'));}}if(_0x143698[_0x3b90('0x31')][_0x3b90('0x77')]){_0x291279=_[_0x3b90('0x78')](_0x143698[_0x3b90('0x31')][_0x3b90('0x77')])?_0x143698['query'][_0x3b90('0x77')]:new Array(_0x143698['query'][_0x3b90('0x77')]);_0x291279[_0x3b90('0x65')](function(_0x4b2c0f){_0x18d59b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b2c0f+',%');});}if(_0x143698[_0x3b90('0x31')][_0x3b90('0x79')]){var _0x3f0f85=_0x143698[_0x3b90('0x31')][_0x3b90('0x79')][_0x3b90('0x7a')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x3b90('0x7b'));if(qs[_0x3b90('0x7c')](_0x3f0f85)){_0x5d7333['or'](_0x3b90('0x7d'),_0x3f0f85+'%')['or']('i.phone\x20LIKE\x20?',_0x3f0f85+'%');}else{_0x5d7333['or'](_0x3b90('0x7e'),qs['getFullTextValue'](_0x3f0f85))['or'](_0x3b90('0x7f'),_0x3f0f85+'%');}}}_0x3f71b0[_0x3b90('0x3d')](_0x5d7333);_0x3f71b0[_0x3b90('0x80')](_0x3b90('0x81'));var _0x15fc75={'type':db[_0x3b90('0x82')]['QueryTypes'][_0x3b90('0x83')],'raw':!![]};var _0x230567=_0x3f71b0[_0x3b90('0x84')]();_0x230567[_0x3b90('0x40')](_0x3b90('0x81'));_0x230567[_0x3b90('0x40')](_0x3b90('0x85'),_0x3b90('0x86'));if(_0x401dc5['order']){_0x401dc5[_0x3b90('0x3b')][_0x3b90('0x65')](function(_0xb0160f){_0x3f71b0[_0x3b90('0x3b')]('i.'+_0xb0160f[0x0],_0xb0160f[0x1]===_0x3b90('0x87')?![]:!![]);});}if(!_[_0x3b90('0x6d')](_0x291279)){_0x3f71b0[_0x3b90('0x57')](_0x18d59b);_0x230567[_0x3b90('0x3d')]('t.id\x20IN\x20?',_0x291279);}BPromise['resolve']()[_0x3b90('0x20')](function(){if(!_0x41e951){if(_0x143698[_0x3b90('0x31')][_0x3b90('0x6e')]||_0x143698['query'][_0x3b90('0x88')])return;_0x230567['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x3f71b0[_0x3b90('0x3d')](_0x3b90('0x89'));return;}return _0x143698[_0x3b90('0x8a')][_0x3b90('0x8b')]({'attributes':['id'],'raw':!![]})[_0x3b90('0x20')](function(_0x133c91){if(_[_0x3b90('0x6d')](_0x133c91)){_0x230567[_0x3b90('0x3d')](_0x3b90('0x8c'));_0x3f71b0[_0x3b90('0x3d')](_0x3b90('0x8c'));}else{_0x230567[_0x3b90('0x3d')](_0x3b90('0x6f'),_[_0x3b90('0x27')](_0x133c91,'id'));_0x3f71b0[_0x3b90('0x3d')]('i.SmsAccountId\x20IN\x20?',_[_0x3b90('0x27')](_0x133c91,'id'));}});})[_0x3b90('0x20')](function(){db['sequelize'][_0x3b90('0x31')](_0x230567['toString'](),_0x15fc75)[_0x3b90('0x20')](function(_0x38fab0){_0x5a97fe[_0x3b90('0x8d')]=_0x38fab0['length'];if(_0x5a97fe[_0x3b90('0x8d')]===0x0)return[];return db[_0x3b90('0x8e')][_0x3b90('0x31')](_0x4d1157[_0x3b90('0x8f')](),_0x15fc75)[_0x3b90('0x20')](function(_0x15befb){_0x11698a=_[_0x3b90('0x90')](_0x15befb,'id');_0x15fc75=_[_0x3b90('0x91')](_0x15fc75,{'model':db[_0x3b90('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x143698[_0x3b90('0x31')][_0x3b90('0x36')]){_0x401dc5[_0x3b90('0x37')]['forEach'](function(_0x5546af){_0x3f71b0['field']('i.'+_0x5546af);});}else{_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x85'),_0x3b90('0x86'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x93'),_0x3b90('0x94'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x95'),_0x3b90('0x96'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x97'));_0x3f71b0['field']('c.firstName',_0x3b90('0x98'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x99'),_0x3b90('0x9a'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x9b'),_0x3b90('0x9c'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x9d'),_0x3b90('0x9e'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0x9f'),_0x3b90('0xa0'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0xa1'),_0x3b90('0xa2'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0xa3'),'Owner.fullname');_0x3f71b0[_0x3b90('0x40')](_0x3b90('0xa4'),_0x3b90('0xa5'));_0x3f71b0[_0x3b90('0x40')](_0x3b90('0xa6'),'TagIds');}if(_0x401dc5[_0x3b90('0x19')])_0x3f71b0[_0x3b90('0x19')](_0x401dc5[_0x3b90('0x19')]);if(_0x401dc5[_0x3b90('0x18')])_0x3f71b0[_0x3b90('0x18')](_0x401dc5[_0x3b90('0x18')]);return db['sequelize'][_0x3b90('0x31')](_0x3f71b0['toString'](),_0x15fc75);})['then'](function(_0x25b369){_0x283419[_0x3b90('0x3d')](_0x3b90('0xa7'),_[_0x3b90('0x27')](_0x25b369,'id'));return db[_0x3b90('0x8e')]['query'](_0x283419[_0x3b90('0x8f')](),_0x15fc75)[_0x3b90('0x20')](function(_0x429cd0){var _0x14d21d=_[_0x3b90('0xa8')](_0x429cd0,_0x3b90('0xa9'));var _0x19b070=[];_0x25b369[_0x3b90('0x65')](function(_0x2c2e24){_0x19b070[_0x3b90('0x2c')](updateSmsInteraction(_0x2c2e24,_0x11698a,_0x14d21d));});return BPromise[_0x3b90('0xaa')](_0x19b070);});});})[_0x3b90('0x20')](function(_0x468342){_0x5a97fe[_0x3b90('0xab')]=_0x468342;return _0x5a97fe;})[_0x3b90('0x20')](respondWithFilteredResult(_0x64a5e,_0x401dc5));})[_0x3b90('0xac')](handleError(_0x64a5e,null));};exports['show']=function(_0x13e661,_0x9fcc2){var _0x27100a={'raw':![],'where':{'id':_0x13e661[_0x3b90('0xad')]['id']}},_0x3c1958={};_0x3c1958[_0x3b90('0x35')]=_['keys'](db[_0x3b90('0x92')][_0x3b90('0xae')]);_0x3c1958[_0x3b90('0x31')]=_[_0x3b90('0x32')](_0x13e661[_0x3b90('0x31')]);_0x3c1958['filters']=_[_0x3b90('0x34')](_0x3c1958[_0x3b90('0x35')],_0x3c1958[_0x3b90('0x31')]);_0x27100a[_0x3b90('0x37')]=_['intersection'](_0x3c1958['model'],qs[_0x3b90('0x36')](_0x13e661['query'][_0x3b90('0x36')]));_0x27100a[_0x3b90('0x37')]=_0x27100a[_0x3b90('0x37')][_0x3b90('0x38')]?_0x27100a[_0x3b90('0x37')]:_0x3c1958['model'];if(_0x13e661[_0x3b90('0x31')]['includeAll']){_0x27100a[_0x3b90('0xaf')]=[{'all':!![]}];}_0x27100a=_[_0x3b90('0x91')]({},_0x27100a,_0x13e661[_0x3b90('0xb0')]);return db['SmsInteraction'][_0x3b90('0x5f')](_0x27100a)[_0x3b90('0x20')](handleEntityNotFound(_0x9fcc2,null))[_0x3b90('0x20')](respondWithResult(_0x9fcc2,null))['catch'](handleError(_0x9fcc2,null));};exports[_0x3b90('0xb1')]=function(_0x1dbc3d,_0x290a14){return db['SmsInteraction'][_0x3b90('0xb1')](_0x1dbc3d[_0x3b90('0x6b')],{})[_0x3b90('0x20')](respondWithResult(_0x290a14,0xc9))[_0x3b90('0xac')](handleError(_0x290a14,null));};exports[_0x3b90('0x1f')]=function(_0x456452,_0x50396d){if(_0x456452['body']['id']){delete _0x456452['body']['id'];}return db[_0x3b90('0x92')]['find']({'where':{'id':_0x456452[_0x3b90('0xad')]['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x50396d,null))[_0x3b90('0x20')](saveUpdates(_0x456452[_0x3b90('0x6b')],null))[_0x3b90('0x20')](respondWithResult(_0x50396d,null))['catch'](handleError(_0x50396d,null));};exports[_0x3b90('0xb2')]=function(_0x4b23be,_0x74241a){return db[_0x3b90('0x92')][_0x3b90('0x5f')]({'where':{'id':_0x4b23be['params']['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x74241a,null))[_0x3b90('0x20')](removeEntity(_0x74241a,null))[_0x3b90('0xac')](handleError(_0x74241a,null));};exports[_0x3b90('0xb3')]=function(_0x1be56f,_0x39eb5e){return db[_0x3b90('0x92')][_0x3b90('0xb3')]()['then'](respondWithResult(_0x39eb5e,null))[_0x3b90('0xac')](handleError(_0x39eb5e,null));};exports['addMessage']=function(_0x152170,_0x171ac6,_0x337da6){return db[_0x3b90('0xb4')][_0x3b90('0x5f')]({'where':{'id':_0x152170[_0x3b90('0xad')]['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x171ac6,null))['then'](function(_0x50ab1f){if(_0x50ab1f){return _0x50ab1f[_0x3b90('0xb5')](_0x152170[_0x3b90('0x6b')][_0x3b90('0xb6')],_[_0x3b90('0xb7')](_0x152170['body'],['ids','id'])||{});}})[_0x3b90('0x20')](respondWithResult(_0x171ac6,null))[_0x3b90('0xac')](handleError(_0x171ac6,null));};exports['getMessages']=function(_0x2c22e9,_0x3346d9,_0xabc9f9){var _0x1d3d2e={'raw':![],'where':{}};var _0x2cef2f={};var _0x4490da={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x3b90('0xb8')]({'where':{'id':_0x2c22e9[_0x3b90('0xad')]['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x3346d9,null))[_0x3b90('0x20')](function(_0x13f288){if(_0x13f288){_0x2cef2f[_0x3b90('0x35')]=_[_0x3b90('0x32')](db[_0x3b90('0xb4')][_0x3b90('0xae')]);_0x2cef2f[_0x3b90('0x31')]=_[_0x3b90('0x32')](_0x2c22e9['query']);_0x2cef2f['filters']=_['intersection'](_0x2cef2f['model'],_0x2cef2f[_0x3b90('0x31')]);_0x1d3d2e[_0x3b90('0x37')]=_[_0x3b90('0x34')](_0x2cef2f[_0x3b90('0x35')],qs[_0x3b90('0x36')](_0x2c22e9[_0x3b90('0x31')][_0x3b90('0x36')]));_0x1d3d2e[_0x3b90('0x37')]=_0x1d3d2e[_0x3b90('0x37')]['length']?_0x1d3d2e[_0x3b90('0x37')]:_0x2cef2f['model'];if(!_0x2c22e9['query'][_0x3b90('0x39')](_0x3b90('0x3a'))){_0x1d3d2e[_0x3b90('0x19')]=qs[_0x3b90('0x19')](_0x2c22e9[_0x3b90('0x31')]['limit']);_0x1d3d2e[_0x3b90('0x18')]=qs['offset'](_0x2c22e9[_0x3b90('0x31')][_0x3b90('0x18')]);}_0x1d3d2e[_0x3b90('0x3b')]=qs[_0x3b90('0x3c')](_0x2c22e9[_0x3b90('0x31')][_0x3b90('0x3c')]);_0x1d3d2e[_0x3b90('0x3d')]=qs[_0x3b90('0x33')](_[_0x3b90('0x3e')](_0x2c22e9[_0x3b90('0x31')],_0x2cef2f['filters']));_0x1d3d2e[_0x3b90('0x3d')][_0x3b90('0xa9')]=_0x13f288['id'];if(_0x2c22e9[_0x3b90('0x31')][_0x3b90('0x79')]){_0x1d3d2e[_0x3b90('0x3d')]=_[_0x3b90('0x91')](_0x1d3d2e[_0x3b90('0x3d')],{'$or':_[_0x3b90('0x27')](_0x1d3d2e[_0x3b90('0x37')],function(_0x383979){var _0xc4bb54={};_0xc4bb54[_0x383979]={'$like':'%'+_0x2c22e9['query'][_0x3b90('0x79')]+'%'};return _0xc4bb54;})});}if(_0x2c22e9[_0x3b90('0x31')]['$gte']){var _0x3c042e=_0x2c22e9[_0x3b90('0x31')][_0x3b90('0xb9')][_0x3b90('0x2b')](',');var _0x57b104={};_0x57b104[_0x3c042e[0x0]]={'$gte':moment(_0x3c042e[0x1])[_0x3b90('0xba')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d3d2e['where']=_['merge'](_0x1d3d2e['where'],_0x57b104);}_0x1d3d2e=_[_0x3b90('0x91')]({},_0x1d3d2e,_0x2c22e9[_0x3b90('0xb0')]);return db[_0x3b90('0xb4')][_0x3b90('0x8d')]({'where':_0x1d3d2e[_0x3b90('0x3d')]})[_0x3b90('0x20')](function(_0x22ead2){_0x4490da[_0x3b90('0x8d')]=_0x22ead2;if(_0x2c22e9['query'][_0x3b90('0xbb')]){_0x1d3d2e[_0x3b90('0xaf')]=[{'all':!![]}];}return db['SmsMessage'][_0x3b90('0xbc')](_0x1d3d2e);})[_0x3b90('0x20')](function(_0x54bbba){_0x4490da[_0x3b90('0xab')]=_0x54bbba;return _0x4490da;});}})['then'](respondWithFilteredResult(_0x3346d9,_0x1d3d2e))[_0x3b90('0xac')](handleError(_0x3346d9,null));};exports['addTags']=function(_0x293642,_0x293197,_0x5b9fd1){return db['SmsInteraction'][_0x3b90('0x5f')]({'where':{'id':_0x293642[_0x3b90('0xad')]['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x293197,null))['then'](function(_0x27f114){if(_0x27f114){return _0x27f114['setTags'](_0x293642[_0x3b90('0x6b')]['ids'],_[_0x3b90('0xb7')](_0x293642[_0x3b90('0x6b')],[_0x3b90('0xb6'),'id'])||{})[_0x3b90('0xbd')](function(){return db[_0x3b90('0x64')][_0x3b90('0xbc')]({'attributes':['id','name',_0x3b90('0x41')],'where':{'id':_0x293642[_0x3b90('0x6b')]['ids']}});})[_0x3b90('0x20')](function(_0x379031){socket[_0x3b90('0xbe')](_0x3b90('0xbf'),{'id':Number(_0x293642['params']['id']),'tags':_0x379031||[]});return{'id':Number(_0x293642['params']['id']),'tags':_0x379031||[]};});}})[_0x3b90('0x20')](respondWithResult(_0x293197,null))[_0x3b90('0xac')](handleError(_0x293197,null));};exports['removeTags']=function(_0x4fe659,_0x352adc,_0x105b8e){return db[_0x3b90('0x92')]['find']({'where':{'id':_0x4fe659[_0x3b90('0xad')]['id']}})[_0x3b90('0x20')](handleEntityNotFound(_0x352adc,null))[_0x3b90('0x20')](function(_0x1b6c29){if(_0x1b6c29){return _0x1b6c29[_0x3b90('0xc0')](_0x4fe659[_0x3b90('0x31')][_0x3b90('0xb6')]);}})['then'](respondWithStatusCode(_0x352adc,null))[_0x3b90('0xac')](handleError(_0x352adc,null));};exports[_0x3b90('0xc1')]=function(_0xd84ba2,_0x364f0e){var _0x450a46=moment()[_0x3b90('0xc2')]()['toString']();var _0x4f154f=path[_0x3b90('0xc3')](config[_0x3b90('0xc4')],_0x3b90('0xc5'),_0x3b90('0xc6'),_0x3b90('0xc7'));var _0x5ce783=path[_0x3b90('0xc3')](config[_0x3b90('0xc4')],'server',_0x3b90('0xc6'),_0x3b90('0xc8'));var _0x4e1dac=path[_0x3b90('0xc3')](_0x4f154f,_0x450a46);var _0xbc60a4=util['format']('transcript-%d-%s.zip',_0xd84ba2['params']['id'],_0x450a46);var _0x5a4736=path[_0x3b90('0xc3')](_0x4f154f,_0xbc60a4);var _0x368a65=[];_0x368a65[_0x3b90('0x2c')]({'model':db['User'],'as':_0x3b90('0x68'),'attributes':['id',_0x3b90('0x28')],'raw':!![]});_0x368a65[_0x3b90('0x2c')]({'model':db[_0x3b90('0xc9')],'as':_0x3b90('0x5a'),'attributes':['id',_0x3b90('0xca'),'lastName'],'raw':!![]});var _0x428fc7=[{'model':db['SmsMessage'],'as':_0x3b90('0xcb'),'attributes':['id',_0x3b90('0x6b'),'createdAt','direction',_0x3b90('0xcc'),_0x3b90('0x74')],'include':_0x368a65}];_0x428fc7[_0x3b90('0x2c')]({'model':db[_0x3b90('0xcd')],'as':_0x3b90('0xce'),'attributes':['id',_0x3b90('0x24')]});_0x428fc7[_0x3b90('0x2c')]({'model':db[_0x3b90('0x68')],'as':_0x3b90('0xcf'),'attributes':['id',_0x3b90('0x28')]});return db[_0x3b90('0x92')][_0x3b90('0x5f')]({'where':{'id':_0xd84ba2['params']['id']},'include':_0x428fc7})[_0x3b90('0x20')](handleEntityNotFound(_0x364f0e,null))[_0x3b90('0x20')](function(_0x318679){if(_0x318679){var _0x462a16=_0x318679[_0x3b90('0xd0')]({'plain':!![]});fs[_0x3b90('0xd1')](_0x4e1dac);var _0x53df48={'format':'A4','border':_0x3b90('0xd2'),'header':{'height':_0x3b90('0xd3'),'contents':{'first':_0x3b90('0xd4')}},'footer':{'height':'30px','contents':{'default':util[_0x3b90('0xba')](_0x3b90('0xd5'),util['format'](_0x3b90('0xd6'),_0x3b90('0xd7'),_0x462a16['id']),moment()[_0x3b90('0xba')](_0x3b90('0xd8'))['toString']())}}};var _0x222229={'channel':_0x3b90('0xd7'),'account':_0x462a16[_0x3b90('0xce')][_0x3b90('0x24')],'agent':_0x462a16['Owner']?_0x462a16[_0x3b90('0xcf')][_0x3b90('0x28')]:_0x3b90('0xd9'),'createdAt':moment(_0x462a16[_0x3b90('0xda')])[_0x3b90('0xba')](_0x3b90('0xdb'))[_0x3b90('0x8f')](),'closedAt':_0x462a16[_0x3b90('0xdc')]?moment(_0x462a16[_0x3b90('0xdd')])[_0x3b90('0xba')](_0x3b90('0xdb'))[_0x3b90('0x8f')]():'','disposition':_0x462a16[_0x3b90('0xde')],'messages':_(_0x462a16[_0x3b90('0xcb')])[_0x3b90('0x79')]({'secret':![]})[_0x3b90('0x27')](function(_0x427ce8){return{'date':moment(_0x427ce8['createdAt'])[_0x3b90('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3b90('0x8f')](),'sender':_0x427ce8[_0x3b90('0xdf')]===_0x3b90('0xe0')?_0x427ce8[_0x3b90('0x68')]?_0x427ce8[_0x3b90('0x68')][_0x3b90('0x28')]:_0x3b90('0xe1'):_0x427ce8[_0x3b90('0x5a')][_0x3b90('0xca')]+(_0x427ce8[_0x3b90('0x5a')][_0x3b90('0xe2')]?'\x20'+_0x427ce8[_0x3b90('0x5a')]['lastName']:''),'body':_0x427ce8['body'],'direction':_0x427ce8[_0x3b90('0xdf')]==='out'?'A':'C','secret':_0x427ce8[_0x3b90('0xcc')],'read':_0x427ce8[_0x3b90('0x74')]};})[_0x3b90('0x56')]()};return ejs[_0x3b90('0xe3')](path[_0x3b90('0xc3')](config[_0x3b90('0xc4')],'server',_0x3b90('0xe4'),_0x3b90('0xe5')),{'interaction':_0x222229})[_0x3b90('0x20')](function(_0x25a7b7){return new BPromise(function(_0x217be5,_0x46da40){pdf[_0x3b90('0xb1')](_0x25a7b7,_0x53df48)['toFile'](path['join'](_0x4e1dac,_0x3b90('0xe6')+_0x462a16['id']+'-'+_0x450a46+_0x3b90('0xe7')),function(_0x476605,_0x580cc3){if(_0x476605)return _0x46da40(_0x476605);_0x217be5(_0x580cc3);});});})[_0x3b90('0x20')](function(){return new BPromise(function(_0x1d5fe8,_0x115518){zipdir(_0x4e1dac,{'saveTo':_0x5a4736},function(_0x466166,_0x2e1a1e){if(_0x466166)return _0x115518(_0x466166);return _0x1d5fe8(_0x2e1a1e);});})[_0x3b90('0x20')](function(){return new BPromise(function(_0x1afa92,_0x49e993){rimraf(_0x4e1dac,function(_0x49c2cf){if(_0x49c2cf)_0x49e993(_0x49c2cf);return _0x1afa92();});});})[_0x3b90('0x20')](function(){return _0x364f0e[_0x3b90('0xc1')](_0x5a4736,_0xbc60a4,function(_0x175fe0){if(_0x175fe0){console[_0x3b90('0xe8')](_0x3b90('0xe9'),_0x175fe0);}else{fs[_0x3b90('0xea')](_0x5a4736);}});});});}else{return _0x364f0e[_0x3b90('0x21')](0xc8);}})['catch'](handleError(_0x364f0e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 6e72b9f..d69d6ad 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 _0x72b1=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','findAll','then'];(function(_0x5e3126,_0xd58a03){var _0x5b5f8c=function(_0x3f8352){while(--_0x3f8352){_0x5e3126['push'](_0x5e3126['shift']());}};_0x5b5f8c(++_0xd58a03);}(_0x72b1,0x16e));var _0x172b=function(_0x48f96b,_0x1b3edf){_0x48f96b=_0x48f96b-0x0;var _0x362247=_0x72b1[_0x48f96b];return _0x362247;};'use strict';var EventEmitter=require(_0x172b('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x172b('0x1')];var SmsMessage=require(_0x172b('0x2'))['db'][_0x172b('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x172b('0x4')](0x0);var events={'afterCreate':_0x172b('0x5'),'afterUpdate':_0x172b('0x6'),'afterDestroy':_0x172b('0x7')};function emitEvent(_0x558038){return function(_0x3781f3,_0x40c72e,_0x475fd6){_0x3781f3[_0x172b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x345e5e){_0x3781f3['setDataValue'](_0x172b('0x9'),_0x345e5e['map'](function(_0x6680e0){return{'id':_0x6680e0['id']};}));return SmsMessage[_0x172b('0xa')]({'where':{'SmsInteractionId':_0x3781f3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x172b('0xb')](function(_0x392f1e){_0x3781f3['setDataValue'](_0x172b('0xc'),_0x392f1e[_0x172b('0xd')]);SmsInteractionEvents[_0x172b('0xe')](_0x558038+':'+_0x3781f3['id'],_0x3781f3);SmsInteractionEvents[_0x172b('0xe')](_0x558038,_0x3781f3);_0x475fd6(null);})[_0x172b('0xf')](_0x475fd6(null));};}for(var e in events){if(events[_0x172b('0x10')](e)){var event=events[e];SmsInteraction[_0x172b('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x4b84=['getUsers','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','update','remove'];(function(_0x423bc4,_0x3c2186){var _0x1d9a75=function(_0x357da5){while(--_0x357da5){_0x423bc4['push'](_0x423bc4['shift']());}};_0x1d9a75(++_0x3c2186);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0x4b84[_0x3fb5eb];return _0x481291;};'use strict';var EventEmitter=require(_0x44b8('0x0'));var SmsInteraction=require(_0x44b8('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0x44b8('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x44b8('0x3'),'afterDestroy':_0x44b8('0x4')};function emitEvent(_0x39ad16){return function(_0x5766b0,_0x4f875e,_0x55f25d){_0x5766b0[_0x44b8('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x327f59){_0x5766b0['setDataValue'](_0x44b8('0x6'),_0x327f59['map'](function(_0x5034b6){return{'id':_0x5034b6['id']};}));return SmsMessage[_0x44b8('0x7')]({'where':{'SmsInteractionId':_0x5766b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x44b8('0x8')](function(_0x30ebc3){_0x5766b0['setDataValue'](_0x44b8('0x9'),_0x30ebc3[_0x44b8('0xa')]);SmsInteractionEvents[_0x44b8('0xb')](_0x39ad16+':'+_0x5766b0['id'],_0x5766b0);SmsInteractionEvents[_0x44b8('0xb')](_0x39ad16,_0x5766b0);_0x55f25d(null);})[_0x44b8('0xc')](_0x55f25d(null));};}for(var e in events){if(events[_0x44b8('0xd')](e)){var event=events[e];SmsInteraction[_0x44b8('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 337a715..82b2c80 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 _0xde9e=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed'];(function(_0x49279c,_0x56da65){var _0x472c04=function(_0x6b5a3d){while(--_0x6b5a3d){_0x49279c['push'](_0x49279c['shift']());}};_0x472c04(++_0x56da65);}(_0xde9e,0x70));var _0xede9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xede9('0x0'));var logger=require(_0xede9('0x1'))(_0xede9('0x2'));var moment=require(_0xede9('0x3'));var BPromise=require(_0xede9('0x4'));var rp=require(_0xede9('0x5'));var fs=require('fs');var path=require(_0xede9('0x6'));var rimraf=require(_0xede9('0x7'));var config=require(_0xede9('0x8'));var attributes=require(_0xede9('0x9'));module['exports']=function(_0x2635c6,_0x16392b){return _0x2635c6[_0xede9('0xa')](_0xede9('0xb'),attributes,{'tableName':_0xede9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x582dfb,_0x33c600,_0x12003e){if(_0x582dfb[_0xede9('0xd')](_0xede9('0xe'))){_0x582dfb[_0xede9('0xf')]=moment()[_0xede9('0x10')](_0xede9('0x11'));}_0x12003e(null,_0x582dfb);}}});}; \ No newline at end of file +var _0x2f14=['changed','closed','closedAt','format','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x293433,_0x22537a){var _0x172cc9=function(_0x156794){while(--_0x156794){_0x293433['push'](_0x293433['shift']());}};_0x172cc9(++_0x22537a);}(_0x2f14,0x199));var _0x42f1=function(_0x286f3a,_0x23f1f1){_0x286f3a=_0x286f3a-0x0;var _0x2fb34c=_0x2f14[_0x286f3a];return _0x2fb34c;};'use strict';var _=require('lodash');var util=require(_0x42f1('0x0'));var logger=require(_0x42f1('0x1'))('api');var moment=require(_0x42f1('0x2'));var BPromise=require('bluebird');var rp=require(_0x42f1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42f1('0x4'));var config=require(_0x42f1('0x5'));var attributes=require(_0x42f1('0x6'));module[_0x42f1('0x7')]=function(_0x210043,_0xd7e996){return _0x210043[_0x42f1('0x8')](_0x42f1('0x9'),attributes,{'tableName':_0x42f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x516359,_0x2a77a6,_0xf535ab){if(_0x516359[_0x42f1('0xb')](_0x42f1('0xc'))){_0x516359[_0x42f1('0xd')]=moment()[_0x42f1('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xf535ab(null,_0x516359);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c8a1fde..5ad7782 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 _0xb9be=['SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsInteraction,\x20%s,\x20%s','SmsInteraction','body','options','where','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','./smsInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0x49edf5,_0x3bc3b6){var _0x1ddfd5=function(_0x1d38a5){while(--_0x1d38a5){_0x49edf5['push'](_0x49edf5['shift']());}};_0x1ddfd5(++_0x3bc3b6);}(_0xb9be,0xfe));var _0xeb9b=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0xb9be[_0x16bb4b];return _0x8aeb84;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb9b('0x4'));var db=require(_0xeb9b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb9b('0x6'))('rpc');var config=require(_0xeb9b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb9b('0x8')][_0xeb9b('0x9')]({'port':0x232a});config[_0xeb9b('0xa')]=_[_0xeb9b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xeb9b('0xc'))[_0xeb9b('0xd')](socket);function respondWithRpcPromise(_0x4de18c,_0x2d4bbb,_0x2e1457){return new BPromise(function(_0x1da2dd,_0x2fd165){return client[_0xeb9b('0xe')](_0x4de18c,_0x2e1457)[_0xeb9b('0xf')](function(_0x2ad597){logger[_0xeb9b('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x2d4bbb,_0xeb9b('0x11'));logger[_0xeb9b('0x12')](_0xeb9b('0x13'),_0x2d4bbb,_0xeb9b('0x11'),JSON[_0xeb9b('0x14')](_0x2ad597));if(_0x2ad597[_0xeb9b('0x15')]){if(_0x2ad597[_0xeb9b('0x15')]['code']===0x1f4){logger[_0xeb9b('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x2d4bbb,_0x2ad597['error'][_0xeb9b('0x16')]);return _0x2fd165(_0x2ad597[_0xeb9b('0x15')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x2d4bbb,_0x2ad597[_0xeb9b('0x15')][_0xeb9b('0x16')]);return _0x1da2dd(_0x2ad597[_0xeb9b('0x15')][_0xeb9b('0x16')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x2d4bbb,'request\x20sent');_0x1da2dd(_0x2ad597[_0xeb9b('0x17')]['message']);}})[_0xeb9b('0x18')](function(_0x1ab5de){logger[_0xeb9b('0x15')](_0xeb9b('0x19'),_0x2d4bbb,_0x1ab5de);_0x2fd165(_0x1ab5de);});});}exports['UpdateSmsInteraction']=function(_0x4d7e7f){var _0x376271=this;return new Promise(function(_0x460d36,_0x288b56){return db[_0xeb9b('0x1a')]['update'](_0x4d7e7f[_0xeb9b('0x1b')],{'raw':_0x4d7e7f[_0xeb9b('0x1c')]?_0x4d7e7f[_0xeb9b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d7e7f[_0xeb9b('0x1c')]?_0x4d7e7f[_0xeb9b('0x1c')][_0xeb9b('0x1d')]||null:null,'attributes':_0x4d7e7f[_0xeb9b('0x1c')]?_0x4d7e7f[_0xeb9b('0x1c')]['attributes']||null:null,'limit':_0x4d7e7f[_0xeb9b('0x1c')]?_0x4d7e7f['options'][_0xeb9b('0x1e')]||null:null})[_0xeb9b('0xf')](function(_0x3f8912){logger[_0xeb9b('0x10')](_0xeb9b('0x1f'),_0x4d7e7f);logger['debug'](_0xeb9b('0x1f'),_0x4d7e7f,JSON[_0xeb9b('0x14')](_0x3f8912));_0x460d36(_0x3f8912);})['catch'](function(_0x3c59eb){logger['error'](_0xeb9b('0x1f'),_0x3c59eb[_0xeb9b('0x16')],_0x4d7e7f);_0x288b56(_0x376271['error'](0x1f4,_0x3c59eb[_0xeb9b('0x16')]));});});};exports[_0xeb9b('0x20')]=function(_0x3ee1ae){return new Promise(function(_0x1354c7,_0x8c9d5b){return db[_0xeb9b('0x1a')][_0xeb9b('0x21')]({'where':_0x3ee1ae[_0xeb9b('0x1c')]?_0x3ee1ae[_0xeb9b('0x1c')][_0xeb9b('0x1d')]||null:null})[_0xeb9b('0xf')](function(_0x3838a2){if(_0x3838a2){return _0x3838a2[_0xeb9b('0x22')](_0x3ee1ae[_0xeb9b('0x1b')][_0xeb9b('0x23')],_[_0xeb9b('0x24')](_0x3ee1ae['body'],['ids','id'])||{});}})[_0xeb9b('0x25')](function(_0xa94d18){logger[_0xeb9b('0x10')](_0xeb9b('0x26'),_0x3ee1ae);logger['debug'](_0xeb9b('0x26'),_0x3ee1ae,JSON['stringify'](_0xa94d18));_0x1354c7(_0xa94d18);})[_0xeb9b('0x18')](function(_0x1bb0da){logger[_0xeb9b('0x15')](_0xeb9b('0x26'),_0x1bb0da[_0xeb9b('0x16')],_0x3ee1ae);_0x8c9d5b(_this[_0xeb9b('0x15')](0x1f4,_0x1bb0da['message']));});});}; \ No newline at end of file +var _0xf073=['AddTags','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','find','omit','ids'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xf073,0x17d));var _0x3f07=function(_0xafd9f9,_0x41e0c9){_0xafd9f9=_0xafd9f9-0x0;var _0x283a5b=_0xf073[_0xafd9f9];return _0x283a5b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f07('0x0'));var BPromise=require(_0x3f07('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f07('0x2'))['db'];var utils=require(_0x3f07('0x3'));var logger=require(_0x3f07('0x4'))('rpc');var config=require(_0x3f07('0x5'));var jayson=require(_0x3f07('0x6'));var client=jayson[_0x3f07('0x7')]['http']({'port':0x232a});config['redis']=_[_0x3f07('0x8')](config['redis'],{'host':_0x3f07('0x9'),'port':0x18eb});var socket=require(_0x3f07('0xa'))(new Redis(config[_0x3f07('0xb')]));require('./smsInteraction.socket')[_0x3f07('0xc')](socket);function respondWithRpcPromise(_0x590fa5,_0x63f77b,_0x1f0b83){return new BPromise(function(_0x1e54fb,_0x50c5a6){return client['request'](_0x590fa5,_0x1f0b83)['then'](function(_0x2c2a2c){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x63f77b,_0x3f07('0xd'));logger[_0x3f07('0xe')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x63f77b,'request\x20sent',JSON[_0x3f07('0xf')](_0x2c2a2c));if(_0x2c2a2c['error']){if(_0x2c2a2c[_0x3f07('0x10')][_0x3f07('0x11')]===0x1f4){logger[_0x3f07('0x10')](_0x3f07('0x12'),_0x63f77b,_0x2c2a2c[_0x3f07('0x10')][_0x3f07('0x13')]);return _0x50c5a6(_0x2c2a2c[_0x3f07('0x10')][_0x3f07('0x13')]);}logger[_0x3f07('0x10')](_0x3f07('0x12'),_0x63f77b,_0x2c2a2c[_0x3f07('0x10')][_0x3f07('0x13')]);return _0x1e54fb(_0x2c2a2c[_0x3f07('0x10')][_0x3f07('0x13')]);}else{logger[_0x3f07('0x14')](_0x3f07('0x12'),_0x63f77b,'request\x20sent');_0x1e54fb(_0x2c2a2c[_0x3f07('0x15')][_0x3f07('0x13')]);}})[_0x3f07('0x16')](function(_0x3b9174){logger['error'](_0x3f07('0x12'),_0x63f77b,_0x3b9174);_0x50c5a6(_0x3b9174);});});}exports['UpdateSmsInteraction']=function(_0x29758a){var _0x334d30=this;return new Promise(function(_0x501f1e,_0x2a942f){return db[_0x3f07('0x17')][_0x3f07('0x18')](_0x29758a[_0x3f07('0x19')],{'raw':_0x29758a['options']?_0x29758a[_0x3f07('0x1a')][_0x3f07('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29758a[_0x3f07('0x1a')]?_0x29758a[_0x3f07('0x1a')][_0x3f07('0x1c')]||null:null,'attributes':_0x29758a['options']?_0x29758a['options'][_0x3f07('0x1d')]||null:null,'limit':_0x29758a[_0x3f07('0x1a')]?_0x29758a[_0x3f07('0x1a')][_0x3f07('0x1e')]||null:null})[_0x3f07('0x1f')](function(_0x15e6a6){logger[_0x3f07('0x14')](_0x3f07('0x20'),_0x29758a);logger[_0x3f07('0xe')](_0x3f07('0x20'),_0x29758a,JSON['stringify'](_0x15e6a6));_0x501f1e(_0x15e6a6);})['catch'](function(_0x214acc){logger[_0x3f07('0x10')](_0x3f07('0x20'),_0x214acc[_0x3f07('0x13')],_0x29758a);_0x2a942f(_0x334d30[_0x3f07('0x10')](0x1f4,_0x214acc[_0x3f07('0x13')]));});});};exports[_0x3f07('0x21')]=function(_0x14f3b4){return new Promise(function(_0x5d9dfb,_0x411a18){return db['SmsInteraction'][_0x3f07('0x22')]({'where':_0x14f3b4[_0x3f07('0x1a')]?_0x14f3b4[_0x3f07('0x1a')][_0x3f07('0x1c')]||null:null})[_0x3f07('0x1f')](function(_0x2adfda){if(_0x2adfda){return _0x2adfda['addTags'](_0x14f3b4[_0x3f07('0x19')]['ids'],_[_0x3f07('0x23')](_0x14f3b4[_0x3f07('0x19')],[_0x3f07('0x24'),'id'])||{});}})['spread'](function(_0x456f95){logger[_0x3f07('0x14')](_0x3f07('0x25'),_0x14f3b4);logger[_0x3f07('0xe')](_0x3f07('0x25'),_0x14f3b4,JSON[_0x3f07('0xf')](_0x456f95));_0x5d9dfb(_0x456f95);})['catch'](function(_0x269295){logger[_0x3f07('0x10')](_0x3f07('0x25'),_0x269295[_0x3f07('0x13')],_0x14f3b4);_0x411a18(_this[_0x3f07('0x10')](0x1f4,_0x269295[_0x3f07('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6443a70..f931b3b 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 _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x44aab6,_0x55ddb8){var _0x5f3d87=function(_0x169da0){while(--_0x169da0){_0x44aab6['push'](_0x44aab6['shift']());}};_0x5f3d87(++_0x55ddb8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x2032,0xd9));var _0x2203=function(_0x1d0464,_0x439143){_0x1d0464=_0x1d0464-0x0;var _0x18fa7d=_0x2032[_0x1d0464];return _0x18fa7d;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 52384dd..c01cada 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 _0x4004=['show','post','tracked','sms','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id'];(function(_0xf5e69c,_0x80e8e5){var _0x5cb064=function(_0x587335){while(--_0x587335){_0xf5e69c['push'](_0xf5e69c['shift']());}};_0x5cb064(++_0x80e8e5);}(_0x4004,0x72));var _0x4400=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0x4004[_0x568ec8];return _0x52b2be;};'use strict';var multer=require('multer');var util=require(_0x4400('0x0'));var path=require(_0x4400('0x1'));var timeout=require(_0x4400('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4400('0x3'));var config=require(_0x4400('0x4'));var controller=require(_0x4400('0x5'));router[_0x4400('0x6')]('/',auth[_0x4400('0x7')](),controller[_0x4400('0x8')]);router[_0x4400('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4400('0x9')]);router[_0x4400('0x6')](_0x4400('0xa'),auth[_0x4400('0x7')](),controller[_0x4400('0xb')]);router[_0x4400('0xc')]('/',auth[_0x4400('0x7')](),interaction[_0x4400('0xd')](_0x4400('0xe'),'smsmessage:create'),controller[_0x4400('0xf')]);router[_0x4400('0xc')](_0x4400('0x10'),controller[_0x4400('0x11')]);router[_0x4400('0x12')](_0x4400('0xa'),auth[_0x4400('0x7')](),controller[_0x4400('0x13')]);router[_0x4400('0x12')](_0x4400('0x14'),auth[_0x4400('0x7')](),controller[_0x4400('0x15')]);router[_0x4400('0x12')]('/:id/reject',auth[_0x4400('0x7')](),controller[_0x4400('0x16')]);router[_0x4400('0x17')](_0x4400('0xa'),auth[_0x4400('0x7')](),controller['destroy']);module[_0x4400('0x18')]=router; \ No newline at end of file +var _0xb951=['/:id/status','status','put','/:id/accept','reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create'];(function(_0x31dc7e,_0x2dd309){var _0x172eac=function(_0x25c92e){while(--_0x25c92e){_0x31dc7e['push'](_0x31dc7e['shift']());}};_0x172eac(++_0x2dd309);}(_0xb951,0x1c1));var _0x1b95=function(_0x31bb33,_0x11df38){_0x31bb33=_0x31bb33-0x0;var _0x4eae64=_0xb951[_0x31bb33];return _0x4eae64;};'use strict';var multer=require(_0x1b95('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1b95('0x1'));var express=require(_0x1b95('0x2'));var router=express[_0x1b95('0x3')]();var auth=require(_0x1b95('0x4'));var interaction=require(_0x1b95('0x5'));var config=require(_0x1b95('0x6'));var controller=require('./smsMessage.controller');router[_0x1b95('0x7')]('/',auth[_0x1b95('0x8')](),controller[_0x1b95('0x9')]);router[_0x1b95('0x7')](_0x1b95('0xa'),auth[_0x1b95('0x8')](),controller[_0x1b95('0xb')]);router[_0x1b95('0x7')](_0x1b95('0xc'),auth[_0x1b95('0x8')](),controller[_0x1b95('0xd')]);router[_0x1b95('0xe')]('/',auth[_0x1b95('0x8')](),interaction[_0x1b95('0xf')](_0x1b95('0x10'),_0x1b95('0x11')),controller[_0x1b95('0x12')]);router[_0x1b95('0xe')](_0x1b95('0x13'),controller[_0x1b95('0x14')]);router[_0x1b95('0x15')]('/:id',auth[_0x1b95('0x8')](),controller['update']);router[_0x1b95('0x15')](_0x1b95('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x1b95('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x1b95('0x17')]);router['delete'](_0x1b95('0xc'),auth[_0x1b95('0x8')](),controller[_0x1b95('0x18')]);module[_0x1b95('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e42eed6..b01fd61 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 _0x2452=['exports','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x2452,0x179));var _0x2245=function(_0x9a138c,_0x2607f8){_0x9a138c=_0x9a138c-0x0;var _0x3771a3=_0x2452[_0x9a138c];return _0x3771a3;};'use strict';var Sequelize=require(_0x2245('0x0'));module[_0x2245('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2245('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2245('0x3')]('in',_0x2245('0x4')),'defaultValue':_0x2245('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2245('0x5')](0xbe)},'phone':{'type':Sequelize[_0x2245('0x5')]},'readAt':{'type':Sequelize[_0x2245('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x675e=['STRING','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x48eb0c,_0x1fb504){var _0x5c9aec=function(_0x1f1a39){while(--_0x1f1a39){_0x48eb0c['push'](_0x48eb0c['shift']());}};_0x5c9aec(++_0x1fb504);}(_0x675e,0xc1));var _0xe675=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x675e[_0x1a89a1];return _0x3d5b46;};'use strict';var Sequelize=require(_0xe675('0x0'));module[_0xe675('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe675('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe675('0x3')]('in',_0xe675('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe675('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe675('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xe675('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 54d6d5c..016be20 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 _0xca56=['error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','map','SmsMessage','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','create','body','describe','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','CmContact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','socket.io-emitter','register','jayson/promise','http','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','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x299b9c,_0xd252d2){var _0x4adff8=function(_0x3e19cb){while(--_0x3e19cb){_0x299b9c['push'](_0x299b9c['shift']());}};_0x4adff8(++_0xd252d2);}(_0xca56,0xee));var _0x6ca5=function(_0x3528e8,_0x5f4ffe){_0x3528e8=_0x3528e8-0x0;var _0x47231d=_0xca56[_0x3528e8];return _0x47231d;};'use strict';var pdf=require(_0x6ca5('0x0'));var emlformat=require(_0x6ca5('0x1'));var rimraf=require(_0x6ca5('0x2'));var zipdir=require(_0x6ca5('0x3'));var jsonpatch=require(_0x6ca5('0x4'));var rp=require(_0x6ca5('0x5'));var moment=require(_0x6ca5('0x6'));var BPromise=require(_0x6ca5('0x7'));var Mustache=require(_0x6ca5('0x8'));var util=require('util');var path=require(_0x6ca5('0x9'));var sox=require(_0x6ca5('0xa'));var csv=require(_0x6ca5('0xb'));var ejs=require(_0x6ca5('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ca5('0xd'));var crypto=require(_0x6ca5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ca5('0xb'));var querystring=require(_0x6ca5('0xf'));var Papa=require(_0x6ca5('0x10'));var Redis=require(_0x6ca5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ca5('0x12'));var hardwareService=require(_0x6ca5('0x13'));var logger=require(_0x6ca5('0x14'))(_0x6ca5('0x15'));var utils=require(_0x6ca5('0x16'));var config=require('../../config/environment');var db=require(_0x6ca5('0x17'))['db'];config['redis']=_[_0x6ca5('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ca5('0x19'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x6ca5('0x1a')](socket);var jayson=require(_0x6ca5('0x1b'));var client=jayson['client'][_0x6ca5('0x1c')]({'port':0x232c});var client9002=jayson[_0x6ca5('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x40483f,_0x19debd,_0x1cdfdc){if(_0x1cdfdc){var _0x115381=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x115381[_0x6ca5('0x1e')](_0x19debd)){return _0x40483f;}else{throw new db['Sequelize'][(_0x6ca5('0x1f'))](_0x6ca5('0x20'));}}else{return _0x40483f;}}function respondWithRpcPromise(_0x579a6e,_0x2b3daf,_0xd48e56,_0x4fefd0){return new BPromise(function(_0x100df4,_0x929bbf){var _0x15ffb6=_0x4fefd0||client;return _0x15ffb6[_0x6ca5('0x21')](_0x579a6e,_0xd48e56)[_0x6ca5('0x22')](function(_0x1115ae){logger['info'](_0x6ca5('0x23'),_0x2b3daf,_0x6ca5('0x24'));logger[_0x6ca5('0x25')](_0x6ca5('0x26'),_0x2b3daf,_0x6ca5('0x24'),JSON[_0x6ca5('0x27')](_0x1115ae));if(_0x1115ae[_0x6ca5('0x28')]){if(_0x1115ae[_0x6ca5('0x28')][_0x6ca5('0x29')]===0x1f4){logger[_0x6ca5('0x28')](_0x6ca5('0x23'),_0x2b3daf,_0x1115ae[_0x6ca5('0x28')][_0x6ca5('0x2a')]);return _0x929bbf(_0x1115ae[_0x6ca5('0x28')][_0x6ca5('0x2a')]);}logger['error'](_0x6ca5('0x23'),_0x2b3daf,_0x1115ae[_0x6ca5('0x28')][_0x6ca5('0x2a')]);return _0x100df4(_0x1115ae[_0x6ca5('0x28')]['message']);}else{logger[_0x6ca5('0x2b')](_0x6ca5('0x23'),_0x2b3daf,_0x6ca5('0x24'));_0x100df4(_0x1115ae[_0x6ca5('0x2c')][_0x6ca5('0x2a')]);}})[_0x6ca5('0x2d')](function(_0x241614){logger['error'](_0x6ca5('0x23'),_0x2b3daf,_0x241614);_0x929bbf(_0x241614);});});}function respondWithStatusCode(_0x405979,_0x100120){_0x100120=_0x100120||0xcc;return function(_0x150f54){if(_0x150f54){return _0x405979[_0x6ca5('0x2e')](_0x100120);}return _0x405979[_0x6ca5('0x2f')](_0x100120)['end']();};}function respondWithResult(_0xa570e4,_0x31ab9c){_0x31ab9c=_0x31ab9c||0xc8;return function(_0x3f0756){if(_0x3f0756){return _0xa570e4[_0x6ca5('0x2f')](_0x31ab9c)[_0x6ca5('0x30')](_0x3f0756);}};}function respondWithFilteredResult(_0x2d6558,_0x441436){return function(_0x451c2d){if(_0x451c2d){var _0x360172=_0x451c2d[_0x6ca5('0x31')],_0x1d6420=_0x441436[_0x6ca5('0x32')],_0x3e30c5=_0x441436[_0x6ca5('0x32')]+_0x441436[_0x6ca5('0x33')],_0x2230d4;if(_0x3e30c5>=_0x360172){_0x3e30c5=_0x360172;_0x2230d4=0xc8;}else{_0x2230d4=0xce;}_0x2d6558[_0x6ca5('0x2f')](_0x2230d4);return _0x2d6558[_0x6ca5('0x34')](_0x6ca5('0x35'),_0x1d6420+'-'+_0x3e30c5+'/'+_0x360172)[_0x6ca5('0x30')](_0x451c2d);}return null;};}function patchUpdates(_0x5b95ce){return function(_0x40c4b7){try{jsonpatch['apply'](_0x40c4b7,_0x5b95ce,!![]);}catch(_0x22cd7f){return BPromise[_0x6ca5('0x36')](_0x22cd7f);}return _0x40c4b7[_0x6ca5('0x37')]();};}function saveUpdates(_0x170203,_0x5942a3){return function(_0x1f1798){if(_0x1f1798){return _0x1f1798[_0x6ca5('0x38')](_0x170203)[_0x6ca5('0x22')](function(_0x3d769a){return _0x3d769a;});}return null;};}function removeEntity(_0xce09fb,_0x322699){return function(_0x526fce){if(_0x526fce){return _0x526fce[_0x6ca5('0x39')]()[_0x6ca5('0x22')](function(){_0xce09fb['status'](0xcc)[_0x6ca5('0x3a')]();});}};}function handleEntityNotFound(_0x37aab3,_0x16fc54){return function(_0x57bb45){if(!_0x57bb45){_0x37aab3[_0x6ca5('0x2e')](0x194);}return _0x57bb45;};}function handleError(_0x2d9b2d,_0x22682a){_0x22682a=_0x22682a||0x1f4;return function(_0xb3801){logger['error'](_0xb3801[_0x6ca5('0x3b')]);if(_0xb3801[_0x6ca5('0x3c')]){delete _0xb3801[_0x6ca5('0x3c')];}_0x2d9b2d[_0x6ca5('0x2f')](_0x22682a)[_0x6ca5('0x3d')](_0xb3801);};}exports['index']=function(_0x39b970,_0x23bca2){var _0x1f014f={},_0x218c52={},_0x50d856={'count':0x0,'rows':[]};var _0x9261a8=_[_0x6ca5('0x3e')](db[_0x6ca5('0x3f')]['rawAttributes'],function(_0x380c54){return{'name':_0x380c54[_0x6ca5('0x40')],'type':_0x380c54[_0x6ca5('0x41')][_0x6ca5('0x42')]};});_0x218c52['model']=_[_0x6ca5('0x3e')](_0x9261a8,_0x6ca5('0x3c'));_0x218c52['query']=_[_0x6ca5('0x43')](_0x39b970[_0x6ca5('0x44')]);_0x218c52[_0x6ca5('0x45')]=_[_0x6ca5('0x46')](_0x218c52[_0x6ca5('0x47')],_0x218c52[_0x6ca5('0x44')]);_0x1f014f[_0x6ca5('0x48')]=_[_0x6ca5('0x46')](_0x218c52[_0x6ca5('0x47')],qs[_0x6ca5('0x49')](_0x39b970[_0x6ca5('0x44')]['fields']));_0x1f014f[_0x6ca5('0x48')]=_0x1f014f[_0x6ca5('0x48')][_0x6ca5('0x4a')]?_0x1f014f[_0x6ca5('0x48')]:_0x218c52['model'];if(!_0x39b970[_0x6ca5('0x44')][_0x6ca5('0x4b')]('nolimit')){_0x1f014f[_0x6ca5('0x33')]=qs[_0x6ca5('0x33')](_0x39b970['query'][_0x6ca5('0x33')]);_0x1f014f['offset']=qs['offset'](_0x39b970['query'][_0x6ca5('0x32')]);}_0x1f014f[_0x6ca5('0x4c')]=qs[_0x6ca5('0x4d')](_0x39b970[_0x6ca5('0x44')][_0x6ca5('0x4d')]);_0x1f014f[_0x6ca5('0x4e')]=qs[_0x6ca5('0x45')](_['pick'](_0x39b970['query'],_0x218c52[_0x6ca5('0x45')]),_0x9261a8);if(_0x39b970[_0x6ca5('0x44')][_0x6ca5('0x4f')]){_0x1f014f[_0x6ca5('0x4e')]=_[_0x6ca5('0x50')](_0x1f014f['where'],{'$or':_[_0x6ca5('0x3e')](_0x9261a8,function(_0x2c882e){if(_0x2c882e[_0x6ca5('0x41')]!==_0x6ca5('0x51')){var _0x246c96={};_0x246c96[_0x2c882e['name']]={'$like':'%'+_0x39b970['query'][_0x6ca5('0x4f')]+'%'};return _0x246c96;}})});}_0x1f014f=_['merge']({},_0x1f014f,_0x39b970[_0x6ca5('0x52')]);var _0x1a7be0={'where':_0x1f014f['where']};return db[_0x6ca5('0x3f')][_0x6ca5('0x31')](_0x1a7be0)[_0x6ca5('0x22')](function(_0x1d7bc0){_0x50d856['count']=_0x1d7bc0;if(_0x39b970[_0x6ca5('0x44')][_0x6ca5('0x53')]){_0x1f014f[_0x6ca5('0x54')]=[{'all':!![]}];}return db[_0x6ca5('0x3f')][_0x6ca5('0x55')](_0x1f014f);})[_0x6ca5('0x22')](function(_0x259642){_0x50d856[_0x6ca5('0x56')]=_0x259642;return _0x50d856;})['then'](respondWithFilteredResult(_0x23bca2,_0x1f014f))[_0x6ca5('0x2d')](handleError(_0x23bca2,null));};exports['show']=function(_0x4e6eda,_0x246ed0){var _0x2f1590={'raw':!![],'where':{'id':_0x4e6eda[_0x6ca5('0x57')]['id']}},_0x2bddc4={};_0x2bddc4[_0x6ca5('0x47')]=_[_0x6ca5('0x43')](db[_0x6ca5('0x3f')][_0x6ca5('0x58')]);_0x2bddc4[_0x6ca5('0x44')]=_[_0x6ca5('0x43')](_0x4e6eda['query']);_0x2bddc4[_0x6ca5('0x45')]=_['intersection'](_0x2bddc4[_0x6ca5('0x47')],_0x2bddc4[_0x6ca5('0x44')]);_0x2f1590['attributes']=_[_0x6ca5('0x46')](_0x2bddc4['model'],qs['fields'](_0x4e6eda[_0x6ca5('0x44')][_0x6ca5('0x49')]));_0x2f1590[_0x6ca5('0x48')]=_0x2f1590['attributes'][_0x6ca5('0x4a')]?_0x2f1590[_0x6ca5('0x48')]:_0x2bddc4['model'];if(_0x4e6eda[_0x6ca5('0x44')]['includeAll']){_0x2f1590[_0x6ca5('0x54')]=[{'all':!![]}];}_0x2f1590=_[_0x6ca5('0x50')]({},_0x2f1590,_0x4e6eda['options']);return db[_0x6ca5('0x3f')]['find'](_0x2f1590)[_0x6ca5('0x22')](handleEntityNotFound(_0x246ed0,null))[_0x6ca5('0x22')](respondWithResult(_0x246ed0,null))[_0x6ca5('0x2d')](handleError(_0x246ed0,null));};exports[_0x6ca5('0x59')]=function(_0x163132,_0x4d7f0c){return db['SmsMessage']['create'](_0x163132[_0x6ca5('0x5a')],{})['then'](respondWithResult(_0x4d7f0c,0xc9))[_0x6ca5('0x2d')](handleError(_0x4d7f0c,null));};exports[_0x6ca5('0x38')]=function(_0x37e8d1,_0x58fbad){if(_0x37e8d1[_0x6ca5('0x5a')]['id']){delete _0x37e8d1[_0x6ca5('0x5a')]['id'];}return db[_0x6ca5('0x3f')]['find']({'where':{'id':_0x37e8d1['params']['id']}})[_0x6ca5('0x22')](handleEntityNotFound(_0x58fbad,null))[_0x6ca5('0x22')](saveUpdates(_0x37e8d1[_0x6ca5('0x5a')],null))[_0x6ca5('0x22')](respondWithResult(_0x58fbad,null))[_0x6ca5('0x2d')](handleError(_0x58fbad,null));};exports[_0x6ca5('0x39')]=function(_0x265cf2,_0x3f5941){return db['SmsMessage']['find']({'where':{'id':_0x265cf2['params']['id']}})[_0x6ca5('0x22')](handleEntityNotFound(_0x3f5941,null))[_0x6ca5('0x22')](removeEntity(_0x3f5941,null))['catch'](handleError(_0x3f5941,null));};exports[_0x6ca5('0x5b')]=function(_0x1a4913,_0xe3793b){return db[_0x6ca5('0x3f')][_0x6ca5('0x5b')]()['then'](respondWithResult(_0xe3793b,null))[_0x6ca5('0x2d')](handleError(_0xe3793b,null));};var interaction_log=require(_0x6ca5('0x14'))(_0x6ca5('0x5c'));exports['accept']=function(_0xba6093,_0x1321c5,_0x26c110){var _0x351be1={'channel':_0x6ca5('0x5d')};if(_0xba6093['body']['id']){delete _0xba6093['body']['id'];}_0xba6093[_0x6ca5('0x5a')][_0x6ca5('0x5e')]=!![];_0xba6093[_0x6ca5('0x5a')]['readAt']=moment()[_0x6ca5('0x5f')](_0x6ca5('0x60'));_0xba6093[_0x6ca5('0x5a')]['UserId']=_0xba6093[_0x6ca5('0x5a')][_0x6ca5('0x61')]||_0xba6093[_0x6ca5('0x62')]['id'];return db['SmsMessage'][_0x6ca5('0x63')]({'where':{'id':_0xba6093[_0x6ca5('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x6ca5('0x64')],'as':'Contact'}]})[_0x6ca5('0x22')](handleEntityNotFound(_0x1321c5,null))[_0x6ca5('0x22')](saveUpdates(_0xba6093[_0x6ca5('0x5a')],null))[_0x6ca5('0x22')](function(_0x4f4c21){if(_0x4f4c21){_0x351be1['message']=_0x4f4c21[_0x6ca5('0x65')]({'plain':!![]});return db[_0x6ca5('0x66')][_0x6ca5('0x63')]({'where':{'id':_0x4f4c21[_0x6ca5('0x67')]}});}return null;})[_0x6ca5('0x22')](handleEntityNotFound(_0x1321c5,null))[_0x6ca5('0x22')](function(_0x39867b){if(_0x39867b){return _0x39867b[_0x6ca5('0x38')]({'UserId':_0xba6093['body']['UserId'],'read1stAt':_[_0x6ca5('0x68')](_0x39867b[_0x6ca5('0x69')])?moment()[_0x6ca5('0x5f')](_0x6ca5('0x60')):undefined});}return null;})['then'](function(_0x5c1c7b){if(_0x5c1c7b){_0x351be1[_0x6ca5('0x6a')]=_0x5c1c7b[_0x6ca5('0x65')]({'plain':!![]});interaction_log[_0x6ca5('0x2b')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xba6093['user']['id'],_0xba6093[_0x6ca5('0x62')][_0x6ca5('0x3c')],_0xba6093[_0x6ca5('0x62')][_0x6ca5('0x6b')],_0x351be1[_0x6ca5('0x6a')]['id'],_0xba6093[_0x6ca5('0x5a')]?JSON[_0x6ca5('0x27')](_0xba6093[_0x6ca5('0x5a')]):_0x6ca5('0x6c'));return respondWithRpcPromise(_0x6ca5('0x6d'),_0x6ca5('0x6e'),_0x351be1);}return null;})[_0x6ca5('0x22')](function(_0x266a01){if(_0x266a01){if(_0xba6093[_0x6ca5('0x5a')]['manual']){_0x351be1[_0x6ca5('0x2a')]['interface']=util[_0x6ca5('0x5f')](_0x6ca5('0x6f'),_0xba6093[_0x6ca5('0x62')][_0x6ca5('0x3c')]);_0x351be1['message']['channel']=_0x351be1[_0x6ca5('0x70')];_0x351be1[_0x6ca5('0x2a')][_0x6ca5('0x71')]=_0x6ca5('0x72');return respondWithRpcPromise(_0x6ca5('0x73'),'EventManager',{'event':_0x6ca5('0x74'),'message':_0x351be1[_0x6ca5('0x2a')]},client9002)[_0x6ca5('0x22')](function(){return _0x351be1;});}return _0x351be1;}return null;})[_0x6ca5('0x22')](respondWithResult(_0x1321c5,null))['catch'](handleError(_0x1321c5,null));};var interaction_log=require(_0x6ca5('0x14'))('sms-interactions');exports[_0x6ca5('0x36')]=function(_0x58d6ce,_0x34b960,_0x3a7997){var _0x3447a0={'agent':{},'channel':_0x6ca5('0x5d')};if(_0x58d6ce[_0x6ca5('0x5a')]['id']){delete _0x58d6ce[_0x6ca5('0x5a')]['id'];}_0x58d6ce[_0x6ca5('0x5a')]['UserId']=_0x58d6ce['body']['UserId']||_0x58d6ce['user']['id'];_0x3447a0[_0x6ca5('0x75')]['id']=_0x58d6ce[_0x6ca5('0x5a')][_0x6ca5('0x61')];return db[_0x6ca5('0x3f')][_0x6ca5('0x63')]({'where':{'id':_0x58d6ce[_0x6ca5('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34b960,null))[_0x6ca5('0x22')](function(_0x5d9fc5){if(_0x5d9fc5){_0x3447a0[_0x6ca5('0x2a')]=_0x5d9fc5[_0x6ca5('0x65')]({'plain':!![]});return db[_0x6ca5('0x66')][_0x6ca5('0x63')]({'where':{'id':_0x5d9fc5[_0x6ca5('0x67')]}});}return null;})[_0x6ca5('0x22')](handleEntityNotFound(_0x34b960,null))['then'](function(_0x31dd76){if(_0x31dd76){_0x3447a0['interaction']=_0x31dd76[_0x6ca5('0x65')]({'plain':!![]});interaction_log[_0x6ca5('0x2b')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58d6ce['user']['id'],_0x58d6ce[_0x6ca5('0x62')][_0x6ca5('0x3c')],_0x58d6ce[_0x6ca5('0x62')][_0x6ca5('0x6b')],_0x3447a0[_0x6ca5('0x6a')]['id'],_0x58d6ce['body']?JSON[_0x6ca5('0x27')](_0x58d6ce[_0x6ca5('0x5a')]):_0x6ca5('0x6c'));return respondWithRpcPromise(_0x6ca5('0x76'),_0x6ca5('0x77'),_0x3447a0);}return null;})['then'](function(_0x537848){if(_0x537848){_0x537848[_0x6ca5('0x2a')]['interface']=util[_0x6ca5('0x5f')](_0x6ca5('0x6f'),_0x58d6ce[_0x6ca5('0x62')][_0x6ca5('0x3c')]);_0x537848['message'][_0x6ca5('0x70')]=_0x3447a0[_0x6ca5('0x70')];_0x537848[_0x6ca5('0x2a')][_0x6ca5('0x71')]='reject';respondWithRpcPromise(_0x6ca5('0x73'),'EventManager',{'event':_0x6ca5('0x78'),'message':_0x537848[_0x6ca5('0x2a')]},client9002);return _0x3447a0;}return null;})[_0x6ca5('0x22')](respondWithResult(_0x34b960,null))['catch'](handleError(_0x34b960,null));};exports['status']=function(_0x166c25,_0x3e4722,_0x16a725){if(_0x166c25[_0x6ca5('0x5a')]['id']){delete _0x166c25[_0x6ca5('0x5a')]['id'];}var _0x572c0e;return db[_0x6ca5('0x3f')]['find']({'where':{'id':_0x166c25[_0x6ca5('0x57')]['id']}})['then'](handleEntityNotFound(_0x3e4722,null))[_0x6ca5('0x22')](function(_0x6faf17){if(_0x6faf17){_0x572c0e=_0x6faf17;return db[_0x6ca5('0x79')][_0x6ca5('0x63')]({'where':{'id':_0x6faf17[_0x6ca5('0x7a')]}});}})[_0x6ca5('0x22')](handleEntityNotFound(_0x3e4722,null))[_0x6ca5('0x22')](function(_0x20f649){if(_0x20f649){logger[_0x6ca5('0x25')](_0x6ca5('0x26'),'status',_0x6ca5('0x7b'),_0x20f649[_0x6ca5('0x41')],util[_0x6ca5('0x7c')](_0x166c25['body'],{'showHidden':![],'depth':null}));switch(_0x20f649[_0x6ca5('0x41')]){case'twilio':if(_0x166c25[_0x6ca5('0x5a')][_0x6ca5('0x7d')]&&_0x166c25[_0x6ca5('0x5a')][_0x6ca5('0x7d')]===_0x572c0e['messageId']){return _0x572c0e['update']({'read':!![]});}else{logger[_0x6ca5('0x28')](_0x6ca5('0x7e'),'status',_0x6ca5('0x7f'),util['inspect'](_0x166c25['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x166c25[_0x6ca5('0x5a')]['MessageUUID']&&_0x166c25['body'][_0x6ca5('0x80')]===_0x572c0e[_0x6ca5('0x81')]&&_[_0x6ca5('0x82')]([_0x6ca5('0x83'),_0x6ca5('0x84')],_0x166c25[_0x6ca5('0x5a')][_0x6ca5('0x85')])>=0x0){return _0x572c0e[_0x6ca5('0x38')]({'read':!![]});}else{logger[_0x6ca5('0x28')](_0x6ca5('0x7e'),_0x6ca5('0x2f'),_0x6ca5('0x86'),util[_0x6ca5('0x7c')](_0x166c25[_0x6ca5('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x6ca5('0x87'):var _0x44dcb4=_0x166c25[_0x6ca5('0x5a')][_0x6ca5('0x88')][0x0];if(_0x44dcb4[_0x6ca5('0x2f')][_0x6ca5('0x89')]===_0x6ca5('0x8a')){return _0x572c0e[_0x6ca5('0x38')]({'read':!![]});}else{logger[_0x6ca5('0x28')](_0x6ca5('0x7e'),'status',_0x6ca5('0x87'),util[_0x6ca5('0x7c')](_0x166c25[_0x6ca5('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x572c0e;}})[_0x6ca5('0x22')](respondWithResult(_0x3e4722,null))[_0x6ca5('0x2d')](handleError(_0x3e4722,null));}; \ No newline at end of file +var _0x823c=['filters','pick','filter','where','merge','options','includeAll','include','SmsMessage','catch','rawAttributes','find','create','body','params','describe','sms-interactions','sms','read','format','UserId','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','Status','infobip','results','groupName','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','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','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','destroy','stack','name','index','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','limit','order','sort'];(function(_0x183607,_0x2d55cc){var _0x49f416=function(_0x4c01c3){while(--_0x4c01c3){_0x183607['push'](_0x183607['shift']());}};_0x49f416(++_0x2d55cc);}(_0x823c,0x143));var _0xc823=function(_0x491a46,_0x2e0dcb){_0x491a46=_0x491a46-0x0;var _0x3a70bf=_0x823c[_0x491a46];return _0x3a70bf;};'use strict';var pdf=require(_0xc823('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc823('0x1'));var zipdir=require(_0xc823('0x2'));var jsonpatch=require(_0xc823('0x3'));var rp=require(_0xc823('0x4'));var moment=require(_0xc823('0x5'));var BPromise=require(_0xc823('0x6'));var Mustache=require('mustache');var util=require(_0xc823('0x7'));var path=require(_0xc823('0x8'));var sox=require(_0xc823('0x9'));var csv=require(_0xc823('0xa'));var ejs=require(_0xc823('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc823('0xc'));var crypto=require(_0xc823('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc823('0xa'));var querystring=require(_0xc823('0xe'));var Papa=require('papaparse');var Redis=require(_0xc823('0xf'));var authService=require(_0xc823('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc823('0x11'));var logger=require(_0xc823('0x12'))(_0xc823('0x13'));var utils=require(_0xc823('0x14'));var config=require(_0xc823('0x15'));var db=require('../../mysqldb')['db'];config[_0xc823('0x16')]=_[_0xc823('0x17')](config[_0xc823('0x16')],{'host':_0xc823('0x18'),'port':0x18eb});var socket=require(_0xc823('0x19'))(new Redis(config[_0xc823('0x16')]));require('./smsMessage.socket')[_0xc823('0x1a')](socket);var jayson=require(_0xc823('0x1b'));var client=jayson[_0xc823('0x1c')][_0xc823('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x59749d,_0x5bdfc9,_0x565aeb){if(_0x565aeb){var _0x5d3521=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d3521[_0xc823('0x1e')](_0x5bdfc9)){return _0x59749d;}else{throw new db[(_0xc823('0x1f'))][(_0xc823('0x20'))](_0xc823('0x21'));}}else{return _0x59749d;}}function respondWithRpcPromise(_0x4417ee,_0x1aca6d,_0xfedc1d,_0x58b7c7){return new BPromise(function(_0x42843e,_0x4a713a){var _0xf52707=_0x58b7c7||client;return _0xf52707[_0xc823('0x22')](_0x4417ee,_0xfedc1d)[_0xc823('0x23')](function(_0x4fa275){logger[_0xc823('0x24')](_0xc823('0x25'),_0x1aca6d,_0xc823('0x26'));logger['debug'](_0xc823('0x27'),_0x1aca6d,_0xc823('0x26'),JSON[_0xc823('0x28')](_0x4fa275));if(_0x4fa275[_0xc823('0x29')]){if(_0x4fa275[_0xc823('0x29')][_0xc823('0x2a')]===0x1f4){logger['error'](_0xc823('0x25'),_0x1aca6d,_0x4fa275['error']['message']);return _0x4a713a(_0x4fa275[_0xc823('0x29')][_0xc823('0x2b')]);}logger['error'](_0xc823('0x25'),_0x1aca6d,_0x4fa275[_0xc823('0x29')][_0xc823('0x2b')]);return _0x42843e(_0x4fa275[_0xc823('0x29')][_0xc823('0x2b')]);}else{logger[_0xc823('0x24')](_0xc823('0x25'),_0x1aca6d,_0xc823('0x26'));_0x42843e(_0x4fa275[_0xc823('0x2c')][_0xc823('0x2b')]);}})['catch'](function(_0x3f175d){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1aca6d,_0x3f175d);_0x4a713a(_0x3f175d);});});}function respondWithStatusCode(_0x15ac97,_0x21265a){_0x21265a=_0x21265a||0xcc;return function(_0x1c79dd){if(_0x1c79dd){return _0x15ac97[_0xc823('0x2d')](_0x21265a);}return _0x15ac97[_0xc823('0x2e')](_0x21265a)[_0xc823('0x2f')]();};}function respondWithResult(_0x1d20c6,_0xa5a380){_0xa5a380=_0xa5a380||0xc8;return function(_0x12f061){if(_0x12f061){return _0x1d20c6[_0xc823('0x2e')](_0xa5a380)[_0xc823('0x30')](_0x12f061);}};}function respondWithFilteredResult(_0x368d70,_0x352b61){return function(_0xda39a3){if(_0xda39a3){var _0x1c839f=_0xda39a3[_0xc823('0x31')],_0x52bd31=_0x352b61[_0xc823('0x32')],_0x1b492a=_0x352b61[_0xc823('0x32')]+_0x352b61['limit'],_0x34af84;if(_0x1b492a>=_0x1c839f){_0x1b492a=_0x1c839f;_0x34af84=0xc8;}else{_0x34af84=0xce;}_0x368d70['status'](_0x34af84);return _0x368d70['set'](_0xc823('0x33'),_0x52bd31+'-'+_0x1b492a+'/'+_0x1c839f)[_0xc823('0x30')](_0xda39a3);}return null;};}function patchUpdates(_0x20b4e7){return function(_0x2628be){try{jsonpatch['apply'](_0x2628be,_0x20b4e7,!![]);}catch(_0xc128c7){return BPromise[_0xc823('0x34')](_0xc128c7);}return _0x2628be[_0xc823('0x35')]();};}function saveUpdates(_0xd68524,_0x40fd2a){return function(_0x22601a){if(_0x22601a){return _0x22601a[_0xc823('0x36')](_0xd68524)[_0xc823('0x23')](function(_0xf69aea){return _0xf69aea;});}return null;};}function removeEntity(_0x1562fa,_0x40a11a){return function(_0x9fd3a2){if(_0x9fd3a2){return _0x9fd3a2[_0xc823('0x37')]()['then'](function(){_0x1562fa[_0xc823('0x2e')](0xcc)[_0xc823('0x2f')]();});}};}function handleEntityNotFound(_0x43e2ca,_0x1c4fb9){return function(_0x2b7273){if(!_0x2b7273){_0x43e2ca[_0xc823('0x2d')](0x194);}return _0x2b7273;};}function handleError(_0x48f688,_0xc1ba90){_0xc1ba90=_0xc1ba90||0x1f4;return function(_0x9972c0){logger['error'](_0x9972c0[_0xc823('0x38')]);if(_0x9972c0['name']){delete _0x9972c0[_0xc823('0x39')];}_0x48f688[_0xc823('0x2e')](_0xc1ba90)['send'](_0x9972c0);};}exports[_0xc823('0x3a')]=function(_0x27bb6c,_0x37aaf4){var _0x22eae8={},_0x3a2977={},_0x2c68fb={'count':0x0,'rows':[]};var _0x1fb5a4=_['map'](db['SmsMessage']['rawAttributes'],function(_0x1f7d4d){return{'name':_0x1f7d4d[_0xc823('0x3b')],'type':_0x1f7d4d[_0xc823('0x3c')][_0xc823('0x3d')]};});_0x3a2977[_0xc823('0x3e')]=_['map'](_0x1fb5a4,_0xc823('0x39'));_0x3a2977[_0xc823('0x3f')]=_[_0xc823('0x40')](_0x27bb6c[_0xc823('0x3f')]);_0x3a2977['filters']=_['intersection'](_0x3a2977['model'],_0x3a2977[_0xc823('0x3f')]);_0x22eae8[_0xc823('0x41')]=_[_0xc823('0x42')](_0x3a2977['model'],qs[_0xc823('0x43')](_0x27bb6c['query'][_0xc823('0x43')]));_0x22eae8[_0xc823('0x41')]=_0x22eae8[_0xc823('0x41')][_0xc823('0x44')]?_0x22eae8[_0xc823('0x41')]:_0x3a2977[_0xc823('0x3e')];if(!_0x27bb6c[_0xc823('0x3f')]['hasOwnProperty'](_0xc823('0x45'))){_0x22eae8['limit']=qs[_0xc823('0x46')](_0x27bb6c[_0xc823('0x3f')][_0xc823('0x46')]);_0x22eae8[_0xc823('0x32')]=qs[_0xc823('0x32')](_0x27bb6c[_0xc823('0x3f')][_0xc823('0x32')]);}_0x22eae8[_0xc823('0x47')]=qs['sort'](_0x27bb6c[_0xc823('0x3f')][_0xc823('0x48')]);_0x22eae8['where']=qs[_0xc823('0x49')](_[_0xc823('0x4a')](_0x27bb6c[_0xc823('0x3f')],_0x3a2977[_0xc823('0x49')]),_0x1fb5a4);if(_0x27bb6c[_0xc823('0x3f')][_0xc823('0x4b')]){_0x22eae8[_0xc823('0x4c')]=_[_0xc823('0x4d')](_0x22eae8[_0xc823('0x4c')],{'$or':_['map'](_0x1fb5a4,function(_0x153ca1){if(_0x153ca1[_0xc823('0x3c')]!=='VIRTUAL'){var _0x36a734={};_0x36a734[_0x153ca1[_0xc823('0x39')]]={'$like':'%'+_0x27bb6c['query'][_0xc823('0x4b')]+'%'};return _0x36a734;}})});}_0x22eae8=_['merge']({},_0x22eae8,_0x27bb6c[_0xc823('0x4e')]);var _0x2d80f3={'where':_0x22eae8['where']};return db['SmsMessage'][_0xc823('0x31')](_0x2d80f3)[_0xc823('0x23')](function(_0x3b10a0){_0x2c68fb[_0xc823('0x31')]=_0x3b10a0;if(_0x27bb6c[_0xc823('0x3f')][_0xc823('0x4f')]){_0x22eae8[_0xc823('0x50')]=[{'all':!![]}];}return db[_0xc823('0x51')]['findAll'](_0x22eae8);})[_0xc823('0x23')](function(_0x26b20a){_0x2c68fb['rows']=_0x26b20a;return _0x2c68fb;})['then'](respondWithFilteredResult(_0x37aaf4,_0x22eae8))[_0xc823('0x52')](handleError(_0x37aaf4,null));};exports['show']=function(_0x491928,_0x5c3217){var _0x4e1046={'raw':!![],'where':{'id':_0x491928['params']['id']}},_0x4c00f8={};_0x4c00f8[_0xc823('0x3e')]=_['keys'](db['SmsMessage'][_0xc823('0x53')]);_0x4c00f8['query']=_[_0xc823('0x40')](_0x491928[_0xc823('0x3f')]);_0x4c00f8['filters']=_[_0xc823('0x42')](_0x4c00f8[_0xc823('0x3e')],_0x4c00f8[_0xc823('0x3f')]);_0x4e1046['attributes']=_['intersection'](_0x4c00f8[_0xc823('0x3e')],qs[_0xc823('0x43')](_0x491928['query'][_0xc823('0x43')]));_0x4e1046[_0xc823('0x41')]=_0x4e1046[_0xc823('0x41')]['length']?_0x4e1046[_0xc823('0x41')]:_0x4c00f8[_0xc823('0x3e')];if(_0x491928[_0xc823('0x3f')][_0xc823('0x4f')]){_0x4e1046[_0xc823('0x50')]=[{'all':!![]}];}_0x4e1046=_[_0xc823('0x4d')]({},_0x4e1046,_0x491928[_0xc823('0x4e')]);return db['SmsMessage'][_0xc823('0x54')](_0x4e1046)[_0xc823('0x23')](handleEntityNotFound(_0x5c3217,null))[_0xc823('0x23')](respondWithResult(_0x5c3217,null))[_0xc823('0x52')](handleError(_0x5c3217,null));};exports[_0xc823('0x55')]=function(_0x31ba31,_0x37d7b4){return db['SmsMessage'][_0xc823('0x55')](_0x31ba31[_0xc823('0x56')],{})[_0xc823('0x23')](respondWithResult(_0x37d7b4,0xc9))[_0xc823('0x52')](handleError(_0x37d7b4,null));};exports[_0xc823('0x36')]=function(_0x2d20fc,_0x52adbb){if(_0x2d20fc[_0xc823('0x56')]['id']){delete _0x2d20fc['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x2d20fc[_0xc823('0x57')]['id']}})['then'](handleEntityNotFound(_0x52adbb,null))[_0xc823('0x23')](saveUpdates(_0x2d20fc['body'],null))[_0xc823('0x23')](respondWithResult(_0x52adbb,null))[_0xc823('0x52')](handleError(_0x52adbb,null));};exports['destroy']=function(_0x2ae99e,_0x5592fa){return db['SmsMessage'][_0xc823('0x54')]({'where':{'id':_0x2ae99e['params']['id']}})[_0xc823('0x23')](handleEntityNotFound(_0x5592fa,null))['then'](removeEntity(_0x5592fa,null))[_0xc823('0x52')](handleError(_0x5592fa,null));};exports[_0xc823('0x58')]=function(_0x4b40e5,_0x41ae1a){return db[_0xc823('0x51')][_0xc823('0x58')]()[_0xc823('0x23')](respondWithResult(_0x41ae1a,null))['catch'](handleError(_0x41ae1a,null));};var interaction_log=require('../../config/logger')(_0xc823('0x59'));exports['accept']=function(_0x2240de,_0x2befd0,_0x1823f2){var _0x204c69={'channel':_0xc823('0x5a')};if(_0x2240de['body']['id']){delete _0x2240de[_0xc823('0x56')]['id'];}_0x2240de['body'][_0xc823('0x5b')]=!![];_0x2240de[_0xc823('0x56')]['readAt']=moment()[_0xc823('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2240de[_0xc823('0x56')][_0xc823('0x5d')]=_0x2240de[_0xc823('0x56')][_0xc823('0x5d')]||_0x2240de['user']['id'];return db['SmsMessage']['find']({'where':{'id':_0x2240de['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xc823('0x5e')}]})[_0xc823('0x23')](handleEntityNotFound(_0x2befd0,null))['then'](saveUpdates(_0x2240de['body'],null))[_0xc823('0x23')](function(_0x13ff51){if(_0x13ff51){_0x204c69[_0xc823('0x2b')]=_0x13ff51[_0xc823('0x5f')]({'plain':!![]});return db[_0xc823('0x60')][_0xc823('0x54')]({'where':{'id':_0x13ff51[_0xc823('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x2befd0,null))[_0xc823('0x23')](function(_0x371707){if(_0x371707){return _0x371707[_0xc823('0x36')]({'UserId':_0x2240de['body']['UserId'],'read1stAt':_['isNil'](_0x371707[_0xc823('0x62')])?moment()[_0xc823('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc823('0x23')](function(_0x41be34){if(_0x41be34){_0x204c69[_0xc823('0x63')]=_0x41be34[_0xc823('0x5f')]({'plain':!![]});interaction_log['info'](_0xc823('0x64'),_0x2240de[_0xc823('0x65')]['id'],_0x2240de[_0xc823('0x65')]['name'],_0x2240de[_0xc823('0x65')][_0xc823('0x66')],_0x204c69['interaction']['id'],_0x2240de[_0xc823('0x56')]?JSON[_0xc823('0x28')](_0x2240de['body']):'null');return respondWithRpcPromise('AcceptMessage',_0xc823('0x67'),_0x204c69);}return null;})[_0xc823('0x23')](function(_0x5dbe17){if(_0x5dbe17){if(_0x2240de[_0xc823('0x56')][_0xc823('0x68')]){_0x204c69[_0xc823('0x2b')][_0xc823('0x69')]=util[_0xc823('0x5c')](_0xc823('0x6a'),_0x2240de['user'][_0xc823('0x39')]);_0x204c69['message']['channel']=_0x204c69[_0xc823('0x6b')];_0x204c69['message'][_0xc823('0x6c')]=_0xc823('0x6d');return respondWithRpcPromise(_0xc823('0x6e'),_0xc823('0x6e'),{'event':_0xc823('0x6f'),'message':_0x204c69[_0xc823('0x2b')]},client9002)[_0xc823('0x23')](function(){return _0x204c69;});}return _0x204c69;}return null;})['then'](respondWithResult(_0x2befd0,null))[_0xc823('0x52')](handleError(_0x2befd0,null));};var interaction_log=require(_0xc823('0x12'))(_0xc823('0x59'));exports[_0xc823('0x34')]=function(_0x1f0ce3,_0x514138,_0x239a2d){var _0x1e9439={'agent':{},'channel':_0xc823('0x5a')};if(_0x1f0ce3[_0xc823('0x56')]['id']){delete _0x1f0ce3[_0xc823('0x56')]['id'];}_0x1f0ce3['body'][_0xc823('0x5d')]=_0x1f0ce3[_0xc823('0x56')][_0xc823('0x5d')]||_0x1f0ce3[_0xc823('0x65')]['id'];_0x1e9439['agent']['id']=_0x1f0ce3[_0xc823('0x56')][_0xc823('0x5d')];return db[_0xc823('0x51')][_0xc823('0x54')]({'where':{'id':_0x1f0ce3[_0xc823('0x57')]['id'],'UserId':null}})[_0xc823('0x23')](handleEntityNotFound(_0x514138,null))['then'](function(_0x2d2dc2){if(_0x2d2dc2){_0x1e9439['message']=_0x2d2dc2[_0xc823('0x5f')]({'plain':!![]});return db[_0xc823('0x60')][_0xc823('0x54')]({'where':{'id':_0x2d2dc2['SmsInteractionId']}});}return null;})[_0xc823('0x23')](handleEntityNotFound(_0x514138,null))[_0xc823('0x23')](function(_0x27d4b9){if(_0x27d4b9){_0x1e9439[_0xc823('0x63')]=_0x27d4b9[_0xc823('0x5f')]({'plain':!![]});interaction_log[_0xc823('0x24')](_0xc823('0x70'),_0x1f0ce3['user']['id'],_0x1f0ce3[_0xc823('0x65')][_0xc823('0x39')],_0x1f0ce3[_0xc823('0x65')][_0xc823('0x66')],_0x1e9439[_0xc823('0x63')]['id'],_0x1f0ce3[_0xc823('0x56')]?JSON[_0xc823('0x28')](_0x1f0ce3[_0xc823('0x56')]):_0xc823('0x71'));return respondWithRpcPromise(_0xc823('0x72'),_0xc823('0x73'),_0x1e9439);}return null;})[_0xc823('0x23')](function(_0x2091ab){if(_0x2091ab){_0x2091ab[_0xc823('0x2b')][_0xc823('0x69')]=util[_0xc823('0x5c')](_0xc823('0x6a'),_0x1f0ce3[_0xc823('0x65')][_0xc823('0x39')]);_0x2091ab[_0xc823('0x2b')]['channel']=_0x1e9439[_0xc823('0x6b')];_0x2091ab[_0xc823('0x2b')][_0xc823('0x6c')]=_0xc823('0x34');respondWithRpcPromise(_0xc823('0x6e'),_0xc823('0x6e'),{'event':'rejectmessage','message':_0x2091ab[_0xc823('0x2b')]},client9002);return _0x1e9439;}return null;})[_0xc823('0x23')](respondWithResult(_0x514138,null))[_0xc823('0x52')](handleError(_0x514138,null));};exports[_0xc823('0x2e')]=function(_0x2d250d,_0x397a29,_0x3dcd52){if(_0x2d250d['body']['id']){delete _0x2d250d[_0xc823('0x56')]['id'];}var _0x21438d;return db[_0xc823('0x51')][_0xc823('0x54')]({'where':{'id':_0x2d250d[_0xc823('0x57')]['id']}})[_0xc823('0x23')](handleEntityNotFound(_0x397a29,null))['then'](function(_0x222449){if(_0x222449){_0x21438d=_0x222449;return db[_0xc823('0x74')][_0xc823('0x54')]({'where':{'id':_0x222449[_0xc823('0x75')]}});}})[_0xc823('0x23')](handleEntityNotFound(_0x397a29,null))[_0xc823('0x23')](function(_0x2602e5){if(_0x2602e5){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0xc823('0x76'),_0x2602e5['type'],util[_0xc823('0x77')](_0x2d250d[_0xc823('0x56')],{'showHidden':![],'depth':null}));switch(_0x2602e5[_0xc823('0x3c')]){case _0xc823('0x78'):if(_0x2d250d['body'][_0xc823('0x79')]&&_0x2d250d[_0xc823('0x56')][_0xc823('0x79')]===_0x21438d[_0xc823('0x7a')]){return _0x21438d['update']({'read':!![]});}else{logger[_0xc823('0x29')](_0xc823('0x7b'),'status',_0xc823('0x78'),util['inspect'](_0x2d250d[_0xc823('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2d250d[_0xc823('0x56')][_0xc823('0x7c')]&&_0x2d250d[_0xc823('0x56')]['MessageUUID']===_0x21438d[_0xc823('0x7a')]&&_['indexOf']([_0xc823('0x7d'),_0xc823('0x7e')],_0x2d250d[_0xc823('0x56')][_0xc823('0x7f')])>=0x0){return _0x21438d[_0xc823('0x36')]({'read':!![]});}else{logger[_0xc823('0x29')](_0xc823('0x7b'),_0xc823('0x2e'),'plivio',util[_0xc823('0x77')](_0x2d250d[_0xc823('0x56')],{'showHidden':![],'depth':null}));}break;case _0xc823('0x80'):var _0x1ec68a=_0x2d250d[_0xc823('0x56')][_0xc823('0x81')][0x0];if(_0x1ec68a[_0xc823('0x2e')][_0xc823('0x82')]===_0xc823('0x83')){return _0x21438d[_0xc823('0x36')]({'read':!![]});}else{logger[_0xc823('0x29')](_0xc823('0x7b'),_0xc823('0x2e'),'infobip',util[_0xc823('0x77')](_0x2d250d[_0xc823('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x21438d;}})[_0xc823('0x23')](respondWithResult(_0x397a29,null))[_0xc823('0x52')](handleError(_0x397a29,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index dd82670..e295603 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 _0x3dc4=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsMessage'];(function(_0x2e878c,_0x4d6f8a){var _0x4f96ff=function(_0x2fdb28){while(--_0x2fdb28){_0x2e878c['push'](_0x2e878c['shift']());}};_0x4f96ff(++_0x4d6f8a);}(_0x3dc4,0x76));var _0x43dc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3dc4[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x43dc('0x0'))['db'][_0x43dc('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x43dc('0x2')](0x0);var events={'afterCreate':_0x43dc('0x3'),'afterUpdate':_0x43dc('0x4'),'afterDestroy':_0x43dc('0x5')};function emitEvent(_0x1b4f47){return function(_0x2b0b60,_0xd49543,_0x268030){SmsMessageEvents['emit'](_0x1b4f47+':'+_0x2b0b60['id'],_0x2b0b60);SmsMessageEvents[_0x43dc('0x6')](_0x1b4f47,_0x2b0b60);_0x268030(null);};}for(var e in events){if(events[_0x43dc('0x7')](e)){var event=events[e];SmsMessage[_0x43dc('0x8')](e,emitEvent(event));}}module[_0x43dc('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x72e1=['remove','emit','hasOwnProperty','hook','exports','SmsMessage','setMaxListeners','save','update'];(function(_0x5ea797,_0x2d39dd){var _0x500783=function(_0x4923f2){while(--_0x4923f2){_0x5ea797['push'](_0x5ea797['shift']());}};_0x500783(++_0x2d39dd);}(_0x72e1,0x8c));var _0x172e=function(_0x307fe6,_0x221515){_0x307fe6=_0x307fe6-0x0;var _0x149d27=_0x72e1[_0x307fe6];return _0x149d27;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x172e('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x172e('0x1')](0x0);var events={'afterCreate':_0x172e('0x2'),'afterUpdate':_0x172e('0x3'),'afterDestroy':_0x172e('0x4')};function emitEvent(_0x48bb0c){return function(_0x43ccc0,_0x50b35b,_0x61aa84){SmsMessageEvents['emit'](_0x48bb0c+':'+_0x43ccc0['id'],_0x43ccc0);SmsMessageEvents[_0x172e('0x5')](_0x48bb0c,_0x43ccc0);_0x61aa84(null);};}for(var e in events){if(events[_0x172e('0x6')](e)){var event=events[e];SmsMessage[_0x172e('0x7')](e,emitEvent(event));}}module[_0x172e('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index a34130c..5e8078a 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 _0x4aaf=['bluebird','path','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','secret','isNil','UserId','SmsInteraction','findOne','then','update','createdAt','catch','find','type','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','body','smsMethod','sender','login?username=','&password=','split','sms','session_key','total_sent','internal_order_id','deliveryReport','skebby','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','read','connectel','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','sort','length','createHash','md5','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x4aaf,0x1d0));var _0xf4aa=function(_0x323d3a,_0x325482){_0x323d3a=_0x323d3a-0x0;var _0x24847a=_0x4aaf[_0x323d3a];return _0x24847a;};'use strict';var _=require(_0xf4aa('0x0'));var util=require(_0xf4aa('0x1'));var logger=require('../../config/logger')(_0xf4aa('0x2'));var moment=require(_0xf4aa('0x3'));var BPromise=require(_0xf4aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xf4aa('0x6')]=function(_0x3c3590,_0x57618d){return _0x3c3590[_0xf4aa('0x7')](_0xf4aa('0x8'),attributes,{'tableName':_0xf4aa('0x9'),'paranoid':![],'indexes':[{'name':_0xf4aa('0xa'),'fields':[_0xf4aa('0xa')]},{'name':_0xf4aa('0xb'),'fields':['body'],'type':_0xf4aa('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1061c0,_0x46a242,_0x3a926f){var _0x26ff51=_0x3c3590['models'];var _0x4ae625=_0x1061c0[_0xf4aa('0xd')]({'plain':!![]});if(_0x4ae625[_0xf4aa('0xe')]['toLowerCase']()==='in'||_0x4ae625[_0xf4aa('0xe')]['toLowerCase']()==='out'&&!_0x4ae625[_0xf4aa('0xf')]&&!_[_0xf4aa('0x10')](_0x4ae625[_0xf4aa('0x11')])){_0x26ff51[_0xf4aa('0x12')][_0xf4aa('0x13')]({'where':{'id':_0x4ae625['SmsInteractionId']}})[_0xf4aa('0x14')](function(_0x370f96){if(_0x370f96){_0x370f96[_0xf4aa('0x15')]({'lastMsgAt':_0x4ae625[_0xf4aa('0x16')],'lastMsgDirection':_0x4ae625['direction']['toLowerCase']()});}})[_0xf4aa('0x17')](function(_0x1f88c1){console['error'](_0x1f88c1);});}if(_0x4ae625['direction']==='out'&&!_0x4ae625[_0xf4aa('0xf')]){var _0x260525;_0x26ff51['SmsAccount'][_0xf4aa('0x18')]({'where':{'id':_0x4ae625['SmsAccountId']},'raw':!![]})[_0xf4aa('0x14')](function(_0x14584e){_0x260525=_0x14584e;if(_0x260525&&_0x260525[_0xf4aa('0x19')]){switch(_0x260525[_0xf4aa('0x19')]){case'twilio':var _0x1293eb=require('twilio');if(_0x260525['accountSid']&&_0x260525[_0xf4aa('0x1a')]&&_0x260525[_0xf4aa('0x1b')]){var _0x2429b2=new _0x1293eb(_0x260525['accountSid'],_0x260525['authToken']);_0x2429b2[_0xf4aa('0x1c')]['create']({'body':_0x4ae625['body'],'to':_0x4ae625[_0xf4aa('0x1b')],'from':_0x260525['phone'],'statusCallback':_0x260525[_0xf4aa('0x1d')]+_0xf4aa('0x1e')+_0x4ae625['id']+_0xf4aa('0x1f')+_0x260525[_0xf4aa('0x20')]})[_0xf4aa('0x14')](function(_0x4fee08){if(_0x4fee08['sid']){return _0x1061c0[_0xf4aa('0x15')]({'messageId':_0x4fee08[_0xf4aa('0x21')]});}})[_0xf4aa('0x17')](function(_0x2b203c){logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x25'),util[_0xf4aa('0x26')](_0x2b203c,{'showHidden':![],'depth':null}));});}else{logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x25'),_0xf4aa('0x27'));}break;case'skebby':var _0x87a039=_0xf4aa('0x28');if(_0x260525[_0xf4aa('0x29')]&&_0x260525['password']){var _0x448296={'recipient':[_0x4ae625[_0xf4aa('0x1b')]],'message':_0x4ae625[_0xf4aa('0x2a')],'message_type':_0x260525[_0xf4aa('0x2b')]};if(_0x260525[_0xf4aa('0x2b')]&&_0x260525['smsMethod']!=='SI'){_0x448296[_0xf4aa('0x2c')]=_0x260525['phone'];}var _0x3e7133={'url':_0x87a039+_0xf4aa('0x2d')+_0x260525[_0xf4aa('0x29')]+_0xf4aa('0x2e')+_0x260525['password'],'method':'GET'};rp(_0x3e7133)[_0xf4aa('0x14')](function(_0xc3f60b){var _0x9d1d17=_0xc3f60b[_0xf4aa('0x2f')](';');var _0x53be68={'user_key':_0x9d1d17[0x0],'session_key':_0x9d1d17[0x1]};_0x3e7133={'url':_0x87a039+_0xf4aa('0x30'),'method':'POST','headers':{'user_key':_0x53be68['user_key'],'Session_key':_0x53be68[_0xf4aa('0x31')]},'json':!![],'body':_0x448296};return rp(_0x3e7133);})[_0xf4aa('0x14')](function(_0x13724b){if(_0x13724b[_0xf4aa('0x32')]>=0x1){var _0x3b0b43={'messageId':_0x13724b[_0xf4aa('0x33')]};if(_0x260525[_0xf4aa('0x2b')]!=='GP'||!_0x260525[_0xf4aa('0x34')]){_0x3b0b43['read']=!![];}return _0x1061c0['update'](_0x3b0b43);}else{return logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x35'),util[_0xf4aa('0x26')](_0x13724b,{'showHidden':![],'depth':null}));}})[_0xf4aa('0x17')](function(_0x4da375){return logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),_0xf4aa('0x35'),util['inspect'](_0x4da375,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf4aa('0x23'),'afterCreate',_0xf4aa('0x35'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x260525[_0xf4aa('0x1a')]){var _0x574aad={'recipient':_0x4ae625['phone'],'message':_0x4ae625[_0xf4aa('0x2a')],'sender':_0x260525[_0xf4aa('0x36')]||_0x260525[_0xf4aa('0x1b')],'authorization':_0x260525['authToken']};var _0x46a242={'method':_0xf4aa('0x37'),'uri':_0xf4aa('0x38'),'body':_0x574aad,'json':!![]};rp(_0x46a242)[_0xf4aa('0x14')](function(_0x4fb5c2){var _0x3b8536={'messageId':_0x4fb5c2[_0xf4aa('0x39')]};if(!_0x260525[_0xf4aa('0x34')]){_0x3b8536[_0xf4aa('0x3a')]=!![];}return _0x1061c0[_0xf4aa('0x15')](_0x3b8536);})[_0xf4aa('0x17')](function(_0x44072c){logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),'connectel',util[_0xf4aa('0x26')](_0x44072c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x3b'),_0xf4aa('0x3c'));}break;case _0xf4aa('0x3d'):if(_0x260525[_0xf4aa('0x29')]&&_0x260525[_0xf4aa('0x3e')]){var _0x574aad={'messages':[{'source':_0xf4aa('0x3f'),'to':_0x4ae625[_0xf4aa('0x1b')],'body':_0x4ae625[_0xf4aa('0x2a')],'from':_0x260525[_0xf4aa('0x36')]||_0x260525['phone']}]};var _0x2ea8fc=util[_0xf4aa('0x40')](_0xf4aa('0x41'),_0x260525[_0xf4aa('0x29')],_0x260525[_0xf4aa('0x3e')]);var _0x46a242={'method':_0xf4aa('0x37'),'uri':_0xf4aa('0x42'),'body':_0x574aad,'headers':{'Authorization':util[_0xf4aa('0x40')]('Basic\x20%s',new Buffer(_0x2ea8fc)[_0xf4aa('0x43')]('base64'))},'json':!![]};rp(_0x46a242)['then'](function(_0x3238f7){if(_0x3238f7['http_code']>=0xc8&&_0x3238f7[_0xf4aa('0x44')]<=0xce){if(_0x3238f7[_0xf4aa('0x45')]&&_0x3238f7[_0xf4aa('0x45')][_0xf4aa('0x46')]>0x0){var _0x11d545=_[_0xf4aa('0x47')](_0x3238f7[_0xf4aa('0x45')][_0xf4aa('0x1c')]);var _0x4ad546={'messageId':_0x11d545['message_id']};if(!_0x260525[_0xf4aa('0x34')]){_0x4ad546['read']=!![];}return _0x1061c0['update'](_0x4ad546);}else{logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),'clickSend',util[_0xf4aa('0x26')](_0x3238f7,{'showHidden':![],'depth':null}));}}else{logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),_0xf4aa('0x48'),util[_0xf4aa('0x26')](_0x3238f7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x17cea8){logger['error'](_0xf4aa('0x23'),'afterCreate',_0xf4aa('0x48'),util['inspect'](_0x17cea8,{'showHidden':![],'depth':null}));});}else{logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x48'),_0xf4aa('0x49'));}break;case _0xf4aa('0x4a'):if(_0x260525[_0xf4aa('0x4b')]&&_0x260525[_0xf4aa('0x1a')]){var _0x574aad={'dst':_0x4ae625[_0xf4aa('0x1b')],'text':_0x4ae625[_0xf4aa('0x2a')],'src':_0x260525[_0xf4aa('0x36')]||_0x260525[_0xf4aa('0x1b')],'url':_0x260525[_0xf4aa('0x1d')]+'/api/sms/messages/'+_0x4ae625['id']+_0xf4aa('0x1f')+_0x260525[_0xf4aa('0x20')]};var _0x2ea8fc=util[_0xf4aa('0x40')]('%s:%s',_0x260525[_0xf4aa('0x4b')],_0x260525[_0xf4aa('0x1a')]);var _0x46a242={'method':_0xf4aa('0x37'),'uri':util[_0xf4aa('0x40')](_0xf4aa('0x4c'),_0x260525[_0xf4aa('0x4b')]),'body':_0x574aad,'headers':{'Authorization':util['format'](_0xf4aa('0x4d'),new Buffer(_0x2ea8fc)['toString'](_0xf4aa('0x4e')))},'json':!![]};rp(_0x46a242)['then'](function(_0x35c859){var _0x3288bd={'messageId':_0x35c859[_0xf4aa('0x4f')][0x0]};return _0x1061c0['update'](_0x3288bd);})[_0xf4aa('0x17')](function(_0x1ca5ef){logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x4a'),util[_0xf4aa('0x26')](_0x1ca5ef,{'showHidden':![],'depth':null}));});}else{logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),_0xf4aa('0x4a'),_0xf4aa('0x50'));}break;case _0xf4aa('0x51'):if(_0x260525[_0xf4aa('0x29')]&&_0x260525[_0xf4aa('0x3e')]){if(_0x260525['baseUrl']){var _0x3e807f={'method':_0xf4aa('0x37'),'uri':_0x260525[_0xf4aa('0x52')]+'/auth/1/session','body':{'username':_0x260525[_0xf4aa('0x29')],'password':_0x260525['password']},'json':!![]};return rp(_0x3e807f)['then'](function(_0x7cb9e8){var _0x3e7190={'method':_0xf4aa('0x37'),'uri':_0x260525[_0xf4aa('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x260525[_0xf4aa('0x1b')],'destinations':[{'to':_0x4ae625['phone']}],'text':_0x4ae625['body'],'notifyUrl':_0x260525[_0xf4aa('0x1d')]+_0xf4aa('0x1e')+_0x4ae625['id']+_0xf4aa('0x1f')+_0x260525[_0xf4aa('0x20')],'notifyContentType':_0xf4aa('0x53'),'callbackData':_0x260525['phone']+';'+_0x4ae625[_0xf4aa('0x2a')]}]},'headers':{'Authorization':_0xf4aa('0x54')+_0x7cb9e8[_0xf4aa('0x20')]},'json':!![]};return rp(_0x3e7190)['then'](function(_0x10bfcc){if(_0x10bfcc[_0xf4aa('0x1c')]){var _0x17ac3d={'messageId':_0x10bfcc['messages'][0x0][_0xf4aa('0xa')]};if(!_0x260525['deliveryReport']){_0x17ac3d['read']=!![];}return _0x1061c0['update'](_0x17ac3d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf4aa('0x51'),util[_0xf4aa('0x26')](_0x10bfcc,{'showHidden':![],'depth':null}));}});})[_0xf4aa('0x17')](function(_0x174b26){return logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),_0xf4aa('0x51'),util['inspect'](_0x174b26,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x51'),_0xf4aa('0x55'));}}else{logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x51'),_0xf4aa('0x49'));}break;case _0xf4aa('0x56'):var _0x1ae670=require('crypto');if(_0x260525[_0xf4aa('0x57')]){var _0x45fdec={};_0x45fdec[_0xf4aa('0x58')]=_0x260525[_0xf4aa('0x29')];_0x45fdec[_0xf4aa('0x1b')]=_0x4ae625[_0xf4aa('0x1b')];_0x45fdec['sender']=_0x260525['phone'];_0x45fdec[_0xf4aa('0x59')]=_0x4ae625['body'];_0x45fdec[_0xf4aa('0x5a')]=+new Date();var _0x30d1ab='';var _0x5144ff='';var _0x186f1c=Object['keys'](_0x45fdec);_0x186f1c[_0xf4aa('0x5b')]();for(var _0x235444=0x0;_0x235444<_0x186f1c[_0xf4aa('0x5c')];_0x235444++){if(_0x30d1ab!=''){_0x30d1ab+='&';}_0x30d1ab+=_0x186f1c[_0x235444]+'='+encodeURIComponent(_0x45fdec[_0x186f1c[_0x235444]]);_0x5144ff+=_0x45fdec[_0x186f1c[_0x235444]];}_0x5144ff+=_0x260525[_0xf4aa('0x57')];_0x5144ff=_0x1ae670[_0xf4aa('0x5d')](_0xf4aa('0x5e'))[_0xf4aa('0x15')](_0x5144ff)['digest'](_0xf4aa('0x5f'));if(_0x30d1ab!==''){_0x30d1ab+='&';}_0x30d1ab+=_0xf4aa('0x60')+_0x5144ff;var _0x3e7133={'method':_0xf4aa('0x61'),'uri':_0x260525[_0xf4aa('0x52')]+_0xf4aa('0x62')+_0x30d1ab,'json':!![]};return rp(_0x3e7133)[_0xf4aa('0x14')](function(_0x2d6666){var _0x16bb38=Object['keys'](_0x2d6666);if(_0x2d6666[_0x16bb38[0x0]]['error']&&parseInt(_0x2d6666[_0x16bb38[0x0]]['error'])===0x0){var _0x5422ad={'messageId':_0x2d6666[_0x16bb38[0x0]][_0xf4aa('0x63')]};if(!_0x260525[_0xf4aa('0x34')]){_0x5422ad['read']=!![];}return _0x1061c0[_0xf4aa('0x15')](_0x5422ad);}else{return logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x56'),util[_0xf4aa('0x26')](_0x2d6666[_0xf4aa('0x22')],{'showHidden':![],'depth':null}));}})[_0xf4aa('0x17')](function(_0x15a9d4){return logger[_0xf4aa('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4aa('0x24'),_0xf4aa('0x56'),util[_0xf4aa('0x26')](_0x15a9d4,{'showHidden':![],'depth':null}));});}else{logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x56'),_0xf4aa('0x64'));}break;case _0xf4aa('0x65'):if(_0x260525[_0xf4aa('0x57')]){var _0xca5ada={'method':_0xf4aa('0x37'),'uri':_0xf4aa('0x66'),'headers':{'Authorization':_0x260525['apiKey']},'body':{'content':_0x4ae625[_0xf4aa('0x2a')],'to':[_0x4ae625['phone']],'from':_0x260525['phone'],'binary':![],'clientMessageId':_0xf4aa('0x67'),'charset':_0xf4aa('0x68')},'json':!![]};rp(_0xca5ada)[_0xf4aa('0x14')](function(_0x2103a1){if(!_0x2103a1[_0xf4aa('0x22')]){var _0x109e40={'messageId':_0x2103a1[_0xf4aa('0x1c')][0x0][_0xf4aa('0x69')]};if(!_0x260525[_0xf4aa('0x34')]){_0x109e40['read']=!![];}return _0x1061c0[_0xf4aa('0x15')](_0x109e40);}else{return logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),'clickatell',util[_0xf4aa('0x26')](_0x2103a1[_0xf4aa('0x22')],{'showHidden':![],'depth':null}));}})[_0xf4aa('0x17')](function(_0x461d1d){return logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x65'),util[_0xf4aa('0x26')](_0x461d1d,{'showHidden':![],'depth':null}));});}else{logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x65'),_0xf4aa('0x64'));}break;case'intelepeer':if(_0x260525[_0xf4aa('0x57')]){var _0x4b9f6f={};var _0x3e7133={'method':'POST','uri':_0xf4aa('0x6a'),'headers':{'Authorization':'Bearer\x20'+_0x260525[_0xf4aa('0x57')],'Content-Type':_0xf4aa('0x53')},'body':{'from':_0x260525[_0xf4aa('0x1b')],'to':_0x4ae625[_0xf4aa('0x1b')],'text':_0x4ae625[_0xf4aa('0x2a')]},'json':!![]};return rp(_0x3e7133)[_0xf4aa('0x14')](function(_0x599f82){if(_0x599f82[_0xf4aa('0x6b')]==0xca){_0x4b9f6f[_0xf4aa('0x6c')]=_0x599f82;var _0x2d093b={'method':'POST','uri':_0xf4aa('0x6d'),'headers':{'Authorization':'Bearer\x20'+_0x260525[_0xf4aa('0x57')],'Content-Type':_0xf4aa('0x53')},'body':{'refid':_0x4b9f6f[_0xf4aa('0x6c')]['refid']},'json':!![]};return rp(_0x2d093b)[_0xf4aa('0x14')](function(_0xd1dbdc){_0x4b9f6f[_0xf4aa('0x6e')]=_0xd1dbdc;var _0x2c7e00={'messageId':_0x4b9f6f[_0xf4aa('0x6c')][_0xf4aa('0x6f')],'read':!![]};return _0x1061c0[_0xf4aa('0x15')](_0x2c7e00);});}else{return logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x70'),util[_0xf4aa('0x26')](_0x599f82,{'showHidden':![],'depth':null}));}})['catch'](function(_0x25115d){return logger['error'](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x70'),util[_0xf4aa('0x26')](_0x25115d,{'showHidden':![],'depth':null}));});}else{return logger[_0xf4aa('0x22')](_0xf4aa('0x23'),_0xf4aa('0x24'),_0xf4aa('0x70'),_0xf4aa('0x71'));}break;}}})[_0xf4aa('0x72')](function(){_0x3a926f();});}else{_0x3a926f();}}},'charset':_0xf4aa('0x73'),'collate':_0xf4aa('0x74')});}; \ No newline at end of file +var _0x3930=['/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','user_key','internal_order_id','inspect','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','messages','message_id','clickSend','plivo','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','length','createHash','md5','signature=','GET','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','utf8mb4','util','api','bluebird','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','/api/sms/messages/'];(function(_0x1c100b,_0x5e17a0){var _0x2417fe=function(_0x4f5756){while(--_0x4f5756){_0x1c100b['push'](_0x1c100b['shift']());}};_0x2417fe(++_0x5e17a0);}(_0x3930,0x12e));var _0x0393=function(_0x1b2763,_0x49e0b5){_0x1b2763=_0x1b2763-0x0;var _0x5a02a5=_0x3930[_0x1b2763];return _0x5a02a5;};'use strict';var _=require('lodash');var util=require(_0x0393('0x0'));var logger=require('../../config/logger')(_0x0393('0x1'));var moment=require('moment');var BPromise=require(_0x0393('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0393('0x3'));var rimraf=require('rimraf');var config=require(_0x0393('0x4'));var attributes=require(_0x0393('0x5'));module[_0x0393('0x6')]=function(_0x1f7355,_0x5ec92d){return _0x1f7355[_0x0393('0x7')](_0x0393('0x8'),attributes,{'tableName':_0x0393('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0393('0xa')]},{'name':_0x0393('0xb'),'fields':[_0x0393('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xac0ccc,_0x539d5c,_0x114a4e){var _0x4bc309=_0x1f7355['models'];var _0x5445c8=_0xac0ccc[_0x0393('0xd')]({'plain':!![]});if(_0x5445c8[_0x0393('0xe')][_0x0393('0xf')]()==='in'||_0x5445c8[_0x0393('0xe')]['toLowerCase']()===_0x0393('0x10')&&!_0x5445c8[_0x0393('0x11')]&&!_[_0x0393('0x12')](_0x5445c8['UserId'])){_0x4bc309[_0x0393('0x13')]['findOne']({'where':{'id':_0x5445c8['SmsInteractionId']}})[_0x0393('0x14')](function(_0x1e2972){if(_0x1e2972){_0x1e2972[_0x0393('0x15')]({'lastMsgAt':_0x5445c8[_0x0393('0x16')],'lastMsgDirection':_0x5445c8[_0x0393('0xe')][_0x0393('0xf')]()});}})[_0x0393('0x17')](function(_0x14dcde){console[_0x0393('0x18')](_0x14dcde);});}if(_0x5445c8[_0x0393('0xe')]==='out'&&!_0x5445c8[_0x0393('0x11')]){var _0x55aa48;_0x4bc309[_0x0393('0x19')][_0x0393('0x1a')]({'where':{'id':_0x5445c8[_0x0393('0x1b')]},'raw':!![]})[_0x0393('0x14')](function(_0x5beed4){_0x55aa48=_0x5beed4;if(_0x55aa48&&_0x55aa48['type']){switch(_0x55aa48[_0x0393('0x1c')]){case _0x0393('0x1d'):var _0x4a2087=require(_0x0393('0x1d'));if(_0x55aa48[_0x0393('0x1e')]&&_0x55aa48[_0x0393('0x1f')]&&_0x55aa48[_0x0393('0x20')]){var _0x4fc0c3=new _0x4a2087(_0x55aa48[_0x0393('0x1e')],_0x55aa48[_0x0393('0x1f')]);_0x4fc0c3['messages']['create']({'body':_0x5445c8[_0x0393('0xc')],'to':_0x5445c8[_0x0393('0x20')],'from':_0x55aa48[_0x0393('0x20')],'statusCallback':_0x55aa48['remote']+_0x0393('0x21')+_0x5445c8['id']+_0x0393('0x22')+_0x55aa48[_0x0393('0x23')]})[_0x0393('0x14')](function(_0x300b16){if(_0x300b16['sid']){return _0xac0ccc[_0x0393('0x15')]({'messageId':_0x300b16['sid']});}})[_0x0393('0x17')](function(_0x61feeb){logger['error'](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x1d'),util['inspect'](_0x61feeb,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x1d'),_0x0393('0x26'));}break;case _0x0393('0x27'):var _0x228d08=_0x0393('0x28');if(_0x55aa48[_0x0393('0x29')]&&_0x55aa48[_0x0393('0x2a')]){var _0x562611={'recipient':[_0x5445c8[_0x0393('0x20')]],'message':_0x5445c8[_0x0393('0xc')],'message_type':_0x55aa48['smsMethod']};if(_0x55aa48['smsMethod']&&_0x55aa48[_0x0393('0x2b')]!=='SI'){_0x562611[_0x0393('0x2c')]=_0x55aa48[_0x0393('0x20')];}var _0x2d841d={'url':_0x228d08+_0x0393('0x2d')+_0x55aa48[_0x0393('0x29')]+_0x0393('0x2e')+_0x55aa48[_0x0393('0x2a')],'method':'GET'};rp(_0x2d841d)['then'](function(_0x3ae10f){var _0x4bd9d8=_0x3ae10f[_0x0393('0x2f')](';');var _0x2cbc88={'user_key':_0x4bd9d8[0x0],'session_key':_0x4bd9d8[0x1]};_0x2d841d={'url':_0x228d08+_0x0393('0x30'),'method':'POST','headers':{'user_key':_0x2cbc88[_0x0393('0x31')],'Session_key':_0x2cbc88['session_key']},'json':!![],'body':_0x562611};return rp(_0x2d841d);})['then'](function(_0x4aec34){if(_0x4aec34['total_sent']>=0x1){var _0x286121={'messageId':_0x4aec34[_0x0393('0x32')]};if(_0x55aa48[_0x0393('0x2b')]!=='GP'||!_0x55aa48['deliveryReport']){_0x286121['read']=!![];}return _0xac0ccc[_0x0393('0x15')](_0x286121);}else{return logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0393('0x25'),'skebby',util[_0x0393('0x33')](_0x4aec34,{'showHidden':![],'depth':null}));}})[_0x0393('0x17')](function(_0x549997){return logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0393('0x25'),_0x0393('0x27'),util[_0x0393('0x33')](_0x549997,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),'afterCreate',_0x0393('0x27'),_0x0393('0x34'));}break;case _0x0393('0x35'):if(_0x55aa48[_0x0393('0x1f')]){var _0x3c6f32={'recipient':_0x5445c8['phone'],'message':_0x5445c8[_0x0393('0xc')],'sender':_0x55aa48['senderString']||_0x55aa48[_0x0393('0x20')],'authorization':_0x55aa48[_0x0393('0x1f')]};var _0x539d5c={'method':'POST','uri':_0x0393('0x36'),'body':_0x3c6f32,'json':!![]};rp(_0x539d5c)['then'](function(_0x224e33){var _0x7d50dd={'messageId':_0x224e33[_0x0393('0x37')]};if(!_0x55aa48[_0x0393('0x38')]){_0x7d50dd[_0x0393('0x39')]=!![];}return _0xac0ccc[_0x0393('0x15')](_0x7d50dd);})[_0x0393('0x17')](function(_0x5e8f00){logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0393('0x35'),util[_0x0393('0x33')](_0x5e8f00,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),'connectel',_0x0393('0x3a'));}break;case _0x0393('0x3b'):if(_0x55aa48['username']&&_0x55aa48['password']){var _0x3c6f32={'messages':[{'source':'xCALLY\x20Motion','to':_0x5445c8[_0x0393('0x20')],'body':_0x5445c8['body'],'from':_0x55aa48['senderString']||_0x55aa48[_0x0393('0x20')]}]};var _0x5a3fca=util[_0x0393('0x3c')](_0x0393('0x3d'),_0x55aa48[_0x0393('0x29')],_0x55aa48[_0x0393('0x2a')]);var _0x539d5c={'method':_0x0393('0x3e'),'uri':_0x0393('0x3f'),'body':_0x3c6f32,'headers':{'Authorization':util['format'](_0x0393('0x40'),new Buffer(_0x5a3fca)[_0x0393('0x41')](_0x0393('0x42')))},'json':!![]};rp(_0x539d5c)[_0x0393('0x14')](function(_0x3c389f){if(_0x3c389f[_0x0393('0x43')]>=0xc8&&_0x3c389f['http_code']<=0xce){if(_0x3c389f[_0x0393('0x44')]&&_0x3c389f[_0x0393('0x44')]['queued_count']>0x0){var _0x594c1f=_['head'](_0x3c389f[_0x0393('0x44')][_0x0393('0x45')]);var _0x3173a0={'messageId':_0x594c1f[_0x0393('0x46')]};if(!_0x55aa48['deliveryReport']){_0x3173a0[_0x0393('0x39')]=!![];}return _0xac0ccc[_0x0393('0x15')](_0x3173a0);}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x47'),util[_0x0393('0x33')](_0x3c389f,{'showHidden':![],'depth':null}));}}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x47'),util[_0x0393('0x33')](_0x3c389f,{'showHidden':![],'depth':null}));}})[_0x0393('0x17')](function(_0x4a2ffe){logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0393('0x25'),_0x0393('0x47'),util[_0x0393('0x33')](_0x4a2ffe,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x47'),_0x0393('0x34'));}break;case _0x0393('0x48'):if(_0x55aa48[_0x0393('0x49')]&&_0x55aa48[_0x0393('0x1f')]){var _0x3c6f32={'dst':_0x5445c8['phone'],'text':_0x5445c8[_0x0393('0xc')],'src':_0x55aa48[_0x0393('0x4a')]||_0x55aa48[_0x0393('0x20')],'url':_0x55aa48['remote']+'/api/sms/messages/'+_0x5445c8['id']+'/status?token='+_0x55aa48['token']};var _0x5a3fca=util[_0x0393('0x3c')](_0x0393('0x3d'),_0x55aa48['authId'],_0x55aa48[_0x0393('0x1f')]);var _0x539d5c={'method':_0x0393('0x3e'),'uri':util[_0x0393('0x3c')](_0x0393('0x4b'),_0x55aa48[_0x0393('0x49')]),'body':_0x3c6f32,'headers':{'Authorization':util[_0x0393('0x3c')]('Basic\x20%s',new Buffer(_0x5a3fca)[_0x0393('0x41')](_0x0393('0x42')))},'json':!![]};rp(_0x539d5c)[_0x0393('0x14')](function(_0x311195){var _0x266782={'messageId':_0x311195['message_uuid'][0x0]};return _0xac0ccc[_0x0393('0x15')](_0x266782);})[_0x0393('0x17')](function(_0x4b9b1c){logger[_0x0393('0x18')](_0x0393('0x24'),'afterCreate',_0x0393('0x48'),util[_0x0393('0x33')](_0x4b9b1c,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x48'),_0x0393('0x4c'));}break;case _0x0393('0x4d'):if(_0x55aa48[_0x0393('0x29')]&&_0x55aa48[_0x0393('0x2a')]){if(_0x55aa48[_0x0393('0x4e')]){var _0x1ed21a={'method':_0x0393('0x3e'),'uri':_0x55aa48[_0x0393('0x4e')]+_0x0393('0x4f'),'body':{'username':_0x55aa48['username'],'password':_0x55aa48[_0x0393('0x2a')]},'json':!![]};return rp(_0x1ed21a)[_0x0393('0x14')](function(_0x25480d){var _0x1eab4c={'method':_0x0393('0x3e'),'uri':_0x55aa48[_0x0393('0x4e')]+_0x0393('0x50'),'body':{'messages':[{'from':_0x55aa48[_0x0393('0x20')],'destinations':[{'to':_0x5445c8[_0x0393('0x20')]}],'text':_0x5445c8[_0x0393('0xc')],'notifyUrl':_0x55aa48[_0x0393('0x51')]+'/api/sms/messages/'+_0x5445c8['id']+'/status?token='+_0x55aa48[_0x0393('0x23')],'notifyContentType':_0x0393('0x52'),'callbackData':_0x55aa48['phone']+';'+_0x5445c8[_0x0393('0xc')]}]},'headers':{'Authorization':_0x0393('0x53')+_0x25480d[_0x0393('0x23')]},'json':!![]};return rp(_0x1eab4c)[_0x0393('0x14')](function(_0x5d7eda){if(_0x5d7eda[_0x0393('0x45')]){var _0x509662={'messageId':_0x5d7eda['messages'][0x0][_0x0393('0xa')]};if(!_0x55aa48['deliveryReport']){_0x509662[_0x0393('0x39')]=!![];}return _0xac0ccc[_0x0393('0x15')](_0x509662);}else{return logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0393('0x25'),_0x0393('0x4d'),util[_0x0393('0x33')](_0x5d7eda,{'showHidden':![],'depth':null}));}});})[_0x0393('0x17')](function(_0x4ef325){return logger['error'](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x4d'),util[_0x0393('0x33')](_0x4ef325,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0393('0x25'),_0x0393('0x4d'),_0x0393('0x54'));}}else{logger['error'](_0x0393('0x24'),'afterCreate',_0x0393('0x4d'),_0x0393('0x34'));}break;case _0x0393('0x55'):var _0x1b54d6=require('crypto');if(_0x55aa48[_0x0393('0x56')]){var _0x56c311={};_0x56c311[_0x0393('0x57')]=_0x55aa48[_0x0393('0x29')];_0x56c311[_0x0393('0x20')]=_0x5445c8[_0x0393('0x20')];_0x56c311[_0x0393('0x2c')]=_0x55aa48[_0x0393('0x20')];_0x56c311[_0x0393('0x58')]=_0x5445c8['body'];_0x56c311[_0x0393('0x59')]=+new Date();var _0x3de1ce='';var _0x1e2794='';var _0x1f7a11=Object[_0x0393('0x5a')](_0x56c311);_0x1f7a11['sort']();for(var _0x3da244=0x0;_0x3da244<_0x1f7a11[_0x0393('0x5b')];_0x3da244++){if(_0x3de1ce!=''){_0x3de1ce+='&';}_0x3de1ce+=_0x1f7a11[_0x3da244]+'='+encodeURIComponent(_0x56c311[_0x1f7a11[_0x3da244]]);_0x1e2794+=_0x56c311[_0x1f7a11[_0x3da244]];}_0x1e2794+=_0x55aa48[_0x0393('0x56')];_0x1e2794=_0x1b54d6[_0x0393('0x5c')](_0x0393('0x5d'))[_0x0393('0x15')](_0x1e2794)['digest']('hex');if(_0x3de1ce!==''){_0x3de1ce+='&';}_0x3de1ce+=_0x0393('0x5e')+_0x1e2794;var _0x2d841d={'method':_0x0393('0x5f'),'uri':_0x55aa48[_0x0393('0x4e')]+_0x0393('0x60')+_0x3de1ce,'json':!![]};return rp(_0x2d841d)[_0x0393('0x14')](function(_0x5b75fd){var _0x2eb5bd=Object['keys'](_0x5b75fd);if(_0x5b75fd[_0x2eb5bd[0x0]]['error']&&parseInt(_0x5b75fd[_0x2eb5bd[0x0]][_0x0393('0x18')])===0x0){var _0x79674b={'messageId':_0x5b75fd[_0x2eb5bd[0x0]][_0x0393('0x61')]};if(!_0x55aa48[_0x0393('0x38')]){_0x79674b[_0x0393('0x39')]=!![];}return _0xac0ccc[_0x0393('0x15')](_0x79674b);}else{return logger['error'](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x55'),util['inspect'](_0x5b75fd['error'],{'showHidden':![],'depth':null}));}})[_0x0393('0x17')](function(_0x8ef6b0){return logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x0393('0x33')](_0x8ef6b0,{'showHidden':![],'depth':null}));});}else{logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0x0393('0x62'):if(_0x55aa48[_0x0393('0x56')]){var _0x3650ea={'method':'POST','uri':_0x0393('0x63'),'headers':{'Authorization':_0x55aa48[_0x0393('0x56')]},'body':{'content':_0x5445c8[_0x0393('0xc')],'to':[_0x5445c8[_0x0393('0x20')]],'from':_0x55aa48[_0x0393('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0x0393('0x64')},'json':!![]};rp(_0x3650ea)[_0x0393('0x14')](function(_0x1e5659){if(!_0x1e5659['error']){var _0x5e06f8={'messageId':_0x1e5659['messages'][0x0][_0x0393('0x65')]};if(!_0x55aa48[_0x0393('0x38')]){_0x5e06f8['read']=!![];}return _0xac0ccc[_0x0393('0x15')](_0x5e06f8);}else{return logger[_0x0393('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0393('0x62'),util[_0x0393('0x33')](_0x1e5659['error'],{'showHidden':![],'depth':null}));}})[_0x0393('0x17')](function(_0x12d5e8){return logger['error'](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x62'),util[_0x0393('0x33')](_0x12d5e8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0393('0x62'),_0x0393('0x66'));}break;case _0x0393('0x67'):if(_0x55aa48['apiKey']){var _0x32f578={};var _0x2d841d={'method':_0x0393('0x3e'),'uri':_0x0393('0x68'),'headers':{'Authorization':_0x0393('0x69')+_0x55aa48[_0x0393('0x56')],'Content-Type':_0x0393('0x52')},'body':{'from':_0x55aa48[_0x0393('0x20')],'to':_0x5445c8[_0x0393('0x20')],'text':_0x5445c8['body']},'json':!![]};return rp(_0x2d841d)[_0x0393('0x14')](function(_0x267850){if(_0x267850[_0x0393('0x6a')]==0xca){_0x32f578['message']=_0x267850;var _0x4fbdaf={'method':_0x0393('0x3e'),'uri':_0x0393('0x6b'),'headers':{'Authorization':_0x0393('0x69')+_0x55aa48['apiKey'],'Content-Type':_0x0393('0x52')},'body':{'refid':_0x32f578[_0x0393('0x6c')][_0x0393('0x6d')]},'json':!![]};return rp(_0x4fbdaf)[_0x0393('0x14')](function(_0x295682){_0x32f578[_0x0393('0x6e')]=_0x295682;var _0x4d7e4c={'messageId':_0x32f578[_0x0393('0x6c')][_0x0393('0x6d')],'read':!![]};return _0xac0ccc['update'](_0x4d7e4c);});}else{return logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x67'),util[_0x0393('0x33')](_0x267850,{'showHidden':![],'depth':null}));}})[_0x0393('0x17')](function(_0x426fde){return logger[_0x0393('0x18')](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x67'),util['inspect'](_0x426fde,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x0393('0x24'),_0x0393('0x25'),_0x0393('0x67'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x114a4e();});}else{_0x114a4e();}}},'charset':_0x0393('0x6f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 4f02d69..1136df6 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 _0x1a85=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x1a85,0x178));var _0x51a8=function(_0x23c791,_0xa8bee3){_0x23c791=_0x23c791-0x0;var _0x57b777=_0x1a85[_0x23c791];return _0x57b777;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});}exports[_0x51a8('0x19')]=function(_0x2217ce){var _0x2f2681=this;return new Promise(function(_0x2a4c4c,_0x3bc044){return db[_0x51a8('0x1a')][_0x51a8('0x1b')](_0x2217ce['body'],{'raw':_0x2217ce[_0x51a8('0x1c')]?_0x2217ce['options'][_0x51a8('0x1d')]===undefined?!![]:![]:!![]})[_0x51a8('0xd')](function(_0x8bda40){logger[_0x51a8('0xe')]('CreateSmsMessage',_0x2217ce);logger[_0x51a8('0x11')]('CreateSmsMessage',_0x2217ce,JSON['stringify'](_0x8bda40));_0x2a4c4c(_0x8bda40);})[_0x51a8('0x18')](function(_0x52e503){logger[_0x51a8('0x14')](_0x51a8('0x19'),_0x52e503[_0x51a8('0x16')],_0x2217ce);_0x3bc044(_0x2f2681[_0x51a8('0x14')](0x1f4,_0x52e503[_0x51a8('0x16')]));});});}; \ No newline at end of file +var _0x57ca=['jayson/promise','client','http','redis','defaults','localhost','register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsMessage','create','body','options','raw','then','info','CreateSmsMessage','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57ca,0x108));var _0xa57c=function(_0x17ebad,_0x575d46){_0x17ebad=_0x17ebad-0x0;var _0x4fddfe=_0x57ca[_0x17ebad];return _0x4fddfe;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});config[_0xa57c('0xb')]=_[_0xa57c('0xc')](config[_0xa57c('0xb')],{'host':_0xa57c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0xb')]));require('./smsMessage.socket')[_0xa57c('0xe')](socket);function respondWithRpcPromise(_0x932dcc,_0x4fa5ed,_0x156bca){return new BPromise(function(_0x51f287,_0x554101){return client[_0xa57c('0xf')](_0x932dcc,_0x156bca)['then'](function(_0x2ed4c6){logger['info'](_0xa57c('0x10'),_0x4fa5ed,_0xa57c('0x11'));logger[_0xa57c('0x12')](_0xa57c('0x13'),_0x4fa5ed,_0xa57c('0x11'),JSON['stringify'](_0x2ed4c6));if(_0x2ed4c6[_0xa57c('0x14')]){if(_0x2ed4c6['error'][_0xa57c('0x15')]===0x1f4){logger[_0xa57c('0x14')](_0xa57c('0x10'),_0x4fa5ed,_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x554101(_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);}logger['error'](_0xa57c('0x10'),_0x4fa5ed,_0x2ed4c6[_0xa57c('0x14')][_0xa57c('0x16')]);return _0x51f287(_0x2ed4c6['error'][_0xa57c('0x16')]);}else{logger['info'](_0xa57c('0x10'),_0x4fa5ed,_0xa57c('0x11'));_0x51f287(_0x2ed4c6[_0xa57c('0x17')][_0xa57c('0x16')]);}})[_0xa57c('0x18')](function(_0x4728f9){logger[_0xa57c('0x14')](_0xa57c('0x10'),_0x4fa5ed,_0x4728f9);_0x554101(_0x4728f9);});});}exports['CreateSmsMessage']=function(_0x8a8856){var _0x4a53ab=this;return new Promise(function(_0x4a35bb,_0x418415){return db[_0xa57c('0x19')][_0xa57c('0x1a')](_0x8a8856[_0xa57c('0x1b')],{'raw':_0x8a8856['options']?_0x8a8856[_0xa57c('0x1c')][_0xa57c('0x1d')]===undefined?!![]:![]:!![]})[_0xa57c('0x1e')](function(_0x2213b2){logger[_0xa57c('0x1f')](_0xa57c('0x20'),_0x8a8856);logger[_0xa57c('0x12')](_0xa57c('0x20'),_0x8a8856,JSON[_0xa57c('0x21')](_0x2213b2));_0x4a35bb(_0x2213b2);})[_0xa57c('0x18')](function(_0x382a26){logger[_0xa57c('0x14')](_0xa57c('0x20'),_0x382a26[_0xa57c('0x16')],_0x8a8856);_0x418415(_0x4a53ab[_0xa57c('0x14')](0x1f4,_0x382a26['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 40a5403..943ed22 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 _0x3895=['register','length','smsMessage:','./smsMessage.events','save','remove','update','removeListener'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x3895,0x6b));var _0x5389=function(_0x2e6c41,_0x21b274){_0x2e6c41=_0x2e6c41-0x0;var _0x3f3907=_0x3895[_0x2e6c41];return _0x3f3907;};'use strict';var SmsMessageEvents=require(_0x5389('0x0'));var events=[_0x5389('0x1'),_0x5389('0x2'),_0x5389('0x3')];function createListener(_0x5c62da,_0x233e4e){return function(_0x34fbd0){_0x233e4e['emit'](_0x5c62da,_0x34fbd0);};}function removeListener(_0x486157,_0x14234){return function(){SmsMessageEvents[_0x5389('0x4')](_0x486157,_0x14234);};}exports[_0x5389('0x5')]=function(_0xba3399){for(var _0x3af75d=0x0,_0x2ae650=events[_0x5389('0x6')];_0x3af75d<_0x2ae650;_0x3af75d++){var _0x30f7b1=events[_0x3af75d];var _0x112bf9=createListener(_0x5389('0x7')+_0x30f7b1,_0xba3399);SmsMessageEvents['on'](_0x30f7b1,_0x112bf9);}}; \ No newline at end of file +var _0xa369=['./smsMessage.events','save','remove','update','emit','register','length'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0xa369,0x1c0));var _0x9a36=function(_0x3d6ef9,_0xa3ab19){_0x3d6ef9=_0x3d6ef9-0x0;var _0x43bbee=_0xa369[_0x3d6ef9];return _0x43bbee;};'use strict';var SmsMessageEvents=require(_0x9a36('0x0'));var events=[_0x9a36('0x1'),_0x9a36('0x2'),_0x9a36('0x3')];function createListener(_0x1c5fcb,_0x1de91c){return function(_0x675b50){_0x1de91c[_0x9a36('0x4')](_0x1c5fcb,_0x675b50);};}function removeListener(_0x556d9a,_0x112732){return function(){SmsMessageEvents['removeListener'](_0x556d9a,_0x112732);};}exports[_0x9a36('0x5')]=function(_0x469721){for(var _0x366b4e=0x0,_0x59f921=events[_0x9a36('0x6')];_0x366b4e<_0x59f921;_0x366b4e++){var _0x171cee=events[_0x366b4e];var _0x563d87=createListener('smsMessage:'+_0x171cee,_0x469721);SmsMessageEvents['on'](_0x171cee,_0x563d87);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6da01e0..1772543 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 _0x7958=['../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8795('0x0'));var util=require(_0x8795('0x1'));var path=require('path');var timeout=require(_0x8795('0x2'));var express=require(_0x8795('0x3'));var router=express[_0x8795('0x4')]();var auth=require(_0x8795('0x5'));var interaction=require(_0x8795('0x6'));var config=require(_0x8795('0x7'));var controller=require(_0x8795('0x8'));router[_0x8795('0x9')]('/',auth['isAuthenticated'](),controller[_0x8795('0xa')]);router[_0x8795('0x9')](_0x8795('0xb'),auth['isAuthenticated'](),controller[_0x8795('0xc')]);router['get'](_0x8795('0xd'),auth[_0x8795('0xe')](),controller[_0x8795('0xf')]);router[_0x8795('0x9')](_0x8795('0x10'),auth[_0x8795('0xe')](),controller[_0x8795('0x11')]);router[_0x8795('0x9')](_0x8795('0x12'),auth[_0x8795('0xe')](),controller[_0x8795('0x13')]);router[_0x8795('0x9')](_0x8795('0x14'),auth['isAuthenticated'](),controller[_0x8795('0x15')]);router[_0x8795('0x16')]('/',auth[_0x8795('0xe')](),controller[_0x8795('0x17')]);router[_0x8795('0x16')](_0x8795('0x12'),auth[_0x8795('0xe')](),controller['addTeams']);router['post']('/:id/users',auth[_0x8795('0xe')](),controller[_0x8795('0x18')]);router[_0x8795('0x19')](_0x8795('0xd'),auth[_0x8795('0xe')](),controller[_0x8795('0x1a')]);router[_0x8795('0x1b')]('/:id',auth[_0x8795('0xe')](),controller['destroy']);router[_0x8795('0x1b')](_0x8795('0x12'),auth[_0x8795('0xe')](),controller[_0x8795('0x1c')]);router[_0x8795('0x1b')](_0x8795('0x14'),auth[_0x8795('0xe')](),controller['removeAgents']);module[_0x8795('0x1d')]=router; \ No newline at end of file +var _0xbea5=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','connect-timeout'];(function(_0x3324e5,_0x4eb1ef){var _0x33cb08=function(_0x2eb4e5){while(--_0x2eb4e5){_0x3324e5['push'](_0x3324e5['shift']());}};_0x33cb08(++_0x4eb1ef);}(_0xbea5,0x177));var _0x5bea=function(_0x385467,_0x298239){_0x385467=_0x385467-0x0;var _0x5ed67e=_0xbea5[_0x385467];return _0x5ed67e;};'use strict';var multer=require(_0x5bea('0x0'));var util=require(_0x5bea('0x1'));var path=require('path');var timeout=require(_0x5bea('0x2'));var express=require(_0x5bea('0x3'));var router=express[_0x5bea('0x4')]();var auth=require(_0x5bea('0x5'));var interaction=require(_0x5bea('0x6'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x5bea('0x7')]('/',auth['isAuthenticated'](),controller[_0x5bea('0x8')]);router['get']('/describe',auth[_0x5bea('0x9')](),controller['describe']);router['get'](_0x5bea('0xa'),auth[_0x5bea('0x9')](),controller[_0x5bea('0xb')]);router['get'](_0x5bea('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x5bea('0x7')](_0x5bea('0xd'),auth[_0x5bea('0x9')](),controller[_0x5bea('0xe')]);router[_0x5bea('0x7')](_0x5bea('0xf'),auth['isAuthenticated'](),controller[_0x5bea('0x10')]);router[_0x5bea('0x11')]('/',auth['isAuthenticated'](),controller[_0x5bea('0x12')]);router[_0x5bea('0x11')]('/:id/teams',auth[_0x5bea('0x9')](),controller[_0x5bea('0x13')]);router[_0x5bea('0x11')](_0x5bea('0xf'),auth[_0x5bea('0x9')](),controller[_0x5bea('0x14')]);router[_0x5bea('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x5bea('0x16')]);router[_0x5bea('0x17')](_0x5bea('0xa'),auth['isAuthenticated'](),controller[_0x5bea('0x18')]);router[_0x5bea('0x17')](_0x5bea('0xd'),auth['isAuthenticated'](),controller[_0x5bea('0x19')]);router[_0x5bea('0x17')]('/:id/users',auth[_0x5bea('0x9')](),controller['removeAgents']);module[_0x5bea('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e466cd6..6616054 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 _0x61db=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3b502e,_0x2b9361){var _0x3ef3d6=function(_0x46c1ce){while(--_0x46c1ce){_0x3b502e['push'](_0x3b502e['shift']());}};_0x3ef3d6(++_0x2b9361);}(_0x61db,0xdd));var _0xb61d=function(_0x13192c,_0x52cf73){_0x13192c=_0x13192c-0x0;var _0x4b32fe=_0x61db[_0x13192c];return _0x4b32fe;};'use strict';var Sequelize=require(_0xb61d('0x0'));module[_0xb61d('0x1')]={'name':{'type':Sequelize[_0xb61d('0x2')],'unique':_0xb61d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb61d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb61d('0x4')](_0xb61d('0x5'),_0xb61d('0x6'),_0xb61d('0x7'))}}; \ No newline at end of file +var _0xd96f=['INTEGER','rrmemory','sequelize','exports','STRING'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xd96f,0x12e));var _0xfd96=function(_0x53fff3,_0x4ee805){_0x53fff3=_0x53fff3-0x0;var _0x42f577=_0xd96f[_0x53fff3];return _0x42f577;};'use strict';var Sequelize=require(_0xfd96('0x0'));module[_0xfd96('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd96('0x2')]},'timeout':{'type':Sequelize[_0xfd96('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfd96('0x4'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index bf75d2c..73638a3 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 _0x2365=['every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','end','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','map','User','findAndCountAll','UserId','agent','smsPause','updatedAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Agents','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','SELECT'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x2365,0x12c));var _0x5236=function(_0x2774d0,_0x3a67c8){_0x2774d0=_0x2774d0-0x0;var _0x12f981=_0x2365[_0x2774d0];return _0x12f981;};'use strict';var pdf=require(_0x5236('0x0'));var emlformat=require(_0x5236('0x1'));var rimraf=require(_0x5236('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5236('0x3'));var rp=require('request-promise');var moment=require(_0x5236('0x4'));var BPromise=require(_0x5236('0x5'));var Mustache=require('mustache');var util=require(_0x5236('0x6'));var path=require(_0x5236('0x7'));var sox=require(_0x5236('0x8'));var csv=require(_0x5236('0x9'));var ejs=require(_0x5236('0xa'));var fs=require('fs');var _=require(_0x5236('0xb'));var squel=require(_0x5236('0xc'));var crypto=require(_0x5236('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5236('0xe'));var toCsv=require(_0x5236('0x9'));var querystring=require(_0x5236('0xf'));var Papa=require(_0x5236('0x10'));var Redis=require(_0x5236('0x11'));var authService=require(_0x5236('0x12'));var qs=require(_0x5236('0x13'));var as=require(_0x5236('0x14'));var hardwareService=require(_0x5236('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5236('0x16'))['db'];config[_0x5236('0x17')]=_[_0x5236('0x18')](config[_0x5236('0x17')],{'host':_0x5236('0x19'),'port':0x18eb});var socket=require(_0x5236('0x1a'))(new Redis(config['redis']));require(_0x5236('0x1b'))['register'](socket);function respondWithStatusCode(_0x247d2f,_0xd086c){_0xd086c=_0xd086c||0xcc;return function(_0x2b292d){if(_0x2b292d){return _0x247d2f[_0x5236('0x1c')](_0xd086c);}return _0x247d2f[_0x5236('0x1d')](_0xd086c)['end']();};}function respondWithResult(_0x3f5e7e,_0x34e928){_0x34e928=_0x34e928||0xc8;return function(_0x573ba0){if(_0x573ba0){return _0x3f5e7e[_0x5236('0x1d')](_0x34e928)['json'](_0x573ba0);}};}function respondWithFilteredResult(_0x290fa9,_0x476193){return function(_0x14a949){if(_0x14a949){var _0x1b86d7=_0x14a949['count'],_0x1236d3=_0x476193[_0x5236('0x1e')],_0x4bead1=_0x476193['offset']+_0x476193[_0x5236('0x1f')],_0xaffe33;if(_0x4bead1>=_0x1b86d7){_0x4bead1=_0x1b86d7;_0xaffe33=0xc8;}else{_0xaffe33=0xce;}_0x290fa9[_0x5236('0x1d')](_0xaffe33);return _0x290fa9[_0x5236('0x20')](_0x5236('0x21'),_0x1236d3+'-'+_0x4bead1+'/'+_0x1b86d7)[_0x5236('0x22')](_0x14a949);}return null;};}function patchUpdates(_0x8af02f){return function(_0x53579e){try{jsonpatch[_0x5236('0x23')](_0x53579e,_0x8af02f,!![]);}catch(_0x4ea5f3){return BPromise[_0x5236('0x24')](_0x4ea5f3);}return _0x53579e[_0x5236('0x25')]();};}function saveUpdates(_0x1a58dd,_0x2d1502){return function(_0x22e525){if(_0x22e525){return _0x22e525['update'](_0x1a58dd)['then'](function(_0x2c5bf8){return _0x2c5bf8;});}return null;};}function removeEntity(_0x2282bb,_0x3c65d5){return function(_0x514ed5){if(_0x514ed5){return _0x514ed5[_0x5236('0x26')]()[_0x5236('0x27')](function(){var _0x2cc658=_0x514ed5['get']({'plain':!![]});var _0x49dca5='SmsQueues';return db[_0x5236('0x28')][_0x5236('0x26')]({'where':{'type':_0x49dca5,'resourceId':_0x2cc658['id']}})[_0x5236('0x27')](function(){return _0x514ed5;});})[_0x5236('0x27')](function(){_0x2282bb[_0x5236('0x1d')](0xcc)[_0x5236('0x29')]();});}};}function handleEntityNotFound(_0x129725,_0x4bc3b9){return function(_0x309291){if(!_0x309291){_0x129725['sendStatus'](0x194);}return _0x309291;};}function handleError(_0x30e86f,_0x591c41){_0x591c41=_0x591c41||0x1f4;return function(_0x16a93f){logger[_0x5236('0x2a')](_0x16a93f[_0x5236('0x2b')]);if(_0x16a93f[_0x5236('0x2c')]){delete _0x16a93f[_0x5236('0x2c')];}_0x30e86f[_0x5236('0x1d')](_0x591c41)[_0x5236('0x2d')](_0x16a93f);};}exports[_0x5236('0x2e')]=function(_0x38de0b,_0x7c2358){var _0x3b3792={},_0xdd4e96={},_0x4015f0={'count':0x0,'rows':[]};var _0x290db0=_['map'](db[_0x5236('0x2f')][_0x5236('0x30')],function(_0x238508){return{'name':_0x238508[_0x5236('0x31')],'type':_0x238508[_0x5236('0x32')][_0x5236('0x33')]};});_0xdd4e96[_0x5236('0x34')]=_['map'](_0x290db0,'name');_0xdd4e96[_0x5236('0x35')]=_['keys'](_0x38de0b[_0x5236('0x35')]);_0xdd4e96[_0x5236('0x36')]=_[_0x5236('0x37')](_0xdd4e96[_0x5236('0x34')],_0xdd4e96[_0x5236('0x35')]);_0x3b3792['attributes']=_[_0x5236('0x37')](_0xdd4e96[_0x5236('0x34')],qs[_0x5236('0x38')](_0x38de0b[_0x5236('0x35')][_0x5236('0x38')]));_0x3b3792[_0x5236('0x39')]=_0x3b3792['attributes'][_0x5236('0x3a')]?_0x3b3792[_0x5236('0x39')]:_0xdd4e96[_0x5236('0x34')];if(!_0x38de0b[_0x5236('0x35')]['hasOwnProperty'](_0x5236('0x3b'))){_0x3b3792['limit']=qs['limit'](_0x38de0b['query'][_0x5236('0x1f')]);_0x3b3792[_0x5236('0x1e')]=qs[_0x5236('0x1e')](_0x38de0b['query'][_0x5236('0x1e')]);}_0x3b3792[_0x5236('0x3c')]=qs[_0x5236('0x3d')](_0x38de0b[_0x5236('0x35')][_0x5236('0x3d')]);_0x3b3792[_0x5236('0x3e')]=qs[_0x5236('0x36')](_['pick'](_0x38de0b[_0x5236('0x35')],_0xdd4e96[_0x5236('0x36')]),_0x290db0);if(_0x38de0b[_0x5236('0x35')][_0x5236('0x3f')]){_0x3b3792['where']=_[_0x5236('0x40')](_0x3b3792[_0x5236('0x3e')],{'$or':_['map'](_0x290db0,function(_0x539c53){if(_0x539c53[_0x5236('0x32')]!=='VIRTUAL'){var _0x49b97f={};_0x49b97f[_0x539c53[_0x5236('0x2c')]]={'$like':'%'+_0x38de0b[_0x5236('0x35')][_0x5236('0x3f')]+'%'};return _0x49b97f;}})});}_0x3b3792=_['merge']({},_0x3b3792,_0x38de0b[_0x5236('0x41')]);var _0x44adc0={'where':_0x3b3792[_0x5236('0x3e')]};return db[_0x5236('0x2f')][_0x5236('0x42')](_0x44adc0)[_0x5236('0x27')](function(_0x345736){_0x4015f0[_0x5236('0x42')]=_0x345736;if(_0x38de0b[_0x5236('0x35')][_0x5236('0x43')]){_0x3b3792[_0x5236('0x44')]=[{'all':!![]}];}return db[_0x5236('0x2f')]['findAll'](_0x3b3792);})['then'](function(_0x12cfcf){_0x4015f0[_0x5236('0x45')]=_0x12cfcf;return _0x4015f0;})[_0x5236('0x27')](respondWithFilteredResult(_0x7c2358,_0x3b3792))[_0x5236('0x46')](handleError(_0x7c2358,null));};exports[_0x5236('0x47')]=function(_0x60dc78,_0x1e180a){var _0x30e317={'raw':!![],'where':{'id':_0x60dc78[_0x5236('0x48')]['id']}},_0x1626e0={};_0x1626e0[_0x5236('0x34')]=_[_0x5236('0x49')](db[_0x5236('0x2f')][_0x5236('0x30')]);_0x1626e0['query']=_[_0x5236('0x49')](_0x60dc78[_0x5236('0x35')]);_0x1626e0['filters']=_['intersection'](_0x1626e0[_0x5236('0x34')],_0x1626e0[_0x5236('0x35')]);_0x30e317[_0x5236('0x39')]=_[_0x5236('0x37')](_0x1626e0['model'],qs['fields'](_0x60dc78[_0x5236('0x35')][_0x5236('0x38')]));_0x30e317[_0x5236('0x39')]=_0x30e317[_0x5236('0x39')]['length']?_0x30e317[_0x5236('0x39')]:_0x1626e0[_0x5236('0x34')];if(_0x60dc78[_0x5236('0x35')]['includeAll']){_0x30e317[_0x5236('0x44')]=[{'all':!![]}];}_0x30e317=_[_0x5236('0x40')]({},_0x30e317,_0x60dc78[_0x5236('0x41')]);return db[_0x5236('0x2f')][_0x5236('0x4a')](_0x30e317)[_0x5236('0x27')](handleEntityNotFound(_0x1e180a,null))['then'](respondWithResult(_0x1e180a,null))[_0x5236('0x46')](handleError(_0x1e180a,null));};exports[_0x5236('0x4b')]=function(_0xad436,_0x4852ba){return db['SmsQueue']['create'](_0xad436['body'],{})[_0x5236('0x27')](function(_0x4c085a){var _0x4ad4e4=_0xad436[_0x5236('0x4c')][_0x5236('0x4d')]({'plain':!![]});if(!_0x4ad4e4)throw new Error(_0x5236('0x4e'));if(_0x4ad4e4[_0x5236('0x4f')]===_0x5236('0x4c')){var _0x1a1233=_0x4c085a[_0x5236('0x4d')]({'plain':!![]});var _0x546c11=_0x5236('0x50');return db[_0x5236('0x51')][_0x5236('0x4a')]({'where':{'name':_0x546c11,'userProfileId':_0x4ad4e4[_0x5236('0x52')]},'raw':!![]})[_0x5236('0x27')](function(_0x3a6e2a){if(_0x3a6e2a&&_0x3a6e2a[_0x5236('0x53')]===0x0){return db['UserProfileResource'][_0x5236('0x4b')]({'name':_0x1a1233[_0x5236('0x2c')],'resourceId':_0x1a1233['id'],'type':_0x3a6e2a[_0x5236('0x2c')],'sectionId':_0x3a6e2a['id']},{})[_0x5236('0x27')](function(){return _0x4c085a;});}else{return _0x4c085a;}})[_0x5236('0x46')](function(_0x3482b6){logger['error'](_0x5236('0x54'),_0x3482b6);throw _0x3482b6;});}return _0x4c085a;})[_0x5236('0x27')](respondWithResult(_0x4852ba,0xc9))[_0x5236('0x46')](handleError(_0x4852ba,null));};exports[_0x5236('0x55')]=function(_0x5976a6,_0x13ab88){if(_0x5976a6[_0x5236('0x56')]['id']){delete _0x5976a6[_0x5236('0x56')]['id'];}return db['SmsQueue'][_0x5236('0x4a')]({'where':{'id':_0x5976a6[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x13ab88,null))[_0x5236('0x27')](saveUpdates(_0x5976a6[_0x5236('0x56')],null))[_0x5236('0x27')](respondWithResult(_0x13ab88,null))[_0x5236('0x46')](handleError(_0x13ab88,null));};exports[_0x5236('0x26')]=function(_0xb25167,_0x578951){return db['SmsQueue'][_0x5236('0x4a')]({'where':{'id':_0xb25167[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x578951,null))[_0x5236('0x27')](removeEntity(_0x578951,null))[_0x5236('0x46')](handleError(_0x578951,null));};exports[_0x5236('0x57')]=function(_0x12637d,_0x3e5329){return db[_0x5236('0x2f')][_0x5236('0x57')]()[_0x5236('0x27')](respondWithResult(_0x3e5329,null))[_0x5236('0x46')](handleError(_0x3e5329,null));};exports[_0x5236('0x58')]=function(_0x24c399,_0x1afeef,_0x2400dd){var _0x1e4f0b={'raw':!![],'where':{}},_0x4fb449={},_0x2821c6;return db[_0x5236('0x2f')]['findOne']({'where':{'id':_0x24c399[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x1afeef,null))[_0x5236('0x27')](function(_0x3fb7e8){if(_0x3fb7e8){_0x2821c6=_0x3fb7e8[_0x5236('0x4d')]({'plain':!![]});_0x4fb449[_0x5236('0x34')]=_['keys'](db[_0x5236('0x59')][_0x5236('0x30')]);_0x4fb449[_0x5236('0x35')]=_['keys'](_0x24c399[_0x5236('0x35')]);_0x4fb449[_0x5236('0x36')]=_[_0x5236('0x37')](_0x4fb449['model'],_0x4fb449[_0x5236('0x35')]);_0x1e4f0b[_0x5236('0x39')]=_[_0x5236('0x37')](_0x4fb449['model'],qs[_0x5236('0x38')](_0x24c399[_0x5236('0x35')][_0x5236('0x38')]));_0x1e4f0b['attributes']=_0x1e4f0b[_0x5236('0x39')][_0x5236('0x3a')]?_0x1e4f0b[_0x5236('0x39')]:_0x4fb449[_0x5236('0x34')];if(!_0x24c399['query'][_0x5236('0x5a')](_0x5236('0x3b'))){_0x1e4f0b[_0x5236('0x1f')]=qs['limit'](_0x24c399[_0x5236('0x35')][_0x5236('0x1f')]);_0x1e4f0b[_0x5236('0x1e')]=qs[_0x5236('0x1e')](_0x24c399[_0x5236('0x35')][_0x5236('0x1e')]);}_0x1e4f0b['order']=qs['sort'](_0x24c399['query'][_0x5236('0x3d')]);_0x1e4f0b[_0x5236('0x3e')]=qs[_0x5236('0x36')](_[_0x5236('0x5b')](_0x24c399[_0x5236('0x35')],_0x4fb449[_0x5236('0x36')]));_0x1e4f0b['where'][_0x5236('0x5c')]=_0x3fb7e8['id'];if(_0x24c399[_0x5236('0x35')][_0x5236('0x3f')]){_0x1e4f0b[_0x5236('0x3e')]=_[_0x5236('0x40')](_0x1e4f0b[_0x5236('0x3e')],{'$or':_[_0x5236('0x5d')](_0x1e4f0b[_0x5236('0x39')],function(_0x51c8a2){var _0x2698a6={};_0x2698a6[_0x51c8a2]={'$like':'%'+_0x24c399[_0x5236('0x35')]['filter']+'%'};return _0x2698a6;})});}_0x1e4f0b=_['merge']({},_0x1e4f0b,_0x24c399['options']);return db['UserSmsQueue']['findAll'](_0x1e4f0b);}})[_0x5236('0x27')](function(_0x54de27){if(_0x54de27){return db[_0x5236('0x5e')][_0x5236('0x5f')]({'where':{'id':_['map'](_0x54de27,_0x5236('0x60')),'role':_0x5236('0x61')},'attributes':['id',_0x5236('0x2c'),_0x5236('0x62'),_0x5236('0x63'),'createdAt']});}})[_0x5236('0x27')](function(_0x1af18e){if(_0x1af18e){return{'count':_0x1af18e[_0x5236('0x42')],'rows':_[_0x5236('0x5d')](_0x1af18e['rows'],function(_0x2656ed){return{'membername':_0x2656ed[_0x5236('0x2c')],'UserId':_0x2656ed['id'],'queue_name':_0x2821c6[_0x5236('0x2c')],'SmsQueueId':_0x2821c6['id'],'interface':util['format'](_0x5236('0x64'),_0x5236('0x65'),_0x2656ed[_0x5236('0x2c')]),'penalty':0x0,'paused':_0x2656ed[_0x5236('0x62')],'createdAt':_0x2656ed['createdAt'],'updatedAt':_0x2656ed[_0x5236('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5236('0x27')](respondWithFilteredResult(_0x1afeef,_0x1e4f0b))['catch'](handleError(_0x1afeef,null));};exports[_0x5236('0x66')]=function(_0xba5beb,_0x49ea33,_0x2c0362){var _0x8bc85b={};var _0x3f044d={};var _0x406ca5;var _0x536fd5;return db[_0x5236('0x2f')][_0x5236('0x67')]({'where':{'id':_0xba5beb[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x49ea33,null))[_0x5236('0x27')](function(_0x4ed8c0){if(_0x4ed8c0){_0x406ca5=_0x4ed8c0;_0x3f044d['model']=_[_0x5236('0x49')](db[_0x5236('0x68')][_0x5236('0x30')]);_0x3f044d[_0x5236('0x35')]=_[_0x5236('0x49')](_0xba5beb[_0x5236('0x35')]);_0x3f044d[_0x5236('0x36')]=_[_0x5236('0x37')](_0x3f044d[_0x5236('0x34')],_0x3f044d[_0x5236('0x35')]);_0x8bc85b[_0x5236('0x39')]=_[_0x5236('0x37')](_0x3f044d[_0x5236('0x34')],qs[_0x5236('0x38')](_0xba5beb[_0x5236('0x35')][_0x5236('0x38')]));_0x8bc85b[_0x5236('0x39')]=_0x8bc85b['attributes'][_0x5236('0x3a')]?_0x8bc85b[_0x5236('0x39')]:_0x3f044d[_0x5236('0x34')];_0x8bc85b['order']=qs[_0x5236('0x3d')](_0xba5beb[_0x5236('0x35')][_0x5236('0x3d')]);_0x8bc85b[_0x5236('0x3e')]=qs[_0x5236('0x36')](_[_0x5236('0x5b')](_0xba5beb[_0x5236('0x35')],_0x3f044d[_0x5236('0x36')]));if(_0xba5beb['query'][_0x5236('0x3f')]){_0x8bc85b[_0x5236('0x3e')]=_[_0x5236('0x40')](_0x8bc85b['where'],{'$or':_[_0x5236('0x5d')](_0x8bc85b['attributes'],function(_0x47cf0e){var _0x724cca={};_0x724cca[_0x47cf0e]={'$like':'%'+_0xba5beb[_0x5236('0x35')][_0x5236('0x3f')]+'%'};return _0x724cca;})});}_0x8bc85b=_[_0x5236('0x40')]({},_0x8bc85b,_0xba5beb['options']);return _0x406ca5[_0x5236('0x66')](_0x8bc85b);}})[_0x5236('0x27')](function(_0x174242){if(_0x174242){_0x536fd5=_0x174242[_0x5236('0x3a')];if(!_0xba5beb[_0x5236('0x35')][_0x5236('0x5a')](_0x5236('0x3b'))){_0x8bc85b['limit']=qs[_0x5236('0x1f')](_0xba5beb[_0x5236('0x35')]['limit']);_0x8bc85b['offset']=qs['offset'](_0xba5beb[_0x5236('0x35')][_0x5236('0x1e')]);}return _0x406ca5[_0x5236('0x66')](_0x8bc85b);}})[_0x5236('0x27')](function(_0x3b4a64){if(_0x3b4a64){return _0x3b4a64?{'count':_0x536fd5,'rows':_0x3b4a64}:null;}})[_0x5236('0x27')](respondWithResult(_0x49ea33,null))[_0x5236('0x46')](handleError(_0x49ea33,null));};exports[_0x5236('0x69')]=function(_0x3a5ac0,_0x2e7687,_0x4b370f){var _0x1472cd=_0x3a5ac0[_0x5236('0x56')][_0x5236('0x6a')];return db[_0x5236('0x68')]['findAll']({'where':{'id':_0x1472cd},'attributes':['id'],'include':[{'model':db[_0x5236('0x5e')],'as':'Agents','attributes':['id','name',_0x5236('0x6b'),_0x5236('0x6c'),_0x5236('0x6d')],'raw':!![]}]})['then'](function(_0x1c8198){if(_0x1c8198){var _0x5de43e=_[_0x5236('0x6e')](_0x1c8198,function(_0x5ce1f0){var _0x55e53b=_0x5ce1f0['get']({'plain':!![]});return _0x55e53b['Agents'];});return db['SmsQueue'][_0x5236('0x4a')]({'where':{'id':_0x3a5ac0[_0x5236('0x48')]['id']}})['then'](function(_0x195922){return db['sequelize']['transaction'](function(_0x573917){return _0x195922['addTeams'](_0x1472cd,{'transaction':_0x573917})[_0x5236('0x27')](function(){return BPromise[_0x5236('0x6f')](_0x5de43e,function(_0x559cee){return db[_0x5236('0x59')][_0x5236('0x70')]({'where':{'UserId':_0x559cee['id'],'SmsQueueId':_0x3a5ac0[_0x5236('0x48')]['id']},'transaction':_0x573917});});})[_0x5236('0x27')](function(){_0x5de43e[_0x5236('0x71')](function(_0x46748e){socket[_0x5236('0x72')](_0x5236('0x73'),{'UserId':_0x46748e['id'],'SmsQueueId':_0x195922['id']});});});});});}})['then'](respondWithStatusCode(_0x2e7687,null))[_0x5236('0x46')](handleError(_0x2e7687,null));};exports[_0x5236('0x74')]=function(_0x5eac79,_0x2c9c8b,_0x294528){return db[_0x5236('0x68')]['findAll']({'where':{'id':_0x5eac79[_0x5236('0x35')][_0x5236('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5236('0x75'),'attributes':['id'],'raw':!![]}]})[_0x5236('0x27')](handleEntityNotFound(_0x2c9c8b,null))['then'](function(_0x35b981){var _0x20ad15=_[_0x5236('0x5d')](_0x35b981,'id');var _0x2a387b=[];var _0x399320=[];var _0x170e16=squel[_0x5236('0x76')]();_0x170e16['field'](_0x5236('0x77'))[_0x5236('0x78')]('team_has_sms_queues','tq')[_0x5236('0x79')](_0x5236('0x7a'),'ut',_0x5236('0x7b'))[_0x5236('0x3e')](_0x5236('0x7c'),_0x5eac79[_0x5236('0x48')]['id']);for(var _0x1f6fa9=0x0;_0x1f6fa9<_0x35b981[_0x5236('0x3a')];_0x1f6fa9+=0x1){let _0x29a77f=_0x35b981[_0x1f6fa9];for(var _0x2bcbad=0x0;_0x2bcbad<_0x29a77f[_0x5236('0x75')][_0x5236('0x3a')];_0x2bcbad+=0x1){let _0x41a5ce=_0x29a77f[_0x5236('0x75')][_0x2bcbad];var _0x3d436b=_0x170e16['clone']();_0x3d436b['where'](_0x5236('0x7d'),_0x41a5ce['id']);_0x399320[_0x5236('0x7e')](db['sequelize'][_0x5236('0x35')](_0x3d436b['toString'](),{'type':db[_0x5236('0x7f')]['QueryTypes'][_0x5236('0x80')]})[_0x5236('0x27')](function(_0x229f36){if(_0x229f36[_0x5236('0x3a')]===0x1){return _0x41a5ce['id'];}else{var _0x4e0e4f=_[_0x5236('0x81')](_['map'](_0x229f36,_0x5236('0x82')),function(_0x4d735b){return _['includes'](_0x20ad15,_0x4d735b);});if(_0x4e0e4f){return _0x41a5ce['id'];}}}));}}return BPromise[_0x5236('0x83')](_0x399320)[_0x5236('0x27')](function(_0x2f93ca){_0x2a387b=_(_0x2a387b)[_0x5236('0x84')](_0x2f93ca)[_0x5236('0x85')]()[_0x5236('0x86')]();return db[_0x5236('0x2f')][_0x5236('0x4a')]({'where':{'id':_0x5eac79[_0x5236('0x48')]['id']}})['then'](function(_0x552b08){return db[_0x5236('0x7f')][_0x5236('0x87')](function(_0x47a222){return _0x552b08[_0x5236('0x74')](_0x5eac79[_0x5236('0x35')]['ids'],{'transaction':_0x47a222})[_0x5236('0x27')](function(){if(!_[_0x5236('0x88')](_0x2a387b)){return _0x552b08[_0x5236('0x89')](_0x2a387b,{'transaction':_0x47a222});}})[_0x5236('0x27')](function(){_0x2a387b[_0x5236('0x71')](function(_0x1d0d56){socket[_0x5236('0x72')](_0x5236('0x8a'),{'UserId':_0x1d0d56,'SmsQueueId':_0x552b08['id']});});});});});});})[_0x5236('0x27')](respondWithStatusCode(_0x2c9c8b,null))['catch'](handleError(_0x2c9c8b,null));};exports[_0x5236('0x8b')]=function(_0x4ff356,_0x248697,_0x37feab){return db[_0x5236('0x2f')][_0x5236('0x4a')]({'where':{'id':_0x4ff356[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x248697,null))['then'](function(_0x51fd5a){if(_0x51fd5a){return _0x51fd5a['addAgents'](_0x4ff356[_0x5236('0x56')][_0x5236('0x6a')],_[_0x5236('0x8c')](_0x4ff356[_0x5236('0x56')],['ids','id'])||{})['spread'](function(_0x149133){for(var _0x33b948=0x0;_0x33b948<_0x4ff356['body'][_0x5236('0x6a')]['length'];_0x33b948+=0x1){socket[_0x5236('0x72')](_0x5236('0x73'),{'UserId':_0x4ff356[_0x5236('0x56')][_0x5236('0x6a')][_0x33b948],'SmsQueueId':_0x4ff356[_0x5236('0x48')]['id']});}return _0x149133;});}})[_0x5236('0x27')](respondWithResult(_0x248697,null))[_0x5236('0x46')](handleError(_0x248697,null));};exports['removeAgents']=function(_0x5e0a6b,_0xcb108,_0x4194e6){return db[_0x5236('0x2f')]['find']({'where':{'id':_0x5e0a6b[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0xcb108,null))['then'](function(_0x464309){if(_0x464309){return _0x464309['removeAgents'](_0x5e0a6b[_0x5236('0x35')][_0x5236('0x6a')])['then'](function(){if(_[_0x5236('0x8d')](_0x5e0a6b[_0x5236('0x35')][_0x5236('0x6a')])){for(var _0x21cb4a=0x0;_0x21cb4a<_0x5e0a6b[_0x5236('0x35')]['ids'][_0x5236('0x3a')];_0x21cb4a+=0x1){socket[_0x5236('0x72')](_0x5236('0x8a'),{'UserId':Number(_0x5e0a6b[_0x5236('0x35')][_0x5236('0x6a')][_0x21cb4a]),'SmsQueueId':Number(_0x5e0a6b[_0x5236('0x48')]['id'])});}}else{socket[_0x5236('0x72')](_0x5236('0x8a'),{'UserId':Number(_0x5e0a6b[_0x5236('0x35')][_0x5236('0x6a')]),'SmsQueueId':Number(_0x5e0a6b['params']['id'])});}});}})['then'](respondWithStatusCode(_0xcb108,null))[_0x5236('0x46')](handleError(_0xcb108,null));};exports[_0x5236('0x8e')]=function(_0x13638e,_0x33fdd4,_0x435808){var _0x249979={};var _0x19e8a5={};var _0x52c2c0;var _0x1fbe36;return db[_0x5236('0x2f')]['findOne']({'where':{'id':_0x13638e[_0x5236('0x48')]['id']}})[_0x5236('0x27')](handleEntityNotFound(_0x33fdd4,null))[_0x5236('0x27')](function(_0x33ce74){if(_0x33ce74){_0x52c2c0=_0x33ce74;_0x19e8a5[_0x5236('0x34')]=_['keys'](db[_0x5236('0x5e')]['rawAttributes']);_0x19e8a5[_0x5236('0x35')]=_[_0x5236('0x49')](_0x13638e[_0x5236('0x35')]);_0x19e8a5['filters']=_[_0x5236('0x37')](_0x19e8a5[_0x5236('0x34')],_0x19e8a5[_0x5236('0x35')]);_0x249979['attributes']=_['intersection'](_0x19e8a5[_0x5236('0x34')],qs[_0x5236('0x38')](_0x13638e[_0x5236('0x35')][_0x5236('0x38')]));_0x249979[_0x5236('0x39')]=_0x249979[_0x5236('0x39')]['length']?_0x249979[_0x5236('0x39')]:_0x19e8a5['model'];_0x249979['order']=qs[_0x5236('0x3d')](_0x13638e[_0x5236('0x35')][_0x5236('0x3d')]);_0x249979[_0x5236('0x3e')]=qs[_0x5236('0x36')](_[_0x5236('0x5b')](_0x13638e[_0x5236('0x35')],_0x19e8a5[_0x5236('0x36')]));if(_0x13638e[_0x5236('0x35')]['filter']){_0x249979[_0x5236('0x3e')]=_[_0x5236('0x40')](_0x249979[_0x5236('0x3e')],{'$or':_[_0x5236('0x5d')](_0x249979[_0x5236('0x39')],function(_0x2aca8e){var _0x1cec4b={};_0x1cec4b[_0x2aca8e]={'$like':'%'+_0x13638e[_0x5236('0x35')][_0x5236('0x3f')]+'%'};return _0x1cec4b;})});}_0x249979=_[_0x5236('0x40')]({},_0x249979,_0x13638e[_0x5236('0x41')]);return _0x52c2c0['getAgents'](_0x249979);}})[_0x5236('0x27')](function(_0x315239){if(_0x315239){_0x1fbe36=_0x315239[_0x5236('0x3a')];if(!_0x13638e[_0x5236('0x35')][_0x5236('0x5a')](_0x5236('0x3b'))){_0x249979[_0x5236('0x1f')]=qs[_0x5236('0x1f')](_0x13638e[_0x5236('0x35')]['limit']);_0x249979[_0x5236('0x1e')]=qs[_0x5236('0x1e')](_0x13638e[_0x5236('0x35')][_0x5236('0x1e')]);}return _0x52c2c0[_0x5236('0x8e')](_0x249979);}})[_0x5236('0x27')](function(_0x11faa9){if(_0x11faa9){return _0x11faa9?{'count':_0x1fbe36,'rows':_0x11faa9}:null;}})[_0x5236('0x27')](respondWithResult(_0x33fdd4,null))['catch'](handleError(_0x33fdd4,null));}; \ No newline at end of file +var _0x2937=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','offset','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserSmsQueue','nolimit','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','ids','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','end','json','set','Content-Range','reject','save','then','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','type'];(function(_0x18ee5c,_0x4ff1cc){var _0x217a46=function(_0xba7336){while(--_0xba7336){_0x18ee5c['push'](_0x18ee5c['shift']());}};_0x217a46(++_0x4ff1cc);}(_0x2937,0xf2));var _0x7293=function(_0x15a937,_0x2ed73e){_0x15a937=_0x15a937-0x0;var _0x439acb=_0x2937[_0x15a937];return _0x439acb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7293('0x0'));var rimraf=require(_0x7293('0x1'));var zipdir=require(_0x7293('0x2'));var jsonpatch=require(_0x7293('0x3'));var rp=require(_0x7293('0x4'));var moment=require(_0x7293('0x5'));var BPromise=require(_0x7293('0x6'));var Mustache=require(_0x7293('0x7'));var util=require(_0x7293('0x8'));var path=require(_0x7293('0x9'));var sox=require(_0x7293('0xa'));var csv=require(_0x7293('0xb'));var ejs=require(_0x7293('0xc'));var fs=require('fs');var _=require(_0x7293('0xd'));var squel=require(_0x7293('0xe'));var crypto=require(_0x7293('0xf'));var jsforce=require(_0x7293('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7293('0xb'));var querystring=require(_0x7293('0x11'));var Papa=require('papaparse');var Redis=require(_0x7293('0x12'));var authService=require(_0x7293('0x13'));var qs=require(_0x7293('0x14'));var as=require(_0x7293('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7293('0x16'))(_0x7293('0x17'));var utils=require(_0x7293('0x18'));var config=require(_0x7293('0x19'));var db=require(_0x7293('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7293('0x1b'))(new Redis(config[_0x7293('0x1c')]));require(_0x7293('0x1d'))[_0x7293('0x1e')](socket);function respondWithStatusCode(_0x5cf60a,_0x2a7ef0){_0x2a7ef0=_0x2a7ef0||0xcc;return function(_0x4113dc){if(_0x4113dc){return _0x5cf60a[_0x7293('0x1f')](_0x2a7ef0);}return _0x5cf60a[_0x7293('0x20')](_0x2a7ef0)[_0x7293('0x21')]();};}function respondWithResult(_0x3adea7,_0x405da3){_0x405da3=_0x405da3||0xc8;return function(_0x1d6a3e){if(_0x1d6a3e){return _0x3adea7[_0x7293('0x20')](_0x405da3)[_0x7293('0x22')](_0x1d6a3e);}};}function respondWithFilteredResult(_0x5578e6,_0x4ef085){return function(_0x3ee84f){if(_0x3ee84f){var _0x214524=_0x3ee84f['count'],_0x2b6516=_0x4ef085['offset'],_0x47fe59=_0x4ef085['offset']+_0x4ef085['limit'],_0x5148ea;if(_0x47fe59>=_0x214524){_0x47fe59=_0x214524;_0x5148ea=0xc8;}else{_0x5148ea=0xce;}_0x5578e6[_0x7293('0x20')](_0x5148ea);return _0x5578e6[_0x7293('0x23')](_0x7293('0x24'),_0x2b6516+'-'+_0x47fe59+'/'+_0x214524)[_0x7293('0x22')](_0x3ee84f);}return null;};}function patchUpdates(_0x381c2b){return function(_0x45a0c0){try{jsonpatch['apply'](_0x45a0c0,_0x381c2b,!![]);}catch(_0x482144){return BPromise[_0x7293('0x25')](_0x482144);}return _0x45a0c0[_0x7293('0x26')]();};}function saveUpdates(_0xea82a6,_0x3a6018){return function(_0x3971bb){if(_0x3971bb){return _0x3971bb['update'](_0xea82a6)[_0x7293('0x27')](function(_0xe409f6){return _0xe409f6;});}return null;};}function removeEntity(_0x3fafa6,_0x43b20e){return function(_0x438713){if(_0x438713){return _0x438713['destroy']()['then'](function(){var _0x16b514=_0x438713['get']({'plain':!![]});var _0x2e6388='SmsQueues';return db[_0x7293('0x28')]['destroy']({'where':{'type':_0x2e6388,'resourceId':_0x16b514['id']}})[_0x7293('0x27')](function(){return _0x438713;});})[_0x7293('0x27')](function(){_0x3fafa6[_0x7293('0x20')](0xcc)[_0x7293('0x21')]();});}};}function handleEntityNotFound(_0xe04dbb,_0x1c2f29){return function(_0x4b7b94){if(!_0x4b7b94){_0xe04dbb[_0x7293('0x1f')](0x194);}return _0x4b7b94;};}function handleError(_0x6135f,_0x51d137){_0x51d137=_0x51d137||0x1f4;return function(_0x46ccc8){logger[_0x7293('0x29')](_0x46ccc8[_0x7293('0x2a')]);if(_0x46ccc8[_0x7293('0x2b')]){delete _0x46ccc8[_0x7293('0x2b')];}_0x6135f[_0x7293('0x20')](_0x51d137)[_0x7293('0x2c')](_0x46ccc8);};}exports[_0x7293('0x2d')]=function(_0x41143e,_0x313f24){var _0x41ea24={},_0x4c3849={},_0x344053={'count':0x0,'rows':[]};var _0x5f026e=_[_0x7293('0x2e')](db[_0x7293('0x2f')][_0x7293('0x30')],function(_0x1c1a7b){return{'name':_0x1c1a7b['fieldName'],'type':_0x1c1a7b[_0x7293('0x31')][_0x7293('0x32')]};});_0x4c3849[_0x7293('0x33')]=_[_0x7293('0x2e')](_0x5f026e,_0x7293('0x2b'));_0x4c3849[_0x7293('0x34')]=_[_0x7293('0x35')](_0x41143e['query']);_0x4c3849[_0x7293('0x36')]=_['intersection'](_0x4c3849[_0x7293('0x33')],_0x4c3849[_0x7293('0x34')]);_0x41ea24['attributes']=_[_0x7293('0x37')](_0x4c3849[_0x7293('0x33')],qs[_0x7293('0x38')](_0x41143e[_0x7293('0x34')]['fields']));_0x41ea24[_0x7293('0x39')]=_0x41ea24[_0x7293('0x39')][_0x7293('0x3a')]?_0x41ea24[_0x7293('0x39')]:_0x4c3849['model'];if(!_0x41143e['query'][_0x7293('0x3b')]('nolimit')){_0x41ea24[_0x7293('0x3c')]=qs[_0x7293('0x3c')](_0x41143e[_0x7293('0x34')][_0x7293('0x3c')]);_0x41ea24['offset']=qs['offset'](_0x41143e[_0x7293('0x34')][_0x7293('0x3d')]);}_0x41ea24['order']=qs['sort'](_0x41143e[_0x7293('0x34')][_0x7293('0x3e')]);_0x41ea24['where']=qs[_0x7293('0x36')](_[_0x7293('0x3f')](_0x41143e[_0x7293('0x34')],_0x4c3849['filters']),_0x5f026e);if(_0x41143e[_0x7293('0x34')][_0x7293('0x40')]){_0x41ea24[_0x7293('0x41')]=_[_0x7293('0x42')](_0x41ea24[_0x7293('0x41')],{'$or':_['map'](_0x5f026e,function(_0x3c03ea){if(_0x3c03ea['type']!==_0x7293('0x43')){var _0x9b16be={};_0x9b16be[_0x3c03ea['name']]={'$like':'%'+_0x41143e['query'][_0x7293('0x40')]+'%'};return _0x9b16be;}})});}_0x41ea24=_[_0x7293('0x42')]({},_0x41ea24,_0x41143e[_0x7293('0x44')]);var _0x2b99b9={'where':_0x41ea24[_0x7293('0x41')]};return db[_0x7293('0x2f')]['count'](_0x2b99b9)[_0x7293('0x27')](function(_0x4092e3){_0x344053[_0x7293('0x45')]=_0x4092e3;if(_0x41143e[_0x7293('0x34')][_0x7293('0x46')]){_0x41ea24[_0x7293('0x47')]=[{'all':!![]}];}return db[_0x7293('0x2f')][_0x7293('0x48')](_0x41ea24);})[_0x7293('0x27')](function(_0x2b79cd){_0x344053['rows']=_0x2b79cd;return _0x344053;})[_0x7293('0x27')](respondWithFilteredResult(_0x313f24,_0x41ea24))[_0x7293('0x49')](handleError(_0x313f24,null));};exports[_0x7293('0x4a')]=function(_0x9f1c1b,_0xe3b3d6){var _0x3de316={'raw':!![],'where':{'id':_0x9f1c1b[_0x7293('0x4b')]['id']}},_0xa339c={};_0xa339c[_0x7293('0x33')]=_['keys'](db['SmsQueue'][_0x7293('0x30')]);_0xa339c[_0x7293('0x34')]=_[_0x7293('0x35')](_0x9f1c1b['query']);_0xa339c['filters']=_[_0x7293('0x37')](_0xa339c['model'],_0xa339c[_0x7293('0x34')]);_0x3de316[_0x7293('0x39')]=_['intersection'](_0xa339c[_0x7293('0x33')],qs['fields'](_0x9f1c1b[_0x7293('0x34')][_0x7293('0x38')]));_0x3de316[_0x7293('0x39')]=_0x3de316['attributes'][_0x7293('0x3a')]?_0x3de316[_0x7293('0x39')]:_0xa339c[_0x7293('0x33')];if(_0x9f1c1b[_0x7293('0x34')][_0x7293('0x46')]){_0x3de316[_0x7293('0x47')]=[{'all':!![]}];}_0x3de316=_[_0x7293('0x42')]({},_0x3de316,_0x9f1c1b[_0x7293('0x44')]);return db[_0x7293('0x2f')][_0x7293('0x4c')](_0x3de316)['then'](handleEntityNotFound(_0xe3b3d6,null))[_0x7293('0x27')](respondWithResult(_0xe3b3d6,null))['catch'](handleError(_0xe3b3d6,null));};exports[_0x7293('0x4d')]=function(_0x427a65,_0x5d236c){return db['SmsQueue'][_0x7293('0x4d')](_0x427a65['body'],{})[_0x7293('0x27')](function(_0x623340){var _0x1c6623=_0x427a65[_0x7293('0x4e')][_0x7293('0x4f')]({'plain':!![]});if(!_0x1c6623)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c6623['role']===_0x7293('0x4e')){var _0x7b5b56=_0x623340[_0x7293('0x4f')]({'plain':!![]});var _0x53d6b8='SmsQueues';return db[_0x7293('0x50')][_0x7293('0x4c')]({'where':{'name':_0x53d6b8,'userProfileId':_0x1c6623[_0x7293('0x51')]},'raw':!![]})[_0x7293('0x27')](function(_0x117105){if(_0x117105&&_0x117105[_0x7293('0x52')]===0x0){return db[_0x7293('0x28')][_0x7293('0x4d')]({'name':_0x7b5b56[_0x7293('0x2b')],'resourceId':_0x7b5b56['id'],'type':_0x117105[_0x7293('0x2b')],'sectionId':_0x117105['id']},{})[_0x7293('0x27')](function(){return _0x623340;});}else{return _0x623340;}})['catch'](function(_0x1b03bd){logger['error'](_0x7293('0x53'),_0x1b03bd);throw _0x1b03bd;});}return _0x623340;})[_0x7293('0x27')](respondWithResult(_0x5d236c,0xc9))[_0x7293('0x49')](handleError(_0x5d236c,null));};exports['update']=function(_0x1a8d0d,_0x2f4666){if(_0x1a8d0d[_0x7293('0x54')]['id']){delete _0x1a8d0d[_0x7293('0x54')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1a8d0d[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x2f4666,null))[_0x7293('0x27')](saveUpdates(_0x1a8d0d[_0x7293('0x54')],null))['then'](respondWithResult(_0x2f4666,null))[_0x7293('0x49')](handleError(_0x2f4666,null));};exports[_0x7293('0x55')]=function(_0x425b4b,_0x3ced5){return db[_0x7293('0x2f')][_0x7293('0x4c')]({'where':{'id':_0x425b4b[_0x7293('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ced5,null))[_0x7293('0x27')](removeEntity(_0x3ced5,null))[_0x7293('0x49')](handleError(_0x3ced5,null));};exports[_0x7293('0x56')]=function(_0x24fcf0,_0x446147){return db[_0x7293('0x2f')][_0x7293('0x56')]()[_0x7293('0x27')](respondWithResult(_0x446147,null))[_0x7293('0x49')](handleError(_0x446147,null));};exports[_0x7293('0x57')]=function(_0x4c958b,_0x45af29,_0x1e7b4c){var _0x4e9c66={'raw':!![],'where':{}},_0x4e4333={},_0x57e397;return db[_0x7293('0x2f')][_0x7293('0x58')]({'where':{'id':_0x4c958b['params']['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x45af29,null))[_0x7293('0x27')](function(_0x245d27){if(_0x245d27){_0x57e397=_0x245d27['get']({'plain':!![]});_0x4e4333[_0x7293('0x33')]=_[_0x7293('0x35')](db[_0x7293('0x59')][_0x7293('0x30')]);_0x4e4333['query']=_['keys'](_0x4c958b[_0x7293('0x34')]);_0x4e4333[_0x7293('0x36')]=_[_0x7293('0x37')](_0x4e4333[_0x7293('0x33')],_0x4e4333[_0x7293('0x34')]);_0x4e9c66[_0x7293('0x39')]=_[_0x7293('0x37')](_0x4e4333['model'],qs[_0x7293('0x38')](_0x4c958b['query'][_0x7293('0x38')]));_0x4e9c66[_0x7293('0x39')]=_0x4e9c66[_0x7293('0x39')][_0x7293('0x3a')]?_0x4e9c66[_0x7293('0x39')]:_0x4e4333[_0x7293('0x33')];if(!_0x4c958b['query'][_0x7293('0x3b')](_0x7293('0x5a'))){_0x4e9c66[_0x7293('0x3c')]=qs[_0x7293('0x3c')](_0x4c958b[_0x7293('0x34')][_0x7293('0x3c')]);_0x4e9c66['offset']=qs['offset'](_0x4c958b[_0x7293('0x34')][_0x7293('0x3d')]);}_0x4e9c66[_0x7293('0x5b')]=qs[_0x7293('0x3e')](_0x4c958b['query']['sort']);_0x4e9c66[_0x7293('0x41')]=qs[_0x7293('0x36')](_[_0x7293('0x3f')](_0x4c958b[_0x7293('0x34')],_0x4e4333['filters']));_0x4e9c66['where'][_0x7293('0x5c')]=_0x245d27['id'];if(_0x4c958b[_0x7293('0x34')]['filter']){_0x4e9c66[_0x7293('0x41')]=_['merge'](_0x4e9c66[_0x7293('0x41')],{'$or':_['map'](_0x4e9c66[_0x7293('0x39')],function(_0x1f4ac7){var _0x45d18b={};_0x45d18b[_0x1f4ac7]={'$like':'%'+_0x4c958b[_0x7293('0x34')][_0x7293('0x40')]+'%'};return _0x45d18b;})});}_0x4e9c66=_[_0x7293('0x42')]({},_0x4e9c66,_0x4c958b[_0x7293('0x44')]);return db[_0x7293('0x59')][_0x7293('0x48')](_0x4e9c66);}})[_0x7293('0x27')](function(_0x158108){if(_0x158108){return db[_0x7293('0x5d')][_0x7293('0x5e')]({'where':{'id':_[_0x7293('0x2e')](_0x158108,_0x7293('0x5f')),'role':_0x7293('0x60')},'attributes':['id',_0x7293('0x2b'),_0x7293('0x61'),_0x7293('0x62'),_0x7293('0x63')]});}})[_0x7293('0x27')](function(_0x56810c){if(_0x56810c){return{'count':_0x56810c['count'],'rows':_['map'](_0x56810c['rows'],function(_0xcf2dc5){return{'membername':_0xcf2dc5[_0x7293('0x2b')],'UserId':_0xcf2dc5['id'],'queue_name':_0x57e397[_0x7293('0x2b')],'SmsQueueId':_0x57e397['id'],'interface':util[_0x7293('0x64')](_0x7293('0x65'),_0x7293('0x66'),_0xcf2dc5[_0x7293('0x2b')]),'penalty':0x0,'paused':_0xcf2dc5[_0x7293('0x61')],'createdAt':_0xcf2dc5[_0x7293('0x63')],'updatedAt':_0xcf2dc5[_0x7293('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7293('0x27')](respondWithFilteredResult(_0x45af29,_0x4e9c66))['catch'](handleError(_0x45af29,null));};exports[_0x7293('0x67')]=function(_0x2b8433,_0x16e007,_0x3a38d5){var _0x44d89e={};var _0x317e41={};var _0x14913f;var _0x23a8d3;return db[_0x7293('0x2f')]['findOne']({'where':{'id':_0x2b8433[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x16e007,null))[_0x7293('0x27')](function(_0x3b118d){if(_0x3b118d){_0x14913f=_0x3b118d;_0x317e41[_0x7293('0x33')]=_[_0x7293('0x35')](db[_0x7293('0x68')][_0x7293('0x30')]);_0x317e41[_0x7293('0x34')]=_[_0x7293('0x35')](_0x2b8433[_0x7293('0x34')]);_0x317e41['filters']=_[_0x7293('0x37')](_0x317e41['model'],_0x317e41['query']);_0x44d89e[_0x7293('0x39')]=_[_0x7293('0x37')](_0x317e41[_0x7293('0x33')],qs[_0x7293('0x38')](_0x2b8433[_0x7293('0x34')][_0x7293('0x38')]));_0x44d89e['attributes']=_0x44d89e['attributes'][_0x7293('0x3a')]?_0x44d89e['attributes']:_0x317e41[_0x7293('0x33')];_0x44d89e[_0x7293('0x5b')]=qs[_0x7293('0x3e')](_0x2b8433[_0x7293('0x34')][_0x7293('0x3e')]);_0x44d89e[_0x7293('0x41')]=qs[_0x7293('0x36')](_[_0x7293('0x3f')](_0x2b8433[_0x7293('0x34')],_0x317e41[_0x7293('0x36')]));if(_0x2b8433[_0x7293('0x34')][_0x7293('0x40')]){_0x44d89e['where']=_[_0x7293('0x42')](_0x44d89e[_0x7293('0x41')],{'$or':_['map'](_0x44d89e[_0x7293('0x39')],function(_0x240d1e){var _0xee9cfa={};_0xee9cfa[_0x240d1e]={'$like':'%'+_0x2b8433[_0x7293('0x34')]['filter']+'%'};return _0xee9cfa;})});}_0x44d89e=_['merge']({},_0x44d89e,_0x2b8433[_0x7293('0x44')]);return _0x14913f[_0x7293('0x67')](_0x44d89e);}})[_0x7293('0x27')](function(_0x3f2df9){if(_0x3f2df9){_0x23a8d3=_0x3f2df9[_0x7293('0x3a')];if(!_0x2b8433[_0x7293('0x34')]['hasOwnProperty'](_0x7293('0x5a'))){_0x44d89e[_0x7293('0x3c')]=qs[_0x7293('0x3c')](_0x2b8433['query'][_0x7293('0x3c')]);_0x44d89e[_0x7293('0x3d')]=qs[_0x7293('0x3d')](_0x2b8433[_0x7293('0x34')]['offset']);}return _0x14913f[_0x7293('0x67')](_0x44d89e);}})['then'](function(_0x3c1330){if(_0x3c1330){return _0x3c1330?{'count':_0x23a8d3,'rows':_0x3c1330}:null;}})[_0x7293('0x27')](respondWithResult(_0x16e007,null))[_0x7293('0x49')](handleError(_0x16e007,null));};exports[_0x7293('0x69')]=function(_0x44e273,_0x919cfc,_0x26c612){var _0x478937=_0x44e273[_0x7293('0x54')]['ids'];return db[_0x7293('0x68')][_0x7293('0x48')]({'where':{'id':_0x478937},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7293('0x6a'),'attributes':['id','name',_0x7293('0x6b'),_0x7293('0x6c'),_0x7293('0x6d')],'raw':!![]}]})[_0x7293('0x27')](function(_0x455825){if(_0x455825){var _0x4d3613=_[_0x7293('0x6e')](_0x455825,function(_0x474e03){var _0x4dd8f3=_0x474e03[_0x7293('0x4f')]({'plain':!![]});return _0x4dd8f3[_0x7293('0x6a')];});return db[_0x7293('0x2f')][_0x7293('0x4c')]({'where':{'id':_0x44e273[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](function(_0x15f9fd){return db[_0x7293('0x6f')][_0x7293('0x70')](function(_0xb3b965){return _0x15f9fd[_0x7293('0x69')](_0x478937,{'transaction':_0xb3b965})['then'](function(){return BPromise[_0x7293('0x71')](_0x4d3613,function(_0x48d621){return db[_0x7293('0x59')][_0x7293('0x72')]({'where':{'UserId':_0x48d621['id'],'SmsQueueId':_0x44e273[_0x7293('0x4b')]['id']},'transaction':_0xb3b965});});})['then'](function(){_0x4d3613['forEach'](function(_0x129a7b){socket[_0x7293('0x73')](_0x7293('0x74'),{'UserId':_0x129a7b['id'],'SmsQueueId':_0x15f9fd['id']});});});});});}})[_0x7293('0x27')](respondWithStatusCode(_0x919cfc,null))['catch'](handleError(_0x919cfc,null));};exports[_0x7293('0x75')]=function(_0x2839a4,_0x42fb85,_0x345f06){return db[_0x7293('0x68')][_0x7293('0x48')]({'where':{'id':_0x2839a4[_0x7293('0x34')][_0x7293('0x76')]},'attributes':['id'],'include':[{'model':db[_0x7293('0x5d')],'as':_0x7293('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x7293('0x27')](handleEntityNotFound(_0x42fb85,null))[_0x7293('0x27')](function(_0x49a1ae){var _0x5b9e93=_[_0x7293('0x2e')](_0x49a1ae,'id');var _0x5b5b80=[];var _0x48bf28=[];var _0x529f86=squel[_0x7293('0x77')]();_0x529f86[_0x7293('0x78')]('tq.TeamId')[_0x7293('0x79')]('team_has_sms_queues','tq')[_0x7293('0x7a')](_0x7293('0x7b'),'ut',_0x7293('0x7c'))['where'](_0x7293('0x7d'),_0x2839a4['params']['id']);for(var _0x39c027=0x0;_0x39c027<_0x49a1ae[_0x7293('0x3a')];_0x39c027+=0x1){let _0x3fa741=_0x49a1ae[_0x39c027];for(var _0x33a5bd=0x0;_0x33a5bd<_0x3fa741['Agents'][_0x7293('0x3a')];_0x33a5bd+=0x1){let _0x2b9c9f=_0x3fa741['Agents'][_0x33a5bd];var _0x1b412b=_0x529f86[_0x7293('0x7e')]();_0x1b412b[_0x7293('0x41')](_0x7293('0x7f'),_0x2b9c9f['id']);_0x48bf28['push'](db['sequelize'][_0x7293('0x34')](_0x1b412b[_0x7293('0x80')](),{'type':db['sequelize'][_0x7293('0x81')][_0x7293('0x82')]})[_0x7293('0x27')](function(_0x4dd91c){if(_0x4dd91c[_0x7293('0x3a')]===0x1){return _0x2b9c9f['id'];}else{var _0x27779e=_[_0x7293('0x83')](_[_0x7293('0x2e')](_0x4dd91c,_0x7293('0x84')),function(_0x3ca93d){return _[_0x7293('0x85')](_0x5b9e93,_0x3ca93d);});if(_0x27779e){return _0x2b9c9f['id'];}}}));}}return BPromise[_0x7293('0x86')](_0x48bf28)[_0x7293('0x27')](function(_0x573295){_0x5b5b80=_(_0x5b5b80)[_0x7293('0x87')](_0x573295)[_0x7293('0x88')]()['value']();return db[_0x7293('0x2f')][_0x7293('0x4c')]({'where':{'id':_0x2839a4['params']['id']}})[_0x7293('0x27')](function(_0x505781){return db['sequelize'][_0x7293('0x70')](function(_0x3e5afe){return _0x505781[_0x7293('0x75')](_0x2839a4[_0x7293('0x34')][_0x7293('0x76')],{'transaction':_0x3e5afe})[_0x7293('0x27')](function(){if(!_[_0x7293('0x89')](_0x5b5b80)){return _0x505781[_0x7293('0x8a')](_0x5b5b80,{'transaction':_0x3e5afe});}})[_0x7293('0x27')](function(){_0x5b5b80[_0x7293('0x8b')](function(_0x5c5f11){socket['emit'](_0x7293('0x8c'),{'UserId':_0x5c5f11,'SmsQueueId':_0x505781['id']});});});});});});})[_0x7293('0x27')](respondWithStatusCode(_0x42fb85,null))[_0x7293('0x49')](handleError(_0x42fb85,null));};exports[_0x7293('0x8d')]=function(_0x1c2335,_0x22538b,_0x249165){return db['SmsQueue'][_0x7293('0x4c')]({'where':{'id':_0x1c2335[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x22538b,null))[_0x7293('0x27')](function(_0x5e3740){if(_0x5e3740){return _0x5e3740[_0x7293('0x8d')](_0x1c2335[_0x7293('0x54')]['ids'],_[_0x7293('0x8e')](_0x1c2335[_0x7293('0x54')],[_0x7293('0x76'),'id'])||{})[_0x7293('0x8f')](function(_0x538fa2){for(var _0x488d88=0x0;_0x488d88<_0x1c2335[_0x7293('0x54')][_0x7293('0x76')][_0x7293('0x3a')];_0x488d88+=0x1){socket[_0x7293('0x73')](_0x7293('0x74'),{'UserId':_0x1c2335[_0x7293('0x54')][_0x7293('0x76')][_0x488d88],'SmsQueueId':_0x1c2335[_0x7293('0x4b')]['id']});}return _0x538fa2;});}})['then'](respondWithResult(_0x22538b,null))[_0x7293('0x49')](handleError(_0x22538b,null));};exports[_0x7293('0x8a')]=function(_0x253b6d,_0x45314f,_0x3d1990){return db[_0x7293('0x2f')][_0x7293('0x4c')]({'where':{'id':_0x253b6d[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x45314f,null))[_0x7293('0x27')](function(_0x5b0316){if(_0x5b0316){return _0x5b0316['removeAgents'](_0x253b6d[_0x7293('0x34')][_0x7293('0x76')])[_0x7293('0x27')](function(){if(_[_0x7293('0x90')](_0x253b6d[_0x7293('0x34')]['ids'])){for(var _0x1efd3a=0x0;_0x1efd3a<_0x253b6d['query'][_0x7293('0x76')]['length'];_0x1efd3a+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x253b6d[_0x7293('0x34')][_0x7293('0x76')][_0x1efd3a]),'SmsQueueId':Number(_0x253b6d['params']['id'])});}}else{socket['emit'](_0x7293('0x8c'),{'UserId':Number(_0x253b6d[_0x7293('0x34')]['ids']),'SmsQueueId':Number(_0x253b6d[_0x7293('0x4b')]['id'])});}});}})[_0x7293('0x27')](respondWithStatusCode(_0x45314f,null))[_0x7293('0x49')](handleError(_0x45314f,null));};exports[_0x7293('0x91')]=function(_0x17cabb,_0x4c6606,_0x408fb6){var _0x15a1cb={};var _0x26918c={};var _0x10226e;var _0x5e7650;return db[_0x7293('0x2f')][_0x7293('0x58')]({'where':{'id':_0x17cabb[_0x7293('0x4b')]['id']}})[_0x7293('0x27')](handleEntityNotFound(_0x4c6606,null))[_0x7293('0x27')](function(_0x62544d){if(_0x62544d){_0x10226e=_0x62544d;_0x26918c['model']=_[_0x7293('0x35')](db['User'][_0x7293('0x30')]);_0x26918c[_0x7293('0x34')]=_[_0x7293('0x35')](_0x17cabb[_0x7293('0x34')]);_0x26918c[_0x7293('0x36')]=_[_0x7293('0x37')](_0x26918c[_0x7293('0x33')],_0x26918c['query']);_0x15a1cb[_0x7293('0x39')]=_['intersection'](_0x26918c[_0x7293('0x33')],qs[_0x7293('0x38')](_0x17cabb['query']['fields']));_0x15a1cb['attributes']=_0x15a1cb[_0x7293('0x39')]['length']?_0x15a1cb[_0x7293('0x39')]:_0x26918c[_0x7293('0x33')];_0x15a1cb[_0x7293('0x5b')]=qs[_0x7293('0x3e')](_0x17cabb[_0x7293('0x34')]['sort']);_0x15a1cb[_0x7293('0x41')]=qs['filters'](_[_0x7293('0x3f')](_0x17cabb[_0x7293('0x34')],_0x26918c[_0x7293('0x36')]));if(_0x17cabb[_0x7293('0x34')]['filter']){_0x15a1cb['where']=_['merge'](_0x15a1cb[_0x7293('0x41')],{'$or':_[_0x7293('0x2e')](_0x15a1cb['attributes'],function(_0x3867b2){var _0x5875a9={};_0x5875a9[_0x3867b2]={'$like':'%'+_0x17cabb[_0x7293('0x34')][_0x7293('0x40')]+'%'};return _0x5875a9;})});}_0x15a1cb=_[_0x7293('0x42')]({},_0x15a1cb,_0x17cabb[_0x7293('0x44')]);return _0x10226e[_0x7293('0x91')](_0x15a1cb);}})['then'](function(_0x1b40ab){if(_0x1b40ab){_0x5e7650=_0x1b40ab[_0x7293('0x3a')];if(!_0x17cabb[_0x7293('0x34')][_0x7293('0x3b')](_0x7293('0x5a'))){_0x15a1cb[_0x7293('0x3c')]=qs[_0x7293('0x3c')](_0x17cabb[_0x7293('0x34')][_0x7293('0x3c')]);_0x15a1cb['offset']=qs[_0x7293('0x3d')](_0x17cabb['query'][_0x7293('0x3d')]);}return _0x10226e[_0x7293('0x91')](_0x15a1cb);}})['then'](function(_0x21dac2){if(_0x21dac2){return _0x21dac2?{'count':_0x5e7650,'rows':_0x21dac2}:null;}})[_0x7293('0x27')](respondWithResult(_0x4c6606,null))[_0x7293('0x49')](handleError(_0x4c6606,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8a869e8..b151309 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 _0x3403=['SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3410fe,_0x48f9de){var _0x277fd2=function(_0x70231b){while(--_0x70231b){_0x3410fe['push'](_0x3410fe['shift']());}};_0x277fd2(++_0x48f9de);}(_0x3403,0x1b7));var _0x3340=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x3403[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0x3340('0x0'));var SmsQueue=require(_0x3340('0x1'))['db'][_0x3340('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3340('0x3')](0x0);var events={'afterCreate':_0x3340('0x4'),'afterUpdate':'update','afterDestroy':_0x3340('0x5')};function emitEvent(_0x4a9304){return function(_0x29c9db,_0xebee87,_0x584394){SmsQueueEvents[_0x3340('0x6')](_0x4a9304+':'+_0x29c9db['id'],_0x29c9db);SmsQueueEvents['emit'](_0x4a9304,_0x29c9db);_0x584394(null);};}for(var e in events){if(events[_0x3340('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x3340('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xe98f=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0xe98f,0xc1));var _0xfe98=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe98f[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0xfe98('0x0'));var SmsQueue=require(_0xfe98('0x1'))['db'][_0xfe98('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfe98('0x3')](0x0);var events={'afterCreate':_0xfe98('0x4'),'afterUpdate':_0xfe98('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34db78){return function(_0x1b7274,_0x13f20b,_0x345e0c){SmsQueueEvents[_0xfe98('0x6')](_0x34db78+':'+_0x1b7274['id'],_0x1b7274);SmsQueueEvents['emit'](_0x34db78,_0x1b7274);_0x345e0c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xfe98('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b94f1dd..39a0a75 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 _0xdf3b=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','api'];(function(_0x5de482,_0x1134d8){var _0x105db9=function(_0x5e5095){while(--_0x5e5095){_0x5de482['push'](_0x5de482['shift']());}};_0x105db9(++_0x1134d8);}(_0xdf3b,0x172));var _0xbdf3=function(_0x131acf,_0x4b4597){_0x131acf=_0x131acf-0x0;var _0x40d32e=_0xdf3b[_0x131acf];return _0x40d32e;};'use strict';var _=require('lodash');var util=require(_0xbdf3('0x0'));var logger=require('../../config/logger')(_0xbdf3('0x1'));var moment=require(_0xbdf3('0x2'));var BPromise=require(_0xbdf3('0x3'));var rp=require(_0xbdf3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdf3('0x5'));var config=require(_0xbdf3('0x6'));var attributes=require(_0xbdf3('0x7'));module[_0xbdf3('0x8')]=function(_0x46a1fe,_0x36aa91){return _0x46a1fe[_0xbdf3('0x9')](_0xbdf3('0xa'),attributes,{'tableName':_0xbdf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x325a=['../../config/environment','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x37f2ee,_0x3f26f5){var _0x24f7fc=function(_0x29b5cf){while(--_0x29b5cf){_0x37f2ee['push'](_0x37f2ee['shift']());}};_0x24f7fc(++_0x3f26f5);}(_0x325a,0x1b5));var _0xa325=function(_0x2ebd4d,_0x32e249){_0x2ebd4d=_0x2ebd4d-0x0;var _0x69cba3=_0x325a[_0x2ebd4d];return _0x69cba3;};'use strict';var _=require(_0xa325('0x0'));var util=require(_0xa325('0x1'));var logger=require('../../config/logger')(_0xa325('0x2'));var moment=require(_0xa325('0x3'));var BPromise=require('bluebird');var rp=require(_0xa325('0x4'));var fs=require('fs');var path=require(_0xa325('0x5'));var rimraf=require(_0xa325('0x6'));var config=require(_0xa325('0x7'));var attributes=require(_0xa325('0x8'));module['exports']=function(_0x829ff,_0x230144){return _0x829ff[_0xa325('0x9')](_0xa325('0xa'),attributes,{'tableName':_0xa325('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 4d89669..0dcded8 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 _0xb577=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','include','map','model','stringify','ShowSmsQueue','SmsQueue','find','lodash','util','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb577,0x1e8));var _0x7b57=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0xb577[_0x4f3e33];return _0x1a070c;};'use strict';var _=require(_0x7b57('0x0'));var util=require(_0x7b57('0x1'));var moment=require(_0x7b57('0x2'));var BPromise=require(_0x7b57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b57('0x4'));var db=require(_0x7b57('0x5'))['db'];var utils=require(_0x7b57('0x6'));var logger=require(_0x7b57('0x7'))('rpc');var config=require(_0x7b57('0x8'));var jayson=require(_0x7b57('0x9'));var client=jayson[_0x7b57('0xa')][_0x7b57('0xb')]({'port':0x232a});config[_0x7b57('0xc')]=_['defaults'](config[_0x7b57('0xc')],{'host':_0x7b57('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7b57('0xe'))[_0x7b57('0xf')](socket);function respondWithRpcPromise(_0x2db415,_0x49e5c2,_0x11205e){return new BPromise(function(_0x6e22a9,_0x4b97ce){return client[_0x7b57('0x10')](_0x2db415,_0x11205e)[_0x7b57('0x11')](function(_0x36ea0a){logger[_0x7b57('0x12')](_0x7b57('0x13'),_0x49e5c2,_0x7b57('0x14'));logger[_0x7b57('0x15')](_0x7b57('0x16'),_0x49e5c2,_0x7b57('0x14'),JSON['stringify'](_0x36ea0a));if(_0x36ea0a[_0x7b57('0x17')]){if(_0x36ea0a[_0x7b57('0x17')][_0x7b57('0x18')]===0x1f4){logger['error'](_0x7b57('0x13'),_0x49e5c2,_0x36ea0a[_0x7b57('0x17')][_0x7b57('0x19')]);return _0x4b97ce(_0x36ea0a['error']['message']);}logger[_0x7b57('0x17')](_0x7b57('0x13'),_0x49e5c2,_0x36ea0a[_0x7b57('0x17')]['message']);return _0x6e22a9(_0x36ea0a[_0x7b57('0x17')][_0x7b57('0x19')]);}else{logger['info'](_0x7b57('0x13'),_0x49e5c2,_0x7b57('0x14'));_0x6e22a9(_0x36ea0a[_0x7b57('0x1a')]['message']);}})[_0x7b57('0x1b')](function(_0x90c48a){logger[_0x7b57('0x17')](_0x7b57('0x13'),_0x49e5c2,_0x90c48a);_0x4b97ce(_0x90c48a);});});}exports[_0x7b57('0x1c')]=function(_0x4263b4){var _0x4fc450=this;return new Promise(function(_0xc3a258,_0x5d0c5e){return db['SmsQueue'][_0x7b57('0x1d')]({'raw':_0x4263b4['options']?_0x4263b4[_0x7b57('0x1e')][_0x7b57('0x1f')]===undefined?!![]:![]:!![],'where':_0x4263b4[_0x7b57('0x1e')]?_0x4263b4[_0x7b57('0x1e')][_0x7b57('0x20')]||null:null,'attributes':_0x4263b4[_0x7b57('0x1e')]?_0x4263b4['options'][_0x7b57('0x21')]||null:null,'limit':_0x4263b4['options']?_0x4263b4[_0x7b57('0x1e')]['limit']||null:null,'include':_0x4263b4[_0x7b57('0x1e')]?_0x4263b4[_0x7b57('0x1e')][_0x7b57('0x22')]?_[_0x7b57('0x23')](_0x4263b4[_0x7b57('0x1e')][_0x7b57('0x22')],function(_0x476650){return{'model':db[_0x476650[_0x7b57('0x24')]],'as':_0x476650['as'],'attributes':_0x476650[_0x7b57('0x21')],'include':_0x476650[_0x7b57('0x22')]?_['map'](_0x476650[_0x7b57('0x22')],function(_0x457752){return{'model':db[_0x457752['model']],'as':_0x457752['as'],'attributes':_0x457752['attributes'],'include':_0x457752[_0x7b57('0x22')]?_[_0x7b57('0x23')](_0x457752[_0x7b57('0x22')],function(_0x1b9756){return{'model':db[_0x1b9756['model']],'as':_0x1b9756['as'],'attributes':_0x1b9756[_0x7b57('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7b57('0x11')](function(_0x5d48a2){logger[_0x7b57('0x12')](_0x7b57('0x1c'),_0x4263b4);logger[_0x7b57('0x15')]('GetSmsQueue',_0x4263b4,JSON[_0x7b57('0x25')](_0x5d48a2));_0xc3a258(_0x5d48a2);})[_0x7b57('0x1b')](function(_0x2a3f24){logger['error'](_0x7b57('0x1c'),_0x2a3f24[_0x7b57('0x19')],_0x4263b4);_0x5d0c5e(_0x4fc450[_0x7b57('0x17')](0x1f4,_0x2a3f24[_0x7b57('0x19')]));});});};exports[_0x7b57('0x26')]=function(_0x364d1d){var _0x1ec839=this;return new Promise(function(_0x30979c,_0x445379){return db[_0x7b57('0x27')][_0x7b57('0x28')]({'raw':_0x364d1d[_0x7b57('0x1e')]?_0x364d1d['options'][_0x7b57('0x1f')]===undefined?!![]:![]:!![],'where':_0x364d1d[_0x7b57('0x1e')]?_0x364d1d[_0x7b57('0x1e')]['where']||null:null,'attributes':_0x364d1d[_0x7b57('0x1e')]?_0x364d1d[_0x7b57('0x1e')]['attributes']||null:null,'include':_0x364d1d[_0x7b57('0x1e')]?_0x364d1d[_0x7b57('0x1e')]['include']?_[_0x7b57('0x23')](_0x364d1d[_0x7b57('0x1e')][_0x7b57('0x22')],function(_0x1eb2cb){return{'model':db[_0x1eb2cb[_0x7b57('0x24')]],'as':_0x1eb2cb['as'],'attributes':_0x1eb2cb[_0x7b57('0x21')],'include':_0x1eb2cb[_0x7b57('0x22')]?_[_0x7b57('0x23')](_0x1eb2cb['include'],function(_0x1f323f){return{'model':db[_0x1f323f[_0x7b57('0x24')]],'as':_0x1f323f['as'],'attributes':_0x1f323f[_0x7b57('0x21')],'include':_0x1f323f[_0x7b57('0x22')]?_['map'](_0x1f323f['include'],function(_0x3ae852){return{'model':db[_0x3ae852['model']],'as':_0x3ae852['as'],'attributes':_0x3ae852[_0x7b57('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7b57('0x11')](function(_0x2b764d){logger[_0x7b57('0x12')](_0x7b57('0x26'),_0x364d1d);logger[_0x7b57('0x15')]('ShowSmsQueue',_0x364d1d,JSON[_0x7b57('0x25')](_0x2b764d));_0x30979c(_0x2b764d);})[_0x7b57('0x1b')](function(_0x2c8d85){logger['error'](_0x7b57('0x26'),_0x2c8d85[_0x7b57('0x19')],_0x364d1d);_0x445379(_0x1ec839['error'](0x1f4,_0x2c8d85[_0x7b57('0x19')]));});});}; \ No newline at end of file +var _0x4ae6=['options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','SmsQueue'];(function(_0x5cd5a0,_0x2c1335){var _0x5f2688=function(_0x2b3e19){while(--_0x2b3e19){_0x5cd5a0['push'](_0x5cd5a0['shift']());}};_0x5f2688(++_0x2c1335);}(_0x4ae6,0x7e));var _0x64ae=function(_0x53a375,_0x474d5c){_0x53a375=_0x53a375-0x0;var _0x3a46f4=_0x4ae6[_0x53a375];return _0x3a46f4;};'use strict';var _=require(_0x64ae('0x0'));var util=require(_0x64ae('0x1'));var moment=require(_0x64ae('0x2'));var BPromise=require(_0x64ae('0x3'));var rs=require(_0x64ae('0x4'));var fs=require('fs');var Redis=require(_0x64ae('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64ae('0x6'))(_0x64ae('0x7'));var config=require(_0x64ae('0x8'));var jayson=require(_0x64ae('0x9'));var client=jayson[_0x64ae('0xa')]['http']({'port':0x232a});config[_0x64ae('0xb')]=_[_0x64ae('0xc')](config[_0x64ae('0xb')],{'host':_0x64ae('0xd'),'port':0x18eb});var socket=require(_0x64ae('0xe'))(new Redis(config[_0x64ae('0xb')]));require(_0x64ae('0xf'))[_0x64ae('0x10')](socket);function respondWithRpcPromise(_0x43922c,_0x32a0e4,_0x532ce9){return new BPromise(function(_0x1216e0,_0x586bd0){return client['request'](_0x43922c,_0x532ce9)[_0x64ae('0x11')](function(_0x897a3c){logger[_0x64ae('0x12')](_0x64ae('0x13'),_0x32a0e4,_0x64ae('0x14'));logger[_0x64ae('0x15')](_0x64ae('0x16'),_0x32a0e4,_0x64ae('0x14'),JSON[_0x64ae('0x17')](_0x897a3c));if(_0x897a3c[_0x64ae('0x18')]){if(_0x897a3c[_0x64ae('0x18')][_0x64ae('0x19')]===0x1f4){logger[_0x64ae('0x18')]('SmsQueue,\x20%s,\x20%s',_0x32a0e4,_0x897a3c[_0x64ae('0x18')][_0x64ae('0x1a')]);return _0x586bd0(_0x897a3c['error'][_0x64ae('0x1a')]);}logger[_0x64ae('0x18')](_0x64ae('0x13'),_0x32a0e4,_0x897a3c[_0x64ae('0x18')][_0x64ae('0x1a')]);return _0x1216e0(_0x897a3c[_0x64ae('0x18')][_0x64ae('0x1a')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x32a0e4,_0x64ae('0x14'));_0x1216e0(_0x897a3c['result'][_0x64ae('0x1a')]);}})[_0x64ae('0x1b')](function(_0x5f3eda){logger['error'](_0x64ae('0x13'),_0x32a0e4,_0x5f3eda);_0x586bd0(_0x5f3eda);});});}exports[_0x64ae('0x1c')]=function(_0x267fd1){var _0x9303b1=this;return new Promise(function(_0x4396af,_0x11d356){return db[_0x64ae('0x1d')]['findAll']({'raw':_0x267fd1[_0x64ae('0x1e')]?_0x267fd1[_0x64ae('0x1e')][_0x64ae('0x1f')]===undefined?!![]:![]:!![],'where':_0x267fd1[_0x64ae('0x1e')]?_0x267fd1[_0x64ae('0x1e')][_0x64ae('0x20')]||null:null,'attributes':_0x267fd1[_0x64ae('0x1e')]?_0x267fd1[_0x64ae('0x1e')][_0x64ae('0x21')]||null:null,'limit':_0x267fd1[_0x64ae('0x1e')]?_0x267fd1[_0x64ae('0x1e')][_0x64ae('0x22')]||null:null,'include':_0x267fd1['options']?_0x267fd1['options'][_0x64ae('0x23')]?_[_0x64ae('0x24')](_0x267fd1[_0x64ae('0x1e')][_0x64ae('0x23')],function(_0x2f631e){return{'model':db[_0x2f631e[_0x64ae('0x25')]],'as':_0x2f631e['as'],'attributes':_0x2f631e[_0x64ae('0x21')],'include':_0x2f631e['include']?_[_0x64ae('0x24')](_0x2f631e[_0x64ae('0x23')],function(_0x1e3bbd){return{'model':db[_0x1e3bbd[_0x64ae('0x25')]],'as':_0x1e3bbd['as'],'attributes':_0x1e3bbd['attributes'],'include':_0x1e3bbd[_0x64ae('0x23')]?_[_0x64ae('0x24')](_0x1e3bbd[_0x64ae('0x23')],function(_0x28b749){return{'model':db[_0x28b749[_0x64ae('0x25')]],'as':_0x28b749['as'],'attributes':_0x28b749[_0x64ae('0x21')]};}):[]};}):[]};}):[]:[]})[_0x64ae('0x11')](function(_0x347309){logger[_0x64ae('0x12')](_0x64ae('0x1c'),_0x267fd1);logger[_0x64ae('0x15')]('GetSmsQueue',_0x267fd1,JSON[_0x64ae('0x17')](_0x347309));_0x4396af(_0x347309);})[_0x64ae('0x1b')](function(_0x1f99a9){logger[_0x64ae('0x18')]('GetSmsQueue',_0x1f99a9[_0x64ae('0x1a')],_0x267fd1);_0x11d356(_0x9303b1['error'](0x1f4,_0x1f99a9[_0x64ae('0x1a')]));});});};exports[_0x64ae('0x26')]=function(_0x2b0a8c){var _0x4fe9dd=this;return new Promise(function(_0x792df6,_0x5921de){return db[_0x64ae('0x1d')]['find']({'raw':_0x2b0a8c[_0x64ae('0x1e')]?_0x2b0a8c['options'][_0x64ae('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b0a8c['options']?_0x2b0a8c[_0x64ae('0x1e')]['where']||null:null,'attributes':_0x2b0a8c[_0x64ae('0x1e')]?_0x2b0a8c[_0x64ae('0x1e')]['attributes']||null:null,'include':_0x2b0a8c['options']?_0x2b0a8c['options']['include']?_['map'](_0x2b0a8c[_0x64ae('0x1e')][_0x64ae('0x23')],function(_0x5d7da2){return{'model':db[_0x5d7da2[_0x64ae('0x25')]],'as':_0x5d7da2['as'],'attributes':_0x5d7da2[_0x64ae('0x21')],'include':_0x5d7da2['include']?_['map'](_0x5d7da2['include'],function(_0x5c5304){return{'model':db[_0x5c5304[_0x64ae('0x25')]],'as':_0x5c5304['as'],'attributes':_0x5c5304['attributes'],'include':_0x5c5304[_0x64ae('0x23')]?_[_0x64ae('0x24')](_0x5c5304[_0x64ae('0x23')],function(_0x2fe7a3){return{'model':db[_0x2fe7a3[_0x64ae('0x25')]],'as':_0x2fe7a3['as'],'attributes':_0x2fe7a3[_0x64ae('0x21')]};}):[]};}):[]};}):[]:[]})[_0x64ae('0x11')](function(_0x2d9de0){logger[_0x64ae('0x12')](_0x64ae('0x26'),_0x2b0a8c);logger['debug'](_0x64ae('0x26'),_0x2b0a8c,JSON[_0x64ae('0x17')](_0x2d9de0));_0x792df6(_0x2d9de0);})[_0x64ae('0x1b')](function(_0x39cf49){logger[_0x64ae('0x18')](_0x64ae('0x26'),_0x39cf49[_0x64ae('0x1a')],_0x2b0a8c);_0x5921de(_0x4fe9dd[_0x64ae('0x18')](0x1f4,_0x39cf49[_0x64ae('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index f34ada3..c4bc5b0 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 _0x57af=['register','length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x57af,0x6f));var _0xf57a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x57af[_0x13d07a];return _0x5ee0ee;};'use strict';var SmsQueueEvents=require(_0xf57a('0x0'));var events=[_0xf57a('0x1'),_0xf57a('0x2'),_0xf57a('0x3')];function createListener(_0x2ee9c1,_0x4bccb4){return function(_0x5d8346){_0x4bccb4[_0xf57a('0x4')](_0x2ee9c1,_0x5d8346);};}function removeListener(_0x5ee378,_0x54187d){return function(){SmsQueueEvents[_0xf57a('0x5')](_0x5ee378,_0x54187d);};}exports[_0xf57a('0x6')]=function(_0xef98fc){for(var _0x377d80=0x0,_0xf37a67=events[_0xf57a('0x7')];_0x377d80<_0xf37a67;_0x377d80++){var _0xd63224=events[_0x377d80];var _0x25ec72=createListener(_0xf57a('0x8')+_0xd63224,_0xef98fc);SmsQueueEvents['on'](_0xd63224,_0x25ec72);}}; \ No newline at end of file +var _0x1769=['smsQueue:','./smsQueue.events','save','removeListener','register'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1769,0xf6));var _0x9176=function(_0x3821fb,_0x5df0d7){_0x3821fb=_0x3821fb-0x0;var _0x55fe75=_0x1769[_0x3821fb];return _0x55fe75;};'use strict';var SmsQueueEvents=require(_0x9176('0x0'));var events=[_0x9176('0x1'),'remove','update'];function createListener(_0xa3757c,_0x3ea7a7){return function(_0xa24789){_0x3ea7a7['emit'](_0xa3757c,_0xa24789);};}function removeListener(_0x29d6f9,_0x221ac9){return function(){SmsQueueEvents[_0x9176('0x2')](_0x29d6f9,_0x221ac9);};}exports[_0x9176('0x3')]=function(_0x2bdd2c){for(var _0xed6fc8=0x0,_0x140235=events['length'];_0xed6fc8<_0x140235;_0xed6fc8++){var _0x4b15ee=events[_0xed6fc8];var _0x4311b4=createListener(_0x9176('0x4')+_0x4b15ee,_0x2bdd2c);SmsQueueEvents['on'](_0x4b15ee,_0x4311b4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f70acdf..73ea517 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 _0xf796=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf796,0x7c));var _0x6f79=function(_0x5162b2,_0x1e3779){_0x5162b2=_0x5162b2-0x0;var _0x4c1063=_0xf796[_0x5162b2];return _0x4c1063;};'use strict';var multer=require(_0x6f79('0x0'));var util=require('util');var path=require(_0x6f79('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f79('0x2'));var router=express[_0x6f79('0x3')]();var auth=require(_0x6f79('0x4'));var interaction=require(_0x6f79('0x5'));var config=require(_0x6f79('0x6'));var controller=require(_0x6f79('0x7'));router[_0x6f79('0x8')]('/',auth[_0x6f79('0x9')](),controller[_0x6f79('0xa')]);router[_0x6f79('0x8')](_0x6f79('0xb'),auth[_0x6f79('0x9')](),controller[_0x6f79('0xc')]);router[_0x6f79('0x8')](_0x6f79('0xd'),auth[_0x6f79('0x9')](),controller[_0x6f79('0xe')]);router[_0x6f79('0xf')]('/',auth[_0x6f79('0x9')](),controller['create']);router[_0x6f79('0x10')]('/:id',auth[_0x6f79('0x9')](),controller[_0x6f79('0x11')]);router[_0x6f79('0x12')](_0x6f79('0xd'),auth['isAuthenticated'](),controller[_0x6f79('0x13')]);module[_0x6f79('0x14')]=router; \ No newline at end of file +var _0x32a9=['./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x11e7a7,_0x9c230a){var _0x16c26e=function(_0x39d7d6){while(--_0x39d7d6){_0x11e7a7['push'](_0x11e7a7['shift']());}};_0x16c26e(++_0x9c230a);}(_0x32a9,0xe3));var _0x932a=function(_0x29ce17,_0x100ee2){_0x29ce17=_0x29ce17-0x0;var _0x51bf75=_0x32a9[_0x29ce17];return _0x51bf75;};'use strict';var multer=require(_0x932a('0x0'));var util=require(_0x932a('0x1'));var path=require(_0x932a('0x2'));var timeout=require(_0x932a('0x3'));var express=require(_0x932a('0x4'));var router=express[_0x932a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x932a('0x6'));var config=require('../../config/environment');var controller=require(_0x932a('0x7'));router[_0x932a('0x8')]('/',auth[_0x932a('0x9')](),controller[_0x932a('0xa')]);router[_0x932a('0x8')](_0x932a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x932a('0x8')](_0x932a('0xc'),auth[_0x932a('0x9')](),controller[_0x932a('0xd')]);router['post']('/',auth[_0x932a('0x9')](),controller['create']);router['put'](_0x932a('0xc'),auth[_0x932a('0x9')](),controller[_0x932a('0xe')]);router[_0x932a('0xf')](_0x932a('0xc'),auth['isAuthenticated'](),controller[_0x932a('0x10')]);module[_0x932a('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 3ea8a4d..1c1d45e 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 _0x7d75=['sequelize','exports','STRING','DATE','moment'];(function(_0x282f79,_0x1c1417){var _0x3bbdeb=function(_0x441de6){while(--_0x441de6){_0x282f79['push'](_0x282f79['shift']());}};_0x3bbdeb(++_0x1c1417);}(_0x7d75,0x1e9));var _0x57d7=function(_0x2ae232,_0x4e0754){_0x2ae232=_0x2ae232-0x0;var _0x36deae=_0x7d75[_0x2ae232];return _0x36deae;};'use strict';var moment=require(_0x57d7('0x0'));var Sequelize=require(_0x57d7('0x1'));module[_0x57d7('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x57d7('0x3')]},'joinAt':{'type':Sequelize[_0x57d7('0x4')]},'leaveAt':{'type':Sequelize[_0x57d7('0x4')]},'acceptAt':{'type':Sequelize[_0x57d7('0x4')]},'exitAt':{'type':Sequelize[_0x57d7('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x850c=['DATE','moment','sequelize','exports','STRING'];(function(_0x1347ff,_0x2c9340){var _0x335d6a=function(_0x33eaa0){while(--_0x33eaa0){_0x1347ff['push'](_0x1347ff['shift']());}};_0x335d6a(++_0x2c9340);}(_0x850c,0x1cd));var _0xc850=function(_0x12a3e5,_0x972d2e){_0x12a3e5=_0x12a3e5-0x0;var _0x2ba48e=_0x850c[_0x12a3e5];return _0x2ba48e;};'use strict';var moment=require(_0xc850('0x0'));var Sequelize=require(_0xc850('0x1'));module[_0xc850('0x2')]={'uniqueid':{'type':Sequelize[_0xc850('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc850('0x3')]},'joinAt':{'type':Sequelize[_0xc850('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc850('0x4')]},'exitAt':{'type':Sequelize[_0xc850('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f0731e8..0ec8ae4 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 _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']),_0x23b061);if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SmsQueueReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SmsQueueReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file +var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','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','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x1b664d,_0x1d8695){var _0x43af6b=function(_0x7fe8b2){while(--_0x7fe8b2){_0x1b664d['push'](_0x1b664d['shift']());}};_0x43af6b(++_0x1d8695);}(_0x814b,0x1a2));var _0xb814=function(_0x5c96eb,_0x5404da){_0x5c96eb=_0x5c96eb-0x0;var _0x4ddbad=_0x814b[_0x5c96eb];return _0x4ddbad;};'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'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 905a174..2c32a19 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 _0x38a5=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x424c0f,_0x31a27d){var _0x265bf4=function(_0x419f69){while(--_0x419f69){_0x424c0f['push'](_0x424c0f['shift']());}};_0x265bf4(++_0x31a27d);}(_0x38a5,0x69));var _0x538a=function(_0x41296f,_0x4c1ffb){_0x41296f=_0x41296f-0x0;var _0x160a49=_0x38a5[_0x41296f];return _0x160a49;};'use strict';var _=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var logger=require(_0x538a('0x2'))(_0x538a('0x3'));var moment=require('moment');var BPromise=require(_0x538a('0x4'));var rp=require(_0x538a('0x5'));var fs=require('fs');var path=require(_0x538a('0x6'));var rimraf=require(_0x538a('0x7'));var config=require(_0x538a('0x8'));var attributes=require(_0x538a('0x9'));module[_0x538a('0xa')]=function(_0x16ab09,_0x1e3587){return _0x16ab09[_0x538a('0xb')](_0x538a('0xc'),attributes,{'tableName':_0x538a('0xd'),'paranoid':![],'indexes':[{'name':_0x538a('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2b4=['exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c0b7d,_0xb0ac76){var _0x4596ee=function(_0x392b81){while(--_0x392b81){_0x3c0b7d['push'](_0x3c0b7d['shift']());}};_0x4596ee(++_0xb0ac76);}(_0xe2b4,0x1d3));var _0x4e2b=function(_0x1a0abf,_0xe9a497){_0x1a0abf=_0x1a0abf-0x0;var _0x25409c=_0xe2b4[_0x1a0abf];return _0x25409c;};'use strict';var _=require(_0x4e2b('0x0'));var util=require('util');var logger=require(_0x4e2b('0x1'))(_0x4e2b('0x2'));var moment=require(_0x4e2b('0x3'));var BPromise=require(_0x4e2b('0x4'));var rp=require(_0x4e2b('0x5'));var fs=require('fs');var path=require(_0x4e2b('0x6'));var rimraf=require(_0x4e2b('0x7'));var config=require(_0x4e2b('0x8'));var attributes=require('./smsQueueReport.attributes');module[_0x4e2b('0x9')]=function(_0x1fffcd,_0x85b152){return _0x1fffcd[_0x4e2b('0xa')](_0x4e2b('0xb'),attributes,{'tableName':_0x4e2b('0xc'),'paranoid':![],'indexes':[{'name':_0x4e2b('0xd'),'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 3e1a7e1..08ee396 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 _0x48e3=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsQueueReport','create','raw','stringify','UpdateSmsQueueReport','SmsQueueReport','update','options','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x27b3c1,_0x224593){var _0x131c65=function(_0x3fcd58){while(--_0x3fcd58){_0x27b3c1['push'](_0x27b3c1['shift']());}};_0x131c65(++_0x224593);}(_0x48e3,0x151));var _0x348e=function(_0x49f447,_0x5907fe){_0x49f447=_0x49f447-0x0;var _0x2a05fd=_0x48e3[_0x49f447];return _0x2a05fd;};'use strict';var _=require(_0x348e('0x0'));var util=require(_0x348e('0x1'));var moment=require('moment');var BPromise=require(_0x348e('0x2'));var rs=require(_0x348e('0x3'));var fs=require('fs');var Redis=require(_0x348e('0x4'));var db=require(_0x348e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x348e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x348e('0x7'));var client=jayson[_0x348e('0x8')][_0x348e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e88ee,_0x3bd432,_0x5f1192){return new BPromise(function(_0x4c43c6,_0x36f041){return client[_0x348e('0xa')](_0x3e88ee,_0x5f1192)[_0x348e('0xb')](function(_0x3b57ab){logger[_0x348e('0xc')](_0x348e('0xd'),_0x3bd432,_0x348e('0xe'));logger[_0x348e('0xf')](_0x348e('0x10'),_0x3bd432,_0x348e('0xe'),JSON['stringify'](_0x3b57ab));if(_0x3b57ab[_0x348e('0x11')]){if(_0x3b57ab['error'][_0x348e('0x12')]===0x1f4){logger[_0x348e('0x11')](_0x348e('0xd'),_0x3bd432,_0x3b57ab[_0x348e('0x11')][_0x348e('0x13')]);return _0x36f041(_0x3b57ab['error'][_0x348e('0x13')]);}logger[_0x348e('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x3bd432,_0x3b57ab['error'][_0x348e('0x13')]);return _0x4c43c6(_0x3b57ab[_0x348e('0x11')][_0x348e('0x13')]);}else{logger['info'](_0x348e('0xd'),_0x3bd432,'request\x20sent');_0x4c43c6(_0x3b57ab[_0x348e('0x14')]['message']);}})[_0x348e('0x15')](function(_0x3fa247){logger['error'](_0x348e('0xd'),_0x3bd432,_0x3fa247);_0x36f041(_0x3fa247);});});}exports[_0x348e('0x16')]=function(_0x58f4b8){var _0x5a6c9b=this;return new Promise(function(_0x5a4425,_0x482279){return db['SmsQueueReport'][_0x348e('0x17')](_0x58f4b8['body'],{'raw':_0x58f4b8['options']?_0x58f4b8['options'][_0x348e('0x18')]===undefined?!![]:![]:!![]})[_0x348e('0xb')](function(_0x276fbd){logger[_0x348e('0xc')](_0x348e('0x16'),_0x58f4b8);logger[_0x348e('0xf')]('CreateSmsQueueReport',_0x58f4b8,JSON[_0x348e('0x19')](_0x276fbd));_0x5a4425(_0x276fbd);})[_0x348e('0x15')](function(_0x41267e){logger['error'](_0x348e('0x16'),_0x41267e[_0x348e('0x13')],_0x58f4b8);_0x482279(_0x5a6c9b[_0x348e('0x11')](0x1f4,_0x41267e[_0x348e('0x13')]));});});};exports[_0x348e('0x1a')]=function(_0x4177c1){var _0x4e080b=this;return new Promise(function(_0x58e876,_0x30b8fa){return db[_0x348e('0x1b')][_0x348e('0x1c')](_0x4177c1['body'],{'raw':_0x4177c1[_0x348e('0x1d')]?_0x4177c1['options'][_0x348e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4177c1[_0x348e('0x1d')]?_0x4177c1['options']['where']||null:null,'attributes':_0x4177c1[_0x348e('0x1d')]?_0x4177c1[_0x348e('0x1d')][_0x348e('0x1e')]||null:null,'limit':_0x4177c1[_0x348e('0x1d')]?_0x4177c1['options'][_0x348e('0x1f')]||null:null})[_0x348e('0xb')](function(_0x355974){logger[_0x348e('0xc')](_0x348e('0x1a'),_0x4177c1);logger['debug'](_0x348e('0x1a'),_0x4177c1,JSON[_0x348e('0x19')](_0x355974));_0x58e876(_0x355974);})['catch'](function(_0xc142b5){logger[_0x348e('0x11')]('UpdateSmsQueueReport',_0xc142b5['message'],_0x4177c1);_0x30b8fa(_0x4e080b[_0x348e('0x11')](0x1f4,_0xc142b5[_0x348e('0x13')]));});});}; \ No newline at end of file +var _0xed7c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','update','where','limit','UpdateSmsQueueReport','lodash'];(function(_0x44606e,_0x2bf244){var _0xe68388=function(_0x488a30){while(--_0x488a30){_0x44606e['push'](_0x44606e['shift']());}};_0xe68388(++_0x2bf244);}(_0xed7c,0x1a3));var _0xced7=function(_0x2004f2,_0x31f4d3){_0x2004f2=_0x2004f2-0x0;var _0x1a860f=_0xed7c[_0x2004f2];return _0x1a860f;};'use strict';var _=require(_0xced7('0x0'));var util=require(_0xced7('0x1'));var moment=require(_0xced7('0x2'));var BPromise=require(_0xced7('0x3'));var rs=require(_0xced7('0x4'));var fs=require('fs');var Redis=require(_0xced7('0x5'));var db=require(_0xced7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xced7('0x7'))(_0xced7('0x8'));var config=require(_0xced7('0x9'));var jayson=require(_0xced7('0xa'));var client=jayson[_0xced7('0xb')][_0xced7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x549e03,_0x2af5ae,_0x412dad){return new BPromise(function(_0x1c255c,_0x30470f){return client[_0xced7('0xd')](_0x549e03,_0x412dad)[_0xced7('0xe')](function(_0x30a692){logger[_0xced7('0xf')](_0xced7('0x10'),_0x2af5ae,'request\x20sent');logger[_0xced7('0x11')](_0xced7('0x12'),_0x2af5ae,_0xced7('0x13'),JSON[_0xced7('0x14')](_0x30a692));if(_0x30a692[_0xced7('0x15')]){if(_0x30a692[_0xced7('0x15')]['code']===0x1f4){logger['error'](_0xced7('0x10'),_0x2af5ae,_0x30a692[_0xced7('0x15')]['message']);return _0x30470f(_0x30a692[_0xced7('0x15')][_0xced7('0x16')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2af5ae,_0x30a692['error'][_0xced7('0x16')]);return _0x1c255c(_0x30a692[_0xced7('0x15')][_0xced7('0x16')]);}else{logger[_0xced7('0xf')](_0xced7('0x10'),_0x2af5ae,'request\x20sent');_0x1c255c(_0x30a692[_0xced7('0x17')][_0xced7('0x16')]);}})[_0xced7('0x18')](function(_0x14c582){logger[_0xced7('0x15')](_0xced7('0x10'),_0x2af5ae,_0x14c582);_0x30470f(_0x14c582);});});}exports['CreateSmsQueueReport']=function(_0x4b1041){var _0x45ed60=this;return new Promise(function(_0x5c5476,_0x558646){return db[_0xced7('0x19')][_0xced7('0x1a')](_0x4b1041[_0xced7('0x1b')],{'raw':_0x4b1041[_0xced7('0x1c')]?_0x4b1041[_0xced7('0x1c')][_0xced7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5085b5){logger[_0xced7('0xf')]('CreateSmsQueueReport',_0x4b1041);logger['debug'](_0xced7('0x1e'),_0x4b1041,JSON[_0xced7('0x14')](_0x5085b5));_0x5c5476(_0x5085b5);})[_0xced7('0x18')](function(_0x30bf1a){logger['error']('CreateSmsQueueReport',_0x30bf1a[_0xced7('0x16')],_0x4b1041);_0x558646(_0x45ed60[_0xced7('0x15')](0x1f4,_0x30bf1a[_0xced7('0x16')]));});});};exports['UpdateSmsQueueReport']=function(_0x570e2a){var _0x2ae863=this;return new Promise(function(_0x4f09ec,_0x3322f3){return db[_0xced7('0x19')][_0xced7('0x1f')](_0x570e2a[_0xced7('0x1b')],{'raw':_0x570e2a[_0xced7('0x1c')]?_0x570e2a[_0xced7('0x1c')][_0xced7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x570e2a[_0xced7('0x1c')]?_0x570e2a[_0xced7('0x1c')][_0xced7('0x20')]||null:null,'attributes':_0x570e2a['options']?_0x570e2a[_0xced7('0x1c')]['attributes']||null:null,'limit':_0x570e2a['options']?_0x570e2a[_0xced7('0x1c')][_0xced7('0x21')]||null:null})[_0xced7('0xe')](function(_0x36b1bd){logger[_0xced7('0xf')](_0xced7('0x22'),_0x570e2a);logger[_0xced7('0x11')](_0xced7('0x22'),_0x570e2a,JSON[_0xced7('0x14')](_0x36b1bd));_0x4f09ec(_0x36b1bd);})['catch'](function(_0x11f708){logger[_0xced7('0x15')](_0xced7('0x22'),_0x11f708[_0xced7('0x16')],_0x570e2a);_0x3322f3(_0x2ae863['error'](0x1f4,_0x11f708[_0xced7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b70b7dd..1c57171 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 _0x5c00=['put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x16b994,_0x22872a){var _0xfc3e0f=function(_0x32d1d8){while(--_0x32d1d8){_0x16b994['push'](_0x16b994['shift']());}};_0xfc3e0f(++_0x22872a);}(_0x5c00,0x17e));var _0x05c0=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x5c00[_0x54aea3];return _0x21ae46;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var auth=require(_0x05c0('0x4'));var interaction=require(_0x05c0('0x5'));var config=require(_0x05c0('0x6'));var controller=require(_0x05c0('0x7'));router['get']('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x9')]);router[_0x05c0('0xa')](_0x05c0('0xb'),auth['isAuthenticated'](),controller[_0x05c0('0xc')]);router[_0x05c0('0xa')](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0xe')]);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x8')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')](_0x05c0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x05c0('0x12')]('/:id',auth[_0x05c0('0x8')](),controller[_0x05c0('0x13')]);module[_0x05c0('0x14')]=router; \ No newline at end of file +var _0x2547=['../../config/environment','get','isAuthenticated','index','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x9712cb,_0x265691){var _0xe189ca=function(_0x132ede){while(--_0x132ede){_0x9712cb['push'](_0x9712cb['shift']());}};_0xe189ca(++_0x265691);}(_0x2547,0x1cd));var _0x7254=function(_0x541914,_0x3ca679){_0x541914=_0x541914-0x0;var _0x56c3f9=_0x2547[_0x541914];return _0x56c3f9;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var auth=require(_0x7254('0x5'));var interaction=require(_0x7254('0x6'));var config=require(_0x7254('0x7'));var controller=require('./smsTransferReport.controller');router[_0x7254('0x8')]('/',auth[_0x7254('0x9')](),controller[_0x7254('0xa')]);router[_0x7254('0x8')]('/describe',auth[_0x7254('0x9')](),controller[_0x7254('0xb')]);router[_0x7254('0x8')]('/:id',auth[_0x7254('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7254('0xc')]);router[_0x7254('0xd')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0xf')]);router[_0x7254('0x10')]('/:id',auth[_0x7254('0x9')](),controller['destroy']);module[_0x7254('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 24df2c2..377b979 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 _0x5533=['NOW','STRING','ENUM','account','agent','queue','DATE'];(function(_0x158ff5,_0x2510b7){var _0x2f2597=function(_0x87870c){while(--_0x87870c){_0x158ff5['push'](_0x158ff5['shift']());}};_0x2f2597(++_0x2510b7);}(_0x5533,0x8d));var _0x3553=function(_0x4e23f5,_0x47bc1f){_0x4e23f5=_0x4e23f5-0x0;var _0x11e69d=_0x5533[_0x4e23f5];return _0x11e69d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3553('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x3553('0x1')](_0x3553('0x2'),_0x3553('0x3'),_0x3553('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3553('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x3553('0x6')]}}; \ No newline at end of file +var _0x7998=['exports','STRING','ENUM','account','agent','queue','DATE','NOW','sequelize'];(function(_0x49cf25,_0x5b2381){var _0x2bcb71=function(_0x358dc7){while(--_0x358dc7){_0x49cf25['push'](_0x49cf25['shift']());}};_0x2bcb71(++_0x5b2381);}(_0x7998,0x10d));var _0x8799=function(_0x234545,_0x17b059){_0x234545=_0x234545-0x0;var _0x46159b=_0x7998[_0x234545];return _0x46159b;};'use strict';var moment=require('moment');var Sequelize=require(_0x8799('0x0'));module[_0x8799('0x1')]={'uniqueid':{'type':Sequelize[_0x8799('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8799('0x3')](_0x8799('0x4'),_0x8799('0x5'),_0x8799('0x6')),'allowNull':![],'defaultValue':_0x8799('0x6')},'transferredAt':{'type':Sequelize[_0x8799('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8799('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index ed7da48..21d3f05 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 _0xd8b0=['intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','SmsTransferReport','count','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys'];(function(_0x5ba580,_0x591c61){var _0xb5894f=function(_0x4ca3b2){while(--_0x4ca3b2){_0x5ba580['push'](_0x5ba580['shift']());}};_0xb5894f(++_0x591c61);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={},_0x28f639={},_0x3ef745={'count':0x0,'rows':[]};var _0x4c05ee=_[_0x0d8b('0x28')](db['SmsTransferReport'][_0x0d8b('0x29')],function(_0x4b59e5){return{'name':_0x4b59e5[_0x0d8b('0x2a')],'type':_0x4b59e5['type'][_0x0d8b('0x2b')]};});_0x28f639['model']=_[_0x0d8b('0x28')](_0x4c05ee,'name');_0x28f639[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0xa2af02[_0x0d8b('0x2c')]);_0x28f639['filters']=_['intersection'](_0x28f639['model'],_0x28f639[_0x0d8b('0x2c')]);_0x59a905['attributes']=_[_0x0d8b('0x2e')](_0x28f639['model'],qs['fields'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x2f')]));_0x59a905[_0x0d8b('0x30')]=_0x59a905[_0x0d8b('0x30')][_0x0d8b('0x31')]?_0x59a905[_0x0d8b('0x30')]:_0x28f639[_0x0d8b('0x32')];if(!_0xa2af02[_0x0d8b('0x2c')]['hasOwnProperty'](_0x0d8b('0x33'))){_0x59a905[_0x0d8b('0x1b')]=qs['limit'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x59a905[_0x0d8b('0x1a')]=qs['offset'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x59a905[_0x0d8b('0x34')]=qs[_0x0d8b('0x35')](_0xa2af02[_0x0d8b('0x2c')]['sort']);_0x59a905[_0x0d8b('0x36')]=qs[_0x0d8b('0x37')](_['pick'](_0xa2af02[_0x0d8b('0x2c')],_0x28f639[_0x0d8b('0x37')]),_0x4c05ee);if(_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x59a905[_0x0d8b('0x36')]=_['merge'](_0x59a905['where'],{'$or':_[_0x0d8b('0x28')](_0x4c05ee,function(_0x5c2c04){if(_0x5c2c04['type']!==_0x0d8b('0x39')){var _0x2e279c={};_0x2e279c[_0x5c2c04[_0x0d8b('0x25')]]={'$like':'%'+_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x2e279c;}})});}_0x59a905=_[_0x0d8b('0x3a')]({},_0x59a905,_0xa2af02['options']);var _0x6e5bab={'where':_0x59a905[_0x0d8b('0x36')]};return db[_0x0d8b('0x3b')][_0x0d8b('0x3c')](_0x6e5bab)[_0x0d8b('0x22')](function(_0x1a39ad){_0x3ef745[_0x0d8b('0x3c')]=_0x1a39ad;if(_0xa2af02['query'][_0x0d8b('0x3d')]){_0x59a905[_0x0d8b('0x3e')]=[{'all':!![]}];}return db[_0x0d8b('0x3b')][_0x0d8b('0x3f')](_0x59a905);})['then'](function(_0xe0bf42){_0x3ef745['rows']=_0xe0bf42;return _0x3ef745;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4fe6f9,_0x59a905))[_0x0d8b('0x40')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x41')]=function(_0x26ac10,_0x35fa7e){var _0x3e632e={'raw':!![],'where':{'id':_0x26ac10[_0x0d8b('0x42')]['id']}},_0x1ff17d={};_0x1ff17d[_0x0d8b('0x32')]=_[_0x0d8b('0x2d')](db['SmsTransferReport']['rawAttributes']);_0x1ff17d['query']=_['keys'](_0x26ac10['query']);_0x1ff17d[_0x0d8b('0x37')]=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],_0x1ff17d['query']);_0x3e632e['attributes']=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],qs[_0x0d8b('0x2f')](_0x26ac10['query'][_0x0d8b('0x2f')]));_0x3e632e[_0x0d8b('0x30')]=_0x3e632e['attributes']['length']?_0x3e632e[_0x0d8b('0x30')]:_0x1ff17d['model'];if(_0x26ac10[_0x0d8b('0x2c')]['includeAll']){_0x3e632e['include']=[{'all':!![]}];}_0x3e632e=_[_0x0d8b('0x3a')]({},_0x3e632e,_0x26ac10[_0x0d8b('0x43')]);return db['SmsTransferReport']['find'](_0x3e632e)['then'](handleEntityNotFound(_0x35fa7e,null))['then'](respondWithResult(_0x35fa7e,null))[_0x0d8b('0x40')](handleError(_0x35fa7e,null));};exports[_0x0d8b('0x44')]=function(_0xd9d4c3,_0x490eda){return db[_0x0d8b('0x3b')][_0x0d8b('0x44')](_0xd9d4c3[_0x0d8b('0x45')],{})[_0x0d8b('0x22')](respondWithResult(_0x490eda,0xc9))[_0x0d8b('0x40')](handleError(_0x490eda,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x45')]['id']){delete _0x11d22b[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x3b')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x45')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x40')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x47')]=function(_0x574b90,_0x371fa0){return db['SmsTransferReport']['find']({'where':{'id':_0x574b90[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x371fa0,null))[_0x0d8b('0x22')](removeEntity(_0x371fa0,null))[_0x0d8b('0x40')](handleError(_0x371fa0,null));};exports['describe']=function(_0x131579,_0x1106d6){return db[_0x0d8b('0x3b')][_0x0d8b('0x48')]()[_0x0d8b('0x22')](respondWithResult(_0x1106d6,null))['catch'](handleError(_0x1106d6,null));}; \ No newline at end of file +var _0xa9e0=['merge','options','include','findAll','catch','params','includeAll','create','body','find','describe','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','end','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL'];(function(_0x5c5c44,_0x3f5404){var _0x16396f=function(_0x20cfb7){while(--_0x20cfb7){_0x5c5c44['push'](_0x5c5c44['shift']());}};_0x16396f(++_0x3f5404);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x45')]=function(_0x3fe430,_0x4f7240){return db['SmsTransferReport']['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,null))[_0x0a9e('0x3f')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 503ed1c..1c945dd 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 _0xba34=['./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x652914,_0xa0fbc5){var _0x334b9a=function(_0xdb326d){while(--_0xdb326d){_0x652914['push'](_0x652914['shift']());}};_0x334b9a(++_0xa0fbc5);}(_0xba34,0x119));var _0x4ba3=function(_0x1481a2,_0x4dc59c){_0x1481a2=_0x1481a2-0x0;var _0x13cafa=_0xba34[_0x1481a2];return _0x13cafa;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('SmsTransferReport',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5334=['api','moment','request-promise','rimraf','../../config/environment','uniqueid','lodash','util','../../config/logger'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x5334,0x84));var _0x4533=function(_0x2cf24e,_0x41c166){_0x2cf24e=_0x2cf24e-0x0;var _0x5a9c66=_0x5334[_0x2cf24e];return _0x5a9c66;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4533('0x6'));var config=require(_0x4533('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x51b4ce,_0x201673){return _0x51b4ce['define']('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x4533('0x8'),'fields':[_0x4533('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 18f92c2..a30f8c6 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 _0xc21d=['code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc21d,0x89));var _0xdc21=function(_0x5a2142,_0x1554cc){_0x5a2142=_0x5a2142-0x0;var _0x1e3d8c=_0xc21d[_0x5a2142];return _0x1e3d8c;};'use strict';var _=require(_0xdc21('0x0'));var util=require(_0xdc21('0x1'));var moment=require('moment');var BPromise=require(_0xdc21('0x2'));var rs=require(_0xdc21('0x3'));var fs=require('fs');var Redis=require(_0xdc21('0x4'));var db=require(_0xdc21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc21('0x6'))(_0xdc21('0x7'));var config=require('../../config/environment');var jayson=require(_0xdc21('0x8'));var client=jayson[_0xdc21('0x9')][_0xdc21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92bd98,_0x15f283,_0x16cc3c){return new BPromise(function(_0x57baac,_0x52f2a6){return client['request'](_0x92bd98,_0x16cc3c)[_0xdc21('0xb')](function(_0x45e859){logger[_0xdc21('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x15f283,_0xdc21('0xd'));logger[_0xdc21('0xe')](_0xdc21('0xf'),_0x15f283,_0xdc21('0xd'),JSON['stringify'](_0x45e859));if(_0x45e859['error']){if(_0x45e859[_0xdc21('0x10')][_0xdc21('0x11')]===0x1f4){logger[_0xdc21('0x10')](_0xdc21('0x12'),_0x15f283,_0x45e859[_0xdc21('0x10')]['message']);return _0x52f2a6(_0x45e859[_0xdc21('0x10')][_0xdc21('0x13')]);}logger[_0xdc21('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x15f283,_0x45e859[_0xdc21('0x10')][_0xdc21('0x13')]);return _0x57baac(_0x45e859[_0xdc21('0x10')][_0xdc21('0x13')]);}else{logger[_0xdc21('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x15f283,'request\x20sent');_0x57baac(_0x45e859[_0xdc21('0x14')]['message']);}})[_0xdc21('0x15')](function(_0x5df40a){logger[_0xdc21('0x10')](_0xdc21('0x12'),_0x15f283,_0x5df40a);_0x52f2a6(_0x5df40a);});});} \ No newline at end of file +var _0x740e=['stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b309b,_0x58b4ed){var _0x2739b4=function(_0x1b418a){while(--_0x1b418a){_0x2b309b['push'](_0x2b309b['shift']());}};_0x2739b4(++_0x58b4ed);}(_0x740e,0x1ea));var _0xe740=function(_0x489cb5,_0x5d2b4f){_0x489cb5=_0x489cb5-0x0;var _0x5cb56b=_0x740e[_0x489cb5];return _0x5cb56b;};'use strict';var _=require('lodash');var util=require(_0xe740('0x0'));var moment=require('moment');var BPromise=require(_0xe740('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe740('0x2'));var db=require(_0xe740('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe740('0x4'))(_0xe740('0x5'));var config=require(_0xe740('0x6'));var jayson=require(_0xe740('0x7'));var client=jayson[_0xe740('0x8')][_0xe740('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x479cd7,_0x376fc6,_0x520cd9){return new BPromise(function(_0x2e1061,_0xce3189){return client[_0xe740('0xa')](_0x479cd7,_0x520cd9)[_0xe740('0xb')](function(_0x4c8daf){logger[_0xe740('0xc')](_0xe740('0xd'),_0x376fc6,_0xe740('0xe'));logger[_0xe740('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x376fc6,_0xe740('0xe'),JSON[_0xe740('0x10')](_0x4c8daf));if(_0x4c8daf[_0xe740('0x11')]){if(_0x4c8daf[_0xe740('0x11')][_0xe740('0x12')]===0x1f4){logger[_0xe740('0x11')](_0xe740('0xd'),_0x376fc6,_0x4c8daf[_0xe740('0x11')]['message']);return _0xce3189(_0x4c8daf['error'][_0xe740('0x13')]);}logger[_0xe740('0x11')](_0xe740('0xd'),_0x376fc6,_0x4c8daf[_0xe740('0x11')]['message']);return _0x2e1061(_0x4c8daf['error'][_0xe740('0x13')]);}else{logger['info'](_0xe740('0xd'),_0x376fc6,_0xe740('0xe'));_0x2e1061(_0x4c8daf[_0xe740('0x14')][_0xe740('0x13')]);}})[_0xe740('0x15')](function(_0xd7e9fb){logger[_0xe740('0x11')](_0xe740('0xd'),_0x376fc6,_0xd7e9fb);_0xce3189(_0xd7e9fb);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3d0cdf1..5869f36 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 _0xb769=['server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','single','file','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/download','download','diskStorage','join','root'];(function(_0x371e83,_0xb4184d){var _0x2352cc=function(_0x3cc2c4){while(--_0x3cc2c4){_0x371e83['push'](_0x371e83['shift']());}};_0x2352cc(++_0xb4184d);}(_0xb769,0x178));var _0x9b76=function(_0x43db46,_0x2a3cdf){_0x43db46=_0x43db46-0x0;var _0x1d435e=_0xb769[_0x43db46];return _0x1d435e;};'use strict';var multer=require(_0x9b76('0x0'));var util=require(_0x9b76('0x1'));var path=require('path');var timeout=require(_0x9b76('0x2'));var express=require(_0x9b76('0x3'));var router=express[_0x9b76('0x4')]();var auth=require(_0x9b76('0x5'));var interaction=require(_0x9b76('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x9b76('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b76('0x8')]);router[_0x9b76('0x7')](_0x9b76('0x9'),auth[_0x9b76('0xa')](),controller['show']);router[_0x9b76('0x7')](_0x9b76('0xb'),auth[_0x9b76('0xa')](),controller[_0x9b76('0xc')]);var upload=multer({'storage':multer[_0x9b76('0xd')]({'destination':function(_0x2e4722,_0x42b748,_0x4f27dd){_0x4f27dd(null,path[_0x9b76('0xe')](config[_0x9b76('0xf')],_0x9b76('0x10')));},'filename':function(_0x32cc23,_0x171ee2,_0x4802a7){_0x171ee2['originalname']=_0x171ee2[_0x9b76('0x11')][_0x9b76('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4802a7(null,util[_0x9b76('0x13')](_0x9b76('0x14'),path['basename'](_0x171ee2[_0x9b76('0x11')],path[_0x9b76('0x15')](_0x171ee2[_0x9b76('0x11')])),Date['now'](),path[_0x9b76('0x15')](_0x171ee2[_0x9b76('0x11')])));}})});router['post']('/',upload[_0x9b76('0x16')](_0x9b76('0x17')),controller[_0x9b76('0x18')]);router['put'](_0x9b76('0x9'),auth[_0x9b76('0xa')](),controller[_0x9b76('0x19')]);router[_0x9b76('0x1a')](_0x9b76('0x9'),auth[_0x9b76('0xa')](),controller[_0x9b76('0x1a')]);module[_0x9b76('0x1b')]=router; \ No newline at end of file +var _0xa3b9=['path','express','../../components/auth/service','../../components/interaction/service','./sound.controller','isAuthenticated','get','/:id','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','put','update','exports','util'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xa3b9,0xfb));var _0x9a3b=function(_0x5e688a,_0x3c521e){_0x5e688a=_0x5e688a-0x0;var _0x487b76=_0xa3b9[_0x5e688a];return _0x487b76;};'use strict';var multer=require('multer');var util=require(_0x9a3b('0x0'));var path=require(_0x9a3b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a3b('0x2'));var router=express['Router']();var auth=require(_0x9a3b('0x3'));var interaction=require(_0x9a3b('0x4'));var config=require('../../config/environment');var controller=require(_0x9a3b('0x5'));router['get']('/',auth[_0x9a3b('0x6')](),controller['index']);router[_0x9a3b('0x7')](_0x9a3b('0x8'),auth[_0x9a3b('0x6')](),controller[_0x9a3b('0x9')]);router[_0x9a3b('0x7')](_0x9a3b('0xa'),auth[_0x9a3b('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x9a3b('0xb')]({'destination':function(_0x3df0ac,_0x4f2b8c,_0x114d2d){_0x114d2d(null,path[_0x9a3b('0xc')](config[_0x9a3b('0xd')],_0x9a3b('0xe')));},'filename':function(_0x299cd0,_0x580b65,_0x2b74ff){_0x580b65[_0x9a3b('0xf')]=_0x580b65['originalname'][_0x9a3b('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b74ff(null,util[_0x9a3b('0x11')](_0x9a3b('0x12'),path['basename'](_0x580b65[_0x9a3b('0xf')],path[_0x9a3b('0x13')](_0x580b65[_0x9a3b('0xf')])),Date[_0x9a3b('0x14')](),path[_0x9a3b('0x13')](_0x580b65[_0x9a3b('0xf')])));}})});router[_0x9a3b('0x15')]('/',upload[_0x9a3b('0x16')](_0x9a3b('0x17')),controller[_0x9a3b('0x18')]);router[_0x9a3b('0x19')](_0x9a3b('0x8'),auth[_0x9a3b('0x6')](),controller[_0x9a3b('0x1a')]);router['delete'](_0x9a3b('0x8'),auth['isAuthenticated'](),controller['delete']);module[_0x9a3b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 04b2302..b25c63d 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 _0x606c=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0xa4205d,_0xa25f31){var _0x266d13=function(_0x3a1330){while(--_0x3a1330){_0xa4205d['push'](_0xa4205d['shift']());}};_0x266d13(++_0xa25f31);}(_0x606c,0x1eb));var _0xc606=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0x606c[_0x3ee1fe];return _0x1ae57a;};'use strict';var Sequelize=require('sequelize');module[_0xc606('0x0')]={'name':{'type':Sequelize[_0xc606('0x1')],'unique':_0xc606('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc606('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xc606('0x1')]},'original_duration':{'type':Sequelize[_0xc606('0x3')]},'original_sampleCount':{'type':Sequelize[_0xc606('0x4')]},'original_channelCount':{'type':Sequelize[_0xc606('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xc606('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc606('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc606('0x5')]}}; \ No newline at end of file +var _0x9b13=['sequelize','STRING','name','BIGINT','INTEGER','FLOAT'];(function(_0x1f8dab,_0x1a3a74){var _0x1c163c=function(_0x4a9ab0){while(--_0x4a9ab0){_0x1f8dab['push'](_0x1f8dab['shift']());}};_0x1c163c(++_0x1a3a74);}(_0x9b13,0xde));var _0x39b1=function(_0x3446d9,_0x3f06a1){_0x3446d9=_0x3446d9-0x0;var _0x556541=_0x9b13[_0x3446d9];return _0x556541;};'use strict';var Sequelize=require(_0x39b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x39b1('0x1')],'unique':_0x39b1('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x39b1('0x1')]},'display_name':{'type':Sequelize[_0x39b1('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x39b1('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x39b1('0x3')]},'original_channelCount':{'type':Sequelize[_0x39b1('0x4')]},'original_bitRate':{'type':Sequelize[_0x39b1('0x3')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x39b1('0x1')]},'converted_duration':{'type':Sequelize[_0x39b1('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x39b1('0x3')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x39b1('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x39b1('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 95aa534..0177923 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 _0x347f=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','sort','where','pick','merge','filter','options','Sound','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','format','%s.%s','create','basename','originalname','extname','file','substring','wav','root','server/files/sounds/original','filename','Sound\x20upload\x20filepath:\x20%s','info','chmodSync','0777','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','dest','converted_duration','converted_bitRate','sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','description','original_format','unlinkSync','end','html-pdf'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x347f,0x71));var _0xf347=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x347f[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xf347('0x0'));var emlformat=require(_0xf347('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf347('0x2'));var jsonpatch=require(_0xf347('0x3'));var rp=require(_0xf347('0x4'));var moment=require(_0xf347('0x5'));var BPromise=require(_0xf347('0x6'));var Mustache=require(_0xf347('0x7'));var util=require(_0xf347('0x8'));var path=require(_0xf347('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf347('0xa'));var fs=require('fs');var _=require(_0xf347('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf347('0xc'));var deskjs=require(_0xf347('0xd'));var toCsv=require(_0xf347('0xe'));var querystring=require(_0xf347('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf347('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf347('0x11'));var logger=require(_0xf347('0x12'))('api');var utils=require(_0xf347('0x13'));var config=require(_0xf347('0x14'));var db=require(_0xf347('0x15'))['db'];function respondWithStatusCode(_0x9cf064,_0x39c74e){_0x39c74e=_0x39c74e||0xcc;return function(_0x52ff55){if(_0x52ff55){return _0x9cf064['sendStatus'](_0x39c74e);}return _0x9cf064['status'](_0x39c74e)['end']();};}function respondWithResult(_0x4dfbef,_0x2269e7){_0x2269e7=_0x2269e7||0xc8;return function(_0x316123){if(_0x316123){return _0x4dfbef[_0xf347('0x16')](_0x2269e7)[_0xf347('0x17')](_0x316123);}};}function respondWithFilteredResult(_0x36b2f1,_0xc7689f){return function(_0x4b2250){if(_0x4b2250){var _0x4f04f7=_0x4b2250[_0xf347('0x18')],_0x6af8b=_0xc7689f[_0xf347('0x19')],_0x27ad46=_0xc7689f['offset']+_0xc7689f[_0xf347('0x1a')],_0x25f362;if(_0x27ad46>=_0x4f04f7){_0x27ad46=_0x4f04f7;_0x25f362=0xc8;}else{_0x25f362=0xce;}_0x36b2f1['status'](_0x25f362);return _0x36b2f1[_0xf347('0x1b')](_0xf347('0x1c'),_0x6af8b+'-'+_0x27ad46+'/'+_0x4f04f7)[_0xf347('0x17')](_0x4b2250);}return null;};}function patchUpdates(_0x1b2ef1){return function(_0x4ac5c7){try{jsonpatch[_0xf347('0x1d')](_0x4ac5c7,_0x1b2ef1,!![]);}catch(_0x186f9a){return BPromise[_0xf347('0x1e')](_0x186f9a);}return _0x4ac5c7['save']();};}function saveUpdates(_0x1bfc87,_0xb02b75){return function(_0x20e24c){if(_0x20e24c){return _0x20e24c[_0xf347('0x1f')](_0x1bfc87)[_0xf347('0x20')](function(_0x3df522){return _0x3df522;});}return null;};}function removeEntity(_0x37f317,_0x3e7c89){return function(_0x1b83d7){if(_0x1b83d7){return _0x1b83d7[_0xf347('0x21')]()[_0xf347('0x20')](function(){var _0x2db6a6=_0x1b83d7[_0xf347('0x22')]({'plain':!![]});var _0x2ddb40=_0xf347('0x23');return db[_0xf347('0x24')][_0xf347('0x21')]({'where':{'type':_0x2ddb40,'resourceId':_0x2db6a6['id']}})[_0xf347('0x20')](function(){return _0x1b83d7;});})[_0xf347('0x20')](function(){_0x37f317['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ff843,_0x14b96e){return function(_0x3e5cdb){if(!_0x3e5cdb){_0x1ff843['sendStatus'](0x194);}return _0x3e5cdb;};}function handleError(_0x2d7d51,_0x25506b){_0x25506b=_0x25506b||0x1f4;return function(_0x19a6ac){logger[_0xf347('0x25')](_0x19a6ac[_0xf347('0x26')]);if(_0x19a6ac[_0xf347('0x27')]){delete _0x19a6ac['name'];}_0x2d7d51[_0xf347('0x16')](_0x25506b)['send'](_0x19a6ac);};}exports[_0xf347('0x28')]=function(_0x464d25,_0x7c011){var _0x11f54a={},_0x2034a0={},_0x35439e={'count':0x0,'rows':[]};var _0x4673ad=_['map'](db['Sound'][_0xf347('0x29')],function(_0x1c4f83){return{'name':_0x1c4f83[_0xf347('0x2a')],'type':_0x1c4f83[_0xf347('0x2b')][_0xf347('0x2c')]};});_0x2034a0[_0xf347('0x2d')]=_[_0xf347('0x2e')](_0x4673ad,'name');_0x2034a0[_0xf347('0x2f')]=_['keys'](_0x464d25[_0xf347('0x2f')]);_0x2034a0[_0xf347('0x30')]=_[_0xf347('0x31')](_0x2034a0[_0xf347('0x2d')],_0x2034a0[_0xf347('0x2f')]);_0x11f54a[_0xf347('0x32')]=_[_0xf347('0x31')](_0x2034a0['model'],qs[_0xf347('0x33')](_0x464d25[_0xf347('0x2f')][_0xf347('0x33')]));_0x11f54a[_0xf347('0x32')]=_0x11f54a[_0xf347('0x32')]['length']?_0x11f54a[_0xf347('0x32')]:_0x2034a0[_0xf347('0x2d')];if(!_0x464d25[_0xf347('0x2f')]['hasOwnProperty']('nolimit')){_0x11f54a['limit']=qs[_0xf347('0x1a')](_0x464d25[_0xf347('0x2f')][_0xf347('0x1a')]);_0x11f54a[_0xf347('0x19')]=qs['offset'](_0x464d25[_0xf347('0x2f')]['offset']);}_0x11f54a['order']=qs['sort'](_0x464d25[_0xf347('0x2f')][_0xf347('0x34')]);_0x11f54a[_0xf347('0x35')]=qs['filters'](_[_0xf347('0x36')](_0x464d25[_0xf347('0x2f')],_0x2034a0[_0xf347('0x30')]),_0x4673ad);if(_0x464d25[_0xf347('0x2f')]['filter']){_0x11f54a['where']=_[_0xf347('0x37')](_0x11f54a[_0xf347('0x35')],{'$or':_['map'](_0x4673ad,function(_0x22843a){if(_0x22843a['type']!=='VIRTUAL'){var _0x2be94f={};_0x2be94f[_0x22843a[_0xf347('0x27')]]={'$like':'%'+_0x464d25[_0xf347('0x2f')][_0xf347('0x38')]+'%'};return _0x2be94f;}})});}_0x11f54a=_[_0xf347('0x37')]({},_0x11f54a,_0x464d25[_0xf347('0x39')]);var _0x46f1db={'where':_0x11f54a['where']};return db[_0xf347('0x3a')][_0xf347('0x18')](_0x46f1db)['then'](function(_0x12d2d2){_0x35439e[_0xf347('0x18')]=_0x12d2d2;if(_0x464d25[_0xf347('0x2f')][_0xf347('0x3b')]){_0x11f54a[_0xf347('0x3c')]=[{'all':!![]}];}return db[_0xf347('0x3a')][_0xf347('0x3d')](_0x11f54a);})['then'](function(_0x11878f){_0x35439e[_0xf347('0x3e')]=_0x11878f;return _0x35439e;})[_0xf347('0x20')](respondWithFilteredResult(_0x7c011,_0x11f54a))[_0xf347('0x3f')](handleError(_0x7c011,null));};exports[_0xf347('0x40')]=function(_0x4ad5a3,_0x191130){var _0x33e61e={'raw':!![],'where':{'id':_0x4ad5a3[_0xf347('0x41')]['id']}},_0x29df73={};_0x29df73[_0xf347('0x2d')]=_[_0xf347('0x42')](db['Sound'][_0xf347('0x29')]);_0x29df73['query']=_[_0xf347('0x42')](_0x4ad5a3['query']);_0x29df73['filters']=_[_0xf347('0x31')](_0x29df73[_0xf347('0x2d')],_0x29df73[_0xf347('0x2f')]);_0x33e61e['attributes']=_[_0xf347('0x31')](_0x29df73[_0xf347('0x2d')],qs[_0xf347('0x33')](_0x4ad5a3[_0xf347('0x2f')][_0xf347('0x33')]));_0x33e61e[_0xf347('0x32')]=_0x33e61e[_0xf347('0x32')][_0xf347('0x43')]?_0x33e61e[_0xf347('0x32')]:_0x29df73[_0xf347('0x2d')];if(_0x4ad5a3[_0xf347('0x2f')][_0xf347('0x3b')]){_0x33e61e['include']=[{'all':!![]}];}_0x33e61e=_[_0xf347('0x37')]({},_0x33e61e,_0x4ad5a3[_0xf347('0x39')]);return db[_0xf347('0x3a')][_0xf347('0x44')](_0x33e61e)[_0xf347('0x20')](handleEntityNotFound(_0x191130,null))[_0xf347('0x20')](respondWithResult(_0x191130,null))[_0xf347('0x3f')](handleError(_0x191130,null));};exports[_0xf347('0x45')]=function(_0x14d219,_0x59235d,_0x501231){return db[_0xf347('0x3a')][_0xf347('0x44')]({'where':{'id':_0x14d219[_0xf347('0x41')]['id']},'attributes':[_0xf347('0x27'),_0xf347('0x46'),_0xf347('0x47')],'raw':!![]})[_0xf347('0x20')](handleEntityNotFound(_0x59235d,null))[_0xf347('0x20')](function(_0x331481){if(_0x331481){if(!fs['existsSync'](path[_0xf347('0x48')](config['root'],_0xf347('0x49'),_0x331481[_0xf347('0x46')]+'.'+_0x331481[_0xf347('0x47')]))){throw new db[(_0xf347('0x4a'))]['ValidationError']('Sound\x20not\x20found');}return _0x59235d[_0xf347('0x45')](path[_0xf347('0x48')](config['root'],_0xf347('0x49'),util[_0xf347('0x4b')]('%s.%s',_0x331481[_0xf347('0x46')],_0x331481[_0xf347('0x47')])),util[_0xf347('0x4b')](_0xf347('0x4c'),_0x331481['name'],_0x331481['converted_format']));}return null;})[_0xf347('0x3f')](handleError(_0x59235d,null));};exports[_0xf347('0x4d')]=function(_0x48c894,_0x38aedb,_0x32c5eb){var _0x5d1517={'name':path[_0xf347('0x4e')](_0x48c894['file'][_0xf347('0x4f')],path[_0xf347('0x50')](_0x48c894[_0xf347('0x51')]['originalname'])),'save_name':path[_0xf347('0x4e')](_0x48c894['file']['filename'],path['extname'](_0x48c894[_0xf347('0x51')]['filename'])),'original_format':path[_0xf347('0x50')](_0x48c894[_0xf347('0x51')][_0xf347('0x4f')])[_0xf347('0x52')](0x1),'converted_format':_0xf347('0x53')};var _0x4b47cd=path[_0xf347('0x48')](config[_0xf347('0x54')],_0xf347('0x55'),_0x48c894[_0xf347('0x51')][_0xf347('0x56')]);var _0x9c38ae=path['join'](config['root'],_0xf347('0x49'),util[_0xf347('0x4b')](_0xf347('0x4c'),path[_0xf347('0x4e')](_0x48c894[_0xf347('0x51')]['filename'],path[_0xf347('0x50')](_0x48c894[_0xf347('0x51')]['filename'])),_0x5d1517[_0xf347('0x47')]));logger['info'](_0xf347('0x57'),_0x4b47cd);logger[_0xf347('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x9c38ae);try{fs[_0xf347('0x59')](_0x4b47cd,parseInt(_0xf347('0x5a'),0x8));var _0x3eb708=sox['transcode'](_0x4b47cd,_0x9c38ae,{'sampleRate':0x1f40,'format':_0xf347('0x53'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3eb708['on'](_0xf347('0x25'),function(_0x4419d4){fs['unlinkSync'](_0x4b47cd);_0x38aedb['status'](0x1f4)['send'](_0x4419d4);});_0x3eb708['on']('src',function(_0x1e144a){_0x5d1517['original_duration']=isNaN(_0x1e144a[_0xf347('0x5b')])?null:_0x1e144a[_0xf347('0x5b')]*0x3e8;_0x5d1517['original_sampleCount']=isNaN(_0x1e144a[_0xf347('0x5c')])?null:_0x1e144a[_0xf347('0x5c')];_0x5d1517[_0xf347('0x5d')]=isNaN(_0x1e144a['channelCount'])?null:_0x1e144a[_0xf347('0x5e')];_0x5d1517[_0xf347('0x5f')]=isNaN(_0x1e144a[_0xf347('0x60')])?null:_0x1e144a['bitRate'];_0x5d1517['original_sampleRate']=isNaN(_0x1e144a['sampleRate'])?null:_0x1e144a['sampleRate'];});_0x3eb708['on'](_0xf347('0x61'),function(_0x3bc08b){_0x5d1517[_0xf347('0x62')]=isNaN(_0x3bc08b[_0xf347('0x5b')])?null:_0x3bc08b[_0xf347('0x5b')]*0x3e8;_0x5d1517['converted_sampleCount']=isNaN(_0x3bc08b[_0xf347('0x5c')])?null:_0x3bc08b['sampleCount'];_0x5d1517['converted_channelCount']=isNaN(_0x3bc08b[_0xf347('0x5e')])?null:_0x3bc08b[_0xf347('0x5e')];_0x5d1517[_0xf347('0x63')]=isNaN(_0x3bc08b[_0xf347('0x60')])?null:_0x3bc08b[_0xf347('0x60')];_0x5d1517['converted_sampleRate']=isNaN(_0x3bc08b[_0xf347('0x64')])?null:_0x3bc08b[_0xf347('0x64')];});_0x3eb708['on']('end',function(){fs['chmodSync'](_0x9c38ae,parseInt(_0xf347('0x5a'),0x8));return db[_0xf347('0x3a')][_0xf347('0x4d')](_0x5d1517)['then'](function(_0xe426a9){var _0x37150e={'role':_0x48c894[_0xf347('0x65')]['role'],'userProfileId':_0x48c894['body'][_0xf347('0x66')]};if(!_0x37150e)throw new Error(_0xf347('0x67'));if(_0x37150e[_0xf347('0x68')]==='user'){var _0x233ec6=_0xe426a9[_0xf347('0x22')]({'plain':!![]});return db[_0xf347('0x69')][_0xf347('0x44')]({'where':{'name':_0xf347('0x23'),'userProfileId':_0x37150e[_0xf347('0x66')]},'raw':!![]})[_0xf347('0x20')](function(_0x42ec96){if(_0x42ec96&&_0x42ec96[_0xf347('0x6a')]===0x0){return db[_0xf347('0x24')]['create']({'name':_0x233ec6['name'],'resourceId':_0x233ec6['id'],'type':_0x42ec96[_0xf347('0x27')],'sectionId':_0x42ec96['id']},{})[_0xf347('0x20')](function(){return _0xe426a9;});}else{return _0xe426a9;}})['catch'](function(_0x4a1849){logger[_0xf347('0x25')](_0xf347('0x6b'),_0x4a1849);throw _0x4a1849;});}return _0xe426a9;})['then'](respondWithResult(_0x38aedb,null))[_0xf347('0x3f')](handleError(_0x38aedb,null));});_0x3eb708[_0xf347('0x6c')]();}catch(_0x4811af){_0x38aedb[_0xf347('0x16')](0x1f4)[_0xf347('0x6d')](_0x4811af);}};exports['update']=function(_0x174d9f,_0x40ccf9,_0x443f40){return db[_0xf347('0x3a')][_0xf347('0x44')]({'where':{'id':_0x174d9f['params']['id']}})[_0xf347('0x20')](handleEntityNotFound(_0x40ccf9,null))[_0xf347('0x20')](saveUpdates(_[_0xf347('0x36')](_0x174d9f[_0xf347('0x65')],['name',_0xf347('0x6e')]),null))[_0xf347('0x20')](respondWithResult(_0x40ccf9,null))[_0xf347('0x3f')](handleError(_0x40ccf9,null));};exports['delete']=function(_0x58b779,_0x5e5510,_0x5143a0){return db[_0xf347('0x3a')][_0xf347('0x44')]({'where':{'id':_0x58b779[_0xf347('0x41')]['id']}})[_0xf347('0x20')](function(_0x70e5ca){if(_0x70e5ca){return _0x70e5ca[_0xf347('0x21')]();}})[_0xf347('0x20')](function(_0x2cb72d){var _0x19b0ca=path['join'](config[_0xf347('0x54')],'server/files/sounds/original',util[_0xf347('0x4b')](_0xf347('0x4c'),_0x2cb72d[_0xf347('0x46')],_0x2cb72d[_0xf347('0x6f')]));var _0x366fad=path[_0xf347('0x48')](config[_0xf347('0x54')],_0xf347('0x49'),util[_0xf347('0x4b')](_0xf347('0x4c'),_0x2cb72d[_0xf347('0x46')],_0x2cb72d[_0xf347('0x47')]));fs['unlinkSync'](_0x19b0ca);fs[_0xf347('0x70')](_0x366fad);return _0x2cb72d;})[_0xf347('0x20')](function(_0xc2a99e){if(_0xc2a99e){return _0x5e5510['status'](0xcc)[_0xf347('0x71')]();}})[_0xf347('0x20')](handleEntityNotFound(_0x5e5510,null))[_0xf347('0x3f')](handleError(_0x5e5510,null));}; \ No newline at end of file +var _0xe17d=['../../config/utils','sendStatus','end','count','offset','status','Content-Range','json','apply','save','update','destroy','get','Sounds','UserProfileResource','then','error','name','send','Sound','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','map','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','download','save_name','converted_format','existsSync','join','root','Sequelize','Sound\x20not\x20found','%s.%s','format','basename','file','originalname','extname','filename','substring','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','description','delete','original_format','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','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'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0xe17d,0x164));var _0xde17=function(_0x52012c,_0x5866d4){_0x52012c=_0x52012c-0x0;var _0x38928e=_0xe17d[_0x52012c];return _0x38928e;};'use strict';var pdf=require(_0xde17('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xde17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde17('0x2'));var moment=require(_0xde17('0x3'));var BPromise=require(_0xde17('0x4'));var Mustache=require(_0xde17('0x5'));var util=require(_0xde17('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xde17('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xde17('0x8'));var squel=require(_0xde17('0x9'));var crypto=require(_0xde17('0xa'));var jsforce=require(_0xde17('0xb'));var deskjs=require(_0xde17('0xc'));var toCsv=require(_0xde17('0x7'));var querystring=require(_0xde17('0xd'));var Papa=require(_0xde17('0xe'));var Redis=require(_0xde17('0xf'));var authService=require(_0xde17('0x10'));var qs=require(_0xde17('0x11'));var as=require(_0xde17('0x12'));var hardwareService=require(_0xde17('0x13'));var logger=require(_0xde17('0x14'))(_0xde17('0x15'));var utils=require(_0xde17('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43e8b9,_0x4c3074){_0x4c3074=_0x4c3074||0xcc;return function(_0x2df188){if(_0x2df188){return _0x43e8b9[_0xde17('0x17')](_0x4c3074);}return _0x43e8b9['status'](_0x4c3074)[_0xde17('0x18')]();};}function respondWithResult(_0x2a678,_0x34913d){_0x34913d=_0x34913d||0xc8;return function(_0x59e935){if(_0x59e935){return _0x2a678['status'](_0x34913d)['json'](_0x59e935);}};}function respondWithFilteredResult(_0x27c74c,_0x9c5ea5){return function(_0x562fdf){if(_0x562fdf){var _0x3f355c=_0x562fdf[_0xde17('0x19')],_0x26f2af=_0x9c5ea5[_0xde17('0x1a')],_0x5bfedb=_0x9c5ea5['offset']+_0x9c5ea5['limit'],_0x4dc73d;if(_0x5bfedb>=_0x3f355c){_0x5bfedb=_0x3f355c;_0x4dc73d=0xc8;}else{_0x4dc73d=0xce;}_0x27c74c[_0xde17('0x1b')](_0x4dc73d);return _0x27c74c['set'](_0xde17('0x1c'),_0x26f2af+'-'+_0x5bfedb+'/'+_0x3f355c)[_0xde17('0x1d')](_0x562fdf);}return null;};}function patchUpdates(_0x184ba0){return function(_0x38956f){try{jsonpatch[_0xde17('0x1e')](_0x38956f,_0x184ba0,!![]);}catch(_0x596679){return BPromise['reject'](_0x596679);}return _0x38956f[_0xde17('0x1f')]();};}function saveUpdates(_0x361402,_0x517cd5){return function(_0x3b89a1){if(_0x3b89a1){return _0x3b89a1[_0xde17('0x20')](_0x361402)['then'](function(_0x4e1cdf){return _0x4e1cdf;});}return null;};}function removeEntity(_0x3cf8f1,_0x63aaff){return function(_0x436844){if(_0x436844){return _0x436844[_0xde17('0x21')]()['then'](function(){var _0x16f89d=_0x436844[_0xde17('0x22')]({'plain':!![]});var _0xf2b24d=_0xde17('0x23');return db[_0xde17('0x24')][_0xde17('0x21')]({'where':{'type':_0xf2b24d,'resourceId':_0x16f89d['id']}})[_0xde17('0x25')](function(){return _0x436844;});})[_0xde17('0x25')](function(){_0x3cf8f1[_0xde17('0x1b')](0xcc)[_0xde17('0x18')]();});}};}function handleEntityNotFound(_0x44d94e,_0x57c7e8){return function(_0x30d4ce){if(!_0x30d4ce){_0x44d94e[_0xde17('0x17')](0x194);}return _0x30d4ce;};}function handleError(_0x3f0443,_0x3e0aa3){_0x3e0aa3=_0x3e0aa3||0x1f4;return function(_0x1cd2b9){logger[_0xde17('0x26')](_0x1cd2b9['stack']);if(_0x1cd2b9[_0xde17('0x27')]){delete _0x1cd2b9[_0xde17('0x27')];}_0x3f0443[_0xde17('0x1b')](_0x3e0aa3)[_0xde17('0x28')](_0x1cd2b9);};}exports['index']=function(_0x30dbfc,_0x1216f4){var _0x23c262={},_0x2ede7b={},_0x5dd0fa={'count':0x0,'rows':[]};var _0x3dd6a3=_['map'](db[_0xde17('0x29')][_0xde17('0x2a')],function(_0x2f6e9f){return{'name':_0x2f6e9f[_0xde17('0x2b')],'type':_0x2f6e9f['type'][_0xde17('0x2c')]};});_0x2ede7b[_0xde17('0x2d')]=_['map'](_0x3dd6a3,_0xde17('0x27'));_0x2ede7b[_0xde17('0x2e')]=_[_0xde17('0x2f')](_0x30dbfc[_0xde17('0x2e')]);_0x2ede7b['filters']=_[_0xde17('0x30')](_0x2ede7b['model'],_0x2ede7b[_0xde17('0x2e')]);_0x23c262[_0xde17('0x31')]=_[_0xde17('0x30')](_0x2ede7b[_0xde17('0x2d')],qs[_0xde17('0x32')](_0x30dbfc[_0xde17('0x2e')]['fields']));_0x23c262[_0xde17('0x31')]=_0x23c262[_0xde17('0x31')][_0xde17('0x33')]?_0x23c262[_0xde17('0x31')]:_0x2ede7b[_0xde17('0x2d')];if(!_0x30dbfc[_0xde17('0x2e')][_0xde17('0x34')]('nolimit')){_0x23c262[_0xde17('0x35')]=qs[_0xde17('0x35')](_0x30dbfc['query'][_0xde17('0x35')]);_0x23c262['offset']=qs[_0xde17('0x1a')](_0x30dbfc['query'][_0xde17('0x1a')]);}_0x23c262[_0xde17('0x36')]=qs[_0xde17('0x37')](_0x30dbfc[_0xde17('0x2e')][_0xde17('0x37')]);_0x23c262[_0xde17('0x38')]=qs['filters'](_[_0xde17('0x39')](_0x30dbfc['query'],_0x2ede7b[_0xde17('0x3a')]),_0x3dd6a3);if(_0x30dbfc[_0xde17('0x2e')][_0xde17('0x3b')]){_0x23c262[_0xde17('0x38')]=_['merge'](_0x23c262['where'],{'$or':_[_0xde17('0x3c')](_0x3dd6a3,function(_0x4487cc){if(_0x4487cc[_0xde17('0x3d')]!==_0xde17('0x3e')){var _0x2d1b64={};_0x2d1b64[_0x4487cc[_0xde17('0x27')]]={'$like':'%'+_0x30dbfc[_0xde17('0x2e')][_0xde17('0x3b')]+'%'};return _0x2d1b64;}})});}_0x23c262=_[_0xde17('0x3f')]({},_0x23c262,_0x30dbfc['options']);var _0x37496={'where':_0x23c262['where']};return db[_0xde17('0x29')][_0xde17('0x19')](_0x37496)['then'](function(_0x550e86){_0x5dd0fa[_0xde17('0x19')]=_0x550e86;if(_0x30dbfc[_0xde17('0x2e')][_0xde17('0x40')]){_0x23c262[_0xde17('0x41')]=[{'all':!![]}];}return db[_0xde17('0x29')][_0xde17('0x42')](_0x23c262);})[_0xde17('0x25')](function(_0x29bc41){_0x5dd0fa[_0xde17('0x43')]=_0x29bc41;return _0x5dd0fa;})['then'](respondWithFilteredResult(_0x1216f4,_0x23c262))[_0xde17('0x44')](handleError(_0x1216f4,null));};exports[_0xde17('0x45')]=function(_0x536656,_0x30e1b6){var _0x34ccaa={'raw':!![],'where':{'id':_0x536656[_0xde17('0x46')]['id']}},_0x803974={};_0x803974[_0xde17('0x2d')]=_[_0xde17('0x2f')](db[_0xde17('0x29')][_0xde17('0x2a')]);_0x803974['query']=_[_0xde17('0x2f')](_0x536656[_0xde17('0x2e')]);_0x803974[_0xde17('0x3a')]=_[_0xde17('0x30')](_0x803974[_0xde17('0x2d')],_0x803974['query']);_0x34ccaa[_0xde17('0x31')]=_[_0xde17('0x30')](_0x803974[_0xde17('0x2d')],qs[_0xde17('0x32')](_0x536656['query']['fields']));_0x34ccaa[_0xde17('0x31')]=_0x34ccaa[_0xde17('0x31')][_0xde17('0x33')]?_0x34ccaa[_0xde17('0x31')]:_0x803974[_0xde17('0x2d')];if(_0x536656[_0xde17('0x2e')][_0xde17('0x40')]){_0x34ccaa['include']=[{'all':!![]}];}_0x34ccaa=_['merge']({},_0x34ccaa,_0x536656[_0xde17('0x47')]);return db[_0xde17('0x29')][_0xde17('0x48')](_0x34ccaa)[_0xde17('0x25')](handleEntityNotFound(_0x30e1b6,null))['then'](respondWithResult(_0x30e1b6,null))[_0xde17('0x44')](handleError(_0x30e1b6,null));};exports[_0xde17('0x49')]=function(_0x2fc9f9,_0x330ff1,_0x8640d1){return db[_0xde17('0x29')][_0xde17('0x48')]({'where':{'id':_0x2fc9f9[_0xde17('0x46')]['id']},'attributes':['name',_0xde17('0x4a'),_0xde17('0x4b')],'raw':!![]})[_0xde17('0x25')](handleEntityNotFound(_0x330ff1,null))[_0xde17('0x25')](function(_0x307b49){if(_0x307b49){if(!fs[_0xde17('0x4c')](path[_0xde17('0x4d')](config[_0xde17('0x4e')],'server/files/sounds/converted',_0x307b49[_0xde17('0x4a')]+'.'+_0x307b49[_0xde17('0x4b')]))){throw new db[(_0xde17('0x4f'))]['ValidationError'](_0xde17('0x50'));}return _0x330ff1[_0xde17('0x49')](path[_0xde17('0x4d')](config[_0xde17('0x4e')],'server/files/sounds/converted',util['format'](_0xde17('0x51'),_0x307b49['save_name'],_0x307b49[_0xde17('0x4b')])),util[_0xde17('0x52')](_0xde17('0x51'),_0x307b49['name'],_0x307b49[_0xde17('0x4b')]));}return null;})[_0xde17('0x44')](handleError(_0x330ff1,null));};exports['create']=function(_0x4dabe3,_0xddd8fb,_0x12039e){var _0x58dd54={'name':path[_0xde17('0x53')](_0x4dabe3[_0xde17('0x54')][_0xde17('0x55')],path[_0xde17('0x56')](_0x4dabe3[_0xde17('0x54')]['originalname'])),'save_name':path[_0xde17('0x53')](_0x4dabe3[_0xde17('0x54')][_0xde17('0x57')],path[_0xde17('0x56')](_0x4dabe3[_0xde17('0x54')][_0xde17('0x57')])),'original_format':path[_0xde17('0x56')](_0x4dabe3[_0xde17('0x54')][_0xde17('0x55')])[_0xde17('0x58')](0x1),'converted_format':'wav'};var _0x4c3e48=path['join'](config[_0xde17('0x4e')],_0xde17('0x59'),_0x4dabe3[_0xde17('0x54')][_0xde17('0x57')]);var _0x5966aa=path['join'](config[_0xde17('0x4e')],_0xde17('0x5a'),util[_0xde17('0x52')]('%s.%s',path[_0xde17('0x53')](_0x4dabe3['file'][_0xde17('0x57')],path[_0xde17('0x56')](_0x4dabe3[_0xde17('0x54')][_0xde17('0x57')])),_0x58dd54[_0xde17('0x4b')]));logger[_0xde17('0x5b')](_0xde17('0x5c'),_0x4c3e48);logger['info'](_0xde17('0x5d'),_0x5966aa);try{fs[_0xde17('0x5e')](_0x4c3e48,parseInt(_0xde17('0x5f'),0x8));var _0x47031e=sox['transcode'](_0x4c3e48,_0x5966aa,{'sampleRate':0x1f40,'format':_0xde17('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x47031e['on'](_0xde17('0x26'),function(_0x5f1df9){fs[_0xde17('0x61')](_0x4c3e48);_0xddd8fb['status'](0x1f4)['send'](_0x5f1df9);});_0x47031e['on'](_0xde17('0x62'),function(_0x26e346){_0x58dd54[_0xde17('0x63')]=isNaN(_0x26e346[_0xde17('0x64')])?null:_0x26e346['duration']*0x3e8;_0x58dd54[_0xde17('0x65')]=isNaN(_0x26e346[_0xde17('0x66')])?null:_0x26e346['sampleCount'];_0x58dd54[_0xde17('0x67')]=isNaN(_0x26e346[_0xde17('0x68')])?null:_0x26e346[_0xde17('0x68')];_0x58dd54[_0xde17('0x69')]=isNaN(_0x26e346[_0xde17('0x6a')])?null:_0x26e346[_0xde17('0x6a')];_0x58dd54[_0xde17('0x6b')]=isNaN(_0x26e346[_0xde17('0x6c')])?null:_0x26e346[_0xde17('0x6c')];});_0x47031e['on'](_0xde17('0x6d'),function(_0x3290ef){_0x58dd54[_0xde17('0x6e')]=isNaN(_0x3290ef[_0xde17('0x64')])?null:_0x3290ef[_0xde17('0x64')]*0x3e8;_0x58dd54[_0xde17('0x6f')]=isNaN(_0x3290ef[_0xde17('0x66')])?null:_0x3290ef['sampleCount'];_0x58dd54[_0xde17('0x70')]=isNaN(_0x3290ef[_0xde17('0x68')])?null:_0x3290ef[_0xde17('0x68')];_0x58dd54[_0xde17('0x71')]=isNaN(_0x3290ef[_0xde17('0x6a')])?null:_0x3290ef[_0xde17('0x6a')];_0x58dd54[_0xde17('0x72')]=isNaN(_0x3290ef[_0xde17('0x6c')])?null:_0x3290ef['sampleRate'];});_0x47031e['on']('end',function(){fs[_0xde17('0x5e')](_0x5966aa,parseInt(_0xde17('0x5f'),0x8));return db[_0xde17('0x29')]['create'](_0x58dd54)[_0xde17('0x25')](function(_0x45260d){var _0x2d3c24={'role':_0x4dabe3['body'][_0xde17('0x73')],'userProfileId':_0x4dabe3[_0xde17('0x74')][_0xde17('0x75')]};if(!_0x2d3c24)throw new Error(_0xde17('0x76'));if(_0x2d3c24['role']===_0xde17('0x77')){var _0x1c97e7=_0x45260d[_0xde17('0x22')]({'plain':!![]});return db[_0xde17('0x78')]['find']({'where':{'name':_0xde17('0x23'),'userProfileId':_0x2d3c24[_0xde17('0x75')]},'raw':!![]})[_0xde17('0x25')](function(_0x4e7699){if(_0x4e7699&&_0x4e7699[_0xde17('0x79')]===0x0){return db['UserProfileResource'][_0xde17('0x7a')]({'name':_0x1c97e7[_0xde17('0x27')],'resourceId':_0x1c97e7['id'],'type':_0x4e7699[_0xde17('0x27')],'sectionId':_0x4e7699['id']},{})['then'](function(){return _0x45260d;});}else{return _0x45260d;}})[_0xde17('0x44')](function(_0x3128c4){logger[_0xde17('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3128c4);throw _0x3128c4;});}return _0x45260d;})[_0xde17('0x25')](respondWithResult(_0xddd8fb,null))['catch'](handleError(_0xddd8fb,null));});_0x47031e['start']();}catch(_0x3a12d7){_0xddd8fb['status'](0x1f4)[_0xde17('0x28')](_0x3a12d7);}};exports[_0xde17('0x20')]=function(_0x1a72aa,_0x5711ca,_0x2826aa){return db['Sound'][_0xde17('0x48')]({'where':{'id':_0x1a72aa[_0xde17('0x46')]['id']}})['then'](handleEntityNotFound(_0x5711ca,null))[_0xde17('0x25')](saveUpdates(_[_0xde17('0x39')](_0x1a72aa[_0xde17('0x74')],[_0xde17('0x27'),_0xde17('0x7b')]),null))[_0xde17('0x25')](respondWithResult(_0x5711ca,null))['catch'](handleError(_0x5711ca,null));};exports[_0xde17('0x7c')]=function(_0xc49568,_0x39a5f3,_0x290d46){return db[_0xde17('0x29')][_0xde17('0x48')]({'where':{'id':_0xc49568['params']['id']}})[_0xde17('0x25')](function(_0x3e44c2){if(_0x3e44c2){return _0x3e44c2[_0xde17('0x21')]();}})[_0xde17('0x25')](function(_0x49f975){var _0x32ea08=path[_0xde17('0x4d')](config[_0xde17('0x4e')],'server/files/sounds/original',util[_0xde17('0x52')](_0xde17('0x51'),_0x49f975['save_name'],_0x49f975[_0xde17('0x7d')]));var _0x5886bb=path[_0xde17('0x4d')](config[_0xde17('0x4e')],_0xde17('0x5a'),util[_0xde17('0x52')](_0xde17('0x51'),_0x49f975[_0xde17('0x4a')],_0x49f975[_0xde17('0x4b')]));fs[_0xde17('0x61')](_0x32ea08);fs[_0xde17('0x61')](_0x5886bb);return _0x49f975;})[_0xde17('0x25')](function(_0x274a3d){if(_0x274a3d){return _0x39a5f3['status'](0xcc)['end']();}})[_0xde17('0x25')](handleEntityNotFound(_0x39a5f3,null))[_0xde17('0x44')](handleError(_0x39a5f3,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 39bcf52..a15cfaf 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 _0xaa14=['api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaa14,0xfa));var _0x4aa1=function(_0x46ec24,_0x4d2d68){_0x46ec24=_0x46ec24-0x0;var _0x8e7299=_0xaa14[_0x46ec24];return _0x8e7299;};'use strict';var _=require(_0x4aa1('0x0'));var util=require(_0x4aa1('0x1'));var logger=require(_0x4aa1('0x2'))(_0x4aa1('0x3'));var moment=require('moment');var BPromise=require(_0x4aa1('0x4'));var rp=require(_0x4aa1('0x5'));var fs=require('fs');var path=require(_0x4aa1('0x6'));var rimraf=require(_0x4aa1('0x7'));var config=require(_0x4aa1('0x8'));var attributes=require(_0x4aa1('0x9'));module[_0x4aa1('0xa')]=function(_0x4c36c9,_0x30c027){return _0x4c36c9['define']('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a06=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','api'];(function(_0x4da4a5,_0x58354f){var _0x1a8c00=function(_0x5746ef){while(--_0x5746ef){_0x4da4a5['push'](_0x4da4a5['shift']());}};_0x1a8c00(++_0x58354f);}(_0x5a06,0x10d));var _0x65a0=function(_0x36d2a1,_0x176456){_0x36d2a1=_0x36d2a1-0x0;var _0x5de65d=_0x5a06[_0x36d2a1];return _0x5de65d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x65a0('0x0'));var moment=require(_0x65a0('0x1'));var BPromise=require(_0x65a0('0x2'));var rp=require(_0x65a0('0x3'));var fs=require('fs');var path=require(_0x65a0('0x4'));var rimraf=require(_0x65a0('0x5'));var config=require(_0x65a0('0x6'));var attributes=require(_0x65a0('0x7'));module['exports']=function(_0x506ec3,_0x4d8cf5){return _0x506ec3[_0x65a0('0x8')](_0x65a0('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d167a00..7669ea2 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 _0xcddc=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xcddc,0x187));var _0xccdd=function(_0x151a5d,_0x3f9902){_0x151a5d=_0x151a5d-0x0;var _0x234dcb=_0xcddc[_0x151a5d];return _0x234dcb;};'use strict';var _=require(_0xccdd('0x0'));var util=require(_0xccdd('0x1'));var moment=require(_0xccdd('0x2'));var BPromise=require(_0xccdd('0x3'));var rs=require(_0xccdd('0x4'));var fs=require('fs');var Redis=require(_0xccdd('0x5'));var db=require(_0xccdd('0x6'))['db'];var utils=require(_0xccdd('0x7'));var logger=require('../../config/logger')(_0xccdd('0x8'));var config=require(_0xccdd('0x9'));var jayson=require(_0xccdd('0xa'));var client=jayson[_0xccdd('0xb')][_0xccdd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x238330,_0x1871e6,_0x57b7f1){return new BPromise(function(_0x442e8c,_0x1e1149){return client[_0xccdd('0xd')](_0x238330,_0x57b7f1)[_0xccdd('0xe')](function(_0x64dde3){logger[_0xccdd('0xf')](_0xccdd('0x10'),_0x1871e6,_0xccdd('0x11'));logger['debug'](_0xccdd('0x12'),_0x1871e6,'request\x20sent',JSON['stringify'](_0x64dde3));if(_0x64dde3[_0xccdd('0x13')]){if(_0x64dde3[_0xccdd('0x13')]['code']===0x1f4){logger[_0xccdd('0x13')](_0xccdd('0x10'),_0x1871e6,_0x64dde3[_0xccdd('0x13')][_0xccdd('0x14')]);return _0x1e1149(_0x64dde3[_0xccdd('0x13')][_0xccdd('0x14')]);}logger['error'](_0xccdd('0x10'),_0x1871e6,_0x64dde3[_0xccdd('0x13')][_0xccdd('0x14')]);return _0x442e8c(_0x64dde3['error'][_0xccdd('0x14')]);}else{logger[_0xccdd('0xf')](_0xccdd('0x10'),_0x1871e6,_0xccdd('0x11'));_0x442e8c(_0x64dde3[_0xccdd('0x15')][_0xccdd('0x14')]);}})[_0xccdd('0x16')](function(_0x74b488){logger[_0xccdd('0x13')]('Sound,\x20%s,\x20%s',_0x1871e6,_0x74b488);_0x1e1149(_0x74b488);});});}exports[_0xccdd('0x17')]=function(_0x4198fa){var _0x49c278=this;return new Promise(function(_0x126504,_0x2584c4){return db[_0xccdd('0x18')]['find']({'raw':_0x4198fa[_0xccdd('0x19')]?_0x4198fa[_0xccdd('0x19')][_0xccdd('0x1a')]===undefined?!![]:![]:!![],'where':_0x4198fa['options']?_0x4198fa[_0xccdd('0x19')][_0xccdd('0x1b')]||null:null,'attributes':_0x4198fa[_0xccdd('0x19')]?_0x4198fa['options'][_0xccdd('0x1c')]||null:null,'include':_0x4198fa[_0xccdd('0x19')]?_0x4198fa[_0xccdd('0x19')][_0xccdd('0x1d')]?_[_0xccdd('0x1e')](_0x4198fa[_0xccdd('0x19')][_0xccdd('0x1d')],function(_0x30f93c){return{'model':db[_0x30f93c['model']],'as':_0x30f93c['as'],'attributes':_0x30f93c['attributes'],'include':_0x30f93c[_0xccdd('0x1d')]?_[_0xccdd('0x1e')](_0x30f93c[_0xccdd('0x1d')],function(_0x465ffd){return{'model':db[_0x465ffd[_0xccdd('0x1f')]],'as':_0x465ffd['as'],'attributes':_0x465ffd[_0xccdd('0x1c')],'include':_0x465ffd['include']?_['map'](_0x465ffd['include'],function(_0x33fa65){return{'model':db[_0x33fa65[_0xccdd('0x1f')]],'as':_0x33fa65['as'],'attributes':_0x33fa65[_0xccdd('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xccdd('0xe')](function(_0x328bb6){logger[_0xccdd('0xf')]('ShowSound',_0x4198fa);logger[_0xccdd('0x20')]('ShowSound',_0x4198fa,JSON['stringify'](_0x328bb6));_0x126504(_0x328bb6);})[_0xccdd('0x16')](function(_0x3b9c43){logger[_0xccdd('0x13')](_0xccdd('0x17'),_0x3b9c43[_0xccdd('0x14')],_0x4198fa);_0x2584c4(_0x49c278['error'](0x1f4,_0x3b9c43['message']));});});}; \ No newline at end of file +var _0xef28=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Sound','find','options','raw','where','attributes','include','map','model','then','ShowSound','catch','lodash'];(function(_0x31b151,_0x42fc2a){var _0x325470=function(_0x2127b2){while(--_0x2127b2){_0x31b151['push'](_0x31b151['shift']());}};_0x325470(++_0x42fc2a);}(_0xef28,0xc5));var _0x8ef2=function(_0x595ab0,_0x34873a){_0x595ab0=_0x595ab0-0x0;var _0x5b0499=_0xef28[_0x595ab0];return _0x5b0499;};'use strict';var _=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var moment=require(_0x8ef2('0x2'));var BPromise=require(_0x8ef2('0x3'));var rs=require(_0x8ef2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ef2('0x6'))(_0x8ef2('0x7'));var config=require(_0x8ef2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ef2('0x9')][_0x8ef2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x256f91,_0x429244,_0x6504a6){return new BPromise(function(_0x2740b2,_0x4d68b3){return client['request'](_0x256f91,_0x6504a6)['then'](function(_0x3cb381){logger[_0x8ef2('0xb')](_0x8ef2('0xc'),_0x429244,_0x8ef2('0xd'));logger[_0x8ef2('0xe')](_0x8ef2('0xf'),_0x429244,_0x8ef2('0xd'),JSON[_0x8ef2('0x10')](_0x3cb381));if(_0x3cb381[_0x8ef2('0x11')]){if(_0x3cb381[_0x8ef2('0x11')][_0x8ef2('0x12')]===0x1f4){logger['error'](_0x8ef2('0xc'),_0x429244,_0x3cb381['error']['message']);return _0x4d68b3(_0x3cb381[_0x8ef2('0x11')][_0x8ef2('0x13')]);}logger[_0x8ef2('0x11')](_0x8ef2('0xc'),_0x429244,_0x3cb381[_0x8ef2('0x11')][_0x8ef2('0x13')]);return _0x2740b2(_0x3cb381[_0x8ef2('0x11')][_0x8ef2('0x13')]);}else{logger[_0x8ef2('0xb')](_0x8ef2('0xc'),_0x429244,'request\x20sent');_0x2740b2(_0x3cb381[_0x8ef2('0x14')]['message']);}})['catch'](function(_0x15cd1a){logger[_0x8ef2('0x11')](_0x8ef2('0xc'),_0x429244,_0x15cd1a);_0x4d68b3(_0x15cd1a);});});}exports['ShowSound']=function(_0x20840c){var _0x19d696=this;return new Promise(function(_0x341fdb,_0x5e65be){return db[_0x8ef2('0x15')][_0x8ef2('0x16')]({'raw':_0x20840c[_0x8ef2('0x17')]?_0x20840c[_0x8ef2('0x17')][_0x8ef2('0x18')]===undefined?!![]:![]:!![],'where':_0x20840c[_0x8ef2('0x17')]?_0x20840c[_0x8ef2('0x17')][_0x8ef2('0x19')]||null:null,'attributes':_0x20840c['options']?_0x20840c['options'][_0x8ef2('0x1a')]||null:null,'include':_0x20840c[_0x8ef2('0x17')]?_0x20840c[_0x8ef2('0x17')][_0x8ef2('0x1b')]?_[_0x8ef2('0x1c')](_0x20840c[_0x8ef2('0x17')][_0x8ef2('0x1b')],function(_0x15a3b3){return{'model':db[_0x15a3b3['model']],'as':_0x15a3b3['as'],'attributes':_0x15a3b3['attributes'],'include':_0x15a3b3['include']?_[_0x8ef2('0x1c')](_0x15a3b3[_0x8ef2('0x1b')],function(_0x29b745){return{'model':db[_0x29b745[_0x8ef2('0x1d')]],'as':_0x29b745['as'],'attributes':_0x29b745['attributes'],'include':_0x29b745[_0x8ef2('0x1b')]?_[_0x8ef2('0x1c')](_0x29b745[_0x8ef2('0x1b')],function(_0x2a7267){return{'model':db[_0x2a7267[_0x8ef2('0x1d')]],'as':_0x2a7267['as'],'attributes':_0x2a7267[_0x8ef2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ef2('0x1e')](function(_0x4dedc4){logger[_0x8ef2('0xb')](_0x8ef2('0x1f'),_0x20840c);logger[_0x8ef2('0xe')](_0x8ef2('0x1f'),_0x20840c,JSON[_0x8ef2('0x10')](_0x4dedc4));_0x341fdb(_0x4dedc4);})[_0x8ef2('0x20')](function(_0x134634){logger[_0x8ef2('0x11')](_0x8ef2('0x1f'),_0x134634[_0x8ef2('0x13')],_0x20840c);_0x5e65be(_0x19d696[_0x8ef2('0x11')](0x1f4,_0x134634[_0x8ef2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d5b3092..984d18b 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 _0xd98f=['create','put','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x421ff6,_0x40f195){var _0x177051=function(_0x254bdf){while(--_0x254bdf){_0x421ff6['push'](_0x421ff6['shift']());}};_0x177051(++_0x40f195);}(_0xd98f,0x185));var _0xfd98=function(_0xf4e4b5,_0x3ffb13){_0xf4e4b5=_0xf4e4b5-0x0;var _0xf497e0=_0xd98f[_0xf4e4b5];return _0xf497e0;};'use strict';var multer=require(_0xfd98('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd98('0x1'));var express=require(_0xfd98('0x2'));var router=express['Router']();var auth=require(_0xfd98('0x3'));var interaction=require(_0xfd98('0x4'));var config=require(_0xfd98('0x5'));var controller=require('./squareMessage.controller');router[_0xfd98('0x6')]('/',auth[_0xfd98('0x7')](),controller[_0xfd98('0x8')]);router[_0xfd98('0x6')](_0xfd98('0x9'),auth[_0xfd98('0x7')](),controller['show']);router[_0xfd98('0xa')]('/',auth[_0xfd98('0x7')](),controller[_0xfd98('0xb')]);router[_0xfd98('0xc')](_0xfd98('0x9'),auth[_0xfd98('0x7')](),controller['update']);router[_0xfd98('0xd')](_0xfd98('0x9'),auth[_0xfd98('0x7')](),controller[_0xfd98('0xe')]);module[_0xfd98('0xf')]=router; \ No newline at end of file +var _0xab18=['../../config/environment','./squareMessage.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xab18,0x191));var _0x8ab1=function(_0x52d4a9,_0x40e0fe){_0x52d4a9=_0x52d4a9-0x0;var _0x5d20f7=_0xab18[_0x52d4a9];return _0x5d20f7;};'use strict';var multer=require(_0x8ab1('0x0'));var util=require(_0x8ab1('0x1'));var path=require(_0x8ab1('0x2'));var timeout=require('connect-timeout');var express=require(_0x8ab1('0x3'));var router=express[_0x8ab1('0x4')]();var auth=require(_0x8ab1('0x5'));var interaction=require(_0x8ab1('0x6'));var config=require(_0x8ab1('0x7'));var controller=require(_0x8ab1('0x8'));router[_0x8ab1('0x9')]('/',auth[_0x8ab1('0xa')](),controller['index']);router[_0x8ab1('0x9')](_0x8ab1('0xb'),auth['isAuthenticated'](),controller[_0x8ab1('0xc')]);router[_0x8ab1('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ab1('0xe')]);router['put'](_0x8ab1('0xb'),auth['isAuthenticated'](),controller[_0x8ab1('0xf')]);router['delete']('/:id',auth[_0x8ab1('0xa')](),controller[_0x8ab1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 7550b85..314abfa 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 _0x82a3=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x76d0dd,_0x16716d){var _0x508d20=function(_0x15af09){while(--_0x15af09){_0x76d0dd['push'](_0x76d0dd['shift']());}};_0x508d20(++_0x16716d);}(_0x82a3,0x1ae));var _0x382a=function(_0x35e4af,_0x28237a){_0x35e4af=_0x35e4af-0x0;var _0x15411e=_0x82a3[_0x35e4af];return _0x15411e;};'use strict';var Sequelize=require(_0x382a('0x0'));module[_0x382a('0x1')]={'uniqueid':{'type':Sequelize[_0x382a('0x2')]},'body':{'type':Sequelize[_0x382a('0x3')](_0x382a('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x382a('0x5')]('in',_0x382a('0x6')),'defaultValue':_0x382a('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xa024=['STRING','TEXT','medium','ENUM','out','sequelize','exports'];(function(_0x3351d7,_0x475cd2){var _0x36d366=function(_0x44f538){while(--_0x44f538){_0x3351d7['push'](_0x3351d7['shift']());}};_0x36d366(++_0x475cd2);}(_0xa024,0x19b));var _0x4a02=function(_0x44a1b0,_0x1e41ca){_0x44a1b0=_0x44a1b0-0x0;var _0x4d7b78=_0xa024[_0x44a1b0];return _0x4d7b78;};'use strict';var Sequelize=require(_0x4a02('0x0'));module[_0x4a02('0x1')]={'uniqueid':{'type':Sequelize[_0x4a02('0x2')]},'body':{'type':Sequelize[_0x4a02('0x3')](_0x4a02('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x4a02('0x5')]('in','out'),'defaultValue':_0x4a02('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 7d344fc..003e971 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 _0x2277=['ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','index','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','options','SquareMessage','count','then','includeAll','rows','catch','show','params','keys','include','merge','create','body','destroy','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x343fc0,_0x555cc6){var _0x28f5f4=function(_0x132bd7){while(--_0x132bd7){_0x343fc0['push'](_0x343fc0['shift']());}};_0x28f5f4(++_0x555cc6);}(_0x2277,0x121));var _0x7227=function(_0x6f8421,_0x1c5cd9){_0x6f8421=_0x6f8421-0x0;var _0x298060=_0x2277[_0x6f8421];return _0x298060;};'use strict';var pdf=require(_0x7227('0x0'));var emlformat=require(_0x7227('0x1'));var rimraf=require(_0x7227('0x2'));var zipdir=require(_0x7227('0x3'));var jsonpatch=require(_0x7227('0x4'));var rp=require('request-promise');var moment=require(_0x7227('0x5'));var BPromise=require(_0x7227('0x6'));var Mustache=require(_0x7227('0x7'));var util=require(_0x7227('0x8'));var path=require(_0x7227('0x9'));var sox=require(_0x7227('0xa'));var csv=require('to-csv');var ejs=require(_0x7227('0xb'));var fs=require('fs');var _=require(_0x7227('0xc'));var squel=require(_0x7227('0xd'));var crypto=require(_0x7227('0xe'));var jsforce=require(_0x7227('0xf'));var deskjs=require(_0x7227('0x10'));var toCsv=require(_0x7227('0x11'));var querystring=require(_0x7227('0x12'));var Papa=require('papaparse');var Redis=require(_0x7227('0x13'));var authService=require(_0x7227('0x14'));var qs=require(_0x7227('0x15'));var as=require(_0x7227('0x16'));var hardwareService=require(_0x7227('0x17'));var logger=require(_0x7227('0x18'))('api');var utils=require(_0x7227('0x19'));var config=require(_0x7227('0x1a'));var db=require(_0x7227('0x1b'))['db'];function respondWithStatusCode(_0x4596d3,_0x5be9d4){_0x5be9d4=_0x5be9d4||0xcc;return function(_0x33ef31){if(_0x33ef31){return _0x4596d3[_0x7227('0x1c')](_0x5be9d4);}return _0x4596d3[_0x7227('0x1d')](_0x5be9d4)[_0x7227('0x1e')]();};}function respondWithResult(_0x51377c,_0x46df51){_0x46df51=_0x46df51||0xc8;return function(_0x224f6a){if(_0x224f6a){return _0x51377c[_0x7227('0x1d')](_0x46df51)[_0x7227('0x1f')](_0x224f6a);}};}function respondWithFilteredResult(_0x5b9702,_0x34020a){return function(_0x19d6f8){if(_0x19d6f8){var _0x1a3812=_0x19d6f8['count'],_0x3af338=_0x34020a[_0x7227('0x20')],_0x2e6bfc=_0x34020a[_0x7227('0x20')]+_0x34020a[_0x7227('0x21')],_0x4e327d;if(_0x2e6bfc>=_0x1a3812){_0x2e6bfc=_0x1a3812;_0x4e327d=0xc8;}else{_0x4e327d=0xce;}_0x5b9702[_0x7227('0x1d')](_0x4e327d);return _0x5b9702[_0x7227('0x22')](_0x7227('0x23'),_0x3af338+'-'+_0x2e6bfc+'/'+_0x1a3812)[_0x7227('0x1f')](_0x19d6f8);}return null;};}function patchUpdates(_0x5d49de){return function(_0x44c66d){try{jsonpatch[_0x7227('0x24')](_0x44c66d,_0x5d49de,!![]);}catch(_0x5ae68f){return BPromise['reject'](_0x5ae68f);}return _0x44c66d[_0x7227('0x25')]();};}function saveUpdates(_0x9bf896,_0x3e2ac8){return function(_0x1ed639){if(_0x1ed639){return _0x1ed639[_0x7227('0x26')](_0x9bf896)['then'](function(_0x3c9fdf){return _0x3c9fdf;});}return null;};}function removeEntity(_0x317e59,_0x23b66e){return function(_0xae1a68){if(_0xae1a68){return _0xae1a68['destroy']()['then'](function(){_0x317e59[_0x7227('0x1d')](0xcc)[_0x7227('0x1e')]();});}};}function handleEntityNotFound(_0xf2d4f2,_0x54ffcc){return function(_0x170807){if(!_0x170807){_0xf2d4f2[_0x7227('0x1c')](0x194);}return _0x170807;};}function handleError(_0x12dbbe,_0x49d3ab){_0x49d3ab=_0x49d3ab||0x1f4;return function(_0x390d7b){logger['error'](_0x390d7b[_0x7227('0x27')]);if(_0x390d7b[_0x7227('0x28')]){delete _0x390d7b['name'];}_0x12dbbe['status'](_0x49d3ab)['send'](_0x390d7b);};}exports[_0x7227('0x29')]=function(_0x4db380,_0x106809){var _0x5ac51e={},_0x34e955={},_0xe57195={'count':0x0,'rows':[]};var _0x51d44f=_['map'](db['SquareMessage'][_0x7227('0x2a')],function(_0x36ca28){return{'name':_0x36ca28['fieldName'],'type':_0x36ca28[_0x7227('0x2b')][_0x7227('0x2c')]};});_0x34e955['model']=_[_0x7227('0x2d')](_0x51d44f,_0x7227('0x28'));_0x34e955[_0x7227('0x2e')]=_['keys'](_0x4db380[_0x7227('0x2e')]);_0x34e955[_0x7227('0x2f')]=_[_0x7227('0x30')](_0x34e955[_0x7227('0x31')],_0x34e955[_0x7227('0x2e')]);_0x5ac51e[_0x7227('0x32')]=_[_0x7227('0x30')](_0x34e955[_0x7227('0x31')],qs[_0x7227('0x33')](_0x4db380[_0x7227('0x2e')][_0x7227('0x33')]));_0x5ac51e[_0x7227('0x32')]=_0x5ac51e['attributes'][_0x7227('0x34')]?_0x5ac51e['attributes']:_0x34e955[_0x7227('0x31')];if(!_0x4db380[_0x7227('0x2e')]['hasOwnProperty'](_0x7227('0x35'))){_0x5ac51e[_0x7227('0x21')]=qs[_0x7227('0x21')](_0x4db380['query'][_0x7227('0x21')]);_0x5ac51e[_0x7227('0x20')]=qs[_0x7227('0x20')](_0x4db380[_0x7227('0x2e')][_0x7227('0x20')]);}_0x5ac51e[_0x7227('0x36')]=qs[_0x7227('0x37')](_0x4db380[_0x7227('0x2e')][_0x7227('0x37')]);_0x5ac51e['where']=qs[_0x7227('0x2f')](_[_0x7227('0x38')](_0x4db380[_0x7227('0x2e')],_0x34e955[_0x7227('0x2f')]),_0x51d44f);if(_0x4db380[_0x7227('0x2e')][_0x7227('0x39')]){_0x5ac51e[_0x7227('0x3a')]=_['merge'](_0x5ac51e[_0x7227('0x3a')],{'$or':_['map'](_0x51d44f,function(_0x5661c8){if(_0x5661c8[_0x7227('0x2b')]!=='VIRTUAL'){var _0x5a6799={};_0x5a6799[_0x5661c8[_0x7227('0x28')]]={'$like':'%'+_0x4db380[_0x7227('0x2e')][_0x7227('0x39')]+'%'};return _0x5a6799;}})});}_0x5ac51e=_['merge']({},_0x5ac51e,_0x4db380[_0x7227('0x3b')]);var _0x1eddd3={'where':_0x5ac51e[_0x7227('0x3a')]};return db[_0x7227('0x3c')][_0x7227('0x3d')](_0x1eddd3)[_0x7227('0x3e')](function(_0x583574){_0xe57195[_0x7227('0x3d')]=_0x583574;if(_0x4db380[_0x7227('0x2e')][_0x7227('0x3f')]){_0x5ac51e['include']=[{'all':!![]}];}return db[_0x7227('0x3c')]['findAll'](_0x5ac51e);})[_0x7227('0x3e')](function(_0x298d26){_0xe57195[_0x7227('0x40')]=_0x298d26;return _0xe57195;})[_0x7227('0x3e')](respondWithFilteredResult(_0x106809,_0x5ac51e))[_0x7227('0x41')](handleError(_0x106809,null));};exports[_0x7227('0x42')]=function(_0x5811e0,_0x50f9a3){var _0x9928cc={'raw':!![],'where':{'id':_0x5811e0[_0x7227('0x43')]['id']}},_0x316407={};_0x316407[_0x7227('0x31')]=_[_0x7227('0x44')](db['SquareMessage'][_0x7227('0x2a')]);_0x316407['query']=_[_0x7227('0x44')](_0x5811e0[_0x7227('0x2e')]);_0x316407[_0x7227('0x2f')]=_[_0x7227('0x30')](_0x316407[_0x7227('0x31')],_0x316407[_0x7227('0x2e')]);_0x9928cc['attributes']=_[_0x7227('0x30')](_0x316407[_0x7227('0x31')],qs['fields'](_0x5811e0[_0x7227('0x2e')][_0x7227('0x33')]));_0x9928cc[_0x7227('0x32')]=_0x9928cc[_0x7227('0x32')]['length']?_0x9928cc[_0x7227('0x32')]:_0x316407[_0x7227('0x31')];if(_0x5811e0[_0x7227('0x2e')][_0x7227('0x3f')]){_0x9928cc[_0x7227('0x45')]=[{'all':!![]}];}_0x9928cc=_[_0x7227('0x46')]({},_0x9928cc,_0x5811e0[_0x7227('0x3b')]);return db['SquareMessage']['find'](_0x9928cc)[_0x7227('0x3e')](handleEntityNotFound(_0x50f9a3,null))['then'](respondWithResult(_0x50f9a3,null))['catch'](handleError(_0x50f9a3,null));};exports[_0x7227('0x47')]=function(_0x23d15a,_0x225388){return db['SquareMessage'][_0x7227('0x47')](_0x23d15a['body'],{})['then'](respondWithResult(_0x225388,0xc9))[_0x7227('0x41')](handleError(_0x225388,null));};exports[_0x7227('0x26')]=function(_0x7ecb49,_0x3f3186){if(_0x7ecb49[_0x7227('0x48')]['id']){delete _0x7ecb49[_0x7227('0x48')]['id'];}return db[_0x7227('0x3c')]['find']({'where':{'id':_0x7ecb49[_0x7227('0x43')]['id']}})[_0x7227('0x3e')](handleEntityNotFound(_0x3f3186,null))['then'](saveUpdates(_0x7ecb49[_0x7227('0x48')],null))[_0x7227('0x3e')](respondWithResult(_0x3f3186,null))[_0x7227('0x41')](handleError(_0x3f3186,null));};exports[_0x7227('0x49')]=function(_0xc09fcc,_0x4ffa55){return db[_0x7227('0x3c')][_0x7227('0x4a')]({'where':{'id':_0xc09fcc[_0x7227('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ffa55,null))[_0x7227('0x3e')](removeEntity(_0x4ffa55,null))[_0x7227('0x41')](handleError(_0x4ffa55,null));}; \ No newline at end of file +var _0xd10c=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','map','SquareMessage','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd10c,0x10e));var _0xcd10=function(_0x24c68d,_0x107941){_0x24c68d=_0x24c68d-0x0;var _0x47c361=_0xd10c[_0x24c68d];return _0x47c361;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd10('0x0'));var rimraf=require(_0xcd10('0x1'));var zipdir=require(_0xcd10('0x2'));var jsonpatch=require(_0xcd10('0x3'));var rp=require('request-promise');var moment=require(_0xcd10('0x4'));var BPromise=require(_0xcd10('0x5'));var Mustache=require(_0xcd10('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcd10('0x7'));var csv=require('to-csv');var ejs=require(_0xcd10('0x8'));var fs=require('fs');var _=require(_0xcd10('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd10('0xa'));var deskjs=require(_0xcd10('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd10('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd10('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd10('0xe'))(_0xcd10('0xf'));var utils=require(_0xcd10('0x10'));var config=require(_0xcd10('0x11'));var db=require(_0xcd10('0x12'))['db'];function respondWithStatusCode(_0x60ecd4,_0x3b7a30){_0x3b7a30=_0x3b7a30||0xcc;return function(_0x1a4101){if(_0x1a4101){return _0x60ecd4[_0xcd10('0x13')](_0x3b7a30);}return _0x60ecd4[_0xcd10('0x14')](_0x3b7a30)[_0xcd10('0x15')]();};}function respondWithResult(_0x2d6cdd,_0x39cad4){_0x39cad4=_0x39cad4||0xc8;return function(_0x5c1ac0){if(_0x5c1ac0){return _0x2d6cdd[_0xcd10('0x14')](_0x39cad4)[_0xcd10('0x16')](_0x5c1ac0);}};}function respondWithFilteredResult(_0x4b6f72,_0xe56f9a){return function(_0xad11b5){if(_0xad11b5){var _0x1db8fa=_0xad11b5[_0xcd10('0x17')],_0x3d547d=_0xe56f9a[_0xcd10('0x18')],_0x2569d9=_0xe56f9a[_0xcd10('0x18')]+_0xe56f9a[_0xcd10('0x19')],_0x20e684;if(_0x2569d9>=_0x1db8fa){_0x2569d9=_0x1db8fa;_0x20e684=0xc8;}else{_0x20e684=0xce;}_0x4b6f72['status'](_0x20e684);return _0x4b6f72['set'](_0xcd10('0x1a'),_0x3d547d+'-'+_0x2569d9+'/'+_0x1db8fa)[_0xcd10('0x16')](_0xad11b5);}return null;};}function patchUpdates(_0x117f40){return function(_0x337fa8){try{jsonpatch[_0xcd10('0x1b')](_0x337fa8,_0x117f40,!![]);}catch(_0xabfdde){return BPromise[_0xcd10('0x1c')](_0xabfdde);}return _0x337fa8['save']();};}function saveUpdates(_0x598a4c,_0x49f98e){return function(_0x23c380){if(_0x23c380){return _0x23c380[_0xcd10('0x1d')](_0x598a4c)['then'](function(_0x2064c6){return _0x2064c6;});}return null;};}function removeEntity(_0x30d501,_0x7ced04){return function(_0x54d7ae){if(_0x54d7ae){return _0x54d7ae['destroy']()[_0xcd10('0x1e')](function(){_0x30d501[_0xcd10('0x14')](0xcc)[_0xcd10('0x15')]();});}};}function handleEntityNotFound(_0x1f8305,_0x257167){return function(_0x518c0d){if(!_0x518c0d){_0x1f8305['sendStatus'](0x194);}return _0x518c0d;};}function handleError(_0xb18dd3,_0x123b1a){_0x123b1a=_0x123b1a||0x1f4;return function(_0x3be9bb){logger[_0xcd10('0x1f')](_0x3be9bb[_0xcd10('0x20')]);if(_0x3be9bb['name']){delete _0x3be9bb[_0xcd10('0x21')];}_0xb18dd3[_0xcd10('0x14')](_0x123b1a)['send'](_0x3be9bb);};}exports['index']=function(_0x2aa397,_0x163ffa){var _0x1db8ae={},_0x37bd60={},_0x2b715f={'count':0x0,'rows':[]};var _0x205594=_[_0xcd10('0x22')](db[_0xcd10('0x23')]['rawAttributes'],function(_0x3d8d79){return{'name':_0x3d8d79[_0xcd10('0x24')],'type':_0x3d8d79[_0xcd10('0x25')][_0xcd10('0x26')]};});_0x37bd60[_0xcd10('0x27')]=_[_0xcd10('0x22')](_0x205594,_0xcd10('0x21'));_0x37bd60['query']=_[_0xcd10('0x28')](_0x2aa397[_0xcd10('0x29')]);_0x37bd60[_0xcd10('0x2a')]=_['intersection'](_0x37bd60['model'],_0x37bd60[_0xcd10('0x29')]);_0x1db8ae[_0xcd10('0x2b')]=_[_0xcd10('0x2c')](_0x37bd60[_0xcd10('0x27')],qs[_0xcd10('0x2d')](_0x2aa397[_0xcd10('0x29')][_0xcd10('0x2d')]));_0x1db8ae[_0xcd10('0x2b')]=_0x1db8ae[_0xcd10('0x2b')][_0xcd10('0x2e')]?_0x1db8ae[_0xcd10('0x2b')]:_0x37bd60[_0xcd10('0x27')];if(!_0x2aa397[_0xcd10('0x29')][_0xcd10('0x2f')](_0xcd10('0x30'))){_0x1db8ae[_0xcd10('0x19')]=qs[_0xcd10('0x19')](_0x2aa397[_0xcd10('0x29')][_0xcd10('0x19')]);_0x1db8ae[_0xcd10('0x18')]=qs['offset'](_0x2aa397[_0xcd10('0x29')][_0xcd10('0x18')]);}_0x1db8ae['order']=qs[_0xcd10('0x31')](_0x2aa397[_0xcd10('0x29')][_0xcd10('0x31')]);_0x1db8ae[_0xcd10('0x32')]=qs[_0xcd10('0x2a')](_[_0xcd10('0x33')](_0x2aa397[_0xcd10('0x29')],_0x37bd60[_0xcd10('0x2a')]),_0x205594);if(_0x2aa397[_0xcd10('0x29')]['filter']){_0x1db8ae[_0xcd10('0x32')]=_[_0xcd10('0x34')](_0x1db8ae[_0xcd10('0x32')],{'$or':_[_0xcd10('0x22')](_0x205594,function(_0x2ef4a3){if(_0x2ef4a3[_0xcd10('0x25')]!==_0xcd10('0x35')){var _0x47c723={};_0x47c723[_0x2ef4a3[_0xcd10('0x21')]]={'$like':'%'+_0x2aa397[_0xcd10('0x29')][_0xcd10('0x36')]+'%'};return _0x47c723;}})});}_0x1db8ae=_[_0xcd10('0x34')]({},_0x1db8ae,_0x2aa397[_0xcd10('0x37')]);var _0x560cb3={'where':_0x1db8ae['where']};return db['SquareMessage'][_0xcd10('0x17')](_0x560cb3)['then'](function(_0x46fa48){_0x2b715f[_0xcd10('0x17')]=_0x46fa48;if(_0x2aa397[_0xcd10('0x29')][_0xcd10('0x38')]){_0x1db8ae[_0xcd10('0x39')]=[{'all':!![]}];}return db[_0xcd10('0x23')][_0xcd10('0x3a')](_0x1db8ae);})[_0xcd10('0x1e')](function(_0x572181){_0x2b715f[_0xcd10('0x3b')]=_0x572181;return _0x2b715f;})[_0xcd10('0x1e')](respondWithFilteredResult(_0x163ffa,_0x1db8ae))['catch'](handleError(_0x163ffa,null));};exports[_0xcd10('0x3c')]=function(_0x22daff,_0x15fd5c){var _0x409619={'raw':!![],'where':{'id':_0x22daff[_0xcd10('0x3d')]['id']}},_0x31ea84={};_0x31ea84[_0xcd10('0x27')]=_[_0xcd10('0x28')](db[_0xcd10('0x23')][_0xcd10('0x3e')]);_0x31ea84[_0xcd10('0x29')]=_[_0xcd10('0x28')](_0x22daff['query']);_0x31ea84[_0xcd10('0x2a')]=_['intersection'](_0x31ea84[_0xcd10('0x27')],_0x31ea84[_0xcd10('0x29')]);_0x409619[_0xcd10('0x2b')]=_['intersection'](_0x31ea84[_0xcd10('0x27')],qs['fields'](_0x22daff['query']['fields']));_0x409619[_0xcd10('0x2b')]=_0x409619[_0xcd10('0x2b')][_0xcd10('0x2e')]?_0x409619['attributes']:_0x31ea84[_0xcd10('0x27')];if(_0x22daff[_0xcd10('0x29')][_0xcd10('0x38')]){_0x409619[_0xcd10('0x39')]=[{'all':!![]}];}_0x409619=_[_0xcd10('0x34')]({},_0x409619,_0x22daff[_0xcd10('0x37')]);return db[_0xcd10('0x23')][_0xcd10('0x3f')](_0x409619)[_0xcd10('0x1e')](handleEntityNotFound(_0x15fd5c,null))['then'](respondWithResult(_0x15fd5c,null))[_0xcd10('0x40')](handleError(_0x15fd5c,null));};exports[_0xcd10('0x41')]=function(_0x250d4f,_0x553fe5){return db[_0xcd10('0x23')]['create'](_0x250d4f['body'],{})[_0xcd10('0x1e')](respondWithResult(_0x553fe5,0xc9))[_0xcd10('0x40')](handleError(_0x553fe5,null));};exports[_0xcd10('0x1d')]=function(_0x53f6b7,_0x3caabe){if(_0x53f6b7[_0xcd10('0x42')]['id']){delete _0x53f6b7[_0xcd10('0x42')]['id'];}return db[_0xcd10('0x23')][_0xcd10('0x3f')]({'where':{'id':_0x53f6b7[_0xcd10('0x3d')]['id']}})[_0xcd10('0x1e')](handleEntityNotFound(_0x3caabe,null))['then'](saveUpdates(_0x53f6b7[_0xcd10('0x42')],null))[_0xcd10('0x1e')](respondWithResult(_0x3caabe,null))['catch'](handleError(_0x3caabe,null));};exports['destroy']=function(_0x412f7,_0x118910){return db[_0xcd10('0x23')][_0xcd10('0x3f')]({'where':{'id':_0x412f7[_0xcd10('0x3d')]['id']}})['then'](handleEntityNotFound(_0x118910,null))['then'](removeEntity(_0x118910,null))['catch'](handleError(_0x118910,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 0540900..11ad735 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 _0xfd74=['rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2baa22,_0x98a3d1){var _0x15df18=function(_0x2d02f5){while(--_0x2d02f5){_0x2baa22['push'](_0x2baa22['shift']());}};_0x15df18(++_0x98a3d1);}(_0xfd74,0x156));var _0x4fd7=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0xfd74[_0x32f9ca];return _0x52e083;};'use strict';var _=require('lodash');var util=require(_0x4fd7('0x0'));var logger=require(_0x4fd7('0x1'))('api');var moment=require(_0x4fd7('0x2'));var BPromise=require(_0x4fd7('0x3'));var rp=require(_0x4fd7('0x4'));var fs=require('fs');var path=require(_0x4fd7('0x5'));var rimraf=require(_0x4fd7('0x6'));var config=require(_0x4fd7('0x7'));var attributes=require(_0x4fd7('0x8'));module[_0x4fd7('0x9')]=function(_0xc9245d,_0x491b01){return _0xc9245d['define'](_0x4fd7('0xa'),attributes,{'tableName':_0x4fd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeeb=['../../config/environment','exports','define','SquareMessage','square_messages','lodash','util','api','request-promise','path','rimraf'];(function(_0x432d9d,_0x35a04a){var _0x49a10b=function(_0x2eed52){while(--_0x2eed52){_0x432d9d['push'](_0x432d9d['shift']());}};_0x49a10b(++_0x35a04a);}(_0xaeeb,0x1e9));var _0xbaee=function(_0x2401fc,_0xbc7845){_0x2401fc=_0x2401fc-0x0;var _0x23bb42=_0xaeeb[_0x2401fc];return _0x23bb42;};'use strict';var _=require(_0xbaee('0x0'));var util=require(_0xbaee('0x1'));var logger=require('../../config/logger')(_0xbaee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbaee('0x3'));var fs=require('fs');var path=require(_0xbaee('0x4'));var rimraf=require(_0xbaee('0x5'));var config=require(_0xbaee('0x6'));var attributes=require('./squareMessage.attributes');module[_0xbaee('0x7')]=function(_0x4cab10,_0x1edf10){return _0x4cab10[_0xbaee('0x8')](_0xbaee('0x9'),attributes,{'tableName':_0xbaee('0xa'),'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 0a2c208..ca7c615 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 _0xc6c0=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash'];(function(_0x5e4e77,_0x1b84cd){var _0x29074c=function(_0x1c3941){while(--_0x1c3941){_0x5e4e77['push'](_0x5e4e77['shift']());}};_0x29074c(++_0x1b84cd);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xc6c0[_0x5dc03e];return _0x466a07;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var moment=require(_0x0c6c('0x1'));var BPromise=require(_0x0c6c('0x2'));var rs=require(_0x0c6c('0x3'));var fs=require('fs');var Redis=require(_0x0c6c('0x4'));var db=require(_0x0c6c('0x5'))['db'];var utils=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));var config=require(_0x0c6c('0x9'));var jayson=require(_0x0c6c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1791cb,_0x223b4f,_0x51208d){return new BPromise(function(_0x2e0cd9,_0x15c862){return client[_0x0c6c('0xb')](_0x1791cb,_0x51208d)[_0x0c6c('0xc')](function(_0x317bcf){logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));logger[_0x0c6c('0x10')](_0x0c6c('0x11'),_0x223b4f,_0x0c6c('0xf'),JSON[_0x0c6c('0x12')](_0x317bcf));if(_0x317bcf['error']){if(_0x317bcf[_0x0c6c('0x13')]['code']===0x1f4){logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x15c862(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x2e0cd9(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}else{logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));_0x2e0cd9(_0x317bcf[_0x0c6c('0x15')]['message']);}})[_0x0c6c('0x16')](function(_0x527ade){logger['error']('SquareMessage,\x20%s,\x20%s',_0x223b4f,_0x527ade);_0x15c862(_0x527ade);});});}exports[_0x0c6c('0x17')]=function(_0x530333){var _0x9463e8=this;return new Promise(function(_0x50be43,_0x316dbe){return db[_0x0c6c('0x18')][_0x0c6c('0x19')](_0x530333[_0x0c6c('0x1a')],{'raw':_0x530333['options']?_0x530333[_0x0c6c('0x1b')][_0x0c6c('0x1c')]===undefined?!![]:![]:!![]})[_0x0c6c('0xc')](function(_0x1280fb){logger[_0x0c6c('0xd')](_0x0c6c('0x17'),_0x530333);logger[_0x0c6c('0x10')](_0x0c6c('0x17'),_0x530333,JSON[_0x0c6c('0x12')](_0x1280fb));_0x50be43(_0x1280fb);})['catch'](function(_0x323854){logger[_0x0c6c('0x13')](_0x0c6c('0x17'),_0x323854['message'],_0x530333);_0x316dbe(_0x9463e8[_0x0c6c('0x13')](0x1f4,_0x323854['message']));});});}; \ No newline at end of file +var _0xaf5a=['request','then','info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSquareMessage','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xaf5a,0x116));var _0xaaf5=function(_0x507d63,_0x375424){_0x507d63=_0x507d63-0x0;var _0x4f7124=_0xaf5a[_0x507d63];return _0x4f7124;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require(_0xaaf5('0x1'));var BPromise=require(_0xaaf5('0x2'));var rs=require(_0xaaf5('0x3'));var fs=require('fs');var Redis=require(_0xaaf5('0x4'));var db=require(_0xaaf5('0x5'))['db'];var utils=require(_0xaaf5('0x6'));var logger=require(_0xaaf5('0x7'))('rpc');var config=require(_0xaaf5('0x8'));var jayson=require(_0xaaf5('0x9'));var client=jayson[_0xaaf5('0xa')][_0xaaf5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5890d2,_0x57e7f9,_0x34a86f){return new BPromise(function(_0x2243cb,_0x408180){return client[_0xaaf5('0xc')](_0x5890d2,_0x34a86f)[_0xaaf5('0xd')](function(_0x488279){logger[_0xaaf5('0xe')]('SquareMessage,\x20%s,\x20%s',_0x57e7f9,'request\x20sent');logger[_0xaaf5('0xf')](_0xaaf5('0x10'),_0x57e7f9,'request\x20sent',JSON[_0xaaf5('0x11')](_0x488279));if(_0x488279[_0xaaf5('0x12')]){if(_0x488279[_0xaaf5('0x12')][_0xaaf5('0x13')]===0x1f4){logger['error'](_0xaaf5('0x14'),_0x57e7f9,_0x488279[_0xaaf5('0x12')]['message']);return _0x408180(_0x488279[_0xaaf5('0x12')]['message']);}logger[_0xaaf5('0x12')](_0xaaf5('0x14'),_0x57e7f9,_0x488279[_0xaaf5('0x12')][_0xaaf5('0x15')]);return _0x2243cb(_0x488279['error'][_0xaaf5('0x15')]);}else{logger[_0xaaf5('0xe')](_0xaaf5('0x14'),_0x57e7f9,_0xaaf5('0x16'));_0x2243cb(_0x488279[_0xaaf5('0x17')][_0xaaf5('0x15')]);}})[_0xaaf5('0x18')](function(_0x4b1693){logger[_0xaaf5('0x12')](_0xaaf5('0x14'),_0x57e7f9,_0x4b1693);_0x408180(_0x4b1693);});});}exports[_0xaaf5('0x19')]=function(_0x3a036d){var _0x318d47=this;return new Promise(function(_0x403bb2,_0x3e8576){return db['SquareMessage']['create'](_0x3a036d[_0xaaf5('0x1a')],{'raw':_0x3a036d[_0xaaf5('0x1b')]?_0x3a036d[_0xaaf5('0x1b')][_0xaaf5('0x1c')]===undefined?!![]:![]:!![]})[_0xaaf5('0xd')](function(_0x6131a3){logger['info']('CreateSquareMessage',_0x3a036d);logger[_0xaaf5('0xf')](_0xaaf5('0x19'),_0x3a036d,JSON[_0xaaf5('0x11')](_0x6131a3));_0x403bb2(_0x6131a3);})[_0xaaf5('0x18')](function(_0x3020b0){logger[_0xaaf5('0x12')](_0xaaf5('0x19'),_0x3020b0[_0xaaf5('0x15')],_0x3a036d);_0x3e8576(_0x318d47[_0xaaf5('0x12')](0x1f4,_0x3020b0[_0xaaf5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d028585..0f4f308 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 _0x1e1a=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','isAuthenticated','get','show','/:id/test','15s','test','post','create','put','/:id','update','delete'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x1e1a,0x86));var _0xa1e1=function(_0x40c28b,_0x30cdfa){_0x40c28b=_0x40c28b-0x0;var _0x53704f=_0x1e1a[_0x40c28b];return _0x53704f;};'use strict';var multer=require(_0xa1e1('0x0'));var util=require(_0xa1e1('0x1'));var path=require(_0xa1e1('0x2'));var timeout=require(_0xa1e1('0x3'));var express=require('express');var router=express[_0xa1e1('0x4')]();var auth=require(_0xa1e1('0x5'));var interaction=require(_0xa1e1('0x6'));var config=require('../../config/environment');var controller=require(_0xa1e1('0x7'));router['get']('/',auth[_0xa1e1('0x8')](),controller['index']);router[_0xa1e1('0x9')]('/:id',auth[_0xa1e1('0x8')](),controller[_0xa1e1('0xa')]);router[_0xa1e1('0x9')](_0xa1e1('0xb'),auth[_0xa1e1('0x8')](),timeout(_0xa1e1('0xc')),controller[_0xa1e1('0xd')]);router[_0xa1e1('0xe')]('/',auth[_0xa1e1('0x8')](),controller[_0xa1e1('0xf')]);router[_0xa1e1('0x10')](_0xa1e1('0x11'),auth[_0xa1e1('0x8')](),controller[_0xa1e1('0x12')]);router[_0xa1e1('0x13')](_0xa1e1('0x11'),auth[_0xa1e1('0x8')](),controller[_0xa1e1('0x14')]);module[_0xa1e1('0x15')]=router; \ No newline at end of file +var _0xb31d=['./squareOdbc.controller','index','get','15s','test','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x957f74,_0x687fe1){var _0x45347a=function(_0x433bbf){while(--_0x433bbf){_0x957f74['push'](_0x957f74['shift']());}};_0x45347a(++_0x687fe1);}(_0xb31d,0xca));var _0xdb31=function(_0xb6a5d5,_0x5bfdb1){_0xb6a5d5=_0xb6a5d5-0x0;var _0x16ef49=_0xb31d[_0xb6a5d5];return _0x16ef49;};'use strict';var multer=require(_0xdb31('0x0'));var util=require(_0xdb31('0x1'));var path=require(_0xdb31('0x2'));var timeout=require(_0xdb31('0x3'));var express=require('express');var router=express[_0xdb31('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb31('0x5'));var config=require(_0xdb31('0x6'));var controller=require(_0xdb31('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdb31('0x8')]);router[_0xdb31('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdb31('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0xdb31('0xa')),controller[_0xdb31('0xb')]);router['post']('/',auth[_0xdb31('0xc')](),controller[_0xdb31('0xd')]);router[_0xdb31('0xe')](_0xdb31('0xf'),auth[_0xdb31('0xc')](),controller[_0xdb31('0x10')]);router[_0xdb31('0x11')]('/:id',auth[_0xdb31('0xc')](),controller[_0xdb31('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 84c7451..6d5939e 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 _0xfa99=['exports','STRING','name','sequelize'];(function(_0x5a78f3,_0x19e237){var _0x2ea856=function(_0x5c3ba6){while(--_0x5c3ba6){_0x5a78f3['push'](_0x5a78f3['shift']());}};_0x2ea856(++_0x19e237);}(_0xfa99,0x1cf));var _0x9fa9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfa99[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x9fa9('0x0'));module[_0x9fa9('0x1')]={'name':{'type':Sequelize[_0x9fa9('0x2')],'unique':_0x9fa9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x9fa9('0x2')]},'description':{'type':Sequelize[_0x9fa9('0x2')]}}; \ No newline at end of file +var _0x9502=['exports','STRING','sequelize'];(function(_0x2c29b3,_0x3b4a8c){var _0x52d58c=function(_0x15d6fc){while(--_0x15d6fc){_0x2c29b3['push'](_0x2c29b3['shift']());}};_0x52d58c(++_0x3b4a8c);}(_0x9502,0x13d));var _0x2950=function(_0x5caee2,_0x325a65){_0x5caee2=_0x5caee2-0x0;var _0x3f8747=_0x9502[_0x5caee2];return _0x3f8747;};'use strict';var Sequelize=require(_0x2950('0x0'));module[_0x2950('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2950('0x2')]},'description':{'type':Sequelize[_0x2950('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 5c85fa0..b82217d 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 _0xa183=['odbc','openSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','SquareOdbc','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn'];(function(_0x254081,_0x20731a){var _0x5d1e2a=function(_0x597854){while(--_0x597854){_0x254081['push'](_0x254081['shift']());}};_0x5d1e2a(++_0x20731a);}(_0xa183,0xaa));var _0x3a18=function(_0x2044db,_0x712bbc){_0x2044db=_0x2044db-0x0;var _0x2be1ec=_0xa183[_0x2044db];return _0x2be1ec;};'use strict';var pdf=require(_0x3a18('0x0'));var emlformat=require(_0x3a18('0x1'));var rimraf=require(_0x3a18('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a18('0x3'));var rp=require(_0x3a18('0x4'));var moment=require(_0x3a18('0x5'));var BPromise=require(_0x3a18('0x6'));var Mustache=require(_0x3a18('0x7'));var util=require('util');var path=require(_0x3a18('0x8'));var sox=require(_0x3a18('0x9'));var csv=require(_0x3a18('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3a18('0xb'));var squel=require(_0x3a18('0xc'));var crypto=require(_0x3a18('0xd'));var jsforce=require(_0x3a18('0xe'));var deskjs=require(_0x3a18('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3a18('0x10'));var Papa=require(_0x3a18('0x11'));var Redis=require(_0x3a18('0x12'));var authService=require(_0x3a18('0x13'));var qs=require(_0x3a18('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a18('0x15'));var logger=require('../../config/logger')(_0x3a18('0x16'));var utils=require(_0x3a18('0x17'));var config=require(_0x3a18('0x18'));var db=require(_0x3a18('0x19'))['db'];function respondWithStatusCode(_0x188941,_0x4454fb){_0x4454fb=_0x4454fb||0xcc;return function(_0x18c6d5){if(_0x18c6d5){return _0x188941['sendStatus'](_0x4454fb);}return _0x188941[_0x3a18('0x1a')](_0x4454fb)[_0x3a18('0x1b')]();};}function respondWithResult(_0x1d2033,_0x27c061){_0x27c061=_0x27c061||0xc8;return function(_0x386691){if(_0x386691){return _0x1d2033[_0x3a18('0x1a')](_0x27c061)[_0x3a18('0x1c')](_0x386691);}};}function respondWithFilteredResult(_0x2d419e,_0x3c8017){return function(_0x5b500a){if(_0x5b500a){var _0x3f2eb2=_0x5b500a[_0x3a18('0x1d')],_0x170848=_0x3c8017[_0x3a18('0x1e')],_0x5427bb=_0x3c8017[_0x3a18('0x1e')]+_0x3c8017['limit'],_0x589fc0;if(_0x5427bb>=_0x3f2eb2){_0x5427bb=_0x3f2eb2;_0x589fc0=0xc8;}else{_0x589fc0=0xce;}_0x2d419e[_0x3a18('0x1a')](_0x589fc0);return _0x2d419e[_0x3a18('0x1f')]('Content-Range',_0x170848+'-'+_0x5427bb+'/'+_0x3f2eb2)[_0x3a18('0x1c')](_0x5b500a);}return null;};}function patchUpdates(_0x1780af){return function(_0xf61bef){try{jsonpatch['apply'](_0xf61bef,_0x1780af,!![]);}catch(_0x5b6897){return BPromise['reject'](_0x5b6897);}return _0xf61bef[_0x3a18('0x20')]();};}function saveUpdates(_0x22ed8e,_0xa3cdbf){return function(_0x4fd99a){if(_0x4fd99a){return _0x4fd99a[_0x3a18('0x21')](_0x22ed8e)[_0x3a18('0x22')](function(_0x5d0872){return _0x5d0872;});}return null;};}function removeEntity(_0x5c6ef2,_0x565a39){return function(_0x1ab3df){if(_0x1ab3df){return _0x1ab3df[_0x3a18('0x23')]()[_0x3a18('0x22')](function(){var _0x14e4a1=_0x1ab3df['get']({'plain':!![]});var _0x4bd82a=_0x3a18('0x24');return db[_0x3a18('0x25')][_0x3a18('0x23')]({'where':{'type':_0x4bd82a,'resourceId':_0x14e4a1['id']}})['then'](function(){return _0x1ab3df;});})['then'](function(){_0x5c6ef2[_0x3a18('0x1a')](0xcc)[_0x3a18('0x1b')]();});}};}function handleEntityNotFound(_0x109ddc,_0x104c02){return function(_0x2096e9){if(!_0x2096e9){_0x109ddc['sendStatus'](0x194);}return _0x2096e9;};}function handleError(_0x38a4f1,_0x8e02fd){_0x8e02fd=_0x8e02fd||0x1f4;return function(_0x43e77f){logger[_0x3a18('0x26')](_0x43e77f[_0x3a18('0x27')]);if(_0x43e77f[_0x3a18('0x28')]){delete _0x43e77f[_0x3a18('0x28')];}_0x38a4f1[_0x3a18('0x1a')](_0x8e02fd)[_0x3a18('0x29')](_0x43e77f);};}exports['index']=function(_0x55551e,_0x157927){var _0xcb53e1={},_0x144960={},_0x3390ff={'count':0x0,'rows':[]};var _0x3aef93=_[_0x3a18('0x2a')](db['SquareOdbc'][_0x3a18('0x2b')],function(_0x448d20){return{'name':_0x448d20[_0x3a18('0x2c')],'type':_0x448d20[_0x3a18('0x2d')][_0x3a18('0x2e')]};});_0x144960[_0x3a18('0x2f')]=_[_0x3a18('0x2a')](_0x3aef93,'name');_0x144960['query']=_[_0x3a18('0x30')](_0x55551e[_0x3a18('0x31')]);_0x144960['filters']=_['intersection'](_0x144960[_0x3a18('0x2f')],_0x144960['query']);_0xcb53e1[_0x3a18('0x32')]=_[_0x3a18('0x33')](_0x144960[_0x3a18('0x2f')],qs[_0x3a18('0x34')](_0x55551e['query'][_0x3a18('0x34')]));_0xcb53e1[_0x3a18('0x32')]=_0xcb53e1[_0x3a18('0x32')][_0x3a18('0x35')]?_0xcb53e1[_0x3a18('0x32')]:_0x144960[_0x3a18('0x2f')];if(!_0x55551e[_0x3a18('0x31')][_0x3a18('0x36')](_0x3a18('0x37'))){_0xcb53e1['limit']=qs[_0x3a18('0x38')](_0x55551e[_0x3a18('0x31')][_0x3a18('0x38')]);_0xcb53e1[_0x3a18('0x1e')]=qs[_0x3a18('0x1e')](_0x55551e[_0x3a18('0x31')]['offset']);}_0xcb53e1['order']=qs[_0x3a18('0x39')](_0x55551e[_0x3a18('0x31')][_0x3a18('0x39')]);_0xcb53e1['where']=qs[_0x3a18('0x3a')](_['pick'](_0x55551e[_0x3a18('0x31')],_0x144960['filters']),_0x3aef93);if(_0x55551e[_0x3a18('0x31')][_0x3a18('0x3b')]){_0xcb53e1[_0x3a18('0x3c')]=_[_0x3a18('0x3d')](_0xcb53e1[_0x3a18('0x3c')],{'$or':_[_0x3a18('0x2a')](_0x3aef93,function(_0x59c5f0){if(_0x59c5f0[_0x3a18('0x2d')]!==_0x3a18('0x3e')){var _0x2b0ce3={};_0x2b0ce3[_0x59c5f0[_0x3a18('0x28')]]={'$like':'%'+_0x55551e[_0x3a18('0x31')][_0x3a18('0x3b')]+'%'};return _0x2b0ce3;}})});}_0xcb53e1=_['merge']({},_0xcb53e1,_0x55551e[_0x3a18('0x3f')]);var _0x172ec2={'where':_0xcb53e1[_0x3a18('0x3c')]};return db['SquareOdbc']['count'](_0x172ec2)[_0x3a18('0x22')](function(_0xb427f9){_0x3390ff['count']=_0xb427f9;if(_0x55551e[_0x3a18('0x31')][_0x3a18('0x40')]){_0xcb53e1[_0x3a18('0x41')]=[{'all':!![]}];}return db[_0x3a18('0x42')][_0x3a18('0x43')](_0xcb53e1);})[_0x3a18('0x22')](function(_0x169ae7){_0x3390ff['rows']=_0x169ae7;return _0x3390ff;})[_0x3a18('0x22')](respondWithFilteredResult(_0x157927,_0xcb53e1))[_0x3a18('0x44')](handleError(_0x157927,null));};exports[_0x3a18('0x45')]=function(_0x278e2e,_0x48678f){var _0x7d789a={'raw':!![],'where':{'id':_0x278e2e[_0x3a18('0x46')]['id']}},_0x1f669d={};_0x1f669d[_0x3a18('0x2f')]=_[_0x3a18('0x30')](db[_0x3a18('0x42')]['rawAttributes']);_0x1f669d[_0x3a18('0x31')]=_[_0x3a18('0x30')](_0x278e2e[_0x3a18('0x31')]);_0x1f669d[_0x3a18('0x3a')]=_[_0x3a18('0x33')](_0x1f669d['model'],_0x1f669d[_0x3a18('0x31')]);_0x7d789a[_0x3a18('0x32')]=_[_0x3a18('0x33')](_0x1f669d[_0x3a18('0x2f')],qs['fields'](_0x278e2e[_0x3a18('0x31')]['fields']));_0x7d789a[_0x3a18('0x32')]=_0x7d789a[_0x3a18('0x32')][_0x3a18('0x35')]?_0x7d789a[_0x3a18('0x32')]:_0x1f669d['model'];if(_0x278e2e[_0x3a18('0x31')][_0x3a18('0x40')]){_0x7d789a[_0x3a18('0x41')]=[{'all':!![]}];}_0x7d789a=_[_0x3a18('0x3d')]({},_0x7d789a,_0x278e2e[_0x3a18('0x3f')]);return db['SquareOdbc'][_0x3a18('0x47')](_0x7d789a)['then'](handleEntityNotFound(_0x48678f,null))[_0x3a18('0x22')](respondWithResult(_0x48678f,null))[_0x3a18('0x44')](handleError(_0x48678f,null));};exports['create']=function(_0x36afb9,_0x362ab3){return db[_0x3a18('0x42')][_0x3a18('0x48')](_0x36afb9[_0x3a18('0x49')],{})['then'](function(_0x83af53){var _0x6fa23a=_0x36afb9[_0x3a18('0x4a')][_0x3a18('0x4b')]({'plain':!![]});if(!_0x6fa23a)throw new Error(_0x3a18('0x4c'));if(_0x6fa23a[_0x3a18('0x4d')]===_0x3a18('0x4a')){var _0x38aa25=_0x83af53[_0x3a18('0x4b')]({'plain':!![]});var _0x480b7f='ODBC';return db['UserProfileSection'][_0x3a18('0x47')]({'where':{'name':_0x480b7f,'userProfileId':_0x6fa23a['userProfileId']},'raw':!![]})[_0x3a18('0x22')](function(_0x320c06){if(_0x320c06&&_0x320c06[_0x3a18('0x4e')]===0x0){return db['UserProfileResource'][_0x3a18('0x48')]({'name':_0x38aa25[_0x3a18('0x28')],'resourceId':_0x38aa25['id'],'type':_0x320c06[_0x3a18('0x28')],'sectionId':_0x320c06['id']},{})['then'](function(){return _0x83af53;});}else{return _0x83af53;}})[_0x3a18('0x44')](function(_0x17ae0b){logger[_0x3a18('0x26')](_0x3a18('0x4f'),_0x17ae0b);throw _0x17ae0b;});}return _0x83af53;})[_0x3a18('0x22')](respondWithResult(_0x362ab3,0xc9))['catch'](handleError(_0x362ab3,null));};exports['update']=function(_0x26c760,_0x1b115b){if(_0x26c760[_0x3a18('0x49')]['id']){delete _0x26c760[_0x3a18('0x49')]['id'];}return db[_0x3a18('0x42')]['find']({'where':{'id':_0x26c760[_0x3a18('0x46')]['id']}})[_0x3a18('0x22')](handleEntityNotFound(_0x1b115b,null))['then'](saveUpdates(_0x26c760[_0x3a18('0x49')],null))['then'](respondWithResult(_0x1b115b,null))[_0x3a18('0x44')](handleError(_0x1b115b,null));};exports[_0x3a18('0x23')]=function(_0x51fe1c,_0x1c05da){return db['SquareOdbc'][_0x3a18('0x47')]({'where':{'id':_0x51fe1c[_0x3a18('0x46')]['id']}})[_0x3a18('0x22')](handleEntityNotFound(_0x1c05da,null))[_0x3a18('0x22')](removeEntity(_0x1c05da,null))['catch'](handleError(_0x1c05da,null));};exports[_0x3a18('0x50')]=function(_0xb89ce4,_0xc3ee78,_0x5bdba8){var _0x41aede;return db['SquareOdbc']['find']({'where':{'id':_0xb89ce4[_0x3a18('0x46')]['id']},'attributes':['id',_0x3a18('0x51')]})[_0x3a18('0x22')](handleEntityNotFound(_0xc3ee78,null))['then'](function(_0x2de11a){if(_0x2de11a){var _0xae7075=require(_0x3a18('0x52'))();_0xae7075[_0x3a18('0x53')](_0x2de11a[_0x3a18('0x51')]);_0xae7075['closeSync']();return _0x2de11a;}})['then'](respondWithResult(_0xc3ee78,null))[_0x3a18('0x44')](handleError(_0xc3ee78,null));}; \ No newline at end of file +var _0x8d20=['limit','set','Content-Range','json','apply','save','then','destroy','ODBC','UserProfileResource','end','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','update','params','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset'];(function(_0x4ccaa8,_0xcd8e01){var _0xfe2b4f=function(_0xfb2b28){while(--_0xfb2b28){_0x4ccaa8['push'](_0x4ccaa8['shift']());}};_0xfe2b4f(++_0xcd8e01);}(_0x8d20,0xe6));var _0x08d2=function(_0x53f189,_0x2c8a54){_0x53f189=_0x53f189-0x0;var _0x31469f=_0x8d20[_0x53f189];return _0x31469f;};'use strict';var pdf=require(_0x08d2('0x0'));var emlformat=require(_0x08d2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x08d2('0x2'));var jsonpatch=require(_0x08d2('0x3'));var rp=require(_0x08d2('0x4'));var moment=require('moment');var BPromise=require(_0x08d2('0x5'));var Mustache=require(_0x08d2('0x6'));var util=require(_0x08d2('0x7'));var path=require('path');var sox=require(_0x08d2('0x8'));var csv=require(_0x08d2('0x9'));var ejs=require(_0x08d2('0xa'));var fs=require('fs');var _=require(_0x08d2('0xb'));var squel=require(_0x08d2('0xc'));var crypto=require(_0x08d2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x08d2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x08d2('0xf'));var authService=require(_0x08d2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x08d2('0x11'));var hardwareService=require(_0x08d2('0x12'));var logger=require(_0x08d2('0x13'))(_0x08d2('0x14'));var utils=require(_0x08d2('0x15'));var config=require(_0x08d2('0x16'));var db=require(_0x08d2('0x17'))['db'];function respondWithStatusCode(_0x5d28d4,_0x12dcc0){_0x12dcc0=_0x12dcc0||0xcc;return function(_0xc695b9){if(_0xc695b9){return _0x5d28d4[_0x08d2('0x18')](_0x12dcc0);}return _0x5d28d4[_0x08d2('0x19')](_0x12dcc0)['end']();};}function respondWithResult(_0x2798c5,_0xd3cc3){_0xd3cc3=_0xd3cc3||0xc8;return function(_0x2f017a){if(_0x2f017a){return _0x2798c5[_0x08d2('0x19')](_0xd3cc3)['json'](_0x2f017a);}};}function respondWithFilteredResult(_0x4face0,_0x173263){return function(_0x2f4c5d){if(_0x2f4c5d){var _0x41221e=_0x2f4c5d[_0x08d2('0x1a')],_0x5df38c=_0x173263[_0x08d2('0x1b')],_0x5e8b92=_0x173263[_0x08d2('0x1b')]+_0x173263[_0x08d2('0x1c')],_0x329be2;if(_0x5e8b92>=_0x41221e){_0x5e8b92=_0x41221e;_0x329be2=0xc8;}else{_0x329be2=0xce;}_0x4face0[_0x08d2('0x19')](_0x329be2);return _0x4face0[_0x08d2('0x1d')](_0x08d2('0x1e'),_0x5df38c+'-'+_0x5e8b92+'/'+_0x41221e)[_0x08d2('0x1f')](_0x2f4c5d);}return null;};}function patchUpdates(_0x53c5cb){return function(_0xfc89db){try{jsonpatch[_0x08d2('0x20')](_0xfc89db,_0x53c5cb,!![]);}catch(_0xdeb15){return BPromise['reject'](_0xdeb15);}return _0xfc89db[_0x08d2('0x21')]();};}function saveUpdates(_0x4053cb,_0x27be5c){return function(_0x47054c){if(_0x47054c){return _0x47054c['update'](_0x4053cb)[_0x08d2('0x22')](function(_0x39d1a6){return _0x39d1a6;});}return null;};}function removeEntity(_0x21f759,_0x36030e){return function(_0x311cf6){if(_0x311cf6){return _0x311cf6[_0x08d2('0x23')]()[_0x08d2('0x22')](function(){var _0x565655=_0x311cf6['get']({'plain':!![]});var _0x49cb19=_0x08d2('0x24');return db[_0x08d2('0x25')][_0x08d2('0x23')]({'where':{'type':_0x49cb19,'resourceId':_0x565655['id']}})[_0x08d2('0x22')](function(){return _0x311cf6;});})['then'](function(){_0x21f759[_0x08d2('0x19')](0xcc)[_0x08d2('0x26')]();});}};}function handleEntityNotFound(_0x319d0f,_0x34d765){return function(_0xae8551){if(!_0xae8551){_0x319d0f['sendStatus'](0x194);}return _0xae8551;};}function handleError(_0x40dd1b,_0x4a0b24){_0x4a0b24=_0x4a0b24||0x1f4;return function(_0x2b4415){logger['error'](_0x2b4415[_0x08d2('0x27')]);if(_0x2b4415['name']){delete _0x2b4415[_0x08d2('0x28')];}_0x40dd1b['status'](_0x4a0b24)[_0x08d2('0x29')](_0x2b4415);};}exports['index']=function(_0x22523a,_0x43576e){var _0x4fe1a2={},_0x16a446={},_0x48ae8c={'count':0x0,'rows':[]};var _0x47ba9b=_[_0x08d2('0x2a')](db[_0x08d2('0x2b')][_0x08d2('0x2c')],function(_0x1aa8e6){return{'name':_0x1aa8e6[_0x08d2('0x2d')],'type':_0x1aa8e6[_0x08d2('0x2e')][_0x08d2('0x2f')]};});_0x16a446[_0x08d2('0x30')]=_[_0x08d2('0x2a')](_0x47ba9b,_0x08d2('0x28'));_0x16a446[_0x08d2('0x31')]=_[_0x08d2('0x32')](_0x22523a['query']);_0x16a446['filters']=_[_0x08d2('0x33')](_0x16a446[_0x08d2('0x30')],_0x16a446[_0x08d2('0x31')]);_0x4fe1a2[_0x08d2('0x34')]=_[_0x08d2('0x33')](_0x16a446[_0x08d2('0x30')],qs['fields'](_0x22523a['query'][_0x08d2('0x35')]));_0x4fe1a2[_0x08d2('0x34')]=_0x4fe1a2['attributes'][_0x08d2('0x36')]?_0x4fe1a2['attributes']:_0x16a446[_0x08d2('0x30')];if(!_0x22523a['query']['hasOwnProperty'](_0x08d2('0x37'))){_0x4fe1a2[_0x08d2('0x1c')]=qs[_0x08d2('0x1c')](_0x22523a[_0x08d2('0x31')][_0x08d2('0x1c')]);_0x4fe1a2[_0x08d2('0x1b')]=qs[_0x08d2('0x1b')](_0x22523a[_0x08d2('0x31')]['offset']);}_0x4fe1a2[_0x08d2('0x38')]=qs[_0x08d2('0x39')](_0x22523a[_0x08d2('0x31')][_0x08d2('0x39')]);_0x4fe1a2[_0x08d2('0x3a')]=qs[_0x08d2('0x3b')](_[_0x08d2('0x3c')](_0x22523a['query'],_0x16a446[_0x08d2('0x3b')]),_0x47ba9b);if(_0x22523a[_0x08d2('0x31')][_0x08d2('0x3d')]){_0x4fe1a2[_0x08d2('0x3a')]=_[_0x08d2('0x3e')](_0x4fe1a2[_0x08d2('0x3a')],{'$or':_[_0x08d2('0x2a')](_0x47ba9b,function(_0x464d19){if(_0x464d19[_0x08d2('0x2e')]!==_0x08d2('0x3f')){var _0x3612ea={};_0x3612ea[_0x464d19[_0x08d2('0x28')]]={'$like':'%'+_0x22523a['query'][_0x08d2('0x3d')]+'%'};return _0x3612ea;}})});}_0x4fe1a2=_[_0x08d2('0x3e')]({},_0x4fe1a2,_0x22523a[_0x08d2('0x40')]);var _0x331557={'where':_0x4fe1a2[_0x08d2('0x3a')]};return db[_0x08d2('0x2b')][_0x08d2('0x1a')](_0x331557)['then'](function(_0x484322){_0x48ae8c[_0x08d2('0x1a')]=_0x484322;if(_0x22523a['query'][_0x08d2('0x41')]){_0x4fe1a2['include']=[{'all':!![]}];}return db[_0x08d2('0x2b')][_0x08d2('0x42')](_0x4fe1a2);})[_0x08d2('0x22')](function(_0x22e882){_0x48ae8c[_0x08d2('0x43')]=_0x22e882;return _0x48ae8c;})['then'](respondWithFilteredResult(_0x43576e,_0x4fe1a2))[_0x08d2('0x44')](handleError(_0x43576e,null));};exports[_0x08d2('0x45')]=function(_0x3eefcd,_0xf22c20){var _0x4fb961={'raw':!![],'where':{'id':_0x3eefcd['params']['id']}},_0x1ba0f6={};_0x1ba0f6[_0x08d2('0x30')]=_['keys'](db[_0x08d2('0x2b')][_0x08d2('0x2c')]);_0x1ba0f6['query']=_['keys'](_0x3eefcd[_0x08d2('0x31')]);_0x1ba0f6[_0x08d2('0x3b')]=_[_0x08d2('0x33')](_0x1ba0f6['model'],_0x1ba0f6['query']);_0x4fb961[_0x08d2('0x34')]=_[_0x08d2('0x33')](_0x1ba0f6['model'],qs[_0x08d2('0x35')](_0x3eefcd[_0x08d2('0x31')][_0x08d2('0x35')]));_0x4fb961[_0x08d2('0x34')]=_0x4fb961[_0x08d2('0x34')][_0x08d2('0x36')]?_0x4fb961[_0x08d2('0x34')]:_0x1ba0f6['model'];if(_0x3eefcd[_0x08d2('0x31')][_0x08d2('0x41')]){_0x4fb961[_0x08d2('0x46')]=[{'all':!![]}];}_0x4fb961=_[_0x08d2('0x3e')]({},_0x4fb961,_0x3eefcd[_0x08d2('0x40')]);return db['SquareOdbc'][_0x08d2('0x47')](_0x4fb961)[_0x08d2('0x22')](handleEntityNotFound(_0xf22c20,null))[_0x08d2('0x22')](respondWithResult(_0xf22c20,null))['catch'](handleError(_0xf22c20,null));};exports[_0x08d2('0x48')]=function(_0x5bc75f,_0x376856){return db['SquareOdbc'][_0x08d2('0x48')](_0x5bc75f[_0x08d2('0x49')],{})[_0x08d2('0x22')](function(_0x25dbaa){var _0x33d907=_0x5bc75f[_0x08d2('0x4a')][_0x08d2('0x4b')]({'plain':!![]});if(!_0x33d907)throw new Error(_0x08d2('0x4c'));if(_0x33d907[_0x08d2('0x4d')]===_0x08d2('0x4a')){var _0x3f4a14=_0x25dbaa[_0x08d2('0x4b')]({'plain':!![]});var _0x2d6950=_0x08d2('0x24');return db['UserProfileSection'][_0x08d2('0x47')]({'where':{'name':_0x2d6950,'userProfileId':_0x33d907[_0x08d2('0x4e')]},'raw':!![]})[_0x08d2('0x22')](function(_0x33c5bd){if(_0x33c5bd&&_0x33c5bd['autoAssociation']===0x0){return db[_0x08d2('0x25')][_0x08d2('0x48')]({'name':_0x3f4a14[_0x08d2('0x28')],'resourceId':_0x3f4a14['id'],'type':_0x33c5bd['name'],'sectionId':_0x33c5bd['id']},{})['then'](function(){return _0x25dbaa;});}else{return _0x25dbaa;}})[_0x08d2('0x44')](function(_0x986ad3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x986ad3);throw _0x986ad3;});}return _0x25dbaa;})[_0x08d2('0x22')](respondWithResult(_0x376856,0xc9))['catch'](handleError(_0x376856,null));};exports[_0x08d2('0x4f')]=function(_0x5a8603,_0x285883){if(_0x5a8603[_0x08d2('0x49')]['id']){delete _0x5a8603['body']['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x5a8603[_0x08d2('0x50')]['id']}})[_0x08d2('0x22')](handleEntityNotFound(_0x285883,null))[_0x08d2('0x22')](saveUpdates(_0x5a8603['body'],null))[_0x08d2('0x22')](respondWithResult(_0x285883,null))['catch'](handleError(_0x285883,null));};exports[_0x08d2('0x23')]=function(_0xe563cc,_0x408257){return db['SquareOdbc']['find']({'where':{'id':_0xe563cc[_0x08d2('0x50')]['id']}})[_0x08d2('0x22')](handleEntityNotFound(_0x408257,null))[_0x08d2('0x22')](removeEntity(_0x408257,null))[_0x08d2('0x44')](handleError(_0x408257,null));};exports[_0x08d2('0x51')]=function(_0x58324d,_0x38f3cf,_0x1279ee){var _0x1ceb3c;return db[_0x08d2('0x2b')][_0x08d2('0x47')]({'where':{'id':_0x58324d[_0x08d2('0x50')]['id']},'attributes':['id',_0x08d2('0x52')]})[_0x08d2('0x22')](handleEntityNotFound(_0x38f3cf,null))[_0x08d2('0x22')](function(_0x4dccb4){if(_0x4dccb4){var _0x299783=require(_0x08d2('0x53'))();_0x299783[_0x08d2('0x54')](_0x4dccb4[_0x08d2('0x52')]);_0x299783[_0x08d2('0x55')]();return _0x4dccb4;}})[_0x08d2('0x22')](respondWithResult(_0x38f3cf,null))['catch'](handleError(_0x38f3cf,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a208721..d152424 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 _0x9ed0=['square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc'];(function(_0x340308,_0x576102){var _0x1424c5=function(_0x4c214d){while(--_0x4c214d){_0x340308['push'](_0x340308['shift']());}};_0x1424c5(++_0x576102);}(_0x9ed0,0xe1));var _0x09ed=function(_0x155e04,_0x28cd61){_0x155e04=_0x155e04-0x0;var _0x4590d0=_0x9ed0[_0x155e04];return _0x4590d0;};'use strict';var _=require(_0x09ed('0x0'));var util=require(_0x09ed('0x1'));var logger=require(_0x09ed('0x2'))(_0x09ed('0x3'));var moment=require(_0x09ed('0x4'));var BPromise=require(_0x09ed('0x5'));var rp=require(_0x09ed('0x6'));var fs=require('fs');var path=require(_0x09ed('0x7'));var rimraf=require('rimraf');var config=require(_0x09ed('0x8'));var attributes=require(_0x09ed('0x9'));module[_0x09ed('0xa')]=function(_0x41eb8c,_0x95ea90){return _0x41eb8c[_0x09ed('0xb')](_0x09ed('0xc'),attributes,{'tableName':_0x09ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','util'];(function(_0x1e7a20,_0x292c7e){var _0x23cb44=function(_0x4dc876){while(--_0x4dc876){_0x1e7a20['push'](_0x1e7a20['shift']());}};_0x23cb44(++_0x292c7e);}(_0x2fc9,0xc2));var _0x92fc=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x2fc9[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var logger=require(_0x92fc('0x1'))(_0x92fc('0x2'));var moment=require(_0x92fc('0x3'));var BPromise=require(_0x92fc('0x4'));var rp=require(_0x92fc('0x5'));var fs=require('fs');var path=require(_0x92fc('0x6'));var rimraf=require(_0x92fc('0x7'));var config=require(_0x92fc('0x8'));var attributes=require(_0x92fc('0x9'));module[_0x92fc('0xa')]=function(_0x5d492e,_0x580d4a){return _0x5d492e['define'](_0x92fc('0xb'),attributes,{'tableName':_0x92fc('0xc'),'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 bb106fe..011f5d6 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 _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x386628,_0x31b5f0){var _0x1ff37b=function(_0x337cea){while(--_0x337cea){_0x386628['push'](_0x386628['shift']());}};_0x1ff37b(++_0x31b5f0);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x54c191,_0x4a04ef){var _0x40ee4a=function(_0x200a79){while(--_0x200a79){_0x54c191['push'](_0x54c191['shift']());}};_0x40ee4a(++_0x4a04ef);}(_0xe14b,0x93));var _0xbe14=function(_0x5cbf7b,_0x3f5dd8){_0x5cbf7b=_0x5cbf7b-0x0;var _0x346596=_0xe14b[_0x5cbf7b];return _0x346596;};'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);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 7dbb7fb..0092d21 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 _0xb574=['getUsers','post','create','addUsers','put','/:id','delete','destroy','removeUsers','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id/users','isAuthenticated'];(function(_0x443547,_0x21d7a8){var _0x1423a8=function(_0x2f8d47){while(--_0x2f8d47){_0x443547['push'](_0x443547['shift']());}};_0x1423a8(++_0x21d7a8);}(_0xb574,0x106));var _0x4b57=function(_0x9c4ce4,_0x4a8da2){_0x9c4ce4=_0x9c4ce4-0x0;var _0x2ed040=_0xb574[_0x9c4ce4];return _0x2ed040;};'use strict';var multer=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var path=require('path');var timeout=require(_0x4b57('0x2'));var express=require(_0x4b57('0x3'));var router=express['Router']();var auth=require(_0x4b57('0x4'));var interaction=require(_0x4b57('0x5'));var config=require(_0x4b57('0x6'));var controller=require(_0x4b57('0x7'));router[_0x4b57('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4b57('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x4b57('0x9'),auth[_0x4b57('0xa')](),controller[_0x4b57('0xb')]);router[_0x4b57('0xc')]('/',auth[_0x4b57('0xa')](),controller[_0x4b57('0xd')]);router[_0x4b57('0xc')](_0x4b57('0x9'),auth['isAuthenticated'](),controller[_0x4b57('0xe')]);router[_0x4b57('0xf')](_0x4b57('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x4b57('0x11')](_0x4b57('0x10'),auth[_0x4b57('0xa')](),controller[_0x4b57('0x12')]);router[_0x4b57('0x11')](_0x4b57('0x9'),auth[_0x4b57('0xa')](),controller[_0x4b57('0x13')]);module[_0x4b57('0x14')]=router; \ No newline at end of file +var _0x58a4=['post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','create'];(function(_0x44b13e,_0x4cdca5){var _0xe700cd=function(_0x2f389d){while(--_0x2f389d){_0x44b13e['push'](_0x44b13e['shift']());}};_0xe700cd(++_0x4cdca5);}(_0x58a4,0xbf));var _0x458a=function(_0x23895f,_0x43e4a9){_0x23895f=_0x23895f-0x0;var _0x39cfc9=_0x58a4[_0x23895f];return _0x39cfc9;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var auth=require(_0x458a('0x6'));var interaction=require(_0x458a('0x7'));var config=require(_0x458a('0x8'));var controller=require(_0x458a('0x9'));router[_0x458a('0xa')]('/',auth[_0x458a('0xb')](),controller[_0x458a('0xc')]);router['get']('/:id',auth[_0x458a('0xb')](),controller[_0x458a('0xd')]);router[_0x458a('0xa')](_0x458a('0xe'),auth[_0x458a('0xb')](),controller['getUsers']);router['post']('/',auth[_0x458a('0xb')](),controller[_0x458a('0xf')]);router[_0x458a('0x10')](_0x458a('0xe'),auth[_0x458a('0xb')](),controller['addUsers']);router[_0x458a('0x11')](_0x458a('0x12'),auth['isAuthenticated'](),controller[_0x458a('0x13')]);router[_0x458a('0x14')](_0x458a('0x12'),auth[_0x458a('0xb')](),controller[_0x458a('0x15')]);router['delete']('/:id/users',auth[_0x458a('0xb')](),controller['removeUsers']);module[_0x458a('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 04c85a2..e228c49 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 _0x22cb=['production','utf8','sequelize','exports','STRING','TEXT','long','getDataValue','preproduction','toString','BLOB'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22cb,0x65));var _0xb22c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x22cb[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb22c('0x0'));module[_0xb22c('0x1')]={'name':{'type':Sequelize[_0xb22c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb22c('0x2')]},'notes':{'type':Sequelize[_0xb22c('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xb22c('0x4')),'get':function(){if(this[_0xb22c('0x5')](_0xb22c('0x6'))){return this[_0xb22c('0x5')](_0xb22c('0x6'))[_0xb22c('0x7')]('utf8');}}},'production':{'type':Sequelize[_0xb22c('0x8')](_0xb22c('0x4')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0xb22c('0x9'))[_0xb22c('0x7')](_0xb22c('0xa'));}}}}; \ No newline at end of file +var _0x2a8c=['toString','name','STRING','TEXT','BLOB','long','getDataValue','preproduction','utf8','production'];(function(_0x1a2d2a,_0x1a8309){var _0x3e08ab=function(_0x5555e7){while(--_0x5555e7){_0x1a2d2a['push'](_0x1a2d2a['shift']());}};_0x3e08ab(++_0x1a8309);}(_0x2a8c,0xc9));var _0xc2a8=function(_0x29b939,_0x57aa23){_0x29b939=_0x29b939-0x0;var _0x20bf72=_0x2a8c[_0x29b939];return _0x20bf72;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc2a8('0x0'),'allowNull':![]},'description':{'type':Sequelize[_0xc2a8('0x1')]},'notes':{'type':Sequelize[_0xc2a8('0x2')]},'preproduction':{'type':Sequelize[_0xc2a8('0x3')](_0xc2a8('0x4')),'get':function(){if(this[_0xc2a8('0x5')](_0xc2a8('0x6'))){return this[_0xc2a8('0x5')](_0xc2a8('0x6'))['toString'](_0xc2a8('0x7'));}}},'production':{'type':Sequelize[_0xc2a8('0x3')](_0xc2a8('0x4')),'get':function(){if(this[_0xc2a8('0x5')](_0xc2a8('0x8'))){return this[_0xc2a8('0x5')](_0xc2a8('0x8'))[_0xc2a8('0x9')]('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index cb94bb9..e0292e7 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 _0x99a1=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','eml-format','fast-json-patch','moment','bluebird','mustache','sox','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','defaults','redis','localhost','./squareProject.socket','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','SquareProjects','UserProfileResource','then','error','stack','name','send','map','SquareProject','fieldName'];(function(_0x47355d,_0x538398){var _0x4badc1=function(_0x41a4d2){while(--_0x41a4d2){_0x47355d['push'](_0x47355d['shift']());}};_0x4badc1(++_0x538398);}(_0x99a1,0x1f4));var _0x199a=function(_0x2ce705,_0x3a0316){_0x2ce705=_0x2ce705-0x0;var _0x3e70fb=_0x99a1[_0x2ce705];return _0x3e70fb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x199a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x199a('0x1'));var rp=require('request-promise');var moment=require(_0x199a('0x2'));var BPromise=require(_0x199a('0x3'));var Mustache=require(_0x199a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x199a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x199a('0x6'));var squel=require('squel');var crypto=require(_0x199a('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x199a('0x8'));var querystring=require(_0x199a('0x9'));var Papa=require(_0x199a('0xa'));var Redis=require(_0x199a('0xb'));var authService=require(_0x199a('0xc'));var qs=require(_0x199a('0xd'));var as=require(_0x199a('0xe'));var hardwareService=require(_0x199a('0xf'));var logger=require(_0x199a('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x199a('0x11')](config[_0x199a('0x12')],{'host':_0x199a('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x199a('0x12')]));require(_0x199a('0x14'))[_0x199a('0x15')](socket);function respondWithStatusCode(_0x3ba25a,_0x21db0a){_0x21db0a=_0x21db0a||0xcc;return function(_0x2261ca){if(_0x2261ca){return _0x3ba25a[_0x199a('0x16')](_0x21db0a);}return _0x3ba25a['status'](_0x21db0a)[_0x199a('0x17')]();};}function respondWithResult(_0x511f7d,_0x57b7ff){_0x57b7ff=_0x57b7ff||0xc8;return function(_0x557e07){if(_0x557e07){return _0x511f7d[_0x199a('0x18')](_0x57b7ff)['json'](_0x557e07);}};}function respondWithFilteredResult(_0x52142a,_0x2048b3){return function(_0x3df5a3){if(_0x3df5a3){var _0xaeadb0=_0x3df5a3[_0x199a('0x19')],_0x4f5af8=_0x2048b3['offset'],_0x2ae2ee=_0x2048b3[_0x199a('0x1a')]+_0x2048b3[_0x199a('0x1b')],_0x134301;if(_0x2ae2ee>=_0xaeadb0){_0x2ae2ee=_0xaeadb0;_0x134301=0xc8;}else{_0x134301=0xce;}_0x52142a['status'](_0x134301);return _0x52142a[_0x199a('0x1c')](_0x199a('0x1d'),_0x4f5af8+'-'+_0x2ae2ee+'/'+_0xaeadb0)[_0x199a('0x1e')](_0x3df5a3);}return null;};}function patchUpdates(_0x3711a4){return function(_0x45ccbc){try{jsonpatch[_0x199a('0x1f')](_0x45ccbc,_0x3711a4,!![]);}catch(_0x562959){return BPromise[_0x199a('0x20')](_0x562959);}return _0x45ccbc[_0x199a('0x21')]();};}function saveUpdates(_0x55e7ec,_0x1ed173){return function(_0x2af592){if(_0x2af592){return _0x2af592[_0x199a('0x22')](_0x55e7ec)['then'](function(_0x1259c6){return _0x1259c6;});}return null;};}function removeEntity(_0xf08389,_0x21afa5){return function(_0x3f05db){if(_0x3f05db){return _0x3f05db[_0x199a('0x23')]()['then'](function(){var _0x4c12ca=_0x3f05db['get']({'plain':!![]});var _0x4dcaba=_0x199a('0x24');return db[_0x199a('0x25')][_0x199a('0x23')]({'where':{'type':_0x4dcaba,'resourceId':_0x4c12ca['id']}})[_0x199a('0x26')](function(){return _0x3f05db;});})[_0x199a('0x26')](function(){_0xf08389['status'](0xcc)[_0x199a('0x17')]();});}};}function handleEntityNotFound(_0x4228a4,_0x38c3e7){return function(_0x2453f6){if(!_0x2453f6){_0x4228a4[_0x199a('0x16')](0x194);}return _0x2453f6;};}function handleError(_0x4fc9af,_0x351bc9){_0x351bc9=_0x351bc9||0x1f4;return function(_0x16264a){logger[_0x199a('0x27')](_0x16264a[_0x199a('0x28')]);if(_0x16264a[_0x199a('0x29')]){delete _0x16264a[_0x199a('0x29')];}_0x4fc9af['status'](_0x351bc9)[_0x199a('0x2a')](_0x16264a);};}exports['index']=function(_0x396c71,_0x448a59){var _0x76e1da={},_0x52eb1b={},_0x1b3998={'count':0x0,'rows':[]};var _0x16d162=_[_0x199a('0x2b')](db[_0x199a('0x2c')]['rawAttributes'],function(_0x55c754){return{'name':_0x55c754[_0x199a('0x2d')],'type':_0x55c754[_0x199a('0x2e')][_0x199a('0x2f')]};});_0x52eb1b[_0x199a('0x30')]=_['map'](_0x16d162,'name');_0x52eb1b[_0x199a('0x31')]=_[_0x199a('0x32')](_0x396c71[_0x199a('0x31')]);_0x52eb1b[_0x199a('0x33')]=_[_0x199a('0x34')](_0x52eb1b[_0x199a('0x30')],_0x52eb1b[_0x199a('0x31')]);_0x76e1da[_0x199a('0x35')]=_[_0x199a('0x34')](_0x52eb1b[_0x199a('0x30')],qs[_0x199a('0x36')](_0x396c71[_0x199a('0x31')][_0x199a('0x36')]));_0x76e1da[_0x199a('0x35')]=_0x76e1da[_0x199a('0x35')][_0x199a('0x37')]?_0x76e1da[_0x199a('0x35')]:_0x52eb1b[_0x199a('0x30')];if(!_0x396c71[_0x199a('0x31')][_0x199a('0x38')](_0x199a('0x39'))){_0x76e1da['limit']=qs[_0x199a('0x1b')](_0x396c71['query']['limit']);_0x76e1da[_0x199a('0x1a')]=qs[_0x199a('0x1a')](_0x396c71[_0x199a('0x31')][_0x199a('0x1a')]);}_0x76e1da[_0x199a('0x3a')]=qs[_0x199a('0x3b')](_0x396c71[_0x199a('0x31')][_0x199a('0x3b')]);_0x76e1da[_0x199a('0x3c')]=qs[_0x199a('0x33')](_[_0x199a('0x3d')](_0x396c71[_0x199a('0x31')],_0x52eb1b['filters']),_0x16d162);if(_0x396c71[_0x199a('0x31')][_0x199a('0x3e')]){_0x76e1da[_0x199a('0x3c')]=_['merge'](_0x76e1da['where'],{'$or':_[_0x199a('0x2b')](_0x16d162,function(_0x915b07){if(_0x915b07[_0x199a('0x2e')]!==_0x199a('0x3f')){var _0x5dfc4c={};_0x5dfc4c[_0x915b07['name']]={'$like':'%'+_0x396c71[_0x199a('0x31')][_0x199a('0x3e')]+'%'};return _0x5dfc4c;}})});}_0x76e1da=_[_0x199a('0x40')]({},_0x76e1da,_0x396c71[_0x199a('0x41')]);var _0x21d3fe={'where':_0x76e1da['where']};return db[_0x199a('0x2c')]['count'](_0x21d3fe)[_0x199a('0x26')](function(_0x51b46){_0x1b3998[_0x199a('0x19')]=_0x51b46;if(_0x396c71[_0x199a('0x31')][_0x199a('0x42')]){_0x76e1da[_0x199a('0x43')]=[{'all':!![]}];}return db[_0x199a('0x2c')][_0x199a('0x44')](_0x76e1da);})[_0x199a('0x26')](function(_0x3e9ad9){_0x1b3998[_0x199a('0x45')]=_0x3e9ad9;return _0x1b3998;})[_0x199a('0x26')](respondWithFilteredResult(_0x448a59,_0x76e1da))[_0x199a('0x46')](handleError(_0x448a59,null));};exports[_0x199a('0x47')]=function(_0x443b85,_0x2c16c0){var _0x4abe95={'raw':![],'where':{'id':_0x443b85['params']['id']}},_0x31c4a5={};_0x31c4a5[_0x199a('0x30')]=_[_0x199a('0x32')](db[_0x199a('0x2c')]['rawAttributes']);_0x31c4a5['query']=_[_0x199a('0x32')](_0x443b85[_0x199a('0x31')]);_0x31c4a5[_0x199a('0x33')]=_['intersection'](_0x31c4a5[_0x199a('0x30')],_0x31c4a5[_0x199a('0x31')]);_0x4abe95['attributes']=_[_0x199a('0x34')](_0x31c4a5[_0x199a('0x30')],qs['fields'](_0x443b85['query'][_0x199a('0x36')]));_0x4abe95[_0x199a('0x35')]=_0x4abe95[_0x199a('0x35')][_0x199a('0x37')]?_0x4abe95[_0x199a('0x35')]:_0x31c4a5['model'];if(_0x443b85[_0x199a('0x31')][_0x199a('0x42')]){_0x4abe95['include']=[{'all':!![]}];}_0x4abe95=_['merge']({},_0x4abe95,_0x443b85[_0x199a('0x41')]);return db[_0x199a('0x2c')][_0x199a('0x48')](_0x4abe95)[_0x199a('0x26')](handleEntityNotFound(_0x2c16c0,null))[_0x199a('0x26')](respondWithResult(_0x2c16c0,null))[_0x199a('0x46')](handleError(_0x2c16c0,null));};exports[_0x199a('0x49')]=function(_0x496eaf,_0x2d5372){return db[_0x199a('0x2c')][_0x199a('0x49')](_0x496eaf['body'],{})[_0x199a('0x26')](function(_0x281991){var _0x35a34e=_0x496eaf[_0x199a('0x4a')][_0x199a('0x4b')]({'plain':!![]});if(!_0x35a34e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35a34e[_0x199a('0x4c')]===_0x199a('0x4a')){var _0x13b2f7=_0x281991['get']({'plain':!![]});var _0x1492d7='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x1492d7,'userProfileId':_0x35a34e[_0x199a('0x4d')]},'raw':!![]})['then'](function(_0x2343f3){if(_0x2343f3&&_0x2343f3[_0x199a('0x4e')]===0x0){return db[_0x199a('0x25')]['create']({'name':_0x13b2f7['name'],'resourceId':_0x13b2f7['id'],'type':_0x2343f3[_0x199a('0x29')],'sectionId':_0x2343f3['id']},{})[_0x199a('0x26')](function(){return _0x281991;});}else{return _0x281991;}})[_0x199a('0x46')](function(_0x53d615){logger[_0x199a('0x27')](_0x199a('0x4f'),_0x53d615);throw _0x53d615;});}return _0x281991;})[_0x199a('0x26')](respondWithResult(_0x2d5372,0xc9))[_0x199a('0x46')](handleError(_0x2d5372,null));};exports['update']=function(_0x1dee0f,_0xfbe4d4){if(_0x1dee0f[_0x199a('0x50')]['id']){delete _0x1dee0f[_0x199a('0x50')]['id'];}return db[_0x199a('0x2c')][_0x199a('0x48')]({'where':{'id':_0x1dee0f['params']['id']}})[_0x199a('0x26')](handleEntityNotFound(_0xfbe4d4,null))[_0x199a('0x26')](saveUpdates(_0x1dee0f['body'],null))['then'](respondWithResult(_0xfbe4d4,null))[_0x199a('0x46')](handleError(_0xfbe4d4,null));};exports['destroy']=function(_0x49aeb2,_0x9199f9){return db[_0x199a('0x2c')][_0x199a('0x48')]({'where':{'id':_0x49aeb2[_0x199a('0x51')]['id']}})['then'](handleEntityNotFound(_0x9199f9,null))[_0x199a('0x26')](removeEntity(_0x9199f9,null))['catch'](handleError(_0x9199f9,null));};exports[_0x199a('0x52')]=function(_0x17bc30,_0x2e4a4b,_0x339920){return db[_0x199a('0x2c')]['find']({'where':{'id':_0x17bc30[_0x199a('0x51')]['id']}})[_0x199a('0x26')](handleEntityNotFound(_0x2e4a4b,null))[_0x199a('0x26')](function(_0x532f7e){if(_0x532f7e){return _0x532f7e[_0x199a('0x52')](_0x17bc30[_0x199a('0x50')][_0x199a('0x53')],_[_0x199a('0x54')](_0x17bc30[_0x199a('0x50')],[_0x199a('0x53'),'id'])||{});}})['then'](respondWithResult(_0x2e4a4b,null))[_0x199a('0x46')](handleError(_0x2e4a4b,null));};exports[_0x199a('0x55')]=function(_0x3942e9,_0x718e00,_0x268dc9){return db[_0x199a('0x2c')]['find']({'where':{'id':_0x3942e9[_0x199a('0x51')]['id']}})[_0x199a('0x26')](handleEntityNotFound(_0x718e00,null))[_0x199a('0x26')](function(_0xb2ce6c){if(_0xb2ce6c){return _0xb2ce6c[_0x199a('0x55')](_0x3942e9[_0x199a('0x31')]['ids'])['then'](function(){if(_[_0x199a('0x56')](_0x3942e9[_0x199a('0x31')]['ids'])){for(var _0x3ec5a0=0x0;_0x3ec5a0<_0x3942e9['query'][_0x199a('0x53')]['length'];_0x3ec5a0+=0x1){socket['emit'](_0x199a('0x57'),{'UserId':Number(_0x3942e9[_0x199a('0x31')][_0x199a('0x53')][_0x3ec5a0]),'SquareProjectId':Number(_0x3942e9['params']['id'])});}}else{socket[_0x199a('0x58')](_0x199a('0x57'),{'UserId':Number(_0x3942e9[_0x199a('0x31')][_0x199a('0x53')]),'SquareProjectId':Number(_0x3942e9[_0x199a('0x51')]['id'])});}});}})[_0x199a('0x26')](respondWithStatusCode(_0x718e00,null))['catch'](handleError(_0x718e00,null));};exports[_0x199a('0x59')]=function(_0x3e1c26,_0x51b7c3,_0x320c23){var _0x2dcba0={};var _0x249cff={};var _0x20e7a4;var _0x855076;return db[_0x199a('0x2c')][_0x199a('0x5a')]({'where':{'id':_0x3e1c26[_0x199a('0x51')]['id']}})[_0x199a('0x26')](handleEntityNotFound(_0x51b7c3,null))[_0x199a('0x26')](function(_0x13a1bd){if(_0x13a1bd){_0x20e7a4=_0x13a1bd;_0x249cff[_0x199a('0x30')]=_[_0x199a('0x32')](db['User']['rawAttributes']);_0x249cff['query']=_['keys'](_0x3e1c26['query']);_0x249cff[_0x199a('0x33')]=_[_0x199a('0x34')](_0x249cff['model'],_0x249cff['query']);_0x2dcba0[_0x199a('0x35')]=_[_0x199a('0x34')](_0x249cff[_0x199a('0x30')],qs[_0x199a('0x36')](_0x3e1c26[_0x199a('0x31')][_0x199a('0x36')]));_0x2dcba0[_0x199a('0x35')]=_0x2dcba0['attributes']['length']?_0x2dcba0[_0x199a('0x35')]:_0x249cff[_0x199a('0x30')];_0x2dcba0[_0x199a('0x3a')]=qs[_0x199a('0x3b')](_0x3e1c26[_0x199a('0x31')][_0x199a('0x3b')]);_0x2dcba0[_0x199a('0x3c')]=qs[_0x199a('0x33')](_[_0x199a('0x3d')](_0x3e1c26[_0x199a('0x31')],_0x249cff['filters']));if(_0x3e1c26[_0x199a('0x31')][_0x199a('0x3e')]){_0x2dcba0[_0x199a('0x3c')]=_[_0x199a('0x40')](_0x2dcba0[_0x199a('0x3c')],{'$or':_[_0x199a('0x2b')](_0x2dcba0[_0x199a('0x35')],function(_0x1b3ed0){var _0x3d1eee={};_0x3d1eee[_0x1b3ed0]={'$like':'%'+_0x3e1c26[_0x199a('0x31')]['filter']+'%'};return _0x3d1eee;})});}_0x2dcba0=_[_0x199a('0x40')]({},_0x2dcba0,_0x3e1c26[_0x199a('0x41')]);return _0x20e7a4[_0x199a('0x59')](_0x2dcba0);}})[_0x199a('0x26')](function(_0x56a2ce){if(_0x56a2ce){_0x855076=_0x56a2ce['length'];if(!_0x3e1c26[_0x199a('0x31')][_0x199a('0x38')](_0x199a('0x39'))){_0x2dcba0[_0x199a('0x1b')]=qs[_0x199a('0x1b')](_0x3e1c26[_0x199a('0x31')][_0x199a('0x1b')]);_0x2dcba0[_0x199a('0x1a')]=qs[_0x199a('0x1a')](_0x3e1c26['query'][_0x199a('0x1a')]);}return _0x20e7a4['getUsers'](_0x2dcba0);}})[_0x199a('0x26')](function(_0x53ad0d){if(_0x53ad0d){return _0x53ad0d?{'count':_0x855076,'rows':_0x53ad0d}:null;}})['then'](respondWithResult(_0x51b7c3,null))[_0x199a('0x46')](handleError(_0x51b7c3,null));}; \ No newline at end of file +var _0xcbdb=['Content-Range','json','apply','reject','save','update','then','SquareProjects','UserProfileResource','destroy','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','sort','filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','length','merge','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','order','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','set'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xcbdb,0x16a));var _0xbcbd=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xcbdb[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0xbcbd('0x0'));var emlformat=require(_0xbcbd('0x1'));var rimraf=require(_0xbcbd('0x2'));var zipdir=require(_0xbcbd('0x3'));var jsonpatch=require(_0xbcbd('0x4'));var rp=require(_0xbcbd('0x5'));var moment=require(_0xbcbd('0x6'));var BPromise=require(_0xbcbd('0x7'));var Mustache=require('mustache');var util=require(_0xbcbd('0x8'));var path=require(_0xbcbd('0x9'));var sox=require('sox');var csv=require(_0xbcbd('0xa'));var ejs=require(_0xbcbd('0xb'));var fs=require('fs');var _=require(_0xbcbd('0xc'));var squel=require(_0xbcbd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbcbd('0xe'));var toCsv=require(_0xbcbd('0xa'));var querystring=require(_0xbcbd('0xf'));var Papa=require('papaparse');var Redis=require(_0xbcbd('0x10'));var authService=require(_0xbcbd('0x11'));var qs=require(_0xbcbd('0x12'));var as=require(_0xbcbd('0x13'));var hardwareService=require(_0xbcbd('0x14'));var logger=require(_0xbcbd('0x15'))(_0xbcbd('0x16'));var utils=require('../../config/utils');var config=require(_0xbcbd('0x17'));var db=require(_0xbcbd('0x18'))['db'];config[_0xbcbd('0x19')]=_['defaults'](config[_0xbcbd('0x19')],{'host':_0xbcbd('0x1a'),'port':0x18eb});var socket=require(_0xbcbd('0x1b'))(new Redis(config[_0xbcbd('0x19')]));require('./squareProject.socket')[_0xbcbd('0x1c')](socket);function respondWithStatusCode(_0x2000f3,_0x55f78d){_0x55f78d=_0x55f78d||0xcc;return function(_0x4ecfb4){if(_0x4ecfb4){return _0x2000f3[_0xbcbd('0x1d')](_0x55f78d);}return _0x2000f3[_0xbcbd('0x1e')](_0x55f78d)['end']();};}function respondWithResult(_0x25eaeb,_0x611b04){_0x611b04=_0x611b04||0xc8;return function(_0x2ebf0c){if(_0x2ebf0c){return _0x25eaeb['status'](_0x611b04)['json'](_0x2ebf0c);}};}function respondWithFilteredResult(_0xb0ddd2,_0x1a9530){return function(_0x32727f){if(_0x32727f){var _0x140911=_0x32727f['count'],_0x14f700=_0x1a9530[_0xbcbd('0x1f')],_0x1111c8=_0x1a9530['offset']+_0x1a9530[_0xbcbd('0x20')],_0x458c18;if(_0x1111c8>=_0x140911){_0x1111c8=_0x140911;_0x458c18=0xc8;}else{_0x458c18=0xce;}_0xb0ddd2[_0xbcbd('0x1e')](_0x458c18);return _0xb0ddd2[_0xbcbd('0x21')](_0xbcbd('0x22'),_0x14f700+'-'+_0x1111c8+'/'+_0x140911)[_0xbcbd('0x23')](_0x32727f);}return null;};}function patchUpdates(_0x37706e){return function(_0x1a464c){try{jsonpatch[_0xbcbd('0x24')](_0x1a464c,_0x37706e,!![]);}catch(_0x3c4850){return BPromise[_0xbcbd('0x25')](_0x3c4850);}return _0x1a464c[_0xbcbd('0x26')]();};}function saveUpdates(_0x2a8b0d,_0x2dac1f){return function(_0x3fbdb7){if(_0x3fbdb7){return _0x3fbdb7[_0xbcbd('0x27')](_0x2a8b0d)['then'](function(_0x563b2d){return _0x563b2d;});}return null;};}function removeEntity(_0xa4f741,_0x16d73c){return function(_0x454b66){if(_0x454b66){return _0x454b66['destroy']()[_0xbcbd('0x28')](function(){var _0x3da2ad=_0x454b66['get']({'plain':!![]});var _0x1539cb=_0xbcbd('0x29');return db[_0xbcbd('0x2a')][_0xbcbd('0x2b')]({'where':{'type':_0x1539cb,'resourceId':_0x3da2ad['id']}})[_0xbcbd('0x28')](function(){return _0x454b66;});})[_0xbcbd('0x28')](function(){_0xa4f741[_0xbcbd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3163e0,_0x3b4c13){return function(_0x59a7aa){if(!_0x59a7aa){_0x3163e0['sendStatus'](0x194);}return _0x59a7aa;};}function handleError(_0x145d61,_0x10e93b){_0x10e93b=_0x10e93b||0x1f4;return function(_0x40bd58){logger['error'](_0x40bd58[_0xbcbd('0x2c')]);if(_0x40bd58[_0xbcbd('0x2d')]){delete _0x40bd58[_0xbcbd('0x2d')];}_0x145d61[_0xbcbd('0x1e')](_0x10e93b)[_0xbcbd('0x2e')](_0x40bd58);};}exports[_0xbcbd('0x2f')]=function(_0x394b2e,_0x2dde82){var _0x556034={},_0x5c2664={},_0x321caa={'count':0x0,'rows':[]};var _0x45bc02=_[_0xbcbd('0x30')](db[_0xbcbd('0x31')][_0xbcbd('0x32')],function(_0xa14764){return{'name':_0xa14764[_0xbcbd('0x33')],'type':_0xa14764[_0xbcbd('0x34')][_0xbcbd('0x35')]};});_0x5c2664['model']=_[_0xbcbd('0x30')](_0x45bc02,_0xbcbd('0x2d'));_0x5c2664[_0xbcbd('0x36')]=_['keys'](_0x394b2e[_0xbcbd('0x36')]);_0x5c2664[_0xbcbd('0x37')]=_[_0xbcbd('0x38')](_0x5c2664[_0xbcbd('0x39')],_0x5c2664['query']);_0x556034[_0xbcbd('0x3a')]=_[_0xbcbd('0x38')](_0x5c2664[_0xbcbd('0x39')],qs[_0xbcbd('0x3b')](_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x3b')]));_0x556034[_0xbcbd('0x3a')]=_0x556034[_0xbcbd('0x3a')]['length']?_0x556034[_0xbcbd('0x3a')]:_0x5c2664[_0xbcbd('0x39')];if(!_0x394b2e['query']['hasOwnProperty'](_0xbcbd('0x3c'))){_0x556034[_0xbcbd('0x20')]=qs[_0xbcbd('0x20')](_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x20')]);_0x556034[_0xbcbd('0x1f')]=qs[_0xbcbd('0x1f')](_0x394b2e['query'][_0xbcbd('0x1f')]);}_0x556034['order']=qs[_0xbcbd('0x3d')](_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x3d')]);_0x556034['where']=qs[_0xbcbd('0x37')](_['pick'](_0x394b2e[_0xbcbd('0x36')],_0x5c2664[_0xbcbd('0x37')]),_0x45bc02);if(_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x3e')]){_0x556034['where']=_['merge'](_0x556034[_0xbcbd('0x3f')],{'$or':_[_0xbcbd('0x30')](_0x45bc02,function(_0x2982b2){if(_0x2982b2['type']!==_0xbcbd('0x40')){var _0x406129={};_0x406129[_0x2982b2[_0xbcbd('0x2d')]]={'$like':'%'+_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x3e')]+'%'};return _0x406129;}})});}_0x556034=_['merge']({},_0x556034,_0x394b2e[_0xbcbd('0x41')]);var _0xc73e4={'where':_0x556034[_0xbcbd('0x3f')]};return db[_0xbcbd('0x31')][_0xbcbd('0x42')](_0xc73e4)[_0xbcbd('0x28')](function(_0x92ef45){_0x321caa[_0xbcbd('0x42')]=_0x92ef45;if(_0x394b2e[_0xbcbd('0x36')][_0xbcbd('0x43')]){_0x556034[_0xbcbd('0x44')]=[{'all':!![]}];}return db[_0xbcbd('0x31')][_0xbcbd('0x45')](_0x556034);})[_0xbcbd('0x28')](function(_0x1ac338){_0x321caa[_0xbcbd('0x46')]=_0x1ac338;return _0x321caa;})[_0xbcbd('0x28')](respondWithFilteredResult(_0x2dde82,_0x556034))[_0xbcbd('0x47')](handleError(_0x2dde82,null));};exports[_0xbcbd('0x48')]=function(_0x550796,_0x2228a0){var _0x24c529={'raw':![],'where':{'id':_0x550796[_0xbcbd('0x49')]['id']}},_0x3187d6={};_0x3187d6[_0xbcbd('0x39')]=_['keys'](db[_0xbcbd('0x31')][_0xbcbd('0x32')]);_0x3187d6[_0xbcbd('0x36')]=_[_0xbcbd('0x4a')](_0x550796['query']);_0x3187d6[_0xbcbd('0x37')]=_[_0xbcbd('0x38')](_0x3187d6[_0xbcbd('0x39')],_0x3187d6['query']);_0x24c529[_0xbcbd('0x3a')]=_[_0xbcbd('0x38')](_0x3187d6['model'],qs[_0xbcbd('0x3b')](_0x550796[_0xbcbd('0x36')][_0xbcbd('0x3b')]));_0x24c529[_0xbcbd('0x3a')]=_0x24c529[_0xbcbd('0x3a')][_0xbcbd('0x4b')]?_0x24c529['attributes']:_0x3187d6['model'];if(_0x550796[_0xbcbd('0x36')][_0xbcbd('0x43')]){_0x24c529['include']=[{'all':!![]}];}_0x24c529=_[_0xbcbd('0x4c')]({},_0x24c529,_0x550796[_0xbcbd('0x41')]);return db[_0xbcbd('0x31')]['find'](_0x24c529)[_0xbcbd('0x28')](handleEntityNotFound(_0x2228a0,null))[_0xbcbd('0x28')](respondWithResult(_0x2228a0,null))[_0xbcbd('0x47')](handleError(_0x2228a0,null));};exports[_0xbcbd('0x4d')]=function(_0x1b3d88,_0x30a3b5){return db['SquareProject'][_0xbcbd('0x4d')](_0x1b3d88[_0xbcbd('0x4e')],{})[_0xbcbd('0x28')](function(_0x2184b8){var _0x524b73=_0x1b3d88['user'][_0xbcbd('0x4f')]({'plain':!![]});if(!_0x524b73)throw new Error(_0xbcbd('0x50'));if(_0x524b73[_0xbcbd('0x51')]===_0xbcbd('0x52')){var _0x5ce937=_0x2184b8[_0xbcbd('0x4f')]({'plain':!![]});var _0x29fdb8=_0xbcbd('0x29');return db[_0xbcbd('0x53')]['find']({'where':{'name':_0x29fdb8,'userProfileId':_0x524b73['userProfileId']},'raw':!![]})[_0xbcbd('0x28')](function(_0x23cc05){if(_0x23cc05&&_0x23cc05[_0xbcbd('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5ce937[_0xbcbd('0x2d')],'resourceId':_0x5ce937['id'],'type':_0x23cc05[_0xbcbd('0x2d')],'sectionId':_0x23cc05['id']},{})['then'](function(){return _0x2184b8;});}else{return _0x2184b8;}})[_0xbcbd('0x47')](function(_0x10d33a){logger[_0xbcbd('0x55')](_0xbcbd('0x56'),_0x10d33a);throw _0x10d33a;});}return _0x2184b8;})[_0xbcbd('0x28')](respondWithResult(_0x30a3b5,0xc9))[_0xbcbd('0x47')](handleError(_0x30a3b5,null));};exports[_0xbcbd('0x27')]=function(_0x317ffb,_0x282fb1){if(_0x317ffb[_0xbcbd('0x4e')]['id']){delete _0x317ffb[_0xbcbd('0x4e')]['id'];}return db[_0xbcbd('0x31')][_0xbcbd('0x57')]({'where':{'id':_0x317ffb[_0xbcbd('0x49')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x282fb1,null))['then'](saveUpdates(_0x317ffb[_0xbcbd('0x4e')],null))['then'](respondWithResult(_0x282fb1,null))['catch'](handleError(_0x282fb1,null));};exports[_0xbcbd('0x2b')]=function(_0x4f8a10,_0x5c3e9e){return db[_0xbcbd('0x31')][_0xbcbd('0x57')]({'where':{'id':_0x4f8a10[_0xbcbd('0x49')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x5c3e9e,null))[_0xbcbd('0x28')](removeEntity(_0x5c3e9e,null))['catch'](handleError(_0x5c3e9e,null));};exports[_0xbcbd('0x58')]=function(_0x2fe842,_0x1b06fd,_0x28068b){return db['SquareProject'][_0xbcbd('0x57')]({'where':{'id':_0x2fe842[_0xbcbd('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b06fd,null))[_0xbcbd('0x28')](function(_0x59fc9c){if(_0x59fc9c){return _0x59fc9c[_0xbcbd('0x58')](_0x2fe842['body'][_0xbcbd('0x59')],_[_0xbcbd('0x5a')](_0x2fe842[_0xbcbd('0x4e')],[_0xbcbd('0x59'),'id'])||{});}})[_0xbcbd('0x28')](respondWithResult(_0x1b06fd,null))[_0xbcbd('0x47')](handleError(_0x1b06fd,null));};exports[_0xbcbd('0x5b')]=function(_0x2b228,_0x4e266b,_0x20518f){return db[_0xbcbd('0x31')]['find']({'where':{'id':_0x2b228['params']['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x4e266b,null))[_0xbcbd('0x28')](function(_0x59a965){if(_0x59a965){return _0x59a965['removeUsers'](_0x2b228[_0xbcbd('0x36')]['ids'])['then'](function(){if(_[_0xbcbd('0x5c')](_0x2b228[_0xbcbd('0x36')][_0xbcbd('0x59')])){for(var _0x3e285e=0x0;_0x3e285e<_0x2b228[_0xbcbd('0x36')][_0xbcbd('0x59')][_0xbcbd('0x4b')];_0x3e285e+=0x1){socket[_0xbcbd('0x5d')](_0xbcbd('0x5e'),{'UserId':Number(_0x2b228[_0xbcbd('0x36')]['ids'][_0x3e285e]),'SquareProjectId':Number(_0x2b228[_0xbcbd('0x49')]['id'])});}}else{socket[_0xbcbd('0x5d')](_0xbcbd('0x5e'),{'UserId':Number(_0x2b228['query'][_0xbcbd('0x59')]),'SquareProjectId':Number(_0x2b228[_0xbcbd('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x4e266b,null))[_0xbcbd('0x47')](handleError(_0x4e266b,null));};exports[_0xbcbd('0x5f')]=function(_0x285f65,_0x405055,_0x1edb9c){var _0x592776={};var _0x4545fd={};var _0x20299a;var _0x42eef0;return db[_0xbcbd('0x31')]['findOne']({'where':{'id':_0x285f65[_0xbcbd('0x49')]['id']}})[_0xbcbd('0x28')](handleEntityNotFound(_0x405055,null))[_0xbcbd('0x28')](function(_0x8bbe8f){if(_0x8bbe8f){_0x20299a=_0x8bbe8f;_0x4545fd[_0xbcbd('0x39')]=_[_0xbcbd('0x4a')](db[_0xbcbd('0x60')]['rawAttributes']);_0x4545fd[_0xbcbd('0x36')]=_[_0xbcbd('0x4a')](_0x285f65[_0xbcbd('0x36')]);_0x4545fd['filters']=_[_0xbcbd('0x38')](_0x4545fd[_0xbcbd('0x39')],_0x4545fd[_0xbcbd('0x36')]);_0x592776['attributes']=_['intersection'](_0x4545fd['model'],qs['fields'](_0x285f65[_0xbcbd('0x36')]['fields']));_0x592776['attributes']=_0x592776[_0xbcbd('0x3a')]['length']?_0x592776[_0xbcbd('0x3a')]:_0x4545fd[_0xbcbd('0x39')];_0x592776[_0xbcbd('0x61')]=qs[_0xbcbd('0x3d')](_0x285f65[_0xbcbd('0x36')][_0xbcbd('0x3d')]);_0x592776[_0xbcbd('0x3f')]=qs[_0xbcbd('0x37')](_['pick'](_0x285f65[_0xbcbd('0x36')],_0x4545fd[_0xbcbd('0x37')]));if(_0x285f65[_0xbcbd('0x36')][_0xbcbd('0x3e')]){_0x592776[_0xbcbd('0x3f')]=_[_0xbcbd('0x4c')](_0x592776[_0xbcbd('0x3f')],{'$or':_[_0xbcbd('0x30')](_0x592776[_0xbcbd('0x3a')],function(_0xce48a5){var _0x44d990={};_0x44d990[_0xce48a5]={'$like':'%'+_0x285f65[_0xbcbd('0x36')][_0xbcbd('0x3e')]+'%'};return _0x44d990;})});}_0x592776=_[_0xbcbd('0x4c')]({},_0x592776,_0x285f65[_0xbcbd('0x41')]);return _0x20299a['getUsers'](_0x592776);}})[_0xbcbd('0x28')](function(_0x14327b){if(_0x14327b){_0x42eef0=_0x14327b[_0xbcbd('0x4b')];if(!_0x285f65[_0xbcbd('0x36')][_0xbcbd('0x62')](_0xbcbd('0x3c'))){_0x592776['limit']=qs[_0xbcbd('0x20')](_0x285f65[_0xbcbd('0x36')][_0xbcbd('0x20')]);_0x592776['offset']=qs[_0xbcbd('0x1f')](_0x285f65['query'][_0xbcbd('0x1f')]);}return _0x20299a[_0xbcbd('0x5f')](_0x592776);}})['then'](function(_0x2b95ef){if(_0x2b95ef){return _0x2b95ef?{'count':_0x42eef0,'rows':_0x2b95ef}:null;}})[_0xbcbd('0x28')](respondWithResult(_0x405055,null))[_0xbcbd('0x47')](handleError(_0x405055,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f1cb32a..c6019de 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 _0xbaa8=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x92712a,_0x37be16){var _0x957fac=function(_0x432bc4){while(--_0x432bc4){_0x92712a['push'](_0x92712a['shift']());}};_0x957fac(++_0x37be16);}(_0xbaa8,0x1a5));var _0x8baa=function(_0x201e24,_0x4a4c44){_0x201e24=_0x201e24-0x0;var _0x5f0269=_0xbaa8[_0x201e24];return _0x5f0269;};'use strict';var EventEmitter=require(_0x8baa('0x0'));var SquareProject=require(_0x8baa('0x1'))['db'][_0x8baa('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8baa('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8baa('0x4')};function emitEvent(_0x12ed3f){return function(_0x3fa162,_0x4510a3,_0x50dae1){SquareProjectEvents[_0x8baa('0x5')](_0x12ed3f+':'+_0x3fa162['id'],_0x3fa162);SquareProjectEvents[_0x8baa('0x5')](_0x12ed3f,_0x3fa162);_0x50dae1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8baa('0x6')](e,emitEvent(event));}}module[_0x8baa('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x860a=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','SquareProject'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x860a,0x14a));var _0xa860=function(_0xbb432,_0x44dc55){_0xbb432=_0xbb432-0x0;var _0x18be1e=_0x860a[_0xbb432];return _0x18be1e;};'use strict';var EventEmitter=require(_0xa860('0x0'));var SquareProject=require(_0xa860('0x1'))['db'][_0xa860('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa860('0x3')](0x0);var events={'afterCreate':_0xa860('0x4'),'afterUpdate':_0xa860('0x5'),'afterDestroy':_0xa860('0x6')};function emitEvent(_0x4daba9){return function(_0x138944,_0x4c42be,_0x66b2c1){SquareProjectEvents[_0xa860('0x7')](_0x4daba9+':'+_0x138944['id'],_0x138944);SquareProjectEvents[_0xa860('0x7')](_0x4daba9,_0x138944);_0x66b2c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa860('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2763ca9..2db3f2f 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 _0x1927=['path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x1927,0x1c1));var _0x7192=function(_0xd3ac55,_0x3915b6){_0xd3ac55=_0xd3ac55-0x0;var _0x526e60=_0x1927[_0xd3ac55];return _0x526e60;};'use strict';var _=require(_0x7192('0x0'));var util=require(_0x7192('0x1'));var logger=require(_0x7192('0x2'))(_0x7192('0x3'));var moment=require(_0x7192('0x4'));var BPromise=require('bluebird');var rp=require(_0x7192('0x5'));var fs=require('fs');var path=require(_0x7192('0x6'));var rimraf=require(_0x7192('0x7'));var config=require(_0x7192('0x8'));var attributes=require(_0x7192('0x9'));module[_0x7192('0xa')]=function(_0x4c32b7,_0x419fc4){return _0x4c32b7['define'](_0x7192('0xb'),attributes,{'tableName':_0x7192('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dd6=['../../config/environment','define','SquareProject','square_projects','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x9dd6,0x1dd));var _0x69dd=function(_0x55bcf3,_0x3d51f2){_0x55bcf3=_0x55bcf3-0x0;var _0x239514=_0x9dd6[_0x55bcf3];return _0x239514;};'use strict';var _=require(_0x69dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x69dd('0x1'));var moment=require(_0x69dd('0x2'));var BPromise=require(_0x69dd('0x3'));var rp=require(_0x69dd('0x4'));var fs=require('fs');var path=require(_0x69dd('0x5'));var rimraf=require(_0x69dd('0x6'));var config=require(_0x69dd('0x7'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x5b6b05,_0x37cbe1){return _0x5b6b05[_0x69dd('0x8')](_0x69dd('0x9'),attributes,{'tableName':_0x69dd('0xa'),'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 18e80b2..46e7684 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 _0x6a5f=['include','ShowSquareProject','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','SquareProject','find','raw','options','where','attributes','map'];(function(_0x4e12fb,_0x59342c){var _0xdba8b2=function(_0x429cfd){while(--_0x429cfd){_0x4e12fb['push'](_0x4e12fb['shift']());}};_0xdba8b2(++_0x59342c);}(_0x6a5f,0x1bf));var _0xf6a5=function(_0x565404,_0x846949){_0x565404=_0x565404-0x0;var _0x2b0bb3=_0x6a5f[_0x565404];return _0x2b0bb3;};'use strict';var _=require(_0xf6a5('0x0'));var util=require(_0xf6a5('0x1'));var moment=require(_0xf6a5('0x2'));var BPromise=require(_0xf6a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6a5('0x4'));var db=require(_0xf6a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6a5('0x6'));var config=require(_0xf6a5('0x7'));var jayson=require(_0xf6a5('0x8'));var client=jayson[_0xf6a5('0x9')][_0xf6a5('0xa')]({'port':0x232a});config[_0xf6a5('0xb')]=_[_0xf6a5('0xc')](config[_0xf6a5('0xb')],{'host':_0xf6a5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6a5('0xb')]));require(_0xf6a5('0xe'))[_0xf6a5('0xf')](socket);function respondWithRpcPromise(_0x4cbd7e,_0x449e8e,_0x1638b8){return new BPromise(function(_0x3e4f67,_0x45d69a){return client[_0xf6a5('0x10')](_0x4cbd7e,_0x1638b8)[_0xf6a5('0x11')](function(_0xb50471){logger[_0xf6a5('0x12')](_0xf6a5('0x13'),_0x449e8e,_0xf6a5('0x14'));logger[_0xf6a5('0x15')](_0xf6a5('0x16'),_0x449e8e,_0xf6a5('0x14'),JSON['stringify'](_0xb50471));if(_0xb50471['error']){if(_0xb50471[_0xf6a5('0x17')]['code']===0x1f4){logger[_0xf6a5('0x17')](_0xf6a5('0x13'),_0x449e8e,_0xb50471[_0xf6a5('0x17')][_0xf6a5('0x18')]);return _0x45d69a(_0xb50471[_0xf6a5('0x17')][_0xf6a5('0x18')]);}logger['error'](_0xf6a5('0x13'),_0x449e8e,_0xb50471[_0xf6a5('0x17')][_0xf6a5('0x18')]);return _0x3e4f67(_0xb50471[_0xf6a5('0x17')][_0xf6a5('0x18')]);}else{logger[_0xf6a5('0x12')]('SquareProject,\x20%s,\x20%s',_0x449e8e,_0xf6a5('0x14'));_0x3e4f67(_0xb50471[_0xf6a5('0x19')]['message']);}})[_0xf6a5('0x1a')](function(_0x556a11){logger[_0xf6a5('0x17')](_0xf6a5('0x13'),_0x449e8e,_0x556a11);_0x45d69a(_0x556a11);});});}exports['ShowSquareProject']=function(_0xebbef4){var _0x3acca2=this;return new Promise(function(_0x1a1b2f,_0x3196ee){return db[_0xf6a5('0x1b')][_0xf6a5('0x1c')]({'raw':_0xebbef4['options']?_0xebbef4['options'][_0xf6a5('0x1d')]===undefined?!![]:![]:!![],'where':_0xebbef4[_0xf6a5('0x1e')]?_0xebbef4['options'][_0xf6a5('0x1f')]||null:null,'attributes':_0xebbef4[_0xf6a5('0x1e')]?_0xebbef4[_0xf6a5('0x1e')][_0xf6a5('0x20')]||null:null,'include':_0xebbef4[_0xf6a5('0x1e')]?_0xebbef4['options']['include']?_[_0xf6a5('0x21')](_0xebbef4[_0xf6a5('0x1e')][_0xf6a5('0x22')],function(_0x4d7774){return{'model':db[_0x4d7774['model']],'as':_0x4d7774['as'],'attributes':_0x4d7774[_0xf6a5('0x20')],'include':_0x4d7774[_0xf6a5('0x22')]?_[_0xf6a5('0x21')](_0x4d7774[_0xf6a5('0x22')],function(_0x4ca99a){return{'model':db[_0x4ca99a['model']],'as':_0x4ca99a['as'],'attributes':_0x4ca99a[_0xf6a5('0x20')],'include':_0x4ca99a[_0xf6a5('0x22')]?_[_0xf6a5('0x21')](_0x4ca99a[_0xf6a5('0x22')],function(_0x1fa3cb){return{'model':db[_0x1fa3cb['model']],'as':_0x1fa3cb['as'],'attributes':_0x1fa3cb[_0xf6a5('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf6a5('0x11')](function(_0x2ad243){logger[_0xf6a5('0x12')](_0xf6a5('0x23'),_0xebbef4);logger['debug']('ShowSquareProject',_0xebbef4,JSON[_0xf6a5('0x24')](_0x2ad243));_0x1a1b2f(_0x2ad243);})[_0xf6a5('0x1a')](function(_0x5b39c9){logger['error'](_0xf6a5('0x23'),_0x5b39c9[_0xf6a5('0x18')],_0xebbef4);_0x3196ee(_0x3acca2[_0xf6a5('0x17')](0x1f4,_0x5b39c9['message']));});});}; \ No newline at end of file +var _0x5704=['catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','debug','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./squareProject.socket','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','message','SquareProject,\x20%s,\x20%s'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x5704,0x9a));var _0x4570=function(_0x3cac17,_0x174a50){_0x3cac17=_0x3cac17-0x0;var _0x38e3be=_0x5704[_0x3cac17];return _0x38e3be;};'use strict';var _=require(_0x4570('0x0'));var util=require(_0x4570('0x1'));var moment=require(_0x4570('0x2'));var BPromise=require(_0x4570('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4570('0x4'));var db=require(_0x4570('0x5'))['db'];var utils=require(_0x4570('0x6'));var logger=require(_0x4570('0x7'))(_0x4570('0x8'));var config=require('../../config/environment');var jayson=require(_0x4570('0x9'));var client=jayson[_0x4570('0xa')]['http']({'port':0x232a});config[_0x4570('0xb')]=_['defaults'](config['redis'],{'host':_0x4570('0xc'),'port':0x18eb});var socket=require(_0x4570('0xd'))(new Redis(config[_0x4570('0xb')]));require(_0x4570('0xe'))['register'](socket);function respondWithRpcPromise(_0xea31b9,_0x3aa1f2,_0x3db862){return new BPromise(function(_0x5ce60d,_0x43a229){return client['request'](_0xea31b9,_0x3db862)['then'](function(_0x4604d0){logger[_0x4570('0xf')]('SquareProject,\x20%s,\x20%s',_0x3aa1f2,_0x4570('0x10'));logger['debug'](_0x4570('0x11'),_0x3aa1f2,_0x4570('0x10'),JSON['stringify'](_0x4604d0));if(_0x4604d0['error']){if(_0x4604d0[_0x4570('0x12')]['code']===0x1f4){logger[_0x4570('0x12')]('SquareProject,\x20%s,\x20%s',_0x3aa1f2,_0x4604d0['error']['message']);return _0x43a229(_0x4604d0['error'][_0x4570('0x13')]);}logger[_0x4570('0x12')](_0x4570('0x14'),_0x3aa1f2,_0x4604d0[_0x4570('0x12')][_0x4570('0x13')]);return _0x5ce60d(_0x4604d0['error'][_0x4570('0x13')]);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x3aa1f2,_0x4570('0x10'));_0x5ce60d(_0x4604d0['result']['message']);}})[_0x4570('0x15')](function(_0x14113c){logger[_0x4570('0x12')]('SquareProject,\x20%s,\x20%s',_0x3aa1f2,_0x14113c);_0x43a229(_0x14113c);});});}exports[_0x4570('0x16')]=function(_0x4c636f){var _0x1f227e=this;return new Promise(function(_0x209918,_0x38ee6a){return db[_0x4570('0x17')][_0x4570('0x18')]({'raw':_0x4c636f[_0x4570('0x19')]?_0x4c636f['options'][_0x4570('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c636f[_0x4570('0x19')]?_0x4c636f['options'][_0x4570('0x1b')]||null:null,'attributes':_0x4c636f[_0x4570('0x19')]?_0x4c636f[_0x4570('0x19')][_0x4570('0x1c')]||null:null,'include':_0x4c636f[_0x4570('0x19')]?_0x4c636f[_0x4570('0x19')][_0x4570('0x1d')]?_[_0x4570('0x1e')](_0x4c636f[_0x4570('0x19')]['include'],function(_0x1f14f7){return{'model':db[_0x1f14f7[_0x4570('0x1f')]],'as':_0x1f14f7['as'],'attributes':_0x1f14f7[_0x4570('0x1c')],'include':_0x1f14f7[_0x4570('0x1d')]?_[_0x4570('0x1e')](_0x1f14f7[_0x4570('0x1d')],function(_0x4a6dc6){return{'model':db[_0x4a6dc6[_0x4570('0x1f')]],'as':_0x4a6dc6['as'],'attributes':_0x4a6dc6[_0x4570('0x1c')],'include':_0x4a6dc6[_0x4570('0x1d')]?_['map'](_0x4a6dc6[_0x4570('0x1d')],function(_0x432c99){return{'model':db[_0x432c99[_0x4570('0x1f')]],'as':_0x432c99['as'],'attributes':_0x432c99[_0x4570('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4570('0x20')](function(_0x322d17){logger[_0x4570('0xf')](_0x4570('0x16'),_0x4c636f);logger[_0x4570('0x21')](_0x4570('0x16'),_0x4c636f,JSON[_0x4570('0x22')](_0x322d17));_0x209918(_0x322d17);})['catch'](function(_0x33eddc){logger['error'](_0x4570('0x16'),_0x33eddc[_0x4570('0x13')],_0x4c636f);_0x38ee6a(_0x1f227e[_0x4570('0x12')](0x1f4,_0x33eddc[_0x4570('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 3dcb5d1..60bdb4b 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 _0xda19=['removeListener','register','length','save','remove'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xda19,0xd5));var _0x9da1=function(_0x214e18,_0x13189b){_0x214e18=_0x214e18-0x0;var _0x323044=_0xda19[_0x214e18];return _0x323044;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x9da1('0x0'),_0x9da1('0x1'),'update'];function createListener(_0x175479,_0x503770){return function(_0x435076){_0x503770['emit'](_0x175479,_0x435076);};}function removeListener(_0x2a77c7,_0xef6f5a){return function(){SquareProjectEvents[_0x9da1('0x2')](_0x2a77c7,_0xef6f5a);};}exports[_0x9da1('0x3')]=function(_0x156faf){for(var _0x2dcbc6=0x0,_0x23e4f7=events[_0x9da1('0x4')];_0x2dcbc6<_0x23e4f7;_0x2dcbc6++){var _0x1c24e6=events[_0x2dcbc6];var _0x5e2d18=createListener('squareProject:'+_0x1c24e6,_0x156faf);SquareProjectEvents['on'](_0x1c24e6,_0x5e2d18);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','squareProject:','./squareProject.events','update'];(function(_0x20be7f,_0x3ca238){var _0x2b7dd7=function(_0x3e581f){while(--_0x3e581f){_0x20be7f['push'](_0x20be7f['shift']());}};_0x2b7dd7(++_0x3ca238);}(_0x0295,0x1f0));var _0x5029=function(_0x2b7cec,_0x948c5d){_0x2b7cec=_0x2b7cec-0x0;var _0x5c7780=_0x0295[_0x2b7cec];return _0x5c7780;};'use strict';var SquareProjectEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){SquareProjectEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);SquareProjectEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 48930d4..ffaccaa 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 _0x505a=['download','create','/:id','update','delete','/:id/delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x505a,0x1d4));var _0xa505=function(_0x3fdfd0,_0x785356){_0x3fdfd0=_0x3fdfd0-0x0;var _0xe00443=_0x505a[_0x3fdfd0];return _0xe00443;};'use strict';var multer=require(_0xa505('0x0'));var util=require(_0xa505('0x1'));var path=require(_0xa505('0x2'));var timeout=require(_0xa505('0x3'));var express=require('express');var router=express[_0xa505('0x4')]();var auth=require(_0xa505('0x5'));var interaction=require(_0xa505('0x6'));var config=require(_0xa505('0x7'));var controller=require('./squareRecording.controller');router[_0xa505('0x8')]('/',auth['isAuthenticated'](),controller[_0xa505('0x9')]);router[_0xa505('0x8')]('/:id',auth[_0xa505('0xa')](),controller[_0xa505('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xa505('0xc')]);router['post']('/',auth[_0xa505('0xa')](),controller[_0xa505('0xd')]);router['put'](_0xa505('0xe'),auth[_0xa505('0xa')](),controller[_0xa505('0xf')]);router[_0xa505('0x10')](_0xa505('0x11'),auth[_0xa505('0xa')](),controller[_0xa505('0x12')]);module[_0xa505('0x13')]=router; \ No newline at end of file +var _0x2dd4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','isAuthenticated','show','post','/:id','update','delete','/:id/delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1f5d29,_0x13d54a){var _0x395feb=function(_0x2cd603){while(--_0x2cd603){_0x1f5d29['push'](_0x1f5d29['shift']());}};_0x395feb(++_0x13d54a);}(_0x2dd4,0x174));var _0x42dd=function(_0x47cb95,_0x522ce0){_0x47cb95=_0x47cb95-0x0;var _0x3613e1=_0x2dd4[_0x47cb95];return _0x3613e1;};'use strict';var multer=require(_0x42dd('0x0'));var util=require(_0x42dd('0x1'));var path=require(_0x42dd('0x2'));var timeout=require(_0x42dd('0x3'));var express=require(_0x42dd('0x4'));var router=express[_0x42dd('0x5')]();var auth=require(_0x42dd('0x6'));var interaction=require(_0x42dd('0x7'));var config=require(_0x42dd('0x8'));var controller=require(_0x42dd('0x9'));router[_0x42dd('0xa')]('/',auth['isAuthenticated'](),controller[_0x42dd('0xb')]);router[_0x42dd('0xa')]('/:id',auth[_0x42dd('0xc')](),controller[_0x42dd('0xd')]);router[_0x42dd('0xa')]('/:id/download',auth[_0x42dd('0xc')](),controller['download']);router[_0x42dd('0xe')]('/',auth[_0x42dd('0xc')](),controller['create']);router['put'](_0x42dd('0xf'),auth[_0x42dd('0xc')](),controller[_0x42dd('0x10')]);router[_0x42dd('0x11')](_0x42dd('0x12'),auth[_0x42dd('0xc')](),controller[_0x42dd('0x13')]);module[_0x42dd('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 3a5d989..53711e5 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 _0x84db=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x1cdbc7,_0x2d4be0){var _0x22ddce=function(_0xa4142a){while(--_0xa4142a){_0x1cdbc7['push'](_0x1cdbc7['shift']());}};_0x22ddce(++_0x2d4be0);}(_0x84db,0x195));var _0xb84d=function(_0x4dae05,_0x4ee4f2){_0x4dae05=_0x4dae05-0x0;var _0x3db1ad=_0x84db[_0x4dae05];return _0x3db1ad;};'use strict';var Sequelize=require(_0xb84d('0x0'));module[_0xb84d('0x1')]={'uniqueid':{'type':Sequelize[_0xb84d('0x2')]},'callerid':{'type':Sequelize[_0xb84d('0x2')]},'calleridname':{'type':Sequelize[_0xb84d('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xb84d('0x2')]},'projectName':{'type':Sequelize[_0xb84d('0x2')]},'saveName':{'type':Sequelize[_0xb84d('0x2')]},'filename':{'type':Sequelize[_0xb84d('0x2')]},'savePath':{'type':Sequelize[_0xb84d('0x2')]},'format':{'type':Sequelize[_0xb84d('0x3')],'get':function(){var _0x993268='';var _0x132018=this[_0xb84d('0x4')](_0xb84d('0x5'));if(_0x132018){_0x993268=_0x132018[_0xb84d('0x6')](_0x132018[_0xb84d('0x7')]('.'));}return _0x993268;}}}; \ No newline at end of file +var _0xa937=['sequelize','exports','STRING','VIRTUAL','savePath','substring'];(function(_0x18bf31,_0xef30ae){var _0x1ac933=function(_0x2ac176){while(--_0x2ac176){_0x18bf31['push'](_0x18bf31['shift']());}};_0x1ac933(++_0xef30ae);}(_0xa937,0xde));var _0x7a93=function(_0x5a6741,_0x344a94){_0x5a6741=_0x5a6741-0x0;var _0x4c491b=_0xa937[_0x5a6741];return _0x4c491b;};'use strict';var Sequelize=require(_0x7a93('0x0'));module[_0x7a93('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7a93('0x2')]},'context':{'type':Sequelize[_0x7a93('0x2')]},'extension':{'type':Sequelize[_0x7a93('0x2')]},'priority':{'type':Sequelize[_0x7a93('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7a93('0x2')]},'projectName':{'type':Sequelize[_0x7a93('0x2')]},'saveName':{'type':Sequelize[_0x7a93('0x2')]},'filename':{'type':Sequelize[_0x7a93('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7a93('0x3')],'get':function(){var _0x3699b3='';var _0x80c60=this['getDataValue'](_0x7a93('0x4'));if(_0x80c60){_0x3699b3=_0x80c60[_0x7a93('0x5')](_0x80c60['lastIndexOf']('.'));}return _0x3699b3;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ed906dd..f0b1587 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 _0x51e7=['zip-dir','fast-json-patch','request-promise','mustache','path','sox','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','download','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf'];(function(_0x2dd003,_0x1c3812){var _0xde824f=function(_0x4bc70b){while(--_0x4bc70b){_0x2dd003['push'](_0x2dd003['shift']());}};_0xde824f(++_0x1c3812);}(_0x51e7,0xb8));var _0x751e=function(_0x273280,_0x16254e){_0x273280=_0x273280-0x0;var _0x28ea92=_0x51e7[_0x273280];return _0x28ea92;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x751e('0x0'));var rimraf=require(_0x751e('0x1'));var zipdir=require(_0x751e('0x2'));var jsonpatch=require(_0x751e('0x3'));var rp=require(_0x751e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x751e('0x5'));var util=require('util');var path=require(_0x751e('0x6'));var sox=require(_0x751e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x751e('0x8'));var crypto=require(_0x751e('0x9'));var jsforce=require(_0x751e('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x751e('0xb'));var Papa=require('papaparse');var Redis=require(_0x751e('0xc'));var authService=require(_0x751e('0xd'));var qs=require(_0x751e('0xe'));var as=require(_0x751e('0xf'));var hardwareService=require(_0x751e('0x10'));var logger=require(_0x751e('0x11'))('api');var utils=require(_0x751e('0x12'));var config=require(_0x751e('0x13'));var db=require(_0x751e('0x14'))['db'];function respondWithStatusCode(_0x6b1566,_0x201ee9){_0x201ee9=_0x201ee9||0xcc;return function(_0x1dc66a){if(_0x1dc66a){return _0x6b1566[_0x751e('0x15')](_0x201ee9);}return _0x6b1566[_0x751e('0x16')](_0x201ee9)[_0x751e('0x17')]();};}function respondWithResult(_0x45c38a,_0x180cc1){_0x180cc1=_0x180cc1||0xc8;return function(_0xd0e7ac){if(_0xd0e7ac){return _0x45c38a[_0x751e('0x16')](_0x180cc1)[_0x751e('0x18')](_0xd0e7ac);}};}function respondWithFilteredResult(_0x4e68a8,_0x134b9f){return function(_0x1cb927){if(_0x1cb927){var _0x1c82c7=_0x1cb927[_0x751e('0x19')],_0x2254cf=_0x134b9f[_0x751e('0x1a')],_0x80c9bc=_0x134b9f[_0x751e('0x1a')]+_0x134b9f[_0x751e('0x1b')],_0x1178e8;if(_0x80c9bc>=_0x1c82c7){_0x80c9bc=_0x1c82c7;_0x1178e8=0xc8;}else{_0x1178e8=0xce;}_0x4e68a8['status'](_0x1178e8);return _0x4e68a8[_0x751e('0x1c')](_0x751e('0x1d'),_0x2254cf+'-'+_0x80c9bc+'/'+_0x1c82c7)[_0x751e('0x18')](_0x1cb927);}return null;};}function patchUpdates(_0x1d9853){return function(_0x29e850){try{jsonpatch[_0x751e('0x1e')](_0x29e850,_0x1d9853,!![]);}catch(_0x4326c9){return BPromise['reject'](_0x4326c9);}return _0x29e850['save']();};}function saveUpdates(_0x2c6b3a,_0x1a3986){return function(_0x243e0e){if(_0x243e0e){return _0x243e0e[_0x751e('0x1f')](_0x2c6b3a)[_0x751e('0x20')](function(_0x1e7c0b){return _0x1e7c0b;});}return null;};}function removeEntity(_0x596bbe,_0x3f0597){return function(_0x547db6){if(_0x547db6){return _0x547db6['destroy']()[_0x751e('0x20')](function(){_0x596bbe['status'](0xcc)[_0x751e('0x17')]();});}};}function handleEntityNotFound(_0x11ef01,_0x4f62b9){return function(_0x5af6c1){if(!_0x5af6c1){_0x11ef01[_0x751e('0x15')](0x194);}return _0x5af6c1;};}function handleError(_0x16032c,_0x1c623f){_0x1c623f=_0x1c623f||0x1f4;return function(_0x5c5562){logger[_0x751e('0x21')](_0x5c5562['stack']);if(_0x5c5562[_0x751e('0x22')]){delete _0x5c5562[_0x751e('0x22')];}_0x16032c[_0x751e('0x16')](_0x1c623f)[_0x751e('0x23')](_0x5c5562);};}exports[_0x751e('0x24')]=function(_0x11943b,_0x3e7f00){var _0x32562e={},_0x39d77c={},_0x45fb42={'count':0x0,'rows':[]};var _0x205580=_[_0x751e('0x25')](db[_0x751e('0x26')][_0x751e('0x27')],function(_0xf76e6b){return{'name':_0xf76e6b[_0x751e('0x28')],'type':_0xf76e6b[_0x751e('0x29')][_0x751e('0x2a')]};});_0x39d77c[_0x751e('0x2b')]=_['map'](_0x205580,'name');_0x39d77c['query']=_[_0x751e('0x2c')](_0x11943b[_0x751e('0x2d')]);_0x39d77c[_0x751e('0x2e')]=_[_0x751e('0x2f')](_0x39d77c[_0x751e('0x2b')],_0x39d77c[_0x751e('0x2d')]);_0x32562e['attributes']=_['intersection'](_0x39d77c['model'],qs['fields'](_0x11943b[_0x751e('0x2d')][_0x751e('0x30')]));_0x32562e[_0x751e('0x31')]=_0x32562e[_0x751e('0x31')][_0x751e('0x32')]?_0x32562e['attributes']:_0x39d77c[_0x751e('0x2b')];if(!_0x11943b[_0x751e('0x2d')][_0x751e('0x33')](_0x751e('0x34'))){_0x32562e[_0x751e('0x1b')]=qs[_0x751e('0x1b')](_0x11943b['query']['limit']);_0x32562e[_0x751e('0x1a')]=qs[_0x751e('0x1a')](_0x11943b[_0x751e('0x2d')]['offset']);}_0x32562e[_0x751e('0x35')]=qs[_0x751e('0x36')](_0x11943b[_0x751e('0x2d')][_0x751e('0x36')]);_0x32562e[_0x751e('0x37')]=qs[_0x751e('0x2e')](_['pick'](_0x11943b[_0x751e('0x2d')],_0x39d77c[_0x751e('0x2e')]),_0x205580);if(_0x11943b[_0x751e('0x2d')][_0x751e('0x38')]){_0x32562e[_0x751e('0x37')]=_[_0x751e('0x39')](_0x32562e[_0x751e('0x37')],{'$or':_[_0x751e('0x25')](_0x205580,function(_0x286b60){if(_0x286b60[_0x751e('0x29')]!==_0x751e('0x3a')){var _0x21818e={};_0x21818e[_0x286b60[_0x751e('0x22')]]={'$like':'%'+_0x11943b[_0x751e('0x2d')][_0x751e('0x38')]+'%'};return _0x21818e;}})});}_0x32562e=_[_0x751e('0x39')]({},_0x32562e,_0x11943b[_0x751e('0x3b')]);var _0x1fa893={'where':_0x32562e[_0x751e('0x37')]};return db[_0x751e('0x26')][_0x751e('0x19')](_0x1fa893)[_0x751e('0x20')](function(_0x13ec91){_0x45fb42[_0x751e('0x19')]=_0x13ec91;if(_0x11943b[_0x751e('0x2d')][_0x751e('0x3c')]){_0x32562e[_0x751e('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x751e('0x3e')](_0x32562e);})[_0x751e('0x20')](function(_0x38b653){_0x45fb42['rows']=_0x38b653;return _0x45fb42;})['then'](respondWithFilteredResult(_0x3e7f00,_0x32562e))['catch'](handleError(_0x3e7f00,null));};exports[_0x751e('0x3f')]=function(_0x4b212a,_0x2441f0){var _0x4454ad={'raw':!![],'where':{'id':_0x4b212a[_0x751e('0x40')]['id']}},_0x21dff6={};_0x21dff6['model']=_[_0x751e('0x2c')](db[_0x751e('0x26')][_0x751e('0x27')]);_0x21dff6[_0x751e('0x2d')]=_[_0x751e('0x2c')](_0x4b212a['query']);_0x21dff6[_0x751e('0x2e')]=_[_0x751e('0x2f')](_0x21dff6[_0x751e('0x2b')],_0x21dff6['query']);_0x4454ad[_0x751e('0x31')]=_['intersection'](_0x21dff6[_0x751e('0x2b')],qs['fields'](_0x4b212a[_0x751e('0x2d')][_0x751e('0x30')]));_0x4454ad['attributes']=_0x4454ad['attributes'][_0x751e('0x32')]?_0x4454ad[_0x751e('0x31')]:_0x21dff6['model'];if(_0x4b212a[_0x751e('0x2d')][_0x751e('0x3c')]){_0x4454ad[_0x751e('0x3d')]=[{'all':!![]}];}_0x4454ad=_['merge']({},_0x4454ad,_0x4b212a[_0x751e('0x3b')]);return db[_0x751e('0x26')][_0x751e('0x41')](_0x4454ad)[_0x751e('0x20')](handleEntityNotFound(_0x2441f0,null))['then'](respondWithResult(_0x2441f0,null))[_0x751e('0x42')](handleError(_0x2441f0,null));};exports[_0x751e('0x43')]=function(_0x38ef3c,_0x37b6d6){return db['SquareRecording'][_0x751e('0x43')](_0x38ef3c['body'],{})[_0x751e('0x20')](respondWithResult(_0x37b6d6,0xc9))[_0x751e('0x42')](handleError(_0x37b6d6,null));};exports[_0x751e('0x1f')]=function(_0x1edb24,_0x14ecee){if(_0x1edb24[_0x751e('0x44')]['id']){delete _0x1edb24[_0x751e('0x44')]['id'];}return db[_0x751e('0x26')][_0x751e('0x41')]({'where':{'id':_0x1edb24['params']['id']}})['then'](handleEntityNotFound(_0x14ecee,null))['then'](saveUpdates(_0x1edb24['body'],null))[_0x751e('0x20')](respondWithResult(_0x14ecee,null))[_0x751e('0x42')](handleError(_0x14ecee,null));};exports[_0x751e('0x45')]=function(_0x67136e,_0x55449a,_0x5a73d3){var _0x1f4cac=require(_0x751e('0x46'));var _0x44bcd0=![];var _0x571520={};if(_0x67136e[_0x751e('0x2d')][_0x751e('0x29')]&&_0x67136e[_0x751e('0x2d')][_0x751e('0x29')]===_0x751e('0x47')){_0x571520[_0x751e('0x47')]=_0x67136e[_0x751e('0x40')]['id'];}else{_0x571520['id']=_0x67136e[_0x751e('0x40')]['id'];}return db[_0x751e('0x26')][_0x751e('0x41')]({'where':_0x571520,'attributes':['id','savePath',_0x751e('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x55449a,null))['then'](function(_0x1fcbe9){if(_0x1fcbe9){var _0x24db62=_0x1fcbe9[_0x751e('0x49')];var _0x382b52=util['format'](_0x751e('0x4a'),_0x24db62);if(fs[_0x751e('0x4b')](_0x382b52)){_0x44bcd0=!![];return _0x1f4cac[_0x751e('0x4c')](_0x382b52,_0x24db62,config[_0x751e('0x4d')][_0x751e('0x4e')])[_0x751e('0x20')](function(){return _0x1fcbe9;});}return _0x1fcbe9;}})[_0x751e('0x20')](function(_0x354484){if(_0x354484){var _0x190fa7=_0x354484[_0x751e('0x49')];if(!fs[_0x751e('0x4b')](_0x190fa7)){throw new db[(_0x751e('0x4f'))]['ValidationError'](_0x751e('0x50'));}if(_0x354484['filename']){return _0x55449a[_0x751e('0x45')](_0x190fa7,_0x354484[_0x751e('0x48')]+path[_0x751e('0x51')](_0x190fa7),function(){if(_0x44bcd0){fs[_0x751e('0x52')](_0x190fa7);}});}else{return _0x55449a['download'](_0x190fa7,function(_0x17301e){if(_0x44bcd0){fs[_0x751e('0x52')](_0x190fa7);}});}}})[_0x751e('0x42')](function(_0x4960cd){if(_0x4960cd[_0x751e('0x53')]===_0x751e('0x50')){_0x55449a['status'](0x194)[_0x751e('0x23')](_0x751e('0x54'));}else{return handleError(_0x55449a,null);}});};exports[_0x751e('0x55')]=function(_0x2f7eea,_0x4695b5){return db[_0x751e('0x26')][_0x751e('0x41')]({'where':{'id':_0x2f7eea[_0x751e('0x40')]['id']}})[_0x751e('0x20')](function(_0x49082a){if(!_0x49082a)throw new ReferenceError(_0x751e('0x56'));return _0x49082a;})[_0x751e('0x20')](function(_0x54d806){var _0x3ddb55=_0x54d806[_0x751e('0x49')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x3ddb55);if(!_[_0x751e('0x57')](_0x54d806[_0x751e('0x49')])&&fs[_0x751e('0x4b')](_0x3ddb55)){logger[_0x751e('0x58')](_0x751e('0x59')+_0x3ddb55+_0x751e('0x5a'));fs[_0x751e('0x5b')](_0x3ddb55);}_0x3ddb55=_0x3ddb55+_0x751e('0x5c');if(!_['isNil'](_0x54d806[_0x751e('0x49')])&&fs[_0x751e('0x4b')](_0x3ddb55)){logger[_0x751e('0x58')]('File:\x20\x22'+_0x3ddb55+_0x751e('0x5a'));fs['unlinkSync'](_0x3ddb55);}return _0x54d806;})[_0x751e('0x20')](function(_0x390e19){if(!_0x390e19)throw new InternalError();return _0x390e19[_0x751e('0x55')]();})[_0x751e('0x20')](function(){_0x4695b5['status'](0xcc)[_0x751e('0x17')]();})[_0x751e('0x42')](handleError(_0x4695b5,null));}; \ No newline at end of file +var _0x3387=['type','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','update','download','uniqueid','params','find','savePath','filename','format','%s.cypher','existsSync','decryptFile','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','set','Content-Range','apply','save','then','destroy','end','sendStatus','error','stack','name','map','SquareRecording','fieldName'];(function(_0x26b59b,_0x5e730a){var _0x48cef7=function(_0x372bed){while(--_0x372bed){_0x26b59b['push'](_0x26b59b['shift']());}};_0x48cef7(++_0x5e730a);}(_0x3387,0xf0));var _0x7338=function(_0xfdd058,_0x57c178){_0xfdd058=_0xfdd058-0x0;var _0x37bb60=_0x3387[_0xfdd058];return _0x37bb60;};'use strict';var pdf=require(_0x7338('0x0'));var emlformat=require(_0x7338('0x1'));var rimraf=require(_0x7338('0x2'));var zipdir=require(_0x7338('0x3'));var jsonpatch=require(_0x7338('0x4'));var rp=require(_0x7338('0x5'));var moment=require(_0x7338('0x6'));var BPromise=require(_0x7338('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7338('0x8'));var sox=require(_0x7338('0x9'));var csv=require(_0x7338('0xa'));var ejs=require(_0x7338('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7338('0xc'));var crypto=require('crypto');var jsforce=require(_0x7338('0xd'));var deskjs=require(_0x7338('0xe'));var toCsv=require(_0x7338('0xa'));var querystring=require(_0x7338('0xf'));var Papa=require('papaparse');var Redis=require(_0x7338('0x10'));var authService=require(_0x7338('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7338('0x12'));var hardwareService=require(_0x7338('0x13'));var logger=require(_0x7338('0x14'))(_0x7338('0x15'));var utils=require(_0x7338('0x16'));var config=require('../../config/environment');var db=require(_0x7338('0x17'))['db'];function respondWithStatusCode(_0x2678f3,_0x444e1c){_0x444e1c=_0x444e1c||0xcc;return function(_0x4e3c1a){if(_0x4e3c1a){return _0x2678f3['sendStatus'](_0x444e1c);}return _0x2678f3[_0x7338('0x18')](_0x444e1c)['end']();};}function respondWithResult(_0x399842,_0x5e5d74){_0x5e5d74=_0x5e5d74||0xc8;return function(_0x44d66c){if(_0x44d66c){return _0x399842[_0x7338('0x18')](_0x5e5d74)[_0x7338('0x19')](_0x44d66c);}};}function respondWithFilteredResult(_0x28d38c,_0x104f2c){return function(_0x3764f5){if(_0x3764f5){var _0x34693a=_0x3764f5[_0x7338('0x1a')],_0x4fb04a=_0x104f2c[_0x7338('0x1b')],_0x1b74fa=_0x104f2c[_0x7338('0x1b')]+_0x104f2c['limit'],_0x7e742a;if(_0x1b74fa>=_0x34693a){_0x1b74fa=_0x34693a;_0x7e742a=0xc8;}else{_0x7e742a=0xce;}_0x28d38c[_0x7338('0x18')](_0x7e742a);return _0x28d38c[_0x7338('0x1c')](_0x7338('0x1d'),_0x4fb04a+'-'+_0x1b74fa+'/'+_0x34693a)['json'](_0x3764f5);}return null;};}function patchUpdates(_0x18d169){return function(_0x4a30be){try{jsonpatch[_0x7338('0x1e')](_0x4a30be,_0x18d169,!![]);}catch(_0x187547){return BPromise['reject'](_0x187547);}return _0x4a30be[_0x7338('0x1f')]();};}function saveUpdates(_0x3b0d6b,_0x1817bb){return function(_0x59787c){if(_0x59787c){return _0x59787c['update'](_0x3b0d6b)[_0x7338('0x20')](function(_0x3b5b0d){return _0x3b5b0d;});}return null;};}function removeEntity(_0x3871cc,_0x58c708){return function(_0x30acf5){if(_0x30acf5){return _0x30acf5[_0x7338('0x21')]()[_0x7338('0x20')](function(){_0x3871cc[_0x7338('0x18')](0xcc)[_0x7338('0x22')]();});}};}function handleEntityNotFound(_0x4fd7bb,_0x383d87){return function(_0x3a3781){if(!_0x3a3781){_0x4fd7bb[_0x7338('0x23')](0x194);}return _0x3a3781;};}function handleError(_0x2dd279,_0x1bef09){_0x1bef09=_0x1bef09||0x1f4;return function(_0x1d82f6){logger[_0x7338('0x24')](_0x1d82f6[_0x7338('0x25')]);if(_0x1d82f6[_0x7338('0x26')]){delete _0x1d82f6[_0x7338('0x26')];}_0x2dd279[_0x7338('0x18')](_0x1bef09)['send'](_0x1d82f6);};}exports['index']=function(_0x4018e3,_0x586089){var _0x3fdbc5={},_0x581f63={},_0x2125ae={'count':0x0,'rows':[]};var _0x43903d=_[_0x7338('0x27')](db[_0x7338('0x28')]['rawAttributes'],function(_0x56d7af){return{'name':_0x56d7af[_0x7338('0x29')],'type':_0x56d7af[_0x7338('0x2a')][_0x7338('0x2b')]};});_0x581f63['model']=_[_0x7338('0x27')](_0x43903d,_0x7338('0x26'));_0x581f63[_0x7338('0x2c')]=_[_0x7338('0x2d')](_0x4018e3[_0x7338('0x2c')]);_0x581f63['filters']=_['intersection'](_0x581f63[_0x7338('0x2e')],_0x581f63['query']);_0x3fdbc5['attributes']=_[_0x7338('0x2f')](_0x581f63[_0x7338('0x2e')],qs[_0x7338('0x30')](_0x4018e3['query'][_0x7338('0x30')]));_0x3fdbc5[_0x7338('0x31')]=_0x3fdbc5['attributes'][_0x7338('0x32')]?_0x3fdbc5['attributes']:_0x581f63['model'];if(!_0x4018e3[_0x7338('0x2c')][_0x7338('0x33')]('nolimit')){_0x3fdbc5[_0x7338('0x34')]=qs[_0x7338('0x34')](_0x4018e3[_0x7338('0x2c')][_0x7338('0x34')]);_0x3fdbc5[_0x7338('0x1b')]=qs[_0x7338('0x1b')](_0x4018e3[_0x7338('0x2c')]['offset']);}_0x3fdbc5['order']=qs[_0x7338('0x35')](_0x4018e3[_0x7338('0x2c')][_0x7338('0x35')]);_0x3fdbc5[_0x7338('0x36')]=qs[_0x7338('0x37')](_['pick'](_0x4018e3[_0x7338('0x2c')],_0x581f63[_0x7338('0x37')]),_0x43903d);if(_0x4018e3[_0x7338('0x2c')][_0x7338('0x38')]){_0x3fdbc5[_0x7338('0x36')]=_['merge'](_0x3fdbc5[_0x7338('0x36')],{'$or':_[_0x7338('0x27')](_0x43903d,function(_0x2f08a0){if(_0x2f08a0[_0x7338('0x2a')]!==_0x7338('0x39')){var _0x298d15={};_0x298d15[_0x2f08a0[_0x7338('0x26')]]={'$like':'%'+_0x4018e3[_0x7338('0x2c')][_0x7338('0x38')]+'%'};return _0x298d15;}})});}_0x3fdbc5=_[_0x7338('0x3a')]({},_0x3fdbc5,_0x4018e3[_0x7338('0x3b')]);var _0x3fd037={'where':_0x3fdbc5[_0x7338('0x36')]};return db[_0x7338('0x28')][_0x7338('0x1a')](_0x3fd037)['then'](function(_0x4df0af){_0x2125ae[_0x7338('0x1a')]=_0x4df0af;if(_0x4018e3[_0x7338('0x2c')][_0x7338('0x3c')]){_0x3fdbc5[_0x7338('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x7338('0x3e')](_0x3fdbc5);})[_0x7338('0x20')](function(_0x1d62ea){_0x2125ae[_0x7338('0x3f')]=_0x1d62ea;return _0x2125ae;})['then'](respondWithFilteredResult(_0x586089,_0x3fdbc5))[_0x7338('0x40')](handleError(_0x586089,null));};exports['show']=function(_0x34bc1e,_0x22f9d5){var _0x9971be={'raw':!![],'where':{'id':_0x34bc1e['params']['id']}},_0xc5ea4c={};_0xc5ea4c['model']=_[_0x7338('0x2d')](db[_0x7338('0x28')][_0x7338('0x41')]);_0xc5ea4c['query']=_[_0x7338('0x2d')](_0x34bc1e[_0x7338('0x2c')]);_0xc5ea4c[_0x7338('0x37')]=_[_0x7338('0x2f')](_0xc5ea4c[_0x7338('0x2e')],_0xc5ea4c[_0x7338('0x2c')]);_0x9971be[_0x7338('0x31')]=_['intersection'](_0xc5ea4c[_0x7338('0x2e')],qs['fields'](_0x34bc1e[_0x7338('0x2c')][_0x7338('0x30')]));_0x9971be['attributes']=_0x9971be['attributes']['length']?_0x9971be[_0x7338('0x31')]:_0xc5ea4c['model'];if(_0x34bc1e['query']['includeAll']){_0x9971be[_0x7338('0x3d')]=[{'all':!![]}];}_0x9971be=_[_0x7338('0x3a')]({},_0x9971be,_0x34bc1e['options']);return db[_0x7338('0x28')]['find'](_0x9971be)['then'](handleEntityNotFound(_0x22f9d5,null))[_0x7338('0x20')](respondWithResult(_0x22f9d5,null))[_0x7338('0x40')](handleError(_0x22f9d5,null));};exports['create']=function(_0x2c2cda,_0x38b165){return db[_0x7338('0x28')][_0x7338('0x42')](_0x2c2cda[_0x7338('0x43')],{})['then'](respondWithResult(_0x38b165,0xc9))[_0x7338('0x40')](handleError(_0x38b165,null));};exports[_0x7338('0x44')]=function(_0x1a091d,_0x259f3a){if(_0x1a091d['body']['id']){delete _0x1a091d[_0x7338('0x43')]['id'];}return db[_0x7338('0x28')]['find']({'where':{'id':_0x1a091d['params']['id']}})[_0x7338('0x20')](handleEntityNotFound(_0x259f3a,null))[_0x7338('0x20')](saveUpdates(_0x1a091d[_0x7338('0x43')],null))[_0x7338('0x20')](respondWithResult(_0x259f3a,null))['catch'](handleError(_0x259f3a,null));};exports[_0x7338('0x45')]=function(_0x4550f9,_0x2cb348,_0x53ee4d){var _0x159114=require('../../components/encryptor');var _0x4956c5=![];var _0x109ed0={};if(_0x4550f9[_0x7338('0x2c')][_0x7338('0x2a')]&&_0x4550f9['query'][_0x7338('0x2a')]===_0x7338('0x46')){_0x109ed0[_0x7338('0x46')]=_0x4550f9[_0x7338('0x47')]['id'];}else{_0x109ed0['id']=_0x4550f9['params']['id'];}return db['SquareRecording'][_0x7338('0x48')]({'where':_0x109ed0,'attributes':['id',_0x7338('0x49'),_0x7338('0x4a')],'raw':!![]})[_0x7338('0x20')](handleEntityNotFound(_0x2cb348,null))[_0x7338('0x20')](function(_0x2e8307){if(_0x2e8307){var _0x577ce8=_0x2e8307[_0x7338('0x49')];var _0x279c67=util[_0x7338('0x4b')](_0x7338('0x4c'),_0x577ce8);if(fs[_0x7338('0x4d')](_0x279c67)){_0x4956c5=!![];return _0x159114[_0x7338('0x4e')](_0x279c67,_0x577ce8,config['secrets']['recording'])['then'](function(){return _0x2e8307;});}return _0x2e8307;}})[_0x7338('0x20')](function(_0xe7b5db){if(_0xe7b5db){var _0x2e4213=_0xe7b5db[_0x7338('0x49')];if(!fs['existsSync'](_0x2e4213)){throw new db[(_0x7338('0x4f'))][(_0x7338('0x50'))]('SquareRecording\x20not\x20found');}if(_0xe7b5db[_0x7338('0x4a')]){return _0x2cb348[_0x7338('0x45')](_0x2e4213,_0xe7b5db[_0x7338('0x4a')]+path[_0x7338('0x51')](_0x2e4213),function(){if(_0x4956c5){fs[_0x7338('0x52')](_0x2e4213);}});}else{return _0x2cb348[_0x7338('0x45')](_0x2e4213,function(_0x47f4a8){if(_0x4956c5){fs[_0x7338('0x52')](_0x2e4213);}});}}})[_0x7338('0x40')](function(_0x326811){if(_0x326811[_0x7338('0x53')]===_0x7338('0x54')){_0x2cb348[_0x7338('0x18')](0x194)[_0x7338('0x55')](_0x7338('0x56'));}else{return handleError(_0x2cb348,null);}});};exports['destroy']=function(_0x58b956,_0x3f1802){return db[_0x7338('0x28')][_0x7338('0x48')]({'where':{'id':_0x58b956[_0x7338('0x47')]['id']}})[_0x7338('0x20')](function(_0x379f93){if(!_0x379f93)throw new ReferenceError(_0x7338('0x57'));return _0x379f93;})['then'](function(_0xefa7f7){var _0x45cced=_0xefa7f7[_0x7338('0x49')];logger[_0x7338('0x58')](_0x7338('0x59'),_0x45cced);if(!_[_0x7338('0x5a')](_0xefa7f7[_0x7338('0x49')])&&fs['existsSync'](_0x45cced)){logger['info']('File:\x20\x22'+_0x45cced+_0x7338('0x5b'));fs[_0x7338('0x5c')](_0x45cced);}_0x45cced=_0x45cced+'.cypher';if(!_['isNil'](_0xefa7f7[_0x7338('0x49')])&&fs['existsSync'](_0x45cced)){logger['info'](_0x7338('0x5d')+_0x45cced+_0x7338('0x5b'));fs[_0x7338('0x5c')](_0x45cced);}return _0xefa7f7;})[_0x7338('0x20')](function(_0x128b4c){if(!_0x128b4c)throw new InternalError();return _0x128b4c[_0x7338('0x21')]();})['then'](function(){_0x3f1802[_0x7338('0x18')](0xcc)['end']();})[_0x7338('0x40')](handleError(_0x3f1802,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index ed83126..a4b24da 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 _0xa064=['SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','path','../../config/environment','./squareRecording.attributes'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa064,0x192));var _0x4a06=function(_0x3d91fd,_0x3a768b){_0x3d91fd=_0x3d91fd-0x0;var _0x137a3a=_0xa064[_0x3d91fd];return _0x137a3a;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var logger=require(_0x4a06('0x2'))(_0x4a06('0x3'));var moment=require(_0x4a06('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a06('0x5'));var rimraf=require('rimraf');var config=require(_0x4a06('0x6'));var attributes=require(_0x4a06('0x7'));module['exports']=function(_0x3f2099,_0x54c9ed){return _0x3f2099['define'](_0x4a06('0x8'),attributes,{'tableName':_0x4a06('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23a3=['../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','api','bluebird','request-promise','path','rimraf'];(function(_0x11d156,_0x5e45c5){var _0x10d46a=function(_0x58af0b){while(--_0x58af0b){_0x11d156['push'](_0x11d156['shift']());}};_0x10d46a(++_0x5e45c5);}(_0x23a3,0x131));var _0x323a=function(_0x5dde65,_0x1eb6f7){_0x5dde65=_0x5dde65-0x0;var _0x1e9245=_0x23a3[_0x5dde65];return _0x1e9245;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x323a('0x0'));var moment=require('moment');var BPromise=require(_0x323a('0x1'));var rp=require(_0x323a('0x2'));var fs=require('fs');var path=require(_0x323a('0x3'));var rimraf=require(_0x323a('0x4'));var config=require(_0x323a('0x5'));var attributes=require(_0x323a('0x6'));module[_0x323a('0x7')]=function(_0x3c1648,_0x14a418){return _0x3c1648['define'](_0x323a('0x8'),attributes,{'tableName':_0x323a('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 6f4f914..898371b 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 _0xecfb=['body','options','raw','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateSquareRecording','SquareRecording','create'];(function(_0x576e92,_0x165314){var _0x24c32e=function(_0x1648b1){while(--_0x1648b1){_0x576e92['push'](_0x576e92['shift']());}};_0x24c32e(++_0x165314);}(_0xecfb,0xb9));var _0xbecf=function(_0x426641,_0x26d64c){_0x426641=_0x426641-0x0;var _0x1a1ece=_0xecfb[_0x426641];return _0x1a1ece;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbecf('0x0'));var fs=require('fs');var Redis=require(_0xbecf('0x1'));var db=require(_0xbecf('0x2'))['db'];var utils=require(_0xbecf('0x3'));var logger=require('../../config/logger')(_0xbecf('0x4'));var config=require(_0xbecf('0x5'));var jayson=require(_0xbecf('0x6'));var client=jayson[_0xbecf('0x7')][_0xbecf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c90d9,_0x4d6612,_0x5e9736){return new BPromise(function(_0x4f947d,_0x58a907){return client[_0xbecf('0x9')](_0x1c90d9,_0x5e9736)[_0xbecf('0xa')](function(_0x1a889e){logger['info'](_0xbecf('0xb'),_0x4d6612,_0xbecf('0xc'));logger[_0xbecf('0xd')](_0xbecf('0xe'),_0x4d6612,_0xbecf('0xc'),JSON[_0xbecf('0xf')](_0x1a889e));if(_0x1a889e[_0xbecf('0x10')]){if(_0x1a889e[_0xbecf('0x10')][_0xbecf('0x11')]===0x1f4){logger[_0xbecf('0x10')](_0xbecf('0xb'),_0x4d6612,_0x1a889e['error']['message']);return _0x58a907(_0x1a889e[_0xbecf('0x10')]['message']);}logger['error'](_0xbecf('0xb'),_0x4d6612,_0x1a889e['error'][_0xbecf('0x12')]);return _0x4f947d(_0x1a889e[_0xbecf('0x10')][_0xbecf('0x12')]);}else{logger[_0xbecf('0x13')](_0xbecf('0xb'),_0x4d6612,_0xbecf('0xc'));_0x4f947d(_0x1a889e['result'][_0xbecf('0x12')]);}})['catch'](function(_0x701ba8){logger[_0xbecf('0x10')](_0xbecf('0xb'),_0x4d6612,_0x701ba8);_0x58a907(_0x701ba8);});});}exports[_0xbecf('0x14')]=function(_0x5c28c0){var _0x58f7ec=this;return new Promise(function(_0x46b527,_0x523c96){return db[_0xbecf('0x15')][_0xbecf('0x16')](_0x5c28c0[_0xbecf('0x17')],{'raw':_0x5c28c0[_0xbecf('0x18')]?_0x5c28c0[_0xbecf('0x18')][_0xbecf('0x19')]===undefined?!![]:![]:!![]})[_0xbecf('0xa')](function(_0x431012){logger[_0xbecf('0x13')](_0xbecf('0x14'),_0x5c28c0);logger['debug'](_0xbecf('0x14'),_0x5c28c0,JSON[_0xbecf('0xf')](_0x431012));_0x46b527(_0x431012);})['catch'](function(_0x95d479){logger['error'](_0xbecf('0x14'),_0x95d479[_0xbecf('0x12')],_0x5c28c0);_0x523c96(_0x58f7ec['error'](0x1f4,_0x95d479[_0xbecf('0x12')]));});});}; \ No newline at end of file +var _0xfbe4=['SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xfbe4,0xbd));var _0x4fbe=function(_0x425aff,_0x3ba514){_0x425aff=_0x425aff-0x0;var _0x5a6883=_0xfbe4[_0x425aff];return _0x5a6883;};'use strict';var _=require(_0x4fbe('0x0'));var util=require('util');var moment=require(_0x4fbe('0x1'));var BPromise=require(_0x4fbe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fbe('0x3'));var db=require(_0x4fbe('0x4'))['db'];var utils=require(_0x4fbe('0x5'));var logger=require(_0x4fbe('0x6'))(_0x4fbe('0x7'));var config=require(_0x4fbe('0x8'));var jayson=require(_0x4fbe('0x9'));var client=jayson[_0x4fbe('0xa')][_0x4fbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa91ebd,_0x49c8cc,_0x883531){return new BPromise(function(_0x219a0a,_0x3a9888){return client['request'](_0xa91ebd,_0x883531)[_0x4fbe('0xc')](function(_0x1e52be){logger[_0x4fbe('0xd')](_0x4fbe('0xe'),_0x49c8cc,_0x4fbe('0xf'));logger['debug'](_0x4fbe('0x10'),_0x49c8cc,_0x4fbe('0xf'),JSON[_0x4fbe('0x11')](_0x1e52be));if(_0x1e52be['error']){if(_0x1e52be[_0x4fbe('0x12')][_0x4fbe('0x13')]===0x1f4){logger[_0x4fbe('0x12')]('SquareRecording,\x20%s,\x20%s',_0x49c8cc,_0x1e52be[_0x4fbe('0x12')][_0x4fbe('0x14')]);return _0x3a9888(_0x1e52be[_0x4fbe('0x12')][_0x4fbe('0x14')]);}logger[_0x4fbe('0x12')](_0x4fbe('0xe'),_0x49c8cc,_0x1e52be[_0x4fbe('0x12')]['message']);return _0x219a0a(_0x1e52be[_0x4fbe('0x12')]['message']);}else{logger[_0x4fbe('0xd')]('SquareRecording,\x20%s,\x20%s',_0x49c8cc,_0x4fbe('0xf'));_0x219a0a(_0x1e52be['result'][_0x4fbe('0x14')]);}})[_0x4fbe('0x15')](function(_0x68b576){logger[_0x4fbe('0x12')](_0x4fbe('0xe'),_0x49c8cc,_0x68b576);_0x3a9888(_0x68b576);});});}exports[_0x4fbe('0x16')]=function(_0x260adc){var _0x1d9f40=this;return new Promise(function(_0x15a505,_0x1a793d){return db[_0x4fbe('0x17')][_0x4fbe('0x18')](_0x260adc[_0x4fbe('0x19')],{'raw':_0x260adc[_0x4fbe('0x1a')]?_0x260adc['options'][_0x4fbe('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4fcb25){logger[_0x4fbe('0xd')]('CreateSquareRecording',_0x260adc);logger[_0x4fbe('0x1c')](_0x4fbe('0x16'),_0x260adc,JSON['stringify'](_0x4fcb25));_0x15a505(_0x4fcb25);})[_0x4fbe('0x15')](function(_0x49e722){logger['error']('CreateSquareRecording',_0x49e722[_0x4fbe('0x14')],_0x260adc);_0x1a793d(_0x1d9f40[_0x4fbe('0x12')](0x1f4,_0x49e722[_0x4fbe('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 877ca16..7e6d1cf 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 _0xffcc=['connect-timeout','express','Router','./squareReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1f79f8,_0x1ea2fd){var _0x288e6d=function(_0x5c8876){while(--_0x5c8876){_0x1f79f8['push'](_0x1f79f8['shift']());}};_0x288e6d(++_0x1ea2fd);}(_0xffcc,0x142));var _0xcffc=function(_0x45d6a5,_0x128291){_0x45d6a5=_0x45d6a5-0x0;var _0xfd46cb=_0xffcc[_0x45d6a5];return _0xfd46cb;};'use strict';var multer=require(_0xcffc('0x0'));var util=require(_0xcffc('0x1'));var path=require('path');var timeout=require(_0xcffc('0x2'));var express=require(_0xcffc('0x3'));var router=express[_0xcffc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcffc('0x5'));router[_0xcffc('0x6')]('/',auth['isAuthenticated'](),controller[_0xcffc('0x7')]);router['get'](_0xcffc('0x8'),auth[_0xcffc('0x9')](),controller['describe']);router['get'](_0xcffc('0xa'),auth[_0xcffc('0x9')](),controller[_0xcffc('0xb')]);router[_0xcffc('0xc')]('/',auth[_0xcffc('0x9')](),controller[_0xcffc('0xd')]);router[_0xcffc('0xe')]('/:id',auth[_0xcffc('0x9')](),controller['update']);router[_0xcffc('0xf')](_0xcffc('0xa'),auth['isAuthenticated'](),controller[_0xcffc('0x10')]);module[_0xcffc('0x11')]=router; \ No newline at end of file +var _0x6fbc=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./squareReport.controller','get','index','/describe','isAuthenticated'];(function(_0x285913,_0x56f221){var _0x29fda6=function(_0x423160){while(--_0x423160){_0x285913['push'](_0x285913['shift']());}};_0x29fda6(++_0x56f221);}(_0x6fbc,0x199));var _0xc6fb=function(_0x4e3886,_0x130414){_0x4e3886=_0x4e3886-0x0;var _0x497d1a=_0x6fbc[_0x4e3886];return _0x497d1a;};'use strict';var multer=require(_0xc6fb('0x0'));var util=require(_0xc6fb('0x1'));var path=require(_0xc6fb('0x2'));var timeout=require(_0xc6fb('0x3'));var express=require(_0xc6fb('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc6fb('0x5'));var controller=require(_0xc6fb('0x6'));router[_0xc6fb('0x7')]('/',auth['isAuthenticated'](),controller[_0xc6fb('0x8')]);router[_0xc6fb('0x7')](_0xc6fb('0x9'),auth[_0xc6fb('0xa')](),controller[_0xc6fb('0xb')]);router[_0xc6fb('0x7')](_0xc6fb('0xc'),auth[_0xc6fb('0xa')](),controller[_0xc6fb('0xd')]);router[_0xc6fb('0xe')]('/',auth['isAuthenticated'](),controller[_0xc6fb('0xf')]);router[_0xc6fb('0x10')](_0xc6fb('0xc'),auth['isAuthenticated'](),controller[_0xc6fb('0x11')]);router[_0xc6fb('0x12')](_0xc6fb('0xc'),auth[_0xc6fb('0xa')](),controller[_0xc6fb('0x13')]);module[_0xc6fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index ef926fb..fff5805 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 _0x35a2=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x12084c,_0x25680d){var _0x3c1906=function(_0x48a23b){while(--_0x48a23b){_0x12084c['push'](_0x12084c['shift']());}};_0x3c1906(++_0x25680d);}(_0x35a2,0x1a8));var _0x235a=function(_0x195c9a,_0x16f5f4){_0x195c9a=_0x195c9a-0x0;var _0x46aad4=_0x35a2[_0x195c9a];return _0x46aad4;};'use strict';var Sequelize=require(_0x235a('0x0'));module[_0x235a('0x1')]={'network':{'type':Sequelize[_0x235a('0x2')]},'network_script':{'type':Sequelize[_0x235a('0x2')]},'request':{'type':Sequelize[_0x235a('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x235a('0x2')]},'type':{'type':Sequelize[_0x235a('0x2')]},'uniqueid':{'type':Sequelize[_0x235a('0x2')]},'version':{'type':Sequelize[_0x235a('0x2')]},'callerid':{'type':Sequelize[_0x235a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x235a('0x2')]},'callingani2':{'type':Sequelize[_0x235a('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x235a('0x2')]},'rdnis':{'type':Sequelize[_0x235a('0x2')]},'context':{'type':Sequelize[_0x235a('0x2')]},'extension':{'type':Sequelize[_0x235a('0x2')]},'priority':{'type':Sequelize[_0x235a('0x2')]},'enhanced':{'type':Sequelize[_0x235a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x235a('0x2')]},'project_name':{'type':Sequelize[_0x235a('0x2')]},'joinAt':{'type':Sequelize[_0x235a('0x3')]},'leaveAt':{'type':Sequelize[_0x235a('0x3')]},'bot':{'type':Sequelize[_0x235a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x53bb=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x12b294,_0x192e53){var _0x7b92cb=function(_0x16898e){while(--_0x16898e){_0x12b294['push'](_0x12b294['shift']());}};_0x7b92cb(++_0x192e53);}(_0x53bb,0xdb));var _0xb53b=function(_0x28da36,_0xf2f822){_0x28da36=_0x28da36-0x0;var _0x4d0c71=_0x53bb[_0x28da36];return _0x4d0c71;};'use strict';var Sequelize=require(_0xb53b('0x0'));module[_0xb53b('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb53b('0x2')]},'request':{'type':Sequelize[_0xb53b('0x2')]},'channel':{'type':Sequelize[_0xb53b('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb53b('0x2')]},'uniqueid':{'type':Sequelize[_0xb53b('0x2')]},'version':{'type':Sequelize[_0xb53b('0x2')]},'callerid':{'type':Sequelize[_0xb53b('0x2')]},'calleridname':{'type':Sequelize[_0xb53b('0x2')]},'callingpres':{'type':Sequelize[_0xb53b('0x2')]},'callingani2':{'type':Sequelize[_0xb53b('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xb53b('0x2')]},'dnid':{'type':Sequelize[_0xb53b('0x2')]},'rdnis':{'type':Sequelize[_0xb53b('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb53b('0x2')]},'priority':{'type':Sequelize[_0xb53b('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb53b('0x2')]},'project_name':{'type':Sequelize[_0xb53b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb53b('0x3')]},'bot':{'type':Sequelize[_0xb53b('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 aeb36ce..974ca42 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 _0x2fbc=['status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','params','keys','fields','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3d0572,_0x3909e6){var _0x241372=function(_0x205863){while(--_0x205863){_0x3d0572['push'](_0x3d0572['shift']());}};_0x241372(++_0x3909e6);}(_0x2fbc,0x1f3));var _0xc2fb=function(_0x282c7f,_0x460e10){_0x282c7f=_0x282c7f-0x0;var _0x54bc87=_0x2fbc[_0x282c7f];return _0x54bc87;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc2fb('0x0'));var rimraf=require(_0xc2fb('0x1'));var zipdir=require(_0xc2fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc2fb('0x3'));var moment=require(_0xc2fb('0x4'));var BPromise=require(_0xc2fb('0x5'));var Mustache=require(_0xc2fb('0x6'));var util=require(_0xc2fb('0x7'));var path=require('path');var sox=require(_0xc2fb('0x8'));var csv=require(_0xc2fb('0x9'));var ejs=require(_0xc2fb('0xa'));var fs=require('fs');var _=require(_0xc2fb('0xb'));var squel=require(_0xc2fb('0xc'));var crypto=require(_0xc2fb('0xd'));var jsforce=require(_0xc2fb('0xe'));var deskjs=require(_0xc2fb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc2fb('0x10'));var Redis=require(_0xc2fb('0x11'));var authService=require(_0xc2fb('0x12'));var qs=require(_0xc2fb('0x13'));var as=require(_0xc2fb('0x14'));var hardwareService=require(_0xc2fb('0x15'));var logger=require(_0xc2fb('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc2fb('0x17'));var db=require(_0xc2fb('0x18'))['db'];function respondWithStatusCode(_0x2993b5,_0x1c31cf){_0x1c31cf=_0x1c31cf||0xcc;return function(_0x2d447f){if(_0x2d447f){return _0x2993b5[_0xc2fb('0x19')](_0x1c31cf);}return _0x2993b5[_0xc2fb('0x1a')](_0x1c31cf)[_0xc2fb('0x1b')]();};}function respondWithResult(_0x1289a7,_0x2bbd5f){_0x2bbd5f=_0x2bbd5f||0xc8;return function(_0x283146){if(_0x283146){return _0x1289a7[_0xc2fb('0x1a')](_0x2bbd5f)[_0xc2fb('0x1c')](_0x283146);}};}function respondWithFilteredResult(_0x17ee0e,_0x1228df){return function(_0x5d1d19){if(_0x5d1d19){var _0x112e3d=_0x5d1d19[_0xc2fb('0x1d')],_0x12196c=_0x1228df['offset'],_0x9880e6=_0x1228df[_0xc2fb('0x1e')]+_0x1228df['limit'],_0x83b71d;if(_0x9880e6>=_0x112e3d){_0x9880e6=_0x112e3d;_0x83b71d=0xc8;}else{_0x83b71d=0xce;}_0x17ee0e[_0xc2fb('0x1a')](_0x83b71d);return _0x17ee0e['set'](_0xc2fb('0x1f'),_0x12196c+'-'+_0x9880e6+'/'+_0x112e3d)[_0xc2fb('0x1c')](_0x5d1d19);}return null;};}function patchUpdates(_0x264ecd){return function(_0x1910f5){try{jsonpatch[_0xc2fb('0x20')](_0x1910f5,_0x264ecd,!![]);}catch(_0x293c6a){return BPromise[_0xc2fb('0x21')](_0x293c6a);}return _0x1910f5[_0xc2fb('0x22')]();};}function saveUpdates(_0x322e27,_0x2d7da8){return function(_0x1fc069){if(_0x1fc069){return _0x1fc069[_0xc2fb('0x23')](_0x322e27)[_0xc2fb('0x24')](function(_0x10bd63){return _0x10bd63;});}return null;};}function removeEntity(_0x5a0128,_0x44a5f3){return function(_0x27469e){if(_0x27469e){return _0x27469e[_0xc2fb('0x25')]()[_0xc2fb('0x24')](function(){_0x5a0128[_0xc2fb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32615d,_0x304ceb){return function(_0x44b3b0){if(!_0x44b3b0){_0x32615d['sendStatus'](0x194);}return _0x44b3b0;};}function handleError(_0x32e09a,_0x1d75e7){_0x1d75e7=_0x1d75e7||0x1f4;return function(_0x4a4c01){logger[_0xc2fb('0x26')](_0x4a4c01['stack']);if(_0x4a4c01[_0xc2fb('0x27')]){delete _0x4a4c01[_0xc2fb('0x27')];}_0x32e09a[_0xc2fb('0x1a')](_0x1d75e7)[_0xc2fb('0x28')](_0x4a4c01);};}exports[_0xc2fb('0x29')]=function(_0x59f053,_0x5ab418){var _0x23a3b6={},_0xcc8a3c={},_0x9e8954={'count':0x0,'rows':[]};var _0x46fc4b=_[_0xc2fb('0x2a')](db[_0xc2fb('0x2b')][_0xc2fb('0x2c')],function(_0x491b51){return{'name':_0x491b51[_0xc2fb('0x2d')],'type':_0x491b51[_0xc2fb('0x2e')][_0xc2fb('0x2f')]};});_0xcc8a3c[_0xc2fb('0x30')]=_[_0xc2fb('0x2a')](_0x46fc4b,_0xc2fb('0x27'));_0xcc8a3c[_0xc2fb('0x31')]=_['keys'](_0x59f053[_0xc2fb('0x31')]);_0xcc8a3c['filters']=_[_0xc2fb('0x32')](_0xcc8a3c[_0xc2fb('0x30')],_0xcc8a3c[_0xc2fb('0x31')]);_0x23a3b6[_0xc2fb('0x33')]=_[_0xc2fb('0x32')](_0xcc8a3c[_0xc2fb('0x30')],qs['fields'](_0x59f053['query']['fields']));_0x23a3b6['attributes']=_0x23a3b6[_0xc2fb('0x33')]['length']?_0x23a3b6[_0xc2fb('0x33')]:_0xcc8a3c[_0xc2fb('0x30')];if(!_0x59f053[_0xc2fb('0x31')][_0xc2fb('0x34')](_0xc2fb('0x35'))){_0x23a3b6[_0xc2fb('0x36')]=qs['limit'](_0x59f053[_0xc2fb('0x31')][_0xc2fb('0x36')]);_0x23a3b6[_0xc2fb('0x1e')]=qs[_0xc2fb('0x1e')](_0x59f053['query'][_0xc2fb('0x1e')]);}_0x23a3b6[_0xc2fb('0x37')]=qs['sort'](_0x59f053['query'][_0xc2fb('0x38')]);_0x23a3b6[_0xc2fb('0x39')]=qs['filters'](_[_0xc2fb('0x3a')](_0x59f053[_0xc2fb('0x31')],_0xcc8a3c['filters']),_0x46fc4b);if(_0x59f053[_0xc2fb('0x31')]['filter']){_0x23a3b6[_0xc2fb('0x39')]=_[_0xc2fb('0x3b')](_0x23a3b6['where'],{'$or':_[_0xc2fb('0x2a')](_0x46fc4b,function(_0x3426d3){if(_0x3426d3['type']!==_0xc2fb('0x3c')){var _0x21eaf5={};_0x21eaf5[_0x3426d3['name']]={'$like':'%'+_0x59f053['query'][_0xc2fb('0x3d')]+'%'};return _0x21eaf5;}})});}_0x23a3b6=_[_0xc2fb('0x3b')]({},_0x23a3b6,_0x59f053[_0xc2fb('0x3e')]);var _0x4c7506={'where':_0x23a3b6[_0xc2fb('0x39')]};return db['SquareReport']['count'](_0x4c7506)[_0xc2fb('0x24')](function(_0x1e1f8f){_0x9e8954[_0xc2fb('0x1d')]=_0x1e1f8f;if(_0x59f053['query'][_0xc2fb('0x3f')]){_0x23a3b6['include']=[{'all':!![]}];}return db[_0xc2fb('0x2b')]['findAll'](_0x23a3b6);})['then'](function(_0x1d2ad0){_0x9e8954[_0xc2fb('0x40')]=_0x1d2ad0;return _0x9e8954;})[_0xc2fb('0x24')](respondWithFilteredResult(_0x5ab418,_0x23a3b6))[_0xc2fb('0x41')](handleError(_0x5ab418,null));};exports['show']=function(_0x381661,_0x201335){var _0x20fa32={'raw':!![],'where':{'id':_0x381661[_0xc2fb('0x42')]['id']}},_0x5a4bf6={};_0x5a4bf6['model']=_[_0xc2fb('0x43')](db[_0xc2fb('0x2b')][_0xc2fb('0x2c')]);_0x5a4bf6[_0xc2fb('0x31')]=_[_0xc2fb('0x43')](_0x381661[_0xc2fb('0x31')]);_0x5a4bf6['filters']=_['intersection'](_0x5a4bf6['model'],_0x5a4bf6['query']);_0x20fa32[_0xc2fb('0x33')]=_[_0xc2fb('0x32')](_0x5a4bf6[_0xc2fb('0x30')],qs[_0xc2fb('0x44')](_0x381661['query'][_0xc2fb('0x44')]));_0x20fa32['attributes']=_0x20fa32[_0xc2fb('0x33')][_0xc2fb('0x45')]?_0x20fa32[_0xc2fb('0x33')]:_0x5a4bf6[_0xc2fb('0x30')];if(_0x381661[_0xc2fb('0x31')][_0xc2fb('0x3f')]){_0x20fa32[_0xc2fb('0x46')]=[{'all':!![]}];}_0x20fa32=_[_0xc2fb('0x3b')]({},_0x20fa32,_0x381661[_0xc2fb('0x3e')]);return db['SquareReport'][_0xc2fb('0x47')](_0x20fa32)[_0xc2fb('0x24')](handleEntityNotFound(_0x201335,null))[_0xc2fb('0x24')](respondWithResult(_0x201335,null))[_0xc2fb('0x41')](handleError(_0x201335,null));};exports[_0xc2fb('0x48')]=function(_0x3cd36b,_0xd28d06){return db[_0xc2fb('0x2b')][_0xc2fb('0x48')](_0x3cd36b[_0xc2fb('0x49')],{})['then'](respondWithResult(_0xd28d06,0xc9))[_0xc2fb('0x41')](handleError(_0xd28d06,null));};exports[_0xc2fb('0x23')]=function(_0x2debd0,_0x5271ab){if(_0x2debd0[_0xc2fb('0x49')]['id']){delete _0x2debd0[_0xc2fb('0x49')]['id'];}return db[_0xc2fb('0x2b')][_0xc2fb('0x47')]({'where':{'id':_0x2debd0['params']['id']}})[_0xc2fb('0x24')](handleEntityNotFound(_0x5271ab,null))[_0xc2fb('0x24')](saveUpdates(_0x2debd0[_0xc2fb('0x49')],null))[_0xc2fb('0x24')](respondWithResult(_0x5271ab,null))['catch'](handleError(_0x5271ab,null));};exports[_0xc2fb('0x25')]=function(_0x2c9312,_0x15eeac){return db[_0xc2fb('0x2b')][_0xc2fb('0x47')]({'where':{'id':_0x2c9312[_0xc2fb('0x42')]['id']}})[_0xc2fb('0x24')](handleEntityNotFound(_0x15eeac,null))[_0xc2fb('0x24')](removeEntity(_0x15eeac,null))['catch'](handleError(_0x15eeac,null));};exports[_0xc2fb('0x4a')]=function(_0x497da4,_0x15bc3f){return db[_0xc2fb('0x2b')][_0xc2fb('0x4a')]()[_0xc2fb('0x24')](respondWithResult(_0x15bc3f,null))[_0xc2fb('0x41')](handleError(_0x15bc3f,null));}; \ No newline at end of file +var _0x6ae4=['hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','includeAll','catch','create','body','find','describe','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','index','map','SquareReport','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x41b2b1,_0x2ed52d){var _0xdbc971=function(_0x59ff57){while(--_0x59ff57){_0x41b2b1['push'](_0x41b2b1['shift']());}};_0xdbc971(++_0x2ed52d);}(_0x6ae4,0x17d));var _0x46ae=function(_0x4d1621,_0x4135de){_0x4d1621=_0x4d1621-0x0;var _0x340bab=_0x6ae4[_0x4d1621];return _0x340bab;};'use strict';var pdf=require(_0x46ae('0x0'));var emlformat=require(_0x46ae('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x46ae('0x2'));var rp=require('request-promise');var moment=require(_0x46ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x46ae('0x4'));var util=require(_0x46ae('0x5'));var path=require(_0x46ae('0x6'));var sox=require(_0x46ae('0x7'));var csv=require(_0x46ae('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x46ae('0x9'));var crypto=require(_0x46ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x46ae('0xb'));var toCsv=require(_0x46ae('0x8'));var querystring=require(_0x46ae('0xc'));var Papa=require(_0x46ae('0xd'));var Redis=require(_0x46ae('0xe'));var authService=require(_0x46ae('0xf'));var qs=require(_0x46ae('0x10'));var as=require(_0x46ae('0x11'));var hardwareService=require(_0x46ae('0x12'));var logger=require(_0x46ae('0x13'))('api');var utils=require(_0x46ae('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf06ba8,_0xa6f2da){_0xa6f2da=_0xa6f2da||0xcc;return function(_0x4cdff9){if(_0x4cdff9){return _0xf06ba8[_0x46ae('0x15')](_0xa6f2da);}return _0xf06ba8[_0x46ae('0x16')](_0xa6f2da)[_0x46ae('0x17')]();};}function respondWithResult(_0x5533d3,_0x41b453){_0x41b453=_0x41b453||0xc8;return function(_0x3506c3){if(_0x3506c3){return _0x5533d3[_0x46ae('0x16')](_0x41b453)[_0x46ae('0x18')](_0x3506c3);}};}function respondWithFilteredResult(_0x31c682,_0x526ce2){return function(_0x2f1acf){if(_0x2f1acf){var _0x4240e0=_0x2f1acf[_0x46ae('0x19')],_0x11a9c7=_0x526ce2['offset'],_0x35fa22=_0x526ce2[_0x46ae('0x1a')]+_0x526ce2[_0x46ae('0x1b')],_0x20e561;if(_0x35fa22>=_0x4240e0){_0x35fa22=_0x4240e0;_0x20e561=0xc8;}else{_0x20e561=0xce;}_0x31c682['status'](_0x20e561);return _0x31c682[_0x46ae('0x1c')](_0x46ae('0x1d'),_0x11a9c7+'-'+_0x35fa22+'/'+_0x4240e0)['json'](_0x2f1acf);}return null;};}function patchUpdates(_0x10a444){return function(_0x24788e){try{jsonpatch[_0x46ae('0x1e')](_0x24788e,_0x10a444,!![]);}catch(_0x30ecb4){return BPromise[_0x46ae('0x1f')](_0x30ecb4);}return _0x24788e[_0x46ae('0x20')]();};}function saveUpdates(_0x553a9b,_0x188d85){return function(_0x1a6934){if(_0x1a6934){return _0x1a6934[_0x46ae('0x21')](_0x553a9b)[_0x46ae('0x22')](function(_0x342750){return _0x342750;});}return null;};}function removeEntity(_0x15b7c0,_0x190f45){return function(_0x53a05){if(_0x53a05){return _0x53a05[_0x46ae('0x23')]()[_0x46ae('0x22')](function(){_0x15b7c0[_0x46ae('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a6478,_0x51e284){return function(_0x3336be){if(!_0x3336be){_0x3a6478['sendStatus'](0x194);}return _0x3336be;};}function handleError(_0xe828e5,_0x5b017d){_0x5b017d=_0x5b017d||0x1f4;return function(_0x196b10){logger[_0x46ae('0x24')](_0x196b10['stack']);if(_0x196b10['name']){delete _0x196b10['name'];}_0xe828e5[_0x46ae('0x16')](_0x5b017d)['send'](_0x196b10);};}exports[_0x46ae('0x25')]=function(_0x12370b,_0x203ca2){var _0x4249ba={},_0x29a8e1={},_0x3afa12={'count':0x0,'rows':[]};var _0xe900e=_[_0x46ae('0x26')](db[_0x46ae('0x27')]['rawAttributes'],function(_0x22c3b9){return{'name':_0x22c3b9[_0x46ae('0x28')],'type':_0x22c3b9[_0x46ae('0x29')][_0x46ae('0x2a')]};});_0x29a8e1[_0x46ae('0x2b')]=_[_0x46ae('0x26')](_0xe900e,_0x46ae('0x2c'));_0x29a8e1[_0x46ae('0x2d')]=_[_0x46ae('0x2e')](_0x12370b[_0x46ae('0x2d')]);_0x29a8e1[_0x46ae('0x2f')]=_[_0x46ae('0x30')](_0x29a8e1[_0x46ae('0x2b')],_0x29a8e1[_0x46ae('0x2d')]);_0x4249ba[_0x46ae('0x31')]=_[_0x46ae('0x30')](_0x29a8e1['model'],qs[_0x46ae('0x32')](_0x12370b[_0x46ae('0x2d')][_0x46ae('0x32')]));_0x4249ba[_0x46ae('0x31')]=_0x4249ba[_0x46ae('0x31')]['length']?_0x4249ba['attributes']:_0x29a8e1[_0x46ae('0x2b')];if(!_0x12370b[_0x46ae('0x2d')][_0x46ae('0x33')]('nolimit')){_0x4249ba[_0x46ae('0x1b')]=qs[_0x46ae('0x1b')](_0x12370b['query'][_0x46ae('0x1b')]);_0x4249ba[_0x46ae('0x1a')]=qs['offset'](_0x12370b[_0x46ae('0x2d')][_0x46ae('0x1a')]);}_0x4249ba[_0x46ae('0x34')]=qs[_0x46ae('0x35')](_0x12370b['query'][_0x46ae('0x35')]);_0x4249ba[_0x46ae('0x36')]=qs['filters'](_[_0x46ae('0x37')](_0x12370b[_0x46ae('0x2d')],_0x29a8e1[_0x46ae('0x2f')]),_0xe900e);if(_0x12370b[_0x46ae('0x2d')]['filter']){_0x4249ba[_0x46ae('0x36')]=_[_0x46ae('0x38')](_0x4249ba[_0x46ae('0x36')],{'$or':_[_0x46ae('0x26')](_0xe900e,function(_0x18ab9c){if(_0x18ab9c[_0x46ae('0x29')]!==_0x46ae('0x39')){var _0x3bef0f={};_0x3bef0f[_0x18ab9c[_0x46ae('0x2c')]]={'$like':'%'+_0x12370b[_0x46ae('0x2d')][_0x46ae('0x3a')]+'%'};return _0x3bef0f;}})});}_0x4249ba=_[_0x46ae('0x38')]({},_0x4249ba,_0x12370b[_0x46ae('0x3b')]);var _0x1cc219={'where':_0x4249ba[_0x46ae('0x36')]};return db[_0x46ae('0x27')][_0x46ae('0x19')](_0x1cc219)[_0x46ae('0x22')](function(_0x548716){_0x3afa12[_0x46ae('0x19')]=_0x548716;if(_0x12370b[_0x46ae('0x2d')]['includeAll']){_0x4249ba[_0x46ae('0x3c')]=[{'all':!![]}];}return db[_0x46ae('0x27')][_0x46ae('0x3d')](_0x4249ba);})[_0x46ae('0x22')](function(_0xb747ed){_0x3afa12[_0x46ae('0x3e')]=_0xb747ed;return _0x3afa12;})[_0x46ae('0x22')](respondWithFilteredResult(_0x203ca2,_0x4249ba))['catch'](handleError(_0x203ca2,null));};exports[_0x46ae('0x3f')]=function(_0xa36e25,_0x2b5e5c){var _0x43dbc6={'raw':!![],'where':{'id':_0xa36e25[_0x46ae('0x40')]['id']}},_0x59294f={};_0x59294f['model']=_[_0x46ae('0x2e')](db[_0x46ae('0x27')]['rawAttributes']);_0x59294f[_0x46ae('0x2d')]=_['keys'](_0xa36e25['query']);_0x59294f[_0x46ae('0x2f')]=_[_0x46ae('0x30')](_0x59294f[_0x46ae('0x2b')],_0x59294f[_0x46ae('0x2d')]);_0x43dbc6['attributes']=_['intersection'](_0x59294f[_0x46ae('0x2b')],qs[_0x46ae('0x32')](_0xa36e25[_0x46ae('0x2d')][_0x46ae('0x32')]));_0x43dbc6[_0x46ae('0x31')]=_0x43dbc6[_0x46ae('0x31')][_0x46ae('0x41')]?_0x43dbc6[_0x46ae('0x31')]:_0x59294f[_0x46ae('0x2b')];if(_0xa36e25['query'][_0x46ae('0x42')]){_0x43dbc6['include']=[{'all':!![]}];}_0x43dbc6=_[_0x46ae('0x38')]({},_0x43dbc6,_0xa36e25[_0x46ae('0x3b')]);return db[_0x46ae('0x27')]['find'](_0x43dbc6)['then'](handleEntityNotFound(_0x2b5e5c,null))['then'](respondWithResult(_0x2b5e5c,null))[_0x46ae('0x43')](handleError(_0x2b5e5c,null));};exports['create']=function(_0x158321,_0x5c1f3a){return db['SquareReport'][_0x46ae('0x44')](_0x158321['body'],{})['then'](respondWithResult(_0x5c1f3a,0xc9))[_0x46ae('0x43')](handleError(_0x5c1f3a,null));};exports[_0x46ae('0x21')]=function(_0xef0b07,_0x26ac02){if(_0xef0b07[_0x46ae('0x45')]['id']){delete _0xef0b07[_0x46ae('0x45')]['id'];}return db[_0x46ae('0x27')][_0x46ae('0x46')]({'where':{'id':_0xef0b07['params']['id']}})['then'](handleEntityNotFound(_0x26ac02,null))[_0x46ae('0x22')](saveUpdates(_0xef0b07[_0x46ae('0x45')],null))[_0x46ae('0x22')](respondWithResult(_0x26ac02,null))[_0x46ae('0x43')](handleError(_0x26ac02,null));};exports[_0x46ae('0x23')]=function(_0x12a05e,_0xc5d03c){return db[_0x46ae('0x27')][_0x46ae('0x46')]({'where':{'id':_0x12a05e['params']['id']}})[_0x46ae('0x22')](handleEntityNotFound(_0xc5d03c,null))[_0x46ae('0x22')](removeEntity(_0xc5d03c,null))[_0x46ae('0x43')](handleError(_0xc5d03c,null));};exports[_0x46ae('0x47')]=function(_0x5e4a04,_0x57eaae){return db[_0x46ae('0x27')][_0x46ae('0x47')]()[_0x46ae('0x22')](respondWithResult(_0x57eaae,null))[_0x46ae('0x43')](handleError(_0x57eaae,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 0b0ca8e..cee194c 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 _0x851d=['../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd196e0,_0x45e74c){var _0x3763b9=function(_0x378388){while(--_0x378388){_0xd196e0['push'](_0xd196e0['shift']());}};_0x3763b9(++_0x45e74c);}(_0x851d,0xc8));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd851('0x0'));var util=require(_0xd851('0x1'));var logger=require('../../config/logger')(_0xd851('0x2'));var moment=require(_0xd851('0x3'));var BPromise=require(_0xd851('0x4'));var rp=require(_0xd851('0x5'));var fs=require('fs');var path=require(_0xd851('0x6'));var rimraf=require(_0xd851('0x7'));var config=require(_0xd851('0x8'));var attributes=require(_0xd851('0x9'));module[_0xd851('0xa')]=function(_0x2cf98a,_0xd7e742){return _0x2cf98a['define'](_0xd851('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xd851('0xc'),'fields':[_0xd851('0xd'),_0xd851('0xe')]},{'name':_0xd851('0xf'),'fields':[_0xd851('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x743c=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','api','moment','request-promise','path','./squareReport.attributes','define'];(function(_0x449370,_0xef42ff){var _0x871e63=function(_0x46c92e){while(--_0x46c92e){_0x449370['push'](_0x449370['shift']());}};_0x871e63(++_0xef42ff);}(_0x743c,0x87));var _0xc743=function(_0x4c4d07,_0x48512b){_0x4c4d07=_0x4c4d07-0x0;var _0x278851=_0x743c[_0x4c4d07];return _0x278851;};'use strict';var _=require(_0xc743('0x0'));var util=require('util');var logger=require(_0xc743('0x1'))(_0xc743('0x2'));var moment=require(_0xc743('0x3'));var BPromise=require('bluebird');var rp=require(_0xc743('0x4'));var fs=require('fs');var path=require(_0xc743('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc743('0x6'));module['exports']=function(_0x19574a,_0x55e6aa){return _0x19574a[_0xc743('0x7')](_0xc743('0x8'),attributes,{'tableName':_0xc743('0x9'),'paranoid':![],'indexes':[{'name':_0xc743('0xa'),'fields':[_0xc743('0xb'),'project_name']},{'name':_0xc743('0xc'),'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 f9c24d6..8b8b7c9 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 _0xe30a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','raw','UpdateSquareReport','SquareReport','body','options','where','lodash','moment','randomstring','ioredis'];(function(_0x1e38f7,_0x2844ee){var _0x4aa5bd=function(_0x5930e1){while(--_0x5930e1){_0x1e38f7['push'](_0x1e38f7['shift']());}};_0x4aa5bd(++_0x2844ee);}(_0xe30a,0xb0));var _0xae30=function(_0x121bd6,_0x53c4b4){_0x121bd6=_0x121bd6-0x0;var _0x2f9055=_0xe30a[_0x121bd6];return _0x2f9055;};'use strict';var _=require(_0xae30('0x0'));var util=require('util');var moment=require(_0xae30('0x1'));var BPromise=require('bluebird');var rs=require(_0xae30('0x2'));var fs=require('fs');var Redis=require(_0xae30('0x3'));var db=require(_0xae30('0x4'))['db'];var utils=require(_0xae30('0x5'));var logger=require(_0xae30('0x6'))(_0xae30('0x7'));var config=require(_0xae30('0x8'));var jayson=require(_0xae30('0x9'));var client=jayson[_0xae30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1de0b1,_0x4938b6,_0x25d528){return new BPromise(function(_0x35a688,_0x4ea05b){return client[_0xae30('0xb')](_0x1de0b1,_0x25d528)[_0xae30('0xc')](function(_0x321b74){logger[_0xae30('0xd')](_0xae30('0xe'),_0x4938b6,'request\x20sent');logger[_0xae30('0xf')](_0xae30('0x10'),_0x4938b6,_0xae30('0x11'),JSON[_0xae30('0x12')](_0x321b74));if(_0x321b74[_0xae30('0x13')]){if(_0x321b74[_0xae30('0x13')]['code']===0x1f4){logger[_0xae30('0x13')](_0xae30('0xe'),_0x4938b6,_0x321b74['error'][_0xae30('0x14')]);return _0x4ea05b(_0x321b74[_0xae30('0x13')][_0xae30('0x14')]);}logger['error'](_0xae30('0xe'),_0x4938b6,_0x321b74['error'][_0xae30('0x14')]);return _0x35a688(_0x321b74[_0xae30('0x13')][_0xae30('0x14')]);}else{logger[_0xae30('0xd')](_0xae30('0xe'),_0x4938b6,_0xae30('0x11'));_0x35a688(_0x321b74[_0xae30('0x15')][_0xae30('0x14')]);}})[_0xae30('0x16')](function(_0x3b71d5){logger[_0xae30('0x13')]('SquareReport,\x20%s,\x20%s',_0x4938b6,_0x3b71d5);_0x4ea05b(_0x3b71d5);});});}exports[_0xae30('0x17')]=function(_0x3d3a74){var _0x4e254b=this;return new Promise(function(_0x110e73,_0x19ee8c){return db['SquareReport']['create'](_0x3d3a74['body'],{'raw':_0x3d3a74['options']?_0x3d3a74['options'][_0xae30('0x18')]===undefined?!![]:![]:!![]})[_0xae30('0xc')](function(_0x4d7deb){logger[_0xae30('0xd')]('CreateSquareReport',_0x3d3a74);logger[_0xae30('0xf')](_0xae30('0x17'),_0x3d3a74,JSON[_0xae30('0x12')](_0x4d7deb));_0x110e73(_0x4d7deb);})[_0xae30('0x16')](function(_0x10f348){logger[_0xae30('0x13')](_0xae30('0x17'),_0x10f348[_0xae30('0x14')],_0x3d3a74);_0x19ee8c(_0x4e254b[_0xae30('0x13')](0x1f4,_0x10f348['message']));});});};exports[_0xae30('0x19')]=function(_0x1dc7ed){var _0x6f3a2a=this;return new Promise(function(_0x28c849,_0x2844ca){return db[_0xae30('0x1a')]['update'](_0x1dc7ed[_0xae30('0x1b')],{'raw':_0x1dc7ed['options']?_0x1dc7ed['options'][_0xae30('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dc7ed['options']?_0x1dc7ed[_0xae30('0x1c')][_0xae30('0x1d')]||null:null,'attributes':_0x1dc7ed['options']?_0x1dc7ed['options']['attributes']||null:null,'limit':_0x1dc7ed[_0xae30('0x1c')]?_0x1dc7ed[_0xae30('0x1c')]['limit']||null:null})['then'](function(_0x5c7f01){logger[_0xae30('0xd')](_0xae30('0x19'),_0x1dc7ed);logger[_0xae30('0xf')](_0xae30('0x19'),_0x1dc7ed,JSON[_0xae30('0x12')](_0x5c7f01));_0x28c849(_0x5c7f01);})[_0xae30('0x16')](function(_0x8fd7be){logger[_0xae30('0x13')](_0xae30('0x19'),_0x8fd7be[_0xae30('0x14')],_0x1dc7ed);_0x2844ca(_0x6f3a2a[_0xae30('0x13')](0x1f4,_0x8fd7be['message']));});});}; \ No newline at end of file +var _0x2a8c=['then','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','create','body','options','raw','SquareReport','update','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x38f3e7,_0x4c5fc1){var _0x229378=function(_0x29674a){while(--_0x29674a){_0x38f3e7['push'](_0x38f3e7['shift']());}};_0x229378(++_0x4c5fc1);}(_0x2a8c,0x1af));var _0xc2a8=function(_0x2270d1,_0xf4cd83){_0x2270d1=_0x2270d1-0x0;var _0x303c64=_0x2a8c[_0x2270d1];return _0x303c64;};'use strict';var _=require(_0xc2a8('0x0'));var util=require('util');var moment=require(_0xc2a8('0x1'));var BPromise=require(_0xc2a8('0x2'));var rs=require(_0xc2a8('0x3'));var fs=require('fs');var Redis=require(_0xc2a8('0x4'));var db=require(_0xc2a8('0x5'))['db'];var utils=require(_0xc2a8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc2a8('0x7'));var jayson=require(_0xc2a8('0x8'));var client=jayson['client'][_0xc2a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba9c3c,_0x4bddc9,_0x2cf9b3){return new BPromise(function(_0x51b04d,_0x4f9a97){return client[_0xc2a8('0xa')](_0xba9c3c,_0x2cf9b3)[_0xc2a8('0xb')](function(_0x701700){logger[_0xc2a8('0xc')]('SquareReport,\x20%s,\x20%s',_0x4bddc9,'request\x20sent');logger[_0xc2a8('0xd')](_0xc2a8('0xe'),_0x4bddc9,_0xc2a8('0xf'),JSON[_0xc2a8('0x10')](_0x701700));if(_0x701700[_0xc2a8('0x11')]){if(_0x701700[_0xc2a8('0x11')][_0xc2a8('0x12')]===0x1f4){logger[_0xc2a8('0x11')](_0xc2a8('0x13'),_0x4bddc9,_0x701700[_0xc2a8('0x11')][_0xc2a8('0x14')]);return _0x4f9a97(_0x701700['error'][_0xc2a8('0x14')]);}logger['error'](_0xc2a8('0x13'),_0x4bddc9,_0x701700[_0xc2a8('0x11')][_0xc2a8('0x14')]);return _0x51b04d(_0x701700[_0xc2a8('0x11')]['message']);}else{logger[_0xc2a8('0xc')](_0xc2a8('0x13'),_0x4bddc9,_0xc2a8('0xf'));_0x51b04d(_0x701700[_0xc2a8('0x15')][_0xc2a8('0x14')]);}})[_0xc2a8('0x16')](function(_0x338efc){logger[_0xc2a8('0x11')](_0xc2a8('0x13'),_0x4bddc9,_0x338efc);_0x4f9a97(_0x338efc);});});}exports[_0xc2a8('0x17')]=function(_0x3cee19){var _0x4e0b5b=this;return new Promise(function(_0x395105,_0x4d1267){return db['SquareReport'][_0xc2a8('0x18')](_0x3cee19[_0xc2a8('0x19')],{'raw':_0x3cee19[_0xc2a8('0x1a')]?_0x3cee19[_0xc2a8('0x1a')][_0xc2a8('0x1b')]===undefined?!![]:![]:!![]})[_0xc2a8('0xb')](function(_0x474d30){logger['info'](_0xc2a8('0x17'),_0x3cee19);logger[_0xc2a8('0xd')]('CreateSquareReport',_0x3cee19,JSON[_0xc2a8('0x10')](_0x474d30));_0x395105(_0x474d30);})['catch'](function(_0x5e8c24){logger[_0xc2a8('0x11')]('CreateSquareReport',_0x5e8c24[_0xc2a8('0x14')],_0x3cee19);_0x4d1267(_0x4e0b5b[_0xc2a8('0x11')](0x1f4,_0x5e8c24[_0xc2a8('0x14')]));});});};exports['UpdateSquareReport']=function(_0x33ca82){var _0x58eaea=this;return new Promise(function(_0x5f4f11,_0x44a427){return db[_0xc2a8('0x1c')][_0xc2a8('0x1d')](_0x33ca82[_0xc2a8('0x19')],{'raw':_0x33ca82[_0xc2a8('0x1a')]?_0x33ca82[_0xc2a8('0x1a')][_0xc2a8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33ca82[_0xc2a8('0x1a')]?_0x33ca82[_0xc2a8('0x1a')][_0xc2a8('0x1e')]||null:null,'attributes':_0x33ca82[_0xc2a8('0x1a')]?_0x33ca82['options'][_0xc2a8('0x1f')]||null:null,'limit':_0x33ca82[_0xc2a8('0x1a')]?_0x33ca82['options'][_0xc2a8('0x20')]||null:null})[_0xc2a8('0xb')](function(_0x5e0c92){logger[_0xc2a8('0xc')](_0xc2a8('0x21'),_0x33ca82);logger[_0xc2a8('0xd')]('UpdateSquareReport',_0x33ca82,JSON[_0xc2a8('0x10')](_0x5e0c92));_0x5f4f11(_0x5e0c92);})[_0xc2a8('0x16')](function(_0x5a6365){logger[_0xc2a8('0x11')](_0xc2a8('0x21'),_0x5a6365[_0xc2a8('0x14')],_0x33ca82);_0x44a427(_0x58eaea[_0xc2a8('0x11')](0x1f4,_0x5a6365['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d13fc2c..77bba68 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(_0x42cedc,_0x3b34a2){var _0xed196e=function(_0x57127f){while(--_0x57127f){_0x42cedc['push'](_0x42cedc['shift']());}};_0xed196e(++_0x3b34a2);}(_0x7a54,0x106));var _0x47a5=function(_0x398761,_0x2b59f6){_0x398761=_0x398761-0x0;var _0x12c17c=_0x7a54[_0x398761];return _0x12c17c;};'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 _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3b1e0c,_0x4bad1d){var _0x4cf9bd=function(_0x57fef7){while(--_0x57fef7){_0x3b1e0c['push'](_0x3b1e0c['shift']());}};_0x4cf9bd(++_0x4bad1d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x242969,_0x19d676){_0x242969=_0x242969-0x0;var _0x2f22d2=_0x5f2f[_0x242969];return _0x2f22d2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 40691e3..effb034 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 _0xdb45=['exports','STRING','TEXT','sequelize'];(function(_0xcc6250,_0x48af95){var _0x25360a=function(_0x5163b3){while(--_0x5163b3){_0xcc6250['push'](_0xcc6250['shift']());}};_0x25360a(++_0x48af95);}(_0xdb45,0x12f));var _0x5db4=function(_0x573f6e,_0x2670e0){_0x573f6e=_0x573f6e-0x0;var _0xd89e47=_0xdb45[_0x573f6e];return _0xd89e47;};'use strict';var Sequelize=require(_0x5db4('0x0'));module[_0x5db4('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x5db4('0x2')]},'data':{'type':Sequelize[_0x5db4('0x3')]},'project_name':{'type':Sequelize[_0x5db4('0x2')]},'callerid':{'type':Sequelize[_0x5db4('0x2')]}}; \ No newline at end of file +var _0x8198=['STRING','TEXT'];(function(_0x86a99c,_0x1e51ae){var _0x88b958=function(_0x51b314){while(--_0x51b314){_0x86a99c['push'](_0x86a99c['shift']());}};_0x88b958(++_0x1e51ae);}(_0x8198,0x1f2));var _0x8819=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x8198[_0x2d8434];return _0x26b9e4;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x8819('0x0')]},'data':{'type':Sequelize[_0x8819('0x1')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8819('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 3accd7f..5282a63 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 _0xa63a=['offset','set','Content-Range','apply','save','update','then','error','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','describe','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','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x4bfff6,_0x3b8233){var _0x41d6c4=function(_0x59e7d7){while(--_0x59e7d7){_0x4bfff6['push'](_0x4bfff6['shift']());}};_0x41d6c4(++_0x3b8233);}(_0xa63a,0x78));var _0xaa63=function(_0x1d0764,_0x2beb7c){_0x1d0764=_0x1d0764-0x0;var _0x423f49=_0xa63a[_0x1d0764];return _0x423f49;};'use strict';var pdf=require(_0xaa63('0x0'));var emlformat=require(_0xaa63('0x1'));var rimraf=require(_0xaa63('0x2'));var zipdir=require(_0xaa63('0x3'));var jsonpatch=require(_0xaa63('0x4'));var rp=require(_0xaa63('0x5'));var moment=require(_0xaa63('0x6'));var BPromise=require(_0xaa63('0x7'));var Mustache=require(_0xaa63('0x8'));var util=require(_0xaa63('0x9'));var path=require(_0xaa63('0xa'));var sox=require(_0xaa63('0xb'));var csv=require(_0xaa63('0xc'));var ejs=require(_0xaa63('0xd'));var fs=require('fs');var _=require(_0xaa63('0xe'));var squel=require(_0xaa63('0xf'));var crypto=require(_0xaa63('0x10'));var jsforce=require(_0xaa63('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa63('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa63('0x13'));var qs=require(_0xaa63('0x14'));var as=require(_0xaa63('0x15'));var hardwareService=require(_0xaa63('0x16'));var logger=require(_0xaa63('0x17'))(_0xaa63('0x18'));var utils=require(_0xaa63('0x19'));var config=require('../../config/environment');var db=require(_0xaa63('0x1a'))['db'];function respondWithStatusCode(_0x4cbd32,_0x25d194){_0x25d194=_0x25d194||0xcc;return function(_0x216e89){if(_0x216e89){return _0x4cbd32[_0xaa63('0x1b')](_0x25d194);}return _0x4cbd32[_0xaa63('0x1c')](_0x25d194)[_0xaa63('0x1d')]();};}function respondWithResult(_0x5461f2,_0x368aac){_0x368aac=_0x368aac||0xc8;return function(_0x5516cf){if(_0x5516cf){return _0x5461f2['status'](_0x368aac)[_0xaa63('0x1e')](_0x5516cf);}};}function respondWithFilteredResult(_0x158faa,_0x5fab98){return function(_0x1ded94){if(_0x1ded94){var _0x4a513d=_0x1ded94[_0xaa63('0x1f')],_0xa7bf9b=_0x5fab98[_0xaa63('0x20')],_0x4e8b65=_0x5fab98[_0xaa63('0x20')]+_0x5fab98['limit'],_0x57ec89;if(_0x4e8b65>=_0x4a513d){_0x4e8b65=_0x4a513d;_0x57ec89=0xc8;}else{_0x57ec89=0xce;}_0x158faa['status'](_0x57ec89);return _0x158faa[_0xaa63('0x21')](_0xaa63('0x22'),_0xa7bf9b+'-'+_0x4e8b65+'/'+_0x4a513d)['json'](_0x1ded94);}return null;};}function patchUpdates(_0x40e640){return function(_0xafe8c9){try{jsonpatch[_0xaa63('0x23')](_0xafe8c9,_0x40e640,!![]);}catch(_0x4ceea0){return BPromise['reject'](_0x4ceea0);}return _0xafe8c9[_0xaa63('0x24')]();};}function saveUpdates(_0x139c12,_0x181b05){return function(_0x5616d8){if(_0x5616d8){return _0x5616d8[_0xaa63('0x25')](_0x139c12)[_0xaa63('0x26')](function(_0x202c55){return _0x202c55;});}return null;};}function removeEntity(_0x4f37cc,_0x1d252a){return function(_0x20b87c){if(_0x20b87c){return _0x20b87c['destroy']()[_0xaa63('0x26')](function(){_0x4f37cc[_0xaa63('0x1c')](0xcc)[_0xaa63('0x1d')]();});}};}function handleEntityNotFound(_0x38eb35,_0x66b74){return function(_0x5d564a){if(!_0x5d564a){_0x38eb35['sendStatus'](0x194);}return _0x5d564a;};}function handleError(_0x472edd,_0x10f56b){_0x10f56b=_0x10f56b||0x1f4;return function(_0x2cdf9a){logger[_0xaa63('0x27')](_0x2cdf9a['stack']);if(_0x2cdf9a[_0xaa63('0x28')]){delete _0x2cdf9a[_0xaa63('0x28')];}_0x472edd[_0xaa63('0x1c')](_0x10f56b)['send'](_0x2cdf9a);};}exports[_0xaa63('0x29')]=function(_0xb0381c,_0x1d045b){var _0x5599df={},_0x39d0b6={},_0x81d0fa={'count':0x0,'rows':[]};var _0x20e58c=_[_0xaa63('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x5063f4){return{'name':_0x5063f4[_0xaa63('0x2b')],'type':_0x5063f4[_0xaa63('0x2c')][_0xaa63('0x2d')]};});_0x39d0b6[_0xaa63('0x2e')]=_[_0xaa63('0x2a')](_0x20e58c,_0xaa63('0x28'));_0x39d0b6[_0xaa63('0x2f')]=_['keys'](_0xb0381c[_0xaa63('0x2f')]);_0x39d0b6[_0xaa63('0x30')]=_[_0xaa63('0x31')](_0x39d0b6['model'],_0x39d0b6[_0xaa63('0x2f')]);_0x5599df[_0xaa63('0x32')]=_[_0xaa63('0x31')](_0x39d0b6['model'],qs[_0xaa63('0x33')](_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x33')]));_0x5599df['attributes']=_0x5599df['attributes'][_0xaa63('0x34')]?_0x5599df[_0xaa63('0x32')]:_0x39d0b6[_0xaa63('0x2e')];if(!_0xb0381c[_0xaa63('0x2f')]['hasOwnProperty'](_0xaa63('0x35'))){_0x5599df['limit']=qs[_0xaa63('0x36')](_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x36')]);_0x5599df[_0xaa63('0x20')]=qs['offset'](_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x20')]);}_0x5599df[_0xaa63('0x37')]=qs[_0xaa63('0x38')](_0xb0381c['query'][_0xaa63('0x38')]);_0x5599df['where']=qs[_0xaa63('0x30')](_[_0xaa63('0x39')](_0xb0381c[_0xaa63('0x2f')],_0x39d0b6[_0xaa63('0x30')]),_0x20e58c);if(_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x3a')]){_0x5599df['where']=_[_0xaa63('0x3b')](_0x5599df[_0xaa63('0x3c')],{'$or':_['map'](_0x20e58c,function(_0x17216d){if(_0x17216d[_0xaa63('0x2c')]!==_0xaa63('0x3d')){var _0x2cff86={};_0x2cff86[_0x17216d[_0xaa63('0x28')]]={'$like':'%'+_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x3a')]+'%'};return _0x2cff86;}})});}_0x5599df=_['merge']({},_0x5599df,_0xb0381c[_0xaa63('0x3e')]);var _0x4399df={'where':_0x5599df[_0xaa63('0x3c')]};return db[_0xaa63('0x3f')][_0xaa63('0x1f')](_0x4399df)[_0xaa63('0x26')](function(_0x2c25ac){_0x81d0fa[_0xaa63('0x1f')]=_0x2c25ac;if(_0xb0381c[_0xaa63('0x2f')][_0xaa63('0x40')]){_0x5599df[_0xaa63('0x41')]=[{'all':!![]}];}return db[_0xaa63('0x3f')][_0xaa63('0x42')](_0x5599df);})[_0xaa63('0x26')](function(_0xd61e2c){_0x81d0fa[_0xaa63('0x43')]=_0xd61e2c;return _0x81d0fa;})[_0xaa63('0x26')](respondWithFilteredResult(_0x1d045b,_0x5599df))[_0xaa63('0x44')](handleError(_0x1d045b,null));};exports[_0xaa63('0x45')]=function(_0x4002c2,_0x18fe41){var _0x3a9816={'raw':!![],'where':{'id':_0x4002c2['params']['id']}},_0x4dd4d6={};_0x4dd4d6[_0xaa63('0x2e')]=_['keys'](db[_0xaa63('0x3f')]['rawAttributes']);_0x4dd4d6[_0xaa63('0x2f')]=_['keys'](_0x4002c2['query']);_0x4dd4d6[_0xaa63('0x30')]=_['intersection'](_0x4dd4d6[_0xaa63('0x2e')],_0x4dd4d6[_0xaa63('0x2f')]);_0x3a9816[_0xaa63('0x32')]=_[_0xaa63('0x31')](_0x4dd4d6[_0xaa63('0x2e')],qs[_0xaa63('0x33')](_0x4002c2[_0xaa63('0x2f')][_0xaa63('0x33')]));_0x3a9816[_0xaa63('0x32')]=_0x3a9816[_0xaa63('0x32')][_0xaa63('0x34')]?_0x3a9816['attributes']:_0x4dd4d6[_0xaa63('0x2e')];if(_0x4002c2[_0xaa63('0x2f')][_0xaa63('0x40')]){_0x3a9816[_0xaa63('0x41')]=[{'all':!![]}];}_0x3a9816=_[_0xaa63('0x3b')]({},_0x3a9816,_0x4002c2[_0xaa63('0x3e')]);return db['SquareDetailsReport'][_0xaa63('0x46')](_0x3a9816)['then'](handleEntityNotFound(_0x18fe41,null))['then'](respondWithResult(_0x18fe41,null))[_0xaa63('0x44')](handleError(_0x18fe41,null));};exports[_0xaa63('0x47')]=function(_0x392d7f,_0x554b74){return db[_0xaa63('0x3f')][_0xaa63('0x47')](_0x392d7f[_0xaa63('0x48')],{})[_0xaa63('0x26')](respondWithResult(_0x554b74,0xc9))[_0xaa63('0x44')](handleError(_0x554b74,null));};exports['update']=function(_0x19a6b3,_0x3c66a8){if(_0x19a6b3[_0xaa63('0x48')]['id']){delete _0x19a6b3[_0xaa63('0x48')]['id'];}return db[_0xaa63('0x3f')][_0xaa63('0x46')]({'where':{'id':_0x19a6b3[_0xaa63('0x49')]['id']}})[_0xaa63('0x26')](handleEntityNotFound(_0x3c66a8,null))[_0xaa63('0x26')](saveUpdates(_0x19a6b3['body'],null))['then'](respondWithResult(_0x3c66a8,null))[_0xaa63('0x44')](handleError(_0x3c66a8,null));};exports[_0xaa63('0x4a')]=function(_0x47becc,_0x2cc29c){return db[_0xaa63('0x3f')][_0xaa63('0x46')]({'where':{'id':_0x47becc[_0xaa63('0x49')]['id']}})[_0xaa63('0x26')](handleEntityNotFound(_0x2cc29c,null))[_0xaa63('0x26')](removeEntity(_0x2cc29c,null))[_0xaa63('0x44')](handleError(_0x2cc29c,null));};exports[_0xaa63('0x4b')]=function(_0x54acba,_0x480606){return db[_0xaa63('0x3f')][_0xaa63('0x4b')]()['then'](respondWithResult(_0x480606,null))['catch'](handleError(_0x480606,null));}; \ No newline at end of file +var _0x1069=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','create','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','querystring','papaparse','../../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','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1069,0xf9));var _0x9106=function(_0x37dfa5,_0x5d1391){_0x37dfa5=_0x37dfa5-0x0;var _0x1a8f23=_0x1069[_0x37dfa5];return _0x1a8f23;};'use strict';var pdf=require(_0x9106('0x0'));var emlformat=require(_0x9106('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9106('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9106('0x3'));var moment=require('moment');var BPromise=require(_0x9106('0x4'));var Mustache=require('mustache');var util=require(_0x9106('0x5'));var path=require(_0x9106('0x6'));var sox=require(_0x9106('0x7'));var csv=require('to-csv');var ejs=require(_0x9106('0x8'));var fs=require('fs');var _=require(_0x9106('0x9'));var squel=require(_0x9106('0xa'));var crypto=require(_0x9106('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9106('0xc'));var Papa=require(_0x9106('0xd'));var Redis=require('ioredis');var authService=require(_0x9106('0xe'));var qs=require(_0x9106('0xf'));var as=require(_0x9106('0x10'));var hardwareService=require(_0x9106('0x11'));var logger=require(_0x9106('0x12'))(_0x9106('0x13'));var utils=require(_0x9106('0x14'));var config=require(_0x9106('0x15'));var db=require(_0x9106('0x16'))['db'];function respondWithStatusCode(_0x13f5f5,_0x2a8c95){_0x2a8c95=_0x2a8c95||0xcc;return function(_0x3dbcd6){if(_0x3dbcd6){return _0x13f5f5[_0x9106('0x17')](_0x2a8c95);}return _0x13f5f5[_0x9106('0x18')](_0x2a8c95)[_0x9106('0x19')]();};}function respondWithResult(_0x20032a,_0x2038b9){_0x2038b9=_0x2038b9||0xc8;return function(_0x40d2f9){if(_0x40d2f9){return _0x20032a['status'](_0x2038b9)[_0x9106('0x1a')](_0x40d2f9);}};}function respondWithFilteredResult(_0x4d390a,_0x350c22){return function(_0x12e8e7){if(_0x12e8e7){var _0x23e53b=_0x12e8e7[_0x9106('0x1b')],_0x59c101=_0x350c22[_0x9106('0x1c')],_0x33bd49=_0x350c22[_0x9106('0x1c')]+_0x350c22['limit'],_0x5c76ec;if(_0x33bd49>=_0x23e53b){_0x33bd49=_0x23e53b;_0x5c76ec=0xc8;}else{_0x5c76ec=0xce;}_0x4d390a[_0x9106('0x18')](_0x5c76ec);return _0x4d390a[_0x9106('0x1d')](_0x9106('0x1e'),_0x59c101+'-'+_0x33bd49+'/'+_0x23e53b)[_0x9106('0x1a')](_0x12e8e7);}return null;};}function patchUpdates(_0x54889d){return function(_0x28ab0d){try{jsonpatch['apply'](_0x28ab0d,_0x54889d,!![]);}catch(_0x5f5df3){return BPromise[_0x9106('0x1f')](_0x5f5df3);}return _0x28ab0d[_0x9106('0x20')]();};}function saveUpdates(_0x2d571a,_0x3b1c0e){return function(_0x1a3254){if(_0x1a3254){return _0x1a3254[_0x9106('0x21')](_0x2d571a)[_0x9106('0x22')](function(_0xc96a3f){return _0xc96a3f;});}return null;};}function removeEntity(_0x1cb33e,_0x319884){return function(_0x17a347){if(_0x17a347){return _0x17a347[_0x9106('0x23')]()[_0x9106('0x22')](function(){_0x1cb33e['status'](0xcc)[_0x9106('0x19')]();});}};}function handleEntityNotFound(_0x5526de,_0x3502ee){return function(_0x143ca1){if(!_0x143ca1){_0x5526de[_0x9106('0x17')](0x194);}return _0x143ca1;};}function handleError(_0x3a0646,_0x5884f3){_0x5884f3=_0x5884f3||0x1f4;return function(_0x395c2c){logger[_0x9106('0x24')](_0x395c2c[_0x9106('0x25')]);if(_0x395c2c[_0x9106('0x26')]){delete _0x395c2c[_0x9106('0x26')];}_0x3a0646[_0x9106('0x18')](_0x5884f3)[_0x9106('0x27')](_0x395c2c);};}exports[_0x9106('0x28')]=function(_0x25a48e,_0x58c166){var _0x38715e={},_0x259695={},_0x13194e={'count':0x0,'rows':[]};var _0x2e5239=_[_0x9106('0x29')](db[_0x9106('0x2a')][_0x9106('0x2b')],function(_0x1213fc){return{'name':_0x1213fc[_0x9106('0x2c')],'type':_0x1213fc[_0x9106('0x2d')][_0x9106('0x2e')]};});_0x259695[_0x9106('0x2f')]=_[_0x9106('0x29')](_0x2e5239,_0x9106('0x26'));_0x259695[_0x9106('0x30')]=_['keys'](_0x25a48e['query']);_0x259695[_0x9106('0x31')]=_[_0x9106('0x32')](_0x259695[_0x9106('0x2f')],_0x259695[_0x9106('0x30')]);_0x38715e[_0x9106('0x33')]=_[_0x9106('0x32')](_0x259695['model'],qs[_0x9106('0x34')](_0x25a48e[_0x9106('0x30')][_0x9106('0x34')]));_0x38715e['attributes']=_0x38715e['attributes'][_0x9106('0x35')]?_0x38715e[_0x9106('0x33')]:_0x259695[_0x9106('0x2f')];if(!_0x25a48e['query'][_0x9106('0x36')](_0x9106('0x37'))){_0x38715e[_0x9106('0x38')]=qs[_0x9106('0x38')](_0x25a48e[_0x9106('0x30')][_0x9106('0x38')]);_0x38715e[_0x9106('0x1c')]=qs[_0x9106('0x1c')](_0x25a48e[_0x9106('0x30')][_0x9106('0x1c')]);}_0x38715e['order']=qs[_0x9106('0x39')](_0x25a48e[_0x9106('0x30')][_0x9106('0x39')]);_0x38715e[_0x9106('0x3a')]=qs[_0x9106('0x31')](_[_0x9106('0x3b')](_0x25a48e[_0x9106('0x30')],_0x259695[_0x9106('0x31')]),_0x2e5239);if(_0x25a48e[_0x9106('0x30')][_0x9106('0x3c')]){_0x38715e[_0x9106('0x3a')]=_[_0x9106('0x3d')](_0x38715e[_0x9106('0x3a')],{'$or':_['map'](_0x2e5239,function(_0x3278fe){if(_0x3278fe[_0x9106('0x2d')]!==_0x9106('0x3e')){var _0x2f39c5={};_0x2f39c5[_0x3278fe['name']]={'$like':'%'+_0x25a48e[_0x9106('0x30')]['filter']+'%'};return _0x2f39c5;}})});}_0x38715e=_[_0x9106('0x3d')]({},_0x38715e,_0x25a48e[_0x9106('0x3f')]);var _0xaa1b4f={'where':_0x38715e['where']};return db[_0x9106('0x2a')]['count'](_0xaa1b4f)[_0x9106('0x22')](function(_0x33e7d7){_0x13194e[_0x9106('0x1b')]=_0x33e7d7;if(_0x25a48e[_0x9106('0x30')][_0x9106('0x40')]){_0x38715e[_0x9106('0x41')]=[{'all':!![]}];}return db[_0x9106('0x2a')]['findAll'](_0x38715e);})['then'](function(_0x4445ed){_0x13194e['rows']=_0x4445ed;return _0x13194e;})['then'](respondWithFilteredResult(_0x58c166,_0x38715e))[_0x9106('0x42')](handleError(_0x58c166,null));};exports['show']=function(_0x1f3cab,_0x22cd37){var _0x5b832d={'raw':!![],'where':{'id':_0x1f3cab[_0x9106('0x43')]['id']}},_0x33384c={};_0x33384c['model']=_[_0x9106('0x44')](db[_0x9106('0x2a')][_0x9106('0x2b')]);_0x33384c[_0x9106('0x30')]=_[_0x9106('0x44')](_0x1f3cab[_0x9106('0x30')]);_0x33384c['filters']=_[_0x9106('0x32')](_0x33384c[_0x9106('0x2f')],_0x33384c[_0x9106('0x30')]);_0x5b832d[_0x9106('0x33')]=_[_0x9106('0x32')](_0x33384c['model'],qs['fields'](_0x1f3cab[_0x9106('0x30')][_0x9106('0x34')]));_0x5b832d['attributes']=_0x5b832d[_0x9106('0x33')][_0x9106('0x35')]?_0x5b832d[_0x9106('0x33')]:_0x33384c[_0x9106('0x2f')];if(_0x1f3cab[_0x9106('0x30')][_0x9106('0x40')]){_0x5b832d[_0x9106('0x41')]=[{'all':!![]}];}_0x5b832d=_[_0x9106('0x3d')]({},_0x5b832d,_0x1f3cab[_0x9106('0x3f')]);return db[_0x9106('0x2a')]['find'](_0x5b832d)['then'](handleEntityNotFound(_0x22cd37,null))['then'](respondWithResult(_0x22cd37,null))[_0x9106('0x42')](handleError(_0x22cd37,null));};exports[_0x9106('0x45')]=function(_0x2096b8,_0x44c233){return db[_0x9106('0x2a')][_0x9106('0x45')](_0x2096b8[_0x9106('0x46')],{})['then'](respondWithResult(_0x44c233,0xc9))[_0x9106('0x42')](handleError(_0x44c233,null));};exports[_0x9106('0x21')]=function(_0x4dd0c2,_0x4c05df){if(_0x4dd0c2[_0x9106('0x46')]['id']){delete _0x4dd0c2['body']['id'];}return db[_0x9106('0x2a')][_0x9106('0x47')]({'where':{'id':_0x4dd0c2[_0x9106('0x43')]['id']}})[_0x9106('0x22')](handleEntityNotFound(_0x4c05df,null))[_0x9106('0x22')](saveUpdates(_0x4dd0c2['body'],null))[_0x9106('0x22')](respondWithResult(_0x4c05df,null))['catch'](handleError(_0x4c05df,null));};exports[_0x9106('0x23')]=function(_0x838522,_0x28c5c7){return db[_0x9106('0x2a')]['find']({'where':{'id':_0x838522[_0x9106('0x43')]['id']}})[_0x9106('0x22')](handleEntityNotFound(_0x28c5c7,null))[_0x9106('0x22')](removeEntity(_0x28c5c7,null))[_0x9106('0x42')](handleError(_0x28c5c7,null));};exports[_0x9106('0x48')]=function(_0x3d667e,_0x1bd518){return db[_0x9106('0x2a')][_0x9106('0x48')]()['then'](respondWithResult(_0x1bd518,null))[_0x9106('0x42')](handleError(_0x1bd518,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b475e2f..35cb8d7 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 _0x5370=['report_square_details','util','../../config/logger','api','moment','bluebird','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5370,0x11f));var _0x0537=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5370[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0537('0x0'));var logger=require(_0x0537('0x1'))(_0x0537('0x2'));var moment=require(_0x0537('0x3'));var BPromise=require(_0x0537('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0537('0x5'));var config=require('../../config/environment');var attributes=require(_0x0537('0x6'));module[_0x0537('0x7')]=function(_0x601891,_0x494a2c){return _0x601891[_0x0537('0x8')](_0x0537('0x9'),attributes,{'tableName':_0x0537('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5a6=['request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','lodash','util','api','moment','bluebird'];(function(_0x4e1af4,_0x5b8cc6){var _0x42b609=function(_0x3cb930){while(--_0x3cb930){_0x4e1af4['push'](_0x4e1af4['shift']());}};_0x42b609(++_0x5b8cc6);}(_0xf5a6,0x7f));var _0x6f5a=function(_0x2eb4dd,_0x4eef7c){_0x2eb4dd=_0x2eb4dd-0x0;var _0x10e506=_0xf5a6[_0x2eb4dd];return _0x10e506;};'use strict';var _=require(_0x6f5a('0x0'));var util=require(_0x6f5a('0x1'));var logger=require('../../config/logger')(_0x6f5a('0x2'));var moment=require(_0x6f5a('0x3'));var BPromise=require(_0x6f5a('0x4'));var rp=require(_0x6f5a('0x5'));var fs=require('fs');var path=require(_0x6f5a('0x6'));var rimraf=require('rimraf');var config=require(_0x6f5a('0x7'));var attributes=require(_0x6f5a('0x8'));module[_0x6f5a('0x9')]=function(_0x556907,_0x5dab54){return _0x556907['define'](_0x6f5a('0xa'),attributes,{'tableName':'report_square_details','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 1a51935..7717905 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 _0x391a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateSquareDetailsReport','options','raw','lodash','util','moment'];(function(_0x5c4060,_0x459619){var _0x3e1ad9=function(_0x4de5f5){while(--_0x4de5f5){_0x5c4060['push'](_0x5c4060['shift']());}};_0x3e1ad9(++_0x459619);}(_0x391a,0x1b7));var _0xa391=function(_0x5ed91b,_0x17f80c){_0x5ed91b=_0x5ed91b-0x0;var _0x2ec9d3=_0x391a[_0x5ed91b];return _0x2ec9d3;};'use strict';var _=require(_0xa391('0x0'));var util=require(_0xa391('0x1'));var moment=require(_0xa391('0x2'));var BPromise=require(_0xa391('0x3'));var rs=require(_0xa391('0x4'));var fs=require('fs');var Redis=require(_0xa391('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa391('0x6'));var logger=require(_0xa391('0x7'))(_0xa391('0x8'));var config=require(_0xa391('0x9'));var jayson=require(_0xa391('0xa'));var client=jayson[_0xa391('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x334853,_0x397d47,_0x4e112d){return new BPromise(function(_0xf93558,_0x50c226){return client[_0xa391('0xc')](_0x334853,_0x4e112d)[_0xa391('0xd')](function(_0x16aa50){logger[_0xa391('0xe')](_0xa391('0xf'),_0x397d47,_0xa391('0x10'));logger[_0xa391('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x397d47,_0xa391('0x10'),JSON[_0xa391('0x12')](_0x16aa50));if(_0x16aa50[_0xa391('0x13')]){if(_0x16aa50[_0xa391('0x13')][_0xa391('0x14')]===0x1f4){logger[_0xa391('0x13')](_0xa391('0xf'),_0x397d47,_0x16aa50[_0xa391('0x13')][_0xa391('0x15')]);return _0x50c226(_0x16aa50[_0xa391('0x13')][_0xa391('0x15')]);}logger[_0xa391('0x13')](_0xa391('0xf'),_0x397d47,_0x16aa50[_0xa391('0x13')][_0xa391('0x15')]);return _0xf93558(_0x16aa50[_0xa391('0x13')][_0xa391('0x15')]);}else{logger[_0xa391('0xe')](_0xa391('0xf'),_0x397d47,_0xa391('0x10'));_0xf93558(_0x16aa50['result']['message']);}})[_0xa391('0x16')](function(_0x2720d2){logger[_0xa391('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x397d47,_0x2720d2);_0x50c226(_0x2720d2);});});}exports[_0xa391('0x17')]=function(_0x18359a){var _0x4f898c=this;return new Promise(function(_0x5eb7bb,_0x5b8d2c){return db['SquareDetailsReport']['create'](_0x18359a['body'],{'raw':_0x18359a[_0xa391('0x18')]?_0x18359a[_0xa391('0x18')][_0xa391('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x69b203){logger[_0xa391('0xe')](_0xa391('0x17'),_0x18359a);logger[_0xa391('0x11')](_0xa391('0x17'),_0x18359a,JSON[_0xa391('0x12')](_0x69b203));_0x5eb7bb(_0x69b203);})[_0xa391('0x16')](function(_0x585ca9){logger['error'](_0xa391('0x17'),_0x585ca9[_0xa391('0x15')],_0x18359a);_0x5b8d2c(_0x4f898c['error'](0x1f4,_0x585ca9[_0xa391('0x15')]));});});}; \ No newline at end of file +var _0xaaa5=['http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareDetailsReport','create','body','options','raw','then','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xaaa5,0x155));var _0x5aaa=function(_0x2b8d34,_0x3f824a){_0x2b8d34=_0x2b8d34-0x0;var _0x344cd9=_0xaaa5[_0x2b8d34];return _0x344cd9;};'use strict';var _=require(_0x5aaa('0x0'));var util=require(_0x5aaa('0x1'));var moment=require('moment');var BPromise=require(_0x5aaa('0x2'));var rs=require(_0x5aaa('0x3'));var fs=require('fs');var Redis=require(_0x5aaa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5aaa('0x5'));var logger=require('../../config/logger')(_0x5aaa('0x6'));var config=require(_0x5aaa('0x7'));var jayson=require(_0x5aaa('0x8'));var client=jayson[_0x5aaa('0x9')][_0x5aaa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd032,_0x168711,_0x92f774){return new BPromise(function(_0x1e75db,_0x1bf8ad){return client[_0x5aaa('0xb')](_0x4dd032,_0x92f774)['then'](function(_0x287420){logger[_0x5aaa('0xc')](_0x5aaa('0xd'),_0x168711,_0x5aaa('0xe'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x168711,_0x5aaa('0xe'),JSON[_0x5aaa('0xf')](_0x287420));if(_0x287420[_0x5aaa('0x10')]){if(_0x287420['error']['code']===0x1f4){logger[_0x5aaa('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x168711,_0x287420[_0x5aaa('0x10')]['message']);return _0x1bf8ad(_0x287420['error'][_0x5aaa('0x11')]);}logger[_0x5aaa('0x10')](_0x5aaa('0xd'),_0x168711,_0x287420[_0x5aaa('0x10')][_0x5aaa('0x11')]);return _0x1e75db(_0x287420[_0x5aaa('0x10')][_0x5aaa('0x11')]);}else{logger['info'](_0x5aaa('0xd'),_0x168711,_0x5aaa('0xe'));_0x1e75db(_0x287420[_0x5aaa('0x12')][_0x5aaa('0x11')]);}})['catch'](function(_0x50647d){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x168711,_0x50647d);_0x1bf8ad(_0x50647d);});});}exports[_0x5aaa('0x13')]=function(_0x2506d3){var _0x58e99c=this;return new Promise(function(_0x18da25,_0x4838f7){return db['SquareDetailsReport'][_0x5aaa('0x14')](_0x2506d3[_0x5aaa('0x15')],{'raw':_0x2506d3[_0x5aaa('0x16')]?_0x2506d3[_0x5aaa('0x16')][_0x5aaa('0x17')]===undefined?!![]:![]:!![]})[_0x5aaa('0x18')](function(_0x1bb129){logger[_0x5aaa('0xc')](_0x5aaa('0x13'),_0x2506d3);logger[_0x5aaa('0x19')]('CreateSquareDetailsReport',_0x2506d3,JSON[_0x5aaa('0xf')](_0x1bb129));_0x18da25(_0x1bb129);})[_0x5aaa('0x1a')](function(_0xe9766a){logger['error'](_0x5aaa('0x13'),_0xe9766a['message'],_0x2506d3);_0x4838f7(_0x58e99c[_0x5aaa('0x10')](0x1f4,_0xe9766a[_0x5aaa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 0a33d4b..85fe67e 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 _0x2471=['index','/process/:pid/kill','killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x1610a9,_0x12b812){var _0x33a66e=function(_0x70738f){while(--_0x70738f){_0x1610a9['push'](_0x1610a9['shift']());}};_0x33a66e(++_0x12b812);}(_0x2471,0x70));var _0x1247=function(_0x4ae260,_0x2b9058){_0x4ae260=_0x4ae260-0x0;var _0x52ba98=_0x2471[_0x4ae260];return _0x52ba98;};'use strict';var express=require('express');var router=express[_0x1247('0x0')]();var auth=require(_0x1247('0x1'));var controller=require(_0x1247('0x2'));router[_0x1247('0x3')]('/',auth[_0x1247('0x4')](),controller[_0x1247('0x5')]);router[_0x1247('0x3')](_0x1247('0x6'),auth[_0x1247('0x4')](),controller[_0x1247('0x7')]);module[_0x1247('0x8')]=router; \ No newline at end of file +var _0x697e=['isAuthenticated','index','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller','get'];(function(_0x4daf52,_0x1895ea){var _0x586fc9=function(_0x3c28a8){while(--_0x3c28a8){_0x4daf52['push'](_0x4daf52['shift']());}};_0x586fc9(++_0x1895ea);}(_0x697e,0xe4));var _0xe697=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x697e[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0xe697('0x0')]();var auth=require(_0xe697('0x1'));var controller=require(_0xe697('0x2'));router[_0xe697('0x3')]('/',auth[_0xe697('0x4')](),controller[_0xe697('0x5')]);router[_0xe697('0x3')](_0xe697('0x6'),auth[_0xe697('0x4')](),controller['killProcess']);module[_0xe697('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2f230b0..b525785 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 _0x7780=['index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split','length','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send'];(function(_0x52c3d5,_0x153853){var _0x3ec72a=function(_0x1a5531){while(--_0x1a5531){_0x52c3d5['push'](_0x52c3d5['shift']());}};_0x3ec72a(++_0x153853);}(_0x7780,0xef));var _0x0778=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x7780[_0x1c7137];return _0xeb4432;};'use strict';var info=require(_0x0778('0x0'));var exec=require(_0x0778('0x1'))[_0x0778('0x2')];var logger=require(_0x0778('0x3'))(_0x0778('0x4'));var util=require('util');var BPromise=require(_0x0778('0x5'));var _=require(_0x0778('0x6'));function handleError(_0x39abaf,_0x15dffc,_0x5f51c3){_0x15dffc=_0x15dffc||0x1f4;return function(_0x1544cf){logger[_0x0778('0x7')](_0x0778('0x8'),_0x5f51c3,_0x15dffc,util[_0x0778('0x9')](_0x1544cf,{'showHidden':![],'depth':null}));delete _0x1544cf[_0x0778('0xa')];_0x39abaf[_0x0778('0xb')](_0x15dffc)[_0x0778('0xc')](_0x1544cf);};}exports[_0x0778('0xd')]=function(_0x5c5266,_0x4c0499){return info[_0x0778('0xe')]()[_0x0778('0xf')](function(_0x543874){return _0x4c0499[_0x0778('0xb')](0xc8)[_0x0778('0x10')](_0x543874);})[_0x0778('0x11')](function(_0x1ccb86){return _0x4c0499['status'](0x1f4)['json'](_0x1ccb86);});};exports[_0x0778('0x12')]=function(_0x36140a,_0x4cc1de){var _0x1cb370=[_0x0778('0x13')];return new BPromise(function(_0x2dfe65,_0x350fe2){return exec(util[_0x0778('0x14')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x36140a[_0x0778('0x15')][_0x0778('0x16')]),function(_0x2a3f10,_0x58ded6,_0x94ab3a){if(_0x2a3f10){return _0x350fe2(_0x2a3f10);}return _0x2dfe65(_0x58ded6);});})[_0x0778('0xf')](function(_0x514ffe){var _0x46f95c=![];var _0x224a11=_0x514ffe[_0x0778('0x17')](/\n/);for(var _0x3f890b=0x0,_0x7fb035=_0x1cb370[_0x0778('0x18')];_0x3f890b<_0x7fb035,_0x46f95c===![];_0x3f890b+=0x1){if(_0x514ffe['indexOf'](_0x1cb370[_0x3f890b])>=0x0){_0x46f95c=!![];}}if(!_0x46f95c){throw new Error(util[_0x0778('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x36140a[_0x0778('0x15')][_0x0778('0x16')]));}process[_0x0778('0x19')](_0x36140a[_0x0778('0x15')]['pid'],_0x0778('0x1a'));return _0x4cc1de['status'](0xc8)[_0x0778('0x10')]({'message':util['format'](_0x0778('0x1b'),_0x36140a[_0x0778('0x15')][_0x0778('0x16')])});})['catch'](handleError(_0x4cc1de,null,_0x0778('0x12')));}; \ No newline at end of file +var _0x1f52=['components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess'];(function(_0x5a405c,_0x3f580e){var _0x44c5dd=function(_0x2a3f20){while(--_0x2a3f20){_0x5a405c['push'](_0x5a405c['shift']());}};_0x44c5dd(++_0x3f580e);}(_0x1f52,0x85));var _0x21f5=function(_0xdfb3c3,_0x59788d){_0xdfb3c3=_0xdfb3c3-0x0;var _0x4f9a74=_0x1f52[_0xdfb3c3];return _0x4f9a74;};'use strict';var info=require(_0x21f5('0x0'));var exec=require('child_process')[_0x21f5('0x1')];var logger=require(_0x21f5('0x2'))(_0x21f5('0x3'));var util=require('util');var BPromise=require(_0x21f5('0x4'));var _=require(_0x21f5('0x5'));function handleError(_0x4ceb02,_0x2dc16a,_0xfa2775){_0x2dc16a=_0x2dc16a||0x1f4;return function(_0x398e21){logger[_0x21f5('0x6')](_0x21f5('0x7'),_0xfa2775,_0x2dc16a,util[_0x21f5('0x8')](_0x398e21,{'showHidden':![],'depth':null}));delete _0x398e21[_0x21f5('0x9')];_0x4ceb02[_0x21f5('0xa')](_0x2dc16a)[_0x21f5('0xb')](_0x398e21);};}exports[_0x21f5('0xc')]=function(_0x416361,_0x55e5a0){return info[_0x21f5('0xd')]()[_0x21f5('0xe')](function(_0x3b5bab){return _0x55e5a0[_0x21f5('0xa')](0xc8)[_0x21f5('0xf')](_0x3b5bab);})['catch'](function(_0xea89a6){return _0x55e5a0[_0x21f5('0xa')](0x1f4)['json'](_0xea89a6);});};exports[_0x21f5('0x10')]=function(_0x1fdc04,_0x5f5cc6){var _0x2efded=[_0x21f5('0x11')];return new BPromise(function(_0xf1ea36,_0x4cac31){return exec(util[_0x21f5('0x12')](_0x21f5('0x13'),_0x1fdc04['params'][_0x21f5('0x14')]),function(_0x381850,_0x3319f2,_0x2da56e){if(_0x381850){return _0x4cac31(_0x381850);}return _0xf1ea36(_0x3319f2);});})['then'](function(_0xecb9bc){var _0x2d88c5=![];var _0x214cb0=_0xecb9bc[_0x21f5('0x15')](/\n/);for(var _0x1722c6=0x0,_0x2dcc56=_0x2efded[_0x21f5('0x16')];_0x1722c6<_0x2dcc56,_0x2d88c5===![];_0x1722c6+=0x1){if(_0xecb9bc[_0x21f5('0x17')](_0x2efded[_0x1722c6])>=0x0){_0x2d88c5=!![];}}if(!_0x2d88c5){throw new Error(util['format'](_0x21f5('0x18'),_0x1fdc04['params'][_0x21f5('0x14')]));}process[_0x21f5('0x19')](_0x1fdc04[_0x21f5('0x1a')][_0x21f5('0x14')],_0x21f5('0x1b'));return _0x5f5cc6['status'](0xc8)[_0x21f5('0xf')]({'message':util[_0x21f5('0x12')](_0x21f5('0x1c'),_0x1fdc04[_0x21f5('0x1a')][_0x21f5('0x14')])});})[_0x21f5('0x1d')](handleError(_0x5f5cc6,null,_0x21f5('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 07b9728..81e3720 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 _0xfd28=['index','/:id','post','create','update','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x406d8c,_0x51f6a2){var _0x28be52=function(_0x1d574e){while(--_0x1d574e){_0x406d8c['push'](_0x406d8c['shift']());}};_0x28be52(++_0x51f6a2);}(_0xfd28,0x148));var _0x8fd2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xfd28[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var auth=require(_0x8fd2('0x3'));var interaction=require(_0x8fd2('0x4'));var config=require(_0x8fd2('0x5'));var controller=require('./tag.controller');router[_0x8fd2('0x6')]('/',auth[_0x8fd2('0x7')](),controller[_0x8fd2('0x8')]);router[_0x8fd2('0x6')](_0x8fd2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8fd2('0xa')]('/',auth[_0x8fd2('0x7')](),controller[_0x8fd2('0xb')]);router['put'](_0x8fd2('0x9'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['delete'](_0x8fd2('0x9'),auth['isAuthenticated'](),controller[_0x8fd2('0xd')]);module['exports']=router; \ No newline at end of file +var _0xb43b=['get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x1e399a,_0x179b5b){var _0x114766=function(_0x527fe6){while(--_0x527fe6){_0x1e399a['push'](_0x1e399a['shift']());}};_0x114766(++_0x179b5b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x7d06a0,_0x443c24){_0x7d06a0=_0x7d06a0-0x0;var _0x2ee611=_0xb43b[_0x7d06a0];return _0x2ee611;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb43('0x5'));var config=require(_0xbb43('0x6'));var controller=require(_0xbb43('0x7'));router[_0xbb43('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb43('0x8')]('/:id',auth[_0xbb43('0x9')](),controller[_0xbb43('0xa')]);router[_0xbb43('0xb')]('/',auth[_0xbb43('0x9')](),controller[_0xbb43('0xc')]);router['put'](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller['update']);router[_0xbb43('0xe')](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller[_0xbb43('0xf')]);module[_0xbb43('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a20b2c9..6986dd7 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 _0xda3f=['exports','STRING'];(function(_0x655985,_0x4e86ee){var _0x40568f=function(_0xbce30d){while(--_0xbce30d){_0x655985['push'](_0x655985['shift']());}};_0x40568f(++_0x4e86ee);}(_0xda3f,0xec));var _0xfda3=function(_0xfbac49,_0x248e85){_0xfbac49=_0xfbac49-0x0;var _0x183942=_0xda3f[_0xfbac49];return _0x183942;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'name':{'type':Sequelize[_0xfda3('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xfda3('0x1')]}}; \ No newline at end of file +var _0xbdb7=['name','#0091EA','sequelize','exports','STRING'];(function(_0x16ae34,_0x1dc6d){var _0x184836=function(_0x1e48b7){while(--_0x1e48b7){_0x16ae34['push'](_0x16ae34['shift']());}};_0x184836(++_0x1dc6d);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x39e4a1,_0x4edcc5){_0x39e4a1=_0x39e4a1-0x0;var _0x55b30e=_0xbdb7[_0x39e4a1];return _0x55b30e;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'unique':_0x7bdb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':_0x7bdb('0x4')},'description':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 467fb96..0217fb5 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 _0xa2d7=['ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','destroy','then','get','Tags','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','Tag','includeAll','include','show','length','create','body','user','role','find','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2c8e0a,_0x1900eb){var _0x13ab60=function(_0x262227){while(--_0x262227){_0x2c8e0a['push'](_0x2c8e0a['shift']());}};_0x13ab60(++_0x1900eb);}(_0xa2d7,0xdd));var _0x7a2d=function(_0x4a53fb,_0x52c2d0){_0x4a53fb=_0x4a53fb-0x0;var _0x49920d=_0xa2d7[_0x4a53fb];return _0x49920d;};'use strict';var pdf=require(_0x7a2d('0x0'));var emlformat=require(_0x7a2d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7a2d('0x2'));var jsonpatch=require(_0x7a2d('0x3'));var rp=require(_0x7a2d('0x4'));var moment=require(_0x7a2d('0x5'));var BPromise=require(_0x7a2d('0x6'));var Mustache=require(_0x7a2d('0x7'));var util=require(_0x7a2d('0x8'));var path=require('path');var sox=require(_0x7a2d('0x9'));var csv=require(_0x7a2d('0xa'));var ejs=require(_0x7a2d('0xb'));var fs=require('fs');var _=require(_0x7a2d('0xc'));var squel=require(_0x7a2d('0xd'));var crypto=require(_0x7a2d('0xe'));var jsforce=require(_0x7a2d('0xf'));var deskjs=require(_0x7a2d('0x10'));var toCsv=require(_0x7a2d('0xa'));var querystring=require(_0x7a2d('0x11'));var Papa=require(_0x7a2d('0x12'));var Redis=require(_0x7a2d('0x13'));var authService=require(_0x7a2d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a2d('0x15'));var logger=require('../../config/logger')(_0x7a2d('0x16'));var utils=require(_0x7a2d('0x17'));var config=require(_0x7a2d('0x18'));var db=require(_0x7a2d('0x19'))['db'];function respondWithStatusCode(_0xe92c1d,_0x12df71){_0x12df71=_0x12df71||0xcc;return function(_0x421132){if(_0x421132){return _0xe92c1d[_0x7a2d('0x1a')](_0x12df71);}return _0xe92c1d[_0x7a2d('0x1b')](_0x12df71)[_0x7a2d('0x1c')]();};}function respondWithResult(_0x4c71f2,_0x108937){_0x108937=_0x108937||0xc8;return function(_0x2f5c7a){if(_0x2f5c7a){return _0x4c71f2[_0x7a2d('0x1b')](_0x108937)[_0x7a2d('0x1d')](_0x2f5c7a);}};}function respondWithFilteredResult(_0x43b4b9,_0x4c8f11){return function(_0x2248b6){if(_0x2248b6){var _0x4e70d2=_0x2248b6[_0x7a2d('0x1e')],_0x4fdeda=_0x4c8f11[_0x7a2d('0x1f')],_0x48d810=_0x4c8f11[_0x7a2d('0x1f')]+_0x4c8f11[_0x7a2d('0x20')],_0x3ff1ee;if(_0x48d810>=_0x4e70d2){_0x48d810=_0x4e70d2;_0x3ff1ee=0xc8;}else{_0x3ff1ee=0xce;}_0x43b4b9['status'](_0x3ff1ee);return _0x43b4b9['set']('Content-Range',_0x4fdeda+'-'+_0x48d810+'/'+_0x4e70d2)[_0x7a2d('0x1d')](_0x2248b6);}return null;};}function patchUpdates(_0x31d391){return function(_0x188c66){try{jsonpatch[_0x7a2d('0x21')](_0x188c66,_0x31d391,!![]);}catch(_0x57f487){return BPromise['reject'](_0x57f487);}return _0x188c66[_0x7a2d('0x22')]();};}function saveUpdates(_0x1cebb7,_0x2a1613){return function(_0xd98ef7){if(_0xd98ef7){return _0xd98ef7[_0x7a2d('0x23')](_0x1cebb7)['then'](function(_0x40948f){return _0x40948f;});}return null;};}function removeEntity(_0x2f876d,_0x53e1f3){return function(_0x36619e){if(_0x36619e){return _0x36619e[_0x7a2d('0x24')]()[_0x7a2d('0x25')](function(){var _0x5297e5=_0x36619e[_0x7a2d('0x26')]({'plain':!![]});var _0x4a21b0=_0x7a2d('0x27');return db[_0x7a2d('0x28')]['destroy']({'where':{'type':_0x4a21b0,'resourceId':_0x5297e5['id']}})[_0x7a2d('0x25')](function(){return _0x36619e;});})['then'](function(){_0x2f876d[_0x7a2d('0x1b')](0xcc)[_0x7a2d('0x1c')]();});}};}function handleEntityNotFound(_0x26e78e,_0x2b714e){return function(_0x2fdb86){if(!_0x2fdb86){_0x26e78e[_0x7a2d('0x1a')](0x194);}return _0x2fdb86;};}function handleError(_0xa3107e,_0x45670b){_0x45670b=_0x45670b||0x1f4;return function(_0x58ace9){logger['error'](_0x58ace9[_0x7a2d('0x29')]);if(_0x58ace9[_0x7a2d('0x2a')]){delete _0x58ace9['name'];}_0xa3107e[_0x7a2d('0x1b')](_0x45670b)[_0x7a2d('0x2b')](_0x58ace9);};}exports[_0x7a2d('0x2c')]=function(_0x56c824,_0x191bf2){var _0x38ddd8={},_0x74c3ce={},_0x4e580c={'count':0x0,'rows':[]};var _0x5682ec=_['map'](db['Tag'][_0x7a2d('0x2d')],function(_0x367c3d){return{'name':_0x367c3d[_0x7a2d('0x2e')],'type':_0x367c3d[_0x7a2d('0x2f')][_0x7a2d('0x30')]};});_0x74c3ce[_0x7a2d('0x31')]=_[_0x7a2d('0x32')](_0x5682ec,_0x7a2d('0x2a'));_0x74c3ce[_0x7a2d('0x33')]=_[_0x7a2d('0x34')](_0x56c824['query']);_0x74c3ce[_0x7a2d('0x35')]=_[_0x7a2d('0x36')](_0x74c3ce['model'],_0x74c3ce[_0x7a2d('0x33')]);_0x38ddd8[_0x7a2d('0x37')]=_[_0x7a2d('0x36')](_0x74c3ce[_0x7a2d('0x31')],qs[_0x7a2d('0x38')](_0x56c824['query'][_0x7a2d('0x38')]));_0x38ddd8['attributes']=_0x38ddd8[_0x7a2d('0x37')]['length']?_0x38ddd8['attributes']:_0x74c3ce[_0x7a2d('0x31')];if(!_0x56c824[_0x7a2d('0x33')]['hasOwnProperty'](_0x7a2d('0x39'))){_0x38ddd8[_0x7a2d('0x20')]=qs['limit'](_0x56c824[_0x7a2d('0x33')]['limit']);_0x38ddd8['offset']=qs[_0x7a2d('0x1f')](_0x56c824['query'][_0x7a2d('0x1f')]);}_0x38ddd8[_0x7a2d('0x3a')]=qs[_0x7a2d('0x3b')](_0x56c824[_0x7a2d('0x33')][_0x7a2d('0x3b')]);_0x38ddd8[_0x7a2d('0x3c')]=qs['filters'](_[_0x7a2d('0x3d')](_0x56c824[_0x7a2d('0x33')],_0x74c3ce[_0x7a2d('0x35')]),_0x5682ec);if(_0x56c824['query'][_0x7a2d('0x3e')]){_0x38ddd8['where']=_[_0x7a2d('0x3f')](_0x38ddd8[_0x7a2d('0x3c')],{'$or':_['map'](_0x5682ec,function(_0x3f1a96){if(_0x3f1a96['type']!=='VIRTUAL'){var _0x1f251={};_0x1f251[_0x3f1a96[_0x7a2d('0x2a')]]={'$like':'%'+_0x56c824[_0x7a2d('0x33')]['filter']+'%'};return _0x1f251;}})});}_0x38ddd8=_[_0x7a2d('0x3f')]({},_0x38ddd8,_0x56c824[_0x7a2d('0x40')]);var _0x5dd237={'where':_0x38ddd8['where']};return db[_0x7a2d('0x41')][_0x7a2d('0x1e')](_0x5dd237)[_0x7a2d('0x25')](function(_0x28f26f){_0x4e580c[_0x7a2d('0x1e')]=_0x28f26f;if(_0x56c824[_0x7a2d('0x33')][_0x7a2d('0x42')]){_0x38ddd8[_0x7a2d('0x43')]=[{'all':!![]}];}return db[_0x7a2d('0x41')]['findAll'](_0x38ddd8);})[_0x7a2d('0x25')](function(_0x33980b){_0x4e580c['rows']=_0x33980b;return _0x4e580c;})[_0x7a2d('0x25')](respondWithFilteredResult(_0x191bf2,_0x38ddd8))['catch'](handleError(_0x191bf2,null));};exports[_0x7a2d('0x44')]=function(_0x235b2c,_0x59d213){var _0x5092fb={'raw':!![],'where':{'id':_0x235b2c['params']['id']}},_0xd5d77e={};_0xd5d77e[_0x7a2d('0x31')]=_[_0x7a2d('0x34')](db[_0x7a2d('0x41')][_0x7a2d('0x2d')]);_0xd5d77e['query']=_[_0x7a2d('0x34')](_0x235b2c[_0x7a2d('0x33')]);_0xd5d77e[_0x7a2d('0x35')]=_['intersection'](_0xd5d77e['model'],_0xd5d77e[_0x7a2d('0x33')]);_0x5092fb[_0x7a2d('0x37')]=_[_0x7a2d('0x36')](_0xd5d77e[_0x7a2d('0x31')],qs[_0x7a2d('0x38')](_0x235b2c['query'][_0x7a2d('0x38')]));_0x5092fb[_0x7a2d('0x37')]=_0x5092fb[_0x7a2d('0x37')][_0x7a2d('0x45')]?_0x5092fb[_0x7a2d('0x37')]:_0xd5d77e[_0x7a2d('0x31')];if(_0x235b2c['query']['includeAll']){_0x5092fb[_0x7a2d('0x43')]=[{'all':!![]}];}_0x5092fb=_['merge']({},_0x5092fb,_0x235b2c['options']);return db[_0x7a2d('0x41')]['find'](_0x5092fb)[_0x7a2d('0x25')](handleEntityNotFound(_0x59d213,null))[_0x7a2d('0x25')](respondWithResult(_0x59d213,null))['catch'](handleError(_0x59d213,null));};exports[_0x7a2d('0x46')]=function(_0x4902b1,_0x5b9dde){return db[_0x7a2d('0x41')]['create'](_0x4902b1[_0x7a2d('0x47')],{})[_0x7a2d('0x25')](function(_0x1ed069){var _0x12ed6f=_0x4902b1[_0x7a2d('0x48')][_0x7a2d('0x26')]({'plain':!![]});if(!_0x12ed6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ed6f[_0x7a2d('0x49')]===_0x7a2d('0x48')){var _0x53c539=_0x1ed069[_0x7a2d('0x26')]({'plain':!![]});var _0x590cb9=_0x7a2d('0x27');return db['UserProfileSection'][_0x7a2d('0x4a')]({'where':{'name':_0x590cb9,'userProfileId':_0x12ed6f[_0x7a2d('0x4b')]},'raw':!![]})['then'](function(_0x54bfd5){if(_0x54bfd5&&_0x54bfd5['autoAssociation']===0x0){return db[_0x7a2d('0x28')]['create']({'name':_0x53c539[_0x7a2d('0x2a')],'resourceId':_0x53c539['id'],'type':_0x54bfd5['name'],'sectionId':_0x54bfd5['id']},{})[_0x7a2d('0x25')](function(){return _0x1ed069;});}else{return _0x1ed069;}})[_0x7a2d('0x4c')](function(_0x462d8f){logger[_0x7a2d('0x4d')](_0x7a2d('0x4e'),_0x462d8f);throw _0x462d8f;});}return _0x1ed069;})[_0x7a2d('0x25')](respondWithResult(_0x5b9dde,0xc9))[_0x7a2d('0x4c')](handleError(_0x5b9dde,null));};exports[_0x7a2d('0x23')]=function(_0x93e951,_0x457f1b){if(_0x93e951[_0x7a2d('0x47')]['id']){delete _0x93e951['body']['id'];}return db[_0x7a2d('0x41')]['find']({'where':{'id':_0x93e951[_0x7a2d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x457f1b,null))['then'](saveUpdates(_0x93e951[_0x7a2d('0x47')],null))[_0x7a2d('0x25')](respondWithResult(_0x457f1b,null))[_0x7a2d('0x4c')](handleError(_0x457f1b,null));};exports[_0x7a2d('0x24')]=function(_0x11468c,_0x342055){return db[_0x7a2d('0x41')][_0x7a2d('0x4a')]({'where':{'id':_0x11468c[_0x7a2d('0x4f')]['id']}})[_0x7a2d('0x25')](handleEntityNotFound(_0x342055,null))[_0x7a2d('0x25')](removeEntity(_0x342055,null))[_0x7a2d('0x4c')](handleError(_0x342055,null));}; \ No newline at end of file +var _0xbff8=['error','stack','name','send','map','Tag','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','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','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Tags','UserProfileResource'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbff8,0xd2));var _0x8bff=function(_0x4741f2,_0x2f3009){_0x4741f2=_0x4741f2-0x0;var _0x198250=_0xbff8[_0x4741f2];return _0x198250;};'use strict';var pdf=require(_0x8bff('0x0'));var emlformat=require(_0x8bff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8bff('0x2'));var jsonpatch=require(_0x8bff('0x3'));var rp=require(_0x8bff('0x4'));var moment=require(_0x8bff('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bff('0x6'));var util=require('util');var path=require(_0x8bff('0x7'));var sox=require(_0x8bff('0x8'));var csv=require(_0x8bff('0x9'));var ejs=require(_0x8bff('0xa'));var fs=require('fs');var _=require(_0x8bff('0xb'));var squel=require('squel');var crypto=require(_0x8bff('0xc'));var jsforce=require(_0x8bff('0xd'));var deskjs=require(_0x8bff('0xe'));var toCsv=require(_0x8bff('0x9'));var querystring=require(_0x8bff('0xf'));var Papa=require(_0x8bff('0x10'));var Redis=require(_0x8bff('0x11'));var authService=require(_0x8bff('0x12'));var qs=require(_0x8bff('0x13'));var as=require(_0x8bff('0x14'));var hardwareService=require(_0x8bff('0x15'));var logger=require(_0x8bff('0x16'))('api');var utils=require(_0x8bff('0x17'));var config=require(_0x8bff('0x18'));var db=require(_0x8bff('0x19'))['db'];function respondWithStatusCode(_0x54795e,_0x4453bc){_0x4453bc=_0x4453bc||0xcc;return function(_0x5eff4a){if(_0x5eff4a){return _0x54795e[_0x8bff('0x1a')](_0x4453bc);}return _0x54795e[_0x8bff('0x1b')](_0x4453bc)[_0x8bff('0x1c')]();};}function respondWithResult(_0x5232e5,_0x6e7e39){_0x6e7e39=_0x6e7e39||0xc8;return function(_0xa3b520){if(_0xa3b520){return _0x5232e5[_0x8bff('0x1b')](_0x6e7e39)[_0x8bff('0x1d')](_0xa3b520);}};}function respondWithFilteredResult(_0x8d4147,_0x37fc62){return function(_0x3bbad8){if(_0x3bbad8){var _0x279146=_0x3bbad8['count'],_0x5e447e=_0x37fc62['offset'],_0x35066f=_0x37fc62[_0x8bff('0x1e')]+_0x37fc62[_0x8bff('0x1f')],_0x515964;if(_0x35066f>=_0x279146){_0x35066f=_0x279146;_0x515964=0xc8;}else{_0x515964=0xce;}_0x8d4147['status'](_0x515964);return _0x8d4147[_0x8bff('0x20')](_0x8bff('0x21'),_0x5e447e+'-'+_0x35066f+'/'+_0x279146)[_0x8bff('0x1d')](_0x3bbad8);}return null;};}function patchUpdates(_0x1fe596){return function(_0x2a40f9){try{jsonpatch[_0x8bff('0x22')](_0x2a40f9,_0x1fe596,!![]);}catch(_0x476142){return BPromise['reject'](_0x476142);}return _0x2a40f9[_0x8bff('0x23')]();};}function saveUpdates(_0x5cbc17,_0x1ab607){return function(_0x4985f5){if(_0x4985f5){return _0x4985f5[_0x8bff('0x24')](_0x5cbc17)[_0x8bff('0x25')](function(_0x3c793c){return _0x3c793c;});}return null;};}function removeEntity(_0x384eb8,_0x342acb){return function(_0x5bfacb){if(_0x5bfacb){return _0x5bfacb[_0x8bff('0x26')]()[_0x8bff('0x25')](function(){var _0x317cbf=_0x5bfacb[_0x8bff('0x27')]({'plain':!![]});var _0x3eae82=_0x8bff('0x28');return db[_0x8bff('0x29')]['destroy']({'where':{'type':_0x3eae82,'resourceId':_0x317cbf['id']}})[_0x8bff('0x25')](function(){return _0x5bfacb;});})[_0x8bff('0x25')](function(){_0x384eb8[_0x8bff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64cec0,_0x1dc807){return function(_0x2296da){if(!_0x2296da){_0x64cec0[_0x8bff('0x1a')](0x194);}return _0x2296da;};}function handleError(_0x2b57bc,_0x781b37){_0x781b37=_0x781b37||0x1f4;return function(_0x483f21){logger[_0x8bff('0x2a')](_0x483f21[_0x8bff('0x2b')]);if(_0x483f21['name']){delete _0x483f21[_0x8bff('0x2c')];}_0x2b57bc[_0x8bff('0x1b')](_0x781b37)[_0x8bff('0x2d')](_0x483f21);};}exports['index']=function(_0x57c9ca,_0x7d95fd){var _0x247ebc={},_0x27eae8={},_0x33617c={'count':0x0,'rows':[]};var _0x435736=_[_0x8bff('0x2e')](db[_0x8bff('0x2f')]['rawAttributes'],function(_0x4830fb){return{'name':_0x4830fb[_0x8bff('0x30')],'type':_0x4830fb[_0x8bff('0x31')]['key']};});_0x27eae8[_0x8bff('0x32')]=_[_0x8bff('0x2e')](_0x435736,_0x8bff('0x2c'));_0x27eae8[_0x8bff('0x33')]=_[_0x8bff('0x34')](_0x57c9ca[_0x8bff('0x33')]);_0x27eae8[_0x8bff('0x35')]=_[_0x8bff('0x36')](_0x27eae8[_0x8bff('0x32')],_0x27eae8['query']);_0x247ebc['attributes']=_['intersection'](_0x27eae8[_0x8bff('0x32')],qs[_0x8bff('0x37')](_0x57c9ca[_0x8bff('0x33')][_0x8bff('0x37')]));_0x247ebc[_0x8bff('0x38')]=_0x247ebc[_0x8bff('0x38')][_0x8bff('0x39')]?_0x247ebc[_0x8bff('0x38')]:_0x27eae8[_0x8bff('0x32')];if(!_0x57c9ca['query'][_0x8bff('0x3a')](_0x8bff('0x3b'))){_0x247ebc[_0x8bff('0x1f')]=qs[_0x8bff('0x1f')](_0x57c9ca[_0x8bff('0x33')]['limit']);_0x247ebc[_0x8bff('0x1e')]=qs[_0x8bff('0x1e')](_0x57c9ca['query'][_0x8bff('0x1e')]);}_0x247ebc[_0x8bff('0x3c')]=qs['sort'](_0x57c9ca['query']['sort']);_0x247ebc[_0x8bff('0x3d')]=qs[_0x8bff('0x35')](_[_0x8bff('0x3e')](_0x57c9ca[_0x8bff('0x33')],_0x27eae8['filters']),_0x435736);if(_0x57c9ca[_0x8bff('0x33')][_0x8bff('0x3f')]){_0x247ebc[_0x8bff('0x3d')]=_[_0x8bff('0x40')](_0x247ebc[_0x8bff('0x3d')],{'$or':_[_0x8bff('0x2e')](_0x435736,function(_0x2cbe77){if(_0x2cbe77[_0x8bff('0x31')]!==_0x8bff('0x41')){var _0x300a88={};_0x300a88[_0x2cbe77[_0x8bff('0x2c')]]={'$like':'%'+_0x57c9ca[_0x8bff('0x33')][_0x8bff('0x3f')]+'%'};return _0x300a88;}})});}_0x247ebc=_[_0x8bff('0x40')]({},_0x247ebc,_0x57c9ca[_0x8bff('0x42')]);var _0x53c29a={'where':_0x247ebc['where']};return db[_0x8bff('0x2f')][_0x8bff('0x43')](_0x53c29a)[_0x8bff('0x25')](function(_0x1d07be){_0x33617c[_0x8bff('0x43')]=_0x1d07be;if(_0x57c9ca[_0x8bff('0x33')][_0x8bff('0x44')]){_0x247ebc[_0x8bff('0x45')]=[{'all':!![]}];}return db[_0x8bff('0x2f')][_0x8bff('0x46')](_0x247ebc);})[_0x8bff('0x25')](function(_0x2559fa){_0x33617c[_0x8bff('0x47')]=_0x2559fa;return _0x33617c;})[_0x8bff('0x25')](respondWithFilteredResult(_0x7d95fd,_0x247ebc))['catch'](handleError(_0x7d95fd,null));};exports['show']=function(_0x577fc5,_0x3c7967){var _0x89fef0={'raw':!![],'where':{'id':_0x577fc5[_0x8bff('0x48')]['id']}},_0x53607c={};_0x53607c[_0x8bff('0x32')]=_[_0x8bff('0x34')](db[_0x8bff('0x2f')][_0x8bff('0x49')]);_0x53607c[_0x8bff('0x33')]=_[_0x8bff('0x34')](_0x577fc5['query']);_0x53607c['filters']=_[_0x8bff('0x36')](_0x53607c['model'],_0x53607c[_0x8bff('0x33')]);_0x89fef0['attributes']=_[_0x8bff('0x36')](_0x53607c[_0x8bff('0x32')],qs[_0x8bff('0x37')](_0x577fc5[_0x8bff('0x33')][_0x8bff('0x37')]));_0x89fef0[_0x8bff('0x38')]=_0x89fef0[_0x8bff('0x38')][_0x8bff('0x39')]?_0x89fef0[_0x8bff('0x38')]:_0x53607c[_0x8bff('0x32')];if(_0x577fc5[_0x8bff('0x33')][_0x8bff('0x44')]){_0x89fef0['include']=[{'all':!![]}];}_0x89fef0=_['merge']({},_0x89fef0,_0x577fc5[_0x8bff('0x42')]);return db['Tag'][_0x8bff('0x4a')](_0x89fef0)['then'](handleEntityNotFound(_0x3c7967,null))[_0x8bff('0x25')](respondWithResult(_0x3c7967,null))[_0x8bff('0x4b')](handleError(_0x3c7967,null));};exports[_0x8bff('0x4c')]=function(_0x5cdb26,_0x268ff0){return db[_0x8bff('0x2f')][_0x8bff('0x4c')](_0x5cdb26['body'],{})['then'](function(_0x1938b3){var _0x554805=_0x5cdb26['user'][_0x8bff('0x27')]({'plain':!![]});if(!_0x554805)throw new Error(_0x8bff('0x4d'));if(_0x554805[_0x8bff('0x4e')]==='user'){var _0x4682d8=_0x1938b3['get']({'plain':!![]});var _0x28f49e='Tags';return db[_0x8bff('0x4f')][_0x8bff('0x4a')]({'where':{'name':_0x28f49e,'userProfileId':_0x554805[_0x8bff('0x50')]},'raw':!![]})[_0x8bff('0x25')](function(_0xda1907){if(_0xda1907&&_0xda1907[_0x8bff('0x51')]===0x0){return db['UserProfileResource'][_0x8bff('0x4c')]({'name':_0x4682d8[_0x8bff('0x2c')],'resourceId':_0x4682d8['id'],'type':_0xda1907[_0x8bff('0x2c')],'sectionId':_0xda1907['id']},{})[_0x8bff('0x25')](function(){return _0x1938b3;});}else{return _0x1938b3;}})[_0x8bff('0x4b')](function(_0x3cacc3){logger[_0x8bff('0x2a')](_0x8bff('0x52'),_0x3cacc3);throw _0x3cacc3;});}return _0x1938b3;})['then'](respondWithResult(_0x268ff0,0xc9))[_0x8bff('0x4b')](handleError(_0x268ff0,null));};exports[_0x8bff('0x24')]=function(_0x4b8f0d,_0x11213c){if(_0x4b8f0d[_0x8bff('0x53')]['id']){delete _0x4b8f0d[_0x8bff('0x53')]['id'];}return db['Tag']['find']({'where':{'id':_0x4b8f0d[_0x8bff('0x48')]['id']}})[_0x8bff('0x25')](handleEntityNotFound(_0x11213c,null))[_0x8bff('0x25')](saveUpdates(_0x4b8f0d['body'],null))['then'](respondWithResult(_0x11213c,null))[_0x8bff('0x4b')](handleError(_0x11213c,null));};exports[_0x8bff('0x26')]=function(_0x1f4940,_0x51b850){return db[_0x8bff('0x2f')][_0x8bff('0x4a')]({'where':{'id':_0x1f4940[_0x8bff('0x48')]['id']}})[_0x8bff('0x25')](handleEntityNotFound(_0x51b850,null))['then'](removeEntity(_0x51b850,null))['catch'](handleError(_0x51b850,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6c2bdbc..27769ec 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 _0x6f0b=['exports','define','Tag','tools_tags','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x28a120,_0x6cbdb3){var _0x3454b9=function(_0x466df6){while(--_0x466df6){_0x28a120['push'](_0x28a120['shift']());}};_0x3454b9(++_0x6cbdb3);}(_0x6f0b,0xf4));var _0xb6f0=function(_0x32471c,_0x144995){_0x32471c=_0x32471c-0x0;var _0x396e27=_0x6f0b[_0x32471c];return _0x396e27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6f0('0x0'))(_0xb6f0('0x1'));var moment=require('moment');var BPromise=require(_0xb6f0('0x2'));var rp=require(_0xb6f0('0x3'));var fs=require('fs');var path=require(_0xb6f0('0x4'));var rimraf=require(_0xb6f0('0x5'));var config=require(_0xb6f0('0x6'));var attributes=require(_0xb6f0('0x7'));module[_0xb6f0('0x8')]=function(_0x342039,_0x46e003){return _0x342039[_0xb6f0('0x9')](_0xb6f0('0xa'),attributes,{'tableName':_0xb6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7268=['Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7268,0x146));var _0x8726=function(_0x13b0c6,_0xd4256d){_0x13b0c6=_0x13b0c6-0x0;var _0x9991e=_0x7268[_0x13b0c6];return _0x9991e;};'use strict';var _=require(_0x8726('0x0'));var util=require('util');var logger=require(_0x8726('0x1'))(_0x8726('0x2'));var moment=require(_0x8726('0x3'));var BPromise=require(_0x8726('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8726('0x5'));var rimraf=require(_0x8726('0x6'));var config=require(_0x8726('0x7'));var attributes=require('./tag.attributes');module[_0x8726('0x8')]=function(_0x4afc14,_0x3df09a){return _0x4afc14[_0x8726('0x9')](_0x8726('0xa'),attributes,{'tableName':_0x8726('0xb'),'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 1c05b43..3bb5afa 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 _0x0bb5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4b2fb0,_0x2264f1){var _0x2b6ba7=function(_0x37c1d8){while(--_0x37c1d8){_0x4b2fb0['push'](_0x4b2fb0['shift']());}};_0x2b6ba7(++_0x2264f1);}(_0x0bb5,0x148));var _0x50bb=function(_0x4989d9,_0x4f55ca){_0x4989d9=_0x4989d9-0x0;var _0x2cba4f=_0x0bb5[_0x4989d9];return _0x2cba4f;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});} \ No newline at end of file +var _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd38a4c,_0x10205d){var _0x38c708=function(_0x2bf027){while(--_0x2bf027){_0xd38a4c['push'](_0xd38a4c['shift']());}};_0x38c708(++_0x10205d);}(_0x579c,0xda));var _0xc579=function(_0x469eb9,_0x6c3137){_0x469eb9=_0x469eb9-0x0;var _0x435681=_0x579c[_0x469eb9];return _0x435681;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 13746d8..4f17dc6 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 _0x7db2=['../../config/environment','isAuthenticated','index','get','/:id','show','/:id/queues','/:id/users','getAgents','post','create','addQueues','addAgents','delete','destroy','removeQueues','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1ca29b,_0x3c381e){var _0xb5b716=function(_0x8c7c2e){while(--_0x8c7c2e){_0x1ca29b['push'](_0x1ca29b['shift']());}};_0xb5b716(++_0x3c381e);}(_0x7db2,0x1f1));var _0x27db=function(_0x10f506,_0x2f070a){_0x10f506=_0x10f506-0x0;var _0x3b71ce=_0x7db2[_0x10f506];return _0x3b71ce;};'use strict';var multer=require(_0x27db('0x0'));var util=require('util');var path=require(_0x27db('0x1'));var timeout=require(_0x27db('0x2'));var express=require(_0x27db('0x3'));var router=express[_0x27db('0x4')]();var auth=require(_0x27db('0x5'));var interaction=require(_0x27db('0x6'));var config=require(_0x27db('0x7'));var controller=require('./team.controller');router['get']('/',auth[_0x27db('0x8')](),controller[_0x27db('0x9')]);router[_0x27db('0xa')](_0x27db('0xb'),auth[_0x27db('0x8')](),controller[_0x27db('0xc')]);router[_0x27db('0xa')](_0x27db('0xd'),auth[_0x27db('0x8')](),controller['getQueues']);router[_0x27db('0xa')](_0x27db('0xe'),auth[_0x27db('0x8')](),controller[_0x27db('0xf')]);router[_0x27db('0x10')]('/',auth[_0x27db('0x8')](),controller[_0x27db('0x11')]);router[_0x27db('0x10')]('/:id/queues',auth[_0x27db('0x8')](),controller[_0x27db('0x12')]);router['post'](_0x27db('0xe'),auth[_0x27db('0x8')](),controller[_0x27db('0x13')]);router['put'](_0x27db('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x27db('0x14')](_0x27db('0xb'),auth[_0x27db('0x8')](),controller[_0x27db('0x15')]);router[_0x27db('0x14')](_0x27db('0xd'),auth['isAuthenticated'](),controller[_0x27db('0x16')]);router[_0x27db('0x14')](_0x27db('0xe'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x27db('0x17')]=router; \ No newline at end of file +var _0x7128=['isAuthenticated','show','/:id/queues','getQueues','/:id/users','getAgents','create','post','addAgents','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get'];(function(_0x261ae4,_0x5be223){var _0x4d1c52=function(_0x2dda5b){while(--_0x2dda5b){_0x261ae4['push'](_0x261ae4['shift']());}};_0x4d1c52(++_0x5be223);}(_0x7128,0xaf));var _0x8712=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x7128[_0x2fee96];return _0x2e6ad1;};'use strict';var multer=require(_0x8712('0x0'));var util=require('util');var path=require(_0x8712('0x1'));var timeout=require(_0x8712('0x2'));var express=require('express');var router=express[_0x8712('0x3')]();var auth=require(_0x8712('0x4'));var interaction=require(_0x8712('0x5'));var config=require(_0x8712('0x6'));var controller=require(_0x8712('0x7'));router[_0x8712('0x8')]('/',auth[_0x8712('0x9')](),controller['index']);router['get']('/:id',auth[_0x8712('0x9')](),controller[_0x8712('0xa')]);router['get'](_0x8712('0xb'),auth['isAuthenticated'](),controller[_0x8712('0xc')]);router['get'](_0x8712('0xd'),auth['isAuthenticated'](),controller[_0x8712('0xe')]);router['post']('/',auth[_0x8712('0x9')](),controller[_0x8712('0xf')]);router[_0x8712('0x10')](_0x8712('0xb'),auth[_0x8712('0x9')](),controller['addQueues']);router[_0x8712('0x10')](_0x8712('0xd'),auth[_0x8712('0x9')](),controller[_0x8712('0x11')]);router['put'](_0x8712('0x12'),auth[_0x8712('0x9')](),controller[_0x8712('0x13')]);router[_0x8712('0x14')](_0x8712('0x12'),auth['isAuthenticated'](),controller[_0x8712('0x15')]);router['delete'](_0x8712('0xb'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x8712('0x14')](_0x8712('0xd'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x8712('0x16')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 4c6b176..65becc7 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 _0x11c2=['name','STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x11c2,0x92));var _0x211c=function(_0x3ec901,_0x145af1){_0x3ec901=_0x3ec901-0x0;var _0x4ef1b1=_0x11c2[_0x3ec901];return _0x4ef1b1;};'use strict';var Sequelize=require(_0x211c('0x0'));module[_0x211c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x211c('0x2')},'description':{'type':Sequelize[_0x211c('0x3')]}}; \ No newline at end of file +var _0x6c85=['STRING','name','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6c85,0xec));var _0x56c8=function(_0x4a2c13,_0x2a9b69){_0x4a2c13=_0x4a2c13-0x0;var _0x4c6ea2=_0x6c85[_0x4a2c13];return _0x4c6ea2;};'use strict';var Sequelize=require('sequelize');module[_0x56c8('0x0')]={'name':{'type':Sequelize[_0x56c8('0x1')],'allowNull':![],'unique':_0x56c8('0x2')},'description':{'type':Sequelize[_0x56c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e8393e1..24fad2d 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 _0xaf92=['whatsapp','removeAgents','userTeam:remove','getAgents','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','get','Teams','UserProfileResource','stack','name','send','index','map','Team','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','getQueues','channel','Sequelize','ValidationError','toLowerCase','Queue','pick','capitalize','addQueues','findOne','isValidChannel','Unknown\x20channel','ids','removeQueues','remove','Queues','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','each','User','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','addAgents','omit','emit','voice','sms','fax','openchannel'];(function(_0x2a9a62,_0x219c66){var _0x2f7c75=function(_0x74bb92){while(--_0x74bb92){_0x2a9a62['push'](_0x2a9a62['shift']());}};_0x2f7c75(++_0x219c66);}(_0xaf92,0x185));var _0x2af9=function(_0x8acacc,_0x508a1b){_0x8acacc=_0x8acacc-0x0;var _0x1e6e5d=_0xaf92[_0x8acacc];return _0x1e6e5d;};'use strict';var pdf=require(_0x2af9('0x0'));var emlformat=require(_0x2af9('0x1'));var rimraf=require(_0x2af9('0x2'));var zipdir=require(_0x2af9('0x3'));var jsonpatch=require(_0x2af9('0x4'));var rp=require(_0x2af9('0x5'));var moment=require(_0x2af9('0x6'));var BPromise=require(_0x2af9('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2af9('0x8'));var csv=require(_0x2af9('0x9'));var ejs=require(_0x2af9('0xa'));var fs=require('fs');var _=require(_0x2af9('0xb'));var squel=require(_0x2af9('0xc'));var crypto=require(_0x2af9('0xd'));var jsforce=require(_0x2af9('0xe'));var deskjs=require(_0x2af9('0xf'));var toCsv=require(_0x2af9('0x9'));var querystring=require(_0x2af9('0x10'));var Papa=require(_0x2af9('0x11'));var Redis=require(_0x2af9('0x12'));var authService=require(_0x2af9('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2af9('0x14'));var utils=require(_0x2af9('0x15'));var config=require(_0x2af9('0x16'));var db=require(_0x2af9('0x17'))['db'];config[_0x2af9('0x18')]=_[_0x2af9('0x19')](config[_0x2af9('0x18')],{'host':_0x2af9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2af9('0x1b'))[_0x2af9('0x1c')](socket);function respondWithStatusCode(_0xd1bd3a,_0x4a6c9b){_0x4a6c9b=_0x4a6c9b||0xcc;return function(_0x347f21){if(_0x347f21){return _0xd1bd3a[_0x2af9('0x1d')](_0x4a6c9b);}return _0xd1bd3a[_0x2af9('0x1e')](_0x4a6c9b)[_0x2af9('0x1f')]();};}function respondWithResult(_0x1bf60b,_0x4531b0){_0x4531b0=_0x4531b0||0xc8;return function(_0x8c5061){if(_0x8c5061){return _0x1bf60b[_0x2af9('0x1e')](_0x4531b0)[_0x2af9('0x20')](_0x8c5061);}};}function respondWithFilteredResult(_0x27afcc,_0xe60455){return function(_0x382083){if(_0x382083){var _0x42dca5=_0x382083['count'],_0x20d0dc=_0xe60455[_0x2af9('0x21')],_0x5b9f2d=_0xe60455['offset']+_0xe60455[_0x2af9('0x22')],_0x241bb1;if(_0x5b9f2d>=_0x42dca5){_0x5b9f2d=_0x42dca5;_0x241bb1=0xc8;}else{_0x241bb1=0xce;}_0x27afcc['status'](_0x241bb1);return _0x27afcc['set'](_0x2af9('0x23'),_0x20d0dc+'-'+_0x5b9f2d+'/'+_0x42dca5)['json'](_0x382083);}return null;};}function patchUpdates(_0x57d167){return function(_0x416d6f){try{jsonpatch[_0x2af9('0x24')](_0x416d6f,_0x57d167,!![]);}catch(_0x42de70){return BPromise[_0x2af9('0x25')](_0x42de70);}return _0x416d6f['save']();};}function saveUpdates(_0x35b473,_0x290a7c){return function(_0x3f4db3){if(_0x3f4db3){return _0x3f4db3[_0x2af9('0x26')](_0x35b473)[_0x2af9('0x27')](function(_0x40506e){return _0x40506e;});}return null;};}function removeEntity(_0x1bfcf5,_0x58170e){return function(_0x54b119){if(_0x54b119){return _0x54b119[_0x2af9('0x28')]()[_0x2af9('0x27')](function(){var _0x6bbf68=_0x54b119[_0x2af9('0x29')]({'plain':!![]});var _0x43dd38=_0x2af9('0x2a');return db[_0x2af9('0x2b')][_0x2af9('0x28')]({'where':{'type':_0x43dd38,'resourceId':_0x6bbf68['id']}})[_0x2af9('0x27')](function(){return _0x54b119;});})[_0x2af9('0x27')](function(){_0x1bfcf5[_0x2af9('0x1e')](0xcc)[_0x2af9('0x1f')]();});}};}function handleEntityNotFound(_0x414a63,_0x2669ea){return function(_0x514a11){if(!_0x514a11){_0x414a63[_0x2af9('0x1d')](0x194);}return _0x514a11;};}function handleError(_0x425097,_0x2ca2f5){_0x2ca2f5=_0x2ca2f5||0x1f4;return function(_0x3b76e6){logger['error'](_0x3b76e6[_0x2af9('0x2c')]);if(_0x3b76e6[_0x2af9('0x2d')]){delete _0x3b76e6[_0x2af9('0x2d')];}_0x425097[_0x2af9('0x1e')](_0x2ca2f5)[_0x2af9('0x2e')](_0x3b76e6);};}exports[_0x2af9('0x2f')]=function(_0x314f1b,_0x1f72bd){var _0x46beee={},_0x184adf={},_0x2a2de7={'count':0x0,'rows':[]};var _0x13c97f=_[_0x2af9('0x30')](db[_0x2af9('0x31')][_0x2af9('0x32')],function(_0x28cca5){return{'name':_0x28cca5['fieldName'],'type':_0x28cca5[_0x2af9('0x33')][_0x2af9('0x34')]};});_0x184adf[_0x2af9('0x35')]=_[_0x2af9('0x30')](_0x13c97f,_0x2af9('0x2d'));_0x184adf['query']=_['keys'](_0x314f1b[_0x2af9('0x36')]);_0x184adf['filters']=_[_0x2af9('0x37')](_0x184adf[_0x2af9('0x35')],_0x184adf[_0x2af9('0x36')]);_0x46beee[_0x2af9('0x38')]=_[_0x2af9('0x37')](_0x184adf[_0x2af9('0x35')],qs[_0x2af9('0x39')](_0x314f1b[_0x2af9('0x36')]['fields']));_0x46beee['attributes']=_0x46beee[_0x2af9('0x38')][_0x2af9('0x3a')]?_0x46beee['attributes']:_0x184adf['model'];if(!_0x314f1b[_0x2af9('0x36')]['hasOwnProperty'](_0x2af9('0x3b'))){_0x46beee['limit']=qs[_0x2af9('0x22')](_0x314f1b[_0x2af9('0x36')]['limit']);_0x46beee['offset']=qs[_0x2af9('0x21')](_0x314f1b['query']['offset']);}_0x46beee[_0x2af9('0x3c')]=qs[_0x2af9('0x3d')](_0x314f1b[_0x2af9('0x36')][_0x2af9('0x3d')]);_0x46beee['where']=qs['filters'](_['pick'](_0x314f1b[_0x2af9('0x36')],_0x184adf[_0x2af9('0x3e')]),_0x13c97f);if(_0x314f1b[_0x2af9('0x36')][_0x2af9('0x3f')]){_0x46beee[_0x2af9('0x40')]=_[_0x2af9('0x41')](_0x46beee['where'],{'$or':_[_0x2af9('0x30')](_0x13c97f,function(_0x31264f){if(_0x31264f['type']!==_0x2af9('0x42')){var _0x1d5453={};_0x1d5453[_0x31264f[_0x2af9('0x2d')]]={'$like':'%'+_0x314f1b[_0x2af9('0x36')][_0x2af9('0x3f')]+'%'};return _0x1d5453;}})});}_0x46beee=_['merge']({},_0x46beee,_0x314f1b[_0x2af9('0x43')]);var _0x253aa4={'where':_0x46beee[_0x2af9('0x40')]};return db[_0x2af9('0x31')][_0x2af9('0x44')](_0x253aa4)[_0x2af9('0x27')](function(_0x24b848){_0x2a2de7[_0x2af9('0x44')]=_0x24b848;if(_0x314f1b['query'][_0x2af9('0x45')]){_0x46beee['include']=[{'all':!![]}];}return db[_0x2af9('0x31')][_0x2af9('0x46')](_0x46beee);})[_0x2af9('0x27')](function(_0x5a4653){_0x2a2de7[_0x2af9('0x47')]=_0x5a4653;return _0x2a2de7;})[_0x2af9('0x27')](respondWithFilteredResult(_0x1f72bd,_0x46beee))[_0x2af9('0x48')](handleError(_0x1f72bd,null));};exports['show']=function(_0x12a4bc,_0x33a78b){var _0x5a27e6={'raw':![],'where':{'id':_0x12a4bc[_0x2af9('0x49')]['id']}},_0x40d839={};_0x40d839[_0x2af9('0x35')]=_[_0x2af9('0x4a')](db[_0x2af9('0x31')][_0x2af9('0x32')]);_0x40d839['query']=_[_0x2af9('0x4a')](_0x12a4bc[_0x2af9('0x36')]);_0x40d839[_0x2af9('0x3e')]=_['intersection'](_0x40d839['model'],_0x40d839[_0x2af9('0x36')]);_0x5a27e6[_0x2af9('0x38')]=_['intersection'](_0x40d839[_0x2af9('0x35')],qs['fields'](_0x12a4bc[_0x2af9('0x36')][_0x2af9('0x39')]));_0x5a27e6[_0x2af9('0x38')]=_0x5a27e6['attributes'][_0x2af9('0x3a')]?_0x5a27e6['attributes']:_0x40d839[_0x2af9('0x35')];if(_0x12a4bc[_0x2af9('0x36')][_0x2af9('0x45')]){_0x5a27e6['include']=[{'all':!![]}];}_0x5a27e6=_['merge']({},_0x5a27e6,_0x12a4bc[_0x2af9('0x43')]);return db[_0x2af9('0x31')][_0x2af9('0x4b')](_0x5a27e6)[_0x2af9('0x27')](handleEntityNotFound(_0x33a78b,null))[_0x2af9('0x27')](respondWithResult(_0x33a78b,null))['catch'](handleError(_0x33a78b,null));};exports[_0x2af9('0x4c')]=function(_0x6b2b89,_0x843986){return db[_0x2af9('0x31')]['create'](_0x6b2b89[_0x2af9('0x4d')],{})['then'](function(_0x4916ae){var _0x3f49d9=_0x6b2b89[_0x2af9('0x4e')][_0x2af9('0x29')]({'plain':!![]});if(!_0x3f49d9)throw new Error(_0x2af9('0x4f'));if(_0x3f49d9[_0x2af9('0x50')]===_0x2af9('0x4e')){var _0x1a2f2e=_0x4916ae[_0x2af9('0x29')]({'plain':!![]});var _0x3d795e='Teams';return db['UserProfileSection'][_0x2af9('0x4b')]({'where':{'name':_0x3d795e,'userProfileId':_0x3f49d9[_0x2af9('0x51')]},'raw':!![]})[_0x2af9('0x27')](function(_0x5e184f){if(_0x5e184f&&_0x5e184f[_0x2af9('0x52')]===0x0){return db[_0x2af9('0x2b')][_0x2af9('0x4c')]({'name':_0x1a2f2e[_0x2af9('0x2d')],'resourceId':_0x1a2f2e['id'],'type':_0x5e184f['name'],'sectionId':_0x5e184f['id']},{})['then'](function(){return _0x4916ae;});}else{return _0x4916ae;}})[_0x2af9('0x48')](function(_0x239110){logger[_0x2af9('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x239110);throw _0x239110;});}return _0x4916ae;})[_0x2af9('0x27')](respondWithResult(_0x843986,0xc9))[_0x2af9('0x48')](handleError(_0x843986,null));};exports[_0x2af9('0x26')]=function(_0x33c9f7,_0x159a21){if(_0x33c9f7['body']['id']){delete _0x33c9f7[_0x2af9('0x4d')]['id'];}return db[_0x2af9('0x31')]['find']({'where':{'id':_0x33c9f7[_0x2af9('0x49')]['id']}})['then'](handleEntityNotFound(_0x159a21,null))[_0x2af9('0x27')](saveUpdates(_0x33c9f7[_0x2af9('0x4d')],null))[_0x2af9('0x27')](respondWithResult(_0x159a21,null))['catch'](handleError(_0x159a21,null));};exports[_0x2af9('0x28')]=function(_0x455f3a,_0x14e002){return db[_0x2af9('0x31')][_0x2af9('0x4b')]({'where':{'id':_0x455f3a[_0x2af9('0x49')]['id']}})[_0x2af9('0x27')](handleEntityNotFound(_0x14e002,null))['then'](removeEntity(_0x14e002,null))[_0x2af9('0x48')](handleError(_0x14e002,null));};exports[_0x2af9('0x54')]=function(_0x5a84fb,_0x18c28a,_0x59d349){return db['Team']['findOne']({'where':{'id':_0x5a84fb[_0x2af9('0x49')]['id']}})['then'](handleEntityNotFound(_0x18c28a,null))[_0x2af9('0x27')](function(_0x268798){if(!_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x55')]||!utils['isValidChannel'](_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x55')])){throw new db[(_0x2af9('0x56'))][(_0x2af9('0x57'))]('Unknown\x20channel');}var _0x2ce39d={};var _0x1bf149={};_0x1bf149[_0x2af9('0x35')]=_[_0x2af9('0x4a')](db[_['capitalize'](_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x55')][_0x2af9('0x58')]())+_0x2af9('0x59')][_0x2af9('0x32')]);_0x1bf149['query']=_[_0x2af9('0x4a')](_0x5a84fb[_0x2af9('0x36')]);_0x1bf149['filters']=_['intersection'](_0x1bf149['model'],_0x1bf149[_0x2af9('0x36')]);_0x2ce39d['attributes']=_['intersection'](_0x1bf149[_0x2af9('0x35')],qs['fields'](_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x39')]));_0x2ce39d[_0x2af9('0x38')]=_0x2ce39d[_0x2af9('0x38')][_0x2af9('0x3a')]?_0x2ce39d[_0x2af9('0x38')]:_0x1bf149[_0x2af9('0x35')];_0x2ce39d[_0x2af9('0x22')]=qs[_0x2af9('0x22')](_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x22')]);_0x2ce39d[_0x2af9('0x21')]=qs['offset'](_0x5a84fb[_0x2af9('0x36')][_0x2af9('0x21')]);_0x2ce39d['order']=qs[_0x2af9('0x3d')](_0x5a84fb['query'][_0x2af9('0x3d')]);_0x2ce39d[_0x2af9('0x40')]=qs[_0x2af9('0x3e')](_[_0x2af9('0x5a')](_0x5a84fb[_0x2af9('0x36')],_0x1bf149[_0x2af9('0x3e')]));_0x2ce39d=_['merge']({},_0x2ce39d,_0x5a84fb[_0x2af9('0x43')]);return _0x268798[_0x2af9('0x29')+_[_0x2af9('0x5b')](_0x5a84fb['query'][_0x2af9('0x55')][_0x2af9('0x58')]())+'Queues'](_0x2ce39d);})[_0x2af9('0x27')](respondWithResult(_0x18c28a,null))[_0x2af9('0x48')](handleError(_0x18c28a,null));};exports[_0x2af9('0x5c')]=function(_0x49d427,_0x339d62,_0x654d7a){return db[_0x2af9('0x31')][_0x2af9('0x5d')]({'where':{'id':_0x49d427[_0x2af9('0x49')]['id']}})[_0x2af9('0x27')](function(_0x459887){if(_0x459887){if(!_0x49d427[_0x2af9('0x4d')][_0x2af9('0x55')]||!utils[_0x2af9('0x5e')](_0x49d427[_0x2af9('0x4d')][_0x2af9('0x55')])){throw new db[(_0x2af9('0x56'))][(_0x2af9('0x57'))](_0x2af9('0x5f'));}return _0x459887['add'+_[_0x2af9('0x5b')](_0x49d427['body'][_0x2af9('0x55')][_0x2af9('0x58')]())+'Queues'](_0x49d427['body'][_0x2af9('0x60')]);}return null;})[_0x2af9('0x27')](handleEntityNotFound(_0x339d62,null))['then'](respondWithStatusCode(_0x339d62,null))[_0x2af9('0x48')](handleError(_0x339d62,null));};exports[_0x2af9('0x61')]=function(_0x19e38e,_0x4602a8,_0x208e5a){return db['Team']['findOne']({'where':{'id':_0x19e38e[_0x2af9('0x49')]['id']}})[_0x2af9('0x27')](function(_0xb5648d){if(_0xb5648d){if(!_0x19e38e[_0x2af9('0x36')][_0x2af9('0x55')]||!utils['isValidChannel'](_0x19e38e[_0x2af9('0x36')][_0x2af9('0x55')])){throw new db['Sequelize'][(_0x2af9('0x57'))]('Unknown\x20channel');}return _0xb5648d[_0x2af9('0x62')+_[_0x2af9('0x5b')](_0x19e38e[_0x2af9('0x36')][_0x2af9('0x55')][_0x2af9('0x58')]())+_0x2af9('0x63')](_0x19e38e['query'][_0x2af9('0x60')]);}return null;})['then'](handleEntityNotFound(_0x4602a8,null))[_0x2af9('0x27')](respondWithStatusCode(_0x4602a8,null))[_0x2af9('0x48')](handleError(_0x4602a8,null));};exports['addAgents']=function(_0xa7ba2f,_0x3d9c64,_0x15eb20){return db[_0x2af9('0x31')][_0x2af9('0x4b')]({'where':{'id':_0xa7ba2f['params']['id']}})['then'](handleEntityNotFound(_0x3d9c64,null))[_0x2af9('0x27')](function(_0x11d936){if(_0x11d936){var _0x3e9964=[_0x2af9('0x64'),_0x2af9('0x65'),_0x2af9('0x66'),_0x2af9('0x67'),_0x2af9('0x68'),_0x2af9('0x69'),_0x2af9('0x6a')];return BPromise['each'](_0x3e9964,function(_0x21f7fb){return _0x11d936[_0x2af9('0x29')+_0x21f7fb+_0x2af9('0x63')]({'attributes':['id',_0x2af9('0x2d')]})['then'](function(_0x4f1a9f){return BPromise[_0x2af9('0x6b')](_0x4f1a9f,function(_0x37b58d){return _0x37b58d['addAgents'](_0xa7ba2f[_0x2af9('0x4d')]['ids'])[_0x2af9('0x27')](function(){if(_0x21f7fb==='Voice'){return db[_0x2af9('0x6c')][_0x2af9('0x46')]({'where':{'id':_0xa7ba2f['body'][_0x2af9('0x60')]},'attributes':['id',_0x2af9('0x2d'),'online','voicePause',_0x2af9('0x6d')],'raw':!![]})[_0x2af9('0x27')](function(_0x975acb){return BPromise[_0x2af9('0x6b')](_['filter'](_0x975acb,{'online':0x1}),function(_0x4f8ed1){return db[_0x2af9('0x6e')][_0x2af9('0x6f')]({'membername':_0x4f8ed1[_0x2af9('0x2d')],'UserId':_0x4f8ed1['id'],'queue_name':_0x37b58d['name'],'VoiceQueueId':_0x37b58d['id'],'interface':_[_0x2af9('0x70')](_0x4f8ed1[_0x2af9('0x6d')])?util[_0x2af9('0x71')](_0x2af9('0x72'),_0x4f8ed1['name']):_0x4f8ed1[_0x2af9('0x6d')],'paused':_0x4f8ed1[_0x2af9('0x73')]||![],'penalty':0x0});});});}});});})[_0x2af9('0x27')](function(){return _0x11d936;});})['then'](function(){return _0x11d936;});}})['then'](function(_0x599796){if(_0x599796){return _0x599796[_0x2af9('0x74')](_0xa7ba2f['body'][_0x2af9('0x60')],_[_0x2af9('0x75')](_0xa7ba2f[_0x2af9('0x4d')],[_0x2af9('0x60'),'id'])||{})['spread'](function(_0x828d56){for(var _0xbd4d02=0x0;_0xbd4d02<_0xa7ba2f[_0x2af9('0x4d')][_0x2af9('0x60')]['length'];_0xbd4d02+=0x1){socket[_0x2af9('0x76')]('userTeam:save',{'UserId':_0xa7ba2f[_0x2af9('0x4d')][_0x2af9('0x60')][_0xbd4d02],'TeamId':_0xa7ba2f[_0x2af9('0x49')]['id']});}return _0x828d56;});}})[_0x2af9('0x27')](respondWithResult(_0x3d9c64,null))[_0x2af9('0x48')](handleError(_0x3d9c64,null));};exports['removeAgents']=function(_0x422c21,_0x3c5ef4,_0x17a731){return db[_0x2af9('0x31')][_0x2af9('0x4b')]({'where':{'id':_0x422c21['params']['id']}})['then'](handleEntityNotFound(_0x3c5ef4,null))[_0x2af9('0x27')](function(_0x1d63b4){if(_0x1d63b4){return BPromise[_0x2af9('0x6b')]([_0x2af9('0x77'),'chat','mail',_0x2af9('0x78'),_0x2af9('0x79'),_0x2af9('0x7a'),_0x2af9('0x7b')],function(_0x2f1589){return _0x1d63b4['get'+_[_0x2af9('0x5b')](_0x2f1589)+_0x2af9('0x63')]({'attributes':['id',_0x2af9('0x2d')]})[_0x2af9('0x27')](function(_0x3b73a0){return BPromise[_0x2af9('0x6b')](_0x3b73a0,function(_0x59f8d3){return _0x59f8d3[_0x2af9('0x7c')](_0x422c21[_0x2af9('0x36')][_0x2af9('0x60')])[_0x2af9('0x27')](function(){if(_0x2f1589==='voice'){return db['UserVoiceQueueRt'][_0x2af9('0x28')]({'where':{'VoiceQueueId':_0x59f8d3['id'],'UserId':_0x422c21[_0x2af9('0x36')][_0x2af9('0x60')]}});}});});})[_0x2af9('0x27')](function(){return _0x1d63b4;});})['then'](function(){return _0x1d63b4;});}})[_0x2af9('0x27')](function(_0x4fb7d6){if(_0x4fb7d6){return _0x4fb7d6[_0x2af9('0x7c')](_0x422c21[_0x2af9('0x36')][_0x2af9('0x60')])[_0x2af9('0x27')](function(){if(_['isArray'](_0x422c21['query'][_0x2af9('0x60')])){for(var _0x57c5cc=0x0;_0x57c5cc<_0x422c21['query'][_0x2af9('0x60')][_0x2af9('0x3a')];_0x57c5cc+=0x1){socket['emit'](_0x2af9('0x7d'),{'UserId':Number(_0x422c21[_0x2af9('0x36')]['ids'][_0x57c5cc]),'TeamId':Number(_0x422c21[_0x2af9('0x49')]['id'])});}}else{socket[_0x2af9('0x76')](_0x2af9('0x7d'),{'UserId':Number(_0x422c21[_0x2af9('0x36')]['ids']),'TeamId':Number(_0x422c21['params']['id'])});}});}})[_0x2af9('0x27')](respondWithStatusCode(_0x3c5ef4,null))[_0x2af9('0x48')](handleError(_0x3c5ef4,null));};exports['getAgents']=function(_0x567d7d,_0xb84da8,_0x327f6d){var _0x24ad48={};var _0x56a763={};var _0x346fd6;var _0x346a07;return db['Team'][_0x2af9('0x5d')]({'where':{'id':_0x567d7d[_0x2af9('0x49')]['id']}})[_0x2af9('0x27')](handleEntityNotFound(_0xb84da8,null))[_0x2af9('0x27')](function(_0x41ead7){if(_0x41ead7){_0x346fd6=_0x41ead7;_0x56a763[_0x2af9('0x35')]=_['keys'](db[_0x2af9('0x6c')][_0x2af9('0x32')]);_0x56a763[_0x2af9('0x36')]=_[_0x2af9('0x4a')](_0x567d7d[_0x2af9('0x36')]);_0x56a763[_0x2af9('0x3e')]=_[_0x2af9('0x37')](_0x56a763['model'],_0x56a763[_0x2af9('0x36')]);_0x24ad48['attributes']=_[_0x2af9('0x37')](_0x56a763[_0x2af9('0x35')],qs['fields'](_0x567d7d['query'][_0x2af9('0x39')]));_0x24ad48['attributes']=_0x24ad48['attributes'][_0x2af9('0x3a')]?_0x24ad48[_0x2af9('0x38')]:_0x56a763[_0x2af9('0x35')];_0x24ad48[_0x2af9('0x3c')]=qs[_0x2af9('0x3d')](_0x567d7d[_0x2af9('0x36')]['sort']);_0x24ad48[_0x2af9('0x40')]=qs['filters'](_['pick'](_0x567d7d[_0x2af9('0x36')],_0x56a763[_0x2af9('0x3e')]));if(_0x567d7d[_0x2af9('0x36')]['filter']){_0x24ad48['where']=_['merge'](_0x24ad48['where'],{'$or':_[_0x2af9('0x30')](_0x24ad48['attributes'],function(_0x243368){var _0x100294={};_0x100294[_0x243368]={'$like':'%'+_0x567d7d[_0x2af9('0x36')][_0x2af9('0x3f')]+'%'};return _0x100294;})});}_0x24ad48=_[_0x2af9('0x41')]({},_0x24ad48,_0x567d7d[_0x2af9('0x43')]);return _0x346fd6[_0x2af9('0x7e')](_0x24ad48);}})['then'](function(_0x2a15dc){if(_0x2a15dc){_0x346a07=_0x2a15dc['length'];if(!_0x567d7d[_0x2af9('0x36')][_0x2af9('0x7f')](_0x2af9('0x3b'))){_0x24ad48[_0x2af9('0x22')]=qs[_0x2af9('0x22')](_0x567d7d[_0x2af9('0x36')][_0x2af9('0x22')]);_0x24ad48[_0x2af9('0x21')]=qs[_0x2af9('0x21')](_0x567d7d['query'][_0x2af9('0x21')]);}return _0x346fd6[_0x2af9('0x7e')](_0x24ad48);}})[_0x2af9('0x27')](function(_0xcb5d19){if(_0xcb5d19){return _0xcb5d19?{'count':_0x346a07,'rows':_0xcb5d19}:null;}})[_0x2af9('0x27')](respondWithResult(_0xb84da8,null))[_0x2af9('0x48')](handleError(_0xb84da8,null));}; \ No newline at end of file +var _0xe71c=['error','stack','name','send','index','map','Team','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getQueues','findOne','isValidChannel','channel','ValidationError','capitalize','Queue','rawAttributes','options','toLowerCase','addQueues','Unknown\x20channel','ids','Sequelize','remove','Queues','addAgents','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','openchannel','whatsapp','isArray','userTeam:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Teams','UserProfileResource'];(function(_0x3d5395,_0x253bf0){var _0x2cdb6e=function(_0x1bf739){while(--_0x1bf739){_0x3d5395['push'](_0x3d5395['shift']());}};_0x2cdb6e(++_0x253bf0);}(_0xe71c,0x1e1));var _0xce71=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xe71c[_0x3cea78];return _0x33b66b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xce71('0x0'));var rimraf=require(_0xce71('0x1'));var zipdir=require(_0xce71('0x2'));var jsonpatch=require(_0xce71('0x3'));var rp=require(_0xce71('0x4'));var moment=require('moment');var BPromise=require(_0xce71('0x5'));var Mustache=require(_0xce71('0x6'));var util=require(_0xce71('0x7'));var path=require(_0xce71('0x8'));var sox=require(_0xce71('0x9'));var csv=require(_0xce71('0xa'));var ejs=require(_0xce71('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xce71('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xce71('0xa'));var querystring=require(_0xce71('0xd'));var Papa=require('papaparse');var Redis=require(_0xce71('0xe'));var authService=require(_0xce71('0xf'));var qs=require(_0xce71('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce71('0x11'));var logger=require(_0xce71('0x12'))('api');var utils=require(_0xce71('0x13'));var config=require(_0xce71('0x14'));var db=require('../../mysqldb')['db'];config[_0xce71('0x15')]=_[_0xce71('0x16')](config[_0xce71('0x15')],{'host':_0xce71('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xce71('0x18'))[_0xce71('0x19')](socket);function respondWithStatusCode(_0x67dbd9,_0x6a191){_0x6a191=_0x6a191||0xcc;return function(_0x289789){if(_0x289789){return _0x67dbd9[_0xce71('0x1a')](_0x6a191);}return _0x67dbd9[_0xce71('0x1b')](_0x6a191)[_0xce71('0x1c')]();};}function respondWithResult(_0x5a2961,_0x41b512){_0x41b512=_0x41b512||0xc8;return function(_0xb3810e){if(_0xb3810e){return _0x5a2961[_0xce71('0x1b')](_0x41b512)[_0xce71('0x1d')](_0xb3810e);}};}function respondWithFilteredResult(_0x1e9c6d,_0x181f63){return function(_0x138e41){if(_0x138e41){var _0x576ca2=_0x138e41[_0xce71('0x1e')],_0x40e014=_0x181f63[_0xce71('0x1f')],_0x260922=_0x181f63['offset']+_0x181f63[_0xce71('0x20')],_0x50e88a;if(_0x260922>=_0x576ca2){_0x260922=_0x576ca2;_0x50e88a=0xc8;}else{_0x50e88a=0xce;}_0x1e9c6d['status'](_0x50e88a);return _0x1e9c6d[_0xce71('0x21')](_0xce71('0x22'),_0x40e014+'-'+_0x260922+'/'+_0x576ca2)[_0xce71('0x1d')](_0x138e41);}return null;};}function patchUpdates(_0x12cb7b){return function(_0x5cd97b){try{jsonpatch[_0xce71('0x23')](_0x5cd97b,_0x12cb7b,!![]);}catch(_0x363b80){return BPromise['reject'](_0x363b80);}return _0x5cd97b[_0xce71('0x24')]();};}function saveUpdates(_0x4e8bde,_0x565b4b){return function(_0x2a1bf0){if(_0x2a1bf0){return _0x2a1bf0[_0xce71('0x25')](_0x4e8bde)[_0xce71('0x26')](function(_0x3c8484){return _0x3c8484;});}return null;};}function removeEntity(_0x382ff6,_0x46757c){return function(_0x4b4156){if(_0x4b4156){return _0x4b4156[_0xce71('0x27')]()[_0xce71('0x26')](function(){var _0x401086=_0x4b4156[_0xce71('0x28')]({'plain':!![]});var _0x224d97=_0xce71('0x29');return db[_0xce71('0x2a')][_0xce71('0x27')]({'where':{'type':_0x224d97,'resourceId':_0x401086['id']}})[_0xce71('0x26')](function(){return _0x4b4156;});})['then'](function(){_0x382ff6[_0xce71('0x1b')](0xcc)[_0xce71('0x1c')]();});}};}function handleEntityNotFound(_0x2fd35f,_0x28175f){return function(_0x45255d){if(!_0x45255d){_0x2fd35f['sendStatus'](0x194);}return _0x45255d;};}function handleError(_0x30ce33,_0x2218a4){_0x2218a4=_0x2218a4||0x1f4;return function(_0x289514){logger[_0xce71('0x2b')](_0x289514[_0xce71('0x2c')]);if(_0x289514['name']){delete _0x289514[_0xce71('0x2d')];}_0x30ce33[_0xce71('0x1b')](_0x2218a4)[_0xce71('0x2e')](_0x289514);};}exports[_0xce71('0x2f')]=function(_0x459d17,_0x6aa7c6){var _0x3b9461={},_0x43cb4e={},_0x18afe9={'count':0x0,'rows':[]};var _0x3ff5e2=_[_0xce71('0x30')](db[_0xce71('0x31')]['rawAttributes'],function(_0x5b7c56){return{'name':_0x5b7c56['fieldName'],'type':_0x5b7c56[_0xce71('0x32')][_0xce71('0x33')]};});_0x43cb4e[_0xce71('0x34')]=_['map'](_0x3ff5e2,_0xce71('0x2d'));_0x43cb4e[_0xce71('0x35')]=_[_0xce71('0x36')](_0x459d17[_0xce71('0x35')]);_0x43cb4e[_0xce71('0x37')]=_[_0xce71('0x38')](_0x43cb4e[_0xce71('0x34')],_0x43cb4e['query']);_0x3b9461[_0xce71('0x39')]=_[_0xce71('0x38')](_0x43cb4e[_0xce71('0x34')],qs[_0xce71('0x3a')](_0x459d17['query'][_0xce71('0x3a')]));_0x3b9461[_0xce71('0x39')]=_0x3b9461[_0xce71('0x39')]['length']?_0x3b9461[_0xce71('0x39')]:_0x43cb4e[_0xce71('0x34')];if(!_0x459d17['query'][_0xce71('0x3b')](_0xce71('0x3c'))){_0x3b9461['limit']=qs[_0xce71('0x20')](_0x459d17[_0xce71('0x35')][_0xce71('0x20')]);_0x3b9461[_0xce71('0x1f')]=qs[_0xce71('0x1f')](_0x459d17['query'][_0xce71('0x1f')]);}_0x3b9461[_0xce71('0x3d')]=qs['sort'](_0x459d17[_0xce71('0x35')][_0xce71('0x3e')]);_0x3b9461[_0xce71('0x3f')]=qs['filters'](_[_0xce71('0x40')](_0x459d17[_0xce71('0x35')],_0x43cb4e['filters']),_0x3ff5e2);if(_0x459d17[_0xce71('0x35')][_0xce71('0x41')]){_0x3b9461['where']=_[_0xce71('0x42')](_0x3b9461['where'],{'$or':_[_0xce71('0x30')](_0x3ff5e2,function(_0x36ed42){if(_0x36ed42[_0xce71('0x32')]!==_0xce71('0x43')){var _0x10c585={};_0x10c585[_0x36ed42[_0xce71('0x2d')]]={'$like':'%'+_0x459d17['query'][_0xce71('0x41')]+'%'};return _0x10c585;}})});}_0x3b9461=_[_0xce71('0x42')]({},_0x3b9461,_0x459d17['options']);var _0x3e0746={'where':_0x3b9461[_0xce71('0x3f')]};return db[_0xce71('0x31')][_0xce71('0x1e')](_0x3e0746)[_0xce71('0x26')](function(_0x5e4b32){_0x18afe9[_0xce71('0x1e')]=_0x5e4b32;if(_0x459d17[_0xce71('0x35')][_0xce71('0x44')]){_0x3b9461[_0xce71('0x45')]=[{'all':!![]}];}return db[_0xce71('0x31')][_0xce71('0x46')](_0x3b9461);})[_0xce71('0x26')](function(_0x179f83){_0x18afe9[_0xce71('0x47')]=_0x179f83;return _0x18afe9;})[_0xce71('0x26')](respondWithFilteredResult(_0x6aa7c6,_0x3b9461))[_0xce71('0x48')](handleError(_0x6aa7c6,null));};exports[_0xce71('0x49')]=function(_0x31d5f9,_0xf228e){var _0x55ac90={'raw':![],'where':{'id':_0x31d5f9[_0xce71('0x4a')]['id']}},_0x3a0723={};_0x3a0723[_0xce71('0x34')]=_[_0xce71('0x36')](db[_0xce71('0x31')]['rawAttributes']);_0x3a0723[_0xce71('0x35')]=_[_0xce71('0x36')](_0x31d5f9[_0xce71('0x35')]);_0x3a0723[_0xce71('0x37')]=_[_0xce71('0x38')](_0x3a0723[_0xce71('0x34')],_0x3a0723[_0xce71('0x35')]);_0x55ac90[_0xce71('0x39')]=_[_0xce71('0x38')](_0x3a0723[_0xce71('0x34')],qs['fields'](_0x31d5f9[_0xce71('0x35')][_0xce71('0x3a')]));_0x55ac90['attributes']=_0x55ac90['attributes'][_0xce71('0x4b')]?_0x55ac90[_0xce71('0x39')]:_0x3a0723['model'];if(_0x31d5f9['query'][_0xce71('0x44')]){_0x55ac90['include']=[{'all':!![]}];}_0x55ac90=_[_0xce71('0x42')]({},_0x55ac90,_0x31d5f9['options']);return db[_0xce71('0x31')]['find'](_0x55ac90)[_0xce71('0x26')](handleEntityNotFound(_0xf228e,null))[_0xce71('0x26')](respondWithResult(_0xf228e,null))['catch'](handleError(_0xf228e,null));};exports[_0xce71('0x4c')]=function(_0xcce1d7,_0x227eea){return db['Team'][_0xce71('0x4c')](_0xcce1d7[_0xce71('0x4d')],{})[_0xce71('0x26')](function(_0x2c2717){var _0x3c6750=_0xcce1d7[_0xce71('0x4e')][_0xce71('0x28')]({'plain':!![]});if(!_0x3c6750)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c6750[_0xce71('0x4f')]==='user'){var _0x472ff2=_0x2c2717[_0xce71('0x28')]({'plain':!![]});var _0x24da44=_0xce71('0x29');return db[_0xce71('0x50')]['find']({'where':{'name':_0x24da44,'userProfileId':_0x3c6750[_0xce71('0x51')]},'raw':!![]})[_0xce71('0x26')](function(_0x2a7876){if(_0x2a7876&&_0x2a7876[_0xce71('0x52')]===0x0){return db[_0xce71('0x2a')][_0xce71('0x4c')]({'name':_0x472ff2[_0xce71('0x2d')],'resourceId':_0x472ff2['id'],'type':_0x2a7876[_0xce71('0x2d')],'sectionId':_0x2a7876['id']},{})[_0xce71('0x26')](function(){return _0x2c2717;});}else{return _0x2c2717;}})[_0xce71('0x48')](function(_0x4deb71){logger[_0xce71('0x2b')](_0xce71('0x53'),_0x4deb71);throw _0x4deb71;});}return _0x2c2717;})[_0xce71('0x26')](respondWithResult(_0x227eea,0xc9))[_0xce71('0x48')](handleError(_0x227eea,null));};exports[_0xce71('0x25')]=function(_0x10e04c,_0x415e05){if(_0x10e04c[_0xce71('0x4d')]['id']){delete _0x10e04c[_0xce71('0x4d')]['id'];}return db[_0xce71('0x31')][_0xce71('0x54')]({'where':{'id':_0x10e04c[_0xce71('0x4a')]['id']}})['then'](handleEntityNotFound(_0x415e05,null))[_0xce71('0x26')](saveUpdates(_0x10e04c[_0xce71('0x4d')],null))[_0xce71('0x26')](respondWithResult(_0x415e05,null))['catch'](handleError(_0x415e05,null));};exports[_0xce71('0x27')]=function(_0x18b40e,_0xcc9e88){return db[_0xce71('0x31')]['find']({'where':{'id':_0x18b40e[_0xce71('0x4a')]['id']}})[_0xce71('0x26')](handleEntityNotFound(_0xcc9e88,null))[_0xce71('0x26')](removeEntity(_0xcc9e88,null))['catch'](handleError(_0xcc9e88,null));};exports[_0xce71('0x55')]=function(_0x557acf,_0x42b7bf,_0x36e877){return db['Team'][_0xce71('0x56')]({'where':{'id':_0x557acf[_0xce71('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42b7bf,null))['then'](function(_0x8902ec){if(!_0x557acf[_0xce71('0x35')]['channel']||!utils[_0xce71('0x57')](_0x557acf['query'][_0xce71('0x58')])){throw new db['Sequelize'][(_0xce71('0x59'))]('Unknown\x20channel');}var _0x2b7077={};var _0x5708d2={};_0x5708d2[_0xce71('0x34')]=_[_0xce71('0x36')](db[_[_0xce71('0x5a')](_0x557acf[_0xce71('0x35')][_0xce71('0x58')]['toLowerCase']())+_0xce71('0x5b')][_0xce71('0x5c')]);_0x5708d2['query']=_[_0xce71('0x36')](_0x557acf[_0xce71('0x35')]);_0x5708d2[_0xce71('0x37')]=_[_0xce71('0x38')](_0x5708d2['model'],_0x5708d2[_0xce71('0x35')]);_0x2b7077[_0xce71('0x39')]=_[_0xce71('0x38')](_0x5708d2[_0xce71('0x34')],qs[_0xce71('0x3a')](_0x557acf[_0xce71('0x35')]['fields']));_0x2b7077[_0xce71('0x39')]=_0x2b7077['attributes'][_0xce71('0x4b')]?_0x2b7077[_0xce71('0x39')]:_0x5708d2[_0xce71('0x34')];_0x2b7077['limit']=qs[_0xce71('0x20')](_0x557acf[_0xce71('0x35')][_0xce71('0x20')]);_0x2b7077['offset']=qs[_0xce71('0x1f')](_0x557acf[_0xce71('0x35')][_0xce71('0x1f')]);_0x2b7077[_0xce71('0x3d')]=qs[_0xce71('0x3e')](_0x557acf[_0xce71('0x35')]['sort']);_0x2b7077['where']=qs['filters'](_[_0xce71('0x40')](_0x557acf[_0xce71('0x35')],_0x5708d2[_0xce71('0x37')]));_0x2b7077=_['merge']({},_0x2b7077,_0x557acf[_0xce71('0x5d')]);return _0x8902ec[_0xce71('0x28')+_['capitalize'](_0x557acf['query'][_0xce71('0x58')][_0xce71('0x5e')]())+'Queues'](_0x2b7077);})[_0xce71('0x26')](respondWithResult(_0x42b7bf,null))[_0xce71('0x48')](handleError(_0x42b7bf,null));};exports[_0xce71('0x5f')]=function(_0x2c56ce,_0x5f5bf9,_0xa0d118){return db[_0xce71('0x31')][_0xce71('0x56')]({'where':{'id':_0x2c56ce[_0xce71('0x4a')]['id']}})[_0xce71('0x26')](function(_0x43817b){if(_0x43817b){if(!_0x2c56ce[_0xce71('0x4d')]['channel']||!utils['isValidChannel'](_0x2c56ce[_0xce71('0x4d')][_0xce71('0x58')])){throw new db['Sequelize'][(_0xce71('0x59'))](_0xce71('0x60'));}return _0x43817b['add'+_['capitalize'](_0x2c56ce['body'][_0xce71('0x58')]['toLowerCase']())+'Queues'](_0x2c56ce[_0xce71('0x4d')][_0xce71('0x61')]);}return null;})['then'](handleEntityNotFound(_0x5f5bf9,null))[_0xce71('0x26')](respondWithStatusCode(_0x5f5bf9,null))['catch'](handleError(_0x5f5bf9,null));};exports['removeQueues']=function(_0x24df82,_0x429e21,_0x189ae1){return db[_0xce71('0x31')][_0xce71('0x56')]({'where':{'id':_0x24df82['params']['id']}})[_0xce71('0x26')](function(_0x5310e4){if(_0x5310e4){if(!_0x24df82[_0xce71('0x35')][_0xce71('0x58')]||!utils['isValidChannel'](_0x24df82[_0xce71('0x35')][_0xce71('0x58')])){throw new db[(_0xce71('0x62'))]['ValidationError'](_0xce71('0x60'));}return _0x5310e4[_0xce71('0x63')+_['capitalize'](_0x24df82[_0xce71('0x35')]['channel']['toLowerCase']())+_0xce71('0x64')](_0x24df82[_0xce71('0x35')][_0xce71('0x61')]);}return null;})[_0xce71('0x26')](handleEntityNotFound(_0x429e21,null))[_0xce71('0x26')](respondWithStatusCode(_0x429e21,null))[_0xce71('0x48')](handleError(_0x429e21,null));};exports[_0xce71('0x65')]=function(_0x1af1e3,_0xdc5639,_0x194b6d){return db[_0xce71('0x31')][_0xce71('0x54')]({'where':{'id':_0x1af1e3[_0xce71('0x4a')]['id']}})[_0xce71('0x26')](handleEntityNotFound(_0xdc5639,null))[_0xce71('0x26')](function(_0x566907){if(_0x566907){var _0x607b5c=[_0xce71('0x66'),'Chat',_0xce71('0x67'),_0xce71('0x68'),_0xce71('0x69'),_0xce71('0x6a'),_0xce71('0x6b')];return BPromise['each'](_0x607b5c,function(_0x49470e){return _0x566907['get'+_0x49470e+_0xce71('0x64')]({'attributes':['id',_0xce71('0x2d')]})[_0xce71('0x26')](function(_0x1e0f6b){return BPromise[_0xce71('0x6c')](_0x1e0f6b,function(_0x11a1a8){return _0x11a1a8['addAgents'](_0x1af1e3[_0xce71('0x4d')][_0xce71('0x61')])[_0xce71('0x26')](function(){if(_0x49470e===_0xce71('0x66')){return db[_0xce71('0x6d')][_0xce71('0x46')]({'where':{'id':_0x1af1e3['body'][_0xce71('0x61')]},'attributes':['id',_0xce71('0x2d'),_0xce71('0x6e'),_0xce71('0x6f'),_0xce71('0x70')],'raw':!![]})[_0xce71('0x26')](function(_0x26be13){return BPromise[_0xce71('0x6c')](_[_0xce71('0x41')](_0x26be13,{'online':0x1}),function(_0x4cee22){return db[_0xce71('0x71')][_0xce71('0x72')]({'membername':_0x4cee22[_0xce71('0x2d')],'UserId':_0x4cee22['id'],'queue_name':_0x11a1a8['name'],'VoiceQueueId':_0x11a1a8['id'],'interface':_[_0xce71('0x73')](_0x4cee22[_0xce71('0x70')])?util[_0xce71('0x74')](_0xce71('0x75'),_0x4cee22[_0xce71('0x2d')]):_0x4cee22[_0xce71('0x70')],'paused':_0x4cee22[_0xce71('0x6f')]||![],'penalty':0x0});});});}});});})[_0xce71('0x26')](function(){return _0x566907;});})['then'](function(){return _0x566907;});}})[_0xce71('0x26')](function(_0x55f384){if(_0x55f384){return _0x55f384['addAgents'](_0x1af1e3['body'][_0xce71('0x61')],_['omit'](_0x1af1e3[_0xce71('0x4d')],[_0xce71('0x61'),'id'])||{})['spread'](function(_0x2ea8ce){for(var _0x3f544c=0x0;_0x3f544c<_0x1af1e3[_0xce71('0x4d')][_0xce71('0x61')][_0xce71('0x4b')];_0x3f544c+=0x1){socket[_0xce71('0x76')](_0xce71('0x77'),{'UserId':_0x1af1e3['body'][_0xce71('0x61')][_0x3f544c],'TeamId':_0x1af1e3['params']['id']});}return _0x2ea8ce;});}})[_0xce71('0x26')](respondWithResult(_0xdc5639,null))[_0xce71('0x48')](handleError(_0xdc5639,null));};exports[_0xce71('0x78')]=function(_0x476c35,_0x58e3fa,_0x40e61b){return db['Team'][_0xce71('0x54')]({'where':{'id':_0x476c35[_0xce71('0x4a')]['id']}})[_0xce71('0x26')](handleEntityNotFound(_0x58e3fa,null))[_0xce71('0x26')](function(_0x349ef6){if(_0x349ef6){return BPromise['each']([_0xce71('0x79'),_0xce71('0x7a'),_0xce71('0x7b'),_0xce71('0x7c'),_0xce71('0x7d'),_0xce71('0x7e'),_0xce71('0x7f')],function(_0x46e8d1){return _0x349ef6[_0xce71('0x28')+_[_0xce71('0x5a')](_0x46e8d1)+_0xce71('0x64')]({'attributes':['id',_0xce71('0x2d')]})[_0xce71('0x26')](function(_0x54890a){return BPromise[_0xce71('0x6c')](_0x54890a,function(_0x2d3c1a){return _0x2d3c1a[_0xce71('0x78')](_0x476c35[_0xce71('0x35')][_0xce71('0x61')])[_0xce71('0x26')](function(){if(_0x46e8d1===_0xce71('0x79')){return db[_0xce71('0x71')]['destroy']({'where':{'VoiceQueueId':_0x2d3c1a['id'],'UserId':_0x476c35[_0xce71('0x35')][_0xce71('0x61')]}});}});});})[_0xce71('0x26')](function(){return _0x349ef6;});})[_0xce71('0x26')](function(){return _0x349ef6;});}})[_0xce71('0x26')](function(_0x48f5a4){if(_0x48f5a4){return _0x48f5a4[_0xce71('0x78')](_0x476c35[_0xce71('0x35')][_0xce71('0x61')])['then'](function(){if(_[_0xce71('0x80')](_0x476c35[_0xce71('0x35')]['ids'])){for(var _0x5f19b3=0x0;_0x5f19b3<_0x476c35[_0xce71('0x35')][_0xce71('0x61')][_0xce71('0x4b')];_0x5f19b3+=0x1){socket[_0xce71('0x76')](_0xce71('0x81'),{'UserId':Number(_0x476c35[_0xce71('0x35')][_0xce71('0x61')][_0x5f19b3]),'TeamId':Number(_0x476c35[_0xce71('0x4a')]['id'])});}}else{socket[_0xce71('0x76')]('userTeam:remove',{'UserId':Number(_0x476c35[_0xce71('0x35')][_0xce71('0x61')]),'TeamId':Number(_0x476c35[_0xce71('0x4a')]['id'])});}});}})[_0xce71('0x26')](respondWithStatusCode(_0x58e3fa,null))[_0xce71('0x48')](handleError(_0x58e3fa,null));};exports['getAgents']=function(_0x3fd828,_0x4aed1a,_0x1cc1c9){var _0x19e3b1={};var _0x1e248a={};var _0x1f2002;var _0x1dd8de;return db[_0xce71('0x31')][_0xce71('0x56')]({'where':{'id':_0x3fd828[_0xce71('0x4a')]['id']}})[_0xce71('0x26')](handleEntityNotFound(_0x4aed1a,null))[_0xce71('0x26')](function(_0x57069c){if(_0x57069c){_0x1f2002=_0x57069c;_0x1e248a[_0xce71('0x34')]=_['keys'](db[_0xce71('0x6d')][_0xce71('0x5c')]);_0x1e248a[_0xce71('0x35')]=_[_0xce71('0x36')](_0x3fd828['query']);_0x1e248a[_0xce71('0x37')]=_['intersection'](_0x1e248a[_0xce71('0x34')],_0x1e248a[_0xce71('0x35')]);_0x19e3b1[_0xce71('0x39')]=_['intersection'](_0x1e248a[_0xce71('0x34')],qs[_0xce71('0x3a')](_0x3fd828[_0xce71('0x35')]['fields']));_0x19e3b1['attributes']=_0x19e3b1['attributes'][_0xce71('0x4b')]?_0x19e3b1[_0xce71('0x39')]:_0x1e248a[_0xce71('0x34')];_0x19e3b1[_0xce71('0x3d')]=qs[_0xce71('0x3e')](_0x3fd828[_0xce71('0x35')][_0xce71('0x3e')]);_0x19e3b1[_0xce71('0x3f')]=qs[_0xce71('0x37')](_[_0xce71('0x40')](_0x3fd828[_0xce71('0x35')],_0x1e248a[_0xce71('0x37')]));if(_0x3fd828[_0xce71('0x35')][_0xce71('0x41')]){_0x19e3b1[_0xce71('0x3f')]=_[_0xce71('0x42')](_0x19e3b1[_0xce71('0x3f')],{'$or':_['map'](_0x19e3b1[_0xce71('0x39')],function(_0x43843e){var _0x736df0={};_0x736df0[_0x43843e]={'$like':'%'+_0x3fd828['query'][_0xce71('0x41')]+'%'};return _0x736df0;})});}_0x19e3b1=_[_0xce71('0x42')]({},_0x19e3b1,_0x3fd828[_0xce71('0x5d')]);return _0x1f2002[_0xce71('0x82')](_0x19e3b1);}})['then'](function(_0x59f0d5){if(_0x59f0d5){_0x1dd8de=_0x59f0d5[_0xce71('0x4b')];if(!_0x3fd828[_0xce71('0x35')][_0xce71('0x3b')](_0xce71('0x3c'))){_0x19e3b1[_0xce71('0x20')]=qs[_0xce71('0x20')](_0x3fd828['query'][_0xce71('0x20')]);_0x19e3b1[_0xce71('0x1f')]=qs[_0xce71('0x1f')](_0x3fd828[_0xce71('0x35')][_0xce71('0x1f')]);}return _0x1f2002[_0xce71('0x82')](_0x19e3b1);}})[_0xce71('0x26')](function(_0x4611c4){if(_0x4611c4){return _0x4611c4?{'count':_0x1dd8de,'rows':_0x4611c4}:null;}})['then'](respondWithResult(_0x4aed1a,null))[_0xce71('0x48')](handleError(_0x4aed1a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1fa41d6..d2faf32 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 _0xb534=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0xb534,0x1de));var _0x4b53=function(_0x5319f9,_0x23e160){_0x5319f9=_0x5319f9-0x0;var _0x2437df=_0xb534[_0x5319f9];return _0x2437df;};'use strict';var EventEmitter=require(_0x4b53('0x0'));var Team=require(_0x4b53('0x1'))['db'][_0x4b53('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4b53('0x3')](0x0);var events={'afterCreate':_0x4b53('0x4'),'afterUpdate':_0x4b53('0x5'),'afterDestroy':_0x4b53('0x6')};function emitEvent(_0xa41122){return function(_0x1e6fc7,_0x2d623c,_0x47c065){TeamEvents[_0x4b53('0x7')](_0xa41122+':'+_0x1e6fc7['id'],_0x1e6fc7);TeamEvents[_0x4b53('0x7')](_0xa41122,_0x1e6fc7);_0x47c065(null);};}for(var e in events){if(events[_0x4b53('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x4b53('0x9')]=TeamEvents; \ No newline at end of file +var _0x80ed=['exports','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x5d8e44,_0x390492){var _0x5b7c5c=function(_0x5e6a62){while(--_0x5e6a62){_0x5d8e44['push'](_0x5d8e44['shift']());}};_0x5b7c5c(++_0x390492);}(_0x80ed,0x189));var _0xd80e=function(_0x250add,_0x1d53aa){_0x250add=_0x250add-0x0;var _0x42df80=_0x80ed[_0x250add];return _0x42df80;};'use strict';var EventEmitter=require('events');var Team=require(_0xd80e('0x0'))['db'][_0xd80e('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xd80e('0x2')](0x0);var events={'afterCreate':_0xd80e('0x3'),'afterUpdate':_0xd80e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x417ba6){return function(_0x186378,_0x4586c3,_0x3fb926){TeamEvents['emit'](_0x417ba6+':'+_0x186378['id'],_0x186378);TeamEvents[_0xd80e('0x5')](_0x417ba6,_0x186378);_0x3fb926(null);};}for(var e in events){if(events[_0xd80e('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xd80e('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 3ad4982..43d42ff 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 _0xac3f=['Team','teams','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./team.attributes','exports','define'];(function(_0x57d209,_0x37dc1a){var _0x182ced=function(_0x54d873){while(--_0x54d873){_0x57d209['push'](_0x57d209['shift']());}};_0x182ced(++_0x37dc1a);}(_0xac3f,0x161));var _0xfac3=function(_0x2bc2a2,_0x51e95f){_0x2bc2a2=_0x2bc2a2-0x0;var _0x20de67=_0xac3f[_0x2bc2a2];return _0x20de67;};'use strict';var _=require(_0xfac3('0x0'));var util=require(_0xfac3('0x1'));var logger=require(_0xfac3('0x2'))(_0xfac3('0x3'));var moment=require(_0xfac3('0x4'));var BPromise=require(_0xfac3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfac3('0x6'));var rimraf=require(_0xfac3('0x7'));var config=require('../../config/environment');var attributes=require(_0xfac3('0x8'));module[_0xfac3('0x9')]=function(_0x4fec17,_0x459c23){return _0x4fec17[_0xfac3('0xa')](_0xfac3('0xb'),attributes,{'tableName':_0xfac3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15d3=['request-promise','path','rimraf','exports','define','Team','util','api','moment','bluebird'];(function(_0x13766c,_0x448358){var _0x4e1472=function(_0x15e6f5){while(--_0x15e6f5){_0x13766c['push'](_0x13766c['shift']());}};_0x4e1472(++_0x448358);}(_0x15d3,0x9c));var _0x315d=function(_0x1c629f,_0x4c7d1e){_0x1c629f=_0x1c629f-0x0;var _0x2c0186=_0x15d3[_0x1c629f];return _0x2c0186;};'use strict';var _=require('lodash');var util=require(_0x315d('0x0'));var logger=require('../../config/logger')(_0x315d('0x1'));var moment=require(_0x315d('0x2'));var BPromise=require(_0x315d('0x3'));var rp=require(_0x315d('0x4'));var fs=require('fs');var path=require(_0x315d('0x5'));var rimraf=require(_0x315d('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x315d('0x7')]=function(_0x567df1,_0x1c77cf){return _0x567df1[_0x315d('0x8')](_0x315d('0x9'),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 7e705ed..29a1f19 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 _0xc5ca=['http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc5ca,0xcc));var _0xac5c=function(_0x43682e,_0x45a02d){_0x43682e=_0x43682e-0x0;var _0x4d1e02=_0xc5ca[_0x43682e];return _0x4d1e02;};'use strict';var _=require(_0xac5c('0x0'));var util=require(_0xac5c('0x1'));var moment=require(_0xac5c('0x2'));var BPromise=require(_0xac5c('0x3'));var rs=require(_0xac5c('0x4'));var fs=require('fs');var Redis=require(_0xac5c('0x5'));var db=require(_0xac5c('0x6'))['db'];var utils=require(_0xac5c('0x7'));var logger=require(_0xac5c('0x8'))('rpc');var config=require(_0xac5c('0x9'));var jayson=require(_0xac5c('0xa'));var client=jayson[_0xac5c('0xb')][_0xac5c('0xc')]({'port':0x232a});config[_0xac5c('0xd')]=_[_0xac5c('0xe')](config[_0xac5c('0xd')],{'host':_0xac5c('0xf'),'port':0x18eb});var socket=require(_0xac5c('0x10'))(new Redis(config[_0xac5c('0xd')]));require('./team.socket')[_0xac5c('0x11')](socket);function respondWithRpcPromise(_0x2664a6,_0x5dbc9b,_0x257eb0){return new BPromise(function(_0x27126f,_0x382879){return client[_0xac5c('0x12')](_0x2664a6,_0x257eb0)['then'](function(_0x433c62){logger[_0xac5c('0x13')]('Team,\x20%s,\x20%s',_0x5dbc9b,_0xac5c('0x14'));logger[_0xac5c('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x5dbc9b,_0xac5c('0x14'),JSON[_0xac5c('0x16')](_0x433c62));if(_0x433c62[_0xac5c('0x17')]){if(_0x433c62[_0xac5c('0x17')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x5dbc9b,_0x433c62[_0xac5c('0x17')][_0xac5c('0x18')]);return _0x382879(_0x433c62[_0xac5c('0x17')][_0xac5c('0x18')]);}logger[_0xac5c('0x17')](_0xac5c('0x19'),_0x5dbc9b,_0x433c62[_0xac5c('0x17')][_0xac5c('0x18')]);return _0x27126f(_0x433c62['error']['message']);}else{logger['info']('Team,\x20%s,\x20%s',_0x5dbc9b,_0xac5c('0x14'));_0x27126f(_0x433c62[_0xac5c('0x1a')]['message']);}})['catch'](function(_0x417638){logger[_0xac5c('0x17')](_0xac5c('0x19'),_0x5dbc9b,_0x417638);_0x382879(_0x417638);});});} \ No newline at end of file +var _0xc621=['Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc621,0x1d1));var _0x1c62=function(_0x34f746,_0x1e283e){_0x34f746=_0x34f746-0x0;var _0xa9a65e=_0xc621[_0x34f746];return _0xa9a65e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1c62('0x0'));var BPromise=require(_0x1c62('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c62('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c62('0x3'));var logger=require(_0x1c62('0x4'))(_0x1c62('0x5'));var config=require('../../config/environment');var jayson=require(_0x1c62('0x6'));var client=jayson[_0x1c62('0x7')][_0x1c62('0x8')]({'port':0x232a});config[_0x1c62('0x9')]=_['defaults'](config['redis'],{'host':_0x1c62('0xa'),'port':0x18eb});var socket=require(_0x1c62('0xb'))(new Redis(config['redis']));require('./team.socket')[_0x1c62('0xc')](socket);function respondWithRpcPromise(_0x15992f,_0x428f21,_0x45bd3a){return new BPromise(function(_0x370b6e,_0x4fe2d2){return client[_0x1c62('0xd')](_0x15992f,_0x45bd3a)[_0x1c62('0xe')](function(_0x11bbca){logger['info'](_0x1c62('0xf'),_0x428f21,_0x1c62('0x10'));logger[_0x1c62('0x11')](_0x1c62('0x12'),_0x428f21,'request\x20sent',JSON[_0x1c62('0x13')](_0x11bbca));if(_0x11bbca['error']){if(_0x11bbca[_0x1c62('0x14')]['code']===0x1f4){logger[_0x1c62('0x14')](_0x1c62('0xf'),_0x428f21,_0x11bbca[_0x1c62('0x14')][_0x1c62('0x15')]);return _0x4fe2d2(_0x11bbca[_0x1c62('0x14')][_0x1c62('0x15')]);}logger[_0x1c62('0x14')]('Team,\x20%s,\x20%s',_0x428f21,_0x11bbca['error'][_0x1c62('0x15')]);return _0x370b6e(_0x11bbca[_0x1c62('0x14')][_0x1c62('0x15')]);}else{logger[_0x1c62('0x16')](_0x1c62('0xf'),_0x428f21,_0x1c62('0x10'));_0x370b6e(_0x11bbca[_0x1c62('0x17')][_0x1c62('0x15')]);}})['catch'](function(_0x511464){logger[_0x1c62('0x14')](_0x1c62('0xf'),_0x428f21,_0x511464);_0x4fe2d2(_0x511464);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0faec13..3644802 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 _0x5f71=['team:','./team.events','remove','register','length'];(function(_0x1cd1bf,_0x5c03e6){var _0x1e22d4=function(_0x5cc916){while(--_0x5cc916){_0x1cd1bf['push'](_0x1cd1bf['shift']());}};_0x1e22d4(++_0x5c03e6);}(_0x5f71,0xc9));var _0x15f7=function(_0x7f8e19,_0x46eec6){_0x7f8e19=_0x7f8e19-0x0;var _0x423e23=_0x5f71[_0x7f8e19];return _0x423e23;};'use strict';var TeamEvents=require(_0x15f7('0x0'));var events=['save',_0x15f7('0x1'),'update'];function createListener(_0x472e37,_0x4cb523){return function(_0x575fdb){_0x4cb523['emit'](_0x472e37,_0x575fdb);};}function removeListener(_0x3a9fe1,_0x3fa535){return function(){TeamEvents['removeListener'](_0x3a9fe1,_0x3fa535);};}exports[_0x15f7('0x2')]=function(_0x421c41){for(var _0x81b047=0x0,_0x1de7b3=events[_0x15f7('0x3')];_0x81b047<_0x1de7b3;_0x81b047++){var _0x30d083=events[_0x81b047];var _0x1c9509=createListener(_0x15f7('0x4')+_0x30d083,_0x421c41);TeamEvents['on'](_0x30d083,_0x1c9509);}}; \ No newline at end of file +var _0x6209=['remove','update','removeListener','length','team:','./team.events','save'];(function(_0x5568ed,_0x61f3be){var _0x406c98=function(_0x3cc9a7){while(--_0x3cc9a7){_0x5568ed['push'](_0x5568ed['shift']());}};_0x406c98(++_0x61f3be);}(_0x6209,0x1e8));var _0x9620=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6209[_0xa1e3e3];return _0xc980e9;};'use strict';var TeamEvents=require(_0x9620('0x0'));var events=[_0x9620('0x1'),_0x9620('0x2'),_0x9620('0x3')];function createListener(_0x21f61a,_0xd5842f){return function(_0x27ec47){_0xd5842f['emit'](_0x21f61a,_0x27ec47);};}function removeListener(_0x2869e2,_0x17dc92){return function(){TeamEvents[_0x9620('0x4')](_0x2869e2,_0x17dc92);};}exports['register']=function(_0x30c6e7){for(var _0x26302a=0x0,_0x2bdb4e=events[_0x9620('0x5')];_0x26302a<_0x2bdb4e;_0x26302a++){var _0x488d59=events[_0x26302a];var _0x4e9082=createListener(_0x9620('0x6')+_0x488d59,_0x30c6e7);TeamEvents['on'](_0x488d59,_0x4e9082);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 275e8e8..f5b17ee 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 _0x8a0c=['show','post','create','put','update','delete','/:id','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index'];(function(_0xe73fc1,_0x40c909){var _0x354258=function(_0x5a7cb0){while(--_0x5a7cb0){_0xe73fc1['push'](_0xe73fc1['shift']());}};_0x354258(++_0x40c909);}(_0x8a0c,0x196));var _0xc8a0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8a0c[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xc8a0('0x0'));var util=require(_0xc8a0('0x1'));var path=require(_0xc8a0('0x2'));var timeout=require(_0xc8a0('0x3'));var express=require(_0xc8a0('0x4'));var router=express[_0xc8a0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc8a0('0x6'));var config=require(_0xc8a0('0x7'));var controller=require(_0xc8a0('0x8'));router[_0xc8a0('0x9')]('/',auth[_0xc8a0('0xa')](),controller[_0xc8a0('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc8a0('0xc')]);router[_0xc8a0('0xd')]('/',auth['isAuthenticated'](),controller[_0xc8a0('0xe')]);router[_0xc8a0('0xf')]('/:id',auth[_0xc8a0('0xa')](),controller[_0xc8a0('0x10')]);router[_0xc8a0('0x11')](_0xc8a0('0x12'),auth[_0xc8a0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4a08=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0x498917,_0xba064b){var _0x85e0f3=function(_0x33d293){while(--_0x33d293){_0x498917['push'](_0x498917['shift']());}};_0x85e0f3(++_0xba064b);}(_0x4a08,0x1a0));var _0x84a0=function(_0x3da353,_0x39dd0a){_0x3da353=_0x3da353-0x0;var _0x24dc09=_0x4a08[_0x3da353];return _0x24dc09;};'use strict';var multer=require(_0x84a0('0x0'));var util=require(_0x84a0('0x1'));var path=require('path');var timeout=require(_0x84a0('0x2'));var express=require(_0x84a0('0x3'));var router=express[_0x84a0('0x4')]();var auth=require(_0x84a0('0x5'));var interaction=require(_0x84a0('0x6'));var config=require(_0x84a0('0x7'));var controller=require(_0x84a0('0x8'));router['get']('/',auth[_0x84a0('0x9')](),controller[_0x84a0('0xa')]);router[_0x84a0('0xb')](_0x84a0('0xc'),auth['isAuthenticated'](),controller[_0x84a0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x84a0('0xe')]);router[_0x84a0('0xf')](_0x84a0('0xc'),auth[_0x84a0('0x9')](),controller[_0x84a0('0x10')]);router[_0x84a0('0x11')](_0x84a0('0xc'),auth['isAuthenticated'](),controller[_0x84a0('0x12')]);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 bc5271c..6f33d41 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 _0x9a26=['sequelize','exports','STRING'];(function(_0x5d0aa5,_0x26901c){var _0x4c8f6e=function(_0x994f48){while(--_0x994f48){_0x5d0aa5['push'](_0x5d0aa5['shift']());}};_0x4c8f6e(++_0x26901c);}(_0x9a26,0xdb));var _0x69a2=function(_0x579b4c,_0x418ec0){_0x579b4c=_0x579b4c-0x0;var _0x598027=_0x9a26[_0x579b4c];return _0x598027;};'use strict';var Sequelize=require(_0x69a2('0x0'));module[_0x69a2('0x1')]={'name':{'type':Sequelize[_0x69a2('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdeb7=['STRING','TEXT'];(function(_0x316df6,_0x23c30a){var _0x36e79c=function(_0x461ebe){while(--_0x461ebe){_0x316df6['push'](_0x316df6['shift']());}};_0x36e79c(++_0x23c30a);}(_0xdeb7,0x82));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7deb('0x0')]},'description':{'type':Sequelize[_0x7deb('0x0')]},'html':{'type':Sequelize[_0x7deb('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a4b827c..8a29da8 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 _0x2add=['limit','set','Content-Range','apply','reject','save','destroy','then','get','Templates','UserProfileResource','end','error','stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','rows','show','keys','include','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x451d0c,_0x241e73){var _0x1aae50=function(_0x481316){while(--_0x481316){_0x451d0c['push'](_0x451d0c['shift']());}};_0x1aae50(++_0x241e73);}(_0x2add,0xd9));var _0xd2ad=function(_0x4b4e36,_0x2e4433){_0x4b4e36=_0x4b4e36-0x0;var _0x4fbfe4=_0x2add[_0x4b4e36];return _0x4fbfe4;};'use strict';var pdf=require(_0xd2ad('0x0'));var emlformat=require(_0xd2ad('0x1'));var rimraf=require(_0xd2ad('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd2ad('0x3'));var moment=require(_0xd2ad('0x4'));var BPromise=require(_0xd2ad('0x5'));var Mustache=require('mustache');var util=require(_0xd2ad('0x6'));var path=require('path');var sox=require(_0xd2ad('0x7'));var csv=require(_0xd2ad('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd2ad('0x9'));var crypto=require(_0xd2ad('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd2ad('0xb'));var toCsv=require(_0xd2ad('0x8'));var querystring=require(_0xd2ad('0xc'));var Papa=require(_0xd2ad('0xd'));var Redis=require(_0xd2ad('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd2ad('0xf'));var as=require(_0xd2ad('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2ad('0x11'))(_0xd2ad('0x12'));var utils=require(_0xd2ad('0x13'));var config=require('../../config/environment');var db=require(_0xd2ad('0x14'))['db'];function respondWithStatusCode(_0xda42d1,_0x271a37){_0x271a37=_0x271a37||0xcc;return function(_0x2fa7cf){if(_0x2fa7cf){return _0xda42d1[_0xd2ad('0x15')](_0x271a37);}return _0xda42d1[_0xd2ad('0x16')](_0x271a37)['end']();};}function respondWithResult(_0x2c5736,_0x2d79ff){_0x2d79ff=_0x2d79ff||0xc8;return function(_0x23c83c){if(_0x23c83c){return _0x2c5736[_0xd2ad('0x16')](_0x2d79ff)[_0xd2ad('0x17')](_0x23c83c);}};}function respondWithFilteredResult(_0x5e9411,_0x53d3c0){return function(_0x475ba6){if(_0x475ba6){var _0x445752=_0x475ba6[_0xd2ad('0x18')],_0x1a0b7b=_0x53d3c0[_0xd2ad('0x19')],_0x3889f3=_0x53d3c0[_0xd2ad('0x19')]+_0x53d3c0[_0xd2ad('0x1a')],_0x27de6a;if(_0x3889f3>=_0x445752){_0x3889f3=_0x445752;_0x27de6a=0xc8;}else{_0x27de6a=0xce;}_0x5e9411[_0xd2ad('0x16')](_0x27de6a);return _0x5e9411[_0xd2ad('0x1b')](_0xd2ad('0x1c'),_0x1a0b7b+'-'+_0x3889f3+'/'+_0x445752)[_0xd2ad('0x17')](_0x475ba6);}return null;};}function patchUpdates(_0x26ed72){return function(_0x489c3a){try{jsonpatch[_0xd2ad('0x1d')](_0x489c3a,_0x26ed72,!![]);}catch(_0x5331bf){return BPromise[_0xd2ad('0x1e')](_0x5331bf);}return _0x489c3a[_0xd2ad('0x1f')]();};}function saveUpdates(_0x385e08,_0x230234){return function(_0x24f0a9){if(_0x24f0a9){return _0x24f0a9['update'](_0x385e08)['then'](function(_0x4fc67a){return _0x4fc67a;});}return null;};}function removeEntity(_0x3891f5,_0x45be8b){return function(_0x215236){if(_0x215236){return _0x215236[_0xd2ad('0x20')]()[_0xd2ad('0x21')](function(){var _0x573e97=_0x215236[_0xd2ad('0x22')]({'plain':!![]});var _0x28e8b3=_0xd2ad('0x23');return db[_0xd2ad('0x24')][_0xd2ad('0x20')]({'where':{'type':_0x28e8b3,'resourceId':_0x573e97['id']}})['then'](function(){return _0x215236;});})[_0xd2ad('0x21')](function(){_0x3891f5['status'](0xcc)[_0xd2ad('0x25')]();});}};}function handleEntityNotFound(_0x3c7294,_0x13ab0f){return function(_0x14349c){if(!_0x14349c){_0x3c7294[_0xd2ad('0x15')](0x194);}return _0x14349c;};}function handleError(_0x3d3d2d,_0x6c1825){_0x6c1825=_0x6c1825||0x1f4;return function(_0x505c30){logger[_0xd2ad('0x26')](_0x505c30[_0xd2ad('0x27')]);if(_0x505c30[_0xd2ad('0x28')]){delete _0x505c30['name'];}_0x3d3d2d['status'](_0x6c1825)[_0xd2ad('0x29')](_0x505c30);};}exports['index']=function(_0x570277,_0xcfc034){var _0x3d7acf={},_0x52e13f={},_0x5268ed={'count':0x0,'rows':[]};var _0xc917ff=_['map'](db[_0xd2ad('0x2a')][_0xd2ad('0x2b')],function(_0x4f0611){return{'name':_0x4f0611[_0xd2ad('0x2c')],'type':_0x4f0611[_0xd2ad('0x2d')][_0xd2ad('0x2e')]};});_0x52e13f[_0xd2ad('0x2f')]=_[_0xd2ad('0x30')](_0xc917ff,_0xd2ad('0x28'));_0x52e13f[_0xd2ad('0x31')]=_['keys'](_0x570277['query']);_0x52e13f[_0xd2ad('0x32')]=_['intersection'](_0x52e13f[_0xd2ad('0x2f')],_0x52e13f[_0xd2ad('0x31')]);_0x3d7acf[_0xd2ad('0x33')]=_[_0xd2ad('0x34')](_0x52e13f[_0xd2ad('0x2f')],qs['fields'](_0x570277[_0xd2ad('0x31')][_0xd2ad('0x35')]));_0x3d7acf[_0xd2ad('0x33')]=_0x3d7acf['attributes'][_0xd2ad('0x36')]?_0x3d7acf[_0xd2ad('0x33')]:_0x52e13f['model'];if(!_0x570277[_0xd2ad('0x31')][_0xd2ad('0x37')](_0xd2ad('0x38'))){_0x3d7acf[_0xd2ad('0x1a')]=qs[_0xd2ad('0x1a')](_0x570277[_0xd2ad('0x31')][_0xd2ad('0x1a')]);_0x3d7acf[_0xd2ad('0x19')]=qs[_0xd2ad('0x19')](_0x570277[_0xd2ad('0x31')][_0xd2ad('0x19')]);}_0x3d7acf['order']=qs[_0xd2ad('0x39')](_0x570277[_0xd2ad('0x31')][_0xd2ad('0x39')]);_0x3d7acf['where']=qs['filters'](_[_0xd2ad('0x3a')](_0x570277[_0xd2ad('0x31')],_0x52e13f['filters']),_0xc917ff);if(_0x570277[_0xd2ad('0x31')]['filter']){_0x3d7acf['where']=_[_0xd2ad('0x3b')](_0x3d7acf[_0xd2ad('0x3c')],{'$or':_[_0xd2ad('0x30')](_0xc917ff,function(_0x5cc36e){if(_0x5cc36e[_0xd2ad('0x2d')]!==_0xd2ad('0x3d')){var _0xfcc884={};_0xfcc884[_0x5cc36e[_0xd2ad('0x28')]]={'$like':'%'+_0x570277['query'][_0xd2ad('0x3e')]+'%'};return _0xfcc884;}})});}_0x3d7acf=_['merge']({},_0x3d7acf,_0x570277[_0xd2ad('0x3f')]);var _0x4eb787={'where':_0x3d7acf['where']};return db[_0xd2ad('0x2a')][_0xd2ad('0x18')](_0x4eb787)[_0xd2ad('0x21')](function(_0x515a58){_0x5268ed[_0xd2ad('0x18')]=_0x515a58;if(_0x570277[_0xd2ad('0x31')][_0xd2ad('0x40')]){_0x3d7acf['include']=[{'all':!![]}];}return db[_0xd2ad('0x2a')]['findAll'](_0x3d7acf);})['then'](function(_0x35e008){_0x5268ed[_0xd2ad('0x41')]=_0x35e008;return _0x5268ed;})[_0xd2ad('0x21')](respondWithFilteredResult(_0xcfc034,_0x3d7acf))['catch'](handleError(_0xcfc034,null));};exports[_0xd2ad('0x42')]=function(_0x2e765a,_0xca520f){var _0x4abaa9={'raw':!![],'where':{'id':_0x2e765a['params']['id']}},_0x184977={};_0x184977[_0xd2ad('0x2f')]=_[_0xd2ad('0x43')](db[_0xd2ad('0x2a')][_0xd2ad('0x2b')]);_0x184977['query']=_['keys'](_0x2e765a[_0xd2ad('0x31')]);_0x184977['filters']=_[_0xd2ad('0x34')](_0x184977[_0xd2ad('0x2f')],_0x184977[_0xd2ad('0x31')]);_0x4abaa9[_0xd2ad('0x33')]=_['intersection'](_0x184977[_0xd2ad('0x2f')],qs['fields'](_0x2e765a['query'][_0xd2ad('0x35')]));_0x4abaa9['attributes']=_0x4abaa9['attributes'][_0xd2ad('0x36')]?_0x4abaa9[_0xd2ad('0x33')]:_0x184977[_0xd2ad('0x2f')];if(_0x2e765a['query']['includeAll']){_0x4abaa9[_0xd2ad('0x44')]=[{'all':!![]}];}_0x4abaa9=_[_0xd2ad('0x3b')]({},_0x4abaa9,_0x2e765a[_0xd2ad('0x3f')]);return db[_0xd2ad('0x2a')][_0xd2ad('0x45')](_0x4abaa9)[_0xd2ad('0x21')](handleEntityNotFound(_0xca520f,null))[_0xd2ad('0x21')](respondWithResult(_0xca520f,null))[_0xd2ad('0x46')](handleError(_0xca520f,null));};exports['create']=function(_0x1af97d,_0x45536f){return db[_0xd2ad('0x2a')]['create'](_0x1af97d[_0xd2ad('0x47')],{})['then'](function(_0x592b1f){var _0x435b79=_0x1af97d[_0xd2ad('0x48')][_0xd2ad('0x22')]({'plain':!![]});if(!_0x435b79)throw new Error(_0xd2ad('0x49'));if(_0x435b79[_0xd2ad('0x4a')]===_0xd2ad('0x48')){var _0x5eef30=_0x592b1f[_0xd2ad('0x22')]({'plain':!![]});var _0x5c500f=_0xd2ad('0x23');return db[_0xd2ad('0x4b')][_0xd2ad('0x45')]({'where':{'name':_0x5c500f,'userProfileId':_0x435b79[_0xd2ad('0x4c')]},'raw':!![]})[_0xd2ad('0x21')](function(_0x32e496){if(_0x32e496&&_0x32e496['autoAssociation']===0x0){return db[_0xd2ad('0x24')][_0xd2ad('0x4d')]({'name':_0x5eef30[_0xd2ad('0x28')],'resourceId':_0x5eef30['id'],'type':_0x32e496[_0xd2ad('0x28')],'sectionId':_0x32e496['id']},{})[_0xd2ad('0x21')](function(){return _0x592b1f;});}else{return _0x592b1f;}})[_0xd2ad('0x46')](function(_0x4effa1){logger[_0xd2ad('0x26')](_0xd2ad('0x4e'),_0x4effa1);throw _0x4effa1;});}return _0x592b1f;})[_0xd2ad('0x21')](respondWithResult(_0x45536f,0xc9))[_0xd2ad('0x46')](handleError(_0x45536f,null));};exports[_0xd2ad('0x4f')]=function(_0x40ac6c,_0x277a22){if(_0x40ac6c['body']['id']){delete _0x40ac6c['body']['id'];}return db[_0xd2ad('0x2a')][_0xd2ad('0x45')]({'where':{'id':_0x40ac6c['params']['id']}})[_0xd2ad('0x21')](handleEntityNotFound(_0x277a22,null))['then'](saveUpdates(_0x40ac6c['body'],null))[_0xd2ad('0x21')](respondWithResult(_0x277a22,null))[_0xd2ad('0x46')](handleError(_0x277a22,null));};exports[_0xd2ad('0x20')]=function(_0x34f125,_0x32fdac){return db[_0xd2ad('0x2a')][_0xd2ad('0x45')]({'where':{'id':_0x34f125[_0xd2ad('0x50')]['id']}})[_0xd2ad('0x21')](handleEntityNotFound(_0x32fdac,null))[_0xd2ad('0x21')](removeEntity(_0x32fdac,null))[_0xd2ad('0x46')](handleError(_0x32fdac,null));}; \ No newline at end of file +var _0xd9ff=['intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Template','then','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','sendStatus','status','end','count','offset','limit','set','json','apply','reject','destroy','get','error','stack','name','send','index','rawAttributes','type','map','query','keys','filters'];(function(_0x3eff47,_0x2796a1){var _0x8c1be2=function(_0x43d039){while(--_0x43d039){_0x3eff47['push'](_0x3eff47['shift']());}};_0x8c1be2(++_0x2796a1);}(_0xd9ff,0x1d0));var _0xfd9f=function(_0x3cea8d,_0x163bf2){_0x3cea8d=_0x3cea8d-0x0;var _0x4e757e=_0xd9ff[_0x3cea8d];return _0x4e757e;};'use strict';var pdf=require(_0xfd9f('0x0'));var emlformat=require(_0xfd9f('0x1'));var rimraf=require(_0xfd9f('0x2'));var zipdir=require(_0xfd9f('0x3'));var jsonpatch=require(_0xfd9f('0x4'));var rp=require(_0xfd9f('0x5'));var moment=require(_0xfd9f('0x6'));var BPromise=require(_0xfd9f('0x7'));var Mustache=require(_0xfd9f('0x8'));var util=require(_0xfd9f('0x9'));var path=require(_0xfd9f('0xa'));var sox=require('sox');var csv=require(_0xfd9f('0xb'));var ejs=require(_0xfd9f('0xc'));var fs=require('fs');var _=require(_0xfd9f('0xd'));var squel=require(_0xfd9f('0xe'));var crypto=require('crypto');var jsforce=require(_0xfd9f('0xf'));var deskjs=require(_0xfd9f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfd9f('0x11'));var Papa=require(_0xfd9f('0x12'));var Redis=require(_0xfd9f('0x13'));var authService=require(_0xfd9f('0x14'));var qs=require(_0xfd9f('0x15'));var as=require(_0xfd9f('0x16'));var hardwareService=require(_0xfd9f('0x17'));var logger=require(_0xfd9f('0x18'))(_0xfd9f('0x19'));var utils=require(_0xfd9f('0x1a'));var config=require(_0xfd9f('0x1b'));var db=require(_0xfd9f('0x1c'))['db'];function respondWithStatusCode(_0x9c1ca6,_0x2cd910){_0x2cd910=_0x2cd910||0xcc;return function(_0x34f993){if(_0x34f993){return _0x9c1ca6[_0xfd9f('0x1d')](_0x2cd910);}return _0x9c1ca6[_0xfd9f('0x1e')](_0x2cd910)[_0xfd9f('0x1f')]();};}function respondWithResult(_0x31e276,_0x527953){_0x527953=_0x527953||0xc8;return function(_0x15747b){if(_0x15747b){return _0x31e276[_0xfd9f('0x1e')](_0x527953)['json'](_0x15747b);}};}function respondWithFilteredResult(_0x592773,_0x49c068){return function(_0x105046){if(_0x105046){var _0x532698=_0x105046[_0xfd9f('0x20')],_0x20ed19=_0x49c068[_0xfd9f('0x21')],_0x4628d6=_0x49c068['offset']+_0x49c068[_0xfd9f('0x22')],_0x15be17;if(_0x4628d6>=_0x532698){_0x4628d6=_0x532698;_0x15be17=0xc8;}else{_0x15be17=0xce;}_0x592773['status'](_0x15be17);return _0x592773[_0xfd9f('0x23')]('Content-Range',_0x20ed19+'-'+_0x4628d6+'/'+_0x532698)[_0xfd9f('0x24')](_0x105046);}return null;};}function patchUpdates(_0x518855){return function(_0x23fdcc){try{jsonpatch[_0xfd9f('0x25')](_0x23fdcc,_0x518855,!![]);}catch(_0x1f79ff){return BPromise[_0xfd9f('0x26')](_0x1f79ff);}return _0x23fdcc['save']();};}function saveUpdates(_0x401544,_0x51026b){return function(_0x30def3){if(_0x30def3){return _0x30def3['update'](_0x401544)['then'](function(_0x37eaaa){return _0x37eaaa;});}return null;};}function removeEntity(_0xa03598,_0x3f55f1){return function(_0x503612){if(_0x503612){return _0x503612[_0xfd9f('0x27')]()['then'](function(){var _0x2000bb=_0x503612[_0xfd9f('0x28')]({'plain':!![]});var _0x497f7c='Templates';return db['UserProfileResource']['destroy']({'where':{'type':_0x497f7c,'resourceId':_0x2000bb['id']}})['then'](function(){return _0x503612;});})['then'](function(){_0xa03598['status'](0xcc)[_0xfd9f('0x1f')]();});}};}function handleEntityNotFound(_0xfbd7d9,_0x1efdf1){return function(_0x2e1f7c){if(!_0x2e1f7c){_0xfbd7d9[_0xfd9f('0x1d')](0x194);}return _0x2e1f7c;};}function handleError(_0x1b7c9e,_0x4a3a8a){_0x4a3a8a=_0x4a3a8a||0x1f4;return function(_0xb9b8a8){logger[_0xfd9f('0x29')](_0xb9b8a8[_0xfd9f('0x2a')]);if(_0xb9b8a8[_0xfd9f('0x2b')]){delete _0xb9b8a8[_0xfd9f('0x2b')];}_0x1b7c9e[_0xfd9f('0x1e')](_0x4a3a8a)[_0xfd9f('0x2c')](_0xb9b8a8);};}exports[_0xfd9f('0x2d')]=function(_0x4cbd6d,_0x2e356d){var _0x3def48={},_0x146573={},_0x46d540={'count':0x0,'rows':[]};var _0x50e640=_['map'](db['Template'][_0xfd9f('0x2e')],function(_0x252cb3){return{'name':_0x252cb3['fieldName'],'type':_0x252cb3[_0xfd9f('0x2f')]['key']};});_0x146573['model']=_[_0xfd9f('0x30')](_0x50e640,_0xfd9f('0x2b'));_0x146573[_0xfd9f('0x31')]=_[_0xfd9f('0x32')](_0x4cbd6d[_0xfd9f('0x31')]);_0x146573[_0xfd9f('0x33')]=_[_0xfd9f('0x34')](_0x146573['model'],_0x146573[_0xfd9f('0x31')]);_0x3def48[_0xfd9f('0x35')]=_['intersection'](_0x146573[_0xfd9f('0x36')],qs['fields'](_0x4cbd6d['query'][_0xfd9f('0x37')]));_0x3def48[_0xfd9f('0x35')]=_0x3def48['attributes'][_0xfd9f('0x38')]?_0x3def48[_0xfd9f('0x35')]:_0x146573[_0xfd9f('0x36')];if(!_0x4cbd6d[_0xfd9f('0x31')]['hasOwnProperty'](_0xfd9f('0x39'))){_0x3def48['limit']=qs[_0xfd9f('0x22')](_0x4cbd6d[_0xfd9f('0x31')][_0xfd9f('0x22')]);_0x3def48[_0xfd9f('0x21')]=qs[_0xfd9f('0x21')](_0x4cbd6d[_0xfd9f('0x31')][_0xfd9f('0x21')]);}_0x3def48[_0xfd9f('0x3a')]=qs[_0xfd9f('0x3b')](_0x4cbd6d[_0xfd9f('0x31')][_0xfd9f('0x3b')]);_0x3def48[_0xfd9f('0x3c')]=qs[_0xfd9f('0x33')](_[_0xfd9f('0x3d')](_0x4cbd6d[_0xfd9f('0x31')],_0x146573[_0xfd9f('0x33')]),_0x50e640);if(_0x4cbd6d[_0xfd9f('0x31')]['filter']){_0x3def48['where']=_[_0xfd9f('0x3e')](_0x3def48[_0xfd9f('0x3c')],{'$or':_['map'](_0x50e640,function(_0xeae35){if(_0xeae35[_0xfd9f('0x2f')]!==_0xfd9f('0x3f')){var _0x22a22b={};_0x22a22b[_0xeae35[_0xfd9f('0x2b')]]={'$like':'%'+_0x4cbd6d[_0xfd9f('0x31')][_0xfd9f('0x40')]+'%'};return _0x22a22b;}})});}_0x3def48=_[_0xfd9f('0x3e')]({},_0x3def48,_0x4cbd6d[_0xfd9f('0x41')]);var _0x27c11c={'where':_0x3def48[_0xfd9f('0x3c')]};return db[_0xfd9f('0x42')][_0xfd9f('0x20')](_0x27c11c)[_0xfd9f('0x43')](function(_0x5a3837){_0x46d540[_0xfd9f('0x20')]=_0x5a3837;if(_0x4cbd6d[_0xfd9f('0x31')]['includeAll']){_0x3def48['include']=[{'all':!![]}];}return db[_0xfd9f('0x42')][_0xfd9f('0x44')](_0x3def48);})[_0xfd9f('0x43')](function(_0x2b346d){_0x46d540[_0xfd9f('0x45')]=_0x2b346d;return _0x46d540;})[_0xfd9f('0x43')](respondWithFilteredResult(_0x2e356d,_0x3def48))[_0xfd9f('0x46')](handleError(_0x2e356d,null));};exports[_0xfd9f('0x47')]=function(_0x9ba30c,_0x1cde27){var _0x522aee={'raw':!![],'where':{'id':_0x9ba30c[_0xfd9f('0x48')]['id']}},_0x54d525={};_0x54d525[_0xfd9f('0x36')]=_['keys'](db[_0xfd9f('0x42')][_0xfd9f('0x2e')]);_0x54d525[_0xfd9f('0x31')]=_[_0xfd9f('0x32')](_0x9ba30c[_0xfd9f('0x31')]);_0x54d525[_0xfd9f('0x33')]=_['intersection'](_0x54d525['model'],_0x54d525[_0xfd9f('0x31')]);_0x522aee['attributes']=_[_0xfd9f('0x34')](_0x54d525[_0xfd9f('0x36')],qs[_0xfd9f('0x37')](_0x9ba30c[_0xfd9f('0x31')][_0xfd9f('0x37')]));_0x522aee[_0xfd9f('0x35')]=_0x522aee[_0xfd9f('0x35')][_0xfd9f('0x38')]?_0x522aee[_0xfd9f('0x35')]:_0x54d525[_0xfd9f('0x36')];if(_0x9ba30c[_0xfd9f('0x31')][_0xfd9f('0x49')]){_0x522aee['include']=[{'all':!![]}];}_0x522aee=_[_0xfd9f('0x3e')]({},_0x522aee,_0x9ba30c[_0xfd9f('0x41')]);return db['Template'][_0xfd9f('0x4a')](_0x522aee)[_0xfd9f('0x43')](handleEntityNotFound(_0x1cde27,null))[_0xfd9f('0x43')](respondWithResult(_0x1cde27,null))[_0xfd9f('0x46')](handleError(_0x1cde27,null));};exports[_0xfd9f('0x4b')]=function(_0x1bd006,_0x49db15){return db[_0xfd9f('0x42')][_0xfd9f('0x4b')](_0x1bd006['body'],{})[_0xfd9f('0x43')](function(_0x18b74b){var _0x59d7eb=_0x1bd006[_0xfd9f('0x4c')]['get']({'plain':!![]});if(!_0x59d7eb)throw new Error(_0xfd9f('0x4d'));if(_0x59d7eb[_0xfd9f('0x4e')]===_0xfd9f('0x4c')){var _0x9289ae=_0x18b74b[_0xfd9f('0x28')]({'plain':!![]});var _0x35b877='Templates';return db[_0xfd9f('0x4f')]['find']({'where':{'name':_0x35b877,'userProfileId':_0x59d7eb[_0xfd9f('0x50')]},'raw':!![]})['then'](function(_0x429444){if(_0x429444&&_0x429444[_0xfd9f('0x51')]===0x0){return db[_0xfd9f('0x52')][_0xfd9f('0x4b')]({'name':_0x9289ae[_0xfd9f('0x2b')],'resourceId':_0x9289ae['id'],'type':_0x429444[_0xfd9f('0x2b')],'sectionId':_0x429444['id']},{})[_0xfd9f('0x43')](function(){return _0x18b74b;});}else{return _0x18b74b;}})[_0xfd9f('0x46')](function(_0x423173){logger[_0xfd9f('0x29')](_0xfd9f('0x53'),_0x423173);throw _0x423173;});}return _0x18b74b;})['then'](respondWithResult(_0x49db15,0xc9))['catch'](handleError(_0x49db15,null));};exports[_0xfd9f('0x54')]=function(_0x147e7a,_0x4bb035){if(_0x147e7a['body']['id']){delete _0x147e7a[_0xfd9f('0x55')]['id'];}return db['Template'][_0xfd9f('0x4a')]({'where':{'id':_0x147e7a[_0xfd9f('0x48')]['id']}})[_0xfd9f('0x43')](handleEntityNotFound(_0x4bb035,null))['then'](saveUpdates(_0x147e7a[_0xfd9f('0x55')],null))[_0xfd9f('0x43')](respondWithResult(_0x4bb035,null))[_0xfd9f('0x46')](handleError(_0x4bb035,null));};exports[_0xfd9f('0x27')]=function(_0x1a37a0,_0x1b7f31){return db[_0xfd9f('0x42')][_0xfd9f('0x4a')]({'where':{'id':_0x1a37a0[_0xfd9f('0x48')]['id']}})[_0xfd9f('0x43')](handleEntityNotFound(_0x1b7f31,null))[_0xfd9f('0x43')](removeEntity(_0x1b7f31,null))[_0xfd9f('0x46')](handleError(_0x1b7f31,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 625f8ef..05e9572 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 _0x9e24=['exports','define','Template','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./template.attributes'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x9e24,0x6f));var _0x49e2=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x9e24[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x49e2('0x0'));var util=require(_0x49e2('0x1'));var logger=require(_0x49e2('0x2'))('api');var moment=require(_0x49e2('0x3'));var BPromise=require(_0x49e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49e2('0x5'));var rimraf=require(_0x49e2('0x6'));var config=require(_0x49e2('0x7'));var attributes=require(_0x49e2('0x8'));module[_0x49e2('0x9')]=function(_0x29b3f6,_0x1efb31){return _0x29b3f6[_0x49e2('0xa')](_0x49e2('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd80f=['define','Template','tools_templates','lodash','util','../../config/logger','moment','request-promise','rimraf','./template.attributes','exports'];(function(_0x1dfd20,_0x32f529){var _0x41270e=function(_0x5d3326){while(--_0x5d3326){_0x1dfd20['push'](_0x1dfd20['shift']());}};_0x41270e(++_0x32f529);}(_0xd80f,0x100));var _0xfd80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd80f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd80('0x0'));var util=require(_0xfd80('0x1'));var logger=require(_0xfd80('0x2'))('api');var moment=require(_0xfd80('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd80('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd80('0x5'));var config=require('../../config/environment');var attributes=require(_0xfd80('0x6'));module[_0xfd80('0x7')]=function(_0x3c809c,_0x2135c1){return _0x3c809c[_0xfd80('0x8')](_0xfd80('0x9'),attributes,{'tableName':_0xfd80('0xa'),'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 9b3181f..0967a36 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 _0x8a6c=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','catch','util'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x8a6c,0x15f));var _0xc8a6=function(_0x3c3603,_0xb16e87){_0x3c3603=_0x3c3603-0x0;var _0x588811=_0x8a6c[_0x3c3603];return _0x588811;};'use strict';var _=require('lodash');var util=require(_0xc8a6('0x0'));var moment=require(_0xc8a6('0x1'));var BPromise=require(_0xc8a6('0x2'));var rs=require(_0xc8a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc8a6('0x4'))(_0xc8a6('0x5'));var config=require(_0xc8a6('0x6'));var jayson=require(_0xc8a6('0x7'));var client=jayson[_0xc8a6('0x8')][_0xc8a6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30712e,_0x2be42c,_0x436c39){return new BPromise(function(_0x170e54,_0x3730de){return client[_0xc8a6('0xa')](_0x30712e,_0x436c39)[_0xc8a6('0xb')](function(_0x598f2a){logger[_0xc8a6('0xc')](_0xc8a6('0xd'),_0x2be42c,_0xc8a6('0xe'));logger[_0xc8a6('0xf')](_0xc8a6('0x10'),_0x2be42c,_0xc8a6('0xe'),JSON[_0xc8a6('0x11')](_0x598f2a));if(_0x598f2a[_0xc8a6('0x12')]){if(_0x598f2a[_0xc8a6('0x12')][_0xc8a6('0x13')]===0x1f4){logger[_0xc8a6('0x12')]('Template,\x20%s,\x20%s',_0x2be42c,_0x598f2a[_0xc8a6('0x12')][_0xc8a6('0x14')]);return _0x3730de(_0x598f2a[_0xc8a6('0x12')][_0xc8a6('0x14')]);}logger['error']('Template,\x20%s,\x20%s',_0x2be42c,_0x598f2a[_0xc8a6('0x12')][_0xc8a6('0x14')]);return _0x170e54(_0x598f2a[_0xc8a6('0x12')][_0xc8a6('0x14')]);}else{logger[_0xc8a6('0xc')](_0xc8a6('0xd'),_0x2be42c,'request\x20sent');_0x170e54(_0x598f2a['result']['message']);}})['catch'](function(_0x367faa){logger['error'](_0xc8a6('0xd'),_0x2be42c,_0x367faa);_0x3730de(_0x367faa);});});}exports[_0xc8a6('0x15')]=function(_0x54f8ea){var _0x5ea175=this;return new Promise(function(_0x16f61e,_0x123527){return db['Template'][_0xc8a6('0x16')]({'raw':_0x54f8ea[_0xc8a6('0x17')]?_0x54f8ea[_0xc8a6('0x17')][_0xc8a6('0x18')]===undefined?!![]:![]:!![],'where':_0x54f8ea[_0xc8a6('0x17')]?_0x54f8ea[_0xc8a6('0x17')][_0xc8a6('0x19')]||null:null,'attributes':_0x54f8ea[_0xc8a6('0x17')]?_0x54f8ea[_0xc8a6('0x17')][_0xc8a6('0x1a')]||null:null,'limit':_0x54f8ea['options']?_0x54f8ea['options'][_0xc8a6('0x1b')]||null:null,'include':_0x54f8ea[_0xc8a6('0x17')]?_0x54f8ea[_0xc8a6('0x17')][_0xc8a6('0x1c')]?_[_0xc8a6('0x1d')](_0x54f8ea['options'][_0xc8a6('0x1c')],function(_0x58a9a5){return{'model':db[_0x58a9a5[_0xc8a6('0x1e')]],'as':_0x58a9a5['as'],'attributes':_0x58a9a5[_0xc8a6('0x1a')],'include':_0x58a9a5[_0xc8a6('0x1c')]?_['map'](_0x58a9a5[_0xc8a6('0x1c')],function(_0x352409){return{'model':db[_0x352409['model']],'as':_0x352409['as'],'attributes':_0x352409[_0xc8a6('0x1a')],'include':_0x352409[_0xc8a6('0x1c')]?_[_0xc8a6('0x1d')](_0x352409[_0xc8a6('0x1c')],function(_0x3b6b20){return{'model':db[_0x3b6b20[_0xc8a6('0x1e')]],'as':_0x3b6b20['as'],'attributes':_0x3b6b20[_0xc8a6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc8a6('0xb')](function(_0x1c423f){logger[_0xc8a6('0xc')](_0xc8a6('0x15'),_0x54f8ea);logger[_0xc8a6('0xf')](_0xc8a6('0x15'),_0x54f8ea,JSON[_0xc8a6('0x11')](_0x1c423f));_0x16f61e(_0x1c423f);})[_0xc8a6('0x1f')](function(_0x4c7c78){logger['error'](_0xc8a6('0x15'),_0x4c7c78[_0xc8a6('0x14')],_0x54f8ea);_0x123527(_0x5ea175[_0xc8a6('0x12')](0x1f4,_0x4c7c78[_0xc8a6('0x14')]));});});}; \ No newline at end of file +var _0x44ec=['options','raw','where','attributes','limit','include','map','model','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template'];(function(_0x1d4970,_0x787bab){var _0x10877e=function(_0x243ed4){while(--_0x243ed4){_0x1d4970['push'](_0x1d4970['shift']());}};_0x10877e(++_0x787bab);}(_0x44ec,0x99));var _0xc44e=function(_0x10f17c,_0x25a5f8){_0x10f17c=_0x10f17c-0x0;var _0x53702b=_0x44ec[_0x10f17c];return _0x53702b;};'use strict';var _=require(_0xc44e('0x0'));var util=require(_0xc44e('0x1'));var moment=require(_0xc44e('0x2'));var BPromise=require(_0xc44e('0x3'));var rs=require(_0xc44e('0x4'));var fs=require('fs');var Redis=require(_0xc44e('0x5'));var db=require(_0xc44e('0x6'))['db'];var utils=require(_0xc44e('0x7'));var logger=require('../../config/logger')(_0xc44e('0x8'));var config=require(_0xc44e('0x9'));var jayson=require(_0xc44e('0xa'));var client=jayson[_0xc44e('0xb')][_0xc44e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46db92,_0x1ea906,_0x94e598){return new BPromise(function(_0x46a892,_0x582d62){return client[_0xc44e('0xd')](_0x46db92,_0x94e598)[_0xc44e('0xe')](function(_0x221805){logger[_0xc44e('0xf')](_0xc44e('0x10'),_0x1ea906,_0xc44e('0x11'));logger[_0xc44e('0x12')](_0xc44e('0x13'),_0x1ea906,_0xc44e('0x11'),JSON[_0xc44e('0x14')](_0x221805));if(_0x221805[_0xc44e('0x15')]){if(_0x221805['error'][_0xc44e('0x16')]===0x1f4){logger[_0xc44e('0x15')]('Template,\x20%s,\x20%s',_0x1ea906,_0x221805[_0xc44e('0x15')]['message']);return _0x582d62(_0x221805['error'][_0xc44e('0x17')]);}logger[_0xc44e('0x15')](_0xc44e('0x10'),_0x1ea906,_0x221805[_0xc44e('0x15')][_0xc44e('0x17')]);return _0x46a892(_0x221805[_0xc44e('0x15')]['message']);}else{logger['info'](_0xc44e('0x10'),_0x1ea906,'request\x20sent');_0x46a892(_0x221805[_0xc44e('0x18')][_0xc44e('0x17')]);}})[_0xc44e('0x19')](function(_0x4c08b1){logger[_0xc44e('0x15')]('Template,\x20%s,\x20%s',_0x1ea906,_0x4c08b1);_0x582d62(_0x4c08b1);});});}exports['GetTemplate']=function(_0x217be1){var _0x142aa9=this;return new Promise(function(_0x50e113,_0x43d299){return db[_0xc44e('0x1a')]['findAll']({'raw':_0x217be1[_0xc44e('0x1b')]?_0x217be1[_0xc44e('0x1b')][_0xc44e('0x1c')]===undefined?!![]:![]:!![],'where':_0x217be1[_0xc44e('0x1b')]?_0x217be1[_0xc44e('0x1b')][_0xc44e('0x1d')]||null:null,'attributes':_0x217be1[_0xc44e('0x1b')]?_0x217be1[_0xc44e('0x1b')][_0xc44e('0x1e')]||null:null,'limit':_0x217be1[_0xc44e('0x1b')]?_0x217be1[_0xc44e('0x1b')][_0xc44e('0x1f')]||null:null,'include':_0x217be1['options']?_0x217be1[_0xc44e('0x1b')][_0xc44e('0x20')]?_[_0xc44e('0x21')](_0x217be1[_0xc44e('0x1b')][_0xc44e('0x20')],function(_0x574f5a){return{'model':db[_0x574f5a[_0xc44e('0x22')]],'as':_0x574f5a['as'],'attributes':_0x574f5a['attributes'],'include':_0x574f5a[_0xc44e('0x20')]?_[_0xc44e('0x21')](_0x574f5a[_0xc44e('0x20')],function(_0x156aff){return{'model':db[_0x156aff[_0xc44e('0x22')]],'as':_0x156aff['as'],'attributes':_0x156aff[_0xc44e('0x1e')],'include':_0x156aff[_0xc44e('0x20')]?_[_0xc44e('0x21')](_0x156aff[_0xc44e('0x20')],function(_0x12e010){return{'model':db[_0x12e010['model']],'as':_0x12e010['as'],'attributes':_0x12e010[_0xc44e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc44e('0xe')](function(_0x1e2045){logger['info'](_0xc44e('0x23'),_0x217be1);logger[_0xc44e('0x12')](_0xc44e('0x23'),_0x217be1,JSON[_0xc44e('0x14')](_0x1e2045));_0x50e113(_0x1e2045);})[_0xc44e('0x19')](function(_0xe1c9a7){logger[_0xc44e('0x15')](_0xc44e('0x23'),_0xe1c9a7[_0xc44e('0x17')],_0x217be1);_0x43d299(_0x142aa9[_0xc44e('0x15')](0x1f4,_0xe1c9a7[_0xc44e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index e7d9a88..fe6a8a4 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 _0x2101=['getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x2101,0x16a));var _0x1210=function(_0x52c6e6,_0x19befc){_0x52c6e6=_0x52c6e6-0x0;var _0x12cc9b=_0x2101[_0x52c6e6];return _0x12cc9b;};'use strict';var multer=require(_0x1210('0x0'));var util=require(_0x1210('0x1'));var path=require(_0x1210('0x2'));var timeout=require(_0x1210('0x3'));var express=require('express');var router=express[_0x1210('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1210('0x5'));var config=require(_0x1210('0x6'));var controller=require(_0x1210('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1210('0x8')](_0x1210('0x9'),auth[_0x1210('0xa')](),controller[_0x1210('0xb')]);router['get'](_0x1210('0xc'),auth['isAuthenticated'](),controller[_0x1210('0xd')]);router[_0x1210('0x8')]('/:id/any_conditions',auth[_0x1210('0xa')](),controller[_0x1210('0xe')]);router['get'](_0x1210('0xf'),auth[_0x1210('0xa')](),controller[_0x1210('0x10')]);router[_0x1210('0x11')]('/',auth['isAuthenticated'](),controller[_0x1210('0x12')]);router[_0x1210('0x11')](_0x1210('0xc'),auth['isAuthenticated'](),controller[_0x1210('0x13')]);router[_0x1210('0x11')](_0x1210('0x14'),auth[_0x1210('0xa')](),controller[_0x1210('0x15')]);router[_0x1210('0x11')](_0x1210('0xf'),auth[_0x1210('0xa')](),controller[_0x1210('0x16')]);router[_0x1210('0x17')](_0x1210('0x9'),auth[_0x1210('0xa')](),controller[_0x1210('0x18')]);router['delete'](_0x1210('0x9'),auth[_0x1210('0xa')](),controller[_0x1210('0x19')]);module[_0x1210('0x1a')]=router; \ No newline at end of file +var _0x1cd6=['getAllConditions','/:id/actions','post','create','addAllCondition','/:id/any_conditions','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions'];(function(_0x36982b,_0x2923c9){var _0x4fcf7b=function(_0xf24a46){while(--_0xf24a46){_0x36982b['push'](_0x36982b['shift']());}};_0x4fcf7b(++_0x2923c9);}(_0x1cd6,0x88));var _0x61cd=function(_0x2d6022,_0x343d21){_0x2d6022=_0x2d6022-0x0;var _0x223f6e=_0x1cd6[_0x2d6022];return _0x223f6e;};'use strict';var multer=require(_0x61cd('0x0'));var util=require(_0x61cd('0x1'));var path=require(_0x61cd('0x2'));var timeout=require('connect-timeout');var express=require(_0x61cd('0x3'));var router=express[_0x61cd('0x4')]();var auth=require(_0x61cd('0x5'));var interaction=require(_0x61cd('0x6'));var config=require(_0x61cd('0x7'));var controller=require(_0x61cd('0x8'));router[_0x61cd('0x9')]('/',auth[_0x61cd('0xa')](),controller[_0x61cd('0xb')]);router['get'](_0x61cd('0xc'),auth[_0x61cd('0xa')](),controller['show']);router[_0x61cd('0x9')](_0x61cd('0xd'),auth['isAuthenticated'](),controller[_0x61cd('0xe')]);router[_0x61cd('0x9')]('/:id/any_conditions',auth[_0x61cd('0xa')](),controller['getAnyConditions']);router[_0x61cd('0x9')](_0x61cd('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x61cd('0x10')]('/',auth[_0x61cd('0xa')](),controller[_0x61cd('0x11')]);router[_0x61cd('0x10')](_0x61cd('0xd'),auth['isAuthenticated'](),controller[_0x61cd('0x12')]);router[_0x61cd('0x10')](_0x61cd('0x13'),auth[_0x61cd('0xa')](),controller['addAnyCondition']);router[_0x61cd('0x10')](_0x61cd('0xf'),auth[_0x61cd('0xa')](),controller['addAction']);router[_0x61cd('0x14')](_0x61cd('0xc'),auth[_0x61cd('0xa')](),controller[_0x61cd('0x15')]);router[_0x61cd('0x16')]('/:id',auth[_0x61cd('0xa')](),controller[_0x61cd('0x17')]);module[_0x61cd('0x18')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 8af8091..679546c 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 _0xf42d=['STRING','exports'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xf42d,0xf5));var _0xdf42=function(_0x41c54a,_0xe7fe5a){_0x41c54a=_0x41c54a-0x0;var _0x5ae8d9=_0xf42d[_0x41c54a];return _0x5ae8d9;};'use strict';var Sequelize=require('sequelize');module[_0xdf42('0x0')]={'name':{'type':Sequelize[_0xdf42('0x1')]},'channel':{'type':Sequelize[_0xdf42('0x1')]},'description':{'type':Sequelize[_0xdf42('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa5a5=['STRING','sequelize','exports'];(function(_0x2d0e10,_0x2d8d4c){var _0x2a7d57=function(_0x4814f8){while(--_0x4814f8){_0x2d0e10['push'](_0x2d0e10['shift']());}};_0x2a7d57(++_0x2d8d4c);}(_0xa5a5,0x15d));var _0x5a5a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa5a5[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x5a5a('0x0'));module[_0x5a5a('0x1')]={'name':{'type':Sequelize[_0x5a5a('0x2')]},'channel':{'type':Sequelize[_0x5a5a('0x2')]},'description':{'type':Sequelize[_0x5a5a('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index fe627dc..90477b0 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 _0xbe46=['stack','name','index','map','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','then','destroy','get','Triggers','UserProfileResource','error'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xbe46,0xeb));var _0x6be4=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xbe46[_0x2d8fc2];return _0x3a9e53;};'use strict';var pdf=require(_0x6be4('0x0'));var emlformat=require(_0x6be4('0x1'));var rimraf=require(_0x6be4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6be4('0x3'));var rp=require('request-promise');var moment=require(_0x6be4('0x4'));var BPromise=require(_0x6be4('0x5'));var Mustache=require(_0x6be4('0x6'));var util=require('util');var path=require(_0x6be4('0x7'));var sox=require(_0x6be4('0x8'));var csv=require(_0x6be4('0x9'));var ejs=require(_0x6be4('0xa'));var fs=require('fs');var _=require(_0x6be4('0xb'));var squel=require(_0x6be4('0xc'));var crypto=require(_0x6be4('0xd'));var jsforce=require(_0x6be4('0xe'));var deskjs=require(_0x6be4('0xf'));var toCsv=require(_0x6be4('0x9'));var querystring=require(_0x6be4('0x10'));var Papa=require(_0x6be4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6be4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6be4('0x13'))(_0x6be4('0x14'));var utils=require(_0x6be4('0x15'));var config=require(_0x6be4('0x16'));var db=require(_0x6be4('0x17'))['db'];function respondWithStatusCode(_0xc6f3cd,_0x584bde){_0x584bde=_0x584bde||0xcc;return function(_0x2f2001){if(_0x2f2001){return _0xc6f3cd[_0x6be4('0x18')](_0x584bde);}return _0xc6f3cd[_0x6be4('0x19')](_0x584bde)[_0x6be4('0x1a')]();};}function respondWithResult(_0x112ac7,_0x49c8d0){_0x49c8d0=_0x49c8d0||0xc8;return function(_0x36809d){if(_0x36809d){return _0x112ac7[_0x6be4('0x19')](_0x49c8d0)['json'](_0x36809d);}};}function respondWithFilteredResult(_0x41bc3d,_0x3bcbec){return function(_0x3add51){if(_0x3add51){var _0x51754e=_0x3add51['count'],_0x3ccf1c=_0x3bcbec[_0x6be4('0x1b')],_0x321ea4=_0x3bcbec[_0x6be4('0x1b')]+_0x3bcbec[_0x6be4('0x1c')],_0x2230c0;if(_0x321ea4>=_0x51754e){_0x321ea4=_0x51754e;_0x2230c0=0xc8;}else{_0x2230c0=0xce;}_0x41bc3d['status'](_0x2230c0);return _0x41bc3d[_0x6be4('0x1d')]('Content-Range',_0x3ccf1c+'-'+_0x321ea4+'/'+_0x51754e)[_0x6be4('0x1e')](_0x3add51);}return null;};}function patchUpdates(_0x42addf){return function(_0xc290c6){try{jsonpatch[_0x6be4('0x1f')](_0xc290c6,_0x42addf,!![]);}catch(_0x55d963){return BPromise['reject'](_0x55d963);}return _0xc290c6['save']();};}function saveUpdates(_0x28b0ae,_0x4aa4cc){return function(_0x447c5e){if(_0x447c5e){return _0x447c5e['update'](_0x28b0ae)[_0x6be4('0x20')](function(_0x74e736){return _0x74e736;});}return null;};}function removeEntity(_0xfb62f,_0x24b33e){return function(_0x4dc1d1){if(_0x4dc1d1){return _0x4dc1d1[_0x6be4('0x21')]()[_0x6be4('0x20')](function(){var _0x16642d=_0x4dc1d1[_0x6be4('0x22')]({'plain':!![]});var _0x2081a5=_0x6be4('0x23');return db[_0x6be4('0x24')][_0x6be4('0x21')]({'where':{'type':_0x2081a5,'resourceId':_0x16642d['id']}})['then'](function(){return _0x4dc1d1;});})[_0x6be4('0x20')](function(){_0xfb62f['status'](0xcc)[_0x6be4('0x1a')]();});}};}function handleEntityNotFound(_0x314ec1,_0x19c1b7){return function(_0x29fb41){if(!_0x29fb41){_0x314ec1[_0x6be4('0x18')](0x194);}return _0x29fb41;};}function handleError(_0xc04729,_0x419b7a){_0x419b7a=_0x419b7a||0x1f4;return function(_0x33c5ae){logger[_0x6be4('0x25')](_0x33c5ae[_0x6be4('0x26')]);if(_0x33c5ae[_0x6be4('0x27')]){delete _0x33c5ae[_0x6be4('0x27')];}_0xc04729['status'](_0x419b7a)['send'](_0x33c5ae);};}exports[_0x6be4('0x28')]=function(_0x72b30e,_0x4c612f){var _0x5a8ffc={},_0x20e416={},_0x4f8354={'count':0x0,'rows':[]};var _0x2dca31=_[_0x6be4('0x29')](db['Trigger'][_0x6be4('0x2a')],function(_0x2acf60){return{'name':_0x2acf60['fieldName'],'type':_0x2acf60['type'][_0x6be4('0x2b')]};});_0x20e416[_0x6be4('0x2c')]=_[_0x6be4('0x29')](_0x2dca31,_0x6be4('0x27'));_0x20e416['query']=_[_0x6be4('0x2d')](_0x72b30e['query']);_0x20e416[_0x6be4('0x2e')]=_[_0x6be4('0x2f')](_0x20e416['model'],_0x20e416[_0x6be4('0x30')]);_0x5a8ffc[_0x6be4('0x31')]=_[_0x6be4('0x2f')](_0x20e416[_0x6be4('0x2c')],qs[_0x6be4('0x32')](_0x72b30e['query'][_0x6be4('0x32')]));_0x5a8ffc['attributes']=_0x5a8ffc[_0x6be4('0x31')][_0x6be4('0x33')]?_0x5a8ffc['attributes']:_0x20e416[_0x6be4('0x2c')];if(!_0x72b30e['query'][_0x6be4('0x34')](_0x6be4('0x35'))){_0x5a8ffc[_0x6be4('0x1c')]=qs[_0x6be4('0x1c')](_0x72b30e[_0x6be4('0x30')]['limit']);_0x5a8ffc[_0x6be4('0x1b')]=qs[_0x6be4('0x1b')](_0x72b30e[_0x6be4('0x30')][_0x6be4('0x1b')]);}_0x5a8ffc[_0x6be4('0x36')]=qs['sort'](_0x72b30e[_0x6be4('0x30')][_0x6be4('0x37')]);_0x5a8ffc[_0x6be4('0x38')]=qs[_0x6be4('0x2e')](_[_0x6be4('0x39')](_0x72b30e[_0x6be4('0x30')],_0x20e416[_0x6be4('0x2e')]),_0x2dca31);if(_0x72b30e['query'][_0x6be4('0x3a')]){_0x5a8ffc[_0x6be4('0x38')]=_[_0x6be4('0x3b')](_0x5a8ffc[_0x6be4('0x38')],{'$or':_[_0x6be4('0x29')](_0x2dca31,function(_0x5636a0){if(_0x5636a0['type']!==_0x6be4('0x3c')){var _0x155c71={};_0x155c71[_0x5636a0[_0x6be4('0x27')]]={'$like':'%'+_0x72b30e[_0x6be4('0x30')][_0x6be4('0x3a')]+'%'};return _0x155c71;}})});}_0x5a8ffc=_[_0x6be4('0x3b')]({},_0x5a8ffc,_0x72b30e[_0x6be4('0x3d')]);var _0x29e50c={'where':_0x5a8ffc[_0x6be4('0x38')]};return db[_0x6be4('0x3e')]['count'](_0x29e50c)[_0x6be4('0x20')](function(_0x5577f9){_0x4f8354['count']=_0x5577f9;if(_0x72b30e[_0x6be4('0x30')][_0x6be4('0x3f')]){_0x5a8ffc['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x5a8ffc);})['then'](function(_0x1f5a92){_0x4f8354[_0x6be4('0x40')]=_0x1f5a92;return _0x4f8354;})['then'](respondWithFilteredResult(_0x4c612f,_0x5a8ffc))[_0x6be4('0x41')](handleError(_0x4c612f,null));};exports[_0x6be4('0x42')]=function(_0x586451,_0x201650){var _0x37f3bb={'raw':![],'where':{'id':_0x586451[_0x6be4('0x43')]['id']}},_0x40aa36={};_0x40aa36[_0x6be4('0x2c')]=_[_0x6be4('0x2d')](db['Trigger'][_0x6be4('0x2a')]);_0x40aa36[_0x6be4('0x30')]=_['keys'](_0x586451[_0x6be4('0x30')]);_0x40aa36['filters']=_[_0x6be4('0x2f')](_0x40aa36[_0x6be4('0x2c')],_0x40aa36[_0x6be4('0x30')]);_0x37f3bb['attributes']=_[_0x6be4('0x2f')](_0x40aa36[_0x6be4('0x2c')],qs[_0x6be4('0x32')](_0x586451['query'][_0x6be4('0x32')]));_0x37f3bb[_0x6be4('0x31')]=_0x37f3bb[_0x6be4('0x31')]['length']?_0x37f3bb['attributes']:_0x40aa36[_0x6be4('0x2c')];if(_0x586451[_0x6be4('0x30')]['includeAll']){_0x37f3bb[_0x6be4('0x44')]=[{'all':!![]}];}_0x37f3bb=_['merge']({},_0x37f3bb,_0x586451[_0x6be4('0x3d')]);return db[_0x6be4('0x3e')][_0x6be4('0x45')](_0x37f3bb)[_0x6be4('0x20')](handleEntityNotFound(_0x201650,null))[_0x6be4('0x20')](respondWithResult(_0x201650,null))[_0x6be4('0x41')](handleError(_0x201650,null));};exports[_0x6be4('0x46')]=function(_0x1a24c1,_0x20f5bf){return db['Trigger']['create'](_0x1a24c1[_0x6be4('0x47')],{})[_0x6be4('0x20')](function(_0x45e3c3){var _0x5b9170=_0x1a24c1[_0x6be4('0x48')][_0x6be4('0x22')]({'plain':!![]});if(!_0x5b9170)throw new Error(_0x6be4('0x49'));if(_0x5b9170[_0x6be4('0x4a')]==='user'){var _0x4c23e0=_0x45e3c3['get']({'plain':!![]});var _0x4cb0a9='Triggers';return db[_0x6be4('0x4b')][_0x6be4('0x45')]({'where':{'name':_0x4cb0a9,'userProfileId':_0x5b9170[_0x6be4('0x4c')]},'raw':!![]})[_0x6be4('0x20')](function(_0x418fd3){if(_0x418fd3&&_0x418fd3[_0x6be4('0x4d')]===0x0){return db[_0x6be4('0x24')][_0x6be4('0x46')]({'name':_0x4c23e0[_0x6be4('0x27')],'resourceId':_0x4c23e0['id'],'type':_0x418fd3[_0x6be4('0x27')],'sectionId':_0x418fd3['id']},{})[_0x6be4('0x20')](function(){return _0x45e3c3;});}else{return _0x45e3c3;}})[_0x6be4('0x41')](function(_0x5b1740){logger[_0x6be4('0x25')](_0x6be4('0x4e'),_0x5b1740);throw _0x5b1740;});}return _0x45e3c3;})[_0x6be4('0x20')](respondWithResult(_0x20f5bf,0xc9))[_0x6be4('0x41')](handleError(_0x20f5bf,null));};exports[_0x6be4('0x4f')]=function(_0x1ac4c2,_0xbbfdc){if(_0x1ac4c2[_0x6be4('0x47')]['id']){delete _0x1ac4c2['body']['id'];}return db[_0x6be4('0x3e')][_0x6be4('0x45')]({'where':{'id':_0x1ac4c2[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0xbbfdc,null))[_0x6be4('0x20')](saveUpdates(_0x1ac4c2['body'],null))[_0x6be4('0x20')](respondWithResult(_0xbbfdc,null))[_0x6be4('0x41')](handleError(_0xbbfdc,null));};exports[_0x6be4('0x21')]=function(_0x3bf2c2,_0x1d5371){return db['Trigger'][_0x6be4('0x45')]({'where':{'id':_0x3bf2c2[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x1d5371,null))['then'](removeEntity(_0x1d5371,null))[_0x6be4('0x41')](handleError(_0x1d5371,null));};exports[_0x6be4('0x50')]=function(_0x333cd3,_0x11087f,_0x4c059d){if(_0x333cd3[_0x6be4('0x47')]['id']){delete _0x333cd3[_0x6be4('0x47')]['id'];}return db['Trigger'][_0x6be4('0x45')]({'where':{'id':_0x333cd3[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x11087f,null))['then'](function(_0x1f4c30){if(_0x1f4c30){_0x333cd3[_0x6be4('0x47')][_0x6be4('0x51')]=_0x1f4c30['id'];return db[_0x6be4('0x52')][_0x6be4('0x46')](_0x333cd3[_0x6be4('0x47')]);}})[_0x6be4('0x20')](respondWithResult(_0x11087f,null))['catch'](handleError(_0x11087f,null));};exports[_0x6be4('0x53')]=function(_0x4e9076,_0x4e13e0,_0xe35b45){if(_0x4e9076[_0x6be4('0x47')]['id']){delete _0x4e9076[_0x6be4('0x47')]['id'];}return db[_0x6be4('0x3e')][_0x6be4('0x45')]({'where':{'id':_0x4e9076[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x4e13e0,null))[_0x6be4('0x20')](function(_0x28e3a5){if(_0x28e3a5){_0x4e9076[_0x6be4('0x47')][_0x6be4('0x54')]=_0x28e3a5['id'];return db['Condition'][_0x6be4('0x46')](_0x4e9076[_0x6be4('0x47')]);}})[_0x6be4('0x20')](respondWithResult(_0x4e13e0,null))[_0x6be4('0x41')](handleError(_0x4e13e0,null));};exports[_0x6be4('0x55')]=function(_0x4f5b65,_0x1cddd5,_0x25e6fb){var _0x4e9ded={};var _0x205b87={};var _0x5a40f2;var _0x44631e;return db['Trigger']['findOne']({'where':{'id':_0x4f5b65[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x1cddd5,null))[_0x6be4('0x20')](function(_0x51aae0){if(_0x51aae0){_0x5a40f2=_0x51aae0;_0x205b87['model']=_[_0x6be4('0x2d')](db[_0x6be4('0x52')]['rawAttributes']);_0x205b87[_0x6be4('0x30')]=_[_0x6be4('0x2d')](_0x4f5b65[_0x6be4('0x30')]);_0x205b87['filters']=_[_0x6be4('0x2f')](_0x205b87[_0x6be4('0x2c')],_0x205b87[_0x6be4('0x30')]);_0x4e9ded[_0x6be4('0x31')]=_[_0x6be4('0x2f')](_0x205b87[_0x6be4('0x2c')],qs[_0x6be4('0x32')](_0x4f5b65[_0x6be4('0x30')][_0x6be4('0x32')]));_0x4e9ded['attributes']=_0x4e9ded['attributes'][_0x6be4('0x33')]?_0x4e9ded[_0x6be4('0x31')]:_0x205b87[_0x6be4('0x2c')];_0x4e9ded[_0x6be4('0x36')]=qs['sort'](_0x4f5b65[_0x6be4('0x30')][_0x6be4('0x37')]);_0x4e9ded[_0x6be4('0x38')]=qs[_0x6be4('0x2e')](_[_0x6be4('0x39')](_0x4f5b65[_0x6be4('0x30')],_0x205b87['filters']));if(_0x4f5b65[_0x6be4('0x30')][_0x6be4('0x3a')]){_0x4e9ded[_0x6be4('0x38')]=_[_0x6be4('0x3b')](_0x4e9ded[_0x6be4('0x38')],{'$or':_['map'](_0x4e9ded['attributes'],function(_0x1505f8){var _0x4ceda8={};_0x4ceda8[_0x1505f8]={'$like':'%'+_0x4f5b65['query'][_0x6be4('0x3a')]+'%'};return _0x4ceda8;})});}_0x4e9ded=_[_0x6be4('0x3b')]({},_0x4e9ded,_0x4f5b65['options']);return _0x5a40f2[_0x6be4('0x55')](_0x4e9ded);}})['then'](function(_0x1ec395){if(_0x1ec395){_0x44631e=_0x1ec395[_0x6be4('0x33')];if(!_0x4f5b65[_0x6be4('0x30')][_0x6be4('0x34')](_0x6be4('0x35'))){_0x4e9ded[_0x6be4('0x1c')]=qs[_0x6be4('0x1c')](_0x4f5b65[_0x6be4('0x30')]['limit']);_0x4e9ded[_0x6be4('0x1b')]=qs[_0x6be4('0x1b')](_0x4f5b65['query'][_0x6be4('0x1b')]);}return _0x5a40f2['getAllConditions'](_0x4e9ded);}})[_0x6be4('0x20')](function(_0x4536fa){if(_0x4536fa){return _0x4536fa?{'count':_0x44631e,'rows':_0x4536fa}:null;}})['then'](respondWithResult(_0x1cddd5,null))[_0x6be4('0x41')](handleError(_0x1cddd5,null));};exports[_0x6be4('0x56')]=function(_0x57e030,_0x6b489,_0x57ab96){var _0x2cf392={};var _0x22878f={};var _0x299f1d;var _0xdbda4;return db['Trigger']['findOne']({'where':{'id':_0x57e030[_0x6be4('0x43')]['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x6b489,null))[_0x6be4('0x20')](function(_0x5c022c){if(_0x5c022c){_0x299f1d=_0x5c022c;_0x22878f['model']=_[_0x6be4('0x2d')](db['Condition'][_0x6be4('0x2a')]);_0x22878f[_0x6be4('0x30')]=_[_0x6be4('0x2d')](_0x57e030[_0x6be4('0x30')]);_0x22878f[_0x6be4('0x2e')]=_[_0x6be4('0x2f')](_0x22878f[_0x6be4('0x2c')],_0x22878f['query']);_0x2cf392['attributes']=_['intersection'](_0x22878f[_0x6be4('0x2c')],qs['fields'](_0x57e030[_0x6be4('0x30')][_0x6be4('0x32')]));_0x2cf392['attributes']=_0x2cf392[_0x6be4('0x31')][_0x6be4('0x33')]?_0x2cf392[_0x6be4('0x31')]:_0x22878f[_0x6be4('0x2c')];_0x2cf392[_0x6be4('0x36')]=qs['sort'](_0x57e030[_0x6be4('0x30')][_0x6be4('0x37')]);_0x2cf392['where']=qs[_0x6be4('0x2e')](_[_0x6be4('0x39')](_0x57e030[_0x6be4('0x30')],_0x22878f[_0x6be4('0x2e')]));if(_0x57e030[_0x6be4('0x30')][_0x6be4('0x3a')]){_0x2cf392[_0x6be4('0x38')]=_[_0x6be4('0x3b')](_0x2cf392[_0x6be4('0x38')],{'$or':_[_0x6be4('0x29')](_0x2cf392['attributes'],function(_0x106793){var _0x31e042={};_0x31e042[_0x106793]={'$like':'%'+_0x57e030[_0x6be4('0x30')][_0x6be4('0x3a')]+'%'};return _0x31e042;})});}_0x2cf392=_['merge']({},_0x2cf392,_0x57e030[_0x6be4('0x3d')]);return _0x299f1d[_0x6be4('0x56')](_0x2cf392);}})[_0x6be4('0x20')](function(_0x4d1f8e){if(_0x4d1f8e){_0xdbda4=_0x4d1f8e[_0x6be4('0x33')];if(!_0x57e030[_0x6be4('0x30')]['hasOwnProperty']('nolimit')){_0x2cf392[_0x6be4('0x1c')]=qs[_0x6be4('0x1c')](_0x57e030[_0x6be4('0x30')][_0x6be4('0x1c')]);_0x2cf392['offset']=qs[_0x6be4('0x1b')](_0x57e030[_0x6be4('0x30')][_0x6be4('0x1b')]);}return _0x299f1d[_0x6be4('0x56')](_0x2cf392);}})[_0x6be4('0x20')](function(_0x5b8cb6){if(_0x5b8cb6){return _0x5b8cb6?{'count':_0xdbda4,'rows':_0x5b8cb6}:null;}})[_0x6be4('0x20')](respondWithResult(_0x6b489,null))['catch'](handleError(_0x6b489,null));};exports[_0x6be4('0x57')]=function(_0xd05fa5,_0x4ce9f2,_0x250a41){if(_0xd05fa5[_0x6be4('0x47')]['id']){delete _0xd05fa5['body']['id'];}return db['Trigger'][_0x6be4('0x45')]({'where':{'id':_0xd05fa5['params']['id']}})[_0x6be4('0x20')](handleEntityNotFound(_0x4ce9f2,null))[_0x6be4('0x20')](function(_0x569077){if(_0x569077){_0xd05fa5[_0x6be4('0x47')][_0x6be4('0x58')]=_0x569077['id'];return db[_0x6be4('0x59')][_0x6be4('0x46')](_0xd05fa5[_0x6be4('0x47')]);}})[_0x6be4('0x20')](respondWithResult(_0x4ce9f2,null))['catch'](handleError(_0x4ce9f2,null));};exports[_0x6be4('0x5a')]=function(_0x3453dc,_0x49fde9,_0xd1ff0a){var _0x18d6c5={};var _0x4c9b38={};var _0x25d90c;var _0x2b4d50;return db[_0x6be4('0x3e')]['findOne']({'where':{'id':_0x3453dc[_0x6be4('0x43')]['id']}})['then'](handleEntityNotFound(_0x49fde9,null))[_0x6be4('0x20')](function(_0x36fd4c){if(_0x36fd4c){_0x25d90c=_0x36fd4c;_0x4c9b38[_0x6be4('0x2c')]=_[_0x6be4('0x2d')](db['Action']['rawAttributes']);_0x4c9b38[_0x6be4('0x30')]=_[_0x6be4('0x2d')](_0x3453dc[_0x6be4('0x30')]);_0x4c9b38[_0x6be4('0x2e')]=_[_0x6be4('0x2f')](_0x4c9b38[_0x6be4('0x2c')],_0x4c9b38[_0x6be4('0x30')]);_0x18d6c5[_0x6be4('0x31')]=_[_0x6be4('0x2f')](_0x4c9b38['model'],qs[_0x6be4('0x32')](_0x3453dc[_0x6be4('0x30')][_0x6be4('0x32')]));_0x18d6c5[_0x6be4('0x31')]=_0x18d6c5[_0x6be4('0x31')][_0x6be4('0x33')]?_0x18d6c5[_0x6be4('0x31')]:_0x4c9b38[_0x6be4('0x2c')];_0x18d6c5['order']=qs[_0x6be4('0x37')](_0x3453dc[_0x6be4('0x30')][_0x6be4('0x37')]);_0x18d6c5[_0x6be4('0x38')]=qs[_0x6be4('0x2e')](_[_0x6be4('0x39')](_0x3453dc[_0x6be4('0x30')],_0x4c9b38[_0x6be4('0x2e')]));if(_0x3453dc[_0x6be4('0x30')][_0x6be4('0x3a')]){_0x18d6c5[_0x6be4('0x38')]=_[_0x6be4('0x3b')](_0x18d6c5[_0x6be4('0x38')],{'$or':_[_0x6be4('0x29')](_0x18d6c5['attributes'],function(_0x41152e){var _0x2156dd={};_0x2156dd[_0x41152e]={'$like':'%'+_0x3453dc['query'][_0x6be4('0x3a')]+'%'};return _0x2156dd;})});}_0x18d6c5=_['merge']({},_0x18d6c5,_0x3453dc['options']);return _0x25d90c[_0x6be4('0x5a')](_0x18d6c5);}})[_0x6be4('0x20')](function(_0x467dbc){if(_0x467dbc){_0x2b4d50=_0x467dbc['length'];if(!_0x3453dc[_0x6be4('0x30')]['hasOwnProperty'](_0x6be4('0x35'))){_0x18d6c5[_0x6be4('0x1c')]=qs[_0x6be4('0x1c')](_0x3453dc[_0x6be4('0x30')]['limit']);_0x18d6c5['offset']=qs[_0x6be4('0x1b')](_0x3453dc[_0x6be4('0x30')][_0x6be4('0x1b')]);}return _0x25d90c[_0x6be4('0x5a')](_0x18d6c5);}})['then'](function(_0x208447){if(_0x208447){return _0x208447?{'count':_0x2b4d50,'rows':_0x208447}:null;}})['then'](respondWithResult(_0x49fde9,null))['catch'](handleError(_0x49fde9,null));}; \ No newline at end of file +var _0xcd05=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','get','Triggers','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','includeAll','include','findAll','rows','catch','params','find','create','user'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xcd05,0x1e3));var _0x5cd0=function(_0x4704dc,_0x575a5f){_0x4704dc=_0x4704dc-0x0;var _0x254d81=_0xcd05[_0x4704dc];return _0x254d81;};'use strict';var pdf=require(_0x5cd0('0x0'));var emlformat=require(_0x5cd0('0x1'));var rimraf=require(_0x5cd0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cd0('0x3'));var rp=require(_0x5cd0('0x4'));var moment=require('moment');var BPromise=require(_0x5cd0('0x5'));var Mustache=require(_0x5cd0('0x6'));var util=require(_0x5cd0('0x7'));var path=require(_0x5cd0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5cd0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5cd0('0xa'));var jsforce=require(_0x5cd0('0xb'));var deskjs=require(_0x5cd0('0xc'));var toCsv=require(_0x5cd0('0xd'));var querystring=require(_0x5cd0('0xe'));var Papa=require(_0x5cd0('0xf'));var Redis=require(_0x5cd0('0x10'));var authService=require(_0x5cd0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5cd0('0x12'));var hardwareService=require(_0x5cd0('0x13'));var logger=require(_0x5cd0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5cd0('0x15'));var db=require(_0x5cd0('0x16'))['db'];function respondWithStatusCode(_0x2f65a7,_0x3bf5ce){_0x3bf5ce=_0x3bf5ce||0xcc;return function(_0x58b8cb){if(_0x58b8cb){return _0x2f65a7['sendStatus'](_0x3bf5ce);}return _0x2f65a7['status'](_0x3bf5ce)[_0x5cd0('0x17')]();};}function respondWithResult(_0x5d316c,_0x2cc8f6){_0x2cc8f6=_0x2cc8f6||0xc8;return function(_0x50bfa2){if(_0x50bfa2){return _0x5d316c[_0x5cd0('0x18')](_0x2cc8f6)[_0x5cd0('0x19')](_0x50bfa2);}};}function respondWithFilteredResult(_0x1373a1,_0x51db23){return function(_0xcbd137){if(_0xcbd137){var _0x3c9aee=_0xcbd137[_0x5cd0('0x1a')],_0x39f328=_0x51db23[_0x5cd0('0x1b')],_0x409a6b=_0x51db23[_0x5cd0('0x1b')]+_0x51db23['limit'],_0x29d271;if(_0x409a6b>=_0x3c9aee){_0x409a6b=_0x3c9aee;_0x29d271=0xc8;}else{_0x29d271=0xce;}_0x1373a1[_0x5cd0('0x18')](_0x29d271);return _0x1373a1['set'](_0x5cd0('0x1c'),_0x39f328+'-'+_0x409a6b+'/'+_0x3c9aee)[_0x5cd0('0x19')](_0xcbd137);}return null;};}function patchUpdates(_0x2b794c){return function(_0x545902){try{jsonpatch[_0x5cd0('0x1d')](_0x545902,_0x2b794c,!![]);}catch(_0x10f31e){return BPromise[_0x5cd0('0x1e')](_0x10f31e);}return _0x545902[_0x5cd0('0x1f')]();};}function saveUpdates(_0x4ab63e,_0x1b120b){return function(_0x3f4c88){if(_0x3f4c88){return _0x3f4c88['update'](_0x4ab63e)[_0x5cd0('0x20')](function(_0x492b52){return _0x492b52;});}return null;};}function removeEntity(_0x569060,_0x5988cb){return function(_0x5391f9){if(_0x5391f9){return _0x5391f9[_0x5cd0('0x21')]()[_0x5cd0('0x20')](function(){var _0x16c947=_0x5391f9[_0x5cd0('0x22')]({'plain':!![]});var _0x2f435f=_0x5cd0('0x23');return db['UserProfileResource'][_0x5cd0('0x21')]({'where':{'type':_0x2f435f,'resourceId':_0x16c947['id']}})[_0x5cd0('0x20')](function(){return _0x5391f9;});})[_0x5cd0('0x20')](function(){_0x569060['status'](0xcc)[_0x5cd0('0x17')]();});}};}function handleEntityNotFound(_0x4589b7,_0x1c970f){return function(_0x2843db){if(!_0x2843db){_0x4589b7[_0x5cd0('0x24')](0x194);}return _0x2843db;};}function handleError(_0x5da9c1,_0x134c5f){_0x134c5f=_0x134c5f||0x1f4;return function(_0x2914af){logger[_0x5cd0('0x25')](_0x2914af[_0x5cd0('0x26')]);if(_0x2914af['name']){delete _0x2914af[_0x5cd0('0x27')];}_0x5da9c1[_0x5cd0('0x18')](_0x134c5f)[_0x5cd0('0x28')](_0x2914af);};}exports['index']=function(_0x2def5a,_0x26f0bc){var _0x5a222c={},_0x5ef188={},_0xd4bcf={'count':0x0,'rows':[]};var _0x3cdf03=_['map'](db['Trigger'][_0x5cd0('0x29')],function(_0x4a1b59){return{'name':_0x4a1b59[_0x5cd0('0x2a')],'type':_0x4a1b59[_0x5cd0('0x2b')][_0x5cd0('0x2c')]};});_0x5ef188['model']=_[_0x5cd0('0x2d')](_0x3cdf03,_0x5cd0('0x27'));_0x5ef188[_0x5cd0('0x2e')]=_[_0x5cd0('0x2f')](_0x2def5a['query']);_0x5ef188[_0x5cd0('0x30')]=_[_0x5cd0('0x31')](_0x5ef188[_0x5cd0('0x32')],_0x5ef188[_0x5cd0('0x2e')]);_0x5a222c[_0x5cd0('0x33')]=_[_0x5cd0('0x31')](_0x5ef188[_0x5cd0('0x32')],qs[_0x5cd0('0x34')](_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x34')]));_0x5a222c[_0x5cd0('0x33')]=_0x5a222c['attributes'][_0x5cd0('0x35')]?_0x5a222c[_0x5cd0('0x33')]:_0x5ef188[_0x5cd0('0x32')];if(!_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x36')](_0x5cd0('0x37'))){_0x5a222c[_0x5cd0('0x38')]=qs[_0x5cd0('0x38')](_0x2def5a[_0x5cd0('0x2e')]['limit']);_0x5a222c[_0x5cd0('0x1b')]=qs['offset'](_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x1b')]);}_0x5a222c[_0x5cd0('0x39')]=qs[_0x5cd0('0x3a')](_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x3a')]);_0x5a222c[_0x5cd0('0x3b')]=qs[_0x5cd0('0x30')](_[_0x5cd0('0x3c')](_0x2def5a[_0x5cd0('0x2e')],_0x5ef188[_0x5cd0('0x30')]),_0x3cdf03);if(_0x2def5a['query'][_0x5cd0('0x3d')]){_0x5a222c[_0x5cd0('0x3b')]=_[_0x5cd0('0x3e')](_0x5a222c[_0x5cd0('0x3b')],{'$or':_[_0x5cd0('0x2d')](_0x3cdf03,function(_0x38bcb8){if(_0x38bcb8[_0x5cd0('0x2b')]!==_0x5cd0('0x3f')){var _0x56baaa={};_0x56baaa[_0x38bcb8['name']]={'$like':'%'+_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x3d')]+'%'};return _0x56baaa;}})});}_0x5a222c=_['merge']({},_0x5a222c,_0x2def5a[_0x5cd0('0x40')]);var _0x3a1302={'where':_0x5a222c['where']};return db[_0x5cd0('0x41')][_0x5cd0('0x1a')](_0x3a1302)['then'](function(_0x578d45){_0xd4bcf[_0x5cd0('0x1a')]=_0x578d45;if(_0x2def5a[_0x5cd0('0x2e')][_0x5cd0('0x42')]){_0x5a222c[_0x5cd0('0x43')]=[{'all':!![]}];}return db[_0x5cd0('0x41')][_0x5cd0('0x44')](_0x5a222c);})[_0x5cd0('0x20')](function(_0x583a6e){_0xd4bcf[_0x5cd0('0x45')]=_0x583a6e;return _0xd4bcf;})[_0x5cd0('0x20')](respondWithFilteredResult(_0x26f0bc,_0x5a222c))[_0x5cd0('0x46')](handleError(_0x26f0bc,null));};exports['show']=function(_0xfc605f,_0x18acea){var _0x2a4bd4={'raw':![],'where':{'id':_0xfc605f[_0x5cd0('0x47')]['id']}},_0xe5f582={};_0xe5f582[_0x5cd0('0x32')]=_[_0x5cd0('0x2f')](db[_0x5cd0('0x41')][_0x5cd0('0x29')]);_0xe5f582[_0x5cd0('0x2e')]=_[_0x5cd0('0x2f')](_0xfc605f['query']);_0xe5f582['filters']=_['intersection'](_0xe5f582[_0x5cd0('0x32')],_0xe5f582['query']);_0x2a4bd4[_0x5cd0('0x33')]=_['intersection'](_0xe5f582[_0x5cd0('0x32')],qs[_0x5cd0('0x34')](_0xfc605f[_0x5cd0('0x2e')][_0x5cd0('0x34')]));_0x2a4bd4[_0x5cd0('0x33')]=_0x2a4bd4[_0x5cd0('0x33')][_0x5cd0('0x35')]?_0x2a4bd4[_0x5cd0('0x33')]:_0xe5f582[_0x5cd0('0x32')];if(_0xfc605f[_0x5cd0('0x2e')][_0x5cd0('0x42')]){_0x2a4bd4[_0x5cd0('0x43')]=[{'all':!![]}];}_0x2a4bd4=_[_0x5cd0('0x3e')]({},_0x2a4bd4,_0xfc605f[_0x5cd0('0x40')]);return db[_0x5cd0('0x41')][_0x5cd0('0x48')](_0x2a4bd4)[_0x5cd0('0x20')](handleEntityNotFound(_0x18acea,null))[_0x5cd0('0x20')](respondWithResult(_0x18acea,null))[_0x5cd0('0x46')](handleError(_0x18acea,null));};exports[_0x5cd0('0x49')]=function(_0x569ba3,_0x5a3ef8){return db['Trigger'][_0x5cd0('0x49')](_0x569ba3['body'],{})[_0x5cd0('0x20')](function(_0x1a1478){var _0x2fa7c8=_0x569ba3[_0x5cd0('0x4a')][_0x5cd0('0x22')]({'plain':!![]});if(!_0x2fa7c8)throw new Error(_0x5cd0('0x4b'));if(_0x2fa7c8[_0x5cd0('0x4c')]===_0x5cd0('0x4a')){var _0xe9bcd3=_0x1a1478[_0x5cd0('0x22')]({'plain':!![]});var _0xa839a9=_0x5cd0('0x23');return db[_0x5cd0('0x4d')][_0x5cd0('0x48')]({'where':{'name':_0xa839a9,'userProfileId':_0x2fa7c8[_0x5cd0('0x4e')]},'raw':!![]})['then'](function(_0x580d08){if(_0x580d08&&_0x580d08[_0x5cd0('0x4f')]===0x0){return db[_0x5cd0('0x50')][_0x5cd0('0x49')]({'name':_0xe9bcd3[_0x5cd0('0x27')],'resourceId':_0xe9bcd3['id'],'type':_0x580d08[_0x5cd0('0x27')],'sectionId':_0x580d08['id']},{})['then'](function(){return _0x1a1478;});}else{return _0x1a1478;}})[_0x5cd0('0x46')](function(_0x3259ff){logger[_0x5cd0('0x25')](_0x5cd0('0x51'),_0x3259ff);throw _0x3259ff;});}return _0x1a1478;})[_0x5cd0('0x20')](respondWithResult(_0x5a3ef8,0xc9))['catch'](handleError(_0x5a3ef8,null));};exports[_0x5cd0('0x52')]=function(_0x42af80,_0x3abddd){if(_0x42af80[_0x5cd0('0x53')]['id']){delete _0x42af80[_0x5cd0('0x53')]['id'];}return db[_0x5cd0('0x41')][_0x5cd0('0x48')]({'where':{'id':_0x42af80[_0x5cd0('0x47')]['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0x3abddd,null))['then'](saveUpdates(_0x42af80['body'],null))['then'](respondWithResult(_0x3abddd,null))[_0x5cd0('0x46')](handleError(_0x3abddd,null));};exports[_0x5cd0('0x21')]=function(_0x3fa260,_0xa8af9c){return db[_0x5cd0('0x41')]['find']({'where':{'id':_0x3fa260['params']['id']}})['then'](handleEntityNotFound(_0xa8af9c,null))[_0x5cd0('0x20')](removeEntity(_0xa8af9c,null))['catch'](handleError(_0xa8af9c,null));};exports['addAllCondition']=function(_0x39a23c,_0x44ac1a,_0xc3cf8a){if(_0x39a23c[_0x5cd0('0x53')]['id']){delete _0x39a23c[_0x5cd0('0x53')]['id'];}return db[_0x5cd0('0x41')][_0x5cd0('0x48')]({'where':{'id':_0x39a23c[_0x5cd0('0x47')]['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0x44ac1a,null))[_0x5cd0('0x20')](function(_0x1cf5a5){if(_0x1cf5a5){_0x39a23c[_0x5cd0('0x53')][_0x5cd0('0x54')]=_0x1cf5a5['id'];return db[_0x5cd0('0x55')][_0x5cd0('0x49')](_0x39a23c[_0x5cd0('0x53')]);}})[_0x5cd0('0x20')](respondWithResult(_0x44ac1a,null))['catch'](handleError(_0x44ac1a,null));};exports['addAnyCondition']=function(_0x52b669,_0x314498,_0x288f39){if(_0x52b669[_0x5cd0('0x53')]['id']){delete _0x52b669[_0x5cd0('0x53')]['id'];}return db[_0x5cd0('0x41')][_0x5cd0('0x48')]({'where':{'id':_0x52b669['params']['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0x314498,null))[_0x5cd0('0x20')](function(_0x408c18){if(_0x408c18){_0x52b669[_0x5cd0('0x53')][_0x5cd0('0x56')]=_0x408c18['id'];return db[_0x5cd0('0x55')][_0x5cd0('0x49')](_0x52b669['body']);}})[_0x5cd0('0x20')](respondWithResult(_0x314498,null))[_0x5cd0('0x46')](handleError(_0x314498,null));};exports[_0x5cd0('0x57')]=function(_0x4823fd,_0xcef18f,_0x2b59c1){var _0x2be45e={};var _0x452ddc={};var _0x2bb944;var _0x1521f0;return db[_0x5cd0('0x41')][_0x5cd0('0x58')]({'where':{'id':_0x4823fd[_0x5cd0('0x47')]['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0xcef18f,null))[_0x5cd0('0x20')](function(_0x18d6fd){if(_0x18d6fd){_0x2bb944=_0x18d6fd;_0x452ddc['model']=_[_0x5cd0('0x2f')](db[_0x5cd0('0x55')]['rawAttributes']);_0x452ddc['query']=_[_0x5cd0('0x2f')](_0x4823fd['query']);_0x452ddc[_0x5cd0('0x30')]=_[_0x5cd0('0x31')](_0x452ddc[_0x5cd0('0x32')],_0x452ddc[_0x5cd0('0x2e')]);_0x2be45e[_0x5cd0('0x33')]=_[_0x5cd0('0x31')](_0x452ddc[_0x5cd0('0x32')],qs[_0x5cd0('0x34')](_0x4823fd[_0x5cd0('0x2e')][_0x5cd0('0x34')]));_0x2be45e[_0x5cd0('0x33')]=_0x2be45e[_0x5cd0('0x33')][_0x5cd0('0x35')]?_0x2be45e[_0x5cd0('0x33')]:_0x452ddc[_0x5cd0('0x32')];_0x2be45e[_0x5cd0('0x39')]=qs[_0x5cd0('0x3a')](_0x4823fd['query'][_0x5cd0('0x3a')]);_0x2be45e[_0x5cd0('0x3b')]=qs[_0x5cd0('0x30')](_[_0x5cd0('0x3c')](_0x4823fd[_0x5cd0('0x2e')],_0x452ddc[_0x5cd0('0x30')]));if(_0x4823fd[_0x5cd0('0x2e')][_0x5cd0('0x3d')]){_0x2be45e[_0x5cd0('0x3b')]=_['merge'](_0x2be45e['where'],{'$or':_[_0x5cd0('0x2d')](_0x2be45e[_0x5cd0('0x33')],function(_0x292636){var _0x268574={};_0x268574[_0x292636]={'$like':'%'+_0x4823fd[_0x5cd0('0x2e')][_0x5cd0('0x3d')]+'%'};return _0x268574;})});}_0x2be45e=_['merge']({},_0x2be45e,_0x4823fd['options']);return _0x2bb944['getAllConditions'](_0x2be45e);}})[_0x5cd0('0x20')](function(_0x4a0fa5){if(_0x4a0fa5){_0x1521f0=_0x4a0fa5[_0x5cd0('0x35')];if(!_0x4823fd[_0x5cd0('0x2e')][_0x5cd0('0x36')](_0x5cd0('0x37'))){_0x2be45e['limit']=qs[_0x5cd0('0x38')](_0x4823fd['query'][_0x5cd0('0x38')]);_0x2be45e[_0x5cd0('0x1b')]=qs['offset'](_0x4823fd[_0x5cd0('0x2e')][_0x5cd0('0x1b')]);}return _0x2bb944[_0x5cd0('0x57')](_0x2be45e);}})[_0x5cd0('0x20')](function(_0x58bccf){if(_0x58bccf){return _0x58bccf?{'count':_0x1521f0,'rows':_0x58bccf}:null;}})[_0x5cd0('0x20')](respondWithResult(_0xcef18f,null))[_0x5cd0('0x46')](handleError(_0xcef18f,null));};exports[_0x5cd0('0x59')]=function(_0x15cce6,_0x1ed97d,_0x582ec7){var _0x42bd13={};var _0x5d686c={};var _0x796444;var _0x111912;return db[_0x5cd0('0x41')][_0x5cd0('0x58')]({'where':{'id':_0x15cce6[_0x5cd0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ed97d,null))[_0x5cd0('0x20')](function(_0xdad924){if(_0xdad924){_0x796444=_0xdad924;_0x5d686c['model']=_['keys'](db['Condition'][_0x5cd0('0x29')]);_0x5d686c[_0x5cd0('0x2e')]=_[_0x5cd0('0x2f')](_0x15cce6[_0x5cd0('0x2e')]);_0x5d686c['filters']=_[_0x5cd0('0x31')](_0x5d686c[_0x5cd0('0x32')],_0x5d686c['query']);_0x42bd13[_0x5cd0('0x33')]=_[_0x5cd0('0x31')](_0x5d686c[_0x5cd0('0x32')],qs[_0x5cd0('0x34')](_0x15cce6[_0x5cd0('0x2e')][_0x5cd0('0x34')]));_0x42bd13['attributes']=_0x42bd13[_0x5cd0('0x33')][_0x5cd0('0x35')]?_0x42bd13[_0x5cd0('0x33')]:_0x5d686c[_0x5cd0('0x32')];_0x42bd13[_0x5cd0('0x39')]=qs[_0x5cd0('0x3a')](_0x15cce6[_0x5cd0('0x2e')][_0x5cd0('0x3a')]);_0x42bd13['where']=qs[_0x5cd0('0x30')](_[_0x5cd0('0x3c')](_0x15cce6[_0x5cd0('0x2e')],_0x5d686c[_0x5cd0('0x30')]));if(_0x15cce6[_0x5cd0('0x2e')]['filter']){_0x42bd13[_0x5cd0('0x3b')]=_[_0x5cd0('0x3e')](_0x42bd13[_0x5cd0('0x3b')],{'$or':_[_0x5cd0('0x2d')](_0x42bd13['attributes'],function(_0xd6f887){var _0x1b4362={};_0x1b4362[_0xd6f887]={'$like':'%'+_0x15cce6[_0x5cd0('0x2e')][_0x5cd0('0x3d')]+'%'};return _0x1b4362;})});}_0x42bd13=_['merge']({},_0x42bd13,_0x15cce6[_0x5cd0('0x40')]);return _0x796444[_0x5cd0('0x59')](_0x42bd13);}})[_0x5cd0('0x20')](function(_0x9aa29){if(_0x9aa29){_0x111912=_0x9aa29['length'];if(!_0x15cce6['query'][_0x5cd0('0x36')](_0x5cd0('0x37'))){_0x42bd13[_0x5cd0('0x38')]=qs[_0x5cd0('0x38')](_0x15cce6[_0x5cd0('0x2e')][_0x5cd0('0x38')]);_0x42bd13[_0x5cd0('0x1b')]=qs['offset'](_0x15cce6[_0x5cd0('0x2e')][_0x5cd0('0x1b')]);}return _0x796444[_0x5cd0('0x59')](_0x42bd13);}})['then'](function(_0x4ce282){if(_0x4ce282){return _0x4ce282?{'count':_0x111912,'rows':_0x4ce282}:null;}})[_0x5cd0('0x20')](respondWithResult(_0x1ed97d,null))[_0x5cd0('0x46')](handleError(_0x1ed97d,null));};exports['addAction']=function(_0x4146a1,_0x19601d,_0x37b8c5){if(_0x4146a1[_0x5cd0('0x53')]['id']){delete _0x4146a1[_0x5cd0('0x53')]['id'];}return db['Trigger'][_0x5cd0('0x48')]({'where':{'id':_0x4146a1['params']['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0x19601d,null))['then'](function(_0x5cabbf){if(_0x5cabbf){_0x4146a1[_0x5cd0('0x53')][_0x5cd0('0x5a')]=_0x5cabbf['id'];return db['Action'][_0x5cd0('0x49')](_0x4146a1[_0x5cd0('0x53')]);}})[_0x5cd0('0x20')](respondWithResult(_0x19601d,null))[_0x5cd0('0x46')](handleError(_0x19601d,null));};exports['getActions']=function(_0x61a9cd,_0x29d6fa,_0x4a3dc6){var _0x5b5c41={};var _0x22e7c8={};var _0x1e4947;var _0x21fb48;return db[_0x5cd0('0x41')][_0x5cd0('0x58')]({'where':{'id':_0x61a9cd['params']['id']}})[_0x5cd0('0x20')](handleEntityNotFound(_0x29d6fa,null))[_0x5cd0('0x20')](function(_0x311054){if(_0x311054){_0x1e4947=_0x311054;_0x22e7c8['model']=_[_0x5cd0('0x2f')](db[_0x5cd0('0x5b')][_0x5cd0('0x29')]);_0x22e7c8[_0x5cd0('0x2e')]=_['keys'](_0x61a9cd[_0x5cd0('0x2e')]);_0x22e7c8[_0x5cd0('0x30')]=_[_0x5cd0('0x31')](_0x22e7c8['model'],_0x22e7c8[_0x5cd0('0x2e')]);_0x5b5c41[_0x5cd0('0x33')]=_[_0x5cd0('0x31')](_0x22e7c8[_0x5cd0('0x32')],qs[_0x5cd0('0x34')](_0x61a9cd[_0x5cd0('0x2e')][_0x5cd0('0x34')]));_0x5b5c41[_0x5cd0('0x33')]=_0x5b5c41[_0x5cd0('0x33')][_0x5cd0('0x35')]?_0x5b5c41[_0x5cd0('0x33')]:_0x22e7c8[_0x5cd0('0x32')];_0x5b5c41['order']=qs[_0x5cd0('0x3a')](_0x61a9cd[_0x5cd0('0x2e')]['sort']);_0x5b5c41['where']=qs[_0x5cd0('0x30')](_['pick'](_0x61a9cd[_0x5cd0('0x2e')],_0x22e7c8[_0x5cd0('0x30')]));if(_0x61a9cd[_0x5cd0('0x2e')][_0x5cd0('0x3d')]){_0x5b5c41[_0x5cd0('0x3b')]=_[_0x5cd0('0x3e')](_0x5b5c41['where'],{'$or':_['map'](_0x5b5c41[_0x5cd0('0x33')],function(_0x2d569b){var _0x281238={};_0x281238[_0x2d569b]={'$like':'%'+_0x61a9cd['query']['filter']+'%'};return _0x281238;})});}_0x5b5c41=_[_0x5cd0('0x3e')]({},_0x5b5c41,_0x61a9cd[_0x5cd0('0x40')]);return _0x1e4947[_0x5cd0('0x5c')](_0x5b5c41);}})[_0x5cd0('0x20')](function(_0x7d45f0){if(_0x7d45f0){_0x21fb48=_0x7d45f0[_0x5cd0('0x35')];if(!_0x61a9cd[_0x5cd0('0x2e')][_0x5cd0('0x36')](_0x5cd0('0x37'))){_0x5b5c41[_0x5cd0('0x38')]=qs['limit'](_0x61a9cd[_0x5cd0('0x2e')][_0x5cd0('0x38')]);_0x5b5c41['offset']=qs['offset'](_0x61a9cd['query'][_0x5cd0('0x1b')]);}return _0x1e4947['getActions'](_0x5b5c41);}})[_0x5cd0('0x20')](function(_0x4ed874){if(_0x4ed874){return _0x4ed874?{'count':_0x21fb48,'rows':_0x4ed874}:null;}})[_0x5cd0('0x20')](respondWithResult(_0x29d6fa,null))[_0x5cd0('0x46')](handleError(_0x29d6fa,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 2631cf9..eb5775f 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 _0x7849=['../../config/logger','api','bluebird','request-promise','path','rimraf','./trigger.attributes','exports','tools_triggers','util'];(function(_0x4a42f0,_0x2da65d){var _0x3dc532=function(_0xb60cdf){while(--_0xb60cdf){_0x4a42f0['push'](_0x4a42f0['shift']());}};_0x3dc532(++_0x2da65d);}(_0x7849,0x1f3));var _0x9784=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7849[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9784('0x0'));var logger=require(_0x9784('0x1'))(_0x9784('0x2'));var moment=require('moment');var BPromise=require(_0x9784('0x3'));var rp=require(_0x9784('0x4'));var fs=require('fs');var path=require(_0x9784('0x5'));var rimraf=require(_0x9784('0x6'));var config=require('../../config/environment');var attributes=require(_0x9784('0x7'));module[_0x9784('0x8')]=function(_0x59f8ed,_0x48691c){return _0x59f8ed['define']('Trigger',attributes,{'tableName':_0x9784('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf9e=['../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','api','request-promise','path'];(function(_0x3c95b3,_0x11fa43){var _0xce52c=function(_0x5c626c){while(--_0x5c626c){_0x3c95b3['push'](_0x3c95b3['shift']());}};_0xce52c(++_0x11fa43);}(_0xdf9e,0x177));var _0xedf9=function(_0x2b70bb,_0x49e53a){_0x2b70bb=_0x2b70bb-0x0;var _0x2a4eaa=_0xdf9e[_0x2b70bb];return _0x2a4eaa;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xedf9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xedf9('0x1'));var fs=require('fs');var path=require(_0xedf9('0x2'));var rimraf=require('rimraf');var config=require(_0xedf9('0x3'));var attributes=require(_0xedf9('0x4'));module[_0xedf9('0x5')]=function(_0x5b4158,_0x30f807){return _0x5b4158[_0xedf9('0x6')](_0xedf9('0x7'),attributes,{'tableName':_0xedf9('0x8'),'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 bea2799..9bb12f1 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 _0xe820=['findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowTrigger','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger'];(function(_0x5b978c,_0x3c81f6){var _0x544967=function(_0x4b7719){while(--_0x4b7719){_0x5b978c['push'](_0x5b978c['shift']());}};_0x544967(++_0x3c81f6);}(_0xe820,0xd2));var _0x0e82=function(_0x412a6d,_0x5e824b){_0x412a6d=_0x412a6d-0x0;var _0x1006d2=_0xe820[_0x412a6d];return _0x1006d2;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('Trigger,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')]({'raw':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x18')]||null:null,'attributes':_0x53622b['options']?_0x53622b['options'][_0x0e82('0x19')]||null:null,'limit':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1a')]||null:null,'include':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x53622b['options'][_0x0e82('0x1b')],function(_0x13f023){return{'model':db[_0x13f023[_0x0e82('0x1d')]],'as':_0x13f023['as'],'attributes':_0x13f023[_0x0e82('0x19')],'include':_0x13f023['include']?_[_0x0e82('0x1c')](_0x13f023[_0x0e82('0x1b')],function(_0x7a9399){return{'model':db[_0x7a9399[_0x0e82('0x1d')]],'as':_0x7a9399['as'],'attributes':_0x7a9399['attributes'],'include':_0x7a9399[_0x0e82('0x1b')]?_['map'](_0x7a9399['include'],function(_0x384f88){return{'model':db[_0x384f88[_0x0e82('0x1d')]],'as':_0x384f88['as'],'attributes':_0x384f88['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0xe3c530){logger[_0x0e82('0x1e')]('GetTrigger',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON['stringify'](_0xe3c530));_0x310aac(_0xe3c530);})[_0x0e82('0x1f')](function(_0x59a5b6){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0x59a5b6['message'],_0x53622b);_0x3a3ddf(_0x25ac21[_0x0e82('0x10')](0x1f4,_0x59a5b6[_0x0e82('0x12')]));});});};exports[_0x0e82('0x20')]=function(_0x4d74d0){var _0x50adb7=this;return new Promise(function(_0x2dc021,_0x4a8c43){return db[_0x0e82('0x14')]['find']({'raw':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x4d74d0['options']?_0x4d74d0[_0x0e82('0x16')]['where']||null:null,'attributes':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x19')]||null:null,'include':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')]?_['map'](_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')],function(_0x34c914){return{'model':db[_0x34c914[_0x0e82('0x1d')]],'as':_0x34c914['as'],'attributes':_0x34c914[_0x0e82('0x19')],'include':_0x34c914[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x34c914[_0x0e82('0x1b')],function(_0xfd7924){return{'model':db[_0xfd7924[_0x0e82('0x1d')]],'as':_0xfd7924['as'],'attributes':_0xfd7924[_0x0e82('0x19')],'include':_0xfd7924[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0xfd7924[_0x0e82('0x1b')],function(_0x21dd97){return{'model':db[_0x21dd97['model']],'as':_0x21dd97['as'],'attributes':_0x21dd97[_0x0e82('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0x3be8e8){logger[_0x0e82('0x1e')]('ShowTrigger',_0x4d74d0);logger[_0x0e82('0xd')](_0x0e82('0x20'),_0x4d74d0,JSON['stringify'](_0x3be8e8));_0x2dc021(_0x3be8e8);})[_0x0e82('0x1f')](function(_0x57e505){logger['error'](_0x0e82('0x20'),_0x57e505[_0x0e82('0x12')],_0x4d74d0);_0x4a8c43(_0x50adb7[_0x0e82('0x10')](0x1f4,_0x57e505[_0x0e82('0x12')]));});});}; \ No newline at end of file +var _0x087b=['find','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','findAll','options','raw','attributes','limit','map','include','model','GetTrigger','catch','ShowTrigger'];(function(_0x1bbb03,_0x18c084){var _0x1ae659=function(_0x388937){while(--_0x388937){_0x1bbb03['push'](_0x1bbb03['shift']());}};_0x1ae659(++_0x18c084);}(_0x087b,0x11a));var _0xb087=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x087b[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('Trigger,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['GetTrigger']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['Trigger'][_0xb087('0x16')]({'raw':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')][_0xb087('0x18')]===undefined?!![]:![]:!![],'where':_0x330005['options']?_0x330005['options']['where']||null:null,'attributes':_0x330005['options']?_0x330005[_0xb087('0x17')][_0xb087('0x19')]||null:null,'limit':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')][_0xb087('0x1a')]||null:null,'include':_0x330005[_0xb087('0x17')]?_0x330005[_0xb087('0x17')]['include']?_[_0xb087('0x1b')](_0x330005[_0xb087('0x17')][_0xb087('0x1c')],function(_0x1cfb3e){return{'model':db[_0x1cfb3e[_0xb087('0x1d')]],'as':_0x1cfb3e['as'],'attributes':_0x1cfb3e['attributes'],'include':_0x1cfb3e[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x1cfb3e['include'],function(_0x5a2dc6){return{'model':db[_0x5a2dc6['model']],'as':_0x5a2dc6['as'],'attributes':_0x5a2dc6['attributes'],'include':_0x5a2dc6['include']?_[_0xb087('0x1b')](_0x5a2dc6[_0xb087('0x1c')],function(_0x1d124f){return{'model':db[_0x1d124f[_0xb087('0x1d')]],'as':_0x1d124f['as'],'attributes':_0x1d124f[_0xb087('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb087('0xc')](function(_0xf3f41f){logger[_0xb087('0xd')](_0xb087('0x1e'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x1e'),_0x330005,JSON[_0xb087('0x11')](_0xf3f41f));_0x17200d(_0xf3f41f);})[_0xb087('0x1f')](function(_0x263259){logger['error'](_0xb087('0x1e'),_0x263259[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x263259[_0xb087('0x14')]));});});};exports[_0xb087('0x20')]=function(_0xa6d90c){var _0x2e1c57=this;return new Promise(function(_0x13fb2f,_0x53a535){return db['Trigger'][_0xb087('0x21')]({'raw':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c['options'][_0xb087('0x18')]===undefined?!![]:![]:!![],'where':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x22')]||null:null,'attributes':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x19')]||null:null,'include':_0xa6d90c[_0xb087('0x17')]?_0xa6d90c[_0xb087('0x17')][_0xb087('0x1c')]?_[_0xb087('0x1b')](_0xa6d90c[_0xb087('0x17')]['include'],function(_0x3bec03){return{'model':db[_0x3bec03['model']],'as':_0x3bec03['as'],'attributes':_0x3bec03[_0xb087('0x19')],'include':_0x3bec03[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x3bec03[_0xb087('0x1c')],function(_0x13cb5d){return{'model':db[_0x13cb5d[_0xb087('0x1d')]],'as':_0x13cb5d['as'],'attributes':_0x13cb5d[_0xb087('0x19')],'include':_0x13cb5d[_0xb087('0x1c')]?_[_0xb087('0x1b')](_0x13cb5d['include'],function(_0x5814c2){return{'model':db[_0x5814c2[_0xb087('0x1d')]],'as':_0x5814c2['as'],'attributes':_0x5814c2[_0xb087('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb087('0xc')](function(_0x2d2902){logger[_0xb087('0xd')]('ShowTrigger',_0xa6d90c);logger[_0xb087('0xf')](_0xb087('0x20'),_0xa6d90c,JSON['stringify'](_0x2d2902));_0x13fb2f(_0x2d2902);})['catch'](function(_0x1726c2){logger[_0xb087('0x12')](_0xb087('0x20'),_0x1726c2['message'],_0xa6d90c);_0x53a535(_0x2e1c57[_0xb087('0x12')](0x1f4,_0x1726c2[_0xb087('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 12dc79f..41fb8fc 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 _0x9957=['/:id/clone','clone','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x5c3fff,_0x413d8f){var _0x2cb058=function(_0x41ae3e){while(--_0x41ae3e){_0x5c3fff['push'](_0x5c3fff['shift']());}};_0x2cb058(++_0x413d8f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./trunk.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')](_0x7995('0xd'),auth['isAuthenticated'](),controller[_0x7995('0xe')]);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['update']);router[_0x7995('0x11')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);module[_0x7995('0x13')]=router; \ No newline at end of file +var _0x5636=['put','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone'];(function(_0x511d5c,_0x4d44a0){var _0x128d3b=function(_0x271de6){while(--_0x271de6){_0x511d5c['push'](_0x511d5c['shift']());}};_0x128d3b(++_0x4d44a0);}(_0x5636,0x102));var _0x6563=function(_0x527483,_0x282761){_0x527483=_0x527483-0x0;var _0x1d3c7b=_0x5636[_0x527483];return _0x1d3c7b;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var auth=require(_0x6563('0x3'));var interaction=require(_0x6563('0x4'));var config=require('../../config/environment');var controller=require(_0x6563('0x5'));router[_0x6563('0x6')]('/',auth[_0x6563('0x7')](),controller[_0x6563('0x8')]);router[_0x6563('0x6')](_0x6563('0x9'),auth[_0x6563('0x7')](),controller[_0x6563('0xa')]);router[_0x6563('0xb')](_0x6563('0xc'),auth[_0x6563('0x7')](),controller[_0x6563('0xd')]);router[_0x6563('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6563('0xe')](_0x6563('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6563('0x9'),auth[_0x6563('0x7')](),controller[_0x6563('0xf')]);module[_0x6563('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index bcac3fb..1fa3ee8 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 _0x8098=['originate','uac','pai','fingerprint','passive','actpass','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','accept'];(function(_0x1493aa,_0x577979){var _0x9230bb=function(_0x3ba658){while(--_0x3ba658){_0x1493aa['push'](_0x1493aa['shift']());}};_0x9230bb(++_0x577979);}(_0x8098,0x1b8));var _0x8809=function(_0x37a014,_0x14315d){_0x37a014=_0x37a014-0x0;var _0x47f358=_0x8098[_0x37a014];return _0x47f358;};'use strict';var Sequelize=require('sequelize');module[_0x8809('0x0')]={'name':{'type':Sequelize[_0x8809('0x1')],'allowNull':![],'unique':_0x8809('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8809('0x3')]('friend',_0x8809('0x4'),'peer'),'allowNull':![],'defaultValue':_0x8809('0x5')},'context':{'type':Sequelize[_0x8809('0x1')],'allowNull':![],'defaultValue':_0x8809('0x6')},'callingpres':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x7'),_0x8809('0x8'),_0x8809('0x9'),_0x8809('0xa'),_0x8809('0xb'),_0x8809('0xc'),_0x8809('0xd'),_0x8809('0xe'))},'deny':{'type':Sequelize[_0x8809('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x8809('0x1')]},'md5secret':{'type':Sequelize[_0x8809('0x1')]},'remotesecret':{'type':Sequelize[_0x8809('0x1')]},'transport':{'type':Sequelize[_0x8809('0x1')],'defaultValue':_0x8809('0xf'),'set':function(_0x10d8d5){this[_0x8809('0x10')]('transport',_0x10d8d5?_0x10d8d5[_0x8809('0x11')](','):null);},'get':function(){return this[_0x8809('0x12')](_0x8809('0x13'))?this[_0x8809('0x12')](_0x8809('0x13'))[_0x8809('0x14')](','):null;},'comment':_0x8809('0x15')},'dtmfmode':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x16'),_0x8809('0x17'),'shortinfo','inband',_0x8809('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x8809('0x19'),'no','nonat',_0x8809('0x1a'),_0x8809('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x8809('0x1')],'defaultValue':_0x8809('0x1c'),'set':function(_0x56ccfc){this[_0x8809('0x10')](_0x8809('0x1d'),_0x56ccfc?_0x56ccfc[_0x8809('0x11')](','):null);},'get':function(){return this[_0x8809('0x12')](_0x8809('0x1d'))?this[_0x8809('0x12')](_0x8809('0x1d'))['split'](','):null;},'comment':_0x8809('0x1e')},'callgroup':{'type':Sequelize[_0x8809('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x8809('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x8809('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x8809('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x8809('0x1')],'defaultValue':_0x8809('0x1f')},'allow':{'type':Sequelize[_0x8809('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x41276b){this['setDataValue']('allow',_0x41276b?_0x41276b[_0x8809('0x11')](';'):_0x8809('0x20'));},'get':function(){return this[_0x8809('0x12')](_0x8809('0x21'))?this['getDataValue'](_0x8809('0x21'))[_0x8809('0x14')](';'):null;},'comment':_0x8809('0x22')},'autoframing':{'type':Sequelize[_0x8809('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x8809('0x1')],'defaultValue':_0x8809('0x23'),'set':function(_0x59e173){this['setDataValue'](_0x8809('0x24'),_0x59e173?_0x59e173['join'](','):null);},'get':function(){return this[_0x8809('0x12')](_0x8809('0x24'))?this[_0x8809('0x12')](_0x8809('0x24'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8809('0x3')]('yes','no',_0x8809('0x25'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x8809('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x8809('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x8809('0x3')]('yes','no'),'defaultValue':_0x8809('0x19')},'busylevel':{'type':Sequelize[_0x8809('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x8809('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x8809('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x8809('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8809('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'mailbox':{'type':Sequelize[_0x8809('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x8809('0x27'),'refuse',_0x8809('0x28'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x29'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x8809('0x1')]},'fromdomain':{'type':Sequelize[_0x8809('0x1')]},'fromuser':{'type':Sequelize[_0x8809('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x8809('0x3')]('yes','no'),'defaultValue':_0x8809('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x8809('0x1')]},'defaultuser':{'type':Sequelize[_0x8809('0x1')]},'rtptimeout':{'type':Sequelize[_0x8809('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8809('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no',_0x8809('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8809('0x1')]},'callbackextension':{'type':Sequelize[_0x8809('0x1')]},'timert1':{'type':Sequelize[_0x8809('0x26')](0xb)},'timerb':{'type':Sequelize[_0x8809('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x8809('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x8809('0x1')]},'contactdeny':{'type':Sequelize[_0x8809('0x1')]},'contactacl':{'type':Sequelize[_0x8809('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x8809('0x26')](0xb)},'encryption':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'force_avp':{'type':Sequelize[_0x8809('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no',_0x8809('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x8809('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x8809('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x8809('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8809('0x3')]('active',_0x8809('0x2c'),_0x8809('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8809('0x1')]},'usereqphone':{'type':Sequelize[_0x8809('0x3')](_0x8809('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8809('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x8809('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8809('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x8809('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x8809('0x1')]},'mohinterpret':{'type':Sequelize[_0x8809('0x1')]},'mohsuggest':{'type':Sequelize[_0x8809('0x1')]},'parkinglot':{'type':Sequelize[_0x8809('0x1')]},'description':{'type':Sequelize[_0x8809('0x1')]},'host':{'type':Sequelize[_0x8809('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x8809('0x3')]('yes','no','nonat',_0x8809('0x1a'),_0x8809('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x8809('0x1')]},'otherFields':{'type':Sequelize[_0x8809('0x1')]},'active':{'type':Sequelize[_0x8809('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8809('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1e10=['yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','nonat','update'];(function(_0x43dfb7,_0x1f5b0a){var _0x4f6af6=function(_0x2d6aec){while(--_0x2d6aec){_0x43dfb7['push'](_0x43dfb7['shift']());}};_0x4f6af6(++_0x1f5b0a);}(_0x1e10,0x10e));var _0x01e1=function(_0x31e4fc,_0x3372f7){_0x31e4fc=_0x31e4fc-0x0;var _0x3ed572=_0x1e10[_0x31e4fc];return _0x3ed572;};'use strict';var Sequelize=require(_0x01e1('0x0'));module[_0x01e1('0x1')]={'name':{'type':Sequelize[_0x01e1('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x01e1('0x3'),_0x01e1('0x4'),_0x01e1('0x5')),'allowNull':![],'defaultValue':_0x01e1('0x3')},'context':{'type':Sequelize[_0x01e1('0x2')],'allowNull':![],'defaultValue':_0x01e1('0x6')},'callingpres':{'type':Sequelize[_0x01e1('0x7')]('ALLOWED_NOT_SCREENED',_0x01e1('0x8'),'ALLOWED_FAILED_SCREEN',_0x01e1('0x9'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x01e1('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0x01e1('0x2')]},'permit':{'type':Sequelize[_0x01e1('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x01e1('0x2')]},'remotesecret':{'type':Sequelize[_0x01e1('0x2')]},'transport':{'type':Sequelize[_0x01e1('0x2')],'defaultValue':_0x01e1('0xb'),'set':function(_0x1bc1b8){this[_0x01e1('0xc')](_0x01e1('0xd'),_0x1bc1b8?_0x1bc1b8[_0x01e1('0xe')](','):null);},'get':function(){return this[_0x01e1('0xf')](_0x01e1('0xd'))?this[_0x01e1('0xf')](_0x01e1('0xd'))[_0x01e1('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x11'),_0x01e1('0x12'),_0x01e1('0x13'),_0x01e1('0x14'),_0x01e1('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x01e1('0x7')]('yes','no',_0x01e1('0x16'),_0x01e1('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x01e1('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x01e1('0x19'),'set':function(_0x584a88){this['setDataValue'](_0x01e1('0x1a'),_0x584a88?_0x584a88[_0x01e1('0xe')](','):null);},'get':function(){return this[_0x01e1('0xf')](_0x01e1('0x1a'))?this[_0x01e1('0xf')](_0x01e1('0x1a'))[_0x01e1('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x01e1('0x2')]},'namedcallgroup':{'type':Sequelize[_0x01e1('0x2')]},'pickupgroup':{'type':Sequelize[_0x01e1('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x01e1('0x2')]},'language':{'type':Sequelize[_0x01e1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x01e1('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x01e1('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x01e1('0x1c'),'set':function(_0x1eed60){this[_0x01e1('0xc')](_0x01e1('0x1d'),_0x1eed60?_0x1eed60['join'](';'):_0x01e1('0x1c'));},'get':function(){return this[_0x01e1('0xf')]('allow')?this[_0x01e1('0xf')](_0x01e1('0x1d'))[_0x01e1('0x10')](';'):null;},'comment':_0x01e1('0x1e')},'autoframing':{'type':Sequelize[_0x01e1('0x7')]('yes','no')},'insecure':{'type':Sequelize[_0x01e1('0x2')],'defaultValue':_0x01e1('0x1f'),'set':function(_0x4c28ba){this['setDataValue'](_0x01e1('0x20'),_0x4c28ba?_0x4c28ba['join'](','):null);},'get':function(){return this[_0x01e1('0xf')](_0x01e1('0x20'))?this[_0x01e1('0xf')]('insecure')['split'](','):null;},'comment':_0x01e1('0x21')},'trustrpid':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no',_0x01e1('0x22'))},'promiscredir':{'type':Sequelize[_0x01e1('0x7')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x01e1('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x01e1('0x2')]},'callcounter':{'type':Sequelize[_0x01e1('0x7')]('yes','no'),'defaultValue':_0x01e1('0x18')},'busylevel':{'type':Sequelize[_0x01e1('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no',_0x01e1('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x01e1('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'mailbox':{'type':Sequelize[_0x01e1('0x2')]},'session_timers':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x25'),_0x01e1('0x26'),_0x01e1('0x27'))},'session_expires':{'type':Sequelize[_0x01e1('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x01e1('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x01e1('0x28'),_0x01e1('0x29')),'defaultValue':_0x01e1('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x01e1('0x2')]},'regexten':{'type':Sequelize[_0x01e1('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x01e1('0x23')](0x5)},'qualify':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x01e1('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x01e1('0x2')]},'defaultuser':{'type':Sequelize[_0x01e1('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x01e1('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x01e1('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x01e1('0x2')]},'callbackextension':{'type':Sequelize[_0x01e1('0x2')]},'timert1':{'type':Sequelize[_0x01e1('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x01e1('0x2')]},'contactdeny':{'type':Sequelize[_0x01e1('0x2')]},'contactacl':{'type':Sequelize[_0x01e1('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x01e1('0x2')]},'use_q850_reason':{'type':Sequelize[_0x01e1('0x2')]},'maxforwards':{'type':Sequelize[_0x01e1('0x23')](0xb)},'encryption':{'type':Sequelize[_0x01e1('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no')},'force_avp':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'icesupport':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no',_0x01e1('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x01e1('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x01e1('0x2')]},'dtlscipher':{'type':Sequelize[_0x01e1('0x2')]},'dtlscafile':{'type':Sequelize[_0x01e1('0x2')]},'dtlscapath':{'type':Sequelize[_0x01e1('0x2')]},'dtlssetup':{'type':Sequelize[_0x01e1('0x7')](_0x01e1('0x2c'),_0x01e1('0x2d'),_0x01e1('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x01e1('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x01e1('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x01e1('0x2')]},'call_limit':{'type':Sequelize[_0x01e1('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x01e1('0x7')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x01e1('0x7')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x01e1('0x2')]},'mohsuggest':{'type':Sequelize[_0x01e1('0x2')]},'parkinglot':{'type':Sequelize[_0x01e1('0x2')]},'description':{'type':Sequelize[_0x01e1('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x01e1('0x2f')},'canreinvite':{'type':Sequelize[_0x01e1('0x7')]('yes','no','nonat',_0x01e1('0x17'),_0x01e1('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x01e1('0x2')]},'otherFields':{'type':Sequelize[_0x01e1('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 838ce67..8915a4f 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 _0xcbe1=['then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','count','offset','limit','set','json','apply','reject','update','destroy','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','Trunk','rows','show','params','includeAll','include','options','find','clone','get','omit','createdAt','body','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','eml-format','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','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'];(function(_0x20997e,_0x161121){var _0x198438=function(_0x55561f){while(--_0x55561f){_0x20997e['push'](_0x20997e['shift']());}};_0x198438(++_0x161121);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x59cdd0,_0x56af37){_0x59cdd0=_0x59cdd0-0x0;var _0x41bf3d=_0xcbe1[_0x59cdd0];return _0x41bf3d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1cbe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1cbe('0x1'));var BPromise=require(_0x1cbe('0x2'));var Mustache=require('mustache');var util=require(_0x1cbe('0x3'));var path=require('path');var sox=require(_0x1cbe('0x4'));var csv=require(_0x1cbe('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1cbe('0x6'));var squel=require(_0x1cbe('0x7'));var crypto=require(_0x1cbe('0x8'));var jsforce=require(_0x1cbe('0x9'));var deskjs=require(_0x1cbe('0xa'));var toCsv=require(_0x1cbe('0x5'));var querystring=require(_0x1cbe('0xb'));var Papa=require(_0x1cbe('0xc'));var Redis=require('ioredis');var authService=require(_0x1cbe('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1cbe('0xe'));var hardwareService=require(_0x1cbe('0xf'));var logger=require(_0x1cbe('0x10'))(_0x1cbe('0x11'));var utils=require('../../config/utils');var config=require(_0x1cbe('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1cbe('0x13'));var client=jayson[_0x1cbe('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x42da0e,_0x2cc9a2,_0x3edda6){if(_0x3edda6){var _0x50e749=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50e749[_0x1cbe('0x15')](_0x2cc9a2)){return _0x42da0e;}else{throw new db[(_0x1cbe('0x16'))][(_0x1cbe('0x17'))](_0x1cbe('0x18'));}}else{return _0x42da0e;}}function respondWithRpcPromise(_0x47303f,_0x14784f,_0x3eb11f,_0x25093a){return new BPromise(function(_0x109cd7,_0x41eec7){var _0x4fd646=_0x25093a||client;return _0x4fd646[_0x1cbe('0x19')](_0x47303f,_0x3eb11f)[_0x1cbe('0x1a')](function(_0x244a1d){logger['info'](_0x1cbe('0x1b'),_0x14784f,_0x1cbe('0x1c'));logger[_0x1cbe('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x14784f,'request\x20sent',JSON[_0x1cbe('0x1e')](_0x244a1d));if(_0x244a1d[_0x1cbe('0x1f')]){if(_0x244a1d[_0x1cbe('0x1f')][_0x1cbe('0x20')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x14784f,_0x244a1d[_0x1cbe('0x1f')][_0x1cbe('0x21')]);return _0x41eec7(_0x244a1d[_0x1cbe('0x1f')]['message']);}logger['error'](_0x1cbe('0x1b'),_0x14784f,_0x244a1d['error'][_0x1cbe('0x21')]);return _0x109cd7(_0x244a1d[_0x1cbe('0x1f')][_0x1cbe('0x21')]);}else{logger[_0x1cbe('0x22')](_0x1cbe('0x1b'),_0x14784f,_0x1cbe('0x1c'));_0x109cd7(_0x244a1d[_0x1cbe('0x23')][_0x1cbe('0x21')]);}})[_0x1cbe('0x24')](function(_0x4c7a82){logger[_0x1cbe('0x1f')]('Trunk,\x20%s,\x20%s',_0x14784f,_0x4c7a82);_0x41eec7(_0x4c7a82);});});}function respondWithStatusCode(_0x1fb6aa,_0x2208bd){_0x2208bd=_0x2208bd||0xcc;return function(_0x384845){if(_0x384845){return _0x1fb6aa['sendStatus'](_0x2208bd);}return _0x1fb6aa[_0x1cbe('0x25')](_0x2208bd)[_0x1cbe('0x26')]();};}function respondWithResult(_0x1b391d,_0x17cc57){_0x17cc57=_0x17cc57||0xc8;return function(_0xd9bb05){if(_0xd9bb05){return _0x1b391d[_0x1cbe('0x25')](_0x17cc57)['json'](_0xd9bb05);}};}function respondWithFilteredResult(_0x1d08b5,_0x367548){return function(_0x26fb19){if(_0x26fb19){var _0x5d781d=_0x26fb19[_0x1cbe('0x27')],_0x4c840e=_0x367548['offset'],_0xa30ec5=_0x367548[_0x1cbe('0x28')]+_0x367548[_0x1cbe('0x29')],_0x52d0d5;if(_0xa30ec5>=_0x5d781d){_0xa30ec5=_0x5d781d;_0x52d0d5=0xc8;}else{_0x52d0d5=0xce;}_0x1d08b5[_0x1cbe('0x25')](_0x52d0d5);return _0x1d08b5[_0x1cbe('0x2a')]('Content-Range',_0x4c840e+'-'+_0xa30ec5+'/'+_0x5d781d)[_0x1cbe('0x2b')](_0x26fb19);}return null;};}function patchUpdates(_0x1fa764){return function(_0x2f0888){try{jsonpatch[_0x1cbe('0x2c')](_0x2f0888,_0x1fa764,!![]);}catch(_0x6ac965){return BPromise[_0x1cbe('0x2d')](_0x6ac965);}return _0x2f0888['save']();};}function saveUpdates(_0x509a42,_0x5dbdd8){return function(_0x594295){if(_0x594295){return _0x594295[_0x1cbe('0x2e')](_0x509a42)[_0x1cbe('0x1a')](function(_0x5c8fed){return _0x5c8fed;});}return null;};}function removeEntity(_0x287e7d,_0x542101){return function(_0x33dfee){if(_0x33dfee){return _0x33dfee[_0x1cbe('0x2f')]()[_0x1cbe('0x1a')](function(){var _0x3217e5=_0x33dfee['get']({'plain':!![]});var _0x54c30e=_0x1cbe('0x30');return db[_0x1cbe('0x31')][_0x1cbe('0x2f')]({'where':{'type':_0x54c30e,'resourceId':_0x3217e5['id']}})[_0x1cbe('0x1a')](function(){return _0x33dfee;});})[_0x1cbe('0x1a')](function(){_0x287e7d['status'](0xcc)[_0x1cbe('0x26')]();});}};}function handleEntityNotFound(_0x1602fd,_0x5aec7f){return function(_0x12ab92){if(!_0x12ab92){_0x1602fd[_0x1cbe('0x32')](0x194);}return _0x12ab92;};}function handleError(_0x38c56d,_0x4c84f0){_0x4c84f0=_0x4c84f0||0x1f4;return function(_0x572189){logger[_0x1cbe('0x1f')](_0x572189[_0x1cbe('0x33')]);if(_0x572189[_0x1cbe('0x34')]){delete _0x572189[_0x1cbe('0x34')];}_0x38c56d[_0x1cbe('0x25')](_0x4c84f0)[_0x1cbe('0x35')](_0x572189);};}exports[_0x1cbe('0x36')]=function(_0x2a065e,_0x4a265c){var _0x9972a4={},_0x5f2f59={},_0x3e1e7c={'count':0x0,'rows':[]};var _0x59b54b=_[_0x1cbe('0x37')](db['Trunk'][_0x1cbe('0x38')],function(_0x57c3ac){return{'name':_0x57c3ac[_0x1cbe('0x39')],'type':_0x57c3ac[_0x1cbe('0x3a')]['key']};});_0x5f2f59[_0x1cbe('0x3b')]=_[_0x1cbe('0x37')](_0x59b54b,_0x1cbe('0x34'));_0x5f2f59[_0x1cbe('0x3c')]=_[_0x1cbe('0x3d')](_0x2a065e[_0x1cbe('0x3c')]);_0x5f2f59[_0x1cbe('0x3e')]=_[_0x1cbe('0x3f')](_0x5f2f59[_0x1cbe('0x3b')],_0x5f2f59[_0x1cbe('0x3c')]);_0x9972a4['attributes']=_[_0x1cbe('0x3f')](_0x5f2f59[_0x1cbe('0x3b')],qs[_0x1cbe('0x40')](_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x40')]));_0x9972a4[_0x1cbe('0x41')]=_0x9972a4[_0x1cbe('0x41')][_0x1cbe('0x42')]?_0x9972a4[_0x1cbe('0x41')]:_0x5f2f59['model'];if(!_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x43')](_0x1cbe('0x44'))){_0x9972a4[_0x1cbe('0x29')]=qs['limit'](_0x2a065e['query'][_0x1cbe('0x29')]);_0x9972a4['offset']=qs['offset'](_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x28')]);}_0x9972a4[_0x1cbe('0x45')]=qs[_0x1cbe('0x46')](_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x46')]);_0x9972a4[_0x1cbe('0x47')]=qs[_0x1cbe('0x3e')](_['pick'](_0x2a065e[_0x1cbe('0x3c')],_0x5f2f59['filters']),_0x59b54b);if(_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x48')]){_0x9972a4[_0x1cbe('0x47')]=_['merge'](_0x9972a4[_0x1cbe('0x47')],{'$or':_[_0x1cbe('0x37')](_0x59b54b,function(_0xddc7c0){if(_0xddc7c0[_0x1cbe('0x3a')]!==_0x1cbe('0x49')){var _0x150e97={};_0x150e97[_0xddc7c0[_0x1cbe('0x34')]]={'$like':'%'+_0x2a065e[_0x1cbe('0x3c')][_0x1cbe('0x48')]+'%'};return _0x150e97;}})});}_0x9972a4=_[_0x1cbe('0x4a')]({},_0x9972a4,_0x2a065e['options']);var _0x1c18b2={'where':_0x9972a4[_0x1cbe('0x47')]};return db[_0x1cbe('0x4b')][_0x1cbe('0x27')](_0x1c18b2)[_0x1cbe('0x1a')](function(_0x49b406){_0x3e1e7c[_0x1cbe('0x27')]=_0x49b406;if(_0x2a065e[_0x1cbe('0x3c')]['includeAll']){_0x9972a4['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x9972a4);})[_0x1cbe('0x1a')](function(_0xa8d499){_0x3e1e7c[_0x1cbe('0x4c')]=_0xa8d499;return _0x3e1e7c;})['then'](respondWithFilteredResult(_0x4a265c,_0x9972a4))['catch'](handleError(_0x4a265c,null));};exports[_0x1cbe('0x4d')]=function(_0x5084e1,_0x5038d3){var _0x279caf={'raw':![],'where':{'id':_0x5084e1[_0x1cbe('0x4e')]['id']}},_0x4c99fd={};_0x4c99fd[_0x1cbe('0x3b')]=_['keys'](db['Trunk']['rawAttributes']);_0x4c99fd['query']=_[_0x1cbe('0x3d')](_0x5084e1[_0x1cbe('0x3c')]);_0x4c99fd[_0x1cbe('0x3e')]=_[_0x1cbe('0x3f')](_0x4c99fd[_0x1cbe('0x3b')],_0x4c99fd[_0x1cbe('0x3c')]);_0x279caf[_0x1cbe('0x41')]=_[_0x1cbe('0x3f')](_0x4c99fd[_0x1cbe('0x3b')],qs['fields'](_0x5084e1[_0x1cbe('0x3c')]['fields']));_0x279caf[_0x1cbe('0x41')]=_0x279caf[_0x1cbe('0x41')][_0x1cbe('0x42')]?_0x279caf[_0x1cbe('0x41')]:_0x4c99fd[_0x1cbe('0x3b')];if(_0x5084e1[_0x1cbe('0x3c')][_0x1cbe('0x4f')]){_0x279caf[_0x1cbe('0x50')]=[{'all':!![]}];}_0x279caf=_[_0x1cbe('0x4a')]({},_0x279caf,_0x5084e1[_0x1cbe('0x51')]);return db[_0x1cbe('0x4b')][_0x1cbe('0x52')](_0x279caf)[_0x1cbe('0x1a')](handleEntityNotFound(_0x5038d3,null))[_0x1cbe('0x1a')](respondWithResult(_0x5038d3,null))['catch'](handleError(_0x5038d3,null));};exports[_0x1cbe('0x53')]=function(_0x545ca8,_0x33b2c0){var _0x503423={'where':{'id':_0x545ca8[_0x1cbe('0x4e')]['id']}},_0x3f0a6e={};_0x3f0a6e[_0x1cbe('0x3b')]=_['keys'](db[_0x1cbe('0x4b')][_0x1cbe('0x38')]);_0x503423['attributes']=_[_0x1cbe('0x3f')](_0x3f0a6e[_0x1cbe('0x3b')],qs[_0x1cbe('0x40')](_0x545ca8['query'][_0x1cbe('0x40')]));_0x503423[_0x1cbe('0x41')]=_0x503423[_0x1cbe('0x41')][_0x1cbe('0x42')]?_0x503423[_0x1cbe('0x41')]:_0x3f0a6e[_0x1cbe('0x3b')];if(_0x545ca8[_0x1cbe('0x3c')]['includeAll']){_0x503423['include']=[{'all':!![]}];}_0x503423=_['merge']({},_0x503423,_0x545ca8[_0x1cbe('0x51')]);return db[_0x1cbe('0x4b')]['find'](_0x503423)[_0x1cbe('0x1a')](handleEntityNotFound(_0x33b2c0,null))[_0x1cbe('0x1a')](function(_0x2a217d){if(_0x2a217d){var _0x52ea2b=_0x2a217d[_0x1cbe('0x54')]({'plain':!![]});_0x52ea2b=qs[_0x1cbe('0x55')](_0x52ea2b,['id',_0x1cbe('0x56'),'updatedAt']);_0x545ca8[_0x1cbe('0x57')]=_[_0x1cbe('0x55')](_0x545ca8[_0x1cbe('0x57')],['id',_0x1cbe('0x56'),_0x1cbe('0x58')]);return db[_0x1cbe('0x4b')]['create'](_[_0x1cbe('0x4a')](_0x52ea2b,_0x545ca8['body']),{'include':_0x545ca8['query'][_0x1cbe('0x4f')]?[{'all':!![]}]:undefined})[_0x1cbe('0x1a')](function(_0x41c809){var _0x579107=_0x545ca8['user']['get']({'plain':!![]});if(!_0x579107)throw new Error(_0x1cbe('0x59'));if(_0x579107[_0x1cbe('0x5a')]===_0x1cbe('0x5b')){var _0x5504a6=_0x41c809['get']({'plain':!![]});var _0xc51fe0=_0x1cbe('0x30');return db[_0x1cbe('0x5c')][_0x1cbe('0x52')]({'where':{'name':_0xc51fe0,'userProfileId':_0x579107['userProfileId']},'raw':!![]})[_0x1cbe('0x1a')](function(_0x4de52b){if(_0x4de52b&&_0x4de52b[_0x1cbe('0x5d')]===0x0){return db[_0x1cbe('0x31')][_0x1cbe('0x5e')]({'name':_0x5504a6[_0x1cbe('0x34')],'resourceId':_0x5504a6['id'],'type':_0x4de52b[_0x1cbe('0x34')],'sectionId':_0x4de52b['id']},{})[_0x1cbe('0x1a')](function(){return _0x41c809;});}else{return _0x41c809;}})[_0x1cbe('0x24')](function(_0x511161){logger[_0x1cbe('0x1f')](_0x1cbe('0x5f'),_0x511161);throw _0x511161;});}return _0x41c809;});}})[_0x1cbe('0x1a')](respondWithResult(_0x33b2c0,0xc9))[_0x1cbe('0x24')](handleError(_0x33b2c0,null));};exports['create']=function(_0x397d10,_0x183f85,_0x552bc6){var _0x5f0933;return db[_0x1cbe('0x4b')][_0x1cbe('0x5e')](_0x397d10[_0x1cbe('0x57')],{'raw':!![]})[_0x1cbe('0x1a')](function(_0x15ec5f){_0x5f0933=_0x15ec5f;return db[_0x1cbe('0x4b')][_0x1cbe('0x60')]({'raw':!![]});})['then'](function(_0x3685d0){var _0x56331e=fs[_0x1cbe('0x61')](path[_0x1cbe('0x62')](config['root'],_0x1cbe('0x63')),_0x1cbe('0x64'));var _0x26a1fc=fs[_0x1cbe('0x61')](path[_0x1cbe('0x62')](config[_0x1cbe('0x65')],_0x1cbe('0x66')),_0x1cbe('0x64'));var _0x2b286b=ejs[_0x1cbe('0x67')](_0x56331e,{'trunks':_0x3685d0||[]});fs[_0x1cbe('0x68')](_0x1cbe('0x69'),_0x2b286b);if(_0x5f0933[_0x1cbe('0x6a')]){var _0x285be9=ejs[_0x1cbe('0x67')](_0x26a1fc,{'trunks':_0x3685d0||[]});fs[_0x1cbe('0x68')](_0x1cbe('0x6b'),_0x285be9);}})[_0x1cbe('0x1a')](function(){return respondWithRpcPromise(_0x1cbe('0x6c'),_0x1cbe('0x5e'),{'module':_0x1cbe('0x6d')});})[_0x1cbe('0x1a')](function(){var _0x5681aa=_0x397d10[_0x1cbe('0x5b')]['get']({'plain':!![]});if(!_0x5681aa)throw new Error(_0x1cbe('0x59'));if(_0x5681aa['role']===_0x1cbe('0x5b')){var _0x4c7633=_0x5f0933['get']({'plain':!![]});return db[_0x1cbe('0x5c')][_0x1cbe('0x52')]({'where':{'name':_0x1cbe('0x30'),'userProfileId':_0x5681aa[_0x1cbe('0x6e')]},'raw':!![]})[_0x1cbe('0x1a')](function(_0x46d160){if(_0x46d160&&_0x46d160[_0x1cbe('0x5d')]===0x0){return db[_0x1cbe('0x31')][_0x1cbe('0x5e')]({'name':_0x4c7633[_0x1cbe('0x34')],'resourceId':_0x4c7633['id'],'type':_0x46d160['name'],'sectionId':_0x46d160['id']},{})[_0x1cbe('0x1a')](function(){return _0x5f0933;});}else{return _0x5f0933;}})[_0x1cbe('0x24')](function(_0x337a5c){logger['error'](_0x1cbe('0x5f'),_0x337a5c);throw _0x337a5c;});}return _0x5f0933;})[_0x1cbe('0x1a')](respondWithResult(_0x183f85,0xc9))['catch'](handleError(_0x183f85,null));};exports[_0x1cbe('0x2e')]=function(_0x1c70a6,_0x57863a,_0x4cbb2d){var _0x487e06;return db[_0x1cbe('0x4b')][_0x1cbe('0x52')]({'where':{'id':_0x1c70a6['params']['id']}})[_0x1cbe('0x1a')](handleEntityNotFound(_0x57863a,null))[_0x1cbe('0x1a')](saveUpdates(_0x1c70a6['body'],null))['then'](function(_0x193f61){if(_0x193f61){_0x487e06=_0x193f61;return db[_0x1cbe('0x4b')][_0x1cbe('0x60')]({'raw':!![]});}})[_0x1cbe('0x1a')](function(_0x17f8c7){if(_0x17f8c7){var _0x348bb5=fs['readFileSync'](path[_0x1cbe('0x62')](config[_0x1cbe('0x65')],'server/files/templates/trunk.ejs'),_0x1cbe('0x64'));var _0x20908e=fs[_0x1cbe('0x61')](path[_0x1cbe('0x62')](config[_0x1cbe('0x65')],_0x1cbe('0x66')),_0x1cbe('0x64'));var _0x43127b=ejs[_0x1cbe('0x67')](_0x348bb5,{'trunks':_0x17f8c7||[]});fs[_0x1cbe('0x68')](_0x1cbe('0x69'),_0x43127b);var _0x4637d9=ejs[_0x1cbe('0x67')](_0x20908e,{'trunks':_0x17f8c7||[]});fs[_0x1cbe('0x68')](_0x1cbe('0x6b'),_0x4637d9);return respondWithRpcPromise(_0x1cbe('0x6c'),_0x1cbe('0x2e'),{'module':_0x1cbe('0x6d')});}return null;})['then'](function(_0x1c94b0){if(_0x1c94b0){return _0x487e06;}})[_0x1cbe('0x1a')](respondWithResult(_0x57863a,null))['catch'](handleError(_0x57863a,null));};exports[_0x1cbe('0x2f')]=function(_0x754d53,_0x404a37,_0x472ee4){var _0x238a74;return db[_0x1cbe('0x4b')][_0x1cbe('0x52')]({'where':{'id':_0x754d53['params']['id']}})[_0x1cbe('0x1a')](handleEntityNotFound(_0x404a37,null))['then'](removeEntity(_0x404a37,null))[_0x1cbe('0x1a')](function(){return db[_0x1cbe('0x4b')][_0x1cbe('0x60')]({'raw':!![]});})[_0x1cbe('0x1a')](function(_0x5e7803){var _0x242d16=fs[_0x1cbe('0x61')](path[_0x1cbe('0x62')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x3dbdec=fs[_0x1cbe('0x61')](path[_0x1cbe('0x62')](config[_0x1cbe('0x65')],'server/files/templates/registry.ejs'),'utf8');var _0x271654=ejs[_0x1cbe('0x67')](_0x242d16,{'trunks':_0x5e7803});var _0x40e11d=ejs[_0x1cbe('0x67')](_0x3dbdec,{'trunks':_0x5e7803});fs[_0x1cbe('0x68')](_0x1cbe('0x69'),_0x271654);fs[_0x1cbe('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x40e11d);return respondWithRpcPromise(_0x1cbe('0x6c'),_0x1cbe('0x2f'),{'module':_0x1cbe('0x6d')});})[_0x1cbe('0x24')](handleError(_0x404a37,null));}; \ No newline at end of file +var _0x20df=['join','root','readFileSync','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','writeFileSync','Reload','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','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','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','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','limit','Content-Range','apply','update','destroy','get','Trunks','UserProfileResource','end','stack','name','send','map','fieldName','model','query','filters','attributes','intersection','length','nolimit','offset','order','sort','where','filter','merge','type','VIRTUAL','options','Trunk','includeAll','show','params','rawAttributes','keys','include','find','clone','updatedAt','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','findAll'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x20df,0x7c));var _0xf20d=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0x20df[_0x1e9e56];return _0x5d5e2e;};'use strict';var pdf=require(_0xf20d('0x0'));var emlformat=require(_0xf20d('0x1'));var rimraf=require(_0xf20d('0x2'));var zipdir=require(_0xf20d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf20d('0x4'));var moment=require(_0xf20d('0x5'));var BPromise=require(_0xf20d('0x6'));var Mustache=require(_0xf20d('0x7'));var util=require(_0xf20d('0x8'));var path=require('path');var sox=require(_0xf20d('0x9'));var csv=require('to-csv');var ejs=require(_0xf20d('0xa'));var fs=require('fs');var _=require(_0xf20d('0xb'));var squel=require('squel');var crypto=require(_0xf20d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf20d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf20d('0xe'));var Papa=require(_0xf20d('0xf'));var Redis=require(_0xf20d('0x10'));var authService=require(_0xf20d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf20d('0x12'));var hardwareService=require(_0xf20d('0x13'));var logger=require(_0xf20d('0x14'))(_0xf20d('0x15'));var utils=require(_0xf20d('0x16'));var config=require(_0xf20d('0x17'));var db=require(_0xf20d('0x18'))['db'];var jayson=require(_0xf20d('0x19'));var client=jayson['client'][_0xf20d('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5126e0,_0x15f05d,_0x1364b8){if(_0x1364b8){var _0x554005=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x554005[_0xf20d('0x1b')](_0x15f05d)){return _0x5126e0;}else{throw new db[(_0xf20d('0x1c'))][(_0xf20d('0x1d'))](_0xf20d('0x1e'));}}else{return _0x5126e0;}}function respondWithRpcPromise(_0x12b4e0,_0x5c2ff0,_0x5d4244,_0x3a4563){return new BPromise(function(_0xcd434c,_0x2b2d00){var _0x1ce0c8=_0x3a4563||client;return _0x1ce0c8['request'](_0x12b4e0,_0x5d4244)[_0xf20d('0x1f')](function(_0x4d3bfc){logger[_0xf20d('0x20')]('Trunk,\x20%s,\x20%s',_0x5c2ff0,'request\x20sent');logger[_0xf20d('0x21')](_0xf20d('0x22'),_0x5c2ff0,_0xf20d('0x23'),JSON[_0xf20d('0x24')](_0x4d3bfc));if(_0x4d3bfc[_0xf20d('0x25')]){if(_0x4d3bfc[_0xf20d('0x25')]['code']===0x1f4){logger[_0xf20d('0x25')]('Trunk,\x20%s,\x20%s',_0x5c2ff0,_0x4d3bfc[_0xf20d('0x25')]['message']);return _0x2b2d00(_0x4d3bfc[_0xf20d('0x25')][_0xf20d('0x26')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5c2ff0,_0x4d3bfc[_0xf20d('0x25')][_0xf20d('0x26')]);return _0xcd434c(_0x4d3bfc[_0xf20d('0x25')]['message']);}else{logger['info'](_0xf20d('0x27'),_0x5c2ff0,_0xf20d('0x23'));_0xcd434c(_0x4d3bfc[_0xf20d('0x28')][_0xf20d('0x26')]);}})[_0xf20d('0x29')](function(_0x24b1e5){logger['error'](_0xf20d('0x27'),_0x5c2ff0,_0x24b1e5);_0x2b2d00(_0x24b1e5);});});}function respondWithStatusCode(_0x486104,_0x505645){_0x505645=_0x505645||0xcc;return function(_0x3e97bd){if(_0x3e97bd){return _0x486104[_0xf20d('0x2a')](_0x505645);}return _0x486104[_0xf20d('0x2b')](_0x505645)['end']();};}function respondWithResult(_0x5c6e7a,_0x5d8169){_0x5d8169=_0x5d8169||0xc8;return function(_0x41378f){if(_0x41378f){return _0x5c6e7a[_0xf20d('0x2b')](_0x5d8169)[_0xf20d('0x2c')](_0x41378f);}};}function respondWithFilteredResult(_0x49ecbc,_0x191c70){return function(_0x993a3b){if(_0x993a3b){var _0x1dfda0=_0x993a3b[_0xf20d('0x2d')],_0x8372b2=_0x191c70['offset'],_0x19e60b=_0x191c70['offset']+_0x191c70[_0xf20d('0x2e')],_0x36e7a5;if(_0x19e60b>=_0x1dfda0){_0x19e60b=_0x1dfda0;_0x36e7a5=0xc8;}else{_0x36e7a5=0xce;}_0x49ecbc[_0xf20d('0x2b')](_0x36e7a5);return _0x49ecbc['set'](_0xf20d('0x2f'),_0x8372b2+'-'+_0x19e60b+'/'+_0x1dfda0)[_0xf20d('0x2c')](_0x993a3b);}return null;};}function patchUpdates(_0x422944){return function(_0x1f99b0){try{jsonpatch[_0xf20d('0x30')](_0x1f99b0,_0x422944,!![]);}catch(_0x4baea7){return BPromise['reject'](_0x4baea7);}return _0x1f99b0['save']();};}function saveUpdates(_0xd5fea2,_0x5ca778){return function(_0x37662f){if(_0x37662f){return _0x37662f[_0xf20d('0x31')](_0xd5fea2)[_0xf20d('0x1f')](function(_0x883f6f){return _0x883f6f;});}return null;};}function removeEntity(_0x51b9be,_0x3cb18c){return function(_0x3ba88c){if(_0x3ba88c){return _0x3ba88c[_0xf20d('0x32')]()[_0xf20d('0x1f')](function(){var _0x37c1e5=_0x3ba88c[_0xf20d('0x33')]({'plain':!![]});var _0x22f1c9=_0xf20d('0x34');return db[_0xf20d('0x35')]['destroy']({'where':{'type':_0x22f1c9,'resourceId':_0x37c1e5['id']}})[_0xf20d('0x1f')](function(){return _0x3ba88c;});})[_0xf20d('0x1f')](function(){_0x51b9be[_0xf20d('0x2b')](0xcc)[_0xf20d('0x36')]();});}};}function handleEntityNotFound(_0x58387f,_0xcb73d){return function(_0x2474dd){if(!_0x2474dd){_0x58387f[_0xf20d('0x2a')](0x194);}return _0x2474dd;};}function handleError(_0x172fa7,_0x27d0ae){_0x27d0ae=_0x27d0ae||0x1f4;return function(_0x30b47f){logger[_0xf20d('0x25')](_0x30b47f[_0xf20d('0x37')]);if(_0x30b47f[_0xf20d('0x38')]){delete _0x30b47f[_0xf20d('0x38')];}_0x172fa7['status'](_0x27d0ae)[_0xf20d('0x39')](_0x30b47f);};}exports['index']=function(_0x32ff78,_0x29517d){var _0x350c82={},_0x219193={},_0x3ef514={'count':0x0,'rows':[]};var _0xe50ef1=_[_0xf20d('0x3a')](db['Trunk']['rawAttributes'],function(_0x1c9b69){return{'name':_0x1c9b69[_0xf20d('0x3b')],'type':_0x1c9b69['type']['key']};});_0x219193[_0xf20d('0x3c')]=_[_0xf20d('0x3a')](_0xe50ef1,'name');_0x219193[_0xf20d('0x3d')]=_['keys'](_0x32ff78[_0xf20d('0x3d')]);_0x219193[_0xf20d('0x3e')]=_['intersection'](_0x219193[_0xf20d('0x3c')],_0x219193[_0xf20d('0x3d')]);_0x350c82[_0xf20d('0x3f')]=_[_0xf20d('0x40')](_0x219193[_0xf20d('0x3c')],qs['fields'](_0x32ff78[_0xf20d('0x3d')]['fields']));_0x350c82['attributes']=_0x350c82[_0xf20d('0x3f')][_0xf20d('0x41')]?_0x350c82[_0xf20d('0x3f')]:_0x219193[_0xf20d('0x3c')];if(!_0x32ff78[_0xf20d('0x3d')]['hasOwnProperty'](_0xf20d('0x42'))){_0x350c82['limit']=qs['limit'](_0x32ff78[_0xf20d('0x3d')][_0xf20d('0x2e')]);_0x350c82[_0xf20d('0x43')]=qs[_0xf20d('0x43')](_0x32ff78[_0xf20d('0x3d')][_0xf20d('0x43')]);}_0x350c82[_0xf20d('0x44')]=qs[_0xf20d('0x45')](_0x32ff78[_0xf20d('0x3d')][_0xf20d('0x45')]);_0x350c82[_0xf20d('0x46')]=qs[_0xf20d('0x3e')](_['pick'](_0x32ff78['query'],_0x219193[_0xf20d('0x3e')]),_0xe50ef1);if(_0x32ff78['query'][_0xf20d('0x47')]){_0x350c82[_0xf20d('0x46')]=_[_0xf20d('0x48')](_0x350c82[_0xf20d('0x46')],{'$or':_[_0xf20d('0x3a')](_0xe50ef1,function(_0x576e2c){if(_0x576e2c[_0xf20d('0x49')]!==_0xf20d('0x4a')){var _0x48b247={};_0x48b247[_0x576e2c[_0xf20d('0x38')]]={'$like':'%'+_0x32ff78[_0xf20d('0x3d')]['filter']+'%'};return _0x48b247;}})});}_0x350c82=_[_0xf20d('0x48')]({},_0x350c82,_0x32ff78[_0xf20d('0x4b')]);var _0x2ea30e={'where':_0x350c82[_0xf20d('0x46')]};return db[_0xf20d('0x4c')][_0xf20d('0x2d')](_0x2ea30e)[_0xf20d('0x1f')](function(_0x132b07){_0x3ef514[_0xf20d('0x2d')]=_0x132b07;if(_0x32ff78[_0xf20d('0x3d')][_0xf20d('0x4d')]){_0x350c82['include']=[{'all':!![]}];}return db[_0xf20d('0x4c')]['findAll'](_0x350c82);})['then'](function(_0xdbbcb7){_0x3ef514['rows']=_0xdbbcb7;return _0x3ef514;})[_0xf20d('0x1f')](respondWithFilteredResult(_0x29517d,_0x350c82))['catch'](handleError(_0x29517d,null));};exports[_0xf20d('0x4e')]=function(_0x2689d3,_0x5d6c41){var _0x1ba672={'raw':![],'where':{'id':_0x2689d3[_0xf20d('0x4f')]['id']}},_0x195a11={};_0x195a11['model']=_['keys'](db[_0xf20d('0x4c')][_0xf20d('0x50')]);_0x195a11[_0xf20d('0x3d')]=_[_0xf20d('0x51')](_0x2689d3[_0xf20d('0x3d')]);_0x195a11['filters']=_[_0xf20d('0x40')](_0x195a11[_0xf20d('0x3c')],_0x195a11['query']);_0x1ba672['attributes']=_[_0xf20d('0x40')](_0x195a11['model'],qs['fields'](_0x2689d3[_0xf20d('0x3d')]['fields']));_0x1ba672['attributes']=_0x1ba672[_0xf20d('0x3f')][_0xf20d('0x41')]?_0x1ba672[_0xf20d('0x3f')]:_0x195a11[_0xf20d('0x3c')];if(_0x2689d3[_0xf20d('0x3d')][_0xf20d('0x4d')]){_0x1ba672[_0xf20d('0x52')]=[{'all':!![]}];}_0x1ba672=_[_0xf20d('0x48')]({},_0x1ba672,_0x2689d3[_0xf20d('0x4b')]);return db['Trunk'][_0xf20d('0x53')](_0x1ba672)[_0xf20d('0x1f')](handleEntityNotFound(_0x5d6c41,null))[_0xf20d('0x1f')](respondWithResult(_0x5d6c41,null))['catch'](handleError(_0x5d6c41,null));};exports[_0xf20d('0x54')]=function(_0x46eea5,_0x51e0b3){var _0x243308={'where':{'id':_0x46eea5['params']['id']}},_0x2ad598={};_0x2ad598['model']=_[_0xf20d('0x51')](db[_0xf20d('0x4c')][_0xf20d('0x50')]);_0x243308[_0xf20d('0x3f')]=_[_0xf20d('0x40')](_0x2ad598[_0xf20d('0x3c')],qs['fields'](_0x46eea5[_0xf20d('0x3d')]['fields']));_0x243308['attributes']=_0x243308[_0xf20d('0x3f')][_0xf20d('0x41')]?_0x243308[_0xf20d('0x3f')]:_0x2ad598[_0xf20d('0x3c')];if(_0x46eea5[_0xf20d('0x3d')]['includeAll']){_0x243308[_0xf20d('0x52')]=[{'all':!![]}];}_0x243308=_[_0xf20d('0x48')]({},_0x243308,_0x46eea5[_0xf20d('0x4b')]);return db[_0xf20d('0x4c')][_0xf20d('0x53')](_0x243308)[_0xf20d('0x1f')](handleEntityNotFound(_0x51e0b3,null))[_0xf20d('0x1f')](function(_0x29cbd8){if(_0x29cbd8){var _0x28a621=_0x29cbd8[_0xf20d('0x33')]({'plain':!![]});_0x28a621=qs['omit'](_0x28a621,['id','createdAt',_0xf20d('0x55')]);_0x46eea5['body']=_['omit'](_0x46eea5[_0xf20d('0x56')],['id',_0xf20d('0x57'),'updatedAt']);return db[_0xf20d('0x4c')][_0xf20d('0x58')](_['merge'](_0x28a621,_0x46eea5[_0xf20d('0x56')]),{'include':_0x46eea5[_0xf20d('0x3d')][_0xf20d('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x2f37aa){var _0x41f033=_0x46eea5[_0xf20d('0x59')][_0xf20d('0x33')]({'plain':!![]});if(!_0x41f033)throw new Error(_0xf20d('0x5a'));if(_0x41f033[_0xf20d('0x5b')]===_0xf20d('0x59')){var _0x2edff9=_0x2f37aa[_0xf20d('0x33')]({'plain':!![]});var _0x31dbc0=_0xf20d('0x34');return db[_0xf20d('0x5c')][_0xf20d('0x53')]({'where':{'name':_0x31dbc0,'userProfileId':_0x41f033[_0xf20d('0x5d')]},'raw':!![]})[_0xf20d('0x1f')](function(_0x235a51){if(_0x235a51&&_0x235a51[_0xf20d('0x5e')]===0x0){return db['UserProfileResource'][_0xf20d('0x58')]({'name':_0x2edff9[_0xf20d('0x38')],'resourceId':_0x2edff9['id'],'type':_0x235a51[_0xf20d('0x38')],'sectionId':_0x235a51['id']},{})['then'](function(){return _0x2f37aa;});}else{return _0x2f37aa;}})[_0xf20d('0x29')](function(_0xcecf6e){logger[_0xf20d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcecf6e);throw _0xcecf6e;});}return _0x2f37aa;});}})[_0xf20d('0x1f')](respondWithResult(_0x51e0b3,0xc9))[_0xf20d('0x29')](handleError(_0x51e0b3,null));};exports[_0xf20d('0x58')]=function(_0x4f398f,_0x1497dc,_0x43e81f){var _0x3c049e;return db['Trunk']['create'](_0x4f398f['body'],{'raw':!![]})[_0xf20d('0x1f')](function(_0x5af9f8){_0x3c049e=_0x5af9f8;return db[_0xf20d('0x4c')][_0xf20d('0x5f')]({'raw':!![]});})[_0xf20d('0x1f')](function(_0x3fa7e9){var _0x2d14c4=fs['readFileSync'](path[_0xf20d('0x60')](config[_0xf20d('0x61')],'server/files/templates/trunk.ejs'),'utf8');var _0x55f92f=fs[_0xf20d('0x62')](path[_0xf20d('0x60')](config[_0xf20d('0x61')],'server/files/templates/registry.ejs'),_0xf20d('0x63'));var _0x42e4f0=ejs[_0xf20d('0x64')](_0x2d14c4,{'trunks':_0x3fa7e9||[]});fs['writeFileSync'](_0xf20d('0x65'),_0x42e4f0);if(_0x3c049e[_0xf20d('0x66')]){var _0x4f203f=ejs[_0xf20d('0x64')](_0x55f92f,{'trunks':_0x3fa7e9||[]});fs['writeFileSync'](_0xf20d('0x67'),_0x4f203f);}})[_0xf20d('0x1f')](function(){return respondWithRpcPromise('Reload',_0xf20d('0x58'),{'module':_0xf20d('0x68')});})[_0xf20d('0x1f')](function(){var _0x3fa4bf=_0x4f398f['user'][_0xf20d('0x33')]({'plain':!![]});if(!_0x3fa4bf)throw new Error(_0xf20d('0x5a'));if(_0x3fa4bf['role']===_0xf20d('0x59')){var _0x5e9315=_0x3c049e[_0xf20d('0x33')]({'plain':!![]});return db[_0xf20d('0x5c')]['find']({'where':{'name':_0xf20d('0x34'),'userProfileId':_0x3fa4bf[_0xf20d('0x5d')]},'raw':!![]})[_0xf20d('0x1f')](function(_0x30d817){if(_0x30d817&&_0x30d817[_0xf20d('0x5e')]===0x0){return db[_0xf20d('0x35')][_0xf20d('0x58')]({'name':_0x5e9315[_0xf20d('0x38')],'resourceId':_0x5e9315['id'],'type':_0x30d817[_0xf20d('0x38')],'sectionId':_0x30d817['id']},{})[_0xf20d('0x1f')](function(){return _0x3c049e;});}else{return _0x3c049e;}})['catch'](function(_0x848d3b){logger[_0xf20d('0x25')](_0xf20d('0x69'),_0x848d3b);throw _0x848d3b;});}return _0x3c049e;})['then'](respondWithResult(_0x1497dc,0xc9))[_0xf20d('0x29')](handleError(_0x1497dc,null));};exports[_0xf20d('0x31')]=function(_0x2c988f,_0x210f07,_0x53958b){var _0x35c87a;return db[_0xf20d('0x4c')][_0xf20d('0x53')]({'where':{'id':_0x2c988f['params']['id']}})[_0xf20d('0x1f')](handleEntityNotFound(_0x210f07,null))[_0xf20d('0x1f')](saveUpdates(_0x2c988f[_0xf20d('0x56')],null))[_0xf20d('0x1f')](function(_0x1cab94){if(_0x1cab94){_0x35c87a=_0x1cab94;return db[_0xf20d('0x4c')][_0xf20d('0x5f')]({'raw':!![]});}})[_0xf20d('0x1f')](function(_0x53880f){if(_0x53880f){var _0x34b361=fs['readFileSync'](path[_0xf20d('0x60')](config[_0xf20d('0x61')],_0xf20d('0x6a')),_0xf20d('0x63'));var _0x27f3ad=fs[_0xf20d('0x62')](path[_0xf20d('0x60')](config['root'],_0xf20d('0x6b')),_0xf20d('0x63'));var _0x1483de=ejs[_0xf20d('0x64')](_0x34b361,{'trunks':_0x53880f||[]});fs['writeFileSync'](_0xf20d('0x65'),_0x1483de);var _0x3d3b96=ejs[_0xf20d('0x64')](_0x27f3ad,{'trunks':_0x53880f||[]});fs['writeFileSync'](_0xf20d('0x67'),_0x3d3b96);return respondWithRpcPromise('Reload',_0xf20d('0x31'),{'module':_0xf20d('0x68')});}return null;})[_0xf20d('0x1f')](function(_0x54d661){if(_0x54d661){return _0x35c87a;}})[_0xf20d('0x1f')](respondWithResult(_0x210f07,null))['catch'](handleError(_0x210f07,null));};exports[_0xf20d('0x32')]=function(_0x5430be,_0x2b78ba,_0x400889){var _0x585fa6;return db[_0xf20d('0x4c')][_0xf20d('0x53')]({'where':{'id':_0x5430be['params']['id']}})[_0xf20d('0x1f')](handleEntityNotFound(_0x2b78ba,null))[_0xf20d('0x1f')](removeEntity(_0x2b78ba,null))[_0xf20d('0x1f')](function(){return db['Trunk'][_0xf20d('0x5f')]({'raw':!![]});})[_0xf20d('0x1f')](function(_0x41d87b){var _0x409953=fs[_0xf20d('0x62')](path[_0xf20d('0x60')](config[_0xf20d('0x61')],_0xf20d('0x6a')),'utf8');var _0xe2ae7a=fs[_0xf20d('0x62')](path[_0xf20d('0x60')](config['root'],_0xf20d('0x6b')),_0xf20d('0x63'));var _0x20d078=ejs[_0xf20d('0x64')](_0x409953,{'trunks':_0x41d87b});var _0x400375=ejs[_0xf20d('0x64')](_0xe2ae7a,{'trunks':_0x41d87b});fs[_0xf20d('0x6c')]('/etc/asterisk/sip_xcally_trunks.conf',_0x20d078);fs[_0xf20d('0x6c')]('/etc/asterisk/sip_xcally_registers.conf',_0x400375);return respondWithRpcPromise(_0xf20d('0x6d'),_0xf20d('0x32'),{'module':_0xf20d('0x68')});})[_0xf20d('0x29')](handleError(_0x2b78ba,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9fd1667..296733f 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 _0x3a0c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','define','tools_trunks'];(function(_0x2fceb0,_0x1c22db){var _0x4bb89f=function(_0x584e5c){while(--_0x584e5c){_0x2fceb0['push'](_0x2fceb0['shift']());}};_0x4bb89f(++_0x1c22db);}(_0x3a0c,0xf7));var _0xc3a0=function(_0x3848cf,_0x38d178){_0x3848cf=_0x3848cf-0x0;var _0x4ba819=_0x3a0c[_0x3848cf];return _0x4ba819;};'use strict';var _=require(_0xc3a0('0x0'));var util=require(_0xc3a0('0x1'));var logger=require(_0xc3a0('0x2'))(_0xc3a0('0x3'));var moment=require(_0xc3a0('0x4'));var BPromise=require(_0xc3a0('0x5'));var rp=require(_0xc3a0('0x6'));var fs=require('fs');var path=require(_0xc3a0('0x7'));var rimraf=require('rimraf');var config=require(_0xc3a0('0x8'));var attributes=require(_0xc3a0('0x9'));module[_0xc3a0('0xa')]=function(_0x5dfcc9,_0x5b8e9f){return _0x5dfcc9[_0xc3a0('0xb')]('Trunk',attributes,{'tableName':_0xc3a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd5c=['./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xb7c348,_0x39ab13){var _0x1cf9a0=function(_0x10fe57){while(--_0x10fe57){_0xb7c348['push'](_0xb7c348['shift']());}};_0x1cf9a0(++_0x39ab13);}(_0xcd5c,0x86));var _0xccd5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcd5c[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xccd5('0x0'));var util=require(_0xccd5('0x1'));var logger=require(_0xccd5('0x2'))(_0xccd5('0x3'));var moment=require(_0xccd5('0x4'));var BPromise=require('bluebird');var rp=require(_0xccd5('0x5'));var fs=require('fs');var path=require(_0xccd5('0x6'));var rimraf=require(_0xccd5('0x7'));var config=require(_0xccd5('0x8'));var attributes=require(_0xccd5('0x9'));module[_0xccd5('0xa')]=function(_0x3a1aa8,_0x11d5c2){return _0x3a1aa8[_0xccd5('0xb')](_0xccd5('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index db82fb5..a946bdd 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 _0x1a85=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','model','map','attributes','then','ShowTrunk','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x1a85,0x178));var _0x51a8=function(_0x17ee38,_0x5bdff4){_0x17ee38=_0x17ee38-0x0;var _0x439a4e=_0x1a85[_0x17ee38];return _0x439a4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Trunk,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['Trunk'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowTrunk',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x2032=['error','code','message','info','result','catch','GetTrunk','Trunk','options','raw','where','map','model','attributes','include','stringify','ShowTrunk','find','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c9fc5,_0x3ca335){var _0x4eea03=function(_0x191625){while(--_0x191625){_0x1c9fc5['push'](_0x1c9fc5['shift']());}};_0x4eea03(++_0x3ca335);}(_0x2032,0xd9));var _0x2203=function(_0x5b4d9f,_0x4f15a8){_0x5b4d9f=_0x5b4d9f-0x0;var _0x274091=_0x2032[_0x5b4d9f];return _0x274091;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('Trunk,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('Trunk,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['findAll']({'raw':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x18')]||null:null,'attributes':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['attributes']||null:null,'limit':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['limit']||null:null,'include':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')]['include']?_[_0x2203('0x19')](_0x4893ff['options']['include'],function(_0x226374){return{'model':db[_0x226374[_0x2203('0x1a')]],'as':_0x226374['as'],'attributes':_0x226374[_0x2203('0x1b')],'include':_0x226374[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x226374[_0x2203('0x1c')],function(_0x49c12){return{'model':db[_0x49c12[_0x2203('0x1a')]],'as':_0x49c12['as'],'attributes':_0x49c12['attributes'],'include':_0x49c12[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x49c12[_0x2203('0x1c')],function(_0x5f11bf){return{'model':db[_0x5f11bf[_0x2203('0x1a')]],'as':_0x5f11bf['as'],'attributes':_0x5f11bf[_0x2203('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6e109){logger[_0x2203('0x11')](_0x2203('0x14'),_0x4893ff);logger[_0x2203('0xd')](_0x2203('0x14'),_0x4893ff,JSON[_0x2203('0x1d')](_0xd6e109));_0x8906e1(_0xd6e109);})[_0x2203('0x13')](function(_0x5a95c1){logger[_0x2203('0xe')](_0x2203('0x14'),_0x5a95c1[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6[_0x2203('0xe')](0x1f4,_0x5a95c1['message']));});});};exports[_0x2203('0x1e')]=function(_0x21ff0d){var _0x287c95=this;return new Promise(function(_0xf59954,_0x520602){return db[_0x2203('0x15')][_0x2203('0x1f')]({'raw':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x18')]||null:null,'attributes':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d[_0x2203('0x16')][_0x2203('0x1b')]||null:null,'include':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d['options'][_0x2203('0x1c')]?_[_0x2203('0x19')](_0x21ff0d['options'][_0x2203('0x1c')],function(_0x20fbe1){return{'model':db[_0x20fbe1[_0x2203('0x1a')]],'as':_0x20fbe1['as'],'attributes':_0x20fbe1[_0x2203('0x1b')],'include':_0x20fbe1[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x20fbe1[_0x2203('0x1c')],function(_0x44228e){return{'model':db[_0x44228e[_0x2203('0x1a')]],'as':_0x44228e['as'],'attributes':_0x44228e['attributes'],'include':_0x44228e[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x44228e['include'],function(_0x54b90b){return{'model':db[_0x54b90b[_0x2203('0x1a')]],'as':_0x54b90b['as'],'attributes':_0x54b90b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2203('0x20')](function(_0x3b1eeb){logger[_0x2203('0x11')]('ShowTrunk',_0x21ff0d);logger['debug'](_0x2203('0x1e'),_0x21ff0d,JSON['stringify'](_0x3b1eeb));_0xf59954(_0x3b1eeb);})[_0x2203('0x13')](function(_0x5cfe5e){logger[_0x2203('0xe')]('ShowTrunk',_0x5cfe5e[_0x2203('0x10')],_0x21ff0d);_0x520602(_0x287c95[_0x2203('0xe')](0x1f4,_0x5cfe5e[_0x2203('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 38f9efd..7922c3f 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 _0x315a=['/:id/whatsapp_accounts','addWhatsappAccounts','/:id/square_projects','/:id/api_key','createApiKey','put','/:id','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','file','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts'];(function(_0x4a07e7,_0x5c4062){var _0x18c27c=function(_0x3f6b15){while(--_0x3f6b15){_0x4a07e7['push'](_0x4a07e7['shift']());}};_0x18c27c(++_0x5c4062);}(_0x315a,0x90));var _0xa315=function(_0x4c94d1,_0x573a4f){_0x4c94d1=_0x4c94d1-0x0;var _0x48c2c3=_0x315a[_0x4c94d1];return _0x48c2c3;};'use strict';var multer=require(_0xa315('0x0'));var util=require(_0xa315('0x1'));var path=require(_0xa315('0x2'));var timeout=require(_0xa315('0x3'));var express=require('express');var router=express[_0xa315('0x4')]();var auth=require(_0xa315('0x5'));var interaction=require(_0xa315('0x6'));var config=require(_0xa315('0x7'));var controller=require(_0xa315('0x8'));router['get']('/',auth[_0xa315('0x9')](),controller[_0xa315('0xa')]);router[_0xa315('0xb')](_0xa315('0xc'),auth[_0xa315('0x9')](),controller[_0xa315('0xd')]);router['get'](_0xa315('0xe'),auth[_0xa315('0x9')](),controller[_0xa315('0xf')]);router[_0xa315('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa315('0x10')]);router['get'](_0xa315('0x11'),controller[_0xa315('0x12')]);router['get'](_0xa315('0x13'),auth['isAuthenticated'](),controller[_0xa315('0x14')]);router[_0xa315('0xb')](_0xa315('0x15'),auth['isAuthenticated'](),controller['getQueues']);router[_0xa315('0xb')]('/:id/queues_rt',auth[_0xa315('0x9')](),controller['getVoiceQueuesRt']);router['get']('/:id/groups',auth['isAuthenticated'](),controller[_0xa315('0x16')]);router[_0xa315('0xb')](_0xa315('0x17'),auth[_0xa315('0x9')](),controller[_0xa315('0x18')]);router[_0xa315('0xb')](_0xa315('0x19'),auth[_0xa315('0x9')](),controller[_0xa315('0x1a')]);router[_0xa315('0xb')](_0xa315('0x1b'),auth['isAuthenticated'](),controller[_0xa315('0x1c')]);router[_0xa315('0xb')]('/:id/openchannel/interactions',auth[_0xa315('0x9')](),controller[_0xa315('0x1d')]);router['get'](_0xa315('0x1e'),auth['isAuthenticated'](),controller[_0xa315('0x1f')]);router[_0xa315('0xb')](_0xa315('0x20'),auth[_0xa315('0x9')](),controller[_0xa315('0x21')]);router[_0xa315('0xb')](_0xa315('0x22'),auth[_0xa315('0x9')](),controller[_0xa315('0x23')]);router[_0xa315('0xb')](_0xa315('0x24'),auth[_0xa315('0x9')](),controller[_0xa315('0x25')]);router[_0xa315('0xb')](_0xa315('0x26'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/lists',auth[_0xa315('0x9')](),controller[_0xa315('0x27')]);router[_0xa315('0xb')](_0xa315('0x28'),auth[_0xa315('0x9')](),controller['getAgents']);router[_0xa315('0xb')]('/:id/prefixes',auth[_0xa315('0x9')](),controller[_0xa315('0x29')]);router[_0xa315('0xb')](_0xa315('0x2a'),auth[_0xa315('0x9')](),controller[_0xa315('0x2b')]);router[_0xa315('0xb')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xa315('0x2c')]);router[_0xa315('0xb')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xa315('0xb')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xa315('0x2d')]);router[_0xa315('0xb')](_0xa315('0x2e'),auth[_0xa315('0x9')](),controller[_0xa315('0x2f')]);router[_0xa315('0xb')]('/:id/whatsapp_accounts',auth[_0xa315('0x9')](),controller[_0xa315('0x30')]);router[_0xa315('0xb')]('/:id/square_projects',auth[_0xa315('0x9')](),controller[_0xa315('0x31')]);router[_0xa315('0xb')](_0xa315('0x32'),auth[_0xa315('0x9')](),controller[_0xa315('0x33')]);router[_0xa315('0xb')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xa315('0x34')]);router[_0xa315('0x35')](_0xa315('0x36'),auth[_0xa315('0x9')](),controller[_0xa315('0x37')]);router[_0xa315('0x35')]('/:id/contacts',auth[_0xa315('0x9')](),controller[_0xa315('0x38')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa315('0x39')]);router[_0xa315('0x35')](_0xa315('0x15'),auth[_0xa315('0x9')](),controller[_0xa315('0x3a')]);var upload=multer({'storage':multer[_0xa315('0x3b')]({'destination':function(_0x1833c9,_0x1e8aed,_0x1d7bf3){_0x1d7bf3(null,path[_0xa315('0x3c')](config[_0xa315('0x3d')],'server/files/images/'));},'filename':function(_0x33f335,_0x43ff69,_0x59bb23){_0x59bb23(null,util[_0xa315('0x3e')](_0xa315('0x3f'),Date[_0xa315('0x40')](),_0x43ff69[_0xa315('0x41')]));}})});router[_0xa315('0x35')](_0xa315('0x11'),upload['single'](_0xa315('0x42')),controller['addAvatar']);router[_0xa315('0x35')](_0xa315('0x43'),auth[_0xa315('0x9')](),controller[_0xa315('0x44')]);router[_0xa315('0x35')](_0xa315('0x45'),auth['isAuthenticated'](),controller[_0xa315('0x46')]);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0xa315('0x47')]);router['post'](_0xa315('0x48'),auth[_0xa315('0x9')](),controller[_0xa315('0x49')]);router[_0xa315('0x35')]('/:id/teams',auth[_0xa315('0x9')](),controller[_0xa315('0x4a')]);router[_0xa315('0x35')]('/:id/chat_interactions',auth[_0xa315('0x9')](),controller[_0xa315('0x4b')]);router[_0xa315('0x35')](_0xa315('0x4c'),auth[_0xa315('0x9')](),controller[_0xa315('0x4d')]);router[_0xa315('0x35')](_0xa315('0x4e'),auth[_0xa315('0x9')](),controller[_0xa315('0x4f')]);router[_0xa315('0x35')](_0xa315('0x50'),auth[_0xa315('0x9')](),controller[_0xa315('0x51')]);router[_0xa315('0x35')](_0xa315('0x52'),auth[_0xa315('0x9')](),controller[_0xa315('0x53')]);router[_0xa315('0x35')](_0xa315('0x54'),auth[_0xa315('0x9')](),controller[_0xa315('0x55')]);router[_0xa315('0x35')](_0xa315('0x2a'),auth[_0xa315('0x9')](),controller[_0xa315('0x56')]);router['post'](_0xa315('0x57'),auth[_0xa315('0x9')](),controller['addMailAccounts']);router[_0xa315('0x35')](_0xa315('0x58'),auth[_0xa315('0x9')](),controller[_0xa315('0x59')]);router[_0xa315('0x35')](_0xa315('0x5a'),auth['isAuthenticated'](),controller[_0xa315('0x5b')]);router[_0xa315('0x35')](_0xa315('0x2e'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0xa315('0x35')](_0xa315('0x5c'),auth['isAuthenticated'](),controller[_0xa315('0x5d')]);router['post'](_0xa315('0x5e'),auth[_0xa315('0x9')](),controller['addSquareProjects']);router['post'](_0xa315('0x5f'),auth[_0xa315('0x9')](),controller[_0xa315('0x60')]);router[_0xa315('0x61')](_0xa315('0x62'),auth['isAuthenticated'](),controller[_0xa315('0x63')]);router[_0xa315('0x61')](_0xa315('0x64'),auth[_0xa315('0x9')](),controller[_0xa315('0x65')]);router['delete'](_0xa315('0x15'),auth[_0xa315('0x9')](),controller[_0xa315('0x66')]);router[_0xa315('0x67')](_0xa315('0x26'),auth[_0xa315('0x9')](),controller[_0xa315('0x68')]);router[_0xa315('0x67')](_0xa315('0x62'),auth[_0xa315('0x9')](),controller[_0xa315('0x69')]);router['delete'](_0xa315('0x6a'),auth[_0xa315('0x9')](),controller[_0xa315('0x6b')]);router[_0xa315('0x67')](_0xa315('0x4c'),auth[_0xa315('0x9')](),controller['removeMailInteractions']);router[_0xa315('0x67')](_0xa315('0x4e'),auth[_0xa315('0x9')](),controller[_0xa315('0x6c')]);router[_0xa315('0x67')](_0xa315('0x50'),auth[_0xa315('0x9')](),controller[_0xa315('0x6d')]);router[_0xa315('0x67')](_0xa315('0x52'),auth['isAuthenticated'](),controller[_0xa315('0x6e')]);router[_0xa315('0x67')](_0xa315('0x54'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0xa315('0x67')](_0xa315('0x2a'),auth[_0xa315('0x9')](),controller[_0xa315('0x6f')]);router[_0xa315('0x67')]('/:id/mail_accounts',auth[_0xa315('0x9')](),controller[_0xa315('0x70')]);router['delete'](_0xa315('0x58'),auth[_0xa315('0x9')](),controller[_0xa315('0x71')]);router[_0xa315('0x67')](_0xa315('0x5a'),auth[_0xa315('0x9')](),controller['removeSmsAccounts']);router['delete']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xa315('0x72')]);router['delete'](_0xa315('0x5c'),auth[_0xa315('0x9')](),controller['removeWhatsappAccounts']);router['delete'](_0xa315('0x5e'),auth[_0xa315('0x9')](),controller[_0xa315('0x73')]);router[_0xa315('0x67')]('/:id/api_key',auth[_0xa315('0x9')](),controller[_0xa315('0x74')]);module[_0xa315('0x75')]=router; \ No newline at end of file +var _0x1092=['diskStorage','join','root','server/files/images/','format','now','single','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','/:id/api_key','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','/create_many','bulkCreate','post','addContacts','create','addQueues'];(function(_0x3949b4,_0x40ebeb){var _0x1b2036=function(_0xb8f97){while(--_0xb8f97){_0x3949b4['push'](_0x3949b4['shift']());}};_0x1b2036(++_0x40ebeb);}(_0x1092,0x1d6));var _0x2109=function(_0x3170eb,_0x22dddd){_0x3170eb=_0x3170eb-0x0;var _0x58948e=_0x1092[_0x3170eb];return _0x58948e;};'use strict';var multer=require('multer');var util=require(_0x2109('0x0'));var path=require(_0x2109('0x1'));var timeout=require(_0x2109('0x2'));var express=require(_0x2109('0x3'));var router=express[_0x2109('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2109('0x5'));var config=require(_0x2109('0x6'));var controller=require('./user.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2109('0x7')](_0x2109('0x8'),auth[_0x2109('0x9')](),controller['describe']);router[_0x2109('0x7')]('/whoami',auth[_0x2109('0x9')](),controller[_0x2109('0xa')]);router[_0x2109('0x7')](_0x2109('0xb'),auth[_0x2109('0x9')](),controller[_0x2109('0xc')]);router['get'](_0x2109('0xd'),controller[_0x2109('0xe')]);router[_0x2109('0x7')](_0x2109('0xf'),auth[_0x2109('0x9')](),controller[_0x2109('0x10')]);router[_0x2109('0x7')](_0x2109('0x11'),auth[_0x2109('0x9')](),controller[_0x2109('0x12')]);router[_0x2109('0x7')](_0x2109('0x13'),auth[_0x2109('0x9')](),controller[_0x2109('0x14')]);router[_0x2109('0x7')](_0x2109('0x15'),auth[_0x2109('0x9')](),controller['getGroups']);router[_0x2109('0x7')](_0x2109('0x16'),auth[_0x2109('0x9')](),controller[_0x2109('0x17')]);router[_0x2109('0x7')](_0x2109('0x18'),auth[_0x2109('0x9')](),controller[_0x2109('0x19')]);router['get']('/:id/chat/interactions',auth[_0x2109('0x9')](),controller[_0x2109('0x1a')]);router[_0x2109('0x7')](_0x2109('0x1b'),auth[_0x2109('0x9')](),controller[_0x2109('0x1c')]);router[_0x2109('0x7')](_0x2109('0x1d'),auth[_0x2109('0x9')](),controller['getMailInteractions']);router[_0x2109('0x7')](_0x2109('0x1e'),auth[_0x2109('0x9')](),controller['getSmsInteractions']);router[_0x2109('0x7')](_0x2109('0x1f'),auth[_0x2109('0x9')](),controller['getFaxInteractions']);router[_0x2109('0x7')](_0x2109('0x20'),auth['isAuthenticated'](),controller[_0x2109('0x21')]);router[_0x2109('0x7')](_0x2109('0x22'),auth[_0x2109('0x9')](),controller['getTeams']);router['get'](_0x2109('0x23'),auth[_0x2109('0x9')](),controller[_0x2109('0x24')]);router[_0x2109('0x7')]('/:id/agents',auth[_0x2109('0x9')](),controller[_0x2109('0x25')]);router[_0x2109('0x7')](_0x2109('0x26'),auth[_0x2109('0x9')](),controller[_0x2109('0x27')]);router[_0x2109('0x7')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2109('0x28')]);router[_0x2109('0x7')](_0x2109('0x29'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x2109('0x7')](_0x2109('0x2a'),auth[_0x2109('0x9')](),controller[_0x2109('0x2b')]);router[_0x2109('0x7')](_0x2109('0x2c'),auth[_0x2109('0x9')](),controller[_0x2109('0x2d')]);router[_0x2109('0x7')](_0x2109('0x2e'),auth['isAuthenticated'](),controller[_0x2109('0x2f')]);router[_0x2109('0x7')](_0x2109('0x30'),auth['isAuthenticated'](),controller[_0x2109('0x31')]);router[_0x2109('0x7')](_0x2109('0x32'),auth[_0x2109('0x9')](),controller[_0x2109('0x33')]);router[_0x2109('0x7')](_0x2109('0x34'),auth[_0x2109('0x9')](),controller['getScheduledCalls']);router[_0x2109('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x2109('0x35')]);router['post'](_0x2109('0x36'),auth[_0x2109('0x9')](),controller[_0x2109('0x37')]);router[_0x2109('0x38')](_0x2109('0xf'),auth['isAuthenticated'](),controller[_0x2109('0x39')]);router[_0x2109('0x38')]('/',auth['isAuthenticated'](),controller[_0x2109('0x3a')]);router[_0x2109('0x38')](_0x2109('0x11'),auth[_0x2109('0x9')](),controller[_0x2109('0x3b')]);var upload=multer({'storage':multer[_0x2109('0x3c')]({'destination':function(_0x5c55c1,_0x2b6dee,_0x35b063){_0x35b063(null,path[_0x2109('0x3d')](config[_0x2109('0x3e')],_0x2109('0x3f')));},'filename':function(_0x386618,_0x4af2ec,_0x5cc04f){_0x5cc04f(null,util[_0x2109('0x40')]('%s-%s',Date[_0x2109('0x41')](),_0x4af2ec['originalname']));}})});router[_0x2109('0x38')](_0x2109('0xd'),upload[_0x2109('0x42')](_0x2109('0x43')),controller['addAvatar']);router[_0x2109('0x38')](_0x2109('0x44'),auth[_0x2109('0x9')](),controller['login']);router['post'](_0x2109('0x45'),auth[_0x2109('0x9')](),controller['logout']);router['post'](_0x2109('0x46'),auth[_0x2109('0x9')](),controller[_0x2109('0x47')]);router['post'](_0x2109('0x48'),auth[_0x2109('0x9')](),controller['unpause']);router['post'](_0x2109('0x22'),auth['isAuthenticated'](),controller[_0x2109('0x49')]);router[_0x2109('0x38')](_0x2109('0x4a'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x2109('0x38')](_0x2109('0x4b'),auth['isAuthenticated'](),controller[_0x2109('0x4c')]);router['post'](_0x2109('0x4d'),auth[_0x2109('0x9')](),controller[_0x2109('0x4e')]);router[_0x2109('0x38')](_0x2109('0x4f'),auth[_0x2109('0x9')](),controller[_0x2109('0x50')]);router['post']('/:id/openchannel_interactions',auth[_0x2109('0x9')](),controller[_0x2109('0x51')]);router[_0x2109('0x38')](_0x2109('0x52'),auth[_0x2109('0x9')](),controller[_0x2109('0x53')]);router[_0x2109('0x38')]('/:id/fax_accounts',auth[_0x2109('0x9')](),controller[_0x2109('0x54')]);router['post'](_0x2109('0x29'),auth[_0x2109('0x9')](),controller[_0x2109('0x55')]);router['post'](_0x2109('0x2a'),auth[_0x2109('0x9')](),controller[_0x2109('0x56')]);router[_0x2109('0x38')](_0x2109('0x2c'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x2109('0x38')]('/:id/chat_websites',auth[_0x2109('0x9')](),controller[_0x2109('0x57')]);router[_0x2109('0x38')](_0x2109('0x30'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x2109('0x38')](_0x2109('0x32'),auth[_0x2109('0x9')](),controller['addSquareProjects']);router[_0x2109('0x38')](_0x2109('0x58'),auth[_0x2109('0x9')](),controller['createApiKey']);router[_0x2109('0x59')](_0x2109('0xb'),auth['isAuthenticated'](),controller[_0x2109('0x5a')]);router[_0x2109('0x59')](_0x2109('0x5b'),auth[_0x2109('0x9')](),controller['changePassword']);router[_0x2109('0x5c')](_0x2109('0x11'),auth[_0x2109('0x9')](),controller[_0x2109('0x5d')]);router[_0x2109('0x5c')](_0x2109('0x22'),auth['isAuthenticated'](),controller[_0x2109('0x5e')]);router[_0x2109('0x5c')](_0x2109('0xb'),auth[_0x2109('0x9')](),controller[_0x2109('0x5f')]);router[_0x2109('0x5c')](_0x2109('0x4a'),auth['isAuthenticated'](),controller[_0x2109('0x60')]);router[_0x2109('0x5c')](_0x2109('0x4b'),auth[_0x2109('0x9')](),controller['removeMailInteractions']);router[_0x2109('0x5c')]('/:id/fax_interactions',auth[_0x2109('0x9')](),controller['removeFaxInteractions']);router[_0x2109('0x5c')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x2109('0x61')]);router[_0x2109('0x5c')](_0x2109('0x62'),auth[_0x2109('0x9')](),controller['removeOpenchannelInteractions']);router[_0x2109('0x5c')]('/:id/whatsapp_interactions',auth[_0x2109('0x9')](),controller[_0x2109('0x63')]);router[_0x2109('0x5c')]('/:id/fax_accounts',auth[_0x2109('0x9')](),controller[_0x2109('0x64')]);router[_0x2109('0x5c')](_0x2109('0x29'),auth[_0x2109('0x9')](),controller[_0x2109('0x65')]);router[_0x2109('0x5c')]('/:id/openchannel_accounts',auth[_0x2109('0x9')](),controller[_0x2109('0x66')]);router[_0x2109('0x5c')](_0x2109('0x2c'),auth[_0x2109('0x9')](),controller['removeSmsAccounts']);router[_0x2109('0x5c')]('/:id/chat_websites',auth[_0x2109('0x9')](),controller[_0x2109('0x67')]);router[_0x2109('0x5c')](_0x2109('0x30'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete']('/:id/square_projects',auth[_0x2109('0x9')](),controller[_0x2109('0x68')]);router[_0x2109('0x5c')](_0x2109('0x58'),auth[_0x2109('0x9')](),controller['removeApiKey']);module[_0x2109('0x69')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index dbf8276..8e349de 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 _0xffa1=['outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','refuse','originate','uas','fingerprint','actpass','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update'];(function(_0x19e696,_0x2055f6){var _0x4f8eb7=function(_0x45d895){while(--_0x45d895){_0x19e696['push'](_0x19e696['shift']());}};_0x4f8eb7(++_0x2055f6);}(_0xffa1,0xde));var _0x1ffa=function(_0x246c54,_0x52c8e6){_0x246c54=_0x246c54-0x0;var _0x5b0011=_0xffa1[_0x246c54];return _0x5b0011;};'use strict';var Sequelize=require(_0x1ffa('0x0'));var moment=require(_0x1ffa('0x1'));var util=require(_0x1ffa('0x2'));var _=require(_0x1ffa('0x3'));module['exports']={'name':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'unique':_0x1ffa('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7239bb){this[_0x1ffa('0x6')](_0x1ffa('0x5'),_0x7239bb);this['setDataValue'](_0x1ffa('0x7'),_0x7239bb);},'comment':_0x1ffa('0x8')},'fullname':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'set':function(_0x4d2c26){this[_0x1ffa('0x6')]('fullname',_0x4d2c26);this['setDataValue'](_0x1ffa('0x9'),util[_0x1ffa('0xa')](_0x1ffa('0xb'),_0x4d2c26,this['getDataValue'](_0x1ffa('0xc'))));}},'alias':{'type':Sequelize[_0x1ffa('0x4')]},'email':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'unique':_0x1ffa('0xd'),'validate':{'isEmail':!![]},'set':function(_0x3601e2){if(_0x3601e2){this[_0x1ffa('0x6')](_0x1ffa('0xd'),_0x3601e2[_0x1ffa('0xe')]());}}},'role':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x10'),_0x1ffa('0x11'),_0x1ffa('0x12'),_0x1ffa('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1ffa('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x35ffcb){this[_0x1ffa('0x6')](_0x1ffa('0xc'),_0x35ffcb);this[_0x1ffa('0x6')](_0x1ffa('0x15'),_0x35ffcb);this['setDataValue'](_0x1ffa('0x9'),util[_0x1ffa('0xa')](_0x1ffa('0xb'),this['getDataValue'](_0x1ffa('0x16')),_0x35ffcb));}},'salt':{'type':Sequelize[_0x1ffa('0x4')]},'phone':{'type':Sequelize[_0x1ffa('0x4')]},'mobile':{'type':Sequelize[_0x1ffa('0x4')]},'address':{'type':Sequelize[_0x1ffa('0x4')]},'zipcode':{'type':Sequelize[_0x1ffa('0x4')]},'userpic':{'type':Sequelize[_0x1ffa('0x4')]},'city':{'type':Sequelize[_0x1ffa('0x4')]},'country':{'type':Sequelize[_0x1ffa('0x4')]},'online':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1ffa('0x4')],'defaultValue':_0x1ffa('0x18')},'lastPauseAt':{'type':Sequelize[_0x1ffa('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x1ffa('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1ffa('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1ffa('0x1a')},'ipaddr':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x1b'),_0x1ffa('0x11'),_0x1ffa('0x1c')),'allowNull':!![],'defaultValue':_0x1ffa('0x1b')},'context':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![],'defaultValue':_0x1ffa('0x1d')},'callingpres':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x1e'),'ALLOWED_PASSED_SCREEN',_0x1ffa('0x1f'),_0x1ffa('0x20'),_0x1ffa('0x21'),_0x1ffa('0x22'),_0x1ffa('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![],'defaultValue':_0x1ffa('0x24'),'set':function(_0x1d39e2){this['setDataValue']('transport',_0x1d39e2?_0x1d39e2['join'](','):null);},'get':function(){return this[_0x1ffa('0x25')](_0x1ffa('0x26'))?this[_0x1ffa('0x25')](_0x1ffa('0x26'))[_0x1ffa('0x27')](','):null;},'comment':_0x1ffa('0x28')},'dtmfmode':{'type':Sequelize['ENUM'](_0x1ffa('0x29'),'info',_0x1ffa('0x2a'),_0x1ffa('0x2b'),_0x1ffa('0x2c')),'allowNull':!![],'defaultValue':_0x1ffa('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x1ffa('0x2d'),'no',_0x1ffa('0x2e'),_0x1ffa('0x2f'),_0x1ffa('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![],'defaultValue':_0x1ffa('0x31'),'set':function(_0x24836f){this[_0x1ffa('0x6')](_0x1ffa('0x32'),_0x24836f?_0x24836f[_0x1ffa('0x33')](','):null);},'get':function(){return this[_0x1ffa('0x25')](_0x1ffa('0x32'))?this['getDataValue'](_0x1ffa('0x32'))[_0x1ffa('0x27')](','):null;},'comment':_0x1ffa('0x34')},'callgroup':{'type':Sequelize[_0x1ffa('0x4')]},'namedcallgroup':{'type':Sequelize[_0x1ffa('0x4')]},'pickupgroup':{'type':Sequelize[_0x1ffa('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x1ffa('0x4')]},'language':{'type':Sequelize[_0x1ffa('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1ffa('0x4')]},'disallow':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'defaultValue':_0x1ffa('0x35')},'allow':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':![],'defaultValue':_0x1ffa('0x36'),'set':function(_0x340286){this['setDataValue'](_0x1ffa('0x37'),_0x340286?_0x340286[_0x1ffa('0x33')](';'):_0x1ffa('0x36'));},'get':function(){return this[_0x1ffa('0x25')](_0x1ffa('0x37'))?this[_0x1ffa('0x25')]('allow')[_0x1ffa('0x27')](';'):null;},'comment':_0x1ffa('0x38')},'autoframing':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![],'set':function(_0x535fc1){this[_0x1ffa('0x6')]('insecure',_0x535fc1?_0x535fc1[_0x1ffa('0x33')](','):null);},'get':function(){return this[_0x1ffa('0x25')](_0x1ffa('0x39'))?this[_0x1ffa('0x25')]('insecure')[_0x1ffa('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no',_0x1ffa('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x1ffa('0x2d')},'busylevel':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1ffa('0xf')]('accept',_0x1ffa('0x3b'),_0x1ffa('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1ffa('0xf')]('uac',_0x1ffa('0x3d')),'allowNull':!![],'defaultValue':_0x1ffa('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x1ffa('0x2d'),'no',_0x1ffa('0x3e'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1ffa('0xf')]('active','passive',_0x1ffa('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1ffa('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1ffa('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no',_0x1ffa('0x2e'),_0x1ffa('0x2f'),_0x1ffa('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x1ffa('0x19')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x566b55){this['setDataValue'](_0x1ffa('0x41'),_0x566b55);var _0x19c59d=this[_0x1ffa('0x42')]({'plain':!![]});switch(_0x566b55){case 0x0:case 0x1:var _0x24cb1c=_0x19c59d['transport']?_[_0x1ffa('0x43')](_0x19c59d[_0x1ffa('0x26')])?_0x19c59d['transport'][_0x1ffa('0x33')]():_0x19c59d[_0x1ffa('0x26')]:_0x1ffa('0x24');if(_0x24cb1c===_0x1ffa('0x44')){_0x24cb1c=_0x1ffa('0x24');}this['setDataValue']('transport',_0x24cb1c);this[_0x1ffa('0x6')](_0x1ffa('0x45'),'no');this[_0x1ffa('0x6')](_0x1ffa('0x46'),null);this[_0x1ffa('0x6')](_0x1ffa('0x47'),null);this[_0x1ffa('0x6')](_0x1ffa('0x48'),null);this[_0x1ffa('0x6')](_0x1ffa('0x49'),null);this['setDataValue'](_0x1ffa('0x4a'),null);this['setDataValue'](_0x1ffa('0x4b'),null);this['setDataValue'](_0x1ffa('0x4c'),null);this['setDataValue']('dtlsprivatekey',null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x1ffa('0x6')](_0x1ffa('0x26'),_0x1ffa('0x44'));this[_0x1ffa('0x6')](_0x1ffa('0x45'),_0x1ffa('0x2d'));this[_0x1ffa('0x6')](_0x1ffa('0x46'),'yes');this[_0x1ffa('0x6')]('force_avp',_0x1ffa('0x2d'));this['setDataValue']('icesupport',_0x1ffa('0x2d'));this[_0x1ffa('0x6')]('dtlsenable',_0x1ffa('0x2d'));this[_0x1ffa('0x6')]('dtlsverify','no');this[_0x1ffa('0x6')]('dtlssetup',_0x1ffa('0x3f'));this['setDataValue']('dtlscertfile',_0x19c59d[_0x1ffa('0x4c')]||_0x1ffa('0x4d'));this['setDataValue'](_0x1ffa('0x4e'),_0x19c59d['dtlsprivatekey']||_0x1ffa('0x4f'));this[_0x1ffa('0x6')]('rtcp_mux',_0x1ffa('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x1ffa('0x50')],'set':function(_0x246e17){this[_0x1ffa('0x6')](_0x1ffa('0x51'),_0x246e17?_0x246e17[_0x1ffa('0x33')](','):[]);},'get':function(){return this['getDataValue'](_0x1ffa('0x51'))?_[_0x1ffa('0x52')](this[_0x1ffa('0x25')](_0x1ffa('0x51'))[_0x1ffa('0x27')](','),function(_0x27dd12){return parseInt(_0x27dd12,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1ffa('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1ffa('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1ffa('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1ffa('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1ffa('0xf')](_0x1ffa('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x1ffa('0x19')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1ffa('0x25')](_0x1ffa('0x53'))?this['getDataValue'](_0x1ffa('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1ffa('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![],'set':function(_0x1acedf){if(typeof _0x1acedf===_0x1ffa('0x54')){var _0x5eec0e=_0x1acedf==='1'?!![]:_0x1acedf==='0'?![]:_0x1acedf===_0x1ffa('0x55')?!![]:_0x1acedf==='false'?![]:![];this[_0x1ffa('0x6')](_0x1ffa('0x56'),_0x5eec0e);}else{this[_0x1ffa('0x6')](_0x1ffa('0x56'),_0x1acedf);}}},'blocked':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![],'set':function(_0x146a54){this[_0x1ffa('0x6')](_0x1ffa('0x57'),_0x146a54);if(_0x146a54===!![]){this[_0x1ffa('0x6')](_0x1ffa('0x58'),moment());this[_0x1ffa('0x6')](_0x1ffa('0x59'),0x0);}else{this[_0x1ffa('0x6')](_0x1ffa('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x1ffa('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1ffa('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1ffa('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x35de=['actpass','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlsprivatekey','rtcp_mux','encryption','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','local','INTEGER','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','originate','uas','fingerprint','certificate','active'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x35de,0x161));var _0xe35d=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x35de[_0x5a2285];return _0x48f6ed;};'use strict';var Sequelize=require(_0xe35d('0x0'));var moment=require(_0xe35d('0x1'));var util=require(_0xe35d('0x2'));var _=require('lodash');module[_0xe35d('0x3')]={'name':{'type':Sequelize[_0xe35d('0x4')],'allowNull':![],'unique':_0xe35d('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4900b2){this[_0xe35d('0x6')](_0xe35d('0x5'),_0x4900b2);this[_0xe35d('0x6')](_0xe35d('0x7'),_0x4900b2);},'comment':_0xe35d('0x8')},'fullname':{'type':Sequelize[_0xe35d('0x4')],'allowNull':![],'set':function(_0x2777e3){this[_0xe35d('0x6')](_0xe35d('0x9'),_0x2777e3);this[_0xe35d('0x6')]('callerid',util[_0xe35d('0xa')](_0xe35d('0xb'),_0x2777e3,this[_0xe35d('0xc')](_0xe35d('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe35d('0xe'),'validate':{'isEmail':!![]},'set':function(_0x264500){if(_0x264500){this[_0xe35d('0x6')](_0xe35d('0xe'),_0x264500['toLowerCase']());}}},'role':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x10'),_0xe35d('0x11'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xe35d('0x4')],'defaultValue':_0xe35d('0x12')},'internal':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':![],'unique':'internal','set':function(_0x2885a8){this[_0xe35d('0x6')](_0xe35d('0xd'),_0x2885a8);this[_0xe35d('0x6')]('accountcode',_0x2885a8);this[_0xe35d('0x6')](_0xe35d('0x14'),util[_0xe35d('0xa')](_0xe35d('0xb'),this['getDataValue']('fullname'),_0x2885a8));}},'salt':{'type':Sequelize[_0xe35d('0x4')]},'phone':{'type':Sequelize[_0xe35d('0x4')]},'mobile':{'type':Sequelize[_0xe35d('0x4')]},'address':{'type':Sequelize[_0xe35d('0x4')]},'zipcode':{'type':Sequelize[_0xe35d('0x4')]},'userpic':{'type':Sequelize[_0xe35d('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe35d('0x4')]},'online':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xe35d('0x16')]},'voicePause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xe35d('0x17')},'lastPauseAt':{'type':Sequelize[_0xe35d('0x16')]},'chatCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xe35d('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xe35d('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xe35d('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x18'),_0xe35d('0x11'),_0xe35d('0x19')),'allowNull':!![],'defaultValue':_0xe35d('0x18')},'context':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xe35d('0xf')]('ALLOWED_NOT_SCREENED',_0xe35d('0x1a'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xe35d('0x1b'),_0xe35d('0x1c'),_0xe35d('0x1d'),_0xe35d('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![],'defaultValue':_0xe35d('0x1f'),'set':function(_0x2c02f5){this['setDataValue']('transport',_0x2c02f5?_0x2c02f5[_0xe35d('0x20')](','):null);},'get':function(){return this[_0xe35d('0xc')](_0xe35d('0x21'))?this[_0xe35d('0xc')](_0xe35d('0x21'))[_0xe35d('0x22')](','):null;},'comment':_0xe35d('0x23')},'dtmfmode':{'type':Sequelize[_0xe35d('0xf')]('rfc2833','info',_0xe35d('0x24'),'inband',_0xe35d('0x25')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no',_0xe35d('0x27'),_0xe35d('0x28'),_0xe35d('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x239fc7){this[_0xe35d('0x6')](_0xe35d('0x2a'),_0x239fc7?_0x239fc7[_0xe35d('0x20')](','):null);},'get':function(){return this[_0xe35d('0xc')](_0xe35d('0x2a'))?this[_0xe35d('0xc')]('nat')[_0xe35d('0x22')](','):null;},'comment':_0xe35d('0x2b')},'callgroup':{'type':Sequelize[_0xe35d('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xe35d('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xe35d('0x4')]},'language':{'type':Sequelize[_0xe35d('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe35d('0x4')]},'disallow':{'type':Sequelize[_0xe35d('0x4')],'allowNull':![],'defaultValue':_0xe35d('0x2c')},'allow':{'type':Sequelize[_0xe35d('0x4')],'allowNull':![],'defaultValue':_0xe35d('0x2d'),'set':function(_0x383adc){this['setDataValue']('allow',_0x383adc?_0x383adc[_0xe35d('0x20')](';'):_0xe35d('0x2d'));},'get':function(){return this['getDataValue'](_0xe35d('0x2e'))?this[_0xe35d('0xc')](_0xe35d('0x2e'))[_0xe35d('0x22')](';'):null;},'comment':_0xe35d('0x2f')},'autoframing':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![],'set':function(_0x8a928){this[_0xe35d('0x6')](_0xe35d('0x30'),_0x8a928?_0x8a928['join'](','):null);},'get':function(){return this[_0xe35d('0xc')](_0xe35d('0x30'))?this[_0xe35d('0xc')](_0xe35d('0x30'))[_0xe35d('0x22')](','):null;},'comment':_0xe35d('0x31')},'trustrpid':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe35d('0xf')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xe35d('0x32')},'amaflags':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':_0xe35d('0x26')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xe35d('0x33'),'refuse',_0xe35d('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xe35d('0xf')]('uac',_0xe35d('0x35')),'allowNull':!![],'defaultValue':_0xe35d('0x35')},'t38pt_usertpsource':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':_0xe35d('0x26')},'keepalive':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no',_0xe35d('0x36'),_0xe35d('0x37')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xe35d('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xe35d('0x38'),'passive',_0xe35d('0x39')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xe35d('0xf')]('yes','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['ENUM'](_0xe35d('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xe35d('0xf')](_0xe35d('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat','update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xe35d('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xe35d('0x16')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1760d0){this[_0xe35d('0x6')](_0xe35d('0x3a'),_0x1760d0);var _0x1c942e=this[_0xe35d('0x3b')]({'plain':!![]});switch(_0x1760d0){case 0x0:case 0x1:var _0x3aa3ad=_0x1c942e[_0xe35d('0x21')]?_[_0xe35d('0x3c')](_0x1c942e[_0xe35d('0x21')])?_0x1c942e['transport'][_0xe35d('0x20')]():_0x1c942e[_0xe35d('0x21')]:_0xe35d('0x1f');if(_0x3aa3ad===_0xe35d('0x3d')){_0x3aa3ad=_0xe35d('0x1f');}this[_0xe35d('0x6')](_0xe35d('0x21'),_0x3aa3ad);this['setDataValue']('encryption','no');this['setDataValue'](_0xe35d('0x3e'),null);this[_0xe35d('0x6')](_0xe35d('0x3f'),null);this[_0xe35d('0x6')](_0xe35d('0x40'),null);this[_0xe35d('0x6')](_0xe35d('0x41'),null);this[_0xe35d('0x6')]('dtlsverify',null);this[_0xe35d('0x6')]('dtlssetup',null);this[_0xe35d('0x6')]('dtlscertfile',null);this[_0xe35d('0x6')](_0xe35d('0x42'),null);this[_0xe35d('0x6')](_0xe35d('0x43'),'no');break;case 0x2:this[_0xe35d('0x6')]('transport','wss');this[_0xe35d('0x6')](_0xe35d('0x44'),_0xe35d('0x26'));this[_0xe35d('0x6')](_0xe35d('0x3e'),'yes');this[_0xe35d('0x6')](_0xe35d('0x3f'),'yes');this[_0xe35d('0x6')](_0xe35d('0x40'),_0xe35d('0x26'));this[_0xe35d('0x6')](_0xe35d('0x41'),_0xe35d('0x26'));this[_0xe35d('0x6')]('dtlsverify','no');this[_0xe35d('0x6')]('dtlssetup',_0xe35d('0x39'));this[_0xe35d('0x6')](_0xe35d('0x45'),_0x1c942e[_0xe35d('0x45')]||_0xe35d('0x46'));this[_0xe35d('0x6')]('dtlsprivatekey',_0x1c942e[_0xe35d('0x42')]||_0xe35d('0x47'));this[_0xe35d('0x6')](_0xe35d('0x43'),_0xe35d('0x26'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1b7fb5){this['setDataValue'](_0xe35d('0x48'),_0x1b7fb5?_0x1b7fb5[_0xe35d('0x20')](','):[]);},'get':function(){return this[_0xe35d('0xc')](_0xe35d('0x48'))?_[_0xe35d('0x49')](this[_0xe35d('0xc')](_0xe35d('0x48'))[_0xe35d('0x22')](','),function(_0x26cb0f){return parseInt(_0x26cb0f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xe35d('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xe35d('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xe35d('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xe35d('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xe35d('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xe35d('0x4')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xe35d('0x4a')],'get':function(){return this[_0xe35d('0xc')](_0xe35d('0x4b'))?this[_0xe35d('0xc')](_0xe35d('0x4b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xe35d('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xe35d('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![],'set':function(_0x546eea){if(typeof _0x546eea===_0xe35d('0x4c')){var _0x8b0e37=_0x546eea==='1'?!![]:_0x546eea==='0'?![]:_0x546eea===_0xe35d('0x4d')?!![]:_0x546eea===_0xe35d('0x4e')?![]:![];this[_0xe35d('0x6')](_0xe35d('0x4f'),_0x8b0e37);}else{this['setDataValue'](_0xe35d('0x4f'),_0x546eea);}}},'blocked':{'type':Sequelize[_0xe35d('0x15')],'defaultValue':![],'set':function(_0x5e1ba8){this[_0xe35d('0x6')](_0xe35d('0x50'),_0x5e1ba8);if(_0x5e1ba8===!![]){this['setDataValue'](_0xe35d('0x51'),moment());this[_0xe35d('0x6')]('loginAttempts',0x0);}else{this['setDataValue'](_0xe35d('0x51'),null);}}},'blockedAt':{'type':Sequelize[_0xe35d('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xe35d('0x13')],'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 3dd8802..8f3864a 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 _0x9bc1=['Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$lt','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','Contact','dialActive','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','Sequelize','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','includes','role','find','value','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','model','salt','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','sequelize','lower','col','options','include','findAll','rows','catch','show','differenceBy','password','includeAll','merge','bulkCreate','body','describe','params','addContacts','ids','agent\x20role','admin','../../config/license/util','telephones','users','isNil','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','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)','from','voicemail','VoiceMail','fullname','email','permissions','101','102','103','113','110','106','108','100','114','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','oldPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','online','loginInPause','voicePause','interface','isValidChannel','add','toLowerCase','penalty','capitalize','emit','Queue:save','voice','VoiceQueue','push','each','upsert','removeQueues','channel','Unknown\x20channel','remove','Queues','QueueId','UserVoiceQueueRt','addAvatar','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','findOne','getContacts','CmList','List','Tag','Tags','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','unpause','manual','mail','chat','fax','sms','whatsapp','openchannel','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','Openchannel','transaction','getDataValue','removeTeams','Fax'];(function(_0x5d7866,_0x3e3a05){var _0x1bd279=function(_0x160212){while(--_0x160212){_0x5d7866['push'](_0x5d7866['shift']());}};_0x1bd279(++_0x3e3a05);}(_0x9bc1,0x1c1));var _0x19bc=function(_0x22089b,_0x2e9648){_0x22089b=_0x22089b-0x0;var _0x403a74=_0x9bc1[_0x22089b];return _0x403a74;};'use strict';var pdf=require(_0x19bc('0x0'));var emlformat=require(_0x19bc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x19bc('0x2'));var rp=require(_0x19bc('0x3'));var moment=require(_0x19bc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x19bc('0x5'));var util=require(_0x19bc('0x6'));var path=require(_0x19bc('0x7'));var sox=require(_0x19bc('0x8'));var csv=require(_0x19bc('0x9'));var ejs=require(_0x19bc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x19bc('0xb'));var crypto=require(_0x19bc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x19bc('0xd'));var toCsv=require(_0x19bc('0x9'));var querystring=require(_0x19bc('0xe'));var Papa=require(_0x19bc('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19bc('0x10'));var as=require(_0x19bc('0x11'));var hardwareService=require(_0x19bc('0x12'));var logger=require(_0x19bc('0x13'))(_0x19bc('0x14'));var utils=require(_0x19bc('0x15'));var config=require(_0x19bc('0x16'));var db=require(_0x19bc('0x17'))['db'];config[_0x19bc('0x18')]=_['defaults'](config[_0x19bc('0x18')],{'host':_0x19bc('0x19'),'port':0x18eb});var socket=require(_0x19bc('0x1a'))(new Redis(config[_0x19bc('0x18')]));require(_0x19bc('0x1b'))[_0x19bc('0x1c')](socket);var jayson=require(_0x19bc('0x1d'));var client=jayson[_0x19bc('0x1e')][_0x19bc('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x4ffa4a,_0x2934fa,_0x36726f){if(_0x36726f){var _0x43d05c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43d05c[_0x19bc('0x20')](_0x2934fa)){return _0x4ffa4a;}else{throw new db[(_0x19bc('0x21'))]['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 _0x4ffa4a;}}function respondWithRpcPromise(_0x12f003,_0x56877a,_0x3b794e,_0x4890e8){return new BPromise(function(_0x2c7f76,_0x2d8d18){var _0x35025c=_0x4890e8||client;return _0x35025c[_0x19bc('0x22')](_0x12f003,_0x3b794e)[_0x19bc('0x23')](function(_0x2a1d64){logger[_0x19bc('0x24')](_0x19bc('0x25'),_0x56877a,_0x19bc('0x26'));logger['debug'](_0x19bc('0x27'),_0x56877a,_0x19bc('0x26'),JSON[_0x19bc('0x28')](_0x2a1d64));if(_0x2a1d64['error']){if(_0x2a1d64[_0x19bc('0x29')][_0x19bc('0x2a')]===0x1f4){logger[_0x19bc('0x29')](_0x19bc('0x25'),_0x56877a,_0x2a1d64[_0x19bc('0x29')][_0x19bc('0x2b')]);return _0x2d8d18(_0x2a1d64[_0x19bc('0x29')][_0x19bc('0x2b')]);}logger['error']('User,\x20%s,\x20%s',_0x56877a,_0x2a1d64[_0x19bc('0x29')]['message']);return _0x2c7f76(_0x2a1d64[_0x19bc('0x29')][_0x19bc('0x2b')]);}else{logger['info'](_0x19bc('0x25'),_0x56877a,_0x19bc('0x26'));_0x2c7f76(_0x2a1d64[_0x19bc('0x2c')][_0x19bc('0x2b')]);}})['catch'](function(_0x5b474d){logger[_0x19bc('0x29')](_0x19bc('0x25'),_0x56877a,_0x5b474d);_0x2d8d18(_0x5b474d);});});}function respondWithStatusCode(_0x1932d9,_0x5d6894){_0x5d6894=_0x5d6894||0xcc;return function(_0x20a27b){if(_0x20a27b){return _0x1932d9[_0x19bc('0x2d')](_0x5d6894);}return _0x1932d9['status'](_0x5d6894)['end']();};}function respondWithResult(_0x214783,_0x265a8c){_0x265a8c=_0x265a8c||0xc8;return function(_0x1ef242){if(_0x1ef242){return _0x214783[_0x19bc('0x2e')](_0x265a8c)['json'](_0x1ef242);}};}function respondWithFilteredResult(_0x331ed1,_0x15ba10){return function(_0xc70408){if(_0xc70408){var _0x272935=_0xc70408[_0x19bc('0x2f')],_0x8a3d24=_0x15ba10[_0x19bc('0x30')],_0x155bc2=_0x15ba10[_0x19bc('0x30')]+_0x15ba10[_0x19bc('0x31')],_0x2d7c22;if(_0x155bc2>=_0x272935){_0x155bc2=_0x272935;_0x2d7c22=0xc8;}else{_0x2d7c22=0xce;}_0x331ed1[_0x19bc('0x2e')](_0x2d7c22);return _0x331ed1[_0x19bc('0x32')](_0x19bc('0x33'),_0x8a3d24+'-'+_0x155bc2+'/'+_0x272935)[_0x19bc('0x34')](_0xc70408);}return null;};}function patchUpdates(_0x3860f0){return function(_0x11c501){try{jsonpatch[_0x19bc('0x35')](_0x11c501,_0x3860f0,!![]);}catch(_0x573b57){return BPromise['reject'](_0x573b57);}return _0x11c501[_0x19bc('0x36')]();};}function saveUpdates(_0x1451c1,_0x2373c8){return function(_0x374ead){if(_0x374ead){return _0x374ead[_0x19bc('0x37')](_0x1451c1)[_0x19bc('0x23')](function(_0x1accbc){return _0x1accbc;});}return null;};}function removeEntity(_0x43a937,_0x17cf20){return function(_0x400ae2){if(_0x400ae2){return _0x400ae2[_0x19bc('0x38')]()['then'](function(){var _0x501074=_0x400ae2[_0x19bc('0x39')]({'plain':!![]});var _0x2080af=[{'name':_0x19bc('0x3a'),'value':_0x19bc('0x3b'),'ignore':!![]},{'name':_0x19bc('0x3c'),'value':_0x19bc('0x3d'),'ignore':![]},{'name':_0x19bc('0x3e'),'value':_0x19bc('0x3f'),'ignore':![]}];var _0x472ed5=_(_0x2080af)[_0x19bc('0x40')](_0x19bc('0x41'))[_0x19bc('0x42')]('value')['value']();if(_[_0x19bc('0x43')](_0x472ed5,_0x501074[_0x19bc('0x44')])){return;}var _0x15eb18=_[_0x19bc('0x45')](_0x2080af,[_0x19bc('0x46'),_0x501074[_0x19bc('0x44')]])[_0x19bc('0x47')];return db[_0x19bc('0x48')][_0x19bc('0x38')]({'where':{'type':_0x15eb18,'resourceId':_0x501074['id']}})[_0x19bc('0x23')](function(){return _0x400ae2;});})[_0x19bc('0x23')](function(){_0x43a937['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f51e,_0x44c991){return function(_0x1996d5){if(!_0x1996d5){_0x46f51e[_0x19bc('0x2d')](0x194);}return _0x1996d5;};}function handleError(_0xaa389,_0x61dd52){_0x61dd52=_0x61dd52||0x1f4;return function(_0x4f74fd){logger[_0x19bc('0x29')](_0x4f74fd[_0x19bc('0x49')]);if(_0x4f74fd[_0x19bc('0x47')]){delete _0x4f74fd[_0x19bc('0x47')];}_0xaa389[_0x19bc('0x2e')](_0x61dd52)[_0x19bc('0x4a')](_0x4f74fd);};}exports[_0x19bc('0x4b')]=function(_0x14cc76,_0x1781c0){var _0x25738e={},_0x56caa9={},_0x1adee4={'count':0x0,'rows':[]};var _0x33ed07=_['map'](db[_0x19bc('0x4c')][_0x19bc('0x4d')],function(_0x37677d){return{'name':_0x37677d[_0x19bc('0x4e')],'type':_0x37677d['type']['key']};});_0x56caa9[_0x19bc('0x4f')]=_['differenceBy'](_[_0x19bc('0x42')](_0x33ed07,_0x19bc('0x47')),['password',_0x19bc('0x50')]);_0x56caa9[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x14cc76[_0x19bc('0x51')]);_0x56caa9[_0x19bc('0x53')]=_['intersection'](_0x56caa9[_0x19bc('0x4f')],_0x56caa9[_0x19bc('0x51')]);_0x25738e[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x56caa9[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x14cc76[_0x19bc('0x51')][_0x19bc('0x56')]));_0x25738e[_0x19bc('0x54')]=_0x25738e[_0x19bc('0x54')][_0x19bc('0x57')]?_0x25738e[_0x19bc('0x54')]:_0x56caa9['model'];if(!_0x14cc76[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x25738e[_0x19bc('0x31')]=qs['limit'](_0x14cc76['query'][_0x19bc('0x31')]);_0x25738e[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x14cc76[_0x19bc('0x51')][_0x19bc('0x30')]);}_0x25738e[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x14cc76[_0x19bc('0x51')]['sort']);_0x25738e[_0x19bc('0x5c')]=qs['filters'](_[_0x19bc('0x5d')](_0x14cc76[_0x19bc('0x51')],_0x56caa9[_0x19bc('0x53')]),_0x33ed07);if(_0x14cc76[_0x19bc('0x51')][_0x19bc('0x40')]){_0x25738e[_0x19bc('0x5c')]=_['merge'](_0x25738e[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x33ed07,function(_0x597eb7){if(_0x597eb7['type']!==_0x19bc('0x5e')){return db[_0x19bc('0x5f')][_0x19bc('0x5c')](db[_0x19bc('0x5f')]['fn'](_0x19bc('0x60'),db['sequelize'][_0x19bc('0x61')](_0x597eb7[_0x19bc('0x47')])),{'$like':db[_0x19bc('0x5f')]['fn']('lower','%'+_0x14cc76[_0x19bc('0x51')][_0x19bc('0x40')]+'%')});}})});}_0x25738e=_['merge']({},_0x25738e,_0x14cc76[_0x19bc('0x62')]);var _0xb15d5f={'where':_0x25738e[_0x19bc('0x5c')]};return db[_0x19bc('0x4c')]['count'](_0xb15d5f)[_0x19bc('0x23')](function(_0x3cb8bb){_0x1adee4[_0x19bc('0x2f')]=_0x3cb8bb;if(_0x14cc76[_0x19bc('0x51')]['includeAll']){_0x25738e[_0x19bc('0x63')]=[{'all':!![]}];}return db[_0x19bc('0x4c')][_0x19bc('0x64')](_0x25738e);})[_0x19bc('0x23')](function(_0x4f294a){_0x1adee4[_0x19bc('0x65')]=_0x4f294a;return _0x1adee4;})[_0x19bc('0x23')](respondWithFilteredResult(_0x1781c0,_0x25738e))[_0x19bc('0x66')](handleError(_0x1781c0,null));};exports[_0x19bc('0x67')]=function(_0x566f97,_0x2e5a75){var _0x474208={'raw':![],'where':{'id':_0x566f97['params']['id']}},_0x5615a4={};_0x5615a4[_0x19bc('0x4f')]=_[_0x19bc('0x68')](_[_0x19bc('0x52')](db[_0x19bc('0x4c')][_0x19bc('0x4d')]),[_0x19bc('0x69'),_0x19bc('0x50')]);_0x5615a4[_0x19bc('0x51')]=_['keys'](_0x566f97[_0x19bc('0x51')]);_0x5615a4[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x5615a4['model'],_0x5615a4[_0x19bc('0x51')]);_0x474208['attributes']=_['intersection'](_0x5615a4[_0x19bc('0x4f')],qs['fields'](_0x566f97[_0x19bc('0x51')]['fields']));_0x474208[_0x19bc('0x54')]=_0x474208[_0x19bc('0x54')][_0x19bc('0x57')]?_0x474208[_0x19bc('0x54')]:_0x5615a4[_0x19bc('0x4f')];if(_0x566f97[_0x19bc('0x51')][_0x19bc('0x6a')]){_0x474208[_0x19bc('0x63')]=[{'all':!![]}];}_0x474208=_[_0x19bc('0x6b')]({},_0x474208,_0x566f97[_0x19bc('0x62')]);return db['User'][_0x19bc('0x45')](_0x474208)['then'](handleEntityNotFound(_0x2e5a75,null))[_0x19bc('0x23')](respondWithResult(_0x2e5a75,null))[_0x19bc('0x66')](handleError(_0x2e5a75,null));};exports[_0x19bc('0x6c')]=function(_0xb0f831,_0x3ca917){return db[_0x19bc('0x4c')]['bulkCreate'](_0xb0f831[_0x19bc('0x6d')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3ca917,0xc9))[_0x19bc('0x66')](handleError(_0x3ca917,null));};exports[_0x19bc('0x37')]=function(_0x951f62,_0x593322){if(_0x951f62[_0x19bc('0x6d')]['id']){delete _0x951f62[_0x19bc('0x6d')]['id'];}delete _0x951f62[_0x19bc('0x6d')][_0x19bc('0x44')];return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x951f62['params']['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x593322,null))['then'](saveUpdates(_0x951f62[_0x19bc('0x6d')],null))[_0x19bc('0x23')](respondWithResult(_0x593322,null))[_0x19bc('0x66')](handleError(_0x593322,null));};exports[_0x19bc('0x6e')]=function(_0x686daf,_0x2e1eca){return db[_0x19bc('0x4c')][_0x19bc('0x6e')]()[_0x19bc('0x23')](respondWithResult(_0x2e1eca,null))[_0x19bc('0x66')](handleError(_0x2e1eca,null));};exports['addContacts']=function(_0x237488,_0x3c11c8,_0x33707d){return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x237488[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x3c11c8,null))[_0x19bc('0x23')](function(_0x68a933){if(_0x68a933){return _0x68a933[_0x19bc('0x70')](_0x237488[_0x19bc('0x6d')]['ids'],_['omit'](_0x237488['body'],[_0x19bc('0x71'),'id'])||{});}})[_0x19bc('0x23')](respondWithResult(_0x3c11c8,null))['catch'](handleError(_0x3c11c8,null));};var getLicense=function(_0x1a1fa7){return new BPromise(function(_0x25f5d2,_0x31bb42){var _0x1b4179=0x0;_0x1a1fa7['body']['role']==='agent'&&_0x25f5d2(_0x19bc('0x72'));return db[_0x19bc('0x4c')][_0x19bc('0x2f')]({'where':{'$or':[{'role':_0x1a1fa7[_0x19bc('0x6d')][_0x19bc('0x44')]===_0x19bc('0x3f')?_0x19bc('0x3f'):[_0x19bc('0x73'),_0x19bc('0x3b')]}]}})['then'](function(_0x3d6456){_0x1b4179=_0x3d6456;return require(_0x19bc('0x74'))['getLicense']();})['then'](function(_0x400356){var _0x5b6db0=_0x1a1fa7['body']['role']===_0x19bc('0x3f')?_0x19bc('0x75'):_0x19bc('0x76');if(!_[_0x19bc('0x77')](_0x400356[_0x5b6db0])&&_0x1b4179>=_0x400356[_0x5b6db0]){return _0x31bb42({'message':'License\x20limit\x20reached'});}return _0x25f5d2(util[_0x19bc('0x78')](_0x19bc('0x79'),_0x5b6db0,_0x1b4179));})['catch'](function(_0x23a53c){return _0x31bb42(_0x23a53c);});});};exports[_0x19bc('0x7a')]=function(_0x13dfcd,_0x193ccf){return getLicense(_0x13dfcd)[_0x19bc('0x23')](function(_0x17e65a){if(!_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x7b')]){var _0x11495b;return db[_0x19bc('0x7c')][_0x19bc('0x7d')](0x1)[_0x19bc('0x23')](function(_0x12dd84){return checkPasswordPattern(_0x12dd84,_0x13dfcd[_0x19bc('0x6d')]['password'],_0x12dd84[_0x19bc('0x7e')]);})['then'](function(_0x19086e){_0x11495b=_0x19086e[_0x19bc('0x7f')];return db[_0x19bc('0x4c')][_0x19bc('0x80')]('internal');})[_0x19bc('0x23')](function(_0x234735){if(_['isNil'](_0x234735)){if(_0x11495b){_0x13dfcd['body']['internal']=_0x11495b;}else{_0x13dfcd[_0x19bc('0x6d')]['internal']=0x1;}}else{if(_[_0x19bc('0x77')](_0x11495b)||_0x11495b==_0x234735){_0x13dfcd[_0x19bc('0x6d')]['internal']=_0x234735+0x1;}else if(_0x11495b>_0x234735){_0x13dfcd['body'][_0x19bc('0x7b')]=_0x11495b;}else{return db[_0x19bc('0x5f')][_0x19bc('0x51')](_0x19bc('0x81'),{'type':db[_0x19bc('0x5f')]['QueryTypes']['SELECT']})[_0x19bc('0x23')](function(_0x12ca92){if(_0x12ca92&&_0x12ca92[_0x19bc('0x57')]){for(var _0x3feb53=0x0,_0x13d751=_0x12ca92['length'];_0x3feb53<_0x13d751&&_[_0x19bc('0x77')](_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x7b')]);_0x3feb53++){if(_0x11495b<=_0x12ca92[_0x3feb53][_0x19bc('0x82')]){_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x7b')]=_0x12ca92[_0x3feb53][_0x19bc('0x82')];}else if(_0x11495b>_0x12ca92[_0x3feb53][_0x19bc('0x82')]&&_0x11495b<=_0x12ca92[_0x3feb53]['to']){_0x13dfcd['body']['internal']=_0x11495b;}}}if(_[_0x19bc('0x77')](_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x7b')])){_0x13dfcd['body']['internal']=_0x234735+0x1;}});}}});}})[_0x19bc('0x23')](function(){if(_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x83')]){_0x13dfcd[_0x19bc('0x6d')]['mailbox']=_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x7b')];_0x13dfcd['body'][_0x19bc('0x84')]={'mailbox':_0x13dfcd[_0x19bc('0x6d')]['internal'],'password':_0x13dfcd['body']['password'],'fullname':_0x13dfcd['body'][_0x19bc('0x85')],'email':_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x86')]};}if(_0x13dfcd[_0x19bc('0x6d')]&&_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x44')]===_0x19bc('0x3d')){if(!_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x87')]){_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x87')]=[_0x19bc('0x88'),_0x19bc('0x89'),_0x19bc('0x8a'),_0x19bc('0x8b'),_0x19bc('0x8c'),'104','105',_0x19bc('0x8d'),'107',_0x19bc('0x8e'),'109',_0x19bc('0x8f'),'111',_0x19bc('0x90')];}}return db[_0x19bc('0x4c')]['create'](_0x13dfcd[_0x19bc('0x6d')],{'include':[{'model':db[_0x19bc('0x84')],'as':_0x19bc('0x84')}]});})['then'](function(_0x2a2931){if(_0x13dfcd[_0x19bc('0x6d')][_0x19bc('0x44')]===_0x19bc('0x3b'))return _0x2a2931;var _0x542661=_0x13dfcd[_0x19bc('0x3b')][_0x19bc('0x39')]({'plain':!![]});if(!_0x542661)throw new Error(_0x19bc('0x91'));if(_0x542661['role']===_0x19bc('0x3b')){var _0xc7b45a=_0x2a2931['get']({'plain':!![]});var _0x52cc00=[{'name':_0x19bc('0x3c'),'value':'agent'},{'name':_0x19bc('0x3e'),'value':'telephone'}];var _0x4e20b4=_[_0x19bc('0x45')](_0x52cc00,[_0x19bc('0x46'),_0xc7b45a[_0x19bc('0x44')]])['name'];return db[_0x19bc('0x92')][_0x19bc('0x45')]({'where':{'name':_0x4e20b4,'userProfileId':_0x542661['userProfileId']},'raw':!![]})[_0x19bc('0x23')](function(_0x30ed9a){if(_0x30ed9a&&_0x30ed9a[_0x19bc('0x93')]===0x0){return db['UserProfileResource'][_0x19bc('0x7a')]({'name':_0xc7b45a['name'],'resourceId':_0xc7b45a['id'],'type':_0x30ed9a[_0x19bc('0x47')],'sectionId':_0x30ed9a['id']},{})['then'](function(){return _0x2a2931;});}else{return _0x2a2931;}})['catch'](function(_0x43fb3c){logger[_0x19bc('0x29')](_0x19bc('0x94'),_0x43fb3c);throw _0x43fb3c;});}return _0x2a2931;})['then'](respondWithResult(_0x193ccf,0xc9))[_0x19bc('0x66')](handleError(_0x193ccf,null));};exports['changePassword']=function(_0xc0a0d0,_0x3e77ac,_0x2db380){var _0x369348=![];if(_0xc0a0d0['body']['id']){delete _0xc0a0d0[_0x19bc('0x6d')]['id'];}return db[_0x19bc('0x7c')]['findOne']({'attributes':['id',_0x19bc('0x7e')]})[_0x19bc('0x23')](function(_0x103935){_0x369348=_0x103935[_0x19bc('0x7e')];return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0xc0a0d0[_0x19bc('0x6f')]['id']}});})[_0x19bc('0x23')](function(_0x2454d4){if(_0x2454d4){if(_0x2454d4['id']==_0xc0a0d0[_0x19bc('0x3b')]['id']){if(!_0xc0a0d0['body']['oldPassword']||!_0xc0a0d0[_0x19bc('0x6d')][_0x19bc('0x95')]){throw new db['Sequelize'][(_0x19bc('0x96'))](_0x19bc('0x97'));}if(!_0x2454d4[_0x19bc('0x98')](_0xc0a0d0[_0x19bc('0x6d')]['oldPassword'])){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0x99'));}if(_0xc0a0d0[_0x19bc('0x6d')][_0x19bc('0x9a')]==_0xc0a0d0['body']['newPassword']){throw new db['Sequelize'][(_0x19bc('0x96'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x2454d4;}else if(_0xc0a0d0[_0x19bc('0x3b')]['role']=='admin'){if(!_0xc0a0d0['body'][_0x19bc('0x95')]){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0x9b'));}return _0x2454d4;}else if(_0xc0a0d0[_0x19bc('0x3b')][_0x19bc('0x44')]==_0x19bc('0x3b')){if(!_0xc0a0d0[_0x19bc('0x6d')]['newPassword']){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0x9b'));}if(_0x2454d4[_0x19bc('0x44')]!='agent'){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))]('Unauthorized');}return _0x2454d4;}else{throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0x9c'));}}return null;})[_0x19bc('0x23')](handleEntityNotFound(_0x3e77ac,null))[_0x19bc('0x23')](function(_0x4865a4){return checkPasswordPattern(_0x4865a4,_0xc0a0d0['body'][_0x19bc('0x95')],_0x369348);})[_0x19bc('0x23')](saveUpdates({'password':_0xc0a0d0[_0x19bc('0x6d')][_0x19bc('0x95')],'passwordResetAt':_0xc0a0d0[_0x19bc('0x3b')]['id']==_0xc0a0d0[_0x19bc('0x6f')]['id']?moment():null},null))['then'](respondWithResult(_0x3e77ac,null))[_0x19bc('0x66')](handleError(_0x3e77ac,null));};exports[_0x19bc('0x9d')]=function(_0x4c847f,_0x3a4b46,_0x353a5a){var _0x5eea5a=_0x4c847f[_0x19bc('0x6d')]['channel'];return db['User'][_0x19bc('0x45')]({'where':{'id':_0x4c847f['params']['id']},'attributes':['id','name',_0x19bc('0x44'),_0x19bc('0x9e'),_0x19bc('0x9f'),_0x19bc('0xa0'),_0x19bc('0xa1')]})[_0x19bc('0x23')](handleEntityNotFound(_0x3a4b46,null))[_0x19bc('0x23')](function(_0x4795b6){if(_0x4795b6){if(!utils[_0x19bc('0xa2')](_0x5eea5a)){throw new db['Sequelize'][(_0x19bc('0x96'))]('Unknown\x20channel');}return _0x4795b6[_0x19bc('0xa3')+_['capitalize'](_0x5eea5a[_0x19bc('0xa4')]())+'Queues'](_0x4c847f[_0x19bc('0x6d')][_0x19bc('0x71')],{'penalty':_0x4c847f['body'][_0x19bc('0xa5')]||0x0})['spread'](function(_0x3b6e8d){for(var _0x22cd5b=0x0;_0x22cd5b<_0x4c847f[_0x19bc('0x6d')]['ids'][_0x19bc('0x57')];_0x22cd5b+=0x1){var _0x24e259={'UserId':_0x4c847f[_0x19bc('0x6f')]['id']};_0x24e259[_[_0x19bc('0xa6')](_0x5eea5a[_0x19bc('0xa4')]())+'QueueId']=_0x4c847f[_0x19bc('0x6d')][_0x19bc('0x71')][_0x22cd5b];socket[_0x19bc('0xa7')](_0x19bc('0x3b')+_[_0x19bc('0xa6')](_0x5eea5a[_0x19bc('0xa4')]())+_0x19bc('0xa8'),_0x24e259);}return _0x3b6e8d;})[_0x19bc('0x23')](function(){if(_0x5eea5a===_0x19bc('0xa9')){return db[_0x19bc('0xaa')]['findAll']({'where':{'id':_0x4c847f['body']['ids']||[]},'raw':!![],'attributes':['id',_0x19bc('0x47')]});}})[_0x19bc('0x23')](function(_0x4c9170){var _0x2251db=_0x4795b6['get']({'plain':!![]});var _0x319a8d=[];if(_0x5eea5a===_0x19bc('0xa9')&&_0x2251db[_0x19bc('0x44')]===_0x19bc('0x3d')&&_0x2251db[_0x19bc('0x9e')]){for(var _0xf9d241=0x0;_0xf9d241<_0x4c9170[_0x19bc('0x57')];_0xf9d241+=0x1){_0x319a8d[_0x19bc('0xab')]({'membername':_0x2251db[_0x19bc('0x47')],'UserId':_0x2251db['id'],'queue_name':_0x4c9170[_0xf9d241][_0x19bc('0x47')],'VoiceQueueId':_0x4c9170[_0xf9d241]['id'],'interface':_[_0x19bc('0x77')](_0x2251db[_0x19bc('0xa1')])?util['format']('SIP/%s',_0x2251db[_0x19bc('0x47')]):_0x2251db[_0x19bc('0xa1')],'paused':_0x2251db[_0x19bc('0xa0')]||![],'penalty':_0x4c847f[_0x19bc('0x6d')][_0x19bc('0xa5')]||0x0});}return BPromise[_0x19bc('0xac')](_0x319a8d,function(_0x477020){return db['UserVoiceQueueRt'][_0x19bc('0xad')](_0x477020);});}return _0x4795b6;});}})[_0x19bc('0x23')](respondWithStatusCode(_0x3a4b46,null))[_0x19bc('0x66')](handleError(_0x3a4b46,null));};exports[_0x19bc('0xae')]=function(_0x5bbb06,_0x268ab5,_0x31771c){var _0x3c8342;return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x5bbb06[_0x19bc('0x6f')]['id']},'attributes':['id',_0x19bc('0x47'),_0x19bc('0x44')]})['then'](handleEntityNotFound(_0x268ab5,null))[_0x19bc('0x23')](function(_0x2b3ae0){if(_0x2b3ae0){_0x3c8342=_0x2b3ae0;if(!_0x5bbb06['query'][_0x19bc('0xaf')]||!utils['isValidChannel'](_0x5bbb06[_0x19bc('0x51')][_0x19bc('0xaf')])){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0xb0'));}return _0x2b3ae0[_0x19bc('0xb1')+_[_0x19bc('0xa6')](_0x5bbb06[_0x19bc('0x51')]['channel']['toLowerCase']())+_0x19bc('0xb2')](_0x5bbb06[_0x19bc('0x51')]['ids']);}})[_0x19bc('0x23')](function(_0x40b6ac){for(var _0x2fc823=0x0;_0x2fc823<_0x5bbb06[_0x19bc('0x51')][_0x19bc('0x71')][_0x19bc('0x57')];_0x2fc823+=0x1){var _0x387b43={'UserId':_0x5bbb06['params']['id']};_0x387b43[_[_0x19bc('0xa6')](_0x5bbb06[_0x19bc('0x51')]['channel']['toLowerCase']())+_0x19bc('0xb3')]=_0x5bbb06[_0x19bc('0x51')][_0x19bc('0x71')][_0x2fc823];socket[_0x19bc('0xa7')]('user'+_[_0x19bc('0xa6')](_0x5bbb06['query'][_0x19bc('0xaf')][_0x19bc('0xa4')]())+'Queue:remove',_0x387b43);}return _0x40b6ac;})[_0x19bc('0x23')](function(){if(_0x5bbb06[_0x19bc('0x51')][_0x19bc('0xaf')]===_0x19bc('0xa9')){return db[_0x19bc('0xb4')]['destroy']({'where':{'UserId':_0x5bbb06[_0x19bc('0x6f')]['id'],'VoiceQueueId':_0x5bbb06['query'][_0x19bc('0x71')]},'individualHooks':!![]})[_0x19bc('0x23')](function(){return _0x3c8342;});}return _0x3c8342;})[_0x19bc('0x23')](respondWithStatusCode(_0x268ab5,null))[_0x19bc('0x66')](handleError(_0x268ab5,null));};exports[_0x19bc('0xb5')]=function(_0x18c65b,_0x123aa9,_0x2122a9){_0x18c65b[_0x19bc('0x6d')][_0x19bc('0xb6')]=_0x18c65b[_0x19bc('0xb7')][_0x19bc('0xb8')];return db['User']['find']({'where':{'id':_0x18c65b[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x123aa9,null))[_0x19bc('0x23')](saveUpdates(_0x18c65b[_0x19bc('0x6d')],null))[_0x19bc('0x23')](respondWithResult(_0x123aa9,null))[_0x19bc('0x66')](handleError(_0x123aa9,null));};exports['getAvatar']=function(_0x135c1b,_0x45340a,_0x852144){var _0x4a0eaf=path[_0x19bc('0xb9')](config[_0x19bc('0xba')],_0x19bc('0xbb'));return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x135c1b[_0x19bc('0x6f')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x19bc('0x23')](handleEntityNotFound(_0x45340a,null))[_0x19bc('0x23')](function(_0x1b6370){if(_0x1b6370){if(_[_0x19bc('0x77')](_0x1b6370['userpic'])){return _0x45340a[_0x19bc('0xbc')](_0x4a0eaf);}else{if(!fs[_0x19bc('0xbd')](path[_0x19bc('0xb9')](config['root'],_0x19bc('0xbe'),_0x1b6370[_0x19bc('0xb6')]))){return _0x45340a[_0x19bc('0xbc')](_0x4a0eaf);}return _0x45340a[_0x19bc('0xbc')](path['join'](config[_0x19bc('0xba')],_0x19bc('0xbe'),_0x1b6370[_0x19bc('0xb6')]));}}})['catch'](handleError(_0x45340a,null));};exports['getContacts']=function(_0x5e3b51,_0x35c463,_0x37b4ca){var _0x202704={};var _0x28efcb={};var _0x475b43;var _0x181361;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x5e3b51[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x35c463,null))[_0x19bc('0x23')](function(_0x307604){if(_0x307604){_0x475b43=_0x307604;_0x28efcb[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db['CmContact'][_0x19bc('0x4d')]);_0x28efcb[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x5e3b51[_0x19bc('0x51')]);_0x28efcb[_0x19bc('0x53')]=_['intersection'](_0x28efcb[_0x19bc('0x4f')],_0x28efcb[_0x19bc('0x51')]);_0x202704[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x28efcb['model'],qs['fields'](_0x5e3b51[_0x19bc('0x51')][_0x19bc('0x56')]));_0x202704[_0x19bc('0x54')]=_0x202704[_0x19bc('0x54')][_0x19bc('0x57')]?_0x202704[_0x19bc('0x54')]:_0x28efcb[_0x19bc('0x4f')];_0x202704[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x5e3b51[_0x19bc('0x51')]['sort']);_0x202704[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_['pick'](_0x5e3b51[_0x19bc('0x51')],_0x28efcb[_0x19bc('0x53')]));if(_0x5e3b51[_0x19bc('0x51')]['filter']){_0x202704[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x202704[_0x19bc('0x5c')],{'$or':_['map'](_0x202704[_0x19bc('0x54')],function(_0x4d0eec){var _0x6ada92={};_0x6ada92[_0x4d0eec]={'$like':'%'+_0x5e3b51[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x6ada92;})});}_0x202704=_[_0x19bc('0x6b')]({},_0x202704,_0x5e3b51[_0x19bc('0x62')]);return _0x475b43[_0x19bc('0xc0')](_0x202704);}})[_0x19bc('0x23')](function(_0x2e2889){if(_0x2e2889){_0x181361=_0x2e2889[_0x19bc('0x57')];if(_0x5e3b51[_0x19bc('0x51')][_0x19bc('0x58')]('includeAll')){_0x202704[_0x19bc('0x63')]=[{'model':db[_0x19bc('0xc1')],'as':_0x19bc('0xc2'),'required':![]},{'model':db[_0x19bc('0xc3')],'as':_0x19bc('0xc4'),'attributes':['id',_0x19bc('0x47'),'color'],'where':_0x5e3b51[_0x19bc('0x51')][_0x19bc('0xc5')]?{'id':_0x5e3b51['query']['tag']}:undefined,'required':_0x5e3b51['query'][_0x19bc('0xc5')]?!![]:![]}];}if(!_0x5e3b51[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x202704[_0x19bc('0x31')]=qs['limit'](_0x5e3b51[_0x19bc('0x51')]['limit']);_0x202704[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x5e3b51[_0x19bc('0x51')][_0x19bc('0x30')]);}return _0x475b43[_0x19bc('0xc0')](_0x202704);}})['then'](function(_0x828803){if(_0x828803){return _0x828803?{'count':_0x181361,'rows':_0x828803}:null;}})[_0x19bc('0x23')](respondWithResult(_0x35c463,null))[_0x19bc('0x66')](handleError(_0x35c463,null));};exports[_0x19bc('0xc6')]=function(_0xba8380,_0x588b48,_0x1fc042){var _0x414d84;var _0x366c41;var _0x2cc89f={};var _0x3484f6;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0xba8380[_0x19bc('0x6f')]['id']},'attributes':['id',_0x19bc('0x47'),_0x19bc('0x44')]})[_0x19bc('0x23')](handleEntityNotFound(_0x588b48,null))[_0x19bc('0x23')](function(_0x56d148){if(!utils[_0x19bc('0xa2')](_0xba8380['query'][_0x19bc('0xaf')])){throw new db[(_0x19bc('0x21'))]['ValidationError'](_0x19bc('0xb0'));}_0x414d84=_0x56d148;var _0x396823={};_0x396823['model']=_[_0x19bc('0x52')](db[_[_0x19bc('0xa6')](_0xba8380[_0x19bc('0x51')][_0x19bc('0xaf')])+'Queue'][_0x19bc('0x4d')]);_0x396823[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0xba8380[_0x19bc('0x51')]);_0x396823['filters']=_[_0x19bc('0x55')](_0x396823[_0x19bc('0x4f')],_0x396823['query']);_0x2cc89f[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x396823['model'],qs['fields'](_0xba8380['query'][_0x19bc('0x56')]));_0x2cc89f['attributes']=_0x2cc89f['attributes'][_0x19bc('0x57')]?_0x2cc89f[_0x19bc('0x54')]:_0x396823['model'];_0x2cc89f[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0xba8380['query'][_0x19bc('0x5b')]);_0x2cc89f[_0x19bc('0x5c')]=qs['filters'](_[_0x19bc('0x5d')](_0xba8380[_0x19bc('0x51')],_0x396823[_0x19bc('0x53')]));if(_0xba8380['query'][_0x19bc('0x40')]){_0x2cc89f[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x2cc89f[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x2cc89f[_0x19bc('0x54')],function(_0x187181){var _0x3b8e8c={};_0x3b8e8c[_0x187181]={'$like':'%'+_0xba8380[_0x19bc('0x51')]['filter']+'%'};return _0x3b8e8c;})});}_0x2cc89f=_['merge']({},_0x2cc89f,_0xba8380[_0x19bc('0x62')]);switch(_0x414d84[_0x19bc('0x44')]){case'admin':return db[_['capitalize'](_0xba8380[_0x19bc('0x51')]['channel'])+_0x19bc('0xc7')][_0x19bc('0x64')](_0x2cc89f);case _0x19bc('0x3b'):case _0x19bc('0x3d'):return _0x414d84[_0x19bc('0x39')+_[_0x19bc('0xa6')](_0xba8380[_0x19bc('0x51')]['channel'])+_0x19bc('0xb2')](_0x2cc89f);default:throw new db[(_0x19bc('0x21'))]['ValidationError'](_0x19bc('0xc8'));}})[_0x19bc('0x23')](function(_0x46d315){_0x3484f6=_0x46d315[_0x19bc('0x57')];if(!_0xba8380[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x2cc89f[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0xba8380[_0x19bc('0x51')][_0x19bc('0x31')]);_0x2cc89f['offset']=qs[_0x19bc('0x30')](_0xba8380[_0x19bc('0x51')][_0x19bc('0x30')]);}switch(_0x414d84[_0x19bc('0x44')]){case _0x19bc('0x73'):return db[_[_0x19bc('0xa6')](_0xba8380['query']['channel'])+'Queue'][_0x19bc('0x64')](_0x2cc89f);case _0x19bc('0x3b'):case _0x19bc('0x3d'):return _0x414d84[_0x19bc('0x39')+_[_0x19bc('0xa6')](_0xba8380[_0x19bc('0x51')][_0x19bc('0xaf')])+_0x19bc('0xb2')](_0x2cc89f);}})['then'](function(_0x254f2c){return{'count':_0x3484f6,'rows':_0x254f2c};})[_0x19bc('0x23')](respondWithResult(_0x588b48,null))[_0x19bc('0x66')](handleError(_0x588b48,null));};exports['getVoiceQueuesRt']=function(_0x5979cf,_0x138f37,_0x3d7802){var _0x216697={};var _0x4daffd={};var _0x880a9e;var _0x1ab877;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x5979cf[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x138f37,null))[_0x19bc('0x23')](function(_0x2d3803){if(_0x2d3803){_0x880a9e=_0x2d3803;_0x4daffd[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0xb4')][_0x19bc('0x4d')]);_0x4daffd[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x5979cf[_0x19bc('0x51')]);_0x4daffd[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x4daffd[_0x19bc('0x4f')],_0x4daffd[_0x19bc('0x51')]);_0x216697[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x4daffd[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x5979cf[_0x19bc('0x51')][_0x19bc('0x56')]));_0x216697[_0x19bc('0x54')]=_0x216697[_0x19bc('0x54')]['length']?_0x216697[_0x19bc('0x54')]:_0x4daffd['model'];_0x216697['order']=qs['sort'](_0x5979cf[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x216697['where']=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x5979cf[_0x19bc('0x51')],_0x4daffd[_0x19bc('0x53')]));if(_0x5979cf['query'][_0x19bc('0x40')]){_0x216697[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x216697[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x216697[_0x19bc('0x54')],function(_0x59deab){var _0x191106={};_0x191106[_0x59deab]={'$like':'%'+_0x5979cf[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x191106;})});}_0x216697=_[_0x19bc('0x6b')]({},_0x216697,_0x5979cf[_0x19bc('0x62')]);return _0x880a9e['getVoiceQueuesRt'](_0x216697);}})[_0x19bc('0x23')](function(_0x466d9d){if(_0x466d9d){_0x1ab877=_0x466d9d[_0x19bc('0x57')];if(!_0x5979cf[_0x19bc('0x51')][_0x19bc('0x58')]('nolimit')){_0x216697[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x5979cf[_0x19bc('0x51')][_0x19bc('0x31')]);_0x216697['offset']=qs['offset'](_0x5979cf[_0x19bc('0x51')]['offset']);}return _0x880a9e[_0x19bc('0xc9')](_0x216697);}})[_0x19bc('0x23')](function(_0x3c8773){if(_0x3c8773){return _0x3c8773?{'count':_0x1ab877,'rows':_0x3c8773}:null;}})[_0x19bc('0x23')](respondWithResult(_0x138f37,null))[_0x19bc('0x66')](handleError(_0x138f37,null));};exports[_0x19bc('0xca')]=function(_0x3d0bd9,_0x25d1c7,_0x4d75ff){var _0x4af036={};var _0x4b80fe={};var _0x204b60;var _0x4ce2b7;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x3d0bd9['params']['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x25d1c7,null))[_0x19bc('0x23')](function(_0x285e03){if(_0x285e03){_0x204b60=_0x285e03;_0x4b80fe[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0xcb')][_0x19bc('0x4d')]);_0x4b80fe[_0x19bc('0x51')]=_['keys'](_0x3d0bd9['query']);_0x4b80fe['filters']=_[_0x19bc('0x55')](_0x4b80fe[_0x19bc('0x4f')],_0x4b80fe[_0x19bc('0x51')]);_0x4af036['attributes']=_['intersection'](_0x4b80fe[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x3d0bd9[_0x19bc('0x51')][_0x19bc('0x56')]));_0x4af036[_0x19bc('0x54')]=_0x4af036['attributes'][_0x19bc('0x57')]?_0x4af036[_0x19bc('0x54')]:_0x4b80fe[_0x19bc('0x4f')];_0x4af036[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x3d0bd9['query'][_0x19bc('0x5b')]);_0x4af036[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x3d0bd9[_0x19bc('0x51')],_0x4b80fe['filters']));if(_0x3d0bd9[_0x19bc('0x51')][_0x19bc('0x40')]){_0x4af036[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x4af036[_0x19bc('0x5c')],{'$or':_['map'](_0x4af036[_0x19bc('0x54')],function(_0x246ca7){var _0x5f35f5={};_0x5f35f5[_0x246ca7]={'$like':'%'+_0x3d0bd9[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x5f35f5;})});}_0x4af036=_[_0x19bc('0x6b')]({},_0x4af036,_0x3d0bd9[_0x19bc('0x62')]);return _0x204b60[_0x19bc('0xca')](_0x4af036);}})[_0x19bc('0x23')](function(_0x145378){if(_0x145378){_0x4ce2b7=_0x145378['length'];if(!_0x3d0bd9[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x4af036[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x3d0bd9['query']['limit']);_0x4af036['offset']=qs['offset'](_0x3d0bd9['query'][_0x19bc('0x30')]);}return _0x204b60['getGroups'](_0x4af036);}})[_0x19bc('0x23')](function(_0xcb0074){if(_0xcb0074){return _0xcb0074?{'count':_0x4ce2b7,'rows':_0xcb0074}:null;}})[_0x19bc('0x23')](respondWithResult(_0x25d1c7,null))[_0x19bc('0x66')](handleError(_0x25d1c7,null));};exports[_0x19bc('0xcc')]=function(_0x1232ba,_0x5e4537,_0x1ffddc){var _0x1528c1={'raw':!![],'where':{}};var _0x5a2667={};var _0x36d65e={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x1232ba[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5e4537,null))['then'](function(_0x483051){if(_0x483051){_0x5a2667[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0xcd')][_0x19bc('0x4d')]);_0x5a2667[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x1232ba[_0x19bc('0x51')]);_0x5a2667[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x5a2667['model'],_0x5a2667[_0x19bc('0x51')]);_0x1528c1[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x5a2667[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x1232ba[_0x19bc('0x51')][_0x19bc('0x56')]));_0x1528c1[_0x19bc('0x54')]=_0x1528c1[_0x19bc('0x54')]['length']?_0x1528c1[_0x19bc('0x54')]:_0x5a2667[_0x19bc('0x4f')];if(!_0x1232ba[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x1528c1[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x1232ba[_0x19bc('0x51')]['limit']);_0x1528c1[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x1232ba['query']['offset']);}_0x1528c1['order']=qs[_0x19bc('0x5b')](_0x1232ba[_0x19bc('0x51')]['sort']);_0x1528c1[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x1232ba[_0x19bc('0x51')],_0x5a2667[_0x19bc('0x53')]));_0x1528c1[_0x19bc('0x5c')][_0x19bc('0xce')]=_0x483051['id'];if(_0x1232ba[_0x19bc('0x51')][_0x19bc('0x40')]){_0x1528c1['where']=_[_0x19bc('0x6b')](_0x1528c1[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x1528c1[_0x19bc('0x54')],function(_0x5351e1){var _0x5010a0={};_0x5010a0[_0x5351e1]={'$like':'%'+_0x1232ba[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x5010a0;})});}_0x1528c1=_[_0x19bc('0x6b')]({},_0x1528c1,_0x1232ba[_0x19bc('0x62')]);return db[_0x19bc('0xcd')][_0x19bc('0x2f')]({'where':_0x1528c1[_0x19bc('0x5c')]})[_0x19bc('0x23')](function(_0x30ad26){_0x36d65e[_0x19bc('0x2f')]=_0x30ad26;if(_0x1232ba[_0x19bc('0x51')]['includeAll']){_0x1528c1[_0x19bc('0x63')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x1528c1);})[_0x19bc('0x23')](function(_0x374dba){_0x36d65e[_0x19bc('0x65')]=_0x374dba;return _0x36d65e;});}})[_0x19bc('0x23')](respondWithFilteredResult(_0x5e4537,_0x1528c1))[_0x19bc('0x66')](handleError(_0x5e4537,null));};exports[_0x19bc('0xcf')]=function(_0x107402,_0x11d46c,_0x49bad5){var _0x1c2efd={'raw':!![],'where':{}};var _0x5af8a9={};var _0x126a32={'count':0x0,'rows':[]};return db['User'][_0x19bc('0xbf')]({'where':{'id':_0x107402[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x11d46c,null))[_0x19bc('0x23')](function(_0xd83246){if(_0xd83246){_0x5af8a9[_0x19bc('0x4f')]=_['keys'](db[_0x19bc('0xd0')][_0x19bc('0x4d')]);_0x5af8a9['query']=_[_0x19bc('0x52')](_0x107402[_0x19bc('0x51')]);_0x5af8a9[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x5af8a9['model'],_0x5af8a9[_0x19bc('0x51')]);_0x1c2efd[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x5af8a9[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x107402[_0x19bc('0x51')][_0x19bc('0x56')]));_0x1c2efd[_0x19bc('0x54')]=_0x1c2efd[_0x19bc('0x54')][_0x19bc('0x57')]?_0x1c2efd[_0x19bc('0x54')]:_0x5af8a9[_0x19bc('0x4f')];if(!_0x107402['query'][_0x19bc('0x58')](_0x19bc('0x59'))){_0x1c2efd[_0x19bc('0x31')]=qs['limit'](_0x107402['query'][_0x19bc('0x31')]);_0x1c2efd['offset']=qs[_0x19bc('0x30')](_0x107402[_0x19bc('0x51')][_0x19bc('0x30')]);}_0x1c2efd[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x107402[_0x19bc('0x51')]['sort']);_0x1c2efd[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x107402[_0x19bc('0x51')],_0x5af8a9[_0x19bc('0x53')]));_0x1c2efd[_0x19bc('0x5c')][_0x19bc('0xce')]=_0xd83246['id'];if(_0x107402[_0x19bc('0x51')][_0x19bc('0x40')]){_0x1c2efd[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x1c2efd[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x1c2efd[_0x19bc('0x54')],function(_0x39d578){var _0x69f53f={};_0x69f53f[_0x39d578]={'$like':'%'+_0x107402[_0x19bc('0x51')]['filter']+'%'};return _0x69f53f;})});}_0x1c2efd=_[_0x19bc('0x6b')]({},_0x1c2efd,_0x107402[_0x19bc('0x62')]);return db[_0x19bc('0xd0')][_0x19bc('0x2f')]({'where':_0x1c2efd['where']})[_0x19bc('0x23')](function(_0x37f3b7){_0x126a32['count']=_0x37f3b7;if(_0x107402['query'][_0x19bc('0x6a')]){_0x1c2efd['include']=[{'all':!![]}];}return db[_0x19bc('0xd0')][_0x19bc('0x64')](_0x1c2efd);})[_0x19bc('0x23')](function(_0x50111b){_0x126a32[_0x19bc('0x65')]=_0x50111b;return _0x126a32;});}})[_0x19bc('0x23')](respondWithFilteredResult(_0x11d46c,_0x1c2efd))[_0x19bc('0x66')](handleError(_0x11d46c,null));};exports[_0x19bc('0xd1')]=function(_0x52a52e,_0x41200f,_0x33eaea){var _0x59f1a8={};var _0x46f6f6={};var _0x292970;var _0x3ec598;return db['User']['findOne']({'where':{'id':_0x52a52e[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x41200f,null))[_0x19bc('0x23')](function(_0x359095){if(_0x359095){_0x292970=_0x359095;_0x46f6f6[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0xd2')][_0x19bc('0x4d')]);_0x46f6f6[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x52a52e['query']);_0x46f6f6[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x46f6f6[_0x19bc('0x4f')],_0x46f6f6['query']);_0x59f1a8[_0x19bc('0x54')]=_['intersection'](_0x46f6f6[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x52a52e[_0x19bc('0x51')][_0x19bc('0x56')]));_0x59f1a8[_0x19bc('0x54')]=_0x59f1a8['attributes']['length']?_0x59f1a8[_0x19bc('0x54')]:_0x46f6f6[_0x19bc('0x4f')];_0x59f1a8[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x52a52e[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x59f1a8['where']=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x52a52e[_0x19bc('0x51')],_0x46f6f6[_0x19bc('0x53')]));if(_0x52a52e[_0x19bc('0x51')][_0x19bc('0x40')]){_0x59f1a8[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x59f1a8[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x59f1a8['attributes'],function(_0x309957){var _0x35dbcc={};_0x35dbcc[_0x309957]={'$like':'%'+_0x52a52e[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x35dbcc;})});}_0x59f1a8=_['merge']({},_0x59f1a8,_0x52a52e[_0x19bc('0x62')]);return _0x292970[_0x19bc('0xd1')](_0x59f1a8);}})[_0x19bc('0x23')](function(_0x702f49){if(_0x702f49){_0x3ec598=_0x702f49['length'];if(!_0x52a52e[_0x19bc('0x51')][_0x19bc('0x58')]('nolimit')){_0x59f1a8[_0x19bc('0x31')]=qs['limit'](_0x52a52e[_0x19bc('0x51')][_0x19bc('0x31')]);_0x59f1a8[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x52a52e[_0x19bc('0x51')][_0x19bc('0x30')]);}return _0x292970['getChatInteractions'](_0x59f1a8);}})[_0x19bc('0x23')](function(_0x501c71){if(_0x501c71){return _0x501c71?{'count':_0x3ec598,'rows':_0x501c71}:null;}})[_0x19bc('0x23')](respondWithResult(_0x41200f,null))[_0x19bc('0x66')](handleError(_0x41200f,null));};exports[_0x19bc('0xd3')]=function(_0x21415e,_0x2ac481,_0x3282a1){var _0x53b133={};var _0x542b03={};var _0x4b405d;var _0x36623b;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x21415e[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x2ac481,null))['then'](function(_0xb7bf25){if(_0xb7bf25){_0x4b405d=_0xb7bf25;_0x542b03['model']=_[_0x19bc('0x52')](db[_0x19bc('0xd4')][_0x19bc('0x4d')]);_0x542b03[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x21415e['query']);_0x542b03[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x542b03[_0x19bc('0x4f')],_0x542b03['query']);_0x53b133[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x542b03[_0x19bc('0x4f')],qs['fields'](_0x21415e[_0x19bc('0x51')][_0x19bc('0x56')]));_0x53b133[_0x19bc('0x54')]=_0x53b133[_0x19bc('0x54')]['length']?_0x53b133[_0x19bc('0x54')]:_0x542b03['model'];_0x53b133[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x21415e[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x53b133['where']=qs['filters'](_[_0x19bc('0x5d')](_0x21415e[_0x19bc('0x51')],_0x542b03[_0x19bc('0x53')]));if(_0x21415e[_0x19bc('0x51')][_0x19bc('0x40')]){_0x53b133[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x53b133[_0x19bc('0x5c')],{'$or':_['map'](_0x53b133['attributes'],function(_0x14c089){var _0x10cf05={};_0x10cf05[_0x14c089]={'$like':'%'+_0x21415e[_0x19bc('0x51')]['filter']+'%'};return _0x10cf05;})});}_0x53b133=_[_0x19bc('0x6b')]({},_0x53b133,_0x21415e[_0x19bc('0x62')]);return _0x4b405d[_0x19bc('0xd3')](_0x53b133);}})['then'](function(_0x20d1df){if(_0x20d1df){_0x36623b=_0x20d1df[_0x19bc('0x57')];if(!_0x21415e[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x53b133['limit']=qs[_0x19bc('0x31')](_0x21415e[_0x19bc('0x51')]['limit']);_0x53b133[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x21415e['query'][_0x19bc('0x30')]);}return _0x4b405d[_0x19bc('0xd3')](_0x53b133);}})[_0x19bc('0x23')](function(_0x57daa4){if(_0x57daa4){return _0x57daa4?{'count':_0x36623b,'rows':_0x57daa4}:null;}})['then'](respondWithResult(_0x2ac481,null))[_0x19bc('0x66')](handleError(_0x2ac481,null));};exports['getMailInteractions']=function(_0x24bad0,_0x385c10,_0x2ac6cc){var _0x199320={'raw':!![],'where':{}};var _0x59fe2f={};var _0x3eca2e={'count':0x0,'rows':[]};return db[_0x19bc('0x4c')]['findOne']({'where':{'id':_0x24bad0['params']['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x385c10,null))[_0x19bc('0x23')](function(_0x567d3f){if(_0x567d3f){_0x59fe2f[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db['MailInteraction']['rawAttributes']);_0x59fe2f['query']=_['keys'](_0x24bad0[_0x19bc('0x51')]);_0x59fe2f[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x59fe2f[_0x19bc('0x4f')],_0x59fe2f[_0x19bc('0x51')]);_0x199320[_0x19bc('0x54')]=_['intersection'](_0x59fe2f[_0x19bc('0x4f')],qs['fields'](_0x24bad0[_0x19bc('0x51')][_0x19bc('0x56')]));_0x199320[_0x19bc('0x54')]=_0x199320[_0x19bc('0x54')]['length']?_0x199320[_0x19bc('0x54')]:_0x59fe2f['model'];if(!_0x24bad0[_0x19bc('0x51')][_0x19bc('0x58')](_0x19bc('0x59'))){_0x199320[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x24bad0[_0x19bc('0x51')][_0x19bc('0x31')]);_0x199320[_0x19bc('0x30')]=qs['offset'](_0x24bad0['query'][_0x19bc('0x30')]);}_0x199320[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x24bad0[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x199320['where']=qs[_0x19bc('0x53')](_['pick'](_0x24bad0[_0x19bc('0x51')],_0x59fe2f[_0x19bc('0x53')]));_0x199320[_0x19bc('0x5c')][_0x19bc('0xce')]=_0x567d3f['id'];if(_0x24bad0[_0x19bc('0x51')]['filter']){_0x199320[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x199320[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x199320[_0x19bc('0x54')],function(_0x411353){var _0x57dee3={};_0x57dee3[_0x411353]={'$like':'%'+_0x24bad0[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x57dee3;})});}_0x199320=_[_0x19bc('0x6b')]({},_0x199320,_0x24bad0[_0x19bc('0x62')]);return db[_0x19bc('0xd5')][_0x19bc('0x2f')]({'where':_0x199320[_0x19bc('0x5c')]})['then'](function(_0xaa569d){_0x3eca2e[_0x19bc('0x2f')]=_0xaa569d;if(_0x24bad0[_0x19bc('0x51')][_0x19bc('0x6a')]){_0x199320[_0x19bc('0x63')]=[{'all':!![]}];}return db[_0x19bc('0xd5')][_0x19bc('0x64')](_0x199320);})[_0x19bc('0x23')](function(_0xb93e1f){_0x3eca2e['rows']=_0xb93e1f;return _0x3eca2e;});}})[_0x19bc('0x23')](respondWithFilteredResult(_0x385c10,_0x199320))['catch'](handleError(_0x385c10,null));};exports[_0x19bc('0xd6')]=function(_0x4ce295,_0x5a95ec,_0x190d50){var _0xc2820d={};var _0x54b7b8={};var _0x31cc5f;var _0x5974fc;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x4ce295['params']['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x5a95ec,null))[_0x19bc('0x23')](function(_0x160583){if(_0x160583){_0x31cc5f=_0x160583;_0x54b7b8[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db['SmsInteraction'][_0x19bc('0x4d')]);_0x54b7b8[_0x19bc('0x51')]=_['keys'](_0x4ce295['query']);_0x54b7b8[_0x19bc('0x53')]=_['intersection'](_0x54b7b8[_0x19bc('0x4f')],_0x54b7b8[_0x19bc('0x51')]);_0xc2820d[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x54b7b8[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x4ce295[_0x19bc('0x51')]['fields']));_0xc2820d['attributes']=_0xc2820d[_0x19bc('0x54')][_0x19bc('0x57')]?_0xc2820d['attributes']:_0x54b7b8[_0x19bc('0x4f')];_0xc2820d[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x4ce295['query']['sort']);_0xc2820d[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_['pick'](_0x4ce295[_0x19bc('0x51')],_0x54b7b8[_0x19bc('0x53')]));if(_0x4ce295[_0x19bc('0x51')][_0x19bc('0x40')]){_0xc2820d[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0xc2820d[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0xc2820d[_0x19bc('0x54')],function(_0x41ad9e){var _0x85a716={};_0x85a716[_0x41ad9e]={'$like':'%'+_0x4ce295[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x85a716;})});}_0xc2820d=_[_0x19bc('0x6b')]({},_0xc2820d,_0x4ce295[_0x19bc('0x62')]);return _0x31cc5f['getSmsInteractions'](_0xc2820d);}})[_0x19bc('0x23')](function(_0x250df3){if(_0x250df3){_0x5974fc=_0x250df3[_0x19bc('0x57')];if(!_0x4ce295[_0x19bc('0x51')][_0x19bc('0x58')]('nolimit')){_0xc2820d['limit']=qs[_0x19bc('0x31')](_0x4ce295['query'][_0x19bc('0x31')]);_0xc2820d['offset']=qs[_0x19bc('0x30')](_0x4ce295[_0x19bc('0x51')][_0x19bc('0x30')]);}return _0x31cc5f['getSmsInteractions'](_0xc2820d);}})[_0x19bc('0x23')](function(_0x1f14bf){if(_0x1f14bf){return _0x1f14bf?{'count':_0x5974fc,'rows':_0x1f14bf}:null;}})['then'](respondWithResult(_0x5a95ec,null))[_0x19bc('0x66')](handleError(_0x5a95ec,null));};exports[_0x19bc('0xd7')]=function(_0x2d2f80,_0x111239,_0x5b1aa3){var _0x4b66cb={};var _0x5eec99={};var _0x99aee2;var _0x13f315;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x2d2f80[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x111239,null))[_0x19bc('0x23')](function(_0x2c8b61){if(_0x2c8b61){_0x99aee2=_0x2c8b61;_0x5eec99[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db['FaxInteraction']['rawAttributes']);_0x5eec99[_0x19bc('0x51')]=_['keys'](_0x2d2f80[_0x19bc('0x51')]);_0x5eec99['filters']=_[_0x19bc('0x55')](_0x5eec99['model'],_0x5eec99[_0x19bc('0x51')]);_0x4b66cb[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x5eec99[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x2d2f80[_0x19bc('0x51')][_0x19bc('0x56')]));_0x4b66cb[_0x19bc('0x54')]=_0x4b66cb['attributes']['length']?_0x4b66cb[_0x19bc('0x54')]:_0x5eec99[_0x19bc('0x4f')];_0x4b66cb[_0x19bc('0x5a')]=qs['sort'](_0x2d2f80[_0x19bc('0x51')]['sort']);_0x4b66cb[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x2d2f80[_0x19bc('0x51')],_0x5eec99[_0x19bc('0x53')]));if(_0x2d2f80[_0x19bc('0x51')][_0x19bc('0x40')]){_0x4b66cb[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x4b66cb['where'],{'$or':_['map'](_0x4b66cb[_0x19bc('0x54')],function(_0x3dbe9c){var _0x510f82={};_0x510f82[_0x3dbe9c]={'$like':'%'+_0x2d2f80[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x510f82;})});}_0x4b66cb=_[_0x19bc('0x6b')]({},_0x4b66cb,_0x2d2f80[_0x19bc('0x62')]);return _0x99aee2[_0x19bc('0xd7')](_0x4b66cb);}})[_0x19bc('0x23')](function(_0x53c72c){if(_0x53c72c){_0x13f315=_0x53c72c[_0x19bc('0x57')];if(!_0x2d2f80['query']['hasOwnProperty']('nolimit')){_0x4b66cb[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x2d2f80[_0x19bc('0x51')]['limit']);_0x4b66cb[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x2d2f80[_0x19bc('0x51')]['offset']);}return _0x99aee2[_0x19bc('0xd7')](_0x4b66cb);}})[_0x19bc('0x23')](function(_0x5c7582){if(_0x5c7582){return _0x5c7582?{'count':_0x13f315,'rows':_0x5c7582}:null;}})[_0x19bc('0x23')](respondWithResult(_0x111239,null))[_0x19bc('0x66')](handleError(_0x111239,null));};exports[_0x19bc('0xd8')]=function(_0x653f2e,_0x545277,_0x3926d0){var _0x364abb={};var _0x225875={};var _0x4dcb60;var _0x5a9d6b;return db[_0x19bc('0x4c')]['findOne']({'where':{'id':_0x653f2e[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x545277,null))['then'](function(_0x2bc40d){if(_0x2bc40d){_0x4dcb60=_0x2bc40d;_0x225875[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db['WhatsappInteraction']['rawAttributes']);_0x225875[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x653f2e[_0x19bc('0x51')]);_0x225875[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x225875[_0x19bc('0x4f')],_0x225875['query']);_0x364abb[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x225875['model'],qs['fields'](_0x653f2e['query'][_0x19bc('0x56')]));_0x364abb['attributes']=_0x364abb[_0x19bc('0x54')]['length']?_0x364abb['attributes']:_0x225875[_0x19bc('0x4f')];_0x364abb['order']=qs[_0x19bc('0x5b')](_0x653f2e[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x364abb[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_['pick'](_0x653f2e['query'],_0x225875['filters']));if(_0x653f2e[_0x19bc('0x51')]['filter']){_0x364abb[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x364abb[_0x19bc('0x5c')],{'$or':_[_0x19bc('0x42')](_0x364abb[_0x19bc('0x54')],function(_0x261343){var _0x14ec74={};_0x14ec74[_0x261343]={'$like':'%'+_0x653f2e[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x14ec74;})});}_0x364abb=_['merge']({},_0x364abb,_0x653f2e[_0x19bc('0x62')]);return _0x4dcb60[_0x19bc('0xd8')](_0x364abb);}})[_0x19bc('0x23')](function(_0x53c3d7){if(_0x53c3d7){_0x5a9d6b=_0x53c3d7[_0x19bc('0x57')];if(!_0x653f2e[_0x19bc('0x51')][_0x19bc('0x58')]('nolimit')){_0x364abb[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x653f2e[_0x19bc('0x51')][_0x19bc('0x31')]);_0x364abb[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x653f2e[_0x19bc('0x51')]['offset']);}return _0x4dcb60[_0x19bc('0xd8')](_0x364abb);}})[_0x19bc('0x23')](function(_0x494db1){if(_0x494db1){return _0x494db1?{'count':_0x5a9d6b,'rows':_0x494db1}:null;}})[_0x19bc('0x23')](respondWithResult(_0x545277,null))[_0x19bc('0x66')](handleError(_0x545277,null));};exports[_0x19bc('0xd9')]=function(_0x532e35,_0x4167ce,_0x2ac7d4){var _0x39795e;var _0x55d95b;var _0x1e3542;var _0x1f3ebd=!_['isNil'](_0x532e35[_0x19bc('0x6f')]['id'])?_0x532e35[_0x19bc('0x6f')]['id']:!_['isNil'](_0x532e35['user']['id'])?_0x532e35[_0x19bc('0x3b')]['id']:null;return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x1f3ebd,'role':{'$or':['admin',_0x19bc('0x3b'),_0x19bc('0x3d')]}},'attributes':['id',_0x19bc('0x47'),_0x19bc('0xda'),_0x19bc('0xdb'),_0x19bc('0x44'),_0x19bc('0x7b'),'loginInPause']})[_0x19bc('0x23')](function(_0x33a45c){if(_0x33a45c){if(_0x33a45c[_0x19bc('0x44')]===_0x19bc('0x3d')){_0x39795e=_0x33a45c;if(_0x532e35[_0x19bc('0x6d')]['interface']){_0x1e3542=util[_0x19bc('0x78')](_0x19bc('0xdc'),_0x39795e[_0x532e35[_0x19bc('0x6d')][_0x19bc('0xa1')]]);}else if(_0x532e35['body'][_0x19bc('0xdd')]){_0x1e3542=util[_0x19bc('0x78')](_0x19bc('0xde'),_0x532e35[_0x19bc('0x6d')]['intrf']);}else{_0x1e3542=util['format'](_0x19bc('0xde'),_0x39795e[_0x19bc('0x47')]);}socket['to'](util[_0x19bc('0x78')]('user:%s',_0x39795e[_0x19bc('0x47')]))['emit']('user:forcelogout',{'ip':_0x532e35['headers'][_0x19bc('0xdf')]||_0x532e35[_0x19bc('0xe0')][_0x19bc('0xe1')]||_0x532e35[_0x19bc('0xe2')]['remoteAddress']||_0x532e35[_0x19bc('0xe0')][_0x19bc('0xe2')][_0x19bc('0xe1')]});return db[_0x19bc('0xb4')][_0x19bc('0x38')]({'where':{'membername':_0x39795e[_0x19bc('0x47')]},'individualHooks':!![]});}}else{throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))](_0x19bc('0xe3'));}})[_0x19bc('0x23')](function(){if(_0x39795e){return _0x39795e[_0x19bc('0xe4')]({'raw':!![]});}})[_0x19bc('0x23')](function(_0x39de08){if(_0x39795e){var _0x3fd8be=[];if(_0x39de08){_0x55d95b=_0x39de08;if(_0x55d95b['length']){for(var _0x5acb96=0x0;_0x5acb96<_0x55d95b[_0x19bc('0x57')];_0x5acb96++){_0x3fd8be[_0x19bc('0xab')]({'membername':_0x39795e[_0x19bc('0x47')],'UserId':_0x39795e['id'],'queue_name':_0x55d95b[_0x5acb96][_0x19bc('0x47')],'VoiceQueueId':_0x55d95b[_0x5acb96]['id'],'interface':_0x1e3542,'paused':_0x39795e[_0x19bc('0x9f')]||![],'penalty':_0x55d95b[_0x5acb96][_0x19bc('0xe5')]||0x0});}return BPromise['each'](_0x3fd8be,function(_0x65ef05){return db[_0x19bc('0xb4')][_0x19bc('0xad')](_0x65ef05);});}}}})[_0x19bc('0x23')](function(){if(_0x39795e){return db['MemberReport']['findAll']({'where':{'membername':_0x39795e[_0x19bc('0x47')],'exitAt':null}});}})[_0x19bc('0x23')](function(_0x48d354){if(_0x39795e){var _0x1d37bf=[];_0x48d354['forEach'](function(_0x577c66){_0x1d37bf[_0x19bc('0xab')](_0x577c66['update']({'exitAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6'))}));});return BPromise[_0x19bc('0xe7')](_0x1d37bf);}})[_0x19bc('0x23')](function(){if(_0x39795e){var _0x20665e=[];var _0x21b206=[];var _0x1f396e=utils[_0x19bc('0xe8')]();var _0x28f6c3={'membername':_0x39795e[_0x19bc('0x47')],'interface':_0x1e3542,'enterAt':moment()['format'](_0x19bc('0xe6')),'role':_0x39795e[_0x19bc('0x44')],'internal':_0x39795e['internal']};_0x1f396e[_0x19bc('0xe9')](function(_0x3a6915){_0x20665e['push'](_['merge']({'channel':_0x3a6915,'type':_0x19bc('0xea'),'data1':_0x532e35['body'][_0x19bc('0xeb')],'data2':_0x1e3542},_0x28f6c3));if(_0x39795e[_0x19bc('0x9f')]){_0x21b206[_0x19bc('0xab')](_[_0x19bc('0x6b')]({'channel':_0x3a6915,'type':_0x19bc('0xec'),'data1':_0x19bc('0xed')},_0x28f6c3));}});return db[_0x19bc('0xee')][_0x19bc('0x6c')](_0x20665e['concat'](_0x21b206),{'individualHooks':!![]});}})[_0x19bc('0x23')](function(){if(_0x39795e){return _0x39795e[_0x19bc('0x37')]({'online':!![],'lastLoginAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6')),'voicePause':_0x39795e[_0x19bc('0x9f')]||![],'mailPause':_0x39795e[_0x19bc('0x9f')]||![],'chatPause':_0x39795e['loginInPause']||![],'faxPause':_0x39795e[_0x19bc('0x9f')]||![],'smsPause':_0x39795e['loginInPause']||![],'openchannelPause':_0x39795e[_0x19bc('0x9f')]||![],'whatsappPause':_0x39795e['loginInPause']||![],'pauseType':_0x39795e['loginInPause']?_0x19bc('0xed'):null,'interface':_0x1e3542,'lastPauseAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6'))});}})[_0x19bc('0x23')](function(_0x146f2d){if(_0x532e35['isMiddleware']){return _0x2ac7d4();}else{return BPromise['resolve'](_0x146f2d)[_0x19bc('0x23')](respondWithResult(_0x4167ce,null));}})[_0x19bc('0x66')](handleError(_0x4167ce,null));};exports['logout']=function(_0x1d3faa,_0x5eeee4,_0x3cc805){var _0x4fd078;return db['User'][_0x19bc('0x45')]({'where':{'id':_0x1d3faa[_0x19bc('0x6f')]['id'],'role':'agent'},'attributes':['id',_0x19bc('0x47'),_0x19bc('0x44')]})[_0x19bc('0x23')](handleEntityNotFound(_0x5eeee4,null))[_0x19bc('0x23')](function(_0xe7daf2){if(_0xe7daf2){_0x4fd078=_0xe7daf2;return db[_0x19bc('0xb4')][_0x19bc('0x38')]({'where':{'membername':_0x4fd078[_0x19bc('0x47')]},'individualHooks':!![]});}})[_0x19bc('0x23')](function(){return db[_0x19bc('0xee')][_0x19bc('0x64')]({'where':{'membername':_0x4fd078['name'],'exitAt':null}});})[_0x19bc('0x23')](function(_0x2859e9){var _0x248e3e=[];_0x2859e9[_0x19bc('0xe9')](function(_0x14817e){_0x248e3e[_0x19bc('0xab')](_0x14817e[_0x19bc('0x37')]({'exitAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6'))}));});return BPromise[_0x19bc('0xe7')](_0x248e3e);})[_0x19bc('0x23')](function(){return _0x4fd078[_0x19bc('0x37')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x19bc('0x23')](respondWithResult(_0x5eeee4,null))[_0x19bc('0x66')](handleError(_0x5eeee4,null));};exports[_0x19bc('0xef')]=function(_0x5e00fe,_0x476503,_0x9719ea){var _0xb2bc6;return db[_0x19bc('0xb4')][_0x19bc('0x37')]({'paused':0x1},{'where':{'UserId':_0x5e00fe['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0x19bc('0x4c')]['find']({'where':{'id':_0x5e00fe[_0x19bc('0x6f')]['id'],'role':'agent'},'attributes':['id',_0x19bc('0x47'),_0x19bc('0x44'),_0x19bc('0x7b'),_0x19bc('0xa1')]});})['then'](handleEntityNotFound(_0x476503,null))[_0x19bc('0x23')](function(_0x3ce614){if(_0x3ce614){_0xb2bc6=_0x3ce614;return respondWithRpcPromise(_0x19bc('0xf0'),_0x19bc('0xef'),{'id':_0xb2bc6['id'],'name':_0xb2bc6[_0x19bc('0x47')],'pause':!![]});}})[_0x19bc('0x23')](function(){if(_0xb2bc6){return db[_0x19bc('0xee')][_0x19bc('0x64')]({'where':{'membername':_0xb2bc6['name'],'type':_0x19bc('0xec'),'exitAt':null}});}})[_0x19bc('0x23')](function(_0x4c292b){if(_0x4c292b[_0x19bc('0x57')]){var _0x52fbe9=moment()[_0x19bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x12aae1=0x0,_0x3a0aa9=_0x4c292b[_0x19bc('0x57')];_0x12aae1<_0x3a0aa9;_0x12aae1++){_0x4c292b[_0x12aae1][_0x19bc('0xf1')]({'exitAt':_0x52fbe9});}}})[_0x19bc('0x23')](function(){var _0x353f1f=[];var _0x3d44a5=utils['getChannels']();_0x3d44a5['forEach'](function(_0x14e089){_0x353f1f[_0x19bc('0xab')]({'channel':_0x14e089,'membername':_0xb2bc6[_0x19bc('0x47')],'interface':_[_0x19bc('0x77')](_0xb2bc6[_0x19bc('0xa1')])?util[_0x19bc('0x78')](_0x19bc('0xde'),_0xb2bc6[_0x19bc('0x47')]):_0xb2bc6[_0x19bc('0xa1')],'type':_0x19bc('0xec'),'enterAt':moment()[_0x19bc('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5e00fe[_0x19bc('0x6d')]['type']||_0x19bc('0xf2'),'role':_0xb2bc6[_0x19bc('0x44')],'internal':_0xb2bc6[_0x19bc('0x7b')]});});return db[_0x19bc('0xee')][_0x19bc('0x6c')](_0x353f1f,{'individualHooks':!![]});})[_0x19bc('0x23')](function(){return _0xb2bc6[_0x19bc('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5e00fe['body'][_0x19bc('0xf3')]||_0x19bc('0xf2'),'lastPauseAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6'))});})[_0x19bc('0x23')](respondWithResult(_0x476503,null))['catch'](handleError(_0x476503,null));};exports['unpause']=function(_0x9be0a8,_0x500a99,_0x5413ed){var _0x4d21d9;return db[_0x19bc('0x4c')][_0x19bc('0x45')]({'where':{'id':_0x9be0a8[_0x19bc('0x6f')]['id']},'attributes':['id','name',_0x19bc('0x44'),_0x19bc('0xa0'),'mailPause','chatPause',_0x19bc('0xf4'),_0x19bc('0xf5'),_0x19bc('0xf6'),_0x19bc('0xf7'),_0x19bc('0xf8'),'lastPauseAt']})['then'](handleEntityNotFound(_0x500a99,null))['then'](function(_0x49e5e1){if(_0x49e5e1){_0x4d21d9=_0x49e5e1;if(_0x9be0a8[_0x19bc('0x6d')][_0x19bc('0xaf')]&&!utils[_0x19bc('0xa2')](_0x9be0a8[_0x19bc('0x6d')][_0x19bc('0xaf')])){throw new db[(_0x19bc('0x21'))][(_0x19bc('0x96'))]('Unknown\x20channel');}switch(_0x9be0a8[_0x19bc('0x6d')][_0x19bc('0xaf')]){case'voice':return respondWithRpcPromise(_0x19bc('0xf0'),_0x19bc('0xf9'),{'id':_0x4d21d9['id'],'name':_0x4d21d9[_0x19bc('0x47')],'pause':![]})[_0x19bc('0x23')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x4d21d9['id']},'individualHooks':!![]});})[_0x19bc('0x23')](function(){return db['MemberReport'][_0x19bc('0x45')]({'where':{'channel':_0x9be0a8['body'][_0x19bc('0xaf')],'membername':_0x4d21d9[_0x19bc('0x47')],'type':_0x19bc('0xec'),'exitAt':null}});})[_0x19bc('0x23')](function(_0x13d0bb){if(_0x13d0bb){return _0x13d0bb[_0x19bc('0x37')]({'exitAt':moment()['format'](_0x19bc('0xe6')),'data2':_0x19bc('0xfa')},{'individualHooks':!![]});}return null;})[_0x19bc('0x23')](function(){return _0x4d21d9[_0x19bc('0x37')]({'voicePause':![]});});case _0x19bc('0xfb'):case _0x19bc('0xfc'):case _0x19bc('0xfd'):case _0x19bc('0xfe'):case _0x19bc('0xff'):case _0x19bc('0x100'):return db[_0x19bc('0xee')][_0x19bc('0x45')]({'where':{'channel':_0x9be0a8[_0x19bc('0x6d')]['channel'],'membername':_0x4d21d9['name'],'type':_0x19bc('0xec'),'exitAt':null}})[_0x19bc('0x23')](function(_0x39e05b){if(_0x39e05b){return _0x39e05b['update']({'exitAt':moment()['format'](_0x19bc('0xe6')),'data2':_0x19bc('0xfa')},{'individualHooks':!![]});}return null;})[_0x19bc('0x23')](function(){var _0x597470={};_['set'](_0x597470,util[_0x19bc('0x78')]('%s%s',_0x9be0a8[_0x19bc('0x6d')][_0x19bc('0xaf')],_0x19bc('0x101')),![]);return _0x4d21d9[_0x19bc('0x37')](_0x597470);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x4d21d9['id'],'name':_0x4d21d9[_0x19bc('0x47')],'pause':![]})['then'](function(){return db[_0x19bc('0xb4')][_0x19bc('0x37')]({'paused':0x0},{'where':{'UserId':_0x4d21d9['id']}});})['then'](function(){return db[_0x19bc('0xee')][_0x19bc('0x64')]({'where':{'membername':_0x4d21d9[_0x19bc('0x47')],'type':_0x19bc('0xec'),'exitAt':null}});})['then'](function(_0x24451f){var _0x36aec8=[];_0x24451f[_0x19bc('0xe9')](function(_0x43053a){_0x36aec8['push'](_0x43053a[_0x19bc('0x37')]({'exitAt':moment()[_0x19bc('0x78')](_0x19bc('0xe6')),'data2':'manual'}));});return BPromise[_0x19bc('0xe7')](_0x36aec8);})[_0x19bc('0x23')](function(){return _0x4d21d9[_0x19bc('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x19bc('0x23')](respondWithResult(_0x500a99,null))[_0x19bc('0x66')](handleError(_0x500a99,null));};exports[_0x19bc('0x102')]=function(_0x1cb17a,_0x275a90,_0x5bf891){var _0x31f9a5={};var _0x55b123={};var _0x39b2b8;var _0x20d79a;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x1cb17a['params']['id']}})['then'](handleEntityNotFound(_0x275a90,null))['then'](function(_0x427120){if(_0x427120){_0x39b2b8=_0x427120;_0x55b123[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0x103')][_0x19bc('0x4d')]);_0x55b123[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x1cb17a[_0x19bc('0x51')]);_0x55b123[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0x55b123[_0x19bc('0x4f')],_0x55b123[_0x19bc('0x51')]);_0x31f9a5[_0x19bc('0x54')]=_[_0x19bc('0x55')](_0x55b123['model'],qs['fields'](_0x1cb17a[_0x19bc('0x51')][_0x19bc('0x56')]));_0x31f9a5['attributes']=_0x31f9a5[_0x19bc('0x54')][_0x19bc('0x57')]?_0x31f9a5[_0x19bc('0x54')]:_0x55b123[_0x19bc('0x4f')];_0x31f9a5[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x1cb17a[_0x19bc('0x51')]['sort']);_0x31f9a5[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x1cb17a[_0x19bc('0x51')],_0x55b123[_0x19bc('0x53')]));if(_0x1cb17a[_0x19bc('0x51')][_0x19bc('0x40')]){_0x31f9a5['where']=_[_0x19bc('0x6b')](_0x31f9a5['where'],{'$or':_[_0x19bc('0x42')](_0x31f9a5[_0x19bc('0x54')],function(_0x4eb77c){var _0x22e0fe={};_0x22e0fe[_0x4eb77c]={'$like':'%'+_0x1cb17a[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x22e0fe;})});}_0x31f9a5=_['merge']({},_0x31f9a5,_0x1cb17a[_0x19bc('0x62')]);return _0x39b2b8[_0x19bc('0x102')](_0x31f9a5);}})[_0x19bc('0x23')](function(_0x503970){if(_0x503970){_0x20d79a=_0x503970[_0x19bc('0x57')];if(!_0x1cb17a[_0x19bc('0x51')]['hasOwnProperty'](_0x19bc('0x59'))){_0x31f9a5[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x1cb17a[_0x19bc('0x51')][_0x19bc('0x31')]);_0x31f9a5[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x1cb17a[_0x19bc('0x51')][_0x19bc('0x30')]);}return _0x39b2b8[_0x19bc('0x102')](_0x31f9a5);}})[_0x19bc('0x23')](function(_0x5956ff){if(_0x5956ff){return _0x5956ff?{'count':_0x20d79a,'rows':_0x5956ff}:null;}})[_0x19bc('0x23')](respondWithResult(_0x275a90,null))[_0x19bc('0x66')](handleError(_0x275a90,null));};exports[_0x19bc('0x104')]=function(_0x213624,_0x528398){return db[_0x19bc('0x4c')]['find']({'where':{'id':_0x213624[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x528398,null))['then'](function(_0x513215){if(_0x513215){var _0x1e37f1=_0x513215['get']({'plain':!![]});return _0x513215[_0x19bc('0x104')](_0x213624[_0x19bc('0x6d')][_0x19bc('0x71')],_[_0x19bc('0x105')](_0x213624[_0x19bc('0x6d')],[_0x19bc('0x71'),'id'])||{})[_0x19bc('0x23')](function(){for(var _0x4689f7=0x0;_0x4689f7<_0x213624[_0x19bc('0x6d')][_0x19bc('0x71')]['length'];_0x4689f7++){var _0x5190da=[];db['Team'][_0x19bc('0xbf')]({'where':{'id':_0x213624[_0x19bc('0x6d')][_0x19bc('0x71')][_0x4689f7]}})[_0x19bc('0x23')](function(_0xe7673e){_0x5190da['push'](_0xe7673e[_0x19bc('0xe4')]()[_0x19bc('0x23')](function(_0x1334cb){for(var _0x458f29=0x0;_0x458f29<_0x1334cb[_0x19bc('0x57')];_0x458f29++){_0x1334cb[_0x458f29][_0x19bc('0x106')]('channel',_0x19bc('0x107'));}return _0x1334cb;}));_0x5190da[_0x19bc('0xab')](_0xe7673e[_0x19bc('0x108')]()[_0x19bc('0x23')](function(_0x4bf805){for(var _0x2cc8f1=0x0;_0x2cc8f1<_0x4bf805['length'];_0x2cc8f1++){_0x4bf805[_0x2cc8f1][_0x19bc('0x106')](_0x19bc('0xaf'),_0x19bc('0x109'));}return _0x4bf805;}));_0x5190da[_0x19bc('0xab')](_0xe7673e[_0x19bc('0x10a')]()[_0x19bc('0x23')](function(_0x174829){for(var _0x17c1ea=0x0;_0x17c1ea<_0x174829[_0x19bc('0x57')];_0x17c1ea++){_0x174829[_0x17c1ea][_0x19bc('0x106')]('channel',_0x19bc('0x10b'));}return _0x174829;}));_0x5190da['push'](_0xe7673e[_0x19bc('0x10c')]()[_0x19bc('0x23')](function(_0x3e64fc){for(var _0x5b4d1f=0x0;_0x5b4d1f<_0x3e64fc[_0x19bc('0x57')];_0x5b4d1f++){_0x3e64fc[_0x5b4d1f][_0x19bc('0x106')]('channel',_0x19bc('0x10d'));}return _0x3e64fc;}));_0x5190da[_0x19bc('0xab')](_0xe7673e[_0x19bc('0x10e')]()[_0x19bc('0x23')](function(_0x3fe72e){for(var _0x3d5b99=0x0;_0x3d5b99<_0x3fe72e[_0x19bc('0x57')];_0x3d5b99++){_0x3fe72e[_0x3d5b99][_0x19bc('0x106')]('channel',_0x19bc('0x10f'));}return _0x3fe72e;}));_0x5190da[_0x19bc('0xab')](_0xe7673e[_0x19bc('0x110')]()[_0x19bc('0x23')](function(_0x425fe9){for(var _0x3c4a76=0x0;_0x3c4a76<_0x425fe9['length'];_0x3c4a76++){_0x425fe9[_0x3c4a76][_0x19bc('0x106')](_0x19bc('0xaf'),'Fax');}return _0x425fe9;}));_0x5190da['push'](_0xe7673e[_0x19bc('0x111')]()['then'](function(_0x14566f){for(var _0x38ec63=0x0;_0x38ec63<_0x14566f[_0x19bc('0x57')];_0x38ec63++){_0x14566f[_0x38ec63]['setDataValue']('channel',_0x19bc('0x112'));}return _0x14566f;}));return BPromise['all'](_0x5190da);})[_0x19bc('0x23')](function(_0x4c53bb){var _0x5f1c79=_['flatten'](_0x4c53bb);_0x5190da=[];return db['sequelize'][_0x19bc('0x113')](function(_0x4f09c0){for(var _0x29445d=0x0;_0x29445d<_0x5f1c79['length'];_0x29445d++){_0x5190da[_0x19bc('0xab')](_0x5f1c79[_0x29445d]['addAgent'](_0x1e37f1['id']),{'transaction':_0x4f09c0});}return BPromise[_0x19bc('0xe7')](_0x5190da)[_0x19bc('0x23')](function(){if(_0x1e37f1[_0x19bc('0x9e')]){return BPromise[_0x19bc('0xac')](_[_0x19bc('0x40')](_0x5f1c79,function(_0x2cdca5){return _0x2cdca5[_0x19bc('0x114')](_0x19bc('0xaf'))===_0x19bc('0x107');}),function(_0x5ec1a7){return db[_0x19bc('0xb4')][_0x19bc('0xad')]({'membername':_0x1e37f1[_0x19bc('0x47')],'UserId':_0x1e37f1['id'],'queue_name':_0x5ec1a7[_0x19bc('0x47')],'VoiceQueueId':_0x5ec1a7['id'],'interface':_[_0x19bc('0x77')](_0x1e37f1['interface'])?util[_0x19bc('0x78')](_0x19bc('0xde'),_0x1e37f1[_0x19bc('0x47')]):_0x1e37f1['interface'],'paused':_0x1e37f1[_0x19bc('0xa0')]||![],'penalty':_0x1e37f1['penalty']},{'transaction':_0x4f09c0});});}else{return;}})[_0x19bc('0x23')](function(){for(var _0x21e40f=0x0;_0x21e40f<_0x5f1c79[_0x19bc('0x57')];_0x21e40f++){var _0x582d05=_0x5f1c79[_0x21e40f]['getDataValue']('channel');var _0x3550f1=_0x582d05+_0x19bc('0xb3');socket['emit'](_0x19bc('0x3b')+_0x582d05+'Queue:save',{'UserId':_0x1e37f1['id'],['queueField']:_0x5f1c79[_0x21e40f]['id']});}});});});}});}})[_0x19bc('0x23')](respondWithStatusCode(_0x528398,null))[_0x19bc('0x66')](handleError(_0x528398,null));};exports[_0x19bc('0x115')]=function(_0x189bdf,_0x5d6b0a){return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x189bdf[_0x19bc('0x6f')]['id']}})[_0x19bc('0x23')](handleEntityNotFound(_0x5d6b0a,null))[_0x19bc('0x23')](function(_0x2f5f58){if(_0x2f5f58){var _0xb6262c=_0x2f5f58[_0x19bc('0x39')]({'plain':!![]});var _0x4a62c7=_0x189bdf[_0x19bc('0x51')]['ids'];return _0x2f5f58[_0x19bc('0x115')](_0x4a62c7)['then'](function(){for(var _0x39ac1d=0x0;_0x39ac1d<_0x4a62c7[_0x19bc('0x57')];_0x39ac1d++){var _0x4582d7=[];db[_0x19bc('0x103')][_0x19bc('0xbf')]({'where':{'id':_0x4a62c7[_0x39ac1d]}})[_0x19bc('0x23')](function(_0x1d247b){_0x4582d7[_0x19bc('0xab')](_0x1d247b[_0x19bc('0xe4')]()[_0x19bc('0x23')](function(_0x1e9f00){for(var _0x9fac4b=0x0;_0x9fac4b<_0x1e9f00[_0x19bc('0x57')];_0x9fac4b++){_0x1e9f00[_0x9fac4b][_0x19bc('0x106')](_0x19bc('0xaf'),_0x19bc('0x107'));}return _0x1e9f00;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b[_0x19bc('0x108')]()[_0x19bc('0x23')](function(_0x5d13e1){for(var _0x5cdf48=0x0;_0x5cdf48<_0x5d13e1[_0x19bc('0x57')];_0x5cdf48++){_0x5d13e1[_0x5cdf48]['setDataValue']('channel','Chat');}return _0x5d13e1;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b[_0x19bc('0x10a')]()[_0x19bc('0x23')](function(_0x3eaf4b){for(var _0x58b73e=0x0;_0x58b73e<_0x3eaf4b['length'];_0x58b73e++){_0x3eaf4b[_0x58b73e]['setDataValue']('channel',_0x19bc('0x10b'));}return _0x3eaf4b;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b['getSmsQueues']()[_0x19bc('0x23')](function(_0x54d40e){for(var _0x267b2a=0x0;_0x267b2a<_0x54d40e[_0x19bc('0x57')];_0x267b2a++){_0x54d40e[_0x267b2a][_0x19bc('0x106')](_0x19bc('0xaf'),_0x19bc('0x10d'));}return _0x54d40e;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b[_0x19bc('0x10e')]()[_0x19bc('0x23')](function(_0x532bb6){for(var _0x47f85b=0x0;_0x47f85b<_0x532bb6[_0x19bc('0x57')];_0x47f85b++){_0x532bb6[_0x47f85b][_0x19bc('0x106')]('channel','Whatsapp');}return _0x532bb6;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b[_0x19bc('0x110')]()['then'](function(_0x47e46e){for(var _0x38d6b1=0x0;_0x38d6b1<_0x47e46e['length'];_0x38d6b1++){_0x47e46e[_0x38d6b1][_0x19bc('0x106')]('channel',_0x19bc('0x116'));}return _0x47e46e;}));_0x4582d7[_0x19bc('0xab')](_0x1d247b['getOpenchannelQueues']()[_0x19bc('0x23')](function(_0x5b0f92){for(var _0x10278c=0x0;_0x10278c<_0x5b0f92[_0x19bc('0x57')];_0x10278c++){_0x5b0f92[_0x10278c][_0x19bc('0x106')]('channel',_0x19bc('0x112'));}return _0x5b0f92;}));return BPromise[_0x19bc('0xe7')](_0x4582d7);})['then'](function(_0x30c341){var _0x1d0744=_['flatten'](_0x30c341);_0x4582d7=[];return db['sequelize'][_0x19bc('0x113')](function(_0xed2282){for(var _0x42ede9=0x0;_0x42ede9<_0x1d0744[_0x19bc('0x57')];_0x42ede9++){_0x4582d7[_0x19bc('0xab')](_0x1d0744[_0x42ede9]['removeAgent'](_0xb6262c['id']),{'transaction':_0xed2282});}return BPromise[_0x19bc('0xe7')](_0x4582d7)[_0x19bc('0x23')](function(){if(_0xb6262c[_0x19bc('0x9e')]){return BPromise[_0x19bc('0xac')](_['filter'](_0x1d0744,function(_0x315f46){return _0x315f46[_0x19bc('0x114')](_0x19bc('0xaf'))==='Voice';}),function(_0xf8d37){return db[_0x19bc('0xb4')][_0x19bc('0x38')]({'where':{'VoiceQueueId':_0xf8d37['id'],'UserId':_0xb6262c['id']},'transaction':_0xed2282});});}else{return;}})['then'](function(){for(var _0x12a58f=0x0;_0x12a58f<_0x1d0744[_0x19bc('0x57')];_0x12a58f++){var _0x2045c3=_0x1d0744[_0x12a58f]['getDataValue'](_0x19bc('0xaf'));var _0x3a9abc=_0x2045c3+_0x19bc('0xb3');socket[_0x19bc('0xa7')](_0x19bc('0x3b')+_0x2045c3+_0x19bc('0x117'),{'UserId':_0xb6262c['id'],['queueField']:_0x1d0744[_0x12a58f]['id']});}});});});}});}})[_0x19bc('0x23')](respondWithStatusCode(_0x5d6b0a,null))[_0x19bc('0x66')](handleError(_0x5d6b0a,null));};exports[_0x19bc('0x118')]=function(_0x50c8e2,_0x3718e3,_0x21cd6c){var _0x2c33b1={};var _0xb14f06={};var _0x35a1da;var _0x116fd4;return db[_0x19bc('0x4c')]['findOne']({'where':{'id':_0x50c8e2[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x3718e3,null))[_0x19bc('0x23')](function(_0x4b88b5){if(_0x4b88b5){_0x35a1da=_0x4b88b5;_0xb14f06[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0xc1')][_0x19bc('0x4d')]);_0xb14f06[_0x19bc('0x51')]=_['keys'](_0x50c8e2['query']);_0xb14f06[_0x19bc('0x53')]=_[_0x19bc('0x55')](_0xb14f06[_0x19bc('0x4f')],_0xb14f06[_0x19bc('0x51')]);_0x2c33b1['attributes']=_[_0x19bc('0x55')](_0xb14f06[_0x19bc('0x4f')],qs[_0x19bc('0x56')](_0x50c8e2[_0x19bc('0x51')][_0x19bc('0x56')]));_0x2c33b1[_0x19bc('0x54')]=_0x2c33b1[_0x19bc('0x54')]['length']?_0x2c33b1[_0x19bc('0x54')]:_0xb14f06[_0x19bc('0x4f')];_0x2c33b1['order']=qs[_0x19bc('0x5b')](_0x50c8e2[_0x19bc('0x51')]['sort']);_0x2c33b1[_0x19bc('0x5c')]=qs[_0x19bc('0x53')](_[_0x19bc('0x5d')](_0x50c8e2['query'],_0xb14f06[_0x19bc('0x53')]));if(_0x50c8e2[_0x19bc('0x51')][_0x19bc('0x40')]){_0x2c33b1['where']=_[_0x19bc('0x6b')](_0x2c33b1[_0x19bc('0x5c')],{'$or':_['map'](_0x2c33b1[_0x19bc('0x54')],function(_0x314065){var _0x136d9c={};_0x136d9c[_0x314065]={'$like':'%'+_0x50c8e2[_0x19bc('0x51')][_0x19bc('0x40')]+'%'};return _0x136d9c;})});}_0x2c33b1=_[_0x19bc('0x6b')]({},_0x2c33b1,_0x50c8e2[_0x19bc('0x62')]);return _0x35a1da[_0x19bc('0x118')](_0x2c33b1);}})['then'](function(_0x5ea594){if(_0x5ea594){_0x116fd4=_0x5ea594[_0x19bc('0x57')];if(!_0x50c8e2[_0x19bc('0x51')]['hasOwnProperty'](_0x19bc('0x59'))){_0x2c33b1[_0x19bc('0x31')]=qs[_0x19bc('0x31')](_0x50c8e2[_0x19bc('0x51')]['limit']);_0x2c33b1[_0x19bc('0x30')]=qs[_0x19bc('0x30')](_0x50c8e2[_0x19bc('0x51')][_0x19bc('0x30')]);}return _0x35a1da[_0x19bc('0x118')](_0x2c33b1);}})['then'](function(_0x1ebeaa){if(_0x1ebeaa){return _0x1ebeaa?{'count':_0x116fd4,'rows':_0x1ebeaa}:null;}})['then'](respondWithResult(_0x3718e3,null))[_0x19bc('0x66')](handleError(_0x3718e3,null));};exports[_0x19bc('0x119')]=function(_0x45e363,_0x3802aa,_0x3e0bfb){var _0x3e5161={};var _0x23391d={};var _0x2778b7;var _0x485eff;return db[_0x19bc('0x4c')][_0x19bc('0xbf')]({'where':{'id':_0x45e363[_0x19bc('0x6f')]['id']}})['then'](handleEntityNotFound(_0x3802aa,null))[_0x19bc('0x23')](function(_0x5018f4){if(_0x5018f4){_0x2778b7=_0x5018f4;_0x23391d[_0x19bc('0x4f')]=_[_0x19bc('0x52')](db[_0x19bc('0x4c')][_0x19bc('0x4d')]);_0x23391d[_0x19bc('0x51')]=_[_0x19bc('0x52')](_0x45e363[_0x19bc('0x51')]);_0x23391d['filters']=_[_0x19bc('0x55')](_0x23391d['model'],_0x23391d[_0x19bc('0x51')]);_0x3e5161[_0x19bc('0x54')]=_['intersection'](_0x23391d['model'],qs['fields'](_0x45e363['query'][_0x19bc('0x56')]));_0x3e5161[_0x19bc('0x54')]=_0x3e5161[_0x19bc('0x54')][_0x19bc('0x57')]?_0x3e5161[_0x19bc('0x54')]:_0x23391d[_0x19bc('0x4f')];_0x3e5161[_0x19bc('0x5a')]=qs[_0x19bc('0x5b')](_0x45e363[_0x19bc('0x51')][_0x19bc('0x5b')]);_0x3e5161[_0x19bc('0x5c')]=qs['filters'](_['pick'](_0x45e363['query'],_0x23391d['filters']));if(_0x45e363[_0x19bc('0x51')][_0x19bc('0x40')]){_0x3e5161[_0x19bc('0x5c')]=_[_0x19bc('0x6b')](_0x3e5161[_0x19bc('0x5c')],{'$or':_['map'](_0x3e5161[_0x19bc('0x54')],function(_0x47ab22){var _0x1a90e6={};_0x1a90e6[_0x47ab22]={'$like':'%'+_0x45e363['query']['filter']+'%'};return _0x1a90e6;})});}_0x3e5161[_0x19bc('0x4f')]=db[_0x19bc('0x4c')];_0x3e5161['as']='Agents';_0x3e5161=_[_0x19bc('0x6b')]({},_0x3e5161,_0x45e363[_0x19bc('0x62')]);return _0x2778b7['getVoiceQueues']({'include':[_0x3e5161]});}})['then'](function(_0x4632e6){if(_0x4632e6){var _0x3b656c={},_0xaa2817=[],_0x49d264=0x0;for(var _0x4690e5=0x0;_0x4690e5<_0x4632e6['length'];_0x4690e5+=0x1){for(var _0x1983fb=0x0,_0x344c3d;_0x1983fb<_0x4632e6[_0x4690e5][_0x19bc('0x3c')]['length'];_0x1983fb+=0x1){_0x344c3d=_0x4632e6[_0x4690e5]['Agents'][_0x1983fb][_0x19bc('0x39')]({'plain':!![]});_0x3b656c[_0x344c3d['id']]=_0x344c3d;}}_0x3b656c=_[_0x19bc('0x11a')](_0x3b656c);for(var _0xaba81f=qs[_0x19bc('0x30')](_0x45e363[_0x19bc('0x51')][_0x19bc('0x30')]);_0xaba81f<_0x3b656c[_0x19bc('0x57')]&&_0xaa2817[_0x19bc('0x57')]=_0x2e0534){_0x85d29c=_0x2e0534;_0x1ce9c8=0xc8;}else{_0x1ce9c8=0xce;}_0x31a8ff[_0x725e('0x33')](_0x1ce9c8);return _0x31a8ff[_0x725e('0x34')](_0x725e('0x35'),_0x5b03d9+'-'+_0x85d29c+'/'+_0x2e0534)[_0x725e('0x2f')](_0x545237);}return null;};}function patchUpdates(_0x9179a4){return function(_0x5493d0){try{jsonpatch[_0x725e('0x36')](_0x5493d0,_0x9179a4,!![]);}catch(_0x175571){return BPromise['reject'](_0x175571);}return _0x5493d0[_0x725e('0x37')]();};}function saveUpdates(_0x4f2571,_0x351ce4){return function(_0x48ed43){if(_0x48ed43){return _0x48ed43[_0x725e('0x38')](_0x4f2571)[_0x725e('0x23')](function(_0x1f2898){return _0x1f2898;});}return null;};}function removeEntity(_0x398735,_0x40ce76){return function(_0x1eb190){if(_0x1eb190){return _0x1eb190['destroy']()['then'](function(){var _0x35e5e7=_0x1eb190[_0x725e('0x39')]({'plain':!![]});var _0x224942=[{'name':'Users','value':_0x725e('0x3a'),'ignore':!![]},{'name':'Agents','value':_0x725e('0x3b'),'ignore':![]},{'name':_0x725e('0x3c'),'value':_0x725e('0x3d'),'ignore':![]}];var _0x1ef636=_(_0x224942)['filter']('ignore')[_0x725e('0x3e')](_0x725e('0x3f'))[_0x725e('0x3f')]();if(_['includes'](_0x1ef636,_0x35e5e7[_0x725e('0x40')])){return;}var _0xec3b9d=_[_0x725e('0x41')](_0x224942,['value',_0x35e5e7[_0x725e('0x40')]])['name'];return db[_0x725e('0x42')][_0x725e('0x43')]({'where':{'type':_0xec3b9d,'resourceId':_0x35e5e7['id']}})[_0x725e('0x23')](function(){return _0x1eb190;});})[_0x725e('0x23')](function(){_0x398735[_0x725e('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bc884,_0x1be4f4){return function(_0x253caa){if(!_0x253caa){_0x4bc884[_0x725e('0x44')](0x194);}return _0x253caa;};}function handleError(_0x5dd1d1,_0x23d29b){_0x23d29b=_0x23d29b||0x1f4;return function(_0x5be83e){logger[_0x725e('0x29')](_0x5be83e[_0x725e('0x45')]);if(_0x5be83e[_0x725e('0x46')]){delete _0x5be83e[_0x725e('0x46')];}_0x5dd1d1['status'](_0x23d29b)[_0x725e('0x47')](_0x5be83e);};}exports[_0x725e('0x48')]=function(_0x1ae4e2,_0x4366bc){var _0x1ec4fe={},_0x19ed0a={},_0x3e5460={'count':0x0,'rows':[]};var _0x49848f=_[_0x725e('0x3e')](db[_0x725e('0x49')]['rawAttributes'],function(_0x2200ad){return{'name':_0x2200ad[_0x725e('0x4a')],'type':_0x2200ad['type']['key']};});_0x19ed0a['model']=_['differenceBy'](_[_0x725e('0x3e')](_0x49848f,_0x725e('0x46')),[_0x725e('0x4b'),'salt']);_0x19ed0a[_0x725e('0x4c')]=_['keys'](_0x1ae4e2['query']);_0x19ed0a[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x19ed0a[_0x725e('0x4f')],_0x19ed0a[_0x725e('0x4c')]);_0x1ec4fe[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x19ed0a['model'],qs[_0x725e('0x51')](_0x1ae4e2['query'][_0x725e('0x51')]));_0x1ec4fe[_0x725e('0x50')]=_0x1ec4fe['attributes'][_0x725e('0x52')]?_0x1ec4fe['attributes']:_0x19ed0a[_0x725e('0x4f')];if(!_0x1ae4e2[_0x725e('0x4c')]['hasOwnProperty']('nolimit')){_0x1ec4fe[_0x725e('0x32')]=qs['limit'](_0x1ae4e2[_0x725e('0x4c')]['limit']);_0x1ec4fe['offset']=qs['offset'](_0x1ae4e2[_0x725e('0x4c')][_0x725e('0x31')]);}_0x1ec4fe['order']=qs[_0x725e('0x53')](_0x1ae4e2[_0x725e('0x4c')]['sort']);_0x1ec4fe[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x1ae4e2[_0x725e('0x4c')],_0x19ed0a[_0x725e('0x4d')]),_0x49848f);if(_0x1ae4e2[_0x725e('0x4c')][_0x725e('0x56')]){_0x1ec4fe[_0x725e('0x54')]=_[_0x725e('0x57')](_0x1ec4fe[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x49848f,function(_0x14753a){if(_0x14753a[_0x725e('0x58')]!=='VIRTUAL'){return db[_0x725e('0x59')]['where'](db[_0x725e('0x59')]['fn'](_0x725e('0x5a'),db[_0x725e('0x59')][_0x725e('0x5b')](_0x14753a[_0x725e('0x46')])),{'$like':db[_0x725e('0x59')]['fn'](_0x725e('0x5a'),'%'+_0x1ae4e2[_0x725e('0x4c')][_0x725e('0x56')]+'%')});}})});}_0x1ec4fe=_[_0x725e('0x57')]({},_0x1ec4fe,_0x1ae4e2[_0x725e('0x5c')]);var _0x248252={'where':_0x1ec4fe[_0x725e('0x54')]};return db[_0x725e('0x49')][_0x725e('0x30')](_0x248252)[_0x725e('0x23')](function(_0x420689){_0x3e5460[_0x725e('0x30')]=_0x420689;if(_0x1ae4e2['query'][_0x725e('0x5d')]){_0x1ec4fe['include']=[{'all':!![]}];}return db[_0x725e('0x49')][_0x725e('0x5e')](_0x1ec4fe);})['then'](function(_0x118bf9){_0x3e5460['rows']=_0x118bf9;return _0x3e5460;})[_0x725e('0x23')](respondWithFilteredResult(_0x4366bc,_0x1ec4fe))[_0x725e('0x2d')](handleError(_0x4366bc,null));};exports[_0x725e('0x5f')]=function(_0x53d504,_0x9bc8b5){var _0x1b347e={'raw':![],'where':{'id':_0x53d504[_0x725e('0x60')]['id']}},_0x1cbfb8={};_0x1cbfb8[_0x725e('0x4f')]=_[_0x725e('0x61')](_[_0x725e('0x62')](db[_0x725e('0x49')]['rawAttributes']),[_0x725e('0x4b'),_0x725e('0x63')]);_0x1cbfb8['query']=_['keys'](_0x53d504[_0x725e('0x4c')]);_0x1cbfb8[_0x725e('0x4d')]=_['intersection'](_0x1cbfb8['model'],_0x1cbfb8[_0x725e('0x4c')]);_0x1b347e[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x1cbfb8[_0x725e('0x4f')],qs[_0x725e('0x51')](_0x53d504[_0x725e('0x4c')]['fields']));_0x1b347e[_0x725e('0x50')]=_0x1b347e[_0x725e('0x50')]['length']?_0x1b347e[_0x725e('0x50')]:_0x1cbfb8[_0x725e('0x4f')];if(_0x53d504[_0x725e('0x4c')][_0x725e('0x5d')]){_0x1b347e[_0x725e('0x64')]=[{'all':!![]}];}_0x1b347e=_['merge']({},_0x1b347e,_0x53d504[_0x725e('0x5c')]);return db[_0x725e('0x49')][_0x725e('0x41')](_0x1b347e)[_0x725e('0x23')](handleEntityNotFound(_0x9bc8b5,null))[_0x725e('0x23')](respondWithResult(_0x9bc8b5,null))[_0x725e('0x2d')](handleError(_0x9bc8b5,null));};exports['bulkCreate']=function(_0x342ba9,_0x5f46f0){return db['User'][_0x725e('0x65')](_0x342ba9['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5f46f0,0xc9))[_0x725e('0x2d')](handleError(_0x5f46f0,null));};exports[_0x725e('0x38')]=function(_0x46f14d,_0xd78f3){if(_0x46f14d[_0x725e('0x66')]['id']){delete _0x46f14d[_0x725e('0x66')]['id'];}delete _0x46f14d[_0x725e('0x66')]['role'];return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x46f14d[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0xd78f3,null))['then'](saveUpdates(_0x46f14d[_0x725e('0x66')],null))[_0x725e('0x23')](respondWithResult(_0xd78f3,null))[_0x725e('0x2d')](handleError(_0xd78f3,null));};exports[_0x725e('0x67')]=function(_0x106493,_0x10c7ba){return db[_0x725e('0x49')]['describe']()[_0x725e('0x23')](respondWithResult(_0x10c7ba,null))['catch'](handleError(_0x10c7ba,null));};exports[_0x725e('0x68')]=function(_0x4c8af0,_0x3b756b,_0x22d7d9){return db[_0x725e('0x49')]['find']({'where':{'id':_0x4c8af0[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x3b756b,null))[_0x725e('0x23')](function(_0x388510){if(_0x388510){return _0x388510[_0x725e('0x68')](_0x4c8af0[_0x725e('0x66')][_0x725e('0x69')],_[_0x725e('0x6a')](_0x4c8af0[_0x725e('0x66')],['ids','id'])||{});}})[_0x725e('0x23')](respondWithResult(_0x3b756b,null))[_0x725e('0x2d')](handleError(_0x3b756b,null));};var getLicense=function(_0x58c7f7){return new BPromise(function(_0x12cc3e,_0x1a12c1){var _0x1d2e49=0x0;_0x58c7f7[_0x725e('0x66')][_0x725e('0x40')]===_0x725e('0x3b')&&_0x12cc3e(_0x725e('0x6b'));return db['User']['count']({'where':{'$or':[{'role':_0x58c7f7['body'][_0x725e('0x40')]===_0x725e('0x3d')?_0x725e('0x3d'):['admin',_0x725e('0x3a')]}]}})[_0x725e('0x23')](function(_0x59338f){_0x1d2e49=_0x59338f;return require('../../config/license/util')[_0x725e('0x6c')]();})['then'](function(_0xb665b0){var _0x21d6da=_0x58c7f7['body'][_0x725e('0x40')]===_0x725e('0x3d')?_0x725e('0x6d'):'users';if(!_[_0x725e('0x6e')](_0xb665b0[_0x21d6da])&&_0x1d2e49>=_0xb665b0[_0x21d6da]){return _0x1a12c1({'message':_0x725e('0x6f')});}return _0x12cc3e(util[_0x725e('0x70')]('count\x20%s:\x20%s',_0x21d6da,_0x1d2e49));})[_0x725e('0x2d')](function(_0xd36461){return _0x1a12c1(_0xd36461);});});};exports[_0x725e('0x71')]=function(_0x75897c,_0x1551bd){return getLicense(_0x75897c)['then'](function(_0x5b84ae){if(!_0x75897c[_0x725e('0x66')][_0x725e('0x72')]){var _0x3ff259;return db['Setting'][_0x725e('0x73')](0x1)[_0x725e('0x23')](function(_0x4d0809){return checkPasswordPattern(_0x4d0809,_0x75897c[_0x725e('0x66')][_0x725e('0x4b')],_0x4d0809[_0x725e('0x74')]);})[_0x725e('0x23')](function(_0x42af7e){_0x3ff259=_0x42af7e['min_internal'];return db[_0x725e('0x49')]['max'](_0x725e('0x72'));})[_0x725e('0x23')](function(_0x347483){if(_[_0x725e('0x6e')](_0x347483)){if(_0x3ff259){_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=_0x3ff259;}else{_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=0x1;}}else{if(_[_0x725e('0x6e')](_0x3ff259)||_0x3ff259==_0x347483){_0x75897c['body'][_0x725e('0x72')]=_0x347483+0x1;}else if(_0x3ff259>_0x347483){_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=_0x3ff259;}else{return db[_0x725e('0x59')]['query'](_0x725e('0x75'),{'type':db[_0x725e('0x59')][_0x725e('0x76')][_0x725e('0x77')]})['then'](function(_0x3072d8){if(_0x3072d8&&_0x3072d8['length']){for(var _0x277249=0x0,_0x4e80b8=_0x3072d8['length'];_0x277249<_0x4e80b8&&_[_0x725e('0x6e')](_0x75897c['body'][_0x725e('0x72')]);_0x277249++){if(_0x3ff259<=_0x3072d8[_0x277249]['from']){_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=_0x3072d8[_0x277249][_0x725e('0x78')];}else if(_0x3ff259>_0x3072d8[_0x277249]['from']&&_0x3ff259<=_0x3072d8[_0x277249]['to']){_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=_0x3ff259;}}}if(_['isNil'](_0x75897c[_0x725e('0x66')]['internal'])){_0x75897c[_0x725e('0x66')][_0x725e('0x72')]=_0x347483+0x1;}});}}});}})['then'](function(){if(_0x75897c[_0x725e('0x66')][_0x725e('0x79')]){_0x75897c[_0x725e('0x66')][_0x725e('0x7a')]=_0x75897c[_0x725e('0x66')][_0x725e('0x72')];_0x75897c[_0x725e('0x66')][_0x725e('0x7b')]={'mailbox':_0x75897c[_0x725e('0x66')][_0x725e('0x72')],'password':_0x75897c[_0x725e('0x66')][_0x725e('0x4b')],'fullname':_0x75897c[_0x725e('0x66')][_0x725e('0x7c')],'email':_0x75897c[_0x725e('0x66')][_0x725e('0x7d')]};}if(_0x75897c[_0x725e('0x66')]&&_0x75897c['body'][_0x725e('0x40')]===_0x725e('0x3b')){if(!_0x75897c[_0x725e('0x66')][_0x725e('0x7e')]){_0x75897c[_0x725e('0x66')][_0x725e('0x7e')]=[_0x725e('0x7f'),_0x725e('0x80'),'103','113',_0x725e('0x81'),_0x725e('0x82'),_0x725e('0x83'),'106','107',_0x725e('0x84'),_0x725e('0x85'),_0x725e('0x86'),_0x725e('0x87'),_0x725e('0x88')];}}return db[_0x725e('0x49')]['create'](_0x75897c[_0x725e('0x66')],{'include':[{'model':db[_0x725e('0x7b')],'as':_0x725e('0x7b')}]});})['then'](function(_0xce526e){if(_0x75897c[_0x725e('0x66')]['role']===_0x725e('0x3a'))return _0xce526e;var _0x2a055d=_0x75897c[_0x725e('0x3a')][_0x725e('0x39')]({'plain':!![]});if(!_0x2a055d)throw new Error(_0x725e('0x89'));if(_0x2a055d[_0x725e('0x40')]==='user'){var _0x581774=_0xce526e[_0x725e('0x39')]({'plain':!![]});var _0x21d697=[{'name':_0x725e('0x8a'),'value':_0x725e('0x3b')},{'name':_0x725e('0x3c'),'value':'telephone'}];var _0x345d9b=_[_0x725e('0x41')](_0x21d697,[_0x725e('0x3f'),_0x581774['role']])['name'];return db[_0x725e('0x8b')][_0x725e('0x41')]({'where':{'name':_0x345d9b,'userProfileId':_0x2a055d[_0x725e('0x8c')]},'raw':!![]})['then'](function(_0x214f6b){if(_0x214f6b&&_0x214f6b[_0x725e('0x8d')]===0x0){return db[_0x725e('0x42')][_0x725e('0x71')]({'name':_0x581774[_0x725e('0x46')],'resourceId':_0x581774['id'],'type':_0x214f6b[_0x725e('0x46')],'sectionId':_0x214f6b['id']},{})[_0x725e('0x23')](function(){return _0xce526e;});}else{return _0xce526e;}})[_0x725e('0x2d')](function(_0x54fbe6){logger[_0x725e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fbe6);throw _0x54fbe6;});}return _0xce526e;})[_0x725e('0x23')](respondWithResult(_0x1551bd,0xc9))['catch'](handleError(_0x1551bd,null));};exports[_0x725e('0x8e')]=function(_0x2e02a3,_0x1b6528,_0x4fc3ef){var _0x50bb3e=![];if(_0x2e02a3[_0x725e('0x66')]['id']){delete _0x2e02a3[_0x725e('0x66')]['id'];}return db['Setting'][_0x725e('0x8f')]({'attributes':['id',_0x725e('0x74')]})[_0x725e('0x23')](function(_0x1fe8bd){_0x50bb3e=_0x1fe8bd[_0x725e('0x74')];return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x2e02a3[_0x725e('0x60')]['id']}});})['then'](function(_0x1f07f3){if(_0x1f07f3){if(_0x1f07f3['id']==_0x2e02a3[_0x725e('0x3a')]['id']){if(!_0x2e02a3[_0x725e('0x66')][_0x725e('0x90')]||!_0x2e02a3[_0x725e('0x66')][_0x725e('0x91')]){throw new db[(_0x725e('0x20'))]['ValidationError'](_0x725e('0x92'));}if(!_0x1f07f3['authenticate'](_0x2e02a3[_0x725e('0x66')][_0x725e('0x90')])){throw new db[(_0x725e('0x20'))][(_0x725e('0x21'))](_0x725e('0x93'));}if(_0x2e02a3[_0x725e('0x66')]['oldPassword']==_0x2e02a3['body'][_0x725e('0x91')]){throw new db[(_0x725e('0x20'))][(_0x725e('0x21'))](_0x725e('0x94'));}return _0x1f07f3;}else if(_0x2e02a3[_0x725e('0x3a')][_0x725e('0x40')]==_0x725e('0x95')){if(!_0x2e02a3[_0x725e('0x66')][_0x725e('0x91')]){throw new db[(_0x725e('0x20'))][(_0x725e('0x21'))](_0x725e('0x96'));}return _0x1f07f3;}else if(_0x2e02a3[_0x725e('0x3a')]['role']==_0x725e('0x3a')){if(!_0x2e02a3['body'][_0x725e('0x91')]){throw new db[(_0x725e('0x20'))]['ValidationError'](_0x725e('0x96'));}if(_0x1f07f3['role']!=_0x725e('0x3b')){throw new db[(_0x725e('0x20'))]['ValidationError']('Unauthorized');}return _0x1f07f3;}else{throw new db[(_0x725e('0x20'))]['ValidationError'](_0x725e('0x97'));}}return null;})['then'](handleEntityNotFound(_0x1b6528,null))[_0x725e('0x23')](function(_0x2f5c12){return checkPasswordPattern(_0x2f5c12,_0x2e02a3['body'][_0x725e('0x91')],_0x50bb3e);})[_0x725e('0x23')](saveUpdates({'password':_0x2e02a3[_0x725e('0x66')][_0x725e('0x91')],'passwordResetAt':_0x2e02a3[_0x725e('0x3a')]['id']==_0x2e02a3[_0x725e('0x60')]['id']?moment():null},null))[_0x725e('0x23')](respondWithResult(_0x1b6528,null))['catch'](handleError(_0x1b6528,null));};exports[_0x725e('0x98')]=function(_0x56d7d0,_0x1dffdd,_0x125a60){var _0x58773a=_0x56d7d0['body']['channel'];return db[_0x725e('0x49')]['find']({'where':{'id':_0x56d7d0['params']['id']},'attributes':['id',_0x725e('0x46'),_0x725e('0x40'),_0x725e('0x99'),_0x725e('0x9a'),'voicePause',_0x725e('0x9b')]})[_0x725e('0x23')](handleEntityNotFound(_0x1dffdd,null))[_0x725e('0x23')](function(_0x4cb90b){if(_0x4cb90b){if(!utils[_0x725e('0x9c')](_0x58773a)){throw new db['Sequelize'][(_0x725e('0x21'))](_0x725e('0x9d'));}return _0x4cb90b[_0x725e('0x9e')+_[_0x725e('0x9f')](_0x58773a[_0x725e('0xa0')]())+_0x725e('0xa1')](_0x56d7d0[_0x725e('0x66')]['ids'],{'penalty':_0x56d7d0['body'][_0x725e('0xa2')]||0x0})[_0x725e('0xa3')](function(_0xe17e71){for(var _0x40bb92=0x0;_0x40bb92<_0x56d7d0['body'][_0x725e('0x69')][_0x725e('0x52')];_0x40bb92+=0x1){var _0x44c2f2={'UserId':_0x56d7d0[_0x725e('0x60')]['id']};_0x44c2f2[_[_0x725e('0x9f')](_0x58773a[_0x725e('0xa0')]())+_0x725e('0xa4')]=_0x56d7d0[_0x725e('0x66')][_0x725e('0x69')][_0x40bb92];socket[_0x725e('0xa5')]('user'+_[_0x725e('0x9f')](_0x58773a[_0x725e('0xa0')]())+_0x725e('0xa6'),_0x44c2f2);}return _0xe17e71;})[_0x725e('0x23')](function(){if(_0x58773a===_0x725e('0xa7')){return db[_0x725e('0xa8')]['findAll']({'where':{'id':_0x56d7d0[_0x725e('0x66')][_0x725e('0x69')]||[]},'raw':!![],'attributes':['id',_0x725e('0x46')]});}})['then'](function(_0x5a8e61){var _0x12107b=_0x4cb90b[_0x725e('0x39')]({'plain':!![]});var _0x240fde=[];if(_0x58773a===_0x725e('0xa7')&&_0x12107b[_0x725e('0x40')]===_0x725e('0x3b')&&_0x12107b[_0x725e('0x99')]){for(var _0x46b8f8=0x0;_0x46b8f8<_0x5a8e61[_0x725e('0x52')];_0x46b8f8+=0x1){_0x240fde[_0x725e('0xa9')]({'membername':_0x12107b[_0x725e('0x46')],'UserId':_0x12107b['id'],'queue_name':_0x5a8e61[_0x46b8f8]['name'],'VoiceQueueId':_0x5a8e61[_0x46b8f8]['id'],'interface':_[_0x725e('0x6e')](_0x12107b[_0x725e('0x9b')])?util[_0x725e('0x70')](_0x725e('0xaa'),_0x12107b[_0x725e('0x46')]):_0x12107b['interface'],'paused':_0x12107b['voicePause']||![],'penalty':_0x56d7d0['body'][_0x725e('0xa2')]||0x0});}return BPromise['each'](_0x240fde,function(_0x5ea21c){return db[_0x725e('0xab')]['upsert'](_0x5ea21c);});}return _0x4cb90b;});}})[_0x725e('0x23')](respondWithStatusCode(_0x1dffdd,null))[_0x725e('0x2d')](handleError(_0x1dffdd,null));};exports[_0x725e('0xac')]=function(_0x4cd25e,_0x3ade77,_0x35aa4a){var _0x497934;return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x4cd25e[_0x725e('0x60')]['id']},'attributes':['id',_0x725e('0x46'),_0x725e('0x40')]})['then'](handleEntityNotFound(_0x3ade77,null))['then'](function(_0x4152a2){if(_0x4152a2){_0x497934=_0x4152a2;if(!_0x4cd25e[_0x725e('0x4c')]['channel']||!utils[_0x725e('0x9c')](_0x4cd25e['query']['channel'])){throw new db[(_0x725e('0x20'))]['ValidationError'](_0x725e('0x9d'));}return _0x4152a2[_0x725e('0xad')+_[_0x725e('0x9f')](_0x4cd25e['query']['channel'][_0x725e('0xa0')]())+_0x725e('0xa1')](_0x4cd25e[_0x725e('0x4c')][_0x725e('0x69')]);}})[_0x725e('0x23')](function(_0x135262){for(var _0x4ca119=0x0;_0x4ca119<_0x4cd25e[_0x725e('0x4c')][_0x725e('0x69')][_0x725e('0x52')];_0x4ca119+=0x1){var _0x51ba9d={'UserId':_0x4cd25e[_0x725e('0x60')]['id']};_0x51ba9d[_[_0x725e('0x9f')](_0x4cd25e[_0x725e('0x4c')][_0x725e('0xae')]['toLowerCase']())+_0x725e('0xa4')]=_0x4cd25e[_0x725e('0x4c')][_0x725e('0x69')][_0x4ca119];socket[_0x725e('0xa5')]('user'+_[_0x725e('0x9f')](_0x4cd25e['query'][_0x725e('0xae')]['toLowerCase']())+_0x725e('0xaf'),_0x51ba9d);}return _0x135262;})[_0x725e('0x23')](function(){if(_0x4cd25e[_0x725e('0x4c')][_0x725e('0xae')]===_0x725e('0xa7')){return db[_0x725e('0xab')][_0x725e('0x43')]({'where':{'UserId':_0x4cd25e[_0x725e('0x60')]['id'],'VoiceQueueId':_0x4cd25e[_0x725e('0x4c')]['ids']},'individualHooks':!![]})[_0x725e('0x23')](function(){return _0x497934;});}return _0x497934;})['then'](respondWithStatusCode(_0x3ade77,null))[_0x725e('0x2d')](handleError(_0x3ade77,null));};exports['addAvatar']=function(_0x31cea2,_0x7172b1,_0x55af4e){_0x31cea2[_0x725e('0x66')][_0x725e('0xb0')]=_0x31cea2[_0x725e('0xb1')][_0x725e('0xb2')];return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x31cea2[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0x7172b1,null))[_0x725e('0x23')](saveUpdates(_0x31cea2[_0x725e('0x66')],null))[_0x725e('0x23')](respondWithResult(_0x7172b1,null))[_0x725e('0x2d')](handleError(_0x7172b1,null));};exports['getAvatar']=function(_0x37bc92,_0x5c2f29,_0x5813bb){var _0xbdf6b=path[_0x725e('0xb3')](config['root'],_0x725e('0xb4'));return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x37bc92[_0x725e('0x60')]['id']},'attributes':['id',_0x725e('0xb0')],'raw':!![]})[_0x725e('0x23')](handleEntityNotFound(_0x5c2f29,null))[_0x725e('0x23')](function(_0x2ab9d8){if(_0x2ab9d8){if(_[_0x725e('0x6e')](_0x2ab9d8[_0x725e('0xb0')])){return _0x5c2f29['download'](_0xbdf6b);}else{if(!fs[_0x725e('0xb5')](path['join'](config[_0x725e('0xb6')],'server/files/images/',_0x2ab9d8['userpic']))){return _0x5c2f29['download'](_0xbdf6b);}return _0x5c2f29[_0x725e('0xb7')](path[_0x725e('0xb3')](config['root'],'server/files/images/',_0x2ab9d8[_0x725e('0xb0')]));}}})[_0x725e('0x2d')](handleError(_0x5c2f29,null));};exports['getContacts']=function(_0x457f26,_0x13ab71,_0x5999c3){var _0x16d62f={};var _0x5bb431={};var _0x27b9a9;var _0x49a96e;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x457f26[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x13ab71,null))[_0x725e('0x23')](function(_0x497051){if(_0x497051){_0x27b9a9=_0x497051;_0x5bb431['model']=_[_0x725e('0x62')](db[_0x725e('0xb8')][_0x725e('0xb9')]);_0x5bb431['query']=_[_0x725e('0x62')](_0x457f26[_0x725e('0x4c')]);_0x5bb431['filters']=_[_0x725e('0x4e')](_0x5bb431[_0x725e('0x4f')],_0x5bb431[_0x725e('0x4c')]);_0x16d62f[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x5bb431[_0x725e('0x4f')],qs[_0x725e('0x51')](_0x457f26[_0x725e('0x4c')][_0x725e('0x51')]));_0x16d62f[_0x725e('0x50')]=_0x16d62f[_0x725e('0x50')]['length']?_0x16d62f[_0x725e('0x50')]:_0x5bb431['model'];_0x16d62f[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x457f26[_0x725e('0x4c')][_0x725e('0x53')]);_0x16d62f['where']=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x457f26[_0x725e('0x4c')],_0x5bb431[_0x725e('0x4d')]));if(_0x457f26[_0x725e('0x4c')][_0x725e('0x56')]){_0x16d62f[_0x725e('0x54')]=_[_0x725e('0x57')](_0x16d62f[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x16d62f[_0x725e('0x50')],function(_0x5babed){var _0x1176ad={};_0x1176ad[_0x5babed]={'$like':'%'+_0x457f26[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x1176ad;})});}_0x16d62f=_[_0x725e('0x57')]({},_0x16d62f,_0x457f26[_0x725e('0x5c')]);return _0x27b9a9[_0x725e('0xbb')](_0x16d62f);}})[_0x725e('0x23')](function(_0x3f6825){if(_0x3f6825){_0x49a96e=_0x3f6825[_0x725e('0x52')];if(_0x457f26[_0x725e('0x4c')][_0x725e('0xbc')]('includeAll')){_0x16d62f[_0x725e('0x64')]=[{'model':db[_0x725e('0xbd')],'as':_0x725e('0xbe'),'required':![]},{'model':db[_0x725e('0xbf')],'as':_0x725e('0xc0'),'attributes':['id',_0x725e('0x46'),_0x725e('0xc1')],'where':_0x457f26[_0x725e('0x4c')]['tag']?{'id':_0x457f26[_0x725e('0x4c')][_0x725e('0xc2')]}:undefined,'required':_0x457f26[_0x725e('0x4c')][_0x725e('0xc2')]?!![]:![]}];}if(!_0x457f26[_0x725e('0x4c')][_0x725e('0xbc')]('nolimit')){_0x16d62f[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x457f26[_0x725e('0x4c')]['limit']);_0x16d62f[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x457f26[_0x725e('0x4c')][_0x725e('0x31')]);}return _0x27b9a9[_0x725e('0xbb')](_0x16d62f);}})[_0x725e('0x23')](function(_0x2ed2be){if(_0x2ed2be){return _0x2ed2be?{'count':_0x49a96e,'rows':_0x2ed2be}:null;}})[_0x725e('0x23')](respondWithResult(_0x13ab71,null))[_0x725e('0x2d')](handleError(_0x13ab71,null));};exports['getQueues']=function(_0x11ec39,_0x153365,_0x4aab72){var _0x18a33e;var _0x960ffb;var _0x2f5725={};var _0x2b3d07;return db[_0x725e('0x49')]['findOne']({'where':{'id':_0x11ec39[_0x725e('0x60')]['id']},'attributes':['id',_0x725e('0x46'),_0x725e('0x40')]})[_0x725e('0x23')](handleEntityNotFound(_0x153365,null))[_0x725e('0x23')](function(_0x52787e){if(!utils[_0x725e('0x9c')](_0x11ec39[_0x725e('0x4c')][_0x725e('0xae')])){throw new db[(_0x725e('0x20'))]['ValidationError'](_0x725e('0x9d'));}_0x18a33e=_0x52787e;var _0x32f462={};_0x32f462[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_[_0x725e('0x9f')](_0x11ec39['query'][_0x725e('0xae')])+_0x725e('0xc3')]['rawAttributes']);_0x32f462['query']=_[_0x725e('0x62')](_0x11ec39[_0x725e('0x4c')]);_0x32f462['filters']=_[_0x725e('0x4e')](_0x32f462[_0x725e('0x4f')],_0x32f462['query']);_0x2f5725[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x32f462[_0x725e('0x4f')],qs[_0x725e('0x51')](_0x11ec39[_0x725e('0x4c')][_0x725e('0x51')]));_0x2f5725[_0x725e('0x50')]=_0x2f5725[_0x725e('0x50')][_0x725e('0x52')]?_0x2f5725['attributes']:_0x32f462['model'];_0x2f5725[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x11ec39['query']['sort']);_0x2f5725['where']=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x11ec39['query'],_0x32f462[_0x725e('0x4d')]));if(_0x11ec39[_0x725e('0x4c')][_0x725e('0x56')]){_0x2f5725[_0x725e('0x54')]=_['merge'](_0x2f5725[_0x725e('0x54')],{'$or':_['map'](_0x2f5725[_0x725e('0x50')],function(_0x2fefbf){var _0x39cb0e={};_0x39cb0e[_0x2fefbf]={'$like':'%'+_0x11ec39[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x39cb0e;})});}_0x2f5725=_['merge']({},_0x2f5725,_0x11ec39[_0x725e('0x5c')]);switch(_0x18a33e[_0x725e('0x40')]){case'admin':return db[_['capitalize'](_0x11ec39[_0x725e('0x4c')][_0x725e('0xae')])+_0x725e('0xc3')][_0x725e('0x5e')](_0x2f5725);case _0x725e('0x3a'):case _0x725e('0x3b'):return _0x18a33e[_0x725e('0x39')+_[_0x725e('0x9f')](_0x11ec39[_0x725e('0x4c')][_0x725e('0xae')])+_0x725e('0xa1')](_0x2f5725);default:throw new db[(_0x725e('0x20'))][(_0x725e('0x21'))](_0x725e('0xc4'));}})['then'](function(_0x47524d){_0x2b3d07=_0x47524d[_0x725e('0x52')];if(!_0x11ec39['query'][_0x725e('0xbc')](_0x725e('0xc5'))){_0x2f5725['limit']=qs[_0x725e('0x32')](_0x11ec39[_0x725e('0x4c')][_0x725e('0x32')]);_0x2f5725[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x11ec39[_0x725e('0x4c')]['offset']);}switch(_0x18a33e['role']){case _0x725e('0x95'):return db[_['capitalize'](_0x11ec39[_0x725e('0x4c')][_0x725e('0xae')])+'Queue'][_0x725e('0x5e')](_0x2f5725);case _0x725e('0x3a'):case'agent':return _0x18a33e['get'+_[_0x725e('0x9f')](_0x11ec39[_0x725e('0x4c')]['channel'])+_0x725e('0xa1')](_0x2f5725);}})[_0x725e('0x23')](function(_0x3f2e93){return{'count':_0x2b3d07,'rows':_0x3f2e93};})[_0x725e('0x23')](respondWithResult(_0x153365,null))[_0x725e('0x2d')](handleError(_0x153365,null));};exports['getVoiceQueuesRt']=function(_0x4a9c0b,_0x45f6b6,_0x730483){var _0x34424c={};var _0x47f01a={};var _0x14c741;var _0x3a8a7a;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x4a9c0b[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0x45f6b6,null))[_0x725e('0x23')](function(_0x8e1867){if(_0x8e1867){_0x14c741=_0x8e1867;_0x47f01a[_0x725e('0x4f')]=_[_0x725e('0x62')](db['UserVoiceQueueRt'][_0x725e('0xb9')]);_0x47f01a[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x4a9c0b[_0x725e('0x4c')]);_0x47f01a[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x47f01a[_0x725e('0x4f')],_0x47f01a['query']);_0x34424c[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x47f01a['model'],qs[_0x725e('0x51')](_0x4a9c0b[_0x725e('0x4c')]['fields']));_0x34424c['attributes']=_0x34424c[_0x725e('0x50')]['length']?_0x34424c['attributes']:_0x47f01a[_0x725e('0x4f')];_0x34424c[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x4a9c0b[_0x725e('0x4c')][_0x725e('0x53')]);_0x34424c['where']=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x4a9c0b[_0x725e('0x4c')],_0x47f01a['filters']));if(_0x4a9c0b[_0x725e('0x4c')][_0x725e('0x56')]){_0x34424c['where']=_[_0x725e('0x57')](_0x34424c[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x34424c['attributes'],function(_0x21f62b){var _0x2f23fd={};_0x2f23fd[_0x21f62b]={'$like':'%'+_0x4a9c0b[_0x725e('0x4c')]['filter']+'%'};return _0x2f23fd;})});}_0x34424c=_['merge']({},_0x34424c,_0x4a9c0b[_0x725e('0x5c')]);return _0x14c741[_0x725e('0xc6')](_0x34424c);}})['then'](function(_0x4b30f4){if(_0x4b30f4){_0x3a8a7a=_0x4b30f4[_0x725e('0x52')];if(!_0x4a9c0b['query'][_0x725e('0xbc')](_0x725e('0xc5'))){_0x34424c[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x4a9c0b[_0x725e('0x4c')][_0x725e('0x32')]);_0x34424c[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x4a9c0b[_0x725e('0x4c')][_0x725e('0x31')]);}return _0x14c741[_0x725e('0xc6')](_0x34424c);}})[_0x725e('0x23')](function(_0x2b5433){if(_0x2b5433){return _0x2b5433?{'count':_0x3a8a7a,'rows':_0x2b5433}:null;}})[_0x725e('0x23')](respondWithResult(_0x45f6b6,null))[_0x725e('0x2d')](handleError(_0x45f6b6,null));};exports[_0x725e('0xc7')]=function(_0x5a901e,_0x352764,_0x2ba1be){var _0x556412={};var _0x3df380={};var _0x2052e5;var _0x392be6;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x5a901e['params']['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x352764,null))[_0x725e('0x23')](function(_0x1a9292){if(_0x1a9292){_0x2052e5=_0x1a9292;_0x3df380[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0xc8')][_0x725e('0xb9')]);_0x3df380[_0x725e('0x4c')]=_['keys'](_0x5a901e[_0x725e('0x4c')]);_0x3df380[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x3df380[_0x725e('0x4f')],_0x3df380[_0x725e('0x4c')]);_0x556412[_0x725e('0x50')]=_['intersection'](_0x3df380['model'],qs[_0x725e('0x51')](_0x5a901e[_0x725e('0x4c')]['fields']));_0x556412[_0x725e('0x50')]=_0x556412[_0x725e('0x50')][_0x725e('0x52')]?_0x556412[_0x725e('0x50')]:_0x3df380[_0x725e('0x4f')];_0x556412[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x5a901e[_0x725e('0x4c')]['sort']);_0x556412[_0x725e('0x54')]=qs[_0x725e('0x4d')](_['pick'](_0x5a901e[_0x725e('0x4c')],_0x3df380[_0x725e('0x4d')]));if(_0x5a901e['query'][_0x725e('0x56')]){_0x556412['where']=_[_0x725e('0x57')](_0x556412[_0x725e('0x54')],{'$or':_['map'](_0x556412[_0x725e('0x50')],function(_0x2ea102){var _0x3d31f2={};_0x3d31f2[_0x2ea102]={'$like':'%'+_0x5a901e[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x3d31f2;})});}_0x556412=_[_0x725e('0x57')]({},_0x556412,_0x5a901e[_0x725e('0x5c')]);return _0x2052e5[_0x725e('0xc7')](_0x556412);}})[_0x725e('0x23')](function(_0x174bc0){if(_0x174bc0){_0x392be6=_0x174bc0['length'];if(!_0x5a901e[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x556412[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x5a901e[_0x725e('0x4c')]['limit']);_0x556412[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x5a901e[_0x725e('0x4c')]['offset']);}return _0x2052e5[_0x725e('0xc7')](_0x556412);}})[_0x725e('0x23')](function(_0xe53713){if(_0xe53713){return _0xe53713?{'count':_0x392be6,'rows':_0xe53713}:null;}})['then'](respondWithResult(_0x352764,null))[_0x725e('0x2d')](handleError(_0x352764,null));};exports[_0x725e('0xc9')]=function(_0xea845c,_0x1620f0,_0x2c7a63){var _0x429688={'raw':!![],'where':{}};var _0xd5a7df={};var _0x358b39={'count':0x0,'rows':[]};return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0xea845c[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0x1620f0,null))[_0x725e('0x23')](function(_0x5be85f){if(_0x5be85f){_0xd5a7df['model']=_[_0x725e('0x62')](db[_0x725e('0xca')]['rawAttributes']);_0xd5a7df[_0x725e('0x4c')]=_['keys'](_0xea845c[_0x725e('0x4c')]);_0xd5a7df[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0xd5a7df[_0x725e('0x4f')],_0xd5a7df[_0x725e('0x4c')]);_0x429688[_0x725e('0x50')]=_[_0x725e('0x4e')](_0xd5a7df['model'],qs[_0x725e('0x51')](_0xea845c[_0x725e('0x4c')]['fields']));_0x429688[_0x725e('0x50')]=_0x429688[_0x725e('0x50')][_0x725e('0x52')]?_0x429688[_0x725e('0x50')]:_0xd5a7df[_0x725e('0x4f')];if(!_0xea845c[_0x725e('0x4c')]['hasOwnProperty']('nolimit')){_0x429688['limit']=qs[_0x725e('0x32')](_0xea845c['query']['limit']);_0x429688[_0x725e('0x31')]=qs['offset'](_0xea845c[_0x725e('0x4c')][_0x725e('0x31')]);}_0x429688[_0x725e('0xba')]=qs[_0x725e('0x53')](_0xea845c[_0x725e('0x4c')][_0x725e('0x53')]);_0x429688[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0xea845c[_0x725e('0x4c')],_0xd5a7df[_0x725e('0x4d')]));_0x429688[_0x725e('0x54')]['UserId']=_0x5be85f['id'];if(_0xea845c[_0x725e('0x4c')][_0x725e('0x56')]){_0x429688[_0x725e('0x54')]=_[_0x725e('0x57')](_0x429688[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x429688[_0x725e('0x50')],function(_0x27655b){var _0x228530={};_0x228530[_0x27655b]={'$like':'%'+_0xea845c[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x228530;})});}_0x429688=_[_0x725e('0x57')]({},_0x429688,_0xea845c[_0x725e('0x5c')]);return db[_0x725e('0xca')][_0x725e('0x30')]({'where':_0x429688[_0x725e('0x54')]})[_0x725e('0x23')](function(_0x28f389){_0x358b39['count']=_0x28f389;if(_0xea845c[_0x725e('0x4c')][_0x725e('0x5d')]){_0x429688[_0x725e('0x64')]=[{'all':!![]}];}return db['VoiceRecording'][_0x725e('0x5e')](_0x429688);})[_0x725e('0x23')](function(_0x568378){_0x358b39[_0x725e('0xcb')]=_0x568378;return _0x358b39;});}})[_0x725e('0x23')](respondWithFilteredResult(_0x1620f0,_0x429688))[_0x725e('0x2d')](handleError(_0x1620f0,null));};exports[_0x725e('0xcc')]=function(_0x4d05ee,_0x52a4b8,_0x1b0813){var _0x3dc5e4={'raw':!![],'where':{}};var _0x72308c={};var _0x269f30={'count':0x0,'rows':[]};return db['User'][_0x725e('0x8f')]({'where':{'id':_0x4d05ee[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x52a4b8,null))[_0x725e('0x23')](function(_0x2a1e1e){if(_0x2a1e1e){_0x72308c['model']=_['keys'](db[_0x725e('0xcd')]['rawAttributes']);_0x72308c[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x4d05ee[_0x725e('0x4c')]);_0x72308c['filters']=_[_0x725e('0x4e')](_0x72308c[_0x725e('0x4f')],_0x72308c[_0x725e('0x4c')]);_0x3dc5e4['attributes']=_[_0x725e('0x4e')](_0x72308c[_0x725e('0x4f')],qs['fields'](_0x4d05ee['query'][_0x725e('0x51')]));_0x3dc5e4[_0x725e('0x50')]=_0x3dc5e4[_0x725e('0x50')][_0x725e('0x52')]?_0x3dc5e4[_0x725e('0x50')]:_0x72308c[_0x725e('0x4f')];if(!_0x4d05ee[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x3dc5e4['limit']=qs['limit'](_0x4d05ee['query']['limit']);_0x3dc5e4[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x4d05ee[_0x725e('0x4c')]['offset']);}_0x3dc5e4[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x4d05ee['query'][_0x725e('0x53')]);_0x3dc5e4[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x4d05ee['query'],_0x72308c[_0x725e('0x4d')]));_0x3dc5e4[_0x725e('0x54')][_0x725e('0xce')]=_0x2a1e1e['id'];if(_0x4d05ee[_0x725e('0x4c')][_0x725e('0x56')]){_0x3dc5e4[_0x725e('0x54')]=_[_0x725e('0x57')](_0x3dc5e4[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x3dc5e4[_0x725e('0x50')],function(_0x38af1d){var _0x371efe={};_0x371efe[_0x38af1d]={'$like':'%'+_0x4d05ee[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x371efe;})});}_0x3dc5e4=_[_0x725e('0x57')]({},_0x3dc5e4,_0x4d05ee[_0x725e('0x5c')]);return db['ScreenRecording'][_0x725e('0x30')]({'where':_0x3dc5e4[_0x725e('0x54')]})[_0x725e('0x23')](function(_0x1d8cc4){_0x269f30['count']=_0x1d8cc4;if(_0x4d05ee['query'][_0x725e('0x5d')]){_0x3dc5e4[_0x725e('0x64')]=[{'all':!![]}];}return db[_0x725e('0xcd')][_0x725e('0x5e')](_0x3dc5e4);})[_0x725e('0x23')](function(_0x59e2c3){_0x269f30[_0x725e('0xcb')]=_0x59e2c3;return _0x269f30;});}})[_0x725e('0x23')](respondWithFilteredResult(_0x52a4b8,_0x3dc5e4))[_0x725e('0x2d')](handleError(_0x52a4b8,null));};exports['getChatInteractions']=function(_0x5b1136,_0x4b7e08,_0x48f841){var _0x360cf1={};var _0x1e37bc={};var _0x22a5da;var _0xe94536;return db[_0x725e('0x49')]['findOne']({'where':{'id':_0x5b1136[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x4b7e08,null))['then'](function(_0x4bad97){if(_0x4bad97){_0x22a5da=_0x4bad97;_0x1e37bc[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0xcf')]['rawAttributes']);_0x1e37bc[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x5b1136[_0x725e('0x4c')]);_0x1e37bc[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x1e37bc[_0x725e('0x4f')],_0x1e37bc[_0x725e('0x4c')]);_0x360cf1[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x1e37bc[_0x725e('0x4f')],qs['fields'](_0x5b1136[_0x725e('0x4c')]['fields']));_0x360cf1[_0x725e('0x50')]=_0x360cf1[_0x725e('0x50')][_0x725e('0x52')]?_0x360cf1[_0x725e('0x50')]:_0x1e37bc[_0x725e('0x4f')];_0x360cf1[_0x725e('0xba')]=qs['sort'](_0x5b1136[_0x725e('0x4c')]['sort']);_0x360cf1[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x5b1136[_0x725e('0x4c')],_0x1e37bc[_0x725e('0x4d')]));if(_0x5b1136[_0x725e('0x4c')][_0x725e('0x56')]){_0x360cf1[_0x725e('0x54')]=_[_0x725e('0x57')](_0x360cf1[_0x725e('0x54')],{'$or':_['map'](_0x360cf1['attributes'],function(_0x62132f){var _0x1ef81c={};_0x1ef81c[_0x62132f]={'$like':'%'+_0x5b1136[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x1ef81c;})});}_0x360cf1=_['merge']({},_0x360cf1,_0x5b1136[_0x725e('0x5c')]);return _0x22a5da[_0x725e('0xd0')](_0x360cf1);}})[_0x725e('0x23')](function(_0x30f0ec){if(_0x30f0ec){_0xe94536=_0x30f0ec[_0x725e('0x52')];if(!_0x5b1136[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x360cf1[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x5b1136[_0x725e('0x4c')]['limit']);_0x360cf1[_0x725e('0x31')]=qs['offset'](_0x5b1136['query'][_0x725e('0x31')]);}return _0x22a5da[_0x725e('0xd0')](_0x360cf1);}})[_0x725e('0x23')](function(_0xdac7d7){if(_0xdac7d7){return _0xdac7d7?{'count':_0xe94536,'rows':_0xdac7d7}:null;}})[_0x725e('0x23')](respondWithResult(_0x4b7e08,null))[_0x725e('0x2d')](handleError(_0x4b7e08,null));};exports[_0x725e('0xd1')]=function(_0x103c1a,_0x12565d,_0x3f21ed){var _0x3b4d29={};var _0x1c126c={};var _0x3478a3;var _0x3ead78;return db['User']['findOne']({'where':{'id':_0x103c1a[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x12565d,null))[_0x725e('0x23')](function(_0x2e9850){if(_0x2e9850){_0x3478a3=_0x2e9850;_0x1c126c['model']=_['keys'](db[_0x725e('0xd2')]['rawAttributes']);_0x1c126c[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x103c1a['query']);_0x1c126c['filters']=_['intersection'](_0x1c126c[_0x725e('0x4f')],_0x1c126c['query']);_0x3b4d29[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x1c126c['model'],qs[_0x725e('0x51')](_0x103c1a[_0x725e('0x4c')][_0x725e('0x51')]));_0x3b4d29[_0x725e('0x50')]=_0x3b4d29[_0x725e('0x50')][_0x725e('0x52')]?_0x3b4d29[_0x725e('0x50')]:_0x1c126c[_0x725e('0x4f')];_0x3b4d29['order']=qs[_0x725e('0x53')](_0x103c1a[_0x725e('0x4c')][_0x725e('0x53')]);_0x3b4d29['where']=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x103c1a[_0x725e('0x4c')],_0x1c126c['filters']));if(_0x103c1a[_0x725e('0x4c')][_0x725e('0x56')]){_0x3b4d29[_0x725e('0x54')]=_[_0x725e('0x57')](_0x3b4d29['where'],{'$or':_['map'](_0x3b4d29['attributes'],function(_0xcf6dea){var _0x360b06={};_0x360b06[_0xcf6dea]={'$like':'%'+_0x103c1a[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x360b06;})});}_0x3b4d29=_[_0x725e('0x57')]({},_0x3b4d29,_0x103c1a[_0x725e('0x5c')]);return _0x3478a3[_0x725e('0xd1')](_0x3b4d29);}})[_0x725e('0x23')](function(_0x50aafb){if(_0x50aafb){_0x3ead78=_0x50aafb[_0x725e('0x52')];if(!_0x103c1a[_0x725e('0x4c')][_0x725e('0xbc')]('nolimit')){_0x3b4d29[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x103c1a[_0x725e('0x4c')][_0x725e('0x32')]);_0x3b4d29[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x103c1a[_0x725e('0x4c')][_0x725e('0x31')]);}return _0x3478a3[_0x725e('0xd1')](_0x3b4d29);}})[_0x725e('0x23')](function(_0xbe01c5){if(_0xbe01c5){return _0xbe01c5?{'count':_0x3ead78,'rows':_0xbe01c5}:null;}})[_0x725e('0x23')](respondWithResult(_0x12565d,null))[_0x725e('0x2d')](handleError(_0x12565d,null));};exports[_0x725e('0xd3')]=function(_0x3bfad1,_0x4fa792,_0x858bc5){var _0x231c2a={'raw':!![],'where':{}};var _0xa77417={};var _0x3715a5={'count':0x0,'rows':[]};return db['User'][_0x725e('0x8f')]({'where':{'id':_0x3bfad1[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x4fa792,null))[_0x725e('0x23')](function(_0x23c67){if(_0x23c67){_0xa77417['model']=_[_0x725e('0x62')](db[_0x725e('0xd4')][_0x725e('0xb9')]);_0xa77417[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x3bfad1[_0x725e('0x4c')]);_0xa77417[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0xa77417[_0x725e('0x4f')],_0xa77417[_0x725e('0x4c')]);_0x231c2a[_0x725e('0x50')]=_['intersection'](_0xa77417[_0x725e('0x4f')],qs[_0x725e('0x51')](_0x3bfad1[_0x725e('0x4c')][_0x725e('0x51')]));_0x231c2a[_0x725e('0x50')]=_0x231c2a[_0x725e('0x50')][_0x725e('0x52')]?_0x231c2a[_0x725e('0x50')]:_0xa77417[_0x725e('0x4f')];if(!_0x3bfad1[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x231c2a['limit']=qs['limit'](_0x3bfad1[_0x725e('0x4c')][_0x725e('0x32')]);_0x231c2a[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x3bfad1[_0x725e('0x4c')][_0x725e('0x31')]);}_0x231c2a[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x3bfad1[_0x725e('0x4c')][_0x725e('0x53')]);_0x231c2a[_0x725e('0x54')]=qs[_0x725e('0x4d')](_['pick'](_0x3bfad1[_0x725e('0x4c')],_0xa77417[_0x725e('0x4d')]));_0x231c2a['where'][_0x725e('0xce')]=_0x23c67['id'];if(_0x3bfad1['query'][_0x725e('0x56')]){_0x231c2a['where']=_['merge'](_0x231c2a[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x231c2a['attributes'],function(_0x4cf82d){var _0x19b733={};_0x19b733[_0x4cf82d]={'$like':'%'+_0x3bfad1['query'][_0x725e('0x56')]+'%'};return _0x19b733;})});}_0x231c2a=_[_0x725e('0x57')]({},_0x231c2a,_0x3bfad1['options']);return db[_0x725e('0xd4')]['count']({'where':_0x231c2a[_0x725e('0x54')]})[_0x725e('0x23')](function(_0x4e4471){_0x3715a5[_0x725e('0x30')]=_0x4e4471;if(_0x3bfad1['query'][_0x725e('0x5d')]){_0x231c2a[_0x725e('0x64')]=[{'all':!![]}];}return db[_0x725e('0xd4')][_0x725e('0x5e')](_0x231c2a);})[_0x725e('0x23')](function(_0xa4925d){_0x3715a5[_0x725e('0xcb')]=_0xa4925d;return _0x3715a5;});}})[_0x725e('0x23')](respondWithFilteredResult(_0x4fa792,_0x231c2a))[_0x725e('0x2d')](handleError(_0x4fa792,null));};exports[_0x725e('0xd5')]=function(_0x7659ab,_0x390988,_0x549792){var _0x27a671={};var _0x149d27={};var _0xe3119b;var _0x5c50a9;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x7659ab['params']['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x390988,null))[_0x725e('0x23')](function(_0x3a87a2){if(_0x3a87a2){_0xe3119b=_0x3a87a2;_0x149d27[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0xd6')]['rawAttributes']);_0x149d27[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x7659ab[_0x725e('0x4c')]);_0x149d27[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x149d27[_0x725e('0x4f')],_0x149d27[_0x725e('0x4c')]);_0x27a671[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x149d27[_0x725e('0x4f')],qs[_0x725e('0x51')](_0x7659ab[_0x725e('0x4c')][_0x725e('0x51')]));_0x27a671[_0x725e('0x50')]=_0x27a671[_0x725e('0x50')][_0x725e('0x52')]?_0x27a671[_0x725e('0x50')]:_0x149d27[_0x725e('0x4f')];_0x27a671[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x7659ab[_0x725e('0x4c')][_0x725e('0x53')]);_0x27a671[_0x725e('0x54')]=qs[_0x725e('0x4d')](_['pick'](_0x7659ab['query'],_0x149d27[_0x725e('0x4d')]));if(_0x7659ab[_0x725e('0x4c')]['filter']){_0x27a671[_0x725e('0x54')]=_[_0x725e('0x57')](_0x27a671['where'],{'$or':_[_0x725e('0x3e')](_0x27a671['attributes'],function(_0x9b1bb4){var _0x2a6063={};_0x2a6063[_0x9b1bb4]={'$like':'%'+_0x7659ab[_0x725e('0x4c')]['filter']+'%'};return _0x2a6063;})});}_0x27a671=_[_0x725e('0x57')]({},_0x27a671,_0x7659ab[_0x725e('0x5c')]);return _0xe3119b[_0x725e('0xd5')](_0x27a671);}})[_0x725e('0x23')](function(_0x5899e7){if(_0x5899e7){_0x5c50a9=_0x5899e7[_0x725e('0x52')];if(!_0x7659ab[_0x725e('0x4c')][_0x725e('0xbc')]('nolimit')){_0x27a671[_0x725e('0x32')]=qs['limit'](_0x7659ab[_0x725e('0x4c')]['limit']);_0x27a671['offset']=qs[_0x725e('0x31')](_0x7659ab['query']['offset']);}return _0xe3119b[_0x725e('0xd5')](_0x27a671);}})[_0x725e('0x23')](function(_0x5c6a56){if(_0x5c6a56){return _0x5c6a56?{'count':_0x5c50a9,'rows':_0x5c6a56}:null;}})['then'](respondWithResult(_0x390988,null))[_0x725e('0x2d')](handleError(_0x390988,null));};exports[_0x725e('0xd7')]=function(_0xfbdb02,_0x19239a,_0x52e882){var _0x2536fe={};var _0x39ef44={};var _0x1732f5;var _0xfe97fe;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0xfbdb02[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x19239a,null))['then'](function(_0x5e6497){if(_0x5e6497){_0x1732f5=_0x5e6497;_0x39ef44[_0x725e('0x4f')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x39ef44[_0x725e('0x4c')]=_['keys'](_0xfbdb02[_0x725e('0x4c')]);_0x39ef44[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x39ef44[_0x725e('0x4f')],_0x39ef44[_0x725e('0x4c')]);_0x2536fe[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x39ef44[_0x725e('0x4f')],qs[_0x725e('0x51')](_0xfbdb02['query']['fields']));_0x2536fe[_0x725e('0x50')]=_0x2536fe['attributes'][_0x725e('0x52')]?_0x2536fe[_0x725e('0x50')]:_0x39ef44[_0x725e('0x4f')];_0x2536fe[_0x725e('0xba')]=qs['sort'](_0xfbdb02[_0x725e('0x4c')][_0x725e('0x53')]);_0x2536fe[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0xfbdb02[_0x725e('0x4c')],_0x39ef44[_0x725e('0x4d')]));if(_0xfbdb02['query'][_0x725e('0x56')]){_0x2536fe[_0x725e('0x54')]=_[_0x725e('0x57')](_0x2536fe['where'],{'$or':_[_0x725e('0x3e')](_0x2536fe['attributes'],function(_0x81acdf){var _0x34155d={};_0x34155d[_0x81acdf]={'$like':'%'+_0xfbdb02[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x34155d;})});}_0x2536fe=_[_0x725e('0x57')]({},_0x2536fe,_0xfbdb02[_0x725e('0x5c')]);return _0x1732f5[_0x725e('0xd7')](_0x2536fe);}})[_0x725e('0x23')](function(_0x330d8b){if(_0x330d8b){_0xfe97fe=_0x330d8b['length'];if(!_0xfbdb02[_0x725e('0x4c')]['hasOwnProperty'](_0x725e('0xc5'))){_0x2536fe[_0x725e('0x32')]=qs[_0x725e('0x32')](_0xfbdb02[_0x725e('0x4c')]['limit']);_0x2536fe[_0x725e('0x31')]=qs[_0x725e('0x31')](_0xfbdb02[_0x725e('0x4c')][_0x725e('0x31')]);}return _0x1732f5[_0x725e('0xd7')](_0x2536fe);}})[_0x725e('0x23')](function(_0x4c79a7){if(_0x4c79a7){return _0x4c79a7?{'count':_0xfe97fe,'rows':_0x4c79a7}:null;}})['then'](respondWithResult(_0x19239a,null))[_0x725e('0x2d')](handleError(_0x19239a,null));};exports[_0x725e('0xd8')]=function(_0x8552a0,_0xe8e4bf,_0xaa6421){var _0x5a49d1={};var _0x7c1400={};var _0x5a7dcc;var _0x310278;return db['User'][_0x725e('0x8f')]({'where':{'id':_0x8552a0['params']['id']}})[_0x725e('0x23')](handleEntityNotFound(_0xe8e4bf,null))[_0x725e('0x23')](function(_0x30be99){if(_0x30be99){_0x5a7dcc=_0x30be99;_0x7c1400[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0xd9')][_0x725e('0xb9')]);_0x7c1400[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x8552a0[_0x725e('0x4c')]);_0x7c1400['filters']=_[_0x725e('0x4e')](_0x7c1400[_0x725e('0x4f')],_0x7c1400['query']);_0x5a49d1['attributes']=_[_0x725e('0x4e')](_0x7c1400['model'],qs[_0x725e('0x51')](_0x8552a0[_0x725e('0x4c')]['fields']));_0x5a49d1[_0x725e('0x50')]=_0x5a49d1[_0x725e('0x50')][_0x725e('0x52')]?_0x5a49d1['attributes']:_0x7c1400['model'];_0x5a49d1[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x8552a0[_0x725e('0x4c')][_0x725e('0x53')]);_0x5a49d1['where']=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x8552a0[_0x725e('0x4c')],_0x7c1400[_0x725e('0x4d')]));if(_0x8552a0[_0x725e('0x4c')][_0x725e('0x56')]){_0x5a49d1[_0x725e('0x54')]=_['merge'](_0x5a49d1[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x5a49d1[_0x725e('0x50')],function(_0x574b55){var _0x373cd3={};_0x373cd3[_0x574b55]={'$like':'%'+_0x8552a0[_0x725e('0x4c')]['filter']+'%'};return _0x373cd3;})});}_0x5a49d1=_[_0x725e('0x57')]({},_0x5a49d1,_0x8552a0['options']);return _0x5a7dcc[_0x725e('0xd8')](_0x5a49d1);}})[_0x725e('0x23')](function(_0x5e78a7){if(_0x5e78a7){_0x310278=_0x5e78a7[_0x725e('0x52')];if(!_0x8552a0['query'][_0x725e('0xbc')]('nolimit')){_0x5a49d1[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x8552a0[_0x725e('0x4c')][_0x725e('0x32')]);_0x5a49d1[_0x725e('0x31')]=qs['offset'](_0x8552a0['query'][_0x725e('0x31')]);}return _0x5a7dcc[_0x725e('0xd8')](_0x5a49d1);}})[_0x725e('0x23')](function(_0x24ffb5){if(_0x24ffb5){return _0x24ffb5?{'count':_0x310278,'rows':_0x24ffb5}:null;}})[_0x725e('0x23')](respondWithResult(_0xe8e4bf,null))[_0x725e('0x2d')](handleError(_0xe8e4bf,null));};exports[_0x725e('0xda')]=function(_0x360a9f,_0x1c506e,_0xa13af2){var _0x171817;var _0x3f724b;var _0x8e55b2;var _0x46ef6f=!_['isNil'](_0x360a9f[_0x725e('0x60')]['id'])?_0x360a9f[_0x725e('0x60')]['id']:!_[_0x725e('0x6e')](_0x360a9f['user']['id'])?_0x360a9f[_0x725e('0x3a')]['id']:null;return db['User']['find']({'where':{'id':_0x46ef6f,'role':{'$or':['admin',_0x725e('0x3a'),_0x725e('0x3b')]}},'attributes':['id','name','phone',_0x725e('0xdb'),_0x725e('0x40'),_0x725e('0x72'),'loginInPause']})[_0x725e('0x23')](function(_0xbbb5cd){if(_0xbbb5cd){if(_0xbbb5cd['role']===_0x725e('0x3b')){_0x171817=_0xbbb5cd;if(_0x360a9f[_0x725e('0x66')][_0x725e('0x9b')]){_0x8e55b2=util[_0x725e('0x70')](_0x725e('0xdc'),_0x171817[_0x360a9f['body'][_0x725e('0x9b')]]);}else if(_0x360a9f[_0x725e('0x66')][_0x725e('0xdd')]){_0x8e55b2=util[_0x725e('0x70')](_0x725e('0xaa'),_0x360a9f['body'][_0x725e('0xdd')]);}else{_0x8e55b2=util[_0x725e('0x70')](_0x725e('0xaa'),_0x171817[_0x725e('0x46')]);}socket['to'](util[_0x725e('0x70')](_0x725e('0xde'),_0x171817['name']))['emit'](_0x725e('0xdf'),{'ip':_0x360a9f['headers'][_0x725e('0xe0')]||_0x360a9f[_0x725e('0xe1')]['remoteAddress']||_0x360a9f[_0x725e('0xe2')][_0x725e('0xe3')]||_0x360a9f[_0x725e('0xe1')][_0x725e('0xe2')][_0x725e('0xe3')]});return db[_0x725e('0xab')][_0x725e('0x43')]({'where':{'membername':_0x171817[_0x725e('0x46')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x725e('0x21'))](_0x725e('0xe4'));}})[_0x725e('0x23')](function(){if(_0x171817){return _0x171817[_0x725e('0xe5')]({'raw':!![]});}})[_0x725e('0x23')](function(_0xebb054){if(_0x171817){var _0x221e95=[];if(_0xebb054){_0x3f724b=_0xebb054;if(_0x3f724b[_0x725e('0x52')]){for(var _0x1c1a18=0x0;_0x1c1a18<_0x3f724b['length'];_0x1c1a18++){_0x221e95[_0x725e('0xa9')]({'membername':_0x171817[_0x725e('0x46')],'UserId':_0x171817['id'],'queue_name':_0x3f724b[_0x1c1a18][_0x725e('0x46')],'VoiceQueueId':_0x3f724b[_0x1c1a18]['id'],'interface':_0x8e55b2,'paused':_0x171817[_0x725e('0x9a')]||![],'penalty':_0x3f724b[_0x1c1a18][_0x725e('0xe6')]||0x0});}return BPromise[_0x725e('0xe7')](_0x221e95,function(_0x3c965c){return db[_0x725e('0xab')][_0x725e('0xe8')](_0x3c965c);});}}}})[_0x725e('0x23')](function(){if(_0x171817){return db[_0x725e('0xe9')][_0x725e('0x5e')]({'where':{'membername':_0x171817['name'],'exitAt':null}});}})[_0x725e('0x23')](function(_0xa84766){if(_0x171817){var _0x575766=[];_0xa84766[_0x725e('0xea')](function(_0x32d477){_0x575766['push'](_0x32d477[_0x725e('0x38')]({'exitAt':moment()[_0x725e('0x70')](_0x725e('0xeb'))}));});return BPromise[_0x725e('0xec')](_0x575766);}})[_0x725e('0x23')](function(){if(_0x171817){var _0x834ed8=[];var _0x37cd5f=[];var _0xe33cf1=utils[_0x725e('0xed')]();var _0x1c935e={'membername':_0x171817['name'],'interface':_0x8e55b2,'enterAt':moment()[_0x725e('0x70')](_0x725e('0xeb')),'role':_0x171817[_0x725e('0x40')],'internal':_0x171817[_0x725e('0x72')]};_0xe33cf1[_0x725e('0xea')](function(_0x3bd6e5){_0x834ed8[_0x725e('0xa9')](_[_0x725e('0x57')]({'channel':_0x3bd6e5,'type':_0x725e('0xee'),'data1':_0x360a9f['body'][_0x725e('0xef')],'data2':_0x8e55b2},_0x1c935e));if(_0x171817['loginInPause']){_0x37cd5f['push'](_[_0x725e('0x57')]({'channel':_0x3bd6e5,'type':_0x725e('0xf0'),'data1':'LOGININPAUSE'},_0x1c935e));}});return db[_0x725e('0xe9')][_0x725e('0x65')](_0x834ed8[_0x725e('0xf1')](_0x37cd5f),{'individualHooks':!![]});}})[_0x725e('0x23')](function(){if(_0x171817){return _0x171817[_0x725e('0x38')]({'online':!![],'lastLoginAt':moment()['format'](_0x725e('0xeb')),'voicePause':_0x171817[_0x725e('0x9a')]||![],'mailPause':_0x171817[_0x725e('0x9a')]||![],'chatPause':_0x171817['loginInPause']||![],'faxPause':_0x171817['loginInPause']||![],'smsPause':_0x171817[_0x725e('0x9a')]||![],'openchannelPause':_0x171817[_0x725e('0x9a')]||![],'whatsappPause':_0x171817[_0x725e('0x9a')]||![],'pauseType':_0x171817['loginInPause']?_0x725e('0xf2'):null,'interface':_0x8e55b2,'lastPauseAt':moment()[_0x725e('0x70')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x725e('0x23')](function(_0x406839){if(_0x360a9f[_0x725e('0xf3')]){return _0xa13af2();}else{return BPromise[_0x725e('0xf4')](_0x406839)[_0x725e('0x23')](respondWithResult(_0x1c506e,null));}})[_0x725e('0x2d')](handleError(_0x1c506e,null));};exports['logout']=function(_0x16db38,_0x19bf53,_0x228143){var _0x1f93f8;return db[_0x725e('0x49')]['find']({'where':{'id':_0x16db38[_0x725e('0x60')]['id'],'role':_0x725e('0x3b')},'attributes':['id','name',_0x725e('0x40')]})[_0x725e('0x23')](handleEntityNotFound(_0x19bf53,null))[_0x725e('0x23')](function(_0xdf433){if(_0xdf433){_0x1f93f8=_0xdf433;return db[_0x725e('0xab')]['destroy']({'where':{'membername':_0x1f93f8[_0x725e('0x46')]},'individualHooks':!![]});}})[_0x725e('0x23')](function(){return db[_0x725e('0xe9')][_0x725e('0x5e')]({'where':{'membername':_0x1f93f8[_0x725e('0x46')],'exitAt':null}});})[_0x725e('0x23')](function(_0x34e9d8){var _0x18f997=[];_0x34e9d8['forEach'](function(_0x1c6e0f){_0x18f997['push'](_0x1c6e0f[_0x725e('0x38')]({'exitAt':moment()[_0x725e('0x70')](_0x725e('0xeb'))}));});return BPromise[_0x725e('0xec')](_0x18f997);})[_0x725e('0x23')](function(){return _0x1f93f8[_0x725e('0x38')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x725e('0x23')](respondWithResult(_0x19bf53,null))['catch'](handleError(_0x19bf53,null));};exports[_0x725e('0xf5')]=function(_0x5480fb,_0x47b704,_0x44b05a){var _0x59d28d;return db[_0x725e('0xab')][_0x725e('0x38')]({'paused':0x1},{'where':{'UserId':_0x5480fb[_0x725e('0x60')]['id']},'individualHooks':!![]})[_0x725e('0x23')](function(){return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x5480fb[_0x725e('0x60')]['id'],'role':'agent'},'attributes':['id','name',_0x725e('0x40'),_0x725e('0x72'),_0x725e('0x9b')]});})[_0x725e('0x23')](handleEntityNotFound(_0x47b704,null))['then'](function(_0x54d323){if(_0x54d323){_0x59d28d=_0x54d323;return respondWithRpcPromise(_0x725e('0xf6'),_0x725e('0xf5'),{'id':_0x59d28d['id'],'name':_0x59d28d[_0x725e('0x46')],'pause':!![]});}})[_0x725e('0x23')](function(){if(_0x59d28d){return db[_0x725e('0xe9')][_0x725e('0x5e')]({'where':{'membername':_0x59d28d['name'],'type':'PAUSE','exitAt':null}});}})[_0x725e('0x23')](function(_0x5a7ecd){if(_0x5a7ecd[_0x725e('0x52')]){var _0x42c0b3=moment()[_0x725e('0x70')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x146964=0x0,_0x3fc546=_0x5a7ecd[_0x725e('0x52')];_0x146964<_0x3fc546;_0x146964++){_0x5a7ecd[_0x146964][_0x725e('0xf7')]({'exitAt':_0x42c0b3});}}})[_0x725e('0x23')](function(){var _0x1c3554=[];var _0x15a306=utils['getChannels']();_0x15a306[_0x725e('0xea')](function(_0x23f9f8){_0x1c3554[_0x725e('0xa9')]({'channel':_0x23f9f8,'membername':_0x59d28d[_0x725e('0x46')],'interface':_[_0x725e('0x6e')](_0x59d28d['interface'])?util['format'](_0x725e('0xaa'),_0x59d28d[_0x725e('0x46')]):_0x59d28d[_0x725e('0x9b')],'type':'PAUSE','enterAt':moment()[_0x725e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x5480fb[_0x725e('0x66')][_0x725e('0x58')]||_0x725e('0xf8'),'role':_0x59d28d['role'],'internal':_0x59d28d[_0x725e('0x72')]});});return db[_0x725e('0xe9')]['bulkCreate'](_0x1c3554,{'individualHooks':!![]});})[_0x725e('0x23')](function(){return _0x59d28d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5480fb['body'][_0x725e('0x58')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x725e('0x70')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x47b704,null))[_0x725e('0x2d')](handleError(_0x47b704,null));};exports[_0x725e('0xf9')]=function(_0x1cf1b2,_0x4a1c7d,_0xc83740){var _0x16280c;return db[_0x725e('0x49')][_0x725e('0x41')]({'where':{'id':_0x1cf1b2['params']['id']},'attributes':['id',_0x725e('0x46'),_0x725e('0x40'),_0x725e('0xfa'),_0x725e('0xfb'),_0x725e('0xfc'),_0x725e('0xfd'),_0x725e('0xfe'),_0x725e('0xff'),_0x725e('0x100'),_0x725e('0x101'),_0x725e('0x102')]})[_0x725e('0x23')](handleEntityNotFound(_0x4a1c7d,null))['then'](function(_0x5a589e){if(_0x5a589e){_0x16280c=_0x5a589e;if(_0x1cf1b2['body'][_0x725e('0xae')]&&!utils[_0x725e('0x9c')](_0x1cf1b2[_0x725e('0x66')][_0x725e('0xae')])){throw new db['Sequelize'][(_0x725e('0x21'))](_0x725e('0x9d'));}switch(_0x1cf1b2[_0x725e('0x66')][_0x725e('0xae')]){case _0x725e('0xa7'):return respondWithRpcPromise(_0x725e('0xf6'),'unpause',{'id':_0x16280c['id'],'name':_0x16280c[_0x725e('0x46')],'pause':![]})[_0x725e('0x23')](function(){return db[_0x725e('0xab')][_0x725e('0x38')]({'paused':0x0},{'where':{'UserId':_0x16280c['id']},'individualHooks':!![]});})[_0x725e('0x23')](function(){return db[_0x725e('0xe9')][_0x725e('0x41')]({'where':{'channel':_0x1cf1b2[_0x725e('0x66')][_0x725e('0xae')],'membername':_0x16280c['name'],'type':_0x725e('0xf0'),'exitAt':null}});})[_0x725e('0x23')](function(_0x33e8cc){if(_0x33e8cc){return _0x33e8cc[_0x725e('0x38')]({'exitAt':moment()[_0x725e('0x70')](_0x725e('0xeb')),'data2':_0x725e('0x103')},{'individualHooks':!![]});}return null;})[_0x725e('0x23')](function(){return _0x16280c['update']({'voicePause':![]});});case _0x725e('0x104'):case'chat':case'fax':case _0x725e('0x105'):case'whatsapp':case _0x725e('0x106'):return db[_0x725e('0xe9')][_0x725e('0x41')]({'where':{'channel':_0x1cf1b2['body'][_0x725e('0xae')],'membername':_0x16280c['name'],'type':'PAUSE','exitAt':null}})[_0x725e('0x23')](function(_0x9ec2f3){if(_0x9ec2f3){return _0x9ec2f3[_0x725e('0x38')]({'exitAt':moment()[_0x725e('0x70')](_0x725e('0xeb')),'data2':_0x725e('0x103')},{'individualHooks':!![]});}return null;})[_0x725e('0x23')](function(){var _0x12f9d7={};_[_0x725e('0x34')](_0x12f9d7,util['format'](_0x725e('0x107'),_0x1cf1b2[_0x725e('0x66')][_0x725e('0xae')],_0x725e('0x108')),![]);return _0x16280c['update'](_0x12f9d7);});default:return respondWithRpcPromise(_0x725e('0xf6'),_0x725e('0xf9'),{'id':_0x16280c['id'],'name':_0x16280c[_0x725e('0x46')],'pause':![]})[_0x725e('0x23')](function(){return db[_0x725e('0xab')][_0x725e('0x38')]({'paused':0x0},{'where':{'UserId':_0x16280c['id']}});})[_0x725e('0x23')](function(){return db['MemberReport'][_0x725e('0x5e')]({'where':{'membername':_0x16280c[_0x725e('0x46')],'type':_0x725e('0xf0'),'exitAt':null}});})[_0x725e('0x23')](function(_0x68f046){var _0x2b2803=[];_0x68f046[_0x725e('0xea')](function(_0x444989){_0x2b2803[_0x725e('0xa9')](_0x444989[_0x725e('0x38')]({'exitAt':moment()[_0x725e('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x725e('0x103')}));});return BPromise[_0x725e('0xec')](_0x2b2803);})[_0x725e('0x23')](function(){return _0x16280c[_0x725e('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x725e('0x23')](respondWithResult(_0x4a1c7d,null))['catch'](handleError(_0x4a1c7d,null));};exports[_0x725e('0x109')]=function(_0x33c36f,_0x47bdb6,_0x23feec){var _0x56d8f7={};var _0x24e45d={};var _0xe4cdb;var _0x331693;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x33c36f[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x47bdb6,null))[_0x725e('0x23')](function(_0x291ab9){if(_0x291ab9){_0xe4cdb=_0x291ab9;_0x24e45d[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0x10a')][_0x725e('0xb9')]);_0x24e45d['query']=_[_0x725e('0x62')](_0x33c36f[_0x725e('0x4c')]);_0x24e45d[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x24e45d[_0x725e('0x4f')],_0x24e45d[_0x725e('0x4c')]);_0x56d8f7[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x24e45d[_0x725e('0x4f')],qs['fields'](_0x33c36f[_0x725e('0x4c')][_0x725e('0x51')]));_0x56d8f7['attributes']=_0x56d8f7[_0x725e('0x50')]['length']?_0x56d8f7[_0x725e('0x50')]:_0x24e45d[_0x725e('0x4f')];_0x56d8f7['order']=qs[_0x725e('0x53')](_0x33c36f[_0x725e('0x4c')][_0x725e('0x53')]);_0x56d8f7[_0x725e('0x54')]=qs[_0x725e('0x4d')](_['pick'](_0x33c36f[_0x725e('0x4c')],_0x24e45d['filters']));if(_0x33c36f['query'][_0x725e('0x56')]){_0x56d8f7['where']=_['merge'](_0x56d8f7[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x56d8f7[_0x725e('0x50')],function(_0x2eac92){var _0x38ed77={};_0x38ed77[_0x2eac92]={'$like':'%'+_0x33c36f[_0x725e('0x4c')]['filter']+'%'};return _0x38ed77;})});}_0x56d8f7=_[_0x725e('0x57')]({},_0x56d8f7,_0x33c36f['options']);return _0xe4cdb[_0x725e('0x109')](_0x56d8f7);}})[_0x725e('0x23')](function(_0x537a30){if(_0x537a30){_0x331693=_0x537a30[_0x725e('0x52')];if(!_0x33c36f[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x56d8f7[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x33c36f['query']['limit']);_0x56d8f7[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x33c36f[_0x725e('0x4c')][_0x725e('0x31')]);}return _0xe4cdb[_0x725e('0x109')](_0x56d8f7);}})[_0x725e('0x23')](function(_0x160fc4){if(_0x160fc4){return _0x160fc4?{'count':_0x331693,'rows':_0x160fc4}:null;}})[_0x725e('0x23')](respondWithResult(_0x47bdb6,null))['catch'](handleError(_0x47bdb6,null));};exports[_0x725e('0x10b')]=function(_0x3743a3,_0x322541){return db[_0x725e('0x49')]['find']({'where':{'id':_0x3743a3[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x322541,null))['then'](function(_0x18e4df){if(_0x18e4df){var _0xd4b721=_0x18e4df[_0x725e('0x39')]({'plain':!![]});return _0x18e4df[_0x725e('0x10b')](_0x3743a3[_0x725e('0x66')][_0x725e('0x69')],_['omit'](_0x3743a3[_0x725e('0x66')],[_0x725e('0x69'),'id'])||{})[_0x725e('0x23')](function(){for(var _0x4425b6=0x0;_0x4425b6<_0x3743a3[_0x725e('0x66')][_0x725e('0x69')][_0x725e('0x52')];_0x4425b6++){var _0xea6f6a=[];db[_0x725e('0x10a')][_0x725e('0x8f')]({'where':{'id':_0x3743a3['body'][_0x725e('0x69')][_0x4425b6]}})[_0x725e('0x23')](function(_0x1712e3){_0xea6f6a['push'](_0x1712e3[_0x725e('0xe5')]()[_0x725e('0x23')](function(_0x166551){for(var _0x5584cc=0x0;_0x5584cc<_0x166551[_0x725e('0x52')];_0x5584cc++){_0x166551[_0x5584cc]['setDataValue'](_0x725e('0xae'),_0x725e('0x10c'));}return _0x166551;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3[_0x725e('0x10d')]()[_0x725e('0x23')](function(_0x56c47e){for(var _0x23b0c8=0x0;_0x23b0c8<_0x56c47e[_0x725e('0x52')];_0x23b0c8++){_0x56c47e[_0x23b0c8][_0x725e('0x10e')](_0x725e('0xae'),'Chat');}return _0x56c47e;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3['getMailQueues']()[_0x725e('0x23')](function(_0x1ffc92){for(var _0x14918a=0x0;_0x14918a<_0x1ffc92[_0x725e('0x52')];_0x14918a++){_0x1ffc92[_0x14918a][_0x725e('0x10e')](_0x725e('0xae'),_0x725e('0x10f'));}return _0x1ffc92;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3[_0x725e('0x110')]()[_0x725e('0x23')](function(_0x4f8bf0){for(var _0x2aa5fa=0x0;_0x2aa5fa<_0x4f8bf0[_0x725e('0x52')];_0x2aa5fa++){_0x4f8bf0[_0x2aa5fa][_0x725e('0x10e')](_0x725e('0xae'),_0x725e('0x111'));}return _0x4f8bf0;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3[_0x725e('0x112')]()['then'](function(_0x1bd897){for(var _0x4fd86b=0x0;_0x4fd86b<_0x1bd897['length'];_0x4fd86b++){_0x1bd897[_0x4fd86b]['setDataValue'](_0x725e('0xae'),'Whatsapp');}return _0x1bd897;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3[_0x725e('0x113')]()['then'](function(_0x2d88f3){for(var _0x5568a6=0x0;_0x5568a6<_0x2d88f3[_0x725e('0x52')];_0x5568a6++){_0x2d88f3[_0x5568a6][_0x725e('0x10e')](_0x725e('0xae'),_0x725e('0x114'));}return _0x2d88f3;}));_0xea6f6a[_0x725e('0xa9')](_0x1712e3[_0x725e('0x115')]()['then'](function(_0x13fd15){for(var _0x15419d=0x0;_0x15419d<_0x13fd15[_0x725e('0x52')];_0x15419d++){_0x13fd15[_0x15419d][_0x725e('0x10e')](_0x725e('0xae'),_0x725e('0x116'));}return _0x13fd15;}));return BPromise[_0x725e('0xec')](_0xea6f6a);})[_0x725e('0x23')](function(_0x29bbf7){var _0x5ceebf=_['flatten'](_0x29bbf7);_0xea6f6a=[];return db[_0x725e('0x59')][_0x725e('0x117')](function(_0xb63b5a){for(var _0x2541f1=0x0;_0x2541f1<_0x5ceebf[_0x725e('0x52')];_0x2541f1++){_0xea6f6a['push'](_0x5ceebf[_0x2541f1][_0x725e('0x118')](_0xd4b721['id']),{'transaction':_0xb63b5a});}return BPromise[_0x725e('0xec')](_0xea6f6a)['then'](function(){if(_0xd4b721[_0x725e('0x99')]){return BPromise[_0x725e('0xe7')](_[_0x725e('0x56')](_0x5ceebf,function(_0x4b3367){return _0x4b3367['getDataValue'](_0x725e('0xae'))===_0x725e('0x10c');}),function(_0x567846){return db['UserVoiceQueueRt'][_0x725e('0xe8')]({'membername':_0xd4b721[_0x725e('0x46')],'UserId':_0xd4b721['id'],'queue_name':_0x567846[_0x725e('0x46')],'VoiceQueueId':_0x567846['id'],'interface':_[_0x725e('0x6e')](_0xd4b721[_0x725e('0x9b')])?util[_0x725e('0x70')](_0x725e('0xaa'),_0xd4b721[_0x725e('0x46')]):_0xd4b721[_0x725e('0x9b')],'paused':_0xd4b721[_0x725e('0xfa')]||![],'penalty':_0xd4b721[_0x725e('0xa2')]},{'transaction':_0xb63b5a});});}else{return;}})[_0x725e('0x23')](function(){for(var _0x1809d5=0x0;_0x1809d5<_0x5ceebf[_0x725e('0x52')];_0x1809d5++){var _0x17f305=_0x5ceebf[_0x1809d5][_0x725e('0x119')](_0x725e('0xae'));var _0x4c3547=_0x17f305+_0x725e('0xa4');socket[_0x725e('0xa5')](_0x725e('0x3a')+_0x17f305+_0x725e('0xa6'),{'UserId':_0xd4b721['id'],['queueField']:_0x5ceebf[_0x1809d5]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x322541,null))['catch'](handleError(_0x322541,null));};exports[_0x725e('0x11a')]=function(_0x2c28b4,_0x425b79){return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x2c28b4[_0x725e('0x60')]['id']}})[_0x725e('0x23')](handleEntityNotFound(_0x425b79,null))[_0x725e('0x23')](function(_0x45bed3){if(_0x45bed3){var _0x904f=_0x45bed3['get']({'plain':!![]});var _0x5d451=_0x2c28b4[_0x725e('0x4c')][_0x725e('0x69')];return _0x45bed3[_0x725e('0x11a')](_0x5d451)[_0x725e('0x23')](function(){for(var _0x37aa60=0x0;_0x37aa60<_0x5d451[_0x725e('0x52')];_0x37aa60++){var _0x368d1a=[];db[_0x725e('0x10a')][_0x725e('0x8f')]({'where':{'id':_0x5d451[_0x37aa60]}})[_0x725e('0x23')](function(_0x3fa010){_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0xe5')]()[_0x725e('0x23')](function(_0x2c19f0){for(var _0x3fe802=0x0;_0x3fe802<_0x2c19f0[_0x725e('0x52')];_0x3fe802++){_0x2c19f0[_0x3fe802][_0x725e('0x10e')](_0x725e('0xae'),_0x725e('0x10c'));}return _0x2c19f0;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x10d')]()['then'](function(_0x1a93e1){for(var _0x2e588e=0x0;_0x2e588e<_0x1a93e1[_0x725e('0x52')];_0x2e588e++){_0x1a93e1[_0x2e588e][_0x725e('0x10e')]('channel','Chat');}return _0x1a93e1;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x11b')]()[_0x725e('0x23')](function(_0x31d7e2){for(var _0x302a0f=0x0;_0x302a0f<_0x31d7e2[_0x725e('0x52')];_0x302a0f++){_0x31d7e2[_0x302a0f]['setDataValue']('channel','Mail');}return _0x31d7e2;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x110')]()[_0x725e('0x23')](function(_0x327d5f){for(var _0x5ea314=0x0;_0x5ea314<_0x327d5f['length'];_0x5ea314++){_0x327d5f[_0x5ea314]['setDataValue'](_0x725e('0xae'),'Sms');}return _0x327d5f;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x112')]()['then'](function(_0x2d8a90){for(var _0x1a5c83=0x0;_0x1a5c83<_0x2d8a90['length'];_0x1a5c83++){_0x2d8a90[_0x1a5c83]['setDataValue'](_0x725e('0xae'),_0x725e('0x11c'));}return _0x2d8a90;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x113')]()[_0x725e('0x23')](function(_0x4e1bd0){for(var _0xeba618=0x0;_0xeba618<_0x4e1bd0[_0x725e('0x52')];_0xeba618++){_0x4e1bd0[_0xeba618][_0x725e('0x10e')]('channel',_0x725e('0x114'));}return _0x4e1bd0;}));_0x368d1a[_0x725e('0xa9')](_0x3fa010[_0x725e('0x115')]()['then'](function(_0x6a2b6c){for(var _0x29b753=0x0;_0x29b753<_0x6a2b6c[_0x725e('0x52')];_0x29b753++){_0x6a2b6c[_0x29b753][_0x725e('0x10e')](_0x725e('0xae'),'Openchannel');}return _0x6a2b6c;}));return BPromise[_0x725e('0xec')](_0x368d1a);})[_0x725e('0x23')](function(_0x4790f6){var _0x5e3cd3=_[_0x725e('0x11d')](_0x4790f6);_0x368d1a=[];return db[_0x725e('0x59')]['transaction'](function(_0x42b18f){for(var _0x2fc188=0x0;_0x2fc188<_0x5e3cd3[_0x725e('0x52')];_0x2fc188++){_0x368d1a[_0x725e('0xa9')](_0x5e3cd3[_0x2fc188][_0x725e('0x11e')](_0x904f['id']),{'transaction':_0x42b18f});}return BPromise[_0x725e('0xec')](_0x368d1a)[_0x725e('0x23')](function(){if(_0x904f[_0x725e('0x99')]){return BPromise[_0x725e('0xe7')](_[_0x725e('0x56')](_0x5e3cd3,function(_0x40cd39){return _0x40cd39[_0x725e('0x119')](_0x725e('0xae'))===_0x725e('0x10c');}),function(_0x9a40bc){return db[_0x725e('0xab')][_0x725e('0x43')]({'where':{'VoiceQueueId':_0x9a40bc['id'],'UserId':_0x904f['id']},'transaction':_0x42b18f});});}else{return;}})['then'](function(){for(var _0x57596e=0x0;_0x57596e<_0x5e3cd3[_0x725e('0x52')];_0x57596e++){var _0xf86227=_0x5e3cd3[_0x57596e][_0x725e('0x119')]('channel');var _0x265081=_0xf86227+_0x725e('0xa4');socket[_0x725e('0xa5')](_0x725e('0x3a')+_0xf86227+_0x725e('0xaf'),{'UserId':_0x904f['id'],['queueField']:_0x5e3cd3[_0x57596e]['id']});}});});});}});}})[_0x725e('0x23')](respondWithStatusCode(_0x425b79,null))[_0x725e('0x2d')](handleError(_0x425b79,null));};exports[_0x725e('0x11f')]=function(_0x19572c,_0x216a56,_0x570fdc){var _0x5fb2dd={};var _0x4414dd={};var _0x26ab76;var _0x3017ca;return db['User'][_0x725e('0x8f')]({'where':{'id':_0x19572c[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0x216a56,null))[_0x725e('0x23')](function(_0x5f465e){if(_0x5f465e){_0x26ab76=_0x5f465e;_0x4414dd[_0x725e('0x4f')]=_[_0x725e('0x62')](db[_0x725e('0xbd')][_0x725e('0xb9')]);_0x4414dd[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x19572c['query']);_0x4414dd['filters']=_[_0x725e('0x4e')](_0x4414dd[_0x725e('0x4f')],_0x4414dd[_0x725e('0x4c')]);_0x5fb2dd['attributes']=_[_0x725e('0x4e')](_0x4414dd['model'],qs[_0x725e('0x51')](_0x19572c['query'][_0x725e('0x51')]));_0x5fb2dd[_0x725e('0x50')]=_0x5fb2dd['attributes'][_0x725e('0x52')]?_0x5fb2dd['attributes']:_0x4414dd[_0x725e('0x4f')];_0x5fb2dd['order']=qs[_0x725e('0x53')](_0x19572c[_0x725e('0x4c')]['sort']);_0x5fb2dd[_0x725e('0x54')]=qs[_0x725e('0x4d')](_[_0x725e('0x55')](_0x19572c[_0x725e('0x4c')],_0x4414dd[_0x725e('0x4d')]));if(_0x19572c[_0x725e('0x4c')][_0x725e('0x56')]){_0x5fb2dd[_0x725e('0x54')]=_[_0x725e('0x57')](_0x5fb2dd[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x5fb2dd[_0x725e('0x50')],function(_0x3d71f2){var _0x3e1908={};_0x3e1908[_0x3d71f2]={'$like':'%'+_0x19572c[_0x725e('0x4c')][_0x725e('0x56')]+'%'};return _0x3e1908;})});}_0x5fb2dd=_[_0x725e('0x57')]({},_0x5fb2dd,_0x19572c[_0x725e('0x5c')]);return _0x26ab76['getLists'](_0x5fb2dd);}})[_0x725e('0x23')](function(_0x4be9fb){if(_0x4be9fb){_0x3017ca=_0x4be9fb['length'];if(!_0x19572c[_0x725e('0x4c')][_0x725e('0xbc')](_0x725e('0xc5'))){_0x5fb2dd[_0x725e('0x32')]=qs[_0x725e('0x32')](_0x19572c[_0x725e('0x4c')]['limit']);_0x5fb2dd[_0x725e('0x31')]=qs[_0x725e('0x31')](_0x19572c[_0x725e('0x4c')][_0x725e('0x31')]);}return _0x26ab76[_0x725e('0x11f')](_0x5fb2dd);}})[_0x725e('0x23')](function(_0x4e37fd){if(_0x4e37fd){return _0x4e37fd?{'count':_0x3017ca,'rows':_0x4e37fd}:null;}})[_0x725e('0x23')](respondWithResult(_0x216a56,null))['catch'](handleError(_0x216a56,null));};exports['getAgents']=function(_0x3b59a4,_0x448596,_0x476151){var _0x4bd6d9={};var _0x14509c={};var _0x35bf4f;var _0x321b29;return db[_0x725e('0x49')][_0x725e('0x8f')]({'where':{'id':_0x3b59a4[_0x725e('0x60')]['id']}})['then'](handleEntityNotFound(_0x448596,null))['then'](function(_0x3c954f){if(_0x3c954f){_0x35bf4f=_0x3c954f;_0x14509c[_0x725e('0x4f')]=_[_0x725e('0x62')](db['User'][_0x725e('0xb9')]);_0x14509c[_0x725e('0x4c')]=_[_0x725e('0x62')](_0x3b59a4[_0x725e('0x4c')]);_0x14509c[_0x725e('0x4d')]=_[_0x725e('0x4e')](_0x14509c[_0x725e('0x4f')],_0x14509c[_0x725e('0x4c')]);_0x4bd6d9[_0x725e('0x50')]=_[_0x725e('0x4e')](_0x14509c['model'],qs[_0x725e('0x51')](_0x3b59a4[_0x725e('0x4c')][_0x725e('0x51')]));_0x4bd6d9[_0x725e('0x50')]=_0x4bd6d9[_0x725e('0x50')][_0x725e('0x52')]?_0x4bd6d9['attributes']:_0x14509c[_0x725e('0x4f')];_0x4bd6d9[_0x725e('0xba')]=qs[_0x725e('0x53')](_0x3b59a4[_0x725e('0x4c')][_0x725e('0x53')]);_0x4bd6d9['where']=qs[_0x725e('0x4d')](_['pick'](_0x3b59a4['query'],_0x14509c[_0x725e('0x4d')]));if(_0x3b59a4[_0x725e('0x4c')][_0x725e('0x56')]){_0x4bd6d9[_0x725e('0x54')]=_[_0x725e('0x57')](_0x4bd6d9[_0x725e('0x54')],{'$or':_[_0x725e('0x3e')](_0x4bd6d9[_0x725e('0x50')],function(_0x4f19b2){var _0x227cf4={};_0x227cf4[_0x4f19b2]={'$like':'%'+_0x3b59a4['query']['filter']+'%'};return _0x227cf4;})});}_0x4bd6d9[_0x725e('0x4f')]=db['User'];_0x4bd6d9['as']=_0x725e('0x8a');_0x4bd6d9=_[_0x725e('0x57')]({},_0x4bd6d9,_0x3b59a4[_0x725e('0x5c')]);return _0x35bf4f['getVoiceQueues']({'include':[_0x4bd6d9]});}})[_0x725e('0x23')](function(_0x1eb27d){if(_0x1eb27d){var _0x5afa1b={},_0xa4a2e1=[],_0x1d596e=0x0;for(var _0x2cf84e=0x0;_0x2cf84e<_0x1eb27d[_0x725e('0x52')];_0x2cf84e+=0x1){for(var _0xf817d3=0x0,_0x555523;_0xf817d3<_0x1eb27d[_0x2cf84e]['Agents'][_0x725e('0x52')];_0xf817d3+=0x1){_0x555523=_0x1eb27d[_0x2cf84e][_0x725e('0x8a')][_0xf817d3]['get']({'plain':!![]});_0x5afa1b[_0x555523['id']]=_0x555523;}}_0x5afa1b=_['values'](_0x5afa1b);for(var _0x14de96=qs[_0x725e('0x31')](_0x3b59a4['query'][_0x725e('0x31')]);_0x14de96<_0x5afa1b[_0x725e('0x52')]&&_0xa4a2e1['length']=_0x25440a[_0xf4c2('0x54')]){throw new Error(_0xf4c2('0x55'));}})['then'](function(){if(_0x5277a4){return db[_0xf4c2('0x41')][_0xf4c2('0x4d')]({'where':{'membername':_0x5277a4[_0xf4c2('0x2b')]},'individualHooks':!![]});}})[_0xf4c2('0x13')](function(){if(_0x5277a4){return _0x5277a4['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x36c9be){if(_0x5277a4){if(_0x36c9be){var _0x2f8a25=[];_0x48eda8=_0x36c9be;if(_0x48eda8[_0xf4c2('0x31')]){for(var _0x46b50a=0x0;_0x46b50a<_0x48eda8[_0xf4c2('0x31')];_0x46b50a++){_0x2f8a25[_0xf4c2('0x4a')](db[_0xf4c2('0x41')][_0xf4c2('0x56')]({'membername':_0x5277a4[_0xf4c2('0x2b')],'UserId':_0x5277a4['id'],'queue_name':_0x48eda8[_0x46b50a][_0xf4c2('0x2b')],'VoiceQueueId':_0x48eda8[_0x46b50a]['id'],'interface':_0x426ae1,'paused':_0x5277a4[_0xf4c2('0x57')]||![],'penalty':_0x48eda8[_0x46b50a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xf4c2('0x4b')](_0x2f8a25);}}}})[_0xf4c2('0x13')](function(){if(_0x5277a4){return db[_0xf4c2('0x2f')][_0xf4c2('0x1d')]({'where':{'membername':_0x5277a4[_0xf4c2('0x2b')],'exitAt':null}});}})[_0xf4c2('0x13')](function(_0x2c0f3d){if(_0x5277a4){if(_0x2c0f3d&&_0x2c0f3d[_0xf4c2('0x31')]){var _0x996a99=[];_0x2c0f3d['forEach'](function(_0x5b0246){_0x996a99[_0xf4c2('0x4a')](_0x5b0246['update']({'exitAt':moment()[_0xf4c2('0x32')](_0xf4c2('0x33'))}));});return BPromise['all'](_0x996a99);}}})[_0xf4c2('0x13')](function(_0x575dba){if(_0x5277a4){var _0x3fb926=[];var _0x1726ce=[];var _0x21017d=utils[_0xf4c2('0x35')]();var _0x23ba77={'membername':_0x5277a4['name'],'interface':_0x426ae1,'enterAt':moment()[_0xf4c2('0x32')](_0xf4c2('0x33')),'role':_0x5277a4[_0xf4c2('0x2c')],'internal':_0x5277a4[_0xf4c2('0x38')]};_0x21017d[_0xf4c2('0x49')](function(_0x16777d){_0x3fb926[_0xf4c2('0x4a')](_['merge']({'channel':_0x16777d,'type':'LOGIN','data1':'callysquare','data2':_0x426ae1},_0x23ba77));if(_0x5277a4[_0xf4c2('0x57')]){_0x1726ce[_0xf4c2('0x4a')](_[_0xf4c2('0x58')]({'channel':_0x16777d,'type':_0xf4c2('0x30'),'data1':_0xf4c2('0x59')},_0x23ba77));}});return db[_0xf4c2('0x2f')]['bulkCreate'](_0x3fb926['concat'](_0x1726ce),{'individualHooks':!![]});}})[_0xf4c2('0x13')](function(){if(_0x5277a4){return _0x5277a4[_0xf4c2('0x2e')]({'online':!![],'lastLoginAt':moment()[_0xf4c2('0x32')](_0xf4c2('0x33')),'voicePause':_0x5277a4['loginInPause']||![],'mailPause':_0x5277a4['loginInPause']||![],'chatPause':_0x5277a4[_0xf4c2('0x57')]||![],'faxPause':_0x5277a4[_0xf4c2('0x57')]||![],'smsPause':_0x5277a4[_0xf4c2('0x57')]||![],'openchannelPause':_0x5277a4[_0xf4c2('0x57')]||![],'pauseType':_0x5277a4[_0xf4c2('0x57')]?_0xf4c2('0x59'):null,'lastPauseAt':moment()[_0xf4c2('0x32')](_0xf4c2('0x33')),'interface':_0x426ae1});}})['then'](function(_0x2d0322){_0x464649(_0x2d0322);})['catch'](function(_0x95252c){_0x133062(_0x20ce05[_0xf4c2('0x19')](0x1f4,_0x95252c['message']));});});}; \ No newline at end of file +var _0x381d=['length','updateAttributes','getChannels','forEach','push','isNil','format','YYYY-MM-DD\x20HH:mm:ss','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','system','mail','chat','openchannel','set','%s%s','Pause','destroy','findAll','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','merge','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./user.socket','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetUser','options','raw','where','limit','include','map','model','attributes','ShowUser','User','find','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x381d,0x1ec));var _0xd381=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x381d[_0x363ef8];return _0x148822;};'use strict';var _=require(_0xd381('0x0'));var util=require(_0xd381('0x1'));var moment=require(_0xd381('0x2'));var BPromise=require(_0xd381('0x3'));var rs=require(_0xd381('0x4'));var fs=require('fs');var Redis=require(_0xd381('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd381('0x6'));var logger=require(_0xd381('0x7'))(_0xd381('0x8'));var config=require(_0xd381('0x9'));var jayson=require(_0xd381('0xa'));var client=jayson[_0xd381('0xb')]['http']({'port':0x232a});config['redis']=_[_0xd381('0xc')](config[_0xd381('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd381('0xe'))['register'](socket);function respondWithRpcPromise(_0x553461,_0x1d9434,_0x19166d){return new BPromise(function(_0x4f3dd8,_0x5968b3){return client['request'](_0x553461,_0x19166d)[_0xd381('0xf')](function(_0x41d123){logger[_0xd381('0x10')](_0xd381('0x11'),_0x1d9434,'request\x20sent');logger[_0xd381('0x12')](_0xd381('0x13'),_0x1d9434,'request\x20sent',JSON[_0xd381('0x14')](_0x41d123));if(_0x41d123[_0xd381('0x15')]){if(_0x41d123[_0xd381('0x15')][_0xd381('0x16')]===0x1f4){logger[_0xd381('0x15')](_0xd381('0x11'),_0x1d9434,_0x41d123[_0xd381('0x15')][_0xd381('0x17')]);return _0x5968b3(_0x41d123[_0xd381('0x15')][_0xd381('0x17')]);}logger[_0xd381('0x15')](_0xd381('0x11'),_0x1d9434,_0x41d123[_0xd381('0x15')][_0xd381('0x17')]);return _0x4f3dd8(_0x41d123[_0xd381('0x15')]['message']);}else{logger[_0xd381('0x10')](_0xd381('0x11'),_0x1d9434,_0xd381('0x18'));_0x4f3dd8(_0x41d123[_0xd381('0x19')][_0xd381('0x17')]);}})[_0xd381('0x1a')](function(_0x56d605){logger['error']('User,\x20%s,\x20%s',_0x1d9434,_0x56d605);_0x5968b3(_0x56d605);});});}exports[_0xd381('0x1b')]=function(_0x3a70c4){var _0x20f3fe=this;return new Promise(function(_0x10345e,_0x43eb93){return db['User']['findAll']({'raw':_0x3a70c4['options']?_0x3a70c4[_0xd381('0x1c')][_0xd381('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a70c4[_0xd381('0x1c')]?_0x3a70c4[_0xd381('0x1c')][_0xd381('0x1e')]||null:null,'attributes':_0x3a70c4[_0xd381('0x1c')]?_0x3a70c4[_0xd381('0x1c')]['attributes']||null:null,'limit':_0x3a70c4[_0xd381('0x1c')]?_0x3a70c4[_0xd381('0x1c')][_0xd381('0x1f')]||null:null,'include':_0x3a70c4[_0xd381('0x1c')]?_0x3a70c4['options'][_0xd381('0x20')]?_[_0xd381('0x21')](_0x3a70c4[_0xd381('0x1c')]['include'],function(_0x5c4d41){return{'model':db[_0x5c4d41[_0xd381('0x22')]],'as':_0x5c4d41['as'],'attributes':_0x5c4d41['attributes'],'include':_0x5c4d41[_0xd381('0x20')]?_[_0xd381('0x21')](_0x5c4d41[_0xd381('0x20')],function(_0x332f9f){return{'model':db[_0x332f9f['model']],'as':_0x332f9f['as'],'attributes':_0x332f9f[_0xd381('0x23')],'include':_0x332f9f['include']?_[_0xd381('0x21')](_0x332f9f[_0xd381('0x20')],function(_0x422dcb){return{'model':db[_0x422dcb[_0xd381('0x22')]],'as':_0x422dcb['as'],'attributes':_0x422dcb[_0xd381('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd381('0xf')](function(_0x33725c){logger['info'](_0xd381('0x1b'),_0x3a70c4);logger['debug']('GetUser',_0x3a70c4,JSON[_0xd381('0x14')](_0x33725c));_0x10345e(_0x33725c);})[_0xd381('0x1a')](function(_0x5c7932){logger[_0xd381('0x15')](_0xd381('0x1b'),_0x5c7932[_0xd381('0x17')],_0x3a70c4);_0x43eb93(_0x20f3fe[_0xd381('0x15')](0x1f4,_0x5c7932[_0xd381('0x17')]));});});};exports[_0xd381('0x24')]=function(_0x5794b6){var _0x337c36=this;return new Promise(function(_0x35d6d0,_0x5f49cf){return db[_0xd381('0x25')][_0xd381('0x26')]({'raw':_0x5794b6[_0xd381('0x1c')]?_0x5794b6[_0xd381('0x1c')][_0xd381('0x1d')]===undefined?!![]:![]:!![],'where':_0x5794b6[_0xd381('0x1c')]?_0x5794b6[_0xd381('0x1c')][_0xd381('0x1e')]||null:null,'attributes':_0x5794b6['options']?_0x5794b6['options']['attributes']||null:null,'include':_0x5794b6[_0xd381('0x1c')]?_0x5794b6[_0xd381('0x1c')][_0xd381('0x20')]?_[_0xd381('0x21')](_0x5794b6[_0xd381('0x1c')][_0xd381('0x20')],function(_0x2407e4){return{'model':db[_0x2407e4[_0xd381('0x22')]],'as':_0x2407e4['as'],'attributes':_0x2407e4[_0xd381('0x23')],'include':_0x2407e4[_0xd381('0x20')]?_[_0xd381('0x21')](_0x2407e4[_0xd381('0x20')],function(_0x392abe){return{'model':db[_0x392abe[_0xd381('0x22')]],'as':_0x392abe['as'],'attributes':_0x392abe['attributes'],'include':_0x392abe['include']?_[_0xd381('0x21')](_0x392abe[_0xd381('0x20')],function(_0xc6e2b4){return{'model':db[_0xc6e2b4[_0xd381('0x22')]],'as':_0xc6e2b4['as'],'attributes':_0xc6e2b4[_0xd381('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2766da){logger['info'](_0xd381('0x24'),_0x5794b6);logger[_0xd381('0x12')](_0xd381('0x24'),_0x5794b6,JSON[_0xd381('0x14')](_0x2766da));_0x35d6d0(_0x2766da);})[_0xd381('0x1a')](function(_0x4fd108){logger[_0xd381('0x15')]('ShowUser',_0x4fd108[_0xd381('0x17')],_0x5794b6);_0x5f49cf(_0x337c36[_0xd381('0x15')](0x1f4,_0x4fd108[_0xd381('0x17')]));});});};exports[_0xd381('0x27')]=function(_0x3b2949){var _0x4e0e22=this;return new Promise(function(_0x4021ef,_0x5d4c98){var _0x494dc1;return db['User'][_0xd381('0x26')]({'where':_0x3b2949[_0xd381('0x1c')]['where']||{},'attributes':['id',_0xd381('0x28'),_0xd381('0x29'),_0xd381('0x2a'),_0xd381('0x2b')]})[_0xd381('0xf')](function(_0x152a55){if(_0x152a55){_0x494dc1=_0x152a55;return db[_0xd381('0x2c')][_0xd381('0x2d')]({'paused':0x1},{'where':{'UserId':_0x494dc1['id']},'individualHooks':!![]});}})[_0xd381('0xf')](function(){if(_0x494dc1){return db[_0xd381('0x2e')]['findAll']({'where':{'membername':_0x494dc1[_0xd381('0x28')],'type':_0xd381('0x2f'),'exitAt':null}});}})[_0xd381('0xf')](function(_0xfd4dfa){if(_0x494dc1){if(_0xfd4dfa&&_0xfd4dfa['length']){var _0x112efa=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4c068e=0x0,_0x38a36f=_0xfd4dfa[_0xd381('0x30')];_0x4c068e<_0x38a36f;_0x4c068e++){_0xfd4dfa[_0x4c068e][_0xd381('0x31')]({'exitAt':_0x112efa});}}}})[_0xd381('0xf')](function(){if(_0x494dc1){var _0x1147f0=[];var _0x3b534e=utils[_0xd381('0x32')]();_0x3b534e[_0xd381('0x33')](function(_0x3493c0){_0x1147f0[_0xd381('0x34')]({'channel':_0x3493c0,'membername':_0x494dc1['name'],'interface':_[_0xd381('0x35')](_0x494dc1[_0xd381('0x2b')])?util['format']('SIP/%s',_0x494dc1['name']):_0x494dc1[_0xd381('0x2b')],'type':_0xd381('0x2f'),'enterAt':moment()[_0xd381('0x36')](_0xd381('0x37')),'data1':_0x3b2949[_0xd381('0x38')][_0xd381('0x39')]||'DEFAULT\x20PAUSE','role':_0x494dc1[_0xd381('0x29')],'internal':_0x494dc1[_0xd381('0x2a')],'uniqueid':_0x3b2949[_0xd381('0x38')][_0xd381('0x3a')]||null});});return db[_0xd381('0x2e')][_0xd381('0x3b')](_0x1147f0,{'individualHooks':!![]});}})[_0xd381('0xf')](function(){if(_0x494dc1){return _0x494dc1['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3b2949[_0xd381('0x38')]['type']||_0xd381('0x3c'),'lastPauseAt':moment()['format'](_0xd381('0x37'))});}})[_0xd381('0xf')](function(_0x3a9b9c){_0x4021ef(_0x3a9b9c);})[_0xd381('0x1a')](function(_0x5b7a05){_0x5d4c98(_0x4e0e22[_0xd381('0x15')](0x1f4,_0x5b7a05[_0xd381('0x17')]));});});};exports[_0xd381('0x3d')]=function(_0x1c1fb9){var _0x4dc06f=this;return new Promise(function(_0x25bb96,_0x55ad90){var _0x5e62b0;return db[_0xd381('0x25')][_0xd381('0x3e')]({'where':_0x1c1fb9[_0xd381('0x1c')]['where']||{},'attributes':['id',_0xd381('0x28')]})['then'](function(_0x3fca51){if(_0x3fca51){_0x5e62b0=_0x3fca51;if(_0x1c1fb9[_0xd381('0x38')]['channel']&&!utils[_0xd381('0x3f')](_0x1c1fb9[_0xd381('0x38')][_0xd381('0x40')])){throw new Error(_0xd381('0x41'));}switch(_0x1c1fb9['body'][_0xd381('0x40')]){case _0xd381('0x42'):return db['UserVoiceQueueRt'][_0xd381('0x2d')]({'paused':0x0},{'where':{'UserId':_0x5e62b0['id']}})[_0xd381('0xf')](function(){return db[_0xd381('0x2e')][_0xd381('0x26')]({'where':{'channel':_0x1c1fb9[_0xd381('0x38')]['channel'],'membername':_0x5e62b0[_0xd381('0x28')],'type':_0xd381('0x2f'),'exitAt':null}});})['then'](function(_0x269bf7){if(_0x269bf7){return _0x269bf7[_0xd381('0x2d')]({'exitAt':moment()[_0xd381('0x36')](_0xd381('0x37')),'data2':_0xd381('0x43')},{'individualHooks':!![]});}return null;})[_0xd381('0xf')](function(){return _0x5e62b0[_0xd381('0x2d')]({'voicePause':![]});});case _0xd381('0x44'):case _0xd381('0x45'):case'fax':case'sms':case _0xd381('0x46'):return db[_0xd381('0x2e')][_0xd381('0x26')]({'where':{'channel':_0x1c1fb9[_0xd381('0x38')][_0xd381('0x40')],'membername':_0x5e62b0['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0x300cca){return _0x300cca[_0xd381('0x2d')]({'exitAt':moment()[_0xd381('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xd381('0xf')](function(){var _0x25db8c={};_[_0xd381('0x47')](_0x25db8c,util['format'](_0xd381('0x48'),_0x1c1fb9[_0xd381('0x38')][_0xd381('0x40')],_0xd381('0x49')),![]);return _0x5e62b0[_0xd381('0x2d')](_0x25db8c);});default:return db[_0xd381('0x2c')][_0xd381('0x2d')]({'paused':0x0},{'where':{'UserId':_0x5e62b0['id']}})[_0xd381('0xf')](function(){return db[_0xd381('0x2e')]['findAll']({'where':{'membername':_0x5e62b0[_0xd381('0x28')],'type':_0xd381('0x2f'),'exitAt':null}});})[_0xd381('0xf')](function(_0x2e5e8f){var _0x29e403=[];_0x2e5e8f[_0xd381('0x33')](function(_0x2b5835){_0x29e403['push'](_0x2b5835['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xd381('0x43')}));});return BPromise['all'](_0x29e403);})[_0xd381('0xf')](function(){return _0x5e62b0[_0xd381('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd381('0xf')](function(_0x2bf511){_0x25bb96(_0x2bf511);})[_0xd381('0x1a')](function(_0x58f11f){_0x55ad90(_0x4dc06f[_0xd381('0x15')](0x1f4,_0x58f11f[_0xd381('0x17')]));});});};exports['LogoutUser']=function(_0x4d1961){var _0x1675b7=this;return new Promise(function(_0x37d050,_0x59b0a9){var _0xa4d462;return db[_0xd381('0x25')][_0xd381('0x3e')]({'where':_0x4d1961[_0xd381('0x1c')]['where']||{},'attributes':['id','name']})[_0xd381('0xf')](function(_0x304924){if(_0x304924){_0xa4d462=_0x304924;return db[_0xd381('0x2c')][_0xd381('0x4a')]({'where':{'membername':_0xa4d462[_0xd381('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0xa4d462){return db[_0xd381('0x2e')][_0xd381('0x4b')]({'where':{'membername':_0xa4d462[_0xd381('0x28')],'exitAt':null}});}})['then'](function(_0x38072b){if(_0xa4d462){if(_0x38072b&&_0x38072b['length']){var _0x22f2bd=[];_0x38072b[_0xd381('0x33')](function(_0x53cca5){_0x22f2bd['push'](_0x53cca5[_0xd381('0x2d')]({'exitAt':moment()[_0xd381('0x36')](_0xd381('0x37'))}));});return BPromise[_0xd381('0x4c')](_0x22f2bd);}}})[_0xd381('0xf')](function(){if(_0xa4d462){return _0xa4d462[_0xd381('0x2d')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd381('0xf')](function(_0x5834ff){_0x37d050(_0x5834ff);})[_0xd381('0x1a')](function(_0x505672){_0x59b0a9(_0x1675b7['error'](0x1f4,_0x505672[_0xd381('0x17')]));});});};exports[_0xd381('0x4d')]=function(_0x2f1f37){var _0x5dec74=this;return new Promise(function(_0x263348,_0xc87d){var _0x3217d4;var _0xe4c79a;var _0x5d6841;var _0x14d04d;return db[_0xd381('0x25')][_0xd381('0x3e')]({'where':_0x2f1f37[_0xd381('0x1c')][_0xd381('0x1e')]||{},'attributes':['id','name',_0xd381('0x29'),_0xd381('0x4e'),_0xd381('0x4f'),_0xd381('0x2a'),_0xd381('0x50'),_0xd381('0x2b')]})[_0xd381('0xf')](function(_0x1266f0){if(_0x1266f0){_0x3217d4=_0x1266f0;_0x14d04d=_0x2f1f37[_0xd381('0x38')]['interface']?_0x2f1f37[_0xd381('0x38')]['interface']:util[_0xd381('0x36')](_0xd381('0x51'),_0x3217d4[_0xd381('0x28')]);return db[_0xd381('0x25')][_0xd381('0x52')]({'where':{'role':_0xd381('0x53'),'online':!![],'id':{'$ne':_0x3217d4['id']}}});}})['then'](function(_0x5f09e3){if(_0x5f09e3){_0x5d6841=_0x5f09e3;return require('../../config/license/util')['getLicense']();}})[_0xd381('0xf')](function(_0xbc57be){if(_0xbc57be&&_0xbc57be['agents']&&_0x5d6841>=_0xbc57be[_0xd381('0x54')]){throw new Error(_0xd381('0x55'));}})[_0xd381('0xf')](function(){if(_0x3217d4){return db['UserVoiceQueueRt'][_0xd381('0x4a')]({'where':{'membername':_0x3217d4['name']},'individualHooks':!![]});}})[_0xd381('0xf')](function(){if(_0x3217d4){return _0x3217d4[_0xd381('0x56')]({'raw':!![]});}})[_0xd381('0xf')](function(_0x5f02bb){if(_0x3217d4){if(_0x5f02bb){var _0x474a6f=[];_0xe4c79a=_0x5f02bb;if(_0xe4c79a[_0xd381('0x30')]){for(var _0x46e11b=0x0;_0x46e11b<_0xe4c79a['length'];_0x46e11b++){_0x474a6f[_0xd381('0x34')](db[_0xd381('0x2c')]['upsert']({'membername':_0x3217d4[_0xd381('0x28')],'UserId':_0x3217d4['id'],'queue_name':_0xe4c79a[_0x46e11b][_0xd381('0x28')],'VoiceQueueId':_0xe4c79a[_0x46e11b]['id'],'interface':_0x14d04d,'paused':_0x3217d4['loginInPause']||![],'penalty':_0xe4c79a[_0x46e11b]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xd381('0x4c')](_0x474a6f);}}}})[_0xd381('0xf')](function(){if(_0x3217d4){return db[_0xd381('0x2e')]['findAll']({'where':{'membername':_0x3217d4[_0xd381('0x28')],'exitAt':null}});}})['then'](function(_0x45b266){if(_0x3217d4){if(_0x45b266&&_0x45b266[_0xd381('0x30')]){var _0x2554d0=[];_0x45b266[_0xd381('0x33')](function(_0x1a31ff){_0x2554d0[_0xd381('0x34')](_0x1a31ff[_0xd381('0x2d')]({'exitAt':moment()[_0xd381('0x36')](_0xd381('0x37'))}));});return BPromise[_0xd381('0x4c')](_0x2554d0);}}})[_0xd381('0xf')](function(_0x304a2b){if(_0x3217d4){var _0x4e2c5e=[];var _0x52a7ad=[];var _0x6248ca=utils['getChannels']();var _0x4f3ba4={'membername':_0x3217d4[_0xd381('0x28')],'interface':_0x14d04d,'enterAt':moment()[_0xd381('0x36')](_0xd381('0x37')),'role':_0x3217d4[_0xd381('0x29')],'internal':_0x3217d4[_0xd381('0x2a')]};_0x6248ca[_0xd381('0x33')](function(_0xc314e3){_0x4e2c5e[_0xd381('0x34')](_[_0xd381('0x57')]({'channel':_0xc314e3,'type':'LOGIN','data1':_0xd381('0x58'),'data2':_0x14d04d},_0x4f3ba4));if(_0x3217d4['loginInPause']){_0x52a7ad[_0xd381('0x34')](_[_0xd381('0x57')]({'channel':_0xc314e3,'type':_0xd381('0x2f'),'data1':_0xd381('0x59')},_0x4f3ba4));}});return db[_0xd381('0x2e')]['bulkCreate'](_0x4e2c5e['concat'](_0x52a7ad),{'individualHooks':!![]});}})['then'](function(){if(_0x3217d4){return _0x3217d4['update']({'online':!![],'lastLoginAt':moment()[_0xd381('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3217d4[_0xd381('0x50')]||![],'mailPause':_0x3217d4[_0xd381('0x50')]||![],'chatPause':_0x3217d4[_0xd381('0x50')]||![],'faxPause':_0x3217d4['loginInPause']||![],'smsPause':_0x3217d4[_0xd381('0x50')]||![],'openchannelPause':_0x3217d4['loginInPause']||![],'pauseType':_0x3217d4['loginInPause']?_0xd381('0x59'):null,'lastPauseAt':moment()[_0xd381('0x36')](_0xd381('0x37')),'interface':_0x14d04d});}})[_0xd381('0xf')](function(_0x54f2fb){_0x263348(_0x54f2fb);})['catch'](function(_0x21e8a8){_0xc87d(_0x5dec74[_0xd381('0x15')](0x1f4,_0x21e8a8[_0xd381('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 722d186..17cd1aa 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 _0xe8fd=['user:','save','remove','update','emit','removeListener','register','length'];(function(_0x5cca9f,_0x154684){var _0x55edda=function(_0x115aa2){while(--_0x115aa2){_0x5cca9f['push'](_0x5cca9f['shift']());}};_0x55edda(++_0x154684);}(_0xe8fd,0xe9));var _0xde8f=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xe8fd[_0x2f45ea];return _0x485a84;};'use strict';var UserEvents=require('./user.events');var events=[_0xde8f('0x0'),_0xde8f('0x1'),_0xde8f('0x2')];function createListener(_0x2c8099,_0x278302){return function(_0x513cae){_0x278302[_0xde8f('0x3')](_0x2c8099,_0x513cae);};}function removeListener(_0xa1c7fa,_0x525b58){return function(){UserEvents[_0xde8f('0x4')](_0xa1c7fa,_0x525b58);};}exports[_0xde8f('0x5')]=function(_0x252019){for(var _0x4f2579=0x0,_0x1f24a2=events[_0xde8f('0x6')];_0x4f2579<_0x1f24a2;_0x4f2579++){var _0x47cece=events[_0x4f2579];var _0x32e683=createListener(_0xde8f('0x7')+_0x47cece,_0x252019);UserEvents['on'](_0x47cece,_0x32e683);}}; \ No newline at end of file +var _0xed2f=['register','user:','./user.events','save','update'];(function(_0x53a2cb,_0x4e0b37){var _0xa7627e=function(_0x102bfe){while(--_0x102bfe){_0x53a2cb['push'](_0x53a2cb['shift']());}};_0xa7627e(++_0x4e0b37);}(_0xed2f,0x142));var _0xfed2=function(_0x44f893,_0x5a50ac){_0x44f893=_0x44f893-0x0;var _0x5e8460=_0xed2f[_0x44f893];return _0x5e8460;};'use strict';var UserEvents=require(_0xfed2('0x0'));var events=[_0xfed2('0x1'),'remove',_0xfed2('0x2')];function createListener(_0x22e5b1,_0x27949f){return function(_0x4432ff){_0x27949f['emit'](_0x22e5b1,_0x4432ff);};}function removeListener(_0x5ea170,_0x31122a){return function(){UserEvents['removeListener'](_0x5ea170,_0x31122a);};}exports[_0xfed2('0x3')]=function(_0x535a39){for(var _0x336e25=0x0,_0x10c6a0=events['length'];_0x336e25<_0x10c6a0;_0x336e25++){var _0x4e765b=events[_0x336e25];var _0x1131b1=createListener(_0xfed2('0x4')+_0x4e765b,_0x535a39);UserEvents['on'](_0x4e765b,_0x1131b1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1e93f7b..818f347 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 _0x0d65=['util','path','connect-timeout','../../components/auth/service','../../config/environment','multer'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x0d65,0xbf));var _0x50d6=function(_0x205c02,_0xb01941){_0x205c02=_0x205c02-0x0;var _0x380619=_0x0d65[_0x205c02];return _0x380619;};'use strict';var multer=require(_0x50d6('0x0'));var util=require(_0x50d6('0x1'));var path=require(_0x50d6('0x2'));var timeout=require(_0x50d6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x50d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x50d6('0x5'));module['exports']=router; \ No newline at end of file +var _0x499e=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','connect-timeout','express'];(function(_0x227542,_0x4e3554){var _0x16e8d9=function(_0x505523){while(--_0x505523){_0x227542['push'](_0x227542['shift']());}};_0x16e8d9(++_0x4e3554);}(_0x499e,0xa6));var _0xe499=function(_0x266a10,_0x327612){_0x266a10=_0x266a10-0x0;var _0x121341=_0x499e[_0x266a10];return _0x121341;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe499('0x0'));var express=require(_0xe499('0x1'));var router=express['Router']();var auth=require(_0xe499('0x2'));var interaction=require(_0xe499('0x3'));var config=require(_0xe499('0x4'));module[_0xe499('0x5')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 77da947..c5f17c5 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(_0x395b58,_0x23518d){var _0x43c80a=function(_0x4f5687){while(--_0x4f5687){_0x395b58['push'](_0x395b58['shift']());}};_0x43c80a(++_0x23518d);}(_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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x22d986,_0x513513){var _0x40ec36=function(_0xedd449){while(--_0xedd449){_0x22d986['push'](_0x22d986['shift']());}};_0x40ec36(++_0x513513);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7e42bd8..ebb4558 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 _0x935e=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x935e,0x17e));var _0xe935=function(_0x1b7459,_0x33d46c){_0x1b7459=_0x1b7459-0x0;var _0x5d3b2d=_0x935e[_0x1b7459];return _0x5d3b2d;};'use strict';var _=require(_0xe935('0x0'));var util=require(_0xe935('0x1'));var logger=require(_0xe935('0x2'))(_0xe935('0x3'));var moment=require(_0xe935('0x4'));var BPromise=require('bluebird');var rp=require(_0xe935('0x5'));var fs=require('fs');var path=require(_0xe935('0x6'));var rimraf=require(_0xe935('0x7'));var config=require(_0xe935('0x8'));var attributes=require(_0xe935('0x9'));module[_0xe935('0xa')]=function(_0x1c99e3,_0x3da394){return _0x1c99e3[_0xe935('0xb')](_0xe935('0xc'),attributes,{'tableName':_0xe935('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf93=['bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x21c69e,_0x48e283){var _0x102abc=function(_0x1af410){while(--_0x1af410){_0x21c69e['push'](_0x21c69e['shift']());}};_0x102abc(++_0x48e283);}(_0xdf93,0x13b));var _0x3df9=function(_0x55f41f,_0x108f13){_0x55f41f=_0x55f41f-0x0;var _0x2ccb67=_0xdf93[_0x55f41f];return _0x2ccb67;};'use strict';var _=require(_0x3df9('0x0'));var util=require(_0x3df9('0x1'));var logger=require(_0x3df9('0x2'))('api');var moment=require(_0x3df9('0x3'));var BPromise=require(_0x3df9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3df9('0x5'));var rimraf=require(_0x3df9('0x6'));var config=require(_0x3df9('0x7'));var attributes=require(_0x3df9('0x8'));module[_0x3df9('0x9')]=function(_0x286688,_0x58632e){return _0x286688[_0x3df9('0xa')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index f80164e..478041b 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 _0xad53=['catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2864b3,_0x1e5771){var _0x2c2049=function(_0x1c18a8){while(--_0x1c18a8){_0x2864b3['push'](_0x2864b3['shift']());}};_0x2c2049(++_0x1e5771);}(_0xad53,0x151));var _0x3ad5=function(_0x33c6cd,_0x447095){_0x33c6cd=_0x33c6cd-0x0;var _0x53f83c=_0xad53[_0x33c6cd];return _0x53f83c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3ad5('0x0'));var fs=require('fs');var Redis=require(_0x3ad5('0x1'));var db=require(_0x3ad5('0x2'))['db'];var utils=require(_0x3ad5('0x3'));var logger=require('../../config/logger')(_0x3ad5('0x4'));var config=require(_0x3ad5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3ad5('0x6')][_0x3ad5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e91f0,_0xaffc90,_0x223665){return new BPromise(function(_0xe6d463,_0x279828){return client[_0x3ad5('0x8')](_0x4e91f0,_0x223665)[_0x3ad5('0x9')](function(_0x31cd8b){logger[_0x3ad5('0xa')](_0x3ad5('0xb'),_0xaffc90,_0x3ad5('0xc'));logger[_0x3ad5('0xd')](_0x3ad5('0xe'),_0xaffc90,_0x3ad5('0xc'),JSON[_0x3ad5('0xf')](_0x31cd8b));if(_0x31cd8b[_0x3ad5('0x10')]){if(_0x31cd8b[_0x3ad5('0x10')][_0x3ad5('0x11')]===0x1f4){logger[_0x3ad5('0x10')](_0x3ad5('0xb'),_0xaffc90,_0x31cd8b[_0x3ad5('0x10')][_0x3ad5('0x12')]);return _0x279828(_0x31cd8b[_0x3ad5('0x10')][_0x3ad5('0x12')]);}logger[_0x3ad5('0x10')](_0x3ad5('0xb'),_0xaffc90,_0x31cd8b['error'][_0x3ad5('0x12')]);return _0xe6d463(_0x31cd8b[_0x3ad5('0x10')][_0x3ad5('0x12')]);}else{logger[_0x3ad5('0xa')](_0x3ad5('0xb'),_0xaffc90,_0x3ad5('0xc'));_0xe6d463(_0x31cd8b[_0x3ad5('0x13')]['message']);}})[_0x3ad5('0x14')](function(_0x23b45e){logger[_0x3ad5('0x10')](_0x3ad5('0xb'),_0xaffc90,_0x23b45e);_0x279828(_0x23b45e);});});} \ No newline at end of file +var _0x310e=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1cf4ea,_0x41cf33){var _0x339bc3=function(_0x399bef){while(--_0x399bef){_0x1cf4ea['push'](_0x1cf4ea['shift']());}};_0x339bc3(++_0x41cf33);}(_0x310e,0x1c9));var _0xe310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x310e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe310('0x0'));var util=require(_0xe310('0x1'));var moment=require(_0xe310('0x2'));var BPromise=require('bluebird');var rs=require(_0xe310('0x3'));var fs=require('fs');var Redis=require(_0xe310('0x4'));var db=require(_0xe310('0x5'))['db'];var utils=require(_0xe310('0x6'));var logger=require(_0xe310('0x7'))(_0xe310('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe310('0x9')][_0xe310('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x599672,_0x12c6b0,_0x438b99){return new BPromise(function(_0x300c1d,_0x4ea456){return client[_0xe310('0xb')](_0x599672,_0x438b99)['then'](function(_0x56fd6a){logger[_0xe310('0xc')](_0xe310('0xd'),_0x12c6b0,'request\x20sent');logger[_0xe310('0xe')](_0xe310('0xf'),_0x12c6b0,_0xe310('0x10'),JSON[_0xe310('0x11')](_0x56fd6a));if(_0x56fd6a['error']){if(_0x56fd6a[_0xe310('0x12')]['code']===0x1f4){logger[_0xe310('0x12')](_0xe310('0xd'),_0x12c6b0,_0x56fd6a['error'][_0xe310('0x13')]);return _0x4ea456(_0x56fd6a[_0xe310('0x12')]['message']);}logger[_0xe310('0x12')](_0xe310('0xd'),_0x12c6b0,_0x56fd6a[_0xe310('0x12')][_0xe310('0x13')]);return _0x300c1d(_0x56fd6a['error'][_0xe310('0x13')]);}else{logger['info'](_0xe310('0xd'),_0x12c6b0,'request\x20sent');_0x300c1d(_0x56fd6a[_0xe310('0x14')]['message']);}})[_0xe310('0x15')](function(_0x25a6a4){logger['error'](_0xe310('0xd'),_0x12c6b0,_0x25a6a4);_0x4ea456(_0x25a6a4);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index edd3e13..9280648 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 _0x3303=['exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x44ef29,_0x28b043){var _0x4a3ae6=function(_0x5b61eb){while(--_0x5b61eb){_0x44ef29['push'](_0x44ef29['shift']());}};_0x4a3ae6(++_0x28b043);}(_0x3303,0xb9));var _0x3330=function(_0x3bd935,_0x5bf0f6){_0x3bd935=_0x3bd935-0x0;var _0x1b03a2=_0x3303[_0x3bd935];return _0x1b03a2;};'use strict';var multer=require(_0x3330('0x0'));var util=require(_0x3330('0x1'));var path=require('path');var timeout=require(_0x3330('0x2'));var express=require(_0x3330('0x3'));var router=express[_0x3330('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3330('0x5'));var config=require(_0x3330('0x6'));module[_0x3330('0x7')]=router; \ No newline at end of file +var _0x7052=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7052,0x114));var _0x2705=function(_0x4d79bc,_0x32c905){_0x4d79bc=_0x4d79bc-0x0;var _0x4b4760=_0x7052[_0x4d79bc];return _0x4b4760;};'use strict';var multer=require(_0x2705('0x0'));var util=require('util');var path=require(_0x2705('0x1'));var timeout=require(_0x2705('0x2'));var express=require(_0x2705('0x3'));var router=express[_0x2705('0x4')]();var auth=require(_0x2705('0x5'));var interaction=require(_0x2705('0x6'));var config=require('../../config/environment');module[_0x2705('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 42978f0..242eedc 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 _0xdd4f=['sequelize','STRING'];(function(_0x5f23dd,_0x14156a){var _0x5d6ab8=function(_0x452286){while(--_0x452286){_0x5f23dd['push'](_0x5f23dd['shift']());}};_0x5d6ab8(++_0x14156a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x5a2a20,_0x5682f6){_0x5a2a20=_0x5a2a20-0x0;var _0x16b967=_0xdd4f[_0x5a2a20];return _0x16b967;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfdd4('0x1')]}}; \ No newline at end of file +var _0xb688=['exports','INTEGER','STRING'];(function(_0x5c002b,_0x3ca3a9){var _0x1ce73b=function(_0x22275d){while(--_0x22275d){_0x5c002b['push'](_0x5c002b['shift']());}};_0x1ce73b(++_0x3ca3a9);}(_0xb688,0xcf));var _0x8b68=function(_0xfbfc58,_0x12735c){_0xfbfc58=_0xfbfc58-0x0;var _0xdb6cab=_0xb688[_0xfbfc58];return _0xdb6cab;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'penalty':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8b68('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index c4bacd0..55948b9 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 _0xe860=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x5d2d44,_0x2ee5ed){var _0xb82cd4=function(_0x2ab5d7){while(--_0x2ab5d7){_0x5d2d44['push'](_0x5d2d44['shift']());}};_0xb82cd4(++_0x2ee5ed);}(_0xe860,0x188));var _0x0e86=function(_0x351d56,_0x2c720a){_0x351d56=_0x351d56-0x0;var _0x26f405=_0xe860[_0x351d56];return _0x26f405;};'use strict';var _=require(_0x0e86('0x0'));var util=require(_0x0e86('0x1'));var logger=require(_0x0e86('0x2'))(_0x0e86('0x3'));var moment=require('moment');var BPromise=require(_0x0e86('0x4'));var rp=require(_0x0e86('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e86('0x6'));var config=require(_0x0e86('0x7'));var attributes=require(_0x0e86('0x8'));module[_0x0e86('0x9')]=function(_0xbc6b0f,_0x1dd265){return _0xbc6b0f[_0x0e86('0xa')](_0x0e86('0xb'),attributes,{'tableName':_0x0e86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8882=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','lodash','util'];(function(_0xad2194,_0x51bd71){var _0x510d4e=function(_0x1fc6f4){while(--_0x1fc6f4){_0xad2194['push'](_0xad2194['shift']());}};_0x510d4e(++_0x51bd71);}(_0x8882,0x169));var _0x2888=function(_0x4965ee,_0x5c09b6){_0x4965ee=_0x4965ee-0x0;var _0xae26a3=_0x8882[_0x4965ee];return _0xae26a3;};'use strict';var _=require(_0x2888('0x0'));var util=require(_0x2888('0x1'));var logger=require(_0x2888('0x2'))(_0x2888('0x3'));var moment=require('moment');var BPromise=require(_0x2888('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2888('0x5'));var rimraf=require(_0x2888('0x6'));var config=require(_0x2888('0x7'));var attributes=require(_0x2888('0x8'));module['exports']=function(_0x3207d9,_0x163dea){return _0x3207d9[_0x2888('0x9')](_0x2888('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 1fbd4df..6f80268 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 _0x677c=['client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x9f48f6,_0x36c115){var _0x263acf=function(_0x16e474){while(--_0x16e474){_0x9f48f6['push'](_0x9f48f6['shift']());}};_0x263acf(++_0x36c115);}(_0x677c,0x187));var _0xc677=function(_0x12b929,_0xe53e68){_0x12b929=_0x12b929-0x0;var _0x2a67dd=_0x677c[_0x12b929];return _0x2a67dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc677('0x0'));var BPromise=require(_0xc677('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc677('0x2'));var db=require(_0xc677('0x3'))['db'];var utils=require(_0xc677('0x4'));var logger=require(_0xc677('0x5'))('rpc');var config=require(_0xc677('0x6'));var jayson=require(_0xc677('0x7'));var client=jayson[_0xc677('0x8')][_0xc677('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f1f34,_0x59aced,_0x3a6e1b){return new BPromise(function(_0x1f430a,_0x5d99a3){return client['request'](_0x3f1f34,_0x3a6e1b)[_0xc677('0xa')](function(_0x2886b4){logger[_0xc677('0xb')](_0xc677('0xc'),_0x59aced,_0xc677('0xd'));logger[_0xc677('0xe')](_0xc677('0xf'),_0x59aced,_0xc677('0xd'),JSON[_0xc677('0x10')](_0x2886b4));if(_0x2886b4[_0xc677('0x11')]){if(_0x2886b4[_0xc677('0x11')][_0xc677('0x12')]===0x1f4){logger['error'](_0xc677('0xc'),_0x59aced,_0x2886b4[_0xc677('0x11')]['message']);return _0x5d99a3(_0x2886b4['error']['message']);}logger[_0xc677('0x11')](_0xc677('0xc'),_0x59aced,_0x2886b4[_0xc677('0x11')][_0xc677('0x13')]);return _0x1f430a(_0x2886b4[_0xc677('0x11')][_0xc677('0x13')]);}else{logger['info'](_0xc677('0xc'),_0x59aced,'request\x20sent');_0x1f430a(_0x2886b4[_0xc677('0x14')]['message']);}})['catch'](function(_0x32a2e7){logger[_0xc677('0x11')](_0xc677('0xc'),_0x59aced,_0x32a2e7);_0x5d99a3(_0x32a2e7);});});} \ No newline at end of file +var _0xfffd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xfffd,0xea));var _0xdfff=function(_0xab4a04,_0x216291){_0xab4a04=_0xab4a04-0x0;var _0x27ae03=_0xfffd[_0xab4a04];return _0x27ae03;};'use strict';var _=require(_0xdfff('0x0'));var util=require(_0xdfff('0x1'));var moment=require(_0xdfff('0x2'));var BPromise=require(_0xdfff('0x3'));var rs=require(_0xdfff('0x4'));var fs=require('fs');var Redis=require(_0xdfff('0x5'));var db=require(_0xdfff('0x6'))['db'];var utils=require(_0xdfff('0x7'));var logger=require(_0xdfff('0x8'))(_0xdfff('0x9'));var config=require(_0xdfff('0xa'));var jayson=require(_0xdfff('0xb'));var client=jayson[_0xdfff('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31b56c,_0x520a3b,_0x5af9e4){return new BPromise(function(_0x272509,_0x49e4f0){return client['request'](_0x31b56c,_0x5af9e4)[_0xdfff('0xd')](function(_0x35120e){logger[_0xdfff('0xe')](_0xdfff('0xf'),_0x520a3b,_0xdfff('0x10'));logger[_0xdfff('0x11')](_0xdfff('0x12'),_0x520a3b,_0xdfff('0x10'),JSON['stringify'](_0x35120e));if(_0x35120e[_0xdfff('0x13')]){if(_0x35120e[_0xdfff('0x13')][_0xdfff('0x14')]===0x1f4){logger[_0xdfff('0x13')](_0xdfff('0xf'),_0x520a3b,_0x35120e['error'][_0xdfff('0x15')]);return _0x49e4f0(_0x35120e[_0xdfff('0x13')][_0xdfff('0x15')]);}logger[_0xdfff('0x13')](_0xdfff('0xf'),_0x520a3b,_0x35120e[_0xdfff('0x13')][_0xdfff('0x15')]);return _0x272509(_0x35120e[_0xdfff('0x13')][_0xdfff('0x15')]);}else{logger[_0xdfff('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x520a3b,_0xdfff('0x10'));_0x272509(_0x35120e[_0xdfff('0x16')][_0xdfff('0x15')]);}})[_0xdfff('0x17')](function(_0x4f91b6){logger[_0xdfff('0x13')](_0xdfff('0xf'),_0x520a3b,_0x4f91b6);_0x49e4f0(_0x4f91b6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index b5122d6..17bd5c4 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 _0x70c4=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a1a31,_0x1b8b1a){var _0xe175e8=function(_0xa6f2c2){while(--_0xa6f2c2){_0x2a1a31['push'](_0x2a1a31['shift']());}};_0xe175e8(++_0x1b8b1a);}(_0x70c4,0x184));var _0x470c=function(_0x17071c,_0x406dd6){_0x17071c=_0x17071c-0x0;var _0x14440b=_0x70c4[_0x17071c];return _0x14440b;};'use strict';var multer=require(_0x470c('0x0'));var util=require(_0x470c('0x1'));var path=require(_0x470c('0x2'));var timeout=require(_0x470c('0x3'));var express=require(_0x470c('0x4'));var router=express[_0x470c('0x5')]();var auth=require(_0x470c('0x6'));var interaction=require(_0x470c('0x7'));var config=require('../../config/environment');module[_0x470c('0x8')]=router; \ No newline at end of file +var _0x5f7e=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x237340,_0x39b15d){var _0x5542c8=function(_0xb6a05f){while(--_0xb6a05f){_0x237340['push'](_0x237340['shift']());}};_0x5542c8(++_0x39b15d);}(_0x5f7e,0xd3));var _0xe5f7=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x5f7e[_0x368bba];return _0x409f8f;};'use strict';var multer=require(_0xe5f7('0x0'));var util=require(_0xe5f7('0x1'));var path=require(_0xe5f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5f7('0x3'));var router=express[_0xe5f7('0x4')]();var auth=require(_0xe5f7('0x5'));var interaction=require(_0xe5f7('0x6'));var config=require(_0xe5f7('0x7'));module[_0xe5f7('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 7b1b370..9d6d899 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 _0xbaf0=['exports','INTEGER'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x197043,_0x3ebf47){var _0x233e33=function(_0x17bd0f){while(--_0x17bd0f){_0x197043['push'](_0x197043['shift']());}};_0x233e33(++_0x3ebf47);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'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 034999e..2ed2b9f 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4f1fa6,_0x51e822){var _0x1573dc=function(_0x454adb){while(--_0x454adb){_0x4f1fa6['push'](_0x4f1fa6['shift']());}};_0x1573dc(++_0x51e822);}(_0xe706,0xa3));var _0x6e70=function(_0x3dc9bc,_0x77bc87){_0x3dc9bc=_0x3dc9bc-0x0;var _0x23a813=_0xe706[_0x3dc9bc];return _0x23a813;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2032=['user_has_mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x317510,_0x26fe66){var _0x51320=function(_0x2dfb7c){while(--_0x2dfb7c){_0x317510['push'](_0x317510['shift']());}};_0x51320(++_0x26fe66);}(_0x2032,0xd9));var _0x2203=function(_0x20c175,_0x275efc){_0x20c175=_0x20c175-0x0;var _0x3c971e=_0x2032[_0x20c175];return _0x3c971e;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index e5ca611..2096a94 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 _0x2d06=['debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0xafb8e6,_0x4b3a6b){var _0x36eec3=function(_0x30af02){while(--_0x30af02){_0xafb8e6['push'](_0xafb8e6['shift']());}};_0x36eec3(++_0x4b3a6b);}(_0x2d06,0x157));var _0x62d0=function(_0x1d5b3d,_0x5c7145){_0x1d5b3d=_0x1d5b3d-0x0;var _0xc810b9=_0x2d06[_0x1d5b3d];return _0xc810b9;};'use strict';var _=require('lodash');var util=require(_0x62d0('0x0'));var moment=require(_0x62d0('0x1'));var BPromise=require(_0x62d0('0x2'));var rs=require(_0x62d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62d0('0x4'))['db'];var utils=require(_0x62d0('0x5'));var logger=require(_0x62d0('0x6'))(_0x62d0('0x7'));var config=require('../../config/environment');var jayson=require(_0x62d0('0x8'));var client=jayson[_0x62d0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x377f3d,_0x43fd82,_0x508d82){return new BPromise(function(_0x264cd4,_0xc4dacc){return client[_0x62d0('0xa')](_0x377f3d,_0x508d82)[_0x62d0('0xb')](function(_0x482d16){logger['info'](_0x62d0('0xc'),_0x43fd82,_0x62d0('0xd'));logger[_0x62d0('0xe')](_0x62d0('0xf'),_0x43fd82,_0x62d0('0xd'),JSON[_0x62d0('0x10')](_0x482d16));if(_0x482d16[_0x62d0('0x11')]){if(_0x482d16[_0x62d0('0x11')][_0x62d0('0x12')]===0x1f4){logger[_0x62d0('0x11')](_0x62d0('0xc'),_0x43fd82,_0x482d16[_0x62d0('0x11')][_0x62d0('0x13')]);return _0xc4dacc(_0x482d16[_0x62d0('0x11')]['message']);}logger[_0x62d0('0x11')](_0x62d0('0xc'),_0x43fd82,_0x482d16[_0x62d0('0x11')]['message']);return _0x264cd4(_0x482d16[_0x62d0('0x11')][_0x62d0('0x13')]);}else{logger['info'](_0x62d0('0xc'),_0x43fd82,_0x62d0('0xd'));_0x264cd4(_0x482d16[_0x62d0('0x14')][_0x62d0('0x13')]);}})['catch'](function(_0x5a803c){logger[_0x62d0('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x43fd82,_0x5a803c);_0xc4dacc(_0x5a803c);});});} \ No newline at end of file +var _0xba18=['request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var moment=require(_0x8ba1('0x2'));var BPromise=require(_0x8ba1('0x3'));var rs=require(_0x8ba1('0x4'));var fs=require('fs');var Redis=require(_0x8ba1('0x5'));var db=require(_0x8ba1('0x6'))['db'];var utils=require(_0x8ba1('0x7'));var logger=require('../../config/logger')(_0x8ba1('0x8'));var config=require(_0x8ba1('0x9'));var jayson=require(_0x8ba1('0xa'));var client=jayson[_0x8ba1('0xb')][_0x8ba1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ffa15,_0x51a988,_0x3a87eb){return new BPromise(function(_0x3d1fe7,_0x4dc6c4){return client['request'](_0x2ffa15,_0x3a87eb)['then'](function(_0x4609ce){logger[_0x8ba1('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x51a988,_0x8ba1('0xe'));logger[_0x8ba1('0xf')](_0x8ba1('0x10'),_0x51a988,_0x8ba1('0xe'),JSON[_0x8ba1('0x11')](_0x4609ce));if(_0x4609ce['error']){if(_0x4609ce[_0x8ba1('0x12')][_0x8ba1('0x13')]===0x1f4){logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x4609ce[_0x8ba1('0x12')][_0x8ba1('0x15')]);return _0x4dc6c4(_0x4609ce['error'][_0x8ba1('0x15')]);}logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x4609ce[_0x8ba1('0x12')]['message']);return _0x3d1fe7(_0x4609ce['error']['message']);}else{logger[_0x8ba1('0xd')](_0x8ba1('0x14'),_0x51a988,_0x8ba1('0xe'));_0x3d1fe7(_0x4609ce[_0x8ba1('0x16')][_0x8ba1('0x15')]);}})[_0x8ba1('0x17')](function(_0x107846){logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x107846);_0x4dc6c4(_0x107846);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2a860e8..4eaec30 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 _0xeb58=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5b827f,_0x339f5f){var _0xf0672c=function(_0x1b8db1){while(--_0x1b8db1){_0x5b827f['push'](_0x5b827f['shift']());}};_0xf0672c(++_0x339f5f);}(_0xeb58,0x101));var _0x8eb5=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xeb58[_0x3902c1];return _0x1266cc;};'use strict';var multer=require(_0x8eb5('0x0'));var util=require(_0x8eb5('0x1'));var path=require(_0x8eb5('0x2'));var timeout=require(_0x8eb5('0x3'));var express=require(_0x8eb5('0x4'));var router=express[_0x8eb5('0x5')]();var auth=require(_0x8eb5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x8eb5('0x7')]=router; \ No newline at end of file +var _0x778e=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x778e,0x124));var _0xe778=function(_0x16a564,_0x154257){_0x16a564=_0x16a564-0x0;var _0x45403f=_0x778e[_0x16a564];return _0x45403f;};'use strict';var multer=require(_0xe778('0x0'));var util=require(_0xe778('0x1'));var path=require('path');var timeout=require(_0xe778('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe778('0x3'));var interaction=require(_0xe778('0x4'));var config=require(_0xe778('0x5'));module[_0xe778('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f8f0fe5..9eb6fa6 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 _0xbaf0=['exports','INTEGER'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x109c40,_0x3463fa){var _0x3d5aed=function(_0x236b3f){while(--_0x236b3f){_0x109c40['push'](_0x109c40['shift']());}};_0x3d5aed(++_0x3463fa);}(_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 28e0fac..ec62015 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 _0x9cad=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird'];(function(_0x1cb73e,_0xce62f4){var _0x5c1e4c=function(_0x5cf8e3){while(--_0x5cf8e3){_0x1cb73e['push'](_0x1cb73e['shift']());}};_0x5c1e4c(++_0xce62f4);}(_0x9cad,0x12f));var _0xd9ca=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x9cad[_0x16629d];return _0x56ccee;};'use strict';var _=require(_0xd9ca('0x0'));var util=require(_0xd9ca('0x1'));var logger=require('../../config/logger')(_0xd9ca('0x2'));var moment=require(_0xd9ca('0x3'));var BPromise=require(_0xd9ca('0x4'));var rp=require(_0xd9ca('0x5'));var fs=require('fs');var path=require(_0xd9ca('0x6'));var rimraf=require(_0xd9ca('0x7'));var config=require(_0xd9ca('0x8'));var attributes=require(_0xd9ca('0x9'));module[_0xd9ca('0xa')]=function(_0x3e02a4,_0xd8a0f3){return _0x3e02a4[_0xd9ca('0xb')](_0xd9ca('0xc'),attributes,{'tableName':_0xd9ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5224=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5224,0x163));var _0x4522=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x5224[_0x43371b];return _0x19cd26;};'use strict';var _=require(_0x4522('0x0'));var util=require('util');var logger=require(_0x4522('0x1'))(_0x4522('0x2'));var moment=require(_0x4522('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4522('0x4'));var rimraf=require(_0x4522('0x5'));var config=require(_0x4522('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x4522('0x7')]=function(_0x545c18,_0x1bab3a){return _0x545c18[_0x4522('0x8')](_0x4522('0x9'),attributes,{'tableName':_0x4522('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index aa6824f..0a7ab2b 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 _0x510b=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','message','error','info','lodash','util','bluebird'];(function(_0x4e61a9,_0x42a30e){var _0x124703=function(_0x28ce23){while(--_0x28ce23){_0x4e61a9['push'](_0x4e61a9['shift']());}};_0x124703(++_0x42a30e);}(_0x510b,0x140));var _0xb510=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x510b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb510('0x0'));var util=require(_0xb510('0x1'));var moment=require('moment');var BPromise=require(_0xb510('0x2'));var rs=require(_0xb510('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb510('0x4'));var logger=require('../../config/logger')(_0xb510('0x5'));var config=require(_0xb510('0x6'));var jayson=require(_0xb510('0x7'));var client=jayson[_0xb510('0x8')][_0xb510('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14fb82,_0x55b393,_0x2e1e77){return new BPromise(function(_0x1d733a,_0xbc127a){return client['request'](_0x14fb82,_0x2e1e77)[_0xb510('0xa')](function(_0x54622e){logger['info'](_0xb510('0xb'),_0x55b393,_0xb510('0xc'));logger['debug'](_0xb510('0xd'),_0x55b393,'request\x20sent',JSON['stringify'](_0x54622e));if(_0x54622e['error']){if(_0x54622e['error']['code']===0x1f4){logger['error'](_0xb510('0xb'),_0x55b393,_0x54622e['error'][_0xb510('0xe')]);return _0xbc127a(_0x54622e[_0xb510('0xf')][_0xb510('0xe')]);}logger[_0xb510('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55b393,_0x54622e[_0xb510('0xf')][_0xb510('0xe')]);return _0x1d733a(_0x54622e[_0xb510('0xf')][_0xb510('0xe')]);}else{logger[_0xb510('0x10')](_0xb510('0xb'),_0x55b393,_0xb510('0xc'));_0x1d733a(_0x54622e['result'][_0xb510('0xe')]);}})['catch'](function(_0x4c252a){logger[_0xb510('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x55b393,_0x4c252a);_0xbc127a(_0x4c252a);});});} \ No newline at end of file +var _0x637c=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x637c,0x102));var _0xc637=function(_0x45da68,_0x132430){_0x45da68=_0x45da68-0x0;var _0x500b97=_0x637c[_0x45da68];return _0x500b97;};'use strict';var _=require(_0xc637('0x0'));var util=require(_0xc637('0x1'));var moment=require(_0xc637('0x2'));var BPromise=require(_0xc637('0x3'));var rs=require(_0xc637('0x4'));var fs=require('fs');var Redis=require(_0xc637('0x5'));var db=require(_0xc637('0x6'))['db'];var utils=require(_0xc637('0x7'));var logger=require(_0xc637('0x8'))(_0xc637('0x9'));var config=require(_0xc637('0xa'));var jayson=require(_0xc637('0xb'));var client=jayson[_0xc637('0xc')][_0xc637('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4cc4c0,_0x23c285,_0x538910){return new BPromise(function(_0x36522d,_0x3c8580){return client[_0xc637('0xe')](_0x4cc4c0,_0x538910)[_0xc637('0xf')](function(_0x4d36ac){logger['info'](_0xc637('0x10'),_0x23c285,_0xc637('0x11'));logger[_0xc637('0x12')](_0xc637('0x13'),_0x23c285,_0xc637('0x11'),JSON[_0xc637('0x14')](_0x4d36ac));if(_0x4d36ac[_0xc637('0x15')]){if(_0x4d36ac[_0xc637('0x15')][_0xc637('0x16')]===0x1f4){logger['error'](_0xc637('0x10'),_0x23c285,_0x4d36ac[_0xc637('0x15')]['message']);return _0x3c8580(_0x4d36ac[_0xc637('0x15')][_0xc637('0x17')]);}logger[_0xc637('0x15')](_0xc637('0x10'),_0x23c285,_0x4d36ac[_0xc637('0x15')][_0xc637('0x17')]);return _0x36522d(_0x4d36ac[_0xc637('0x15')][_0xc637('0x17')]);}else{logger[_0xc637('0x18')](_0xc637('0x10'),_0x23c285,_0xc637('0x11'));_0x36522d(_0x4d36ac['result']['message']);}})[_0xc637('0x19')](function(_0x4fc4bb){logger[_0xc637('0x15')](_0xc637('0x10'),_0x23c285,_0x4fc4bb);_0x3c8580(_0x4fc4bb);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 909c10d..32a578a 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 _0x61b9=['delete','destroy','removeSections','removeResources','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getSections','create','clone','post','addSections','put','update'];(function(_0x15c21d,_0x32c628){var _0x294b0b=function(_0x35b90f){while(--_0x35b90f){_0x15c21d['push'](_0x15c21d['shift']());}};_0x294b0b(++_0x32c628);}(_0x61b9,0x1f3));var _0x961b=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x61b9[_0x49a57c];return _0x4e0316;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x961b('0x0'));var timeout=require(_0x961b('0x1'));var express=require(_0x961b('0x2'));var router=express[_0x961b('0x3')]();var auth=require(_0x961b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x961b('0x5'));var controller=require(_0x961b('0x6'));router['get']('/',auth[_0x961b('0x7')](),controller[_0x961b('0x8')]);router[_0x961b('0x9')](_0x961b('0xa'),auth[_0x961b('0x7')](),controller[_0x961b('0xb')]);router[_0x961b('0x9')](_0x961b('0xc'),auth[_0x961b('0x7')](),controller[_0x961b('0xd')]);router[_0x961b('0x9')]('/:id/sections',auth[_0x961b('0x7')](),controller[_0x961b('0xe')]);router[_0x961b('0x9')]('/:id/resources',auth['isAuthenticated'](),controller['getResources']);router['post']('/',auth[_0x961b('0x7')](),controller[_0x961b('0xf')]);router['post']('/:id/clone',auth[_0x961b('0x7')](),controller[_0x961b('0x10')]);router[_0x961b('0x11')]('/:id/sections',auth['isAuthenticated'](),controller[_0x961b('0x12')]);router[_0x961b('0x11')]('/:id/resources',auth[_0x961b('0x7')](),controller['addResources']);router[_0x961b('0x13')]('/:id',auth[_0x961b('0x7')](),controller[_0x961b('0x14')]);router[_0x961b('0x15')](_0x961b('0xc'),auth[_0x961b('0x7')](),controller[_0x961b('0x16')]);router[_0x961b('0x15')]('/:id/sections',auth[_0x961b('0x7')](),controller[_0x961b('0x17')]);router[_0x961b('0x15')]('/:id/resources',auth[_0x961b('0x7')](),controller[_0x961b('0x18')]);module[_0x961b('0x19')]=router; \ No newline at end of file +var _0x1b28=['addSections','addResources','put','/:id','destroy','removeSections','delete','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id/sections','getSections','/:id/resources','getResources','create','post','/:id/clone','clone'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1b28,0x1c9));var _0x81b2=function(_0x4647e4,_0x465868){_0x4647e4=_0x4647e4-0x0;var _0x222985=_0x1b28[_0x4647e4];return _0x222985;};'use strict';var multer=require(_0x81b2('0x0'));var util=require(_0x81b2('0x1'));var path=require(_0x81b2('0x2'));var timeout=require(_0x81b2('0x3'));var express=require(_0x81b2('0x4'));var router=express[_0x81b2('0x5')]();var auth=require(_0x81b2('0x6'));var interaction=require(_0x81b2('0x7'));var config=require(_0x81b2('0x8'));var controller=require(_0x81b2('0x9'));router['get']('/',auth[_0x81b2('0xa')](),controller[_0x81b2('0xb')]);router[_0x81b2('0xc')](_0x81b2('0xd'),auth[_0x81b2('0xa')](),controller[_0x81b2('0xe')]);router[_0x81b2('0xc')]('/:id',auth[_0x81b2('0xa')](),controller['show']);router[_0x81b2('0xc')](_0x81b2('0xf'),auth[_0x81b2('0xa')](),controller[_0x81b2('0x10')]);router[_0x81b2('0xc')](_0x81b2('0x11'),auth['isAuthenticated'](),controller[_0x81b2('0x12')]);router['post']('/',auth[_0x81b2('0xa')](),controller[_0x81b2('0x13')]);router[_0x81b2('0x14')](_0x81b2('0x15'),auth[_0x81b2('0xa')](),controller[_0x81b2('0x16')]);router[_0x81b2('0x14')](_0x81b2('0xf'),auth[_0x81b2('0xa')](),controller[_0x81b2('0x17')]);router[_0x81b2('0x14')](_0x81b2('0x11'),auth[_0x81b2('0xa')](),controller[_0x81b2('0x18')]);router[_0x81b2('0x19')](_0x81b2('0x1a'),auth[_0x81b2('0xa')](),controller['update']);router['delete'](_0x81b2('0x1a'),auth[_0x81b2('0xa')](),controller[_0x81b2('0x1b')]);router['delete']('/:id/sections',auth['isAuthenticated'](),controller[_0x81b2('0x1c')]);router[_0x81b2('0x1d')]('/:id/resources',auth[_0x81b2('0xa')](),controller[_0x81b2('0x1e')]);module[_0x81b2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index f971561..3681388 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 _0x7c80=['join','getDataValue','crudPermissions','sequelize','exports','STRING','setDataValue'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x7c80,0xa4));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x07c8('0x0'));module[_0x07c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x07c8('0x2')],'set':function(_0x17fa86){this[_0x07c8('0x3')]('crudPermissions',_0x17fa86?_0x17fa86[_0x07c8('0x4')](''):[]);},'get':function(){return this[_0x07c8('0x5')](_0x07c8('0x6'))?this['getDataValue'](_0x07c8('0x6'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x7e05=['sequelize','exports','name','setDataValue','getDataValue','crudPermissions','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7e05,0x69));var _0x57e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7e05[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x57e0('0x0'));module[_0x57e0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57e0('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x387826){this[_0x57e0('0x3')]('crudPermissions',_0x387826?_0x387826['join'](''):[]);},'get':function(){return this[_0x57e0('0x4')](_0x57e0('0x5'))?this[_0x57e0('0x4')](_0x57e0('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x57e0('0x6')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 80f3d68..33bb00a 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 _0xf4a5=['autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sequelize','UserProfileSection','sectionId','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','order','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','default','custom','CustomReports','CmContact','Tags','color','tag','Tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','intervals','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','Trigger','trunks','variables','Plugin','extractedreports','Reports','metrics','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','socket.io-emitter','register','sendStatus','count','offset','limit','status','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','map','UserProfile','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','clone','get','omit','createdAt','updatedAt','transaction','each'];(function(_0x1b6e23,_0x3b3563){var _0x36205b=function(_0x8621a9){while(--_0x8621a9){_0x1b6e23['push'](_0x1b6e23['shift']());}};_0x36205b(++_0x3b3563);}(_0xf4a5,0x186));var _0x5f4a=function(_0x19fc44,_0x4bca56){_0x19fc44=_0x19fc44-0x0;var _0x3414ec=_0xf4a5[_0x19fc44];return _0x3414ec;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f4a('0x0'));var rimraf=require(_0x5f4a('0x1'));var zipdir=require(_0x5f4a('0x2'));var jsonpatch=require(_0x5f4a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5f4a('0x4'));var util=require(_0x5f4a('0x5'));var path=require('path');var sox=require(_0x5f4a('0x6'));var csv=require(_0x5f4a('0x7'));var ejs=require(_0x5f4a('0x8'));var fs=require('fs');var _=require(_0x5f4a('0x9'));var squel=require('squel');var crypto=require(_0x5f4a('0xa'));var jsforce=require(_0x5f4a('0xb'));var deskjs=require(_0x5f4a('0xc'));var toCsv=require(_0x5f4a('0x7'));var querystring=require(_0x5f4a('0xd'));var Papa=require(_0x5f4a('0xe'));var Redis=require('ioredis');var authService=require(_0x5f4a('0xf'));var qs=require(_0x5f4a('0x10'));var as=require(_0x5f4a('0x11'));var hardwareService=require(_0x5f4a('0x12'));var logger=require('../../config/logger')(_0x5f4a('0x13'));var utils=require(_0x5f4a('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5f4a('0x15')]=_['defaults'](config[_0x5f4a('0x15')],{'host':_0x5f4a('0x16'),'port':0x18eb});var socket=require(_0x5f4a('0x17'))(new Redis(config[_0x5f4a('0x15')]));require('./userProfile.socket')[_0x5f4a('0x18')](socket);function respondWithStatusCode(_0x2525b1,_0x5b4134){_0x5b4134=_0x5b4134||0xcc;return function(_0x4e2ef4){if(_0x4e2ef4){return _0x2525b1[_0x5f4a('0x19')](_0x5b4134);}return _0x2525b1['status'](_0x5b4134)['end']();};}function respondWithResult(_0x18781d,_0x530f04){_0x530f04=_0x530f04||0xc8;return function(_0x1c00ea){if(_0x1c00ea){return _0x18781d['status'](_0x530f04)['json'](_0x1c00ea);}};}function respondWithFilteredResult(_0x116a86,_0x2a7c83){return function(_0x38abf9){if(_0x38abf9){var _0x3b46ca=_0x38abf9[_0x5f4a('0x1a')],_0x41e4c8=_0x2a7c83[_0x5f4a('0x1b')],_0x44881b=_0x2a7c83[_0x5f4a('0x1b')]+_0x2a7c83[_0x5f4a('0x1c')],_0xabfe72;if(_0x44881b>=_0x3b46ca){_0x44881b=_0x3b46ca;_0xabfe72=0xc8;}else{_0xabfe72=0xce;}_0x116a86[_0x5f4a('0x1d')](_0xabfe72);return _0x116a86[_0x5f4a('0x1e')](_0x5f4a('0x1f'),_0x41e4c8+'-'+_0x44881b+'/'+_0x3b46ca)['json'](_0x38abf9);}return null;};}function patchUpdates(_0x2fb164){return function(_0x4fce70){try{jsonpatch[_0x5f4a('0x20')](_0x4fce70,_0x2fb164,!![]);}catch(_0x262c62){return BPromise['reject'](_0x262c62);}return _0x4fce70[_0x5f4a('0x21')]();};}function saveUpdates(_0xcd6725,_0x34d8fa){return function(_0xa724ce){if(_0xa724ce){return _0xa724ce[_0x5f4a('0x22')](_0xcd6725)['then'](function(_0x8cbc2d){return _0x8cbc2d;});}return null;};}function removeEntity(_0x18a558,_0x25f4ae){return function(_0x2f8614){if(_0x2f8614){return _0x2f8614[_0x5f4a('0x23')]()[_0x5f4a('0x24')](function(){_0x18a558['status'](0xcc)[_0x5f4a('0x25')]();});}};}function handleEntityNotFound(_0x334967,_0x5f3184){return function(_0x2ab16c){if(!_0x2ab16c){_0x334967['sendStatus'](0x194);}return _0x2ab16c;};}function handleError(_0x4bcd08,_0x46edfb){_0x46edfb=_0x46edfb||0x1f4;return function(_0x34c40e){logger[_0x5f4a('0x26')](_0x34c40e[_0x5f4a('0x27')]);if(_0x34c40e[_0x5f4a('0x28')]){delete _0x34c40e[_0x5f4a('0x28')];}_0x4bcd08[_0x5f4a('0x1d')](_0x46edfb)[_0x5f4a('0x29')](_0x34c40e);};}exports['index']=function(_0x4709aa,_0x459569){var _0x247099={},_0x1aa6fb={},_0x4c28d0={'count':0x0,'rows':[]};var _0x43a97f=_[_0x5f4a('0x2a')](db[_0x5f4a('0x2b')]['rawAttributes'],function(_0x15bc83){return{'name':_0x15bc83[_0x5f4a('0x2c')],'type':_0x15bc83[_0x5f4a('0x2d')][_0x5f4a('0x2e')]};});_0x1aa6fb[_0x5f4a('0x2f')]=_[_0x5f4a('0x2a')](_0x43a97f,_0x5f4a('0x28'));_0x1aa6fb['query']=_['keys'](_0x4709aa[_0x5f4a('0x30')]);_0x1aa6fb[_0x5f4a('0x31')]=_[_0x5f4a('0x32')](_0x1aa6fb[_0x5f4a('0x2f')],_0x1aa6fb[_0x5f4a('0x30')]);_0x247099[_0x5f4a('0x33')]=_[_0x5f4a('0x32')](_0x1aa6fb[_0x5f4a('0x2f')],qs[_0x5f4a('0x34')](_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x34')]));_0x247099[_0x5f4a('0x33')]=_0x247099['attributes'][_0x5f4a('0x35')]?_0x247099['attributes']:_0x1aa6fb[_0x5f4a('0x2f')];if(!_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x36')](_0x5f4a('0x37'))){_0x247099[_0x5f4a('0x1c')]=qs[_0x5f4a('0x1c')](_0x4709aa[_0x5f4a('0x30')]['limit']);_0x247099[_0x5f4a('0x1b')]=qs[_0x5f4a('0x1b')](_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x1b')]);}_0x247099['order']=qs[_0x5f4a('0x38')](_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x38')]);_0x247099[_0x5f4a('0x39')]=qs[_0x5f4a('0x31')](_[_0x5f4a('0x3a')](_0x4709aa[_0x5f4a('0x30')],_0x1aa6fb['filters']),_0x43a97f);if(_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x3b')]){_0x247099['where']=_[_0x5f4a('0x3c')](_0x247099['where'],{'$or':_[_0x5f4a('0x2a')](_0x43a97f,function(_0x3151ba){if(_0x3151ba[_0x5f4a('0x2d')]!==_0x5f4a('0x3d')){var _0x21a697={};_0x21a697[_0x3151ba['name']]={'$like':'%'+_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x3b')]+'%'};return _0x21a697;}})});}_0x247099=_[_0x5f4a('0x3c')]({},_0x247099,_0x4709aa[_0x5f4a('0x3e')]);var _0x38578e={'where':_0x247099[_0x5f4a('0x39')]};return db[_0x5f4a('0x2b')][_0x5f4a('0x1a')](_0x38578e)[_0x5f4a('0x24')](function(_0xdc35c7){_0x4c28d0[_0x5f4a('0x1a')]=_0xdc35c7;if(_0x4709aa[_0x5f4a('0x30')][_0x5f4a('0x3f')]){_0x247099[_0x5f4a('0x40')]=[{'all':!![]}];}return db[_0x5f4a('0x2b')][_0x5f4a('0x41')](_0x247099);})['then'](function(_0x2ae3a2){_0x4c28d0[_0x5f4a('0x42')]=_0x2ae3a2;return _0x4c28d0;})[_0x5f4a('0x24')](respondWithFilteredResult(_0x459569,_0x247099))[_0x5f4a('0x43')](handleError(_0x459569,null));};exports[_0x5f4a('0x44')]=function(_0x446c05,_0x184e75){var _0xe2bfb6={'raw':![],'where':{'id':_0x446c05[_0x5f4a('0x45')]['id']}},_0x288568={};_0x288568[_0x5f4a('0x2f')]=_[_0x5f4a('0x46')](db[_0x5f4a('0x2b')][_0x5f4a('0x47')]);_0x288568[_0x5f4a('0x30')]=_['keys'](_0x446c05[_0x5f4a('0x30')]);_0x288568[_0x5f4a('0x31')]=_[_0x5f4a('0x32')](_0x288568[_0x5f4a('0x2f')],_0x288568[_0x5f4a('0x30')]);_0xe2bfb6[_0x5f4a('0x33')]=_['intersection'](_0x288568[_0x5f4a('0x2f')],qs[_0x5f4a('0x34')](_0x446c05[_0x5f4a('0x30')][_0x5f4a('0x34')]));_0xe2bfb6['attributes']=_0xe2bfb6[_0x5f4a('0x33')]['length']?_0xe2bfb6['attributes']:_0x288568[_0x5f4a('0x2f')];if(_0x446c05[_0x5f4a('0x30')]['includeAll']){_0xe2bfb6[_0x5f4a('0x40')]=[{'all':!![]}];}_0xe2bfb6=_['merge']({},_0xe2bfb6,_0x446c05[_0x5f4a('0x3e')]);return db[_0x5f4a('0x2b')][_0x5f4a('0x48')](_0xe2bfb6)[_0x5f4a('0x24')](handleEntityNotFound(_0x184e75,null))[_0x5f4a('0x24')](respondWithResult(_0x184e75,null))['catch'](handleError(_0x184e75,null));};exports[_0x5f4a('0x49')]=function(_0x52ab64,_0x1e84d7){return db['UserProfile']['create'](_0x52ab64[_0x5f4a('0x4a')],{})[_0x5f4a('0x24')](respondWithResult(_0x1e84d7,0xc9))[_0x5f4a('0x43')](handleError(_0x1e84d7,null));};exports[_0x5f4a('0x4b')]=function(_0x4a2a99,_0x324d5c){var _0x57c870={'where':{'id':_0x4a2a99[_0x5f4a('0x45')]['id']}},_0x20e356={};_0x20e356[_0x5f4a('0x2f')]=_['keys'](db['UserProfile']['rawAttributes']);_0x57c870[_0x5f4a('0x33')]=_['intersection'](_0x20e356[_0x5f4a('0x2f')],qs[_0x5f4a('0x34')](_0x4a2a99[_0x5f4a('0x30')]['fields']));_0x57c870['attributes']=_0x57c870[_0x5f4a('0x33')][_0x5f4a('0x35')]?_0x57c870['attributes']:_0x20e356[_0x5f4a('0x2f')];if(_0x4a2a99[_0x5f4a('0x30')][_0x5f4a('0x3f')]){_0x57c870[_0x5f4a('0x40')]=[{'all':!![]}];}_0x57c870=_[_0x5f4a('0x3c')]({},_0x57c870,_0x4a2a99[_0x5f4a('0x3e')]);return db[_0x5f4a('0x2b')][_0x5f4a('0x48')](_0x57c870)[_0x5f4a('0x24')](handleEntityNotFound(_0x324d5c,null))['then'](function(_0x11b760){if(_0x11b760){var _0x516cbb=_0x11b760[_0x5f4a('0x4c')]({'plain':!![]});_0x516cbb=qs[_0x5f4a('0x4d')](_0x516cbb,['id',_0x5f4a('0x4e'),'updatedAt','crudPermissions']);_0x4a2a99['body']=_[_0x5f4a('0x4d')](_0x4a2a99[_0x5f4a('0x4a')],['id',_0x5f4a('0x4e'),_0x5f4a('0x4f')]);return db['sequelize'][_0x5f4a('0x50')](function(_0x25d3f0){return db['UserProfile'][_0x5f4a('0x49')](_[_0x5f4a('0x3c')](_0x516cbb,_0x4a2a99[_0x5f4a('0x4a')]),{'include':_0x4a2a99[_0x5f4a('0x30')][_0x5f4a('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x25d3f0})['then'](function(_0x3c5fef){var _0xa619f=_0x3c5fef[_0x5f4a('0x4c')]({'plain':!![]});return db['UserProfileSection'][_0x5f4a('0x41')]({'where':{'userProfileId':_0x4a2a99[_0x5f4a('0x45')]['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x3a5def){if(_0x3a5def){return BPromise[_0x5f4a('0x51')](_0x3a5def,function(_0x1c19ff){return new BPromise(function(_0x96c915,_0x5612a8){if(_0x1c19ff[_0x5f4a('0x52')]===null||_0x1c19ff[_0x5f4a('0x52')]===0x1)_0x96c915(null);return db[_0x5f4a('0x53')][_0x5f4a('0x41')]({'where':{'sectionId':_0x1c19ff['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x17be42){var _0x426c01=_[_0x5f4a('0x2a')](_0x17be42,function(_0x431eb7){return qs['omit'](_0x431eb7,['id',_0x5f4a('0x4e'),'updatedAt','sectionId']);});_0x96c915(_0x426c01);})[_0x5f4a('0x43')](function(_0x171422){_0x5612a8(_0x171422);});})[_0x5f4a('0x24')](function(_0x196cbe){var _0x5a8905=qs[_0x5f4a('0x4d')](_0x1c19ff,['id',_0x5f4a('0x4e'),'updatedAt']);_0x5a8905[_0x5f4a('0x54')]=_0xa619f['id'];if(_0x196cbe)_0x5a8905[_0x5f4a('0x55')]=_0x196cbe;return _0x5a8905;})[_0x5f4a('0x24')](function(_0x3f56c5){return db['UserProfileSection']['create'](_0x3f56c5,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x25d3f0});});})[_0x5f4a('0x24')](function(){return _0xa619f;});}});});});}})[_0x5f4a('0x24')](respondWithResult(_0x324d5c,0xc9))[_0x5f4a('0x43')](handleError(_0x324d5c,null));};exports[_0x5f4a('0x22')]=function(_0x12cda3,_0x50cd1f){if(_0x12cda3[_0x5f4a('0x4a')]['id']){delete _0x12cda3[_0x5f4a('0x4a')]['id'];}return db[_0x5f4a('0x2b')][_0x5f4a('0x48')]({'where':{'id':_0x12cda3[_0x5f4a('0x45')]['id']}})[_0x5f4a('0x24')](handleEntityNotFound(_0x50cd1f,null))[_0x5f4a('0x24')](saveUpdates(_0x12cda3[_0x5f4a('0x4a')],null))[_0x5f4a('0x24')](respondWithResult(_0x50cd1f,null))[_0x5f4a('0x43')](handleError(_0x50cd1f,null));};exports['destroy']=function(_0x48e4a1,_0x3dc521){return db['UserProfile'][_0x5f4a('0x48')]({'where':{'id':_0x48e4a1[_0x5f4a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3dc521,null))['then'](removeEntity(_0x3dc521,null))[_0x5f4a('0x43')](handleError(_0x3dc521,null));};exports[_0x5f4a('0x56')]=function(_0x1bdd87,_0x4ba851){return db[_0x5f4a('0x2b')][_0x5f4a('0x56')]()['then'](respondWithResult(_0x4ba851,null))[_0x5f4a('0x43')](handleError(_0x4ba851,null));};exports[_0x5f4a('0x57')]=function(_0x569d76,_0xa4f304){var _0x5b83e4=_0x569d76[_0x5f4a('0x4a')];return db['UserProfile'][_0x5f4a('0x48')]({'where':{'id':_0x569d76['params']['id']}})['then'](handleEntityNotFound(_0xa4f304,null))['then'](function(_0x51f6fd){if(_0x51f6fd){return db[_0x5f4a('0x58')][_0x5f4a('0x50')](function(_0x47a3c8){return db[_0x5f4a('0x59')][_0x5f4a('0x23')]({'where':{'userProfileId':_0x569d76[_0x5f4a('0x45')]['id'],'sectionId':_[_0x5f4a('0x2a')](_0x5b83e4,function(_0x58f77d){return _0x58f77d[_0x5f4a('0x5a')];})},'transaction':_0x47a3c8})[_0x5f4a('0x24')](function(){var _0x4e1f45=_[_0x5f4a('0x2a')](_0x5b83e4,function(_0x2d071f){_0x2d071f[_0x5f4a('0x54')]=_0x569d76[_0x5f4a('0x45')]['id'];return _0x2d071f;});var _0x4e7cef=[];return BPromise[_0x5f4a('0x51')](_0x4e1f45,function(_0x154a81){return db[_0x5f4a('0x59')][_0x5f4a('0x49')](_0x154a81,{'include':[{'model':db['UserProfileResource'],'as':_0x5f4a('0x55')}],'raw':!![],'transaction':_0x47a3c8})[_0x5f4a('0x24')](function(_0x5e0d77){_0x4e7cef['push'](_0x5e0d77[_0x5f4a('0x4c')]({'plain':!![]}));});})[_0x5f4a('0x24')](function(){return _0x4e7cef;});});});}})['then'](function(_0x57bb2d){return _0x57bb2d;})[_0x5f4a('0x24')](respondWithResult(_0xa4f304,null))[_0x5f4a('0x43')](handleError(_0xa4f304,null));};exports['removeSections']=function(_0x30b432,_0x58b132){var _0x245b24;return db[_0x5f4a('0x2b')][_0x5f4a('0x48')]({'where':{'id':_0x30b432[_0x5f4a('0x45')]['id']},'attributes':['id',_0x5f4a('0x28')]})[_0x5f4a('0x24')](handleEntityNotFound(_0x58b132,null))[_0x5f4a('0x24')](function(_0x1889a2){if(_0x1889a2){_0x245b24=_0x1889a2;return db[_0x5f4a('0x59')][_0x5f4a('0x23')]({'where':{'userProfileId':_0x30b432['params']['id'],'sectionId':_0x30b432[_0x5f4a('0x30')][_0x5f4a('0x5b')]}});}})['then'](function(){return _0x245b24;})[_0x5f4a('0x24')](respondWithStatusCode(_0x58b132,null))[_0x5f4a('0x43')](handleError(_0x58b132,null));};exports[_0x5f4a('0x5c')]=function(_0x488b33,_0x55476e){var _0x7a048d=[];var _0xe256f4=[];return db[_0x5f4a('0x59')]['findAll']({'where':{'userProfileId':_0x488b33[_0x5f4a('0x45')]['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x2f7410){_0x7a048d=_[_0x5f4a('0x3b')](_0x2f7410,function(_0x26436f){return _0x26436f[_0x5f4a('0x5d')]===0x1||_[_0x5f4a('0x5e')]([0x3eb,0x709],_0x26436f[_0x5f4a('0x5a')]);});if(!_[_0x5f4a('0x5f')](_0x7a048d)){return _['map'](_0x7a048d,function(_0x1c5715){return _0x1c5715[_0x5f4a('0x5a')];});}else{return;}})['then'](function(_0x292397){if(_0x292397)_0xe256f4=_0x292397;if(_[_0x5f4a('0x5e')](_0xe256f4,0x64)){var _0x27ca6a=_['find'](_0x7a048d,{'sectionId':0x64});return hasDefaultDashboard(_0x27ca6a)[_0x5f4a('0x24')](function(_0x4593ab){return _[_0x5f4a('0x2a')](_0x7a048d,function(_0x3b7d2d){if(_0x3b7d2d['sectionId']===0x64){_0x3b7d2d[_0x5f4a('0x60')]=_0x4593ab;}return _0x3b7d2d;});});}else{return;}})['then'](function(_0x5e8d47){if(_0x5e8d47)_0x7a048d=_0x5e8d47;if(_[_0x5f4a('0x5e')](_0xe256f4,0x3eb)){var _0x1e8722=_['find'](_0x7a048d,{'sectionId':0x3eb});return getCustomDashboards(_0x1e8722)[_0x5f4a('0x24')](function(_0x16c163){return _[_0x5f4a('0x2a')](_0x7a048d,function(_0x33328a){if(_0x1e8722[_0x5f4a('0x5d')]){if(_0x33328a['sectionId']===0x3eb){_0x33328a['subsections']=_0x16c163;}}else{if(_0x33328a[_0x5f4a('0x5a')]===0x64){_0x33328a['subsections']=_0x16c163;}}return _0x33328a;});});}else{return;}})[_0x5f4a('0x24')](function(_0x24ae2e){if(_0x24ae2e)_0x7a048d=_0x24ae2e;if(_[_0x5f4a('0x5e')](_0xe256f4,0x709)){var _0x52b2fb=_[_0x5f4a('0x48')](_0x7a048d,{'sectionId':0x709});return getPlugins(_0x52b2fb)[_0x5f4a('0x24')](function(_0x343add){if(_0x52b2fb[_0x5f4a('0x5d')]){return _[_0x5f4a('0x2a')](_0x7a048d,function(_0x3d7189){if(_0x3d7189['sectionId']===0x709){_0x3d7189[_0x5f4a('0x60')]=_0x343add;}return _0x3d7189;});}else{var _0x52bb41={'sectionId':0x76c,'enabled':0x1,'subsections':_0x343add};var _0x191e1f=_['map'](_0x7a048d);_0x191e1f[_0x5f4a('0x61')](_0x52bb41);return _0x191e1f;}});}else{return;}})['then'](function(_0x11506b){if(_0x11506b)_0x7a048d=_0x11506b;return _['filter'](_0x7a048d,[_0x5f4a('0x5d'),0x1]);})[_0x5f4a('0x24')](respondWithResult(_0x55476e,null))[_0x5f4a('0x43')](handleError(_0x55476e,null));};function hasDefaultDashboard(_0x11f163){var _0x5bbc15=[0x65];return new BPromise(function(_0x2c9ce3,_0xe94459){try{if(_0x11f163['autoAssociation']){_0x2c9ce3(_0x5bbc15);}else{return db[_0x5f4a('0x53')][_0x5f4a('0x62')]({'where':{'sectionId':_0x11f163['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x58c4bf){_0x58c4bf?_0x2c9ce3(_0x5bbc15):_0x2c9ce3();});}}catch(_0x3379d2){_0xe94459(_0x3379d2);}});}function getCustomDashboards(_0x584da4){var _0x5df52e=[];return new BPromise(function(_0x3a353d,_0x519e76){try{if(_0x584da4[_0x5f4a('0x52')]){return db['Dashboard'][_0x5f4a('0x41')]({'raw':!![]})[_0x5f4a('0x24')](function(_0x49f902){_0x49f902[_0x5f4a('0x63')](function(_0xdba1ac){_0x5df52e[_0x5f4a('0x61')](_0xdba1ac['id']+0x1869f);});_0x3a353d(_0x5df52e);});}else{return db[_0x5f4a('0x53')]['findAll']({'where':{'sectionId':_0x584da4['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x128c0f){_0x128c0f[_0x5f4a('0x63')](function(_0x19ffc3){_0x5df52e[_0x5f4a('0x61')](_0x19ffc3[_0x5f4a('0x64')]+0x1869f);});_0x3a353d(_0x5df52e);});}}catch(_0x521219){_0x519e76(_0x521219);}});}function getPlugins(_0x5081d1){var _0x227bd5=[];return new BPromise(function(_0x36aee7,_0x2ef293){try{if(_0x5081d1[_0x5f4a('0x52')]){return db['Plugin'][_0x5f4a('0x41')]({'raw':!![]})['then'](function(_0x840260){_0x840260[_0x5f4a('0x63')](function(_0x18311b){_0x227bd5[_0x5f4a('0x61')](_0x18311b['id']+0x15b38);});_0x36aee7(_0x227bd5);});}else{return db[_0x5f4a('0x53')][_0x5f4a('0x41')]({'where':{'sectionId':_0x5081d1['id']},'raw':!![]})['then'](function(_0x5d3e98){_0x5d3e98[_0x5f4a('0x63')](function(_0x270616){_0x227bd5[_0x5f4a('0x61')](_0x270616[_0x5f4a('0x64')]+0x15b38);});_0x36aee7(_0x227bd5);});}}catch(_0x3bbab4){_0x2ef293(_0x3bbab4);}});}exports[_0x5f4a('0x65')]=function(_0x13a514,_0x3553ec){return db[_0x5f4a('0x2b')][_0x5f4a('0x48')]({'where':{'id':_0x13a514[_0x5f4a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3553ec,null))[_0x5f4a('0x24')](function(_0xddb8a7){if(_0xddb8a7){return db[_0x5f4a('0x58')][_0x5f4a('0x50')](function(_0x3e7c9d){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x13a514[_0x5f4a('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0x5f4a('0x24')](function(_0x136337){if(_0x136337){return db[_0x5f4a('0x59')]['destroy']({'where':{'userProfileId':_0x13a514[_0x5f4a('0x45')]['id'],'id':_['map'](_0x136337,function(_0xe24d60){return _0xe24d60['id'];})},'transaction':_0x3e7c9d});}})['then'](function(_0x1b8f6f){var _0x3cf35f=_[_0x5f4a('0x2a')](_0x13a514[_0x5f4a('0x4a')],function(_0x238c43){_0x238c43['userProfileId']=_0x13a514[_0x5f4a('0x45')]['id'];return _0x238c43;});return db['UserProfileSection'][_0x5f4a('0x66')](_0x3cf35f,{'raw':!![],'transaction':_0x3e7c9d});})[_0x5f4a('0x24')](function(_0x3b613e){var _0x1164af=_['filter'](_['map'](_0x3b613e,function(_0x23715b){return _0x23715b[_0x5f4a('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x1164af){return db[_0x5f4a('0x59')][_0x5f4a('0x41')]({'where':{'userProfileId':_0x13a514[_0x5f4a('0x45')]['id'],'sectionId':_[_0x5f4a('0x2a')](_0x1164af,function(_0x14b527){return _0x14b527[_0x5f4a('0x5a')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x5f4a('0x24')](function(_0x1d45ef){var _0x36dec3=_[_0x5f4a('0x2a')](_0x13a514['body'],function(_0x58a39e){_0x58a39e[_0x5f4a('0x54')]=_0x13a514[_0x5f4a('0x45')]['id'];return _0x58a39e;});return db[_0x5f4a('0x53')][_0x5f4a('0x66')](_0x36dec3,{'raw':!![],'transaction':_0x3e7c9d});});}})[_0x5f4a('0x43')](handleError(_0x3553ec,null));});}})[_0x5f4a('0x24')](function(_0x1bc595){var _0x4e313d=_[_0x5f4a('0x2a')](_0x1bc595,function(_0x5bc685){return _0x5bc685[_0x5f4a('0x4c')]({'plain':!![]});});})[_0x5f4a('0x24')](respondWithResult(_0x3553ec,null))[_0x5f4a('0x43')](handleError(_0x3553ec,null));};exports[_0x5f4a('0x67')]=function(_0x197ece,_0x460d4c,_0x39f783){return db[_0x5f4a('0x2b')][_0x5f4a('0x48')]({'where':{'id':_0x197ece['params']['id']}})[_0x5f4a('0x24')](handleEntityNotFound(_0x460d4c,null))['then'](function(_0x2630ab){if(_0x2630ab){return _0x2630ab['removeResources'](_0x197ece['query']['ids']);}})[_0x5f4a('0x24')](respondWithStatusCode(_0x460d4c,null))[_0x5f4a('0x43')](handleError(_0x460d4c,null));};exports[_0x5f4a('0x68')]=function(_0x1f3b0b,_0x401999){var _0x164db8={'raw':![],'where':{}};var _0x2ac00c={};var _0xffc17a={'count':0x0,'rows':[]};var _0x418192=_0x1f3b0b[_0x5f4a('0x30')]['section'];if(typeof _0x418192===_0x5f4a('0x69')){throw new db[(_0x5f4a('0x6a'))][(_0x5f4a('0x6b'))](_0x5f4a('0x6c'));}var _0x130eef=_0x1f3b0b['query'][_0x5f4a('0x6d')]||![];var _0x409334=getQueryModels(_0x418192,_0x130eef);if(typeof _0x409334[_0x5f4a('0x6e')]===_0x5f4a('0x69')){throw new db[(_0x5f4a('0x6a'))][(_0x5f4a('0x6b'))](_0x5f4a('0x6f')+_0x418192+'\x27');}var _0x565794=[];if(!_[_0x5f4a('0x5f')](_0x409334[_0x5f4a('0x70')])){_0x565794=_0x409334[_0x5f4a('0x70')];}else{_0x565794=[{'name':_0x418192}];}return db['UserProfile'][_0x5f4a('0x62')]({'where':{'id':_0x1f3b0b[_0x5f4a('0x45')]['id']}})[_0x5f4a('0x24')](handleEntityNotFound(_0x401999,null))[_0x5f4a('0x24')](function(_0x4c179a){if(_0x4c179a){var _0x2abbe6=[];for(var _0x3fc8f0=0x0;_0x3fc8f0<_0x565794[_0x5f4a('0x35')];_0x3fc8f0++){_0x2abbe6['push'](db[_0x5f4a('0x59')]['findOne']({'where':{'userProfileId':_0x4c179a['id'],'name':_0x565794[_0x3fc8f0][_0x5f4a('0x28')]},'raw':!![]}));}return BPromise[_0x5f4a('0x71')](_0x2abbe6);}})['then'](function(_0xc4212f){var _0x487a13=_[_0x5f4a('0x3b')](_0xc4212f,function(_0x3e3a38){return _0x3e3a38?_0x3e3a38:undefined;});var _0x59a3bd=_[_0x5f4a('0x3b')](_0x565794,[_0x5f4a('0x72'),!![]]);var _0x1f3781=_[_0x5f4a('0x5f')](_0x487a13)&&_['isEmpty'](_0x59a3bd)?null:_['union'](_0x59a3bd,_0x487a13);if(_0x1f3781){var _0x4f66ee=[];for(var _0x32549d=0x0;_0x32549d<_0x1f3781[_0x5f4a('0x35')];_0x32549d++){var _0x508e2c=_[_0x5f4a('0x48')](_0x565794,function(_0x1e8ce8){return _0x1f3781[_0x32549d]?_0x1e8ce8[_0x5f4a('0x28')]===_0x1f3781[_0x32549d]['name']:null;});if(_0x508e2c){if(_0x1f3781[_0x32549d][_0x5f4a('0x72')]){_0x4f66ee[_0x5f4a('0x61')](getAllResources(_0x409334[_0x5f4a('0x6e')],_0x1f3781[_0x32549d]));}else{if(!_0x1f3781[_0x32549d]['autoAssociation']){_0x4f66ee[_0x5f4a('0x61')](getAllowedResources(_0x508e2c,_0x1f3781[_0x32549d],_0x409334['childModel']));}else{if(_0x508e2c[_0x5f4a('0x2f')]){_0x4f66ee['push'](getAllFilteredResources(_0x508e2c,_0x1f3781[_0x32549d]));}}}}}return BPromise['all'](_0x4f66ee);}else{return null;}})[_0x5f4a('0x24')](function(_0x18d07c){var _0x22b4f0=_0x18d07c;var _0x3d7985=null;if(_0x22b4f0){_0x3d7985=_0x22b4f0[_0x5f4a('0x35')]===0x1?_0x22b4f0[0x0]:null;}if(_0x3d7985||_0x22b4f0){var _0x24fc08=db[_0x409334[_0x5f4a('0x6e')]]['rawAttributes'];_0x2ac00c[_0x5f4a('0x2f')]=_['keys'](_0x24fc08);_0x2ac00c[_0x5f4a('0x30')]=_[_0x5f4a('0x46')](_0x1f3b0b[_0x5f4a('0x30')]);_0x2ac00c[_0x5f4a('0x31')]=_[_0x5f4a('0x32')](_0x2ac00c[_0x5f4a('0x2f')],_0x2ac00c[_0x5f4a('0x30')]);_0x164db8[_0x5f4a('0x33')]=_[_0x5f4a('0x32')](_0x2ac00c['model'],qs[_0x5f4a('0x34')](_0x1f3b0b[_0x5f4a('0x30')]['fields']));_0x164db8[_0x5f4a('0x33')]=_0x164db8[_0x5f4a('0x33')]['length']?_0x164db8[_0x5f4a('0x33')]:_0x2ac00c[_0x5f4a('0x2f')];if(!_0x1f3b0b['query'][_0x5f4a('0x36')](_0x5f4a('0x37'))){_0x164db8[_0x5f4a('0x1c')]=qs[_0x5f4a('0x1c')](_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x1c')]);_0x164db8[_0x5f4a('0x1b')]=qs[_0x5f4a('0x1b')](_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x1b')]);}_0x164db8[_0x5f4a('0x73')]=qs['sort'](_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x38')]);_0x164db8['where']=qs['filters'](_[_0x5f4a('0x3a')](_0x1f3b0b[_0x5f4a('0x30')],_0x2ac00c[_0x5f4a('0x31')]));if(_0x1f3b0b[_0x5f4a('0x30')]['filter']){_0x164db8['where']=_[_0x5f4a('0x3c')](_0x164db8[_0x5f4a('0x39')],{'$or':_[_0x5f4a('0x2a')](_0x24fc08,function(_0xc961e){if(_0xc961e[_0x5f4a('0x2d')]['key']!==_0x5f4a('0x3d')){var _0x1f6dc9={};_0x1f6dc9[_0xc961e[_0x5f4a('0x74')]]={'$like':'%'+_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x3b')]+'%'};return _0x1f6dc9;}})});}var _0x3e7c6d=[];if(_0x3d7985){var _0x424958=_[_0x5f4a('0x48')](_0x565794,[_0x5f4a('0x28'),_0x3d7985[_0x5f4a('0x28')]]);if(_0x424958['field']){var _0x1837ce={};if(_0x409334['childModel']===_0x5f4a('0x75')){_0x1837ce[_0x424958['foreignKey']]=_['map'](_0x3d7985[_0x5f4a('0x76')],'id');}else{_0x1837ce[_0x424958['foreignKey']]=_0x3d7985[_0x5f4a('0x76')];}_0x3e7c6d[_0x5f4a('0x61')](_0x1837ce);}else{_0x164db8['where']['id']=_0x3d7985[_0x5f4a('0x76')];}}else{for(var _0x2eacfc=0x0;_0x2eacfc<_0x22b4f0['length'];_0x2eacfc++){var _0x424958=_[_0x5f4a('0x48')](_0x565794,[_0x5f4a('0x28'),_0x22b4f0[_0x2eacfc]['name']]);if(_0x424958[_0x5f4a('0x74')]){var _0x1837ce={};_0x1837ce[_0x424958[_0x5f4a('0x77')]]=_0x22b4f0[_0x2eacfc][_0x5f4a('0x76')];_0x3e7c6d[_0x5f4a('0x61')](_0x1837ce);}else{if(!_0x164db8['where']['id'])_0x164db8['where']['id']=[];_0x22b4f0[_0x2eacfc][_0x5f4a('0x76')][_0x5f4a('0x63')](function(_0x2d4944){_0x164db8[_0x5f4a('0x39')]['id'][_0x5f4a('0x61')](_0x2d4944);});}}}if(!_[_0x5f4a('0x5f')](_0x3e7c6d)){_0x164db8['where']=_[_0x5f4a('0x3c')](_0x164db8['where'],{'$and':{'$or':_0x3e7c6d}});}_0x164db8=_[_0x5f4a('0x3c')]({},_0x164db8,_0x1f3b0b[_0x5f4a('0x3e')]);if(_0x3d7985&&!_0x3d7985[_0x5f4a('0x52')]&&_0x409334[_0x5f4a('0x6e')]===_0x5f4a('0x75')){if(_0x1f3b0b['query'][_0x5f4a('0x3f')]){_0x164db8[_0x5f4a('0x40')]=[{'all':!![]}];}return db[_0x409334[_0x5f4a('0x6e')]]['findAll'](_0x164db8)['then'](function(_0x4ded52){var _0x3764be=[];_0x4ded52[_0x5f4a('0x63')](function(_0x31d545){var _0x551571;switch(_0x31d545[_0x5f4a('0x78')]){case _0x5f4a('0x79'):_0x551571=_[_0x5f4a('0x48')](_0x3d7985[_0x5f4a('0x76')],function(_0x20c6f6){return _0x20c6f6['id']===_0x31d545['reportId']&&_0x20c6f6[_0x5f4a('0x2d')]==='DefaultReports';});break;case _0x5f4a('0x7a'):_0x551571=_[_0x5f4a('0x48')](_0x3d7985[_0x5f4a('0x76')],function(_0x3f846c){return _0x3f846c['id']===_0x31d545['reportId']&&_0x3f846c['type']===_0x5f4a('0x7b');});break;}if(_0x551571)_0x3764be[_0x5f4a('0x61')](_0x31d545);});_0xffc17a[_0x5f4a('0x1a')]=_0x3764be[_0x5f4a('0x35')];_0xffc17a[_0x5f4a('0x42')]=_0x3764be;return _0xffc17a;});}else{return db[_0x409334[_0x5f4a('0x6e')]]['count']({'where':_0x164db8[_0x5f4a('0x39')]})[_0x5f4a('0x24')](function(_0x51b5ce){_0xffc17a[_0x5f4a('0x1a')]=_0x51b5ce;if(_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x3f')]){if(_0x409334[_0x5f4a('0x6e')]===_0x5f4a('0x7c')){_0x164db8[_0x5f4a('0x40')]=[{'model':db['Tag'],'as':_0x5f4a('0x7d'),'attributes':['id','name',_0x5f4a('0x7e')],'required':_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x7f')]?!![]:![]},{'model':db[_0x5f4a('0x80')],'as':_0x5f4a('0x81'),'attributes':['id',_0x5f4a('0x28'),'color'],'through':_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x7f')]?{'attributes':[],'where':{'TagId':_0x1f3b0b[_0x5f4a('0x30')][_0x5f4a('0x7f')]||undefined}}:{},'required':_0x1f3b0b[_0x5f4a('0x30')]['tag']?!![]:![]}];}else{_0x164db8[_0x5f4a('0x40')]=[{'all':!![]}];}}return db[_0x409334[_0x5f4a('0x6e')]][_0x5f4a('0x41')](_0x164db8);})[_0x5f4a('0x24')](function(_0xba0777){_0xffc17a[_0x5f4a('0x42')]=_0xba0777;return _0xffc17a;});}}else{return _0xffc17a;}})[_0x5f4a('0x24')](respondWithFilteredResult(_0x401999,_0x164db8))[_0x5f4a('0x43')](handleError(_0x401999,null));};function getAllResources(_0x132923,_0x322ae4){return new BPromise(function(_0x38ed43,_0x420241){if(_0x322ae4){var _0x14d829=_0x322ae4[_0x5f4a('0x3b')]?{[_0x322ae4[_0x5f4a('0x3b')][_0x5f4a('0x74')]]:_0x322ae4[_0x5f4a('0x3b')][_0x5f4a('0x82')]}:undefined;return db[_0x132923][_0x5f4a('0x41')]({'where':_0x14d829,'raw':!![]})[_0x5f4a('0x24')](function(_0x3221a1){_0x322ae4[_0x5f4a('0x76')]=_[_0x5f4a('0x2a')](_0x3221a1,'id');_0x38ed43(_0x322ae4);})[_0x5f4a('0x43')](function(_0x5ccc3a){_0x420241(_0x5ccc3a);});}else{_0x38ed43(null);}});}function getAllFilteredResources(_0xe711fd,_0x932c5f){return new BPromise(function(_0x336f7c,_0x4dc0e8){var _0x344950=_0xe711fd[_0x5f4a('0x3b')]?{[_0xe711fd['filter'][_0x5f4a('0x74')]]:_0xe711fd[_0x5f4a('0x3b')][_0x5f4a('0x82')]}:undefined;return db[_0xe711fd[_0x5f4a('0x2f')]][_0x5f4a('0x41')]({'where':_0x344950,'raw':!![]})['then'](function(_0x51930c){_0x932c5f[_0x5f4a('0x76')]=_['map'](_0x51930c,function(_0x5c448b){return _0x5c448b[_0x5f4a('0x28')];});_0x336f7c(_0x932c5f);})[_0x5f4a('0x43')](function(_0x11c699){_0x4dc0e8(_0x11c699);});});}function getAllowedResources(_0x497135,_0x3ef1d7,_0x39dcaa){return new BPromise(function(_0xd1ad52,_0x696cb4){if(_0x3ef1d7){return db[_0x5f4a('0x53')][_0x5f4a('0x41')]({'where':{'sectionId':_0x3ef1d7['id']},'raw':!![]})[_0x5f4a('0x24')](function(_0x3da0da){if(_0x497135[_0x5f4a('0x74')]&&_0x497135[_0x5f4a('0x74')]!=='id'){_0x3ef1d7['associatedResources']=_[_0x5f4a('0x2a')](_0x3da0da,function(_0x3e50ee){return _0x3e50ee[_0x497135['field']];});}else{if(_0x39dcaa===_0x5f4a('0x75')){_0x3ef1d7[_0x5f4a('0x76')]=_[_0x5f4a('0x2a')](_0x3da0da,function(_0xe68749){return{'id':_0xe68749[_0x5f4a('0x64')],'type':_0xe68749[_0x5f4a('0x2d')]};});}else{_0x3ef1d7[_0x5f4a('0x76')]=_[_0x5f4a('0x2a')](_0x3da0da,function(_0x50de82){return _0x50de82['resourceId'];});}}_0xd1ad52(_0x3ef1d7);})[_0x5f4a('0x43')](function(_0x14d4c3){_0x696cb4(_0x14d4c3);});}else{_0xd1ad52(null);}});}function getQueryModels(_0x1481dc,_0x3ceaeb){var _0x8d0052=_0x1481dc[_0x5f4a('0x83')]();var _0x4c9c72={'childModel':undefined,'parentSections':[]};switch(_0x8d0052){case _0x5f4a('0x84'):_0x4c9c72['childModel']=_0x5f4a('0x85');break;case _0x5f4a('0x86'):_0x4c9c72['childModel']='SquareOdbc';break;case _0x5f4a('0x87'):_0x4c9c72['childModel']='SquareRecording';_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0x88'),'field':_0x5f4a('0x28'),'foreignKey':_0x5f4a('0x89')}];break;case'projects':_0x4c9c72['childModel']=_0x5f4a('0x8a');break;case _0x5f4a('0x8b'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x7c');_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0x8c'),'field':'id','foreignKey':_0x5f4a('0x8d')}];break;case'lists':_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x8e');break;case _0x5f4a('0x8f'):_0x4c9c72[_0x5f4a('0x6e')]='CmCompany';break;case _0x5f4a('0x90'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x91');break;case _0x5f4a('0x92'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x93');break;case _0x5f4a('0x94'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x95');break;case _0x5f4a('0x96'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x97');break;case _0x5f4a('0x98'):_0x4c9c72[_0x5f4a('0x6e')]='FaxAccount';break;case'inboundroutes':case _0x5f4a('0x99'):case'outboundroutes':_0x4c9c72['childModel']='VoiceExtension';break;case _0x5f4a('0x9a'):_0x4c9c72['childModel']='VoiceContext';break;case _0x5f4a('0x9b'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x9c');break;case _0x5f4a('0x9d'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x9e');_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0x9f'),'field':'name','foreignKey':_0x5f4a('0xa0'),'model':_0x5f4a('0xa1'),'filter':{'field':_0x5f4a('0xa2'),'value':[_0x5f4a('0xa3')]}},{'name':'Telephones','field':'name','foreignKey':'membername','model':_0x5f4a('0xa1'),'filter':{'field':_0x5f4a('0xa2'),'value':[_0x5f4a('0xa4')]}},{'name':_0x5f4a('0xa5'),'field':_0x5f4a('0x28'),'foreignKey':_0x5f4a('0xa6'),'model':_0x5f4a('0xa7'),'filter':{'field':'type','value':[_0x5f4a('0xa8')]}},{'name':_0x5f4a('0xa9'),'field':_0x5f4a('0x28'),'foreignKey':_0x5f4a('0xa6'),'model':_0x5f4a('0xa7'),'filter':{'field':'type','value':[_0x5f4a('0xaa')]}}];break;case'musiconholds':_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xab');break;case _0x5f4a('0xac'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xad');break;case _0x5f4a('0xae'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xaf');break;case _0x5f4a('0xb0'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xb1');break;case _0x5f4a('0xb2'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xb3');break;case'mailaccounts':_0x4c9c72['childModel']=_0x5f4a('0xb4');break;case _0x5f4a('0xb5'):_0x4c9c72[_0x5f4a('0x6e')]='MailSubstatus';break;case _0x5f4a('0xb6'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xb7');break;case _0x5f4a('0xb8'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xb9');break;case _0x5f4a('0xba'):_0x4c9c72[_0x5f4a('0x6e')]='SmsQueue';break;case _0x5f4a('0xbb'):_0x4c9c72[_0x5f4a('0x6e')]='SmsAccount';break;case _0x5f4a('0xbc'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xbd');break;case _0x5f4a('0xbe'):_0x4c9c72['childModel']=_0x5f4a('0xbf');break;case _0x5f4a('0xc0'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xc1');break;case _0x5f4a('0xc2'):case _0x5f4a('0xc3'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xa7');if(_0x3ceaeb){_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0xa5')},{'name':_0x5f4a('0xa9')}];}break;case _0x5f4a('0xc4'):case _0x5f4a('0xc5'):case _0x5f4a('0xc6'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xa1');if(_0x3ceaeb){_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0xc7'),'filter':{'field':_0x5f4a('0xa2'),'value':['admin',_0x5f4a('0xc8')]},'ignore':!![]},{'name':_0x5f4a('0x9f')},{'name':'Telephones'}];}break;case _0x5f4a('0xc9'):_0x4c9c72[_0x5f4a('0x6e')]='ZendeskAccount';break;case _0x5f4a('0xca'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xcb');break;case _0x5f4a('0xcc'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xcd');break;case _0x5f4a('0xce'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xcf');break;case _0x5f4a('0xd0'):_0x4c9c72['childModel']=_0x5f4a('0xd1');break;case _0x5f4a('0xd2'):_0x4c9c72['childModel']=_0x5f4a('0xd3');break;case _0x5f4a('0xd4'):_0x4c9c72['childModel']=_0x5f4a('0xa1');break;case _0x5f4a('0xd5'):_0x4c9c72['childModel']=_0x5f4a('0xd6');break;case _0x5f4a('0xd7'):_0x4c9c72[_0x5f4a('0x6e')]='Disposition';break;case _0x5f4a('0xd8'):_0x4c9c72[_0x5f4a('0x6e')]='Dashboard';break;case _0x5f4a('0xd9'):_0x4c9c72['childModel']='Interval';break;case _0x5f4a('0xda'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xdb');break;case _0x5f4a('0xdc'):_0x4c9c72['childModel']=_0x5f4a('0xdd');break;case _0x5f4a('0xde'):_0x4c9c72['childModel']=_0x5f4a('0xdf');break;case _0x5f4a('0xe0'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x80');break;case _0x5f4a('0xe1'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xe2');break;case _0x5f4a('0xe3'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xe4');break;case _0x5f4a('0xe5'):_0x4c9c72[_0x5f4a('0x6e')]='Trunk';break;case _0x5f4a('0xe6'):_0x4c9c72['childModel']='Variable';break;case'plugins':_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xe7');break;case _0x5f4a('0xe8'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0x75');_0x4c9c72[_0x5f4a('0x70')]=[{'name':_0x5f4a('0xe9'),'field':'id','foreignKey':'reportId'}];break;case _0x5f4a('0xea'):_0x4c9c72[_0x5f4a('0x6e')]=_0x5f4a('0xeb');break;case _0x5f4a('0xbe'):_0x4c9c72[_0x5f4a('0x6e')]='WhatsappAccount';break;default:return _0x4c9c72;}return _0x4c9c72;} \ No newline at end of file +var _0x4901=['name','index','map','UserProfile','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','params','describe','addSections','push','removeSections','getSections','includes','enabled','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','ids','getResources','section','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Sequelize','isEmpty','all','ignore','union','hasOwnProperty','order','sort','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','reportId','custom','CustomReports','rows','CmContact','Tag','Tags','tag','ThroughTags','color','value','toLowerCase','squareprojects','SquareProject','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','musiconholds','chanspies','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','whatsappaccounts','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','sounds','tags','templates','triggers','Trigger','trunks','Variable','plugins','Reports','WhatsappAccount','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','error','stack'];(function(_0x2527d3,_0x5098b0){var _0x20f842=function(_0x1ca5da){while(--_0x1ca5da){_0x2527d3['push'](_0x2527d3['shift']());}};_0x20f842(++_0x5098b0);}(_0x4901,0xbe));var _0x1490=function(_0x1fae42,_0x12ef9c){_0x1fae42=_0x1fae42-0x0;var _0x44e867=_0x4901[_0x1fae42];return _0x44e867;};'use strict';var pdf=require(_0x1490('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1490('0x1'));var zipdir=require(_0x1490('0x2'));var jsonpatch=require(_0x1490('0x3'));var rp=require(_0x1490('0x4'));var moment=require(_0x1490('0x5'));var BPromise=require(_0x1490('0x6'));var Mustache=require('mustache');var util=require(_0x1490('0x7'));var path=require(_0x1490('0x8'));var sox=require(_0x1490('0x9'));var csv=require('to-csv');var ejs=require(_0x1490('0xa'));var fs=require('fs');var _=require(_0x1490('0xb'));var squel=require(_0x1490('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1490('0xd'));var querystring=require(_0x1490('0xe'));var Papa=require(_0x1490('0xf'));var Redis=require(_0x1490('0x10'));var authService=require(_0x1490('0x11'));var qs=require(_0x1490('0x12'));var as=require(_0x1490('0x13'));var hardwareService=require(_0x1490('0x14'));var logger=require(_0x1490('0x15'))(_0x1490('0x16'));var utils=require(_0x1490('0x17'));var config=require(_0x1490('0x18'));var db=require('../../mysqldb')['db'];config[_0x1490('0x19')]=_[_0x1490('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1490('0x1b'))(new Redis(config['redis']));require('./userProfile.socket')[_0x1490('0x1c')](socket);function respondWithStatusCode(_0x397b31,_0x295c6e){_0x295c6e=_0x295c6e||0xcc;return function(_0x3a0b7b){if(_0x3a0b7b){return _0x397b31[_0x1490('0x1d')](_0x295c6e);}return _0x397b31[_0x1490('0x1e')](_0x295c6e)[_0x1490('0x1f')]();};}function respondWithResult(_0x1e2e72,_0x193d6e){_0x193d6e=_0x193d6e||0xc8;return function(_0x5f181b){if(_0x5f181b){return _0x1e2e72[_0x1490('0x1e')](_0x193d6e)[_0x1490('0x20')](_0x5f181b);}};}function respondWithFilteredResult(_0x4b25fa,_0x43537e){return function(_0x590c10){if(_0x590c10){var _0x340894=_0x590c10[_0x1490('0x21')],_0x32ab11=_0x43537e[_0x1490('0x22')],_0x994b1b=_0x43537e[_0x1490('0x22')]+_0x43537e[_0x1490('0x23')],_0x3da997;if(_0x994b1b>=_0x340894){_0x994b1b=_0x340894;_0x3da997=0xc8;}else{_0x3da997=0xce;}_0x4b25fa[_0x1490('0x1e')](_0x3da997);return _0x4b25fa[_0x1490('0x24')]('Content-Range',_0x32ab11+'-'+_0x994b1b+'/'+_0x340894)[_0x1490('0x20')](_0x590c10);}return null;};}function patchUpdates(_0x44befd){return function(_0x4309ab){try{jsonpatch['apply'](_0x4309ab,_0x44befd,!![]);}catch(_0x1d1310){return BPromise[_0x1490('0x25')](_0x1d1310);}return _0x4309ab[_0x1490('0x26')]();};}function saveUpdates(_0x24b4ab,_0x935ec2){return function(_0x1b7ea0){if(_0x1b7ea0){return _0x1b7ea0[_0x1490('0x27')](_0x24b4ab)['then'](function(_0x3daf1b){return _0x3daf1b;});}return null;};}function removeEntity(_0x30fe3d,_0x2f411e){return function(_0x422dd6){if(_0x422dd6){return _0x422dd6[_0x1490('0x28')]()[_0x1490('0x29')](function(){_0x30fe3d[_0x1490('0x1e')](0xcc)[_0x1490('0x1f')]();});}};}function handleEntityNotFound(_0x99d8ae,_0x80034){return function(_0x4bce90){if(!_0x4bce90){_0x99d8ae['sendStatus'](0x194);}return _0x4bce90;};}function handleError(_0x14fa3e,_0xda908f){_0xda908f=_0xda908f||0x1f4;return function(_0x2a0a2e){logger[_0x1490('0x2a')](_0x2a0a2e[_0x1490('0x2b')]);if(_0x2a0a2e['name']){delete _0x2a0a2e[_0x1490('0x2c')];}_0x14fa3e[_0x1490('0x1e')](_0xda908f)['send'](_0x2a0a2e);};}exports[_0x1490('0x2d')]=function(_0x1beaae,_0x626d1b){var _0x4026a7={},_0x39cb86={},_0x4f8a5f={'count':0x0,'rows':[]};var _0x4586a0=_[_0x1490('0x2e')](db[_0x1490('0x2f')]['rawAttributes'],function(_0x1bdccb){return{'name':_0x1bdccb[_0x1490('0x30')],'type':_0x1bdccb['type'][_0x1490('0x31')]};});_0x39cb86['model']=_[_0x1490('0x2e')](_0x4586a0,_0x1490('0x2c'));_0x39cb86[_0x1490('0x32')]=_[_0x1490('0x33')](_0x1beaae[_0x1490('0x32')]);_0x39cb86[_0x1490('0x34')]=_['intersection'](_0x39cb86[_0x1490('0x35')],_0x39cb86[_0x1490('0x32')]);_0x4026a7[_0x1490('0x36')]=_[_0x1490('0x37')](_0x39cb86['model'],qs[_0x1490('0x38')](_0x1beaae[_0x1490('0x32')][_0x1490('0x38')]));_0x4026a7[_0x1490('0x36')]=_0x4026a7[_0x1490('0x36')][_0x1490('0x39')]?_0x4026a7[_0x1490('0x36')]:_0x39cb86['model'];if(!_0x1beaae[_0x1490('0x32')]['hasOwnProperty'](_0x1490('0x3a'))){_0x4026a7['limit']=qs[_0x1490('0x23')](_0x1beaae[_0x1490('0x32')][_0x1490('0x23')]);_0x4026a7[_0x1490('0x22')]=qs[_0x1490('0x22')](_0x1beaae[_0x1490('0x32')]['offset']);}_0x4026a7['order']=qs['sort'](_0x1beaae[_0x1490('0x32')]['sort']);_0x4026a7['where']=qs[_0x1490('0x34')](_[_0x1490('0x3b')](_0x1beaae[_0x1490('0x32')],_0x39cb86[_0x1490('0x34')]),_0x4586a0);if(_0x1beaae[_0x1490('0x32')]['filter']){_0x4026a7[_0x1490('0x3c')]=_[_0x1490('0x3d')](_0x4026a7[_0x1490('0x3c')],{'$or':_[_0x1490('0x2e')](_0x4586a0,function(_0x2168ac){if(_0x2168ac[_0x1490('0x3e')]!==_0x1490('0x3f')){var _0x17d6cc={};_0x17d6cc[_0x2168ac[_0x1490('0x2c')]]={'$like':'%'+_0x1beaae[_0x1490('0x32')][_0x1490('0x40')]+'%'};return _0x17d6cc;}})});}_0x4026a7=_[_0x1490('0x3d')]({},_0x4026a7,_0x1beaae[_0x1490('0x41')]);var _0x3859fd={'where':_0x4026a7[_0x1490('0x3c')]};return db[_0x1490('0x2f')][_0x1490('0x21')](_0x3859fd)['then'](function(_0x5f5674){_0x4f8a5f[_0x1490('0x21')]=_0x5f5674;if(_0x1beaae[_0x1490('0x32')][_0x1490('0x42')]){_0x4026a7[_0x1490('0x43')]=[{'all':!![]}];}return db[_0x1490('0x2f')][_0x1490('0x44')](_0x4026a7);})[_0x1490('0x29')](function(_0x3f0327){_0x4f8a5f['rows']=_0x3f0327;return _0x4f8a5f;})['then'](respondWithFilteredResult(_0x626d1b,_0x4026a7))[_0x1490('0x45')](handleError(_0x626d1b,null));};exports[_0x1490('0x46')]=function(_0x95258c,_0x55e99c){var _0xe7e34d={'raw':![],'where':{'id':_0x95258c['params']['id']}},_0xb51dbc={};_0xb51dbc[_0x1490('0x35')]=_[_0x1490('0x33')](db[_0x1490('0x2f')][_0x1490('0x47')]);_0xb51dbc[_0x1490('0x32')]=_[_0x1490('0x33')](_0x95258c['query']);_0xb51dbc[_0x1490('0x34')]=_[_0x1490('0x37')](_0xb51dbc[_0x1490('0x35')],_0xb51dbc['query']);_0xe7e34d[_0x1490('0x36')]=_[_0x1490('0x37')](_0xb51dbc[_0x1490('0x35')],qs[_0x1490('0x38')](_0x95258c[_0x1490('0x32')][_0x1490('0x38')]));_0xe7e34d[_0x1490('0x36')]=_0xe7e34d['attributes'][_0x1490('0x39')]?_0xe7e34d['attributes']:_0xb51dbc[_0x1490('0x35')];if(_0x95258c['query']['includeAll']){_0xe7e34d[_0x1490('0x43')]=[{'all':!![]}];}_0xe7e34d=_[_0x1490('0x3d')]({},_0xe7e34d,_0x95258c[_0x1490('0x41')]);return db[_0x1490('0x2f')][_0x1490('0x48')](_0xe7e34d)[_0x1490('0x29')](handleEntityNotFound(_0x55e99c,null))[_0x1490('0x29')](respondWithResult(_0x55e99c,null))[_0x1490('0x45')](handleError(_0x55e99c,null));};exports['create']=function(_0x2c92fb,_0x46dfeb){return db[_0x1490('0x2f')][_0x1490('0x49')](_0x2c92fb[_0x1490('0x4a')],{})[_0x1490('0x29')](respondWithResult(_0x46dfeb,0xc9))[_0x1490('0x45')](handleError(_0x46dfeb,null));};exports[_0x1490('0x4b')]=function(_0x1ed693,_0x85e6a6){var _0x167c0c={'where':{'id':_0x1ed693['params']['id']}},_0x189d1d={};_0x189d1d[_0x1490('0x35')]=_[_0x1490('0x33')](db['UserProfile']['rawAttributes']);_0x167c0c['attributes']=_[_0x1490('0x37')](_0x189d1d[_0x1490('0x35')],qs[_0x1490('0x38')](_0x1ed693['query'][_0x1490('0x38')]));_0x167c0c[_0x1490('0x36')]=_0x167c0c[_0x1490('0x36')][_0x1490('0x39')]?_0x167c0c['attributes']:_0x189d1d[_0x1490('0x35')];if(_0x1ed693[_0x1490('0x32')][_0x1490('0x42')]){_0x167c0c[_0x1490('0x43')]=[{'all':!![]}];}_0x167c0c=_[_0x1490('0x3d')]({},_0x167c0c,_0x1ed693[_0x1490('0x41')]);return db[_0x1490('0x2f')][_0x1490('0x48')](_0x167c0c)['then'](handleEntityNotFound(_0x85e6a6,null))['then'](function(_0x438c1b){if(_0x438c1b){var _0x465144=_0x438c1b[_0x1490('0x4c')]({'plain':!![]});_0x465144=qs[_0x1490('0x4d')](_0x465144,['id',_0x1490('0x4e'),_0x1490('0x4f'),_0x1490('0x50')]);_0x1ed693[_0x1490('0x4a')]=_[_0x1490('0x4d')](_0x1ed693['body'],['id',_0x1490('0x4e'),_0x1490('0x4f')]);return db[_0x1490('0x51')][_0x1490('0x52')](function(_0x4531d7){return db[_0x1490('0x2f')]['create'](_[_0x1490('0x3d')](_0x465144,_0x1ed693[_0x1490('0x4a')]),{'include':_0x1ed693[_0x1490('0x32')][_0x1490('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x4531d7})[_0x1490('0x29')](function(_0x1b392c){var _0x2944d2=_0x1b392c[_0x1490('0x4c')]({'plain':!![]});return db[_0x1490('0x53')][_0x1490('0x44')]({'where':{'userProfileId':_0x1ed693['params']['id']},'raw':!![]})[_0x1490('0x29')](function(_0x49dff0){if(_0x49dff0){return BPromise[_0x1490('0x54')](_0x49dff0,function(_0x3ec230){return new BPromise(function(_0x2fa143,_0x5485f9){if(_0x3ec230[_0x1490('0x55')]===null||_0x3ec230['autoAssociation']===0x1)_0x2fa143(null);return db[_0x1490('0x56')][_0x1490('0x44')]({'where':{'sectionId':_0x3ec230['id']},'raw':!![]})[_0x1490('0x29')](function(_0x103f5b){var _0x39eab0=_[_0x1490('0x2e')](_0x103f5b,function(_0x18aeb1){return qs['omit'](_0x18aeb1,['id',_0x1490('0x4e'),_0x1490('0x4f'),_0x1490('0x57')]);});_0x2fa143(_0x39eab0);})['catch'](function(_0x12c7f2){_0x5485f9(_0x12c7f2);});})['then'](function(_0x5a6a8c){var _0x360831=qs[_0x1490('0x4d')](_0x3ec230,['id','createdAt',_0x1490('0x4f')]);_0x360831[_0x1490('0x58')]=_0x2944d2['id'];if(_0x5a6a8c)_0x360831[_0x1490('0x59')]=_0x5a6a8c;return _0x360831;})['then'](function(_0x5bc119){return db[_0x1490('0x53')][_0x1490('0x49')](_0x5bc119,{'include':[{'model':db[_0x1490('0x56')],'as':_0x1490('0x59')}],'raw':!![],'transaction':_0x4531d7});});})[_0x1490('0x29')](function(){return _0x2944d2;});}});});});}})[_0x1490('0x29')](respondWithResult(_0x85e6a6,0xc9))[_0x1490('0x45')](handleError(_0x85e6a6,null));};exports[_0x1490('0x27')]=function(_0x49a5ca,_0x2aa995){if(_0x49a5ca['body']['id']){delete _0x49a5ca[_0x1490('0x4a')]['id'];}return db[_0x1490('0x2f')]['find']({'where':{'id':_0x49a5ca[_0x1490('0x5a')]['id']}})[_0x1490('0x29')](handleEntityNotFound(_0x2aa995,null))[_0x1490('0x29')](saveUpdates(_0x49a5ca['body'],null))[_0x1490('0x29')](respondWithResult(_0x2aa995,null))[_0x1490('0x45')](handleError(_0x2aa995,null));};exports[_0x1490('0x28')]=function(_0x39ec2b,_0x1b8a62){return db['UserProfile']['find']({'where':{'id':_0x39ec2b[_0x1490('0x5a')]['id']}})[_0x1490('0x29')](handleEntityNotFound(_0x1b8a62,null))['then'](removeEntity(_0x1b8a62,null))['catch'](handleError(_0x1b8a62,null));};exports[_0x1490('0x5b')]=function(_0x245b9d,_0x55b067){return db[_0x1490('0x2f')][_0x1490('0x5b')]()[_0x1490('0x29')](respondWithResult(_0x55b067,null))[_0x1490('0x45')](handleError(_0x55b067,null));};exports[_0x1490('0x5c')]=function(_0x1e3da8,_0x5f4b0d){var _0x2ae2e8=_0x1e3da8[_0x1490('0x4a')];return db[_0x1490('0x2f')]['find']({'where':{'id':_0x1e3da8[_0x1490('0x5a')]['id']}})[_0x1490('0x29')](handleEntityNotFound(_0x5f4b0d,null))[_0x1490('0x29')](function(_0xc94b49){if(_0xc94b49){return db[_0x1490('0x51')][_0x1490('0x52')](function(_0x291dea){return db[_0x1490('0x53')][_0x1490('0x28')]({'where':{'userProfileId':_0x1e3da8[_0x1490('0x5a')]['id'],'sectionId':_[_0x1490('0x2e')](_0x2ae2e8,function(_0x3ee40c){return _0x3ee40c[_0x1490('0x57')];})},'transaction':_0x291dea})[_0x1490('0x29')](function(){var _0x851168=_[_0x1490('0x2e')](_0x2ae2e8,function(_0x3c54d1){_0x3c54d1['userProfileId']=_0x1e3da8[_0x1490('0x5a')]['id'];return _0x3c54d1;});var _0x2eb525=[];return BPromise[_0x1490('0x54')](_0x851168,function(_0x378967){return db[_0x1490('0x53')][_0x1490('0x49')](_0x378967,{'include':[{'model':db[_0x1490('0x56')],'as':_0x1490('0x59')}],'raw':!![],'transaction':_0x291dea})[_0x1490('0x29')](function(_0x5b4b87){_0x2eb525[_0x1490('0x5d')](_0x5b4b87['get']({'plain':!![]}));});})[_0x1490('0x29')](function(){return _0x2eb525;});});});}})[_0x1490('0x29')](function(_0x404bd9){return _0x404bd9;})['then'](respondWithResult(_0x5f4b0d,null))[_0x1490('0x45')](handleError(_0x5f4b0d,null));};exports[_0x1490('0x5e')]=function(_0x4a6d56,_0x3c1a36){var _0x1d9ae6;return db[_0x1490('0x2f')]['find']({'where':{'id':_0x4a6d56[_0x1490('0x5a')]['id']},'attributes':['id',_0x1490('0x2c')]})[_0x1490('0x29')](handleEntityNotFound(_0x3c1a36,null))[_0x1490('0x29')](function(_0xee172b){if(_0xee172b){_0x1d9ae6=_0xee172b;return db[_0x1490('0x53')][_0x1490('0x28')]({'where':{'userProfileId':_0x4a6d56[_0x1490('0x5a')]['id'],'sectionId':_0x4a6d56[_0x1490('0x32')]['ids']}});}})[_0x1490('0x29')](function(){return _0x1d9ae6;})[_0x1490('0x29')](respondWithStatusCode(_0x3c1a36,null))['catch'](handleError(_0x3c1a36,null));};exports[_0x1490('0x5f')]=function(_0x11298f,_0x2f8a44){var _0x172b5e=[];var _0x6fff=[];return db[_0x1490('0x53')]['findAll']({'where':{'userProfileId':_0x11298f[_0x1490('0x5a')]['id']},'raw':!![]})[_0x1490('0x29')](function(_0x455729){_0x172b5e=_[_0x1490('0x40')](_0x455729,function(_0x4fd6db){return _0x4fd6db['enabled']===0x1||_[_0x1490('0x60')]([0x3eb,0x709],_0x4fd6db[_0x1490('0x57')]);});if(!_['isEmpty'](_0x172b5e)){return _[_0x1490('0x2e')](_0x172b5e,function(_0x44c62c){return _0x44c62c[_0x1490('0x57')];});}else{return;}})[_0x1490('0x29')](function(_0xa6a010){if(_0xa6a010)_0x6fff=_0xa6a010;if(_[_0x1490('0x60')](_0x6fff,0x64)){var _0x17b1e3=_[_0x1490('0x48')](_0x172b5e,{'sectionId':0x64});return hasDefaultDashboard(_0x17b1e3)[_0x1490('0x29')](function(_0x3a43da){return _['map'](_0x172b5e,function(_0x1f5b80){if(_0x1f5b80[_0x1490('0x57')]===0x64){_0x1f5b80['subsections']=_0x3a43da;}return _0x1f5b80;});});}else{return;}})[_0x1490('0x29')](function(_0x3cdd75){if(_0x3cdd75)_0x172b5e=_0x3cdd75;if(_[_0x1490('0x60')](_0x6fff,0x3eb)){var _0xf9cea5=_[_0x1490('0x48')](_0x172b5e,{'sectionId':0x3eb});return getCustomDashboards(_0xf9cea5)['then'](function(_0xc0af3b){return _['map'](_0x172b5e,function(_0x384f15){if(_0xf9cea5[_0x1490('0x61')]){if(_0x384f15[_0x1490('0x57')]===0x3eb){_0x384f15[_0x1490('0x62')]=_0xc0af3b;}}else{if(_0x384f15[_0x1490('0x57')]===0x64){_0x384f15[_0x1490('0x62')]=_0xc0af3b;}}return _0x384f15;});});}else{return;}})[_0x1490('0x29')](function(_0x2c094e){if(_0x2c094e)_0x172b5e=_0x2c094e;if(_[_0x1490('0x60')](_0x6fff,0x709)){var _0x28dfd0=_[_0x1490('0x48')](_0x172b5e,{'sectionId':0x709});return getPlugins(_0x28dfd0)['then'](function(_0x3ad70e){if(_0x28dfd0[_0x1490('0x61')]){return _[_0x1490('0x2e')](_0x172b5e,function(_0x2ae1bc){if(_0x2ae1bc[_0x1490('0x57')]===0x709){_0x2ae1bc[_0x1490('0x62')]=_0x3ad70e;}return _0x2ae1bc;});}else{var _0x5c412a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3ad70e};var _0x488cb2=_[_0x1490('0x2e')](_0x172b5e);_0x488cb2[_0x1490('0x5d')](_0x5c412a);return _0x488cb2;}});}else{return;}})[_0x1490('0x29')](function(_0x302b2c){if(_0x302b2c)_0x172b5e=_0x302b2c;return _[_0x1490('0x40')](_0x172b5e,['enabled',0x1]);})[_0x1490('0x29')](respondWithResult(_0x2f8a44,null))[_0x1490('0x45')](handleError(_0x2f8a44,null));};function hasDefaultDashboard(_0x194034){var _0xbb945a=[0x65];return new BPromise(function(_0x3a7776,_0x3208ac){try{if(_0x194034['autoAssociation']){_0x3a7776(_0xbb945a);}else{return db['UserProfileResource'][_0x1490('0x63')]({'where':{'sectionId':_0x194034['id']},'raw':!![]})[_0x1490('0x29')](function(_0xc41a02){_0xc41a02?_0x3a7776(_0xbb945a):_0x3a7776();});}}catch(_0x57c135){_0x3208ac(_0x57c135);}});}function getCustomDashboards(_0x2b3f8b){var _0x3ebd62=[];return new BPromise(function(_0x278d6a,_0x3bc604){try{if(_0x2b3f8b[_0x1490('0x55')]){return db[_0x1490('0x64')]['findAll']({'raw':!![]})[_0x1490('0x29')](function(_0x4b785a){_0x4b785a['forEach'](function(_0x2389f3){_0x3ebd62[_0x1490('0x5d')](_0x2389f3['id']+0x1869f);});_0x278d6a(_0x3ebd62);});}else{return db['UserProfileResource'][_0x1490('0x44')]({'where':{'sectionId':_0x2b3f8b['id']},'raw':!![]})[_0x1490('0x29')](function(_0x529505){_0x529505[_0x1490('0x65')](function(_0xaf1062){_0x3ebd62[_0x1490('0x5d')](_0xaf1062[_0x1490('0x66')]+0x1869f);});_0x278d6a(_0x3ebd62);});}}catch(_0x3d5fbb){_0x3bc604(_0x3d5fbb);}});}function getPlugins(_0x46271d){var _0x312b43=[];return new BPromise(function(_0x53f960,_0x1ed3e2){try{if(_0x46271d['autoAssociation']){return db[_0x1490('0x67')][_0x1490('0x44')]({'raw':!![]})[_0x1490('0x29')](function(_0x4f1f80){_0x4f1f80['forEach'](function(_0x299ea8){_0x312b43[_0x1490('0x5d')](_0x299ea8['id']+0x15b38);});_0x53f960(_0x312b43);});}else{return db[_0x1490('0x56')][_0x1490('0x44')]({'where':{'sectionId':_0x46271d['id']},'raw':!![]})[_0x1490('0x29')](function(_0x5a2f08){_0x5a2f08[_0x1490('0x65')](function(_0x47b3e6){_0x312b43[_0x1490('0x5d')](_0x47b3e6['resourceId']+0x15b38);});_0x53f960(_0x312b43);});}}catch(_0x346921){_0x1ed3e2(_0x346921);}});}exports[_0x1490('0x68')]=function(_0x74cf98,_0x353968){return db['UserProfile'][_0x1490('0x48')]({'where':{'id':_0x74cf98[_0x1490('0x5a')]['id']}})[_0x1490('0x29')](handleEntityNotFound(_0x353968,null))['then'](function(_0xbe4acb){if(_0xbe4acb){return db[_0x1490('0x51')][_0x1490('0x52')](function(_0x147c39){return db[_0x1490('0x53')][_0x1490('0x44')]({'where':{'userProfileId':_0x74cf98[_0x1490('0x5a')]['id']},'attributes':['id'],'raw':!![]})[_0x1490('0x29')](function(_0x40d91b){if(_0x40d91b){return db['UserProfileSection'][_0x1490('0x28')]({'where':{'userProfileId':_0x74cf98[_0x1490('0x5a')]['id'],'id':_[_0x1490('0x2e')](_0x40d91b,function(_0x152d48){return _0x152d48['id'];})},'transaction':_0x147c39});}})[_0x1490('0x29')](function(_0x3534df){var _0xc36dd9=_[_0x1490('0x2e')](_0x74cf98[_0x1490('0x4a')],function(_0x23bcb5){_0x23bcb5[_0x1490('0x58')]=_0x74cf98[_0x1490('0x5a')]['id'];return _0x23bcb5;});return db['UserProfileSection'][_0x1490('0x69')](_0xc36dd9,{'raw':!![],'transaction':_0x147c39});})[_0x1490('0x29')](function(_0x258c3b){var _0x2d4977=_[_0x1490('0x40')](_[_0x1490('0x2e')](_0x258c3b,function(_0x464b28){return _0x464b28['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2d4977){return db[_0x1490('0x53')][_0x1490('0x44')]({'where':{'userProfileId':_0x74cf98['params']['id'],'sectionId':_[_0x1490('0x2e')](_0x2d4977,function(_0x2aeca5){return _0x2aeca5[_0x1490('0x57')];})},'attributes':['id',_0x1490('0x57')],'raw':!![]})[_0x1490('0x29')](function(_0xedf018){var _0x3ed548=_['map'](_0x74cf98['body'],function(_0x2d1c32){_0x2d1c32[_0x1490('0x58')]=_0x74cf98['params']['id'];return _0x2d1c32;});return db['UserProfileResource'][_0x1490('0x69')](_0x3ed548,{'raw':!![],'transaction':_0x147c39});});}})[_0x1490('0x45')](handleError(_0x353968,null));});}})['then'](function(_0x95240a){var _0x555002=_[_0x1490('0x2e')](_0x95240a,function(_0x54bb59){return _0x54bb59[_0x1490('0x4c')]({'plain':!![]});});})[_0x1490('0x29')](respondWithResult(_0x353968,null))[_0x1490('0x45')](handleError(_0x353968,null));};exports['removeResources']=function(_0x2f290a,_0x440e8c,_0x431806){return db['UserProfile']['find']({'where':{'id':_0x2f290a[_0x1490('0x5a')]['id']}})['then'](handleEntityNotFound(_0x440e8c,null))['then'](function(_0x48fa19){if(_0x48fa19){return _0x48fa19['removeResources'](_0x2f290a[_0x1490('0x32')][_0x1490('0x6a')]);}})[_0x1490('0x29')](respondWithStatusCode(_0x440e8c,null))['catch'](handleError(_0x440e8c,null));};exports[_0x1490('0x6b')]=function(_0x39e67d,_0xe735a8){var _0x1da31e={'raw':![],'where':{}};var _0x3c64bf={};var _0x3d366f={'count':0x0,'rows':[]};var _0x434161=_0x39e67d['query'][_0x1490('0x6c')];if(typeof _0x434161===_0x1490('0x6d')){throw new db['Sequelize'][(_0x1490('0x6e'))](_0x1490('0x6f'));}var _0x1f7147=_0x39e67d['query'][_0x1490('0x70')]||![];var _0x34b778=getQueryModels(_0x434161,_0x1f7147);if(typeof _0x34b778[_0x1490('0x71')]==='undefined'){throw new db[(_0x1490('0x72'))]['ValidationError']('Invalid\x20section\x20\x27'+_0x434161+'\x27');}var _0x528423=[];if(!_[_0x1490('0x73')](_0x34b778['parentSections'])){_0x528423=_0x34b778['parentSections'];}else{_0x528423=[{'name':_0x434161}];}return db[_0x1490('0x2f')][_0x1490('0x63')]({'where':{'id':_0x39e67d[_0x1490('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe735a8,null))[_0x1490('0x29')](function(_0x4ddfc2){if(_0x4ddfc2){var _0x23e19e=[];for(var _0x4fabba=0x0;_0x4fabba<_0x528423[_0x1490('0x39')];_0x4fabba++){_0x23e19e[_0x1490('0x5d')](db[_0x1490('0x53')][_0x1490('0x63')]({'where':{'userProfileId':_0x4ddfc2['id'],'name':_0x528423[_0x4fabba][_0x1490('0x2c')]},'raw':!![]}));}return BPromise[_0x1490('0x74')](_0x23e19e);}})['then'](function(_0x49154f){var _0x145f86=_[_0x1490('0x40')](_0x49154f,function(_0x5afb4b){return _0x5afb4b?_0x5afb4b:undefined;});var _0x61e5e=_['filter'](_0x528423,[_0x1490('0x75'),!![]]);var _0x2c6851=_[_0x1490('0x73')](_0x145f86)&&_[_0x1490('0x73')](_0x61e5e)?null:_[_0x1490('0x76')](_0x61e5e,_0x145f86);if(_0x2c6851){var _0x148ad6=[];for(var _0xb9e7f8=0x0;_0xb9e7f8<_0x2c6851[_0x1490('0x39')];_0xb9e7f8++){var _0x113bac=_[_0x1490('0x48')](_0x528423,function(_0x115906){return _0x2c6851[_0xb9e7f8]?_0x115906['name']===_0x2c6851[_0xb9e7f8][_0x1490('0x2c')]:null;});if(_0x113bac){if(_0x2c6851[_0xb9e7f8][_0x1490('0x75')]){_0x148ad6['push'](getAllResources(_0x34b778[_0x1490('0x71')],_0x2c6851[_0xb9e7f8]));}else{if(!_0x2c6851[_0xb9e7f8]['autoAssociation']){_0x148ad6[_0x1490('0x5d')](getAllowedResources(_0x113bac,_0x2c6851[_0xb9e7f8],_0x34b778[_0x1490('0x71')]));}else{if(_0x113bac['model']){_0x148ad6[_0x1490('0x5d')](getAllFilteredResources(_0x113bac,_0x2c6851[_0xb9e7f8]));}}}}}return BPromise[_0x1490('0x74')](_0x148ad6);}else{return null;}})[_0x1490('0x29')](function(_0x3ce308){var _0x47bb3a=_0x3ce308;var _0x158bd2=null;if(_0x47bb3a){_0x158bd2=_0x47bb3a[_0x1490('0x39')]===0x1?_0x47bb3a[0x0]:null;}if(_0x158bd2||_0x47bb3a){var _0xf75f9e=db[_0x34b778[_0x1490('0x71')]][_0x1490('0x47')];_0x3c64bf[_0x1490('0x35')]=_[_0x1490('0x33')](_0xf75f9e);_0x3c64bf[_0x1490('0x32')]=_[_0x1490('0x33')](_0x39e67d[_0x1490('0x32')]);_0x3c64bf['filters']=_[_0x1490('0x37')](_0x3c64bf['model'],_0x3c64bf['query']);_0x1da31e[_0x1490('0x36')]=_[_0x1490('0x37')](_0x3c64bf[_0x1490('0x35')],qs[_0x1490('0x38')](_0x39e67d[_0x1490('0x32')]['fields']));_0x1da31e['attributes']=_0x1da31e['attributes'][_0x1490('0x39')]?_0x1da31e[_0x1490('0x36')]:_0x3c64bf[_0x1490('0x35')];if(!_0x39e67d[_0x1490('0x32')][_0x1490('0x77')](_0x1490('0x3a'))){_0x1da31e[_0x1490('0x23')]=qs['limit'](_0x39e67d['query'][_0x1490('0x23')]);_0x1da31e[_0x1490('0x22')]=qs[_0x1490('0x22')](_0x39e67d[_0x1490('0x32')][_0x1490('0x22')]);}_0x1da31e[_0x1490('0x78')]=qs[_0x1490('0x79')](_0x39e67d[_0x1490('0x32')][_0x1490('0x79')]);_0x1da31e['where']=qs[_0x1490('0x34')](_[_0x1490('0x3b')](_0x39e67d['query'],_0x3c64bf[_0x1490('0x34')]));if(_0x39e67d[_0x1490('0x32')][_0x1490('0x40')]){_0x1da31e[_0x1490('0x3c')]=_[_0x1490('0x3d')](_0x1da31e[_0x1490('0x3c')],{'$or':_[_0x1490('0x2e')](_0xf75f9e,function(_0x547c40){if(_0x547c40[_0x1490('0x3e')][_0x1490('0x31')]!==_0x1490('0x3f')){var _0xb5d9b0={};_0xb5d9b0[_0x547c40[_0x1490('0x7a')]]={'$like':'%'+_0x39e67d[_0x1490('0x32')][_0x1490('0x40')]+'%'};return _0xb5d9b0;}})});}var _0x1aeae7=[];if(_0x158bd2){var _0xa610e4=_[_0x1490('0x48')](_0x528423,['name',_0x158bd2[_0x1490('0x2c')]]);if(_0xa610e4[_0x1490('0x7a')]){var _0x16cb06={};if(_0x34b778[_0x1490('0x71')]===_0x1490('0x7b')){_0x16cb06[_0xa610e4[_0x1490('0x7c')]]=_[_0x1490('0x2e')](_0x158bd2['associatedResources'],'id');}else{_0x16cb06[_0xa610e4[_0x1490('0x7c')]]=_0x158bd2['associatedResources'];}_0x1aeae7['push'](_0x16cb06);}else{_0x1da31e['where']['id']=_0x158bd2[_0x1490('0x7d')];}}else{for(var _0x1d8dae=0x0;_0x1d8dae<_0x47bb3a[_0x1490('0x39')];_0x1d8dae++){var _0xa610e4=_['find'](_0x528423,[_0x1490('0x2c'),_0x47bb3a[_0x1d8dae]['name']]);if(_0xa610e4[_0x1490('0x7a')]){var _0x16cb06={};_0x16cb06[_0xa610e4[_0x1490('0x7c')]]=_0x47bb3a[_0x1d8dae]['associatedResources'];_0x1aeae7[_0x1490('0x5d')](_0x16cb06);}else{if(!_0x1da31e['where']['id'])_0x1da31e[_0x1490('0x3c')]['id']=[];_0x47bb3a[_0x1d8dae][_0x1490('0x7d')]['forEach'](function(_0x5b6b1c){_0x1da31e[_0x1490('0x3c')]['id'][_0x1490('0x5d')](_0x5b6b1c);});}}}if(!_[_0x1490('0x73')](_0x1aeae7)){_0x1da31e[_0x1490('0x3c')]=_[_0x1490('0x3d')](_0x1da31e[_0x1490('0x3c')],{'$and':{'$or':_0x1aeae7}});}_0x1da31e=_['merge']({},_0x1da31e,_0x39e67d[_0x1490('0x41')]);if(_0x158bd2&&!_0x158bd2[_0x1490('0x55')]&&_0x34b778[_0x1490('0x71')]==='AnalyticExtractedReport'){if(_0x39e67d[_0x1490('0x32')][_0x1490('0x42')]){_0x1da31e[_0x1490('0x43')]=[{'all':!![]}];}return db[_0x34b778[_0x1490('0x71')]]['findAll'](_0x1da31e)['then'](function(_0x2a5221){var _0x494858=[];_0x2a5221['forEach'](function(_0x24076d){var _0x38fefc;switch(_0x24076d[_0x1490('0x7e')]){case'default':_0x38fefc=_[_0x1490('0x48')](_0x158bd2[_0x1490('0x7d')],function(_0x310ee3){return _0x310ee3['id']===_0x24076d[_0x1490('0x7f')]&&_0x310ee3[_0x1490('0x3e')]==='DefaultReports';});break;case _0x1490('0x80'):_0x38fefc=_['find'](_0x158bd2[_0x1490('0x7d')],function(_0x259f7d){return _0x259f7d['id']===_0x24076d[_0x1490('0x7f')]&&_0x259f7d[_0x1490('0x3e')]===_0x1490('0x81');});break;}if(_0x38fefc)_0x494858[_0x1490('0x5d')](_0x24076d);});_0x3d366f[_0x1490('0x21')]=_0x494858[_0x1490('0x39')];_0x3d366f[_0x1490('0x82')]=_0x494858;return _0x3d366f;});}else{return db[_0x34b778['childModel']][_0x1490('0x21')]({'where':_0x1da31e[_0x1490('0x3c')]})[_0x1490('0x29')](function(_0x53edf3){_0x3d366f[_0x1490('0x21')]=_0x53edf3;if(_0x39e67d['query'][_0x1490('0x42')]){if(_0x34b778['childModel']===_0x1490('0x83')){_0x1da31e[_0x1490('0x43')]=[{'model':db[_0x1490('0x84')],'as':_0x1490('0x85'),'attributes':['id',_0x1490('0x2c'),'color'],'required':_0x39e67d[_0x1490('0x32')][_0x1490('0x86')]?!![]:![]},{'model':db['Tag'],'as':_0x1490('0x87'),'attributes':['id',_0x1490('0x2c'),_0x1490('0x88')],'through':_0x39e67d[_0x1490('0x32')]['tag']?{'attributes':[],'where':{'TagId':_0x39e67d['query'][_0x1490('0x86')]||undefined}}:{},'required':_0x39e67d['query'][_0x1490('0x86')]?!![]:![]}];}else{_0x1da31e[_0x1490('0x43')]=[{'all':!![]}];}}return db[_0x34b778[_0x1490('0x71')]]['findAll'](_0x1da31e);})[_0x1490('0x29')](function(_0x2d5325){_0x3d366f[_0x1490('0x82')]=_0x2d5325;return _0x3d366f;});}}else{return _0x3d366f;}})['then'](respondWithFilteredResult(_0xe735a8,_0x1da31e))['catch'](handleError(_0xe735a8,null));};function getAllResources(_0x1d0a30,_0x370c88){return new BPromise(function(_0x2c3dc8,_0x37dda7){if(_0x370c88){var _0x39aece=_0x370c88[_0x1490('0x40')]?{[_0x370c88[_0x1490('0x40')][_0x1490('0x7a')]]:_0x370c88[_0x1490('0x40')][_0x1490('0x89')]}:undefined;return db[_0x1d0a30]['findAll']({'where':_0x39aece,'raw':!![]})[_0x1490('0x29')](function(_0x2e122e){_0x370c88[_0x1490('0x7d')]=_[_0x1490('0x2e')](_0x2e122e,'id');_0x2c3dc8(_0x370c88);})[_0x1490('0x45')](function(_0x240da0){_0x37dda7(_0x240da0);});}else{_0x2c3dc8(null);}});}function getAllFilteredResources(_0x1ac7d0,_0x2fcd9f){return new BPromise(function(_0x31272b,_0xa27990){var _0x22da70=_0x1ac7d0[_0x1490('0x40')]?{[_0x1ac7d0[_0x1490('0x40')]['field']]:_0x1ac7d0[_0x1490('0x40')]['value']}:undefined;return db[_0x1ac7d0[_0x1490('0x35')]][_0x1490('0x44')]({'where':_0x22da70,'raw':!![]})[_0x1490('0x29')](function(_0x5962b7){_0x2fcd9f['associatedResources']=_[_0x1490('0x2e')](_0x5962b7,function(_0x4969b3){return _0x4969b3[_0x1490('0x2c')];});_0x31272b(_0x2fcd9f);})[_0x1490('0x45')](function(_0x7cf1f4){_0xa27990(_0x7cf1f4);});});}function getAllowedResources(_0x472908,_0x3600c5,_0x328e3b){return new BPromise(function(_0x2b0fdd,_0x49edce){if(_0x3600c5){return db[_0x1490('0x56')][_0x1490('0x44')]({'where':{'sectionId':_0x3600c5['id']},'raw':!![]})[_0x1490('0x29')](function(_0x2db136){if(_0x472908[_0x1490('0x7a')]&&_0x472908[_0x1490('0x7a')]!=='id'){_0x3600c5[_0x1490('0x7d')]=_[_0x1490('0x2e')](_0x2db136,function(_0x13a69b){return _0x13a69b[_0x472908[_0x1490('0x7a')]];});}else{if(_0x328e3b===_0x1490('0x7b')){_0x3600c5['associatedResources']=_['map'](_0x2db136,function(_0x55d7e5){return{'id':_0x55d7e5[_0x1490('0x66')],'type':_0x55d7e5[_0x1490('0x3e')]};});}else{_0x3600c5[_0x1490('0x7d')]=_[_0x1490('0x2e')](_0x2db136,function(_0x22054d){return _0x22054d[_0x1490('0x66')];});}}_0x2b0fdd(_0x3600c5);})[_0x1490('0x45')](function(_0x4e0838){_0x49edce(_0x4e0838);});}else{_0x2b0fdd(null);}});}function getQueryModels(_0x23daf7,_0x4e6d44){var _0x4b994f=_0x23daf7[_0x1490('0x8a')]();var _0x4b836b={'childModel':undefined,'parentSections':[]};switch(_0x4b994f){case _0x1490('0x8b'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x8c');break;case'odbc':_0x4b836b[_0x1490('0x71')]=_0x1490('0x8d');break;case'squarerecordings':_0x4b836b['childModel']=_0x1490('0x8e');_0x4b836b[_0x1490('0x8f')]=[{'name':_0x1490('0x90'),'field':_0x1490('0x2c'),'foreignKey':_0x1490('0x91')}];break;case _0x1490('0x92'):_0x4b836b['childModel']=_0x1490('0x93');break;case _0x1490('0x94'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x83');_0x4b836b[_0x1490('0x8f')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x1490('0x95'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x96');break;case _0x1490('0x97'):_0x4b836b['childModel']=_0x1490('0x98');break;case _0x1490('0x99'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x9a');break;case _0x1490('0x9b'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x9c');break;case _0x1490('0x9d'):_0x4b836b[_0x1490('0x71')]='ChatWebsite';break;case _0x1490('0x9e'):_0x4b836b[_0x1490('0x71')]='FaxQueue';break;case _0x1490('0x9f'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xa0');break;case _0x1490('0xa1'):case'internalroutes':case _0x1490('0xa2'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xa3');break;case _0x1490('0xa4'):_0x4b836b['childModel']=_0x1490('0xa5');break;case'voicemails':_0x4b836b[_0x1490('0x71')]=_0x1490('0xa6');break;case _0x1490('0xa7'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xa8');_0x4b836b[_0x1490('0x8f')]=[{'name':'Agents','field':_0x1490('0x2c'),'foreignKey':_0x1490('0xa9'),'model':_0x1490('0xaa'),'filter':{'field':_0x1490('0xab'),'value':[_0x1490('0xac')]}},{'name':_0x1490('0xad'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0x1490('0xab'),'value':[_0x1490('0xae')]}},{'name':_0x1490('0xaf'),'field':'name','foreignKey':'queue','model':_0x1490('0xb0'),'filter':{'field':'type','value':['inbound']}},{'name':_0x1490('0xb1'),'field':'name','foreignKey':_0x1490('0xb2'),'model':_0x1490('0xb0'),'filter':{'field':_0x1490('0x3e'),'value':['outbound']}}];break;case _0x1490('0xb3'):_0x4b836b[_0x1490('0x71')]='VoiceMusicOnHold';break;case _0x1490('0xb4'):_0x4b836b['childModel']='VoiceChanSpy';break;case _0x1490('0xb5'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xb6');break;case'ivrcampaigns':_0x4b836b['childModel']=_0x1490('0xb7');break;case _0x1490('0xb8'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xb9');break;case _0x1490('0xba'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xbb');break;case _0x1490('0xbc'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xbd');break;case _0x1490('0xbe'):_0x4b836b['childModel']=_0x1490('0xbf');break;case _0x1490('0xc0'):_0x4b836b[_0x1490('0x71')]='OpenchannelAccount';break;case _0x1490('0xc1'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xc2');break;case'smsaccounts':_0x4b836b[_0x1490('0x71')]=_0x1490('0xc3');break;case'whatsappqueues':_0x4b836b[_0x1490('0x71')]='WhatsappQueue';break;case _0x1490('0xc4'):_0x4b836b['childModel']='WhatsappAccount';break;case _0x1490('0xc5'):_0x4b836b[_0x1490('0x71')]='Team';break;case _0x1490('0xc6'):case _0x1490('0xc7'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xb0');if(_0x4e6d44){_0x4b836b[_0x1490('0x8f')]=[{'name':_0x1490('0xaf')},{'name':'QueueCampaigns'}];}break;case _0x1490('0xc8'):case _0x1490('0xc9'):case _0x1490('0xca'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xaa');if(_0x4e6d44){_0x4b836b['parentSections']=[{'name':_0x1490('0xcb'),'filter':{'field':_0x1490('0xab'),'value':[_0x1490('0xcc'),_0x1490('0xcd')]},'ignore':!![]},{'name':_0x1490('0xce')},{'name':_0x1490('0xad')}];}break;case _0x1490('0xcf'):_0x4b836b['childModel']='ZendeskAccount';break;case _0x1490('0xd0'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xd1');break;case _0x1490('0xd2'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xd3');break;case'sugarcrmaccounts':_0x4b836b[_0x1490('0x71')]='SugarcrmAccount';break;case _0x1490('0xd4'):_0x4b836b[_0x1490('0x71')]='DeskAccount';break;case'zohoaccounts':_0x4b836b['childModel']=_0x1490('0xd5');break;case _0x1490('0xd6'):_0x4b836b['childModel']=_0x1490('0xaa');break;case'cannedanswers':_0x4b836b[_0x1490('0x71')]=_0x1490('0xd7');break;case _0x1490('0xd8'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xd9');break;case _0x1490('0xda'):_0x4b836b['childModel']=_0x1490('0x64');break;case _0x1490('0xdb'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xdc');break;case _0x1490('0xdd'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xde');break;case _0x1490('0xdf'):_0x4b836b['childModel']='Schedule';break;case _0x1490('0xe0'):_0x4b836b[_0x1490('0x71')]='Sound';break;case _0x1490('0xe1'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x84');break;case _0x1490('0xe2'):_0x4b836b[_0x1490('0x71')]='Template';break;case _0x1490('0xe3'):_0x4b836b[_0x1490('0x71')]=_0x1490('0xe4');break;case _0x1490('0xe5'):_0x4b836b[_0x1490('0x71')]='Trunk';break;case'variables':_0x4b836b[_0x1490('0x71')]=_0x1490('0xe6');break;case _0x1490('0xe7'):_0x4b836b[_0x1490('0x71')]=_0x1490('0x67');break;case'extractedreports':_0x4b836b[_0x1490('0x71')]=_0x1490('0x7b');_0x4b836b['parentSections']=[{'name':_0x1490('0xe8'),'field':'id','foreignKey':_0x1490('0x7f')}];break;case'metrics':_0x4b836b['childModel']='AnalyticMetric';break;case _0x1490('0xc4'):_0x4b836b['childModel']=_0x1490('0xe9');break;default:return _0x4b836b;}return _0x4b836b;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 07e7ec9..a29a57c 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 _0x6bf4=['../../mysqldb','UserProfile','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x381477,_0x1760e1){var _0x35328d=function(_0x2fa454){while(--_0x2fa454){_0x381477['push'](_0x381477['shift']());}};_0x35328d(++_0x1760e1);}(_0x6bf4,0x9f));var _0x46bf=function(_0x3ce1a1,_0x465127){_0x3ce1a1=_0x3ce1a1-0x0;var _0x32c826=_0x6bf4[_0x3ce1a1];return _0x32c826;};'use strict';var EventEmitter=require(_0x46bf('0x0'));var UserProfile=require(_0x46bf('0x1'))['db'][_0x46bf('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x46bf('0x3'),'afterUpdate':_0x46bf('0x4'),'afterDestroy':_0x46bf('0x5')};function emitEvent(_0x467442){return function(_0x3c4049,_0x1262f2,_0x4eaa00){UserProfileEvents[_0x46bf('0x6')](_0x467442+':'+_0x3c4049['id'],_0x3c4049);UserProfileEvents[_0x46bf('0x6')](_0x467442,_0x3c4049);_0x4eaa00(null);};}for(var e in events){if(events[_0x46bf('0x7')](e)){var event=events[e];UserProfile[_0x46bf('0x8')](e,emitEvent(event));}}module[_0x46bf('0x9')]=UserProfileEvents; \ No newline at end of file +var _0xc2dd=['exports','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xc2dd,0x187));var _0xdc2d=function(_0x4cd5e2,_0x59ecdb){_0x4cd5e2=_0x4cd5e2-0x0;var _0x17be05=_0xc2dd[_0x4cd5e2];return _0x17be05;};'use strict';var EventEmitter=require(_0xdc2d('0x0'));var UserProfile=require(_0xdc2d('0x1'))['db'][_0xdc2d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xdc2d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdc2d('0x4'),'afterDestroy':_0xdc2d('0x5')};function emitEvent(_0x46b7eb){return function(_0x4057f8,_0x274d49,_0x2d053c){UserProfileEvents[_0xdc2d('0x6')](_0x46b7eb+':'+_0x4057f8['id'],_0x4057f8);UserProfileEvents[_0xdc2d('0x6')](_0x46b7eb,_0x4057f8);_0x2d053c(null);};}for(var e in events){if(events[_0xdc2d('0x7')](e)){var event=events[e];UserProfile[_0xdc2d('0x8')](e,emitEvent(event));}}module[_0xdc2d('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index bd58618..891a7ea 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 _0xb9a6=['moment','rimraf','../../config/environment','exports','define','UserProfile','lodash','util','api'];(function(_0xb15db6,_0x388d94){var _0x1db34d=function(_0x309006){while(--_0x309006){_0xb15db6['push'](_0xb15db6['shift']());}};_0x1db34d(++_0x388d94);}(_0xb9a6,0x1ec));var _0x6b9a=function(_0x3818d2,_0xcda7db){_0x3818d2=_0x3818d2-0x0;var _0x5aec98=_0xb9a6[_0x3818d2];return _0x5aec98;};'use strict';var _=require(_0x6b9a('0x0'));var util=require(_0x6b9a('0x1'));var logger=require('../../config/logger')(_0x6b9a('0x2'));var moment=require(_0x6b9a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b9a('0x4'));var config=require(_0x6b9a('0x5'));var attributes=require('./userProfile.attributes');module[_0x6b9a('0x6')]=function(_0x31e3b7,_0xc6bde4){return _0x31e3b7[_0x6b9a('0x7')](_0x6b9a('0x8'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a11=['user_profiles','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile'];(function(_0xc69d34,_0x3b3e8f){var _0x272df=function(_0x5a488f){while(--_0x5a488f){_0xc69d34['push'](_0xc69d34['shift']());}};_0x272df(++_0x3b3e8f);}(_0x0a11,0xc5));var _0x10a1=function(_0x2e1906,_0xa281e9){_0x2e1906=_0x2e1906-0x0;var _0x3ea10e=_0x0a11[_0x2e1906];return _0x3ea10e;};'use strict';var _=require(_0x10a1('0x0'));var util=require(_0x10a1('0x1'));var logger=require(_0x10a1('0x2'))(_0x10a1('0x3'));var moment=require(_0x10a1('0x4'));var BPromise=require(_0x10a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x10a1('0x6'));var rimraf=require(_0x10a1('0x7'));var config=require(_0x10a1('0x8'));var attributes=require(_0x10a1('0x9'));module[_0x10a1('0xa')]=function(_0x30a15c,_0x407bf2){return _0x30a15c[_0x10a1('0xb')](_0x10a1('0xc'),attributes,{'tableName':_0x10a1('0xd'),'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 75c9d96..e55f322 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x372263,_0x2f1ee5){var _0x488429=function(_0x24fa43){while(--_0x24fa43){_0x372263['push'](_0x372263['shift']());}};_0x488429(++_0x2f1ee5);}(_0x814b,0x1a2));var _0xb814=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0x814b[_0x5ca644];return _0x5c87a2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});} \ No newline at end of file +var _0x5fab=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./userProfile.socket','register'];(function(_0x478970,_0x5df032){var _0x1759f1=function(_0x58579d){while(--_0x58579d){_0x478970['push'](_0x478970['shift']());}};_0x1759f1(++_0x5df032);}(_0x5fab,0x177));var _0xb5fa=function(_0x4497cd,_0x4a2208){_0x4497cd=_0x4497cd-0x0;var _0x3c6c43=_0x5fab[_0x4497cd];return _0x3c6c43;};'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});config['redis']=_[_0xb5fa('0xc')](config[_0xb5fa('0xd')],{'host':_0xb5fa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5fa('0xd')]));require(_0xb5fa('0xf'))[_0xb5fa('0x10')](socket);function respondWithRpcPromise(_0x54c7eb,_0x5b5ea8,_0x3a8e1b){return new BPromise(function(_0x23d124,_0xe46b26){return client[_0xb5fa('0x11')](_0x54c7eb,_0x3a8e1b)[_0xb5fa('0x12')](function(_0xadef41){logger[_0xb5fa('0x13')](_0xb5fa('0x14'),_0x5b5ea8,_0xb5fa('0x15'));logger['debug'](_0xb5fa('0x16'),_0x5b5ea8,_0xb5fa('0x15'),JSON['stringify'](_0xadef41));if(_0xadef41[_0xb5fa('0x17')]){if(_0xadef41['error'][_0xb5fa('0x18')]===0x1f4){logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0xadef41[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0xe46b26(_0xadef41['error']['message']);}logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0xadef41[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x23d124(_0xadef41['error']['message']);}else{logger[_0xb5fa('0x13')](_0xb5fa('0x14'),_0x5b5ea8,_0xb5fa('0x15'));_0x23d124(_0xadef41[_0xb5fa('0x1a')][_0xb5fa('0x19')]);}})[_0xb5fa('0x1b')](function(_0x3b0f69){logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0x3b0f69);_0xe46b26(_0x3b0f69);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 5934d33..4d93a16 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 _0x45b5=['emit','removeListener','register','length','userProfile:','./userProfile.events','remove','update'];(function(_0x46fa24,_0x2abf65){var _0x35869b=function(_0x41a744){while(--_0x41a744){_0x46fa24['push'](_0x46fa24['shift']());}};_0x35869b(++_0x2abf65);}(_0x45b5,0x195));var _0x545b=function(_0x2f2654,_0x1572bd){_0x2f2654=_0x2f2654-0x0;var _0x332b2a=_0x45b5[_0x2f2654];return _0x332b2a;};'use strict';var UserProfileEvents=require(_0x545b('0x0'));var events=['save',_0x545b('0x1'),_0x545b('0x2')];function createListener(_0x7e0878,_0x59d79d){return function(_0x4f0e63){_0x59d79d[_0x545b('0x3')](_0x7e0878,_0x4f0e63);};}function removeListener(_0x4b1ce5,_0x5c34ce){return function(){UserProfileEvents[_0x545b('0x4')](_0x4b1ce5,_0x5c34ce);};}exports[_0x545b('0x5')]=function(_0x99c3de){for(var _0x2b69a4=0x0,_0x49018e=events[_0x545b('0x6')];_0x2b69a4<_0x49018e;_0x2b69a4++){var _0x264abc=events[_0x2b69a4];var _0x4d42aa=createListener(_0x545b('0x7')+_0x264abc,_0x99c3de);UserProfileEvents['on'](_0x264abc,_0x4d42aa);}}; \ No newline at end of file +var _0xd7a2=['remove','update','emit','removeListener','register','length','userProfile:','./userProfile.events','save'];(function(_0x5d6295,_0x5acc82){var _0x58849a=function(_0x2628d5){while(--_0x2628d5){_0x5d6295['push'](_0x5d6295['shift']());}};_0x58849a(++_0x5acc82);}(_0xd7a2,0xfa));var _0x2d7a=function(_0x4392fd,_0x50daad){_0x4392fd=_0x4392fd-0x0;var _0x13c9c7=_0xd7a2[_0x4392fd];return _0x13c9c7;};'use strict';var UserProfileEvents=require(_0x2d7a('0x0'));var events=[_0x2d7a('0x1'),_0x2d7a('0x2'),_0x2d7a('0x3')];function createListener(_0x10bc80,_0x383e34){return function(_0xed1fec){_0x383e34[_0x2d7a('0x4')](_0x10bc80,_0xed1fec);};}function removeListener(_0x433af9,_0x2f1a6c){return function(){UserProfileEvents[_0x2d7a('0x5')](_0x433af9,_0x2f1a6c);};}exports[_0x2d7a('0x6')]=function(_0x5cacfb){for(var _0x3e2882=0x0,_0xe86946=events[_0x2d7a('0x7')];_0x3e2882<_0xe86946;_0x3e2882++){var _0x5de4f2=events[_0x3e2882];var _0x13f695=createListener(_0x2d7a('0x8')+_0x5de4f2,_0x5cacfb);UserProfileEvents['on'](_0x5de4f2,_0x13f695);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 1786b2f..ab0c1ef 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 _0xd676=['/:id','post','create','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd676,0x1e6));var _0x6d67=function(_0xbb5ed6,_0x5f2644){_0xbb5ed6=_0xbb5ed6-0x0;var _0x3604f5=_0xd676[_0xbb5ed6];return _0x3604f5;};'use strict';var multer=require(_0x6d67('0x0'));var util=require(_0x6d67('0x1'));var path=require('path');var timeout=require(_0x6d67('0x2'));var express=require(_0x6d67('0x3'));var router=express[_0x6d67('0x4')]();var auth=require(_0x6d67('0x5'));var interaction=require(_0x6d67('0x6'));var config=require(_0x6d67('0x7'));var controller=require(_0x6d67('0x8'));router[_0x6d67('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d67('0xa')]);router[_0x6d67('0x9')](_0x6d67('0xb'),auth[_0x6d67('0xc')](),controller[_0x6d67('0xd')]);router[_0x6d67('0x9')](_0x6d67('0xe'),auth[_0x6d67('0xc')](),controller['show']);router[_0x6d67('0xf')]('/',auth['isAuthenticated'](),controller[_0x6d67('0x10')]);router[_0x6d67('0x11')](_0x6d67('0xe'),auth[_0x6d67('0xc')](),controller['update']);router[_0x6d67('0x12')]('/:id',auth[_0x6d67('0xc')](),controller['destroy']);module[_0x6d67('0x13')]=router; \ No newline at end of file +var _0x1c2e=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','Router','../../components/interaction/service'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x1c2e,0xb8));var _0xe1c2=function(_0x162415,_0x2ce52a){_0x162415=_0x162415-0x0;var _0x44a072=_0x1c2e[_0x162415];return _0x44a072;};'use strict';var multer=require('multer');var util=require(_0xe1c2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe1c2('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe1c2('0x2'));var config=require(_0xe1c2('0x3'));var controller=require(_0xe1c2('0x4'));router[_0xe1c2('0x5')]('/',auth[_0xe1c2('0x6')](),controller[_0xe1c2('0x7')]);router['get'](_0xe1c2('0x8'),auth[_0xe1c2('0x6')](),controller[_0xe1c2('0x9')]);router['get'](_0xe1c2('0xa'),auth['isAuthenticated'](),controller[_0xe1c2('0xb')]);router[_0xe1c2('0xc')]('/',auth[_0xe1c2('0x6')](),controller[_0xe1c2('0xd')]);router[_0xe1c2('0xe')]('/:id',auth[_0xe1c2('0x6')](),controller[_0xe1c2('0xf')]);router[_0xe1c2('0x10')]('/:id',auth[_0xe1c2('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b7f8182..aba0ba0 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 _0x29a5=['exports','INTEGER'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x29a5,0xd2));var _0x529a=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x29a5[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require('sequelize');module[_0x529a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x529a('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x48e6=['exports','STRING','INTEGER','sequelize'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x48e6,0x163));var _0x648e=function(_0x46b54b,_0x122e15){_0x46b54b=_0x46b54b-0x0;var _0x2802f8=_0x48e6[_0x46b54b];return _0x2802f8;};'use strict';var Sequelize=require(_0x648e('0x0'));module[_0x648e('0x1')]={'name':{'type':Sequelize[_0x648e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x648e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x648e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6b15236..933b307 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 _0x3937=['offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x314927,_0x28cf9d){var _0x1c85dc=function(_0x28bdeb){while(--_0x28bdeb){_0x314927['push'](_0x314927['shift']());}};_0x1c85dc(++_0x28cf9d);}(_0x3937,0xbf));var _0x7393=function(_0x33ac78,_0x42a5a2){_0x33ac78=_0x33ac78-0x0;var _0x410671=_0x3937[_0x33ac78];return _0x410671;};'use strict';var pdf=require(_0x7393('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7393('0x1'));var zipdir=require(_0x7393('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7393('0x3'));var moment=require('moment');var BPromise=require(_0x7393('0x4'));var Mustache=require('mustache');var util=require(_0x7393('0x5'));var path=require(_0x7393('0x6'));var sox=require(_0x7393('0x7'));var csv=require(_0x7393('0x8'));var ejs=require(_0x7393('0x9'));var fs=require('fs');var _=require(_0x7393('0xa'));var squel=require(_0x7393('0xb'));var crypto=require(_0x7393('0xc'));var jsforce=require(_0x7393('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7393('0xe'));var Papa=require(_0x7393('0xf'));var Redis=require(_0x7393('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7393('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7393('0x12'));var config=require(_0x7393('0x13'));var db=require(_0x7393('0x14'))['db'];function respondWithStatusCode(_0x4fb764,_0x79fc4e){_0x79fc4e=_0x79fc4e||0xcc;return function(_0x470f09){if(_0x470f09){return _0x4fb764[_0x7393('0x15')](_0x79fc4e);}return _0x4fb764[_0x7393('0x16')](_0x79fc4e)[_0x7393('0x17')]();};}function respondWithResult(_0x1fe171,_0x38eaad){_0x38eaad=_0x38eaad||0xc8;return function(_0x212f44){if(_0x212f44){return _0x1fe171[_0x7393('0x16')](_0x38eaad)['json'](_0x212f44);}};}function respondWithFilteredResult(_0x47b152,_0x414c37){return function(_0x5d0d2b){if(_0x5d0d2b){var _0x5b91a9=_0x5d0d2b[_0x7393('0x18')],_0x4e7ec6=_0x414c37[_0x7393('0x19')],_0x82f5fa=_0x414c37['offset']+_0x414c37[_0x7393('0x1a')],_0x54dc47;if(_0x82f5fa>=_0x5b91a9){_0x82f5fa=_0x5b91a9;_0x54dc47=0xc8;}else{_0x54dc47=0xce;}_0x47b152['status'](_0x54dc47);return _0x47b152['set'](_0x7393('0x1b'),_0x4e7ec6+'-'+_0x82f5fa+'/'+_0x5b91a9)[_0x7393('0x1c')](_0x5d0d2b);}return null;};}function patchUpdates(_0x1b032c){return function(_0x1dc3e3){try{jsonpatch[_0x7393('0x1d')](_0x1dc3e3,_0x1b032c,!![]);}catch(_0x3e2453){return BPromise[_0x7393('0x1e')](_0x3e2453);}return _0x1dc3e3[_0x7393('0x1f')]();};}function saveUpdates(_0x546642,_0x52cd6a){return function(_0x30eae3){if(_0x30eae3){return _0x30eae3[_0x7393('0x20')](_0x546642)[_0x7393('0x21')](function(_0x7fc0ef){return _0x7fc0ef;});}return null;};}function removeEntity(_0x131667,_0x52f716){return function(_0x4d7870){if(_0x4d7870){return _0x4d7870['destroy']()[_0x7393('0x21')](function(){_0x131667['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bf7a9,_0xa8f852){return function(_0x5b4498){if(!_0x5b4498){_0x2bf7a9[_0x7393('0x15')](0x194);}return _0x5b4498;};}function handleError(_0x2b0389,_0x1ac912){_0x1ac912=_0x1ac912||0x1f4;return function(_0x3a0a83){logger[_0x7393('0x22')](_0x3a0a83[_0x7393('0x23')]);if(_0x3a0a83[_0x7393('0x24')]){delete _0x3a0a83[_0x7393('0x24')];}_0x2b0389[_0x7393('0x16')](_0x1ac912)[_0x7393('0x25')](_0x3a0a83);};}exports[_0x7393('0x26')]=function(_0x123ab4,_0x19160c){var _0x4e1fea={},_0x39d95f={},_0x17e350={'count':0x0,'rows':[]};var _0x1fea0a=_[_0x7393('0x27')](db[_0x7393('0x28')][_0x7393('0x29')],function(_0x4a865e){return{'name':_0x4a865e[_0x7393('0x2a')],'type':_0x4a865e['type'][_0x7393('0x2b')]};});_0x39d95f['model']=_[_0x7393('0x27')](_0x1fea0a,_0x7393('0x24'));_0x39d95f[_0x7393('0x2c')]=_[_0x7393('0x2d')](_0x123ab4[_0x7393('0x2c')]);_0x39d95f[_0x7393('0x2e')]=_[_0x7393('0x2f')](_0x39d95f[_0x7393('0x30')],_0x39d95f[_0x7393('0x2c')]);_0x4e1fea[_0x7393('0x31')]=_[_0x7393('0x2f')](_0x39d95f[_0x7393('0x30')],qs['fields'](_0x123ab4['query'][_0x7393('0x32')]));_0x4e1fea['attributes']=_0x4e1fea[_0x7393('0x31')]['length']?_0x4e1fea[_0x7393('0x31')]:_0x39d95f['model'];if(!_0x123ab4[_0x7393('0x2c')][_0x7393('0x33')](_0x7393('0x34'))){_0x4e1fea[_0x7393('0x1a')]=qs[_0x7393('0x1a')](_0x123ab4[_0x7393('0x2c')][_0x7393('0x1a')]);_0x4e1fea[_0x7393('0x19')]=qs[_0x7393('0x19')](_0x123ab4[_0x7393('0x2c')]['offset']);}_0x4e1fea[_0x7393('0x35')]=qs['sort'](_0x123ab4[_0x7393('0x2c')]['sort']);_0x4e1fea[_0x7393('0x36')]=qs[_0x7393('0x2e')](_[_0x7393('0x37')](_0x123ab4[_0x7393('0x2c')],_0x39d95f[_0x7393('0x2e')]),_0x1fea0a);if(_0x123ab4['query'][_0x7393('0x38')]){_0x4e1fea['where']=_[_0x7393('0x39')](_0x4e1fea[_0x7393('0x36')],{'$or':_[_0x7393('0x27')](_0x1fea0a,function(_0x26cb6e){if(_0x26cb6e[_0x7393('0x3a')]!=='VIRTUAL'){var _0x4c82e6={};_0x4c82e6[_0x26cb6e[_0x7393('0x24')]]={'$like':'%'+_0x123ab4[_0x7393('0x2c')][_0x7393('0x38')]+'%'};return _0x4c82e6;}})});}_0x4e1fea=_[_0x7393('0x39')]({},_0x4e1fea,_0x123ab4['options']);var _0x5d746e={'where':_0x4e1fea['where']};return db[_0x7393('0x28')][_0x7393('0x18')](_0x5d746e)[_0x7393('0x21')](function(_0x4aa2ca){_0x17e350[_0x7393('0x18')]=_0x4aa2ca;if(_0x123ab4[_0x7393('0x2c')][_0x7393('0x3b')]){_0x4e1fea[_0x7393('0x3c')]=[{'all':!![]}];}return db[_0x7393('0x28')][_0x7393('0x3d')](_0x4e1fea);})[_0x7393('0x21')](function(_0x2241c8){_0x17e350[_0x7393('0x3e')]=_0x2241c8;return _0x17e350;})[_0x7393('0x21')](respondWithFilteredResult(_0x19160c,_0x4e1fea))[_0x7393('0x3f')](handleError(_0x19160c,null));};exports[_0x7393('0x40')]=function(_0x1644ac,_0x3eefe0){var _0x445b39={'raw':![],'where':{'id':_0x1644ac[_0x7393('0x41')]['id']}},_0x13c476={};_0x13c476[_0x7393('0x30')]=_['keys'](db[_0x7393('0x28')][_0x7393('0x29')]);_0x13c476[_0x7393('0x2c')]=_[_0x7393('0x2d')](_0x1644ac[_0x7393('0x2c')]);_0x13c476[_0x7393('0x2e')]=_[_0x7393('0x2f')](_0x13c476[_0x7393('0x30')],_0x13c476['query']);_0x445b39['attributes']=_[_0x7393('0x2f')](_0x13c476['model'],qs[_0x7393('0x32')](_0x1644ac[_0x7393('0x2c')][_0x7393('0x32')]));_0x445b39[_0x7393('0x31')]=_0x445b39[_0x7393('0x31')][_0x7393('0x42')]?_0x445b39['attributes']:_0x13c476[_0x7393('0x30')];if(_0x1644ac[_0x7393('0x2c')][_0x7393('0x3b')]){_0x445b39[_0x7393('0x3c')]=[{'all':!![]}];}_0x445b39=_[_0x7393('0x39')]({},_0x445b39,_0x1644ac['options']);return db['UserProfileResource'][_0x7393('0x43')](_0x445b39)['then'](handleEntityNotFound(_0x3eefe0,null))[_0x7393('0x21')](respondWithResult(_0x3eefe0,null))[_0x7393('0x3f')](handleError(_0x3eefe0,null));};exports[_0x7393('0x44')]=function(_0xaef517,_0x2348a9){return db[_0x7393('0x28')][_0x7393('0x44')](_0xaef517[_0x7393('0x45')],{})[_0x7393('0x21')](respondWithResult(_0x2348a9,0xc9))[_0x7393('0x3f')](handleError(_0x2348a9,null));};exports[_0x7393('0x20')]=function(_0x26c327,_0x3fdbe2){if(_0x26c327[_0x7393('0x45')]['id']){delete _0x26c327[_0x7393('0x45')]['id'];}return db['UserProfileResource'][_0x7393('0x43')]({'where':{'id':_0x26c327[_0x7393('0x41')]['id']}})[_0x7393('0x21')](handleEntityNotFound(_0x3fdbe2,null))[_0x7393('0x21')](saveUpdates(_0x26c327['body'],null))[_0x7393('0x21')](respondWithResult(_0x3fdbe2,null))[_0x7393('0x3f')](handleError(_0x3fdbe2,null));};exports[_0x7393('0x46')]=function(_0x275192,_0x1deca3){return db[_0x7393('0x28')][_0x7393('0x43')]({'where':{'id':_0x275192[_0x7393('0x41')]['id']}})[_0x7393('0x21')](handleEntityNotFound(_0x1deca3,null))['then'](removeEntity(_0x1deca3,null))[_0x7393('0x3f')](handleError(_0x1deca3,null));};exports[_0x7393('0x47')]=function(_0x306ab7,_0x5b82d4){return db[_0x7393('0x28')][_0x7393('0x47')]()['then'](respondWithResult(_0x5b82d4,null))[_0x7393('0x3f')](handleError(_0x5b82d4,null));}; \ No newline at end of file +var _0xeec6=['options','count','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','UserProfileResource','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','filter'];(function(_0x1fb66b,_0x27aa31){var _0x15320f=function(_0x506c96){while(--_0x506c96){_0x1fb66b['push'](_0x1fb66b['shift']());}};_0x15320f(++_0x27aa31);}(_0xeec6,0x1c2));var _0x6eec=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0xeec6[_0x2b8077];return _0x308091;};'use strict';var pdf=require(_0x6eec('0x0'));var emlformat=require(_0x6eec('0x1'));var rimraf=require(_0x6eec('0x2'));var zipdir=require(_0x6eec('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eec('0x4'));var moment=require(_0x6eec('0x5'));var BPromise=require(_0x6eec('0x6'));var Mustache=require(_0x6eec('0x7'));var util=require(_0x6eec('0x8'));var path=require(_0x6eec('0x9'));var sox=require('sox');var csv=require(_0x6eec('0xa'));var ejs=require(_0x6eec('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6eec('0xc'));var crypto=require(_0x6eec('0xd'));var jsforce=require(_0x6eec('0xe'));var deskjs=require(_0x6eec('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6eec('0x10'));var Papa=require(_0x6eec('0x11'));var Redis=require(_0x6eec('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eec('0x13'));var logger=require(_0x6eec('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6eec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3091d0,_0x3387c2){_0x3387c2=_0x3387c2||0xcc;return function(_0x162db1){if(_0x162db1){return _0x3091d0[_0x6eec('0x16')](_0x3387c2);}return _0x3091d0[_0x6eec('0x17')](_0x3387c2)['end']();};}function respondWithResult(_0x25e2a5,_0x3b2972){_0x3b2972=_0x3b2972||0xc8;return function(_0x462dbb){if(_0x462dbb){return _0x25e2a5[_0x6eec('0x17')](_0x3b2972)[_0x6eec('0x18')](_0x462dbb);}};}function respondWithFilteredResult(_0x2b35d6,_0x345852){return function(_0x393271){if(_0x393271){var _0x34a7fc=_0x393271['count'],_0x2ac797=_0x345852[_0x6eec('0x19')],_0x5e2a9b=_0x345852[_0x6eec('0x19')]+_0x345852['limit'],_0x3c0c1b;if(_0x5e2a9b>=_0x34a7fc){_0x5e2a9b=_0x34a7fc;_0x3c0c1b=0xc8;}else{_0x3c0c1b=0xce;}_0x2b35d6[_0x6eec('0x17')](_0x3c0c1b);return _0x2b35d6[_0x6eec('0x1a')](_0x6eec('0x1b'),_0x2ac797+'-'+_0x5e2a9b+'/'+_0x34a7fc)['json'](_0x393271);}return null;};}function patchUpdates(_0x87f3be){return function(_0x1ed94c){try{jsonpatch[_0x6eec('0x1c')](_0x1ed94c,_0x87f3be,!![]);}catch(_0x3320a3){return BPromise[_0x6eec('0x1d')](_0x3320a3);}return _0x1ed94c[_0x6eec('0x1e')]();};}function saveUpdates(_0x536429,_0x328693){return function(_0x2f843e){if(_0x2f843e){return _0x2f843e[_0x6eec('0x1f')](_0x536429)[_0x6eec('0x20')](function(_0x1a8f73){return _0x1a8f73;});}return null;};}function removeEntity(_0xcd546f,_0x52f941){return function(_0x6e40b3){if(_0x6e40b3){return _0x6e40b3[_0x6eec('0x21')]()[_0x6eec('0x20')](function(){_0xcd546f[_0x6eec('0x17')](0xcc)[_0x6eec('0x22')]();});}};}function handleEntityNotFound(_0x13863c,_0x573249){return function(_0x384586){if(!_0x384586){_0x13863c[_0x6eec('0x16')](0x194);}return _0x384586;};}function handleError(_0xd664f5,_0x33d580){_0x33d580=_0x33d580||0x1f4;return function(_0x1d2be9){logger[_0x6eec('0x23')](_0x1d2be9[_0x6eec('0x24')]);if(_0x1d2be9[_0x6eec('0x25')]){delete _0x1d2be9[_0x6eec('0x25')];}_0xd664f5['status'](_0x33d580)[_0x6eec('0x26')](_0x1d2be9);};}exports[_0x6eec('0x27')]=function(_0x30eb98,_0x275fd0){var _0x4f507e={},_0x23432d={},_0x3b9b9f={'count':0x0,'rows':[]};var _0x518ba5=_['map'](db[_0x6eec('0x28')]['rawAttributes'],function(_0x20a130){return{'name':_0x20a130[_0x6eec('0x29')],'type':_0x20a130[_0x6eec('0x2a')][_0x6eec('0x2b')]};});_0x23432d[_0x6eec('0x2c')]=_[_0x6eec('0x2d')](_0x518ba5,_0x6eec('0x25'));_0x23432d[_0x6eec('0x2e')]=_[_0x6eec('0x2f')](_0x30eb98[_0x6eec('0x2e')]);_0x23432d['filters']=_[_0x6eec('0x30')](_0x23432d['model'],_0x23432d[_0x6eec('0x2e')]);_0x4f507e[_0x6eec('0x31')]=_[_0x6eec('0x30')](_0x23432d['model'],qs['fields'](_0x30eb98['query'][_0x6eec('0x32')]));_0x4f507e[_0x6eec('0x31')]=_0x4f507e[_0x6eec('0x31')][_0x6eec('0x33')]?_0x4f507e[_0x6eec('0x31')]:_0x23432d[_0x6eec('0x2c')];if(!_0x30eb98[_0x6eec('0x2e')][_0x6eec('0x34')](_0x6eec('0x35'))){_0x4f507e[_0x6eec('0x36')]=qs[_0x6eec('0x36')](_0x30eb98[_0x6eec('0x2e')]['limit']);_0x4f507e[_0x6eec('0x19')]=qs[_0x6eec('0x19')](_0x30eb98[_0x6eec('0x2e')]['offset']);}_0x4f507e[_0x6eec('0x37')]=qs[_0x6eec('0x38')](_0x30eb98[_0x6eec('0x2e')][_0x6eec('0x38')]);_0x4f507e[_0x6eec('0x39')]=qs[_0x6eec('0x3a')](_['pick'](_0x30eb98[_0x6eec('0x2e')],_0x23432d[_0x6eec('0x3a')]),_0x518ba5);if(_0x30eb98[_0x6eec('0x2e')]['filter']){_0x4f507e['where']=_[_0x6eec('0x3b')](_0x4f507e[_0x6eec('0x39')],{'$or':_[_0x6eec('0x2d')](_0x518ba5,function(_0x3f79d1){if(_0x3f79d1[_0x6eec('0x2a')]!=='VIRTUAL'){var _0x223dfa={};_0x223dfa[_0x3f79d1[_0x6eec('0x25')]]={'$like':'%'+_0x30eb98[_0x6eec('0x2e')][_0x6eec('0x3c')]+'%'};return _0x223dfa;}})});}_0x4f507e=_[_0x6eec('0x3b')]({},_0x4f507e,_0x30eb98[_0x6eec('0x3d')]);var _0x36cfe1={'where':_0x4f507e[_0x6eec('0x39')]};return db['UserProfileResource'][_0x6eec('0x3e')](_0x36cfe1)[_0x6eec('0x20')](function(_0x4d30c9){_0x3b9b9f['count']=_0x4d30c9;if(_0x30eb98[_0x6eec('0x2e')][_0x6eec('0x3f')]){_0x4f507e[_0x6eec('0x40')]=[{'all':!![]}];}return db[_0x6eec('0x28')]['findAll'](_0x4f507e);})['then'](function(_0x35fd91){_0x3b9b9f['rows']=_0x35fd91;return _0x3b9b9f;})['then'](respondWithFilteredResult(_0x275fd0,_0x4f507e))[_0x6eec('0x41')](handleError(_0x275fd0,null));};exports[_0x6eec('0x42')]=function(_0x125bd4,_0x34049a){var _0x25d3f3={'raw':![],'where':{'id':_0x125bd4[_0x6eec('0x43')]['id']}},_0x58dfe7={};_0x58dfe7[_0x6eec('0x2c')]=_['keys'](db[_0x6eec('0x28')][_0x6eec('0x44')]);_0x58dfe7['query']=_[_0x6eec('0x2f')](_0x125bd4[_0x6eec('0x2e')]);_0x58dfe7['filters']=_[_0x6eec('0x30')](_0x58dfe7[_0x6eec('0x2c')],_0x58dfe7[_0x6eec('0x2e')]);_0x25d3f3[_0x6eec('0x31')]=_['intersection'](_0x58dfe7[_0x6eec('0x2c')],qs[_0x6eec('0x32')](_0x125bd4[_0x6eec('0x2e')][_0x6eec('0x32')]));_0x25d3f3[_0x6eec('0x31')]=_0x25d3f3['attributes']['length']?_0x25d3f3[_0x6eec('0x31')]:_0x58dfe7[_0x6eec('0x2c')];if(_0x125bd4[_0x6eec('0x2e')][_0x6eec('0x3f')]){_0x25d3f3[_0x6eec('0x40')]=[{'all':!![]}];}_0x25d3f3=_['merge']({},_0x25d3f3,_0x125bd4[_0x6eec('0x3d')]);return db['UserProfileResource'][_0x6eec('0x45')](_0x25d3f3)[_0x6eec('0x20')](handleEntityNotFound(_0x34049a,null))[_0x6eec('0x20')](respondWithResult(_0x34049a,null))['catch'](handleError(_0x34049a,null));};exports[_0x6eec('0x46')]=function(_0x35a4a5,_0x14ee5e){return db[_0x6eec('0x28')][_0x6eec('0x46')](_0x35a4a5['body'],{})[_0x6eec('0x20')](respondWithResult(_0x14ee5e,0xc9))['catch'](handleError(_0x14ee5e,null));};exports['update']=function(_0x2529ad,_0x535d96){if(_0x2529ad[_0x6eec('0x47')]['id']){delete _0x2529ad[_0x6eec('0x47')]['id'];}return db[_0x6eec('0x28')]['find']({'where':{'id':_0x2529ad['params']['id']}})[_0x6eec('0x20')](handleEntityNotFound(_0x535d96,null))[_0x6eec('0x20')](saveUpdates(_0x2529ad[_0x6eec('0x47')],null))[_0x6eec('0x20')](respondWithResult(_0x535d96,null))[_0x6eec('0x41')](handleError(_0x535d96,null));};exports[_0x6eec('0x21')]=function(_0x185711,_0x442bca){return db[_0x6eec('0x28')][_0x6eec('0x45')]({'where':{'id':_0x185711['params']['id']}})['then'](handleEntityNotFound(_0x442bca,null))[_0x6eec('0x20')](removeEntity(_0x442bca,null))[_0x6eec('0x41')](handleError(_0x442bca,null));};exports[_0x6eec('0x48')]=function(_0x577fb6,_0x2c8400){return db[_0x6eec('0x28')][_0x6eec('0x48')]()[_0x6eec('0x20')](respondWithResult(_0x2c8400,null))[_0x6eec('0x41')](handleError(_0x2c8400,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index c89758b..65b359d 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 _0x7678=['exports','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x5072b6,_0x300d57){var _0x213867=function(_0x10d118){while(--_0x10d118){_0x5072b6['push'](_0x5072b6['shift']());}};_0x213867(++_0x300d57);}(_0x7678,0xd5));var _0x8767=function(_0x41aede,_0x17b0ef){_0x41aede=_0x41aede-0x0;var _0x377444=_0x7678[_0x41aede];return _0x377444;};'use strict';var _=require(_0x8767('0x0'));var util=require(_0x8767('0x1'));var logger=require(_0x8767('0x2'))(_0x8767('0x3'));var moment=require(_0x8767('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8767('0x5'));var config=require(_0x8767('0x6'));var attributes=require(_0x8767('0x7'));module[_0x8767('0x8')]=function(_0x3f7dae,_0x3c82c7){return _0x3f7dae['define'](_0x8767('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x8767('0xa'),'fields':[_0x8767('0xb'),_0x8767('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb242=['./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','sectionId','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb242,0x124));var _0x2b24=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xb242[_0x1269c6];return _0x4868c7;};'use strict';var _=require(_0x2b24('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2b24('0x1'));var moment=require(_0x2b24('0x2'));var BPromise=require('bluebird');var rp=require(_0x2b24('0x3'));var fs=require('fs');var path=require(_0x2b24('0x4'));var rimraf=require(_0x2b24('0x5'));var config=require(_0x2b24('0x6'));var attributes=require(_0x2b24('0x7'));module[_0x2b24('0x8')]=function(_0x1f52ce,_0x12bbf6){return _0x1f52ce[_0x2b24('0x9')](_0x2b24('0xa'),attributes,{'tableName':_0x2b24('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x2b24('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 b335e6d..14069f1 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 _0xde96=['UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x2de26c,_0x1efb07){var _0x4e3607=function(_0x4646d5){while(--_0x4646d5){_0x2de26c['push'](_0x2de26c['shift']());}};_0x4e3607(++_0x1efb07);}(_0xde96,0x101));var _0x6de9=function(_0xca465b,_0x470663){_0xca465b=_0xca465b-0x0;var _0x3d988d=_0xde96[_0xca465b];return _0x3d988d;};'use strict';var _=require(_0x6de9('0x0'));var util=require('util');var moment=require(_0x6de9('0x1'));var BPromise=require(_0x6de9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6de9('0x3'));var db=require(_0x6de9('0x4'))['db'];var utils=require(_0x6de9('0x5'));var logger=require(_0x6de9('0x6'))(_0x6de9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6de9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3168cc,_0x1274d5,_0x17029b){return new BPromise(function(_0x44b844,_0x1581fe){return client[_0x6de9('0x9')](_0x3168cc,_0x17029b)[_0x6de9('0xa')](function(_0x5a1b09){logger[_0x6de9('0xb')](_0x6de9('0xc'),_0x1274d5,'request\x20sent');logger['debug'](_0x6de9('0xd'),_0x1274d5,_0x6de9('0xe'),JSON['stringify'](_0x5a1b09));if(_0x5a1b09[_0x6de9('0xf')]){if(_0x5a1b09['error']['code']===0x1f4){logger[_0x6de9('0xf')](_0x6de9('0xc'),_0x1274d5,_0x5a1b09[_0x6de9('0xf')][_0x6de9('0x10')]);return _0x1581fe(_0x5a1b09[_0x6de9('0xf')][_0x6de9('0x10')]);}logger[_0x6de9('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x1274d5,_0x5a1b09[_0x6de9('0xf')][_0x6de9('0x10')]);return _0x44b844(_0x5a1b09[_0x6de9('0xf')][_0x6de9('0x10')]);}else{logger[_0x6de9('0xb')](_0x6de9('0xc'),_0x1274d5,_0x6de9('0xe'));_0x44b844(_0x5a1b09['result'][_0x6de9('0x10')]);}})[_0x6de9('0x11')](function(_0x35e710){logger[_0x6de9('0xf')](_0x6de9('0xc'),_0x1274d5,_0x35e710);_0x1581fe(_0x35e710);});});} \ No newline at end of file +var _0xbc3f=['info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x56cad9,_0x283604){var _0x50ce8e=function(_0x56cc8c){while(--_0x56cc8c){_0x56cad9['push'](_0x56cad9['shift']());}};_0x50ce8e(++_0x283604);}(_0xbc3f,0x17d));var _0xfbc3=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xbc3f[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0xfbc3('0x0'));var util=require('util');var moment=require(_0xfbc3('0x1'));var BPromise=require('bluebird');var rs=require(_0xfbc3('0x2'));var fs=require('fs');var Redis=require(_0xfbc3('0x3'));var db=require(_0xfbc3('0x4'))['db'];var utils=require(_0xfbc3('0x5'));var logger=require('../../config/logger')(_0xfbc3('0x6'));var config=require('../../config/environment');var jayson=require(_0xfbc3('0x7'));var client=jayson[_0xfbc3('0x8')][_0xfbc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a5c0,_0x400753,_0x6377ce){return new BPromise(function(_0x5ee44a,_0x4e78f5){return client[_0xfbc3('0xa')](_0x57a5c0,_0x6377ce)['then'](function(_0x60cc6c){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x400753,_0xfbc3('0xb'));logger['debug'](_0xfbc3('0xc'),_0x400753,'request\x20sent',JSON[_0xfbc3('0xd')](_0x60cc6c));if(_0x60cc6c['error']){if(_0x60cc6c[_0xfbc3('0xe')][_0xfbc3('0xf')]===0x1f4){logger[_0xfbc3('0xe')](_0xfbc3('0x10'),_0x400753,_0x60cc6c[_0xfbc3('0xe')][_0xfbc3('0x11')]);return _0x4e78f5(_0x60cc6c[_0xfbc3('0xe')]['message']);}logger[_0xfbc3('0xe')](_0xfbc3('0x10'),_0x400753,_0x60cc6c[_0xfbc3('0xe')][_0xfbc3('0x11')]);return _0x5ee44a(_0x60cc6c['error'][_0xfbc3('0x11')]);}else{logger[_0xfbc3('0x12')](_0xfbc3('0x10'),_0x400753,_0xfbc3('0xb'));_0x5ee44a(_0x60cc6c[_0xfbc3('0x13')][_0xfbc3('0x11')]);}})[_0xfbc3('0x14')](function(_0x3dbb6a){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x400753,_0x3dbb6a);_0x4e78f5(_0x3dbb6a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c8bd09e..17f6753 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 _0xb4fc=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x50fb36,_0x29d64a){var _0x2375e1=function(_0x32737f){while(--_0x32737f){_0x50fb36['push'](_0x50fb36['shift']());}};_0x2375e1(++_0x29d64a);}(_0xb4fc,0xdd));var _0xcb4f=function(_0xe80c36,_0x5afcce){_0xe80c36=_0xe80c36-0x0;var _0x47ff62=_0xb4fc[_0xe80c36];return _0x47ff62;};'use strict';var multer=require('multer');var util=require(_0xcb4f('0x0'));var path=require(_0xcb4f('0x1'));var timeout=require(_0xcb4f('0x2'));var express=require(_0xcb4f('0x3'));var router=express[_0xcb4f('0x4')]();var auth=require(_0xcb4f('0x5'));var interaction=require(_0xcb4f('0x6'));var config=require(_0xcb4f('0x7'));var controller=require(_0xcb4f('0x8'));router[_0xcb4f('0x9')]('/',auth[_0xcb4f('0xa')](),controller[_0xcb4f('0xb')]);router[_0xcb4f('0x9')](_0xcb4f('0xc'),auth['isAuthenticated'](),controller[_0xcb4f('0xd')]);router[_0xcb4f('0x9')](_0xcb4f('0xe'),auth['isAuthenticated'](),controller[_0xcb4f('0xf')]);router[_0xcb4f('0x10')]('/',auth[_0xcb4f('0xa')](),controller[_0xcb4f('0x11')]);router[_0xcb4f('0x12')]('/:id',auth[_0xcb4f('0xa')](),controller['update']);router[_0xcb4f('0x13')](_0xcb4f('0xe'),auth[_0xcb4f('0xa')](),controller['destroy']);module[_0xcb4f('0x14')]=router; \ No newline at end of file +var _0x18fe=['isAuthenticated','/describe','describe','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2dfb34,_0x87239d){var _0x9029de=function(_0x35f096){while(--_0x35f096){_0x2dfb34['push'](_0x2dfb34['shift']());}};_0x9029de(++_0x87239d);}(_0x18fe,0x13a));var _0xe18f=function(_0x36e374,_0x32ac0c){_0x36e374=_0x36e374-0x0;var _0x1ee011=_0x18fe[_0x36e374];return _0x1ee011;};'use strict';var multer=require(_0xe18f('0x0'));var util=require(_0xe18f('0x1'));var path=require(_0xe18f('0x2'));var timeout=require(_0xe18f('0x3'));var express=require(_0xe18f('0x4'));var router=express[_0xe18f('0x5')]();var auth=require(_0xe18f('0x6'));var interaction=require(_0xe18f('0x7'));var config=require(_0xe18f('0x8'));var controller=require('./userProfileSection.controller');router[_0xe18f('0x9')]('/',auth[_0xe18f('0xa')](),controller['index']);router[_0xe18f('0x9')](_0xe18f('0xb'),auth[_0xe18f('0xa')](),controller[_0xe18f('0xc')]);router[_0xe18f('0x9')]('/:id',auth[_0xe18f('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe18f('0xd')](_0xe18f('0xe'),auth[_0xe18f('0xa')](),controller[_0xe18f('0xf')]);router['delete'](_0xe18f('0xe'),auth[_0xe18f('0xa')](),controller[_0xe18f('0x10')]);module[_0xe18f('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 16eec12..e7fea33 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 _0x89c3=['exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','sequelize'];(function(_0x31ae7,_0x4579bc){var _0x2b35c2=function(_0x4ab8c8){while(--_0x4ab8c8){_0x31ae7['push'](_0x31ae7['shift']());}};_0x2b35c2(++_0x4579bc);}(_0x89c3,0xff));var _0x389c=function(_0x59d397,_0x1d533a){_0x59d397=_0x59d397-0x0;var _0x51e979=_0x89c3[_0x59d397];return _0x51e979;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x389c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x389c('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x389c('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x389c('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x389c('0x2')],'set':function(_0x5c6c68){this[_0x389c('0x5')]('crudPermissions',_0x5c6c68?_0x5c6c68[_0x389c('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x389c('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x6f2d=['getDataValue','split','sequelize','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x29a59a,_0x5934a2){var _0x44293e=function(_0x176dd6){while(--_0x176dd6){_0x29a59a['push'](_0x29a59a['shift']());}};_0x44293e(++_0x5934a2);}(_0x6f2d,0x182));var _0xd6f2=function(_0x21edef,_0x5bddcc){_0x21edef=_0x21edef-0x0;var _0x44ee34=_0x6f2d[_0x21edef];return _0x44ee34;};'use strict';var Sequelize=require(_0xd6f2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xd6f2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xd6f2('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd6f2('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd6f2('0x1')],'set':function(_0x13ab05){this[_0xd6f2('0x3')](_0xd6f2('0x4'),_0x13ab05?_0x13ab05[_0xd6f2('0x5')](''):[]);},'get':function(){return this[_0xd6f2('0x6')](_0xd6f2('0x4'))?this[_0xd6f2('0x6')](_0xd6f2('0x4'))[_0xd6f2('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e0487b3..7ee5af2 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 _0x4092=['findAll','rows','catch','show','options','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','limit','set','Content-Range','json','reject','destroy','then','error','name','send','UserProfileSection','rawAttributes','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','count','include'];(function(_0x5bd5fc,_0x57597){var _0x420110=function(_0x3d99d8){while(--_0x3d99d8){_0x5bd5fc['push'](_0x5bd5fc['shift']());}};_0x420110(++_0x57597);}(_0x4092,0x1af));var _0x2409=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x4092[_0x56f7e2];return _0x36240b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2409('0x0'));var rimraf=require(_0x2409('0x1'));var zipdir=require(_0x2409('0x2'));var jsonpatch=require(_0x2409('0x3'));var rp=require(_0x2409('0x4'));var moment=require(_0x2409('0x5'));var BPromise=require(_0x2409('0x6'));var Mustache=require(_0x2409('0x7'));var util=require(_0x2409('0x8'));var path=require('path');var sox=require(_0x2409('0x9'));var csv=require(_0x2409('0xa'));var ejs=require(_0x2409('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2409('0xc'));var crypto=require(_0x2409('0xd'));var jsforce=require(_0x2409('0xe'));var deskjs=require(_0x2409('0xf'));var toCsv=require(_0x2409('0xa'));var querystring=require(_0x2409('0x10'));var Papa=require(_0x2409('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2409('0x12'));var as=require(_0x2409('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2409('0x14'));var utils=require('../../config/utils');var config=require(_0x2409('0x15'));var db=require(_0x2409('0x16'))['db'];function respondWithStatusCode(_0x149812,_0x5cd1f1){_0x5cd1f1=_0x5cd1f1||0xcc;return function(_0x580f8c){if(_0x580f8c){return _0x149812[_0x2409('0x17')](_0x5cd1f1);}return _0x149812[_0x2409('0x18')](_0x5cd1f1)['end']();};}function respondWithResult(_0x58532f,_0x3d1ad3){_0x3d1ad3=_0x3d1ad3||0xc8;return function(_0x3a6f0e){if(_0x3a6f0e){return _0x58532f['status'](_0x3d1ad3)['json'](_0x3a6f0e);}};}function respondWithFilteredResult(_0x575d51,_0xc24deb){return function(_0x1f9eda){if(_0x1f9eda){var _0x289dcf=_0x1f9eda['count'],_0x449a3d=_0xc24deb['offset'],_0x1937ce=_0xc24deb['offset']+_0xc24deb[_0x2409('0x19')],_0x1557ed;if(_0x1937ce>=_0x289dcf){_0x1937ce=_0x289dcf;_0x1557ed=0xc8;}else{_0x1557ed=0xce;}_0x575d51[_0x2409('0x18')](_0x1557ed);return _0x575d51[_0x2409('0x1a')](_0x2409('0x1b'),_0x449a3d+'-'+_0x1937ce+'/'+_0x289dcf)[_0x2409('0x1c')](_0x1f9eda);}return null;};}function patchUpdates(_0x31e28c){return function(_0x5aa2c1){try{jsonpatch['apply'](_0x5aa2c1,_0x31e28c,!![]);}catch(_0xfd1ea8){return BPromise[_0x2409('0x1d')](_0xfd1ea8);}return _0x5aa2c1['save']();};}function saveUpdates(_0x5daa29,_0x3da4fd){return function(_0x3c78ca){if(_0x3c78ca){return _0x3c78ca['update'](_0x5daa29)['then'](function(_0x21454f){return _0x21454f;});}return null;};}function removeEntity(_0x12c0e0,_0x3a9620){return function(_0x33c6df){if(_0x33c6df){return _0x33c6df[_0x2409('0x1e')]()[_0x2409('0x1f')](function(){_0x12c0e0[_0x2409('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x559c92,_0x17809d){return function(_0x47f7d7){if(!_0x47f7d7){_0x559c92[_0x2409('0x17')](0x194);}return _0x47f7d7;};}function handleError(_0x1eabd1,_0x53f382){_0x53f382=_0x53f382||0x1f4;return function(_0x27e1c9){logger[_0x2409('0x20')](_0x27e1c9['stack']);if(_0x27e1c9[_0x2409('0x21')]){delete _0x27e1c9[_0x2409('0x21')];}_0x1eabd1[_0x2409('0x18')](_0x53f382)[_0x2409('0x22')](_0x27e1c9);};}exports['index']=function(_0x25d2fb,_0x3f7277){var _0x1f5ed2={},_0x592c5d={},_0x97c0cb={'count':0x0,'rows':[]};var _0x411e8d=_['map'](db[_0x2409('0x23')][_0x2409('0x24')],function(_0x1ad2b3){return{'name':_0x1ad2b3['fieldName'],'type':_0x1ad2b3[_0x2409('0x25')][_0x2409('0x26')]};});_0x592c5d['model']=_[_0x2409('0x27')](_0x411e8d,_0x2409('0x21'));_0x592c5d['query']=_[_0x2409('0x28')](_0x25d2fb[_0x2409('0x29')]);_0x592c5d[_0x2409('0x2a')]=_[_0x2409('0x2b')](_0x592c5d['model'],_0x592c5d['query']);_0x1f5ed2[_0x2409('0x2c')]=_[_0x2409('0x2b')](_0x592c5d[_0x2409('0x2d')],qs[_0x2409('0x2e')](_0x25d2fb[_0x2409('0x29')][_0x2409('0x2e')]));_0x1f5ed2[_0x2409('0x2c')]=_0x1f5ed2['attributes'][_0x2409('0x2f')]?_0x1f5ed2[_0x2409('0x2c')]:_0x592c5d[_0x2409('0x2d')];if(!_0x25d2fb[_0x2409('0x29')][_0x2409('0x30')]('nolimit')){_0x1f5ed2[_0x2409('0x19')]=qs[_0x2409('0x19')](_0x25d2fb['query'][_0x2409('0x19')]);_0x1f5ed2[_0x2409('0x31')]=qs['offset'](_0x25d2fb[_0x2409('0x29')][_0x2409('0x31')]);}_0x1f5ed2[_0x2409('0x32')]=qs[_0x2409('0x33')](_0x25d2fb[_0x2409('0x29')]['sort']);_0x1f5ed2[_0x2409('0x34')]=qs[_0x2409('0x2a')](_[_0x2409('0x35')](_0x25d2fb['query'],_0x592c5d[_0x2409('0x2a')]),_0x411e8d);if(_0x25d2fb[_0x2409('0x29')][_0x2409('0x36')]){_0x1f5ed2[_0x2409('0x34')]=_[_0x2409('0x37')](_0x1f5ed2['where'],{'$or':_[_0x2409('0x27')](_0x411e8d,function(_0x2c9a52){if(_0x2c9a52[_0x2409('0x25')]!==_0x2409('0x38')){var _0x26936c={};_0x26936c[_0x2c9a52[_0x2409('0x21')]]={'$like':'%'+_0x25d2fb[_0x2409('0x29')][_0x2409('0x36')]+'%'};return _0x26936c;}})});}_0x1f5ed2=_[_0x2409('0x37')]({},_0x1f5ed2,_0x25d2fb['options']);var _0x33faa2={'where':_0x1f5ed2[_0x2409('0x34')]};return db[_0x2409('0x23')]['count'](_0x33faa2)[_0x2409('0x1f')](function(_0x1f7d0d){_0x97c0cb[_0x2409('0x39')]=_0x1f7d0d;if(_0x25d2fb[_0x2409('0x29')]['includeAll']){_0x1f5ed2[_0x2409('0x3a')]=[{'all':!![]}];}return db[_0x2409('0x23')][_0x2409('0x3b')](_0x1f5ed2);})[_0x2409('0x1f')](function(_0x2aceb6){_0x97c0cb[_0x2409('0x3c')]=_0x2aceb6;return _0x97c0cb;})[_0x2409('0x1f')](respondWithFilteredResult(_0x3f7277,_0x1f5ed2))[_0x2409('0x3d')](handleError(_0x3f7277,null));};exports[_0x2409('0x3e')]=function(_0x6fa16,_0x542254){var _0x57f775={'raw':![],'where':{'id':_0x6fa16['params']['id']}},_0x40ea42={};_0x40ea42[_0x2409('0x2d')]=_[_0x2409('0x28')](db[_0x2409('0x23')][_0x2409('0x24')]);_0x40ea42['query']=_['keys'](_0x6fa16[_0x2409('0x29')]);_0x40ea42[_0x2409('0x2a')]=_['intersection'](_0x40ea42[_0x2409('0x2d')],_0x40ea42[_0x2409('0x29')]);_0x57f775['attributes']=_[_0x2409('0x2b')](_0x40ea42[_0x2409('0x2d')],qs[_0x2409('0x2e')](_0x6fa16[_0x2409('0x29')]['fields']));_0x57f775[_0x2409('0x2c')]=_0x57f775['attributes']['length']?_0x57f775['attributes']:_0x40ea42[_0x2409('0x2d')];if(_0x6fa16['query']['includeAll']){_0x57f775[_0x2409('0x3a')]=[{'all':!![]}];}_0x57f775=_['merge']({},_0x57f775,_0x6fa16[_0x2409('0x3f')]);return db['UserProfileSection']['find'](_0x57f775)[_0x2409('0x1f')](handleEntityNotFound(_0x542254,null))[_0x2409('0x1f')](respondWithResult(_0x542254,null))['catch'](handleError(_0x542254,null));};exports[_0x2409('0x40')]=function(_0x288913,_0x137314){return db[_0x2409('0x23')][_0x2409('0x40')](_0x288913['body'],{})[_0x2409('0x1f')](respondWithResult(_0x137314,0xc9))[_0x2409('0x3d')](handleError(_0x137314,null));};exports[_0x2409('0x41')]=function(_0xfc710,_0x265d73){if(_0xfc710[_0x2409('0x42')]['id']){delete _0xfc710[_0x2409('0x42')]['id'];}return db[_0x2409('0x23')][_0x2409('0x43')]({'where':{'id':_0xfc710[_0x2409('0x44')]['id']}})[_0x2409('0x1f')](handleEntityNotFound(_0x265d73,null))[_0x2409('0x1f')](saveUpdates(_0xfc710[_0x2409('0x42')],null))[_0x2409('0x1f')](respondWithResult(_0x265d73,null))[_0x2409('0x3d')](handleError(_0x265d73,null));};exports[_0x2409('0x1e')]=function(_0x43a219,_0x43aebd){return db[_0x2409('0x23')][_0x2409('0x43')]({'where':{'id':_0x43a219[_0x2409('0x44')]['id']}})[_0x2409('0x1f')](handleEntityNotFound(_0x43aebd,null))[_0x2409('0x1f')](removeEntity(_0x43aebd,null))[_0x2409('0x3d')](handleError(_0x43aebd,null));};exports['describe']=function(_0x4003bc,_0x3ab6d8){return db['UserProfileSection'][_0x2409('0x45')]()[_0x2409('0x1f')](respondWithResult(_0x3ab6d8,null))['catch'](handleError(_0x3ab6d8,null));}; \ No newline at end of file +var _0xcb06=['params','rawAttributes','find','create','body','update','describe','zip-dir','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','then','destroy','end','stack','name','send','index','map','UserProfileSection','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcb06,0x127));var _0x6cb0=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xcb06[_0x3071ab];return _0x2f458c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6cb0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cb0('0x1'));var moment=require('moment');var BPromise=require(_0x6cb0('0x2'));var Mustache=require('mustache');var util=require(_0x6cb0('0x3'));var path=require('path');var sox=require(_0x6cb0('0x4'));var csv=require(_0x6cb0('0x5'));var ejs=require(_0x6cb0('0x6'));var fs=require('fs');var _=require(_0x6cb0('0x7'));var squel=require(_0x6cb0('0x8'));var crypto=require(_0x6cb0('0x9'));var jsforce=require(_0x6cb0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6cb0('0x5'));var querystring=require(_0x6cb0('0xb'));var Papa=require(_0x6cb0('0xc'));var Redis=require(_0x6cb0('0xd'));var authService=require(_0x6cb0('0xe'));var qs=require(_0x6cb0('0xf'));var as=require(_0x6cb0('0x10'));var hardwareService=require(_0x6cb0('0x11'));var logger=require(_0x6cb0('0x12'))(_0x6cb0('0x13'));var utils=require(_0x6cb0('0x14'));var config=require(_0x6cb0('0x15'));var db=require(_0x6cb0('0x16'))['db'];function respondWithStatusCode(_0x5633b8,_0x5161c5){_0x5161c5=_0x5161c5||0xcc;return function(_0x141a9f){if(_0x141a9f){return _0x5633b8[_0x6cb0('0x17')](_0x5161c5);}return _0x5633b8[_0x6cb0('0x18')](_0x5161c5)['end']();};}function respondWithResult(_0x37409f,_0x3b2b85){_0x3b2b85=_0x3b2b85||0xc8;return function(_0x362fd4){if(_0x362fd4){return _0x37409f[_0x6cb0('0x18')](_0x3b2b85)[_0x6cb0('0x19')](_0x362fd4);}};}function respondWithFilteredResult(_0x270215,_0x47fa55){return function(_0x7609a){if(_0x7609a){var _0x2b633e=_0x7609a[_0x6cb0('0x1a')],_0xb6b531=_0x47fa55[_0x6cb0('0x1b')],_0x51d0db=_0x47fa55[_0x6cb0('0x1b')]+_0x47fa55[_0x6cb0('0x1c')],_0x1a4e69;if(_0x51d0db>=_0x2b633e){_0x51d0db=_0x2b633e;_0x1a4e69=0xc8;}else{_0x1a4e69=0xce;}_0x270215[_0x6cb0('0x18')](_0x1a4e69);return _0x270215['set'](_0x6cb0('0x1d'),_0xb6b531+'-'+_0x51d0db+'/'+_0x2b633e)[_0x6cb0('0x19')](_0x7609a);}return null;};}function patchUpdates(_0x456243){return function(_0x40d40a){try{jsonpatch[_0x6cb0('0x1e')](_0x40d40a,_0x456243,!![]);}catch(_0x38c61a){return BPromise['reject'](_0x38c61a);}return _0x40d40a['save']();};}function saveUpdates(_0x366e71,_0x2ca4c8){return function(_0x52d250){if(_0x52d250){return _0x52d250['update'](_0x366e71)[_0x6cb0('0x1f')](function(_0x3874cb){return _0x3874cb;});}return null;};}function removeEntity(_0x2eee4d,_0x590c69){return function(_0xe1ffd1){if(_0xe1ffd1){return _0xe1ffd1[_0x6cb0('0x20')]()[_0x6cb0('0x1f')](function(){_0x2eee4d['status'](0xcc)[_0x6cb0('0x21')]();});}};}function handleEntityNotFound(_0x3182c0,_0x412eea){return function(_0x3402b3){if(!_0x3402b3){_0x3182c0['sendStatus'](0x194);}return _0x3402b3;};}function handleError(_0x246cab,_0x99aebc){_0x99aebc=_0x99aebc||0x1f4;return function(_0x4302e0){logger['error'](_0x4302e0[_0x6cb0('0x22')]);if(_0x4302e0[_0x6cb0('0x23')]){delete _0x4302e0[_0x6cb0('0x23')];}_0x246cab[_0x6cb0('0x18')](_0x99aebc)[_0x6cb0('0x24')](_0x4302e0);};}exports[_0x6cb0('0x25')]=function(_0x4953d5,_0x3ca195){var _0x3c97f9={},_0x58aa93={},_0x1b5648={'count':0x0,'rows':[]};var _0x5be66e=_[_0x6cb0('0x26')](db[_0x6cb0('0x27')]['rawAttributes'],function(_0x838416){return{'name':_0x838416['fieldName'],'type':_0x838416[_0x6cb0('0x28')][_0x6cb0('0x29')]};});_0x58aa93[_0x6cb0('0x2a')]=_[_0x6cb0('0x26')](_0x5be66e,_0x6cb0('0x23'));_0x58aa93[_0x6cb0('0x2b')]=_[_0x6cb0('0x2c')](_0x4953d5['query']);_0x58aa93[_0x6cb0('0x2d')]=_['intersection'](_0x58aa93['model'],_0x58aa93[_0x6cb0('0x2b')]);_0x3c97f9['attributes']=_[_0x6cb0('0x2e')](_0x58aa93[_0x6cb0('0x2a')],qs[_0x6cb0('0x2f')](_0x4953d5['query'][_0x6cb0('0x2f')]));_0x3c97f9['attributes']=_0x3c97f9[_0x6cb0('0x30')][_0x6cb0('0x31')]?_0x3c97f9['attributes']:_0x58aa93['model'];if(!_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x32')](_0x6cb0('0x33'))){_0x3c97f9['limit']=qs['limit'](_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x1c')]);_0x3c97f9[_0x6cb0('0x1b')]=qs[_0x6cb0('0x1b')](_0x4953d5['query'][_0x6cb0('0x1b')]);}_0x3c97f9[_0x6cb0('0x34')]=qs['sort'](_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x35')]);_0x3c97f9[_0x6cb0('0x36')]=qs[_0x6cb0('0x2d')](_[_0x6cb0('0x37')](_0x4953d5[_0x6cb0('0x2b')],_0x58aa93[_0x6cb0('0x2d')]),_0x5be66e);if(_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x38')]){_0x3c97f9[_0x6cb0('0x36')]=_['merge'](_0x3c97f9['where'],{'$or':_[_0x6cb0('0x26')](_0x5be66e,function(_0x447d3b){if(_0x447d3b[_0x6cb0('0x28')]!==_0x6cb0('0x39')){var _0x43347c={};_0x43347c[_0x447d3b['name']]={'$like':'%'+_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x38')]+'%'};return _0x43347c;}})});}_0x3c97f9=_[_0x6cb0('0x3a')]({},_0x3c97f9,_0x4953d5[_0x6cb0('0x3b')]);var _0x1de44c={'where':_0x3c97f9[_0x6cb0('0x36')]};return db[_0x6cb0('0x27')][_0x6cb0('0x1a')](_0x1de44c)['then'](function(_0x71a9aa){_0x1b5648[_0x6cb0('0x1a')]=_0x71a9aa;if(_0x4953d5[_0x6cb0('0x2b')][_0x6cb0('0x3c')]){_0x3c97f9[_0x6cb0('0x3d')]=[{'all':!![]}];}return db[_0x6cb0('0x27')][_0x6cb0('0x3e')](_0x3c97f9);})[_0x6cb0('0x1f')](function(_0x2596c1){_0x1b5648['rows']=_0x2596c1;return _0x1b5648;})[_0x6cb0('0x1f')](respondWithFilteredResult(_0x3ca195,_0x3c97f9))[_0x6cb0('0x3f')](handleError(_0x3ca195,null));};exports[_0x6cb0('0x40')]=function(_0x56eb13,_0x1de967){var _0x5cb198={'raw':![],'where':{'id':_0x56eb13[_0x6cb0('0x41')]['id']}},_0x4ec8dd={};_0x4ec8dd[_0x6cb0('0x2a')]=_[_0x6cb0('0x2c')](db[_0x6cb0('0x27')][_0x6cb0('0x42')]);_0x4ec8dd[_0x6cb0('0x2b')]=_['keys'](_0x56eb13[_0x6cb0('0x2b')]);_0x4ec8dd['filters']=_[_0x6cb0('0x2e')](_0x4ec8dd['model'],_0x4ec8dd[_0x6cb0('0x2b')]);_0x5cb198['attributes']=_[_0x6cb0('0x2e')](_0x4ec8dd[_0x6cb0('0x2a')],qs[_0x6cb0('0x2f')](_0x56eb13[_0x6cb0('0x2b')][_0x6cb0('0x2f')]));_0x5cb198[_0x6cb0('0x30')]=_0x5cb198['attributes'][_0x6cb0('0x31')]?_0x5cb198[_0x6cb0('0x30')]:_0x4ec8dd['model'];if(_0x56eb13['query'][_0x6cb0('0x3c')]){_0x5cb198[_0x6cb0('0x3d')]=[{'all':!![]}];}_0x5cb198=_[_0x6cb0('0x3a')]({},_0x5cb198,_0x56eb13['options']);return db[_0x6cb0('0x27')][_0x6cb0('0x43')](_0x5cb198)[_0x6cb0('0x1f')](handleEntityNotFound(_0x1de967,null))[_0x6cb0('0x1f')](respondWithResult(_0x1de967,null))[_0x6cb0('0x3f')](handleError(_0x1de967,null));};exports[_0x6cb0('0x44')]=function(_0x304bf3,_0x5d61e3){return db[_0x6cb0('0x27')][_0x6cb0('0x44')](_0x304bf3[_0x6cb0('0x45')],{})[_0x6cb0('0x1f')](respondWithResult(_0x5d61e3,0xc9))[_0x6cb0('0x3f')](handleError(_0x5d61e3,null));};exports[_0x6cb0('0x46')]=function(_0x495011,_0x8012e2){if(_0x495011[_0x6cb0('0x45')]['id']){delete _0x495011[_0x6cb0('0x45')]['id'];}return db['UserProfileSection'][_0x6cb0('0x43')]({'where':{'id':_0x495011[_0x6cb0('0x41')]['id']}})[_0x6cb0('0x1f')](handleEntityNotFound(_0x8012e2,null))['then'](saveUpdates(_0x495011[_0x6cb0('0x45')],null))[_0x6cb0('0x1f')](respondWithResult(_0x8012e2,null))[_0x6cb0('0x3f')](handleError(_0x8012e2,null));};exports[_0x6cb0('0x20')]=function(_0x8f2228,_0x4c1bcf){return db[_0x6cb0('0x27')][_0x6cb0('0x43')]({'where':{'id':_0x8f2228[_0x6cb0('0x41')]['id']}})[_0x6cb0('0x1f')](handleEntityNotFound(_0x4c1bcf,null))[_0x6cb0('0x1f')](removeEntity(_0x4c1bcf,null))[_0x6cb0('0x3f')](handleError(_0x4c1bcf,null));};exports[_0x6cb0('0x47')]=function(_0x331b53,_0x4d4c0f){return db[_0x6cb0('0x27')][_0x6cb0('0x47')]()[_0x6cb0('0x1f')](respondWithResult(_0x4d4c0f,null))[_0x6cb0('0x3f')](handleError(_0x4d4c0f,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index da887f9..dffa07c 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 _0xd71f=['../../config/environment','define','UserProfileSection','sectionId','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x14ab31,_0x4dff45){var _0x5458ea=function(_0x4e8ce8){while(--_0x4e8ce8){_0x14ab31['push'](_0x14ab31['shift']());}};_0x5458ea(++_0x4dff45);}(_0xd71f,0x101));var _0xfd71=function(_0x239879,_0x14cc25){_0x239879=_0x239879-0x0;var _0x59d26d=_0xd71f[_0x239879];return _0x59d26d;};'use strict';var _=require(_0xfd71('0x0'));var util=require('util');var logger=require(_0xfd71('0x1'))(_0xfd71('0x2'));var moment=require(_0xfd71('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd71('0x4'));var fs=require('fs');var path=require(_0xfd71('0x5'));var rimraf=require(_0xfd71('0x6'));var config=require(_0xfd71('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x29b202,_0x1917ea){return _0x29b202[_0xfd71('0x8')](_0xfd71('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xfd71('0xa'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ee4=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ee4,0x179));var _0x44ee=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x4ee4[_0x903228];return _0xcec81d;};'use strict';var _=require(_0x44ee('0x0'));var util=require(_0x44ee('0x1'));var logger=require(_0x44ee('0x2'))(_0x44ee('0x3'));var moment=require('moment');var BPromise=require(_0x44ee('0x4'));var rp=require(_0x44ee('0x5'));var fs=require('fs');var path=require(_0x44ee('0x6'));var rimraf=require(_0x44ee('0x7'));var config=require(_0x44ee('0x8'));var attributes=require(_0x44ee('0x9'));module[_0x44ee('0xa')]=function(_0x355e5a,_0x3de2fa){return _0x355e5a[_0x44ee('0xb')](_0x44ee('0xc'),attributes,{'tableName':_0x44ee('0xd'),'paranoid':![],'indexes':[{'name':_0x44ee('0xe'),'fields':[_0x44ee('0xf'),_0x44ee('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e77bd21..63b8425 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 _0xbebd=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x24c134,_0x108719){var _0x18817b=function(_0x10b8fc){while(--_0x10b8fc){_0x24c134['push'](_0x24c134['shift']());}};_0x18817b(++_0x108719);}(_0xbebd,0x1ab));var _0xdbeb=function(_0x2569c5,_0x47f34c){_0x2569c5=_0x2569c5-0x0;var _0xacda67=_0xbebd[_0x2569c5];return _0xacda67;};'use strict';var _=require(_0xdbeb('0x0'));var util=require(_0xdbeb('0x1'));var moment=require('moment');var BPromise=require(_0xdbeb('0x2'));var rs=require(_0xdbeb('0x3'));var fs=require('fs');var Redis=require(_0xdbeb('0x4'));var db=require(_0xdbeb('0x5'))['db'];var utils=require(_0xdbeb('0x6'));var logger=require(_0xdbeb('0x7'))(_0xdbeb('0x8'));var config=require(_0xdbeb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdbeb('0xa')][_0xdbeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab6610,_0x985480,_0x494e71){return new BPromise(function(_0x2980ca,_0x149774){return client[_0xdbeb('0xc')](_0xab6610,_0x494e71)[_0xdbeb('0xd')](function(_0x5bbf4a){logger[_0xdbeb('0xe')](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));logger[_0xdbeb('0x11')](_0xdbeb('0x12'),_0x985480,'request\x20sent',JSON['stringify'](_0x5bbf4a));if(_0x5bbf4a[_0xdbeb('0x13')]){if(_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x14')]===0x1f4){logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x149774(_0x5bbf4a['error'][_0xdbeb('0x15')]);}logger['error'](_0xdbeb('0xf'),_0x985480,_0x5bbf4a[_0xdbeb('0x13')][_0xdbeb('0x15')]);return _0x2980ca(_0x5bbf4a['error'][_0xdbeb('0x15')]);}else{logger['info'](_0xdbeb('0xf'),_0x985480,_0xdbeb('0x10'));_0x2980ca(_0x5bbf4a['result'][_0xdbeb('0x15')]);}})['catch'](function(_0x46b13e){logger[_0xdbeb('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x985480,_0x46b13e);_0x149774(_0x46b13e);});});} \ No newline at end of file +var _0xe884=['UserProfileSection,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','result'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0xe884,0xb1));var _0x4e88=function(_0x38daf2,_0x391fa1){_0x38daf2=_0x38daf2-0x0;var _0x7f0cc3=_0xe884[_0x38daf2];return _0x7f0cc3;};'use strict';var _=require(_0x4e88('0x0'));var util=require(_0x4e88('0x1'));var moment=require(_0x4e88('0x2'));var BPromise=require(_0x4e88('0x3'));var rs=require(_0x4e88('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e88('0x5'))['db'];var utils=require(_0x4e88('0x6'));var logger=require('../../config/logger')(_0x4e88('0x7'));var config=require(_0x4e88('0x8'));var jayson=require(_0x4e88('0x9'));var client=jayson[_0x4e88('0xa')][_0x4e88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7f9332,_0x36e45a,_0x268ee2){return new BPromise(function(_0xa5f563,_0x1962cd){return client[_0x4e88('0xc')](_0x7f9332,_0x268ee2)[_0x4e88('0xd')](function(_0x414b08){logger[_0x4e88('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x36e45a,_0x4e88('0xf'));logger[_0x4e88('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x36e45a,_0x4e88('0xf'),JSON['stringify'](_0x414b08));if(_0x414b08[_0x4e88('0x11')]){if(_0x414b08[_0x4e88('0x11')][_0x4e88('0x12')]===0x1f4){logger[_0x4e88('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x36e45a,_0x414b08['error'][_0x4e88('0x13')]);return _0x1962cd(_0x414b08[_0x4e88('0x11')][_0x4e88('0x13')]);}logger[_0x4e88('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x36e45a,_0x414b08['error']['message']);return _0xa5f563(_0x414b08[_0x4e88('0x11')]['message']);}else{logger[_0x4e88('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x36e45a,_0x4e88('0xf'));_0xa5f563(_0x414b08[_0x4e88('0x14')][_0x4e88('0x13')]);}})['catch'](function(_0x5bea13){logger['error'](_0x4e88('0x15'),_0x36e45a,_0x5bea13);_0x1962cd(_0x5bea13);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 01944e8..2f9ec16 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 _0x292f=['exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x35f5a5,_0x3f8a65){var _0x143dce=function(_0x5c3197){while(--_0x5c3197){_0x35f5a5['push'](_0x35f5a5['shift']());}};_0x143dce(++_0x3f8a65);}(_0x292f,0x1c8));var _0xf292=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x292f[_0x231dda];return _0x3f88cb;};'use strict';var multer=require(_0xf292('0x0'));var util=require(_0xf292('0x1'));var path=require(_0xf292('0x2'));var timeout=require('connect-timeout');var express=require(_0xf292('0x3'));var router=express[_0xf292('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf292('0x5'));var config=require('../../config/environment');module[_0xf292('0x6')]=router; \ No newline at end of file +var _0x9a1a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x7e61c5,_0x3514aa){var _0x3106ea=function(_0x3d58ef){while(--_0x3d58ef){_0x7e61c5['push'](_0x7e61c5['shift']());}};_0x3106ea(++_0x3514aa);}(_0x9a1a,0x12f));var _0xa9a1=function(_0x37b713,_0x248677){_0x37b713=_0x37b713-0x0;var _0xae950c=_0x9a1a[_0x37b713];return _0xae950c;};'use strict';var multer=require(_0xa9a1('0x0'));var util=require('util');var path=require(_0xa9a1('0x1'));var timeout=require(_0xa9a1('0x2'));var express=require(_0xa9a1('0x3'));var router=express[_0xa9a1('0x4')]();var auth=require(_0xa9a1('0x5'));var interaction=require(_0xa9a1('0x6'));var config=require(_0xa9a1('0x7'));module[_0xa9a1('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 7520f21..8d67bfd 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 _0xd8b0=['exports','sequelize'];(function(_0x4c5a24,_0x5ef60c){var _0x4b067e=function(_0x33c0da){while(--_0x33c0da){_0x4c5a24['push'](_0x4c5a24['shift']());}};_0x4b067e(++_0x5ef60c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x4d2938,_0x332d65){var _0x5e7d9b=function(_0x135e24){while(--_0x135e24){_0x4d2938['push'](_0x4d2938['shift']());}};_0x5e7d9b(++_0x332d65);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'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 5a186a3..c6580b7 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 _0x5662=['define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5662,0xf9));var _0x2566=function(_0x37e7da,_0x492b80){_0x37e7da=_0x37e7da-0x0;var _0x391672=_0x5662[_0x37e7da];return _0x391672;};'use strict';var _=require(_0x2566('0x0'));var util=require(_0x2566('0x1'));var logger=require(_0x2566('0x2'))('api');var moment=require(_0x2566('0x3'));var BPromise=require(_0x2566('0x4'));var rp=require(_0x2566('0x5'));var fs=require('fs');var path=require(_0x2566('0x6'));var rimraf=require(_0x2566('0x7'));var config=require(_0x2566('0x8'));var attributes=require(_0x2566('0x9'));module[_0x2566('0xa')]=function(_0xcfca2,_0x481299){return _0xcfca2[_0x2566('0xb')](_0x2566('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce64=['user_has_sms_queues','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue'];(function(_0x567c09,_0x7f9a1d){var _0x4723f8=function(_0x562192){while(--_0x562192){_0x567c09['push'](_0x567c09['shift']());}};_0x4723f8(++_0x7f9a1d);}(_0xce64,0x105));var _0x4ce6=function(_0x3bb04c,_0x4af802){_0x3bb04c=_0x3bb04c-0x0;var _0x479c32=_0xce64[_0x3bb04c];return _0x479c32;};'use strict';var _=require(_0x4ce6('0x0'));var util=require(_0x4ce6('0x1'));var logger=require(_0x4ce6('0x2'))('api');var moment=require(_0x4ce6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ce6('0x4'));var config=require(_0x4ce6('0x5'));var attributes=require(_0x4ce6('0x6'));module[_0x4ce6('0x7')]=function(_0x4a6b3f,_0x4e8b30){return _0x4a6b3f['define'](_0x4ce6('0x8'),attributes,{'tableName':_0x4ce6('0x9'),'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 e1a41ec..3269a09 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 _0x1aa5=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info'];(function(_0x3bd6a2,_0x16d1da){var _0x3382f2=function(_0x35d124){while(--_0x35d124){_0x3bd6a2['push'](_0x3bd6a2['shift']());}};_0x3382f2(++_0x16d1da);}(_0x1aa5,0xe1));var _0x51aa=function(_0x3f5dc3,_0x1d07b7){_0x3f5dc3=_0x3f5dc3-0x0;var _0x1edce4=_0x1aa5[_0x3f5dc3];return _0x1edce4;};'use strict';var _=require('lodash');var util=require(_0x51aa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x51aa('0x1'));var fs=require('fs');var Redis=require(_0x51aa('0x2'));var db=require(_0x51aa('0x3'))['db'];var utils=require(_0x51aa('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x51aa('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x51aa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7565,_0x4c4bcf,_0x9a9ceb){return new BPromise(function(_0x3e9a1c,_0x41ca52){return client[_0x51aa('0x7')](_0x3f7565,_0x9a9ceb)['then'](function(_0x18117e){logger[_0x51aa('0x8')](_0x51aa('0x9'),_0x4c4bcf,_0x51aa('0xa'));logger['debug'](_0x51aa('0xb'),_0x4c4bcf,_0x51aa('0xa'),JSON[_0x51aa('0xc')](_0x18117e));if(_0x18117e[_0x51aa('0xd')]){if(_0x18117e['error'][_0x51aa('0xe')]===0x1f4){logger[_0x51aa('0xd')](_0x51aa('0x9'),_0x4c4bcf,_0x18117e[_0x51aa('0xd')][_0x51aa('0xf')]);return _0x41ca52(_0x18117e['error'][_0x51aa('0xf')]);}logger[_0x51aa('0xd')](_0x51aa('0x9'),_0x4c4bcf,_0x18117e[_0x51aa('0xd')]['message']);return _0x3e9a1c(_0x18117e[_0x51aa('0xd')]['message']);}else{logger[_0x51aa('0x8')](_0x51aa('0x9'),_0x4c4bcf,'request\x20sent');_0x3e9a1c(_0x18117e[_0x51aa('0x10')][_0x51aa('0xf')]);}})[_0x51aa('0x11')](function(_0x2f68ae){logger[_0x51aa('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4c4bcf,_0x2f68ae);_0x41ca52(_0x2f68ae);});});} \ No newline at end of file +var _0x146d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1be6eb,_0x16e497){var _0x3788a4=function(_0x30f2cc){while(--_0x30f2cc){_0x1be6eb['push'](_0x1be6eb['shift']());}};_0x3788a4(++_0x16e497);}(_0x146d,0x9e));var _0xd146=function(_0x4db387,_0x5896d7){_0x4db387=_0x4db387-0x0;var _0x3672bb=_0x146d[_0x4db387];return _0x3672bb;};'use strict';var _=require(_0xd146('0x0'));var util=require(_0xd146('0x1'));var moment=require(_0xd146('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd146('0x3'));var db=require(_0xd146('0x4'))['db'];var utils=require(_0xd146('0x5'));var logger=require(_0xd146('0x6'))(_0xd146('0x7'));var config=require('../../config/environment');var jayson=require(_0xd146('0x8'));var client=jayson['client'][_0xd146('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x320062,_0x314d01,_0x5cbb70){return new BPromise(function(_0x507472,_0x272867){return client[_0xd146('0xa')](_0x320062,_0x5cbb70)[_0xd146('0xb')](function(_0x588d5c){logger[_0xd146('0xc')](_0xd146('0xd'),_0x314d01,'request\x20sent');logger[_0xd146('0xe')](_0xd146('0xf'),_0x314d01,_0xd146('0x10'),JSON[_0xd146('0x11')](_0x588d5c));if(_0x588d5c[_0xd146('0x12')]){if(_0x588d5c[_0xd146('0x12')][_0xd146('0x13')]===0x1f4){logger[_0xd146('0x12')](_0xd146('0xd'),_0x314d01,_0x588d5c[_0xd146('0x12')]['message']);return _0x272867(_0x588d5c[_0xd146('0x12')]['message']);}logger[_0xd146('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x314d01,_0x588d5c[_0xd146('0x12')][_0xd146('0x14')]);return _0x507472(_0x588d5c[_0xd146('0x12')][_0xd146('0x14')]);}else{logger[_0xd146('0xc')](_0xd146('0xd'),_0x314d01,_0xd146('0x10'));_0x507472(_0x588d5c[_0xd146('0x15')][_0xd146('0x14')]);}})[_0xd146('0x16')](function(_0x57cfe8){logger[_0xd146('0x12')](_0xd146('0xd'),_0x314d01,_0x57cfe8);_0x272867(_0x57cfe8);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 4e06f78..4198ec9 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 _0x2981=['express','Router','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0xf93b08,_0x2559d7){var _0x12f72e=function(_0x30534b){while(--_0x30534b){_0xf93b08['push'](_0xf93b08['shift']());}};_0x12f72e(++_0x2559d7);}(_0x2981,0x184));var _0x1298=function(_0x30e2b0,_0xd270f6){_0x30e2b0=_0x30e2b0-0x0;var _0x596af9=_0x2981[_0x30e2b0];return _0x596af9;};'use strict';var multer=require(_0x1298('0x0'));var util=require(_0x1298('0x1'));var path=require(_0x1298('0x2'));var timeout=require(_0x1298('0x3'));var express=require(_0x1298('0x4'));var router=express[_0x1298('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1298('0x6'));module[_0x1298('0x7')]=router; \ No newline at end of file +var _0x8a01=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x8a01,0x96));var _0x18a0=function(_0x57f7a2,_0xfbbc4){_0x57f7a2=_0x57f7a2-0x0;var _0x5147c1=_0x8a01[_0x57f7a2];return _0x5147c1;};'use strict';var multer=require(_0x18a0('0x0'));var util=require(_0x18a0('0x1'));var path=require(_0x18a0('0x2'));var timeout=require('connect-timeout');var express=require(_0x18a0('0x3'));var router=express[_0x18a0('0x4')]();var auth=require(_0x18a0('0x5'));var interaction=require(_0x18a0('0x6'));var config=require(_0x18a0('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 75947c9..18294b5 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x21d105,_0x157e99){var _0x2523dc=function(_0x2de3c9){while(--_0x2de3c9){_0x21d105['push'](_0x21d105['shift']());}};_0x2523dc(++_0x157e99);}(_0xe706,0xa3));var _0x6e70=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0xe706[_0x455893];return _0x3851e8;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x432a72,_0x49d546){var _0x49f594=function(_0x250dcd){while(--_0x250dcd){_0x432a72['push'](_0x432a72['shift']());}};_0x49f594(++_0x49d546);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1923,_0x5446e9){_0x2c1923=_0x2c1923-0x0;var _0x73c9b4=_0xe706[_0x2c1923];return _0x73c9b4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 5d1e79c..453b8a7 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 _0xadb8=['UserVoiceQueue','user_has_voice_queues','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define'];(function(_0x5eb13b,_0x53bbc8){var _0x5b3b0b=function(_0x7259c4){while(--_0x7259c4){_0x5eb13b['push'](_0x5eb13b['shift']());}};_0x5b3b0b(++_0x53bbc8);}(_0xadb8,0x1d0));var _0x8adb=function(_0x381a28,_0x4eb359){_0x381a28=_0x381a28-0x0;var _0x5e572d=_0xadb8[_0x381a28];return _0x5e572d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8adb('0x0'))('api');var moment=require(_0x8adb('0x1'));var BPromise=require(_0x8adb('0x2'));var rp=require(_0x8adb('0x3'));var fs=require('fs');var path=require(_0x8adb('0x4'));var rimraf=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var attributes=require(_0x8adb('0x7'));module['exports']=function(_0x15bc63,_0x1a5f36){return _0x15bc63[_0x8adb('0x8')](_0x8adb('0x9'),attributes,{'tableName':_0x8adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','user_has_voice_queues','lodash','util','api'];(function(_0x3afdd4,_0x205683){var _0xabcc01=function(_0x25207c){while(--_0x25207c){_0x3afdd4['push'](_0x3afdd4['shift']());}};_0xabcc01(++_0x205683);}(_0xa41a,0x6b));var _0xaa41=function(_0x3e3c14,_0x4c2390){_0x3e3c14=_0x3e3c14-0x0;var _0x455591=_0xa41a[_0x3e3c14];return _0x455591;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('UserVoiceQueue',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 189ac8c..477a504 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 _0x62b6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','moment'];(function(_0x580f6e,_0x424c8f){var _0x2c942f=function(_0x21b4be){while(--_0x21b4be){_0x580f6e['push'](_0x580f6e['shift']());}};_0x2c942f(++_0x424c8f);}(_0x62b6,0x123));var _0x662b=function(_0x272404,_0x14f5cd){_0x272404=_0x272404-0x0;var _0x2bfc14=_0x62b6[_0x272404];return _0x2bfc14;};'use strict';var _=require(_0x662b('0x0'));var util=require(_0x662b('0x1'));var moment=require(_0x662b('0x2'));var BPromise=require(_0x662b('0x3'));var rs=require(_0x662b('0x4'));var fs=require('fs');var Redis=require(_0x662b('0x5'));var db=require(_0x662b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x662b('0x7'))('rpc');var config=require(_0x662b('0x8'));var jayson=require(_0x662b('0x9'));var client=jayson[_0x662b('0xa')][_0x662b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x533e1d,_0x9b4e1d,_0x557a0e){return new BPromise(function(_0xdb2c22,_0x57f627){return client[_0x662b('0xc')](_0x533e1d,_0x557a0e)[_0x662b('0xd')](function(_0x14a234){logger['info'](_0x662b('0xe'),_0x9b4e1d,_0x662b('0xf'));logger['debug'](_0x662b('0x10'),_0x9b4e1d,_0x662b('0xf'),JSON['stringify'](_0x14a234));if(_0x14a234['error']){if(_0x14a234['error']['code']===0x1f4){logger[_0x662b('0x11')](_0x662b('0xe'),_0x9b4e1d,_0x14a234['error'][_0x662b('0x12')]);return _0x57f627(_0x14a234[_0x662b('0x11')][_0x662b('0x12')]);}logger['error'](_0x662b('0xe'),_0x9b4e1d,_0x14a234[_0x662b('0x11')][_0x662b('0x12')]);return _0xdb2c22(_0x14a234[_0x662b('0x11')][_0x662b('0x12')]);}else{logger[_0x662b('0x13')](_0x662b('0xe'),_0x9b4e1d,_0x662b('0xf'));_0xdb2c22(_0x14a234['result']['message']);}})[_0x662b('0x14')](function(_0x45a016){logger[_0x662b('0x11')](_0x662b('0xe'),_0x9b4e1d,_0x45a016);_0x57f627(_0x45a016);});});} \ No newline at end of file +var _0x9900=['../../config/utils','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserVoiceQueue,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3450e4,_0x13258c){var _0xde7eec=function(_0x73d98b){while(--_0x73d98b){_0x3450e4['push'](_0x3450e4['shift']());}};_0xde7eec(++_0x13258c);}(_0x9900,0xa6));var _0x0990=function(_0x1aaffe,_0x42a4a6){_0x1aaffe=_0x1aaffe-0x0;var _0xf0c796=_0x9900[_0x1aaffe];return _0xf0c796;};'use strict';var _=require('lodash');var util=require(_0x0990('0x0'));var moment=require(_0x0990('0x1'));var BPromise=require(_0x0990('0x2'));var rs=require(_0x0990('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0990('0x4'))['db'];var utils=require(_0x0990('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0990('0x6'));var jayson=require(_0x0990('0x7'));var client=jayson[_0x0990('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25dad7,_0x1bfa4d,_0x17bee9){return new BPromise(function(_0x446e50,_0x4537c5){return client[_0x0990('0x9')](_0x25dad7,_0x17bee9)['then'](function(_0x5b3b1b){logger[_0x0990('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x1bfa4d,_0x0990('0xb'));logger[_0x0990('0xc')](_0x0990('0xd'),_0x1bfa4d,'request\x20sent',JSON[_0x0990('0xe')](_0x5b3b1b));if(_0x5b3b1b['error']){if(_0x5b3b1b[_0x0990('0xf')]['code']===0x1f4){logger[_0x0990('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x1bfa4d,_0x5b3b1b['error']['message']);return _0x4537c5(_0x5b3b1b[_0x0990('0xf')][_0x0990('0x10')]);}logger[_0x0990('0xf')](_0x0990('0x11'),_0x1bfa4d,_0x5b3b1b[_0x0990('0xf')][_0x0990('0x10')]);return _0x446e50(_0x5b3b1b[_0x0990('0xf')][_0x0990('0x10')]);}else{logger[_0x0990('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x1bfa4d,'request\x20sent');_0x446e50(_0x5b3b1b[_0x0990('0x12')][_0x0990('0x10')]);}})['catch'](function(_0x81175a){logger[_0x0990('0xf')](_0x0990('0x11'),_0x1bfa4d,_0x81175a);_0x4537c5(_0x81175a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 55321c4..41ca0f8 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 _0x4816=['../../components/auth/service','../../components/interaction/service','exports','util','path','express','Router'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x4816,0x1bc));var _0x6481=function(_0x59d546,_0x107f05){_0x59d546=_0x59d546-0x0;var _0x41fbdb=_0x4816[_0x59d546];return _0x41fbdb;};'use strict';var multer=require('multer');var util=require(_0x6481('0x0'));var path=require(_0x6481('0x1'));var timeout=require('connect-timeout');var express=require(_0x6481('0x2'));var router=express[_0x6481('0x3')]();var auth=require(_0x6481('0x4'));var interaction=require(_0x6481('0x5'));var config=require('../../config/environment');module[_0x6481('0x6')]=router; \ No newline at end of file +var _0x7e56=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x2f436b,_0x439bd6){var _0x30258c=function(_0x5ae91c){while(--_0x5ae91c){_0x2f436b['push'](_0x2f436b['shift']());}};_0x30258c(++_0x439bd6);}(_0x7e56,0x116));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x67e5('0x0'));var util=require(_0x67e5('0x1'));var path=require('path');var timeout=require(_0x67e5('0x2'));var express=require(_0x67e5('0x3'));var router=express['Router']();var auth=require(_0x67e5('0x4'));var interaction=require(_0x67e5('0x5'));var config=require('../../config/environment');module[_0x67e5('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 89ac37d..67f315e 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 _0x14d8=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x50b850,_0x797ed2){var _0x348619=function(_0x2b12f5){while(--_0x2b12f5){_0x50b850['push'](_0x50b850['shift']());}};_0x348619(++_0x797ed2);}(_0x14d8,0xb6));var _0x814d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x14d8[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0x814d('0x0'));module[_0x814d('0x1')]={'uniqueid':{'type':Sequelize[_0x814d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x814d('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x814d('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x814d('0x4')],'allowNull':![],'unique':_0x814d('0x5'),'comment':_0x814d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x814d('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x814d('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x814d('0x2')](0xb),'defaultValue':0x0,'comment':_0x814d('0x3')}}; \ No newline at end of file +var _0xa667=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','exports'];(function(_0x31af98,_0x519ce1){var _0x157020=function(_0x3504fa){while(--_0x3504fa){_0x31af98['push'](_0x31af98['shift']());}};_0x157020(++_0x519ce1);}(_0xa667,0xe0));var _0x7a66=function(_0x1e577d,_0x3413d0){_0x1e577d=_0x1e577d-0x0;var _0x30adbe=_0xa667[_0x1e577d];return _0x30adbe;};'use strict';var Sequelize=require('sequelize');module[_0x7a66('0x0')]={'uniqueid':{'type':Sequelize[_0x7a66('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x7a66('0x2')},'UserId':{'type':Sequelize[_0x7a66('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7a66('0x3')],'allowNull':![],'unique':_0x7a66('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x7a66('0x3')],'allowNull':![],'unique':_0x7a66('0x4'),'comment':_0x7a66('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7a66('0x2')},'paused':{'type':Sequelize[_0x7a66('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index bd667ba..8f1a46c 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 _0x4b4f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove'];(function(_0x4d869b,_0x2c278d){var _0x306b32=function(_0x38f3e8){while(--_0x38f3e8){_0x4d869b['push'](_0x4d869b['shift']());}};_0x306b32(++_0x2c278d);}(_0x4b4f,0x1c7));var _0xf4b4=function(_0x1c5909,_0x4f9067){_0x1c5909=_0x1c5909-0x0;var _0x34bf11=_0x4b4f[_0x1c5909];return _0x34bf11;};'use strict';var EventEmitter=require(_0xf4b4('0x0'));var UserVoiceQueueRt=require(_0xf4b4('0x1'))['db'][_0xf4b4('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf4b4('0x3')](0x0);var events={'afterCreate':_0xf4b4('0x4'),'afterUpdate':_0xf4b4('0x5'),'afterDestroy':_0xf4b4('0x6')};function emitEvent(_0x553a9b){return function(_0x54f6a9,_0x701ae6,_0x2cb1ab){UserVoiceQueueRtEvents['emit'](_0x553a9b+':'+_0x54f6a9['id'],_0x54f6a9);UserVoiceQueueRtEvents[_0xf4b4('0x7')](_0x553a9b,_0x54f6a9);_0x2cb1ab(null);};}for(var e in events){if(events[_0xf4b4('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xf4b4('0x9')](e,emitEvent(event));}}module[_0xf4b4('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3bb5=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x1cc52a,_0xc352df){var _0x296a25=function(_0x17e4a2){while(--_0x17e4a2){_0x1cc52a['push'](_0x1cc52a['shift']());}};_0x296a25(++_0xc352df);}(_0x3bb5,0x1dc));var _0x53bb=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x3bb5[_0x456fb1];return _0x4083d6;};'use strict';var EventEmitter=require(_0x53bb('0x0'));var UserVoiceQueueRt=require(_0x53bb('0x1'))['db'][_0x53bb('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x53bb('0x3')](0x0);var events={'afterCreate':_0x53bb('0x4'),'afterUpdate':_0x53bb('0x5'),'afterDestroy':'remove'};function emitEvent(_0x60e957){return function(_0x4ed312,_0x30e48c,_0x1c0e90){UserVoiceQueueRtEvents[_0x53bb('0x6')](_0x60e957+':'+_0x4ed312['id'],_0x4ed312);UserVoiceQueueRtEvents[_0x53bb('0x6')](_0x60e957,_0x4ed312);_0x1c0e90(null);};}for(var e in events){if(events[_0x53bb('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x53bb('0x8')](e,emitEvent(event));}}module[_0x53bb('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 df63cb5..ffe4a7e 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 _0x423d=['api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','../../config/logger'];(function(_0x2eb9e9,_0x3dfdd7){var _0x3279aa=function(_0x1ef168){while(--_0x1ef168){_0x2eb9e9['push'](_0x2eb9e9['shift']());}};_0x3279aa(++_0x3dfdd7);}(_0x423d,0x199));var _0xd423=function(_0x12c5fe,_0x5587a0){_0x12c5fe=_0x12c5fe-0x0;var _0x2a86a0=_0x423d[_0x12c5fe];return _0x2a86a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd423('0x0'))(_0xd423('0x1'));var moment=require(_0xd423('0x2'));var BPromise=require(_0xd423('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd423('0x4'));var rimraf=require(_0xd423('0x5'));var config=require(_0xd423('0x6'));var attributes=require(_0xd423('0x7'));module['exports']=function(_0x384ccf,_0x48e1c8){return _0x384ccf[_0xd423('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0xd423('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc21=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','../../config/logger','api','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc21,0x1b5));var _0x1bc2=function(_0x1c3609,_0x1e023d){_0x1c3609=_0x1c3609-0x0;var _0x2a26b8=_0xbc21[_0x1c3609];return _0x2a26b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1bc2('0x0'))(_0x1bc2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1bc2('0x2'));var fs=require('fs');var path=require(_0x1bc2('0x3'));var rimraf=require(_0x1bc2('0x4'));var config=require(_0x1bc2('0x5'));var attributes=require(_0x1bc2('0x6'));module[_0x1bc2('0x7')]=function(_0x2738ec,_0x198754){return _0x2738ec[_0x1bc2('0x8')](_0x1bc2('0x9'),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 5bc03a4..b33448f 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 _0x36c2=['code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x36c2,0xab));var _0x236c=function(_0x351818,_0x328a3e){_0x351818=_0x351818-0x0;var _0x49aaae=_0x36c2[_0x351818];return _0x49aaae;};'use strict';var _=require(_0x236c('0x0'));var util=require(_0x236c('0x1'));var moment=require(_0x236c('0x2'));var BPromise=require(_0x236c('0x3'));var rs=require(_0x236c('0x4'));var fs=require('fs');var Redis=require(_0x236c('0x5'));var db=require(_0x236c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x236c('0x7'))(_0x236c('0x8'));var config=require(_0x236c('0x9'));var jayson=require(_0x236c('0xa'));var client=jayson[_0x236c('0xb')][_0x236c('0xc')]({'port':0x232a});config[_0x236c('0xd')]=_[_0x236c('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x236c('0xf'))(new Redis(config[_0x236c('0xd')]));require('./userVoiceQueueRt.socket')[_0x236c('0x10')](socket);function respondWithRpcPromise(_0x3fbf5e,_0x4726d8,_0x560dd9){return new BPromise(function(_0x3cec98,_0x48841f){return client['request'](_0x3fbf5e,_0x560dd9)[_0x236c('0x11')](function(_0x2e3e10){logger[_0x236c('0x12')](_0x236c('0x13'),_0x4726d8,_0x236c('0x14'));logger['debug'](_0x236c('0x15'),_0x4726d8,_0x236c('0x14'),JSON[_0x236c('0x16')](_0x2e3e10));if(_0x2e3e10[_0x236c('0x17')]){if(_0x2e3e10[_0x236c('0x17')][_0x236c('0x18')]===0x1f4){logger[_0x236c('0x17')](_0x236c('0x13'),_0x4726d8,_0x2e3e10['error'][_0x236c('0x19')]);return _0x48841f(_0x2e3e10[_0x236c('0x17')][_0x236c('0x19')]);}logger['error'](_0x236c('0x13'),_0x4726d8,_0x2e3e10[_0x236c('0x17')][_0x236c('0x19')]);return _0x3cec98(_0x2e3e10[_0x236c('0x17')][_0x236c('0x19')]);}else{logger[_0x236c('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4726d8,_0x236c('0x14'));_0x3cec98(_0x2e3e10[_0x236c('0x1a')][_0x236c('0x19')]);}})[_0x236c('0x1b')](function(_0x7c6415){logger[_0x236c('0x17')](_0x236c('0x13'),_0x4726d8,_0x7c6415);_0x48841f(_0x7c6415);});});}exports[_0x236c('0x1c')]=function(_0x1307ad){var _0x56ad37=this;return new Promise(function(_0xb6039,_0x3e2be3){return db[_0x236c('0x1d')][_0x236c('0x1e')]({'raw':_0x1307ad[_0x236c('0x1f')]?_0x1307ad[_0x236c('0x1f')][_0x236c('0x20')]===undefined?!![]:![]:!![],'where':_0x1307ad[_0x236c('0x1f')]?_0x1307ad['options']['where']||null:null,'attributes':[[db[_0x236c('0x21')]['fn'](_0x236c('0x22'),db[_0x236c('0x21')]['fn']('IF',db['sequelize'][_0x236c('0x23')](_0x236c('0x24')))),_0x236c('0x25')]]})['then'](function(_0x44ec61){logger['info'](_0x236c('0x1c'),_0x1307ad);logger[_0x236c('0x26')](_0x236c('0x1c'),_0x1307ad,JSON['stringify'](_0x44ec61));_0xb6039(_0x44ec61);})['catch'](function(_0x17dcf3){logger[_0x236c('0x17')](_0x236c('0x1c'),_0x17dcf3[_0x236c('0x19')],_0x1307ad);_0x3e2be3(_0x56ad37[_0x236c('0x17')](0x1f4,_0x17dcf3[_0x236c('0x19')]));});});}; \ No newline at end of file +var _0xdf2b=['debug','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','`paused`\x20=\x201,\x201,\x20null','then'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xdf2b,0x162));var _0xbdf2=function(_0x2813e5,_0x45a66b){_0x2813e5=_0x2813e5-0x0;var _0xb04455=_0xdf2b[_0x2813e5];return _0xb04455;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbdf2('0x0'));var rs=require(_0xbdf2('0x1'));var fs=require('fs');var Redis=require(_0xbdf2('0x2'));var db=require(_0xbdf2('0x3'))['db'];var utils=require(_0xbdf2('0x4'));var logger=require('../../config/logger')(_0xbdf2('0x5'));var config=require(_0xbdf2('0x6'));var jayson=require(_0xbdf2('0x7'));var client=jayson[_0xbdf2('0x8')]['http']({'port':0x232a});config[_0xbdf2('0x9')]=_[_0xbdf2('0xa')](config[_0xbdf2('0x9')],{'host':_0xbdf2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdf2('0x9')]));require('./userVoiceQueueRt.socket')[_0xbdf2('0xc')](socket);function respondWithRpcPromise(_0xb6e75d,_0x38b6ec,_0x551a68){return new BPromise(function(_0x37cea3,_0x5ad942){return client[_0xbdf2('0xd')](_0xb6e75d,_0x551a68)['then'](function(_0x133e70){logger['info'](_0xbdf2('0xe'),_0x38b6ec,_0xbdf2('0xf'));logger['debug'](_0xbdf2('0x10'),_0x38b6ec,_0xbdf2('0xf'),JSON[_0xbdf2('0x11')](_0x133e70));if(_0x133e70[_0xbdf2('0x12')]){if(_0x133e70[_0xbdf2('0x12')][_0xbdf2('0x13')]===0x1f4){logger[_0xbdf2('0x12')](_0xbdf2('0xe'),_0x38b6ec,_0x133e70[_0xbdf2('0x12')]['message']);return _0x5ad942(_0x133e70[_0xbdf2('0x12')][_0xbdf2('0x14')]);}logger['error'](_0xbdf2('0xe'),_0x38b6ec,_0x133e70['error'][_0xbdf2('0x14')]);return _0x37cea3(_0x133e70['error'][_0xbdf2('0x14')]);}else{logger[_0xbdf2('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38b6ec,_0xbdf2('0xf'));_0x37cea3(_0x133e70[_0xbdf2('0x16')][_0xbdf2('0x14')]);}})['catch'](function(_0x5c04b4){logger[_0xbdf2('0x12')](_0xbdf2('0xe'),_0x38b6ec,_0x5c04b4);_0x5ad942(_0x5c04b4);});});}exports[_0xbdf2('0x17')]=function(_0x48c940){var _0xa184ad=this;return new Promise(function(_0x4d4d7a,_0x11ef91){return db[_0xbdf2('0x18')]['findAll']({'raw':_0x48c940['options']?_0x48c940[_0xbdf2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x48c940[_0xbdf2('0x19')]?_0x48c940[_0xbdf2('0x19')][_0xbdf2('0x1a')]||null:null,'attributes':[[db[_0xbdf2('0x1b')]['fn']('COUNT',db[_0xbdf2('0x1b')]['fn']('IF',db[_0xbdf2('0x1b')]['literal'](_0xbdf2('0x1c')))),'outboundQueuePauses']]})[_0xbdf2('0x1d')](function(_0xf9a3cb){logger['info'](_0xbdf2('0x17'),_0x48c940);logger[_0xbdf2('0x1e')]('GetVoiceQueueRtPauses',_0x48c940,JSON[_0xbdf2('0x11')](_0xf9a3cb));_0x4d4d7a(_0xf9a3cb);})[_0xbdf2('0x1f')](function(_0x546681){logger[_0xbdf2('0x12')]('GetVoiceQueueRtPauses',_0x546681[_0xbdf2('0x14')],_0x48c940);_0x11ef91(_0xa184ad[_0xbdf2('0x12')](0x1f4,_0x546681[_0xbdf2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8a4675d..7925f1d 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 _0x3b84=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit','removeListener'];(function(_0xef7b42,_0xf9ab01){var _0x5c3893=function(_0xaf24be){while(--_0xaf24be){_0xef7b42['push'](_0xef7b42['shift']());}};_0x5c3893(++_0xf9ab01);}(_0x3b84,0x1a6));var _0x43b8=function(_0x12f74f,_0x2e6653){_0x12f74f=_0x12f74f-0x0;var _0x5f0581=_0x3b84[_0x12f74f];return _0x5f0581;};'use strict';var UserVoiceQueueRtEvents=require(_0x43b8('0x0'));var events=['save',_0x43b8('0x1'),_0x43b8('0x2')];function createListener(_0x45ce26,_0x4e2b48){return function(_0x13642f){_0x4e2b48[_0x43b8('0x3')](_0x45ce26,_0x13642f);};}function removeListener(_0x4663c4,_0xaa5d7){return function(){UserVoiceQueueRtEvents[_0x43b8('0x4')](_0x4663c4,_0xaa5d7);};}exports[_0x43b8('0x5')]=function(_0xfbd591){for(var _0x3aed86=0x0,_0x513075=events['length'];_0x3aed86<_0x513075;_0x3aed86++){var _0x315f38=events[_0x3aed86];var _0x357002=createListener(_0x43b8('0x6')+_0x315f38,_0xfbd591);UserVoiceQueueRtEvents['on'](_0x315f38,_0x357002);}}; \ No newline at end of file +var _0x78c0=['removeListener','register','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x164e3a,_0x15e57c){var _0x2fff45=function(_0x5954d6){while(--_0x5954d6){_0x164e3a['push'](_0x164e3a['shift']());}};_0x2fff45(++_0x15e57c);}(_0x78c0,0x6e));var _0x078c=function(_0x3d140e,_0x19e6c6){_0x3d140e=_0x3d140e-0x0;var _0x25d39c=_0x78c0[_0x3d140e];return _0x25d39c;};'use strict';var UserVoiceQueueRtEvents=require(_0x078c('0x0'));var events=[_0x078c('0x1'),_0x078c('0x2'),'update'];function createListener(_0x556677,_0x3778f1){return function(_0x51bd7e){_0x3778f1[_0x078c('0x3')](_0x556677,_0x51bd7e);};}function removeListener(_0x1d29e2,_0x883978){return function(){UserVoiceQueueRtEvents[_0x078c('0x4')](_0x1d29e2,_0x883978);};}exports[_0x078c('0x5')]=function(_0x378936){for(var _0x9204b3=0x0,_0x4e04e8=events['length'];_0x9204b3<_0x4e04e8;_0x9204b3++){var _0x4e38d7=events[_0x9204b3];var _0x4a6849=createListener('userVoiceQueueRt:'+_0x4e38d7,_0x378936);UserVoiceQueueRtEvents['on'](_0x4e38d7,_0x4a6849);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d2ef4c5..247c4e4 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ff2=['../../config/environment','exports','util','connect-timeout','../../components/interaction/service'];(function(_0x46cf7e,_0xe67477){var _0x241ad7=function(_0x2e8aa7){while(--_0x2e8aa7){_0x46cf7e['push'](_0x46cf7e['shift']());}};_0x241ad7(++_0xe67477);}(_0x3ff2,0xc5));var _0x23ff=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ff2[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x23ff('0x0'));var path=require('path');var timeout=require(_0x23ff('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x23ff('0x2'));var config=require(_0x23ff('0x3'));module[_0x23ff('0x4')]=router; \ No newline at end of file +var _0x9a3a=['../../components/interaction/service','path','connect-timeout','express','../../components/auth/service'];(function(_0x36498b,_0x1653a4){var _0x2aa7e4=function(_0xa0cb4f){while(--_0xa0cb4f){_0x36498b['push'](_0x36498b['shift']());}};_0x2aa7e4(++_0x1653a4);}(_0x9a3a,0xfb));var _0xa9a3=function(_0x505116,_0x5d0b8c){_0x505116=_0x505116-0x0;var _0x789aa1=_0x9a3a[_0x505116];return _0x789aa1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9a3('0x0'));var timeout=require(_0xa9a3('0x1'));var express=require(_0xa9a3('0x2'));var router=express['Router']();var auth=require(_0xa9a3('0x3'));var interaction=require(_0xa9a3('0x4'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f14d435..fc01a16 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x22dca7,_0x535d95){var _0x3d3e7d=function(_0x591bb8){while(--_0x591bb8){_0x22dca7['push'](_0x22dca7['shift']());}};_0x3d3e7d(++_0x535d95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3feb8a,_0x47c784){var _0x4523ca=function(_0x4fba86){while(--_0x4fba86){_0x3feb8a['push'](_0x3feb8a['shift']());}};_0x4523ca(++_0x47c784);}(_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/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 511c725..ac323c0 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x9c00[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','../../config/logger','api'];(function(_0x448231,_0x2dd454){var _0x42fb5e=function(_0x12097d){while(--_0x12097d){_0x448231['push'](_0x448231['shift']());}};_0x42fb5e(++_0x2dd454);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x1e565a,_0x17dce7){_0x1e565a=_0x1e565a-0x0;var _0x356df5=_0xaebd[_0x1e565a];return _0x356df5;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 674d0aa..af199fd 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x515a54,_0x90f4b7){var _0x3f7cae=function(_0x19f68e){while(--_0x19f68e){_0x515a54['push'](_0x515a54['shift']());}};_0x3f7cae(++_0x90f4b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x13db9d,_0x2143d9){var _0x24602a=function(_0x102b82){while(--_0x102b82){_0x13db9d['push'](_0x13db9d['shift']());}};_0x24602a(++_0x2143d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 6591123..6aad2a9 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 _0x5da6=['../../components/interaction/service','../../config/environment','./variable.controller','index','get','/:id','isAuthenticated','show','post','create','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x5b801a,_0x30b70c){var _0x1ed93e=function(_0x46d84a){while(--_0x46d84a){_0x5b801a['push'](_0x5b801a['shift']());}};_0x1ed93e(++_0x30b70c);}(_0x5da6,0x83));var _0x65da=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x5da6[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require(_0x65da('0x0'));var util=require(_0x65da('0x1'));var path=require('path');var timeout=require(_0x65da('0x2'));var express=require('express');var router=express[_0x65da('0x3')]();var auth=require(_0x65da('0x4'));var interaction=require(_0x65da('0x5'));var config=require(_0x65da('0x6'));var controller=require(_0x65da('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x65da('0x8')]);router[_0x65da('0x9')](_0x65da('0xa'),auth[_0x65da('0xb')](),controller[_0x65da('0xc')]);router[_0x65da('0xd')]('/',auth[_0x65da('0xb')](),controller[_0x65da('0xe')]);router['put'](_0x65da('0xa'),auth[_0x65da('0xb')](),controller['update']);router[_0x65da('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x65da('0x10')]=router; \ No newline at end of file +var _0xe861=['post','create','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe861,0x1f3));var _0x1e86=function(_0x5388e1,_0x5b3473){_0x5388e1=_0x5388e1-0x0;var _0x4dd02c=_0xe861[_0x5388e1];return _0x4dd02c;};'use strict';var multer=require(_0x1e86('0x0'));var util=require(_0x1e86('0x1'));var path=require('path');var timeout=require(_0x1e86('0x2'));var express=require(_0x1e86('0x3'));var router=express[_0x1e86('0x4')]();var auth=require(_0x1e86('0x5'));var interaction=require(_0x1e86('0x6'));var config=require(_0x1e86('0x7'));var controller=require(_0x1e86('0x8'));router[_0x1e86('0x9')]('/',auth['isAuthenticated'](),controller[_0x1e86('0xa')]);router['get'](_0x1e86('0xb'),auth[_0x1e86('0xc')](),controller['show']);router[_0x1e86('0xd')]('/',auth['isAuthenticated'](),controller[_0x1e86('0xe')]);router['put']('/:id',auth[_0x1e86('0xc')](),controller['update']);router['delete'](_0x1e86('0xb'),auth[_0x1e86('0xc')](),controller[_0x1e86('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 76ef841..2de05ce 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 _0x746a=['exports','STRING','sequelize'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x746a,0xe9));var _0xa746=function(_0x242068,_0x55088f){_0x242068=_0x242068-0x0;var _0x1752d8=_0x746a[_0x242068];return _0x1752d8;};'use strict';var Sequelize=require(_0xa746('0x0'));module[_0xa746('0x1')]={'name':{'type':Sequelize[_0xa746('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa746('0x2')]}}; \ No newline at end of file +var _0xf600=['name','sequelize','exports','STRING'];(function(_0x4e5254,_0x40ee71){var _0x41c2c6=function(_0x4ed1ae){while(--_0x4ed1ae){_0x4e5254['push'](_0x4e5254['shift']());}};_0x41c2c6(++_0x40ee71);}(_0xf600,0xbd));var _0x0f60=function(_0x289e06,_0x5257e5){_0x289e06=_0x289e06-0x0;var _0x186418=_0xf600[_0x289e06];return _0x186418;};'use strict';var Sequelize=require(_0x0f60('0x0'));module[_0x0f60('0x1')]={'name':{'type':Sequelize[_0x0f60('0x2')],'unique':_0x0f60('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0f60('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4933127..c58bb18 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 _0x20d3=['length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','catch','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','fast-json-patch','request-promise','bluebird','path','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','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Variables','sendStatus','error','name','index','map','Variable','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x4b6985,_0x55a17b){var _0x7df500=function(_0x22e369){while(--_0x22e369){_0x4b6985['push'](_0x4b6985['shift']());}};_0x7df500(++_0x55a17b);}(_0x20d3,0xb9));var _0x320d=function(_0x44bafc,_0x733252){_0x44bafc=_0x44bafc-0x0;var _0x4bd177=_0x20d3[_0x44bafc];return _0x4bd177;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x320d('0x0'));var jsonpatch=require(_0x320d('0x1'));var rp=require(_0x320d('0x2'));var moment=require('moment');var BPromise=require(_0x320d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x320d('0x4'));var sox=require(_0x320d('0x5'));var csv=require(_0x320d('0x6'));var ejs=require(_0x320d('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x320d('0x8'));var crypto=require(_0x320d('0x9'));var jsforce=require(_0x320d('0xa'));var deskjs=require(_0x320d('0xb'));var toCsv=require(_0x320d('0x6'));var querystring=require(_0x320d('0xc'));var Papa=require(_0x320d('0xd'));var Redis=require('ioredis');var authService=require(_0x320d('0xe'));var qs=require(_0x320d('0xf'));var as=require(_0x320d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x320d('0x11'))(_0x320d('0x12'));var utils=require(_0x320d('0x13'));var config=require(_0x320d('0x14'));var db=require(_0x320d('0x15'))['db'];function respondWithStatusCode(_0x15ecef,_0x3de245){_0x3de245=_0x3de245||0xcc;return function(_0x5ba7f2){if(_0x5ba7f2){return _0x15ecef['sendStatus'](_0x3de245);}return _0x15ecef[_0x320d('0x16')](_0x3de245)['end']();};}function respondWithResult(_0x5121ad,_0x4db6ed){_0x4db6ed=_0x4db6ed||0xc8;return function(_0x571dcb){if(_0x571dcb){return _0x5121ad[_0x320d('0x16')](_0x4db6ed)[_0x320d('0x17')](_0x571dcb);}};}function respondWithFilteredResult(_0x38782f,_0x4104b8){return function(_0xa3b992){if(_0xa3b992){var _0x321589=_0xa3b992[_0x320d('0x18')],_0x107c82=_0x4104b8['offset'],_0x904850=_0x4104b8[_0x320d('0x19')]+_0x4104b8[_0x320d('0x1a')],_0x289b1e;if(_0x904850>=_0x321589){_0x904850=_0x321589;_0x289b1e=0xc8;}else{_0x289b1e=0xce;}_0x38782f[_0x320d('0x16')](_0x289b1e);return _0x38782f['set'](_0x320d('0x1b'),_0x107c82+'-'+_0x904850+'/'+_0x321589)[_0x320d('0x17')](_0xa3b992);}return null;};}function patchUpdates(_0x343bc0){return function(_0xda4c01){try{jsonpatch[_0x320d('0x1c')](_0xda4c01,_0x343bc0,!![]);}catch(_0x868266){return BPromise[_0x320d('0x1d')](_0x868266);}return _0xda4c01[_0x320d('0x1e')]();};}function saveUpdates(_0x23bbff,_0x3c768b){return function(_0x42f8ab){if(_0x42f8ab){return _0x42f8ab[_0x320d('0x1f')](_0x23bbff)[_0x320d('0x20')](function(_0x3ca88f){return _0x3ca88f;});}return null;};}function removeEntity(_0x5ed498,_0x12a38d){return function(_0x59200f){if(_0x59200f){return _0x59200f[_0x320d('0x21')]()[_0x320d('0x20')](function(){var _0x1f708a=_0x59200f[_0x320d('0x22')]({'plain':!![]});var _0x3633c6=_0x320d('0x23');return db['UserProfileResource'][_0x320d('0x21')]({'where':{'type':_0x3633c6,'resourceId':_0x1f708a['id']}})[_0x320d('0x20')](function(){return _0x59200f;});})[_0x320d('0x20')](function(){_0x5ed498['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x433fee,_0x3b4580){return function(_0x4df4dd){if(!_0x4df4dd){_0x433fee[_0x320d('0x24')](0x194);}return _0x4df4dd;};}function handleError(_0x997022,_0xc4f79d){_0xc4f79d=_0xc4f79d||0x1f4;return function(_0x4e9d21){logger[_0x320d('0x25')](_0x4e9d21['stack']);if(_0x4e9d21[_0x320d('0x26')]){delete _0x4e9d21['name'];}_0x997022[_0x320d('0x16')](_0xc4f79d)['send'](_0x4e9d21);};}exports[_0x320d('0x27')]=function(_0x266e05,_0x56bdd4){var _0x5c0cc8={},_0x52ce54={},_0x5d7287={'count':0x0,'rows':[]};var _0x2471c6=_[_0x320d('0x28')](db[_0x320d('0x29')]['rawAttributes'],function(_0x426c4a){return{'name':_0x426c4a[_0x320d('0x2a')],'type':_0x426c4a[_0x320d('0x2b')][_0x320d('0x2c')]};});_0x52ce54[_0x320d('0x2d')]=_[_0x320d('0x28')](_0x2471c6,_0x320d('0x26'));_0x52ce54['query']=_[_0x320d('0x2e')](_0x266e05[_0x320d('0x2f')]);_0x52ce54[_0x320d('0x30')]=_[_0x320d('0x31')](_0x52ce54[_0x320d('0x2d')],_0x52ce54[_0x320d('0x2f')]);_0x5c0cc8[_0x320d('0x32')]=_[_0x320d('0x31')](_0x52ce54[_0x320d('0x2d')],qs[_0x320d('0x33')](_0x266e05[_0x320d('0x2f')][_0x320d('0x33')]));_0x5c0cc8[_0x320d('0x32')]=_0x5c0cc8[_0x320d('0x32')][_0x320d('0x34')]?_0x5c0cc8['attributes']:_0x52ce54[_0x320d('0x2d')];if(!_0x266e05['query']['hasOwnProperty']('nolimit')){_0x5c0cc8[_0x320d('0x1a')]=qs[_0x320d('0x1a')](_0x266e05[_0x320d('0x2f')][_0x320d('0x1a')]);_0x5c0cc8[_0x320d('0x19')]=qs['offset'](_0x266e05[_0x320d('0x2f')][_0x320d('0x19')]);}_0x5c0cc8[_0x320d('0x35')]=qs[_0x320d('0x36')](_0x266e05['query'][_0x320d('0x36')]);_0x5c0cc8[_0x320d('0x37')]=qs[_0x320d('0x30')](_[_0x320d('0x38')](_0x266e05[_0x320d('0x2f')],_0x52ce54[_0x320d('0x30')]),_0x2471c6);if(_0x266e05[_0x320d('0x2f')][_0x320d('0x39')]){_0x5c0cc8['where']=_[_0x320d('0x3a')](_0x5c0cc8[_0x320d('0x37')],{'$or':_[_0x320d('0x28')](_0x2471c6,function(_0x3bc48c){if(_0x3bc48c['type']!==_0x320d('0x3b')){var _0x89127b={};_0x89127b[_0x3bc48c[_0x320d('0x26')]]={'$like':'%'+_0x266e05[_0x320d('0x2f')][_0x320d('0x39')]+'%'};return _0x89127b;}})});}_0x5c0cc8=_[_0x320d('0x3a')]({},_0x5c0cc8,_0x266e05['options']);var _0x1f12a7={'where':_0x5c0cc8[_0x320d('0x37')]};return db['Variable'][_0x320d('0x18')](_0x1f12a7)['then'](function(_0x598d33){_0x5d7287['count']=_0x598d33;if(_0x266e05[_0x320d('0x2f')][_0x320d('0x3c')]){_0x5c0cc8[_0x320d('0x3d')]=[{'all':!![]}];}return db[_0x320d('0x29')][_0x320d('0x3e')](_0x5c0cc8);})[_0x320d('0x20')](function(_0x39cf3e){_0x5d7287[_0x320d('0x3f')]=_0x39cf3e;return _0x5d7287;})['then'](respondWithFilteredResult(_0x56bdd4,_0x5c0cc8))['catch'](handleError(_0x56bdd4,null));};exports[_0x320d('0x40')]=function(_0x43d5fb,_0x206c3d){var _0x568add={'raw':!![],'where':{'id':_0x43d5fb[_0x320d('0x41')]['id']}},_0x37ec5f={};_0x37ec5f['model']=_[_0x320d('0x2e')](db[_0x320d('0x29')][_0x320d('0x42')]);_0x37ec5f['query']=_[_0x320d('0x2e')](_0x43d5fb[_0x320d('0x2f')]);_0x37ec5f[_0x320d('0x30')]=_[_0x320d('0x31')](_0x37ec5f[_0x320d('0x2d')],_0x37ec5f['query']);_0x568add[_0x320d('0x32')]=_[_0x320d('0x31')](_0x37ec5f[_0x320d('0x2d')],qs[_0x320d('0x33')](_0x43d5fb[_0x320d('0x2f')][_0x320d('0x33')]));_0x568add[_0x320d('0x32')]=_0x568add['attributes'][_0x320d('0x34')]?_0x568add[_0x320d('0x32')]:_0x37ec5f[_0x320d('0x2d')];if(_0x43d5fb[_0x320d('0x2f')][_0x320d('0x3c')]){_0x568add['include']=[{'all':!![]}];}_0x568add=_[_0x320d('0x3a')]({},_0x568add,_0x43d5fb[_0x320d('0x43')]);return db[_0x320d('0x29')]['find'](_0x568add)[_0x320d('0x20')](handleEntityNotFound(_0x206c3d,null))[_0x320d('0x20')](respondWithResult(_0x206c3d,null))[_0x320d('0x44')](handleError(_0x206c3d,null));};exports[_0x320d('0x45')]=function(_0x311e63,_0x5ab377){return db['Variable'][_0x320d('0x45')](_0x311e63['body'],{})[_0x320d('0x20')](function(_0x510de3){var _0x12e8ff=_0x311e63[_0x320d('0x46')][_0x320d('0x22')]({'plain':!![]});if(!_0x12e8ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12e8ff[_0x320d('0x47')]==='user'){var _0x58a131=_0x510de3['get']({'plain':!![]});var _0x2cecc6=_0x320d('0x23');return db[_0x320d('0x48')][_0x320d('0x49')]({'where':{'name':_0x2cecc6,'userProfileId':_0x12e8ff[_0x320d('0x4a')]},'raw':!![]})[_0x320d('0x20')](function(_0x35f5ec){if(_0x35f5ec&&_0x35f5ec[_0x320d('0x4b')]===0x0){return db[_0x320d('0x4c')][_0x320d('0x45')]({'name':_0x58a131[_0x320d('0x26')],'resourceId':_0x58a131['id'],'type':_0x35f5ec[_0x320d('0x26')],'sectionId':_0x35f5ec['id']},{})[_0x320d('0x20')](function(){return _0x510de3;});}else{return _0x510de3;}})['catch'](function(_0x439936){logger[_0x320d('0x25')](_0x320d('0x4d'),_0x439936);throw _0x439936;});}return _0x510de3;})['then'](respondWithResult(_0x5ab377,0xc9))[_0x320d('0x44')](handleError(_0x5ab377,null));};exports[_0x320d('0x1f')]=function(_0x4da717,_0xb020e5){if(_0x4da717[_0x320d('0x4e')]['id']){delete _0x4da717[_0x320d('0x4e')]['id'];}return db[_0x320d('0x29')]['find']({'where':{'id':_0x4da717[_0x320d('0x41')]['id']}})[_0x320d('0x20')](handleEntityNotFound(_0xb020e5,null))[_0x320d('0x20')](saveUpdates(_0x4da717[_0x320d('0x4e')],null))[_0x320d('0x20')](respondWithResult(_0xb020e5,null))[_0x320d('0x44')](handleError(_0xb020e5,null));};exports[_0x320d('0x21')]=function(_0x3ee2d7,_0xf669b8){return db[_0x320d('0x29')][_0x320d('0x49')]({'where':{'id':_0x3ee2d7[_0x320d('0x41')]['id']}})[_0x320d('0x20')](handleEntityNotFound(_0xf669b8,null))[_0x320d('0x20')](removeEntity(_0xf669b8,null))[_0x320d('0x44')](handleError(_0xf669b8,null));}; \ No newline at end of file +var _0x51f4=['save','update','get','UserProfileResource','destroy','sendStatus','name','send','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','options','then','includeAll','findAll','rows','catch','show','params','include','find','create','body','role','user','Variables','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','apply','reject'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x51f4,0x17f));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x451f('0x0'));var emlformat=require(_0x451f('0x1'));var rimraf=require(_0x451f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x451f('0x3'));var rp=require('request-promise');var moment=require(_0x451f('0x4'));var BPromise=require(_0x451f('0x5'));var Mustache=require(_0x451f('0x6'));var util=require(_0x451f('0x7'));var path=require('path');var sox=require(_0x451f('0x8'));var csv=require(_0x451f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x451f('0xa'));var squel=require(_0x451f('0xb'));var crypto=require(_0x451f('0xc'));var jsforce=require(_0x451f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x451f('0x9'));var querystring=require(_0x451f('0xe'));var Papa=require(_0x451f('0xf'));var Redis=require(_0x451f('0x10'));var authService=require(_0x451f('0x11'));var qs=require(_0x451f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x451f('0x13'));var logger=require(_0x451f('0x14'))(_0x451f('0x15'));var utils=require('../../config/utils');var config=require(_0x451f('0x16'));var db=require(_0x451f('0x17'))['db'];function respondWithStatusCode(_0xb89635,_0x3f6e4e){_0x3f6e4e=_0x3f6e4e||0xcc;return function(_0x4988ce){if(_0x4988ce){return _0xb89635['sendStatus'](_0x3f6e4e);}return _0xb89635[_0x451f('0x18')](_0x3f6e4e)[_0x451f('0x19')]();};}function respondWithResult(_0x8a3a80,_0x12238c){_0x12238c=_0x12238c||0xc8;return function(_0xa586f9){if(_0xa586f9){return _0x8a3a80[_0x451f('0x18')](_0x12238c)[_0x451f('0x1a')](_0xa586f9);}};}function respondWithFilteredResult(_0x411851,_0x218579){return function(_0x481a82){if(_0x481a82){var _0x41cb0d=_0x481a82[_0x451f('0x1b')],_0x2547b5=_0x218579[_0x451f('0x1c')],_0x516d20=_0x218579['offset']+_0x218579['limit'],_0xacccf3;if(_0x516d20>=_0x41cb0d){_0x516d20=_0x41cb0d;_0xacccf3=0xc8;}else{_0xacccf3=0xce;}_0x411851[_0x451f('0x18')](_0xacccf3);return _0x411851['set'](_0x451f('0x1d'),_0x2547b5+'-'+_0x516d20+'/'+_0x41cb0d)['json'](_0x481a82);}return null;};}function patchUpdates(_0x9e34c){return function(_0x58d52e){try{jsonpatch[_0x451f('0x1e')](_0x58d52e,_0x9e34c,!![]);}catch(_0xa3b3d4){return BPromise[_0x451f('0x1f')](_0xa3b3d4);}return _0x58d52e[_0x451f('0x20')]();};}function saveUpdates(_0x34de23,_0x43712a){return function(_0x5a6d27){if(_0x5a6d27){return _0x5a6d27[_0x451f('0x21')](_0x34de23)['then'](function(_0x231a9b){return _0x231a9b;});}return null;};}function removeEntity(_0x3481f3,_0x18cee6){return function(_0x2d9f74){if(_0x2d9f74){return _0x2d9f74['destroy']()['then'](function(){var _0xcfa309=_0x2d9f74[_0x451f('0x22')]({'plain':!![]});var _0x57caee='Variables';return db[_0x451f('0x23')][_0x451f('0x24')]({'where':{'type':_0x57caee,'resourceId':_0xcfa309['id']}})['then'](function(){return _0x2d9f74;});})['then'](function(){_0x3481f3[_0x451f('0x18')](0xcc)[_0x451f('0x19')]();});}};}function handleEntityNotFound(_0x284758,_0x4b2a99){return function(_0x1204a7){if(!_0x1204a7){_0x284758[_0x451f('0x25')](0x194);}return _0x1204a7;};}function handleError(_0xf63975,_0x4dcbe1){_0x4dcbe1=_0x4dcbe1||0x1f4;return function(_0x411b05){logger['error'](_0x411b05['stack']);if(_0x411b05['name']){delete _0x411b05[_0x451f('0x26')];}_0xf63975['status'](_0x4dcbe1)[_0x451f('0x27')](_0x411b05);};}exports[_0x451f('0x28')]=function(_0x459d87,_0x533f64){var _0x12c5cc={},_0x1d53d0={},_0xec834f={'count':0x0,'rows':[]};var _0x3e2d1c=_[_0x451f('0x29')](db[_0x451f('0x2a')][_0x451f('0x2b')],function(_0x1a16b4){return{'name':_0x1a16b4[_0x451f('0x2c')],'type':_0x1a16b4['type'][_0x451f('0x2d')]};});_0x1d53d0[_0x451f('0x2e')]=_['map'](_0x3e2d1c,'name');_0x1d53d0[_0x451f('0x2f')]=_[_0x451f('0x30')](_0x459d87[_0x451f('0x2f')]);_0x1d53d0['filters']=_[_0x451f('0x31')](_0x1d53d0['model'],_0x1d53d0['query']);_0x12c5cc[_0x451f('0x32')]=_[_0x451f('0x31')](_0x1d53d0[_0x451f('0x2e')],qs[_0x451f('0x33')](_0x459d87[_0x451f('0x2f')][_0x451f('0x33')]));_0x12c5cc['attributes']=_0x12c5cc['attributes'][_0x451f('0x34')]?_0x12c5cc[_0x451f('0x32')]:_0x1d53d0[_0x451f('0x2e')];if(!_0x459d87['query'][_0x451f('0x35')](_0x451f('0x36'))){_0x12c5cc[_0x451f('0x37')]=qs['limit'](_0x459d87['query'][_0x451f('0x37')]);_0x12c5cc[_0x451f('0x1c')]=qs[_0x451f('0x1c')](_0x459d87[_0x451f('0x2f')][_0x451f('0x1c')]);}_0x12c5cc[_0x451f('0x38')]=qs[_0x451f('0x39')](_0x459d87[_0x451f('0x2f')][_0x451f('0x39')]);_0x12c5cc[_0x451f('0x3a')]=qs[_0x451f('0x3b')](_[_0x451f('0x3c')](_0x459d87[_0x451f('0x2f')],_0x1d53d0[_0x451f('0x3b')]),_0x3e2d1c);if(_0x459d87[_0x451f('0x2f')][_0x451f('0x3d')]){_0x12c5cc[_0x451f('0x3a')]=_[_0x451f('0x3e')](_0x12c5cc['where'],{'$or':_[_0x451f('0x29')](_0x3e2d1c,function(_0x352f1a){if(_0x352f1a[_0x451f('0x3f')]!=='VIRTUAL'){var _0x1ff2bc={};_0x1ff2bc[_0x352f1a[_0x451f('0x26')]]={'$like':'%'+_0x459d87['query']['filter']+'%'};return _0x1ff2bc;}})});}_0x12c5cc=_[_0x451f('0x3e')]({},_0x12c5cc,_0x459d87[_0x451f('0x40')]);var _0x2e98d5={'where':_0x12c5cc[_0x451f('0x3a')]};return db[_0x451f('0x2a')]['count'](_0x2e98d5)[_0x451f('0x41')](function(_0x379954){_0xec834f[_0x451f('0x1b')]=_0x379954;if(_0x459d87['query'][_0x451f('0x42')]){_0x12c5cc['include']=[{'all':!![]}];}return db[_0x451f('0x2a')][_0x451f('0x43')](_0x12c5cc);})['then'](function(_0x3cc193){_0xec834f[_0x451f('0x44')]=_0x3cc193;return _0xec834f;})[_0x451f('0x41')](respondWithFilteredResult(_0x533f64,_0x12c5cc))[_0x451f('0x45')](handleError(_0x533f64,null));};exports[_0x451f('0x46')]=function(_0x753764,_0x13cb24){var _0x5a1483={'raw':!![],'where':{'id':_0x753764[_0x451f('0x47')]['id']}},_0x2c9cc2={};_0x2c9cc2[_0x451f('0x2e')]=_[_0x451f('0x30')](db[_0x451f('0x2a')][_0x451f('0x2b')]);_0x2c9cc2[_0x451f('0x2f')]=_['keys'](_0x753764[_0x451f('0x2f')]);_0x2c9cc2['filters']=_[_0x451f('0x31')](_0x2c9cc2[_0x451f('0x2e')],_0x2c9cc2[_0x451f('0x2f')]);_0x5a1483[_0x451f('0x32')]=_[_0x451f('0x31')](_0x2c9cc2[_0x451f('0x2e')],qs[_0x451f('0x33')](_0x753764[_0x451f('0x2f')]['fields']));_0x5a1483[_0x451f('0x32')]=_0x5a1483[_0x451f('0x32')]['length']?_0x5a1483[_0x451f('0x32')]:_0x2c9cc2['model'];if(_0x753764[_0x451f('0x2f')]['includeAll']){_0x5a1483[_0x451f('0x48')]=[{'all':!![]}];}_0x5a1483=_['merge']({},_0x5a1483,_0x753764[_0x451f('0x40')]);return db[_0x451f('0x2a')][_0x451f('0x49')](_0x5a1483)[_0x451f('0x41')](handleEntityNotFound(_0x13cb24,null))[_0x451f('0x41')](respondWithResult(_0x13cb24,null))[_0x451f('0x45')](handleError(_0x13cb24,null));};exports[_0x451f('0x4a')]=function(_0x1f606e,_0x34824e){return db[_0x451f('0x2a')][_0x451f('0x4a')](_0x1f606e[_0x451f('0x4b')],{})[_0x451f('0x41')](function(_0xd73321){var _0x5d436d=_0x1f606e['user'][_0x451f('0x22')]({'plain':!![]});if(!_0x5d436d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d436d[_0x451f('0x4c')]===_0x451f('0x4d')){var _0x61b498=_0xd73321[_0x451f('0x22')]({'plain':!![]});var _0x1908a0=_0x451f('0x4e');return db['UserProfileSection'][_0x451f('0x49')]({'where':{'name':_0x1908a0,'userProfileId':_0x5d436d[_0x451f('0x4f')]},'raw':!![]})[_0x451f('0x41')](function(_0x262935){if(_0x262935&&_0x262935[_0x451f('0x50')]===0x0){return db[_0x451f('0x23')][_0x451f('0x4a')]({'name':_0x61b498[_0x451f('0x26')],'resourceId':_0x61b498['id'],'type':_0x262935[_0x451f('0x26')],'sectionId':_0x262935['id']},{})[_0x451f('0x41')](function(){return _0xd73321;});}else{return _0xd73321;}})['catch'](function(_0x28237d){logger[_0x451f('0x51')](_0x451f('0x52'),_0x28237d);throw _0x28237d;});}return _0xd73321;})['then'](respondWithResult(_0x34824e,0xc9))[_0x451f('0x45')](handleError(_0x34824e,null));};exports['update']=function(_0x52ff05,_0x6c33df){if(_0x52ff05['body']['id']){delete _0x52ff05['body']['id'];}return db[_0x451f('0x2a')][_0x451f('0x49')]({'where':{'id':_0x52ff05['params']['id']}})[_0x451f('0x41')](handleEntityNotFound(_0x6c33df,null))[_0x451f('0x41')](saveUpdates(_0x52ff05[_0x451f('0x4b')],null))['then'](respondWithResult(_0x6c33df,null))[_0x451f('0x45')](handleError(_0x6c33df,null));};exports[_0x451f('0x24')]=function(_0x5769e1,_0x540093){return db[_0x451f('0x2a')]['find']({'where':{'id':_0x5769e1[_0x451f('0x47')]['id']}})[_0x451f('0x41')](handleEntityNotFound(_0x540093,null))[_0x451f('0x41')](removeEntity(_0x540093,null))[_0x451f('0x45')](handleError(_0x540093,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d094607..22146cc 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 _0x07c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x07c3,0x1bf));var _0x307c=function(_0x38d499,_0x1cbb6b){_0x38d499=_0x38d499-0x0;var _0x274b18=_0x07c3[_0x38d499];return _0x274b18;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var logger=require(_0x307c('0x2'))(_0x307c('0x3'));var moment=require(_0x307c('0x4'));var BPromise=require(_0x307c('0x5'));var rp=require(_0x307c('0x6'));var fs=require('fs');var path=require(_0x307c('0x7'));var rimraf=require('rimraf');var config=require(_0x307c('0x8'));var attributes=require(_0x307c('0x9'));module[_0x307c('0xa')]=function(_0x317066,_0x250f22){return _0x317066[_0x307c('0xb')](_0x307c('0xc'),attributes,{'tableName':_0x307c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a79=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','util','../../config/logger'];(function(_0x38f8eb,_0x1eeea3){var _0x273f7f=function(_0x52fd97){while(--_0x52fd97){_0x38f8eb['push'](_0x38f8eb['shift']());}};_0x273f7f(++_0x1eeea3);}(_0x3a79,0xca));var _0x93a7=function(_0x44ef02,_0x29d833){_0x44ef02=_0x44ef02-0x0;var _0x19d21c=_0x3a79[_0x44ef02];return _0x19d21c;};'use strict';var _=require('lodash');var util=require(_0x93a7('0x0'));var logger=require(_0x93a7('0x1'))('api');var moment=require(_0x93a7('0x2'));var BPromise=require(_0x93a7('0x3'));var rp=require(_0x93a7('0x4'));var fs=require('fs');var path=require(_0x93a7('0x5'));var rimraf=require(_0x93a7('0x6'));var config=require(_0x93a7('0x7'));var attributes=require(_0x93a7('0x8'));module['exports']=function(_0x2976b2,_0x4efb20){return _0x2976b2[_0x93a7('0x9')](_0x93a7('0xa'),attributes,{'tableName':_0x93a7('0xb'),'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 9957949..cbedd77 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 _0x3de5=['Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x2a8b8d,_0x33dc67){var _0x3afac7=function(_0x3a77de){while(--_0x3a77de){_0x2a8b8d['push'](_0x2a8b8d['shift']());}};_0x3afac7(++_0x33dc67);}(_0x3de5,0x14e));var _0x53de=function(_0x4f6ada,_0x35d782){_0x4f6ada=_0x4f6ada-0x0;var _0x521fcb=_0x3de5[_0x4f6ada];return _0x521fcb;};'use strict';var _=require(_0x53de('0x0'));var util=require(_0x53de('0x1'));var moment=require(_0x53de('0x2'));var BPromise=require(_0x53de('0x3'));var rs=require(_0x53de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53de('0x5'));var logger=require(_0x53de('0x6'))(_0x53de('0x7'));var config=require(_0x53de('0x8'));var jayson=require(_0x53de('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x932511,_0x2bb6b6,_0x21f13b){return new BPromise(function(_0x358087,_0x37d377){return client['request'](_0x932511,_0x21f13b)[_0x53de('0xa')](function(_0x467233){logger[_0x53de('0xb')](_0x53de('0xc'),_0x2bb6b6,_0x53de('0xd'));logger['debug'](_0x53de('0xe'),_0x2bb6b6,_0x53de('0xd'),JSON[_0x53de('0xf')](_0x467233));if(_0x467233[_0x53de('0x10')]){if(_0x467233[_0x53de('0x10')][_0x53de('0x11')]===0x1f4){logger[_0x53de('0x10')]('Variable,\x20%s,\x20%s',_0x2bb6b6,_0x467233[_0x53de('0x10')]['message']);return _0x37d377(_0x467233['error'][_0x53de('0x12')]);}logger['error']('Variable,\x20%s,\x20%s',_0x2bb6b6,_0x467233['error'][_0x53de('0x12')]);return _0x358087(_0x467233['error'][_0x53de('0x12')]);}else{logger[_0x53de('0xb')](_0x53de('0xc'),_0x2bb6b6,_0x53de('0xd'));_0x358087(_0x467233[_0x53de('0x13')][_0x53de('0x12')]);}})[_0x53de('0x14')](function(_0x36e8ba){logger['error'](_0x53de('0xc'),_0x2bb6b6,_0x36e8ba);_0x37d377(_0x36e8ba);});});}exports[_0x53de('0x15')]=function(_0x5c03d9){var _0x10761b=this;return new Promise(function(_0x1af687,_0x580292){return db['Variable'][_0x53de('0x16')]({'raw':_0x5c03d9[_0x53de('0x17')]?_0x5c03d9['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c03d9[_0x53de('0x17')]?_0x5c03d9[_0x53de('0x17')][_0x53de('0x18')]||null:null,'attributes':_0x5c03d9['options']?_0x5c03d9['options'][_0x53de('0x19')]||null:null,'include':_0x5c03d9['options']?_0x5c03d9[_0x53de('0x17')][_0x53de('0x1a')]?_[_0x53de('0x1b')](_0x5c03d9['options']['include'],function(_0x5e2828){return{'model':db[_0x5e2828[_0x53de('0x1c')]],'as':_0x5e2828['as'],'attributes':_0x5e2828[_0x53de('0x19')],'include':_0x5e2828['include']?_['map'](_0x5e2828['include'],function(_0x2e1c66){return{'model':db[_0x2e1c66[_0x53de('0x1c')]],'as':_0x2e1c66['as'],'attributes':_0x2e1c66['attributes'],'include':_0x2e1c66[_0x53de('0x1a')]?_[_0x53de('0x1b')](_0x2e1c66[_0x53de('0x1a')],function(_0x7cf392){return{'model':db[_0x7cf392['model']],'as':_0x7cf392['as'],'attributes':_0x7cf392['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b708){logger['info'](_0x53de('0x15'),_0x5c03d9);logger['debug']('ShowVariable',_0x5c03d9,JSON['stringify'](_0x33b708));_0x1af687(_0x33b708);})[_0x53de('0x14')](function(_0x1781b5){logger[_0x53de('0x10')](_0x53de('0x15'),_0x1781b5[_0x53de('0x12')],_0x5c03d9);_0x580292(_0x10761b[_0x53de('0x10')](0x1f4,_0x1781b5[_0x53de('0x12')]));});});}; \ No newline at end of file +var _0x1950=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1950,0x1b5));var _0x0195=function(_0x4b4a71,_0x2dd9e3){_0x4b4a71=_0x4b4a71-0x0;var _0x1435f2=_0x1950[_0x4b4a71];return _0x1435f2;};'use strict';var _=require(_0x0195('0x0'));var util=require(_0x0195('0x1'));var moment=require(_0x0195('0x2'));var BPromise=require(_0x0195('0x3'));var rs=require(_0x0195('0x4'));var fs=require('fs');var Redis=require(_0x0195('0x5'));var db=require(_0x0195('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0195('0x7'))(_0x0195('0x8'));var config=require('../../config/environment');var jayson=require(_0x0195('0x9'));var client=jayson[_0x0195('0xa')][_0x0195('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e5f2,_0x33ef1a,_0x2e0496){return new BPromise(function(_0xc161aa,_0x2b4cfa){return client[_0x0195('0xc')](_0x12e5f2,_0x2e0496)['then'](function(_0x23b06b){logger['info'](_0x0195('0xd'),_0x33ef1a,_0x0195('0xe'));logger['debug'](_0x0195('0xf'),_0x33ef1a,_0x0195('0xe'),JSON[_0x0195('0x10')](_0x23b06b));if(_0x23b06b['error']){if(_0x23b06b[_0x0195('0x11')]['code']===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x33ef1a,_0x23b06b['error']['message']);return _0x2b4cfa(_0x23b06b[_0x0195('0x11')]['message']);}logger[_0x0195('0x11')](_0x0195('0xd'),_0x33ef1a,_0x23b06b[_0x0195('0x11')][_0x0195('0x12')]);return _0xc161aa(_0x23b06b[_0x0195('0x11')][_0x0195('0x12')]);}else{logger[_0x0195('0x13')](_0x0195('0xd'),_0x33ef1a,_0x0195('0xe'));_0xc161aa(_0x23b06b[_0x0195('0x14')][_0x0195('0x12')]);}})[_0x0195('0x15')](function(_0x4f5ddf){logger[_0x0195('0x11')](_0x0195('0xd'),_0x33ef1a,_0x4f5ddf);_0x2b4cfa(_0x4f5ddf);});});}exports[_0x0195('0x16')]=function(_0xb0369b){var _0x1dd32f=this;return new Promise(function(_0x29d5c6,_0x594949){return db[_0x0195('0x17')][_0x0195('0x18')]({'raw':_0xb0369b[_0x0195('0x19')]?_0xb0369b[_0x0195('0x19')][_0x0195('0x1a')]===undefined?!![]:![]:!![],'where':_0xb0369b[_0x0195('0x19')]?_0xb0369b['options'][_0x0195('0x1b')]||null:null,'attributes':_0xb0369b[_0x0195('0x19')]?_0xb0369b[_0x0195('0x19')][_0x0195('0x1c')]||null:null,'include':_0xb0369b[_0x0195('0x19')]?_0xb0369b['options'][_0x0195('0x1d')]?_[_0x0195('0x1e')](_0xb0369b[_0x0195('0x19')][_0x0195('0x1d')],function(_0x3c2da8){return{'model':db[_0x3c2da8[_0x0195('0x1f')]],'as':_0x3c2da8['as'],'attributes':_0x3c2da8[_0x0195('0x1c')],'include':_0x3c2da8[_0x0195('0x1d')]?_[_0x0195('0x1e')](_0x3c2da8[_0x0195('0x1d')],function(_0x5ee592){return{'model':db[_0x5ee592[_0x0195('0x1f')]],'as':_0x5ee592['as'],'attributes':_0x5ee592[_0x0195('0x1c')],'include':_0x5ee592['include']?_['map'](_0x5ee592[_0x0195('0x1d')],function(_0x106611){return{'model':db[_0x106611[_0x0195('0x1f')]],'as':_0x106611['as'],'attributes':_0x106611[_0x0195('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0195('0x20')](function(_0x541867){logger[_0x0195('0x13')](_0x0195('0x16'),_0xb0369b);logger[_0x0195('0x21')]('ShowVariable',_0xb0369b,JSON[_0x0195('0x10')](_0x541867));_0x29d5c6(_0x541867);})[_0x0195('0x15')](function(_0x30ab5d){logger[_0x0195('0x11')]('ShowVariable',_0x30ab5d[_0x0195('0x12')],_0xb0369b);_0x594949(_0x1dd32f[_0x0195('0x11')](0x1f4,_0x30ab5d[_0x0195('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 4749ea1..3d3b47e 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 _0x20c0=['/pull','/restart','restart','/migrations','migrations','Router','../../components/auth/service','get','index','canUpdate','fetch','/reset','reset'];(function(_0x2bd38b,_0x30aa72){var _0x45d925=function(_0xc619db){while(--_0xc619db){_0x2bd38b['push'](_0x2bd38b['shift']());}};_0x45d925(++_0x30aa72);}(_0x20c0,0x13d));var _0x020c=function(_0x14b2bc,_0x52ba26){_0x14b2bc=_0x14b2bc-0x0;var _0x2fefcb=_0x20c0[_0x14b2bc];return _0x2fefcb;};'use strict';var express=require('express');var router=express[_0x020c('0x0')]();var auth=require(_0x020c('0x1'));var controller=require('./version.controller');router[_0x020c('0x2')]('/',controller[_0x020c('0x3')]);router[_0x020c('0x2')]('/fetch',auth['isAuthenticated'](),auth[_0x020c('0x4')](),controller[_0x020c('0x5')]);router[_0x020c('0x2')](_0x020c('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x020c('0x7')]);router[_0x020c('0x2')](_0x020c('0x8'),auth['isAuthenticated'](),auth[_0x020c('0x4')](),controller['pull']);router[_0x020c('0x2')](_0x020c('0x9'),auth['isAuthenticated'](),controller[_0x020c('0xa')]);router[_0x020c('0x2')](_0x020c('0xb'),controller[_0x020c('0xc')]);module['exports']=router; \ No newline at end of file +var _0x05ce=['fetch','get','/reset','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','isAuthenticated','canUpdate'];(function(_0x772a04,_0x29fbe5){var _0x4fd280=function(_0x3b0ff6){while(--_0x3b0ff6){_0x772a04['push'](_0x772a04['shift']());}};_0x4fd280(++_0x29fbe5);}(_0x05ce,0xcc));var _0xe05c=function(_0x55d92a,_0x9f9f89){_0x55d92a=_0x55d92a-0x0;var _0x401546=_0x05ce[_0x55d92a];return _0x401546;};'use strict';var express=require('express');var router=express[_0xe05c('0x0')]();var auth=require(_0xe05c('0x1'));var controller=require('./version.controller');router['get']('/',controller['index']);router['get']('/fetch',auth[_0xe05c('0x2')](),auth[_0xe05c('0x3')](),controller[_0xe05c('0x4')]);router[_0xe05c('0x5')](_0xe05c('0x6'),auth['isAuthenticated'](),auth[_0xe05c('0x3')](),controller['reset']);router[_0xe05c('0x5')]('/pull',auth[_0xe05c('0x2')](),auth['canUpdate'](),controller[_0xe05c('0x7')]);router[_0xe05c('0x5')](_0xe05c('0x8'),auth['isAuthenticated'](),controller[_0xe05c('0x9')]);router[_0xe05c('0x5')](_0xe05c('0xa'),controller[_0xe05c('0xb')]);module[_0xe05c('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3080a74..e911b72 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 _0x6b19=['info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','server','length','replace','.js','exports','push','sort','sequelize','Migration','getQueryInterface','constructor','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','root','index','version','query','latest','fetch','2.0.0','status','json','origin','master','error'];(function(_0x31282b,_0xa476db){var _0x19c632=function(_0x207214){while(--_0x207214){_0x31282b['push'](_0x31282b['shift']());}};_0x19c632(++_0xa476db);}(_0x6b19,0xf4));var _0x96b1=function(_0x2e57c8,_0x42d1fc){_0x2e57c8=_0x2e57c8-0x0;var _0x1287e7=_0x6b19[_0x2e57c8];return _0x1287e7;};'use strict';var Umzug=require(_0x96b1('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x96b1('0x1'));var pkginfo=require(_0x96b1('0x2'))(module,'version');var compareVersions=require(_0x96b1('0x3'));var exec=require(_0x96b1('0x4'))[_0x96b1('0x5')];var db=require(_0x96b1('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x96b1('0x7'));var logger=require(_0x96b1('0x8'))('update');var git=require('simple-git')(config[_0x96b1('0x9')]);exports[_0x96b1('0xa')]=function(_0x519fbe,_0x280b00){var _0x2300ad={'current':module['exports'][_0x96b1('0xb')],'phonebar':0x2};if(_0x519fbe[_0x96b1('0xc')]&&_0x519fbe[_0x96b1('0xc')][_0x96b1('0xd')]){return git[_0x96b1('0xe')]()['tags'](function(_0x2a9fa8,_0x4effd5){_0x2300ad['latest']=(_0x2a9fa8?module['exports']['version']:_0x4effd5[_0x96b1('0xd')])||_0x96b1('0xf');return _0x280b00[_0x96b1('0x10')](0xc8)[_0x96b1('0x11')](_0x2300ad);});}else{return _0x280b00[_0x96b1('0x10')](0xc8)['json'](_0x2300ad);}};exports[_0x96b1('0xe')]=function(_0xfa00b9,_0xe809b6){return git[_0x96b1('0xe')]([_0x96b1('0x12'),_0x96b1('0x13')],function(_0x2eddaf){if(_0x2eddaf){logger[_0x96b1('0x14')](_0x2eddaf);return _0xe809b6[_0x96b1('0x10')](0x1f4)['json'](_0x2eddaf);}logger[_0x96b1('0x15')](_0x96b1('0x16'));return _0xe809b6[_0x96b1('0x10')](0xc8)[_0x96b1('0x11')]({'output':_0x96b1('0x17')});});};exports[_0x96b1('0x18')]=function(_0x5653e1,_0x41227b){return git[_0x96b1('0x18')]([_0x96b1('0x19'),_0x96b1('0x1a')],function(_0x56a860){if(_0x56a860){logger['error'](_0x56a860);return _0x41227b[_0x96b1('0x10')](0x1f4)['json'](_0x56a860);}logger['info'](_0x96b1('0x1b'));return _0x41227b[_0x96b1('0x10')](0xc8)[_0x96b1('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x96b1('0x1c')]=function(_0x3954e3,_0x3ad333){exec(_0x96b1('0x1d'),function(_0x1e1436,_0x276919,_0x416022){logger[_0x96b1('0x15')](_0x276919);logger[_0x96b1('0x15')](_0x416022);if(_0x1e1436){logger[_0x96b1('0x14')](_0x1e1436);return _0x3ad333[_0x96b1('0x10')](0x1f4)[_0x96b1('0x11')](_0x1e1436);}return _0x3ad333[_0x96b1('0x10')](0xc8)[_0x96b1('0x11')]({'output':_0x276919});});};exports[_0x96b1('0x1e')]=function(_0x232d49,_0x1db6ba){return pm2[_0x96b1('0x1e')](_0x96b1('0x1f'))[_0x96b1('0x20')](function(_0x1bc6d3){logger[_0x96b1('0x15')](_0x96b1('0x21'),_0x1bc6d3);return _0x1db6ba[_0x96b1('0x10')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x96b1('0x22')](function(_0x4bc715){logger[_0x96b1('0x14')](_0x4bc715);return _0x1db6ba[_0x96b1('0x10')](0x1f4)[_0x96b1('0x11')](_0x4bc715);});};exports[_0x96b1('0x23')]=function(_0x4e4426,_0x59fc7c){var _0x45c20e=fs[_0x96b1('0x24')](path['join'](config[_0x96b1('0x9')],_0x96b1('0x25'),_0x96b1('0x23')));var _0x2262ad=[];for(var _0x378e04=0x0;_0x378e04<_0x45c20e[_0x96b1('0x26')];_0x378e04++){var _0x5ac63c=_0x45c20e[_0x378e04][_0x96b1('0x27')](_0x96b1('0x28'),'');if(compareVersions(module[_0x96b1('0x29')][_0x96b1('0xb')],_0x5ac63c)===-0x1){_0x2262ad[_0x96b1('0x2a')](_0x5ac63c);}}if(_0x2262ad[_0x96b1('0x26')]){var _0x24fcbc=_0x2262ad[_0x96b1('0x2b')](compareVersions);var _0x4e84dd=new Umzug({'storage':_0x96b1('0x2c'),'storageOptions':{'model':db[_0x96b1('0x2d')],'modelName':_0x96b1('0x2d'),'columnName':_0x96b1('0xb')},'migrations':{'params':[db[_0x96b1('0x2c')][_0x96b1('0x2e')](),db[_0x96b1('0x2c')][_0x96b1('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x96b1('0x30')](config[_0x96b1('0x9')],_0x96b1('0x25'),'migrations'),'pattern':/\.js$/}});_0x4e84dd['up']({'migrations':_['map'](_0x24fcbc,function(_0x2592ac){return _0x2592ac+_0x96b1('0x28');})})['then'](function(){return _0x59fc7c['status'](0xc8)['json']({'output':_0x96b1('0x31')+module[_0x96b1('0x29')][_0x96b1('0xb')]+_0x96b1('0x32')+_[_0x96b1('0x33')](_0x24fcbc),'migrations':_[_0x96b1('0x30')](_0x24fcbc)});})[_0x96b1('0x22')](function(_0x5c5c54){if(_0x5c5c54 instanceof db[_0x96b1('0x2c')]['UniqueConstraintError']){return _0x59fc7c['status'](0xc8)[_0x96b1('0x11')]({'output':_0x96b1('0x34')});}else{return _0x59fc7c['status'](0x1f4)[_0x96b1('0x11')](_0x5c5c54);}});}else{return _0x59fc7c[_0x96b1('0x10')](0xc8)[_0x96b1('0x11')]({'output':_0x96b1('0x34')});}}; \ No newline at end of file +var _0xab00=['update','simple-git','root','index','query','latest','status','json','fetch','origin','master','error','git\x20fetch','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','exports','push','sort','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','last','UniqueConstraintError','umzug','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger'];(function(_0x5b7cfa,_0x132e22){var _0x49243f=function(_0x37c2c2){while(--_0x37c2c2){_0x5b7cfa['push'](_0x5b7cfa['shift']());}};_0x49243f(++_0x132e22);}(_0xab00,0x1b9));var _0x0ab0=function(_0x316f1f,_0x107370){_0x316f1f=_0x316f1f-0x0;var _0x4240f4=_0xab00[_0x316f1f];return _0x4240f4;};'use strict';var Umzug=require(_0x0ab0('0x0'));var path=require(_0x0ab0('0x1'));var fs=require('fs');var _=require(_0x0ab0('0x2'));var pkginfo=require('pkginfo')(module,_0x0ab0('0x3'));var compareVersions=require(_0x0ab0('0x4'));var exec=require(_0x0ab0('0x5'))['exec'];var db=require(_0x0ab0('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x0ab0('0x7'));var logger=require(_0x0ab0('0x8'))(_0x0ab0('0x9'));var git=require(_0x0ab0('0xa'))(config[_0x0ab0('0xb')]);exports[_0x0ab0('0xc')]=function(_0x59fb03,_0x3e934d){var _0x2cbb53={'current':module['exports'][_0x0ab0('0x3')],'phonebar':0x2};if(_0x59fb03['query']&&_0x59fb03[_0x0ab0('0xd')][_0x0ab0('0xe')]){return git['fetch']()['tags'](function(_0x5a1887,_0x5a69bd){_0x2cbb53[_0x0ab0('0xe')]=(_0x5a1887?module['exports'][_0x0ab0('0x3')]:_0x5a69bd[_0x0ab0('0xe')])||'2.0.0';return _0x3e934d[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')](_0x2cbb53);});}else{return _0x3e934d[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')](_0x2cbb53);}};exports[_0x0ab0('0x11')]=function(_0x3f1558,_0x906db9){return git[_0x0ab0('0x11')]([_0x0ab0('0x12'),_0x0ab0('0x13')],function(_0x28f26d){if(_0x28f26d){logger[_0x0ab0('0x14')](_0x28f26d);return _0x906db9['status'](0x1f4)['json'](_0x28f26d);}logger['info'](_0x0ab0('0x15'));return _0x906db9[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x0ab0('0x16')]=function(_0x4a453f,_0x5b3bef){return git['reset']([_0x0ab0('0x17'),_0x0ab0('0x18')],function(_0x2d876b){if(_0x2d876b){logger[_0x0ab0('0x14')](_0x2d876b);return _0x5b3bef[_0x0ab0('0xf')](0x1f4)[_0x0ab0('0x10')](_0x2d876b);}logger[_0x0ab0('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5b3bef['status'](0xc8)[_0x0ab0('0x10')]({'output':_0x0ab0('0x1a')});});};exports[_0x0ab0('0x1b')]=function(_0x5c3382,_0x19b33e){exec('npm\x20install\x20--production',function(_0x2691c7,_0x2ccb3e,_0x20cd95){logger[_0x0ab0('0x19')](_0x2ccb3e);logger[_0x0ab0('0x19')](_0x20cd95);if(_0x2691c7){logger[_0x0ab0('0x14')](_0x2691c7);return _0x19b33e[_0x0ab0('0xf')](0x1f4)['json'](_0x2691c7);}return _0x19b33e[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')]({'output':_0x2ccb3e});});};exports[_0x0ab0('0x1c')]=function(_0x5e3ebb,_0x206906){return pm2[_0x0ab0('0x1c')](_0x0ab0('0x1d'))['then'](function(_0x1f5d10){logger[_0x0ab0('0x19')](_0x0ab0('0x1e'),_0x1f5d10);return _0x206906[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x0ab0('0x1f')](function(_0x4d330f){logger[_0x0ab0('0x14')](_0x4d330f);return _0x206906[_0x0ab0('0xf')](0x1f4)[_0x0ab0('0x10')](_0x4d330f);});};exports[_0x0ab0('0x20')]=function(_0x5ae993,_0x4764fc){var _0x5e7e2b=fs[_0x0ab0('0x21')](path[_0x0ab0('0x22')](config[_0x0ab0('0xb')],_0x0ab0('0x23'),_0x0ab0('0x20')));var _0xa9cb4f=[];for(var _0x3306c6=0x0;_0x3306c6<_0x5e7e2b[_0x0ab0('0x24')];_0x3306c6++){var _0x3c6822=_0x5e7e2b[_0x3306c6][_0x0ab0('0x25')](_0x0ab0('0x26'),'');if(compareVersions(module[_0x0ab0('0x27')]['version'],_0x3c6822)===-0x1){_0xa9cb4f[_0x0ab0('0x28')](_0x3c6822);}}if(_0xa9cb4f[_0x0ab0('0x24')]){var _0x989e82=_0xa9cb4f[_0x0ab0('0x29')](compareVersions);var _0xd9eac0=new Umzug({'storage':_0x0ab0('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x0ab0('0x3')},'migrations':{'params':[db[_0x0ab0('0x2a')][_0x0ab0('0x2b')](),db[_0x0ab0('0x2a')][_0x0ab0('0x2c')],function(){throw new Error(_0x0ab0('0x2d'));}],'path':path[_0x0ab0('0x22')](config['root'],_0x0ab0('0x23'),_0x0ab0('0x20')),'pattern':/\.js$/}});_0xd9eac0['up']({'migrations':_[_0x0ab0('0x2e')](_0x989e82,function(_0x33f161){return _0x33f161+'.js';})})[_0x0ab0('0x2f')](function(){return _0x4764fc['status'](0xc8)[_0x0ab0('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x0ab0('0x3')]+'\x20to\x20'+_[_0x0ab0('0x30')](_0x989e82),'migrations':_[_0x0ab0('0x22')](_0x989e82)});})[_0x0ab0('0x1f')](function(_0xb7b26b){if(_0xb7b26b instanceof db[_0x0ab0('0x2a')][_0x0ab0('0x31')]){return _0x4764fc[_0x0ab0('0xf')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x4764fc['status'](0x1f4)[_0x0ab0('0x10')](_0xb7b26b);}});}else{return _0x4764fc[_0x0ab0('0xf')](0xc8)[_0x0ab0('0x10')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index d87565d..4745f43 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 _0x2e27=['get','isAuthenticated','index','/describe','describe','/:id','show','post','update','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x2227b2,_0x4bd4db){var _0x1fb3ac=function(_0x1c5011){while(--_0x1c5011){_0x2227b2['push'](_0x2227b2['shift']());}};_0x1fb3ac(++_0x4bd4db);}(_0x2e27,0x1e6));var _0x72e2=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x2e27[_0x59eefb];return _0x1a49e8;};'use strict';var multer=require(_0x72e2('0x0'));var util=require(_0x72e2('0x1'));var path=require('path');var timeout=require(_0x72e2('0x2'));var express=require('express');var router=express[_0x72e2('0x3')]();var auth=require(_0x72e2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x72e2('0x5'));var controller=require(_0x72e2('0x6'));router[_0x72e2('0x7')]('/',auth[_0x72e2('0x8')](),controller[_0x72e2('0x9')]);router[_0x72e2('0x7')](_0x72e2('0xa'),auth[_0x72e2('0x8')](),controller[_0x72e2('0xb')]);router['get'](_0x72e2('0xc'),auth[_0x72e2('0x8')](),controller[_0x72e2('0xd')]);router[_0x72e2('0xe')]('/',auth[_0x72e2('0x8')](),controller['create']);router['put']('/:id',auth[_0x72e2('0x8')](),controller[_0x72e2('0xf')]);router['delete'](_0x72e2('0xc'),auth['isAuthenticated'](),controller[_0x72e2('0x10')]);module['exports']=router; \ No newline at end of file +var _0x989c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5c0d48,_0x50e024){var _0x367686=function(_0x134396){while(--_0x134396){_0x5c0d48['push'](_0x5c0d48['shift']());}};_0x367686(++_0x50e024);}(_0x989c,0x1e0));var _0xc989=function(_0x26c34b,_0x41e950){_0x26c34b=_0x26c34b-0x0;var _0x267153=_0x989c[_0x26c34b];return _0x267153;};'use strict';var multer=require('multer');var util=require(_0xc989('0x0'));var path=require(_0xc989('0x1'));var timeout=require(_0xc989('0x2'));var express=require(_0xc989('0x3'));var router=express[_0xc989('0x4')]();var auth=require(_0xc989('0x5'));var interaction=require(_0xc989('0x6'));var config=require(_0xc989('0x7'));var controller=require(_0xc989('0x8'));router[_0xc989('0x9')]('/',auth[_0xc989('0xa')](),controller['index']);router[_0xc989('0x9')](_0xc989('0xb'),auth[_0xc989('0xa')](),controller[_0xc989('0xc')]);router['get'](_0xc989('0xd'),auth[_0xc989('0xa')](),controller[_0xc989('0xe')]);router['post']('/',auth[_0xc989('0xa')](),controller[_0xc989('0xf')]);router[_0xc989('0x10')](_0xc989('0xd'),auth[_0xc989('0xa')](),controller[_0xc989('0x11')]);router[_0xc989('0x12')](_0xc989('0xd'),auth[_0xc989('0xa')](),controller[_0xc989('0x13')]);module[_0xc989('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d5f405e..30267a3 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 _0x7217=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'type':{'type':Sequelize[_0x7721('0x1')]},'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'calleridnum':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'queue':{'type':Sequelize[_0x7721('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7721('0x2')]},'agentconnectAt':{'type':Sequelize[_0x7721('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x7721('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x7721('0x2')]},'agentdumpAt':{'type':Sequelize[_0x7721('0x2')]},'holdtime':{'type':Sequelize[_0x7721('0x3')]},'agentcomplete':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x7721('0x3')]},'agentacw':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7721('0x3')]},'reason':{'type':Sequelize[_0x7721('0x1')]},'lastevent':{'type':Sequelize[_0x7721('0x1')]},'channel':{'type':Sequelize[_0x7721('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7721('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7721('0x1')]},'connectedlinename':{'type':Sequelize[_0x7721('0x1')]},'language':{'type':Sequelize[_0x7721('0x1')]},'accountcode':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'exten':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize[_0x7721('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7721('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7721('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7721('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x7721('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x7721('0x1')]},'destlanguage':{'type':Sequelize[_0x7721('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x7721('0x1')]},'destexten':{'type':Sequelize[_0x7721('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x7721('0x1')]},'transfer':{'type':Sequelize[_0x7721('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7721('0x1')],'comment':_0x7721('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x7721('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb138=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x305f92,_0x14744d){var _0x570ff0=function(_0xff705b){while(--_0xff705b){_0x305f92['push'](_0x305f92['shift']());}};_0x570ff0(++_0x14744d);}(_0xb138,0x1dd));var _0x8b13=function(_0x28c043,_0x2df5fc){_0x28c043=_0x28c043-0x0;var _0x50aff0=_0xb138[_0x28c043];return _0x50aff0;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'type':{'type':Sequelize[_0x8b13('0x2')]},'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'calleridnum':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'queue':{'type':Sequelize[_0x8b13('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8b13('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8b13('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8b13('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8b13('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8b13('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8b13('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b13('0x2')]},'channelstate':{'type':Sequelize[_0x8b13('0x5')]},'channelstatedesc':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'connectedlinename':{'type':Sequelize[_0x8b13('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'exten':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize[_0x8b13('0x2')]},'destchannel':{'type':Sequelize[_0x8b13('0x2')]},'destchannelstate':{'type':Sequelize[_0x8b13('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8b13('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8b13('0x2')]},'destexten':{'type':Sequelize[_0x8b13('0x2')]},'destpriority':{'type':Sequelize[_0x8b13('0x2')]},'destuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8b13('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8b13('0x2')],'comment':_0x8b13('0x6')},'transferexten':{'type':Sequelize[_0x8b13('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8b13('0x2')]},'agententerreason':{'type':Sequelize[_0x8b13('0x5')],'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 05f514f..23313f7 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 _0x73f1=['find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','jsforce','papaparse','../../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','reject','destroy','then','end','error','name','send','index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','merge'];(function(_0x12e97f,_0x5c50fc){var _0x2479e9=function(_0x496734){while(--_0x496734){_0x12e97f['push'](_0x12e97f['shift']());}};_0x2479e9(++_0x5c50fc);}(_0x73f1,0x9b));var _0x173f=function(_0x21ca53,_0x1351cd){_0x21ca53=_0x21ca53-0x0;var _0x1d63fd=_0x73f1[_0x21ca53];return _0x1d63fd;};'use strict';var pdf=require(_0x173f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x173f('0x1'));var zipdir=require(_0x173f('0x2'));var jsonpatch=require(_0x173f('0x3'));var rp=require(_0x173f('0x4'));var moment=require(_0x173f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x173f('0x6'));var util=require(_0x173f('0x7'));var path=require(_0x173f('0x8'));var sox=require(_0x173f('0x9'));var csv=require(_0x173f('0xa'));var ejs=require(_0x173f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x173f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x173f('0xd'));var Redis=require('ioredis');var authService=require(_0x173f('0xe'));var qs=require(_0x173f('0xf'));var as=require(_0x173f('0x10'));var hardwareService=require(_0x173f('0x11'));var logger=require(_0x173f('0x12'))(_0x173f('0x13'));var utils=require(_0x173f('0x14'));var config=require(_0x173f('0x15'));var db=require(_0x173f('0x16'))['db'];function respondWithStatusCode(_0x5ba520,_0x2e512b){_0x2e512b=_0x2e512b||0xcc;return function(_0x4a7ba8){if(_0x4a7ba8){return _0x5ba520[_0x173f('0x17')](_0x2e512b);}return _0x5ba520[_0x173f('0x18')](_0x2e512b)['end']();};}function respondWithResult(_0x17ded5,_0x3d45f1){_0x3d45f1=_0x3d45f1||0xc8;return function(_0x1ef68e){if(_0x1ef68e){return _0x17ded5[_0x173f('0x18')](_0x3d45f1)[_0x173f('0x19')](_0x1ef68e);}};}function respondWithFilteredResult(_0x1b6615,_0x46793e){return function(_0x581867){if(_0x581867){var _0x248451=_0x581867[_0x173f('0x1a')],_0x738676=_0x46793e[_0x173f('0x1b')],_0x2417cd=_0x46793e['offset']+_0x46793e[_0x173f('0x1c')],_0xdf708;if(_0x2417cd>=_0x248451){_0x2417cd=_0x248451;_0xdf708=0xc8;}else{_0xdf708=0xce;}_0x1b6615[_0x173f('0x18')](_0xdf708);return _0x1b6615[_0x173f('0x1d')](_0x173f('0x1e'),_0x738676+'-'+_0x2417cd+'/'+_0x248451)['json'](_0x581867);}return null;};}function patchUpdates(_0x1f7355){return function(_0x505ca6){try{jsonpatch[_0x173f('0x1f')](_0x505ca6,_0x1f7355,!![]);}catch(_0x1ca859){return BPromise[_0x173f('0x20')](_0x1ca859);}return _0x505ca6['save']();};}function saveUpdates(_0x3b5b64,_0x39b98a){return function(_0x330724){if(_0x330724){return _0x330724['update'](_0x3b5b64)['then'](function(_0x41696e){return _0x41696e;});}return null;};}function removeEntity(_0x574351,_0x1b3f4c){return function(_0x35d0ad){if(_0x35d0ad){return _0x35d0ad[_0x173f('0x21')]()[_0x173f('0x22')](function(){_0x574351[_0x173f('0x18')](0xcc)[_0x173f('0x23')]();});}};}function handleEntityNotFound(_0x49c74d,_0x957163){return function(_0x12d2b3){if(!_0x12d2b3){_0x49c74d[_0x173f('0x17')](0x194);}return _0x12d2b3;};}function handleError(_0x7c7e12,_0x43119a){_0x43119a=_0x43119a||0x1f4;return function(_0x4d8574){logger[_0x173f('0x24')](_0x4d8574['stack']);if(_0x4d8574[_0x173f('0x25')]){delete _0x4d8574[_0x173f('0x25')];}_0x7c7e12[_0x173f('0x18')](_0x43119a)[_0x173f('0x26')](_0x4d8574);};}exports[_0x173f('0x27')]=function(_0x17cb66,_0x1fee3c){var _0x2cc7b7={},_0x3dfd5b={},_0x2ef190={'count':0x0,'rows':[]};var _0x52accb=_[_0x173f('0x28')](db[_0x173f('0x29')][_0x173f('0x2a')],function(_0x951d72){return{'name':_0x951d72[_0x173f('0x2b')],'type':_0x951d72[_0x173f('0x2c')][_0x173f('0x2d')]};});_0x3dfd5b[_0x173f('0x2e')]=_[_0x173f('0x28')](_0x52accb,_0x173f('0x25'));_0x3dfd5b[_0x173f('0x2f')]=_[_0x173f('0x30')](_0x17cb66['query']);_0x3dfd5b[_0x173f('0x31')]=_['intersection'](_0x3dfd5b[_0x173f('0x2e')],_0x3dfd5b[_0x173f('0x2f')]);_0x2cc7b7[_0x173f('0x32')]=_['intersection'](_0x3dfd5b[_0x173f('0x2e')],qs['fields'](_0x17cb66[_0x173f('0x2f')][_0x173f('0x33')]));_0x2cc7b7['attributes']=_0x2cc7b7[_0x173f('0x32')][_0x173f('0x34')]?_0x2cc7b7['attributes']:_0x3dfd5b[_0x173f('0x2e')];if(!_0x17cb66[_0x173f('0x2f')][_0x173f('0x35')](_0x173f('0x36'))){_0x2cc7b7['limit']=qs['limit'](_0x17cb66['query']['limit']);_0x2cc7b7['offset']=qs['offset'](_0x17cb66[_0x173f('0x2f')][_0x173f('0x1b')]);}_0x2cc7b7[_0x173f('0x37')]=qs['sort'](_0x17cb66[_0x173f('0x2f')][_0x173f('0x38')]);_0x2cc7b7[_0x173f('0x39')]=qs['filters'](_[_0x173f('0x3a')](_0x17cb66[_0x173f('0x2f')],_0x3dfd5b['filters']),_0x52accb);if(_0x17cb66[_0x173f('0x2f')][_0x173f('0x3b')]){_0x2cc7b7['where']=_['merge'](_0x2cc7b7[_0x173f('0x39')],{'$or':_['map'](_0x52accb,function(_0x1165d2){if(_0x1165d2['type']!==_0x173f('0x3c')){var _0x856f49={};_0x856f49[_0x1165d2[_0x173f('0x25')]]={'$like':'%'+_0x17cb66['query'][_0x173f('0x3b')]+'%'};return _0x856f49;}})});}_0x2cc7b7=_['merge']({},_0x2cc7b7,_0x17cb66[_0x173f('0x3d')]);var _0x4d322c={'where':_0x2cc7b7[_0x173f('0x39')]};return db['VoiceAgentReport']['count'](_0x4d322c)[_0x173f('0x22')](function(_0x5be5ab){_0x2ef190[_0x173f('0x1a')]=_0x5be5ab;if(_0x17cb66[_0x173f('0x2f')][_0x173f('0x3e')]){_0x2cc7b7[_0x173f('0x3f')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x173f('0x40')](_0x2cc7b7);})[_0x173f('0x22')](function(_0x5ddbfe){_0x2ef190['rows']=_0x5ddbfe;return _0x2ef190;})['then'](respondWithFilteredResult(_0x1fee3c,_0x2cc7b7))[_0x173f('0x41')](handleError(_0x1fee3c,null));};exports[_0x173f('0x42')]=function(_0x20a426,_0x114f5a){var _0x85e28={'raw':![],'where':{'id':_0x20a426[_0x173f('0x43')]['id']}},_0x170fb1={};_0x170fb1['model']=_[_0x173f('0x30')](db['VoiceAgentReport'][_0x173f('0x2a')]);_0x170fb1[_0x173f('0x2f')]=_[_0x173f('0x30')](_0x20a426['query']);_0x170fb1[_0x173f('0x31')]=_[_0x173f('0x44')](_0x170fb1[_0x173f('0x2e')],_0x170fb1[_0x173f('0x2f')]);_0x85e28[_0x173f('0x32')]=_[_0x173f('0x44')](_0x170fb1[_0x173f('0x2e')],qs[_0x173f('0x33')](_0x20a426[_0x173f('0x2f')][_0x173f('0x33')]));_0x85e28[_0x173f('0x32')]=_0x85e28['attributes'][_0x173f('0x34')]?_0x85e28[_0x173f('0x32')]:_0x170fb1[_0x173f('0x2e')];if(_0x20a426[_0x173f('0x2f')][_0x173f('0x3e')]){_0x85e28[_0x173f('0x3f')]=[{'all':!![]}];}_0x85e28=_[_0x173f('0x45')]({},_0x85e28,_0x20a426[_0x173f('0x3d')]);return db[_0x173f('0x29')][_0x173f('0x46')](_0x85e28)[_0x173f('0x22')](handleEntityNotFound(_0x114f5a,null))[_0x173f('0x22')](respondWithResult(_0x114f5a,null))[_0x173f('0x41')](handleError(_0x114f5a,null));};exports['create']=function(_0x24414a,_0x400cc9){return db[_0x173f('0x29')][_0x173f('0x47')](_0x24414a[_0x173f('0x48')],{})[_0x173f('0x22')](respondWithResult(_0x400cc9,0xc9))[_0x173f('0x41')](handleError(_0x400cc9,null));};exports[_0x173f('0x49')]=function(_0xed8a3,_0x2a4a3c){if(_0xed8a3['body']['id']){delete _0xed8a3[_0x173f('0x48')]['id'];}return db['VoiceAgentReport'][_0x173f('0x46')]({'where':{'id':_0xed8a3[_0x173f('0x43')]['id']}})[_0x173f('0x22')](handleEntityNotFound(_0x2a4a3c,null))[_0x173f('0x22')](saveUpdates(_0xed8a3[_0x173f('0x48')],null))[_0x173f('0x22')](respondWithResult(_0x2a4a3c,null))[_0x173f('0x41')](handleError(_0x2a4a3c,null));};exports[_0x173f('0x21')]=function(_0x11a7eb,_0x779036){return db['VoiceAgentReport'][_0x173f('0x46')]({'where':{'id':_0x11a7eb[_0x173f('0x43')]['id']}})['then'](handleEntityNotFound(_0x779036,null))[_0x173f('0x22')](removeEntity(_0x779036,null))['catch'](handleError(_0x779036,null));};exports[_0x173f('0x4a')]=function(_0x223b75,_0x377fad){return db['VoiceAgentReport'][_0x173f('0x4a')]()[_0x173f('0x22')](respondWithResult(_0x377fad,null))['catch'](handleError(_0x377fad,null));}; \ No newline at end of file +var _0x15ad=['apply','save','update','destroy','then','error','stack','name','send','VoiceAgentReport','rawAttributes','fieldName','type','map','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','rows','catch','params','include','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x133fc0,_0x1edda8){var _0x4ce619=function(_0x308be5){while(--_0x308be5){_0x133fc0['push'](_0x133fc0['shift']());}};_0x4ce619(++_0x1edda8);}(_0x15ad,0x6a));var _0xd15a=function(_0x2f699e,_0x2e0991){_0x2f699e=_0x2f699e-0x0;var _0x271482=_0x15ad[_0x2f699e];return _0x271482;};'use strict';var pdf=require(_0xd15a('0x0'));var emlformat=require(_0xd15a('0x1'));var rimraf=require(_0xd15a('0x2'));var zipdir=require(_0xd15a('0x3'));var jsonpatch=require(_0xd15a('0x4'));var rp=require(_0xd15a('0x5'));var moment=require(_0xd15a('0x6'));var BPromise=require(_0xd15a('0x7'));var Mustache=require(_0xd15a('0x8'));var util=require('util');var path=require(_0xd15a('0x9'));var sox=require('sox');var csv=require(_0xd15a('0xa'));var ejs=require(_0xd15a('0xb'));var fs=require('fs');var _=require(_0xd15a('0xc'));var squel=require('squel');var crypto=require(_0xd15a('0xd'));var jsforce=require(_0xd15a('0xe'));var deskjs=require(_0xd15a('0xf'));var toCsv=require(_0xd15a('0xa'));var querystring=require('querystring');var Papa=require(_0xd15a('0x10'));var Redis=require(_0xd15a('0x11'));var authService=require(_0xd15a('0x12'));var qs=require(_0xd15a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd15a('0x14'));var utils=require(_0xd15a('0x15'));var config=require(_0xd15a('0x16'));var db=require(_0xd15a('0x17'))['db'];function respondWithStatusCode(_0x926560,_0x11368e){_0x11368e=_0x11368e||0xcc;return function(_0x11e46f){if(_0x11e46f){return _0x926560[_0xd15a('0x18')](_0x11368e);}return _0x926560[_0xd15a('0x19')](_0x11368e)[_0xd15a('0x1a')]();};}function respondWithResult(_0x163857,_0x27b5f7){_0x27b5f7=_0x27b5f7||0xc8;return function(_0x60217f){if(_0x60217f){return _0x163857[_0xd15a('0x19')](_0x27b5f7)[_0xd15a('0x1b')](_0x60217f);}};}function respondWithFilteredResult(_0xc13308,_0x83cc11){return function(_0xff8692){if(_0xff8692){var _0x5b7631=_0xff8692[_0xd15a('0x1c')],_0x1179b5=_0x83cc11['offset'],_0x5ef0e7=_0x83cc11[_0xd15a('0x1d')]+_0x83cc11[_0xd15a('0x1e')],_0x5f3740;if(_0x5ef0e7>=_0x5b7631){_0x5ef0e7=_0x5b7631;_0x5f3740=0xc8;}else{_0x5f3740=0xce;}_0xc13308['status'](_0x5f3740);return _0xc13308['set'](_0xd15a('0x1f'),_0x1179b5+'-'+_0x5ef0e7+'/'+_0x5b7631)[_0xd15a('0x1b')](_0xff8692);}return null;};}function patchUpdates(_0x350854){return function(_0x20aa96){try{jsonpatch[_0xd15a('0x20')](_0x20aa96,_0x350854,!![]);}catch(_0x4563ef){return BPromise['reject'](_0x4563ef);}return _0x20aa96[_0xd15a('0x21')]();};}function saveUpdates(_0x5e17d3,_0x232913){return function(_0x2df73e){if(_0x2df73e){return _0x2df73e[_0xd15a('0x22')](_0x5e17d3)['then'](function(_0x13fff7){return _0x13fff7;});}return null;};}function removeEntity(_0x25043d,_0x12bc02){return function(_0x479e86){if(_0x479e86){return _0x479e86[_0xd15a('0x23')]()[_0xd15a('0x24')](function(){_0x25043d[_0xd15a('0x19')](0xcc)[_0xd15a('0x1a')]();});}};}function handleEntityNotFound(_0x4ddf0b,_0x4e8307){return function(_0x362dc8){if(!_0x362dc8){_0x4ddf0b[_0xd15a('0x18')](0x194);}return _0x362dc8;};}function handleError(_0x1fa2e7,_0x206ad0){_0x206ad0=_0x206ad0||0x1f4;return function(_0x387ab5){logger[_0xd15a('0x25')](_0x387ab5[_0xd15a('0x26')]);if(_0x387ab5['name']){delete _0x387ab5[_0xd15a('0x27')];}_0x1fa2e7[_0xd15a('0x19')](_0x206ad0)[_0xd15a('0x28')](_0x387ab5);};}exports['index']=function(_0x588d5f,_0x37cc30){var _0x33bda1={},_0x1ddbb0={},_0x43c544={'count':0x0,'rows':[]};var _0x76022e=_['map'](db[_0xd15a('0x29')][_0xd15a('0x2a')],function(_0x5a19fd){return{'name':_0x5a19fd[_0xd15a('0x2b')],'type':_0x5a19fd[_0xd15a('0x2c')]['key']};});_0x1ddbb0['model']=_[_0xd15a('0x2d')](_0x76022e,_0xd15a('0x27'));_0x1ddbb0['query']=_[_0xd15a('0x2e')](_0x588d5f[_0xd15a('0x2f')]);_0x1ddbb0[_0xd15a('0x30')]=_['intersection'](_0x1ddbb0[_0xd15a('0x31')],_0x1ddbb0['query']);_0x33bda1[_0xd15a('0x32')]=_['intersection'](_0x1ddbb0[_0xd15a('0x31')],qs[_0xd15a('0x33')](_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x33')]));_0x33bda1[_0xd15a('0x32')]=_0x33bda1[_0xd15a('0x32')][_0xd15a('0x34')]?_0x33bda1[_0xd15a('0x32')]:_0x1ddbb0['model'];if(!_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x35')](_0xd15a('0x36'))){_0x33bda1[_0xd15a('0x1e')]=qs[_0xd15a('0x1e')](_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x1e')]);_0x33bda1[_0xd15a('0x1d')]=qs[_0xd15a('0x1d')](_0x588d5f[_0xd15a('0x2f')]['offset']);}_0x33bda1['order']=qs['sort'](_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x37')]);_0x33bda1[_0xd15a('0x38')]=qs[_0xd15a('0x30')](_['pick'](_0x588d5f[_0xd15a('0x2f')],_0x1ddbb0['filters']),_0x76022e);if(_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x39')]){_0x33bda1[_0xd15a('0x38')]=_['merge'](_0x33bda1[_0xd15a('0x38')],{'$or':_['map'](_0x76022e,function(_0x55d211){if(_0x55d211[_0xd15a('0x2c')]!=='VIRTUAL'){var _0x293b54={};_0x293b54[_0x55d211[_0xd15a('0x27')]]={'$like':'%'+_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x39')]+'%'};return _0x293b54;}})});}_0x33bda1=_[_0xd15a('0x3a')]({},_0x33bda1,_0x588d5f[_0xd15a('0x3b')]);var _0x57a92c={'where':_0x33bda1['where']};return db[_0xd15a('0x29')][_0xd15a('0x1c')](_0x57a92c)['then'](function(_0x1b21d1){_0x43c544[_0xd15a('0x1c')]=_0x1b21d1;if(_0x588d5f[_0xd15a('0x2f')][_0xd15a('0x3c')]){_0x33bda1['include']=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x33bda1);})['then'](function(_0x2e2419){_0x43c544[_0xd15a('0x3d')]=_0x2e2419;return _0x43c544;})[_0xd15a('0x24')](respondWithFilteredResult(_0x37cc30,_0x33bda1))[_0xd15a('0x3e')](handleError(_0x37cc30,null));};exports['show']=function(_0x5c38e4,_0x479468){var _0x484166={'raw':![],'where':{'id':_0x5c38e4[_0xd15a('0x3f')]['id']}},_0x243adc={};_0x243adc['model']=_[_0xd15a('0x2e')](db['VoiceAgentReport'][_0xd15a('0x2a')]);_0x243adc[_0xd15a('0x2f')]=_[_0xd15a('0x2e')](_0x5c38e4[_0xd15a('0x2f')]);_0x243adc['filters']=_['intersection'](_0x243adc[_0xd15a('0x31')],_0x243adc[_0xd15a('0x2f')]);_0x484166['attributes']=_['intersection'](_0x243adc['model'],qs[_0xd15a('0x33')](_0x5c38e4[_0xd15a('0x2f')][_0xd15a('0x33')]));_0x484166['attributes']=_0x484166['attributes']['length']?_0x484166[_0xd15a('0x32')]:_0x243adc['model'];if(_0x5c38e4['query']['includeAll']){_0x484166[_0xd15a('0x40')]=[{'all':!![]}];}_0x484166=_[_0xd15a('0x3a')]({},_0x484166,_0x5c38e4[_0xd15a('0x3b')]);return db[_0xd15a('0x29')]['find'](_0x484166)[_0xd15a('0x24')](handleEntityNotFound(_0x479468,null))[_0xd15a('0x24')](respondWithResult(_0x479468,null))[_0xd15a('0x3e')](handleError(_0x479468,null));};exports[_0xd15a('0x41')]=function(_0x5b2ac9,_0x19748a){return db[_0xd15a('0x29')][_0xd15a('0x41')](_0x5b2ac9[_0xd15a('0x42')],{})[_0xd15a('0x24')](respondWithResult(_0x19748a,0xc9))[_0xd15a('0x3e')](handleError(_0x19748a,null));};exports[_0xd15a('0x22')]=function(_0x8b4a98,_0x53bca8){if(_0x8b4a98[_0xd15a('0x42')]['id']){delete _0x8b4a98[_0xd15a('0x42')]['id'];}return db[_0xd15a('0x29')][_0xd15a('0x43')]({'where':{'id':_0x8b4a98[_0xd15a('0x3f')]['id']}})[_0xd15a('0x24')](handleEntityNotFound(_0x53bca8,null))[_0xd15a('0x24')](saveUpdates(_0x8b4a98[_0xd15a('0x42')],null))['then'](respondWithResult(_0x53bca8,null))[_0xd15a('0x3e')](handleError(_0x53bca8,null));};exports[_0xd15a('0x23')]=function(_0x781817,_0x21ef07){return db[_0xd15a('0x29')][_0xd15a('0x43')]({'where':{'id':_0x781817[_0xd15a('0x3f')]['id']}})[_0xd15a('0x24')](handleEntityNotFound(_0x21ef07,null))['then'](removeEntity(_0x21ef07,null))[_0xd15a('0x3e')](handleError(_0x21ef07,null));};exports[_0xd15a('0x44')]=function(_0x56e9ec,_0x38375a){return db[_0xd15a('0x29')][_0xd15a('0x44')]()[_0xd15a('0x24')](respondWithResult(_0x38375a,null))['catch'](handleError(_0x38375a,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 26fae9a..7e049d4 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 _0x5b94=['rimraf','exports','define','VoiceAgentReport','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xb33f93,_0x74da85){var _0x51473f=function(_0xe224ad){while(--_0xe224ad){_0xb33f93['push'](_0xb33f93['shift']());}};_0x51473f(++_0x74da85);}(_0x5b94,0x117));var _0x45b9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5b94[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x45b9('0x0'));var util=require(_0x45b9('0x1'));var logger=require(_0x45b9('0x2'))('api');var moment=require(_0x45b9('0x3'));var BPromise=require(_0x45b9('0x4'));var rp=require(_0x45b9('0x5'));var fs=require('fs');var path=require(_0x45b9('0x6'));var rimraf=require(_0x45b9('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x45b9('0x8')]=function(_0x470291,_0x10b5b2){return _0x470291[_0x45b9('0x9')](_0x45b9('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x45b9('0xb'),_0x45b9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ca9=['uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','VoiceAgentReport','report_agent'];(function(_0x1559c8,_0x20a312){var _0x2646fe=function(_0x4d6f77){while(--_0x4d6f77){_0x1559c8['push'](_0x1559c8['shift']());}};_0x2646fe(++_0x20a312);}(_0x8ca9,0x9c));var _0x98ca=function(_0x1aa65d,_0xf9591d){_0x1aa65d=_0x1aa65d-0x0;var _0x3f6502=_0x8ca9[_0x1aa65d];return _0x3f6502;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('0xb'),'paranoid':![],'indexes':[{'fields':[_0x98ca('0xc'),_0x98ca('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 8df313a..0374e7a 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 _0xd94d=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','attributes','limit','lodash','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd94d,0x10a));var _0xdd94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd94d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xdd94('0x0'));var util=require('util');var moment=require(_0xdd94('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd94('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd94('0x3'));var logger=require('../../config/logger')(_0xdd94('0x4'));var config=require(_0xdd94('0x5'));var jayson=require(_0xdd94('0x6'));var client=jayson[_0xdd94('0x7')][_0xdd94('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cdce0,_0x49d696,_0x26ec17){return new BPromise(function(_0x573ea3,_0x2eb6b0){return client['request'](_0x1cdce0,_0x26ec17)[_0xdd94('0x9')](function(_0x520d55){logger[_0xdd94('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x49d696,_0xdd94('0xb'));logger[_0xdd94('0xc')](_0xdd94('0xd'),_0x49d696,_0xdd94('0xb'),JSON[_0xdd94('0xe')](_0x520d55));if(_0x520d55[_0xdd94('0xf')]){if(_0x520d55['error'][_0xdd94('0x10')]===0x1f4){logger['error'](_0xdd94('0x11'),_0x49d696,_0x520d55[_0xdd94('0xf')][_0xdd94('0x12')]);return _0x2eb6b0(_0x520d55[_0xdd94('0xf')][_0xdd94('0x12')]);}logger[_0xdd94('0xf')](_0xdd94('0x11'),_0x49d696,_0x520d55[_0xdd94('0xf')][_0xdd94('0x12')]);return _0x573ea3(_0x520d55[_0xdd94('0xf')][_0xdd94('0x12')]);}else{logger[_0xdd94('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x49d696,_0xdd94('0xb'));_0x573ea3(_0x520d55[_0xdd94('0x13')]['message']);}})[_0xdd94('0x14')](function(_0x5aa125){logger['error'](_0xdd94('0x11'),_0x49d696,_0x5aa125);_0x2eb6b0(_0x5aa125);});});}exports['CreateVoiceAgentReport']=function(_0x2f6767){var _0xc7ae70=this;return new Promise(function(_0x1f3b8b,_0x5a0b39){return db[_0xdd94('0x15')][_0xdd94('0x16')](_0x2f6767[_0xdd94('0x17')],{'raw':_0x2f6767[_0xdd94('0x18')]?_0x2f6767[_0xdd94('0x18')][_0xdd94('0x19')]===undefined?!![]:![]:!![]})[_0xdd94('0x9')](function(_0x24cf2b){logger['info'](_0xdd94('0x1a'),_0x2f6767);logger[_0xdd94('0xc')]('CreateVoiceAgentReport',_0x2f6767,JSON['stringify'](_0x24cf2b));_0x1f3b8b(_0x24cf2b);})[_0xdd94('0x14')](function(_0x1d971a){logger['error'](_0xdd94('0x1a'),_0x1d971a[_0xdd94('0x12')],_0x2f6767);_0x5a0b39(_0xc7ae70[_0xdd94('0xf')](0x1f4,_0x1d971a[_0xdd94('0x12')]));});});};exports[_0xdd94('0x1b')]=function(_0x12b209){var _0x3f8e30=this;return new Promise(function(_0x1d4f99,_0x598f6c){return db[_0xdd94('0x15')][_0xdd94('0x1c')](_0x12b209[_0xdd94('0x17')],{'raw':_0x12b209['options']?_0x12b209[_0xdd94('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12b209['options']?_0x12b209[_0xdd94('0x18')]['where']||null:null,'attributes':_0x12b209['options']?_0x12b209[_0xdd94('0x18')][_0xdd94('0x1d')]||null:null,'limit':_0x12b209[_0xdd94('0x18')]?_0x12b209[_0xdd94('0x18')][_0xdd94('0x1e')]||null:null})[_0xdd94('0x9')](function(_0x5ad29f){logger[_0xdd94('0xa')]('UpdateVoiceAgentReport',_0x12b209);logger['debug'](_0xdd94('0x1b'),_0x12b209,JSON['stringify'](_0x5ad29f));_0x1d4f99(_0x5ad29f);})[_0xdd94('0x14')](function(_0x20d61b){logger[_0xdd94('0xf')]('UpdateVoiceAgentReport',_0x20d61b['message'],_0x12b209);_0x598f6c(_0x3f8e30['error'](0x1f4,_0x20d61b[_0xdd94('0x12')]));});});}; \ No newline at end of file +var _0xbf85=['request\x20sent','stringify','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x1c8bd3,_0x453096){var _0x30228d=function(_0x23d5d3){while(--_0x23d5d3){_0x1c8bd3['push'](_0x1c8bd3['shift']());}};_0x30228d(++_0x453096);}(_0xbf85,0xd0));var _0x5bf8=function(_0xedc747,_0x38cf97){_0xedc747=_0xedc747-0x0;var _0x530406=_0xbf85[_0xedc747];return _0x530406;};'use strict';var _=require(_0x5bf8('0x0'));var util=require(_0x5bf8('0x1'));var moment=require(_0x5bf8('0x2'));var BPromise=require(_0x5bf8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bf8('0x4'));var db=require(_0x5bf8('0x5'))['db'];var utils=require(_0x5bf8('0x6'));var logger=require(_0x5bf8('0x7'))(_0x5bf8('0x8'));var config=require(_0x5bf8('0x9'));var jayson=require(_0x5bf8('0xa'));var client=jayson[_0x5bf8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaa2e46,_0x3efb2b,_0x34fa7b){return new BPromise(function(_0x57bfc0,_0x3a19a9){return client[_0x5bf8('0xc')](_0xaa2e46,_0x34fa7b)[_0x5bf8('0xd')](function(_0x3b27f1){logger[_0x5bf8('0xe')](_0x5bf8('0xf'),_0x3efb2b,_0x5bf8('0x10'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3efb2b,_0x5bf8('0x10'),JSON[_0x5bf8('0x11')](_0x3b27f1));if(_0x3b27f1[_0x5bf8('0x12')]){if(_0x3b27f1[_0x5bf8('0x12')][_0x5bf8('0x13')]===0x1f4){logger[_0x5bf8('0x12')](_0x5bf8('0xf'),_0x3efb2b,_0x3b27f1[_0x5bf8('0x12')][_0x5bf8('0x14')]);return _0x3a19a9(_0x3b27f1[_0x5bf8('0x12')][_0x5bf8('0x14')]);}logger[_0x5bf8('0x12')](_0x5bf8('0xf'),_0x3efb2b,_0x3b27f1[_0x5bf8('0x12')]['message']);return _0x57bfc0(_0x3b27f1[_0x5bf8('0x12')][_0x5bf8('0x14')]);}else{logger[_0x5bf8('0xe')](_0x5bf8('0xf'),_0x3efb2b,_0x5bf8('0x10'));_0x57bfc0(_0x3b27f1['result']['message']);}})[_0x5bf8('0x15')](function(_0xb22732){logger[_0x5bf8('0x12')](_0x5bf8('0xf'),_0x3efb2b,_0xb22732);_0x3a19a9(_0xb22732);});});}exports[_0x5bf8('0x16')]=function(_0x3c6ef0){var _0x4bd7d3=this;return new Promise(function(_0x236589,_0x278b17){return db[_0x5bf8('0x17')]['create'](_0x3c6ef0[_0x5bf8('0x18')],{'raw':_0x3c6ef0[_0x5bf8('0x19')]?_0x3c6ef0[_0x5bf8('0x19')][_0x5bf8('0x1a')]===undefined?!![]:![]:!![]})[_0x5bf8('0xd')](function(_0x416778){logger[_0x5bf8('0xe')](_0x5bf8('0x16'),_0x3c6ef0);logger['debug']('CreateVoiceAgentReport',_0x3c6ef0,JSON[_0x5bf8('0x11')](_0x416778));_0x236589(_0x416778);})[_0x5bf8('0x15')](function(_0xb5af53){logger[_0x5bf8('0x12')](_0x5bf8('0x16'),_0xb5af53['message'],_0x3c6ef0);_0x278b17(_0x4bd7d3['error'](0x1f4,_0xb5af53[_0x5bf8('0x14')]));});});};exports[_0x5bf8('0x1b')]=function(_0x582f6e){var _0xb082e3=this;return new Promise(function(_0x117383,_0xb639b5){return db['VoiceAgentReport']['update'](_0x582f6e[_0x5bf8('0x18')],{'raw':_0x582f6e[_0x5bf8('0x19')]?_0x582f6e[_0x5bf8('0x19')][_0x5bf8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582f6e['options']?_0x582f6e['options'][_0x5bf8('0x1c')]||null:null,'attributes':_0x582f6e['options']?_0x582f6e[_0x5bf8('0x19')][_0x5bf8('0x1d')]||null:null,'limit':_0x582f6e[_0x5bf8('0x19')]?_0x582f6e[_0x5bf8('0x19')][_0x5bf8('0x1e')]||null:null})['then'](function(_0x10f205){logger[_0x5bf8('0xe')](_0x5bf8('0x1b'),_0x582f6e);logger[_0x5bf8('0x1f')]('UpdateVoiceAgentReport',_0x582f6e,JSON['stringify'](_0x10f205));_0x117383(_0x10f205);})['catch'](function(_0x86f676){logger[_0x5bf8('0x12')](_0x5bf8('0x1b'),_0x86f676['message'],_0x582f6e);_0xb639b5(_0xb082e3['error'](0x1f4,_0x86f676[_0x5bf8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 23b6c0a..f31b063 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 _0x4832=['get','isAuthenticated','index','/describe','describe','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceCallReport.controller'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0x4832,0x12b));var _0x2483=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x4832[_0x531e48];return _0x202971;};'use strict';var multer=require(_0x2483('0x0'));var util=require(_0x2483('0x1'));var path=require(_0x2483('0x2'));var timeout=require(_0x2483('0x3'));var express=require(_0x2483('0x4'));var router=express['Router']();var auth=require(_0x2483('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2483('0x6'));router[_0x2483('0x7')]('/',auth[_0x2483('0x8')](),controller[_0x2483('0x9')]);router[_0x2483('0x7')](_0x2483('0xa'),auth['isAuthenticated'](),controller[_0x2483('0xb')]);router[_0x2483('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2483('0xc')]('/',auth[_0x2483('0x8')](),controller[_0x2483('0xd')]);router['put'](_0x2483('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x2483('0xf')](_0x2483('0xe'),auth['isAuthenticated'](),controller[_0x2483('0x10')]);module[_0x2483('0x11')]=router; \ No newline at end of file +var _0x3291=['show','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x2398d6,_0x2e04a9){var _0x32b942=function(_0x3669fc){while(--_0x3669fc){_0x2398d6['push'](_0x2398d6['shift']());}};_0x32b942(++_0x2e04a9);}(_0x3291,0xba));var _0x1329=function(_0x329769,_0x5c1035){_0x329769=_0x329769-0x0;var _0xbbc3aa=_0x3291[_0x329769];return _0xbbc3aa;};'use strict';var multer=require('multer');var util=require(_0x1329('0x0'));var path=require(_0x1329('0x1'));var timeout=require(_0x1329('0x2'));var express=require(_0x1329('0x3'));var router=express[_0x1329('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1329('0x5'));var config=require(_0x1329('0x6'));var controller=require(_0x1329('0x7'));router[_0x1329('0x8')]('/',auth['isAuthenticated'](),controller[_0x1329('0x9')]);router[_0x1329('0x8')](_0x1329('0xa'),auth[_0x1329('0xb')](),controller[_0x1329('0xc')]);router[_0x1329('0x8')](_0x1329('0xd'),auth[_0x1329('0xb')](),controller[_0x1329('0xe')]);router['post']('/',auth[_0x1329('0xb')](),controller[_0x1329('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1329('0x10')]);router[_0x1329('0x11')]('/:id',auth[_0x1329('0xb')](),controller[_0x1329('0x12')]);module[_0x1329('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e463da4..b1f267f 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(_0xfe30d5,_0x44cb68){var _0x80272c=function(_0x241d09){while(--_0x241d09){_0xfe30d5['push'](_0xfe30d5['shift']());}};_0x80272c(++_0x44cb68);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x54ca9d,_0x358a79){var _0x58fb8d=function(_0x463f5c){while(--_0x463f5c){_0x54ca9d['push'](_0x54ca9d['shift']());}};_0x58fb8d(++_0x358a79);}(_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 ba3dd72..55c5a83 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 _0x374b=['query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','fullname','alias','User','VoiceCallReport','findAll','rows','catch','params','keys','length','include','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','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','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','key','model','map'];(function(_0x32e6ce,_0xf2adef){var _0x553af2=function(_0x246891){while(--_0x246891){_0x32e6ce['push'](_0x32e6ce['shift']());}};_0x553af2(++_0xf2adef);}(_0x374b,0x1b1));var _0xb374=function(_0x2e532c,_0x4be1f3){_0x2e532c=_0x2e532c-0x0;var _0x5a2d5e=_0x374b[_0x2e532c];return _0x5a2d5e;};'use strict';var pdf=require(_0xb374('0x0'));var emlformat=require(_0xb374('0x1'));var rimraf=require(_0xb374('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb374('0x3'));var rp=require(_0xb374('0x4'));var moment=require(_0xb374('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb374('0x6'));var util=require(_0xb374('0x7'));var path=require('path');var sox=require(_0xb374('0x8'));var csv=require(_0xb374('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb374('0xa'));var squel=require(_0xb374('0xb'));var crypto=require(_0xb374('0xc'));var jsforce=require(_0xb374('0xd'));var deskjs=require(_0xb374('0xe'));var toCsv=require(_0xb374('0x9'));var querystring=require(_0xb374('0xf'));var Papa=require('papaparse');var Redis=require(_0xb374('0x10'));var authService=require(_0xb374('0x11'));var qs=require(_0xb374('0x12'));var as=require(_0xb374('0x13'));var hardwareService=require(_0xb374('0x14'));var logger=require('../../config/logger')(_0xb374('0x15'));var utils=require(_0xb374('0x16'));var config=require(_0xb374('0x17'));var db=require(_0xb374('0x18'))['db'];function respondWithStatusCode(_0x1b277e,_0x2e1dbc){_0x2e1dbc=_0x2e1dbc||0xcc;return function(_0x5602a6){if(_0x5602a6){return _0x1b277e[_0xb374('0x19')](_0x2e1dbc);}return _0x1b277e[_0xb374('0x1a')](_0x2e1dbc)[_0xb374('0x1b')]();};}function respondWithResult(_0x2ef3bb,_0x5ecad7){_0x5ecad7=_0x5ecad7||0xc8;return function(_0x3d2788){if(_0x3d2788){return _0x2ef3bb[_0xb374('0x1a')](_0x5ecad7)['json'](_0x3d2788);}};}function respondWithFilteredResult(_0x4b4db2,_0x487c40){return function(_0x36f0a5){if(_0x36f0a5){var _0x3c508c=_0x36f0a5[_0xb374('0x1c')],_0x5d21e4=_0x487c40[_0xb374('0x1d')],_0x1345b6=_0x487c40[_0xb374('0x1d')]+_0x487c40[_0xb374('0x1e')],_0x5e050f;if(_0x1345b6>=_0x3c508c){_0x1345b6=_0x3c508c;_0x5e050f=0xc8;}else{_0x5e050f=0xce;}_0x4b4db2[_0xb374('0x1a')](_0x5e050f);return _0x4b4db2['set'](_0xb374('0x1f'),_0x5d21e4+'-'+_0x1345b6+'/'+_0x3c508c)[_0xb374('0x20')](_0x36f0a5);}return null;};}function patchUpdates(_0x216eb7){return function(_0x49b4f5){try{jsonpatch[_0xb374('0x21')](_0x49b4f5,_0x216eb7,!![]);}catch(_0x2efd94){return BPromise[_0xb374('0x22')](_0x2efd94);}return _0x49b4f5[_0xb374('0x23')]();};}function saveUpdates(_0x3aa60d,_0x2baab2){return function(_0x277d25){if(_0x277d25){return _0x277d25[_0xb374('0x24')](_0x3aa60d)[_0xb374('0x25')](function(_0xae6557){return _0xae6557;});}return null;};}function removeEntity(_0x222e64,_0x134a6b){return function(_0x10cc2c){if(_0x10cc2c){return _0x10cc2c[_0xb374('0x26')]()['then'](function(){_0x222e64[_0xb374('0x1a')](0xcc)[_0xb374('0x1b')]();});}};}function handleEntityNotFound(_0x139733,_0x3dc80d){return function(_0x29fef7){if(!_0x29fef7){_0x139733[_0xb374('0x19')](0x194);}return _0x29fef7;};}function handleError(_0x4b5622,_0x317e28){_0x317e28=_0x317e28||0x1f4;return function(_0x49bc4d){logger['error'](_0x49bc4d[_0xb374('0x27')]);if(_0x49bc4d[_0xb374('0x28')]){delete _0x49bc4d[_0xb374('0x28')];}_0x4b5622[_0xb374('0x1a')](_0x317e28)[_0xb374('0x29')](_0x49bc4d);};}exports[_0xb374('0x2a')]=function(_0x35053d,_0xeee271){var _0x25a168={},_0x36cc56={},_0x10a05c={'count':0x0,'rows':[]};var _0x3c5e0a=_['map'](db['VoiceCallReport'][_0xb374('0x2b')],function(_0x463634){return{'name':_0x463634['fieldName'],'type':_0x463634['type'][_0xb374('0x2c')]};});_0x36cc56[_0xb374('0x2d')]=_[_0xb374('0x2e')](_0x3c5e0a,'name');_0x36cc56[_0xb374('0x2f')]=_['keys'](_0x35053d[_0xb374('0x2f')]);_0x36cc56[_0xb374('0x30')]=_['intersection'](_0x36cc56[_0xb374('0x2d')],_0x36cc56[_0xb374('0x2f')]);_0x25a168[_0xb374('0x31')]=_[_0xb374('0x32')](_0x36cc56[_0xb374('0x2d')],qs[_0xb374('0x33')](_0x35053d['query']['fields']));_0x25a168[_0xb374('0x31')]=_0x25a168[_0xb374('0x31')]['length']?_0x25a168[_0xb374('0x31')]:_0x36cc56[_0xb374('0x2d')];if(!_0x35053d['query'][_0xb374('0x34')](_0xb374('0x35'))){_0x25a168[_0xb374('0x1e')]=qs[_0xb374('0x1e')](_0x35053d[_0xb374('0x2f')]['limit']);_0x25a168[_0xb374('0x1d')]=qs['offset'](_0x35053d[_0xb374('0x2f')][_0xb374('0x1d')]);}_0x25a168[_0xb374('0x36')]=qs[_0xb374('0x37')](_0x35053d[_0xb374('0x2f')]['sort']);_0x25a168[_0xb374('0x38')]=qs[_0xb374('0x30')](_[_0xb374('0x39')](_0x35053d[_0xb374('0x2f')],_0x36cc56[_0xb374('0x30')]),_0x3c5e0a);if(_0x35053d[_0xb374('0x2f')][_0xb374('0x3a')]){_0x25a168[_0xb374('0x38')]=_[_0xb374('0x3b')](_0x25a168['where'],{'$or':_['map'](_0x3c5e0a,function(_0x4d9edf){if(_0x4d9edf[_0xb374('0x3c')]!=='VIRTUAL'){var _0x3cc5f2={};_0x3cc5f2[_0x4d9edf[_0xb374('0x28')]]={'$like':'%'+_0x35053d[_0xb374('0x2f')]['filter']+'%'};return _0x3cc5f2;}})});}_0x25a168=_['merge']({},_0x25a168,_0x35053d[_0xb374('0x3d')]);var _0x372f98={'where':_0x25a168[_0xb374('0x38')]};return db['VoiceCallReport'][_0xb374('0x1c')](_0x372f98)[_0xb374('0x25')](function(_0x4a6e6e){_0x10a05c['count']=_0x4a6e6e;if(_0x35053d[_0xb374('0x2f')][_0xb374('0x3e')]){_0x25a168['include']=[{'attributes':['id','name',_0xb374('0x3f'),_0xb374('0x40')],'model':db[_0xb374('0x41')],'as':_0xb374('0x41')}];}return db[_0xb374('0x42')][_0xb374('0x43')](_0x25a168);})[_0xb374('0x25')](function(_0x9cb576){_0x10a05c[_0xb374('0x44')]=_0x9cb576;return _0x10a05c;})[_0xb374('0x25')](respondWithFilteredResult(_0xeee271,_0x25a168))[_0xb374('0x45')](handleError(_0xeee271,null));};exports['show']=function(_0x16b93f,_0x349e6f){var _0x97b971={'raw':!![],'where':{'id':_0x16b93f[_0xb374('0x46')]['id']}},_0x8b63ef={};_0x8b63ef[_0xb374('0x2d')]=_[_0xb374('0x47')](db[_0xb374('0x42')][_0xb374('0x2b')]);_0x8b63ef['query']=_[_0xb374('0x47')](_0x16b93f[_0xb374('0x2f')]);_0x8b63ef[_0xb374('0x30')]=_['intersection'](_0x8b63ef[_0xb374('0x2d')],_0x8b63ef[_0xb374('0x2f')]);_0x97b971[_0xb374('0x31')]=_[_0xb374('0x32')](_0x8b63ef[_0xb374('0x2d')],qs['fields'](_0x16b93f[_0xb374('0x2f')]['fields']));_0x97b971['attributes']=_0x97b971[_0xb374('0x31')][_0xb374('0x48')]?_0x97b971[_0xb374('0x31')]:_0x8b63ef[_0xb374('0x2d')];if(_0x16b93f['query'][_0xb374('0x3e')]){_0x97b971[_0xb374('0x49')]=[{'all':!![]}];}_0x97b971=_[_0xb374('0x3b')]({},_0x97b971,_0x16b93f['options']);return db[_0xb374('0x42')][_0xb374('0x4a')](_0x97b971)['then'](handleEntityNotFound(_0x349e6f,null))[_0xb374('0x25')](respondWithResult(_0x349e6f,null))['catch'](handleError(_0x349e6f,null));};exports[_0xb374('0x4b')]=function(_0x258b5d,_0x4389f4){return db[_0xb374('0x42')][_0xb374('0x4b')](_0x258b5d[_0xb374('0x4c')],{})[_0xb374('0x25')](respondWithResult(_0x4389f4,0xc9))[_0xb374('0x45')](handleError(_0x4389f4,null));};exports[_0xb374('0x26')]=function(_0x7dbf88,_0x1f05e3){return db['VoiceCallReport']['find']({'where':{'id':_0x7dbf88[_0xb374('0x46')]['id']}})[_0xb374('0x25')](handleEntityNotFound(_0x1f05e3,null))['then'](removeEntity(_0x1f05e3,null))[_0xb374('0x45')](handleError(_0x1f05e3,null));};exports[_0xb374('0x4d')]=function(_0x230841,_0x56986a){return db[_0xb374('0x42')][_0xb374('0x4d')]()[_0xb374('0x25')](respondWithResult(_0x56986a,null))['catch'](handleError(_0x56986a,null));};exports[_0xb374('0x24')]=function(_0x392da9,_0x4a4a91){if(_0x392da9['body'][_0xb374('0x4e')]){delete _0x392da9[_0xb374('0x4c')][_0xb374('0x4e')];}return db['VoiceCallReport'][_0xb374('0x4a')]({'where':{'uniqueid':_0x392da9[_0xb374('0x46')]['id'],'UserId':{'$or':[null,_0x392da9[_0xb374('0x4f')]['id']]}}})[_0xb374('0x25')](handleEntityNotFound(_0x4a4a91,null))[_0xb374('0x25')](saveUpdates(_0x392da9[_0xb374('0x4c')],null))[_0xb374('0x25')](respondWithResult(_0x4a4a91,null))[_0xb374('0x45')](handleError(_0x4a4a91,null));}; \ No newline at end of file +var _0x33d3=['update','then','destroy','end','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','filters','intersection','attributes','fields','query','length','order','sort','filter','where','merge','includeAll','include','fullname','alias','User','findAll','catch','show','params','options','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x33d3,0x1e4));var _0x333d=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x33d3[_0xcfe8cc];return _0x55ac53;};'use strict';var pdf=require(_0x333d('0x0'));var emlformat=require(_0x333d('0x1'));var rimraf=require(_0x333d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x333d('0x3'));var rp=require('request-promise');var moment=require(_0x333d('0x4'));var BPromise=require(_0x333d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x333d('0x6'));var sox=require(_0x333d('0x7'));var csv=require(_0x333d('0x8'));var ejs=require(_0x333d('0x9'));var fs=require('fs');var _=require(_0x333d('0xa'));var squel=require('squel');var crypto=require(_0x333d('0xb'));var jsforce=require(_0x333d('0xc'));var deskjs=require(_0x333d('0xd'));var toCsv=require(_0x333d('0x8'));var querystring=require(_0x333d('0xe'));var Papa=require('papaparse');var Redis=require(_0x333d('0xf'));var authService=require(_0x333d('0x10'));var qs=require(_0x333d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x333d('0x12'));var logger=require(_0x333d('0x13'))('api');var utils=require(_0x333d('0x14'));var config=require(_0x333d('0x15'));var db=require(_0x333d('0x16'))['db'];function respondWithStatusCode(_0x2c018a,_0x6bf16c){_0x6bf16c=_0x6bf16c||0xcc;return function(_0x3a56f3){if(_0x3a56f3){return _0x2c018a[_0x333d('0x17')](_0x6bf16c);}return _0x2c018a[_0x333d('0x18')](_0x6bf16c)['end']();};}function respondWithResult(_0x1ccf9e,_0x4d4306){_0x4d4306=_0x4d4306||0xc8;return function(_0x1b4dc7){if(_0x1b4dc7){return _0x1ccf9e[_0x333d('0x18')](_0x4d4306)[_0x333d('0x19')](_0x1b4dc7);}};}function respondWithFilteredResult(_0x515ee6,_0x10ab7e){return function(_0x1600d3){if(_0x1600d3){var _0x49a028=_0x1600d3[_0x333d('0x1a')],_0xafdfa2=_0x10ab7e[_0x333d('0x1b')],_0x2fe14e=_0x10ab7e[_0x333d('0x1b')]+_0x10ab7e[_0x333d('0x1c')],_0x46958f;if(_0x2fe14e>=_0x49a028){_0x2fe14e=_0x49a028;_0x46958f=0xc8;}else{_0x46958f=0xce;}_0x515ee6[_0x333d('0x18')](_0x46958f);return _0x515ee6[_0x333d('0x1d')](_0x333d('0x1e'),_0xafdfa2+'-'+_0x2fe14e+'/'+_0x49a028)[_0x333d('0x19')](_0x1600d3);}return null;};}function patchUpdates(_0x13cff9){return function(_0x357e23){try{jsonpatch[_0x333d('0x1f')](_0x357e23,_0x13cff9,!![]);}catch(_0x553dfe){return BPromise[_0x333d('0x20')](_0x553dfe);}return _0x357e23[_0x333d('0x21')]();};}function saveUpdates(_0x98d15f,_0xa6b0c6){return function(_0x28566a){if(_0x28566a){return _0x28566a[_0x333d('0x22')](_0x98d15f)[_0x333d('0x23')](function(_0x46b372){return _0x46b372;});}return null;};}function removeEntity(_0x551c14,_0x360d16){return function(_0x15b96a){if(_0x15b96a){return _0x15b96a[_0x333d('0x24')]()[_0x333d('0x23')](function(){_0x551c14['status'](0xcc)[_0x333d('0x25')]();});}};}function handleEntityNotFound(_0x236201,_0x1b739d){return function(_0x2a174f){if(!_0x2a174f){_0x236201[_0x333d('0x17')](0x194);}return _0x2a174f;};}function handleError(_0x10c3f3,_0x31c6ca){_0x31c6ca=_0x31c6ca||0x1f4;return function(_0x5b38e5){logger['error'](_0x5b38e5['stack']);if(_0x5b38e5['name']){delete _0x5b38e5[_0x333d('0x26')];}_0x10c3f3[_0x333d('0x18')](_0x31c6ca)[_0x333d('0x27')](_0x5b38e5);};}exports[_0x333d('0x28')]=function(_0x12f020,_0x4c8e60){var _0x1de6e0={},_0x568f90={},_0x461296={'count':0x0,'rows':[]};var _0x49314e=_[_0x333d('0x29')](db[_0x333d('0x2a')][_0x333d('0x2b')],function(_0x59bbcb){return{'name':_0x59bbcb[_0x333d('0x2c')],'type':_0x59bbcb['type']['key']};});_0x568f90[_0x333d('0x2d')]=_['map'](_0x49314e,_0x333d('0x26'));_0x568f90['query']=_[_0x333d('0x2e')](_0x12f020['query']);_0x568f90[_0x333d('0x2f')]=_[_0x333d('0x30')](_0x568f90['model'],_0x568f90['query']);_0x1de6e0[_0x333d('0x31')]=_['intersection'](_0x568f90[_0x333d('0x2d')],qs[_0x333d('0x32')](_0x12f020[_0x333d('0x33')]['fields']));_0x1de6e0[_0x333d('0x31')]=_0x1de6e0[_0x333d('0x31')][_0x333d('0x34')]?_0x1de6e0[_0x333d('0x31')]:_0x568f90[_0x333d('0x2d')];if(!_0x12f020['query']['hasOwnProperty']('nolimit')){_0x1de6e0[_0x333d('0x1c')]=qs[_0x333d('0x1c')](_0x12f020['query']['limit']);_0x1de6e0['offset']=qs[_0x333d('0x1b')](_0x12f020['query']['offset']);}_0x1de6e0[_0x333d('0x35')]=qs[_0x333d('0x36')](_0x12f020[_0x333d('0x33')][_0x333d('0x36')]);_0x1de6e0['where']=qs[_0x333d('0x2f')](_['pick'](_0x12f020[_0x333d('0x33')],_0x568f90[_0x333d('0x2f')]),_0x49314e);if(_0x12f020['query'][_0x333d('0x37')]){_0x1de6e0[_0x333d('0x38')]=_[_0x333d('0x39')](_0x1de6e0[_0x333d('0x38')],{'$or':_[_0x333d('0x29')](_0x49314e,function(_0x1f24fd){if(_0x1f24fd['type']!=='VIRTUAL'){var _0xde6894={};_0xde6894[_0x1f24fd[_0x333d('0x26')]]={'$like':'%'+_0x12f020['query'][_0x333d('0x37')]+'%'};return _0xde6894;}})});}_0x1de6e0=_[_0x333d('0x39')]({},_0x1de6e0,_0x12f020['options']);var _0x5b10a7={'where':_0x1de6e0[_0x333d('0x38')]};return db[_0x333d('0x2a')][_0x333d('0x1a')](_0x5b10a7)[_0x333d('0x23')](function(_0x330def){_0x461296[_0x333d('0x1a')]=_0x330def;if(_0x12f020[_0x333d('0x33')][_0x333d('0x3a')]){_0x1de6e0[_0x333d('0x3b')]=[{'attributes':['id',_0x333d('0x26'),_0x333d('0x3c'),_0x333d('0x3d')],'model':db[_0x333d('0x3e')],'as':'User'}];}return db['VoiceCallReport'][_0x333d('0x3f')](_0x1de6e0);})[_0x333d('0x23')](function(_0x2cada1){_0x461296['rows']=_0x2cada1;return _0x461296;})['then'](respondWithFilteredResult(_0x4c8e60,_0x1de6e0))[_0x333d('0x40')](handleError(_0x4c8e60,null));};exports[_0x333d('0x41')]=function(_0x2076f3,_0x2e8145){var _0x44a36d={'raw':!![],'where':{'id':_0x2076f3[_0x333d('0x42')]['id']}},_0x487110={};_0x487110[_0x333d('0x2d')]=_[_0x333d('0x2e')](db[_0x333d('0x2a')][_0x333d('0x2b')]);_0x487110[_0x333d('0x33')]=_[_0x333d('0x2e')](_0x2076f3['query']);_0x487110[_0x333d('0x2f')]=_[_0x333d('0x30')](_0x487110['model'],_0x487110[_0x333d('0x33')]);_0x44a36d[_0x333d('0x31')]=_[_0x333d('0x30')](_0x487110[_0x333d('0x2d')],qs[_0x333d('0x32')](_0x2076f3['query']['fields']));_0x44a36d[_0x333d('0x31')]=_0x44a36d[_0x333d('0x31')][_0x333d('0x34')]?_0x44a36d[_0x333d('0x31')]:_0x487110['model'];if(_0x2076f3[_0x333d('0x33')][_0x333d('0x3a')]){_0x44a36d[_0x333d('0x3b')]=[{'all':!![]}];}_0x44a36d=_[_0x333d('0x39')]({},_0x44a36d,_0x2076f3[_0x333d('0x43')]);return db[_0x333d('0x2a')][_0x333d('0x44')](_0x44a36d)[_0x333d('0x23')](handleEntityNotFound(_0x2e8145,null))['then'](respondWithResult(_0x2e8145,null))[_0x333d('0x40')](handleError(_0x2e8145,null));};exports[_0x333d('0x45')]=function(_0x47daec,_0x2aa346){return db['VoiceCallReport'][_0x333d('0x45')](_0x47daec[_0x333d('0x46')],{})[_0x333d('0x23')](respondWithResult(_0x2aa346,0xc9))['catch'](handleError(_0x2aa346,null));};exports[_0x333d('0x24')]=function(_0x3c41d4,_0x3e0813){return db[_0x333d('0x2a')][_0x333d('0x44')]({'where':{'id':_0x3c41d4[_0x333d('0x42')]['id']}})[_0x333d('0x23')](handleEntityNotFound(_0x3e0813,null))[_0x333d('0x23')](removeEntity(_0x3e0813,null))[_0x333d('0x40')](handleError(_0x3e0813,null));};exports['describe']=function(_0x1d5b22,_0x35ff24){return db[_0x333d('0x2a')][_0x333d('0x47')]()['then'](respondWithResult(_0x35ff24,null))[_0x333d('0x40')](handleError(_0x35ff24,null));};exports[_0x333d('0x22')]=function(_0x8b15da,_0x3405e7){if(_0x8b15da[_0x333d('0x46')][_0x333d('0x48')]){delete _0x8b15da[_0x333d('0x46')][_0x333d('0x48')];}return db['VoiceCallReport'][_0x333d('0x44')]({'where':{'uniqueid':_0x8b15da['params']['id'],'UserId':{'$or':[null,_0x8b15da[_0x333d('0x49')]['id']]}}})[_0x333d('0x23')](handleEntityNotFound(_0x3405e7,null))[_0x333d('0x23')](saveUpdates(_0x8b15da['body'],null))[_0x333d('0x23')](respondWithResult(_0x3405e7,null))[_0x333d('0x40')](handleError(_0x3405e7,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 2b6b99f..c66f491 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 _0x669c=['api','bluebird','request-promise','path','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','util','../../config/logger'];(function(_0x308a1d,_0x3d379d){var _0x5eb875=function(_0x464dbe){while(--_0x464dbe){_0x308a1d['push'](_0x308a1d['shift']());}};_0x5eb875(++_0x3d379d);}(_0x669c,0x153));var _0xc669=function(_0x5d5b4b,_0x5a810e){_0x5d5b4b=_0x5d5b4b-0x0;var _0x5707a5=_0x669c[_0x5d5b4b];return _0x5707a5;};'use strict';var _=require('lodash');var util=require(_0xc669('0x0'));var logger=require(_0xc669('0x1'))(_0xc669('0x2'));var moment=require('moment');var BPromise=require(_0xc669('0x3'));var rp=require(_0xc669('0x4'));var fs=require('fs');var path=require(_0xc669('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc669('0x6'));module[_0xc669('0x7')]=function(_0x49736d,_0x4780e4){return _0x49736d[_0xc669('0x8')](_0xc669('0x9'),attributes,{'tableName':_0xc669('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8475=['api','moment','bluebird','rimraf','./voiceCallReport.attributes','exports','report_call','uniqueid','util'];(function(_0x5a7860,_0x1c6534){var _0x1ed7e8=function(_0x19b076){while(--_0x19b076){_0x5a7860['push'](_0x5a7860['shift']());}};_0x1ed7e8(++_0x1c6534);}(_0x8475,0xf2));var _0x5847=function(_0x22f148,_0xcc55e0){_0x22f148=_0x22f148-0x0;var _0x5f33c2=_0x8475[_0x22f148];return _0x5f33c2;};'use strict';var _=require('lodash');var util=require(_0x5847('0x0'));var logger=require('../../config/logger')(_0x5847('0x1'));var moment=require(_0x5847('0x2'));var BPromise=require(_0x5847('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5847('0x4'));var config=require('../../config/environment');var attributes=require(_0x5847('0x5'));module[_0x5847('0x6')]=function(_0x5b15c8,_0x3a3233){return _0x5b15c8['define']('VoiceCallReport',attributes,{'tableName':_0x5847('0x7'),'paranoid':![],'indexes':[{'fields':[_0x5847('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 2bf80cf..f8c9623 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 _0xd873=['attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceCallReport','findAll','options','raw','where'];(function(_0x1b87b8,_0x359b39){var _0x57c35a=function(_0x5d5522){while(--_0x5d5522){_0x1b87b8['push'](_0x1b87b8['shift']());}};_0x57c35a(++_0x359b39);}(_0xd873,0xd9));var _0x3d87=function(_0x544ebc,_0x2900fe){_0x544ebc=_0x544ebc-0x0;var _0x5a3615=_0xd873[_0x544ebc];return _0x5a3615;};'use strict';var _=require(_0x3d87('0x0'));var util=require('util');var moment=require(_0x3d87('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d87('0x2'));var fs=require('fs');var Redis=require(_0x3d87('0x3'));var db=require(_0x3d87('0x4'))['db'];var utils=require(_0x3d87('0x5'));var logger=require(_0x3d87('0x6'))(_0x3d87('0x7'));var config=require(_0x3d87('0x8'));var jayson=require(_0x3d87('0x9'));var client=jayson[_0x3d87('0xa')][_0x3d87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3600dd,_0x18540b,_0x536e19){return new BPromise(function(_0x43aedc,_0x13d0b7){return client[_0x3d87('0xc')](_0x3600dd,_0x536e19)[_0x3d87('0xd')](function(_0x8ac17c){logger['info'](_0x3d87('0xe'),_0x18540b,_0x3d87('0xf'));logger['debug'](_0x3d87('0x10'),_0x18540b,_0x3d87('0xf'),JSON[_0x3d87('0x11')](_0x8ac17c));if(_0x8ac17c['error']){if(_0x8ac17c[_0x3d87('0x12')][_0x3d87('0x13')]===0x1f4){logger[_0x3d87('0x12')](_0x3d87('0xe'),_0x18540b,_0x8ac17c[_0x3d87('0x12')][_0x3d87('0x14')]);return _0x13d0b7(_0x8ac17c[_0x3d87('0x12')][_0x3d87('0x14')]);}logger[_0x3d87('0x12')](_0x3d87('0xe'),_0x18540b,_0x8ac17c['error'][_0x3d87('0x14')]);return _0x43aedc(_0x8ac17c['error']['message']);}else{logger[_0x3d87('0x15')](_0x3d87('0xe'),_0x18540b,_0x3d87('0xf'));_0x43aedc(_0x8ac17c[_0x3d87('0x16')]['message']);}})[_0x3d87('0x17')](function(_0x105345){logger[_0x3d87('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x18540b,_0x105345);_0x13d0b7(_0x105345);});});}exports['GetVoiceCallReport']=function(_0x176f9f){var _0x2e8780=this;return new Promise(function(_0x4c1246,_0x5b254c){return db[_0x3d87('0x18')][_0x3d87('0x19')]({'raw':_0x176f9f['options']?_0x176f9f[_0x3d87('0x1a')][_0x3d87('0x1b')]===undefined?!![]:![]:!![],'where':_0x176f9f[_0x3d87('0x1a')]?_0x176f9f[_0x3d87('0x1a')][_0x3d87('0x1c')]||null:null,'attributes':_0x176f9f['options']?_0x176f9f['options'][_0x3d87('0x1d')]||null:null,'limit':_0x176f9f[_0x3d87('0x1a')]?_0x176f9f[_0x3d87('0x1a')][_0x3d87('0x1e')]||null:null,'include':_0x176f9f[_0x3d87('0x1a')]?_0x176f9f[_0x3d87('0x1a')][_0x3d87('0x1f')]?_['map'](_0x176f9f[_0x3d87('0x1a')][_0x3d87('0x1f')],function(_0x4d050c){return{'model':db[_0x4d050c['model']],'as':_0x4d050c['as'],'attributes':_0x4d050c['attributes'],'include':_0x4d050c[_0x3d87('0x1f')]?_[_0x3d87('0x20')](_0x4d050c[_0x3d87('0x1f')],function(_0x372388){return{'model':db[_0x372388['model']],'as':_0x372388['as'],'attributes':_0x372388[_0x3d87('0x1d')],'include':_0x372388[_0x3d87('0x1f')]?_['map'](_0x372388[_0x3d87('0x1f')],function(_0xb6a6b6){return{'model':db[_0xb6a6b6[_0x3d87('0x21')]],'as':_0xb6a6b6['as'],'attributes':_0xb6a6b6['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d87('0xd')](function(_0x2d4e81){logger['info'](_0x3d87('0x22'),_0x176f9f);logger['debug'](_0x3d87('0x22'),_0x176f9f,JSON[_0x3d87('0x11')](_0x2d4e81));_0x4c1246(_0x2d4e81);})[_0x3d87('0x17')](function(_0x5db5c4){logger['error'](_0x3d87('0x22'),_0x5db5c4['message'],_0x176f9f);_0x5b254c(_0x2e8780[_0x3d87('0x12')](0x1f4,_0x5db5c4['message']));});});};exports[_0x3d87('0x23')]=function(_0x435ca2){var _0x3494cf=this;return new Promise(function(_0x3b5373,_0x52c367){return db[_0x3d87('0x18')][_0x3d87('0x24')](_0x435ca2['body'],{'raw':_0x435ca2[_0x3d87('0x1a')]?_0x435ca2[_0x3d87('0x1a')][_0x3d87('0x1b')]===undefined?!![]:![]:!![]})[_0x3d87('0xd')](function(_0x268527){logger['info']('CreateVoiceCallReport',_0x435ca2);logger['debug'](_0x3d87('0x23'),_0x435ca2,JSON[_0x3d87('0x11')](_0x268527));_0x3b5373(_0x268527);})[_0x3d87('0x17')](function(_0x361e07){logger[_0x3d87('0x12')]('CreateVoiceCallReport',_0x361e07[_0x3d87('0x14')],_0x435ca2);_0x52c367(_0x3494cf[_0x3d87('0x12')](0x1f4,_0x361e07[_0x3d87('0x14')]));});});};exports[_0x3d87('0x25')]=function(_0x540071){var _0x2796cf=this;return new Promise(function(_0x4dccca,_0x1f733f){return db[_0x3d87('0x18')][_0x3d87('0x26')](_0x540071[_0x3d87('0x27')],{'raw':_0x540071['options']?_0x540071[_0x3d87('0x1a')][_0x3d87('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540071[_0x3d87('0x1a')]?_0x540071[_0x3d87('0x1a')]['where']||null:null,'attributes':_0x540071['options']?_0x540071[_0x3d87('0x1a')][_0x3d87('0x1d')]||null:null,'limit':_0x540071[_0x3d87('0x1a')]?_0x540071[_0x3d87('0x1a')][_0x3d87('0x1e')]||null:null})[_0x3d87('0xd')](function(_0x1d7936){logger[_0x3d87('0x15')](_0x3d87('0x25'),_0x540071);logger[_0x3d87('0x28')](_0x3d87('0x25'),_0x540071,JSON[_0x3d87('0x11')](_0x1d7936));_0x4dccca(_0x1d7936);})[_0x3d87('0x17')](function(_0xf98f4e){logger[_0x3d87('0x12')](_0x3d87('0x25'),_0xf98f4e[_0x3d87('0x14')],_0x540071);_0x1f733f(_0x2796cf[_0x3d87('0x12')](0x1f4,_0xf98f4e[_0x3d87('0x14')]));});});}; \ No newline at end of file +var _0x87a4=['include','map','model','create','CreateVoiceCallReport','debug','update','body','limit','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x87a4,0x14a));var _0x487a=function(_0x4ed74d,_0x228c5f){_0x4ed74d=_0x4ed74d-0x0;var _0x127cea=_0x87a4[_0x4ed74d];return _0x127cea;};'use strict';var _=require(_0x487a('0x0'));var util=require(_0x487a('0x1'));var moment=require('moment');var BPromise=require(_0x487a('0x2'));var rs=require(_0x487a('0x3'));var fs=require('fs');var Redis=require(_0x487a('0x4'));var db=require(_0x487a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x487a('0x6'))(_0x487a('0x7'));var config=require(_0x487a('0x8'));var jayson=require(_0x487a('0x9'));var client=jayson[_0x487a('0xa')][_0x487a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc558b,_0x5d1916,_0x420403){return new BPromise(function(_0x2dbf7e,_0x2c089e){return client[_0x487a('0xc')](_0xc558b,_0x420403)[_0x487a('0xd')](function(_0x7612b1){logger[_0x487a('0xe')](_0x487a('0xf'),_0x5d1916,_0x487a('0x10'));logger['debug'](_0x487a('0x11'),_0x5d1916,_0x487a('0x10'),JSON[_0x487a('0x12')](_0x7612b1));if(_0x7612b1[_0x487a('0x13')]){if(_0x7612b1[_0x487a('0x13')][_0x487a('0x14')]===0x1f4){logger['error'](_0x487a('0xf'),_0x5d1916,_0x7612b1['error'][_0x487a('0x15')]);return _0x2c089e(_0x7612b1['error'][_0x487a('0x15')]);}logger[_0x487a('0x13')](_0x487a('0xf'),_0x5d1916,_0x7612b1['error'][_0x487a('0x15')]);return _0x2dbf7e(_0x7612b1[_0x487a('0x13')]['message']);}else{logger[_0x487a('0xe')](_0x487a('0xf'),_0x5d1916,_0x487a('0x10'));_0x2dbf7e(_0x7612b1['result']['message']);}})[_0x487a('0x16')](function(_0x3f8852){logger['error'](_0x487a('0xf'),_0x5d1916,_0x3f8852);_0x2c089e(_0x3f8852);});});}exports[_0x487a('0x17')]=function(_0x24295f){var _0x217052=this;return new Promise(function(_0xb4cc,_0x16e860){return db[_0x487a('0x18')][_0x487a('0x19')]({'raw':_0x24295f[_0x487a('0x1a')]?_0x24295f['options'][_0x487a('0x1b')]===undefined?!![]:![]:!![],'where':_0x24295f[_0x487a('0x1a')]?_0x24295f[_0x487a('0x1a')][_0x487a('0x1c')]||null:null,'attributes':_0x24295f[_0x487a('0x1a')]?_0x24295f[_0x487a('0x1a')][_0x487a('0x1d')]||null:null,'limit':_0x24295f[_0x487a('0x1a')]?_0x24295f['options']['limit']||null:null,'include':_0x24295f[_0x487a('0x1a')]?_0x24295f[_0x487a('0x1a')][_0x487a('0x1e')]?_[_0x487a('0x1f')](_0x24295f[_0x487a('0x1a')]['include'],function(_0x15932e){return{'model':db[_0x15932e[_0x487a('0x20')]],'as':_0x15932e['as'],'attributes':_0x15932e[_0x487a('0x1d')],'include':_0x15932e[_0x487a('0x1e')]?_['map'](_0x15932e[_0x487a('0x1e')],function(_0x146d99){return{'model':db[_0x146d99[_0x487a('0x20')]],'as':_0x146d99['as'],'attributes':_0x146d99[_0x487a('0x1d')],'include':_0x146d99[_0x487a('0x1e')]?_[_0x487a('0x1f')](_0x146d99[_0x487a('0x1e')],function(_0x52280e){return{'model':db[_0x52280e[_0x487a('0x20')]],'as':_0x52280e['as'],'attributes':_0x52280e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x37fcff){logger[_0x487a('0xe')]('GetVoiceCallReport',_0x24295f);logger['debug'](_0x487a('0x17'),_0x24295f,JSON[_0x487a('0x12')](_0x37fcff));_0xb4cc(_0x37fcff);})['catch'](function(_0x8b97c7){logger[_0x487a('0x13')]('GetVoiceCallReport',_0x8b97c7[_0x487a('0x15')],_0x24295f);_0x16e860(_0x217052[_0x487a('0x13')](0x1f4,_0x8b97c7[_0x487a('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x144ed3){var _0x5a5d60=this;return new Promise(function(_0x42857d,_0x2ec12a){return db[_0x487a('0x18')][_0x487a('0x21')](_0x144ed3['body'],{'raw':_0x144ed3[_0x487a('0x1a')]?_0x144ed3[_0x487a('0x1a')][_0x487a('0x1b')]===undefined?!![]:![]:!![]})[_0x487a('0xd')](function(_0x4b1887){logger[_0x487a('0xe')](_0x487a('0x22'),_0x144ed3);logger[_0x487a('0x23')](_0x487a('0x22'),_0x144ed3,JSON[_0x487a('0x12')](_0x4b1887));_0x42857d(_0x4b1887);})[_0x487a('0x16')](function(_0x363102){logger['error'](_0x487a('0x22'),_0x363102['message'],_0x144ed3);_0x2ec12a(_0x5a5d60[_0x487a('0x13')](0x1f4,_0x363102[_0x487a('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x6f4a61){var _0x164a20=this;return new Promise(function(_0x19f094,_0x5704fb){return db['VoiceCallReport'][_0x487a('0x24')](_0x6f4a61[_0x487a('0x25')],{'raw':_0x6f4a61[_0x487a('0x1a')]?_0x6f4a61[_0x487a('0x1a')][_0x487a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6f4a61[_0x487a('0x1a')]?_0x6f4a61['options'][_0x487a('0x1c')]||null:null,'attributes':_0x6f4a61['options']?_0x6f4a61[_0x487a('0x1a')]['attributes']||null:null,'limit':_0x6f4a61['options']?_0x6f4a61[_0x487a('0x1a')][_0x487a('0x26')]||null:null})['then'](function(_0x1328bc){logger['info'](_0x487a('0x27'),_0x6f4a61);logger['debug'](_0x487a('0x27'),_0x6f4a61,JSON['stringify'](_0x1328bc));_0x19f094(_0x1328bc);})[_0x487a('0x16')](function(_0x27d8cc){logger[_0x487a('0x13')](_0x487a('0x27'),_0x27d8cc[_0x487a('0x15')],_0x6f4a61);_0x5704fb(_0x164a20['error'](0x1f4,_0x27d8cc['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index c1328f8..1337b33 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 _0xfeef=['show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xfeef,0x10b));var _0xffee=function(_0x4595ac,_0x4a6c83){_0x4595ac=_0x4595ac-0x0;var _0x13c73c=_0xfeef[_0x4595ac];return _0x13c73c;};'use strict';var multer=require(_0xffee('0x0'));var util=require('util');var path=require(_0xffee('0x1'));var timeout=require(_0xffee('0x2'));var express=require(_0xffee('0x3'));var router=express[_0xffee('0x4')]();var auth=require(_0xffee('0x5'));var interaction=require(_0xffee('0x6'));var config=require(_0xffee('0x7'));var controller=require(_0xffee('0x8'));router[_0xffee('0x9')]('/',auth[_0xffee('0xa')](),controller[_0xffee('0xb')]);router['get'](_0xffee('0xc'),auth[_0xffee('0xa')](),controller[_0xffee('0xd')]);router[_0xffee('0xe')]('/',auth['isAuthenticated'](),controller[_0xffee('0xf')]);router[_0xffee('0x10')](_0xffee('0xc'),auth['isAuthenticated'](),controller[_0xffee('0x11')]);router[_0xffee('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xffee('0x13')]=router; \ No newline at end of file +var _0x1290=['create','put','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x1290,0x136));var _0x0129=function(_0x54eeb8,_0x1d903c){_0x54eeb8=_0x54eeb8-0x0;var _0x43476e=_0x1290[_0x54eeb8];return _0x43476e;};'use strict';var multer=require(_0x0129('0x0'));var util=require(_0x0129('0x1'));var path=require('path');var timeout=require(_0x0129('0x2'));var express=require('express');var router=express[_0x0129('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0129('0x4'));var config=require(_0x0129('0x5'));var controller=require(_0x0129('0x6'));router[_0x0129('0x7')]('/',auth[_0x0129('0x8')](),controller[_0x0129('0x9')]);router[_0x0129('0x7')](_0x0129('0xa'),auth[_0x0129('0x8')](),controller[_0x0129('0xb')]);router[_0x0129('0xc')]('/',auth['isAuthenticated'](),controller[_0x0129('0xd')]);router[_0x0129('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0129('0xf')](_0x0129('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0129('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index cb96d1c..426955d 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 _0x62cd=['options','join','getDataValue','split','BOOLEAN','exports','name','STRING','setDataValue'];(function(_0x17a718,_0x1a65cc){var _0xb19710=function(_0x478a88){while(--_0x478a88){_0x17a718['push'](_0x17a718['shift']());}};_0xb19710(++_0x1a65cc);}(_0x62cd,0x95));var _0xd62c=function(_0x1e3be4,_0x98455f){_0x1e3be4=_0x1e3be4-0x0;var _0x3e5c87=_0x62cd[_0x1e3be4];return _0x3e5c87;};'use strict';var Sequelize=require('sequelize');module[_0xd62c('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xd62c('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xd62c('0x2')],'set':function(_0x1a6bd8){this[_0xd62c('0x3')](_0xd62c('0x4'),_0x1a6bd8?_0x1a6bd8[_0xd62c('0x5')](''):[]);},'get':function(){return this[_0xd62c('0x6')](_0xd62c('0x4'))?this[_0xd62c('0x6')](_0xd62c('0x4'))[_0xd62c('0x7')](''):[];}},'auth':{'type':Sequelize[_0xd62c('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xd62c('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xd62c('0x2')]},'description':{'type':Sequelize[_0xd62c('0x2')]}}; \ No newline at end of file +var _0x4801=['split','sequelize','exports','STRING','setDataValue','join','getDataValue'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x4801,0xbe));var _0x1480=function(_0x5b4972,_0x464200){_0x5b4972=_0x5b4972-0x0;var _0x6df520=_0x4801[_0x5b4972];return _0x6df520;};'use strict';var Sequelize=require(_0x1480('0x0'));module[_0x1480('0x1')]={'name':{'type':Sequelize[_0x1480('0x2')]},'prefix':{'type':Sequelize[_0x1480('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1480('0x2')],'set':function(_0x2b8fe5){this[_0x1480('0x3')]('options',_0x2b8fe5?_0x2b8fe5[_0x1480('0x4')](''):[]);},'get':function(){return this[_0x1480('0x5')]('options')?this[_0x1480('0x5')]('options')[_0x1480('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1480('0x2')]},'description':{'type':Sequelize[_0x1480('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e2b171d..a75eb27 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 _0x17be=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','index','map','VoiceChanSpy','type','key','model','name','query','keys','filters','intersection','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x57d9a6,_0x2120ec){var _0x2ad98f=function(_0x18684c){while(--_0x18684c){_0x57d9a6['push'](_0x57d9a6['shift']());}};_0x2ad98f(++_0x2120ec);}(_0x17be,0xa5));var _0xe17b=function(_0x52ae62,_0x3dbdff){_0x52ae62=_0x52ae62-0x0;var _0x28f3f8=_0x17be[_0x52ae62];return _0x28f3f8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe17b('0x0'));var zipdir=require(_0xe17b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe17b('0x2'));var BPromise=require(_0xe17b('0x3'));var Mustache=require(_0xe17b('0x4'));var util=require(_0xe17b('0x5'));var path=require('path');var sox=require(_0xe17b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe17b('0x7'));var crypto=require(_0xe17b('0x8'));var jsforce=require(_0xe17b('0x9'));var deskjs=require(_0xe17b('0xa'));var toCsv=require(_0xe17b('0xb'));var querystring=require(_0xe17b('0xc'));var Papa=require(_0xe17b('0xd'));var Redis=require(_0xe17b('0xe'));var authService=require(_0xe17b('0xf'));var qs=require(_0xe17b('0x10'));var as=require(_0xe17b('0x11'));var hardwareService=require(_0xe17b('0x12'));var logger=require(_0xe17b('0x13'))('api');var utils=require(_0xe17b('0x14'));var config=require('../../config/environment');var db=require(_0xe17b('0x15'))['db'];function respondWithStatusCode(_0x354224,_0x448390){_0x448390=_0x448390||0xcc;return function(_0xcf9ff6){if(_0xcf9ff6){return _0x354224[_0xe17b('0x16')](_0x448390);}return _0x354224[_0xe17b('0x17')](_0x448390)[_0xe17b('0x18')]();};}function respondWithResult(_0x2083a9,_0x4b3972){_0x4b3972=_0x4b3972||0xc8;return function(_0x43f0e7){if(_0x43f0e7){return _0x2083a9[_0xe17b('0x17')](_0x4b3972)[_0xe17b('0x19')](_0x43f0e7);}};}function respondWithFilteredResult(_0x1c3db8,_0x1ca5c0){return function(_0x33bee4){if(_0x33bee4){var _0x3fe026=_0x33bee4[_0xe17b('0x1a')],_0x59fc41=_0x1ca5c0[_0xe17b('0x1b')],_0x116d92=_0x1ca5c0[_0xe17b('0x1b')]+_0x1ca5c0[_0xe17b('0x1c')],_0x565cc7;if(_0x116d92>=_0x3fe026){_0x116d92=_0x3fe026;_0x565cc7=0xc8;}else{_0x565cc7=0xce;}_0x1c3db8['status'](_0x565cc7);return _0x1c3db8[_0xe17b('0x1d')](_0xe17b('0x1e'),_0x59fc41+'-'+_0x116d92+'/'+_0x3fe026)[_0xe17b('0x19')](_0x33bee4);}return null;};}function patchUpdates(_0x130367){return function(_0x202be9){try{jsonpatch[_0xe17b('0x1f')](_0x202be9,_0x130367,!![]);}catch(_0x1c8fac){return BPromise[_0xe17b('0x20')](_0x1c8fac);}return _0x202be9[_0xe17b('0x21')]();};}function saveUpdates(_0x4f8dea,_0x20f692){return function(_0x457390){if(_0x457390){return _0x457390[_0xe17b('0x22')](_0x4f8dea)[_0xe17b('0x23')](function(_0x10133d){return _0x10133d;});}return null;};}function removeEntity(_0x4a540f,_0x59682b){return function(_0x19435e){if(_0x19435e){return _0x19435e[_0xe17b('0x24')]()['then'](function(){var _0x18bae1=_0x19435e['get']({'plain':!![]});var _0x4890e0=_0xe17b('0x25');return db[_0xe17b('0x26')][_0xe17b('0x24')]({'where':{'type':_0x4890e0,'resourceId':_0x18bae1['id']}})[_0xe17b('0x23')](function(){return _0x19435e;});})[_0xe17b('0x23')](function(){_0x4a540f[_0xe17b('0x17')](0xcc)[_0xe17b('0x18')]();});}};}function handleEntityNotFound(_0x490e3b,_0x279a20){return function(_0x2d5a85){if(!_0x2d5a85){_0x490e3b['sendStatus'](0x194);}return _0x2d5a85;};}function handleError(_0x3bf925,_0x4030bb){_0x4030bb=_0x4030bb||0x1f4;return function(_0x10c7ee){logger[_0xe17b('0x27')](_0x10c7ee['stack']);if(_0x10c7ee['name']){delete _0x10c7ee['name'];}_0x3bf925[_0xe17b('0x17')](_0x4030bb)['send'](_0x10c7ee);};}exports[_0xe17b('0x28')]=function(_0x328370,_0x19f416){var _0x48cb9c={},_0x24188a={},_0x257dad={'count':0x0,'rows':[]};var _0x337900=_[_0xe17b('0x29')](db[_0xe17b('0x2a')]['rawAttributes'],function(_0x45c1b9){return{'name':_0x45c1b9['fieldName'],'type':_0x45c1b9[_0xe17b('0x2b')][_0xe17b('0x2c')]};});_0x24188a[_0xe17b('0x2d')]=_[_0xe17b('0x29')](_0x337900,_0xe17b('0x2e'));_0x24188a[_0xe17b('0x2f')]=_[_0xe17b('0x30')](_0x328370[_0xe17b('0x2f')]);_0x24188a[_0xe17b('0x31')]=_[_0xe17b('0x32')](_0x24188a[_0xe17b('0x2d')],_0x24188a[_0xe17b('0x2f')]);_0x48cb9c[_0xe17b('0x33')]=_['intersection'](_0x24188a[_0xe17b('0x2d')],qs['fields'](_0x328370[_0xe17b('0x2f')]['fields']));_0x48cb9c[_0xe17b('0x33')]=_0x48cb9c['attributes']['length']?_0x48cb9c[_0xe17b('0x33')]:_0x24188a['model'];if(!_0x328370[_0xe17b('0x2f')]['hasOwnProperty']('nolimit')){_0x48cb9c[_0xe17b('0x1c')]=qs['limit'](_0x328370[_0xe17b('0x2f')][_0xe17b('0x1c')]);_0x48cb9c['offset']=qs[_0xe17b('0x1b')](_0x328370[_0xe17b('0x2f')][_0xe17b('0x1b')]);}_0x48cb9c[_0xe17b('0x34')]=qs[_0xe17b('0x35')](_0x328370[_0xe17b('0x2f')][_0xe17b('0x35')]);_0x48cb9c[_0xe17b('0x36')]=qs[_0xe17b('0x31')](_[_0xe17b('0x37')](_0x328370[_0xe17b('0x2f')],_0x24188a[_0xe17b('0x31')]),_0x337900);if(_0x328370[_0xe17b('0x2f')]['filter']){_0x48cb9c['where']=_[_0xe17b('0x38')](_0x48cb9c['where'],{'$or':_[_0xe17b('0x29')](_0x337900,function(_0xd96295){if(_0xd96295[_0xe17b('0x2b')]!==_0xe17b('0x39')){var _0x54aa55={};_0x54aa55[_0xd96295[_0xe17b('0x2e')]]={'$like':'%'+_0x328370[_0xe17b('0x2f')][_0xe17b('0x3a')]+'%'};return _0x54aa55;}})});}_0x48cb9c=_['merge']({},_0x48cb9c,_0x328370[_0xe17b('0x3b')]);var _0xacd2f6={'where':_0x48cb9c[_0xe17b('0x36')]};return db['VoiceChanSpy'][_0xe17b('0x1a')](_0xacd2f6)[_0xe17b('0x23')](function(_0x460885){_0x257dad['count']=_0x460885;if(_0x328370[_0xe17b('0x2f')][_0xe17b('0x3c')]){_0x48cb9c[_0xe17b('0x3d')]=[{'all':!![]}];}return db[_0xe17b('0x2a')][_0xe17b('0x3e')](_0x48cb9c);})['then'](function(_0x5eaadb){_0x257dad[_0xe17b('0x3f')]=_0x5eaadb;return _0x257dad;})[_0xe17b('0x23')](respondWithFilteredResult(_0x19f416,_0x48cb9c))[_0xe17b('0x40')](handleError(_0x19f416,null));};exports[_0xe17b('0x41')]=function(_0xa1ae98,_0x26bcd3){var _0xe5bb8f={'raw':![],'where':{'id':_0xa1ae98[_0xe17b('0x42')]['id']}},_0x569020={};_0x569020[_0xe17b('0x2d')]=_[_0xe17b('0x30')](db[_0xe17b('0x2a')][_0xe17b('0x43')]);_0x569020[_0xe17b('0x2f')]=_[_0xe17b('0x30')](_0xa1ae98[_0xe17b('0x2f')]);_0x569020[_0xe17b('0x31')]=_[_0xe17b('0x32')](_0x569020[_0xe17b('0x2d')],_0x569020['query']);_0xe5bb8f[_0xe17b('0x33')]=_['intersection'](_0x569020[_0xe17b('0x2d')],qs['fields'](_0xa1ae98[_0xe17b('0x2f')][_0xe17b('0x44')]));_0xe5bb8f[_0xe17b('0x33')]=_0xe5bb8f[_0xe17b('0x33')][_0xe17b('0x45')]?_0xe5bb8f[_0xe17b('0x33')]:_0x569020['model'];if(_0xa1ae98[_0xe17b('0x2f')]['includeAll']){_0xe5bb8f[_0xe17b('0x3d')]=[{'all':!![]}];}_0xe5bb8f=_[_0xe17b('0x38')]({},_0xe5bb8f,_0xa1ae98[_0xe17b('0x3b')]);return db[_0xe17b('0x2a')][_0xe17b('0x46')](_0xe5bb8f)['then'](handleEntityNotFound(_0x26bcd3,null))[_0xe17b('0x23')](respondWithResult(_0x26bcd3,null))[_0xe17b('0x40')](handleError(_0x26bcd3,null));};exports[_0xe17b('0x47')]=function(_0x350c98,_0x5cbb08){return db['VoiceChanSpy']['create'](_0x350c98['body'],{})['then'](function(_0x454953){var _0x2ac144=_0x350c98[_0xe17b('0x48')][_0xe17b('0x49')]({'plain':!![]});if(!_0x2ac144)throw new Error(_0xe17b('0x4a'));if(_0x2ac144[_0xe17b('0x4b')]===_0xe17b('0x48')){var _0xabee00=_0x454953[_0xe17b('0x49')]({'plain':!![]});var _0x182212=_0xe17b('0x25');return db[_0xe17b('0x4c')]['find']({'where':{'name':_0x182212,'userProfileId':_0x2ac144[_0xe17b('0x4d')]},'raw':!![]})[_0xe17b('0x23')](function(_0x516a8f){if(_0x516a8f&&_0x516a8f[_0xe17b('0x4e')]===0x0){return db[_0xe17b('0x26')][_0xe17b('0x47')]({'name':_0xabee00['name'],'resourceId':_0xabee00['id'],'type':_0x516a8f[_0xe17b('0x2e')],'sectionId':_0x516a8f['id']},{})['then'](function(){return _0x454953;});}else{return _0x454953;}})[_0xe17b('0x40')](function(_0x4be481){logger[_0xe17b('0x27')](_0xe17b('0x4f'),_0x4be481);throw _0x4be481;});}return _0x454953;})['then'](respondWithResult(_0x5cbb08,0xc9))['catch'](handleError(_0x5cbb08,null));};exports[_0xe17b('0x22')]=function(_0x5bbdcd,_0x3d56ac){if(_0x5bbdcd[_0xe17b('0x50')]['id']){delete _0x5bbdcd[_0xe17b('0x50')]['id'];}return db[_0xe17b('0x2a')]['find']({'where':{'id':_0x5bbdcd['params']['id']}})[_0xe17b('0x23')](handleEntityNotFound(_0x3d56ac,null))['then'](saveUpdates(_0x5bbdcd[_0xe17b('0x50')],null))[_0xe17b('0x23')](respondWithResult(_0x3d56ac,null))[_0xe17b('0x40')](handleError(_0x3d56ac,null));};exports[_0xe17b('0x24')]=function(_0x2118d5,_0x4a0e56){return db[_0xe17b('0x2a')][_0xe17b('0x46')]({'where':{'id':_0x2118d5[_0xe17b('0x42')]['id']}})[_0xe17b('0x23')](handleEntityNotFound(_0x4a0e56,null))['then'](removeEntity(_0x4a0e56,null))[_0xe17b('0x40')](handleError(_0x4a0e56,null));}; \ No newline at end of file +var _0xd79b=['path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','options','count','includeAll','include','findAll','catch','show','params','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x31f73a,_0x2ea7bf){var _0x3674c2=function(_0x1d978c){while(--_0x1d978c){_0x31f73a['push'](_0x31f73a['shift']());}};_0x3674c2(++_0x2ea7bf);}(_0xd79b,0x1cc));var _0xbd79=function(_0x1f0534,_0x51895d){_0x1f0534=_0x1f0534-0x0;var _0x1186db=_0xd79b[_0x1f0534];return _0x1186db;};'use strict';var pdf=require(_0xbd79('0x0'));var emlformat=require(_0xbd79('0x1'));var rimraf=require(_0xbd79('0x2'));var zipdir=require(_0xbd79('0x3'));var jsonpatch=require(_0xbd79('0x4'));var rp=require('request-promise');var moment=require(_0xbd79('0x5'));var BPromise=require(_0xbd79('0x6'));var Mustache=require('mustache');var util=require(_0xbd79('0x7'));var path=require(_0xbd79('0x8'));var sox=require(_0xbd79('0x9'));var csv=require('to-csv');var ejs=require(_0xbd79('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd79('0xb'));var crypto=require(_0xbd79('0xc'));var jsforce=require(_0xbd79('0xd'));var deskjs=require(_0xbd79('0xe'));var toCsv=require(_0xbd79('0xf'));var querystring=require(_0xbd79('0x10'));var Papa=require(_0xbd79('0x11'));var Redis=require(_0xbd79('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbd79('0x13'));var hardwareService=require(_0xbd79('0x14'));var logger=require('../../config/logger')(_0xbd79('0x15'));var utils=require(_0xbd79('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4e23,_0x455ce7){_0x455ce7=_0x455ce7||0xcc;return function(_0x2c6200){if(_0x2c6200){return _0x1e4e23[_0xbd79('0x17')](_0x455ce7);}return _0x1e4e23['status'](_0x455ce7)[_0xbd79('0x18')]();};}function respondWithResult(_0x3d2982,_0x16294f){_0x16294f=_0x16294f||0xc8;return function(_0x98dee6){if(_0x98dee6){return _0x3d2982[_0xbd79('0x19')](_0x16294f)['json'](_0x98dee6);}};}function respondWithFilteredResult(_0xa4336d,_0x56fad8){return function(_0x2836bf){if(_0x2836bf){var _0x11a457=_0x2836bf['count'],_0x315422=_0x56fad8[_0xbd79('0x1a')],_0x410a96=_0x56fad8[_0xbd79('0x1a')]+_0x56fad8[_0xbd79('0x1b')],_0x3575ec;if(_0x410a96>=_0x11a457){_0x410a96=_0x11a457;_0x3575ec=0xc8;}else{_0x3575ec=0xce;}_0xa4336d['status'](_0x3575ec);return _0xa4336d['set'](_0xbd79('0x1c'),_0x315422+'-'+_0x410a96+'/'+_0x11a457)[_0xbd79('0x1d')](_0x2836bf);}return null;};}function patchUpdates(_0xa6f487){return function(_0x18bb8c){try{jsonpatch[_0xbd79('0x1e')](_0x18bb8c,_0xa6f487,!![]);}catch(_0x338d4b){return BPromise[_0xbd79('0x1f')](_0x338d4b);}return _0x18bb8c[_0xbd79('0x20')]();};}function saveUpdates(_0x25f328,_0x5ac6c8){return function(_0xd1b664){if(_0xd1b664){return _0xd1b664[_0xbd79('0x21')](_0x25f328)[_0xbd79('0x22')](function(_0x2e7581){return _0x2e7581;});}return null;};}function removeEntity(_0x491348,_0x11bb69){return function(_0x1a7e1f){if(_0x1a7e1f){return _0x1a7e1f[_0xbd79('0x23')]()[_0xbd79('0x22')](function(){var _0x4ca086=_0x1a7e1f['get']({'plain':!![]});var _0x11efcb=_0xbd79('0x24');return db[_0xbd79('0x25')]['destroy']({'where':{'type':_0x11efcb,'resourceId':_0x4ca086['id']}})[_0xbd79('0x22')](function(){return _0x1a7e1f;});})['then'](function(){_0x491348[_0xbd79('0x19')](0xcc)[_0xbd79('0x18')]();});}};}function handleEntityNotFound(_0x5ac401,_0x1b5020){return function(_0x18671f){if(!_0x18671f){_0x5ac401[_0xbd79('0x17')](0x194);}return _0x18671f;};}function handleError(_0x295185,_0x93c27a){_0x93c27a=_0x93c27a||0x1f4;return function(_0x3612f0){logger[_0xbd79('0x26')](_0x3612f0[_0xbd79('0x27')]);if(_0x3612f0[_0xbd79('0x28')]){delete _0x3612f0[_0xbd79('0x28')];}_0x295185['status'](_0x93c27a)[_0xbd79('0x29')](_0x3612f0);};}exports['index']=function(_0x246ca4,_0x39f3f0){var _0x28a297={},_0x472d1b={},_0x361659={'count':0x0,'rows':[]};var _0x1189a6=_[_0xbd79('0x2a')](db[_0xbd79('0x2b')][_0xbd79('0x2c')],function(_0x32ecc8){return{'name':_0x32ecc8[_0xbd79('0x2d')],'type':_0x32ecc8[_0xbd79('0x2e')]['key']};});_0x472d1b[_0xbd79('0x2f')]=_[_0xbd79('0x2a')](_0x1189a6,_0xbd79('0x28'));_0x472d1b[_0xbd79('0x30')]=_[_0xbd79('0x31')](_0x246ca4[_0xbd79('0x30')]);_0x472d1b['filters']=_[_0xbd79('0x32')](_0x472d1b[_0xbd79('0x2f')],_0x472d1b[_0xbd79('0x30')]);_0x28a297[_0xbd79('0x33')]=_['intersection'](_0x472d1b[_0xbd79('0x2f')],qs['fields'](_0x246ca4['query'][_0xbd79('0x34')]));_0x28a297[_0xbd79('0x33')]=_0x28a297[_0xbd79('0x33')][_0xbd79('0x35')]?_0x28a297['attributes']:_0x472d1b['model'];if(!_0x246ca4['query'][_0xbd79('0x36')]('nolimit')){_0x28a297[_0xbd79('0x1b')]=qs[_0xbd79('0x1b')](_0x246ca4[_0xbd79('0x30')][_0xbd79('0x1b')]);_0x28a297[_0xbd79('0x1a')]=qs['offset'](_0x246ca4[_0xbd79('0x30')]['offset']);}_0x28a297[_0xbd79('0x37')]=qs[_0xbd79('0x38')](_0x246ca4[_0xbd79('0x30')][_0xbd79('0x38')]);_0x28a297[_0xbd79('0x39')]=qs[_0xbd79('0x3a')](_[_0xbd79('0x3b')](_0x246ca4[_0xbd79('0x30')],_0x472d1b[_0xbd79('0x3a')]),_0x1189a6);if(_0x246ca4[_0xbd79('0x30')]['filter']){_0x28a297[_0xbd79('0x39')]=_['merge'](_0x28a297[_0xbd79('0x39')],{'$or':_[_0xbd79('0x2a')](_0x1189a6,function(_0x54074c){if(_0x54074c['type']!=='VIRTUAL'){var _0x6989c4={};_0x6989c4[_0x54074c[_0xbd79('0x28')]]={'$like':'%'+_0x246ca4[_0xbd79('0x30')]['filter']+'%'};return _0x6989c4;}})});}_0x28a297=_[_0xbd79('0x3c')]({},_0x28a297,_0x246ca4[_0xbd79('0x3d')]);var _0x212d6f={'where':_0x28a297['where']};return db[_0xbd79('0x2b')][_0xbd79('0x3e')](_0x212d6f)['then'](function(_0x1b27a8){_0x361659[_0xbd79('0x3e')]=_0x1b27a8;if(_0x246ca4[_0xbd79('0x30')][_0xbd79('0x3f')]){_0x28a297[_0xbd79('0x40')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xbd79('0x41')](_0x28a297);})[_0xbd79('0x22')](function(_0x464579){_0x361659['rows']=_0x464579;return _0x361659;})[_0xbd79('0x22')](respondWithFilteredResult(_0x39f3f0,_0x28a297))[_0xbd79('0x42')](handleError(_0x39f3f0,null));};exports[_0xbd79('0x43')]=function(_0x480740,_0x343804){var _0x173d49={'raw':![],'where':{'id':_0x480740[_0xbd79('0x44')]['id']}},_0x550532={};_0x550532[_0xbd79('0x2f')]=_[_0xbd79('0x31')](db['VoiceChanSpy'][_0xbd79('0x2c')]);_0x550532[_0xbd79('0x30')]=_['keys'](_0x480740['query']);_0x550532[_0xbd79('0x3a')]=_[_0xbd79('0x32')](_0x550532[_0xbd79('0x2f')],_0x550532[_0xbd79('0x30')]);_0x173d49[_0xbd79('0x33')]=_[_0xbd79('0x32')](_0x550532[_0xbd79('0x2f')],qs['fields'](_0x480740[_0xbd79('0x30')]['fields']));_0x173d49[_0xbd79('0x33')]=_0x173d49['attributes'][_0xbd79('0x35')]?_0x173d49[_0xbd79('0x33')]:_0x550532[_0xbd79('0x2f')];if(_0x480740[_0xbd79('0x30')][_0xbd79('0x3f')]){_0x173d49[_0xbd79('0x40')]=[{'all':!![]}];}_0x173d49=_[_0xbd79('0x3c')]({},_0x173d49,_0x480740[_0xbd79('0x3d')]);return db[_0xbd79('0x2b')]['find'](_0x173d49)['then'](handleEntityNotFound(_0x343804,null))[_0xbd79('0x22')](respondWithResult(_0x343804,null))[_0xbd79('0x42')](handleError(_0x343804,null));};exports[_0xbd79('0x45')]=function(_0x4420ee,_0x4dfba5){return db[_0xbd79('0x2b')][_0xbd79('0x45')](_0x4420ee[_0xbd79('0x46')],{})[_0xbd79('0x22')](function(_0x18595f){var _0x433215=_0x4420ee[_0xbd79('0x47')][_0xbd79('0x48')]({'plain':!![]});if(!_0x433215)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x433215[_0xbd79('0x49')]===_0xbd79('0x47')){var _0x3b50a=_0x18595f[_0xbd79('0x48')]({'plain':!![]});var _0x3390e2=_0xbd79('0x24');return db[_0xbd79('0x4a')]['find']({'where':{'name':_0x3390e2,'userProfileId':_0x433215[_0xbd79('0x4b')]},'raw':!![]})[_0xbd79('0x22')](function(_0x1921e3){if(_0x1921e3&&_0x1921e3[_0xbd79('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3b50a[_0xbd79('0x28')],'resourceId':_0x3b50a['id'],'type':_0x1921e3['name'],'sectionId':_0x1921e3['id']},{})[_0xbd79('0x22')](function(){return _0x18595f;});}else{return _0x18595f;}})[_0xbd79('0x42')](function(_0x1412ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1412ad);throw _0x1412ad;});}return _0x18595f;})[_0xbd79('0x22')](respondWithResult(_0x4dfba5,0xc9))[_0xbd79('0x42')](handleError(_0x4dfba5,null));};exports[_0xbd79('0x21')]=function(_0x922884,_0x35787b){if(_0x922884[_0xbd79('0x46')]['id']){delete _0x922884[_0xbd79('0x46')]['id'];}return db['VoiceChanSpy'][_0xbd79('0x4d')]({'where':{'id':_0x922884['params']['id']}})[_0xbd79('0x22')](handleEntityNotFound(_0x35787b,null))[_0xbd79('0x22')](saveUpdates(_0x922884[_0xbd79('0x46')],null))[_0xbd79('0x22')](respondWithResult(_0x35787b,null))[_0xbd79('0x42')](handleError(_0x35787b,null));};exports[_0xbd79('0x23')]=function(_0x4aac08,_0x43164b){return db[_0xbd79('0x2b')][_0xbd79('0x4d')]({'where':{'id':_0x4aac08[_0xbd79('0x44')]['id']}})[_0xbd79('0x22')](handleEntityNotFound(_0x43164b,null))[_0xbd79('0x22')](removeEntity(_0x43164b,null))[_0xbd79('0x42')](handleError(_0x43164b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 99e9716..b117458 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 _0x2a4b=['VoiceExtension','destroy','util','./voiceChanSpy.attributes','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate'];(function(_0xc7c7aa,_0x2b5b02){var _0x499731=function(_0xbccca5){while(--_0xbccca5){_0xc7c7aa['push'](_0xc7c7aa['shift']());}};_0x499731(++_0x2b5b02);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x4ff1e3,_0x52cf02){_0x4ff1e3=_0x4ff1e3-0x0;var _0x43deba=_0x2a4b[_0x4ff1e3];return _0x43deba;};'use strict';var _=require('lodash');var util=require(_0xb2a4('0x0'));var BPromise=require('bluebird');var attributes=require(_0xb2a4('0x1'));var getUserApplications=function(_0x186b93,_0x477f1c,_0x23414c){var _0x3b976e=0x1;var _0x139e1f=[];var _0x50b6a7={'context':_0x477f1c['context']||'from-sip','exten':util[_0xb2a4('0x2')](_0xb2a4('0x3'),_0x186b93[_0xb2a4('0x4')],_0x23414c),'type':_0xb2a4('0x5'),'isApp':![],'ChanSpyId':_0x186b93['id'],'UserId':_0x477f1c['id']};_0x139e1f[_0xb2a4('0x6')](_[_0xb2a4('0x7')]({'app':'Set','appdata':util[_0xb2a4('0x2')](_0xb2a4('0x8'),_0xb2a4('0x9')),'priority':_0x3b976e++},_0x50b6a7));if(_0x186b93[_0xb2a4('0xa')]){_0x139e1f[_0xb2a4('0x6')](_[_0xb2a4('0x7')]({'app':'MixMonitor','appdata':util[_0xb2a4('0x2')](_0xb2a4('0xb'),_0x186b93[_0xb2a4('0xc')]),'priority':_0x3b976e++},_0x50b6a7));}if(_0x186b93[_0xb2a4('0xd')]){_0x139e1f[_0xb2a4('0x6')](_['merge']({'app':_0xb2a4('0xe'),'appdata':_0x186b93[_0xb2a4('0xf')],'priority':_0x3b976e++},_0x50b6a7));}_0x139e1f[_0xb2a4('0x6')](_[_0xb2a4('0x7')]({'app':_0xb2a4('0x10'),'appdata':util[_0xb2a4('0x2')](_0xb2a4('0x11'),_0x477f1c[_0xb2a4('0x12')],_0x186b93[_0xb2a4('0x13')]?_0x186b93[_0xb2a4('0x13')][_0xb2a4('0x14')](''):''),'priority':_0x3b976e++},_0x50b6a7));if(_0x186b93[_0xb2a4('0xa')]){_0x139e1f[_0xb2a4('0x6')](_['merge']({'app':_0xb2a4('0x15'),'priority':_0x3b976e++},_0x50b6a7));}return _0x139e1f;};var getChanSpyApplications=function(_0x1045f8,_0x2d51f8){var _0x33ff61=[];for(var _0xc2d810=0x0,_0x59c8b3=0x1;_0xc2d810<_0x2d51f8[_0xb2a4('0x16')];_0xc2d810++,_0x59c8b3=0x1){_0x33ff61=_0x33ff61['concat'](getUserApplications(_0x1045f8,_0x2d51f8[_0xc2d810],_0x2d51f8[_0xc2d810][_0xb2a4('0x17')]));if(_0x2d51f8[_0xc2d810][_0xb2a4('0x17')]!=_0x2d51f8[_0xc2d810][_0xb2a4('0x12')]){_0x33ff61=_0x33ff61[_0xb2a4('0x18')](getUserApplications(_0x1045f8,_0x2d51f8[_0xc2d810],_0x2d51f8[_0xc2d810]['name']));}}return _0x33ff61;};var getChanSpyPromise=function(_0x4b44ad,_0x21a0e6){return new BPromise(function(_0x5aa87e,_0x4c9f98){return _0x4b44ad[_0xb2a4('0x19')][_0xb2a4('0x1a')]({'attributes':['id',_0xb2a4('0x12'),_0xb2a4('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xb2a4('0x1b')](function(_0x5430f8){if(_0x5430f8){return _0x5aa87e(getChanSpyApplications(_0x21a0e6,_0x5430f8));}return _0x5aa87e([]);})[_0xb2a4('0x1c')](function(_0x1b69c7){_0x4c9f98(_0x1b69c7);});});};module[_0xb2a4('0x1d')]=function(_0x5969b5,_0x3eb005){var _0x4a45b4=_0x5969b5[_0xb2a4('0x1e')];return _0x5969b5[_0xb2a4('0x1f')](_0xb2a4('0x20'),attributes,{'tableName':_0xb2a4('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f433d,_0x13a95c,_0x4c7f45){return getChanSpyPromise(_0x4a45b4,_0x1f433d)[_0xb2a4('0x1b')](function(_0xfe0c01){if(_0xfe0c01&&_0xfe0c01['length']){return _0x4a45b4['VoiceExtension'][_0xb2a4('0x22')](_0xfe0c01);}})[_0xb2a4('0x1b')](function(){_0x4c7f45();})[_0xb2a4('0x1c')](function(_0x59d105){_0x4c7f45(_0x59d105);});},'afterUpdate':function(_0x2cd63c,_0x562c83,_0x156c73){return _0x4a45b4[_0xb2a4('0x23')][_0xb2a4('0x24')]({'where':{'ChanSpyId':_0x2cd63c['id']}})[_0xb2a4('0x1b')](function(){return getChanSpyPromise(_0x4a45b4,_0x2cd63c);})[_0xb2a4('0x1b')](function(_0x31d446){if(_0x31d446&&_0x31d446['length']){return _0x4a45b4['VoiceExtension'][_0xb2a4('0x22')](_0x31d446);}})['then'](function(){_0x156c73();})[_0xb2a4('0x1c')](function(_0x119258){_0x156c73(_0x119258);});},'afterDestroy':function(_0x22f753,_0x28c4aa,_0x4664e7){return _0x4a45b4[_0xb2a4('0x23')][_0xb2a4('0x24')]({'where':{'ChanSpyId':_0x22f753['id']}})[_0xb2a4('0x1b')](function(){_0x4664e7();})[_0xb2a4('0x1c')](function(_0x5d4f82){_0x4664e7(_0x5d4f82);});}}});}; \ No newline at end of file +var _0x81dc=['%s%s','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','format','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','options','join','length','internal','name','then','catch','exports','VoiceChanSpy','VoiceExtension','destroy','util','bluebird','./voiceChanSpy.attributes','from-sip'];(function(_0x4dce10,_0x51d9c7){var _0x277d58=function(_0x4b3503){while(--_0x4b3503){_0x4dce10['push'](_0x4dce10['shift']());}};_0x277d58(++_0x51d9c7);}(_0x81dc,0x1e9));var _0xc81d=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x81dc[_0x29771f];return _0x279baf;};'use strict';var _=require('lodash');var util=require(_0xc81d('0x0'));var BPromise=require(_0xc81d('0x1'));var attributes=require(_0xc81d('0x2'));var getUserApplications=function(_0x21eeaa,_0x42b9a8,_0x50c099){var _0x574c44=0x1;var _0x2a4396=[];var _0x28fb3d={'context':_0x42b9a8['context']||_0xc81d('0x3'),'exten':util['format'](_0xc81d('0x4'),_0x21eeaa['prefix'],_0x50c099),'type':_0xc81d('0x5'),'isApp':![],'ChanSpyId':_0x21eeaa['id'],'UserId':_0x42b9a8['id']};_0x2a4396[_0xc81d('0x6')](_[_0xc81d('0x7')]({'app':_0xc81d('0x8'),'appdata':util['format'](_0xc81d('0x9'),_0xc81d('0xa')),'priority':_0x574c44++},_0x28fb3d));if(_0x21eeaa[_0xc81d('0xb')]){_0x2a4396[_0xc81d('0x6')](_[_0xc81d('0x7')]({'app':_0xc81d('0xc'),'appdata':util[_0xc81d('0xd')](_0xc81d('0xe'),_0x21eeaa[_0xc81d('0xf')]),'priority':_0x574c44++},_0x28fb3d));}if(_0x21eeaa['auth']){_0x2a4396[_0xc81d('0x6')](_[_0xc81d('0x7')]({'app':_0xc81d('0x10'),'appdata':_0x21eeaa['password'],'priority':_0x574c44++},_0x28fb3d));}_0x2a4396[_0xc81d('0x6')](_['merge']({'app':_0xc81d('0x11'),'appdata':util['format']('SIP/%s,%s',_0x42b9a8['name'],_0x21eeaa['options']?_0x21eeaa[_0xc81d('0x12')][_0xc81d('0x13')](''):''),'priority':_0x574c44++},_0x28fb3d));if(_0x21eeaa[_0xc81d('0xb')]){_0x2a4396[_0xc81d('0x6')](_[_0xc81d('0x7')]({'app':'StopMixMonitor','priority':_0x574c44++},_0x28fb3d));}return _0x2a4396;};var getChanSpyApplications=function(_0x329b86,_0x5e052a){var _0x472704=[];for(var _0x4f2f26=0x0,_0x2f8eea=0x1;_0x4f2f26<_0x5e052a[_0xc81d('0x14')];_0x4f2f26++,_0x2f8eea=0x1){_0x472704=_0x472704['concat'](getUserApplications(_0x329b86,_0x5e052a[_0x4f2f26],_0x5e052a[_0x4f2f26]['internal']));if(_0x5e052a[_0x4f2f26][_0xc81d('0x15')]!=_0x5e052a[_0x4f2f26][_0xc81d('0x16')]){_0x472704=_0x472704['concat'](getUserApplications(_0x329b86,_0x5e052a[_0x4f2f26],_0x5e052a[_0x4f2f26]['name']));}}return _0x472704;};var getChanSpyPromise=function(_0x4594c6,_0x12bee8){return new BPromise(function(_0x3986b6,_0x4a2311){return _0x4594c6['User']['findAll']({'attributes':['id',_0xc81d('0x16'),_0xc81d('0x15')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xc81d('0x17')](function(_0x1c9b05){if(_0x1c9b05){return _0x3986b6(getChanSpyApplications(_0x12bee8,_0x1c9b05));}return _0x3986b6([]);})[_0xc81d('0x18')](function(_0x462610){_0x4a2311(_0x462610);});});};module[_0xc81d('0x19')]=function(_0x5abc2e,_0x76d918){var _0x44e5f3=_0x5abc2e['models'];return _0x5abc2e['define'](_0xc81d('0x1a'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1680a1,_0x159e54,_0x499f12){return getChanSpyPromise(_0x44e5f3,_0x1680a1)[_0xc81d('0x17')](function(_0x2b10d7){if(_0x2b10d7&&_0x2b10d7[_0xc81d('0x14')]){return _0x44e5f3[_0xc81d('0x1b')]['bulkCreate'](_0x2b10d7);}})['then'](function(){_0x499f12();})[_0xc81d('0x18')](function(_0x3dbd77){_0x499f12(_0x3dbd77);});},'afterUpdate':function(_0x3ea8e3,_0xd7f406,_0x18ab23){return _0x44e5f3[_0xc81d('0x1b')][_0xc81d('0x1c')]({'where':{'ChanSpyId':_0x3ea8e3['id']}})['then'](function(){return getChanSpyPromise(_0x44e5f3,_0x3ea8e3);})[_0xc81d('0x17')](function(_0x55719a){if(_0x55719a&&_0x55719a[_0xc81d('0x14')]){return _0x44e5f3[_0xc81d('0x1b')]['bulkCreate'](_0x55719a);}})['then'](function(){_0x18ab23();})['catch'](function(_0x153253){_0x18ab23(_0x153253);});},'afterDestroy':function(_0x2fc203,_0x5f4cc2,_0x1dba9c){return _0x44e5f3[_0xc81d('0x1b')][_0xc81d('0x1c')]({'where':{'ChanSpyId':_0x2fc203['id']}})['then'](function(){_0x1dba9c();})[_0xc81d('0x18')](function(_0x2b8a3f){_0x1dba9c(_0x2b8a3f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index d5f8130..5a2222a 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 _0xf758=['request\x20sent','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x1e5bac,_0x2c5987){var _0x341bef=function(_0x3b08ef){while(--_0x3b08ef){_0x1e5bac['push'](_0x1e5bac['shift']());}};_0x341bef(++_0x2c5987);}(_0xf758,0x16a));var _0x8f75=function(_0x45310c,_0x106a46){_0x45310c=_0x45310c-0x0;var _0x5e941f=_0xf758[_0x45310c];return _0x5e941f;};'use strict';var _=require(_0x8f75('0x0'));var util=require(_0x8f75('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f75('0x2'));var db=require(_0x8f75('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f75('0x4'))(_0x8f75('0x5'));var config=require(_0x8f75('0x6'));var jayson=require(_0x8f75('0x7'));var client=jayson[_0x8f75('0x8')][_0x8f75('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43c6cb,_0x5eb836,_0x281fdf){return new BPromise(function(_0x4d770a,_0x115d58){return client[_0x8f75('0xa')](_0x43c6cb,_0x281fdf)['then'](function(_0x8b25d5){logger[_0x8f75('0xb')](_0x8f75('0xc'),_0x5eb836,'request\x20sent');logger[_0x8f75('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5eb836,'request\x20sent',JSON[_0x8f75('0xe')](_0x8b25d5));if(_0x8b25d5[_0x8f75('0xf')]){if(_0x8b25d5[_0x8f75('0xf')][_0x8f75('0x10')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x5eb836,_0x8b25d5[_0x8f75('0xf')]['message']);return _0x115d58(_0x8b25d5[_0x8f75('0xf')]['message']);}logger[_0x8f75('0xf')](_0x8f75('0xc'),_0x5eb836,_0x8b25d5[_0x8f75('0xf')]['message']);return _0x4d770a(_0x8b25d5['error'][_0x8f75('0x11')]);}else{logger[_0x8f75('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x5eb836,_0x8f75('0x12'));_0x4d770a(_0x8b25d5['result']['message']);}})[_0x8f75('0x13')](function(_0xe114ad){logger['error'](_0x8f75('0xc'),_0x5eb836,_0xe114ad);_0x115d58(_0xe114ad);});});} \ No newline at end of file +var _0x6e36=['request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xf7f60a,_0x15f736){var _0x2567ad=function(_0x396850){while(--_0x396850){_0xf7f60a['push'](_0xf7f60a['shift']());}};_0x2567ad(++_0x15f736);}(_0x6e36,0x95));var _0x66e3=function(_0x2580f3,_0x57d2ca){_0x2580f3=_0x2580f3-0x0;var _0x3ccf92=_0x6e36[_0x2580f3];return _0x3ccf92;};'use strict';var _=require('lodash');var util=require(_0x66e3('0x0'));var moment=require(_0x66e3('0x1'));var BPromise=require(_0x66e3('0x2'));var rs=require(_0x66e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66e3('0x4'))['db'];var utils=require(_0x66e3('0x5'));var logger=require(_0x66e3('0x6'))('rpc');var config=require(_0x66e3('0x7'));var jayson=require(_0x66e3('0x8'));var client=jayson[_0x66e3('0x9')][_0x66e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x223be8,_0x30f641,_0x446bce){return new BPromise(function(_0x5eb4ea,_0x1296c7){return client[_0x66e3('0xb')](_0x223be8,_0x446bce)[_0x66e3('0xc')](function(_0x405993){logger[_0x66e3('0xd')](_0x66e3('0xe'),_0x30f641,_0x66e3('0xf'));logger['debug'](_0x66e3('0x10'),_0x30f641,_0x66e3('0xf'),JSON['stringify'](_0x405993));if(_0x405993[_0x66e3('0x11')]){if(_0x405993['error']['code']===0x1f4){logger[_0x66e3('0x11')](_0x66e3('0xe'),_0x30f641,_0x405993[_0x66e3('0x11')][_0x66e3('0x12')]);return _0x1296c7(_0x405993[_0x66e3('0x11')][_0x66e3('0x12')]);}logger[_0x66e3('0x11')](_0x66e3('0xe'),_0x30f641,_0x405993[_0x66e3('0x11')][_0x66e3('0x12')]);return _0x5eb4ea(_0x405993[_0x66e3('0x11')][_0x66e3('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x30f641,'request\x20sent');_0x5eb4ea(_0x405993[_0x66e3('0x13')][_0x66e3('0x12')]);}})['catch'](function(_0x2cb19c){logger[_0x66e3('0x11')](_0x66e3('0xe'),_0x30f641,_0x2cb19c);_0x1296c7(_0x2cb19c);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f759628..e6fcbe1 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 _0xdfd6=['../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0xdfd6,0x1c6));var _0x6dfd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdfd6[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x6dfd('0x0'));var util=require(_0x6dfd('0x1'));var path=require(_0x6dfd('0x2'));var timeout=require(_0x6dfd('0x3'));var express=require(_0x6dfd('0x4'));var router=express[_0x6dfd('0x5')]();var auth=require(_0x6dfd('0x6'));var interaction=require(_0x6dfd('0x7'));var config=require(_0x6dfd('0x8'));var controller=require(_0x6dfd('0x9'));router['get']('/',auth[_0x6dfd('0xa')](),controller[_0x6dfd('0xb')]);router[_0x6dfd('0xc')](_0x6dfd('0xd'),auth['isAuthenticated'](),controller[_0x6dfd('0xe')]);router[_0x6dfd('0xf')]('/',auth[_0x6dfd('0xa')](),controller[_0x6dfd('0x10')]);router[_0x6dfd('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6dfd('0x12')]);router['delete']('/:id',auth[_0x6dfd('0xa')](),controller[_0x6dfd('0x13')]);module[_0x6dfd('0x14')]=router; \ No newline at end of file +var _0x7466=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x29920c,_0x57fb6f){var _0x49bd86=function(_0x36262e){while(--_0x36262e){_0x29920c['push'](_0x29920c['shift']());}};_0x49bd86(++_0x57fb6f);}(_0x7466,0xa6));var _0x6746=function(_0xd6cb8d,_0x50238b){_0xd6cb8d=_0xd6cb8d-0x0;var _0x24c790=_0x7466[_0xd6cb8d];return _0x24c790;};'use strict';var multer=require(_0x6746('0x0'));var util=require(_0x6746('0x1'));var path=require(_0x6746('0x2'));var timeout=require(_0x6746('0x3'));var express=require(_0x6746('0x4'));var router=express['Router']();var auth=require(_0x6746('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6746('0x6'));var controller=require(_0x6746('0x7'));router[_0x6746('0x8')]('/',auth['isAuthenticated'](),controller[_0x6746('0x9')]);router[_0x6746('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6746('0xa')]);router[_0x6746('0xb')]('/',auth[_0x6746('0xc')](),controller[_0x6746('0xd')]);router[_0x6746('0xe')]('/:id',auth[_0x6746('0xc')](),controller[_0x6746('0xf')]);router[_0x6746('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6746('0x11')]);module[_0x6746('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 492f8a2..70311f5 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(_0x37ef38,_0x2cfe4e){var _0x499daa=function(_0x18d0f5){while(--_0x18d0f5){_0x37ef38['push'](_0x37ef38['shift']());}};_0x499daa(++_0x2cfe4e);}(_0x3e74,0x175));var _0x43e7=function(_0xef49e7,_0x2106e7){_0xef49e7=_0xef49e7-0x0;var _0x4d74e3=_0x3e74[_0xef49e7];return _0x4d74e3;};'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(_0x4af8a5,_0x235b51){var _0x2f73a0=function(_0x62bae6){while(--_0x62bae6){_0x4af8a5['push'](_0x4af8a5['shift']());}};_0x2f73a0(++_0x235b51);}(_0x3e74,0x175));var _0x43e7=function(_0x21dcd3,_0x178329){_0x21dcd3=_0x21dcd3-0x0;var _0x341561=_0x3e74[_0x21dcd3];return _0x341561;};'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 aa258e3..75a190b 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 _0x3e74=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','map','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','findAll','show','params','include','find','create','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','readFileSync','server/files/templates/context.ejs','chan_sip.so','render','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','request','then'];(function(_0x3a3e2f,_0x41df79){var _0x665942=function(_0x45176d){while(--_0x45176d){_0x3a3e2f['push'](_0x3a3e2f['shift']());}};_0x665942(++_0x41df79);}(_0x3e74,0x175));var _0x43e7=function(_0x41f793,_0x345ea5){_0x41f793=_0x41f793-0x0;var _0x403385=_0x3e74[_0x41f793];return _0x403385;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x43e7('0x14'));var client=jayson[_0x43e7('0x15')][_0x43e7('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3bb83f,_0x4e008c,_0x583d85){if(_0x583d85){var _0x2fcb36=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fcb36[_0x43e7('0x17')](_0x4e008c)){return _0x3bb83f;}else{throw new db[(_0x43e7('0x18'))]['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 _0x3bb83f;}}function respondWithRpcPromise(_0x16849c,_0x14c146,_0x203378,_0x328445){return new BPromise(function(_0x4de324,_0x5c4eaa){var _0xdf16c=_0x328445||client;return _0xdf16c[_0x43e7('0x19')](_0x16849c,_0x203378)[_0x43e7('0x1a')](function(_0x5d346f){logger['info'](_0x43e7('0x1b'),_0x14c146,_0x43e7('0x1c'));logger[_0x43e7('0x1d')](_0x43e7('0x1e'),_0x14c146,_0x43e7('0x1c'),JSON[_0x43e7('0x1f')](_0x5d346f));if(_0x5d346f[_0x43e7('0x20')]){if(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x21')]===0x1f4){logger[_0x43e7('0x20')](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')]['message']);return _0x5c4eaa(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}logger['error'](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);return _0x4de324(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}else{logger[_0x43e7('0x23')]('VoiceContext,\x20%s,\x20%s',_0x14c146,_0x43e7('0x1c'));_0x4de324(_0x5d346f['result']['message']);}})[_0x43e7('0x24')](function(_0x43f4ff){logger['error'](_0x43e7('0x1b'),_0x14c146,_0x43f4ff);_0x5c4eaa(_0x43f4ff);});});}function respondWithStatusCode(_0x4ca5cf,_0x326dab){_0x326dab=_0x326dab||0xcc;return function(_0x5c5e67){if(_0x5c5e67){return _0x4ca5cf[_0x43e7('0x25')](_0x326dab);}return _0x4ca5cf[_0x43e7('0x26')](_0x326dab)[_0x43e7('0x27')]();};}function respondWithResult(_0x405f85,_0x51f4d7){_0x51f4d7=_0x51f4d7||0xc8;return function(_0x52b7b3){if(_0x52b7b3){return _0x405f85[_0x43e7('0x26')](_0x51f4d7)['json'](_0x52b7b3);}};}function respondWithFilteredResult(_0x2dd5f,_0x40dc8f){return function(_0x3565cf){if(_0x3565cf){var _0xb1fc63=_0x3565cf[_0x43e7('0x28')],_0x5087d7=_0x40dc8f[_0x43e7('0x29')],_0x33a1a5=_0x40dc8f[_0x43e7('0x29')]+_0x40dc8f[_0x43e7('0x2a')],_0x4690a6;if(_0x33a1a5>=_0xb1fc63){_0x33a1a5=_0xb1fc63;_0x4690a6=0xc8;}else{_0x4690a6=0xce;}_0x2dd5f[_0x43e7('0x26')](_0x4690a6);return _0x2dd5f[_0x43e7('0x2b')](_0x43e7('0x2c'),_0x5087d7+'-'+_0x33a1a5+'/'+_0xb1fc63)[_0x43e7('0x2d')](_0x3565cf);}return null;};}function patchUpdates(_0x17df44){return function(_0x19725a){try{jsonpatch[_0x43e7('0x2e')](_0x19725a,_0x17df44,!![]);}catch(_0x208706){return BPromise['reject'](_0x208706);}return _0x19725a[_0x43e7('0x2f')]();};}function saveUpdates(_0x44f6b0,_0x3b8f78){return function(_0x183c81){if(_0x183c81){return _0x183c81[_0x43e7('0x30')](_0x44f6b0)['then'](function(_0x1eba65){return _0x1eba65;});}return null;};}function removeEntity(_0x49b83d,_0x30d47e){return function(_0x3f280d){if(_0x3f280d){return _0x3f280d['destroy']()['then'](function(){var _0x5e203f=_0x3f280d[_0x43e7('0x31')]({'plain':!![]});var _0xbe6e28=_0x43e7('0x32');return db[_0x43e7('0x33')][_0x43e7('0x34')]({'where':{'type':_0xbe6e28,'resourceId':_0x5e203f['id']}})[_0x43e7('0x1a')](function(){return _0x3f280d;});})['then'](function(){_0x49b83d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e5b2,_0x4e8e86){return function(_0x564f0e){if(!_0x564f0e){_0x59e5b2['sendStatus'](0x194);}return _0x564f0e;};}function handleError(_0x14d888,_0x49cda6){_0x49cda6=_0x49cda6||0x1f4;return function(_0x2b4bfd){logger[_0x43e7('0x20')](_0x2b4bfd[_0x43e7('0x35')]);if(_0x2b4bfd[_0x43e7('0x36')]){delete _0x2b4bfd[_0x43e7('0x36')];}_0x14d888[_0x43e7('0x26')](_0x49cda6)[_0x43e7('0x37')](_0x2b4bfd);};}exports['index']=function(_0x5332d9,_0x5d84f4){var _0xfa0474={},_0xfe70e9={},_0x199ff6={'count':0x0,'rows':[]};var _0x16cdba=_[_0x43e7('0x38')](db[_0x43e7('0x39')][_0x43e7('0x3a')],function(_0x2ffd43){return{'name':_0x2ffd43['fieldName'],'type':_0x2ffd43[_0x43e7('0x3b')][_0x43e7('0x3c')]};});_0xfe70e9['model']=_[_0x43e7('0x38')](_0x16cdba,'name');_0xfe70e9[_0x43e7('0x3d')]=_[_0x43e7('0x3e')](_0x5332d9[_0x43e7('0x3d')]);_0xfe70e9[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],_0xfe70e9['query']);_0xfa0474['attributes']=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x42')]));_0xfa0474['attributes']=_0xfa0474[_0x43e7('0x43')][_0x43e7('0x44')]?_0xfa0474['attributes']:_0xfe70e9[_0x43e7('0x41')];if(!_0x5332d9['query'][_0x43e7('0x45')]('nolimit')){_0xfa0474[_0x43e7('0x2a')]=qs[_0x43e7('0x2a')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x2a')]);_0xfa0474['offset']=qs['offset'](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x29')]);}_0xfa0474[_0x43e7('0x46')]=qs[_0x43e7('0x47')](_0x5332d9['query']['sort']);_0xfa0474['where']=qs[_0x43e7('0x3f')](_['pick'](_0x5332d9[_0x43e7('0x3d')],_0xfe70e9['filters']),_0x16cdba);if(_0x5332d9['query'][_0x43e7('0x48')]){_0xfa0474['where']=_[_0x43e7('0x49')](_0xfa0474[_0x43e7('0x4a')],{'$or':_[_0x43e7('0x38')](_0x16cdba,function(_0x99b9e1){if(_0x99b9e1['type']!==_0x43e7('0x4b')){var _0x2b9046={};_0x2b9046[_0x99b9e1[_0x43e7('0x36')]]={'$like':'%'+_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x48')]+'%'};return _0x2b9046;}})});}_0xfa0474=_[_0x43e7('0x49')]({},_0xfa0474,_0x5332d9['options']);var _0x4930a2={'where':_0xfa0474[_0x43e7('0x4a')]};return db[_0x43e7('0x39')][_0x43e7('0x28')](_0x4930a2)['then'](function(_0x5c1c18){_0x199ff6['count']=_0x5c1c18;if(_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0xfa0474['include']=[{'all':!![]}];}return db[_0x43e7('0x39')][_0x43e7('0x4d')](_0xfa0474);})[_0x43e7('0x1a')](function(_0x560329){_0x199ff6['rows']=_0x560329;return _0x199ff6;})['then'](respondWithFilteredResult(_0x5d84f4,_0xfa0474))['catch'](handleError(_0x5d84f4,null));};exports[_0x43e7('0x4e')]=function(_0xe955fc,_0x52fea5){var _0x23e7cb={'raw':![],'where':{'id':_0xe955fc[_0x43e7('0x4f')]['id']}},_0x82d32f={};_0x82d32f[_0x43e7('0x41')]=_['keys'](db[_0x43e7('0x39')]['rawAttributes']);_0x82d32f['query']=_[_0x43e7('0x3e')](_0xe955fc[_0x43e7('0x3d')]);_0x82d32f[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],_0x82d32f[_0x43e7('0x3d')]);_0x23e7cb[_0x43e7('0x43')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0xe955fc['query'][_0x43e7('0x42')]));_0x23e7cb[_0x43e7('0x43')]=_0x23e7cb['attributes'][_0x43e7('0x44')]?_0x23e7cb['attributes']:_0x82d32f[_0x43e7('0x41')];if(_0xe955fc[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0x23e7cb[_0x43e7('0x50')]=[{'all':!![]}];}_0x23e7cb=_[_0x43e7('0x49')]({},_0x23e7cb,_0xe955fc['options']);return db['VoiceContext'][_0x43e7('0x51')](_0x23e7cb)[_0x43e7('0x1a')](handleEntityNotFound(_0x52fea5,null))[_0x43e7('0x1a')](respondWithResult(_0x52fea5,null))[_0x43e7('0x24')](handleError(_0x52fea5,null));};exports[_0x43e7('0x52')]=function(_0x25bb44,_0xa47464,_0x44f8a0){var _0x26d86c;return db[_0x43e7('0x39')][_0x43e7('0x52')](_0x25bb44['body'],{'raw':!![]})[_0x43e7('0x1a')](function(_0x2da2f3){_0x26d86c=_0x2da2f3;return db['VoiceContext'][_0x43e7('0x4d')]({'raw':!![]});})[_0x43e7('0x1a')](function(_0x2d0052){var _0x558d54=fs['readFileSync'](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x54506d=ejs['render'](_0x558d54,{'contexts':_0x2d0052||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x54506d);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x52'),{'module':'chan_sip.so'});})[_0x43e7('0x1a')](function(){var _0xdb9fbe=_0x25bb44['user'][_0x43e7('0x31')]({'plain':!![]});if(!_0xdb9fbe)throw new Error(_0x43e7('0x59'));if(_0xdb9fbe[_0x43e7('0x5a')]==='user'){var _0x5a4c95=_0x26d86c['get']({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x51')]({'where':{'name':_0x43e7('0x32'),'userProfileId':_0xdb9fbe[_0x43e7('0x5c')]},'raw':!![]})['then'](function(_0x5a50fc){if(_0x5a50fc&&_0x5a50fc[_0x43e7('0x5d')]===0x0){return db[_0x43e7('0x33')][_0x43e7('0x52')]({'name':_0x5a4c95[_0x43e7('0x36')],'resourceId':_0x5a4c95['id'],'type':_0x5a50fc['name'],'sectionId':_0x5a50fc['id']},{})[_0x43e7('0x1a')](function(){return _0x26d86c;});}else{return _0x26d86c;}})[_0x43e7('0x24')](function(_0x23595c){logger[_0x43e7('0x20')](_0x43e7('0x5e'),_0x23595c);throw _0x23595c;});}return _0x26d86c;})[_0x43e7('0x1a')](respondWithResult(_0xa47464,0xc9))[_0x43e7('0x24')](handleError(_0xa47464,null));};exports[_0x43e7('0x30')]=function(_0x406155,_0x381208,_0x252f00){var _0x57fdfe;return db['VoiceContext'][_0x43e7('0x51')]({'where':{'id':_0x406155['params']['id']}})['then'](handleEntityNotFound(_0x381208,null))['then'](saveUpdates(_0x406155[_0x43e7('0x5f')],null))[_0x43e7('0x1a')](function(_0x5d7b37){if(_0x5d7b37){_0x57fdfe=_0x5d7b37;return db[_0x43e7('0x39')][_0x43e7('0x4d')]({'raw':!![]});}})[_0x43e7('0x1a')](function(_0x537a53){var _0x2b7406=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],_0x43e7('0x61')),_0x43e7('0x55'));var _0x1e02fa=ejs['render'](_0x2b7406,{'contexts':_0x537a53||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x1e02fa);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x43e7('0x62')});})['then'](function(){return _0x57fdfe;})['then'](respondWithResult(_0x381208,null))[_0x43e7('0x24')](handleError(_0x381208,null));};exports[_0x43e7('0x34')]=function(_0x5b5833,_0x88c7f,_0x28b21d){var _0x1e2fed;return db[_0x43e7('0x39')][_0x43e7('0x51')]({'where':{'id':_0x5b5833[_0x43e7('0x4f')]['id']}})[_0x43e7('0x1a')](handleEntityNotFound(_0x88c7f,null))['then'](removeEntity(_0x88c7f,null))[_0x43e7('0x1a')](function(){return db[_0x43e7('0x39')]['findAll']({'raw':!![]});})[_0x43e7('0x1a')](function(_0x5c2c5f){var _0x26ee52=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x2646c2=ejs[_0x43e7('0x63')](_0x26ee52,{'contexts':_0x5c2c5f});fs['writeFileSync'](_0x43e7('0x57'),_0x2646c2);return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x34'),{'module':_0x43e7('0x62')});})[_0x43e7('0x24')](handleError(_0x88c7f,null));}; \ No newline at end of file +var _0x7217=['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','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\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','get','Contexts','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','show','params','length','options','find','create','body','join','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','role','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','root','server/files/templates/context.ejs','utf8','chan_sip.so','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'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x7217,0x19e));var _0x7721=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x7217[_0x387777];return _0x3f84c0;};'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(){var _0x498654=_0x5c5b33[_0x7721('0x39')]({'plain':!![]});var _0x5ce026=_0x7721('0x3a');return db[_0x7721('0x3b')][_0x7721('0x37')]({'where':{'type':_0x5ce026,'resourceId':_0x498654['id']}})[_0x7721('0x38')](function(){return _0x5c5b33;});})[_0x7721('0x38')](function(){_0x3e4e56[_0x7721('0x2d')](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x15545a,_0x25bdd9){return function(_0x3a2eb7){if(!_0x3a2eb7){_0x15545a[_0x7721('0x2c')](0x194);}return _0x3a2eb7;};}function handleError(_0x5c806d,_0xd1df68){_0xd1df68=_0xd1df68||0x1f4;return function(_0x5e6663){logger[_0x7721('0x26')](_0x5e6663[_0x7721('0x3c')]);if(_0x5e6663[_0x7721('0x3d')]){delete _0x5e6663[_0x7721('0x3d')];}_0x5c806d[_0x7721('0x2d')](_0xd1df68)[_0x7721('0x3e')](_0x5e6663);};}exports['index']=function(_0x557c34,_0x4cadef){var _0x539560={},_0x18001c={},_0x1b3f8d={'count':0x0,'rows':[]};var _0x1acc72=_[_0x7721('0x3f')](db['VoiceContext'][_0x7721('0x40')],function(_0x4cf659){return{'name':_0x4cf659[_0x7721('0x41')],'type':_0x4cf659[_0x7721('0x42')]['key']};});_0x18001c[_0x7721('0x43')]=_[_0x7721('0x3f')](_0x1acc72,'name');_0x18001c['query']=_[_0x7721('0x44')](_0x557c34[_0x7721('0x45')]);_0x18001c[_0x7721('0x46')]=_[_0x7721('0x47')](_0x18001c['model'],_0x18001c[_0x7721('0x45')]);_0x539560[_0x7721('0x48')]=_[_0x7721('0x47')](_0x18001c[_0x7721('0x43')],qs[_0x7721('0x49')](_0x557c34['query'][_0x7721('0x49')]));_0x539560['attributes']=_0x539560[_0x7721('0x48')]['length']?_0x539560[_0x7721('0x48')]:_0x18001c[_0x7721('0x43')];if(!_0x557c34[_0x7721('0x45')]['hasOwnProperty'](_0x7721('0x4a'))){_0x539560[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x557c34['query'][_0x7721('0x31')]);_0x539560[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x557c34[_0x7721('0x45')][_0x7721('0x30')]);}_0x539560[_0x7721('0x4b')]=qs[_0x7721('0x4c')](_0x557c34['query']['sort']);_0x539560[_0x7721('0x4d')]=qs[_0x7721('0x46')](_[_0x7721('0x4e')](_0x557c34[_0x7721('0x45')],_0x18001c[_0x7721('0x46')]),_0x1acc72);if(_0x557c34[_0x7721('0x45')][_0x7721('0x4f')]){_0x539560[_0x7721('0x4d')]=_[_0x7721('0x50')](_0x539560[_0x7721('0x4d')],{'$or':_['map'](_0x1acc72,function(_0x578867){if(_0x578867[_0x7721('0x42')]!==_0x7721('0x51')){var _0x151f69={};_0x151f69[_0x578867[_0x7721('0x3d')]]={'$like':'%'+_0x557c34['query'][_0x7721('0x4f')]+'%'};return _0x151f69;}})});}_0x539560=_[_0x7721('0x50')]({},_0x539560,_0x557c34['options']);var _0x330fac={'where':_0x539560['where']};return db[_0x7721('0x52')]['count'](_0x330fac)[_0x7721('0x38')](function(_0x196be4){_0x1b3f8d[_0x7721('0x2f')]=_0x196be4;if(_0x557c34['query'][_0x7721('0x53')]){_0x539560[_0x7721('0x54')]=[{'all':!![]}];}return db['VoiceContext'][_0x7721('0x55')](_0x539560);})[_0x7721('0x38')](function(_0xf88e8c){_0x1b3f8d['rows']=_0xf88e8c;return _0x1b3f8d;})[_0x7721('0x38')](respondWithFilteredResult(_0x4cadef,_0x539560))['catch'](handleError(_0x4cadef,null));};exports[_0x7721('0x56')]=function(_0x310549,_0x4738ef){var _0x443503={'raw':![],'where':{'id':_0x310549[_0x7721('0x57')]['id']}},_0x1c95d8={};_0x1c95d8[_0x7721('0x43')]=_[_0x7721('0x44')](db[_0x7721('0x52')][_0x7721('0x40')]);_0x1c95d8[_0x7721('0x45')]=_[_0x7721('0x44')](_0x310549[_0x7721('0x45')]);_0x1c95d8[_0x7721('0x46')]=_[_0x7721('0x47')](_0x1c95d8['model'],_0x1c95d8[_0x7721('0x45')]);_0x443503[_0x7721('0x48')]=_[_0x7721('0x47')](_0x1c95d8[_0x7721('0x43')],qs[_0x7721('0x49')](_0x310549[_0x7721('0x45')][_0x7721('0x49')]));_0x443503['attributes']=_0x443503[_0x7721('0x48')][_0x7721('0x58')]?_0x443503[_0x7721('0x48')]:_0x1c95d8[_0x7721('0x43')];if(_0x310549[_0x7721('0x45')][_0x7721('0x53')]){_0x443503[_0x7721('0x54')]=[{'all':!![]}];}_0x443503=_[_0x7721('0x50')]({},_0x443503,_0x310549[_0x7721('0x59')]);return db[_0x7721('0x52')][_0x7721('0x5a')](_0x443503)['then'](handleEntityNotFound(_0x4738ef,null))[_0x7721('0x38')](respondWithResult(_0x4738ef,null))[_0x7721('0x2b')](handleError(_0x4738ef,null));};exports[_0x7721('0x5b')]=function(_0x2ee3c0,_0x15ed3b,_0x3e7918){var _0x41644f;return db[_0x7721('0x52')][_0x7721('0x5b')](_0x2ee3c0[_0x7721('0x5c')],{'raw':!![]})[_0x7721('0x38')](function(_0x2e5c28){_0x41644f=_0x2e5c28;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});})[_0x7721('0x38')](function(_0x577f47){var _0x50e9e9=fs['readFileSync'](path[_0x7721('0x5d')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x5d7036=ejs[_0x7721('0x5e')](_0x50e9e9,{'contexts':_0x577f47||[]});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x5d7036);})['then'](function(){return respondWithRpcPromise(_0x7721('0x61'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x24d1dc=_0x2ee3c0['user']['get']({'plain':!![]});if(!_0x24d1dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24d1dc[_0x7721('0x62')]===_0x7721('0x63')){var _0x1ff090=_0x41644f['get']({'plain':!![]});return db[_0x7721('0x64')][_0x7721('0x5a')]({'where':{'name':_0x7721('0x3a'),'userProfileId':_0x24d1dc[_0x7721('0x65')]},'raw':!![]})[_0x7721('0x38')](function(_0x16e80b){if(_0x16e80b&&_0x16e80b[_0x7721('0x66')]===0x0){return db[_0x7721('0x3b')][_0x7721('0x5b')]({'name':_0x1ff090[_0x7721('0x3d')],'resourceId':_0x1ff090['id'],'type':_0x16e80b[_0x7721('0x3d')],'sectionId':_0x16e80b['id']},{})[_0x7721('0x38')](function(){return _0x41644f;});}else{return _0x41644f;}})[_0x7721('0x2b')](function(_0x211d27){logger[_0x7721('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211d27);throw _0x211d27;});}return _0x41644f;})[_0x7721('0x38')](respondWithResult(_0x15ed3b,0xc9))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports[_0x7721('0x36')]=function(_0xb6db23,_0x542e30,_0x103009){var _0x104f05;return db['VoiceContext'][_0x7721('0x5a')]({'where':{'id':_0xb6db23['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x542e30,null))[_0x7721('0x38')](saveUpdates(_0xb6db23[_0x7721('0x5c')],null))[_0x7721('0x38')](function(_0x3d2b7d){if(_0x3d2b7d){_0x104f05=_0x3d2b7d;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});}})[_0x7721('0x38')](function(_0x4727b0){var _0x57759a=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),_0x7721('0x6a'));var _0x3ed425=ejs[_0x7721('0x5e')](_0x57759a,{'contexts':_0x4727b0||[]});fs['writeFileSync'](_0x7721('0x60'),_0x3ed425);})[_0x7721('0x38')](function(){return respondWithRpcPromise('Reload',_0x7721('0x36'),{'module':'chan_sip.so'});})[_0x7721('0x38')](function(){return _0x104f05;})[_0x7721('0x38')](respondWithResult(_0x542e30,null))[_0x7721('0x2b')](handleError(_0x542e30,null));};exports[_0x7721('0x37')]=function(_0x1e2436,_0x2bab14,_0x258c57){var _0x5dca04;return db[_0x7721('0x52')][_0x7721('0x5a')]({'where':{'id':_0x1e2436[_0x7721('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bab14,null))['then'](removeEntity(_0x2bab14,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x7721('0x38')](function(_0x2645dd){var _0x580473=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),'utf8');var _0x275b25=ejs[_0x7721('0x5e')](_0x580473,{'contexts':_0x2645dd});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x275b25);return respondWithRpcPromise(_0x7721('0x61'),'destroy',{'module':_0x7721('0x6b')});})[_0x7721('0x2b')](handleError(_0x2bab14,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3e46edd..ad7a3cc 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 _0x4c72=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash'];(function(_0x140332,_0x102a44){var _0x2d14f=function(_0x201b35){while(--_0x201b35){_0x140332['push'](_0x140332['shift']());}};_0x2d14f(++_0x102a44);}(_0x4c72,0x180));var _0x24c7=function(_0x13be78,_0x4f457d){_0x13be78=_0x13be78-0x0;var _0x4bd076=_0x4c72[_0x13be78];return _0x4bd076;};'use strict';var _=require(_0x24c7('0x0'));var util=require(_0x24c7('0x1'));var logger=require(_0x24c7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x24c7('0x3'));var rp=require(_0x24c7('0x4'));var fs=require('fs');var path=require(_0x24c7('0x5'));var rimraf=require('rimraf');var config=require(_0x24c7('0x6'));var attributes=require(_0x24c7('0x7'));module[_0x24c7('0x8')]=function(_0x35157e,_0x5b316d){return _0x35157e['define'](_0x24c7('0x9'),attributes,{'tableName':_0x24c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46fc=['exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','moment','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x46fc,0x17a));var _0xc46f=function(_0x175c5e,_0x5a411b){_0x175c5e=_0x175c5e-0x0;var _0x18d528=_0x46fc[_0x175c5e];return _0x18d528;};'use strict';var _=require(_0xc46f('0x0'));var util=require('util');var logger=require(_0xc46f('0x1'))('api');var moment=require(_0xc46f('0x2'));var BPromise=require('bluebird');var rp=require(_0xc46f('0x3'));var fs=require('fs');var path=require(_0xc46f('0x4'));var rimraf=require(_0xc46f('0x5'));var config=require('../../config/environment');var attributes=require(_0xc46f('0x6'));module[_0xc46f('0x7')]=function(_0x544018,_0x4330c0){return _0x544018[_0xc46f('0x8')](_0xc46f('0x9'),attributes,{'tableName':_0xc46f('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 76d1b0c..62ee1ea 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 _0x1db9=['code','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1f50b8,_0x516324){var _0x895388=function(_0x4796dd){while(--_0x4796dd){_0x1f50b8['push'](_0x1f50b8['shift']());}};_0x895388(++_0x516324);}(_0x1db9,0x1e9));var _0x91db=function(_0x180ec6,_0x58ab07){_0x180ec6=_0x180ec6-0x0;var _0xd8c906=_0x1db9[_0x180ec6];return _0xd8c906;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91db('0x3'));var db=require(_0x91db('0x4'))['db'];var utils=require(_0x91db('0x5'));var logger=require(_0x91db('0x6'))(_0x91db('0x7'));var config=require(_0x91db('0x8'));var jayson=require(_0x91db('0x9'));var client=jayson[_0x91db('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x376b7b,_0x16d05c,_0x4c27c7){return new BPromise(function(_0x24dfac,_0x25e291){return client[_0x91db('0xb')](_0x376b7b,_0x4c27c7)['then'](function(_0x3a1572){logger['info']('VoiceContext,\x20%s,\x20%s',_0x16d05c,_0x91db('0xc'));logger[_0x91db('0xd')](_0x91db('0xe'),_0x16d05c,'request\x20sent',JSON[_0x91db('0xf')](_0x3a1572));if(_0x3a1572[_0x91db('0x10')]){if(_0x3a1572['error'][_0x91db('0x11')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x16d05c,_0x3a1572[_0x91db('0x10')][_0x91db('0x12')]);return _0x25e291(_0x3a1572[_0x91db('0x10')][_0x91db('0x12')]);}logger[_0x91db('0x10')]('VoiceContext,\x20%s,\x20%s',_0x16d05c,_0x3a1572[_0x91db('0x10')]['message']);return _0x24dfac(_0x3a1572[_0x91db('0x10')]['message']);}else{logger['info'](_0x91db('0x13'),_0x16d05c,_0x91db('0xc'));_0x24dfac(_0x3a1572[_0x91db('0x14')][_0x91db('0x12')]);}})[_0x91db('0x15')](function(_0x37e441){logger[_0x91db('0x10')](_0x91db('0x13'),_0x16d05c,_0x37e441);_0x25e291(_0x37e441);});});} \ No newline at end of file +var _0xda54=['request','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','client'];(function(_0x55ed1b,_0x3fdb52){var _0x59891d=function(_0x412595){while(--_0x412595){_0x55ed1b['push'](_0x55ed1b['shift']());}};_0x59891d(++_0x3fdb52);}(_0xda54,0xa3));var _0x4da5=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0xda54[_0x447ef1];return _0x3d72ec;};'use strict';var _=require(_0x4da5('0x0'));var util=require(_0x4da5('0x1'));var moment=require(_0x4da5('0x2'));var BPromise=require(_0x4da5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4da5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4da5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4da5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x411ab8,_0x41df0e,_0x57d34c){return new BPromise(function(_0x3246de,_0x15d7d4){return client[_0x4da5('0x7')](_0x411ab8,_0x57d34c)['then'](function(_0x58603f){logger[_0x4da5('0x8')](_0x4da5('0x9'),_0x41df0e,'request\x20sent');logger['debug'](_0x4da5('0xa'),_0x41df0e,_0x4da5('0xb'),JSON['stringify'](_0x58603f));if(_0x58603f[_0x4da5('0xc')]){if(_0x58603f[_0x4da5('0xc')][_0x4da5('0xd')]===0x1f4){logger[_0x4da5('0xc')](_0x4da5('0x9'),_0x41df0e,_0x58603f[_0x4da5('0xc')][_0x4da5('0xe')]);return _0x15d7d4(_0x58603f[_0x4da5('0xc')][_0x4da5('0xe')]);}logger['error'](_0x4da5('0x9'),_0x41df0e,_0x58603f[_0x4da5('0xc')][_0x4da5('0xe')]);return _0x3246de(_0x58603f[_0x4da5('0xc')]['message']);}else{logger[_0x4da5('0x8')]('VoiceContext,\x20%s,\x20%s',_0x41df0e,_0x4da5('0xb'));_0x3246de(_0x58603f[_0x4da5('0xf')][_0x4da5('0xe')]);}})[_0x4da5('0x10')](function(_0x1c1776){logger[_0x4da5('0xc')](_0x4da5('0x9'),_0x41df0e,_0x1c1776);_0x15d7d4(_0x1c1776);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 01d8a07..6026794 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 _0xece6=['/:id','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3b4d1b,_0x12517b){var _0x5a2ffd=function(_0x241fe6){while(--_0x241fe6){_0x3b4d1b['push'](_0x3b4d1b['shift']());}};_0x5a2ffd(++_0x12517b);}(_0xece6,0xd7));var _0x6ece=function(_0x198b7b,_0x5f5bae){_0x198b7b=_0x198b7b-0x0;var _0x16c056=_0xece6[_0x198b7b];return _0x16c056;};'use strict';var multer=require(_0x6ece('0x0'));var util=require(_0x6ece('0x1'));var path=require(_0x6ece('0x2'));var timeout=require('connect-timeout');var express=require(_0x6ece('0x3'));var router=express[_0x6ece('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ece('0x5'));var config=require(_0x6ece('0x6'));var controller=require(_0x6ece('0x7'));router[_0x6ece('0x8')]('/',auth[_0x6ece('0x9')](),controller[_0x6ece('0xa')]);router[_0x6ece('0x8')](_0x6ece('0xb'),auth[_0x6ece('0x9')](),controller[_0x6ece('0xc')]);router['get'](_0x6ece('0xd'),auth[_0x6ece('0x9')](),controller['show']);router['post']('/',auth[_0x6ece('0x9')](),controller['create']);router[_0x6ece('0xe')](_0x6ece('0xd'),auth[_0x6ece('0x9')](),controller[_0x6ece('0xf')]);router[_0x6ece('0x10')](_0x6ece('0xd'),auth[_0x6ece('0x9')](),controller[_0x6ece('0x11')]);module[_0x6ece('0x12')]=router; \ No newline at end of file +var _0xbd01=['exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','post','put','/:id','update','delete','destroy'];(function(_0xdfee19,_0x21b6d4){var _0xbd2c99=function(_0x59438d){while(--_0x59438d){_0xdfee19['push'](_0xdfee19['shift']());}};_0xbd2c99(++_0x21b6d4);}(_0xbd01,0x133));var _0x1bd0=function(_0x4862e3,_0x11c162){_0x4862e3=_0x4862e3-0x0;var _0x16592e=_0xbd01[_0x4862e3];return _0x16592e;};'use strict';var multer=require('multer');var util=require(_0x1bd0('0x0'));var path=require(_0x1bd0('0x1'));var timeout=require(_0x1bd0('0x2'));var express=require('express');var router=express[_0x1bd0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1bd0('0x4'));var config=require(_0x1bd0('0x5'));var controller=require('./voiceDialReport.controller');router[_0x1bd0('0x6')]('/',auth[_0x1bd0('0x7')](),controller[_0x1bd0('0x8')]);router[_0x1bd0('0x6')](_0x1bd0('0x9'),auth[_0x1bd0('0x7')](),controller['describe']);router['get']('/:id',auth[_0x1bd0('0x7')](),controller['show']);router[_0x1bd0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1bd0('0xb')](_0x1bd0('0xc'),auth[_0x1bd0('0x7')](),controller[_0x1bd0('0xd')]);router[_0x1bd0('0xe')](_0x1bd0('0xc'),auth[_0x1bd0('0x7')](),controller[_0x1bd0('0xf')]);module[_0x1bd0('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a7b402a..9788efd 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 _0xb04b=['STRING','INTEGER','DATE','exports'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0xb04b,0xcb));var _0xbb04=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb04b[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xbb04('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbb04('0x1')]},'channelstate':{'type':Sequelize[_0xbb04('0x2')]},'channelstatedesc':{'type':Sequelize[_0xbb04('0x1')]},'calleridnum':{'type':Sequelize[_0xbb04('0x1')]},'calleridname':{'type':Sequelize[_0xbb04('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbb04('0x1')]},'language':{'type':Sequelize[_0xbb04('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xbb04('0x1')]},'exten':{'type':Sequelize[_0xbb04('0x1')]},'priority':{'type':Sequelize[_0xbb04('0x2')]},'uniqueid':{'type':Sequelize[_0xbb04('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xbb04('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xbb04('0x1')]},'destcalleridnum':{'type':Sequelize[_0xbb04('0x1')]},'destcalleridname':{'type':Sequelize[_0xbb04('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbb04('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xbb04('0x1')]},'destlanguage':{'type':Sequelize[_0xbb04('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbb04('0x1')]},'destexten':{'type':Sequelize[_0xbb04('0x1')]},'destpriority':{'type':Sequelize[_0xbb04('0x2')]},'destuniqueid':{'type':Sequelize[_0xbb04('0x1')]},'destlinkedid':{'type':Sequelize[_0xbb04('0x1')]},'dialstring':{'type':Sequelize[_0xbb04('0x1')]},'dialstatus':{'type':Sequelize[_0xbb04('0x1')]},'starttime':{'type':Sequelize[_0xbb04('0x3')]},'answertime':{'type':Sequelize[_0xbb04('0x3')]},'endtime':{'type':Sequelize[_0xbb04('0x3')]},'lastevent':{'type':Sequelize[_0xbb04('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xbb04('0x2')]},'holdtime':{'type':Sequelize[_0xbb04('0x2')]},'billableseconds':{'type':Sequelize[_0xbb04('0x2')]}}; \ No newline at end of file +var _0x2c82=['DATE','called,connect,complete','STRING','INTEGER'];(function(_0x4ce140,_0x36e087){var _0x1f7209=function(_0x3c9aec){while(--_0x3c9aec){_0x4ce140['push'](_0x4ce140['shift']());}};_0x1f7209(++_0x36e087);}(_0x2c82,0x16a));var _0x22c8=function(_0x4a2b3c,_0xc69f59){_0x4a2b3c=_0x4a2b3c-0x0;var _0x4b081b=_0x2c82[_0x4a2b3c];return _0x4b081b;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x22c8('0x0')]},'channelstate':{'type':Sequelize[_0x22c8('0x1')]},'channelstatedesc':{'type':Sequelize[_0x22c8('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22c8('0x0')]},'connectedlinenum':{'type':Sequelize[_0x22c8('0x0')]},'connectedlinename':{'type':Sequelize[_0x22c8('0x0')]},'language':{'type':Sequelize[_0x22c8('0x0')]},'accountcode':{'type':Sequelize[_0x22c8('0x0')]},'context':{'type':Sequelize[_0x22c8('0x0')]},'exten':{'type':Sequelize[_0x22c8('0x0')]},'priority':{'type':Sequelize[_0x22c8('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x22c8('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x22c8('0x1')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x22c8('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x22c8('0x0')]},'destlanguage':{'type':Sequelize[_0x22c8('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x22c8('0x0')]},'destexten':{'type':Sequelize[_0x22c8('0x0')]},'destpriority':{'type':Sequelize[_0x22c8('0x1')]},'destuniqueid':{'type':Sequelize[_0x22c8('0x0')]},'destlinkedid':{'type':Sequelize[_0x22c8('0x0')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x22c8('0x0')]},'starttime':{'type':Sequelize[_0x22c8('0x2')]},'answertime':{'type':Sequelize[_0x22c8('0x2')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x22c8('0x0')],'comment':_0x22c8('0x3')},'routeId':{'type':Sequelize[_0x22c8('0x1')]},'duration':{'type':Sequelize[_0x22c8('0x1')]},'holdtime':{'type':Sequelize[_0x22c8('0x1')]},'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 5e5e38a..e5e9669 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 _0x3a5e=['filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','fields','find','create','catch','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x114486,_0x48c6e1){var _0x5afe9b=function(_0xcc08bf){while(--_0xcc08bf){_0x114486['push'](_0x114486['shift']());}};_0x5afe9b(++_0x48c6e1);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x41abe6,_0x4648bd){_0x41abe6=_0x41abe6-0x0;var _0xf5ddaa=_0x3a5e[_0x41abe6];return _0xf5ddaa;};'use strict';var pdf=require(_0xe3a5('0x0'));var emlformat=require(_0xe3a5('0x1'));var rimraf=require(_0xe3a5('0x2'));var zipdir=require(_0xe3a5('0x3'));var jsonpatch=require(_0xe3a5('0x4'));var rp=require(_0xe3a5('0x5'));var moment=require('moment');var BPromise=require(_0xe3a5('0x6'));var Mustache=require(_0xe3a5('0x7'));var util=require(_0xe3a5('0x8'));var path=require(_0xe3a5('0x9'));var sox=require(_0xe3a5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3a5('0xb'));var squel=require('squel');var crypto=require(_0xe3a5('0xc'));var jsforce=require(_0xe3a5('0xd'));var deskjs=require(_0xe3a5('0xe'));var toCsv=require(_0xe3a5('0xf'));var querystring=require(_0xe3a5('0x10'));var Papa=require(_0xe3a5('0x11'));var Redis=require(_0xe3a5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe3a5('0x13'));var as=require(_0xe3a5('0x14'));var hardwareService=require(_0xe3a5('0x15'));var logger=require(_0xe3a5('0x16'))('api');var utils=require(_0xe3a5('0x17'));var config=require(_0xe3a5('0x18'));var db=require(_0xe3a5('0x19'))['db'];function respondWithStatusCode(_0xed6d6a,_0x21df1a){_0x21df1a=_0x21df1a||0xcc;return function(_0x11c871){if(_0x11c871){return _0xed6d6a['sendStatus'](_0x21df1a);}return _0xed6d6a[_0xe3a5('0x1a')](_0x21df1a)[_0xe3a5('0x1b')]();};}function respondWithResult(_0x35097b,_0x69a1c){_0x69a1c=_0x69a1c||0xc8;return function(_0x33d5de){if(_0x33d5de){return _0x35097b[_0xe3a5('0x1a')](_0x69a1c)[_0xe3a5('0x1c')](_0x33d5de);}};}function respondWithFilteredResult(_0x45aad6,_0x28645a){return function(_0x539af2){if(_0x539af2){var _0x59bc87=_0x539af2[_0xe3a5('0x1d')],_0x132932=_0x28645a[_0xe3a5('0x1e')],_0x3994f0=_0x28645a[_0xe3a5('0x1e')]+_0x28645a[_0xe3a5('0x1f')],_0x55e709;if(_0x3994f0>=_0x59bc87){_0x3994f0=_0x59bc87;_0x55e709=0xc8;}else{_0x55e709=0xce;}_0x45aad6[_0xe3a5('0x1a')](_0x55e709);return _0x45aad6[_0xe3a5('0x20')](_0xe3a5('0x21'),_0x132932+'-'+_0x3994f0+'/'+_0x59bc87)[_0xe3a5('0x1c')](_0x539af2);}return null;};}function patchUpdates(_0x5e421c){return function(_0x53091a){try{jsonpatch['apply'](_0x53091a,_0x5e421c,!![]);}catch(_0x1ab537){return BPromise[_0xe3a5('0x22')](_0x1ab537);}return _0x53091a[_0xe3a5('0x23')]();};}function saveUpdates(_0x3eea83,_0x2a07e6){return function(_0x5a2a0c){if(_0x5a2a0c){return _0x5a2a0c['update'](_0x3eea83)['then'](function(_0x453e95){return _0x453e95;});}return null;};}function removeEntity(_0xd5f03b,_0x2920e7){return function(_0x1758db){if(_0x1758db){return _0x1758db[_0xe3a5('0x24')]()[_0xe3a5('0x25')](function(){_0xd5f03b[_0xe3a5('0x1a')](0xcc)[_0xe3a5('0x1b')]();});}};}function handleEntityNotFound(_0x10759c,_0xb8ab4f){return function(_0x182622){if(!_0x182622){_0x10759c[_0xe3a5('0x26')](0x194);}return _0x182622;};}function handleError(_0x3fcedb,_0x551e78){_0x551e78=_0x551e78||0x1f4;return function(_0xe49210){logger[_0xe3a5('0x27')](_0xe49210[_0xe3a5('0x28')]);if(_0xe49210[_0xe3a5('0x29')]){delete _0xe49210['name'];}_0x3fcedb[_0xe3a5('0x1a')](_0x551e78)[_0xe3a5('0x2a')](_0xe49210);};}exports[_0xe3a5('0x2b')]=function(_0x4d709d,_0x3b9f7d){var _0x51acf8={},_0x952936={},_0x3989f6={'count':0x0,'rows':[]};var _0x5a6b20=_[_0xe3a5('0x2c')](db[_0xe3a5('0x2d')][_0xe3a5('0x2e')],function(_0x1c1f79){return{'name':_0x1c1f79[_0xe3a5('0x2f')],'type':_0x1c1f79[_0xe3a5('0x30')][_0xe3a5('0x31')]};});_0x952936[_0xe3a5('0x32')]=_[_0xe3a5('0x2c')](_0x5a6b20,_0xe3a5('0x29'));_0x952936[_0xe3a5('0x33')]=_[_0xe3a5('0x34')](_0x4d709d[_0xe3a5('0x33')]);_0x952936[_0xe3a5('0x35')]=_[_0xe3a5('0x36')](_0x952936[_0xe3a5('0x32')],_0x952936[_0xe3a5('0x33')]);_0x51acf8[_0xe3a5('0x37')]=_['intersection'](_0x952936['model'],qs['fields'](_0x4d709d[_0xe3a5('0x33')]['fields']));_0x51acf8[_0xe3a5('0x37')]=_0x51acf8[_0xe3a5('0x37')][_0xe3a5('0x38')]?_0x51acf8[_0xe3a5('0x37')]:_0x952936[_0xe3a5('0x32')];if(!_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x39')](_0xe3a5('0x3a'))){_0x51acf8[_0xe3a5('0x1f')]=qs[_0xe3a5('0x1f')](_0x4d709d['query'][_0xe3a5('0x1f')]);_0x51acf8[_0xe3a5('0x1e')]=qs[_0xe3a5('0x1e')](_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x1e')]);}_0x51acf8['order']=qs[_0xe3a5('0x3b')](_0x4d709d[_0xe3a5('0x33')]['sort']);_0x51acf8[_0xe3a5('0x3c')]=qs[_0xe3a5('0x35')](_[_0xe3a5('0x3d')](_0x4d709d[_0xe3a5('0x33')],_0x952936['filters']),_0x5a6b20);if(_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x3e')]){_0x51acf8[_0xe3a5('0x3c')]=_[_0xe3a5('0x3f')](_0x51acf8[_0xe3a5('0x3c')],{'$or':_[_0xe3a5('0x2c')](_0x5a6b20,function(_0x32e6fa){if(_0x32e6fa[_0xe3a5('0x30')]!=='VIRTUAL'){var _0x5ac1a3={};_0x5ac1a3[_0x32e6fa[_0xe3a5('0x29')]]={'$like':'%'+_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x3e')]+'%'};return _0x5ac1a3;}})});}_0x51acf8=_[_0xe3a5('0x3f')]({},_0x51acf8,_0x4d709d[_0xe3a5('0x40')]);var _0x5cb5e4={'where':_0x51acf8[_0xe3a5('0x3c')]};return db[_0xe3a5('0x2d')][_0xe3a5('0x1d')](_0x5cb5e4)[_0xe3a5('0x25')](function(_0x3f3dcf){_0x3989f6[_0xe3a5('0x1d')]=_0x3f3dcf;if(_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x41')]){_0x51acf8[_0xe3a5('0x42')]=[{'all':!![]}];}return db[_0xe3a5('0x2d')][_0xe3a5('0x43')](_0x51acf8);})[_0xe3a5('0x25')](function(_0x37229f){_0x3989f6[_0xe3a5('0x44')]=_0x37229f;return _0x3989f6;})['then'](respondWithFilteredResult(_0x3b9f7d,_0x51acf8))['catch'](handleError(_0x3b9f7d,null));};exports[_0xe3a5('0x45')]=function(_0x29947a,_0x19370d){var _0xaacd4c={'raw':!![],'where':{'id':_0x29947a['params']['id']}},_0x2a524c={};_0x2a524c[_0xe3a5('0x32')]=_[_0xe3a5('0x34')](db[_0xe3a5('0x2d')][_0xe3a5('0x2e')]);_0x2a524c[_0xe3a5('0x33')]=_[_0xe3a5('0x34')](_0x29947a[_0xe3a5('0x33')]);_0x2a524c[_0xe3a5('0x35')]=_['intersection'](_0x2a524c[_0xe3a5('0x32')],_0x2a524c[_0xe3a5('0x33')]);_0xaacd4c['attributes']=_[_0xe3a5('0x36')](_0x2a524c[_0xe3a5('0x32')],qs[_0xe3a5('0x46')](_0x29947a['query'][_0xe3a5('0x46')]));_0xaacd4c[_0xe3a5('0x37')]=_0xaacd4c[_0xe3a5('0x37')]['length']?_0xaacd4c[_0xe3a5('0x37')]:_0x2a524c[_0xe3a5('0x32')];if(_0x29947a[_0xe3a5('0x33')][_0xe3a5('0x41')]){_0xaacd4c['include']=[{'all':!![]}];}_0xaacd4c=_[_0xe3a5('0x3f')]({},_0xaacd4c,_0x29947a[_0xe3a5('0x40')]);return db[_0xe3a5('0x2d')][_0xe3a5('0x47')](_0xaacd4c)[_0xe3a5('0x25')](handleEntityNotFound(_0x19370d,null))['then'](respondWithResult(_0x19370d,null))['catch'](handleError(_0x19370d,null));};exports[_0xe3a5('0x48')]=function(_0x33d361,_0x4d6684){return db[_0xe3a5('0x2d')]['create'](_0x33d361['body'],{})[_0xe3a5('0x25')](respondWithResult(_0x4d6684,0xc9))[_0xe3a5('0x49')](handleError(_0x4d6684,null));};exports[_0xe3a5('0x4a')]=function(_0x1714f8,_0x424e85){if(_0x1714f8[_0xe3a5('0x4b')]['id']){delete _0x1714f8[_0xe3a5('0x4b')]['id'];}return db[_0xe3a5('0x2d')][_0xe3a5('0x47')]({'where':{'id':_0x1714f8['params']['id']}})['then'](handleEntityNotFound(_0x424e85,null))[_0xe3a5('0x25')](saveUpdates(_0x1714f8[_0xe3a5('0x4b')],null))[_0xe3a5('0x25')](respondWithResult(_0x424e85,null))[_0xe3a5('0x49')](handleError(_0x424e85,null));};exports[_0xe3a5('0x24')]=function(_0xb39ebf,_0x4005c1){return db[_0xe3a5('0x2d')][_0xe3a5('0x47')]({'where':{'id':_0xb39ebf['params']['id']}})[_0xe3a5('0x25')](handleEntityNotFound(_0x4005c1,null))[_0xe3a5('0x25')](removeEntity(_0x4005c1,null))[_0xe3a5('0x49')](handleError(_0x4005c1,null));};exports[_0xe3a5('0x4c')]=function(_0x40b271,_0x356a05){return db[_0xe3a5('0x2d')][_0xe3a5('0x4c')]()[_0xe3a5('0x25')](respondWithResult(_0x356a05,null))[_0xe3a5('0x49')](handleError(_0x356a05,null));}; \ No newline at end of file +var _0x7aa0=['jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceDialReport','include','findAll','rows','catch','show','params','intersection','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x19dbf6,_0x51ea26){var _0x49f053=function(_0x9eff2){while(--_0x9eff2){_0x19dbf6['push'](_0x19dbf6['shift']());}};_0x49f053(++_0x51ea26);}(_0x7aa0,0x1b9));var _0x07aa=function(_0x2bcc41,_0x5829ae){_0x2bcc41=_0x2bcc41-0x0;var _0x36bd2d=_0x7aa0[_0x2bcc41];return _0x36bd2d;};'use strict';var pdf=require(_0x07aa('0x0'));var emlformat=require(_0x07aa('0x1'));var rimraf=require(_0x07aa('0x2'));var zipdir=require(_0x07aa('0x3'));var jsonpatch=require(_0x07aa('0x4'));var rp=require('request-promise');var moment=require(_0x07aa('0x5'));var BPromise=require(_0x07aa('0x6'));var Mustache=require(_0x07aa('0x7'));var util=require(_0x07aa('0x8'));var path=require(_0x07aa('0x9'));var sox=require(_0x07aa('0xa'));var csv=require('to-csv');var ejs=require(_0x07aa('0xb'));var fs=require('fs');var _=require(_0x07aa('0xc'));var squel=require(_0x07aa('0xd'));var crypto=require(_0x07aa('0xe'));var jsforce=require(_0x07aa('0xf'));var deskjs=require(_0x07aa('0x10'));var toCsv=require(_0x07aa('0x11'));var querystring=require(_0x07aa('0x12'));var Papa=require('papaparse');var Redis=require(_0x07aa('0x13'));var authService=require(_0x07aa('0x14'));var qs=require(_0x07aa('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x07aa('0x16'));var logger=require(_0x07aa('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x07aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b3aa7,_0x1009d5){_0x1009d5=_0x1009d5||0xcc;return function(_0x535faa){if(_0x535faa){return _0x1b3aa7[_0x07aa('0x19')](_0x1009d5);}return _0x1b3aa7['status'](_0x1009d5)[_0x07aa('0x1a')]();};}function respondWithResult(_0x2cb68a,_0x54047d){_0x54047d=_0x54047d||0xc8;return function(_0x99f53c){if(_0x99f53c){return _0x2cb68a['status'](_0x54047d)['json'](_0x99f53c);}};}function respondWithFilteredResult(_0x260060,_0x36cac4){return function(_0x1034ec){if(_0x1034ec){var _0x18e93e=_0x1034ec[_0x07aa('0x1b')],_0x2c1e3b=_0x36cac4[_0x07aa('0x1c')],_0x5a13d4=_0x36cac4[_0x07aa('0x1c')]+_0x36cac4[_0x07aa('0x1d')],_0x388efc;if(_0x5a13d4>=_0x18e93e){_0x5a13d4=_0x18e93e;_0x388efc=0xc8;}else{_0x388efc=0xce;}_0x260060[_0x07aa('0x1e')](_0x388efc);return _0x260060['set'](_0x07aa('0x1f'),_0x2c1e3b+'-'+_0x5a13d4+'/'+_0x18e93e)[_0x07aa('0x20')](_0x1034ec);}return null;};}function patchUpdates(_0x2c5dde){return function(_0x15a257){try{jsonpatch[_0x07aa('0x21')](_0x15a257,_0x2c5dde,!![]);}catch(_0x363e06){return BPromise[_0x07aa('0x22')](_0x363e06);}return _0x15a257[_0x07aa('0x23')]();};}function saveUpdates(_0x3cdc98,_0x1514c5){return function(_0x3b67c9){if(_0x3b67c9){return _0x3b67c9[_0x07aa('0x24')](_0x3cdc98)[_0x07aa('0x25')](function(_0x513471){return _0x513471;});}return null;};}function removeEntity(_0x53e1c7,_0x3b4a66){return function(_0x403b64){if(_0x403b64){return _0x403b64[_0x07aa('0x26')]()[_0x07aa('0x25')](function(){_0x53e1c7[_0x07aa('0x1e')](0xcc)[_0x07aa('0x1a')]();});}};}function handleEntityNotFound(_0x6453e7,_0x5ed7fd){return function(_0x38578f){if(!_0x38578f){_0x6453e7[_0x07aa('0x19')](0x194);}return _0x38578f;};}function handleError(_0x2ec222,_0x1b7600){_0x1b7600=_0x1b7600||0x1f4;return function(_0x540d5c){logger['error'](_0x540d5c['stack']);if(_0x540d5c['name']){delete _0x540d5c[_0x07aa('0x27')];}_0x2ec222[_0x07aa('0x1e')](_0x1b7600)[_0x07aa('0x28')](_0x540d5c);};}exports[_0x07aa('0x29')]=function(_0x223ac9,_0x54c756){var _0x22d511={},_0x1f1db2={},_0x191978={'count':0x0,'rows':[]};var _0x2c71ff=_['map'](db['VoiceDialReport'][_0x07aa('0x2a')],function(_0x2a254d){return{'name':_0x2a254d['fieldName'],'type':_0x2a254d['type'][_0x07aa('0x2b')]};});_0x1f1db2[_0x07aa('0x2c')]=_[_0x07aa('0x2d')](_0x2c71ff,_0x07aa('0x27'));_0x1f1db2[_0x07aa('0x2e')]=_[_0x07aa('0x2f')](_0x223ac9[_0x07aa('0x2e')]);_0x1f1db2[_0x07aa('0x30')]=_['intersection'](_0x1f1db2['model'],_0x1f1db2[_0x07aa('0x2e')]);_0x22d511[_0x07aa('0x31')]=_['intersection'](_0x1f1db2[_0x07aa('0x2c')],qs[_0x07aa('0x32')](_0x223ac9[_0x07aa('0x2e')][_0x07aa('0x32')]));_0x22d511[_0x07aa('0x31')]=_0x22d511['attributes'][_0x07aa('0x33')]?_0x22d511[_0x07aa('0x31')]:_0x1f1db2[_0x07aa('0x2c')];if(!_0x223ac9[_0x07aa('0x2e')][_0x07aa('0x34')](_0x07aa('0x35'))){_0x22d511[_0x07aa('0x1d')]=qs[_0x07aa('0x1d')](_0x223ac9[_0x07aa('0x2e')][_0x07aa('0x1d')]);_0x22d511[_0x07aa('0x1c')]=qs[_0x07aa('0x1c')](_0x223ac9[_0x07aa('0x2e')]['offset']);}_0x22d511[_0x07aa('0x36')]=qs[_0x07aa('0x37')](_0x223ac9[_0x07aa('0x2e')]['sort']);_0x22d511[_0x07aa('0x38')]=qs[_0x07aa('0x30')](_[_0x07aa('0x39')](_0x223ac9[_0x07aa('0x2e')],_0x1f1db2[_0x07aa('0x30')]),_0x2c71ff);if(_0x223ac9[_0x07aa('0x2e')][_0x07aa('0x3a')]){_0x22d511[_0x07aa('0x38')]=_[_0x07aa('0x3b')](_0x22d511['where'],{'$or':_[_0x07aa('0x2d')](_0x2c71ff,function(_0x1c481d){if(_0x1c481d[_0x07aa('0x3c')]!==_0x07aa('0x3d')){var _0x5c64c6={};_0x5c64c6[_0x1c481d[_0x07aa('0x27')]]={'$like':'%'+_0x223ac9['query'][_0x07aa('0x3a')]+'%'};return _0x5c64c6;}})});}_0x22d511=_['merge']({},_0x22d511,_0x223ac9[_0x07aa('0x3e')]);var _0x347361={'where':_0x22d511[_0x07aa('0x38')]};return db[_0x07aa('0x3f')]['count'](_0x347361)[_0x07aa('0x25')](function(_0x5b48e3){_0x191978[_0x07aa('0x1b')]=_0x5b48e3;if(_0x223ac9[_0x07aa('0x2e')]['includeAll']){_0x22d511[_0x07aa('0x40')]=[{'all':!![]}];}return db[_0x07aa('0x3f')][_0x07aa('0x41')](_0x22d511);})[_0x07aa('0x25')](function(_0x4007b1){_0x191978[_0x07aa('0x42')]=_0x4007b1;return _0x191978;})[_0x07aa('0x25')](respondWithFilteredResult(_0x54c756,_0x22d511))[_0x07aa('0x43')](handleError(_0x54c756,null));};exports[_0x07aa('0x44')]=function(_0x173064,_0x4f9471){var _0x5e60a3={'raw':!![],'where':{'id':_0x173064[_0x07aa('0x45')]['id']}},_0x11cbbc={};_0x11cbbc[_0x07aa('0x2c')]=_[_0x07aa('0x2f')](db['VoiceDialReport'][_0x07aa('0x2a')]);_0x11cbbc[_0x07aa('0x2e')]=_[_0x07aa('0x2f')](_0x173064[_0x07aa('0x2e')]);_0x11cbbc[_0x07aa('0x30')]=_[_0x07aa('0x46')](_0x11cbbc[_0x07aa('0x2c')],_0x11cbbc['query']);_0x5e60a3[_0x07aa('0x31')]=_[_0x07aa('0x46')](_0x11cbbc[_0x07aa('0x2c')],qs[_0x07aa('0x32')](_0x173064['query'][_0x07aa('0x32')]));_0x5e60a3[_0x07aa('0x31')]=_0x5e60a3[_0x07aa('0x31')][_0x07aa('0x33')]?_0x5e60a3['attributes']:_0x11cbbc['model'];if(_0x173064[_0x07aa('0x2e')][_0x07aa('0x47')]){_0x5e60a3[_0x07aa('0x40')]=[{'all':!![]}];}_0x5e60a3=_['merge']({},_0x5e60a3,_0x173064[_0x07aa('0x3e')]);return db[_0x07aa('0x3f')]['find'](_0x5e60a3)[_0x07aa('0x25')](handleEntityNotFound(_0x4f9471,null))['then'](respondWithResult(_0x4f9471,null))[_0x07aa('0x43')](handleError(_0x4f9471,null));};exports[_0x07aa('0x48')]=function(_0x354ceb,_0x2ea8e7){return db['VoiceDialReport']['create'](_0x354ceb[_0x07aa('0x49')],{})[_0x07aa('0x25')](respondWithResult(_0x2ea8e7,0xc9))[_0x07aa('0x43')](handleError(_0x2ea8e7,null));};exports[_0x07aa('0x24')]=function(_0xb46e87,_0x5eaf7c){if(_0xb46e87[_0x07aa('0x49')]['id']){delete _0xb46e87[_0x07aa('0x49')]['id'];}return db[_0x07aa('0x3f')]['find']({'where':{'id':_0xb46e87['params']['id']}})[_0x07aa('0x25')](handleEntityNotFound(_0x5eaf7c,null))['then'](saveUpdates(_0xb46e87[_0x07aa('0x49')],null))[_0x07aa('0x25')](respondWithResult(_0x5eaf7c,null))['catch'](handleError(_0x5eaf7c,null));};exports[_0x07aa('0x26')]=function(_0x4d2816,_0x4012e4){return db[_0x07aa('0x3f')][_0x07aa('0x4a')]({'where':{'id':_0x4d2816[_0x07aa('0x45')]['id']}})[_0x07aa('0x25')](handleEntityNotFound(_0x4012e4,null))['then'](removeEntity(_0x4012e4,null))['catch'](handleError(_0x4012e4,null));};exports[_0x07aa('0x4b')]=function(_0x33fc90,_0x46f602){return db[_0x07aa('0x3f')]['describe']()[_0x07aa('0x25')](respondWithResult(_0x46f602,null))['catch'](handleError(_0x46f602,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 6fcd46d..391c167 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 _0x4374=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x51a6ab,_0x2a2424){var _0x219de8=function(_0x13e706){while(--_0x13e706){_0x51a6ab['push'](_0x51a6ab['shift']());}};_0x219de8(++_0x2a2424);}(_0x4374,0xef));var _0x4437=function(_0xb661df,_0x34952a){_0xb661df=_0xb661df-0x0;var _0x447ed1=_0x4374[_0xb661df];return _0x447ed1;};'use strict';var _=require(_0x4437('0x0'));var util=require(_0x4437('0x1'));var logger=require(_0x4437('0x2'))(_0x4437('0x3'));var moment=require(_0x4437('0x4'));var BPromise=require(_0x4437('0x5'));var rp=require(_0x4437('0x6'));var fs=require('fs');var path=require(_0x4437('0x7'));var rimraf=require(_0x4437('0x8'));var config=require(_0x4437('0x9'));var attributes=require(_0x4437('0xa'));module[_0x4437('0xb')]=function(_0x4db0bc,_0x474723){return _0x4db0bc['define'](_0x4437('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a0f=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x368c08,_0x13d50e){var _0x4994d8=function(_0x2015ca){while(--_0x2015ca){_0x368c08['push'](_0x368c08['shift']());}};_0x4994d8(++_0x13d50e);}(_0x7a0f,0x7d));var _0xf7a0=function(_0x32c5c7,_0xc6881f){_0x32c5c7=_0x32c5c7-0x0;var _0x4648be=_0x7a0f[_0x32c5c7];return _0x4648be;};'use strict';var _=require(_0xf7a0('0x0'));var util=require(_0xf7a0('0x1'));var logger=require(_0xf7a0('0x2'))(_0xf7a0('0x3'));var moment=require(_0xf7a0('0x4'));var BPromise=require(_0xf7a0('0x5'));var rp=require(_0xf7a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7a0('0x7'));var config=require(_0xf7a0('0x8'));var attributes=require(_0xf7a0('0x9'));module[_0xf7a0('0xa')]=function(_0x28eca1,_0x177a8d){return _0x28eca1[_0xf7a0('0xb')](_0xf7a0('0xc'),attributes,{'tableName':_0xf7a0('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf7a0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a636342..0ed2eee 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 _0xbf5c=['jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x27a5bb,_0x3f4cfb){var _0x2e17ea=function(_0x22912d){while(--_0x22912d){_0x27a5bb['push'](_0x27a5bb['shift']());}};_0x2e17ea(++_0x3f4cfb);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0xbf5c[_0x49ab20];return _0x3c10b4;};'use strict';var _=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var moment=require(_0xcbf5('0x2'));var BPromise=require('bluebird');var rs=require(_0xcbf5('0x3'));var fs=require('fs');var Redis=require(_0xcbf5('0x4'));var db=require(_0xcbf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbf5('0x6'))(_0xcbf5('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbf5('0x8'));var client=jayson[_0xcbf5('0x9')][_0xcbf5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522014,_0x4504dd,_0x31b6d1){return new BPromise(function(_0x54d2d4,_0x52f784){return client[_0xcbf5('0xb')](_0x522014,_0x31b6d1)[_0xcbf5('0xc')](function(_0x230a6c){logger['info'](_0xcbf5('0xd'),_0x4504dd,_0xcbf5('0xe'));logger[_0xcbf5('0xf')](_0xcbf5('0x10'),_0x4504dd,_0xcbf5('0xe'),JSON[_0xcbf5('0x11')](_0x230a6c));if(_0x230a6c['error']){if(_0x230a6c[_0xcbf5('0x12')][_0xcbf5('0x13')]===0x1f4){logger[_0xcbf5('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x4504dd,_0x230a6c['error'][_0xcbf5('0x14')]);return _0x52f784(_0x230a6c['error'][_0xcbf5('0x14')]);}logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x230a6c[_0xcbf5('0x12')]['message']);return _0x54d2d4(_0x230a6c['error'][_0xcbf5('0x14')]);}else{logger['info'](_0xcbf5('0xd'),_0x4504dd,'request\x20sent');_0x54d2d4(_0x230a6c['result'][_0xcbf5('0x14')]);}})[_0xcbf5('0x15')](function(_0x18753e){logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x18753e);_0x52f784(_0x18753e);});});}exports[_0xcbf5('0x16')]=function(_0x462d46){var _0x53939d=this;return new Promise(function(_0xcf3d18,_0x10d573){return db[_0xcbf5('0x17')][_0xcbf5('0x18')](_0x462d46[_0xcbf5('0x19')],{'raw':_0x462d46[_0xcbf5('0x1a')]?_0x462d46[_0xcbf5('0x1a')][_0xcbf5('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x155147){logger['info'](_0xcbf5('0x16'),_0x462d46);logger['debug'](_0xcbf5('0x16'),_0x462d46,JSON[_0xcbf5('0x11')](_0x155147));_0xcf3d18(_0x155147);})[_0xcbf5('0x15')](function(_0xf2360){logger[_0xcbf5('0x12')](_0xcbf5('0x16'),_0xf2360['message'],_0x462d46);_0x10d573(_0x53939d[_0xcbf5('0x12')](0x1f4,_0xf2360['message']));});});};exports[_0xcbf5('0x1c')]=function(_0x1b59d4){var _0x26477c=this;return new Promise(function(_0x27558a,_0x4c8d12){return db[_0xcbf5('0x17')][_0xcbf5('0x1d')](_0x1b59d4[_0xcbf5('0x19')],{'raw':_0x1b59d4[_0xcbf5('0x1a')]?_0x1b59d4[_0xcbf5('0x1a')][_0xcbf5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b59d4[_0xcbf5('0x1a')]?_0x1b59d4[_0xcbf5('0x1a')]['where']||null:null,'attributes':_0x1b59d4[_0xcbf5('0x1a')]?_0x1b59d4[_0xcbf5('0x1a')][_0xcbf5('0x1e')]||null:null,'limit':_0x1b59d4[_0xcbf5('0x1a')]?_0x1b59d4[_0xcbf5('0x1a')]['limit']||null:null})[_0xcbf5('0xc')](function(_0x367eb0){logger[_0xcbf5('0x1f')](_0xcbf5('0x1c'),_0x1b59d4);logger[_0xcbf5('0xf')](_0xcbf5('0x1c'),_0x1b59d4,JSON['stringify'](_0x367eb0));_0x27558a(_0x367eb0);})[_0xcbf5('0x15')](function(_0x399f50){logger[_0xcbf5('0x12')](_0xcbf5('0x1c'),_0x399f50[_0xcbf5('0x14')],_0x1b59d4);_0x4c8d12(_0x26477c[_0xcbf5('0x12')](0x1f4,_0x399f50[_0xcbf5('0x14')]));});});}; \ No newline at end of file +var _0x3cd1=['create','options','raw','catch','VoiceDialReport','update','body','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport'];(function(_0x49f9dd,_0x2d863a){var _0x47a33f=function(_0x486179){while(--_0x486179){_0x49f9dd['push'](_0x49f9dd['shift']());}};_0x47a33f(++_0x2d863a);}(_0x3cd1,0x112));var _0x13cd=function(_0x5a70a2,_0xf1e7f9){_0x5a70a2=_0x5a70a2-0x0;var _0x1c88fd=_0x3cd1[_0x5a70a2];return _0x1c88fd;};'use strict';var _=require('lodash');var util=require(_0x13cd('0x0'));var moment=require(_0x13cd('0x1'));var BPromise=require(_0x13cd('0x2'));var rs=require(_0x13cd('0x3'));var fs=require('fs');var Redis=require(_0x13cd('0x4'));var db=require(_0x13cd('0x5'))['db'];var utils=require(_0x13cd('0x6'));var logger=require(_0x13cd('0x7'))('rpc');var config=require(_0x13cd('0x8'));var jayson=require(_0x13cd('0x9'));var client=jayson[_0x13cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55cac0,_0x461fe5,_0x427fb0){return new BPromise(function(_0x258008,_0x64751a){return client['request'](_0x55cac0,_0x427fb0)[_0x13cd('0xb')](function(_0x334e06){logger[_0x13cd('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x461fe5,'request\x20sent');logger[_0x13cd('0xd')](_0x13cd('0xe'),_0x461fe5,_0x13cd('0xf'),JSON[_0x13cd('0x10')](_0x334e06));if(_0x334e06[_0x13cd('0x11')]){if(_0x334e06[_0x13cd('0x11')][_0x13cd('0x12')]===0x1f4){logger['error'](_0x13cd('0x13'),_0x461fe5,_0x334e06[_0x13cd('0x11')]['message']);return _0x64751a(_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);}logger[_0x13cd('0x11')](_0x13cd('0x13'),_0x461fe5,_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);return _0x258008(_0x334e06[_0x13cd('0x11')][_0x13cd('0x14')]);}else{logger['info'](_0x13cd('0x13'),_0x461fe5,'request\x20sent');_0x258008(_0x334e06[_0x13cd('0x15')][_0x13cd('0x14')]);}})['catch'](function(_0x1bd779){logger[_0x13cd('0x11')](_0x13cd('0x13'),_0x461fe5,_0x1bd779);_0x64751a(_0x1bd779);});});}exports[_0x13cd('0x16')]=function(_0x1442eb){var _0x50557f=this;return new Promise(function(_0x45b9de,_0x446a31){return db['VoiceDialReport'][_0x13cd('0x17')](_0x1442eb['body'],{'raw':_0x1442eb[_0x13cd('0x18')]?_0x1442eb[_0x13cd('0x18')][_0x13cd('0x19')]===undefined?!![]:![]:!![]})[_0x13cd('0xb')](function(_0x5d12b8){logger[_0x13cd('0xc')]('CreateVoiceDialReport',_0x1442eb);logger[_0x13cd('0xd')](_0x13cd('0x16'),_0x1442eb,JSON[_0x13cd('0x10')](_0x5d12b8));_0x45b9de(_0x5d12b8);})[_0x13cd('0x1a')](function(_0x439ba1){logger[_0x13cd('0x11')]('CreateVoiceDialReport',_0x439ba1['message'],_0x1442eb);_0x446a31(_0x50557f[_0x13cd('0x11')](0x1f4,_0x439ba1['message']));});});};exports['UpdateVoiceDialReport']=function(_0xc0503f){var _0x299b9a=this;return new Promise(function(_0x1b84c8,_0x4882ae){return db[_0x13cd('0x1b')][_0x13cd('0x1c')](_0xc0503f[_0x13cd('0x1d')],{'raw':_0xc0503f[_0x13cd('0x18')]?_0xc0503f[_0x13cd('0x18')][_0x13cd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc0503f[_0x13cd('0x18')]?_0xc0503f[_0x13cd('0x18')]['where']||null:null,'attributes':_0xc0503f[_0x13cd('0x18')]?_0xc0503f['options'][_0x13cd('0x1e')]||null:null,'limit':_0xc0503f[_0x13cd('0x18')]?_0xc0503f['options'][_0x13cd('0x1f')]||null:null})[_0x13cd('0xb')](function(_0x256628){logger[_0x13cd('0xc')](_0x13cd('0x20'),_0xc0503f);logger[_0x13cd('0xd')](_0x13cd('0x20'),_0xc0503f,JSON['stringify'](_0x256628));_0x1b84c8(_0x256628);})[_0x13cd('0x1a')](function(_0x4a674b){logger['error'](_0x13cd('0x20'),_0x4a674b['message'],_0xc0503f);_0x4882ae(_0x299b9a['error'](0x1f4,_0x4a674b[_0x13cd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 47c0d6d..5e9fee4 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 _0x5ea9=['isAuthenticated','create','addApplications','put','update','delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','/:id','post'];(function(_0x217222,_0x38c7e2){var _0x353358=function(_0x2373fa){while(--_0x2373fa){_0x217222['push'](_0x217222['shift']());}};_0x353358(++_0x38c7e2);}(_0x5ea9,0xe7));var _0x95ea=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0x5ea9[_0x51ab33];return _0x5e1298;};'use strict';var multer=require(_0x95ea('0x0'));var util=require(_0x95ea('0x1'));var path=require(_0x95ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95ea('0x3')]();var auth=require(_0x95ea('0x4'));var interaction=require(_0x95ea('0x5'));var config=require('../../config/environment');var controller=require(_0x95ea('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x95ea('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x95ea('0x8')]('/',auth[_0x95ea('0x9')](),controller[_0x95ea('0xa')]);router['post']('/:id/applications',auth[_0x95ea('0x9')](),controller[_0x95ea('0xb')]);router[_0x95ea('0xc')]('/:id',auth[_0x95ea('0x9')](),controller[_0x95ea('0xd')]);router[_0x95ea('0xe')]('/:id',auth[_0x95ea('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0c7a=['put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','post','/:id/applications','addApplications'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0c7a,0xb8));var _0xa0c7=function(_0xe51c17,_0x3dc6da){_0xe51c17=_0xe51c17-0x0;var _0x3453e3=_0x0c7a[_0xe51c17];return _0x3453e3;};'use strict';var multer=require(_0xa0c7('0x0'));var util=require('util');var path=require(_0xa0c7('0x1'));var timeout=require(_0xa0c7('0x2'));var express=require(_0xa0c7('0x3'));var router=express[_0xa0c7('0x4')]();var auth=require(_0xa0c7('0x5'));var interaction=require(_0xa0c7('0x6'));var config=require(_0xa0c7('0x7'));var controller=require('./voiceExtension.controller');router[_0xa0c7('0x8')]('/',auth[_0xa0c7('0x9')](),controller['index']);router['get'](_0xa0c7('0xa'),auth['isAuthenticated'](),controller[_0xa0c7('0xb')]);router['post']('/',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0xc')]);router[_0xa0c7('0xd')](_0xa0c7('0xe'),auth['isAuthenticated'](),controller[_0xa0c7('0xf')]);router[_0xa0c7('0x10')]('/:id',auth[_0xa0c7('0x9')](),controller[_0xa0c7('0x11')]);router['delete'](_0xa0c7('0xa'),auth[_0xa0c7('0x9')](),controller[_0xa0c7('0x12')]);module[_0xa0c7('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index b9ba76d..fdab2a1 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(_0x298a31,_0x29f9ed){var _0x1f254f=function(_0xe20666){while(--_0xe20666){_0x298a31['push'](_0x298a31['shift']());}};_0x1f254f(++_0x29f9ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x581564,_0x4b3dbc){var _0x2b9bba=function(_0x560ee4){while(--_0x560ee4){_0x581564['push'](_0x581564['shift']());}};_0x2b9bba(++_0x4b3dbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 d02b06f..1ede0ce 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 _0x4975=['rows','catch','show','body','startsWith','exten','concat','user','get','role','userProfileId','autoAssociation','error','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','params','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','includes','find','value','type','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','model','map','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x4975,0x86));var _0x5497=function(_0x391f03,_0x5d316a){_0x391f03=_0x391f03-0x0;var _0x202484=_0x4975[_0x391f03];return _0x202484;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5497('0x18')]=_[_0x5497('0x19')](config[_0x5497('0x18')],{'host':_0x5497('0x1a'),'port':0x18eb});var socket=require(_0x5497('0x1b'))(new Redis(config[_0x5497('0x18')]));require(_0x5497('0x1c'))[_0x5497('0x1d')](socket);function respondWithStatusCode(_0x363a5b,_0x1a4c74){_0x1a4c74=_0x1a4c74||0xcc;return function(_0x55f590){if(_0x55f590){return _0x363a5b[_0x5497('0x1e')](_0x1a4c74);}return _0x363a5b['status'](_0x1a4c74)[_0x5497('0x1f')]();};}function respondWithResult(_0x2bfd8a,_0x19e5f3){_0x19e5f3=_0x19e5f3||0xc8;return function(_0x3ce50b){if(_0x3ce50b){return _0x2bfd8a[_0x5497('0x20')](_0x19e5f3)[_0x5497('0x21')](_0x3ce50b);}};}function respondWithFilteredResult(_0x2f2997,_0x575f6b){return function(_0x56a788){if(_0x56a788){var _0x3f4d20=_0x56a788[_0x5497('0x22')],_0x1bf442=_0x575f6b[_0x5497('0x23')],_0x3a47fd=_0x575f6b[_0x5497('0x23')]+_0x575f6b[_0x5497('0x24')],_0x5d9e24;if(_0x3a47fd>=_0x3f4d20){_0x3a47fd=_0x3f4d20;_0x5d9e24=0xc8;}else{_0x5d9e24=0xce;}_0x2f2997[_0x5497('0x20')](_0x5d9e24);return _0x2f2997[_0x5497('0x25')](_0x5497('0x26'),_0x1bf442+'-'+_0x3a47fd+'/'+_0x3f4d20)[_0x5497('0x21')](_0x56a788);}return null;};}function patchUpdates(_0x2e3960){return function(_0x3f54ef){try{jsonpatch[_0x5497('0x27')](_0x3f54ef,_0x2e3960,!![]);}catch(_0x52c049){return BPromise[_0x5497('0x28')](_0x52c049);}return _0x3f54ef['save']();};}function saveUpdates(_0x19200a,_0xd0868d){return function(_0x44265c){if(_0x44265c){return _0x44265c[_0x5497('0x29')](_0x19200a)[_0x5497('0x2a')](function(_0x3b2fbc){return _0x3b2fbc;});}return null;};}function removeEntity(_0x5018fa,_0x54043a){return function(_0x1eefce){if(_0x1eefce){return _0x1eefce[_0x5497('0x2b')]()[_0x5497('0x2a')](function(){var _0x281155=_0x1eefce['get']({'plain':!![]});var _0x13b7a4=[{'name':'InboundRoutes','value':_0x5497('0x2c'),'ignore':![]},{'name':_0x5497('0x2d'),'value':_0x5497('0x2e'),'ignore':![]},{'name':_0x5497('0x2f'),'value':_0x5497('0x30'),'ignore':![]}];var _0x31cd01=_(_0x13b7a4)['filter'](_0x5497('0x31'))['map']('value')['value']();if(_[_0x5497('0x32')](_0x31cd01,_0x281155['type'])){return;}var _0x5e9356=_[_0x5497('0x33')](_0x13b7a4,[_0x5497('0x34'),_0x281155[_0x5497('0x35')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5e9356,'resourceId':_0x281155['id']}})[_0x5497('0x2a')](function(){return _0x1eefce;});})[_0x5497('0x2a')](function(){_0x5018fa[_0x5497('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x489f71,_0x594866){return function(_0xa28dd8){if(!_0xa28dd8){_0x489f71['sendStatus'](0x194);}return _0xa28dd8;};}function handleError(_0x438ee4,_0x258c2d){_0x258c2d=_0x258c2d||0x1f4;return function(_0x77c575){logger['error'](_0x77c575[_0x5497('0x36')]);if(_0x77c575[_0x5497('0x37')]){delete _0x77c575['name'];}_0x438ee4[_0x5497('0x20')](_0x258c2d)[_0x5497('0x38')](_0x77c575);};}exports[_0x5497('0x39')]=function(_0x489fbd,_0x3395f6){var _0x2fe1f2={},_0x125d51={},_0x362b96={'count':0x0,'rows':[]};var _0x412f5b=_['map'](db[_0x5497('0x3a')][_0x5497('0x3b')],function(_0x558a70){return{'name':_0x558a70[_0x5497('0x3c')],'type':_0x558a70[_0x5497('0x35')][_0x5497('0x3d')]};});_0x125d51[_0x5497('0x3e')]=_[_0x5497('0x3f')](_0x412f5b,_0x5497('0x37'));_0x125d51['query']=_[_0x5497('0x40')](_0x489fbd['query']);_0x125d51[_0x5497('0x41')]=_[_0x5497('0x42')](_0x125d51[_0x5497('0x3e')],_0x125d51['query']);_0x2fe1f2['attributes']=_[_0x5497('0x42')](_0x125d51[_0x5497('0x3e')],qs[_0x5497('0x43')](_0x489fbd[_0x5497('0x44')][_0x5497('0x43')]));_0x2fe1f2[_0x5497('0x45')]=_0x2fe1f2['attributes'][_0x5497('0x46')]?_0x2fe1f2[_0x5497('0x45')]:_0x125d51[_0x5497('0x3e')];if(!_0x489fbd[_0x5497('0x44')][_0x5497('0x47')](_0x5497('0x48'))){_0x2fe1f2[_0x5497('0x24')]=qs[_0x5497('0x24')](_0x489fbd[_0x5497('0x44')]['limit']);_0x2fe1f2[_0x5497('0x23')]=qs[_0x5497('0x23')](_0x489fbd[_0x5497('0x44')][_0x5497('0x23')]);}_0x2fe1f2[_0x5497('0x49')]=qs[_0x5497('0x4a')](_0x489fbd[_0x5497('0x44')]['sort']);_0x2fe1f2[_0x5497('0x4b')]=qs[_0x5497('0x41')](_[_0x5497('0x4c')](_0x489fbd[_0x5497('0x44')],_0x125d51[_0x5497('0x41')]),_0x412f5b);if(_0x489fbd[_0x5497('0x44')][_0x5497('0x4d')]){_0x2fe1f2['where']=_[_0x5497('0x4e')](_0x2fe1f2[_0x5497('0x4b')],{'$or':_[_0x5497('0x3f')](_0x412f5b,function(_0x1e6389){if(_0x1e6389[_0x5497('0x35')]!==_0x5497('0x4f')){var _0xc1a999={};_0xc1a999[_0x1e6389[_0x5497('0x37')]]={'$like':'%'+_0x489fbd[_0x5497('0x44')][_0x5497('0x4d')]+'%'};return _0xc1a999;}})});}_0x2fe1f2=_['merge']({},_0x2fe1f2,_0x489fbd[_0x5497('0x50')]);var _0x4a9fd7={'where':_0x2fe1f2[_0x5497('0x4b')]};return db[_0x5497('0x3a')][_0x5497('0x22')](_0x4a9fd7)[_0x5497('0x2a')](function(_0x133746){_0x362b96['count']=_0x133746;if(_0x489fbd[_0x5497('0x44')][_0x5497('0x51')]){_0x2fe1f2['include']=[{'all':!![]}];}return db[_0x5497('0x3a')]['findAll'](_0x2fe1f2);})[_0x5497('0x2a')](function(_0x4aa6b8){_0x362b96[_0x5497('0x52')]=_0x4aa6b8;return _0x362b96;})[_0x5497('0x2a')](respondWithFilteredResult(_0x3395f6,_0x2fe1f2))[_0x5497('0x53')](handleError(_0x3395f6,null));};exports[_0x5497('0x54')]=function(_0xbf2f0,_0x5bf06d){var _0x495068={'raw':![],'where':{'id':_0xbf2f0['params']['id']}},_0x498de5={};_0x498de5[_0x5497('0x3e')]=_[_0x5497('0x40')](db[_0x5497('0x3a')][_0x5497('0x3b')]);_0x498de5[_0x5497('0x44')]=_[_0x5497('0x40')](_0xbf2f0[_0x5497('0x44')]);_0x498de5[_0x5497('0x41')]=_[_0x5497('0x42')](_0x498de5['model'],_0x498de5[_0x5497('0x44')]);_0x495068[_0x5497('0x45')]=_[_0x5497('0x42')](_0x498de5['model'],qs[_0x5497('0x43')](_0xbf2f0['query'][_0x5497('0x43')]));_0x495068[_0x5497('0x45')]=_0x495068[_0x5497('0x45')]['length']?_0x495068[_0x5497('0x45')]:_0x498de5[_0x5497('0x3e')];if(_0xbf2f0['query'][_0x5497('0x51')]){_0x495068['include']=[{'all':!![]}];}_0x495068=_[_0x5497('0x4e')]({},_0x495068,_0xbf2f0['options']);return db[_0x5497('0x3a')][_0x5497('0x33')](_0x495068)[_0x5497('0x2a')](handleEntityNotFound(_0x5bf06d,null))[_0x5497('0x2a')](respondWithResult(_0x5bf06d,null))[_0x5497('0x53')](handleError(_0x5bf06d,null));};exports[_0x5497('0x2b')]=function(_0x6583f1,_0x2a6e4d){return db['VoiceExtension'][_0x5497('0x33')]({'where':{'id':_0x6583f1['params']['id']}})['then'](handleEntityNotFound(_0x2a6e4d,null))[_0x5497('0x2a')](removeEntity(_0x2a6e4d,null))[_0x5497('0x53')](handleError(_0x2a6e4d,null));};exports['create']=function(_0x2ddccd,_0x3df816){if(_0x2ddccd[_0x5497('0x55')][_0x5497('0x35')]==='outbound'&&!_[_0x5497('0x56')](_0x2ddccd['body']['exten'],'_')){_0x2ddccd[_0x5497('0x55')][_0x5497('0x57')]='_'[_0x5497('0x58')](_0x2ddccd['body']['exten']);}return db[_0x5497('0x3a')]['create'](_0x2ddccd[_0x5497('0x55')],{'raw':![]})['then'](function(_0x3f50ae){var _0x5b9e57=_0x2ddccd[_0x5497('0x59')][_0x5497('0x5a')]({'plain':!![]});if(!_0x5b9e57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b9e57[_0x5497('0x5b')]==='user'){var _0x506d69=_0x3f50ae[_0x5497('0x5a')]({'plain':!![]});var _0x5541b4=[{'name':'InboundRoutes','value':_0x5497('0x2c')},{'name':_0x5497('0x2d'),'value':_0x5497('0x2e')},{'name':_0x5497('0x2f'),'value':_0x5497('0x30')}];var _0x25c75e=_['find'](_0x5541b4,[_0x5497('0x34'),_0x506d69['type']])['name'];return db['UserProfileSection'][_0x5497('0x33')]({'where':{'name':_0x25c75e,'userProfileId':_0x5b9e57[_0x5497('0x5c')]},'raw':!![]})[_0x5497('0x2a')](function(_0x544085){if(_0x544085&&_0x544085[_0x5497('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x506d69[_0x5497('0x37')],'resourceId':_0x506d69['id'],'type':_0x544085[_0x5497('0x37')],'sectionId':_0x544085['id']},{})[_0x5497('0x2a')](function(){return _0x3f50ae;});}else{return _0x3f50ae;}})[_0x5497('0x53')](function(_0x3afcf8){logger[_0x5497('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3afcf8);throw _0x3afcf8;});}return _0x3f50ae;})[_0x5497('0x2a')](respondWithResult(_0x3df816,0xc9))[_0x5497('0x53')](handleError(_0x3df816,null));};exports[_0x5497('0x29')]=function(_0xc783ce,_0x4b86a8){if(_0xc783ce[_0x5497('0x55')]['id']){delete _0xc783ce[_0x5497('0x55')]['id'];}return db[_0x5497('0x3a')][_0x5497('0x33')]({'where':{'id':_0xc783ce['params']['id']}})[_0x5497('0x2a')](handleEntityNotFound(_0x4b86a8,null))[_0x5497('0x2a')](function(_0x1516c8){if(_0x1516c8){return db['VoiceExtension'][_0x5497('0x29')](_['pick'](_0xc783ce['body'],['exten',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61'),'cutdigits',_0x5497('0x62')]),{'where':{'context':_0x1516c8[_0x5497('0x5f')],'exten':_0x1516c8[_0x5497('0x57')]},'individualHooks':!![]})[_0x5497('0x2a')](function(_0x4fec68){return _0x4fec68;});}return null;})[_0x5497('0x2a')](respondWithStatusCode(_0x4b86a8,null))[_0x5497('0x53')](handleError(_0x4b86a8,null));};exports[_0x5497('0x63')]=function(_0x49617c,_0x164de1,_0x465bed){return db[_0x5497('0x3a')][_0x5497('0x64')]({'where':{'id':_0x49617c[_0x5497('0x65')]['id']}})[_0x5497('0x2a')](handleEntityNotFound(_0x164de1,null))[_0x5497('0x2a')](function(_0x4b4cfe){if(_0x4b4cfe){return db[_0x5497('0x66')][_0x5497('0x67')](function(_0x32a5bf){return db[_0x5497('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x49617c['params']['id']},'transaction':_0x32a5bf})['then'](function(_0x305d5b){var _0x1d1405=_[_0x5497('0x3f')](_0x49617c['body'],function(_0xc7fa29){_0xc7fa29[_0x5497('0x68')]=_0x49617c[_0x5497('0x65')]['id'];return _0xc7fa29;});return db[_0x5497('0x3a')][_0x5497('0x69')](_0x1d1405,{'transaction':_0x32a5bf});});})[_0x5497('0x2a')](function(){return db[_0x5497('0x3a')][_0x5497('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x49617c[_0x5497('0x65')]['id']},'order':_0x5497('0x6b')});});}})[_0x5497('0x2a')](respondWithResult(_0x164de1,null))['catch'](handleError(_0x164de1,null));}; \ No newline at end of file +var _0x687b=['html-pdf','eml-format','rimraf','zip-dir','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','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','show','params','catch','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','context','description','cutdigits','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)'];(function(_0x53beed,_0x425446){var _0x13a363=function(_0x11143f){while(--_0x11143f){_0x53beed['push'](_0x53beed['shift']());}};_0x13a363(++_0x425446);}(_0x687b,0x14a));var _0xb687=function(_0x54e335,_0x6b782d){_0x54e335=_0x54e335-0x0;var _0x5be44a=_0x687b[_0x54e335];return _0x5be44a;};'use strict';var pdf=require(_0xb687('0x0'));var emlformat=require(_0xb687('0x1'));var rimraf=require(_0xb687('0x2'));var zipdir=require(_0xb687('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb687('0x4'));var BPromise=require(_0xb687('0x5'));var Mustache=require(_0xb687('0x6'));var util=require(_0xb687('0x7'));var path=require(_0xb687('0x8'));var sox=require(_0xb687('0x9'));var csv=require(_0xb687('0xa'));var ejs=require(_0xb687('0xb'));var fs=require('fs');var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var db=require(_0xb687('0x1a'))['db'];config[_0xb687('0x1b')]=_[_0xb687('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb687('0x1d'))(new Redis(config[_0xb687('0x1b')]));require('./voiceExtension.socket')[_0xb687('0x1e')](socket);function respondWithStatusCode(_0x2f1ac0,_0x1f1f35){_0x1f1f35=_0x1f1f35||0xcc;return function(_0x30d502){if(_0x30d502){return _0x2f1ac0[_0xb687('0x1f')](_0x1f1f35);}return _0x2f1ac0[_0xb687('0x20')](_0x1f1f35)[_0xb687('0x21')]();};}function respondWithResult(_0x141375,_0x263085){_0x263085=_0x263085||0xc8;return function(_0x2c7a18){if(_0x2c7a18){return _0x141375[_0xb687('0x20')](_0x263085)[_0xb687('0x22')](_0x2c7a18);}};}function respondWithFilteredResult(_0x4f0fdb,_0x214b06){return function(_0x328301){if(_0x328301){var _0x30d370=_0x328301[_0xb687('0x23')],_0x5eb9b9=_0x214b06[_0xb687('0x24')],_0x48958d=_0x214b06['offset']+_0x214b06[_0xb687('0x25')],_0x12eff1;if(_0x48958d>=_0x30d370){_0x48958d=_0x30d370;_0x12eff1=0xc8;}else{_0x12eff1=0xce;}_0x4f0fdb['status'](_0x12eff1);return _0x4f0fdb[_0xb687('0x26')](_0xb687('0x27'),_0x5eb9b9+'-'+_0x48958d+'/'+_0x30d370)[_0xb687('0x22')](_0x328301);}return null;};}function patchUpdates(_0x44bd0b){return function(_0x49d5a1){try{jsonpatch[_0xb687('0x28')](_0x49d5a1,_0x44bd0b,!![]);}catch(_0x58e83c){return BPromise[_0xb687('0x29')](_0x58e83c);}return _0x49d5a1[_0xb687('0x2a')]();};}function saveUpdates(_0x274241,_0x546fde){return function(_0x1dc06b){if(_0x1dc06b){return _0x1dc06b[_0xb687('0x2b')](_0x274241)[_0xb687('0x2c')](function(_0x16cdcb){return _0x16cdcb;});}return null;};}function removeEntity(_0xbf6c58,_0x38866c){return function(_0xf48ba4){if(_0xf48ba4){return _0xf48ba4[_0xb687('0x2d')]()['then'](function(){var _0xf45db0=_0xf48ba4[_0xb687('0x2e')]({'plain':!![]});var _0x1c1585=[{'name':_0xb687('0x2f'),'value':_0xb687('0x30'),'ignore':![]},{'name':_0xb687('0x31'),'value':_0xb687('0x32'),'ignore':![]},{'name':_0xb687('0x33'),'value':_0xb687('0x34'),'ignore':![]}];var _0x2e6185=_(_0x1c1585)['filter'](_0xb687('0x35'))[_0xb687('0x36')](_0xb687('0x37'))[_0xb687('0x37')]();if(_[_0xb687('0x38')](_0x2e6185,_0xf45db0[_0xb687('0x39')])){return;}var _0x4e9a06=_[_0xb687('0x3a')](_0x1c1585,['value',_0xf45db0[_0xb687('0x39')]])[_0xb687('0x3b')];return db[_0xb687('0x3c')][_0xb687('0x2d')]({'where':{'type':_0x4e9a06,'resourceId':_0xf45db0['id']}})[_0xb687('0x2c')](function(){return _0xf48ba4;});})[_0xb687('0x2c')](function(){_0xbf6c58[_0xb687('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da2be,_0xe3428f){return function(_0x3c08ab){if(!_0x3c08ab){_0x3da2be[_0xb687('0x1f')](0x194);}return _0x3c08ab;};}function handleError(_0xa18fec,_0x263834){_0x263834=_0x263834||0x1f4;return function(_0x44be88){logger[_0xb687('0x3d')](_0x44be88[_0xb687('0x3e')]);if(_0x44be88[_0xb687('0x3b')]){delete _0x44be88[_0xb687('0x3b')];}_0xa18fec['status'](_0x263834)['send'](_0x44be88);};}exports[_0xb687('0x3f')]=function(_0xe4456,_0x24c418){var _0x32abc4={},_0x4fc44a={},_0x4f0b28={'count':0x0,'rows':[]};var _0x1ccc25=_[_0xb687('0x36')](db['VoiceExtension'][_0xb687('0x40')],function(_0x449074){return{'name':_0x449074['fieldName'],'type':_0x449074[_0xb687('0x39')]['key']};});_0x4fc44a[_0xb687('0x41')]=_[_0xb687('0x36')](_0x1ccc25,_0xb687('0x3b'));_0x4fc44a[_0xb687('0x42')]=_[_0xb687('0x43')](_0xe4456[_0xb687('0x42')]);_0x4fc44a['filters']=_[_0xb687('0x44')](_0x4fc44a[_0xb687('0x41')],_0x4fc44a[_0xb687('0x42')]);_0x32abc4[_0xb687('0x45')]=_['intersection'](_0x4fc44a[_0xb687('0x41')],qs[_0xb687('0x46')](_0xe4456[_0xb687('0x42')][_0xb687('0x46')]));_0x32abc4[_0xb687('0x45')]=_0x32abc4['attributes'][_0xb687('0x47')]?_0x32abc4[_0xb687('0x45')]:_0x4fc44a[_0xb687('0x41')];if(!_0xe4456[_0xb687('0x42')][_0xb687('0x48')](_0xb687('0x49'))){_0x32abc4['limit']=qs['limit'](_0xe4456[_0xb687('0x42')]['limit']);_0x32abc4[_0xb687('0x24')]=qs[_0xb687('0x24')](_0xe4456['query'][_0xb687('0x24')]);}_0x32abc4[_0xb687('0x4a')]=qs['sort'](_0xe4456[_0xb687('0x42')][_0xb687('0x4b')]);_0x32abc4[_0xb687('0x4c')]=qs['filters'](_[_0xb687('0x4d')](_0xe4456[_0xb687('0x42')],_0x4fc44a[_0xb687('0x4e')]),_0x1ccc25);if(_0xe4456[_0xb687('0x42')][_0xb687('0x4f')]){_0x32abc4[_0xb687('0x4c')]=_[_0xb687('0x50')](_0x32abc4['where'],{'$or':_[_0xb687('0x36')](_0x1ccc25,function(_0x4cf6ad){if(_0x4cf6ad['type']!==_0xb687('0x51')){var _0x430364={};_0x430364[_0x4cf6ad['name']]={'$like':'%'+_0xe4456[_0xb687('0x42')]['filter']+'%'};return _0x430364;}})});}_0x32abc4=_[_0xb687('0x50')]({},_0x32abc4,_0xe4456[_0xb687('0x52')]);var _0x5c89a3={'where':_0x32abc4[_0xb687('0x4c')]};return db[_0xb687('0x53')]['count'](_0x5c89a3)[_0xb687('0x2c')](function(_0x8e259e){_0x4f0b28[_0xb687('0x23')]=_0x8e259e;if(_0xe4456[_0xb687('0x42')][_0xb687('0x54')]){_0x32abc4[_0xb687('0x55')]=[{'all':!![]}];}return db[_0xb687('0x53')][_0xb687('0x56')](_0x32abc4);})[_0xb687('0x2c')](function(_0x41a3e5){_0x4f0b28[_0xb687('0x57')]=_0x41a3e5;return _0x4f0b28;})[_0xb687('0x2c')](respondWithFilteredResult(_0x24c418,_0x32abc4))['catch'](handleError(_0x24c418,null));};exports[_0xb687('0x58')]=function(_0x524853,_0x3da453){var _0x1edb1a={'raw':![],'where':{'id':_0x524853[_0xb687('0x59')]['id']}},_0x3761d6={};_0x3761d6[_0xb687('0x41')]=_[_0xb687('0x43')](db['VoiceExtension']['rawAttributes']);_0x3761d6[_0xb687('0x42')]=_[_0xb687('0x43')](_0x524853[_0xb687('0x42')]);_0x3761d6[_0xb687('0x4e')]=_['intersection'](_0x3761d6[_0xb687('0x41')],_0x3761d6[_0xb687('0x42')]);_0x1edb1a[_0xb687('0x45')]=_[_0xb687('0x44')](_0x3761d6['model'],qs[_0xb687('0x46')](_0x524853[_0xb687('0x42')][_0xb687('0x46')]));_0x1edb1a[_0xb687('0x45')]=_0x1edb1a['attributes']['length']?_0x1edb1a[_0xb687('0x45')]:_0x3761d6[_0xb687('0x41')];if(_0x524853[_0xb687('0x42')]['includeAll']){_0x1edb1a['include']=[{'all':!![]}];}_0x1edb1a=_[_0xb687('0x50')]({},_0x1edb1a,_0x524853[_0xb687('0x52')]);return db[_0xb687('0x53')][_0xb687('0x3a')](_0x1edb1a)[_0xb687('0x2c')](handleEntityNotFound(_0x3da453,null))[_0xb687('0x2c')](respondWithResult(_0x3da453,null))[_0xb687('0x5a')](handleError(_0x3da453,null));};exports[_0xb687('0x2d')]=function(_0x543083,_0xe39007){return db[_0xb687('0x53')][_0xb687('0x3a')]({'where':{'id':_0x543083['params']['id']}})['then'](handleEntityNotFound(_0xe39007,null))['then'](removeEntity(_0xe39007,null))['catch'](handleError(_0xe39007,null));};exports[_0xb687('0x5b')]=function(_0x17b991,_0x1bea6f){if(_0x17b991[_0xb687('0x5c')][_0xb687('0x39')]===_0xb687('0x32')&&!_[_0xb687('0x5d')](_0x17b991[_0xb687('0x5c')][_0xb687('0x5e')],'_')){_0x17b991[_0xb687('0x5c')][_0xb687('0x5e')]='_'[_0xb687('0x5f')](_0x17b991[_0xb687('0x5c')][_0xb687('0x5e')]);}return db[_0xb687('0x53')][_0xb687('0x5b')](_0x17b991[_0xb687('0x5c')],{'raw':![]})['then'](function(_0x58670a){var _0x1ebbca=_0x17b991[_0xb687('0x60')][_0xb687('0x2e')]({'plain':!![]});if(!_0x1ebbca)throw new Error(_0xb687('0x61'));if(_0x1ebbca['role']===_0xb687('0x60')){var _0x37feb8=_0x58670a['get']({'plain':!![]});var _0x115d14=[{'name':'InboundRoutes','value':_0xb687('0x30')},{'name':_0xb687('0x31'),'value':'outbound'},{'name':'InternalRoutes','value':_0xb687('0x34')}];var _0x4ab9c5=_['find'](_0x115d14,[_0xb687('0x37'),_0x37feb8[_0xb687('0x39')]])[_0xb687('0x3b')];return db['UserProfileSection'][_0xb687('0x3a')]({'where':{'name':_0x4ab9c5,'userProfileId':_0x1ebbca['userProfileId']},'raw':!![]})[_0xb687('0x2c')](function(_0x1a31f6){if(_0x1a31f6&&_0x1a31f6[_0xb687('0x62')]===0x0){return db[_0xb687('0x3c')][_0xb687('0x5b')]({'name':_0x37feb8['name'],'resourceId':_0x37feb8['id'],'type':_0x1a31f6['name'],'sectionId':_0x1a31f6['id']},{})[_0xb687('0x2c')](function(){return _0x58670a;});}else{return _0x58670a;}})['catch'](function(_0x5362ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5362ea);throw _0x5362ea;});}return _0x58670a;})[_0xb687('0x2c')](respondWithResult(_0x1bea6f,0xc9))[_0xb687('0x5a')](handleError(_0x1bea6f,null));};exports[_0xb687('0x2b')]=function(_0x4bc18f,_0x3afcf3){if(_0x4bc18f[_0xb687('0x5c')]['id']){delete _0x4bc18f[_0xb687('0x5c')]['id'];}return db[_0xb687('0x53')][_0xb687('0x3a')]({'where':{'id':_0x4bc18f[_0xb687('0x59')]['id']}})[_0xb687('0x2c')](handleEntityNotFound(_0x3afcf3,null))['then'](function(_0x56c4f6){if(_0x56c4f6){return db[_0xb687('0x53')]['update'](_[_0xb687('0x4d')](_0x4bc18f[_0xb687('0x5c')],[_0xb687('0x5e'),_0xb687('0x63'),_0xb687('0x64'),'recordingFormat',_0xb687('0x65'),'mandatoryDisposition']),{'where':{'context':_0x56c4f6[_0xb687('0x63')],'exten':_0x56c4f6[_0xb687('0x5e')]},'individualHooks':!![]})[_0xb687('0x2c')](function(_0x24f42b){return _0x24f42b;});}return null;})[_0xb687('0x2c')](respondWithStatusCode(_0x3afcf3,null))[_0xb687('0x5a')](handleError(_0x3afcf3,null));};exports[_0xb687('0x66')]=function(_0x5deb7a,_0x28a6aa,_0x31ed20){return db[_0xb687('0x53')][_0xb687('0x67')]({'where':{'id':_0x5deb7a[_0xb687('0x59')]['id']}})['then'](handleEntityNotFound(_0x28a6aa,null))[_0xb687('0x2c')](function(_0x2f892){if(_0x2f892){return db[_0xb687('0x68')][_0xb687('0x69')](function(_0x2f88c2){return db[_0xb687('0x53')][_0xb687('0x2d')]({'where':{'VoiceExtensionId':_0x5deb7a[_0xb687('0x59')]['id']},'transaction':_0x2f88c2})[_0xb687('0x2c')](function(_0x249d39){var _0x1c167c=_['map'](_0x5deb7a[_0xb687('0x5c')],function(_0x2b6a95){_0x2b6a95[_0xb687('0x6a')]=_0x5deb7a[_0xb687('0x59')]['id'];return _0x2b6a95;});return db['VoiceExtension'][_0xb687('0x6b')](_0x1c167c,{'transaction':_0x2f88c2});});})[_0xb687('0x2c')](function(){return db['VoiceExtension'][_0xb687('0x6c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5deb7a[_0xb687('0x59')]['id']},'order':_0xb687('0x6d')});});}})['then'](respondWithResult(_0x28a6aa,null))[_0xb687('0x5a')](handleError(_0x28a6aa,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b326630..dd413a8 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 _0x396a=['events','VoiceExtension','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x3ac721,_0x10551c){var _0x3027b4=function(_0x4dd9c2){while(--_0x4dd9c2){_0x3ac721['push'](_0x3ac721['shift']());}};_0x3027b4(++_0x10551c);}(_0x396a,0x129));var _0xa396=function(_0x4a9bdd,_0x5098f5){_0x4a9bdd=_0x4a9bdd-0x0;var _0x1ba3a4=_0x396a[_0x4a9bdd];return _0x1ba3a4;};'use strict';var EventEmitter=require(_0xa396('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa396('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa396('0x2')](0x0);var events={'afterCreate':_0xa396('0x3'),'afterUpdate':_0xa396('0x4'),'afterDestroy':_0xa396('0x5')};function emitEvent(_0x2245cb){return function(_0x11001f,_0x204e24,_0x2becb2){VoiceExtensionEvents['emit'](_0x2245cb+':'+_0x11001f['id'],_0x11001f);VoiceExtensionEvents[_0xa396('0x6')](_0x2245cb,_0x11001f);_0x2becb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xa396('0x7')](e,emitEvent(event));}}module[_0xa396('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xc94e=['save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceExtension'];(function(_0x5443ac,_0x2cb686){var _0x2e4780=function(_0x54addf){while(--_0x54addf){_0x5443ac['push'](_0x5443ac['shift']());}};_0x2e4780(++_0x2cb686);}(_0xc94e,0x11e));var _0xec94=function(_0x35fab3,_0x5287ba){_0x35fab3=_0x35fab3-0x0;var _0x251ff2=_0xc94e[_0x35fab3];return _0x251ff2;};'use strict';var EventEmitter=require(_0xec94('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xec94('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xec94('0x2'),'afterUpdate':_0xec94('0x3'),'afterDestroy':_0xec94('0x4')};function emitEvent(_0x2e0256){return function(_0x461a43,_0x48bf08,_0x3817bd){VoiceExtensionEvents[_0xec94('0x5')](_0x2e0256+':'+_0x461a43['id'],_0x461a43);VoiceExtensionEvents['emit'](_0x2e0256,_0x461a43);_0x3817bd(null);};}for(var e in events){if(events[_0xec94('0x6')](e)){var event=events[e];VoiceExtension[_0xec94('0x7')](e,emitEvent(event));}}module[_0xec94('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 01449e6..f64752c 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 _0x1203=['moment','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x1b9cd5,_0x103dc4){var _0x4c74ca=function(_0x460b5e){while(--_0x460b5e){_0x1b9cd5['push'](_0x1b9cd5['shift']());}};_0x4c74ca(++_0x103dc4);}(_0x1203,0x11c));var _0x3120=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1203[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var logger=require(_0x3120('0x2'))(_0x3120('0x3'));var moment=require(_0x3120('0x4'));var BPromise=require(_0x3120('0x5'));var rp=require(_0x3120('0x6'));var fs=require('fs');var path=require(_0x3120('0x7'));var rimraf=require('rimraf');var config=require(_0x3120('0x8'));var attributes=require(_0x3120('0x9'));module[_0x3120('0xa')]=function(_0x5583a8,_0x3e7ee8){return _0x5583a8[_0x3120('0xb')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0918=['rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x27711b,_0x4fe0ba){var _0x54d6bd=function(_0x494fc9){while(--_0x494fc9){_0x27711b['push'](_0x27711b['shift']());}};_0x54d6bd(++_0x4fe0ba);}(_0x0918,0x11f));var _0x8091=function(_0x1a90a4,_0x407549){_0x1a90a4=_0x1a90a4-0x0;var _0x5803c2=_0x0918[_0x1a90a4];return _0x5803c2;};'use strict';var _=require(_0x8091('0x0'));var util=require(_0x8091('0x1'));var logger=require(_0x8091('0x2'))(_0x8091('0x3'));var moment=require(_0x8091('0x4'));var BPromise=require('bluebird');var rp=require(_0x8091('0x5'));var fs=require('fs');var path=require(_0x8091('0x6'));var rimraf=require(_0x8091('0x7'));var config=require(_0x8091('0x8'));var attributes=require(_0x8091('0x9'));module[_0x8091('0xa')]=function(_0x16597e,_0x32d87a){return _0x16597e[_0x8091('0xb')](_0x8091('0xc'),attributes,{'tableName':_0x8091('0xd'),'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 351dad8..9a694b3 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 _0x5003=['info','result','catch','GetVoiceExtension','findAll','options','attributes','map','include','model','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2dd74c,_0x4a1cd0){var _0x455608=function(_0x3b1877){while(--_0x3b1877){_0x2dd74c['push'](_0x2dd74c['shift']());}};_0x455608(++_0x4a1cd0);}(_0x5003,0x8e));var _0x3500=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5003[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3500('0x0'));var BPromise=require(_0x3500('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3500('0x2'));var db=require(_0x3500('0x3'))['db'];var utils=require(_0x3500('0x4'));var logger=require(_0x3500('0x5'))(_0x3500('0x6'));var config=require(_0x3500('0x7'));var jayson=require(_0x3500('0x8'));var client=jayson[_0x3500('0x9')][_0x3500('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3500('0xb')],{'host':_0x3500('0xc'),'port':0x18eb});var socket=require(_0x3500('0xd'))(new Redis(config[_0x3500('0xb')]));require(_0x3500('0xe'))['register'](socket);function respondWithRpcPromise(_0x134387,_0x18d1bb,_0x4c9c9a){return new BPromise(function(_0x3fb716,_0x4bfbf4){return client[_0x3500('0xf')](_0x134387,_0x4c9c9a)[_0x3500('0x10')](function(_0x32450d){logger['info'](_0x3500('0x11'),_0x18d1bb,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x18d1bb,_0x3500('0x12'),JSON[_0x3500('0x13')](_0x32450d));if(_0x32450d[_0x3500('0x14')]){if(_0x32450d['error'][_0x3500('0x15')]===0x1f4){logger[_0x3500('0x14')](_0x3500('0x11'),_0x18d1bb,_0x32450d[_0x3500('0x14')][_0x3500('0x16')]);return _0x4bfbf4(_0x32450d[_0x3500('0x14')]['message']);}logger['error'](_0x3500('0x11'),_0x18d1bb,_0x32450d['error'][_0x3500('0x16')]);return _0x3fb716(_0x32450d[_0x3500('0x14')][_0x3500('0x16')]);}else{logger[_0x3500('0x17')](_0x3500('0x11'),_0x18d1bb,_0x3500('0x12'));_0x3fb716(_0x32450d[_0x3500('0x18')][_0x3500('0x16')]);}})[_0x3500('0x19')](function(_0x104e20){logger[_0x3500('0x14')](_0x3500('0x11'),_0x18d1bb,_0x104e20);_0x4bfbf4(_0x104e20);});});}exports[_0x3500('0x1a')]=function(_0x3b7988){var _0x16b145=this;return new Promise(function(_0x54a217,_0x5e4d54){return db['VoiceExtension'][_0x3500('0x1b')]({'raw':_0x3b7988[_0x3500('0x1c')]?_0x3b7988[_0x3500('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b7988[_0x3500('0x1c')]?_0x3b7988[_0x3500('0x1c')]['where']||null:null,'attributes':_0x3b7988[_0x3500('0x1c')]?_0x3b7988[_0x3500('0x1c')][_0x3500('0x1d')]||null:null,'limit':_0x3b7988['options']?_0x3b7988['options']['limit']||null:null,'include':_0x3b7988[_0x3500('0x1c')]?_0x3b7988[_0x3500('0x1c')]['include']?_[_0x3500('0x1e')](_0x3b7988['options'][_0x3500('0x1f')],function(_0x1c15a8){return{'model':db[_0x1c15a8[_0x3500('0x20')]],'as':_0x1c15a8['as'],'attributes':_0x1c15a8['attributes'],'include':_0x1c15a8[_0x3500('0x1f')]?_[_0x3500('0x1e')](_0x1c15a8[_0x3500('0x1f')],function(_0x353763){return{'model':db[_0x353763[_0x3500('0x20')]],'as':_0x353763['as'],'attributes':_0x353763[_0x3500('0x1d')],'include':_0x353763['include']?_[_0x3500('0x1e')](_0x353763[_0x3500('0x1f')],function(_0x2cd721){return{'model':db[_0x2cd721[_0x3500('0x20')]],'as':_0x2cd721['as'],'attributes':_0x2cd721[_0x3500('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3500('0x10')](function(_0x1c7fb5){logger[_0x3500('0x17')](_0x3500('0x1a'),_0x3b7988);logger['debug'](_0x3500('0x1a'),_0x3b7988,JSON['stringify'](_0x1c7fb5));_0x54a217(_0x1c7fb5);})['catch'](function(_0x5c4a05){logger[_0x3500('0x14')]('GetVoiceExtension',_0x5c4a05['message'],_0x3b7988);_0x5e4d54(_0x16b145['error'](0x1f4,_0x5c4a05[_0x3500('0x16')]));});});}; \ No newline at end of file +var _0x9fd4=['map','include','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes'];(function(_0x109669,_0x1b4895){var _0x4dd5a7=function(_0x1dc91b){while(--_0x1dc91b){_0x109669['push'](_0x109669['shift']());}};_0x4dd5a7(++_0x1b4895);}(_0x9fd4,0xf1));var _0x49fd=function(_0x149b5a,_0x4bd327){_0x149b5a=_0x149b5a-0x0;var _0x3658bf=_0x9fd4[_0x149b5a];return _0x3658bf;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var moment=require('moment');var BPromise=require(_0x49fd('0x2'));var rs=require(_0x49fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49fd('0x4'))['db'];var utils=require(_0x49fd('0x5'));var logger=require(_0x49fd('0x6'))('rpc');var config=require(_0x49fd('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x49fd('0x8')]=_[_0x49fd('0x9')](config['redis'],{'host':_0x49fd('0xa'),'port':0x18eb});var socket=require(_0x49fd('0xb'))(new Redis(config[_0x49fd('0x8')]));require(_0x49fd('0xc'))[_0x49fd('0xd')](socket);function respondWithRpcPromise(_0x18258a,_0x2d21e6,_0x26c7b3){return new BPromise(function(_0x3895bd,_0x2225b8){return client[_0x49fd('0xe')](_0x18258a,_0x26c7b3)[_0x49fd('0xf')](function(_0x5e7584){logger['info'](_0x49fd('0x10'),_0x2d21e6,_0x49fd('0x11'));logger[_0x49fd('0x12')](_0x49fd('0x13'),_0x2d21e6,'request\x20sent',JSON[_0x49fd('0x14')](_0x5e7584));if(_0x5e7584[_0x49fd('0x15')]){if(_0x5e7584[_0x49fd('0x15')][_0x49fd('0x16')]===0x1f4){logger[_0x49fd('0x15')](_0x49fd('0x10'),_0x2d21e6,_0x5e7584[_0x49fd('0x15')]['message']);return _0x2225b8(_0x5e7584['error']['message']);}logger[_0x49fd('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x2d21e6,_0x5e7584[_0x49fd('0x15')][_0x49fd('0x17')]);return _0x3895bd(_0x5e7584[_0x49fd('0x15')][_0x49fd('0x17')]);}else{logger[_0x49fd('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x2d21e6,_0x49fd('0x11'));_0x3895bd(_0x5e7584['result']['message']);}})[_0x49fd('0x19')](function(_0x56b9d4){logger[_0x49fd('0x15')](_0x49fd('0x10'),_0x2d21e6,_0x56b9d4);_0x2225b8(_0x56b9d4);});});}exports[_0x49fd('0x1a')]=function(_0x396a4e){var _0x14a16f=this;return new Promise(function(_0x464fc8,_0x9437d6){return db[_0x49fd('0x1b')][_0x49fd('0x1c')]({'raw':_0x396a4e['options']?_0x396a4e[_0x49fd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x396a4e[_0x49fd('0x1d')]?_0x396a4e[_0x49fd('0x1d')]['where']||null:null,'attributes':_0x396a4e['options']?_0x396a4e[_0x49fd('0x1d')][_0x49fd('0x1e')]||null:null,'limit':_0x396a4e[_0x49fd('0x1d')]?_0x396a4e[_0x49fd('0x1d')]['limit']||null:null,'include':_0x396a4e[_0x49fd('0x1d')]?_0x396a4e[_0x49fd('0x1d')]['include']?_[_0x49fd('0x1f')](_0x396a4e['options'][_0x49fd('0x20')],function(_0x2107df){return{'model':db[_0x2107df[_0x49fd('0x21')]],'as':_0x2107df['as'],'attributes':_0x2107df[_0x49fd('0x1e')],'include':_0x2107df[_0x49fd('0x20')]?_[_0x49fd('0x1f')](_0x2107df['include'],function(_0x92b0bb){return{'model':db[_0x92b0bb[_0x49fd('0x21')]],'as':_0x92b0bb['as'],'attributes':_0x92b0bb[_0x49fd('0x1e')],'include':_0x92b0bb[_0x49fd('0x20')]?_[_0x49fd('0x1f')](_0x92b0bb[_0x49fd('0x20')],function(_0x5e8bff){return{'model':db[_0x5e8bff[_0x49fd('0x21')]],'as':_0x5e8bff['as'],'attributes':_0x5e8bff[_0x49fd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x49fd('0xf')](function(_0x366dc6){logger[_0x49fd('0x18')](_0x49fd('0x1a'),_0x396a4e);logger[_0x49fd('0x12')]('GetVoiceExtension',_0x396a4e,JSON[_0x49fd('0x14')](_0x366dc6));_0x464fc8(_0x366dc6);})[_0x49fd('0x19')](function(_0x47efd4){logger[_0x49fd('0x15')]('GetVoiceExtension',_0x47efd4[_0x49fd('0x17')],_0x396a4e);_0x9437d6(_0x14a16f[_0x49fd('0x15')](0x1f4,_0x47efd4[_0x49fd('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e7f19b8..8ee63c7 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 _0x6863=['voiceExtension:','./voiceExtension.events','save','update','emit','register','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6863,0x190));var _0x3686=function(_0x48a73e,_0x39f1ac){_0x48a73e=_0x48a73e-0x0;var _0x390c0b=_0x6863[_0x48a73e];return _0x390c0b;};'use strict';var VoiceExtensionEvents=require(_0x3686('0x0'));var events=[_0x3686('0x1'),'remove',_0x3686('0x2')];function createListener(_0x3e6a37,_0x56c519){return function(_0x2a0ba7){_0x56c519[_0x3686('0x3')](_0x3e6a37,_0x2a0ba7);};}function removeListener(_0x3ea7fa,_0x361904){return function(){VoiceExtensionEvents['removeListener'](_0x3ea7fa,_0x361904);};}exports[_0x3686('0x4')]=function(_0x306f7a){for(var _0x18b21c=0x0,_0x37fabe=events[_0x3686('0x5')];_0x18b21c<_0x37fabe;_0x18b21c++){var _0x665951=events[_0x18b21c];var _0x27d9e4=createListener(_0x3686('0x6')+_0x665951,_0x306f7a);VoiceExtensionEvents['on'](_0x665951,_0x27d9e4);}}; \ No newline at end of file +var _0x25d9=['register','length','save','remove','removeListener'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x25d9,0xd4));var _0x925d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x25d9[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x925d('0x0'),_0x925d('0x1'),'update'];function createListener(_0x56ed71,_0x1bd321){return function(_0x2befcc){_0x1bd321['emit'](_0x56ed71,_0x2befcc);};}function removeListener(_0x2b53e2,_0x55bef7){return function(){VoiceExtensionEvents[_0x925d('0x2')](_0x2b53e2,_0x55bef7);};}exports[_0x925d('0x3')]=function(_0x44ddc2){for(var _0x52b1ec=0x0,_0x1480e6=events[_0x925d('0x4')];_0x52b1ec<_0x1480e6;_0x52b1ec++){var _0x141cc1=events[_0x52b1ec];var _0x526aba=createListener('voiceExtension:'+_0x141cc1,_0x44ddc2);VoiceExtensionEvents['on'](_0x141cc1,_0x526aba);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 52e60af..5614fbb 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 _0x4554=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller'];(function(_0x166ce3,_0x1b334e){var _0x5dd2ad=function(_0x340ce8){while(--_0x340ce8){_0x166ce3['push'](_0x166ce3['shift']());}};_0x5dd2ad(++_0x1b334e);}(_0x4554,0x160));var _0x4455=function(_0x30d3d5,_0x33c0be){_0x30d3d5=_0x30d3d5-0x0;var _0x277fb6=_0x4554[_0x30d3d5];return _0x277fb6;};'use strict';var multer=require(_0x4455('0x0'));var util=require(_0x4455('0x1'));var path=require(_0x4455('0x2'));var timeout=require('connect-timeout');var express=require(_0x4455('0x3'));var router=express[_0x4455('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4455('0x5'));var config=require(_0x4455('0x6'));var controller=require(_0x4455('0x7'));router[_0x4455('0x8')]('/',auth[_0x4455('0x9')](),controller[_0x4455('0xa')]);router['get'](_0x4455('0xb'),auth[_0x4455('0x9')](),controller['show']);router[_0x4455('0x8')](_0x4455('0xc'),auth['isAuthenticated'](),controller[_0x4455('0xd')]);router[_0x4455('0xe')]('/',auth[_0x4455('0x9')](),controller[_0x4455('0xf')]);router[_0x4455('0x10')](_0x4455('0xb'),auth['isAuthenticated'](),controller[_0x4455('0x11')]);router[_0x4455('0x12')]('/:id',auth[_0x4455('0x9')](),controller[_0x4455('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9f92=['get','isAuthenticated','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4baefc,_0x388dca){var _0x193979=function(_0x3bfe0e){while(--_0x3bfe0e){_0x4baefc['push'](_0x4baefc['shift']());}};_0x193979(++_0x388dca);}(_0x9f92,0x125));var _0x29f9=function(_0x211448,_0x333996){_0x211448=_0x211448-0x0;var _0x162266=_0x9f92[_0x211448];return _0x162266;};'use strict';var multer=require(_0x29f9('0x0'));var util=require('util');var path=require(_0x29f9('0x1'));var timeout=require(_0x29f9('0x2'));var express=require(_0x29f9('0x3'));var router=express['Router']();var auth=require(_0x29f9('0x4'));var interaction=require(_0x29f9('0x5'));var config=require(_0x29f9('0x6'));var controller=require('./voiceMail.controller');router[_0x29f9('0x7')]('/',auth[_0x29f9('0x8')](),controller['index']);router[_0x29f9('0x7')](_0x29f9('0x9'),auth[_0x29f9('0x8')](),controller[_0x29f9('0xa')]);router[_0x29f9('0x7')](_0x29f9('0xb'),auth[_0x29f9('0x8')](),controller[_0x29f9('0xc')]);router[_0x29f9('0xd')]('/',auth[_0x29f9('0x8')](),controller[_0x29f9('0xe')]);router[_0x29f9('0xf')](_0x29f9('0x9'),auth['isAuthenticated'](),controller[_0x29f9('0x10')]);router[_0x29f9('0x11')](_0x29f9('0x9'),auth[_0x29f9('0x8')](),controller[_0x29f9('0x12')]);module[_0x29f9('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a12dc4d..54bccf4 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 _0xf4f4=['string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x1758e7,_0x514db1){var _0x5f46c0=function(_0x4b15a7){while(--_0x4b15a7){_0x1758e7['push'](_0x1758e7['shift']());}};_0x5f46c0(++_0x514db1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x55189a,_0x35d0d0){_0x55189a=_0x55189a-0x0;var _0x3731f6=_0xf4f4[_0x55189a];return _0x3731f6;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4f4f('0x2')],'defaultValue':_0x4f4f('0x3'),'unique':_0x4f4f('0x4')},'mailbox':{'type':Sequelize[_0x4f4f('0x2')],'defaultValue':'','allowNull':![],'unique':_0x4f4f('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4f4f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3f274d){this[_0x4f4f('0x5')](_0x4f4f('0x6'),typeof _0x3f274d===_0x4f4f('0x7')&&_0x3f274d[_0x4f4f('0x8')]()?_0x3f274d[_0x4f4f('0x8')]():null);}},'pager':{'type':Sequelize[_0x4f4f('0x2')]},'tz':{'type':Sequelize[_0x4f4f('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':_0x4f4f('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':_0x4f4f('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4f4f('0x2')]},'callback':{'type':Sequelize[_0x4f4f('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4f4f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x4f4f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4f4f('0x9')](_0x4f4f('0xa'),'no'),'defaultValue':_0x4f4f('0xa'),'allowNull':![]},'stamp':{'type':_0x4f4f('0xb')},'emailsubject':{'type':Sequelize[_0x4f4f('0x2')]},'emailbody':{'type':Sequelize[_0x4f4f('0x2')]},'maxsecs':{'type':Sequelize[_0x4f4f('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4f4f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4f4f('0xd')],'get':function(){return this[_0x4f4f('0xe')](_0x4f4f('0xf'))+_0x4f4f('0x10')+this['getDataValue'](_0x4f4f('0x11'));}}}; \ No newline at end of file +var _0xb7e7=['sequelize','STRING','from-voicemail','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x4838c6,_0x25793c){var _0x39f083=function(_0xe0c56a){while(--_0xe0c56a){_0x4838c6['push'](_0x4838c6['shift']());}};_0x39f083(++_0x25793c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xb7e7[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x7b7e('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x7b7e('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7b7e('0x1')]},'fullname':{'type':Sequelize[_0x7b7e('0x1')]},'email':{'type':Sequelize[_0x7b7e('0x1')],'validate':{'isEmail':!![]},'set':function(_0x52047f){this['setDataValue'](_0x7b7e('0x3'),typeof _0x52047f===_0x7b7e('0x4')&&_0x52047f[_0x7b7e('0x5')]()?_0x52047f['trim']():null);}},'pager':{'type':Sequelize[_0x7b7e('0x1')]},'tz':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0x6')},'attach':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7b7e('0x7')]('yes','no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7b7e('0x1')]},'callback':{'type':Sequelize[_0x7b7e('0x1')]},'review':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7b7e('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7b7e('0x7')](_0x7b7e('0x8'),'no'),'defaultValue':_0x7b7e('0x8'),'allowNull':![]},'stamp':{'type':_0x7b7e('0xa')},'emailsubject':{'type':Sequelize[_0x7b7e('0x1')]},'emailbody':{'type':Sequelize[_0x7b7e('0x1')]},'maxsecs':{'type':Sequelize[_0x7b7e('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7b7e('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7b7e('0xc')],'get':function(){return this[_0x7b7e('0xd')](_0x7b7e('0xe'))+_0x7b7e('0xf')+this[_0x7b7e('0xd')](_0x7b7e('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 13d15bc..d8458eb 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 _0xcbde=['VoiceMailMessage','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','VoiceMail','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','mailbox'];(function(_0x136ff2,_0x4d1028){var _0x576e2d=function(_0x3e9787){while(--_0x3e9787){_0x136ff2['push'](_0x136ff2['shift']());}};_0x576e2d(++_0x4d1028);}(_0xcbde,0x19b));var _0xecbd=function(_0xb257b2,_0x48f11e){_0xb257b2=_0xb257b2-0x0;var _0xc4010b=_0xcbde[_0xb257b2];return _0xc4010b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xecbd('0x0'));var zipdir=require(_0xecbd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecbd('0x2'));var moment=require(_0xecbd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xecbd('0x4'));var util=require(_0xecbd('0x5'));var path=require(_0xecbd('0x6'));var sox=require(_0xecbd('0x7'));var csv=require('to-csv');var ejs=require(_0xecbd('0x8'));var fs=require('fs');var _=require(_0xecbd('0x9'));var squel=require(_0xecbd('0xa'));var crypto=require(_0xecbd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xecbd('0xc'));var toCsv=require(_0xecbd('0xd'));var querystring=require(_0xecbd('0xe'));var Papa=require(_0xecbd('0xf'));var Redis=require(_0xecbd('0x10'));var authService=require(_0xecbd('0x11'));var qs=require(_0xecbd('0x12'));var as=require(_0xecbd('0x13'));var hardwareService=require(_0xecbd('0x14'));var logger=require(_0xecbd('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xecbd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12719f,_0x25f684){_0x25f684=_0x25f684||0xcc;return function(_0x4a9c6f){if(_0x4a9c6f){return _0x12719f[_0xecbd('0x17')](_0x25f684);}return _0x12719f[_0xecbd('0x18')](_0x25f684)[_0xecbd('0x19')]();};}function respondWithResult(_0x313090,_0x591164){_0x591164=_0x591164||0xc8;return function(_0x394687){if(_0x394687){return _0x313090[_0xecbd('0x18')](_0x591164)[_0xecbd('0x1a')](_0x394687);}};}function respondWithFilteredResult(_0x508ae3,_0x72e315){return function(_0x568f07){if(_0x568f07){var _0x35f32f=_0x568f07[_0xecbd('0x1b')],_0x5cde5a=_0x72e315['offset'],_0x23f79c=_0x72e315[_0xecbd('0x1c')]+_0x72e315[_0xecbd('0x1d')],_0x184e64;if(_0x23f79c>=_0x35f32f){_0x23f79c=_0x35f32f;_0x184e64=0xc8;}else{_0x184e64=0xce;}_0x508ae3[_0xecbd('0x18')](_0x184e64);return _0x508ae3[_0xecbd('0x1e')](_0xecbd('0x1f'),_0x5cde5a+'-'+_0x23f79c+'/'+_0x35f32f)['json'](_0x568f07);}return null;};}function patchUpdates(_0x569a0b){return function(_0x489b8a){try{jsonpatch[_0xecbd('0x20')](_0x489b8a,_0x569a0b,!![]);}catch(_0x24d601){return BPromise[_0xecbd('0x21')](_0x24d601);}return _0x489b8a[_0xecbd('0x22')]();};}function saveUpdates(_0x16e3c3,_0xb915bc){return function(_0x453c38){if(_0x453c38){return _0x453c38[_0xecbd('0x23')](_0x16e3c3)[_0xecbd('0x24')](function(_0x1ad028){return _0x1ad028;});}return null;};}function removeEntity(_0x2b78df,_0x39bee9){return function(_0x59b7b5){if(_0x59b7b5){return _0x59b7b5[_0xecbd('0x25')]()[_0xecbd('0x24')](function(){var _0x482c75=_0x59b7b5[_0xecbd('0x26')]({'plain':!![]});var _0x28c253=_0xecbd('0x27');return db[_0xecbd('0x28')][_0xecbd('0x25')]({'where':{'type':_0x28c253,'resourceId':_0x482c75['id']}})[_0xecbd('0x24')](function(){return _0x59b7b5;});})['then'](function(){_0x2b78df['status'](0xcc)[_0xecbd('0x19')]();});}};}function handleEntityNotFound(_0x5ed70e,_0x243f17){return function(_0x5b37d2){if(!_0x5b37d2){_0x5ed70e[_0xecbd('0x17')](0x194);}return _0x5b37d2;};}function handleError(_0x1fa81b,_0x238c5f){_0x238c5f=_0x238c5f||0x1f4;return function(_0x3abaee){logger[_0xecbd('0x29')](_0x3abaee[_0xecbd('0x2a')]);if(_0x3abaee[_0xecbd('0x2b')]){delete _0x3abaee[_0xecbd('0x2b')];}_0x1fa81b[_0xecbd('0x18')](_0x238c5f)['send'](_0x3abaee);};}exports[_0xecbd('0x2c')]=function(_0x5bc752,_0x50e850){var _0x7c0e8e={},_0x2d31fe={},_0x5534e7={'count':0x0,'rows':[]};var _0x3ace8e=_[_0xecbd('0x2d')](db[_0xecbd('0x2e')][_0xecbd('0x2f')],function(_0x3a4e97){return{'name':_0x3a4e97['fieldName'],'type':_0x3a4e97[_0xecbd('0x30')]['key']};});_0x2d31fe[_0xecbd('0x31')]=_['map'](_0x3ace8e,_0xecbd('0x2b'));_0x2d31fe['query']=_[_0xecbd('0x32')](_0x5bc752[_0xecbd('0x33')]);_0x2d31fe[_0xecbd('0x34')]=_[_0xecbd('0x35')](_0x2d31fe[_0xecbd('0x31')],_0x2d31fe[_0xecbd('0x33')]);_0x7c0e8e[_0xecbd('0x36')]=_[_0xecbd('0x35')](_0x2d31fe[_0xecbd('0x31')],qs[_0xecbd('0x37')](_0x5bc752[_0xecbd('0x33')][_0xecbd('0x37')]));_0x7c0e8e[_0xecbd('0x36')]=_0x7c0e8e['attributes'][_0xecbd('0x38')]?_0x7c0e8e['attributes']:_0x2d31fe['model'];if(!_0x5bc752[_0xecbd('0x33')][_0xecbd('0x39')](_0xecbd('0x3a'))){_0x7c0e8e[_0xecbd('0x1d')]=qs[_0xecbd('0x1d')](_0x5bc752[_0xecbd('0x33')][_0xecbd('0x1d')]);_0x7c0e8e[_0xecbd('0x1c')]=qs[_0xecbd('0x1c')](_0x5bc752[_0xecbd('0x33')][_0xecbd('0x1c')]);}_0x7c0e8e[_0xecbd('0x3b')]=qs['sort'](_0x5bc752['query'][_0xecbd('0x3c')]);_0x7c0e8e[_0xecbd('0x3d')]=qs[_0xecbd('0x34')](_[_0xecbd('0x3e')](_0x5bc752[_0xecbd('0x33')],_0x2d31fe[_0xecbd('0x34')]),_0x3ace8e);if(_0x5bc752[_0xecbd('0x33')][_0xecbd('0x3f')]){_0x7c0e8e['where']=_[_0xecbd('0x40')](_0x7c0e8e[_0xecbd('0x3d')],{'$or':_[_0xecbd('0x2d')](_0x3ace8e,function(_0xc40755){if(_0xc40755['type']!==_0xecbd('0x41')){var _0x3914d9={};_0x3914d9[_0xc40755[_0xecbd('0x2b')]]={'$like':'%'+_0x5bc752[_0xecbd('0x33')]['filter']+'%'};return _0x3914d9;}})});}_0x7c0e8e=_['merge']({},_0x7c0e8e,_0x5bc752[_0xecbd('0x42')]);var _0x3d7290={'where':_0x7c0e8e['where']};return db[_0xecbd('0x2e')][_0xecbd('0x1b')](_0x3d7290)[_0xecbd('0x24')](function(_0x1b3d69){_0x5534e7['count']=_0x1b3d69;if(_0x5bc752[_0xecbd('0x33')][_0xecbd('0x43')]){_0x7c0e8e[_0xecbd('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0xecbd('0x45')](_0x7c0e8e);})['then'](function(_0x10f2bd){_0x5534e7['rows']=_0x10f2bd;return _0x5534e7;})[_0xecbd('0x24')](respondWithFilteredResult(_0x50e850,_0x7c0e8e))[_0xecbd('0x46')](handleError(_0x50e850,null));};exports['show']=function(_0x41ee26,_0x3970df){var _0xbe656c={'raw':!![],'where':{'id':_0x41ee26['params']['id']}},_0x41b1fc={};_0x41b1fc[_0xecbd('0x31')]=_[_0xecbd('0x32')](db[_0xecbd('0x2e')]['rawAttributes']);_0x41b1fc[_0xecbd('0x33')]=_[_0xecbd('0x32')](_0x41ee26[_0xecbd('0x33')]);_0x41b1fc['filters']=_['intersection'](_0x41b1fc[_0xecbd('0x31')],_0x41b1fc[_0xecbd('0x33')]);_0xbe656c[_0xecbd('0x36')]=_[_0xecbd('0x35')](_0x41b1fc[_0xecbd('0x31')],qs[_0xecbd('0x37')](_0x41ee26['query'][_0xecbd('0x37')]));_0xbe656c['attributes']=_0xbe656c[_0xecbd('0x36')][_0xecbd('0x38')]?_0xbe656c['attributes']:_0x41b1fc[_0xecbd('0x31')];if(_0x41ee26[_0xecbd('0x33')]['includeAll']){_0xbe656c[_0xecbd('0x44')]=[{'all':!![]}];}_0xbe656c=_[_0xecbd('0x40')]({},_0xbe656c,_0x41ee26[_0xecbd('0x42')]);return db['VoiceMail'][_0xecbd('0x47')](_0xbe656c)[_0xecbd('0x24')](handleEntityNotFound(_0x3970df,null))['then'](respondWithResult(_0x3970df,null))[_0xecbd('0x46')](handleError(_0x3970df,null));};exports[_0xecbd('0x48')]=function(_0x5256cc,_0x415867){return db[_0xecbd('0x2e')]['create'](_0x5256cc['body'],{})[_0xecbd('0x24')](function(_0x411574){var _0x2f801c=_0x5256cc[_0xecbd('0x49')][_0xecbd('0x26')]({'plain':!![]});if(!_0x2f801c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f801c[_0xecbd('0x4a')]===_0xecbd('0x49')){var _0xf75049=_0x411574[_0xecbd('0x26')]({'plain':!![]});var _0x3d2e9e=_0xecbd('0x27');return db['UserProfileSection'][_0xecbd('0x47')]({'where':{'name':_0x3d2e9e,'userProfileId':_0x2f801c[_0xecbd('0x4b')]},'raw':!![]})['then'](function(_0x10102e){if(_0x10102e&&_0x10102e[_0xecbd('0x4c')]===0x0){return db[_0xecbd('0x28')][_0xecbd('0x48')]({'name':_0xf75049[_0xecbd('0x2b')],'resourceId':_0xf75049['id'],'type':_0x10102e['name'],'sectionId':_0x10102e['id']},{})[_0xecbd('0x24')](function(){return _0x411574;});}else{return _0x411574;}})[_0xecbd('0x46')](function(_0x1ca8cc){logger[_0xecbd('0x29')](_0xecbd('0x4d'),_0x1ca8cc);throw _0x1ca8cc;});}return _0x411574;})['then'](respondWithResult(_0x415867,0xc9))['catch'](handleError(_0x415867,null));};exports['update']=function(_0x4ca47f,_0x3e3802){if(_0x4ca47f[_0xecbd('0x4e')]['id']){delete _0x4ca47f['body']['id'];}return db[_0xecbd('0x2e')]['find']({'where':{'id':_0x4ca47f[_0xecbd('0x4f')]['id']}})[_0xecbd('0x24')](handleEntityNotFound(_0x3e3802,null))[_0xecbd('0x24')](saveUpdates(_0x4ca47f[_0xecbd('0x4e')],null))[_0xecbd('0x24')](respondWithResult(_0x3e3802,null))['catch'](handleError(_0x3e3802,null));};exports[_0xecbd('0x25')]=function(_0x6e87c3,_0x553c1c){return db['VoiceMail'][_0xecbd('0x47')]({'where':{'id':_0x6e87c3[_0xecbd('0x4f')]['id']}})[_0xecbd('0x24')](handleEntityNotFound(_0x553c1c,null))[_0xecbd('0x24')](removeEntity(_0x553c1c,null))[_0xecbd('0x46')](handleError(_0x553c1c,null));};exports['getMessages']=function(_0xa65d6,_0x1a3c11,_0x41291b){return db[_0xecbd('0x2e')]['findOne']({'where':{'id':_0xa65d6[_0xecbd('0x4f')]['id']}})[_0xecbd('0x24')](handleEntityNotFound(_0x1a3c11,null))[_0xecbd('0x24')](function(_0x821494){var _0x467519;var _0x393d12={},_0x21405e={};_0x21405e[_0xecbd('0x31')]=_[_0xecbd('0x32')](db['VoiceMailMessage'][_0xecbd('0x2f')]);_0x21405e[_0xecbd('0x33')]=_[_0xecbd('0x32')](_0xa65d6['query']);_0x21405e[_0xecbd('0x34')]=_[_0xecbd('0x35')](_0x21405e[_0xecbd('0x31')],_0x21405e[_0xecbd('0x33')]);_0x393d12[_0xecbd('0x36')]=_[_0xecbd('0x35')](_0x21405e[_0xecbd('0x31')],qs[_0xecbd('0x37')](_0xa65d6[_0xecbd('0x33')][_0xecbd('0x37')]));_0x393d12[_0xecbd('0x36')]=_0x393d12['attributes'][_0xecbd('0x38')]?_0x393d12['attributes']:_0x21405e[_0xecbd('0x31')];if(!_0xa65d6['query'][_0xecbd('0x39')](_0xecbd('0x3a'))){_0x393d12['limit']=qs[_0xecbd('0x1d')](_0xa65d6[_0xecbd('0x33')][_0xecbd('0x1d')]);_0x393d12[_0xecbd('0x1c')]=qs[_0xecbd('0x1c')](_0xa65d6[_0xecbd('0x33')][_0xecbd('0x1c')]);}_0x393d12['order']=qs[_0xecbd('0x3c')](_0xa65d6['query'][_0xecbd('0x3c')]);_0x393d12[_0xecbd('0x3d')]=qs[_0xecbd('0x34')](_[_0xecbd('0x3e')](_0xa65d6[_0xecbd('0x33')],_0x21405e['filters']));if(_0xa65d6[_0xecbd('0x33')]['filter']){_0x393d12[_0xecbd('0x3d')]=_[_0xecbd('0x40')](_0x393d12[_0xecbd('0x3d')],{'$or':_['map'](_0x393d12[_0xecbd('0x36')],function(_0x177bf4){var _0x5c3c8b={};_0x5c3c8b[_0x177bf4]={'$like':'%'+_0xa65d6[_0xecbd('0x33')]['filter']+'%'};return _0x5c3c8b;})});}_0x393d12[_0xecbd('0x3d')]=_[_0xecbd('0x40')](_0x393d12[_0xecbd('0x3d')],{'mailboxuser':_0x821494[_0xecbd('0x50')]});_0x393d12=_['merge']({},_0x393d12,_0xa65d6[_0xecbd('0x42')]);return db[_0xecbd('0x51')]['findAndCountAll'](_0x393d12)[_0xecbd('0x24')](respondWithFilteredResult(_0x1a3c11,_0x393d12));})['catch'](handleError(_0x1a3c11,null));}; \ No newline at end of file +var _0x87d6=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','filter','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','status','end','json','count','offset','limit','set','apply','update','then','destroy','UserProfileResource','error','stack','name','map','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','show','params','fields','include','catch','create'];(function(_0x592979,_0x47b605){var _0x4f9950=function(_0xe9751c){while(--_0xe9751c){_0x592979['push'](_0x592979['shift']());}};_0x4f9950(++_0x47b605);}(_0x87d6,0x1d1));var _0x687d=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x87d6[_0x3d2e4b];return _0x509e78;};'use strict';var pdf=require(_0x687d('0x0'));var emlformat=require(_0x687d('0x1'));var rimraf=require(_0x687d('0x2'));var zipdir=require(_0x687d('0x3'));var jsonpatch=require(_0x687d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x687d('0x5'));var sox=require(_0x687d('0x6'));var csv=require(_0x687d('0x7'));var ejs=require(_0x687d('0x8'));var fs=require('fs');var _=require(_0x687d('0x9'));var squel=require('squel');var crypto=require(_0x687d('0xa'));var jsforce=require(_0x687d('0xb'));var deskjs=require(_0x687d('0xc'));var toCsv=require(_0x687d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x687d('0xd'));var as=require(_0x687d('0xe'));var hardwareService=require(_0x687d('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x687d('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1345a7,_0xd6d36a){_0xd6d36a=_0xd6d36a||0xcc;return function(_0x56832b){if(_0x56832b){return _0x1345a7['sendStatus'](_0xd6d36a);}return _0x1345a7[_0x687d('0x11')](_0xd6d36a)[_0x687d('0x12')]();};}function respondWithResult(_0x3c9945,_0x2bc363){_0x2bc363=_0x2bc363||0xc8;return function(_0xd6677d){if(_0xd6677d){return _0x3c9945[_0x687d('0x11')](_0x2bc363)[_0x687d('0x13')](_0xd6677d);}};}function respondWithFilteredResult(_0x2cb4fa,_0x3f395f){return function(_0x4c4bf){if(_0x4c4bf){var _0x2f5ded=_0x4c4bf[_0x687d('0x14')],_0x3666b9=_0x3f395f[_0x687d('0x15')],_0x82fc07=_0x3f395f['offset']+_0x3f395f[_0x687d('0x16')],_0x10db5a;if(_0x82fc07>=_0x2f5ded){_0x82fc07=_0x2f5ded;_0x10db5a=0xc8;}else{_0x10db5a=0xce;}_0x2cb4fa[_0x687d('0x11')](_0x10db5a);return _0x2cb4fa[_0x687d('0x17')]('Content-Range',_0x3666b9+'-'+_0x82fc07+'/'+_0x2f5ded)[_0x687d('0x13')](_0x4c4bf);}return null;};}function patchUpdates(_0x13494e){return function(_0x523b3a){try{jsonpatch[_0x687d('0x18')](_0x523b3a,_0x13494e,!![]);}catch(_0x150435){return BPromise['reject'](_0x150435);}return _0x523b3a['save']();};}function saveUpdates(_0x28a2d7,_0x48dd04){return function(_0x127976){if(_0x127976){return _0x127976[_0x687d('0x19')](_0x28a2d7)[_0x687d('0x1a')](function(_0x5528df){return _0x5528df;});}return null;};}function removeEntity(_0x249028,_0xe39871){return function(_0xef3461){if(_0xef3461){return _0xef3461[_0x687d('0x1b')]()[_0x687d('0x1a')](function(){var _0x4f30cf=_0xef3461['get']({'plain':!![]});var _0x43787c='Voicemails';return db[_0x687d('0x1c')][_0x687d('0x1b')]({'where':{'type':_0x43787c,'resourceId':_0x4f30cf['id']}})['then'](function(){return _0xef3461;});})[_0x687d('0x1a')](function(){_0x249028['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x344328,_0x9d26d6){return function(_0x42c4af){if(!_0x42c4af){_0x344328['sendStatus'](0x194);}return _0x42c4af;};}function handleError(_0x465063,_0x4346c9){_0x4346c9=_0x4346c9||0x1f4;return function(_0x41e8de){logger[_0x687d('0x1d')](_0x41e8de[_0x687d('0x1e')]);if(_0x41e8de['name']){delete _0x41e8de[_0x687d('0x1f')];}_0x465063[_0x687d('0x11')](_0x4346c9)['send'](_0x41e8de);};}exports['index']=function(_0x994ed9,_0x3fae85){var _0x675715={},_0x2d9332={},_0x3fc109={'count':0x0,'rows':[]};var _0x2e0b06=_[_0x687d('0x20')](db[_0x687d('0x21')][_0x687d('0x22')],function(_0x58e5bf){return{'name':_0x58e5bf[_0x687d('0x23')],'type':_0x58e5bf[_0x687d('0x24')]['key']};});_0x2d9332['model']=_['map'](_0x2e0b06,_0x687d('0x1f'));_0x2d9332[_0x687d('0x25')]=_[_0x687d('0x26')](_0x994ed9[_0x687d('0x25')]);_0x2d9332[_0x687d('0x27')]=_['intersection'](_0x2d9332[_0x687d('0x28')],_0x2d9332['query']);_0x675715[_0x687d('0x29')]=_[_0x687d('0x2a')](_0x2d9332['model'],qs['fields'](_0x994ed9[_0x687d('0x25')]['fields']));_0x675715[_0x687d('0x29')]=_0x675715[_0x687d('0x29')][_0x687d('0x2b')]?_0x675715[_0x687d('0x29')]:_0x2d9332['model'];if(!_0x994ed9[_0x687d('0x25')][_0x687d('0x2c')](_0x687d('0x2d'))){_0x675715['limit']=qs[_0x687d('0x16')](_0x994ed9[_0x687d('0x25')]['limit']);_0x675715[_0x687d('0x15')]=qs[_0x687d('0x15')](_0x994ed9[_0x687d('0x25')][_0x687d('0x15')]);}_0x675715[_0x687d('0x2e')]=qs[_0x687d('0x2f')](_0x994ed9[_0x687d('0x25')][_0x687d('0x2f')]);_0x675715['where']=qs[_0x687d('0x27')](_['pick'](_0x994ed9[_0x687d('0x25')],_0x2d9332[_0x687d('0x27')]),_0x2e0b06);if(_0x994ed9[_0x687d('0x25')]['filter']){_0x675715[_0x687d('0x30')]=_[_0x687d('0x31')](_0x675715['where'],{'$or':_[_0x687d('0x20')](_0x2e0b06,function(_0x5983d7){if(_0x5983d7[_0x687d('0x24')]!==_0x687d('0x32')){var _0x15fec8={};_0x15fec8[_0x5983d7[_0x687d('0x1f')]]={'$like':'%'+_0x994ed9[_0x687d('0x25')]['filter']+'%'};return _0x15fec8;}})});}_0x675715=_[_0x687d('0x31')]({},_0x675715,_0x994ed9[_0x687d('0x33')]);var _0x5f4d55={'where':_0x675715[_0x687d('0x30')]};return db[_0x687d('0x21')][_0x687d('0x14')](_0x5f4d55)[_0x687d('0x1a')](function(_0xf0eef0){_0x3fc109[_0x687d('0x14')]=_0xf0eef0;if(_0x994ed9['query'][_0x687d('0x34')]){_0x675715['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x675715);})[_0x687d('0x1a')](function(_0x245f9a){_0x3fc109[_0x687d('0x35')]=_0x245f9a;return _0x3fc109;})['then'](respondWithFilteredResult(_0x3fae85,_0x675715))['catch'](handleError(_0x3fae85,null));};exports[_0x687d('0x36')]=function(_0x4afe3f,_0x5c5946){var _0x245134={'raw':!![],'where':{'id':_0x4afe3f[_0x687d('0x37')]['id']}},_0x5489b7={};_0x5489b7[_0x687d('0x28')]=_['keys'](db[_0x687d('0x21')][_0x687d('0x22')]);_0x5489b7[_0x687d('0x25')]=_['keys'](_0x4afe3f['query']);_0x5489b7[_0x687d('0x27')]=_[_0x687d('0x2a')](_0x5489b7[_0x687d('0x28')],_0x5489b7[_0x687d('0x25')]);_0x245134['attributes']=_['intersection'](_0x5489b7[_0x687d('0x28')],qs['fields'](_0x4afe3f[_0x687d('0x25')][_0x687d('0x38')]));_0x245134[_0x687d('0x29')]=_0x245134[_0x687d('0x29')]['length']?_0x245134[_0x687d('0x29')]:_0x5489b7[_0x687d('0x28')];if(_0x4afe3f[_0x687d('0x25')][_0x687d('0x34')]){_0x245134[_0x687d('0x39')]=[{'all':!![]}];}_0x245134=_[_0x687d('0x31')]({},_0x245134,_0x4afe3f[_0x687d('0x33')]);return db['VoiceMail']['find'](_0x245134)['then'](handleEntityNotFound(_0x5c5946,null))['then'](respondWithResult(_0x5c5946,null))[_0x687d('0x3a')](handleError(_0x5c5946,null));};exports[_0x687d('0x3b')]=function(_0x287a10,_0x45e89d){return db[_0x687d('0x21')][_0x687d('0x3b')](_0x287a10['body'],{})[_0x687d('0x1a')](function(_0x31b0da){var _0x387780=_0x287a10[_0x687d('0x3c')][_0x687d('0x3d')]({'plain':!![]});if(!_0x387780)throw new Error(_0x687d('0x3e'));if(_0x387780[_0x687d('0x3f')]==='user'){var _0x36a7ce=_0x31b0da['get']({'plain':!![]});var _0x327a75=_0x687d('0x40');return db[_0x687d('0x41')][_0x687d('0x42')]({'where':{'name':_0x327a75,'userProfileId':_0x387780[_0x687d('0x43')]},'raw':!![]})[_0x687d('0x1a')](function(_0x1a7172){if(_0x1a7172&&_0x1a7172[_0x687d('0x44')]===0x0){return db[_0x687d('0x1c')]['create']({'name':_0x36a7ce[_0x687d('0x1f')],'resourceId':_0x36a7ce['id'],'type':_0x1a7172[_0x687d('0x1f')],'sectionId':_0x1a7172['id']},{})['then'](function(){return _0x31b0da;});}else{return _0x31b0da;}})[_0x687d('0x3a')](function(_0x54e15a){logger['error'](_0x687d('0x45'),_0x54e15a);throw _0x54e15a;});}return _0x31b0da;})[_0x687d('0x1a')](respondWithResult(_0x45e89d,0xc9))[_0x687d('0x3a')](handleError(_0x45e89d,null));};exports[_0x687d('0x19')]=function(_0x5b71d7,_0x74b9b7){if(_0x5b71d7[_0x687d('0x46')]['id']){delete _0x5b71d7['body']['id'];}return db[_0x687d('0x21')][_0x687d('0x42')]({'where':{'id':_0x5b71d7[_0x687d('0x37')]['id']}})[_0x687d('0x1a')](handleEntityNotFound(_0x74b9b7,null))['then'](saveUpdates(_0x5b71d7[_0x687d('0x46')],null))[_0x687d('0x1a')](respondWithResult(_0x74b9b7,null))['catch'](handleError(_0x74b9b7,null));};exports[_0x687d('0x1b')]=function(_0x26fe72,_0x58f067){return db[_0x687d('0x21')]['find']({'where':{'id':_0x26fe72[_0x687d('0x37')]['id']}})[_0x687d('0x1a')](handleEntityNotFound(_0x58f067,null))[_0x687d('0x1a')](removeEntity(_0x58f067,null))[_0x687d('0x3a')](handleError(_0x58f067,null));};exports['getMessages']=function(_0x4a64da,_0x5df8b0,_0x33c270){return db[_0x687d('0x21')][_0x687d('0x47')]({'where':{'id':_0x4a64da[_0x687d('0x37')]['id']}})[_0x687d('0x1a')](handleEntityNotFound(_0x5df8b0,null))[_0x687d('0x1a')](function(_0x1b6a46){var _0xd4b68e;var _0x27e565={},_0x42e3f5={};_0x42e3f5[_0x687d('0x28')]=_[_0x687d('0x26')](db[_0x687d('0x48')]['rawAttributes']);_0x42e3f5[_0x687d('0x25')]=_[_0x687d('0x26')](_0x4a64da[_0x687d('0x25')]);_0x42e3f5[_0x687d('0x27')]=_[_0x687d('0x2a')](_0x42e3f5[_0x687d('0x28')],_0x42e3f5[_0x687d('0x25')]);_0x27e565[_0x687d('0x29')]=_['intersection'](_0x42e3f5['model'],qs[_0x687d('0x38')](_0x4a64da[_0x687d('0x25')]['fields']));_0x27e565[_0x687d('0x29')]=_0x27e565['attributes'][_0x687d('0x2b')]?_0x27e565[_0x687d('0x29')]:_0x42e3f5['model'];if(!_0x4a64da[_0x687d('0x25')][_0x687d('0x2c')](_0x687d('0x2d'))){_0x27e565[_0x687d('0x16')]=qs[_0x687d('0x16')](_0x4a64da[_0x687d('0x25')][_0x687d('0x16')]);_0x27e565['offset']=qs[_0x687d('0x15')](_0x4a64da['query'][_0x687d('0x15')]);}_0x27e565['order']=qs[_0x687d('0x2f')](_0x4a64da['query'][_0x687d('0x2f')]);_0x27e565['where']=qs['filters'](_['pick'](_0x4a64da['query'],_0x42e3f5[_0x687d('0x27')]));if(_0x4a64da[_0x687d('0x25')][_0x687d('0x49')]){_0x27e565[_0x687d('0x30')]=_[_0x687d('0x31')](_0x27e565['where'],{'$or':_[_0x687d('0x20')](_0x27e565[_0x687d('0x29')],function(_0x4c6180){var _0x49b140={};_0x49b140[_0x4c6180]={'$like':'%'+_0x4a64da[_0x687d('0x25')][_0x687d('0x49')]+'%'};return _0x49b140;})});}_0x27e565[_0x687d('0x30')]=_[_0x687d('0x31')](_0x27e565[_0x687d('0x30')],{'mailboxuser':_0x1b6a46['mailbox']});_0x27e565=_[_0x687d('0x31')]({},_0x27e565,_0x4a64da[_0x687d('0x33')]);return db['VoiceMailMessage'][_0x687d('0x4a')](_0x27e565)['then'](respondWithFilteredResult(_0x5df8b0,_0x27e565));})[_0x687d('0x3a')](handleError(_0x5df8b0,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 3a77fea..173515b 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 _0x68a9=['../../config/logger','api','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util'];(function(_0x1910da,_0x23ee1d){var _0x276f1b=function(_0x344858){while(--_0x344858){_0x1910da['push'](_0x1910da['shift']());}};_0x276f1b(++_0x23ee1d);}(_0x68a9,0x106));var _0x968a=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x68a9[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x968a('0x0'));var util=require(_0x968a('0x1'));var logger=require(_0x968a('0x2'))(_0x968a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x968a('0x4'));var attributes=require(_0x968a('0x5'));module[_0x968a('0x6')]=function(_0x1d2b24,_0x4e7307){return _0x1d2b24['define'](_0x968a('0x7'),attributes,{'tableName':_0x968a('0x8'),'paranoid':![],'indexes':[{'name':_0x968a('0x9'),'fields':['mailbox',_0x968a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66eb=['exports','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x7f42c1,_0x592f5a){var _0x40dcc6=function(_0x2cb984){while(--_0x2cb984){_0x7f42c1['push'](_0x7f42c1['shift']());}};_0x40dcc6(++_0x592f5a);}(_0x66eb,0x1d2));var _0xb66e=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x66eb[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0xb66e('0x0'));var util=require(_0xb66e('0x1'));var logger=require(_0xb66e('0x2'))('api');var moment=require(_0xb66e('0x3'));var BPromise=require(_0xb66e('0x4'));var rp=require(_0xb66e('0x5'));var fs=require('fs');var path=require(_0xb66e('0x6'));var rimraf=require(_0xb66e('0x7'));var config=require(_0xb66e('0x8'));var attributes=require(_0xb66e('0x9'));module[_0xb66e('0xa')]=function(_0x4b7f81,_0x2648f2){return _0x4b7f81['define']('VoiceMail',attributes,{'tableName':_0xb66e('0xb'),'paranoid':![],'indexes':[{'name':_0xb66e('0xc'),'fields':[_0xb66e('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 53517dd..4dc9a57 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 _0xa56e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa56e,0xc7));var _0xea56=function(_0x29d4ac,_0x5c4e0f){_0x29d4ac=_0x29d4ac-0x0;var _0x2a99b0=_0xa56e[_0x29d4ac];return _0x2a99b0;};'use strict';var _=require(_0xea56('0x0'));var util=require(_0xea56('0x1'));var moment=require('moment');var BPromise=require(_0xea56('0x2'));var rs=require(_0xea56('0x3'));var fs=require('fs');var Redis=require(_0xea56('0x4'));var db=require(_0xea56('0x5'))['db'];var utils=require(_0xea56('0x6'));var logger=require(_0xea56('0x7'))(_0xea56('0x8'));var config=require(_0xea56('0x9'));var jayson=require(_0xea56('0xa'));var client=jayson[_0xea56('0xb')][_0xea56('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33c351,_0x59b6dd,_0x4adbe5){return new BPromise(function(_0x4587fd,_0x506409){return client[_0xea56('0xd')](_0x33c351,_0x4adbe5)[_0xea56('0xe')](function(_0x230b8d){logger[_0xea56('0xf')](_0xea56('0x10'),_0x59b6dd,_0xea56('0x11'));logger[_0xea56('0x12')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x59b6dd,'request\x20sent',JSON[_0xea56('0x13')](_0x230b8d));if(_0x230b8d[_0xea56('0x14')]){if(_0x230b8d[_0xea56('0x14')][_0xea56('0x15')]===0x1f4){logger[_0xea56('0x14')](_0xea56('0x10'),_0x59b6dd,_0x230b8d[_0xea56('0x14')][_0xea56('0x16')]);return _0x506409(_0x230b8d[_0xea56('0x14')][_0xea56('0x16')]);}logger[_0xea56('0x14')](_0xea56('0x10'),_0x59b6dd,_0x230b8d[_0xea56('0x14')][_0xea56('0x16')]);return _0x4587fd(_0x230b8d[_0xea56('0x14')][_0xea56('0x16')]);}else{logger['info'](_0xea56('0x10'),_0x59b6dd,_0xea56('0x11'));_0x4587fd(_0x230b8d[_0xea56('0x17')]['message']);}})[_0xea56('0x18')](function(_0x240e09){logger[_0xea56('0x14')](_0xea56('0x10'),_0x59b6dd,_0x240e09);_0x506409(_0x240e09);});});} \ No newline at end of file +var _0xbd19=['jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0xbd19,0x1d6));var _0x9bd1=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xbd19[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x9bd1('0x0'));var util=require(_0x9bd1('0x1'));var moment=require(_0x9bd1('0x2'));var BPromise=require(_0x9bd1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bd1('0x4'));var db=require(_0x9bd1('0x5'))['db'];var utils=require(_0x9bd1('0x6'));var logger=require(_0x9bd1('0x7'))(_0x9bd1('0x8'));var config=require(_0x9bd1('0x9'));var jayson=require(_0x9bd1('0xa'));var client=jayson[_0x9bd1('0xb')][_0x9bd1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x405654,_0x187b8e,_0x27e8f3){return new BPromise(function(_0x55e2e8,_0x8e12ae){return client[_0x9bd1('0xd')](_0x405654,_0x27e8f3)[_0x9bd1('0xe')](function(_0x30b02c){logger[_0x9bd1('0xf')](_0x9bd1('0x10'),_0x187b8e,_0x9bd1('0x11'));logger[_0x9bd1('0x12')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x187b8e,_0x9bd1('0x11'),JSON['stringify'](_0x30b02c));if(_0x30b02c[_0x9bd1('0x13')]){if(_0x30b02c[_0x9bd1('0x13')][_0x9bd1('0x14')]===0x1f4){logger[_0x9bd1('0x13')]('VoiceMail,\x20%s,\x20%s',_0x187b8e,_0x30b02c[_0x9bd1('0x13')]['message']);return _0x8e12ae(_0x30b02c[_0x9bd1('0x13')][_0x9bd1('0x15')]);}logger[_0x9bd1('0x13')](_0x9bd1('0x10'),_0x187b8e,_0x30b02c['error'][_0x9bd1('0x15')]);return _0x55e2e8(_0x30b02c[_0x9bd1('0x13')]['message']);}else{logger[_0x9bd1('0xf')]('VoiceMail,\x20%s,\x20%s',_0x187b8e,_0x9bd1('0x11'));_0x55e2e8(_0x30b02c[_0x9bd1('0x16')]['message']);}})[_0x9bd1('0x17')](function(_0x15eec1){logger[_0x9bd1('0x13')]('VoiceMail,\x20%s,\x20%s',_0x187b8e,_0x15eec1);_0x8e12ae(_0x15eec1);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0f88ed8..0cfd425 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 _0x1261=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','show','/:id/download','isAuthenticated','download','create','put','destroy'];(function(_0x87eee5,_0x581852){var _0x17e2dc=function(_0x1122d2){while(--_0x1122d2){_0x87eee5['push'](_0x87eee5['shift']());}};_0x17e2dc(++_0x581852);}(_0x1261,0x144));var _0x1126=function(_0x3d2580,_0x5bcf59){_0x3d2580=_0x3d2580-0x0;var _0x1bed34=_0x1261[_0x3d2580];return _0x1bed34;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0xf')]);router[_0x1126('0x10')]('/:id',auth[_0x1126('0xd')](),controller['update']);router['delete'](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0x11')]);module[_0x1126('0x12')]=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','delete','exports'];(function(_0x4f3956,_0xb882fa){var _0x97c11f=function(_0x3f6a84){while(--_0x3f6a84){_0x4f3956['push'](_0x4f3956['shift']());}};_0x97c11f(++_0xb882fa);}(_0x46ed,0x168));var _0xd46e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x46ed[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0x7')](_0xd46e('0xc'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router['post']('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xe')]);router['put'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router[_0xd46e('0x10')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller['destroy']);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 4194e05..9612c28 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 _0xfd3e=['BLOB','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xfd3e,0x104));var _0xefd3=function(_0x1dc4d2,_0x25df78){_0x1dc4d2=_0x1dc4d2-0x0;var _0x46443f=_0xfd3e[_0x1dc4d2];return _0x46443f;};'use strict';var Sequelize=require(_0xefd3('0x0'));module[_0xefd3('0x1')]={'name':{'type':Sequelize[_0xefd3('0x2')],'get':function(_0x11352e){return this[_0xefd3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xefd3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xefd3('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xefd3('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x436b=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','TIMESTAMP'];(function(_0x3263f5,_0xf655e3){var _0x588a98=function(_0x28123f){while(--_0x28123f){_0x3263f5['push'](_0x3263f5['shift']());}};_0x588a98(++_0xf655e3);}(_0x436b,0x142));var _0xb436=function(_0x4cd585,_0x449d33){_0x4cd585=_0x4cd585-0x0;var _0x29cd43=_0x436b[_0x4cd585];return _0x29cd43;};'use strict';var Sequelize=require(_0xb436('0x0'));module[_0xb436('0x1')]={'name':{'type':Sequelize[_0xb436('0x2')],'get':function(_0x4b90cd){return this[_0xb436('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xb436('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xb436('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xb436('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b7a4421..140bd34 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 _0x235a=['audio/wav','attachment','Content-Disposition','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','differenceBy','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x235a,0x1ef));var _0xa235=function(_0x50916b,_0x56fe5f){_0x50916b=_0x50916b-0x0;var _0x56a75e=_0x235a[_0x50916b];return _0x56a75e;};'use strict';var pdf=require(_0xa235('0x0'));var emlformat=require(_0xa235('0x1'));var rimraf=require(_0xa235('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa235('0x3'));var rp=require('request-promise');var moment=require(_0xa235('0x4'));var BPromise=require(_0xa235('0x5'));var Mustache=require(_0xa235('0x6'));var util=require(_0xa235('0x7'));var path=require(_0xa235('0x8'));var sox=require(_0xa235('0x9'));var csv=require(_0xa235('0xa'));var ejs=require(_0xa235('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var db=require(_0xa235('0x15'))['db'];function respondWithStatusCode(_0x1fe5cf,_0x5330db){_0x5330db=_0x5330db||0xcc;return function(_0x5510ff){if(_0x5510ff){return _0x1fe5cf['sendStatus'](_0x5330db);}return _0x1fe5cf[_0xa235('0x16')](_0x5330db)[_0xa235('0x17')]();};}function respondWithResult(_0xf1b244,_0x3bf6fc){_0x3bf6fc=_0x3bf6fc||0xc8;return function(_0x36b4b1){if(_0x36b4b1){return _0xf1b244[_0xa235('0x16')](_0x3bf6fc)[_0xa235('0x18')](_0x36b4b1);}};}function respondWithFilteredResult(_0x1e03a8,_0x1369de){return function(_0x4aceee){if(_0x4aceee){var _0x352463=_0x4aceee[_0xa235('0x19')],_0x20cd67=_0x1369de[_0xa235('0x1a')],_0x26fd63=_0x1369de['offset']+_0x1369de['limit'],_0x128244;if(_0x26fd63>=_0x352463){_0x26fd63=_0x352463;_0x128244=0xc8;}else{_0x128244=0xce;}_0x1e03a8[_0xa235('0x16')](_0x128244);return _0x1e03a8[_0xa235('0x1b')](_0xa235('0x1c'),_0x20cd67+'-'+_0x26fd63+'/'+_0x352463)['json'](_0x4aceee);}return null;};}function patchUpdates(_0x40b4a9){return function(_0x219e41){try{jsonpatch[_0xa235('0x1d')](_0x219e41,_0x40b4a9,!![]);}catch(_0x3b115){return BPromise[_0xa235('0x1e')](_0x3b115);}return _0x219e41[_0xa235('0x1f')]();};}function saveUpdates(_0x37faca,_0x483771){return function(_0x5a3bea){if(_0x5a3bea){return _0x5a3bea[_0xa235('0x20')](_0x37faca)[_0xa235('0x21')](function(_0x85a3d8){return _0x85a3d8;});}return null;};}function removeEntity(_0x26323c,_0x2e38e){return function(_0x3deeea){if(_0x3deeea){return _0x3deeea[_0xa235('0x22')]()[_0xa235('0x21')](function(){_0x26323c[_0xa235('0x16')](0xcc)[_0xa235('0x17')]();});}};}function handleEntityNotFound(_0x3219f1,_0x20292c){return function(_0xee45e1){if(!_0xee45e1){_0x3219f1[_0xa235('0x23')](0x194);}return _0xee45e1;};}function handleError(_0x3a0def,_0x3364ee){_0x3364ee=_0x3364ee||0x1f4;return function(_0x7a3b5d){logger[_0xa235('0x24')](_0x7a3b5d[_0xa235('0x25')]);if(_0x7a3b5d[_0xa235('0x26')]){delete _0x7a3b5d[_0xa235('0x26')];}_0x3a0def['status'](_0x3364ee)[_0xa235('0x27')](_0x7a3b5d);};}exports['index']=function(_0x19a673,_0x53ec70){var _0x442edf={},_0x3ab925={},_0x7a6f13={'count':0x0,'rows':[]};var _0x2b273a=_[_0xa235('0x28')](db['VoiceMailMessage'][_0xa235('0x29')],function(_0x612f2){return{'name':_0x612f2['fieldName'],'type':_0x612f2['type']['key']};});_0x3ab925['model']=_[_0xa235('0x2a')](_[_0xa235('0x28')](_0x2b273a,_0xa235('0x26')),[_0xa235('0x26')]);_0x3ab925[_0xa235('0x2b')]=_[_0xa235('0x2c')](_0x19a673[_0xa235('0x2b')]);_0x3ab925['filters']=_['intersection'](_0x3ab925[_0xa235('0x2d')],_0x3ab925[_0xa235('0x2b')]);_0x442edf['attributes']=_[_0xa235('0x2e')](_0x3ab925[_0xa235('0x2d')],qs[_0xa235('0x2f')](_0x19a673[_0xa235('0x2b')][_0xa235('0x2f')]));_0x442edf[_0xa235('0x30')]=_0x442edf[_0xa235('0x30')][_0xa235('0x31')]?_0x442edf['attributes']:_0x3ab925[_0xa235('0x2d')];if(!_0x19a673['query'][_0xa235('0x32')](_0xa235('0x33'))){_0x442edf[_0xa235('0x34')]=qs[_0xa235('0x34')](_0x19a673[_0xa235('0x2b')][_0xa235('0x34')]);_0x442edf[_0xa235('0x1a')]=qs[_0xa235('0x1a')](_0x19a673[_0xa235('0x2b')][_0xa235('0x1a')]);}_0x442edf[_0xa235('0x35')]=qs[_0xa235('0x36')](_0x19a673[_0xa235('0x2b')]['sort']);_0x442edf['where']=qs['filters'](_[_0xa235('0x37')](_0x19a673['query'],_0x3ab925[_0xa235('0x38')]),_0x2b273a);if(_0x19a673[_0xa235('0x2b')][_0xa235('0x39')]){_0x442edf[_0xa235('0x3a')]=_[_0xa235('0x3b')](_0x442edf[_0xa235('0x3a')],{'$or':_[_0xa235('0x28')](_0x2b273a,function(_0x5ba3cf){if(_0x5ba3cf[_0xa235('0x3c')]!==_0xa235('0x3d')){var _0x594511={};_0x594511[_0x5ba3cf[_0xa235('0x26')]]={'$like':'%'+_0x19a673[_0xa235('0x2b')][_0xa235('0x39')]+'%'};return _0x594511;}})});}_0x442edf=_[_0xa235('0x3b')]({},_0x442edf,_0x19a673[_0xa235('0x3e')]);var _0x444656={'where':_0x442edf[_0xa235('0x3a')]};return db[_0xa235('0x3f')][_0xa235('0x19')](_0x444656)['then'](function(_0x28c259){_0x7a6f13[_0xa235('0x19')]=_0x28c259;if(_0x19a673[_0xa235('0x2b')][_0xa235('0x40')]){_0x442edf[_0xa235('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa235('0x42')](_0x442edf);})[_0xa235('0x21')](function(_0x2ebe2a){_0x7a6f13[_0xa235('0x43')]=_0x2ebe2a;return _0x7a6f13;})['then'](respondWithFilteredResult(_0x53ec70,_0x442edf))[_0xa235('0x44')](handleError(_0x53ec70,null));};exports[_0xa235('0x45')]=function(_0x47801f,_0x2de451){var _0x32179a={'raw':!![],'where':{'id':_0x47801f[_0xa235('0x46')]['id']}},_0x22caf6={};_0x22caf6['model']=_[_0xa235('0x2c')](db[_0xa235('0x3f')][_0xa235('0x29')]);_0x22caf6[_0xa235('0x2b')]=_[_0xa235('0x2c')](_0x47801f['query']);_0x22caf6[_0xa235('0x38')]=_[_0xa235('0x2e')](_0x22caf6[_0xa235('0x2d')],_0x22caf6[_0xa235('0x2b')]);_0x32179a[_0xa235('0x30')]=_['intersection'](_0x22caf6[_0xa235('0x2d')],qs[_0xa235('0x2f')](_0x47801f[_0xa235('0x2b')][_0xa235('0x2f')]));_0x32179a[_0xa235('0x30')]=_0x32179a[_0xa235('0x30')][_0xa235('0x31')]?_0x32179a[_0xa235('0x30')]:_0x22caf6['model'];if(_0x47801f[_0xa235('0x2b')][_0xa235('0x40')]){_0x32179a[_0xa235('0x41')]=[{'all':!![]}];}_0x32179a=_[_0xa235('0x3b')]({},_0x32179a,_0x47801f[_0xa235('0x3e')]);return db[_0xa235('0x3f')][_0xa235('0x47')](_0x32179a)[_0xa235('0x21')](handleEntityNotFound(_0x2de451,null))[_0xa235('0x21')](respondWithResult(_0x2de451,null))['catch'](handleError(_0x2de451,null));};exports[_0xa235('0x48')]=function(_0x3395e9,_0x116256){return db[_0xa235('0x3f')][_0xa235('0x48')](_0x3395e9['body'],{})[_0xa235('0x21')](respondWithResult(_0x116256,0xc9))[_0xa235('0x44')](handleError(_0x116256,null));};exports['update']=function(_0x2a628f,_0x430196){if(_0x2a628f[_0xa235('0x49')]['id']){delete _0x2a628f[_0xa235('0x49')]['id'];}return db['VoiceMailMessage'][_0xa235('0x47')]({'where':{'id':_0x2a628f['params']['id']}})[_0xa235('0x21')](handleEntityNotFound(_0x430196,null))[_0xa235('0x21')](saveUpdates(_0x2a628f['body'],null))[_0xa235('0x21')](respondWithResult(_0x430196,null))[_0xa235('0x44')](handleError(_0x430196,null));};exports[_0xa235('0x22')]=function(_0x26e8ad,_0x133980){return db[_0xa235('0x3f')][_0xa235('0x47')]({'where':{'id':_0x26e8ad[_0xa235('0x46')]['id']}})['then'](handleEntityNotFound(_0x133980,null))['then'](removeEntity(_0x133980,null))['catch'](handleError(_0x133980,null));};exports[_0xa235('0x4a')]=function(_0x1711a8,_0x476401,_0x3b5255){return db['VoiceMailMessage'][_0xa235('0x47')]({'where':{'id':_0x1711a8['params']['id']},'attributes':['id',_0xa235('0x4b'),_0xa235('0x4c')]})[_0xa235('0x21')](handleEntityNotFound(_0x476401,null))[_0xa235('0x21')](function(_0x54edb0){if(_0x54edb0){if(!_0x54edb0[_0xa235('0x4b')]){throw new db['Sequelize'][(_0xa235('0x4d'))](_0xa235('0x4e'));}var _0x5a119e={'Content-Type':_0xa235('0x4f'),'Content-Disposition':_0xa235('0x50')};if(_0x54edb0[_0xa235('0x4c')]){_0x5a119e[_0xa235('0x51')]='attachment;\x20filename=\x22'+_0x54edb0['msg_id']+'.wav\x22';}_0x476401[_0xa235('0x1b')](_0x5a119e);return _0x476401[_0xa235('0x27')](new Buffer(_0x54edb0['recording']));}})['catch'](handleError(_0x476401,null));}; \ No newline at end of file +var _0xb688=['query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','map','name','keys','filters','intersection'];(function(_0x6d8534,_0xf69e4c){var _0x19527d=function(_0x45dc9){while(--_0x45dc9){_0x6d8534['push'](_0x6d8534['shift']());}};_0x19527d(++_0xf69e4c);}(_0xb688,0xcf));var _0x8b68=function(_0x5d051e,_0x2feb67){_0x5d051e=_0x5d051e-0x0;var _0x3ce954=_0xb688[_0x5d051e];return _0x3ce954;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var as=require(_0x8b68('0x15'));var hardwareService=require(_0x8b68('0x16'));var logger=require(_0x8b68('0x17'))('api');var utils=require(_0x8b68('0x18'));var config=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x2d8472,_0x1965cf){_0x1965cf=_0x1965cf||0xcc;return function(_0x2f3af4){if(_0x2f3af4){return _0x2d8472[_0x8b68('0x1b')](_0x1965cf);}return _0x2d8472[_0x8b68('0x1c')](_0x1965cf)[_0x8b68('0x1d')]();};}function respondWithResult(_0x5b4364,_0xb2df35){_0xb2df35=_0xb2df35||0xc8;return function(_0x509033){if(_0x509033){return _0x5b4364['status'](_0xb2df35)[_0x8b68('0x1e')](_0x509033);}};}function respondWithFilteredResult(_0x1554d6,_0x27d717){return function(_0x5d3468){if(_0x5d3468){var _0x5c8d0e=_0x5d3468[_0x8b68('0x1f')],_0x23bd52=_0x27d717[_0x8b68('0x20')],_0x5c1e44=_0x27d717[_0x8b68('0x20')]+_0x27d717['limit'],_0x136f1b;if(_0x5c1e44>=_0x5c8d0e){_0x5c1e44=_0x5c8d0e;_0x136f1b=0xc8;}else{_0x136f1b=0xce;}_0x1554d6[_0x8b68('0x1c')](_0x136f1b);return _0x1554d6[_0x8b68('0x21')]('Content-Range',_0x23bd52+'-'+_0x5c1e44+'/'+_0x5c8d0e)[_0x8b68('0x1e')](_0x5d3468);}return null;};}function patchUpdates(_0x3c7e5a){return function(_0x3cf3bd){try{jsonpatch[_0x8b68('0x22')](_0x3cf3bd,_0x3c7e5a,!![]);}catch(_0x38b7a7){return BPromise['reject'](_0x38b7a7);}return _0x3cf3bd[_0x8b68('0x23')]();};}function saveUpdates(_0x4b4b0f,_0x59e9b1){return function(_0x1a9788){if(_0x1a9788){return _0x1a9788[_0x8b68('0x24')](_0x4b4b0f)[_0x8b68('0x25')](function(_0x5603d4){return _0x5603d4;});}return null;};}function removeEntity(_0x571adf,_0x23edc1){return function(_0x59cb26){if(_0x59cb26){return _0x59cb26[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x571adf[_0x8b68('0x1c')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(!_0x59bb8a){_0x32ddc5[_0x8b68('0x1b')](0x194);}return _0x59bb8a;};}function handleError(_0x46e827,_0x4ca77d){_0x4ca77d=_0x4ca77d||0x1f4;return function(_0x1c5808){logger[_0x8b68('0x27')](_0x1c5808[_0x8b68('0x28')]);if(_0x1c5808['name']){delete _0x1c5808['name'];}_0x46e827['status'](_0x4ca77d)[_0x8b68('0x29')](_0x1c5808);};}exports[_0x8b68('0x2a')]=function(_0x2ba2a3,_0x583476){var _0x3311c7={},_0x53aaa2={},_0x4cf89d={'count':0x0,'rows':[]};var _0x3865ea=_['map'](db[_0x8b68('0x2b')][_0x8b68('0x2c')],function(_0x48e2c8){return{'name':_0x48e2c8['fieldName'],'type':_0x48e2c8[_0x8b68('0x2d')][_0x8b68('0x2e')]};});_0x53aaa2[_0x8b68('0x2f')]=_[_0x8b68('0x30')](_[_0x8b68('0x31')](_0x3865ea,_0x8b68('0x32')),[_0x8b68('0x32')]);_0x53aaa2['query']=_[_0x8b68('0x33')](_0x2ba2a3['query']);_0x53aaa2[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x53aaa2['model'],_0x53aaa2[_0x8b68('0x36')]);_0x3311c7[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x53aaa2['model'],qs['fields'](_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x38')]));_0x3311c7[_0x8b68('0x37')]=_0x3311c7[_0x8b68('0x37')][_0x8b68('0x39')]?_0x3311c7[_0x8b68('0x37')]:_0x53aaa2[_0x8b68('0x2f')];if(!_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x3a')](_0x8b68('0x3b'))){_0x3311c7[_0x8b68('0x3c')]=qs[_0x8b68('0x3c')](_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x3c')]);_0x3311c7[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x20')]);}_0x3311c7[_0x8b68('0x3d')]=qs[_0x8b68('0x3e')](_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x3e')]);_0x3311c7['where']=qs['filters'](_[_0x8b68('0x3f')](_0x2ba2a3[_0x8b68('0x36')],_0x53aaa2[_0x8b68('0x34')]),_0x3865ea);if(_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x40')]){_0x3311c7[_0x8b68('0x41')]=_[_0x8b68('0x42')](_0x3311c7[_0x8b68('0x41')],{'$or':_['map'](_0x3865ea,function(_0x14cda1){if(_0x14cda1[_0x8b68('0x2d')]!==_0x8b68('0x43')){var _0x13cf49={};_0x13cf49[_0x14cda1[_0x8b68('0x32')]]={'$like':'%'+_0x2ba2a3[_0x8b68('0x36')][_0x8b68('0x40')]+'%'};return _0x13cf49;}})});}_0x3311c7=_[_0x8b68('0x42')]({},_0x3311c7,_0x2ba2a3['options']);var _0x3f874c={'where':_0x3311c7[_0x8b68('0x41')]};return db[_0x8b68('0x2b')][_0x8b68('0x1f')](_0x3f874c)[_0x8b68('0x25')](function(_0x3b3394){_0x4cf89d[_0x8b68('0x1f')]=_0x3b3394;if(_0x2ba2a3['query'][_0x8b68('0x44')]){_0x3311c7[_0x8b68('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8b68('0x46')](_0x3311c7);})[_0x8b68('0x25')](function(_0x50b2f1){_0x4cf89d['rows']=_0x50b2f1;return _0x4cf89d;})['then'](respondWithFilteredResult(_0x583476,_0x3311c7))['catch'](handleError(_0x583476,null));};exports[_0x8b68('0x47')]=function(_0x23d24a,_0x515815){var _0x1998dc={'raw':!![],'where':{'id':_0x23d24a[_0x8b68('0x48')]['id']}},_0x5960fc={};_0x5960fc[_0x8b68('0x2f')]=_['keys'](db[_0x8b68('0x2b')]['rawAttributes']);_0x5960fc['query']=_['keys'](_0x23d24a[_0x8b68('0x36')]);_0x5960fc[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x5960fc[_0x8b68('0x2f')],_0x5960fc['query']);_0x1998dc[_0x8b68('0x37')]=_['intersection'](_0x5960fc[_0x8b68('0x2f')],qs[_0x8b68('0x38')](_0x23d24a['query'][_0x8b68('0x38')]));_0x1998dc[_0x8b68('0x37')]=_0x1998dc[_0x8b68('0x37')][_0x8b68('0x39')]?_0x1998dc['attributes']:_0x5960fc[_0x8b68('0x2f')];if(_0x23d24a[_0x8b68('0x36')][_0x8b68('0x44')]){_0x1998dc[_0x8b68('0x45')]=[{'all':!![]}];}_0x1998dc=_[_0x8b68('0x42')]({},_0x1998dc,_0x23d24a[_0x8b68('0x49')]);return db[_0x8b68('0x2b')][_0x8b68('0x4a')](_0x1998dc)[_0x8b68('0x25')](handleEntityNotFound(_0x515815,null))[_0x8b68('0x25')](respondWithResult(_0x515815,null))[_0x8b68('0x4b')](handleError(_0x515815,null));};exports[_0x8b68('0x4c')]=function(_0x1af430,_0x108c8d){return db[_0x8b68('0x2b')][_0x8b68('0x4c')](_0x1af430['body'],{})[_0x8b68('0x25')](respondWithResult(_0x108c8d,0xc9))[_0x8b68('0x4b')](handleError(_0x108c8d,null));};exports['update']=function(_0xeab810,_0x4cd28a){if(_0xeab810['body']['id']){delete _0xeab810['body']['id'];}return db[_0x8b68('0x2b')][_0x8b68('0x4a')]({'where':{'id':_0xeab810[_0x8b68('0x48')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x4cd28a,null))['then'](saveUpdates(_0xeab810['body'],null))[_0x8b68('0x25')](respondWithResult(_0x4cd28a,null))[_0x8b68('0x4b')](handleError(_0x4cd28a,null));};exports[_0x8b68('0x26')]=function(_0x5d08c4,_0x3f6e21){return db[_0x8b68('0x2b')]['find']({'where':{'id':_0x5d08c4[_0x8b68('0x48')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x3f6e21,null))['then'](removeEntity(_0x3f6e21,null))[_0x8b68('0x4b')](handleError(_0x3f6e21,null));};exports[_0x8b68('0x4d')]=function(_0x51bf1b,_0x3f7f89,_0x735e17){return db['VoiceMailMessage']['find']({'where':{'id':_0x51bf1b['params']['id']},'attributes':['id',_0x8b68('0x4e'),_0x8b68('0x4f')]})[_0x8b68('0x25')](handleEntityNotFound(_0x3f7f89,null))[_0x8b68('0x25')](function(_0x55aad3){if(_0x55aad3){if(!_0x55aad3['recording']){throw new db[(_0x8b68('0x50'))][(_0x8b68('0x51'))](_0x8b68('0x52'));}var _0x5c0ece={'Content-Type':_0x8b68('0x53'),'Content-Disposition':_0x8b68('0x54')};if(_0x55aad3[_0x8b68('0x4f')]){_0x5c0ece['Content-Disposition']=_0x8b68('0x55')+_0x55aad3['msg_id']+_0x8b68('0x56');}_0x3f7f89[_0x8b68('0x21')](_0x5c0ece);return _0x3f7f89['send'](new Buffer(_0x55aad3[_0x8b68('0x4e')]));}})[_0x8b68('0x4b')](handleError(_0x3f7f89,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index e68f7c2..8929022 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 _0x537a=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x537a,0x193));var _0xa537=function(_0x7c5b41,_0x577587){_0x7c5b41=_0x7c5b41-0x0;var _0xa75631=_0x537a[_0x7c5b41];return _0xa75631;};'use strict';var _=require(_0xa537('0x0'));var util=require('util');var logger=require(_0xa537('0x1'))(_0xa537('0x2'));var moment=require(_0xa537('0x3'));var BPromise=require(_0xa537('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa537('0x5'));var rimraf=require(_0xa537('0x6'));var config=require(_0xa537('0x7'));var attributes=require(_0xa537('0x8'));module['exports']=function(_0x449b5a,_0x474ab5){return _0x449b5a[_0xa537('0x9')](_0xa537('0xa'),attributes,{'tableName':_0xa537('0xb'),'paranoid':![],'indexes':[{'name':_0xa537('0xc'),'fields':[_0xa537('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x47ff=['bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','voice_voicemail_messages','dir','api','moment'];(function(_0x3aaf97,_0x4fa2e8){var _0xeba75e=function(_0xf7f986){while(--_0xf7f986){_0x3aaf97['push'](_0x3aaf97['shift']());}};_0xeba75e(++_0x4fa2e8);}(_0x47ff,0xbc));var _0xf47f=function(_0x2534a0,_0xda89db){_0x2534a0=_0x2534a0-0x0;var _0x3209c0=_0x47ff[_0x2534a0];return _0x3209c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf47f('0x0'));var moment=require(_0xf47f('0x1'));var BPromise=require(_0xf47f('0x2'));var rp=require(_0xf47f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf47f('0x4'));var config=require(_0xf47f('0x5'));var attributes=require(_0xf47f('0x6'));module[_0xf47f('0x7')]=function(_0x16c779,_0x35e494){return _0x16c779['define']('VoiceMailMessage',attributes,{'tableName':_0xf47f('0x8'),'paranoid':![],'indexes':[{'name':_0xf47f('0x9'),'fields':[_0xf47f('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index b960da6..01d3e68 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 _0x0b0e=['VoiceMailMessage,\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','VoiceMailMessage,\x20%s,\x20%s','debug'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0x0b0e[_0x2c93e2];return _0x57264e;};'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')]('VoiceMailMessage,\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 _0x1967=['then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x1967,0x173));var _0x7196=function(_0x1e1e20,_0xbf0b29){_0x1e1e20=_0x1e1e20-0x0;var _0x363d2a=_0x1967[_0x1e1e20];return _0x363d2a;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index cffee4a..ae524ca 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 _0x8a72=['get','/:id','isAuthenticated','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','path','express','Router','../../components/auth/service','./voiceMusicOnHold.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8a72,0xa6));var _0x28a7=function(_0x1af3ec,_0x3ea005){_0x1af3ec=_0x1af3ec-0x0;var _0x43a8de=_0x8a72[_0x1af3ec];return _0x43a8de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x28a7('0x0'));var timeout=require('connect-timeout');var express=require(_0x28a7('0x1'));var router=express[_0x28a7('0x2')]();var auth=require(_0x28a7('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x28a7('0x4'));router[_0x28a7('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x28a7('0x6'),auth[_0x28a7('0x7')](),controller['show']);router['get'](_0x28a7('0x8'),auth[_0x28a7('0x7')](),controller[_0x28a7('0x9')]);router[_0x28a7('0xa')]('/',auth[_0x28a7('0x7')](),controller['create']);router[_0x28a7('0xa')]('/:id/sounds',auth[_0x28a7('0x7')](),controller[_0x28a7('0xb')]);router[_0x28a7('0xc')](_0x28a7('0x6'),auth[_0x28a7('0x7')](),controller[_0x28a7('0xd')]);router[_0x28a7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x28a7('0xf')]);router[_0x28a7('0xe')](_0x28a7('0x10'),auth[_0x28a7('0x7')](),controller[_0x28a7('0x11')]);module[_0x28a7('0x12')]=router; \ No newline at end of file +var _0xaa24=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa24,0xca));var _0x4aa2=function(_0x53c462,_0x439da6){_0x53c462=_0x53c462-0x0;var _0x355562=_0xaa24[_0x53c462];return _0x355562;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4aa2('0x0'));var timeout=require(_0x4aa2('0x1'));var express=require(_0x4aa2('0x2'));var router=express[_0x4aa2('0x3')]();var auth=require(_0x4aa2('0x4'));var interaction=require(_0x4aa2('0x5'));var config=require(_0x4aa2('0x6'));var controller=require(_0x4aa2('0x7'));router[_0x4aa2('0x8')]('/',auth[_0x4aa2('0x9')](),controller[_0x4aa2('0xa')]);router[_0x4aa2('0x8')](_0x4aa2('0xb'),auth['isAuthenticated'](),controller[_0x4aa2('0xc')]);router['get'](_0x4aa2('0xd'),auth[_0x4aa2('0x9')](),controller[_0x4aa2('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4aa2('0xf')]);router[_0x4aa2('0x10')]('/:id/sounds',auth[_0x4aa2('0x9')](),controller[_0x4aa2('0x11')]);router[_0x4aa2('0x12')](_0x4aa2('0xb'),auth[_0x4aa2('0x9')](),controller[_0x4aa2('0x13')]);router['delete'](_0x4aa2('0xb'),auth[_0x4aa2('0x9')](),controller['destroy']);router[_0x4aa2('0x14')](_0x4aa2('0x15'),auth[_0x4aa2('0x9')](),controller[_0x4aa2('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 5edb8d5..b00f762 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 _0x2ff5=['quietmp3','mp3','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ff5,0x100));var _0x52ff=function(_0x53af21,_0x34fc56){_0x53af21=_0x53af21-0x0;var _0x51c66c=_0x2ff5[_0x53af21];return _0x51c66c;};'use strict';var Sequelize=require(_0x52ff('0x0'));module[_0x52ff('0x1')]={'name':{'type':Sequelize[_0x52ff('0x2')],'allowNull':![],'unique':_0x52ff('0x3')},'mode':{'type':Sequelize[_0x52ff('0x4')](_0x52ff('0x5'),_0x52ff('0x6'),'mp3nb',_0x52ff('0x7'),_0x52ff('0x8'),_0x52ff('0x9')),'allowNull':!![],'defaultValue':_0x52ff('0x6')},'directory':{'type':Sequelize[_0x52ff('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x52ff('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x52ff('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x52ff('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x52ff('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x46aa=['mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','exports','name','ENUM','custom','files'];(function(_0x34ef53,_0x5beb3f){var _0x3f588a=function(_0x126eca){while(--_0x126eca){_0x34ef53['push'](_0x34ef53['shift']());}};_0x3f588a(++_0x5beb3f);}(_0x46aa,0xcb));var _0xa46a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x46aa[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require('sequelize');module[_0xa46a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa46a('0x1')},'mode':{'type':Sequelize[_0xa46a('0x2')](_0xa46a('0x3'),_0xa46a('0x4'),_0xa46a('0x5'),_0xa46a('0x6'),_0xa46a('0x7'),_0xa46a('0x8')),'allowNull':!![],'defaultValue':_0xa46a('0x4')},'directory':{'type':Sequelize[_0xa46a('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xa46a('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa46a('0x9')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa46a('0xa')},'format':{'type':Sequelize[_0xa46a('0x9')],'allowNull':!![]},'stamp':{'type':_0xa46a('0xb')},'defaultEntry':{'type':Sequelize[_0xa46a('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index a1a006c..a8e6413 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 _0x5f2f=['getSounds','nolimit','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','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','MusicOnHolds','UserProfileResource','then','end','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','body','catch','transaction','mode','directory','server/files/moh','create','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','join','rmdirSync','message','addSound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','ValidationError','removeSound','id2','Sound'];(function(_0x5717bf,_0x9d92af){var _0x2a1e0b=function(_0xc763ef){while(--_0xc763ef){_0x5717bf['push'](_0x5717bf['shift']());}};_0x2a1e0b(++_0x9d92af);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2d52aa,_0x4179e9){_0x2d52aa=_0x2d52aa-0x0;var _0xde20c5=_0x5f2f[_0x2d52aa];return _0xde20c5;};'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(){var _0x21cd91=_0x39c024[_0xf5f2('0x24')]({'plain':!![]});var _0x4e8bda=_0xf5f2('0x25');return db[_0xf5f2('0x26')]['destroy']({'where':{'type':_0x4e8bda,'resourceId':_0x21cd91['id']}})['then'](function(){return _0x39c024;});})[_0xf5f2('0x27')](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x28')]();});}};}function handleEntityNotFound(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(!_0x788a8d){_0x1a5bb3[_0xf5f2('0x17')](0x194);}return _0x788a8d;};}function handleError(_0x281ec8,_0x294414){_0x294414=_0x294414||0x1f4;return function(_0x4ab014){logger[_0xf5f2('0x29')](_0x4ab014[_0xf5f2('0x2a')]);if(_0x4ab014[_0xf5f2('0x2b')]){delete _0x4ab014[_0xf5f2('0x2b')];}_0x281ec8[_0xf5f2('0x18')](_0x294414)[_0xf5f2('0x2c')](_0x4ab014);};}exports['index']=function(_0x53cb96,_0x22c826){var _0x14c829={},_0x11c771={},_0x5027ab={'count':0x0,'rows':[]};var _0x5a2c7e=_[_0xf5f2('0x2d')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')],function(_0x153924){return{'name':_0x153924[_0xf5f2('0x30')],'type':_0x153924['type']['key']};});_0x11c771[_0xf5f2('0x31')]=_['map'](_0x5a2c7e,_0xf5f2('0x2b'));_0x11c771['query']=_[_0xf5f2('0x32')](_0x53cb96[_0xf5f2('0x33')]);_0x11c771[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x11c771[_0xf5f2('0x31')],_0x11c771[_0xf5f2('0x33')]);_0x14c829[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x11c771['model'],qs[_0xf5f2('0x37')](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x37')]));_0x14c829[_0xf5f2('0x36')]=_0x14c829[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x14c829[_0xf5f2('0x36')]:_0x11c771['model'];if(!_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x39')]('nolimit')){_0x14c829[_0xf5f2('0x1c')]=qs['limit'](_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x14c829[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x53cb96['query']['offset']);}_0x14c829[_0xf5f2('0x3a')]=qs[_0xf5f2('0x3b')](_0x53cb96[_0xf5f2('0x33')]['sort']);_0x14c829[_0xf5f2('0x3c')]=qs['filters'](_[_0xf5f2('0x3d')](_0x53cb96['query'],_0x11c771[_0xf5f2('0x34')]),_0x5a2c7e);if(_0x53cb96[_0xf5f2('0x33')]['filter']){_0x14c829[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x14c829[_0xf5f2('0x3c')],{'$or':_[_0xf5f2('0x2d')](_0x5a2c7e,function(_0x542cd6){if(_0x542cd6['type']!==_0xf5f2('0x3f')){var _0x140a11={};_0x140a11[_0x542cd6[_0xf5f2('0x2b')]]={'$like':'%'+_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x140a11;}})});}_0x14c829=_[_0xf5f2('0x3e')]({},_0x14c829,_0x53cb96[_0xf5f2('0x41')]);var _0x4c0ac7={'where':_0x14c829[_0xf5f2('0x3c')]};return db[_0xf5f2('0x2e')]['count'](_0x4c0ac7)[_0xf5f2('0x27')](function(_0x3f3895){_0x5027ab[_0xf5f2('0x1a')]=_0x3f3895;if(_0x53cb96[_0xf5f2('0x33')][_0xf5f2('0x42')]){_0x14c829[_0xf5f2('0x43')]=[{'all':!![]}];}return db[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0x14c829);})['then'](function(_0x31c3c){_0x5027ab[_0xf5f2('0x45')]=_0x31c3c;return _0x5027ab;})[_0xf5f2('0x27')](respondWithFilteredResult(_0x22c826,_0x14c829))['catch'](handleError(_0x22c826,null));};exports['show']=function(_0x59eb00,_0x76d21b){var _0x2ad13c={'raw':![],'where':{'id':_0x59eb00[_0xf5f2('0x46')]['id']}},_0x4c8d8e={};_0x4c8d8e[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x2e')][_0xf5f2('0x2f')]);_0x4c8d8e[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x59eb00[_0xf5f2('0x33')]);_0x4c8d8e[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x4c8d8e[_0xf5f2('0x31')],_0x4c8d8e[_0xf5f2('0x33')]);_0x2ad13c[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x4c8d8e['model'],qs[_0xf5f2('0x37')](_0x59eb00['query'][_0xf5f2('0x37')]));_0x2ad13c[_0xf5f2('0x36')]=_0x2ad13c[_0xf5f2('0x36')][_0xf5f2('0x38')]?_0x2ad13c[_0xf5f2('0x36')]:_0x4c8d8e[_0xf5f2('0x31')];if(_0x59eb00['query'][_0xf5f2('0x42')]){_0x2ad13c[_0xf5f2('0x43')]=[{'all':!![]}];}_0x2ad13c=_[_0xf5f2('0x3e')]({},_0x2ad13c,_0x59eb00[_0xf5f2('0x41')]);return db[_0xf5f2('0x2e')][_0xf5f2('0x47')](_0x2ad13c)[_0xf5f2('0x27')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x27')](respondWithResult(_0x76d21b,null))['catch'](handleError(_0x76d21b,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x48')]['id'];}return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x27')](saveUpdates(_0x33ec29[_0xf5f2('0x48')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x49')](handleError(_0x45db9a,null));};exports['create']=function(_0x740321,_0x497eb8,_0x2cbd9d){return db['sequelize'][_0xf5f2('0x4a')](function(_0xb8ea3a){if(_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4b')]==='files'){_0x740321[_0xf5f2('0x48')][_0xf5f2('0x4c')]=path['join'](config['root'],_0xf5f2('0x4d'),_0x740321[_0xf5f2('0x48')]['name']);}return db[_0xf5f2('0x2e')][_0xf5f2('0x4e')](_0x740321[_0xf5f2('0x48')],{'transaction':_0xb8ea3a})[_0xf5f2('0x27')](function(_0x5d0db0){if(_0x740321['body'][_0xf5f2('0x4b')]===_0xf5f2('0x4f')){fs['mkdirSync'](_0x5d0db0[_0xf5f2('0x4c')],parseInt(_0xf5f2('0x50'),0x8));}var _0x255125=_0x740321[_0xf5f2('0x51')][_0xf5f2('0x24')]({'plain':!![]});if(!_0x255125)throw new Error(_0xf5f2('0x52'));if(_0x255125[_0xf5f2('0x53')]==='user'){var _0x59e8ef=_0x5d0db0[_0xf5f2('0x24')]({'plain':!![]});return db[_0xf5f2('0x54')][_0xf5f2('0x47')]({'where':{'name':_0xf5f2('0x25'),'userProfileId':_0x255125[_0xf5f2('0x55')]},'raw':!![]})['then'](function(_0xdb1106){if(_0xdb1106&&_0xdb1106[_0xf5f2('0x56')]===0x0){return db[_0xf5f2('0x26')]['create']({'name':_0x59e8ef[_0xf5f2('0x2b')],'resourceId':_0x59e8ef['id'],'type':_0xdb1106['name'],'sectionId':_0xdb1106['id']},{})[_0xf5f2('0x27')](function(){return _0x5d0db0;});}else{return _0x5d0db0;}})[_0xf5f2('0x49')](function(_0x28cce5){logger[_0xf5f2('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28cce5);});}return _0x5d0db0;});})['then'](respondWithResult(_0x497eb8,0xc9))[_0xf5f2('0x49')](handleError(_0x497eb8,null));};exports['destroy']=function(_0xa39c65,_0x1f1916,_0x572ec1){var _0x3f0579;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0xa39c65['params']['id']}})[_0xf5f2('0x27')](function(_0xcf7a50){if(_0xcf7a50){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x51fa7e){return _0xcf7a50[_0xf5f2('0x23')]({'transaction':_0x51fa7e,'raw':!![]})['then'](function(_0x2cbe1e){if(_0x2cbe1e[_0xf5f2('0x4c')]){fs[_0xf5f2('0x58')](_0x2cbe1e[_0xf5f2('0x4c')])[_0xf5f2('0x59')](function(_0x5583c2){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x2cbe1e[_0xf5f2('0x4c')],_0x5583c2));});fs[_0xf5f2('0x5c')](_0x2cbe1e[_0xf5f2('0x4c')]);}return _0x2cbe1e;});})['catch'](function(_0x31e16b){throw new db['Sequelize']['ValidationError'](_0x31e16b[_0xf5f2('0x5d')]);});}})['then'](handleEntityNotFound(_0x1f1916,null))[_0xf5f2('0x27')](removeEntity(_0x1f1916,null))[_0xf5f2('0x49')](handleError(_0x1f1916,null));};exports[_0xf5f2('0x5e')]=function(_0x123b93,_0x5767fc,_0x15d0c2){return db[_0xf5f2('0x57')][_0xf5f2('0x4a')](function(_0x18c41f){var _0x15b680;return db[_0xf5f2('0x2e')][_0xf5f2('0x47')]({'where':{'id':_0x123b93['params']['id']}})[_0xf5f2('0x27')](function(_0x2d171d){if(_0x2d171d){_0x15b680=_0x2d171d;return _0x2d171d[_0xf5f2('0x5e')](_0x123b93[_0xf5f2('0x48')]['id'],{'transaction':_0x18c41f});}})['then'](function(_0x1de396){if(_0x1de396){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x123b93[_0xf5f2('0x48')]['id']},'attributes':['id','name',_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})[_0xf5f2('0x27')](function(_0x146462){if(_0x146462){var _0x4bd113=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],_0xf5f2('0x64'),util[_0xf5f2('0x65')](_0xf5f2('0x66'),path[_0xf5f2('0x67')](_0x146462['save_name'],path[_0xf5f2('0x68')](_0x146462[_0xf5f2('0x60')])),_0x146462['converted_format']));var _0x3f677e=path[_0xf5f2('0x5b')](config[_0xf5f2('0x63')],'server/files/moh',_0x15b680['name'],util['format'](_0xf5f2('0x66'),_0x146462[_0xf5f2('0x2b')],_0x146462[_0xf5f2('0x61')]));fs[_0xf5f2('0x69')](_0x4bd113,_0x3f677e);return _0x146462;}})[_0xf5f2('0x49')](function(_0x4d878e){throw new db[(_0xf5f2('0x6a'))][(_0xf5f2('0x6b'))](_0x4d878e[_0xf5f2('0x5d')]);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x5767fc,null))[_0xf5f2('0x27')](respondWithResult(_0x5767fc,0xc9))[_0xf5f2('0x49')](handleError(_0x5767fc,null));};exports[_0xf5f2('0x6c')]=function(_0x3cce11,_0x155f45,_0x1f35ef){return db[_0xf5f2('0x57')]['transaction'](function(_0x5e4e07){var _0x5a143f;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))[_0xf5f2('0x27')](function(_0x5c6959){if(_0x5c6959){_0x5a143f=_0x5c6959;return _0x5c6959[_0xf5f2('0x6c')](_0x3cce11[_0xf5f2('0x46')][_0xf5f2('0x6d')]);}})[_0xf5f2('0x27')](function(_0x44d119){if(_0x44d119){return db['Sound'][_0xf5f2('0x5f')]({'where':{'id':_0x3cce11[_0xf5f2('0x46')]['id2']},'attributes':['id',_0xf5f2('0x2b'),_0xf5f2('0x60'),_0xf5f2('0x61'),_0xf5f2('0x62')],'raw':!![]});}})['then'](function(_0x40b36e){if(_0x40b36e){fs[_0xf5f2('0x5a')](path[_0xf5f2('0x5b')](_0x5a143f[_0xf5f2('0x4c')],util[_0xf5f2('0x65')]('%s.%s',_0x40b36e['name'],_0x40b36e[_0xf5f2('0x61')])));return _0x40b36e;}})[_0xf5f2('0x49')](function(_0x17eb69){throw new db[(_0xf5f2('0x6a'))]['ValidationError'](_0x17eb69['message']);});})[_0xf5f2('0x27')](handleEntityNotFound(_0x155f45,null))['then'](respondWithStatusCode(_0x155f45,0xcc))['catch'](handleError(_0x155f45,null));};exports['getSounds']=function(_0x57cb18,_0xad4554,_0x543434){var _0x18eb83={};var _0x168092={};var _0x3de508;var _0x9f941e;return db[_0xf5f2('0x2e')][_0xf5f2('0x5f')]({'where':{'id':_0x57cb18[_0xf5f2('0x46')]['id']}})[_0xf5f2('0x27')](handleEntityNotFound(_0xad4554,null))[_0xf5f2('0x27')](function(_0x2afeac){if(_0x2afeac){_0x3de508=_0x2afeac;_0x168092[_0xf5f2('0x31')]=_[_0xf5f2('0x32')](db[_0xf5f2('0x6e')][_0xf5f2('0x2f')]);_0x168092[_0xf5f2('0x33')]=_[_0xf5f2('0x32')](_0x57cb18['query']);_0x168092[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],_0x168092[_0xf5f2('0x33')]);_0x18eb83[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x168092[_0xf5f2('0x31')],qs[_0xf5f2('0x37')](_0x57cb18['query'][_0xf5f2('0x37')]));_0x18eb83['attributes']=_0x18eb83['attributes']['length']?_0x18eb83['attributes']:_0x168092['model'];_0x18eb83['order']=qs[_0xf5f2('0x3b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x3b')]);_0x18eb83[_0xf5f2('0x3c')]=qs[_0xf5f2('0x34')](_[_0xf5f2('0x3d')](_0x57cb18['query'],_0x168092['filters']));if(_0x57cb18[_0xf5f2('0x33')]['filter']){_0x18eb83[_0xf5f2('0x3c')]=_[_0xf5f2('0x3e')](_0x18eb83['where'],{'$or':_['map'](_0x18eb83[_0xf5f2('0x36')],function(_0x274aa3){var _0x5a23c7={};_0x5a23c7[_0x274aa3]={'$like':'%'+_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x40')]+'%'};return _0x5a23c7;})});}_0x18eb83=_['merge']({},_0x18eb83,_0x57cb18[_0xf5f2('0x41')]);return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0x4c1678){if(_0x4c1678){_0x9f941e=_0x4c1678[_0xf5f2('0x38')];if(!_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x39')](_0xf5f2('0x70'))){_0x18eb83[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1c')]);_0x18eb83[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x57cb18[_0xf5f2('0x33')][_0xf5f2('0x1b')]);}return _0x3de508[_0xf5f2('0x6f')](_0x18eb83);}})[_0xf5f2('0x27')](function(_0xe900ea){if(_0xe900ea){return _0xe900ea?{'count':_0x9f941e,'rows':_0xe900ea}:null;}})[_0xf5f2('0x27')](respondWithResult(_0xad4554,null))[_0xf5f2('0x49')](handleError(_0xad4554,null));}; \ No newline at end of file +var _0xd8b0=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','ValidationError','removeSound','id2','message','getSounds','options','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','name','send'];(function(_0x1a86fb,_0x5db923){var _0xdf2088=function(_0x2629d9){while(--_0x2629d9){_0x1a86fb['push'](_0x1a86fb['shift']());}};_0xdf2088(++_0x5db923);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){var _0x2b924f=_0x56c729[_0x0d8b('0x23')]({'plain':!![]});var _0x38efc8=_0x0d8b('0x24');return db[_0x0d8b('0x25')][_0x0d8b('0x26')]({'where':{'type':_0x38efc8,'resourceId':_0x2b924f['id']}})[_0x0d8b('0x22')](function(){return _0x56c729;});})[_0x0d8b('0x22')](function(){_0x33fb87['status'](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['VoiceMusicOnHold'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x1b2b59['query'][_0x0d8b('0x1a')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x3e')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3f')]){_0x97050a[_0x0d8b('0x40')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x41')](_0x97050a);})[_0x0d8b('0x22')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x42')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x43')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x44')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x45')](db['VoiceMusicOnHold']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3f')]){_0x4d0811[_0x0d8b('0x40')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x4d0811)[_0x0d8b('0x22')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x22')](respondWithResult(_0x576050,null))[_0x0d8b('0x43')](handleError(_0x576050,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x47')]['id']){delete _0x11d22b[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x47')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x43')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x48')]=function(_0x574b90,_0x371fa0,_0x4d8850){return db['sequelize'][_0x0d8b('0x49')](function(_0x113fb7){if(_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4a')]==='files'){_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4b')]=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x4e'),_0x574b90['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x574b90[_0x0d8b('0x47')],{'transaction':_0x113fb7})[_0x0d8b('0x22')](function(_0x5e3bb4){if(_0x574b90['body'][_0x0d8b('0x4a')]===_0x0d8b('0x4f')){fs['mkdirSync'](_0x5e3bb4['directory'],parseInt(_0x0d8b('0x50'),0x8));}var _0xeeefd4=_0x574b90[_0x0d8b('0x51')][_0x0d8b('0x23')]({'plain':!![]});if(!_0xeeefd4)throw new Error(_0x0d8b('0x52'));if(_0xeeefd4['role']===_0x0d8b('0x51')){var _0x2afe34=_0x5e3bb4['get']({'plain':!![]});return db['UserProfileSection'][_0x0d8b('0x46')]({'where':{'name':_0x0d8b('0x24'),'userProfileId':_0xeeefd4['userProfileId']},'raw':!![]})['then'](function(_0xb8be3b){if(_0xb8be3b&&_0xb8be3b[_0x0d8b('0x53')]===0x0){return db[_0x0d8b('0x25')][_0x0d8b('0x48')]({'name':_0x2afe34['name'],'resourceId':_0x2afe34['id'],'type':_0xb8be3b[_0x0d8b('0x27')],'sectionId':_0xb8be3b['id']},{})['then'](function(){return _0x5e3bb4;});}else{return _0x5e3bb4;}})['catch'](function(_0x38c24e){logger[_0x0d8b('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c24e);});}return _0x5e3bb4;});})['then'](respondWithResult(_0x371fa0,0xc9))[_0x0d8b('0x43')](handleError(_0x371fa0,null));};exports[_0x0d8b('0x26')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0xccc2a9['params']['id']}})[_0x0d8b('0x22')](function(_0x37dc9f){if(_0x37dc9f){return db[_0x0d8b('0x55')][_0x0d8b('0x49')](function(_0x3fb9ea){return _0x37dc9f[_0x0d8b('0x26')]({'transaction':_0x3fb9ea,'raw':!![]})[_0x0d8b('0x22')](function(_0x1c78b6){if(_0x1c78b6[_0x0d8b('0x4b')]){fs['readdirSync'](_0x1c78b6[_0x0d8b('0x4b')])[_0x0d8b('0x56')](function(_0x180b7b){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x1c78b6['directory'],_0x180b7b));});fs[_0x0d8b('0x58')](_0x1c78b6[_0x0d8b('0x4b')]);}return _0x1c78b6;});})[_0x0d8b('0x43')](function(_0x17a87f){throw new db[(_0x0d8b('0x59'))]['ValidationError'](_0x17a87f['message']);});}})[_0x0d8b('0x22')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x22')](removeEntity(_0x2c1eb0,null))[_0x0d8b('0x43')](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x5a')]=function(_0x5a70bd,_0x199122,_0x12aef7){return db[_0x0d8b('0x55')]['transaction'](function(_0x2f19f4){var _0x532a85;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x5a70bd[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](function(_0x2b6eb6){if(_0x2b6eb6){_0x532a85=_0x2b6eb6;return _0x2b6eb6[_0x0d8b('0x5a')](_0x5a70bd['body']['id'],{'transaction':_0x2f19f4});}})[_0x0d8b('0x22')](function(_0x4c074d){if(_0x4c074d){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x5a70bd[_0x0d8b('0x47')]['id']},'attributes':['id',_0x0d8b('0x27'),'save_name',_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2332fc){if(_0x2332fc){var _0x2ccdae=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x5f'),util[_0x0d8b('0x60')](_0x0d8b('0x61'),path['basename'](_0x2332fc['save_name'],path[_0x0d8b('0x62')](_0x2332fc[_0x0d8b('0x63')])),_0x2332fc['converted_format']));var _0xb1aa96=path['join'](config['root'],_0x0d8b('0x4e'),_0x532a85[_0x0d8b('0x27')],util['format']('%s.%s',_0x2332fc[_0x0d8b('0x27')],_0x2332fc[_0x0d8b('0x5d')]));fs[_0x0d8b('0x64')](_0x2ccdae,_0xb1aa96);return _0x2332fc;}})[_0x0d8b('0x43')](function(_0x2ab72b){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x2ab72b['message']);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x199122,null))['then'](respondWithResult(_0x199122,0xc9))[_0x0d8b('0x43')](handleError(_0x199122,null));};exports[_0x0d8b('0x66')]=function(_0x2bb690,_0x14a34b,_0x49f610){return db[_0x0d8b('0x55')]['transaction'](function(_0x3a356b){var _0x2c6c5f;return db[_0x0d8b('0x3d')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](function(_0x91aa89){if(_0x91aa89){_0x2c6c5f=_0x91aa89;return _0x91aa89[_0x0d8b('0x66')](_0x2bb690[_0x0d8b('0x44')]['id2']);}})[_0x0d8b('0x22')](function(_0x54c28b){if(_0x54c28b){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690['params'][_0x0d8b('0x67')]},'attributes':['id','name',_0x0d8b('0x63'),_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2242cd){if(_0x2242cd){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x2c6c5f[_0x0d8b('0x4b')],util['format'](_0x0d8b('0x61'),_0x2242cd[_0x0d8b('0x27')],_0x2242cd['converted_format'])));return _0x2242cd;}})[_0x0d8b('0x43')](function(_0x105df9){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x105df9[_0x0d8b('0x68')]);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](respondWithStatusCode(_0x14a34b,0xcc))[_0x0d8b('0x43')](handleError(_0x14a34b,null));};exports[_0x0d8b('0x69')]=function(_0x5007c0,_0xe35028,_0x16df83){var _0x50c0ff={};var _0x1ece98={};var _0x93fc55;var _0x3acffa;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5007c0[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0xe35028,null))[_0x0d8b('0x22')](function(_0x5b76af){if(_0x5b76af){_0x93fc55=_0x5b76af;_0x1ece98['model']=_[_0x0d8b('0x45')](db[_0x0d8b('0x5b')][_0x0d8b('0x2a')]);_0x1ece98[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x5007c0[_0x0d8b('0x2c')]);_0x1ece98[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],_0x1ece98[_0x0d8b('0x2c')]);_0x50c0ff[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],qs['fields'](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x31')]));_0x50c0ff['attributes']=_0x50c0ff['attributes'][_0x0d8b('0x32')]?_0x50c0ff[_0x0d8b('0x30')]:_0x1ece98[_0x0d8b('0x2f')];_0x50c0ff[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x5007c0[_0x0d8b('0x2c')]['sort']);_0x50c0ff['where']=qs['filters'](_[_0x0d8b('0x37')](_0x5007c0[_0x0d8b('0x2c')],_0x1ece98[_0x0d8b('0x2d')]));if(_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x50c0ff[_0x0d8b('0x39')]=_['merge'](_0x50c0ff[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x50c0ff['attributes'],function(_0x30a69d){var _0x57e3c2={};_0x57e3c2[_0x30a69d]={'$like':'%'+_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x57e3c2;})});}_0x50c0ff=_[_0x0d8b('0x3a')]({},_0x50c0ff,_0x5007c0[_0x0d8b('0x6a')]);return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x424f9d){if(_0x424f9d){_0x3acffa=_0x424f9d[_0x0d8b('0x32')];if(!_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x50c0ff[_0x0d8b('0x1b')]=qs['limit'](_0x5007c0['query'][_0x0d8b('0x1b')]);_0x50c0ff[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x54674f){if(_0x54674f){return _0x54674f?{'count':_0x3acffa,'rows':_0x54674f}:null;}})[_0x0d8b('0x22')](respondWithResult(_0xe35028,null))['catch'](handleError(_0xe35028,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 4826af7..1673953 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 _0xbfe1=['request-promise','path','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x22ed32,_0x37dedf){var _0x1e8eee=function(_0x5469fa){while(--_0x5469fa){_0x22ed32['push'](_0x22ed32['shift']());}};_0x1e8eee(++_0x37dedf);}(_0xbfe1,0xe1));var _0x1bfe=function(_0x2cb2e6,_0x401618){_0x2cb2e6=_0x2cb2e6-0x0;var _0x8c40d9=_0xbfe1[_0x2cb2e6];return _0x8c40d9;};'use strict';var _=require(_0x1bfe('0x0'));var util=require(_0x1bfe('0x1'));var logger=require(_0x1bfe('0x2'))(_0x1bfe('0x3'));var moment=require(_0x1bfe('0x4'));var BPromise=require(_0x1bfe('0x5'));var rp=require(_0x1bfe('0x6'));var fs=require('fs');var path=require(_0x1bfe('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bfe('0x8'));module[_0x1bfe('0x9')]=function(_0x414c5,_0x2c6848){return _0x414c5['define'](_0x1bfe('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45b2=['request-promise','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x5946e3,_0x47da7f){var _0x5962b1=function(_0x45d73b){while(--_0x45d73b){_0x5946e3['push'](_0x5946e3['shift']());}};_0x5962b1(++_0x47da7f);}(_0x45b2,0xcd));var _0x245b=function(_0x2549c8,_0x406f29){_0x2549c8=_0x2549c8-0x0;var _0x4fcefa=_0x45b2[_0x2549c8];return _0x4fcefa;};'use strict';var _=require(_0x245b('0x0'));var util=require(_0x245b('0x1'));var logger=require(_0x245b('0x2'))(_0x245b('0x3'));var moment=require(_0x245b('0x4'));var BPromise=require('bluebird');var rp=require(_0x245b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x245b('0x6'));module['exports']=function(_0x13b5b1,_0x31e14c){return _0x13b5b1[_0x245b('0x7')](_0x245b('0x8'),attributes,{'tableName':_0x245b('0x9'),'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 9d7fa6a..d7b3ad3 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 _0xeaef=['request','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','message','error','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x34c6bd,_0x5af7fc){var _0x2e251a=function(_0x516837){while(--_0x516837){_0x34c6bd['push'](_0x34c6bd['shift']());}};_0x2e251a(++_0x5af7fc);}(_0xeaef,0xe6));var _0xfeae=function(_0x2a3eb3,_0x2c71a6){_0x2a3eb3=_0x2a3eb3-0x0;var _0x51eede=_0xeaef[_0x2a3eb3];return _0x51eede;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var moment=require(_0xfeae('0x2'));var BPromise=require(_0xfeae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfeae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfeae('0x5'));var logger=require(_0xfeae('0x6'))(_0xfeae('0x7'));var config=require(_0xfeae('0x8'));var jayson=require(_0xfeae('0x9'));var client=jayson[_0xfeae('0xa')][_0xfeae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2684be,_0x5aca52,_0x588b54){return new BPromise(function(_0x3f3f0b,_0x1b2b19){return client[_0xfeae('0xc')](_0x2684be,_0x588b54)['then'](function(_0xb79d01){logger[_0xfeae('0xd')](_0xfeae('0xe'),_0x5aca52,'request\x20sent');logger[_0xfeae('0xf')](_0xfeae('0x10'),_0x5aca52,'request\x20sent',JSON[_0xfeae('0x11')](_0xb79d01));if(_0xb79d01['error']){if(_0xb79d01['error']['code']===0x1f4){logger['error'](_0xfeae('0xe'),_0x5aca52,_0xb79d01['error'][_0xfeae('0x12')]);return _0x1b2b19(_0xb79d01[_0xfeae('0x13')][_0xfeae('0x12')]);}logger[_0xfeae('0x13')](_0xfeae('0xe'),_0x5aca52,_0xb79d01[_0xfeae('0x13')]['message']);return _0x3f3f0b(_0xb79d01[_0xfeae('0x13')][_0xfeae('0x12')]);}else{logger[_0xfeae('0xd')](_0xfeae('0xe'),_0x5aca52,'request\x20sent');_0x3f3f0b(_0xb79d01[_0xfeae('0x14')][_0xfeae('0x12')]);}})[_0xfeae('0x15')](function(_0x52eb11){logger[_0xfeae('0x13')](_0xfeae('0xe'),_0x5aca52,_0x52eb11);_0x1b2b19(_0x52eb11);});});} \ No newline at end of file +var _0x94c3=['request','then','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMusicOnHold,\x20%s,\x20%s','result','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xca226c,_0x2a1e1e){var _0x56f52a=function(_0x3d3bb3){while(--_0x3d3bb3){_0xca226c['push'](_0xca226c['shift']());}};_0x56f52a(++_0x2a1e1e);}(_0x94c3,0xbc));var _0x394c=function(_0x5880ac,_0x512f8d){_0x5880ac=_0x5880ac-0x0;var _0x134010=_0x94c3[_0x5880ac];return _0x134010;};'use strict';var _=require(_0x394c('0x0'));var util=require(_0x394c('0x1'));var moment=require(_0x394c('0x2'));var BPromise=require('bluebird');var rs=require(_0x394c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x394c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x394c('0x5'));var config=require(_0x394c('0x6'));var jayson=require(_0x394c('0x7'));var client=jayson[_0x394c('0x8')][_0x394c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25b7f5,_0x46aaaa,_0x3fb656){return new BPromise(function(_0x23d7a1,_0x4d3d0a){return client[_0x394c('0xa')](_0x25b7f5,_0x3fb656)[_0x394c('0xb')](function(_0x8d858d){logger[_0x394c('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x46aaaa,_0x394c('0xd'));logger[_0x394c('0xe')](_0x394c('0xf'),_0x46aaaa,_0x394c('0xd'),JSON[_0x394c('0x10')](_0x8d858d));if(_0x8d858d[_0x394c('0x11')]){if(_0x8d858d[_0x394c('0x11')][_0x394c('0x12')]===0x1f4){logger[_0x394c('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x46aaaa,_0x8d858d[_0x394c('0x11')][_0x394c('0x13')]);return _0x4d3d0a(_0x8d858d[_0x394c('0x11')]['message']);}logger[_0x394c('0x11')](_0x394c('0x14'),_0x46aaaa,_0x8d858d[_0x394c('0x11')][_0x394c('0x13')]);return _0x23d7a1(_0x8d858d[_0x394c('0x11')]['message']);}else{logger[_0x394c('0xc')](_0x394c('0x14'),_0x46aaaa,'request\x20sent');_0x23d7a1(_0x8d858d[_0x394c('0x15')][_0x394c('0x13')]);}})['catch'](function(_0x41d85a){logger[_0x394c('0x11')](_0x394c('0x14'),_0x46aaaa,_0x41d85a);_0x4d3d0a(_0x41d85a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6caf15c..3f47e4b 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 _0x7166=['getAgents','post','/:id/users','addAgents','put','/:id','update','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x41ee40,_0x1d020f){var _0x4d0d61=function(_0x59d80d){while(--_0x59d80d){_0x41ee40['push'](_0x41ee40['shift']());}};_0x4d0d61(++_0x1d020f);}(_0x7166,0x127));var _0x6716=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7166[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x6716('0x0'));var util=require(_0x6716('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6716('0x2'));var router=express['Router']();var auth=require(_0x6716('0x3'));var interaction=require(_0x6716('0x4'));var config=require(_0x6716('0x5'));var controller=require(_0x6716('0x6'));router[_0x6716('0x7')]('/',auth[_0x6716('0x8')](),controller[_0x6716('0x9')]);router['get'](_0x6716('0xa'),auth[_0x6716('0x8')](),controller[_0x6716('0xb')]);router[_0x6716('0x7')]('/:id',auth[_0x6716('0x8')](),controller[_0x6716('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x6716('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6716('0xe')](_0x6716('0xf'),auth[_0x6716('0x8')](),controller[_0x6716('0x10')]);router[_0x6716('0x11')](_0x6716('0x12'),auth[_0x6716('0x8')](),controller[_0x6716('0x13')]);router[_0x6716('0x14')](_0x6716('0x12'),auth[_0x6716('0x8')](),controller['destroy']);router[_0x6716('0x14')](_0x6716('0xf'),auth[_0x6716('0x8')](),controller['removeAgents']);module[_0x6716('0x15')]=router; \ No newline at end of file +var _0xf5d4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users','getAgents','post','create','addAgents','put','delete','destroy','exports','multer'];(function(_0x118da4,_0x2e192e){var _0x40dfbb=function(_0x43b165){while(--_0x43b165){_0x118da4['push'](_0x118da4['shift']());}};_0x40dfbb(++_0x2e192e);}(_0xf5d4,0x18f));var _0x4f5d=function(_0x2c83c4,_0x7c9638){_0x2c83c4=_0x2c83c4-0x0;var _0x531a31=_0xf5d4[_0x2c83c4];return _0x531a31;};'use strict';var multer=require(_0x4f5d('0x0'));var util=require(_0x4f5d('0x1'));var path=require(_0x4f5d('0x2'));var timeout=require(_0x4f5d('0x3'));var express=require(_0x4f5d('0x4'));var router=express[_0x4f5d('0x5')]();var auth=require(_0x4f5d('0x6'));var interaction=require(_0x4f5d('0x7'));var config=require(_0x4f5d('0x8'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x4f5d('0x9')](),controller[_0x4f5d('0xa')]);router['get'](_0x4f5d('0xb'),auth[_0x4f5d('0x9')](),controller[_0x4f5d('0xc')]);router[_0x4f5d('0xd')](_0x4f5d('0xe'),auth[_0x4f5d('0x9')](),controller[_0x4f5d('0xf')]);router[_0x4f5d('0xd')](_0x4f5d('0x10'),auth[_0x4f5d('0x9')](),controller[_0x4f5d('0x11')]);router[_0x4f5d('0x12')]('/',auth[_0x4f5d('0x9')](),controller[_0x4f5d('0x13')]);router[_0x4f5d('0x12')](_0x4f5d('0x10'),auth[_0x4f5d('0x9')](),controller[_0x4f5d('0x14')]);router[_0x4f5d('0x15')](_0x4f5d('0xe'),auth[_0x4f5d('0x9')](),controller['update']);router[_0x4f5d('0x16')](_0x4f5d('0xe'),auth['isAuthenticated'](),controller[_0x4f5d('0x17')]);router[_0x4f5d('0x16')]('/:id/users',auth[_0x4f5d('0x9')](),controller['removeAgents']);module[_0x4f5d('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 07a5930..76851e4 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 _0xd005=['STRING','VIRTUAL','system-','name','INTEGER','sequelize'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xd005,0x17f));var _0x5d00=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd005[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x5d00('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d00('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x5d00('0x2')],'get':function(_0x182c67){return _0x5d00('0x3')+this['getDataValue'](_0x5d00('0x4'))+'-';}},'description':{'type':Sequelize[_0x5d00('0x1')]},'callerIdAll':{'type':Sequelize[_0x5d00('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5d00('0x5')]}}; \ No newline at end of file +var _0x5b14=['sequelize','exports','STRING','name','VIRTUAL','system-','INTEGER'];(function(_0x9902b5,_0x5243d0){var _0x283fa9=function(_0x305c7c){while(--_0x305c7c){_0x9902b5['push'](_0x9902b5['shift']());}};_0x283fa9(++_0x5243d0);}(_0x5b14,0xfc));var _0x45b1=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x5b14[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0x45b1('0x0'));module[_0x45b1('0x1')]={'name':{'type':Sequelize[_0x45b1('0x2')],'allowNull':![],'unique':_0x45b1('0x3')},'prefix':{'type':Sequelize[_0x45b1('0x4')],'get':function(_0x28237f){return _0x45b1('0x5')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0x45b1('0x2')]},'callerIdAll':{'type':Sequelize[_0x45b1('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x45b1('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 12535b9..9ad6153 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 _0x7849=['CDR(prefix)=','callerIdAll','push','NoOp','context','${EXTEN:','charAt','body','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','VoicePrefixes','name','send','index','map','VoicePrefix','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','length','find','params','describe','create','sequelize','transaction','get','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7849,0x89));var _0x9784=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7849[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x9784('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9784('0x1'));var zipdir=require(_0x9784('0x2'));var jsonpatch=require(_0x9784('0x3'));var rp=require(_0x9784('0x4'));var moment=require(_0x9784('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9784('0x6'));var util=require(_0x9784('0x7'));var path=require('path');var sox=require(_0x9784('0x8'));var csv=require(_0x9784('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9784('0xa'));var jsforce=require(_0x9784('0xb'));var deskjs=require(_0x9784('0xc'));var toCsv=require(_0x9784('0x9'));var querystring=require(_0x9784('0xd'));var Papa=require(_0x9784('0xe'));var Redis=require('ioredis');var authService=require(_0x9784('0xf'));var qs=require(_0x9784('0x10'));var as=require(_0x9784('0x11'));var hardwareService=require(_0x9784('0x12'));var logger=require(_0x9784('0x13'))('api');var utils=require(_0x9784('0x14'));var config=require(_0x9784('0x15'));var db=require(_0x9784('0x16'))['db'];config[_0x9784('0x17')]=_[_0x9784('0x18')](config[_0x9784('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9784('0x19'))(new Redis(config[_0x9784('0x17')]));require(_0x9784('0x1a'))['register'](socket);function respondWithStatusCode(_0x31dc1c,_0x2a2b6e){_0x2a2b6e=_0x2a2b6e||0xcc;return function(_0x25da20){if(_0x25da20){return _0x31dc1c[_0x9784('0x1b')](_0x2a2b6e);}return _0x31dc1c['status'](_0x2a2b6e)[_0x9784('0x1c')]();};}function respondWithResult(_0x1f2ab0,_0x26cf32){_0x26cf32=_0x26cf32||0xc8;return function(_0x1876e0){if(_0x1876e0){return _0x1f2ab0[_0x9784('0x1d')](_0x26cf32)['json'](_0x1876e0);}};}function respondWithFilteredResult(_0x4ff63d,_0x2ccd0d){return function(_0x16d7d4){if(_0x16d7d4){var _0x27f2bc=_0x16d7d4[_0x9784('0x1e')],_0x2a5a4f=_0x2ccd0d[_0x9784('0x1f')],_0x5a5504=_0x2ccd0d[_0x9784('0x1f')]+_0x2ccd0d[_0x9784('0x20')],_0x109141;if(_0x5a5504>=_0x27f2bc){_0x5a5504=_0x27f2bc;_0x109141=0xc8;}else{_0x109141=0xce;}_0x4ff63d[_0x9784('0x1d')](_0x109141);return _0x4ff63d['set'](_0x9784('0x21'),_0x2a5a4f+'-'+_0x5a5504+'/'+_0x27f2bc)[_0x9784('0x22')](_0x16d7d4);}return null;};}function patchUpdates(_0x2949d4){return function(_0x3e18f3){try{jsonpatch[_0x9784('0x23')](_0x3e18f3,_0x2949d4,!![]);}catch(_0x2989a3){return BPromise['reject'](_0x2989a3);}return _0x3e18f3[_0x9784('0x24')]();};}function saveUpdates(_0x3b3225,_0x570034){return function(_0x395158){if(_0x395158){return _0x395158[_0x9784('0x25')](_0x3b3225)[_0x9784('0x26')](function(_0x5da52f){return _0x5da52f;});}return null;};}function removeEntity(_0x273449,_0x305c11){return function(_0x351f5f){if(_0x351f5f){return _0x351f5f[_0x9784('0x27')]()[_0x9784('0x26')](function(){var _0x11b9c5=_0x351f5f['get']({'plain':!![]});var _0x3c6aac=_0x9784('0x28');return db['UserProfileResource'][_0x9784('0x27')]({'where':{'type':_0x3c6aac,'resourceId':_0x11b9c5['id']}})[_0x9784('0x26')](function(){return _0x351f5f;});})['then'](function(){_0x273449[_0x9784('0x1d')](0xcc)[_0x9784('0x1c')]();});}};}function handleEntityNotFound(_0x69ed6a,_0x1842d9){return function(_0x46e05f){if(!_0x46e05f){_0x69ed6a['sendStatus'](0x194);}return _0x46e05f;};}function handleError(_0x150dde,_0x454b39){_0x454b39=_0x454b39||0x1f4;return function(_0x222b19){logger['error'](_0x222b19['stack']);if(_0x222b19[_0x9784('0x29')]){delete _0x222b19['name'];}_0x150dde[_0x9784('0x1d')](_0x454b39)[_0x9784('0x2a')](_0x222b19);};}exports[_0x9784('0x2b')]=function(_0x4267c1,_0x48d8d2){var _0x22f2ae={},_0x4d73b2={},_0x570e2f={'count':0x0,'rows':[]};var _0x13e4e0=_[_0x9784('0x2c')](db[_0x9784('0x2d')]['rawAttributes'],function(_0x51a763){return{'name':_0x51a763[_0x9784('0x2e')],'type':_0x51a763[_0x9784('0x2f')][_0x9784('0x30')]};});_0x4d73b2['model']=_[_0x9784('0x2c')](_0x13e4e0,'name');_0x4d73b2[_0x9784('0x31')]=_[_0x9784('0x32')](_0x4267c1['query']);_0x4d73b2['filters']=_[_0x9784('0x33')](_0x4d73b2[_0x9784('0x34')],_0x4d73b2[_0x9784('0x31')]);_0x22f2ae[_0x9784('0x35')]=_['intersection'](_0x4d73b2[_0x9784('0x34')],qs[_0x9784('0x36')](_0x4267c1[_0x9784('0x31')][_0x9784('0x36')]));_0x22f2ae[_0x9784('0x35')]=_0x22f2ae['attributes']['length']?_0x22f2ae['attributes']:_0x4d73b2[_0x9784('0x34')];if(!_0x4267c1[_0x9784('0x31')][_0x9784('0x37')](_0x9784('0x38'))){_0x22f2ae[_0x9784('0x20')]=qs[_0x9784('0x20')](_0x4267c1[_0x9784('0x31')][_0x9784('0x20')]);_0x22f2ae['offset']=qs[_0x9784('0x1f')](_0x4267c1[_0x9784('0x31')][_0x9784('0x1f')]);}_0x22f2ae[_0x9784('0x39')]=qs['sort'](_0x4267c1['query'][_0x9784('0x3a')]);_0x22f2ae[_0x9784('0x3b')]=qs['filters'](_[_0x9784('0x3c')](_0x4267c1[_0x9784('0x31')],_0x4d73b2[_0x9784('0x3d')]),_0x13e4e0);if(_0x4267c1[_0x9784('0x31')][_0x9784('0x3e')]){_0x22f2ae[_0x9784('0x3b')]=_[_0x9784('0x3f')](_0x22f2ae['where'],{'$or':_[_0x9784('0x2c')](_0x13e4e0,function(_0x23af84){if(_0x23af84[_0x9784('0x2f')]!==_0x9784('0x40')){var _0x3f156f={};_0x3f156f[_0x23af84['name']]={'$like':'%'+_0x4267c1[_0x9784('0x31')][_0x9784('0x3e')]+'%'};return _0x3f156f;}})});}_0x22f2ae=_[_0x9784('0x3f')]({},_0x22f2ae,_0x4267c1[_0x9784('0x41')]);var _0x36c234={'where':_0x22f2ae['where']};return db['VoicePrefix'][_0x9784('0x1e')](_0x36c234)[_0x9784('0x26')](function(_0x1ba928){_0x570e2f[_0x9784('0x1e')]=_0x1ba928;if(_0x4267c1['query'][_0x9784('0x42')]){_0x22f2ae[_0x9784('0x43')]=[{'all':!![]}];}return db[_0x9784('0x2d')]['findAll'](_0x22f2ae);})[_0x9784('0x26')](function(_0x2164d8){_0x570e2f['rows']=_0x2164d8;return _0x570e2f;})['then'](respondWithFilteredResult(_0x48d8d2,_0x22f2ae))[_0x9784('0x44')](handleError(_0x48d8d2,null));};exports[_0x9784('0x45')]=function(_0x2cd34d,_0x1b0274){var _0xf49a47={'raw':![],'where':{'id':_0x2cd34d['params']['id']}},_0x1a5124={};_0x1a5124[_0x9784('0x34')]=_['keys'](db[_0x9784('0x2d')][_0x9784('0x46')]);_0x1a5124[_0x9784('0x31')]=_[_0x9784('0x32')](_0x2cd34d['query']);_0x1a5124[_0x9784('0x3d')]=_['intersection'](_0x1a5124[_0x9784('0x34')],_0x1a5124[_0x9784('0x31')]);_0xf49a47['attributes']=_[_0x9784('0x33')](_0x1a5124['model'],qs[_0x9784('0x36')](_0x2cd34d[_0x9784('0x31')][_0x9784('0x36')]));_0xf49a47['attributes']=_0xf49a47[_0x9784('0x35')][_0x9784('0x47')]?_0xf49a47['attributes']:_0x1a5124[_0x9784('0x34')];if(_0x2cd34d[_0x9784('0x31')]['includeAll']){_0xf49a47['include']=[{'all':!![]}];}_0xf49a47=_['merge']({},_0xf49a47,_0x2cd34d[_0x9784('0x41')]);return db[_0x9784('0x2d')]['find'](_0xf49a47)['then'](handleEntityNotFound(_0x1b0274,null))[_0x9784('0x26')](respondWithResult(_0x1b0274,null))[_0x9784('0x44')](handleError(_0x1b0274,null));};exports['destroy']=function(_0x9bfa97,_0x1d8a2b){return db['VoicePrefix'][_0x9784('0x48')]({'where':{'id':_0x9bfa97[_0x9784('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d8a2b,null))['then'](removeEntity(_0x1d8a2b,null))[_0x9784('0x44')](handleError(_0x1d8a2b,null));};exports[_0x9784('0x4a')]=function(_0x174949,_0x4772c4){return db[_0x9784('0x2d')]['describe']()[_0x9784('0x26')](respondWithResult(_0x4772c4,null))[_0x9784('0x44')](handleError(_0x4772c4,null));};exports[_0x9784('0x4b')]=function(_0x3cf793,_0x3d5be1){var _0x60ece9;return db[_0x9784('0x4c')][_0x9784('0x4d')](function(_0x54ea40){return db[_0x9784('0x2d')][_0x9784('0x4b')](_0x3cf793['body'],{'transaction':_0x54ea40})[_0x9784('0x26')](function(_0xe7fb28){_0x60ece9=_0xe7fb28[_0x9784('0x4e')]({'plain':!![]});return db['VoiceExtension'][_0x9784('0x48')]({'where':{'id':_0x60ece9[_0x9784('0x4f')]},'raw':!![]})[_0x9784('0x26')](function(_0x137fbf){return createVoicePrefixExtensions(_0x60ece9,_0x137fbf,_0x54ea40);});});})[_0x9784('0x26')](function(){var _0x24637a=_0x3cf793[_0x9784('0x50')]['get']({'plain':!![]});if(!_0x24637a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24637a[_0x9784('0x51')]===_0x9784('0x50')){var _0x5ac850=_0x60ece9;return db[_0x9784('0x52')][_0x9784('0x48')]({'where':{'name':_0x9784('0x28'),'userProfileId':_0x24637a[_0x9784('0x53')]},'raw':!![]})['then'](function(_0x3a4d47){if(_0x3a4d47&&_0x3a4d47[_0x9784('0x54')]===0x0){return db[_0x9784('0x55')][_0x9784('0x4b')]({'name':_0x5ac850[_0x9784('0x29')],'resourceId':_0x5ac850['id'],'type':_0x3a4d47['name'],'sectionId':_0x3a4d47['id']},{})[_0x9784('0x26')](function(){return _0x60ece9;});}else{return _0x60ece9;}})['catch'](function(_0x2176b0){logger[_0x9784('0x56')](_0x9784('0x57'),_0x2176b0);throw _0x2176b0;});}return _0x60ece9;})[_0x9784('0x26')](respondWithResult(_0x3d5be1,null))[_0x9784('0x44')](handleError(_0x3d5be1,null));};function Extension(_0x26d731,_0x388db8,_0x412c3f,_0x50d379){this['context']='from-sip';this[_0x9784('0x58')]=_0x26d731;this[_0x9784('0x59')]=_0x412c3f;this[_0x9784('0x2f')]=_0x9784('0x5a');this[_0x9784('0x5b')]=_0x9784('0x5c');this[_0x9784('0x5d')]=_0x388db8;this[_0x9784('0x5e')]=_0x50d379;}function createVoicePrefixExtensions(_0x19c591,_0x2cc26f,_0x52bffc){return new BPromise(function(_0x2216bc,_0x5b8f98){var _0xe03646=new Extension(formatPrefixName(_0x19c591[_0x9784('0x5f')]),0x1,'NoOp',_0x9784('0x60'));_0xe03646['VoicePrefixId']=_0x19c591['id'];return db['VoiceExtension'][_0x9784('0x4b')](_0xe03646,{'transaction':_0x52bffc})[_0x9784('0x26')](function(_0x1c949e){var _0x5956ae=_0x1c949e[_0x9784('0x4e')]({'plain':!![]});var _0x21f38f=_[_0x9784('0x2c')](addVoicePrefixExtensions(_0x19c591,_0x2cc26f),function(_0x20c116){_0x20c116[_0x9784('0x4f')]=_0x5956ae['id'];_0x20c116[_0x9784('0x61')]=_0x19c591['id'];return _0x20c116;});return db[_0x9784('0x62')][_0x9784('0x63')](_0x21f38f,{'transaction':_0x52bffc})[_0x9784('0x26')](function(_0x3c45cd){if(!_0x3c45cd){return _0x5b8f98(_0x9784('0x64'));}else{return _0x2216bc(_0x3c45cd);}})[_0x9784('0x44')](function(_0x4a4779){return _0x5b8f98(_0x4a4779);});});;});};function addVoicePrefixExtensions(_0x19d39f,_0x5a2238){var _0x59c81f=[];var _0x195448=formatPrefixName(_0x19d39f['prefix']);_0x59c81f['push'](new Extension(_0x195448,0x2,'Set',_0x9784('0x65')+_0x19d39f[_0x9784('0x29')]));if(_0x19d39f[_0x9784('0x66')]){_0x59c81f[_0x9784('0x67')](new Extension(_0x195448,0x3,'Set','PREFIX-CALLERIDALL='+_0x19d39f['callerIdAll']));}else{_0x59c81f['push'](new Extension(_0x195448,0x3,_0x9784('0x68'),'No\x20callerid\x20available'));}_0x59c81f[_0x9784('0x67')](new Extension(_0x195448,0x4,'goto',_0x5a2238[_0x9784('0x69')]+','+_0x9784('0x6a')+(0x8+_0x19d39f[_0x9784('0x29')][_0x9784('0x47')])+'}'+','+0x1));return _0x59c81f;}function formatPrefixName(_0x2831ae){var _0xa89157='_';for(var _0x22e075=0x0;_0x22e075<_0x2831ae['length'];_0x22e075++){if(_0x2831ae[_0x9784('0x6b')](_0x22e075)=='-'){_0xa89157+=_0x2831ae[_0x9784('0x6b')](_0x22e075);}else{_0xa89157+='['+_0x2831ae[_0x9784('0x6b')](_0x22e075)+']';}}_0xa89157+='.';return _0xa89157;}exports[_0x9784('0x25')]=function(_0x11866d,_0x47e4ca,_0x41557c){var _0x2d2234=_0x11866d[_0x9784('0x6c')];_0x2d2234[_0x9784('0x5f')]='system-'+_0x2d2234[_0x9784('0x29')]+'-';return db[_0x9784('0x4c')]['transaction'](function(_0x8b6244){return db[_0x9784('0x2d')][_0x9784('0x25')](_0x2d2234,{'where':{'id':_0x2d2234['id']},'transaction':_0x8b6244})['then'](function(){return db[_0x9784('0x62')][_0x9784('0x27')]({'where':{'VoicePrefixId':_0x2d2234['id']},'transaction':_0x8b6244})[_0x9784('0x26')](function(){return db[_0x9784('0x62')][_0x9784('0x48')]({'where':{'id':_0x2d2234['VoiceExtensionId']},'raw':!![]})[_0x9784('0x26')](function(_0xa9350e){return createVoicePrefixExtensions(_0x2d2234,_0xa9350e,_0x8b6244);});});});})[_0x9784('0x26')](function(){return db[_0x9784('0x2d')][_0x9784('0x6d')](_0x2d2234['id']);})[_0x9784('0x26')](respondWithResult(_0x47e4ca,null))[_0x9784('0x44')](handleError(_0x47e4ca,null));};exports[_0x9784('0x6e')]=function(_0x4807c4,_0x2d4806,_0x3e45b5){return db[_0x9784('0x2d')][_0x9784('0x48')]({'where':{'id':_0x4807c4['params']['id']}})[_0x9784('0x26')](handleEntityNotFound(_0x2d4806,null))['then'](function(_0x354ab3){if(_0x354ab3){return _0x354ab3[_0x9784('0x6e')](_0x4807c4[_0x9784('0x6c')][_0x9784('0x6f')],_[_0x9784('0x70')](_0x4807c4[_0x9784('0x6c')],[_0x9784('0x6f'),'id'])||{})[_0x9784('0x71')](function(_0x52b06a){for(var _0x5c282a=0x0;_0x5c282a<_0x4807c4['body'][_0x9784('0x6f')]['length'];_0x5c282a+=0x1){socket[_0x9784('0x72')]('userVoicePrefix:save',{'UserId':_0x4807c4[_0x9784('0x6c')][_0x9784('0x6f')][_0x5c282a],'VoicePrefixId':_0x4807c4['params']['id']});}return _0x52b06a;});}})[_0x9784('0x26')](respondWithResult(_0x2d4806,null))['catch'](handleError(_0x2d4806,null));};exports[_0x9784('0x73')]=function(_0x1883db,_0x42b0e3,_0x4a5309){return db['VoicePrefix'][_0x9784('0x48')]({'where':{'id':_0x1883db['params']['id']}})[_0x9784('0x26')](handleEntityNotFound(_0x42b0e3,null))[_0x9784('0x26')](function(_0x75a195){if(_0x75a195){return _0x75a195[_0x9784('0x73')](_0x1883db['query'][_0x9784('0x6f')])[_0x9784('0x26')](function(){if(_[_0x9784('0x74')](_0x1883db[_0x9784('0x31')][_0x9784('0x6f')])){for(var _0x5571fe=0x0;_0x5571fe<_0x1883db['query'][_0x9784('0x6f')][_0x9784('0x47')];_0x5571fe+=0x1){socket[_0x9784('0x72')](_0x9784('0x75'),{'UserId':Number(_0x1883db['query']['ids'][_0x5571fe]),'VoicePrefixId':Number(_0x1883db[_0x9784('0x49')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1883db['query'][_0x9784('0x6f')]),'VoicePrefixId':Number(_0x1883db[_0x9784('0x49')]['id'])});}});}})[_0x9784('0x26')](respondWithStatusCode(_0x42b0e3,null))['catch'](handleError(_0x42b0e3,null));};exports['getAgents']=function(_0x201c04,_0x48acb8,_0xb04f9d){var _0x551e3b={};var _0x26f5b6={};var _0x1f0203;var _0x5e8340;return db[_0x9784('0x2d')]['findOne']({'where':{'id':_0x201c04['params']['id']}})[_0x9784('0x26')](handleEntityNotFound(_0x48acb8,null))[_0x9784('0x26')](function(_0x5c952f){if(_0x5c952f){_0x1f0203=_0x5c952f;_0x26f5b6['model']=_[_0x9784('0x32')](db['User'][_0x9784('0x46')]);_0x26f5b6[_0x9784('0x31')]=_[_0x9784('0x32')](_0x201c04[_0x9784('0x31')]);_0x26f5b6[_0x9784('0x3d')]=_[_0x9784('0x33')](_0x26f5b6['model'],_0x26f5b6[_0x9784('0x31')]);_0x551e3b[_0x9784('0x35')]=_[_0x9784('0x33')](_0x26f5b6['model'],qs[_0x9784('0x36')](_0x201c04['query'][_0x9784('0x36')]));_0x551e3b['attributes']=_0x551e3b[_0x9784('0x35')][_0x9784('0x47')]?_0x551e3b[_0x9784('0x35')]:_0x26f5b6[_0x9784('0x34')];_0x551e3b[_0x9784('0x39')]=qs[_0x9784('0x3a')](_0x201c04[_0x9784('0x31')][_0x9784('0x3a')]);_0x551e3b['where']=qs[_0x9784('0x3d')](_[_0x9784('0x3c')](_0x201c04[_0x9784('0x31')],_0x26f5b6[_0x9784('0x3d')]));if(_0x201c04[_0x9784('0x31')]['filter']){_0x551e3b[_0x9784('0x3b')]=_[_0x9784('0x3f')](_0x551e3b[_0x9784('0x3b')],{'$or':_[_0x9784('0x2c')](_0x551e3b['attributes'],function(_0x370a06){var _0x26bc6b={};_0x26bc6b[_0x370a06]={'$like':'%'+_0x201c04[_0x9784('0x31')]['filter']+'%'};return _0x26bc6b;})});}_0x551e3b=_[_0x9784('0x3f')]({},_0x551e3b,_0x201c04[_0x9784('0x41')]);return _0x1f0203[_0x9784('0x76')](_0x551e3b);}})[_0x9784('0x26')](function(_0x4aa63c){if(_0x4aa63c){_0x5e8340=_0x4aa63c['length'];if(!_0x201c04[_0x9784('0x31')][_0x9784('0x37')](_0x9784('0x38'))){_0x551e3b['limit']=qs['limit'](_0x201c04['query'][_0x9784('0x20')]);_0x551e3b['offset']=qs[_0x9784('0x1f')](_0x201c04[_0x9784('0x31')][_0x9784('0x1f')]);}return _0x1f0203[_0x9784('0x76')](_0x551e3b);}})[_0x9784('0x26')](function(_0x5e0175){if(_0x5e0175){return _0x5e0175?{'count':_0x5e8340,'rows':_0x5e0175}:null;}})[_0x9784('0x26')](respondWithResult(_0x48acb8,null))[_0x9784('0x44')](handleError(_0x48acb8,null));}; \ No newline at end of file +var _0x2796=['sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','json','count','offset','limit','set','reject','save','destroy','then','get','VoicePrefixes','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','VoicePrefix','includeAll','include','findAll','rows','catch','params','intersection','find','describe','create','sequelize','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','system-','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','filter','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x8b010b,_0x1176a5){var _0x3caac6=function(_0x14927a){while(--_0x14927a){_0x8b010b['push'](_0x8b010b['shift']());}};_0x3caac6(++_0x1176a5);}(_0x2796,0x71));var _0x6279=function(_0x4e32e8,_0x3f489f){_0x4e32e8=_0x4e32e8-0x0;var _0x3941f5=_0x2796[_0x4e32e8];return _0x3941f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6279('0x0'));var rimraf=require(_0x6279('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6279('0x2'));var rp=require('request-promise');var moment=require(_0x6279('0x3'));var BPromise=require(_0x6279('0x4'));var Mustache=require(_0x6279('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6279('0x6'));var csv=require(_0x6279('0x7'));var ejs=require(_0x6279('0x8'));var fs=require('fs');var _=require(_0x6279('0x9'));var squel=require(_0x6279('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6279('0x7'));var querystring=require(_0x6279('0xb'));var Papa=require(_0x6279('0xc'));var Redis=require(_0x6279('0xd'));var authService=require(_0x6279('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6279('0xf'));var logger=require(_0x6279('0x10'))(_0x6279('0x11'));var utils=require(_0x6279('0x12'));var config=require(_0x6279('0x13'));var db=require('../../mysqldb')['db'];config[_0x6279('0x14')]=_[_0x6279('0x15')](config[_0x6279('0x14')],{'host':_0x6279('0x16'),'port':0x18eb});var socket=require(_0x6279('0x17'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x6279('0x18')](socket);function respondWithStatusCode(_0x59d920,_0x5a97bf){_0x5a97bf=_0x5a97bf||0xcc;return function(_0x57cc65){if(_0x57cc65){return _0x59d920['sendStatus'](_0x5a97bf);}return _0x59d920['status'](_0x5a97bf)['end']();};}function respondWithResult(_0x2f0797,_0x47699e){_0x47699e=_0x47699e||0xc8;return function(_0x39a07d){if(_0x39a07d){return _0x2f0797[_0x6279('0x19')](_0x47699e)[_0x6279('0x1a')](_0x39a07d);}};}function respondWithFilteredResult(_0x5d0b58,_0x436e31){return function(_0x5062de){if(_0x5062de){var _0x2c00d9=_0x5062de[_0x6279('0x1b')],_0x16716d=_0x436e31[_0x6279('0x1c')],_0x1e71e5=_0x436e31['offset']+_0x436e31[_0x6279('0x1d')],_0x148689;if(_0x1e71e5>=_0x2c00d9){_0x1e71e5=_0x2c00d9;_0x148689=0xc8;}else{_0x148689=0xce;}_0x5d0b58[_0x6279('0x19')](_0x148689);return _0x5d0b58[_0x6279('0x1e')]('Content-Range',_0x16716d+'-'+_0x1e71e5+'/'+_0x2c00d9)[_0x6279('0x1a')](_0x5062de);}return null;};}function patchUpdates(_0x27152c){return function(_0x1d6cd8){try{jsonpatch['apply'](_0x1d6cd8,_0x27152c,!![]);}catch(_0x11d7b0){return BPromise[_0x6279('0x1f')](_0x11d7b0);}return _0x1d6cd8[_0x6279('0x20')]();};}function saveUpdates(_0x488a8f,_0x457aec){return function(_0x467c6a){if(_0x467c6a){return _0x467c6a['update'](_0x488a8f)['then'](function(_0x52d34a){return _0x52d34a;});}return null;};}function removeEntity(_0x13fcf6,_0x538f45){return function(_0x163586){if(_0x163586){return _0x163586[_0x6279('0x21')]()[_0x6279('0x22')](function(){var _0x4330a7=_0x163586[_0x6279('0x23')]({'plain':!![]});var _0x28f5cb=_0x6279('0x24');return db[_0x6279('0x25')][_0x6279('0x21')]({'where':{'type':_0x28f5cb,'resourceId':_0x4330a7['id']}})[_0x6279('0x22')](function(){return _0x163586;});})[_0x6279('0x22')](function(){_0x13fcf6['status'](0xcc)[_0x6279('0x26')]();});}};}function handleEntityNotFound(_0x1b914d,_0x18729f){return function(_0x3bd236){if(!_0x3bd236){_0x1b914d[_0x6279('0x27')](0x194);}return _0x3bd236;};}function handleError(_0x37ab98,_0x340e48){_0x340e48=_0x340e48||0x1f4;return function(_0xb33448){logger[_0x6279('0x28')](_0xb33448[_0x6279('0x29')]);if(_0xb33448[_0x6279('0x2a')]){delete _0xb33448[_0x6279('0x2a')];}_0x37ab98[_0x6279('0x19')](_0x340e48)[_0x6279('0x2b')](_0xb33448);};}exports[_0x6279('0x2c')]=function(_0x238171,_0x5d179c){var _0x513eaf={},_0x5d978b={},_0x4f73e0={'count':0x0,'rows':[]};var _0x3ceb1c=_[_0x6279('0x2d')](db['VoicePrefix'][_0x6279('0x2e')],function(_0x5e7816){return{'name':_0x5e7816['fieldName'],'type':_0x5e7816['type'][_0x6279('0x2f')]};});_0x5d978b[_0x6279('0x30')]=_[_0x6279('0x2d')](_0x3ceb1c,'name');_0x5d978b[_0x6279('0x31')]=_[_0x6279('0x32')](_0x238171[_0x6279('0x31')]);_0x5d978b[_0x6279('0x33')]=_['intersection'](_0x5d978b[_0x6279('0x30')],_0x5d978b[_0x6279('0x31')]);_0x513eaf[_0x6279('0x34')]=_['intersection'](_0x5d978b[_0x6279('0x30')],qs[_0x6279('0x35')](_0x238171[_0x6279('0x31')][_0x6279('0x35')]));_0x513eaf[_0x6279('0x34')]=_0x513eaf[_0x6279('0x34')][_0x6279('0x36')]?_0x513eaf[_0x6279('0x34')]:_0x5d978b['model'];if(!_0x238171[_0x6279('0x31')][_0x6279('0x37')]('nolimit')){_0x513eaf[_0x6279('0x1d')]=qs[_0x6279('0x1d')](_0x238171[_0x6279('0x31')][_0x6279('0x1d')]);_0x513eaf[_0x6279('0x1c')]=qs['offset'](_0x238171['query'][_0x6279('0x1c')]);}_0x513eaf[_0x6279('0x38')]=qs['sort'](_0x238171[_0x6279('0x31')][_0x6279('0x39')]);_0x513eaf[_0x6279('0x3a')]=qs[_0x6279('0x33')](_[_0x6279('0x3b')](_0x238171[_0x6279('0x31')],_0x5d978b[_0x6279('0x33')]),_0x3ceb1c);if(_0x238171[_0x6279('0x31')]['filter']){_0x513eaf[_0x6279('0x3a')]=_[_0x6279('0x3c')](_0x513eaf[_0x6279('0x3a')],{'$or':_[_0x6279('0x2d')](_0x3ceb1c,function(_0x396359){if(_0x396359[_0x6279('0x3d')]!==_0x6279('0x3e')){var _0x2cdc3b={};_0x2cdc3b[_0x396359[_0x6279('0x2a')]]={'$like':'%'+_0x238171['query']['filter']+'%'};return _0x2cdc3b;}})});}_0x513eaf=_[_0x6279('0x3c')]({},_0x513eaf,_0x238171['options']);var _0x10db9a={'where':_0x513eaf[_0x6279('0x3a')]};return db[_0x6279('0x3f')]['count'](_0x10db9a)[_0x6279('0x22')](function(_0x5d2ffe){_0x4f73e0[_0x6279('0x1b')]=_0x5d2ffe;if(_0x238171[_0x6279('0x31')][_0x6279('0x40')]){_0x513eaf[_0x6279('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6279('0x42')](_0x513eaf);})[_0x6279('0x22')](function(_0x299100){_0x4f73e0[_0x6279('0x43')]=_0x299100;return _0x4f73e0;})[_0x6279('0x22')](respondWithFilteredResult(_0x5d179c,_0x513eaf))[_0x6279('0x44')](handleError(_0x5d179c,null));};exports['show']=function(_0xbfa85d,_0x3f4741){var _0x5ccb8a={'raw':![],'where':{'id':_0xbfa85d[_0x6279('0x45')]['id']}},_0x431fba={};_0x431fba[_0x6279('0x30')]=_['keys'](db[_0x6279('0x3f')]['rawAttributes']);_0x431fba[_0x6279('0x31')]=_[_0x6279('0x32')](_0xbfa85d[_0x6279('0x31')]);_0x431fba[_0x6279('0x33')]=_[_0x6279('0x46')](_0x431fba[_0x6279('0x30')],_0x431fba[_0x6279('0x31')]);_0x5ccb8a[_0x6279('0x34')]=_['intersection'](_0x431fba['model'],qs['fields'](_0xbfa85d[_0x6279('0x31')][_0x6279('0x35')]));_0x5ccb8a[_0x6279('0x34')]=_0x5ccb8a[_0x6279('0x34')][_0x6279('0x36')]?_0x5ccb8a[_0x6279('0x34')]:_0x431fba[_0x6279('0x30')];if(_0xbfa85d['query']['includeAll']){_0x5ccb8a[_0x6279('0x41')]=[{'all':!![]}];}_0x5ccb8a=_['merge']({},_0x5ccb8a,_0xbfa85d['options']);return db[_0x6279('0x3f')][_0x6279('0x47')](_0x5ccb8a)[_0x6279('0x22')](handleEntityNotFound(_0x3f4741,null))[_0x6279('0x22')](respondWithResult(_0x3f4741,null))[_0x6279('0x44')](handleError(_0x3f4741,null));};exports['destroy']=function(_0x1f7c1f,_0x20474f){return db[_0x6279('0x3f')]['find']({'where':{'id':_0x1f7c1f[_0x6279('0x45')]['id']}})[_0x6279('0x22')](handleEntityNotFound(_0x20474f,null))[_0x6279('0x22')](removeEntity(_0x20474f,null))[_0x6279('0x44')](handleError(_0x20474f,null));};exports[_0x6279('0x48')]=function(_0x729877,_0x744213){return db[_0x6279('0x3f')][_0x6279('0x48')]()[_0x6279('0x22')](respondWithResult(_0x744213,null))['catch'](handleError(_0x744213,null));};exports[_0x6279('0x49')]=function(_0x29cb98,_0x50eb9d){var _0x58b0ee;return db[_0x6279('0x4a')]['transaction'](function(_0x5de44c){return db['VoicePrefix'][_0x6279('0x49')](_0x29cb98[_0x6279('0x4b')],{'transaction':_0x5de44c})[_0x6279('0x22')](function(_0x4c456e){_0x58b0ee=_0x4c456e[_0x6279('0x23')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x58b0ee[_0x6279('0x4c')]},'raw':!![]})[_0x6279('0x22')](function(_0x1875a5){return createVoicePrefixExtensions(_0x58b0ee,_0x1875a5,_0x5de44c);});});})['then'](function(){var _0x4b55e8=_0x29cb98['user'][_0x6279('0x23')]({'plain':!![]});if(!_0x4b55e8)throw new Error(_0x6279('0x4d'));if(_0x4b55e8[_0x6279('0x4e')]===_0x6279('0x4f')){var _0x52ce3e=_0x58b0ee;return db[_0x6279('0x50')][_0x6279('0x47')]({'where':{'name':_0x6279('0x24'),'userProfileId':_0x4b55e8[_0x6279('0x51')]},'raw':!![]})[_0x6279('0x22')](function(_0x2ee53c){if(_0x2ee53c&&_0x2ee53c[_0x6279('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x52ce3e['name'],'resourceId':_0x52ce3e['id'],'type':_0x2ee53c[_0x6279('0x2a')],'sectionId':_0x2ee53c['id']},{})[_0x6279('0x22')](function(){return _0x58b0ee;});}else{return _0x58b0ee;}})[_0x6279('0x44')](function(_0x40472b){logger[_0x6279('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40472b);throw _0x40472b;});}return _0x58b0ee;})[_0x6279('0x22')](respondWithResult(_0x50eb9d,null))['catch'](handleError(_0x50eb9d,null));};function Extension(_0x414a33,_0x3d95e0,_0x361328,_0x50df6d){this[_0x6279('0x53')]=_0x6279('0x54');this['exten']=_0x414a33;this['app']=_0x361328;this[_0x6279('0x3d')]=_0x6279('0x55');this[_0x6279('0x56')]=_0x6279('0x57');this[_0x6279('0x58')]=_0x3d95e0;this['appdata']=_0x50df6d;}function createVoicePrefixExtensions(_0x634b60,_0xe858ea,_0x4ca7b8){return new BPromise(function(_0x488bf4,_0x3d4fad){var _0x3ca6b1=new Extension(formatPrefixName(_0x634b60[_0x6279('0x59')]),0x1,_0x6279('0x5a'),_0x6279('0x5b'));_0x3ca6b1['VoicePrefixId']=_0x634b60['id'];return db['VoiceExtension'][_0x6279('0x49')](_0x3ca6b1,{'transaction':_0x4ca7b8})[_0x6279('0x22')](function(_0x18edb6){var _0x39f4a9=_0x18edb6[_0x6279('0x23')]({'plain':!![]});var _0x5af469=_[_0x6279('0x2d')](addVoicePrefixExtensions(_0x634b60,_0xe858ea),function(_0x56e889){_0x56e889[_0x6279('0x4c')]=_0x39f4a9['id'];_0x56e889['VoicePrefixId']=_0x634b60['id'];return _0x56e889;});return db[_0x6279('0x5c')][_0x6279('0x5d')](_0x5af469,{'transaction':_0x4ca7b8})[_0x6279('0x22')](function(_0x51c57c){if(!_0x51c57c){return _0x3d4fad('Extensions\x20creation\x20failed');}else{return _0x488bf4(_0x51c57c);}})[_0x6279('0x44')](function(_0x1d0f39){return _0x3d4fad(_0x1d0f39);});});;});};function addVoicePrefixExtensions(_0x32e22f,_0x40ae8f){var _0x2da2e9=[];var _0x1b731b=formatPrefixName(_0x32e22f['prefix']);_0x2da2e9[_0x6279('0x5e')](new Extension(_0x1b731b,0x2,_0x6279('0x5f'),_0x6279('0x60')+_0x32e22f[_0x6279('0x2a')]));if(_0x32e22f['callerIdAll']){_0x2da2e9['push'](new Extension(_0x1b731b,0x3,_0x6279('0x5f'),'PREFIX-CALLERIDALL='+_0x32e22f[_0x6279('0x61')]));}else{_0x2da2e9[_0x6279('0x5e')](new Extension(_0x1b731b,0x3,_0x6279('0x5a'),_0x6279('0x62')));}_0x2da2e9[_0x6279('0x5e')](new Extension(_0x1b731b,0x4,_0x6279('0x63'),_0x40ae8f[_0x6279('0x53')]+','+_0x6279('0x64')+(0x8+_0x32e22f[_0x6279('0x2a')][_0x6279('0x36')])+'}'+','+0x1));return _0x2da2e9;}function formatPrefixName(_0x23acbc){var _0x32bb87='_';for(var _0x43ac87=0x0;_0x43ac87<_0x23acbc[_0x6279('0x36')];_0x43ac87++){if(_0x23acbc[_0x6279('0x65')](_0x43ac87)=='-'){_0x32bb87+=_0x23acbc[_0x6279('0x65')](_0x43ac87);}else{_0x32bb87+='['+_0x23acbc[_0x6279('0x65')](_0x43ac87)+']';}}_0x32bb87+='.';return _0x32bb87;}exports[_0x6279('0x66')]=function(_0x42ddcf,_0x2da4f7,_0x41c047){var _0x20bf4d=_0x42ddcf['body'];_0x20bf4d[_0x6279('0x59')]=_0x6279('0x67')+_0x20bf4d[_0x6279('0x2a')]+'-';return db[_0x6279('0x4a')][_0x6279('0x68')](function(_0x210a71){return db[_0x6279('0x3f')]['update'](_0x20bf4d,{'where':{'id':_0x20bf4d['id']},'transaction':_0x210a71})[_0x6279('0x22')](function(){return db[_0x6279('0x5c')][_0x6279('0x21')]({'where':{'VoicePrefixId':_0x20bf4d['id']},'transaction':_0x210a71})['then'](function(){return db[_0x6279('0x5c')][_0x6279('0x47')]({'where':{'id':_0x20bf4d['VoiceExtensionId']},'raw':!![]})[_0x6279('0x22')](function(_0x45ff0f){return createVoicePrefixExtensions(_0x20bf4d,_0x45ff0f,_0x210a71);});});});})[_0x6279('0x22')](function(){return db[_0x6279('0x3f')][_0x6279('0x69')](_0x20bf4d['id']);})['then'](respondWithResult(_0x2da4f7,null))[_0x6279('0x44')](handleError(_0x2da4f7,null));};exports[_0x6279('0x6a')]=function(_0x50f279,_0x318d93,_0x32a678){return db[_0x6279('0x3f')]['find']({'where':{'id':_0x50f279[_0x6279('0x45')]['id']}})[_0x6279('0x22')](handleEntityNotFound(_0x318d93,null))[_0x6279('0x22')](function(_0x46af06){if(_0x46af06){return _0x46af06[_0x6279('0x6a')](_0x50f279[_0x6279('0x4b')][_0x6279('0x6b')],_[_0x6279('0x6c')](_0x50f279[_0x6279('0x4b')],['ids','id'])||{})[_0x6279('0x6d')](function(_0x33688c){for(var _0x207b30=0x0;_0x207b30<_0x50f279[_0x6279('0x4b')][_0x6279('0x6b')]['length'];_0x207b30+=0x1){socket[_0x6279('0x6e')](_0x6279('0x6f'),{'UserId':_0x50f279[_0x6279('0x4b')][_0x6279('0x6b')][_0x207b30],'VoicePrefixId':_0x50f279[_0x6279('0x45')]['id']});}return _0x33688c;});}})[_0x6279('0x22')](respondWithResult(_0x318d93,null))[_0x6279('0x44')](handleError(_0x318d93,null));};exports[_0x6279('0x70')]=function(_0x3b4d78,_0x4f7e96,_0x1ab4bd){return db['VoicePrefix'][_0x6279('0x47')]({'where':{'id':_0x3b4d78[_0x6279('0x45')]['id']}})[_0x6279('0x22')](handleEntityNotFound(_0x4f7e96,null))[_0x6279('0x22')](function(_0x498157){if(_0x498157){return _0x498157[_0x6279('0x70')](_0x3b4d78[_0x6279('0x31')][_0x6279('0x6b')])[_0x6279('0x22')](function(){if(_[_0x6279('0x71')](_0x3b4d78[_0x6279('0x31')]['ids'])){for(var _0x4147d1=0x0;_0x4147d1<_0x3b4d78['query'][_0x6279('0x6b')]['length'];_0x4147d1+=0x1){socket['emit'](_0x6279('0x72'),{'UserId':Number(_0x3b4d78[_0x6279('0x31')][_0x6279('0x6b')][_0x4147d1]),'VoicePrefixId':Number(_0x3b4d78[_0x6279('0x45')]['id'])});}}else{socket['emit'](_0x6279('0x72'),{'UserId':Number(_0x3b4d78[_0x6279('0x31')][_0x6279('0x6b')]),'VoicePrefixId':Number(_0x3b4d78[_0x6279('0x45')]['id'])});}});}})[_0x6279('0x22')](respondWithStatusCode(_0x4f7e96,null))['catch'](handleError(_0x4f7e96,null));};exports[_0x6279('0x73')]=function(_0x29621b,_0x272266,_0x3bc0d0){var _0x35a2d5={};var _0x54101d={};var _0x5b4be5;var _0x4e0513;return db[_0x6279('0x3f')][_0x6279('0x74')]({'where':{'id':_0x29621b[_0x6279('0x45')]['id']}})[_0x6279('0x22')](handleEntityNotFound(_0x272266,null))[_0x6279('0x22')](function(_0x39f2f7){if(_0x39f2f7){_0x5b4be5=_0x39f2f7;_0x54101d[_0x6279('0x30')]=_[_0x6279('0x32')](db['User']['rawAttributes']);_0x54101d[_0x6279('0x31')]=_[_0x6279('0x32')](_0x29621b['query']);_0x54101d['filters']=_[_0x6279('0x46')](_0x54101d['model'],_0x54101d[_0x6279('0x31')]);_0x35a2d5['attributes']=_[_0x6279('0x46')](_0x54101d[_0x6279('0x30')],qs[_0x6279('0x35')](_0x29621b[_0x6279('0x31')]['fields']));_0x35a2d5[_0x6279('0x34')]=_0x35a2d5['attributes'][_0x6279('0x36')]?_0x35a2d5[_0x6279('0x34')]:_0x54101d[_0x6279('0x30')];_0x35a2d5[_0x6279('0x38')]=qs[_0x6279('0x39')](_0x29621b[_0x6279('0x31')][_0x6279('0x39')]);_0x35a2d5[_0x6279('0x3a')]=qs[_0x6279('0x33')](_[_0x6279('0x3b')](_0x29621b[_0x6279('0x31')],_0x54101d[_0x6279('0x33')]));if(_0x29621b[_0x6279('0x31')][_0x6279('0x75')]){_0x35a2d5[_0x6279('0x3a')]=_[_0x6279('0x3c')](_0x35a2d5[_0x6279('0x3a')],{'$or':_[_0x6279('0x2d')](_0x35a2d5[_0x6279('0x34')],function(_0x560a8d){var _0x52cf5c={};_0x52cf5c[_0x560a8d]={'$like':'%'+_0x29621b[_0x6279('0x31')][_0x6279('0x75')]+'%'};return _0x52cf5c;})});}_0x35a2d5=_['merge']({},_0x35a2d5,_0x29621b['options']);return _0x5b4be5[_0x6279('0x73')](_0x35a2d5);}})[_0x6279('0x22')](function(_0x51c57b){if(_0x51c57b){_0x4e0513=_0x51c57b[_0x6279('0x36')];if(!_0x29621b[_0x6279('0x31')][_0x6279('0x37')](_0x6279('0x76'))){_0x35a2d5[_0x6279('0x1d')]=qs['limit'](_0x29621b['query'][_0x6279('0x1d')]);_0x35a2d5['offset']=qs[_0x6279('0x1c')](_0x29621b[_0x6279('0x31')][_0x6279('0x1c')]);}return _0x5b4be5[_0x6279('0x73')](_0x35a2d5);}})[_0x6279('0x22')](function(_0x57c573){if(_0x57c573){return _0x57c573?{'count':_0x4e0513,'rows':_0x57c573}:null;}})['then'](respondWithResult(_0x272266,null))[_0x6279('0x44')](handleError(_0x272266,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 78c60ce..ab6e710 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 _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x16737b,_0x52493f){var _0x4657c5=function(_0x95352c){while(--_0x95352c){_0x16737b['push'](_0x16737b['shift']());}};_0x4657c5(++_0x52493f);}(_0x70e0,0x17b));var _0x070e=function(_0x32e9c3,_0x3eb118){_0x32e9c3=_0x32e9c3-0x0;var _0xb6d703=_0x70e0[_0x32e9c3];return _0xb6d703;};'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 +var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x500729,_0x32ed4a){var _0x2d2ab4=function(_0x2ff344){while(--_0x2ff344){_0x500729['push'](_0x500729['shift']());}};_0x2d2ab4(++_0x32ed4a);}(_0x70e0,0x17b));var _0x070e=function(_0x54111a,_0x54e5fc){_0x54111a=_0x54111a-0x0;var _0x459795=_0x70e0[_0x54111a];return _0x459795;};'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 d4a0f7e..ff8e86d 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 _0x15c5=['moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','api'];(function(_0x49a525,_0x13dc6c){var _0x331bbd=function(_0x1df324){while(--_0x1df324){_0x49a525['push'](_0x49a525['shift']());}};_0x331bbd(++_0x13dc6c);}(_0x15c5,0x183));var _0x515c=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0x15c5[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0x515c('0x0'));var util=require(_0x515c('0x1'));var logger=require('../../config/logger')(_0x515c('0x2'));var moment=require(_0x515c('0x3'));var BPromise=require(_0x515c('0x4'));var rp=require(_0x515c('0x5'));var fs=require('fs');var path=require(_0x515c('0x6'));var rimraf=require('rimraf');var config=require(_0x515c('0x7'));var attributes=require(_0x515c('0x8'));module[_0x515c('0x9')]=function(_0x1c5f52,_0x46a4fc){return _0x1c5f52[_0x515c('0xa')](_0x515c('0xb'),attributes,{'tableName':_0x515c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16f0=['VoicePrefix','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x1c4769,_0x200259){var _0x2883f7=function(_0x5a41be){while(--_0x5a41be){_0x1c4769['push'](_0x1c4769['shift']());}};_0x2883f7(++_0x200259);}(_0x16f0,0x140));var _0x016f=function(_0x456623,_0x1dda69){_0x456623=_0x456623-0x0;var _0x572cfd=_0x16f0[_0x456623];return _0x572cfd;};'use strict';var _=require(_0x016f('0x0'));var util=require(_0x016f('0x1'));var logger=require(_0x016f('0x2'))(_0x016f('0x3'));var moment=require(_0x016f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x016f('0x5'));var rimraf=require(_0x016f('0x6'));var config=require(_0x016f('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x016f('0x8')]=function(_0x340660,_0x2cab74){return _0x340660[_0x016f('0x9')](_0x016f('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 839c606..ccc8f95 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 _0xbeec=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x26a09d,_0x21aa2d){var _0x5c4fb4=function(_0x4672d7){while(--_0x4672d7){_0x26a09d['push'](_0x26a09d['shift']());}};_0x5c4fb4(++_0x21aa2d);}(_0xbeec,0xa6));var _0xcbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var moment=require(_0xcbee('0x2'));var BPromise=require(_0xcbee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbee('0x4'));var db=require(_0xcbee('0x5'))['db'];var utils=require(_0xcbee('0x6'));var logger=require(_0xcbee('0x7'))(_0xcbee('0x8'));var config=require(_0xcbee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcbee('0xa')][_0xcbee('0xb')]({'port':0x232a});config[_0xcbee('0xc')]=_[_0xcbee('0xd')](config[_0xcbee('0xc')],{'host':_0xcbee('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcbee('0xc')]));require(_0xcbee('0xf'))[_0xcbee('0x10')](socket);function respondWithRpcPromise(_0xe992fa,_0x1de7b2,_0x54c6f9){return new BPromise(function(_0x5bb960,_0x5bf757){return client[_0xcbee('0x11')](_0xe992fa,_0x54c6f9)[_0xcbee('0x12')](function(_0x222c34){logger['info'](_0xcbee('0x13'),_0x1de7b2,_0xcbee('0x14'));logger[_0xcbee('0x15')](_0xcbee('0x16'),_0x1de7b2,_0xcbee('0x14'),JSON['stringify'](_0x222c34));if(_0x222c34[_0xcbee('0x17')]){if(_0x222c34['error'][_0xcbee('0x18')]===0x1f4){logger[_0xcbee('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x1de7b2,_0x222c34['error'][_0xcbee('0x19')]);return _0x5bf757(_0x222c34[_0xcbee('0x17')][_0xcbee('0x19')]);}logger[_0xcbee('0x17')](_0xcbee('0x13'),_0x1de7b2,_0x222c34[_0xcbee('0x17')]['message']);return _0x5bb960(_0x222c34[_0xcbee('0x17')][_0xcbee('0x19')]);}else{logger['info'](_0xcbee('0x13'),_0x1de7b2,_0xcbee('0x14'));_0x5bb960(_0x222c34[_0xcbee('0x1a')][_0xcbee('0x19')]);}})[_0xcbee('0x1b')](function(_0x1faec8){logger[_0xcbee('0x17')](_0xcbee('0x13'),_0x1de7b2,_0x1faec8);_0x5bf757(_0x1faec8);});});} \ No newline at end of file +var _0x0c6c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0c6c,0x1e2));var _0xc0c6=function(_0x15b298,_0x5bd763){_0x15b298=_0x15b298-0x0;var _0x301ee4=_0x0c6c[_0x15b298];return _0x301ee4;};'use strict';var _=require(_0xc0c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc0c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0c6('0x2'));var db=require(_0xc0c6('0x3'))['db'];var utils=require(_0xc0c6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc0c6('0x6')][_0xc0c6('0x7')]({'port':0x232a});config[_0xc0c6('0x8')]=_[_0xc0c6('0x9')](config[_0xc0c6('0x8')],{'host':_0xc0c6('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0xc0c6('0xb')](socket);function respondWithRpcPromise(_0x324aea,_0x38eeac,_0x2266ae){return new BPromise(function(_0x52e7d7,_0x5547cd){return client[_0xc0c6('0xc')](_0x324aea,_0x2266ae)['then'](function(_0x3617b7){logger[_0xc0c6('0xd')](_0xc0c6('0xe'),_0x38eeac,_0xc0c6('0xf'));logger[_0xc0c6('0x10')](_0xc0c6('0x11'),_0x38eeac,_0xc0c6('0xf'),JSON['stringify'](_0x3617b7));if(_0x3617b7[_0xc0c6('0x12')]){if(_0x3617b7[_0xc0c6('0x12')][_0xc0c6('0x13')]===0x1f4){logger[_0xc0c6('0x12')](_0xc0c6('0xe'),_0x38eeac,_0x3617b7[_0xc0c6('0x12')][_0xc0c6('0x14')]);return _0x5547cd(_0x3617b7[_0xc0c6('0x12')][_0xc0c6('0x14')]);}logger['error'](_0xc0c6('0xe'),_0x38eeac,_0x3617b7['error'][_0xc0c6('0x14')]);return _0x52e7d7(_0x3617b7[_0xc0c6('0x12')][_0xc0c6('0x14')]);}else{logger[_0xc0c6('0xd')](_0xc0c6('0xe'),_0x38eeac,'request\x20sent');_0x52e7d7(_0x3617b7[_0xc0c6('0x15')][_0xc0c6('0x14')]);}})[_0xc0c6('0x16')](function(_0x570973){logger[_0xc0c6('0x12')](_0xc0c6('0xe'),_0x38eeac,_0x570973);_0x5547cd(_0x570973);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e193678..707ece6 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 _0x36b1=['emit','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x36b1,0xf1));var _0x136b=function(_0x31de53,_0x312fe3){_0x31de53=_0x31de53-0x0;var _0xbcb822=_0x36b1[_0x31de53];return _0xbcb822;};'use strict';var VoicePrefixEvents=require(_0x136b('0x0'));var events=[_0x136b('0x1'),_0x136b('0x2'),_0x136b('0x3')];function createListener(_0x2a1dbe,_0x449b94){return function(_0x135f46){_0x449b94[_0x136b('0x4')](_0x2a1dbe,_0x135f46);};}function removeListener(_0x2a5816,_0x3efc18){return function(){VoicePrefixEvents['removeListener'](_0x2a5816,_0x3efc18);};}exports['register']=function(_0x16e221){for(var _0x3728ff=0x0,_0x26ac2d=events[_0x136b('0x5')];_0x3728ff<_0x26ac2d;_0x3728ff++){var _0x578b68=events[_0x3728ff];var _0x3936e6=createListener(_0x136b('0x6')+_0x578b68,_0x16e221);VoicePrefixEvents['on'](_0x578b68,_0x3936e6);}}; \ No newline at end of file +var _0x1d1b=['emit','register','./voicePrefix.events','save','remove','update'];(function(_0x3d9d2b,_0x386063){var _0x8838cb=function(_0xb97187){while(--_0xb97187){_0x3d9d2b['push'](_0x3d9d2b['shift']());}};_0x8838cb(++_0x386063);}(_0x1d1b,0x74));var _0xb1d1=function(_0x1c59ca,_0x30a4b3){_0x1c59ca=_0x1c59ca-0x0;var _0x46d95f=_0x1d1b[_0x1c59ca];return _0x46d95f;};'use strict';var VoicePrefixEvents=require(_0xb1d1('0x0'));var events=[_0xb1d1('0x1'),_0xb1d1('0x2'),_0xb1d1('0x3')];function createListener(_0x5d2b26,_0x259a48){return function(_0x4d6bdd){_0x259a48[_0xb1d1('0x4')](_0x5d2b26,_0x4d6bdd);};}function removeListener(_0x51cf9c,_0x296ff5){return function(){VoicePrefixEvents['removeListener'](_0x51cf9c,_0x296ff5);};}exports[_0xb1d1('0x5')]=function(_0x53a031){for(var _0x340fd3=0x0,_0x230281=events['length'];_0x340fd3<_0x230281;_0x340fd3++){var _0x419689=events[_0x340fd3];var _0x2eec28=createListener('voicePrefix:'+_0x419689,_0x53a031);VoicePrefixEvents['on'](_0x419689,_0x2eec28);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 916d70f..4febccb 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 _0x257d=['post','clone','addTeams','addLists','addBlackLists','put','/:id','update','destroy','delete','removeTeams','/:id/users','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/members','/:id/lists','getLists','/:id/blacklists'];(function(_0x35d033,_0xf6140c){var _0x257ed1=function(_0x1d9927){while(--_0x1d9927){_0x35d033['push'](_0x35d033['shift']());}};_0x257ed1(++_0xf6140c);}(_0x257d,0x1e3));var _0xd257=function(_0x3bed60,_0x4e259e){_0x3bed60=_0x3bed60-0x0;var _0x179779=_0x257d[_0x3bed60];return _0x179779;};'use strict';var multer=require(_0xd257('0x0'));var util=require(_0xd257('0x1'));var path=require(_0xd257('0x2'));var timeout=require(_0xd257('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd257('0x4'));var interaction=require(_0xd257('0x5'));var config=require(_0xd257('0x6'));var controller=require('./voiceQueue.controller');router[_0xd257('0x7')]('/',auth['isAuthenticated'](),controller[_0xd257('0x8')]);router[_0xd257('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xd257('0x9')]);router[_0xd257('0x7')](_0xd257('0xa'),auth[_0xd257('0xb')](),controller[_0xd257('0xc')]);router[_0xd257('0x7')](_0xd257('0xd'),auth['isAuthenticated'](),controller[_0xd257('0xe')]);router[_0xd257('0x7')](_0xd257('0xf'),auth[_0xd257('0xb')](),controller['getHopperFinals']);router[_0xd257('0x7')](_0xd257('0x10'),auth['isAuthenticated'](),controller[_0xd257('0x11')]);router[_0xd257('0x7')](_0xd257('0x12'),auth[_0xd257('0xb')](),controller[_0xd257('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xd257('0x7')](_0xd257('0x14'),auth[_0xd257('0xb')](),controller['getMembers']);router[_0xd257('0x7')](_0xd257('0x15'),auth['isAuthenticated'](),controller[_0xd257('0x16')]);router[_0xd257('0x7')](_0xd257('0x17'),auth[_0xd257('0xb')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd257('0x18')]('/:id/clone',auth[_0xd257('0xb')](),controller[_0xd257('0x19')]);router[_0xd257('0x18')](_0xd257('0x12'),auth['isAuthenticated'](),controller[_0xd257('0x1a')]);router[_0xd257('0x18')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xd257('0x15'),auth[_0xd257('0xb')](),controller[_0xd257('0x1b')]);router[_0xd257('0x18')]('/:id/blacklists',auth[_0xd257('0xb')](),controller[_0xd257('0x1c')]);router[_0xd257('0x1d')](_0xd257('0x1e'),auth[_0xd257('0xb')](),controller[_0xd257('0x1f')]);router['delete'](_0xd257('0x1e'),auth[_0xd257('0xb')](),controller[_0xd257('0x20')]);router[_0xd257('0x21')](_0xd257('0x12'),auth['isAuthenticated'](),controller[_0xd257('0x22')]);router[_0xd257('0x21')](_0xd257('0x23'),auth[_0xd257('0xb')](),controller['removeAgents']);router[_0xd257('0x21')](_0xd257('0x15'),auth[_0xd257('0xb')](),controller[_0xd257('0x24')]);router['delete'](_0xd257('0x17'),auth[_0xd257('0xb')](),controller[_0xd257('0x25')]);module[_0xd257('0x26')]=router; \ No newline at end of file +var _0x6889=['delete','removeTeams','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/teams','getTeams','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addTeams','/:id/users','addAgents','addBlackLists','put','update'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x6889,0xa0));var _0x9688=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x6889[_0x1af05b];return _0x5be7cc;};'use strict';var multer=require(_0x9688('0x0'));var util=require(_0x9688('0x1'));var path=require(_0x9688('0x2'));var timeout=require(_0x9688('0x3'));var express=require('express');var router=express[_0x9688('0x4')]();var auth=require(_0x9688('0x5'));var interaction=require(_0x9688('0x6'));var config=require(_0x9688('0x7'));var controller=require(_0x9688('0x8'));router[_0x9688('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9688('0x9')](_0x9688('0xa'),auth[_0x9688('0xb')](),controller[_0x9688('0xc')]);router['get'](_0x9688('0xd'),auth[_0x9688('0xb')](),controller[_0x9688('0xe')]);router[_0x9688('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x9688('0xf')]);router[_0x9688('0x9')](_0x9688('0x10'),auth[_0x9688('0xb')](),controller['getHopperFinals']);router['get'](_0x9688('0x11'),auth[_0x9688('0xb')](),controller['getHopperBlacks']);router[_0x9688('0x9')](_0x9688('0x12'),auth['isAuthenticated'](),controller[_0x9688('0x13')]);router[_0x9688('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x9688('0x14'),auth['isAuthenticated'](),controller[_0x9688('0x15')]);router[_0x9688('0x9')](_0x9688('0x16'),auth['isAuthenticated'](),controller[_0x9688('0x17')]);router['get'](_0x9688('0x18'),auth[_0x9688('0xb')](),controller[_0x9688('0x19')]);router['post']('/',auth[_0x9688('0xb')](),controller[_0x9688('0x1a')]);router[_0x9688('0x1b')]('/:id/clone',auth[_0x9688('0xb')](),controller[_0x9688('0x1c')]);router[_0x9688('0x1b')](_0x9688('0x12'),auth[_0x9688('0xb')](),controller[_0x9688('0x1d')]);router[_0x9688('0x1b')](_0x9688('0x1e'),auth[_0x9688('0xb')](),controller[_0x9688('0x1f')]);router[_0x9688('0x1b')](_0x9688('0x16'),auth[_0x9688('0xb')](),controller['addLists']);router[_0x9688('0x1b')](_0x9688('0x18'),auth[_0x9688('0xb')](),controller[_0x9688('0x20')]);router[_0x9688('0x21')]('/:id',auth[_0x9688('0xb')](),controller[_0x9688('0x22')]);router[_0x9688('0x23')](_0x9688('0xa'),auth[_0x9688('0xb')](),controller['destroy']);router[_0x9688('0x23')](_0x9688('0x12'),auth[_0x9688('0xb')](),controller[_0x9688('0x24')]);router[_0x9688('0x23')](_0x9688('0x1e'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x9688('0x23')](_0x9688('0x16'),auth[_0x9688('0xb')](),controller[_0x9688('0x25')]);router[_0x9688('0x23')](_0x9688('0x18'),auth[_0x9688('0xb')](),controller[_0x9688('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 4eb8f30..df485be 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 _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x46b573,_0x388f6d){var _0x3bcf35=function(_0x531d44){while(--_0x531d44){_0x46b573['push'](_0x46b573['shift']());}};_0x3bcf35(++_0x388f6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('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':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x1cd7f1,_0x44236f){var _0x5adfde=function(_0x409537){while(--_0x409537){_0x1cd7f1['push'](_0x1cd7f1['shift']());}};_0x5adfde(++_0x44236f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('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':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'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 9d6cc7b..db935ac 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 _0x59d5=['update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','send','index','VoiceQueue','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','VIRTUAL','options','where','includeAll','findAll','rows','show','params','keys','include','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','clone','rawAttributes','omit','createdAt','updatedAt','body','user','role','userProfileId','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','VoiceQueueId','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','voicePause','interface','forEach','penalty','sequelize','transaction','addTeams','findOrCreate','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','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','toString','every','TeamId','union','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','online','all','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save'];(function(_0x2b690f,_0x6d53c7){var _0x4414b7=function(_0x2f880b){while(--_0x2f880b){_0x2b690f['push'](_0x2b690f['shift']());}};_0x4414b7(++_0x6d53c7);}(_0x59d5,0x92));var _0x559d=function(_0x12b436,_0x331e1c){_0x12b436=_0x12b436-0x0;var _0x1b56d3=_0x59d5[_0x12b436];return _0x1b56d3;};'use strict';var pdf=require(_0x559d('0x0'));var emlformat=require(_0x559d('0x1'));var rimraf=require(_0x559d('0x2'));var zipdir=require(_0x559d('0x3'));var jsonpatch=require(_0x559d('0x4'));var rp=require(_0x559d('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x559d('0x6'));var util=require(_0x559d('0x7'));var path=require(_0x559d('0x8'));var sox=require('sox');var csv=require(_0x559d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x559d('0xa'));var squel=require(_0x559d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x559d('0xc'));var toCsv=require(_0x559d('0x9'));var querystring=require(_0x559d('0xd'));var Papa=require(_0x559d('0xe'));var Redis=require(_0x559d('0xf'));var authService=require(_0x559d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x559d('0x11'));var logger=require(_0x559d('0x12'))(_0x559d('0x13'));var utils=require(_0x559d('0x14'));var config=require(_0x559d('0x15'));var db=require(_0x559d('0x16'))['db'];config[_0x559d('0x17')]=_[_0x559d('0x18')](config[_0x559d('0x17')],{'host':_0x559d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x559d('0x17')]));require(_0x559d('0x1a'))[_0x559d('0x1b')](socket);function respondWithStatusCode(_0x4b3a7a,_0x53ac4e){_0x53ac4e=_0x53ac4e||0xcc;return function(_0x13cf14){if(_0x13cf14){return _0x4b3a7a[_0x559d('0x1c')](_0x53ac4e);}return _0x4b3a7a[_0x559d('0x1d')](_0x53ac4e)[_0x559d('0x1e')]();};}function respondWithResult(_0x11504c,_0x8b9341){_0x8b9341=_0x8b9341||0xc8;return function(_0x17d201){if(_0x17d201){return _0x11504c[_0x559d('0x1d')](_0x8b9341)['json'](_0x17d201);}};}function respondWithFilteredResult(_0x5d8869,_0x4d7ca6){return function(_0x2ea660){if(_0x2ea660){var _0x2355db=_0x2ea660[_0x559d('0x1f')],_0x3d2615=_0x4d7ca6[_0x559d('0x20')],_0x5a2a50=_0x4d7ca6[_0x559d('0x20')]+_0x4d7ca6[_0x559d('0x21')],_0x5d22a9;if(_0x5a2a50>=_0x2355db){_0x5a2a50=_0x2355db;_0x5d22a9=0xc8;}else{_0x5d22a9=0xce;}_0x5d8869[_0x559d('0x1d')](_0x5d22a9);return _0x5d8869[_0x559d('0x22')](_0x559d('0x23'),_0x3d2615+'-'+_0x5a2a50+'/'+_0x2355db)['json'](_0x2ea660);}return null;};}function patchUpdates(_0x4233b7){return function(_0xe79795){try{jsonpatch['apply'](_0xe79795,_0x4233b7,!![]);}catch(_0x580222){return BPromise[_0x559d('0x24')](_0x580222);}return _0xe79795[_0x559d('0x25')]();};}function saveUpdates(_0x55a877,_0x1c543e){return function(_0x3bd8f5){if(_0x3bd8f5){return _0x3bd8f5[_0x559d('0x26')](_0x55a877)[_0x559d('0x27')](function(_0x2c3e46){return _0x2c3e46;});}return null;};}function removeEntity(_0xf0b15a,_0x48e913){return function(_0x3b4d99){if(_0x3b4d99){return _0x3b4d99[_0x559d('0x28')]()['then'](function(){var _0x34f464=_0x3b4d99['get']({'plain':!![]});var _0x3ca96a=[{'name':_0x559d('0x29'),'value':_0x559d('0x2a'),'ignore':![]},{'name':_0x559d('0x2b'),'value':_0x559d('0x2c'),'ignore':![]}];var _0x29a941=_(_0x3ca96a)[_0x559d('0x2d')](_0x559d('0x2e'))[_0x559d('0x2f')](_0x559d('0x30'))[_0x559d('0x30')]();if(_[_0x559d('0x31')](_0x29a941,_0x34f464[_0x559d('0x32')])){return;}var _0x497cab=_[_0x559d('0x33')](_0x3ca96a,['value',_0x34f464[_0x559d('0x32')]])['name'];return db[_0x559d('0x34')][_0x559d('0x28')]({'where':{'type':_0x497cab,'resourceId':_0x34f464['id']}})[_0x559d('0x27')](function(){return _0x3b4d99;});})[_0x559d('0x27')](function(){_0xf0b15a['status'](0xcc)[_0x559d('0x1e')]();});}};}function handleEntityNotFound(_0x5be131,_0x1a0f58){return function(_0x29aa2d){if(!_0x29aa2d){_0x5be131[_0x559d('0x1c')](0x194);}return _0x29aa2d;};}function handleError(_0x466c10,_0x3fde1e){_0x3fde1e=_0x3fde1e||0x1f4;return function(_0x1e0f75){logger[_0x559d('0x35')](_0x1e0f75[_0x559d('0x36')]);if(_0x1e0f75['name']){delete _0x1e0f75[_0x559d('0x37')];}_0x466c10['status'](_0x3fde1e)[_0x559d('0x38')](_0x1e0f75);};}exports[_0x559d('0x39')]=function(_0x49582b,_0x4bdf38){var _0x30a59b={},_0x38ee06={},_0x56ecba={'count':0x0,'rows':[]};var _0x19626c=_['map'](db[_0x559d('0x3a')]['rawAttributes'],function(_0x5053a7){return{'name':_0x5053a7[_0x559d('0x3b')],'type':_0x5053a7[_0x559d('0x32')][_0x559d('0x3c')]};});_0x38ee06[_0x559d('0x3d')]=_[_0x559d('0x2f')](_0x19626c,_0x559d('0x37'));_0x38ee06['query']=_['keys'](_0x49582b[_0x559d('0x3e')]);_0x38ee06[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x38ee06['model'],_0x38ee06[_0x559d('0x3e')]);_0x30a59b[_0x559d('0x41')]=_['intersection'](_0x38ee06[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x49582b[_0x559d('0x3e')][_0x559d('0x42')]));_0x30a59b[_0x559d('0x41')]=_0x30a59b[_0x559d('0x41')][_0x559d('0x43')]?_0x30a59b['attributes']:_0x38ee06[_0x559d('0x3d')];if(!_0x49582b[_0x559d('0x3e')][_0x559d('0x44')]('nolimit')){_0x30a59b['limit']=qs[_0x559d('0x21')](_0x49582b['query'][_0x559d('0x21')]);_0x30a59b[_0x559d('0x20')]=qs['offset'](_0x49582b['query'][_0x559d('0x20')]);}_0x30a59b[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x49582b[_0x559d('0x3e')]['sort']);_0x30a59b['where']=qs[_0x559d('0x3f')](_[_0x559d('0x47')](_0x49582b[_0x559d('0x3e')],_0x38ee06[_0x559d('0x3f')]),_0x19626c);if(_0x49582b[_0x559d('0x3e')][_0x559d('0x2d')]){_0x30a59b['where']=_[_0x559d('0x48')](_0x30a59b['where'],{'$or':_[_0x559d('0x2f')](_0x19626c,function(_0xaa121){if(_0xaa121[_0x559d('0x32')]!==_0x559d('0x49')){var _0x106ce5={};_0x106ce5[_0xaa121[_0x559d('0x37')]]={'$like':'%'+_0x49582b['query'][_0x559d('0x2d')]+'%'};return _0x106ce5;}})});}_0x30a59b=_[_0x559d('0x48')]({},_0x30a59b,_0x49582b[_0x559d('0x4a')]);var _0x2d8e9c={'where':_0x30a59b[_0x559d('0x4b')]};return db[_0x559d('0x3a')][_0x559d('0x1f')](_0x2d8e9c)[_0x559d('0x27')](function(_0x25b243){_0x56ecba[_0x559d('0x1f')]=_0x25b243;if(_0x49582b[_0x559d('0x3e')][_0x559d('0x4c')]){_0x30a59b['include']=[{'all':!![]}];}return db[_0x559d('0x3a')][_0x559d('0x4d')](_0x30a59b);})[_0x559d('0x27')](function(_0x474059){_0x56ecba[_0x559d('0x4e')]=_0x474059;return _0x56ecba;})[_0x559d('0x27')](respondWithFilteredResult(_0x4bdf38,_0x30a59b))['catch'](handleError(_0x4bdf38,null));};exports[_0x559d('0x4f')]=function(_0x41c0a5,_0x11b01e){var _0x42f179={'raw':![],'where':{'id':_0x41c0a5[_0x559d('0x50')]['id']}},_0x22cbf7={};_0x22cbf7['model']=_[_0x559d('0x51')](db[_0x559d('0x3a')]['rawAttributes']);_0x22cbf7['query']=_[_0x559d('0x51')](_0x41c0a5['query']);_0x22cbf7['filters']=_[_0x559d('0x40')](_0x22cbf7['model'],_0x22cbf7[_0x559d('0x3e')]);_0x42f179[_0x559d('0x41')]=_[_0x559d('0x40')](_0x22cbf7['model'],qs[_0x559d('0x42')](_0x41c0a5[_0x559d('0x3e')][_0x559d('0x42')]));_0x42f179[_0x559d('0x41')]=_0x42f179[_0x559d('0x41')][_0x559d('0x43')]?_0x42f179[_0x559d('0x41')]:_0x22cbf7['model'];if(_0x41c0a5[_0x559d('0x3e')][_0x559d('0x4c')]){_0x42f179[_0x559d('0x52')]=[{'all':!![]}];}_0x42f179=_[_0x559d('0x48')]({},_0x42f179,_0x41c0a5[_0x559d('0x4a')]);return db[_0x559d('0x3a')]['find'](_0x42f179)[_0x559d('0x27')](handleEntityNotFound(_0x11b01e,null))['then'](respondWithResult(_0x11b01e,null))[_0x559d('0x53')](handleError(_0x11b01e,null));};exports[_0x559d('0x54')]=function(_0x589465,_0x11de13){return db[_0x559d('0x3a')][_0x559d('0x54')](_0x589465['body'],{})['then'](function(_0x140aa9){var _0x5a1b25=_0x589465['user'][_0x559d('0x55')]({'plain':!![]});if(!_0x5a1b25)throw new Error(_0x559d('0x56'));if(_0x5a1b25['role']==='user'){var _0x31a239=_0x140aa9[_0x559d('0x55')]({'plain':!![]});var _0x44b18a=[{'name':_0x559d('0x29'),'value':_0x559d('0x2a')},{'name':_0x559d('0x2b'),'value':'outbound'}];var _0xaabb1c=_[_0x559d('0x33')](_0x44b18a,[_0x559d('0x30'),_0x31a239[_0x559d('0x32')]])['name'];return db[_0x559d('0x57')][_0x559d('0x33')]({'where':{'name':_0xaabb1c,'userProfileId':_0x5a1b25['userProfileId']},'raw':!![]})['then'](function(_0x3056b9){if(_0x3056b9&&_0x3056b9[_0x559d('0x58')]===0x0){return db[_0x559d('0x34')][_0x559d('0x54')]({'name':_0x31a239[_0x559d('0x37')],'resourceId':_0x31a239['id'],'type':_0x3056b9['name'],'sectionId':_0x3056b9['id']},{})[_0x559d('0x27')](function(){return _0x140aa9;});}else{return _0x140aa9;}})[_0x559d('0x53')](function(_0x58a703){logger[_0x559d('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58a703);throw _0x58a703;});}return _0x140aa9;})['then'](respondWithResult(_0x11de13,0xc9))[_0x559d('0x53')](handleError(_0x11de13,null));};exports[_0x559d('0x59')]=function(_0x21fd92,_0x2c5dc2){var _0x5c39fc={'where':{'id':_0x21fd92[_0x559d('0x50')]['id']}},_0x2021f6={};_0x2021f6['model']=_['keys'](db['VoiceQueue'][_0x559d('0x5a')]);_0x5c39fc['attributes']=_['intersection'](_0x2021f6[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x21fd92[_0x559d('0x3e')][_0x559d('0x42')]));_0x5c39fc['attributes']=_0x5c39fc['attributes'][_0x559d('0x43')]?_0x5c39fc['attributes']:_0x2021f6['model'];if(_0x21fd92[_0x559d('0x3e')][_0x559d('0x4c')]){_0x5c39fc[_0x559d('0x52')]=[{'all':!![]}];}_0x5c39fc=_['merge']({},_0x5c39fc,_0x21fd92['options']);return db[_0x559d('0x3a')][_0x559d('0x33')](_0x5c39fc)[_0x559d('0x27')](handleEntityNotFound(_0x2c5dc2,null))[_0x559d('0x27')](function(_0x406808){if(_0x406808){var _0x449097=_0x406808[_0x559d('0x55')]({'plain':!![]});_0x449097=qs[_0x559d('0x5b')](_0x449097,['id',_0x559d('0x5c'),_0x559d('0x5d')]);_0x21fd92[_0x559d('0x5e')]=_['omit'](_0x21fd92[_0x559d('0x5e')],['id',_0x559d('0x5c'),_0x559d('0x5d')]);return db[_0x559d('0x3a')]['create'](_[_0x559d('0x48')](_0x449097,_0x21fd92['body']),{'include':_0x21fd92['query']['includeAll']?[{'all':!![]}]:undefined})[_0x559d('0x27')](function(_0x6455ff){var _0x148353=_0x21fd92[_0x559d('0x5f')][_0x559d('0x55')]({'plain':!![]});if(!_0x148353)throw new Error(_0x559d('0x56'));if(_0x148353[_0x559d('0x60')]===_0x559d('0x5f')){var _0x3173a9=_0x6455ff[_0x559d('0x55')]({'plain':!![]});var _0x25fd60=[{'name':_0x559d('0x29'),'value':_0x559d('0x2a')},{'name':_0x559d('0x2b'),'value':'outbound'}];var _0x11797e=_[_0x559d('0x33')](_0x25fd60,[_0x559d('0x30'),_0x3173a9['type']])[_0x559d('0x37')];return db[_0x559d('0x57')][_0x559d('0x33')]({'where':{'name':_0x11797e,'userProfileId':_0x148353[_0x559d('0x61')]},'raw':!![]})[_0x559d('0x27')](function(_0x164133){if(_0x164133&&_0x164133[_0x559d('0x58')]===0x0){return db[_0x559d('0x34')][_0x559d('0x54')]({'name':_0x3173a9['name'],'resourceId':_0x3173a9['id'],'type':_0x164133[_0x559d('0x37')],'sectionId':_0x164133['id']},{})[_0x559d('0x27')](function(){return _0x6455ff;});}else{return _0x6455ff;}})[_0x559d('0x53')](function(_0x2af95e){logger[_0x559d('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2af95e);throw _0x2af95e;});}return _0x6455ff;});}})['then'](respondWithResult(_0x2c5dc2,0xc9))[_0x559d('0x53')](handleError(_0x2c5dc2,null));};exports[_0x559d('0x26')]=function(_0x5a41a0,_0x4055f9){if(_0x5a41a0[_0x559d('0x5e')]['id']){delete _0x5a41a0[_0x559d('0x5e')]['id'];}return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x5a41a0[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x4055f9,null))[_0x559d('0x27')](saveUpdates(_0x5a41a0[_0x559d('0x5e')],null))[_0x559d('0x27')](respondWithResult(_0x4055f9,null))[_0x559d('0x53')](handleError(_0x4055f9,null));};exports[_0x559d('0x28')]=function(_0x2dff33,_0x56cacc){return db['VoiceQueue'][_0x559d('0x33')]({'where':{'id':_0x2dff33['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x56cacc,null))['then'](removeEntity(_0x56cacc,null))[_0x559d('0x53')](handleError(_0x56cacc,null));};exports[_0x559d('0x62')]=function(_0x36e1e3,_0x5c59c8,_0x2249f0){var _0x5c5211={'raw':![],'where':{}};var _0x546da0={};var _0x484aed={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x559d('0x63')]({'where':{'id':_0x36e1e3[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x5c59c8,null))[_0x559d('0x27')](function(_0x5886fb){if(_0x5886fb){_0x546da0['model']=_['keys'](db[_0x559d('0x64')][_0x559d('0x5a')]);_0x546da0[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x36e1e3[_0x559d('0x3e')]);_0x546da0[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x546da0[_0x559d('0x3d')],_0x546da0[_0x559d('0x3e')]);_0x5c5211[_0x559d('0x41')]=_[_0x559d('0x40')](_0x546da0[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x36e1e3[_0x559d('0x3e')][_0x559d('0x42')]));_0x5c5211[_0x559d('0x41')]=_0x5c5211[_0x559d('0x41')][_0x559d('0x43')]?_0x5c5211[_0x559d('0x41')]:_0x546da0[_0x559d('0x3d')];if(!_0x36e1e3['query'][_0x559d('0x44')](_0x559d('0x65'))){_0x5c5211[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x36e1e3[_0x559d('0x3e')][_0x559d('0x21')]);_0x5c5211[_0x559d('0x20')]=qs[_0x559d('0x20')](_0x36e1e3[_0x559d('0x3e')]['offset']);}_0x5c5211['order']=qs[_0x559d('0x46')](_0x36e1e3[_0x559d('0x3e')][_0x559d('0x46')]);_0x5c5211[_0x559d('0x4b')]=qs['filters'](_[_0x559d('0x47')](_0x36e1e3[_0x559d('0x3e')],_0x546da0[_0x559d('0x3f')]));_0x5c5211[_0x559d('0x4b')]['VoiceQueueId']=_0x5886fb['id'];if(_0x36e1e3[_0x559d('0x3e')]['filter']){_0x5c5211[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x5c5211[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x5c5211[_0x559d('0x41')],function(_0x53c3fc){var _0x3b7b3b={};_0x3b7b3b[_0x53c3fc]={'$like':'%'+_0x36e1e3[_0x559d('0x3e')][_0x559d('0x2d')]+'%'};return _0x3b7b3b;})});}_0x5c5211=_[_0x559d('0x48')]({},_0x5c5211,_0x36e1e3[_0x559d('0x4a')]);return db[_0x559d('0x64')][_0x559d('0x1f')]({'where':_0x5c5211[_0x559d('0x4b')]})[_0x559d('0x27')](function(_0x380411){_0x484aed[_0x559d('0x1f')]=_0x380411;if(_0x36e1e3[_0x559d('0x3e')]['includeAll']){_0x5c5211[_0x559d('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x559d('0x4d')](_0x5c5211);})['then'](function(_0x52fd3c){_0x484aed['rows']=_0x52fd3c;return _0x484aed;});}})[_0x559d('0x27')](respondWithFilteredResult(_0x5c59c8,_0x5c5211))['catch'](handleError(_0x5c59c8,null));};exports[_0x559d('0x66')]=function(_0x3e43e1,_0x233232,_0x4fab64){var _0x1cc954={'raw':!![],'where':{}};var _0x347dc2={};var _0x5b079b={'count':0x0,'rows':[]};return db[_0x559d('0x3a')][_0x559d('0x63')]({'where':{'id':_0x3e43e1['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x233232,null))['then'](function(_0x5d1bd1){if(_0x5d1bd1){_0x347dc2['model']=_[_0x559d('0x51')](db['CmHopperHistory']['rawAttributes']);_0x347dc2[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x3e43e1['query']);_0x347dc2[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x347dc2[_0x559d('0x3d')],_0x347dc2[_0x559d('0x3e')]);_0x1cc954[_0x559d('0x41')]=_['intersection'](_0x347dc2[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x3e43e1[_0x559d('0x3e')][_0x559d('0x42')]));_0x1cc954['attributes']=_0x1cc954[_0x559d('0x41')][_0x559d('0x43')]?_0x1cc954['attributes']:_0x347dc2[_0x559d('0x3d')];if(!_0x3e43e1[_0x559d('0x3e')][_0x559d('0x44')](_0x559d('0x65'))){_0x1cc954[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x3e43e1['query'][_0x559d('0x21')]);_0x1cc954['offset']=qs[_0x559d('0x20')](_0x3e43e1[_0x559d('0x3e')][_0x559d('0x20')]);}_0x1cc954[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x3e43e1[_0x559d('0x3e')][_0x559d('0x46')]);_0x1cc954[_0x559d('0x4b')]=qs[_0x559d('0x3f')](_['pick'](_0x3e43e1[_0x559d('0x3e')],_0x347dc2['filters']));_0x1cc954[_0x559d('0x4b')]['VoiceQueueId']=_0x5d1bd1['id'];if(_0x3e43e1['query'][_0x559d('0x2d')]){_0x1cc954[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x1cc954['where'],{'$or':_[_0x559d('0x2f')](_0x1cc954['attributes'],function(_0x36ad11){var _0x5973ba={};_0x5973ba[_0x36ad11]={'$like':'%'+_0x3e43e1[_0x559d('0x3e')][_0x559d('0x2d')]+'%'};return _0x5973ba;})});}_0x1cc954=_['merge']({},_0x1cc954,_0x3e43e1[_0x559d('0x4a')]);return db[_0x559d('0x67')][_0x559d('0x1f')]({'where':_0x1cc954['where']})['then'](function(_0x422198){_0x5b079b[_0x559d('0x1f')]=_0x422198;if(_0x3e43e1[_0x559d('0x3e')][_0x559d('0x4c')]){_0x1cc954[_0x559d('0x52')]=[{'all':!![]}];}return db[_0x559d('0x67')][_0x559d('0x4d')](_0x1cc954);})[_0x559d('0x27')](function(_0x1dd24a){_0x5b079b['rows']=_0x1dd24a;return _0x5b079b;});}})['then'](respondWithFilteredResult(_0x233232,_0x1cc954))[_0x559d('0x53')](handleError(_0x233232,null));};exports[_0x559d('0x68')]=function(_0x2b364f,_0x2659cd,_0x39023c){var _0x1ee44a={'raw':!![],'where':{}};var _0x5ad576={};var _0xc9fada={'count':0x0,'rows':[]};return db[_0x559d('0x3a')]['findOne']({'where':{'id':_0x2b364f[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x2659cd,null))['then'](function(_0x15564a){if(_0x15564a){_0x5ad576[_0x559d('0x3d')]=_['keys'](db[_0x559d('0x69')]['rawAttributes']);_0x5ad576[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x2b364f[_0x559d('0x3e')]);_0x5ad576[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x5ad576['model'],_0x5ad576[_0x559d('0x3e')]);_0x1ee44a[_0x559d('0x41')]=_[_0x559d('0x40')](_0x5ad576[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x2b364f['query'][_0x559d('0x42')]));_0x1ee44a[_0x559d('0x41')]=_0x1ee44a[_0x559d('0x41')][_0x559d('0x43')]?_0x1ee44a['attributes']:_0x5ad576['model'];if(!_0x2b364f[_0x559d('0x3e')]['hasOwnProperty'](_0x559d('0x65'))){_0x1ee44a[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x2b364f[_0x559d('0x3e')][_0x559d('0x21')]);_0x1ee44a[_0x559d('0x20')]=qs[_0x559d('0x20')](_0x2b364f[_0x559d('0x3e')]['offset']);}_0x1ee44a[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x2b364f[_0x559d('0x3e')][_0x559d('0x46')]);_0x1ee44a['where']=qs[_0x559d('0x3f')](_['pick'](_0x2b364f[_0x559d('0x3e')],_0x5ad576['filters']));_0x1ee44a['where'][_0x559d('0x6a')]=_0x15564a['id'];if(_0x2b364f[_0x559d('0x3e')][_0x559d('0x2d')]){_0x1ee44a[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x1ee44a[_0x559d('0x4b')],{'$or':_['map'](_0x1ee44a[_0x559d('0x41')],function(_0x3dbf73){var _0x370c1f={};_0x370c1f[_0x3dbf73]={'$like':'%'+_0x2b364f[_0x559d('0x3e')]['filter']+'%'};return _0x370c1f;})});}_0x1ee44a=_[_0x559d('0x48')]({},_0x1ee44a,_0x2b364f[_0x559d('0x4a')]);return db['CmHopperFinal'][_0x559d('0x1f')]({'where':_0x1ee44a[_0x559d('0x4b')]})['then'](function(_0x19cee7){_0xc9fada['count']=_0x19cee7;if(_0x2b364f[_0x559d('0x3e')][_0x559d('0x4c')]){_0x1ee44a[_0x559d('0x52')]=[{'all':!![]}];}return db[_0x559d('0x69')][_0x559d('0x4d')](_0x1ee44a);})[_0x559d('0x27')](function(_0x194b0b){_0xc9fada[_0x559d('0x4e')]=_0x194b0b;return _0xc9fada;});}})[_0x559d('0x27')](respondWithFilteredResult(_0x2659cd,_0x1ee44a))['catch'](handleError(_0x2659cd,null));};exports[_0x559d('0x6b')]=function(_0x337bee,_0x28495e,_0xc63521){var _0x361008={'raw':!![],'where':{}};var _0x3efa91={};var _0x50b0f9={'count':0x0,'rows':[]};return db[_0x559d('0x3a')][_0x559d('0x63')]({'where':{'id':_0x337bee['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x28495e,null))[_0x559d('0x27')](function(_0x54fd2c){if(_0x54fd2c){_0x3efa91['model']=_[_0x559d('0x51')](db[_0x559d('0x6c')][_0x559d('0x5a')]);_0x3efa91['query']=_[_0x559d('0x51')](_0x337bee[_0x559d('0x3e')]);_0x3efa91['filters']=_[_0x559d('0x40')](_0x3efa91[_0x559d('0x3d')],_0x3efa91[_0x559d('0x3e')]);_0x361008[_0x559d('0x41')]=_['intersection'](_0x3efa91[_0x559d('0x3d')],qs[_0x559d('0x42')](_0x337bee[_0x559d('0x3e')][_0x559d('0x42')]));_0x361008[_0x559d('0x41')]=_0x361008['attributes']['length']?_0x361008[_0x559d('0x41')]:_0x3efa91[_0x559d('0x3d')];if(!_0x337bee[_0x559d('0x3e')][_0x559d('0x44')](_0x559d('0x65'))){_0x361008[_0x559d('0x21')]=qs['limit'](_0x337bee[_0x559d('0x3e')]['limit']);_0x361008[_0x559d('0x20')]=qs['offset'](_0x337bee[_0x559d('0x3e')]['offset']);}_0x361008[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x337bee[_0x559d('0x3e')]['sort']);_0x361008['where']=qs[_0x559d('0x3f')](_[_0x559d('0x47')](_0x337bee[_0x559d('0x3e')],_0x3efa91[_0x559d('0x3f')]));_0x361008[_0x559d('0x4b')]['VoiceQueueId']=_0x54fd2c['id'];if(_0x337bee[_0x559d('0x3e')][_0x559d('0x2d')]){_0x361008[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x361008[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x361008['attributes'],function(_0x59a1d8){var _0x3cb995={};_0x3cb995[_0x59a1d8]={'$like':'%'+_0x337bee['query']['filter']+'%'};return _0x3cb995;})});}_0x361008=_[_0x559d('0x48')]({},_0x361008,_0x337bee['options']);return db[_0x559d('0x6c')][_0x559d('0x1f')]({'where':_0x361008['where']})[_0x559d('0x27')](function(_0x4d0aa0){_0x50b0f9['count']=_0x4d0aa0;if(_0x337bee[_0x559d('0x3e')][_0x559d('0x4c')]){_0x361008[_0x559d('0x52')]=[{'all':!![]}];}return db[_0x559d('0x6c')][_0x559d('0x4d')](_0x361008);})[_0x559d('0x27')](function(_0xc08a21){_0x50b0f9[_0x559d('0x4e')]=_0xc08a21;return _0x50b0f9;});}})['then'](respondWithFilteredResult(_0x28495e,_0x361008))['catch'](handleError(_0x28495e,null));};exports[_0x559d('0x6d')]=function(_0x40dffc,_0x3d9953,_0x5d6c0b){var _0x1583bc={};var _0x3f2a4d={};var _0xb7f5f3;var _0x22bcf6;return db[_0x559d('0x3a')]['findOne']({'where':{'id':_0x40dffc[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x3d9953,null))['then'](function(_0x346ce9){if(_0x346ce9){_0xb7f5f3=_0x346ce9;_0x3f2a4d[_0x559d('0x3d')]=_['keys'](db['Team'][_0x559d('0x5a')]);_0x3f2a4d['query']=_[_0x559d('0x51')](_0x40dffc['query']);_0x3f2a4d['filters']=_['intersection'](_0x3f2a4d[_0x559d('0x3d')],_0x3f2a4d[_0x559d('0x3e')]);_0x1583bc[_0x559d('0x41')]=_[_0x559d('0x40')](_0x3f2a4d['model'],qs[_0x559d('0x42')](_0x40dffc[_0x559d('0x3e')][_0x559d('0x42')]));_0x1583bc['attributes']=_0x1583bc[_0x559d('0x41')][_0x559d('0x43')]?_0x1583bc[_0x559d('0x41')]:_0x3f2a4d[_0x559d('0x3d')];_0x1583bc[_0x559d('0x45')]=qs['sort'](_0x40dffc[_0x559d('0x3e')][_0x559d('0x46')]);_0x1583bc[_0x559d('0x4b')]=qs['filters'](_['pick'](_0x40dffc['query'],_0x3f2a4d[_0x559d('0x3f')]));if(_0x40dffc[_0x559d('0x3e')][_0x559d('0x2d')]){_0x1583bc[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x1583bc['where'],{'$or':_[_0x559d('0x2f')](_0x1583bc[_0x559d('0x41')],function(_0x5097e7){var _0x30fc0a={};_0x30fc0a[_0x5097e7]={'$like':'%'+_0x40dffc[_0x559d('0x3e')][_0x559d('0x2d')]+'%'};return _0x30fc0a;})});}_0x1583bc=_[_0x559d('0x48')]({},_0x1583bc,_0x40dffc['options']);return _0xb7f5f3[_0x559d('0x6d')](_0x1583bc);}})['then'](function(_0x32f3ed){if(_0x32f3ed){_0x22bcf6=_0x32f3ed[_0x559d('0x43')];if(!_0x40dffc['query'][_0x559d('0x44')](_0x559d('0x65'))){_0x1583bc[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x40dffc[_0x559d('0x3e')][_0x559d('0x21')]);_0x1583bc[_0x559d('0x20')]=qs[_0x559d('0x20')](_0x40dffc[_0x559d('0x3e')][_0x559d('0x20')]);}return _0xb7f5f3['getTeams'](_0x1583bc);}})[_0x559d('0x27')](function(_0x29c353){if(_0x29c353){return _0x29c353?{'count':_0x22bcf6,'rows':_0x29c353}:null;}})[_0x559d('0x27')](respondWithResult(_0x3d9953,null))[_0x559d('0x53')](handleError(_0x3d9953,null));};exports['addTeams']=function(_0xf3d8e6,_0x4d65a0,_0x3ef7d6){var _0x5125c0=_0xf3d8e6['body'][_0x559d('0x6e')];var _0xc7082d=_['map'](_0x5125c0,'id');return db[_0x559d('0x6f')][_0x559d('0x4d')]({'where':{'id':_0xc7082d},'attributes':['id'],'include':[{'model':db[_0x559d('0x70')],'as':_0x559d('0x71'),'attributes':['id',_0x559d('0x37'),'online',_0x559d('0x72'),_0x559d('0x73')],'raw':!![]}]})['then'](function(_0x46d873){if(_0x46d873){var _0x437640=_['flatMap'](_0x46d873,function(_0x49b6f2){var _0x86acf=_0x49b6f2[_0x559d('0x55')]({'plain':!![]});_0x86acf['Agents'][_0x559d('0x74')](function(_0x302444){_0x302444['penalty']=_[_0x559d('0x33')](_0x5125c0,{'id':_0x86acf['id']})[_0x559d('0x75')];});return _0x86acf[_0x559d('0x71')];});return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0xf3d8e6[_0x559d('0x50')]['id']}})['then'](function(_0x2115ba){return db[_0x559d('0x76')][_0x559d('0x77')](function(_0x5ab4b0){return _0x2115ba[_0x559d('0x78')](_0xc7082d,{'transaction':_0x5ab4b0})[_0x559d('0x27')](function(){return BPromise['each'](_0x437640,function(_0x5065d){return db['UserVoiceQueue'][_0x559d('0x79')]({'where':{'UserId':_0x5065d['id'],'VoiceQueueId':_0xf3d8e6[_0x559d('0x50')]['id']},'defaults':{'penalty':_0x5065d[_0x559d('0x75')]},'transaction':_0x5ab4b0});});})[_0x559d('0x27')](function(){return BPromise[_0x559d('0x7a')](_[_0x559d('0x2d')](_0x437640,{'online':!![]}),function(_0xeb697e){return db[_0x559d('0x7b')][_0x559d('0x7c')]({'membername':_0xeb697e['name'],'UserId':_0xeb697e['id'],'queue_name':_0x2115ba[_0x559d('0x37')],'VoiceQueueId':_0x2115ba['id'],'interface':_[_0x559d('0x7d')](_0xeb697e[_0x559d('0x73')])?util[_0x559d('0x7e')](_0x559d('0x7f'),_0xeb697e[_0x559d('0x37')]):_0xeb697e[_0x559d('0x73')],'paused':_0xeb697e[_0x559d('0x72')]||![],'penalty':_0xeb697e[_0x559d('0x75')]},{'transaction':_0x5ab4b0});});})[_0x559d('0x27')](function(){_0x437640['forEach'](function(_0x3d1e0e){socket[_0x559d('0x80')](_0x559d('0x81'),{'UserId':_0x3d1e0e['id'],'VoiceQueueId':_0x2115ba['id']});});});});});}})[_0x559d('0x27')](respondWithStatusCode(_0x4d65a0,null))[_0x559d('0x53')](handleError(_0x4d65a0,null));};exports['removeTeams']=function(_0x4a0c60,_0x118b29,_0x59f76e){return db[_0x559d('0x6f')]['findAll']({'where':{'id':_0x4a0c60[_0x559d('0x3e')][_0x559d('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x559d('0x71'),'attributes':['id'],'raw':!![]}]})[_0x559d('0x27')](handleEntityNotFound(_0x118b29,null))[_0x559d('0x27')](function(_0x1b62b5){var _0x4342ce=_['map'](_0x1b62b5,'id');var _0x2a03bf=[];var _0x584c7b=[];var _0x5b9c35=squel[_0x559d('0x83')]();_0x5b9c35[_0x559d('0x84')](_0x559d('0x85'))[_0x559d('0x86')](_0x559d('0x87'),'tq')['join'](_0x559d('0x88'),'ut',_0x559d('0x89'))[_0x559d('0x4b')](_0x559d('0x8a'),_0x4a0c60[_0x559d('0x50')]['id']);for(var _0x5c60fc=0x0;_0x5c60fc<_0x1b62b5[_0x559d('0x43')];_0x5c60fc+=0x1){let _0xf42824=_0x1b62b5[_0x5c60fc];for(var _0x22b586=0x0;_0x22b586<_0xf42824[_0x559d('0x71')][_0x559d('0x43')];_0x22b586+=0x1){let _0x593e13=_0xf42824['Agents'][_0x22b586];var _0x2da945=_0x5b9c35[_0x559d('0x59')]();_0x2da945['where'](_0x559d('0x8b'),_0x593e13['id']);_0x584c7b[_0x559d('0x8c')](db[_0x559d('0x76')][_0x559d('0x3e')](_0x2da945[_0x559d('0x8d')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x559d('0x27')](function(_0x2f5d48){if(_0x2f5d48[_0x559d('0x43')]===0x1){return _0x593e13['id'];}else{var _0x528a53=_[_0x559d('0x8e')](_[_0x559d('0x2f')](_0x2f5d48,_0x559d('0x8f')),function(_0x25c38f){return _['includes'](_0x4342ce,_0x25c38f);});if(_0x528a53){return _0x593e13['id'];}}}));}}return BPromise['all'](_0x584c7b)[_0x559d('0x27')](function(_0xe547ce){_0x2a03bf=_(_0x2a03bf)[_0x559d('0x90')](_0xe547ce)['compact']()[_0x559d('0x30')]();return db['VoiceQueue'][_0x559d('0x33')]({'where':{'id':_0x4a0c60[_0x559d('0x50')]['id']}})[_0x559d('0x27')](function(_0x40ec9a){return db[_0x559d('0x76')][_0x559d('0x77')](function(_0x608fdc){return _0x40ec9a[_0x559d('0x91')](_0x4a0c60['query'][_0x559d('0x82')],{'transaction':_0x608fdc})[_0x559d('0x27')](function(){if(!_[_0x559d('0x92')](_0x2a03bf)){return _0x40ec9a[_0x559d('0x93')](_0x2a03bf,{'transaction':_0x608fdc})[_0x559d('0x27')](function(){return db[_0x559d('0x7b')][_0x559d('0x28')]({'where':{'VoiceQueueId':_0x4a0c60['params']['id'],'UserId':_0x2a03bf},'transaction':_0x608fdc});});}})[_0x559d('0x27')](function(){_0x2a03bf['forEach'](function(_0x19acc8){socket['emit'](_0x559d('0x94'),{'UserId':_0x19acc8,'VoiceQueueId':_0x40ec9a['id']});});});});});});})[_0x559d('0x27')](respondWithStatusCode(_0x118b29,null))['catch'](handleError(_0x118b29,null));};exports[_0x559d('0x95')]=function(_0x44b1bf,_0x7f6561,_0x8a5b39){var _0x7a1291,_0x25b52b;return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x44b1bf[_0x559d('0x50')]['id']}})['then'](handleEntityNotFound(_0x7f6561,null))['then'](function(_0x47f609){if(_0x47f609){_0x25b52b=_0x47f609;return _0x47f609[_0x559d('0x95')](_0x44b1bf[_0x559d('0x5e')][_0x559d('0x82')],_[_0x559d('0x5b')](_0x44b1bf[_0x559d('0x5e')],[_0x559d('0x82'),'id'])||{})[_0x559d('0x96')](function(_0x1c46db){for(var _0x2ee90f=0x0;_0x2ee90f<_0x44b1bf['body'][_0x559d('0x82')][_0x559d('0x43')];_0x2ee90f+=0x1){socket['emit'](_0x559d('0x81'),{'UserId':_0x44b1bf[_0x559d('0x5e')][_0x559d('0x82')][_0x2ee90f],'VoiceQueueId':_0x44b1bf[_0x559d('0x50')]['id']});}return _0x1c46db;});}})[_0x559d('0x27')](function(_0x2bc510){_0x7a1291=_0x2bc510||[];if(_0x25b52b){return db[_0x559d('0x70')][_0x559d('0x4d')]({'where':{'id':_0x44b1bf['body'][_0x559d('0x82')]},'attributes':['id',_0x559d('0x37'),_0x559d('0x97'),'voicePause','interface'],'raw':!![]});}})[_0x559d('0x27')](function(_0x308ac7){if(!_[_0x559d('0x92')](_0x308ac7)){var _0x35303c=[];for(var _0x21a494=0x0;_0x21a494<_0x308ac7[_0x559d('0x43')];_0x21a494++){if(_0x308ac7[_0x21a494]['online']){_0x35303c['push'](db[_0x559d('0x7b')]['upsert']({'membername':_0x308ac7[_0x21a494][_0x559d('0x37')],'UserId':_0x308ac7[_0x21a494]['id'],'queue_name':_0x25b52b['name'],'VoiceQueueId':_0x25b52b['id'],'interface':_[_0x559d('0x7d')](_0x308ac7[_0x21a494][_0x559d('0x73')])?util[_0x559d('0x7e')](_0x559d('0x7f'),_0x308ac7[_0x21a494][_0x559d('0x37')]):_0x308ac7[_0x21a494][_0x559d('0x73')],'paused':_0x308ac7[_0x21a494][_0x559d('0x72')]||![],'penalty':_0x44b1bf[_0x559d('0x5e')][_0x559d('0x75')]||0x0}));}}return BPromise[_0x559d('0x98')](_0x35303c);}})[_0x559d('0x27')](function(){return _0x7a1291;})[_0x559d('0x27')](respondWithResult(_0x7f6561,null))[_0x559d('0x53')](handleError(_0x7f6561,null));};exports[_0x559d('0x93')]=function(_0x302347,_0x53ea7c,_0x258e57){return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x302347[_0x559d('0x50')]['id']}})['then'](handleEntityNotFound(_0x53ea7c,null))['then'](function(_0x5eaed0){if(_0x5eaed0){return _0x5eaed0['removeAgents'](_0x302347['query'][_0x559d('0x82')])['then'](function(){if(_[_0x559d('0x99')](_0x302347[_0x559d('0x3e')][_0x559d('0x82')])){for(var _0x1c2a08=0x0;_0x1c2a08<_0x302347[_0x559d('0x3e')][_0x559d('0x82')]['length'];_0x1c2a08+=0x1){socket[_0x559d('0x80')](_0x559d('0x94'),{'UserId':Number(_0x302347['query'][_0x559d('0x82')][_0x1c2a08]),'VoiceQueueId':Number(_0x302347[_0x559d('0x50')]['id'])});}}else{socket['emit'](_0x559d('0x94'),{'UserId':Number(_0x302347['query'][_0x559d('0x82')]),'VoiceQueueId':Number(_0x302347[_0x559d('0x50')]['id'])});}});}})[_0x559d('0x27')](function(_0xc957e8){return db['UserVoiceQueueRt'][_0x559d('0x28')]({'where':{'VoiceQueueId':_0x302347[_0x559d('0x50')]['id'],'UserId':_0x302347[_0x559d('0x3e')][_0x559d('0x82')]}})[_0x559d('0x27')](function(){return _0xc957e8;});})['then'](respondWithStatusCode(_0x53ea7c,null))[_0x559d('0x53')](handleError(_0x53ea7c,null));};exports[_0x559d('0x9a')]=function(_0x2174c5,_0x2e331c,_0x4cdc25){var _0x240bc8={};var _0x1d2c4d={};var _0x438c70;var _0x2c792d;return db['VoiceQueue'][_0x559d('0x63')]({'where':{'id':_0x2174c5['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x2e331c,null))[_0x559d('0x27')](function(_0x3a09b2){if(_0x3a09b2){_0x438c70=_0x3a09b2;_0x1d2c4d[_0x559d('0x3d')]=_[_0x559d('0x51')](db[_0x559d('0x70')][_0x559d('0x5a')]);_0x1d2c4d[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x2174c5[_0x559d('0x3e')]);_0x1d2c4d[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x1d2c4d[_0x559d('0x3d')],_0x1d2c4d['query']);_0x240bc8['attributes']=_[_0x559d('0x40')](_0x1d2c4d[_0x559d('0x3d')],qs['fields'](_0x2174c5['query'][_0x559d('0x42')]));_0x240bc8[_0x559d('0x41')]=_0x240bc8['attributes'][_0x559d('0x43')]?_0x240bc8[_0x559d('0x41')]:_0x1d2c4d[_0x559d('0x3d')];_0x240bc8[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x2174c5[_0x559d('0x3e')][_0x559d('0x46')]);_0x240bc8['where']=qs[_0x559d('0x3f')](_[_0x559d('0x47')](_0x2174c5['query'],_0x1d2c4d['filters']));if(_0x2174c5['query'][_0x559d('0x2d')]){_0x240bc8['where']=_['merge'](_0x240bc8[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x240bc8['attributes'],function(_0x1a61da){var _0xe2e4b1={};_0xe2e4b1[_0x1a61da]={'$like':'%'+_0x2174c5[_0x559d('0x3e')][_0x559d('0x2d')]+'%'};return _0xe2e4b1;})});}_0x240bc8=_[_0x559d('0x48')]({},_0x240bc8,_0x2174c5['options']);return _0x438c70[_0x559d('0x9a')](_0x240bc8);}})[_0x559d('0x27')](function(_0x3e0d4d){if(_0x3e0d4d){_0x2c792d=_0x3e0d4d[_0x559d('0x43')];if(!_0x2174c5['query'][_0x559d('0x44')](_0x559d('0x65'))){_0x240bc8[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x2174c5[_0x559d('0x3e')][_0x559d('0x21')]);_0x240bc8[_0x559d('0x20')]=qs[_0x559d('0x20')](_0x2174c5[_0x559d('0x3e')]['offset']);}return _0x438c70[_0x559d('0x9a')](_0x240bc8);}})[_0x559d('0x27')](function(_0x4db1f3){if(_0x4db1f3){return _0x4db1f3?{'count':_0x2c792d,'rows':_0x4db1f3}:null;}})[_0x559d('0x27')](respondWithResult(_0x2e331c,null))[_0x559d('0x53')](handleError(_0x2e331c,null));};exports[_0x559d('0x9b')]=function(_0x1732e4,_0x288e57,_0x3d2832){var _0x35b632={};var _0x442b00={};var _0xcc0f40;var _0x3283a9;return db[_0x559d('0x3a')][_0x559d('0x63')]({'where':{'id':_0x1732e4['params']['id']}})['then'](handleEntityNotFound(_0x288e57,null))[_0x559d('0x27')](function(_0xb8e4f7){if(_0xb8e4f7){_0xcc0f40=_0xb8e4f7;_0x442b00[_0x559d('0x3d')]=_[_0x559d('0x51')](db[_0x559d('0x7b')][_0x559d('0x5a')]);_0x442b00[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x1732e4[_0x559d('0x3e')]);_0x442b00[_0x559d('0x3f')]=_['intersection'](_0x442b00[_0x559d('0x3d')],_0x442b00[_0x559d('0x3e')]);_0x35b632[_0x559d('0x41')]=_['intersection'](_0x442b00['model'],qs[_0x559d('0x42')](_0x1732e4[_0x559d('0x3e')]['fields']));_0x35b632[_0x559d('0x41')]=_0x35b632[_0x559d('0x41')][_0x559d('0x43')]?_0x35b632[_0x559d('0x41')]:_0x442b00[_0x559d('0x3d')];_0x35b632[_0x559d('0x45')]=qs['sort'](_0x1732e4['query']['sort']);_0x35b632[_0x559d('0x4b')]=qs[_0x559d('0x3f')](_[_0x559d('0x47')](_0x1732e4['query'],_0x442b00[_0x559d('0x3f')]));if(_0x1732e4[_0x559d('0x3e')][_0x559d('0x2d')]){_0x35b632[_0x559d('0x4b')]=_[_0x559d('0x48')](_0x35b632[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x35b632['attributes'],function(_0x551082){var _0xe3629a={};_0xe3629a[_0x551082]={'$like':'%'+_0x1732e4[_0x559d('0x3e')][_0x559d('0x2d')]+'%'};return _0xe3629a;})});}_0x35b632=_[_0x559d('0x48')]({},_0x35b632,_0x1732e4[_0x559d('0x4a')]);return _0xcc0f40[_0x559d('0x9b')](_0x35b632);}})['then'](function(_0x52bfa1){if(_0x52bfa1){_0x3283a9=_0x52bfa1[_0x559d('0x43')];if(!_0x1732e4[_0x559d('0x3e')][_0x559d('0x44')](_0x559d('0x65'))){_0x35b632[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x1732e4[_0x559d('0x3e')]['limit']);_0x35b632['offset']=qs['offset'](_0x1732e4[_0x559d('0x3e')][_0x559d('0x20')]);}return _0xcc0f40['getMembers'](_0x35b632);}})[_0x559d('0x27')](function(_0x4228dc){return _0x4228dc?{'count':_0x3283a9,'rows':_0x4228dc}:null;})[_0x559d('0x27')](respondWithResult(_0x288e57,null))[_0x559d('0x53')](handleError(_0x288e57,null));};exports[_0x559d('0x9c')]=function(_0x2b2e32,_0x292b0d,_0x310136){var _0x26de98={};var _0x6fab46={};var _0x16a442;var _0x15b181;return db[_0x559d('0x3a')]['findOne']({'where':{'id':_0x2b2e32[_0x559d('0x50')]['id']}})['then'](handleEntityNotFound(_0x292b0d,null))['then'](function(_0x2094ce){if(_0x2094ce){_0x16a442=_0x2094ce;_0x6fab46[_0x559d('0x3d')]=_[_0x559d('0x51')](db[_0x559d('0x9d')][_0x559d('0x5a')]);_0x6fab46[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x2b2e32[_0x559d('0x3e')]);_0x6fab46[_0x559d('0x3f')]=_['intersection'](_0x6fab46['model'],_0x6fab46['query']);_0x26de98[_0x559d('0x41')]=_['intersection'](_0x6fab46[_0x559d('0x3d')],qs['fields'](_0x2b2e32[_0x559d('0x3e')][_0x559d('0x42')]));_0x26de98[_0x559d('0x41')]=_0x26de98[_0x559d('0x41')][_0x559d('0x43')]?_0x26de98[_0x559d('0x41')]:_0x6fab46['model'];_0x26de98[_0x559d('0x45')]=qs[_0x559d('0x46')](_0x2b2e32[_0x559d('0x3e')][_0x559d('0x46')]);_0x26de98[_0x559d('0x4b')]=qs[_0x559d('0x3f')](_[_0x559d('0x47')](_0x2b2e32['query'],_0x6fab46[_0x559d('0x3f')]));if(_0x2b2e32[_0x559d('0x3e')][_0x559d('0x2d')]){_0x26de98[_0x559d('0x4b')]=_['merge'](_0x26de98[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x26de98['attributes'],function(_0x3d1fc5){var _0xcbe026={};_0xcbe026[_0x3d1fc5]={'$like':'%'+_0x2b2e32['query']['filter']+'%'};return _0xcbe026;})});}_0x26de98=_[_0x559d('0x48')]({},_0x26de98,_0x2b2e32[_0x559d('0x4a')]);return _0x16a442[_0x559d('0x9c')](_0x26de98);}})['then'](function(_0x4a2db4){if(_0x4a2db4){_0x15b181=_0x4a2db4[_0x559d('0x43')];if(!_0x2b2e32[_0x559d('0x3e')]['hasOwnProperty'](_0x559d('0x65'))){_0x26de98[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x2b2e32[_0x559d('0x3e')][_0x559d('0x21')]);_0x26de98['offset']=qs[_0x559d('0x20')](_0x2b2e32[_0x559d('0x3e')][_0x559d('0x20')]);}return _0x16a442[_0x559d('0x9c')](_0x26de98);}})[_0x559d('0x27')](function(_0x4a7f0e){if(_0x4a7f0e){return _0x4a7f0e?{'count':_0x15b181,'rows':_0x4a7f0e}:null;}})['then'](respondWithResult(_0x292b0d,null))['catch'](handleError(_0x292b0d,null));};exports['addLists']=function(_0x17812b,_0x2d06e5,_0x21bcde){var _0x7f9ca,_0x594c55;return db['VoiceQueue'][_0x559d('0x33')]({'where':{'id':_0x17812b['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x2d06e5,null))[_0x559d('0x27')](function(_0x57b7ca){if(_0x57b7ca){_0x594c55=_0x57b7ca;return _0x57b7ca[_0x559d('0x9e')](_0x17812b[_0x559d('0x5e')][_0x559d('0x82')],_[_0x559d('0x5b')](_0x17812b[_0x559d('0x5e')],[_0x559d('0x82'),'id'])||{});}return null;})[_0x559d('0x96')](function(_0x3203d2){var _0x1b226a;_0x7f9ca=_0x3203d2||[];var _0xcb113=[];if(_0x3203d2){for(var _0x5c3df7=0x0;_0x5c3df7<_0x3203d2[_0x559d('0x43')];_0x5c3df7+=0x1){var _0x78b9d6=_0x3203d2[_0x5c3df7][_0x559d('0x55')]({'plain':!![]});_0x594c55[_0x559d('0x9f')]=_0x17812b[_0x559d('0x5e')][_0x559d('0x9f')]?_0x17812b[_0x559d('0x5e')]['dialCheckDuplicateType']:_0x594c55['dialCheckDuplicateType'];switch(_0x594c55[_0x559d('0x9f')]){case'always':_0x1b226a=squel['insert']()[_0x559d('0xa0')](_0x559d('0xa1'))[_0x559d('0xa2')](['phone',_0x559d('0xa3'),_0x559d('0xa4'),_0x559d('0xa5'),_0x559d('0x6a'),'createdAt','updatedAt'],squel[_0x559d('0x83')]()[_0x559d('0x84')](_0x559d('0xa6'),_0x559d('0xa6'))[_0x559d('0x84')](_0x559d('0xa7'),_0x559d('0xa3'))[_0x559d('0x84')]('id',_0x559d('0xa4'))[_0x559d('0x84')](_0x78b9d6[_0x559d('0xa8')][_0x559d('0x8d')](),_0x559d('0xa5'))['field'](_0x17812b[_0x559d('0x50')]['id'][_0x559d('0x8d')](),_0x559d('0x6a'))['field'](_0x559d('0xa7'),'createdAt')['field'](_0x559d('0xa7'),'updatedAt')[_0x559d('0x86')](_0x559d('0xa9'))[_0x559d('0x4b')](_0x559d('0xaa'))['where'](_0x559d('0xab'),_0x78b9d6['CmListId'][_0x559d('0x8d')]())[_0x559d('0x4b')](_0x559d('0xac'))[_0x559d('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x559d('0x83')]()[_0x559d('0x84')](_0x559d('0xad'))['from'](_0x559d('0xae'))['where'](_0x559d('0x8a'),_0x17812b[_0x559d('0x50')]['id']['toString']()))[_0x559d('0x4b')](_0x559d('0xaf'),squel[_0x559d('0x83')]()[_0x559d('0x84')]('COALESCE(phone,\x27\x27)')[_0x559d('0x86')](_0x559d('0xa1'))[_0x559d('0x4b')](_0x559d('0x8a'),_0x17812b[_0x559d('0x50')]['id'][_0x559d('0x8d')]())))[_0x559d('0x8d')]();break;case _0x559d('0xb0'):_0x1b226a=squel[_0x559d('0xb1')]()[_0x559d('0xa0')](_0x559d('0xa1'))[_0x559d('0xa2')]([_0x559d('0xa6'),_0x559d('0xa3'),'ContactId',_0x559d('0xa5'),'VoiceQueueId','createdAt','updatedAt'],squel[_0x559d('0x83')]()[_0x559d('0x84')](_0x559d('0xa6'),_0x559d('0xa6'))[_0x559d('0x84')](_0x559d('0xa7'),_0x559d('0xa3'))['field']('id',_0x559d('0xa4'))[_0x559d('0x84')](_0x78b9d6[_0x559d('0xa8')][_0x559d('0x8d')](),_0x559d('0xa5'))[_0x559d('0x84')](_0x17812b[_0x559d('0x50')]['id'][_0x559d('0x8d')](),'VoiceQueueId')[_0x559d('0x84')](_0x559d('0xa7'),'createdAt')[_0x559d('0x84')](_0x559d('0xa7'),_0x559d('0x5d'))[_0x559d('0x86')](_0x559d('0xa9'))[_0x559d('0x4b')](_0x559d('0xaa'))[_0x559d('0x4b')](_0x559d('0xab'),_0x78b9d6[_0x559d('0xa8')][_0x559d('0x8d')]())['where'](_0x559d('0xac'))[_0x559d('0x4b')](_0x559d('0xaf'),squel['select']()[_0x559d('0x84')](_0x559d('0xb2'))[_0x559d('0x86')](_0x559d('0xa1'))[_0x559d('0x4b')](_0x559d('0x8a'),_0x17812b['params']['id'][_0x559d('0x8d')]())))[_0x559d('0x8d')]();break;default:_0x1b226a=squel[_0x559d('0xb1')]()[_0x559d('0xa0')](_0x559d('0xa1'))[_0x559d('0xa2')]([_0x559d('0xa6'),_0x559d('0xa3'),'ContactId',_0x559d('0xa5'),_0x559d('0x6a'),_0x559d('0x5c'),_0x559d('0x5d')],squel[_0x559d('0x83')]()[_0x559d('0x84')]('phone',_0x559d('0xa6'))[_0x559d('0x84')]('NOW()','scheduledAt')[_0x559d('0x84')]('id','ContactId')[_0x559d('0x84')](_0x78b9d6[_0x559d('0xa8')][_0x559d('0x8d')](),_0x559d('0xa5'))['field'](_0x17812b[_0x559d('0x50')]['id'][_0x559d('0x8d')](),_0x559d('0x6a'))['field'](_0x559d('0xa7'),_0x559d('0x5c'))[_0x559d('0x84')]('NOW()','updatedAt')['from'](_0x559d('0xa9'))[_0x559d('0x4b')]('deletedAt\x20IS\x20NULL')[_0x559d('0x4b')]('ListId\x20=\x20?',_0x78b9d6[_0x559d('0xa8')][_0x559d('0x8d')]())[_0x559d('0x4b')](_0x559d('0xac')))['toString']();}_0xcb113[_0x559d('0x8c')](db[_0x559d('0x76')][_0x559d('0x3e')](_0x1b226a));}return BPromise['all'](_0xcb113);}})['then'](function(){return _0x7f9ca;})[_0x559d('0x27')](respondWithResult(_0x2d06e5,null))[_0x559d('0x53')](handleError(_0x2d06e5,null));};exports[_0x559d('0xb3')]=function(_0x50861d,_0xc1a3dd,_0x4f8109){return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x50861d[_0x559d('0x50')]['id']}})['then'](handleEntityNotFound(_0xc1a3dd,null))[_0x559d('0x27')](function(_0x3ecdd3){if(_0x3ecdd3){return _0x3ecdd3[_0x559d('0xb3')](_0x50861d['query'][_0x559d('0x82')]);}})[_0x559d('0x27')](function(_0x5b192a){if(_0x5b192a){return db[_0x559d('0x64')][_0x559d('0x28')]({'where':{'ListId':_0x50861d['query'][_0x559d('0x82')],'VoiceQueueId':_0x50861d[_0x559d('0x50')]['id']}})[_0x559d('0x27')](function(){return _0x5b192a;});}})['then'](respondWithStatusCode(_0xc1a3dd,null))[_0x559d('0x53')](handleError(_0xc1a3dd,null));};exports[_0x559d('0xb4')]=function(_0x2c52f9,_0x3194c7,_0x3998a5){var _0x4f42b1={};var _0x119116={};var _0x2e763b;var _0x664706;return db[_0x559d('0x3a')][_0x559d('0x63')]({'where':{'id':_0x2c52f9[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x3194c7,null))[_0x559d('0x27')](function(_0x12b3a7){if(_0x12b3a7){_0x2e763b=_0x12b3a7;_0x119116[_0x559d('0x3d')]=_[_0x559d('0x51')](db[_0x559d('0x9d')][_0x559d('0x5a')]);_0x119116[_0x559d('0x3e')]=_[_0x559d('0x51')](_0x2c52f9[_0x559d('0x3e')]);_0x119116[_0x559d('0x3f')]=_[_0x559d('0x40')](_0x119116['model'],_0x119116[_0x559d('0x3e')]);_0x4f42b1[_0x559d('0x41')]=_[_0x559d('0x40')](_0x119116['model'],qs['fields'](_0x2c52f9[_0x559d('0x3e')][_0x559d('0x42')]));_0x4f42b1[_0x559d('0x41')]=_0x4f42b1[_0x559d('0x41')][_0x559d('0x43')]?_0x4f42b1[_0x559d('0x41')]:_0x119116[_0x559d('0x3d')];_0x4f42b1['order']=qs[_0x559d('0x46')](_0x2c52f9[_0x559d('0x3e')]['sort']);_0x4f42b1[_0x559d('0x4b')]=qs[_0x559d('0x3f')](_['pick'](_0x2c52f9['query'],_0x119116['filters']));if(_0x2c52f9[_0x559d('0x3e')][_0x559d('0x2d')]){_0x4f42b1['where']=_[_0x559d('0x48')](_0x4f42b1[_0x559d('0x4b')],{'$or':_[_0x559d('0x2f')](_0x4f42b1['attributes'],function(_0x52ef25){var _0x2844d1={};_0x2844d1[_0x52ef25]={'$like':'%'+_0x2c52f9['query'][_0x559d('0x2d')]+'%'};return _0x2844d1;})});}_0x4f42b1=_[_0x559d('0x48')]({},_0x4f42b1,_0x2c52f9[_0x559d('0x4a')]);return _0x2e763b[_0x559d('0xb4')](_0x4f42b1);}})[_0x559d('0x27')](function(_0x391126){if(_0x391126){_0x664706=_0x391126['length'];if(!_0x2c52f9[_0x559d('0x3e')][_0x559d('0x44')](_0x559d('0x65'))){_0x4f42b1[_0x559d('0x21')]=qs[_0x559d('0x21')](_0x2c52f9[_0x559d('0x3e')]['limit']);_0x4f42b1['offset']=qs[_0x559d('0x20')](_0x2c52f9[_0x559d('0x3e')][_0x559d('0x20')]);}return _0x2e763b[_0x559d('0xb4')](_0x4f42b1);}})[_0x559d('0x27')](function(_0x4036f9){if(_0x4036f9){return _0x4036f9?{'count':_0x664706,'rows':_0x4036f9}:null;}})[_0x559d('0x27')](respondWithResult(_0x3194c7,null))[_0x559d('0x53')](handleError(_0x3194c7,null));};exports['addBlackLists']=function(_0x23458b,_0x4ff631,_0x12bdb4){var _0x3d6025,_0x315b2e;return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x23458b[_0x559d('0x50')]['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x4ff631,null))['then'](function(_0x45b6aa){if(_0x45b6aa){_0x315b2e=_0x45b6aa;return _0x45b6aa[_0x559d('0xb5')](_0x23458b[_0x559d('0x5e')][_0x559d('0x82')],_['omit'](_0x23458b[_0x559d('0x5e')],[_0x559d('0x82'),'id'])||{});}return null;})[_0x559d('0x96')](function(_0x2138d7){var _0x2894fa;_0x3d6025=_0x2138d7||[];var _0xcd25d1=[];if(_0x2138d7){for(var _0x42ef36=0x0;_0x42ef36<_0x2138d7[_0x559d('0x43')];_0x42ef36+=0x1){var _0x261b0e=_0x2138d7[_0x42ef36]['get']({'plain':!![]});_0x2894fa=squel[_0x559d('0xb1')]()[_0x559d('0xa0')](_0x559d('0xb6'))['fromQuery'](['phone',_0x559d('0xa4'),'ListId',_0x559d('0x6a'),_0x559d('0x5c'),_0x559d('0x5d')],squel[_0x559d('0x83')]()[_0x559d('0x84')](_0x559d('0xa6'),_0x559d('0xa6'))[_0x559d('0x84')]('id',_0x559d('0xa4'))[_0x559d('0x84')](_0x261b0e['CmListId'][_0x559d('0x8d')](),_0x559d('0xa5'))['field'](_0x23458b[_0x559d('0x50')]['id'][_0x559d('0x8d')](),'VoiceQueueId')[_0x559d('0x84')](_0x559d('0xa7'),_0x559d('0x5c'))['field'](_0x559d('0xa7'),_0x559d('0x5d'))[_0x559d('0x86')]('cm_contacts')[_0x559d('0x4b')]('deletedAt\x20IS\x20NULL')['where'](_0x559d('0xab'),_0x261b0e['CmListId'][_0x559d('0x8d')]())[_0x559d('0x4b')](_0x559d('0xac')))['toString']();_0xcd25d1['push'](db[_0x559d('0x76')][_0x559d('0x3e')](_0x2894fa));}return BPromise[_0x559d('0x98')](_0xcd25d1);}})[_0x559d('0x27')](function(){return _0x3d6025;})['then'](respondWithResult(_0x4ff631,null))[_0x559d('0x53')](handleError(_0x4ff631,null));};exports[_0x559d('0xb7')]=function(_0x481de4,_0x61b48c,_0x432dd8){return db[_0x559d('0x3a')][_0x559d('0x33')]({'where':{'id':_0x481de4['params']['id']}})[_0x559d('0x27')](handleEntityNotFound(_0x61b48c,null))[_0x559d('0x27')](function(_0x2c23c3){if(_0x2c23c3){return _0x2c23c3[_0x559d('0xb7')](_0x481de4['query']['ids']);}})['then'](function(_0x410352){if(_0x410352){return db[_0x559d('0x6c')][_0x559d('0x28')]({'where':{'ListId':_0x481de4[_0x559d('0x3e')][_0x559d('0x82')],'VoiceQueueId':_0x481de4['params']['id']}})[_0x559d('0x27')](function(){return _0x410352;});}})[_0x559d('0x27')](respondWithStatusCode(_0x61b48c,null))['catch'](handleError(_0x61b48c,null));}; \ No newline at end of file +var _0x952a=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','User','Agents','voicePause','forEach','penalty','sequelize','transaction','UserVoiceQueue','findOrCreate','each','upsert','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','Team','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','toString','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','insert','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','type','find','name','UserProfileResource','end','error','stack','map','VoiceQueue','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','body','createdAt','updatedAt','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals'];(function(_0x8e8578,_0xd2a6b5){var _0x279605=function(_0x4b0347){while(--_0x4b0347){_0x8e8578['push'](_0x8e8578['shift']());}};_0x279605(++_0xd2a6b5);}(_0x952a,0x107));var _0xa952=function(_0xe834ca,_0xc7f251){_0xe834ca=_0xe834ca-0x0;var _0x5a3d76=_0x952a[_0xe834ca];return _0x5a3d76;};'use strict';var pdf=require(_0xa952('0x0'));var emlformat=require(_0xa952('0x1'));var rimraf=require(_0xa952('0x2'));var zipdir=require(_0xa952('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa952('0x4'));var moment=require('moment');var BPromise=require(_0xa952('0x5'));var Mustache=require(_0xa952('0x6'));var util=require(_0xa952('0x7'));var path=require(_0xa952('0x8'));var sox=require(_0xa952('0x9'));var csv=require(_0xa952('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa952('0xb'));var squel=require(_0xa952('0xc'));var crypto=require(_0xa952('0xd'));var jsforce=require(_0xa952('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa952('0xa'));var querystring=require(_0xa952('0xf'));var Papa=require(_0xa952('0x10'));var Redis=require('ioredis');var authService=require(_0xa952('0x11'));var qs=require(_0xa952('0x12'));var as=require(_0xa952('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa952('0x14'))(_0xa952('0x15'));var utils=require('../../config/utils');var config=require(_0xa952('0x16'));var db=require(_0xa952('0x17'))['db'];config[_0xa952('0x18')]=_['defaults'](config[_0xa952('0x18')],{'host':_0xa952('0x19'),'port':0x18eb});var socket=require(_0xa952('0x1a'))(new Redis(config['redis']));require(_0xa952('0x1b'))[_0xa952('0x1c')](socket);function respondWithStatusCode(_0x275f1e,_0x5dc5da){_0x5dc5da=_0x5dc5da||0xcc;return function(_0x569a92){if(_0x569a92){return _0x275f1e[_0xa952('0x1d')](_0x5dc5da);}return _0x275f1e['status'](_0x5dc5da)['end']();};}function respondWithResult(_0x231489,_0x4414ef){_0x4414ef=_0x4414ef||0xc8;return function(_0x2b7746){if(_0x2b7746){return _0x231489[_0xa952('0x1e')](_0x4414ef)[_0xa952('0x1f')](_0x2b7746);}};}function respondWithFilteredResult(_0xee10c5,_0x4098cf){return function(_0x34667f){if(_0x34667f){var _0x3166cb=_0x34667f[_0xa952('0x20')],_0x1e32d8=_0x4098cf[_0xa952('0x21')],_0x367d92=_0x4098cf[_0xa952('0x21')]+_0x4098cf['limit'],_0xd086e0;if(_0x367d92>=_0x3166cb){_0x367d92=_0x3166cb;_0xd086e0=0xc8;}else{_0xd086e0=0xce;}_0xee10c5[_0xa952('0x1e')](_0xd086e0);return _0xee10c5['set'](_0xa952('0x22'),_0x1e32d8+'-'+_0x367d92+'/'+_0x3166cb)['json'](_0x34667f);}return null;};}function patchUpdates(_0x480a2a){return function(_0xdac3c7){try{jsonpatch['apply'](_0xdac3c7,_0x480a2a,!![]);}catch(_0x125140){return BPromise[_0xa952('0x23')](_0x125140);}return _0xdac3c7[_0xa952('0x24')]();};}function saveUpdates(_0x318d0f,_0x74455b){return function(_0xc282a){if(_0xc282a){return _0xc282a[_0xa952('0x25')](_0x318d0f)[_0xa952('0x26')](function(_0x4f1325){return _0x4f1325;});}return null;};}function removeEntity(_0x575760,_0x35cfc4){return function(_0x348548){if(_0x348548){return _0x348548[_0xa952('0x27')]()[_0xa952('0x26')](function(){var _0x265e38=_0x348548[_0xa952('0x28')]({'plain':!![]});var _0x40fc6c=[{'name':_0xa952('0x29'),'value':'inbound','ignore':![]},{'name':_0xa952('0x2a'),'value':_0xa952('0x2b'),'ignore':![]}];var _0x18cfb1=_(_0x40fc6c)[_0xa952('0x2c')](_0xa952('0x2d'))['map'](_0xa952('0x2e'))[_0xa952('0x2e')]();if(_['includes'](_0x18cfb1,_0x265e38[_0xa952('0x2f')])){return;}var _0x5a6b92=_[_0xa952('0x30')](_0x40fc6c,[_0xa952('0x2e'),_0x265e38[_0xa952('0x2f')]])[_0xa952('0x31')];return db[_0xa952('0x32')][_0xa952('0x27')]({'where':{'type':_0x5a6b92,'resourceId':_0x265e38['id']}})[_0xa952('0x26')](function(){return _0x348548;});})['then'](function(){_0x575760['status'](0xcc)[_0xa952('0x33')]();});}};}function handleEntityNotFound(_0x4ba64e,_0xbf4128){return function(_0x2cabd1){if(!_0x2cabd1){_0x4ba64e[_0xa952('0x1d')](0x194);}return _0x2cabd1;};}function handleError(_0x4d4ee3,_0x2ed7a2){_0x2ed7a2=_0x2ed7a2||0x1f4;return function(_0xeb2462){logger[_0xa952('0x34')](_0xeb2462[_0xa952('0x35')]);if(_0xeb2462['name']){delete _0xeb2462[_0xa952('0x31')];}_0x4d4ee3[_0xa952('0x1e')](_0x2ed7a2)['send'](_0xeb2462);};}exports['index']=function(_0x362a5c,_0x1505b2){var _0x36f2cb={},_0x4779d9={},_0x877019={'count':0x0,'rows':[]};var _0xbadfb1=_[_0xa952('0x36')](db[_0xa952('0x37')][_0xa952('0x38')],function(_0x22ffcb){return{'name':_0x22ffcb[_0xa952('0x39')],'type':_0x22ffcb['type'][_0xa952('0x3a')]};});_0x4779d9[_0xa952('0x3b')]=_[_0xa952('0x36')](_0xbadfb1,'name');_0x4779d9['query']=_[_0xa952('0x3c')](_0x362a5c[_0xa952('0x3d')]);_0x4779d9['filters']=_[_0xa952('0x3e')](_0x4779d9[_0xa952('0x3b')],_0x4779d9[_0xa952('0x3d')]);_0x36f2cb[_0xa952('0x3f')]=_[_0xa952('0x3e')](_0x4779d9[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x362a5c[_0xa952('0x3d')]['fields']));_0x36f2cb[_0xa952('0x3f')]=_0x36f2cb[_0xa952('0x3f')][_0xa952('0x41')]?_0x36f2cb[_0xa952('0x3f')]:_0x4779d9[_0xa952('0x3b')];if(!_0x362a5c[_0xa952('0x3d')][_0xa952('0x42')]('nolimit')){_0x36f2cb[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x362a5c[_0xa952('0x3d')][_0xa952('0x43')]);_0x36f2cb[_0xa952('0x21')]=qs[_0xa952('0x21')](_0x362a5c['query']['offset']);}_0x36f2cb[_0xa952('0x44')]=qs['sort'](_0x362a5c[_0xa952('0x3d')][_0xa952('0x45')]);_0x36f2cb[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x362a5c[_0xa952('0x3d')],_0x4779d9[_0xa952('0x47')]),_0xbadfb1);if(_0x362a5c[_0xa952('0x3d')][_0xa952('0x2c')]){_0x36f2cb['where']=_[_0xa952('0x49')](_0x36f2cb['where'],{'$or':_['map'](_0xbadfb1,function(_0x541837){if(_0x541837[_0xa952('0x2f')]!==_0xa952('0x4a')){var _0x2a2c4b={};_0x2a2c4b[_0x541837[_0xa952('0x31')]]={'$like':'%'+_0x362a5c[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x2a2c4b;}})});}_0x36f2cb=_['merge']({},_0x36f2cb,_0x362a5c[_0xa952('0x4b')]);var _0x2451cb={'where':_0x36f2cb['where']};return db[_0xa952('0x37')][_0xa952('0x20')](_0x2451cb)['then'](function(_0x425f59){_0x877019[_0xa952('0x20')]=_0x425f59;if(_0x362a5c['query'][_0xa952('0x4c')]){_0x36f2cb[_0xa952('0x4d')]=[{'all':!![]}];}return db[_0xa952('0x37')][_0xa952('0x4e')](_0x36f2cb);})[_0xa952('0x26')](function(_0x506c90){_0x877019[_0xa952('0x4f')]=_0x506c90;return _0x877019;})[_0xa952('0x26')](respondWithFilteredResult(_0x1505b2,_0x36f2cb))['catch'](handleError(_0x1505b2,null));};exports['show']=function(_0x43b1e0,_0x12ab12){var _0x4d49b9={'raw':![],'where':{'id':_0x43b1e0['params']['id']}},_0x52eb57={};_0x52eb57['model']=_[_0xa952('0x3c')](db[_0xa952('0x37')]['rawAttributes']);_0x52eb57[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x43b1e0['query']);_0x52eb57[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x52eb57[_0xa952('0x3b')],_0x52eb57[_0xa952('0x3d')]);_0x4d49b9[_0xa952('0x3f')]=_[_0xa952('0x3e')](_0x52eb57['model'],qs[_0xa952('0x40')](_0x43b1e0[_0xa952('0x3d')][_0xa952('0x40')]));_0x4d49b9['attributes']=_0x4d49b9[_0xa952('0x3f')]['length']?_0x4d49b9[_0xa952('0x3f')]:_0x52eb57[_0xa952('0x3b')];if(_0x43b1e0[_0xa952('0x3d')][_0xa952('0x4c')]){_0x4d49b9[_0xa952('0x4d')]=[{'all':!![]}];}_0x4d49b9=_[_0xa952('0x49')]({},_0x4d49b9,_0x43b1e0[_0xa952('0x4b')]);return db[_0xa952('0x37')][_0xa952('0x30')](_0x4d49b9)[_0xa952('0x26')](handleEntityNotFound(_0x12ab12,null))[_0xa952('0x26')](respondWithResult(_0x12ab12,null))[_0xa952('0x50')](handleError(_0x12ab12,null));};exports[_0xa952('0x51')]=function(_0x3a1cb2,_0x2371f2){return db[_0xa952('0x37')][_0xa952('0x51')](_0x3a1cb2['body'],{})[_0xa952('0x26')](function(_0xac9127){var _0x53d2a3=_0x3a1cb2['user'][_0xa952('0x28')]({'plain':!![]});if(!_0x53d2a3)throw new Error(_0xa952('0x52'));if(_0x53d2a3[_0xa952('0x53')]===_0xa952('0x54')){var _0x40cf34=_0xac9127[_0xa952('0x28')]({'plain':!![]});var _0x4065af=[{'name':_0xa952('0x29'),'value':_0xa952('0x55')},{'name':_0xa952('0x2a'),'value':_0xa952('0x2b')}];var _0xc8c502=_['find'](_0x4065af,[_0xa952('0x2e'),_0x40cf34['type']])[_0xa952('0x31')];return db[_0xa952('0x56')]['find']({'where':{'name':_0xc8c502,'userProfileId':_0x53d2a3[_0xa952('0x57')]},'raw':!![]})[_0xa952('0x26')](function(_0x1ed124){if(_0x1ed124&&_0x1ed124[_0xa952('0x58')]===0x0){return db['UserProfileResource'][_0xa952('0x51')]({'name':_0x40cf34[_0xa952('0x31')],'resourceId':_0x40cf34['id'],'type':_0x1ed124[_0xa952('0x31')],'sectionId':_0x1ed124['id']},{})['then'](function(){return _0xac9127;});}else{return _0xac9127;}})[_0xa952('0x50')](function(_0x4515e9){logger[_0xa952('0x34')](_0xa952('0x59'),_0x4515e9);throw _0x4515e9;});}return _0xac9127;})[_0xa952('0x26')](respondWithResult(_0x2371f2,0xc9))[_0xa952('0x50')](handleError(_0x2371f2,null));};exports['clone']=function(_0xd03d70,_0x5bf1a2){var _0x260f9c={'where':{'id':_0xd03d70[_0xa952('0x5a')]['id']}},_0x1df0a3={};_0x1df0a3[_0xa952('0x3b')]=_[_0xa952('0x3c')](db[_0xa952('0x37')][_0xa952('0x38')]);_0x260f9c['attributes']=_[_0xa952('0x3e')](_0x1df0a3[_0xa952('0x3b')],qs['fields'](_0xd03d70[_0xa952('0x3d')][_0xa952('0x40')]));_0x260f9c[_0xa952('0x3f')]=_0x260f9c[_0xa952('0x3f')][_0xa952('0x41')]?_0x260f9c[_0xa952('0x3f')]:_0x1df0a3[_0xa952('0x3b')];if(_0xd03d70[_0xa952('0x3d')][_0xa952('0x4c')]){_0x260f9c[_0xa952('0x4d')]=[{'all':!![]}];}_0x260f9c=_[_0xa952('0x49')]({},_0x260f9c,_0xd03d70['options']);return db[_0xa952('0x37')][_0xa952('0x30')](_0x260f9c)['then'](handleEntityNotFound(_0x5bf1a2,null))[_0xa952('0x26')](function(_0x1503bb){if(_0x1503bb){var _0x3537f9=_0x1503bb[_0xa952('0x28')]({'plain':!![]});_0x3537f9=qs[_0xa952('0x5b')](_0x3537f9,['id','createdAt','updatedAt']);_0xd03d70[_0xa952('0x5c')]=_[_0xa952('0x5b')](_0xd03d70[_0xa952('0x5c')],['id',_0xa952('0x5d'),_0xa952('0x5e')]);return db[_0xa952('0x37')][_0xa952('0x51')](_[_0xa952('0x49')](_0x3537f9,_0xd03d70[_0xa952('0x5c')]),{'include':_0xd03d70[_0xa952('0x3d')][_0xa952('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x4a913f){var _0x1a1801=_0xd03d70[_0xa952('0x54')][_0xa952('0x28')]({'plain':!![]});if(!_0x1a1801)throw new Error(_0xa952('0x52'));if(_0x1a1801['role']===_0xa952('0x54')){var _0x2bd77b=_0x4a913f[_0xa952('0x28')]({'plain':!![]});var _0x4ee731=[{'name':_0xa952('0x29'),'value':'inbound'},{'name':_0xa952('0x2a'),'value':_0xa952('0x2b')}];var _0x4f2be1=_[_0xa952('0x30')](_0x4ee731,[_0xa952('0x2e'),_0x2bd77b[_0xa952('0x2f')]])[_0xa952('0x31')];return db['UserProfileSection'][_0xa952('0x30')]({'where':{'name':_0x4f2be1,'userProfileId':_0x1a1801['userProfileId']},'raw':!![]})[_0xa952('0x26')](function(_0x3f8e5e){if(_0x3f8e5e&&_0x3f8e5e[_0xa952('0x58')]===0x0){return db['UserProfileResource'][_0xa952('0x51')]({'name':_0x2bd77b[_0xa952('0x31')],'resourceId':_0x2bd77b['id'],'type':_0x3f8e5e[_0xa952('0x31')],'sectionId':_0x3f8e5e['id']},{})['then'](function(){return _0x4a913f;});}else{return _0x4a913f;}})[_0xa952('0x50')](function(_0x4d5bb2){logger[_0xa952('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d5bb2);throw _0x4d5bb2;});}return _0x4a913f;});}})[_0xa952('0x26')](respondWithResult(_0x5bf1a2,0xc9))[_0xa952('0x50')](handleError(_0x5bf1a2,null));};exports[_0xa952('0x25')]=function(_0x1b5eb3,_0x5562d3){if(_0x1b5eb3[_0xa952('0x5c')]['id']){delete _0x1b5eb3['body']['id'];}return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0x1b5eb3[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x5562d3,null))[_0xa952('0x26')](saveUpdates(_0x1b5eb3[_0xa952('0x5c')],null))[_0xa952('0x26')](respondWithResult(_0x5562d3,null))['catch'](handleError(_0x5562d3,null));};exports[_0xa952('0x27')]=function(_0xd35938,_0x306645){return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0xd35938[_0xa952('0x5a')]['id']}})['then'](handleEntityNotFound(_0x306645,null))[_0xa952('0x26')](removeEntity(_0x306645,null))[_0xa952('0x50')](handleError(_0x306645,null));};exports[_0xa952('0x5f')]=function(_0x4c5762,_0x258f1c,_0x1e12a8){var _0x2ee96c={'raw':![],'where':{}};var _0x26f891={};var _0x18b8b2={'count':0x0,'rows':[]};return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x4c5762[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x258f1c,null))[_0xa952('0x26')](function(_0x147640){if(_0x147640){_0x26f891[_0xa952('0x3b')]=_[_0xa952('0x3c')](db[_0xa952('0x61')][_0xa952('0x38')]);_0x26f891[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x4c5762[_0xa952('0x3d')]);_0x26f891[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x26f891[_0xa952('0x3b')],_0x26f891['query']);_0x2ee96c['attributes']=_[_0xa952('0x3e')](_0x26f891['model'],qs[_0xa952('0x40')](_0x4c5762[_0xa952('0x3d')][_0xa952('0x40')]));_0x2ee96c[_0xa952('0x3f')]=_0x2ee96c[_0xa952('0x3f')][_0xa952('0x41')]?_0x2ee96c[_0xa952('0x3f')]:_0x26f891[_0xa952('0x3b')];if(!_0x4c5762[_0xa952('0x3d')]['hasOwnProperty']('nolimit')){_0x2ee96c[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x4c5762[_0xa952('0x3d')]['limit']);_0x2ee96c['offset']=qs['offset'](_0x4c5762[_0xa952('0x3d')][_0xa952('0x21')]);}_0x2ee96c[_0xa952('0x44')]=qs[_0xa952('0x45')](_0x4c5762[_0xa952('0x3d')][_0xa952('0x45')]);_0x2ee96c[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x4c5762[_0xa952('0x3d')],_0x26f891[_0xa952('0x47')]));_0x2ee96c[_0xa952('0x46')][_0xa952('0x62')]=_0x147640['id'];if(_0x4c5762['query'][_0xa952('0x2c')]){_0x2ee96c[_0xa952('0x46')]=_[_0xa952('0x49')](_0x2ee96c[_0xa952('0x46')],{'$or':_[_0xa952('0x36')](_0x2ee96c[_0xa952('0x3f')],function(_0x511389){var _0x198982={};_0x198982[_0x511389]={'$like':'%'+_0x4c5762[_0xa952('0x3d')]['filter']+'%'};return _0x198982;})});}_0x2ee96c=_[_0xa952('0x49')]({},_0x2ee96c,_0x4c5762[_0xa952('0x4b')]);return db[_0xa952('0x61')][_0xa952('0x20')]({'where':_0x2ee96c[_0xa952('0x46')]})['then'](function(_0x8f4f32){_0x18b8b2[_0xa952('0x20')]=_0x8f4f32;if(_0x4c5762[_0xa952('0x3d')][_0xa952('0x4c')]){_0x2ee96c[_0xa952('0x4d')]=[{'all':!![]}];}return db[_0xa952('0x61')][_0xa952('0x4e')](_0x2ee96c);})[_0xa952('0x26')](function(_0x2434df){_0x18b8b2[_0xa952('0x4f')]=_0x2434df;return _0x18b8b2;});}})['then'](respondWithFilteredResult(_0x258f1c,_0x2ee96c))['catch'](handleError(_0x258f1c,null));};exports[_0xa952('0x63')]=function(_0x34e351,_0x337e5c,_0x11d75c){var _0x372195={'raw':!![],'where':{}};var _0x1a5538={};var _0x1e838c={'count':0x0,'rows':[]};return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x34e351[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x337e5c,null))['then'](function(_0x1f5f60){if(_0x1f5f60){_0x1a5538[_0xa952('0x3b')]=_[_0xa952('0x3c')](db[_0xa952('0x64')][_0xa952('0x38')]);_0x1a5538['query']=_['keys'](_0x34e351[_0xa952('0x3d')]);_0x1a5538[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x1a5538[_0xa952('0x3b')],_0x1a5538['query']);_0x372195[_0xa952('0x3f')]=_['intersection'](_0x1a5538['model'],qs[_0xa952('0x40')](_0x34e351['query'][_0xa952('0x40')]));_0x372195[_0xa952('0x3f')]=_0x372195[_0xa952('0x3f')][_0xa952('0x41')]?_0x372195[_0xa952('0x3f')]:_0x1a5538[_0xa952('0x3b')];if(!_0x34e351[_0xa952('0x3d')][_0xa952('0x42')](_0xa952('0x65'))){_0x372195[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x34e351[_0xa952('0x3d')][_0xa952('0x43')]);_0x372195[_0xa952('0x21')]=qs[_0xa952('0x21')](_0x34e351[_0xa952('0x3d')][_0xa952('0x21')]);}_0x372195[_0xa952('0x44')]=qs['sort'](_0x34e351[_0xa952('0x3d')][_0xa952('0x45')]);_0x372195[_0xa952('0x46')]=qs[_0xa952('0x47')](_['pick'](_0x34e351[_0xa952('0x3d')],_0x1a5538[_0xa952('0x47')]));_0x372195[_0xa952('0x46')]['VoiceQueueId']=_0x1f5f60['id'];if(_0x34e351[_0xa952('0x3d')][_0xa952('0x2c')]){_0x372195['where']=_['merge'](_0x372195['where'],{'$or':_[_0xa952('0x36')](_0x372195[_0xa952('0x3f')],function(_0x497bc4){var _0x170f4d={};_0x170f4d[_0x497bc4]={'$like':'%'+_0x34e351[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x170f4d;})});}_0x372195=_[_0xa952('0x49')]({},_0x372195,_0x34e351[_0xa952('0x4b')]);return db[_0xa952('0x64')]['count']({'where':_0x372195['where']})['then'](function(_0x5a868d){_0x1e838c[_0xa952('0x20')]=_0x5a868d;if(_0x34e351[_0xa952('0x3d')][_0xa952('0x4c')]){_0x372195[_0xa952('0x4d')]=[{'all':!![]}];}return db[_0xa952('0x64')][_0xa952('0x4e')](_0x372195);})[_0xa952('0x26')](function(_0x1c9ab3){_0x1e838c['rows']=_0x1c9ab3;return _0x1e838c;});}})[_0xa952('0x26')](respondWithFilteredResult(_0x337e5c,_0x372195))[_0xa952('0x50')](handleError(_0x337e5c,null));};exports[_0xa952('0x66')]=function(_0x16a198,_0x583bb8,_0x1f0166){var _0x4affcb={'raw':!![],'where':{}};var _0x28993c={};var _0x2195db={'count':0x0,'rows':[]};return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x16a198['params']['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x583bb8,null))[_0xa952('0x26')](function(_0x15412a){if(_0x15412a){_0x28993c[_0xa952('0x3b')]=_[_0xa952('0x3c')](db[_0xa952('0x67')][_0xa952('0x38')]);_0x28993c[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x16a198[_0xa952('0x3d')]);_0x28993c['filters']=_['intersection'](_0x28993c[_0xa952('0x3b')],_0x28993c[_0xa952('0x3d')]);_0x4affcb['attributes']=_[_0xa952('0x3e')](_0x28993c[_0xa952('0x3b')],qs['fields'](_0x16a198[_0xa952('0x3d')][_0xa952('0x40')]));_0x4affcb[_0xa952('0x3f')]=_0x4affcb[_0xa952('0x3f')][_0xa952('0x41')]?_0x4affcb[_0xa952('0x3f')]:_0x28993c[_0xa952('0x3b')];if(!_0x16a198[_0xa952('0x3d')]['hasOwnProperty'](_0xa952('0x65'))){_0x4affcb[_0xa952('0x43')]=qs['limit'](_0x16a198[_0xa952('0x3d')][_0xa952('0x43')]);_0x4affcb[_0xa952('0x21')]=qs['offset'](_0x16a198[_0xa952('0x3d')][_0xa952('0x21')]);}_0x4affcb['order']=qs[_0xa952('0x45')](_0x16a198[_0xa952('0x3d')][_0xa952('0x45')]);_0x4affcb['where']=qs['filters'](_[_0xa952('0x48')](_0x16a198[_0xa952('0x3d')],_0x28993c[_0xa952('0x47')]));_0x4affcb[_0xa952('0x46')][_0xa952('0x62')]=_0x15412a['id'];if(_0x16a198[_0xa952('0x3d')][_0xa952('0x2c')]){_0x4affcb[_0xa952('0x46')]=_[_0xa952('0x49')](_0x4affcb[_0xa952('0x46')],{'$or':_['map'](_0x4affcb['attributes'],function(_0x3a5481){var _0x2970f3={};_0x2970f3[_0x3a5481]={'$like':'%'+_0x16a198[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x2970f3;})});}_0x4affcb=_[_0xa952('0x49')]({},_0x4affcb,_0x16a198[_0xa952('0x4b')]);return db['CmHopperFinal'][_0xa952('0x20')]({'where':_0x4affcb[_0xa952('0x46')]})[_0xa952('0x26')](function(_0x1effc6){_0x2195db['count']=_0x1effc6;if(_0x16a198[_0xa952('0x3d')][_0xa952('0x4c')]){_0x4affcb[_0xa952('0x4d')]=[{'all':!![]}];}return db[_0xa952('0x67')][_0xa952('0x4e')](_0x4affcb);})[_0xa952('0x26')](function(_0x3b52ec){_0x2195db[_0xa952('0x4f')]=_0x3b52ec;return _0x2195db;});}})[_0xa952('0x26')](respondWithFilteredResult(_0x583bb8,_0x4affcb))[_0xa952('0x50')](handleError(_0x583bb8,null));};exports[_0xa952('0x68')]=function(_0x3f2fd8,_0xf94a78,_0x5d855f){var _0x5018e3={'raw':!![],'where':{}};var _0xb76052={};var _0x1af2f1={'count':0x0,'rows':[]};return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x3f2fd8[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0xf94a78,null))['then'](function(_0x5894a7){if(_0x5894a7){_0xb76052[_0xa952('0x3b')]=_['keys'](db[_0xa952('0x69')][_0xa952('0x38')]);_0xb76052[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x3f2fd8['query']);_0xb76052[_0xa952('0x47')]=_[_0xa952('0x3e')](_0xb76052['model'],_0xb76052['query']);_0x5018e3[_0xa952('0x3f')]=_['intersection'](_0xb76052[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x3f2fd8[_0xa952('0x3d')][_0xa952('0x40')]));_0x5018e3[_0xa952('0x3f')]=_0x5018e3[_0xa952('0x3f')][_0xa952('0x41')]?_0x5018e3[_0xa952('0x3f')]:_0xb76052[_0xa952('0x3b')];if(!_0x3f2fd8['query'][_0xa952('0x42')]('nolimit')){_0x5018e3[_0xa952('0x43')]=qs['limit'](_0x3f2fd8[_0xa952('0x3d')][_0xa952('0x43')]);_0x5018e3[_0xa952('0x21')]=qs[_0xa952('0x21')](_0x3f2fd8['query'][_0xa952('0x21')]);}_0x5018e3[_0xa952('0x44')]=qs[_0xa952('0x45')](_0x3f2fd8[_0xa952('0x3d')][_0xa952('0x45')]);_0x5018e3[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x3f2fd8[_0xa952('0x3d')],_0xb76052[_0xa952('0x47')]));_0x5018e3[_0xa952('0x46')][_0xa952('0x62')]=_0x5894a7['id'];if(_0x3f2fd8[_0xa952('0x3d')]['filter']){_0x5018e3[_0xa952('0x46')]=_[_0xa952('0x49')](_0x5018e3[_0xa952('0x46')],{'$or':_[_0xa952('0x36')](_0x5018e3[_0xa952('0x3f')],function(_0x47d938){var _0x2c58fa={};_0x2c58fa[_0x47d938]={'$like':'%'+_0x3f2fd8['query']['filter']+'%'};return _0x2c58fa;})});}_0x5018e3=_['merge']({},_0x5018e3,_0x3f2fd8[_0xa952('0x4b')]);return db[_0xa952('0x69')][_0xa952('0x20')]({'where':_0x5018e3[_0xa952('0x46')]})[_0xa952('0x26')](function(_0x4ee6bd){_0x1af2f1[_0xa952('0x20')]=_0x4ee6bd;if(_0x3f2fd8['query']['includeAll']){_0x5018e3[_0xa952('0x4d')]=[{'all':!![]}];}return db[_0xa952('0x69')][_0xa952('0x4e')](_0x5018e3);})[_0xa952('0x26')](function(_0x4017a4){_0x1af2f1[_0xa952('0x4f')]=_0x4017a4;return _0x1af2f1;});}})[_0xa952('0x26')](respondWithFilteredResult(_0xf94a78,_0x5018e3))['catch'](handleError(_0xf94a78,null));};exports[_0xa952('0x6a')]=function(_0x1ab88a,_0x34bfce,_0x704347){var _0x41edf7={};var _0x98fa85={};var _0x2a39ad;var _0x41e8a3;return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x1ab88a[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x34bfce,null))[_0xa952('0x26')](function(_0x26ef02){if(_0x26ef02){_0x2a39ad=_0x26ef02;_0x98fa85['model']=_[_0xa952('0x3c')](db['Team'][_0xa952('0x38')]);_0x98fa85[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x1ab88a[_0xa952('0x3d')]);_0x98fa85[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x98fa85['model'],_0x98fa85[_0xa952('0x3d')]);_0x41edf7['attributes']=_['intersection'](_0x98fa85[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x1ab88a[_0xa952('0x3d')][_0xa952('0x40')]));_0x41edf7[_0xa952('0x3f')]=_0x41edf7[_0xa952('0x3f')]['length']?_0x41edf7[_0xa952('0x3f')]:_0x98fa85[_0xa952('0x3b')];_0x41edf7[_0xa952('0x44')]=qs[_0xa952('0x45')](_0x1ab88a[_0xa952('0x3d')]['sort']);_0x41edf7[_0xa952('0x46')]=qs['filters'](_[_0xa952('0x48')](_0x1ab88a[_0xa952('0x3d')],_0x98fa85[_0xa952('0x47')]));if(_0x1ab88a['query'][_0xa952('0x2c')]){_0x41edf7[_0xa952('0x46')]=_[_0xa952('0x49')](_0x41edf7[_0xa952('0x46')],{'$or':_[_0xa952('0x36')](_0x41edf7[_0xa952('0x3f')],function(_0x31cfbb){var _0x59f8dc={};_0x59f8dc[_0x31cfbb]={'$like':'%'+_0x1ab88a[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x59f8dc;})});}_0x41edf7=_[_0xa952('0x49')]({},_0x41edf7,_0x1ab88a[_0xa952('0x4b')]);return _0x2a39ad[_0xa952('0x6a')](_0x41edf7);}})[_0xa952('0x26')](function(_0xd28af7){if(_0xd28af7){_0x41e8a3=_0xd28af7['length'];if(!_0x1ab88a[_0xa952('0x3d')]['hasOwnProperty'](_0xa952('0x65'))){_0x41edf7[_0xa952('0x43')]=qs['limit'](_0x1ab88a['query']['limit']);_0x41edf7[_0xa952('0x21')]=qs[_0xa952('0x21')](_0x1ab88a[_0xa952('0x3d')][_0xa952('0x21')]);}return _0x2a39ad[_0xa952('0x6a')](_0x41edf7);}})[_0xa952('0x26')](function(_0x8c6a6b){if(_0x8c6a6b){return _0x8c6a6b?{'count':_0x41e8a3,'rows':_0x8c6a6b}:null;}})['then'](respondWithResult(_0x34bfce,null))[_0xa952('0x50')](handleError(_0x34bfce,null));};exports[_0xa952('0x6b')]=function(_0x5113e1,_0x56a6e3,_0x6072c2){var _0x3fbb50=_0x5113e1['body']['teams'];var _0x217197=_[_0xa952('0x36')](_0x3fbb50,'id');return db['Team']['findAll']({'where':{'id':_0x217197},'attributes':['id'],'include':[{'model':db[_0xa952('0x6c')],'as':_0xa952('0x6d'),'attributes':['id',_0xa952('0x31'),'online',_0xa952('0x6e'),'interface'],'raw':!![]}]})[_0xa952('0x26')](function(_0xcef4e9){if(_0xcef4e9){var _0x386df4=_['flatMap'](_0xcef4e9,function(_0x3d1a70){var _0x42dd5e=_0x3d1a70['get']({'plain':!![]});_0x42dd5e['Agents'][_0xa952('0x6f')](function(_0x4c027e){_0x4c027e[_0xa952('0x70')]=_['find'](_0x3fbb50,{'id':_0x42dd5e['id']})['penalty'];});return _0x42dd5e[_0xa952('0x6d')];});return db[_0xa952('0x37')]['find']({'where':{'id':_0x5113e1['params']['id']}})['then'](function(_0x524b0a){return db[_0xa952('0x71')][_0xa952('0x72')](function(_0x4182b7){return _0x524b0a['addTeams'](_0x217197,{'transaction':_0x4182b7})['then'](function(){return BPromise['each'](_0x386df4,function(_0xf8813e){return db[_0xa952('0x73')][_0xa952('0x74')]({'where':{'UserId':_0xf8813e['id'],'VoiceQueueId':_0x5113e1[_0xa952('0x5a')]['id']},'defaults':{'penalty':_0xf8813e[_0xa952('0x70')]},'transaction':_0x4182b7});});})[_0xa952('0x26')](function(){return BPromise[_0xa952('0x75')](_['filter'](_0x386df4,{'online':!![]}),function(_0x2c3e4e){return db['UserVoiceQueueRt'][_0xa952('0x76')]({'membername':_0x2c3e4e[_0xa952('0x31')],'UserId':_0x2c3e4e['id'],'queue_name':_0x524b0a[_0xa952('0x31')],'VoiceQueueId':_0x524b0a['id'],'interface':_[_0xa952('0x77')](_0x2c3e4e[_0xa952('0x78')])?util[_0xa952('0x79')](_0xa952('0x7a'),_0x2c3e4e[_0xa952('0x31')]):_0x2c3e4e[_0xa952('0x78')],'paused':_0x2c3e4e[_0xa952('0x6e')]||![],'penalty':_0x2c3e4e[_0xa952('0x70')]},{'transaction':_0x4182b7});});})[_0xa952('0x26')](function(){_0x386df4['forEach'](function(_0x504344){socket[_0xa952('0x7b')](_0xa952('0x7c'),{'UserId':_0x504344['id'],'VoiceQueueId':_0x524b0a['id']});});});});});}})[_0xa952('0x26')](respondWithStatusCode(_0x56a6e3,null))['catch'](handleError(_0x56a6e3,null));};exports[_0xa952('0x7d')]=function(_0x32b2dd,_0x8d641f,_0x1d7eb7){return db[_0xa952('0x7e')][_0xa952('0x4e')]({'where':{'id':_0x32b2dd['query'][_0xa952('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xa952('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa952('0x26')](handleEntityNotFound(_0x8d641f,null))[_0xa952('0x26')](function(_0x214845){var _0x1c88fb=_[_0xa952('0x36')](_0x214845,'id');var _0x516610=[];var _0x2a5c61=[];var _0x3cca6b=squel[_0xa952('0x80')]();_0x3cca6b[_0xa952('0x81')](_0xa952('0x82'))[_0xa952('0x83')](_0xa952('0x84'),'tq')[_0xa952('0x85')](_0xa952('0x86'),'ut',_0xa952('0x87'))[_0xa952('0x46')]('VoiceQueueId\x20=\x20?',_0x32b2dd[_0xa952('0x5a')]['id']);for(var _0x5f1daa=0x0;_0x5f1daa<_0x214845[_0xa952('0x41')];_0x5f1daa+=0x1){let _0x51988f=_0x214845[_0x5f1daa];for(var _0x34e900=0x0;_0x34e900<_0x51988f['Agents'][_0xa952('0x41')];_0x34e900+=0x1){let _0x635333=_0x51988f['Agents'][_0x34e900];var _0x3f0c66=_0x3cca6b['clone']();_0x3f0c66[_0xa952('0x46')]('ut.UserId\x20=\x20?',_0x635333['id']);_0x2a5c61[_0xa952('0x88')](db[_0xa952('0x71')]['query'](_0x3f0c66['toString'](),{'type':db['sequelize'][_0xa952('0x89')][_0xa952('0x8a')]})[_0xa952('0x26')](function(_0x229f13){if(_0x229f13[_0xa952('0x41')]===0x1){return _0x635333['id'];}else{var _0x310f02=_[_0xa952('0x8b')](_[_0xa952('0x36')](_0x229f13,_0xa952('0x8c')),function(_0x4a3d31){return _[_0xa952('0x8d')](_0x1c88fb,_0x4a3d31);});if(_0x310f02){return _0x635333['id'];}}}));}}return BPromise[_0xa952('0x8e')](_0x2a5c61)['then'](function(_0x50849b){_0x516610=_(_0x516610)['union'](_0x50849b)[_0xa952('0x8f')]()[_0xa952('0x2e')]();return db['VoiceQueue']['find']({'where':{'id':_0x32b2dd['params']['id']}})[_0xa952('0x26')](function(_0x52e339){return db[_0xa952('0x71')][_0xa952('0x72')](function(_0x5d8128){return _0x52e339[_0xa952('0x7d')](_0x32b2dd[_0xa952('0x3d')][_0xa952('0x7f')],{'transaction':_0x5d8128})[_0xa952('0x26')](function(){if(!_[_0xa952('0x90')](_0x516610)){return _0x52e339[_0xa952('0x91')](_0x516610,{'transaction':_0x5d8128})[_0xa952('0x26')](function(){return db[_0xa952('0x92')][_0xa952('0x27')]({'where':{'VoiceQueueId':_0x32b2dd[_0xa952('0x5a')]['id'],'UserId':_0x516610},'transaction':_0x5d8128});});}})['then'](function(){_0x516610[_0xa952('0x6f')](function(_0x1118e4){socket['emit'](_0xa952('0x93'),{'UserId':_0x1118e4,'VoiceQueueId':_0x52e339['id']});});});});});});})[_0xa952('0x26')](respondWithStatusCode(_0x8d641f,null))[_0xa952('0x50')](handleError(_0x8d641f,null));};exports[_0xa952('0x94')]=function(_0x36c698,_0x1bcaa2,_0x2cfdc4){var _0x39d5b3,_0x55f318;return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0x36c698['params']['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x1bcaa2,null))[_0xa952('0x26')](function(_0x312574){if(_0x312574){_0x55f318=_0x312574;return _0x312574['addAgents'](_0x36c698[_0xa952('0x5c')][_0xa952('0x7f')],_[_0xa952('0x5b')](_0x36c698['body'],[_0xa952('0x7f'),'id'])||{})['spread'](function(_0x32f5fc){for(var _0x23a20c=0x0;_0x23a20c<_0x36c698[_0xa952('0x5c')][_0xa952('0x7f')][_0xa952('0x41')];_0x23a20c+=0x1){socket['emit'](_0xa952('0x7c'),{'UserId':_0x36c698[_0xa952('0x5c')][_0xa952('0x7f')][_0x23a20c],'VoiceQueueId':_0x36c698[_0xa952('0x5a')]['id']});}return _0x32f5fc;});}})[_0xa952('0x26')](function(_0x5044d4){_0x39d5b3=_0x5044d4||[];if(_0x55f318){return db['User'][_0xa952('0x4e')]({'where':{'id':_0x36c698[_0xa952('0x5c')][_0xa952('0x7f')]},'attributes':['id','name','online',_0xa952('0x6e'),_0xa952('0x78')],'raw':!![]});}})[_0xa952('0x26')](function(_0x134ac0){if(!_[_0xa952('0x90')](_0x134ac0)){var _0x25a7cc=[];for(var _0x3b66e1=0x0;_0x3b66e1<_0x134ac0[_0xa952('0x41')];_0x3b66e1++){if(_0x134ac0[_0x3b66e1]['online']){_0x25a7cc[_0xa952('0x88')](db[_0xa952('0x92')][_0xa952('0x76')]({'membername':_0x134ac0[_0x3b66e1][_0xa952('0x31')],'UserId':_0x134ac0[_0x3b66e1]['id'],'queue_name':_0x55f318[_0xa952('0x31')],'VoiceQueueId':_0x55f318['id'],'interface':_[_0xa952('0x77')](_0x134ac0[_0x3b66e1][_0xa952('0x78')])?util['format'](_0xa952('0x7a'),_0x134ac0[_0x3b66e1][_0xa952('0x31')]):_0x134ac0[_0x3b66e1][_0xa952('0x78')],'paused':_0x134ac0[_0x3b66e1][_0xa952('0x6e')]||![],'penalty':_0x36c698[_0xa952('0x5c')][_0xa952('0x70')]||0x0}));}}return BPromise[_0xa952('0x8e')](_0x25a7cc);}})[_0xa952('0x26')](function(){return _0x39d5b3;})[_0xa952('0x26')](respondWithResult(_0x1bcaa2,null))['catch'](handleError(_0x1bcaa2,null));};exports[_0xa952('0x91')]=function(_0x3b92f5,_0x28f7f8,_0x4dca70){return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0x3b92f5[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x28f7f8,null))[_0xa952('0x26')](function(_0x4d2faf){if(_0x4d2faf){return _0x4d2faf[_0xa952('0x91')](_0x3b92f5['query']['ids'])[_0xa952('0x26')](function(){if(_[_0xa952('0x95')](_0x3b92f5[_0xa952('0x3d')][_0xa952('0x7f')])){for(var _0x1bdfef=0x0;_0x1bdfef<_0x3b92f5[_0xa952('0x3d')][_0xa952('0x7f')][_0xa952('0x41')];_0x1bdfef+=0x1){socket[_0xa952('0x7b')](_0xa952('0x93'),{'UserId':Number(_0x3b92f5['query'][_0xa952('0x7f')][_0x1bdfef]),'VoiceQueueId':Number(_0x3b92f5['params']['id'])});}}else{socket['emit'](_0xa952('0x93'),{'UserId':Number(_0x3b92f5[_0xa952('0x3d')]['ids']),'VoiceQueueId':Number(_0x3b92f5[_0xa952('0x5a')]['id'])});}});}})[_0xa952('0x26')](function(_0x178bc4){return db[_0xa952('0x92')][_0xa952('0x27')]({'where':{'VoiceQueueId':_0x3b92f5[_0xa952('0x5a')]['id'],'UserId':_0x3b92f5[_0xa952('0x3d')][_0xa952('0x7f')]}})[_0xa952('0x26')](function(){return _0x178bc4;});})['then'](respondWithStatusCode(_0x28f7f8,null))[_0xa952('0x50')](handleError(_0x28f7f8,null));};exports[_0xa952('0x96')]=function(_0x74e84c,_0x5ae532,_0x55c467){var _0x2e79e7={};var _0x2ea4ed={};var _0x32951e;var _0x5c48f1;return db[_0xa952('0x37')][_0xa952('0x60')]({'where':{'id':_0x74e84c[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x5ae532,null))['then'](function(_0x3bf464){if(_0x3bf464){_0x32951e=_0x3bf464;_0x2ea4ed[_0xa952('0x3b')]=_['keys'](db[_0xa952('0x6c')]['rawAttributes']);_0x2ea4ed[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x74e84c[_0xa952('0x3d')]);_0x2ea4ed['filters']=_['intersection'](_0x2ea4ed['model'],_0x2ea4ed['query']);_0x2e79e7['attributes']=_[_0xa952('0x3e')](_0x2ea4ed[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x74e84c[_0xa952('0x3d')][_0xa952('0x40')]));_0x2e79e7[_0xa952('0x3f')]=_0x2e79e7[_0xa952('0x3f')][_0xa952('0x41')]?_0x2e79e7[_0xa952('0x3f')]:_0x2ea4ed[_0xa952('0x3b')];_0x2e79e7['order']=qs[_0xa952('0x45')](_0x74e84c[_0xa952('0x3d')]['sort']);_0x2e79e7[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x74e84c[_0xa952('0x3d')],_0x2ea4ed[_0xa952('0x47')]));if(_0x74e84c[_0xa952('0x3d')][_0xa952('0x2c')]){_0x2e79e7['where']=_['merge'](_0x2e79e7[_0xa952('0x46')],{'$or':_['map'](_0x2e79e7[_0xa952('0x3f')],function(_0x6e0153){var _0x3e10da={};_0x3e10da[_0x6e0153]={'$like':'%'+_0x74e84c[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x3e10da;})});}_0x2e79e7=_['merge']({},_0x2e79e7,_0x74e84c[_0xa952('0x4b')]);return _0x32951e[_0xa952('0x96')](_0x2e79e7);}})[_0xa952('0x26')](function(_0x57e1c0){if(_0x57e1c0){_0x5c48f1=_0x57e1c0[_0xa952('0x41')];if(!_0x74e84c[_0xa952('0x3d')]['hasOwnProperty'](_0xa952('0x65'))){_0x2e79e7[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x74e84c['query'][_0xa952('0x43')]);_0x2e79e7[_0xa952('0x21')]=qs[_0xa952('0x21')](_0x74e84c[_0xa952('0x3d')][_0xa952('0x21')]);}return _0x32951e[_0xa952('0x96')](_0x2e79e7);}})['then'](function(_0x51e574){if(_0x51e574){return _0x51e574?{'count':_0x5c48f1,'rows':_0x51e574}:null;}})['then'](respondWithResult(_0x5ae532,null))[_0xa952('0x50')](handleError(_0x5ae532,null));};exports[_0xa952('0x97')]=function(_0x4e82ad,_0xd7c096,_0xd8b58f){var _0x506623={};var _0x161c43={};var _0x20e39b;var _0xbf51d7;return db[_0xa952('0x37')]['findOne']({'where':{'id':_0x4e82ad['params']['id']}})['then'](handleEntityNotFound(_0xd7c096,null))[_0xa952('0x26')](function(_0x54cda2){if(_0x54cda2){_0x20e39b=_0x54cda2;_0x161c43['model']=_[_0xa952('0x3c')](db[_0xa952('0x92')][_0xa952('0x38')]);_0x161c43[_0xa952('0x3d')]=_['keys'](_0x4e82ad[_0xa952('0x3d')]);_0x161c43[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x161c43[_0xa952('0x3b')],_0x161c43[_0xa952('0x3d')]);_0x506623['attributes']=_[_0xa952('0x3e')](_0x161c43[_0xa952('0x3b')],qs['fields'](_0x4e82ad[_0xa952('0x3d')][_0xa952('0x40')]));_0x506623[_0xa952('0x3f')]=_0x506623[_0xa952('0x3f')]['length']?_0x506623[_0xa952('0x3f')]:_0x161c43['model'];_0x506623[_0xa952('0x44')]=qs['sort'](_0x4e82ad[_0xa952('0x3d')][_0xa952('0x45')]);_0x506623[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x4e82ad[_0xa952('0x3d')],_0x161c43[_0xa952('0x47')]));if(_0x4e82ad[_0xa952('0x3d')][_0xa952('0x2c')]){_0x506623[_0xa952('0x46')]=_[_0xa952('0x49')](_0x506623[_0xa952('0x46')],{'$or':_['map'](_0x506623[_0xa952('0x3f')],function(_0x42417f){var _0x327667={};_0x327667[_0x42417f]={'$like':'%'+_0x4e82ad[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x327667;})});}_0x506623=_[_0xa952('0x49')]({},_0x506623,_0x4e82ad['options']);return _0x20e39b['getMembers'](_0x506623);}})[_0xa952('0x26')](function(_0x4f10f4){if(_0x4f10f4){_0xbf51d7=_0x4f10f4[_0xa952('0x41')];if(!_0x4e82ad[_0xa952('0x3d')][_0xa952('0x42')]('nolimit')){_0x506623[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x4e82ad[_0xa952('0x3d')][_0xa952('0x43')]);_0x506623['offset']=qs[_0xa952('0x21')](_0x4e82ad[_0xa952('0x3d')][_0xa952('0x21')]);}return _0x20e39b['getMembers'](_0x506623);}})[_0xa952('0x26')](function(_0x586c0e){return _0x586c0e?{'count':_0xbf51d7,'rows':_0x586c0e}:null;})[_0xa952('0x26')](respondWithResult(_0xd7c096,null))[_0xa952('0x50')](handleError(_0xd7c096,null));};exports[_0xa952('0x98')]=function(_0x149d33,_0x1de222,_0x46a6fc){var _0x45b7ff={};var _0x3a61dd={};var _0x35fa59;var _0x5df4cc;return db[_0xa952('0x37')]['findOne']({'where':{'id':_0x149d33[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x1de222,null))[_0xa952('0x26')](function(_0x4f2840){if(_0x4f2840){_0x35fa59=_0x4f2840;_0x3a61dd[_0xa952('0x3b')]=_[_0xa952('0x3c')](db[_0xa952('0x99')][_0xa952('0x38')]);_0x3a61dd[_0xa952('0x3d')]=_['keys'](_0x149d33[_0xa952('0x3d')]);_0x3a61dd['filters']=_[_0xa952('0x3e')](_0x3a61dd[_0xa952('0x3b')],_0x3a61dd[_0xa952('0x3d')]);_0x45b7ff[_0xa952('0x3f')]=_[_0xa952('0x3e')](_0x3a61dd[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x149d33[_0xa952('0x3d')][_0xa952('0x40')]));_0x45b7ff['attributes']=_0x45b7ff[_0xa952('0x3f')][_0xa952('0x41')]?_0x45b7ff[_0xa952('0x3f')]:_0x3a61dd[_0xa952('0x3b')];_0x45b7ff['order']=qs[_0xa952('0x45')](_0x149d33[_0xa952('0x3d')][_0xa952('0x45')]);_0x45b7ff[_0xa952('0x46')]=qs[_0xa952('0x47')](_['pick'](_0x149d33[_0xa952('0x3d')],_0x3a61dd[_0xa952('0x47')]));if(_0x149d33[_0xa952('0x3d')][_0xa952('0x2c')]){_0x45b7ff['where']=_[_0xa952('0x49')](_0x45b7ff['where'],{'$or':_[_0xa952('0x36')](_0x45b7ff[_0xa952('0x3f')],function(_0xe20124){var _0x1ef9b8={};_0x1ef9b8[_0xe20124]={'$like':'%'+_0x149d33[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x1ef9b8;})});}_0x45b7ff=_[_0xa952('0x49')]({},_0x45b7ff,_0x149d33[_0xa952('0x4b')]);return _0x35fa59[_0xa952('0x98')](_0x45b7ff);}})[_0xa952('0x26')](function(_0x3eda4d){if(_0x3eda4d){_0x5df4cc=_0x3eda4d['length'];if(!_0x149d33[_0xa952('0x3d')][_0xa952('0x42')](_0xa952('0x65'))){_0x45b7ff['limit']=qs[_0xa952('0x43')](_0x149d33[_0xa952('0x3d')][_0xa952('0x43')]);_0x45b7ff['offset']=qs[_0xa952('0x21')](_0x149d33[_0xa952('0x3d')]['offset']);}return _0x35fa59[_0xa952('0x98')](_0x45b7ff);}})[_0xa952('0x26')](function(_0x278268){if(_0x278268){return _0x278268?{'count':_0x5df4cc,'rows':_0x278268}:null;}})[_0xa952('0x26')](respondWithResult(_0x1de222,null))[_0xa952('0x50')](handleError(_0x1de222,null));};exports[_0xa952('0x9a')]=function(_0x48753a,_0x54f78f,_0x598eda){var _0x49957c,_0x50470c;return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0x48753a[_0xa952('0x5a')]['id']}})['then'](handleEntityNotFound(_0x54f78f,null))[_0xa952('0x26')](function(_0x177ef6){if(_0x177ef6){_0x50470c=_0x177ef6;return _0x177ef6[_0xa952('0x9a')](_0x48753a[_0xa952('0x5c')][_0xa952('0x7f')],_[_0xa952('0x5b')](_0x48753a[_0xa952('0x5c')],[_0xa952('0x7f'),'id'])||{});}return null;})[_0xa952('0x9b')](function(_0x5e6be1){var _0x12eb7f;_0x49957c=_0x5e6be1||[];var _0x478b0a=[];if(_0x5e6be1){for(var _0x1f1aaf=0x0;_0x1f1aaf<_0x5e6be1[_0xa952('0x41')];_0x1f1aaf+=0x1){var _0x2ad0cc=_0x5e6be1[_0x1f1aaf]['get']({'plain':!![]});_0x50470c['dialCheckDuplicateType']=_0x48753a[_0xa952('0x5c')]['dialCheckDuplicateType']?_0x48753a['body']['dialCheckDuplicateType']:_0x50470c[_0xa952('0x9c')];switch(_0x50470c[_0xa952('0x9c')]){case'always':_0x12eb7f=squel['insert']()[_0xa952('0x9d')](_0xa952('0x9e'))[_0xa952('0x9f')]([_0xa952('0xa0'),_0xa952('0xa1'),_0xa952('0xa2'),_0xa952('0xa3'),_0xa952('0x62'),'createdAt',_0xa952('0x5e')],squel[_0xa952('0x80')]()[_0xa952('0x81')](_0xa952('0xa0'),_0xa952('0xa0'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0xa1'))[_0xa952('0x81')]('id','ContactId')['field'](_0x2ad0cc[_0xa952('0xa5')]['toString'](),'ListId')['field'](_0x48753a[_0xa952('0x5a')]['id'][_0xa952('0xa6')](),'VoiceQueueId')[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5d'))[_0xa952('0x81')](_0xa952('0xa4'),'updatedAt')[_0xa952('0x83')]('cm_contacts')[_0xa952('0x46')]('deletedAt\x20IS\x20NULL')[_0xa952('0x46')](_0xa952('0xa7'),_0x2ad0cc[_0xa952('0xa5')][_0xa952('0xa6')]())[_0xa952('0x46')](_0xa952('0xa8'))[_0xa952('0x46')](_0xa952('0xa9'),squel[_0xa952('0x80')]()['field'](_0xa952('0xaa'))[_0xa952('0x83')](_0xa952('0xab'))[_0xa952('0x46')](_0xa952('0xac'),_0x48753a[_0xa952('0x5a')]['id'][_0xa952('0xa6')]()))[_0xa952('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa952('0x80')]()['field'](_0xa952('0xad'))[_0xa952('0x83')]('cm_hopper')[_0xa952('0x46')](_0xa952('0xac'),_0x48753a['params']['id'][_0xa952('0xa6')]())))[_0xa952('0xa6')]();break;case _0xa952('0xae'):_0x12eb7f=squel['insert']()[_0xa952('0x9d')](_0xa952('0x9e'))[_0xa952('0x9f')]([_0xa952('0xa0'),_0xa952('0xa1'),_0xa952('0xa2'),_0xa952('0xa3'),_0xa952('0x62'),'createdAt',_0xa952('0x5e')],squel[_0xa952('0x80')]()[_0xa952('0x81')](_0xa952('0xa0'),'phone')['field']('NOW()',_0xa952('0xa1'))['field']('id','ContactId')['field'](_0x2ad0cc['CmListId'][_0xa952('0xa6')](),_0xa952('0xa3'))[_0xa952('0x81')](_0x48753a[_0xa952('0x5a')]['id'][_0xa952('0xa6')](),_0xa952('0x62'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5d'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5e'))[_0xa952('0x83')](_0xa952('0xaf'))[_0xa952('0x46')]('deletedAt\x20IS\x20NULL')['where'](_0xa952('0xa7'),_0x2ad0cc[_0xa952('0xa5')][_0xa952('0xa6')]())[_0xa952('0x46')](_0xa952('0xa8'))[_0xa952('0x46')](_0xa952('0xa9'),squel[_0xa952('0x80')]()[_0xa952('0x81')](_0xa952('0xad'))[_0xa952('0x83')](_0xa952('0x9e'))[_0xa952('0x46')](_0xa952('0xac'),_0x48753a['params']['id'][_0xa952('0xa6')]())))[_0xa952('0xa6')]();break;default:_0x12eb7f=squel[_0xa952('0xb0')]()[_0xa952('0x9d')](_0xa952('0x9e'))[_0xa952('0x9f')]([_0xa952('0xa0'),_0xa952('0xa1'),_0xa952('0xa2'),_0xa952('0xa3'),_0xa952('0x62'),'createdAt','updatedAt'],squel['select']()[_0xa952('0x81')](_0xa952('0xa0'),_0xa952('0xa0'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0xa1'))[_0xa952('0x81')]('id',_0xa952('0xa2'))[_0xa952('0x81')](_0x2ad0cc[_0xa952('0xa5')][_0xa952('0xa6')](),'ListId')[_0xa952('0x81')](_0x48753a[_0xa952('0x5a')]['id']['toString'](),'VoiceQueueId')[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5d'))[_0xa952('0x81')]('NOW()',_0xa952('0x5e'))['from'](_0xa952('0xaf'))[_0xa952('0x46')](_0xa952('0xb1'))[_0xa952('0x46')]('ListId\x20=\x20?',_0x2ad0cc[_0xa952('0xa5')][_0xa952('0xa6')]())['where'](_0xa952('0xa8')))[_0xa952('0xa6')]();}_0x478b0a[_0xa952('0x88')](db[_0xa952('0x71')][_0xa952('0x3d')](_0x12eb7f));}return BPromise[_0xa952('0x8e')](_0x478b0a);}})['then'](function(){return _0x49957c;})[_0xa952('0x26')](respondWithResult(_0x54f78f,null))[_0xa952('0x50')](handleError(_0x54f78f,null));};exports[_0xa952('0xb2')]=function(_0x2013db,_0x5725aa,_0x4fdd59){return db[_0xa952('0x37')]['find']({'where':{'id':_0x2013db['params']['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x5725aa,null))[_0xa952('0x26')](function(_0x5afe8d){if(_0x5afe8d){return _0x5afe8d[_0xa952('0xb2')](_0x2013db['query']['ids']);}})[_0xa952('0x26')](function(_0x182a90){if(_0x182a90){return db[_0xa952('0x61')][_0xa952('0x27')]({'where':{'ListId':_0x2013db[_0xa952('0x3d')][_0xa952('0x7f')],'VoiceQueueId':_0x2013db[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](function(){return _0x182a90;});}})[_0xa952('0x26')](respondWithStatusCode(_0x5725aa,null))['catch'](handleError(_0x5725aa,null));};exports[_0xa952('0xb3')]=function(_0x593b8f,_0x1cee33,_0x2a263a){var _0x25bf9c={};var _0x30820b={};var _0x3421e9;var _0x2038b3;return db['VoiceQueue'][_0xa952('0x60')]({'where':{'id':_0x593b8f[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x1cee33,null))['then'](function(_0x41d7d2){if(_0x41d7d2){_0x3421e9=_0x41d7d2;_0x30820b[_0xa952('0x3b')]=_[_0xa952('0x3c')](db['CmList']['rawAttributes']);_0x30820b[_0xa952('0x3d')]=_[_0xa952('0x3c')](_0x593b8f[_0xa952('0x3d')]);_0x30820b[_0xa952('0x47')]=_[_0xa952('0x3e')](_0x30820b[_0xa952('0x3b')],_0x30820b['query']);_0x25bf9c['attributes']=_[_0xa952('0x3e')](_0x30820b[_0xa952('0x3b')],qs[_0xa952('0x40')](_0x593b8f[_0xa952('0x3d')][_0xa952('0x40')]));_0x25bf9c[_0xa952('0x3f')]=_0x25bf9c[_0xa952('0x3f')]['length']?_0x25bf9c['attributes']:_0x30820b[_0xa952('0x3b')];_0x25bf9c['order']=qs[_0xa952('0x45')](_0x593b8f[_0xa952('0x3d')][_0xa952('0x45')]);_0x25bf9c[_0xa952('0x46')]=qs[_0xa952('0x47')](_[_0xa952('0x48')](_0x593b8f[_0xa952('0x3d')],_0x30820b['filters']));if(_0x593b8f[_0xa952('0x3d')]['filter']){_0x25bf9c[_0xa952('0x46')]=_[_0xa952('0x49')](_0x25bf9c[_0xa952('0x46')],{'$or':_[_0xa952('0x36')](_0x25bf9c[_0xa952('0x3f')],function(_0x56131b){var _0x533804={};_0x533804[_0x56131b]={'$like':'%'+_0x593b8f[_0xa952('0x3d')][_0xa952('0x2c')]+'%'};return _0x533804;})});}_0x25bf9c=_['merge']({},_0x25bf9c,_0x593b8f['options']);return _0x3421e9['getBlackLists'](_0x25bf9c);}})[_0xa952('0x26')](function(_0x296447){if(_0x296447){_0x2038b3=_0x296447[_0xa952('0x41')];if(!_0x593b8f['query'][_0xa952('0x42')](_0xa952('0x65'))){_0x25bf9c[_0xa952('0x43')]=qs[_0xa952('0x43')](_0x593b8f[_0xa952('0x3d')][_0xa952('0x43')]);_0x25bf9c[_0xa952('0x21')]=qs['offset'](_0x593b8f[_0xa952('0x3d')]['offset']);}return _0x3421e9[_0xa952('0xb3')](_0x25bf9c);}})[_0xa952('0x26')](function(_0x3ab336){if(_0x3ab336){return _0x3ab336?{'count':_0x2038b3,'rows':_0x3ab336}:null;}})[_0xa952('0x26')](respondWithResult(_0x1cee33,null))[_0xa952('0x50')](handleError(_0x1cee33,null));};exports[_0xa952('0xb4')]=function(_0x28423d,_0x540b29,_0x57e1b8){var _0x2083a1,_0x402e8a;return db[_0xa952('0x37')][_0xa952('0x30')]({'where':{'id':_0x28423d[_0xa952('0x5a')]['id']}})[_0xa952('0x26')](handleEntityNotFound(_0x540b29,null))['then'](function(_0x226afa){if(_0x226afa){_0x402e8a=_0x226afa;return _0x226afa['addBlackLists'](_0x28423d['body'][_0xa952('0x7f')],_[_0xa952('0x5b')](_0x28423d[_0xa952('0x5c')],[_0xa952('0x7f'),'id'])||{});}return null;})['spread'](function(_0x17f8b1){var _0x2fb4a1;_0x2083a1=_0x17f8b1||[];var _0x244d62=[];if(_0x17f8b1){for(var _0x396cbe=0x0;_0x396cbe<_0x17f8b1['length'];_0x396cbe+=0x1){var _0x44da69=_0x17f8b1[_0x396cbe][_0xa952('0x28')]({'plain':!![]});_0x2fb4a1=squel[_0xa952('0xb0')]()[_0xa952('0x9d')](_0xa952('0xb5'))[_0xa952('0x9f')]([_0xa952('0xa0'),'ContactId',_0xa952('0xa3'),_0xa952('0x62'),_0xa952('0x5d'),'updatedAt'],squel[_0xa952('0x80')]()[_0xa952('0x81')](_0xa952('0xa0'),_0xa952('0xa0'))['field']('id',_0xa952('0xa2'))[_0xa952('0x81')](_0x44da69[_0xa952('0xa5')][_0xa952('0xa6')](),_0xa952('0xa3'))[_0xa952('0x81')](_0x28423d[_0xa952('0x5a')]['id'][_0xa952('0xa6')](),_0xa952('0x62'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5d'))[_0xa952('0x81')](_0xa952('0xa4'),_0xa952('0x5e'))[_0xa952('0x83')](_0xa952('0xaf'))[_0xa952('0x46')]('deletedAt\x20IS\x20NULL')[_0xa952('0x46')](_0xa952('0xa7'),_0x44da69[_0xa952('0xa5')][_0xa952('0xa6')]())[_0xa952('0x46')]('phone\x20IS\x20NOT\x20NULL'))[_0xa952('0xa6')]();_0x244d62['push'](db[_0xa952('0x71')][_0xa952('0x3d')](_0x2fb4a1));}return BPromise[_0xa952('0x8e')](_0x244d62);}})[_0xa952('0x26')](function(){return _0x2083a1;})[_0xa952('0x26')](respondWithResult(_0x540b29,null))[_0xa952('0x50')](handleError(_0x540b29,null));};exports[_0xa952('0xb6')]=function(_0x41be0c,_0x54bcc8,_0x262152){return db[_0xa952('0x37')]['find']({'where':{'id':_0x41be0c['params']['id']}})['then'](handleEntityNotFound(_0x54bcc8,null))['then'](function(_0x32a940){if(_0x32a940){return _0x32a940['removeBlackLists'](_0x41be0c['query'][_0xa952('0x7f')]);}})[_0xa952('0x26')](function(_0x2857d8){if(_0x2857d8){return db[_0xa952('0x69')][_0xa952('0x27')]({'where':{'ListId':_0x41be0c[_0xa952('0x3d')][_0xa952('0x7f')],'VoiceQueueId':_0x41be0c['params']['id']}})[_0xa952('0x26')](function(){return _0x2857d8;});}})['then'](respondWithStatusCode(_0x54bcc8,null))[_0xa952('0x50')](handleError(_0x54bcc8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 859ff2e..2288b2f 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 _0xfb5f=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x51eec3,_0x300e47){var _0x47181a=function(_0x3f4850){while(--_0x3f4850){_0x51eec3['push'](_0x51eec3['shift']());}};_0x47181a(++_0x300e47);}(_0xfb5f,0x1be));var _0xffb5=function(_0x1672b3,_0x4d3196){_0x1672b3=_0x1672b3-0x0;var _0x5cf5cd=_0xfb5f[_0x1672b3];return _0x5cf5cd;};'use strict';var EventEmitter=require(_0xffb5('0x0'));var VoiceQueue=require(_0xffb5('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xffb5('0x2')](0x0);var events={'afterCreate':_0xffb5('0x3'),'afterUpdate':_0xffb5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15ed1a){return function(_0x223387,_0x3b73db,_0x2b8d17){VoiceQueueEvents[_0xffb5('0x5')](_0x15ed1a+':'+_0x223387['id'],_0x223387);VoiceQueueEvents[_0xffb5('0x5')](_0x15ed1a,_0x223387);_0x2b8d17(null);};}for(var e in events){if(events[_0xffb5('0x6')](e)){var event=events[e];VoiceQueue[_0xffb5('0x7')](e,emitEvent(event));}}module[_0xffb5('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x2613=['emit','hasOwnProperty','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x1876c7,_0x379202){var _0x2b9572=function(_0x9bf2ff){while(--_0x9bf2ff){_0x1876c7['push'](_0x1876c7['shift']());}};_0x2b9572(++_0x379202);}(_0x2613,0x1bb));var _0x3261=function(_0x3ce8b2,_0x141823){_0x3ce8b2=_0x3ce8b2-0x0;var _0x41de55=_0x2613[_0x3ce8b2];return _0x41de55;};'use strict';var EventEmitter=require(_0x3261('0x0'));var VoiceQueue=require(_0x3261('0x1'))['db'][_0x3261('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3261('0x3')](0x0);var events={'afterCreate':_0x3261('0x4'),'afterUpdate':_0x3261('0x5'),'afterDestroy':_0x3261('0x6')};function emitEvent(_0x556663){return function(_0x339296,_0x146bb7,_0x2237a9){VoiceQueueEvents[_0x3261('0x7')](_0x556663+':'+_0x339296['id'],_0x339296);VoiceQueueEvents['emit'](_0x556663,_0x339296);_0x2237a9(null);};}for(var e in events){if(events[_0x3261('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5bcb7d8..82453d2 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 _0xc960=['bluebird','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','../../config/logger','api'];(function(_0x44c89b,_0x5bfb9c){var _0x2545f7=function(_0x1deab9){while(--_0x1deab9){_0x44c89b['push'](_0x44c89b['shift']());}};_0x2545f7(++_0x5bfb9c);}(_0xc960,0x1ec));var _0x0c96=function(_0x2488fa,_0x13609c){_0x2488fa=_0x2488fa-0x0;var _0x41694c=_0xc960[_0x2488fa];return _0x41694c;};'use strict';var _=require(_0x0c96('0x0'));var util=require('util');var logger=require(_0x0c96('0x1'))(_0x0c96('0x2'));var moment=require('moment');var BPromise=require(_0x0c96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c96('0x4'));var rimraf=require(_0x0c96('0x5'));var config=require(_0x0c96('0x6'));var attributes=require(_0x0c96('0x7'));module[_0x0c96('0x8')]=function(_0x284636,_0x246679){return _0x284636[_0x0c96('0x9')](_0x0c96('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3e8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueue','voice_queues'];(function(_0xba9491,_0xe8766d){var _0x3796ba=function(_0x3b3a40){while(--_0x3b3a40){_0xba9491['push'](_0xba9491['shift']());}};_0x3796ba(++_0xe8766d);}(_0xb3e8,0x16c));var _0x8b3e=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0xb3e8[_0x5c4e16];return _0x36044a;};'use strict';var _=require(_0x8b3e('0x0'));var util=require(_0x8b3e('0x1'));var logger=require(_0x8b3e('0x2'))(_0x8b3e('0x3'));var moment=require(_0x8b3e('0x4'));var BPromise=require(_0x8b3e('0x5'));var rp=require(_0x8b3e('0x6'));var fs=require('fs');var path=require(_0x8b3e('0x7'));var rimraf=require(_0x8b3e('0x8'));var config=require(_0x8b3e('0x9'));var attributes=require('./voiceQueue.attributes');module[_0x8b3e('0xa')]=function(_0x302893,_0x403a41){return _0x302893[_0x8b3e('0xb')](_0x8b3e('0xc'),attributes,{'tableName':_0x8b3e('0xd'),'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 87e5bd6..787796e 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 _0x6263=['code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','then','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3465e1,_0x2995a6){var _0x563dcb=function(_0xacce59){while(--_0xacce59){_0x3465e1['push'](_0x3465e1['shift']());}};_0x563dcb(++_0x2995a6);}(_0x6263,0x100));var _0x3626=function(_0xac4dd4,_0x41ac92){_0xac4dd4=_0xac4dd4-0x0;var _0x35b182=_0x6263[_0xac4dd4];return _0x35b182;};'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(_0x3626('0x5'));var db=require(_0x3626('0x6'))['db'];var utils=require(_0x3626('0x7'));var logger=require(_0x3626('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3626('0x9'));var client=jayson[_0x3626('0xa')]['http']({'port':0x232a});config[_0x3626('0xb')]=_[_0x3626('0xc')](config[_0x3626('0xb')],{'host':_0x3626('0xd'),'port':0x18eb});var socket=require(_0x3626('0xe'))(new Redis(config[_0x3626('0xb')]));require(_0x3626('0xf'))['register'](socket);function respondWithRpcPromise(_0x3e2f1e,_0x4534be,_0x2a805c){return new BPromise(function(_0x24035d,_0x5ab006){return client[_0x3626('0x10')](_0x3e2f1e,_0x2a805c)['then'](function(_0x5654b7){logger[_0x3626('0x11')](_0x3626('0x12'),_0x4534be,_0x3626('0x13'));logger[_0x3626('0x14')](_0x3626('0x15'),_0x4534be,_0x3626('0x13'),JSON[_0x3626('0x16')](_0x5654b7));if(_0x5654b7[_0x3626('0x17')]){if(_0x5654b7['error'][_0x3626('0x18')]===0x1f4){logger[_0x3626('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x4534be,_0x5654b7[_0x3626('0x17')]['message']);return _0x5ab006(_0x5654b7['error'][_0x3626('0x19')]);}logger[_0x3626('0x17')](_0x3626('0x12'),_0x4534be,_0x5654b7[_0x3626('0x17')][_0x3626('0x19')]);return _0x24035d(_0x5654b7['error']['message']);}else{logger[_0x3626('0x11')](_0x3626('0x12'),_0x4534be,_0x3626('0x13'));_0x24035d(_0x5654b7['result'][_0x3626('0x19')]);}})[_0x3626('0x1a')](function(_0x185c3d){logger[_0x3626('0x17')](_0x3626('0x12'),_0x4534be,_0x185c3d);_0x5ab006(_0x185c3d);});});}exports[_0x3626('0x1b')]=function(_0x852e6a){var _0x1c31f7=this;return new Promise(function(_0x457b3b,_0x3ebd19){return db[_0x3626('0x1c')][_0x3626('0x1d')]({'raw':_0x852e6a[_0x3626('0x1e')]?_0x852e6a[_0x3626('0x1e')][_0x3626('0x1f')]===undefined?!![]:![]:!![],'where':_0x852e6a[_0x3626('0x1e')]?_0x852e6a[_0x3626('0x1e')][_0x3626('0x20')]||null:null,'attributes':_0x852e6a[_0x3626('0x1e')]?_0x852e6a['options'][_0x3626('0x21')]||null:null,'limit':_0x852e6a[_0x3626('0x1e')]?_0x852e6a[_0x3626('0x1e')]['limit']||null:null,'include':_0x852e6a[_0x3626('0x1e')]?_0x852e6a[_0x3626('0x1e')][_0x3626('0x22')]?_[_0x3626('0x23')](_0x852e6a[_0x3626('0x1e')][_0x3626('0x22')],function(_0x2caef8){return{'model':db[_0x2caef8['model']],'as':_0x2caef8['as'],'attributes':_0x2caef8['attributes'],'include':_0x2caef8[_0x3626('0x22')]?_[_0x3626('0x23')](_0x2caef8[_0x3626('0x22')],function(_0x22ddd8){return{'model':db[_0x22ddd8[_0x3626('0x24')]],'as':_0x22ddd8['as'],'attributes':_0x22ddd8[_0x3626('0x21')],'include':_0x22ddd8['include']?_[_0x3626('0x23')](_0x22ddd8[_0x3626('0x22')],function(_0x199887){return{'model':db[_0x199887['model']],'as':_0x199887['as'],'attributes':_0x199887[_0x3626('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3626('0x25')](function(_0x7d4225){logger[_0x3626('0x11')](_0x3626('0x1b'),_0x852e6a);logger[_0x3626('0x14')](_0x3626('0x1b'),_0x852e6a,JSON[_0x3626('0x16')](_0x7d4225));_0x457b3b(_0x7d4225);})[_0x3626('0x1a')](function(_0x4833a4){logger[_0x3626('0x17')](_0x3626('0x1b'),_0x4833a4[_0x3626('0x19')],_0x852e6a);_0x3ebd19(_0x1c31f7[_0x3626('0x17')](0x1f4,_0x4833a4[_0x3626('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x391c98){var _0x3659d5=this;return new Promise(function(_0x34d0e6,_0x32a248){return db[_0x3626('0x1c')][_0x3626('0x26')]({'raw':_0x391c98[_0x3626('0x1e')]?_0x391c98[_0x3626('0x1e')][_0x3626('0x1f')]===undefined?!![]:![]:!![],'where':_0x391c98[_0x3626('0x1e')]?_0x391c98[_0x3626('0x1e')][_0x3626('0x20')]||null:null,'attributes':_0x391c98['options']?_0x391c98[_0x3626('0x1e')]['attributes']||null:null,'include':_0x391c98[_0x3626('0x1e')]?_0x391c98[_0x3626('0x1e')]['include']?_[_0x3626('0x23')](_0x391c98['options']['include'],function(_0xbb2720){return{'model':db[_0xbb2720[_0x3626('0x24')]],'as':_0xbb2720['as'],'attributes':_0xbb2720[_0x3626('0x21')],'include':_0xbb2720[_0x3626('0x22')]?_['map'](_0xbb2720[_0x3626('0x22')],function(_0x6bad27){return{'model':db[_0x6bad27[_0x3626('0x24')]],'as':_0x6bad27['as'],'attributes':_0x6bad27[_0x3626('0x21')],'include':_0x6bad27[_0x3626('0x22')]?_[_0x3626('0x23')](_0x6bad27[_0x3626('0x22')],function(_0x279641){return{'model':db[_0x279641['model']],'as':_0x279641['as'],'attributes':_0x279641['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a010e){logger[_0x3626('0x11')](_0x3626('0x27'),_0x391c98);logger['debug'](_0x3626('0x27'),_0x391c98,JSON[_0x3626('0x16')](_0x2a010e));_0x34d0e6(_0x2a010e);})[_0x3626('0x1a')](function(_0x28498c){logger['error'](_0x3626('0x27'),_0x28498c['message'],_0x391c98);_0x32a248(_0x3659d5[_0x3626('0x17')](0x1f4,_0x28498c[_0x3626('0x19')]));});});}; \ No newline at end of file +var _0xfe09=['VoiceQueue','find','where','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','then','info','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','catch','GetVoiceQueue','options','raw','attributes','map','include','model','ShowVoiceQueue'];(function(_0xb1b08c,_0x1961a6){var _0x608518=function(_0x405997){while(--_0x405997){_0xb1b08c['push'](_0xb1b08c['shift']());}};_0x608518(++_0x1961a6);}(_0xfe09,0x175));var _0x9fe0=function(_0x3f35e5,_0xab3b92){_0x3f35e5=_0x3f35e5-0x0;var _0x23d6e1=_0xfe09[_0x3f35e5];return _0x23d6e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9fe0('0x0'));var BPromise=require(_0x9fe0('0x1'));var rs=require(_0x9fe0('0x2'));var fs=require('fs');var Redis=require(_0x9fe0('0x3'));var db=require(_0x9fe0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fe0('0x5'));var config=require(_0x9fe0('0x6'));var jayson=require(_0x9fe0('0x7'));var client=jayson[_0x9fe0('0x8')][_0x9fe0('0x9')]({'port':0x232a});config[_0x9fe0('0xa')]=_[_0x9fe0('0xb')](config[_0x9fe0('0xa')],{'host':_0x9fe0('0xc'),'port':0x18eb});var socket=require(_0x9fe0('0xd'))(new Redis(config[_0x9fe0('0xa')]));require(_0x9fe0('0xe'))['register'](socket);function respondWithRpcPromise(_0x1de787,_0x144622,_0x310a58){return new BPromise(function(_0x5c9edb,_0x2d9b92){return client['request'](_0x1de787,_0x310a58)[_0x9fe0('0xf')](function(_0x4acf95){logger[_0x9fe0('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x144622,'request\x20sent');logger[_0x9fe0('0x11')](_0x9fe0('0x12'),_0x144622,_0x9fe0('0x13'),JSON[_0x9fe0('0x14')](_0x4acf95));if(_0x4acf95[_0x9fe0('0x15')]){if(_0x4acf95[_0x9fe0('0x15')][_0x9fe0('0x16')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x144622,_0x4acf95[_0x9fe0('0x15')][_0x9fe0('0x17')]);return _0x2d9b92(_0x4acf95[_0x9fe0('0x15')][_0x9fe0('0x17')]);}logger[_0x9fe0('0x15')](_0x9fe0('0x18'),_0x144622,_0x4acf95['error']['message']);return _0x5c9edb(_0x4acf95[_0x9fe0('0x15')]['message']);}else{logger[_0x9fe0('0x10')](_0x9fe0('0x18'),_0x144622,_0x9fe0('0x13'));_0x5c9edb(_0x4acf95['result'][_0x9fe0('0x17')]);}})[_0x9fe0('0x19')](function(_0xc6449e){logger['error'](_0x9fe0('0x18'),_0x144622,_0xc6449e);_0x2d9b92(_0xc6449e);});});}exports[_0x9fe0('0x1a')]=function(_0x391569){var _0x1aec7d=this;return new Promise(function(_0x440303,_0x4b2473){return db['VoiceQueue']['findAll']({'raw':_0x391569[_0x9fe0('0x1b')]?_0x391569[_0x9fe0('0x1b')][_0x9fe0('0x1c')]===undefined?!![]:![]:!![],'where':_0x391569[_0x9fe0('0x1b')]?_0x391569[_0x9fe0('0x1b')]['where']||null:null,'attributes':_0x391569['options']?_0x391569[_0x9fe0('0x1b')][_0x9fe0('0x1d')]||null:null,'limit':_0x391569['options']?_0x391569['options']['limit']||null:null,'include':_0x391569['options']?_0x391569['options']['include']?_[_0x9fe0('0x1e')](_0x391569['options'][_0x9fe0('0x1f')],function(_0x1c0e66){return{'model':db[_0x1c0e66['model']],'as':_0x1c0e66['as'],'attributes':_0x1c0e66[_0x9fe0('0x1d')],'include':_0x1c0e66['include']?_['map'](_0x1c0e66[_0x9fe0('0x1f')],function(_0xa816a4){return{'model':db[_0xa816a4[_0x9fe0('0x20')]],'as':_0xa816a4['as'],'attributes':_0xa816a4[_0x9fe0('0x1d')],'include':_0xa816a4['include']?_[_0x9fe0('0x1e')](_0xa816a4[_0x9fe0('0x1f')],function(_0x1e8d22){return{'model':db[_0x1e8d22['model']],'as':_0x1e8d22['as'],'attributes':_0x1e8d22[_0x9fe0('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41bab7){logger[_0x9fe0('0x10')](_0x9fe0('0x1a'),_0x391569);logger[_0x9fe0('0x11')](_0x9fe0('0x1a'),_0x391569,JSON[_0x9fe0('0x14')](_0x41bab7));_0x440303(_0x41bab7);})[_0x9fe0('0x19')](function(_0x2e3fcf){logger[_0x9fe0('0x15')](_0x9fe0('0x1a'),_0x2e3fcf[_0x9fe0('0x17')],_0x391569);_0x4b2473(_0x1aec7d['error'](0x1f4,_0x2e3fcf[_0x9fe0('0x17')]));});});};exports[_0x9fe0('0x21')]=function(_0x352057){var _0x2e36f9=this;return new Promise(function(_0x26df9c,_0x224b82){return db[_0x9fe0('0x22')][_0x9fe0('0x23')]({'raw':_0x352057['options']?_0x352057[_0x9fe0('0x1b')][_0x9fe0('0x1c')]===undefined?!![]:![]:!![],'where':_0x352057['options']?_0x352057[_0x9fe0('0x1b')][_0x9fe0('0x24')]||null:null,'attributes':_0x352057[_0x9fe0('0x1b')]?_0x352057[_0x9fe0('0x1b')]['attributes']||null:null,'include':_0x352057['options']?_0x352057[_0x9fe0('0x1b')][_0x9fe0('0x1f')]?_[_0x9fe0('0x1e')](_0x352057['options']['include'],function(_0x48b080){return{'model':db[_0x48b080[_0x9fe0('0x20')]],'as':_0x48b080['as'],'attributes':_0x48b080[_0x9fe0('0x1d')],'include':_0x48b080['include']?_[_0x9fe0('0x1e')](_0x48b080[_0x9fe0('0x1f')],function(_0xcb2339){return{'model':db[_0xcb2339[_0x9fe0('0x20')]],'as':_0xcb2339['as'],'attributes':_0xcb2339['attributes'],'include':_0xcb2339['include']?_[_0x9fe0('0x1e')](_0xcb2339[_0x9fe0('0x1f')],function(_0x349b5b){return{'model':db[_0x349b5b[_0x9fe0('0x20')]],'as':_0x349b5b['as'],'attributes':_0x349b5b[_0x9fe0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9fe0('0xf')](function(_0x17e30e){logger[_0x9fe0('0x10')]('ShowVoiceQueue',_0x352057);logger[_0x9fe0('0x11')](_0x9fe0('0x21'),_0x352057,JSON['stringify'](_0x17e30e));_0x26df9c(_0x17e30e);})[_0x9fe0('0x19')](function(_0x3c3698){logger[_0x9fe0('0x15')](_0x9fe0('0x21'),_0x3c3698[_0x9fe0('0x17')],_0x352057);_0x224b82(_0x2e36f9[_0x9fe0('0x15')](0x1f4,_0x3c3698['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index caf0b32..15b06d5 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 _0x3d09=['./voiceQueue.events','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x4bd5a2,_0x3fbefa){var _0x1a86fe=function(_0x56fb30){while(--_0x56fb30){_0x4bd5a2['push'](_0x4bd5a2['shift']());}};_0x1a86fe(++_0x3fbefa);}(_0x3d09,0x8c));var _0x93d0=function(_0x78e79e,_0x4caed2){_0x78e79e=_0x78e79e-0x0;var _0x209be9=_0x3d09[_0x78e79e];return _0x209be9;};'use strict';var VoiceQueueEvents=require(_0x93d0('0x0'));var events=['save',_0x93d0('0x1'),'update'];function createListener(_0x56512a,_0x172b0e){return function(_0x17d1cf){_0x172b0e[_0x93d0('0x2')](_0x56512a,_0x17d1cf);};}function removeListener(_0x296422,_0x14a206){return function(){VoiceQueueEvents[_0x93d0('0x3')](_0x296422,_0x14a206);};}exports[_0x93d0('0x4')]=function(_0x4707bb){for(var _0x562278=0x0,_0x5e68f2=events[_0x93d0('0x5')];_0x562278<_0x5e68f2;_0x562278++){var _0xd9caea=events[_0x562278];var _0x5998e5=createListener(_0x93d0('0x6')+_0xd9caea,_0x4707bb);VoiceQueueEvents['on'](_0xd9caea,_0x5998e5);}}; \ No newline at end of file +var _0x38e8=['./voiceQueue.events','remove','update','removeListener','register','voiceQueue:'];(function(_0x251ecb,_0x1d4ac4){var _0x1c0983=function(_0x442e23){while(--_0x442e23){_0x251ecb['push'](_0x251ecb['shift']());}};_0x1c0983(++_0x1d4ac4);}(_0x38e8,0x11a));var _0x838e=function(_0x4e8815,_0x586a3a){_0x4e8815=_0x4e8815-0x0;var _0x116e63=_0x38e8[_0x4e8815];return _0x116e63;};'use strict';var VoiceQueueEvents=require(_0x838e('0x0'));var events=['save',_0x838e('0x1'),_0x838e('0x2')];function createListener(_0x1ce10e,_0x166afd){return function(_0x111746){_0x166afd['emit'](_0x1ce10e,_0x111746);};}function removeListener(_0x4861d4,_0x3c0a39){return function(){VoiceQueueEvents[_0x838e('0x3')](_0x4861d4,_0x3c0a39);};}exports[_0x838e('0x4')]=function(_0x3b9c5c){for(var _0x4c93e1=0x0,_0x3d5045=events['length'];_0x4c93e1<_0x3d5045;_0x4c93e1++){var _0x164d2a=events[_0x4c93e1];var _0x25d2f2=createListener(_0x838e('0x5')+_0x164d2a,_0x3b9c5c);VoiceQueueEvents['on'](_0x164d2a,_0x25d2f2);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index eb6f2b8..ff4d9c6 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 _0x0eeb=['connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','create','update','delete','destroy','multer','util','path'];(function(_0x5d0988,_0xef5cb6){var _0x4bd15c=function(_0x1ad73a){while(--_0x1ad73a){_0x5d0988['push'](_0x5d0988['shift']());}};_0x4bd15c(++_0xef5cb6);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0eeb[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var path=require(_0xb0ee('0x2'));var timeout=require(_0xb0ee('0x3'));var express=require(_0xb0ee('0x4'));var router=express[_0xb0ee('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb0ee('0x6'));var controller=require(_0xb0ee('0x7'));router[_0xb0ee('0x8')]('/',auth[_0xb0ee('0x9')](),controller[_0xb0ee('0xa')]);router[_0xb0ee('0x8')](_0xb0ee('0xb'),auth['isAuthenticated'](),controller[_0xb0ee('0xc')]);router['get'](_0xb0ee('0xd'),auth[_0xb0ee('0x9')](),controller[_0xb0ee('0xe')]);router[_0xb0ee('0x8')](_0xb0ee('0xf'),auth[_0xb0ee('0x9')](),controller['show']);router['post']('/',auth[_0xb0ee('0x9')](),controller[_0xb0ee('0x10')]);router['put']('/:id',auth[_0xb0ee('0x9')](),controller[_0xb0ee('0x11')]);router[_0xb0ee('0x12')](_0xb0ee('0xf'),auth['isAuthenticated'](),controller[_0xb0ee('0x13')]);module['exports']=router; \ No newline at end of file +var _0x236d=['../../config/environment','isAuthenticated','index','get','/describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xf74e6,_0x5ea367){var _0x4a6bda=function(_0x23f310){while(--_0x23f310){_0xf74e6['push'](_0xf74e6['shift']());}};_0x4a6bda(++_0x5ea367);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd236('0x0'));var util=require(_0xd236('0x1'));var path=require('path');var timeout=require(_0xd236('0x2'));var express=require('express');var router=express[_0xd236('0x3')]();var auth=require(_0xd236('0x4'));var interaction=require(_0xd236('0x5'));var config=require(_0xd236('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xd236('0x7')](),controller[_0xd236('0x8')]);router[_0xd236('0x9')](_0xd236('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd236('0x9')](_0xd236('0xb'),auth['isAuthenticated'](),controller[_0xd236('0xc')]);router[_0xd236('0x9')]('/:id',auth[_0xd236('0x7')](),controller[_0xd236('0xd')]);router[_0xd236('0xe')]('/',auth['isAuthenticated'](),controller[_0xd236('0xf')]);router[_0xd236('0x10')](_0xd236('0x11'),auth['isAuthenticated'](),controller[_0xd236('0x12')]);router[_0xd236('0x13')](_0xd236('0x11'),auth[_0xd236('0x7')](),controller[_0xd236('0x14')]);module[_0xd236('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 0a9503e..1360cfc 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 _0x5d91=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format'];(function(_0x5af081,_0x566d25){var _0x2dde7b=function(_0x491b43){while(--_0x491b43){_0x5af081['push'](_0x5af081['shift']());}};_0x2dde7b(++_0x566d25);}(_0x5d91,0xf8));var _0x15d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d91[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x15d9('0x0'));var moment=require(_0x15d9('0x1'));module[_0x15d9('0x2')]={'type':{'type':Sequelize[_0x15d9('0x3')]},'uniqueid':{'type':Sequelize[_0x15d9('0x3')]},'calleridnum':{'type':Sequelize[_0x15d9('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x15d9('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x15d9('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x15d9('0x4')],'set':function(_0x125f5a){var _0x494d5c=moment(_0x125f5a);var _0x16c7fe=moment(this[_0x15d9('0x5')]('queuecallerjoinAt'))[_0x15d9('0x6')](_0x15d9('0x7'));var _0xe3f124=_0x494d5c[_0x15d9('0x8')](_0x16c7fe,_0x15d9('0x9'));this[_0x15d9('0xa')](_0x15d9('0xb'),_0x125f5a);this[_0x15d9('0xa')](_0x15d9('0xc'),_0xe3f124||null);}},'position':{'type':Sequelize[_0x15d9('0xd')]},'count':{'type':Sequelize[_0x15d9('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x15d9('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x15d9('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x15d9('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x15d9('0x4')]},'queuecallerexit':{'type':Sequelize[_0x15d9('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x15d9('0x3')],'comment':_0x15d9('0xf')},'originalposition':{'type':Sequelize[_0x15d9('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x15d9('0x3')]},'connectedlinename':{'type':Sequelize[_0x15d9('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x15d9('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x15d9('0xd')]},'mohtime':{'type':Sequelize[_0x15d9('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x15d9('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x15d9('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x15d9('0x10')},'transferexten':{'type':Sequelize[_0x15d9('0x3')]},'transferuniqueid':{'type':Sequelize[_0x15d9('0x3')]},'disposition':{'type':Sequelize[_0x15d9('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa1ab=['FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x162d89,_0x4904e7){var _0x4af420=function(_0x564dfb){while(--_0x564dfb){_0x162d89['push'](_0x162d89['shift']());}};_0x4af420(++_0x4904e7);}(_0xa1ab,0x1a1));var _0xba1a=function(_0x88929e,_0x9097e3){_0x88929e=_0x88929e-0x0;var _0x514d08=_0xa1ab[_0x88929e];return _0x514d08;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xba1a('0x0'));module[_0xba1a('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xba1a('0x2')]},'calleridname':{'type':Sequelize[_0xba1a('0x2')]},'queue':{'type':Sequelize[_0xba1a('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xba1a('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xba1a('0x3')],'set':function(_0xa2e23a){var _0x5ee8c5=moment(_0xa2e23a);var _0x20b66c=moment(this[_0xba1a('0x4')](_0xba1a('0x5')))[_0xba1a('0x6')](_0xba1a('0x7'));var _0x1a2cd3=_0x5ee8c5[_0xba1a('0x8')](_0x20b66c,_0xba1a('0x9'));this[_0xba1a('0xa')](_0xba1a('0xb'),_0xa2e23a);this[_0xba1a('0xa')]('holdtime',_0x1a2cd3||null);}},'position':{'type':Sequelize[_0xba1a('0xc')]},'count':{'type':Sequelize[_0xba1a('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xba1a('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xba1a('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xba1a('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xba1a('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xba1a('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xba1a('0x2')],'comment':_0xba1a('0xe')},'originalposition':{'type':Sequelize[_0xba1a('0xc')]},'channel':{'type':Sequelize[_0xba1a('0x2')]},'connectedlinenum':{'type':Sequelize[_0xba1a('0x2')]},'connectedlinename':{'type':Sequelize[_0xba1a('0x2')]},'accountcode':{'type':Sequelize[_0xba1a('0x2')]},'context':{'type':Sequelize[_0xba1a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xba1a('0x2')]},'holdtime':{'type':Sequelize[_0xba1a('0xc')]},'mohtime':{'type':Sequelize[_0xba1a('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xba1a('0x2')],'comment':_0xba1a('0xf')},'transferexten':{'type':Sequelize[_0xba1a('0x2')]},'transferuniqueid':{'type':Sequelize[_0xba1a('0x2')]},'disposition':{'type':Sequelize[_0xba1a('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xba1a('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 b373fe8..9e4f284 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 _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('0x4d')));}; \ No newline at end of file +var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','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','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x7a54,0x106));var _0x47a5=function(_0x26179a,_0x29620b){_0x26179a=_0x26179a-0x0;var _0x3624d3=_0x7a54[_0x26179a];return _0x3624d3;};'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'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0c0d161..ae7a4d4 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 _0xe8c2=['exports','events','VoiceQueueReport','update','remove','emit','hasOwnProperty','hook'];(function(_0x1ec312,_0x5af072){var _0x2d249f=function(_0x59b1d8){while(--_0x59b1d8){_0x1ec312['push'](_0x1ec312['shift']());}};_0x2d249f(++_0x5af072);}(_0xe8c2,0x81));var _0x2e8c=function(_0x85c1d6,_0x194c2b){_0x85c1d6=_0x85c1d6-0x0;var _0x45afcd=_0xe8c2[_0x85c1d6];return _0x45afcd;};'use strict';var EventEmitter=require(_0x2e8c('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x2e8c('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e8c('0x2'),'afterDestroy':_0x2e8c('0x3')};function emitEvent(_0x9fcf92){return function(_0x1da7f4,_0x5dc895,_0x4354c5){VoiceQueueReportEvents[_0x2e8c('0x4')](_0x9fcf92+':'+_0x1da7f4['id'],_0x1da7f4);VoiceQueueReportEvents['emit'](_0x9fcf92,_0x1da7f4);_0x4354c5(null);};}for(var e in events){if(events[_0x2e8c('0x5')](e)){var event=events[e];VoiceQueueReport[_0x2e8c('0x6')](e,emitEvent(event));}}module[_0x2e8c('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe054=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x104171,_0x5a9705){var _0x3e8928=function(_0x16f59a){while(--_0x16f59a){_0x104171['push'](_0x104171['shift']());}};_0x3e8928(++_0x5a9705);}(_0xe054,0x99));var _0x4e05=function(_0x49be9d,_0x53fcd4){_0x49be9d=_0x49be9d-0x0;var _0x313bca=_0xe054[_0x49be9d];return _0x313bca;};'use strict';var EventEmitter=require(_0x4e05('0x0'));var VoiceQueueReport=require(_0x4e05('0x1'))['db'][_0x4e05('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4e05('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4e05('0x4')};function emitEvent(_0x256562){return function(_0x22d3de,_0x59a86c,_0xc1e32f){VoiceQueueReportEvents[_0x4e05('0x5')](_0x256562+':'+_0x22d3de['id'],_0x22d3de);VoiceQueueReportEvents[_0x4e05('0x5')](_0x256562,_0x22d3de);_0xc1e32f(null);};}for(var e in events){if(events[_0x4e05('0x6')](e)){var event=events[e];VoiceQueueReport[_0x4e05('0x7')](e,emitEvent(event));}}module[_0x4e05('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 49a1c11..c5b04e2 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 _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0x2032,0xd9));var _0x2203=function(_0xb02085,_0x3df377){_0xb02085=_0xb02085-0x0;var _0xb7291d=_0x2032[_0xb02085];return _0xb7291d;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x23e4cf,_0x12704d){var _0x2bd35a=function(_0xaa827a){while(--_0xaa827a){_0x23e4cf['push'](_0x23e4cf['shift']());}};_0x2bd35a(++_0x12704d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0xb10b[_0x4bdf64];return _0x9a1a19;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('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 372619c..ffd3056 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 _0x9856=['then','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','util','../../mysqldb','../../config/utils','../../config/environment','http','defaults','register','request','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','include','map','model'];(function(_0x55d070,_0x217865){var _0x1b4b62=function(_0x5ade29){while(--_0x5ade29){_0x55d070['push'](_0x55d070['shift']());}};_0x1b4b62(++_0x217865);}(_0x9856,0x170));var _0x6985=function(_0x1bbaa5,_0x4eadff){_0x1bbaa5=_0x1bbaa5-0x0;var _0x585ef2=_0x9856[_0x1bbaa5];return _0x585ef2;};'use strict';var _=require(_0x6985('0x0'));var util=require(_0x6985('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6985('0x2'))['db'];var utils=require(_0x6985('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6985('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6985('0x5')]({'port':0x232a});config['redis']=_[_0x6985('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x6985('0x7')](socket);function respondWithRpcPromise(_0x13cedc,_0x5e9914,_0x42e715){return new BPromise(function(_0x42750e,_0x2e6ea7){return client[_0x6985('0x8')](_0x13cedc,_0x42e715)['then'](function(_0x226a34){logger[_0x6985('0x9')](_0x6985('0xa'),_0x5e9914,'request\x20sent');logger[_0x6985('0xb')](_0x6985('0xc'),_0x5e9914,_0x6985('0xd'),JSON['stringify'](_0x226a34));if(_0x226a34[_0x6985('0xe')]){if(_0x226a34['error'][_0x6985('0xf')]===0x1f4){logger['error'](_0x6985('0xa'),_0x5e9914,_0x226a34['error'][_0x6985('0x10')]);return _0x2e6ea7(_0x226a34[_0x6985('0xe')][_0x6985('0x10')]);}logger[_0x6985('0xe')](_0x6985('0xa'),_0x5e9914,_0x226a34[_0x6985('0xe')][_0x6985('0x10')]);return _0x42750e(_0x226a34['error'][_0x6985('0x10')]);}else{logger[_0x6985('0x9')](_0x6985('0xa'),_0x5e9914,_0x6985('0xd'));_0x42750e(_0x226a34[_0x6985('0x11')]['message']);}})[_0x6985('0x12')](function(_0x5c76c9){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5e9914,_0x5c76c9);_0x2e6ea7(_0x5c76c9);});});}exports[_0x6985('0x13')]=function(_0x21c63c){var _0x3c5430=this;return new Promise(function(_0x498270,_0x1f0c51){return db[_0x6985('0x14')]['findAll']({'raw':_0x21c63c[_0x6985('0x15')]?_0x21c63c[_0x6985('0x15')][_0x6985('0x16')]===undefined?!![]:![]:!![],'where':_0x21c63c[_0x6985('0x15')]?_0x21c63c[_0x6985('0x15')][_0x6985('0x17')]||null:null,'attributes':_0x21c63c[_0x6985('0x15')]?_0x21c63c[_0x6985('0x15')][_0x6985('0x18')]||null:null,'limit':_0x21c63c['options']?_0x21c63c['options']['limit']||null:null,'include':_0x21c63c[_0x6985('0x15')]?_0x21c63c[_0x6985('0x15')][_0x6985('0x19')]?_[_0x6985('0x1a')](_0x21c63c['options']['include'],function(_0x44d03c){return{'model':db[_0x44d03c['model']],'as':_0x44d03c['as'],'attributes':_0x44d03c['attributes'],'include':_0x44d03c[_0x6985('0x19')]?_['map'](_0x44d03c[_0x6985('0x19')],function(_0x445c12){return{'model':db[_0x445c12['model']],'as':_0x445c12['as'],'attributes':_0x445c12['attributes'],'include':_0x445c12['include']?_[_0x6985('0x1a')](_0x445c12['include'],function(_0x48e163){return{'model':db[_0x48e163[_0x6985('0x1b')]],'as':_0x48e163['as'],'attributes':_0x48e163[_0x6985('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6985('0x1c')](function(_0x399670){logger[_0x6985('0x9')](_0x6985('0x13'),_0x21c63c);logger[_0x6985('0xb')]('GetVoiceQueueReport',_0x21c63c,JSON[_0x6985('0x1d')](_0x399670));_0x498270(_0x399670);})['catch'](function(_0x50a3db){logger[_0x6985('0xe')](_0x6985('0x13'),_0x50a3db[_0x6985('0x10')],_0x21c63c);_0x1f0c51(_0x3c5430[_0x6985('0xe')](0x1f4,_0x50a3db[_0x6985('0x10')]));});});};exports[_0x6985('0x1e')]=function(_0x2f33da){var _0x2a47af=this;return new Promise(function(_0x2e7866,_0x2c17f2){return db[_0x6985('0x14')][_0x6985('0x1f')](_0x2f33da[_0x6985('0x20')],{'raw':_0x2f33da[_0x6985('0x15')]?_0x2f33da[_0x6985('0x15')][_0x6985('0x16')]===undefined?!![]:![]:!![]})[_0x6985('0x1c')](function(_0x3dba6e){logger[_0x6985('0x9')]('CreateVoiceQueueReport',_0x2f33da);logger[_0x6985('0xb')](_0x6985('0x1e'),_0x2f33da,JSON[_0x6985('0x1d')](_0x3dba6e));_0x2e7866(_0x3dba6e);})[_0x6985('0x12')](function(_0x8bd939){logger[_0x6985('0xe')](_0x6985('0x1e'),_0x8bd939[_0x6985('0x10')],_0x2f33da);_0x2c17f2(_0x2a47af[_0x6985('0xe')](0x1f4,_0x8bd939[_0x6985('0x10')]));});});};exports[_0x6985('0x21')]=function(_0x17cb39){var _0x506a06=this;return new Promise(function(_0x3c82d0,_0x58a954){return db[_0x6985('0x14')][_0x6985('0x22')](_0x17cb39['body'],{'raw':_0x17cb39[_0x6985('0x15')]?_0x17cb39['options'][_0x6985('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17cb39[_0x6985('0x15')]?_0x17cb39[_0x6985('0x15')][_0x6985('0x17')]||null:null,'attributes':_0x17cb39['options']?_0x17cb39[_0x6985('0x15')][_0x6985('0x18')]||null:null,'limit':_0x17cb39[_0x6985('0x15')]?_0x17cb39[_0x6985('0x15')][_0x6985('0x23')]||null:null})[_0x6985('0x1c')](function(_0x1e3e13){logger['info'](_0x6985('0x21'),_0x17cb39);logger['debug'](_0x6985('0x21'),_0x17cb39,JSON[_0x6985('0x1d')](_0x1e3e13));_0x3c82d0(_0x1e3e13);})[_0x6985('0x12')](function(_0x5e87df){logger['error'](_0x6985('0x21'),_0x5e87df[_0x6985('0x10')],_0x17cb39);_0x58a954(_0x506a06[_0x6985('0xe')](0x1f4,_0x5e87df[_0x6985('0x10')]));});});}; \ No newline at end of file +var _0x1d89=['rpc','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','model','attributes','map','debug','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x30a2d6,_0x43201d){var _0x10bff2=function(_0x1eee56){while(--_0x1eee56){_0x30a2d6['push'](_0x30a2d6['shift']());}};_0x10bff2(++_0x43201d);}(_0x1d89,0x1e6));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require('util');var moment=require(_0x91d8('0x1'));var BPromise=require('bluebird');var rs=require(_0x91d8('0x2'));var fs=require('fs');var Redis=require(_0x91d8('0x3'));var db=require(_0x91d8('0x4'))['db'];var utils=require(_0x91d8('0x5'));var logger=require('../../config/logger')(_0x91d8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x91d8('0x7')]({'port':0x232a});config['redis']=_[_0x91d8('0x8')](config['redis'],{'host':_0x91d8('0x9'),'port':0x18eb});var socket=require(_0x91d8('0xa'))(new Redis(config[_0x91d8('0xb')]));require('./voiceQueueReport.socket')[_0x91d8('0xc')](socket);function respondWithRpcPromise(_0x2854a6,_0x34b714,_0x5a2540){return new BPromise(function(_0x41785f,_0xc4d211){return client[_0x91d8('0xd')](_0x2854a6,_0x5a2540)[_0x91d8('0xe')](function(_0x3168fa){logger[_0x91d8('0xf')](_0x91d8('0x10'),_0x34b714,_0x91d8('0x11'));logger['debug'](_0x91d8('0x12'),_0x34b714,_0x91d8('0x11'),JSON[_0x91d8('0x13')](_0x3168fa));if(_0x3168fa[_0x91d8('0x14')]){if(_0x3168fa[_0x91d8('0x14')][_0x91d8('0x15')]===0x1f4){logger[_0x91d8('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x34b714,_0x3168fa['error'][_0x91d8('0x16')]);return _0xc4d211(_0x3168fa[_0x91d8('0x14')][_0x91d8('0x16')]);}logger['error'](_0x91d8('0x10'),_0x34b714,_0x3168fa[_0x91d8('0x14')]['message']);return _0x41785f(_0x3168fa['error'][_0x91d8('0x16')]);}else{logger[_0x91d8('0xf')](_0x91d8('0x10'),_0x34b714,_0x91d8('0x11'));_0x41785f(_0x3168fa['result'][_0x91d8('0x16')]);}})[_0x91d8('0x17')](function(_0x4db1cb){logger[_0x91d8('0x14')](_0x91d8('0x10'),_0x34b714,_0x4db1cb);_0xc4d211(_0x4db1cb);});});}exports[_0x91d8('0x18')]=function(_0x1d6d5e){var _0xa38809=this;return new Promise(function(_0x10898a,_0x23a9f6){return db[_0x91d8('0x19')][_0x91d8('0x1a')]({'raw':_0x1d6d5e[_0x91d8('0x1b')]?_0x1d6d5e[_0x91d8('0x1b')][_0x91d8('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d6d5e['options']?_0x1d6d5e[_0x91d8('0x1b')][_0x91d8('0x1d')]||null:null,'attributes':_0x1d6d5e[_0x91d8('0x1b')]?_0x1d6d5e[_0x91d8('0x1b')]['attributes']||null:null,'limit':_0x1d6d5e['options']?_0x1d6d5e[_0x91d8('0x1b')][_0x91d8('0x1e')]||null:null,'include':_0x1d6d5e[_0x91d8('0x1b')]?_0x1d6d5e['options'][_0x91d8('0x1f')]?_['map'](_0x1d6d5e[_0x91d8('0x1b')][_0x91d8('0x1f')],function(_0x56f9eb){return{'model':db[_0x56f9eb[_0x91d8('0x20')]],'as':_0x56f9eb['as'],'attributes':_0x56f9eb[_0x91d8('0x21')],'include':_0x56f9eb[_0x91d8('0x1f')]?_[_0x91d8('0x22')](_0x56f9eb[_0x91d8('0x1f')],function(_0x5aa9f2){return{'model':db[_0x5aa9f2[_0x91d8('0x20')]],'as':_0x5aa9f2['as'],'attributes':_0x5aa9f2[_0x91d8('0x21')],'include':_0x5aa9f2['include']?_[_0x91d8('0x22')](_0x5aa9f2[_0x91d8('0x1f')],function(_0x205c4f){return{'model':db[_0x205c4f[_0x91d8('0x20')]],'as':_0x205c4f['as'],'attributes':_0x205c4f[_0x91d8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x91d8('0xe')](function(_0x15a217){logger[_0x91d8('0xf')](_0x91d8('0x18'),_0x1d6d5e);logger[_0x91d8('0x23')]('GetVoiceQueueReport',_0x1d6d5e,JSON[_0x91d8('0x13')](_0x15a217));_0x10898a(_0x15a217);})['catch'](function(_0x317e06){logger[_0x91d8('0x14')]('GetVoiceQueueReport',_0x317e06[_0x91d8('0x16')],_0x1d6d5e);_0x23a9f6(_0xa38809['error'](0x1f4,_0x317e06['message']));});});};exports[_0x91d8('0x24')]=function(_0x3a3cf8){var _0x54f176=this;return new Promise(function(_0x55b7fe,_0x1364f3){return db[_0x91d8('0x19')][_0x91d8('0x25')](_0x3a3cf8[_0x91d8('0x26')],{'raw':_0x3a3cf8[_0x91d8('0x1b')]?_0x3a3cf8[_0x91d8('0x1b')][_0x91d8('0x1c')]===undefined?!![]:![]:!![]})[_0x91d8('0xe')](function(_0x2fbb91){logger[_0x91d8('0xf')]('CreateVoiceQueueReport',_0x3a3cf8);logger[_0x91d8('0x23')](_0x91d8('0x24'),_0x3a3cf8,JSON['stringify'](_0x2fbb91));_0x55b7fe(_0x2fbb91);})[_0x91d8('0x17')](function(_0x20f8f3){logger[_0x91d8('0x14')]('CreateVoiceQueueReport',_0x20f8f3['message'],_0x3a3cf8);_0x1364f3(_0x54f176[_0x91d8('0x14')](0x1f4,_0x20f8f3['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x506a3f){var _0x1f3176=this;return new Promise(function(_0x29a874,_0x44bff8){return db[_0x91d8('0x19')][_0x91d8('0x27')](_0x506a3f[_0x91d8('0x26')],{'raw':_0x506a3f['options']?_0x506a3f[_0x91d8('0x1b')][_0x91d8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x506a3f[_0x91d8('0x1b')]?_0x506a3f[_0x91d8('0x1b')][_0x91d8('0x1d')]||null:null,'attributes':_0x506a3f['options']?_0x506a3f[_0x91d8('0x1b')][_0x91d8('0x21')]||null:null,'limit':_0x506a3f[_0x91d8('0x1b')]?_0x506a3f[_0x91d8('0x1b')][_0x91d8('0x1e')]||null:null})[_0x91d8('0xe')](function(_0x473109){logger[_0x91d8('0xf')](_0x91d8('0x28'),_0x506a3f);logger[_0x91d8('0x23')](_0x91d8('0x28'),_0x506a3f,JSON[_0x91d8('0x13')](_0x473109));_0x29a874(_0x473109);})[_0x91d8('0x17')](function(_0xdcf35f){logger[_0x91d8('0x14')](_0x91d8('0x28'),_0xdcf35f['message'],_0x506a3f);_0x44bff8(_0x1f3176['error'](0x1f4,_0xdcf35f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 85fec37..dbf20f8 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 _0x9663=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x34b6d4,_0x33fd82){var _0x41c44a=function(_0x3f1313){while(--_0x3f1313){_0x34b6d4['push'](_0x34b6d4['shift']());}};_0x41c44a(++_0x33fd82);}(_0x9663,0x1a7));var _0x3966=function(_0x2f2358,_0x4fec00){_0x2f2358=_0x2f2358-0x0;var _0x4d1d8f=_0x9663[_0x2f2358];return _0x4d1d8f;};'use strict';var VoiceQueueReportEvents=require(_0x3966('0x0'));var events=[_0x3966('0x1'),_0x3966('0x2'),'update'];function createListener(_0x2b7088,_0x4148dd){return function(_0x394119){_0x4148dd['emit'](_0x2b7088,_0x394119);};}function removeListener(_0x339467,_0xd5975f){return function(){VoiceQueueReportEvents['removeListener'](_0x339467,_0xd5975f);};}exports[_0x3966('0x3')]=function(_0x32a92c){for(var _0x51392b=0x0,_0x5d6710=events[_0x3966('0x4')];_0x51392b<_0x5d6710;_0x51392b++){var _0x1d042c=events[_0x51392b];var _0x49096e=createListener(_0x3966('0x5')+_0x1d042c,_0x32a92c);VoiceQueueReportEvents['on'](_0x1d042c,_0x49096e);}}; \ No newline at end of file +var _0x2a21=['removeListener','register','remove','update','emit'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x2a21,0x110));var _0x12a2=function(_0x135e0c,_0x1921e9){_0x135e0c=_0x135e0c-0x0;var _0x39a380=_0x2a21[_0x135e0c];return _0x39a380;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0x12a2('0x0'),_0x12a2('0x1')];function createListener(_0x53e7a5,_0x2411ae){return function(_0x17ca23){_0x2411ae[_0x12a2('0x2')](_0x53e7a5,_0x17ca23);};}function removeListener(_0x8eabeb,_0x2967a1){return function(){VoiceQueueReportEvents[_0x12a2('0x3')](_0x8eabeb,_0x2967a1);};}exports[_0x12a2('0x4')]=function(_0x32d9b9){for(var _0x4a525d=0x0,_0x84001f=events['length'];_0x4a525d<_0x84001f;_0x4a525d++){var _0x5426d3=events[_0x4a525d];var _0x39be29=createListener('voiceQueueReport:'+_0x5426d3,_0x32d9b9);VoiceQueueReportEvents['on'](_0x5426d3,_0x39be29);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6ef67d7..7ee78e4 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 _0x91ac=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','put','/:id','update'];(function(_0x4fe526,_0x34b040){var _0x1c4ba0=function(_0x4b5736){while(--_0x4b5736){_0x4fe526['push'](_0x4fe526['shift']());}};_0x1c4ba0(++_0x34b040);}(_0x91ac,0x17c));var _0xc91a=function(_0x9f46f5,_0xf4cc8){_0x9f46f5=_0x9f46f5-0x0;var _0x121a01=_0x91ac[_0x9f46f5];return _0x121a01;};'use strict';var multer=require(_0xc91a('0x0'));var util=require(_0xc91a('0x1'));var path=require(_0xc91a('0x2'));var timeout=require(_0xc91a('0x3'));var express=require(_0xc91a('0x4'));var router=express[_0xc91a('0x5')]();var auth=require(_0xc91a('0x6'));var interaction=require(_0xc91a('0x7'));var config=require(_0xc91a('0x8'));var controller=require(_0xc91a('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc91a('0xa')]('/:id',auth[_0xc91a('0xb')](),controller[_0xc91a('0xc')]);router['post']('/',auth[_0xc91a('0xb')](),controller['create']);router[_0xc91a('0xd')](_0xc91a('0xe'),auth[_0xc91a('0xb')](),controller[_0xc91a('0xf')]);router[_0xc91a('0x10')](_0xc91a('0xe'),auth[_0xc91a('0xb')](),controller[_0xc91a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xde11=['Router','../../components/auth/service','./voiceQueuesLog.controller','get','index','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x5425ea,_0x465e78){var _0x492be5=function(_0x236c20){while(--_0x236c20){_0x5425ea['push'](_0x5425ea['shift']());}};_0x492be5(++_0x465e78);}(_0xde11,0x73));var _0x1de1=function(_0xb3f6f8,_0x64420e){_0xb3f6f8=_0xb3f6f8-0x0;var _0x3d49ec=_0xde11[_0xb3f6f8];return _0x3d49ec;};'use strict';var multer=require('multer');var util=require(_0x1de1('0x0'));var path=require(_0x1de1('0x1'));var timeout=require(_0x1de1('0x2'));var express=require(_0x1de1('0x3'));var router=express[_0x1de1('0x4')]();var auth=require(_0x1de1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1de1('0x6'));router[_0x1de1('0x7')]('/',auth['isAuthenticated'](),controller[_0x1de1('0x8')]);router[_0x1de1('0x7')]('/:id',auth[_0x1de1('0x9')](),controller[_0x1de1('0xa')]);router[_0x1de1('0xb')]('/',auth[_0x1de1('0x9')](),controller[_0x1de1('0xc')]);router[_0x1de1('0xd')]('/:id',auth[_0x1de1('0x9')](),controller[_0x1de1('0xe')]);router['delete']('/:id',auth[_0x1de1('0x9')](),controller[_0x1de1('0xf')]);module[_0x1de1('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 ed5dbe3..5857d06 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 _0x02c5=['exports','STRING','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x3cf350,_0x382aa7){var _0x33ea35=function(_0x1666aa){while(--_0x1666aa){_0x3cf350['push'](_0x3cf350['shift']());}};_0x33ea35(++_0x382aa7);}(_0x02c5,0x76));var _0x502c=function(_0x40d728,_0x190ef2){_0x40d728=_0x40d728-0x0;var _0x207740=_0x02c5[_0x40d728];return _0x207740;};'use strict';var Sequelize=require(_0x502c('0x0'));var moment=require(_0x502c('0x1'));module[_0x502c('0x2')]={'time':{'type':Sequelize[_0x502c('0x3')]},'callid':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x502c('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()['format'](_0x502c('0x4'))}}; \ No newline at end of file +var _0x1fb9=['moment','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x15411f,_0x42bef8){var _0x555650=function(_0x215e4f){while(--_0x215e4f){_0x15411f['push'](_0x15411f['shift']());}};_0x555650(++_0x42bef8);}(_0x1fb9,0xe0));var _0x91fb=function(_0x345ac6,_0x43a5de){_0x345ac6=_0x345ac6-0x0;var _0x4c6fe6=_0x1fb9[_0x345ac6];return _0x4c6fe6;};'use strict';var Sequelize=require(_0x91fb('0x0'));var moment=require(_0x91fb('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x91fb('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x91fb('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x91fb('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index be15973..d4045a3 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 _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','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','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0xf84660,_0x42ee71){var _0x503742=function(_0x3e9a4f){while(--_0x3e9a4f){_0xf84660['push'](_0xf84660['shift']());}};_0x503742(++_0x42ee71);}(_0xb10b,0x12a));var _0xbb10=function(_0x20e882,_0x16185c){_0x20e882=_0x20e882-0x0;var _0x3e0dbe=_0xb10b[_0x20e882];return _0x3e0dbe;};'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'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file +var _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','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','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x319087,_0x19c692){var _0x4e39ac=function(_0x2cd450){while(--_0x2cd450){_0x319087['push'](_0x319087['shift']());}};_0x4e39ac(++_0x19c692);}(_0xb10b,0x12a));var _0xbb10=function(_0x406b98,_0x3dea6d){_0x406b98=_0x406b98-0x0;var _0x10545f=_0xb10b[_0x406b98];return _0x10545f;};'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'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b39e192..0efed6d 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 _0xe65f=['define','event_dtm','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x27519d,_0x5eaba9){var _0x535b3e=function(_0x3fd0d8){while(--_0x3fd0d8){_0x27519d['push'](_0x27519d['shift']());}};_0x535b3e(++_0x5eaba9);}(_0xe65f,0x1a7));var _0xfe65=function(_0x87eee5,_0x581852){_0x87eee5=_0x87eee5-0x0;var _0x17e2dc=_0xe65f[_0x87eee5];return _0x17e2dc;};'use strict';var _=require(_0xfe65('0x0'));var util=require(_0xfe65('0x1'));var logger=require(_0xfe65('0x2'))('api');var moment=require(_0xfe65('0x3'));var BPromise=require(_0xfe65('0x4'));var rp=require(_0xfe65('0x5'));var fs=require('fs');var path=require(_0xfe65('0x6'));var rimraf=require(_0xfe65('0x7'));var config=require(_0xfe65('0x8'));var attributes=require(_0xfe65('0x9'));module[_0xfe65('0xa')]=function(_0x4052d3,_0x4d2a4f){return _0x4052d3[_0xfe65('0xb')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xfe65('0xc'),'fields':['event',_0xfe65('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x85ae=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log','dtm','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x85ae,0xcf));var _0xe85a=function(_0x26ddc0,_0x4dcb97){_0x26ddc0=_0x26ddc0-0x0;var _0x409167=_0x85ae[_0x26ddc0];return _0x409167;};'use strict';var _=require(_0xe85a('0x0'));var util=require(_0xe85a('0x1'));var logger=require(_0xe85a('0x2'))(_0xe85a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe85a('0x4'));var fs=require('fs');var path=require(_0xe85a('0x5'));var rimraf=require(_0xe85a('0x6'));var config=require(_0xe85a('0x7'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x1de948,_0x192cbb){return _0x1de948['define'](_0xe85a('0x8'),attributes,{'tableName':_0xe85a('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xe85a('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 50099ed..88ebddb 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 _0xc29b=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59ce79,_0x290843){var _0x1de3a8=function(_0x2b2d52){while(--_0x2b2d52){_0x59ce79['push'](_0x59ce79['shift']());}};_0x1de3a8(++_0x290843);}(_0xc29b,0x12d));var _0xbc29=function(_0x5c0be9,_0x44aab7){_0x5c0be9=_0x5c0be9-0x0;var _0x478881=_0xc29b[_0x5c0be9];return _0x478881;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var moment=require(_0xbc29('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc29('0x3'));var fs=require('fs');var Redis=require(_0xbc29('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc29('0x5'));var logger=require(_0xbc29('0x6'))(_0xbc29('0x7'));var config=require(_0xbc29('0x8'));var jayson=require(_0xbc29('0x9'));var client=jayson[_0xbc29('0xa')][_0xbc29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40f0c9,_0x463e2b,_0x37d9dd){return new BPromise(function(_0x2e5fb7,_0x29b188){return client[_0xbc29('0xc')](_0x40f0c9,_0x37d9dd)[_0xbc29('0xd')](function(_0x320cb4){logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,_0xbc29('0x10'));logger[_0xbc29('0x11')](_0xbc29('0x12'),_0x463e2b,'request\x20sent',JSON[_0xbc29('0x13')](_0x320cb4));if(_0x320cb4[_0xbc29('0x14')]){if(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x15')]===0x1f4){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x320cb4[_0xbc29('0x14')]['message']);return _0x29b188(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x16')]);}logger[_0xbc29('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x463e2b,_0x320cb4['error'][_0xbc29('0x16')]);return _0x2e5fb7(_0x320cb4['error'][_0xbc29('0x16')]);}else{logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,'request\x20sent');_0x2e5fb7(_0x320cb4[_0xbc29('0x17')]['message']);}})[_0xbc29('0x18')](function(_0x3b5bae){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x3b5bae);_0x29b188(_0x3b5bae);});});} \ No newline at end of file +var _0xe2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x54befe,_0x280a2d){var _0x4396f2=function(_0x4639b6){while(--_0x4639b6){_0x54befe['push'](_0x54befe['shift']());}};_0x4396f2(++_0x280a2d);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x26c643,_0x2c784a){_0x26c643=_0x26c643-0x0;var _0xb49398=_0xe2cf[_0x26c643];return _0xb49398;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ec64100..f68d550 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 _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x1a5fee,_0x2b291d){var _0x4f6e8b=function(_0x5be3a5){while(--_0x5be3a5){_0x1a5fee['push'](_0x1a5fee['shift']());}};_0x4f6e8b(++_0x2b291d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x5f0c50,_0x3c3101){var _0x5112a0=function(_0x1d5f99){while(--_0x1d5f99){_0x5f0c50['push'](_0x5f0c50['shift']());}};_0x5112a0(++_0x3c3101);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 10826ce..eba4acd 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 _0x9aa5=['sequelize','moment','exports','VIRTUAL','value','extname','getDataValue','STRING','channel','setDataValue','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','DATE','format','toString','updatedAt'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0x9aa5,0x1c8));var _0x59aa=function(_0x5c9dc5,_0x4296b3){_0x5c9dc5=_0x5c9dc5-0x0;var _0x3a6fc7=_0x9aa5[_0x5c9dc5];return _0x3a6fc7;};'use strict';var Sequelize=require(_0x59aa('0x0'));var moment=require(_0x59aa('0x1'));var path=require('path');module[_0x59aa('0x2')]={'format':{'type':Sequelize[_0x59aa('0x3')],'get':function(){return this['getDataValue'](_0x59aa('0x4'))?path[_0x59aa('0x5')](this[_0x59aa('0x6')](_0x59aa('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0x59aa('0x7')]},'channel':{'type':Sequelize[_0x59aa('0x7')],'set':function(_0x1d0b22){if(_0x1d0b22){this['setDataValue'](_0x59aa('0x8'),_0x1d0b22);this[_0x59aa('0x9')]('membername',_0x1d0b22['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x59aa('0x7')]},'calleridnum':{'type':Sequelize[_0x59aa('0x7')]},'calleridname':{'type':Sequelize[_0x59aa('0x7')]},'connectedlinenum':{'type':Sequelize[_0x59aa('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x59aa('0x7')]},'context':{'type':Sequelize[_0x59aa('0x7')]},'exten':{'type':Sequelize[_0x59aa('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x59aa('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x59aa('0x7')]},'location':{'type':Sequelize[_0x59aa('0xb')]},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize[_0x59aa('0x7')],'defaultValue':_0x59aa('0xc')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x59aa('0xb')]},'failureReason':{'type':Sequelize[_0x59aa('0xb')]},'sentiment':{'type':Sequelize[_0x59aa('0x7')]},'sPositive':{'type':Sequelize[_0x59aa('0xd')]},'sNegative':{'type':Sequelize[_0x59aa('0xd')]},'sNeutral':{'type':Sequelize[_0x59aa('0xd')]},'sMixed':{'type':Sequelize[_0x59aa('0xd')]},'tempSentiment':{'type':Sequelize[_0x59aa('0xe')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x59aa('0xf')],'get':function(){return moment(this[_0x59aa('0x6')]('createdAt'))[_0x59aa('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x59aa('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x59aa('0x6')](_0x59aa('0x12')))[_0x59aa('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x59aa('0x11')]();}}}; \ No newline at end of file +var _0xc6ec=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN'];(function(_0x4f6c3d,_0x28427f){var _0x84606=function(_0x5b3cf7){while(--_0x5b3cf7){_0x4f6c3d['push'](_0x4f6c3d['shift']());}};_0x84606(++_0x28427f);}(_0xc6ec,0x1a8));var _0xcc6e=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xc6ec[_0x189305];return _0xea3406;};'use strict';var Sequelize=require(_0xcc6e('0x0'));var moment=require(_0xcc6e('0x1'));var path=require(_0xcc6e('0x2'));module['exports']={'format':{'type':Sequelize[_0xcc6e('0x3')],'get':function(){return this[_0xcc6e('0x4')](_0xcc6e('0x5'))?path[_0xcc6e('0x6')](this['getDataValue'](_0xcc6e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xcc6e('0x7')]},'channel':{'type':Sequelize[_0xcc6e('0x7')],'set':function(_0x551e5e){if(_0x551e5e){this[_0xcc6e('0x8')](_0xcc6e('0x9'),_0x551e5e);this['setDataValue'](_0xcc6e('0xa'),_0x551e5e[_0xcc6e('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xcc6e('0x7')]},'calleridnum':{'type':Sequelize[_0xcc6e('0x7')]},'calleridname':{'type':Sequelize[_0xcc6e('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xcc6e('0x7')]},'accountcode':{'type':Sequelize[_0xcc6e('0x7')]},'context':{'type':Sequelize[_0xcc6e('0x7')]},'exten':{'type':Sequelize[_0xcc6e('0x7')]},'value':{'type':Sequelize[_0xcc6e('0x7')]},'type':{'type':Sequelize[_0xcc6e('0x7')]},'rating':{'type':Sequelize[_0xcc6e('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xcc6e('0x7')]},'userDisposition':{'type':Sequelize[_0xcc6e('0x7')]},'location':{'type':Sequelize[_0xcc6e('0xd')]},'transcribeName':{'type':Sequelize[_0xcc6e('0x7')]},'transcribeStatus':{'type':Sequelize[_0xcc6e('0x7')],'defaultValue':_0xcc6e('0xe')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0xcc6e('0xd')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0xcc6e('0x7')]},'sPositive':{'type':Sequelize[_0xcc6e('0xf')]},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize[_0xcc6e('0xf')]},'sMixed':{'type':Sequelize[_0xcc6e('0xf')]},'tempSentiment':{'type':Sequelize[_0xcc6e('0x10')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xcc6e('0x11')],'get':function(){return moment(this[_0xcc6e('0x4')](_0xcc6e('0x12')))[_0xcc6e('0x13')](_0xcc6e('0x14'))['toString']();}},'updatedAt':{'type':Sequelize[_0xcc6e('0x11')],'get':function(){return moment(this[_0xcc6e('0x4')]('updatedAt'))[_0xcc6e('0x13')](_0xcc6e('0x14'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 5a30da6..a55761d 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 _0x988e=['TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','ValidationError','transcribe','transcribeAccountId','transcribeRegion','runSentiment','sentiment','sentimentRegion','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','MD5','col','token','$and','push','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket'];(function(_0x73540f,_0x1c0976){var _0x56967a=function(_0xa670d6){while(--_0xa670d6){_0x73540f['push'](_0x73540f['shift']());}};_0x56967a(++_0x1c0976);}(_0x988e,0x154));var _0xe988=function(_0x3f5269,_0x4bcd9d){_0x3f5269=_0x3f5269-0x0;var _0xbeedd0=_0x988e[_0x3f5269];return _0xbeedd0;};'use strict';var pdf=require(_0xe988('0x0'));var emlformat=require(_0xe988('0x1'));var rimraf=require(_0xe988('0x2'));var zipdir=require(_0xe988('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe988('0x4'));var moment=require(_0xe988('0x5'));var BPromise=require(_0xe988('0x6'));var Mustache=require(_0xe988('0x7'));var util=require(_0xe988('0x8'));var path=require(_0xe988('0x9'));var sox=require(_0xe988('0xa'));var csv=require(_0xe988('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe988('0xc'));var squel=require(_0xe988('0xd'));var crypto=require(_0xe988('0xe'));var jsforce=require(_0xe988('0xf'));var deskjs=require(_0xe988('0x10'));var toCsv=require(_0xe988('0xb'));var querystring=require('querystring');var Papa=require(_0xe988('0x11'));var AWS=require(_0xe988('0x12'));var uuidv4=require(_0xe988('0x13'));var Redis=require(_0xe988('0x14'));var authService=require(_0xe988('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe988('0x16'));var hardwareService=require(_0xe988('0x17'));var logger=require(_0xe988('0x18'))(_0xe988('0x19'));var utils=require(_0xe988('0x1a'));var config=require('../../config/environment');var db=require(_0xe988('0x1b'))['db'];function respondWithStatusCode(_0x39e52b,_0x42f972){_0x42f972=_0x42f972||0xcc;return function(_0x3e0d9a){if(_0x3e0d9a){return _0x39e52b[_0xe988('0x1c')](_0x42f972);}return _0x39e52b[_0xe988('0x1d')](_0x42f972)[_0xe988('0x1e')]();};}function respondWithResult(_0xb215a4,_0x33d8dd){_0x33d8dd=_0x33d8dd||0xc8;return function(_0x5a3a6d){if(_0x5a3a6d){return _0xb215a4[_0xe988('0x1d')](_0x33d8dd)['json'](_0x5a3a6d);}};}function respondWithFilteredResult(_0x31a2ea,_0x13c0a5){return function(_0x499aa4){if(_0x499aa4){var _0x3d2c4c=_0x499aa4[_0xe988('0x1f')],_0x674086=_0x13c0a5['offset'],_0x29d9bd=_0x13c0a5['offset']+_0x13c0a5[_0xe988('0x20')],_0x2b425c;if(_0x29d9bd>=_0x3d2c4c){_0x29d9bd=_0x3d2c4c;_0x2b425c=0xc8;}else{_0x2b425c=0xce;}_0x31a2ea[_0xe988('0x1d')](_0x2b425c);return _0x31a2ea[_0xe988('0x21')](_0xe988('0x22'),_0x674086+'-'+_0x29d9bd+'/'+_0x3d2c4c)[_0xe988('0x23')](_0x499aa4);}return null;};}function patchUpdates(_0x2ee326){return function(_0x39a46d){try{jsonpatch['apply'](_0x39a46d,_0x2ee326,!![]);}catch(_0x275649){return BPromise[_0xe988('0x24')](_0x275649);}return _0x39a46d['save']();};}function saveUpdates(_0x1d7603,_0x993e05){return function(_0x6799ea){if(_0x6799ea){return _0x6799ea[_0xe988('0x25')](_0x1d7603)[_0xe988('0x26')](function(_0xdcc6cc){return _0xdcc6cc;});}return null;};}function removeEntity(_0x35234d,_0x4efce4){return function(_0x5f0a3a){if(_0x5f0a3a){return _0x5f0a3a[_0xe988('0x27')]()['then'](function(){_0x35234d[_0xe988('0x1d')](0xcc)[_0xe988('0x1e')]();});}};}function handleEntityNotFound(_0x368676,_0x1cde4e){return function(_0x30ce19){if(!_0x30ce19){_0x368676['sendStatus'](0x194);}return _0x30ce19;};}function handleError(_0x6592d9,_0x385fd8){_0x385fd8=_0x385fd8||0x1f4;return function(_0x674b9b){logger[_0xe988('0x28')](_0x674b9b[_0xe988('0x29')]);if(_0x674b9b[_0xe988('0x2a')]){delete _0x674b9b[_0xe988('0x2a')];}_0x6592d9['status'](_0x385fd8)[_0xe988('0x2b')](_0x674b9b);};}exports[_0xe988('0x2c')]=function(_0x574720,_0x3522a7){var _0x51b25f={},_0x171a37={},_0x203315={'count':0x0,'rows':[]};var _0x28de53=_[_0xe988('0x2d')](db[_0xe988('0x2e')][_0xe988('0x2f')],function(_0x26e155){return{'name':_0x26e155[_0xe988('0x30')],'type':_0x26e155[_0xe988('0x31')][_0xe988('0x32')]};});_0x171a37['model']=_[_0xe988('0x33')](_[_0xe988('0x2d')](_0x28de53,_0xe988('0x2a')),[_0xe988('0x34')]);_0x171a37['query']=_[_0xe988('0x35')](_0x574720[_0xe988('0x36')]);_0x171a37[_0xe988('0x37')]=_[_0xe988('0x38')](_0x171a37[_0xe988('0x39')],_0x171a37[_0xe988('0x36')]);_0x51b25f[_0xe988('0x3a')]=_['intersection'](_0x171a37['model'],qs[_0xe988('0x3b')](_0x574720[_0xe988('0x36')][_0xe988('0x3b')]));_0x51b25f[_0xe988('0x3a')]=_0x51b25f['attributes'][_0xe988('0x3c')]?_0x51b25f['attributes']:_0x171a37[_0xe988('0x39')];if(!_0x574720[_0xe988('0x36')][_0xe988('0x3d')](_0xe988('0x3e'))){_0x51b25f[_0xe988('0x20')]=qs['limit'](_0x574720[_0xe988('0x36')][_0xe988('0x20')]);_0x51b25f['offset']=qs[_0xe988('0x3f')](_0x574720[_0xe988('0x36')][_0xe988('0x3f')]);}_0x51b25f[_0xe988('0x40')]=qs[_0xe988('0x41')](_0x574720[_0xe988('0x36')][_0xe988('0x41')]);_0x51b25f[_0xe988('0x42')]=qs[_0xe988('0x37')](_[_0xe988('0x43')](_0x574720[_0xe988('0x36')],_0x171a37[_0xe988('0x37')]),_0x28de53);if(_0x574720['query'][_0xe988('0x44')]){_0x51b25f['where']=_[_0xe988('0x45')](_0x51b25f[_0xe988('0x42')],{'$or':_[_0xe988('0x2d')](_0x28de53,function(_0x202f70){if(_0x202f70['type']!=='VIRTUAL'){var _0x3a881e={};_0x3a881e[_0x202f70[_0xe988('0x2a')]]={'$like':'%'+_0x574720[_0xe988('0x36')][_0xe988('0x44')]+'%'};return _0x3a881e;}})});}_0x51b25f=_['merge']({},_0x51b25f,_0x574720[_0xe988('0x46')]);var _0x26117b={'where':_0x51b25f[_0xe988('0x42')]};return db[_0xe988('0x2e')][_0xe988('0x1f')](_0x26117b)[_0xe988('0x26')](function(_0x2b9520){_0x203315[_0xe988('0x1f')]=_0x2b9520;if(_0x574720[_0xe988('0x36')][_0xe988('0x47')]){_0x51b25f[_0xe988('0x48')]=[{'all':!![]}];}return db['VoiceRecording'][_0xe988('0x49')](_0x51b25f);})[_0xe988('0x26')](function(_0x5925c0){_0x203315[_0xe988('0x4a')]=_0x5925c0;return _0x203315;})['then'](respondWithFilteredResult(_0x3522a7,_0x51b25f))['catch'](handleError(_0x3522a7,null));};exports['show']=function(_0x5f484c,_0x533645){var _0x2f1345={'raw':![],'where':{'id':_0x5f484c[_0xe988('0x4b')]['id']}},_0x572416={};_0x572416[_0xe988('0x39')]=_[_0xe988('0x35')](db['VoiceRecording'][_0xe988('0x2f')]);_0x572416[_0xe988('0x36')]=_[_0xe988('0x35')](_0x5f484c['query']);_0x572416[_0xe988('0x37')]=_['intersection'](_0x572416[_0xe988('0x39')],_0x572416[_0xe988('0x36')]);_0x2f1345[_0xe988('0x3a')]=_[_0xe988('0x38')](_0x572416[_0xe988('0x39')],qs[_0xe988('0x3b')](_0x5f484c[_0xe988('0x36')][_0xe988('0x3b')]));_0x2f1345[_0xe988('0x3a')]=_0x2f1345['attributes'][_0xe988('0x3c')]?_0x2f1345[_0xe988('0x3a')]:_0x572416[_0xe988('0x39')];if(_0x5f484c[_0xe988('0x36')][_0xe988('0x47')]){_0x2f1345[_0xe988('0x48')]=[{'all':!![]}];}_0x2f1345=_[_0xe988('0x45')]({},_0x2f1345,_0x5f484c[_0xe988('0x46')]);return db[_0xe988('0x2e')][_0xe988('0x4c')](_0x2f1345)['then'](handleEntityNotFound(_0x533645,null))['then'](respondWithResult(_0x533645,null))[_0xe988('0x4d')](handleError(_0x533645,null));};exports[_0xe988('0x4e')]=function(_0x21b311,_0x2488b6){return db['VoiceRecording'][_0xe988('0x4e')](_0x21b311[_0xe988('0x4f')],{})[_0xe988('0x26')](respondWithResult(_0x2488b6,0xc9))[_0xe988('0x4d')](handleError(_0x2488b6,null));};exports[_0xe988('0x25')]=function(_0x3ab765,_0x5d770f){if(_0x3ab765[_0xe988('0x4f')]['id']){delete _0x3ab765[_0xe988('0x4f')]['id'];}return db['VoiceRecording'][_0xe988('0x4c')]({'where':{'id':_0x3ab765[_0xe988('0x4b')]['id']}})[_0xe988('0x26')](handleEntityNotFound(_0x5d770f,null))['then'](saveUpdates(_0x3ab765[_0xe988('0x4f')],null))[_0xe988('0x26')](respondWithResult(_0x5d770f,null))[_0xe988('0x4d')](handleError(_0x5d770f,null));};exports[_0xe988('0x50')]=function(_0x42a30b,_0x2625c5){return db[_0xe988('0x2e')]['describe']()[_0xe988('0x26')](respondWithResult(_0x2625c5,null))[_0xe988('0x4d')](handleError(_0x2625c5,null));};exports[_0xe988('0x51')]=function(_0x35db71,_0x4dfc37,_0x4d631e){var _0x16422c=require(_0xe988('0x52'));var _0x5ce53b=![];var _0x1bcea1={};if(_0x35db71['query'][_0xe988('0x31')]&&_0x35db71[_0xe988('0x36')][_0xe988('0x31')]===_0xe988('0x53')){_0x1bcea1[_0xe988('0x53')]=_0x35db71[_0xe988('0x4b')]['id'];}else{_0x1bcea1['id']=_0x35db71[_0xe988('0x4b')]['id'];}return db[_0xe988('0x2e')]['find']({'where':_0x1bcea1,'attributes':['id',_0xe988('0x54')],'raw':!![]})[_0xe988('0x26')](handleEntityNotFound(_0x4dfc37,null))[_0xe988('0x26')](function(_0x1a3f87){if(_0x1a3f87){var _0x476c71=_0x1a3f87[_0xe988('0x54')];var _0x841477=util['format'](_0xe988('0x55'),_0x476c71);if(fs[_0xe988('0x56')](_0x841477)){_0x5ce53b=!![];return _0x16422c[_0xe988('0x57')](_0x841477,_0x476c71,config[_0xe988('0x58')][_0xe988('0x59')])[_0xe988('0x26')](function(){return _0x1a3f87;});}return _0x1a3f87;}})[_0xe988('0x26')](function(_0x965715){if(_0x965715){var _0x1cc0aa=_0x965715[_0xe988('0x54')];if(!fs[_0xe988('0x56')](_0x1cc0aa)){throw new db[(_0xe988('0x5a'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x965715[_0xe988('0x5b')]){return _0x4dfc37[_0xe988('0x51')](_0x1cc0aa,_0x965715['filename']+path['extname'](_0x1cc0aa),function(){if(_0x5ce53b){fs[_0xe988('0x5c')](_0x1cc0aa);}});}else{return _0x4dfc37[_0xe988('0x51')](_0x1cc0aa,function(_0x3e574c){if(_0x5ce53b){fs[_0xe988('0x5c')](_0x1cc0aa);}});}}})[_0xe988('0x4d')](function(_0x3f04e7){if(_0x3f04e7[_0xe988('0x5d')]===_0xe988('0x5e')){_0x4dfc37[_0xe988('0x1d')](0x194)[_0xe988('0x2b')](_0xe988('0x5f'));}else{return handleError(_0x4dfc37,null);}});};exports['downloads']=function(_0x172968,_0x55f69c,_0x25591c){var _0x24b72c=require(_0xe988('0x52'));var _0x128510=![];var _0x5a0fa7={'$and':[db[_0xe988('0x60')][_0xe988('0x42')](db[_0xe988('0x60')]['fn'](_0xe988('0x61'),db['sequelize'][_0xe988('0x62')](_0xe988('0x53'))),_0x172968[_0xe988('0x36')][_0xe988('0x63')])]};if(_0x172968[_0xe988('0x36')][_0xe988('0x31')]&&_0x172968[_0xe988('0x36')][_0xe988('0x31')]==='uniqueid'){_0x5a0fa7[_0xe988('0x64')]['push']({'uniqueid':_0x172968[_0xe988('0x4b')]['id']});}else{_0x5a0fa7[_0xe988('0x64')][_0xe988('0x65')]({'id':_0x172968[_0xe988('0x4b')]['id']});}return db['VoiceRecording'][_0xe988('0x4c')]({'where':_0x5a0fa7,'attributes':['id',_0xe988('0x54')],'raw':!![]})[_0xe988('0x26')](handleEntityNotFound(_0x55f69c,null))[_0xe988('0x26')](function(_0xe8caa){if(_0xe8caa){var _0x3c2735=util['format'](_0xe988('0x55'),_0xe8caa['value']);if(fs[_0xe988('0x56')](_0x3c2735)){_0x128510=!![];return _0x24b72c[_0xe988('0x57')](_0x3c2735,_0xe8caa[_0xe988('0x54')],config[_0xe988('0x58')][_0xe988('0x59')])[_0xe988('0x26')](function(){return _0xe8caa;});}return _0xe8caa;}})[_0xe988('0x26')](function(_0xf7bd7a){if(_0xf7bd7a){if(!fs[_0xe988('0x56')](_0xf7bd7a[_0xe988('0x54')])){throw new db['Sequelize']['ValidationError'](_0xe988('0x5e'));}if(_0xf7bd7a[_0xe988('0x5b')]){return _0x55f69c[_0xe988('0x51')](_0xf7bd7a[_0xe988('0x54')],_0xf7bd7a['filename']+path[_0xe988('0x66')](_0xf7bd7a[_0xe988('0x54')]),function(){if(_0x128510){fs[_0xe988('0x5c')](_0xf7bd7a[_0xe988('0x54')]);}});}else{return _0x55f69c[_0xe988('0x51')](_0xf7bd7a[_0xe988('0x54')],function(_0x3984c2){if(_0x128510){fs[_0xe988('0x5c')](_0xf7bd7a[_0xe988('0x54')]);}});}}})['catch'](handleError(_0x55f69c,null));};exports[_0xe988('0x27')]=function(_0x71ede2,_0x4dba18){return db['VoiceRecording'][_0xe988('0x4c')]({'where':{'id':_0x71ede2['params']['id']}})['then'](function(_0x146701){if(!_0x146701)throw new ReferenceError(_0xe988('0x67'));return _0x146701;})['then'](function(_0x1ecd86){var _0x38df2f=_0x1ecd86[_0xe988('0x54')];logger[_0xe988('0x68')](_0xe988('0x69'),_0x38df2f);if(!_[_0xe988('0x6a')](_0x1ecd86[_0xe988('0x54')])&&fs[_0xe988('0x56')](_0x38df2f)){logger[_0xe988('0x68')]('File:\x20\x22'+_0x38df2f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x38df2f);}_0x38df2f=_0x38df2f+_0xe988('0x6b');if(!_[_0xe988('0x6a')](_0x1ecd86['value'])&&fs[_0xe988('0x56')](_0x38df2f)){logger[_0xe988('0x68')](_0xe988('0x6c')+_0x38df2f+_0xe988('0x6d'));fs[_0xe988('0x6e')](_0x38df2f);}return _0x1ecd86;})[_0xe988('0x26')](function(_0x47e522){if(!_0x47e522)throw new InternalError();return _0x47e522[_0xe988('0x27')]();})['then'](function(){_0x4dba18['status'](0xcc)['end']();})['catch'](handleError(_0x4dba18,null));};function getBucketslist(_0x4e87e5,_0x5a8ebc,_0x469c6f){return new Promise(function(_0x5f4220,_0x1dc37f){var _0x296723=new AWS['S3']({'accessKeyId':_0x5a8ebc,'secretAccessKey':_0x4e87e5,'region':_0x469c6f});_0x296723[_0xe988('0x6f')]({},function(_0x1a27fb,_0x4f1eef){if(_0x1a27fb){return _0x1dc37f(_0x1a27fb);}else{return _0x5f4220(_0x4f1eef);}});});}function createBucket(_0xafb9c1,_0x408eee,_0xe7697,_0x6fd623){return new Promise(function(_0x19bbd5,_0x486425){var _0x5c8e18=new AWS['S3']({'accessKeyId':_0x408eee,'secretAccessKey':_0xafb9c1,'region':_0xe7697});_0x5c8e18[_0xe988('0x70')]({'Bucket':_0x6fd623},function(_0x324299,_0x5c3010){if(_0x324299){return _0x486425(_0x324299);}else{return _0x19bbd5(_0x5c3010);}});});}function uploadFile(_0x1b6ad1,_0x59953d,_0x1c3f80,_0x5e7036,_0x2da593,_0x21d174){return new Promise(function(_0xa80832,_0x4f65e6){var _0x3d5051=new AWS['S3']({'accessKeyId':_0x59953d,'secretAccessKey':_0x1b6ad1,'region':_0x1c3f80});_0x3d5051['upload']({'Bucket':_0x5e7036,'Key':_0x2da593,'Body':_0x21d174},function(_0x5e0e6f,_0x577494){if(_0x5e0e6f){return _0x4f65e6(_0x5e0e6f);}else{return _0xa80832(_0x577494);}});});}function startTranscribe(_0x146f8b,_0x5d24e5,_0x920c2f,_0x305d8a,_0x41d848,_0x2c7089){return new Promise(function(_0x40f370,_0x237198){var _0x394694=new AWS[(_0xe988('0x71'))]({'accessKeyId':_0x5d24e5,'secretAccessKey':_0x146f8b,'region':_0x920c2f});_0x394694[_0xe988('0x72')]({'TranscriptionJobName':_0x305d8a,'LanguageCode':_0x41d848,'Media':{'MediaFileUri':_0x2c7089}},function(_0x5f4482,_0x262333){if(_0x5f4482){return _0x237198(_0x5f4482);}else{return _0x40f370(_0x262333);}});});}function transcribe(_0x425557,_0xeb8396,_0x530af7,_0xfa82af,_0x2159ca,_0x3a6309,_0x6ed0bb){return new Promise(function(_0x1f95bf,_0xa1e109){var _0x102d60={};logger[_0xe988('0x68')](util[_0xe988('0x34')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x425557,_0x2159ca));return uploadFile(_0xeb8396,_0x530af7,_0xfa82af,_0x2159ca,path[_0xe988('0x73')](_0x3a6309),fs['readFileSync'](_0x3a6309))[_0xe988('0x26')](function(_0x1af416){logger[_0xe988('0x68')](util[_0xe988('0x34')](_0xe988('0x74'),_0x425557,_0x2159ca,_0x1af416[_0xe988('0x75')]));_0x102d60[_0xe988('0x76')]=_0x1af416['Bucket'];_0x102d60[_0xe988('0x77')]=_0x1af416[_0xe988('0x75')];logger[_0xe988('0x68')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x425557));return startTranscribe(_0xeb8396,_0x530af7,_0xfa82af,uuidv4(),_0x6ed0bb,_0x1af416['Location']);})[_0xe988('0x26')](function(_0x501db1){logger[_0xe988('0x68')](util['format'](_0xe988('0x78'),_0x425557,_0x501db1[_0xe988('0x79')]['TranscriptionJobName']));_0x102d60[_0xe988('0x7a')]=_0x501db1['TranscriptionJob'][_0xe988('0x7b')];_0x102d60[_0xe988('0x7c')]=_0x501db1[_0xe988('0x79')]['TranscriptionJobStatus'];return _0x1f95bf(_0x102d60);})[_0xe988('0x4d')](function(_0x3bdb1c){return _0xa1e109(_0x3bdb1c);});});}exports[_0xe988('0x7d')]=function(_0x1fcd9c,_0x21651b,_0x54b33a){var _0x2696d0;var _0x38ad71;var _0x215a92;var _0x479e37=require(_0xe988('0x52'));return db[_0xe988('0x2e')][_0xe988('0x7e')]({'where':{'id':_0x1fcd9c[_0xe988('0x4b')]['id']}})['then'](function(_0x501321){if(_0x501321){var _0x3d2bdf=util[_0xe988('0x34')](_0xe988('0x55'),_0x501321[_0xe988('0x54')]);if(fs[_0xe988('0x56')](_0x3d2bdf)){cypher=!![];return _0x479e37['decryptFile'](_0x3d2bdf,_0x501321[_0xe988('0x54')],config[_0xe988('0x58')][_0xe988('0x59')])[_0xe988('0x26')](function(){return _0x501321;});}return _0x501321;}})[_0xe988('0x26')](function(_0x471c82){if(!_0x471c82){throw new db[(_0xe988('0x5a'))][(_0xe988('0x7f'))]('Voice\x20Recording\x20not\x20found');}_0x38ad71=_0x471c82;return db['Setting'][_0xe988('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x21651b,null))[_0xe988('0x26')](function(_0x1d8308){if(_0x1d8308){_0x2696d0=_0x1d8308;if(!_0x2696d0[_0xe988('0x80')]||!_0x2696d0[_0xe988('0x81')]||!_0x2696d0[_0xe988('0x82')]||!_0x2696d0['language']||!_0x2696d0[_0xe988('0x76')]){throw new db[(_0xe988('0x5a'))][(_0xe988('0x7f'))]('Transcribe\x20not\x20configured');}if(_0x1fcd9c[_0xe988('0x4f')][_0xe988('0x83')]&&(!_0x2696d0[_0xe988('0x84')]||!_0x2696d0['sentimentAccountId']||!_0x2696d0[_0xe988('0x85')]||!_0x2696d0['language']||!_0x2696d0[_0xe988('0x76')])){throw new db[(_0xe988('0x5a'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xe988('0x7e')]({'where':{'id':_0x2696d0['transcribeAccountId']}});}})[_0xe988('0x26')](function(_0x158276){if(!_0x158276){throw new db['Sequelize'][(_0xe988('0x7f'))](_0xe988('0x86'));}if(!_0x158276[_0xe988('0x87')]||!_0x158276['data2']){throw new db['Sequelize'][(_0xe988('0x7f'))](_0xe988('0x88'));}_0x215a92=_0x158276;return getBucketslist(_0x215a92[_0xe988('0x87')],_0x215a92['data2'],_0x2696d0[_0xe988('0x82')]);})[_0xe988('0x26')](function(_0x4f0d71){if(_0x4f0d71&&_0x4f0d71[_0xe988('0x89')]){var _0x29dc7e=_[_0xe988('0x4c')](_0x4f0d71[_0xe988('0x89')],function(_0x1af53b){return _0x1af53b[_0xe988('0x8a')]===_0x2696d0[_0xe988('0x76')];});if(!_0x29dc7e){logger[_0xe988('0x68')](util[_0xe988('0x34')](_0xe988('0x8b'),_0x1fcd9c[_0xe988('0x4b')]['id'],_0x2696d0['bucket']));return createBucket(_0x215a92['data1'],_0x215a92[_0xe988('0x8c')],_0x2696d0['transcribeRegion'],_0x2696d0[_0xe988('0x76')]);}logger[_0xe988('0x68')](util[_0xe988('0x34')](_0xe988('0x8d'),_0x1fcd9c['params']['id'],_0x2696d0[_0xe988('0x76')]));return;}})[_0xe988('0x26')](function(_0x44bc61){if(_0x38ad71[_0xe988('0x7c')]===_0xe988('0x8e')){return transcribe(_0x1fcd9c['params']['id'],_0x215a92[_0xe988('0x87')],_0x215a92[_0xe988('0x8c')],_0x2696d0[_0xe988('0x82')],_0x2696d0[_0xe988('0x76')],_0x38ad71['value'],_0x2696d0['language']);}else{logger['info'](util['format'](_0xe988('0x8f'),_0x1fcd9c['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xe988('0x26')](function(_0x470cf4){if(_0x470cf4){_0x470cf4['tempSentiment']=_0x1fcd9c[_0xe988('0x4f')][_0xe988('0x83')];return _0x38ad71['updateAttributes'](_0x470cf4);}})[_0xe988('0x26')](respondWithResult(_0x21651b,null))[_0xe988('0x4d')](handleError(_0x21651b,null));};function writeFile(_0x162516,_0x3b3997){return new Promise(function(_0x1e4de6,_0x3a33fb){fs[_0xe988('0x90')](_0x3b3997,_0x162516,function(_0xa66fa,_0x46ccc1){if(_0xa66fa){return _0x3a33fb(_0xa66fa);}else{return _0x1e4de6(_0x46ccc1);}});});}exports[_0xe988('0x91')]=function(_0x267f38,_0x3c4565,_0x3ff5c8){return db[_0xe988('0x2e')][_0xe988('0x7e')]({'where':{'id':_0x267f38[_0xe988('0x4b')]['id']}})[_0xe988('0x26')](handleEntityNotFound(_0x3c4565))[_0xe988('0x26')](function(_0x3f5f54){if(_0x3f5f54&&_0x3f5f54[_0xe988('0x92')]){var _0x55e11c=_0x3f5f54[_0xe988('0x92')];var _0x2708fb=config[_0xe988('0x93')]+_0xe988('0x94')+_0x3f5f54['id']+_0xe988('0x95');if(fs['existsSync'](_0x2708fb)){return _0x2708fb;}return writeFile(_0x55e11c,_0x2708fb)[_0xe988('0x26')](function(){return _0x2708fb;});}else{throw new db[(_0xe988('0x5a'))]['ValidationError'](_0xe988('0x96'));}})[_0xe988('0x26')](function(_0x7534a3){return _0x3c4565[_0xe988('0x51')](_0x7534a3);})['catch'](handleError(_0x3c4565));}; \ No newline at end of file +var _0x66ab=['json','count','offset','limit','set','Content-Range','save','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','keys','length','options','find','catch','create','body','update','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','decryptFile','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','ValidationError','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x66ab,0x111));var _0xb66a=function(_0x2fcb38,_0x2a02e0){_0x2fcb38=_0x2fcb38-0x0;var _0x409ab1=_0x66ab[_0x2fcb38];return _0x409ab1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb66a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb66a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb66a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb66a('0x3'));var util=require(_0xb66a('0x4'));var path=require(_0xb66a('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb66a('0x6'));var fs=require('fs');var _=require(_0xb66a('0x7'));var squel=require(_0xb66a('0x8'));var crypto=require(_0xb66a('0x9'));var jsforce=require(_0xb66a('0xa'));var deskjs=require(_0xb66a('0xb'));var toCsv=require(_0xb66a('0xc'));var querystring=require(_0xb66a('0xd'));var Papa=require(_0xb66a('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0xb66a('0xf'));var Redis=require(_0xb66a('0x10'));var authService=require(_0xb66a('0x11'));var qs=require(_0xb66a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb66a('0x13'))(_0xb66a('0x14'));var utils=require(_0xb66a('0x15'));var config=require(_0xb66a('0x16'));var db=require(_0xb66a('0x17'))['db'];function respondWithStatusCode(_0x5d80e3,_0x4bd42a){_0x4bd42a=_0x4bd42a||0xcc;return function(_0x1ea718){if(_0x1ea718){return _0x5d80e3[_0xb66a('0x18')](_0x4bd42a);}return _0x5d80e3[_0xb66a('0x19')](_0x4bd42a)[_0xb66a('0x1a')]();};}function respondWithResult(_0x26937c,_0x3be7d5){_0x3be7d5=_0x3be7d5||0xc8;return function(_0x389cbd){if(_0x389cbd){return _0x26937c[_0xb66a('0x19')](_0x3be7d5)[_0xb66a('0x1b')](_0x389cbd);}};}function respondWithFilteredResult(_0x28cf65,_0x3d97df){return function(_0x301dc9){if(_0x301dc9){var _0x431346=_0x301dc9[_0xb66a('0x1c')],_0x1297f3=_0x3d97df[_0xb66a('0x1d')],_0x5caa70=_0x3d97df[_0xb66a('0x1d')]+_0x3d97df[_0xb66a('0x1e')],_0x3ca1d1;if(_0x5caa70>=_0x431346){_0x5caa70=_0x431346;_0x3ca1d1=0xc8;}else{_0x3ca1d1=0xce;}_0x28cf65[_0xb66a('0x19')](_0x3ca1d1);return _0x28cf65[_0xb66a('0x1f')](_0xb66a('0x20'),_0x1297f3+'-'+_0x5caa70+'/'+_0x431346)['json'](_0x301dc9);}return null;};}function patchUpdates(_0x27b557){return function(_0x47dfa4){try{jsonpatch['apply'](_0x47dfa4,_0x27b557,!![]);}catch(_0x18705c){return BPromise['reject'](_0x18705c);}return _0x47dfa4[_0xb66a('0x21')]();};}function saveUpdates(_0x413677,_0x3abf8d){return function(_0x1188e6){if(_0x1188e6){return _0x1188e6['update'](_0x413677)[_0xb66a('0x22')](function(_0x57d3db){return _0x57d3db;});}return null;};}function removeEntity(_0x45a3e7,_0x42052d){return function(_0x1ba7de){if(_0x1ba7de){return _0x1ba7de[_0xb66a('0x23')]()['then'](function(){_0x45a3e7[_0xb66a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x225a71,_0x3f675b){return function(_0x5688bd){if(!_0x5688bd){_0x225a71[_0xb66a('0x18')](0x194);}return _0x5688bd;};}function handleError(_0xd283cc,_0x9d678b){_0x9d678b=_0x9d678b||0x1f4;return function(_0x39692a){logger[_0xb66a('0x24')](_0x39692a['stack']);if(_0x39692a['name']){delete _0x39692a[_0xb66a('0x25')];}_0xd283cc[_0xb66a('0x19')](_0x9d678b)[_0xb66a('0x26')](_0x39692a);};}exports[_0xb66a('0x27')]=function(_0x756336,_0x4643b9){var _0x3a8d7f={},_0x5b9d60={},_0x24df88={'count':0x0,'rows':[]};var _0x4fa1e2=_[_0xb66a('0x28')](db[_0xb66a('0x29')][_0xb66a('0x2a')],function(_0xcd9c62){return{'name':_0xcd9c62[_0xb66a('0x2b')],'type':_0xcd9c62[_0xb66a('0x2c')][_0xb66a('0x2d')]};});_0x5b9d60['model']=_[_0xb66a('0x2e')](_[_0xb66a('0x28')](_0x4fa1e2,_0xb66a('0x25')),['format']);_0x5b9d60[_0xb66a('0x2f')]=_['keys'](_0x756336[_0xb66a('0x2f')]);_0x5b9d60[_0xb66a('0x30')]=_[_0xb66a('0x31')](_0x5b9d60['model'],_0x5b9d60['query']);_0x3a8d7f[_0xb66a('0x32')]=_[_0xb66a('0x31')](_0x5b9d60[_0xb66a('0x33')],qs[_0xb66a('0x34')](_0x756336[_0xb66a('0x2f')]['fields']));_0x3a8d7f[_0xb66a('0x32')]=_0x3a8d7f[_0xb66a('0x32')]['length']?_0x3a8d7f[_0xb66a('0x32')]:_0x5b9d60[_0xb66a('0x33')];if(!_0x756336[_0xb66a('0x2f')][_0xb66a('0x35')]('nolimit')){_0x3a8d7f[_0xb66a('0x1e')]=qs[_0xb66a('0x1e')](_0x756336[_0xb66a('0x2f')]['limit']);_0x3a8d7f[_0xb66a('0x1d')]=qs[_0xb66a('0x1d')](_0x756336[_0xb66a('0x2f')][_0xb66a('0x1d')]);}_0x3a8d7f[_0xb66a('0x36')]=qs[_0xb66a('0x37')](_0x756336[_0xb66a('0x2f')]['sort']);_0x3a8d7f[_0xb66a('0x38')]=qs[_0xb66a('0x30')](_[_0xb66a('0x39')](_0x756336[_0xb66a('0x2f')],_0x5b9d60[_0xb66a('0x30')]),_0x4fa1e2);if(_0x756336[_0xb66a('0x2f')][_0xb66a('0x3a')]){_0x3a8d7f[_0xb66a('0x38')]=_['merge'](_0x3a8d7f[_0xb66a('0x38')],{'$or':_[_0xb66a('0x28')](_0x4fa1e2,function(_0x272cc3){if(_0x272cc3[_0xb66a('0x2c')]!=='VIRTUAL'){var _0x41d760={};_0x41d760[_0x272cc3[_0xb66a('0x25')]]={'$like':'%'+_0x756336[_0xb66a('0x2f')]['filter']+'%'};return _0x41d760;}})});}_0x3a8d7f=_[_0xb66a('0x3b')]({},_0x3a8d7f,_0x756336['options']);var _0x5c3dd5={'where':_0x3a8d7f[_0xb66a('0x38')]};return db[_0xb66a('0x29')]['count'](_0x5c3dd5)['then'](function(_0x5553e2){_0x24df88['count']=_0x5553e2;if(_0x756336[_0xb66a('0x2f')][_0xb66a('0x3c')]){_0x3a8d7f[_0xb66a('0x3d')]=[{'all':!![]}];}return db[_0xb66a('0x29')][_0xb66a('0x3e')](_0x3a8d7f);})[_0xb66a('0x22')](function(_0x1efdba){_0x24df88[_0xb66a('0x3f')]=_0x1efdba;return _0x24df88;})[_0xb66a('0x22')](respondWithFilteredResult(_0x4643b9,_0x3a8d7f))['catch'](handleError(_0x4643b9,null));};exports['show']=function(_0x8d773,_0x1b047c){var _0x3d16d2={'raw':![],'where':{'id':_0x8d773[_0xb66a('0x40')]['id']}},_0x23652f={};_0x23652f[_0xb66a('0x33')]=_['keys'](db[_0xb66a('0x29')]['rawAttributes']);_0x23652f[_0xb66a('0x2f')]=_[_0xb66a('0x41')](_0x8d773[_0xb66a('0x2f')]);_0x23652f['filters']=_['intersection'](_0x23652f['model'],_0x23652f[_0xb66a('0x2f')]);_0x3d16d2[_0xb66a('0x32')]=_[_0xb66a('0x31')](_0x23652f[_0xb66a('0x33')],qs[_0xb66a('0x34')](_0x8d773['query'][_0xb66a('0x34')]));_0x3d16d2['attributes']=_0x3d16d2[_0xb66a('0x32')][_0xb66a('0x42')]?_0x3d16d2[_0xb66a('0x32')]:_0x23652f['model'];if(_0x8d773[_0xb66a('0x2f')][_0xb66a('0x3c')]){_0x3d16d2[_0xb66a('0x3d')]=[{'all':!![]}];}_0x3d16d2=_[_0xb66a('0x3b')]({},_0x3d16d2,_0x8d773[_0xb66a('0x43')]);return db[_0xb66a('0x29')][_0xb66a('0x44')](_0x3d16d2)[_0xb66a('0x22')](handleEntityNotFound(_0x1b047c,null))['then'](respondWithResult(_0x1b047c,null))[_0xb66a('0x45')](handleError(_0x1b047c,null));};exports[_0xb66a('0x46')]=function(_0x533e4e,_0x1c3c0b){return db[_0xb66a('0x29')][_0xb66a('0x46')](_0x533e4e[_0xb66a('0x47')],{})[_0xb66a('0x22')](respondWithResult(_0x1c3c0b,0xc9))['catch'](handleError(_0x1c3c0b,null));};exports[_0xb66a('0x48')]=function(_0x16a3fc,_0x405b2f){if(_0x16a3fc[_0xb66a('0x47')]['id']){delete _0x16a3fc[_0xb66a('0x47')]['id'];}return db['VoiceRecording'][_0xb66a('0x44')]({'where':{'id':_0x16a3fc[_0xb66a('0x40')]['id']}})[_0xb66a('0x22')](handleEntityNotFound(_0x405b2f,null))[_0xb66a('0x22')](saveUpdates(_0x16a3fc[_0xb66a('0x47')],null))[_0xb66a('0x22')](respondWithResult(_0x405b2f,null))[_0xb66a('0x45')](handleError(_0x405b2f,null));};exports[_0xb66a('0x49')]=function(_0x10e223,_0x4969af){return db[_0xb66a('0x29')][_0xb66a('0x49')]()['then'](respondWithResult(_0x4969af,null))[_0xb66a('0x45')](handleError(_0x4969af,null));};exports[_0xb66a('0x4a')]=function(_0x27e616,_0x4972bb,_0x2d7b77){var _0x40668a=require(_0xb66a('0x4b'));var _0x1c3273=![];var _0x12a292={};if(_0x27e616[_0xb66a('0x2f')]['type']&&_0x27e616[_0xb66a('0x2f')][_0xb66a('0x2c')]==='uniqueid'){_0x12a292[_0xb66a('0x4c')]=_0x27e616['params']['id'];}else{_0x12a292['id']=_0x27e616['params']['id'];}return db[_0xb66a('0x29')][_0xb66a('0x44')]({'where':_0x12a292,'attributes':['id',_0xb66a('0x4d')],'raw':!![]})[_0xb66a('0x22')](handleEntityNotFound(_0x4972bb,null))[_0xb66a('0x22')](function(_0x5577c1){if(_0x5577c1){var _0x4bebcc=_0x5577c1['value'];var _0x32bf34=util[_0xb66a('0x4e')]('%s.cypher',_0x4bebcc);if(fs[_0xb66a('0x4f')](_0x32bf34)){_0x1c3273=!![];return _0x40668a['decryptFile'](_0x32bf34,_0x4bebcc,config[_0xb66a('0x50')][_0xb66a('0x51')])[_0xb66a('0x22')](function(){return _0x5577c1;});}return _0x5577c1;}})['then'](function(_0xa20baa){if(_0xa20baa){var _0x50a5df=_0xa20baa[_0xb66a('0x4d')];if(!fs['existsSync'](_0x50a5df)){throw new db[(_0xb66a('0x52'))]['ValidationError'](_0xb66a('0x53'));}if(_0xa20baa['filename']){return _0x4972bb[_0xb66a('0x4a')](_0x50a5df,_0xa20baa[_0xb66a('0x54')]+path[_0xb66a('0x55')](_0x50a5df),function(){if(_0x1c3273){fs[_0xb66a('0x56')](_0x50a5df);}});}else{return _0x4972bb[_0xb66a('0x4a')](_0x50a5df,function(_0x339ab0){if(_0x1c3273){fs[_0xb66a('0x56')](_0x50a5df);}});}}})[_0xb66a('0x45')](function(_0x6bec37){if(_0x6bec37['message']==='VoiceRecording\x20not\x20found'){_0x4972bb[_0xb66a('0x19')](0x194)[_0xb66a('0x26')]('Not\x20found');}else{return handleError(_0x4972bb,null);}});};exports[_0xb66a('0x57')]=function(_0x428aa3,_0x2537e5,_0x53c00a){var _0x17e824=require(_0xb66a('0x4b'));var _0x16c8b2=![];var _0x3ff483={'$and':[db[_0xb66a('0x58')]['where'](db[_0xb66a('0x58')]['fn'](_0xb66a('0x59'),db[_0xb66a('0x58')][_0xb66a('0x5a')](_0xb66a('0x4c'))),_0x428aa3[_0xb66a('0x2f')][_0xb66a('0x5b')])]};if(_0x428aa3[_0xb66a('0x2f')][_0xb66a('0x2c')]&&_0x428aa3[_0xb66a('0x2f')][_0xb66a('0x2c')]===_0xb66a('0x4c')){_0x3ff483[_0xb66a('0x5c')][_0xb66a('0x5d')]({'uniqueid':_0x428aa3[_0xb66a('0x40')]['id']});}else{_0x3ff483['$and']['push']({'id':_0x428aa3[_0xb66a('0x40')]['id']});}return db['VoiceRecording'][_0xb66a('0x44')]({'where':_0x3ff483,'attributes':['id',_0xb66a('0x4d')],'raw':!![]})[_0xb66a('0x22')](handleEntityNotFound(_0x2537e5,null))['then'](function(_0x513e15){if(_0x513e15){var _0x26eb72=util[_0xb66a('0x4e')](_0xb66a('0x5e'),_0x513e15[_0xb66a('0x4d')]);if(fs[_0xb66a('0x4f')](_0x26eb72)){_0x16c8b2=!![];return _0x17e824[_0xb66a('0x5f')](_0x26eb72,_0x513e15['value'],config['secrets'][_0xb66a('0x51')])[_0xb66a('0x22')](function(){return _0x513e15;});}return _0x513e15;}})[_0xb66a('0x22')](function(_0x2a0195){if(_0x2a0195){if(!fs[_0xb66a('0x4f')](_0x2a0195[_0xb66a('0x4d')])){throw new db[(_0xb66a('0x52'))]['ValidationError'](_0xb66a('0x53'));}if(_0x2a0195[_0xb66a('0x54')]){return _0x2537e5[_0xb66a('0x4a')](_0x2a0195[_0xb66a('0x4d')],_0x2a0195[_0xb66a('0x54')]+path[_0xb66a('0x55')](_0x2a0195[_0xb66a('0x4d')]),function(){if(_0x16c8b2){fs[_0xb66a('0x56')](_0x2a0195['value']);}});}else{return _0x2537e5[_0xb66a('0x4a')](_0x2a0195[_0xb66a('0x4d')],function(_0x2a621a){if(_0x16c8b2){fs[_0xb66a('0x56')](_0x2a0195[_0xb66a('0x4d')]);}});}}})[_0xb66a('0x45')](handleError(_0x2537e5,null));};exports[_0xb66a('0x23')]=function(_0x2de16e,_0x12e94f){return db[_0xb66a('0x29')][_0xb66a('0x44')]({'where':{'id':_0x2de16e[_0xb66a('0x40')]['id']}})['then'](function(_0x1a7560){if(!_0x1a7560)throw new ReferenceError(_0xb66a('0x60'));return _0x1a7560;})[_0xb66a('0x22')](function(_0x4d3d40){var _0x2612fa=_0x4d3d40['value'];logger[_0xb66a('0x61')](_0xb66a('0x62'),_0x2612fa);if(!_[_0xb66a('0x63')](_0x4d3d40[_0xb66a('0x4d')])&&fs['existsSync'](_0x2612fa)){logger[_0xb66a('0x61')](_0xb66a('0x64')+_0x2612fa+_0xb66a('0x65'));fs[_0xb66a('0x66')](_0x2612fa);}_0x2612fa=_0x2612fa+'.cypher';if(!_[_0xb66a('0x63')](_0x4d3d40[_0xb66a('0x4d')])&&fs['existsSync'](_0x2612fa)){logger[_0xb66a('0x61')](_0xb66a('0x64')+_0x2612fa+_0xb66a('0x65'));fs[_0xb66a('0x66')](_0x2612fa);}return _0x4d3d40;})[_0xb66a('0x22')](function(_0x5d9316){if(!_0x5d9316)throw new InternalError();return _0x5d9316[_0xb66a('0x23')]();})[_0xb66a('0x22')](function(){_0x12e94f[_0xb66a('0x19')](0xcc)[_0xb66a('0x1a')]();})[_0xb66a('0x45')](handleError(_0x12e94f,null));};function getBucketslist(_0x16fff6,_0x199ec2,_0x3396e8){return new Promise(function(_0x68f16,_0x27c3d3){var _0xb71d14=new AWS['S3']({'accessKeyId':_0x199ec2,'secretAccessKey':_0x16fff6,'region':_0x3396e8});_0xb71d14[_0xb66a('0x67')]({},function(_0x2a036b,_0x2f2bfd){if(_0x2a036b){return _0x27c3d3(_0x2a036b);}else{return _0x68f16(_0x2f2bfd);}});});}function createBucket(_0x296202,_0x2d683a,_0x44251a,_0x4094fb){return new Promise(function(_0x44f7ad,_0x2ef012){var _0x219e4f=new AWS['S3']({'accessKeyId':_0x2d683a,'secretAccessKey':_0x296202,'region':_0x44251a});_0x219e4f[_0xb66a('0x68')]({'Bucket':_0x4094fb},function(_0x1d5345,_0x3aa1bd){if(_0x1d5345){return _0x2ef012(_0x1d5345);}else{return _0x44f7ad(_0x3aa1bd);}});});}function uploadFile(_0x2c721d,_0x4e818e,_0x4b1e70,_0x597bce,_0x26d9f9,_0x308c94){return new Promise(function(_0x2f15ca,_0x9676cd){var _0x3f8ca5=new AWS['S3']({'accessKeyId':_0x4e818e,'secretAccessKey':_0x2c721d,'region':_0x4b1e70});_0x3f8ca5[_0xb66a('0x69')]({'Bucket':_0x597bce,'Key':_0x26d9f9,'Body':_0x308c94},function(_0x65570d,_0xc00367){if(_0x65570d){return _0x9676cd(_0x65570d);}else{return _0x2f15ca(_0xc00367);}});});}function startTranscribe(_0x2522c0,_0x3a7bcf,_0x4de143,_0x124d45,_0x489f0f,_0x40a228){return new Promise(function(_0x3e015a,_0x1cadb0){var _0x5677c2=new AWS['TranscribeService']({'accessKeyId':_0x3a7bcf,'secretAccessKey':_0x2522c0,'region':_0x4de143});_0x5677c2['startTranscriptionJob']({'TranscriptionJobName':_0x124d45,'LanguageCode':_0x489f0f,'Media':{'MediaFileUri':_0x40a228}},function(_0x167bdf,_0x36221a){if(_0x167bdf){return _0x1cadb0(_0x167bdf);}else{return _0x3e015a(_0x36221a);}});});}function transcribe(_0x35b126,_0x42a9b9,_0x16e5bc,_0x3e1a9a,_0x2822d5,_0x4f2628,_0xf53f97){return new Promise(function(_0x2eaf2a,_0x299feb){var _0x1aa855={};logger['info'](util[_0xb66a('0x4e')](_0xb66a('0x6a'),_0x35b126,_0x2822d5));return uploadFile(_0x42a9b9,_0x16e5bc,_0x3e1a9a,_0x2822d5,path['basename'](_0x4f2628),fs[_0xb66a('0x6b')](_0x4f2628))[_0xb66a('0x22')](function(_0x4d0181){logger[_0xb66a('0x61')](util[_0xb66a('0x4e')](_0xb66a('0x6c'),_0x35b126,_0x2822d5,_0x4d0181[_0xb66a('0x6d')]));_0x1aa855[_0xb66a('0x6e')]=_0x4d0181['Bucket'];_0x1aa855[_0xb66a('0x6f')]=_0x4d0181['Location'];logger[_0xb66a('0x61')](util[_0xb66a('0x4e')](_0xb66a('0x70'),_0x35b126));return startTranscribe(_0x42a9b9,_0x16e5bc,_0x3e1a9a,uuidv4(),_0xf53f97,_0x4d0181[_0xb66a('0x6d')]);})[_0xb66a('0x22')](function(_0x486e4f){logger[_0xb66a('0x61')](util[_0xb66a('0x4e')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x35b126,_0x486e4f[_0xb66a('0x71')][_0xb66a('0x72')]));_0x1aa855[_0xb66a('0x73')]=_0x486e4f[_0xb66a('0x71')][_0xb66a('0x72')];_0x1aa855[_0xb66a('0x74')]=_0x486e4f[_0xb66a('0x71')][_0xb66a('0x75')];return _0x2eaf2a(_0x1aa855);})[_0xb66a('0x45')](function(_0x210b9d){return _0x299feb(_0x210b9d);});});}exports[_0xb66a('0x76')]=function(_0x4fe9ff,_0x22d0b3,_0xd64447){var _0x30480c;var _0x2db981;var _0x502d70;var _0x106a3c=require(_0xb66a('0x4b'));return db[_0xb66a('0x29')][_0xb66a('0x77')]({'where':{'id':_0x4fe9ff[_0xb66a('0x40')]['id']}})['then'](function(_0x1b8ba9){if(_0x1b8ba9){var _0x253ea0=util['format'](_0xb66a('0x5e'),_0x1b8ba9[_0xb66a('0x4d')]);if(fs['existsSync'](_0x253ea0)){cypher=!![];return _0x106a3c[_0xb66a('0x5f')](_0x253ea0,_0x1b8ba9[_0xb66a('0x4d')],config[_0xb66a('0x50')][_0xb66a('0x51')])['then'](function(){return _0x1b8ba9;});}return _0x1b8ba9;}})['then'](function(_0x19b2ad){if(!_0x19b2ad){throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))]('Voice\x20Recording\x20not\x20found');}_0x2db981=_0x19b2ad;return db[_0xb66a('0x79')]['findOne']({'where':{'id':0x1}});})[_0xb66a('0x22')](handleEntityNotFound(_0x22d0b3,null))[_0xb66a('0x22')](function(_0x14bec6){if(_0x14bec6){_0x30480c=_0x14bec6;if(!_0x30480c[_0xb66a('0x7a')]||!_0x30480c[_0xb66a('0x7b')]||!_0x30480c[_0xb66a('0x7c')]||!_0x30480c[_0xb66a('0x7d')]||!_0x30480c[_0xb66a('0x6e')]){throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))](_0xb66a('0x7e'));}if(_0x4fe9ff['body'][_0xb66a('0x7f')]&&(!_0x30480c[_0xb66a('0x80')]||!_0x30480c[_0xb66a('0x81')]||!_0x30480c[_0xb66a('0x82')]||!_0x30480c[_0xb66a('0x7d')]||!_0x30480c[_0xb66a('0x6e')])){throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))](_0xb66a('0x83'));}return db[_0xb66a('0x84')][_0xb66a('0x77')]({'where':{'id':_0x30480c[_0xb66a('0x7b')]}});}})['then'](function(_0x3b3f85){if(!_0x3b3f85){throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))](_0xb66a('0x85'));}if(!_0x3b3f85[_0xb66a('0x86')]||!_0x3b3f85[_0xb66a('0x87')]){throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))](_0xb66a('0x88'));}_0x502d70=_0x3b3f85;return getBucketslist(_0x502d70['data1'],_0x502d70['data2'],_0x30480c[_0xb66a('0x7c')]);})[_0xb66a('0x22')](function(_0x169aca){if(_0x169aca&&_0x169aca['Buckets']){var _0x540042=_[_0xb66a('0x44')](_0x169aca[_0xb66a('0x89')],function(_0xa7ffb){return _0xa7ffb[_0xb66a('0x8a')]===_0x30480c['bucket'];});if(!_0x540042){logger[_0xb66a('0x61')](util[_0xb66a('0x4e')](_0xb66a('0x8b'),_0x4fe9ff['params']['id'],_0x30480c[_0xb66a('0x6e')]));return createBucket(_0x502d70[_0xb66a('0x86')],_0x502d70[_0xb66a('0x87')],_0x30480c[_0xb66a('0x7c')],_0x30480c[_0xb66a('0x6e')]);}logger[_0xb66a('0x61')](util[_0xb66a('0x4e')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4fe9ff['params']['id'],_0x30480c[_0xb66a('0x6e')]));return;}})[_0xb66a('0x22')](function(_0x4c1a74){if(_0x2db981[_0xb66a('0x74')]==='NEW'){return transcribe(_0x4fe9ff[_0xb66a('0x40')]['id'],_0x502d70[_0xb66a('0x86')],_0x502d70[_0xb66a('0x87')],_0x30480c['transcribeRegion'],_0x30480c[_0xb66a('0x6e')],_0x2db981[_0xb66a('0x4d')],_0x30480c[_0xb66a('0x7d')]);}else{logger[_0xb66a('0x61')](util[_0xb66a('0x4e')](_0xb66a('0x8c'),_0x4fe9ff['params']['id']));return{'transcribeStatus':_0xb66a('0x8d')};}})[_0xb66a('0x22')](function(_0x52ad98){if(_0x52ad98){_0x52ad98[_0xb66a('0x8e')]=_0x4fe9ff['body']['runSentiment'];return _0x2db981['updateAttributes'](_0x52ad98);}})[_0xb66a('0x22')](respondWithResult(_0x22d0b3,null))[_0xb66a('0x45')](handleError(_0x22d0b3,null));};function writeFile(_0x15a8c2,_0x35af1e){return new Promise(function(_0x2c0a30,_0x297d80){fs[_0xb66a('0x8f')](_0x35af1e,_0x15a8c2,function(_0x4e01ae,_0x3df214){if(_0x4e01ae){return _0x297d80(_0x4e01ae);}else{return _0x2c0a30(_0x3df214);}});});}exports[_0xb66a('0x90')]=function(_0x42c049,_0x4f7080,_0x18b54d){return db[_0xb66a('0x29')][_0xb66a('0x77')]({'where':{'id':_0x42c049[_0xb66a('0x40')]['id']}})['then'](handleEntityNotFound(_0x4f7080))['then'](function(_0x34ea9e){if(_0x34ea9e&&_0x34ea9e[_0xb66a('0x91')]){var _0x590aea=_0x34ea9e[_0xb66a('0x91')];var _0x201482=config[_0xb66a('0x92')]+_0xb66a('0x93')+_0x34ea9e['id']+_0xb66a('0x94');if(fs['existsSync'](_0x201482)){return _0x201482;}return writeFile(_0x590aea,_0x201482)[_0xb66a('0x22')](function(){return _0x201482;});}else{throw new db[(_0xb66a('0x52'))][(_0xb66a('0x78'))](_0xb66a('0x95'));}})[_0xb66a('0x22')](function(_0x1977a7){return _0x4f7080[_0xb66a('0x4a')](_0x1977a7);})[_0xb66a('0x45')](handleError(_0x4f7080));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 68c4a9d..a9d62ec 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 _0x2ab3=['../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x47298a,_0x1e1946){var _0x4ae29a=function(_0x2e02a9){while(--_0x2e02a9){_0x47298a['push'](_0x47298a['shift']());}};_0x4ae29a(++_0x1e1946);}(_0x2ab3,0xbc));var _0x32ab=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x2ab3[_0x41d432];return _0x1650f9;};'use strict';var _=require('lodash');var util=require(_0x32ab('0x0'));var logger=require(_0x32ab('0x1'))('api');var moment=require(_0x32ab('0x2'));var BPromise=require(_0x32ab('0x3'));var rp=require(_0x32ab('0x4'));var fs=require('fs');var path=require(_0x32ab('0x5'));var rimraf=require(_0x32ab('0x6'));var config=require(_0x32ab('0x7'));var attributes=require(_0x32ab('0x8'));module['exports']=function(_0x39908b,_0x42826c){return _0x39908b[_0x32ab('0x9')](_0x32ab('0xa'),attributes,{'tableName':_0x32ab('0xb'),'paranoid':![],'indexes':[{'name':_0x32ab('0xc'),'fields':[_0x32ab('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ca1=['../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x13fabf,_0x554b3a){var _0x35e697=function(_0x1d160){while(--_0x1d160){_0x13fabf['push'](_0x13fabf['shift']());}};_0x35e697(++_0x554b3a);}(_0x1ca1,0x14b));var _0x11ca=function(_0x386f13,_0x33d758){_0x386f13=_0x386f13-0x0;var _0x3008ee=_0x1ca1[_0x386f13];return _0x3008ee;};'use strict';var _=require('lodash');var util=require(_0x11ca('0x0'));var logger=require(_0x11ca('0x1'))(_0x11ca('0x2'));var moment=require(_0x11ca('0x3'));var BPromise=require(_0x11ca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11ca('0x5'));var rimraf=require(_0x11ca('0x6'));var config=require(_0x11ca('0x7'));var attributes=require(_0x11ca('0x8'));module[_0x11ca('0x9')]=function(_0x3c5660,_0x300661){return _0x3c5660[_0x11ca('0xa')]('VoiceRecording',attributes,{'tableName':_0x11ca('0xb'),'paranoid':![],'indexes':[{'name':_0x11ca('0xc'),'fields':[_0x11ca('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 6dee6c3..450f8d1 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(_0x2ecf03,_0x2adccf){var _0x4418ab=function(_0x201f87){while(--_0x201f87){_0x2ecf03['push'](_0x2ecf03['shift']());}};_0x4418ab(++_0x2adccf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 ab016f0..a0f4188 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x1db0c1,_0x16ff01){var _0x298160=function(_0x35a788){while(--_0x35a788){_0x1db0c1['push'](_0x1db0c1['shift']());}};_0x298160(++_0x16ff01);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file +var _0xb4c7=['create','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/:id','show','post'];(function(_0x30cd67,_0x20f84e){var _0x3bb0a4=function(_0x680771){while(--_0x680771){_0x30cd67['push'](_0x30cd67['shift']());}};_0x3bb0a4(++_0x20f84e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5cb6bd,_0x542d5d){_0x5cb6bd=_0x5cb6bd-0x0;var _0x3d4281=_0xb4c7[_0x5cb6bd];return _0x3d4281;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var auth=require(_0x7b4c('0x5'));var interaction=require(_0x7b4c('0x6'));var config=require(_0x7b4c('0x7'));var controller=require(_0x7b4c('0x8'));router[_0x7b4c('0x9')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xa')]);router[_0x7b4c('0x9')](_0x7b4c('0xb'),auth['isAuthenticated'](),controller[_0x7b4c('0xc')]);router[_0x7b4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xb'),auth[_0x7b4c('0x10')](),controller[_0x7b4c('0x13')]);module[_0x7b4c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d771c17..cb6b839 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 _0x7c0d=['moment','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x163b98,_0x587d17){var _0x9824cf=function(_0x248347){while(--_0x248347){_0x163b98['push'](_0x163b98['shift']());}};_0x9824cf(++_0x587d17);}(_0x7c0d,0x14f));var _0xd7c0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7c0d[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xd7c0('0x0'));var moment=require(_0xd7c0('0x1'));module['exports']={'type':{'type':Sequelize[_0xd7c0('0x2')](_0xd7c0('0x3'),_0xd7c0('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd7c0('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xd7c0('0x5')]},'transferercalleridname':{'type':Sequelize[_0xd7c0('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd7c0('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xd7c0('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xd7c0('0x5')]},'transferercontext':{'type':Sequelize[_0xd7c0('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xd7c0('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd7c0('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xd7c0('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd7c0('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xd7c0('0x5')]},'transfereecontext':{'type':Sequelize[_0xd7c0('0x5')]},'transfereeexten':{'type':Sequelize[_0xd7c0('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xd7c0('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xd7c0('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x320e=['STRING','Yes','moment','ENUM','blind'];(function(_0x3cad22,_0x3f8ef){var _0xb8250f=function(_0x47c80c){while(--_0x47c80c){_0x3cad22['push'](_0x3cad22['shift']());}};_0xb8250f(++_0x3f8ef);}(_0x320e,0xc5));var _0xe320=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0x320e[_0x151334];return _0x3d03da;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe320('0x0'));module['exports']={'type':{'type':Sequelize[_0xe320('0x1')](_0xe320('0x2'),'attended')},'result':{'type':Sequelize[_0xe320('0x3')]},'transfererchannel':{'type':Sequelize[_0xe320('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xe320('0x3')]},'transferercalleridname':{'type':Sequelize[_0xe320('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe320('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xe320('0x3')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xe320('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xe320('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe320('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe320('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0xe320('0x3')]},'transfereecontext':{'type':Sequelize[_0xe320('0x3')]},'transfereeexten':{'type':Sequelize[_0xe320('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xe320('0x3')]},'isexternal':{'type':Sequelize[_0xe320('0x1')](_0xe320('0x4'),'No')},'context':{'type':Sequelize[_0xe320('0x3')]},'extension':{'type':Sequelize[_0xe320('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8a90cd1..0855bc1 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 _0xab49=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','error','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','name','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring'];(function(_0x4feb7d,_0x2e9487){var _0x382c57=function(_0x42f333){while(--_0x42f333){_0x4feb7d['push'](_0x4feb7d['shift']());}};_0x382c57(++_0x2e9487);}(_0xab49,0x116));var _0x9ab4=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xab49[_0x43b08];return _0x5e05f4;};'use strict';var pdf=require(_0x9ab4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ab4('0x1'));var zipdir=require(_0x9ab4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ab4('0x3'));var moment=require(_0x9ab4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ab4('0x5'));var util=require(_0x9ab4('0x6'));var path=require(_0x9ab4('0x7'));var sox=require('sox');var csv=require(_0x9ab4('0x8'));var ejs=require(_0x9ab4('0x9'));var fs=require('fs');var _=require(_0x9ab4('0xa'));var squel=require(_0x9ab4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9ab4('0xc'));var toCsv=require(_0x9ab4('0x8'));var querystring=require(_0x9ab4('0xd'));var Papa=require(_0x9ab4('0xe'));var Redis=require(_0x9ab4('0xf'));var authService=require(_0x9ab4('0x10'));var qs=require(_0x9ab4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ab4('0x12'));var logger=require(_0x9ab4('0x13'))('api');var utils=require(_0x9ab4('0x14'));var config=require(_0x9ab4('0x15'));var db=require(_0x9ab4('0x16'))['db'];function respondWithStatusCode(_0x371495,_0x57bd16){_0x57bd16=_0x57bd16||0xcc;return function(_0x19d515){if(_0x19d515){return _0x371495[_0x9ab4('0x17')](_0x57bd16);}return _0x371495[_0x9ab4('0x18')](_0x57bd16)['end']();};}function respondWithResult(_0x368259,_0x1083d0){_0x1083d0=_0x1083d0||0xc8;return function(_0x5675ad){if(_0x5675ad){return _0x368259[_0x9ab4('0x18')](_0x1083d0)[_0x9ab4('0x19')](_0x5675ad);}};}function respondWithFilteredResult(_0x7946c5,_0x53fe88){return function(_0xf3cc35){if(_0xf3cc35){var _0x4149d5=_0xf3cc35[_0x9ab4('0x1a')],_0x3193cb=_0x53fe88[_0x9ab4('0x1b')],_0x21e0ad=_0x53fe88['offset']+_0x53fe88[_0x9ab4('0x1c')],_0x32c8c4;if(_0x21e0ad>=_0x4149d5){_0x21e0ad=_0x4149d5;_0x32c8c4=0xc8;}else{_0x32c8c4=0xce;}_0x7946c5[_0x9ab4('0x18')](_0x32c8c4);return _0x7946c5[_0x9ab4('0x1d')](_0x9ab4('0x1e'),_0x3193cb+'-'+_0x21e0ad+'/'+_0x4149d5)['json'](_0xf3cc35);}return null;};}function patchUpdates(_0xe126fb){return function(_0x1cde7e){try{jsonpatch[_0x9ab4('0x1f')](_0x1cde7e,_0xe126fb,!![]);}catch(_0xaffe7){return BPromise[_0x9ab4('0x20')](_0xaffe7);}return _0x1cde7e['save']();};}function saveUpdates(_0x9230a0,_0x2e1faf){return function(_0x2eb064){if(_0x2eb064){return _0x2eb064['update'](_0x9230a0)[_0x9ab4('0x21')](function(_0x5724f0){return _0x5724f0;});}return null;};}function removeEntity(_0x4f05f8,_0x5679bd){return function(_0x40c39e){if(_0x40c39e){return _0x40c39e[_0x9ab4('0x22')]()[_0x9ab4('0x21')](function(){_0x4f05f8[_0x9ab4('0x18')](0xcc)[_0x9ab4('0x23')]();});}};}function handleEntityNotFound(_0x1ee929,_0x172f22){return function(_0x4025ac){if(!_0x4025ac){_0x1ee929[_0x9ab4('0x17')](0x194);}return _0x4025ac;};}function handleError(_0x3ac87f,_0x24f62f){_0x24f62f=_0x24f62f||0x1f4;return function(_0x55b82f){logger[_0x9ab4('0x24')](_0x55b82f['stack']);if(_0x55b82f['name']){delete _0x55b82f['name'];}_0x3ac87f[_0x9ab4('0x18')](_0x24f62f)[_0x9ab4('0x25')](_0x55b82f);};}exports[_0x9ab4('0x26')]=function(_0x2cde5b,_0x40f26e){var _0x4e7a16={},_0x5e0247={},_0x16fda2={'count':0x0,'rows':[]};var _0x37b228=_[_0x9ab4('0x27')](db[_0x9ab4('0x28')][_0x9ab4('0x29')],function(_0x3ae496){return{'name':_0x3ae496[_0x9ab4('0x2a')],'type':_0x3ae496[_0x9ab4('0x2b')][_0x9ab4('0x2c')]};});_0x5e0247[_0x9ab4('0x2d')]=_[_0x9ab4('0x27')](_0x37b228,'name');_0x5e0247['query']=_[_0x9ab4('0x2e')](_0x2cde5b[_0x9ab4('0x2f')]);_0x5e0247[_0x9ab4('0x30')]=_[_0x9ab4('0x31')](_0x5e0247[_0x9ab4('0x2d')],_0x5e0247[_0x9ab4('0x2f')]);_0x4e7a16[_0x9ab4('0x32')]=_[_0x9ab4('0x31')](_0x5e0247['model'],qs[_0x9ab4('0x33')](_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x33')]));_0x4e7a16[_0x9ab4('0x32')]=_0x4e7a16[_0x9ab4('0x32')][_0x9ab4('0x34')]?_0x4e7a16[_0x9ab4('0x32')]:_0x5e0247['model'];if(!_0x2cde5b[_0x9ab4('0x2f')]['hasOwnProperty'](_0x9ab4('0x35'))){_0x4e7a16['limit']=qs['limit'](_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x1c')]);_0x4e7a16[_0x9ab4('0x1b')]=qs[_0x9ab4('0x1b')](_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x1b')]);}_0x4e7a16[_0x9ab4('0x36')]=qs[_0x9ab4('0x37')](_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x37')]);_0x4e7a16['where']=qs[_0x9ab4('0x30')](_[_0x9ab4('0x38')](_0x2cde5b[_0x9ab4('0x2f')],_0x5e0247[_0x9ab4('0x30')]),_0x37b228);if(_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x39')]){_0x4e7a16[_0x9ab4('0x3a')]=_[_0x9ab4('0x3b')](_0x4e7a16[_0x9ab4('0x3a')],{'$or':_[_0x9ab4('0x27')](_0x37b228,function(_0x54f533){if(_0x54f533[_0x9ab4('0x2b')]!==_0x9ab4('0x3c')){var _0x3227f5={};_0x3227f5[_0x54f533[_0x9ab4('0x3d')]]={'$like':'%'+_0x2cde5b['query'][_0x9ab4('0x39')]+'%'};return _0x3227f5;}})});}_0x4e7a16=_[_0x9ab4('0x3b')]({},_0x4e7a16,_0x2cde5b['options']);var _0x1aa970={'where':_0x4e7a16[_0x9ab4('0x3a')]};return db[_0x9ab4('0x28')][_0x9ab4('0x1a')](_0x1aa970)[_0x9ab4('0x21')](function(_0x46b47b){_0x16fda2['count']=_0x46b47b;if(_0x2cde5b[_0x9ab4('0x2f')][_0x9ab4('0x3e')]){_0x4e7a16[_0x9ab4('0x3f')]=[{'all':!![]}];}return db[_0x9ab4('0x28')][_0x9ab4('0x40')](_0x4e7a16);})[_0x9ab4('0x21')](function(_0x50b12c){_0x16fda2[_0x9ab4('0x41')]=_0x50b12c;return _0x16fda2;})[_0x9ab4('0x21')](respondWithFilteredResult(_0x40f26e,_0x4e7a16))[_0x9ab4('0x42')](handleError(_0x40f26e,null));};exports['show']=function(_0xc13591,_0x2527a3){var _0x37615c={'raw':!![],'where':{'id':_0xc13591['params']['id']}},_0x5cbce5={};_0x5cbce5[_0x9ab4('0x2d')]=_[_0x9ab4('0x2e')](db['VoiceTransferReport']['rawAttributes']);_0x5cbce5[_0x9ab4('0x2f')]=_['keys'](_0xc13591['query']);_0x5cbce5['filters']=_[_0x9ab4('0x31')](_0x5cbce5[_0x9ab4('0x2d')],_0x5cbce5[_0x9ab4('0x2f')]);_0x37615c['attributes']=_['intersection'](_0x5cbce5[_0x9ab4('0x2d')],qs[_0x9ab4('0x33')](_0xc13591[_0x9ab4('0x2f')][_0x9ab4('0x33')]));_0x37615c[_0x9ab4('0x32')]=_0x37615c[_0x9ab4('0x32')][_0x9ab4('0x34')]?_0x37615c['attributes']:_0x5cbce5[_0x9ab4('0x2d')];if(_0xc13591[_0x9ab4('0x2f')][_0x9ab4('0x3e')]){_0x37615c[_0x9ab4('0x3f')]=[{'all':!![]}];}_0x37615c=_[_0x9ab4('0x3b')]({},_0x37615c,_0xc13591[_0x9ab4('0x43')]);return db['VoiceTransferReport'][_0x9ab4('0x44')](_0x37615c)[_0x9ab4('0x21')](handleEntityNotFound(_0x2527a3,null))[_0x9ab4('0x21')](respondWithResult(_0x2527a3,null))['catch'](handleError(_0x2527a3,null));};exports[_0x9ab4('0x45')]=function(_0x17f893,_0x2780c7){return db[_0x9ab4('0x28')][_0x9ab4('0x45')](_0x17f893[_0x9ab4('0x46')],{})[_0x9ab4('0x21')](respondWithResult(_0x2780c7,0xc9))['catch'](handleError(_0x2780c7,null));};exports[_0x9ab4('0x47')]=function(_0x159ef7,_0x56f053){if(_0x159ef7[_0x9ab4('0x46')]['id']){delete _0x159ef7[_0x9ab4('0x46')]['id'];}return db[_0x9ab4('0x28')]['find']({'where':{'id':_0x159ef7[_0x9ab4('0x48')]['id']}})[_0x9ab4('0x21')](handleEntityNotFound(_0x56f053,null))['then'](saveUpdates(_0x159ef7[_0x9ab4('0x46')],null))[_0x9ab4('0x21')](respondWithResult(_0x56f053,null))['catch'](handleError(_0x56f053,null));};exports[_0x9ab4('0x22')]=function(_0x555642,_0x2517e1){return db[_0x9ab4('0x28')]['find']({'where':{'id':_0x555642[_0x9ab4('0x48')]['id']}})['then'](handleEntityNotFound(_0x2517e1,null))[_0x9ab4('0x21')](removeEntity(_0x2517e1,null))[_0x9ab4('0x42')](handleError(_0x2517e1,null));}; \ No newline at end of file +var _0x1d29=['end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','index','map','VoiceTransferReport','fieldName','type','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','filters','pick','filter','merge','where','includeAll','include','findAll','rows','params','rawAttributes','keys','length','options','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x29b1d1,_0x5f1982){var _0x1868bd=function(_0x2ac50b){while(--_0x2ac50b){_0x29b1d1['push'](_0x29b1d1['shift']());}};_0x1868bd(++_0x5f1982);}(_0x1d29,0x10b));var _0x91d2=function(_0xf1ceb4,_0x3443e6){_0xf1ceb4=_0xf1ceb4-0x0;var _0x42ed45=_0x1d29[_0xf1ceb4];return _0x42ed45;};'use strict';var pdf=require(_0x91d2('0x0'));var emlformat=require(_0x91d2('0x1'));var rimraf=require(_0x91d2('0x2'));var zipdir=require(_0x91d2('0x3'));var jsonpatch=require(_0x91d2('0x4'));var rp=require(_0x91d2('0x5'));var moment=require(_0x91d2('0x6'));var BPromise=require(_0x91d2('0x7'));var Mustache=require(_0x91d2('0x8'));var util=require(_0x91d2('0x9'));var path=require(_0x91d2('0xa'));var sox=require('sox');var csv=require(_0x91d2('0xb'));var ejs=require(_0x91d2('0xc'));var fs=require('fs');var _=require(_0x91d2('0xd'));var squel=require(_0x91d2('0xe'));var crypto=require(_0x91d2('0xf'));var jsforce=require(_0x91d2('0x10'));var deskjs=require(_0x91d2('0x11'));var toCsv=require(_0x91d2('0xb'));var querystring=require(_0x91d2('0x12'));var Papa=require(_0x91d2('0x13'));var Redis=require(_0x91d2('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x91d2('0x15'));var as=require(_0x91d2('0x16'));var hardwareService=require(_0x91d2('0x17'));var logger=require('../../config/logger')(_0x91d2('0x18'));var utils=require(_0x91d2('0x19'));var config=require('../../config/environment');var db=require(_0x91d2('0x1a'))['db'];function respondWithStatusCode(_0x5a5b01,_0x3ae9b9){_0x3ae9b9=_0x3ae9b9||0xcc;return function(_0x36173f){if(_0x36173f){return _0x5a5b01[_0x91d2('0x1b')](_0x3ae9b9);}return _0x5a5b01[_0x91d2('0x1c')](_0x3ae9b9)[_0x91d2('0x1d')]();};}function respondWithResult(_0x4e0561,_0x3f18eb){_0x3f18eb=_0x3f18eb||0xc8;return function(_0x75dded){if(_0x75dded){return _0x4e0561['status'](_0x3f18eb)[_0x91d2('0x1e')](_0x75dded);}};}function respondWithFilteredResult(_0x34efce,_0x1acf88){return function(_0x1152e1){if(_0x1152e1){var _0x35265b=_0x1152e1[_0x91d2('0x1f')],_0x2e1d95=_0x1acf88[_0x91d2('0x20')],_0x5ea4c0=_0x1acf88[_0x91d2('0x20')]+_0x1acf88[_0x91d2('0x21')],_0x24a62b;if(_0x5ea4c0>=_0x35265b){_0x5ea4c0=_0x35265b;_0x24a62b=0xc8;}else{_0x24a62b=0xce;}_0x34efce[_0x91d2('0x1c')](_0x24a62b);return _0x34efce[_0x91d2('0x22')](_0x91d2('0x23'),_0x2e1d95+'-'+_0x5ea4c0+'/'+_0x35265b)[_0x91d2('0x1e')](_0x1152e1);}return null;};}function patchUpdates(_0x40c30e){return function(_0x983109){try{jsonpatch['apply'](_0x983109,_0x40c30e,!![]);}catch(_0x1c29eb){return BPromise[_0x91d2('0x24')](_0x1c29eb);}return _0x983109[_0x91d2('0x25')]();};}function saveUpdates(_0xc1bbbb,_0x203743){return function(_0x333d54){if(_0x333d54){return _0x333d54[_0x91d2('0x26')](_0xc1bbbb)[_0x91d2('0x27')](function(_0x515889){return _0x515889;});}return null;};}function removeEntity(_0x440fbe,_0x2b9dfc){return function(_0x502d69){if(_0x502d69){return _0x502d69['destroy']()[_0x91d2('0x27')](function(){_0x440fbe[_0x91d2('0x1c')](0xcc)[_0x91d2('0x1d')]();});}};}function handleEntityNotFound(_0x1249dc,_0x48a785){return function(_0x9d8ae9){if(!_0x9d8ae9){_0x1249dc[_0x91d2('0x1b')](0x194);}return _0x9d8ae9;};}function handleError(_0x1f8e41,_0x3db434){_0x3db434=_0x3db434||0x1f4;return function(_0x3ac482){logger[_0x91d2('0x28')](_0x3ac482['stack']);if(_0x3ac482[_0x91d2('0x29')]){delete _0x3ac482[_0x91d2('0x29')];}_0x1f8e41['status'](_0x3db434)['send'](_0x3ac482);};}exports[_0x91d2('0x2a')]=function(_0x36e63a,_0x5a44ea){var _0x2dcdfb={},_0x2fe6bd={},_0x56cfc3={'count':0x0,'rows':[]};var _0x5749ae=_[_0x91d2('0x2b')](db[_0x91d2('0x2c')]['rawAttributes'],function(_0x1c7e96){return{'name':_0x1c7e96[_0x91d2('0x2d')],'type':_0x1c7e96[_0x91d2('0x2e')]['key']};});_0x2fe6bd[_0x91d2('0x2f')]=_['map'](_0x5749ae,_0x91d2('0x29'));_0x2fe6bd['query']=_['keys'](_0x36e63a[_0x91d2('0x30')]);_0x2fe6bd['filters']=_['intersection'](_0x2fe6bd[_0x91d2('0x2f')],_0x2fe6bd[_0x91d2('0x30')]);_0x2dcdfb[_0x91d2('0x31')]=_[_0x91d2('0x32')](_0x2fe6bd[_0x91d2('0x2f')],qs[_0x91d2('0x33')](_0x36e63a['query'][_0x91d2('0x33')]));_0x2dcdfb['attributes']=_0x2dcdfb[_0x91d2('0x31')]['length']?_0x2dcdfb[_0x91d2('0x31')]:_0x2fe6bd[_0x91d2('0x2f')];if(!_0x36e63a['query'][_0x91d2('0x34')](_0x91d2('0x35'))){_0x2dcdfb[_0x91d2('0x21')]=qs['limit'](_0x36e63a[_0x91d2('0x30')][_0x91d2('0x21')]);_0x2dcdfb[_0x91d2('0x20')]=qs['offset'](_0x36e63a[_0x91d2('0x30')][_0x91d2('0x20')]);}_0x2dcdfb[_0x91d2('0x36')]=qs['sort'](_0x36e63a['query']['sort']);_0x2dcdfb['where']=qs[_0x91d2('0x37')](_[_0x91d2('0x38')](_0x36e63a[_0x91d2('0x30')],_0x2fe6bd[_0x91d2('0x37')]),_0x5749ae);if(_0x36e63a[_0x91d2('0x30')][_0x91d2('0x39')]){_0x2dcdfb['where']=_[_0x91d2('0x3a')](_0x2dcdfb['where'],{'$or':_[_0x91d2('0x2b')](_0x5749ae,function(_0x22b0ef){if(_0x22b0ef[_0x91d2('0x2e')]!=='VIRTUAL'){var _0x36c98f={};_0x36c98f[_0x22b0ef[_0x91d2('0x29')]]={'$like':'%'+_0x36e63a[_0x91d2('0x30')]['filter']+'%'};return _0x36c98f;}})});}_0x2dcdfb=_[_0x91d2('0x3a')]({},_0x2dcdfb,_0x36e63a['options']);var _0x40fefb={'where':_0x2dcdfb[_0x91d2('0x3b')]};return db['VoiceTransferReport'][_0x91d2('0x1f')](_0x40fefb)[_0x91d2('0x27')](function(_0x1b0d6d){_0x56cfc3[_0x91d2('0x1f')]=_0x1b0d6d;if(_0x36e63a[_0x91d2('0x30')][_0x91d2('0x3c')]){_0x2dcdfb[_0x91d2('0x3d')]=[{'all':!![]}];}return db[_0x91d2('0x2c')][_0x91d2('0x3e')](_0x2dcdfb);})[_0x91d2('0x27')](function(_0x1a6a16){_0x56cfc3[_0x91d2('0x3f')]=_0x1a6a16;return _0x56cfc3;})[_0x91d2('0x27')](respondWithFilteredResult(_0x5a44ea,_0x2dcdfb))['catch'](handleError(_0x5a44ea,null));};exports['show']=function(_0xf2b7,_0x40896a){var _0x3ff651={'raw':!![],'where':{'id':_0xf2b7[_0x91d2('0x40')]['id']}},_0x1e28c4={};_0x1e28c4['model']=_['keys'](db['VoiceTransferReport'][_0x91d2('0x41')]);_0x1e28c4[_0x91d2('0x30')]=_[_0x91d2('0x42')](_0xf2b7[_0x91d2('0x30')]);_0x1e28c4['filters']=_[_0x91d2('0x32')](_0x1e28c4[_0x91d2('0x2f')],_0x1e28c4[_0x91d2('0x30')]);_0x3ff651[_0x91d2('0x31')]=_[_0x91d2('0x32')](_0x1e28c4['model'],qs[_0x91d2('0x33')](_0xf2b7[_0x91d2('0x30')][_0x91d2('0x33')]));_0x3ff651['attributes']=_0x3ff651[_0x91d2('0x31')][_0x91d2('0x43')]?_0x3ff651['attributes']:_0x1e28c4[_0x91d2('0x2f')];if(_0xf2b7['query']['includeAll']){_0x3ff651[_0x91d2('0x3d')]=[{'all':!![]}];}_0x3ff651=_[_0x91d2('0x3a')]({},_0x3ff651,_0xf2b7[_0x91d2('0x44')]);return db['VoiceTransferReport'][_0x91d2('0x45')](_0x3ff651)['then'](handleEntityNotFound(_0x40896a,null))[_0x91d2('0x27')](respondWithResult(_0x40896a,null))[_0x91d2('0x46')](handleError(_0x40896a,null));};exports[_0x91d2('0x47')]=function(_0x2ac35f,_0x3b96ab){return db[_0x91d2('0x2c')][_0x91d2('0x47')](_0x2ac35f[_0x91d2('0x48')],{})[_0x91d2('0x27')](respondWithResult(_0x3b96ab,0xc9))[_0x91d2('0x46')](handleError(_0x3b96ab,null));};exports[_0x91d2('0x26')]=function(_0x47ca1c,_0x4505b2){if(_0x47ca1c[_0x91d2('0x48')]['id']){delete _0x47ca1c['body']['id'];}return db[_0x91d2('0x2c')][_0x91d2('0x45')]({'where':{'id':_0x47ca1c[_0x91d2('0x40')]['id']}})[_0x91d2('0x27')](handleEntityNotFound(_0x4505b2,null))[_0x91d2('0x27')](saveUpdates(_0x47ca1c[_0x91d2('0x48')],null))[_0x91d2('0x27')](respondWithResult(_0x4505b2,null))[_0x91d2('0x46')](handleError(_0x4505b2,null));};exports[_0x91d2('0x49')]=function(_0x2381a1,_0xec5c0a){return db[_0x91d2('0x2c')][_0x91d2('0x45')]({'where':{'id':_0x2381a1[_0x91d2('0x40')]['id']}})[_0x91d2('0x27')](handleEntityNotFound(_0xec5c0a,null))[_0x91d2('0x27')](removeEntity(_0xec5c0a,null))[_0x91d2('0x46')](handleError(_0xec5c0a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index e180860..a700871 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 _0x78c4=['define','VoiceTransferReport','report_call_transfer','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x5b9a30,_0x2b3667){var _0x35f722=function(_0xfb962b){while(--_0xfb962b){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x35f722(++_0x2b3667);}(_0x78c4,0x158));var _0x478c=function(_0x120619,_0x244e19){_0x120619=_0x120619-0x0;var _0x4dcd9b=_0x78c4[_0x120619];return _0x4dcd9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x478c('0x0'))(_0x478c('0x1'));var moment=require('moment');var BPromise=require(_0x478c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x478c('0x3'));var rimraf=require(_0x478c('0x4'));var config=require(_0x478c('0x5'));var attributes=require(_0x478c('0x6'));module[_0x478c('0x7')]=function(_0x1970f3,_0x3656fb){return _0x1970f3[_0x478c('0x8')](_0x478c('0x9'),attributes,{'tableName':_0x478c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('VoiceTransferReport',attributes,{'tableName':_0xeb62('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 f974098..618d6b7 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 _0xda33=['error','code','message','catch','VoiceTransferReport','body','options','raw','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b29ce,_0x13de5f){var _0x57b233=function(_0x5e4248){while(--_0x5e4248){_0x3b29ce['push'](_0x3b29ce['shift']());}};_0x57b233(++_0x13de5f);}(_0xda33,0x1d4));var _0x3da3=function(_0x4dee78,_0x3b517d){_0x4dee78=_0x4dee78-0x0;var _0x5a953a=_0xda33[_0x4dee78];return _0x5a953a;};'use strict';var _=require('lodash');var util=require(_0x3da3('0x0'));var moment=require(_0x3da3('0x1'));var BPromise=require(_0x3da3('0x2'));var rs=require(_0x3da3('0x3'));var fs=require('fs');var Redis=require(_0x3da3('0x4'));var db=require(_0x3da3('0x5'))['db'];var utils=require(_0x3da3('0x6'));var logger=require(_0x3da3('0x7'))(_0x3da3('0x8'));var config=require('../../config/environment');var jayson=require(_0x3da3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34bd10,_0x27921f,_0x257648){return new BPromise(function(_0x5a30a9,_0x4ef3b7){return client[_0x3da3('0xa')](_0x34bd10,_0x257648)[_0x3da3('0xb')](function(_0x48a357){logger[_0x3da3('0xc')](_0x3da3('0xd'),_0x27921f,_0x3da3('0xe'));logger[_0x3da3('0xf')](_0x3da3('0x10'),_0x27921f,_0x3da3('0xe'),JSON[_0x3da3('0x11')](_0x48a357));if(_0x48a357[_0x3da3('0x12')]){if(_0x48a357[_0x3da3('0x12')][_0x3da3('0x13')]===0x1f4){logger[_0x3da3('0x12')](_0x3da3('0xd'),_0x27921f,_0x48a357[_0x3da3('0x12')][_0x3da3('0x14')]);return _0x4ef3b7(_0x48a357['error'][_0x3da3('0x14')]);}logger['error'](_0x3da3('0xd'),_0x27921f,_0x48a357[_0x3da3('0x12')][_0x3da3('0x14')]);return _0x5a30a9(_0x48a357[_0x3da3('0x12')]['message']);}else{logger[_0x3da3('0xc')](_0x3da3('0xd'),_0x27921f,_0x3da3('0xe'));_0x5a30a9(_0x48a357['result'][_0x3da3('0x14')]);}})[_0x3da3('0x15')](function(_0x6ae074){logger[_0x3da3('0x12')](_0x3da3('0xd'),_0x27921f,_0x6ae074);_0x4ef3b7(_0x6ae074);});});}exports['CreateVoiceTransferReport']=function(_0xbeb4b4){var _0x3a4571=this;return new Promise(function(_0x59a0af,_0x1a9c11){return db[_0x3da3('0x16')]['create'](_0xbeb4b4[_0x3da3('0x17')],{'raw':_0xbeb4b4[_0x3da3('0x18')]?_0xbeb4b4[_0x3da3('0x18')][_0x3da3('0x19')]===undefined?!![]:![]:!![]})[_0x3da3('0xb')](function(_0x50466e){logger[_0x3da3('0xc')](_0x3da3('0x1a'),_0xbeb4b4);logger[_0x3da3('0xf')](_0x3da3('0x1a'),_0xbeb4b4,JSON['stringify'](_0x50466e));_0x59a0af(_0x50466e);})[_0x3da3('0x15')](function(_0x487c15){logger[_0x3da3('0x12')](_0x3da3('0x1a'),_0x487c15[_0x3da3('0x14')],_0xbeb4b4);_0x1a9c11(_0x3a4571[_0x3da3('0x12')](0x1f4,_0x487c15['message']));});});}; \ No newline at end of file +var _0xa0ef=['util','bluebird','ioredis','../../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','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash'];(function(_0x368b80,_0x48a178){var _0x418d2a=function(_0x38be7c){while(--_0x38be7c){_0x368b80['push'](_0x368b80['shift']());}};_0x418d2a(++_0x48a178);}(_0xa0ef,0x1a3));var _0xfa0e=function(_0x1f175e,_0x25487c){_0x1f175e=_0x1f175e-0x0;var _0x4ab74c=_0xa0ef[_0x1f175e];return _0x4ab74c;};'use strict';var _=require(_0xfa0e('0x0'));var util=require(_0xfa0e('0x1'));var moment=require('moment');var BPromise=require(_0xfa0e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa0e('0x3'));var db=require(_0xfa0e('0x4'))['db'];var utils=require(_0xfa0e('0x5'));var logger=require(_0xfa0e('0x6'))(_0xfa0e('0x7'));var config=require(_0xfa0e('0x8'));var jayson=require(_0xfa0e('0x9'));var client=jayson[_0xfa0e('0xa')][_0xfa0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc72fc6,_0x2e5ae2,_0x1a04e4){return new BPromise(function(_0x4732f1,_0x5c78a3){return client[_0xfa0e('0xc')](_0xc72fc6,_0x1a04e4)[_0xfa0e('0xd')](function(_0x48ccab){logger[_0xfa0e('0xe')](_0xfa0e('0xf'),_0x2e5ae2,_0xfa0e('0x10'));logger[_0xfa0e('0x11')](_0xfa0e('0x12'),_0x2e5ae2,_0xfa0e('0x10'),JSON[_0xfa0e('0x13')](_0x48ccab));if(_0x48ccab['error']){if(_0x48ccab['error']['code']===0x1f4){logger[_0xfa0e('0x14')](_0xfa0e('0xf'),_0x2e5ae2,_0x48ccab[_0xfa0e('0x14')][_0xfa0e('0x15')]);return _0x5c78a3(_0x48ccab['error']['message']);}logger[_0xfa0e('0x14')](_0xfa0e('0xf'),_0x2e5ae2,_0x48ccab[_0xfa0e('0x14')][_0xfa0e('0x15')]);return _0x4732f1(_0x48ccab[_0xfa0e('0x14')]['message']);}else{logger[_0xfa0e('0xe')](_0xfa0e('0xf'),_0x2e5ae2,_0xfa0e('0x10'));_0x4732f1(_0x48ccab[_0xfa0e('0x16')][_0xfa0e('0x15')]);}})[_0xfa0e('0x17')](function(_0x1fe853){logger['error'](_0xfa0e('0xf'),_0x2e5ae2,_0x1fe853);_0x5c78a3(_0x1fe853);});});}exports[_0xfa0e('0x18')]=function(_0x2af0d9){var _0x3dde9b=this;return new Promise(function(_0x243736,_0x235e98){return db[_0xfa0e('0x19')][_0xfa0e('0x1a')](_0x2af0d9[_0xfa0e('0x1b')],{'raw':_0x2af0d9[_0xfa0e('0x1c')]?_0x2af0d9[_0xfa0e('0x1c')][_0xfa0e('0x1d')]===undefined?!![]:![]:!![]})[_0xfa0e('0xd')](function(_0x2e73b6){logger[_0xfa0e('0xe')](_0xfa0e('0x18'),_0x2af0d9);logger[_0xfa0e('0x11')](_0xfa0e('0x18'),_0x2af0d9,JSON[_0xfa0e('0x13')](_0x2e73b6));_0x243736(_0x2e73b6);})[_0xfa0e('0x17')](function(_0x36b24a){logger[_0xfa0e('0x14')]('CreateVoiceTransferReport',_0x36b24a[_0xfa0e('0x15')],_0x2af0d9);_0x235e98(_0x3dde9b['error'](0x1f4,_0x36b24a[_0xfa0e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index cd6f4bc..602e7c0 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 _0x1e19=['exports','express','Router','../../components/auth/service','./webbar.controller','post','/hangup','isAuthenticated','canUpdate','hangup','/answer','answer','/hold','hold','unhold','/calls','calls','/transfer','transfer'];(function(_0x531e1e,_0x229b12){var _0x16f73a=function(_0x1b6be4){while(--_0x1b6be4){_0x531e1e['push'](_0x531e1e['shift']());}};_0x16f73a(++_0x229b12);}(_0x1e19,0x1c9));var _0x91e1=function(_0xf6c510,_0x38658f){_0xf6c510=_0xf6c510-0x0;var _0x18fa72=_0x1e19[_0xf6c510];return _0x18fa72;};'use strict';var express=require(_0x91e1('0x0'));var router=express[_0x91e1('0x1')]();var auth=require(_0x91e1('0x2'));var controller=require(_0x91e1('0x3'));router[_0x91e1('0x4')]('/originate',auth['isAuthenticated'](),auth['canUpdate'](),controller['originate']);router[_0x91e1('0x4')](_0x91e1('0x5'),auth[_0x91e1('0x6')](),auth[_0x91e1('0x7')](),controller[_0x91e1('0x8')]);router['post'](_0x91e1('0x9'),auth['isAuthenticated'](),auth[_0x91e1('0x7')](),controller[_0x91e1('0xa')]);router[_0x91e1('0x4')](_0x91e1('0xb'),auth[_0x91e1('0x6')](),auth['canUpdate'](),controller[_0x91e1('0xc')]);router[_0x91e1('0x4')]('/unhold',auth[_0x91e1('0x6')](),auth[_0x91e1('0x7')](),controller[_0x91e1('0xd')]);router[_0x91e1('0x4')](_0x91e1('0xe'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x91e1('0xf')]);router[_0x91e1('0x4')](_0x91e1('0x10'),auth[_0x91e1('0x6')](),auth[_0x91e1('0x7')](),controller[_0x91e1('0x11')]);module[_0x91e1('0x12')]=router; \ No newline at end of file +var _0x340c=['exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','post','answer','hold','/unhold','unhold','calls','/transfer','transfer'];(function(_0x5ddc36,_0x20384a){var _0x5b670f=function(_0x22bc8c){while(--_0x22bc8c){_0x5ddc36['push'](_0x5ddc36['shift']());}};_0x5b670f(++_0x20384a);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xc340('0x0'));var router=express[_0xc340('0x1')]();var auth=require(_0xc340('0x2'));var controller=require(_0xc340('0x3'));router['post'](_0xc340('0x4'),auth[_0xc340('0x5')](),auth[_0xc340('0x6')](),controller[_0xc340('0x7')]);router['post'](_0xc340('0x8'),auth[_0xc340('0x5')](),auth[_0xc340('0x6')](),controller[_0xc340('0x9')]);router[_0xc340('0xa')]('/answer',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xc340('0xb')]);router[_0xc340('0xa')]('/hold',auth[_0xc340('0x5')](),auth[_0xc340('0x6')](),controller[_0xc340('0xc')]);router[_0xc340('0xa')](_0xc340('0xd'),auth['isAuthenticated'](),auth[_0xc340('0x6')](),controller[_0xc340('0xe')]);router[_0xc340('0xa')]('/calls',auth[_0xc340('0x5')](),auth[_0xc340('0x6')](),controller[_0xc340('0xf')]);router[_0xc340('0xa')](_0xc340('0x10'),auth['isAuthenticated'](),auth[_0xc340('0x6')](),controller[_0xc340('0x11')]);module[_0xc340('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 99300d5..eb3c41d 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 _0x3738=['User','findOne','agent','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','info','body','json','userId','callerId','callbackUrl','format','user:%s','webbar:originate','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','error','name','status','send','request','then','code','message','result','catch'];(function(_0x458482,_0x3bc717){var _0x3289c5=function(_0x4b4d15){while(--_0x4b4d15){_0x458482['push'](_0x458482['shift']());}};_0x3289c5(++_0x3bc717);}(_0x3738,0x1e5));var _0x8373=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x3738[_0x345a17];return _0xd0f947;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8373('0x0'));var db=require(_0x8373('0x1'))['db'];var config=require(_0x8373('0x2'));var util=require(_0x8373('0x3'));var BPromise=require(_0x8373('0x4'));var jayson=require(_0x8373('0x5'));var amiClient=jayson[_0x8373('0x6')][_0x8373('0x7')]({'port':0x232a});var logger=require(_0x8373('0x8'))(_0x8373('0x9'));var Redis=require(_0x8373('0xa'));config[_0x8373('0xb')]=_['defaults'](config[_0x8373('0xb')],{'host':_0x8373('0xc'),'port':0x18eb});var io=require(_0x8373('0xd'))(new Redis(config[_0x8373('0xb')]));var Schema=require(_0x8373('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8373('0xf')]},'callNumber':{'type':_0x8373('0x10'),'required':[!![],_0x8373('0x11')]},'callerId':{'type':_0x8373('0x10')},'callbackUrl':{'type':_0x8373('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x8373('0x12'),'required':[!![],_0x8373('0xf')]},'sessionId':{'type':_0x8373('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8373('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8373('0x12'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8373('0x10'),'required':[!![],_0x8373('0x13')]},'transferNumber':{'type':'string','required':[!![],_0x8373('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x8373('0x12'),'required':[!![],_0x8373('0xf')]},'sessionId':{'type':_0x8373('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8373('0xf')]},'sessionId':{'type':_0x8373('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8373('0x12'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x8373('0x12'),'required':[!![],_0x8373('0xf')]}});function emit(_0x3613ed,_0x276318,_0x192b83){logger['info'](_0x3613ed,_0x276318,JSON[_0x8373('0x15')](_0x192b83));io['to'](_0x3613ed)[_0x8373('0x16')](_0x276318,_0x192b83);}function handleError(_0x3576ac){return function(_0xf27fa7){console['log']('handleError:',_0xf27fa7,_0xf27fa7 instanceof RangeError);logger[_0x8373('0x17')](_0xf27fa7['stack']);if(_0xf27fa7 instanceof RangeError){if(_0xf27fa7[_0x8373('0x18')]){delete _0xf27fa7[_0x8373('0x18')];}_0x3576ac[_0x8373('0x19')](0x194)[_0x8373('0x1a')](_0xf27fa7);}else{if(_0xf27fa7['name']){delete _0xf27fa7[_0x8373('0x18')];}_0x3576ac[_0x8373('0x19')](0x1f4)[_0x8373('0x1a')](_0xf27fa7);}};}function checkError(){return function(_0x398f4a){if(!_0x398f4a){throw new RangeError('NotFound');}return _0x398f4a;};}function respondWithRpcPromise(_0x591e27,_0x250b1a){return new BPromise(function(_0x552a2a,_0x2b8259){var _0x313014=amiClient;return _0x313014[_0x8373('0x1b')](_0x591e27,_0x250b1a)[_0x8373('0x1c')](function(_0x59fa12){if(_0x59fa12[_0x8373('0x17')]){if(_0x59fa12[_0x8373('0x17')][_0x8373('0x1d')]===0x1f4){return _0x2b8259(_0x59fa12[_0x8373('0x17')][_0x8373('0x1e')]);}return _0x552a2a(_0x59fa12[_0x8373('0x17')][_0x8373('0x1e')]);}else{_0x552a2a(_0x59fa12[_0x8373('0x1f')]);}})[_0x8373('0x20')](function(_0x26af56){_0x2b8259(_0x26af56);});});}function getAgent(_0x50ffac){return db[_0x8373('0x21')][_0x8373('0x22')]({'where':{'id':_0x50ffac,'role':_0x8373('0x23')}})[_0x8373('0x1c')](checkError());}function getAgentCheckSession(_0x42c8ca,_0x27858f){return new BPromise(function(_0x4a57e5,_0x14cd4b){var _0x104cdb=respondWithRpcPromise('VoiceChannels');var _0x426d0e=getAgent(_0x42c8ca);Promise[_0x8373('0x24')]([_0x104cdb,_0x426d0e])[_0x8373('0x1c')](function(_0x2ef9c5){var _0xdf741b=_0x2ef9c5[0x0];var _0x1d34c1=_0x2ef9c5[0x1];var _0x1e4de4=_[_0x8373('0x25')](_0xdf741b[_0x8373('0x26')],function(_0x260567){return _0x260567[_0x8373('0x27')]==_0x1d34c1['id']&&_0x260567['sessionId']==_0x27858f;});if(_0x1e4de4[_0x8373('0x28')]==0x1){_0x4a57e5(_0x1d34c1);}else{_0x14cd4b(new RangeError(_0x8373('0x29')+_0x27858f+_0x8373('0x2a')));}});});}exports['originate']=function(_0x3b0565,_0x27c2ac){logger[_0x8373('0x2b')]('originate\x20fired:',_0x3b0565[_0x8373('0x2c')]);var _0x18b26a=originateValidation[_0x8373('0xe')](_0x3b0565[_0x8373('0x2c')]);if(_0x18b26a[_0x8373('0x28')]>0x0){return _0x27c2ac[_0x8373('0x19')](0x190)[_0x8373('0x2d')](_0x18b26a);}var _0x5c11a9=_0x3b0565[_0x8373('0x2c')][_0x8373('0x2e')];var _0x5435d8=_0x3b0565[_0x8373('0x2c')]['callNumber'];var _0x7f8a62=_0x3b0565[_0x8373('0x2c')][_0x8373('0x2f')];var _0x62eaa3=_0x3b0565[_0x8373('0x2c')][_0x8373('0x30')];return getAgent(_0x5c11a9)['then'](function(_0x5cf6a7){logger[_0x8373('0x2b')]('entityFound:',_0x5cf6a7['name']);emit(util[_0x8373('0x31')](_0x8373('0x32'),_0x5cf6a7[_0x8373('0x18')]),_0x8373('0x33'),{'callNumber':_0x5435d8,'callerId':_0x7f8a62,'callbackUrl':_0x62eaa3});return _0x27c2ac[_0x8373('0x19')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x8373('0x20')](handleError(_0x27c2ac));};exports[_0x8373('0x34')]=function(_0x3a1783,_0x5e199b){logger[_0x8373('0x2b')](_0x8373('0x35'),_0x3a1783['body']);var _0x50daae=hangupValidation['validate'](_0x3a1783[_0x8373('0x2c')]);if(_0x50daae[_0x8373('0x28')]>0x0){return _0x5e199b[_0x8373('0x19')](0x190)['json'](_0x50daae);}var _0x389382=_0x3a1783[_0x8373('0x2c')][_0x8373('0x2e')];var _0x2b8f8d=_0x3a1783[_0x8373('0x2c')][_0x8373('0x36')];return getAgent(_0x389382)[_0x8373('0x1c')](function(_0x26baa9){logger['info']('entityFound:',_0x26baa9[_0x8373('0x18')]);emit(util[_0x8373('0x31')]('user:%s',_0x26baa9[_0x8373('0x18')]),_0x8373('0x37'),{'sessionId':_0x2b8f8d});return _0x5e199b[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'error':![],'message':_0x8373('0x38')});})[_0x8373('0x20')](handleError(_0x5e199b));};exports[_0x8373('0x39')]=function(_0x16e9c2,_0x5b27f6){logger['info'](_0x8373('0x3a'),_0x16e9c2[_0x8373('0x2c')]);var _0x2e7605=answerValidation[_0x8373('0xe')](_0x16e9c2[_0x8373('0x2c')]);if(_0x2e7605[_0x8373('0x28')]>0x0){return _0x5b27f6['status'](0x190)[_0x8373('0x2d')](_0x2e7605);}var _0x4fc8fe=_0x16e9c2['body'][_0x8373('0x2e')];var _0x1b7e0c=_0x16e9c2[_0x8373('0x2c')][_0x8373('0x36')];return getAgent(_0x4fc8fe)['then'](function(_0x36b25b){logger[_0x8373('0x2b')](_0x8373('0x3b'),_0x36b25b['name']);emit(util[_0x8373('0x31')](_0x8373('0x32'),_0x36b25b[_0x8373('0x18')]),_0x8373('0x3c'),{'sessionId':_0x1b7e0c});return _0x5b27f6[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'error':![],'message':_0x8373('0x3d')});})[_0x8373('0x20')](handleError(_0x5b27f6));};exports[_0x8373('0x3e')]=function(_0x1f7258,_0x2dd87c){logger[_0x8373('0x2b')](_0x8373('0x3f'),_0x1f7258['body']);var _0x23fe72=holdValidation[_0x8373('0xe')](_0x1f7258[_0x8373('0x2c')]);if(_0x23fe72[_0x8373('0x28')]>0x0){return _0x2dd87c['status'](0x190)[_0x8373('0x2d')](_0x23fe72);}var _0x32ec0b=_0x1f7258[_0x8373('0x2c')][_0x8373('0x2e')];var _0x583535=_0x1f7258[_0x8373('0x2c')][_0x8373('0x36')];return getAgent(_0x32ec0b)[_0x8373('0x1c')](function(_0x2f3e41){logger['info'](_0x8373('0x3b'),_0x2f3e41['name']);emit(util[_0x8373('0x31')](_0x8373('0x32'),_0x2f3e41[_0x8373('0x18')]),_0x8373('0x40'),{'sessionId':_0x583535});return _0x2dd87c[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x2dd87c));};exports[_0x8373('0x41')]=function(_0x4b1894,_0x283d32){logger[_0x8373('0x2b')](_0x8373('0x42'),_0x4b1894[_0x8373('0x2c')]);var _0x1111b8=unholdValidation[_0x8373('0xe')](_0x4b1894[_0x8373('0x2c')]);if(_0x1111b8['length']>0x0){return _0x283d32[_0x8373('0x19')](0x190)['json'](_0x1111b8);}var _0x350a39=_0x4b1894[_0x8373('0x2c')][_0x8373('0x2e')];var _0x46b32a=_0x4b1894['body']['sessionId'];return getAgent(_0x350a39)[_0x8373('0x1c')](function(_0xab34f1){logger['info'](_0x8373('0x3b'),_0xab34f1[_0x8373('0x18')]);emit(util['format'](_0x8373('0x32'),_0xab34f1[_0x8373('0x18')]),'webbar:unhold',{'sessionId':_0x46b32a});return _0x283d32[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0x8373('0x20')](handleError(_0x283d32));};exports['calls']=function(_0x4894d0,_0x1325dc){logger['info'](_0x8373('0x43'),_0x1325dc['body']);var _0x1650cd=callsValidation[_0x8373('0xe')](_0x4894d0[_0x8373('0x2c')]);if(_0x1650cd[_0x8373('0x28')]>0x0){return _0x1325dc[_0x8373('0x19')](0x190)[_0x8373('0x2d')](_0x1650cd);}var _0x15045f=_0x4894d0[_0x8373('0x2c')][_0x8373('0x2e')];var _0x2322e9=respondWithRpcPromise('VoiceChannels');var _0x3ba184=getAgent(_0x15045f);return Promise[_0x8373('0x24')]([_0x2322e9,_0x3ba184])[_0x8373('0x1c')](function(_0x1db756){var _0x1ec8a7=_0x1db756[0x0];var _0x3c4cab=_0x1db756[0x1];var _0x3909b6=_[_0x8373('0x25')](_0x1ec8a7[_0x8373('0x26')],function(_0x19a540){return _0x19a540[_0x8373('0x27')]==_0x3c4cab['id'];});return _0x1325dc[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'count':_0x3909b6[_0x8373('0x28')],'rows':_0x3909b6});})[_0x8373('0x20')](handleError(_0x1325dc));};exports[_0x8373('0x44')]=function(_0x53cde2,_0x2fd646){logger[_0x8373('0x2b')](_0x8373('0x45'),_0x53cde2[_0x8373('0x2c')]);var _0x21a269=conferenceValidation[_0x8373('0xe')](_0x53cde2['body']);if(_0x21a269[_0x8373('0x28')]>0x0){return _0x2fd646[_0x8373('0x19')](0x190)[_0x8373('0x2d')](_0x21a269);}var _0x394234=_0x53cde2[_0x8373('0x2c')][_0x8373('0x2e')];return getAgent(_0x394234)['then'](function(_0x1a739c){logger[_0x8373('0x2b')]('entityFound:',_0x1a739c[_0x8373('0x18')]);emit(util[_0x8373('0x31')]('user:%s',_0x1a739c['name']),'webbar:conference');return _0x2fd646[_0x8373('0x19')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x2fd646));};exports[_0x8373('0x46')]=function(_0x281aec,_0x37d15b){logger[_0x8373('0x2b')](_0x8373('0x47'),_0x281aec[_0x8373('0x2c')]);var _0xa4f9f4=transferValidation[_0x8373('0xe')](_0x281aec[_0x8373('0x2c')]);if(_0xa4f9f4[_0x8373('0x28')]>0x0){return _0x37d15b['status'](0x190)[_0x8373('0x2d')](_0xa4f9f4);}var _0x4e4f1c=_0x281aec[_0x8373('0x2c')]['userId'];var _0x1c096d=_0x281aec[_0x8373('0x2c')][_0x8373('0x36')];var _0x99291b=_0x281aec['body']['transferNumber'];return getAgent(_0x4e4f1c)[_0x8373('0x1c')](function(_0x376e46){logger[_0x8373('0x2b')](_0x8373('0x3b'),_0x376e46[_0x8373('0x18')]);emit(util[_0x8373('0x31')](_0x8373('0x32'),_0x376e46[_0x8373('0x18')]),_0x8373('0x48'),{'sessionId':_0x1c096d,'transferNumber':_0x99291b});return _0x37d15b[_0x8373('0x19')](0xc8)[_0x8373('0x2d')]({'error':![],'message':_0x8373('0x49')});})['catch'](handleError(_0x37d15b));}; \ No newline at end of file +var _0x2208=['info','stringify','emit','handleError:','error','name','send','status','NotFound','request','then','code','message','catch','User','agent','VoiceChannels','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','format','webbar:originate','originate\x20executed!','hangup\x20fired:','userId','sessionId','entityFound:','user:%s','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required'];(function(_0x3c44cf,_0x3cabf7){var _0x33e408=function(_0x21833a){while(--_0x21833a){_0x3c44cf['push'](_0x3c44cf['shift']());}};_0x33e408(++_0x3cabf7);}(_0x2208,0x11e));var _0x8220=function(_0x55b44c,_0x4a070a){_0x55b44c=_0x55b44c-0x0;var _0x768ac6=_0x2208[_0x55b44c];return _0x768ac6;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8220('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x8220('0x1'));var util=require('util');var BPromise=require(_0x8220('0x2'));var jayson=require(_0x8220('0x3'));var amiClient=jayson[_0x8220('0x4')][_0x8220('0x5')]({'port':0x232a});var logger=require(_0x8220('0x6'))(_0x8220('0x7'));var Redis=require('ioredis');config[_0x8220('0x8')]=_['defaults'](config[_0x8220('0x8')],{'host':_0x8220('0x9'),'port':0x18eb});var io=require(_0x8220('0xa'))(new Redis(config[_0x8220('0x8')]));var Schema=require(_0x8220('0xb'));var originateValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x8220('0xd'),'required':[!![],_0x8220('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8220('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],_0x8220('0xf')]},'sessionId':{'type':_0x8220('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],_0x8220('0xf')]},'sessionId':{'type':_0x8220('0xd'),'required':[!![],_0x8220('0x10')]},'transferNumber':{'type':_0x8220('0xd'),'required':[!![],_0x8220('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],_0x8220('0xf')]},'sessionId':{'type':_0x8220('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],_0x8220('0xf')]},'sessionId':{'type':_0x8220('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8220('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8220('0xf')]}});function emit(_0x1fb3d1,_0x1d04ab,_0xc10f2){logger[_0x8220('0x12')](_0x1fb3d1,_0x1d04ab,JSON[_0x8220('0x13')](_0xc10f2));io['to'](_0x1fb3d1)[_0x8220('0x14')](_0x1d04ab,_0xc10f2);}function handleError(_0x14e141){return function(_0x3fe87d){console['log'](_0x8220('0x15'),_0x3fe87d,_0x3fe87d instanceof RangeError);logger[_0x8220('0x16')](_0x3fe87d['stack']);if(_0x3fe87d instanceof RangeError){if(_0x3fe87d[_0x8220('0x17')]){delete _0x3fe87d['name'];}_0x14e141['status'](0x194)[_0x8220('0x18')](_0x3fe87d);}else{if(_0x3fe87d['name']){delete _0x3fe87d[_0x8220('0x17')];}_0x14e141[_0x8220('0x19')](0x1f4)[_0x8220('0x18')](_0x3fe87d);}};}function checkError(){return function(_0x334f3b){if(!_0x334f3b){throw new RangeError(_0x8220('0x1a'));}return _0x334f3b;};}function respondWithRpcPromise(_0x4c916e,_0x517fcf){return new BPromise(function(_0x8efe59,_0x21dd97){var _0x15988d=amiClient;return _0x15988d[_0x8220('0x1b')](_0x4c916e,_0x517fcf)[_0x8220('0x1c')](function(_0x2c4183){if(_0x2c4183[_0x8220('0x16')]){if(_0x2c4183['error'][_0x8220('0x1d')]===0x1f4){return _0x21dd97(_0x2c4183['error'][_0x8220('0x1e')]);}return _0x8efe59(_0x2c4183[_0x8220('0x16')][_0x8220('0x1e')]);}else{_0x8efe59(_0x2c4183['result']);}})[_0x8220('0x1f')](function(_0x3902c8){_0x21dd97(_0x3902c8);});});}function getAgent(_0x3feef6){return db[_0x8220('0x20')]['findOne']({'where':{'id':_0x3feef6,'role':_0x8220('0x21')}})[_0x8220('0x1c')](checkError());}function getAgentCheckSession(_0x21933d,_0x55d7fc){return new BPromise(function(_0x2c354b,_0x162ee9){var _0x218b23=respondWithRpcPromise(_0x8220('0x22'));var _0x154e8c=getAgent(_0x21933d);Promise['all']([_0x218b23,_0x154e8c])[_0x8220('0x1c')](function(_0xd56a27){var _0x150c4a=_0xd56a27[0x0];var _0x17c245=_0xd56a27[0x1];var _0x292fe6=_[_0x8220('0x23')](_0x150c4a[_0x8220('0x24')],function(_0x74a7a0){return _0x74a7a0[_0x8220('0x25')]==_0x17c245['id']&&_0x74a7a0['sessionId']==_0x55d7fc;});if(_0x292fe6[_0x8220('0x26')]==0x1){_0x2c354b(_0x17c245);}else{_0x162ee9(new RangeError('sessionId\x20'+_0x55d7fc+_0x8220('0x27')));}});});}exports[_0x8220('0x28')]=function(_0x527974,_0x4370fa){logger[_0x8220('0x12')](_0x8220('0x29'),_0x527974[_0x8220('0x2a')]);var _0x31ef16=originateValidation[_0x8220('0xb')](_0x527974[_0x8220('0x2a')]);if(_0x31ef16[_0x8220('0x26')]>0x0){return _0x4370fa['status'](0x190)[_0x8220('0x2b')](_0x31ef16);}var _0x3433e3=_0x527974['body']['userId'];var _0x45859c=_0x527974[_0x8220('0x2a')][_0x8220('0x2c')];var _0x4a596b=_0x527974['body'][_0x8220('0x2d')];var _0x292837=_0x527974[_0x8220('0x2a')][_0x8220('0x2e')];return getAgent(_0x3433e3)['then'](function(_0x19fb65){logger[_0x8220('0x12')]('entityFound:',_0x19fb65[_0x8220('0x17')]);emit(util[_0x8220('0x2f')]('user:%s',_0x19fb65[_0x8220('0x17')]),_0x8220('0x30'),{'callNumber':_0x45859c,'callerId':_0x4a596b,'callbackUrl':_0x292837});return _0x4370fa[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':_0x8220('0x31')});})[_0x8220('0x1f')](handleError(_0x4370fa));};exports['hangup']=function(_0x58ed8b,_0x4522bc){logger[_0x8220('0x12')](_0x8220('0x32'),_0x58ed8b[_0x8220('0x2a')]);var _0x2612c9=hangupValidation[_0x8220('0xb')](_0x58ed8b[_0x8220('0x2a')]);if(_0x2612c9['length']>0x0){return _0x4522bc[_0x8220('0x19')](0x190)[_0x8220('0x2b')](_0x2612c9);}var _0x3013b6=_0x58ed8b['body'][_0x8220('0x33')];var _0x438a52=_0x58ed8b[_0x8220('0x2a')][_0x8220('0x34')];return getAgent(_0x3013b6)[_0x8220('0x1c')](function(_0x4af8d5){logger[_0x8220('0x12')](_0x8220('0x35'),_0x4af8d5[_0x8220('0x17')]);emit(util[_0x8220('0x2f')](_0x8220('0x36'),_0x4af8d5[_0x8220('0x17')]),_0x8220('0x37'),{'sessionId':_0x438a52});return _0x4522bc[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':'hangup\x20executed!'});})[_0x8220('0x1f')](handleError(_0x4522bc));};exports[_0x8220('0x38')]=function(_0x65d87,_0x290026){logger[_0x8220('0x12')](_0x8220('0x39'),_0x65d87[_0x8220('0x2a')]);var _0x571bc0=answerValidation[_0x8220('0xb')](_0x65d87[_0x8220('0x2a')]);if(_0x571bc0[_0x8220('0x26')]>0x0){return _0x290026['status'](0x190)[_0x8220('0x2b')](_0x571bc0);}var _0x3459d8=_0x65d87['body']['userId'];var _0x214149=_0x65d87[_0x8220('0x2a')][_0x8220('0x34')];return getAgent(_0x3459d8)[_0x8220('0x1c')](function(_0x39fe71){logger[_0x8220('0x12')]('entityFound:',_0x39fe71[_0x8220('0x17')]);emit(util['format'](_0x8220('0x36'),_0x39fe71[_0x8220('0x17')]),_0x8220('0x3a'),{'sessionId':_0x214149});return _0x290026[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':_0x8220('0x3b')});})[_0x8220('0x1f')](handleError(_0x290026));};exports[_0x8220('0x3c')]=function(_0x1981ca,_0x203df3){logger[_0x8220('0x12')]('hold\x20fired:',_0x1981ca[_0x8220('0x2a')]);var _0x23e7cf=holdValidation['validate'](_0x1981ca['body']);if(_0x23e7cf[_0x8220('0x26')]>0x0){return _0x203df3[_0x8220('0x19')](0x190)[_0x8220('0x2b')](_0x23e7cf);}var _0x22c706=_0x1981ca[_0x8220('0x2a')]['userId'];var _0x1efe63=_0x1981ca['body']['sessionId'];return getAgent(_0x22c706)[_0x8220('0x1c')](function(_0x3ff0cb){logger[_0x8220('0x12')]('entityFound:',_0x3ff0cb[_0x8220('0x17')]);emit(util[_0x8220('0x2f')](_0x8220('0x36'),_0x3ff0cb[_0x8220('0x17')]),_0x8220('0x3d'),{'sessionId':_0x1efe63});return _0x203df3[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':_0x8220('0x3e')});})[_0x8220('0x1f')](handleError(_0x203df3));};exports[_0x8220('0x3f')]=function(_0x43f4d2,_0x2536aa){logger[_0x8220('0x12')](_0x8220('0x40'),_0x43f4d2[_0x8220('0x2a')]);var _0x766641=unholdValidation[_0x8220('0xb')](_0x43f4d2[_0x8220('0x2a')]);if(_0x766641[_0x8220('0x26')]>0x0){return _0x2536aa[_0x8220('0x19')](0x190)[_0x8220('0x2b')](_0x766641);}var _0x7fdc1a=_0x43f4d2[_0x8220('0x2a')][_0x8220('0x33')];var _0x4011a2=_0x43f4d2[_0x8220('0x2a')]['sessionId'];return getAgent(_0x7fdc1a)[_0x8220('0x1c')](function(_0x46d1a0){logger[_0x8220('0x12')](_0x8220('0x35'),_0x46d1a0['name']);emit(util['format'](_0x8220('0x36'),_0x46d1a0[_0x8220('0x17')]),_0x8220('0x41'),{'sessionId':_0x4011a2});return _0x2536aa[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':_0x8220('0x42')});})[_0x8220('0x1f')](handleError(_0x2536aa));};exports[_0x8220('0x43')]=function(_0x2207ed,_0xd6d6a){logger[_0x8220('0x12')](_0x8220('0x44'),_0xd6d6a[_0x8220('0x2a')]);var _0x3de204=callsValidation[_0x8220('0xb')](_0x2207ed[_0x8220('0x2a')]);if(_0x3de204[_0x8220('0x26')]>0x0){return _0xd6d6a[_0x8220('0x19')](0x190)[_0x8220('0x2b')](_0x3de204);}var _0x5f48b6=_0x2207ed[_0x8220('0x2a')][_0x8220('0x33')];var _0x2c1616=respondWithRpcPromise('VoiceChannels');var _0x363420=getAgent(_0x5f48b6);return Promise[_0x8220('0x45')]([_0x2c1616,_0x363420])[_0x8220('0x1c')](function(_0x1a91b6){var _0x37f985=_0x1a91b6[0x0];var _0x408648=_0x1a91b6[0x1];var _0x5c2610=_[_0x8220('0x23')](_0x37f985['rows'],function(_0x4be47b){return _0x4be47b[_0x8220('0x25')]==_0x408648['id'];});return _0xd6d6a[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'count':_0x5c2610[_0x8220('0x26')],'rows':_0x5c2610});})[_0x8220('0x1f')](handleError(_0xd6d6a));};exports[_0x8220('0x46')]=function(_0x276065,_0x4f62ab){logger['info'](_0x8220('0x47'),_0x276065[_0x8220('0x2a')]);var _0xb6fee9=conferenceValidation[_0x8220('0xb')](_0x276065[_0x8220('0x2a')]);if(_0xb6fee9['length']>0x0){return _0x4f62ab[_0x8220('0x19')](0x190)[_0x8220('0x2b')](_0xb6fee9);}var _0x60d3fe=_0x276065[_0x8220('0x2a')][_0x8220('0x33')];return getAgent(_0x60d3fe)['then'](function(_0xb05eb4){logger[_0x8220('0x12')](_0x8220('0x35'),_0xb05eb4[_0x8220('0x17')]);emit(util['format'](_0x8220('0x36'),_0xb05eb4['name']),'webbar:conference');return _0x4f62ab[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':'conference\x20executed!'});})[_0x8220('0x1f')](handleError(_0x4f62ab));};exports[_0x8220('0x48')]=function(_0x5d229c,_0x525c28){logger['info'](_0x8220('0x49'),_0x5d229c[_0x8220('0x2a')]);var _0x47ef88=transferValidation[_0x8220('0xb')](_0x5d229c[_0x8220('0x2a')]);if(_0x47ef88[_0x8220('0x26')]>0x0){return _0x525c28['status'](0x190)['json'](_0x47ef88);}var _0x24fdf3=_0x5d229c[_0x8220('0x2a')]['userId'];var _0x56f24a=_0x5d229c[_0x8220('0x2a')]['sessionId'];var _0x4b5fe9=_0x5d229c[_0x8220('0x2a')][_0x8220('0x4a')];return getAgent(_0x24fdf3)[_0x8220('0x1c')](function(_0x51f17c){logger['info'](_0x8220('0x35'),_0x51f17c['name']);emit(util[_0x8220('0x2f')](_0x8220('0x36'),_0x51f17c['name']),'webbar:transfer',{'sessionId':_0x56f24a,'transferNumber':_0x4b5fe9});return _0x525c28[_0x8220('0x19')](0xc8)[_0x8220('0x2b')]({'error':![],'message':_0x8220('0x4b')});})[_0x8220('0x1f')](handleError(_0x525c28));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 60d3934..746380c 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6cc7=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','delete','removeDispositions','exports','multer'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6cc7,0xc5));var _0x76cc=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x6cc7[_0x280ae7];return _0x418b9e;};'use strict';var multer=require(_0x76cc('0x0'));var util=require(_0x76cc('0x1'));var path=require(_0x76cc('0x2'));var timeout=require(_0x76cc('0x3'));var express=require(_0x76cc('0x4'));var router=express['Router']();var auth=require(_0x76cc('0x5'));var interaction=require(_0x76cc('0x6'));var config=require('../../config/environment');var controller=require(_0x76cc('0x7'));router[_0x76cc('0x8')]('/',auth[_0x76cc('0x9')](),controller[_0x76cc('0xa')]);router[_0x76cc('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x76cc('0xb')]);router[_0x76cc('0x8')](_0x76cc('0xc'),auth[_0x76cc('0x9')](),controller[_0x76cc('0xd')]);router[_0x76cc('0x8')](_0x76cc('0xe'),auth[_0x76cc('0x9')](),controller[_0x76cc('0xf')]);router[_0x76cc('0x8')](_0x76cc('0x10'),auth[_0x76cc('0x9')](),controller[_0x76cc('0x11')]);router['get'](_0x76cc('0x12'),auth[_0x76cc('0x9')](),controller['getAgents']);router[_0x76cc('0x8')](_0x76cc('0x13'),auth[_0x76cc('0x9')](),controller[_0x76cc('0x14')]);router['post']('/',auth[_0x76cc('0x9')](),controller['create']);router[_0x76cc('0x15')](_0x76cc('0xe'),auth[_0x76cc('0x9')](),controller['addDisposition']);router[_0x76cc('0x15')](_0x76cc('0x10'),auth[_0x76cc('0x9')](),controller[_0x76cc('0x16')]);router[_0x76cc('0x15')](_0x76cc('0x12'),auth[_0x76cc('0x9')](),controller[_0x76cc('0x17')]);router[_0x76cc('0x15')]('/:id/applications',auth[_0x76cc('0x9')](),controller[_0x76cc('0x18')]);router[_0x76cc('0x15')](_0x76cc('0x19'),controller[_0x76cc('0x1a')]);router[_0x76cc('0x15')](_0x76cc('0x1b'),auth['isAuthenticated'](),controller[_0x76cc('0x1c')]);router['put']('/:id',auth[_0x76cc('0x9')](),controller[_0x76cc('0x1d')]);router[_0x76cc('0x1e')]('/:id',auth[_0x76cc('0x9')](),controller['destroy']);router[_0x76cc('0x1e')]('/:id/dispositions',auth[_0x76cc('0x9')](),controller[_0x76cc('0x1f')]);router['delete'](_0x76cc('0x10'),auth[_0x76cc('0x9')](),controller['removeAnswers']);router['delete'](_0x76cc('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x76cc('0x20')]=router; \ No newline at end of file +var _0x2e51=['removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','post','addDisposition','addAnswer','/:id/applications','/:id/notify','/:id/send','send','update','delete','destroy'];(function(_0x570434,_0x5d9ffb){var _0x1ca0f5=function(_0x3850e0){while(--_0x3850e0){_0x570434['push'](_0x570434['shift']());}};_0x1ca0f5(++_0x5d9ffb);}(_0x2e51,0x19c));var _0x12e5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2e51[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x12e5('0x0'));var util=require(_0x12e5('0x1'));var path=require(_0x12e5('0x2'));var timeout=require(_0x12e5('0x3'));var express=require('express');var router=express[_0x12e5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x12e5('0x5'));var config=require(_0x12e5('0x6'));var controller=require(_0x12e5('0x7'));router[_0x12e5('0x8')]('/',auth[_0x12e5('0x9')](),controller['index']);router[_0x12e5('0x8')](_0x12e5('0xa'),auth[_0x12e5('0x9')](),controller['describe']);router[_0x12e5('0x8')](_0x12e5('0xb'),auth['isAuthenticated'](),controller[_0x12e5('0xc')]);router['get'](_0x12e5('0xd'),auth['isAuthenticated'](),controller[_0x12e5('0xe')]);router[_0x12e5('0x8')](_0x12e5('0xf'),auth['isAuthenticated'](),controller[_0x12e5('0x10')]);router['get'](_0x12e5('0x11'),auth[_0x12e5('0x9')](),controller[_0x12e5('0x12')]);router[_0x12e5('0x8')]('/:id/applications',auth[_0x12e5('0x9')](),controller[_0x12e5('0x13')]);router[_0x12e5('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x12e5('0x14')]('/:id/dispositions',auth[_0x12e5('0x9')](),controller[_0x12e5('0x15')]);router[_0x12e5('0x14')](_0x12e5('0xf'),auth[_0x12e5('0x9')](),controller[_0x12e5('0x16')]);router['post'](_0x12e5('0x11'),auth[_0x12e5('0x9')](),controller['addAgents']);router[_0x12e5('0x14')](_0x12e5('0x17'),auth[_0x12e5('0x9')](),controller['addApplications']);router[_0x12e5('0x14')](_0x12e5('0x18'),controller['notify']);router['post'](_0x12e5('0x19'),auth[_0x12e5('0x9')](),controller[_0x12e5('0x1a')]);router['put'](_0x12e5('0xb'),auth[_0x12e5('0x9')](),controller[_0x12e5('0x1b')]);router[_0x12e5('0x1c')](_0x12e5('0xb'),auth[_0x12e5('0x9')](),controller[_0x12e5('0x1d')]);router['delete'](_0x12e5('0xd'),auth['isAuthenticated'](),controller[_0x12e5('0x1e')]);router[_0x12e5('0x1c')]('/:id/canned_answers',auth[_0x12e5('0x9')](),controller[_0x12e5('0x1f')]);router['delete'](_0x12e5('0x11'),auth['isAuthenticated'](),controller[_0x12e5('0x20')]);module[_0x12e5('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 9322ce3..edeb996 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32eb=['randomstring','exports','STRING','name','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x32eb,0xed));var _0xb32e=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0x32eb[_0x318410];return _0x2898a3;};'use strict';var Sequelize=require(_0xb32e('0x0'));var rs=require(_0xb32e('0x1'));module[_0xb32e('0x2')]={'name':{'type':Sequelize[_0xb32e('0x3')],'unique':_0xb32e('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xb32e('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xb32e('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xb32e('0x3')]},'type':{'type':Sequelize[_0xb32e('0x5')](_0xb32e('0x6'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb32e('0x3')]},'notificationTemplate':{'type':Sequelize[_0xb32e('0x7')],'defaultValue':function(){return _0xb32e('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb32e('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb32e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb32e('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb32e('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb32e('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5ceb04){if(!_0x5ceb04){this['setDataValue'](_0xb32e('0xb'),null);}this[_0xb32e('0xc')](_0xb32e('0xd'),_0x5ceb04);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x70c2=['STRING','name','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring'];(function(_0x366a1d,_0xf510f5){var _0x260669=function(_0x377b2d){while(--_0x377b2d){_0x366a1d['push'](_0x366a1d['shift']());}};_0x260669(++_0xf510f5);}(_0x70c2,0x106));var _0x270c=function(_0x33187c,_0x766ee9){_0x33187c=_0x33187c-0x0;var _0x29dda5=_0x70c2[_0x33187c];return _0x29dda5;};'use strict';var Sequelize=require(_0x270c('0x0'));var rs=require(_0x270c('0x1'));module['exports']={'name':{'type':Sequelize[_0x270c('0x2')],'unique':_0x270c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x270c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x270c('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x270c('0x2')]},'type':{'type':Sequelize['ENUM'](_0x270c('0x4'))},'accountSid':{'type':Sequelize[_0x270c('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x270c('0x5')],'defaultValue':function(){return _0x270c('0x6');}},'notificationSound':{'type':Sequelize[_0x270c('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x270c('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x270c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x270c('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x270c('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x270c('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x270c('0x9'),'set':function(_0x3827a6){if(!_0x3827a6){this['setDataValue'](_0x270c('0xa'),null);}this[_0x270c('0xb')]('mandatoryDisposition',_0x3827a6);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 72d69c0..b08696b 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcea2=['../../mysqldb','redis','localhost','./whatsappAccount.socket','register','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','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','get','UserProfileResource','destroy','end','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','hasOwnProperty','CannedAnswer','removeAnswers','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','orderBy','asc','CmContact','createdAt','difference','updatedAt','ListId','mobile','twilio','replace','whatsapp:','messageId','isNil','from','from\x20is\x20mandatory','mapKey','CmList','Contacts','DESC','list','defaults','interaction','created','autoclose','push','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','WhatsappInteraction','out','spread','dataValues','Messages','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2e7c33,_0x5ab768){var _0x3396cf=function(_0x33c03a){while(--_0x33c03a){_0x2e7c33['push'](_0x2e7c33['shift']());}};_0x3396cf(++_0x5ab768);}(_0xcea2,0x15a));var _0x2cea=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xcea2[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0x2cea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2cea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cea('0x2'));var rp=require(_0x2cea('0x3'));var moment=require(_0x2cea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2cea('0x5'));var util=require(_0x2cea('0x6'));var path=require(_0x2cea('0x7'));var sox=require('sox');var csv=require(_0x2cea('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0x8'));var querystring=require('querystring');var Papa=require(_0x2cea('0xe'));var Redis=require(_0x2cea('0xf'));var authService=require(_0x2cea('0x10'));var qs=require(_0x2cea('0x11'));var as=require(_0x2cea('0x12'));var hardwareService=require(_0x2cea('0x13'));var logger=require(_0x2cea('0x14'))(_0x2cea('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2cea('0x16'))['db'];config[_0x2cea('0x17')]=_['defaults'](config['redis'],{'host':_0x2cea('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cea('0x17')]));require(_0x2cea('0x19'))[_0x2cea('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x369c72,_0x586ad5,_0x3c7130){if(_0x3c7130){var _0x338669=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x338669[_0x2cea('0x1b')](_0x586ad5)){return _0x369c72;}else{throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))](_0x2cea('0x1e'));}}else{return _0x369c72;}}function respondWithRpcPromise(_0x3530d7,_0x1ead4c,_0x5eee09,_0x19927a){return new BPromise(function(_0x464f7d,_0x20c46c){var _0x43ae15=_0x19927a||client;return _0x43ae15[_0x2cea('0x1f')](_0x3530d7,_0x5eee09)[_0x2cea('0x20')](function(_0x5d75c4){logger[_0x2cea('0x21')]('WhatsappAccount,\x20%s,\x20%s',_0x1ead4c,_0x2cea('0x22'));logger[_0x2cea('0x23')](_0x2cea('0x24'),_0x1ead4c,'request\x20sent',JSON[_0x2cea('0x25')](_0x5d75c4));if(_0x5d75c4[_0x2cea('0x26')]){if(_0x5d75c4[_0x2cea('0x26')][_0x2cea('0x27')]===0x1f4){logger[_0x2cea('0x26')](_0x2cea('0x28'),_0x1ead4c,_0x5d75c4[_0x2cea('0x26')]['message']);return _0x20c46c(_0x5d75c4[_0x2cea('0x26')]['message']);}logger[_0x2cea('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x1ead4c,_0x5d75c4[_0x2cea('0x26')][_0x2cea('0x29')]);return _0x464f7d(_0x5d75c4['error'][_0x2cea('0x29')]);}else{logger[_0x2cea('0x21')](_0x2cea('0x28'),_0x1ead4c,_0x2cea('0x22'));_0x464f7d(_0x5d75c4[_0x2cea('0x2a')][_0x2cea('0x29')]);}})['catch'](function(_0x4ec9b3){logger[_0x2cea('0x26')](_0x2cea('0x28'),_0x1ead4c,_0x4ec9b3);_0x20c46c(_0x4ec9b3);});});}function respondWithStatusCode(_0x32af98,_0x46ef5a){_0x46ef5a=_0x46ef5a||0xcc;return function(_0x3ea40c){if(_0x3ea40c){return _0x32af98[_0x2cea('0x2b')](_0x46ef5a);}return _0x32af98[_0x2cea('0x2c')](_0x46ef5a)['end']();};}function respondWithResult(_0xff69ad,_0x128863){_0x128863=_0x128863||0xc8;return function(_0x5f3fb4){if(_0x5f3fb4){return _0xff69ad[_0x2cea('0x2c')](_0x128863)[_0x2cea('0x2d')](_0x5f3fb4);}};}function respondWithFilteredResult(_0x271b2f,_0x16cf9f){return function(_0x5e0519){if(_0x5e0519){var _0x3c0066=_0x5e0519[_0x2cea('0x2e')],_0x128934=_0x16cf9f[_0x2cea('0x2f')],_0x4a51e5=_0x16cf9f[_0x2cea('0x2f')]+_0x16cf9f[_0x2cea('0x30')],_0x2bf4e9;if(_0x4a51e5>=_0x3c0066){_0x4a51e5=_0x3c0066;_0x2bf4e9=0xc8;}else{_0x2bf4e9=0xce;}_0x271b2f[_0x2cea('0x2c')](_0x2bf4e9);return _0x271b2f[_0x2cea('0x31')](_0x2cea('0x32'),_0x128934+'-'+_0x4a51e5+'/'+_0x3c0066)[_0x2cea('0x2d')](_0x5e0519);}return null;};}function patchUpdates(_0x1e721b){return function(_0x107472){try{jsonpatch['apply'](_0x107472,_0x1e721b,!![]);}catch(_0x260a0f){return BPromise[_0x2cea('0x33')](_0x260a0f);}return _0x107472[_0x2cea('0x34')]();};}function saveUpdates(_0x1bd2a5,_0x5a0061){return function(_0x4dbbcd){if(_0x4dbbcd){return _0x4dbbcd[_0x2cea('0x35')](_0x1bd2a5)[_0x2cea('0x20')](function(_0x5eefbf){return _0x5eefbf;});}return null;};}function removeEntity(_0x381ad7,_0x49d851){return function(_0x3332db){if(_0x3332db){return _0x3332db['destroy']()[_0x2cea('0x20')](function(){var _0x5bd36b=_0x3332db[_0x2cea('0x36')]({'plain':!![]});var _0x4518eb='WhatsappAccounts';return db[_0x2cea('0x37')][_0x2cea('0x38')]({'where':{'type':_0x4518eb,'resourceId':_0x5bd36b['id']}})['then'](function(){return _0x3332db;});})[_0x2cea('0x20')](function(){_0x381ad7[_0x2cea('0x2c')](0xcc)[_0x2cea('0x39')]();});}};}function handleEntityNotFound(_0x3c9f6e,_0x1c6d58){return function(_0x551cc6){if(!_0x551cc6){_0x3c9f6e[_0x2cea('0x2b')](0x194);}return _0x551cc6;};}function handleError(_0x69e6e8,_0x57037f){_0x57037f=_0x57037f||0x1f4;return function(_0x53c088){logger[_0x2cea('0x26')](_0x53c088['stack']);if(_0x53c088['name']){delete _0x53c088['name'];}_0x69e6e8['status'](_0x57037f)[_0x2cea('0x3a')](_0x53c088);};}exports[_0x2cea('0x3b')]=function(_0x53d597,_0x219560){var _0x3e0683={'include':[{'model':db[_0x2cea('0x3c')],'as':_0x2cea('0x3d')}]},_0x249aaa={},_0x51fae6={'count':0x0,'rows':[]};var _0x352f60=_[_0x2cea('0x3e')](db[_0x2cea('0x3f')][_0x2cea('0x40')],function(_0x3afee0){return{'name':_0x3afee0[_0x2cea('0x41')],'type':_0x3afee0[_0x2cea('0x42')][_0x2cea('0x43')]};});_0x249aaa[_0x2cea('0x44')]=_[_0x2cea('0x3e')](_0x352f60,_0x2cea('0x45'));_0x249aaa[_0x2cea('0x46')]=_[_0x2cea('0x47')](_0x53d597[_0x2cea('0x46')]);_0x249aaa[_0x2cea('0x48')]=_[_0x2cea('0x49')](_0x249aaa['model'],_0x249aaa[_0x2cea('0x46')]);_0x3e0683['attributes']=_[_0x2cea('0x49')](_0x249aaa[_0x2cea('0x44')],qs[_0x2cea('0x4a')](_0x53d597[_0x2cea('0x46')][_0x2cea('0x4a')]));_0x3e0683[_0x2cea('0x4b')]=_0x3e0683[_0x2cea('0x4b')][_0x2cea('0x4c')]?_0x3e0683[_0x2cea('0x4b')]:_0x249aaa[_0x2cea('0x44')];if(!_0x53d597['query']['hasOwnProperty'](_0x2cea('0x4d'))){_0x3e0683[_0x2cea('0x30')]=qs['limit'](_0x53d597[_0x2cea('0x46')]['limit']);_0x3e0683[_0x2cea('0x2f')]=qs['offset'](_0x53d597[_0x2cea('0x46')][_0x2cea('0x2f')]);}_0x3e0683[_0x2cea('0x4e')]=qs[_0x2cea('0x4f')](_0x53d597[_0x2cea('0x46')][_0x2cea('0x4f')]);_0x3e0683[_0x2cea('0x50')]=qs[_0x2cea('0x48')](_[_0x2cea('0x51')](_0x53d597[_0x2cea('0x46')],_0x249aaa['filters']),_0x352f60);if(_0x53d597[_0x2cea('0x46')][_0x2cea('0x52')]){_0x3e0683[_0x2cea('0x50')]=_[_0x2cea('0x53')](_0x3e0683['where'],{'$or':_['map'](_0x352f60,function(_0x41f86c){if(_0x41f86c[_0x2cea('0x42')]!==_0x2cea('0x54')){var _0x510e0f={};_0x510e0f[_0x41f86c[_0x2cea('0x45')]]={'$like':'%'+_0x53d597[_0x2cea('0x46')][_0x2cea('0x52')]+'%'};return _0x510e0f;}})});}_0x3e0683=_[_0x2cea('0x53')]({},_0x3e0683,_0x53d597['options']);var _0x3554cb={'where':_0x3e0683['where']};return db['WhatsappAccount'][_0x2cea('0x2e')](_0x3554cb)[_0x2cea('0x20')](function(_0x320396){_0x51fae6[_0x2cea('0x2e')]=_0x320396;if(_0x53d597['query']['includeAll']){_0x3e0683[_0x2cea('0x55')]=[{'all':!![]}];}return db[_0x2cea('0x3f')][_0x2cea('0x56')](_0x3e0683);})[_0x2cea('0x20')](function(_0x4e755c){_0x51fae6['rows']=_0x4e755c;return _0x51fae6;})['then'](respondWithFilteredResult(_0x219560,_0x3e0683))[_0x2cea('0x57')](handleError(_0x219560,null));};exports[_0x2cea('0x58')]=function(_0x127069,_0x25dc12){var _0x1e9937={'raw':![],'where':{'id':_0x127069[_0x2cea('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x2cea('0x3d')}]},_0x193e0c={};_0x193e0c[_0x2cea('0x44')]=_[_0x2cea('0x47')](db['WhatsappAccount'][_0x2cea('0x40')]);_0x193e0c['query']=_[_0x2cea('0x47')](_0x127069[_0x2cea('0x46')]);_0x193e0c[_0x2cea('0x48')]=_[_0x2cea('0x49')](_0x193e0c[_0x2cea('0x44')],_0x193e0c[_0x2cea('0x46')]);_0x1e9937[_0x2cea('0x4b')]=_[_0x2cea('0x49')](_0x193e0c['model'],qs[_0x2cea('0x4a')](_0x127069['query'][_0x2cea('0x4a')]));_0x1e9937[_0x2cea('0x4b')]=_0x1e9937[_0x2cea('0x4b')]['length']?_0x1e9937[_0x2cea('0x4b')]:_0x193e0c['model'];if(_0x127069['query'][_0x2cea('0x5a')]){_0x1e9937[_0x2cea('0x55')]=[{'all':!![]}];}_0x1e9937=_[_0x2cea('0x53')]({},_0x1e9937,_0x127069[_0x2cea('0x5b')]);return db[_0x2cea('0x3f')]['find'](_0x1e9937)['then'](handleEntityNotFound(_0x25dc12,null))[_0x2cea('0x20')](respondWithResult(_0x25dc12,null))[_0x2cea('0x57')](handleError(_0x25dc12,null));};exports[_0x2cea('0x5c')]=function(_0xacbf7a,_0x526269){return db[_0x2cea('0x3f')]['create'](_0xacbf7a[_0x2cea('0x5d')],{})[_0x2cea('0x20')](function(_0x35d64b){var _0x3f06d1=_0xacbf7a[_0x2cea('0x5e')]['get']({'plain':!![]});if(!_0x3f06d1)throw new Error(_0x2cea('0x5f'));if(_0x3f06d1[_0x2cea('0x60')]===_0x2cea('0x5e')){var _0x16b6ee=_0x35d64b[_0x2cea('0x36')]({'plain':!![]});var _0x4b25e0=_0x2cea('0x61');return db[_0x2cea('0x62')]['find']({'where':{'name':_0x4b25e0,'userProfileId':_0x3f06d1[_0x2cea('0x63')]},'raw':!![]})[_0x2cea('0x20')](function(_0x12b07a){if(_0x12b07a&&_0x12b07a[_0x2cea('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x16b6ee[_0x2cea('0x45')],'resourceId':_0x16b6ee['id'],'type':_0x12b07a[_0x2cea('0x45')],'sectionId':_0x12b07a['id']},{})['then'](function(){return _0x35d64b;});}else{return _0x35d64b;}})[_0x2cea('0x57')](function(_0x11178d){logger['error'](_0x2cea('0x65'),_0x11178d);throw _0x11178d;});}return _0x35d64b;})[_0x2cea('0x20')](respondWithResult(_0x526269,0xc9))[_0x2cea('0x57')](handleError(_0x526269,null));};exports[_0x2cea('0x35')]=function(_0x14daae,_0x54ade9){if(_0x14daae[_0x2cea('0x5d')]['id']){delete _0x14daae[_0x2cea('0x5d')]['id'];}return db['WhatsappAccount'][_0x2cea('0x66')]({'where':{'id':_0x14daae[_0x2cea('0x59')]['id']},'include':[{'model':db[_0x2cea('0x3c')],'as':_0x2cea('0x3d')}]})[_0x2cea('0x20')](handleEntityNotFound(_0x54ade9,null))[_0x2cea('0x20')](saveUpdates(_0x14daae[_0x2cea('0x5d')],null))[_0x2cea('0x20')](respondWithResult(_0x54ade9,null))[_0x2cea('0x57')](handleError(_0x54ade9,null));};exports[_0x2cea('0x38')]=function(_0x45e266,_0x175d9a){return db[_0x2cea('0x3f')]['find']({'where':{'id':_0x45e266['params']['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x175d9a,null))[_0x2cea('0x20')](removeEntity(_0x175d9a,null))[_0x2cea('0x57')](handleError(_0x175d9a,null));};exports[_0x2cea('0x67')]=function(_0x3c51e8,_0x3bb026){return db[_0x2cea('0x3f')]['describe']()['then'](respondWithResult(_0x3bb026,null))[_0x2cea('0x57')](handleError(_0x3bb026,null));};exports[_0x2cea('0x68')]=function(_0x316b28,_0x53ca15,_0x4e00b6){if(_0x316b28['body']['id']){delete _0x316b28[_0x2cea('0x5d')]['id'];}return db[_0x2cea('0x3f')]['find']({'where':{'id':_0x316b28['params']['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x53ca15,null))[_0x2cea('0x20')](function(_0x77f341){if(_0x77f341){_0x316b28[_0x2cea('0x5d')][_0x2cea('0x69')]=_0x77f341['id'];return db[_0x2cea('0x6a')][_0x2cea('0x5c')](_0x316b28[_0x2cea('0x5d')]);}})['then'](respondWithResult(_0x53ca15,null))[_0x2cea('0x57')](handleError(_0x53ca15,null));};exports[_0x2cea('0x6b')]=function(_0x236bf0,_0x2527e8,_0x2eca29){var _0x554659={'raw':![],'where':{}};var _0x122bc9={};var _0x242d94={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2cea('0x6c')]({'where':{'id':_0x236bf0[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x2527e8,null))[_0x2cea('0x20')](function(_0x5bcd33){if(_0x5bcd33){_0x122bc9[_0x2cea('0x44')]=_[_0x2cea('0x47')](db[_0x2cea('0x6a')]['rawAttributes']);_0x122bc9[_0x2cea('0x46')]=_[_0x2cea('0x47')](_0x236bf0[_0x2cea('0x46')]);_0x122bc9[_0x2cea('0x48')]=_[_0x2cea('0x49')](_0x122bc9[_0x2cea('0x44')],_0x122bc9[_0x2cea('0x46')]);_0x554659[_0x2cea('0x4b')]=_[_0x2cea('0x49')](_0x122bc9['model'],qs[_0x2cea('0x4a')](_0x236bf0[_0x2cea('0x46')][_0x2cea('0x4a')]));_0x554659[_0x2cea('0x4b')]=_0x554659['attributes'][_0x2cea('0x4c')]?_0x554659[_0x2cea('0x4b')]:_0x122bc9[_0x2cea('0x44')];if(!_0x236bf0[_0x2cea('0x46')]['hasOwnProperty'](_0x2cea('0x4d'))){_0x554659[_0x2cea('0x30')]=qs[_0x2cea('0x30')](_0x236bf0[_0x2cea('0x46')][_0x2cea('0x30')]);_0x554659[_0x2cea('0x2f')]=qs[_0x2cea('0x2f')](_0x236bf0[_0x2cea('0x46')][_0x2cea('0x2f')]);}_0x554659[_0x2cea('0x4e')]=qs[_0x2cea('0x4f')](_0x236bf0[_0x2cea('0x46')][_0x2cea('0x4f')]);_0x554659[_0x2cea('0x50')]=qs['filters'](_[_0x2cea('0x51')](_0x236bf0['query'],_0x122bc9[_0x2cea('0x48')]));_0x554659[_0x2cea('0x50')][_0x2cea('0x69')]=_0x5bcd33['id'];if(_0x236bf0[_0x2cea('0x46')][_0x2cea('0x52')]){_0x554659['where']=_[_0x2cea('0x53')](_0x554659['where'],{'$or':_['map'](_0x554659[_0x2cea('0x4b')],function(_0x453474){var _0x1da2f1={};_0x1da2f1[_0x453474]={'$like':'%'+_0x236bf0['query'][_0x2cea('0x52')]+'%'};return _0x1da2f1;})});}_0x554659=_[_0x2cea('0x53')]({},_0x554659,_0x236bf0[_0x2cea('0x5b')]);return db[_0x2cea('0x6a')]['count']({'where':_0x554659[_0x2cea('0x50')]})[_0x2cea('0x20')](function(_0x47e16f){_0x242d94[_0x2cea('0x2e')]=_0x47e16f;if(_0x236bf0[_0x2cea('0x46')][_0x2cea('0x5a')]){_0x554659[_0x2cea('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x2cea('0x56')](_0x554659);})['then'](function(_0x1ab9cd){_0x242d94[_0x2cea('0x6d')]=_0x1ab9cd;return _0x242d94;});}})[_0x2cea('0x20')](respondWithFilteredResult(_0x2527e8,_0x554659))[_0x2cea('0x57')](handleError(_0x2527e8,null));};exports[_0x2cea('0x6e')]=function(_0x3b3905,_0x257b0c,_0x1453fb){return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x3b3905[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x257b0c,null))[_0x2cea('0x20')](function(_0x2f3993){if(_0x2f3993){return _0x2f3993[_0x2cea('0x6e')](_0x3b3905[_0x2cea('0x46')][_0x2cea('0x6f')]);}})[_0x2cea('0x20')](respondWithStatusCode(_0x257b0c,null))[_0x2cea('0x57')](handleError(_0x257b0c,null));};exports[_0x2cea('0x70')]=function(_0x3ee973,_0x4a3127,_0x3d94e2){if(_0x3ee973[_0x2cea('0x5d')]['id']){delete _0x3ee973[_0x2cea('0x5d')]['id'];}return db['WhatsappAccount'][_0x2cea('0x66')]({'where':{'id':_0x3ee973[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x4a3127,null))[_0x2cea('0x20')](function(_0x1e2b88){if(_0x1e2b88){_0x3ee973['body']['WhatsappAccountId']=_0x1e2b88['id'];return db['CannedAnswer']['create'](_0x3ee973[_0x2cea('0x5d')]);}})['then'](respondWithResult(_0x4a3127,null))[_0x2cea('0x57')](handleError(_0x4a3127,null));};exports['getAnswers']=function(_0x364312,_0x1abeeb,_0x77794){var _0x14d7bb={'raw':![],'where':{}};var _0x5e9c7e={};var _0x40a827={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x2cea('0x6c')]({'where':{'id':_0x364312[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x1abeeb,null))[_0x2cea('0x20')](function(_0x3721a0){if(_0x3721a0){_0x5e9c7e['model']=_[_0x2cea('0x47')](db['CannedAnswer'][_0x2cea('0x40')]);_0x5e9c7e['query']=_[_0x2cea('0x47')](_0x364312['query']);_0x5e9c7e[_0x2cea('0x48')]=_[_0x2cea('0x49')](_0x5e9c7e[_0x2cea('0x44')],_0x5e9c7e[_0x2cea('0x46')]);_0x14d7bb[_0x2cea('0x4b')]=_[_0x2cea('0x49')](_0x5e9c7e[_0x2cea('0x44')],qs[_0x2cea('0x4a')](_0x364312['query'][_0x2cea('0x4a')]));_0x14d7bb['attributes']=_0x14d7bb[_0x2cea('0x4b')]['length']?_0x14d7bb[_0x2cea('0x4b')]:_0x5e9c7e[_0x2cea('0x44')];if(!_0x364312['query'][_0x2cea('0x71')](_0x2cea('0x4d'))){_0x14d7bb[_0x2cea('0x30')]=qs[_0x2cea('0x30')](_0x364312[_0x2cea('0x46')][_0x2cea('0x30')]);_0x14d7bb[_0x2cea('0x2f')]=qs[_0x2cea('0x2f')](_0x364312[_0x2cea('0x46')][_0x2cea('0x2f')]);}_0x14d7bb[_0x2cea('0x4e')]=qs[_0x2cea('0x4f')](_0x364312[_0x2cea('0x46')][_0x2cea('0x4f')]);_0x14d7bb['where']=qs['filters'](_[_0x2cea('0x51')](_0x364312[_0x2cea('0x46')],_0x5e9c7e[_0x2cea('0x48')]));_0x14d7bb[_0x2cea('0x50')][_0x2cea('0x69')]=_0x3721a0['id'];if(_0x364312['query']['filter']){_0x14d7bb[_0x2cea('0x50')]=_[_0x2cea('0x53')](_0x14d7bb[_0x2cea('0x50')],{'$or':_[_0x2cea('0x3e')](_0x14d7bb['attributes'],function(_0x1c15e4){var _0x29878a={};_0x29878a[_0x1c15e4]={'$like':'%'+_0x364312[_0x2cea('0x46')]['filter']+'%'};return _0x29878a;})});}_0x14d7bb=_[_0x2cea('0x53')]({},_0x14d7bb,_0x364312[_0x2cea('0x5b')]);return db[_0x2cea('0x72')][_0x2cea('0x2e')]({'where':_0x14d7bb[_0x2cea('0x50')]})[_0x2cea('0x20')](function(_0x5f050c){_0x40a827[_0x2cea('0x2e')]=_0x5f050c;if(_0x364312[_0x2cea('0x46')]['includeAll']){_0x14d7bb[_0x2cea('0x55')]=[{'all':!![]}];}return db[_0x2cea('0x72')][_0x2cea('0x56')](_0x14d7bb);})['then'](function(_0x4abfbe){_0x40a827[_0x2cea('0x6d')]=_0x4abfbe;return _0x40a827;});}})[_0x2cea('0x20')](respondWithFilteredResult(_0x1abeeb,_0x14d7bb))[_0x2cea('0x57')](handleError(_0x1abeeb,null));};exports[_0x2cea('0x73')]=function(_0x44af15,_0x29b46a,_0x3f4f4a){return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x44af15[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x29b46a,null))[_0x2cea('0x20')](function(_0x59ce34){if(_0x59ce34){return _0x59ce34[_0x2cea('0x73')](_0x44af15['query'][_0x2cea('0x6f')]);}})[_0x2cea('0x20')](respondWithStatusCode(_0x29b46a,null))[_0x2cea('0x57')](handleError(_0x29b46a,null));};exports['addAgents']=function(_0x672c,_0x542c68,_0x2c865b){return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x672c[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x542c68,null))[_0x2cea('0x20')](function(_0x42102c){if(_0x42102c){return _0x42102c['addAgents'](_0x672c[_0x2cea('0x5d')][_0x2cea('0x6f')],_[_0x2cea('0x74')](_0x672c['body'],[_0x2cea('0x6f'),'id'])||{})['spread'](function(_0x4d0eea){for(var _0x274170=0x0;_0x274170<_0x672c[_0x2cea('0x5d')][_0x2cea('0x6f')]['length'];_0x274170+=0x1){socket[_0x2cea('0x75')]('userWhatsappAccount:save',{'UserId':_0x672c['body'][_0x2cea('0x6f')][_0x274170],'WhatsappAccountId':_0x672c['params']['id']});}return _0x4d0eea;});}})[_0x2cea('0x20')](respondWithResult(_0x542c68,null))[_0x2cea('0x57')](handleError(_0x542c68,null));};exports[_0x2cea('0x76')]=function(_0x4d1fab,_0x511109,_0x173359){return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x4d1fab[_0x2cea('0x59')]['id']}})['then'](handleEntityNotFound(_0x511109,null))['then'](function(_0x42130c){if(_0x42130c){return _0x42130c[_0x2cea('0x76')](_0x4d1fab[_0x2cea('0x46')][_0x2cea('0x6f')])[_0x2cea('0x20')](function(){if(_[_0x2cea('0x77')](_0x4d1fab[_0x2cea('0x46')][_0x2cea('0x6f')])){for(var _0x3a6e0c=0x0;_0x3a6e0c<_0x4d1fab['query'][_0x2cea('0x6f')][_0x2cea('0x4c')];_0x3a6e0c+=0x1){socket[_0x2cea('0x75')](_0x2cea('0x78'),{'UserId':Number(_0x4d1fab['query']['ids'][_0x3a6e0c]),'WhatsappAccountId':Number(_0x4d1fab[_0x2cea('0x59')]['id'])});}}else{socket['emit'](_0x2cea('0x78'),{'UserId':Number(_0x4d1fab[_0x2cea('0x46')][_0x2cea('0x6f')]),'WhatsappAccountId':Number(_0x4d1fab[_0x2cea('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x511109,null))[_0x2cea('0x57')](handleError(_0x511109,null));};exports[_0x2cea('0x79')]=function(_0x40d395,_0x1ab80a,_0x1962df){var _0x1a7350={};var _0x416db2={};var _0x56819f;var _0x7d3f87;return db[_0x2cea('0x3f')][_0x2cea('0x6c')]({'where':{'id':_0x40d395[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x1ab80a,null))[_0x2cea('0x20')](function(_0x5b8162){if(_0x5b8162){_0x56819f=_0x5b8162;_0x416db2[_0x2cea('0x44')]=_[_0x2cea('0x47')](db[_0x2cea('0x7a')][_0x2cea('0x40')]);_0x416db2['query']=_[_0x2cea('0x47')](_0x40d395[_0x2cea('0x46')]);_0x416db2[_0x2cea('0x48')]=_['intersection'](_0x416db2[_0x2cea('0x44')],_0x416db2['query']);_0x1a7350[_0x2cea('0x4b')]=_[_0x2cea('0x49')](_0x416db2[_0x2cea('0x44')],qs['fields'](_0x40d395[_0x2cea('0x46')][_0x2cea('0x4a')]));_0x1a7350['attributes']=_0x1a7350[_0x2cea('0x4b')]['length']?_0x1a7350[_0x2cea('0x4b')]:_0x416db2[_0x2cea('0x44')];_0x1a7350[_0x2cea('0x4e')]=qs['sort'](_0x40d395['query'][_0x2cea('0x4f')]);_0x1a7350[_0x2cea('0x50')]=qs[_0x2cea('0x48')](_['pick'](_0x40d395[_0x2cea('0x46')],_0x416db2[_0x2cea('0x48')]));if(_0x40d395[_0x2cea('0x46')][_0x2cea('0x52')]){_0x1a7350[_0x2cea('0x50')]=_['merge'](_0x1a7350[_0x2cea('0x50')],{'$or':_['map'](_0x1a7350[_0x2cea('0x4b')],function(_0x50a48e){var _0x4d2aea={};_0x4d2aea[_0x50a48e]={'$like':'%'+_0x40d395[_0x2cea('0x46')][_0x2cea('0x52')]+'%'};return _0x4d2aea;})});}_0x1a7350=_[_0x2cea('0x53')]({},_0x1a7350,_0x40d395['options']);return _0x56819f['getAgents'](_0x1a7350);}})[_0x2cea('0x20')](function(_0x206116){if(_0x206116){_0x7d3f87=_0x206116[_0x2cea('0x4c')];if(!_0x40d395[_0x2cea('0x46')][_0x2cea('0x71')](_0x2cea('0x4d'))){_0x1a7350['limit']=qs[_0x2cea('0x30')](_0x40d395[_0x2cea('0x46')][_0x2cea('0x30')]);_0x1a7350[_0x2cea('0x2f')]=qs[_0x2cea('0x2f')](_0x40d395[_0x2cea('0x46')][_0x2cea('0x2f')]);}return _0x56819f[_0x2cea('0x79')](_0x1a7350);}})[_0x2cea('0x20')](function(_0x53f40c){if(_0x53f40c){return _0x53f40c?{'count':_0x7d3f87,'rows':_0x53f40c}:null;}})[_0x2cea('0x20')](respondWithResult(_0x1ab80a,null))['catch'](handleError(_0x1ab80a,null));};exports[_0x2cea('0x7b')]=function(_0x5a55ba,_0x130dae,_0x3ae10d){return db[_0x2cea('0x3f')][_0x2cea('0x6c')]({'where':{'id':_0x5a55ba[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x130dae,null))['then'](function(_0x1cb121){if(_0x1cb121){return db[_0x2cea('0x7c')][_0x2cea('0x7d')](function(_0x341b3a){return db['WhatsappApplication'][_0x2cea('0x38')]({'where':{'WhatsappAccountId':_0x5a55ba['params']['id']},'transaction':_0x341b3a})[_0x2cea('0x20')](function(_0x890180){var _0x2943b7=_[_0x2cea('0x3e')](_0x5a55ba[_0x2cea('0x5d')],function(_0x4559c1){_0x4559c1['WhatsappAccountId']=_0x5a55ba[_0x2cea('0x59')]['id'];return _0x4559c1;});return db[_0x2cea('0x7e')][_0x2cea('0x7f')](_0x2943b7,{'transaction':_0x341b3a});});})['then'](function(){return db[_0x2cea('0x7e')][_0x2cea('0x80')]({'where':{'WhatsappAccountId':_0x5a55ba[_0x2cea('0x59')]['id']},'order':_0x2cea('0x81')});});}})[_0x2cea('0x20')](respondWithResult(_0x130dae,null))[_0x2cea('0x57')](handleError(_0x130dae,null));};exports[_0x2cea('0x82')]=function(_0x58329d,_0x2fc390,_0x3f034e){var _0x4b6511={};var _0x1b5784={};var _0x5d220f;var _0x329cd0;return db[_0x2cea('0x3f')][_0x2cea('0x6c')]({'where':{'id':_0x58329d[_0x2cea('0x59')]['id']}})[_0x2cea('0x20')](handleEntityNotFound(_0x2fc390,null))[_0x2cea('0x20')](function(_0x1d5b52){if(_0x1d5b52){_0x5d220f=_0x1d5b52;_0x1b5784[_0x2cea('0x44')]=_['keys'](db[_0x2cea('0x7e')][_0x2cea('0x40')]);_0x1b5784[_0x2cea('0x46')]=_[_0x2cea('0x47')](_0x58329d[_0x2cea('0x46')]);_0x1b5784[_0x2cea('0x48')]=_[_0x2cea('0x49')](_0x1b5784[_0x2cea('0x44')],_0x1b5784[_0x2cea('0x46')]);_0x4b6511['attributes']=_[_0x2cea('0x49')](_0x1b5784['model'],qs[_0x2cea('0x4a')](_0x58329d['query'][_0x2cea('0x4a')]));_0x4b6511[_0x2cea('0x4b')]=_0x4b6511[_0x2cea('0x4b')][_0x2cea('0x4c')]?_0x4b6511[_0x2cea('0x4b')]:_0x1b5784[_0x2cea('0x44')];_0x4b6511[_0x2cea('0x4e')]=qs[_0x2cea('0x4f')](_0x58329d[_0x2cea('0x46')][_0x2cea('0x4f')]);_0x4b6511[_0x2cea('0x50')]=qs['filters'](_[_0x2cea('0x51')](_0x58329d[_0x2cea('0x46')],_0x1b5784[_0x2cea('0x48')]));if(_0x58329d['query']['filter']){_0x4b6511[_0x2cea('0x50')]=_[_0x2cea('0x53')](_0x4b6511[_0x2cea('0x50')],{'$or':_['map'](_0x4b6511[_0x2cea('0x4b')],function(_0x3a0d50){var _0x1e5f04={};_0x1e5f04[_0x3a0d50]={'$like':'%'+_0x58329d[_0x2cea('0x46')][_0x2cea('0x52')]+'%'};return _0x1e5f04;})});}_0x4b6511=_[_0x2cea('0x53')]({},_0x4b6511,_0x58329d[_0x2cea('0x5b')]);return _0x5d220f[_0x2cea('0x82')](_0x4b6511);}})[_0x2cea('0x20')](function(_0x10a9b9){if(_0x10a9b9){_0x329cd0=_0x10a9b9['length'];if(!_0x58329d[_0x2cea('0x46')]['hasOwnProperty'](_0x2cea('0x4d'))){_0x4b6511[_0x2cea('0x30')]=qs['limit'](_0x58329d[_0x2cea('0x46')][_0x2cea('0x30')]);_0x4b6511[_0x2cea('0x2f')]=qs[_0x2cea('0x2f')](_0x58329d['query'][_0x2cea('0x2f')]);}return _0x5d220f['getApplications'](_0x4b6511);}})[_0x2cea('0x20')](function(_0x485914){if(_0x485914){return _0x485914?{'count':_0x329cd0,'rows':_0x485914}:null;}})[_0x2cea('0x20')](respondWithResult(_0x2fc390,null))[_0x2cea('0x57')](handleError(_0x2fc390,null));};exports[_0x2cea('0x83')]=function(_0x17fe9e,_0x54c153,_0x5fc9d){var _0x458743={'channel':_0x2cea('0x84')};var _0x4c59c4=[];var _0x32bf00=[];var _0x1ea68c={};return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x17fe9e['params']['id']},'include':[{'model':db[_0x2cea('0x7e')],'as':_0x2cea('0x85')}]})[_0x2cea('0x20')](handleEntityNotFound(_0x54c153,null))[_0x2cea('0x20')](function(_0x45ee41){_0x458743[_0x2cea('0x86')]=_0x45ee41;_0x458743[_0x2cea('0x87')]=_[_0x2cea('0x88')](_0x45ee41[_0x2cea('0x85')],[_0x2cea('0x81')],[_0x2cea('0x89')]);if(_0x458743[_0x2cea('0x86')][_0x2cea('0x85')]){delete _0x458743[_0x2cea('0x86')][_0x2cea('0x85')];}return db[_0x2cea('0x8a')][_0x2cea('0x67')]();})[_0x2cea('0x20')](function(_0xc6abe7){if(!_0xc6abe7){throw new db[(_0x2cea('0x1c'))]['ValidationError']('no\x20available\x20attributes');}_0x4c59c4=_['difference'](_[_0x2cea('0x47')](_0xc6abe7),[_0x2cea('0x8b'),'updatedAt']);_0x32bf00=_[_0x2cea('0x8c')](_[_0x2cea('0x47')](_0xc6abe7),['createdAt',_0x2cea('0x8d'),'CompanyId',_0x2cea('0x8e')]);_0x458743[_0x2cea('0x5d')]={'mapKey':_0x2cea('0x8f')};if(_0x458743[_0x2cea('0x86')]['type']&&_0x458743['account']['type']===_0x2cea('0x90')){_0x458743['body']['from']=_0x17fe9e[_0x2cea('0x5d')]['From'][_0x2cea('0x91')](_0x2cea('0x92'),'');_0x458743[_0x2cea('0x5d')][_0x2cea('0x5d')]=_0x17fe9e[_0x2cea('0x5d')]['Body'];_0x458743[_0x2cea('0x5d')][_0x2cea('0x93')]=_0x17fe9e[_0x2cea('0x5d')]['MessageSid'];}if(_0x458743[_0x2cea('0x5d')]['id']){delete _0x458743[_0x2cea('0x5d')]['id'];}if(_[_0x2cea('0x94')](_0x458743[_0x2cea('0x5d')][_0x2cea('0x95')])){throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))](_0x2cea('0x96'));}if(_['isNil'](_0x458743[_0x2cea('0x5d')][_0x2cea('0x5d')])||_0x458743[_0x2cea('0x5d')][_0x2cea('0x5d')]===''){throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2cea('0x94')](_0x458743[_0x2cea('0x5d')][_0x2cea('0x97')])){throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32bf00);}if(!_['includes'](_0x32bf00,_0x458743[_0x2cea('0x5d')]['mapKey'])){throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32bf00);}_0x1ea68c[_0x458743['body'][_0x2cea('0x97')]]=_0x458743[_0x2cea('0x5d')][_0x2cea('0x95')];return db[_0x2cea('0x98')][_0x2cea('0x66')]({'where':{'id':_0x458743[_0x2cea('0x86')]['ListId']},'include':[{'model':db[_0x2cea('0x8a')],'as':_0x2cea('0x99'),'where':_0x1ea68c,'limit':0x1,'order':[[_0x2cea('0x8d'),_0x2cea('0x9a')]]}]});})[_0x2cea('0x20')](handleEntityNotFound(_0x54c153,null))['then'](function(_0x4974db){if(_0x4974db){_0x458743[_0x2cea('0x9b')]=_[_0x2cea('0x74')](_0x4974db,[_0x2cea('0x99')]);if(_0x4974db[_0x2cea('0x99')][_0x2cea('0x4c')]){return _0x4974db[_0x2cea('0x99')][0x0];}var _0x11a46c=_[_0x2cea('0x9c')](_0x458743[_0x2cea('0x5d')],{'firstName':_0x458743[_0x2cea('0x5d')]['from'],'ListId':_0x4974db['id']});_0x11a46c[_0x458743[_0x2cea('0x5d')][_0x2cea('0x97')]]=_0x458743[_0x2cea('0x5d')]['from'];return db[_0x2cea('0x8a')][_0x2cea('0x5c')](_0x11a46c,{'fields':_0x4c59c4,'raw':!![]});}})['then'](handleEntityNotFound(_0x54c153,null))[_0x2cea('0x20')](function(_0x8203fd){if(_0x8203fd){_0x458743['contact']=_0x8203fd;var _0x55c253={'ContactId':_0x8203fd['id'],'phone':_0x458743['body']['from'],'WhatsappAccountId':_0x17fe9e[_0x2cea('0x59')]['id']};var _0x41d753={'ContactId':_0x8203fd['id'],'WhatsappAccountId':_0x17fe9e[_0x2cea('0x59')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x2cea('0x66')]({'where':_0x41d753})[_0x2cea('0x20')](function(_0x38c203){if(_0x38c203){return[_0x38c203,![]];}return db['WhatsappInteraction'][_0x2cea('0x5c')](_0x55c253)[_0x2cea('0x20')](function(_0x4916a7){return[_0x4916a7,!![]];});});}})['spread'](function(_0x21742e,_0x2c902e){_0x458743['interaction']=_0x21742e[_0x2cea('0x36')]({'plain':!![]});_0x458743[_0x2cea('0x9d')][_0x2cea('0x9e')]=![];if(_0x2c902e){if(_0x458743[_0x2cea('0x86')][_0x2cea('0x9f')]){_0x458743[_0x2cea('0x87')][_0x2cea('0xa0')]({'id':0x0,'priority':_0x458743[_0x2cea('0x87')][_0x2cea('0x4c')]+0x1,'app':_0x2cea('0xa1'),'appdata':_0x2cea('0xa2'),'interval':'*,*,*,*'});}_0x458743[_0x2cea('0x9d')]['created']=!![];}return db[_0x2cea('0xa3')]['create']({'phone':_0x458743['body'][_0x2cea('0x95')],'messageId':_0x458743['body']['messageId'],'body':_0x458743[_0x2cea('0x5d')][_0x2cea('0x5d')],'WhatsappAccountId':_0x17fe9e[_0x2cea('0x59')]['id'],'WhatsappInteractionId':_0x21742e['id'],'direction':'in','ContactId':_0x21742e[_0x2cea('0xa4')],'AttachmentId':_0x458743['body'][_0x2cea('0xa5')]});})[_0x2cea('0x20')](function(_0x3fa5ca){_0x458743[_0x2cea('0x29')]=_0x3fa5ca;if(_0x458743['interaction']['UserId']){return db[_0x2cea('0x7a')][_0x2cea('0x66')]({'attributes':['id',_0x2cea('0x45')],'where':{'id':_0x458743[_0x2cea('0x9d')][_0x2cea('0xa6')]}})[_0x2cea('0x20')](function(_0x2f45b3){if(_0x2f45b3){_0x458743[_0x2cea('0x87')][_0x2cea('0xa7')]({'id':0x0,'priority':0x0,'app':_0x2cea('0xa8'),'appdata':_0x2f45b3[_0x2cea('0x45')]+','+(_0x458743[_0x2cea('0x86')]['waitForTheAssignedAgent']||0xa),'interval':_0x2cea('0xa9')});}return respondWithRpcPromise(_0x2cea('0xaa'),_0x2cea('0xab'),_0x458743);});}return respondWithRpcPromise('Start',_0x2cea('0xab'),_0x458743);})['then'](function(_0x200530){if(_0x200530){var _0x5b6c42=0xc8;var _0x466b70=_0x2cea('0xac');logger[_0x2cea('0x21')](_0x2cea('0x24'),_0x466b70,_0x5b6c42,_0x2cea('0xad'));logger[_0x2cea('0x23')](_0x2cea('0xae'),_0x466b70,_0x5b6c42,_0x2cea('0xad'),JSON[_0x2cea('0x25')](_0x200530));if(_0x458743[_0x2cea('0x86')][_0x2cea('0x42')]==='twilio'){return _0x54c153[_0x2cea('0x2c')](_0x5b6c42)[_0x2cea('0x31')](_0x2cea('0xaf'),_0x2cea('0xb0'))[_0x2cea('0x3a')]('\x0a');}else{return _0x54c153[_0x2cea('0x2c')](_0x5b6c42)[_0x2cea('0x2d')](_0x200530);}}})['catch'](handleError(_0x54c153,null));};exports['send']=function(_0x1bd88c,_0x3219c5,_0x550eda){var _0x26d520,_0x25e5eb,_0x150b47;if(_[_0x2cea('0x94')](_0x1bd88c[_0x2cea('0x5d')]['body'])||_0x1bd88c[_0x2cea('0x5d')][_0x2cea('0x5d')]===''){throw new db['Sequelize'][(_0x2cea('0x1d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2cea('0x94')](_0x1bd88c[_0x2cea('0x5d')]['to'])){throw new db[(_0x2cea('0x1c'))][(_0x2cea('0x1d'))](_0x2cea('0xb1'));}_0x26d520=_0x1bd88c[_0x2cea('0x5d')]['to'];return db[_0x2cea('0x3f')][_0x2cea('0x66')]({'where':{'id':_0x1bd88c[_0x2cea('0x59')]['id']},'include':[{'model':db[_0x2cea('0x98')],'as':_0x2cea('0xb2'),'include':[{'model':db[_0x2cea('0x8a')],'as':_0x2cea('0x99'),'where':{'mobile':_0x26d520},'limit':0x1,'order':[['updatedAt',_0x2cea('0x9a')]]}]}]})[_0x2cea('0x20')](handleEntityNotFound(_0x3219c5,null))[_0x2cea('0x20')](function(_0x438d2b){if(_0x438d2b&&_0x438d2b[_0x2cea('0xb2')]){_0x25e5eb=_0x438d2b[_0x2cea('0x36')]({'plain':!![]});if(_0x25e5eb[_0x2cea('0xb2')]&&_0x25e5eb[_0x2cea('0xb2')][_0x2cea('0x99')][_0x2cea('0x4c')]){return _0x25e5eb[_0x2cea('0xb2')][_0x2cea('0x99')][0x0];}return db['CmContact'][_0x2cea('0x5c')](_[_0x2cea('0x9c')](_0x1bd88c[_0x2cea('0x5d')],{'firstName':_0x26d520,'mobile':_0x26d520,'phone':_0x26d520,'ListId':_0x25e5eb[_0x2cea('0x8e')]}));}})[_0x2cea('0x20')](handleEntityNotFound(_0x3219c5,null))['then'](function(_0x2a0e94){if(_0x2a0e94){_0x150b47=_0x2a0e94;return db[_0x2cea('0xb3')][_0x2cea('0x66')]({'where':{'ContactId':_0x150b47['id'],'closed':![],'WhatsappAccountId':_0x25e5eb['id']}})[_0x2cea('0x20')](function(_0x48b36b){if(_0x48b36b){return[_0x48b36b,![]];}return db[_0x2cea('0xb3')][_0x2cea('0x5c')]({'UserId':_0x1bd88c[_0x2cea('0x5e')]['id'],'ContactId':_0x150b47['id'],'WhatsappAccountId':_0x25e5eb['id'],'phone':_0x26d520,'firstMsgDirection':_0x2cea('0xb4'),'Messages':[_[_0x2cea('0x53')](_0x1bd88c[_0x2cea('0x5d')],{'read':![],'body':_0x1bd88c['body'][_0x2cea('0x5d')],'phone':_0x26d520,'WhatsappAccountId':_0x25e5eb['id'],'UserId':_0x1bd88c[_0x2cea('0x5e')]['id'],'ContactId':_0x150b47['id']})]},{'include':[{'model':db[_0x2cea('0xa3')],'as':'Messages'}]})[_0x2cea('0x20')](function(_0x404241){return[_0x404241,!![]];});});}})[_0x2cea('0xb5')](function(_0x21a68d,_0x2f011f){if(_0x2f011f){return _0x21a68d;}return db['WhatsappMessage'][_0x2cea('0x5c')](_[_0x2cea('0x53')](_0x1bd88c[_0x2cea('0x5d')],{'read':![],'body':_0x1bd88c['body'][_0x2cea('0x5d')],'phone':_0x26d520,'WhatsappAccountId':_0x25e5eb['id'],'WhatsappInteractionId':_0x21a68d['id'],'UserId':_0x1bd88c['user']['id'],'ContactId':_0x150b47['id']}))[_0x2cea('0x20')](function(_0x89e95){_0x21a68d[_0x2cea('0xb6')][_0x2cea('0xb7')]=[];_0x21a68d[_0x2cea('0xb6')][_0x2cea('0xb7')][_0x2cea('0xa0')](_0x89e95[_0x2cea('0xb6')]);return _0x21a68d;});})['then'](respondWithResult(_0x3219c5,null))[_0x2cea('0x57')](handleError(_0x3219c5,null));}; \ No newline at end of file +var _0xa74f=['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','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','offset','limit','Content-Range','json','apply','reject','update','then','destroy','WhatsappAccounts','end','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','count','findAll','rows','show','params','includeAll','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','account','orderBy','Applications','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','whatsapp:','Body','MessageSid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','WhatsappInteraction','interaction','created','autoclose','applications','push','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','DESC','user','out','Messages','spread','dataValues','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','Sequelize'];(function(_0x18bcbc,_0x317121){var _0x5356dc=function(_0x2b9a26){while(--_0x2b9a26){_0x18bcbc['push'](_0x18bcbc['shift']());}};_0x5356dc(++_0x317121);}(_0xa74f,0x9a));var _0xfa74=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0xa74f[_0x3e25c1];return _0x52e7f2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xfa74('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa74('0x1'));var moment=require(_0xfa74('0x2'));var BPromise=require(_0xfa74('0x3'));var Mustache=require(_0xfa74('0x4'));var util=require('util');var path=require(_0xfa74('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa74('0x6'));var fs=require('fs');var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var db=require(_0xfa74('0x15'))['db'];config['redis']=_[_0xfa74('0x16')](config[_0xfa74('0x17')],{'host':_0xfa74('0x18'),'port':0x18eb});var socket=require(_0xfa74('0x19'))(new Redis(config['redis']));require(_0xfa74('0x1a'))[_0xfa74('0x1b')](socket);var jayson=require(_0xfa74('0x1c'));var client=jayson[_0xfa74('0x1d')][_0xfa74('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x47c8fb,_0x199d20,_0x13d911){if(_0x13d911){var _0x947da6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x947da6[_0xfa74('0x1f')](_0x199d20)){return _0x47c8fb;}else{throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0x22'));}}else{return _0x47c8fb;}}function respondWithRpcPromise(_0x48c119,_0x58a67a,_0xe0e33d,_0x51dda1){return new BPromise(function(_0x4928b6,_0x31d3c1){var _0x25a36b=_0x51dda1||client;return _0x25a36b[_0xfa74('0x23')](_0x48c119,_0xe0e33d)['then'](function(_0x3bede6){logger[_0xfa74('0x24')](_0xfa74('0x25'),_0x58a67a,'request\x20sent');logger[_0xfa74('0x26')](_0xfa74('0x27'),_0x58a67a,_0xfa74('0x28'),JSON['stringify'](_0x3bede6));if(_0x3bede6['error']){if(_0x3bede6[_0xfa74('0x29')][_0xfa74('0x2a')]===0x1f4){logger[_0xfa74('0x29')](_0xfa74('0x25'),_0x58a67a,_0x3bede6[_0xfa74('0x29')]['message']);return _0x31d3c1(_0x3bede6['error'][_0xfa74('0x2b')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x58a67a,_0x3bede6['error'][_0xfa74('0x2b')]);return _0x4928b6(_0x3bede6[_0xfa74('0x29')][_0xfa74('0x2b')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x58a67a,_0xfa74('0x28'));_0x4928b6(_0x3bede6[_0xfa74('0x2c')]['message']);}})[_0xfa74('0x2d')](function(_0x5d3b26){logger[_0xfa74('0x29')](_0xfa74('0x25'),_0x58a67a,_0x5d3b26);_0x31d3c1(_0x5d3b26);});});}function respondWithStatusCode(_0x55d8e4,_0x298388){_0x298388=_0x298388||0xcc;return function(_0x1130de){if(_0x1130de){return _0x55d8e4[_0xfa74('0x2e')](_0x298388);}return _0x55d8e4[_0xfa74('0x2f')](_0x298388)['end']();};}function respondWithResult(_0xd9c55d,_0x2f7cd7){_0x2f7cd7=_0x2f7cd7||0xc8;return function(_0x204e01){if(_0x204e01){return _0xd9c55d['status'](_0x2f7cd7)['json'](_0x204e01);}};}function respondWithFilteredResult(_0x1322a4,_0x8b706e){return function(_0x5df5cd){if(_0x5df5cd){var _0x4b38fc=_0x5df5cd['count'],_0x343466=_0x8b706e[_0xfa74('0x30')],_0x564060=_0x8b706e[_0xfa74('0x30')]+_0x8b706e[_0xfa74('0x31')],_0x2238d4;if(_0x564060>=_0x4b38fc){_0x564060=_0x4b38fc;_0x2238d4=0xc8;}else{_0x2238d4=0xce;}_0x1322a4[_0xfa74('0x2f')](_0x2238d4);return _0x1322a4['set'](_0xfa74('0x32'),_0x343466+'-'+_0x564060+'/'+_0x4b38fc)[_0xfa74('0x33')](_0x5df5cd);}return null;};}function patchUpdates(_0x317180){return function(_0x16f9dc){try{jsonpatch[_0xfa74('0x34')](_0x16f9dc,_0x317180,!![]);}catch(_0xb878c7){return BPromise[_0xfa74('0x35')](_0xb878c7);}return _0x16f9dc['save']();};}function saveUpdates(_0x20fc18,_0x5a9f43){return function(_0x74665c){if(_0x74665c){return _0x74665c[_0xfa74('0x36')](_0x20fc18)[_0xfa74('0x37')](function(_0x1b5ff0){return _0x1b5ff0;});}return null;};}function removeEntity(_0x562289,_0x5055d3){return function(_0x390ed4){if(_0x390ed4){return _0x390ed4[_0xfa74('0x38')]()[_0xfa74('0x37')](function(){var _0x25863f=_0x390ed4['get']({'plain':!![]});var _0x441eaa=_0xfa74('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x441eaa,'resourceId':_0x25863f['id']}})['then'](function(){return _0x390ed4;});})['then'](function(){_0x562289['status'](0xcc)[_0xfa74('0x3a')]();});}};}function handleEntityNotFound(_0x1c3b44,_0x3dcda3){return function(_0x235607){if(!_0x235607){_0x1c3b44[_0xfa74('0x2e')](0x194);}return _0x235607;};}function handleError(_0x304f6e,_0x19094d){_0x19094d=_0x19094d||0x1f4;return function(_0x13475a){logger[_0xfa74('0x29')](_0x13475a['stack']);if(_0x13475a[_0xfa74('0x3b')]){delete _0x13475a[_0xfa74('0x3b')];}_0x304f6e[_0xfa74('0x2f')](_0x19094d)[_0xfa74('0x3c')](_0x13475a);};}exports[_0xfa74('0x3d')]=function(_0x186126,_0x5e58dd){var _0x4307be={'include':[{'model':db[_0xfa74('0x3e')],'as':'mandatoryDispositionPause'}]},_0x1f0806={},_0x12f22c={'count':0x0,'rows':[]};var _0x207566=_[_0xfa74('0x3f')](db[_0xfa74('0x40')][_0xfa74('0x41')],function(_0x565b5d){return{'name':_0x565b5d[_0xfa74('0x42')],'type':_0x565b5d[_0xfa74('0x43')][_0xfa74('0x44')]};});_0x1f0806['model']=_['map'](_0x207566,_0xfa74('0x3b'));_0x1f0806[_0xfa74('0x45')]=_[_0xfa74('0x46')](_0x186126[_0xfa74('0x45')]);_0x1f0806['filters']=_[_0xfa74('0x47')](_0x1f0806[_0xfa74('0x48')],_0x1f0806['query']);_0x4307be['attributes']=_['intersection'](_0x1f0806['model'],qs[_0xfa74('0x49')](_0x186126[_0xfa74('0x45')][_0xfa74('0x49')]));_0x4307be[_0xfa74('0x4a')]=_0x4307be[_0xfa74('0x4a')][_0xfa74('0x4b')]?_0x4307be[_0xfa74('0x4a')]:_0x1f0806['model'];if(!_0x186126[_0xfa74('0x45')][_0xfa74('0x4c')](_0xfa74('0x4d'))){_0x4307be[_0xfa74('0x31')]=qs[_0xfa74('0x31')](_0x186126['query'][_0xfa74('0x31')]);_0x4307be[_0xfa74('0x30')]=qs[_0xfa74('0x30')](_0x186126[_0xfa74('0x45')][_0xfa74('0x30')]);}_0x4307be[_0xfa74('0x4e')]=qs[_0xfa74('0x4f')](_0x186126[_0xfa74('0x45')][_0xfa74('0x4f')]);_0x4307be[_0xfa74('0x50')]=qs['filters'](_[_0xfa74('0x51')](_0x186126['query'],_0x1f0806[_0xfa74('0x52')]),_0x207566);if(_0x186126[_0xfa74('0x45')][_0xfa74('0x53')]){_0x4307be[_0xfa74('0x50')]=_['merge'](_0x4307be[_0xfa74('0x50')],{'$or':_[_0xfa74('0x3f')](_0x207566,function(_0x480287){if(_0x480287[_0xfa74('0x43')]!==_0xfa74('0x54')){var _0x5cbb70={};_0x5cbb70[_0x480287[_0xfa74('0x3b')]]={'$like':'%'+_0x186126[_0xfa74('0x45')][_0xfa74('0x53')]+'%'};return _0x5cbb70;}})});}_0x4307be=_[_0xfa74('0x55')]({},_0x4307be,_0x186126[_0xfa74('0x56')]);var _0x5e116b={'where':_0x4307be['where']};return db[_0xfa74('0x40')][_0xfa74('0x57')](_0x5e116b)['then'](function(_0x32e440){_0x12f22c[_0xfa74('0x57')]=_0x32e440;if(_0x186126[_0xfa74('0x45')]['includeAll']){_0x4307be['include']=[{'all':!![]}];}return db[_0xfa74('0x40')][_0xfa74('0x58')](_0x4307be);})[_0xfa74('0x37')](function(_0x186700){_0x12f22c[_0xfa74('0x59')]=_0x186700;return _0x12f22c;})[_0xfa74('0x37')](respondWithFilteredResult(_0x5e58dd,_0x4307be))[_0xfa74('0x2d')](handleError(_0x5e58dd,null));};exports[_0xfa74('0x5a')]=function(_0x58b985,_0x214994){var _0x361c17={'raw':![],'where':{'id':_0x58b985[_0xfa74('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x26bb7e={};_0x26bb7e[_0xfa74('0x48')]=_['keys'](db[_0xfa74('0x40')][_0xfa74('0x41')]);_0x26bb7e[_0xfa74('0x45')]=_[_0xfa74('0x46')](_0x58b985[_0xfa74('0x45')]);_0x26bb7e[_0xfa74('0x52')]=_[_0xfa74('0x47')](_0x26bb7e['model'],_0x26bb7e[_0xfa74('0x45')]);_0x361c17['attributes']=_[_0xfa74('0x47')](_0x26bb7e['model'],qs['fields'](_0x58b985[_0xfa74('0x45')][_0xfa74('0x49')]));_0x361c17['attributes']=_0x361c17['attributes'][_0xfa74('0x4b')]?_0x361c17[_0xfa74('0x4a')]:_0x26bb7e[_0xfa74('0x48')];if(_0x58b985[_0xfa74('0x45')][_0xfa74('0x5c')]){_0x361c17[_0xfa74('0x5d')]=[{'all':!![]}];}_0x361c17=_[_0xfa74('0x55')]({},_0x361c17,_0x58b985[_0xfa74('0x56')]);return db[_0xfa74('0x40')][_0xfa74('0x5e')](_0x361c17)['then'](handleEntityNotFound(_0x214994,null))[_0xfa74('0x37')](respondWithResult(_0x214994,null))[_0xfa74('0x2d')](handleError(_0x214994,null));};exports['create']=function(_0x550974,_0x3d88dc){return db[_0xfa74('0x40')][_0xfa74('0x5f')](_0x550974[_0xfa74('0x60')],{})[_0xfa74('0x37')](function(_0x5475f1){var _0x36cfc6=_0x550974['user'][_0xfa74('0x61')]({'plain':!![]});if(!_0x36cfc6)throw new Error(_0xfa74('0x62'));if(_0x36cfc6[_0xfa74('0x63')]==='user'){var _0x5943b5=_0x5475f1[_0xfa74('0x61')]({'plain':!![]});var _0x48f895=_0xfa74('0x39');return db[_0xfa74('0x64')]['find']({'where':{'name':_0x48f895,'userProfileId':_0x36cfc6[_0xfa74('0x65')]},'raw':!![]})[_0xfa74('0x37')](function(_0x5a2494){if(_0x5a2494&&_0x5a2494[_0xfa74('0x66')]===0x0){return db[_0xfa74('0x67')][_0xfa74('0x5f')]({'name':_0x5943b5[_0xfa74('0x3b')],'resourceId':_0x5943b5['id'],'type':_0x5a2494['name'],'sectionId':_0x5a2494['id']},{})[_0xfa74('0x37')](function(){return _0x5475f1;});}else{return _0x5475f1;}})['catch'](function(_0x2c610a){logger[_0xfa74('0x29')](_0xfa74('0x68'),_0x2c610a);throw _0x2c610a;});}return _0x5475f1;})[_0xfa74('0x37')](respondWithResult(_0x3d88dc,0xc9))[_0xfa74('0x2d')](handleError(_0x3d88dc,null));};exports[_0xfa74('0x36')]=function(_0x1f355a,_0xc344eb){if(_0x1f355a[_0xfa74('0x60')]['id']){delete _0x1f355a[_0xfa74('0x60')]['id'];}return db[_0xfa74('0x40')][_0xfa74('0x5e')]({'where':{'id':_0x1f355a[_0xfa74('0x5b')]['id']},'include':[{'model':db[_0xfa74('0x3e')],'as':_0xfa74('0x69')}]})['then'](handleEntityNotFound(_0xc344eb,null))[_0xfa74('0x37')](saveUpdates(_0x1f355a[_0xfa74('0x60')],null))['then'](respondWithResult(_0xc344eb,null))['catch'](handleError(_0xc344eb,null));};exports[_0xfa74('0x38')]=function(_0x516e98,_0x126f09){return db[_0xfa74('0x40')][_0xfa74('0x5e')]({'where':{'id':_0x516e98['params']['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x126f09,null))['then'](removeEntity(_0x126f09,null))['catch'](handleError(_0x126f09,null));};exports[_0xfa74('0x6a')]=function(_0x1fccac,_0x1e3450){return db[_0xfa74('0x40')][_0xfa74('0x6a')]()[_0xfa74('0x37')](respondWithResult(_0x1e3450,null))[_0xfa74('0x2d')](handleError(_0x1e3450,null));};exports[_0xfa74('0x6b')]=function(_0x3dff70,_0xa16e7b,_0x2588bb){if(_0x3dff70['body']['id']){delete _0x3dff70[_0xfa74('0x60')]['id'];}return db['WhatsappAccount'][_0xfa74('0x5e')]({'where':{'id':_0x3dff70[_0xfa74('0x5b')]['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0xa16e7b,null))['then'](function(_0x773f98){if(_0x773f98){_0x3dff70[_0xfa74('0x60')][_0xfa74('0x6c')]=_0x773f98['id'];return db['Disposition'][_0xfa74('0x5f')](_0x3dff70[_0xfa74('0x60')]);}})[_0xfa74('0x37')](respondWithResult(_0xa16e7b,null))[_0xfa74('0x2d')](handleError(_0xa16e7b,null));};exports[_0xfa74('0x6d')]=function(_0x5bd0e5,_0x31d315,_0xeaff0c){var _0xba054d={'raw':![],'where':{}};var _0x2f9aab={};var _0x30c871={'count':0x0,'rows':[]};return db[_0xfa74('0x40')][_0xfa74('0x6e')]({'where':{'id':_0x5bd0e5[_0xfa74('0x5b')]['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x31d315,null))[_0xfa74('0x37')](function(_0x1dccaa){if(_0x1dccaa){_0x2f9aab[_0xfa74('0x48')]=_['keys'](db[_0xfa74('0x6f')][_0xfa74('0x41')]);_0x2f9aab[_0xfa74('0x45')]=_[_0xfa74('0x46')](_0x5bd0e5[_0xfa74('0x45')]);_0x2f9aab[_0xfa74('0x52')]=_[_0xfa74('0x47')](_0x2f9aab[_0xfa74('0x48')],_0x2f9aab['query']);_0xba054d[_0xfa74('0x4a')]=_[_0xfa74('0x47')](_0x2f9aab[_0xfa74('0x48')],qs[_0xfa74('0x49')](_0x5bd0e5['query'][_0xfa74('0x49')]));_0xba054d[_0xfa74('0x4a')]=_0xba054d[_0xfa74('0x4a')][_0xfa74('0x4b')]?_0xba054d['attributes']:_0x2f9aab[_0xfa74('0x48')];if(!_0x5bd0e5['query']['hasOwnProperty'](_0xfa74('0x4d'))){_0xba054d['limit']=qs[_0xfa74('0x31')](_0x5bd0e5[_0xfa74('0x45')]['limit']);_0xba054d['offset']=qs[_0xfa74('0x30')](_0x5bd0e5[_0xfa74('0x45')][_0xfa74('0x30')]);}_0xba054d[_0xfa74('0x4e')]=qs['sort'](_0x5bd0e5['query']['sort']);_0xba054d[_0xfa74('0x50')]=qs[_0xfa74('0x52')](_[_0xfa74('0x51')](_0x5bd0e5[_0xfa74('0x45')],_0x2f9aab[_0xfa74('0x52')]));_0xba054d['where'][_0xfa74('0x6c')]=_0x1dccaa['id'];if(_0x5bd0e5[_0xfa74('0x45')][_0xfa74('0x53')]){_0xba054d[_0xfa74('0x50')]=_[_0xfa74('0x55')](_0xba054d[_0xfa74('0x50')],{'$or':_[_0xfa74('0x3f')](_0xba054d[_0xfa74('0x4a')],function(_0x8d123c){var _0x557e28={};_0x557e28[_0x8d123c]={'$like':'%'+_0x5bd0e5['query']['filter']+'%'};return _0x557e28;})});}_0xba054d=_[_0xfa74('0x55')]({},_0xba054d,_0x5bd0e5[_0xfa74('0x56')]);return db[_0xfa74('0x6f')][_0xfa74('0x57')]({'where':_0xba054d[_0xfa74('0x50')]})['then'](function(_0x3e4323){_0x30c871[_0xfa74('0x57')]=_0x3e4323;if(_0x5bd0e5['query'][_0xfa74('0x5c')]){_0xba054d['include']=[{'all':!![]}];}return db[_0xfa74('0x6f')][_0xfa74('0x58')](_0xba054d);})[_0xfa74('0x37')](function(_0x431573){_0x30c871[_0xfa74('0x59')]=_0x431573;return _0x30c871;});}})[_0xfa74('0x37')](respondWithFilteredResult(_0x31d315,_0xba054d))[_0xfa74('0x2d')](handleError(_0x31d315,null));};exports[_0xfa74('0x70')]=function(_0x5ca15d,_0x4f795b,_0x56c49c){return db[_0xfa74('0x40')][_0xfa74('0x5e')]({'where':{'id':_0x5ca15d['params']['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x4f795b,null))[_0xfa74('0x37')](function(_0x1f271b){if(_0x1f271b){return _0x1f271b[_0xfa74('0x70')](_0x5ca15d['query'][_0xfa74('0x71')]);}})['then'](respondWithStatusCode(_0x4f795b,null))['catch'](handleError(_0x4f795b,null));};exports[_0xfa74('0x72')]=function(_0x3fb1a4,_0x3d72cd,_0x4af5df){if(_0x3fb1a4[_0xfa74('0x60')]['id']){delete _0x3fb1a4[_0xfa74('0x60')]['id'];}return db['WhatsappAccount'][_0xfa74('0x5e')]({'where':{'id':_0x3fb1a4['params']['id']}})['then'](handleEntityNotFound(_0x3d72cd,null))['then'](function(_0x9d30ae){if(_0x9d30ae){_0x3fb1a4[_0xfa74('0x60')][_0xfa74('0x6c')]=_0x9d30ae['id'];return db[_0xfa74('0x73')][_0xfa74('0x5f')](_0x3fb1a4['body']);}})['then'](respondWithResult(_0x3d72cd,null))[_0xfa74('0x2d')](handleError(_0x3d72cd,null));};exports['getAnswers']=function(_0x90dfe7,_0x2d9311,_0x4075d3){var _0x3a9c87={'raw':![],'where':{}};var _0x2720a7={};var _0x4189a2={'count':0x0,'rows':[]};return db[_0xfa74('0x40')][_0xfa74('0x6e')]({'where':{'id':_0x90dfe7[_0xfa74('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2d9311,null))[_0xfa74('0x37')](function(_0x1593d1){if(_0x1593d1){_0x2720a7[_0xfa74('0x48')]=_[_0xfa74('0x46')](db[_0xfa74('0x73')][_0xfa74('0x41')]);_0x2720a7[_0xfa74('0x45')]=_[_0xfa74('0x46')](_0x90dfe7[_0xfa74('0x45')]);_0x2720a7[_0xfa74('0x52')]=_[_0xfa74('0x47')](_0x2720a7['model'],_0x2720a7['query']);_0x3a9c87[_0xfa74('0x4a')]=_[_0xfa74('0x47')](_0x2720a7[_0xfa74('0x48')],qs['fields'](_0x90dfe7['query'][_0xfa74('0x49')]));_0x3a9c87[_0xfa74('0x4a')]=_0x3a9c87[_0xfa74('0x4a')][_0xfa74('0x4b')]?_0x3a9c87[_0xfa74('0x4a')]:_0x2720a7[_0xfa74('0x48')];if(!_0x90dfe7[_0xfa74('0x45')]['hasOwnProperty'](_0xfa74('0x4d'))){_0x3a9c87['limit']=qs['limit'](_0x90dfe7[_0xfa74('0x45')][_0xfa74('0x31')]);_0x3a9c87[_0xfa74('0x30')]=qs['offset'](_0x90dfe7[_0xfa74('0x45')]['offset']);}_0x3a9c87['order']=qs[_0xfa74('0x4f')](_0x90dfe7[_0xfa74('0x45')][_0xfa74('0x4f')]);_0x3a9c87[_0xfa74('0x50')]=qs[_0xfa74('0x52')](_[_0xfa74('0x51')](_0x90dfe7['query'],_0x2720a7[_0xfa74('0x52')]));_0x3a9c87[_0xfa74('0x50')]['WhatsappAccountId']=_0x1593d1['id'];if(_0x90dfe7[_0xfa74('0x45')][_0xfa74('0x53')]){_0x3a9c87[_0xfa74('0x50')]=_['merge'](_0x3a9c87[_0xfa74('0x50')],{'$or':_[_0xfa74('0x3f')](_0x3a9c87['attributes'],function(_0x26882e){var _0x348b6f={};_0x348b6f[_0x26882e]={'$like':'%'+_0x90dfe7[_0xfa74('0x45')]['filter']+'%'};return _0x348b6f;})});}_0x3a9c87=_[_0xfa74('0x55')]({},_0x3a9c87,_0x90dfe7['options']);return db['CannedAnswer'][_0xfa74('0x57')]({'where':_0x3a9c87['where']})[_0xfa74('0x37')](function(_0x40fa4c){_0x4189a2[_0xfa74('0x57')]=_0x40fa4c;if(_0x90dfe7[_0xfa74('0x45')][_0xfa74('0x5c')]){_0x3a9c87[_0xfa74('0x5d')]=[{'all':!![]}];}return db[_0xfa74('0x73')][_0xfa74('0x58')](_0x3a9c87);})[_0xfa74('0x37')](function(_0x2e9e2a){_0x4189a2['rows']=_0x2e9e2a;return _0x4189a2;});}})['then'](respondWithFilteredResult(_0x2d9311,_0x3a9c87))['catch'](handleError(_0x2d9311,null));};exports['removeAnswers']=function(_0x154f7f,_0x43834b,_0x5b1aa9){return db[_0xfa74('0x40')]['find']({'where':{'id':_0x154f7f[_0xfa74('0x5b')]['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x43834b,null))[_0xfa74('0x37')](function(_0x1de7ca){if(_0x1de7ca){return _0x1de7ca[_0xfa74('0x74')](_0x154f7f[_0xfa74('0x45')][_0xfa74('0x71')]);}})[_0xfa74('0x37')](respondWithStatusCode(_0x43834b,null))[_0xfa74('0x2d')](handleError(_0x43834b,null));};exports[_0xfa74('0x75')]=function(_0x119587,_0x566004,_0x2d0559){return db['WhatsappAccount'][_0xfa74('0x5e')]({'where':{'id':_0x119587['params']['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x566004,null))[_0xfa74('0x37')](function(_0xbf723e){if(_0xbf723e){return _0xbf723e['addAgents'](_0x119587[_0xfa74('0x60')][_0xfa74('0x71')],_[_0xfa74('0x76')](_0x119587[_0xfa74('0x60')],[_0xfa74('0x71'),'id'])||{})['spread'](function(_0x17e39e){for(var _0x3d806e=0x0;_0x3d806e<_0x119587[_0xfa74('0x60')]['ids'][_0xfa74('0x4b')];_0x3d806e+=0x1){socket[_0xfa74('0x77')]('userWhatsappAccount:save',{'UserId':_0x119587[_0xfa74('0x60')][_0xfa74('0x71')][_0x3d806e],'WhatsappAccountId':_0x119587[_0xfa74('0x5b')]['id']});}return _0x17e39e;});}})[_0xfa74('0x37')](respondWithResult(_0x566004,null))[_0xfa74('0x2d')](handleError(_0x566004,null));};exports[_0xfa74('0x78')]=function(_0x4ab8d8,_0x143c31,_0x2cf55d){return db[_0xfa74('0x40')][_0xfa74('0x5e')]({'where':{'id':_0x4ab8d8[_0xfa74('0x5b')]['id']}})[_0xfa74('0x37')](handleEntityNotFound(_0x143c31,null))[_0xfa74('0x37')](function(_0x29da93){if(_0x29da93){return _0x29da93['removeAgents'](_0x4ab8d8[_0xfa74('0x45')]['ids'])[_0xfa74('0x37')](function(){if(_['isArray'](_0x4ab8d8[_0xfa74('0x45')][_0xfa74('0x71')])){for(var _0x85539a=0x0;_0x85539a<_0x4ab8d8['query'][_0xfa74('0x71')]['length'];_0x85539a+=0x1){socket[_0xfa74('0x77')](_0xfa74('0x79'),{'UserId':Number(_0x4ab8d8[_0xfa74('0x45')][_0xfa74('0x71')][_0x85539a]),'WhatsappAccountId':Number(_0x4ab8d8['params']['id'])});}}else{socket[_0xfa74('0x77')](_0xfa74('0x79'),{'UserId':Number(_0x4ab8d8[_0xfa74('0x45')][_0xfa74('0x71')]),'WhatsappAccountId':Number(_0x4ab8d8[_0xfa74('0x5b')]['id'])});}});}})[_0xfa74('0x37')](respondWithStatusCode(_0x143c31,null))[_0xfa74('0x2d')](handleError(_0x143c31,null));};exports[_0xfa74('0x7a')]=function(_0x2418ce,_0x1dddb3,_0x346832){var _0x4c2930={};var _0x3069ce={};var _0x3908f9;var _0x416019;return db['WhatsappAccount'][_0xfa74('0x6e')]({'where':{'id':_0x2418ce[_0xfa74('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1dddb3,null))[_0xfa74('0x37')](function(_0x4799e2){if(_0x4799e2){_0x3908f9=_0x4799e2;_0x3069ce[_0xfa74('0x48')]=_['keys'](db['User'][_0xfa74('0x41')]);_0x3069ce[_0xfa74('0x45')]=_[_0xfa74('0x46')](_0x2418ce['query']);_0x3069ce[_0xfa74('0x52')]=_['intersection'](_0x3069ce[_0xfa74('0x48')],_0x3069ce[_0xfa74('0x45')]);_0x4c2930[_0xfa74('0x4a')]=_[_0xfa74('0x47')](_0x3069ce[_0xfa74('0x48')],qs['fields'](_0x2418ce[_0xfa74('0x45')][_0xfa74('0x49')]));_0x4c2930[_0xfa74('0x4a')]=_0x4c2930[_0xfa74('0x4a')]['length']?_0x4c2930[_0xfa74('0x4a')]:_0x3069ce[_0xfa74('0x48')];_0x4c2930['order']=qs[_0xfa74('0x4f')](_0x2418ce[_0xfa74('0x45')][_0xfa74('0x4f')]);_0x4c2930[_0xfa74('0x50')]=qs[_0xfa74('0x52')](_[_0xfa74('0x51')](_0x2418ce[_0xfa74('0x45')],_0x3069ce[_0xfa74('0x52')]));if(_0x2418ce[_0xfa74('0x45')][_0xfa74('0x53')]){_0x4c2930[_0xfa74('0x50')]=_[_0xfa74('0x55')](_0x4c2930[_0xfa74('0x50')],{'$or':_[_0xfa74('0x3f')](_0x4c2930['attributes'],function(_0x397fdb){var _0x2466f7={};_0x2466f7[_0x397fdb]={'$like':'%'+_0x2418ce[_0xfa74('0x45')]['filter']+'%'};return _0x2466f7;})});}_0x4c2930=_[_0xfa74('0x55')]({},_0x4c2930,_0x2418ce['options']);return _0x3908f9[_0xfa74('0x7a')](_0x4c2930);}})[_0xfa74('0x37')](function(_0x3c2f4e){if(_0x3c2f4e){_0x416019=_0x3c2f4e[_0xfa74('0x4b')];if(!_0x2418ce[_0xfa74('0x45')]['hasOwnProperty']('nolimit')){_0x4c2930[_0xfa74('0x31')]=qs[_0xfa74('0x31')](_0x2418ce[_0xfa74('0x45')][_0xfa74('0x31')]);_0x4c2930[_0xfa74('0x30')]=qs[_0xfa74('0x30')](_0x2418ce[_0xfa74('0x45')][_0xfa74('0x30')]);}return _0x3908f9[_0xfa74('0x7a')](_0x4c2930);}})['then'](function(_0x5907ac){if(_0x5907ac){return _0x5907ac?{'count':_0x416019,'rows':_0x5907ac}:null;}})[_0xfa74('0x37')](respondWithResult(_0x1dddb3,null))[_0xfa74('0x2d')](handleError(_0x1dddb3,null));};exports[_0xfa74('0x7b')]=function(_0x43525d,_0x4505b2,_0x357202){return db['WhatsappAccount'][_0xfa74('0x6e')]({'where':{'id':_0x43525d[_0xfa74('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4505b2,null))[_0xfa74('0x37')](function(_0x41a9bf){if(_0x41a9bf){return db[_0xfa74('0x7c')][_0xfa74('0x7d')](function(_0x55a8e0){return db[_0xfa74('0x7e')][_0xfa74('0x38')]({'where':{'WhatsappAccountId':_0x43525d[_0xfa74('0x5b')]['id']},'transaction':_0x55a8e0})['then'](function(_0x375850){var _0x3c3195=_[_0xfa74('0x3f')](_0x43525d['body'],function(_0x222605){_0x222605['WhatsappAccountId']=_0x43525d[_0xfa74('0x5b')]['id'];return _0x222605;});return db['WhatsappApplication'][_0xfa74('0x7f')](_0x3c3195,{'transaction':_0x55a8e0});});})[_0xfa74('0x37')](function(){return db[_0xfa74('0x7e')][_0xfa74('0x80')]({'where':{'WhatsappAccountId':_0x43525d[_0xfa74('0x5b')]['id']},'order':_0xfa74('0x81')});});}})[_0xfa74('0x37')](respondWithResult(_0x4505b2,null))[_0xfa74('0x2d')](handleError(_0x4505b2,null));};exports[_0xfa74('0x82')]=function(_0x6710e2,_0x4f11d5,_0x2a4341){var _0x39a711={};var _0x3a1041={};var _0x2dcdaf;var _0x462130;return db['WhatsappAccount'][_0xfa74('0x6e')]({'where':{'id':_0x6710e2[_0xfa74('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4f11d5,null))[_0xfa74('0x37')](function(_0x33f55b){if(_0x33f55b){_0x2dcdaf=_0x33f55b;_0x3a1041['model']=_[_0xfa74('0x46')](db[_0xfa74('0x7e')]['rawAttributes']);_0x3a1041['query']=_[_0xfa74('0x46')](_0x6710e2[_0xfa74('0x45')]);_0x3a1041[_0xfa74('0x52')]=_['intersection'](_0x3a1041[_0xfa74('0x48')],_0x3a1041[_0xfa74('0x45')]);_0x39a711[_0xfa74('0x4a')]=_['intersection'](_0x3a1041[_0xfa74('0x48')],qs[_0xfa74('0x49')](_0x6710e2[_0xfa74('0x45')][_0xfa74('0x49')]));_0x39a711[_0xfa74('0x4a')]=_0x39a711['attributes'][_0xfa74('0x4b')]?_0x39a711[_0xfa74('0x4a')]:_0x3a1041[_0xfa74('0x48')];_0x39a711['order']=qs[_0xfa74('0x4f')](_0x6710e2[_0xfa74('0x45')][_0xfa74('0x4f')]);_0x39a711[_0xfa74('0x50')]=qs[_0xfa74('0x52')](_[_0xfa74('0x51')](_0x6710e2['query'],_0x3a1041[_0xfa74('0x52')]));if(_0x6710e2[_0xfa74('0x45')][_0xfa74('0x53')]){_0x39a711['where']=_[_0xfa74('0x55')](_0x39a711[_0xfa74('0x50')],{'$or':_[_0xfa74('0x3f')](_0x39a711['attributes'],function(_0x4ed29e){var _0x546a80={};_0x546a80[_0x4ed29e]={'$like':'%'+_0x6710e2[_0xfa74('0x45')]['filter']+'%'};return _0x546a80;})});}_0x39a711=_[_0xfa74('0x55')]({},_0x39a711,_0x6710e2[_0xfa74('0x56')]);return _0x2dcdaf['getApplications'](_0x39a711);}})[_0xfa74('0x37')](function(_0x4fcce4){if(_0x4fcce4){_0x462130=_0x4fcce4[_0xfa74('0x4b')];if(!_0x6710e2[_0xfa74('0x45')][_0xfa74('0x4c')](_0xfa74('0x4d'))){_0x39a711['limit']=qs[_0xfa74('0x31')](_0x6710e2[_0xfa74('0x45')]['limit']);_0x39a711[_0xfa74('0x30')]=qs['offset'](_0x6710e2[_0xfa74('0x45')][_0xfa74('0x30')]);}return _0x2dcdaf['getApplications'](_0x39a711);}})[_0xfa74('0x37')](function(_0x2272b1){if(_0x2272b1){return _0x2272b1?{'count':_0x462130,'rows':_0x2272b1}:null;}})[_0xfa74('0x37')](respondWithResult(_0x4f11d5,null))[_0xfa74('0x2d')](handleError(_0x4f11d5,null));};exports['notify']=function(_0xf5ee6f,_0x403528,_0x5e5a3c){var _0x1299ec={'channel':_0xfa74('0x83')};var _0x35d648=[];var _0x465f3d=[];var _0x50b739={};return db['WhatsappAccount'][_0xfa74('0x5e')]({'where':{'id':_0xf5ee6f['params']['id']},'include':[{'model':db[_0xfa74('0x7e')],'as':'Applications'}]})[_0xfa74('0x37')](handleEntityNotFound(_0x403528,null))[_0xfa74('0x37')](function(_0x3aed3d){_0x1299ec[_0xfa74('0x84')]=_0x3aed3d;_0x1299ec['applications']=_[_0xfa74('0x85')](_0x3aed3d[_0xfa74('0x86')],[_0xfa74('0x81')],[_0xfa74('0x87')]);if(_0x1299ec[_0xfa74('0x84')][_0xfa74('0x86')]){delete _0x1299ec[_0xfa74('0x84')]['Applications'];}return db[_0xfa74('0x88')][_0xfa74('0x6a')]();})[_0xfa74('0x37')](function(_0x216193){if(!_0x216193){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0x89'));}_0x35d648=_[_0xfa74('0x8a')](_[_0xfa74('0x46')](_0x216193),[_0xfa74('0x8b'),_0xfa74('0x8c')]);_0x465f3d=_[_0xfa74('0x8a')](_[_0xfa74('0x46')](_0x216193),['createdAt',_0xfa74('0x8c'),'CompanyId',_0xfa74('0x8d')]);_0x1299ec[_0xfa74('0x60')]={'mapKey':'mobile'};if(_0x1299ec[_0xfa74('0x84')][_0xfa74('0x43')]&&_0x1299ec[_0xfa74('0x84')]['type']===_0xfa74('0x8e')){_0x1299ec[_0xfa74('0x60')][_0xfa74('0x8f')]=_0xf5ee6f[_0xfa74('0x60')][_0xfa74('0x90')]['replace'](_0xfa74('0x91'),'');_0x1299ec['body']['body']=_0xf5ee6f[_0xfa74('0x60')][_0xfa74('0x92')];_0x1299ec[_0xfa74('0x60')]['messageId']=_0xf5ee6f['body'][_0xfa74('0x93')];}if(_0x1299ec[_0xfa74('0x60')]['id']){delete _0x1299ec[_0xfa74('0x60')]['id'];}if(_[_0xfa74('0x94')](_0x1299ec[_0xfa74('0x60')]['from'])){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))]('from\x20is\x20mandatory');}if(_[_0xfa74('0x94')](_0x1299ec[_0xfa74('0x60')]['body'])||_0x1299ec[_0xfa74('0x60')]['body']===''){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0x95'));}if(_[_0xfa74('0x94')](_0x1299ec[_0xfa74('0x60')]['mapKey'])){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0x96')+_0x465f3d);}if(!_[_0xfa74('0x97')](_0x465f3d,_0x1299ec['body']['mapKey'])){throw new db[(_0xfa74('0x20'))]['ValidationError'](_0xfa74('0x98')+_0x465f3d);}_0x50b739[_0x1299ec[_0xfa74('0x60')][_0xfa74('0x99')]]=_0x1299ec[_0xfa74('0x60')]['from'];return db[_0xfa74('0x9a')]['find']({'where':{'id':_0x1299ec[_0xfa74('0x84')][_0xfa74('0x8d')]},'include':[{'model':db[_0xfa74('0x88')],'as':_0xfa74('0x9b'),'where':_0x50b739,'limit':0x1,'order':[[_0xfa74('0x8c'),'DESC']]}]});})[_0xfa74('0x37')](handleEntityNotFound(_0x403528,null))['then'](function(_0x16a6e6){if(_0x16a6e6){_0x1299ec['list']=_[_0xfa74('0x76')](_0x16a6e6,['Contacts']);if(_0x16a6e6[_0xfa74('0x9b')]['length']){return _0x16a6e6[_0xfa74('0x9b')][0x0];}var _0x4a68ca=_[_0xfa74('0x16')](_0x1299ec[_0xfa74('0x60')],{'firstName':_0x1299ec[_0xfa74('0x60')]['from'],'ListId':_0x16a6e6['id']});_0x4a68ca[_0x1299ec['body'][_0xfa74('0x99')]]=_0x1299ec[_0xfa74('0x60')][_0xfa74('0x8f')];return db[_0xfa74('0x88')]['create'](_0x4a68ca,{'fields':_0x35d648,'raw':!![]});}})[_0xfa74('0x37')](handleEntityNotFound(_0x403528,null))[_0xfa74('0x37')](function(_0x351ddb){if(_0x351ddb){_0x1299ec['contact']=_0x351ddb;var _0x87020e={'ContactId':_0x351ddb['id'],'phone':_0x1299ec[_0xfa74('0x60')][_0xfa74('0x8f')],'WhatsappAccountId':_0xf5ee6f[_0xfa74('0x5b')]['id']};var _0x5e7eb7={'ContactId':_0x351ddb['id'],'WhatsappAccountId':_0xf5ee6f[_0xfa74('0x5b')]['id'],'closed':![]};return db[_0xfa74('0x9c')][_0xfa74('0x5e')]({'where':_0x5e7eb7})[_0xfa74('0x37')](function(_0x5ef7ae){if(_0x5ef7ae){return[_0x5ef7ae,![]];}return db['WhatsappInteraction'][_0xfa74('0x5f')](_0x87020e)['then'](function(_0x5affdc){return[_0x5affdc,!![]];});});}})['spread'](function(_0x5b2df5,_0x43b948){_0x1299ec[_0xfa74('0x9d')]=_0x5b2df5[_0xfa74('0x61')]({'plain':!![]});_0x1299ec[_0xfa74('0x9d')][_0xfa74('0x9e')]=![];if(_0x43b948){if(_0x1299ec[_0xfa74('0x84')][_0xfa74('0x9f')]){_0x1299ec[_0xfa74('0xa0')][_0xfa74('0xa1')]({'id':0x0,'priority':_0x1299ec[_0xfa74('0xa0')][_0xfa74('0x4b')]+0x1,'app':'close','appdata':_0xfa74('0xa2'),'interval':_0xfa74('0xa3')});}_0x1299ec[_0xfa74('0x9d')]['created']=!![];}return db[_0xfa74('0xa4')][_0xfa74('0x5f')]({'phone':_0x1299ec[_0xfa74('0x60')][_0xfa74('0x8f')],'messageId':_0x1299ec[_0xfa74('0x60')]['messageId'],'body':_0x1299ec['body'][_0xfa74('0x60')],'WhatsappAccountId':_0xf5ee6f[_0xfa74('0x5b')]['id'],'WhatsappInteractionId':_0x5b2df5['id'],'direction':'in','ContactId':_0x5b2df5['ContactId'],'AttachmentId':_0x1299ec[_0xfa74('0x60')][_0xfa74('0xa5')]});})[_0xfa74('0x37')](function(_0x7fd6f){_0x1299ec[_0xfa74('0x2b')]=_0x7fd6f;if(_0x1299ec['interaction'][_0xfa74('0xa6')]){return db[_0xfa74('0xa7')][_0xfa74('0x5e')]({'attributes':['id',_0xfa74('0x3b')],'where':{'id':_0x1299ec[_0xfa74('0x9d')]['UserId']}})['then'](function(_0x1d2220){if(_0x1d2220){_0x1299ec[_0xfa74('0xa0')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfa74('0xa8'),'appdata':_0x1d2220[_0xfa74('0x3b')]+','+(_0x1299ec[_0xfa74('0x84')][_0xfa74('0xa9')]||0xa),'interval':_0xfa74('0xa3')});}return respondWithRpcPromise(_0xfa74('0xaa'),'startRouting',_0x1299ec);});}return respondWithRpcPromise(_0xfa74('0xaa'),'startRouting',_0x1299ec);})[_0xfa74('0x37')](function(_0x504fbf){if(_0x504fbf){var _0x49198a=0xc8;var _0x3bfda8=_0xfa74('0xab');logger[_0xfa74('0x24')](_0xfa74('0x27'),_0x3bfda8,_0x49198a,'entity\x20found');logger[_0xfa74('0x26')](_0xfa74('0xac'),_0x3bfda8,_0x49198a,_0xfa74('0xad'),JSON[_0xfa74('0xae')](_0x504fbf));if(_0x1299ec[_0xfa74('0x84')][_0xfa74('0x43')]===_0xfa74('0x8e')){return _0x403528[_0xfa74('0x2f')](_0x49198a)[_0xfa74('0xaf')](_0xfa74('0xb0'),_0xfa74('0xb1'))[_0xfa74('0x3c')](_0xfa74('0xb2'));}else{return _0x403528['status'](_0x49198a)[_0xfa74('0x33')](_0x504fbf);}}})[_0xfa74('0x2d')](handleError(_0x403528,null));};exports['send']=function(_0x15ada9,_0x2389d3,_0x339079){var _0xa760ba,_0x267144,_0x211153;if(_[_0xfa74('0x94')](_0x15ada9[_0xfa74('0x60')][_0xfa74('0x60')])||_0x15ada9[_0xfa74('0x60')]['body']===''){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0x95'));}if(_[_0xfa74('0x94')](_0x15ada9[_0xfa74('0x60')]['to'])){throw new db[(_0xfa74('0x20'))][(_0xfa74('0x21'))](_0xfa74('0xb3'));}_0xa760ba=_0x15ada9[_0xfa74('0x60')]['to'];return db[_0xfa74('0x40')][_0xfa74('0x5e')]({'where':{'id':_0x15ada9[_0xfa74('0x5b')]['id']},'include':[{'model':db[_0xfa74('0x9a')],'as':_0xfa74('0xb4'),'include':[{'model':db[_0xfa74('0x88')],'as':'Contacts','where':{'mobile':_0xa760ba},'limit':0x1,'order':[[_0xfa74('0x8c'),_0xfa74('0xb5')]]}]}]})['then'](handleEntityNotFound(_0x2389d3,null))[_0xfa74('0x37')](function(_0x124930){if(_0x124930&&_0x124930[_0xfa74('0xb4')]){_0x267144=_0x124930[_0xfa74('0x61')]({'plain':!![]});if(_0x267144[_0xfa74('0xb4')]&&_0x267144[_0xfa74('0xb4')][_0xfa74('0x9b')][_0xfa74('0x4b')]){return _0x267144[_0xfa74('0xb4')][_0xfa74('0x9b')][0x0];}return db[_0xfa74('0x88')]['create'](_[_0xfa74('0x16')](_0x15ada9[_0xfa74('0x60')],{'firstName':_0xa760ba,'mobile':_0xa760ba,'phone':_0xa760ba,'ListId':_0x267144[_0xfa74('0x8d')]}));}})[_0xfa74('0x37')](handleEntityNotFound(_0x2389d3,null))[_0xfa74('0x37')](function(_0x392a41){if(_0x392a41){_0x211153=_0x392a41;return db[_0xfa74('0x9c')][_0xfa74('0x5e')]({'where':{'ContactId':_0x211153['id'],'closed':![],'WhatsappAccountId':_0x267144['id']}})[_0xfa74('0x37')](function(_0x44c13a){if(_0x44c13a){return[_0x44c13a,![]];}return db[_0xfa74('0x9c')][_0xfa74('0x5f')]({'UserId':_0x15ada9[_0xfa74('0xb6')]['id'],'ContactId':_0x211153['id'],'WhatsappAccountId':_0x267144['id'],'phone':_0xa760ba,'firstMsgDirection':_0xfa74('0xb7'),'Messages':[_[_0xfa74('0x55')](_0x15ada9[_0xfa74('0x60')],{'read':![],'body':_0x15ada9[_0xfa74('0x60')][_0xfa74('0x60')],'phone':_0xa760ba,'WhatsappAccountId':_0x267144['id'],'UserId':_0x15ada9[_0xfa74('0xb6')]['id'],'ContactId':_0x211153['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xfa74('0xb8')}]})[_0xfa74('0x37')](function(_0x15b038){return[_0x15b038,!![]];});});}})[_0xfa74('0xb9')](function(_0x4e5ec6,_0x270c2d){if(_0x270c2d){return _0x4e5ec6;}return db[_0xfa74('0xa4')]['create'](_[_0xfa74('0x55')](_0x15ada9[_0xfa74('0x60')],{'read':![],'body':_0x15ada9['body'][_0xfa74('0x60')],'phone':_0xa760ba,'WhatsappAccountId':_0x267144['id'],'WhatsappInteractionId':_0x4e5ec6['id'],'UserId':_0x15ada9[_0xfa74('0xb6')]['id'],'ContactId':_0x211153['id']}))[_0xfa74('0x37')](function(_0xd31a80){_0x4e5ec6['dataValues']['Messages']=[];_0x4e5ec6[_0xfa74('0xba')][_0xfa74('0xb8')]['push'](_0xd31a80[_0xfa74('0xba')]);return _0x4e5ec6;});})[_0xfa74('0x37')](respondWithResult(_0x2389d3,null))[_0xfa74('0x2d')](handleError(_0x2389d3,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 274fdf1..615f4fa 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50a5=['../../mysqldb','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4d58c1,_0x115333){var _0x925f11=function(_0x3aae5d){while(--_0x3aae5d){_0x4d58c1['push'](_0x4d58c1['shift']());}};_0x925f11(++_0x115333);}(_0x50a5,0xd1));var _0x550a=function(_0x253cee,_0x353353){_0x253cee=_0x253cee-0x0;var _0x52202e=_0x50a5[_0x253cee];return _0x52202e;};'use strict';var EventEmitter=require(_0x550a('0x0'));var WhatsappAccount=require(_0x550a('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x550a('0x2')};function emitEvent(_0x4827e0){return function(_0x357485,_0x2038f7,_0x45ca06){WhatsappAccountEvents[_0x550a('0x3')](_0x4827e0+':'+_0x357485['id'],_0x357485);WhatsappAccountEvents[_0x550a('0x3')](_0x4827e0,_0x357485);_0x45ca06(null);};}for(var e in events){if(events[_0x550a('0x4')](e)){var event=events[e];WhatsappAccount[_0x550a('0x5')](e,emitEvent(event));}}module[_0x550a('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x27a0=['hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x45a98f,_0x46004e){var _0x3eb94d=function(_0x1346d5){while(--_0x1346d5){_0x45a98f['push'](_0x45a98f['shift']());}};_0x3eb94d(++_0x46004e);}(_0x27a0,0xbf));var _0x027a=function(_0xefdb06,_0xd7b8b1){_0xefdb06=_0xefdb06-0x0;var _0x4b65f5=_0x27a0[_0xefdb06];return _0x4b65f5;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x027a('0x0'))['db'][_0x027a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x027a('0x2')](0x0);var events={'afterCreate':_0x027a('0x3'),'afterUpdate':_0x027a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58a58b){return function(_0x4e8d6b,_0x47cd65,_0x30a54d){WhatsappAccountEvents[_0x027a('0x5')](_0x58a58b+':'+_0x4e8d6b['id'],_0x4e8d6b);WhatsappAccountEvents[_0x027a('0x5')](_0x58a58b,_0x4e8d6b);_0x30a54d(null);};}for(var e in events){if(events[_0x027a('0x6')](e)){var event=events[e];WhatsappAccount[_0x027a('0x7')](e,emitEvent(event));}}module[_0x027a('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index f7c554e..31c0e51 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8151=['bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','WhatsappAccount','../../config/logger'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x8151,0x15f));var _0x1815=function(_0xa86f0e,_0x48f50b){_0xa86f0e=_0xa86f0e-0x0;var _0x31815f=_0x8151[_0xa86f0e];return _0x31815f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1815('0x0'))('api');var moment=require('moment');var BPromise=require(_0x1815('0x1'));var rp=require(_0x1815('0x2'));var fs=require('fs');var path=require(_0x1815('0x3'));var rimraf=require(_0x1815('0x4'));var config=require('../../config/environment');var attributes=require(_0x1815('0x5'));module[_0x1815('0x6')]=function(_0x541bb1,_0xc882c2){return _0x541bb1['define'](_0x1815('0x7'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2976=['../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x15d691,_0x3406a3){var _0x3927a1=function(_0x8d4cfb){while(--_0x8d4cfb){_0x15d691['push'](_0x15d691['shift']());}};_0x3927a1(++_0x3406a3);}(_0x2976,0x155));var _0x6297=function(_0x8c391f,_0x3df4b8){_0x8c391f=_0x8c391f-0x0;var _0xe29f49=_0x2976[_0x8c391f];return _0xe29f49;};'use strict';var _=require(_0x6297('0x0'));var util=require(_0x6297('0x1'));var logger=require(_0x6297('0x2'))(_0x6297('0x3'));var moment=require('moment');var BPromise=require(_0x6297('0x4'));var rp=require(_0x6297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6297('0x6'));var config=require(_0x6297('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x6297('0x8')]=function(_0x2ca1a2,_0xa58d94){return _0x2ca1a2[_0x6297('0x9')](_0x6297('0xa'),attributes,{'tableName':_0x6297('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 8ddac10..d81c2de 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e18=['register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','map','model','include','attributes','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket'];(function(_0x4f1bb9,_0x4a9b3b){var _0x8101ba=function(_0x5ddede){while(--_0x5ddede){_0x4f1bb9['push'](_0x4f1bb9['shift']());}};_0x8101ba(++_0x4a9b3b);}(_0x2e18,0x19c));var _0x82e1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x2e18[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x82e1('0x0'));var util=require(_0x82e1('0x1'));var moment=require(_0x82e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x82e1('0x3'));var fs=require('fs');var Redis=require(_0x82e1('0x4'));var db=require(_0x82e1('0x5'))['db'];var utils=require(_0x82e1('0x6'));var logger=require(_0x82e1('0x7'))(_0x82e1('0x8'));var config=require(_0x82e1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x82e1('0xa')][_0x82e1('0xb')]({'port':0x232a});config['redis']=_[_0x82e1('0xc')](config[_0x82e1('0xd')],{'host':_0x82e1('0xe'),'port':0x18eb});var socket=require(_0x82e1('0xf'))(new Redis(config[_0x82e1('0xd')]));require(_0x82e1('0x10'))[_0x82e1('0x11')](socket);function respondWithRpcPromise(_0x3b40af,_0x10f52a,_0x222a52){return new BPromise(function(_0x4f613f,_0x2ab85d){return client[_0x82e1('0x12')](_0x3b40af,_0x222a52)['then'](function(_0x177786){logger[_0x82e1('0x13')](_0x82e1('0x14'),_0x10f52a,_0x82e1('0x15'));logger[_0x82e1('0x16')](_0x82e1('0x17'),_0x10f52a,'request\x20sent',JSON[_0x82e1('0x18')](_0x177786));if(_0x177786['error']){if(_0x177786[_0x82e1('0x19')]['code']===0x1f4){logger[_0x82e1('0x19')](_0x82e1('0x14'),_0x10f52a,_0x177786[_0x82e1('0x19')][_0x82e1('0x1a')]);return _0x2ab85d(_0x177786[_0x82e1('0x19')]['message']);}logger['error'](_0x82e1('0x14'),_0x10f52a,_0x177786[_0x82e1('0x19')]['message']);return _0x4f613f(_0x177786[_0x82e1('0x19')][_0x82e1('0x1a')]);}else{logger['info'](_0x82e1('0x14'),_0x10f52a,_0x82e1('0x15'));_0x4f613f(_0x177786[_0x82e1('0x1b')][_0x82e1('0x1a')]);}})[_0x82e1('0x1c')](function(_0x380cdd){logger['error'](_0x82e1('0x14'),_0x10f52a,_0x380cdd);_0x2ab85d(_0x380cdd);});});}exports[_0x82e1('0x1d')]=function(_0xa7dffb){var _0x2fb033=this;return new Promise(function(_0x137a04,_0x159c9e){return db[_0x82e1('0x1e')][_0x82e1('0x1f')]({'raw':_0xa7dffb[_0x82e1('0x20')]?_0xa7dffb[_0x82e1('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xa7dffb[_0x82e1('0x20')]?_0xa7dffb[_0x82e1('0x20')][_0x82e1('0x21')]||null:null,'attributes':_0xa7dffb[_0x82e1('0x20')]?_0xa7dffb['options']['attributes']||null:null,'include':_0xa7dffb[_0x82e1('0x20')]?_0xa7dffb[_0x82e1('0x20')]['include']?_[_0x82e1('0x22')](_0xa7dffb[_0x82e1('0x20')]['include'],function(_0x854e33){return{'model':db[_0x854e33[_0x82e1('0x23')]],'as':_0x854e33['as'],'attributes':_0x854e33['attributes'],'include':_0x854e33['include']?_['map'](_0x854e33[_0x82e1('0x24')],function(_0x10c705){return{'model':db[_0x10c705['model']],'as':_0x10c705['as'],'attributes':_0x10c705[_0x82e1('0x25')],'include':_0x10c705[_0x82e1('0x24')]?_[_0x82e1('0x22')](_0x10c705[_0x82e1('0x24')],function(_0x5c9086){return{'model':db[_0x5c9086[_0x82e1('0x23')]],'as':_0x5c9086['as'],'attributes':_0x5c9086[_0x82e1('0x25')]};}):[]};}):[]};}):[]:[]})[_0x82e1('0x26')](function(_0x303606){logger[_0x82e1('0x13')](_0x82e1('0x1d'),_0xa7dffb);logger[_0x82e1('0x16')]('ShowWhatsappAccount',_0xa7dffb,JSON[_0x82e1('0x18')](_0x303606));_0x137a04(_0x303606);})[_0x82e1('0x1c')](function(_0x1e19ce){logger[_0x82e1('0x19')](_0x82e1('0x1d'),_0x1e19ce['message'],_0xa7dffb);_0x159c9e(_0x2fb033[_0x82e1('0x19')](0x1f4,_0x1e19ce[_0x82e1('0x1a')]));});});}; \ No newline at end of file +var _0xc1f4=['localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x226290,_0x233393){var _0x29588f=function(_0x2f4359){while(--_0x2f4359){_0x226290['push'](_0x226290['shift']());}};_0x29588f(++_0x233393);}(_0xc1f4,0xc7));var _0x4c1f=function(_0x41075d,_0x112862){_0x41075d=_0x41075d-0x0;var _0x11f102=_0xc1f4[_0x41075d];return _0x11f102;};'use strict';var _=require(_0x4c1f('0x0'));var util=require(_0x4c1f('0x1'));var moment=require('moment');var BPromise=require(_0x4c1f('0x2'));var rs=require(_0x4c1f('0x3'));var fs=require('fs');var Redis=require(_0x4c1f('0x4'));var db=require(_0x4c1f('0x5'))['db'];var utils=require(_0x4c1f('0x6'));var logger=require(_0x4c1f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c1f('0x8'));var client=jayson['client'][_0x4c1f('0x9')]({'port':0x232a});config[_0x4c1f('0xa')]=_['defaults'](config['redis'],{'host':_0x4c1f('0xb'),'port':0x18eb});var socket=require(_0x4c1f('0xc'))(new Redis(config[_0x4c1f('0xa')]));require(_0x4c1f('0xd'))[_0x4c1f('0xe')](socket);function respondWithRpcPromise(_0xfc593c,_0x56f9c0,_0x5b0963){return new BPromise(function(_0x76a8f5,_0x55e4d4){return client['request'](_0xfc593c,_0x5b0963)[_0x4c1f('0xf')](function(_0x4b39c8){logger[_0x4c1f('0x10')](_0x4c1f('0x11'),_0x56f9c0,'request\x20sent');logger[_0x4c1f('0x12')](_0x4c1f('0x13'),_0x56f9c0,_0x4c1f('0x14'),JSON[_0x4c1f('0x15')](_0x4b39c8));if(_0x4b39c8[_0x4c1f('0x16')]){if(_0x4b39c8[_0x4c1f('0x16')]['code']===0x1f4){logger[_0x4c1f('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x56f9c0,_0x4b39c8[_0x4c1f('0x16')][_0x4c1f('0x17')]);return _0x55e4d4(_0x4b39c8[_0x4c1f('0x16')][_0x4c1f('0x17')]);}logger['error'](_0x4c1f('0x11'),_0x56f9c0,_0x4b39c8[_0x4c1f('0x16')][_0x4c1f('0x17')]);return _0x76a8f5(_0x4b39c8[_0x4c1f('0x16')][_0x4c1f('0x17')]);}else{logger[_0x4c1f('0x10')](_0x4c1f('0x11'),_0x56f9c0,'request\x20sent');_0x76a8f5(_0x4b39c8[_0x4c1f('0x18')][_0x4c1f('0x17')]);}})[_0x4c1f('0x19')](function(_0x28cdc4){logger[_0x4c1f('0x16')](_0x4c1f('0x11'),_0x56f9c0,_0x28cdc4);_0x55e4d4(_0x28cdc4);});});}exports[_0x4c1f('0x1a')]=function(_0x20a87d){var _0x29ed38=this;return new Promise(function(_0x20648d,_0x1088a5){return db[_0x4c1f('0x1b')][_0x4c1f('0x1c')]({'raw':_0x20a87d['options']?_0x20a87d[_0x4c1f('0x1d')][_0x4c1f('0x1e')]===undefined?!![]:![]:!![],'where':_0x20a87d[_0x4c1f('0x1d')]?_0x20a87d[_0x4c1f('0x1d')]['where']||null:null,'attributes':_0x20a87d[_0x4c1f('0x1d')]?_0x20a87d[_0x4c1f('0x1d')][_0x4c1f('0x1f')]||null:null,'include':_0x20a87d[_0x4c1f('0x1d')]?_0x20a87d[_0x4c1f('0x1d')][_0x4c1f('0x20')]?_[_0x4c1f('0x21')](_0x20a87d['options'][_0x4c1f('0x20')],function(_0xde17a8){return{'model':db[_0xde17a8['model']],'as':_0xde17a8['as'],'attributes':_0xde17a8['attributes'],'include':_0xde17a8['include']?_[_0x4c1f('0x21')](_0xde17a8[_0x4c1f('0x20')],function(_0x42f89f){return{'model':db[_0x42f89f[_0x4c1f('0x22')]],'as':_0x42f89f['as'],'attributes':_0x42f89f['attributes'],'include':_0x42f89f[_0x4c1f('0x20')]?_[_0x4c1f('0x21')](_0x42f89f[_0x4c1f('0x20')],function(_0x19d251){return{'model':db[_0x19d251[_0x4c1f('0x22')]],'as':_0x19d251['as'],'attributes':_0x19d251['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c1f('0xf')](function(_0x24e19c){logger['info'](_0x4c1f('0x1a'),_0x20a87d);logger[_0x4c1f('0x12')](_0x4c1f('0x1a'),_0x20a87d,JSON[_0x4c1f('0x15')](_0x24e19c));_0x20648d(_0x24e19c);})[_0x4c1f('0x19')](function(_0xa4ae4c){logger[_0x4c1f('0x16')](_0x4c1f('0x1a'),_0xa4ae4c[_0x4c1f('0x17')],_0x20a87d);_0x1088a5(_0x29ed38[_0x4c1f('0x16')](0x1f4,_0xa4ae4c[_0x4c1f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 68f9cc7..f3dd709 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e6c=['./whatsappAccount.events','save','remove','update','emit','removeListener','whatsappAccount:'];(function(_0x46888a,_0xd99424){var _0x11cd87=function(_0x41ad29){while(--_0x41ad29){_0x46888a['push'](_0x46888a['shift']());}};_0x11cd87(++_0xd99424);}(_0x6e6c,0xa8));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var WhatsappAccountEvents=require(_0xc6e6('0x0'));var events=[_0xc6e6('0x1'),_0xc6e6('0x2'),_0xc6e6('0x3')];function createListener(_0x58c54c,_0x29d39f){return function(_0x4f2e76){_0x29d39f[_0xc6e6('0x4')](_0x58c54c,_0x4f2e76);};}function removeListener(_0x458b51,_0x4ca48b){return function(){WhatsappAccountEvents[_0xc6e6('0x5')](_0x458b51,_0x4ca48b);};}exports['register']=function(_0xde67b1){for(var _0xef7561=0x0,_0x505708=events['length'];_0xef7561<_0x505708;_0xef7561++){var _0x3b3760=events[_0xef7561];var _0x300c65=createListener(_0xc6e6('0x6')+_0x3b3760,_0xde67b1);WhatsappAccountEvents['on'](_0x3b3760,_0x300c65);}}; \ No newline at end of file +var _0x12af=['whatsappAccount:','./whatsappAccount.events','update','emit','removeListener','register'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x12af,0x1f3));var _0xf12a=function(_0x3799cd,_0x131494){_0x3799cd=_0x3799cd-0x0;var _0x3410d3=_0x12af[_0x3799cd];return _0x3410d3;};'use strict';var WhatsappAccountEvents=require(_0xf12a('0x0'));var events=['save','remove',_0xf12a('0x1')];function createListener(_0x54e45d,_0x1a272e){return function(_0x3b4215){_0x1a272e[_0xf12a('0x2')](_0x54e45d,_0x3b4215);};}function removeListener(_0xe9b0ae,_0x56f63e){return function(){WhatsappAccountEvents[_0xf12a('0x3')](_0xe9b0ae,_0x56f63e);};}exports[_0xf12a('0x4')]=function(_0x4578c3){for(var _0x7a7119=0x0,_0x1c36ac=events['length'];_0x7a7119<_0x1c36ac;_0x7a7119++){var _0x5ca147=events[_0x7a7119];var _0x18936a=createListener(_0xf12a('0x5')+_0x5ca147,_0x4578c3);WhatsappAccountEvents['on'](_0x5ca147,_0x18936a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 1b969ac..0d95aa9 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9e02=['../../components/interaction/service','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x17772e,_0x3d4d93){var _0x21e766=function(_0x474f74){while(--_0x474f74){_0x17772e['push'](_0x17772e['shift']());}};_0x21e766(++_0x3d4d93);}(_0x9e02,0x72));var _0x29e0=function(_0x19a4a7,_0x2fc264){_0x19a4a7=_0x19a4a7-0x0;var _0x134a5c=_0x9e02[_0x19a4a7];return _0x134a5c;};'use strict';var multer=require('multer');var util=require(_0x29e0('0x0'));var path=require(_0x29e0('0x1'));var timeout=require(_0x29e0('0x2'));var express=require(_0x29e0('0x3'));var router=express[_0x29e0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x29e0('0x5'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x29e0('0x6')](),controller[_0x29e0('0x7')]);router[_0x29e0('0x8')]('/:id',auth[_0x29e0('0x6')](),controller['show']);router[_0x29e0('0x9')]('/',auth[_0x29e0('0x6')](),controller[_0x29e0('0xa')]);router[_0x29e0('0xb')](_0x29e0('0xc'),auth['isAuthenticated'](),controller[_0x29e0('0xd')]);router[_0x29e0('0xe')](_0x29e0('0xc'),auth[_0x29e0('0x6')](),controller[_0x29e0('0xf')]);module[_0x29e0('0x10')]=router; \ No newline at end of file +var _0x3bbc=['post','put','/:id','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x2d99b8,_0x443f90){var _0x52c0b1=function(_0x2a04e0){while(--_0x2a04e0){_0x2d99b8['push'](_0x2d99b8['shift']());}};_0x52c0b1(++_0x443f90);}(_0x3bbc,0x19d));var _0xc3bb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3bbc[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xc3bb('0x0'));var path=require(_0xc3bb('0x1'));var timeout=require(_0xc3bb('0x2'));var express=require(_0xc3bb('0x3'));var router=express[_0xc3bb('0x4')]();var auth=require(_0xc3bb('0x5'));var interaction=require(_0xc3bb('0x6'));var config=require(_0xc3bb('0x7'));var controller=require('./whatsappApplication.controller');router[_0xc3bb('0x8')]('/',auth['isAuthenticated'](),controller[_0xc3bb('0x9')]);router[_0xc3bb('0x8')]('/:id',auth[_0xc3bb('0xa')](),controller[_0xc3bb('0xb')]);router[_0xc3bb('0xc')]('/',auth[_0xc3bb('0xa')](),controller['create']);router[_0xc3bb('0xd')](_0xc3bb('0xe'),auth[_0xc3bb('0xa')](),controller['update']);router[_0xc3bb('0xf')]('/:id',auth[_0xc3bb('0xa')](),controller['destroy']);module[_0xc3bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2266194..4c76875 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9125=['*,*,*,*','exports','STRING','TEXT'];(function(_0x2957a8,_0x1b06d7){var _0x20b696=function(_0x1141d2){while(--_0x1141d2){_0x2957a8['push'](_0x2957a8['shift']());}};_0x20b696(++_0x1b06d7);}(_0x9125,0x141));var _0x5912=function(_0x504dd8,_0x1396f2){_0x504dd8=_0x504dd8-0x0;var _0x54db75=_0x9125[_0x504dd8];return _0x54db75;};'use strict';var Sequelize=require('sequelize');module[_0x5912('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5912('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5912('0x2')]()},'description':{'type':Sequelize[_0x5912('0x1')]},'interval':{'type':Sequelize[_0x5912('0x1')],'defaultValue':_0x5912('0x3')}}; \ No newline at end of file +var _0x1c05=['INTEGER','noop','STRING','*,*,*,*','exports'];(function(_0x4ffa03,_0x363a82){var _0x30d661=function(_0x36ba86){while(--_0x36ba86){_0x4ffa03['push'](_0x4ffa03['shift']());}};_0x30d661(++_0x363a82);}(_0x1c05,0x14e));var _0x51c0=function(_0x3f47e8,_0x1836a3){_0x3f47e8=_0x3f47e8-0x0;var _0x2f0708=_0x1c05[_0x3f47e8];return _0x2f0708;};'use strict';var Sequelize=require('sequelize');module[_0x51c0('0x0')]={'priority':{'type':Sequelize[_0x51c0('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x51c0('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x51c0('0x3')]},'interval':{'type':Sequelize[_0x51c0('0x3')],'defaultValue':_0x51c0('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e63528f..a3a7108 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb24e=['model','query','attributes','intersection','fields','length','nolimit','offset','order','sort','filters','where','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key'];(function(_0x71e9e4,_0x2b8f91){var _0x44f29d=function(_0x42b0d3){while(--_0x42b0d3){_0x71e9e4['push'](_0x71e9e4['shift']());}};_0x44f29d(++_0x2b8f91);}(_0xb24e,0x1e5));var _0xeb24=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb24e[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0xeb24('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb24('0x2'));var rp=require(_0xeb24('0x3'));var moment=require('moment');var BPromise=require(_0xeb24('0x4'));var Mustache=require(_0xeb24('0x5'));var util=require(_0xeb24('0x6'));var path=require(_0xeb24('0x7'));var sox=require(_0xeb24('0x8'));var csv=require(_0xeb24('0x9'));var ejs=require(_0xeb24('0xa'));var fs=require('fs');var _=require(_0xeb24('0xb'));var squel=require('squel');var crypto=require(_0xeb24('0xc'));var jsforce=require(_0xeb24('0xd'));var deskjs=require(_0xeb24('0xe'));var toCsv=require(_0xeb24('0x9'));var querystring=require(_0xeb24('0xf'));var Papa=require(_0xeb24('0x10'));var Redis=require('ioredis');var authService=require(_0xeb24('0x11'));var qs=require(_0xeb24('0x12'));var as=require(_0xeb24('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb24('0x14'))(_0xeb24('0x15'));var utils=require(_0xeb24('0x16'));var config=require(_0xeb24('0x17'));var db=require(_0xeb24('0x18'))['db'];function respondWithStatusCode(_0x4f65a8,_0x34d7a6){_0x34d7a6=_0x34d7a6||0xcc;return function(_0x496172){if(_0x496172){return _0x4f65a8[_0xeb24('0x19')](_0x34d7a6);}return _0x4f65a8[_0xeb24('0x1a')](_0x34d7a6)[_0xeb24('0x1b')]();};}function respondWithResult(_0x1427d1,_0x14a67f){_0x14a67f=_0x14a67f||0xc8;return function(_0x25ad4e){if(_0x25ad4e){return _0x1427d1[_0xeb24('0x1a')](_0x14a67f)[_0xeb24('0x1c')](_0x25ad4e);}};}function respondWithFilteredResult(_0x219b94,_0x5cdfbd){return function(_0x5e02a7){if(_0x5e02a7){var _0xa764a5=_0x5e02a7['count'],_0x51e6be=_0x5cdfbd['offset'],_0x7ec4b9=_0x5cdfbd['offset']+_0x5cdfbd[_0xeb24('0x1d')],_0x1b123a;if(_0x7ec4b9>=_0xa764a5){_0x7ec4b9=_0xa764a5;_0x1b123a=0xc8;}else{_0x1b123a=0xce;}_0x219b94['status'](_0x1b123a);return _0x219b94['set'](_0xeb24('0x1e'),_0x51e6be+'-'+_0x7ec4b9+'/'+_0xa764a5)['json'](_0x5e02a7);}return null;};}function patchUpdates(_0xf3774b){return function(_0xed27fc){try{jsonpatch[_0xeb24('0x1f')](_0xed27fc,_0xf3774b,!![]);}catch(_0x14c654){return BPromise[_0xeb24('0x20')](_0x14c654);}return _0xed27fc[_0xeb24('0x21')]();};}function saveUpdates(_0x13c1c7,_0x599e37){return function(_0x165366){if(_0x165366){return _0x165366[_0xeb24('0x22')](_0x13c1c7)[_0xeb24('0x23')](function(_0x1f65da){return _0x1f65da;});}return null;};}function removeEntity(_0x4aa392,_0x20ab9c){return function(_0x22c530){if(_0x22c530){return _0x22c530[_0xeb24('0x24')]()[_0xeb24('0x23')](function(){_0x4aa392[_0xeb24('0x1a')](0xcc)[_0xeb24('0x1b')]();});}};}function handleEntityNotFound(_0x330b60,_0x14f905){return function(_0x446885){if(!_0x446885){_0x330b60[_0xeb24('0x19')](0x194);}return _0x446885;};}function handleError(_0x30ca83,_0x2dc700){_0x2dc700=_0x2dc700||0x1f4;return function(_0x1cb88b){logger[_0xeb24('0x25')](_0x1cb88b[_0xeb24('0x26')]);if(_0x1cb88b[_0xeb24('0x27')]){delete _0x1cb88b[_0xeb24('0x27')];}_0x30ca83[_0xeb24('0x1a')](_0x2dc700)[_0xeb24('0x28')](_0x1cb88b);};}exports[_0xeb24('0x29')]=function(_0x229683,_0x29514d){var _0x5a1f2d={},_0x2d1980={},_0xec09f7={'count':0x0,'rows':[]};var _0x86af55=_[_0xeb24('0x2a')](db[_0xeb24('0x2b')][_0xeb24('0x2c')],function(_0x2f0332){return{'name':_0x2f0332[_0xeb24('0x2d')],'type':_0x2f0332['type'][_0xeb24('0x2e')]};});_0x2d1980[_0xeb24('0x2f')]=_[_0xeb24('0x2a')](_0x86af55,'name');_0x2d1980['query']=_['keys'](_0x229683[_0xeb24('0x30')]);_0x2d1980['filters']=_['intersection'](_0x2d1980[_0xeb24('0x2f')],_0x2d1980['query']);_0x5a1f2d[_0xeb24('0x31')]=_[_0xeb24('0x32')](_0x2d1980[_0xeb24('0x2f')],qs[_0xeb24('0x33')](_0x229683['query'][_0xeb24('0x33')]));_0x5a1f2d[_0xeb24('0x31')]=_0x5a1f2d[_0xeb24('0x31')][_0xeb24('0x34')]?_0x5a1f2d[_0xeb24('0x31')]:_0x2d1980[_0xeb24('0x2f')];if(!_0x229683[_0xeb24('0x30')]['hasOwnProperty'](_0xeb24('0x35'))){_0x5a1f2d[_0xeb24('0x1d')]=qs[_0xeb24('0x1d')](_0x229683[_0xeb24('0x30')]['limit']);_0x5a1f2d[_0xeb24('0x36')]=qs[_0xeb24('0x36')](_0x229683['query']['offset']);}_0x5a1f2d[_0xeb24('0x37')]=qs[_0xeb24('0x38')](_0x229683[_0xeb24('0x30')][_0xeb24('0x38')]);_0x5a1f2d['where']=qs[_0xeb24('0x39')](_['pick'](_0x229683[_0xeb24('0x30')],_0x2d1980[_0xeb24('0x39')]),_0x86af55);if(_0x229683[_0xeb24('0x30')]['filter']){_0x5a1f2d[_0xeb24('0x3a')]=_['merge'](_0x5a1f2d['where'],{'$or':_['map'](_0x86af55,function(_0xe763b8){if(_0xe763b8[_0xeb24('0x3b')]!==_0xeb24('0x3c')){var _0x311ee4={};_0x311ee4[_0xe763b8[_0xeb24('0x27')]]={'$like':'%'+_0x229683[_0xeb24('0x30')][_0xeb24('0x3d')]+'%'};return _0x311ee4;}})});}_0x5a1f2d=_[_0xeb24('0x3e')]({},_0x5a1f2d,_0x229683[_0xeb24('0x3f')]);var _0x191bc1={'where':_0x5a1f2d[_0xeb24('0x3a')]};return db[_0xeb24('0x2b')][_0xeb24('0x40')](_0x191bc1)[_0xeb24('0x23')](function(_0x4d4f7d){_0xec09f7[_0xeb24('0x40')]=_0x4d4f7d;if(_0x229683[_0xeb24('0x30')][_0xeb24('0x41')]){_0x5a1f2d[_0xeb24('0x42')]=[{'all':!![]}];}return db[_0xeb24('0x2b')][_0xeb24('0x43')](_0x5a1f2d);})[_0xeb24('0x23')](function(_0x6f5940){_0xec09f7[_0xeb24('0x44')]=_0x6f5940;return _0xec09f7;})['then'](respondWithFilteredResult(_0x29514d,_0x5a1f2d))[_0xeb24('0x45')](handleError(_0x29514d,null));};exports[_0xeb24('0x46')]=function(_0x54eb1a,_0x27f493){var _0x3f129b={'raw':!![],'where':{'id':_0x54eb1a[_0xeb24('0x47')]['id']}},_0x1dec81={};_0x1dec81['model']=_[_0xeb24('0x48')](db['WhatsappApplication'][_0xeb24('0x2c')]);_0x1dec81[_0xeb24('0x30')]=_[_0xeb24('0x48')](_0x54eb1a[_0xeb24('0x30')]);_0x1dec81[_0xeb24('0x39')]=_[_0xeb24('0x32')](_0x1dec81[_0xeb24('0x2f')],_0x1dec81[_0xeb24('0x30')]);_0x3f129b['attributes']=_[_0xeb24('0x32')](_0x1dec81[_0xeb24('0x2f')],qs[_0xeb24('0x33')](_0x54eb1a[_0xeb24('0x30')]['fields']));_0x3f129b[_0xeb24('0x31')]=_0x3f129b[_0xeb24('0x31')]['length']?_0x3f129b[_0xeb24('0x31')]:_0x1dec81[_0xeb24('0x2f')];if(_0x54eb1a[_0xeb24('0x30')][_0xeb24('0x41')]){_0x3f129b[_0xeb24('0x42')]=[{'all':!![]}];}_0x3f129b=_[_0xeb24('0x3e')]({},_0x3f129b,_0x54eb1a['options']);return db[_0xeb24('0x2b')]['find'](_0x3f129b)[_0xeb24('0x23')](handleEntityNotFound(_0x27f493,null))[_0xeb24('0x23')](respondWithResult(_0x27f493,null))['catch'](handleError(_0x27f493,null));};exports['create']=function(_0x51fffb,_0x4f9915){return db[_0xeb24('0x2b')][_0xeb24('0x49')](_0x51fffb[_0xeb24('0x4a')],{})[_0xeb24('0x23')](respondWithResult(_0x4f9915,0xc9))[_0xeb24('0x45')](handleError(_0x4f9915,null));};exports[_0xeb24('0x22')]=function(_0x2a632a,_0x3ce99a){if(_0x2a632a['body']['id']){delete _0x2a632a[_0xeb24('0x4a')]['id'];}return db[_0xeb24('0x2b')]['find']({'where':{'id':_0x2a632a[_0xeb24('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ce99a,null))[_0xeb24('0x23')](saveUpdates(_0x2a632a[_0xeb24('0x4a')],null))[_0xeb24('0x23')](respondWithResult(_0x3ce99a,null))[_0xeb24('0x45')](handleError(_0x3ce99a,null));};exports['destroy']=function(_0xc6c605,_0x588edf){return db[_0xeb24('0x2b')][_0xeb24('0x4b')]({'where':{'id':_0xc6c605[_0xeb24('0x47')]['id']}})['then'](handleEntityNotFound(_0x588edf,null))[_0xeb24('0x23')](removeEntity(_0x588edf,null))[_0xeb24('0x45')](handleError(_0x588edf,null));}; \ No newline at end of file +var _0x5b70=['find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','end','json','count','offset','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','WhatsappApplication','includeAll','include','findAll','rows','catch','keys','options'];(function(_0x19f36c,_0x5a6432){var _0x41382e=function(_0x4942b1){while(--_0x4942b1){_0x19f36c['push'](_0x19f36c['shift']());}};_0x41382e(++_0x5a6432);}(_0x5b70,0xdf));var _0x05b7=function(_0x1ec3be,_0x5a224e){_0x1ec3be=_0x1ec3be-0x0;var _0x1df743=_0x5b70[_0x1ec3be];return _0x1df743;};'use strict';var pdf=require(_0x05b7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x05b7('0x1'));var zipdir=require(_0x05b7('0x2'));var jsonpatch=require(_0x05b7('0x3'));var rp=require(_0x05b7('0x4'));var moment=require(_0x05b7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x05b7('0x6'));var util=require(_0x05b7('0x7'));var path=require(_0x05b7('0x8'));var sox=require('sox');var csv=require(_0x05b7('0x9'));var ejs=require(_0x05b7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x05b7('0xb'));var crypto=require(_0x05b7('0xc'));var jsforce=require(_0x05b7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x05b7('0xe'));var Papa=require(_0x05b7('0xf'));var Redis=require(_0x05b7('0x10'));var authService=require(_0x05b7('0x11'));var qs=require(_0x05b7('0x12'));var as=require(_0x05b7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05b7('0x14'))(_0x05b7('0x15'));var utils=require(_0x05b7('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d237,_0x3684df){_0x3684df=_0x3684df||0xcc;return function(_0x56fd66){if(_0x56fd66){return _0x56d237['sendStatus'](_0x3684df);}return _0x56d237[_0x05b7('0x17')](_0x3684df)[_0x05b7('0x18')]();};}function respondWithResult(_0x9d149f,_0x21a666){_0x21a666=_0x21a666||0xc8;return function(_0x68d4fe){if(_0x68d4fe){return _0x9d149f[_0x05b7('0x17')](_0x21a666)[_0x05b7('0x19')](_0x68d4fe);}};}function respondWithFilteredResult(_0x52d1b8,_0x3dc027){return function(_0x7cbb4d){if(_0x7cbb4d){var _0x31ba4f=_0x7cbb4d[_0x05b7('0x1a')],_0x536f80=_0x3dc027[_0x05b7('0x1b')],_0x277671=_0x3dc027[_0x05b7('0x1b')]+_0x3dc027['limit'],_0x139e04;if(_0x277671>=_0x31ba4f){_0x277671=_0x31ba4f;_0x139e04=0xc8;}else{_0x139e04=0xce;}_0x52d1b8['status'](_0x139e04);return _0x52d1b8[_0x05b7('0x1c')]('Content-Range',_0x536f80+'-'+_0x277671+'/'+_0x31ba4f)[_0x05b7('0x19')](_0x7cbb4d);}return null;};}function patchUpdates(_0x1b61eb){return function(_0x213562){try{jsonpatch[_0x05b7('0x1d')](_0x213562,_0x1b61eb,!![]);}catch(_0x555e4d){return BPromise[_0x05b7('0x1e')](_0x555e4d);}return _0x213562[_0x05b7('0x1f')]();};}function saveUpdates(_0x3d329e,_0x2ecb60){return function(_0x233622){if(_0x233622){return _0x233622[_0x05b7('0x20')](_0x3d329e)[_0x05b7('0x21')](function(_0x521e49){return _0x521e49;});}return null;};}function removeEntity(_0x1bbba3,_0x48fca5){return function(_0x39e202){if(_0x39e202){return _0x39e202['destroy']()[_0x05b7('0x21')](function(){_0x1bbba3['status'](0xcc)[_0x05b7('0x18')]();});}};}function handleEntityNotFound(_0x1e5c81,_0x2a6884){return function(_0x2b0861){if(!_0x2b0861){_0x1e5c81[_0x05b7('0x22')](0x194);}return _0x2b0861;};}function handleError(_0x1e0be8,_0x5ea85d){_0x5ea85d=_0x5ea85d||0x1f4;return function(_0x131bbd){logger[_0x05b7('0x23')](_0x131bbd[_0x05b7('0x24')]);if(_0x131bbd['name']){delete _0x131bbd[_0x05b7('0x25')];}_0x1e0be8['status'](_0x5ea85d)[_0x05b7('0x26')](_0x131bbd);};}exports[_0x05b7('0x27')]=function(_0x59bd5d,_0x31ab82){var _0x2bab21={},_0x284b42={},_0x5c3aff={'count':0x0,'rows':[]};var _0x1b6e5b=_[_0x05b7('0x28')](db['WhatsappApplication'][_0x05b7('0x29')],function(_0x3b1a83){return{'name':_0x3b1a83[_0x05b7('0x2a')],'type':_0x3b1a83[_0x05b7('0x2b')]['key']};});_0x284b42[_0x05b7('0x2c')]=_['map'](_0x1b6e5b,_0x05b7('0x25'));_0x284b42[_0x05b7('0x2d')]=_['keys'](_0x59bd5d['query']);_0x284b42[_0x05b7('0x2e')]=_[_0x05b7('0x2f')](_0x284b42[_0x05b7('0x2c')],_0x284b42[_0x05b7('0x2d')]);_0x2bab21['attributes']=_['intersection'](_0x284b42[_0x05b7('0x2c')],qs[_0x05b7('0x30')](_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x30')]));_0x2bab21[_0x05b7('0x31')]=_0x2bab21['attributes'][_0x05b7('0x32')]?_0x2bab21[_0x05b7('0x31')]:_0x284b42['model'];if(!_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x33')](_0x05b7('0x34'))){_0x2bab21[_0x05b7('0x35')]=qs[_0x05b7('0x35')](_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x35')]);_0x2bab21[_0x05b7('0x1b')]=qs[_0x05b7('0x1b')](_0x59bd5d['query'][_0x05b7('0x1b')]);}_0x2bab21[_0x05b7('0x36')]=qs['sort'](_0x59bd5d['query'][_0x05b7('0x37')]);_0x2bab21[_0x05b7('0x38')]=qs[_0x05b7('0x2e')](_[_0x05b7('0x39')](_0x59bd5d[_0x05b7('0x2d')],_0x284b42[_0x05b7('0x2e')]),_0x1b6e5b);if(_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x3a')]){_0x2bab21[_0x05b7('0x38')]=_['merge'](_0x2bab21[_0x05b7('0x38')],{'$or':_[_0x05b7('0x28')](_0x1b6e5b,function(_0x3c01f0){if(_0x3c01f0[_0x05b7('0x2b')]!==_0x05b7('0x3b')){var _0x3ef06a={};_0x3ef06a[_0x3c01f0['name']]={'$like':'%'+_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x3a')]+'%'};return _0x3ef06a;}})});}_0x2bab21=_[_0x05b7('0x3c')]({},_0x2bab21,_0x59bd5d['options']);var _0x3df417={'where':_0x2bab21[_0x05b7('0x38')]};return db[_0x05b7('0x3d')]['count'](_0x3df417)['then'](function(_0x28535c){_0x5c3aff[_0x05b7('0x1a')]=_0x28535c;if(_0x59bd5d[_0x05b7('0x2d')][_0x05b7('0x3e')]){_0x2bab21[_0x05b7('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x05b7('0x40')](_0x2bab21);})[_0x05b7('0x21')](function(_0x2557b7){_0x5c3aff[_0x05b7('0x41')]=_0x2557b7;return _0x5c3aff;})[_0x05b7('0x21')](respondWithFilteredResult(_0x31ab82,_0x2bab21))[_0x05b7('0x42')](handleError(_0x31ab82,null));};exports['show']=function(_0x1eaf5c,_0x795004){var _0x21baf3={'raw':!![],'where':{'id':_0x1eaf5c['params']['id']}},_0x156704={};_0x156704[_0x05b7('0x2c')]=_[_0x05b7('0x43')](db[_0x05b7('0x3d')][_0x05b7('0x29')]);_0x156704[_0x05b7('0x2d')]=_[_0x05b7('0x43')](_0x1eaf5c['query']);_0x156704[_0x05b7('0x2e')]=_[_0x05b7('0x2f')](_0x156704['model'],_0x156704['query']);_0x21baf3[_0x05b7('0x31')]=_[_0x05b7('0x2f')](_0x156704[_0x05b7('0x2c')],qs[_0x05b7('0x30')](_0x1eaf5c[_0x05b7('0x2d')][_0x05b7('0x30')]));_0x21baf3[_0x05b7('0x31')]=_0x21baf3['attributes']['length']?_0x21baf3[_0x05b7('0x31')]:_0x156704[_0x05b7('0x2c')];if(_0x1eaf5c[_0x05b7('0x2d')]['includeAll']){_0x21baf3['include']=[{'all':!![]}];}_0x21baf3=_['merge']({},_0x21baf3,_0x1eaf5c[_0x05b7('0x44')]);return db[_0x05b7('0x3d')][_0x05b7('0x45')](_0x21baf3)[_0x05b7('0x21')](handleEntityNotFound(_0x795004,null))['then'](respondWithResult(_0x795004,null))['catch'](handleError(_0x795004,null));};exports[_0x05b7('0x46')]=function(_0x358044,_0xd06559){return db['WhatsappApplication'][_0x05b7('0x46')](_0x358044[_0x05b7('0x47')],{})[_0x05b7('0x21')](respondWithResult(_0xd06559,0xc9))[_0x05b7('0x42')](handleError(_0xd06559,null));};exports['update']=function(_0x547235,_0x327926){if(_0x547235['body']['id']){delete _0x547235[_0x05b7('0x47')]['id'];}return db[_0x05b7('0x3d')][_0x05b7('0x45')]({'where':{'id':_0x547235[_0x05b7('0x48')]['id']}})[_0x05b7('0x21')](handleEntityNotFound(_0x327926,null))['then'](saveUpdates(_0x547235[_0x05b7('0x47')],null))['then'](respondWithResult(_0x327926,null))['catch'](handleError(_0x327926,null));};exports['destroy']=function(_0x1abb6a,_0x36bb56){return db[_0x05b7('0x3d')][_0x05b7('0x45')]({'where':{'id':_0x1abb6a[_0x05b7('0x48')]['id']}})[_0x05b7('0x21')](handleEntityNotFound(_0x36bb56,null))[_0x05b7('0x21')](removeEntity(_0x36bb56,null))[_0x05b7('0x42')](handleError(_0x36bb56,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 4ead990..abdc084 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0271=['moment','bluebird','path','rimraf','define','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x24dff7,_0xb7ddab){var _0x1b9152=function(_0x5be86e){while(--_0x5be86e){_0x24dff7['push'](_0x24dff7['shift']());}};_0x1b9152(++_0xb7ddab);}(_0x0271,0x189));var _0x1027=function(_0x1b57c2,_0x52e796){_0x1b57c2=_0x1b57c2-0x0;var _0x750c38=_0x0271[_0x1b57c2];return _0x750c38;};'use strict';var _=require('lodash');var util=require(_0x1027('0x0'));var logger=require(_0x1027('0x1'))(_0x1027('0x2'));var moment=require(_0x1027('0x3'));var BPromise=require(_0x1027('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1027('0x5'));var rimraf=require(_0x1027('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0xf69d1a,_0x12c03e){return _0xf69d1a[_0x1027('0x7')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1027('0x8')});}; \ No newline at end of file +var _0x5687=['../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','rimraf'];(function(_0x3f03f2,_0x3cf184){var _0x486e11=function(_0x1cf6e1){while(--_0x1cf6e1){_0x3f03f2['push'](_0x3f03f2['shift']());}};_0x486e11(++_0x3cf184);}(_0x5687,0x13a));var _0x7568=function(_0x2d2b1d,_0x295b42){_0x2d2b1d=_0x2d2b1d-0x0;var _0xc0eabe=_0x5687[_0x2d2b1d];return _0xc0eabe;};'use strict';var _=require(_0x7568('0x0'));var util=require(_0x7568('0x1'));var logger=require(_0x7568('0x2'))(_0x7568('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7568('0x4'));var config=require(_0x7568('0x5'));var attributes=require(_0x7568('0x6'));module[_0x7568('0x7')]=function(_0x118313,_0x1c5d93){return _0x118313[_0x7568('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7568('0x9'),'collate':_0x7568('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index a37fd2c..b53970b 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c32=['request','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x7b7098,_0x4157bc){var _0x4cc759=function(_0x3d4cc8){while(--_0x3d4cc8){_0x7b7098['push'](_0x7b7098['shift']());}};_0x4cc759(++_0x4157bc);}(_0x6c32,0xb5));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var moment=require(_0x26c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c3('0x3'))['db'];var utils=require(_0x26c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26c3('0x5'));var jayson=require(_0x26c3('0x6'));var client=jayson[_0x26c3('0x7')][_0x26c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17bc12,_0x2756e5,_0x438a89){return new BPromise(function(_0x11ed3d,_0x2134b8){return client[_0x26c3('0x9')](_0x17bc12,_0x438a89)['then'](function(_0x561496){logger[_0x26c3('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'));logger[_0x26c3('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'),JSON[_0x26c3('0xd')](_0x561496));if(_0x561496[_0x26c3('0xe')]){if(_0x561496[_0x26c3('0xe')][_0x26c3('0xf')]===0x1f4){logger['error'](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);return _0x2134b8(_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);}logger[_0x26c3('0xe')](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')]['message']);return _0x11ed3d(_0x561496['error'][_0x26c3('0x11')]);}else{logger[_0x26c3('0xa')](_0x26c3('0x10'),_0x2756e5,_0x26c3('0xb'));_0x11ed3d(_0x561496[_0x26c3('0x12')][_0x26c3('0x11')]);}})['catch'](function(_0x2edaca){logger[_0x26c3('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x2756e5,_0x2edaca);_0x2134b8(_0x2edaca);});});} \ No newline at end of file +var _0x6075=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','WhatsappApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x3cb83f,_0x2bc6dd){var _0x105d68=function(_0x18bd0f){while(--_0x18bd0f){_0x3cb83f['push'](_0x3cb83f['shift']());}};_0x105d68(++_0x2bc6dd);}(_0x6075,0x191));var _0x5607=function(_0x238f20,_0x2995ec){_0x238f20=_0x238f20-0x0;var _0x14cc79=_0x6075[_0x238f20];return _0x14cc79;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var moment=require(_0x5607('0x1'));var BPromise=require(_0x5607('0x2'));var rs=require(_0x5607('0x3'));var fs=require('fs');var Redis=require(_0x5607('0x4'));var db=require(_0x5607('0x5'))['db'];var utils=require(_0x5607('0x6'));var logger=require(_0x5607('0x7'))(_0x5607('0x8'));var config=require('../../config/environment');var jayson=require(_0x5607('0x9'));var client=jayson[_0x5607('0xa')][_0x5607('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab18d,_0x53f825,_0x3dc860){return new BPromise(function(_0x25107d,_0x24d9da){return client[_0x5607('0xc')](_0x5ab18d,_0x3dc860)[_0x5607('0xd')](function(_0x4f61bf){logger[_0x5607('0xe')](_0x5607('0xf'),_0x53f825,_0x5607('0x10'));logger['debug'](_0x5607('0x11'),_0x53f825,'request\x20sent',JSON['stringify'](_0x4f61bf));if(_0x4f61bf[_0x5607('0x12')]){if(_0x4f61bf[_0x5607('0x12')][_0x5607('0x13')]===0x1f4){logger['error'](_0x5607('0xf'),_0x53f825,_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);return _0x24d9da(_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);}logger[_0x5607('0x12')](_0x5607('0xf'),_0x53f825,_0x4f61bf[_0x5607('0x12')][_0x5607('0x14')]);return _0x25107d(_0x4f61bf['error'][_0x5607('0x14')]);}else{logger[_0x5607('0xe')](_0x5607('0xf'),_0x53f825,'request\x20sent');_0x25107d(_0x4f61bf['result'][_0x5607('0x14')]);}})['catch'](function(_0x38ab1c){logger[_0x5607('0x12')](_0x5607('0xf'),_0x53f825,_0x38ab1c);_0x24d9da(_0x38ab1c);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7f21f74..edaf2b3 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d65=['../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','multer','express','../../components/auth/service','../../components/interaction/service'];(function(_0xacff7b,_0x11de3d){var _0x59b50e=function(_0x591e7c){while(--_0x591e7c){_0xacff7b['push'](_0xacff7b['shift']());}};_0x59b50e(++_0x11de3d);}(_0x4d65,0xc0));var _0x54d6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4d65[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x54d6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x54d6('0x1'));var router=express['Router']();var auth=require(_0x54d6('0x2'));var interaction=require(_0x54d6('0x3'));var config=require(_0x54d6('0x4'));var controller=require(_0x54d6('0x5'));router[_0x54d6('0x6')]('/',auth[_0x54d6('0x7')](),controller[_0x54d6('0x8')]);router['get'](_0x54d6('0x9'),auth[_0x54d6('0x7')](),controller[_0x54d6('0xa')]);router['get'](_0x54d6('0xb'),auth[_0x54d6('0x7')](),controller[_0x54d6('0xc')]);router[_0x54d6('0x6')](_0x54d6('0xd'),auth[_0x54d6('0x7')](),controller['getMessages']);router[_0x54d6('0x6')](_0x54d6('0xe'),auth[_0x54d6('0x7')](),controller[_0x54d6('0xf')]);router[_0x54d6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x54d6('0x10')](_0x54d6('0xd'),auth[_0x54d6('0x7')](),controller[_0x54d6('0x11')]);router[_0x54d6('0x10')](_0x54d6('0x12'),auth[_0x54d6('0x7')](),interaction[_0x54d6('0x13')](_0x54d6('0x14'),_0x54d6('0x15')),controller['addTags']);router[_0x54d6('0x16')](_0x54d6('0xb'),auth['isAuthenticated'](),interaction[_0x54d6('0x13')](_0x54d6('0x14'),_0x54d6('0x17')),controller[_0x54d6('0x18')]);router[_0x54d6('0x19')](_0x54d6('0xb'),auth[_0x54d6('0x7')](),interaction['tracked']('whatsapp',_0x54d6('0x1a')),controller[_0x54d6('0x1b')]);router['delete']('/:id/tags',auth[_0x54d6('0x7')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xa4e8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','update','destroy','delete','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4e8,0xfd));var _0x8a4e=function(_0xeb8e8d,_0x607771){_0xeb8e8d=_0xeb8e8d-0x0;var _0x309878=_0xa4e8[_0xeb8e8d];return _0x309878;};'use strict';var multer=require(_0x8a4e('0x0'));var util=require(_0x8a4e('0x1'));var path=require(_0x8a4e('0x2'));var timeout=require(_0x8a4e('0x3'));var express=require(_0x8a4e('0x4'));var router=express[_0x8a4e('0x5')]();var auth=require(_0x8a4e('0x6'));var interaction=require(_0x8a4e('0x7'));var config=require(_0x8a4e('0x8'));var controller=require(_0x8a4e('0x9'));router[_0x8a4e('0xa')]('/',auth[_0x8a4e('0xb')](),controller[_0x8a4e('0xc')]);router[_0x8a4e('0xa')](_0x8a4e('0xd'),auth[_0x8a4e('0xb')](),controller['describe']);router[_0x8a4e('0xa')]('/:id',auth[_0x8a4e('0xb')](),controller[_0x8a4e('0xe')]);router[_0x8a4e('0xa')](_0x8a4e('0xf'),auth[_0x8a4e('0xb')](),controller['getMessages']);router[_0x8a4e('0xa')](_0x8a4e('0x10'),auth[_0x8a4e('0xb')](),controller[_0x8a4e('0x11')]);router[_0x8a4e('0x12')]('/',auth[_0x8a4e('0xb')](),controller[_0x8a4e('0x13')]);router[_0x8a4e('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x8a4e('0x14')]);router[_0x8a4e('0x12')](_0x8a4e('0x15'),auth['isAuthenticated'](),interaction[_0x8a4e('0x16')](_0x8a4e('0x17'),_0x8a4e('0x18')),controller[_0x8a4e('0x19')]);router[_0x8a4e('0x1a')](_0x8a4e('0x1b'),auth['isAuthenticated'](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x8a4e('0x1c')]);router['delete']('/:id',auth[_0x8a4e('0xb')](),interaction['tracked'](_0x8a4e('0x17'),'whatsappinteraction:destroy'),controller[_0x8a4e('0x1d')]);router[_0x8a4e('0x1e')](_0x8a4e('0x15'),auth[_0x8a4e('0xb')](),controller['removeTags']);module[_0x8a4e('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index fae3a09..5f2bb36 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xede8=['ENUM','out','sequelize','moment','STRING','DATE'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xede8,0x182));var _0x8ede=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xede8[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x8ede('0x0'));var moment=require(_0x8ede('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8ede('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8ede('0x2')]},'read1stAt':{'type':Sequelize[_0x8ede('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8ede('0x4')]('in',_0x8ede('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8ede('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8ede('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x2ebd=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x5205c7,_0x4d83b1){var _0x16e253=function(_0x3b6887){while(--_0x3b6887){_0x5205c7['push'](_0x5205c7['shift']());}};_0x16e253(++_0x4d83b1);}(_0x2ebd,0x1c5));var _0xd2eb=function(_0xe1b523,_0x2bc05b){_0xe1b523=_0xe1b523-0x0;var _0x52c152=_0x2ebd[_0xe1b523];return _0x52c152;};'use strict';var Sequelize=require(_0xd2eb('0x0'));var moment=require(_0xd2eb('0x1'));module[_0xd2eb('0x2')]={'closed':{'type':Sequelize[_0xd2eb('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd2eb('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd2eb('0x5')]},'read1stAt':{'type':Sequelize[_0xd2eb('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd2eb('0x6')]('in',_0xd2eb('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd2eb('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd2eb('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 535ba58..f7e5e23 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['attachments','Attachment','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','30px','%s\x20#%d','Whatsapp','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','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','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','select','color','tools_tags','u.id','field','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','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','UserId','buildExpression','start','body','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','rows','show','params','includeAll','include','WhatsappInteraction','create','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','format','options','findAll','emit','removeTags','unix','root','files','tmp','server','join','transcript-%d-%s.zip','User','firstName','lastName'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x25c465,_0x184735){_0x25c465=_0x25c465-0x0;var _0x32a4b6=_0x7a54[_0x25c465];return _0x32a4b6;};'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'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}function getInteractionUsers(_0x136b14,_0x16631f){return new BPromise(function(_0x361bfa,_0x1127f8){try{if(_0x16631f[_0x136b14['id']]){_0x136b14[_0x47a5('0x2b')]=_[_0x47a5('0x2c')](_0x16631f[_0x136b14['id']],function(_0x528582){return{'id':_0x528582['id'],'fullname':_0x528582[_0x47a5('0x2d')]};});}}catch(_0x51833b){_0x1127f8(_0x51833b);}_0x361bfa(_0x136b14);});}function getInteractionTags(_0x2ef875,_0x9ac908){return new BPromise(function(_0x16901f,_0x4d6b57){try{if(_0x2ef875[_0x47a5('0x2e')]){_0x2ef875[_0x47a5('0x2f')]=[];_0x2ef875[_0x47a5('0x2e')][_0x47a5('0x30')](',')['forEach'](function(_0x50d875){_0x2ef875[_0x47a5('0x2f')][_0x47a5('0x31')](_0x9ac908[_0x50d875]);});}delete _0x2ef875['TagIds'];}catch(_0x4e1006){_0x4d6b57(_0x4e1006);}_0x16901f(_0x2ef875);});}function updateWhatsappInteraction(_0x836303,_0x51544e,_0x57bff6){return new BPromise(function(_0x42f70c,_0x53119b){return getInteractionUsers(_0x836303,_0x57bff6)[_0x47a5('0x26')](function(_0xd972c){return getInteractionTags(_0xd972c,_0x51544e);})['then'](function(_0x4843c0){_0x42f70c(_0x4843c0);})[_0x47a5('0x32')](function(_0x5910bb){_0x53119b(_0x5910bb);});});}exports[_0x47a5('0x33')]=function(_0x87e4c9,_0xf269a8){var _0x52749b={},_0x18f7e9={},_0x50c086={'count':0x0,'rows':[]};var _0x53c754=_[_0x47a5('0x2c')](db['WhatsappInteraction'][_0x47a5('0x34')],function(_0x5ef577){return{'name':_0x5ef577[_0x47a5('0x35')],'type':_0x5ef577[_0x47a5('0x36')][_0x47a5('0x37')]};});_0x18f7e9[_0x47a5('0x38')]=_[_0x47a5('0x2c')](_0x53c754,_0x47a5('0x29'));_0x18f7e9[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x87e4c9[_0x47a5('0x39')]);_0x18f7e9['filters']=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],_0x18f7e9['query']);_0x52749b[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],qs['fields'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x3d')]));_0x52749b['attributes']=_0x52749b[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x52749b['attributes']:_0x18f7e9['model'];if(!_0x87e4c9['query'][_0x47a5('0x3f')]('nolimit')){_0x52749b[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1f')]);_0x52749b[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x52749b[_0x47a5('0x40')]=qs[_0x47a5('0x41')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x41')]);_0x52749b[_0x47a5('0x42')]=qs['filters'](_[_0x47a5('0x43')](_0x87e4c9[_0x47a5('0x39')],_0x18f7e9[_0x47a5('0x44')]),_0x53c754);var _0x23bd8d=[];var _0x586f4f=squel[_0x47a5('0x45')]()['field']('id')['field']('name')['field'](_0x47a5('0x46'))['from'](_0x47a5('0x47'));var _0x3a740b=squel[_0x47a5('0x45')]()['field'](_0x47a5('0x48'))[_0x47a5('0x49')]('u.fullname')['field'](_0x47a5('0x4a'))['from'](_0x47a5('0x4b'),'ui')[_0x47a5('0x4c')](_0x47a5('0x4d'),'u',_0x47a5('0x4e'));var _0x34a9ae=squel[_0x47a5('0x45')]()[_0x47a5('0x4f')](_0x47a5('0x50'),'i')[_0x47a5('0x4c')](_0x47a5('0x51'),'c',_0x47a5('0x52'))[_0x47a5('0x4c')](_0x47a5('0x4d'),'o',_0x47a5('0x53'))[_0x47a5('0x4c')](_0x47a5('0x54'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x47a5('0x4c')](_0x47a5('0x55'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x47a5('0x56'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x47a5('0x4c')](_0x47a5('0x47'),'t','t.id\x20=\x20it.TagId');var _0x4f62d3=squel[_0x47a5('0x57')]();var _0x52d409=[];var _0x2d147c=squel[_0x47a5('0x57')]();var _0x3548bc;if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x58')]){_0x3548bc=as[_0x47a5('0x59')](_0x87e4c9[_0x47a5('0x39')]['search']);var _0x48a0ef=_0x3548bc[_0x47a5('0x5a')];for(var _0x411230=0x0;_0x411230<_0x3548bc[_0x47a5('0x5b')][_0x47a5('0x3e')];_0x411230++){var _0x2c7020=_0x3548bc[_0x47a5('0x5b')][_0x411230];var _0x249de5='i';var _0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x2c7020[_0x47a5('0x49')]]);if(!_0x492cf7){switch(_0x2c7020['field']){case _0x47a5('0x5d'):if(_0x2c7020['value']==0x1){_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020[_0x47a5('0x49')]+_0x47a5('0x5f'));}else{_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020['field']+_0x47a5('0x60'));}break;case _0x47a5('0x61'):if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){if(_0x2c7020[_0x47a5('0x64')][_0x47a5('0x30')]('\x20')[_0x47a5('0x3e')]>0x1){_0x4f62d3[_0x48a0ef]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47a5('0x65')](_0x2c7020[_0x47a5('0x64')]),null);}else{var _0x187d7e='%'+_0x2c7020[_0x47a5('0x64')]+'%';_0x4f62d3[_0x48a0ef](_0x47a5('0x66'),_0x187d7e,_0x187d7e,_0x187d7e);}}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,['name',_0x47a5('0x67')]);_0x2c7020[_0x47a5('0x49')]=_0x47a5('0x67');_0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x69'):var _0x4fa1da=_0x2c7020['value'][_0x47a5('0x30')](',')['map'](function(_0x16bb8a){return Number(_0x16bb8a);});_0x4fa1da['forEach'](function(_0x482de6){_0x2d147c['or'](_0x47a5('0x6a'),'%,'+_0x482de6+',%');});_0x52d409=_[_0x47a5('0x6b')](_0x52d409,_0x4fa1da);break;case'User':if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){_0x4f62d3[_0x48a0ef]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2c7020['value']+'%',null);}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x47a5('0x6c')]);_0x2c7020[_0x47a5('0x49')]='UserId';_0x5cbe97=as[_0x47a5('0x6d')](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97['value'][_0x47a5('0x6e')],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x6f'):_0x5cbe97=as[_0x47a5('0x6d')]('me',null,_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97[_0x47a5('0x64')]['end']);break;}}else{var _0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7['type'],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')][_0x47a5('0x6e')],_0x5cbe97['value']['end']);}}}else{var _0x139229=_(_0x87e4c9[_0x47a5('0x39')])[_0x47a5('0x3a')]()[_0x47a5('0x2c')](function(_0xc45e25){return _['some'](_0x53c754,[_0x47a5('0x29'),_0xc45e25])?_0xc45e25:undefined;})['compact']()[_0x47a5('0x64')]();if(!_[_0x47a5('0x70')](_0x139229)){_0x139229['forEach'](function(_0x32b4de){if(_0x32b4de===_0x47a5('0x71')){_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x72'),[][_0x47a5('0x73')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de]));}else if(_0x32b4de===_0x47a5('0x74')){var _0x3ac38c=JSON['parse'](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])[_0x47a5('0x75')];var _0x3c75c6=JSON[_0x47a5('0x76')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])['$lte'];_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x77'),_0x3ac38c,_0x3c75c6);}else{if(_0x87e4c9[_0x47a5('0x39')][_0x32b4de]===_0x47a5('0x78')){_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x79'));}else{_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x7a'),_0x87e4c9[_0x47a5('0x39')][_0x32b4de]);}}});}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]==0x1){_0x34a9ae[_0x47a5('0x5e')](_0x47a5('0x7c'));}else{_0x34a9ae['having'](_0x47a5('0x7d'));}}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]){_0x52d409=_['isArray'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')])?_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]:new Array(_0x87e4c9['query'][_0x47a5('0x7e')]);_0x52d409['forEach'](function(_0x2d5ee6){_0x2d147c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2d5ee6+',%');});}if(_0x87e4c9[_0x47a5('0x39')]['filter']){var _0x7c1190=_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7f')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x47a5('0x80')](_0x7c1190)){_0x4f62d3['or'](_0x47a5('0x81'),_0x7c1190+'%')['or'](_0x47a5('0x82'),_0x7c1190+'%');}else{_0x4f62d3['or'](_0x47a5('0x83'),qs['getFullTextValue'](_0x7c1190))['or'](_0x47a5('0x84'),_0x7c1190+'%');}}}_0x34a9ae[_0x47a5('0x42')](_0x4f62d3);_0x34a9ae[_0x47a5('0x85')](_0x47a5('0x86'));var _0x308c9a={'type':db[_0x47a5('0x87')][_0x47a5('0x88')][_0x47a5('0x89')],'raw':!![]};var _0x4618a0=_0x34a9ae[_0x47a5('0x8a')]();_0x4618a0[_0x47a5('0x49')](_0x47a5('0x86'));_0x4618a0['field'](_0x47a5('0x8b'),'unreadMessages');if(_0x52749b[_0x47a5('0x40')]){_0x52749b[_0x47a5('0x40')][_0x47a5('0x8c')](function(_0x12fec9){_0x34a9ae[_0x47a5('0x40')]('i.'+_0x12fec9[0x0],_0x12fec9[0x1]===_0x47a5('0x8d')?![]:!![]);});}if(!_[_0x47a5('0x70')](_0x52d409)){_0x34a9ae[_0x47a5('0x5e')](_0x2d147c);_0x4618a0[_0x47a5('0x42')](_0x47a5('0x8e'),_0x52d409);}BPromise[_0x47a5('0x8f')]()[_0x47a5('0x26')](function(){if(!_0x3548bc){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x71')]||_0x87e4c9[_0x47a5('0x39')]['journey'])return;_0x4618a0['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x34a9ae['where'](_0x47a5('0x90'));return;}return _0x87e4c9[_0x47a5('0x91')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x47a5('0x26')](function(_0x44dda2){if(_[_0x47a5('0x70')](_0x44dda2)){_0x4618a0[_0x47a5('0x42')](_0x47a5('0x92'));_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x92'));}else{_0x4618a0[_0x47a5('0x42')](_0x47a5('0x72'),_[_0x47a5('0x2c')](_0x44dda2,'id'));_0x34a9ae[_0x47a5('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0x47a5('0x2c')](_0x44dda2,'id'));}});})[_0x47a5('0x26')](function(){db[_0x47a5('0x93')]['query'](_0x4618a0[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x17b61d){_0x50c086['count']=_0x17b61d[_0x47a5('0x3e')];if(_0x50c086['count']===0x0)return[];return db['sequelize'][_0x47a5('0x39')](_0x586f4f[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x27333e){_0x23bd8d=_[_0x47a5('0x95')](_0x27333e,'id');_0x308c9a=_[_0x47a5('0x96')](_0x308c9a,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x87e4c9['query'][_0x47a5('0x3d')]){_0x52749b['attributes'][_0x47a5('0x8c')](function(_0x3fffd1){_0x34a9ae[_0x47a5('0x49')]('i.'+_0x3fffd1);});}else{_0x34a9ae[_0x47a5('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47a5('0x5d'));_0x34a9ae['field']('a.key',_0x47a5('0x97'));_0x34a9ae[_0x47a5('0x49')]('a.mandatoryDisposition',_0x47a5('0x98'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x99'));_0x34a9ae['field'](_0x47a5('0x9a'),'Contact.firstName');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x9b'),_0x47a5('0x9c'));_0x34a9ae['field'](_0x47a5('0x9d'),_0x47a5('0x9e'));_0x34a9ae[_0x47a5('0x49')]('c.phone',_0x47a5('0x9f'));_0x34a9ae['field'](_0x47a5('0xa0'),'Contact.mobile');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa1'),_0x47a5('0xa2'));_0x34a9ae[_0x47a5('0x49')]('o.fullname',_0x47a5('0xa3'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa4'),_0x47a5('0xa5'));_0x34a9ae[_0x47a5('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x52749b[_0x47a5('0x1f')])_0x34a9ae['limit'](_0x52749b[_0x47a5('0x1f')]);if(_0x52749b[_0x47a5('0x1e')])_0x34a9ae[_0x47a5('0x1e')](_0x52749b['offset']);return db[_0x47a5('0x93')][_0x47a5('0x39')](_0x34a9ae['toString'](),_0x308c9a);})[_0x47a5('0x26')](function(_0x8a9dea){_0x3a740b[_0x47a5('0x42')](_0x47a5('0xa6'),_['map'](_0x8a9dea,'id'));return db['sequelize'][_0x47a5('0x39')](_0x3a740b[_0x47a5('0x94')](),_0x308c9a)['then'](function(_0x27d422){var _0x23f055=_['groupBy'](_0x27d422,_0x47a5('0xa7'));var _0x2a02cd=[];_0x8a9dea[_0x47a5('0x8c')](function(_0x59f010){_0x2a02cd[_0x47a5('0x31')](updateWhatsappInteraction(_0x59f010,_0x23bd8d,_0x23f055));});return BPromise['all'](_0x2a02cd);});});})[_0x47a5('0x26')](function(_0x5e2946){_0x50c086[_0x47a5('0xa8')]=_0x5e2946;return _0x50c086;})[_0x47a5('0x26')](respondWithFilteredResult(_0xf269a8,_0x52749b));})['catch'](handleError(_0xf269a8,null));};exports[_0x47a5('0xa9')]=function(_0x597cb2,_0x1eabef){var _0x36f619={'raw':![],'where':{'id':_0x597cb2[_0x47a5('0xaa')]['id']}},_0x37e045={};_0x37e045['model']=_[_0x47a5('0x3a')](db['WhatsappInteraction']['rawAttributes']);_0x37e045[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x597cb2[_0x47a5('0x39')]);_0x37e045[_0x47a5('0x44')]=_[_0x47a5('0x3b')](_0x37e045['model'],_0x37e045[_0x47a5('0x39')]);_0x36f619[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x37e045[_0x47a5('0x38')],qs['fields'](_0x597cb2[_0x47a5('0x39')]['fields']));_0x36f619[_0x47a5('0x3c')]=_0x36f619[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x36f619[_0x47a5('0x3c')]:_0x37e045[_0x47a5('0x38')];if(_0x597cb2[_0x47a5('0x39')][_0x47a5('0xab')]){_0x36f619[_0x47a5('0xac')]=[{'all':!![]}];}_0x36f619=_[_0x47a5('0x96')]({},_0x36f619,_0x597cb2['options']);return db[_0x47a5('0xad')][_0x47a5('0x5c')](_0x36f619)['then'](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x26')](respondWithResult(_0x1eabef,null))[_0x47a5('0x32')](handleError(_0x1eabef,null));};exports[_0x47a5('0xae')]=function(_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0xad')][_0x47a5('0xae')](_0x5b85cd['body'],{})['then'](respondWithResult(_0x4bf1f5,0xc9))[_0x47a5('0x32')](handleError(_0x4bf1f5,null));};exports[_0x47a5('0x24')]=function(_0x54eab1,_0x29e384){if(_0x54eab1[_0x47a5('0x6f')]['id']){delete _0x54eab1['body']['id'];}return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x54eab1[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x29e384,null))[_0x47a5('0x26')](saveUpdates(_0x54eab1[_0x47a5('0x6f')],null))['then'](respondWithResult(_0x29e384,null))['catch'](handleError(_0x29e384,null));};exports['destroy']=function(_0x133b7a,_0xce5ada){return db['WhatsappInteraction'][_0x47a5('0x5c')]({'where':{'id':_0x133b7a[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0xce5ada,null))[_0x47a5('0x26')](removeEntity(_0xce5ada,null))[_0x47a5('0x32')](handleError(_0xce5ada,null));};exports['describe']=function(_0x3e7750,_0x548a06){return db['WhatsappInteraction']['describe']()[_0x47a5('0x26')](respondWithResult(_0x548a06,null))['catch'](handleError(_0x548a06,null));};exports[_0x47a5('0xaf')]=function(_0xf3edc8,_0x5a316e,_0x49f791){return db[_0x47a5('0xb0')][_0x47a5('0x5c')]({'where':{'id':_0xf3edc8[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x5a316e,null))[_0x47a5('0x26')](function(_0x581a87){if(_0x581a87){return _0x581a87[_0x47a5('0xaf')](_0xf3edc8[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0xf3edc8[_0x47a5('0x6f')],[_0x47a5('0xb2'),'id'])||{});}})[_0x47a5('0x26')](respondWithResult(_0x5a316e,null))[_0x47a5('0x32')](handleError(_0x5a316e,null));};exports[_0x47a5('0xb3')]=function(_0x5112d7,_0x6a8174,_0x2e418d){var _0x50b236={'raw':![],'where':{}};var _0x263521={};var _0x9769b5={'count':0x0,'rows':[]};return db[_0x47a5('0xad')][_0x47a5('0xb4')]({'where':{'id':_0x5112d7['params']['id']}})['then'](handleEntityNotFound(_0x6a8174,null))['then'](function(_0x4eee99){if(_0x4eee99){_0x263521[_0x47a5('0x38')]=_[_0x47a5('0x3a')](db[_0x47a5('0xb0')][_0x47a5('0x34')]);_0x263521[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x5112d7[_0x47a5('0x39')]);_0x263521[_0x47a5('0x44')]=_['intersection'](_0x263521[_0x47a5('0x38')],_0x263521[_0x47a5('0x39')]);_0x50b236[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x263521['model'],qs['fields'](_0x5112d7[_0x47a5('0x39')]['fields']));_0x50b236['attributes']=_0x50b236[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x50b236['attributes']:_0x263521[_0x47a5('0x38')];if(!_0x5112d7[_0x47a5('0x39')][_0x47a5('0x3f')]('nolimit')){_0x50b236[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x5112d7['query'][_0x47a5('0x1f')]);_0x50b236[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x5112d7[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x50b236[_0x47a5('0x40')]=qs['sort'](_0x5112d7[_0x47a5('0x39')]['sort']);_0x50b236[_0x47a5('0x42')]=qs[_0x47a5('0x44')](_[_0x47a5('0x43')](_0x5112d7[_0x47a5('0x39')],_0x263521['filters']));_0x50b236[_0x47a5('0x42')][_0x47a5('0xa7')]=_0x4eee99['id'];if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x7f')]){_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],{'$or':_[_0x47a5('0x2c')](_0x50b236[_0x47a5('0x3c')],function(_0xa2045c){var _0x109738={};_0x109738[_0xa2045c]={'$like':'%'+_0x5112d7[_0x47a5('0x39')]['filter']+'%'};return _0x109738;})});}if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')]){var _0x591bde=_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')][_0x47a5('0x30')](',');var _0x2ccf21={};_0x2ccf21[_0x591bde[0x0]]={'$gte':moment(_0x591bde[0x1])[_0x47a5('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],_0x2ccf21);}_0x50b236=_[_0x47a5('0x96')]({},_0x50b236,_0x5112d7[_0x47a5('0xb6')]);return db[_0x47a5('0xb0')][_0x47a5('0x1d')]({'where':_0x50b236['where']})['then'](function(_0xa3d578){_0x9769b5['count']=_0xa3d578;if(_0x5112d7[_0x47a5('0x39')]['includeAll']){_0x50b236[_0x47a5('0xac')]=[{'all':!![]}];}return db[_0x47a5('0xb0')][_0x47a5('0xb7')](_0x50b236);})[_0x47a5('0x26')](function(_0x49cb8c){_0x9769b5[_0x47a5('0xa8')]=_0x49cb8c;return _0x9769b5;});}})[_0x47a5('0x26')](respondWithFilteredResult(_0x6a8174,_0x50b236))[_0x47a5('0x32')](handleError(_0x6a8174,null));};exports['addTags']=function(_0x581759,_0x30375f,_0x29015a){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x581759[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x30375f,null))[_0x47a5('0x26')](function(_0xe662d7){if(_0xe662d7){return _0xe662d7['setTags'](_0x581759[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0x581759[_0x47a5('0x6f')],['ids','id'])||{})['spread'](function(){return db[_0x47a5('0x69')][_0x47a5('0xb7')]({'attributes':['id','name',_0x47a5('0x46')],'where':{'id':_0x581759[_0x47a5('0x6f')][_0x47a5('0xb2')]}});})[_0x47a5('0x26')](function(_0x5a7f32){socket[_0x47a5('0xb8')]('whatsappInteractionTags:save',{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]});return{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]};});}})[_0x47a5('0x26')](respondWithResult(_0x30375f,null))['catch'](handleError(_0x30375f,null));};exports[_0x47a5('0xb9')]=function(_0x156d51,_0x401139,_0x2005d5){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x156d51[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x401139,null))[_0x47a5('0x26')](function(_0x2200f9){if(_0x2200f9){return _0x2200f9[_0x47a5('0xb9')](_0x156d51[_0x47a5('0x39')][_0x47a5('0xb2')]);}})[_0x47a5('0x26')](respondWithStatusCode(_0x401139,null))[_0x47a5('0x32')](handleError(_0x401139,null));};exports['download']=function(_0xdd95c8,_0x40aee5){var _0x322cee=moment()[_0x47a5('0xba')]()['toString']();var _0x367662=path['join'](config[_0x47a5('0xbb')],'server',_0x47a5('0xbc'),_0x47a5('0xbd'));var _0x3b894d=path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xbc'),'attachments');var _0x52798d=path[_0x47a5('0xbf')](_0x367662,_0x322cee);var _0x1a5e07=util[_0x47a5('0xb5')](_0x47a5('0xc0'),_0xdd95c8[_0x47a5('0xaa')]['id'],_0x322cee);var _0x579e5c=path[_0x47a5('0xbf')](_0x367662,_0x1a5e07);var _0x4b3ae4=[];_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc1')],'as':_0x47a5('0xc1'),'attributes':['id',_0x47a5('0x2d')],'raw':!![]});_0x4b3ae4['push']({'model':db['CmContact'],'as':_0x47a5('0x61'),'attributes':['id',_0x47a5('0xc2'),_0x47a5('0xc3')],'raw':!![]});if(_0xdd95c8[_0x47a5('0x39')][_0x47a5('0xc4')]){_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc5')],'as':_0x47a5('0xc5'),'raw':!![]});}var _0x2c2245=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x47a5('0x6f'),'createdAt',_0x47a5('0xc6'),_0x47a5('0xc7'),_0x47a5('0x7b')],'include':_0x4b3ae4}];_0x2c2245['push']({'model':db[_0x47a5('0xc8')],'as':_0x47a5('0xc9'),'attributes':['id','name']});_0x2c2245[_0x47a5('0x31')]({'model':db['User'],'as':_0x47a5('0xca'),'attributes':['id',_0x47a5('0x2d')]});return db[_0x47a5('0xad')]['find']({'where':{'id':_0xdd95c8['params']['id']},'include':_0x2c2245})['then'](handleEntityNotFound(_0x40aee5,null))['then'](function(_0x5075a6){if(_0x5075a6){var _0x1ba5b6=_0x5075a6['get']({'plain':!![]});fs[_0x47a5('0xcb')](_0x52798d);var _0x2287b0={'format':'A4','border':'10px','header':{'height':'40px','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
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'}},'footer':{'height':_0x47a5('0xcc'),'contents':{'default':util['format']('\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\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\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%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\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\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{{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\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\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%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\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',util['format'](_0x47a5('0xcd'),_0x47a5('0xce'),_0x1ba5b6['id']),moment()[_0x47a5('0xb5')](_0x47a5('0xcf'))['toString']())}}};var _0xdda046={'channel':'Whatsapp','account':_0x1ba5b6[_0x47a5('0xc9')]['name'],'agent':_0x1ba5b6[_0x47a5('0xca')]?_0x1ba5b6[_0x47a5('0xca')][_0x47a5('0x2d')]:'N.A.','createdAt':moment(_0x1ba5b6[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')](),'closedAt':_0x1ba5b6['closed']?moment(_0x1ba5b6[_0x47a5('0xd1')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')]():'','disposition':_0x1ba5b6[_0x47a5('0xd2')],'messages':_(_0x1ba5b6[_0x47a5('0xd3')])['filter']({'secret':![]})[_0x47a5('0x2c')](function(_0xe245ca){if(_0xe245ca[_0x47a5('0xc5')]){var _0xac8d4f=path[_0x47a5('0xbf')](_0x3b894d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]);if(fs[_0x47a5('0xd5')](_0xac8d4f)){fs[_0x47a5('0xd6')](_0xac8d4f)[_0x47a5('0xd7')](fs[_0x47a5('0xd8')](path[_0x47a5('0xbf')](_0x52798d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')])));}}return{'date':moment(_0xe245ca[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))['toString'](),'sender':_0xe245ca[_0x47a5('0xc6')]==='out'?_0xe245ca['User']?_0xe245ca[_0x47a5('0xc1')][_0x47a5('0x2d')]:_0x47a5('0xd9'):_0xe245ca['Contact'][_0x47a5('0xc2')]+(_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]?'\x20'+_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]:''),'body':_0xe245ca[_0x47a5('0xc5')]?_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]:_0xe245ca[_0x47a5('0x6f')],'direction':_0xe245ca[_0x47a5('0xc6')]===_0x47a5('0xda')?'A':'C','secret':_0xe245ca[_0x47a5('0xc7')],'read':_0xe245ca[_0x47a5('0x7b')],'attachment':_0xe245ca['Attachment']};})['value']()};return ejs[_0x47a5('0xdb')](path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xdc'),_0x47a5('0xdd')),{'interaction':_0xdda046})[_0x47a5('0x26')](function(_0x3708ea){return new BPromise(function(_0x583b37,_0x2b4039){pdf[_0x47a5('0xae')](_0x3708ea,_0x2287b0)[_0x47a5('0xde')](path['join'](_0x52798d,_0x47a5('0xdf')+_0x1ba5b6['id']+'-'+_0x322cee+_0x47a5('0xe0')),function(_0x3ecc41,_0x3e4148){if(_0x3ecc41)return _0x2b4039(_0x3ecc41);_0x583b37(_0x3e4148);});});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x23e649,_0x35e20f){zipdir(_0x52798d,{'saveTo':_0x579e5c},function(_0x46615a,_0xd6e255){if(_0x46615a)return _0x35e20f(_0x46615a);return _0x23e649(_0xd6e255);});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x1b91ad,_0x40b7a5){rimraf(_0x52798d,function(_0x28e998){if(_0x28e998)_0x40b7a5(_0x28e998);return _0x1b91ad();});});})[_0x47a5('0x26')](function(){return _0x40aee5[_0x47a5('0xe1')](_0x579e5c,_0x1a5e07,function(_0x3f7fdc){if(_0x3f7fdc){console[_0x47a5('0xe2')](_0x47a5('0xe3'),_0x3f7fdc);}else{fs[_0x47a5('0xe4')](_0x579e5c);}});});});}else{return _0x40aee5[_0x47a5('0x1a')](0xc8);}})[_0x47a5('0x32')](handleError(_0x40aee5,null));}; \ No newline at end of file +var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','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
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','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','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','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x14e23e,_0x5dafb6){var _0x1276e7=function(_0x326afe){while(--_0x326afe){_0x14e23e['push'](_0x14e23e['shift']());}};_0x1276e7(++_0x5dafb6);}(_0x814b,0x1a2));var _0xb814=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x814b[_0x22cb5f];return _0x274d36;};'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'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('\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\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\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%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\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\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{{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\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\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%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\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',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index b7891c0..7b5502e 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc9bf=['events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','map','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x293e55,_0x167995){var _0x27f9ef=function(_0x490aca){while(--_0x490aca){_0x293e55['push'](_0x293e55['shift']());}};_0x27f9ef(++_0x167995);}(_0xc9bf,0x1ed));var _0xfc9b=function(_0x114315,_0x304d88){_0x114315=_0x114315-0x0;var _0x2186ba=_0xc9bf[_0x114315];return _0x2186ba;};'use strict';var EventEmitter=require(_0xfc9b('0x0'));var WhatsappInteraction=require(_0xfc9b('0x1'))['db'][_0xfc9b('0x2')];var WhatsappMessage=require(_0xfc9b('0x1'))['db'][_0xfc9b('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfc9b('0x4')](0x0);var events={'afterCreate':_0xfc9b('0x5'),'afterUpdate':_0xfc9b('0x6'),'afterDestroy':_0xfc9b('0x7')};function emitEvent(_0x5b283f){return function(_0x2cbfb5,_0x494627,_0x546c7d){_0x2cbfb5['getUsers']({'attributes':['id'],'raw':!![]})[_0xfc9b('0x8')](function(_0x5b2cd3){_0x2cbfb5[_0xfc9b('0x9')]('Users',_0x5b2cd3[_0xfc9b('0xa')](function(_0x490622){return{'id':_0x490622['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x2cbfb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfc9b('0x8')](function(_0x4bbaf9){_0x2cbfb5['setDataValue']('unreadMessages',_0x4bbaf9[_0xfc9b('0xb')]);WhatsappInteractionEvents[_0xfc9b('0xc')](_0x5b283f+':'+_0x2cbfb5['id'],_0x2cbfb5);WhatsappInteractionEvents[_0xfc9b('0xc')](_0x5b283f,_0x2cbfb5);_0x546c7d(null);})[_0xfc9b('0xd')](_0x546c7d(null));};}for(var e in events){if(events[_0xfc9b('0xe')](e)){var event=events[e];WhatsappInteraction[_0xfc9b('0xf')](e,emitEvent(event));}}module[_0xfc9b('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc9c5=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x4e0c31,_0x208e9f){var _0x3fd7df=function(_0x5ee817){while(--_0x5ee817){_0x4e0c31['push'](_0x4e0c31['shift']());}};_0x3fd7df(++_0x208e9f);}(_0xc9c5,0x193));var _0x5c9c=function(_0xd4e6b4,_0x14394e){_0xd4e6b4=_0xd4e6b4-0x0;var _0x63f282=_0xc9c5[_0xd4e6b4];return _0x63f282;};'use strict';var EventEmitter=require(_0x5c9c('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x5c9c('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5c9c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c9c('0x3'),'afterDestroy':_0x5c9c('0x4')};function emitEvent(_0x7fe2bb){return function(_0x132510,_0x51db61,_0x596428){_0x132510[_0x5c9c('0x5')]({'attributes':['id'],'raw':!![]})[_0x5c9c('0x6')](function(_0x575d3e){_0x132510[_0x5c9c('0x7')](_0x5c9c('0x8'),_0x575d3e[_0x5c9c('0x9')](function(_0x1d0b48){return{'id':_0x1d0b48['id']};}));return WhatsappMessage[_0x5c9c('0xa')]({'where':{'WhatsappInteractionId':_0x132510['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c9c('0x6')](function(_0x55c5c2){_0x132510[_0x5c9c('0x7')](_0x5c9c('0xb'),_0x55c5c2[_0x5c9c('0xc')]);WhatsappInteractionEvents['emit'](_0x7fe2bb+':'+_0x132510['id'],_0x132510);WhatsappInteractionEvents[_0x5c9c('0xd')](_0x7fe2bb,_0x132510);_0x596428(null);})[_0x5c9c('0xe')](_0x596428(null));};}for(var e in events){if(events[_0x5c9c('0xf')](e)){var event=events[e];WhatsappInteraction[_0x5c9c('0x10')](e,emitEvent(event));}}module[_0x5c9c('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index ba24aa0..59ab736 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00b5=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed'];(function(_0x28c2cc,_0x212fab){var _0xf79b8f=function(_0x385b1f){while(--_0x385b1f){_0x28c2cc['push'](_0x28c2cc['shift']());}};_0xf79b8f(++_0x212fab);}(_0x00b5,0x103));var _0x500b=function(_0x5f2e2c,_0x110a16){_0x5f2e2c=_0x5f2e2c-0x0;var _0x5acf22=_0x00b5[_0x5f2e2c];return _0x5acf22;};'use strict';var _=require(_0x500b('0x0'));var util=require(_0x500b('0x1'));var logger=require('../../config/logger')(_0x500b('0x2'));var moment=require(_0x500b('0x3'));var BPromise=require('bluebird');var rp=require(_0x500b('0x4'));var fs=require('fs');var path=require(_0x500b('0x5'));var rimraf=require(_0x500b('0x6'));var config=require(_0x500b('0x7'));var attributes=require(_0x500b('0x8'));module[_0x500b('0x9')]=function(_0x33c80e,_0x400228){return _0x33c80e[_0x500b('0xa')](_0x500b('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d8cb7,_0x1fef46,_0x57584a){if(_0x2d8cb7[_0x500b('0xc')](_0x500b('0xd'))){_0x2d8cb7[_0x500b('0xe')]=moment()[_0x500b('0xf')](_0x500b('0x10'));}_0x57584a(null,_0x2d8cb7);}}});}; \ No newline at end of file +var _0xc249=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x102d20,_0x4a0162){var _0x59c89a=function(_0x1b694d){while(--_0x1b694d){_0x102d20['push'](_0x102d20['shift']());}};_0x59c89a(++_0x4a0162);}(_0xc249,0x190));var _0x9c24=function(_0x3a060a,_0xf8626d){_0x3a060a=_0x3a060a-0x0;var _0x45a20c=_0xc249[_0x3a060a];return _0x45a20c;};'use strict';var _=require(_0x9c24('0x0'));var util=require(_0x9c24('0x1'));var logger=require(_0x9c24('0x2'))(_0x9c24('0x3'));var moment=require(_0x9c24('0x4'));var BPromise=require(_0x9c24('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c24('0x6'));var config=require(_0x9c24('0x7'));var attributes=require(_0x9c24('0x8'));module['exports']=function(_0x4350c3,_0x22ce67){return _0x4350c3[_0x9c24('0x9')](_0x9c24('0xa'),attributes,{'tableName':_0x9c24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17bc4e,_0x434936,_0x55a538){if(_0x17bc4e[_0x9c24('0xc')](_0x9c24('0xd'))){_0x17bc4e['closedAt']=moment()[_0x9c24('0xe')](_0x9c24('0xf'));}_0x55a538(null,_0x17bc4e);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index a0e9cb4..87d0601 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdab6=['options','raw','where','UpdateWhatsappInteraction','debug','AddTagsToWhatsappInteraction','find','addTags','ids','spread','AddTags','lodash','moment','ioredis','rpc','../../config/environment','jayson/promise','redis','localhost','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','WhatsappInteraction','body'];(function(_0x5a71d3,_0x41cbd8){var _0xb929be=function(_0x28cadd){while(--_0x28cadd){_0x5a71d3['push'](_0x5a71d3['shift']());}};_0xb929be(++_0x41cbd8);}(_0xdab6,0x197));var _0x6dab=function(_0x33337f,_0x5d7319){_0x33337f=_0x33337f-0x0;var _0x3d9d50=_0xdab6[_0x33337f];return _0x3d9d50;};'use strict';var _=require(_0x6dab('0x0'));var util=require('util');var moment=require(_0x6dab('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dab('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6dab('0x3'));var config=require(_0x6dab('0x4'));var jayson=require(_0x6dab('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x6dab('0x6')]=_['defaults'](config[_0x6dab('0x6')],{'host':_0x6dab('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dab('0x6')]));require('./whatsappInteraction.socket')[_0x6dab('0x8')](socket);function respondWithRpcPromise(_0xbf63a6,_0x5565d1,_0x16463d){return new BPromise(function(_0x5da310,_0x5a5680){return client[_0x6dab('0x9')](_0xbf63a6,_0x16463d)[_0x6dab('0xa')](function(_0x4318ff){logger[_0x6dab('0xb')](_0x6dab('0xc'),_0x5565d1,_0x6dab('0xd'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5565d1,_0x6dab('0xd'),JSON[_0x6dab('0xe')](_0x4318ff));if(_0x4318ff[_0x6dab('0xf')]){if(_0x4318ff[_0x6dab('0xf')][_0x6dab('0x10')]===0x1f4){logger[_0x6dab('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x5565d1,_0x4318ff[_0x6dab('0xf')][_0x6dab('0x11')]);return _0x5a5680(_0x4318ff['error']['message']);}logger[_0x6dab('0xf')](_0x6dab('0xc'),_0x5565d1,_0x4318ff[_0x6dab('0xf')][_0x6dab('0x11')]);return _0x5da310(_0x4318ff[_0x6dab('0xf')][_0x6dab('0x11')]);}else{logger[_0x6dab('0xb')](_0x6dab('0xc'),_0x5565d1,_0x6dab('0xd'));_0x5da310(_0x4318ff[_0x6dab('0x12')][_0x6dab('0x11')]);}})[_0x6dab('0x13')](function(_0x5ad1b5){logger[_0x6dab('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x5565d1,_0x5ad1b5);_0x5a5680(_0x5ad1b5);});});}exports['UpdateWhatsappInteraction']=function(_0x1fdb8d){var _0xbf1032=this;return new Promise(function(_0x2d1f61,_0x513587){return db[_0x6dab('0x14')]['update'](_0x1fdb8d[_0x6dab('0x15')],{'raw':_0x1fdb8d[_0x6dab('0x16')]?_0x1fdb8d[_0x6dab('0x16')][_0x6dab('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fdb8d[_0x6dab('0x16')]?_0x1fdb8d[_0x6dab('0x16')][_0x6dab('0x18')]||null:null,'attributes':_0x1fdb8d[_0x6dab('0x16')]?_0x1fdb8d[_0x6dab('0x16')]['attributes']||null:null,'limit':_0x1fdb8d[_0x6dab('0x16')]?_0x1fdb8d[_0x6dab('0x16')]['limit']||null:null})[_0x6dab('0xa')](function(_0x410ca4){logger[_0x6dab('0xb')](_0x6dab('0x19'),_0x1fdb8d);logger[_0x6dab('0x1a')](_0x6dab('0x19'),_0x1fdb8d,JSON[_0x6dab('0xe')](_0x410ca4));_0x2d1f61(_0x410ca4);})[_0x6dab('0x13')](function(_0xb7f5){logger[_0x6dab('0xf')](_0x6dab('0x19'),_0xb7f5[_0x6dab('0x11')],_0x1fdb8d);_0x513587(_0xbf1032[_0x6dab('0xf')](0x1f4,_0xb7f5['message']));});});};exports[_0x6dab('0x1b')]=function(_0xc80738){return new Promise(function(_0x222d60,_0x5a21df){return db[_0x6dab('0x14')][_0x6dab('0x1c')]({'where':_0xc80738['options']?_0xc80738[_0x6dab('0x16')][_0x6dab('0x18')]||null:null})[_0x6dab('0xa')](function(_0x4bbb92){if(_0x4bbb92){return _0x4bbb92[_0x6dab('0x1d')](_0xc80738[_0x6dab('0x15')][_0x6dab('0x1e')],_['omit'](_0xc80738[_0x6dab('0x15')],[_0x6dab('0x1e'),'id'])||{});}})[_0x6dab('0x1f')](function(_0x1d64d3){logger[_0x6dab('0xb')]('AddTags',_0xc80738);logger['debug'](_0x6dab('0x20'),_0xc80738,JSON['stringify'](_0x1d64d3));_0x222d60(_0x1d64d3);})[_0x6dab('0x13')](function(_0x3ebf9b){logger[_0x6dab('0xf')](_0x6dab('0x20'),_0x3ebf9b['message'],_0xc80738);_0x5a21df(_this[_0x6dab('0xf')](0x1f4,_0x3ebf9b[_0x6dab('0x11')]));});});}; \ No newline at end of file +var _0xb923=['attributes','limit','stringify','catch','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','spread','AddTags','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','UpdateWhatsappInteraction','update','body','options','raw','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb923,0x161));var _0x3b92=function(_0x1a4f6c,_0xb28a0f){_0x1a4f6c=_0x1a4f6c-0x0;var _0x16a471=_0xb923[_0x1a4f6c];return _0x16a471;};'use strict';var _=require('lodash');var util=require(_0x3b92('0x0'));var moment=require(_0x3b92('0x1'));var BPromise=require('bluebird');var rs=require(_0x3b92('0x2'));var fs=require('fs');var Redis=require(_0x3b92('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3b92('0x4'))(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require(_0x3b92('0x7'));var client=jayson[_0x3b92('0x8')][_0x3b92('0x9')]({'port':0x232a});config[_0x3b92('0xa')]=_['defaults'](config[_0x3b92('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b92('0xa')]));require(_0x3b92('0xb'))['register'](socket);function respondWithRpcPromise(_0x5b35a3,_0x53472a,_0x2bcc93){return new BPromise(function(_0xb2936a,_0x1f2112){return client[_0x3b92('0xc')](_0x5b35a3,_0x2bcc93)[_0x3b92('0xd')](function(_0x1bc37d){logger[_0x3b92('0xe')](_0x3b92('0xf'),_0x53472a,'request\x20sent');logger[_0x3b92('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x53472a,_0x3b92('0x11'),JSON['stringify'](_0x1bc37d));if(_0x1bc37d[_0x3b92('0x12')]){if(_0x1bc37d[_0x3b92('0x12')]['code']===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x53472a,_0x1bc37d[_0x3b92('0x12')][_0x3b92('0x13')]);return _0x1f2112(_0x1bc37d['error'][_0x3b92('0x13')]);}logger['error'](_0x3b92('0xf'),_0x53472a,_0x1bc37d[_0x3b92('0x12')][_0x3b92('0x13')]);return _0xb2936a(_0x1bc37d[_0x3b92('0x12')][_0x3b92('0x13')]);}else{logger['info'](_0x3b92('0xf'),_0x53472a,_0x3b92('0x11'));_0xb2936a(_0x1bc37d[_0x3b92('0x14')]['message']);}})['catch'](function(_0x738dcb){logger[_0x3b92('0x12')](_0x3b92('0xf'),_0x53472a,_0x738dcb);_0x1f2112(_0x738dcb);});});}exports[_0x3b92('0x15')]=function(_0x5565ea){var _0x57e779=this;return new Promise(function(_0x48a7f9,_0x53e84e){return db['WhatsappInteraction'][_0x3b92('0x16')](_0x5565ea[_0x3b92('0x17')],{'raw':_0x5565ea[_0x3b92('0x18')]?_0x5565ea[_0x3b92('0x18')][_0x3b92('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5565ea[_0x3b92('0x18')]?_0x5565ea['options'][_0x3b92('0x1a')]||null:null,'attributes':_0x5565ea[_0x3b92('0x18')]?_0x5565ea[_0x3b92('0x18')][_0x3b92('0x1b')]||null:null,'limit':_0x5565ea[_0x3b92('0x18')]?_0x5565ea[_0x3b92('0x18')][_0x3b92('0x1c')]||null:null})[_0x3b92('0xd')](function(_0x33553e){logger[_0x3b92('0xe')](_0x3b92('0x15'),_0x5565ea);logger[_0x3b92('0x10')](_0x3b92('0x15'),_0x5565ea,JSON[_0x3b92('0x1d')](_0x33553e));_0x48a7f9(_0x33553e);})[_0x3b92('0x1e')](function(_0xcef421){logger[_0x3b92('0x12')]('UpdateWhatsappInteraction',_0xcef421[_0x3b92('0x13')],_0x5565ea);_0x53e84e(_0x57e779[_0x3b92('0x12')](0x1f4,_0xcef421[_0x3b92('0x13')]));});});};exports[_0x3b92('0x1f')]=function(_0x3ca6d6){return new Promise(function(_0x30e312,_0x5a9c4f){return db[_0x3b92('0x20')][_0x3b92('0x21')]({'where':_0x3ca6d6['options']?_0x3ca6d6[_0x3b92('0x18')][_0x3b92('0x1a')]||null:null})['then'](function(_0x3f91b6){if(_0x3f91b6){return _0x3f91b6[_0x3b92('0x22')](_0x3ca6d6[_0x3b92('0x17')][_0x3b92('0x23')],_['omit'](_0x3ca6d6['body'],[_0x3b92('0x23'),'id'])||{});}})[_0x3b92('0x24')](function(_0x582385){logger[_0x3b92('0xe')](_0x3b92('0x25'),_0x3ca6d6);logger[_0x3b92('0x10')](_0x3b92('0x25'),_0x3ca6d6,JSON[_0x3b92('0x1d')](_0x582385));_0x30e312(_0x582385);})[_0x3b92('0x1e')](function(_0x154b90){logger[_0x3b92('0x12')](_0x3b92('0x25'),_0x154b90[_0x3b92('0x13')],_0x3ca6d6);_0x5a9c4f(_this['error'](0x1f4,_0x154b90[_0x3b92('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 124b045..de2b13c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cd9=['emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cd9,0x118));var _0x91cd=function(_0x17e798,_0x446651){_0x17e798=_0x17e798-0x0;var _0x47ef8c=_0x1cd9[_0x17e798];return _0x47ef8c;};'use strict';var WhatsappInteractionEvents=require(_0x91cd('0x0'));var events=[_0x91cd('0x1'),'remove','update'];function createListener(_0x42fac1,_0x5a35bb){return function(_0x5f17b1){_0x5a35bb[_0x91cd('0x2')](_0x42fac1,_0x5f17b1);};}function removeListener(_0x18bdd3,_0x16a9d0){return function(){WhatsappInteractionEvents[_0x91cd('0x3')](_0x18bdd3,_0x16a9d0);};}exports[_0x91cd('0x4')]=function(_0x30f2f1){for(var _0x536353=0x0,_0x40f510=events['length'];_0x536353<_0x40f510;_0x536353++){var _0x6fdf2d=events[_0x536353];var _0x23c792=createListener(_0x91cd('0x5')+_0x6fdf2d,_0x30f2f1);WhatsappInteractionEvents['on'](_0x6fdf2d,_0x23c792);}}; \ No newline at end of file +var _0x2b99=['update','emit','removeListener','register','length','./whatsappInteraction.events','save','remove'];(function(_0x461dac,_0x24b4d7){var _0x462fe7=function(_0xbeb3d3){while(--_0xbeb3d3){_0x461dac['push'](_0x461dac['shift']());}};_0x462fe7(++_0x24b4d7);}(_0x2b99,0xa5));var _0x92b9=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x2b99[_0x243b59];return _0x3e1676;};'use strict';var WhatsappInteractionEvents=require(_0x92b9('0x0'));var events=[_0x92b9('0x1'),_0x92b9('0x2'),_0x92b9('0x3')];function createListener(_0x1f3cc4,_0x1f82dc){return function(_0x4ccb5f){_0x1f82dc[_0x92b9('0x4')](_0x1f3cc4,_0x4ccb5f);};}function removeListener(_0x5517af,_0x5907c3){return function(){WhatsappInteractionEvents[_0x92b9('0x5')](_0x5517af,_0x5907c3);};}exports[_0x92b9('0x6')]=function(_0x334cc1){for(var _0x135995=0x0,_0x5723e7=events[_0x92b9('0x7')];_0x135995<_0x5723e7;_0x135995++){var _0x3c3512=events[_0x135995];var _0x4cadbf=createListener('whatsappInteraction:'+_0x3c3512,_0x334cc1);WhatsappInteractionEvents['on'](_0x3c3512,_0x4cadbf);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 6b97896..df80e46 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6347=['status','put','/:id/accept','accept','/:id/reject','reject','multer','util','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status'];(function(_0x58ff7a,_0x300d57){var _0x3e491b=function(_0x4fd4a7){while(--_0x4fd4a7){_0x58ff7a['push'](_0x58ff7a['shift']());}};_0x3e491b(++_0x300d57);}(_0x6347,0x90));var _0x7634=function(_0x5e5585,_0x2d4d7b){_0x5e5585=_0x5e5585-0x0;var _0x486032=_0x6347[_0x5e5585];return _0x486032;};'use strict';var multer=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7634('0x2')]();var auth=require(_0x7634('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7634('0x4'));var controller=require('./whatsappMessage.controller');router[_0x7634('0x5')]('/',auth[_0x7634('0x6')](),controller[_0x7634('0x7')]);router[_0x7634('0x5')](_0x7634('0x8'),auth[_0x7634('0x6')](),controller[_0x7634('0x9')]);router['get'](_0x7634('0xa'),auth[_0x7634('0x6')](),controller[_0x7634('0xb')]);router[_0x7634('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7634('0xd')](_0x7634('0xe'),_0x7634('0xf')),controller['create']);router[_0x7634('0xc')](_0x7634('0x10'),controller[_0x7634('0x11')]);router[_0x7634('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['put'](_0x7634('0x13'),auth[_0x7634('0x6')](),controller[_0x7634('0x14')]);router[_0x7634('0x12')](_0x7634('0x15'),auth[_0x7634('0x6')](),controller[_0x7634('0x16')]);router['delete'](_0x7634('0xa'),auth[_0x7634('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x573e=['tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x573e,0x109));var _0xe573=function(_0x2d9679,_0x4ab380){_0x2d9679=_0x2d9679-0x0;var _0x49a928=_0x573e[_0x2d9679];return _0x49a928;};'use strict';var multer=require(_0xe573('0x0'));var util=require(_0xe573('0x1'));var path=require(_0xe573('0x2'));var timeout=require(_0xe573('0x3'));var express=require(_0xe573('0x4'));var router=express['Router']();var auth=require(_0xe573('0x5'));var interaction=require(_0xe573('0x6'));var config=require(_0xe573('0x7'));var controller=require(_0xe573('0x8'));router[_0xe573('0x9')]('/',auth[_0xe573('0xa')](),controller[_0xe573('0xb')]);router[_0xe573('0x9')](_0xe573('0xc'),auth[_0xe573('0xa')](),controller[_0xe573('0xd')]);router[_0xe573('0x9')](_0xe573('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0xe573('0xf')](_0xe573('0x10'),_0xe573('0x11')),controller[_0xe573('0x12')]);router['post'](_0xe573('0x13'),controller[_0xe573('0x14')]);router[_0xe573('0x15')](_0xe573('0xe'),auth['isAuthenticated'](),controller[_0xe573('0x16')]);router[_0xe573('0x15')](_0xe573('0x17'),auth[_0xe573('0xa')](),controller[_0xe573('0x18')]);router[_0xe573('0x15')](_0xe573('0x19'),auth[_0xe573('0xa')](),controller['reject']);router['delete']('/:id',auth[_0xe573('0xa')](),controller[_0xe573('0x1a')]);module[_0xe573('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a80971d..b10bb80 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2b41=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b41,0x146));var _0x12b4=function(_0x1acc03,_0x1794d6){_0x1acc03=_0x1acc03-0x0;var _0x51bc63=_0x2b41[_0x1acc03];return _0x51bc63;};'use strict';var Sequelize=require(_0x12b4('0x0'));module[_0x12b4('0x1')]={'body':{'type':Sequelize[_0x12b4('0x2')](_0x12b4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x12b4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x12b4('0x5')]('in',_0x12b4('0x6')),'defaultValue':_0x12b4('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x12b4('0x7')]},'secret':{'type':Sequelize[_0x12b4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9b15=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9b15,0x191));var _0x59b1=function(_0x3d577d,_0x52ff5e){_0x3d577d=_0x3d577d-0x0;var _0x14b396=_0x9b15[_0x3d577d];return _0x14b396;};'use strict';var Sequelize=require(_0x59b1('0x0'));module[_0x59b1('0x1')]={'body':{'type':Sequelize[_0x59b1('0x2')](_0x59b1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x59b1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x59b1('0x5')]('in',_0x59b1('0x6')),'defaultValue':_0x59b1('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x59b1('0x7')](0xbe)},'phone':{'type':Sequelize[_0x59b1('0x7')]},'readAt':{'type':Sequelize[_0x59b1('0x8')]},'secret':{'type':Sequelize[_0x59b1('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 37db165..74a3022 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe297=['reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','CmContact','WhatsappInteraction','WhatsappInteractionId','UserId','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./whatsappMessage.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','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','sendStatus','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe297,0x152));var _0x7e29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe297[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7e29('0x0'));var rimraf=require(_0x7e29('0x1'));var zipdir=require(_0x7e29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e29('0x3'));var Mustache=require('mustache');var util=require(_0x7e29('0x4'));var path=require('path');var sox=require(_0x7e29('0x5'));var csv=require(_0x7e29('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7e29('0x7'));var crypto=require(_0x7e29('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e29('0x6'));var querystring=require(_0x7e29('0x9'));var Papa=require(_0x7e29('0xa'));var Redis=require(_0x7e29('0xb'));var authService=require(_0x7e29('0xc'));var qs=require(_0x7e29('0xd'));var as=require(_0x7e29('0xe'));var hardwareService=require(_0x7e29('0xf'));var logger=require(_0x7e29('0x10'))(_0x7e29('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7e29('0x12'))['db'];config[_0x7e29('0x13')]=_[_0x7e29('0x14')](config[_0x7e29('0x13')],{'host':_0x7e29('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e29('0x13')]));require(_0x7e29('0x16'))[_0x7e29('0x17')](socket);var jayson=require(_0x7e29('0x18'));var client=jayson[_0x7e29('0x19')][_0x7e29('0x1a')]({'port':0x232c});var client9002=jayson[_0x7e29('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x3e448c,_0x74964c,_0x563ca2){if(_0x563ca2){var _0x561a3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x561a3b[_0x7e29('0x1b')](_0x74964c)){return _0x3e448c;}else{throw new db[(_0x7e29('0x1c'))][(_0x7e29('0x1d'))](_0x7e29('0x1e'));}}else{return _0x3e448c;}}function respondWithRpcPromise(_0x1c3318,_0x2339bf,_0x2a2a1f,_0x1bae09){return new BPromise(function(_0x41b078,_0x197606){var _0x8fbceb=_0x1bae09||client;return _0x8fbceb['request'](_0x1c3318,_0x2a2a1f)[_0x7e29('0x1f')](function(_0x26227e){logger[_0x7e29('0x20')](_0x7e29('0x21'),_0x2339bf,_0x7e29('0x22'));logger['debug'](_0x7e29('0x23'),_0x2339bf,'request\x20sent',JSON[_0x7e29('0x24')](_0x26227e));if(_0x26227e['error']){if(_0x26227e['error'][_0x7e29('0x25')]===0x1f4){logger[_0x7e29('0x26')](_0x7e29('0x21'),_0x2339bf,_0x26227e[_0x7e29('0x26')][_0x7e29('0x27')]);return _0x197606(_0x26227e[_0x7e29('0x26')]['message']);}logger[_0x7e29('0x26')](_0x7e29('0x21'),_0x2339bf,_0x26227e[_0x7e29('0x26')][_0x7e29('0x27')]);return _0x41b078(_0x26227e[_0x7e29('0x26')][_0x7e29('0x27')]);}else{logger[_0x7e29('0x20')](_0x7e29('0x21'),_0x2339bf,_0x7e29('0x22'));_0x41b078(_0x26227e['result'][_0x7e29('0x27')]);}})['catch'](function(_0x42d9e7){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x2339bf,_0x42d9e7);_0x197606(_0x42d9e7);});});}function respondWithStatusCode(_0x4118df,_0x1dcdd2){_0x1dcdd2=_0x1dcdd2||0xcc;return function(_0x38b094){if(_0x38b094){return _0x4118df[_0x7e29('0x28')](_0x1dcdd2);}return _0x4118df[_0x7e29('0x29')](_0x1dcdd2)[_0x7e29('0x2a')]();};}function respondWithResult(_0xdad545,_0x3e828b){_0x3e828b=_0x3e828b||0xc8;return function(_0x8007bb){if(_0x8007bb){return _0xdad545[_0x7e29('0x29')](_0x3e828b)[_0x7e29('0x2b')](_0x8007bb);}};}function respondWithFilteredResult(_0x1250a8,_0xab747c){return function(_0x421c87){if(_0x421c87){var _0x212264=_0x421c87[_0x7e29('0x2c')],_0x4ee07d=_0xab747c[_0x7e29('0x2d')],_0x472bf5=_0xab747c[_0x7e29('0x2d')]+_0xab747c['limit'],_0x360640;if(_0x472bf5>=_0x212264){_0x472bf5=_0x212264;_0x360640=0xc8;}else{_0x360640=0xce;}_0x1250a8[_0x7e29('0x29')](_0x360640);return _0x1250a8[_0x7e29('0x2e')](_0x7e29('0x2f'),_0x4ee07d+'-'+_0x472bf5+'/'+_0x212264)['json'](_0x421c87);}return null;};}function patchUpdates(_0x4c094d){return function(_0x178194){try{jsonpatch[_0x7e29('0x30')](_0x178194,_0x4c094d,!![]);}catch(_0x341b1d){return BPromise[_0x7e29('0x31')](_0x341b1d);}return _0x178194[_0x7e29('0x32')]();};}function saveUpdates(_0x15ec3e,_0x3b2823){return function(_0x3f37e9){if(_0x3f37e9){return _0x3f37e9['update'](_0x15ec3e)[_0x7e29('0x1f')](function(_0x59c729){return _0x59c729;});}return null;};}function removeEntity(_0x5afb39,_0x4f47d2){return function(_0x318aed){if(_0x318aed){return _0x318aed[_0x7e29('0x33')]()[_0x7e29('0x1f')](function(){_0x5afb39['status'](0xcc)[_0x7e29('0x2a')]();});}};}function handleEntityNotFound(_0x1282b1,_0x34baf8){return function(_0x1ac3c2){if(!_0x1ac3c2){_0x1282b1['sendStatus'](0x194);}return _0x1ac3c2;};}function handleError(_0x522d6c,_0x18fe2e){_0x18fe2e=_0x18fe2e||0x1f4;return function(_0x3a31f2){logger[_0x7e29('0x26')](_0x3a31f2[_0x7e29('0x34')]);if(_0x3a31f2[_0x7e29('0x35')]){delete _0x3a31f2['name'];}_0x522d6c['status'](_0x18fe2e)[_0x7e29('0x36')](_0x3a31f2);};}exports[_0x7e29('0x37')]=function(_0x34ce7f,_0x3b165c){var _0xee2147={},_0x4bc38f={},_0x471b88={'count':0x0,'rows':[]};var _0x37d90b=_[_0x7e29('0x38')](db[_0x7e29('0x39')]['rawAttributes'],function(_0x462e2d){return{'name':_0x462e2d[_0x7e29('0x3a')],'type':_0x462e2d[_0x7e29('0x3b')][_0x7e29('0x3c')]};});_0x4bc38f[_0x7e29('0x3d')]=_[_0x7e29('0x38')](_0x37d90b,'name');_0x4bc38f[_0x7e29('0x3e')]=_[_0x7e29('0x3f')](_0x34ce7f[_0x7e29('0x3e')]);_0x4bc38f[_0x7e29('0x40')]=_[_0x7e29('0x41')](_0x4bc38f[_0x7e29('0x3d')],_0x4bc38f['query']);_0xee2147[_0x7e29('0x42')]=_[_0x7e29('0x41')](_0x4bc38f['model'],qs[_0x7e29('0x43')](_0x34ce7f[_0x7e29('0x3e')]['fields']));_0xee2147[_0x7e29('0x42')]=_0xee2147[_0x7e29('0x42')][_0x7e29('0x44')]?_0xee2147[_0x7e29('0x42')]:_0x4bc38f['model'];if(!_0x34ce7f['query']['hasOwnProperty'](_0x7e29('0x45'))){_0xee2147['limit']=qs[_0x7e29('0x46')](_0x34ce7f[_0x7e29('0x3e')][_0x7e29('0x46')]);_0xee2147[_0x7e29('0x2d')]=qs[_0x7e29('0x2d')](_0x34ce7f['query']['offset']);}_0xee2147['order']=qs[_0x7e29('0x47')](_0x34ce7f['query'][_0x7e29('0x47')]);_0xee2147['where']=qs[_0x7e29('0x40')](_[_0x7e29('0x48')](_0x34ce7f['query'],_0x4bc38f[_0x7e29('0x40')]),_0x37d90b);if(_0x34ce7f[_0x7e29('0x3e')]['filter']){_0xee2147[_0x7e29('0x49')]=_[_0x7e29('0x4a')](_0xee2147[_0x7e29('0x49')],{'$or':_['map'](_0x37d90b,function(_0x4c0fa6){if(_0x4c0fa6[_0x7e29('0x3b')]!==_0x7e29('0x4b')){var _0x261e1e={};_0x261e1e[_0x4c0fa6['name']]={'$like':'%'+_0x34ce7f[_0x7e29('0x3e')]['filter']+'%'};return _0x261e1e;}})});}_0xee2147=_[_0x7e29('0x4a')]({},_0xee2147,_0x34ce7f[_0x7e29('0x4c')]);var _0x8fb365={'where':_0xee2147[_0x7e29('0x49')]};return db['WhatsappMessage'][_0x7e29('0x2c')](_0x8fb365)[_0x7e29('0x1f')](function(_0x558a5f){_0x471b88[_0x7e29('0x2c')]=_0x558a5f;if(_0x34ce7f['query'][_0x7e29('0x4d')]){_0xee2147[_0x7e29('0x4e')]=[{'all':!![]}];}return db[_0x7e29('0x39')]['findAll'](_0xee2147);})['then'](function(_0x2c0793){_0x471b88[_0x7e29('0x4f')]=_0x2c0793;return _0x471b88;})[_0x7e29('0x1f')](respondWithFilteredResult(_0x3b165c,_0xee2147))[_0x7e29('0x50')](handleError(_0x3b165c,null));};exports['show']=function(_0x56b304,_0x5dbd07){var _0x5c71ed={'raw':!![],'where':{'id':_0x56b304[_0x7e29('0x51')]['id']}},_0x168949={};_0x168949[_0x7e29('0x3d')]=_[_0x7e29('0x3f')](db[_0x7e29('0x39')][_0x7e29('0x52')]);_0x168949['query']=_[_0x7e29('0x3f')](_0x56b304[_0x7e29('0x3e')]);_0x168949[_0x7e29('0x40')]=_[_0x7e29('0x41')](_0x168949['model'],_0x168949[_0x7e29('0x3e')]);_0x5c71ed[_0x7e29('0x42')]=_[_0x7e29('0x41')](_0x168949[_0x7e29('0x3d')],qs[_0x7e29('0x43')](_0x56b304['query']['fields']));_0x5c71ed[_0x7e29('0x42')]=_0x5c71ed[_0x7e29('0x42')][_0x7e29('0x44')]?_0x5c71ed[_0x7e29('0x42')]:_0x168949['model'];if(_0x56b304[_0x7e29('0x3e')][_0x7e29('0x4d')]){_0x5c71ed[_0x7e29('0x4e')]=[{'all':!![]}];}_0x5c71ed=_[_0x7e29('0x4a')]({},_0x5c71ed,_0x56b304['options']);return db[_0x7e29('0x39')][_0x7e29('0x53')](_0x5c71ed)[_0x7e29('0x1f')](handleEntityNotFound(_0x5dbd07,null))[_0x7e29('0x1f')](respondWithResult(_0x5dbd07,null))[_0x7e29('0x50')](handleError(_0x5dbd07,null));};exports[_0x7e29('0x54')]=function(_0x56661e,_0x520983){return db['WhatsappMessage'][_0x7e29('0x54')](_0x56661e[_0x7e29('0x55')],{})['then'](respondWithResult(_0x520983,0xc9))[_0x7e29('0x50')](handleError(_0x520983,null));};exports[_0x7e29('0x56')]=function(_0x2b0020,_0x365b2a){if(_0x2b0020[_0x7e29('0x55')]['id']){delete _0x2b0020['body']['id'];}return db[_0x7e29('0x39')]['find']({'where':{'id':_0x2b0020['params']['id']}})[_0x7e29('0x1f')](handleEntityNotFound(_0x365b2a,null))[_0x7e29('0x1f')](saveUpdates(_0x2b0020['body'],null))[_0x7e29('0x1f')](respondWithResult(_0x365b2a,null))[_0x7e29('0x50')](handleError(_0x365b2a,null));};exports[_0x7e29('0x33')]=function(_0x18d251,_0xa1f68){return db[_0x7e29('0x39')][_0x7e29('0x53')]({'where':{'id':_0x18d251[_0x7e29('0x51')]['id']}})[_0x7e29('0x1f')](handleEntityNotFound(_0xa1f68,null))['then'](removeEntity(_0xa1f68,null))[_0x7e29('0x50')](handleError(_0xa1f68,null));};exports[_0x7e29('0x57')]=function(_0x1c05f6,_0x3f978a){return db[_0x7e29('0x39')][_0x7e29('0x57')]()[_0x7e29('0x1f')](respondWithResult(_0x3f978a,null))[_0x7e29('0x50')](handleError(_0x3f978a,null));};var interaction_log=require('../../config/logger')(_0x7e29('0x58'));exports[_0x7e29('0x59')]=function(_0x4c13a6,_0x589ea7,_0x1fdd13){var _0x21fba0={'channel':_0x7e29('0x5a')};if(_0x4c13a6[_0x7e29('0x55')]['id']){delete _0x4c13a6[_0x7e29('0x55')]['id'];}_0x4c13a6[_0x7e29('0x55')][_0x7e29('0x5b')]=!![];_0x4c13a6[_0x7e29('0x55')][_0x7e29('0x5c')]=moment()['format'](_0x7e29('0x5d'));_0x4c13a6[_0x7e29('0x55')]['UserId']=_0x4c13a6[_0x7e29('0x55')]['UserId']||_0x4c13a6['user']['id'];return db[_0x7e29('0x39')][_0x7e29('0x53')]({'where':{'id':_0x4c13a6['params']['id'],'UserId':null},'include':[{'model':db[_0x7e29('0x5e')],'as':'Contact'}]})[_0x7e29('0x1f')](handleEntityNotFound(_0x589ea7,null))[_0x7e29('0x1f')](saveUpdates(_0x4c13a6['body'],null))[_0x7e29('0x1f')](function(_0x1ec74f){if(_0x1ec74f){_0x21fba0['message']=_0x1ec74f['get']({'plain':!![]});return db[_0x7e29('0x5f')][_0x7e29('0x53')]({'where':{'id':_0x1ec74f[_0x7e29('0x60')]}});}return null;})[_0x7e29('0x1f')](handleEntityNotFound(_0x589ea7,null))[_0x7e29('0x1f')](function(_0x5a1edb){if(_0x5a1edb){return _0x5a1edb[_0x7e29('0x56')]({'UserId':_0x4c13a6[_0x7e29('0x55')][_0x7e29('0x61')],'read1stAt':_[_0x7e29('0x62')](_0x5a1edb[_0x7e29('0x63')])?moment()[_0x7e29('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7e29('0x1f')](function(_0x52d4de){if(_0x52d4de){_0x21fba0[_0x7e29('0x65')]=_0x52d4de[_0x7e29('0x66')]({'plain':!![]});interaction_log[_0x7e29('0x20')](_0x7e29('0x67'),_0x4c13a6[_0x7e29('0x68')]['id'],_0x4c13a6[_0x7e29('0x68')][_0x7e29('0x35')],_0x4c13a6[_0x7e29('0x68')][_0x7e29('0x69')],_0x21fba0[_0x7e29('0x65')]['id'],_0x4c13a6[_0x7e29('0x55')]?JSON['stringify'](_0x4c13a6[_0x7e29('0x55')]):_0x7e29('0x6a'));return respondWithRpcPromise(_0x7e29('0x6b'),_0x7e29('0x6c'),_0x21fba0);}return null;})['then'](function(_0x20bdac){if(_0x20bdac){if(_0x4c13a6[_0x7e29('0x55')][_0x7e29('0x6d')]){_0x21fba0[_0x7e29('0x27')][_0x7e29('0x6e')]=util[_0x7e29('0x64')](_0x7e29('0x6f'),_0x4c13a6[_0x7e29('0x68')][_0x7e29('0x35')]);_0x21fba0['message'][_0x7e29('0x70')]=_0x21fba0['channel'];_0x21fba0[_0x7e29('0x27')][_0x7e29('0x71')]=_0x7e29('0x59');return respondWithRpcPromise(_0x7e29('0x72'),_0x7e29('0x72'),{'event':_0x7e29('0x73'),'message':_0x21fba0[_0x7e29('0x27')]},client9002)[_0x7e29('0x1f')](function(){return _0x21fba0;});}return _0x21fba0;}return null;})[_0x7e29('0x1f')](respondWithResult(_0x589ea7,null))[_0x7e29('0x50')](handleError(_0x589ea7,null));};var interaction_log=require(_0x7e29('0x10'))(_0x7e29('0x58'));exports[_0x7e29('0x31')]=function(_0x5e7846,_0x2cb458,_0x1fa315){var _0xb7148c={'agent':{},'channel':_0x7e29('0x5a')};if(_0x5e7846[_0x7e29('0x55')]['id']){delete _0x5e7846[_0x7e29('0x55')]['id'];}_0x5e7846['body'][_0x7e29('0x61')]=_0x5e7846['body'][_0x7e29('0x61')]||_0x5e7846['user']['id'];_0xb7148c[_0x7e29('0x74')]['id']=_0x5e7846[_0x7e29('0x55')][_0x7e29('0x61')];return db[_0x7e29('0x39')][_0x7e29('0x53')]({'where':{'id':_0x5e7846[_0x7e29('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2cb458,null))[_0x7e29('0x1f')](function(_0x267aed){if(_0x267aed){_0xb7148c[_0x7e29('0x27')]=_0x267aed['get']({'plain':!![]});return db[_0x7e29('0x5f')][_0x7e29('0x53')]({'where':{'id':_0x267aed['WhatsappInteractionId']}});}return null;})[_0x7e29('0x1f')](handleEntityNotFound(_0x2cb458,null))[_0x7e29('0x1f')](function(_0x3dcaa2){if(_0x3dcaa2){_0xb7148c[_0x7e29('0x65')]=_0x3dcaa2[_0x7e29('0x66')]({'plain':!![]});interaction_log[_0x7e29('0x20')](_0x7e29('0x75'),_0x5e7846[_0x7e29('0x68')]['id'],_0x5e7846[_0x7e29('0x68')]['name'],_0x5e7846['user'][_0x7e29('0x69')],_0xb7148c[_0x7e29('0x65')]['id'],_0x5e7846['body']?JSON[_0x7e29('0x24')](_0x5e7846[_0x7e29('0x55')]):_0x7e29('0x6a'));return respondWithRpcPromise('RejectMessage',_0x7e29('0x76'),_0xb7148c);}return null;})[_0x7e29('0x1f')](function(_0x2f4aee){if(_0x2f4aee){_0x2f4aee[_0x7e29('0x27')][_0x7e29('0x6e')]=util[_0x7e29('0x64')](_0x7e29('0x6f'),_0x5e7846[_0x7e29('0x68')][_0x7e29('0x35')]);_0x2f4aee[_0x7e29('0x27')][_0x7e29('0x70')]=_0xb7148c[_0x7e29('0x70')];_0x2f4aee[_0x7e29('0x27')][_0x7e29('0x71')]=_0x7e29('0x31');respondWithRpcPromise(_0x7e29('0x72'),'EventManager',{'event':_0x7e29('0x77'),'message':_0x2f4aee[_0x7e29('0x27')]},client9002);return _0xb7148c;}return null;})['then'](respondWithResult(_0x2cb458,null))[_0x7e29('0x50')](handleError(_0x2cb458,null));};exports[_0x7e29('0x29')]=function(_0x1bc6b9,_0x5e9422,_0x2db76d){if(_0x1bc6b9[_0x7e29('0x55')]['id']){delete _0x1bc6b9[_0x7e29('0x55')]['id'];}var _0x16df24;return db[_0x7e29('0x39')]['find']({'where':{'id':_0x1bc6b9['params']['id']}})[_0x7e29('0x1f')](handleEntityNotFound(_0x5e9422,null))[_0x7e29('0x1f')](function(_0x43c1eb){if(_0x43c1eb){_0x16df24=_0x43c1eb;return db[_0x7e29('0x78')]['find']({'where':{'id':_0x43c1eb['WhatsappAccountId']}});}})[_0x7e29('0x1f')](handleEntityNotFound(_0x5e9422,null))['then'](function(_0x3e3b3d){if(_0x3e3b3d){logger[_0x7e29('0x79')](_0x7e29('0x7a'),_0x7e29('0x29'),_0x7e29('0x7b'),_0x3e3b3d[_0x7e29('0x3b')],util[_0x7e29('0x7c')](_0x1bc6b9[_0x7e29('0x55')],{'showHidden':![],'depth':null}));switch(_0x3e3b3d['type']){case'twilio':if(_0x1bc6b9['body'][_0x7e29('0x7d')]&&_0x1bc6b9[_0x7e29('0x55')][_0x7e29('0x7d')]===_0x16df24[_0x7e29('0x7e')]&&_0x1bc6b9['body']['MessageStatus']&&_0x1bc6b9[_0x7e29('0x55')][_0x7e29('0x7f')]==='read'){return _0x16df24[_0x7e29('0x56')]({'read':!![]});}else{logger['error'](_0x7e29('0x80'),_0x7e29('0x29'),'twilio',util[_0x7e29('0x7c')](_0x1bc6b9[_0x7e29('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x16df24;}})[_0x7e29('0x1f')](respondWithResult(_0x5e9422,null))['catch'](handleError(_0x5e9422,null));}; \ No newline at end of file +var _0xf3a1=['fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','WhatsappInteractionId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp','agent','WhatsappInteraction','stringify','rejectMessage','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','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','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','WhatsappMessage,\x20%s,\x20%s','message','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','end','stack','name','index','rawAttributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf3a1,0xcd));var _0x1f3a=function(_0x11a647,_0x2368d6){_0x11a647=_0x11a647-0x0;var _0x56698b=_0xf3a1[_0x11a647];return _0x56698b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1f3a('0x0'));var rimraf=require(_0x1f3a('0x1'));var zipdir=require(_0x1f3a('0x2'));var jsonpatch=require(_0x1f3a('0x3'));var rp=require(_0x1f3a('0x4'));var moment=require(_0x1f3a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f3a('0x6'));var path=require(_0x1f3a('0x7'));var sox=require(_0x1f3a('0x8'));var csv=require(_0x1f3a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1f3a('0xa'));var squel=require('squel');var crypto=require(_0x1f3a('0xb'));var jsforce=require(_0x1f3a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1f3a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f3a('0xd'));var authService=require(_0x1f3a('0xe'));var qs=require(_0x1f3a('0xf'));var as=require(_0x1f3a('0x10'));var hardwareService=require(_0x1f3a('0x11'));var logger=require(_0x1f3a('0x12'))(_0x1f3a('0x13'));var utils=require(_0x1f3a('0x14'));var config=require(_0x1f3a('0x15'));var db=require(_0x1f3a('0x16'))['db'];config[_0x1f3a('0x17')]=_[_0x1f3a('0x18')](config[_0x1f3a('0x17')],{'host':_0x1f3a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f3a('0x17')]));require(_0x1f3a('0x1a'))[_0x1f3a('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1f3a('0x1c')][_0x1f3a('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x1f3a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x395430,_0x46ce44,_0x3ef2a9){if(_0x3ef2a9){var _0x3c7024=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c7024[_0x1f3a('0x1e')](_0x46ce44)){return _0x395430;}else{throw new db[(_0x1f3a('0x1f'))][(_0x1f3a('0x20'))](_0x1f3a('0x21'));}}else{return _0x395430;}}function respondWithRpcPromise(_0x436dfe,_0x334538,_0x6873c0,_0x49eb70){return new BPromise(function(_0x3dbd7d,_0x2548b7){var _0x1b98db=_0x49eb70||client;return _0x1b98db['request'](_0x436dfe,_0x6873c0)[_0x1f3a('0x22')](function(_0x3a8919){logger[_0x1f3a('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x334538,_0x1f3a('0x24'));logger['debug'](_0x1f3a('0x25'),_0x334538,_0x1f3a('0x24'),JSON['stringify'](_0x3a8919));if(_0x3a8919[_0x1f3a('0x26')]){if(_0x3a8919[_0x1f3a('0x26')]['code']===0x1f4){logger[_0x1f3a('0x26')](_0x1f3a('0x27'),_0x334538,_0x3a8919[_0x1f3a('0x26')][_0x1f3a('0x28')]);return _0x2548b7(_0x3a8919['error'][_0x1f3a('0x28')]);}logger[_0x1f3a('0x26')](_0x1f3a('0x27'),_0x334538,_0x3a8919['error']['message']);return _0x3dbd7d(_0x3a8919['error']['message']);}else{logger[_0x1f3a('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x334538,_0x1f3a('0x24'));_0x3dbd7d(_0x3a8919['result'][_0x1f3a('0x28')]);}})['catch'](function(_0x339d95){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x334538,_0x339d95);_0x2548b7(_0x339d95);});});}function respondWithStatusCode(_0x304c35,_0x2b3ef3){_0x2b3ef3=_0x2b3ef3||0xcc;return function(_0x30b460){if(_0x30b460){return _0x304c35[_0x1f3a('0x29')](_0x2b3ef3);}return _0x304c35[_0x1f3a('0x2a')](_0x2b3ef3)['end']();};}function respondWithResult(_0x14b783,_0x45dd3e){_0x45dd3e=_0x45dd3e||0xc8;return function(_0x5cdf0a){if(_0x5cdf0a){return _0x14b783[_0x1f3a('0x2a')](_0x45dd3e)[_0x1f3a('0x2b')](_0x5cdf0a);}};}function respondWithFilteredResult(_0x21f75d,_0x2fcc2b){return function(_0x1991ba){if(_0x1991ba){var _0xa85625=_0x1991ba[_0x1f3a('0x2c')],_0x4090e0=_0x2fcc2b[_0x1f3a('0x2d')],_0x5c3c2e=_0x2fcc2b['offset']+_0x2fcc2b[_0x1f3a('0x2e')],_0x2a8206;if(_0x5c3c2e>=_0xa85625){_0x5c3c2e=_0xa85625;_0x2a8206=0xc8;}else{_0x2a8206=0xce;}_0x21f75d[_0x1f3a('0x2a')](_0x2a8206);return _0x21f75d[_0x1f3a('0x2f')](_0x1f3a('0x30'),_0x4090e0+'-'+_0x5c3c2e+'/'+_0xa85625)[_0x1f3a('0x2b')](_0x1991ba);}return null;};}function patchUpdates(_0x16f05a){return function(_0x51f35e){try{jsonpatch['apply'](_0x51f35e,_0x16f05a,!![]);}catch(_0x3aad38){return BPromise[_0x1f3a('0x31')](_0x3aad38);}return _0x51f35e[_0x1f3a('0x32')]();};}function saveUpdates(_0x55b7a8,_0x35f638){return function(_0x2ba0c6){if(_0x2ba0c6){return _0x2ba0c6[_0x1f3a('0x33')](_0x55b7a8)['then'](function(_0x3b075e){return _0x3b075e;});}return null;};}function removeEntity(_0x55e697,_0x19a4cf){return function(_0x343732){if(_0x343732){return _0x343732['destroy']()[_0x1f3a('0x22')](function(){_0x55e697[_0x1f3a('0x2a')](0xcc)[_0x1f3a('0x34')]();});}};}function handleEntityNotFound(_0x4fbe5d,_0x391890){return function(_0x52b8cc){if(!_0x52b8cc){_0x4fbe5d[_0x1f3a('0x29')](0x194);}return _0x52b8cc;};}function handleError(_0x26c159,_0x10df54){_0x10df54=_0x10df54||0x1f4;return function(_0x1b8623){logger[_0x1f3a('0x26')](_0x1b8623[_0x1f3a('0x35')]);if(_0x1b8623[_0x1f3a('0x36')]){delete _0x1b8623[_0x1f3a('0x36')];}_0x26c159[_0x1f3a('0x2a')](_0x10df54)['send'](_0x1b8623);};}exports[_0x1f3a('0x37')]=function(_0xd5dbf,_0x2de68f){var _0x5e589d={},_0x752030={},_0xa37e86={'count':0x0,'rows':[]};var _0xdbdc85=_['map'](db['WhatsappMessage'][_0x1f3a('0x38')],function(_0x28468f){return{'name':_0x28468f[_0x1f3a('0x39')],'type':_0x28468f['type'][_0x1f3a('0x3a')]};});_0x752030['model']=_[_0x1f3a('0x3b')](_0xdbdc85,_0x1f3a('0x36'));_0x752030[_0x1f3a('0x3c')]=_[_0x1f3a('0x3d')](_0xd5dbf[_0x1f3a('0x3c')]);_0x752030[_0x1f3a('0x3e')]=_[_0x1f3a('0x3f')](_0x752030[_0x1f3a('0x40')],_0x752030[_0x1f3a('0x3c')]);_0x5e589d['attributes']=_[_0x1f3a('0x3f')](_0x752030[_0x1f3a('0x40')],qs[_0x1f3a('0x41')](_0xd5dbf[_0x1f3a('0x3c')]['fields']));_0x5e589d[_0x1f3a('0x42')]=_0x5e589d[_0x1f3a('0x42')][_0x1f3a('0x43')]?_0x5e589d[_0x1f3a('0x42')]:_0x752030[_0x1f3a('0x40')];if(!_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x44')](_0x1f3a('0x45'))){_0x5e589d[_0x1f3a('0x2e')]=qs[_0x1f3a('0x2e')](_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x2e')]);_0x5e589d[_0x1f3a('0x2d')]=qs[_0x1f3a('0x2d')](_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x2d')]);}_0x5e589d['order']=qs[_0x1f3a('0x46')](_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x46')]);_0x5e589d['where']=qs[_0x1f3a('0x3e')](_[_0x1f3a('0x47')](_0xd5dbf['query'],_0x752030[_0x1f3a('0x3e')]),_0xdbdc85);if(_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x48')]){_0x5e589d[_0x1f3a('0x49')]=_[_0x1f3a('0x4a')](_0x5e589d['where'],{'$or':_[_0x1f3a('0x3b')](_0xdbdc85,function(_0x415478){if(_0x415478[_0x1f3a('0x4b')]!==_0x1f3a('0x4c')){var _0x14319b={};_0x14319b[_0x415478[_0x1f3a('0x36')]]={'$like':'%'+_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x48')]+'%'};return _0x14319b;}})});}_0x5e589d=_[_0x1f3a('0x4a')]({},_0x5e589d,_0xd5dbf[_0x1f3a('0x4d')]);var _0x123718={'where':_0x5e589d[_0x1f3a('0x49')]};return db[_0x1f3a('0x4e')][_0x1f3a('0x2c')](_0x123718)['then'](function(_0x1d4d2e){_0xa37e86[_0x1f3a('0x2c')]=_0x1d4d2e;if(_0xd5dbf[_0x1f3a('0x3c')][_0x1f3a('0x4f')]){_0x5e589d[_0x1f3a('0x50')]=[{'all':!![]}];}return db[_0x1f3a('0x4e')][_0x1f3a('0x51')](_0x5e589d);})[_0x1f3a('0x22')](function(_0x2a0a00){_0xa37e86[_0x1f3a('0x52')]=_0x2a0a00;return _0xa37e86;})[_0x1f3a('0x22')](respondWithFilteredResult(_0x2de68f,_0x5e589d))[_0x1f3a('0x53')](handleError(_0x2de68f,null));};exports[_0x1f3a('0x54')]=function(_0x3e7b3d,_0x51ee4a){var _0x2c14f2={'raw':!![],'where':{'id':_0x3e7b3d[_0x1f3a('0x55')]['id']}},_0x2f406e={};_0x2f406e[_0x1f3a('0x40')]=_[_0x1f3a('0x3d')](db['WhatsappMessage']['rawAttributes']);_0x2f406e[_0x1f3a('0x3c')]=_[_0x1f3a('0x3d')](_0x3e7b3d[_0x1f3a('0x3c')]);_0x2f406e[_0x1f3a('0x3e')]=_[_0x1f3a('0x3f')](_0x2f406e[_0x1f3a('0x40')],_0x2f406e['query']);_0x2c14f2['attributes']=_[_0x1f3a('0x3f')](_0x2f406e[_0x1f3a('0x40')],qs[_0x1f3a('0x41')](_0x3e7b3d['query'][_0x1f3a('0x41')]));_0x2c14f2[_0x1f3a('0x42')]=_0x2c14f2[_0x1f3a('0x42')][_0x1f3a('0x43')]?_0x2c14f2['attributes']:_0x2f406e['model'];if(_0x3e7b3d[_0x1f3a('0x3c')][_0x1f3a('0x4f')]){_0x2c14f2[_0x1f3a('0x50')]=[{'all':!![]}];}_0x2c14f2=_[_0x1f3a('0x4a')]({},_0x2c14f2,_0x3e7b3d[_0x1f3a('0x4d')]);return db[_0x1f3a('0x4e')]['find'](_0x2c14f2)[_0x1f3a('0x22')](handleEntityNotFound(_0x51ee4a,null))[_0x1f3a('0x22')](respondWithResult(_0x51ee4a,null))[_0x1f3a('0x53')](handleError(_0x51ee4a,null));};exports[_0x1f3a('0x56')]=function(_0x499826,_0x5ce20e){return db[_0x1f3a('0x4e')][_0x1f3a('0x56')](_0x499826['body'],{})[_0x1f3a('0x22')](respondWithResult(_0x5ce20e,0xc9))[_0x1f3a('0x53')](handleError(_0x5ce20e,null));};exports[_0x1f3a('0x33')]=function(_0x1e2298,_0x248a6c){if(_0x1e2298[_0x1f3a('0x57')]['id']){delete _0x1e2298['body']['id'];}return db[_0x1f3a('0x4e')][_0x1f3a('0x58')]({'where':{'id':_0x1e2298[_0x1f3a('0x55')]['id']}})[_0x1f3a('0x22')](handleEntityNotFound(_0x248a6c,null))['then'](saveUpdates(_0x1e2298[_0x1f3a('0x57')],null))[_0x1f3a('0x22')](respondWithResult(_0x248a6c,null))[_0x1f3a('0x53')](handleError(_0x248a6c,null));};exports[_0x1f3a('0x59')]=function(_0x7adb43,_0x13873d){return db['WhatsappMessage'][_0x1f3a('0x58')]({'where':{'id':_0x7adb43['params']['id']}})[_0x1f3a('0x22')](handleEntityNotFound(_0x13873d,null))['then'](removeEntity(_0x13873d,null))[_0x1f3a('0x53')](handleError(_0x13873d,null));};exports[_0x1f3a('0x5a')]=function(_0x70d51,_0x3036b6){return db[_0x1f3a('0x4e')][_0x1f3a('0x5a')]()[_0x1f3a('0x22')](respondWithResult(_0x3036b6,null))['catch'](handleError(_0x3036b6,null));};var interaction_log=require(_0x1f3a('0x12'))('whatsapp-interactions');exports[_0x1f3a('0x5b')]=function(_0x41b1ce,_0x18e758,_0x6e2881){var _0x30141f={'channel':'whatsapp'};if(_0x41b1ce['body']['id']){delete _0x41b1ce[_0x1f3a('0x57')]['id'];}_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x5c')]=!![];_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x5d')]=moment()['format'](_0x1f3a('0x5e'));_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x5f')]=_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x5f')]||_0x41b1ce[_0x1f3a('0x60')]['id'];return db[_0x1f3a('0x4e')][_0x1f3a('0x58')]({'where':{'id':_0x41b1ce['params']['id'],'UserId':null},'include':[{'model':db[_0x1f3a('0x61')],'as':'Contact'}]})[_0x1f3a('0x22')](handleEntityNotFound(_0x18e758,null))['then'](saveUpdates(_0x41b1ce['body'],null))[_0x1f3a('0x22')](function(_0x1c02d6){if(_0x1c02d6){_0x30141f[_0x1f3a('0x28')]=_0x1c02d6[_0x1f3a('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x1f3a('0x58')]({'where':{'id':_0x1c02d6[_0x1f3a('0x63')]}});}return null;})[_0x1f3a('0x22')](handleEntityNotFound(_0x18e758,null))['then'](function(_0x927787){if(_0x927787){return _0x927787[_0x1f3a('0x33')]({'UserId':_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x5f')],'read1stAt':_[_0x1f3a('0x64')](_0x927787[_0x1f3a('0x65')])?moment()[_0x1f3a('0x66')](_0x1f3a('0x5e')):undefined});}return null;})[_0x1f3a('0x22')](function(_0x81775d){if(_0x81775d){_0x30141f['interaction']=_0x81775d[_0x1f3a('0x62')]({'plain':!![]});interaction_log[_0x1f3a('0x23')](_0x1f3a('0x67'),_0x41b1ce['user']['id'],_0x41b1ce[_0x1f3a('0x60')][_0x1f3a('0x36')],_0x41b1ce[_0x1f3a('0x60')][_0x1f3a('0x68')],_0x30141f['interaction']['id'],_0x41b1ce[_0x1f3a('0x57')]?JSON['stringify'](_0x41b1ce[_0x1f3a('0x57')]):_0x1f3a('0x69'));return respondWithRpcPromise(_0x1f3a('0x6a'),_0x1f3a('0x6b'),_0x30141f);}return null;})[_0x1f3a('0x22')](function(_0x3d4669){if(_0x3d4669){if(_0x41b1ce[_0x1f3a('0x57')][_0x1f3a('0x6c')]){_0x30141f[_0x1f3a('0x28')][_0x1f3a('0x6d')]=util[_0x1f3a('0x66')](_0x1f3a('0x6e'),_0x41b1ce[_0x1f3a('0x60')][_0x1f3a('0x36')]);_0x30141f['message'][_0x1f3a('0x6f')]=_0x30141f[_0x1f3a('0x6f')];_0x30141f[_0x1f3a('0x28')][_0x1f3a('0x70')]=_0x1f3a('0x5b');return respondWithRpcPromise(_0x1f3a('0x71'),_0x1f3a('0x71'),{'event':_0x1f3a('0x72'),'message':_0x30141f[_0x1f3a('0x28')]},client9002)[_0x1f3a('0x22')](function(){return _0x30141f;});}return _0x30141f;}return null;})[_0x1f3a('0x22')](respondWithResult(_0x18e758,null))[_0x1f3a('0x53')](handleError(_0x18e758,null));};var interaction_log=require(_0x1f3a('0x12'))('whatsapp-interactions');exports['reject']=function(_0x491e37,_0x42dd09,_0x26affe){var _0x40f509={'agent':{},'channel':_0x1f3a('0x73')};if(_0x491e37[_0x1f3a('0x57')]['id']){delete _0x491e37['body']['id'];}_0x491e37[_0x1f3a('0x57')][_0x1f3a('0x5f')]=_0x491e37['body'][_0x1f3a('0x5f')]||_0x491e37['user']['id'];_0x40f509[_0x1f3a('0x74')]['id']=_0x491e37['body'][_0x1f3a('0x5f')];return db[_0x1f3a('0x4e')][_0x1f3a('0x58')]({'where':{'id':_0x491e37[_0x1f3a('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x42dd09,null))['then'](function(_0x123ab8){if(_0x123ab8){_0x40f509['message']=_0x123ab8[_0x1f3a('0x62')]({'plain':!![]});return db[_0x1f3a('0x75')][_0x1f3a('0x58')]({'where':{'id':_0x123ab8[_0x1f3a('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x42dd09,null))[_0x1f3a('0x22')](function(_0x14bdff){if(_0x14bdff){_0x40f509['interaction']=_0x14bdff[_0x1f3a('0x62')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x491e37['user']['id'],_0x491e37[_0x1f3a('0x60')]['name'],_0x491e37[_0x1f3a('0x60')][_0x1f3a('0x68')],_0x40f509['interaction']['id'],_0x491e37[_0x1f3a('0x57')]?JSON[_0x1f3a('0x76')](_0x491e37[_0x1f3a('0x57')]):'null');return respondWithRpcPromise('RejectMessage',_0x1f3a('0x77'),_0x40f509);}return null;})[_0x1f3a('0x22')](function(_0x823d2c){if(_0x823d2c){_0x823d2c['message'][_0x1f3a('0x6d')]=util['format']('SIP/%s',_0x491e37['user'][_0x1f3a('0x36')]);_0x823d2c[_0x1f3a('0x28')][_0x1f3a('0x6f')]=_0x40f509[_0x1f3a('0x6f')];_0x823d2c['message'][_0x1f3a('0x70')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x1f3a('0x78'),'message':_0x823d2c[_0x1f3a('0x28')]},client9002);return _0x40f509;}return null;})['then'](respondWithResult(_0x42dd09,null))['catch'](handleError(_0x42dd09,null));};exports['status']=function(_0x3f6a09,_0x540223,_0x33990b){if(_0x3f6a09[_0x1f3a('0x57')]['id']){delete _0x3f6a09['body']['id'];}var _0x471292;return db[_0x1f3a('0x4e')][_0x1f3a('0x58')]({'where':{'id':_0x3f6a09['params']['id']}})[_0x1f3a('0x22')](handleEntityNotFound(_0x540223,null))[_0x1f3a('0x22')](function(_0x460b1b){if(_0x460b1b){_0x471292=_0x460b1b;return db[_0x1f3a('0x79')]['find']({'where':{'id':_0x460b1b[_0x1f3a('0x7a')]}});}})[_0x1f3a('0x22')](handleEntityNotFound(_0x540223,null))[_0x1f3a('0x22')](function(_0x1074e9){if(_0x1074e9){logger[_0x1f3a('0x7b')](_0x1f3a('0x7c'),_0x1f3a('0x2a'),'received\x20delivery\x20report\x20from',_0x1074e9['type'],util['inspect'](_0x3f6a09[_0x1f3a('0x57')],{'showHidden':![],'depth':null}));switch(_0x1074e9[_0x1f3a('0x4b')]){case _0x1f3a('0x7d'):if(_0x3f6a09[_0x1f3a('0x57')][_0x1f3a('0x7e')]&&_0x3f6a09[_0x1f3a('0x57')][_0x1f3a('0x7e')]===_0x471292[_0x1f3a('0x7f')]&&_0x3f6a09[_0x1f3a('0x57')][_0x1f3a('0x80')]&&_0x3f6a09[_0x1f3a('0x57')][_0x1f3a('0x80')]===_0x1f3a('0x5c')){return _0x471292[_0x1f3a('0x33')]({'read':!![]});}else{logger['error'](_0x1f3a('0x81'),_0x1f3a('0x2a'),'twilio',util[_0x1f3a('0x82')](_0x3f6a09[_0x1f3a('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x471292;}})[_0x1f3a('0x22')](respondWithResult(_0x540223,null))[_0x1f3a('0x53')](handleError(_0x540223,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6945e6f..e8f94b3 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x542197,_0x40f3db){var _0x451ac0=function(_0x45ade1){while(--_0x45ade1){_0x542197['push'](_0x542197['shift']());}};_0x451ac0(++_0x40f3db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2d52aa,_0x4179e9){_0x2d52aa=_0x2d52aa-0x0;var _0xde20c5=_0x5f2f[_0x2d52aa];return _0xde20c5;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x54e41c,_0x363e37){var _0x29070d=function(_0x43ab32){while(--_0x43ab32){_0x54e41c['push'](_0x54e41c['shift']());}};_0x29070d(++_0x363e37);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37f330,_0x30ef70){_0x37f330=_0x37f330-0x0;var _0x4fab68=_0x5f2f[_0x37f330];return _0x4fab68;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 2f49d9b..6c083b4 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x37e1=['./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','models','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','catch','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4bd91d,_0x287e43){var _0x1c26fa=function(_0x41a206){while(--_0x41a206){_0x4bd91d['push'](_0x4bd91d['shift']());}};_0x1c26fa(++_0x287e43);}(_0x37e1,0x18e));var _0x137e=function(_0x4a69de,_0x4bd791){_0x4a69de=_0x4a69de-0x0;var _0x17eb79=_0x37e1[_0x4a69de];return _0x17eb79;};'use strict';var _=require('lodash');var util=require(_0x137e('0x0'));var logger=require(_0x137e('0x1'))('api');var moment=require(_0x137e('0x2'));var BPromise=require(_0x137e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x137e('0x4'));var rimraf=require(_0x137e('0x5'));var config=require(_0x137e('0x6'));var attributes=require(_0x137e('0x7'));module['exports']=function(_0x672b8c,_0x5443b8){return _0x672b8c[_0x137e('0x8')](_0x137e('0x9'),attributes,{'tableName':_0x137e('0xa'),'paranoid':![],'indexes':[{'name':_0x137e('0xb'),'fields':[_0x137e('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x137e('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x543e29,_0x19562a,_0x5db909){var _0xaee03f=_0x672b8c[_0x137e('0xd')];var _0x157802=_0x543e29['get']({'plain':!![]});if(_0x157802[_0x137e('0xe')][_0x137e('0xf')]()==='in'||_0x157802[_0x137e('0xe')][_0x137e('0xf')]()==='out'&&!_0x157802[_0x137e('0x10')]&&!_[_0x137e('0x11')](_0x157802[_0x137e('0x12')])){_0xaee03f[_0x137e('0x13')][_0x137e('0x14')]({'where':{'id':_0x157802[_0x137e('0x15')]}})['then'](function(_0x2aaac4){if(_0x2aaac4){_0x2aaac4[_0x137e('0x16')]({'lastMsgAt':_0x157802['createdAt'],'lastMsgDirection':_0x157802['direction']['toLowerCase']()});}})[_0x137e('0x17')](function(_0x8c3d16){console[_0x137e('0x18')](_0x8c3d16);});}if(_0x157802['direction']===_0x137e('0x19')&&!_0x157802[_0x137e('0x10')]){var _0x28515e;_0xaee03f[_0x137e('0x1a')][_0x137e('0x1b')]({'where':{'id':_0x157802['WhatsappAccountId']},'raw':!![]})['then'](function(_0x1ff61a){_0x28515e=_0x1ff61a;if(_0x28515e&&_0x28515e[_0x137e('0x1c')]){switch(_0x28515e[_0x137e('0x1c')]){case _0x137e('0x1d'):var _0x210553=require(_0x137e('0x1d'));if(_0x28515e[_0x137e('0x1e')]&&_0x28515e[_0x137e('0x1f')]&&_0x28515e['phone']){var _0x5c649d=new _0x210553(_0x28515e[_0x137e('0x1e')],_0x28515e[_0x137e('0x1f')]);_0x5c649d['messages'][_0x137e('0x20')]({'body':_0x157802['body'],'to':_0x137e('0x21')+_0x157802['phone'],'from':_0x137e('0x21')+_0x28515e['phone'],'statusCallback':_0x28515e[_0x137e('0x22')]+_0x137e('0x23')+_0x157802['id']+_0x137e('0x24')+_0x28515e[_0x137e('0x25')]})[_0x137e('0x26')](function(_0x1dc1a9){if(_0x1dc1a9[_0x137e('0x27')]){return _0x543e29[_0x137e('0x16')]({'messageId':_0x1dc1a9['sid']});}})[_0x137e('0x17')](function(_0x51356b){logger[_0x137e('0x18')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x137e('0x28'),_0x137e('0x1d'),util[_0x137e('0x29')](_0x51356b,{'showHidden':![],'depth':null}));});}else{logger[_0x137e('0x18')](_0x137e('0x2a'),_0x137e('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x5db909();});}else{_0x5db909();}}},'charset':_0x137e('0x2b'),'collate':_0x137e('0x2c')});}; \ No newline at end of file +var _0xeb35=['whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteractionId','update','createdAt','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','body'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xeb35,0x183));var _0x5eb3=function(_0x542162,_0x4a0759){_0x542162=_0x542162-0x0;var _0x7a75a9=_0xeb35[_0x542162];return _0x7a75a9;};'use strict';var _=require(_0x5eb3('0x0'));var util=require(_0x5eb3('0x1'));var logger=require(_0x5eb3('0x2'))(_0x5eb3('0x3'));var moment=require(_0x5eb3('0x4'));var BPromise=require('bluebird');var rp=require(_0x5eb3('0x5'));var fs=require('fs');var path=require(_0x5eb3('0x6'));var rimraf=require(_0x5eb3('0x7'));var config=require(_0x5eb3('0x8'));var attributes=require(_0x5eb3('0x9'));module['exports']=function(_0x31dee0,_0x1bd050){return _0x31dee0[_0x5eb3('0xa')]('WhatsappMessage',attributes,{'tableName':_0x5eb3('0xb'),'paranoid':![],'indexes':[{'name':_0x5eb3('0xc'),'fields':[_0x5eb3('0xc')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x5eb3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x183a31,_0xcdd1ba,_0x527048){var _0x12ceff=_0x31dee0[_0x5eb3('0xe')];var _0xc6e13e=_0x183a31['get']({'plain':!![]});if(_0xc6e13e[_0x5eb3('0xf')][_0x5eb3('0x10')]()==='in'||_0xc6e13e[_0x5eb3('0xf')][_0x5eb3('0x10')]()===_0x5eb3('0x11')&&!_0xc6e13e['secret']&&!_[_0x5eb3('0x12')](_0xc6e13e[_0x5eb3('0x13')])){_0x12ceff['WhatsappInteraction']['findOne']({'where':{'id':_0xc6e13e[_0x5eb3('0x14')]}})['then'](function(_0x31d0bc){if(_0x31d0bc){_0x31d0bc[_0x5eb3('0x15')]({'lastMsgAt':_0xc6e13e[_0x5eb3('0x16')],'lastMsgDirection':_0xc6e13e['direction'][_0x5eb3('0x10')]()});}})['catch'](function(_0x4a72be){console[_0x5eb3('0x17')](_0x4a72be);});}if(_0xc6e13e[_0x5eb3('0xf')]===_0x5eb3('0x11')&&!_0xc6e13e[_0x5eb3('0x18')]){var _0x4843ec;_0x12ceff[_0x5eb3('0x19')][_0x5eb3('0x1a')]({'where':{'id':_0xc6e13e[_0x5eb3('0x1b')]},'raw':!![]})[_0x5eb3('0x1c')](function(_0x3f9d9c){_0x4843ec=_0x3f9d9c;if(_0x4843ec&&_0x4843ec[_0x5eb3('0x1d')]){switch(_0x4843ec[_0x5eb3('0x1d')]){case _0x5eb3('0x1e'):var _0x34c928=require(_0x5eb3('0x1e'));if(_0x4843ec[_0x5eb3('0x1f')]&&_0x4843ec[_0x5eb3('0x20')]&&_0x4843ec[_0x5eb3('0x21')]){var _0x34ee15=new _0x34c928(_0x4843ec[_0x5eb3('0x1f')],_0x4843ec[_0x5eb3('0x20')]);_0x34ee15['messages'][_0x5eb3('0x22')]({'body':_0xc6e13e[_0x5eb3('0x23')],'to':_0x5eb3('0x24')+_0xc6e13e[_0x5eb3('0x21')],'from':_0x5eb3('0x24')+_0x4843ec['phone'],'statusCallback':_0x4843ec[_0x5eb3('0x25')]+_0x5eb3('0x26')+_0xc6e13e['id']+_0x5eb3('0x27')+_0x4843ec[_0x5eb3('0x28')]})[_0x5eb3('0x1c')](function(_0x261c70){if(_0x261c70[_0x5eb3('0x29')]){return _0x183a31[_0x5eb3('0x15')]({'messageId':_0x261c70[_0x5eb3('0x29')]});}})[_0x5eb3('0x2a')](function(_0x342d0c){logger['error'](_0x5eb3('0x2b'),'afterCreate',_0x5eb3('0x1e'),util[_0x5eb3('0x2c')](_0x342d0c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x5eb3('0x2b'),'afterCreate','twilio',_0x5eb3('0x2d'));}break;}}})['finally'](function(){_0x527048();});}else{_0x527048();}}},'charset':'utf8mb4','collate':_0x5eb3('0x2e')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 2bf063c..36c0bd2 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a7d=['WhatsappMessage','create','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappMessage'];(function(_0x1c1c81,_0x3bc78a){var _0xb56c33=function(_0x39cec3){while(--_0x39cec3){_0x1c1c81['push'](_0x1c1c81['shift']());}};_0xb56c33(++_0x3bc78a);}(_0x0a7d,0x15a));var _0xd0a7=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x0a7d[_0xa8883];return _0x479426;};'use strict';var _=require('lodash');var util=require(_0xd0a7('0x0'));var moment=require('moment');var BPromise=require(_0xd0a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0a7('0x2'));var db=require(_0xd0a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0a7('0x4'))(_0xd0a7('0x5'));var config=require(_0xd0a7('0x6'));var jayson=require(_0xd0a7('0x7'));var client=jayson['client'][_0xd0a7('0x8')]({'port':0x232a});config[_0xd0a7('0x9')]=_[_0xd0a7('0xa')](config[_0xd0a7('0x9')],{'host':_0xd0a7('0xb'),'port':0x18eb});var socket=require(_0xd0a7('0xc'))(new Redis(config[_0xd0a7('0x9')]));require(_0xd0a7('0xd'))[_0xd0a7('0xe')](socket);function respondWithRpcPromise(_0x4d287f,_0xa171a,_0x234900){return new BPromise(function(_0x210ca6,_0x29ca95){return client['request'](_0x4d287f,_0x234900)[_0xd0a7('0xf')](function(_0x2b8cc7){logger[_0xd0a7('0x10')](_0xd0a7('0x11'),_0xa171a,_0xd0a7('0x12'));logger['debug'](_0xd0a7('0x13'),_0xa171a,_0xd0a7('0x12'),JSON[_0xd0a7('0x14')](_0x2b8cc7));if(_0x2b8cc7[_0xd0a7('0x15')]){if(_0x2b8cc7[_0xd0a7('0x15')][_0xd0a7('0x16')]===0x1f4){logger['error'](_0xd0a7('0x11'),_0xa171a,_0x2b8cc7[_0xd0a7('0x15')][_0xd0a7('0x17')]);return _0x29ca95(_0x2b8cc7[_0xd0a7('0x15')][_0xd0a7('0x17')]);}logger[_0xd0a7('0x15')](_0xd0a7('0x11'),_0xa171a,_0x2b8cc7[_0xd0a7('0x15')]['message']);return _0x210ca6(_0x2b8cc7['error']['message']);}else{logger['info'](_0xd0a7('0x11'),_0xa171a,_0xd0a7('0x12'));_0x210ca6(_0x2b8cc7[_0xd0a7('0x18')]['message']);}})['catch'](function(_0x2cf828){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xa171a,_0x2cf828);_0x29ca95(_0x2cf828);});});}exports[_0xd0a7('0x19')]=function(_0x382a9b){var _0x19e380=this;return new Promise(function(_0x5a3d65,_0x34f923){return db[_0xd0a7('0x1a')][_0xd0a7('0x1b')](_0x382a9b[_0xd0a7('0x1c')],{'raw':_0x382a9b[_0xd0a7('0x1d')]?_0x382a9b[_0xd0a7('0x1d')][_0xd0a7('0x1e')]===undefined?!![]:![]:!![]})[_0xd0a7('0xf')](function(_0x2ebce3){logger[_0xd0a7('0x10')]('CreateWhatsappMessage',_0x382a9b);logger['debug'](_0xd0a7('0x19'),_0x382a9b,JSON[_0xd0a7('0x14')](_0x2ebce3));_0x5a3d65(_0x2ebce3);})['catch'](function(_0x49085b){logger['error'](_0xd0a7('0x19'),_0x49085b[_0xd0a7('0x17')],_0x382a9b);_0x34f923(_0x19e380['error'](0x1f4,_0x49085b[_0xd0a7('0x17')]));});});}; \ No newline at end of file +var _0x0609=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappMessage','body','options','raw','CreateWhatsappMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','then'];(function(_0x346deb,_0x50a6af){var _0x4ba4df=function(_0x2dd7bf){while(--_0x2dd7bf){_0x346deb['push'](_0x346deb['shift']());}};_0x4ba4df(++_0x50a6af);}(_0x0609,0x17b));var _0x9060=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x0609[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x9060('0x0'));var util=require(_0x9060('0x1'));var moment=require('moment');var BPromise=require(_0x9060('0x2'));var rs=require(_0x9060('0x3'));var fs=require('fs');var Redis=require(_0x9060('0x4'));var db=require(_0x9060('0x5'))['db'];var utils=require(_0x9060('0x6'));var logger=require(_0x9060('0x7'))(_0x9060('0x8'));var config=require(_0x9060('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x9060('0xa')]=_[_0x9060('0xb')](config[_0x9060('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x24338c,_0x144fd3,_0x26d79c){return new BPromise(function(_0x85d779,_0x45465c){return client['request'](_0x24338c,_0x26d79c)[_0x9060('0xc')](function(_0x26faf){logger[_0x9060('0xd')](_0x9060('0xe'),_0x144fd3,_0x9060('0xf'));logger[_0x9060('0x10')](_0x9060('0x11'),_0x144fd3,_0x9060('0xf'),JSON[_0x9060('0x12')](_0x26faf));if(_0x26faf[_0x9060('0x13')]){if(_0x26faf[_0x9060('0x13')][_0x9060('0x14')]===0x1f4){logger[_0x9060('0x13')](_0x9060('0xe'),_0x144fd3,_0x26faf[_0x9060('0x13')]['message']);return _0x45465c(_0x26faf[_0x9060('0x13')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x144fd3,_0x26faf[_0x9060('0x13')][_0x9060('0x15')]);return _0x85d779(_0x26faf[_0x9060('0x13')][_0x9060('0x15')]);}else{logger[_0x9060('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x144fd3,_0x9060('0xf'));_0x85d779(_0x26faf['result'][_0x9060('0x15')]);}})[_0x9060('0x16')](function(_0x25c5ab){logger[_0x9060('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x144fd3,_0x25c5ab);_0x45465c(_0x25c5ab);});});}exports['CreateWhatsappMessage']=function(_0x1347ba){var _0x5964b9=this;return new Promise(function(_0x2a90ef,_0x3e2493){return db[_0x9060('0x17')]['create'](_0x1347ba[_0x9060('0x18')],{'raw':_0x1347ba[_0x9060('0x19')]?_0x1347ba['options'][_0x9060('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x12f399){logger['info'](_0x9060('0x1b'),_0x1347ba);logger[_0x9060('0x10')](_0x9060('0x1b'),_0x1347ba,JSON[_0x9060('0x12')](_0x12f399));_0x2a90ef(_0x12f399);})[_0x9060('0x16')](function(_0x30009e){logger[_0x9060('0x13')](_0x9060('0x1b'),_0x30009e['message'],_0x1347ba);_0x3e2493(_0x5964b9[_0x9060('0x13')](0x1f4,_0x30009e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index d9d2c75..309de9e 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f0f=['update','emit','removeListener','register','length','whatsappMessage:','save'];(function(_0x462602,_0x2d7a7e){var _0x13e4e7=function(_0x460f5c){while(--_0x460f5c){_0x462602['push'](_0x462602['shift']());}};_0x13e4e7(++_0x2d7a7e);}(_0x3f0f,0x1a3));var _0xf3f0=function(_0x4bd7f5,_0x2543ac){_0x4bd7f5=_0x4bd7f5-0x0;var _0x309d49=_0x3f0f[_0x4bd7f5];return _0x309d49;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xf3f0('0x0'),'remove',_0xf3f0('0x1')];function createListener(_0x341896,_0x4f308f){return function(_0x2f67ea){_0x4f308f[_0xf3f0('0x2')](_0x341896,_0x2f67ea);};}function removeListener(_0x5d8d59,_0x35b62b){return function(){WhatsappMessageEvents[_0xf3f0('0x3')](_0x5d8d59,_0x35b62b);};}exports[_0xf3f0('0x4')]=function(_0x59c696){for(var _0x5d79e9=0x0,_0x1860ac=events[_0xf3f0('0x5')];_0x5d79e9<_0x1860ac;_0x5d79e9++){var _0x10577e=events[_0x5d79e9];var _0x5a45ae=createListener(_0xf3f0('0x6')+_0x10577e,_0x59c696);WhatsappMessageEvents['on'](_0x10577e,_0x5a45ae);}}; \ No newline at end of file +var _0xa5df=['remove','update','removeListener','register','./whatsappMessage.events','save'];(function(_0x2e3ef8,_0x4b8e7c){var _0x28c273=function(_0x29a40a){while(--_0x29a40a){_0x2e3ef8['push'](_0x2e3ef8['shift']());}};_0x28c273(++_0x4b8e7c);}(_0xa5df,0x190));var _0xfa5d=function(_0x5e3b9e,_0x18b3ba){_0x5e3b9e=_0x5e3b9e-0x0;var _0x4726ff=_0xa5df[_0x5e3b9e];return _0x4726ff;};'use strict';var WhatsappMessageEvents=require(_0xfa5d('0x0'));var events=[_0xfa5d('0x1'),_0xfa5d('0x2'),_0xfa5d('0x3')];function createListener(_0x27ffb3,_0x3f52ac){return function(_0x277c62){_0x3f52ac['emit'](_0x27ffb3,_0x277c62);};}function removeListener(_0x36206a,_0x470b5d){return function(){WhatsappMessageEvents[_0xfa5d('0x4')](_0x36206a,_0x470b5d);};}exports[_0xfa5d('0x5')]=function(_0x331859){for(var _0x1c2214=0x0,_0x286da5=events['length'];_0x1c2214<_0x286da5;_0x1c2214++){var _0x51bbe4=events[_0x1c2214];var _0x3663eb=createListener('whatsappMessage:'+_0x51bbe4,_0x331859);WhatsappMessageEvents['on'](_0x51bbe4,_0x3663eb);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5298ced..2ae4875 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7730=['getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/members','/:id/teams'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x7730,0x175));var _0x0773=function(_0x54f493,_0x385811){_0x54f493=_0x54f493-0x0;var _0x5f2b47=_0x7730[_0x54f493];return _0x5f2b47;};'use strict';var multer=require(_0x0773('0x0'));var util=require(_0x0773('0x1'));var path=require(_0x0773('0x2'));var timeout=require(_0x0773('0x3'));var express=require(_0x0773('0x4'));var router=express[_0x0773('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0773('0x6'));var config=require(_0x0773('0x7'));var controller=require(_0x0773('0x8'));router['get']('/',auth[_0x0773('0x9')](),controller[_0x0773('0xa')]);router['get'](_0x0773('0xb'),auth[_0x0773('0x9')](),controller[_0x0773('0xc')]);router[_0x0773('0xd')](_0x0773('0xe'),auth[_0x0773('0x9')](),controller['show']);router[_0x0773('0xd')](_0x0773('0xf'),auth[_0x0773('0x9')](),controller['getMembers']);router[_0x0773('0xd')](_0x0773('0x10'),auth[_0x0773('0x9')](),controller[_0x0773('0x11')]);router[_0x0773('0xd')](_0x0773('0x12'),auth[_0x0773('0x9')](),controller[_0x0773('0x13')]);router[_0x0773('0x14')]('/',auth[_0x0773('0x9')](),controller['create']);router[_0x0773('0x14')](_0x0773('0x10'),auth[_0x0773('0x9')](),controller[_0x0773('0x15')]);router['post'](_0x0773('0x12'),auth[_0x0773('0x9')](),controller[_0x0773('0x16')]);router[_0x0773('0x17')](_0x0773('0xe'),auth[_0x0773('0x9')](),controller[_0x0773('0x18')]);router[_0x0773('0x19')]('/:id',auth[_0x0773('0x9')](),controller[_0x0773('0x1a')]);router[_0x0773('0x19')](_0x0773('0x10'),auth[_0x0773('0x9')](),controller[_0x0773('0x1b')]);router['delete'](_0x0773('0x12'),auth[_0x0773('0x9')](),controller[_0x0773('0x1c')]);module[_0x0773('0x1d')]=router; \ No newline at end of file +var _0xa806=['delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xa806,0x1f2));var _0x6a80=function(_0x156584,_0x211fde){_0x156584=_0x156584-0x0;var _0x3416b1=_0xa806[_0x156584];return _0x3416b1;};'use strict';var multer=require(_0x6a80('0x0'));var util=require('util');var path=require(_0x6a80('0x1'));var timeout=require(_0x6a80('0x2'));var express=require(_0x6a80('0x3'));var router=express[_0x6a80('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6a80('0x5'));var config=require(_0x6a80('0x6'));var controller=require(_0x6a80('0x7'));router[_0x6a80('0x8')]('/',auth[_0x6a80('0x9')](),controller['index']);router[_0x6a80('0x8')](_0x6a80('0xa'),auth['isAuthenticated'](),controller[_0x6a80('0xb')]);router[_0x6a80('0x8')](_0x6a80('0xc'),auth[_0x6a80('0x9')](),controller[_0x6a80('0xd')]);router[_0x6a80('0x8')](_0x6a80('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x6a80('0x8')](_0x6a80('0xf'),auth[_0x6a80('0x9')](),controller[_0x6a80('0x10')]);router[_0x6a80('0x8')](_0x6a80('0x11'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6a80('0x12')]('/',auth[_0x6a80('0x9')](),controller[_0x6a80('0x13')]);router[_0x6a80('0x12')](_0x6a80('0xf'),auth[_0x6a80('0x9')](),controller['addTeams']);router[_0x6a80('0x12')]('/:id/users',auth[_0x6a80('0x9')](),controller[_0x6a80('0x14')]);router[_0x6a80('0x15')]('/:id',auth[_0x6a80('0x9')](),controller['update']);router[_0x6a80('0x16')](_0x6a80('0xc'),auth['isAuthenticated'](),controller[_0x6a80('0x17')]);router[_0x6a80('0x16')](_0x6a80('0xf'),auth[_0x6a80('0x9')](),controller['removeTeams']);router[_0x6a80('0x16')](_0x6a80('0x11'),auth[_0x6a80('0x9')](),controller[_0x6a80('0x18')]);module[_0x6a80('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 85fd65e..7717936 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde46=['roundrobin','STRING','INTEGER'];(function(_0x156320,_0x3e647b){var _0x33735e=function(_0x199ed6){while(--_0x199ed6){_0x156320['push'](_0x156320['shift']());}};_0x33735e(++_0x3e647b);}(_0xde46,0x6d));var _0x6de4=function(_0x59aea9,_0x3b3af9){_0x59aea9=_0x59aea9-0x0;var _0x75d7e8=_0xde46[_0x59aea9];return _0x75d7e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6de4('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x6de4('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x6de4('0x2'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x64a5=['roundrobin','STRING','exports','name','INTEGER','beepall'];(function(_0x2d3df2,_0x2f9498){var _0x347bda=function(_0x55a196){while(--_0x55a196){_0x2d3df2['push'](_0x2d3df2['shift']());}};_0x347bda(++_0x2f9498);}(_0x64a5,0x80));var _0x564a=function(_0x11fc92,_0x4b1a76){_0x11fc92=_0x11fc92-0x0;var _0xc7373f=_0x64a5[_0x11fc92];return _0xc7373f;};'use strict';var Sequelize=require('sequelize');module[_0x564a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x564a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x564a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x564a('0x3'),_0x564a('0x4'))},'description':{'type':Sequelize[_0x564a('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7776700..7fb9993 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a3=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','UserWhatsappQueue','WhatsappQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','whatsappPause','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','User','select','field','from','team_has_whatsapp_queues','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','status','end','json','count','offset','reject','save','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x56f151,_0x281759){var _0x52c1e3=function(_0x12ba6d){while(--_0x12ba6d){_0x56f151['push'](_0x56f151['shift']());}};_0x52c1e3(++_0x281759);}(_0x73a3,0x14e));var _0x373a=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x73a3[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0x373a('0x0'));var emlformat=require(_0x373a('0x1'));var rimraf=require(_0x373a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x373a('0x3'));var rp=require(_0x373a('0x4'));var moment=require(_0x373a('0x5'));var BPromise=require(_0x373a('0x6'));var Mustache=require(_0x373a('0x7'));var util=require(_0x373a('0x8'));var path=require(_0x373a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x373a('0xa'));var fs=require('fs');var _=require(_0x373a('0xb'));var squel=require(_0x373a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x373a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x373a('0xe'));var Papa=require(_0x373a('0xf'));var Redis=require(_0x373a('0x10'));var authService=require(_0x373a('0x11'));var qs=require(_0x373a('0x12'));var as=require(_0x373a('0x13'));var hardwareService=require(_0x373a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x373a('0x15'));var config=require(_0x373a('0x16'));var db=require(_0x373a('0x17'))['db'];config[_0x373a('0x18')]=_['defaults'](config[_0x373a('0x18')],{'host':_0x373a('0x19'),'port':0x18eb});var socket=require(_0x373a('0x1a'))(new Redis(config[_0x373a('0x18')]));require(_0x373a('0x1b'))['register'](socket);function respondWithStatusCode(_0x23cdc5,_0xffee92){_0xffee92=_0xffee92||0xcc;return function(_0x1e7742){if(_0x1e7742){return _0x23cdc5['sendStatus'](_0xffee92);}return _0x23cdc5[_0x373a('0x1c')](_0xffee92)[_0x373a('0x1d')]();};}function respondWithResult(_0x5f28dd,_0x778b60){_0x778b60=_0x778b60||0xc8;return function(_0x5a72d0){if(_0x5a72d0){return _0x5f28dd['status'](_0x778b60)[_0x373a('0x1e')](_0x5a72d0);}};}function respondWithFilteredResult(_0x4509ab,_0xbfc0e8){return function(_0x4cdf2a){if(_0x4cdf2a){var _0x3148ef=_0x4cdf2a[_0x373a('0x1f')],_0x4f793b=_0xbfc0e8['offset'],_0x6f452d=_0xbfc0e8[_0x373a('0x20')]+_0xbfc0e8['limit'],_0x1e7581;if(_0x6f452d>=_0x3148ef){_0x6f452d=_0x3148ef;_0x1e7581=0xc8;}else{_0x1e7581=0xce;}_0x4509ab[_0x373a('0x1c')](_0x1e7581);return _0x4509ab['set']('Content-Range',_0x4f793b+'-'+_0x6f452d+'/'+_0x3148ef)[_0x373a('0x1e')](_0x4cdf2a);}return null;};}function patchUpdates(_0x172004){return function(_0x20e91e){try{jsonpatch['apply'](_0x20e91e,_0x172004,!![]);}catch(_0x1a1933){return BPromise[_0x373a('0x21')](_0x1a1933);}return _0x20e91e[_0x373a('0x22')]();};}function saveUpdates(_0x2e01cf,_0x4e174b){return function(_0x5b09e6){if(_0x5b09e6){return _0x5b09e6['update'](_0x2e01cf)[_0x373a('0x23')](function(_0xfad915){return _0xfad915;});}return null;};}function removeEntity(_0xc8662e,_0x852597){return function(_0x5ea6c2){if(_0x5ea6c2){return _0x5ea6c2[_0x373a('0x24')]()[_0x373a('0x23')](function(){var _0x444853=_0x5ea6c2[_0x373a('0x25')]({'plain':!![]});var _0x36143e=_0x373a('0x26');return db[_0x373a('0x27')][_0x373a('0x24')]({'where':{'type':_0x36143e,'resourceId':_0x444853['id']}})[_0x373a('0x23')](function(){return _0x5ea6c2;});})['then'](function(){_0xc8662e['status'](0xcc)[_0x373a('0x1d')]();});}};}function handleEntityNotFound(_0x978b05,_0x509380){return function(_0x25d38f){if(!_0x25d38f){_0x978b05[_0x373a('0x28')](0x194);}return _0x25d38f;};}function handleError(_0x4b5de4,_0x465310){_0x465310=_0x465310||0x1f4;return function(_0x1e6b23){logger[_0x373a('0x29')](_0x1e6b23[_0x373a('0x2a')]);if(_0x1e6b23[_0x373a('0x2b')]){delete _0x1e6b23[_0x373a('0x2b')];}_0x4b5de4[_0x373a('0x1c')](_0x465310)[_0x373a('0x2c')](_0x1e6b23);};}exports['index']=function(_0x11c014,_0x19f384){var _0x4420ca={},_0x45ca94={},_0x55d095={'count':0x0,'rows':[]};var _0x1507e4=_[_0x373a('0x2d')](db[_0x373a('0x2e')][_0x373a('0x2f')],function(_0x3a07d5){return{'name':_0x3a07d5[_0x373a('0x30')],'type':_0x3a07d5[_0x373a('0x31')][_0x373a('0x32')]};});_0x45ca94['model']=_[_0x373a('0x2d')](_0x1507e4,'name');_0x45ca94[_0x373a('0x33')]=_['keys'](_0x11c014[_0x373a('0x33')]);_0x45ca94[_0x373a('0x34')]=_['intersection'](_0x45ca94[_0x373a('0x35')],_0x45ca94[_0x373a('0x33')]);_0x4420ca[_0x373a('0x36')]=_[_0x373a('0x37')](_0x45ca94[_0x373a('0x35')],qs[_0x373a('0x38')](_0x11c014['query']['fields']));_0x4420ca[_0x373a('0x36')]=_0x4420ca[_0x373a('0x36')][_0x373a('0x39')]?_0x4420ca[_0x373a('0x36')]:_0x45ca94[_0x373a('0x35')];if(!_0x11c014[_0x373a('0x33')][_0x373a('0x3a')](_0x373a('0x3b'))){_0x4420ca[_0x373a('0x3c')]=qs[_0x373a('0x3c')](_0x11c014[_0x373a('0x33')][_0x373a('0x3c')]);_0x4420ca[_0x373a('0x20')]=qs[_0x373a('0x20')](_0x11c014[_0x373a('0x33')][_0x373a('0x20')]);}_0x4420ca[_0x373a('0x3d')]=qs['sort'](_0x11c014[_0x373a('0x33')][_0x373a('0x3e')]);_0x4420ca['where']=qs[_0x373a('0x34')](_[_0x373a('0x3f')](_0x11c014[_0x373a('0x33')],_0x45ca94[_0x373a('0x34')]),_0x1507e4);if(_0x11c014[_0x373a('0x33')][_0x373a('0x40')]){_0x4420ca[_0x373a('0x41')]=_[_0x373a('0x42')](_0x4420ca[_0x373a('0x41')],{'$or':_[_0x373a('0x2d')](_0x1507e4,function(_0x2cd6f5){if(_0x2cd6f5[_0x373a('0x31')]!==_0x373a('0x43')){var _0x51611e={};_0x51611e[_0x2cd6f5[_0x373a('0x2b')]]={'$like':'%'+_0x11c014[_0x373a('0x33')][_0x373a('0x40')]+'%'};return _0x51611e;}})});}_0x4420ca=_['merge']({},_0x4420ca,_0x11c014[_0x373a('0x44')]);var _0x53ddfd={'where':_0x4420ca[_0x373a('0x41')]};return db[_0x373a('0x2e')][_0x373a('0x1f')](_0x53ddfd)[_0x373a('0x23')](function(_0x22aacd){_0x55d095[_0x373a('0x1f')]=_0x22aacd;if(_0x11c014[_0x373a('0x33')][_0x373a('0x45')]){_0x4420ca[_0x373a('0x46')]=[{'all':!![]}];}return db[_0x373a('0x2e')]['findAll'](_0x4420ca);})[_0x373a('0x23')](function(_0x4a5783){_0x55d095[_0x373a('0x47')]=_0x4a5783;return _0x55d095;})[_0x373a('0x23')](respondWithFilteredResult(_0x19f384,_0x4420ca))[_0x373a('0x48')](handleError(_0x19f384,null));};exports['show']=function(_0x4e5205,_0x4fd8b6){var _0x5e7085={'raw':!![],'where':{'id':_0x4e5205[_0x373a('0x49')]['id']}},_0x3deddb={};_0x3deddb[_0x373a('0x35')]=_[_0x373a('0x4a')](db['WhatsappQueue'][_0x373a('0x2f')]);_0x3deddb[_0x373a('0x33')]=_[_0x373a('0x4a')](_0x4e5205[_0x373a('0x33')]);_0x3deddb[_0x373a('0x34')]=_[_0x373a('0x37')](_0x3deddb['model'],_0x3deddb[_0x373a('0x33')]);_0x5e7085['attributes']=_['intersection'](_0x3deddb[_0x373a('0x35')],qs[_0x373a('0x38')](_0x4e5205['query'][_0x373a('0x38')]));_0x5e7085[_0x373a('0x36')]=_0x5e7085[_0x373a('0x36')]['length']?_0x5e7085[_0x373a('0x36')]:_0x3deddb[_0x373a('0x35')];if(_0x4e5205['query']['includeAll']){_0x5e7085['include']=[{'all':!![]}];}_0x5e7085=_['merge']({},_0x5e7085,_0x4e5205['options']);return db[_0x373a('0x2e')][_0x373a('0x4b')](_0x5e7085)[_0x373a('0x23')](handleEntityNotFound(_0x4fd8b6,null))['then'](respondWithResult(_0x4fd8b6,null))[_0x373a('0x48')](handleError(_0x4fd8b6,null));};exports[_0x373a('0x4c')]=function(_0x266f7c,_0x216b16){return db[_0x373a('0x2e')]['create'](_0x266f7c[_0x373a('0x4d')],{})['then'](function(_0x1a0914){var _0x4ff005=_0x266f7c[_0x373a('0x4e')][_0x373a('0x25')]({'plain':!![]});if(!_0x4ff005)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ff005[_0x373a('0x4f')]===_0x373a('0x4e')){var _0x5ce321=_0x1a0914[_0x373a('0x25')]({'plain':!![]});var _0xa5a4fe=_0x373a('0x26');return db[_0x373a('0x50')]['find']({'where':{'name':_0xa5a4fe,'userProfileId':_0x4ff005[_0x373a('0x51')]},'raw':!![]})[_0x373a('0x23')](function(_0x380ad5){if(_0x380ad5&&_0x380ad5[_0x373a('0x52')]===0x0){return db[_0x373a('0x27')][_0x373a('0x4c')]({'name':_0x5ce321[_0x373a('0x2b')],'resourceId':_0x5ce321['id'],'type':_0x380ad5['name'],'sectionId':_0x380ad5['id']},{})[_0x373a('0x23')](function(){return _0x1a0914;});}else{return _0x1a0914;}})[_0x373a('0x48')](function(_0x2482ef){logger[_0x373a('0x29')](_0x373a('0x53'),_0x2482ef);throw _0x2482ef;});}return _0x1a0914;})[_0x373a('0x23')](respondWithResult(_0x216b16,0xc9))[_0x373a('0x48')](handleError(_0x216b16,null));};exports[_0x373a('0x54')]=function(_0x3e3d56,_0x275bc0){if(_0x3e3d56[_0x373a('0x4d')]['id']){delete _0x3e3d56[_0x373a('0x4d')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x3e3d56['params']['id']}})[_0x373a('0x23')](handleEntityNotFound(_0x275bc0,null))[_0x373a('0x23')](saveUpdates(_0x3e3d56[_0x373a('0x4d')],null))[_0x373a('0x23')](respondWithResult(_0x275bc0,null))[_0x373a('0x48')](handleError(_0x275bc0,null));};exports[_0x373a('0x24')]=function(_0xa99023,_0x42accb){return db['WhatsappQueue'][_0x373a('0x4b')]({'where':{'id':_0xa99023['params']['id']}})[_0x373a('0x23')](handleEntityNotFound(_0x42accb,null))['then'](removeEntity(_0x42accb,null))[_0x373a('0x48')](handleError(_0x42accb,null));};exports['describe']=function(_0x1727e2,_0xd39371){return db['WhatsappQueue']['describe']()['then'](respondWithResult(_0xd39371,null))[_0x373a('0x48')](handleError(_0xd39371,null));};exports['getMembers']=function(_0x353304,_0x1370e6,_0x167713){var _0xdd2678={'raw':!![],'where':{}},_0x200538={},_0x28e683;return db['WhatsappQueue'][_0x373a('0x55')]({'where':{'id':_0x353304[_0x373a('0x49')]['id']}})['then'](handleEntityNotFound(_0x1370e6,null))[_0x373a('0x23')](function(_0x115e7a){if(_0x115e7a){_0x28e683=_0x115e7a[_0x373a('0x25')]({'plain':!![]});_0x200538[_0x373a('0x35')]=_[_0x373a('0x4a')](db[_0x373a('0x56')]['rawAttributes']);_0x200538[_0x373a('0x33')]=_[_0x373a('0x4a')](_0x353304['query']);_0x200538[_0x373a('0x34')]=_[_0x373a('0x37')](_0x200538[_0x373a('0x35')],_0x200538[_0x373a('0x33')]);_0xdd2678[_0x373a('0x36')]=_[_0x373a('0x37')](_0x200538[_0x373a('0x35')],qs[_0x373a('0x38')](_0x353304[_0x373a('0x33')][_0x373a('0x38')]));_0xdd2678['attributes']=_0xdd2678['attributes'][_0x373a('0x39')]?_0xdd2678[_0x373a('0x36')]:_0x200538[_0x373a('0x35')];if(!_0x353304[_0x373a('0x33')][_0x373a('0x3a')](_0x373a('0x3b'))){_0xdd2678['limit']=qs['limit'](_0x353304[_0x373a('0x33')]['limit']);_0xdd2678[_0x373a('0x20')]=qs[_0x373a('0x20')](_0x353304[_0x373a('0x33')][_0x373a('0x20')]);}_0xdd2678[_0x373a('0x3d')]=qs[_0x373a('0x3e')](_0x353304['query'][_0x373a('0x3e')]);_0xdd2678[_0x373a('0x41')]=qs[_0x373a('0x34')](_[_0x373a('0x3f')](_0x353304[_0x373a('0x33')],_0x200538['filters']));_0xdd2678[_0x373a('0x41')][_0x373a('0x57')]=_0x115e7a['id'];if(_0x353304[_0x373a('0x33')][_0x373a('0x40')]){_0xdd2678[_0x373a('0x41')]=_[_0x373a('0x42')](_0xdd2678[_0x373a('0x41')],{'$or':_[_0x373a('0x2d')](_0xdd2678[_0x373a('0x36')],function(_0x524b5d){var _0x9e73bb={};_0x9e73bb[_0x524b5d]={'$like':'%'+_0x353304[_0x373a('0x33')]['filter']+'%'};return _0x9e73bb;})});}_0xdd2678=_[_0x373a('0x42')]({},_0xdd2678,_0x353304[_0x373a('0x44')]);return db[_0x373a('0x56')][_0x373a('0x58')](_0xdd2678);}})[_0x373a('0x23')](function(_0x3cd889){if(_0x3cd889){return db['User'][_0x373a('0x59')]({'where':{'id':_['map'](_0x3cd889,_0x373a('0x5a')),'role':_0x373a('0x5b')},'attributes':['id',_0x373a('0x2b'),'whatsappPause',_0x373a('0x5c'),_0x373a('0x5d')]});}})[_0x373a('0x23')](function(_0x32293a){if(_0x32293a){return{'count':_0x32293a['count'],'rows':_[_0x373a('0x2d')](_0x32293a['rows'],function(_0xcd4ac4){return{'membername':_0xcd4ac4[_0x373a('0x2b')],'UserId':_0xcd4ac4['id'],'queue_name':_0x28e683[_0x373a('0x2b')],'WhatsappQueueId':_0x28e683['id'],'interface':util[_0x373a('0x5e')](_0x373a('0x5f'),_0x373a('0x60'),_0xcd4ac4[_0x373a('0x2b')]),'penalty':0x0,'paused':_0xcd4ac4[_0x373a('0x61')],'createdAt':_0xcd4ac4[_0x373a('0x5d')],'updatedAt':_0xcd4ac4[_0x373a('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x373a('0x23')](respondWithFilteredResult(_0x1370e6,_0xdd2678))[_0x373a('0x48')](handleError(_0x1370e6,null));};exports[_0x373a('0x62')]=function(_0x50ef34,_0x4999d6,_0x2336a0){var _0x2b5f35={};var _0x1d94a0={};var _0x3f25e8;var _0x2d1c28;return db[_0x373a('0x2e')][_0x373a('0x55')]({'where':{'id':_0x50ef34[_0x373a('0x49')]['id']}})['then'](handleEntityNotFound(_0x4999d6,null))['then'](function(_0xa98327){if(_0xa98327){_0x3f25e8=_0xa98327;_0x1d94a0['model']=_[_0x373a('0x4a')](db[_0x373a('0x63')][_0x373a('0x2f')]);_0x1d94a0[_0x373a('0x33')]=_['keys'](_0x50ef34[_0x373a('0x33')]);_0x1d94a0[_0x373a('0x34')]=_['intersection'](_0x1d94a0[_0x373a('0x35')],_0x1d94a0[_0x373a('0x33')]);_0x2b5f35[_0x373a('0x36')]=_[_0x373a('0x37')](_0x1d94a0[_0x373a('0x35')],qs[_0x373a('0x38')](_0x50ef34[_0x373a('0x33')][_0x373a('0x38')]));_0x2b5f35[_0x373a('0x36')]=_0x2b5f35[_0x373a('0x36')][_0x373a('0x39')]?_0x2b5f35[_0x373a('0x36')]:_0x1d94a0[_0x373a('0x35')];_0x2b5f35[_0x373a('0x3d')]=qs['sort'](_0x50ef34[_0x373a('0x33')][_0x373a('0x3e')]);_0x2b5f35[_0x373a('0x41')]=qs['filters'](_[_0x373a('0x3f')](_0x50ef34[_0x373a('0x33')],_0x1d94a0[_0x373a('0x34')]));if(_0x50ef34[_0x373a('0x33')][_0x373a('0x40')]){_0x2b5f35[_0x373a('0x41')]=_[_0x373a('0x42')](_0x2b5f35['where'],{'$or':_[_0x373a('0x2d')](_0x2b5f35['attributes'],function(_0x18765b){var _0x5960b5={};_0x5960b5[_0x18765b]={'$like':'%'+_0x50ef34['query']['filter']+'%'};return _0x5960b5;})});}_0x2b5f35=_[_0x373a('0x42')]({},_0x2b5f35,_0x50ef34['options']);return _0x3f25e8[_0x373a('0x62')](_0x2b5f35);}})[_0x373a('0x23')](function(_0x2cfa99){if(_0x2cfa99){_0x2d1c28=_0x2cfa99[_0x373a('0x39')];if(!_0x50ef34[_0x373a('0x33')]['hasOwnProperty']('nolimit')){_0x2b5f35['limit']=qs[_0x373a('0x3c')](_0x50ef34['query']['limit']);_0x2b5f35['offset']=qs[_0x373a('0x20')](_0x50ef34['query'][_0x373a('0x20')]);}return _0x3f25e8[_0x373a('0x62')](_0x2b5f35);}})[_0x373a('0x23')](function(_0x239be9){if(_0x239be9){return _0x239be9?{'count':_0x2d1c28,'rows':_0x239be9}:null;}})[_0x373a('0x23')](respondWithResult(_0x4999d6,null))[_0x373a('0x48')](handleError(_0x4999d6,null));};exports[_0x373a('0x64')]=function(_0x1ab889,_0x38b6c1,_0x3282db){var _0x2a944f=_0x1ab889['body']['ids'];return db[_0x373a('0x63')][_0x373a('0x58')]({'where':{'id':_0x2a944f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x373a('0x65'),'attributes':['id',_0x373a('0x2b'),_0x373a('0x66'),_0x373a('0x67'),_0x373a('0x68')],'raw':!![]}]})[_0x373a('0x23')](function(_0xf8ad3f){if(_0xf8ad3f){var _0x973a1=_[_0x373a('0x69')](_0xf8ad3f,function(_0xbfe3e){var _0x4ccd53=_0xbfe3e[_0x373a('0x25')]({'plain':!![]});return _0x4ccd53[_0x373a('0x65')];});return db[_0x373a('0x2e')][_0x373a('0x4b')]({'where':{'id':_0x1ab889[_0x373a('0x49')]['id']}})[_0x373a('0x23')](function(_0x4fbde8){return db[_0x373a('0x6a')][_0x373a('0x6b')](function(_0x3f05a8){return _0x4fbde8['addTeams'](_0x2a944f,{'transaction':_0x3f05a8})[_0x373a('0x23')](function(){return BPromise[_0x373a('0x6c')](_0x973a1,function(_0x92e6c4){return db['UserWhatsappQueue'][_0x373a('0x6d')]({'where':{'UserId':_0x92e6c4['id'],'WhatsappQueueId':_0x1ab889['params']['id']},'transaction':_0x3f05a8});});})['then'](function(){_0x973a1[_0x373a('0x6e')](function(_0x2f7f06){socket[_0x373a('0x6f')](_0x373a('0x70'),{'UserId':_0x2f7f06['id'],'WhatsappQueueId':_0x4fbde8['id']});});});});});}})[_0x373a('0x23')](respondWithStatusCode(_0x38b6c1,null))[_0x373a('0x48')](handleError(_0x38b6c1,null));};exports[_0x373a('0x71')]=function(_0x116ae4,_0x304876,_0x4074f1){return db[_0x373a('0x63')][_0x373a('0x58')]({'where':{'id':_0x116ae4[_0x373a('0x33')][_0x373a('0x72')]},'attributes':['id'],'include':[{'model':db[_0x373a('0x73')],'as':_0x373a('0x65'),'attributes':['id'],'raw':!![]}]})[_0x373a('0x23')](handleEntityNotFound(_0x304876,null))['then'](function(_0x3a286e){var _0x20a26d=_['map'](_0x3a286e,'id');var _0x5822a6=[];var _0x8b6fa3=[];var _0x4b6261=squel[_0x373a('0x74')]();_0x4b6261[_0x373a('0x75')]('tq.TeamId')[_0x373a('0x76')](_0x373a('0x77'),'tq')['join'](_0x373a('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x116ae4[_0x373a('0x49')]['id']);for(var _0x4f5401=0x0;_0x4f5401<_0x3a286e['length'];_0x4f5401+=0x1){let _0x4f36da=_0x3a286e[_0x4f5401];for(var _0x161ccf=0x0;_0x161ccf<_0x4f36da[_0x373a('0x65')][_0x373a('0x39')];_0x161ccf+=0x1){let _0x161e52=_0x4f36da[_0x373a('0x65')][_0x161ccf];var _0x57e89e=_0x4b6261['clone']();_0x57e89e[_0x373a('0x41')](_0x373a('0x79'),_0x161e52['id']);_0x8b6fa3[_0x373a('0x7a')](db[_0x373a('0x6a')][_0x373a('0x33')](_0x57e89e['toString'](),{'type':db['sequelize'][_0x373a('0x7b')][_0x373a('0x7c')]})[_0x373a('0x23')](function(_0x223b65){if(_0x223b65[_0x373a('0x39')]===0x1){return _0x161e52['id'];}else{var _0x169fbe=_[_0x373a('0x7d')](_['map'](_0x223b65,'TeamId'),function(_0x1b6002){return _[_0x373a('0x7e')](_0x20a26d,_0x1b6002);});if(_0x169fbe){return _0x161e52['id'];}}}));}}return BPromise[_0x373a('0x7f')](_0x8b6fa3)['then'](function(_0x34c9eb){_0x5822a6=_(_0x5822a6)[_0x373a('0x80')](_0x34c9eb)[_0x373a('0x81')]()[_0x373a('0x82')]();return db[_0x373a('0x2e')][_0x373a('0x4b')]({'where':{'id':_0x116ae4[_0x373a('0x49')]['id']}})[_0x373a('0x23')](function(_0x181ec3){return db[_0x373a('0x6a')][_0x373a('0x6b')](function(_0x33816f){return _0x181ec3['removeTeams'](_0x116ae4[_0x373a('0x33')][_0x373a('0x72')],{'transaction':_0x33816f})[_0x373a('0x23')](function(){if(!_[_0x373a('0x83')](_0x5822a6)){return _0x181ec3[_0x373a('0x84')](_0x5822a6,{'transaction':_0x33816f});}})['then'](function(){_0x5822a6[_0x373a('0x6e')](function(_0x27226d){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x27226d,'WhatsappQueueId':_0x181ec3['id']});});});});});});})[_0x373a('0x23')](respondWithStatusCode(_0x304876,null))[_0x373a('0x48')](handleError(_0x304876,null));};exports[_0x373a('0x85')]=function(_0x105152,_0xa9ff0f,_0x4d746b){return db[_0x373a('0x2e')][_0x373a('0x4b')]({'where':{'id':_0x105152['params']['id']}})[_0x373a('0x23')](handleEntityNotFound(_0xa9ff0f,null))[_0x373a('0x23')](function(_0xfc5494){if(_0xfc5494){return _0xfc5494[_0x373a('0x85')](_0x105152[_0x373a('0x4d')]['ids'],_[_0x373a('0x86')](_0x105152[_0x373a('0x4d')],[_0x373a('0x72'),'id'])||{})[_0x373a('0x87')](function(_0x129e16){for(var _0x1c58e3=0x0;_0x1c58e3<_0x105152[_0x373a('0x4d')][_0x373a('0x72')][_0x373a('0x39')];_0x1c58e3+=0x1){socket[_0x373a('0x6f')]('userWhatsappQueue:save',{'UserId':_0x105152[_0x373a('0x4d')]['ids'][_0x1c58e3],'WhatsappQueueId':_0x105152['params']['id']});}return _0x129e16;});}})[_0x373a('0x23')](respondWithResult(_0xa9ff0f,null))[_0x373a('0x48')](handleError(_0xa9ff0f,null));};exports['removeAgents']=function(_0x56ab60,_0x41d7aa,_0x9eb9f3){return db['WhatsappQueue'][_0x373a('0x4b')]({'where':{'id':_0x56ab60[_0x373a('0x49')]['id']}})[_0x373a('0x23')](handleEntityNotFound(_0x41d7aa,null))['then'](function(_0x183fe2){if(_0x183fe2){return _0x183fe2[_0x373a('0x84')](_0x56ab60[_0x373a('0x33')][_0x373a('0x72')])[_0x373a('0x23')](function(){if(_[_0x373a('0x88')](_0x56ab60[_0x373a('0x33')][_0x373a('0x72')])){for(var _0x29d603=0x0;_0x29d603<_0x56ab60[_0x373a('0x33')][_0x373a('0x72')]['length'];_0x29d603+=0x1){socket[_0x373a('0x6f')](_0x373a('0x89'),{'UserId':Number(_0x56ab60[_0x373a('0x33')][_0x373a('0x72')][_0x29d603]),'WhatsappQueueId':Number(_0x56ab60[_0x373a('0x49')]['id'])});}}else{socket[_0x373a('0x6f')](_0x373a('0x89'),{'UserId':Number(_0x56ab60[_0x373a('0x33')][_0x373a('0x72')]),'WhatsappQueueId':Number(_0x56ab60[_0x373a('0x49')]['id'])});}});}})[_0x373a('0x23')](respondWithStatusCode(_0x41d7aa,null))[_0x373a('0x48')](handleError(_0x41d7aa,null));};exports[_0x373a('0x8a')]=function(_0x15fdad,_0x4c8e7e,_0x357341){var _0x2dc745={};var _0x234742={};var _0x589c2b;var _0x5efd27;return db[_0x373a('0x2e')]['findOne']({'where':{'id':_0x15fdad[_0x373a('0x49')]['id']}})[_0x373a('0x23')](handleEntityNotFound(_0x4c8e7e,null))[_0x373a('0x23')](function(_0x36c559){if(_0x36c559){_0x589c2b=_0x36c559;_0x234742[_0x373a('0x35')]=_[_0x373a('0x4a')](db[_0x373a('0x73')][_0x373a('0x2f')]);_0x234742[_0x373a('0x33')]=_[_0x373a('0x4a')](_0x15fdad[_0x373a('0x33')]);_0x234742[_0x373a('0x34')]=_['intersection'](_0x234742[_0x373a('0x35')],_0x234742['query']);_0x2dc745[_0x373a('0x36')]=_[_0x373a('0x37')](_0x234742['model'],qs['fields'](_0x15fdad[_0x373a('0x33')][_0x373a('0x38')]));_0x2dc745[_0x373a('0x36')]=_0x2dc745[_0x373a('0x36')]['length']?_0x2dc745[_0x373a('0x36')]:_0x234742[_0x373a('0x35')];_0x2dc745['order']=qs[_0x373a('0x3e')](_0x15fdad[_0x373a('0x33')][_0x373a('0x3e')]);_0x2dc745[_0x373a('0x41')]=qs[_0x373a('0x34')](_['pick'](_0x15fdad[_0x373a('0x33')],_0x234742[_0x373a('0x34')]));if(_0x15fdad[_0x373a('0x33')][_0x373a('0x40')]){_0x2dc745['where']=_[_0x373a('0x42')](_0x2dc745['where'],{'$or':_[_0x373a('0x2d')](_0x2dc745[_0x373a('0x36')],function(_0x11dc5f){var _0x455983={};_0x455983[_0x11dc5f]={'$like':'%'+_0x15fdad[_0x373a('0x33')][_0x373a('0x40')]+'%'};return _0x455983;})});}_0x2dc745=_[_0x373a('0x42')]({},_0x2dc745,_0x15fdad[_0x373a('0x44')]);return _0x589c2b[_0x373a('0x8a')](_0x2dc745);}})[_0x373a('0x23')](function(_0x5ca800){if(_0x5ca800){_0x5efd27=_0x5ca800[_0x373a('0x39')];if(!_0x15fdad[_0x373a('0x33')][_0x373a('0x3a')](_0x373a('0x3b'))){_0x2dc745[_0x373a('0x3c')]=qs[_0x373a('0x3c')](_0x15fdad[_0x373a('0x33')][_0x373a('0x3c')]);_0x2dc745[_0x373a('0x20')]=qs[_0x373a('0x20')](_0x15fdad[_0x373a('0x33')][_0x373a('0x20')]);}return _0x589c2b['getAgents'](_0x2dc745);}})[_0x373a('0x23')](function(_0x5c9482){if(_0x5c9482){return _0x5c9482?{'count':_0x5efd27,'rows':_0x5c9482}:null;}})[_0x373a('0x23')](respondWithResult(_0x4c8e7e,null))[_0x373a('0x48')](handleError(_0x4c8e7e,null));}; \ No newline at end of file +var _0x19e7=['show','params','rawAttributes','keys','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','describe','getMembers','findOne','UserWhatsappQueue','limit','WhatsappQueueId','findAll','User','findAndCountAll','UserId','whatsappPause','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','compact','sequelize','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','./whatsappQueue.socket','register','sendStatus','end','status','count','offset','set','Content-Range','json','reject','update','destroy','then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows'];(function(_0x116496,_0x285005){var _0x3ebb4b=function(_0x328937){while(--_0x328937){_0x116496['push'](_0x116496['shift']());}};_0x3ebb4b(++_0x285005);}(_0x19e7,0xc8));var _0x719e=function(_0x4d99c1,_0x18f8f4){_0x4d99c1=_0x4d99c1-0x0;var _0x339457=_0x19e7[_0x4d99c1];return _0x339457;};'use strict';var pdf=require(_0x719e('0x0'));var emlformat=require(_0x719e('0x1'));var rimraf=require(_0x719e('0x2'));var zipdir=require(_0x719e('0x3'));var jsonpatch=require(_0x719e('0x4'));var rp=require(_0x719e('0x5'));var moment=require(_0x719e('0x6'));var BPromise=require(_0x719e('0x7'));var Mustache=require(_0x719e('0x8'));var util=require(_0x719e('0x9'));var path=require(_0x719e('0xa'));var sox=require(_0x719e('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x719e('0xc'));var squel=require(_0x719e('0xd'));var crypto=require('crypto');var jsforce=require(_0x719e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x719e('0xf'));var querystring=require(_0x719e('0x10'));var Papa=require(_0x719e('0x11'));var Redis=require(_0x719e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x719e('0x13'));var as=require(_0x719e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x719e('0x15'));var utils=require(_0x719e('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x719e('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x719e('0x17')]));require(_0x719e('0x18'))[_0x719e('0x19')](socket);function respondWithStatusCode(_0x229531,_0x2cc32b){_0x2cc32b=_0x2cc32b||0xcc;return function(_0x57b30a){if(_0x57b30a){return _0x229531[_0x719e('0x1a')](_0x2cc32b);}return _0x229531['status'](_0x2cc32b)[_0x719e('0x1b')]();};}function respondWithResult(_0x1d2180,_0x241f11){_0x241f11=_0x241f11||0xc8;return function(_0x5908ca){if(_0x5908ca){return _0x1d2180[_0x719e('0x1c')](_0x241f11)['json'](_0x5908ca);}};}function respondWithFilteredResult(_0x4d0b4c,_0x5d3c72){return function(_0x57f802){if(_0x57f802){var _0x2b3b8b=_0x57f802[_0x719e('0x1d')],_0x49541a=_0x5d3c72[_0x719e('0x1e')],_0x15cf54=_0x5d3c72['offset']+_0x5d3c72['limit'],_0xdf71bc;if(_0x15cf54>=_0x2b3b8b){_0x15cf54=_0x2b3b8b;_0xdf71bc=0xc8;}else{_0xdf71bc=0xce;}_0x4d0b4c['status'](_0xdf71bc);return _0x4d0b4c[_0x719e('0x1f')](_0x719e('0x20'),_0x49541a+'-'+_0x15cf54+'/'+_0x2b3b8b)[_0x719e('0x21')](_0x57f802);}return null;};}function patchUpdates(_0x3e47ec){return function(_0x118cb2){try{jsonpatch['apply'](_0x118cb2,_0x3e47ec,!![]);}catch(_0x26984a){return BPromise[_0x719e('0x22')](_0x26984a);}return _0x118cb2['save']();};}function saveUpdates(_0x3b99da,_0x57721a){return function(_0x41ebe4){if(_0x41ebe4){return _0x41ebe4[_0x719e('0x23')](_0x3b99da)['then'](function(_0x43c81){return _0x43c81;});}return null;};}function removeEntity(_0x32e5a5,_0x14e175){return function(_0x24408a){if(_0x24408a){return _0x24408a[_0x719e('0x24')]()[_0x719e('0x25')](function(){var _0x4c4ae2=_0x24408a[_0x719e('0x26')]({'plain':!![]});var _0x43cd78=_0x719e('0x27');return db[_0x719e('0x28')][_0x719e('0x24')]({'where':{'type':_0x43cd78,'resourceId':_0x4c4ae2['id']}})[_0x719e('0x25')](function(){return _0x24408a;});})['then'](function(){_0x32e5a5['status'](0xcc)[_0x719e('0x1b')]();});}};}function handleEntityNotFound(_0x5ae34a,_0x58a5d8){return function(_0x58aecf){if(!_0x58aecf){_0x5ae34a[_0x719e('0x1a')](0x194);}return _0x58aecf;};}function handleError(_0x5594ce,_0x10165a){_0x10165a=_0x10165a||0x1f4;return function(_0x16f7aa){logger[_0x719e('0x29')](_0x16f7aa[_0x719e('0x2a')]);if(_0x16f7aa['name']){delete _0x16f7aa[_0x719e('0x2b')];}_0x5594ce[_0x719e('0x1c')](_0x10165a)[_0x719e('0x2c')](_0x16f7aa);};}exports['index']=function(_0x1ca18f,_0x2532f8){var _0x208f61={},_0x2d4ef1={},_0x5ddb47={'count':0x0,'rows':[]};var _0x509b74=_[_0x719e('0x2d')](db[_0x719e('0x2e')]['rawAttributes'],function(_0x449458){return{'name':_0x449458[_0x719e('0x2f')],'type':_0x449458[_0x719e('0x30')]['key']};});_0x2d4ef1[_0x719e('0x31')]=_['map'](_0x509b74,_0x719e('0x2b'));_0x2d4ef1[_0x719e('0x32')]=_['keys'](_0x1ca18f['query']);_0x2d4ef1[_0x719e('0x33')]=_[_0x719e('0x34')](_0x2d4ef1['model'],_0x2d4ef1['query']);_0x208f61['attributes']=_[_0x719e('0x34')](_0x2d4ef1[_0x719e('0x31')],qs['fields'](_0x1ca18f[_0x719e('0x32')]['fields']));_0x208f61[_0x719e('0x35')]=_0x208f61[_0x719e('0x35')]['length']?_0x208f61[_0x719e('0x35')]:_0x2d4ef1[_0x719e('0x31')];if(!_0x1ca18f[_0x719e('0x32')][_0x719e('0x36')](_0x719e('0x37'))){_0x208f61['limit']=qs['limit'](_0x1ca18f[_0x719e('0x32')]['limit']);_0x208f61[_0x719e('0x1e')]=qs[_0x719e('0x1e')](_0x1ca18f[_0x719e('0x32')]['offset']);}_0x208f61[_0x719e('0x38')]=qs[_0x719e('0x39')](_0x1ca18f[_0x719e('0x32')][_0x719e('0x39')]);_0x208f61[_0x719e('0x3a')]=qs['filters'](_[_0x719e('0x3b')](_0x1ca18f[_0x719e('0x32')],_0x2d4ef1[_0x719e('0x33')]),_0x509b74);if(_0x1ca18f['query'][_0x719e('0x3c')]){_0x208f61[_0x719e('0x3a')]=_[_0x719e('0x3d')](_0x208f61[_0x719e('0x3a')],{'$or':_[_0x719e('0x2d')](_0x509b74,function(_0x4ae496){if(_0x4ae496['type']!=='VIRTUAL'){var _0x518bbd={};_0x518bbd[_0x4ae496[_0x719e('0x2b')]]={'$like':'%'+_0x1ca18f[_0x719e('0x32')]['filter']+'%'};return _0x518bbd;}})});}_0x208f61=_[_0x719e('0x3d')]({},_0x208f61,_0x1ca18f[_0x719e('0x3e')]);var _0x17deb4={'where':_0x208f61['where']};return db[_0x719e('0x2e')][_0x719e('0x1d')](_0x17deb4)[_0x719e('0x25')](function(_0x555893){_0x5ddb47['count']=_0x555893;if(_0x1ca18f[_0x719e('0x32')][_0x719e('0x3f')]){_0x208f61[_0x719e('0x40')]=[{'all':!![]}];}return db[_0x719e('0x2e')]['findAll'](_0x208f61);})['then'](function(_0x8085ad){_0x5ddb47[_0x719e('0x41')]=_0x8085ad;return _0x5ddb47;})['then'](respondWithFilteredResult(_0x2532f8,_0x208f61))['catch'](handleError(_0x2532f8,null));};exports[_0x719e('0x42')]=function(_0x4ed61c,_0x468479){var _0x52e5b2={'raw':!![],'where':{'id':_0x4ed61c[_0x719e('0x43')]['id']}},_0x4d5c84={};_0x4d5c84[_0x719e('0x31')]=_['keys'](db[_0x719e('0x2e')][_0x719e('0x44')]);_0x4d5c84[_0x719e('0x32')]=_[_0x719e('0x45')](_0x4ed61c['query']);_0x4d5c84['filters']=_[_0x719e('0x34')](_0x4d5c84['model'],_0x4d5c84[_0x719e('0x32')]);_0x52e5b2[_0x719e('0x35')]=_[_0x719e('0x34')](_0x4d5c84[_0x719e('0x31')],qs[_0x719e('0x46')](_0x4ed61c[_0x719e('0x32')][_0x719e('0x46')]));_0x52e5b2[_0x719e('0x35')]=_0x52e5b2['attributes'][_0x719e('0x47')]?_0x52e5b2[_0x719e('0x35')]:_0x4d5c84['model'];if(_0x4ed61c[_0x719e('0x32')][_0x719e('0x3f')]){_0x52e5b2[_0x719e('0x40')]=[{'all':!![]}];}_0x52e5b2=_[_0x719e('0x3d')]({},_0x52e5b2,_0x4ed61c['options']);return db['WhatsappQueue'][_0x719e('0x48')](_0x52e5b2)[_0x719e('0x25')](handleEntityNotFound(_0x468479,null))[_0x719e('0x25')](respondWithResult(_0x468479,null))['catch'](handleError(_0x468479,null));};exports[_0x719e('0x49')]=function(_0x4af30d,_0x335af6){return db[_0x719e('0x2e')][_0x719e('0x49')](_0x4af30d[_0x719e('0x4a')],{})[_0x719e('0x25')](function(_0x3f2f6c){var _0x39cab9=_0x4af30d[_0x719e('0x4b')]['get']({'plain':!![]});if(!_0x39cab9)throw new Error(_0x719e('0x4c'));if(_0x39cab9[_0x719e('0x4d')]==='user'){var _0x6edecc=_0x3f2f6c['get']({'plain':!![]});var _0x45846c=_0x719e('0x27');return db[_0x719e('0x4e')][_0x719e('0x48')]({'where':{'name':_0x45846c,'userProfileId':_0x39cab9[_0x719e('0x4f')]},'raw':!![]})[_0x719e('0x25')](function(_0x392c0d){if(_0x392c0d&&_0x392c0d[_0x719e('0x50')]===0x0){return db[_0x719e('0x28')][_0x719e('0x49')]({'name':_0x6edecc[_0x719e('0x2b')],'resourceId':_0x6edecc['id'],'type':_0x392c0d[_0x719e('0x2b')],'sectionId':_0x392c0d['id']},{})[_0x719e('0x25')](function(){return _0x3f2f6c;});}else{return _0x3f2f6c;}})[_0x719e('0x51')](function(_0x32d954){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32d954);throw _0x32d954;});}return _0x3f2f6c;})[_0x719e('0x25')](respondWithResult(_0x335af6,0xc9))['catch'](handleError(_0x335af6,null));};exports['update']=function(_0x33506d,_0x52f59d){if(_0x33506d[_0x719e('0x4a')]['id']){delete _0x33506d['body']['id'];}return db[_0x719e('0x2e')][_0x719e('0x48')]({'where':{'id':_0x33506d['params']['id']}})[_0x719e('0x25')](handleEntityNotFound(_0x52f59d,null))[_0x719e('0x25')](saveUpdates(_0x33506d[_0x719e('0x4a')],null))['then'](respondWithResult(_0x52f59d,null))[_0x719e('0x51')](handleError(_0x52f59d,null));};exports[_0x719e('0x24')]=function(_0x5eb4a5,_0x23143e){return db[_0x719e('0x2e')][_0x719e('0x48')]({'where':{'id':_0x5eb4a5['params']['id']}})[_0x719e('0x25')](handleEntityNotFound(_0x23143e,null))[_0x719e('0x25')](removeEntity(_0x23143e,null))[_0x719e('0x51')](handleError(_0x23143e,null));};exports[_0x719e('0x52')]=function(_0x3575ea,_0x404d85){return db['WhatsappQueue'][_0x719e('0x52')]()[_0x719e('0x25')](respondWithResult(_0x404d85,null))[_0x719e('0x51')](handleError(_0x404d85,null));};exports[_0x719e('0x53')]=function(_0xa39162,_0xdd0c16,_0x4e5c62){var _0x3ceb41={'raw':!![],'where':{}},_0x3a3987={},_0xc4ff88;return db[_0x719e('0x2e')][_0x719e('0x54')]({'where':{'id':_0xa39162[_0x719e('0x43')]['id']}})[_0x719e('0x25')](handleEntityNotFound(_0xdd0c16,null))[_0x719e('0x25')](function(_0x1e9e5d){if(_0x1e9e5d){_0xc4ff88=_0x1e9e5d[_0x719e('0x26')]({'plain':!![]});_0x3a3987[_0x719e('0x31')]=_[_0x719e('0x45')](db[_0x719e('0x55')][_0x719e('0x44')]);_0x3a3987[_0x719e('0x32')]=_[_0x719e('0x45')](_0xa39162[_0x719e('0x32')]);_0x3a3987[_0x719e('0x33')]=_[_0x719e('0x34')](_0x3a3987[_0x719e('0x31')],_0x3a3987[_0x719e('0x32')]);_0x3ceb41[_0x719e('0x35')]=_['intersection'](_0x3a3987['model'],qs[_0x719e('0x46')](_0xa39162[_0x719e('0x32')][_0x719e('0x46')]));_0x3ceb41[_0x719e('0x35')]=_0x3ceb41[_0x719e('0x35')][_0x719e('0x47')]?_0x3ceb41['attributes']:_0x3a3987[_0x719e('0x31')];if(!_0xa39162[_0x719e('0x32')][_0x719e('0x36')](_0x719e('0x37'))){_0x3ceb41[_0x719e('0x56')]=qs[_0x719e('0x56')](_0xa39162[_0x719e('0x32')][_0x719e('0x56')]);_0x3ceb41[_0x719e('0x1e')]=qs['offset'](_0xa39162[_0x719e('0x32')][_0x719e('0x1e')]);}_0x3ceb41['order']=qs[_0x719e('0x39')](_0xa39162[_0x719e('0x32')][_0x719e('0x39')]);_0x3ceb41[_0x719e('0x3a')]=qs[_0x719e('0x33')](_[_0x719e('0x3b')](_0xa39162[_0x719e('0x32')],_0x3a3987['filters']));_0x3ceb41['where'][_0x719e('0x57')]=_0x1e9e5d['id'];if(_0xa39162[_0x719e('0x32')][_0x719e('0x3c')]){_0x3ceb41[_0x719e('0x3a')]=_['merge'](_0x3ceb41[_0x719e('0x3a')],{'$or':_[_0x719e('0x2d')](_0x3ceb41[_0x719e('0x35')],function(_0x587291){var _0x3dd137={};_0x3dd137[_0x587291]={'$like':'%'+_0xa39162[_0x719e('0x32')][_0x719e('0x3c')]+'%'};return _0x3dd137;})});}_0x3ceb41=_['merge']({},_0x3ceb41,_0xa39162['options']);return db[_0x719e('0x55')][_0x719e('0x58')](_0x3ceb41);}})[_0x719e('0x25')](function(_0x3157c9){if(_0x3157c9){return db[_0x719e('0x59')][_0x719e('0x5a')]({'where':{'id':_[_0x719e('0x2d')](_0x3157c9,_0x719e('0x5b')),'role':'agent'},'attributes':['id','name',_0x719e('0x5c'),'updatedAt','createdAt']});}})[_0x719e('0x25')](function(_0x19b594){if(_0x19b594){return{'count':_0x19b594[_0x719e('0x1d')],'rows':_[_0x719e('0x2d')](_0x19b594[_0x719e('0x41')],function(_0x45eb4b){return{'membername':_0x45eb4b['name'],'UserId':_0x45eb4b['id'],'queue_name':_0xc4ff88[_0x719e('0x2b')],'WhatsappQueueId':_0xc4ff88['id'],'interface':util['format'](_0x719e('0x5d'),_0x719e('0x5e'),_0x45eb4b[_0x719e('0x2b')]),'penalty':0x0,'paused':_0x45eb4b[_0x719e('0x5c')],'createdAt':_0x45eb4b[_0x719e('0x5f')],'updatedAt':_0x45eb4b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x719e('0x25')](respondWithFilteredResult(_0xdd0c16,_0x3ceb41))['catch'](handleError(_0xdd0c16,null));};exports[_0x719e('0x60')]=function(_0x2c392d,_0x422686,_0x2f69ed){var _0x3e9271={};var _0x50e1c4={};var _0x2b3a47;var _0x4e8424;return db['WhatsappQueue'][_0x719e('0x54')]({'where':{'id':_0x2c392d[_0x719e('0x43')]['id']}})['then'](handleEntityNotFound(_0x422686,null))[_0x719e('0x25')](function(_0x5e7c26){if(_0x5e7c26){_0x2b3a47=_0x5e7c26;_0x50e1c4[_0x719e('0x31')]=_[_0x719e('0x45')](db['Team'][_0x719e('0x44')]);_0x50e1c4['query']=_[_0x719e('0x45')](_0x2c392d[_0x719e('0x32')]);_0x50e1c4[_0x719e('0x33')]=_[_0x719e('0x34')](_0x50e1c4[_0x719e('0x31')],_0x50e1c4['query']);_0x3e9271[_0x719e('0x35')]=_['intersection'](_0x50e1c4['model'],qs['fields'](_0x2c392d[_0x719e('0x32')][_0x719e('0x46')]));_0x3e9271[_0x719e('0x35')]=_0x3e9271[_0x719e('0x35')][_0x719e('0x47')]?_0x3e9271[_0x719e('0x35')]:_0x50e1c4[_0x719e('0x31')];_0x3e9271['order']=qs[_0x719e('0x39')](_0x2c392d[_0x719e('0x32')][_0x719e('0x39')]);_0x3e9271[_0x719e('0x3a')]=qs[_0x719e('0x33')](_['pick'](_0x2c392d[_0x719e('0x32')],_0x50e1c4[_0x719e('0x33')]));if(_0x2c392d[_0x719e('0x32')][_0x719e('0x3c')]){_0x3e9271[_0x719e('0x3a')]=_['merge'](_0x3e9271[_0x719e('0x3a')],{'$or':_['map'](_0x3e9271[_0x719e('0x35')],function(_0x4c3f16){var _0x2bcfc2={};_0x2bcfc2[_0x4c3f16]={'$like':'%'+_0x2c392d[_0x719e('0x32')][_0x719e('0x3c')]+'%'};return _0x2bcfc2;})});}_0x3e9271=_[_0x719e('0x3d')]({},_0x3e9271,_0x2c392d['options']);return _0x2b3a47[_0x719e('0x60')](_0x3e9271);}})[_0x719e('0x25')](function(_0x5a8018){if(_0x5a8018){_0x4e8424=_0x5a8018['length'];if(!_0x2c392d[_0x719e('0x32')][_0x719e('0x36')](_0x719e('0x37'))){_0x3e9271[_0x719e('0x56')]=qs[_0x719e('0x56')](_0x2c392d[_0x719e('0x32')][_0x719e('0x56')]);_0x3e9271['offset']=qs[_0x719e('0x1e')](_0x2c392d[_0x719e('0x32')][_0x719e('0x1e')]);}return _0x2b3a47[_0x719e('0x60')](_0x3e9271);}})[_0x719e('0x25')](function(_0x36f065){if(_0x36f065){return _0x36f065?{'count':_0x4e8424,'rows':_0x36f065}:null;}})[_0x719e('0x25')](respondWithResult(_0x422686,null))[_0x719e('0x51')](handleError(_0x422686,null));};exports[_0x719e('0x61')]=function(_0x1ce10c,_0x3d0ea8,_0x3dad97){var _0x505539=_0x1ce10c[_0x719e('0x4a')][_0x719e('0x62')];return db[_0x719e('0x63')][_0x719e('0x58')]({'where':{'id':_0x505539},'attributes':['id'],'include':[{'model':db[_0x719e('0x59')],'as':_0x719e('0x64'),'attributes':['id',_0x719e('0x2b'),_0x719e('0x65'),_0x719e('0x66'),_0x719e('0x67')],'raw':!![]}]})[_0x719e('0x25')](function(_0x30971a){if(_0x30971a){var _0x16ee81=_[_0x719e('0x68')](_0x30971a,function(_0x150f32){var _0x37d52f=_0x150f32[_0x719e('0x26')]({'plain':!![]});return _0x37d52f[_0x719e('0x64')];});return db['WhatsappQueue'][_0x719e('0x48')]({'where':{'id':_0x1ce10c[_0x719e('0x43')]['id']}})['then'](function(_0x497321){return db['sequelize'][_0x719e('0x69')](function(_0x412c39){return _0x497321[_0x719e('0x61')](_0x505539,{'transaction':_0x412c39})[_0x719e('0x25')](function(){return BPromise[_0x719e('0x6a')](_0x16ee81,function(_0x28f508){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x28f508['id'],'WhatsappQueueId':_0x1ce10c[_0x719e('0x43')]['id']},'transaction':_0x412c39});});})[_0x719e('0x25')](function(){_0x16ee81[_0x719e('0x6b')](function(_0x15d231){socket[_0x719e('0x6c')](_0x719e('0x6d'),{'UserId':_0x15d231['id'],'WhatsappQueueId':_0x497321['id']});});});});});}})[_0x719e('0x25')](respondWithStatusCode(_0x3d0ea8,null))[_0x719e('0x51')](handleError(_0x3d0ea8,null));};exports['removeTeams']=function(_0x3e5a3d,_0x1d2257,_0x4d759b){return db[_0x719e('0x63')][_0x719e('0x58')]({'where':{'id':_0x3e5a3d[_0x719e('0x32')][_0x719e('0x62')]},'attributes':['id'],'include':[{'model':db[_0x719e('0x59')],'as':_0x719e('0x64'),'attributes':['id'],'raw':!![]}]})[_0x719e('0x25')](handleEntityNotFound(_0x1d2257,null))[_0x719e('0x25')](function(_0x183a19){var _0x408b87=_[_0x719e('0x2d')](_0x183a19,'id');var _0x29b154=[];var _0x1ebeba=[];var _0x15ec78=squel[_0x719e('0x6e')]();_0x15ec78['field'](_0x719e('0x6f'))[_0x719e('0x70')](_0x719e('0x71'),'tq')[_0x719e('0x72')](_0x719e('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x719e('0x3a')]('WhatsappQueueId\x20=\x20?',_0x3e5a3d['params']['id']);for(var _0x3b69a1=0x0;_0x3b69a1<_0x183a19[_0x719e('0x47')];_0x3b69a1+=0x1){let _0x118a9c=_0x183a19[_0x3b69a1];for(var _0x2664a5=0x0;_0x2664a5<_0x118a9c[_0x719e('0x64')][_0x719e('0x47')];_0x2664a5+=0x1){let _0x15bfea=_0x118a9c[_0x719e('0x64')][_0x2664a5];var _0x49fac7=_0x15ec78[_0x719e('0x74')]();_0x49fac7[_0x719e('0x3a')](_0x719e('0x75'),_0x15bfea['id']);_0x1ebeba[_0x719e('0x76')](db['sequelize'][_0x719e('0x32')](_0x49fac7[_0x719e('0x77')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x719e('0x25')](function(_0x3d70de){if(_0x3d70de[_0x719e('0x47')]===0x1){return _0x15bfea['id'];}else{var _0x5b38a7=_[_0x719e('0x78')](_['map'](_0x3d70de,_0x719e('0x79')),function(_0x5dede8){return _[_0x719e('0x7a')](_0x408b87,_0x5dede8);});if(_0x5b38a7){return _0x15bfea['id'];}}}));}}return BPromise[_0x719e('0x7b')](_0x1ebeba)[_0x719e('0x25')](function(_0x5c79b4){_0x29b154=_(_0x29b154)['union'](_0x5c79b4)[_0x719e('0x7c')]()['value']();return db[_0x719e('0x2e')]['find']({'where':{'id':_0x3e5a3d[_0x719e('0x43')]['id']}})[_0x719e('0x25')](function(_0x3e5a18){return db[_0x719e('0x7d')][_0x719e('0x69')](function(_0x2ac6f9){return _0x3e5a18['removeTeams'](_0x3e5a3d['query'][_0x719e('0x62')],{'transaction':_0x2ac6f9})['then'](function(){if(!_[_0x719e('0x7e')](_0x29b154)){return _0x3e5a18[_0x719e('0x7f')](_0x29b154,{'transaction':_0x2ac6f9});}})[_0x719e('0x25')](function(){_0x29b154['forEach'](function(_0x15c1c5){socket[_0x719e('0x6c')](_0x719e('0x80'),{'UserId':_0x15c1c5,'WhatsappQueueId':_0x3e5a18['id']});});});});});});})[_0x719e('0x25')](respondWithStatusCode(_0x1d2257,null))[_0x719e('0x51')](handleError(_0x1d2257,null));};exports[_0x719e('0x81')]=function(_0x169880,_0x2607b0,_0x30a309){return db[_0x719e('0x2e')][_0x719e('0x48')]({'where':{'id':_0x169880['params']['id']}})[_0x719e('0x25')](handleEntityNotFound(_0x2607b0,null))['then'](function(_0x40c281){if(_0x40c281){return _0x40c281[_0x719e('0x81')](_0x169880[_0x719e('0x4a')][_0x719e('0x62')],_[_0x719e('0x82')](_0x169880[_0x719e('0x4a')],['ids','id'])||{})['spread'](function(_0x4b6903){for(var _0x385dc0=0x0;_0x385dc0<_0x169880[_0x719e('0x4a')][_0x719e('0x62')][_0x719e('0x47')];_0x385dc0+=0x1){socket[_0x719e('0x6c')](_0x719e('0x6d'),{'UserId':_0x169880[_0x719e('0x4a')]['ids'][_0x385dc0],'WhatsappQueueId':_0x169880[_0x719e('0x43')]['id']});}return _0x4b6903;});}})['then'](respondWithResult(_0x2607b0,null))[_0x719e('0x51')](handleError(_0x2607b0,null));};exports[_0x719e('0x7f')]=function(_0x29af73,_0x19be7a,_0x27a2eb){return db[_0x719e('0x2e')][_0x719e('0x48')]({'where':{'id':_0x29af73[_0x719e('0x43')]['id']}})['then'](handleEntityNotFound(_0x19be7a,null))[_0x719e('0x25')](function(_0x258132){if(_0x258132){return _0x258132['removeAgents'](_0x29af73[_0x719e('0x32')][_0x719e('0x62')])[_0x719e('0x25')](function(){if(_[_0x719e('0x83')](_0x29af73['query'][_0x719e('0x62')])){for(var _0x4c9b10=0x0;_0x4c9b10<_0x29af73[_0x719e('0x32')][_0x719e('0x62')][_0x719e('0x47')];_0x4c9b10+=0x1){socket[_0x719e('0x6c')](_0x719e('0x80'),{'UserId':Number(_0x29af73[_0x719e('0x32')][_0x719e('0x62')][_0x4c9b10]),'WhatsappQueueId':Number(_0x29af73[_0x719e('0x43')]['id'])});}}else{socket[_0x719e('0x6c')]('userWhatsappQueue:remove',{'UserId':Number(_0x29af73[_0x719e('0x32')][_0x719e('0x62')]),'WhatsappQueueId':Number(_0x29af73[_0x719e('0x43')]['id'])});}});}})[_0x719e('0x25')](respondWithStatusCode(_0x19be7a,null))['catch'](handleError(_0x19be7a,null));};exports[_0x719e('0x84')]=function(_0x19e698,_0x3c8213,_0x4df502){var _0x33b952={};var _0x2c4fd1={};var _0x709292;var _0xaa6cf9;return db[_0x719e('0x2e')][_0x719e('0x54')]({'where':{'id':_0x19e698['params']['id']}})[_0x719e('0x25')](handleEntityNotFound(_0x3c8213,null))[_0x719e('0x25')](function(_0x23bdfd){if(_0x23bdfd){_0x709292=_0x23bdfd;_0x2c4fd1[_0x719e('0x31')]=_[_0x719e('0x45')](db['User'][_0x719e('0x44')]);_0x2c4fd1[_0x719e('0x32')]=_['keys'](_0x19e698[_0x719e('0x32')]);_0x2c4fd1[_0x719e('0x33')]=_[_0x719e('0x34')](_0x2c4fd1['model'],_0x2c4fd1['query']);_0x33b952[_0x719e('0x35')]=_[_0x719e('0x34')](_0x2c4fd1['model'],qs[_0x719e('0x46')](_0x19e698['query'][_0x719e('0x46')]));_0x33b952[_0x719e('0x35')]=_0x33b952[_0x719e('0x35')][_0x719e('0x47')]?_0x33b952['attributes']:_0x2c4fd1['model'];_0x33b952['order']=qs[_0x719e('0x39')](_0x19e698[_0x719e('0x32')][_0x719e('0x39')]);_0x33b952[_0x719e('0x3a')]=qs[_0x719e('0x33')](_[_0x719e('0x3b')](_0x19e698[_0x719e('0x32')],_0x2c4fd1['filters']));if(_0x19e698[_0x719e('0x32')][_0x719e('0x3c')]){_0x33b952[_0x719e('0x3a')]=_[_0x719e('0x3d')](_0x33b952[_0x719e('0x3a')],{'$or':_[_0x719e('0x2d')](_0x33b952[_0x719e('0x35')],function(_0x42cbd3){var _0x3f2eb1={};_0x3f2eb1[_0x42cbd3]={'$like':'%'+_0x19e698['query']['filter']+'%'};return _0x3f2eb1;})});}_0x33b952=_['merge']({},_0x33b952,_0x19e698[_0x719e('0x3e')]);return _0x709292[_0x719e('0x84')](_0x33b952);}})[_0x719e('0x25')](function(_0x2b249e){if(_0x2b249e){_0xaa6cf9=_0x2b249e[_0x719e('0x47')];if(!_0x19e698[_0x719e('0x32')]['hasOwnProperty']('nolimit')){_0x33b952[_0x719e('0x56')]=qs[_0x719e('0x56')](_0x19e698['query'][_0x719e('0x56')]);_0x33b952[_0x719e('0x1e')]=qs[_0x719e('0x1e')](_0x19e698[_0x719e('0x32')][_0x719e('0x1e')]);}return _0x709292[_0x719e('0x84')](_0x33b952);}})['then'](function(_0x377182){if(_0x377182){return _0x377182?{'count':_0xaa6cf9,'rows':_0x377182}:null;}})[_0x719e('0x25')](respondWithResult(_0x3c8213,null))['catch'](handleError(_0x3c8213,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3c65ae5..9a0dcf7 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d26=['update','remove','emit','hasOwnProperty','exports','WhatsappQueue','setMaxListeners','save'];(function(_0x535357,_0x23513b){var _0x59ce9c=function(_0x17e3a7){while(--_0x17e3a7){_0x535357['push'](_0x535357['shift']());}};_0x59ce9c(++_0x23513b);}(_0x5d26,0x1e5));var _0x65d2=function(_0x9010c5,_0x1a284b){_0x9010c5=_0x9010c5-0x0;var _0x1ed623=_0x5d26[_0x9010c5];return _0x1ed623;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x65d2('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x65d2('0x1')](0x0);var events={'afterCreate':_0x65d2('0x2'),'afterUpdate':_0x65d2('0x3'),'afterDestroy':_0x65d2('0x4')};function emitEvent(_0x360d58){return function(_0x405329,_0x2cfb86,_0x15467c){WhatsappQueueEvents[_0x65d2('0x5')](_0x360d58+':'+_0x405329['id'],_0x405329);WhatsappQueueEvents[_0x65d2('0x5')](_0x360d58,_0x405329);_0x15467c(null);};}for(var e in events){if(events[_0x65d2('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x65d2('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xaad8=['events','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xef8817,_0x140adc){var _0x3098a2=function(_0x1ef414){while(--_0x1ef414){_0xef8817['push'](_0xef8817['shift']());}};_0x3098a2(++_0x140adc);}(_0xaad8,0x168));var _0x8aad=function(_0x233e90,_0x418241){_0x233e90=_0x233e90-0x0;var _0x519559=_0xaad8[_0x233e90];return _0x519559;};'use strict';var EventEmitter=require(_0x8aad('0x0'));var WhatsappQueue=require(_0x8aad('0x1'))['db'][_0x8aad('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8aad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aad('0x4'),'afterDestroy':_0x8aad('0x5')};function emitEvent(_0x11b1b4){return function(_0x11a216,_0x35b3af,_0x10ca6d){WhatsappQueueEvents[_0x8aad('0x6')](_0x11b1b4+':'+_0x11a216['id'],_0x11a216);WhatsappQueueEvents['emit'](_0x11b1b4,_0x11a216);_0x10ca6d(null);};}for(var e in events){if(events[_0x8aad('0x7')](e)){var event=events[e];WhatsappQueue[_0x8aad('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 7b99306..b8f032c 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed02=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x1f3f2c,_0x2b79f6){var _0x9efc61=function(_0x2ba1e2){while(--_0x2ba1e2){_0x1f3f2c['push'](_0x1f3f2c['shift']());}};_0x9efc61(++_0x2b79f6);}(_0xed02,0x11d));var _0x2ed0=function(_0x4d58a7,_0x3b56c7){_0x4d58a7=_0x4d58a7-0x0;var _0x22dce7=_0xed02[_0x4d58a7];return _0x22dce7;};'use strict';var _=require(_0x2ed0('0x0'));var util=require(_0x2ed0('0x1'));var logger=require(_0x2ed0('0x2'))(_0x2ed0('0x3'));var moment=require(_0x2ed0('0x4'));var BPromise=require(_0x2ed0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ed0('0x6'));var rimraf=require('rimraf');var config=require(_0x2ed0('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x2ed0('0x8')]=function(_0x27966e,_0x423f41){return _0x27966e['define'](_0x2ed0('0x9'),attributes,{'tableName':_0x2ed0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd095=['request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','bluebird'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xd095,0x1a0));var _0x5d09=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xd095[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x5d09('0x0'));var util=require(_0x5d09('0x1'));var logger=require(_0x5d09('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d09('0x3'));var rp=require(_0x5d09('0x4'));var fs=require('fs');var path=require(_0x5d09('0x5'));var rimraf=require(_0x5d09('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d09('0x7'));module[_0x5d09('0x8')]=function(_0x1adfcb,_0x41f3a8){return _0x1adfcb[_0x5d09('0x9')](_0x5d09('0xa'),attributes,{'tableName':_0x5d09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 649bc34..531e907 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ecf=['request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowWhatsappQueue','then','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x256cbf,_0x1fc046){var _0x20cfef=function(_0x3a78c1){while(--_0x3a78c1){_0x256cbf['push'](_0x256cbf['shift']());}};_0x20cfef(++_0x1fc046);}(_0x4ecf,0xef));var _0xf4ec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4ecf[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf4ec('0x0'));var util=require(_0xf4ec('0x1'));var moment=require('moment');var BPromise=require(_0xf4ec('0x2'));var rs=require(_0xf4ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf4ec('0x4'));var logger=require('../../config/logger')(_0xf4ec('0x5'));var config=require(_0xf4ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf4ec('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf4ec('0x8')](config[_0xf4ec('0x9')],{'host':_0xf4ec('0xa'),'port':0x18eb});var socket=require(_0xf4ec('0xb'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xf4ec('0xc')](socket);function respondWithRpcPromise(_0x1d1d0c,_0x6dcd0e,_0x1238c3){return new BPromise(function(_0x22c1cf,_0x103af3){return client[_0xf4ec('0xd')](_0x1d1d0c,_0x1238c3)['then'](function(_0x3736a6){logger[_0xf4ec('0xe')](_0xf4ec('0xf'),_0x6dcd0e,_0xf4ec('0x10'));logger[_0xf4ec('0x11')](_0xf4ec('0x12'),_0x6dcd0e,_0xf4ec('0x10'),JSON[_0xf4ec('0x13')](_0x3736a6));if(_0x3736a6['error']){if(_0x3736a6[_0xf4ec('0x14')][_0xf4ec('0x15')]===0x1f4){logger[_0xf4ec('0x14')](_0xf4ec('0xf'),_0x6dcd0e,_0x3736a6[_0xf4ec('0x14')][_0xf4ec('0x16')]);return _0x103af3(_0x3736a6['error'][_0xf4ec('0x16')]);}logger[_0xf4ec('0x14')](_0xf4ec('0xf'),_0x6dcd0e,_0x3736a6[_0xf4ec('0x14')][_0xf4ec('0x16')]);return _0x22c1cf(_0x3736a6[_0xf4ec('0x14')][_0xf4ec('0x16')]);}else{logger['info'](_0xf4ec('0xf'),_0x6dcd0e,_0xf4ec('0x10'));_0x22c1cf(_0x3736a6['result']['message']);}})['catch'](function(_0x42e0f8){logger['error'](_0xf4ec('0xf'),_0x6dcd0e,_0x42e0f8);_0x103af3(_0x42e0f8);});});}exports[_0xf4ec('0x17')]=function(_0x47e83d){var _0x3527a0=this;return new Promise(function(_0x4339c8,_0x128302){return db[_0xf4ec('0x18')][_0xf4ec('0x19')]({'raw':_0x47e83d[_0xf4ec('0x1a')]?_0x47e83d[_0xf4ec('0x1a')][_0xf4ec('0x1b')]===undefined?!![]:![]:!![],'where':_0x47e83d[_0xf4ec('0x1a')]?_0x47e83d[_0xf4ec('0x1a')]['where']||null:null,'attributes':_0x47e83d['options']?_0x47e83d[_0xf4ec('0x1a')][_0xf4ec('0x1c')]||null:null,'limit':_0x47e83d[_0xf4ec('0x1a')]?_0x47e83d[_0xf4ec('0x1a')][_0xf4ec('0x1d')]||null:null,'include':_0x47e83d[_0xf4ec('0x1a')]?_0x47e83d['options'][_0xf4ec('0x1e')]?_[_0xf4ec('0x1f')](_0x47e83d[_0xf4ec('0x1a')][_0xf4ec('0x1e')],function(_0x5eb418){return{'model':db[_0x5eb418[_0xf4ec('0x20')]],'as':_0x5eb418['as'],'attributes':_0x5eb418[_0xf4ec('0x1c')],'include':_0x5eb418[_0xf4ec('0x1e')]?_['map'](_0x5eb418[_0xf4ec('0x1e')],function(_0xd18034){return{'model':db[_0xd18034[_0xf4ec('0x20')]],'as':_0xd18034['as'],'attributes':_0xd18034[_0xf4ec('0x1c')],'include':_0xd18034[_0xf4ec('0x1e')]?_[_0xf4ec('0x1f')](_0xd18034[_0xf4ec('0x1e')],function(_0xccf216){return{'model':db[_0xccf216[_0xf4ec('0x20')]],'as':_0xccf216['as'],'attributes':_0xccf216[_0xf4ec('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x242094){logger[_0xf4ec('0xe')](_0xf4ec('0x17'),_0x47e83d);logger['debug'](_0xf4ec('0x17'),_0x47e83d,JSON[_0xf4ec('0x13')](_0x242094));_0x4339c8(_0x242094);})[_0xf4ec('0x21')](function(_0x52c49f){logger[_0xf4ec('0x14')](_0xf4ec('0x17'),_0x52c49f['message'],_0x47e83d);_0x128302(_0x3527a0['error'](0x1f4,_0x52c49f[_0xf4ec('0x16')]));});});};exports[_0xf4ec('0x22')]=function(_0x324f46){var _0xc46206=this;return new Promise(function(_0x11a836,_0x58e69e){return db['WhatsappQueue']['find']({'raw':_0x324f46[_0xf4ec('0x1a')]?_0x324f46['options']['raw']===undefined?!![]:![]:!![],'where':_0x324f46[_0xf4ec('0x1a')]?_0x324f46[_0xf4ec('0x1a')]['where']||null:null,'attributes':_0x324f46[_0xf4ec('0x1a')]?_0x324f46[_0xf4ec('0x1a')][_0xf4ec('0x1c')]||null:null,'include':_0x324f46[_0xf4ec('0x1a')]?_0x324f46['options'][_0xf4ec('0x1e')]?_[_0xf4ec('0x1f')](_0x324f46[_0xf4ec('0x1a')][_0xf4ec('0x1e')],function(_0x39145f){return{'model':db[_0x39145f[_0xf4ec('0x20')]],'as':_0x39145f['as'],'attributes':_0x39145f[_0xf4ec('0x1c')],'include':_0x39145f[_0xf4ec('0x1e')]?_[_0xf4ec('0x1f')](_0x39145f[_0xf4ec('0x1e')],function(_0x41c42f){return{'model':db[_0x41c42f['model']],'as':_0x41c42f['as'],'attributes':_0x41c42f[_0xf4ec('0x1c')],'include':_0x41c42f[_0xf4ec('0x1e')]?_[_0xf4ec('0x1f')](_0x41c42f['include'],function(_0x285027){return{'model':db[_0x285027[_0xf4ec('0x20')]],'as':_0x285027['as'],'attributes':_0x285027[_0xf4ec('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4ec('0x23')](function(_0x25b06b){logger[_0xf4ec('0xe')](_0xf4ec('0x22'),_0x324f46);logger['debug'](_0xf4ec('0x22'),_0x324f46,JSON[_0xf4ec('0x13')](_0x25b06b));_0x11a836(_0x25b06b);})[_0xf4ec('0x21')](function(_0xc66012){logger[_0xf4ec('0x14')](_0xf4ec('0x22'),_0xc66012[_0xf4ec('0x16')],_0x324f46);_0x58e69e(_0xc46206[_0xf4ec('0x14')](0x1f4,_0xc66012[_0xf4ec('0x16')]));});});}; \ No newline at end of file +var _0x1622=['request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowWhatsappQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1622,0x1f2));var _0x2162=function(_0x2e8fd1,_0x17377c){_0x2e8fd1=_0x2e8fd1-0x0;var _0x1d6927=_0x1622[_0x2e8fd1];return _0x1d6927;};'use strict';var _=require('lodash');var util=require(_0x2162('0x0'));var moment=require(_0x2162('0x1'));var BPromise=require(_0x2162('0x2'));var rs=require(_0x2162('0x3'));var fs=require('fs');var Redis=require(_0x2162('0x4'));var db=require(_0x2162('0x5'))['db'];var utils=require(_0x2162('0x6'));var logger=require(_0x2162('0x7'))(_0x2162('0x8'));var config=require(_0x2162('0x9'));var jayson=require(_0x2162('0xa'));var client=jayson[_0x2162('0xb')][_0x2162('0xc')]({'port':0x232a});config[_0x2162('0xd')]=_['defaults'](config['redis'],{'host':_0x2162('0xe'),'port':0x18eb});var socket=require(_0x2162('0xf'))(new Redis(config[_0x2162('0xd')]));require(_0x2162('0x10'))[_0x2162('0x11')](socket);function respondWithRpcPromise(_0x3e48cb,_0x327fcc,_0x551820){return new BPromise(function(_0xba9d2a,_0x477b0b){return client[_0x2162('0x12')](_0x3e48cb,_0x551820)[_0x2162('0x13')](function(_0x473794){logger[_0x2162('0x14')](_0x2162('0x15'),_0x327fcc,_0x2162('0x16'));logger[_0x2162('0x17')](_0x2162('0x18'),_0x327fcc,_0x2162('0x16'),JSON[_0x2162('0x19')](_0x473794));if(_0x473794[_0x2162('0x1a')]){if(_0x473794['error']['code']===0x1f4){logger['error'](_0x2162('0x15'),_0x327fcc,_0x473794[_0x2162('0x1a')][_0x2162('0x1b')]);return _0x477b0b(_0x473794[_0x2162('0x1a')][_0x2162('0x1b')]);}logger[_0x2162('0x1a')]('WhatsappQueue,\x20%s,\x20%s',_0x327fcc,_0x473794['error'][_0x2162('0x1b')]);return _0xba9d2a(_0x473794[_0x2162('0x1a')]['message']);}else{logger[_0x2162('0x14')](_0x2162('0x15'),_0x327fcc,'request\x20sent');_0xba9d2a(_0x473794[_0x2162('0x1c')][_0x2162('0x1b')]);}})[_0x2162('0x1d')](function(_0x3385ca){logger[_0x2162('0x1a')](_0x2162('0x15'),_0x327fcc,_0x3385ca);_0x477b0b(_0x3385ca);});});}exports[_0x2162('0x1e')]=function(_0x37d948){var _0x5beff3=this;return new Promise(function(_0x22d593,_0x51b926){return db[_0x2162('0x1f')][_0x2162('0x20')]({'raw':_0x37d948[_0x2162('0x21')]?_0x37d948[_0x2162('0x21')][_0x2162('0x22')]===undefined?!![]:![]:!![],'where':_0x37d948[_0x2162('0x21')]?_0x37d948[_0x2162('0x21')][_0x2162('0x23')]||null:null,'attributes':_0x37d948[_0x2162('0x21')]?_0x37d948[_0x2162('0x21')][_0x2162('0x24')]||null:null,'limit':_0x37d948[_0x2162('0x21')]?_0x37d948[_0x2162('0x21')][_0x2162('0x25')]||null:null,'include':_0x37d948[_0x2162('0x21')]?_0x37d948['options']['include']?_[_0x2162('0x26')](_0x37d948[_0x2162('0x21')][_0x2162('0x27')],function(_0x275fb2){return{'model':db[_0x275fb2[_0x2162('0x28')]],'as':_0x275fb2['as'],'attributes':_0x275fb2[_0x2162('0x24')],'include':_0x275fb2[_0x2162('0x27')]?_['map'](_0x275fb2[_0x2162('0x27')],function(_0x359cc1){return{'model':db[_0x359cc1[_0x2162('0x28')]],'as':_0x359cc1['as'],'attributes':_0x359cc1[_0x2162('0x24')],'include':_0x359cc1[_0x2162('0x27')]?_[_0x2162('0x26')](_0x359cc1['include'],function(_0x528811){return{'model':db[_0x528811[_0x2162('0x28')]],'as':_0x528811['as'],'attributes':_0x528811[_0x2162('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2162('0x13')](function(_0x826e51){logger[_0x2162('0x14')](_0x2162('0x1e'),_0x37d948);logger[_0x2162('0x17')](_0x2162('0x1e'),_0x37d948,JSON[_0x2162('0x19')](_0x826e51));_0x22d593(_0x826e51);})['catch'](function(_0x25a6e6){logger['error'](_0x2162('0x1e'),_0x25a6e6[_0x2162('0x1b')],_0x37d948);_0x51b926(_0x5beff3['error'](0x1f4,_0x25a6e6[_0x2162('0x1b')]));});});};exports['ShowWhatsappQueue']=function(_0x33bb85){var _0x4fb9af=this;return new Promise(function(_0x12e8f6,_0xc535d8){return db['WhatsappQueue'][_0x2162('0x29')]({'raw':_0x33bb85['options']?_0x33bb85['options'][_0x2162('0x22')]===undefined?!![]:![]:!![],'where':_0x33bb85['options']?_0x33bb85[_0x2162('0x21')]['where']||null:null,'attributes':_0x33bb85['options']?_0x33bb85[_0x2162('0x21')]['attributes']||null:null,'include':_0x33bb85[_0x2162('0x21')]?_0x33bb85['options']['include']?_['map'](_0x33bb85[_0x2162('0x21')][_0x2162('0x27')],function(_0x3688a7){return{'model':db[_0x3688a7['model']],'as':_0x3688a7['as'],'attributes':_0x3688a7[_0x2162('0x24')],'include':_0x3688a7['include']?_[_0x2162('0x26')](_0x3688a7[_0x2162('0x27')],function(_0x3528f5){return{'model':db[_0x3528f5[_0x2162('0x28')]],'as':_0x3528f5['as'],'attributes':_0x3528f5[_0x2162('0x24')],'include':_0x3528f5[_0x2162('0x27')]?_[_0x2162('0x26')](_0x3528f5[_0x2162('0x27')],function(_0x1079de){return{'model':db[_0x1079de[_0x2162('0x28')]],'as':_0x1079de['as'],'attributes':_0x1079de['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5a07){logger['info'](_0x2162('0x2a'),_0x33bb85);logger[_0x2162('0x17')](_0x2162('0x2a'),_0x33bb85,JSON['stringify'](_0x4e5a07));_0x12e8f6(_0x4e5a07);})[_0x2162('0x1d')](function(_0x188161){logger[_0x2162('0x1a')](_0x2162('0x2a'),_0x188161[_0x2162('0x1b')],_0x33bb85);_0xc535d8(_0x4fb9af[_0x2162('0x1a')](0x1f4,_0x188161[_0x2162('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 6bb0ea7..dcf8f19 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f79=['update','removeListener','./whatsappQueue.events','save'];(function(_0x14fc08,_0x273516){var _0x533854=function(_0xba288c){while(--_0xba288c){_0x14fc08['push'](_0x14fc08['shift']());}};_0x533854(++_0x273516);}(_0x4f79,0x1ce));var _0x94f7=function(_0x8d8a59,_0xb84752){_0x8d8a59=_0x8d8a59-0x0;var _0x4197a2=_0x4f79[_0x8d8a59];return _0x4197a2;};'use strict';var WhatsappQueueEvents=require(_0x94f7('0x0'));var events=[_0x94f7('0x1'),'remove',_0x94f7('0x2')];function createListener(_0x1d1014,_0x325467){return function(_0x388623){_0x325467['emit'](_0x1d1014,_0x388623);};}function removeListener(_0x147057,_0x41f032){return function(){WhatsappQueueEvents[_0x94f7('0x3')](_0x147057,_0x41f032);};}exports['register']=function(_0x2c7f7c){for(var _0xedddc0=0x0,_0x5a0ef5=events['length'];_0xedddc0<_0x5a0ef5;_0xedddc0++){var _0x4f7e62=events[_0xedddc0];var _0x589e54=createListener('whatsappQueue:'+_0x4f7e62,_0x2c7f7c);WhatsappQueueEvents['on'](_0x4f7e62,_0x589e54);}}; \ No newline at end of file +var _0x4086=['whatsappQueue:','./whatsappQueue.events','remove','emit','removeListener','register','length'];(function(_0x47fd45,_0x40dd67){var _0x363313=function(_0xb92163){while(--_0xb92163){_0x47fd45['push'](_0x47fd45['shift']());}};_0x363313(++_0x40dd67);}(_0x4086,0x6a));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var WhatsappQueueEvents=require(_0x6408('0x0'));var events=['save',_0x6408('0x1'),'update'];function createListener(_0x114d74,_0x4673f7){return function(_0x36efa1){_0x4673f7[_0x6408('0x2')](_0x114d74,_0x36efa1);};}function removeListener(_0x332044,_0x26b6c6){return function(){WhatsappQueueEvents[_0x6408('0x3')](_0x332044,_0x26b6c6);};}exports[_0x6408('0x4')]=function(_0x4f16f9){for(var _0x34cf07=0x0,_0xa7e9dd=events[_0x6408('0x5')];_0x34cf07<_0xa7e9dd;_0x34cf07++){var _0x5a8794=events[_0x34cf07];var _0x3069c4=createListener(_0x6408('0x6')+_0x5a8794,_0x4f16f9);WhatsappQueueEvents['on'](_0x5a8794,_0x3069c4);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 62d8a59..d6707c4 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaacd=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x45cb76,_0x4e511a){var _0x48c47a=function(_0x216591){while(--_0x216591){_0x45cb76['push'](_0x45cb76['shift']());}};_0x48c47a(++_0x4e511a);}(_0xaacd,0x1de));var _0xdaac=function(_0x19648c,_0x1ad579){_0x19648c=_0x19648c-0x0;var _0x376981=_0xaacd[_0x19648c];return _0x376981;};'use strict';var multer=require(_0xdaac('0x0'));var util=require(_0xdaac('0x1'));var path=require(_0xdaac('0x2'));var timeout=require(_0xdaac('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xdaac('0x4'));var interaction=require(_0xdaac('0x5'));var config=require(_0xdaac('0x6'));var controller=require(_0xdaac('0x7'));router[_0xdaac('0x8')]('/',auth['isAuthenticated'](),controller[_0xdaac('0x9')]);router[_0xdaac('0x8')](_0xdaac('0xa'),auth[_0xdaac('0xb')](),controller[_0xdaac('0xc')]);router['get'](_0xdaac('0xd'),auth[_0xdaac('0xb')](),controller[_0xdaac('0xe')]);router[_0xdaac('0xf')]('/',auth[_0xdaac('0xb')](),controller[_0xdaac('0x10')]);router[_0xdaac('0x11')](_0xdaac('0xd'),auth[_0xdaac('0xb')](),controller['update']);router[_0xdaac('0x12')](_0xdaac('0xd'),auth[_0xdaac('0xb')](),controller[_0xdaac('0x13')]);module['exports']=router; \ No newline at end of file +var _0x91a7=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id'];(function(_0x536a51,_0x2bf510){var _0x4a4d9e=function(_0x20deef){while(--_0x20deef){_0x536a51['push'](_0x536a51['shift']());}};_0x4a4d9e(++_0x2bf510);}(_0x91a7,0x6c));var _0x791a=function(_0x2179e2,_0x494572){_0x2179e2=_0x2179e2-0x0;var _0x2e262f=_0x91a7[_0x2179e2];return _0x2e262f;};'use strict';var multer=require(_0x791a('0x0'));var util=require(_0x791a('0x1'));var path=require(_0x791a('0x2'));var timeout=require('connect-timeout');var express=require(_0x791a('0x3'));var router=express[_0x791a('0x4')]();var auth=require(_0x791a('0x5'));var interaction=require(_0x791a('0x6'));var config=require(_0x791a('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x791a('0x8')]('/',auth[_0x791a('0x9')](),controller['index']);router[_0x791a('0x8')]('/describe',auth[_0x791a('0x9')](),controller[_0x791a('0xa')]);router[_0x791a('0x8')](_0x791a('0xb'),auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router[_0x791a('0xd')]('/',auth['isAuthenticated'](),controller[_0x791a('0xe')]);router[_0x791a('0xf')](_0x791a('0xb'),auth['isAuthenticated'](),controller[_0x791a('0x10')]);router[_0x791a('0x11')](_0x791a('0xb'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);module[_0x791a('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 7e83722..dd278a3 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x14f5b9,_0x193451){var _0x32606c=function(_0x4c0902){while(--_0x4c0902){_0x14f5b9['push'](_0x14f5b9['shift']());}};_0x32606c(++_0x193451);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x8ef6=['STRING','DATE','sequelize','exports'];(function(_0x2ee31e,_0x37affb){var _0x20eab2=function(_0x4febf0){while(--_0x4febf0){_0x2ee31e['push'](_0x2ee31e['shift']());}};_0x20eab2(++_0x37affb);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ef3f5,_0x505fbb){_0x2ef3f5=_0x2ef3f5-0x0;var _0x11c670=_0x8ef6[_0x2ef3f5];return _0x11c670;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x68ef('0x2')]},'joinAt':{'type':Sequelize[_0x68ef('0x3')]},'leaveAt':{'type':Sequelize[_0x68ef('0x3')]},'acceptAt':{'type':Sequelize[_0x68ef('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 77309a0..ad3be3e 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52a1=['intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','rows','show','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','keys'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0x52a1,0x1b7));var _0x152a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x52a1[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x152a('0x0'));var emlformat=require(_0x152a('0x1'));var rimraf=require(_0x152a('0x2'));var zipdir=require(_0x152a('0x3'));var jsonpatch=require(_0x152a('0x4'));var rp=require(_0x152a('0x5'));var moment=require(_0x152a('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x152a('0x7'));var util=require('util');var path=require(_0x152a('0x8'));var sox=require(_0x152a('0x9'));var csv=require(_0x152a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x152a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x152a('0xc'));var Papa=require(_0x152a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x152a('0xe'));var as=require(_0x152a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x152a('0x10'))(_0x152a('0x11'));var utils=require(_0x152a('0x12'));var config=require(_0x152a('0x13'));var db=require(_0x152a('0x14'))['db'];function respondWithStatusCode(_0x44120c,_0x51494a){_0x51494a=_0x51494a||0xcc;return function(_0x1554b9){if(_0x1554b9){return _0x44120c[_0x152a('0x15')](_0x51494a);}return _0x44120c[_0x152a('0x16')](_0x51494a)['end']();};}function respondWithResult(_0xa65299,_0x2f8817){_0x2f8817=_0x2f8817||0xc8;return function(_0x56bae6){if(_0x56bae6){return _0xa65299[_0x152a('0x16')](_0x2f8817)['json'](_0x56bae6);}};}function respondWithFilteredResult(_0x6e4b4f,_0x404bb8){return function(_0x1c4b71){if(_0x1c4b71){var _0x40e403=_0x1c4b71['count'],_0x1e411c=_0x404bb8[_0x152a('0x17')],_0x1ec269=_0x404bb8[_0x152a('0x17')]+_0x404bb8['limit'],_0xd1d182;if(_0x1ec269>=_0x40e403){_0x1ec269=_0x40e403;_0xd1d182=0xc8;}else{_0xd1d182=0xce;}_0x6e4b4f[_0x152a('0x16')](_0xd1d182);return _0x6e4b4f[_0x152a('0x18')](_0x152a('0x19'),_0x1e411c+'-'+_0x1ec269+'/'+_0x40e403)[_0x152a('0x1a')](_0x1c4b71);}return null;};}function patchUpdates(_0x3da410){return function(_0x12b31c){try{jsonpatch[_0x152a('0x1b')](_0x12b31c,_0x3da410,!![]);}catch(_0x5f131d){return BPromise['reject'](_0x5f131d);}return _0x12b31c[_0x152a('0x1c')]();};}function saveUpdates(_0x5285fe,_0x1d1d58){return function(_0x2b94d4){if(_0x2b94d4){return _0x2b94d4[_0x152a('0x1d')](_0x5285fe)['then'](function(_0x40af47){return _0x40af47;});}return null;};}function removeEntity(_0x3d9178,_0x5bdbf5){return function(_0x3897f9){if(_0x3897f9){return _0x3897f9['destroy']()[_0x152a('0x1e')](function(){_0x3d9178[_0x152a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b99c2,_0x5e7df4){return function(_0x3c57e3){if(!_0x3c57e3){_0x2b99c2[_0x152a('0x15')](0x194);}return _0x3c57e3;};}function handleError(_0x46cc7e,_0x40ca50){_0x40ca50=_0x40ca50||0x1f4;return function(_0x1f9d6d){logger[_0x152a('0x1f')](_0x1f9d6d[_0x152a('0x20')]);if(_0x1f9d6d[_0x152a('0x21')]){delete _0x1f9d6d[_0x152a('0x21')];}_0x46cc7e[_0x152a('0x16')](_0x40ca50)[_0x152a('0x22')](_0x1f9d6d);};}exports[_0x152a('0x23')]=function(_0x191502,_0x285b05){var _0x330566={},_0x21cc4e={},_0x15c199={'count':0x0,'rows':[]};var _0x72e542=_[_0x152a('0x24')](db[_0x152a('0x25')][_0x152a('0x26')],function(_0x47a162){return{'name':_0x47a162['fieldName'],'type':_0x47a162[_0x152a('0x27')][_0x152a('0x28')]};});_0x21cc4e[_0x152a('0x29')]=_[_0x152a('0x24')](_0x72e542,_0x152a('0x21'));_0x21cc4e[_0x152a('0x2a')]=_[_0x152a('0x2b')](_0x191502[_0x152a('0x2a')]);_0x21cc4e['filters']=_[_0x152a('0x2c')](_0x21cc4e[_0x152a('0x29')],_0x21cc4e[_0x152a('0x2a')]);_0x330566['attributes']=_['intersection'](_0x21cc4e[_0x152a('0x29')],qs[_0x152a('0x2d')](_0x191502[_0x152a('0x2a')][_0x152a('0x2d')]));_0x330566['attributes']=_0x330566[_0x152a('0x2e')][_0x152a('0x2f')]?_0x330566[_0x152a('0x2e')]:_0x21cc4e[_0x152a('0x29')];if(!_0x191502[_0x152a('0x2a')][_0x152a('0x30')]('nolimit')){_0x330566[_0x152a('0x31')]=qs[_0x152a('0x31')](_0x191502[_0x152a('0x2a')]['limit']);_0x330566[_0x152a('0x17')]=qs[_0x152a('0x17')](_0x191502[_0x152a('0x2a')][_0x152a('0x17')]);}_0x330566['order']=qs['sort'](_0x191502[_0x152a('0x2a')][_0x152a('0x32')]);_0x330566[_0x152a('0x33')]=qs[_0x152a('0x34')](_['pick'](_0x191502['query'],_0x21cc4e[_0x152a('0x34')]),_0x72e542);if(_0x191502[_0x152a('0x2a')][_0x152a('0x35')]){_0x330566[_0x152a('0x33')]=_[_0x152a('0x36')](_0x330566[_0x152a('0x33')],{'$or':_[_0x152a('0x24')](_0x72e542,function(_0x40d370){if(_0x40d370[_0x152a('0x27')]!==_0x152a('0x37')){var _0x19d23f={};_0x19d23f[_0x40d370['name']]={'$like':'%'+_0x191502[_0x152a('0x2a')][_0x152a('0x35')]+'%'};return _0x19d23f;}})});}_0x330566=_[_0x152a('0x36')]({},_0x330566,_0x191502[_0x152a('0x38')]);var _0x3a8f83={'where':_0x330566[_0x152a('0x33')]};return db[_0x152a('0x25')]['count'](_0x3a8f83)[_0x152a('0x1e')](function(_0x19425d){_0x15c199[_0x152a('0x39')]=_0x19425d;if(_0x191502['query'][_0x152a('0x3a')]){_0x330566[_0x152a('0x3b')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x330566);})[_0x152a('0x1e')](function(_0x3e286f){_0x15c199[_0x152a('0x3c')]=_0x3e286f;return _0x15c199;})[_0x152a('0x1e')](respondWithFilteredResult(_0x285b05,_0x330566))['catch'](handleError(_0x285b05,null));};exports[_0x152a('0x3d')]=function(_0x2ed3b4,_0x570daa){var _0x36d05e={'raw':!![],'where':{'id':_0x2ed3b4['params']['id']}},_0x27c02c={};_0x27c02c[_0x152a('0x29')]=_['keys'](db['WhatsappQueueReport'][_0x152a('0x26')]);_0x27c02c[_0x152a('0x2a')]=_[_0x152a('0x2b')](_0x2ed3b4[_0x152a('0x2a')]);_0x27c02c[_0x152a('0x34')]=_['intersection'](_0x27c02c[_0x152a('0x29')],_0x27c02c[_0x152a('0x2a')]);_0x36d05e[_0x152a('0x2e')]=_[_0x152a('0x2c')](_0x27c02c[_0x152a('0x29')],qs[_0x152a('0x2d')](_0x2ed3b4[_0x152a('0x2a')]['fields']));_0x36d05e[_0x152a('0x2e')]=_0x36d05e[_0x152a('0x2e')][_0x152a('0x2f')]?_0x36d05e[_0x152a('0x2e')]:_0x27c02c[_0x152a('0x29')];if(_0x2ed3b4[_0x152a('0x2a')][_0x152a('0x3a')]){_0x36d05e['include']=[{'all':!![]}];}_0x36d05e=_[_0x152a('0x36')]({},_0x36d05e,_0x2ed3b4[_0x152a('0x38')]);return db[_0x152a('0x25')][_0x152a('0x3e')](_0x36d05e)[_0x152a('0x1e')](handleEntityNotFound(_0x570daa,null))[_0x152a('0x1e')](respondWithResult(_0x570daa,null))[_0x152a('0x3f')](handleError(_0x570daa,null));};exports[_0x152a('0x40')]=function(_0x26e2e1,_0x4e346f){return db[_0x152a('0x25')][_0x152a('0x40')](_0x26e2e1[_0x152a('0x41')],{})['then'](respondWithResult(_0x4e346f,0xc9))[_0x152a('0x3f')](handleError(_0x4e346f,null));};exports[_0x152a('0x1d')]=function(_0x47582a,_0x4dd229){if(_0x47582a[_0x152a('0x41')]['id']){delete _0x47582a[_0x152a('0x41')]['id'];}return db[_0x152a('0x25')]['find']({'where':{'id':_0x47582a[_0x152a('0x42')]['id']}})[_0x152a('0x1e')](handleEntityNotFound(_0x4dd229,null))['then'](saveUpdates(_0x47582a['body'],null))[_0x152a('0x1e')](respondWithResult(_0x4dd229,null))[_0x152a('0x3f')](handleError(_0x4dd229,null));};exports[_0x152a('0x43')]=function(_0x3e382c,_0x1da015){return db[_0x152a('0x25')][_0x152a('0x3e')]({'where':{'id':_0x3e382c[_0x152a('0x42')]['id']}})['then'](handleEntityNotFound(_0x1da015,null))[_0x152a('0x1e')](removeEntity(_0x1da015,null))[_0x152a('0x3f')](handleError(_0x1da015,null));};exports[_0x152a('0x44')]=function(_0xbbd02e,_0x166a7e){return db['WhatsappQueueReport'][_0x152a('0x44')]()[_0x152a('0x1e')](respondWithResult(_0x166a7e,null))[_0x152a('0x3f')](handleError(_0x166a7e,null));}; \ No newline at end of file +var _0x9e9f=['sort','filters','pick','filter','where','merge','VIRTUAL','then','count','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','update','sendStatus','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order'];(function(_0x48a552,_0x126263){var _0x277289=function(_0x2ac14b){while(--_0x2ac14b){_0x48a552['push'](_0x48a552['shift']());}};_0x277289(++_0x126263);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x9e9f[_0x3fd3a3];return _0xa3e4d5;};'use strict';var pdf=require(_0xf9e9('0x0'));var emlformat=require(_0xf9e9('0x1'));var rimraf=require(_0xf9e9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9e9('0x3'));var moment=require(_0xf9e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf9e9('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf9e9('0x6'));var csv=require('to-csv');var ejs=require(_0xf9e9('0x7'));var fs=require('fs');var _=require(_0xf9e9('0x8'));var squel=require(_0xf9e9('0x9'));var crypto=require(_0xf9e9('0xa'));var jsforce=require(_0xf9e9('0xb'));var deskjs=require(_0xf9e9('0xc'));var toCsv=require(_0xf9e9('0xd'));var querystring=require(_0xf9e9('0xe'));var Papa=require(_0xf9e9('0xf'));var Redis=require('ioredis');var authService=require(_0xf9e9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf9e9('0x11'));var hardwareService=require(_0xf9e9('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf9e9('0x13'));var config=require('../../config/environment');var db=require(_0xf9e9('0x14'))['db'];function respondWithStatusCode(_0x499e94,_0x568de9){_0x568de9=_0x568de9||0xcc;return function(_0x1814bd){if(_0x1814bd){return _0x499e94['sendStatus'](_0x568de9);}return _0x499e94[_0xf9e9('0x15')](_0x568de9)[_0xf9e9('0x16')]();};}function respondWithResult(_0x336c8d,_0x4be565){_0x4be565=_0x4be565||0xc8;return function(_0x125f9a){if(_0x125f9a){return _0x336c8d['status'](_0x4be565)[_0xf9e9('0x17')](_0x125f9a);}};}function respondWithFilteredResult(_0x2d780d,_0x499c17){return function(_0x39713c){if(_0x39713c){var _0x4e9a6a=_0x39713c['count'],_0x411612=_0x499c17['offset'],_0x1f3bbe=_0x499c17[_0xf9e9('0x18')]+_0x499c17[_0xf9e9('0x19')],_0x463123;if(_0x1f3bbe>=_0x4e9a6a){_0x1f3bbe=_0x4e9a6a;_0x463123=0xc8;}else{_0x463123=0xce;}_0x2d780d['status'](_0x463123);return _0x2d780d[_0xf9e9('0x1a')](_0xf9e9('0x1b'),_0x411612+'-'+_0x1f3bbe+'/'+_0x4e9a6a)['json'](_0x39713c);}return null;};}function patchUpdates(_0x42fbe4){return function(_0x2e81c8){try{jsonpatch[_0xf9e9('0x1c')](_0x2e81c8,_0x42fbe4,!![]);}catch(_0x522c82){return BPromise[_0xf9e9('0x1d')](_0x522c82);}return _0x2e81c8['save']();};}function saveUpdates(_0xcb89eb,_0x49b204){return function(_0x164cfb){if(_0x164cfb){return _0x164cfb[_0xf9e9('0x1e')](_0xcb89eb)['then'](function(_0x3b786c){return _0x3b786c;});}return null;};}function removeEntity(_0x3aedb9,_0x59f36f){return function(_0x5ae605){if(_0x5ae605){return _0x5ae605['destroy']()['then'](function(){_0x3aedb9[_0xf9e9('0x15')](0xcc)[_0xf9e9('0x16')]();});}};}function handleEntityNotFound(_0x3c646b,_0xd7bc92){return function(_0x5d8941){if(!_0x5d8941){_0x3c646b[_0xf9e9('0x1f')](0x194);}return _0x5d8941;};}function handleError(_0x39b945,_0x5af98c){_0x5af98c=_0x5af98c||0x1f4;return function(_0x5459de){logger[_0xf9e9('0x20')](_0x5459de[_0xf9e9('0x21')]);if(_0x5459de[_0xf9e9('0x22')]){delete _0x5459de['name'];}_0x39b945[_0xf9e9('0x15')](_0x5af98c)[_0xf9e9('0x23')](_0x5459de);};}exports[_0xf9e9('0x24')]=function(_0x3b3358,_0x19a7d3){var _0x3ec76b={},_0x5e2aef={},_0x187e44={'count':0x0,'rows':[]};var _0x547443=_[_0xf9e9('0x25')](db[_0xf9e9('0x26')]['rawAttributes'],function(_0x2c3a16){return{'name':_0x2c3a16[_0xf9e9('0x27')],'type':_0x2c3a16[_0xf9e9('0x28')]['key']};});_0x5e2aef[_0xf9e9('0x29')]=_['map'](_0x547443,_0xf9e9('0x22'));_0x5e2aef['query']=_[_0xf9e9('0x2a')](_0x3b3358[_0xf9e9('0x2b')]);_0x5e2aef['filters']=_['intersection'](_0x5e2aef['model'],_0x5e2aef[_0xf9e9('0x2b')]);_0x3ec76b[_0xf9e9('0x2c')]=_[_0xf9e9('0x2d')](_0x5e2aef[_0xf9e9('0x29')],qs[_0xf9e9('0x2e')](_0x3b3358[_0xf9e9('0x2b')][_0xf9e9('0x2e')]));_0x3ec76b['attributes']=_0x3ec76b['attributes']['length']?_0x3ec76b[_0xf9e9('0x2c')]:_0x5e2aef['model'];if(!_0x3b3358['query'][_0xf9e9('0x2f')](_0xf9e9('0x30'))){_0x3ec76b['limit']=qs[_0xf9e9('0x19')](_0x3b3358[_0xf9e9('0x2b')][_0xf9e9('0x19')]);_0x3ec76b['offset']=qs[_0xf9e9('0x18')](_0x3b3358[_0xf9e9('0x2b')][_0xf9e9('0x18')]);}_0x3ec76b[_0xf9e9('0x31')]=qs[_0xf9e9('0x32')](_0x3b3358['query'][_0xf9e9('0x32')]);_0x3ec76b['where']=qs[_0xf9e9('0x33')](_[_0xf9e9('0x34')](_0x3b3358[_0xf9e9('0x2b')],_0x5e2aef[_0xf9e9('0x33')]),_0x547443);if(_0x3b3358['query'][_0xf9e9('0x35')]){_0x3ec76b[_0xf9e9('0x36')]=_[_0xf9e9('0x37')](_0x3ec76b['where'],{'$or':_[_0xf9e9('0x25')](_0x547443,function(_0x223fff){if(_0x223fff[_0xf9e9('0x28')]!==_0xf9e9('0x38')){var _0x6e49e0={};_0x6e49e0[_0x223fff[_0xf9e9('0x22')]]={'$like':'%'+_0x3b3358[_0xf9e9('0x2b')]['filter']+'%'};return _0x6e49e0;}})});}_0x3ec76b=_[_0xf9e9('0x37')]({},_0x3ec76b,_0x3b3358['options']);var _0x3bc363={'where':_0x3ec76b[_0xf9e9('0x36')]};return db[_0xf9e9('0x26')]['count'](_0x3bc363)[_0xf9e9('0x39')](function(_0x3e875e){_0x187e44[_0xf9e9('0x3a')]=_0x3e875e;if(_0x3b3358[_0xf9e9('0x2b')][_0xf9e9('0x3b')]){_0x3ec76b[_0xf9e9('0x3c')]=[{'all':!![]}];}return db[_0xf9e9('0x26')][_0xf9e9('0x3d')](_0x3ec76b);})['then'](function(_0x2bb55e){_0x187e44[_0xf9e9('0x3e')]=_0x2bb55e;return _0x187e44;})[_0xf9e9('0x39')](respondWithFilteredResult(_0x19a7d3,_0x3ec76b))[_0xf9e9('0x3f')](handleError(_0x19a7d3,null));};exports[_0xf9e9('0x40')]=function(_0x587d78,_0x1e26d8){var _0x456aa0={'raw':!![],'where':{'id':_0x587d78[_0xf9e9('0x41')]['id']}},_0x570bc3={};_0x570bc3[_0xf9e9('0x29')]=_[_0xf9e9('0x2a')](db[_0xf9e9('0x26')]['rawAttributes']);_0x570bc3[_0xf9e9('0x2b')]=_['keys'](_0x587d78[_0xf9e9('0x2b')]);_0x570bc3[_0xf9e9('0x33')]=_[_0xf9e9('0x2d')](_0x570bc3[_0xf9e9('0x29')],_0x570bc3[_0xf9e9('0x2b')]);_0x456aa0[_0xf9e9('0x2c')]=_[_0xf9e9('0x2d')](_0x570bc3[_0xf9e9('0x29')],qs[_0xf9e9('0x2e')](_0x587d78['query'][_0xf9e9('0x2e')]));_0x456aa0[_0xf9e9('0x2c')]=_0x456aa0['attributes'][_0xf9e9('0x42')]?_0x456aa0[_0xf9e9('0x2c')]:_0x570bc3[_0xf9e9('0x29')];if(_0x587d78[_0xf9e9('0x2b')]['includeAll']){_0x456aa0[_0xf9e9('0x3c')]=[{'all':!![]}];}_0x456aa0=_[_0xf9e9('0x37')]({},_0x456aa0,_0x587d78[_0xf9e9('0x43')]);return db[_0xf9e9('0x26')][_0xf9e9('0x44')](_0x456aa0)[_0xf9e9('0x39')](handleEntityNotFound(_0x1e26d8,null))[_0xf9e9('0x39')](respondWithResult(_0x1e26d8,null))[_0xf9e9('0x3f')](handleError(_0x1e26d8,null));};exports[_0xf9e9('0x45')]=function(_0x22d386,_0x5d4f6a){return db[_0xf9e9('0x26')]['create'](_0x22d386['body'],{})[_0xf9e9('0x39')](respondWithResult(_0x5d4f6a,0xc9))[_0xf9e9('0x3f')](handleError(_0x5d4f6a,null));};exports[_0xf9e9('0x1e')]=function(_0x32e388,_0x2156b9){if(_0x32e388[_0xf9e9('0x46')]['id']){delete _0x32e388[_0xf9e9('0x46')]['id'];}return db[_0xf9e9('0x26')][_0xf9e9('0x44')]({'where':{'id':_0x32e388[_0xf9e9('0x41')]['id']}})['then'](handleEntityNotFound(_0x2156b9,null))[_0xf9e9('0x39')](saveUpdates(_0x32e388['body'],null))['then'](respondWithResult(_0x2156b9,null))[_0xf9e9('0x3f')](handleError(_0x2156b9,null));};exports[_0xf9e9('0x47')]=function(_0x14aee6,_0x25264d){return db[_0xf9e9('0x26')][_0xf9e9('0x44')]({'where':{'id':_0x14aee6['params']['id']}})[_0xf9e9('0x39')](handleEntityNotFound(_0x25264d,null))[_0xf9e9('0x39')](removeEntity(_0x25264d,null))[_0xf9e9('0x3f')](handleError(_0x25264d,null));};exports[_0xf9e9('0x48')]=function(_0x49e1f2,_0x2adf9d){return db[_0xf9e9('0x26')][_0xf9e9('0x48')]()['then'](respondWithResult(_0x2adf9d,null))[_0xf9e9('0x3f')](handleError(_0x2adf9d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 2044f7d..bd8a437 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2143=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','api','moment','./whatsappQueueReport.attributes','exports'];(function(_0x261999,_0x15f7e8){var _0x109e04=function(_0x4c8e93){while(--_0x4c8e93){_0x261999['push'](_0x261999['shift']());}};_0x109e04(++_0x15f7e8);}(_0x2143,0x194));var _0x3214=function(_0x501c0c,_0x2b8282){_0x501c0c=_0x501c0c-0x0;var _0x296087=_0x2143[_0x501c0c];return _0x296087;};'use strict';var _=require(_0x3214('0x0'));var util=require(_0x3214('0x1'));var logger=require('../../config/logger')(_0x3214('0x2'));var moment=require(_0x3214('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('../../config/environment');var attributes=require(_0x3214('0x4'));module[_0x3214('0x5')]=function(_0x5bd6ae,_0x4374fa){return _0x5bd6ae[_0x3214('0x6')](_0x3214('0x7'),attributes,{'tableName':_0x3214('0x8'),'paranoid':![],'indexes':[{'name':_0x3214('0x9'),'fields':[_0x3214('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x114a=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger'];(function(_0x31ac15,_0x2b8d63){var _0x39101d=function(_0x4cb804){while(--_0x4cb804){_0x31ac15['push'](_0x31ac15['shift']());}};_0x39101d(++_0x2b8d63);}(_0x114a,0x1ee));var _0xa114=function(_0xa91db4,_0x464dfe){_0xa91db4=_0xa91db4-0x0;var _0x17afae=_0x114a[_0xa91db4];return _0x17afae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa114('0x0'))('api');var moment=require('moment');var BPromise=require(_0xa114('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa114('0x2'));var rimraf=require(_0xa114('0x3'));var config=require(_0xa114('0x4'));var attributes=require(_0xa114('0x5'));module[_0xa114('0x6')]=function(_0x583475,_0x2acb84){return _0x583475[_0xa114('0x7')](_0xa114('0x8'),attributes,{'tableName':_0xa114('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa114('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 01fc087..2ee9240 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x319a=['limit','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','debug','UpdateWhatsappQueueReport','update','where','attributes'];(function(_0x559d28,_0xb3ed0b){var _0x57ddfe=function(_0x2ef2e2){while(--_0x2ef2e2){_0x559d28['push'](_0x559d28['shift']());}};_0x57ddfe(++_0xb3ed0b);}(_0x319a,0x10a));var _0xa319=function(_0x4a4667,_0x272385){_0x4a4667=_0x4a4667-0x0;var _0x3d4313=_0x319a[_0x4a4667];return _0x3d4313;};'use strict';var _=require('lodash');var util=require(_0xa319('0x0'));var moment=require(_0xa319('0x1'));var BPromise=require('bluebird');var rs=require(_0xa319('0x2'));var fs=require('fs');var Redis=require(_0xa319('0x3'));var db=require(_0xa319('0x4'))['db'];var utils=require(_0xa319('0x5'));var logger=require(_0xa319('0x6'))(_0xa319('0x7'));var config=require(_0xa319('0x8'));var jayson=require(_0xa319('0x9'));var client=jayson['client'][_0xa319('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c6ceb,_0x4923c4,_0x5d7099){return new BPromise(function(_0x1190f9,_0x19756b){return client[_0xa319('0xb')](_0x3c6ceb,_0x5d7099)[_0xa319('0xc')](function(_0x4f2bb3){logger[_0xa319('0xd')](_0xa319('0xe'),_0x4923c4,_0xa319('0xf'));logger['debug'](_0xa319('0x10'),_0x4923c4,'request\x20sent',JSON['stringify'](_0x4f2bb3));if(_0x4f2bb3['error']){if(_0x4f2bb3['error'][_0xa319('0x11')]===0x1f4){logger[_0xa319('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4923c4,_0x4f2bb3[_0xa319('0x12')][_0xa319('0x13')]);return _0x19756b(_0x4f2bb3[_0xa319('0x12')][_0xa319('0x13')]);}logger[_0xa319('0x12')](_0xa319('0xe'),_0x4923c4,_0x4f2bb3['error'][_0xa319('0x13')]);return _0x1190f9(_0x4f2bb3[_0xa319('0x12')][_0xa319('0x13')]);}else{logger[_0xa319('0xd')](_0xa319('0xe'),_0x4923c4,_0xa319('0xf'));_0x1190f9(_0x4f2bb3['result']['message']);}})[_0xa319('0x14')](function(_0x5c420b){logger[_0xa319('0x12')](_0xa319('0xe'),_0x4923c4,_0x5c420b);_0x19756b(_0x5c420b);});});}exports['CreateWhatsappQueueReport']=function(_0x1a2e2b){var _0x581886=this;return new Promise(function(_0x15e877,_0x4fb3fc){return db[_0xa319('0x15')]['create'](_0x1a2e2b[_0xa319('0x16')],{'raw':_0x1a2e2b['options']?_0x1a2e2b[_0xa319('0x17')][_0xa319('0x18')]===undefined?!![]:![]:!![]})[_0xa319('0xc')](function(_0x54adf3){logger[_0xa319('0xd')](_0xa319('0x19'),_0x1a2e2b);logger[_0xa319('0x1a')](_0xa319('0x19'),_0x1a2e2b,JSON['stringify'](_0x54adf3));_0x15e877(_0x54adf3);})[_0xa319('0x14')](function(_0x11e2b6){logger[_0xa319('0x12')](_0xa319('0x19'),_0x11e2b6[_0xa319('0x13')],_0x1a2e2b);_0x4fb3fc(_0x581886[_0xa319('0x12')](0x1f4,_0x11e2b6[_0xa319('0x13')]));});});};exports[_0xa319('0x1b')]=function(_0x2a8833){var _0x17e92c=this;return new Promise(function(_0x146ef7,_0x4d3adf){return db['WhatsappQueueReport'][_0xa319('0x1c')](_0x2a8833[_0xa319('0x16')],{'raw':_0x2a8833[_0xa319('0x17')]?_0x2a8833[_0xa319('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a8833[_0xa319('0x17')]?_0x2a8833[_0xa319('0x17')][_0xa319('0x1d')]||null:null,'attributes':_0x2a8833['options']?_0x2a8833[_0xa319('0x17')][_0xa319('0x1e')]||null:null,'limit':_0x2a8833[_0xa319('0x17')]?_0x2a8833['options'][_0xa319('0x1f')]||null:null})['then'](function(_0x2f5a8d){logger[_0xa319('0xd')](_0xa319('0x1b'),_0x2a8833);logger[_0xa319('0x1a')](_0xa319('0x1b'),_0x2a8833,JSON[_0xa319('0x20')](_0x2f5a8d));_0x146ef7(_0x2f5a8d);})[_0xa319('0x14')](function(_0x1d5d37){logger[_0xa319('0x12')](_0xa319('0x1b'),_0x1d5d37['message'],_0x2a8833);_0x4d3adf(_0x17e92c[_0xa319('0x12')](0x1f4,_0x1d5d37['message']));});});}; \ No newline at end of file +var _0xcb45=['options','raw','debug','catch','UpdateWhatsappQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body'];(function(_0x36f4e7,_0x32d905){var _0x2d269d=function(_0x1bb1b7){while(--_0x1bb1b7){_0x36f4e7['push'](_0x36f4e7['shift']());}};_0x2d269d(++_0x32d905);}(_0xcb45,0x110));var _0x5cb4=function(_0x31631a,_0x3f5972){_0x31631a=_0x31631a-0x0;var _0x55ad66=_0xcb45[_0x31631a];return _0x55ad66;};'use strict';var _=require('lodash');var util=require(_0x5cb4('0x0'));var moment=require(_0x5cb4('0x1'));var BPromise=require(_0x5cb4('0x2'));var rs=require(_0x5cb4('0x3'));var fs=require('fs');var Redis=require(_0x5cb4('0x4'));var db=require(_0x5cb4('0x5'))['db'];var utils=require(_0x5cb4('0x6'));var logger=require(_0x5cb4('0x7'))(_0x5cb4('0x8'));var config=require(_0x5cb4('0x9'));var jayson=require(_0x5cb4('0xa'));var client=jayson[_0x5cb4('0xb')][_0x5cb4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bb1d6,_0x15229c,_0x7319ab){return new BPromise(function(_0x4aeca6,_0x35853d){return client['request'](_0x2bb1d6,_0x7319ab)[_0x5cb4('0xd')](function(_0x418dd2){logger[_0x5cb4('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x15229c,_0x5cb4('0xf'));logger['debug'](_0x5cb4('0x10'),_0x15229c,_0x5cb4('0xf'),JSON['stringify'](_0x418dd2));if(_0x418dd2['error']){if(_0x418dd2['error']['code']===0x1f4){logger[_0x5cb4('0x11')](_0x5cb4('0x12'),_0x15229c,_0x418dd2['error']['message']);return _0x35853d(_0x418dd2[_0x5cb4('0x11')][_0x5cb4('0x13')]);}logger[_0x5cb4('0x11')](_0x5cb4('0x12'),_0x15229c,_0x418dd2['error'][_0x5cb4('0x13')]);return _0x4aeca6(_0x418dd2[_0x5cb4('0x11')][_0x5cb4('0x13')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x15229c,'request\x20sent');_0x4aeca6(_0x418dd2[_0x5cb4('0x14')][_0x5cb4('0x13')]);}})['catch'](function(_0x5988c4){logger[_0x5cb4('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x15229c,_0x5988c4);_0x35853d(_0x5988c4);});});}exports[_0x5cb4('0x15')]=function(_0x4b403a){var _0x26c170=this;return new Promise(function(_0x2fd05c,_0x291206){return db[_0x5cb4('0x16')][_0x5cb4('0x17')](_0x4b403a[_0x5cb4('0x18')],{'raw':_0x4b403a[_0x5cb4('0x19')]?_0x4b403a[_0x5cb4('0x19')][_0x5cb4('0x1a')]===undefined?!![]:![]:!![]})[_0x5cb4('0xd')](function(_0x2fd8f3){logger[_0x5cb4('0xe')](_0x5cb4('0x15'),_0x4b403a);logger[_0x5cb4('0x1b')]('CreateWhatsappQueueReport',_0x4b403a,JSON['stringify'](_0x2fd8f3));_0x2fd05c(_0x2fd8f3);})[_0x5cb4('0x1c')](function(_0x1fd1b8){logger[_0x5cb4('0x11')](_0x5cb4('0x15'),_0x1fd1b8[_0x5cb4('0x13')],_0x4b403a);_0x291206(_0x26c170['error'](0x1f4,_0x1fd1b8['message']));});});};exports[_0x5cb4('0x1d')]=function(_0x49e167){var _0x53a036=this;return new Promise(function(_0x8f7cdb,_0x15bada){return db[_0x5cb4('0x16')][_0x5cb4('0x1e')](_0x49e167[_0x5cb4('0x18')],{'raw':_0x49e167[_0x5cb4('0x19')]?_0x49e167[_0x5cb4('0x19')][_0x5cb4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49e167[_0x5cb4('0x19')]?_0x49e167[_0x5cb4('0x19')][_0x5cb4('0x1f')]||null:null,'attributes':_0x49e167['options']?_0x49e167[_0x5cb4('0x19')]['attributes']||null:null,'limit':_0x49e167[_0x5cb4('0x19')]?_0x49e167[_0x5cb4('0x19')][_0x5cb4('0x20')]||null:null})[_0x5cb4('0xd')](function(_0x482f89){logger[_0x5cb4('0xe')]('UpdateWhatsappQueueReport',_0x49e167);logger['debug'](_0x5cb4('0x1d'),_0x49e167,JSON['stringify'](_0x482f89));_0x8f7cdb(_0x482f89);})[_0x5cb4('0x1c')](function(_0x3d8206){logger[_0x5cb4('0x11')](_0x5cb4('0x1d'),_0x3d8206['message'],_0x49e167);_0x15bada(_0x53a036[_0x5cb4('0x11')](0x1f4,_0x3d8206[_0x5cb4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d5ddbd0..b16019b 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5a7=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x1dd5d7,_0x9d1029){var _0x3fc753=function(_0x3f268f){while(--_0x3f268f){_0x1dd5d7['push'](_0x1dd5d7['shift']());}};_0x3fc753(++_0x9d1029);}(_0xf5a7,0xf5));var _0x7f5a=function(_0x198bcd,_0x39ed8f){_0x198bcd=_0x198bcd-0x0;var _0x123a33=_0xf5a7[_0x198bcd];return _0x123a33;};'use strict';var multer=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var path=require(_0x7f5a('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f5a('0x3'));var router=express[_0x7f5a('0x4')]();var auth=require(_0x7f5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7f5a('0x6'));var controller=require(_0x7f5a('0x7'));router[_0x7f5a('0x8')]('/',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0xa')]);router[_0x7f5a('0x8')](_0x7f5a('0xb'),auth[_0x7f5a('0x9')](),controller[_0x7f5a('0xc')]);router[_0x7f5a('0x8')](_0x7f5a('0xd'),auth['isAuthenticated'](),controller[_0x7f5a('0xe')]);router[_0x7f5a('0xf')]('/',auth[_0x7f5a('0x9')](),controller[_0x7f5a('0x10')]);router[_0x7f5a('0x11')](_0x7f5a('0xd'),auth[_0x7f5a('0x9')](),controller[_0x7f5a('0x12')]);router[_0x7f5a('0x13')](_0x7f5a('0xd'),auth[_0x7f5a('0x9')](),controller[_0x7f5a('0x14')]);module[_0x7f5a('0x15')]=router; \ No newline at end of file +var _0x7939=['./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','util','path','connect-timeout','express','../../config/environment'];(function(_0x9cdccf,_0x27026a){var _0x5d58b3=function(_0xa108e9){while(--_0xa108e9){_0x9cdccf['push'](_0x9cdccf['shift']());}};_0x5d58b3(++_0x27026a);}(_0x7939,0x11c));var _0x9793=function(_0x20d70e,_0x27c749){_0x20d70e=_0x20d70e-0x0;var _0x1547ea=_0x7939[_0x20d70e];return _0x1547ea;};'use strict';var multer=require('multer');var util=require(_0x9793('0x0'));var path=require(_0x9793('0x1'));var timeout=require(_0x9793('0x2'));var express=require(_0x9793('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9793('0x4'));var controller=require(_0x9793('0x5'));router[_0x9793('0x6')]('/',auth[_0x9793('0x7')](),controller[_0x9793('0x8')]);router[_0x9793('0x6')](_0x9793('0x9'),auth['isAuthenticated'](),controller[_0x9793('0xa')]);router[_0x9793('0x6')](_0x9793('0xb'),auth[_0x9793('0x7')](),controller['show']);router[_0x9793('0xc')]('/',auth['isAuthenticated'](),controller[_0x9793('0xd')]);router[_0x9793('0xe')]('/:id',auth[_0x9793('0x7')](),controller[_0x9793('0xf')]);router[_0x9793('0x10')](_0x9793('0xb'),auth[_0x9793('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 2e56754..de7ecfe 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['ENUM','account','agent','queue','exports','STRING'];(function(_0xe51757,_0x1337e1){var _0x14401e=function(_0x36f7e4){while(--_0x36f7e4){_0xe51757['push'](_0xe51757['shift']());}};_0x14401e(++_0x1337e1);}(_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')]={'uniqueid':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0baf('0x2')](_0x0baf('0x3'),_0x0baf('0x4'),_0x0baf('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb7e7=['queue','sequelize','STRING','account'];(function(_0xfcd784,_0x183965){var _0x1a4c12=function(_0x4bd4fc){while(--_0x4bd4fc){_0xfcd784['push'](_0xfcd784['shift']());}};_0x1a4c12(++_0x183965);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7b7e('0x2'),'agent',_0x7b7e('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ae2287e..b320bdf 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50ee=['WhatsappTransferReport','fieldName','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','rows','show','keys','length','include','create','catch','body','find','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x50ee,0xaf));var _0xe50e=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0x50ee[_0x386b03];return _0xd3d524;};'use strict';var pdf=require(_0xe50e('0x0'));var emlformat=require(_0xe50e('0x1'));var rimraf=require(_0xe50e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe50e('0x3'));var moment=require(_0xe50e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe50e('0x5'));var util=require(_0xe50e('0x6'));var path=require(_0xe50e('0x7'));var sox=require(_0xe50e('0x8'));var csv=require('to-csv');var ejs=require(_0xe50e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe50e('0xa'));var crypto=require(_0xe50e('0xb'));var jsforce=require(_0xe50e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe50e('0xd'));var querystring=require(_0xe50e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe50e('0xf'));var as=require(_0xe50e('0x10'));var hardwareService=require(_0xe50e('0x11'));var logger=require(_0xe50e('0x12'))(_0xe50e('0x13'));var utils=require(_0xe50e('0x14'));var config=require(_0xe50e('0x15'));var db=require(_0xe50e('0x16'))['db'];function respondWithStatusCode(_0x3b409f,_0x9e016b){_0x9e016b=_0x9e016b||0xcc;return function(_0x3858b4){if(_0x3858b4){return _0x3b409f[_0xe50e('0x17')](_0x9e016b);}return _0x3b409f[_0xe50e('0x18')](_0x9e016b)[_0xe50e('0x19')]();};}function respondWithResult(_0x4773a6,_0x41dd4d){_0x41dd4d=_0x41dd4d||0xc8;return function(_0x38b65e){if(_0x38b65e){return _0x4773a6[_0xe50e('0x18')](_0x41dd4d)['json'](_0x38b65e);}};}function respondWithFilteredResult(_0x3ae4f9,_0x178b87){return function(_0x18827e){if(_0x18827e){var _0x228898=_0x18827e[_0xe50e('0x1a')],_0x1e0729=_0x178b87[_0xe50e('0x1b')],_0x2ade80=_0x178b87['offset']+_0x178b87['limit'],_0x2b435d;if(_0x2ade80>=_0x228898){_0x2ade80=_0x228898;_0x2b435d=0xc8;}else{_0x2b435d=0xce;}_0x3ae4f9['status'](_0x2b435d);return _0x3ae4f9[_0xe50e('0x1c')]('Content-Range',_0x1e0729+'-'+_0x2ade80+'/'+_0x228898)[_0xe50e('0x1d')](_0x18827e);}return null;};}function patchUpdates(_0x200e6a){return function(_0x2164b8){try{jsonpatch[_0xe50e('0x1e')](_0x2164b8,_0x200e6a,!![]);}catch(_0x4b924e){return BPromise[_0xe50e('0x1f')](_0x4b924e);}return _0x2164b8[_0xe50e('0x20')]();};}function saveUpdates(_0x59eaac,_0x563c6b){return function(_0x19939e){if(_0x19939e){return _0x19939e[_0xe50e('0x21')](_0x59eaac)[_0xe50e('0x22')](function(_0x50ec85){return _0x50ec85;});}return null;};}function removeEntity(_0x419963,_0x44ca22){return function(_0x296d32){if(_0x296d32){return _0x296d32[_0xe50e('0x23')]()['then'](function(){_0x419963['status'](0xcc)[_0xe50e('0x19')]();});}};}function handleEntityNotFound(_0x5370f1,_0x89e459){return function(_0x3d0e22){if(!_0x3d0e22){_0x5370f1[_0xe50e('0x17')](0x194);}return _0x3d0e22;};}function handleError(_0x422546,_0x1fd177){_0x1fd177=_0x1fd177||0x1f4;return function(_0x513528){logger[_0xe50e('0x24')](_0x513528['stack']);if(_0x513528['name']){delete _0x513528[_0xe50e('0x25')];}_0x422546[_0xe50e('0x18')](_0x1fd177)[_0xe50e('0x26')](_0x513528);};}exports[_0xe50e('0x27')]=function(_0x318681,_0x36efed){var _0xb5d198={},_0x24c30c={},_0x164f5e={'count':0x0,'rows':[]};var _0x4fbc20=_[_0xe50e('0x28')](db[_0xe50e('0x29')]['rawAttributes'],function(_0x410135){return{'name':_0x410135[_0xe50e('0x2a')],'type':_0x410135['type'][_0xe50e('0x2b')]};});_0x24c30c['model']=_[_0xe50e('0x28')](_0x4fbc20,_0xe50e('0x25'));_0x24c30c[_0xe50e('0x2c')]=_['keys'](_0x318681[_0xe50e('0x2c')]);_0x24c30c[_0xe50e('0x2d')]=_[_0xe50e('0x2e')](_0x24c30c[_0xe50e('0x2f')],_0x24c30c[_0xe50e('0x2c')]);_0xb5d198['attributes']=_['intersection'](_0x24c30c[_0xe50e('0x2f')],qs['fields'](_0x318681[_0xe50e('0x2c')][_0xe50e('0x30')]));_0xb5d198['attributes']=_0xb5d198[_0xe50e('0x31')]['length']?_0xb5d198[_0xe50e('0x31')]:_0x24c30c[_0xe50e('0x2f')];if(!_0x318681[_0xe50e('0x2c')][_0xe50e('0x32')](_0xe50e('0x33'))){_0xb5d198['limit']=qs['limit'](_0x318681[_0xe50e('0x2c')]['limit']);_0xb5d198[_0xe50e('0x1b')]=qs[_0xe50e('0x1b')](_0x318681[_0xe50e('0x2c')]['offset']);}_0xb5d198[_0xe50e('0x34')]=qs[_0xe50e('0x35')](_0x318681['query'][_0xe50e('0x35')]);_0xb5d198[_0xe50e('0x36')]=qs['filters'](_['pick'](_0x318681['query'],_0x24c30c[_0xe50e('0x2d')]),_0x4fbc20);if(_0x318681['query'][_0xe50e('0x37')]){_0xb5d198['where']=_[_0xe50e('0x38')](_0xb5d198[_0xe50e('0x36')],{'$or':_['map'](_0x4fbc20,function(_0x3b5590){if(_0x3b5590[_0xe50e('0x39')]!==_0xe50e('0x3a')){var _0x131c39={};_0x131c39[_0x3b5590[_0xe50e('0x25')]]={'$like':'%'+_0x318681[_0xe50e('0x2c')][_0xe50e('0x37')]+'%'};return _0x131c39;}})});}_0xb5d198=_[_0xe50e('0x38')]({},_0xb5d198,_0x318681[_0xe50e('0x3b')]);var _0xf7f6b0={'where':_0xb5d198[_0xe50e('0x36')]};return db[_0xe50e('0x29')][_0xe50e('0x1a')](_0xf7f6b0)['then'](function(_0x2420e6){_0x164f5e[_0xe50e('0x1a')]=_0x2420e6;if(_0x318681[_0xe50e('0x2c')][_0xe50e('0x3c')]){_0xb5d198['include']=[{'all':!![]}];}return db[_0xe50e('0x29')]['findAll'](_0xb5d198);})[_0xe50e('0x22')](function(_0x2bd149){_0x164f5e[_0xe50e('0x3d')]=_0x2bd149;return _0x164f5e;})['then'](respondWithFilteredResult(_0x36efed,_0xb5d198))['catch'](handleError(_0x36efed,null));};exports[_0xe50e('0x3e')]=function(_0x363556,_0x19a22d){var _0x2c6017={'raw':!![],'where':{'id':_0x363556['params']['id']}},_0x4fc845={};_0x4fc845[_0xe50e('0x2f')]=_[_0xe50e('0x3f')](db['WhatsappTransferReport']['rawAttributes']);_0x4fc845[_0xe50e('0x2c')]=_[_0xe50e('0x3f')](_0x363556[_0xe50e('0x2c')]);_0x4fc845[_0xe50e('0x2d')]=_[_0xe50e('0x2e')](_0x4fc845[_0xe50e('0x2f')],_0x4fc845[_0xe50e('0x2c')]);_0x2c6017[_0xe50e('0x31')]=_[_0xe50e('0x2e')](_0x4fc845[_0xe50e('0x2f')],qs[_0xe50e('0x30')](_0x363556[_0xe50e('0x2c')]['fields']));_0x2c6017[_0xe50e('0x31')]=_0x2c6017[_0xe50e('0x31')][_0xe50e('0x40')]?_0x2c6017['attributes']:_0x4fc845[_0xe50e('0x2f')];if(_0x363556[_0xe50e('0x2c')]['includeAll']){_0x2c6017[_0xe50e('0x41')]=[{'all':!![]}];}_0x2c6017=_[_0xe50e('0x38')]({},_0x2c6017,_0x363556[_0xe50e('0x3b')]);return db[_0xe50e('0x29')]['find'](_0x2c6017)[_0xe50e('0x22')](handleEntityNotFound(_0x19a22d,null))[_0xe50e('0x22')](respondWithResult(_0x19a22d,null))['catch'](handleError(_0x19a22d,null));};exports['create']=function(_0x5c41d4,_0x3e8abe){return db['WhatsappTransferReport'][_0xe50e('0x42')](_0x5c41d4['body'],{})['then'](respondWithResult(_0x3e8abe,0xc9))[_0xe50e('0x43')](handleError(_0x3e8abe,null));};exports[_0xe50e('0x21')]=function(_0x1693b0,_0x32c990){if(_0x1693b0['body']['id']){delete _0x1693b0[_0xe50e('0x44')]['id'];}return db[_0xe50e('0x29')][_0xe50e('0x45')]({'where':{'id':_0x1693b0[_0xe50e('0x46')]['id']}})[_0xe50e('0x22')](handleEntityNotFound(_0x32c990,null))[_0xe50e('0x22')](saveUpdates(_0x1693b0['body'],null))[_0xe50e('0x22')](respondWithResult(_0x32c990,null))[_0xe50e('0x43')](handleError(_0x32c990,null));};exports[_0xe50e('0x23')]=function(_0xfcb83,_0x305aaf){return db[_0xe50e('0x29')][_0xe50e('0x45')]({'where':{'id':_0xfcb83['params']['id']}})['then'](handleEntityNotFound(_0x305aaf,null))[_0xe50e('0x22')](removeEntity(_0x305aaf,null))['catch'](handleError(_0x305aaf,null));};exports[_0xe50e('0x47')]=function(_0x104056,_0x49e4f9){return db['WhatsappTransferReport'][_0xe50e('0x47')]()[_0xe50e('0x22')](respondWithResult(_0x49e4f9,null))['catch'](handleError(_0x49e4f9,null));}; \ No newline at end of file +var _0x6d4d=['options','includeAll','include','findAll','rows','show','params','length','find','catch','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x1a1104,_0x54a5ba){var _0x4f8717=function(_0x40c462){while(--_0x40c462){_0x1a1104['push'](_0x1a1104['shift']());}};_0x4f8717(++_0x54a5ba);}(_0x6d4d,0xec));var _0xd6d4=function(_0x7e0581,_0x17fbb6){_0x7e0581=_0x7e0581-0x0;var _0x26314b=_0x6d4d[_0x7e0581];return _0x26314b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd6d4('0x0'));var zipdir=require(_0xd6d4('0x1'));var jsonpatch=require(_0xd6d4('0x2'));var rp=require(_0xd6d4('0x3'));var moment=require(_0xd6d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6d4('0x5'));var util=require('util');var path=require(_0xd6d4('0x6'));var sox=require(_0xd6d4('0x7'));var csv=require(_0xd6d4('0x8'));var ejs=require(_0xd6d4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd6d4('0xa'));var crypto=require(_0xd6d4('0xb'));var jsforce=require(_0xd6d4('0xc'));var deskjs=require(_0xd6d4('0xd'));var toCsv=require(_0xd6d4('0x8'));var querystring=require(_0xd6d4('0xe'));var Papa=require(_0xd6d4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd6d4('0x10'));var as=require(_0xd6d4('0x11'));var hardwareService=require(_0xd6d4('0x12'));var logger=require(_0xd6d4('0x13'))('api');var utils=require(_0xd6d4('0x14'));var config=require(_0xd6d4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455ef6,_0x5973c3){_0x5973c3=_0x5973c3||0xcc;return function(_0xc43a7e){if(_0xc43a7e){return _0x455ef6[_0xd6d4('0x16')](_0x5973c3);}return _0x455ef6[_0xd6d4('0x17')](_0x5973c3)[_0xd6d4('0x18')]();};}function respondWithResult(_0x5d03e8,_0x180b63){_0x180b63=_0x180b63||0xc8;return function(_0x5058a5){if(_0x5058a5){return _0x5d03e8[_0xd6d4('0x17')](_0x180b63)[_0xd6d4('0x19')](_0x5058a5);}};}function respondWithFilteredResult(_0x132b04,_0x4bb9b9){return function(_0x20f35b){if(_0x20f35b){var _0x128950=_0x20f35b[_0xd6d4('0x1a')],_0x30f9de=_0x4bb9b9['offset'],_0x4310fb=_0x4bb9b9[_0xd6d4('0x1b')]+_0x4bb9b9[_0xd6d4('0x1c')],_0x34267e;if(_0x4310fb>=_0x128950){_0x4310fb=_0x128950;_0x34267e=0xc8;}else{_0x34267e=0xce;}_0x132b04[_0xd6d4('0x17')](_0x34267e);return _0x132b04[_0xd6d4('0x1d')](_0xd6d4('0x1e'),_0x30f9de+'-'+_0x4310fb+'/'+_0x128950)[_0xd6d4('0x19')](_0x20f35b);}return null;};}function patchUpdates(_0x16fe42){return function(_0x61391f){try{jsonpatch[_0xd6d4('0x1f')](_0x61391f,_0x16fe42,!![]);}catch(_0x325acd){return BPromise[_0xd6d4('0x20')](_0x325acd);}return _0x61391f[_0xd6d4('0x21')]();};}function saveUpdates(_0x111a7f,_0xb7f7f8){return function(_0x477c33){if(_0x477c33){return _0x477c33['update'](_0x111a7f)[_0xd6d4('0x22')](function(_0xc493c1){return _0xc493c1;});}return null;};}function removeEntity(_0xdbc0b5,_0x1f69c9){return function(_0x55e170){if(_0x55e170){return _0x55e170['destroy']()[_0xd6d4('0x22')](function(){_0xdbc0b5[_0xd6d4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452f42,_0x1d0a62){return function(_0x1c1a19){if(!_0x1c1a19){_0x452f42[_0xd6d4('0x16')](0x194);}return _0x1c1a19;};}function handleError(_0x162f56,_0x1cf22a){_0x1cf22a=_0x1cf22a||0x1f4;return function(_0x47b6f1){logger['error'](_0x47b6f1[_0xd6d4('0x23')]);if(_0x47b6f1[_0xd6d4('0x24')]){delete _0x47b6f1[_0xd6d4('0x24')];}_0x162f56[_0xd6d4('0x17')](_0x1cf22a)[_0xd6d4('0x25')](_0x47b6f1);};}exports[_0xd6d4('0x26')]=function(_0x9b5ec3,_0x25007d){var _0x112a56={},_0x2e68f7={},_0x22a910={'count':0x0,'rows':[]};var _0x437df7=_[_0xd6d4('0x27')](db[_0xd6d4('0x28')][_0xd6d4('0x29')],function(_0x3d93e4){return{'name':_0x3d93e4['fieldName'],'type':_0x3d93e4[_0xd6d4('0x2a')][_0xd6d4('0x2b')]};});_0x2e68f7[_0xd6d4('0x2c')]=_['map'](_0x437df7,_0xd6d4('0x24'));_0x2e68f7['query']=_[_0xd6d4('0x2d')](_0x9b5ec3[_0xd6d4('0x2e')]);_0x2e68f7[_0xd6d4('0x2f')]=_[_0xd6d4('0x30')](_0x2e68f7['model'],_0x2e68f7[_0xd6d4('0x2e')]);_0x112a56['attributes']=_[_0xd6d4('0x30')](_0x2e68f7[_0xd6d4('0x2c')],qs[_0xd6d4('0x31')](_0x9b5ec3[_0xd6d4('0x2e')]['fields']));_0x112a56[_0xd6d4('0x32')]=_0x112a56[_0xd6d4('0x32')]['length']?_0x112a56[_0xd6d4('0x32')]:_0x2e68f7[_0xd6d4('0x2c')];if(!_0x9b5ec3[_0xd6d4('0x2e')][_0xd6d4('0x33')](_0xd6d4('0x34'))){_0x112a56['limit']=qs[_0xd6d4('0x1c')](_0x9b5ec3['query'][_0xd6d4('0x1c')]);_0x112a56['offset']=qs[_0xd6d4('0x1b')](_0x9b5ec3['query'][_0xd6d4('0x1b')]);}_0x112a56[_0xd6d4('0x35')]=qs['sort'](_0x9b5ec3[_0xd6d4('0x2e')][_0xd6d4('0x36')]);_0x112a56[_0xd6d4('0x37')]=qs[_0xd6d4('0x2f')](_[_0xd6d4('0x38')](_0x9b5ec3['query'],_0x2e68f7[_0xd6d4('0x2f')]),_0x437df7);if(_0x9b5ec3[_0xd6d4('0x2e')][_0xd6d4('0x39')]){_0x112a56[_0xd6d4('0x37')]=_['merge'](_0x112a56[_0xd6d4('0x37')],{'$or':_[_0xd6d4('0x27')](_0x437df7,function(_0x1144f9){if(_0x1144f9[_0xd6d4('0x2a')]!==_0xd6d4('0x3a')){var _0x4549b0={};_0x4549b0[_0x1144f9[_0xd6d4('0x24')]]={'$like':'%'+_0x9b5ec3[_0xd6d4('0x2e')]['filter']+'%'};return _0x4549b0;}})});}_0x112a56=_[_0xd6d4('0x3b')]({},_0x112a56,_0x9b5ec3[_0xd6d4('0x3c')]);var _0x573b4d={'where':_0x112a56[_0xd6d4('0x37')]};return db[_0xd6d4('0x28')][_0xd6d4('0x1a')](_0x573b4d)['then'](function(_0x50bdda){_0x22a910[_0xd6d4('0x1a')]=_0x50bdda;if(_0x9b5ec3[_0xd6d4('0x2e')][_0xd6d4('0x3d')]){_0x112a56[_0xd6d4('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xd6d4('0x3f')](_0x112a56);})[_0xd6d4('0x22')](function(_0x17d443){_0x22a910[_0xd6d4('0x40')]=_0x17d443;return _0x22a910;})['then'](respondWithFilteredResult(_0x25007d,_0x112a56))['catch'](handleError(_0x25007d,null));};exports[_0xd6d4('0x41')]=function(_0x11faaf,_0x252e54){var _0x2fd027={'raw':!![],'where':{'id':_0x11faaf[_0xd6d4('0x42')]['id']}},_0x20e32b={};_0x20e32b[_0xd6d4('0x2c')]=_[_0xd6d4('0x2d')](db['WhatsappTransferReport'][_0xd6d4('0x29')]);_0x20e32b[_0xd6d4('0x2e')]=_[_0xd6d4('0x2d')](_0x11faaf[_0xd6d4('0x2e')]);_0x20e32b[_0xd6d4('0x2f')]=_[_0xd6d4('0x30')](_0x20e32b[_0xd6d4('0x2c')],_0x20e32b[_0xd6d4('0x2e')]);_0x2fd027[_0xd6d4('0x32')]=_['intersection'](_0x20e32b[_0xd6d4('0x2c')],qs[_0xd6d4('0x31')](_0x11faaf[_0xd6d4('0x2e')][_0xd6d4('0x31')]));_0x2fd027['attributes']=_0x2fd027[_0xd6d4('0x32')][_0xd6d4('0x43')]?_0x2fd027[_0xd6d4('0x32')]:_0x20e32b[_0xd6d4('0x2c')];if(_0x11faaf[_0xd6d4('0x2e')][_0xd6d4('0x3d')]){_0x2fd027[_0xd6d4('0x3e')]=[{'all':!![]}];}_0x2fd027=_[_0xd6d4('0x3b')]({},_0x2fd027,_0x11faaf[_0xd6d4('0x3c')]);return db[_0xd6d4('0x28')][_0xd6d4('0x44')](_0x2fd027)[_0xd6d4('0x22')](handleEntityNotFound(_0x252e54,null))[_0xd6d4('0x22')](respondWithResult(_0x252e54,null))[_0xd6d4('0x45')](handleError(_0x252e54,null));};exports['create']=function(_0x32b02a,_0x52d1c2){return db[_0xd6d4('0x28')]['create'](_0x32b02a[_0xd6d4('0x46')],{})['then'](respondWithResult(_0x52d1c2,0xc9))['catch'](handleError(_0x52d1c2,null));};exports[_0xd6d4('0x47')]=function(_0x1f2265,_0x41901d){if(_0x1f2265[_0xd6d4('0x46')]['id']){delete _0x1f2265[_0xd6d4('0x46')]['id'];}return db[_0xd6d4('0x28')]['find']({'where':{'id':_0x1f2265[_0xd6d4('0x42')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x41901d,null))[_0xd6d4('0x22')](saveUpdates(_0x1f2265[_0xd6d4('0x46')],null))[_0xd6d4('0x22')](respondWithResult(_0x41901d,null))[_0xd6d4('0x45')](handleError(_0x41901d,null));};exports[_0xd6d4('0x48')]=function(_0x39cc18,_0x31919d){return db['WhatsappTransferReport']['find']({'where':{'id':_0x39cc18[_0xd6d4('0x42')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x31919d,null))[_0xd6d4('0x22')](removeEntity(_0x31919d,null))[_0xd6d4('0x45')](handleError(_0x31919d,null));};exports['describe']=function(_0x4435dd,_0x2f85ec){return db[_0xd6d4('0x28')][_0xd6d4('0x49')]()[_0xd6d4('0x22')](respondWithResult(_0x2f85ec,null))[_0xd6d4('0x45')](handleError(_0x2f85ec,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 258c865..bbe2cfa 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf38=['request-promise','path','rimraf','../../config/environment','WhatsappTransferReport','uniqueid','lodash','api','moment'];(function(_0x1ae8d2,_0x542702){var _0x20f63d=function(_0x1ff174){while(--_0x1ff174){_0x1ae8d2['push'](_0x1ae8d2['shift']());}};_0x20f63d(++_0x542702);}(_0xbf38,0x96));var _0x8bf3=function(_0x174e66,_0x3ef28d){_0x174e66=_0x174e66-0x0;var _0x1d3a43=_0xbf38[_0x174e66];return _0x1d3a43;};'use strict';var _=require(_0x8bf3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8bf3('0x1'));var moment=require(_0x8bf3('0x2'));var BPromise=require('bluebird');var rp=require(_0x8bf3('0x3'));var fs=require('fs');var path=require(_0x8bf3('0x4'));var rimraf=require(_0x8bf3('0x5'));var config=require(_0x8bf3('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x525f96,_0x5c27df){return _0x525f96['define'](_0x8bf3('0x7'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x8bf3('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe542=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf','exports'];(function(_0x26b308,_0x397dfc){var _0x59478d=function(_0x20b4c4){while(--_0x20b4c4){_0x26b308['push'](_0x26b308['shift']());}};_0x59478d(++_0x397dfc);}(_0xe542,0xa9));var _0x2e54=function(_0x2173b2,_0x4cb78b){_0x2173b2=_0x2173b2-0x0;var _0x2d11df=_0xe542[_0x2173b2];return _0x2d11df;};'use strict';var _=require(_0x2e54('0x0'));var util=require(_0x2e54('0x1'));var logger=require(_0x2e54('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e54('0x3'));var fs=require('fs');var path=require(_0x2e54('0x4'));var rimraf=require(_0x2e54('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x2e54('0x6')]=function(_0x414fd3,_0x3128b9){return _0x414fd3[_0x2e54('0x7')](_0x2e54('0x8'),attributes,{'tableName':_0x2e54('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2e54('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b7d5845..cb154ac 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x1ec669,_0x118209){var _0x1ea564=function(_0xe939d0){while(--_0xe939d0){_0x1ec669['push'](_0x1ec669['shift']());}};_0x1ea564(++_0x118209);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x477c8c,_0x240e9e){var _0x1c8c0c=function(_0x92342d){while(--_0x92342d){_0x477c8c['push'](_0x477c8c['shift']());}};_0x1c8c0c(++_0x240e9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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/app.js b/server/app.js index e238796..afcecbb 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c52=['Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','online','None','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','start','info'];(function(_0x81604e,_0xe54af9){var _0x13e7ed=function(_0x256016){while(--_0x256016){_0x81604e['push'](_0x81604e['shift']());}};_0x13e7ed(++_0xe54af9);}(_0x1c52,0xb6));var _0x21c5=function(_0x4df299,_0x155212){_0x4df299=_0x4df299-0x0;var _0x2aa0ba=_0x1c52[_0x4df299];return _0x2aa0ba;};'use strict';var _=require(_0x21c5('0x0'));var mysqldb=require(_0x21c5('0x1'));var rpc=require(_0x21c5('0x2'));var config=require(_0x21c5('0x3'));var logger=require('./config/logger')(_0x21c5('0x4'));var pm2=require(_0x21c5('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x21c5('0x6'));var chat=require(_0x21c5('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x21c5('0x8')][_0x21c5('0x9')]()[_0x21c5('0xa')](function(){return rpc[_0x21c5('0xb')]();})['then'](function(_0x311889){logger['info'](_0x311889);return chat[_0x21c5('0xc')]();})[_0x21c5('0xa')](function(){return schedule[_0x21c5('0xc')]();})[_0x21c5('0xa')](function(){return transcribe[_0x21c5('0xc')]();})['then'](function(_0x2cf9ab){logger[_0x21c5('0xd')](_0x2cf9ab);return pm2[_0x21c5('0xc')](pm2Config);})[_0x21c5('0xa')](function(_0x431da5){logger[_0x21c5('0xd')](_0x21c5('0xe'),_[_0x21c5('0xf')](_[_0x21c5('0x10')](_0x431da5,{'status':'online'}),_0x21c5('0x11'))[_0x21c5('0x12')]());logger['info'](_0x21c5('0x13'),_[_0x21c5('0xf')](_['filter'](_0x431da5,function(_0x579dd5){return _0x579dd5[_0x21c5('0x14')]!==_0x21c5('0x15');}),'name')[_0x21c5('0x12')]()||_0x21c5('0x16'));config['seedDB']&&require(_0x21c5('0x17'))[_0x21c5('0x18')]();require('./config/license')[_0x21c5('0x18')]();})['catch'](function(_0x4ad709){logger[_0x21c5('0x19')](_0x21c5('0x1a'),_0x4ad709);process[_0x21c5('0x1b')](0x1);});}main(); \ No newline at end of file +var _0xc645=['catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','name','seedDB','./config/seedDB','./config/license','default'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc645,0x126));var _0x5c64=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc645[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x5c64('0x0'));var mysqldb=require(_0x5c64('0x1'));var rpc=require(_0x5c64('0x2'));var config=require(_0x5c64('0x3'));var logger=require(_0x5c64('0x4'))(_0x5c64('0x5'));var pm2=require(_0x5c64('0x6'));var pm2Config=require(_0x5c64('0x7'));var schedule=require(_0x5c64('0x8'));var chat=require('./config/schedule/chat');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x5c64('0x9')]['sync']()[_0x5c64('0xa')](function(){return rpc['listen']();})[_0x5c64('0xa')](function(_0x4df490){logger[_0x5c64('0xb')](_0x4df490);return chat[_0x5c64('0xc')]();})[_0x5c64('0xa')](function(){return schedule[_0x5c64('0xc')]();})[_0x5c64('0xa')](function(){return transcribe['start']();})['then'](function(_0x3e8502){logger['info'](_0x3e8502);return pm2[_0x5c64('0xc')](pm2Config);})['then'](function(_0x12b0a6){logger[_0x5c64('0xb')](_0x5c64('0xd'),_[_0x5c64('0xe')](_[_0x5c64('0xf')](_0x12b0a6,{'status':_0x5c64('0x10')}),'name')[_0x5c64('0x11')]());logger['info'](_0x5c64('0x12'),_['map'](_['filter'](_0x12b0a6,function(_0x568ef5){return _0x568ef5[_0x5c64('0x13')]!==_0x5c64('0x10');}),_0x5c64('0x14'))[_0x5c64('0x11')]()||'None');config[_0x5c64('0x15')]&&require(_0x5c64('0x16'))['default']();require(_0x5c64('0x17'))[_0x5c64('0x18')]();})[_0x5c64('0x19')](function(_0x2a161c){logger[_0x5c64('0x1a')](_0x5c64('0x1b'),_0x2a161c);process[_0x5c64('0x1c')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 63e178b..1926f26 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 _0x2c60=['apikey','sub','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','status','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','secret','session','payload','options','promisify','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','role','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','closed','disposition','then','json','unmanaged','Unmanaged.','Forbidden.','catch','use','authorization','headers','Basic','User','find','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid'];(function(_0x50df09,_0x39298e){var _0x3a2872=function(_0x5b4119){while(--_0x5b4119){_0x50df09['push'](_0x50df09['shift']());}};_0x3a2872(++_0x39298e);}(_0x2c60,0x1b0));var _0x02c6=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x2c60[_0x2b7764];return _0x848dcb;};'use strict';var db=require(_0x02c6('0x0'))['db'];var config=require(_0x02c6('0x1'));var hardwareConf=require(_0x02c6('0x2'));var _=require(_0x02c6('0x3'));var jwt=require(_0x02c6('0x4'));var expressJwt=require(_0x02c6('0x5'));var compose=require(_0x02c6('0x6'));var basicAuth=require(_0x02c6('0x7'));var crypto=require(_0x02c6('0x8'));var BPromise=require(_0x02c6('0x9'));var validateJwt=expressJwt({'secret':config[_0x02c6('0xa')]['session']});var userAttributes=['id',_0x02c6('0xb'),'fullname',_0x02c6('0xc'),_0x02c6('0xd'),_0x02c6('0xe'),_0x02c6('0xf'),_0x02c6('0x10'),'md5secret',_0x02c6('0x11'),_0x02c6('0x12'),_0x02c6('0x13'),_0x02c6('0x14'),_0x02c6('0x15'),_0x02c6('0x16'),_0x02c6('0x17'),_0x02c6('0x18'),_0x02c6('0x19'),_0x02c6('0x1a'),_0x02c6('0x1b'),_0x02c6('0x1c'),_0x02c6('0x1d'),_0x02c6('0x1e'),_0x02c6('0x1f'),'phoneBarAutoAnswerDelay',_0x02c6('0x20'),_0x02c6('0x21'),'phoneBarEnableDtmfTone',_0x02c6('0x22'),_0x02c6('0x23'),_0x02c6('0x24'),_0x02c6('0x25'),_0x02c6('0x26'),_0x02c6('0x27'),_0x02c6('0x28'),'userProfileId'];exports[_0x02c6('0x29')]=function(){return this[_0x02c6('0x2a')](!![])['use'](function(_0x36690e,_0xb696a0,_0x22d5cf){if(_0x36690e[_0x02c6('0x2b')]){_0x22d5cf();}else{return db[_0x02c6('0x2c')][_0x02c6('0x2d')]({'where':{'id':_0x36690e['params']['id']},'attributes':['id',_0x02c6('0x2e'),_0x02c6('0x2f')],'raw':!![]})[_0x02c6('0x30')](function(_0x2fbb52){if(_0x2fbb52&&_0x2fbb52[_0x02c6('0x2e')]){return _0xb696a0['status'](_0x2fbb52[_0x02c6('0x2f')]==='unmanaged'?0x195:0x193)[_0x02c6('0x31')]({'message':_0x2fbb52['disposition']===_0x02c6('0x32')?_0x02c6('0x33'):_0x02c6('0x34')});}else{_0x22d5cf();}})[_0x02c6('0x35')](function(_0x41f910){_0x22d5cf(_0x41f910);});}});};exports[_0x02c6('0x2a')]=function isAuthenticated(_0x4776f0){return compose()[_0x02c6('0x36')](function(_0x54844a,_0x2dab2b,_0x589912){if(_0x54844a['headers'][_0x02c6('0x37')]){if(_['startsWith'](_0x54844a[_0x02c6('0x38')][_0x02c6('0x37')],_0x02c6('0x39'))){var _0x3b99ba=basicAuth(_0x54844a);db[_0x02c6('0x3a')][_0x02c6('0x3b')]({'where':{'name':_0x3b99ba[_0x02c6('0xc')]}})['then'](function(_0x1f6e21){if(!_0x1f6e21||!_0x1f6e21[_0x02c6('0x3c')](_0x3b99ba[_0x02c6('0x3d')])){return _0x2dab2b['status'](0x191)['json']({'message':_0x02c6('0x3e')});}_0x54844a['user']={'id':_0x1f6e21['id']};_0x589912();})[_0x02c6('0x35')](function(_0xf3e85d){_0x589912(_0xf3e85d);});}else if(_[_0x02c6('0x3f')](_0x54844a[_0x02c6('0x38')][_0x02c6('0x37')],_0x02c6('0x40'))){validateJwt(_0x54844a,_0x2dab2b,_0x589912);}else{if(_0x4776f0){_0x589912();}else{return _0x2dab2b['status'](0x193)[_0x02c6('0x31')]({'message':_0x02c6('0x41')});}}}else if(_0x54844a[_0x02c6('0x42')]['apikey']){try{var _0x3107f3={'audience':hardwareConf[_0x02c6('0x43')](),'issuer':hardwareConf[_0x02c6('0x43')]()};verifyJwt(_0x54844a['query'][_0x02c6('0x44')],_0x3107f3)['then'](function(_0x227cb5){return db[_0x02c6('0x3a')][_0x02c6('0x3b')]({'where':{'id':_0x227cb5[_0x02c6('0x45')]}})[_0x02c6('0x30')](function(_0x5b0cee){if(!_0x5b0cee||!_['isEqual'](_0x5b0cee['apiKeyNonce'],_0x227cb5[_0x02c6('0x46')])){return _0x2dab2b['status'](0x191)[_0x02c6('0x31')]({'message':_0x02c6('0x47')});}_0x54844a[_0x02c6('0x2b')]={'id':_0x5b0cee['id']};_0x589912();});})[_0x02c6('0x35')](function(){return _0x2dab2b[_0x02c6('0x48')](0x191)[_0x02c6('0x31')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x8e9e2e){_0x589912(_0x8e9e2e);}}else if(_0x4776f0){_0x589912();}else{return _0x2dab2b[_0x02c6('0x48')](0x193)[_0x02c6('0x31')]({'message':_0x02c6('0x41')});}})['use'](function(_0x482a4b,_0x3c2bea,_0x1db991){if(_0x482a4b[_0x02c6('0x2b')]){db[_0x02c6('0x3a')][_0x02c6('0x3b')]({'where':{'id':_0x482a4b[_0x02c6('0x2b')]['id']},'attributes':userAttributes})[_0x02c6('0x30')](function(_0x5ac2d6){if(!_0x5ac2d6){return _0x3c2bea[_0x02c6('0x48')](0x194)[_0x02c6('0x31')]({'message':_0x02c6('0x49')});}_0x482a4b[_0x02c6('0x2b')]=_0x5ac2d6;_0x1db991();})[_0x02c6('0x35')](function(_0x30fd9d){_0x1db991(_0x30fd9d);});}else if(_0x4776f0){_0x1db991();}else{return _0x3c2bea['status'](0x194)[_0x02c6('0x31')]({'message':_0x02c6('0x4a')});}});};exports[_0x02c6('0x4b')]=function canUpdate(){return compose()[_0x02c6('0x36')](function(_0x41562a,_0x3cdd69,_0x1773d2){return require('../../config/license/util')[_0x02c6('0x4c')]()[_0x02c6('0x30')](function(_0x217d3f){if(_0x217d3f['update']){_0x1773d2();}else{return _0x3cdd69[_0x02c6('0x48')](0x193)['json']({'message':_0x02c6('0x4d')});}})[_0x02c6('0x35')](function(_0x1f9db3){_0x1773d2(_0x1f9db3);});});};exports[_0x02c6('0x4e')]=function(_0x5572d8,_0x174ecd,_0x4a746e){_0x5572d8[_0x02c6('0x4e')]=!![];return _0x4a746e();};exports['signToken']=function signToken(_0x1de8e6){return signJwt(_0x1de8e6);};exports[_0x02c6('0x4f')]=function(_0x35cfcd,_0x51f23d){if(!_0x35cfcd['user']){return _0x51f23d['status'](0x194)[_0x02c6('0x31')]({'message':_0x02c6('0x50')});}var _0x5d5c4e={'payload':{'id':_0x35cfcd[_0x02c6('0x2b')]['id'],'role':_0x35cfcd[_0x02c6('0x2b')][_0x02c6('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5d5c4e)['then'](function(_0x132ccd){_0x51f23d['cookie']('motion.token',_0x132ccd);_0x51f23d['redirect']('/dashboards/general');})[_0x02c6('0x35')](function(_0x4bf4c8){return _0x51f23d[_0x02c6('0x48')](0x1f4)['send'](_0x4bf4c8);});};exports[_0x02c6('0x51')]=function(_0x2fcd54){if(_[_0x02c6('0x52')](_0x2fcd54[_0x02c6('0x53')])||_[_0x02c6('0x52')](_0x2fcd54[_0x02c6('0x54')])){return null;}else{return createJwt(_0x2fcd54);}};exports[_0x02c6('0x55')]=function(_0x5304db){_0x5304db[_0x02c6('0x53')]=generateNonce();_0x5304db['apiKeyIat']=generateIssuedAt();return createJwt(_0x5304db);};exports[_0x02c6('0x56')]=function(_0x3c0c52,_0x9f0221){var _0x17ccd8=_0x3c0c52[_0x02c6('0x42')]['apikey'];if(_0x17ccd8){var _0x31e990={'nonce':_0x9f0221[_0x02c6('0x53')],'iat':_0x9f0221[_0x02c6('0x54')],'audience':hardwareConf[_0x02c6('0x43')](),'issuer':hardwareConf[_0x02c6('0x43')]()};return verifyJwt(_0x17ccd8,_0x31e990)[_0x02c6('0x30')](function(){return generateApiKey(_0x9f0221);});}else{throw{'message':_0x02c6('0x57')};}};function signJwt(_0xcfab5e){var _0x30b42c=BPromise['promisify'](jwt[_0x02c6('0x58')],{'context':jwt});var _0x49b112=_0xcfab5e[_0x02c6('0x59')]||config['secrets'][_0x02c6('0x5a')];return new BPromise(function(_0x3a0cc6,_0x3f0f2a){_0x30b42c(_0xcfab5e[_0x02c6('0x5b')],_0x49b112,_0xcfab5e[_0x02c6('0x5c')])[_0x02c6('0x30')](function(_0x1fa555){_0x3a0cc6(_0x1fa555);})['catch'](function(_0x4c7da2){_0x3f0f2a(_0x4c7da2);});});}function verifyJwt(_0x40f728,_0x164f00,_0x2d66c9){var _0x5a370d=BPromise[_0x02c6('0x5d')](jwt[_0x02c6('0x5e')],{'context':jwt});var _0x3dd8a3=_0x2d66c9||config['secrets'][_0x02c6('0x5a')];return new BPromise(function(_0x2a511e,_0x4432ca){_0x5a370d(_0x40f728,_0x3dd8a3,_0x164f00)[_0x02c6('0x30')](function(_0x6d3dd2){_0x2a511e(_0x6d3dd2);})[_0x02c6('0x35')](function(_0x1a6011){_0x4432ca(_0x1a6011);});});}function generateNonce(){return crypto[_0x02c6('0x5f')](0x10)[_0x02c6('0x60')](_0x02c6('0x61'));}function generateIssuedAt(){return Math[_0x02c6('0x62')](Date['now']()/0x3e8)[_0x02c6('0x60')]();}function createJwt(_0x5c5413){var _0x443e3f={'payload':{'iat':_0x5c5413[_0x02c6('0x54')],'nonce':_0x5c5413['apiKeyNonce']},'options':{'algorithm':_0x02c6('0x63'),'subject':_0x5c5413['id'][_0x02c6('0x60')](),'issuer':hardwareConf[_0x02c6('0x43')](),'audience':hardwareConf[_0x02c6('0x43')]()}};return signJwt(_0x443e3f)[_0x02c6('0x30')](function(_0xb22eb7){return{'iat':_0x5c5413[_0x02c6('0x54')],'nonce':_0x5c5413[_0x02c6('0x53')],'token':_0xb22eb7};});} \ No newline at end of file +var _0xfc6a=['json','Unmanaged.','catch','headers','authorization','startsWith','User','authenticate','pass','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','find','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControlPort','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xfc6a,0x149));var _0xafc6=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xfc6a[_0xd0b415];return _0x2bdf2c;};'use strict';var db=require(_0xafc6('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xafc6('0x1'));var _=require(_0xafc6('0x2'));var jwt=require(_0xafc6('0x3'));var expressJwt=require(_0xafc6('0x4'));var compose=require(_0xafc6('0x5'));var basicAuth=require(_0xafc6('0x6'));var crypto=require('crypto');var BPromise=require(_0xafc6('0x7'));var validateJwt=expressJwt({'secret':config[_0xafc6('0x8')][_0xafc6('0x9')]});var userAttributes=['id',_0xafc6('0xa'),'fullname',_0xafc6('0xb'),_0xafc6('0xc'),_0xafc6('0xd'),'userpic',_0xafc6('0xe'),_0xafc6('0xf'),_0xafc6('0x10'),_0xafc6('0x11'),'mailPause',_0xafc6('0x12'),_0xafc6('0x13'),_0xafc6('0x14'),_0xafc6('0x15'),_0xafc6('0x16'),_0xafc6('0x17'),_0xafc6('0x18'),_0xafc6('0x19'),'allowmessenger',_0xafc6('0x1a'),_0xafc6('0x1b'),'phoneBarAutoAnswer',_0xafc6('0x1c'),_0xafc6('0x1d'),_0xafc6('0x1e'),'phoneBarEnableDtmfTone',_0xafc6('0x1f'),'phoneBarExpires',_0xafc6('0x20'),'phoneBarRemoteControl',_0xafc6('0x21'),'hotdesk','interface',_0xafc6('0x22')];exports[_0xafc6('0x23')]=function(){return this[_0xafc6('0x24')](!![])[_0xafc6('0x25')](function(_0x48063c,_0x7138c,_0x4d60c8){if(_0x48063c[_0xafc6('0x26')]){_0x4d60c8();}else{return db[_0xafc6('0x27')][_0xafc6('0x28')]({'where':{'id':_0x48063c[_0xafc6('0x29')]['id']},'attributes':['id',_0xafc6('0x2a'),_0xafc6('0x2b')],'raw':!![]})[_0xafc6('0x2c')](function(_0x41c8fa){if(_0x41c8fa&&_0x41c8fa[_0xafc6('0x2a')]){return _0x7138c[_0xafc6('0x2d')](_0x41c8fa[_0xafc6('0x2b')]===_0xafc6('0x2e')?0x195:0x193)[_0xafc6('0x2f')]({'message':_0x41c8fa[_0xafc6('0x2b')]===_0xafc6('0x2e')?_0xafc6('0x30'):'Forbidden.'});}else{_0x4d60c8();}})[_0xafc6('0x31')](function(_0x57ac19){_0x4d60c8(_0x57ac19);});}});};exports[_0xafc6('0x24')]=function isAuthenticated(_0x3078e8){return compose()[_0xafc6('0x25')](function(_0x5ea918,_0x83fdc3,_0x2a3723){if(_0x5ea918[_0xafc6('0x32')][_0xafc6('0x33')]){if(_[_0xafc6('0x34')](_0x5ea918[_0xafc6('0x32')][_0xafc6('0x33')],'Basic')){var _0x194e62=basicAuth(_0x5ea918);db[_0xafc6('0x35')]['find']({'where':{'name':_0x194e62[_0xafc6('0xb')]}})[_0xafc6('0x2c')](function(_0x3b57fd){if(!_0x3b57fd||!_0x3b57fd[_0xafc6('0x36')](_0x194e62[_0xafc6('0x37')])){return _0x83fdc3[_0xafc6('0x2d')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x5ea918['user']={'id':_0x3b57fd['id']};_0x2a3723();})[_0xafc6('0x31')](function(_0x465f5d){_0x2a3723(_0x465f5d);});}else if(_[_0xafc6('0x34')](_0x5ea918[_0xafc6('0x32')]['authorization'],_0xafc6('0x38'))){validateJwt(_0x5ea918,_0x83fdc3,_0x2a3723);}else{if(_0x3078e8){_0x2a3723();}else{return _0x83fdc3[_0xafc6('0x2d')](0x193)[_0xafc6('0x2f')]({'message':_0xafc6('0x39')});}}}else if(_0x5ea918['query'][_0xafc6('0x3a')]){try{var _0x1e08ad={'audience':hardwareConf[_0xafc6('0x3b')](),'issuer':hardwareConf[_0xafc6('0x3b')]()};verifyJwt(_0x5ea918[_0xafc6('0x3c')][_0xafc6('0x3a')],_0x1e08ad)['then'](function(_0x553186){return db[_0xafc6('0x35')][_0xafc6('0x3d')]({'where':{'id':_0x553186['sub']}})[_0xafc6('0x2c')](function(_0x2aa5f0){if(!_0x2aa5f0||!_[_0xafc6('0x3e')](_0x2aa5f0[_0xafc6('0x3f')],_0x553186[_0xafc6('0x40')])){return _0x83fdc3[_0xafc6('0x2d')](0x191)['json']({'message':_0xafc6('0x41')});}_0x5ea918['user']={'id':_0x2aa5f0['id']};_0x2a3723();});})[_0xafc6('0x31')](function(){return _0x83fdc3[_0xafc6('0x2d')](0x191)['json']({'message':_0xafc6('0x42')});});}catch(_0x49bd12){_0x2a3723(_0x49bd12);}}else if(_0x3078e8){_0x2a3723();}else{return _0x83fdc3[_0xafc6('0x2d')](0x193)[_0xafc6('0x2f')]({'message':_0xafc6('0x39')});}})[_0xafc6('0x25')](function(_0x120773,_0xe49312,_0x37f7d9){if(_0x120773['user']){db[_0xafc6('0x35')][_0xafc6('0x3d')]({'where':{'id':_0x120773[_0xafc6('0x26')]['id']},'attributes':userAttributes})[_0xafc6('0x2c')](function(_0x490d93){if(!_0x490d93){return _0xe49312[_0xafc6('0x2d')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x120773[_0xafc6('0x26')]=_0x490d93;_0x37f7d9();})[_0xafc6('0x31')](function(_0x28080a){_0x37f7d9(_0x28080a);});}else if(_0x3078e8){_0x37f7d9();}else{return _0xe49312['status'](0x194)['json']({'message':_0xafc6('0x43')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x49c09a,_0x28c965,_0x1ee411){return require('../../config/license/util')[_0xafc6('0x44')]()[_0xafc6('0x2c')](function(_0x234fce){if(_0x234fce[_0xafc6('0x45')]){_0x1ee411();}else{return _0x28c965[_0xafc6('0x2d')](0x193)[_0xafc6('0x2f')]({'message':_0xafc6('0x46')});}})[_0xafc6('0x31')](function(_0x36ce52){_0x1ee411(_0x36ce52);});});};exports[_0xafc6('0x47')]=function(_0x52e051,_0x1612dc,_0x5c8e47){_0x52e051[_0xafc6('0x47')]=!![];return _0x5c8e47();};exports['signToken']=function signToken(_0x189a05){return signJwt(_0x189a05);};exports[_0xafc6('0x48')]=function(_0x2f74cb,_0x23931f){if(!_0x2f74cb[_0xafc6('0x26')]){return _0x23931f[_0xafc6('0x2d')](0x194)[_0xafc6('0x2f')]({'message':_0xafc6('0x49')});}var _0x279dcb={'payload':{'id':_0x2f74cb[_0xafc6('0x26')]['id'],'role':_0x2f74cb[_0xafc6('0x26')][_0xafc6('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x279dcb)[_0xafc6('0x2c')](function(_0x9dd071){_0x23931f[_0xafc6('0x4a')](_0xafc6('0x4b'),_0x9dd071);_0x23931f[_0xafc6('0x4c')](_0xafc6('0x4d'));})[_0xafc6('0x31')](function(_0x54fccb){return _0x23931f['status'](0x1f4)['send'](_0x54fccb);});};exports[_0xafc6('0x4e')]=function(_0x384a5b){if(_['isNil'](_0x384a5b['apiKeyNonce'])||_[_0xafc6('0x4f')](_0x384a5b[_0xafc6('0x50')])){return null;}else{return createJwt(_0x384a5b);}};exports['generateApiKey']=function(_0x2f044e){_0x2f044e['apiKeyNonce']=generateNonce();_0x2f044e['apiKeyIat']=generateIssuedAt();return createJwt(_0x2f044e);};exports[_0xafc6('0x51')]=function(_0x57a002,_0x2ce252){var _0x11b078=_0x57a002[_0xafc6('0x3c')][_0xafc6('0x3a')];if(_0x11b078){var _0x4ad207={'nonce':_0x2ce252[_0xafc6('0x3f')],'iat':_0x2ce252[_0xafc6('0x50')],'audience':hardwareConf[_0xafc6('0x3b')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x11b078,_0x4ad207)[_0xafc6('0x2c')](function(){return generateApiKey(_0x2ce252);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0xe50075){var _0x356cb1=BPromise[_0xafc6('0x52')](jwt[_0xafc6('0x53')],{'context':jwt});var _0x2dfd24=_0xe50075[_0xafc6('0x54')]||config[_0xafc6('0x8')][_0xafc6('0x9')];return new BPromise(function(_0x59d6b5,_0xf1e04f){_0x356cb1(_0xe50075[_0xafc6('0x55')],_0x2dfd24,_0xe50075[_0xafc6('0x56')])[_0xafc6('0x2c')](function(_0x1f056c){_0x59d6b5(_0x1f056c);})['catch'](function(_0x2a3ca0){_0xf1e04f(_0x2a3ca0);});});}function verifyJwt(_0x242a71,_0x4da30d,_0x1e5fc2){var _0x5027ce=BPromise[_0xafc6('0x52')](jwt[_0xafc6('0x57')],{'context':jwt});var _0x32eb9a=_0x1e5fc2||config[_0xafc6('0x8')][_0xafc6('0x9')];return new BPromise(function(_0x4aad27,_0xf07968){_0x5027ce(_0x242a71,_0x32eb9a,_0x4da30d)[_0xafc6('0x2c')](function(_0x283edc){_0x4aad27(_0x283edc);})['catch'](function(_0x5e2e89){_0xf07968(_0x5e2e89);});});}function generateNonce(){return crypto[_0xafc6('0x58')](0x10)['toString'](_0xafc6('0x59'));}function generateIssuedAt(){return Math[_0xafc6('0x5a')](Date[_0xafc6('0x5b')]()/0x3e8)[_0xafc6('0x5c')]();}function createJwt(_0x1a8afa){var _0x1f1cc3={'payload':{'iat':_0x1a8afa[_0xafc6('0x50')],'nonce':_0x1a8afa[_0xafc6('0x3f')]},'options':{'algorithm':_0xafc6('0x5d'),'subject':_0x1a8afa['id'][_0xafc6('0x5c')](),'issuer':hardwareConf[_0xafc6('0x3b')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1f1cc3)[_0xafc6('0x2c')](function(_0x13117e){return{'iat':_0x1a8afa[_0xafc6('0x50')],'nonce':_0x1a8afa[_0xafc6('0x3f')],'token':_0x13117e};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 37dd735..5290c52 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 _0xcb91=['unlink','createReadStream','createWriteStream','createDecipher','update','aes192','hasOwnProperty','createCipher','algorithm','data','binary','write','end','final','close'];(function(_0x5d1c7b,_0x1d7a08){var _0x3cd3c3=function(_0x45ceb3){while(--_0x45ceb3){_0x5d1c7b['push'](_0x5d1c7b['shift']());}};_0x3cd3c3(++_0x1d7a08);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xcb91[_0x3511d3];return _0x5d6321;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x1cb9('0x0')};function combineOptions(_0xe4a5bf){var _0x17d4ec={};for(var _0x22c4b8 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x22c4b8)){_0x17d4ec[_0x22c4b8]=defaultOptions[_0x22c4b8];}}if(_0xe4a5bf){for(var _0x8c392f in _0xe4a5bf){if(_0xe4a5bf[_0x1cb9('0x1')](_0x8c392f)){_0x17d4ec[_0x8c392f]=_0xe4a5bf[_0x8c392f];}}}return _0x17d4ec;}exports['encryptFile']=function(_0x13d5fd,_0x1b26cd,_0x53ffbd,_0x226b69){return new BPromise(function(_0x3f7deb,_0x4ffe20){_0x226b69=combineOptions(_0x226b69);var _0x38737d=new Buffer(_0x53ffbd);var _0x12567c=fs['createReadStream'](_0x13d5fd);var _0x3ae0f1=fs['createWriteStream'](_0x1b26cd);var _0x567139=crypto[_0x1cb9('0x2')](_0x226b69[_0x1cb9('0x3')],_0x38737d);_0x12567c['on'](_0x1cb9('0x4'),function(_0x1f0eca){var _0x2fc627=new Buffer(_0x567139['update'](_0x1f0eca),_0x1cb9('0x5'));_0x3ae0f1[_0x1cb9('0x6')](_0x2fc627);});_0x12567c['on'](_0x1cb9('0x7'),function(){try{var _0x3fdd83=new Buffer(_0x567139[_0x1cb9('0x8')]('binary'),'binary');_0x3ae0f1['write'](_0x3fdd83);_0x3ae0f1[_0x1cb9('0x7')]();_0x3ae0f1['on'](_0x1cb9('0x9'),function(){return _0x3f7deb(_0x1b26cd);});}catch(_0x384496){fs[_0x1cb9('0xa')](_0x1b26cd);return _0x4ffe20(_0x384496);}});});};exports['decryptFile']=function(_0x397727,_0x6ef389,_0x1b3cd7,_0x8dfa55){return new BPromise(function(_0x3e2d11,_0x5806d8){_0x8dfa55=combineOptions(_0x8dfa55);var _0x5572cb=new Buffer(_0x1b3cd7);var _0xd446a3=fs[_0x1cb9('0xb')](_0x397727);var _0x3904b7=fs[_0x1cb9('0xc')](_0x6ef389);var _0x3e21e0=crypto[_0x1cb9('0xd')](_0x8dfa55[_0x1cb9('0x3')],_0x5572cb);_0xd446a3['on']('data',function(_0x479d43){var _0x1b2fa6=new Buffer(_0x3e21e0[_0x1cb9('0xe')](_0x479d43),_0x1cb9('0x5'));_0x3904b7[_0x1cb9('0x6')](_0x1b2fa6);});_0xd446a3['on'](_0x1cb9('0x7'),function(){try{var _0x4014de=new Buffer(_0x3e21e0[_0x1cb9('0x8')]('binary'),'binary');_0x3904b7[_0x1cb9('0x6')](_0x4014de);_0x3904b7['end']();_0x3904b7['on'](_0x1cb9('0x9'),function(){return _0x3e2d11(_0x6ef389);});}catch(_0x2265ea){fs['unlink'](_0x6ef389);return _0x5806d8(_0x2265ea);}});});}; \ No newline at end of file +var _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x325507,_0x1968ab){var _0x1a5253=function(_0x591c8e){while(--_0x591c8e){_0x325507['push'](_0x325507['shift']());}};_0x1a5253(++_0x1968ab);}(_0xe706,0xa3));var _0x6e70=function(_0x5be527,_0x47a3f2){_0x5be527=_0x5be527-0x0;var _0x3f0f16=_0xe706[_0x5be527];return _0x3f0f16;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index ac06ed9..338e4a3 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 _0x9f62=['find','split','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','dirname','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x9f62,0x154));var _0x29f6=function(_0x185774,_0x14d074){_0x185774=_0x185774-0x0;var _0x3d2575=_0x9f62[_0x185774];return _0x3d2575;};'use strict';var util=require('util');var path=require(_0x29f6('0x0'));var _=require('lodash');var csv=require(_0x29f6('0x1'));var fs=require('fs');var BPromise=require(_0x29f6('0x2'));var zipdir=require(_0x29f6('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x29f6('0x4'))[_0x29f6('0x5')];var logger=require(_0x29f6('0x6'))(_0x29f6('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x29f6('0x8')][0x3];var PATH=process[_0x29f6('0x8')][0x4];function analyticExtractedReport(_0x9a43fe,_0x2ba602){var _0x416c6c={'status':_0x9a43fe};var _0x5e9945={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ba602){_0x416c6c['savename']=_0x2ba602;}return db['AnalyticExtractedReport']['update'](_0x416c6c,_0x5e9945);}function main(){var _0xe25841=0x1388;var _0x44db16;logger['info'](util['format'](_0x29f6('0x9'),EXTRACTED_REPORT_ID,_0x29f6('0xa')));return db['Setting'][_0x29f6('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x29f6('0xc'),'splitSizeCsv']})['then'](function(_0x559585){if(_0x559585){_0x44db16=_0x559585;_0xe25841=_0x44db16['splitSizeCsv']||0x1388;}})[_0x29f6('0xd')](function(){return dbH[_0x29f6('0xe')][_0x29f6('0xf')](util[_0x29f6('0x10')](_0x29f6('0x11'),QUERY),{'type':dbH[_0x29f6('0xe')][_0x29f6('0x12')][_0x29f6('0x13')]});})[_0x29f6('0xd')](function(_0x19331f){if(!_0x19331f[0x0][_0x29f6('0x14')]){return analyticExtractedReport(_0x29f6('0x15'));}var _0x1dde97=[];var _0x3a75d0=0x0;var _0x25e5a2=!![];if(_0x19331f&&_0x19331f[_0x29f6('0x16')]){var _0x3584a1=_0x19331f[0x0]['num']%(_0x3a75d0+_0xe25841);if(_0x44db16['split']){for(;_0x25e5a2;_0x3a75d0+=_0xe25841,_0x3584a1=_0x19331f[0x0][_0x29f6('0x14')]%(_0x3a75d0+_0xe25841)){if(_0x3584a1==0x0||_0x3584a1==_0x19331f[0x0][_0x29f6('0x14')]){_0x25e5a2=![];}_0x1dde97[_0x29f6('0x17')](dbH['sequelize'][_0x29f6('0xf')](util[_0x29f6('0x10')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe25841,_0x3a75d0),{'type':dbH[_0x29f6('0xe')][_0x29f6('0x12')][_0x29f6('0x13')]}));}}else{_0x1dde97[_0x29f6('0x17')](dbH[_0x29f6('0xe')][_0x29f6('0xf')](QUERY,{'type':dbH['sequelize'][_0x29f6('0x12')]['SELECT']}));}}var _0x4acb15=path[_0x29f6('0x18')](PATH);var _0x1fa159=path[_0x29f6('0x19')](PATH,_0x29f6('0x1a'));var _0x54ddeb=_0x44db16[_0x29f6('0xc')]&&_0x1dde97['length']>0x1;var _0xd4179c=[];if(!fs[_0x29f6('0x1b')](path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159))&&_0x54ddeb){fs[_0x29f6('0x1d')](path['join'](_0x4acb15,_0x1fa159));}return BPromise[_0x29f6('0x1e')](_0x1dde97,function(_0x4d494f){_0xd4179c['push'](_0x4d494f);})[_0x29f6('0xd')](function(){for(var _0x45f792=0x0;_0x45f792<_0xd4179c[_0x29f6('0x16')];_0x45f792+=0x1){var _0x342038;var _0x84ccb7=_0xd4179c[_0x45f792];if(_0x54ddeb){_0x342038=path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159,util[_0x29f6('0x10')]('%s%d.%s',_0x1fa159,_0x45f792,_0x29f6('0x1f')));}else{_0x342038=path[_0x29f6('0x1c')](_0x4acb15,util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x29f6('0x1f')));}fs[_0x29f6('0x21')](_0x342038,csv(_0x84ccb7));}})[_0x29f6('0xd')](function(){if(_0x54ddeb){zipdir(path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159),{'saveTo':path[_0x29f6('0x1c')](_0x4acb15,util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x29f6('0x22')))},function(_0x40c830,_0x304c28){});rimraf(path[_0x29f6('0x1c')](_0x4acb15,_0x1fa159),function(){});}})[_0x29f6('0xd')](function(){logger[_0x29f6('0x23')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x29f6('0xa')));return analyticExtractedReport('Completed',_0x54ddeb?util[_0x29f6('0x10')](_0x29f6('0x20'),_0x1fa159,_0x54ddeb?_0x29f6('0x22'):_0x29f6('0x1f')):null);});})['catch'](function(_0x53e11f){logger[_0x29f6('0x23')](util[_0x29f6('0x10')](_0x29f6('0x24'),EXTRACTED_REPORT_ID,_0x29f6('0xa')),util[_0x29f6('0x25')](_0x53e11f,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x29f6('0x26'));});}main(); \ No newline at end of file +var _0xaa88=['join','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','existsSync','mkdirSync'];(function(_0x38ae20,_0x10e0ca){var _0x1bf5f6=function(_0x57593e){while(--_0x57593e){_0x38ae20['push'](_0x38ae20['shift']());}};_0x1bf5f6(++_0x10e0ca);}(_0xaa88,0x137));var _0x8aa8=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0xaa88[_0x21f931];return _0x3f083c;};'use strict';var util=require(_0x8aa8('0x0'));var path=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var csv=require(_0x8aa8('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8aa8('0x4'));var rimraf=require(_0x8aa8('0x5'));var db=require(_0x8aa8('0x6'))['db'];var dbH=require(_0x8aa8('0x6'))[_0x8aa8('0x7')];var logger=require(_0x8aa8('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8aa8('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x449d2d,_0x1ed84d){var _0x27c08d={'status':_0x449d2d};var _0x40826f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ed84d){_0x27c08d['savename']=_0x1ed84d;}return db[_0x8aa8('0xa')][_0x8aa8('0xb')](_0x27c08d,_0x40826f);}function main(){var _0x224f25=0x1388;var _0x5c94d4;logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0xe'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')));return db['Setting'][_0x8aa8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8aa8('0x11'),'splitSizeCsv']})[_0x8aa8('0x12')](function(_0xa691d6){if(_0xa691d6){_0x5c94d4=_0xa691d6;_0x224f25=_0x5c94d4[_0x8aa8('0x13')]||0x1388;}})['then'](function(){return dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](util[_0x8aa8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8aa8('0x14')]['QueryTypes']['SELECT']});})[_0x8aa8('0x12')](function(_0x200662){if(!_0x200662[0x0][_0x8aa8('0x16')]){return analyticExtractedReport(_0x8aa8('0x17'));}var _0x42a6a4=[];var _0x3778f4=0x0;var _0x1bdd39=!![];if(_0x200662&&_0x200662[_0x8aa8('0x18')]){var _0x20d303=_0x200662[0x0]['num']%(_0x3778f4+_0x224f25);if(_0x5c94d4['split']){for(;_0x1bdd39;_0x3778f4+=_0x224f25,_0x20d303=_0x200662[0x0][_0x8aa8('0x16')]%(_0x3778f4+_0x224f25)){if(_0x20d303==0x0||_0x20d303==_0x200662[0x0]['num']){_0x1bdd39=![];}_0x42a6a4['push'](dbH[_0x8aa8('0x14')]['query'](util[_0x8aa8('0xd')](_0x8aa8('0x19'),QUERY,_0x224f25,_0x3778f4),{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')]['SELECT']}));}}else{_0x42a6a4[_0x8aa8('0x1b')](dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](QUERY,{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')][_0x8aa8('0x1c')]}));}}var _0x5d9b62=path[_0x8aa8('0x1d')](PATH);var _0x4cc455=path[_0x8aa8('0x1e')](PATH,'.csv');var _0x2c1828=_0x5c94d4['split']&&_0x42a6a4[_0x8aa8('0x18')]>0x1;var _0x40adb5=[];if(!fs[_0x8aa8('0x1f')](path['join'](_0x5d9b62,_0x4cc455))&&_0x2c1828){fs[_0x8aa8('0x20')](path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455));}return BPromise[_0x8aa8('0x22')](_0x42a6a4,function(_0x547a7b){_0x40adb5['push'](_0x547a7b);})[_0x8aa8('0x12')](function(){for(var _0x44e2d8=0x0;_0x44e2d8<_0x40adb5[_0x8aa8('0x18')];_0x44e2d8+=0x1){var _0x3a3c7a;var _0x24143e=_0x40adb5[_0x44e2d8];if(_0x2c1828){_0x3a3c7a=path['join'](_0x5d9b62,_0x4cc455,util[_0x8aa8('0xd')]('%s%d.%s',_0x4cc455,_0x44e2d8,_0x8aa8('0x23')));}else{_0x3a3c7a=path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')]('%s.%s',_0x4cc455,'csv'));}fs[_0x8aa8('0x24')](_0x3a3c7a,csv(_0x24143e));}})['then'](function(){if(_0x2c1828){zipdir(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),{'saveTo':path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x8aa8('0x26')))},function(_0x4d5c2e,_0x267f4c){});rimraf(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),function(){});}})['then'](function(){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x8aa8('0x28'),_0x2c1828?util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x2c1828?_0x8aa8('0x26'):_0x8aa8('0x23')):null);});})[_0x8aa8('0x29')](function(_0x370401){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x2a'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')),util['inspect'](_0x370401,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 2b56f8b..91b62fc 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 _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0xfcccb8,_0x5c7af5){var _0x218471=function(_0x1e842f){while(--_0x1e842f){_0xfcccb8['push'](_0xfcccb8['shift']());}};_0x218471(++_0x5c7af5);}(_0xb10b,0x12a));var _0xbb10=function(_0x227e24,_0x573dd6){_0x227e24=_0x227e24-0x0;var _0x2ccc99=_0xb10b[_0x227e24];return _0x2ccc99;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +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(_0x4ffde9,_0x170864){var _0x1a3a7f=function(_0x1ea95d){while(--_0x1ea95d){_0x4ffde9['push'](_0x4ffde9['shift']());}};_0x1a3a7f(++_0x170864);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 725c9e7..8ea5f65 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 _0x0c51=['XLSX','Setting','find','split','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x3df83d,_0x37bc93){var _0x5e333f=function(_0x1bffc2){while(--_0x1bffc2){_0x3df83d['push'](_0x3df83d['shift']());}};_0x5e333f(++_0x37bc93);}(_0x0c51,0x7d));var _0x10c5=function(_0xafadf7,_0xe4d086){_0xafadf7=_0xafadf7-0x0;var _0x1e4c7d=_0x0c51[_0xafadf7];return _0x1e4c7d;};'use strict';var util=require(_0x10c5('0x0'));var path=require('path');var _=require(_0x10c5('0x1'));var fs=require('fs');var json2xls=require(_0x10c5('0x2'));var BPromise=require(_0x10c5('0x3'));var zipdir=require(_0x10c5('0x4'));var rimraf=require('rimraf');var db=require(_0x10c5('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x10c5('0x6'))(_0x10c5('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x10c5('0x8')][0x2]);var QUERY=process[_0x10c5('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x4305b1,_0x5d7471){var _0x597d29={'status':_0x4305b1};var _0x35d203={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d7471){_0x597d29[_0x10c5('0x9')]=_0x5d7471;}return db[_0x10c5('0xa')]['update'](_0x597d29,_0x35d203);}function main(){var _0x36b555=0x1388;var _0x5e5d81;logger['info'](util[_0x10c5('0xb')](_0x10c5('0xc'),EXTRACTED_REPORT_ID,_0x10c5('0xd')));return db[_0x10c5('0xe')][_0x10c5('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x10c5('0x10'),'splitSizeXlsx']})[_0x10c5('0x11')](function(_0x522721){if(_0x522721){_0x5e5d81=_0x522721;_0x36b555=_0x5e5d81['splitSizeXlsx']||0x1388;}})[_0x10c5('0x11')](function(){return dbH[_0x10c5('0x12')]['query'](util['format'](_0x10c5('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x10c5('0x14')]});})[_0x10c5('0x11')](function(_0x5161a3){if(!_0x5161a3[0x0][_0x10c5('0x15')]){return analyticExtractedReport('Empty');}var _0x1c3a6c=[];var _0x523181=0x0;var _0x48eb69=!![];if(_0x5e5d81[_0x10c5('0x10')]){if(_0x5161a3&&_0x5161a3[_0x10c5('0x16')]){var _0x22da1=_0x5161a3[0x0]['num']%(_0x523181+_0x36b555);for(;_0x48eb69;_0x523181+=_0x36b555,_0x22da1=_0x5161a3[0x0]['num']%(_0x523181+_0x36b555)){if(_0x22da1==0x0||_0x22da1==_0x5161a3[0x0][_0x10c5('0x15')]){_0x48eb69=![];}_0x1c3a6c[_0x10c5('0x17')](dbH[_0x10c5('0x12')][_0x10c5('0x18')](util[_0x10c5('0xb')](_0x10c5('0x19'),QUERY,_0x36b555,_0x523181),{'type':dbH[_0x10c5('0x12')][_0x10c5('0x1a')][_0x10c5('0x14')]}));}}}else{_0x1c3a6c[_0x10c5('0x17')](dbH[_0x10c5('0x12')]['query'](QUERY,{'type':dbH[_0x10c5('0x12')][_0x10c5('0x1a')]['SELECT']}));}var _0x3e955c=path[_0x10c5('0x1b')](PATH);var _0x379828=path['basename'](PATH,_0x10c5('0x1c'));var _0x228f92=_0x5e5d81[_0x10c5('0x10')]&&_0x1c3a6c[_0x10c5('0x16')]>0x1;var _0x45f67f=[];if(!fs[_0x10c5('0x1d')](path[_0x10c5('0x1e')](_0x3e955c,_0x379828))&&_0x228f92){fs[_0x10c5('0x1f')](path['join'](_0x3e955c,_0x379828));}return BPromise[_0x10c5('0x20')](_0x1c3a6c,function(_0x475d66){_0x45f67f[_0x10c5('0x17')](_0x475d66);})[_0x10c5('0x11')](function(){for(var _0x32800e=0x0;_0x32800e<_0x45f67f[_0x10c5('0x16')];_0x32800e+=0x1){var _0x5513cf;var _0x808e66=_0x45f67f[_0x32800e];if(_0x228f92){_0x5513cf=path['join'](_0x3e955c,_0x379828,util[_0x10c5('0xb')](_0x10c5('0x21'),_0x379828,_0x32800e,_0x10c5('0x22')));}else{_0x5513cf=path['join'](_0x3e955c,util[_0x10c5('0xb')](_0x10c5('0x23'),_0x379828,_0x10c5('0x22')));}fs[_0x10c5('0x24')](_0x5513cf,json2xls(_0x808e66),_0x10c5('0x25'));}})[_0x10c5('0x11')](function(){if(_0x228f92){zipdir(path['join'](_0x3e955c,_0x379828),{'saveTo':path[_0x10c5('0x1e')](_0x3e955c,util[_0x10c5('0xb')](_0x10c5('0x23'),_0x379828,'zip'))},function(_0x2d3847,_0x386513){});rimraf(path[_0x10c5('0x1e')](_0x3e955c,_0x379828),function(){});}})['then'](function(){logger[_0x10c5('0x26')](util['format'](_0x10c5('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x10c5('0x28'),_0x228f92?util[_0x10c5('0xb')](_0x10c5('0x23'),_0x379828,_0x228f92?_0x10c5('0x29'):_0x10c5('0x22')):null);});})[_0x10c5('0x2a')](function(_0x2ecc25){logger[_0x10c5('0x26')](util[_0x10c5('0xb')](_0x10c5('0x2b'),EXTRACTED_REPORT_ID,_0x10c5('0xd')),util[_0x10c5('0x2c')](_0x2ecc25,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x10c5('0x2d'));});}main(); \ No newline at end of file +var _0x7769=['util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','then','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','XLSX','Failed'];(function(_0x45adaf,_0x21c3c1){var _0x15d189=function(_0x48dc43){while(--_0x48dc43){_0x45adaf['push'](_0x45adaf['shift']());}};_0x15d189(++_0x21c3c1);}(_0x7769,0x15e));var _0x9776=function(_0x45dd13,_0x49cb73){_0x45dd13=_0x45dd13-0x0;var _0x491d0b=_0x7769[_0x45dd13];return _0x491d0b;};'use strict';var util=require(_0x9776('0x0'));var path=require(_0x9776('0x1'));var _=require(_0x9776('0x2'));var fs=require('fs');var json2xls=require(_0x9776('0x3'));var BPromise=require(_0x9776('0x4'));var zipdir=require(_0x9776('0x5'));var rimraf=require(_0x9776('0x6'));var db=require(_0x9776('0x7'))['db'];var dbH=require(_0x9776('0x7'))[_0x9776('0x8')];var logger=require(_0x9776('0x9'))(_0x9776('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x9776('0xb')][0x2]);var QUERY=process[_0x9776('0xb')][0x3];var PATH=process[_0x9776('0xb')][0x4];function analyticExtractedReport(_0x157a6f,_0x2b9018){var _0x2ab268={'status':_0x157a6f};var _0x451ba0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b9018){_0x2ab268['savename']=_0x2b9018;}return db[_0x9776('0xc')][_0x9776('0xd')](_0x2ab268,_0x451ba0);}function main(){var _0x16ce7f=0x1388;var _0xbfc7bf;logger[_0x9776('0xe')](util[_0x9776('0xf')](_0x9776('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x9776('0x11')][_0x9776('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0x28b2ba){if(_0x28b2ba){_0xbfc7bf=_0x28b2ba;_0x16ce7f=_0xbfc7bf[_0x9776('0x13')]||0x1388;}})['then'](function(){return dbH[_0x9776('0x14')][_0x9776('0x15')](util[_0x9776('0xf')](_0x9776('0x16'),QUERY),{'type':dbH[_0x9776('0x14')][_0x9776('0x17')][_0x9776('0x18')]});})['then'](function(_0xd3c99a){if(!_0xd3c99a[0x0][_0x9776('0x19')]){return analyticExtractedReport(_0x9776('0x1a'));}var _0x16647a=[];var _0x4d4196=0x0;var _0x103365=!![];if(_0xbfc7bf[_0x9776('0x1b')]){if(_0xd3c99a&&_0xd3c99a[_0x9776('0x1c')]){var _0x40fc66=_0xd3c99a[0x0]['num']%(_0x4d4196+_0x16ce7f);for(;_0x103365;_0x4d4196+=_0x16ce7f,_0x40fc66=_0xd3c99a[0x0][_0x9776('0x19')]%(_0x4d4196+_0x16ce7f)){if(_0x40fc66==0x0||_0x40fc66==_0xd3c99a[0x0][_0x9776('0x19')]){_0x103365=![];}_0x16647a[_0x9776('0x1d')](dbH[_0x9776('0x14')]['query'](util[_0x9776('0xf')](_0x9776('0x1e'),QUERY,_0x16ce7f,_0x4d4196),{'type':dbH[_0x9776('0x14')][_0x9776('0x17')]['SELECT']}));}}}else{_0x16647a[_0x9776('0x1d')](dbH[_0x9776('0x14')][_0x9776('0x15')](QUERY,{'type':dbH['sequelize'][_0x9776('0x17')][_0x9776('0x18')]}));}var _0x318bfc=path[_0x9776('0x1f')](PATH);var _0x2ea392=path[_0x9776('0x20')](PATH,_0x9776('0x21'));var _0x3bbc42=_0xbfc7bf['split']&&_0x16647a[_0x9776('0x1c')]>0x1;var _0x3879e4=[];if(!fs[_0x9776('0x22')](path[_0x9776('0x23')](_0x318bfc,_0x2ea392))&&_0x3bbc42){fs[_0x9776('0x24')](path[_0x9776('0x23')](_0x318bfc,_0x2ea392));}return BPromise[_0x9776('0x25')](_0x16647a,function(_0x52594a){_0x3879e4[_0x9776('0x1d')](_0x52594a);})[_0x9776('0x26')](function(){for(var _0x4004e5=0x0;_0x4004e5<_0x3879e4[_0x9776('0x1c')];_0x4004e5+=0x1){var _0x5630d1;var _0x5878d1=_0x3879e4[_0x4004e5];if(_0x3bbc42){_0x5630d1=path[_0x9776('0x23')](_0x318bfc,_0x2ea392,util[_0x9776('0xf')](_0x9776('0x27'),_0x2ea392,_0x4004e5,_0x9776('0x28')));}else{_0x5630d1=path['join'](_0x318bfc,util[_0x9776('0xf')](_0x9776('0x29'),_0x2ea392,_0x9776('0x28')));}fs[_0x9776('0x2a')](_0x5630d1,json2xls(_0x5878d1),_0x9776('0x2b'));}})[_0x9776('0x26')](function(){if(_0x3bbc42){zipdir(path['join'](_0x318bfc,_0x2ea392),{'saveTo':path[_0x9776('0x23')](_0x318bfc,util[_0x9776('0xf')](_0x9776('0x29'),_0x2ea392,_0x9776('0x2c')))},function(_0x37186c,_0x5803a3){});rimraf(path['join'](_0x318bfc,_0x2ea392),function(){});}})[_0x9776('0x26')](function(){logger[_0x9776('0xe')](util['format'](_0x9776('0x2d'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x9776('0x2e'),_0x3bbc42?util['format'](_0x9776('0x29'),_0x2ea392,_0x3bbc42?_0x9776('0x2c'):_0x9776('0x28')):null);});})[_0x9776('0x2f')](function(_0x8c611d){logger[_0x9776('0xe')](util[_0x9776('0xf')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x9776('0x30')),util['inspect'](_0x8c611d,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x9776('0x31'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e4d8956..79bc921 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 _0x2394=['MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','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','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','Hangup','transaction','bulkCreate','catch','rewrite','lodash','models','Interval','intervals','VoiceExtension','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','groupBy','queue','playback','extensions','extension','find','push','Set','format','CDR(type)=%s','type','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','context','priority','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0'];(function(_0x3eb867,_0x460eea){var _0x1522da=function(_0x15b610){while(--_0x15b610){_0x3eb867['push'](_0x3eb867['shift']());}};_0x1522da(++_0x460eea);}(_0x2394,0x1f4));var _0x4239=function(_0x12f750,_0x44e587){_0x12f750=_0x12f750-0x0;var _0x18014b=_0x2394[_0x12f750];return _0x18014b;};'use strict';var _=require(_0x4239('0x0'));var util=require('util');function rewrite(_0x5af467,_0x257e2a){var _0xdf9b0a=this;return _0x5af467[_0x4239('0x1')][_0x4239('0x2')]['findAll']({'raw':!![]})['then'](function(_0x78dae3){_0xdf9b0a[_0x4239('0x3')]=_0x78dae3;return _0x5af467['models'][_0x4239('0x4')][_0x4239('0x5')]({'where':{'IntervalId':_0x257e2a[_0x4239('0x6')]},'raw':!![]});})['then'](function(_0x26b373){return _0x5af467[_0x4239('0x1')][_0x4239('0x4')][_0x4239('0x5')]({'where':{'exten':{'$in':_[_0x4239('0x7')](_[_0x4239('0x8')](_0x26b373,_0x4239('0x9')))}},'order':[{'raw':_0x4239('0xa')}],'raw':!![]});})[_0x4239('0xb')](function(_0x4d2066){var _0x3103e0=_['filter'](_0x4d2066,{'priority':'1'});var _0x3308aa=_['filter'](_0x4d2066,{'isApp':0x1});var _0x494914=_[_0x4239('0xc')](_0x3308aa,'exten');var _0x81b5ce=[_0x4239('0xd'),_0x4239('0xe')];var _0x4a6c1b=[];var _0x1d3476=[];for(var _0x533433 in _0x494914){if(_0x494914['hasOwnProperty'](_0x533433)){_0xdf9b0a['priority']=0x2;_0xdf9b0a[_0x4239('0xf')]=[];_0xdf9b0a[_0x4239('0x10')]=_[_0x4239('0x11')](_0x3103e0,{'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')]});_0xdf9b0a['extensions'][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0]['type'],'app':_0x4239('0x13'),'appdata':util[_0x4239('0x14')](_0x4239('0x15'),_0x494914[_0x533433][0x0][_0x4239('0x16')]),'context':_0x494914[_0x533433][0x0]['context'],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a['priority']++,'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});if(_0x494914[_0x533433][0x0][_0x4239('0x16')]===_0x4239('0x18')){if(_0xdf9b0a[_0x4239('0x10')]){_0xdf9b0a['extensions'][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0]['type'],'app':_0x4239('0x13'),'appdata':_0x4239('0x19')+(_0xdf9b0a[_0x4239('0x10')][_0x4239('0x1a')]?'${EXTEN:'+_0xdf9b0a[_0x4239('0x10')][_0x4239('0x1a')]+'}':_0x4239('0x1b')),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});}_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0x4239('0x1e')+_0x494914[_0x533433][0x0][_0x4239('0x17')],'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0]['exten'],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});var _0x1e2e10=_0xdf9b0a[_0x4239('0x1d')]++;_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x1f'),'appdata':_0x4239('0x20')+(_0x1e2e10+0x2)+_0x4239('0x21')+(_0x1e2e10+0x1)+')','context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0x1e2e10,'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});if(_0xdf9b0a[_0x4239('0x10')]){_0xdf9b0a['extensions'][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0xdf9b0a[_0x4239('0x10')][_0x4239('0x1a')]?_0x4239('0x22')+_0xdf9b0a[_0x4239('0x10')][_0x4239('0x1a')]+'}':_0x4239('0x23'),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});}_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':'Set','appdata':_0x4239('0x24')+_0x494914[_0x533433][0x0]['VoiceExtensionId'],'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a['priority']++,'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});if(_0xdf9b0a[_0x4239('0x10')]&&_0xdf9b0a['extension'][_0x4239('0x25')](_0x4239('0x26'))&&_0xdf9b0a[_0x4239('0x10')][_0x4239('0x26')]!==_0x4239('0x27')){_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});_0xdf9b0a[_0x4239('0xf')]['push']({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0x4239('0x28')+_0xdf9b0a[_0x4239('0x10')]['recordingFormat']||_0x4239('0x29'),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0]['exten'],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});}}_0xdf9b0a['extensions'][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0x4239('0x2a'),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0]['exten'],'priority':_0xdf9b0a['priority']++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0]['type'],'app':_0x4239('0x13'),'appdata':_0x4239('0x2b'),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});_0xdf9b0a['extensions']['push']({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':'Set','appdata':_0x4239('0x2c'),'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'priority':_0xdf9b0a[_0x4239('0x1d')]++,'VoiceExtensionId':_0x494914[_0x533433][0x0]['VoiceExtensionId']});for(var _0x338095=0x0,_0x24e3bf=0x0;_0x338095<_0x494914[_0x533433][_0x4239('0x2d')];_0x338095+=0x1,_0x24e3bf=0x0){var _0x218f7e=_0x494914[_0x533433][_0x338095];if(_0x218f7e['type']){_0x218f7e[_0x4239('0x16')]=_0x218f7e[_0x4239('0x16')][_0x4239('0x2e')]();}var _0x4f58b0=[];var _0x54d49b=[];delete _0x218f7e['id'];delete _0x218f7e[_0x4239('0x2f')];delete _0x218f7e['updatedAt'];var _0x4bb2b1=_0x218f7e[_0x4239('0x30')]!=='*,*,*,*'?[_0x218f7e[_0x4239('0x30')]]:_0x218f7e['IntervalId']?_[_0x4239('0x8')](_['filter'](_0xdf9b0a[_0x4239('0x3')],{'IntervalId':_0x218f7e[_0x4239('0x6')]}),_0x4239('0x30')):[];if(_0x218f7e[_0x4239('0x25')](_0x4239('0x31'))){if(_0x218f7e['tag']&&_0x218f7e['tag']!=='--'){_0x4f58b0[_0x4239('0x12')]({'type':_0x218f7e[_0x4239('0x16')],'app':'Set','appdata':'CDR(tag)='+_0x218f7e[_0x4239('0x31')],'context':_0x218f7e['context'],'exten':_0x218f7e[_0x4239('0x9')],'priority':_0x4bb2b1['length']+_0xdf9b0a['priority']+_0x24e3bf++,'VoiceExtensionId':_0x218f7e[_0x4239('0x17')]});}}if(_0x218f7e[_0x4239('0x16')]===_0x4239('0x18')&&_0x218f7e[_0x4239('0x25')](_0x4239('0x32'))){if(_0x218f7e[_0x4239('0x32')]){_0x4f58b0['push']({'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x1f'),'appdata':_0x4239('0x33')+_0x218f7e[_0x4239('0x32')]+')','context':_0x218f7e['context'],'exten':_0x218f7e['exten'],'priority':_0x4bb2b1['length']+_0xdf9b0a['priority']+_0x24e3bf++,'VoiceExtensionId':_0x218f7e[_0x4239('0x17')]});}else{_0x4f58b0[_0x4239('0x12')]({'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x1f'),'appdata':_0x4239('0x34'),'context':_0x218f7e[_0x4239('0x1c')],'exten':_0x218f7e[_0x4239('0x9')],'priority':_0x4bb2b1['length']+_0xdf9b0a[_0x4239('0x1d')]+_0x24e3bf++,'VoiceExtensionId':_0x218f7e[_0x4239('0x17')]});}}if(_0x218f7e[_0x4239('0x25')](_0x4239('0x35'))){if(_0x81b5ce['indexOf'](_0x218f7e['app'][_0x4239('0x2e')]())>=0x0&&_0x218f7e[_0x4239('0x36')]!==_0x4239('0x37')){if(_0x218f7e[_0x4239('0x35')]){_0x4f58b0[_0x4239('0x12')]({'type':_0x218f7e['type'],'app':_0x4239('0x1f'),'appdata':_0x4239('0x38'),'context':_0x218f7e[_0x4239('0x1c')],'exten':_0x218f7e[_0x4239('0x9')],'priority':_0x4bb2b1[_0x4239('0x2d')]+_0xdf9b0a[_0x4239('0x1d')]+_0x24e3bf++,'VoiceExtensionId':_0x218f7e['VoiceExtensionId']});_0x4f58b0[_0x4239('0x12')]({'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0x4239('0x39'),'context':_0x218f7e[_0x4239('0x1c')],'exten':_0x218f7e['exten'],'priority':_0x4bb2b1[_0x4239('0x2d')]+_0xdf9b0a[_0x4239('0x1d')]+_0x24e3bf++,'VoiceExtensionId':_0x218f7e[_0x4239('0x17')]});}else{_0x4f58b0['push']({'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x218f7e[_0x4239('0x1c')],'exten':_0x218f7e[_0x4239('0x9')],'priority':_0x4bb2b1[_0x4239('0x2d')]+_0xdf9b0a[_0x4239('0x1d')]+_0x24e3bf++,'VoiceExtensionId':_0x218f7e['VoiceExtensionId']});_0x4f58b0[_0x4239('0x12')]({'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x13'),'appdata':_0x4239('0x3a'),'context':_0x218f7e['context'],'exten':_0x218f7e[_0x4239('0x9')],'priority':_0x4bb2b1['length']+_0xdf9b0a[_0x4239('0x1d')]+_0x24e3bf++,'VoiceExtensionId':_0x218f7e[_0x4239('0x17')]});}}}for(var _0x333daf=0x0;_0x333daf<_0x4bb2b1[_0x4239('0x2d')];_0x333daf+=0x1){var _0x4f52ce=_0xdf9b0a['priority']+_0x4bb2b1[_0x4239('0x2d')];var _0x1a3f53=_0x333daf===_0x4bb2b1[_0x4239('0x2d')]-0x1?_0xdf9b0a[_0x4239('0x1d')]+_0x4f58b0[_0x4239('0x2d')]+_0x54d49b[_0x4239('0x2d')]+0x2:_0xdf9b0a[_0x4239('0x1d')]+_0x333daf+0x1;_0x4f58b0[_0x4239('0x3b')](_0x333daf,0x0,{'type':_0x218f7e[_0x4239('0x16')],'app':_0x4239('0x3c'),'appdata':_0x4bb2b1[_0x333daf]+'?'+_0x218f7e[_0x4239('0x1c')]+',${EXTEN},'+_0x4f52ce+':'+_0x218f7e[_0x4239('0x1c')]+',${EXTEN},'+_0x1a3f53,'exten':_0x218f7e[_0x4239('0x9')],'context':_0x218f7e[_0x4239('0x1c')],'priority':_0xdf9b0a['priority']+_0x333daf,'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});}_0x218f7e['priority']=_0x4f58b0[_0x4239('0x2d')]?_[_0x4239('0x3d')](_0x4f58b0)[_0x4239('0x1d')]+0x1:_0xdf9b0a[_0x4239('0x1d')];_0xdf9b0a[_0x4239('0x1d')]=(_0x54d49b[_0x4239('0x2d')]?_[_0x4239('0x3d')](_0x54d49b)['priority']:_0x218f7e[_0x4239('0x1d')])+0x1;_0xdf9b0a[_0x4239('0xf')]=_[_0x4239('0x3e')](_0xdf9b0a[_0x4239('0xf')],_0x4f58b0,[_0x218f7e],_0x54d49b);}_0xdf9b0a[_0x4239('0xf')][_0x4239('0x12')]({'type':_0x494914[_0x533433][0x0][_0x4239('0x16')],'app':_0x4239('0x3f'),'exten':_0x494914[_0x533433][0x0][_0x4239('0x9')],'context':_0x494914[_0x533433][0x0][_0x4239('0x1c')],'priority':_0xdf9b0a[_0x4239('0x1d')],'VoiceExtensionId':_0x494914[_0x533433][0x0][_0x4239('0x17')]});_0x4a6c1b[_0x4239('0x12')](_0x494914[_0x533433][0x0][_0x4239('0x17')]);_0x1d3476=_['concat'](_0x1d3476,_0xdf9b0a[_0x4239('0xf')]);}}return _0x5af467[_0x4239('0x40')](function(_0x16045d){return _0x5af467[_0x4239('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x4a6c1b}},'transaction':_0x16045d})['then'](function(_0x499e43){return _0x5af467['models'][_0x4239('0x4')][_0x4239('0x41')](_['sortBy'](_0x1d3476,'priority'),{'transaction':_0x16045d});});});})[_0x4239('0x42')](function(_0x535add){console['error'](_0x535add);});}exports[_0x4239('0x43')]=rewrite; \ No newline at end of file +var _0xb887=['extension','find','type','Set','format','context','VoiceExtensionId','push','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','*,*,*,*','IntervalId','interval','tag','outbound','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)','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','concat','transaction','destroy','sortBy','catch','lodash','then','intervals','VoiceExtension','findAll','models','uniq','map','exten','filter','groupBy','playback','priority','extensions'];(function(_0x570a4d,_0x3481e7){var _0x13872f=function(_0x36a679){while(--_0x36a679){_0x570a4d['push'](_0x570a4d['shift']());}};_0x13872f(++_0x3481e7);}(_0xb887,0xaf));var _0x7b88=function(_0x43c447,_0x42bb29){_0x43c447=_0x43c447-0x0;var _0x4607e6=_0xb887[_0x43c447];return _0x4607e6;};'use strict';var _=require(_0x7b88('0x0'));var util=require('util');function rewrite(_0x515594,_0x46ad8a){var _0x24cd4d=this;return _0x515594['models']['Interval']['findAll']({'raw':!![]})[_0x7b88('0x1')](function(_0x1f3a1c){_0x24cd4d[_0x7b88('0x2')]=_0x1f3a1c;return _0x515594['models'][_0x7b88('0x3')][_0x7b88('0x4')]({'where':{'IntervalId':_0x46ad8a['IntervalId']},'raw':!![]});})[_0x7b88('0x1')](function(_0x4b356f){return _0x515594[_0x7b88('0x5')][_0x7b88('0x3')][_0x7b88('0x4')]({'where':{'exten':{'$in':_[_0x7b88('0x6')](_[_0x7b88('0x7')](_0x4b356f,_0x7b88('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x4924ce){var _0x16b81a=_[_0x7b88('0x9')](_0x4924ce,{'priority':'1'});var _0x1046dc=_['filter'](_0x4924ce,{'isApp':0x1});var _0x52546d=_[_0x7b88('0xa')](_0x1046dc,_0x7b88('0x8'));var _0xb714d=['queue',_0x7b88('0xb')];var _0x34959c=[];var _0x1820ee=[];for(var _0x26440b in _0x52546d){if(_0x52546d['hasOwnProperty'](_0x26440b)){_0x24cd4d[_0x7b88('0xc')]=0x2;_0x24cd4d[_0x7b88('0xd')]=[];_0x24cd4d[_0x7b88('0xe')]=_[_0x7b88('0xf')](_0x16b81a,{'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')]});_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':util[_0x7b88('0x12')]('CDR(type)=%s',_0x52546d[_0x26440b][0x0]['type']),'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d['priority']++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});if(_0x52546d[_0x26440b][0x0][_0x7b88('0x10')]==='outbound'){if(_0x24cd4d[_0x7b88('0xe')]){_0x24cd4d[_0x7b88('0xd')][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':_0x7b88('0x16')+(_0x24cd4d[_0x7b88('0xe')]['cutdigits']?_0x7b88('0x17')+_0x24cd4d[_0x7b88('0xe')][_0x7b88('0x18')]+'}':_0x7b88('0x19')),'context':_0x52546d[_0x26440b][0x0]['context'],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d['priority']++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});}_0x24cd4d['extensions'][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':'Set','appdata':_0x7b88('0x1a')+_0x52546d[_0x26440b][0x0][_0x7b88('0x14')],'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d['priority']++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});var _0x1cac74=_0x24cd4d['priority']++;_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':_0x7b88('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1cac74+0x2)+_0x7b88('0x1c')+(_0x1cac74+0x1)+')','context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x1cac74,'VoiceExtensionId':_0x52546d[_0x26440b][0x0]['VoiceExtensionId']});if(_0x24cd4d['extension']){_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0]['type'],'app':'Set','appdata':_0x24cd4d['extension'][_0x7b88('0x18')]?_0x7b88('0x1d')+_0x24cd4d[_0x7b88('0xe')][_0x7b88('0x18')]+'}':_0x7b88('0x1e'),'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d['priority']++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});}_0x24cd4d['extensions'][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':'Set','appdata':_0x7b88('0x1f')+_0x52546d[_0x26440b][0x0][_0x7b88('0x14')],'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0]['exten'],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});if(_0x24cd4d[_0x7b88('0xe')]&&_0x24cd4d['extension'][_0x7b88('0x20')](_0x7b88('0x21'))&&_0x24cd4d[_0x7b88('0xe')][_0x7b88('0x21')]!=='none'){_0x24cd4d['extensions'][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0]['type'],'app':_0x7b88('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0]['exten'],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});_0x24cd4d[_0x7b88('0xd')][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':'Set','appdata':_0x7b88('0x22')+_0x24cd4d['extension'][_0x7b88('0x21')]||_0x7b88('0x23'),'context':_0x52546d[_0x26440b][0x0]['context'],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});}}_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':'Set','appdata':_0x7b88('0x24'),'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':_0x7b88('0x25'),'context':_0x52546d[_0x26440b][0x0][_0x7b88('0x13')],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0]['VoiceExtensionId']});_0x24cd4d[_0x7b88('0xd')]['push']({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':_0x7b88('0x26'),'context':_0x52546d[_0x26440b][0x0]['context'],'exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'priority':_0x24cd4d[_0x7b88('0xc')]++,'VoiceExtensionId':_0x52546d[_0x26440b][0x0]['VoiceExtensionId']});for(var _0x5e83b9=0x0,_0x4f32a2=0x0;_0x5e83b9<_0x52546d[_0x26440b][_0x7b88('0x27')];_0x5e83b9+=0x1,_0x4f32a2=0x0){var _0x4b16bc=_0x52546d[_0x26440b][_0x5e83b9];if(_0x4b16bc[_0x7b88('0x10')]){_0x4b16bc['type']=_0x4b16bc['type'][_0x7b88('0x28')]();}var _0x14bed5=[];var _0x328614=[];delete _0x4b16bc['id'];delete _0x4b16bc[_0x7b88('0x29')];delete _0x4b16bc['updatedAt'];var _0x558c8f=_0x4b16bc['interval']!==_0x7b88('0x2a')?[_0x4b16bc['interval']]:_0x4b16bc[_0x7b88('0x2b')]?_[_0x7b88('0x7')](_[_0x7b88('0x9')](_0x24cd4d[_0x7b88('0x2')],{'IntervalId':_0x4b16bc[_0x7b88('0x2b')]}),_0x7b88('0x2c')):[];if(_0x4b16bc[_0x7b88('0x20')]('tag')){if(_0x4b16bc['tag']&&_0x4b16bc[_0x7b88('0x2d')]!=='--'){_0x14bed5[_0x7b88('0x15')]({'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':'CDR(tag)='+_0x4b16bc[_0x7b88('0x2d')],'context':_0x4b16bc[_0x7b88('0x13')],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d['priority']+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc[_0x7b88('0x14')]});}}if(_0x4b16bc[_0x7b88('0x10')]===_0x7b88('0x2e')&&_0x4b16bc[_0x7b88('0x20')](_0x7b88('0x2f'))){if(_0x4b16bc[_0x7b88('0x2f')]){_0x14bed5[_0x7b88('0x15')]({'type':_0x4b16bc['type'],'app':_0x7b88('0x1b'),'appdata':_0x7b88('0x30')+_0x4b16bc['callerID']+')','context':_0x4b16bc[_0x7b88('0x13')],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d['priority']+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc['VoiceExtensionId']});}else{_0x14bed5[_0x7b88('0x15')]({'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x1b'),'appdata':_0x7b88('0x31'),'context':_0x4b16bc['context'],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d[_0x7b88('0xc')]+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc[_0x7b88('0x14')]});}}if(_0x4b16bc['hasOwnProperty']('answer')){if(_0xb714d['indexOf'](_0x4b16bc[_0x7b88('0x32')][_0x7b88('0x28')]())>=0x0&&_0x4b16bc[_0x7b88('0x33')]!==_0x7b88('0x34')){if(_0x4b16bc['answer']){_0x14bed5[_0x7b88('0x15')]({'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x1b'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4b16bc[_0x7b88('0x13')],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d[_0x7b88('0xc')]+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc[_0x7b88('0x14')]});_0x14bed5[_0x7b88('0x15')]({'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x11'),'appdata':_0x7b88('0x35'),'context':_0x4b16bc['context'],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d[_0x7b88('0xc')]+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc[_0x7b88('0x14')]});}else{_0x14bed5['push']({'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x1b'),'appdata':_0x7b88('0x36'),'context':_0x4b16bc[_0x7b88('0x13')],'exten':_0x4b16bc['exten'],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d[_0x7b88('0xc')]+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc['VoiceExtensionId']});_0x14bed5['push']({'type':_0x4b16bc['type'],'app':'Set','appdata':_0x7b88('0x37'),'context':_0x4b16bc[_0x7b88('0x13')],'exten':_0x4b16bc[_0x7b88('0x8')],'priority':_0x558c8f[_0x7b88('0x27')]+_0x24cd4d['priority']+_0x4f32a2++,'VoiceExtensionId':_0x4b16bc[_0x7b88('0x14')]});}}}for(var _0x490a94=0x0;_0x490a94<_0x558c8f[_0x7b88('0x27')];_0x490a94+=0x1){var _0x8fc906=_0x24cd4d[_0x7b88('0xc')]+_0x558c8f[_0x7b88('0x27')];var _0x4a9169=_0x490a94===_0x558c8f['length']-0x1?_0x24cd4d[_0x7b88('0xc')]+_0x14bed5[_0x7b88('0x27')]+_0x328614['length']+0x2:_0x24cd4d[_0x7b88('0xc')]+_0x490a94+0x1;_0x14bed5['splice'](_0x490a94,0x0,{'type':_0x4b16bc[_0x7b88('0x10')],'app':_0x7b88('0x38'),'appdata':_0x558c8f[_0x490a94]+'?'+_0x4b16bc[_0x7b88('0x13')]+_0x7b88('0x39')+_0x8fc906+':'+_0x4b16bc[_0x7b88('0x13')]+_0x7b88('0x39')+_0x4a9169,'exten':_0x4b16bc[_0x7b88('0x8')],'context':_0x4b16bc[_0x7b88('0x13')],'priority':_0x24cd4d[_0x7b88('0xc')]+_0x490a94,'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});}_0x4b16bc[_0x7b88('0xc')]=_0x14bed5[_0x7b88('0x27')]?_['last'](_0x14bed5)[_0x7b88('0xc')]+0x1:_0x24cd4d['priority'];_0x24cd4d['priority']=(_0x328614[_0x7b88('0x27')]?_['last'](_0x328614)['priority']:_0x4b16bc[_0x7b88('0xc')])+0x1;_0x24cd4d[_0x7b88('0xd')]=_[_0x7b88('0x3a')](_0x24cd4d[_0x7b88('0xd')],_0x14bed5,[_0x4b16bc],_0x328614);}_0x24cd4d[_0x7b88('0xd')][_0x7b88('0x15')]({'type':_0x52546d[_0x26440b][0x0][_0x7b88('0x10')],'app':'Hangup','exten':_0x52546d[_0x26440b][0x0][_0x7b88('0x8')],'context':_0x52546d[_0x26440b][0x0]['context'],'priority':_0x24cd4d[_0x7b88('0xc')],'VoiceExtensionId':_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]});_0x34959c[_0x7b88('0x15')](_0x52546d[_0x26440b][0x0][_0x7b88('0x14')]);_0x1820ee=_[_0x7b88('0x3a')](_0x1820ee,_0x24cd4d[_0x7b88('0xd')]);}}return _0x515594[_0x7b88('0x3b')](function(_0xa1de7c){return _0x515594[_0x7b88('0x5')]['VoiceExtension'][_0x7b88('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x34959c}},'transaction':_0xa1de7c})[_0x7b88('0x1')](function(_0x300b95){return _0x515594['models']['VoiceExtension']['bulkCreate'](_[_0x7b88('0x3d')](_0x1820ee,'priority'),{'transaction':_0xa1de7c});});});})[_0x7b88('0x3e')](function(_0x39d9f1){console['error'](_0x39d9f1);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9b29da7..5e1ecdc 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 _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x101daa,_0x2beb4a){var _0xbd4eeb=function(_0xe6296d){while(--_0xe6296d){_0x101daa['push'](_0x101daa['shift']());}};_0xbd4eeb(++_0x2beb4a);}(_0xe706,0xa3));var _0x6e70=function(_0x3a544a,_0x73a217){_0x3a544a=_0x3a544a-0x0;var _0x342f1e=_0xe706[_0x3a544a];return _0x342f1e;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);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(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file +var _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x4bd50f,_0x5e5c56){var _0x3564df=function(_0x395733){while(--_0x395733){_0x4bd50f['push'](_0x4bd50f['shift']());}};_0x3564df(++_0x5e5c56);}(_0xe706,0xa3));var _0x6e70=function(_0x564d53,_0x31ac8a){_0x564d53=_0x564d53-0x0;var _0x1ba891=_0xe706[_0x564d53];return _0x1ba891;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);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(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1f5121d..60f5b8f 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 _0x85e1=['spread','catch','info','main','binding','root','.csv','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','replace','scheduledat','isValid','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','SystemError','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','emit','unlink','exit','complete','argv','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_contacts.UserId','insert','cm_hopper','ListId','updatedAt','priority','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','into','cm_hopper_black','fromQuery','createdAt','fields','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','field','min_id','group','error','message','errors','push','code','sequelize','query'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x85e1,0x1cb));var _0x185e=function(_0x28f72e,_0x8600a6){_0x28f72e=_0x28f72e-0x0;var _0x17c161=_0x85e1[_0x28f72e];return _0x17c161;};'use strict';var fs=require('fs');var path=require(_0x185e('0x0'));var _=require(_0x185e('0x1'));var Papa=require(_0x185e('0x2'));var util=require(_0x185e('0x3'));var BPromise=require(_0x185e('0x4'));var moment=require(_0x185e('0x5'));var squel=require(_0x185e('0x6'));var Redis=require(_0x185e('0x7'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x185e('0x8'))('import');config[_0x185e('0x9')]=_[_0x185e('0xa')](config[_0x185e('0x9')],{'host':_0x185e('0xb'),'port':0x18eb});var socket=require(_0x185e('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x185e('0xd')](_0x185e('0xe'));function isEmail(_0x431401){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x431401);}function selectNotIn(_0x1db3c8,_0x2ca1d8,_0x40447f,_0x2ed08b,_0x21eea3){return squel[_0x185e('0xf')]()['field'](_0x185e('0x10'))[_0x185e('0x11')](_0x2ed08b)[_0x185e('0x12')](_0x2ca1d8,null,_0x2ca1d8+_0x185e('0x13')+_0x2ed08b+'.'+_0x40447f)[_0x185e('0x14')](_0x2ed08b+'.'+_0x40447f+_0x185e('0x15')+_0x1db3c8+'.'+_0x40447f)[_0x185e('0x14')](_0x2ca1d8+_0x185e('0x16')+_0x21eea3[_0x185e('0x12')]()+')');}function insertCmHopper(_0x4bc16c,_0x30cb1a,_0x1a9f0f,_0x588639,_0x5f69cd){var _0x3dca20=[_0x185e('0x17'),'cm_contacts.scheduledat',_0x185e('0x18'),'cm_contacts.ListId',_0x30cb1a+'.'+_0x588639,_0x185e('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x185e('0x1a'),'\x22'+_0x5f69cd+'\x22'];return squel[_0x185e('0x1b')]()['into'](_0x185e('0x1c'))['fromQuery'](['phone','scheduledat','ContactId',_0x185e('0x1d'),_0x588639,'createdAt',_0x185e('0x1e'),_0x185e('0x1f'),'UserId','recallme'],squel[_0x185e('0xf')]()['fields'](_0x3dca20)['from'](_0x30cb1a)[_0x185e('0x12')](_0x185e('0x20'),null,_0x185e('0x21')+_0x30cb1a+'.CmListId')[_0x185e('0x12')](_0x1a9f0f,null,_0x1a9f0f+'.id\x20=\x20'+_0x30cb1a+'.'+_0x588639)[_0x185e('0x14')](_0x30cb1a+_0x185e('0x22'),_0x4bc16c)[_0x185e('0x14')](_0x185e('0x23'),NOW)[_0x185e('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x30cb1a,_0x1a9f0f,_0x588639,_0x185e('0x1c'),[_0x185e('0x24'),_0x185e('0x25')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x30cb1a,_0x1a9f0f,_0x588639,_0x185e('0x1c'),[_0x185e('0x24')])))[_0x185e('0x26')]();}function insertCmHopperBlack(_0xd22b12,_0x471fbc,_0x3ee932,_0x42dd5b){var _0x3d2586=[_0x185e('0x17'),'cm_contacts.id',_0x185e('0x27'),_0x471fbc+'.'+_0x42dd5b,_0x185e('0x19'),_0x185e('0x28')];return squel[_0x185e('0x1b')]()[_0x185e('0x29')](_0x185e('0x2a'))[_0x185e('0x2b')](['phone','ContactId',_0x185e('0x1d'),_0x42dd5b,_0x185e('0x2c'),_0x185e('0x1e')],squel[_0x185e('0xf')]()[_0x185e('0x2d')](_0x3d2586)['from'](_0x471fbc)[_0x185e('0x12')](_0x185e('0x20'),null,_0x185e('0x21')+_0x471fbc+_0x185e('0x2e'))[_0x185e('0x12')](_0x3ee932,null,_0x3ee932+_0x185e('0x13')+_0x471fbc+'.'+_0x42dd5b)[_0x185e('0x14')](_0x471fbc+_0x185e('0x22'),_0xd22b12)[_0x185e('0x14')](_0x185e('0x23'),NOW)[_0x185e('0x14')](_0x185e('0x2f'),squel[_0x185e('0xf')]()['field'](_0x185e('0x10'))[_0x185e('0x11')](_0x185e('0x2a'))[_0x185e('0x14')](_0x185e('0x30'),_0xd22b12)['where'](_0x42dd5b+_0x185e('0x31'),_0x471fbc+'.'+_0x42dd5b)))[_0x185e('0x26')]();}function insertCmContact(_0x19bc17,_0x2901de,_0x415a57,_0x2332ab){var _0x1b6727=_[_0x185e('0x32')](_[_0x185e('0x33')](_0x2332ab),[_0x185e('0x1d'),_0x185e('0x34'),_0x185e('0x2c'),_0x185e('0x1e')]);return squel[_0x185e('0x1b')]()['into'](_0x185e('0x20'))['fromQuery'](_0x1b6727,squel[_0x185e('0xf')]()['fields'](_0x1b6727)[_0x185e('0x11')](_0x2901de)[_0x185e('0x14')]('('+_0x415a57[_0x185e('0x12')](',')+_0x185e('0x35'),squel['select']()[_0x185e('0x2d')](_0x415a57)[_0x185e('0x11')](_0x185e('0x20'))[_0x185e('0x14')](_0x185e('0x30'),_0x19bc17)['where'](_0x185e('0x36')))['where']('id\x20IN\x20?',squel['select']()[_0x185e('0x37')]('MIN(id)',_0x185e('0x38'))[_0x185e('0x11')](_0x2901de)[_0x185e('0x39')](_0x415a57['join'](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x171f61){logger[_0x185e('0x3a')](_0x171f61[_0x185e('0x3b')]);process['exit'](0x1);}function handleError(_0x4a8018,_0xc1f30c){stats[_0x185e('0x3c')][_0x185e('0x3d')]({'name':_0xc1f30c[_0x185e('0x3e')],'message':_0xc1f30c[_0x185e('0x3b')],'row':_0x4a8018});}function handleQuery(_0x4d1fe8){logger['info'](_0x4d1fe8);return db[_0x185e('0x3f')][_0x185e('0x40')](_0x4d1fe8)[_0x185e('0x41')](function(_0x1ff8ea){results[_0x185e('0x3d')](_0x1ff8ea);})[_0x185e('0x42')](function(_0x4aacfb){logger[_0x185e('0x3a')](_0x4aacfb[_0x185e('0x3b')]);});}function main(_0x147020,_0x18f7ec,_0x5b7d4b,_0x5310da){logger[_0x185e('0x43')](_0x185e('0x44'),_0x147020,JSON['stringify'](_0x18f7ec));process['send']('start');var _0x5718d1=_0x18f7ec[_0x185e('0x45')];var _0x10eaea=_0x18f7ec['socket_timestamp'];var _0x5a1073=path[_0x185e('0x12')](config[_0x185e('0x46')],'server/files/tmp',_0x10eaea+_0x185e('0x47'));var _0x143c1f=_['keys'](_0x5718d1)['join']();logger['info'](_0x185e('0x48'),_0x143c1f);fs[_0x185e('0x49')](_0x5a1073,_0x143c1f+'\x0a');Papa[_0x185e('0x4a')](fs[_0x185e('0x4b')](_0x147020),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2614f9,_0x1f4bc6){try{for(var _0xf34905=0x0,_0x5ab4f8=[];_0xf34905<_0x2614f9[_0x185e('0x4c')][_0x185e('0x4d')];_0xf34905++){stats['rows']+=0x1;if(_0x2614f9[_0x185e('0x3c')][_0xf34905]){handleError(_0x2614f9[_0x185e('0x4c')][_0xf34905],_0x2614f9[_0x185e('0x3c')][_0xf34905]);}else{var _0x154acd=[];for(var _0x4ea7b6 in _0x5718d1){if(_0x5718d1[_0x185e('0x4e')](_0x4ea7b6)){if(_0x2614f9['data'][_0xf34905][_0x5718d1[_0x4ea7b6]]){var _0x203df2=_['trim'](_0x2614f9[_0x185e('0x4c')][_0xf34905][_0x5718d1[_0x4ea7b6]][_0x185e('0x4f')](/"/g,'\x27'));switch(_0x4ea7b6){case _0x185e('0x50'):var _0x7ff25=moment(_0x203df2,_0x185e('0xe'),!![]);if(_0x7ff25[_0x185e('0x51')]()){_0x5ab4f8[_0x185e('0x3d')]('\x22'+_0x203df2+'\x22');}else{_0x154acd[_0x185e('0x3d')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x185e('0x1f'):var _0x5a9182=parseInt(_0x203df2);_0x203df2=_[_0x185e('0x52')](_0x5a9182)||_0x5a9182<0x0||_0x5a9182>0x4?_0x5310da?0x3:0x2:_0x5a9182;_0x5ab4f8['push']('\x22'+_0x203df2+'\x22');break;case _0x185e('0x53'):var _0x4bfc1c=parseInt(_0x203df2);if(_[_0x185e('0x54')](_0x4bfc1c)&&_[_0x185e('0x55')](_0x5b7d4b,_0x4bfc1c)){_0x5ab4f8[_0x185e('0x3d')]('\x22'+_0x4bfc1c+'\x22');}else{_0x154acd[_0x185e('0x3d')](_0x185e('0x56'));}break;case _0x185e('0x57'):if(isEmail(_0x203df2)){_0x5ab4f8[_0x185e('0x3d')]('\x22'+_0x203df2+'\x22');}else{_0x154acd[_0x185e('0x3d')](_0x185e('0x58'));}break;case'dateOfBirth':var _0x257d49=moment(_0x203df2,_0x185e('0x59'),!![]);if(_0x257d49[_0x185e('0x51')]()){_0x5ab4f8[_0x185e('0x3d')]('\x22'+_0x203df2+'\x22');}else{_0x154acd[_0x185e('0x3d')](_0x185e('0x5a'));}break;default:_0x5ab4f8[_0x185e('0x3d')]('\x22'+_0x203df2+'\x22');}}else{switch(_0x4ea7b6){case _0x185e('0x5b'):case _0x185e('0x10'):_0x154acd[_0x185e('0x3d')](_0x4ea7b6+'\x20not\x20specified');break;default:_0x5ab4f8['push']('\x22\x22');}}}}if(_0x154acd[_0x185e('0x4d')]){handleError(_0x2614f9['data'][_0xf34905],{'code':_0x185e('0x5c'),'message':_0x154acd[_0x185e('0x12')]()});}else{fs[_0x185e('0x5d')](_0x5a1073,_0x5ab4f8[_0x185e('0x12')]()+'\x0a');}_0x5ab4f8=[];}if(!(stats[_0x185e('0x5e')]%0xc8)){socket['emit'](_0x185e('0x5f')+_0x10eaea,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x185e('0x60'));_0x1f4bc6[_0x185e('0x61')]();}}catch(_0x50b6f3){handleError(_0x2614f9['data'][_0xf34905],{'code':_0x185e('0x62'),'message':_0x50b6f3['message']});logger[_0x185e('0x3a')](_0x185e('0x63'),_0x50b6f3[_0x185e('0x3b')]);}},'complete':function(){try{var _0x16be54=[];var _0x25c0ae='cm_contacts';if(_0x18f7ec[_0x185e('0x64')]&&_0x18f7ec[_0x185e('0x64')]['length']){_0x25c0ae=_0x185e('0x65')+_0x10eaea;_0x16be54['push']('CREATE\x20TABLE\x20'+_0x25c0ae+_0x185e('0x66'));}var _0x2bea4e=util['format'](_0x185e('0x67'),_0x5a1073,_0x25c0ae,_0x143c1f,_0x18f7ec['ListId'],_0x18f7ec[_0x185e('0x34')]||null,NOW,NOW);if(_[_0x185e('0x68')](_0x5718d1['scheduledat'])){_0x2bea4e+=_0x185e('0x69');}_0x16be54['push'](_0x2bea4e);if(_0x18f7ec[_0x185e('0x64')]&&_0x18f7ec['duplicates']['length']){_0x16be54[_0x185e('0x3d')](insertCmContact(_0x18f7ec[_0x185e('0x1d')],_0x25c0ae,_0x18f7ec[_0x185e('0x64')],_0x5718d1));_0x16be54[_0x185e('0x3d')](_0x185e('0x6a')+_0x25c0ae+';');}_0x16be54[_0x185e('0x3d')](insertCmHopper(_0x18f7ec[_0x185e('0x1d')],'voice_queues_has_cm_lists',_0x185e('0x6b'),_0x185e('0x6c'),_0x5310da));_0x16be54[_0x185e('0x3d')](insertCmHopperBlack(_0x18f7ec['ListId'],_0x185e('0x6d'),_0x185e('0x6b'),_0x185e('0x6c')));_0x16be54[_0x185e('0x3d')](insertCmHopper(_0x18f7ec[_0x185e('0x1d')],_0x185e('0x6e'),_0x185e('0x6f'),'CampaignId',_0x5310da));_0x16be54[_0x185e('0x3d')](insertCmHopperBlack(_0x18f7ec['ListId'],_0x185e('0x70'),_0x185e('0x6f'),_0x185e('0x71')));BPromise[_0x185e('0x72')](_0x16be54,handleQuery)[_0x185e('0x73')](function(_0x211df2){stats[_0x185e('0x74')]=!![];stats[_0x185e('0x75')]=_0x18f7ec['duplicates']&&_0x18f7ec['duplicates'][_0x185e('0x4d')]?results[0x2][_0x185e('0x75')]:results[0x0][_0x185e('0x75')];socket[_0x185e('0x76')]('contact:import:'+_0x10eaea,stats);fs[_0x185e('0x77')](_0x147020);fs[_0x185e('0x77')](_0x5a1073);process[_0x185e('0x78')](0x0);})['catch'](function(_0x33bff4){logger[_0x185e('0x3a')](_0x33bff4['message']);process[_0x185e('0x78')](0x1);});}catch(_0xc1a31e){logger[_0x185e('0x3a')](_0x185e('0x79'),_0xc1a31e[_0x185e('0x3b')]);process[_0x185e('0x78')](0x1);}},'error':function(_0x3cc841,_0x11081f,_0x58a5c1,_0x251202){throw new Error(_0x251202);}});}function validate(){if(process[_0x185e('0x7a')]&&process[_0x185e('0x7a')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x498049=path[_0x185e('0x12')](config[_0x185e('0x46')],_0x185e('0x7b'),process[_0x185e('0x7a')][0x2]);if(!fs[_0x185e('0x7c')](_0x498049)){throw new Error(_0x185e('0x7d'));}var _0x25d330={};try{_0x25d330=JSON[_0x185e('0x4a')](process[_0x185e('0x7a')][0x3]);if(!_0x25d330['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x25d330[_0x185e('0x45')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x25d330['binding'][_0x185e('0x5b')]){throw new Error(_0x185e('0x7e'));}var _0x5cf0a4=0x0;if(_0x25d330[_0x185e('0x45')][_0x185e('0x53')]){_0x5cf0a4=0x1;}if(!_0x25d330[_0x185e('0x1d')]){throw new Error(_0x185e('0x7f'));}}catch(_0x3a9aed){throw new Error('body\x20id\x20mandatory');}var _0x4e6fdb=[];try{_0x4e6fdb=_[_0x185e('0x80')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x56ddf3){logger[_0x185e('0x43')](_0x185e('0x81'));}main(_0x498049,_0x25d330,_0x4e6fdb,_0x5cf0a4);}validate();process['on'](_0x185e('0x82'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x4cfa=['send','start','binding','socket_timestamp','.csv','header','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns','CampaignId','each','then','affectedRows','unlink','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','fromQuery','select','cm_contacts','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x4cfa,0xb9));var _0xa4cf=function(_0x5555c6,_0x3b388f){_0x5555c6=_0x5555c6-0x0;var _0x5e8dc5=_0x4cfa[_0x5555c6];return _0x5e8dc5;};'use strict';var fs=require('fs');var path=require(_0xa4cf('0x0'));var _=require(_0xa4cf('0x1'));var Papa=require(_0xa4cf('0x2'));var util=require(_0xa4cf('0x3'));var BPromise=require('bluebird');var moment=require(_0xa4cf('0x4'));var squel=require(_0xa4cf('0x5'));var Redis=require(_0xa4cf('0x6'));var db=require(_0xa4cf('0x7'))['db'];var config=require(_0xa4cf('0x8'));var logger=require('../../../config/logger')('import');config[_0xa4cf('0x9')]=_[_0xa4cf('0xa')](config[_0xa4cf('0x9')],{'host':_0xa4cf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4cf('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa4cf('0xc')](_0xa4cf('0xd'));function isEmail(_0x398c34){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x398c34);}function selectNotIn(_0x434beb,_0x459ee2,_0x569a72,_0x8118c5,_0x70a3e1){return squel['select']()[_0xa4cf('0xe')]('phone')[_0xa4cf('0xf')](_0x8118c5)[_0xa4cf('0x10')](_0x459ee2,null,_0x459ee2+_0xa4cf('0x11')+_0x8118c5+'.'+_0x569a72)[_0xa4cf('0x12')](_0x8118c5+'.'+_0x569a72+_0xa4cf('0x13')+_0x434beb+'.'+_0x569a72)[_0xa4cf('0x12')](_0x459ee2+_0xa4cf('0x14')+_0x70a3e1['join']()+')');}function insertCmHopper(_0x1cae94,_0x4fab7d,_0x20ba1a,_0xe45273,_0x557456){var _0x531a28=[_0xa4cf('0x15'),'cm_contacts.scheduledat','cm_contacts.id',_0xa4cf('0x16'),_0x4fab7d+'.'+_0xe45273,'cm_contacts.createdAt',_0xa4cf('0x17'),_0xa4cf('0x18'),_0xa4cf('0x19'),'\x22'+_0x557456+'\x22'];return squel[_0xa4cf('0x1a')]()[_0xa4cf('0x1b')](_0xa4cf('0x1c'))['fromQuery']([_0xa4cf('0x1d'),_0xa4cf('0x1e'),_0xa4cf('0x1f'),_0xa4cf('0x20'),_0xe45273,_0xa4cf('0x21'),_0xa4cf('0x22'),_0xa4cf('0x23'),_0xa4cf('0x24'),_0xa4cf('0x25')],squel['select']()[_0xa4cf('0x26')](_0x531a28)[_0xa4cf('0xf')](_0x4fab7d)[_0xa4cf('0x10')]('cm_contacts',null,_0xa4cf('0x27')+_0x4fab7d+_0xa4cf('0x28'))['join'](_0x20ba1a,null,_0x20ba1a+'.id\x20=\x20'+_0x4fab7d+'.'+_0xe45273)['where'](_0x4fab7d+_0xa4cf('0x29'),_0x1cae94)[_0xa4cf('0x12')](_0xa4cf('0x2a'),NOW)['where'](_0xa4cf('0x2b'),selectNotIn(_0x4fab7d,_0x20ba1a,_0xe45273,_0xa4cf('0x1c'),[_0xa4cf('0x2c'),_0xa4cf('0x2d')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4fab7d,_0x20ba1a,_0xe45273,_0xa4cf('0x1c'),[_0xa4cf('0x2c')])))['toString']();}function insertCmHopperBlack(_0x432a08,_0x28ed72,_0x49d611,_0xd231f5){var _0x294a23=['cm_contacts.phone','cm_contacts.id',_0xa4cf('0x16'),_0x28ed72+'.'+_0xd231f5,_0xa4cf('0x2e'),_0xa4cf('0x17')];return squel[_0xa4cf('0x1a')]()['into']('cm_hopper_black')[_0xa4cf('0x2f')](['phone',_0xa4cf('0x1f'),_0xa4cf('0x20'),_0xd231f5,_0xa4cf('0x21'),_0xa4cf('0x22')],squel[_0xa4cf('0x30')]()['fields'](_0x294a23)[_0xa4cf('0xf')](_0x28ed72)[_0xa4cf('0x10')](_0xa4cf('0x31'),null,_0xa4cf('0x27')+_0x28ed72+_0xa4cf('0x28'))['join'](_0x49d611,null,_0x49d611+_0xa4cf('0x11')+_0x28ed72+'.'+_0xd231f5)[_0xa4cf('0x12')](_0x28ed72+_0xa4cf('0x29'),_0x432a08)['where'](_0xa4cf('0x2a'),NOW)['where'](_0xa4cf('0x2b'),squel['select']()[_0xa4cf('0xe')]('phone')['from'](_0xa4cf('0x32'))[_0xa4cf('0x12')](_0xa4cf('0x33'),_0x432a08)['where'](_0xd231f5+_0xa4cf('0x34'),_0x28ed72+'.'+_0xd231f5)))['toString']();}function insertCmContact(_0x2ce9e2,_0x5234d3,_0x1919c1,_0x2008a7){var _0x36c644=_[_0xa4cf('0x35')](_[_0xa4cf('0x36')](_0x2008a7),[_0xa4cf('0x20'),_0xa4cf('0x37'),'createdAt',_0xa4cf('0x22')]);return squel[_0xa4cf('0x1a')]()[_0xa4cf('0x1b')](_0xa4cf('0x31'))[_0xa4cf('0x2f')](_0x36c644,squel['select']()[_0xa4cf('0x26')](_0x36c644)[_0xa4cf('0xf')](_0x5234d3)[_0xa4cf('0x12')]('('+_0x1919c1[_0xa4cf('0x10')](',')+_0xa4cf('0x38'),squel[_0xa4cf('0x30')]()[_0xa4cf('0x26')](_0x1919c1)[_0xa4cf('0xf')](_0xa4cf('0x31'))[_0xa4cf('0x12')](_0xa4cf('0x33'),_0x2ce9e2)[_0xa4cf('0x12')](_0xa4cf('0x39')))[_0xa4cf('0x12')](_0xa4cf('0x3a'),squel[_0xa4cf('0x30')]()[_0xa4cf('0xe')](_0xa4cf('0x3b'),_0xa4cf('0x3c'))[_0xa4cf('0xf')](_0x5234d3)[_0xa4cf('0x3d')](_0x1919c1[_0xa4cf('0x10')](','))))['toString']();}function handleStop(){logger[_0xa4cf('0x3e')](_0xa4cf('0x3f'));stopped=!![];}function handleUncaughtException(_0x296f56){logger[_0xa4cf('0x40')](_0x296f56[_0xa4cf('0x41')]);process[_0xa4cf('0x42')](0x1);}function handleError(_0x3f2002,_0x3016ea){stats[_0xa4cf('0x43')][_0xa4cf('0x44')]({'name':_0x3016ea[_0xa4cf('0x45')],'message':_0x3016ea['message'],'row':_0x3f2002});}function handleQuery(_0x16db37){logger[_0xa4cf('0x3e')](_0x16db37);return db[_0xa4cf('0x46')][_0xa4cf('0x47')](_0x16db37)[_0xa4cf('0x48')](function(_0x2851bb){results[_0xa4cf('0x44')](_0x2851bb);})[_0xa4cf('0x49')](function(_0x271ede){logger[_0xa4cf('0x40')](_0x271ede[_0xa4cf('0x41')]);});}function main(_0x3e0fbd,_0x4bb551,_0x2c44f3,_0x4433fa){logger['info'](_0xa4cf('0x4a'),_0x3e0fbd,JSON['stringify'](_0x4bb551));process[_0xa4cf('0x4b')](_0xa4cf('0x4c'));var _0x5994d3=_0x4bb551[_0xa4cf('0x4d')];var _0x293d9b=_0x4bb551[_0xa4cf('0x4e')];var _0x2f56c1=path['join'](config['root'],'server/files/tmp',_0x293d9b+_0xa4cf('0x4f'));var _0x4e0ea1=_[_0xa4cf('0x36')](_0x5994d3)[_0xa4cf('0x10')]();logger['info'](_0xa4cf('0x50'),_0x4e0ea1);fs[_0xa4cf('0x51')](_0x2f56c1,_0x4e0ea1+'\x0a');Papa[_0xa4cf('0x52')](fs['createReadStream'](_0x3e0fbd),{'header':!![],'skipEmptyLines':!![],'step':function(_0x151768,_0x4f6f11){try{for(var _0x3343fe=0x0,_0x5721b5=[];_0x3343fe<_0x151768[_0xa4cf('0x53')][_0xa4cf('0x54')];_0x3343fe++){stats[_0xa4cf('0x55')]+=0x1;if(_0x151768[_0xa4cf('0x43')][_0x3343fe]){handleError(_0x151768[_0xa4cf('0x53')][_0x3343fe],_0x151768[_0xa4cf('0x43')][_0x3343fe]);}else{var _0x5ecea0=[];for(var _0x1b6120 in _0x5994d3){if(_0x5994d3[_0xa4cf('0x56')](_0x1b6120)){if(_0x151768[_0xa4cf('0x53')][_0x3343fe][_0x5994d3[_0x1b6120]]){var _0x3bb9a4=_[_0xa4cf('0x57')](_0x151768[_0xa4cf('0x53')][_0x3343fe][_0x5994d3[_0x1b6120]]['replace'](/"/g,'\x27'));switch(_0x1b6120){case _0xa4cf('0x1e'):var _0x49129b=moment(_0x3bb9a4,_0xa4cf('0xd'),!![]);if(_0x49129b[_0xa4cf('0x58')]()){_0x5721b5['push']('\x22'+_0x3bb9a4+'\x22');}else{_0x5ecea0[_0xa4cf('0x44')](_0xa4cf('0x59'));}break;case _0xa4cf('0x23'):var _0x4ba9ac=parseInt(_0x3bb9a4);_0x3bb9a4=_[_0xa4cf('0x5a')](_0x4ba9ac)||_0x4ba9ac<0x0||_0x4ba9ac>0x4?_0x4433fa?0x3:0x2:_0x4ba9ac;_0x5721b5[_0xa4cf('0x44')]('\x22'+_0x3bb9a4+'\x22');break;case'UserId':var _0x4c828e=parseInt(_0x3bb9a4);if(_[_0xa4cf('0x5b')](_0x4c828e)&&_[_0xa4cf('0x5c')](_0x2c44f3,_0x4c828e)){_0x5721b5[_0xa4cf('0x44')]('\x22'+_0x4c828e+'\x22');}else{_0x5ecea0[_0xa4cf('0x44')]('agent\x20not\x20exists');}break;case _0xa4cf('0x5d'):if(isEmail(_0x3bb9a4)){_0x5721b5[_0xa4cf('0x44')]('\x22'+_0x3bb9a4+'\x22');}else{_0x5ecea0[_0xa4cf('0x44')](_0xa4cf('0x5e'));}break;case _0xa4cf('0x5f'):var _0x1f4705=moment(_0x3bb9a4,_0xa4cf('0x60'),!![]);if(_0x1f4705['isValid']()){_0x5721b5[_0xa4cf('0x44')]('\x22'+_0x3bb9a4+'\x22');}else{_0x5ecea0[_0xa4cf('0x44')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5721b5[_0xa4cf('0x44')]('\x22'+_0x3bb9a4+'\x22');}}else{switch(_0x1b6120){case _0xa4cf('0x61'):case _0xa4cf('0x1d'):_0x5ecea0['push'](_0x1b6120+_0xa4cf('0x62'));break;default:_0x5721b5[_0xa4cf('0x44')]('\x22\x22');}}}}if(_0x5ecea0[_0xa4cf('0x54')]){handleError(_0x151768['data'][_0x3343fe],{'code':_0xa4cf('0x63'),'message':_0x5ecea0[_0xa4cf('0x10')]()});}else{fs['appendFileSync'](_0x2f56c1,_0x5721b5[_0xa4cf('0x10')]()+'\x0a');}_0x5721b5=[];}if(!(stats[_0xa4cf('0x55')]%0xc8)){socket[_0xa4cf('0x64')](_0xa4cf('0x65')+_0x293d9b,stats);stats[_0xa4cf('0x43')]=[];}}if(stopped){logger[_0xa4cf('0x3e')](_0xa4cf('0x66'));_0x4f6f11[_0xa4cf('0x67')]();}}catch(_0x2fda65){handleError(_0x151768[_0xa4cf('0x53')][_0x3343fe],{'code':_0xa4cf('0x68'),'message':_0x2fda65[_0xa4cf('0x41')]});logger[_0xa4cf('0x40')](_0xa4cf('0x69'),_0x2fda65['message']);}},'complete':function(){try{var _0x547384=[];var _0x4232a0=_0xa4cf('0x31');if(_0x4bb551[_0xa4cf('0x6a')]&&_0x4bb551[_0xa4cf('0x6a')][_0xa4cf('0x54')]){_0x4232a0=_0xa4cf('0x6b')+_0x293d9b;_0x547384[_0xa4cf('0x44')]('CREATE\x20TABLE\x20'+_0x4232a0+'\x20LIKE\x20cm_contacts;');}var _0x59459f=util[_0xa4cf('0xc')](_0xa4cf('0x6c'),_0x2f56c1,_0x4232a0,_0x4e0ea1,_0x4bb551[_0xa4cf('0x20')],_0x4bb551[_0xa4cf('0x37')]||null,NOW,NOW);if(_[_0xa4cf('0x6d')](_0x5994d3['scheduledat'])){_0x59459f+=_0xa4cf('0x6e');}_0x547384[_0xa4cf('0x44')](_0x59459f);if(_0x4bb551[_0xa4cf('0x6a')]&&_0x4bb551['duplicates']['length']){_0x547384['push'](insertCmContact(_0x4bb551[_0xa4cf('0x20')],_0x4232a0,_0x4bb551['duplicates'],_0x5994d3));_0x547384[_0xa4cf('0x44')](_0xa4cf('0x6f')+_0x4232a0+';');}_0x547384[_0xa4cf('0x44')](insertCmHopper(_0x4bb551[_0xa4cf('0x20')],'voice_queues_has_cm_lists',_0xa4cf('0x70'),_0xa4cf('0x71'),_0x4433fa));_0x547384[_0xa4cf('0x44')](insertCmHopperBlack(_0x4bb551[_0xa4cf('0x20')],'voice_queues_has_cm_blacklists','voice_queues',_0xa4cf('0x71')));_0x547384[_0xa4cf('0x44')](insertCmHopper(_0x4bb551['ListId'],'campaigns_has_cm_lists',_0xa4cf('0x72'),_0xa4cf('0x73'),_0x4433fa));_0x547384['push'](insertCmHopperBlack(_0x4bb551[_0xa4cf('0x20')],'campaigns_has_cm_blacklists',_0xa4cf('0x72'),_0xa4cf('0x73')));BPromise[_0xa4cf('0x74')](_0x547384,handleQuery)[_0xa4cf('0x75')](function(_0x503562){stats['finish']=!![];stats[_0xa4cf('0x76')]=_0x4bb551[_0xa4cf('0x6a')]&&_0x4bb551['duplicates'][_0xa4cf('0x54')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0xa4cf('0x64')]('contact:import:'+_0x293d9b,stats);fs[_0xa4cf('0x77')](_0x3e0fbd);fs[_0xa4cf('0x77')](_0x2f56c1);process[_0xa4cf('0x42')](0x0);})[_0xa4cf('0x49')](function(_0x325fce){logger[_0xa4cf('0x40')](_0x325fce['message']);process[_0xa4cf('0x42')](0x1);});}catch(_0x58b271){logger['error']('complete',_0x58b271[_0xa4cf('0x41')]);process['exit'](0x1);}},'error':function(_0x4c16fc,_0x32f4cb,_0x222f5e,_0x12757c){throw new Error(_0x12757c);}});}function validate(){if(process['argv']&&process[_0xa4cf('0x78')]['length']<0x4){throw new Error(_0xa4cf('0x79'));}var _0x3331bc=path[_0xa4cf('0x10')](config[_0xa4cf('0x7a')],'server/files/tmp',process[_0xa4cf('0x78')][0x2]);if(!fs[_0xa4cf('0x7b')](_0x3331bc)){throw new Error(_0xa4cf('0x7c'));}var _0x1b1408={};try{_0x1b1408=JSON['parse'](process[_0xa4cf('0x78')][0x3]);if(!_0x1b1408[_0xa4cf('0x4d')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x1b1408[_0xa4cf('0x4d')][_0xa4cf('0x1d')]){throw new Error(_0xa4cf('0x7d'));}if(!_0x1b1408['binding'][_0xa4cf('0x61')]){throw new Error(_0xa4cf('0x7e'));}var _0x41a5e7=0x0;if(_0x1b1408['binding'][_0xa4cf('0x24')]){_0x41a5e7=0x1;}if(!_0x1b1408[_0xa4cf('0x20')]){throw new Error(_0xa4cf('0x7f'));}}catch(_0x47360e){throw new Error(_0xa4cf('0x80'));}var _0x2de744=[];try{_0x2de744=_['map'](JSON[_0xa4cf('0x52')](process[_0xa4cf('0x78')][0x4]),'id');}catch(_0x1683c2){logger[_0xa4cf('0x3e')]('No\x20agent\x20available');}main(_0x3331bc,_0x1b1408,_0x2de744,_0x41a5e7);}validate();process['on'](_0xa4cf('0x81'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 0f3eff6..c4a26f8 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 _0xeb3b=['endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','voice','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','membername','starttime','Answer\x20Time','answertime','Complete\x20Time'];(function(_0x50514b,_0x83db65){var _0x5d8587=function(_0x327ba5){while(--_0x327ba5){_0x50514b['push'](_0x50514b['shift']());}};_0x5d8587(++_0x83db65);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0xeb3b[_0x58efa6];return _0x5d643c;};'use strict';exports[_0xbeb3('0x0')]=function(_0x1130ba,_0xc5aaa3){var _0x33e049=[{'type':_0xbeb3('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1130ba['toLowerCase']()){case _0xbeb3('0x2'):switch(_0xc5aaa3['toLowerCase']()){case _0xbeb3('0x3'):_0x33e049['push']({'type':_0xbeb3('0x4'),'content':'','variableName':_0xbeb3('0x5')});_0x33e049[_0xbeb3('0x6')]({'type':_0xbeb3('0x4'),'content':'','variableName':_0xbeb3('0x7')});break;case _0xbeb3('0x8'):_0x33e049['push']({'type':_0xbeb3('0x1'),'content':_0xbeb3('0x9'),'variableName':null});_0x33e049[_0xbeb3('0x6')]({'type':_0xbeb3('0x4'),'content':'','variableName':_0xbeb3('0xa')});break;}}return _0x33e049;};exports[_0xbeb3('0xb')]=function(_0x10161e,_0x567333){var _0x2d1e06=[];switch(_0x10161e[_0xbeb3('0xc')]()){case'voice':switch(_0x567333[_0xbeb3('0xc')]()){case _0xbeb3('0x3'):_0x2d1e06=[{'type':_0xbeb3('0x1'),'content':_0xbeb3('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0xf'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x10'),'keyType':'variable','variableName':'calleridname'},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x11'),'keyType':_0xbeb3('0x4'),'variableName':_0xbeb3('0x12')},{'type':_0xbeb3('0xe'),'content':'','key':'Queue','keyType':_0xbeb3('0x4'),'variableName':'queue'},{'type':_0xbeb3('0xe'),'content':'','key':'UniqueId','keyType':'variable','variableName':'uniqueid'},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x13'),'keyType':_0xbeb3('0x4'),'variableName':_0xbeb3('0x14')},{'type':'string','content':_0xbeb3('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x16'),'keyType':'variable','variableName':'destcalleridname'},{'type':_0xbeb3('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xbeb3('0x4'),'variableName':'destcalleridnum'},{'type':'string','content':_0xbeb3('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x18'),'keyType':'variable','variableName':_0xbeb3('0x14')},{'type':_0xbeb3('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xbeb3('0x4'),'variableName':_0xbeb3('0x19')},{'type':'keyValue','content':'','key':_0xbeb3('0x1a'),'keyType':_0xbeb3('0x4'),'variableName':_0xbeb3('0x1b')},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x1c'),'keyType':_0xbeb3('0x4'),'variableName':_0xbeb3('0x1d')},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case _0xbeb3('0x8'):_0x2d1e06=[{'type':'string','content':_0xbeb3('0xd'),'variableName':null},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x1f'),'keyType':_0xbeb3('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xbeb3('0xe'),'content':'','key':'Member\x20Name','keyType':_0xbeb3('0x4'),'keyContent':'','variableName':_0xbeb3('0x20')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xbeb3('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0xbeb3('0x21')},{'type':'string','content':_0xbeb3('0x17')},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x22'),'keyType':_0xbeb3('0x4'),'keyContent':'','variableName':_0xbeb3('0x23')},{'type':_0xbeb3('0xe'),'content':'','key':_0xbeb3('0x24'),'keyType':_0xbeb3('0x4'),'keyContent':'','variableName':_0xbeb3('0x25')},{'type':_0xbeb3('0xe'),'content':'','key':'Duration','keyType':_0xbeb3('0x4'),'keyContent':'','variableName':_0xbeb3('0x26')},{'type':'keyValue','content':'','key':_0xbeb3('0x27'),'keyType':_0xbeb3('0x4'),'keyContent':'','variableName':_0xbeb3('0x28')}];break;}}return _0x2d1e06;}; \ No newline at end of file +var _0x9d9b=['Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','destcalleridnum','Member\x20Name','membername','UniqueId','uniqueid','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','string','toLowerCase','voice','push','queue','calleridnum','outbound','Outbound\x20Call','variable','inbound','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect'];(function(_0x490cd3,_0x97d5ee){var _0x3320d7=function(_0x2ad809){while(--_0x2ad809){_0x490cd3['push'](_0x490cd3['shift']());}};_0x3320d7(++_0x97d5ee);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x136d50,_0x21064c){_0x136d50=_0x136d50-0x0;var _0x238168=_0x9d9b[_0x136d50];return _0x238168;};'use strict';exports['getSubjects']=function(_0x20c6e4,_0x2c6a23){var _0x4b916e=[{'type':_0xb9d9('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x20c6e4[_0xb9d9('0x1')]()){case _0xb9d9('0x2'):switch(_0x2c6a23[_0xb9d9('0x1')]()){case'inbound':_0x4b916e[_0xb9d9('0x3')]({'type':'variable','content':'','variableName':_0xb9d9('0x4')});_0x4b916e[_0xb9d9('0x3')]({'type':'variable','content':'','variableName':_0xb9d9('0x5')});break;case _0xb9d9('0x6'):_0x4b916e[_0xb9d9('0x3')]({'type':_0xb9d9('0x0'),'content':_0xb9d9('0x7'),'variableName':null});_0x4b916e[_0xb9d9('0x3')]({'type':_0xb9d9('0x8'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4b916e;};exports['getDescriptions']=function(_0x5f14e7,_0x4cde40){var _0x45f507=[];switch(_0x5f14e7[_0xb9d9('0x1')]()){case _0xb9d9('0x2'):switch(_0x4cde40['toLowerCase']()){case _0xb9d9('0x9'):_0x45f507=[{'type':_0xb9d9('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb9d9('0xa'),'content':'','key':'Caller\x20Number','keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x5')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0xb'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0xc')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0xd'),'keyType':'variable','variableName':'destexten'},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0xe'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x4')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xb9d9('0x8'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xb9d9('0xf'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x10')},{'type':'string','content':_0xb9d9('0x11'),'key':null,'keyType':null,'variableName':null},{'type':_0xb9d9('0xa'),'content':'','key':'Agent\x20Name','keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x12')},{'type':'keyValue','content':'','key':_0xb9d9('0x13'),'keyType':_0xb9d9('0x8'),'variableName':'destcalleridnum'},{'type':_0xb9d9('0x0'),'content':_0xb9d9('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x15'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x10')},{'type':'keyValue','content':'','key':_0xb9d9('0x16'),'keyType':_0xb9d9('0x8'),'variableName':'agentconnectAt'},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x17'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x18')},{'type':'keyValue','content':'','key':_0xb9d9('0x19'),'keyType':_0xb9d9('0x8'),'variableName':_0xb9d9('0x1a')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x1b'),'keyType':_0xb9d9('0x8'),'variableName':'talktime'}];break;case _0xb9d9('0x6'):_0x45f507=[{'type':_0xb9d9('0x0'),'content':_0xb9d9('0x1c'),'variableName':null},{'type':'keyValue','content':'','key':_0xb9d9('0x1d'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':_0xb9d9('0x1e')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x1f'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':_0xb9d9('0x20')},{'type':'keyValue','content':'','key':_0xb9d9('0x21'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':_0xb9d9('0x22')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0xf'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':'starttime'},{'type':_0xb9d9('0x0'),'content':_0xb9d9('0x14')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x23'),'keyType':'variable','keyContent':'','variableName':_0xb9d9('0x24')},{'type':_0xb9d9('0xa'),'content':'','key':_0xb9d9('0x25'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':_0xb9d9('0x26')},{'type':_0xb9d9('0xa'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0xb9d9('0x27')},{'type':'keyValue','content':'','key':_0xb9d9('0x28'),'keyType':_0xb9d9('0x8'),'keyContent':'','variableName':_0xb9d9('0x29')}];break;}}return _0x45f507;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 6508178..8867832 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 _0x48c6=['../../config/logger','sms-interactions','chat-interactions','upperFirst','toLowerCase','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','user','clone','body','html','fax','lodash','../../mysqldb','openchannel-interactions'];(function(_0x45233f,_0x2a073d){var _0x475718=function(_0x12b46d){while(--_0x12b46d){_0x45233f['push'](_0x45233f['shift']());}};_0x475718(++_0x2a073d);}(_0x48c6,0x17d));var _0x648c=function(_0x2ddd9d,_0x3eef84){_0x2ddd9d=_0x2ddd9d-0x0;var _0x2fb5fa=_0x48c6[_0x2ddd9d];return _0x2fb5fa;};'use strict';var _=require(_0x648c('0x0'));var db=require(_0x648c('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x648c('0x2')),'mail':require(_0x648c('0x3'))('mail-interactions'),'fax':require(_0x648c('0x3'))('fax-interactions'),'sms':require(_0x648c('0x3'))(_0x648c('0x4')),'chat':require(_0x648c('0x3'))(_0x648c('0x5')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x486379,_0x246fc9,_0x349b2e){if(_0x486379&&_0x486379[_[_0x648c('0x6')](_0x349b2e)+'InteractionId']){return _0x486379[_[_0x648c('0x6')](_0x349b2e)+'InteractionId'];}else if(_0x486379&&_0x486379['id']){return _0x486379['id'];}else if(_0x246fc9&&_0x246fc9['id']){return _0x246fc9['id'];}else{return'unknown';}}function log(_0x5167d4,_0x178248,_0x323c3e,_0x461a47,_0x261ce6,_0x26e60e){loggers[_0x261ce6[_0x648c('0x7')]()][_0x5167d4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x26e60e[_0x648c('0x8')](),_0x178248?_0x178248['id']:null,_0x178248?_0x178248[_0x648c('0x9')]:null,_0x178248?_0x178248[_0x648c('0xa')]:null,getInteractionId(_0x323c3e,_0x461a47,_0x261ce6),_0x323c3e?JSON[_0x648c('0xb')](_0x323c3e):'null');}function updateUser(_0x4d8d0e,_0x2f5cc1,_0x3de2b4,_0x485d5d,_0x2d0862){db[_[_0x648c('0x6')](_0x485d5d)+_0x648c('0xc')][_0x648c('0xd')]({'where':{'id':getInteractionId(_0x2f5cc1,_0x3de2b4,_0x485d5d)}})[_0x648c('0xe')](function(_0x581700){if(_0x581700){return _0x581700[_0x648c('0xf')]({'UserId':_0x4d8d0e?_0x4d8d0e['id']:null});}})[_0x648c('0xe')](function(_0x4c1bf4){if(_0x4c1bf4){log(_0x648c('0x10'),_0x4d8d0e,_0x2f5cc1,_0x3de2b4,_0x485d5d,_0x2d0862);}})[_0x648c('0x11')](function(){log(_0x648c('0x12'),_0x4d8d0e,_0x2f5cc1,_0x3de2b4,_0x485d5d,_0x2d0862);});}exports['tracked']=function(_0x21b8bd,_0x349ec2){return function(_0x35e9ff,_0x4e1a02,_0x55e3e7){var _0x4fd450=_0x35e9ff[_0x648c('0x13')];var _0x35471e={};var _0x3d2f1f=_0x35e9ff['query'];if(_0x35471e){_0x35471e=_[_0x648c('0x14')](_0x35e9ff[_0x648c('0x15')]);_0x35471e=_['omit'](_0x35471e,['body',_0x648c('0x16'),'phone',_0x648c('0x17'),'mobile']);}updateUser(_0x4fd450,_0x35471e,_0x3d2f1f,_0x21b8bd,_0x349ec2);_0x55e3e7(null);};}; \ No newline at end of file +var _0xc999=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','update','error','tracked','clone','body','omit','html','phone','mobile','../../mysqldb','../../config/logger','openchannel-interactions','whatsapp-interactions','upperFirst','InteractionId'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xc999,0x176));var _0x9c99=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xc999[_0x40d8d7];return _0x3454cc;};'use strict';var _=require('lodash');var db=require(_0x9c99('0x0'))['db'];var loggers={'openchannel':require(_0x9c99('0x1'))(_0x9c99('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x9c99('0x1'))('sms-interactions'),'chat':require(_0x9c99('0x1'))('chat-interactions'),'whatsapp':require(_0x9c99('0x1'))(_0x9c99('0x3'))};function getInteractionId(_0xe80252,_0x47bfaa,_0xfa25e1){if(_0xe80252&&_0xe80252[_[_0x9c99('0x4')](_0xfa25e1)+_0x9c99('0x5')]){return _0xe80252[_[_0x9c99('0x4')](_0xfa25e1)+_0x9c99('0x5')];}else if(_0xe80252&&_0xe80252['id']){return _0xe80252['id'];}else if(_0x47bfaa&&_0x47bfaa['id']){return _0x47bfaa['id'];}else{return _0x9c99('0x6');}}function log(_0x5ce73c,_0x9406a,_0x18e677,_0x1e34b5,_0x13f33b,_0x560631){loggers[_0x13f33b[_0x9c99('0x7')]()][_0x5ce73c](_0x9c99('0x8'),_0x560631[_0x9c99('0x9')](),_0x9406a?_0x9406a['id']:null,_0x9406a?_0x9406a['name']:null,_0x9406a?_0x9406a[_0x9c99('0xa')]:null,getInteractionId(_0x18e677,_0x1e34b5,_0x13f33b),_0x18e677?JSON['stringify'](_0x18e677):'null');}function updateUser(_0x2185bb,_0x2e754b,_0x2d4c9a,_0x2bb18a,_0x50f62c){db[_[_0x9c99('0x4')](_0x2bb18a)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x2e754b,_0x2d4c9a,_0x2bb18a)}})['then'](function(_0xedd35){if(_0xedd35){return _0xedd35[_0x9c99('0xb')]({'UserId':_0x2185bb?_0x2185bb['id']:null});}})['then'](function(_0x27425b){if(_0x27425b){log('info',_0x2185bb,_0x2e754b,_0x2d4c9a,_0x2bb18a,_0x50f62c);}})['catch'](function(){log(_0x9c99('0xc'),_0x2185bb,_0x2e754b,_0x2d4c9a,_0x2bb18a,_0x50f62c);});}exports[_0x9c99('0xd')]=function(_0x5c0023,_0x34a89d){return function(_0x436e43,_0x5eaa11,_0x1a6f0e){var _0x1cc5ea=_0x436e43['user'];var _0x5da292={};var _0x5408b4=_0x436e43['query'];if(_0x5da292){_0x5da292=_[_0x9c99('0xe')](_0x436e43[_0x9c99('0xf')]);_0x5da292=_[_0x9c99('0x10')](_0x5da292,[_0x9c99('0xf'),_0x9c99('0x11'),_0x9c99('0x12'),'fax',_0x9c99('0x13')]);}updateUser(_0x1cc5ea,_0x5da292,_0x5408b4,_0x5c0023,_0x34a89d);_0x1a6f0e(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 6887dd4..3043ae5 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 _0x1252=['format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','hasOwnProperty','use','License','findOne','then','count','status'];(function(_0x4c95af,_0x3ea284){var _0x54e0ab=function(_0x226455){while(--_0x226455){_0x4c95af['push'](_0x4c95af['shift']());}};_0x54e0ab(++_0x3ea284);}(_0x1252,0x146));var _0x2125=function(_0x1fd809,_0x1bf2d0){_0x1fd809=_0x1fd809-0x0;var _0x28c337=_0x1252[_0x1fd809];return _0x28c337;};'use strict';var crypto=require(_0x2125('0x0'));var util=require(_0x2125('0x1'));var compose=require(_0x2125('0x2'));var db=require(_0x2125('0x3'))['db'];var config=require(_0x2125('0x4'));function getValueFromLicense(_0x2e00b6,_0x58af28){if(_0x2e00b6&&_0x58af28){if(_0x58af28[_0x2125('0x5')]&&_0x58af28[_0x2125('0x6')]){var _0x4670fe=_0x58af28[_0x2125('0x5')];var _0x92661d=_0x58af28[_0x2125('0x6')];var _0xb79a68=_0x4670fe[_0x2125('0x7')]('-')[0x4];var _0x569a5e=_0x4670fe['split']('-')[0x0];var _0x1b1fb2=crypto[_0x2125('0x8')](_0x2125('0x9'),util['format'](_0x2125('0xa'),_0xb79a68,_0x4670fe,_0x569a5e));var _0x5cc59b=_0x1b1fb2[_0x2125('0xb')](_0x92661d,_0x2125('0xc'),'utf8');_0x5cc59b+=_0x1b1fb2[_0x2125('0xd')](_0x2125('0xe'));var _0x381739=JSON['parse'](_0x5cc59b);return _0x381739[_0x2125('0xf')](_0x2e00b6)?_0x381739[_0x2e00b6]:null;}}return null;}function isLimit(_0x1c32d9,_0x5c8820,_0x1d301d,_0x4e5e13){var _0x21cb88=_0x5c8820;return compose()[_0x2125('0x10')](function(_0x34d34b,_0x4c603c,_0x5e4e76){return db[_0x2125('0x11')][_0x2125('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x2125('0x13')](function(_0x86fc3e){var _0x9772ed=getValueFromLicense(_0x1c32d9,_0x86fc3e);return _0x9772ed?_0x9772ed:_0x21cb88;})[_0x2125('0x13')](function(_0x268e72){_0x21cb88=_0x268e72;return _0x1d301d[_0x2125('0x14')](_0x4e5e13);})['then'](function(_0x335e34){if(_0x335e34>=_0x21cb88){return _0x4c603c[_0x2125('0x15')](0x193)['json']({'message':util[_0x2125('0x16')](_0x2125('0x17'),_0x1c32d9)});}_0x5e4e76();})[_0x2125('0x18')](function(_0x28b3db){_0x5e4e76(_0x28b3db);});});}function isUserLimit(){return isLimit(_0x2125('0x19'),0x1,db[_0x2125('0x1a')],{'where':{'$or':[{'role':_0x2125('0x1b')},{'role':_0x2125('0x1c')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x38c1=['crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit'];(function(_0x820452,_0x4eda58){var _0x2b9a98=function(_0x450784){while(--_0x450784){_0x820452['push'](_0x820452['shift']());}};_0x2b9a98(++_0x4eda58);}(_0x38c1,0x87));var _0x138c=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0x38c1[_0x4fc435];return _0x3c5db1;};'use strict';var crypto=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var compose=require('composable-middleware');var db=require(_0x138c('0x2'))['db'];var config=require(_0x138c('0x3'));function getValueFromLicense(_0x45e510,_0x436115){if(_0x45e510&&_0x436115){if(_0x436115[_0x138c('0x4')]&&_0x436115[_0x138c('0x5')]){var _0x5973eb=_0x436115['data1'];var _0x4d2104=_0x436115['license'];var _0x5e68d0=_0x5973eb[_0x138c('0x6')]('-')[0x4];var _0x1bf2c9=_0x5973eb[_0x138c('0x6')]('-')[0x0];var _0x717d00=crypto[_0x138c('0x7')](_0x138c('0x8'),util[_0x138c('0x9')](_0x138c('0xa'),_0x5e68d0,_0x5973eb,_0x1bf2c9));var _0x312a8a=_0x717d00[_0x138c('0xb')](_0x4d2104,_0x138c('0xc'),_0x138c('0xd'));_0x312a8a+=_0x717d00[_0x138c('0xe')](_0x138c('0xd'));var _0x15614a=JSON[_0x138c('0xf')](_0x312a8a);return _0x15614a['hasOwnProperty'](_0x45e510)?_0x15614a[_0x45e510]:null;}}return null;}function isLimit(_0x3cc720,_0x5bda6a,_0x5bc04c,_0x6247f5){var _0x13bb49=_0x5bda6a;return compose()[_0x138c('0x10')](function(_0xd42a02,_0x1b9733,_0x23c65a){return db[_0x138c('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x32e21d){var _0x2ae1b3=getValueFromLicense(_0x3cc720,_0x32e21d);return _0x2ae1b3?_0x2ae1b3:_0x13bb49;})[_0x138c('0x12')](function(_0x3629c4){_0x13bb49=_0x3629c4;return _0x5bc04c[_0x138c('0x13')](_0x6247f5);})['then'](function(_0x4b49d8){if(_0x4b49d8>=_0x13bb49){return _0x1b9733[_0x138c('0x14')](0x193)[_0x138c('0x15')]({'message':util['format'](_0x138c('0x16'),_0x3cc720)});}_0x23c65a();})[_0x138c('0x17')](function(_0x2029a7){_0x23c65a(_0x2029a7);});});}function isUserLimit(){return isLimit(_0x138c('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0x138c('0x19')},{'role':'user'}]}});}exports[_0x138c('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 621d187..634e09e 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 _0xa410=['$lte','days','format','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','add','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','length','split','slice','forEach','shift','match','indexOf','push','$eq','operator','$between','value','includes','$gt'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa410,0x111));var _0x0a41=function(_0x3341e3,_0x544d12){_0x3341e3=_0x3341e3-0x0;var _0x294748=_0xa410[_0x3341e3];return _0x294748;};'use strict';var _=require(_0x0a41('0x0'));var moment=require(_0x0a41('0x1'));exports[_0x0a41('0x2')]=function(_0x2071ef){var _0x1ab712={'conditions':[]};_0x1ab712[_0x0a41('0x3')]=_[_0x0a41('0x4')](_0x2071ef,_0x0a41('0x5'))?'or':'and';var _0x3f0147=_0x2071ef[_0x0a41('0x6')]('[$and]','')[_0x0a41('0x6')]('[$or]','')['split']('||');for(var _0x3f8f23=0x0;_0x3f8f23<_0x3f0147[_0x0a41('0x7')];_0x3f8f23++){var _0x166af3=_0x3f0147[_0x3f8f23][_0x0a41('0x8')](':=');var _0x14b683=_0x166af3[0x0];var _0x19a6e1=_0x166af3[_0x0a41('0x9')](0x1);_0x19a6e1[_0x0a41('0xa')](function(_0x2225f5){var _0x116e59=_0x2225f5['split']('[')[_0x0a41('0xb')]();var _0x9712b2=_0x2225f5[_0x0a41('0xc')](/\[(.*?)\]/g);_0x9712b2[_0x0a41('0xa')](function(_0x195b4f){var _0x486d01=_0x195b4f['split']('[')['filter'](function(_0x482d23){return _0x482d23[_0x0a41('0xd')](']')>-0x1;})['map'](function(_0x4e9904){return _0x4e9904['split'](']')[0x0];})[0x0];_0x1ab712['conditions'][_0x0a41('0xe')]({'field':_0x14b683,'operator':_0x116e59,'value':_0x486d01});});});}return _0x1ab712;};exports['buildExpression']=function(_0x198859,_0x55e4ee,_0x9c2073){var _0x12fdcf={};if(_0x55e4ee==='DATE'){if(_0x9c2073['operator']===_0x0a41('0xf')){_0x9c2073[_0x0a41('0x10')]=_0x0a41('0x11');_0x9c2073[_0x0a41('0x12')]+=','+_0x9c2073[_0x0a41('0x12')];}else if(_[_0x0a41('0x13')]([_0x0a41('0x14'),_0x0a41('0x15')],_0x9c2073['operator'])){_0x9c2073[_0x0a41('0x12')]=moment(_0x9c2073[_0x0a41('0x12')])['add'](0x1,_0x0a41('0x16'))[_0x0a41('0x17')]('YYYY-MM-DD');}}if(_0x9c2073[_0x0a41('0x18')]){_0x55e4ee=_0x9c2073[_0x0a41('0x18')];_0x12fdcf['text']=_0x0a41('0x19')+_0x198859+'.'+_0x9c2073[_0x0a41('0x1a')]+_0x0a41('0x1b')+_0x9c2073[_0x0a41('0x18')]+')\x20'+parseOperator(_0x9c2073['operator']);}else{_0x12fdcf[_0x0a41('0x1c')]=_0x198859+'.'+_0x9c2073[_0x0a41('0x1a')]+'\x20'+parseOperator(_0x9c2073[_0x0a41('0x10')]);}if(_[_0x0a41('0x13')]([_0x0a41('0x1d'),_0x0a41('0x1e')],_0x9c2073[_0x0a41('0x10')]))_0x12fdcf['text']='('+_0x12fdcf[_0x0a41('0x1c')]+_0x0a41('0x1f')+_0x198859+'.'+_0x9c2073[_0x0a41('0x1a')]+_0x0a41('0x20');_0x12fdcf[_0x0a41('0x12')]=parseValue(_0x55e4ee,_0x9c2073[_0x0a41('0x10')],_0x9c2073['value']);return _0x12fdcf;};function parseOperator(_0x2c4bc5){var _0x269f40;switch(_0x2c4bc5){case _0x0a41('0x21'):_0x269f40=_0x0a41('0x22');break;case _0x0a41('0x1e'):_0x269f40=_0x0a41('0x23');break;case _0x0a41('0xf'):_0x269f40=_0x0a41('0x24');break;case _0x0a41('0x1d'):_0x269f40='<>\x20?';break;case'$substring':case _0x0a41('0x25'):case _0x0a41('0x26'):_0x269f40=_0x0a41('0x27');break;case'$lt':_0x269f40='<\x20?';break;case _0x0a41('0x14'):_0x269f40='>\x20?';break;case'$lte':_0x269f40=_0x0a41('0x28');break;case _0x0a41('0x29'):_0x269f40=_0x0a41('0x2a');break;case _0x0a41('0x11'):_0x269f40=_0x0a41('0x2b');break;}return _0x269f40;}function parseValue(_0x5d6f7d,_0x440b64,_0x114fdd){var _0x5ecd1c={'start':undefined,'end':undefined};switch(_0x440b64){case _0x0a41('0x21'):case _0x0a41('0x1e'):_0x5ecd1c['start']=_0x114fdd[_0x0a41('0x8')](',');break;case'$substring':_0x5ecd1c[_0x0a41('0x2c')]='%'+_0x114fdd+'%';break;case'$startsWith':_0x5ecd1c[_0x0a41('0x2c')]=_0x114fdd+'%';break;case _0x0a41('0x26'):_0x5ecd1c[_0x0a41('0x2c')]='%'+_0x114fdd;break;case'$between':var _0x924709=_0x114fdd[_0x0a41('0x8')](',');var _0x114fdd=_0x924709[_0x0a41('0xb')]();var _0xd11617=_0x924709[_0x0a41('0x2d')]();if(_0x5d6f7d===_0x0a41('0x2e')){_0x114fdd=moment(_0x114fdd)[_0x0a41('0x2f')](0x0,!![])[_0x0a41('0x17')]();_0xd11617=moment(_0xd11617)[_0x0a41('0x2f')](0x0,!![])[_0x0a41('0x30')](0x17,'hours')[_0x0a41('0x30')](0x3b,'minutes')[_0x0a41('0x30')](0x3b,'seconds')[_0x0a41('0x17')]();}_0x5ecd1c={'start':_0x114fdd,'end':_0xd11617};break;default:_0x5ecd1c[_0x0a41('0x2c')]=_0x114fdd;break;}return _0x5ecd1c;} \ No newline at end of file +var _0x50a9=['lodash','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','split','slice','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','$gte','>=\x20?','$between','start','shift','pop','utcOffset','hours','minutes'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0x50a9,0xd8));var _0x950a=function(_0x18bcc8,_0x4b1f58){_0x18bcc8=_0x18bcc8-0x0;var _0x45877f=_0x50a9[_0x18bcc8];return _0x45877f;};'use strict';var _=require(_0x950a('0x0'));var moment=require(_0x950a('0x1'));exports[_0x950a('0x2')]=function(_0x5633cc){var _0x3116df={'conditions':[]};_0x3116df[_0x950a('0x3')]=_[_0x950a('0x4')](_0x5633cc,'[$or]')?'or':'and';var _0x272fa9=_0x5633cc[_0x950a('0x5')](_0x950a('0x6'),'')[_0x950a('0x5')]('[$or]','')[_0x950a('0x7')]('||');for(var _0x596577=0x0;_0x596577<_0x272fa9['length'];_0x596577++){var _0x23c175=_0x272fa9[_0x596577][_0x950a('0x7')](':=');var _0x5edaec=_0x23c175[0x0];var _0x21385a=_0x23c175[_0x950a('0x8')](0x1);_0x21385a[_0x950a('0x9')](function(_0x1ce4a6){var _0x3404f3=_0x1ce4a6[_0x950a('0x7')]('[')['shift']();var _0x380aa4=_0x1ce4a6[_0x950a('0xa')](/\[(.*?)\]/g);_0x380aa4[_0x950a('0x9')](function(_0x23ac36){var _0x3336f1=_0x23ac36[_0x950a('0x7')]('[')['filter'](function(_0x5a5e15){return _0x5a5e15[_0x950a('0xb')](']')>-0x1;})[_0x950a('0xc')](function(_0x462fc7){return _0x462fc7[_0x950a('0x7')](']')[0x0];})[0x0];_0x3116df[_0x950a('0xd')][_0x950a('0xe')]({'field':_0x5edaec,'operator':_0x3404f3,'value':_0x3336f1});});});}return _0x3116df;};exports[_0x950a('0xf')]=function(_0xce432e,_0xbab46a,_0x5a2911){var _0x4cb783={};if(_0xbab46a===_0x950a('0x10')){if(_0x5a2911[_0x950a('0x11')]===_0x950a('0x12')){_0x5a2911['operator']='$between';_0x5a2911['value']+=','+_0x5a2911[_0x950a('0x13')];}else if(_[_0x950a('0x14')]([_0x950a('0x15'),_0x950a('0x16')],_0x5a2911[_0x950a('0x11')])){_0x5a2911[_0x950a('0x13')]=moment(_0x5a2911[_0x950a('0x13')])[_0x950a('0x17')](0x1,_0x950a('0x18'))[_0x950a('0x19')](_0x950a('0x1a'));}}if(_0x5a2911[_0x950a('0x1b')]){_0xbab46a=_0x5a2911[_0x950a('0x1b')];_0x4cb783[_0x950a('0x1c')]=_0x950a('0x1d')+_0xce432e+'.'+_0x5a2911[_0x950a('0x1e')]+_0x950a('0x1f')+_0x5a2911['castTo']+')\x20'+parseOperator(_0x5a2911['operator']);}else{_0x4cb783[_0x950a('0x1c')]=_0xce432e+'.'+_0x5a2911[_0x950a('0x1e')]+'\x20'+parseOperator(_0x5a2911[_0x950a('0x11')]);}if(_[_0x950a('0x14')]([_0x950a('0x20'),'$notIn'],_0x5a2911[_0x950a('0x11')]))_0x4cb783[_0x950a('0x1c')]='('+_0x4cb783[_0x950a('0x1c')]+'\x20OR\x20'+_0xce432e+'.'+_0x5a2911[_0x950a('0x1e')]+_0x950a('0x21');_0x4cb783['value']=parseValue(_0xbab46a,_0x5a2911[_0x950a('0x11')],_0x5a2911[_0x950a('0x13')]);return _0x4cb783;};function parseOperator(_0x2ccaed){var _0x31aa77;switch(_0x2ccaed){case _0x950a('0x22'):_0x31aa77=_0x950a('0x23');break;case _0x950a('0x24'):_0x31aa77=_0x950a('0x25');break;case _0x950a('0x12'):_0x31aa77='=\x20?';break;case _0x950a('0x20'):_0x31aa77=_0x950a('0x26');break;case _0x950a('0x27'):case _0x950a('0x28'):case _0x950a('0x29'):_0x31aa77=_0x950a('0x2a');break;case _0x950a('0x2b'):_0x31aa77='<\x20?';break;case _0x950a('0x15'):_0x31aa77=_0x950a('0x2c');break;case _0x950a('0x16'):_0x31aa77='<=\x20?';break;case _0x950a('0x2d'):_0x31aa77=_0x950a('0x2e');break;case _0x950a('0x2f'):_0x31aa77='BETWEEN\x20?\x20AND\x20?';break;}return _0x31aa77;}function parseValue(_0x4883b3,_0x57ae00,_0x19405d){var _0x4fe47d={'start':undefined,'end':undefined};switch(_0x57ae00){case _0x950a('0x22'):case'$notIn':_0x4fe47d[_0x950a('0x30')]=_0x19405d[_0x950a('0x7')](',');break;case'$substring':_0x4fe47d[_0x950a('0x30')]='%'+_0x19405d+'%';break;case'$startsWith':_0x4fe47d[_0x950a('0x30')]=_0x19405d+'%';break;case _0x950a('0x29'):_0x4fe47d[_0x950a('0x30')]='%'+_0x19405d;break;case _0x950a('0x2f'):var _0x5df39b=_0x19405d['split'](',');var _0x19405d=_0x5df39b[_0x950a('0x31')]();var _0x1ab515=_0x5df39b[_0x950a('0x32')]();if(_0x4883b3===_0x950a('0x10')){_0x19405d=moment(_0x19405d)[_0x950a('0x33')](0x0,!![])['format']();_0x1ab515=moment(_0x1ab515)[_0x950a('0x33')](0x0,!![])[_0x950a('0x17')](0x17,_0x950a('0x34'))[_0x950a('0x17')](0x3b,_0x950a('0x35'))[_0x950a('0x17')](0x3b,'seconds')[_0x950a('0x19')]();}_0x4fe47d={'start':_0x19405d,'end':_0x1ab515};break;default:_0x4fe47d[_0x950a('0x30')]=_0x19405d;break;}return _0x4fe47d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index c15abf3..7a03341 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 _0x3f2e=['hasOwnProperty','match','^[0-9]*$','isEmail','getFullTextValue','toString','join','lodash','sequelize','moment','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','isArray','offset','sort','priority','cast','col','DESC','unsigned','ASC','omit','length','isObject','isString','unset'];(function(_0x22f931,_0x51e7d9){var _0x283386=function(_0x16fe83){while(--_0x16fe83){_0x22f931['push'](_0x22f931['shift']());}};_0x283386(++_0x51e7d9);}(_0x3f2e,0x166));var _0xe3f2=function(_0x24a711,_0x2c44e7){_0x24a711=_0x24a711-0x0;var _0x24dad5=_0x3f2e[_0x24a711];return _0x24dad5;};'use strict';var _=require(_0xe3f2('0x0'));var sequelize=require(_0xe3f2('0x1'));var moment=require(_0xe3f2('0x2'));var LIMIT_VALUE=0xfa;exports[_0xe3f2('0x3')]=function(_0x2cfb4a){var _0x834381=null;if(_0x2cfb4a){_0x834381=_0x2cfb4a[_0xe3f2('0x4')](',');}return _0x834381;};exports[_0xe3f2('0x5')]=function(_0x1dbe3d,_0x26d1e3){var _0x439105={};if(!_[_0xe3f2('0x6')](_0x1dbe3d)){_[_0xe3f2('0x7')](_0x1dbe3d,function(_0x3902e6,_0x2dff57){try{if(_0x26d1e3){var _0x8218c2=_[_0xe3f2('0x8')](_0x26d1e3,{'name':_0x2dff57})||{};if(_0x8218c2[_0xe3f2('0x9')]===_0xe3f2('0xa')&&_[_0xe3f2('0xb')](_0x3902e6)){var _0x2fb6ce=JSON[_0xe3f2('0xc')](_0x3902e6);var _0x460859={'$gte':moment(moment(_0x2fb6ce[_0xe3f2('0xd')])[_0xe3f2('0xe')](_0xe3f2('0xf')))[_0xe3f2('0x10')]()[_0xe3f2('0xe')](),'$lte':moment(moment(_0x2fb6ce[_0xe3f2('0x11')])['format'](_0xe3f2('0xf')))[_0xe3f2('0x10')]()['subtract'](0x1,'s')[_0xe3f2('0xe')]()};_0x439105[_0x2dff57]=_0x460859;}else{_0x439105[_0x2dff57]=_[_0xe3f2('0x12')](_0x3902e6)?_0x3902e6:JSON['parse'](_0x3902e6);}}else{_0x439105[_0x2dff57]=_['isArray'](_0x3902e6)?_0x3902e6:JSON[_0xe3f2('0xc')](_0x3902e6);}}catch(_0x24a3f9){_0x439105[_0x2dff57]=_0x3902e6['split'](',');}});}return _0x439105;};exports['limit']=function(_0x1b7baa){_0x1b7baa=parseInt(_0x1b7baa,0xa);if(!_0x1b7baa||_0x1b7baa<0x0){_0x1b7baa=LIMIT_VALUE;}return _0x1b7baa;};exports[_0xe3f2('0x13')]=function(_0x421cdf){_0x421cdf=parseInt(_0x421cdf,0xa);if(!_0x421cdf||_0x421cdf<0x0){_0x421cdf=0x0;}return _0x421cdf;};exports[_0xe3f2('0x14')]=function(_0x3feac8){var _0x3e49c6,_0xdc81ea=null;if(_0x3feac8){_0x3e49c6=_0x3feac8['split'](',');_0xdc81ea=_['map'](_0x3e49c6,function(_0x5baa11){if(_0x5baa11['indexOf']('-')===0x0){return[_0x5baa11===_0xe3f2('0x15')?sequelize[_0xe3f2('0x16')](sequelize[_0xe3f2('0x17')](_0xe3f2('0x15')),'unsigned'):_0x5baa11['substr'](0x1),_0xe3f2('0x18')];}else{return[_0x5baa11===_0xe3f2('0x15')?sequelize[_0xe3f2('0x16')](sequelize[_0xe3f2('0x17')](_0xe3f2('0x15')),_0xe3f2('0x19')):_0x5baa11,_0xe3f2('0x1a')];}});}return _0xdc81ea;};exports[_0xe3f2('0x1b')]=function(_0x59b6ea,_0x5865fe){if(_[_0xe3f2('0x6')](_0x59b6ea)){return _0x59b6ea;}if(_[_0xe3f2('0x12')](_0x59b6ea)){for(var _0x398407=0x0;_0x398407<_0x59b6ea[_0xe3f2('0x1c')];_0x398407+=0x1){_0x59b6ea[_0x398407]=this['omit'](_0x59b6ea[_0x398407],_0x5865fe);}return _0x59b6ea;}if(!_[_0xe3f2('0x1d')](_0x59b6ea)){return _0x59b6ea;}if(_[_0xe3f2('0x1e')](_0x5865fe)){_0x5865fe=[_0x5865fe];}if(!_[_0xe3f2('0x12')](_0x5865fe)){return _0x59b6ea;}for(var _0x1a8b3c=0x0;_0x1a8b3c<_0x5865fe[_0xe3f2('0x1c')];_0x1a8b3c+=0x1){_[_0xe3f2('0x1f')](_0x59b6ea,_0x5865fe[_0x1a8b3c]);}for(var _0x287f57 in _0x59b6ea){if(_0x59b6ea[_0xe3f2('0x20')](_0x287f57)){_0x59b6ea[_0x287f57]=this[_0xe3f2('0x1b')](_0x59b6ea[_0x287f57],_0x5865fe);}}return _0x59b6ea;};exports['isNumeric']=function(_0x55096e){return _0x55096e[_0xe3f2('0x21')](RegExp(_0xe3f2('0x22')))?!![]:![];};exports[_0xe3f2('0x23')]=function(_0x571fcf){return _0x571fcf[_0xe3f2('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0xe3f2('0x24')]=function(_0x386bd0){var _0x4483d6=[];_0x386bd0['split']('\x20')['forEach'](function(_0x123b3f){_0x4483d6['push']('+'+_0x123b3f[_0xe3f2('0x25')]()+'*');});return _0x4483d6[_0xe3f2('0x26')]('\x20');}; \ No newline at end of file +var _0x5f11=['isEmpty','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','isArray','parse','split','offset','sort','map','indexOf','priority','col','unsigned','DESC','cast','ASC','omit','isObject','isString','length','unset','hasOwnProperty','match','isEmail','getFullTextValue','forEach','push','join','lodash','sequelize','moment','filters'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0x5f11,0x98));var _0x15f1=function(_0x24e872,_0xe9f733){_0x24e872=_0x24e872-0x0;var _0x422b15=_0x5f11[_0x24e872];return _0x422b15;};'use strict';var _=require(_0x15f1('0x0'));var sequelize=require(_0x15f1('0x1'));var moment=require(_0x15f1('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x2fd6d0){var _0x4292ae=null;if(_0x2fd6d0){_0x4292ae=_0x2fd6d0['split'](',');}return _0x4292ae;};exports[_0x15f1('0x3')]=function(_0x5c3c9c,_0x263e9d){var _0x3c831d={};if(!_[_0x15f1('0x4')](_0x5c3c9c)){_[_0x15f1('0x5')](_0x5c3c9c,function(_0x407626,_0x26c2df){try{if(_0x263e9d){var _0x5b98d2=_['find'](_0x263e9d,{'name':_0x26c2df})||{};if(_0x5b98d2[_0x15f1('0x6')]===_0x15f1('0x7')&&_[_0x15f1('0x8')](_0x407626)){var _0x2c2272=JSON['parse'](_0x407626);var _0x5077b6={'$gte':moment(moment(_0x2c2272[_0x15f1('0x9')])['format'](_0x15f1('0xa')))[_0x15f1('0xb')]()[_0x15f1('0xc')](),'$lte':moment(moment(_0x2c2272['$lte'])[_0x15f1('0xc')](_0x15f1('0xa')))[_0x15f1('0xb')]()[_0x15f1('0xd')](0x1,'s')[_0x15f1('0xc')]()};_0x3c831d[_0x26c2df]=_0x5077b6;}else{_0x3c831d[_0x26c2df]=_[_0x15f1('0xe')](_0x407626)?_0x407626:JSON[_0x15f1('0xf')](_0x407626);}}else{_0x3c831d[_0x26c2df]=_[_0x15f1('0xe')](_0x407626)?_0x407626:JSON[_0x15f1('0xf')](_0x407626);}}catch(_0x215c2d){_0x3c831d[_0x26c2df]=_0x407626[_0x15f1('0x10')](',');}});}return _0x3c831d;};exports['limit']=function(_0x4d5e26){_0x4d5e26=parseInt(_0x4d5e26,0xa);if(!_0x4d5e26||_0x4d5e26<0x0){_0x4d5e26=LIMIT_VALUE;}return _0x4d5e26;};exports[_0x15f1('0x11')]=function(_0x4f3fa9){_0x4f3fa9=parseInt(_0x4f3fa9,0xa);if(!_0x4f3fa9||_0x4f3fa9<0x0){_0x4f3fa9=0x0;}return _0x4f3fa9;};exports[_0x15f1('0x12')]=function(_0x311ff1){var _0x5a9883,_0x4ffef4=null;if(_0x311ff1){_0x5a9883=_0x311ff1[_0x15f1('0x10')](',');_0x4ffef4=_[_0x15f1('0x13')](_0x5a9883,function(_0x180ce9){if(_0x180ce9[_0x15f1('0x14')]('-')===0x0){return[_0x180ce9===_0x15f1('0x15')?sequelize['cast'](sequelize[_0x15f1('0x16')](_0x15f1('0x15')),_0x15f1('0x17')):_0x180ce9['substr'](0x1),_0x15f1('0x18')];}else{return[_0x180ce9===_0x15f1('0x15')?sequelize[_0x15f1('0x19')](sequelize[_0x15f1('0x16')]('priority'),_0x15f1('0x17')):_0x180ce9,_0x15f1('0x1a')];}});}return _0x4ffef4;};exports['omit']=function(_0x5c6ba2,_0x4b19ad){if(_[_0x15f1('0x4')](_0x5c6ba2)){return _0x5c6ba2;}if(_[_0x15f1('0xe')](_0x5c6ba2)){for(var _0x533029=0x0;_0x533029<_0x5c6ba2['length'];_0x533029+=0x1){_0x5c6ba2[_0x533029]=this[_0x15f1('0x1b')](_0x5c6ba2[_0x533029],_0x4b19ad);}return _0x5c6ba2;}if(!_[_0x15f1('0x1c')](_0x5c6ba2)){return _0x5c6ba2;}if(_[_0x15f1('0x1d')](_0x4b19ad)){_0x4b19ad=[_0x4b19ad];}if(!_[_0x15f1('0xe')](_0x4b19ad)){return _0x5c6ba2;}for(var _0x10d18e=0x0;_0x10d18e<_0x4b19ad[_0x15f1('0x1e')];_0x10d18e+=0x1){_[_0x15f1('0x1f')](_0x5c6ba2,_0x4b19ad[_0x10d18e]);}for(var _0x48038d in _0x5c6ba2){if(_0x5c6ba2[_0x15f1('0x20')](_0x48038d)){_0x5c6ba2[_0x48038d]=this[_0x15f1('0x1b')](_0x5c6ba2[_0x48038d],_0x4b19ad);}}return _0x5c6ba2;};exports['isNumeric']=function(_0x249b9b){return _0x249b9b[_0x15f1('0x21')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x15f1('0x22')]=function(_0x539726){return _0x539726['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x15f1('0x23')]=function(_0x11db76){var _0x2c12dc=[];_0x11db76['split']('\x20')[_0x15f1('0x24')](function(_0x4cb4fe){_0x2c12dc[_0x15f1('0x25')]('+'+_0x4cb4fe['toString']()+'*');});return _0x2c12dc[_0x15f1('0x26')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 43be170..a65a071 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21ef=['engine','ejs','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','env','set','appPath','join','development','test','root','client','use','json\x20replacer','toISOString','static','get','views'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x21ef,0x17f));var _0xf21e=function(_0x349a13,_0x3cd835){_0x349a13=_0x349a13-0x0;var _0x47ddc0=_0x21ef[_0x349a13];return _0x47ddc0;};'use strict';var express=require(_0xf21e('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xf21e('0x1'));var methodOverride=require(_0xf21e('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xf21e('0x3'));var path=require(_0xf21e('0x4'));var passport=require(_0xf21e('0x5'));var cors=require(_0xf21e('0x6'));var moment=require(_0xf21e('0x7'));var config=require(_0xf21e('0x8'));var db=require(_0xf21e('0x9'))['db'];exports[_0xf21e('0xa')]=function(_0x4b63d5){var _0x35ab9d=_0x4b63d5['get'](_0xf21e('0xb'));if(_0x35ab9d==='production'){_0x4b63d5[_0xf21e('0xc')](_0xf21e('0xd'),path[_0xf21e('0xe')](config['root'],'public'));}if(_0x35ab9d===_0xf21e('0xf')||_0x35ab9d===_0xf21e('0x10')){_0x4b63d5[_0xf21e('0xc')]('appPath',path[_0xf21e('0xe')](config[_0xf21e('0x11')],_0xf21e('0x12')));_0x4b63d5[_0xf21e('0x13')](errorHandler());}_0x4b63d5[_0xf21e('0xc')](_0xf21e('0x14'),function(_0xd5ff76,_0x545431){if(this[_0xd5ff76]instanceof Date){_0x545431=this[_0xd5ff76][_0xf21e('0x15')]()['split']('.')[0x0]+'Z';}return _0x545431;});_0x4b63d5['use'](express[_0xf21e('0x16')](_0x4b63d5[_0xf21e('0x17')](_0xf21e('0xd'))));_0x4b63d5[_0xf21e('0xc')](_0xf21e('0x18'),config[_0xf21e('0x11')]+'/server/views');_0x4b63d5[_0xf21e('0x19')]('html',require(_0xf21e('0x1a'))[_0xf21e('0x1b')]);_0x4b63d5[_0xf21e('0xc')](_0xf21e('0x1c'),_0xf21e('0x1d'));_0x4b63d5[_0xf21e('0x13')](bodyParser[_0xf21e('0x1e')]({'limit':_0xf21e('0x1f'),'extended':!![]}));_0x4b63d5[_0xf21e('0x13')](bodyParser[_0xf21e('0x20')]({'limit':_0xf21e('0x1f')}));_0x4b63d5[_0xf21e('0x13')](cors());_0x4b63d5[_0xf21e('0x13')](methodOverride());_0x4b63d5[_0xf21e('0x13')](cookieParser());_0x4b63d5['use'](passport[_0xf21e('0x21')]());}; \ No newline at end of file +var _0x21f7=['use','split','static','views','/server/views','engine','html','renderFile','50mb','json','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','production','set','appPath','join','root','public','development'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x21f7,0xc5));var _0x721f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x21f7[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x721f('0x0'));var favicon=require(_0x721f('0x1'));var bodyParser=require(_0x721f('0x2'));var methodOverride=require(_0x721f('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x721f('0x4'));var path=require(_0x721f('0x5'));var passport=require(_0x721f('0x6'));var cors=require(_0x721f('0x7'));var moment=require(_0x721f('0x8'));var config=require(_0x721f('0x9'));var db=require(_0x721f('0xa'))['db'];exports[_0x721f('0xb')]=function(_0x5d423d){var _0x1ad37c=_0x5d423d[_0x721f('0xc')]('env');if(_0x1ad37c===_0x721f('0xd')){_0x5d423d[_0x721f('0xe')](_0x721f('0xf'),path[_0x721f('0x10')](config[_0x721f('0x11')],_0x721f('0x12')));}if(_0x1ad37c===_0x721f('0x13')||_0x1ad37c==='test'){_0x5d423d['set'](_0x721f('0xf'),path[_0x721f('0x10')](config[_0x721f('0x11')],'client'));_0x5d423d[_0x721f('0x14')](errorHandler());}_0x5d423d[_0x721f('0xe')]('json\x20replacer',function(_0x57b62c,_0x39c0d6){if(this[_0x57b62c]instanceof Date){_0x39c0d6=this[_0x57b62c]['toISOString']()[_0x721f('0x15')]('.')[0x0]+'Z';}return _0x39c0d6;});_0x5d423d[_0x721f('0x14')](express[_0x721f('0x16')](_0x5d423d[_0x721f('0xc')](_0x721f('0xf'))));_0x5d423d[_0x721f('0xe')](_0x721f('0x17'),config[_0x721f('0x11')]+_0x721f('0x18'));_0x5d423d[_0x721f('0x19')](_0x721f('0x1a'),require('ejs')[_0x721f('0x1b')]);_0x5d423d[_0x721f('0xe')]('view\x20engine',_0x721f('0x1a'));_0x5d423d[_0x721f('0x14')](bodyParser['urlencoded']({'limit':_0x721f('0x1c'),'extended':!![]}));_0x5d423d[_0x721f('0x14')](bodyParser[_0x721f('0x1d')]({'limit':_0x721f('0x1c')}));_0x5d423d[_0x721f('0x14')](cors());_0x5d423d[_0x721f('0x14')](methodOverride());_0x5d423d[_0x721f('0x14')](cookieParser());_0x5d423d['use'](passport[_0x721f('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 8ca3413..310adfc 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 _0x598a=['address','127.0.0.1','getFirstInterface','cpus','map','join','md5','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','keys','length','filter','IPv4','internal','concat','head','mac'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x598a,0xfb));var _0xa598=function(_0x2aad5a,_0x2498b4){_0x2aad5a=_0x2aad5a-0x0;var _0xa29401=_0x598a[_0x2aad5a];return _0xa29401;};'use strict';var _=require(_0xa598('0x0'));var os=require('os');var crypto=require(_0xa598('0x1'));var machine=require(_0xa598('0x2'));var exec=require(_0xa598('0x3'))[_0xa598('0x4')];function getInterfaces(){var _0x4d3555=[];var _0x3a2794=os['networkInterfaces']();var _0x4958fc=_['orderBy'](_[_0xa598('0x5')](_0x3a2794));for(var _0x8f041b=0x0;_0x8f041b<_0x4958fc[_0xa598('0x6')];_0x8f041b++){var _0x2b0ef0=_0x3a2794[_0x4958fc[_0x8f041b]][_0xa598('0x7')](function(_0x4d82ee){return _0x4d82ee['family']===_0xa598('0x8')&&_0x4d82ee[_0xa598('0x9')]===![];});_0x4d3555=_0x4d3555[_0xa598('0xa')](_0x2b0ef0);}return _0x4d3555;}function getFirstInterface(){var _0xe36e4f=_[_0xa598('0xb')](getInterfaces());return{'macAddress':_0xe36e4f&&_0xe36e4f[_0xa598('0xc')]?_0xe36e4f['mac']:'00:00:00:00:00:00','ipAddress':_0xe36e4f&&_0xe36e4f[_0xa598('0xd')]?_0xe36e4f[_0xa598('0xd')]:_0xa598('0xe')};}exports[_0xa598('0xf')]=getFirstInterface;function getCPUhash(){var _0xa1c53=_['orderBy'](os[_0xa598('0x10')]()[_0xa598('0x11')](function(_0x468710){return _0x468710['model'];}))[_0xa598('0x12')](':');return crypto['createHash'](_0xa598('0x13'))[_0xa598('0x14')](_0xa1c53)[_0xa598('0x15')](_0xa598('0x16'));}exports[_0xa598('0x17')]=function(){switch(os[_0xa598('0x18')]()){case _0xa598('0x19'):return exec(_0xa598('0x1a'),{'encoding':_0xa598('0x1b')})['replace']('\x0d\x0a','');default:var _0x88df86=getFirstInterface();var _0x82a6cc=getCPUhash();var _0x6e6ff5=_0x82a6cc+'|'+os[_0xa598('0x1c')]()+'|'+_0x88df86[_0xa598('0x1d')]+'|'+_0x88df86[_0xa598('0x1e')];var _0x3cbb9f=crypto[_0xa598('0x1f')](_0xa598('0x13'))[_0xa598('0x14')](_0x6e6ff5)['digest'](_0xa598('0x16'));return _0x3cbb9f[_0xa598('0x20')](0x0,0x8)+'-'+_0x3cbb9f[_0xa598('0x20')](0x8,0xc)+'-'+_0x3cbb9f[_0xa598('0x20')](0xc,0x10)+'-'+_0x3cbb9f[_0xa598('0x20')](0x10,0x14)+'-'+_0x3cbb9f[_0xa598('0x20')](0x14);}}; \ No newline at end of file +var _0x0689=['createHash','md5','update','hex','getUuid','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','digest','substring','crypto','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x0689,0x161));var _0x9068=function(_0xa83955,_0x842b87){_0xa83955=_0xa83955-0x0;var _0x39d283=_0x0689[_0xa83955];return _0x39d283;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9068('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x9068('0x1'))[_0x9068('0x2')];function getInterfaces(){var _0x222292=[];var _0x45c9e5=os[_0x9068('0x3')]();var _0x1c35ba=_[_0x9068('0x4')](_[_0x9068('0x5')](_0x45c9e5));for(var _0x2c25ef=0x0;_0x2c25ef<_0x1c35ba[_0x9068('0x6')];_0x2c25ef++){var _0x5ce5a7=_0x45c9e5[_0x1c35ba[_0x2c25ef]][_0x9068('0x7')](function(_0x5c833f){return _0x5c833f['family']===_0x9068('0x8')&&_0x5c833f[_0x9068('0x9')]===![];});_0x222292=_0x222292[_0x9068('0xa')](_0x5ce5a7);}return _0x222292;}function getFirstInterface(){var _0x77a2db=_[_0x9068('0xb')](getInterfaces());return{'macAddress':_0x77a2db&&_0x77a2db[_0x9068('0xc')]?_0x77a2db[_0x9068('0xc')]:_0x9068('0xd'),'ipAddress':_0x77a2db&&_0x77a2db[_0x9068('0xe')]?_0x77a2db['address']:_0x9068('0xf')};}exports[_0x9068('0x10')]=getFirstInterface;function getCPUhash(){var _0x3e5f5f=_[_0x9068('0x4')](os['cpus']()[_0x9068('0x11')](function(_0x1a89d4){return _0x1a89d4[_0x9068('0x12')];}))['join'](':');return crypto[_0x9068('0x13')](_0x9068('0x14'))[_0x9068('0x15')](_0x3e5f5f)['digest'](_0x9068('0x16'));}exports[_0x9068('0x17')]=function(){switch(os['platform']()){case _0x9068('0x18'):return exec(_0x9068('0x19'),{'encoding':'utf8'})[_0x9068('0x1a')]('\x0d\x0a','');default:var _0x412dbf=getFirstInterface();var _0x74df53=getCPUhash();var _0x430000=_0x74df53+'|'+os['hostname']()+'|'+_0x412dbf[_0x9068('0x1b')]+'|'+_0x412dbf[_0x9068('0x1c')];var _0x3ab698=crypto[_0x9068('0x13')](_0x9068('0x14'))[_0x9068('0x15')](_0x430000)[_0x9068('0x1d')](_0x9068('0x16'));return _0x3ab698[_0x9068('0x1e')](0x0,0x8)+'-'+_0x3ab698['substring'](0x8,0xc)+'-'+_0x3ab698[_0x9068('0x1e')](0xc,0x10)+'-'+_0x3ab698[_0x9068('0x1e')](0x10,0x14)+'-'+_0x3ab698[_0x9068('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index def2a7c..012f479 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 _0xb422=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','request-promise','version','../environment','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','createCipher','session','utf8','base64','final','createDecipher','aes-256-ctr','secrets','update','||FIELD||VALUE||\x0a','User','admin','email','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1'];(function(_0x5f1baf,_0x2942f0){var _0x30aa8d=function(_0x14c9c4){while(--_0x14c9c4){_0x5f1baf['push'](_0x5f1baf['shift']());}};_0x30aa8d(++_0x2942f0);}(_0xb422,0x85));var _0x2b42=function(_0x2ae5ce,_0x481760){_0x2ae5ce=_0x2ae5ce-0x0;var _0x3ccd3c=_0xb422[_0x2ae5ce];return _0x3ccd3c;};'use strict';var util=require('util');var crypto=require('crypto');var moment=require('moment');var rp=require(_0x2b42('0x0'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x2b42('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x2b42('0x2'));var hardware=require('./hardware');var logger=require(_0x2b42('0x3'))('license');var jira=require(_0x2b42('0x4'));var HOST=_0x2b42('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x750c2){return new BPromise(function(_0x51b3bd,_0xde9c67){var _0x1b64f7=util[_0x2b42('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x750c2,module['exports'][_0x2b42('0x1')]);if(oldToken){_0x1b64f7=util['format'](_0x2b42('0x7'),HOST,_0x750c2,module[_0x2b42('0x8')][_0x2b42('0x1')],oldToken);}var _0x1ec844={'uri':_0x1b64f7,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1ec844)[_0x2b42('0x9')](function(_0x18f30b){_0x51b3bd(_0x18f30b);})['catch'](function(_0x391127){_0xde9c67(_0x391127);});});}function encryptDate(_0x30a882){var _0x22272e=crypto[_0x2b42('0xa')]('aes-256-ctr',config['secrets'][_0x2b42('0xb')]);var _0x10cd23=_0x22272e['update'](_0x30a882,_0x2b42('0xc'),_0x2b42('0xd'));_0x10cd23+=_0x22272e[_0x2b42('0xe')](_0x2b42('0xd'));return _0x10cd23;}function decryptDate(_0x4cb695){var _0xc7e610=crypto[_0x2b42('0xf')](_0x2b42('0x10'),config[_0x2b42('0x11')][_0x2b42('0xb')]);var _0x4897d8=_0xc7e610[_0x2b42('0x12')](_0x4cb695,_0x2b42('0xd'),_0x2b42('0xc'));_0x4897d8+=_0xc7e610[_0x2b42('0xe')](_0x2b42('0xc'));return _0x4897d8;}function sendJiraAlert(_0x3ab83c,_0xa28ba4,_0x4728f4){var _0x490053=_0x2b42('0x13');return db[_0x2b42('0x14')]['findOne']({'where':{'role':_0x2b42('0x15')},'attributes':['fullname',_0x2b42('0x16')],'raw':!![]})[_0x2b42('0x9')](function(_0x18e43a){ADMIN=_0x18e43a;_0x490053+='|reason|'+_0x4728f4+'|\x0a';_0x490053+='|uuid|'+_0x3ab83c+'|\x0a';_0x490053+=_0x2b42('0x17')+_0xa28ba4+'|\x0a';_0x490053+=_0x2b42('0x18')+ADMIN[_0x2b42('0x19')]+'|\x0a';_0x490053+=_0x2b42('0x1a')+ADMIN['email']+'|\x0a';return _0x490053;})[_0x2b42('0x9')](function(_0x355859){var _0x5063b6=hardware[_0x2b42('0x1b')]()[_0x2b42('0x1c')];return jira[_0x2b42('0x1d')]({'key':_0x2b42('0x1e'),'summary':_0x2b42('0x1f'),'description':_0x355859,'issuetype':_0x2b42('0x20'),'oldToken':_0x3ab83c,'newToken':_0xa28ba4,'email':ADMIN['email'],'name':ADMIN[_0x2b42('0x19')],'reason':GRAY_PERIOD_REASON,'ip':_0x5063b6});});}function manageLicense(_0x319692,_0x477e97){var _0x256fc9=_0x477e97[_0x2b42('0x21')]({'plain':!![]});httpRequest(_0x319692)[_0x2b42('0x9')](function(_0x130912){if(oldToken){oldToken=undefined;}if(_0x130912[_0x2b42('0x22')]){if(!_0x256fc9[_0x2b42('0x23')]&&_0x256fc9[_0x2b42('0x23')]!=_0x130912[_0x2b42('0x23')]||_0x256fc9['license']&&_0x256fc9['data2']){logger[_0x2b42('0x24')](_0x2b42('0x25'));}if(_0x256fc9[_0x2b42('0x23')]&&!_0x256fc9[_0x2b42('0x26')]&&_0x256fc9['license']!=_0x130912[_0x2b42('0x23')]){logger[_0x2b42('0x24')](_0x2b42('0x27'));}if(_0x256fc9['license']&&!_0x256fc9['data2']&&_0x256fc9[_0x2b42('0x23')]==_0x130912[_0x2b42('0x23')]){return _0x477e97;}return _0x477e97[_0x2b42('0x12')]({'data1':_0x319692,'data2':null,'license':_0x130912[_0x2b42('0x23')]});}else{if(_0x130912['license']||_0x256fc9[_0x2b42('0x23')]){if(!_0x256fc9[_0x2b42('0x26')]){if(_0x256fc9[_0x2b42('0x28')]==_0x319692){GRAY_PERIOD_REASON='Disabled';logger[_0x2b42('0x24')](_0x2b42('0x29'));}else{GRAY_PERIOD_REASON=_0x2b42('0x2a');oldToken=_0x256fc9[_0x2b42('0x28')];logger[_0x2b42('0x24')](_0x2b42('0x2b'),_0x256fc9[_0x2b42('0x28')],_0x319692);}sendJiraAlert(_0x256fc9[_0x2b42('0x28')],_0x130912[_0x2b42('0x2c')],GRAY_PERIOD_REASON);logger[_0x2b42('0x24')](_0x2b42('0x2d'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2b42('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0x477e97['update']({'data2':encryptDate(moment()[_0x2b42('0x6')](_0x2b42('0x2e')))});}else{if(moment()['diff'](decryptDate(_0x256fc9['data2']),'days')>DAYS){logger[_0x2b42('0x24')](_0x2b42('0x2f'),moment()[_0x2b42('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0x477e97[_0x2b42('0x12')]({'data1':_0x319692,'data2':null,'license':null});}}}else{if(_0x256fc9[_0x2b42('0x28')]!=_0x319692){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x256fc9[_0x2b42('0x28')],_0x319692);return _0x477e97[_0x2b42('0x12')]({'data1':_0x319692,'data2':null,'license':null});}}}return _0x477e97;})[_0x2b42('0x9')](function(_0x4efb12){_0x477e97=_0x4efb12;})[_0x2b42('0x30')](function(_0x16d364){logger[_0x2b42('0x31')](_0x16d364[_0x2b42('0x32')]);})[_0x2b42('0x33')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x477e97);},TIME);});}function defaultLicense(){var _0x388def=hardware[_0x2b42('0x34')]();if(_0x388def){return db[_0x2b42('0x35')][_0x2b42('0x36')]({'where':{'id':0x1},'defaults':{'data1':_0x388def}})[_0x2b42('0x37')](function(_0x27b219,_0x45fb9f){logger[_0x2b42('0x24')](_0x2b42('0x38'),_0x388def);manageLicense(_0x388def,_0x27b219);})[_0x2b42('0x30')](function(_0x4fdd40){logger['error'](_0x4fdd40[_0x2b42('0x32')]);});}}exports[_0x2b42('0x39')]=defaultLicense; \ No newline at end of file +var _0x96f2=['DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../environment','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','secrets','session','update','base64','createDecipher','aes-256-ctr','utf8','final','||FIELD||VALUE||\x0a','User','findOne','fullname','email','then','|reason|','|uuid|','|machineUuid|','|email|','openIssue','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','diff','days'];(function(_0x106f69,_0x474efa){var _0x23229b=function(_0x18967e){while(--_0x18967e){_0x106f69['push'](_0x106f69['shift']());}};_0x23229b(++_0x474efa);}(_0x96f2,0xb0));var _0x296f=function(_0xdc890b,_0x2dce60){_0xdc890b=_0xdc890b-0x0;var _0x8e4dc8=_0x96f2[_0xdc890b];return _0x8e4dc8;};'use strict';var util=require(_0x296f('0x0'));var crypto=require('crypto');var moment=require(_0x296f('0x1'));var rp=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var pkginfo=require('pkginfo')(module,_0x296f('0x4'));var db=require(_0x296f('0x5'))['db'];var config=require(_0x296f('0x6'));var hardware=require('./hardware');var logger=require(_0x296f('0x7'))(_0x296f('0x8'));var jira=require('../../api/jira/jira.controller');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x164031){return new BPromise(function(_0x1d019f,_0x2dc0ca){var _0x28f708=util[_0x296f('0x9')](_0x296f('0xa'),HOST,_0x164031,module[_0x296f('0xb')][_0x296f('0x4')]);if(oldToken){_0x28f708=util[_0x296f('0x9')](_0x296f('0xc'),HOST,_0x164031,module['exports'][_0x296f('0x4')],oldToken);}var _0x1a2a02={'uri':_0x28f708,'method':_0x296f('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1a2a02)['then'](function(_0x2e2307){_0x1d019f(_0x2e2307);})[_0x296f('0xe')](function(_0x1800af){_0x2dc0ca(_0x1800af);});});}function encryptDate(_0x28dad3){var _0x5710ac=crypto['createCipher']('aes-256-ctr',config[_0x296f('0xf')][_0x296f('0x10')]);var _0x2ae407=_0x5710ac[_0x296f('0x11')](_0x28dad3,'utf8',_0x296f('0x12'));_0x2ae407+=_0x5710ac['final']('base64');return _0x2ae407;}function decryptDate(_0x367e03){var _0x2ae0f4=crypto[_0x296f('0x13')](_0x296f('0x14'),config['secrets']['session']);var _0x3e3860=_0x2ae0f4['update'](_0x367e03,_0x296f('0x12'),_0x296f('0x15'));_0x3e3860+=_0x2ae0f4[_0x296f('0x16')]('utf8');return _0x3e3860;}function sendJiraAlert(_0xcc2b48,_0x3b7db8,_0x57f19d){var _0x33e62f=_0x296f('0x17');return db[_0x296f('0x18')][_0x296f('0x19')]({'where':{'role':'admin'},'attributes':[_0x296f('0x1a'),_0x296f('0x1b')],'raw':!![]})[_0x296f('0x1c')](function(_0x54005f){ADMIN=_0x54005f;_0x33e62f+=_0x296f('0x1d')+_0x57f19d+'|\x0a';_0x33e62f+=_0x296f('0x1e')+_0xcc2b48+'|\x0a';_0x33e62f+=_0x296f('0x1f')+_0x3b7db8+'|\x0a';_0x33e62f+='|name|'+ADMIN[_0x296f('0x1a')]+'|\x0a';_0x33e62f+=_0x296f('0x20')+ADMIN[_0x296f('0x1b')]+'|\x0a';return _0x33e62f;})['then'](function(_0x4a1912){var _0x12abfb=hardware['getFirstInterface']()['ipAddress'];return jira[_0x296f('0x21')]({'key':'MOTLICENSE','summary':'Motion\x20License\x20Alert','description':_0x4a1912,'issuetype':'Alert','oldToken':_0xcc2b48,'newToken':_0x3b7db8,'email':ADMIN[_0x296f('0x1b')],'name':ADMIN[_0x296f('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x12abfb});});}function manageLicense(_0x120482,_0x371db0){var _0x2b8078=_0x371db0[_0x296f('0x22')]({'plain':!![]});httpRequest(_0x120482)['then'](function(_0x52ba5c){if(oldToken){oldToken=undefined;}if(_0x52ba5c[_0x296f('0x23')]){if(!_0x2b8078['license']&&_0x2b8078[_0x296f('0x8')]!=_0x52ba5c[_0x296f('0x8')]||_0x2b8078[_0x296f('0x8')]&&_0x2b8078[_0x296f('0x24')]){logger[_0x296f('0x25')](_0x296f('0x26'));}if(_0x2b8078['license']&&!_0x2b8078[_0x296f('0x24')]&&_0x2b8078['license']!=_0x52ba5c[_0x296f('0x8')]){logger[_0x296f('0x25')](_0x296f('0x27'));}if(_0x2b8078[_0x296f('0x8')]&&!_0x2b8078[_0x296f('0x24')]&&_0x2b8078[_0x296f('0x8')]==_0x52ba5c[_0x296f('0x8')]){return _0x371db0;}return _0x371db0[_0x296f('0x11')]({'data1':_0x120482,'data2':null,'license':_0x52ba5c[_0x296f('0x8')]});}else{if(_0x52ba5c[_0x296f('0x8')]||_0x2b8078[_0x296f('0x8')]){if(!_0x2b8078[_0x296f('0x24')]){if(_0x2b8078[_0x296f('0x28')]==_0x120482){GRAY_PERIOD_REASON='Disabled';logger[_0x296f('0x25')](_0x296f('0x29'));}else{GRAY_PERIOD_REASON=_0x296f('0x2a');oldToken=_0x2b8078[_0x296f('0x28')];logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2b8078['data1'],_0x120482);}sendJiraAlert(_0x2b8078[_0x296f('0x28')],_0x52ba5c[_0x296f('0x2b')],GRAY_PERIOD_REASON);logger['info'](_0x296f('0x2c'),GRAY_PERIOD_REASON[_0x296f('0x2d')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x371db0[_0x296f('0x11')]({'data2':encryptDate(moment()[_0x296f('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x296f('0x2e')](decryptDate(_0x2b8078[_0x296f('0x24')]),_0x296f('0x2f'))>DAYS){logger[_0x296f('0x25')](_0x296f('0x30'),moment()[_0x296f('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x371db0['update']({'data1':_0x120482,'data2':null,'license':null});}}}else{if(_0x2b8078['data1']!=_0x120482){logger[_0x296f('0x25')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2b8078['data1'],_0x120482);return _0x371db0[_0x296f('0x11')]({'data1':_0x120482,'data2':null,'license':null});}}}return _0x371db0;})[_0x296f('0x1c')](function(_0x2b7380){_0x371db0=_0x2b7380;})[_0x296f('0xe')](function(_0x29b943){logger[_0x296f('0x31')](_0x29b943[_0x296f('0x32')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x296f('0x33')](),_0x371db0);},TIME);});}function defaultLicense(){var _0x12dad2=hardware[_0x296f('0x33')]();if(_0x12dad2){return db[_0x296f('0x34')][_0x296f('0x35')]({'where':{'id':0x1},'defaults':{'data1':_0x12dad2}})[_0x296f('0x36')](function(_0x344548,_0x17208d){logger['info'](_0x296f('0x37'),_0x12dad2);manageLicense(_0x12dad2,_0x344548);})[_0x296f('0xe')](function(_0x5214bc){logger[_0x296f('0x31')](_0x5214bc[_0x296f('0x32')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6946b5e..bd47595 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 _0x7de4=['uuid','machineUuid','disabled','Breaking\x20license','data1','Demo\x20license','getLicense','find','then','checkLicense','crypto','lodash','moment','../environment','../../mysqldb','license','data2','split','createDecipher','%s:%s:%s','update','utf8','final','parse','demo','getUuid','aes-256-ctr','secrets','base64','gray','deadline','add','format','grayReason'];(function(_0x54ce75,_0xf87395){var _0x1be166=function(_0x3f0d4e){while(--_0x3f0d4e){_0x54ce75['push'](_0x54ce75['shift']());}};_0x1be166(++_0xf87395);}(_0x7de4,0xb4));var _0x47de=function(_0x3fd2fa,_0x3b3ef0){_0x3fd2fa=_0x3fd2fa-0x0;var _0x52cd41=_0x7de4[_0x3fd2fa];return _0x52cd41;};'use strict';var crypto=require(_0x47de('0x0'));var util=require('util');var _=require(_0x47de('0x1'));var moment=require(_0x47de('0x2'));var hardware=require('./hardware');var config=require(_0x47de('0x3'));var db=require(_0x47de('0x4'))['db'];function checkLicense(_0x10a014,_0x23d1ea){if(_0x10a014){try{var _0x12ecf9=_0x23d1ea||_0x10a014[_0x47de('0x5')];if(_['isEmpty'](_0x12ecf9)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x36a9bc=_0x10a014['data1'];var _0x1765fa=_0x10a014[_0x47de('0x6')];var _0x540c65=_0x36a9bc[_0x47de('0x7')]('-')[0x4];var _0x23e380=_0x36a9bc[_0x47de('0x7')]('-')[0x0];var _0x247262=crypto[_0x47de('0x8')]('aes-256-ctr',util['format'](_0x47de('0x9'),_0x540c65,_0x36a9bc,_0x23e380));var _0x54cded=_0x247262[_0x47de('0xa')](_0x12ecf9,'base64',_0x47de('0xb'));_0x54cded+=_0x247262[_0x47de('0xc')](_0x47de('0xb'));var _0x20a566=JSON[_0x47de('0xd')](_0x54cded);_0x20a566[_0x47de('0xe')]=![];_0x20a566['uuid']=_0x36a9bc;_0x20a566['machineUuid']=hardware[_0x47de('0xf')]();if(_0x1765fa){var _0x650764=crypto[_0x47de('0x8')](_0x47de('0x10'),config[_0x47de('0x11')]['session']);var _0xe03c29=_0x650764[_0x47de('0xa')](_0x1765fa,_0x47de('0x12'),_0x47de('0xb'));_0xe03c29+=_0x650764[_0x47de('0xc')]('utf8');_0x20a566[_0x47de('0x13')]=_0xe03c29;_0x20a566[_0x47de('0x14')]=moment(_0xe03c29)[_0x47de('0x15')](0x7,'days')[_0x47de('0x16')]();_0x20a566[_0x47de('0x17')]=_0x20a566[_0x47de('0x18')]!=_0x20a566[_0x47de('0x19')]?'changed':_0x47de('0x1a');}return _0x20a566;}catch(_0x15a275){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x47de('0x1b'),'uuid':_0x10a014[_0x47de('0x1c')],'machineUuid':hardware['getUuid'](),'message':_0x15a275['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x47de('0x1d'),'uuid':_0x10a014[_0x47de('0x1c')],'machineUuid':hardware[_0x47de('0xf')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x47de('0x1e')]=function(_0x2e922f){return db['License'][_0x47de('0x1f')](_['defaults'](_0x2e922f,{'raw':!![],'where':{'id':0x1}}))[_0x47de('0x20')](function(_0x3e66fa){return checkLicense(_0x3e66fa,null);});};exports[_0x47de('0x21')]=checkLicense; \ No newline at end of file +var _0x0851=['find','defaults','crypto','util','lodash','moment','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','demo','uuid','machineUuid','secrets','session','gray','add','grayReason','changed','message','getUuid','getLicense'];(function(_0x4881db,_0x32e98f){var _0x43213b=function(_0x39cadb){while(--_0x39cadb){_0x4881db['push'](_0x4881db['shift']());}};_0x43213b(++_0x32e98f);}(_0x0851,0x8a));var _0x1085=function(_0x4b1cd7,_0x27b641){_0x4b1cd7=_0x4b1cd7-0x0;var _0x400e61=_0x0851[_0x4b1cd7];return _0x400e61;};'use strict';var crypto=require(_0x1085('0x0'));var util=require(_0x1085('0x1'));var _=require(_0x1085('0x2'));var moment=require(_0x1085('0x3'));var hardware=require('./hardware');var config=require(_0x1085('0x4'));var db=require(_0x1085('0x5'))['db'];function checkLicense(_0x2de96f,_0x3cbd88){if(_0x2de96f){try{var _0x3b40fb=_0x3cbd88||_0x2de96f[_0x1085('0x6')];if(_[_0x1085('0x7')](_0x3b40fb)){throw new Error(_0x1085('0x8'));}var _0x152eeb=_0x2de96f[_0x1085('0x9')];var _0x33dd2b=_0x2de96f[_0x1085('0xa')];var _0x546546=_0x152eeb['split']('-')[0x4];var _0x114b8b=_0x152eeb[_0x1085('0xb')]('-')[0x0];var _0x41b586=crypto[_0x1085('0xc')](_0x1085('0xd'),util[_0x1085('0xe')]('%s:%s:%s',_0x546546,_0x152eeb,_0x114b8b));var _0x1f84a9=_0x41b586[_0x1085('0xf')](_0x3b40fb,_0x1085('0x10'),_0x1085('0x11'));_0x1f84a9+=_0x41b586[_0x1085('0x12')](_0x1085('0x11'));var _0x7e46fb=JSON[_0x1085('0x13')](_0x1f84a9);_0x7e46fb[_0x1085('0x14')]=![];_0x7e46fb[_0x1085('0x15')]=_0x152eeb;_0x7e46fb[_0x1085('0x16')]=hardware['getUuid']();if(_0x33dd2b){var _0xf5fd55=crypto['createDecipher'](_0x1085('0xd'),config[_0x1085('0x17')][_0x1085('0x18')]);var _0x58e0bf=_0xf5fd55[_0x1085('0xf')](_0x33dd2b,_0x1085('0x10'),_0x1085('0x11'));_0x58e0bf+=_0xf5fd55[_0x1085('0x12')]('utf8');_0x7e46fb[_0x1085('0x19')]=_0x58e0bf;_0x7e46fb['deadline']=moment(_0x58e0bf)[_0x1085('0x1a')](0x7,'days')[_0x1085('0xe')]();_0x7e46fb[_0x1085('0x1b')]=_0x7e46fb[_0x1085('0x15')]!=_0x7e46fb['machineUuid']?_0x1085('0x1c'):'disabled';}return _0x7e46fb;}catch(_0xc4b25){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2de96f['data1'],'machineUuid':hardware['getUuid'](),'message':_0xc4b25[_0x1085('0x1d')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x2de96f['data1'],'machineUuid':hardware[_0x1085('0x1e')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x1085('0x1f')]=function(_0x33c865){return db['License'][_0x1085('0x20')](_[_0x1085('0x21')](_0x33c865,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x12296b){return checkLicense(_0x12296b,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 71a79e3..97445e2 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 _0xca3a=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x5a227d,_0x220692){var _0x1033f1=function(_0x1baa0d){while(--_0x1baa0d){_0x5a227d['push'](_0x5a227d['shift']());}};_0x1033f1(++_0x220692);}(_0xca3a,0x78));var _0xaca3=function(_0x2c2839,_0x1d1d47){_0x2c2839=_0x2c2839-0x0;var _0x224936=_0xca3a[_0x2c2839];return _0x224936;};'use strict';module[_0xaca3('0x0')]={'DOMAIN':_0xaca3('0x1'),'SESSION_SECRET':_0xaca3('0x2'),'GOOGLE_ID':_0xaca3('0x3'),'GOOGLE_SECRET':_0xaca3('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xbaf0=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x254076,_0x5e7b8d){var _0x21a93e=function(_0x26aa78){while(--_0x26aa78){_0x254076['push'](_0x254076['shift']());}};_0x21a93e(++_0x5e7b8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';module['exports']={'DOMAIN':_0x0baf('0x0'),'SESSION_SECRET':_0x0baf('0x1'),'GOOGLE_ID':_0x0baf('0x2'),'GOOGLE_SECRET':_0x0baf('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 258a755..32d208c 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe58=['moment','INFO','join','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','%s-%s','error','info','Console','env'];(function(_0x476d18,_0x4d5d3a){var _0x670eef=function(_0x126d4a){while(--_0x126d4a){_0x476d18['push'](_0x476d18['shift']());}};_0x670eef(++_0x4d5d3a);}(_0xfe58,0x104));var _0x8fe5=function(_0x5e3b21,_0x2e2cc4){_0x5e3b21=_0x5e3b21-0x0;var _0x391d00=_0xfe58[_0x5e3b21];return _0x391d00;};'use strict';var moment=require(_0x8fe5('0x0'));var winston=require('winston');var util=require('util');var path=require('path');var debugLevel=_0x8fe5('0x1');function filename(_0x4a9541,_0x2c8276){return path[_0x8fe5('0x2')]('/var',_0x8fe5('0x3'),_0x8fe5('0x4'),util[_0x8fe5('0x5')](_0x8fe5('0x6'),_0x4a9541,_0x2c8276));}function formatter(_0x162f93,_0x35fdfe){return util[_0x8fe5('0x5')](_0x8fe5('0x7'),moment()['format'](_0x8fe5('0x8')),_0x35fdfe[_0x8fe5('0x9')][_0x8fe5('0xa')](),_0x162f93,_0x35fdfe[_0x8fe5('0xb')]);}module[_0x8fe5('0xc')]=function(_0x2d674a){return new winston[(_0x8fe5('0xd'))]({'transports':[new winston[(_0x8fe5('0xe'))]['File']({'name':util[_0x8fe5('0x5')](_0x8fe5('0xf'),_0x2d674a,_0x8fe5('0x10')),'filename':filename(_0x2d674a,_0x8fe5('0x10')),'level':_0x8fe5('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42c3c3){return formatter(_0x2d674a,_0x42c3c3);}}),new winston[(_0x8fe5('0xe'))]['File']({'name':util[_0x8fe5('0x5')](_0x8fe5('0xf'),_0x2d674a,_0x8fe5('0x11')),'filename':filename(_0x2d674a,_0x8fe5('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x234325){return formatter(_0x2d674a,_0x234325);}}),new winston[(_0x8fe5('0xe'))][(_0x8fe5('0x12'))]({'level':process[_0x8fe5('0x13')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3c6d43){return formatter(_0x2d674a,_0x3c6d43);}})]});}; \ No newline at end of file +var _0x94e7=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','%s-%s','error','File','info','Console','env','winston','util','path','join','/var','log','xcally','format','%s-%s.log'];(function(_0x29aa42,_0x302f20){var _0x321aca=function(_0x2a2c46){while(--_0x2a2c46){_0x29aa42['push'](_0x29aa42['shift']());}};_0x321aca(++_0x302f20);}(_0x94e7,0xc6));var _0x794e=function(_0x227938,_0x5546b7){_0x227938=_0x227938-0x0;var _0x34d4bb=_0x94e7[_0x227938];return _0x34d4bb;};'use strict';var moment=require('moment');var winston=require(_0x794e('0x0'));var util=require(_0x794e('0x1'));var path=require(_0x794e('0x2'));var debugLevel='INFO';function filename(_0x28736a,_0x928401){return path[_0x794e('0x3')](_0x794e('0x4'),_0x794e('0x5'),_0x794e('0x6'),util[_0x794e('0x7')](_0x794e('0x8'),_0x28736a,_0x928401));}function formatter(_0xa6397e,_0x476204){return util[_0x794e('0x7')](_0x794e('0x9'),moment()['format'](_0x794e('0xa')),_0x476204[_0x794e('0xb')][_0x794e('0xc')](),_0xa6397e,_0x476204[_0x794e('0xd')]);}module[_0x794e('0xe')]=function(_0x1b767d){return new winston[(_0x794e('0xf'))]({'transports':[new winston[(_0x794e('0x10'))]['File']({'name':util[_0x794e('0x7')](_0x794e('0x11'),_0x1b767d,_0x794e('0x12')),'filename':filename(_0x1b767d,_0x794e('0x12')),'level':_0x794e('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14fd0d){return formatter(_0x1b767d,_0x14fd0d);}}),new winston[(_0x794e('0x10'))][(_0x794e('0x13'))]({'name':util[_0x794e('0x7')]('%s-%s',_0x1b767d,_0x794e('0x14')),'filename':filename(_0x1b767d,_0x794e('0x14')),'level':_0x794e('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5760a5){return formatter(_0x1b767d,_0x5760a5);}}),new winston['transports'][(_0x794e('0x15'))]({'level':process[_0x794e('0x16')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x39290b){return formatter(_0x1b767d,_0x39290b);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b5e8de4..51b2364 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 _0x3040=['exports','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x7781d3,_0x2ca0fb){var _0x169456=function(_0x28b1bb){while(--_0x28b1bb){_0x7781d3['push'](_0x7781d3['shift']());}};_0x169456(++_0x2ca0fb);}(_0x3040,0x6f));var _0x0304=function(_0x281b72,_0x41a005){_0x281b72=_0x281b72-0x0;var _0x1443dc=_0x3040[_0x281b72];return _0x1443dc;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x0304('0x0'),'script':path[_0x0304('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x0304('0x2'),'script':path[_0x0304('0x1')](__dirname,_0x0304('0x3'))},{'name':_0x0304('0x4'),'script':path[_0x0304('0x1')](__dirname,_0x0304('0x5'))},{'name':'email','script':path[_0x0304('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x0304('0x6'),'script':path['join'](__dirname,_0x0304('0x7'))},{'name':'xdr','script':path[_0x0304('0x1')](__dirname,_0x0304('0x8'))}]};module[_0x0304('0x9')]=config; \ No newline at end of file +var _0x5a52=['exports','path','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x57f2e1,_0x14e4e5){var _0x2d9d84=function(_0x2298d9){while(--_0x2298d9){_0x57f2e1['push'](_0x57f2e1['shift']());}};_0x2d9d84(++_0x14e4e5);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var path=require(_0x25a5('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0x25a5('0x1'),'script':path[_0x25a5('0x2')](__dirname,_0x25a5('0x3'))},{'name':_0x25a5('0x4'),'script':path[_0x25a5('0x2')](__dirname,_0x25a5('0x5'))},{'name':_0x25a5('0x6'),'script':path[_0x25a5('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x25a5('0x7'),'script':path['join'](__dirname,_0x25a5('0x8'))},{'name':_0x25a5('0x9'),'script':path[_0x25a5('0x2')](__dirname,_0x25a5('0xa'))}]};module[_0x25a5('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index d61605c..e8e7a10 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 _0x6462=['disconnect','stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','then'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x6462,0x11f));var _0x2646=function(_0x25660f,_0x51ecde){_0x25660f=_0x25660f-0x0;var _0x358722=_0x6462[_0x25660f];return _0x358722;};'use strict';var pm2=require(_0x2646('0x0'));var BPromise=require(_0x2646('0x1'));var config=require(_0x2646('0x2'));function connect(){return new BPromise(function(_0x191bd7,_0x49dbe3){return pm2[_0x2646('0x3')](function(_0x888ca2){if(_0x888ca2){return _0x49dbe3(_0x888ca2);}return _0x191bd7(_0x2646('0x4'));});});};exports[_0x2646('0x5')]=function(_0x34c686){return connect()[_0x2646('0x6')](function(){return new BPromise(function(_0x301b01,_0x482618){return pm2['start'](_0x34c686,function(_0x9024f4,_0x3cac63){if(_0x9024f4){return _0x482618(_0x9024f4);}pm2[_0x2646('0x7')]();return _0x301b01(_0x3cac63);});});});};exports['stop']=function(_0x22796c){return connect()[_0x2646('0x6')](function(){return new BPromise(function(_0x42f167,_0x2eda4d){return pm2[_0x2646('0x8')](_0x22796c,function(_0x19a547,_0x5b666d){if(_0x19a547){return _0x2eda4d(_0x19a547);}pm2[_0x2646('0x7')]();return _0x42f167(_0x5b666d);});});});};exports[_0x2646('0x9')]=function(_0x50aa72){return connect()[_0x2646('0x6')](function(){return new BPromise(function(_0x4b4023,_0x3a3daf){return pm2[_0x2646('0x9')](_0x50aa72,function(_0x17aca,_0x3ea81f){if(_0x17aca){return _0x3a3daf(_0x17aca);}pm2['disconnect']();return _0x4b4023(_0x3ea81f);});});});};exports[_0x2646('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x478b72,_0xa1b487){return pm2['list'](function(_0x1727ce,_0x8bcc76){if(_0x1727ce){return _0xa1b487(_0x1727ce);}pm2[_0x2646('0x7')]();return _0x478b72(_0x8bcc76);});});});};exports['describe']=function(_0x593642){return connect()[_0x2646('0x6')](function(){return new BPromise(function(_0x19a4a1,_0x52914d){return pm2['describe'](_0x593642,function(_0x477528,_0x29d0e6){if(_0x477528){return _0x52914d(_0x477528);}pm2[_0x2646('0x7')]();return _0x19a4a1(_0x29d0e6);});});});};exports[_0x2646('0xb')]=function(_0xd3e3f5){return connect()[_0x2646('0x6')](function(){return new BPromise(function(_0x45d577,_0x24cd8c){return pm2[_0x2646('0xb')](_0xd3e3f5,function(_0x2c0339,_0x20850f){if(_0x2c0339){return _0x24cd8c(_0x2c0339);}pm2['disconnect']();return _0x45d577(_0x20850f);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x12dcf4,_0x297887){return pm2[_0x2646('0xc')](function(_0x36ee19){if(_0x36ee19){return _0x297887(_0x36ee19);}return _0x12dcf4(_0x2646('0xd'));});});});}; \ No newline at end of file +var _0x4c41=['dump','saved','pm2','bluebird','./config','then','start','disconnect','stop','restart','describe','delete'];(function(_0x239f41,_0x40443d){var _0x37efe0=function(_0x2d9118){while(--_0x2d9118){_0x239f41['push'](_0x239f41['shift']());}};_0x37efe0(++_0x40443d);}(_0x4c41,0xda));var _0x14c4=function(_0x4c79b0,_0x47ba50){_0x4c79b0=_0x4c79b0-0x0;var _0x2bb939=_0x4c41[_0x4c79b0];return _0x2bb939;};'use strict';var pm2=require(_0x14c4('0x0'));var BPromise=require(_0x14c4('0x1'));var config=require(_0x14c4('0x2'));function connect(){return new BPromise(function(_0xedf55c,_0x586678){return pm2['connect'](function(_0x3a08cc){if(_0x3a08cc){return _0x586678(_0x3a08cc);}return _0xedf55c('connected');});});};exports['start']=function(_0x1a7572){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x42d8ce,_0x412091){return pm2[_0x14c4('0x4')](_0x1a7572,function(_0x356a5e,_0x562702){if(_0x356a5e){return _0x412091(_0x356a5e);}pm2[_0x14c4('0x5')]();return _0x42d8ce(_0x562702);});});});};exports[_0x14c4('0x6')]=function(_0x5133b1){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x4086cf,_0x39343c){return pm2['stop'](_0x5133b1,function(_0x2ea67a,_0x438420){if(_0x2ea67a){return _0x39343c(_0x2ea67a);}pm2['disconnect']();return _0x4086cf(_0x438420);});});});};exports[_0x14c4('0x7')]=function(_0x15ea33){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x1fb0a8,_0x4c8ea3){return pm2[_0x14c4('0x7')](_0x15ea33,function(_0x523ac3,_0x50d681){if(_0x523ac3){return _0x4c8ea3(_0x523ac3);}pm2[_0x14c4('0x5')]();return _0x1fb0a8(_0x50d681);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x2e610c,_0xba78c8){return pm2['list'](function(_0x380b5c,_0x2a212d){if(_0x380b5c){return _0xba78c8(_0x380b5c);}pm2['disconnect']();return _0x2e610c(_0x2a212d);});});});};exports[_0x14c4('0x8')]=function(_0x468fec){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x42a787,_0x2b81c1){return pm2[_0x14c4('0x8')](_0x468fec,function(_0x2d874a,_0x57cf0f){if(_0x2d874a){return _0x2b81c1(_0x2d874a);}pm2['disconnect']();return _0x42a787(_0x57cf0f);});});});};exports[_0x14c4('0x9')]=function(_0x314efc){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x48e99d,_0x177803){return pm2['delete'](_0x314efc,function(_0x16b660,_0xf266a2){if(_0x16b660){return _0x177803(_0x16b660);}pm2[_0x14c4('0x5')]();return _0x48e99d(_0xf266a2);});});});};exports[_0x14c4('0xa')]=function(){return connect()[_0x14c4('0x3')](function(){return new BPromise(function(_0x54f3b1,_0x39a419){return pm2['dump'](function(_0x323d5e){if(_0x323d5e){return _0x39a419(_0x323d5e);}return _0x54f3b1(_0x14c4('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 03ea121..22c7f29 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 _0xcc0b=['lodash','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','minutes','system','timeout','format','map','length','chatInteraction:update','catch','error','start'];(function(_0x3151ac,_0x364f57){var _0x2f9707=function(_0x3bdbb8){while(--_0x3bdbb8){_0x3151ac['push'](_0x3151ac['shift']());}};_0x2f9707(++_0x364f57);}(_0xcc0b,0x12b));var _0xbcc0=function(_0x38d6e8,_0x21c3b9){_0x38d6e8=_0x38d6e8-0x0;var _0x37e27f=_0xcc0b[_0x38d6e8];return _0x37e27f;};'use strict';var _=require(_0xbcc0('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require(_0xbcc0('0x1'))['db'];var config=require(_0xbcc0('0x2'));config[_0xbcc0('0x3')]=_[_0xbcc0('0x4')](config[_0xbcc0('0x3')],{'host':_0xbcc0('0x5'),'port':0x18eb});var io=require(_0xbcc0('0x6'))(new Redis(config[_0xbcc0('0x3')]));function closeInteractions(){var _0x3d4ae0=0x0;var _0x2174ed=[];return db[_0xbcc0('0x7')][_0xbcc0('0x8')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xbcc0('0x9')](function(_0x380c92){_0x3d4ae0=_0x380c92[_0xbcc0('0xa')];if(_0x3d4ae0){return db[_0xbcc0('0xb')][_0xbcc0('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x380c92[_0xbcc0('0xa')],_0xbcc0('0xd'))}}});}else{return[];}})[_0xbcc0('0x9')](function(_0x59d8d5){_0x2174ed=_0x59d8d5;if(_0x3d4ae0){return db[_0xbcc0('0xb')]['update']({'closeReason':_0xbcc0('0xe'),'disposition':_0xbcc0('0xf'),'closed':!![],'closedAt':moment()[_0xbcc0('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xbcc0('0x11')](_0x2174ed||[],'id')}});}})['then'](function(_0x44cc3d){for(var _0x5054fd=0x0;_0x5054fd<_0x2174ed[_0xbcc0('0x12')];_0x5054fd++){io['emit'](_0xbcc0('0x13'),{'id':_0x2174ed[_0x5054fd]['id'],'closed':!![]});}})[_0xbcc0('0x14')](function(_0xad7d2d){console[_0xbcc0('0x15')](_0xad7d2d);});}exports[_0xbcc0('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x1f02=['../../config/environment','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','catch','error','start','lodash','moment','ioredis','../../mysqldb'];(function(_0xbd86b3,_0x36081b){var _0x8f988=function(_0xbf5d2b){while(--_0xbf5d2b){_0xbd86b3['push'](_0xbd86b3['shift']());}};_0x8f988(++_0x36081b);}(_0x1f02,0x1d0));var _0x21f0=function(_0x337178,_0x4f6cc7){_0x337178=_0x337178-0x0;var _0x366967=_0x1f02[_0x337178];return _0x366967;};'use strict';var _=require(_0x21f0('0x0'));var moment=require(_0x21f0('0x1'));var Redis=require(_0x21f0('0x2'));var db=require(_0x21f0('0x3'))['db'];var config=require(_0x21f0('0x4'));config[_0x21f0('0x5')]=_['defaults'](config[_0x21f0('0x5')],{'host':_0x21f0('0x6'),'port':0x18eb});var io=require(_0x21f0('0x7'))(new Redis(config[_0x21f0('0x5')]));function closeInteractions(){var _0x267a48=0x0;var _0xdb794c=[];return db[_0x21f0('0x8')][_0x21f0('0x9')]({'raw':!![],'attributes':['id',_0x21f0('0xa')],'where':{'id':0x1}})[_0x21f0('0xb')](function(_0x5b7539){_0x267a48=_0x5b7539[_0x21f0('0xa')];if(_0x267a48){return db[_0x21f0('0xc')][_0x21f0('0xd')]({'raw':!![],'attributes':['id',_0x21f0('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x5b7539[_0x21f0('0xa')],_0x21f0('0xf'))}}});}else{return[];}})[_0x21f0('0xb')](function(_0x4b9bc2){_0xdb794c=_0x4b9bc2;if(_0x267a48){return db['ChatInteraction'][_0x21f0('0x10')]({'closeReason':_0x21f0('0x11'),'disposition':_0x21f0('0x12'),'closed':!![],'closedAt':moment()[_0x21f0('0x13')](_0x21f0('0x14'))},{'where':{'id':_[_0x21f0('0x15')](_0xdb794c||[],'id')}});}})['then'](function(_0x5bd60e){for(var _0x2ec450=0x0;_0x2ec450<_0xdb794c[_0x21f0('0x16')];_0x2ec450++){io['emit']('chatInteraction:update',{'id':_0xdb794c[_0x2ec450]['id'],'closed':!![]});}})[_0x21f0('0x17')](function(_0x1817cc){console[_0x21f0('0x18')](_0x1817cc);});}exports[_0x21f0('0x19')]=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 1c0a663..97b4dec 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 _0xa32b=['error','error\x20mail','data','isNil','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','jobs','map','keyBy','toString','intersection','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','exists','stop\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.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>','name','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','existsSync','status','Sent','message','text','stringify','attachments','empty\x20file,\x20email\x20not\x20sent','request','then','email\x20sent'];(function(_0x5effa2,_0x52a5d1){var _0x126eb2=function(_0x218406){while(--_0x218406){_0x5effa2['push'](_0x5effa2['shift']());}};_0x126eb2(++_0x52a5d1);}(_0xa32b,0x7e));var _0xba32=function(_0x405dc0,_0x5f2898){_0x405dc0=_0x405dc0-0x0;var _0x1ed46d=_0xa32b[_0x405dc0];return _0x1ed46d;};'use strict';var fs=require('fs');var util=require(_0xba32('0x0'));var path=require(_0xba32('0x1'));var _=require(_0xba32('0x2'));var moment=require('moment');var CronJobManager=require(_0xba32('0x3'));var jayson=require(_0xba32('0x4'));var BPromise=require('bluebird');var logger=require(_0xba32('0x5'))(_0xba32('0x6'));var db=require(_0xba32('0x7'))['db'];var analyticCustomReportController=require(_0xba32('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xba32('0x9')][_0xba32('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x24d8ff,_0x136c26){return function(){logger[_0xba32('0xb')](_0xba32('0xc'),_0x24d8ff[_0xba32('0xd')]);var _0xc99798=!![];var _0x15ecfd={'tls':{'rejectUnauthorized':![]}};if(_0x24d8ff[_0xba32('0xe')][_0xba32('0xf')][_0xba32('0x10')]){_0x15ecfd[_0xba32('0x10')]=_0x24d8ff[_0xba32('0xe')]['Smtp'][_0xba32('0x10')];}else{_0x15ecfd[_0xba32('0x11')]=_0x24d8ff['MailAccount'][_0xba32('0xf')]['host'];_0x15ecfd[_0xba32('0x12')]=_0x24d8ff[_0xba32('0xe')][_0xba32('0xf')][_0xba32('0x12')];_0x15ecfd[_0xba32('0x13')]=_0x24d8ff[_0xba32('0xe')]['Smtp']['secure'];}if(_0x24d8ff[_0xba32('0xe')][_0xba32('0xf')][_0xba32('0x14')]){_0x15ecfd[_0xba32('0x15')]={'user':_0x24d8ff[_0xba32('0xe')]['Smtp'][_0xba32('0x16')],'pass':_0x24d8ff[_0xba32('0xe')][_0xba32('0xf')][_0xba32('0x17')]};}var _0x1327eb={'account':_0x15ecfd,'message':{'from':util[_0xba32('0x18')](_0xba32('0x19'),_0x24d8ff[_0xba32('0xe')][_0xba32('0x1a')],_0x24d8ff['MailAccount'][_0xba32('0xd')]||_0x24d8ff[_0xba32('0xe')][_0xba32('0xf')]['user']),'to':_0x24d8ff['email'],'cc':_0x24d8ff['cc'],'bcc':_0x24d8ff[_0xba32('0x1b')],'subject':util[_0xba32('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x136c26[_0xba32('0x1a')],_0x24d8ff[_0xba32('0x1c')],_0x24d8ff[_0xba32('0x1d')])}};var _0x372b6b=path[_0xba32('0x1e')](__dirname,_0xba32('0x1f'));var _0x5b59e2=_0x136c26[_0xba32('0x20')];var _0x2cf923=util[_0xba32('0x18')]('%s.%s',path[_0xba32('0x21')](_0x136c26[_0xba32('0x20')],path['extname'](_0x136c26[_0xba32('0x20')])),_0xba32('0x22'));var _0x3f1f60=path[_0xba32('0x1e')](_0x372b6b,_0x5b59e2);var _0x1e0069=path[_0xba32('0x1e')](_0x372b6b,_0x2cf923);if(fs[_0xba32('0x23')](_0x3f1f60)){_0x136c26[_0xba32('0x24')]=_0xba32('0x25');_0x1327eb[_0xba32('0x26')]['attachments']=[{'filename':_0x5b59e2,'path':_0x3f1f60}];_0x1327eb[_0xba32('0x26')][_0xba32('0x27')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xba32('0x28')](_0x136c26,null,0x2));}else if(fs['existsSync'](_0x1e0069)){_0x136c26['status']=_0xba32('0x25');_0x1327eb[_0xba32('0x26')][_0xba32('0x29')]=[{'filename':_0x2cf923,'path':_0x1e0069}];}else{_0x1327eb[_0xba32('0x26')][_0xba32('0x27')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x24d8ff['sendIfEmpty']){_0xc99798=![];logger[_0xba32('0xb')](_0xba32('0x2a'));}}if(_0xc99798){return client[_0xba32('0x2b')]('SendMail',_0x1327eb)[_0xba32('0x2c')](function(_0x23080a){if(_0x23080a['error']){return logger['error']('error\x20mail',JSON[_0xba32('0x28')](_0x23080a));}return logger[_0xba32('0xb')](_0xba32('0x2d'));})['catch'](function(_0x129f22){return logger[_0xba32('0x2e')](_0xba32('0x2f'),JSON['stringify'](_0x129f22));});}};}function handleError(){return function(_0x48d5d7){return logger[_0xba32('0x2e')](JSON['stringify'](_0x48d5d7));};}function handleResult(_0x49101d){return function(_0x5bf1d0){logger[_0xba32('0xb')](_0xba32('0x30'),JSON[_0xba32('0x28')](_0x5bf1d0));if(_0x49101d['MailAccount']&&_0x49101d[_0xba32('0xe')]['Smtp']&&!_[_0xba32('0x31')](_0x49101d[_0xba32('0xd')])){setTimeout(handleSendEmail(_0x49101d,_0x5bf1d0),0x3c*0x3e8);}};}function handleJob(_0x7df9e2){return function(){try{if(_[_0xba32('0x31')](_0x7df9e2['subtractNumber'])){return logger[_0xba32('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xba32('0x31')](_0x7df9e2[_0xba32('0x1d')])){return logger[_0xba32('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x3b8c86={'startDate':moment()['subtract'](_0x7df9e2['subtractNumber'],_0x7df9e2[_0xba32('0x1d')])[_0xba32('0x18')](_0xba32('0x32')),'endDate':moment()[_0xba32('0x18')](_0xba32('0x32')),'type':'scheduled','output':_0x7df9e2[_0xba32('0x33')],'name':_0x7df9e2[_0xba32('0x1a')]};if(!_[_0xba32('0x31')](_0x7df9e2[_0xba32('0x34')])){logger['info'](_0xba32('0x35'),_0x7df9e2['DefaultReportId']);return analyticDefaultReportController[_0xba32('0x36')]({'id':_0x7df9e2[_0xba32('0x34')]},_0x3b8c86)[_0xba32('0x2c')](handleResult(_0x7df9e2))[_0xba32('0x37')](handleError());}if(!_['isNil'](_0x7df9e2[_0xba32('0x38')])){logger[_0xba32('0xb')](_0xba32('0x39'),_0x7df9e2['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x7df9e2[_0xba32('0x38')]},_0x3b8c86)['then'](handleResult(_0x7df9e2))['catch'](handleError());}}catch(_0x5cd0fb){logger['error'](JSON[_0xba32('0x28')](_0x5cd0fb));}return logger[_0xba32('0xb')](_0xba32('0x3a'));};}function getJobs(_0x13b0fb){var _0xce3e34={};if(_0x13b0fb){_0xce3e34['id']=_0x13b0fb;}return db[_0xba32('0x3b')][_0xba32('0x3c')]({'where':_0xce3e34,'include':[{'model':db[_0xba32('0xe')],'attributes':['id',_0xba32('0x1a'),_0xba32('0xd')],'include':[{'model':db['MailServerOut'],'as':_0xba32('0xf')}]}]})['then'](function(_0x324d0a){var _0x1caace=_[_0xba32('0x3d')](manager[_0xba32('0x3e')]);var _0x34dd7e=_[_0xba32('0x3f')](_0x324d0a,function(_0x4a8949){return _0x4a8949['id']['toString']();});var _0x32d31c=_[_0xba32('0x40')](_0x324d0a,function(_0xe4f83a){return _0xe4f83a['id'][_0xba32('0x41')]();});var _0x3373dd=_0x13b0fb?_0x34dd7e:_['difference'](_0x34dd7e,_0x1caace);var _0x2d160a=_[_0xba32('0x42')](_0x34dd7e,_0x1caace);var _0x1b0193=_[_0xba32('0x43')](_0x1caace,_0x34dd7e);var _0x256fbb;var _0xb2400;for(_0x256fbb=0x0;_0x256fbb<_0x1b0193[_0xba32('0x44')]&&!_0x13b0fb;_0x256fbb+=0x1){_0xb2400=_0x1b0193[_0x256fbb][_0xba32('0x41')]();if(manager['exists'](_0xb2400)){manager[_0xba32('0x45')](_0xb2400);manager[_0xba32('0x46')](_0xb2400);logger[_0xba32('0xb')](_0xba32('0x47'),_0xb2400);}}logger[_0xba32('0xb')](_0xba32('0x48'),JSON['stringify'](_0x3373dd));for(_0x256fbb=0x0;_0x256fbb<_0x3373dd[_0xba32('0x44')];_0x256fbb+=0x1){_0xb2400=_0x3373dd[_0x256fbb][_0xba32('0x41')]();logger[_0xba32('0xb')](_0xba32('0x49'),_0xb2400);if(_0x13b0fb){logger[_0xba32('0xb')](_0xba32('0x4a'),_0x13b0fb);logger[_0xba32('0xb')](JSON[_0xba32('0x28')](_0x32d31c[_0xb2400]));BPromise[_0xba32('0x4b')]()[_0xba32('0x2c')](handleJob(_0x32d31c[_0xb2400]));logger['info'](_0xba32('0x4c'),_0x32d31c[_0xb2400][_0xba32('0x1a')],_0x32d31c[_0xb2400][_0xba32('0x4d')]);}else if(_0x32d31c[_0xb2400][_0xba32('0x4d')]&&_0x32d31c[_0xb2400][_0xba32('0x4e')]&&moment()[_0xba32('0x4f')](_0x32d31c[_0xb2400][_0xba32('0x50')],_0x32d31c[_0xb2400][_0xba32('0x51')])){manager[_0xba32('0x52')](_0xb2400,_0x32d31c[_0xb2400][_0xba32('0x4d')],handleJob(_0x32d31c[_0xb2400]));manager['start'](_0xb2400);logger[_0xba32('0xb')]('add\x20cron',_0x32d31c[_0xb2400]['name'],_0x32d31c[_0xb2400][_0xba32('0x4d')]);}else if(manager[_0xba32('0x53')](_0xb2400)){manager['stop'](_0xb2400);manager['deleteJob'](_0xb2400);logger[_0xba32('0xb')](_0xba32('0x54'),_0x32d31c[_0xb2400][_0xba32('0x1a')],_0x32d31c[_0xb2400]['cron']);}}for(_0x256fbb=0x0,_0xb2400;_0x256fbb<_0x2d160a[_0xba32('0x44')]&&!_0x13b0fb;_0x256fbb+=0x1){_0xb2400=_0x2d160a[_0x256fbb]['toString']();if(manager[_0xba32('0x53')](_0xb2400)){if(_0x32d31c[_0xb2400][_0xba32('0x4d')]&&_0x32d31c[_0xb2400][_0xba32('0x4e')]&&moment()['isBetween'](_0x32d31c[_0xb2400][_0xba32('0x50')],_0x32d31c[_0xb2400][_0xba32('0x51')])){manager['update'](_0xb2400,_0x32d31c[_0xb2400][_0xba32('0x4d')],handleJob(_0x32d31c[_0xb2400]));logger['info']('update\x20cron',_0x32d31c[_0xb2400][_0xba32('0x1a')],_0x32d31c[_0xb2400]['cron']);}else{manager[_0xba32('0x45')](_0xb2400);manager[_0xba32('0x46')](_0xb2400);logger[_0xba32('0xb')](_0xba32('0x54'),_0x32d31c[_0xb2400]['name'],_0x32d31c[_0xb2400]['cron']);}}}})[_0xba32('0x37')](function(_0x55ff80){logger['error'](JSON[_0xba32('0x28')](_0x55ff80));});}exports[_0xba32('0x55')]=function(_0x5b7ace){return getJobs(_0x5b7ace);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x52be=['add','start','add\x20cron','deleteJob','stop\x20cron','isBetween','update','update\x20cron','path','lodash','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','port','secure','authentication','user','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','savename','format','%s.%s','basename','zip','join','existsSync','status','Sent','message','attachments','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','map','toString','keyBy','intersection','difference','length','exists','stop','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','startAt'];(function(_0x2bf3cd,_0x4dd81b){var _0x337f79=function(_0x2f8046){while(--_0x2f8046){_0x2bf3cd['push'](_0x2bf3cd['shift']());}};_0x337f79(++_0x4dd81b);}(_0x52be,0x1a2));var _0xe52b=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x52be[_0x595604];return _0x1466f3;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xe52b('0x0'));var _=require(_0xe52b('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0xe52b('0x2'));var BPromise=require(_0xe52b('0x3'));var logger=require(_0xe52b('0x4'))(_0xe52b('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xe52b('0x6'));var client=jayson['client'][_0xe52b('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x28ce7e,_0x4395ad){return function(){logger[_0xe52b('0x8')](_0xe52b('0x9'),_0x28ce7e['email']);var _0x5d9289=!![];var _0x36ca90={'tls':{'rejectUnauthorized':![]}};if(_0x28ce7e[_0xe52b('0xa')][_0xe52b('0xb')][_0xe52b('0xc')]){_0x36ca90[_0xe52b('0xc')]=_0x28ce7e[_0xe52b('0xa')][_0xe52b('0xb')][_0xe52b('0xc')];}else{_0x36ca90['host']=_0x28ce7e[_0xe52b('0xa')][_0xe52b('0xb')]['host'];_0x36ca90[_0xe52b('0xd')]=_0x28ce7e[_0xe52b('0xa')][_0xe52b('0xb')][_0xe52b('0xd')];_0x36ca90[_0xe52b('0xe')]=_0x28ce7e[_0xe52b('0xa')]['Smtp']['secure'];}if(_0x28ce7e[_0xe52b('0xa')]['Smtp'][_0xe52b('0xf')]){_0x36ca90['auth']={'user':_0x28ce7e['MailAccount'][_0xe52b('0xb')][_0xe52b('0x10')],'pass':_0x28ce7e['MailAccount'][_0xe52b('0xb')]['pass']};}var _0x2575b6={'account':_0x36ca90,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x28ce7e[_0xe52b('0xa')][_0xe52b('0x11')],_0x28ce7e[_0xe52b('0xa')][_0xe52b('0x12')]||_0x28ce7e[_0xe52b('0xa')][_0xe52b('0xb')]['user']),'to':_0x28ce7e[_0xe52b('0x12')],'cc':_0x28ce7e['cc'],'bcc':_0x28ce7e[_0xe52b('0x13')],'subject':util['format'](_0xe52b('0x14'),_0x4395ad[_0xe52b('0x11')],_0x28ce7e[_0xe52b('0x15')],_0x28ce7e['subtractUnit'])}};var _0x1dbb21=path['join'](__dirname,'../../files/reports');var _0x56e581=_0x4395ad[_0xe52b('0x16')];var _0x276596=util[_0xe52b('0x17')](_0xe52b('0x18'),path[_0xe52b('0x19')](_0x4395ad[_0xe52b('0x16')],path['extname'](_0x4395ad[_0xe52b('0x16')])),_0xe52b('0x1a'));var _0x4e431b=path[_0xe52b('0x1b')](_0x1dbb21,_0x56e581);var _0x423279=path['join'](_0x1dbb21,_0x276596);if(fs[_0xe52b('0x1c')](_0x4e431b)){_0x4395ad[_0xe52b('0x1d')]=_0xe52b('0x1e');_0x2575b6[_0xe52b('0x1f')][_0xe52b('0x20')]=[{'filename':_0x56e581,'path':_0x4e431b}];_0x2575b6[_0xe52b('0x1f')]['text']=util[_0xe52b('0x17')](_0xe52b('0x21'),JSON[_0xe52b('0x22')](_0x4395ad,null,0x2));}else if(fs[_0xe52b('0x1c')](_0x423279)){_0x4395ad[_0xe52b('0x1d')]=_0xe52b('0x1e');_0x2575b6[_0xe52b('0x1f')][_0xe52b('0x20')]=[{'filename':_0x276596,'path':_0x423279}];}else{_0x2575b6[_0xe52b('0x1f')]['text']=_0xe52b('0x23');if(!_0x28ce7e['sendIfEmpty']){_0x5d9289=![];logger[_0xe52b('0x8')](_0xe52b('0x24'));}}if(_0x5d9289){return client[_0xe52b('0x25')](_0xe52b('0x26'),_0x2575b6)[_0xe52b('0x27')](function(_0x58eaaf){if(_0x58eaaf['error']){return logger[_0xe52b('0x28')](_0xe52b('0x29'),JSON[_0xe52b('0x22')](_0x58eaaf));}return logger[_0xe52b('0x8')](_0xe52b('0x2a'));})[_0xe52b('0x2b')](function(_0x27a968){return logger['error'](_0xe52b('0x29'),JSON[_0xe52b('0x22')](_0x27a968));});}};}function handleError(){return function(_0x3344ca){return logger[_0xe52b('0x28')](JSON[_0xe52b('0x22')](_0x3344ca));};}function handleResult(_0xfa447c){return function(_0xf0dcb6){logger[_0xe52b('0x8')](_0xe52b('0x2c'),JSON['stringify'](_0xf0dcb6));if(_0xfa447c[_0xe52b('0xa')]&&_0xfa447c[_0xe52b('0xa')]['Smtp']&&!_[_0xe52b('0x2d')](_0xfa447c[_0xe52b('0x12')])){setTimeout(handleSendEmail(_0xfa447c,_0xf0dcb6),0x3c*0x3e8);}};}function handleJob(_0x225609){return function(){try{if(_[_0xe52b('0x2d')](_0x225609[_0xe52b('0x15')])){return logger[_0xe52b('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe52b('0x2d')](_0x225609[_0xe52b('0x2e')])){return logger[_0xe52b('0x8')]('subtractUnit\x20null\x20or\x20undefined');}var _0x49e48d={'startDate':moment()[_0xe52b('0x2f')](_0x225609[_0xe52b('0x15')],_0x225609[_0xe52b('0x2e')])[_0xe52b('0x17')](_0xe52b('0x30')),'endDate':moment()[_0xe52b('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xe52b('0x31'),'output':_0x225609[_0xe52b('0x32')],'name':_0x225609[_0xe52b('0x11')]};if(!_[_0xe52b('0x2d')](_0x225609[_0xe52b('0x33')])){logger[_0xe52b('0x8')]('exec\x20defaul\x20report\x20id:%s',_0x225609[_0xe52b('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x225609[_0xe52b('0x33')]},_0x49e48d)[_0xe52b('0x27')](handleResult(_0x225609))[_0xe52b('0x2b')](handleError());}if(!_[_0xe52b('0x2d')](_0x225609['CustomReportId'])){logger[_0xe52b('0x8')](_0xe52b('0x34'),_0x225609[_0xe52b('0x35')]);return analyticCustomReportController[_0xe52b('0x36')]({'id':_0x225609[_0xe52b('0x35')]},_0x49e48d)[_0xe52b('0x27')](handleResult(_0x225609))[_0xe52b('0x2b')](handleError());}}catch(_0x192689){logger['error'](JSON[_0xe52b('0x22')](_0x192689));}return logger[_0xe52b('0x8')](_0xe52b('0x37'));};}function getJobs(_0x322839){var _0xca9267={};if(_0x322839){_0xca9267['id']=_0x322839;}return db[_0xe52b('0x38')]['findAll']({'where':_0xca9267,'include':[{'model':db[_0xe52b('0xa')],'attributes':['id',_0xe52b('0x11'),_0xe52b('0x12')],'include':[{'model':db[_0xe52b('0x39')],'as':_0xe52b('0xb')}]}]})[_0xe52b('0x27')](function(_0x36a0fd){var _0x5d00f6=_['keys'](manager['jobs']);var _0xdc3ea4=_[_0xe52b('0x3a')](_0x36a0fd,function(_0x33126b){return _0x33126b['id'][_0xe52b('0x3b')]();});var _0x252f09=_[_0xe52b('0x3c')](_0x36a0fd,function(_0x4a01d3){return _0x4a01d3['id']['toString']();});var _0x4739ab=_0x322839?_0xdc3ea4:_['difference'](_0xdc3ea4,_0x5d00f6);var _0x41a1fa=_[_0xe52b('0x3d')](_0xdc3ea4,_0x5d00f6);var _0x1011ca=_[_0xe52b('0x3e')](_0x5d00f6,_0xdc3ea4);var _0x2bad08;var _0x2254cc;for(_0x2bad08=0x0;_0x2bad08<_0x1011ca[_0xe52b('0x3f')]&&!_0x322839;_0x2bad08+=0x1){_0x2254cc=_0x1011ca[_0x2bad08][_0xe52b('0x3b')]();if(manager[_0xe52b('0x40')](_0x2254cc)){manager[_0xe52b('0x41')](_0x2254cc);manager['deleteJob'](_0x2254cc);logger[_0xe52b('0x8')](_0xe52b('0x42'),_0x2254cc);}}logger['info'](_0xe52b('0x43'),JSON['stringify'](_0x4739ab));for(_0x2bad08=0x0;_0x2bad08<_0x4739ab[_0xe52b('0x3f')];_0x2bad08+=0x1){_0x2254cc=_0x4739ab[_0x2bad08][_0xe52b('0x3b')]();logger[_0xe52b('0x8')](_0xe52b('0x44'),_0x2254cc);if(_0x322839){logger[_0xe52b('0x8')]('my\x20id',_0x322839);logger[_0xe52b('0x8')](JSON['stringify'](_0x252f09[_0x2254cc]));BPromise[_0xe52b('0x45')]()['then'](handleJob(_0x252f09[_0x2254cc]));logger[_0xe52b('0x8')](_0xe52b('0x46'),_0x252f09[_0x2254cc]['name'],_0x252f09[_0x2254cc][_0xe52b('0x47')]);}else if(_0x252f09[_0x2254cc][_0xe52b('0x47')]&&_0x252f09[_0x2254cc][_0xe52b('0x48')]&&moment()['isBetween'](_0x252f09[_0x2254cc][_0xe52b('0x49')],_0x252f09[_0x2254cc]['endAt'])){manager[_0xe52b('0x4a')](_0x2254cc,_0x252f09[_0x2254cc][_0xe52b('0x47')],handleJob(_0x252f09[_0x2254cc]));manager[_0xe52b('0x4b')](_0x2254cc);logger[_0xe52b('0x8')](_0xe52b('0x4c'),_0x252f09[_0x2254cc]['name'],_0x252f09[_0x2254cc][_0xe52b('0x47')]);}else if(manager['exists'](_0x2254cc)){manager[_0xe52b('0x41')](_0x2254cc);manager[_0xe52b('0x4d')](_0x2254cc);logger[_0xe52b('0x8')](_0xe52b('0x4e'),_0x252f09[_0x2254cc][_0xe52b('0x11')],_0x252f09[_0x2254cc][_0xe52b('0x47')]);}}for(_0x2bad08=0x0,_0x2254cc;_0x2bad08<_0x41a1fa[_0xe52b('0x3f')]&&!_0x322839;_0x2bad08+=0x1){_0x2254cc=_0x41a1fa[_0x2bad08][_0xe52b('0x3b')]();if(manager[_0xe52b('0x40')](_0x2254cc)){if(_0x252f09[_0x2254cc]['cron']&&_0x252f09[_0x2254cc][_0xe52b('0x48')]&&moment()[_0xe52b('0x4f')](_0x252f09[_0x2254cc][_0xe52b('0x49')],_0x252f09[_0x2254cc]['endAt'])){manager[_0xe52b('0x50')](_0x2254cc,_0x252f09[_0x2254cc][_0xe52b('0x47')],handleJob(_0x252f09[_0x2254cc]));logger[_0xe52b('0x8')](_0xe52b('0x51'),_0x252f09[_0x2254cc][_0xe52b('0x11')],_0x252f09[_0x2254cc][_0xe52b('0x47')]);}else{manager[_0xe52b('0x41')](_0x2254cc);manager['deleteJob'](_0x2254cc);logger['info']('stop\x20cron',_0x252f09[_0x2254cc][_0xe52b('0x11')],_0x252f09[_0x2254cc][_0xe52b('0x47')]);}}}})[_0xe52b('0x2b')](function(_0x416fd1){logger[_0xe52b('0x28')](JSON[_0xe52b('0x22')](_0x416fd1));});}exports['run']=function(_0x45845a){return getJobs(_0x45845a);};exports[_0xe52b('0x4b')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 97ecda8..5bd87c6 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x512c=['bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','data2','Positive','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','error','lodash','request-promise','util'];(function(_0x47c430,_0x3865e2){var _0x1258ab=function(_0x4d6744){while(--_0x4d6744){_0x47c430['push'](_0x47c430['shift']());}};_0x1258ab(++_0x3865e2);}(_0x512c,0xd8));var _0xc512=function(_0x2e9a63,_0x35f934){_0x2e9a63=_0x2e9a63-0x0;var _0x45764e=_0x512c[_0x2e9a63];return _0x45764e;};var _=require(_0xc512('0x0'));var AWS=require('aws-sdk');var rp=require(_0xc512('0x1'));var util=require(_0xc512('0x2'));var BPromise=require(_0xc512('0x3'));var db=require(_0xc512('0x4'))['db'];var logger=require(_0xc512('0x5'))(_0xc512('0x6'));function getTranscriptionJob(_0x4ff825,_0x489ee9,_0x2d9b15,_0x3ae325){return new Promise(function(_0x6381f7,_0x33aead){var _0x108195=new AWS[(_0xc512('0x7'))]({'accessKeyId':_0x489ee9,'secretAccessKey':_0x4ff825,'region':_0x2d9b15});_0x108195['getTranscriptionJob']({'TranscriptionJobName':_0x3ae325},function(_0x12506c,_0x54a93b){if(_0x12506c){return _0x33aead(_0x12506c);}else{return _0x6381f7(_0x54a93b);}});});}function sentiment(_0x2ae2ca,_0x5bf1b3,_0x2835f0,_0x4bb403,_0x3b8cd0){return new Promise(function(_0x11f501,_0x5eea1b){var _0x4bcb5f=new AWS[(_0xc512('0x8'))]({'accessKeyId':_0x5bf1b3,'secretAccessKey':_0x2ae2ca,'region':_0x2835f0});_0x4bcb5f[_0xc512('0x9')]({'Text':_0x4bb403,'LanguageCode':_0x3b8cd0[_0xc512('0xa')](0x0,0x2)},function(_0x4cd680,_0x2af908){if(_0x4cd680){return _0x5eea1b(_0x4cd680);}else{return _0x11f501(_0x2af908);}});});}function checkTranscribeJob(_0x4d77b6,_0x10ffe7,_0x26c5f4){var _0x1154e9;return new BPromise(function(_0x1ae961,_0x4f8cc9){logger[_0xc512('0xb')](util[_0xc512('0xc')](_0xc512('0xd'),_0x4d77b6['id'],_0x4d77b6[_0xc512('0xe')]));return getTranscriptionJob(_0x26c5f4[_0xc512('0xf')],_0x26c5f4['data2'],_0x10ffe7[_0xc512('0x10')],_0x4d77b6['transcribeName'])['then'](function(_0x28e8de){logger[_0xc512('0xb')](util[_0xc512('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4d77b6['id'],_0x4d77b6['transcribeName'],_0x28e8de[_0xc512('0x11')][_0xc512('0x12')]));if(!_0x4d77b6[_0xc512('0x13')]){switch(_0x28e8de[_0xc512('0x11')][_0xc512('0x12')]){case _0xc512('0x14'):var _0x217884={'transcribeStatus':_0x28e8de['TranscriptionJob'][_0xc512('0x12')],'fileUri':_0x28e8de[_0xc512('0x11')]['Transcript']['TranscriptFileUri']};logger['info'](util[_0xc512('0xc')](_0xc512('0x15'),_0x4d77b6['id']));return rp({'uri':_0x28e8de[_0xc512('0x11')][_0xc512('0x16')][_0xc512('0x17')],'json':!![]})[_0xc512('0x18')](function(_0x3382fe){logger['info'](util[_0xc512('0xc')](_0xc512('0x19'),_0x4d77b6['id']));if(_0x3382fe&&_0x3382fe['results']&&_0x3382fe[_0xc512('0x1a')][_0xc512('0x1b')]&&_0x3382fe[_0xc512('0x1a')]['transcripts'][_0xc512('0x1c')]){_0x217884['fileText']='';for(var _0x4aee38=0x0;_0x4aee38<_0x3382fe['results'][_0xc512('0x1b')][_0xc512('0x1c')];_0x4aee38++){_0x217884[_0xc512('0x13')]+=_0x3382fe[_0xc512('0x1a')]['transcripts'][_0x4aee38]['transcript']+'';}}return _0x4d77b6[_0xc512('0x1d')](_0x217884);})[_0xc512('0x18')](function(){logger['info'](util[_0xc512('0xc')](_0xc512('0x1e'),_0x4d77b6['id']));if(!_0x4d77b6[_0xc512('0x1f')]){throw new db[(_0xc512('0x20'))]['ValidationError'](_0xc512('0x21'));}if(!_0x10ffe7['sentiment']||!_0x10ffe7['sentimentAccountId']||!_0x10ffe7[_0xc512('0x22')]||!_0x10ffe7[_0xc512('0x23')]||!_0x10ffe7[_0xc512('0x24')]){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x26'));}if(!_0x217884['fileText']){throw new Error(_0xc512('0x27'));}if(_0x10ffe7[_0xc512('0x28')]===_0x26c5f4['id']){return _0x26c5f4;}else{return db[_0xc512('0x29')][_0xc512('0x2a')]({'where':{'id':_settings[_0xc512('0x28')]}});}})['then'](function(_0x67c55e){if(!_0x67c55e){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x2b'));}if(!_0x67c55e[_0xc512('0xf')]||!_0x67c55e['data2']){throw new db[(_0xc512('0x20'))]['ValidationError'](_0xc512('0x2c'));}_0x1154e9=_0x67c55e;logger[_0xc512('0xb')](util[_0xc512('0xc')](_0xc512('0x2d'),_0x4d77b6['id']));return sentiment(_0x1154e9[_0xc512('0xf')],_0x1154e9['data2'],_0x10ffe7[_0xc512('0x22')],_0x217884[_0xc512('0x13')],_0x10ffe7[_0xc512('0x23')]);})[_0xc512('0x18')](function(_0x20f3c6){logger['info'](util[_0xc512('0xc')](_0xc512('0x2e'),_0x4d77b6['id']));return _0x4d77b6['update']({'sentiment':_0x20f3c6[_0xc512('0x2f')],'sPositive':_0x20f3c6[_0xc512('0x30')]['Positive'],'sNegative':_0x20f3c6[_0xc512('0x30')][_0xc512('0x31')],'sMixed':_0x20f3c6['SentimentScore'][_0xc512('0x32')],'sNeutral':_0x20f3c6[_0xc512('0x30')][_0xc512('0x33')]});})[_0xc512('0x18')](function(){logger['info'](util[_0xc512('0xc')](_0xc512('0x1e'),_0x4d77b6['id']));_0x1ae961();});case _0xc512('0x34'):return _0x4d77b6[_0xc512('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x28e8de[_0xc512('0x11')][_0xc512('0x35')]})[_0xc512('0x18')](function(){logger[_0xc512('0xb')](util['format'](_0xc512('0x1e'),_0x4d77b6['id']));_0x1ae961();});default:logger[_0xc512('0xb')](util[_0xc512('0xc')](_0xc512('0x36'),_0x4d77b6['id']));break;}}else{return BPromise[_0xc512('0x37')]()[_0xc512('0x18')](function(){if(!_0x4d77b6[_0xc512('0x1f')]){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x21'));}if(!_0x10ffe7[_0xc512('0x38')]||!_0x10ffe7[_0xc512('0x28')]||!_0x10ffe7['sentimentRegion']||!_0x10ffe7[_0xc512('0x23')]||!_0x10ffe7[_0xc512('0x24')]){throw new db[(_0xc512('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4d77b6[_0xc512('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x10ffe7[_0xc512('0x28')]===_0x26c5f4['id']){return _0x26c5f4;}else{return db[_0xc512('0x29')]['findOne']({'where':{'id':_settings[_0xc512('0x28')]}});}})[_0xc512('0x18')](function(_0x598cf9){if(!_0x598cf9){throw new db['Sequelize'][(_0xc512('0x25'))](_0xc512('0x2b'));}if(!_0x598cf9[_0xc512('0xf')]||!_0x598cf9[_0xc512('0x39')]){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x2c'));}_0x1154e9=_0x598cf9;logger[_0xc512('0xb')](util[_0xc512('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4d77b6['id']));return sentiment(_0x1154e9[_0xc512('0xf')],_0x1154e9[_0xc512('0x39')],_0x10ffe7['sentimentRegion'],_0x4d77b6[_0xc512('0x13')],_0x10ffe7[_0xc512('0x23')]);})[_0xc512('0x18')](function(_0x49038a){logger['info'](util[_0xc512('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4d77b6['id']));return _0x4d77b6[_0xc512('0x1d')]({'sentiment':_0x49038a[_0xc512('0x2f')],'sPositive':_0x49038a[_0xc512('0x30')][_0xc512('0x3a')],'sNegative':_0x49038a[_0xc512('0x30')][_0xc512('0x31')],'sMixed':_0x49038a[_0xc512('0x30')]['Mixed'],'sNeutral':_0x49038a[_0xc512('0x30')][_0xc512('0x33')],'transcribeStatus':_0xc512('0x14')});})[_0xc512('0x18')](function(){logger[_0xc512('0xb')](util[_0xc512('0xc')](_0xc512('0x1e'),_0x4d77b6['id']));_0x1ae961();});}})['catch'](function(_0x25028d){if(_0x25028d){if(!_0x25028d[_0xc512('0x3b')]||_0x25028d[_0xc512('0x3b')]!==_0xc512('0x3c')){logger['error'](util[_0xc512('0xc')](_0xc512('0x3d'),_0x4d77b6['id']),util[_0xc512('0x3e')](_0x25028d,{'showHidden':![],'depth':null}));}}_0x1ae961();});});}function checkTranscribe(){var _0x55f993;var _0x557cb6;var _0x3eee7c;return db[_0xc512('0x3f')][_0xc512('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xc512('0x18')](function(_0x120967){if(!_0x120967||!_0x120967[_0xc512('0x1c')]){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x41'));}_0x55f993=_0x120967;return db['Setting'][_0xc512('0x2a')]({'where':{'id':0x1}});})[_0xc512('0x18')](function(_0x2804a9){if(!_0x2804a9){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x42'));}_0x557cb6=_0x2804a9;if(!_0x557cb6[_0xc512('0x6')]||!_0x557cb6[_0xc512('0x43')]||!_0x557cb6[_0xc512('0x10')]||!_0x557cb6[_0xc512('0x23')]||!_0x557cb6[_0xc512('0x24')]){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x44'));}return db[_0xc512('0x29')]['findOne']({'where':{'id':_0x557cb6[_0xc512('0x43')]}});})[_0xc512('0x18')](function(_0x2c1026){if(!_0x2c1026){throw new db[(_0xc512('0x20'))][(_0xc512('0x25'))](_0xc512('0x2b'));}if(!_0x2c1026['data1']||!_0x2c1026['data2']){throw new db['Sequelize'][(_0xc512('0x25'))](_0xc512('0x2c'));}_0x3eee7c=_0x2c1026;var _0x2192d1=[];_0x55f993[_0xc512('0x45')](function(_0x1576b3){_0x2192d1[_0xc512('0x46')](checkTranscribeJob(_0x1576b3,_0x557cb6,_0x3eee7c));});return BPromise[_0xc512('0x47')](_0x2192d1);})['catch'](function(_0x2e7f43){if(_0x2e7f43){if(!_0x2e7f43[_0xc512('0x3b')]||_0x2e7f43['name']!==_0xc512('0x3c')){logger[_0xc512('0x48')](util[_0xc512('0x3e')](_0x2e7f43,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4147=['results','transcripts','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','FailureReason','Mixed','Neutral','catch','name','SequelizeValidationError','error','inspect','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded'];(function(_0x46376b,_0x2a51cb){var _0x22e8d3=function(_0x26afbf){while(--_0x26afbf){_0x46376b['push'](_0x46376b['shift']());}};_0x22e8d3(++_0x2a51cb);}(_0x4147,0x131));var _0x7414=function(_0x2a9e93,_0x5c3054){_0x2a9e93=_0x2a9e93-0x0;var _0x1a77bc=_0x4147[_0x2a9e93];return _0x1a77bc;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x7414('0x0'));var util=require(_0x7414('0x1'));var BPromise=require(_0x7414('0x2'));var db=require(_0x7414('0x3'))['db'];var logger=require(_0x7414('0x4'))(_0x7414('0x5'));function getTranscriptionJob(_0x328779,_0x10589c,_0x1f0e0a,_0x397cda){return new Promise(function(_0x3fe03b,_0x207bf4){var _0x13054b=new AWS[(_0x7414('0x6'))]({'accessKeyId':_0x10589c,'secretAccessKey':_0x328779,'region':_0x1f0e0a});_0x13054b[_0x7414('0x7')]({'TranscriptionJobName':_0x397cda},function(_0x58b01e,_0x333f98){if(_0x58b01e){return _0x207bf4(_0x58b01e);}else{return _0x3fe03b(_0x333f98);}});});}function sentiment(_0x3626d6,_0xb23714,_0x28620b,_0x444311,_0x430618){return new Promise(function(_0x24fae0,_0x4079e9){var _0x17349d=new AWS[(_0x7414('0x8'))]({'accessKeyId':_0xb23714,'secretAccessKey':_0x3626d6,'region':_0x28620b});_0x17349d['detectSentiment']({'Text':_0x444311,'LanguageCode':_0x430618[_0x7414('0x9')](0x0,0x2)},function(_0xbbb02b,_0x4c36d7){if(_0xbbb02b){return _0x4079e9(_0xbbb02b);}else{return _0x24fae0(_0x4c36d7);}});});}function checkTranscribeJob(_0x413fee,_0x2f946f,_0xa3b33c){var _0x4e608b;return new BPromise(function(_0x193210,_0x260c3b){logger[_0x7414('0xa')](util['format'](_0x7414('0xb'),_0x413fee['id'],_0x413fee[_0x7414('0xc')]));return getTranscriptionJob(_0xa3b33c[_0x7414('0xd')],_0xa3b33c[_0x7414('0xe')],_0x2f946f[_0x7414('0xf')],_0x413fee[_0x7414('0xc')])['then'](function(_0x4697){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x11'),_0x413fee['id'],_0x413fee[_0x7414('0xc')],_0x4697[_0x7414('0x12')][_0x7414('0x13')]));if(!_0x413fee['fileText']){switch(_0x4697[_0x7414('0x12')][_0x7414('0x13')]){case _0x7414('0x14'):var _0x21f80d={'transcribeStatus':_0x4697[_0x7414('0x12')][_0x7414('0x13')],'fileUri':_0x4697[_0x7414('0x12')][_0x7414('0x15')][_0x7414('0x16')]};logger[_0x7414('0xa')](util[_0x7414('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0x413fee['id']));return rp({'uri':_0x4697[_0x7414('0x12')]['Transcript'][_0x7414('0x16')],'json':!![]})[_0x7414('0x17')](function(_0xff79a){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x18'),_0x413fee['id']));if(_0xff79a&&_0xff79a[_0x7414('0x19')]&&_0xff79a[_0x7414('0x19')][_0x7414('0x1a')]&&_0xff79a[_0x7414('0x19')]['transcripts']['length']){_0x21f80d[_0x7414('0x1b')]='';for(var _0x3ad316=0x0;_0x3ad316<_0xff79a[_0x7414('0x19')][_0x7414('0x1a')]['length'];_0x3ad316++){_0x21f80d['fileText']+=_0xff79a['results'][_0x7414('0x1a')][_0x3ad316][_0x7414('0x1c')]+'';}}return _0x413fee[_0x7414('0x1d')](_0x21f80d);})[_0x7414('0x17')](function(){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x1e'),_0x413fee['id']));if(!_0x413fee[_0x7414('0x1f')]){throw new db[(_0x7414('0x20'))]['ValidationError'](_0x7414('0x21'));}if(!_0x2f946f['sentiment']||!_0x2f946f[_0x7414('0x22')]||!_0x2f946f[_0x7414('0x23')]||!_0x2f946f[_0x7414('0x24')]||!_0x2f946f[_0x7414('0x25')]){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x27'));}if(!_0x21f80d[_0x7414('0x1b')]){throw new Error(_0x7414('0x28'));}if(_0x2f946f[_0x7414('0x22')]===_0xa3b33c['id']){return _0xa3b33c;}else{return db[_0x7414('0x29')][_0x7414('0x2a')]({'where':{'id':_settings[_0x7414('0x22')]}});}})[_0x7414('0x17')](function(_0x2a24f3){if(!_0x2a24f3){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x2b'));}if(!_0x2a24f3[_0x7414('0xd')]||!_0x2a24f3[_0x7414('0xe')]){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x2c'));}_0x4e608b=_0x2a24f3;logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x2d'),_0x413fee['id']));return sentiment(_0x4e608b['data1'],_0x4e608b['data2'],_0x2f946f[_0x7414('0x23')],_0x21f80d[_0x7414('0x1b')],_0x2f946f[_0x7414('0x24')]);})[_0x7414('0x17')](function(_0x250fc9){logger['info'](util[_0x7414('0x10')](_0x7414('0x2e'),_0x413fee['id']));return _0x413fee['update']({'sentiment':_0x250fc9[_0x7414('0x2f')],'sPositive':_0x250fc9['SentimentScore'][_0x7414('0x30')],'sNegative':_0x250fc9[_0x7414('0x31')][_0x7414('0x32')],'sMixed':_0x250fc9['SentimentScore']['Mixed'],'sNeutral':_0x250fc9['SentimentScore']['Neutral']});})['then'](function(){logger[_0x7414('0xa')](util[_0x7414('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x413fee['id']));_0x193210();});case'FAILED':return _0x413fee['update']({'transcribeStatus':'FAILED','failureReason':_0x4697[_0x7414('0x12')][_0x7414('0x33')]})['then'](function(){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x1e'),_0x413fee['id']));_0x193210();});default:logger[_0x7414('0xa')](util[_0x7414('0x10')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x413fee['id']));break;}}else{return BPromise['resolve']()[_0x7414('0x17')](function(){if(!_0x413fee[_0x7414('0x1f')]){throw new db['Sequelize'][(_0x7414('0x26'))](_0x7414('0x21'));}if(!_0x2f946f['sentiment']||!_0x2f946f[_0x7414('0x22')]||!_0x2f946f[_0x7414('0x23')]||!_0x2f946f[_0x7414('0x24')]||!_0x2f946f[_0x7414('0x25')]){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x27'));}if(!_0x413fee[_0x7414('0x1b')]){throw new Error(_0x7414('0x28'));}if(_0x2f946f['sentimentAccountId']===_0xa3b33c['id']){return _0xa3b33c;}else{return db[_0x7414('0x29')][_0x7414('0x2a')]({'where':{'id':_settings[_0x7414('0x22')]}});}})[_0x7414('0x17')](function(_0x5ee397){if(!_0x5ee397){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5ee397[_0x7414('0xd')]||!_0x5ee397[_0x7414('0xe')]){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x2c'));}_0x4e608b=_0x5ee397;logger['info'](util['format'](_0x7414('0x2d'),_0x413fee['id']));return sentiment(_0x4e608b[_0x7414('0xd')],_0x4e608b['data2'],_0x2f946f[_0x7414('0x23')],_0x413fee[_0x7414('0x1b')],_0x2f946f[_0x7414('0x24')]);})[_0x7414('0x17')](function(_0x3193e8){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x2e'),_0x413fee['id']));return _0x413fee[_0x7414('0x1d')]({'sentiment':_0x3193e8[_0x7414('0x2f')],'sPositive':_0x3193e8[_0x7414('0x31')][_0x7414('0x30')],'sNegative':_0x3193e8['SentimentScore'][_0x7414('0x32')],'sMixed':_0x3193e8[_0x7414('0x31')][_0x7414('0x34')],'sNeutral':_0x3193e8[_0x7414('0x31')][_0x7414('0x35')],'transcribeStatus':_0x7414('0x14')});})['then'](function(){logger[_0x7414('0xa')](util[_0x7414('0x10')](_0x7414('0x1e'),_0x413fee['id']));_0x193210();});}})[_0x7414('0x36')](function(_0x5d5c0c){if(_0x5d5c0c){if(!_0x5d5c0c[_0x7414('0x37')]||_0x5d5c0c[_0x7414('0x37')]!==_0x7414('0x38')){logger[_0x7414('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x413fee['id']),util[_0x7414('0x3a')](_0x5d5c0c,{'showHidden':![],'depth':null}));}}_0x193210();});});}function checkTranscribe(){var _0x21c96b;var _0xc0aceb;var _0x1cdbba;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x7414('0x17')](function(_0x1fc015){if(!_0x1fc015||!_0x1fc015['length']){throw new db['Sequelize'][(_0x7414('0x26'))]('No\x20transcribe\x20job\x20to\x20check');}_0x21c96b=_0x1fc015;return db[_0x7414('0x3b')][_0x7414('0x2a')]({'where':{'id':0x1}});})[_0x7414('0x17')](function(_0x50de5e){if(!_0x50de5e){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x3c'));}_0xc0aceb=_0x50de5e;if(!_0xc0aceb[_0x7414('0x5')]||!_0xc0aceb['transcribeAccountId']||!_0xc0aceb['transcribeRegion']||!_0xc0aceb[_0x7414('0x24')]||!_0xc0aceb[_0x7414('0x25')]){throw new db['Sequelize']['ValidationError'](_0x7414('0x3d'));}return db['CloudProvider']['findOne']({'where':{'id':_0xc0aceb[_0x7414('0x3e')]}});})[_0x7414('0x17')](function(_0x1046d8){if(!_0x1046d8){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x2b'));}if(!_0x1046d8[_0x7414('0xd')]||!_0x1046d8['data2']){throw new db[(_0x7414('0x20'))][(_0x7414('0x26'))](_0x7414('0x2c'));}_0x1cdbba=_0x1046d8;var _0x55c644=[];_0x21c96b[_0x7414('0x3f')](function(_0x25830c){_0x55c644[_0x7414('0x40')](checkTranscribeJob(_0x25830c,_0xc0aceb,_0x1cdbba));});return BPromise[_0x7414('0x41')](_0x55c644);})[_0x7414('0x36')](function(_0x26417e){if(_0x26417e){if(!_0x26417e['name']||_0x26417e[_0x7414('0x37')]!==_0x7414('0x38')){logger['error'](util[_0x7414('0x3a')](_0x26417e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 60ac214..5a7f6c6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x039b=['CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','hopper2','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','@xcally.com'];(function(_0x5f363e,_0x5c29e8){var _0x263a9f=function(_0x5eec9a){while(--_0x5eec9a){_0x5f363e['push'](_0x5f363e['shift']());}};_0x263a9f(++_0x5c29e8);}(_0x039b,0x1ba));var _0xb039=function(_0x21d685,_0x18a5e5){_0x21d685=_0x21d685-0x0;var _0x49f3c9=_0x039b[_0x21d685];return _0x49f3c9;};'use strict';var util=require(_0xb039('0x0'));var db=require(_0xb039('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xb039('0x2')+i,'lastName':_0xb039('0x3')+i,'phone':0xf879fb460+i,'email':_0xb039('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb039('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xb039('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb039('0x6')](),'updatedAt':Date[_0xb039('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb039('0x5')]({'id':i,'firstName':_0xb039('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xb039('0x4')+i+_0xb039('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb039('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xb039('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb039('0x6')](),'updatedAt':Date[_0xb039('0x6')]()});}db[_0xb039('0x8')][_0xb039('0x9')]({'where':{}})[_0xb039('0xa')](function(){return db[_0xb039('0x8')]['bulkCreate'](contacts);})[_0xb039('0xa')](function(){console[_0xb039('0xb')](_0xb039('0xc'),_0xb039('0xd'));return db[_0xb039('0xe')]['destroy']({'where':{}});})[_0xb039('0xa')](function(){return db['CmHopper'][_0xb039('0xf')](hopper);})[_0xb039('0xa')](function(){console['log'](_0xb039('0xc'),_0xb039('0x10'));return db[_0xb039('0x8')][_0xb039('0xf')](contacts2);})['then'](function(){console[_0xb039('0xb')](_0xb039('0xc'),'contacts2');return db[_0xb039('0xe')][_0xb039('0xf')](hopper2);})[_0xb039('0xa')](function(){console[_0xb039('0xb')]('finished\x20populating',_0xb039('0x11'));})['catch'](function(_0x1fc9a7){console[_0xb039('0xb')](_0x1fc9a7);}); \ No newline at end of file +var _0xd4fa=['util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','destroy','CmContact','bulkCreate','then','contacts1','CmHopper','log','finished\x20populating','contacts2','hopper2','catch'];(function(_0x2a0b89,_0x449209){var _0x101515=function(_0x2d796b){while(--_0x2d796b){_0x2a0b89['push'](_0x2a0b89['shift']());}};_0x101515(++_0x449209);}(_0xd4fa,0x130));var _0xad4f=function(_0x133937,_0x2ebfad){_0x133937=_0x133937-0x0;var _0x5e8947=_0xd4fa[_0x133937];return _0x5e8947;};'use strict';var util=require(_0xad4f('0x0'));var db=require(_0xad4f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xad4f('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xad4f('0x3')+i,'phone':0xf879fb460+i,'email':_0xad4f('0x4')+i+_0xad4f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad4f('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xad4f('0x7')+i,'lastName':_0xad4f('0x3')+i,'phone':0xf879fb460+i,'email':_0xad4f('0x4')+i+_0xad4f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xad4f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xad4f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad4f('0x6')](),'updatedAt':Date[_0xad4f('0x6')]()});}db['CmContact'][_0xad4f('0x8')]({'where':{}})['then'](function(){return db[_0xad4f('0x9')][_0xad4f('0xa')](contacts);})[_0xad4f('0xb')](function(){console['log']('finished\x20populating',_0xad4f('0xc'));return db[_0xad4f('0xd')][_0xad4f('0x8')]({'where':{}});})[_0xad4f('0xb')](function(){return db[_0xad4f('0xd')][_0xad4f('0xa')](hopper);})[_0xad4f('0xb')](function(){console[_0xad4f('0xe')]('finished\x20populating','hopper1');return db[_0xad4f('0x9')]['bulkCreate'](contacts2);})[_0xad4f('0xb')](function(){console[_0xad4f('0xe')](_0xad4f('0xf'),_0xad4f('0x10'));return db[_0xad4f('0xd')][_0xad4f('0xa')](hopper2);})[_0xad4f('0xb')](function(){console[_0xad4f('0xe')](_0xad4f('0xf'),_0xad4f('0x11'));})[_0xad4f('0x12')](function(_0x18382b){console[_0xad4f('0xe')](_0x18382b);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index d227f2b..cb230e7 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5463=['%s%s','agent','format','%s%s@xcally.com','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','catch','util','../mysqldb','push'];(function(_0x455a8b,_0x9c2d5e){var _0x5de887=function(_0x57d8e1){while(--_0x57d8e1){_0x455a8b['push'](_0x455a8b['shift']());}};_0x5de887(++_0x9c2d5e);}(_0x5463,0x18c));var _0x3546=function(_0x12bcd7,_0x10acb1){_0x12bcd7=_0x12bcd7-0x0;var _0x51b78d=_0x5463[_0x12bcd7];return _0x51b78d;};'use strict';var util=require(_0x3546('0x0'));var db=require(_0x3546('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3546('0x2')]({'name':util['format'](_0x3546('0x3'),'agent',i),'fullname':util['format']('%s%s',_0x3546('0x4'),i),'email':util[_0x3546('0x5')](_0x3546('0x6'),_0x3546('0x4'),i),'role':_0x3546('0x4'),'password':'password','internal':0xfa0+i,'type':_0x3546('0x7'),'transport':['udp','ws',_0x3546('0x8')],'disallow':[_0x3546('0x9')],'allow':[_0x3546('0xa')],'defaultuser':util[_0x3546('0x5')](_0x3546('0x3'),_0x3546('0x4'),i),'encryption':'yes','avpf':_0x3546('0xb'),'force_avp':_0x3546('0xb'),'icesupport':_0x3546('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x3546('0xc'),'dtlsprivatekey':_0x3546('0xd'),'dtlssetup':_0x3546('0xe'),'callerid':util[_0x3546('0x5')](_0x3546('0xf'),util[_0x3546('0x5')](_0x3546('0x3'),_0x3546('0x4'),i),0xfa0+i)});}db['User'][_0x3546('0x10')](users)[_0x3546('0x11')](function(){console['log']('add\x20user');})[_0x3546('0x12')](function(_0x107c4c){console['log'](_0x107c4c);}); \ No newline at end of file +var _0xf57c=['push','agent','%s%s','%s%s@xcally.com','password','friend','udp','ulaw','format','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util'];(function(_0x170038,_0x430bfc){var _0x117982=function(_0x5278a6){while(--_0x5278a6){_0x170038['push'](_0x170038['shift']());}};_0x117982(++_0x430bfc);}(_0xf57c,0x164));var _0xcf57=function(_0x494c7d,_0x47940b){_0x494c7d=_0x494c7d-0x0;var _0x2d0195=_0xf57c[_0x494c7d];return _0x2d0195;};'use strict';var util=require(_0xcf57('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcf57('0x1')]({'name':util['format']('%s%s',_0xcf57('0x2'),i),'fullname':util['format'](_0xcf57('0x3'),'agent',i),'email':util['format'](_0xcf57('0x4'),'agent',i),'role':'agent','password':_0xcf57('0x5'),'internal':0xfa0+i,'type':_0xcf57('0x6'),'transport':[_0xcf57('0x7'),'ws','wss'],'disallow':['all'],'allow':[_0xcf57('0x8')],'defaultuser':util[_0xcf57('0x9')](_0xcf57('0x3'),'agent',i),'encryption':_0xcf57('0xa'),'avpf':_0xcf57('0xa'),'force_avp':_0xcf57('0xa'),'icesupport':_0xcf57('0xa'),'dtlsenable':_0xcf57('0xa'),'dtlsverify':'no','dtlscertfile':_0xcf57('0xb'),'dtlsprivatekey':_0xcf57('0xc'),'dtlssetup':_0xcf57('0xd'),'callerid':util[_0xcf57('0x9')](_0xcf57('0xe'),util[_0xcf57('0x9')](_0xcf57('0x3'),'agent',i),0xfa0+i)});}db[_0xcf57('0xf')][_0xcf57('0x10')](users)[_0xcf57('0x11')](function(){console[_0xcf57('0x12')](_0xcf57('0x13'));})[_0xcf57('0x14')](function(_0x5fc784){console[_0xcf57('0x12')](_0x5fc784);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index fde5224..901aa90 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x534d=['user_has_fax_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','log','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','Campaign','%s:queue:%s','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','format','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','SmsQueue','MailQueue','OpenchannelQueue','Trunk','FaxQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','map','user_has_mail_interactions:remove','FaxInteractions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x534d,0x79));var _0xd534=function(_0x3f8feb,_0x159af2){_0x3f8feb=_0x3f8feb-0x0;var _0x577ff2=_0x534d[_0x3f8feb];return _0x577ff2;};'use strict';var _=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var BPromise=require(_0xd534('0x2'));var db=require(_0xd534('0x3'))['db'];var config=require(_0xd534('0x4'));var queryQueues={'attributes':['id',_0xd534('0x5')],'include':[{'as':_0xd534('0x6'),'model':db[_0xd534('0x7')],'attributes':['id',_0xd534('0x5'),_0xd534('0x8')],'raw':!![],'where':{'role':_0xd534('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd534('0x5')],'where':{'role':_0xd534('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd534('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xd534('0x5')],'where':{'role':_0xd534('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd534('0x5'),_0xd534('0xb')],'where':{'type':_0xd534('0xc')}};function getAssociatedResources(_0x49c1fb,_0x3da8e0,_0x37a2c8){return db[_0xd534('0xd')][_0xd534('0xe')]({'where':{'name':_0x49c1fb,'userProfileId':_0x3da8e0},'raw':!![]})[_0xd534('0xf')](function(_0x4a8c5a){if(_0x4a8c5a){if(_0x4a8c5a[_0xd534('0x10')]){switch(_0x49c1fb){case _0xd534('0x11'):case _0xd534('0x12'):case _0xd534('0x13'):case _0xd534('0x14'):case _0xd534('0x15'):case _0xd534('0x16'):case _0xd534('0x17'):return db[_0x37a2c8]['findAll'](queryQueues);case'Telephones':return db[_0x37a2c8][_0xd534('0x18')](queryTelephones);case _0xd534('0x19'):return db[_0x37a2c8][_0xd534('0x18')](queryTrunks);case _0xd534('0x1a'):return db[_0x37a2c8][_0xd534('0x18')](queryCampaigns);}}else{return db[_0xd534('0x1b')][_0xd534('0x18')]({'attributes':[_0xd534('0x1c')],'where':{'sectionId':_0x4a8c5a['id']},'raw':!![]})[_0xd534('0xf')](function(_0x1ec85f){if(_0x1ec85f){var _0x502c61={'where':{'id':_['map'](_0x1ec85f,_0xd534('0x1c'))},'raw':!![]};switch(_0x37a2c8){case _0xd534('0x7'):_0x502c61[_0xd534('0x1d')]['role']='telephone';break;case _0xd534('0x1e'):_0x502c61[_0xd534('0x1d')][_0xd534('0xb')]=_0xd534('0xc');break;}return db[_0x37a2c8]['findAll'](_0x502c61);}else{return[];}});}}else{return[];}})['then'](function(_0x354ea4){return _0x354ea4;});}function joinOrLeaveQueues(_0x65672f,_0x48d7b5,_0x5e4270,_0xde7071){_0x65672f[_0x48d7b5](util['format'](_0xd534('0x1f'),_0x5e4270,_0xde7071[_0xd534('0x5')]));if(_0xde7071[_0xd534('0x6')]){for(var _0x4464d3=0x0;_0x4464d3<_0xde7071[_0xd534('0x6')]['length'];_0x4464d3+=0x1){_0x65672f[_0x48d7b5](util['format'](_0xd534('0x20'),_0xde7071['Agents'][_0x4464d3][_0xd534('0x5')]));}}}function joinOrLeave(_0x123ec9,_0x4d139f,_0x3138f6){var _0x38681b;if(_0x123ec9[_0xd534('0x21')][_0xd534('0x22')]['id']){db['User']['find']({'attributes':['id',_0xd534('0x5'),_0xd534('0x8'),_0xd534('0x23')],'where':{'id':_0x123ec9['handshake'][_0xd534('0x22')]['id']},'include':[{'model':db[_0xd534('0x24')],'as':_0xd534('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xd534('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xd534('0x27')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd534('0x28')],'as':_0xd534('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xd534('0x2a')],'as':_0xd534('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xd534('0x2c')],'as':_0xd534('0x2d'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xf3da75){if(_0xf3da75){_0x38681b=_0xf3da75;_0x123ec9[_0x4d139f](util[_0xd534('0x2e')](_0xd534('0x20'),_0xf3da75[_0xd534('0x5')]));var _0x12692c=[];switch(_0xf3da75[_0xd534('0x8')]){case _0xd534('0x2f'):_0x123ec9[_0x4d139f](_0xd534('0x30'));_0x123ec9[_0x4d139f](_0xd534('0x31'));if(queryQueues[_0xd534('0x32')](_0xd534('0x33'))){delete queryQueues[_0xd534('0x33')];}_0x12692c['push'](db[_0xd534('0x34')][_0xd534('0x18')](queryQueues));_0x12692c['push'](db[_0xd534('0x35')][_0xd534('0x18')](queryQueues));_0x12692c['push'](db['FaxQueue']['findAll'](queryQueues));_0x12692c[_0xd534('0x36')](db[_0xd534('0x37')]['findAll'](queryQueues));_0x12692c[_0xd534('0x36')](db[_0xd534('0x38')][_0xd534('0x18')](queryQueues));_0x12692c['push'](db[_0xd534('0x39')][_0xd534('0x18')](queryQueues));_0x12692c[_0xd534('0x36')](db['WhatsappQueue'][_0xd534('0x18')](queryQueues));_0x12692c[_0xd534('0x36')](db[_0xd534('0x7')]['findAll'](queryTelephones));_0x12692c[_0xd534('0x36')](db[_0xd534('0x3a')]['findAll'](queryTrunks));_0x12692c[_0xd534('0x36')](db[_0xd534('0x1e')][_0xd534('0x18')](queryCampaigns));_0x12692c[_0xd534('0x36')](db['User'][_0xd534('0x18')](queryAgents));break;case'user':_0x123ec9[_0x4d139f]('voice:inbound');_0x123ec9[_0x4d139f]('voice:outbound');_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x11'),_0xf3da75[_0xd534('0x23')],_0xd534('0x34')));_0x12692c['push'](getAssociatedResources('ChatQueues',_0xf3da75[_0xd534('0x23')],_0xd534('0x35')));_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x13'),_0xf3da75[_0xd534('0x23')],_0xd534('0x3b')));_0x12692c['push'](getAssociatedResources(_0xd534('0x14'),_0xf3da75['userProfileId'],_0xd534('0x37')));_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x15'),_0xf3da75[_0xd534('0x23')],_0xd534('0x38')));_0x12692c['push'](getAssociatedResources(_0xd534('0x16'),_0xf3da75['userProfileId'],_0xd534('0x39')));_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x17'),_0xf3da75[_0xd534('0x23')],_0xd534('0x3c')));_0x12692c['push'](getAssociatedResources('Telephones',_0xf3da75[_0xd534('0x23')],_0xd534('0x7')));_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x19'),_0xf3da75[_0xd534('0x23')],_0xd534('0x3a')));_0x12692c[_0xd534('0x36')](getAssociatedResources(_0xd534('0x1a'),_0xf3da75['userProfileId'],_0xd534('0x1e')));_0x12692c[_0xd534('0x36')](db[_0xd534('0x7')]['findAll'](queryAgents));break;case'agent':_0x123ec9[_0x4d139f](_0xd534('0x30'));_0x123ec9[_0x4d139f](_0xd534('0x31'));_0x12692c['push'](_0xf3da75[_0xd534('0x3d')]({'attributes':['id','name']}));_0x12692c[_0xd534('0x36')](_0xf3da75[_0xd534('0x3e')]({'attributes':['id',_0xd534('0x5')]}));_0x12692c['push'](_0xf3da75[_0xd534('0x3f')]({'attributes':['id',_0xd534('0x5')]}));_0x12692c[_0xd534('0x36')](_0xf3da75[_0xd534('0x40')]({'attributes':['id',_0xd534('0x5')]}));_0x12692c[_0xd534('0x36')](_0xf3da75[_0xd534('0x41')]({'attributes':['id',_0xd534('0x5')]}));_0x12692c[_0xd534('0x36')](_0xf3da75[_0xd534('0x42')]({'attributes':['id','name']}));_0x12692c['push'](_0xf3da75['getWhatsappQueues']({'attributes':['id',_0xd534('0x5')]}));break;}return BPromise[_0xd534('0x43')](_0x12692c);}})[_0xd534('0xf')](function(_0x35063e){if(_0x35063e&&_0x35063e[_0xd534('0x44')]){for(var _0x9dbaec=0x0;_0x9dbaec<_0x35063e['length'];_0x9dbaec+=0x1){for(var _0x3ee60a=0x0;_0x3ee60a<_0x35063e[_0x9dbaec]['length'];_0x3ee60a+=0x1){switch(_0x9dbaec){case 0x0:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x45'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x1:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x46'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x2:joinOrLeaveQueues(_0x123ec9,_0x4d139f,'fax',_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x3:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x47'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x4:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x48'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x5:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x49'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x6:joinOrLeaveQueues(_0x123ec9,_0x4d139f,_0xd534('0x4a'),_0x35063e[_0x9dbaec][_0x3ee60a]);break;case 0x7:_0x123ec9[_0x4d139f](util['format'](_0xd534('0x4b'),_0x35063e[_0x9dbaec][_0x3ee60a][_0xd534('0x5')]));break;case 0x8:_0x123ec9[_0x4d139f](util[_0xd534('0x2e')](_0xd534('0x4c'),_0x35063e[_0x9dbaec][_0x3ee60a][_0xd534('0x5')]));break;case 0x9:_0x123ec9[_0x4d139f](util[_0xd534('0x2e')](_0xd534('0x4d'),_0x35063e[_0x9dbaec][_0x3ee60a]['type'],_0x35063e[_0x9dbaec][_0x3ee60a]['name']));break;case 0xa:_0x123ec9[_0x4d139f](util[_0xd534('0x2e')](_0xd534('0x20'),_0x35063e[_0x9dbaec][_0x3ee60a]['name']));break;}}}}})['then'](function(){if(_0x4d139f==='leave'){var _0x17c87d=_['map'](_0x38681b[_0xd534('0x25')],'id');return _0x38681b[_0xd534('0x4e')](_0x17c87d)[_0xd534('0xf')](function(){for(var _0x688c14=0x0;_0x688c14<_0x17c87d['length'];_0x688c14+=0x1){_0x3138f6[_0xd534('0x4f')](_0xd534('0x50'),{'ChatInteractionId':Number(_0x17c87d[_0x688c14]),'UserId':Number(_0x38681b['id'])});}});}})[_0xd534('0xf')](function(){if(_0x4d139f===_0xd534('0x51')){var _0x1acd0f=_[_0xd534('0x52')](_0x38681b[_0xd534('0x26')],'id');return _0x38681b['removeMailInteractions'](_0x1acd0f)[_0xd534('0xf')](function(){for(var _0x3d069f=0x0;_0x3d069f<_0x1acd0f['length'];_0x3d069f+=0x1){_0x3138f6['emit'](_0xd534('0x53'),{'MailInteractionId':Number(_0x1acd0f[_0x3d069f]),'UserId':Number(_0x38681b['id'])});}});}})[_0xd534('0xf')](function(){if(_0x4d139f===_0xd534('0x51')){var _0x3c2414=_[_0xd534('0x52')](_0x38681b[_0xd534('0x54')],'id');return _0x38681b['removeFaxInteractions'](_0x3c2414)[_0xd534('0xf')](function(){for(var _0x3ddb2e=0x0;_0x3ddb2e<_0x3c2414[_0xd534('0x44')];_0x3ddb2e+=0x1){_0x3138f6['emit'](_0xd534('0x55'),{'FaxInteractionId':Number(_0x3c2414[_0x3ddb2e]),'UserId':Number(_0x38681b['id'])});}});}})['then'](function(){if(_0x4d139f==='leave'){var _0x41c705=_[_0xd534('0x52')](_0x38681b[_0xd534('0x29')],'id');return _0x38681b['removeSmsInteractions'](_0x41c705)[_0xd534('0xf')](function(){for(var _0x51f0fd=0x0;_0x51f0fd<_0x41c705[_0xd534('0x44')];_0x51f0fd+=0x1){_0x3138f6[_0xd534('0x4f')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x41c705[_0x51f0fd]),'UserId':Number(_0x38681b['id'])});}});}})[_0xd534('0xf')](function(){if(_0x4d139f===_0xd534('0x51')){var _0x510bb3=_[_0xd534('0x52')](_0x38681b[_0xd534('0x2b')],'id');return _0x38681b[_0xd534('0x56')](_0x510bb3)[_0xd534('0xf')](function(){for(var _0x378871=0x0;_0x378871<_0x510bb3['length'];_0x378871+=0x1){_0x3138f6['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x510bb3[_0x378871]),'UserId':Number(_0x38681b['id'])});}});}})[_0xd534('0xf')](function(){if(_0x4d139f===_0xd534('0x51')){var _0x56b857=_['map'](_0x38681b[_0xd534('0x2d')],'id');return _0x38681b[_0xd534('0x57')](_0x56b857)[_0xd534('0xf')](function(){for(var _0x5aebf0=0x0;_0x5aebf0<_0x56b857['length'];_0x5aebf0+=0x1){_0x3138f6['emit'](_0xd534('0x58'),{'WhatsappInteractionId':Number(_0x56b857[_0x5aebf0]),'UserId':Number(_0x38681b['id'])});}});}})[_0xd534('0x59')](function(_0x5163bc){_0x123ec9['log'](_0x5163bc);});}}function onDisconnect(_0x4e4cbd,_0x4cf506){joinOrLeave(_0x4e4cbd,'leave',_0x4cf506);}function onConnect(_0x46a156){joinOrLeave(_0x46a156,_0xd534('0x5a'));}exports[_0xd534('0x5b')]=function(_0x19ba41){_0x19ba41['on']('connection',function(_0x35c542){_0x35c542[_0xd534('0x5c')](0x0);_0x35c542[_0xd534('0x5d')]=_0x35c542[_0xd534('0x5e')][_0xd534('0x5f')][_0xd534('0x60')]+':'+_0x35c542[_0xd534('0x5e')]['connection'][_0xd534('0x61')];_0x35c542[_0xd534('0x62')]=new Date();_0x35c542[_0xd534('0x63')]=function(_0x401348){console['log']('SocketIO\x20'+_0x35c542['nsp'][_0xd534('0x5')]+'['+_0x35c542[_0xd534('0x5d')]+']',_0x401348);};_0x35c542['on'](_0xd534('0x64'),function(){onDisconnect(_0x35c542,_0x19ba41);_0x35c542[_0xd534('0x63')](_0xd534('0x65'));});onConnect(_0x35c542);_0x35c542[_0xd534('0x63')](_0xd534('0x66'));});}; \ No newline at end of file +var _0x95ba=['%s:queue:%s','length','user:%s','handshake','find','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','VoiceQueue','ChatQueues','userProfileId','FaxQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','join','default','connection','setMaxListeners','address','request','connectedAt','SocketIO\x20','disconnect','log','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','resourceId','map','where','Campaign','type','format'];(function(_0x1f3699,_0x378bf2){var _0x59258f=function(_0x2364a9){while(--_0x2364a9){_0x1f3699['push'](_0x1f3699['shift']());}};_0x59258f(++_0x378bf2);}(_0x95ba,0x17c));var _0xa95b=function(_0x295b45,_0x47d8cf){_0x295b45=_0x295b45-0x0;var _0x5ed8d4=_0x95ba[_0x295b45];return _0x5ed8d4;};'use strict';var _=require(_0xa95b('0x0'));var util=require(_0xa95b('0x1'));var BPromise=require(_0xa95b('0x2'));var db=require(_0xa95b('0x3'))['db'];var config=require(_0xa95b('0x4'));var queryQueues={'attributes':['id',_0xa95b('0x5')],'include':[{'as':_0xa95b('0x6'),'model':db[_0xa95b('0x7')],'attributes':['id',_0xa95b('0x5'),_0xa95b('0x8')],'raw':!![],'where':{'role':_0xa95b('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa95b('0x5')],'where':{'role':_0xa95b('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xa95b('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa95b('0x5'),'type'],'where':{'type':_0xa95b('0xb')}};function getAssociatedResources(_0x12c616,_0x4cd6ee,_0x1e33e2){return db[_0xa95b('0xc')][_0xa95b('0xd')]({'where':{'name':_0x12c616,'userProfileId':_0x4cd6ee},'raw':!![]})[_0xa95b('0xe')](function(_0xb75882){if(_0xb75882){if(_0xb75882[_0xa95b('0xf')]){switch(_0x12c616){case'VoiceQueues':case'ChatQueues':case'FaxQueues':case _0xa95b('0x10'):case _0xa95b('0x11'):case _0xa95b('0x12'):case _0xa95b('0x13'):return db[_0x1e33e2][_0xa95b('0x14')](queryQueues);case'Telephones':return db[_0x1e33e2][_0xa95b('0x14')](queryTelephones);case'Trunks':return db[_0x1e33e2][_0xa95b('0x14')](queryTrunks);case _0xa95b('0x15'):return db[_0x1e33e2][_0xa95b('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0xa95b('0x14')]({'attributes':[_0xa95b('0x16')],'where':{'sectionId':_0xb75882['id']},'raw':!![]})[_0xa95b('0xe')](function(_0x5e49cb){if(_0x5e49cb){var _0x44d604={'where':{'id':_[_0xa95b('0x17')](_0x5e49cb,_0xa95b('0x16'))},'raw':!![]};switch(_0x1e33e2){case _0xa95b('0x7'):_0x44d604[_0xa95b('0x18')][_0xa95b('0x8')]='telephone';break;case _0xa95b('0x19'):_0x44d604['where'][_0xa95b('0x1a')]=_0xa95b('0xb');break;}return db[_0x1e33e2][_0xa95b('0x14')](_0x44d604);}else{return[];}});}}else{return[];}})['then'](function(_0x36f1a4){return _0x36f1a4;});}function joinOrLeaveQueues(_0x517d8d,_0xd3712a,_0x241ba3,_0x4340d4){_0x517d8d[_0xd3712a](util[_0xa95b('0x1b')](_0xa95b('0x1c'),_0x241ba3,_0x4340d4[_0xa95b('0x5')]));if(_0x4340d4[_0xa95b('0x6')]){for(var _0x45ad3b=0x0;_0x45ad3b<_0x4340d4[_0xa95b('0x6')][_0xa95b('0x1d')];_0x45ad3b+=0x1){_0x517d8d[_0xd3712a](util[_0xa95b('0x1b')](_0xa95b('0x1e'),_0x4340d4[_0xa95b('0x6')][_0x45ad3b][_0xa95b('0x5')]));}}}function joinOrLeave(_0x1f3a13,_0x529910,_0x23155c){var _0x10b73e;if(_0x1f3a13[_0xa95b('0x1f')]['query']['id']){db['User'][_0xa95b('0x20')]({'attributes':['id','name',_0xa95b('0x8'),'userProfileId'],'where':{'id':_0x1f3a13[_0xa95b('0x1f')][_0xa95b('0x21')]['id']},'include':[{'model':db[_0xa95b('0x22')],'as':_0xa95b('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa95b('0x24')],'as':_0xa95b('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xa95b('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa95b('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa95b('0x28')],'as':_0xa95b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa95b('0x2a')],'as':_0xa95b('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xa95b('0xe')](function(_0x969af6){if(_0x969af6){_0x10b73e=_0x969af6;_0x1f3a13[_0x529910](util[_0xa95b('0x1b')](_0xa95b('0x1e'),_0x969af6[_0xa95b('0x5')]));var _0x4019dd=[];switch(_0x969af6[_0xa95b('0x8')]){case _0xa95b('0x2c'):_0x1f3a13[_0x529910](_0xa95b('0x2d'));_0x1f3a13[_0x529910](_0xa95b('0x2e'));if(queryQueues[_0xa95b('0x2f')](_0xa95b('0x30'))){delete queryQueues[_0xa95b('0x30')];}_0x4019dd[_0xa95b('0x31')](db['VoiceQueue'][_0xa95b('0x14')](queryQueues));_0x4019dd['push'](db[_0xa95b('0x32')][_0xa95b('0x14')](queryQueues));_0x4019dd[_0xa95b('0x31')](db[_0xa95b('0x33')][_0xa95b('0x14')](queryQueues));_0x4019dd['push'](db[_0xa95b('0x34')][_0xa95b('0x14')](queryQueues));_0x4019dd[_0xa95b('0x31')](db[_0xa95b('0x35')][_0xa95b('0x14')](queryQueues));_0x4019dd[_0xa95b('0x31')](db[_0xa95b('0x36')][_0xa95b('0x14')](queryQueues));_0x4019dd[_0xa95b('0x31')](db[_0xa95b('0x37')][_0xa95b('0x14')](queryQueues));_0x4019dd[_0xa95b('0x31')](db['User'][_0xa95b('0x14')](queryTelephones));_0x4019dd['push'](db['Trunk'][_0xa95b('0x14')](queryTrunks));_0x4019dd[_0xa95b('0x31')](db[_0xa95b('0x19')][_0xa95b('0x14')](queryCampaigns));_0x4019dd['push'](db[_0xa95b('0x7')][_0xa95b('0x14')](queryAgents));break;case _0xa95b('0x38'):_0x1f3a13[_0x529910](_0xa95b('0x2d'));_0x1f3a13[_0x529910]('voice:outbound');_0x4019dd[_0xa95b('0x31')](getAssociatedResources(_0xa95b('0x39'),_0x969af6['userProfileId'],_0xa95b('0x3a')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources(_0xa95b('0x3b'),_0x969af6[_0xa95b('0x3c')],_0xa95b('0x32')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources(_0xa95b('0x3d'),_0x969af6[_0xa95b('0x3c')],_0xa95b('0x33')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources(_0xa95b('0x10'),_0x969af6[_0xa95b('0x3c')],_0xa95b('0x34')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources('MailQueues',_0x969af6[_0xa95b('0x3c')],_0xa95b('0x35')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources('OpenchannelQueues',_0x969af6['userProfileId'],'OpenchannelQueue'));_0x4019dd[_0xa95b('0x31')](getAssociatedResources(_0xa95b('0x13'),_0x969af6[_0xa95b('0x3c')],_0xa95b('0x37')));_0x4019dd['push'](getAssociatedResources('Telephones',_0x969af6[_0xa95b('0x3c')],_0xa95b('0x7')));_0x4019dd[_0xa95b('0x31')](getAssociatedResources('Trunks',_0x969af6[_0xa95b('0x3c')],'Trunk'));_0x4019dd[_0xa95b('0x31')](getAssociatedResources('IvrCampaigns',_0x969af6[_0xa95b('0x3c')],_0xa95b('0x19')));_0x4019dd[_0xa95b('0x31')](db['User']['findAll'](queryAgents));break;case'agent':_0x1f3a13[_0x529910](_0xa95b('0x2d'));_0x1f3a13[_0x529910](_0xa95b('0x2e'));_0x4019dd[_0xa95b('0x31')](_0x969af6[_0xa95b('0x3e')]({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd['push'](_0x969af6[_0xa95b('0x3f')]({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd[_0xa95b('0x31')](_0x969af6[_0xa95b('0x40')]({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd[_0xa95b('0x31')](_0x969af6[_0xa95b('0x41')]({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd[_0xa95b('0x31')](_0x969af6[_0xa95b('0x42')]({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd['push'](_0x969af6['getOpenchannelQueues']({'attributes':['id',_0xa95b('0x5')]}));_0x4019dd['push'](_0x969af6[_0xa95b('0x43')]({'attributes':['id',_0xa95b('0x5')]}));break;}return BPromise[_0xa95b('0x44')](_0x4019dd);}})['then'](function(_0x4c2221){if(_0x4c2221&&_0x4c2221[_0xa95b('0x1d')]){for(var _0x319642=0x0;_0x319642<_0x4c2221[_0xa95b('0x1d')];_0x319642+=0x1){for(var _0x27803c=0x0;_0x27803c<_0x4c2221[_0x319642][_0xa95b('0x1d')];_0x27803c+=0x1){switch(_0x319642){case 0x0:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x45'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x1:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x46'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x2:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x47'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x3:joinOrLeaveQueues(_0x1f3a13,_0x529910,'sms',_0x4c2221[_0x319642][_0x27803c]);break;case 0x4:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x48'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x5:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x49'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x6:joinOrLeaveQueues(_0x1f3a13,_0x529910,_0xa95b('0x4a'),_0x4c2221[_0x319642][_0x27803c]);break;case 0x7:_0x1f3a13[_0x529910](util[_0xa95b('0x1b')](_0xa95b('0x4b'),_0x4c2221[_0x319642][_0x27803c][_0xa95b('0x5')]));break;case 0x8:_0x1f3a13[_0x529910](util['format'](_0xa95b('0x4c'),_0x4c2221[_0x319642][_0x27803c]['name']));break;case 0x9:_0x1f3a13[_0x529910](util['format'](_0xa95b('0x4d'),_0x4c2221[_0x319642][_0x27803c][_0xa95b('0x1a')],_0x4c2221[_0x319642][_0x27803c][_0xa95b('0x5')]));break;case 0xa:_0x1f3a13[_0x529910](util[_0xa95b('0x1b')](_0xa95b('0x1e'),_0x4c2221[_0x319642][_0x27803c][_0xa95b('0x5')]));break;}}}}})[_0xa95b('0xe')](function(){if(_0x529910===_0xa95b('0x4e')){var _0x6dd563=_[_0xa95b('0x17')](_0x10b73e['ChatInteractions'],'id');return _0x10b73e[_0xa95b('0x4f')](_0x6dd563)[_0xa95b('0xe')](function(){for(var _0x27309a=0x0;_0x27309a<_0x6dd563['length'];_0x27309a+=0x1){_0x23155c[_0xa95b('0x50')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x6dd563[_0x27309a]),'UserId':Number(_0x10b73e['id'])});}});}})[_0xa95b('0xe')](function(){if(_0x529910==='leave'){var _0x493888=_[_0xa95b('0x17')](_0x10b73e['MailInteractions'],'id');return _0x10b73e[_0xa95b('0x51')](_0x493888)[_0xa95b('0xe')](function(){for(var _0x489e9b=0x0;_0x489e9b<_0x493888[_0xa95b('0x1d')];_0x489e9b+=0x1){_0x23155c[_0xa95b('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x493888[_0x489e9b]),'UserId':Number(_0x10b73e['id'])});}});}})[_0xa95b('0xe')](function(){if(_0x529910===_0xa95b('0x4e')){var _0x429b84=_[_0xa95b('0x17')](_0x10b73e[_0xa95b('0x52')],'id');return _0x10b73e[_0xa95b('0x53')](_0x429b84)[_0xa95b('0xe')](function(){for(var _0x1f3602=0x0;_0x1f3602<_0x429b84[_0xa95b('0x1d')];_0x1f3602+=0x1){_0x23155c[_0xa95b('0x50')](_0xa95b('0x54'),{'FaxInteractionId':Number(_0x429b84[_0x1f3602]),'UserId':Number(_0x10b73e['id'])});}});}})[_0xa95b('0xe')](function(){if(_0x529910===_0xa95b('0x4e')){var _0x3ff385=_[_0xa95b('0x17')](_0x10b73e[_0xa95b('0x55')],'id');return _0x10b73e[_0xa95b('0x56')](_0x3ff385)['then'](function(){for(var _0xf05e6=0x0;_0xf05e6<_0x3ff385['length'];_0xf05e6+=0x1){_0x23155c[_0xa95b('0x50')](_0xa95b('0x57'),{'SmsInteractionId':Number(_0x3ff385[_0xf05e6]),'UserId':Number(_0x10b73e['id'])});}});}})[_0xa95b('0xe')](function(){if(_0x529910===_0xa95b('0x4e')){var _0x50f8f2=_[_0xa95b('0x17')](_0x10b73e['OpenchannelInteractions'],'id');return _0x10b73e[_0xa95b('0x58')](_0x50f8f2)[_0xa95b('0xe')](function(){for(var _0x54dc6b=0x0;_0x54dc6b<_0x50f8f2[_0xa95b('0x1d')];_0x54dc6b+=0x1){_0x23155c[_0xa95b('0x50')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x50f8f2[_0x54dc6b]),'UserId':Number(_0x10b73e['id'])});}});}})[_0xa95b('0xe')](function(){if(_0x529910===_0xa95b('0x4e')){var _0x4d2b85=_[_0xa95b('0x17')](_0x10b73e[_0xa95b('0x2b')],'id');return _0x10b73e[_0xa95b('0x59')](_0x4d2b85)['then'](function(){for(var _0x45ba04=0x0;_0x45ba04<_0x4d2b85['length'];_0x45ba04+=0x1){_0x23155c[_0xa95b('0x50')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4d2b85[_0x45ba04]),'UserId':Number(_0x10b73e['id'])});}});}})['catch'](function(_0x158f41){_0x1f3a13['log'](_0x158f41);});}}function onDisconnect(_0x38fdb3,_0x3c66b0){joinOrLeave(_0x38fdb3,_0xa95b('0x4e'),_0x3c66b0);}function onConnect(_0x531854){joinOrLeave(_0x531854,_0xa95b('0x5a'));}exports[_0xa95b('0x5b')]=function(_0x2e7a92){_0x2e7a92['on'](_0xa95b('0x5c'),function(_0x510953){_0x510953[_0xa95b('0x5d')](0x0);_0x510953[_0xa95b('0x5e')]=_0x510953[_0xa95b('0x5f')][_0xa95b('0x5c')]['remoteAddress']+':'+_0x510953[_0xa95b('0x5f')][_0xa95b('0x5c')]['remotePort'];_0x510953[_0xa95b('0x60')]=new Date();_0x510953['log']=function(_0xbe1b52){console['log'](_0xa95b('0x61')+_0x510953['nsp']['name']+'['+_0x510953[_0xa95b('0x5e')]+']',_0xbe1b52);};_0x510953['on'](_0xa95b('0x62'),function(){onDisconnect(_0x510953,_0x2e7a92);_0x510953[_0xa95b('0x63')](_0xa95b('0x64'));});onConnect(_0x510953);_0x510953[_0xa95b('0x63')](_0xa95b('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7a1c4a7..83cf4fd 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 _0x6304=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','code','error','Trigger,\x20%s','catch','get','channel','event','direction','UserId','User','find','name','interface','format','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','default','hasOwnProperty','model','callback','toLowerCase','../../mysqldb','jayson/promise','../logger','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage'];(function(_0x4d347d,_0x5f3713){var _0x53c9ca=function(_0x383a69){while(--_0x383a69){_0x4d347d['push'](_0x4d347d['shift']());}};_0x53c9ca(++_0x5f3713);}(_0x6304,0x166));var _0x4630=function(_0x4a8024,_0x5e1d5d){_0x4a8024=_0x4a8024-0x0;var _0x48db2d=_0x6304[_0x4a8024];return _0x48db2d;};'use strict';var util=require('util');var db=require(_0x4630('0x0'))['db'];var jayson=require(_0x4630('0x1'));var logger=require(_0x4630('0x2'))('triggers');var client=jayson[_0x4630('0x3')][_0x4630('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x4630('0x5'),'event':_0x4630('0x6'),'condition':_0x4630('0x7'),'callback':afterCreate},{'channel':_0x4630('0x8'),'model':_0x4630('0x5'),'event':_0x4630('0x9'),'condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':_0x4630('0x8'),'model':_0x4630('0xb'),'event':_0x4630('0x6'),'condition':_0x4630('0xc'),'callback':afterCreateMessage},{'channel':_0x4630('0xd'),'model':_0x4630('0xe'),'event':'afterCreate','condition':_0x4630('0x7'),'callback':afterCreate},{'channel':'Sms','model':_0x4630('0xe'),'event':_0x4630('0x9'),'condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':'Sms','model':_0x4630('0xf'),'event':_0x4630('0x6'),'condition':_0x4630('0xc'),'callback':afterCreateMessage},{'channel':_0x4630('0x10'),'model':_0x4630('0x11'),'event':_0x4630('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x4630('0x10'),'model':_0x4630('0x11'),'event':_0x4630('0x9'),'condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':_0x4630('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x4630('0xc'),'callback':afterCreateMessage},{'channel':_0x4630('0x12'),'model':_0x4630('0x13'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x4630('0x12'),'model':'FaxInteraction','event':_0x4630('0x9'),'condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':_0x4630('0x12'),'model':'FaxMessage','event':'afterCreate','condition':_0x4630('0xc'),'callback':afterCreateMessage},{'channel':_0x4630('0x14'),'model':_0x4630('0x15'),'event':_0x4630('0x6'),'condition':_0x4630('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x4630('0x15'),'event':'afterUpdate','condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x4630('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x4630('0x16'),'model':_0x4630('0x17'),'event':_0x4630('0x6'),'condition':_0x4630('0x7'),'callback':afterCreate},{'channel':_0x4630('0x16'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x4630('0xa'),'callback':afterUpdate},{'channel':_0x4630('0x16'),'model':_0x4630('0x18'),'event':_0x4630('0x6'),'condition':_0x4630('0xc'),'callback':afterCreateMessage}];function request(_0x10c9d4){return client['request'](_0x4630('0x19'),_0x10c9d4)[_0x4630('0x1a')](function(_0x1720d7){logger[_0x4630('0x1b')]('Trigger,\x20%s',_0x4630('0x19'),_0x1720d7);if(_0x1720d7['error']){if(_0x1720d7['error'][_0x4630('0x1c')]===0x1f4){logger[_0x4630('0x1d')](_0x4630('0x1e'),_0x4630('0x19'),_0x1720d7['error']);}}})[_0x4630('0x1f')](function(_0x42602e){logger[_0x4630('0x1d')](_0x4630('0x1e'),'EventManager',_0x42602e);});}function afterCreateMessage(_0x412ea9,_0x397f9c){return function(_0x164f92,_0x1703a9){_0x164f92=_0x164f92[_0x4630('0x20')]({'plain':!![]});_0x164f92[_0x4630('0x21')]=_0x412ea9;_0x164f92[_0x4630('0x22')]=_0x164f92[_0x4630('0x23')];if(_0x164f92[_0x4630('0x24')]){return db[_0x4630('0x25')][_0x4630('0x26')]({'where':{'id':_0x164f92[_0x4630('0x24')]},'attributes':['id',_0x4630('0x27')],'raw':!![]})['then'](function(_0x4ed761){_0x164f92[_0x4630('0x28')]=util[_0x4630('0x29')](_0x4630('0x2a'),_0x4ed761[_0x4630('0x27')]);_0x164f92[_0x4630('0x21')]=_0x412ea9;return request({'event':_0x4630('0x2b'),'message':_0x164f92});})[_0x4630('0x1f')](function(_0x26bdf5){console[_0x4630('0x1d')](_0x26bdf5);});}else{return request({'event':_0x4630('0x2c'),'message':_0x164f92});}};}function afterCreate(_0x5b6fae,_0x59a35f){return function(_0x58f6d0,_0x19bc59){_0x58f6d0=_0x58f6d0[_0x4630('0x20')]({'plain':!![]});_0x58f6d0[_0x4630('0x21')]=_0x5b6fae;_0x58f6d0[_0x4630('0x22')]=_0x4630('0x2d');return request({'event':_0x59a35f,'message':_0x58f6d0});};}function afterUpdate(_0x29b97a,_0x2d8713){return function(_0x1ca052,_0x4476b2){if(_0x1ca052[_0x4630('0x2e')](_0x4630('0x2f'))&&_0x1ca052[_0x4630('0x2f')]){_0x1ca052=_0x1ca052[_0x4630('0x20')]({'plain':!![]});_0x1ca052[_0x4630('0x21')]=_0x29b97a;_0x1ca052[_0x4630('0x22')]=_0x4630('0x2f');if(_0x1ca052['UserId']){return db[_0x4630('0x25')]['find']({'where':{'id':_0x1ca052[_0x4630('0x24')]},'attributes':['id','name'],'raw':!![]})[_0x4630('0x1a')](function(_0x4612ca){_0x1ca052[_0x4630('0x28')]=util[_0x4630('0x29')](_0x4630('0x2a'),_0x4612ca[_0x4630('0x27')]);return request({'event':_0x2d8713,'message':_0x1ca052});})[_0x4630('0x1f')](function(_0x28a7e9){console[_0x4630('0x1d')](_0x28a7e9);});}else{return request({'event':_0x2d8713,'message':_0x1ca052});}}};}exports[_0x4630('0x30')]=function(){for(var _0x1d6e54=0x0;_0x1d6e54=_0x22d9e3[_0xd82b('0xf')]){throw Error(_0xd82b('0x10'));}_0x4592f0(_0x276e62);})[_0xd82b('0x11')](function(_0x2a65e4){_0x5d6298(_0x2a65e4);});});}; \ No newline at end of file +var _0xf5d2=['mail','chat','fax','toLowerCase','includes','clearBlockUser','isUndefined','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','voice'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xf5d2,0x1d8));var _0x2f5d=function(_0x104a95,_0x424bfc){_0x104a95=_0x104a95-0x0;var _0x2107c8=_0xf5d2[_0x104a95];return _0x2107c8;};'use strict';var _=require(_0x2f5d('0x0'));var BPromise=require(_0x2f5d('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x2f5d('0x2'),_0x2f5d('0x3'),_0x2f5d('0x4'),_0x2f5d('0x5'),'sms','whatsapp','openchannel'];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x4ee4e0){_0x4ee4e0=_0x4ee4e0[_0x2f5d('0x6')]();return _[_0x2f5d('0x7')](channels,_0x4ee4e0);};exports[_0x2f5d('0x8')]=function(_0x260191,_0x3d7811,_0x503af0,_0x25eef3){var _0x4bd21d={'loginAttempts':_0x3d7811,'blocked':_0x503af0};if(!_[_0x2f5d('0x9')](_0x25eef3)){_0x4bd21d['blockedAt']=_0x25eef3;}return _0x260191['updateAttributes'](_0x4bd21d);};exports['getLicense']=function(_0x51adec){return new BPromise(function(_0x110c9c,_0x649623){var _0x12597c=0x0;if(_0x51adec[_0x2f5d('0xa')]!==_0x2f5d('0xb')){_0x110c9c(_0x51adec);}db[_0x2f5d('0xc')][_0x2f5d('0xd')]({'where':{'role':_0x2f5d('0xb'),'online':!![],'id':{'$ne':_0x51adec['id']}}})[_0x2f5d('0xe')](function(_0x163980){_0x12597c=_0x163980;return util[_0x2f5d('0xf')]();})[_0x2f5d('0xe')](function(_0x44a7bf){if(_0x44a7bf&&_0x44a7bf['agents']&&_0x12597c>=_0x44a7bf[_0x2f5d('0x10')]){throw Error(_0x2f5d('0x11'));}_0x110c9c(_0x51adec);})[_0x2f5d('0x12')](function(_0x2ecaa9){_0x649623(_0x2ecaa9);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 0ab6d57..58a7ddb 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcd8=['exports','404','status','render','send'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0xbcd8,0x145));var _0x8bcd=function(_0x19c136,_0x2cc9b1){_0x19c136=_0x19c136-0x0;var _0x34e478=_0xbcd8[_0x19c136];return _0x34e478;};'use strict';module[_0x8bcd('0x0')][0x194]=function pageNotFound(_0x5c9351,_0x3b6d6c){var _0x8c197e=_0x8bcd('0x1');var _0x33e932=0x194;var _0x230087={'status':_0x33e932};_0x3b6d6c[_0x8bcd('0x2')](_0x230087[_0x8bcd('0x2')]);_0x3b6d6c[_0x8bcd('0x3')](_0x8c197e,{},function(_0x7d6ce0,_0x89515a){if(_0x7d6ce0){return _0x3b6d6c[_0x8bcd('0x2')](_0x230087['status'])['json'](_0x230087);}_0x3b6d6c[_0x8bcd('0x4')](_0x89515a);});}; \ No newline at end of file +var _0xd903=['status','render','json','send','exports','404'];(function(_0x1c3d9b,_0x3e6ba2){var _0x35e71f=function(_0x24174e){while(--_0x24174e){_0x1c3d9b['push'](_0x1c3d9b['shift']());}};_0x35e71f(++_0x3e6ba2);}(_0xd903,0x12a));var _0x3d90=function(_0x4d9a65,_0x4fbf12){_0x4d9a65=_0x4d9a65-0x0;var _0x2dbb01=_0xd903[_0x4d9a65];return _0x2dbb01;};'use strict';module[_0x3d90('0x0')][0x194]=function pageNotFound(_0x462ca1,_0x4dff9b){var _0x490ab3=_0x3d90('0x1');var _0x5310b0=0x194;var _0x14b616={'status':_0x5310b0};_0x4dff9b[_0x3d90('0x2')](_0x14b616['status']);_0x4dff9b[_0x3d90('0x3')](_0x490ab3,{},function(_0x4eeb37,_0x467550){if(_0x4eeb37){return _0x4dff9b[_0x3d90('0x2')](_0x14b616[_0x3d90('0x2')])[_0x3d90('0x4')](_0x14b616);}_0x4dff9b[_0x3d90('0x5')](_0x467550);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index f8a461b..aeeca7a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1dcc=['name','database','username','password','options','sequelizeHistory','User','../api/user/user.model','VoiceChanSpy','import','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../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','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','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','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../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','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueue','VoiceQueues','MailQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_sms_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceMailMessage','mailboxuser','uniqueid','ContactId','MailAccountId','hasOne','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','ListId','Template','TemplateId','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','restrict','TagId','Dashboard','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','SmsMessage','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','Website','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','CmCompany','JscriptySessionReport','Company','CompanyId','cm_contact_has_tags','Queue','Campaign','OwnerId','CampaignId','Condition','All','OneAll','Any','AutomationAnyId','AutomationId','Intervals','MailApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','Mohs','chat_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','AnalyticFieldReport','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','DescriptionId','Subject','SubjectId','Description','Field','FieldId','SugarcrmConfiguration','SugarcrmField','Subjects','Descriptions','VariableId','DeskField','ZohoConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','Dynamics365Configuration','FreshsalesConfiguration','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','team_has_mail_queues','team_has_whatsapp_queues','HopperFinals','TrunkId','TrunkBackupId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToUserId','ToAgent','ToQueue','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','CmCustomField','CustomFields','HopperHistory','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','Interaction','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','xC@LL1234'];(function(_0x15744b,_0x215275){var _0x1fc14f=function(_0x19948a){while(--_0x19948a){_0x15744b['push'](_0x15744b['shift']());}};_0x1fc14f(++_0x215275);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x2525c7,_0x13b1a8){_0x2525c7=_0x2525c7-0x0;var _0x2f1ea4=_0x1dcc[_0x2525c7];return _0x2f1ea4;};'use strict';var path=require(_0xc1dc('0x0'));var config=require(_0xc1dc('0x1'));var Sequelize=require(_0xc1dc('0x2'));var _=require(_0xc1dc('0x3'));var jstz=require('jstz');var timezone=jstz[_0xc1dc('0x4')]();config['sequelize']=_[_0xc1dc('0x5')](config[_0xc1dc('0x2')],{'database':_0xc1dc('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0xc1dc('0x7'),'port':0xcea,'dialect':_0xc1dc('0x8'),'dialectOptions':{'charset':_0xc1dc('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xc1dc('0xa'),'collate':_0xc1dc('0xb')}}});config['sequelizeHistory']=_[_0xc1dc('0x5')](config['sequelizeHistory'],{'database':_0xc1dc('0x6'),'username':'xcall','password':_0xc1dc('0xc'),'options':{'host':_0xc1dc('0x7'),'port':0xcea,'dialect':_0xc1dc('0x8'),'dialectOptions':{'charset':_0xc1dc('0x9')},'logging':![],'timezone':timezone[_0xc1dc('0xd')](),'define':{'charset':_0xc1dc('0xa'),'collate':_0xc1dc('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc1dc('0x2')][_0xc1dc('0xe')],config['sequelize'][_0xc1dc('0xf')],config[_0xc1dc('0x2')][_0xc1dc('0x10')],config['sequelize'][_0xc1dc('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc1dc('0x12')][_0xc1dc('0xe')],config[_0xc1dc('0x12')][_0xc1dc('0xf')],config[_0xc1dc('0x12')][_0xc1dc('0x10')],config[_0xc1dc('0x12')][_0xc1dc('0x11')])};db[_0xc1dc('0x13')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x14'));db[_0xc1dc('0x15')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xc1dc('0x17')]=db[_0xc1dc('0x2')]['import']('../api/voiceContext/voiceContext.model');db[_0xc1dc('0x18')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x19'));db[_0xc1dc('0x1a')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x1b'));db['VoiceQueue']=db['sequelize']['import'](_0xc1dc('0x1c'));db[_0xc1dc('0x1d')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x1e'));db[_0xc1dc('0x1f')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x20'));db[_0xc1dc('0x21')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x22'));db['VoiceMailMessage']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x23'));db[_0xc1dc('0x24')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x25'));db[_0xc1dc('0x26')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x27'));db[_0xc1dc('0x28')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xc1dc('0x29')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x2a'));db[_0xc1dc('0x2b')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x2c'));db[_0xc1dc('0x2d')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/trunk/trunk.model');db[_0xc1dc('0x2e')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x2f'));db[_0xc1dc('0x30')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x31'));db[_0xc1dc('0x32')]=db['sequelize']['import'](_0xc1dc('0x33'));db[_0xc1dc('0x34')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x35'));db[_0xc1dc('0x36')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x37'));db['UserFaxQueue']=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/userFaxQueue/userFaxQueue.model');db[_0xc1dc('0x38')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/userSmsQueue/userSmsQueue.model');db[_0xc1dc('0x39')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x3a'));db[_0xc1dc('0x3b')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x3c'));db[_0xc1dc('0x3d')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x3e'));db[_0xc1dc('0x3f')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x40'));db[_0xc1dc('0x41')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x42'));db[_0xc1dc('0x43')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x44'));db[_0xc1dc('0x45')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x46'));db[_0xc1dc('0x47')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x48'));db[_0xc1dc('0x49')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x4a'));db[_0xc1dc('0x4b')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x4c'));db['Dashboard']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x4d'));db['DashboardItem']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x4e'));db[_0xc1dc('0x4f')]=db['sequelize']['import'](_0xc1dc('0x50'));db[_0xc1dc('0x51')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x52'));db[_0xc1dc('0x53')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x54'));db[_0xc1dc('0x55')]=db['sequelize']['import'](_0xc1dc('0x56'));db['FaxQueue']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x57'));db[_0xc1dc('0x58')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x59'));db[_0xc1dc('0x5a')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x5b'));db[_0xc1dc('0x5c')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x5d'));db[_0xc1dc('0x5e')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x5f'));db['SmsMessage']=db['sequelize']['import'](_0xc1dc('0x60'));db[_0xc1dc('0x61')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x62'));db['OpenchannelAccount']=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x63'));db[_0xc1dc('0x64')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x65'));db[_0xc1dc('0x66')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xc1dc('0x67')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x68'));db['OpenchannelQueue']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x69'));db[_0xc1dc('0x6a')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x6b'));db[_0xc1dc('0x6c')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x6d'));db[_0xc1dc('0x6e')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x6f'));db[_0xc1dc('0x70')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x71'));db[_0xc1dc('0x72')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x73'));db[_0xc1dc('0x74')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xc1dc('0x75')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x76'));db[_0xc1dc('0x77')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x78'));db[_0xc1dc('0x79')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x7a'));db['CmCompany']=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x7b'));db[_0xc1dc('0x7c')]=db[_0xc1dc('0x2')]['import']('../api/cmContact/cmContact.model');db[_0xc1dc('0x7d')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/cmHopper/cmHopper.model');db[_0xc1dc('0x7e')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x7f'));db[_0xc1dc('0x80')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x81'));db[_0xc1dc('0x82')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x83'));db[_0xc1dc('0x84')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x85'));db[_0xc1dc('0x86')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x87'));db[_0xc1dc('0x88')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x89'));db[_0xc1dc('0x8a')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x8b'));db[_0xc1dc('0x8c')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x8d'));db['Condition']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x8e'));db['Interval']=db['sequelize'][_0xc1dc('0x16')]('../api/interval/interval.model');db[_0xc1dc('0x8f')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x90'));db['Cdr']=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x91'));db[_0xc1dc('0x92')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x93'));db[_0xc1dc('0x94')]=db['sequelize'][_0xc1dc('0x16')]('../api/schedule/schedule.model');db[_0xc1dc('0x95')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x96'));db[_0xc1dc('0x97')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x98'));db['Template']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x99'));db[_0xc1dc('0x9a')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x9b'));db[_0xc1dc('0x9c')]=db['sequelize'][_0xc1dc('0x16')]('../api/variable/variable.model');db[_0xc1dc('0x9d')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x9e'));db[_0xc1dc('0x9f')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xa0'));db[_0xc1dc('0xa1')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xa2'));db['AnalyticExtractedReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xa3'));db['AnalyticMetric']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xa4'));db['AnalyticFieldReport']=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xa5'));db[_0xc1dc('0xa6')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xa7'));db[_0xc1dc('0xa8')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xa9'));db[_0xc1dc('0xaa')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xab'));db[_0xc1dc('0xac')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xad'));db[_0xc1dc('0xae')]=db[_0xc1dc('0x2')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db['sequelize']['import'](_0xc1dc('0xaf'));db['SugarcrmField']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xb0'));db[_0xc1dc('0xb1')]=db[_0xc1dc('0x2')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xc1dc('0xb2')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xb3'));db['DeskField']=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db[_0xc1dc('0xb4')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xb5'));db['ZohoConfiguration']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xb6'));db[_0xc1dc('0xb7')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xb8'));db['ZendeskAccount']=db['sequelize']['import'](_0xc1dc('0xb9'));db[_0xc1dc('0xba')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xbb'));db[_0xc1dc('0xbc')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xbd'));db[_0xc1dc('0xbe')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xbf'));db[_0xc1dc('0xc0')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xc1'));db['FreshdeskField']=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xc2'));db[_0xc1dc('0xc3')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xc4'));db[_0xc1dc('0xc5')]=db['sequelize']['import'](_0xc1dc('0xc6'));db['VtigerField']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xc7'));db['ServicenowAccount']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xc8'));db[_0xc1dc('0xc9')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xca'));db[_0xc1dc('0xcb')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xcc'));db[_0xc1dc('0xcd')]=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xce'));db[_0xc1dc('0xcf')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xc1dc('0xd0')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xd1'));db[_0xc1dc('0xd2')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xd3'));db[_0xc1dc('0x9d')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0x9e'));db[_0xc1dc('0xd4')]=db[_0xc1dc('0x2')]['import']('../api/network/network.model');db['ChatQueueReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xd5'));db['ChatInternalMessage']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xd6'));db[_0xc1dc('0xd7')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db['JscriptyQuestionReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xd8'));db['JscriptySessionReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xd9'));db['SmsQueueReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xda'));db[_0xc1dc('0xdb')]=db[_0xc1dc('0x2')]['import']('../api/squareReport/squareReport.model');db[_0xc1dc('0xdc')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xdd'));db[_0xc1dc('0xde')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xdf'));db['Setting']=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/setting/setting.model');db[_0xc1dc('0xe0')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xe1'));db[_0xc1dc('0xe2')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xe3'));db['SquareRecording']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xe4'));db[_0xc1dc('0xe5')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xe6'));db[_0xc1dc('0xe7')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xe8'));db[_0xc1dc('0xe9')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xea'));db['Campaign']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xeb'));db['Migration']=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xec'));db[_0xc1dc('0xed')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xee'));db[_0xc1dc('0xef')]=db[_0xc1dc('0x2')]['import']('../api/plugin/plugin.model');db[_0xc1dc('0xf0')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0xf1'));db[_0xc1dc('0xf2')]=db['sequelize'][_0xc1dc('0x16')](_0xc1dc('0xf3'));db['FaxTransferReport']=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xf4'));db[_0xc1dc('0xf5')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xf6'));db['SmsTransferReport']=db['sequelize'][_0xc1dc('0x16')]('../api/smsTransferReport/smsTransferReport.model');db[_0xc1dc('0xf7')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xf8'));db[_0xc1dc('0xf9')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xfa'));db[_0xc1dc('0xfb')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xfc'));db[_0xc1dc('0xfd')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xc1dc('0x2')][_0xc1dc('0x16')]('../api/userProfileResource/userProfileResource.model');db[_0xc1dc('0xfe')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0xff'));db[_0xc1dc('0x100')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x101'));db[_0xc1dc('0x102')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x103'));db[_0xc1dc('0x104')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x105'));db[_0xc1dc('0x106')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x107'));db[_0xc1dc('0x108')]=db['sequelize'][_0xc1dc('0x16')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x109'));db[_0xc1dc('0x10a')]=db[_0xc1dc('0x2')][_0xc1dc('0x16')](_0xc1dc('0x10b'));db[_0xc1dc('0x10c')]=db[_0xc1dc('0x2')]['import'](_0xc1dc('0x10d'));db[_0xc1dc('0x13')]['hasOne'](db['VoiceMail'],{'as':_0xc1dc('0x21'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x10f')});db['User'][_0xc1dc('0x110')](db[_0xc1dc('0x1d')],{'as':'Recordings','foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db[_0xc1dc('0x30')],{'as':_0xc1dc('0x111'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db['VoiceExtension'],{'as':_0xc1dc('0x112'),'onDelete':'cascade','hooks':!![]});db['User'][_0xc1dc('0x110')](db[_0xc1dc('0x80')],{'as':'HopperFinals','foreignKey':_0xc1dc('0x10f')});db['User']['hasMany'](db[_0xc1dc('0x82')],{'as':'HopperHistory','foreignKey':'UserId'});db['User']['hasMany'](db[_0xc1dc('0x84')],{'as':_0xc1dc('0x84'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db[_0xc1dc('0x66')],{'as':_0xc1dc('0x113'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db[_0xc1dc('0x70')],{'as':'ChatInteractions','foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db['SmsInteraction'],{'as':_0xc1dc('0x114'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db[_0xc1dc('0x53')],{'as':_0xc1dc('0x115'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')]['hasMany'](db[_0xc1dc('0x47')],{'as':_0xc1dc('0x116'),'foreignKey':'UserId'});db['User'][_0xc1dc('0x110')](db['WhatsappInteraction'],{'as':_0xc1dc('0x117'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x13')][_0xc1dc('0x110')](db[_0xc1dc('0xfe')],{'as':_0xc1dc('0x118'),'foreignKey':_0xc1dc('0x119')});db[_0xc1dc('0x13')]['belongsTo'](db[_0xc1dc('0xfb')],{'as':_0xc1dc('0xfb'),'foreignKey':_0xc1dc('0x11a')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x77')],{'as':_0xc1dc('0x11c'),'through':'chat_group_has_users'});db['User'][_0xc1dc('0x11b')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x11d'),'through':_0xc1dc('0x11e')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x11f'),'through':_0xc1dc('0x120')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db['Team'],{'through':_0xc1dc('0x121')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x47')],{'as':'MailInteractions','through':_0xc1dc('0x122')});db['User'][_0xc1dc('0x11b')](db['ChatInteraction'],{'as':_0xc1dc('0x123'),'through':_0xc1dc('0x124')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x53')],{'as':_0xc1dc('0x115'),'through':_0xc1dc('0x125')});db[_0xc1dc('0x13')]['belongsToMany'](db['SmsInteraction'],{'as':_0xc1dc('0x114'),'through':_0xc1dc('0x126')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db['OpenchannelInteraction'],{'as':_0xc1dc('0x113'),'through':'user_has_openchannel_interactions'});db['User']['belongsToMany'](db[_0xc1dc('0x104')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x127')],{'as':_0xc1dc('0x128'),'through':_0xc1dc('0x32'),'required':![]});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x43')],{'as':_0xc1dc('0x129'),'through':_0xc1dc('0x36'),'required':![]});db[_0xc1dc('0x13')]['belongsToMany'](db['ChatQueue'],{'as':'ChatQueues','through':_0xc1dc('0x34'),'required':![],'hooks':!![]});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x12a')],{'as':_0xc1dc('0x12b'),'through':_0xc1dc('0x12c'),'required':![]});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db['SmsQueue'],{'as':_0xc1dc('0x12d'),'through':_0xc1dc('0x38'),'required':![]});db['User']['belongsToMany'](db[_0xc1dc('0x12e')],{'as':_0xc1dc('0x12f'),'through':_0xc1dc('0x39'),'required':![]});db['User']['belongsToMany'](db[_0xc1dc('0x10a')],{'as':_0xc1dc('0x130'),'through':_0xc1dc('0x3b'),'required':![]});db['User'][_0xc1dc('0x11b')](db[_0xc1dc('0xf7')],{'through':_0xc1dc('0x120')});db['User'][_0xc1dc('0x11b')](db['VoicePrefix'],{'as':_0xc1dc('0x131'),'through':_0xc1dc('0x132'),'required':![]});db['User'][_0xc1dc('0x11b')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xc1dc('0x133')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db['FaxAccount'],{'as':_0xc1dc('0x134'),'through':_0xc1dc('0x135')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db['MailAccount'],{'as':_0xc1dc('0x136'),'through':_0xc1dc('0x137')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x138')],{'as':_0xc1dc('0x139'),'through':'user_has_openchannel_accounts'});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x5a')],{'as':'SmsAccounts','through':_0xc1dc('0x13a')});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0x100')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xc1dc('0x13')][_0xc1dc('0x11b')](db[_0xc1dc('0xe2')],{'as':'SquareProjects','through':_0xc1dc('0x13b')});db[_0xc1dc('0x15')][_0xc1dc('0x110')](db[_0xc1dc('0x18')],{'as':_0xc1dc('0x13c'),'onDelete':'cascade','foreignKey':_0xc1dc('0x13d')});db[_0xc1dc('0x17')][_0xc1dc('0x110')](db['VoiceExtension'],{'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x18')][_0xc1dc('0x110')](db[_0xc1dc('0x18')],{'as':_0xc1dc('0x13e'),'onDelete':'cascade'});db[_0xc1dc('0x1a')][_0xc1dc('0x11b')](db['Sound'],{'as':_0xc1dc('0x13f'),'through':_0xc1dc('0x140')});db['VoiceQueue'][_0xc1dc('0x110')](db[_0xc1dc('0x30')],{'as':_0xc1dc('0x141'),'foreignKey':_0xc1dc('0x142')});db['VoiceQueue']['hasMany'](db[_0xc1dc('0x7d')],{'as':_0xc1dc('0x143'),'foreignKey':_0xc1dc('0x142')});db['VoiceQueue'][_0xc1dc('0x110')](db[_0xc1dc('0x80')],{'as':'HopperFinals','foreignKey':_0xc1dc('0x142')});db[_0xc1dc('0x127')][_0xc1dc('0x110')](db['CmHopperHistory'],{'as':_0xc1dc('0x144'),'foreignKey':_0xc1dc('0x142')});db[_0xc1dc('0x127')]['hasMany'](db[_0xc1dc('0x84')],{'as':'ReportAgentPreview','foreignKey':_0xc1dc('0x142')});db[_0xc1dc('0x127')][_0xc1dc('0x110')](db['CmHopperBlack'],{'as':_0xc1dc('0x145'),'foreignKey':_0xc1dc('0x142')});db['VoiceQueue'][_0xc1dc('0x110')](db['JscriptySessionReport'],{'as':_0xc1dc('0x146'),'foreignKey':_0xc1dc('0x142')});db[_0xc1dc('0x127')][_0xc1dc('0x147')](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db[_0xc1dc('0x127')][_0xc1dc('0x147')](db[_0xc1dc('0x2d')],{'as':_0xc1dc('0x148'),'foreignKey':'TrunkBackupId'});db['VoiceQueue']['belongsTo'](db[_0xc1dc('0x149')],{'as':'Interval','foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x127')]['belongsTo'](db[_0xc1dc('0x8f')],{'as':_0xc1dc('0x14b'),'foreignKey':_0xc1dc('0x14c')});db[_0xc1dc('0x127')][_0xc1dc('0x11b')](db['CmList'],{'as':_0xc1dc('0x11f'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x32')});db[_0xc1dc('0x127')][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'as':_0xc1dc('0x14e'),'through':_0xc1dc('0x14f')});db[_0xc1dc('0x127')][_0xc1dc('0x11b')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x150'),'through':_0xc1dc('0x151')});db['VoiceRecording']['belongsTo'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x13'),'foreignKey':_0xc1dc('0x10f')});db['ScreenRecording'][_0xc1dc('0x147')](db['User'],{'as':_0xc1dc('0x13'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x21')][_0xc1dc('0x110')](db['VoiceMailMessage'],{'as':_0xc1dc('0x152'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0xc1dc('0x153')});db[_0xc1dc('0x154')]['belongsTo'](db[_0xc1dc('0x21')],{'foreignKey':_0xc1dc('0x155'),'targetKey':_0xc1dc('0x153')});db[_0xc1dc('0x24')][_0xc1dc('0x110')](db[_0xc1dc('0x29')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0xc1dc('0x24')][_0xc1dc('0x110')](db[_0xc1dc('0x28')],{'as':'AgentReports','foreignKey':_0xc1dc('0x156'),'constraints':![]});db[_0xc1dc('0x24')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x13'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xc1dc('0x147')](db['CmContact'],{'as':'Contact','foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x3d')][_0xc1dc('0x147')](db[_0xc1dc('0x41')],{'as':_0xc1dc('0x41'),'foreignKey':_0xc1dc('0x158')});db[_0xc1dc('0x3f')][_0xc1dc('0x147')](db[_0xc1dc('0x41')],{'as':_0xc1dc('0x41'),'foreignKey':_0xc1dc('0x158')});db[_0xc1dc('0x41')][_0xc1dc('0x159')](db[_0xc1dc('0x3d')],{'as':_0xc1dc('0x15a'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x41')][_0xc1dc('0x159')](db[_0xc1dc('0x3f')],{'as':_0xc1dc('0x15b'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x41')][_0xc1dc('0x110')](db[_0xc1dc('0x8c')],{'as':_0xc1dc('0x15c'),'foreignKey':'MailAccountId'});db[_0xc1dc('0x41')][_0xc1dc('0x110')](db[_0xc1dc('0x8a')],{'as':_0xc1dc('0x15d'),'foreignKey':'MailAccountId'});db[_0xc1dc('0x41')][_0xc1dc('0x110')](db[_0xc1dc('0x49')],{'as':_0xc1dc('0x152'),'foreignKey':'MailAccountId'});db[_0xc1dc('0x41')][_0xc1dc('0x110')](db['MailInteraction'],{'as':_0xc1dc('0x15e')});db[_0xc1dc('0x41')][_0xc1dc('0x110')](db[_0xc1dc('0x15f')],{'as':_0xc1dc('0x13e')});db[_0xc1dc('0x41')][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db['MailAccount']['belongsTo'](db[_0xc1dc('0x162')],{'as':'Template','foreignKey':_0xc1dc('0x163')});db['MailAccount'][_0xc1dc('0x147')](db[_0xc1dc('0x8f')],{'as':_0xc1dc('0x14b'),'foreignKey':_0xc1dc('0x14c')});db[_0xc1dc('0x41')][_0xc1dc('0x11b')](db['User'],{'as':'Agents','through':'user_has_mail_accounts'});db['MailQueue']['belongsToMany'](db['User'],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x36')});db[_0xc1dc('0x43')][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'through':'team_has_mail_queues','as':_0xc1dc('0x14e')});db[_0xc1dc('0x47')][_0xc1dc('0x110')](db[_0xc1dc('0x49')],{'as':_0xc1dc('0x152'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x164')});db[_0xc1dc('0x47')][_0xc1dc('0x147')](db[_0xc1dc('0x41')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x158')});db[_0xc1dc('0x47')]['belongsTo'](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x47')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x167'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x47')][_0xc1dc('0x11b')](db['Tag'],{'through':_0xc1dc('0x168'),'as':_0xc1dc('0x169')});db[_0xc1dc('0x47')]['belongsToMany'](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x168'),'as':_0xc1dc('0x16a')});db[_0xc1dc('0x47')]['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db['MailMessage'][_0xc1dc('0x110')](db[_0xc1dc('0xed')],{'as':_0xc1dc('0x16c'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x49')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':'User'});db[_0xc1dc('0x49')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'onDelete':'cascade','as':'Contact'});db['MailMessage'][_0xc1dc('0x147')](db['MailInteraction'],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xc1dc('0x49')]['belongsTo'](db['MailAccount'],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x158')});db['MailApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x15f')][_0xc1dc('0x147')](db['MailQueue'],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x15f')]['belongsTo'](db[_0xc1dc('0x41')],{'onDelete':'restrict'});db[_0xc1dc('0x15f')][_0xc1dc('0x147')](db['Interval'],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x15f')][_0xc1dc('0x147')](db[_0xc1dc('0x97')],{'onDelete':'restrict','foreignKey':_0xc1dc('0x16e')});db[_0xc1dc('0x4b')][_0xc1dc('0x147')](db['MailAccount'],{});db[_0xc1dc('0x4b')][_0xc1dc('0x147')](db['CmList'],{'as':'List','foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x4b')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x4b')]['belongsTo'](db[_0xc1dc('0x47')],{});db['MailQueueReport']['belongsTo'](db[_0xc1dc('0x49')],{});db['MailQueueReport'][_0xc1dc('0x147')](db['User'],{});db[_0xc1dc('0x4b')][_0xc1dc('0x147')](db[_0xc1dc('0x43')],{});db[_0xc1dc('0x16f')]['hasMany'](db['DashboardItem'],{'as':_0xc1dc('0x170'),'onDelete':_0xc1dc('0x10e')});db['FaxAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x8c')],{'as':_0xc1dc('0x15c'),'foreignKey':'FaxAccountId'});db[_0xc1dc('0x4f')]['hasMany'](db[_0xc1dc('0x8a')],{'as':_0xc1dc('0x15d'),'foreignKey':_0xc1dc('0x171')});db[_0xc1dc('0x4f')][_0xc1dc('0x110')](db[_0xc1dc('0x53')],{'as':'Interactions'});db[_0xc1dc('0x4f')][_0xc1dc('0x110')](db[_0xc1dc('0x51')],{'as':_0xc1dc('0x13e')});db[_0xc1dc('0x4f')][_0xc1dc('0x110')](db[_0xc1dc('0x18')],{'as':_0xc1dc('0x172'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x4f')][_0xc1dc('0x110')](db[_0xc1dc('0x55')],{'as':_0xc1dc('0x152')});db[_0xc1dc('0x4f')][_0xc1dc('0x147')](db[_0xc1dc('0x2d')],{'as':'Trunk'});db[_0xc1dc('0x4f')][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':'List','foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x4f')][_0xc1dc('0x147')](db[_0xc1dc('0x8f')],{'as':'mandatoryDispositionPause','foreignKey':_0xc1dc('0x14c')});db[_0xc1dc('0x4f')][_0xc1dc('0x11b')](db['User'],{'as':'Agents','through':_0xc1dc('0x135')});db['FaxApplication']['belongsTo'](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x51')][_0xc1dc('0x147')](db[_0xc1dc('0x12a')],{'onDelete':_0xc1dc('0x16d')});db['FaxApplication']['belongsTo'](db[_0xc1dc('0x4f')],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x51')][_0xc1dc('0x147')](db[_0xc1dc('0x97')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x16e')});db['FaxInteraction']['hasMany'](db[_0xc1dc('0x55')],{'as':_0xc1dc('0x152'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x173')});db['FaxInteraction'][_0xc1dc('0x147')](db[_0xc1dc('0x4f')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x171')});db['FaxInteraction']['belongsTo'](db[_0xc1dc('0x7c')],{'as':'Contact','foreignKey':_0xc1dc('0x157')});db['FaxInteraction'][_0xc1dc('0x147')](db['User'],{'as':_0xc1dc('0x167'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x53')][_0xc1dc('0x11b')](db['Tag'],{'through':_0xc1dc('0x174'),'as':_0xc1dc('0x169')});db[_0xc1dc('0x53')][_0xc1dc('0x11b')](db['Tag'],{'through':_0xc1dc('0x174'),'as':_0xc1dc('0x16a')});db['FaxInteraction']['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':_0xc1dc('0x125'),'foreignKey':'FaxInteractionId'});db[_0xc1dc('0x55')]['belongsTo'](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x10e'),'as':_0xc1dc('0x13')});db['FaxMessage']['belongsTo'](db[_0xc1dc('0x53')],{'as':'Interaction','foreignKey':_0xc1dc('0x173')});db[_0xc1dc('0x55')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'onDelete':_0xc1dc('0x10e'),'as':_0xc1dc('0x166')});db['FaxMessage'][_0xc1dc('0x147')](db['Attachment'],{'as':_0xc1dc('0xed'),'foreignKey':_0xc1dc('0x175')});db['FaxMessage'][_0xc1dc('0x147')](db[_0xc1dc('0x4f')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x171')});db[_0xc1dc('0x12a')][_0xc1dc('0x11b')](db['User'],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x12c')});db[_0xc1dc('0x12a')][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'through':'team_has_fax_queues','as':_0xc1dc('0x14e')});db[_0xc1dc('0x58')][_0xc1dc('0x147')](db[_0xc1dc('0x4f')],{});db[_0xc1dc('0x58')][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db['FaxQueueReport'][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x58')][_0xc1dc('0x147')](db[_0xc1dc('0x53')],{});db[_0xc1dc('0x58')][_0xc1dc('0x147')](db['FaxMessage'],{});db['FaxQueueReport'][_0xc1dc('0x147')](db['User'],{});db[_0xc1dc('0x58')][_0xc1dc('0x147')](db[_0xc1dc('0x12a')],{});db[_0xc1dc('0x5a')]['hasMany'](db[_0xc1dc('0x8c')],{'as':_0xc1dc('0x15c'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x8a')],{'as':_0xc1dc('0x15d'),'foreignKey':'SmsAccountId'});db[_0xc1dc('0x5a')][_0xc1dc('0x110')](db[_0xc1dc('0x176')],{'as':_0xc1dc('0x152'),'foreignKey':'SmsAccountId'});db[_0xc1dc('0x5a')][_0xc1dc('0x110')](db[_0xc1dc('0x5e')],{'as':_0xc1dc('0x15e')});db['SmsAccount'][_0xc1dc('0x110')](db['SmsApplication'],{'as':_0xc1dc('0x13e')});db[_0xc1dc('0x5a')]['belongsTo'](db[_0xc1dc('0xf7')],{'as':'List','foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x5a')][_0xc1dc('0x147')](db['Pause'],{'as':_0xc1dc('0x14b'),'foreignKey':_0xc1dc('0x14c')});db['SmsAccount'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x16d')});db['SmsApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x61')],{'onDelete':'restrict'});db[_0xc1dc('0x5c')][_0xc1dc('0x147')](db[_0xc1dc('0x5a')],{'onDelete':'restrict'});db[_0xc1dc('0x5c')][_0xc1dc('0x147')](db['Interval'],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x5c')]['belongsTo'](db[_0xc1dc('0x97')],{'onDelete':'restrict','foreignKey':_0xc1dc('0x16e')});db[_0xc1dc('0x5e')][_0xc1dc('0x110')](db[_0xc1dc('0x176')],{'as':_0xc1dc('0x152'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'SmsInteractionId'});db[_0xc1dc('0x5e')]['belongsTo'](db[_0xc1dc('0x5a')],{'as':'Account','foreignKey':_0xc1dc('0x177')});db[_0xc1dc('0x5e')]['belongsTo'](db['CmContact'],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x5e')][_0xc1dc('0x147')](db['User'],{'as':_0xc1dc('0x167'),'foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x5e')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x178'),'as':'Tags'});db[_0xc1dc('0x5e')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xc1dc('0x5e')][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':'Users','through':_0xc1dc('0x126'),'foreignKey':_0xc1dc('0x179')});db[_0xc1dc('0x176')][_0xc1dc('0x147')](db['User'],{'as':_0xc1dc('0x13')});db['SmsMessage'][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'onDelete':_0xc1dc('0x10e'),'as':_0xc1dc('0x166')});db[_0xc1dc('0x176')][_0xc1dc('0x147')](db[_0xc1dc('0x5e')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xc1dc('0x179')});db[_0xc1dc('0x176')]['belongsTo'](db[_0xc1dc('0x5a')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x177')});db[_0xc1dc('0x61')][_0xc1dc('0x11b')](db['User'],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xc1dc('0x17a')});db[_0xc1dc('0x61')][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'through':_0xc1dc('0x17b'),'as':_0xc1dc('0x14e')});db[_0xc1dc('0x138')][_0xc1dc('0x110')](db['Disposition'],{'as':_0xc1dc('0x15c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x8a')],{'as':_0xc1dc('0x15d'),'foreignKey':'OpenchannelAccountId'});db[_0xc1dc('0x138')][_0xc1dc('0x110')](db[_0xc1dc('0x66')],{'as':_0xc1dc('0x15e'),'foreignKey':_0xc1dc('0x17c')});db['OpenchannelAccount'][_0xc1dc('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0xc1dc('0x138')][_0xc1dc('0x110')](db[_0xc1dc('0x64')],{'as':_0xc1dc('0x13e'),'foreignKey':'OpenchannelAccountId'});db[_0xc1dc('0x138')][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':'List','foreignKey':'ListId'});db[_0xc1dc('0x138')][_0xc1dc('0x147')](db[_0xc1dc('0x8f')],{'as':_0xc1dc('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc1dc('0x138')][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x17d')});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xc1dc('0x16d')});db['OpenchannelApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x12e')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x17e')});db[_0xc1dc('0x64')]['belongsTo'](db[_0xc1dc('0x138')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0xc1dc('0x64')][_0xc1dc('0x147')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xc1dc('0x14a')});db['OpenchannelApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x97')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x16e')});db[_0xc1dc('0x66')][_0xc1dc('0x110')](db[_0xc1dc('0x67')],{'as':_0xc1dc('0x152'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x17f')});db[_0xc1dc('0x66')][_0xc1dc('0x147')](db[_0xc1dc('0x138')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xc1dc('0x66')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x66')][_0xc1dc('0x147')](db['User'],{'as':'Owner','foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x66')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x180'),'as':'Tags'});db[_0xc1dc('0x66')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x180'),'as':_0xc1dc('0x16a')});db['OpenchannelInteraction']['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':_0xc1dc('0x181'),'foreignKey':_0xc1dc('0x17f')});db[_0xc1dc('0x67')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x10e'),'as':'User'});db[_0xc1dc('0x67')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'onDelete':'cascade','as':_0xc1dc('0x166')});db['OpenchannelMessage']['belongsTo'](db[_0xc1dc('0x66')],{'onDelete':_0xc1dc('0x10e'),'as':'Interaction','foreignKey':_0xc1dc('0x17f')});db[_0xc1dc('0x67')]['belongsTo'](db[_0xc1dc('0xed')],{'as':_0xc1dc('0xed'),'foreignKey':_0xc1dc('0x175')});db['OpenchannelMessage'][_0xc1dc('0x147')](db[_0xc1dc('0x138')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x17c')});db['OpenchannelQueue'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x39'),'foreignKey':'OpenchannelQueueId'});db[_0xc1dc('0x12e')]['belongsToMany'](db[_0xc1dc('0xe7')],{'through':_0xc1dc('0x182'),'as':_0xc1dc('0x14e')});db['ChatWebsite'][_0xc1dc('0x110')](db[_0xc1dc('0x8c')],{'as':_0xc1dc('0x15c'),'foreignKey':_0xc1dc('0x183')});db[_0xc1dc('0x6a')][_0xc1dc('0x110')](db[_0xc1dc('0x8a')],{'as':_0xc1dc('0x15d'),'foreignKey':_0xc1dc('0x183')});db[_0xc1dc('0x6a')][_0xc1dc('0x110')](db[_0xc1dc('0x79')],{'as':_0xc1dc('0x184')});db[_0xc1dc('0x6a')][_0xc1dc('0x110')](db[_0xc1dc('0x70')],{'as':'Interactions'});db[_0xc1dc('0x6a')][_0xc1dc('0x110')](db[_0xc1dc('0x6e')],{'as':_0xc1dc('0x13e')});db[_0xc1dc('0x6a')][_0xc1dc('0x110')](db[_0xc1dc('0x72')],{'as':_0xc1dc('0x152')});db['ChatWebsite'][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x6a')]['belongsTo'](db[_0xc1dc('0x149')],{'as':'Interval','foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x6a')][_0xc1dc('0x147')](db[_0xc1dc('0x8f')],{'as':_0xc1dc('0x14b'),'foreignKey':_0xc1dc('0x14c')});db['ChatWebsite'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xc1dc('0x6c')][_0xc1dc('0x147')](db['OpenchannelAccount'],{});db[_0xc1dc('0x6c')][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db['OpenchannelQueueReport'][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x6c')][_0xc1dc('0x147')](db['OpenchannelInteraction'],{});db[_0xc1dc('0x6c')]['belongsTo'](db[_0xc1dc('0x67')],{});db[_0xc1dc('0x6c')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{});db[_0xc1dc('0x6c')][_0xc1dc('0x147')](db[_0xc1dc('0x12e')],{});db[_0xc1dc('0x6e')]['belongsTo'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x185'),'foreignKey':_0xc1dc('0x10f'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x6e')][_0xc1dc('0x147')](db[_0xc1dc('0x75')],{'as':'Queue','foreignKey':_0xc1dc('0x186'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x6e')][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'as':_0xc1dc('0x187'),'foreignKey':_0xc1dc('0x183'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x6e')][_0xc1dc('0x147')](db[_0xc1dc('0x97')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x16e')});db[_0xc1dc('0x70')][_0xc1dc('0x110')](db[_0xc1dc('0x72')],{'as':_0xc1dc('0x152'),'onDelete':'cascade','foreignKey':_0xc1dc('0x188')});db[_0xc1dc('0x70')][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x183')});db[_0xc1dc('0x70')][_0xc1dc('0x147')](db['CmContact'],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x70')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':'Owner','foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x70')][_0xc1dc('0x11b')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xc1dc('0x169')});db['ChatInteraction'][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':'chat_interaction_has_tags','as':_0xc1dc('0x16a')});db[_0xc1dc('0x70')][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':_0xc1dc('0x124'),'foreignKey':_0xc1dc('0x188')});db[_0xc1dc('0x72')]['belongsTo'](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x10e'),'as':_0xc1dc('0x13')});db[_0xc1dc('0x72')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'onDelete':'cascade','as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x72')]['belongsTo'](db[_0xc1dc('0x70')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xc1dc('0x175')});db[_0xc1dc('0x72')][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'as':'Account','foreignKey':_0xc1dc('0x183')});db[_0xc1dc('0x74')]['belongsTo'](db[_0xc1dc('0x7c')],{'onDelete':_0xc1dc('0x10e'),'as':_0xc1dc('0x166'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x183')});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0xc1dc('0x14d'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'through':_0xc1dc('0x189'),'as':_0xc1dc('0x14e')});db['ChatGroup'][_0xc1dc('0x110')](db[_0xc1dc('0x18a')],{'as':'Messages','foreignKey':_0xc1dc('0x18b'),'onDelete':'cascade'});db[_0xc1dc('0x77')]['belongsToMany'](db[_0xc1dc('0x13')],{'as':'Members','through':_0xc1dc('0x18c')});db['ChatProactiveAction'][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'as':_0xc1dc('0x187'),'foreignKey':_0xc1dc('0x183')});db[_0xc1dc('0x18d')][_0xc1dc('0x110')](db['CmContact'],{'as':_0xc1dc('0x11d'),'foreignKey':'CompanyId'});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db[_0xc1dc('0x7d')],{'as':_0xc1dc('0x143'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x7c')]['hasMany'](db[_0xc1dc('0x80')],{'as':'HopperFinals','foreignKey':_0xc1dc('0x157')});db['CmContact'][_0xc1dc('0x110')](db['CmHopperHistory'],{'as':_0xc1dc('0x144'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db[_0xc1dc('0x84')],{'as':_0xc1dc('0x84'),'foreignKey':'ContactId'});db[_0xc1dc('0x7c')]['hasMany'](db[_0xc1dc('0x18e')],{'as':_0xc1dc('0x146'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db[_0xc1dc('0x66')],{'as':_0xc1dc('0x113'),'foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db['ChatInteraction'],{'as':_0xc1dc('0x123'),'foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db[_0xc1dc('0x5e')],{'as':_0xc1dc('0x114'),'foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x7c')]['hasMany'](db[_0xc1dc('0x53')],{'as':_0xc1dc('0x115'),'foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x7c')][_0xc1dc('0x110')](db['MailInteraction'],{'as':_0xc1dc('0x116'),'foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x7c')][_0xc1dc('0x147')](db[_0xc1dc('0x18d')],{'as':_0xc1dc('0x18f'),'foreignKey':_0xc1dc('0x190')});db[_0xc1dc('0x7c')][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x7c')]['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':_0xc1dc('0x11e')});db[_0xc1dc('0x7c')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'as':_0xc1dc('0x169'),'through':_0xc1dc('0x191')});db[_0xc1dc('0x7c')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':'cm_contact_has_tags','as':_0xc1dc('0x16a')});db['CmHopper'][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':'ContactId','onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x7d')][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161'),'onDelete':'cascade'});db[_0xc1dc('0x7d')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':'Agent','foreignKey':_0xc1dc('0x10f')});db[_0xc1dc('0x7d')][_0xc1dc('0x147')](db[_0xc1dc('0x127')],{'as':_0xc1dc('0x192'),'foreignKey':_0xc1dc('0x142'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x7d')]['belongsTo'](db[_0xc1dc('0x193')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xc1dc('0x10e')});db['CmHopper'][_0xc1dc('0x147')](db['User'],{'as':'Owner','foreignKey':_0xc1dc('0x194')});db[_0xc1dc('0x7e')]['belongsTo'](db[_0xc1dc('0x7c')],{'as':'Contact','foreignKey':_0xc1dc('0x157'),'onDelete':_0xc1dc('0x10e')});db['CmHopperBlack'][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':'List','foreignKey':_0xc1dc('0x161'),'onDelete':'cascade'});db[_0xc1dc('0x7e')][_0xc1dc('0x147')](db[_0xc1dc('0x127')],{'as':_0xc1dc('0x192'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xc1dc('0x7e')][_0xc1dc('0x147')](db[_0xc1dc('0x193')],{'as':_0xc1dc('0x193'),'foreignKey':_0xc1dc('0x195'),'onDelete':'cascade'});db['Automation']['hasMany'](db[_0xc1dc('0x196')],{'as':{'plural':_0xc1dc('0x197'),'singular':_0xc1dc('0x198')},'foreignKey':'AutomationAllId','onDelete':_0xc1dc('0x10e'),'hooks':!![]});db['Automation'][_0xc1dc('0x110')](db[_0xc1dc('0x196')],{'as':{'plural':_0xc1dc('0x199'),'singular':'OneAny'},'foreignKey':_0xc1dc('0x19a'),'onDelete':'cascade','hooks':!![]});db[_0xc1dc('0x88')][_0xc1dc('0x110')](db['Action'],{'as':'Actions','foreignKey':_0xc1dc('0x19b'),'onDelete':'cascade','hooks':!![]});db[_0xc1dc('0x149')][_0xc1dc('0x110')](db[_0xc1dc('0x149')],{'as':_0xc1dc('0x19c'),'foreignKey':_0xc1dc('0x14a'),'onDelete':_0xc1dc('0x10e'),'hooks':!![],'required':![]});db[_0xc1dc('0x149')][_0xc1dc('0x110')](db[_0xc1dc('0x18')],{'as':_0xc1dc('0x112'),'foreignKey':_0xc1dc('0x14a'),'onDelete':'restrict'});db[_0xc1dc('0x149')][_0xc1dc('0x110')](db['MailApplication'],{'as':_0xc1dc('0x19d'),'foreignKey':_0xc1dc('0x14a')});db['Interval']['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xc1dc('0x149')]['hasMany'](db[_0xc1dc('0x51')],{'as':_0xc1dc('0x19e'),'foreignKey':_0xc1dc('0x14a')});db['Interval'][_0xc1dc('0x110')](db[_0xc1dc('0x5c')],{'as':'SmsApplications','foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x94')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0xc1dc('0x147')](db['AnalyticDefaultReport'],{'foreignKey':_0xc1dc('0x19f')});db['Schedule'][_0xc1dc('0x147')](db[_0xc1dc('0x1a0')],{'foreignKey':'CustomReportId'});db[_0xc1dc('0x95')]['belongsToMany'](db[_0xc1dc('0x1a')],{'as':_0xc1dc('0x1a1'),'through':_0xc1dc('0x140'),'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db[_0xc1dc('0x7c')],{'through':_0xc1dc('0x191')});db[_0xc1dc('0x97')]['belongsToMany'](db['ChatInteraction'],{'through':_0xc1dc('0x1a2')});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db[_0xc1dc('0x5e')],{'through':_0xc1dc('0x178')});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db[_0xc1dc('0x53')],{'through':_0xc1dc('0x174')});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db['OpenchannelInteraction'],{'through':_0xc1dc('0x180')});db[_0xc1dc('0x97')][_0xc1dc('0x11b')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0xc1dc('0x9a')][_0xc1dc('0x110')](db[_0xc1dc('0x196')],{'as':{'plural':_0xc1dc('0x1a3'),'singular':_0xc1dc('0x1a4')},'foreignKey':_0xc1dc('0x1a5'),'onDelete':_0xc1dc('0x10e'),'hooks':!![]});db['Trigger'][_0xc1dc('0x110')](db[_0xc1dc('0x196')],{'as':{'plural':_0xc1dc('0x1a6'),'singular':_0xc1dc('0x1a7')},'foreignKey':_0xc1dc('0x1a8'),'onDelete':_0xc1dc('0x10e'),'hooks':!![]});db[_0xc1dc('0x9a')][_0xc1dc('0x110')](db[_0xc1dc('0x86')],{'as':_0xc1dc('0x1a9'),'foreignKey':'TriggerId','onDelete':_0xc1dc('0x10e'),'hooks':!![]});db[_0xc1dc('0x1a0')][_0xc1dc('0x110')](db[_0xc1dc('0x1aa')],{'as':_0xc1dc('0x1ab'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1ac'),'hooks':!![]});db[_0xc1dc('0xa1')][_0xc1dc('0x110')](db[_0xc1dc('0x1aa')],{'as':'Fields','onDelete':_0xc1dc('0x10e'),'foreignKey':'DefaultReportId'});db[_0xc1dc('0x1ad')][_0xc1dc('0x110')](db[_0xc1dc('0x1aa')],{'as':'Fields','onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1ae')});db[_0xc1dc('0x1aa')]['belongsTo'](db[_0xc1dc('0x1ad')],{'foreignKey':'MetricId'});db['SalesforceAccount']['hasMany'](db[_0xc1dc('0xaa')],{'as':_0xc1dc('0x1af'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xaa')][_0xc1dc('0x110')](db[_0xc1dc('0xac')],{'as':'Subjects','onDelete':_0xc1dc('0x10e'),'foreignKey':'SubjectId'});db['SalesforceConfiguration']['hasMany'](db[_0xc1dc('0xac')],{'as':'Descriptions','onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xaa')][_0xc1dc('0x110')](db['SalesforceField'],{'as':_0xc1dc('0x1ab'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'FieldId'});db[_0xc1dc('0xaa')]['belongsTo'](db[_0xc1dc('0xa8')],{'as':'Account','foreignKey':_0xc1dc('0x1b0')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0xc1dc('0x1b2'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xac')]['hasMany'](db[_0xc1dc('0xac')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xac')]['hasMany'](db[_0xc1dc('0xac')],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db['SalesforceField'][_0xc1dc('0x147')](db[_0xc1dc('0x9c')],{'as':_0xc1dc('0x9c'),'foreignKey':'VariableId'});db[_0xc1dc('0xae')]['hasMany'](db[_0xc1dc('0x1b7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc1dc('0x1b0')});db['SugarcrmConfiguration'][_0xc1dc('0x110')](db[_0xc1dc('0x1b8')],{'as':_0xc1dc('0x1b9'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0x1b7')][_0xc1dc('0x110')](db[_0xc1dc('0x1b8')],{'as':_0xc1dc('0x1ba'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'DescriptionId'});db[_0xc1dc('0x1b7')][_0xc1dc('0x110')](db[_0xc1dc('0x1b8')],{'as':_0xc1dc('0x1ab'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0x1b7')][_0xc1dc('0x147')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0x1b8')]['hasMany'](db[_0xc1dc('0x1b8')],{'as':'Subject','foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0x1b8')][_0xc1dc('0x110')](db[_0xc1dc('0x1b8')],{'as':_0xc1dc('0x1b4'),'foreignKey':'DescriptionId'});db[_0xc1dc('0x1b8')][_0xc1dc('0x110')](db[_0xc1dc('0x1b8')],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0x1b8')][_0xc1dc('0x147')](db['Variable'],{'as':_0xc1dc('0x9c'),'foreignKey':_0xc1dc('0x1bb')});db['DeskAccount']['hasMany'](db['DeskConfiguration'],{'as':_0xc1dc('0x1af'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xc1dc('0xb2')]['hasMany'](db[_0xc1dc('0x1bc')],{'as':_0xc1dc('0x1b9'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'SubjectId'});db[_0xc1dc('0xb2')][_0xc1dc('0x110')](db[_0xc1dc('0x1bc')],{'as':_0xc1dc('0x1ba'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xb2')]['hasMany'](db['DeskField'],{'as':_0xc1dc('0x1ab'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xb2')][_0xc1dc('0x147')](db[_0xc1dc('0xb1')],{'as':'Account','foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xb2')][_0xc1dc('0x11b')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xc1dc('0x1bc')]['hasMany'](db[_0xc1dc('0x1bc')],{'as':_0xc1dc('0x1b2'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0x1bc')]['hasMany'](db[_0xc1dc('0x1bc')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0x1bc')][_0xc1dc('0x110')](db[_0xc1dc('0x1bc')],{'as':'Field','foreignKey':'FieldId'});db[_0xc1dc('0x1bc')][_0xc1dc('0x147')](db['Variable'],{'as':_0xc1dc('0x9c'),'foreignKey':_0xc1dc('0x1bb')});db['ZohoAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x1bd')],{'as':_0xc1dc('0x1af'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0x1bd')][_0xc1dc('0x110')](db[_0xc1dc('0xb7')],{'as':_0xc1dc('0x1b9'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1b3')});db['ZohoConfiguration'][_0xc1dc('0x110')](db[_0xc1dc('0xb7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xc1dc('0x1b1')});db['ZohoConfiguration'][_0xc1dc('0x110')](db['ZohoField'],{'as':_0xc1dc('0x1ab'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0x1bd')][_0xc1dc('0x147')](db[_0xc1dc('0xb4')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xb7')][_0xc1dc('0x110')](db[_0xc1dc('0xb7')],{'as':'Subject','foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xb7')][_0xc1dc('0x110')](db[_0xc1dc('0xb7')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xb7')][_0xc1dc('0x110')](db[_0xc1dc('0xb7')],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db['ZohoField'][_0xc1dc('0x147')](db[_0xc1dc('0x9c')],{'as':_0xc1dc('0x9c'),'foreignKey':_0xc1dc('0x1bb')});db[_0xc1dc('0x1be')]['hasMany'](db[_0xc1dc('0xba')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc1dc('0x1b0')});db['ZendeskConfiguration'][_0xc1dc('0x110')](db[_0xc1dc('0xbc')],{'as':'Subjects','foreignKey':_0xc1dc('0x1b3')});db['ZendeskConfiguration'][_0xc1dc('0x110')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xba')][_0xc1dc('0x110')](db[_0xc1dc('0xbc')],{'as':_0xc1dc('0x1ab'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xba')][_0xc1dc('0x147')](db['ZendeskAccount'],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xba')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x1bf')});db['ZendeskField'][_0xc1dc('0x110')](db['ZendeskField'],{'as':_0xc1dc('0x1b2'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xbc')][_0xc1dc('0x110')](db[_0xc1dc('0xbc')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xbc')][_0xc1dc('0x110')](db['ZendeskField'],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xbc')][_0xc1dc('0x147')](db['Variable'],{'as':_0xc1dc('0x9c'),'foreignKey':'VariableId'});db[_0xc1dc('0xbe')][_0xc1dc('0x110')](db[_0xc1dc('0xc0')],{'as':_0xc1dc('0x1af'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xc0')]['hasMany'](db[_0xc1dc('0x1c0')],{'as':_0xc1dc('0x1b9'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'SubjectId'});db[_0xc1dc('0xc0')]['hasMany'](db[_0xc1dc('0x1c0')],{'as':_0xc1dc('0x1ba'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xc0')][_0xc1dc('0x110')](db[_0xc1dc('0x1c0')],{'as':_0xc1dc('0x1ab'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xc0')][_0xc1dc('0x147')](db[_0xc1dc('0xbe')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xc0')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x1c1')});db[_0xc1dc('0x1c0')][_0xc1dc('0x110')](db[_0xc1dc('0x1c0')],{'as':_0xc1dc('0x1b2'),'foreignKey':'SubjectId'});db[_0xc1dc('0x1c0')][_0xc1dc('0x110')](db[_0xc1dc('0x1c0')],{'as':_0xc1dc('0x1b4'),'foreignKey':'DescriptionId'});db[_0xc1dc('0x1c0')]['hasMany'](db['FreshdeskField'],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0x1c0')][_0xc1dc('0x147')](db[_0xc1dc('0x9c')],{'as':_0xc1dc('0x9c'),'foreignKey':_0xc1dc('0x1bb')});db[_0xc1dc('0xc3')][_0xc1dc('0x110')](db[_0xc1dc('0xc5')],{'as':_0xc1dc('0x1af'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xc5')]['hasMany'](db[_0xc1dc('0x1c2')],{'as':'Subjects','foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xc5')][_0xc1dc('0x110')](db[_0xc1dc('0x1c2')],{'as':_0xc1dc('0x1ba'),'foreignKey':_0xc1dc('0x1b1')});db['VtigerConfiguration']['hasMany'](db[_0xc1dc('0x1c2')],{'as':_0xc1dc('0x1ab'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xc1dc('0x147')](db[_0xc1dc('0xc3')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0x1c2')][_0xc1dc('0x110')](db[_0xc1dc('0x1c2')],{'as':'Subject','foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0x1c2')][_0xc1dc('0x110')](db[_0xc1dc('0x1c2')],{'as':_0xc1dc('0x1b4'),'foreignKey':'DescriptionId'});db[_0xc1dc('0x1c2')][_0xc1dc('0x110')](db['VtigerField'],{'as':'Field','foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0x1c2')][_0xc1dc('0x147')](db[_0xc1dc('0x9c')],{'as':'Variable','foreignKey':_0xc1dc('0x1bb')});db[_0xc1dc('0x1c3')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xc9')][_0xc1dc('0x110')](db[_0xc1dc('0xcb')],{'as':_0xc1dc('0x1b9'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xc9')][_0xc1dc('0x110')](db[_0xc1dc('0xcb')],{'as':_0xc1dc('0x1ba'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xc9')][_0xc1dc('0x110')](db[_0xc1dc('0xcb')],{'as':_0xc1dc('0x1ab'),'foreignKey':'FieldId'});db[_0xc1dc('0xc9')][_0xc1dc('0x147')](db['ServicenowAccount'],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xcb')]['hasMany'](db[_0xc1dc('0xcb')],{'as':'Subject','foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xcb')][_0xc1dc('0x110')](db[_0xc1dc('0xcb')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db[_0xc1dc('0xcb')]['hasMany'](db[_0xc1dc('0xcb')],{'as':'Field','foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xcb')]['belongsTo'](db[_0xc1dc('0x9c')],{'as':_0xc1dc('0x9c'),'foreignKey':_0xc1dc('0x1bb')});db['Dynamics365Account']['hasMany'](db[_0xc1dc('0x1c4')],{'as':_0xc1dc('0x1af'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0x1c4')][_0xc1dc('0x110')](db[_0xc1dc('0xcf')],{'as':_0xc1dc('0x1b9'),'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0x1c4')]['hasMany'](db[_0xc1dc('0xcf')],{'as':_0xc1dc('0x1ba'),'onDelete':_0xc1dc('0x10e'),'foreignKey':'DescriptionId'});db[_0xc1dc('0x1c4')][_0xc1dc('0x110')](db[_0xc1dc('0xcf')],{'as':'Fields','onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1b6')});db['Dynamics365Configuration'][_0xc1dc('0x147')](db[_0xc1dc('0xcd')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xcf')][_0xc1dc('0x110')](db[_0xc1dc('0xcf')],{'as':_0xc1dc('0x1b2'),'foreignKey':_0xc1dc('0x1b3')});db[_0xc1dc('0xcf')][_0xc1dc('0x110')](db[_0xc1dc('0xcf')],{'as':_0xc1dc('0x1b4'),'foreignKey':'DescriptionId'});db[_0xc1dc('0xcf')]['hasMany'](db[_0xc1dc('0xcf')],{'as':_0xc1dc('0x1b5'),'foreignKey':_0xc1dc('0x1b6')});db[_0xc1dc('0xcf')]['belongsTo'](db[_0xc1dc('0x9c')],{'as':'Variable','foreignKey':'VariableId'});db[_0xc1dc('0xd0')][_0xc1dc('0x110')](db[_0xc1dc('0x1c5')],{'as':_0xc1dc('0x1af'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0x1c5')][_0xc1dc('0x110')](db[_0xc1dc('0xd2')],{'as':'Subjects','foreignKey':_0xc1dc('0x1b3')});db['FreshsalesConfiguration'][_0xc1dc('0x110')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xc1dc('0x1c5')][_0xc1dc('0x110')](db[_0xc1dc('0xd2')],{'as':'Fields','foreignKey':'FieldId'});db[_0xc1dc('0x1c5')]['belongsTo'](db[_0xc1dc('0xd0')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1b0')});db[_0xc1dc('0xd2')][_0xc1dc('0x110')](db['FreshsalesField'],{'as':_0xc1dc('0x1b2'),'foreignKey':_0xc1dc('0x1b3')});db['FreshsalesField'][_0xc1dc('0x110')](db[_0xc1dc('0xd2')],{'as':_0xc1dc('0x1b4'),'foreignKey':_0xc1dc('0x1b1')});db['FreshsalesField']['hasMany'](db[_0xc1dc('0xd2')],{'as':_0xc1dc('0x1b5'),'foreignKey':'FieldId'});db[_0xc1dc('0xd2')][_0xc1dc('0x147')](db[_0xc1dc('0x9c')],{'as':_0xc1dc('0x9c'),'foreignKey':'VariableId'});db[_0xc1dc('0x1c6')][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{});db['ChatQueueReport'][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x1c6')][_0xc1dc('0x147')](db['CmContact'],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db['ChatQueueReport'][_0xc1dc('0x147')](db[_0xc1dc('0x70')],{});db[_0xc1dc('0x1c6')][_0xc1dc('0x147')](db['ChatMessage'],{});db[_0xc1dc('0x1c6')][_0xc1dc('0x147')](db['User'],{});db['ChatQueueReport'][_0xc1dc('0x147')](db[_0xc1dc('0x75')],{});db[_0xc1dc('0x18a')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x10e'),'foreignKey':'FromId'});db[_0xc1dc('0x18a')][_0xc1dc('0x147')](db['User'],{'onDelete':_0xc1dc('0x10e'),'foreignKey':_0xc1dc('0x1c7')});db[_0xc1dc('0x18e')][_0xc1dc('0x110')](db[_0xc1dc('0x1c8')],{'foreignKey':_0xc1dc('0x1c9'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x18e')][_0xc1dc('0x110')](db[_0xc1dc('0xd7')],{'foreignKey':'SessionId','onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db[_0xc1dc('0x5a')],{});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':'ListId'});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db[_0xc1dc('0x5e')],{});db[_0xc1dc('0x1ca')]['belongsTo'](db[_0xc1dc('0x176')],{});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{});db[_0xc1dc('0x1ca')][_0xc1dc('0x147')](db['SmsQueue'],{});db[_0xc1dc('0xde')]['hasMany'](db[_0xc1dc('0x18e')],{'foreignKey':_0xc1dc('0x1cb')});db[_0xc1dc('0xde')][_0xc1dc('0x110')](db['JscriptyQuestionReport'],{'foreignKey':_0xc1dc('0x1cb')});db[_0xc1dc('0xde')][_0xc1dc('0x110')](db[_0xc1dc('0xd7')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xc1dc('0x11b')](db['User'],{'as':_0xc1dc('0x16b'),'through':_0xc1dc('0x13b')});db['Team'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x121')});db['Team'][_0xc1dc('0x11b')](db[_0xc1dc('0x127')],{'through':_0xc1dc('0x14f'),'as':_0xc1dc('0x128')});db[_0xc1dc('0xe7')][_0xc1dc('0x11b')](db['MailQueue'],{'through':_0xc1dc('0x1cc'),'as':_0xc1dc('0x129')});db[_0xc1dc('0xe7')][_0xc1dc('0x11b')](db[_0xc1dc('0x75')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xc1dc('0xe7')][_0xc1dc('0x11b')](db['FaxQueue'],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0xc1dc('0x11b')](db[_0xc1dc('0x61')],{'through':'team_has_sms_queues','as':_0xc1dc('0x12d')});db[_0xc1dc('0xe7')][_0xc1dc('0x11b')](db[_0xc1dc('0x12e')],{'through':_0xc1dc('0x182'),'as':_0xc1dc('0x12f')});db[_0xc1dc('0xe7')][_0xc1dc('0x11b')](db[_0xc1dc('0x10a')],{'through':_0xc1dc('0x1cd'),'as':_0xc1dc('0x130')});db[_0xc1dc('0x193')][_0xc1dc('0x110')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xc1dc('0x193')]['hasMany'](db[_0xc1dc('0x80')],{'as':_0xc1dc('0x1ce'),'foreignKey':_0xc1dc('0x195')});db[_0xc1dc('0x193')][_0xc1dc('0x110')](db['CmHopperHistory'],{'as':_0xc1dc('0x144'),'foreignKey':_0xc1dc('0x195')});db[_0xc1dc('0x193')][_0xc1dc('0x110')](db['CmHopperBlack'],{'as':_0xc1dc('0x145'),'foreignKey':_0xc1dc('0x195')});db[_0xc1dc('0x193')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0xc1dc('0x1cf')});db['Campaign'][_0xc1dc('0x147')](db[_0xc1dc('0x2d')],{'as':_0xc1dc('0x148'),'foreignKey':_0xc1dc('0x1d0')});db[_0xc1dc('0x193')][_0xc1dc('0x147')](db[_0xc1dc('0x149')],{'as':_0xc1dc('0x149'),'foreignKey':'IntervalId'});db[_0xc1dc('0x193')][_0xc1dc('0x147')](db[_0xc1dc('0xe2')],{'as':_0xc1dc('0xe2'),'foreignKey':'SquareProjectId'});db[_0xc1dc('0x193')]['belongsToMany'](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x11f'),'through':_0xc1dc('0x1d1')});db[_0xc1dc('0x193')]['belongsToMany'](db[_0xc1dc('0xf7')],{'as':'BlackLists','through':_0xc1dc('0x1d2')});db[_0xc1dc('0xf0')][_0xc1dc('0x147')](db[_0xc1dc('0x49')],{});db[_0xc1dc('0xf0')]['belongsTo'](db[_0xc1dc('0x47')],{});db['MailTransferReport'][_0xc1dc('0x147')](db[_0xc1dc('0x41')],{'foreignKey':'FromMailAccountId','as':_0xc1dc('0x1d3')});db['MailTransferReport'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d4'),'as':'FromAgent'});db[_0xc1dc('0xf0')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xc1dc('0xf0')][_0xc1dc('0x147')](db[_0xc1dc('0x43')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0xc1dc('0xf0')][_0xc1dc('0x147')](db[_0xc1dc('0x41')],{'foreignKey':_0xc1dc('0x1d5'),'as':_0xc1dc('0x1d6')});db[_0xc1dc('0xf2')][_0xc1dc('0x147')](db[_0xc1dc('0x72')],{});db['ChatTransferReport'][_0xc1dc('0x147')](db['ChatInteraction'],{});db[_0xc1dc('0xf2')][_0xc1dc('0x147')](db[_0xc1dc('0x6a')],{'foreignKey':_0xc1dc('0x1d7'),'as':_0xc1dc('0x1d3')});db['ChatTransferReport'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d4'),'as':_0xc1dc('0x1d8')});db['ChatTransferReport'][_0xc1dc('0x147')](db['User'],{'foreignKey':_0xc1dc('0x1d9'),'as':_0xc1dc('0x1da')});db['ChatTransferReport'][_0xc1dc('0x147')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0xc1dc('0x1db')});db[_0xc1dc('0xf2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0xc1dc('0x1d6')});db['FaxTransferReport']['belongsTo'](db[_0xc1dc('0x55')],{});db[_0xc1dc('0x1dc')][_0xc1dc('0x147')](db[_0xc1dc('0x53')],{});db[_0xc1dc('0x1dc')][_0xc1dc('0x147')](db[_0xc1dc('0x4f')],{'foreignKey':_0xc1dc('0x1dd'),'as':'FromAccount'});db[_0xc1dc('0x1dc')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d4'),'as':'FromAgent'});db[_0xc1dc('0x1dc')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d9'),'as':_0xc1dc('0x1da')});db[_0xc1dc('0x1dc')][_0xc1dc('0x147')](db['FaxQueue'],{'foreignKey':_0xc1dc('0x1de'),'as':_0xc1dc('0x1db')});db['FaxTransferReport']['belongsTo'](db[_0xc1dc('0x4f')],{'foreignKey':'ToFaxAccountId','as':_0xc1dc('0x1d6')});db[_0xc1dc('0xf5')][_0xc1dc('0x147')](db[_0xc1dc('0x67')],{});db[_0xc1dc('0xf5')][_0xc1dc('0x147')](db[_0xc1dc('0x66')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xc1dc('0x138')],{'foreignKey':_0xc1dc('0x1df'),'as':_0xc1dc('0x1d3')});db['OpenchannelTransferReport'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d4'),'as':_0xc1dc('0x1d8')});db[_0xc1dc('0xf5')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d9'),'as':_0xc1dc('0x1da')});db[_0xc1dc('0xf5')]['belongsTo'](db[_0xc1dc('0x12e')],{'foreignKey':_0xc1dc('0x1e0'),'as':_0xc1dc('0x1db')});db[_0xc1dc('0xf5')][_0xc1dc('0x147')](db[_0xc1dc('0x138')],{'foreignKey':_0xc1dc('0x1e1'),'as':_0xc1dc('0x1d6')});db[_0xc1dc('0x1e2')][_0xc1dc('0x147')](db[_0xc1dc('0x176')],{});db['SmsTransferReport'][_0xc1dc('0x147')](db[_0xc1dc('0x5e')],{});db[_0xc1dc('0x1e2')][_0xc1dc('0x147')](db[_0xc1dc('0x5a')],{'foreignKey':'FromSmsAccountId','as':_0xc1dc('0x1d3')});db[_0xc1dc('0x1e2')]['belongsTo'](db['User'],{'foreignKey':_0xc1dc('0x1d4'),'as':_0xc1dc('0x1d8')});db[_0xc1dc('0x1e2')][_0xc1dc('0x147')](db['User'],{'foreignKey':_0xc1dc('0x1d9'),'as':'ToAgent'});db[_0xc1dc('0x1e2')][_0xc1dc('0x147')](db[_0xc1dc('0x61')],{'foreignKey':_0xc1dc('0x1e3'),'as':_0xc1dc('0x1db')});db[_0xc1dc('0x1e2')][_0xc1dc('0x147')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xc1dc('0x1d6')});db['CmList'][_0xc1dc('0x110')](db[_0xc1dc('0x8c')],{'as':_0xc1dc('0x15c'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xc1dc('0x1e4')],{'as':_0xc1dc('0x1e5'),'foreignKey':'ListId'});db[_0xc1dc('0xf7')][_0xc1dc('0x110')](db[_0xc1dc('0x7c')],{'as':'Contacts','onDelete':_0xc1dc('0x10e'),'foreignKey':'ListId'});db[_0xc1dc('0xf7')][_0xc1dc('0x110')](db[_0xc1dc('0x80')],{'as':_0xc1dc('0x1ce'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0xf7')][_0xc1dc('0x110')](db[_0xc1dc('0x82')],{'as':_0xc1dc('0x1e6'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0xf7')][_0xc1dc('0x110')](db[_0xc1dc('0x84')],{'as':_0xc1dc('0x84'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0xf7')]['belongsToMany'](db[_0xc1dc('0x127')],{'as':'Queues','through':_0xc1dc('0x1e7')});db['CmList'][_0xc1dc('0x11b')](db['User'],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x120')});db['VoicePrefix'][_0xc1dc('0x110')](db[_0xc1dc('0x18')],{'as':_0xc1dc('0x112'),'onDelete':'cascade'});db[_0xc1dc('0xf9')]['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':'user_has_voice_prefixes'});db[_0xc1dc('0xfb')]['hasMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'foreignKey':'userProfileId'});db['UserProfile'][_0xc1dc('0x110')](db[_0xc1dc('0xfd')],{'as':_0xc1dc('0x1e8'),'foreignKey':'userProfileId','onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0xfd')]['hasMany'](db[_0xc1dc('0x1e9')],{'as':_0xc1dc('0x1ea'),'foreignKey':_0xc1dc('0x1eb'),'onDelete':_0xc1dc('0x10e')});db[_0xc1dc('0x100')][_0xc1dc('0x110')](db[_0xc1dc('0x8c')],{'as':'Dispositions','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x8a')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xc1dc('0x110')](db[_0xc1dc('0x106')],{'as':_0xc1dc('0x152'),'foreignKey':_0xc1dc('0x1ec')});db['WhatsappAccount'][_0xc1dc('0x110')](db['WhatsappInteraction'],{'as':_0xc1dc('0x15e')});db[_0xc1dc('0x100')]['hasMany'](db['WhatsappApplication'],{'as':_0xc1dc('0x13e')});db[_0xc1dc('0x100')][_0xc1dc('0x147')](db[_0xc1dc('0xf7')],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db[_0xc1dc('0x100')][_0xc1dc('0x147')](db[_0xc1dc('0x8f')],{'as':'mandatoryDispositionPause','foreignKey':_0xc1dc('0x14c')});db[_0xc1dc('0x100')]['belongsToMany'](db['User'],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x1ed')});db['WhatsappApplication'][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'onDelete':_0xc1dc('0x16d')});db['WhatsappApplication'][_0xc1dc('0x147')](db['WhatsappQueue'],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x102')][_0xc1dc('0x147')](db[_0xc1dc('0x100')],{'onDelete':_0xc1dc('0x16d')});db[_0xc1dc('0x102')][_0xc1dc('0x147')](db[_0xc1dc('0x149')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x14a')});db[_0xc1dc('0x102')]['belongsTo'](db[_0xc1dc('0x97')],{'onDelete':_0xc1dc('0x16d'),'foreignKey':_0xc1dc('0x16e')});db['WhatsappInteraction'][_0xc1dc('0x110')](db[_0xc1dc('0x106')],{'as':_0xc1dc('0x152'),'onDelete':'cascade','foreignKey':_0xc1dc('0x1ee')});db[_0xc1dc('0x104')][_0xc1dc('0x147')](db[_0xc1dc('0x100')],{'as':_0xc1dc('0x165'),'foreignKey':_0xc1dc('0x1ec')});db[_0xc1dc('0x104')][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x104')][_0xc1dc('0x147')](db['User'],{'as':_0xc1dc('0x167'),'foreignKey':'UserId'});db[_0xc1dc('0x104')][_0xc1dc('0x11b')](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x1ef'),'as':_0xc1dc('0x169')});db[_0xc1dc('0x104')]['belongsToMany'](db[_0xc1dc('0x97')],{'through':_0xc1dc('0x1ef'),'as':_0xc1dc('0x16a')});db[_0xc1dc('0x104')]['belongsToMany'](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x16b'),'through':'user_has_whatsapp_interactions','foreignKey':_0xc1dc('0x1ee')});db[_0xc1dc('0x106')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xc1dc('0x166')});db[_0xc1dc('0x106')][_0xc1dc('0x147')](db[_0xc1dc('0x104')],{'onDelete':'cascade','as':_0xc1dc('0x1f0'),'foreignKey':_0xc1dc('0x1ee')});db['WhatsappMessage'][_0xc1dc('0x147')](db['WhatsappAccount'],{'as':_0xc1dc('0x165'),'foreignKey':'WhatsappAccountId'});db[_0xc1dc('0x108')][_0xc1dc('0x147')](db[_0xc1dc('0x100')],{});db['WhatsappQueueReport'][_0xc1dc('0x147')](db['CmList'],{'as':_0xc1dc('0x160'),'foreignKey':_0xc1dc('0x161')});db['WhatsappQueueReport'][_0xc1dc('0x147')](db[_0xc1dc('0x7c')],{'as':_0xc1dc('0x166'),'foreignKey':_0xc1dc('0x157')});db[_0xc1dc('0x108')][_0xc1dc('0x147')](db[_0xc1dc('0x104')],{});db[_0xc1dc('0x108')][_0xc1dc('0x147')](db[_0xc1dc('0x10a')],{});db[_0xc1dc('0x108')]['belongsTo'](db['WhatsappMessage'],{});db[_0xc1dc('0x108')][_0xc1dc('0x147')](db[_0xc1dc('0x13')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xc1dc('0x106')],{});db[_0xc1dc('0x1f1')]['belongsTo'](db[_0xc1dc('0x104')],{});db[_0xc1dc('0x1f1')][_0xc1dc('0x147')](db['WhatsappAccount'],{'foreignKey':_0xc1dc('0x1f2'),'as':_0xc1dc('0x1d3')});db[_0xc1dc('0x1f1')][_0xc1dc('0x147')](db[_0xc1dc('0x100')],{'foreignKey':_0xc1dc('0x1f3'),'as':'ToAccount'});db[_0xc1dc('0x1f1')][_0xc1dc('0x147')](db[_0xc1dc('0x10a')],{'foreignKey':_0xc1dc('0x1f4'),'as':_0xc1dc('0x1db')});db[_0xc1dc('0x1f1')]['belongsTo'](db[_0xc1dc('0x13')],{'foreignKey':_0xc1dc('0x1d4'),'as':_0xc1dc('0x1d8')});db[_0xc1dc('0x1f1')][_0xc1dc('0x147')](db['User'],{'foreignKey':_0xc1dc('0x1d9'),'as':_0xc1dc('0x1da')});db['WhatsappQueue'][_0xc1dc('0x11b')](db[_0xc1dc('0x13')],{'as':_0xc1dc('0x14d'),'through':_0xc1dc('0x3b'),'foreignKey':_0xc1dc('0x1f5')});db[_0xc1dc('0x10a')][_0xc1dc('0x11b')](db[_0xc1dc('0xe7')],{'through':_0xc1dc('0x1cd'),'as':'Teams'});module[_0xc1dc('0x1f6')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x044a=['Action','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Template','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','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','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','Recordings','VoiceQueuesRt','UserId','hasMany','VoiceExtension','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','Notification','Notifications','SenderId','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteraction','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueue','VoiceQueues','FaxQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','CmHopperHistory','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','team_has_voice_queues','BlackLists','VoiceRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','hasOne','Smtp','Dispositions','Answers','Interactions','List','ListId','Agents','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','restrict','TagId','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','Disposition','SmsAccountId','SmsMessage','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','ChatGroupId','CompanyId','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','OwnerId','Condition','OneAll','AutomationAllId','Automation','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','DefaultReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceConfiguration','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Field','VariableId','Subject','Description','ZendeskConfiguration','FreshdeskField','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','ChatQueues','SmsQueues','team_has_whatsapp_queues','CampaignId','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToAccount','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','sectionId','WhatsappAccountId','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','name','username','password','options','database','User','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x044a,0x173));var _0xa044=function(_0x2a13a0,_0x5d252c){_0x2a13a0=_0x2a13a0-0x0;var _0x3b1778=_0x044a[_0x2a13a0];return _0x3b1778;};'use strict';var path=require(_0xa044('0x0'));var config=require(_0xa044('0x1'));var Sequelize=require(_0xa044('0x2'));var _=require(_0xa044('0x3'));var jstz=require(_0xa044('0x4'));var timezone=jstz[_0xa044('0x5')]();config[_0xa044('0x2')]=_[_0xa044('0x6')](config[_0xa044('0x2')],{'database':_0xa044('0x7'),'username':'xcall','password':_0xa044('0x8'),'options':{'host':_0xa044('0x9'),'port':0xcea,'dialect':_0xa044('0xa'),'dialectOptions':{'charset':_0xa044('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa044('0xc'),'collate':_0xa044('0xd')}}});config[_0xa044('0xe')]=_[_0xa044('0x6')](config['sequelizeHistory'],{'database':_0xa044('0x7'),'username':_0xa044('0xf'),'password':_0xa044('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xa044('0xa'),'dialectOptions':{'charset':_0xa044('0xb')},'logging':![],'timezone':timezone[_0xa044('0x10')](),'define':{'charset':_0xa044('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa044('0x2')]['database'],config['sequelize'][_0xa044('0x11')],config[_0xa044('0x2')][_0xa044('0x12')],config[_0xa044('0x2')][_0xa044('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa044('0xe')][_0xa044('0x14')],config['sequelizeHistory'][_0xa044('0x11')],config['sequelizeHistory'][_0xa044('0x12')],config[_0xa044('0xe')][_0xa044('0x13')])};db[_0xa044('0x15')]=db[_0xa044('0x2')]['import']('../api/user/user.model');db[_0xa044('0x16')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x18'));db[_0xa044('0x19')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db['sequelize'][_0xa044('0x17')](_0xa044('0x1a'));db[_0xa044('0x1b')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x1c'));db['VoiceQueue']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x1d'));db['VoiceRecording']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x1e'));db[_0xa044('0x1f')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x20'));db[_0xa044('0x21')]=db[_0xa044('0x2')]['import']('../api/voiceMail/voiceMail.model');db[_0xa044('0x22')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xa044('0x23')]=db[_0xa044('0x2')]['import'](_0xa044('0x24'));db[_0xa044('0x25')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x26'));db['VoiceAgentReport']=db['sequelize']['import'](_0xa044('0x27'));db[_0xa044('0x28')]=db[_0xa044('0x2')]['import'](_0xa044('0x29'));db[_0xa044('0x2a')]=db['sequelize'][_0xa044('0x17')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0xa044('0x2')]['import'](_0xa044('0x2b'));db[_0xa044('0x2c')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x2d'));db[_0xa044('0x2e')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x2f'));db[_0xa044('0x30')]=db[_0xa044('0x2')]['import'](_0xa044('0x31'));db[_0xa044('0x32')]=db['sequelize']['import'](_0xa044('0x33'));db[_0xa044('0x34')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x35'));db[_0xa044('0x36')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x37'));db[_0xa044('0x38')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/userSmsQueue/userSmsQueue.model');db[_0xa044('0x39')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xa044('0x3a')]=db[_0xa044('0x2')]['import'](_0xa044('0x3b'));db[_0xa044('0x3c')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x3d'));db[_0xa044('0x3e')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/mailServerOut/mailServerOut.model');db[_0xa044('0x3f')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x40'));db[_0xa044('0x41')]=db['sequelize'][_0xa044('0x17')]('../api/mailQueue/mailQueue.model');db[_0xa044('0x42')]=db[_0xa044('0x2')]['import']('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x43'));db[_0xa044('0x44')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x45'));db[_0xa044('0x46')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/mailApplication/mailApplication.model');db[_0xa044('0x47')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x48'));db[_0xa044('0x49')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x4a'));db[_0xa044('0x4b')]=db[_0xa044('0x2')]['import']('../api/dashboardItem/dashboardItem.model');db[_0xa044('0x4c')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x4d'));db[_0xa044('0x4e')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x4f'));db['FaxInteraction']=db[_0xa044('0x2')]['import'](_0xa044('0x50'));db[_0xa044('0x51')]=db[_0xa044('0x2')]['import']('../api/faxMessage/faxMessage.model');db[_0xa044('0x52')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x53'));db[_0xa044('0x54')]=db[_0xa044('0x2')]['import'](_0xa044('0x55'));db[_0xa044('0x56')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x57'));db[_0xa044('0x58')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x59'));db[_0xa044('0x5a')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x5b'));db['SmsMessage']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x5c'));db[_0xa044('0x5d')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x5e'));db['OpenchannelAccount']=db['sequelize'][_0xa044('0x17')](_0xa044('0x5f'));db[_0xa044('0x60')]=db[_0xa044('0x2')]['import'](_0xa044('0x61'));db[_0xa044('0x62')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x63'));db[_0xa044('0x64')]=db['sequelize'][_0xa044('0x17')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x65'));db[_0xa044('0x66')]=db['sequelize']['import']('../api/chatWebsite/chatWebsite.model');db[_0xa044('0x67')]=db[_0xa044('0x2')]['import'](_0xa044('0x68'));db[_0xa044('0x69')]=db['sequelize']['import'](_0xa044('0x6a'));db[_0xa044('0x6b')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/chatInteraction/chatInteraction.model');db[_0xa044('0x6c')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x6d'));db[_0xa044('0x6e')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x6f'));db[_0xa044('0x70')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x71'));db[_0xa044('0x72')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/chatGroup/chatGroup.model');db[_0xa044('0x73')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x74'));db[_0xa044('0x75')]=db[_0xa044('0x2')]['import'](_0xa044('0x76'));db[_0xa044('0x77')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x78'));db['CmHopper']=db[_0xa044('0x2')]['import']('../api/cmHopper/cmHopper.model');db[_0xa044('0x79')]=db[_0xa044('0x2')]['import'](_0xa044('0x7a'));db[_0xa044('0x7b')]=db['sequelize'][_0xa044('0x17')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0xa044('0x2')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xa044('0x7c')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xa044('0x7d')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x7e'));db[_0xa044('0x7f')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/action/action.model');db['Automation']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x80'));db[_0xa044('0x81')]=db[_0xa044('0x2')]['import'](_0xa044('0x82'));db['Disposition']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/disposition/disposition.model');db['Condition']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x83'));db[_0xa044('0x84')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x85'));db[_0xa044('0x86')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x87'));db['Cdr']=db['sequelize'][_0xa044('0x17')](_0xa044('0x88'));db[_0xa044('0x89')]=db[_0xa044('0x2')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xa044('0x8a')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x8b'));db['Sound']=db['sequelize'][_0xa044('0x17')]('../api/sound/sound.model');db['Tag']=db['sequelize'][_0xa044('0x17')]('../api/tag/tag.model');db[_0xa044('0x8c')]=db[_0xa044('0x2')]['import']('../api/template/template.model');db[_0xa044('0x8d')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x8e'));db[_0xa044('0x8f')]=db[_0xa044('0x2')]['import']('../api/variable/variable.model');db[_0xa044('0x90')]=db[_0xa044('0x2')]['import'](_0xa044('0x91'));db[_0xa044('0x92')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x93'));db[_0xa044('0x94')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x95'));db['AnalyticDefaultReport']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x96'));db['AnalyticExtractedReport']=db['sequelize']['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xa044('0x97')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x98'));db[_0xa044('0x99')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x9a'));db[_0xa044('0x9b')]=db['sequelize'][_0xa044('0x17')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xa044('0x9c')]=db['sequelize'][_0xa044('0x17')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x9d'));db[_0xa044('0x9e')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x9f'));db[_0xa044('0xa0')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xa1'));db[_0xa044('0xa2')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xa3'));db[_0xa044('0xa4')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xa5'));db[_0xa044('0xa6')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xa7'));db[_0xa044('0xa8')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xa9'));db[_0xa044('0xaa')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xab'));db[_0xa044('0xac')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xad'));db[_0xa044('0xae')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xaf'));db[_0xa044('0xb0')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xb1'));db[_0xa044('0xb2')]=db['sequelize']['import'](_0xa044('0xb3'));db['ZendeskConfiguration']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xb4'));db[_0xa044('0xb5')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xb6'));db[_0xa044('0xb7')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xb8'));db[_0xa044('0xb9')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xa044('0xba')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xbb'));db[_0xa044('0xbc')]=db[_0xa044('0x2')]['import'](_0xa044('0xbd'));db[_0xa044('0xbe')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xbf'));db[_0xa044('0xc0')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xc1'));db[_0xa044('0xc2')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xc3'));db[_0xa044('0xc4')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/intServicenowField/intServicenowField.model');db[_0xa044('0xc5')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xc6'));db[_0xa044('0xc7')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xc8'));db[_0xa044('0xc9')]=db[_0xa044('0x2')]['import'](_0xa044('0xca'));db['FreshsalesAccount']=db['sequelize']['import'](_0xa044('0xcb'));db['FreshsalesConfiguration']=db['sequelize'][_0xa044('0x17')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db[_0xa044('0x2')]['import'](_0xa044('0x91'));db['Network']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/network/network.model');db[_0xa044('0xcc')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xcd'));db['ChatInternalMessage']=db['sequelize'][_0xa044('0x17')](_0xa044('0xce'));db[_0xa044('0xcf')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xd0'));db[_0xa044('0xd1')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xd2'));db[_0xa044('0xd3')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xd4'));db[_0xa044('0xd5')]=db[_0xa044('0x2')]['import'](_0xa044('0xd6'));db[_0xa044('0xd7')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xd8'));db[_0xa044('0xd9')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xda'));db[_0xa044('0xdb')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xdc'));db[_0xa044('0xdd')]=db[_0xa044('0x2')]['import'](_0xa044('0xde'));db[_0xa044('0xdf')]=db[_0xa044('0x2')]['import'](_0xa044('0xe0'));db['SquareProject']=db['sequelize'][_0xa044('0x17')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xe1'));db[_0xa044('0xe2')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xe3'));db[_0xa044('0xe4')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xe5'));db[_0xa044('0xe6')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/campaign/campaign.model');db[_0xa044('0xe7')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xe8'));db[_0xa044('0xe9')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xea'));db[_0xa044('0xeb')]=db[_0xa044('0x2')]['import'](_0xa044('0xec'));db[_0xa044('0xed')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xee'));db['ChatTransferReport']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xef'));db[_0xa044('0xf0')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xf1'));db[_0xa044('0xf2')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xf3'));db[_0xa044('0xf4')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xf5'));db['CmList']=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xf6'));db[_0xa044('0xf7')]=db['sequelize'][_0xa044('0x17')](_0xa044('0xf8'));db[_0xa044('0xf9')]=db[_0xa044('0x2')]['import'](_0xa044('0xfa'));db['UserProfileSection']=db['sequelize'][_0xa044('0x17')](_0xa044('0xfb'));db[_0xa044('0xfc')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xfd'));db['Notification']=db[_0xa044('0x2')][_0xa044('0x17')]('../api/notification/notification.model');db[_0xa044('0xfe')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0xff'));db[_0xa044('0x100')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x101'));db[_0xa044('0x102')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xa044('0x103')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/whatsappMessage/whatsappMessage.model');db[_0xa044('0x104')]=db[_0xa044('0x2')][_0xa044('0x17')](_0xa044('0x105'));db['WhatsappTransferReport']=db[_0xa044('0x2')]['import'](_0xa044('0x106'));db[_0xa044('0x107')]=db[_0xa044('0x2')][_0xa044('0x17')]('../api/whatsappQueue/whatsappQueue.model');db[_0xa044('0x108')]=db['sequelize'][_0xa044('0x17')](_0xa044('0x109'));db[_0xa044('0x15')]['hasOne'](db[_0xa044('0x21')],{'as':_0xa044('0x21'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xa044('0x15')]['hasMany'](db['VoiceRecording'],{'as':_0xa044('0x10a'),'foreignKey':'UserId'});db[_0xa044('0x15')]['hasMany'](db[_0xa044('0x2e')],{'as':_0xa044('0x10b'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'as':_0xa044('0x10f'),'onDelete':_0xa044('0x110'),'hooks':!![]});db['User'][_0xa044('0x10d')](db[_0xa044('0x7b')],{'as':_0xa044('0x111'),'foreignKey':_0xa044('0x10c')});db['User'][_0xa044('0x10d')](db['CmHopperHistory'],{'as':_0xa044('0x112'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')]['hasMany'](db[_0xa044('0x7c')],{'as':'ReportAgentPreview','foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x62')],{'as':_0xa044('0x113'),'foreignKey':_0xa044('0x10c')});db['User']['hasMany'](db[_0xa044('0x6b')],{'as':_0xa044('0x114'),'foreignKey':'UserId'});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x5a')],{'as':'SmsInteractions','foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x115')],{'as':_0xa044('0x116'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')][_0xa044('0x10d')](db['MailInteraction'],{'as':_0xa044('0x117'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x102')],{'as':_0xa044('0x118'),'foreignKey':'UserId'});db[_0xa044('0x15')][_0xa044('0x10d')](db[_0xa044('0x119')],{'as':_0xa044('0x11a'),'foreignKey':_0xa044('0x11b')});db[_0xa044('0x15')][_0xa044('0x11c')](db[_0xa044('0xf9')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xa044('0x15')][_0xa044('0x11d')](db['ChatGroup'],{'as':_0xa044('0x11e'),'through':_0xa044('0x11f')});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0x77')],{'as':_0xa044('0x120'),'through':'cm_user_has_contacts'});db['User'][_0xa044('0x11d')](db[_0xa044('0x121')],{'as':_0xa044('0x122'),'through':_0xa044('0x123')});db[_0xa044('0x15')][_0xa044('0x11d')](db['Team'],{'through':_0xa044('0x124')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x125')],{'as':_0xa044('0x117'),'through':_0xa044('0x126')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x6b')],{'as':_0xa044('0x114'),'through':_0xa044('0x127')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x115')],{'as':_0xa044('0x116'),'through':_0xa044('0x128')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x5a')],{'as':_0xa044('0x129'),'through':_0xa044('0x12a')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x62')],{'as':_0xa044('0x113'),'through':'user_has_openchannel_interactions'});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0x102')],{'as':_0xa044('0x118'),'through':'user_has_whatsapp_interactions'});db['User'][_0xa044('0x11d')](db[_0xa044('0x12b')],{'as':_0xa044('0x12c'),'through':'UserVoiceQueue','required':![]});db[_0xa044('0x15')]['belongsToMany'](db['MailQueue'],{'as':'MailQueues','through':'UserMailQueue','required':![]});db['User'][_0xa044('0x11d')](db[_0xa044('0x70')],{'as':'ChatQueues','through':_0xa044('0x32'),'required':![],'hooks':!![]});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x52')],{'as':_0xa044('0x12d'),'through':_0xa044('0x36'),'required':![]});db['User']['belongsToMany'](db[_0xa044('0x5d')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x12e')],{'as':_0xa044('0x12f'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xa044('0x11d')](db[_0xa044('0x107')],{'as':_0xa044('0x130'),'through':_0xa044('0x3a'),'required':![]});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x121')],{'through':_0xa044('0x123')});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0xf7')],{'as':_0xa044('0x131'),'through':_0xa044('0x132'),'required':![]});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x66')],{'as':_0xa044('0x133'),'through':_0xa044('0x134')});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0x4c')],{'as':'FaxAccounts','through':_0xa044('0x135')});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0x3f')],{'as':_0xa044('0x136'),'through':_0xa044('0x137')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x138')],{'as':_0xa044('0x139'),'through':'user_has_openchannel_accounts'});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0x56')],{'as':_0xa044('0x13a'),'through':_0xa044('0x13b')});db[_0xa044('0x15')][_0xa044('0x11d')](db[_0xa044('0xfe')],{'as':'WhatsappAccounts','through':_0xa044('0x13c')});db[_0xa044('0x15')]['belongsToMany'](db[_0xa044('0x13d')],{'as':_0xa044('0x13e'),'through':_0xa044('0x13f')});db[_0xa044('0x16')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'as':_0xa044('0x140'),'onDelete':'cascade','foreignKey':_0xa044('0x141')});db[_0xa044('0x19')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'onDelete':_0xa044('0x110')});db[_0xa044('0x10e')][_0xa044('0x10d')](db['VoiceExtension'],{'as':_0xa044('0x142'),'onDelete':_0xa044('0x110')});db['VoiceMusicOnHold'][_0xa044('0x11d')](db[_0xa044('0x143')],{'as':_0xa044('0x144'),'through':_0xa044('0x145')});db['VoiceQueue'][_0xa044('0x10d')](db[_0xa044('0x2e')],{'as':_0xa044('0x146'),'foreignKey':_0xa044('0x147')});db['VoiceQueue'][_0xa044('0x10d')](db[_0xa044('0x148')],{'as':_0xa044('0x149'),'foreignKey':_0xa044('0x147')});db[_0xa044('0x12b')]['hasMany'](db[_0xa044('0x7b')],{'as':'HopperFinals','foreignKey':_0xa044('0x147')});db[_0xa044('0x12b')][_0xa044('0x10d')](db[_0xa044('0x14a')],{'as':'HopperHistories','foreignKey':_0xa044('0x147')});db[_0xa044('0x12b')][_0xa044('0x10d')](db[_0xa044('0x7c')],{'as':_0xa044('0x7c'),'foreignKey':_0xa044('0x147')});db[_0xa044('0x12b')]['hasMany'](db[_0xa044('0x79')],{'as':_0xa044('0x14b'),'foreignKey':_0xa044('0x147')});db['VoiceQueue'][_0xa044('0x10d')](db[_0xa044('0xd3')],{'as':_0xa044('0x14c'),'foreignKey':_0xa044('0x147')});db['VoiceQueue']['belongsTo'](db[_0xa044('0x14d')],{'as':_0xa044('0x14d'),'foreignKey':'TrunkId'});db[_0xa044('0x12b')][_0xa044('0x11c')](db[_0xa044('0x14d')],{'as':_0xa044('0x14e'),'foreignKey':'TrunkBackupId'});db[_0xa044('0x12b')][_0xa044('0x11c')](db[_0xa044('0x84')],{'as':_0xa044('0x84'),'foreignKey':_0xa044('0x14f')});db['VoiceQueue']['belongsTo'](db[_0xa044('0x86')],{'as':_0xa044('0x150'),'foreignKey':_0xa044('0x151')});db[_0xa044('0x12b')][_0xa044('0x11d')](db[_0xa044('0x121')],{'as':_0xa044('0x122'),'through':_0xa044('0x152')});db[_0xa044('0x12b')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':'Agents','through':_0xa044('0x30')});db[_0xa044('0x12b')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'as':_0xa044('0x153'),'through':_0xa044('0x154')});db[_0xa044('0x12b')][_0xa044('0x11d')](db[_0xa044('0x121')],{'as':_0xa044('0x155'),'through':'voice_queues_has_cm_blacklists'});db[_0xa044('0x156')][_0xa044('0x11c')](db['User'],{'as':_0xa044('0x15'),'foreignKey':_0xa044('0x10c')});db['ScreenRecording']['belongsTo'](db[_0xa044('0x15')],{'as':_0xa044('0x15'),'foreignKey':_0xa044('0x10c')});db['VoiceMail'][_0xa044('0x10d')](db[_0xa044('0x22')],{'as':_0xa044('0x157'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x158'),'sourceKey':_0xa044('0x159')});db['VoiceMailMessage'][_0xa044('0x11c')](db[_0xa044('0x21')],{'foreignKey':_0xa044('0x158'),'targetKey':'mailbox'});db[_0xa044('0x23')]['hasMany'](db[_0xa044('0x28')],{'as':_0xa044('0x15a'),'foreignKey':_0xa044('0x15b'),'constraints':![]});db[_0xa044('0x23')][_0xa044('0x10d')](db[_0xa044('0x15c')],{'as':_0xa044('0x15d'),'foreignKey':_0xa044('0x15b'),'constraints':![]});db[_0xa044('0x23')][_0xa044('0x11c')](db['User'],{'as':_0xa044('0x15'),'foreignKey':_0xa044('0x10c')});db['VoiceCallReport'][_0xa044('0x11c')](db['CmContact'],{'as':_0xa044('0x15e'),'foreignKey':'ContactId'});db[_0xa044('0x3c')][_0xa044('0x11c')](db[_0xa044('0x3f')],{'as':_0xa044('0x3f'),'foreignKey':'MailAccountId'});db[_0xa044('0x3e')][_0xa044('0x11c')](db[_0xa044('0x3f')],{'as':_0xa044('0x3f'),'foreignKey':_0xa044('0x15f')});db['MailAccount'][_0xa044('0x160')](db[_0xa044('0x3c')],{'as':'Imap','onDelete':_0xa044('0x110')});db['MailAccount']['hasOne'](db[_0xa044('0x3e')],{'as':_0xa044('0x161'),'onDelete':_0xa044('0x110')});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0xa044('0x162'),'foreignKey':_0xa044('0x15f')});db[_0xa044('0x3f')][_0xa044('0x10d')](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x15f')});db[_0xa044('0x3f')][_0xa044('0x10d')](db[_0xa044('0x44')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0xa044('0x3f')][_0xa044('0x10d')](db['MailInteraction'],{'as':_0xa044('0x164')});db[_0xa044('0x3f')][_0xa044('0x10d')](db['MailApplication'],{'as':_0xa044('0x142')});db[_0xa044('0x3f')]['belongsTo'](db['CmList'],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db[_0xa044('0x3f')][_0xa044('0x11c')](db['Template'],{'as':_0xa044('0x8c'),'foreignKey':'TemplateId'});db[_0xa044('0x3f')][_0xa044('0x11c')](db[_0xa044('0x86')],{'as':_0xa044('0x150'),'foreignKey':_0xa044('0x151')});db[_0xa044('0x3f')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':'user_has_mail_accounts'});db[_0xa044('0x41')]['belongsToMany'](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x34')});db[_0xa044('0x41')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'through':_0xa044('0x168'),'as':_0xa044('0x153')});db[_0xa044('0x125')][_0xa044('0x10d')](db[_0xa044('0x44')],{'as':'Messages','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x169')});db[_0xa044('0x125')][_0xa044('0x11c')](db[_0xa044('0x3f')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x15f')});db['MailInteraction'][_0xa044('0x11c')](db['CmContact'],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db['MailInteraction'][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x16c'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x125')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x16e'),'as':_0xa044('0x16f')});db[_0xa044('0x125')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x16e'),'as':_0xa044('0x170')});db[_0xa044('0x125')][_0xa044('0x11d')](db['User'],{'as':_0xa044('0x171'),'through':_0xa044('0x126'),'foreignKey':_0xa044('0x169')});db[_0xa044('0x44')][_0xa044('0x10d')](db[_0xa044('0xe9')],{'as':_0xa044('0x172'),'onDelete':_0xa044('0x110')});db[_0xa044('0x44')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x15')});db[_0xa044('0x44')][_0xa044('0x11c')](db['CmContact'],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x15e')});db[_0xa044('0x44')][_0xa044('0x11c')](db[_0xa044('0x125')],{'as':_0xa044('0x173'),'foreignKey':'MailInteractionId'});db[_0xa044('0x44')][_0xa044('0x11c')](db[_0xa044('0x3f')],{'as':'Account','foreignKey':_0xa044('0x15f')});db[_0xa044('0x46')]['belongsTo'](db['User'],{'onDelete':_0xa044('0x174')});db[_0xa044('0x46')][_0xa044('0x11c')](db[_0xa044('0x41')],{'onDelete':_0xa044('0x174')});db['MailApplication'][_0xa044('0x11c')](db[_0xa044('0x3f')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x46')][_0xa044('0x11c')](db[_0xa044('0x84')],{'onDelete':_0xa044('0x174'),'foreignKey':'IntervalId'});db[_0xa044('0x46')][_0xa044('0x11c')](db[_0xa044('0x16d')],{'onDelete':'restrict','foreignKey':_0xa044('0x175')});db[_0xa044('0x47')][_0xa044('0x11c')](db[_0xa044('0x3f')],{});db['MailQueueReport']['belongsTo'](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db[_0xa044('0x47')][_0xa044('0x11c')](db['CmContact'],{'as':_0xa044('0x15e'),'foreignKey':'ContactId'});db[_0xa044('0x47')]['belongsTo'](db[_0xa044('0x125')],{});db[_0xa044('0x47')][_0xa044('0x11c')](db[_0xa044('0x44')],{});db[_0xa044('0x47')]['belongsTo'](db['User'],{});db[_0xa044('0x47')][_0xa044('0x11c')](db[_0xa044('0x41')],{});db[_0xa044('0x49')][_0xa044('0x10d')](db[_0xa044('0x4b')],{'as':_0xa044('0x176'),'onDelete':_0xa044('0x110')});db[_0xa044('0x4c')][_0xa044('0x10d')](db['Disposition'],{'as':_0xa044('0x162'),'foreignKey':_0xa044('0x177')});db['FaxAccount']['hasMany'](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x177')});db[_0xa044('0x4c')]['hasMany'](db[_0xa044('0x115')],{'as':'Interactions'});db[_0xa044('0x4c')][_0xa044('0x10d')](db[_0xa044('0x4e')],{'as':_0xa044('0x142')});db[_0xa044('0x4c')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'as':_0xa044('0x178'),'onDelete':'cascade'});db['FaxAccount'][_0xa044('0x10d')](db['FaxMessage'],{'as':_0xa044('0x157')});db[_0xa044('0x4c')][_0xa044('0x11c')](db[_0xa044('0x14d')],{'as':_0xa044('0x14d')});db[_0xa044('0x4c')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db[_0xa044('0x4c')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa044('0x151')});db[_0xa044('0x4c')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x135')});db['FaxApplication'][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x4e')][_0xa044('0x11c')](db['FaxQueue'],{'onDelete':_0xa044('0x174')});db['FaxApplication']['belongsTo'](db[_0xa044('0x4c')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x4e')][_0xa044('0x11c')](db['Tag'],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x175')});db[_0xa044('0x115')]['hasMany'](db[_0xa044('0x51')],{'as':_0xa044('0x157'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x179')});db['FaxInteraction'][_0xa044('0x11c')](db['FaxAccount'],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x177')});db[_0xa044('0x115')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':'Contact','foreignKey':_0xa044('0x16b')});db[_0xa044('0x115')]['belongsTo'](db[_0xa044('0x15')],{'as':'Owner','foreignKey':_0xa044('0x10c')});db[_0xa044('0x115')]['belongsToMany'](db['Tag'],{'through':_0xa044('0x17a'),'as':'Tags'});db[_0xa044('0x115')]['belongsToMany'](db[_0xa044('0x16d')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction'][_0xa044('0x11d')](db['User'],{'as':_0xa044('0x171'),'through':_0xa044('0x128'),'foreignKey':_0xa044('0x179')});db[_0xa044('0x51')][_0xa044('0x11c')](db['User'],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x15')});db[_0xa044('0x51')][_0xa044('0x11c')](db['FaxInteraction'],{'as':_0xa044('0x173'),'foreignKey':_0xa044('0x179')});db[_0xa044('0x51')][_0xa044('0x11c')](db['CmContact'],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x15e')});db[_0xa044('0x51')]['belongsTo'](db[_0xa044('0xe9')],{'as':_0xa044('0xe9'),'foreignKey':_0xa044('0x17b')});db[_0xa044('0x51')]['belongsTo'](db[_0xa044('0x4c')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x177')});db[_0xa044('0x52')][_0xa044('0x11d')](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0xa044('0x52')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'through':_0xa044('0x17c'),'as':_0xa044('0x153')});db['FaxQueueReport']['belongsTo'](db[_0xa044('0x4c')],{});db[_0xa044('0x54')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db['FaxQueueReport']['belongsTo'](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x54')][_0xa044('0x11c')](db['FaxInteraction'],{});db[_0xa044('0x54')][_0xa044('0x11c')](db[_0xa044('0x51')],{});db[_0xa044('0x54')][_0xa044('0x11c')](db[_0xa044('0x15')],{});db[_0xa044('0x54')][_0xa044('0x11c')](db[_0xa044('0x52')],{});db[_0xa044('0x56')][_0xa044('0x10d')](db[_0xa044('0x17d')],{'as':_0xa044('0x162'),'foreignKey':_0xa044('0x17e')});db[_0xa044('0x56')][_0xa044('0x10d')](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x17e')});db['SmsAccount'][_0xa044('0x10d')](db[_0xa044('0x17f')],{'as':_0xa044('0x157'),'foreignKey':_0xa044('0x17e')});db[_0xa044('0x56')][_0xa044('0x10d')](db[_0xa044('0x5a')],{'as':_0xa044('0x164')});db[_0xa044('0x56')][_0xa044('0x10d')](db[_0xa044('0x58')],{'as':_0xa044('0x142')});db[_0xa044('0x56')][_0xa044('0x11c')](db['CmList'],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db['SmsAccount'][_0xa044('0x11c')](db[_0xa044('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0xa044('0x151')});db['SmsAccount'][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x13b')});db[_0xa044('0x58')][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x174')});db['SmsApplication'][_0xa044('0x11c')](db[_0xa044('0x5d')],{'onDelete':_0xa044('0x174')});db['SmsApplication'][_0xa044('0x11c')](db[_0xa044('0x56')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x58')][_0xa044('0x11c')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xa044('0x14f')});db['SmsApplication'][_0xa044('0x11c')](db[_0xa044('0x16d')],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x175')});db[_0xa044('0x5a')][_0xa044('0x10d')](db[_0xa044('0x17f')],{'as':'Messages','onDelete':_0xa044('0x110'),'foreignKey':'SmsInteractionId'});db[_0xa044('0x5a')][_0xa044('0x11c')](db[_0xa044('0x56')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x17e')});db[_0xa044('0x5a')][_0xa044('0x11c')](db['CmContact'],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x5a')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x16c'),'foreignKey':'UserId'});db[_0xa044('0x5a')]['belongsToMany'](db[_0xa044('0x16d')],{'through':_0xa044('0x180'),'as':_0xa044('0x16f')});db[_0xa044('0x5a')][_0xa044('0x11d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xa044('0x170')});db['SmsInteraction']['belongsToMany'](db[_0xa044('0x15')],{'as':_0xa044('0x171'),'through':_0xa044('0x12a'),'foreignKey':_0xa044('0x181')});db[_0xa044('0x17f')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x15')});db[_0xa044('0x17f')][_0xa044('0x11c')](db[_0xa044('0x77')],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x15e')});db['SmsMessage'][_0xa044('0x11c')](db['SmsInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xa044('0x11c')](db[_0xa044('0x56')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x17e')});db[_0xa044('0x5d')][_0xa044('0x11d')](db['User'],{'as':_0xa044('0x167'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xa044('0x5d')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'through':_0xa044('0x182'),'as':_0xa044('0x153')});db['OpenchannelAccount'][_0xa044('0x10d')](db[_0xa044('0x17d')],{'as':_0xa044('0x162'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xa044('0x10d')](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x183')});db[_0xa044('0x138')][_0xa044('0x10d')](db[_0xa044('0x62')],{'as':_0xa044('0x164'),'foreignKey':_0xa044('0x183')});db[_0xa044('0x138')][_0xa044('0x10d')](db[_0xa044('0x64')],{'as':'Messages','foreignKey':_0xa044('0x183')});db['OpenchannelAccount'][_0xa044('0x10d')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0xa044('0x183')});db[_0xa044('0x138')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db['OpenchannelAccount'][_0xa044('0x11c')](db['Pause'],{'as':_0xa044('0x150'),'foreignKey':_0xa044('0x151')});db['OpenchannelAccount'][_0xa044('0x11d')](db['User'],{'as':_0xa044('0x167'),'through':_0xa044('0x184')});db[_0xa044('0x60')][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x60')][_0xa044('0x11c')](db[_0xa044('0x12e')],{'onDelete':_0xa044('0x174'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db[_0xa044('0x138')],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x183')});db[_0xa044('0x60')][_0xa044('0x11c')](db['Interval'],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x14f')});db[_0xa044('0x60')][_0xa044('0x11c')](db[_0xa044('0x16d')],{'onDelete':'restrict','foreignKey':_0xa044('0x175')});db[_0xa044('0x62')][_0xa044('0x10d')](db[_0xa044('0x64')],{'as':'Messages','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x185')});db[_0xa044('0x62')][_0xa044('0x11c')](db[_0xa044('0x138')],{'as':'Account','foreignKey':_0xa044('0x183')});db[_0xa044('0x62')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x62')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x16c'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x62')][_0xa044('0x11d')](db['Tag'],{'through':_0xa044('0x186'),'as':'Tags'});db['OpenchannelInteraction'][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x186'),'as':_0xa044('0x170')});db[_0xa044('0x62')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':'Users','through':_0xa044('0x187'),'foreignKey':'OpenchannelInteractionId'});db[_0xa044('0x64')][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x110'),'as':'User'});db[_0xa044('0x64')][_0xa044('0x11c')](db[_0xa044('0x77')],{'onDelete':_0xa044('0x110'),'as':'Contact'});db['OpenchannelMessage'][_0xa044('0x11c')](db[_0xa044('0x62')],{'onDelete':'cascade','as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0xa044('0x64')][_0xa044('0x11c')](db[_0xa044('0xe9')],{'as':_0xa044('0xe9'),'foreignKey':_0xa044('0x17b')});db['OpenchannelMessage']['belongsTo'](db['OpenchannelAccount'],{'as':_0xa044('0x16a'),'foreignKey':'OpenchannelAccountId'});db[_0xa044('0x12e')]['belongsToMany'](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x39'),'foreignKey':_0xa044('0x188')});db['OpenchannelQueue']['belongsToMany'](db['Team'],{'through':_0xa044('0x189'),'as':'Teams'});db[_0xa044('0x66')]['hasMany'](db['Disposition'],{'as':_0xa044('0x162'),'foreignKey':_0xa044('0x18a')});db[_0xa044('0x66')][_0xa044('0x10d')](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x18a')});db[_0xa044('0x66')][_0xa044('0x10d')](db[_0xa044('0x73')],{'as':_0xa044('0x18b')});db[_0xa044('0x66')][_0xa044('0x10d')](db[_0xa044('0x6b')],{'as':'Interactions'});db['ChatWebsite'][_0xa044('0x10d')](db[_0xa044('0x69')],{'as':_0xa044('0x142')});db[_0xa044('0x66')][_0xa044('0x10d')](db[_0xa044('0x6c')],{'as':_0xa044('0x157')});db[_0xa044('0x66')]['belongsTo'](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':'ListId'});db['ChatWebsite'][_0xa044('0x11c')](db[_0xa044('0x84')],{'as':_0xa044('0x84'),'foreignKey':_0xa044('0x14f')});db['ChatWebsite'][_0xa044('0x11c')](db[_0xa044('0x86')],{'as':_0xa044('0x150'),'foreignKey':_0xa044('0x151')});db[_0xa044('0x66')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':'user_has_chat_websites'});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x138')],{});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':'List','foreignKey':'ListId'});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':'Contact','foreignKey':'ContactId'});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x62')],{});db['OpenchannelQueueReport'][_0xa044('0x11c')](db['OpenchannelMessage'],{});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x15')],{});db[_0xa044('0x67')][_0xa044('0x11c')](db[_0xa044('0x12e')],{});db[_0xa044('0x69')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x18c'),'foreignKey':_0xa044('0x10c'),'onDelete':_0xa044('0x174')});db[_0xa044('0x69')][_0xa044('0x11c')](db[_0xa044('0x70')],{'as':_0xa044('0x18d'),'foreignKey':_0xa044('0x18e'),'onDelete':_0xa044('0x174')});db[_0xa044('0x69')]['belongsTo'](db[_0xa044('0x66')],{'as':_0xa044('0x18f'),'foreignKey':'ChatWebsiteId','onDelete':_0xa044('0x174')});db[_0xa044('0x69')][_0xa044('0x11c')](db[_0xa044('0x16d')],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x175')});db[_0xa044('0x6b')][_0xa044('0x10d')](db[_0xa044('0x6c')],{'as':'Messages','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x190')});db[_0xa044('0x6b')]['belongsTo'](db[_0xa044('0x66')],{'as':'Account','foreignKey':_0xa044('0x18a')});db[_0xa044('0x6b')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db['ChatInteraction'][_0xa044('0x11c')](db['User'],{'as':_0xa044('0x16c'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x6b')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x191'),'as':_0xa044('0x16f')});db['ChatInteraction'][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':'chat_interaction_has_tags','as':_0xa044('0x170')});db[_0xa044('0x6b')]['belongsToMany'](db[_0xa044('0x15')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xa044('0x190')});db[_0xa044('0x6c')]['belongsTo'](db[_0xa044('0x15')],{'onDelete':_0xa044('0x110'),'as':'User'});db[_0xa044('0x6c')][_0xa044('0x11c')](db['CmContact'],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x15e'),'foreignKey':'ContactId'});db[_0xa044('0x6c')][_0xa044('0x11c')](db[_0xa044('0x6b')],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x173'),'foreignKey':_0xa044('0x190')});db[_0xa044('0x6c')][_0xa044('0x11c')](db[_0xa044('0xe9')],{'as':_0xa044('0xe9'),'foreignKey':_0xa044('0x17b')});db['ChatMessage'][_0xa044('0x11c')](db[_0xa044('0x66')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x18a')});db[_0xa044('0x6e')][_0xa044('0x11c')](db[_0xa044('0x77')],{'onDelete':'cascade','as':_0xa044('0x15e'),'foreignKey':'ContactId'});db[_0xa044('0x6e')][_0xa044('0x11c')](db['ChatWebsite'],{'as':_0xa044('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0xa044('0x70')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x32'),'hooks':!![]});db[_0xa044('0x70')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'through':'team_has_chat_queues','as':_0xa044('0x153')});db[_0xa044('0x72')]['hasMany'](db[_0xa044('0x192')],{'as':_0xa044('0x157'),'foreignKey':_0xa044('0x193'),'onDelete':_0xa044('0x110')});db[_0xa044('0x72')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x146'),'through':_0xa044('0x11f')});db[_0xa044('0x73')]['belongsTo'](db['ChatWebsite'],{'as':_0xa044('0x18f'),'foreignKey':_0xa044('0x18a')});db[_0xa044('0x75')][_0xa044('0x10d')](db[_0xa044('0x77')],{'as':_0xa044('0x120'),'foreignKey':_0xa044('0x194')});db[_0xa044('0x77')][_0xa044('0x10d')](db[_0xa044('0x148')],{'as':_0xa044('0x149'),'foreignKey':'ContactId'});db[_0xa044('0x77')][_0xa044('0x10d')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xa044('0x77')][_0xa044('0x10d')](db[_0xa044('0x14a')],{'as':_0xa044('0x195'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x77')][_0xa044('0x10d')](db['ReportAgentPreview'],{'as':_0xa044('0x7c'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x77')][_0xa044('0x10d')](db[_0xa044('0xd3')],{'as':_0xa044('0x14c'),'foreignKey':'ContactId'});db[_0xa044('0x77')]['hasMany'](db[_0xa044('0x62')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xa044('0x174')});db[_0xa044('0x77')]['hasMany'](db['ChatInteraction'],{'as':_0xa044('0x114'),'foreignKey':_0xa044('0x16b'),'onDelete':'restrict'});db[_0xa044('0x77')][_0xa044('0x10d')](db[_0xa044('0x5a')],{'as':_0xa044('0x129'),'foreignKey':_0xa044('0x16b'),'onDelete':_0xa044('0x174')});db['CmContact']['hasMany'](db[_0xa044('0x115')],{'as':'FaxInteractions','foreignKey':_0xa044('0x16b'),'onDelete':_0xa044('0x174')});db[_0xa044('0x77')]['hasMany'](db[_0xa044('0x125')],{'as':_0xa044('0x117'),'foreignKey':_0xa044('0x16b'),'onDelete':'restrict'});db[_0xa044('0x77')][_0xa044('0x11c')](db[_0xa044('0x75')],{'as':_0xa044('0x196'),'foreignKey':_0xa044('0x194')});db[_0xa044('0x77')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166'),'onDelete':_0xa044('0x110')});db[_0xa044('0x77')][_0xa044('0x11d')](db['User'],{'as':'Users','through':_0xa044('0x197')});db[_0xa044('0x77')]['belongsToMany'](db[_0xa044('0x16d')],{'as':'Tags','through':_0xa044('0x198')});db[_0xa044('0x77')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x198'),'as':_0xa044('0x170')});db[_0xa044('0x148')]['belongsTo'](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':'ContactId','onDelete':_0xa044('0x110')});db['CmHopper'][_0xa044('0x11c')](db['CmList'],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166'),'onDelete':_0xa044('0x110')});db[_0xa044('0x148')]['belongsTo'](db['User'],{'as':_0xa044('0x18c'),'foreignKey':_0xa044('0x10c')});db['CmHopper'][_0xa044('0x11c')](db[_0xa044('0x12b')],{'as':'Queue','foreignKey':_0xa044('0x147'),'onDelete':_0xa044('0x110')});db['CmHopper'][_0xa044('0x11c')](db['Campaign'],{'as':_0xa044('0xe6'),'foreignKey':'CampaignId','onDelete':_0xa044('0x110')});db['CmHopper']['belongsTo'](db[_0xa044('0x15')],{'as':'Owner','foreignKey':_0xa044('0x199')});db[_0xa044('0x79')][_0xa044('0x11c')](db['CmContact'],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b'),'onDelete':_0xa044('0x110')});db[_0xa044('0x79')][_0xa044('0x11c')](db['CmList'],{'as':'List','foreignKey':_0xa044('0x166'),'onDelete':_0xa044('0x110')});db[_0xa044('0x79')][_0xa044('0x11c')](db[_0xa044('0x12b')],{'as':_0xa044('0x18d'),'foreignKey':_0xa044('0x147'),'onDelete':'cascade'});db['CmHopperBlack'][_0xa044('0x11c')](db[_0xa044('0xe6')],{'as':_0xa044('0xe6'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0xa044('0x10d')](db[_0xa044('0x19a')],{'as':{'plural':'All','singular':_0xa044('0x19b')},'foreignKey':_0xa044('0x19c'),'onDelete':_0xa044('0x110'),'hooks':!![]});db[_0xa044('0x19d')][_0xa044('0x10d')](db[_0xa044('0x19a')],{'as':{'plural':'Any','singular':_0xa044('0x19e')},'foreignKey':_0xa044('0x19f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xa044('0x10d')](db[_0xa044('0x7f')],{'as':_0xa044('0x1a0'),'foreignKey':_0xa044('0x1a1'),'onDelete':_0xa044('0x110'),'hooks':!![]});db['Interval'][_0xa044('0x10d')](db['Interval'],{'as':_0xa044('0x1a2'),'foreignKey':_0xa044('0x14f'),'onDelete':_0xa044('0x110'),'hooks':!![],'required':![]});db[_0xa044('0x84')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'as':_0xa044('0x10f'),'foreignKey':_0xa044('0x14f'),'onDelete':_0xa044('0x174')});db['Interval'][_0xa044('0x10d')](db['MailApplication'],{'as':_0xa044('0x1a3'),'foreignKey':_0xa044('0x14f')});db[_0xa044('0x84')][_0xa044('0x10d')](db[_0xa044('0x69')],{'as':_0xa044('0x1a4'),'foreignKey':_0xa044('0x14f')});db[_0xa044('0x84')]['hasMany'](db['FaxApplication'],{'as':_0xa044('0x1a5'),'foreignKey':_0xa044('0x14f')});db[_0xa044('0x84')][_0xa044('0x10d')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0xa044('0x8a')]['belongsTo'](db[_0xa044('0x3f')],{});db[_0xa044('0x8a')][_0xa044('0x11c')](db[_0xa044('0x1a6')],{'foreignKey':_0xa044('0x1a7')});db[_0xa044('0x8a')][_0xa044('0x11c')](db[_0xa044('0x94')],{'foreignKey':'CustomReportId'});db[_0xa044('0x143')]['belongsToMany'](db[_0xa044('0x1b')],{'as':_0xa044('0x1a8'),'through':_0xa044('0x145'),'onDelete':'restrict'});db[_0xa044('0x16d')][_0xa044('0x11d')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xa044('0x16d')][_0xa044('0x11d')](db[_0xa044('0x6b')],{'through':_0xa044('0x191')});db[_0xa044('0x16d')]['belongsToMany'](db[_0xa044('0x125')],{'through':_0xa044('0x16e')});db[_0xa044('0x16d')][_0xa044('0x11d')](db[_0xa044('0x5a')],{'through':_0xa044('0x180')});db['Tag'][_0xa044('0x11d')](db[_0xa044('0x115')],{'through':_0xa044('0x17a')});db[_0xa044('0x16d')]['belongsToMany'](db[_0xa044('0x62')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xa044('0x11d')](db[_0xa044('0x102')],{'through':'whatsapp_interaction_has_tags'});db[_0xa044('0x8d')][_0xa044('0x10d')](db['Condition'],{'as':{'plural':_0xa044('0x1a9'),'singular':_0xa044('0x1aa')},'foreignKey':_0xa044('0x1ab'),'onDelete':_0xa044('0x110'),'hooks':!![]});db[_0xa044('0x8d')][_0xa044('0x10d')](db[_0xa044('0x19a')],{'as':{'plural':_0xa044('0x1ac'),'singular':_0xa044('0x1ad')},'foreignKey':_0xa044('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0xa044('0x8d')]['hasMany'](db[_0xa044('0x7f')],{'as':'Actions','foreignKey':_0xa044('0x1af'),'onDelete':_0xa044('0x110'),'hooks':!![]});db[_0xa044('0x94')]['hasMany'](db[_0xa044('0x99')],{'as':'Fields','onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xa044('0x10d')](db[_0xa044('0x99')],{'as':_0xa044('0x1b0'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1a7')});db[_0xa044('0x97')][_0xa044('0x10d')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b1')});db['AnalyticFieldReport'][_0xa044('0x11c')](db[_0xa044('0x97')],{'foreignKey':'MetricId'});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0xa044('0x1b2'),'onDelete':'cascade','foreignKey':_0xa044('0x1b3')});db[_0xa044('0x1b4')][_0xa044('0x10d')](db['SalesforceField'],{'as':_0xa044('0x1b5'),'onDelete':'cascade','foreignKey':_0xa044('0x1b6')});db[_0xa044('0x1b4')][_0xa044('0x10d')](db[_0xa044('0x9e')],{'as':_0xa044('0x1b7'),'onDelete':'cascade','foreignKey':_0xa044('0x1b8')});db['SalesforceConfiguration'][_0xa044('0x10d')](db['SalesforceField'],{'as':_0xa044('0x1b0'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b9')});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0x9e')][_0xa044('0x10d')](db['SalesforceField'],{'as':'Subject','foreignKey':_0xa044('0x1b6')});db[_0xa044('0x9e')][_0xa044('0x10d')](db[_0xa044('0x9e')],{'as':'Description','foreignKey':_0xa044('0x1b8')});db[_0xa044('0x9e')][_0xa044('0x10d')](db['SalesforceField'],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db['SalesforceField'][_0xa044('0x11c')](db[_0xa044('0x8f')],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0xa0')][_0xa044('0x10d')](db[_0xa044('0xa2')],{'as':_0xa044('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xa044('0xa2')][_0xa044('0x10d')](db[_0xa044('0xa4')],{'as':_0xa044('0x1b5'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xa2')][_0xa044('0x10d')](db[_0xa044('0xa4')],{'as':_0xa044('0x1b7'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xa2')][_0xa044('0x10d')](db[_0xa044('0xa4')],{'as':_0xa044('0x1b0'),'onDelete':'cascade','foreignKey':_0xa044('0x1b9')});db['SugarcrmConfiguration'][_0xa044('0x11c')](db['SugarcrmAccount'],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xa4')]['hasMany'](db[_0xa044('0xa4')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xa4')]['hasMany'](db['SugarcrmField'],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xa4')][_0xa044('0x10d')](db[_0xa044('0xa4')],{'as':_0xa044('0x1ba'),'foreignKey':'FieldId'});db[_0xa044('0xa4')]['belongsTo'](db[_0xa044('0x8f')],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0xa6')]['hasMany'](db['DeskConfiguration'],{'as':_0xa044('0x1b2'),'onDelete':'cascade','foreignKey':_0xa044('0x1b3')});db[_0xa044('0xa8')][_0xa044('0x10d')](db[_0xa044('0xaa')],{'as':_0xa044('0x1b5'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b6')});db['DeskConfiguration'][_0xa044('0x10d')](db[_0xa044('0xaa')],{'as':_0xa044('0x1b7'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b8')});db['DeskConfiguration'][_0xa044('0x10d')](db[_0xa044('0xaa')],{'as':'Fields','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xa8')][_0xa044('0x11c')](db['DeskAccount'],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xa8')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':'int_desk_configuration_has_tags'});db[_0xa044('0xaa')][_0xa044('0x10d')](db[_0xa044('0xaa')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db['DeskField'][_0xa044('0x10d')](db[_0xa044('0xaa')],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xaa')][_0xa044('0x10d')](db['DeskField'],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xaa')][_0xa044('0x11c')](db[_0xa044('0x8f')],{'as':'Variable','foreignKey':_0xa044('0x1bb')});db['ZohoAccount'][_0xa044('0x10d')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa044('0x1b3')});db['ZohoConfiguration']['hasMany'](db[_0xa044('0xb0')],{'as':_0xa044('0x1b5'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b6')});db['ZohoConfiguration'][_0xa044('0x10d')](db[_0xa044('0xb0')],{'as':'Descriptions','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xae')]['hasMany'](db[_0xa044('0xb0')],{'as':_0xa044('0x1b0'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xae')][_0xa044('0x11c')](db[_0xa044('0xac')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xb0')][_0xa044('0x10d')](db[_0xa044('0xb0')],{'as':'Subject','foreignKey':_0xa044('0x1b6')});db['ZohoField'][_0xa044('0x10d')](db[_0xa044('0xb0')],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xb0')][_0xa044('0x10d')](db[_0xa044('0xb0')],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db['ZohoField']['belongsTo'](db[_0xa044('0x8f')],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0xb2')]['hasMany'](db[_0xa044('0x1be')],{'as':_0xa044('0x1b2'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZendeskConfiguration']['hasMany'](db[_0xa044('0xb5')],{'as':_0xa044('0x1b5'),'foreignKey':_0xa044('0x1b6')});db['ZendeskConfiguration'][_0xa044('0x10d')](db['ZendeskField'],{'as':_0xa044('0x1b7'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0x1be')][_0xa044('0x10d')](db['ZendeskField'],{'as':_0xa044('0x1b0'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0x1be')][_0xa044('0x11c')](db[_0xa044('0xb2')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0x1be')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':'int_zendesk_configuration_has_tags'});db[_0xa044('0xb5')][_0xa044('0x10d')](db[_0xa044('0xb5')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xb5')]['hasMany'](db[_0xa044('0xb5')],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xb5')]['hasMany'](db['ZendeskField'],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xb5')][_0xa044('0x11c')](db[_0xa044('0x8f')],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0xb7')]['hasMany'](db[_0xa044('0xb9')],{'as':_0xa044('0x1b2'),'onDelete':'cascade','foreignKey':_0xa044('0x1b3')});db[_0xa044('0xb9')][_0xa044('0x10d')](db[_0xa044('0x1bf')],{'as':_0xa044('0x1b5'),'onDelete':_0xa044('0x110'),'foreignKey':'SubjectId'});db[_0xa044('0xb9')]['hasMany'](db['FreshdeskField'],{'as':_0xa044('0x1b7'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xb9')][_0xa044('0x10d')](db[_0xa044('0x1bf')],{'as':'Fields','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xb9')][_0xa044('0x11c')](db[_0xa044('0xb7')],{'as':_0xa044('0x16a'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xa044('0x1bf')][_0xa044('0x10d')](db[_0xa044('0x1bf')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0x1bf')][_0xa044('0x10d')](db['FreshdeskField'],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0x1bf')][_0xa044('0x10d')](db[_0xa044('0x1bf')],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0x1bf')][_0xa044('0x11c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xa044('0xba')][_0xa044('0x10d')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xbc')][_0xa044('0x10d')](db['VtigerField'],{'as':_0xa044('0x1b5'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xbc')][_0xa044('0x10d')](db[_0xa044('0xbe')],{'as':'Descriptions','foreignKey':_0xa044('0x1b8')});db[_0xa044('0xbc')][_0xa044('0x10d')](db[_0xa044('0xbe')],{'as':_0xa044('0x1b0'),'foreignKey':'FieldId'});db[_0xa044('0xbc')][_0xa044('0x11c')](db[_0xa044('0xba')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db['VtigerField'][_0xa044('0x10d')](db[_0xa044('0xbe')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xbe')][_0xa044('0x10d')](db['VtigerField'],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xbe')]['hasMany'](db[_0xa044('0xbe')],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xbe')]['belongsTo'](db['Variable'],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0xc0')]['hasMany'](db[_0xa044('0xc2')],{'as':_0xa044('0x1b2'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b3')});db['ServicenowConfiguration']['hasMany'](db[_0xa044('0xc4')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xa044('0xc2')]['hasMany'](db[_0xa044('0xc4')],{'as':_0xa044('0x1b7'),'foreignKey':'DescriptionId'});db[_0xa044('0xc2')][_0xa044('0x10d')](db[_0xa044('0xc4')],{'as':'Fields','foreignKey':_0xa044('0x1b9')});db[_0xa044('0xc2')]['belongsTo'](db['ServicenowAccount'],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xc4')][_0xa044('0x10d')](db[_0xa044('0xc4')],{'as':'Subject','foreignKey':'SubjectId'});db['ServicenowField'][_0xa044('0x10d')](db[_0xa044('0xc4')],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db['ServicenowField'][_0xa044('0x10d')](db[_0xa044('0xc4')],{'as':_0xa044('0x1ba'),'foreignKey':'FieldId'});db[_0xa044('0xc4')]['belongsTo'](db['Variable'],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db['Dynamics365Account'][_0xa044('0x10d')](db[_0xa044('0xc7')],{'as':_0xa044('0x1b2'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0xc7')]['hasMany'](db[_0xa044('0xc9')],{'as':'Subjects','onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b6')});db[_0xa044('0xc7')][_0xa044('0x10d')](db[_0xa044('0xc9')],{'as':_0xa044('0x1b7'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xc7')][_0xa044('0x10d')](db['Dynamics365Field'],{'as':_0xa044('0x1b0'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xc7')]['belongsTo'](db[_0xa044('0xc5')],{'as':_0xa044('0x16a'),'foreignKey':'AccountId'});db[_0xa044('0xc9')]['hasMany'](db[_0xa044('0xc9')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db['Dynamics365Field'][_0xa044('0x10d')](db[_0xa044('0xc9')],{'as':_0xa044('0x1bd'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0xc9')][_0xa044('0x10d')](db['Dynamics365Field'],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db[_0xa044('0xc9')][_0xa044('0x11c')](db[_0xa044('0x8f')],{'as':_0xa044('0x8f'),'foreignKey':_0xa044('0x1bb')});db[_0xa044('0x1c0')][_0xa044('0x10d')](db[_0xa044('0x1c1')],{'as':_0xa044('0x1b2'),'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1b3')});db[_0xa044('0x1c1')][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':_0xa044('0x1b5'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':_0xa044('0x1b7'),'foreignKey':_0xa044('0x1b8')});db[_0xa044('0x1c1')][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':_0xa044('0x1b0'),'foreignKey':_0xa044('0x1b9')});db['FreshsalesConfiguration'][_0xa044('0x11c')](db[_0xa044('0x1c0')],{'as':'Account','foreignKey':_0xa044('0x1b3')});db[_0xa044('0x1c2')][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':_0xa044('0x1bc'),'foreignKey':_0xa044('0x1b6')});db['FreshsalesField'][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':'Description','foreignKey':_0xa044('0x1b8')});db[_0xa044('0x1c2')][_0xa044('0x10d')](db[_0xa044('0x1c2')],{'as':_0xa044('0x1ba'),'foreignKey':_0xa044('0x1b9')});db['FreshsalesField']['belongsTo'](db[_0xa044('0x8f')],{'as':'Variable','foreignKey':_0xa044('0x1bb')});db['ChatQueueReport'][_0xa044('0x11c')](db[_0xa044('0x66')],{});db[_0xa044('0xcc')]['belongsTo'](db['CmList'],{'as':_0xa044('0x165'),'foreignKey':'ListId'});db[_0xa044('0xcc')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0xcc')]['belongsTo'](db[_0xa044('0x6b')],{});db[_0xa044('0xcc')][_0xa044('0x11c')](db[_0xa044('0x6c')],{});db[_0xa044('0xcc')]['belongsTo'](db[_0xa044('0x15')],{});db[_0xa044('0xcc')][_0xa044('0x11c')](db[_0xa044('0x70')],{});db[_0xa044('0x192')][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x110'),'foreignKey':_0xa044('0x1c3')});db[_0xa044('0x192')][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':'cascade','foreignKey':_0xa044('0x1c4')});db[_0xa044('0xd3')][_0xa044('0x10d')](db['JscriptyQuestionReport'],{'foreignKey':_0xa044('0x1c5'),'onDelete':_0xa044('0x110')});db[_0xa044('0xd3')][_0xa044('0x10d')](db['JscriptyAnswerReport'],{'foreignKey':_0xa044('0x1c5'),'onDelete':_0xa044('0x110')});db[_0xa044('0xd5')][_0xa044('0x11c')](db['SmsAccount'],{});db[_0xa044('0xd5')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':_0xa044('0x165'),'foreignKey':'ListId'});db[_0xa044('0xd5')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xa044('0x11c')](db[_0xa044('0x5a')],{});db[_0xa044('0xd5')][_0xa044('0x11c')](db[_0xa044('0x17f')],{});db[_0xa044('0xd5')][_0xa044('0x11c')](db[_0xa044('0x15')],{});db[_0xa044('0xd5')]['belongsTo'](db[_0xa044('0x5d')],{});db[_0xa044('0xdb')]['hasMany'](db[_0xa044('0xd3')],{'foreignKey':_0xa044('0x1c6')});db[_0xa044('0xdb')][_0xa044('0x10d')](db[_0xa044('0xd1')],{'foreignKey':_0xa044('0x1c6')});db[_0xa044('0xdb')][_0xa044('0x10d')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0xa044('0x13d')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':'Users','through':_0xa044('0x13f')});db[_0xa044('0xe2')][_0xa044('0x11d')](db['User'],{'as':'Agents','through':_0xa044('0x124')});db[_0xa044('0xe2')][_0xa044('0x11d')](db[_0xa044('0x12b')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0xa044('0xe2')][_0xa044('0x11d')](db[_0xa044('0x41')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xa044('0xe2')][_0xa044('0x11d')](db[_0xa044('0x70')],{'through':'team_has_chat_queues','as':_0xa044('0x1c7')});db['Team']['belongsToMany'](db[_0xa044('0x52')],{'through':_0xa044('0x17c'),'as':_0xa044('0x12d')});db['Team'][_0xa044('0x11d')](db[_0xa044('0x5d')],{'through':_0xa044('0x182'),'as':_0xa044('0x1c8')});db['Team']['belongsToMany'](db[_0xa044('0x12e')],{'through':_0xa044('0x189'),'as':_0xa044('0x12f')});db[_0xa044('0xe2')][_0xa044('0x11d')](db[_0xa044('0x107')],{'through':_0xa044('0x1c9'),'as':_0xa044('0x130')});db[_0xa044('0xe6')]['hasMany'](db['CmHopper'],{'as':_0xa044('0x149'),'foreignKey':_0xa044('0x1ca')});db['Campaign'][_0xa044('0x10d')](db['CmHopperFinal'],{'as':_0xa044('0x111'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':_0xa044('0x195'),'foreignKey':_0xa044('0x1ca')});db['Campaign'][_0xa044('0x10d')](db[_0xa044('0x79')],{'as':_0xa044('0x14b'),'foreignKey':_0xa044('0x1ca')});db[_0xa044('0xe6')]['belongsTo'](db[_0xa044('0x14d')],{'as':'Trunk','foreignKey':_0xa044('0x1cb')});db['Campaign']['belongsTo'](db[_0xa044('0x14d')],{'as':'TrunkBackup','foreignKey':_0xa044('0x1cc')});db[_0xa044('0xe6')][_0xa044('0x11c')](db[_0xa044('0x84')],{'as':_0xa044('0x84'),'foreignKey':'IntervalId'});db[_0xa044('0xe6')]['belongsTo'](db[_0xa044('0x13d')],{'as':_0xa044('0x13d'),'foreignKey':_0xa044('0x1cd')});db[_0xa044('0xe6')][_0xa044('0x11d')](db['CmList'],{'as':_0xa044('0x122'),'through':_0xa044('0x1ce')});db['Campaign'][_0xa044('0x11d')](db[_0xa044('0x121')],{'as':'BlackLists','through':_0xa044('0x1cf')});db['MailTransferReport'][_0xa044('0x11c')](db[_0xa044('0x44')],{});db[_0xa044('0xed')][_0xa044('0x11c')](db['MailInteraction'],{});db[_0xa044('0xed')]['belongsTo'](db[_0xa044('0x3f')],{'foreignKey':'FromMailAccountId','as':_0xa044('0x1d0')});db[_0xa044('0xed')][_0xa044('0x11c')](db['User'],{'foreignKey':_0xa044('0x1d1'),'as':_0xa044('0x1d2')});db['MailTransferReport'][_0xa044('0x11c')](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d3'),'as':_0xa044('0x1d4')});db['MailTransferReport'][_0xa044('0x11c')](db[_0xa044('0x41')],{'foreignKey':_0xa044('0x1d5'),'as':_0xa044('0x1d6')});db['MailTransferReport'][_0xa044('0x11c')](db['MailAccount'],{'foreignKey':_0xa044('0x1d7'),'as':'ToAccount'});db[_0xa044('0x1d8')][_0xa044('0x11c')](db['ChatMessage'],{});db[_0xa044('0x1d8')][_0xa044('0x11c')](db['ChatInteraction'],{});db[_0xa044('0x1d8')][_0xa044('0x11c')](db['ChatWebsite'],{'foreignKey':_0xa044('0x1d9'),'as':_0xa044('0x1d0')});db[_0xa044('0x1d8')][_0xa044('0x11c')](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d1'),'as':_0xa044('0x1d2')});db['ChatTransferReport']['belongsTo'](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d3'),'as':'ToAgent'});db[_0xa044('0x1d8')][_0xa044('0x11c')](db[_0xa044('0x70')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0xa044('0x1d8')][_0xa044('0x11c')](db[_0xa044('0x66')],{'foreignKey':_0xa044('0x1da'),'as':'ToAccount'});db['FaxTransferReport'][_0xa044('0x11c')](db['FaxMessage'],{});db['FaxTransferReport'][_0xa044('0x11c')](db[_0xa044('0x115')],{});db[_0xa044('0xf0')][_0xa044('0x11c')](db[_0xa044('0x4c')],{'foreignKey':_0xa044('0x1db'),'as':_0xa044('0x1d0')});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa044('0xf0')][_0xa044('0x11c')](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d3'),'as':_0xa044('0x1d4')});db[_0xa044('0xf0')][_0xa044('0x11c')](db[_0xa044('0x52')],{'foreignKey':_0xa044('0x1dc'),'as':_0xa044('0x1d6')});db[_0xa044('0xf0')][_0xa044('0x11c')](db[_0xa044('0x4c')],{'foreignKey':_0xa044('0x1dd'),'as':_0xa044('0x1de')});db[_0xa044('0xf2')][_0xa044('0x11c')](db[_0xa044('0x64')],{});db[_0xa044('0xf2')][_0xa044('0x11c')](db[_0xa044('0x62')],{});db[_0xa044('0xf2')][_0xa044('0x11c')](db[_0xa044('0x138')],{'foreignKey':_0xa044('0x1df'),'as':'FromAccount'});db[_0xa044('0xf2')][_0xa044('0x11c')](db['User'],{'foreignKey':'FromUserId','as':_0xa044('0x1d2')});db['OpenchannelTransferReport'][_0xa044('0x11c')](db['User'],{'foreignKey':_0xa044('0x1d3'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0xa044('0x11c')](db[_0xa044('0x12e')],{'foreignKey':_0xa044('0x1e0'),'as':_0xa044('0x1d6')});db['OpenchannelTransferReport'][_0xa044('0x11c')](db[_0xa044('0x138')],{'foreignKey':_0xa044('0x1e1'),'as':_0xa044('0x1de')});db[_0xa044('0xf4')][_0xa044('0x11c')](db['SmsMessage'],{});db[_0xa044('0xf4')]['belongsTo'](db['SmsInteraction'],{});db[_0xa044('0xf4')][_0xa044('0x11c')](db['SmsAccount'],{'foreignKey':_0xa044('0x1e2'),'as':'FromAccount'});db[_0xa044('0xf4')][_0xa044('0x11c')](db['User'],{'foreignKey':_0xa044('0x1d1'),'as':_0xa044('0x1d2')});db[_0xa044('0xf4')][_0xa044('0x11c')](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d3'),'as':'ToAgent'});db[_0xa044('0xf4')][_0xa044('0x11c')](db[_0xa044('0x5d')],{'foreignKey':_0xa044('0x1e3'),'as':'ToQueue'});db[_0xa044('0xf4')]['belongsTo'](db[_0xa044('0x56')],{'foreignKey':_0xa044('0x1e4'),'as':'ToAccount'});db[_0xa044('0x121')][_0xa044('0x10d')](db[_0xa044('0x17d')],{'as':_0xa044('0x162'),'foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xa044('0x7d')],{'as':_0xa044('0x1e5'),'foreignKey':_0xa044('0x166')});db[_0xa044('0x121')][_0xa044('0x10d')](db[_0xa044('0x77')],{'as':_0xa044('0x120'),'onDelete':_0xa044('0x110'),'foreignKey':'ListId'});db[_0xa044('0x121')][_0xa044('0x10d')](db[_0xa044('0x7b')],{'as':_0xa044('0x111'),'foreignKey':_0xa044('0x166')});db[_0xa044('0x121')][_0xa044('0x10d')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xa044('0x121')][_0xa044('0x10d')](db[_0xa044('0x7c')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xa044('0x121')]['belongsToMany'](db[_0xa044('0x12b')],{'as':_0xa044('0x1e6'),'through':_0xa044('0x152')});db[_0xa044('0x121')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':'Agents','through':_0xa044('0x123')});db[_0xa044('0xf7')][_0xa044('0x10d')](db[_0xa044('0x10e')],{'as':'Extensions','onDelete':'cascade'});db[_0xa044('0xf7')][_0xa044('0x11d')](db['User'],{'as':_0xa044('0x167'),'through':_0xa044('0x132')});db[_0xa044('0xf9')]['hasMany'](db[_0xa044('0x15')],{'as':_0xa044('0x171'),'foreignKey':_0xa044('0x1e7')});db[_0xa044('0xf9')][_0xa044('0x10d')](db[_0xa044('0x1e8')],{'as':_0xa044('0x1e9'),'foreignKey':_0xa044('0x1e7'),'onDelete':_0xa044('0x110')});db['UserProfileSection'][_0xa044('0x10d')](db[_0xa044('0xfc')],{'as':'Resources','foreignKey':_0xa044('0x1ea'),'onDelete':_0xa044('0x110')});db[_0xa044('0xfe')][_0xa044('0x10d')](db[_0xa044('0x17d')],{'as':_0xa044('0x162'),'foreignKey':_0xa044('0x1eb')});db[_0xa044('0xfe')]['hasMany'](db[_0xa044('0x81')],{'as':_0xa044('0x163'),'foreignKey':_0xa044('0x1eb')});db[_0xa044('0xfe')][_0xa044('0x10d')](db[_0xa044('0x103')],{'as':'Messages','foreignKey':_0xa044('0x1eb')});db[_0xa044('0xfe')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db[_0xa044('0xfe')]['hasMany'](db['WhatsappApplication'],{'as':'Applications'});db[_0xa044('0xfe')][_0xa044('0x11c')](db['CmList'],{'as':_0xa044('0x165'),'foreignKey':_0xa044('0x166')});db[_0xa044('0xfe')][_0xa044('0x11c')](db['Pause'],{'as':_0xa044('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa044('0xfe')][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0xa044('0x11c')](db[_0xa044('0x15')],{'onDelete':_0xa044('0x174')});db[_0xa044('0x100')][_0xa044('0x11c')](db[_0xa044('0x107')],{'onDelete':'restrict'});db[_0xa044('0x100')][_0xa044('0x11c')](db[_0xa044('0xfe')],{'onDelete':'restrict'});db[_0xa044('0x100')][_0xa044('0x11c')](db[_0xa044('0x84')],{'onDelete':_0xa044('0x174'),'foreignKey':'IntervalId'});db['WhatsappApplication']['belongsTo'](db[_0xa044('0x16d')],{'onDelete':_0xa044('0x174'),'foreignKey':_0xa044('0x175')});db['WhatsappInteraction'][_0xa044('0x10d')](db['WhatsappMessage'],{'as':_0xa044('0x157'),'onDelete':_0xa044('0x110'),'foreignKey':'WhatsappInteractionId'});db[_0xa044('0x102')][_0xa044('0x11c')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xa044('0x1eb')});db[_0xa044('0x102')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x102')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x16c'),'foreignKey':_0xa044('0x10c')});db[_0xa044('0x102')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x1ec'),'as':_0xa044('0x16f')});db[_0xa044('0x102')][_0xa044('0x11d')](db[_0xa044('0x16d')],{'through':_0xa044('0x1ec'),'as':'ThroughTags'});db[_0xa044('0x102')]['belongsToMany'](db[_0xa044('0x15')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0xa044('0x1ed')});db[_0xa044('0x103')][_0xa044('0x11c')](db[_0xa044('0x15')],{'as':_0xa044('0x15')});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xa044('0x15e')});db['WhatsappMessage'][_0xa044('0x11c')](db[_0xa044('0x102')],{'onDelete':_0xa044('0x110'),'as':_0xa044('0x173'),'foreignKey':_0xa044('0x1ed')});db[_0xa044('0x103')]['belongsTo'](db[_0xa044('0xfe')],{'as':_0xa044('0x16a'),'foreignKey':_0xa044('0x1eb')});db[_0xa044('0x104')][_0xa044('0x11c')](db['WhatsappAccount'],{});db[_0xa044('0x104')][_0xa044('0x11c')](db[_0xa044('0x121')],{'as':'List','foreignKey':'ListId'});db[_0xa044('0x104')][_0xa044('0x11c')](db[_0xa044('0x77')],{'as':_0xa044('0x15e'),'foreignKey':_0xa044('0x16b')});db[_0xa044('0x104')][_0xa044('0x11c')](db[_0xa044('0x102')],{});db[_0xa044('0x104')][_0xa044('0x11c')](db[_0xa044('0x107')],{});db[_0xa044('0x104')]['belongsTo'](db[_0xa044('0x103')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xa044('0x15')],{});db[_0xa044('0x1ee')][_0xa044('0x11c')](db[_0xa044('0x103')],{});db[_0xa044('0x1ee')][_0xa044('0x11c')](db[_0xa044('0x102')],{});db[_0xa044('0x1ee')]['belongsTo'](db[_0xa044('0xfe')],{'foreignKey':_0xa044('0x1ef'),'as':_0xa044('0x1d0')});db['WhatsappTransferReport'][_0xa044('0x11c')](db[_0xa044('0xfe')],{'foreignKey':_0xa044('0x1f0'),'as':_0xa044('0x1de')});db[_0xa044('0x1ee')][_0xa044('0x11c')](db[_0xa044('0x107')],{'foreignKey':'ToQueueId','as':_0xa044('0x1d6')});db[_0xa044('0x1ee')][_0xa044('0x11c')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xa044('0x1ee')][_0xa044('0x11c')](db[_0xa044('0x15')],{'foreignKey':_0xa044('0x1d3'),'as':_0xa044('0x1d4')});db['WhatsappQueue'][_0xa044('0x11d')](db[_0xa044('0x15')],{'as':_0xa044('0x167'),'through':_0xa044('0x3a'),'foreignKey':_0xa044('0x1f1')});db[_0xa044('0x107')][_0xa044('0x11d')](db[_0xa044('0xe2')],{'through':_0xa044('0x1c9'),'as':_0xa044('0x153')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0e651b8..001a7a9 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7d70=['/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','/apidoc','root','/www','static','join','/demo','/snippet','1.0.16','/plugins','route','resolve','get','appPath','/index.html','path','express-winston','./errors','./config/environment','api','default','use','logger','format','x-forwarded-for','headers','connection','remoteAddress','statusCode','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','url','responseTime','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x7d70,0x1b0));var _0x07d7=function(_0x2016a4,_0x42d37f){_0x2016a4=_0x2016a4-0x0;var _0x58ceb6=_0x7d70[_0x2016a4];return _0x58ceb6;};'use strict';var path=require(_0x07d7('0x0'));var express=require('express');var ewinston=require(_0x07d7('0x1'));var util=require('util');var errors=require(_0x07d7('0x2'));var config=require(_0x07d7('0x3'));var logger=require('./config/logger')(_0x07d7('0x4'));var authLogger=require('./config/logger')('auth');exports[_0x07d7('0x5')]=function(_0x19f422){_0x19f422[_0x07d7('0x6')](ewinston[_0x07d7('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x1bdba0,_0x1c54ab){return util[_0x07d7('0x8')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x1bdba0['method'],_0x1bdba0['headers'][_0x07d7('0x9')]?_0x1bdba0[_0x07d7('0xa')][_0x07d7('0x9')]:_0x1bdba0[_0x07d7('0xb')][_0x07d7('0xc')]||_0x1bdba0['ip'],_0x1bdba0['url'],_0x1c54ab[_0x07d7('0xd')],_0x1c54ab['responseTime'],_0x1bdba0[_0x07d7('0xe')]?_0x1bdba0[_0x07d7('0xe')]['id']:null,_0x1bdba0[_0x07d7('0xe')]?_0x1bdba0['user'][_0x07d7('0xf')]:null,_0x1bdba0['user']?_0x1bdba0[_0x07d7('0xe')][_0x07d7('0x10')]:null);}}));_0x19f422['use'](ewinston[_0x07d7('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2b5f5a,_0x43f912){var _0x37d8a3=_0x07d7('0x11');if(_0x2b5f5a[_0x07d7('0x12')]&&_0x2b5f5a[_0x07d7('0x12')]['device']&&_0x2b5f5a[_0x07d7('0x12')]['agent_id']){_0x37d8a3=_0x07d7('0x13');}return util[_0x07d7('0x8')](_0x37d8a3,_0x2b5f5a[_0x07d7('0x14')],_0x2b5f5a[_0x07d7('0xa')][_0x07d7('0x9')]?_0x2b5f5a[_0x07d7('0xa')][_0x07d7('0x9')]:_0x2b5f5a[_0x07d7('0xb')]['remoteAddress']||_0x2b5f5a['ip'],_0x2b5f5a[_0x07d7('0x15')],_0x43f912[_0x07d7('0xd')],_0x43f912[_0x07d7('0x16')],_0x2b5f5a[_0x07d7('0xe')]?_0x2b5f5a[_0x07d7('0xe')]['id']:null,_0x2b5f5a[_0x07d7('0xe')]?_0x2b5f5a[_0x07d7('0xe')][_0x07d7('0xf')]:null,_0x2b5f5a['user']?_0x2b5f5a[_0x07d7('0xe')][_0x07d7('0x10')]:null,_0x2b5f5a[_0x07d7('0x12')]&&_0x2b5f5a['body']['device']?_0x2b5f5a[_0x07d7('0x12')][_0x07d7('0x17')]:_0x07d7('0x18'),_0x2b5f5a[_0x07d7('0x12')]&&_0x2b5f5a[_0x07d7('0x12')]['agent_id']?_0x2b5f5a[_0x07d7('0x12')]['agent_id']:'',_0x2b5f5a[_0x07d7('0x12')]&&_0x2b5f5a[_0x07d7('0x12')][_0x07d7('0x19')]?_0x2b5f5a[_0x07d7('0x12')][_0x07d7('0x19')]:'');},'ignoreRoute':function(_0x243e98){var _0x5aed64=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5aed64[_0x07d7('0x1a')](_0x243e98['url']);}}));_0x19f422[_0x07d7('0x6')](_0x07d7('0x1b'),require(_0x07d7('0x1c')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x1d'),require('./api/voiceChanSpy'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x1e'),require(_0x07d7('0x1f')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x20'),require('./api/voiceExtension'));_0x19f422['use']('/api/voice/mohs',require(_0x07d7('0x21')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x22'),require(_0x07d7('0x23')));_0x19f422[_0x07d7('0x6')]('/api/voice/recordings',require(_0x07d7('0x24')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x25'),require(_0x07d7('0x26')));_0x19f422[_0x07d7('0x6')]('/api/voice/mails',require('./api/voiceMail'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x27'),require(_0x07d7('0x28')));_0x19f422[_0x07d7('0x6')]('/api/voice/calls/reports',require(_0x07d7('0x29')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x2a'),require(_0x07d7('0x2b')));_0x19f422['use']('/api/voice/agents/reports',require(_0x07d7('0x2c')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x2d'),require(_0x07d7('0x2e')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x2f'),require(_0x07d7('0x30')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x31'),require(_0x07d7('0x32')));_0x19f422['use']('/api/voice/transfers/reports',require(_0x07d7('0x33')));_0x19f422[_0x07d7('0x6')]('/api/mail/out_servers',require(_0x07d7('0x34')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x35'),require(_0x07d7('0x36')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x37'),require(_0x07d7('0x38')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x39'),require('./api/mailSubstatus'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x3a'),require('./api/mailInteraction'));_0x19f422['use'](_0x07d7('0x3b'),require(_0x07d7('0x3c')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x3d'),require(_0x07d7('0x3e')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x3f'),require(_0x07d7('0x40')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x41'),require(_0x07d7('0x42')));_0x19f422[_0x07d7('0x6')]('/api/dashboards/items',require(_0x07d7('0x43')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x44'),require(_0x07d7('0x45')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x46'),require(_0x07d7('0x47')));_0x19f422['use'](_0x07d7('0x48'),require(_0x07d7('0x49')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x4a'),require(_0x07d7('0x4b')));_0x19f422[_0x07d7('0x6')]('/api/fax/queues',require(_0x07d7('0x4c')));_0x19f422['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x4d'),require('./api/smsAccount'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x4e'),require(_0x07d7('0x4f')));_0x19f422['use'](_0x07d7('0x50'),require(_0x07d7('0x51')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x52'),require('./api/smsMessage'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x53'),require(_0x07d7('0x54')));_0x19f422['use'](_0x07d7('0x55'),require('./api/openchannelAccount'));_0x19f422[_0x07d7('0x6')]('/api/openchannel/applications',require(_0x07d7('0x56')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x57'),require('./api/openchannelInteraction'));_0x19f422['use'](_0x07d7('0x58'),require('./api/openchannelMessage'));_0x19f422[_0x07d7('0x6')]('/api/openchannel/queues',require(_0x07d7('0x59')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x5a'),require('./api/chatWebsite'));_0x19f422['use'](_0x07d7('0x5b'),require(_0x07d7('0x5c')));_0x19f422['use'](_0x07d7('0x5d'),require(_0x07d7('0x5e')));_0x19f422['use'](_0x07d7('0x5f'),require(_0x07d7('0x60')));_0x19f422['use'](_0x07d7('0x61'),require(_0x07d7('0x62')));_0x19f422['use']('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x63'),require(_0x07d7('0x64')));_0x19f422['use'](_0x07d7('0x65'),require(_0x07d7('0x66')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x67'),require('./api/chatProactiveAction'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x68'),require(_0x07d7('0x69')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x6a'),require(_0x07d7('0x6b')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x6c'),require(_0x07d7('0x6d')));_0x19f422['use'](_0x07d7('0x6e'),require(_0x07d7('0x6f')));_0x19f422['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x70'),require('./api/cmHopperHistory'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x71'),require(_0x07d7('0x72')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x73'),require(_0x07d7('0x74')));_0x19f422[_0x07d7('0x6')]('/api/automations',require(_0x07d7('0x75')));_0x19f422[_0x07d7('0x6')]('/api/canned_answers',require(_0x07d7('0x76')));_0x19f422['use']('/api/dispositions',require(_0x07d7('0x77')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x78'),require(_0x07d7('0x79')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x7a'),require(_0x07d7('0x7b')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x7c'),require(_0x07d7('0x7d')));_0x19f422['use'](_0x07d7('0x7e'),require(_0x07d7('0x7f')));_0x19f422['use'](_0x07d7('0x80'),require(_0x07d7('0x81')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x82'),require(_0x07d7('0x83')));_0x19f422['use']('/api/sounds',require(_0x07d7('0x84')));_0x19f422['use'](_0x07d7('0x85'),require('./api/tag'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x86'),require(_0x07d7('0x87')));_0x19f422['use'](_0x07d7('0x88'),require(_0x07d7('0x89')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x8a'),require(_0x07d7('0x8b')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x8c'),require(_0x07d7('0x8d')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x8e'),require(_0x07d7('0x8f')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x90'),require(_0x07d7('0x91')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x92'),require(_0x07d7('0x93')));_0x19f422['use'](_0x07d7('0x94'),require(_0x07d7('0x95')));_0x19f422['use'](_0x07d7('0x96'),require(_0x07d7('0x97')));_0x19f422[_0x07d7('0x6')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x19f422['use']('/api/analytics/tree_reports',require(_0x07d7('0x98')));_0x19f422[_0x07d7('0x6')]('/api/integrations/salesforce/accounts',require(_0x07d7('0x99')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x9a'),require(_0x07d7('0x9b')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x9c'),require('./api/intSalesforceField'));_0x19f422['use'](_0x07d7('0x9d'),require('./api/intSugarcrmAccount'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x9e'),require(_0x07d7('0x9f')));_0x19f422['use'](_0x07d7('0xa0'),require('./api/intSugarcrmField'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xa1'),require(_0x07d7('0xa2')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xa3'),require(_0x07d7('0xa4')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xa5'),require('./api/intDeskField'));_0x19f422['use'](_0x07d7('0xa6'),require(_0x07d7('0xa7')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xa8'),require(_0x07d7('0xa9')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xaa'),require('./api/intZohoField'));_0x19f422['use']('/api/integrations/zendesk/accounts',require(_0x07d7('0xab')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xac'),require(_0x07d7('0xad')));_0x19f422[_0x07d7('0x6')]('/api/integrations/zendesk/fields',require(_0x07d7('0xae')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xaf'),require('./api/intFreshdeskAccount'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xb0'),require(_0x07d7('0xb1')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xb2'),require('./api/intFreshdeskField'));_0x19f422['use'](_0x07d7('0xb3'),require(_0x07d7('0xb4')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xb5'),require(_0x07d7('0xb6')));_0x19f422[_0x07d7('0x6')]('/api/integrations/vtiger/fields',require(_0x07d7('0xb7')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xb8'),require(_0x07d7('0xb9')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xba'),require(_0x07d7('0xbb')));_0x19f422['use'](_0x07d7('0xbc'),require('./api/intServicenowField'));_0x19f422['use'](_0x07d7('0xbd'),require(_0x07d7('0xbe')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xbf'),require('./api/intDynamics365Configuration'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xc0'),require(_0x07d7('0xc1')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xc2'),require('./api/intFreshsalesAccount'));_0x19f422['use'](_0x07d7('0xc3'),require(_0x07d7('0xc4')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xc5'),require(_0x07d7('0xc6')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xc7'),require(_0x07d7('0xc8')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xc9'),require(_0x07d7('0xca')));_0x19f422['use']('/api/chat/internal/messages',require(_0x07d7('0xcb')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xcc'),require(_0x07d7('0xcd')));_0x19f422['use'](_0x07d7('0xce'),require(_0x07d7('0xcf')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xd0'),require(_0x07d7('0xd1')));_0x19f422['use'](_0x07d7('0xd2'),require(_0x07d7('0xd3')));_0x19f422['use'](_0x07d7('0xd4'),require(_0x07d7('0xd5')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xd6'),require(_0x07d7('0xd7')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xd8'),require(_0x07d7('0xd9')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xda'),require('./api/setting'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xdb'),require('./api/squareOdbc'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xdc'),require(_0x07d7('0xdd')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xde'),require(_0x07d7('0xdf')));_0x19f422['use']('/api/square/messages',require('./api/squareMessage'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe0'),require(_0x07d7('0xe1')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe2'),require(_0x07d7('0xe3')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe4'),require(_0x07d7('0xe5')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe6'),require('./api/migration'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe7'),require(_0x07d7('0xe8')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xe9'),require(_0x07d7('0xea')));_0x19f422['use'](_0x07d7('0xeb'),require(_0x07d7('0xec')));_0x19f422[_0x07d7('0x6')]('/api/chat/reports/transfer',require(_0x07d7('0xed')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xee'),require(_0x07d7('0xef')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xf0'),require(_0x07d7('0xf1')));_0x19f422[_0x07d7('0x6')]('/api/sms/reports/transfer',require(_0x07d7('0xf2')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xf3'),require('./api/cmList'));_0x19f422[_0x07d7('0x6')](_0x07d7('0xf4'),require(_0x07d7('0xf5')));_0x19f422['use'](_0x07d7('0xf6'),require(_0x07d7('0xf7')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xf8'),require(_0x07d7('0xf9')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xfa'),require(_0x07d7('0xfb')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xfc'),require(_0x07d7('0xfd')));_0x19f422[_0x07d7('0x6')](_0x07d7('0xfe'),require(_0x07d7('0xff')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x100'),require(_0x07d7('0x101')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x102'),require(_0x07d7('0x103')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x104'),require(_0x07d7('0x105')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x106'),require(_0x07d7('0x107')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x108'),require(_0x07d7('0x109')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x10a'),require(_0x07d7('0x10b')));_0x19f422[_0x07d7('0x6')]('/api/cloudProviders',require(_0x07d7('0x10c')));_0x19f422['use'](_0x07d7('0x10d'),require('./api/authLocal'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x10e'),require(_0x07d7('0x10f')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x110'),require('./api/jira'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x111'),require(_0x07d7('0x112')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x113'),require(_0x07d7('0x114')));_0x19f422[_0x07d7('0x6')]('/api/system',require(_0x07d7('0x115')));_0x19f422[_0x07d7('0x6')]('/api/pm2',require(_0x07d7('0x116')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x117'),require('./api/webbar'));_0x19f422[_0x07d7('0x6')](_0x07d7('0x118'),express['static'](path['join'](config[_0x07d7('0x119')],_0x07d7('0x118'))));_0x19f422['use'](_0x07d7('0x11a'),express[_0x07d7('0x11b')](path[_0x07d7('0x11c')](config[_0x07d7('0x119')],'/www')));_0x19f422[_0x07d7('0x6')](_0x07d7('0x11d'),express[_0x07d7('0x11b')](path['join'](config['root'],_0x07d7('0x11d'))));_0x19f422[_0x07d7('0x6')](_0x07d7('0x11e'),express[_0x07d7('0x11b')](path[_0x07d7('0x11c')](config[_0x07d7('0x119')],'snippet',_0x07d7('0x11f'))));_0x19f422['use'](_0x07d7('0x120'),express[_0x07d7('0x11b')](path[_0x07d7('0x11c')](config[_0x07d7('0x119')],'/server/files/plugins')));_0x19f422['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x19f422[_0x07d7('0x121')]('/*')['get'](function(_0x3fedfd,_0x47faae){_0x47faae['sendFile'](path[_0x07d7('0x122')](_0x19f422[_0x07d7('0x123')](_0x07d7('0x124'))+_0x07d7('0x125')));});}; \ No newline at end of file +var _0x1a84=['/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/setting','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','get','resolve','/index.html','path','util','./errors','./config/environment','./config/logger','auth','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','url','statusCode','responseTime','user','name','device','body','agent_id','remoteAddress','role','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields'];(function(_0xd3aebe,_0x4c0a60){var _0x279df7=function(_0x412968){while(--_0x412968){_0xd3aebe['push'](_0xd3aebe['shift']());}};_0x279df7(++_0x4c0a60);}(_0x1a84,0x69));var _0x41a8=function(_0xc1c93f,_0x1fba71){_0xc1c93f=_0xc1c93f-0x0;var _0x3f81cb=_0x1a84[_0xc1c93f];return _0x3f81cb;};'use strict';var path=require(_0x41a8('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require(_0x41a8('0x1'));var errors=require(_0x41a8('0x2'));var config=require(_0x41a8('0x3'));var logger=require(_0x41a8('0x4'))('api');var authLogger=require('./config/logger')(_0x41a8('0x5'));exports[_0x41a8('0x6')]=function(_0x30deae){_0x30deae[_0x41a8('0x7')](ewinston[_0x41a8('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x239908,_0x5ac35a){return util[_0x41a8('0x9')](_0x41a8('0xa'),_0x239908[_0x41a8('0xb')],_0x239908[_0x41a8('0xc')][_0x41a8('0xd')]?_0x239908[_0x41a8('0xc')][_0x41a8('0xd')]:_0x239908[_0x41a8('0xe')]['remoteAddress']||_0x239908['ip'],_0x239908[_0x41a8('0xf')],_0x5ac35a[_0x41a8('0x10')],_0x5ac35a[_0x41a8('0x11')],_0x239908[_0x41a8('0x12')]?_0x239908[_0x41a8('0x12')]['id']:null,_0x239908['user']?_0x239908['user'][_0x41a8('0x13')]:null,_0x239908[_0x41a8('0x12')]?_0x239908[_0x41a8('0x12')]['role']:null);}}));_0x30deae[_0x41a8('0x7')](ewinston[_0x41a8('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2fb576,_0x15d49a){var _0x49e4bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2fb576['body']&&_0x2fb576['body'][_0x41a8('0x14')]&&_0x2fb576[_0x41a8('0x15')][_0x41a8('0x16')]){_0x49e4bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x41a8('0x9')](_0x49e4bc,_0x2fb576[_0x41a8('0xb')],_0x2fb576[_0x41a8('0xc')][_0x41a8('0xd')]?_0x2fb576['headers'][_0x41a8('0xd')]:_0x2fb576[_0x41a8('0xe')][_0x41a8('0x17')]||_0x2fb576['ip'],_0x2fb576[_0x41a8('0xf')],_0x15d49a['statusCode'],_0x15d49a[_0x41a8('0x11')],_0x2fb576[_0x41a8('0x12')]?_0x2fb576['user']['id']:null,_0x2fb576[_0x41a8('0x12')]?_0x2fb576['user'][_0x41a8('0x13')]:null,_0x2fb576[_0x41a8('0x12')]?_0x2fb576[_0x41a8('0x12')][_0x41a8('0x18')]:null,_0x2fb576['body']&&_0x2fb576[_0x41a8('0x15')]['device']?_0x2fb576['body'][_0x41a8('0x14')]:_0x41a8('0x19'),_0x2fb576[_0x41a8('0x15')]&&_0x2fb576[_0x41a8('0x15')][_0x41a8('0x16')]?_0x2fb576[_0x41a8('0x15')][_0x41a8('0x16')]:'',_0x2fb576[_0x41a8('0x15')]&&_0x2fb576[_0x41a8('0x15')][_0x41a8('0x1a')]?_0x2fb576[_0x41a8('0x15')]['agent_name']:'');},'ignoreRoute':function(_0x437bcd){var _0x5f33a6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5f33a6[_0x41a8('0x1b')](_0x437bcd['url']);}}));_0x30deae[_0x41a8('0x7')](_0x41a8('0x1c'),require(_0x41a8('0x1d')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x1e'),require(_0x41a8('0x1f')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x20'),require(_0x41a8('0x21')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x22'),require('./api/voiceExtension'));_0x30deae[_0x41a8('0x7')]('/api/voice/mohs',require(_0x41a8('0x23')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x24'),require('./api/voiceQueue'));_0x30deae['use'](_0x41a8('0x25'),require(_0x41a8('0x26')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x27'),require('./api/screenRecording'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x28'),require(_0x41a8('0x29')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x2a'),require(_0x41a8('0x2b')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x2c'),require(_0x41a8('0x2d')));_0x30deae[_0x41a8('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x2e'),require(_0x41a8('0x2f')));_0x30deae[_0x41a8('0x7')]('/api/voice/queues/reports',require(_0x41a8('0x30')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x31'),require(_0x41a8('0x32')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x33'),require(_0x41a8('0x34')));_0x30deae[_0x41a8('0x7')]('/api/voice/transfers/reports',require(_0x41a8('0x35')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x36'),require(_0x41a8('0x37')));_0x30deae[_0x41a8('0x7')]('/api/mail/accounts',require('./api/mailAccount'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x38'),require(_0x41a8('0x39')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x3a'),require(_0x41a8('0x3b')));_0x30deae[_0x41a8('0x7')]('/api/mail/interactions',require(_0x41a8('0x3c')));_0x30deae['use'](_0x41a8('0x3d'),require(_0x41a8('0x3e')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x3f'),require(_0x41a8('0x40')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x41'),require(_0x41a8('0x42')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x43'),require('./api/dashboard'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x44'),require(_0x41a8('0x45')));_0x30deae[_0x41a8('0x7')]('/api/fax/accounts',require(_0x41a8('0x46')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x47'),require(_0x41a8('0x48')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x49'),require('./api/faxInteraction'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x4a'),require(_0x41a8('0x4b')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x4c'),require(_0x41a8('0x4d')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x4e'),require('./api/faxQueueReport'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x4f'),require('./api/smsAccount'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x50'),require(_0x41a8('0x51')));_0x30deae[_0x41a8('0x7')]('/api/sms/interactions',require(_0x41a8('0x52')));_0x30deae[_0x41a8('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x30deae[_0x41a8('0x7')]('/api/sms/queues',require(_0x41a8('0x53')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x54'),require(_0x41a8('0x55')));_0x30deae['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0x30deae['use'](_0x41a8('0x56'),require(_0x41a8('0x57')));_0x30deae['use'](_0x41a8('0x58'),require('./api/openchannelMessage'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x59'),require(_0x41a8('0x5a')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x5b'),require(_0x41a8('0x5c')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x5d'),require(_0x41a8('0x5e')));_0x30deae['use'](_0x41a8('0x5f'),require('./api/chatApplication'));_0x30deae['use'](_0x41a8('0x60'),require(_0x41a8('0x61')));_0x30deae[_0x41a8('0x7')]('/api/chat/messages',require(_0x41a8('0x62')));_0x30deae[_0x41a8('0x7')]('/api/chat/offline_messages',require(_0x41a8('0x63')));_0x30deae['use'](_0x41a8('0x64'),require('./api/chatQueue'));_0x30deae[_0x41a8('0x7')]('/api/chat/groups',require(_0x41a8('0x65')));_0x30deae['use'](_0x41a8('0x66'),require(_0x41a8('0x67')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x68'),require(_0x41a8('0x69')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x6a'),require(_0x41a8('0x6b')));_0x30deae['use'](_0x41a8('0x6c'),require(_0x41a8('0x6d')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x6e'),require(_0x41a8('0x6f')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x70'),require('./api/cmHopperFinal'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x71'),require(_0x41a8('0x72')));_0x30deae['use'](_0x41a8('0x73'),require('./api/cmCustomField'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x74'),require('./api/action'));_0x30deae['use']('/api/automations',require(_0x41a8('0x75')));_0x30deae['use'](_0x41a8('0x76'),require(_0x41a8('0x77')));_0x30deae['use'](_0x41a8('0x78'),require(_0x41a8('0x79')));_0x30deae['use'](_0x41a8('0x7a'),require(_0x41a8('0x7b')));_0x30deae[_0x41a8('0x7')]('/api/intervals',require(_0x41a8('0x7c')));_0x30deae['use'](_0x41a8('0x7d'),require(_0x41a8('0x7e')));_0x30deae['use'](_0x41a8('0x7f'),require('./api/cdr'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x80'),require(_0x41a8('0x81')));_0x30deae['use'](_0x41a8('0x82'),require(_0x41a8('0x83')));_0x30deae['use']('/api/sounds',require(_0x41a8('0x84')));_0x30deae['use'](_0x41a8('0x85'),require('./api/tag'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x86'),require(_0x41a8('0x87')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x88'),require(_0x41a8('0x89')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x8a'),require(_0x41a8('0x8b')));_0x30deae['use'](_0x41a8('0x8c'),require(_0x41a8('0x8d')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x8e'),require(_0x41a8('0x8f')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x90'),require(_0x41a8('0x91')));_0x30deae[_0x41a8('0x7')]('/api/analytics/default_reports',require(_0x41a8('0x92')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x93'),require('./api/analyticExtractedReport'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x94'),require(_0x41a8('0x95')));_0x30deae['use'](_0x41a8('0x96'),require(_0x41a8('0x97')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x98'),require(_0x41a8('0x99')));_0x30deae['use'](_0x41a8('0x9a'),require(_0x41a8('0x9b')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x9c'),require(_0x41a8('0x9d')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x9e'),require(_0x41a8('0x9f')));_0x30deae['use'](_0x41a8('0xa0'),require('./api/intSugarcrmAccount'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xa1'),require(_0x41a8('0xa2')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xa3'),require(_0x41a8('0xa4')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xa5'),require('./api/intDeskAccount'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xa6'),require('./api/intDeskConfiguration'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xa7'),require(_0x41a8('0xa8')));_0x30deae['use'](_0x41a8('0xa9'),require(_0x41a8('0xaa')));_0x30deae['use'](_0x41a8('0xab'),require(_0x41a8('0xac')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xad'),require(_0x41a8('0xae')));_0x30deae[_0x41a8('0x7')]('/api/integrations/zendesk/accounts',require(_0x41a8('0xaf')));_0x30deae['use']('/api/integrations/zendesk/configurations',require(_0x41a8('0xb0')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xb1'),require('./api/intZendeskField'));_0x30deae['use'](_0x41a8('0xb2'),require(_0x41a8('0xb3')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xb4'),require('./api/intFreshdeskConfiguration'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xb5'),require('./api/intFreshdeskField'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xb6'),require(_0x41a8('0xb7')));_0x30deae['use'](_0x41a8('0xb8'),require(_0x41a8('0xb9')));_0x30deae['use'](_0x41a8('0xba'),require(_0x41a8('0xbb')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xbc'),require(_0x41a8('0xbd')));_0x30deae['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xbe'),require('./api/intServicenowField'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xbf'),require(_0x41a8('0xc0')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xc1'),require(_0x41a8('0xc2')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xc3'),require(_0x41a8('0xc4')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xc5'),require(_0x41a8('0xc6')));_0x30deae[_0x41a8('0x7')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xc7'),require(_0x41a8('0xc8')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xc9'),require('./api/network'));_0x30deae[_0x41a8('0x7')]('/api/chat/reports/queue',require(_0x41a8('0xca')));_0x30deae['use'](_0x41a8('0xcb'),require(_0x41a8('0xcc')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xcd'),require(_0x41a8('0xce')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xcf'),require('./api/jscriptyQuestionReport'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xd0'),require(_0x41a8('0xd1')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xd2'),require(_0x41a8('0xd3')));_0x30deae[_0x41a8('0x7')]('/api/square/reports',require(_0x41a8('0xd4')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xd5'),require(_0x41a8('0xd6')));_0x30deae[_0x41a8('0x7')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x30deae[_0x41a8('0x7')]('/api/settings',require(_0x41a8('0xd7')));_0x30deae[_0x41a8('0x7')]('/api/square/odbc',require('./api/squareOdbc'));_0x30deae['use'](_0x41a8('0xd8'),require(_0x41a8('0xd9')));_0x30deae[_0x41a8('0x7')]('/api/square/recordings',require(_0x41a8('0xda')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xdb'),require(_0x41a8('0xdc')));_0x30deae['use'](_0x41a8('0xdd'),require(_0x41a8('0xde')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xdf'),require(_0x41a8('0xe0')));_0x30deae['use'](_0x41a8('0xe1'),require(_0x41a8('0xe2')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xe3'),require('./api/migration'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xe4'),require('./api/attachment'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xe5'),require(_0x41a8('0xe6')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xe7'),require(_0x41a8('0xe8')));_0x30deae['use'](_0x41a8('0xe9'),require('./api/chatTransferReport'));_0x30deae[_0x41a8('0x7')](_0x41a8('0xea'),require(_0x41a8('0xeb')));_0x30deae[_0x41a8('0x7')]('/api/openchannel/reports/transfer',require(_0x41a8('0xec')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xed'),require(_0x41a8('0xee')));_0x30deae['use'](_0x41a8('0xef'),require(_0x41a8('0xf0')));_0x30deae['use'](_0x41a8('0xf1'),require(_0x41a8('0xf2')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xf3'),require(_0x41a8('0xf4')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xf5'),require(_0x41a8('0xf6')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xf7'),require(_0x41a8('0xf8')));_0x30deae['use'](_0x41a8('0xf9'),require(_0x41a8('0xfa')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xfb'),require(_0x41a8('0xfc')));_0x30deae['use']('/api/whatsapp/applications',require(_0x41a8('0xfd')));_0x30deae[_0x41a8('0x7')](_0x41a8('0xfe'),require('./api/whatsappInteraction'));_0x30deae['use']('/api/whatsapp/messages',require(_0x41a8('0xff')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x100'),require(_0x41a8('0x101')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x102'),require(_0x41a8('0x103')));_0x30deae['use'](_0x41a8('0x104'),require(_0x41a8('0x105')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x106'),require(_0x41a8('0x107')));_0x30deae[_0x41a8('0x7')]('/api/auth/local',require('./api/authLocal'));_0x30deae['use']('/api/auth/google',require('./api/authGoogle'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x108'),require(_0x41a8('0x109')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x10a'),require('./api/rpc'));_0x30deae[_0x41a8('0x7')](_0x41a8('0x10b'),require(_0x41a8('0x10c')));_0x30deae[_0x41a8('0x7')]('/api/system',require(_0x41a8('0x10d')));_0x30deae[_0x41a8('0x7')]('/api/pm2',require(_0x41a8('0x10e')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x10f'),require(_0x41a8('0x110')));_0x30deae['use'](_0x41a8('0x111'),express['static'](path[_0x41a8('0x112')](config[_0x41a8('0x113')],_0x41a8('0x111'))));_0x30deae[_0x41a8('0x7')](_0x41a8('0x114'),express[_0x41a8('0x115')](path[_0x41a8('0x112')](config[_0x41a8('0x113')],'/www')));_0x30deae[_0x41a8('0x7')]('/demo',express['static'](path[_0x41a8('0x112')](config[_0x41a8('0x113')],_0x41a8('0x116'))));_0x30deae[_0x41a8('0x7')](_0x41a8('0x117'),express['static'](path[_0x41a8('0x112')](config[_0x41a8('0x113')],_0x41a8('0x118'),'1.0.16')));_0x30deae[_0x41a8('0x7')](_0x41a8('0x119'),express['static'](path[_0x41a8('0x112')](config[_0x41a8('0x113')],_0x41a8('0x11a'))));_0x30deae[_0x41a8('0x11b')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x41a8('0x11c')](errors[0x194]);_0x30deae['route']('/*')[_0x41a8('0x11c')](function(_0x522e58,_0x7fcde4){_0x7fcde4['sendFile'](path[_0x41a8('0x11d')](_0x30deae['get']('appPath')+_0x41a8('0x11e')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7360b0f..294e314 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f24=['../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f24,0x10e));var _0x41f2=function(_0x2553af,_0x30d90e){_0x2553af=_0x2553af-0x0;var _0x53ab3c=_0x1f24[_0x2553af];return _0x53ab3c;};'use strict';var jayson=require(_0x41f2('0x0'));var BPromise=require(_0x41f2('0x1'));var _=require(_0x41f2('0x2'));var config=require('../config/environment');exports[_0x41f2('0x3')]=function(){return new BPromise(function(_0x1dc63e,_0x5337e9){var _0x56266e={};_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x4')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/voiceExtension/voiceExtension.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x6')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/voiceRecording/voiceRecording.rpc'));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x7')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x8')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x9')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0xa')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0xb')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0xc')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0xd')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0xe')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0xf')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x10')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x11')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x12')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x13')));_0x56266e=_['merge'](_0x56266e,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x14')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x15')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x16')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x17')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x18')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x19')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x1a')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/smsMessage/smsMessage.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x1b')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x1c')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x1d')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x1e')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x1f')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x20')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/chatQueue/chatQueue.rpc'));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x21')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x22')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x23')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x24')));_0x56266e=_['merge'](_0x56266e,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x25')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/interval/interval.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x26')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x27')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x28')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x29')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x2a')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x2b')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x2c')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x2d')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x2e')));_0x56266e=_['merge'](_0x56266e,require(_0x41f2('0x2f')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x30')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x31')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x32')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x33')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x34')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/squareOdbc/squareOdbc.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require('../api/squareProject/squareProject.rpc'));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x35')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x36')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x37')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x38')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x39')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x3a')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x3b')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x3c')));_0x56266e=_[_0x41f2('0x5')](_0x56266e,require(_0x41f2('0x3d')));_0x56266e=_['merge'](_0x56266e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x27b3b6=jayson[_0x41f2('0x3e')](_0x56266e)[_0x41f2('0x3f')]();var _0x4c1da4=config[_0x41f2('0x40')][_0x41f2('0x41')]||config[_0x41f2('0x41')]+0x1;var _0x1b696d=config[_0x41f2('0x40')]['ip']||'localhost';_0x27b3b6['on'](_0x41f2('0x42'),function(_0x416d2d){return _0x5337e9(_0x416d2d);});_0x27b3b6[_0x41f2('0x3')](_0x4c1da4,_0x1b696d,function(){console[_0x41f2('0x43')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1b696d,_0x4c1da4);require(_0x41f2('0x44'))[_0x41f2('0x45')]();return _0x1dc63e(_0x41f2('0x46')+_0x1b696d+':'+_0x4c1da4);});});}; \ No newline at end of file +var _0xe928=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.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/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe928,0x7a));var _0x8e92=function(_0x2bb452,_0x2dbbc0){_0x2bb452=_0x2bb452-0x0;var _0x5f50a6=_0xe928[_0x2bb452];return _0x5f50a6;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0x8e92('0x0'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x30f078,_0x2b0ce5){var _0x5f045f={};_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/user/user.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x2')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x3')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x4')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x5')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x6')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x7')));_0x5f045f=_['merge'](_0x5f045f,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x8')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x9')));_0x5f045f=_['merge'](_0x5f045f,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xa')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/mailServerIn/mailServerIn.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xb')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xc')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/mailInteraction/mailInteraction.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xd')));_0x5f045f=_['merge'](_0x5f045f,require('../api/mailApplication/mailApplication.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xe')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0xf')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x10')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x11')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x12')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/faxQueue/faxQueue.rpc'));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x13')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x14')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x15')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x16')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x17')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x18')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x19')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1a')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1b')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1c')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1d')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/chatMessage/chatMessage.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/chatQueue/chatQueue.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/cmContact/cmContact.rpc'));_0x5f045f=_['merge'](_0x5f045f,require('../api/cmHopper/cmHopper.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1e')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x1f')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x20')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/sound/sound.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x21')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x22')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x23')));_0x5f045f=_['merge'](_0x5f045f,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x24')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x25')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x26')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x27')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x28')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x29')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x2a')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x2b')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x2c')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x2d')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x2e')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x2f')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x30')));_0x5f045f=_['merge'](_0x5f045f,require('../api/squareProject/squareProject.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/squareRecording/squareRecording.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/squareMessage/squareMessage.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x31')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x32')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x33')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x34')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x35')));_0x5f045f=_[_0x8e92('0x1')](_0x5f045f,require(_0x8e92('0x36')));_0x5f045f=_['merge'](_0x5f045f,require(_0x8e92('0x37')));var _0x247881=jayson[_0x8e92('0x38')](_0x5f045f)['http']();var _0x367649=config[_0x8e92('0x39')][_0x8e92('0x3a')]||config[_0x8e92('0x3a')]+0x1;var _0x36e3ca=config['rpc']['ip']||'localhost';_0x247881['on'](_0x8e92('0x3b'),function(_0x165cfe){return _0x2b0ce5(_0x165cfe);});_0x247881['listen'](_0x367649,_0x36e3ca,function(){console[_0x8e92('0x3c')](_0x8e92('0x3d'),_0x36e3ca,_0x367649);require(_0x8e92('0x3e'))[_0x8e92('0x3f')]();return _0x30f078(_0x8e92('0x40')+_0x36e3ca+':'+_0x367649);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 942a346..0dae85d 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 _0xa9e0=['utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','util','lodash','events','./error','call'];(function(_0x3fc3b8,_0xa0aa0e){var _0x4fdd19=function(_0x17dbc4){while(--_0x17dbc4){_0x3fc3b8['push'](_0x3fc3b8['shift']());}};_0x4fdd19(++_0xa0aa0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x0a9e('0x3'));function AGIChannel(_0x4ce2f1){var _0x333808=this,_0x432180=new AGIReply(),_0x2ab90b=![],_0x991246={};EventEmitter[_0x0a9e('0x4')](_0x333808);_0x4ce2f1['setEncoding'](_0x0a9e('0x5'));_0x4ce2f1[_0x0a9e('0x6')](0x8*0x3c*0x3c*0x3e8);_0x432180[_0x0a9e('0x7')]('utf8');_0x432180['on']('headers',function(_0xe42b77){for(var _0x56465b in _0xe42b77){_0x333808[_0x56465b]=_0xe42b77[_0x56465b];}_0x333808['emit'](_0x0a9e('0x8'));});_0x432180['on'](_0x0a9e('0x9'),function(_0x307b3e){if(_0x307b3e[_0x0a9e('0xa')]()==_0x0a9e('0xb')){_0x333808[_0x0a9e('0xc')]('hangup');return;}if(_0x307b3e['substring'](0x0,0xb)=='520-Invalid'){_0x2ab90b=!![];}if(_0x2ab90b){_0x991246['rx']+=_0x307b3e+'\x0a';if(_0x307b3e['search'](_0x0a9e('0xd'))!=-0x1){_0x2ab90b=![];}}else{_0x991246['rx']=_0x307b3e;}if(_0x2ab90b){return;}if(typeof _0x991246['cb']==_0x0a9e('0xe')){var _0xd5b662=_0x991246['rx'][_0x0a9e('0xf')](0x0,0x3),_0x26d672=null,_0x32d742=null;_0xd5b662=parseInt(_0xd5b662);if(isNaN(_0xd5b662)){_0x991246['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd5b662!=0xc8){_0x991246['cb'](null,{'code':_0xd5b662,'result':-0x1,'extra':'KO'});return;}_0x26d672=_0x991246['rx'][_0x0a9e('0xf')](0x4)[_0x0a9e('0x10')](_0x0a9e('0x11'),'');if(_0x26d672[_0x0a9e('0x12')]('\x20')!=-0x1){_0x26d672=_0x26d672[_0x0a9e('0x13')](0x0,_0x26d672[_0x0a9e('0x12')]('\x20'));}if(_['startsWith'](_0x26d672,'-1')){_0x26d672=parseInt(_0x26d672);}_0x32d742=_0x991246['rx'][_0x0a9e('0x14')]('\x20');if(_0x32d742['length']==0x3){_0x32d742=_0x32d742[0x2][_0x0a9e('0xf')](0x1,_0x32d742[0x2]['length']-0x1);}else if(_0x32d742[_0x0a9e('0x15')]>0x3){var _0x12066b=/\((.+)\)/;var _0x48f32d=_0x991246['rx'][_0x0a9e('0x16')](_0x12066b);if(_0x48f32d){_0x32d742=_0x48f32d[0x1];}else{_0x32d742=null;}}else{_0x32d742=null;}_0x991246['cb'](null,{'code':_0xd5b662,'result':_0x26d672,'extra':_0x32d742});}});_0x4ce2f1['on']('error',function(_0x459eb1){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x17'),new AGIError(_0x0a9e('0x18'),_0x459eb1[_0x0a9e('0x19')]));});_0x4ce2f1['on'](_0x0a9e('0x1a'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1a'),new AGIError(_0x0a9e('0x1b')));});_0x4ce2f1['on'](_0x0a9e('0x1c'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4ce2f1[_0x0a9e('0x1d')]();});_0x4ce2f1[_0x0a9e('0x1e')](_0x432180);this['command']=function(_0x20f109,_0x5a09ef){var _0x20f109=_0x20f109||'',_0x5a09ef=typeof _0x5a09ef==_0x0a9e('0xe')?_0x5a09ef:new Function();_0x991246={'tx':_0x20f109,'rx':'','cb':_0x5a09ef};_0x4ce2f1[_0x0a9e('0x1f')](_0x20f109+'\x0a');},this[_0x0a9e('0x1a')]=function(){_0x4ce2f1['destroy']();};}util[_0x0a9e('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x22')]=function(_0x4d00e6){return this[_0x0a9e('0x23')][_0x0a9e('0x24')](this,_0x4d00e6);};AGIChannel[_0x0a9e('0x21')]['answer']=function(){return this['sendRequest'](_0x0a9e('0x25'));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x26')]=function(_0x33161b,_0x526cf3,_0x384319){_0x33161b=_0x33161b===undefined?'beep':_0x33161b;_0x526cf3=_0x526cf3===undefined?'5':_0x526cf3;_0x384319=_0x384319===undefined?'1':_0x384319;return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x27'),_0x33161b,_0x526cf3*0x3e8,_0x384319));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x28')]=function(_0x14433c){_0x14433c=_0x14433c||_0x0a9e('0x29');return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x14433c));};AGIChannel['prototype'][_0x0a9e('0x2c')]=function(_0x468813,_0x2b1f27){if(_[_0x0a9e('0x2d')](_0x2b1f27)){return this['sendRequest'](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27[_0x0a9e('0x2f')](',')));}return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x30')]=function(_0x1dbde2){return this['sendRequest'](util[_0x0a9e('0x2a')]('SET\x20CONTEXT\x20%s',_0x1dbde2));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x31')]=function(_0x1122db){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x1122db));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x32')]=function(_0x40cb85){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x33'),_0x40cb85));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0xb')]=function(){return this['sendRequest'](_0x0a9e('0x34'));};AGIChannel['prototype'][_0x0a9e('0x35')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41=_['isBoolean'](_0x2b7e7f)||_[_0x0a9e('0x36')](_0x2b7e7f)?_0x2b7e7f[_0x0a9e('0x37')]():_0x2b7e7f;return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x14b13f,_0x3f3d41?_0x3f3d41['toString']()[_0x0a9e('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x39'),_0x3d9717,_0x381c37));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3a')]=function(_0x533942,_0x1dbf74){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x533942,_0x1dbf74));};AGIChannel['prototype'][_0x0a9e('0x3b')]=function(_0x40d766,_0x5adda1){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3c'),_0x40d766,_0x5adda1));};AGIChannel[_0x0a9e('0x21')]['continueAt']=function(_0x5a594b,_0x15e37d,_0x45b3d0){_0x15e37d=_0x15e37d||this['extension'];_0x45b3d0=_0x45b3d0||0x1;this[_0x0a9e('0x30')](_0x5a594b);this[_0x0a9e('0x31')](_0x15e37d);this[_0x0a9e('0x32')](_0x45b3d0);return this['noop'](util[_0x0a9e('0x2a')](_0x0a9e('0x3d'),_0x5a594b,_0x15e37d,_0x45b3d0));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3e')]=function(_0x13cb1f){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3f'),_0x13cb1f));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x40')]=function(_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x37f6cc,_0x4d04c8){_0x148007=_0x148007||'wav';_0x1a7bce=_0x1a7bce||'';_0x11ca30=_0x11ca30===undefined?-0x1:_0x11ca30==='-1'?-0x1:_0x11ca30*0x3e8;_0x37f6cc=_0x37f6cc===undefined?'':'s='+_0x37f6cc;_0x4d04c8=_0x4d04c8?_0x0a9e('0x41'):'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x42'),_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x4d04c8,_0x37f6cc));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x43')]=function(_0x10b040,_0x445e25){_0x445e25=_0x445e25||'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x44'),_0x10b040,_0x445e25));};AGIChannel[_0x0a9e('0x21')]['agi']=function(_0x117c99){return this[_0x0a9e('0x2c')](_0x0a9e('0x45'),_0x117c99);};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x46')]=function(_0xbe9d19){return this[_0x0a9e('0x2c')](_0x0a9e('0x47'),_0xbe9d19);};AGIChannel['prototype'][_0x0a9e('0x17')]=function(_0x48fd45,_0x473dc8){this[_0x0a9e('0x28')](util[_0x0a9e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x48fd45['id'],_0x48fd45[_0x0a9e('0x48')],_0x473dc8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0a9e('0x49')]=AGIChannel; \ No newline at end of file +var _0x9c44=['no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','inherits','prototype','sendRequest','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIReply=require(_0x49c4('0x2'));var AGIError=require(_0x49c4('0x3'));function AGIChannel(_0x455700){var _0x2ad237=this,_0x4e0313=new AGIReply(),_0x4941f1=![],_0x41a183={};EventEmitter['call'](_0x2ad237);_0x455700[_0x49c4('0x4')](_0x49c4('0x5'));_0x455700[_0x49c4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4e0313[_0x49c4('0x4')](_0x49c4('0x5'));_0x4e0313['on']('headers',function(_0x11c586){for(var _0x42e4f8 in _0x11c586){_0x2ad237[_0x42e4f8]=_0x11c586[_0x42e4f8];}_0x2ad237[_0x49c4('0x7')](_0x49c4('0x8'));});_0x4e0313['on']('line',function(_0x5ab4a3){if(_0x5ab4a3[_0x49c4('0x9')]()==_0x49c4('0xa')){_0x2ad237['emit'](_0x49c4('0xa'));return;}if(_0x5ab4a3[_0x49c4('0xb')](0x0,0xb)=='520-Invalid'){_0x4941f1=!![];}if(_0x4941f1){_0x41a183['rx']+=_0x5ab4a3+'\x0a';if(_0x5ab4a3['search'](_0x49c4('0xc'))!=-0x1){_0x4941f1=![];}}else{_0x41a183['rx']=_0x5ab4a3;}if(_0x4941f1){return;}if(typeof _0x41a183['cb']==_0x49c4('0xd')){var _0x5487cd=_0x41a183['rx']['substring'](0x0,0x3),_0x7df3a9=null,_0x403bfb=null;_0x5487cd=parseInt(_0x5487cd);if(isNaN(_0x5487cd)){_0x41a183['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49c4('0xe')});return;}if(_0x5487cd!=0xc8){_0x41a183['cb'](null,{'code':_0x5487cd,'result':-0x1,'extra':'KO'});return;}_0x7df3a9=_0x41a183['rx'][_0x49c4('0xb')](0x4)[_0x49c4('0xf')](_0x49c4('0x10'),'');if(_0x7df3a9[_0x49c4('0x11')]('\x20')!=-0x1){_0x7df3a9=_0x7df3a9[_0x49c4('0x12')](0x0,_0x7df3a9[_0x49c4('0x11')]('\x20'));}if(_[_0x49c4('0x13')](_0x7df3a9,'-1')){_0x7df3a9=parseInt(_0x7df3a9);}_0x403bfb=_0x41a183['rx']['split']('\x20');if(_0x403bfb[_0x49c4('0x14')]==0x3){_0x403bfb=_0x403bfb[0x2][_0x49c4('0xb')](0x1,_0x403bfb[0x2][_0x49c4('0x14')]-0x1);}else if(_0x403bfb[_0x49c4('0x14')]>0x3){var _0x2abc78=/\((.+)\)/;var _0x53e3a2=_0x41a183['rx'][_0x49c4('0x15')](_0x2abc78);if(_0x53e3a2){_0x403bfb=_0x53e3a2[0x1];}else{_0x403bfb=null;}}else{_0x403bfb=null;}_0x41a183['cb'](null,{'code':_0x5487cd,'result':_0x7df3a9,'extra':_0x403bfb});}});_0x455700['on'](_0x49c4('0x16'),function(_0x4c3253){_0x2ad237['emit'](_0x49c4('0x16'),new AGIError(_0x49c4('0x17'),_0x4c3253[_0x49c4('0x18')]));});_0x455700['on']('close',function(){_0x2ad237[_0x49c4('0x7')]('close',new AGIError(_0x49c4('0x19')));});_0x455700['on'](_0x49c4('0x1a'),function(){_0x2ad237[_0x49c4('0x7')](_0x49c4('0x1a'),new AGIError(_0x49c4('0x1b')));_0x455700[_0x49c4('0x1c')]();});_0x455700[_0x49c4('0x1d')](_0x4e0313);this[_0x49c4('0x1e')]=function(_0x2197d2,_0x578447){var _0x2197d2=_0x2197d2||'',_0x578447=typeof _0x578447==_0x49c4('0xd')?_0x578447:new Function();_0x41a183={'tx':_0x2197d2,'rx':'','cb':_0x578447};_0x455700['write'](_0x2197d2+'\x0a');},this['close']=function(){_0x455700[_0x49c4('0x1c')]();};}util[_0x49c4('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x49c4('0x20')][_0x49c4('0x21')]=function(_0x4811c4){return this['command'][_0x49c4('0x22')](this,_0x4811c4);};AGIChannel[_0x49c4('0x20')]['answer']=function(){return this[_0x49c4('0x21')](_0x49c4('0x23'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x24')]=function(_0x531d92,_0x543ea2,_0x449960){_0x531d92=_0x531d92===undefined?'beep':_0x531d92;_0x543ea2=_0x543ea2===undefined?'5':_0x543ea2;_0x449960=_0x449960===undefined?'1':_0x449960;return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x26'),_0x531d92,_0x543ea2*0x3e8,_0x449960));};AGIChannel[_0x49c4('0x20')]['noop']=function(_0x889909){_0x889909=_0x889909||_0x49c4('0x27');return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x28'),_0x889909));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x29')]=function(_0x427b26,_0x17b50f){if(_[_0x49c4('0x2a')](_0x17b50f)){return this[_0x49c4('0x21')](util['format']('EXEC\x20%s\x20%s',_0x427b26,_0x17b50f['join'](',')));}return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2b'),_0x427b26,_0x17b50f));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2c')]=function(_0x574fd3){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2d'),_0x574fd3));};AGIChannel[_0x49c4('0x20')]['setExtension']=function(_0x57a29c){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x2e'),_0x57a29c));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x2f')]=function(_0x4a0c7a){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x30'),_0x4a0c7a));};AGIChannel['prototype']['hangup']=function(){return this[_0x49c4('0x21')](_0x49c4('0x31'));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x32')]=function(_0x2b45a1,_0x2cf897){var _0x1d1557=_[_0x49c4('0x33')](_0x2cf897)||_[_0x49c4('0x34')](_0x2cf897)?_0x2cf897['toString']():_0x2cf897;return this[_0x49c4('0x21')](util['format'](_0x49c4('0x35'),_0x2b45a1,_0x1d1557?_0x1d1557[_0x49c4('0x36')]()[_0x49c4('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x49c4('0x20')]['sayNumber']=function(_0x335f0c,_0x31f3ff){return this[_0x49c4('0x21')](util['format'](_0x49c4('0x37'),_0x335f0c,_0x31f3ff));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x38')]=function(_0x5e5366,_0x1ba7a0){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x39'),_0x5e5366,_0x1ba7a0));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3a')]=function(_0x1e506a,_0x4e0663){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x3b'),_0x1e506a,_0x4e0663));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x3c')]=function(_0x29dd5d,_0x1be62d,_0xc9722b){_0x1be62d=_0x1be62d||this[_0x49c4('0x3d')];_0xc9722b=_0xc9722b||0x1;this[_0x49c4('0x2c')](_0x29dd5d);this[_0x49c4('0x3e')](_0x1be62d);this[_0x49c4('0x2f')](_0xc9722b);return this[_0x49c4('0x3f')](util['format'](_0x49c4('0x40'),_0x29dd5d,_0x1be62d,_0xc9722b));};AGIChannel['prototype'][_0x49c4('0x41')]=function(_0x4915bc){return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x42'),_0x4915bc));};AGIChannel[_0x49c4('0x20')]['recordFile']=function(_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x117151,_0x490823){_0x20490b=_0x20490b||_0x49c4('0x43');_0x1e7bdc=_0x1e7bdc||'';_0x38349b=_0x38349b===undefined?-0x1:_0x38349b==='-1'?-0x1:_0x38349b*0x3e8;_0x117151=_0x117151===undefined?'':'s='+_0x117151;_0x490823=_0x490823?_0x49c4('0x44'):'';return this[_0x49c4('0x21')](util[_0x49c4('0x25')](_0x49c4('0x45'),_0x4d628a,_0x20490b,_0x1e7bdc,_0x38349b,_0x490823,_0x117151));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x46')]=function(_0x3351c1,_0x3c4a1d){_0x3c4a1d=_0x3c4a1d||'';return this['sendRequest'](util[_0x49c4('0x25')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3351c1,_0x3c4a1d));};AGIChannel[_0x49c4('0x20')][_0x49c4('0x47')]=function(_0x301def){return this[_0x49c4('0x29')](_0x49c4('0x48'),_0x301def);};AGIChannel['prototype'][_0x49c4('0x49')]=function(_0x15b674){return this[_0x49c4('0x29')](_0x49c4('0x4a'),_0x15b674);};AGIChannel[_0x49c4('0x20')][_0x49c4('0x16')]=function(_0x9779ef,_0x4d89e0){this[_0x49c4('0x3f')](util['format'](_0x49c4('0x4b'),_0x9779ef['id'],_0x9779ef[_0x49c4('0x4c')],_0x4d89e0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49c4('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index b492e20..893a8c4 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 _0xe4ef=['push','format','apply','name','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4ef,0x17b));var _0xfe4e=function(_0x17508b,_0x54e648){_0x17508b=_0x17508b-0x0;var _0x30f762=_0xe4ef[_0x17508b];return _0x30f762;};'use strict';var util=require(_0xfe4e('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xfe4e('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xfe4e('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xfe4e('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xfe4e('0x4'),'E_AGI_SOCKET_ERROR':_0xfe4e('0x5'),'E_AGI_SOCKET_CLOSE':_0xfe4e('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xfe4e('0x7'),'E_AGI_COMMAND_EMPTY':_0xfe4e('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfe4e('0x9'),'E_AGI_IVR_ENTRY':_0xfe4e('0xa')};function AGIError(_0x5393a6){var _0x5393a6=_0x5393a6||null,_0x56c01b=_0x56c01b||[],_0xcb6fa6=0x1,_0x5c8fed='';if(!error[_0x5393a6]){_0x5393a6=_0xfe4e('0xb');}_0x56c01b[_0xfe4e('0xc')](error[_0x5393a6]);while(arguments[_0xcb6fa6]){_0x56c01b['push'](arguments[_0xcb6fa6]);_0xcb6fa6++;}_0x5c8fed=util[_0xfe4e('0xd')][_0xfe4e('0xe')](util,_0x56c01b);this['message']=_0x5c8fed;this[_0xfe4e('0xf')]=_0x5393a6;}module[_0xfe4e('0x10')]=AGIError; \ No newline at end of file +var _0xa7ec=['Socket\x20closed.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xa7ec,0x14b));var _0xca7e=function(_0xc583b3,_0x3384a6){_0xc583b3=_0xc583b3-0x0;var _0x59eb9e=_0xa7ec[_0xc583b3];return _0x59eb9e;};'use strict';var util=require(_0xca7e('0x0'));var error={'E_AGI_UNDEFINED':_0xca7e('0x1'),'E_AGI_ARGUMENT_PORT':_0xca7e('0x2'),'E_AGI_SERVER_ERROR':_0xca7e('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xca7e('0x4'),'E_AGI_SOCKET_CLOSE':_0xca7e('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xca7e('0x6')};function AGIError(_0x2f3afd){var _0x2f3afd=_0x2f3afd||null,_0x1c86c3=_0x1c86c3||[],_0x23d222=0x1,_0x30a3b2='';if(!error[_0x2f3afd]){_0x2f3afd='E_AGI_UNDEFINED';}_0x1c86c3[_0xca7e('0x7')](error[_0x2f3afd]);while(arguments[_0x23d222]){_0x1c86c3[_0xca7e('0x7')](arguments[_0x23d222]);_0x23d222++;}_0x30a3b2=util[_0xca7e('0x8')][_0xca7e('0x9')](util,_0x1c86c3);this[_0xca7e('0xa')]=_0x30a3b2;this['name']=_0x2f3afd;}module[_0xca7e('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 5f69960..68688f3 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 _0xe1e3=['condition','split','agicommand','vswitch','info','target','traverseBFS','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','push','size','relations','getVertex','no\x20vertex\x20found','length','no\x20edge/s\x20available'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x462756,_0x3fefd4){_0x462756=_0x462756-0x0;var _0x603ae6=_0xe1e3[_0x462756];return _0x603ae6;};'use strict';var _=require(_0x3e1e('0x0'));var logger=require(_0x3e1e('0x1'))('agi');var verticesWithRetry=[_0x3e1e('0x2'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x3e1e('0x3')]={};this['edges']={};this[_0x3e1e('0x4')]=0x0;};Graph[_0x3e1e('0x5')][_0x3e1e('0x6')]=function(_0x397376){this[_0x3e1e('0x3')][_0x397376['id']]=_0x397376;this[_0x3e1e('0x7')][_0x397376['id']]=[];};Graph['prototype'][_0x3e1e('0x8')]=function(_0x13926d,_0x2f0e12,_0xa67e35){this[_0x3e1e('0x7')][_0x13926d][_0x3e1e('0x9')]({'target':_0x2f0e12,'condition':_0xa67e35});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x3e1e('0xa')](this['vertices']);};Graph[_0x3e1e('0x5')][_0x3e1e('0xb')]=function(){return this[_0x3e1e('0x4')];};Graph['prototype'][_0x3e1e('0xc')]=function(_0x4e6eee){return this['vertices'][_0x4e6eee];};Graph['prototype']['traverseBFS']=function(_0x5c09a2,_0x14ad58){if(!this['vertices'][_0x5c09a2]){return logger['info'](_0x3e1e('0xd'));}var _0x8bd4cd=_0x14ad58(this[_0x3e1e('0x3')][_0x5c09a2]);if(!_0x8bd4cd){return logger['info']('stop\x20traverse');}if(this[_0x3e1e('0x7')][_0x5c09a2][_0x3e1e('0xe')]===0x0){return logger['info'](_0x3e1e('0xf'));}for(var _0x1f0af9=0x0,_0x570212=[],_0x11c07f=![];_0x1f0af9\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','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','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','defaults','agi','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid'];(function(_0x1e5086,_0x54fd73){var _0x3e0113=function(_0x29041a){while(--_0x29041a){_0x1e5086['push'](_0x1e5086['shift']());}};_0x3e0113(++_0x54fd73);}(_0x8ef6,0xf2));var _0x68ef=function(_0xcd933f,_0x394e33){_0xcd933f=_0xcd933f-0x0;var _0x98cd1b=_0x8ef6[_0xcd933f];return _0x98cd1b;};'use strict';var parser=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var syncho=require(_0x68ef('0x2'));var util=require(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var config=require(_0x68ef('0x5'));var logger=require(_0x68ef('0x6'))('agi');var utilLicense=require(_0x68ef('0x7'));var rpc=require(_0x68ef('0x8'));var mailRpc=require(_0x68ef('0x9'));var Graph=require(_0x68ef('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x68ef('0xb')](config[_0x68ef('0xc')],{'ip':_0x68ef('0xd'),'port':0x11dd});function connectionHandler(_0x4eb5eb){process[_0x68ef('0xe')](function(){syncho(function(){try{setChannelVariables(_0x4eb5eb);agiHandler(_0x4eb5eb);}catch(_0x31007e){logger[_0x68ef('0xf')](_0x31007e[_0x68ef('0x10')]);}});});}function listeningHandler(){console[_0x68ef('0x11')](_0x68ef('0x12'),config[_0x68ef('0xc')][_0x68ef('0x13')]);logger[_0x68ef('0x14')](util[_0x68ef('0x15')](_0x68ef('0x16'),config[_0x68ef('0xc')]['ip'],config['agi'][_0x68ef('0x13')]));}function errorHandler(_0x46356f){if(_0x46356f&&_0x46356f[_0x68ef('0x17')]&&_0x46356f[_0x68ef('0x18')]){logger[_0x68ef('0xf')](util[_0x68ef('0x15')]('[%s]\x20%s',_0x46356f[_0x68ef('0x17')],_0x46356f[_0x68ef('0x18')]));}else{logger[_0x68ef('0xf')](util['format'](_0x68ef('0x19'),_0x46356f[_0x68ef('0x10')]));}}function closeHandler(){logger[_0x68ef('0x14')](util['format'](_0x68ef('0x1a'),this[_0x68ef('0x1b')],this[_0x68ef('0x1c')],this[_0x68ef('0x1d')],this['dnid'],this[_0x68ef('0x1e')]));try{createSquareReport(this);}catch(_0x54139e){logger['error'](_0x54139e[_0x68ef('0x10')]);}}function timeoutHandler(){logger[_0x68ef('0x14')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x68ef('0x1b')],this[_0x68ef('0x1c')],this[_0x68ef('0x1d')],this['dnid'],this[_0x68ef('0x1e')]));}function hangupHandler(){logger[_0x68ef('0x14')](util[_0x68ef('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x68ef('0x1b')],this[_0x68ef('0x1c')],this['callerid'],this[_0x68ef('0x1f')],this[_0x68ef('0x1e')]));this[_0x68ef('0x20')]=!![];}function getRoot(_0x5ddec7){return parser['toJson'](_0x5ddec7,{'object':!![]})['mxGraphModel'][_0x68ef('0x21')];}function addVertex(_0x2023f2,_0x312cc9,_0x2e6e39){_0x312cc9[_0x68ef('0x22')]=_0x2e6e39;if(_0x312cc9[_0x68ef('0x23')](_0x68ef('0x24'))){_0x312cc9[_0x68ef('0x25')]=parseInt(_0x312cc9[_0x68ef('0x24')],0xa);}_0x2023f2[_0x68ef('0x26')](_['omit'](_0x312cc9,_0x68ef('0x27')));}function initGraph(_0x57f9ee,_0x599243){var _0x55d8b0=new Graph();for(var _0x1a7ce1 in _0x57f9ee){if(_0x57f9ee[_0x68ef('0x23')](_0x1a7ce1)){if(_[_0x68ef('0x28')](_0x57f9ee[_0x1a7ce1])){for(var _0x29518e=0x0;_0x29518e<_0x57f9ee[_0x1a7ce1]['length'];_0x29518e+=0x1){addVertex(_0x55d8b0,_0x57f9ee[_0x1a7ce1][_0x29518e],_0x1a7ce1);}}else{addVertex(_0x55d8b0,_0x57f9ee[_0x1a7ce1],_0x1a7ce1);}}}for(var _0x4a0550=0x0;_0x4a0550<_0x599243[_0x68ef('0x29')];_0x4a0550+=0x1){if(_0x599243[_0x4a0550][_0x68ef('0x2a')]&&_0x599243[_0x4a0550][_0x68ef('0x2b')]){_0x55d8b0[_0x68ef('0x2c')](_0x599243[_0x4a0550][_0x68ef('0x2a')],_0x599243[_0x4a0550][_0x68ef('0x2b')],_0x599243[_0x4a0550][_0x68ef('0x2d')]);}}return _0x55d8b0;}function getSquareProject(_0x4579cb,_0x5a6dfd){rpc[_0x68ef('0x2e')](_0x4579cb)[_0x68ef('0x2f')](function(_0x132d9e){_0x5a6dfd(null,_0x132d9e);})['catch'](function(_0x370a8f){_0x5a6dfd(null,_0x370a8f);});}function createSquareReport(_0x523120,_0x133788){rpc[_0x68ef('0x30')](_0x523120)['then'](function(_0x5e1e1b){if(_0x133788){_0x133788(null,_0x5e1e1b);}})[_0x68ef('0x31')](function(_0x5fa72a){if(_0x133788){_0x133788(null,_0x5fa72a);}});}function setChannelVariables(_0x4b8fc8){for(var _0xf58fa1 in _0x4b8fc8){if(_0x4b8fc8[_0x68ef('0x23')](_0xf58fa1)){if(_0xf58fa1[_0x68ef('0x32')](_0x68ef('0x33'))===0x0){_0x4b8fc8[_0xf58fa1['substring'](0x4)]=_0x4b8fc8[_0xf58fa1];delete _0x4b8fc8[_0xf58fa1];}}}}function getLogFromObject(_0x2c8bd0){return util[_0x68ef('0x34')](_0x2c8bd0,{'showHidden':![],'depth':null});}function agiHandler(_0x5f137b){var _0x2f8de2,_0x5237e1,_0x14581d,_0xab3c17,_0x4973c2;logger[_0x68ef('0x35')]('variables',JSON[_0x68ef('0x36')](_0x5f137b,null,0x2));logger['info'](util[_0x68ef('0x15')](_0x68ef('0x37'),_0x5f137b[_0x68ef('0x1b')],_0x5f137b['calleridname'],_0x5f137b[_0x68ef('0x1d')],_0x5f137b['dnid'],_0x5f137b[_0x68ef('0x1e')]));_0x5f137b['on']('error',errorHandler);_0x5f137b['on'](_0x68ef('0x38'),closeHandler);_0x5f137b['on'](_0x68ef('0x39'),timeoutHandler);_0x5f137b[_0x68ef('0x20')]=![];_0x5f137b['on'](_0x68ef('0x3a'),hangupHandler);var _0x2181d9=getSquareProject[_0x68ef('0x3b')](null,_0x5f137b['arg_1']);if(_0x2181d9){if(_0x2181d9[_0x68ef('0x3c')]){_0x2f8de2=getRoot(_0x2181d9[_0x68ef('0x3c')]);if(_0x2f8de2&&_0x2f8de2[_0x68ef('0x3d')]){logger['debug'](_0x68ef('0x21'),JSON[_0x68ef('0x36')](_0x2f8de2,null,0x2));_0x5f137b[_0x68ef('0x3e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5237e1=initGraph(_[_0x68ef('0x3f')](_0x2f8de2,_0x68ef('0x27')),_0x2f8de2[_0x68ef('0x27')]);_0x14581d=new Vertices(_0x5f137b,rpc,mailRpc);logger[_0x68ef('0x14')](util[_0x68ef('0x15')](_0x68ef('0x40'),_0x5f137b[_0x68ef('0x1b')],_0x5f137b['calleridname'],_0x5f137b[_0x68ef('0x1d')],_0x5f137b[_0x68ef('0x1f')],_0x5f137b[_0x68ef('0x1e')]));_0x5237e1[_0x68ef('0x41')](_0x2f8de2['start']['id'],function(_0x3cb156){try{_0x3cb156=_0x14581d[_0x68ef('0x42')](_0x3cb156);logger[_0x68ef('0x35')](_0x68ef('0x43'),JSON[_0x68ef('0x36')](_0x3cb156,null,0x2));if(_0x3cb156[_0x68ef('0x22')]==='gotoc'){logger[_0x68ef('0x14')](_0x68ef('0x44'));_0x5f137b[_0x68ef('0x45')]=_0x3cb156[_0x68ef('0x45')]||_0x5f137b[_0x68ef('0x45')];_0x5f137b[_0x68ef('0x46')]=_0x3cb156[_0x68ef('0x46')];_0x5f137b[_0x68ef('0x47')]=_0x3cb156[_0x68ef('0x47')]?_0x3cb156['priority']-0x1:0x1;return null;}else if(_0x3cb156&&_0x14581d[_0x3cb156[_0x68ef('0x22')]]){_0x4973c2=_0x14581d[_0x3cb156[_0x68ef('0x22')]](_0x3cb156);logger[_0x68ef('0x14')](_0x68ef('0x48'),JSON[_0x68ef('0x36')](_0x4973c2,null,0x2));if(_0x4973c2&&_0x4973c2[_0x68ef('0x49')]===AGI_CODE_SUCCESS&&_0x4973c2[_0x68ef('0x4a')]!==AGI_RESULT_ERROR&&!_0x5f137b['evtHangup']){logger[_0x68ef('0x35')]('response',getLogFromObject(_0x4973c2));return _[_0x68ef('0x4b')](_0x4973c2[_0x68ef('0x4a')])?null:_0x4973c2[_0x68ef('0x4a')][_0x68ef('0x4c')]();}else{logger['error'](_0x68ef('0x48'),getLogFromObject(_0x4973c2));return null;}}else{logger['error'](_0x68ef('0x4d'));return null;}}catch(_0x499423){logger[_0x68ef('0xf')](_0x499423[_0x68ef('0x10')]);return null;}});if(_0x2f8de2[_0x68ef('0x4e')]){logger['info'](util['format'](_0x68ef('0x4f'),_0x5f137b[_0x68ef('0x1b')],_0x5f137b['calleridname'],_0x5f137b['callerid'],_0x5f137b['dnid'],_0x5f137b[_0x68ef('0x1e')]));_0x5237e1[_0x68ef('0x41')](_0x2f8de2[_0x68ef('0x4e')]['id'],function(_0x5a2b65){try{_0x5a2b65=_0x14581d[_0x68ef('0x42')](_0x5a2b65);logger['debug']('vertex',JSON[_0x68ef('0x36')](_0x5a2b65,null,0x2));if(_0x5a2b65&&_0x14581d[_0x5a2b65[_0x68ef('0x22')]]){_0x4973c2=_0x14581d[_0x5a2b65[_0x68ef('0x22')]](_0x5a2b65);if(_0x4973c2){logger[_0x68ef('0x35')]('response',getLogFromObject(_0x4973c2));return _[_0x68ef('0x4b')](_0x4973c2[_0x68ef('0x4a')])?null:_0x4973c2[_0x68ef('0x4a')][_0x68ef('0x4c')]();}else{logger['error']('response',getLogFromObject(_0x4973c2));return null;}}else{logger[_0x68ef('0xf')](_0x68ef('0x4d'));return null;}}catch(_0x566e7c){logger[_0x68ef('0xf')](_0x566e7c[_0x68ef('0x10')]);return null;}});}logger[_0x68ef('0x14')](util[_0x68ef('0x15')](_0x68ef('0x50'),_0x5f137b['arg_1'],_0x5f137b[_0x68ef('0x1c')],_0x5f137b[_0x68ef('0x1d')],_0x5f137b[_0x68ef('0x1f')],_0x5f137b['uniqueid']));logger[_0x68ef('0x14')](util[_0x68ef('0x15')](_0x68ef('0x51'),_0x5f137b['context'],_0x5f137b[_0x68ef('0x46')],parseInt(_0x5f137b['priority'],0xa)+0x1));_0x5f137b['continueAt'](_0x5f137b[_0x68ef('0x45')],_0x5f137b['extension'],parseInt(_0x5f137b[_0x68ef('0x47')],0xa)+0x1);_0x5f137b[_0x68ef('0x38')]();}}else{logger[_0x68ef('0xf')](util[_0x68ef('0x15')](_0x68ef('0x52'),_0x5f137b[_0x68ef('0x1b')]));_0x5f137b[_0x68ef('0x53')](_0x5f137b[_0x68ef('0x45')],_0x5f137b[_0x68ef('0x46')],parseInt(_0x5f137b[_0x68ef('0x47')],0xa)+0x1);_0x5f137b['close']();}}else{logger['error'](util[_0x68ef('0x15')](_0x68ef('0x54'),_0x5f137b[_0x68ef('0x1b')]));_0x5f137b[_0x68ef('0x53')](_0x5f137b[_0x68ef('0x45')],_0x5f137b[_0x68ef('0x46')],parseInt(_0x5f137b[_0x68ef('0x47')],0xa)+0x1);_0x5f137b[_0x68ef('0x38')]();}}function main(){var _0x40c784;return utilLicense['getLicense']()['then'](function(_0x42a4b2){if(_0x42a4b2){if(_0x42a4b2['voice']){if(_0x42a4b2[_0x68ef('0x55')]&&_0x42a4b2['callysquare']>0x0){logger[_0x68ef('0x14')](util[_0x68ef('0x15')]('[LICENSE]\x20CHANNELS:\x20%s',_0x42a4b2[_0x68ef('0x55')]));_0x40c784=_0x42a4b2['callysquare'];}else{logger[_0x68ef('0x14')](_0x68ef('0x56'));}}else{logger[_0x68ef('0x14')](_0x68ef('0x57'));_0x40c784=-0x1;}}})[_0x68ef('0x31')](function(_0x3d81c8){logger['error'](_0x68ef('0x58'),_0x3d81c8[_0x68ef('0x10')]);})[_0x68ef('0x4e')](function(){var _0x20dc7f=require(_0x68ef('0x59'))(config[_0x68ef('0xc')]['port'],config[_0x68ef('0xc')]['ip'],_0x40c784);_0x20dc7f['on'](_0x68ef('0xf'),errorHandler);_0x20dc7f['on']('listening',listeningHandler);_0x20dc7f['on'](_0x68ef('0x5a'),connectionHandler);_0x20dc7f['on'](_0x68ef('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0x4944=['isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','uniqueid','evtHangup','agicommand','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','getSquareProject','then','catch','createSquareReport','hasOwnProperty','indexOf','agi_','substring','inspect','debug','variables','stringify','timeout','hangup','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','result','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','clear','vertex'];(function(_0x41026f,_0x3d0564){var _0xb75ff8=function(_0x9d57fe){while(--_0x9d57fe){_0x41026f['push'](_0x41026f['shift']());}};_0xb75ff8(++_0x3d0564);}(_0x4944,0x6d));var _0x4494=function(_0x26f1d7,_0x380095){_0x26f1d7=_0x26f1d7-0x0;var _0x3bce5b=_0x4944[_0x26f1d7];return _0x3bce5b;};'use strict';var parser=require(_0x4494('0x0'));var _=require('lodash');var syncho=require(_0x4494('0x1'));var util=require(_0x4494('0x2'));var moment=require(_0x4494('0x3'));var config=require(_0x4494('0x4'));var logger=require(_0x4494('0x5'))('agi');var utilLicense=require(_0x4494('0x6'));var rpc=require('./rpc');var mailRpc=require(_0x4494('0x7'));var Graph=require(_0x4494('0x8'));var Vertices=require(_0x4494('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x4494('0xa')]=_[_0x4494('0xb')](config[_0x4494('0xa')],{'ip':_0x4494('0xc'),'port':0x11dd});function connectionHandler(_0x12ef8e){process[_0x4494('0xd')](function(){syncho(function(){try{setChannelVariables(_0x12ef8e);agiHandler(_0x12ef8e);}catch(_0x5b14d5){logger[_0x4494('0xe')](_0x5b14d5[_0x4494('0xf')]);}});});}function listeningHandler(){console[_0x4494('0x10')](_0x4494('0x11'),config['agi']['port']);logger[_0x4494('0x12')](util[_0x4494('0x13')](_0x4494('0x14'),config['agi']['ip'],config['agi'][_0x4494('0x15')]));}function errorHandler(_0x435e4a){if(_0x435e4a&&_0x435e4a[_0x4494('0x16')]&&_0x435e4a[_0x4494('0x17')]){logger[_0x4494('0xe')](util[_0x4494('0x13')]('[%s]\x20%s',_0x435e4a[_0x4494('0x16')],_0x435e4a[_0x4494('0x17')]));}else{logger[_0x4494('0xe')](util[_0x4494('0x13')](_0x4494('0x18'),_0x435e4a[_0x4494('0xf')]));}}function closeHandler(){logger[_0x4494('0x12')](util['format'](_0x4494('0x19'),this['arg_1'],this['calleridname'],this[_0x4494('0x1a')],this[_0x4494('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x49350a){logger[_0x4494('0xe')](_0x49350a['stack']);}}function timeoutHandler(){logger[_0x4494('0x12')](util[_0x4494('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4494('0x1c')],this['calleridname'],this[_0x4494('0x1a')],this[_0x4494('0x1b')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x4494('0x13')](_0x4494('0x1d'),this[_0x4494('0x1c')],this[_0x4494('0x1e')],this[_0x4494('0x1a')],this[_0x4494('0x1b')],this[_0x4494('0x1f')]));this[_0x4494('0x20')]=!![];}function getRoot(_0x4cd309){return parser['toJson'](_0x4cd309,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x197da5,_0x8b6c21,_0x1b3630){_0x8b6c21[_0x4494('0x21')]=_0x1b3630;if(_0x8b6c21['hasOwnProperty'](_0x4494('0x22'))){_0x8b6c21[_0x4494('0x23')]=parseInt(_0x8b6c21['retry'],0xa);}_0x197da5[_0x4494('0x24')](_[_0x4494('0x25')](_0x8b6c21,_0x4494('0x26')));}function initGraph(_0x4abe3c,_0xfc1631){var _0x5926fc=new Graph();for(var _0x3af50b in _0x4abe3c){if(_0x4abe3c['hasOwnProperty'](_0x3af50b)){if(_[_0x4494('0x27')](_0x4abe3c[_0x3af50b])){for(var _0x2fcc43=0x0;_0x2fcc43<_0x4abe3c[_0x3af50b][_0x4494('0x28')];_0x2fcc43+=0x1){addVertex(_0x5926fc,_0x4abe3c[_0x3af50b][_0x2fcc43],_0x3af50b);}}else{addVertex(_0x5926fc,_0x4abe3c[_0x3af50b],_0x3af50b);}}}for(var _0x54f1ea=0x0;_0x54f1ea<_0xfc1631[_0x4494('0x28')];_0x54f1ea+=0x1){if(_0xfc1631[_0x54f1ea][_0x4494('0x29')]&&_0xfc1631[_0x54f1ea]['target']){_0x5926fc[_0x4494('0x2a')](_0xfc1631[_0x54f1ea][_0x4494('0x29')],_0xfc1631[_0x54f1ea][_0x4494('0x2b')],_0xfc1631[_0x54f1ea]['value']);}}return _0x5926fc;}function getSquareProject(_0x96cdbb,_0x2e94af){rpc[_0x4494('0x2c')](_0x96cdbb)[_0x4494('0x2d')](function(_0x5a8a5b){_0x2e94af(null,_0x5a8a5b);})[_0x4494('0x2e')](function(_0x32f86f){_0x2e94af(null,_0x32f86f);});}function createSquareReport(_0xcce4da,_0x4d6607){rpc[_0x4494('0x2f')](_0xcce4da)[_0x4494('0x2d')](function(_0x51c69d){if(_0x4d6607){_0x4d6607(null,_0x51c69d);}})['catch'](function(_0x209fe8){if(_0x4d6607){_0x4d6607(null,_0x209fe8);}});}function setChannelVariables(_0x1c93f0){for(var _0x1d8e2f in _0x1c93f0){if(_0x1c93f0[_0x4494('0x30')](_0x1d8e2f)){if(_0x1d8e2f[_0x4494('0x31')](_0x4494('0x32'))===0x0){_0x1c93f0[_0x1d8e2f[_0x4494('0x33')](0x4)]=_0x1c93f0[_0x1d8e2f];delete _0x1c93f0[_0x1d8e2f];}}}}function getLogFromObject(_0x4e1656){return util[_0x4494('0x34')](_0x4e1656,{'showHidden':![],'depth':null});}function agiHandler(_0x1c6ff8){var _0x2f4740,_0x1f3306,_0x381ea8,_0x3cbe98,_0x5bba31;logger[_0x4494('0x35')](_0x4494('0x36'),JSON[_0x4494('0x37')](_0x1c6ff8,null,0x2));logger[_0x4494('0x12')](util[_0x4494('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1c6ff8[_0x4494('0x1c')],_0x1c6ff8[_0x4494('0x1e')],_0x1c6ff8['callerid'],_0x1c6ff8[_0x4494('0x1b')],_0x1c6ff8['uniqueid']));_0x1c6ff8['on']('error',errorHandler);_0x1c6ff8['on']('close',closeHandler);_0x1c6ff8['on'](_0x4494('0x38'),timeoutHandler);_0x1c6ff8[_0x4494('0x20')]=![];_0x1c6ff8['on'](_0x4494('0x39'),hangupHandler);var _0x546133=getSquareProject['sync'](null,_0x1c6ff8[_0x4494('0x1c')]);if(_0x546133){if(_0x546133[_0x4494('0x3a')]){_0x2f4740=getRoot(_0x546133[_0x4494('0x3a')]);if(_0x2f4740&&_0x2f4740[_0x4494('0x3b')]){logger[_0x4494('0x35')](_0x4494('0x3c'),JSON[_0x4494('0x37')](_0x2f4740,null,0x2));_0x1c6ff8[_0x4494('0x3d')]=moment()[_0x4494('0x13')](_0x4494('0x3e'));_0x1f3306=initGraph(_[_0x4494('0x25')](_0x2f4740,_0x4494('0x26')),_0x2f4740[_0x4494('0x26')]);_0x381ea8=new Vertices(_0x1c6ff8,rpc,mailRpc);logger['info'](util[_0x4494('0x13')](_0x4494('0x3f'),_0x1c6ff8[_0x4494('0x1c')],_0x1c6ff8[_0x4494('0x1e')],_0x1c6ff8[_0x4494('0x1a')],_0x1c6ff8[_0x4494('0x1b')],_0x1c6ff8[_0x4494('0x1f')]));_0x1f3306[_0x4494('0x40')](_0x2f4740[_0x4494('0x3b')]['id'],function(_0x47f55c){try{_0x47f55c=_0x381ea8['clear'](_0x47f55c);logger[_0x4494('0x35')]('vertex',JSON[_0x4494('0x37')](_0x47f55c,null,0x2));if(_0x47f55c[_0x4494('0x21')]===_0x4494('0x41')){logger[_0x4494('0x12')](_0x4494('0x42'));_0x1c6ff8['context']=_0x47f55c['context']||_0x1c6ff8[_0x4494('0x43')];_0x1c6ff8['extension']=_0x47f55c[_0x4494('0x44')];_0x1c6ff8[_0x4494('0x45')]=_0x47f55c[_0x4494('0x45')]?_0x47f55c[_0x4494('0x45')]-0x1:0x1;return null;}else if(_0x47f55c&&_0x381ea8[_0x47f55c[_0x4494('0x21')]]){_0x5bba31=_0x381ea8[_0x47f55c[_0x4494('0x21')]](_0x47f55c);logger[_0x4494('0x12')]('response',JSON[_0x4494('0x37')](_0x5bba31,null,0x2));if(_0x5bba31&&_0x5bba31[_0x4494('0x46')]===AGI_CODE_SUCCESS&&_0x5bba31['result']!==AGI_RESULT_ERROR&&!_0x1c6ff8[_0x4494('0x20')]){logger[_0x4494('0x35')](_0x4494('0x47'),getLogFromObject(_0x5bba31));return _['isUndefined'](_0x5bba31[_0x4494('0x48')])?null:_0x5bba31[_0x4494('0x48')][_0x4494('0x49')]();}else{logger[_0x4494('0xe')]('response',getLogFromObject(_0x5bba31));return null;}}else{logger['error'](_0x4494('0x4a'));return null;}}catch(_0x3b9995){logger[_0x4494('0xe')](_0x3b9995['stack']);return null;}});if(_0x2f4740['finally']){logger[_0x4494('0x12')](util[_0x4494('0x13')](_0x4494('0x4b'),_0x1c6ff8['arg_1'],_0x1c6ff8[_0x4494('0x1e')],_0x1c6ff8[_0x4494('0x1a')],_0x1c6ff8['dnid'],_0x1c6ff8[_0x4494('0x1f')]));_0x1f3306[_0x4494('0x40')](_0x2f4740[_0x4494('0x4c')]['id'],function(_0x3d6647){try{_0x3d6647=_0x381ea8[_0x4494('0x4d')](_0x3d6647);logger['debug'](_0x4494('0x4e'),JSON[_0x4494('0x37')](_0x3d6647,null,0x2));if(_0x3d6647&&_0x381ea8[_0x3d6647[_0x4494('0x21')]]){_0x5bba31=_0x381ea8[_0x3d6647[_0x4494('0x21')]](_0x3d6647);if(_0x5bba31){logger[_0x4494('0x35')](_0x4494('0x47'),getLogFromObject(_0x5bba31));return _[_0x4494('0x4f')](_0x5bba31[_0x4494('0x48')])?null:_0x5bba31[_0x4494('0x48')][_0x4494('0x49')]();}else{logger['error'](_0x4494('0x47'),getLogFromObject(_0x5bba31));return null;}}else{logger['error'](_0x4494('0x4a'));return null;}}catch(_0x3d90bc){logger[_0x4494('0xe')](_0x3d90bc[_0x4494('0xf')]);return null;}});}logger[_0x4494('0x12')](util['format'](_0x4494('0x50'),_0x1c6ff8['arg_1'],_0x1c6ff8['calleridname'],_0x1c6ff8['callerid'],_0x1c6ff8['dnid'],_0x1c6ff8['uniqueid']));logger[_0x4494('0x12')](util[_0x4494('0x13')](_0x4494('0x51'),_0x1c6ff8[_0x4494('0x43')],_0x1c6ff8[_0x4494('0x44')],parseInt(_0x1c6ff8[_0x4494('0x45')],0xa)+0x1));_0x1c6ff8[_0x4494('0x52')](_0x1c6ff8['context'],_0x1c6ff8['extension'],parseInt(_0x1c6ff8['priority'],0xa)+0x1);_0x1c6ff8[_0x4494('0x53')]();}}else{logger[_0x4494('0xe')](util['format'](_0x4494('0x54'),_0x1c6ff8[_0x4494('0x1c')]));_0x1c6ff8[_0x4494('0x52')](_0x1c6ff8[_0x4494('0x43')],_0x1c6ff8[_0x4494('0x44')],parseInt(_0x1c6ff8['priority'],0xa)+0x1);_0x1c6ff8[_0x4494('0x53')]();}}else{logger['error'](util['format'](_0x4494('0x55'),_0x1c6ff8['arg_1']));_0x1c6ff8[_0x4494('0x52')](_0x1c6ff8[_0x4494('0x43')],_0x1c6ff8['extension'],parseInt(_0x1c6ff8['priority'],0xa)+0x1);_0x1c6ff8[_0x4494('0x53')]();}}function main(){var _0x2fb2f3;return utilLicense[_0x4494('0x56')]()['then'](function(_0x2ea074){if(_0x2ea074){if(_0x2ea074[_0x4494('0x57')]){if(_0x2ea074[_0x4494('0x58')]&&_0x2ea074[_0x4494('0x58')]>0x0){logger[_0x4494('0x12')](util[_0x4494('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x2ea074['callysquare']));_0x2fb2f3=_0x2ea074[_0x4494('0x58')];}else{logger['info'](_0x4494('0x59'));}}else{logger[_0x4494('0x12')](_0x4494('0x5a'));_0x2fb2f3=-0x1;}}})['catch'](function(_0x4dd3af){logger[_0x4494('0xe')](_0x4494('0x5b'),_0x4dd3af[_0x4494('0xf')]);})[_0x4494('0x4c')](function(){var _0x3dc04a=require(_0x4494('0x5c'))(config[_0x4494('0xa')]['port'],config[_0x4494('0xa')]['ip'],_0x2fb2f3);_0x3dc04a['on'](_0x4494('0xe'),errorHandler);_0x3dc04a['on']('listening',listeningHandler);_0x3dc04a['on'](_0x4494('0x5d'),connectionHandler);_0x3dc04a['on'](_0x4494('0x53'),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 ab93320..562ca0f 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(_0x39634b,_0x14f217){var _0x597363=function(_0x2545d4){while(--_0x2545d4){_0x39634b['push'](_0x39634b['shift']());}};_0x597363(++_0x14f217);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x2e848a,_0x41ba86){var _0xf43e6a=function(_0x2f9fd6){while(--_0x2f9fd6){_0x2e848a['push'](_0x2e848a['shift']());}};_0xf43e6a(++_0x41ba86);}(_0x814b,0x1a2));var _0xb814=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x814b[_0x489b87];return _0x1823b6;};'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 diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 1937779..eb29bf7 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 _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1daebd,_0x79a89){_0x1daebd=_0x1daebd-0x0;var _0x462a89=_0xb10b[_0x1daebd];return _0x462a89;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x27acd4,_0x2cb514){var _0xa64ff3=function(_0x156784){while(--_0x156784){_0x27acd4['push'](_0x27acd4['shift']());}};_0xa64ff3(++_0x2cb514);}(_0x7a54,0x106));var _0x47a5=function(_0x5c48f5,_0x3739a3){_0x5c48f5=_0x5c48f5-0x0;var _0x53de8b=_0x7a54[_0x5c48f5];return _0x53de8b;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ca86bac..02faaef 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 _0x6ea6=['getSquareOdbcById','dsn','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable'];(function(_0x5d8d8a,_0x44eaa6){var _0x2656c9=function(_0xd4c485){while(--_0xd4c485){_0x5d8d8a['push'](_0x5d8d8a['shift']());}};_0x2656c9(++_0x44eaa6);}(_0x6ea6,0x14f));var _0x66ea=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x6ea6[_0x2d364e];return _0x1b9312;};'use strict';var BPromise=require(_0x66ea('0x0'));var moment=require(_0x66ea('0x1'));var _=require(_0x66ea('0x2'));var util=require(_0x66ea('0x3'));var jayson=require(_0x66ea('0x4'));var client=jayson[_0x66ea('0x5')][_0x66ea('0x6')]({'port':0x2329});function request(_0xb2e7d6,_0x1449db){return new BPromise(function(_0x1b5935,_0x1b266f){return client['request'](_0xb2e7d6,_0x1449db)[_0x66ea('0x7')](function(_0x39b73c){if(_0x39b73c['error']){return _0x1b266f(_0x39b73c[_0x66ea('0x8')]['message']);}else{return _0x1b5935(_0x39b73c[_0x66ea('0x9')]);}})[_0x66ea('0xa')](function(_0x390bf8){return _0x1b266f(_0x390bf8);});});}exports[_0x66ea('0xb')]=function(_0xf27ef){return request(_0x66ea('0xc'),{'options':{'raw':![],'where':{'name':_0xf27ef},'attributes':[_0x66ea('0xd')]}});};exports[_0x66ea('0xe')]=function(_0xb23a8c){return request(_0x66ea('0xf'),{'options':{'raw':![],'where':{'id':_0xb23a8c},'include':[{'model':_0x66ea('0x10'),'as':_0x66ea('0x11')}],'attributes':['id','name',_0x66ea('0x12')]}});};exports[_0x66ea('0x13')]=function(_0x194b20){return request(_0x66ea('0xc'),{'options':{'where':{'id':_0x194b20},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x15')]=function(_0xb000ca){return request(_0x66ea('0x16'),{'options':{'where':{'id':_0xb000ca},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x17')]=function(_0x9d4fed){return request(_0x66ea('0x18'),{'options':{'where':{'id':_0x9d4fed},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x19')]=function(_0xc5bddb){return request('ShowSquareOdbc',{'options':{'where':{'id':_0xc5bddb},'attributes':[_0x66ea('0x1a')]}});};exports['getUserById']=function(_0x1d7847){return request(_0x66ea('0x1b'),{'options':{'where':{'id':_0x1d7847},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x1c')]=function(_0x1ad666){return request('ShowTrunk',{'options':{'where':{'id':_0x1ad666},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x1d')]=function(_0x29a569){return request(_0x66ea('0x1e'),{'options':{'where':{'id':_0x29a569},'attributes':[_0x66ea('0x1f')]}});};exports[_0x66ea('0x20')]=function(_0x27c97d){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x27c97d},'include':[{'model':_0x66ea('0x21'),'as':_0x66ea('0x22')}]}});};exports['getSmsAccountById']=function(_0x3c6118){return request(_0x66ea('0x23'),{'options':{'where':{'id':_0x3c6118},'attributes':['id',_0x66ea('0x14')]}});};exports[_0x66ea('0x24')]=function(_0x40f9a4){return request(_0x66ea('0x25'),{'body':_0x40f9a4});};exports[_0x66ea('0x26')]=function(_0x5c9a6f){return request(_0x66ea('0x27'),{'body':_0x5c9a6f});};exports[_0x66ea('0x28')]=function(_0xe88d47){return request(_0x66ea('0x29'),{'body':_[_0x66ea('0x2a')](_0xe88d47,{'project_name':_0xe88d47['arg_1'],'prev_project_name':_0xe88d47[_0x66ea('0x2b')]||'','is_subproject':_0xe88d47[_0x66ea('0x2b')]?!![]:![],'leaveAt':moment()[_0x66ea('0x2c')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x66ea('0x2d')]=function(_0x52a49b){return request(_0x66ea('0x2e'),{'body':_0x52a49b});};exports[_0x66ea('0x2f')]=function(_0x24689f){return request(_0x66ea('0x30'),{'body':_0x24689f});};exports[_0x66ea('0x31')]=function(_0x4ad257){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4ad257[_0x66ea('0x32')],'ListId':_0x4ad257[_0x66ea('0x33')]}}})[_0x66ea('0x7')](function(_0x10fd87){if(_0x10fd87){return _0x10fd87;}return request('CreateCmContact',{'body':_0x4ad257});});};exports[_0x66ea('0x34')]=function(_0xdf645c){return request(_0x66ea('0x35'),{'options':{'where':{'id':_0xdf645c},'attributes':[_0x66ea('0x14')]}});};exports[_0x66ea('0x36')]=function(_0x2db68d,_0xe54b4f){return request('LoginUser',{'body':{'interface':_0xe54b4f},'options':{'where':_0x2db68d}});};exports['agentPause']=function(_0x1d8408,_0x37ab51,_0x3d504f){return request(_0x66ea('0x37'),{'body':{'type':_0x37ab51,'uniqueid':_0x3d504f},'options':{'where':_0x1d8408}});};exports[_0x66ea('0x38')]=function(_0x59ad8b){return request(_0x66ea('0x39'),{'body':{},'options':{'where':_0x59ad8b}});};exports[_0x66ea('0x3a')]=function(_0x4b24da){return request(_0x66ea('0x3b'),{'body':{},'options':{'where':_0x4b24da}});}; \ No newline at end of file +var _0x098b=['util','request','then','error','message','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getSquareProjectById','ShowSquareProject','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getSoundById','ShowSound','save_name','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment'];(function(_0x257635,_0x4201bc){var _0x77bf6e=function(_0xd9f568){while(--_0xd9f568){_0x257635['push'](_0x257635['shift']());}};_0x77bf6e(++_0x4201bc);}(_0x098b,0x6c));var _0xb098=function(_0x5c3d1d,_0x340abf){_0x5c3d1d=_0x5c3d1d-0x0;var _0x30e0e6=_0x098b[_0x5c3d1d];return _0x30e0e6;};'use strict';var BPromise=require(_0xb098('0x0'));var moment=require(_0xb098('0x1'));var _=require('lodash');var util=require(_0xb098('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x2cff34,_0x1b47d2){return new BPromise(function(_0x1ca1e7,_0x1fc014){return client[_0xb098('0x3')](_0x2cff34,_0x1b47d2)[_0xb098('0x4')](function(_0x5747a2){if(_0x5747a2[_0xb098('0x5')]){return _0x1fc014(_0x5747a2[_0xb098('0x5')][_0xb098('0x6')]);}else{return _0x1ca1e7(_0x5747a2['result']);}})[_0xb098('0x7')](function(_0x5138e4){return _0x1fc014(_0x5138e4);});});}exports[_0xb098('0x8')]=function(_0x545561){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x545561},'attributes':[_0xb098('0x9')]}});};exports[_0xb098('0xa')]=function(_0x411e28){return request(_0xb098('0xb'),{'options':{'raw':![],'where':{'id':_0x411e28},'include':[{'model':_0xb098('0xc'),'as':_0xb098('0xd')}],'attributes':['id','name','email']}});};exports[_0xb098('0xe')]=function(_0xa9ca37){return request(_0xb098('0xf'),{'options':{'where':{'id':_0xa9ca37},'attributes':[_0xb098('0x10')]}});};exports[_0xb098('0x11')]=function(_0x1756a9){return request(_0xb098('0x12'),{'options':{'where':{'id':_0x1756a9},'attributes':['name']}});};exports[_0xb098('0x13')]=function(_0x3d4968){return request(_0xb098('0x14'),{'options':{'where':{'id':_0x3d4968},'attributes':[_0xb098('0x10')]}});};exports[_0xb098('0x15')]=function(_0x20a588){return request(_0xb098('0x16'),{'options':{'where':{'id':_0x20a588},'attributes':[_0xb098('0x17')]}});};exports[_0xb098('0x18')]=function(_0x4623a3){return request(_0xb098('0x19'),{'options':{'where':{'id':_0x4623a3},'attributes':['name']}});};exports['getTrunkById']=function(_0x1ea296){return request('ShowTrunk',{'options':{'where':{'id':_0x1ea296},'attributes':['name']}});};exports[_0xb098('0x1a')]=function(_0x18bbd5){return request(_0xb098('0x1b'),{'options':{'where':{'id':_0x18bbd5},'attributes':[_0xb098('0x1c')]}});};exports['getIntervalById']=function(_0x2bed25){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2bed25},'include':[{'model':'Interval','as':_0xb098('0x1d')}]}});};exports[_0xb098('0x1e')]=function(_0x50c7cc){return request('ShowSmsAccount',{'options':{'where':{'id':_0x50c7cc},'attributes':['id','name']}});};exports[_0xb098('0x1f')]=function(_0x3024c7){return request(_0xb098('0x20'),{'body':_0x3024c7});};exports[_0xb098('0x21')]=function(_0x35b064){return request(_0xb098('0x22'),{'body':_0x35b064});};exports[_0xb098('0x23')]=function(_0x18c6d3){return request('CreateSquareReport',{'body':_['merge'](_0x18c6d3,{'project_name':_0x18c6d3['arg_1'],'prev_project_name':_0x18c6d3[_0xb098('0x24')]||'','is_subproject':_0x18c6d3[_0xb098('0x24')]?!![]:![],'leaveAt':moment()['format'](_0xb098('0x25'))})});};exports[_0xb098('0x26')]=function(_0x2fb629){return request(_0xb098('0x27'),{'body':_0x2fb629});};exports['createSquareMessage']=function(_0x33264d){return request(_0xb098('0x28'),{'body':_0x33264d});};exports[_0xb098('0x29')]=function(_0x3c9476){return request(_0xb098('0x2a'),{'options':{'raw':![],'where':{'phone':_0x3c9476[_0xb098('0x2b')],'ListId':_0x3c9476[_0xb098('0x2c')]}}})[_0xb098('0x4')](function(_0x59d4a7){if(_0x59d4a7){return _0x59d4a7;}return request(_0xb098('0x2d'),{'body':_0x3c9476});});};exports[_0xb098('0x2e')]=function(_0x58fc83){return request(_0xb098('0x2f'),{'options':{'where':{'id':_0x58fc83},'attributes':[_0xb098('0x10')]}});};exports[_0xb098('0x30')]=function(_0x335e3c,_0x5abad8){return request(_0xb098('0x31'),{'body':{'interface':_0x5abad8},'options':{'where':_0x335e3c}});};exports[_0xb098('0x32')]=function(_0x56ec4d,_0x2068fa,_0x2d111d){return request(_0xb098('0x33'),{'body':{'type':_0x2068fa,'uniqueid':_0x2d111d},'options':{'where':_0x56ec4d}});};exports[_0xb098('0x34')]=function(_0x43e185){return request(_0xb098('0x35'),{'body':{},'options':{'where':_0x43e185}});};exports[_0xb098('0x36')]=function(_0x48e81a){return request('LogoutUser',{'body':{},'options':{'where':_0x48e81a}});}; \ 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 d46e751..cdff155 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 _0xe107=['exports','./polly'];(function(_0x183c9b,_0x108d81){var _0x307e83=function(_0x23808c){while(--_0x23808c){_0x183c9b['push'](_0x183c9b['shift']());}};_0x307e83(++_0x108d81);}(_0xe107,0xb3));var _0x7e10=function(_0x19ceda,_0x294d08){_0x19ceda=_0x19ceda-0x0;var _0x57f5c6=_0xe107[_0x19ceda];return _0x57f5c6;};var polly=require(_0x7e10('0x0'));var lex=require('./lex');module[_0x7e10('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xf3cd=['./lex','exports','./polly'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0xf3cd[_0xd0cd0b];return _0x59cced;};var polly=require(_0xdf3c('0x0'));var lex=require(_0xdf3c('0x1'));module[_0xdf3c('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 440a233..d48e65e 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 _0x0b78=['exports','./lib/api'];(function(_0x1f3591,_0x1270e9){var _0x3ffcd8=function(_0x1898ac){while(--_0x1898ac){_0x1f3591['push'](_0x1f3591['shift']());}};_0x3ffcd8(++_0x1270e9);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var lex=require(_0x80b7('0x0'));module[_0x80b7('0x1')]=function(_0x5d450f,_0x10e644,_0x4f55ab,_0x4bffac,_0x261012,_0x4ee9b4){return lex(_0x5d450f,_0x10e644,_0x4f55ab,_0x4bffac,_0x261012,_0x4ee9b4);}; \ No newline at end of file +var _0xbe31=['exports'];(function(_0x40c601,_0x25997e){var _0x214a0=function(_0x1c2f19){while(--_0x1c2f19){_0x40c601['push'](_0x40c601['shift']());}};_0x214a0(++_0x25997e);}(_0xbe31,0x83));var _0x1be3=function(_0x3df552,_0x4560ce){_0x3df552=_0x3df552-0x0;var _0x189ba9=_0xbe31[_0x3df552];return _0x189ba9;};'use strict';var lex=require('./lib/api');module[_0x1be3('0x0')]=function(_0x18e467,_0x3b216b,_0x474db2,_0x228047,_0x1bd12d,_0xacfa1e){return lex(_0x18e467,_0x3b216b,_0x474db2,_0x228047,_0x1bd12d,_0xacfa1e);}; \ 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 cca6ea9..377ab12 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 _0x2002=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2002,0x103));var _0x2200=function(_0x31df6f,_0x380e73){_0x31df6f=_0x31df6f-0x0;var _0x31e353=_0x2002[_0x31df6f];return _0x31e353;};'use strict';var BPromise=require(_0x2200('0x0'));var AWS=require(_0x2200('0x1'));function lexResult(_0x2aeaea,_0x5e6151){return new BPromise(function(_0x22b108,_0x48b1bc){_0x2aeaea[_0x2200('0x2')](_0x5e6151,function(_0x7c5a6d,_0x451362){if(_0x7c5a6d){_0x48b1bc(_0x7c5a6d);}if(_0x451362[_0x2200('0x3')]){for(const _0x477b55 in _0x451362['slots']){if(_0x451362[_0x2200('0x3')][_0x2200('0x4')](_0x477b55)){var _0x4c1282=_0x451362[_0x2200('0x3')][_0x477b55];_0x451362[_0x2200('0x5')+_0x477b55]=_0x4c1282;}}}_0x22b108(_0x451362);});});}module[_0x2200('0x6')]=function(_0x2ec2bf,_0x1f57b3,_0x197981,_0x406d5d,_0x19d108,_0x24dd13){var _0x1796e2=new AWS[(_0x2200('0x7'))]({'accessKeyId':_0x1f57b3,'secretAccessKey':_0x197981,'region':_0x406d5d});var _0x110c86={'botAlias':_0x2200('0x8'),'botName':_0x24dd13,'inputText':_0x19d108,'userId':_0x2ec2bf};return lexResult(_0x1796e2,_0x110c86);}; \ No newline at end of file +var _0xce32=['slot_','exports','LexRuntime','slots','hasOwnProperty'];(function(_0x5e9060,_0x46d2a2){var _0x5ba7cb=function(_0xe82280){while(--_0xe82280){_0x5e9060['push'](_0x5e9060['shift']());}};_0x5ba7cb(++_0x46d2a2);}(_0xce32,0x1ac));var _0x2ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce32[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x19c18a,_0x12c4ba){return new BPromise(function(_0x2436a5,_0x4f07a6){_0x19c18a['postText'](_0x12c4ba,function(_0x139c84,_0xb1427){if(_0x139c84){_0x4f07a6(_0x139c84);}if(_0xb1427[_0x2ce3('0x0')]){for(const _0x29a4fd in _0xb1427['slots']){if(_0xb1427['slots'][_0x2ce3('0x1')](_0x29a4fd)){var _0x578595=_0xb1427[_0x2ce3('0x0')][_0x29a4fd];_0xb1427[_0x2ce3('0x2')+_0x29a4fd]=_0x578595;}}}_0x2436a5(_0xb1427);});});}module[_0x2ce3('0x3')]=function(_0x2d2041,_0x46bbd9,_0x1cf2fb,_0x2405f7,_0x5a9a96,_0x31fdf3){var _0x2efc28=new AWS[(_0x2ce3('0x4'))]({'accessKeyId':_0x46bbd9,'secretAccessKey':_0x1cf2fb,'region':_0x2405f7});var _0x5d1807={'botAlias':'$LATEST','botName':_0x31fdf3,'inputText':_0x5a9a96,'userId':_0x2d2041};return lexResult(_0x2efc28,_0x5d1807);}; \ 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 3edde54..aa928db 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x2db1e0,_0x18c3a8,_0x3b0a08,_0x26abfc,_0x423355,_0x23e8fd,_0xafd5e6){return polly(_0x2db1e0,_0x18c3a8,_0x3b0a08,_0x26abfc,_0x423355,_0x23e8fd,_0xafd5e6);}; \ No newline at end of file +var _0xbc3f=['./lib/api','exports'];(function(_0xe116c1,_0x295f11){var _0x448360=function(_0x3fb426){while(--_0x3fb426){_0xe116c1['push'](_0xe116c1['shift']());}};_0x448360(++_0x295f11);}(_0xbc3f,0x128));var _0xfbc3=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xbc3f[_0x102e37];return _0x35a07c;};'use strict';var polly=require(_0xfbc3('0x0'));module[_0xfbc3('0x1')]=function(_0x26276c,_0x559d18,_0x103622,_0x2fa32b,_0x120589,_0x26921a,_0x2e728e){return polly(_0x26276c,_0x559d18,_0x103622,_0x2fa32b,_0x120589,_0x26921a,_0x2e728e);}; \ 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 eb52e84..28ed296 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 _0x8ccc=['AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','randomstring','synthesizeSpeech'];(function(_0x5e5347,_0x20eea4){var _0x502fe2=function(_0x5eec0b){while(--_0x5eec0b){_0x5e5347['push'](_0x5e5347['shift']());}};_0x502fe2(++_0x20eea4);}(_0x8ccc,0xae));var _0xc8cc=function(_0x3fc649,_0x1eca02){_0x3fc649=_0x3fc649-0x0;var _0xc266ec=_0x8ccc[_0x3fc649];return _0xc266ec;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0xc8cc('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x1b66a6,_0xc6eb5b,_0x53426d){return new BPromise(function(_0x143270,_0x2531d0){_0x1b66a6[_0xc8cc('0x1')](_0xc6eb5b,function(_0x5afef6,_0x1e20ee){if(_0x5afef6){_0x2531d0(_0x5afef6);}else if(_0x1e20ee){if(_0x1e20ee[_0xc8cc('0x2')]instanceof Buffer){fs[_0xc8cc('0x3')](_0x53426d,_0x1e20ee[_0xc8cc('0x2')],function(_0x41a215){if(_0x41a215){_0x2531d0(_0x41a215);}else{_0x143270();}});}else{_0x2531d0(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2531d0(new Error(_0xc8cc('0x4')));}});});}module[_0xc8cc('0x5')]=function(_0x19793e,_0x24df0e,_0x5d55cd,_0x59b094,_0x5d4737,_0x1495e9,_0x15c61b){var _0x2d441c=new AWS['Polly']({'accessKeyId':_0x19793e,'secretAccessKey':_0x24df0e,'region':_0x5d55cd});var _0x33fd23={'Text':_0x5d4737,'TextType':_0x1495e9||_0xc8cc('0x6'),'OutputFormat':_0xc8cc('0x7'),'VoiceId':_0x59b094};return pollyResult(_0x2d441c,_0x33fd23,_0x15c61b);}; \ No newline at end of file +var _0x24a8=['exports','Polly','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x2a34c9,_0x124b3a){var _0x132247=function(_0xaeec48){while(--_0xaeec48){_0x2a34c9['push'](_0x2a34c9['shift']());}};_0x132247(++_0x124b3a);}(_0x24a8,0xcb));var _0x824a=function(_0x4c0616,_0x55863f){_0x4c0616=_0x4c0616-0x0;var _0xff5906=_0x24a8[_0x4c0616];return _0xff5906;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x824a('0x0'));var rs=require(_0x824a('0x1'));var AWS=require(_0x824a('0x2'));function pollyResult(_0x1cea4a,_0x5f0f6f,_0x2a45a5){return new BPromise(function(_0x2208e7,_0x3accca){_0x1cea4a[_0x824a('0x3')](_0x5f0f6f,function(_0x3c4b4f,_0x31c758){if(_0x3c4b4f){_0x3accca(_0x3c4b4f);}else if(_0x31c758){if(_0x31c758[_0x824a('0x4')]instanceof Buffer){fs[_0x824a('0x5')](_0x2a45a5,_0x31c758[_0x824a('0x4')],function(_0xd6b64d){if(_0xd6b64d){_0x3accca(_0xd6b64d);}else{_0x2208e7();}});}else{_0x3accca(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3accca(new Error(_0x824a('0x6')));}});});}module[_0x824a('0x7')]=function(_0x1b25bb,_0x3e559d,_0x53ea36,_0x57125a,_0x1923eb,_0x37f8cb,_0x68586c){var _0x490e45=new AWS[(_0x824a('0x8'))]({'accessKeyId':_0x1b25bb,'secretAccessKey':_0x3e559d,'region':_0x53ea36});var _0x1b755c={'Text':_0x1923eb,'TextType':_0x37f8cb||'text','OutputFormat':_0x824a('0x9'),'VoiceId':_0x57125a};return pollyResult(_0x490e45,_0x1b755c,_0x68586c);}; \ 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 0c22d7f..85d7ba7 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb39=['./lib/api','exports'];(function(_0x4effa3,_0x591921){var _0x1eb030=function(_0x51f933){while(--_0x51f933){_0x4effa3['push'](_0x4effa3['shift']());}};_0x1eb030(++_0x591921);}(_0xdb39,0x1a8));var _0x9db3=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xdb39[_0x56825b];return _0x69ce77;};'use strict';var asr=require(_0x9db3('0x0'));module[_0x9db3('0x1')]=function(_0x523aea,_0x10f050,_0x75df76,_0x331bf9){return asr(_0x523aea,_0x10f050,_0x75df76);}; \ No newline at end of file +var _0x7083=['exports','./lib/api'];(function(_0x56ea6f,_0x15535a){var _0x43ac31=function(_0x1b6d99){while(--_0x1b6d99){_0x56ea6f['push'](_0x56ea6f['shift']());}};_0x43ac31(++_0x15535a);}(_0x7083,0x157));var _0x3708=function(_0x3d4b22,_0x407496){_0x3d4b22=_0x3d4b22-0x0;var _0x390557=_0x7083[_0x3d4b22];return _0x390557;};'use strict';var asr=require(_0x3708('0x0'));module[_0x3708('0x1')]=function(_0x2ef96a,_0x2f14fa,_0x5eab11,_0x35cd0f){return asr(_0x2ef96a,_0x2f14fa,_0x5eab11);}; \ 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 6378dc1..8f6523c 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 _0x04e1=['string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','exports'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x04e1,0x190));var _0x104e=function(_0x4ec3a2,_0x10e83b){_0x4ec3a2=_0x4ec3a2-0x0;var _0x99c3b6=_0x04e1[_0x4ec3a2];return _0x99c3b6;};'use strict';var url=require(_0x104e('0x0'));var BPromise=require(_0x104e('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x104e('0x2')]=function(_0x3550d3,_0x5e8bf0,_0x3a15d0){return new BPromise(function(_0xa7c2a1,_0x1597eb){var _0xc17ba7;if(typeof _0x3550d3!==_0x104e('0x3')||_0x3550d3[_0x104e('0x4')]===0x0){return _0x1597eb(_0x104e('0x5'));}if(typeof _0x5e8bf0!==_0x104e('0x3')||_0x5e8bf0[_0x104e('0x4')]===0x0){return _0x1597eb('key\x20should\x20be\x20a\x20string');}if(typeof _0x3a15d0!==_0x104e('0x6')&&(typeof _0x3a15d0!=='string'||_0x3a15d0[_0x104e('0x4')]===0x0)){return _0x1597eb(_0x104e('0x7'));}try{_0xc17ba7=fs['readFileSync'](_0x3550d3)[_0x104e('0x8')](_0x104e('0x9'));}catch(_0x10821d){return _0x1597eb(_0x10821d);}return _0xa7c2a1({'method':_0x104e('0xa'),'uri':host+_0x104e('0xb')+_0x5e8bf0,'body':{'config':{'encoding':_0x104e('0xc'),'sampleRateHertz':'8000','languageCode':_0x3a15d0},'audio':{'content':_0xc17ba7}},'json':!![]});});}; \ No newline at end of file +var _0x553d=['string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','length','undefined'];(function(_0x5e8258,_0x30dd15){var _0x4c1b20=function(_0x3864ea){while(--_0x3864ea){_0x5e8258['push'](_0x5e8258['shift']());}};_0x4c1b20(++_0x30dd15);}(_0x553d,0x10e));var _0xd553=function(_0x4be97b,_0x57816c){_0x4be97b=_0x4be97b-0x0;var _0xf0c5a4=_0x553d[_0x4be97b];return _0xf0c5a4;};'use strict';var url=require(_0xd553('0x0'));var BPromise=require(_0xd553('0x1'));var fs=require('fs');var host=_0xd553('0x2');module['exports']=function(_0xc76d,_0x1dc41c,_0x24966d){return new BPromise(function(_0x4dd124,_0x3427a9){var _0x17febf;if(typeof _0xc76d!=='string'||_0xc76d['length']===0x0){return _0x3427a9(_0xd553('0x3'));}if(typeof _0x1dc41c!=='string'||_0x1dc41c[_0xd553('0x4')]===0x0){return _0x3427a9('key\x20should\x20be\x20a\x20string');}if(typeof _0x24966d!==_0xd553('0x5')&&(typeof _0x24966d!==_0xd553('0x6')||_0x24966d[_0xd553('0x4')]===0x0)){return _0x3427a9(_0xd553('0x7'));}try{_0x17febf=fs[_0xd553('0x8')](_0xc76d)[_0xd553('0x9')](_0xd553('0xa'));}catch(_0x4fa170){return _0x3427a9(_0x4fa170);}return _0x4dd124({'method':'POST','uri':host+_0xd553('0xb')+_0x1dc41c,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x24966d},'audio':{'content':_0x17febf}},'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 e97064b..10cb4be 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 _0x024b=['./asr','exports'];(function(_0x4de156,_0x19d256){var _0x3f6afd=function(_0x5d8e9e){while(--_0x5d8e9e){_0x4de156['push'](_0x4de156['shift']());}};_0x3f6afd(++_0x19d256);}(_0x024b,0xac));var _0xb024=function(_0x1cccd3,_0x307ba0){_0x1cccd3=_0x1cccd3-0x0;var _0x40a7af=_0x024b[_0x1cccd3];return _0x40a7af;};var asr=require(_0xb024('0x0'));module[_0xb024('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');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 b06edc1..0b4904a 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 _0x4564=['finish\x20download\x20file','close','download\x20error','pipe','end','https:','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','resolve','.mp3','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','goggleTTS\x20path','googleASR','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','score','status','code','metadata','isFallbackIntent','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','parse','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','url','randomstring','sox','request-promise','querystring','google-tts-api','apiai-promise','md5','./google','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream'];(function(_0x1628c1,_0x120470){var _0x5bd9b2=function(_0x279bcd){while(--_0x279bcd){_0x1628c1['push'](_0x1628c1['shift']());}};_0x5bd9b2(++_0x120470);}(_0x4564,0x129));var _0x4456=function(_0x3c1cb8,_0x48eea1){_0x3c1cb8=_0x3c1cb8-0x0;var _0x5d10f8=_0x4564[_0x3c1cb8];return _0x5d10f8;};'use strict';var fs=require('fs');var path=require(_0x4456('0x0'));var http=require(_0x4456('0x1'));var https=require(_0x4456('0x2'));var urlParse=require(_0x4456('0x3'))['parse'];var BPromise=require('bluebird');var rs=require(_0x4456('0x4'));var sox=require(_0x4456('0x5'));var rp=require(_0x4456('0x6'));var util=require('util');var querystring=require(_0x4456('0x7'));var tts=require(_0x4456('0x8'));var apiai=require(_0x4456('0x9'));var md5=require(_0x4456('0xa'));var google=require(_0x4456('0xb'));var aws=require('./aws');var tilde=require(_0x4456('0xc'));var sestek=require(_0x4456('0xd'));var logger=require(_0x4456('0xe'))(_0x4456('0xf'));var ISPEECH_API=_0x4456('0x10');function downloadFile(_0x277462,_0x55c8fb){return new BPromise(function(_0x53c7f6,_0x556526){var _0x435aff=urlParse(_0x277462);var _0x5b1229=_0x435aff[_0x4456('0x11')]==='https:'?https:http;var _0x54c2d6={'host':_0x435aff[_0x4456('0x12')],'path':_0x435aff['path'],'headers':{'user-agent':_0x4456('0x13')}};_0x5b1229[_0x4456('0x14')](_0x54c2d6,function(_0xaf1592){if(_0xaf1592[_0x4456('0x15')]!==0xc8){logger[_0x4456('0x16')](_0x4456('0x17')+_0x277462+_0x4456('0x18')+_0xaf1592[_0x4456('0x15')]+'\x20('+_0xaf1592[_0x4456('0x19')]+')');_0x556526(new Error('request\x20to\x20'+_0x277462+_0x4456('0x18')+_0xaf1592['statusCode']+'\x20('+_0xaf1592[_0x4456('0x19')]+')'));return;}var _0x7626a8=fs[_0x4456('0x1a')](_0x55c8fb);_0x7626a8['on']('finish',function(){logger['info'](_0x4456('0x1b'));_0x7626a8[_0x4456('0x1c')](_0x53c7f6);});_0x7626a8['on'](_0x4456('0x16'),function(_0x1465c3){fs['unlink'](_0x55c8fb);logger[_0x4456('0x16')](_0x4456('0x1d'),_0x1465c3);_0x556526(_0x1465c3);});_0xaf1592[_0x4456('0x1e')](_0x7626a8);})['on'](_0x4456('0x16'),function(_0x28020d){logger[_0x4456('0x16')](_0x28020d);_0x556526(_0x28020d);})[_0x4456('0x1f')]();});}function uploadFile(_0x1667ad){return new BPromise(function(_0x5a148f,_0x4dba03){var _0x1571a7=urlParse(_0x1667ad);var _0x40bfa9=_0x1571a7[_0x4456('0x11')]===_0x4456('0x20')?https:http;var _0x12e339={'host':_0x1571a7[_0x4456('0x12')],'path':_0x1571a7[_0x4456('0x0')],'headers':{'user-agent':_0x4456('0x13')}};_0x40bfa9[_0x4456('0x14')](_0x12e339,function(_0x53d007){if(_0x53d007['statusCode']!==0xc8){_0x4dba03(new Error(_0x4456('0x17')+_0x1667ad+_0x4456('0x18')+_0x53d007[_0x4456('0x15')]+'\x20('+_0x53d007[_0x4456('0x19')]+')'));return;}var _0x4eddcf='';_0x53d007['on']('data',function(_0x1a3248){_0x4eddcf+=_0x1a3248;});_0x53d007['on'](_0x4456('0x1f'),function(){_0x5a148f(_0x4eddcf);});})['on'](_0x4456('0x16'),function(_0x46761f){_0x4dba03(_0x46761f);})[_0x4456('0x1f')]();});}function convertFile(_0x2c9cf5,_0x9bd79f){return new BPromise(function(_0x127893,_0x93fe96){var _0xec573f=sox[_0x4456('0x21')](_0x2c9cf5,_0x9bd79f,{'sampleRate':0x1f40,'format':_0x4456('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xec573f['on'](_0x4456('0x16'),function(_0x547b22){logger[_0x4456('0x16')](_0x4456('0x23'),_0x547b22);_0x93fe96(_0x547b22);});_0xec573f['on'](_0x4456('0x1f'),function(){logger[_0x4456('0x24')](_0x4456('0x25'));_0x127893();});_0xec573f[_0x4456('0x26')]();});}function base64Decode(_0x50ec53,_0x44b7c1){var _0x36a6e1=path['resolve'](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x29'));fs[_0x4456('0x2a')](_0x36a6e1,_0x50ec53,_0x4456('0x2b'));return convertFile(_0x36a6e1,_0x44b7c1)[_0x4456('0x2c')](function(){try{fs[_0x4456('0x2d')](_0x36a6e1);fs[_0x4456('0x2e')](_0x44b7c1,_0x4456('0x2f'));}catch(_0x3df293){logger[_0x4456('0x16')](_0x3df293);}return _0x44b7c1['split']('.')[0x0];});}function base64Encode(_0x17cf36){var _0x4add65=fs['readFileSync'](_0x17cf36);return new Buffer(_0x4add65)[_0x4456('0x30')](_0x4456('0x2b'));}exports[_0x4456('0x31')]=function(_0x464e27,_0x314aeb,_0x58a38d,_0x355a56,_0x20506b,_0x5dd8f0){var _0x4290e6,_0x5972c2;var _0x2192a8=_0x4456('0x32');var _0x568d30=_0x4456('0x33')+_0x464e27;var _0x1d2953={};if(_0x314aeb==='ssml'){_0x1d2953[_0x4456('0x34')]={'ssml':_0x58a38d};}else{_0x1d2953[_0x4456('0x34')]={'text':_0x58a38d};};_0x1d2953['voice']={'languageCode':_0x355a56,'ssmlGender':_0x20506b};_0x1d2953[_0x4456('0x35')]={'audioEncoding':_0x4456('0x36'),'sampleRateHertz':0x1f40};var _0x4303fc={'url':_0x2192a8+_0x4456('0x37')+_0x568d30,'method':'POST','json':!![],'body':_0x1d2953};return rp(_0x4303fc)['then'](function(_0x5b2e48){return new BPromise(function(_0x54de96,_0x28977d){_0x4290e6=path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs['generate'](0x4)+_0x4456('0x39'));var _0x12fdcd=Buffer['from'](_0x5b2e48[_0x4456('0x3a')],_0x4456('0x2b'));return fs[_0x4456('0x3b')](_0x4290e6,_0x12fdcd,function(_0x1682ae){_0x28977d(_0x1682ae);},function(_0x4e940b){fs[_0x4456('0x2e')](_0x4290e6,'777');_0x54de96(_0x4e940b);});});})['then'](function(_0x4b4f25){_0x5972c2=path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x29'));return convertFile(_0x4290e6,_0x5972c2);})[_0x4456('0x2c')](function(){try{fs[_0x4456('0x2d')](_0x4290e6);fs[_0x4456('0x2e')](_0x5972c2,_0x4456('0x2f'));}catch(_0x2f01f5){logger['error'](_0x2f01f5);}logger[_0x4456('0x24')](_0x4456('0x3c'),_0x5972c2['split']('.')[0x0]);return _0x5972c2[_0x4456('0x3d')]('.')[0x0];});};exports[_0x4456('0x3e')]=function(_0x3a86ac,_0x227b72){var _0x3dbd1d,_0x51fd47;return tts(_0x3a86ac,_0x227b72||'en',0x1)[_0x4456('0x2c')](function(_0x2bbdfc){logger[_0x4456('0x24')](_0x2bbdfc);_0x3dbd1d=path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x39'));return downloadFile(_0x2bbdfc,_0x3dbd1d);})['then'](function(){_0x51fd47=path['resolve'](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x29'));return convertFile(_0x3dbd1d,_0x51fd47);})[_0x4456('0x2c')](function(){try{fs[_0x4456('0x2d')](_0x3dbd1d);fs['chmodSync'](_0x51fd47,_0x4456('0x2f'));}catch(_0x10aafa){logger['error'](_0x10aafa);}logger['info'](_0x4456('0x3f'),_0x51fd47[_0x4456('0x3d')]('.')[0x0]);return _0x51fd47[_0x4456('0x3d')]('.')[0x0];});};exports[_0x4456('0x40')]=function(_0x5481dc,_0x3f9ebb,_0x27fd9a){return google['asr'](_0x5481dc,_0x3f9ebb,_0x27fd9a)[_0x4456('0x2c')](function(_0x1bd6f1){logger[_0x4456('0x24')](_0x1bd6f1[_0x4456('0x41')]);return rp(_0x1bd6f1);})[_0x4456('0x2c')](function(_0x30b73f){var _0x4a2423='';var _0x59489f=0x0;try{fs['unlink'](_0x5481dc);}catch(_0x149515){logger['error'](_0x149515);}if(_0x30b73f&&_0x30b73f[_0x4456('0x42')]){_0x4a2423=_0x30b73f[_0x4456('0x42')]['map'](function(_0x573dea){return _0x573dea&&_0x573dea[_0x4456('0x43')][0x0]&&_0x573dea[_0x4456('0x43')][0x0][_0x4456('0x44')]?_0x573dea['alternatives'][0x0][_0x4456('0x44')]:'';})[_0x4456('0x45')]('\x0a');_0x59489f=_0x30b73f['results'][_0x4456('0x46')](function(_0x35ca5f){return _0x35ca5f&&_0x35ca5f[_0x4456('0x43')][0x0]&&_0x35ca5f[_0x4456('0x43')][0x0][_0x4456('0x47')]?_0x35ca5f[_0x4456('0x43')][0x0][_0x4456('0x47')]:0x0;})['join']('\x0a');}logger['info'](_0x4456('0x48'),_0x4a2423);logger[_0x4456('0x24')](_0x4456('0x49'),_0x59489f);return{'transcript':_0x4a2423,'confidence':_0x59489f};})[_0x4456('0x4a')](function(_0xe0dfab){logger['error'](_0x4456('0x4b'),_0xe0dfab[_0x4456('0x15')],_0xe0dfab[_0x4456('0x4c')],_0xe0dfab['message']);});};exports[_0x4456('0x4d')]=function(_0x7bd443,_0x3e7903,_0xd3f7d5,_0x43c987){var _0x1b7f83=apiai(_0x3e7903,{'language':_0x43c987||'en'});return _0x1b7f83['textRequest'](_0xd3f7d5,{'sessionId':md5(_0x7bd443)})['then'](function(_0xc8fc08){logger[_0x4456('0x24')](JSON[_0x4456('0x4e')](_0xc8fc08));return{'source':_0xc8fc08[_0x4456('0x4f')][_0x4456('0x50')],'resolvedQuery':_0xc8fc08[_0x4456('0x4f')][_0x4456('0x51')],'action':_0xc8fc08[_0x4456('0x4f')]['action'],'actionIncomplete':_0xc8fc08['result'][_0x4456('0x52')],'speech':_0xc8fc08[_0x4456('0x4f')][_0x4456('0x53')]['speech'],'score':_0xc8fc08[_0x4456('0x4f')][_0x4456('0x54')],'statusCode':_0xc8fc08[_0x4456('0x55')][_0x4456('0x56')],'endConversation':_0xc8fc08['result'][_0x4456('0x57')]['endConversation']||![],'isFallbackIntent':_0xc8fc08[_0x4456('0x4f')]['metadata'][_0x4456('0x58')]};});};exports['tildeASR']=function(_0xea3d1d,_0x22ce93,_0x2109ee,_0x282e94){return tilde[_0x4456('0x59')](_0xea3d1d,_0x22ce93,_0x2109ee,_0x282e94)[_0x4456('0x2c')](function(_0x1792f1){try{fs['unlink'](_0xea3d1d);}catch(_0x43ff8d){logger[_0x4456('0x16')](_0x43ff8d);}logger['info'](_0x4456('0x5a'),_0x1792f1[_0x4456('0x44')]);logger['info']('Tilde\x20ASR\x20confidence',_0x1792f1[_0x4456('0x47')]);return _0x1792f1;});};exports[_0x4456('0x5b')]=function(_0x22838a,_0x575709,_0x4a1b35,_0x5bcec8,_0x38eeef,_0x48ad78){var _0x30608d=path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs['generate'](0x4)+'.mp3');var _0x589094;return aws[_0x4456('0x5c')](_0x22838a,_0x575709,_0x4a1b35,_0x5bcec8,_0x38eeef,_0x48ad78,_0x30608d)['then'](function(){_0x589094=path[_0x4456('0x38')](__dirname,'tmp',rs[_0x4456('0x28')](0x4)+_0x4456('0x29'));return convertFile(_0x30608d,_0x589094);})['then'](function(){try{fs[_0x4456('0x2d')](_0x30608d);fs[_0x4456('0x2e')](_0x589094,_0x4456('0x2f'));}catch(_0x3d38ad){logger[_0x4456('0x16')](_0x3d38ad);}return _0x589094[_0x4456('0x3d')]('.')[0x0];});};exports['awsLex']=function(_0x3ef352,_0x179ea7,_0x438342,_0x359842,_0x51dd97,_0x27e3e7){return aws[_0x4456('0x5d')](_0x3ef352,_0x179ea7,_0x438342,_0x359842,_0x51dd97,_0x27e3e7)[_0x4456('0x2c')](function(_0x26ef84){logger[_0x4456('0x24')](JSON[_0x4456('0x4e')](_0x26ef84));return _0x26ef84;});};exports[_0x4456('0x5e')]=function(_0x288561,_0x57a078,_0x389c16,_0x355191){var _0x2609fd=util[_0x4456('0x5f')](_0x4456('0x60'),ISPEECH_API,_0x288561,encodeURIComponent(_0x57a078),_0x389c16,_0x355191);var _0x856160=path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+'.mp3');var _0x239e55;return downloadFile(_0x2609fd,_0x856160)[_0x4456('0x2c')](function(){_0x239e55=path['resolve'](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x29'));return convertFile(_0x856160,_0x239e55);})[_0x4456('0x2c')](function(){try{fs[_0x4456('0x2d')](_0x856160);fs[_0x4456('0x2e')](_0x239e55,_0x4456('0x2f'));}catch(_0x3752ab){logger[_0x4456('0x16')](_0x3752ab);}return _0x239e55['split']('.')[0x0];});};exports[_0x4456('0x61')]=function(_0x19ca9f,_0x3f6e54,_0x504025,_0xef2ed0){var _0xeb5cfa=util[_0x4456('0x5f')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3f6e54,_0x504025,base64Encode(_0x19ca9f),_0xef2ed0?util['format'](_0x4456('0x62'),encodeURIComponent(_0xef2ed0)):_0x4456('0x63'));return uploadFile(_0xeb5cfa)[_0x4456('0x2c')](function(_0x11622e){return querystring[_0x4456('0x64')](_0x11622e);});};exports['sestekNDA']=function(_0x2ed1b7,_0x5c9f13){return sestek[_0x4456('0x65')](_0x2ed1b7,_0x5c9f13)[_0x4456('0x2c')](function(_0x488d27){logger['info'](JSON[_0x4456('0x4e')](_0x488d27));var _0x20942d={'speech':_0x488d27['text'],'action':_0x488d27['channelData']?_0x488d27['channelData']['CustomAction']:undefined,'actiondata':_0x488d27[_0x4456('0x66')]?_0x488d27[_0x4456('0x66')][_0x4456('0x67')]:undefined};if(_0x488d27[_0x4456('0x66')]&&_0x488d27['channelData']['AudioFromTts']){return base64Decode(_0x488d27[_0x4456('0x66')][_0x4456('0x68')][_0x4456('0x69')],path[_0x4456('0x38')](__dirname,_0x4456('0x27'),rs[_0x4456('0x28')](0x4)+_0x4456('0x29')))[_0x4456('0x2c')](function(_0x1a202c){_0x20942d[_0x4456('0x6a')]=_0x1a202c;return _0x20942d;});}return _0x20942d;});};exports[_0x4456('0x6b')]=function(){return __dirname;}; \ No newline at end of file +var _0x77ca=['googleASR\x20confidence','[%s]\x20%s:%s','name','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','stringify','ispeechTTS','format','ispeechASR','model=%s','freeform=3','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','path','http','https','url','parse','bluebird','sox','request-promise','util','google-tts-api','apiai-promise','md5','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','unlink','pipe','protocol','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','.wav','writeFileSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','MP3','POST','then','generate','.mp3','from','chmodSync','resolve','googleCloudTTS\x20path','split','googleTTS','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription'];(function(_0x3541e4,_0x4dcf9a){var _0x3ca5d9=function(_0x3eaac2){while(--_0x3eaac2){_0x3541e4['push'](_0x3541e4['shift']());}};_0x3ca5d9(++_0x4dcf9a);}(_0x77ca,0xf8));var _0xa77c=function(_0x2d9cc3,_0x13bba9){_0x2d9cc3=_0x2d9cc3-0x0;var _0x2675db=_0x77ca[_0x2d9cc3];return _0x2675db;};'use strict';var fs=require('fs');var path=require(_0xa77c('0x0'));var http=require(_0xa77c('0x1'));var https=require(_0xa77c('0x2'));var urlParse=require(_0xa77c('0x3'))[_0xa77c('0x4')];var BPromise=require(_0xa77c('0x5'));var rs=require('randomstring');var sox=require(_0xa77c('0x6'));var rp=require(_0xa77c('0x7'));var util=require(_0xa77c('0x8'));var querystring=require('querystring');var tts=require(_0xa77c('0x9'));var apiai=require(_0xa77c('0xa'));var md5=require(_0xa77c('0xb'));var google=require('./google');var aws=require('./aws');var tilde=require(_0xa77c('0xc'));var sestek=require('./sestek');var logger=require(_0xa77c('0xd'))('agi');var ISPEECH_API=_0xa77c('0xe');function downloadFile(_0x2bbd73,_0x2dfc7b){return new BPromise(function(_0x3d1231,_0xc54c95){var _0x565cc3=urlParse(_0x2bbd73);var _0x139d2a=_0x565cc3['protocol']===_0xa77c('0xf')?https:http;var _0xc62d70={'host':_0x565cc3[_0xa77c('0x10')],'path':_0x565cc3[_0xa77c('0x0')],'headers':{'user-agent':_0xa77c('0x11')}};_0x139d2a[_0xa77c('0x12')](_0xc62d70,function(_0x4d4cdc){if(_0x4d4cdc['statusCode']!==0xc8){logger[_0xa77c('0x13')](_0xa77c('0x14')+_0x2bbd73+_0xa77c('0x15')+_0x4d4cdc[_0xa77c('0x16')]+'\x20('+_0x4d4cdc[_0xa77c('0x17')]+')');_0xc54c95(new Error(_0xa77c('0x14')+_0x2bbd73+'\x20failed,\x20status\x20code\x20=\x20'+_0x4d4cdc['statusCode']+'\x20('+_0x4d4cdc[_0xa77c('0x17')]+')'));return;}var _0xc478f=fs['createWriteStream'](_0x2dfc7b);_0xc478f['on'](_0xa77c('0x18'),function(){logger[_0xa77c('0x19')](_0xa77c('0x1a'));_0xc478f[_0xa77c('0x1b')](_0x3d1231);});_0xc478f['on'](_0xa77c('0x13'),function(_0x50982a){fs[_0xa77c('0x1c')](_0x2dfc7b);logger[_0xa77c('0x13')]('download\x20error',_0x50982a);_0xc54c95(_0x50982a);});_0x4d4cdc[_0xa77c('0x1d')](_0xc478f);})['on'](_0xa77c('0x13'),function(_0x406a9d){logger[_0xa77c('0x13')](_0x406a9d);_0xc54c95(_0x406a9d);})['end']();});}function uploadFile(_0x2f67aa){return new BPromise(function(_0x260a32,_0x473629){var _0x42de9f=urlParse(_0x2f67aa);var _0x35777d=_0x42de9f[_0xa77c('0x1e')]===_0xa77c('0xf')?https:http;var _0x570528={'host':_0x42de9f[_0xa77c('0x10')],'path':_0x42de9f[_0xa77c('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x35777d[_0xa77c('0x12')](_0x570528,function(_0x53adb3){if(_0x53adb3[_0xa77c('0x16')]!==0xc8){_0x473629(new Error('request\x20to\x20'+_0x2f67aa+_0xa77c('0x15')+_0x53adb3[_0xa77c('0x16')]+'\x20('+_0x53adb3['statusMessage']+')'));return;}var _0x5e3376='';_0x53adb3['on'](_0xa77c('0x1f'),function(_0x1f1eaf){_0x5e3376+=_0x1f1eaf;});_0x53adb3['on'](_0xa77c('0x20'),function(){_0x260a32(_0x5e3376);});})['on']('error',function(_0x200d4d){_0x473629(_0x200d4d);})['end']();});}function convertFile(_0x4df840,_0x558822){return new BPromise(function(_0x4de7f2,_0x4bfe20){var _0x56d504=sox[_0xa77c('0x21')](_0x4df840,_0x558822,{'sampleRate':0x1f40,'format':_0xa77c('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56d504['on'](_0xa77c('0x13'),function(_0xb1cb3d){logger[_0xa77c('0x13')](_0xa77c('0x23'),_0xb1cb3d);_0x4bfe20(_0xb1cb3d);});_0x56d504['on'](_0xa77c('0x20'),function(){logger[_0xa77c('0x19')](_0xa77c('0x24'));_0x4de7f2();});_0x56d504['start']();});}function base64Decode(_0x2ac108,_0x50464d){var _0x5aa59a=path['resolve'](__dirname,_0xa77c('0x25'),rs['generate'](0x4)+_0xa77c('0x26'));fs[_0xa77c('0x27')](_0x5aa59a,_0x2ac108,'base64');return convertFile(_0x5aa59a,_0x50464d)['then'](function(){try{fs[_0xa77c('0x1c')](_0x5aa59a);fs['chmodSync'](_0x50464d,_0xa77c('0x28'));}catch(_0x179a8e){logger['error'](_0x179a8e);}return _0x50464d['split']('.')[0x0];});}function base64Encode(_0x3b2b4c){var _0x3135b7=fs[_0xa77c('0x29')](_0x3b2b4c);return new Buffer(_0x3135b7)[_0xa77c('0x2a')](_0xa77c('0x2b'));}exports[_0xa77c('0x2c')]=function(_0x166656,_0x2d2f17,_0x4989ae,_0x65e6de,_0x3eec0d,_0x122ed5){var _0x14894,_0x47d6b4;var _0x3e8783=_0xa77c('0x2d');var _0x564058='?key='+_0x166656;var _0x427658={};if(_0x2d2f17===_0xa77c('0x2e')){_0x427658[_0xa77c('0x2f')]={'ssml':_0x4989ae};}else{_0x427658[_0xa77c('0x2f')]={'text':_0x4989ae};};_0x427658[_0xa77c('0x30')]={'languageCode':_0x65e6de,'ssmlGender':_0x3eec0d};_0x427658['audioConfig']={'audioEncoding':_0xa77c('0x31'),'sampleRateHertz':0x1f40};var _0x33f52e={'url':_0x3e8783+'text:synthesize'+_0x564058,'method':_0xa77c('0x32'),'json':!![],'body':_0x427658};return rp(_0x33f52e)[_0xa77c('0x33')](function(_0x34f68a){return new BPromise(function(_0x195727,_0x158d0d){_0x14894=path['resolve'](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x35'));var _0x4b02d6=Buffer[_0xa77c('0x36')](_0x34f68a['audioContent'],_0xa77c('0x2b'));return fs['writeFile'](_0x14894,_0x4b02d6,function(_0x1b9916){_0x158d0d(_0x1b9916);},function(_0x56eb46){fs[_0xa77c('0x37')](_0x14894,'777');_0x195727(_0x56eb46);});});})[_0xa77c('0x33')](function(_0x4f7f0b){_0x47d6b4=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x26'));return convertFile(_0x14894,_0x47d6b4);})[_0xa77c('0x33')](function(){try{fs[_0xa77c('0x1c')](_0x14894);fs['chmodSync'](_0x47d6b4,'777');}catch(_0x2c0cc0){logger[_0xa77c('0x13')](_0x2c0cc0);}logger[_0xa77c('0x19')](_0xa77c('0x39'),_0x47d6b4[_0xa77c('0x3a')]('.')[0x0]);return _0x47d6b4[_0xa77c('0x3a')]('.')[0x0];});};exports[_0xa77c('0x3b')]=function(_0x2122e7,_0xdc1ea7){var _0x333006,_0x5d0186;return tts(_0x2122e7,_0xdc1ea7||'en',0x1)[_0xa77c('0x33')](function(_0x46d3d2){logger[_0xa77c('0x19')](_0x46d3d2);_0x333006=path[_0xa77c('0x38')](__dirname,'tmp',rs[_0xa77c('0x34')](0x4)+_0xa77c('0x35'));return downloadFile(_0x46d3d2,_0x333006);})['then'](function(){_0x5d0186=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x26'));return convertFile(_0x333006,_0x5d0186);})['then'](function(){try{fs[_0xa77c('0x1c')](_0x333006);fs[_0xa77c('0x37')](_0x5d0186,'777');}catch(_0x1c816d){logger[_0xa77c('0x13')](_0x1c816d);}logger[_0xa77c('0x19')](_0xa77c('0x3c'),_0x5d0186['split']('.')[0x0]);return _0x5d0186[_0xa77c('0x3a')]('.')[0x0];});};exports[_0xa77c('0x3d')]=function(_0xb4c89e,_0xc795b6,_0x5c177b){return google['asr'](_0xb4c89e,_0xc795b6,_0x5c177b)[_0xa77c('0x33')](function(_0x280db4){logger[_0xa77c('0x19')](_0x280db4[_0xa77c('0x3e')]);return rp(_0x280db4);})[_0xa77c('0x33')](function(_0x19dece){var _0x2c41b3='';var _0x1b4727=0x0;try{fs[_0xa77c('0x1c')](_0xb4c89e);}catch(_0x2003b3){logger[_0xa77c('0x13')](_0x2003b3);}if(_0x19dece&&_0x19dece['results']){_0x2c41b3=_0x19dece[_0xa77c('0x3f')][_0xa77c('0x40')](function(_0x132337){return _0x132337&&_0x132337[_0xa77c('0x41')][0x0]&&_0x132337[_0xa77c('0x41')][0x0][_0xa77c('0x42')]?_0x132337[_0xa77c('0x41')][0x0]['transcript']:'';})[_0xa77c('0x43')]('\x0a');_0x1b4727=_0x19dece[_0xa77c('0x3f')][_0xa77c('0x40')](function(_0x45728a){return _0x45728a&&_0x45728a[_0xa77c('0x41')][0x0]&&_0x45728a['alternatives'][0x0][_0xa77c('0x44')]?_0x45728a[_0xa77c('0x41')][0x0]['confidence']:0x0;})[_0xa77c('0x43')]('\x0a');}logger['info'](_0xa77c('0x45'),_0x2c41b3);logger['info'](_0xa77c('0x46'),_0x1b4727);return{'transcript':_0x2c41b3,'confidence':_0x1b4727};})['catch'](function(_0x2fbca6){logger['error'](_0xa77c('0x47'),_0x2fbca6[_0xa77c('0x16')],_0x2fbca6[_0xa77c('0x48')],_0x2fbca6['message']);});};exports[_0xa77c('0x49')]=function(_0x531347,_0x361442,_0x404a5f,_0x5103dd){var _0x469e65=apiai(_0x361442,{'language':_0x5103dd||'en'});return _0x469e65[_0xa77c('0x4a')](_0x404a5f,{'sessionId':md5(_0x531347)})['then'](function(_0x20eb45){logger[_0xa77c('0x19')](JSON['stringify'](_0x20eb45));return{'source':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x4c')],'resolvedQuery':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x4d')],'action':_0x20eb45[_0xa77c('0x4b')]['action'],'actionIncomplete':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x4e')],'speech':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x4f')][_0xa77c('0x50')],'score':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x51')],'statusCode':_0x20eb45[_0xa77c('0x52')][_0xa77c('0x53')],'endConversation':_0x20eb45['result'][_0xa77c('0x54')]['endConversation']||![],'isFallbackIntent':_0x20eb45[_0xa77c('0x4b')][_0xa77c('0x54')][_0xa77c('0x55')]};});};exports[_0xa77c('0x56')]=function(_0x1332f6,_0x41f40d,_0x1f5f71,_0x5d6bcc){return tilde[_0xa77c('0x57')](_0x1332f6,_0x41f40d,_0x1f5f71,_0x5d6bcc)[_0xa77c('0x33')](function(_0x33828c){try{fs[_0xa77c('0x1c')](_0x1332f6);}catch(_0xdeaa42){logger[_0xa77c('0x13')](_0xdeaa42);}logger[_0xa77c('0x19')](_0xa77c('0x58'),_0x33828c[_0xa77c('0x42')]);logger[_0xa77c('0x19')](_0xa77c('0x59'),_0x33828c[_0xa77c('0x44')]);return _0x33828c;});};exports['awsPolly']=function(_0x591b2f,_0x236444,_0x4a3c64,_0x564eb5,_0x517957,_0xdb8b5d){var _0x4ce3a1=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x35'));var _0x4e7c43;return aws[_0xa77c('0x5a')](_0x591b2f,_0x236444,_0x4a3c64,_0x564eb5,_0x517957,_0xdb8b5d,_0x4ce3a1)[_0xa77c('0x33')](function(){_0x4e7c43=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x4ce3a1,_0x4e7c43);})[_0xa77c('0x33')](function(){try{fs[_0xa77c('0x1c')](_0x4ce3a1);fs[_0xa77c('0x37')](_0x4e7c43,_0xa77c('0x28'));}catch(_0x555d80){logger[_0xa77c('0x13')](_0x555d80);}return _0x4e7c43['split']('.')[0x0];});};exports['awsLex']=function(_0x2dc5a4,_0x409259,_0x1e1a82,_0x58c253,_0x5b4d5b,_0x589f68){return aws[_0xa77c('0x5b')](_0x2dc5a4,_0x409259,_0x1e1a82,_0x58c253,_0x5b4d5b,_0x589f68)[_0xa77c('0x33')](function(_0x80b6bb){logger[_0xa77c('0x19')](JSON[_0xa77c('0x5c')](_0x80b6bb));return _0x80b6bb;});};exports[_0xa77c('0x5d')]=function(_0xcea18e,_0x38a292,_0x4c16dd,_0x40ac99){var _0x140668=util[_0xa77c('0x5e')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0xcea18e,encodeURIComponent(_0x38a292),_0x4c16dd,_0x40ac99);var _0x575ee4=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x35'));var _0x1e5fd3;return downloadFile(_0x140668,_0x575ee4)[_0xa77c('0x33')](function(){_0x1e5fd3=path[_0xa77c('0x38')](__dirname,_0xa77c('0x25'),rs[_0xa77c('0x34')](0x4)+_0xa77c('0x26'));return convertFile(_0x575ee4,_0x1e5fd3);})[_0xa77c('0x33')](function(){try{fs[_0xa77c('0x1c')](_0x575ee4);fs[_0xa77c('0x37')](_0x1e5fd3,'777');}catch(_0x397d40){logger[_0xa77c('0x13')](_0x397d40);}return _0x1e5fd3[_0xa77c('0x3a')]('.')[0x0];});};exports[_0xa77c('0x5f')]=function(_0x496f41,_0x34e42e,_0x1466a5,_0x5ca9aa){var _0x5e11c5=util[_0xa77c('0x5e')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x34e42e,_0x1466a5,base64Encode(_0x496f41),_0x5ca9aa?util['format'](_0xa77c('0x60'),encodeURIComponent(_0x5ca9aa)):_0xa77c('0x61'));return uploadFile(_0x5e11c5)[_0xa77c('0x33')](function(_0x1a67f4){return querystring[_0xa77c('0x4')](_0x1a67f4);});};exports['sestekNDA']=function(_0x2b689a,_0x50b048){return sestek[_0xa77c('0x62')](_0x2b689a,_0x50b048)[_0xa77c('0x33')](function(_0x5edf3e){logger[_0xa77c('0x19')](JSON['stringify'](_0x5edf3e));var _0x3e7f2e={'speech':_0x5edf3e[_0xa77c('0x63')],'action':_0x5edf3e[_0xa77c('0x64')]?_0x5edf3e[_0xa77c('0x64')][_0xa77c('0x65')]:undefined,'actiondata':_0x5edf3e['channelData']?_0x5edf3e[_0xa77c('0x64')]['CustomActionData']:undefined};if(_0x5edf3e[_0xa77c('0x64')]&&_0x5edf3e[_0xa77c('0x64')][_0xa77c('0x66')]){return base64Decode(_0x5edf3e['channelData']['AudioFromTts'][_0xa77c('0x67')],path['resolve'](__dirname,'tmp',rs[_0xa77c('0x34')](0x4)+'.wav'))[_0xa77c('0x33')](function(_0x5a4b69){_0x3e7f2e[_0xa77c('0x68')]=_0x5a4b69;return _0x3e7f2e;});}return _0x3e7f2e;});};exports[_0xa77c('0x69')]=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 35454cd..265b94a 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 _0xc1e9=['exports','./nda'];(function(_0x3168e1,_0xa046e0){var _0x13ad69=function(_0x136b1f){while(--_0x136b1f){_0x3168e1['push'](_0x3168e1['shift']());}};_0x13ad69(++_0xa046e0);}(_0xc1e9,0x181));var _0x9c1e=function(_0x54e282,_0x324bbd){_0x54e282=_0x54e282-0x0;var _0x55d348=_0xc1e9[_0x54e282];return _0x55d348;};var nda=require(_0x9c1e('0x0'));module[_0x9c1e('0x1')]={'nda':nda}; \ No newline at end of file +var _0x38fb=['./nda','exports'];(function(_0x1f5f11,_0x1722b6){var _0x29e4ab=function(_0x4aad83){while(--_0x4aad83){_0x1f5f11['push'](_0x1f5f11['shift']());}};_0x29e4ab(++_0x1722b6);}(_0x38fb,0xec));var _0xb38f=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0x38fb[_0x187718];return _0x29ddf4;};var nda=require(_0xb38f('0x0'));module[_0xb38f('0x1')]={'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 cf8b51f..9c24dc4 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 _0x6283=['audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','url','../../../../../config/logger','agi','exports','POST','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','AudioOutputSettings'];(function(_0x13c0cd,_0x3ceb1d){var _0x5bda3f=function(_0x1f954c){while(--_0x1f954c){_0x13c0cd['push'](_0x13c0cd['shift']());}};_0x5bda3f(++_0x3ceb1d);}(_0x6283,0x186));var _0x3628=function(_0x17643c,_0x57bacf){_0x17643c=_0x17643c-0x0;var _0x2c1634=_0x6283[_0x17643c];return _0x2c1634;};'use strict';var rp=require('request-promise');var url=require(_0x3628('0x0'));var logger=require(_0x3628('0x1'))(_0x3628('0x2'));module[_0x3628('0x3')]=function(_0x180efd,_0x45386a){var _0x485606={'method':_0x3628('0x4'),'uri':url['resolve'](_0x45386a['ndauth_url'],_0x3628('0x5')),'form':{'grant_type':'password','username':_0x45386a['username'],'password':_0x45386a[_0x3628('0x6')]},'json':!![]};return rp(_0x485606)[_0x3628('0x7')](function(_0x5c2b7e){var _0x529b98={'method':_0x3628('0x4'),'uri':url[_0x3628('0x8')](_0x45386a[_0x3628('0x9')],_0x3628('0xa')),'body':{'type':_0x45386a[_0x3628('0xb')]||_0x3628('0xc'),'channelId':'Nda','conversation':{'id':_0x180efd[_0x3628('0xd')]},'from':{'id':_0x180efd[_0x3628('0xe')],'name':_0x180efd[_0x3628('0xf')]},'recipient':{'id':_0x180efd[_0x3628('0x10')],'name':_0x180efd[_0x3628('0x11')]},'text':_0x45386a[_0x3628('0x12')],'channelData':{}},'headers':{'Authorization':_0x3628('0x13')+_0x5c2b7e[_0x3628('0x14')]},'json':!![]};if(_0x45386a['project']){_0x529b98[_0x3628('0x15')][_0x3628('0x16')][_0x3628('0x17')]=_0x45386a[_0x3628('0x18')];}if(_0x45386a['ndagenerate_audio']=='1'){_0x529b98[_0x3628('0x15')][_0x3628('0x16')][_0x3628('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x3628('0x1a')};}if(_0x45386a[_0x3628('0x1b')]){_0x529b98['body'][_0x3628('0x16')][_0x3628('0x1c')]=_0x45386a[_0x3628('0x1b')];if(_0x45386a[_0x3628('0x1d')]){_0x529b98[_0x3628('0x15')][_0x3628('0x16')][_0x3628('0x1e')]=_0x45386a[_0x3628('0x1d')];}}logger[_0x3628('0x1f')](JSON['stringify'](_0x529b98));return rp(_0x529b98);});}; \ No newline at end of file +var _0x4485=['agi','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','ndaactivity_type','Nda','uniqueid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger'];(function(_0x3b8868,_0x36b345){var _0x1ecd45=function(_0x8770a2){while(--_0x8770a2){_0x3b8868['push'](_0x3b8868['shift']());}};_0x1ecd45(++_0x36b345);}(_0x4485,0x152));var _0x5448=function(_0x373ba3,_0x265ccc){_0x373ba3=_0x373ba3-0x0;var _0x151f21=_0x4485[_0x373ba3];return _0x151f21;};'use strict';var rp=require(_0x5448('0x0'));var url=require(_0x5448('0x1'));var logger=require(_0x5448('0x2'))(_0x5448('0x3'));module[_0x5448('0x4')]=function(_0x33b7b0,_0xfb80b7){var _0x247c71={'method':_0x5448('0x5'),'uri':url[_0x5448('0x6')](_0xfb80b7[_0x5448('0x7')],'/token'),'form':{'grant_type':_0x5448('0x8'),'username':_0xfb80b7[_0x5448('0x9')],'password':_0xfb80b7[_0x5448('0x8')]},'json':!![]};return rp(_0x247c71)[_0x5448('0xa')](function(_0xd0db3a){var _0x4f811c={'method':_0x5448('0x5'),'uri':url['resolve'](_0xfb80b7[_0x5448('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0xfb80b7[_0x5448('0xc')]||'message','channelId':_0x5448('0xd'),'conversation':{'id':_0x33b7b0[_0x5448('0xe')]},'from':{'id':_0x33b7b0['callerid'],'name':_0x33b7b0['calleridname']},'recipient':{'id':_0x33b7b0[_0x5448('0xf')],'name':_0x33b7b0[_0x5448('0x10')]},'text':_0xfb80b7[_0x5448('0x11')],'channelData':{}},'headers':{'Authorization':_0x5448('0x12')+_0xd0db3a[_0x5448('0x13')]},'json':!![]};if(_0xfb80b7[_0x5448('0x14')]){_0x4f811c[_0x5448('0x15')][_0x5448('0x16')][_0x5448('0x17')]=_0xfb80b7[_0x5448('0x14')];}if(_0xfb80b7[_0x5448('0x18')]=='1'){_0x4f811c[_0x5448('0x15')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5448('0x19')};}if(_0xfb80b7[_0x5448('0x1a')]){_0x4f811c[_0x5448('0x15')][_0x5448('0x16')][_0x5448('0x1b')]=_0xfb80b7['custom_action'];if(_0xfb80b7['custom_action_data']){_0x4f811c['body']['channelData'][_0x5448('0x1c')]=_0xfb80b7['custom_action_data'];}}logger[_0x5448('0x1d')](JSON[_0x5448('0x1e')](_0x4f811c));return rp(_0x4f811c);});}; \ 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 c521929..50a2e80 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 _0x1dc0=['exports','./lib/api'];(function(_0x2d9c11,_0x2a4c8a){var _0x3b3e89=function(_0x415955){while(--_0x415955){_0x2d9c11['push'](_0x2d9c11['shift']());}};_0x3b3e89(++_0x2a4c8a);}(_0x1dc0,0xab));var _0x01dc=function(_0x34f240,_0x13490b){_0x34f240=_0x34f240-0x0;var _0x4c2ffd=_0x1dc0[_0x34f240];return _0x4c2ffd;};'use strict';var asr=require(_0x01dc('0x0'));module[_0x01dc('0x1')]=function(_0x4da007,_0x170a25,_0x451c4b,_0x5b4a63){return asr(_0x4da007,_0x170a25,_0x451c4b,_0x5b4a63);}; \ No newline at end of file +var _0x702c=['exports','./lib/api'];(function(_0x2ec13e,_0x2ea526){var _0xb48415=function(_0x5566e4){while(--_0x5566e4){_0x2ec13e['push'](_0x2ec13e['shift']());}};_0xb48415(++_0x2ea526);}(_0x702c,0x87));var _0xc702=function(_0x403002,_0x141a35){_0x403002=_0x403002-0x0;var _0x43fc5b=_0x702c[_0x403002];return _0x43fc5b;};'use strict';var asr=require(_0xc702('0x0'));module[_0xc702('0x1')]=function(_0x4624d0,_0xcbdeb1,_0x52ae12,_0x172a71){return asr(_0x4624d0,_0xcbdeb1,_0x52ae12,_0x172a71);}; \ 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 ac789d1..7517599 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 _0x56fd=['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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','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','open','message','crypto','../../../../../../config/logger','exports','Tilde\x20URI'];(function(_0x593b76,_0xe8930e){var _0x139130=function(_0x564cb8){while(--_0x564cb8){_0x593b76['push'](_0x593b76['shift']());}};_0x139130(++_0xe8930e);}(_0x56fd,0x125));var _0xd56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56fd[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xd56f('0x0'));var logger=require(_0xd56f('0x1'))('agi');module[_0xd56f('0x2')]=function(_0x46969d,_0x314191,_0x25f7a0,_0x4906d2){return new BPromise(function(_0x11bfd7,_0x38c409){logger['info'](_0xd56f('0x3'),_0x4906d2||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x62d58e=new WebSocket(_0x4906d2||_0xd56f('0x4'),{'perMessageDeflate':![]});var _0x14e927='';var _0x14dcba='0';var _0x157495='1';var _0x36512a=_0xd56f('0x5');function _0x33d73f(_0x5f446c){var _0x4f8b46=crypto['createHash'](_0xd56f('0x6'));_0x4f8b46[_0xd56f('0x7')](_0x5f446c);return _0x4f8b46[_0xd56f('0x8')]('hex');}function _0x440de7(){try{logger[_0xd56f('0x9')](_0xd56f('0xa'));var _0x5b415e=moment()[_0xd56f('0xb')]();var _0x3e53cb=_0x33d73f(_0x5b415e+_0x314191+_0x25f7a0);_0x62d58e[_0xd56f('0xc')](JSON[_0xd56f('0xd')]({'appID':_0x314191,'timestamp':_0x5b415e,'appKey':_0x3e53cb}));var _0x1d4d59=fs['createReadStream'](_0x46969d);_0x1d4d59['on'](_0xd56f('0xe'),function(_0x547479){_0x62d58e[_0xd56f('0xc')](_0x547479);});_0x1d4d59['on'](_0xd56f('0xf'),function(){_0x62d58e[_0xd56f('0xc')](_0xd56f('0x10'));});}catch(_0x121897){logger[_0xd56f('0x11')](_0xd56f('0x12'),JSON[_0xd56f('0xd')](_0x121897));_0x62d58e[_0xd56f('0x13')]();}}function _0x21e1b2(_0x222456){try{if(_0x222456){var _0x419602=JSON[_0xd56f('0x14')](_0x222456);switch(_0x419602['status']){case 0x0:if(_0x419602[_0xd56f('0x15')]){if(_0x419602[_0xd56f('0x15')]['final']){logger[_0xd56f('0x9')](_0xd56f('0x16'),JSON[_0xd56f('0xd')](_0x419602['result'][_0xd56f('0x17')]));_0x14e927=_0x419602[_0xd56f('0x15')][_0xd56f('0x17')][0x0]['transcript'];_0x14dcba=_0x419602['result'][_0xd56f('0x17')][0x0][_0xd56f('0x18')];_0x157495='0';_0x36512a=_0xd56f('0x19');_0x62d58e[_0xd56f('0x13')]();}}break;case 0x1:logger[_0xd56f('0x9')](_0xd56f('0x5'));_0x157495='1';_0x36512a=_0xd56f('0x5');break;case 0x2:logger['info'](_0xd56f('0x1a'));_0x157495='2';_0x36512a=_0xd56f('0x1a');break;case 0x9:logger[_0xd56f('0x9')](_0xd56f('0x1b'));_0x157495='9';_0x36512a=_0xd56f('0x1b');break;case 0xa:logger[_0xd56f('0x9')](_0xd56f('0x1c'));_0x157495='10';_0x36512a=_0xd56f('0x1c');break;case 0xb:logger[_0xd56f('0x9')](_0xd56f('0x1d'));_0x157495='11';_0x36512a=_0xd56f('0x1d');}}}catch(_0x21d1f8){logger[_0xd56f('0x11')](_0xd56f('0x1e'),JSON['stringify'](_0x21d1f8));_0x62d58e['terminate']();}}function _0x532fe1(){logger[_0xd56f('0x9')]('Close\x20Tilde\x20ASR\x20socket');_0x11bfd7({'transcript':_0x14e927,'confidence':_0x14dcba,'status':_0x157495,'status_message':_0x36512a});}function _0x8d5947(_0xa25645){logger[_0xd56f('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0xa25645)){logger[_0xd56f('0x11')](_['isObject'](_0xa25645)?JSON[_0xd56f('0xd')](_0xa25645):_0xa25645);}}_0x62d58e['on'](_0xd56f('0x1f'),_0x440de7);_0x62d58e['on'](_0xd56f('0x20'),_0x21e1b2);_0x62d58e['on']('close',_0x532fe1);_0x62d58e['on'](_0xd56f('0x11'),_0x8d5947);});}; \ No newline at end of file +var _0xf687=['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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','error','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','Tilde\x20URI'];(function(_0x3bde94,_0x134590){var _0x4e9f7b=function(_0x41e170){while(--_0x41e170){_0x3bde94['push'](_0x3bde94['shift']());}};_0x4e9f7b(++_0x134590);}(_0xf687,0x1a6));var _0x7f68=function(_0x1ca2ba,_0x19be81){_0x1ca2ba=_0x1ca2ba-0x0;var _0x30d372=_0xf687[_0x1ca2ba];return _0x30d372;};'use strict';var BPromise=require(_0x7f68('0x0'));var _=require(_0x7f68('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7f68('0x2'));var crypto=require(_0x7f68('0x3'));var logger=require(_0x7f68('0x4'))(_0x7f68('0x5'));module['exports']=function(_0x43ae57,_0x2e59aa,_0x2aa729,_0x2bc2d3){return new BPromise(function(_0x308968,_0xfd9e9d){logger['info'](_0x7f68('0x6'),_0x2bc2d3||_0x7f68('0x7'));var _0x45b6c8=new WebSocket(_0x2bc2d3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x4ca975='';var _0x18a866='0';var _0xf6c5e='1';var _0xf0f2fc=_0x7f68('0x8');function _0x37a89f(_0x4dbdfc){var _0x303bfd=crypto['createHash'](_0x7f68('0x9'));_0x303bfd[_0x7f68('0xa')](_0x4dbdfc);return _0x303bfd[_0x7f68('0xb')]('hex');}function _0x5bc8c2(){try{logger[_0x7f68('0xc')](_0x7f68('0xd'));var _0x4780c9=moment()[_0x7f68('0xe')]();var _0x1528e8=_0x37a89f(_0x4780c9+_0x2e59aa+_0x2aa729);_0x45b6c8[_0x7f68('0xf')](JSON[_0x7f68('0x10')]({'appID':_0x2e59aa,'timestamp':_0x4780c9,'appKey':_0x1528e8}));var _0x3c90a9=fs['createReadStream'](_0x43ae57);_0x3c90a9['on'](_0x7f68('0x11'),function(_0x41c0ba){_0x45b6c8['send'](_0x41c0ba);});_0x3c90a9['on'](_0x7f68('0x12'),function(){_0x45b6c8[_0x7f68('0xf')](_0x7f68('0x13'));});}catch(_0x48de21){logger['error'](_0x7f68('0x14'),JSON[_0x7f68('0x10')](_0x48de21));_0x45b6c8[_0x7f68('0x15')]();}}function _0x3d2b53(_0x1bf0f){try{if(_0x1bf0f){var _0x4fe2b6=JSON[_0x7f68('0x16')](_0x1bf0f);switch(_0x4fe2b6['status']){case 0x0:if(_0x4fe2b6[_0x7f68('0x17')]){if(_0x4fe2b6[_0x7f68('0x17')]['final']){logger[_0x7f68('0xc')](_0x7f68('0x18'),JSON[_0x7f68('0x10')](_0x4fe2b6[_0x7f68('0x17')]['hypotheses']));_0x4ca975=_0x4fe2b6['result']['hypotheses'][0x0]['transcript'];_0x18a866=_0x4fe2b6['result']['hypotheses'][0x0][_0x7f68('0x19')];_0xf6c5e='0';_0xf0f2fc='Success.';_0x45b6c8['terminate']();}}break;case 0x1:logger[_0x7f68('0xc')](_0x7f68('0x8'));_0xf6c5e='1';_0xf0f2fc=_0x7f68('0x8');break;case 0x2:logger[_0x7f68('0xc')](_0x7f68('0x1a'));_0xf6c5e='2';_0xf0f2fc=_0x7f68('0x1a');break;case 0x9:logger[_0x7f68('0xc')](_0x7f68('0x1b'));_0xf6c5e='9';_0xf0f2fc=_0x7f68('0x1b');break;case 0xa:logger[_0x7f68('0xc')]('Authentication\x20failed.');_0xf6c5e='10';_0xf0f2fc=_0x7f68('0x1c');break;case 0xb:logger[_0x7f68('0xc')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xf6c5e='11';_0xf0f2fc='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x52d42a){logger[_0x7f68('0x1d')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7f68('0x10')](_0x52d42a));_0x45b6c8['terminate']();}}function _0x20d048(){logger[_0x7f68('0xc')]('Close\x20Tilde\x20ASR\x20socket');_0x308968({'transcript':_0x4ca975,'confidence':_0x18a866,'status':_0xf6c5e,'status_message':_0xf0f2fc});}function _0x5fc92(_0x520eb1){logger[_0x7f68('0x1d')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x520eb1)){logger[_0x7f68('0x1d')](_[_0x7f68('0x1e')](_0x520eb1)?JSON['stringify'](_0x520eb1):_0x520eb1);}}_0x45b6c8['on'](_0x7f68('0x1f'),_0x5bc8c2);_0x45b6c8['on'](_0x7f68('0x20'),_0x3d2b53);_0x45b6c8['on'](_0x7f68('0x12'),_0x20d048);_0x45b6c8['on'](_0x7f68('0x1d'),_0x5fc92);});}; \ 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 e62ab52..c679077 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 _0x4639=['./asr'];(function(_0x3e3507,_0x2988bf){var _0x20907e=function(_0x592962){while(--_0x592962){_0x3e3507['push'](_0x3e3507['shift']());}};_0x20907e(++_0x2988bf);}(_0x4639,0x115));var _0x9463=function(_0xdbc93e,_0x4fcd8e){_0xdbc93e=_0xdbc93e-0x0;var _0x29df2c=_0x4639[_0xdbc93e];return _0x29df2c;};var asr=require(_0x9463('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x22fb=['exports','./asr'];(function(_0x987cf2,_0xa636d8){var _0x48e791=function(_0x21851d){while(--_0x21851d){_0x987cf2['push'](_0x987cf2['shift']());}};_0x48e791(++_0xa636d8);}(_0x22fb,0x18f));var _0xb22f=function(_0x46bf28,_0x856d2c){_0x46bf28=_0x46bf28-0x0;var _0x58890a=_0x22fb[_0x46bf28];return _0x58890a;};var asr=require(_0xb22f('0x0'));module[_0xb22f('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4429778..e8ff229 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 _0x8f37=['close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','./channel','127.0.0.1','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code'];(function(_0x29285e,_0xc2f384){var _0x52e46d=function(_0x5dda24){while(--_0x5dda24){_0x29285e['push'](_0x29285e['shift']());}};_0x52e46d(++_0xc2f384);}(_0x8f37,0x190));var _0x78f3=function(_0x323a21,_0x4e4b90){_0x323a21=_0x323a21-0x0;var _0x292ce3=_0x8f37[_0x323a21];return _0x292ce3;};'use strict';var util=require(_0x78f3('0x0'));var net=require(_0x78f3('0x1'));var EventEmitter=require(_0x78f3('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x78f3('0x3'));var AGIServer=function(_0x3c1fa6,_0x3b0667,_0x539794){var _0x1d59a5=this,_0x3c1fa6=_0x3c1fa6||0x11dd,_0x3b0667=_0x3b0667||_0x78f3('0x4'),_0x597b85=null,_0x11c6ad=0x0;EventEmitter['call'](_0x1d59a5);function _0x58bd73(){if(!_0x3c1fa6){_0x1d59a5['emit'](_0x78f3('0x5'),new AGIError(_0x78f3('0x6')));return![];}_0x597b85=net['createServer']();_0x597b85[_0x78f3('0x7')](_0x3c1fa6,_0x3b0667);_0x597b85['on'](_0x78f3('0x8'),function(){_0x1d59a5[_0x78f3('0x9')](_0x78f3('0x8'));});_0x597b85['on'](_0x78f3('0xa'),function(_0x53b7fd){_0x597b85[_0x78f3('0xb')](function(_0x3d5b47,_0x4c57c9){if(_0x3d5b47){_0x1d59a5[_0x78f3('0x9')](_0x78f3('0x5'),new AGIError(_0x78f3('0xc'),_0x3d5b47));}else if(_0x539794&&_0x539794<0x0){_0x1d59a5['emit'](_0x78f3('0x5'),new AGIError(_0x78f3('0xd')));_0x53b7fd[_0x78f3('0xe')]();}else if(_0x539794&&_0x539794>0x0&&_0x539794<_0x4c57c9){_0x11c6ad+=0x1;_0x1d59a5[_0x78f3('0x9')](_0x78f3('0x5'),new AGIError(_0x78f3('0xf'),_0x11c6ad));_0x53b7fd[_0x78f3('0xe')]();}else{var _0x38db12=new AGIChannel(_0x53b7fd);_0x38db12['on'](_0x78f3('0x10'),function(){_0x1d59a5[_0x78f3('0x9')](_0x78f3('0xa'),_0x38db12);});}});});_0x597b85['on'](_0x78f3('0x5'),function(_0x3e2a15){_0x1d59a5[_0x78f3('0x9')](_0x78f3('0x5'),new AGIError(_0x78f3('0xc'),_0x3e2a15[_0x78f3('0x11')]));});_0x597b85['on'](_0x78f3('0x12'),function(){_0x1d59a5[_0x78f3('0x9')](_0x78f3('0x12'),new AGIError(_0x78f3('0x13')));});}process[_0x78f3('0x14')](function(){_0x58bd73();});};util[_0x78f3('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x2f7ec9,_0x1010aa,_0x53ee6a){return new AGIServer(_0x2f7ec9,_0x1010aa,_0x53ee6a);}; \ No newline at end of file +var _0xf2fa=['listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','EventEmitter','./error','./channel','127.0.0.1','call','emit','error'];(function(_0x4fe521,_0x4b1827){var _0x22fe32=function(_0x580a74){while(--_0x580a74){_0x4fe521['push'](_0x4fe521['shift']());}};_0x22fe32(++_0x4b1827);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xaf2f('0x0'));var net=require('net');var EventEmitter=require('events')[_0xaf2f('0x1')];var AGIError=require(_0xaf2f('0x2'));var AGIChannel=require(_0xaf2f('0x3'));var AGIServer=function(_0x339a31,_0x2256a3,_0x45ae14){var _0x96c9f7=this,_0x339a31=_0x339a31||0x11dd,_0x2256a3=_0x2256a3||_0xaf2f('0x4'),_0x3709f9=null,_0x49e700=0x0;EventEmitter[_0xaf2f('0x5')](_0x96c9f7);function _0x1c3cfa(){if(!_0x339a31){_0x96c9f7[_0xaf2f('0x6')](_0xaf2f('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x3709f9=net['createServer']();_0x3709f9['listen'](_0x339a31,_0x2256a3);_0x3709f9['on'](_0xaf2f('0x8'),function(){_0x96c9f7[_0xaf2f('0x6')](_0xaf2f('0x8'));});_0x3709f9['on'](_0xaf2f('0x9'),function(_0xa1081f){_0x3709f9[_0xaf2f('0xa')](function(_0x33d60e,_0x26f602){if(_0x33d60e){_0x96c9f7['emit'](_0xaf2f('0x7'),new AGIError(_0xaf2f('0xb'),_0x33d60e));}else if(_0x45ae14&&_0x45ae14<0x0){_0x96c9f7[_0xaf2f('0x6')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xa1081f['destroy']();}else if(_0x45ae14&&_0x45ae14>0x0&&_0x45ae14<_0x26f602){_0x49e700+=0x1;_0x96c9f7[_0xaf2f('0x6')](_0xaf2f('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x49e700));_0xa1081f[_0xaf2f('0xc')]();}else{var _0x131862=new AGIChannel(_0xa1081f);_0x131862['on']('ready',function(){_0x96c9f7[_0xaf2f('0x6')]('connection',_0x131862);});}});});_0x3709f9['on'](_0xaf2f('0x7'),function(_0x30905b){_0x96c9f7[_0xaf2f('0x6')](_0xaf2f('0x7'),new AGIError(_0xaf2f('0xb'),_0x30905b[_0xaf2f('0xd')]));});_0x3709f9['on'](_0xaf2f('0xe'),function(){_0x96c9f7[_0xaf2f('0x6')](_0xaf2f('0xe'),new AGIError(_0xaf2f('0xf')));});}process['nextTick'](function(){_0x1c3cfa();});};util[_0xaf2f('0x10')](AGIServer,EventEmitter);module[_0xaf2f('0x11')]=function(_0x4d5c24,_0x5aa1f6,_0xb64c0e){return new AGIServer(_0x4d5c24,_0x5aa1f6,_0xb64c0e);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 14c5c68..248ae65 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 _0x77c9=['output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','subject','service','host','port','secure','auth','user','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','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','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','then','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','dsn','getUserById','name','getTrunk','save_name','getMailAccountById','sendMailMessage','IntervalId','interval','Intervals','getSoundPath','getQueryOdbc','open','error','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MP3','googleTTS','restAPI','method','timeout','number','includes','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','url','headers','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','isString','saveRestApiResult','%s.%s','setVariable','split','length','replaceAll','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','no\x20text\x20configured','MRCPSynth','result','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20selected','getData','response','mindigit','maxdigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','file_id','getSound','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block'];(function(_0x1aee25,_0xab3788){var _0xf5aa80=function(_0x1a2975){while(--_0x1a2975){_0x1aee25['push'](_0x1aee25['shift']());}};_0xf5aa80(++_0xab3788);}(_0x77c9,0x6a));var _0x977c=function(_0x2cdc86,_0x4c16c7){_0x2cdc86=_0x2cdc86-0x0;var _0x2e1b96=_0x77c9[_0x2cdc86];return _0x2e1b96;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x977c('0x0'));var _=require(_0x977c('0x1'));var sh=require(_0x977c('0x2'));var odbc=require(_0x977c('0x3'))();var rs=require('randomstring');var moment=require(_0x977c('0x4'));var Mustache=require(_0x977c('0x5'));var rp=require(_0x977c('0x6'));var logger=require(_0x977c('0x7'))('agi');var config=require(_0x977c('0x8'));var scripts=require(_0x977c('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x977c('0xa'),_0x977c('0xb')];var verticesWithRetry=[_0x977c('0xc'),_0x977c('0xd'),_0x977c('0xe')];var AGIVertices=function(_0x1df6bb,_0x280d62,_0x50e1d6){this['channel']=_0x1df6bb;this[_0x977c('0xf')]=_0x280d62;this[_0x977c('0x10')]=_0x50e1d6;};AGIVertices['prototype'][_0x977c('0x11')]=function(_0x49fff1,_0x2f2aab){this[_0x977c('0xf')]['getVariableById'](_0x49fff1)[_0x977c('0x12')](function(_0x66d7fe){_0x2f2aab(null,_0x66d7fe?_0x66d7fe['name']:![]);})[_0x977c('0x13')](function(_0x2796dd){_0x2f2aab(_0x2796dd);});};AGIVertices[_0x977c('0x14')][_0x977c('0x15')]=function(_0x12ba4f,_0x5bd514){this[_0x977c('0xf')][_0x977c('0x16')](_0x12ba4f)[_0x977c('0x12')](function(_0x4d1384){_0x5bd514(null,_0x4d1384?_0x4d1384['name']:![]);})[_0x977c('0x13')](function(_0x3f80cd){_0x5bd514(_0x3f80cd);});};AGIVertices[_0x977c('0x14')][_0x977c('0x17')]=function(_0x20f64f,_0x41ce0b){this[_0x977c('0xf')][_0x977c('0x18')](_0x20f64f)[_0x977c('0x12')](function(_0x4082ba){_0x41ce0b(null,_0x4082ba?_0x4082ba['name']:![]);})[_0x977c('0x13')](function(_0x1fa692){_0x41ce0b(_0x1fa692);});};AGIVertices[_0x977c('0x14')]['getSquareOdbc']=function(_0x6c6517,_0x95a640){this[_0x977c('0xf')]['getSquareOdbcById'](_0x6c6517)[_0x977c('0x12')](function(_0x41b2ff){_0x95a640(null,_0x41b2ff?_0x41b2ff[_0x977c('0x19')]:![]);})[_0x977c('0x13')](function(_0x301a84){_0x95a640(_0x301a84);});};AGIVertices[_0x977c('0x14')]['getUser']=function(_0x52a8d8,_0x5c4a17){this[_0x977c('0xf')][_0x977c('0x1a')](_0x52a8d8)[_0x977c('0x12')](function(_0x272de7){_0x5c4a17(null,_0x272de7?_0x272de7[_0x977c('0x1b')]:![]);})[_0x977c('0x13')](function(_0x7df701){_0x5c4a17(_0x7df701);});};AGIVertices['prototype'][_0x977c('0x1c')]=function(_0x5e4399,_0x59f8e2){this[_0x977c('0xf')]['getTrunkById'](_0x5e4399)['then'](function(_0x5d5af1){_0x59f8e2(null,_0x5d5af1?_0x5d5af1[_0x977c('0x1b')]:![]);})[_0x977c('0x13')](function(_0x361329){_0x59f8e2(_0x361329);});};AGIVertices[_0x977c('0x14')]['getSound']=function(_0x1beade,_0x473bde){var _0x11d11e=this;this[_0x977c('0xf')]['getSoundById'](_0x1beade)[_0x977c('0x12')](function(_0x1397fa){_0x473bde(null,_0x1397fa?_0x11d11e['getSoundPath'](_0x1397fa[_0x977c('0x1d')]):![]);})[_0x977c('0x13')](function(_0x53883f){_0x473bde(_0x53883f);});};AGIVertices[_0x977c('0x14')]['getMailAccount']=function(_0x39e809,_0x79dea4){this[_0x977c('0xf')][_0x977c('0x1e')](_0x39e809)[_0x977c('0x12')](function(_0x1ae395){_0x79dea4(null,_0x1ae395?_0x1ae395:![]);})[_0x977c('0x13')](function(_0x927b23){_0x79dea4(_0x927b23);});};AGIVertices['prototype'][_0x977c('0x1f')]=function(_0x355f1c,_0x50f1ba,_0x59762a){this[_0x977c('0x10')][_0x977c('0x1f')](_0x355f1c,_0x50f1ba)[_0x977c('0x12')](function(){_0x59762a(null);})[_0x977c('0x13')](function(_0x4ca98e){_0x59762a(_0x4ca98e);});};AGIVertices[_0x977c('0x14')]['getIntervals']=function(_0x151fdf,_0x97f37c){this['rpc']['getIntervalById'](_0x151fdf)[_0x977c('0x12')](function(_0x555dc1){if(_0x555dc1){if(_0x555dc1[_0x977c('0x20')]){_0x97f37c(null,[_0x555dc1[_0x977c('0x21')]]);}else{_0x97f37c(null,_['map'](_0x555dc1[_0x977c('0x22')],_0x977c('0x21')));}}else{_0x97f37c(null,![]);}})[_0x977c('0x13')](function(_0x44a288){_0x97f37c(_0x44a288);});};AGIVertices[_0x977c('0x14')][_0x977c('0x23')]=function(_0x191972){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x191972);};AGIVertices[_0x977c('0x14')][_0x977c('0x24')]=function(_0x718af4,_0xc9aaf7,_0x2d9b16){odbc[_0x977c('0x25')](_0x718af4,function(_0x5330d3){if(_0x5330d3){logger[_0x977c('0x26')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5330d3);_0x2d9b16(_0x5330d3);}else{logger[_0x977c('0x27')]('ODBC\x20connection\x20successfully');odbc[_0x977c('0x28')](_0xc9aaf7,function(_0x1e8229,_0x1beac0){if(_0x1e8229){logger['info'](_0x977c('0x29'),_0xc9aaf7);_0x2d9b16(_0x1e8229);}else{logger[_0x977c('0x27')](_0x977c('0x2a'),_0xc9aaf7);odbc[_0x977c('0x2b')](function(_0x3c7d35){if(_0x3c7d35){logger[_0x977c('0x26')](_0x977c('0x2c'),_0x3c7d35);}_0x2d9b16(null,_0x1beac0);});}});}});};AGIVertices[_0x977c('0x14')][_0x977c('0x2d')]=function(_0x5f3afa,_0x717cde){this[_0x977c('0xf')][_0x977c('0x2e')](_0x5f3afa)[_0x977c('0x12')](function(_0x124f28){_0x717cde(null,_0x124f28?_0x124f28:![]);})['catch'](function(_0x2bbd49){_0x717cde(_0x2bbd49);});};AGIVertices['prototype'][_0x977c('0x2f')]=function(_0x418a18,_0x2abe02){this['rpc']['createSmsMessage'](_0x418a18)[_0x977c('0x12')](function(_0x1c4c66){_0x2abe02(null,_0x1c4c66);})['catch'](function(_0x4423f6){_0x2abe02(_0x4423f6);});};AGIVertices[_0x977c('0x14')][_0x977c('0x30')]=function(_0x39d15f,_0x2114f0,_0x1a4fcc){this[_0x977c('0xf')][_0x977c('0x30')]({'uniqueid':this[_0x977c('0x31')]['uniqueid'],'node':_0x39d15f[_0x977c('0x32')],'application':_0x39d15f[_0x977c('0x33')],'data':_0x2114f0||null,'project_name':this[_0x977c('0x31')][_0x977c('0x34')],'callerid':this[_0x977c('0x31')]['callerid']})[_0x977c('0x12')](function(_0x53336d){if(_0x1a4fcc){_0x1a4fcc(null,_0x53336d);}})['catch'](function(_0x13b353){if(_0x1a4fcc){_0x1a4fcc(_0x13b353);}});};AGIVertices[_0x977c('0x14')][_0x977c('0x35')]=function(_0x2ac992,_0x1014a9,_0x23cb19,_0x5498cb){this[_0x977c('0xf')]['createSquareRecording']({'uniqueid':this[_0x977c('0x31')][_0x977c('0x36')],'callerid':this[_0x977c('0x31')][_0x977c('0x37')],'calleridname':this[_0x977c('0x31')][_0x977c('0x38')],'context':this['channel'][_0x977c('0x39')],'extension':this['channel']['extension'],'priority':this[_0x977c('0x31')]['priority'],'accountcode':this['channel'][_0x977c('0x3a')],'dnid':this[_0x977c('0x31')][_0x977c('0x3b')],'projectName':this[_0x977c('0x31')]['arg_1'],'saveName':_0x1014a9,'filename':_0x2ac992[_0x977c('0x3c')]||_0x1014a9,'savePath':_0x23cb19})['then'](function(_0x48d3b4){_0x5498cb(null,_0x48d3b4);})[_0x977c('0x13')](function(_0x294805){_0x5498cb(_0x294805);});};AGIVertices[_0x977c('0x14')][_0x977c('0x3d')]=function(_0x34b9fe,_0x1beaee,_0x26bda4){this[_0x977c('0xf')][_0x977c('0x3d')]({'uniqueid':this['channel'][_0x977c('0x36')],'body':_0x34b9fe,'direction':_0x1beaee})[_0x977c('0x12')](function(_0x48ba91){if(_0x26bda4){_0x26bda4(null,_0x48ba91);}})[_0x977c('0x13')](function(_0x39a401){if(_0x26bda4){_0x26bda4(_0x39a401);}});};AGIVertices[_0x977c('0x14')][_0x977c('0x3e')]=function(_0x4e5737,_0x22470a){this[_0x977c('0xf')][_0x977c('0x3e')]({'firstName':_['isEmpty'](_0x4e5737[_0x977c('0x1b')])||_[_0x977c('0x3f')](_0x4e5737[_0x977c('0x1b')])?_0x977c('0x40')+Math[_0x977c('0x41')]():_0x4e5737[_0x977c('0x1b')],'lastName':_[_0x977c('0x42')](_0x4e5737[_0x977c('0x43')])||_[_0x977c('0x3f')](_0x4e5737[_0x977c('0x43')])?null:_0x4e5737[_0x977c('0x43')],'phone':_0x4e5737[_0x977c('0x44')],'ListId':_0x4e5737[_0x977c('0x45')],'scheduledat':_0x4e5737[_0x977c('0x46')],'callbackUniqueid':this[_0x977c('0x31')][_0x977c('0x36')],'tags':'callback','description':_0x977c('0x47')+_0x4e5737[_0x977c('0x46')]['toString'](),'priority':_0x4e5737[_0x977c('0x48')]})['then'](function(_0x1b4545){_0x22470a(null,_0x1b4545);})['catch'](function(_0x886037){_0x22470a(_0x886037);});};AGIVertices[_0x977c('0x14')]['getPause']=function(_0x57a0e4,_0x5cc5eb){this[_0x977c('0xf')]['getPauseById'](_0x57a0e4)[_0x977c('0x12')](function(_0x1ed6bf){_0x5cc5eb(null,_0x1ed6bf?_0x1ed6bf[_0x977c('0x1b')]:![]);})['catch'](function(_0x9df184){_0x5cc5eb(_0x9df184);});};AGIVertices[_0x977c('0x14')][_0x977c('0x49')]=function(_0x51799d,_0x1c85da,_0x22cda3){var _0x24474b={'role':_0x977c('0x4a')};_0x24474b[_0x51799d]=this[_0x977c('0x31')][_0x977c('0x37')];this[_0x977c('0xf')][_0x977c('0x49')](_0x24474b,_0x1c85da,this['channel'][_0x977c('0x36')])[_0x977c('0x12')](function(_0x3581d3){_0x22cda3(null,_[_0x977c('0x3f')](_0x3581d3)?![]:!![]);})[_0x977c('0x13')](function(_0x57f8dd){logger[_0x977c('0x26')](_0x57f8dd);_0x22cda3(null,![]);});};AGIVertices[_0x977c('0x14')][_0x977c('0x4b')]=function(_0x1e7a69,_0x256d0c){var _0xdf5670={'role':_0x977c('0x4a')};_0xdf5670[_0x1e7a69]=this[_0x977c('0x31')][_0x977c('0x37')];this['rpc'][_0x977c('0x4b')](_0xdf5670)[_0x977c('0x12')](function(_0x639477){_0x256d0c(null,_[_0x977c('0x3f')](_0x639477)?![]:!![]);})[_0x977c('0x13')](function(_0x500978){logger[_0x977c('0x26')](_0x500978);_0x256d0c(null,![]);});};AGIVertices[_0x977c('0x14')][_0x977c('0x4c')]=function(_0xf7f9e1,_0xe731c){var _0x171b60={'role':_0x977c('0x4a')};_0x171b60[_0xf7f9e1]=this[_0x977c('0x31')][_0x977c('0x37')];this[_0x977c('0xf')][_0x977c('0x4c')](_0x171b60)[_0x977c('0x12')](function(_0xb74bbd){_0xe731c(null,_[_0x977c('0x3f')](_0xb74bbd)?![]:!![]);})[_0x977c('0x13')](function(_0xa2631b){logger[_0x977c('0x26')](_0xa2631b);_0xe731c(null,![]);});};AGIVertices[_0x977c('0x14')][_0x977c('0x4d')]=function(_0x38d751,_0x7cff56){var _0x7c6524={'role':'agent'};_0x7c6524[_0x38d751]=this[_0x977c('0x31')][_0x977c('0x37')];var _0x586664=_0x38d751!=_0x977c('0x4e')?util[_0x977c('0x4f')]('%s/%s@from-sip/n',_0x977c('0x50'),this['channel']['callerid']):undefined;this[_0x977c('0xf')][_0x977c('0x4d')](_0x7c6524,_0x586664)[_0x977c('0x12')](function(_0x301099){_0x7cff56(null,_[_0x977c('0x3f')](_0x301099)?![]:!![]);})[_0x977c('0x13')](function(_0x2de58c){logger[_0x977c('0x26')](_0x2de58c);_0x7cff56(null,![]);});};AGIVertices['prototype'][_0x977c('0x51')]=function(_0x3f2f02,_0x332432){sh[_0x977c('0x52')](_[_0x977c('0x53')](_0x3f2f02),function(_0x348f44,_0x2bdb81){var _0x11d9c1=_0x2bdb81[_0x977c('0x54')](/(\r\n|\n|\r)/gm,'');_0x332432(null,_0x11d9c1);});};AGIVertices[_0x977c('0x14')]['googleCloudTTS']=function(_0x247c36,_0x35fd6a){scripts[_0x977c('0x55')](_0x247c36['apiKey'],_0x247c36[_0x977c('0x56')]||_0x977c('0x57'),_0x247c36[_0x977c('0x57')],_0x247c36[_0x977c('0x58')]||'en-US',_0x247c36[_0x977c('0x59')]||'MALE',_0x247c36['audioEncoding']||_0x977c('0x5a'))['then'](function(_0xe1cb4b){_0x35fd6a(null,_0xe1cb4b);})['catch'](function(_0x3cbaa8){_0x35fd6a(_0x3cbaa8);});};AGIVertices['prototype'][_0x977c('0x5b')]=function(_0x39b321,_0x128385){scripts[_0x977c('0x5b')](_0x39b321[_0x977c('0x57')],_0x39b321['google_tts_language']||'en',0x1)['then'](function(_0x1df84b){_0x128385(null,_0x1df84b);})[_0x977c('0x13')](function(_0x14c785){_0x128385(_0x14c785);});};AGIVertices[_0x977c('0x14')][_0x977c('0x5c')]=function(_0x5ba237,_0x580610){var _0xc05d2e={'uri':_0x5ba237['url'],'method':_0x5ba237[_0x977c('0x5d')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5ba237[_0x977c('0x5e')])===_0x977c('0x5f')&&parseInt(_0x5ba237[_0x977c('0x5e')])>=0x1?parseInt(_0x5ba237['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x977c('0x60')](['POST','PUT'],_0xc05d2e[_0x977c('0x5d')][_0x977c('0x61')]())){try{_0xc05d2e[_0x977c('0x62')]=_0x5ba237['rawBody']?JSON[_0x977c('0x63')](_0x5ba237['rawBody']):{};}catch(_0x121f21){logger[_0x977c('0x26')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x121f21);}}try{_0xc05d2e['headers']=_0x5ba237[_0x977c('0xa')]?JSON[_0x977c('0x63')](_0x5ba237[_0x977c('0xa')]):{};}catch(_0x49e585){logger[_0x977c('0x26')](_0x977c('0x64'),_0x49e585);}if(_0x5ba237[_0x977c('0x65')]){try{var _0x34471c=require(_0x5ba237[_0x977c('0x65')])[_0x977c('0x66')](this,_0xc05d2e);_0xc05d2e['uri']=Mustache['render'](_0x5ba237[_0x977c('0x67')],_0x34471c,{},['$$','$$']);if(_0xc05d2e['headers']){_0xc05d2e[_0x977c('0x68')]=JSON[_0x977c('0x63')](Mustache[_0x977c('0x69')](JSON[_0x977c('0x6a')](_0xc05d2e[_0x977c('0x68')]),_0x34471c,{},['$$','$$']));}if(_0xc05d2e[_0x977c('0x62')]){_0xc05d2e[_0x977c('0x62')]=JSON[_0x977c('0x63')](Mustache['render'](JSON[_0x977c('0x6a')](_0xc05d2e['body']),_0x34471c,{},['$$','$$']));}}catch(_0x31e479){logger[_0x977c('0x26')](_0x977c('0x6b'),_0x31e479);}}rp(_0xc05d2e)['then'](function(_0x4f40fa){var _0x451232={'statusCode':_0x4f40fa['statusCode']||0xc8,'statusMessage':_0x4f40fa[_0x977c('0x6c')]||'OK','headers':_0x4f40fa[_0x977c('0x68')]||{},'body':_0x4f40fa[_0x977c('0x62')]||{}};_0x580610(null,_0x451232);})[_0x977c('0x13')](function(_0x1637db){var _0x3d02ac={'statusCode':_0x1637db[_0x977c('0x6d')]||0x1f4,'statusMessage':_0x1637db[_0x977c('0x6e')]||_0x977c('0x6f'),'headers':_0x1637db['options']['headers']||{},'body':_0x1637db[_0x977c('0x70')]['body']||{}};_0x580610(null,_0x3d02ac);});};AGIVertices[_0x977c('0x14')][_0x977c('0x71')]=function(_0x569ed5,_0x28a1de){scripts[_0x977c('0x71')](this[_0x977c('0x31')][_0x977c('0x36')],_0x569ed5[_0x977c('0x72')],_0x569ed5[_0x977c('0x57')],_0x569ed5[_0x977c('0x73')]||'en')['then'](function(_0x456944){_0x28a1de(null,_0x456944);})[_0x977c('0x13')](function(_0x2a09c1){_0x28a1de(_0x2a09c1);});};AGIVertices['prototype']['sestekNDA']=function(_0x107c00,_0x124792){scripts[_0x977c('0x74')](this[_0x977c('0x31')],_0x107c00)['then'](function(_0x45385f){_0x124792(null,_0x45385f);})[_0x977c('0x13')](function(_0x3fb1b9){_0x124792(_0x3fb1b9);});};AGIVertices[_0x977c('0x14')]['ispeechTTS']=function(_0x424bbe,_0x7be3cc){scripts['ispeechTTS'](_0x424bbe['key'],_0x424bbe[_0x977c('0x57')],_0x424bbe[_0x977c('0x75')]||_0x977c('0x76'),_0x424bbe['speed'])['then'](function(_0x1b7aab){_0x7be3cc(null,_0x1b7aab);})[_0x977c('0x13')](function(_0xc2ca14){_0x7be3cc(_0xc2ca14);});};AGIVertices[_0x977c('0x14')][_0x977c('0x77')]=function(_0x40f042,_0x315c6d,_0x5db37b){scripts['ispeechASR'](_0x315c6d,_0x40f042[_0x977c('0x72')],_0x40f042[_0x977c('0x78')]||'en-US',this['isConfigured'](_0x40f042[_0x977c('0x79')])?_0x40f042[_0x977c('0x79')]:undefined)[_0x977c('0x12')](function(_0x51eabb){_0x5db37b(null,_0x51eabb);})[_0x977c('0x13')](function(_0x1ac529){_0x5db37b(_0x1ac529);});};AGIVertices['prototype'][_0x977c('0x7a')]=function(_0x5bf6f7,_0x541789){scripts[_0x977c('0x7a')](_0x5bf6f7[_0x977c('0x7b')],_0x5bf6f7['aws_secret_access_key'],_0x5bf6f7[_0x977c('0x7c')],_0x5bf6f7[_0x977c('0x7d')]||_0x977c('0x7e'),_0x5bf6f7['text'],_0x5bf6f7[_0x977c('0x7f')]||_0x977c('0x57'))['then'](function(_0x1985c0){_0x541789(null,_0x1985c0);})[_0x977c('0x13')](function(_0x393b47){_0x541789(_0x393b47);});};AGIVertices[_0x977c('0x14')][_0x977c('0x80')]=function(_0x5db0bc,_0xd071a6){scripts[_0x977c('0x80')](this[_0x977c('0x31')]['uniqueid'],_0x5db0bc['aws_access_key_id'],_0x5db0bc['aws_secret_access_key'],_0x5db0bc[_0x977c('0x81')],_0x5db0bc['text'],_0x5db0bc[_0x977c('0x82')])[_0x977c('0x12')](function(_0x36c5c4){_0xd071a6(null,_0x36c5c4);})['catch'](function(_0x26cffa){_0xd071a6(_0x26cffa);});};AGIVertices[_0x977c('0x14')][_0x977c('0x83')]=function(_0x245322,_0x3e52a6,_0x14e601){scripts['googleASR'](_0x3e52a6,_0x245322[_0x977c('0x72')],_0x245322[_0x977c('0x84')]||_0x977c('0x76'))[_0x977c('0x12')](function(_0x1f4a26){_0x14e601(null,_0x1f4a26);})[_0x977c('0x13')](function(_0x2b3a5b){_0x14e601(_0x2b3a5b);});};AGIVertices[_0x977c('0x14')][_0x977c('0x85')]=function(_0x35d4d9,_0x2cb8b0,_0x45b875){scripts[_0x977c('0x85')](_0x2cb8b0,_0x35d4d9['appid'],_0x35d4d9[_0x977c('0x86')],_0x35d4d9[_0x977c('0x87')])[_0x977c('0x12')](function(_0x3d2bb2){_0x45b875(null,_0x3d2bb2);})[_0x977c('0x13')](function(_0x5e57ba){_0x45b875(_0x5e57ba);});};AGIVertices[_0x977c('0x14')][_0x977c('0x88')]=function(_0x3d601e){var _0x73e6c7=_[_0x977c('0x60')](verticesWithRetry,_0x3d601e['agicommand'])?_0x3d601e:_['clone'](_0x3d601e);for(var _0x435ce5 in _0x73e6c7){if(_0x73e6c7[_0x977c('0x89')](_0x435ce5)){if(_0x73e6c7[_0x435ce5]&&_['isString'](_0x73e6c7[_0x435ce5])){if(_[_0x977c('0x60')](recursiveMapAttributes,_0x435ce5)){_0x73e6c7[_0x435ce5]=this['replaceObjectAllVariables'](_0x73e6c7[_0x435ce5]);}else{_0x73e6c7[_0x435ce5]=this[_0x977c('0x8a')](_0x73e6c7[_0x435ce5]);}}}}return _0x73e6c7;};AGIVertices[_0x977c('0x14')][_0x977c('0x8b')]=function(_0x4abb4b){for(var _0x4344e3 in _0x4abb4b){if(_0x4abb4b['hasOwnProperty'](_0x4344e3)){if(_[_0x977c('0x8c')](_0x4abb4b[_0x4344e3])){this[_0x977c('0x8b')](_0x4abb4b[_0x4344e3]);}else if(_[_0x977c('0x8d')](_0x4abb4b[_0x4344e3])){for(var _0x5cc777=0x0;_0x5cc777<_0x4abb4b[_0x4344e3]['length'];_0x5cc777++){this[_0x977c('0x8b')](_0x4abb4b[_0x4344e3][_0x5cc777]);}}else if(_[_0x977c('0x8e')](_0x4abb4b[_0x4344e3])){_0x4abb4b[_0x4344e3]=this[_0x977c('0x8a')](_0x4abb4b[_0x4344e3]);}}}};AGIVertices[_0x977c('0x14')][_0x977c('0x8f')]=function(_0x19a3a5,_0x23c613){for(var _0x480a2a in _0x19a3a5){if(_0x19a3a5[_0x977c('0x89')](_0x480a2a)){if(_[_0x977c('0x8c')](_0x19a3a5[_0x480a2a])){if(!_['isEmpty'](_0x19a3a5[_0x480a2a])){this['saveRestApiResult'](_0x19a3a5[_0x480a2a],util[_0x977c('0x4f')](_0x977c('0x90'),_0x23c613,_0x480a2a));}}else if(_[_0x977c('0x8d')](_0x19a3a5[_0x480a2a])){for(var _0x501f3f=0x0;_0x501f3f<_0x19a3a5[_0x480a2a]['length'];_0x501f3f++){this[_0x977c('0x8f')](_0x19a3a5[_0x480a2a][_0x501f3f],util[_0x977c('0x4f')](_0x977c('0x90'),_0x23c613,_0x480a2a+'['+_0x501f3f+']'));}}else{if(!_[_0x977c('0x3f')](_0x19a3a5[_0x480a2a])){this[_0x977c('0x31')][_0x977c('0x91')](util[_0x977c('0x4f')](_0x977c('0x90'),_0x23c613,_0x480a2a),_0x19a3a5[_0x480a2a]);}}}}};AGIVertices[_0x977c('0x14')]['replaceObjectAllVariables']=function(_0x3c02b2){try{var _0x56c847=JSON[_0x977c('0x63')](_0x3c02b2);this[_0x977c('0x8b')](_0x56c847);return JSON[_0x977c('0x6a')](_0x56c847);}catch(_0x573c52){return this[_0x977c('0x8a')](_0x3c02b2);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x378900){var _0x40ce08=_0x378900[_0x977c('0x92')]('{');for(var _0x2cec98=0x1;_0x2cec98<_0x40ce08[_0x977c('0x93')];_0x2cec98+=0x1){var _0x42597e=_0x40ce08[_0x2cec98][_0x977c('0x92')]('}');if(_0x42597e[_0x977c('0x93')]>0x1){_0x378900=_0x378900[_0x977c('0x94')]('{'+_0x42597e[0x0]+'}',this[_0x977c('0x31')][_0x977c('0x11')](_0x42597e[0x0])[_0x977c('0x95')]||_0x42597e[0x0]);}}if(_0x40ce08['length']===0x1){return _0x378900[_0x977c('0x96')]();}return this[_0x977c('0x8a')](_0x378900);};AGIVertices[_0x977c('0x14')][_0x977c('0x97')]=function(_0x33340d,_0x19aee3){var _0x454299=this[_0x977c('0x31')][_0x977c('0x11')](_0x33340d);if(_0x454299['result']===-0x1){return _0x454299;}logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x98'),_0x19aee3,_0x454299['extra']));return this[_0x977c('0x31')]['setVariable'](_0x19aee3,_0x454299[_0x977c('0x95')]);};AGIVertices[_0x977c('0x14')]['isConfigured']=function(_0x29805f){return _0x29805f&&_0x29805f!=='0'&&_0x29805f!=='-1'&&_0x29805f!=='';};AGIVertices[_0x977c('0x14')]['maxRetry']=function(_0x4c4943){this[_0x977c('0x30')][_0x977c('0x66')](this,_0x4c4943,'-');_0x4c4943[_0x977c('0x99')]=_0x4c4943['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x977c('0x14')][_0x977c('0x9a')]=function(_0x3cbb2a){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x9b'),_0x3cbb2a[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x3cbb2a[_0x977c('0x57')])){return this[_0x977c('0x31')]['noop'](_0x977c('0x9d'));}var _0x59f62f='\x22'+_0x3cbb2a[_0x977c('0x57')]+'\x22';if(this['isConfigured'](_0x3cbb2a['options'])){_0x59f62f+=','+_0x3cbb2a[_0x977c('0x70')];}var _0x539a7d=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0x9e'),_0x59f62f);if(_0x539a7d[_0x977c('0x9f')]===-0x1){return _0x539a7d;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x59f62f));};AGIVertices['prototype'][_0x977c('0xa1')]=function(_0x5a842d){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xa2'),_0x5a842d[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x5a842d[_0x977c('0xa3')])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20grammar\x20configured');}var _0x25aa3a=_0x5a842d[_0x977c('0xa3')];if(this[_0x977c('0x9c')](_0x5a842d['options'])){_0x25aa3a+=','+_0x5a842d[_0x977c('0x70')];}var _0x52b722=this['channel'][_0x977c('0x52')]('MRCPRecog',_0x25aa3a);if(_0x52b722[_0x977c('0x9f')]===-0x1){return _0x52b722;}var _0x1cea99=this[_0x977c('0x97')](_0x977c('0xa4'),_0x977c('0xa5'));if(_0x1cea99[_0x977c('0x9f')]===-0x1){return _0x1cea99;}var _0x2202b7=this[_0x977c('0x97')](_0x977c('0xa6'),'MRCP_RECOG_TRANSCRIPT');if(_0x2202b7[_0x977c('0x9f')]===-0x1){return _0x2202b7;}var _0x2c31f1=this[_0x977c('0x97')](_0x977c('0xa7'),_0x977c('0xa8'));if(_0x2c31f1[_0x977c('0x9f')]===-0x1){return _0x2c31f1;}return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0xa9'),_0x25aa3a));};AGIVertices['prototype'][_0x977c('0xaa')]=function(_0xb24d6){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xab'),_0xb24d6[_0x977c('0x32')]));return this['channel'][_0x977c('0xaa')]([_0xb24d6[_0x977c('0xac')],_0xb24d6[_0x977c('0xad')]]);};AGIVertices[_0x977c('0x14')][_0x977c('0xae')]=function(_0x89789e){logger['info'](util[_0x977c('0x4f')](_0x977c('0xaf'),_0x89789e['label']));if(this['isConfigured'](_0x89789e[_0x977c('0x5e')])){logger[_0x977c('0x27')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x89789e[_0x977c('0x5e')]));var _0x40333a=this[_0x977c('0x31')][_0x977c('0xb0')](_0x89789e[_0x977c('0x5e')]);if(_0x40333a['result']===-0x1){return _0x40333a;}}return this['channel'][_0x977c('0xae')]();};AGIVertices[_0x977c('0x14')][_0x977c('0xb1')]=function(_0x500b2e){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xb2'),_0x500b2e['label']));if(!this['isConfigured'](_0x500b2e[_0x977c('0x45')])){return this[_0x977c('0x31')]['error'](_0x500b2e,'no\x20list\x20selected');}_0x500b2e[_0x977c('0x46')]=moment();if(this['isConfigured'](_0x500b2e[_0x977c('0xb3')])){_0x500b2e[_0x977c('0x46')]=moment()['add'](_0x500b2e['delay'],_0x977c('0xb4'));}if(!this[_0x977c('0x9c')](_0x500b2e['callback_priority'])){_0x500b2e['callback_priority']=0x2;}this['createCmContact']['sync'](this,_0x500b2e);return this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0xb5'),_0x500b2e[_0x977c('0x44')],_0x500b2e[_0x977c('0x45')],_0x500b2e[_0x977c('0x46')]));};AGIVertices['prototype'][_0x977c('0xb6')]=function(_0x2da95e){logger['info'](util[_0x977c('0x4f')](_0x977c('0xb7'),_0x2da95e[_0x977c('0x32')]));var _0x772915=this[_0x977c('0x31')]['exec'](_0x2da95e[_0x977c('0xb8')],_0x2da95e['options']);if(_0x772915[_0x977c('0x9f')]===-0x1){return _0x772915;}return this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0xb9'),_0x2da95e['application'],_0x2da95e['options']));};AGIVertices[_0x977c('0x14')][_0x977c('0xba')]=function(_0x8089fc){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xbb'),_0x8089fc[_0x977c('0x32')]));if(!this['isConfigured'](_0x8089fc['text'])){return this['channel']['noop'](_0x977c('0x9d'));}var _0x357e88='\x22'+_0x8089fc[_0x977c('0x57')]+'\x22';if(this[_0x977c('0x9c')](_0x8089fc[_0x977c('0x70')])){_0x357e88+=','+_0x8089fc[_0x977c('0x70')];}var _0x4bf03b=this['channel']['exec'](_0x977c('0x9e'),_0x357e88);if(_0x4bf03b[_0x977c('0x9f')]===-0x1){return _0x4bf03b;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x357e88));};AGIVertices[_0x977c('0x14')]['sestektts']=function(_0x260ae6){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x260ae6[_0x977c('0x32')]));if(!this['isConfigured'](_0x260ae6[_0x977c('0x57')])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20text\x20configured');}var _0x370ad7='\x22'+_0x260ae6['text']+'\x22';if(this[_0x977c('0x9c')](_0x260ae6[_0x977c('0x70')])){_0x370ad7+=','+_0x260ae6[_0x977c('0x70')];}var _0x2a2085=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0x9e'),_0x370ad7);if(_0x2a2085[_0x977c('0x9f')]===-0x1){return _0x2a2085;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x370ad7));};AGIVertices['prototype']['lumenvoxasr']=function(_0x114136){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xbc'),_0x114136[_0x977c('0x32')]));if(!this['isConfigured'](_0x114136[_0x977c('0xa3')])){return this['channel'][_0x977c('0xa0')](_0x977c('0xbd'));}var _0x28b2d0=_0x114136['grammar'];if(this[_0x977c('0x9c')](_0x114136[_0x977c('0x70')])){_0x28b2d0+=','+_0x114136[_0x977c('0x70')];}var _0x22ef6b=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0xbe'),_0x28b2d0);if(_0x22ef6b['result']===-0x1){return _0x22ef6b;}var _0x2485ff=this[_0x977c('0x97')](_0x977c('0xa4'),'LUMENVOX_ASR_CONFIDENCE');if(_0x2485ff[_0x977c('0x9f')]===-0x1){return _0x2485ff;}var _0xebbb12=this['getAndSetVariable'](_0x977c('0xa6'),_0x977c('0xbf'));if(_0xebbb12['result']===-0x1){return _0xebbb12;}var _0x42828b=this[_0x977c('0x97')]('RECOG_INSTANCE()',_0x977c('0xc0'));if(_0x42828b[_0x977c('0x9f')]===-0x1){return _0x42828b;}return this[_0x977c('0x31')][_0x977c('0xa0')](util['format'](_0x977c('0xa9'),_0x28b2d0));};AGIVertices[_0x977c('0x14')][_0x977c('0xc1')]=function(_0x3451f0){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xc2'),_0x3451f0['label']));if(!this[_0x977c('0x9c')](_0x3451f0['grammar'])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0xbd'));}var _0xfeda4d=_0x3451f0['grammar'];if(this['isConfigured'](_0x3451f0[_0x977c('0x70')])){_0xfeda4d+=','+_0x3451f0['options'];}var _0x5ec066=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0xbe'),_0xfeda4d);if(_0x5ec066[_0x977c('0x9f')]===-0x1){return _0x5ec066;}var _0x4a715e=this[_0x977c('0x97')]('RECOG_CONFIDENCE()',_0x977c('0xc3'));if(_0x4a715e[_0x977c('0x9f')]===-0x1){return _0x4a715e;}var _0xed496a=this[_0x977c('0x97')]('RECOG_INPUT()',_0x977c('0xc4'));if(_0xed496a[_0x977c('0x9f')]===-0x1){return _0xed496a;}var _0x489c9f=this['getAndSetVariable'](_0x977c('0xa7'),_0x977c('0xc5'));if(_0x489c9f[_0x977c('0x9f')]===-0x1){return _0x489c9f;}return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')]('Executed\x20command\x20MRCPRecog\x20%s',_0xfeda4d));};AGIVertices[_0x977c('0x14')][_0x977c('0xc6')]=function(_0x342912){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xc7'),_0x342912[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x342912[_0x977c('0xc8')])){return this[_0x977c('0x31')]['error'](_0x342912,_0x977c('0xc9'));}var _0x11988e=this[_0x977c('0xca')]['sync'](this,_0x342912[_0x977c('0xc8')]);if(!_0x11988e){return this[_0x977c('0x31')][_0x977c('0x26')](_0x342912,_0x977c('0xcb'));}if(!this[_0x977c('0x9c')](_0x342912[_0x977c('0x28')])){return this[_0x977c('0x31')]['error'](_0x342912,'no\x20query\x20configured');}var _0x4c5e02=_0x342912[_0x977c('0x28')][_0x977c('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x977c('0x31')]['noop'](util['format']('query:\x20%s',_0x4c5e02));var _0x3e5711=this[_0x977c('0x24')][_0x977c('0x66')](this,_0x11988e,_0x4c5e02);this[_0x977c('0x30')][_0x977c('0x66')](this,_0x342912,_0x4c5e02);if(!this[_0x977c('0x9c')](_0x342912[_0x977c('0xcc')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0xcd'));}var _0x5bd35b=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x342912[_0x977c('0xcc')]);if(!_0x5bd35b){return this[_0x977c('0x31')][_0x977c('0x26')](_0x342912,_0x977c('0xce'));}var _0x38584b=this;_0x3e5711['forEach'](function(_0x1618a2,_0x315588){Object[_0x977c('0xcf')](_0x1618a2)['forEach'](function(_0x4744b9){_0x38584b[_0x977c('0x31')]['setVariable'](util[_0x977c('0x4f')](_0x977c('0xd0'),_0x5bd35b,_0x315588,_0x4744b9),_0x1618a2[_0x4744b9]);});});this[_0x977c('0x31')]['setVariable'](util[_0x977c('0x4f')](_0x977c('0xd1'),_0x5bd35b),_0x3e5711[_0x977c('0x93')]);return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('variable\x20%s\x20set',_0x5bd35b));};AGIVertices['prototype'][_0x977c('0xd2')]=function(_0x52c499){logger['debug'](util['format'](_0x977c('0xd3'),_0x52c499[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x52c499[_0x977c('0xd4')])){return this['channel']['error'](_0x52c499,_0x977c('0xd5'));}var _0xf22791=this[_0x977c('0xd6')][_0x977c('0x66')](this,_0x52c499[_0x977c('0xd4')]);if(!_0xf22791){return this[_0x977c('0x31')][_0x977c('0x26')](_0x52c499,'no\x20user\x20found');}var _0x2ef241=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0xd7'),[util[_0x977c('0x4f')](_0x977c('0xd8'),_0xf22791),_0x52c499[_0x977c('0x5e')],_0x52c499[_0x977c('0xd9')],_0x52c499['url']]);if(_0x2ef241[_0x977c('0x9f')]===-0x1){return _0x2ef241;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Executed\x20command\x20%s',_0x977c('0xd7')));};AGIVertices[_0x977c('0x14')]['dialogflow']=function(_0x11f7d7){logger['info'](util[_0x977c('0x4f')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x11f7d7['label']));if(!this[_0x977c('0x9c')](_0x11f7d7[_0x977c('0x72')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0xda'));}if(!this[_0x977c('0x9c')](_0x11f7d7['text'])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x9d'));}this[_0x977c('0x31')][_0x977c('0xdb')]=!![];this[_0x977c('0x30')](_0x11f7d7);this[_0x977c('0x3d')](_0x11f7d7[_0x977c('0x57')],'in');this['channel']['noop'](util[_0x977c('0x4f')](_0x977c('0xdc'),_0x11f7d7[_0x977c('0x57')]));var _0x16536b=this[_0x977c('0x71')]['sync'](this,_0x11f7d7);if(_0x16536b){for(var _0x491e1a in _0x16536b){if(_0x16536b[_0x977c('0x89')](_0x491e1a)){this[_0x977c('0x31')][_0x977c('0x91')](util['format'](_0x977c('0xdd'),_0x491e1a[_0x977c('0x61')]()),_0x16536b[_0x491e1a]);}}this[_0x977c('0x3d')](_0x16536b[_0x977c('0xde')],_0x977c('0xdf'));return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Dialogflow\x20Result\x20%s',_0x16536b[_0x977c('0xde')]));}return this[_0x977c('0x31')][_0x977c('0x26')](_0x11f7d7,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x977c('0x14')][_0x977c('0xe0')]=function(_0x260a7d){logger[_0x977c('0x27')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x260a7d[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x260a7d[_0x977c('0xe1')])){return this['channel'][_0x977c('0xa0')](_0x977c('0xe2'));}if(!this[_0x977c('0x9c')](_0x260a7d['username'])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20username\x20configured');}if(!this[_0x977c('0x9c')](_0x260a7d[_0x977c('0xe3')])){return this[_0x977c('0x31')]['noop'](_0x977c('0xe4'));}if(!this[_0x977c('0x9c')](_0x260a7d[_0x977c('0xe5')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x9d'));}this[_0x977c('0x31')][_0x977c('0xdb')]=!![];this['createSquareDetailsReport'](_0x260a7d);this[_0x977c('0x3d')](_0x260a7d[_0x977c('0x57')],'in');this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0xe6'),_0x260a7d['text']));var _0x4567a2=this[_0x977c('0x74')][_0x977c('0x66')](this,_0x260a7d);if(_0x4567a2){for(var _0x227694 in _0x4567a2){if(_0x4567a2[_0x977c('0x89')](_0x227694)){this[_0x977c('0x31')][_0x977c('0x91')](util['format']('SESTEK_NDA_%s',_0x227694[_0x977c('0x61')]()),_0x4567a2[_0x227694]);}}this[_0x977c('0x3d')](_0x4567a2[_0x977c('0xde')],_0x977c('0xdf'));if(_0x4567a2[_0x977c('0xe7')]){this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0xe8'),_0x4567a2['audiofile']));var _0x100beb=this[_0x977c('0x31')][_0x977c('0xe9')](_0x4567a2[_0x977c('0xe7')]);try{fs[_0x977c('0xea')](_0x4567a2[_0x977c('0xe7')]+_0x977c('0xeb'));}catch(_0x159862){logger[_0x977c('0x26')](_0x159862);}return _0x100beb;}else{return this[_0x977c('0x31')]['noop'](util['format'](_0x977c('0xec'),_0x4567a2[_0x977c('0xde')]));}}return this['channel'][_0x977c('0x26')](_0x260a7d,_0x977c('0xed'));};AGIVertices['prototype'][_0x977c('0xee')]=function(_0x31229e){logger['info'](util[_0x977c('0x4f')](_0x977c('0xef'),_0x31229e[_0x977c('0x32')]));return this[_0x977c('0x31')]['noop'](_0x977c('0xee'));};AGIVertices[_0x977c('0x14')][_0x977c('0xf0')]=function(_0xa52377){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0xf1'),_0xa52377['label']));var _0x3bf45f='';if(_0xa52377[_0x977c('0xf2')]){if(!this[_0x977c('0x9c')](_0xa52377[_0x977c('0xf2')])){return this['channel'][_0x977c('0x26')](_0xa52377,_0x977c('0xf3'));}else{var _0x2cf857=parseInt(_0xa52377['trunk_id'],0xa);if(isNaN(_0x2cf857)){_0x3bf45f=_0xa52377[_0x977c('0xf2')];}else{_0x3bf45f=this[_0x977c('0x1c')][_0x977c('0x66')](this,_0xa52377[_0x977c('0xf2')]);if(!_0x3bf45f){return this[_0x977c('0x31')][_0x977c('0x26')](_0xa52377,_0x977c('0xf4'));}}}}else if(_0xa52377[_0x977c('0xf5')]){_0x3bf45f=_0xa52377[_0x977c('0xf5')];}else{return this[_0x977c('0x31')][_0x977c('0x26')](_0xa52377,_0x977c('0xf3'));}var _0x549311=this[_0x977c('0x31')]['exec'](_0x977c('0xd7'),[util[_0x977c('0x4f')](_0x977c('0xf6'),_0x3bf45f,_0xa52377[_0x977c('0x44')]),_0xa52377[_0x977c('0x5e')],_0xa52377['opts'],_0xa52377['url']]);if(_0x549311[_0x977c('0x9f')]===-0x1){return _0x549311;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0xf7'),_0x977c('0xd7')));};AGIVertices['prototype']['finally']=function(_0x1d96dc){logger['info'](util[_0x977c('0x4f')](_0x977c('0xf8'),_0x1d96dc['label']));return this[_0x977c('0x31')][_0x977c('0xa0')]('finally');};AGIVertices[_0x977c('0x14')][_0x977c('0xd')]=function(_0x2c38c7){logger['info'](util[_0x977c('0x4f')](_0x977c('0xf9'),_0x2c38c7['label']));if(_0x2c38c7[_0x977c('0x99')]===0x0){return this[_0x977c('0xfa')](_0x2c38c7);}_0x2c38c7[_0x977c('0x99')]-=0x1;if(!this[_0x977c('0x9c')](_0x2c38c7['file_id'])){return this['channel'][_0x977c('0x26')](_0x2c38c7,_0x977c('0xfb'));}var _0x1a6b27=this['getSound'][_0x977c('0x66')](this,_0x2c38c7['file_id']);if(!_0x1a6b27){return this[_0x977c('0x31')]['error'](_0x2c38c7,'no\x20file\x20audio\x20found');}if(!this[_0x977c('0x9c')](_0x2c38c7['variable_id'])){return this[_0x977c('0x31')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x44c14d=this[_0x977c('0x31')][_0x977c('0xfc')](_0x1a6b27,_0x2c38c7[_0x977c('0xfd')],_0x2c38c7['maxdigit']);var _0x5e6eef=_0x44c14d['result']?_0x44c14d[_0x977c('0x9f')][_0x977c('0x96')]():'';logger[_0x977c('0x27')]('test',JSON[_0x977c('0x6a')](_0x44c14d));if(_0x44c14d['result']===-0x1){this[_0x977c('0x30')]['sync'](this,_0x2c38c7,_0x5e6eef);return _0x44c14d;}else if(_0x44c14d[_0x977c('0x95')]===_0x977c('0x5e')){_0x44c14d[_0x977c('0x9f')]=_0x5e6eef[_0x977c('0x93')]>=parseInt(_0x2c38c7['mindigit'])?'x':'i';}else{_0x44c14d[_0x977c('0x9f')]=_0x5e6eef[_0x977c('0x93')]>=parseInt(_0x2c38c7[_0x977c('0xfe')])&&_0x5e6eef[_0x977c('0x93')]<=parseInt(_0x2c38c7[_0x977c('0xff')])?'x':'i';}var _0x53323e=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x2c38c7[_0x977c('0xcc')]);if(!_0x53323e){return this[_0x977c('0x31')][_0x977c('0x26')](_0x2c38c7,'no\x20variable\x20found');}this['channel'][_0x977c('0x91')](_0x53323e,_0x5e6eef);if(this[_0x977c('0x9c')](_0x2c38c7[_0x977c('0x100')])){var _0x3cce87=parseInt(_0x2c38c7[_0x977c('0x100')],0xa);var _0x37ae24=rs[_0x977c('0x101')]({'charset':'*','length':_0x3cce87});var _0x265bc8=_0x5e6eef['length'];if(_0x265bc8>0x0){if(_0x265bc8>_0x3cce87){this[_0x977c('0x30')][_0x977c('0x66')](this,_0x2c38c7,_0x2c38c7['hiddendigitspos']===_0x977c('0x102')?_0x37ae24+_0x5e6eef['substr'](_0x3cce87):_0x5e6eef[_0x977c('0x103')](0x0,_0x265bc8-_0x3cce87)+_0x37ae24);}else{this[_0x977c('0x30')][_0x977c('0x66')](this,_0x2c38c7,rs[_0x977c('0x101')]({'charset':'*','length':_0x265bc8}));}}else{this[_0x977c('0x30')][_0x977c('0x66')](this,_0x2c38c7,'');}}else{this[_0x977c('0x30')][_0x977c('0x66')](this,_0x2c38c7,_0x5e6eef);}return _0x44c14d;};AGIVertices['prototype'][_0x977c('0xe')]=function(_0x6e93f1){logger['info'](util['format'](_0x977c('0x104'),_0x6e93f1['label']));return this[_0x977c('0xd')](_0x6e93f1);};AGIVertices['prototype']['goal']=function(_0x6adc5d){logger['info'](util[_0x977c('0x4f')](_0x977c('0x105'),_0x6adc5d[_0x977c('0x32')]));this[_0x977c('0x30')][_0x977c('0x66')](this,_0x6adc5d,_0x6adc5d[_0x977c('0x106')]);return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x107'),_0x6adc5d[_0x977c('0x106')]));};AGIVertices['prototype'][_0x977c('0x108')]=function(_0x4f60f0){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x109'),_0x4f60f0[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x4f60f0['aws_access_key_id'])||!this[_0x977c('0x9c')](_0x4f60f0[_0x977c('0x10a')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x10b'));}if(!this['isConfigured'](_0x4f60f0[_0x977c('0x57')])){return this['channel'][_0x977c('0xa0')]('no\x20text\x20configured');}this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0x10c'),_0x4f60f0[_0x977c('0x57')]));var _0x2996b2=this[_0x977c('0x7a')][_0x977c('0x66')](this,_0x4f60f0);if(_0x2996b2){this[_0x977c('0x31')][_0x977c('0xa0')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x2996b2));var _0x12152a=this[_0x977c('0x31')][_0x977c('0xe9')](_0x2996b2);try{fs[_0x977c('0xea')](_0x2996b2+_0x977c('0xeb'));}catch(_0x41d0bf){logger[_0x977c('0x26')](_0x41d0bf);}return _0x12152a;}return this[_0x977c('0x31')]['error'](_0x4f60f0,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x977c('0x10d')]=function(_0xb5713e){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x10e'),_0xb5713e['label']));if(!this[_0x977c('0x9c')](_0xb5713e[_0x977c('0x7b')])||!this['isConfigured'](_0xb5713e[_0x977c('0x10a')])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0xb5713e['aws_bot_name'])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x10f'));}if(!this[_0x977c('0x9c')](_0xb5713e[_0x977c('0x57')])){return this[_0x977c('0x31')]['noop'](_0x977c('0x9d'));}this[_0x977c('0x31')][_0x977c('0xdb')]=!![];this[_0x977c('0x30')](_0xb5713e);this['createSquareMessage'](_0xb5713e[_0x977c('0x57')],'in');this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Trying\x20Amazon\x20Lex:\x20%s',_0xb5713e[_0x977c('0x57')]));var _0x45c17b=this[_0x977c('0x80')][_0x977c('0x66')](this,_0xb5713e);if(_0x45c17b){for(var _0x3cf1af in _0x45c17b){if(_0x45c17b[_0x977c('0x89')](_0x3cf1af)&&_['isString'](_0x45c17b[_0x3cf1af])){this[_0x977c('0x31')]['setVariable'](util['format'](_0x977c('0x110'),_0x3cf1af[_0x977c('0x61')]()),_0x45c17b[_0x3cf1af]);}}if(_[_0x977c('0x3f')](_0x45c17b[_0x977c('0x6e')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x111'));}else{this[_0x977c('0x3d')](_0x45c17b['message'],_0x977c('0xdf'));return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')]('Amazon\x20Lex\x20Result\x20%s',_0x45c17b[_0x977c('0x6e')]));}}return this[_0x977c('0x31')][_0x977c('0x26')](_0xb5713e,_0x977c('0x112'));};AGIVertices[_0x977c('0x14')][_0x977c('0x113')]=function(_0x985112){logger['info'](util[_0x977c('0x4f')](_0x977c('0x114'),_0x985112[_0x977c('0x32')],_0x985112[_0x977c('0x5e')]));if(!this[_0x977c('0x9c')](_0x985112[_0x977c('0x72')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0xda'));}var _0x2faf90=_0x977c('0x115');var _0x2edf66=util[_0x977c('0x4f')](_0x977c('0x116'),FILES_PATH,rs['generate'](0x4));var _0x591ded=util['format'](_0x977c('0x90'),_0x2edf66,_0x2faf90);var _0x36b326=!![];if(_0x985112['beep']===_0x977c('0x117')){_0x36b326=![];}var _0x52a595=this[_0x977c('0x31')][_0x977c('0x118')](_0x2edf66,_0x2faf90,_0x985112[_0x977c('0x119')],_0x985112[_0x977c('0x5e')],undefined,_0x36b326);if(_0x52a595[_0x977c('0x9f')]!==-0x1){this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x11a'),_0x591ded));var _0x547e36=this[_0x977c('0x83')]['sync'](this,_0x985112,_0x591ded);if(_0x547e36){for(var _0x5980ad in _0x547e36){if(_0x547e36[_0x977c('0x89')](_0x5980ad)){this[_0x977c('0x31')][_0x977c('0x91')](util[_0x977c('0x4f')](_0x977c('0x11b'),_0x5980ad[_0x977c('0x61')]()),_0x547e36[_0x5980ad]);}}return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x11c'),JSON['stringify'](_0x547e36)));}}return _0x52a595;};AGIVertices[_0x977c('0x14')][_0x977c('0x11d')]=function(_0x28b03b){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x11e'),_0x28b03b['label']));if(!this[_0x977c('0x9c')](_0x28b03b['appid'])){return this['channel'][_0x977c('0xa0')](_0x977c('0x11f'));}if(!this[_0x977c('0x9c')](_0x28b03b[_0x977c('0x86')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x120'));}var _0x47ef54=_0x977c('0x115');var _0x49abfc=util[_0x977c('0x4f')](_0x977c('0x116'),FILES_PATH,rs[_0x977c('0x101')](0x4));var _0x3496d9=util[_0x977c('0x4f')]('%s.%s',_0x49abfc,_0x47ef54);var _0x26955f=!![];if(_0x28b03b[_0x977c('0x121')]===_0x977c('0x117')){_0x26955f=![];}var _0x4ab128=this[_0x977c('0x31')][_0x977c('0x118')](_0x49abfc,_0x47ef54,_0x28b03b['intKey'],_0x28b03b[_0x977c('0x5e')],undefined,_0x26955f);if(_0x4ab128['result']!==-0x1){this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x122'),_0x3496d9));var _0x1d4d34=this[_0x977c('0x85')][_0x977c('0x66')](this,_0x28b03b,_0x3496d9);if(_0x1d4d34){for(var _0x41eed4 in _0x1d4d34){if(_0x1d4d34[_0x977c('0x89')](_0x41eed4)){this['channel'][_0x977c('0x91')](util[_0x977c('0x4f')]('TILDE_ASR_%s',_0x41eed4[_0x977c('0x61')]()),_0x1d4d34[_0x41eed4]);}}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x123'),JSON[_0x977c('0x6a')](_0x1d4d34)));}}return _0x4ab128;};AGIVertices['prototype']['gotoc']=function(_0x4d0a7b){logger['info'](util[_0x977c('0x4f')](_0x977c('0x124'),_0x4d0a7b[_0x977c('0x32')]));return this[_0x977c('0x31')]['continueAt'](_0x4d0a7b['context'],_0x4d0a7b[_0x977c('0x125')],_0x4d0a7b[_0x977c('0x126')]);};AGIVertices['prototype']['gotoif']=function(_0x4b52c8){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x127'),_0x4b52c8[_0x977c('0x32')]));if(!this['isConfigured'](_0x4b52c8[_0x977c('0x128')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x4b52c8,_0x977c('0x129'));}try{var _0x4fae8f=eval(_0x4b52c8[_0x977c('0x128')])?_0x977c('0x12a'):_0x977c('0x12b');this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x12c'),_0x4b52c8['condition'],_0x4fae8f));return{'code':0xc8,'result':_0x4fae8f};}catch(_0x21cf70){return{'code':0xc8,'result':_0x977c('0x12b')};}};AGIVertices[_0x977c('0x14')]['gotoiftime']=function(_0x184f2e){logger[_0x977c('0x27')](util['format'](_0x977c('0x12d'),_0x184f2e[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x184f2e[_0x977c('0x12e')])){return this[_0x977c('0x31')]['error'](_0x184f2e,_0x977c('0x12f'));}var _0x20bdd0=this[_0x977c('0x130')][_0x977c('0x66')](this,_0x184f2e[_0x977c('0x12e')]);if(!_0x20bdd0){return this[_0x977c('0x31')][_0x977c('0x26')](_0x184f2e,_0x977c('0x131'));}for(var _0x180ce5=0x0;_0x180ce5<_0x20bdd0[_0x977c('0x93')];_0x180ce5+=0x1){var _0x3da47e=this[_0x977c('0x31')][_0x977c('0x11')](util[_0x977c('0x4f')](_0x977c('0x132'),_0x20bdd0[_0x180ce5]));if(_0x3da47e[_0x977c('0x9f')]===-0x1){return _0x3da47e;}logger[_0x977c('0x27')](util[_0x977c('0x4f')]('IFTIME\x20%s\x20%s',_0x20bdd0[_0x180ce5],_0x3da47e[_0x977c('0x95')]));if(_0x3da47e[_0x977c('0x95')]===_0x977c('0x12a')){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x133'),_0x20bdd0[_0x180ce5],_0x977c('0x12a')));this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0x133'),_0x20bdd0[_0x180ce5],_0x977c('0x12a')));return{'code':0xc8,'result':_0x977c('0x12a')};}else{logger[_0x977c('0x27')](util['format']('IFTIME\x20%s\x20%s',_0x20bdd0[_0x180ce5],_0x977c('0x12b')));this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')]('IFTIME\x20%s\x20%s',_0x20bdd0[_0x180ce5],_0x977c('0x12b')));}}return{'code':0xc8,'result':_0x977c('0x12b')};};AGIVertices[_0x977c('0x14')][_0x977c('0x134')]=function(_0x52cdd9){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x52cdd9['label']));return this[_0x977c('0x31')]['hangup']();};AGIVertices['prototype'][_0x977c('0x135')]=function(_0x1ad139){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1ad139['label']));if(!this[_0x977c('0x9c')](_0x1ad139['key'])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0xda'));}var _0x568e65=_0x977c('0x115');var _0x51bee0=util[_0x977c('0x4f')](_0x977c('0x116'),FILES_PATH,rs[_0x977c('0x101')](0x4));var _0x430418=util[_0x977c('0x4f')](_0x977c('0x90'),_0x51bee0,_0x568e65);var _0x45f3f6=!![];if(_0x1ad139[_0x977c('0x121')]===_0x977c('0x117')){_0x45f3f6=![];}var _0x91956f=this['channel'][_0x977c('0x118')](_0x51bee0,_0x568e65,_0x1ad139[_0x977c('0x119')],_0x1ad139['timeout'],undefined,_0x45f3f6);if(_0x91956f[_0x977c('0x9f')]!==-0x1){this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x136'),_0x430418));var _0x3a1916=this[_0x977c('0x77')]['sync'](this,_0x1ad139,_0x430418);if(_0x3a1916){for(var _0x2fabc1 in _0x3a1916){if(_0x3a1916['hasOwnProperty'](_0x2fabc1)){this[_0x977c('0x31')][_0x977c('0x91')](util['format'](_0x977c('0x137'),_0x2fabc1[_0x977c('0x61')]()),_0x3a1916[_0x2fabc1]);}}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x138'),JSON[_0x977c('0x6a')](_0x3a1916)));}}return _0x91956f;};AGIVertices['prototype'][_0x977c('0x139')]=function(_0x3dd12e){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3dd12e['label']));if(!this[_0x977c('0x9c')](_0x3dd12e['key'])){return this[_0x977c('0x31')]['noop']('no\x20key\x20configured');}if(!this[_0x977c('0x9c')](_0x3dd12e[_0x977c('0x57')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x9d'));}this[_0x977c('0x31')][_0x977c('0xa0')](util['format'](_0x977c('0x13a'),_0x3dd12e[_0x977c('0x57')]));var _0x3db092=this[_0x977c('0x13b')]['sync'](this,_0x3dd12e);if(_0x3db092){this['channel']['noop'](util[_0x977c('0x4f')](_0x977c('0x136'),_0x3db092));var _0x2de4bc=this[_0x977c('0x31')][_0x977c('0xe9')](_0x3db092,_0x3dd12e[_0x977c('0x119')]);try{fs['unlink'](_0x3db092+_0x977c('0xeb'));}catch(_0x329fb4){logger[_0x977c('0x26')](_0x329fb4);}return _0x2de4bc;}return this[_0x977c('0x31')][_0x977c('0x26')](_0x3dd12e,_0x977c('0x13c'));};AGIVertices[_0x977c('0x14')][_0x977c('0x13d')]=function(_0x57d224){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x13e'),_0x57d224['label']));if(!this[_0x977c('0x9c')](_0x57d224['findBy'])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x57d224,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x977c('0x31')][_0x977c('0x37')],_0x57d224[_0x977c('0x13f')]));var _0x3668ba=this[_0x977c('0x4d')][_0x977c('0x66')](this,_0x57d224['findBy']);if(_0x3668ba){logger[_0x977c('0x27')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x977c('0x31')]['callerid'],_0x57d224[_0x977c('0x13f')]));this[_0x977c('0x31')][_0x977c('0xa0')](util['format'](_0x977c('0x140'),this['channel'][_0x977c('0x37')],_0x57d224['findBy']));return{'code':0xc8,'result':_0x977c('0x141')};}else{logger[_0x977c('0x27')](util['format'](_0x977c('0x142'),this[_0x977c('0x31')][_0x977c('0x37')],_0x57d224[_0x977c('0x13f')]));this[_0x977c('0x31')]['noop'](util['format'](_0x977c('0x142'),this[_0x977c('0x31')][_0x977c('0x37')],_0x57d224[_0x977c('0x13f')]));return{'code':0xc8,'result':_0x977c('0x143')};}};AGIVertices['prototype'][_0x977c('0x144')]=function(_0x3beb34){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3beb34['label']));if(!this[_0x977c('0x9c')](_0x3beb34['findBy'])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x3beb34,_0x977c('0x145'));}logger[_0x977c('0x27')](util['format'](_0x977c('0x146'),this['channel'][_0x977c('0x37')],_0x3beb34['findBy']));var _0x1f40b1=this[_0x977c('0x4c')][_0x977c('0x66')](this,_0x3beb34[_0x977c('0x13f')]);if(_0x1f40b1){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x140'),this[_0x977c('0x31')][_0x977c('0x37')],_0x3beb34['findBy']));this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0x140'),this['channel'][_0x977c('0x37')],_0x3beb34[_0x977c('0x13f')]));return{'code':0xc8,'result':_0x977c('0x141')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x977c('0x37')],_0x3beb34['findBy']));this['channel'][_0x977c('0xa0')](util['format'](_0x977c('0x142'),this[_0x977c('0x31')][_0x977c('0x37')],_0x3beb34['findBy']));return{'code':0xc8,'result':_0x977c('0x143')};}};AGIVertices[_0x977c('0x14')][_0x977c('0x147')]=function(_0x33207b){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x148'),_0x33207b['label']));if(!this['isConfigured'](_0x33207b[_0x977c('0x149')])){return this[_0x977c('0x31')]['error'](_0x33207b,_0x977c('0x14a'));}this['channel'][_0x977c('0xa0')](util['format'](_0x977c('0x14b'),_0x33207b['operation']));var _0x5269e6=eval(_0x33207b[_0x977c('0x149')]);if(!this[_0x977c('0x9c')](_0x33207b[_0x977c('0xcc')])){return this[_0x977c('0x31')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5c496b=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x33207b[_0x977c('0xcc')]);if(!_0x5c496b){return this[_0x977c('0x31')][_0x977c('0x26')](_0x33207b,_0x977c('0xce'));}if(_[_0x977c('0x8d')](_0x5269e6)){var _0xa33af4=this;_0x5269e6[_0x977c('0x14c')](function(_0xb7bf6f,_0x3c14af){_0xa33af4['channel'][_0x977c('0x91')](util[_0x977c('0x4f')](_0x977c('0x14d'),_0x5c496b,_0x3c14af),_0xb7bf6f);});return this[_0x977c('0x31')]['noop'](util[_0x977c('0x4f')](_0x977c('0x14e'),_0x5c496b));}else{return this[_0x977c('0x31')]['setVariable'](_0x5c496b,_0x5269e6);}};AGIVertices[_0x977c('0x14')]['menu']=function(_0x36b9fc){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x36b9fc['label']));if(_0x36b9fc['retry']===0x0){return this[_0x977c('0xfa')](_0x36b9fc);}_0x36b9fc[_0x977c('0x99')]-=0x1;if(!this[_0x977c('0x9c')](_0x36b9fc[_0x977c('0x14f')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x36b9fc,_0x977c('0xfb'));}var _0x3e8686=this[_0x977c('0x150')][_0x977c('0x66')](this,_0x36b9fc[_0x977c('0x14f')]);if(!_0x3e8686){return this[_0x977c('0x31')][_0x977c('0x26')](_0x36b9fc,_0x977c('0x151'));}var _0x4bb02b=this[_0x977c('0x31')]['getData'](_0x3e8686,_0x36b9fc[_0x977c('0xfd')],_0x36b9fc[_0x977c('0x152')]);var _0x43ca1f=_0x4bb02b['result'];if(_0x4bb02b[_0x977c('0x9f')]===-0x1){this[_0x977c('0x30')][_0x977c('0x66')](this,_0x36b9fc,'-1');return _0x4bb02b;}else if(_0x4bb02b['extra']===_0x977c('0x5e')){_0x4bb02b[_0x977c('0x9f')]=_0x4bb02b['result'][_0x977c('0x93')]>0x0?_0x4bb02b['result']:'t';}else if(_[_0x977c('0x42')](_0x4bb02b[_0x977c('0x9f')])){_0x4bb02b[_0x977c('0x9f')]='#';_0x43ca1f='#';}if(!this[_0x977c('0x9c')](_0x36b9fc[_0x977c('0xcc')])){this[_0x977c('0x31')]['noop'](_0x977c('0xcd'));}else{var _0x37cf31=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x36b9fc[_0x977c('0xcc')]);if(!_0x37cf31){return this['channel'][_0x977c('0x26')](_0x36b9fc,_0x977c('0xce'));}this[_0x977c('0x31')]['setVariable'](_0x37cf31,_0x43ca1f);}this[_0x977c('0x30')][_0x977c('0x66')](this,_0x36b9fc,_0x43ca1f);return _0x4bb02b;};AGIVertices[_0x977c('0x14')][_0x977c('0xa0')]=function(_0x509a68){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x153'),_0x509a68[_0x977c('0x32')]));return this[_0x977c('0x31')]['noop'](_0x509a68[_0x977c('0x154')]||_0x509a68[_0x977c('0x32')]);};AGIVertices['prototype'][_0x977c('0x155')]=function(_0x403a36){logger['info'](util[_0x977c('0x4f')](_0x977c('0x156'),_0x403a36[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x403a36[_0x977c('0x13f')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x403a36,'no\x20find\x20by\x20configured');}logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x146'),this['channel'][_0x977c('0x37')],_0x403a36[_0x977c('0x13f')]));var _0x24b3c7=this[_0x977c('0x157')][_0x977c('0x66')](this,_0x403a36['pause_id']);var _0x96b8d7=this[_0x977c('0x49')][_0x977c('0x66')](this,_0x403a36[_0x977c('0x13f')],_0x24b3c7);if(_0x96b8d7){logger['info'](util[_0x977c('0x4f')](_0x977c('0x140'),this['channel'][_0x977c('0x37')],_0x403a36['findBy']));this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x140'),this[_0x977c('0x31')][_0x977c('0x37')],_0x403a36[_0x977c('0x13f')]));return{'code':0xc8,'result':_0x977c('0x141')};}else{logger[_0x977c('0x27')](util[_0x977c('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x977c('0x31')][_0x977c('0x37')],_0x403a36[_0x977c('0x13f')]));this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x140'),this['channel'][_0x977c('0x37')],_0x403a36[_0x977c('0x13f')]));return{'code':0xc8,'result':_0x977c('0x143')};}};AGIVertices[_0x977c('0x14')][_0x977c('0x158')]=function(_0x443220){logger['info'](util[_0x977c('0x4f')](_0x977c('0x159'),_0x443220[_0x977c('0x32')]));if(!this['isConfigured'](_0x443220['file_id'])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x443220,'no\x20file\x20audio\x20selected');}var _0x328cd4=this[_0x977c('0x150')]['sync'](this,_0x443220['file_id']);if(!_0x328cd4){return this[_0x977c('0x31')][_0x977c('0x26')](_0x443220,_0x977c('0x151'));}var _0x177302=this['channel'][_0x977c('0x52')](_0x977c('0x15a'),[_0x328cd4,_0x443220[_0x977c('0xd9')]]);if(_0x177302[_0x977c('0x9f')]===-0x1){return _0x177302;}return this[_0x977c('0x31')][_0x977c('0xa0')](util['format'](_0x977c('0xb9'),_0x977c('0x15a'),_0x328cd4));};AGIVertices['prototype']['queue']=function(_0x5ca8e7){logger['info'](util[_0x977c('0x4f')](_0x977c('0x15b'),_0x5ca8e7[_0x977c('0x32')]));if(!this['isConfigured'](_0x5ca8e7[_0x977c('0x15c')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x5ca8e7,'no\x20queue\x20selected');}var _0x2c92a1='';var _0x36227f=parseInt(_0x5ca8e7[_0x977c('0x15c')],0xa);if(isNaN(_0x36227f)){_0x2c92a1=_0x5ca8e7[_0x977c('0x15c')];}else{_0x2c92a1=this[_0x977c('0x15')][_0x977c('0x66')](this,_0x5ca8e7[_0x977c('0x15c')]);if(!_0x2c92a1){return this[_0x977c('0x31')]['error'](_0x5ca8e7,_0x977c('0x15d'));}}var _0x2f7a29='';if(this['isConfigured'](_0x5ca8e7['file_id'])){var _0x301737=this[_0x977c('0x150')][_0x977c('0x66')](this,_0x5ca8e7['file_id']);if(_0x301737){_0x2f7a29=_0x301737;}}this[_0x977c('0x30')][_0x977c('0x66')](this,_0x5ca8e7,_0x2c92a1);if(_0x5ca8e7[_0x977c('0xd9')][_0x977c('0x15e')]('x')<0x0){_0x5ca8e7[_0x977c('0xd9')]+='x';}if(_0x5ca8e7[_0x977c('0xd9')]['indexOf']('X')<0x0){_0x5ca8e7[_0x977c('0xd9')]+='X';}this[_0x977c('0x31')]['setVariable'](_0x977c('0x15f'),_0x2c92a1?_0x2c92a1[_0x977c('0x160')]():'');var _0x5a87d1=this[_0x977c('0x31')][_0x977c('0x52')]('QUEUE',[_0x2c92a1,_0x5ca8e7[_0x977c('0xd9')],_0x5ca8e7['url'],_0x2f7a29,_0x5ca8e7['timeout'],_0x5ca8e7[_0x977c('0xaa')],_0x5ca8e7[_0x977c('0x161')],_0x5ca8e7[_0x977c('0x162')],'',_0x5ca8e7[_0x977c('0x163')]]);if(_0x5a87d1[_0x977c('0x9f')]===-0x1){return _0x5a87d1;}return this['channel']['noop'](util[_0x977c('0x4f')](_0x977c('0xb9'),'QUEUE',_0x2c92a1));};AGIVertices[_0x977c('0x14')][_0x977c('0x164')]=function(_0x232e82){logger[_0x977c('0x27')](util['format'](_0x977c('0x165'),_0x232e82[_0x977c('0x32')]));var _0x1b22db=_0x232e82['recordingFormat']||_0x977c('0x115');var _0x3d80e8=util[_0x977c('0x4f')](_0x977c('0x166'),this[_0x977c('0x31')][_0x977c('0x36')],rs['generate'](0x5));var _0x56ab9f=util[_0x977c('0x4f')](_0x977c('0x167'),FILES_PATH,_0x3d80e8,_0x1b22db);var _0x39887c=util['format']('%s/recordings/%s',FILES_PATH,_0x3d80e8);this[_0x977c('0x35')][_0x977c('0x66')](this,_0x232e82,_0x3d80e8,_0x56ab9f);this[_0x977c('0x31')]['setVariable'](_0x977c('0x168'),_0x3d80e8);logger[_0x977c('0x27')](_0x977c('0x169'),_0x39887c,_0x1b22db,_0x232e82['escape_digits'],_0x232e82[_0x977c('0x5e')]);return this[_0x977c('0x31')][_0x977c('0x118')](_0x39887c,_0x1b22db,_0x232e82[_0x977c('0x16a')],_0x232e82[_0x977c('0x5e')],undefined,!![]);};AGIVertices[_0x977c('0x14')][_0x977c('0x16b')]=function(_0x4d19fc){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x16c'),_0x4d19fc['label']));if(!this[_0x977c('0x9c')](_0x4d19fc[_0x977c('0x67')])){return this['channel']['noop'](_0x977c('0x16d'));}var _0x368b63=this[_0x977c('0x5c')][_0x977c('0x66')](this,_0x4d19fc);logger['info'](util['format'](_0x977c('0x16e'),util[_0x977c('0x16f')](_0x368b63,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x4d19fc[_0x977c('0xcc')])){return this[_0x977c('0x31')]['noop'](_0x977c('0x170'));}var _0x7db9e9=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x4d19fc[_0x977c('0xcc')]);if(!_0x7db9e9){return this[_0x977c('0x31')][_0x977c('0x26')](_0x4d19fc,'no\x20variable\x20found');}this[_0x977c('0x31')]['setVariable'](util[_0x977c('0x4f')](_0x977c('0x171'),_0x7db9e9),_0x368b63[_0x977c('0x6d')]?_0x368b63[_0x977c('0x6d')]:'200');this['channel'][_0x977c('0x91')](util[_0x977c('0x4f')](_0x977c('0x172'),_0x7db9e9),_0x368b63['statusMessage']?_0x368b63[_0x977c('0x6c')]:'OK');if(_0x368b63[_0x977c('0x62')]){try{this[_0x977c('0x8f')](_0x368b63[_0x977c('0x62')],_0x7db9e9);}catch(_0x28e457){logger[_0x977c('0x26')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x7db9e9));}}return this[_0x977c('0x31')]['noop'](util['format'](_0x977c('0x173'),_0x7db9e9));};AGIVertices[_0x977c('0x14')][_0x977c('0x174')]=function(_0x4179c9){logger['info'](util[_0x977c('0x4f')](_0x977c('0x175'),_0x4179c9[_0x977c('0x32')]));return this[_0x977c('0x31')][_0x977c('0x176')](_0x4179c9[_0x977c('0x177')][_0x977c('0x54')](/\s+/g,''),_0x4179c9[_0x977c('0x16a')]);};AGIVertices[_0x977c('0x14')][_0x977c('0x178')]=function(_0x74f200){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x179'),_0x74f200[_0x977c('0x32')]));return this[_0x977c('0x31')][_0x977c('0x17a')](_0x74f200['number'][_0x977c('0x54')](/\s+/g,''),_0x74f200[_0x977c('0x16a')]);};AGIVertices[_0x977c('0x14')]['sayphonetic']=function(_0x5eea54){logger['info'](util[_0x977c('0x4f')](_0x977c('0x17b'),_0x5eea54['label']));return this[_0x977c('0x31')][_0x977c('0x17c')](_0x5eea54[_0x977c('0x57')],_0x5eea54[_0x977c('0x16a')]);};AGIVertices[_0x977c('0x14')]['sendMail']=function(_0x495e72){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x17d'),_0x495e72[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x495e72[_0x977c('0x17e')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x17f'));}var _0x3c3bdc=this['getMailAccount']['sync'](this,_0x495e72['account_id']);if(!_0x3c3bdc||!_0x3c3bdc[_0x977c('0x180')]){return this[_0x977c('0x31')][_0x977c('0x26')](_0x495e72,_0x977c('0x181'));}var _0x72cdab={'from':util[_0x977c('0x4f')]('\x22%s\x22\x20<%s>',_0x3c3bdc[_0x977c('0x1b')],_0x3c3bdc[_0x977c('0x182')]||_0x3c3bdc['Smtp']['user']),'to':_0x495e72['to']||'','cc':_0x495e72['cc']||'','bcc':_0x495e72['bcc']||'','subject':_0x495e72[_0x977c('0x183')],'html':_0x495e72[_0x977c('0x57')],'text':_0x495e72[_0x977c('0x57')]};var _0x44e35f={'tls':{'rejectUnauthorized':![]}};if(_0x3c3bdc[_0x977c('0x180')][_0x977c('0x184')]){_0x44e35f['service']=_0x3c3bdc[_0x977c('0x180')]['service'];}else{_0x44e35f['host']=_0x3c3bdc['Smtp'][_0x977c('0x185')];_0x44e35f[_0x977c('0x186')]=_0x3c3bdc[_0x977c('0x180')][_0x977c('0x186')];_0x44e35f[_0x977c('0x187')]=_0x3c3bdc[_0x977c('0x180')][_0x977c('0x187')];}if(_0x3c3bdc[_0x977c('0x180')]['authentication']){_0x44e35f[_0x977c('0x188')]={'user':_0x3c3bdc[_0x977c('0x180')][_0x977c('0x189')],'pass':_0x3c3bdc[_0x977c('0x180')][_0x977c('0x18a')]};}if(this[_0x977c('0x9c')](_0x495e72[_0x977c('0x18b')])){}logger[_0x977c('0x18c')](_0x977c('0x18d'),JSON[_0x977c('0x6a')](_0x72cdab));this[_0x977c('0x30')][_0x977c('0x66')](this,_0x495e72,_0x495e72[_0x977c('0x17e')]);this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x18e'),_0x3c3bdc['name']));this[_0x977c('0x1f')][_0x977c('0x66')](this,_0x44e35f,_0x72cdab);return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x18f'));};AGIVertices['prototype'][_0x977c('0x190')]=function(_0x327dfc){logger['info'](util[_0x977c('0x4f')](_0x977c('0x191'),_0x327dfc[_0x977c('0x32')]));return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x192'));};AGIVertices[_0x977c('0x14')][_0x977c('0x193')]=function(_0x8d51bf){logger['info'](util[_0x977c('0x4f')](_0x977c('0x194'),_0x8d51bf[_0x977c('0x32')]));if(!this['isConfigured'](_0x8d51bf[_0x977c('0x195')])){return this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x196'));}var _0x3873f0=this[_0x977c('0x2d')][_0x977c('0x66')](this,_0x8d51bf[_0x977c('0x195')]);if(!_0x3873f0){return this[_0x977c('0x31')]['error'](_0x8d51bf,_0x977c('0x197'));}var _0x55cade={'body':_0x8d51bf['sms_text'],'phone':_0x8d51bf['to']||'','SmsAccountId':_0x3873f0['id']};logger[_0x977c('0x18c')](_0x977c('0x198'),JSON[_0x977c('0x6a')](_0x55cade));this[_0x977c('0x30')][_0x977c('0x66')](this,_0x8d51bf,_0x8d51bf[_0x977c('0x195')]);this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x199'),_0x3873f0[_0x977c('0x1b')]));this['createSmsMessage'][_0x977c('0x66')](this,_0x55cade);return this[_0x977c('0x31')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x977c('0x19a')]=function(_0x4bdbc5){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x19b'),_0x4bdbc5['label']));if(!this['isConfigured'](_0x4bdbc5[_0x977c('0xcc')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x4bdbc5,_0x977c('0x19c'));}var _0x3f95f4=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x4bdbc5['variable_id']);if(!_0x3f95f4){return this[_0x977c('0x31')][_0x977c('0x26')](_0x4bdbc5,_0x977c('0xce'));}return this[_0x977c('0x31')][_0x977c('0x91')](_0x3f95f4,_0x4bdbc5[_0x977c('0x19d')]);};AGIVertices[_0x977c('0x14')][_0x977c('0x19e')]=function(_0xb3cd71){logger['info'](util[_0x977c('0x4f')](_0x977c('0x19f'),_0xb3cd71[_0x977c('0x32')]));this[_0x977c('0x31')][_0x977c('0xa0')](_0x977c('0x1a0'));if(_0xb3cd71[_0x977c('0xae')]==='yes'){this['channel'][_0x977c('0xa0')](_0x977c('0x1a1'));return this[_0x977c('0x31')][_0x977c('0xae')]();}return this[_0x977c('0x31')]['noop']('Skipped\x20Answer');};AGIVertices[_0x977c('0x14')][_0x977c('0x1a2')]=function(_0x8720e6){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x1a3'),_0x8720e6[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x8720e6[_0x977c('0x1a4')])){return this[_0x977c('0x31')][_0x977c('0x26')](_0x8720e6,_0x977c('0x1a5'));}var _0x36f348=this[_0x977c('0x17')][_0x977c('0x66')](this,_0x8720e6[_0x977c('0x1a4')]);if(!this['isConfigured'](_0x36f348)){return this[_0x977c('0x31')][_0x977c('0x26')](_0x8720e6,util[_0x977c('0x4f')](_0x977c('0x1a6'),_0x8720e6['project_id']));}if(_0x36f348===this[_0x977c('0x31')][_0x977c('0x34')]){return this['channel'][_0x977c('0x26')](_0x8720e6,_0x977c('0x1a7'));}this['createSquareDetailsReport'][_0x977c('0x66')](this,_0x8720e6,_0x36f348);var _0x1eed9a=this[_0x977c('0x31')][_0x977c('0x52')]('AGI',util[_0x977c('0x4f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x977c('0xaa')]['host']||'127.0.0.1',_0x36f348,this[_0x977c('0x31')][_0x977c('0x34')]));if(_0x1eed9a[_0x977c('0x9f')]===-0x1){return _0x1eed9a;}return this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0xb9'),_0x977c('0x1a8'),_0x36f348));};AGIVertices[_0x977c('0x14')]['system']=function(_0x31ca0c){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x1a9'),_0x31ca0c[_0x977c('0x32')]));var _0x33dc40=this[_0x977c('0x51')][_0x977c('0x66')](this,_0x31ca0c[_0x977c('0xac')]);this[_0x977c('0x30')][_0x977c('0x66')](this,_0x31ca0c,_0x31ca0c[_0x977c('0xac')]);if(this[_0x977c('0x9c')](_0x31ca0c['variable_id'])){var _0x55f7b3=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x31ca0c[_0x977c('0xcc')]);if(_0x55f7b3){this['channel']['setVariable'](_0x55f7b3,_0x33dc40);return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x1aa'),_0x31ca0c['command'],_0x55f7b3));}}return this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x1ab'),_0x31ca0c[_0x977c('0xac')]));};AGIVertices['prototype'][_0x977c('0x1ac')]=function(_0x5ed4ff){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x1ad'),_0x5ed4ff['label']));_0x5ed4ff[_0x977c('0x57')]=_0x5ed4ff[_0x977c('0x57')][_0x977c('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x977c('0x9c')](_0x5ed4ff[_0x977c('0x1ae')])){return this[_0x977c('0x31')]['noop'](_0x977c('0x1af'));}if(!this['isConfigured'](_0x5ed4ff[_0x977c('0x57')])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20text\x20configured');}this['channel'][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x1b0'),_0x5ed4ff['text']));var _0x3a446b=this[_0x977c('0x55')][_0x977c('0x66')](this,_0x5ed4ff);if(_0x3a446b){this[_0x977c('0x31')][_0x977c('0xa0')](util['format'](_0x977c('0x1b1'),_0x3a446b));var _0x45730e=this[_0x977c('0x31')][_0x977c('0xe9')](_0x3a446b);try{fs[_0x977c('0xea')](_0x3a446b+_0x977c('0xeb'));}catch(_0x4c7843){logger['error'](_0x4c7843);}return _0x45730e;}return this[_0x977c('0x31')][_0x977c('0x26')](_0x5ed4ff,_0x977c('0x1b2'));};AGIVertices[_0x977c('0x14')][_0x977c('0x1b3')]=function(_0xfdf308){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x1b4'),_0xfdf308[_0x977c('0x32')]));_0xfdf308[_0x977c('0x57')]=_0xfdf308[_0x977c('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x977c('0x9c')](_0xfdf308[_0x977c('0x57')])){return this[_0x977c('0x31')][_0x977c('0xa0')]('no\x20text\x20configured');}this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')]('Trying\x20Google\x20TTS\x20%s',_0xfdf308[_0x977c('0x57')]));var _0xa49d3b=this[_0x977c('0x5b')]['sync'](this,_0xfdf308);if(_0xa49d3b){this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x1b5'),_0xa49d3b));var _0x55a822=this[_0x977c('0x31')][_0x977c('0xe9')](_0xa49d3b);try{fs[_0x977c('0xea')](_0xa49d3b+_0x977c('0xeb'));}catch(_0x50e6b0){logger['error'](_0x50e6b0);}return _0x55a822;}return this[_0x977c('0x31')]['error'](_0xfdf308,_0x977c('0x1b6'));};AGIVertices[_0x977c('0x14')][_0x977c('0x1b7')]=function(_0xc768b8){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0xc768b8[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0xc768b8[_0x977c('0x13f')])){return this['channel'][_0x977c('0x26')](_0xc768b8,_0x977c('0x145'));}logger[_0x977c('0x27')](util['format'](_0x977c('0x146'),this[_0x977c('0x31')][_0x977c('0x37')],_0xc768b8['findBy']));var _0x33b51e=this[_0x977c('0x4b')]['sync'](this,_0xc768b8['findBy']);if(_0x33b51e){logger[_0x977c('0x27')](util['format'](_0x977c('0x140'),this[_0x977c('0x31')]['callerid'],_0xc768b8[_0x977c('0x13f')]));this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x140'),this[_0x977c('0x31')]['callerid'],_0xc768b8[_0x977c('0x13f')]));return{'code':0xc8,'result':_0x977c('0x141')};}else{logger['info'](util['format'](_0x977c('0x142'),this[_0x977c('0x31')][_0x977c('0x37')],_0xc768b8[_0x977c('0x13f')]));this[_0x977c('0x31')][_0x977c('0xa0')](util[_0x977c('0x4f')](_0x977c('0x142'),this[_0x977c('0x31')][_0x977c('0x37')],_0xc768b8[_0x977c('0x13f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x977c('0x14')]['voicemail']=function(_0x198faf){logger[_0x977c('0x27')](util[_0x977c('0x4f')](_0x977c('0x1b8'),_0x198faf[_0x977c('0x32')]));var _0x205805=this[_0x977c('0x31')][_0x977c('0x52')](_0x977c('0x1b9'),[_0x198faf[_0x977c('0x1ba')],_0x198faf[_0x977c('0x70')]]);if(_0x205805[_0x977c('0x9f')]===-0x1){return _0x205805;}return this['channel'][_0x977c('0xa0')](util['format']('Executed\x20command\x20%s\x20%s',_0x977c('0x1b9'),_0x198faf[_0x977c('0x1ba')]));};AGIVertices['prototype'][_0x977c('0x1bb')]=function(_0x191f69){logger[_0x977c('0x27')](util[_0x977c('0x4f')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x191f69[_0x977c('0x32')]));if(!this[_0x977c('0x9c')](_0x191f69[_0x977c('0xcc')])){return this[_0x977c('0x31')]['error'](_0x191f69,_0x977c('0x19c'));}var _0x368aea=this[_0x977c('0x11')][_0x977c('0x66')](this,_0x191f69[_0x977c('0xcc')]);if(!_0x368aea){return this[_0x977c('0x31')][_0x977c('0x26')](_0x191f69,_0x977c('0xce'));}var _0x40c857=this['channel']['getVariable'](_0x368aea);return{'code':0xc8,'result':_0x40c857['extra']?_0x40c857['extra']:'-'};};String[_0x977c('0x14')]['replaceAll']=function(_0x596804,_0x1db071){return this[_0x977c('0x92')](_0x596804)[_0x977c('0x1bc')](_0x1db071);};module[_0x977c('0x1bd')]=AGIVertices; \ No newline at end of file +var _0x1afa=['no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','no\x20key\x20configured','bot','createSquareMessage','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','first','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','auth','pass','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','tts','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','split','join','exports','util','lodash','shelljs','odbc','randomstring','moment','../../config/logger','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','catch','getVoiceQueue','name','getSquareProjectById','getSquareOdbcById','then','dsn','getUser','getUserById','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','file','createCmContact','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','audioEncoding','MP3','google_tts_language','restAPI','method','number','timeout','POST','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','body','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','isString','saveRestApiResult','isEmpty','%s.%s','length','setVariable','extra','toString','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','no\x20database\x20selected','getSquareOdbc','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1afa,0xe0));var _0xa1af=function(_0x14ca78,_0x284b65){_0x14ca78=_0x14ca78-0x0;var _0x22b766=_0x1afa[_0x14ca78];return _0x22b766;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xa1af('0x0'));var _=require(_0xa1af('0x1'));var sh=require(_0xa1af('0x2'));var odbc=require(_0xa1af('0x3'))();var rs=require(_0xa1af('0x4'));var moment=require(_0xa1af('0x5'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0xa1af('0x6'))('agi');var config=require('../../config/environment');var scripts=require(_0xa1af('0x7'));var FILES_PATH=_0xa1af('0x8');var recursiveMapAttributes=[_0xa1af('0x9'),_0xa1af('0xa')];var verticesWithRetry=[_0xa1af('0xb'),_0xa1af('0xc'),_0xa1af('0xd')];var AGIVertices=function(_0x252377,_0x1bead2,_0x10b2c2){this[_0xa1af('0xe')]=_0x252377;this[_0xa1af('0xf')]=_0x1bead2;this[_0xa1af('0x10')]=_0x10b2c2;};AGIVertices[_0xa1af('0x11')][_0xa1af('0x12')]=function(_0x158e3f,_0x308eaa){this[_0xa1af('0xf')][_0xa1af('0x13')](_0x158e3f)['then'](function(_0x3411cb){_0x308eaa(null,_0x3411cb?_0x3411cb['name']:![]);})[_0xa1af('0x14')](function(_0x25d457){_0x308eaa(_0x25d457);});};AGIVertices['prototype'][_0xa1af('0x15')]=function(_0x224d6e,_0x1f5563){this[_0xa1af('0xf')]['getVoiceQueueById'](_0x224d6e)['then'](function(_0x2654c8){_0x1f5563(null,_0x2654c8?_0x2654c8[_0xa1af('0x16')]:![]);})['catch'](function(_0x1bbbfc){_0x1f5563(_0x1bbbfc);});};AGIVertices[_0xa1af('0x11')]['getSquareProject']=function(_0x1018d5,_0x2b349b){this['rpc'][_0xa1af('0x17')](_0x1018d5)['then'](function(_0x340b4a){_0x2b349b(null,_0x340b4a?_0x340b4a[_0xa1af('0x16')]:![]);})[_0xa1af('0x14')](function(_0x3235bf){_0x2b349b(_0x3235bf);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x5d4ba6,_0xad6a0d){this[_0xa1af('0xf')][_0xa1af('0x18')](_0x5d4ba6)[_0xa1af('0x19')](function(_0x2319f8){_0xad6a0d(null,_0x2319f8?_0x2319f8[_0xa1af('0x1a')]:![]);})[_0xa1af('0x14')](function(_0x22fac6){_0xad6a0d(_0x22fac6);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x1b')]=function(_0x421d52,_0x3f2416){this['rpc'][_0xa1af('0x1c')](_0x421d52)[_0xa1af('0x19')](function(_0xdaaf6d){_0x3f2416(null,_0xdaaf6d?_0xdaaf6d[_0xa1af('0x16')]:![]);})[_0xa1af('0x14')](function(_0x47c6ca){_0x3f2416(_0x47c6ca);});};AGIVertices[_0xa1af('0x11')]['getTrunk']=function(_0x1d732c,_0x30b991){this[_0xa1af('0xf')][_0xa1af('0x1d')](_0x1d732c)[_0xa1af('0x19')](function(_0x26a726){_0x30b991(null,_0x26a726?_0x26a726[_0xa1af('0x16')]:![]);})['catch'](function(_0x5bdc06){_0x30b991(_0x5bdc06);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x1e')]=function(_0x2353f8,_0x1407be){var _0x17a84b=this;this[_0xa1af('0xf')]['getSoundById'](_0x2353f8)['then'](function(_0x4bd8fd){_0x1407be(null,_0x4bd8fd?_0x17a84b['getSoundPath'](_0x4bd8fd[_0xa1af('0x1f')]):![]);})[_0xa1af('0x14')](function(_0x2c8d5c){_0x1407be(_0x2c8d5c);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x20')]=function(_0x2569c7,_0x902435){this[_0xa1af('0xf')][_0xa1af('0x21')](_0x2569c7)['then'](function(_0x1a91bb){_0x902435(null,_0x1a91bb?_0x1a91bb:![]);})[_0xa1af('0x14')](function(_0x37b7e3){_0x902435(_0x37b7e3);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x22')]=function(_0xa2043e,_0x1f1c08,_0x552000){this[_0xa1af('0x10')]['sendMailMessage'](_0xa2043e,_0x1f1c08)[_0xa1af('0x19')](function(){_0x552000(null);})[_0xa1af('0x14')](function(_0x3ce0d6){_0x552000(_0x3ce0d6);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x23')]=function(_0x4231a6,_0xb011c5){this[_0xa1af('0xf')][_0xa1af('0x24')](_0x4231a6)[_0xa1af('0x19')](function(_0x3bbc54){if(_0x3bbc54){if(_0x3bbc54[_0xa1af('0x25')]){_0xb011c5(null,[_0x3bbc54[_0xa1af('0x26')]]);}else{_0xb011c5(null,_[_0xa1af('0x27')](_0x3bbc54[_0xa1af('0x28')],_0xa1af('0x26')));}}else{_0xb011c5(null,![]);}})[_0xa1af('0x14')](function(_0x49152b){_0xb011c5(_0x49152b);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x29')]=function(_0x24e2fe){return util[_0xa1af('0x2a')](_0xa1af('0x2b'),FILES_PATH,_0x24e2fe);};AGIVertices[_0xa1af('0x11')][_0xa1af('0x2c')]=function(_0x2a8d2d,_0x334a72,_0x5d2c1e){odbc['open'](_0x2a8d2d,function(_0x39e8cd){if(_0x39e8cd){logger[_0xa1af('0x2d')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x39e8cd);_0x5d2c1e(_0x39e8cd);}else{logger[_0xa1af('0x2e')](_0xa1af('0x2f'));odbc[_0xa1af('0x30')](_0x334a72,function(_0x57f28a,_0x244024){if(_0x57f28a){logger[_0xa1af('0x2e')](_0xa1af('0x31'),_0x334a72);_0x5d2c1e(_0x57f28a);}else{logger[_0xa1af('0x2e')](_0xa1af('0x32'),_0x334a72);odbc[_0xa1af('0x33')](function(_0x454e5c){if(_0x454e5c){logger[_0xa1af('0x2d')](_0xa1af('0x34'),_0x454e5c);}_0x5d2c1e(null,_0x244024);});}});}});};AGIVertices['prototype'][_0xa1af('0x35')]=function(_0x8623b7,_0x4028f7){this[_0xa1af('0xf')]['getSmsAccountById'](_0x8623b7)['then'](function(_0x5be1dd){_0x4028f7(null,_0x5be1dd?_0x5be1dd:![]);})['catch'](function(_0x537a37){_0x4028f7(_0x537a37);});};AGIVertices['prototype'][_0xa1af('0x36')]=function(_0x4e58a3,_0x5e3a53){this[_0xa1af('0xf')][_0xa1af('0x36')](_0x4e58a3)[_0xa1af('0x19')](function(_0x47397f){_0x5e3a53(null,_0x47397f);})[_0xa1af('0x14')](function(_0x474619){_0x5e3a53(_0x474619);});};AGIVertices['prototype'][_0xa1af('0x37')]=function(_0x284069,_0x4bca7a,_0x155932){this[_0xa1af('0xf')][_0xa1af('0x37')]({'uniqueid':this['channel'][_0xa1af('0x38')],'node':_0x284069['label'],'application':_0x284069[_0xa1af('0x39')],'data':_0x4bca7a||null,'project_name':this[_0xa1af('0xe')][_0xa1af('0x3a')],'callerid':this[_0xa1af('0xe')][_0xa1af('0x3b')]})[_0xa1af('0x19')](function(_0x30ad1c){if(_0x155932){_0x155932(null,_0x30ad1c);}})[_0xa1af('0x14')](function(_0x34689f){if(_0x155932){_0x155932(_0x34689f);}});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x3c')]=function(_0x2821dd,_0x2e4dd7,_0x5b3a91,_0x2daedc){this[_0xa1af('0xf')]['createSquareRecording']({'uniqueid':this[_0xa1af('0xe')][_0xa1af('0x38')],'callerid':this[_0xa1af('0xe')]['callerid'],'calleridname':this['channel'][_0xa1af('0x3d')],'context':this[_0xa1af('0xe')][_0xa1af('0x3e')],'extension':this['channel']['extension'],'priority':this[_0xa1af('0xe')][_0xa1af('0x3f')],'accountcode':this[_0xa1af('0xe')][_0xa1af('0x40')],'dnid':this[_0xa1af('0xe')]['dnid'],'projectName':this['channel'][_0xa1af('0x3a')],'saveName':_0x2e4dd7,'filename':_0x2821dd[_0xa1af('0x41')]||_0x2e4dd7,'savePath':_0x5b3a91})['then'](function(_0x154bf4){_0x2daedc(null,_0x154bf4);})[_0xa1af('0x14')](function(_0xd4770e){_0x2daedc(_0xd4770e);});};AGIVertices[_0xa1af('0x11')]['createSquareMessage']=function(_0x5f3e8b,_0x4fe59c,_0x11d21e){this[_0xa1af('0xf')]['createSquareMessage']({'uniqueid':this[_0xa1af('0xe')][_0xa1af('0x38')],'body':_0x5f3e8b,'direction':_0x4fe59c})[_0xa1af('0x19')](function(_0x40995d){if(_0x11d21e){_0x11d21e(null,_0x40995d);}})['catch'](function(_0x294569){if(_0x11d21e){_0x11d21e(_0x294569);}});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x42')]=function(_0x36a27e,_0x360d91){this[_0xa1af('0xf')][_0xa1af('0x42')]({'firstName':_['isEmpty'](_0x36a27e[_0xa1af('0x16')])||_[_0xa1af('0x43')](_0x36a27e[_0xa1af('0x16')])?_0xa1af('0x44')+Math[_0xa1af('0x45')]():_0x36a27e[_0xa1af('0x16')],'lastName':_['isEmpty'](_0x36a27e[_0xa1af('0x46')])||_[_0xa1af('0x43')](_0x36a27e['lastName'])?null:_0x36a27e['lastName'],'phone':_0x36a27e[_0xa1af('0x47')],'ListId':_0x36a27e['list_id'],'scheduledat':_0x36a27e[_0xa1af('0x48')],'callbackUniqueid':this['channel'][_0xa1af('0x38')],'tags':_0xa1af('0x49'),'description':_0xa1af('0x4a')+_0x36a27e[_0xa1af('0x48')]['toString'](),'priority':_0x36a27e[_0xa1af('0x4b')]})[_0xa1af('0x19')](function(_0x98dd54){_0x360d91(null,_0x98dd54);})[_0xa1af('0x14')](function(_0x25267d){_0x360d91(_0x25267d);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x4c')]=function(_0x6d60f2,_0x58efdd){this[_0xa1af('0xf')][_0xa1af('0x4d')](_0x6d60f2)[_0xa1af('0x19')](function(_0x399399){_0x58efdd(null,_0x399399?_0x399399[_0xa1af('0x16')]:![]);})[_0xa1af('0x14')](function(_0x1d0dcb){_0x58efdd(_0x1d0dcb);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x4e')]=function(_0x5b9f38,_0x130b9c,_0x203b54){var _0x20792e={'role':_0xa1af('0x4f')};_0x20792e[_0x5b9f38]=this[_0xa1af('0xe')]['callerid'];this[_0xa1af('0xf')][_0xa1af('0x4e')](_0x20792e,_0x130b9c,this[_0xa1af('0xe')][_0xa1af('0x38')])[_0xa1af('0x19')](function(_0x3bc90e){_0x203b54(null,_[_0xa1af('0x43')](_0x3bc90e)?![]:!![]);})['catch'](function(_0x4ef5b7){logger['error'](_0x4ef5b7);_0x203b54(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x110530,_0x2cb8fa){var _0x795a9a={'role':'agent'};_0x795a9a[_0x110530]=this[_0xa1af('0xe')][_0xa1af('0x3b')];this[_0xa1af('0xf')][_0xa1af('0x50')](_0x795a9a)['then'](function(_0xd5c762){_0x2cb8fa(null,_[_0xa1af('0x43')](_0xd5c762)?![]:!![]);})[_0xa1af('0x14')](function(_0x50e202){logger[_0xa1af('0x2d')](_0x50e202);_0x2cb8fa(null,![]);});};AGIVertices['prototype'][_0xa1af('0x51')]=function(_0xe6d5a6,_0x1f083d){var _0x451689={'role':_0xa1af('0x4f')};_0x451689[_0xe6d5a6]=this[_0xa1af('0xe')][_0xa1af('0x3b')];this[_0xa1af('0xf')][_0xa1af('0x51')](_0x451689)[_0xa1af('0x19')](function(_0xed67cc){_0x1f083d(null,_[_0xa1af('0x43')](_0xed67cc)?![]:!![]);})[_0xa1af('0x14')](function(_0x2b1cc1){logger[_0xa1af('0x2d')](_0x2b1cc1);_0x1f083d(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x51bd8b,_0x75999a){var _0x9fa34a={'role':'agent'};_0x9fa34a[_0x51bd8b]=this[_0xa1af('0xe')][_0xa1af('0x3b')];var _0x146472=_0x51bd8b!=_0xa1af('0x52')?util[_0xa1af('0x2a')](_0xa1af('0x53'),'LOCAL',this[_0xa1af('0xe')][_0xa1af('0x3b')]):undefined;this[_0xa1af('0xf')][_0xa1af('0x54')](_0x9fa34a,_0x146472)[_0xa1af('0x19')](function(_0x4b74e9){_0x75999a(null,_['isNil'](_0x4b74e9)?![]:!![]);})[_0xa1af('0x14')](function(_0x17bc29){logger[_0xa1af('0x2d')](_0x17bc29);_0x75999a(null,![]);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x55')]=function(_0x18ba18,_0x176501){sh['exec'](_[_0xa1af('0x56')](_0x18ba18),function(_0x4194f2,_0x46c610){var _0x397f20=_0x46c610[_0xa1af('0x57')](/(\r\n|\n|\r)/gm,'');_0x176501(null,_0x397f20);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x58')]=function(_0x53abe2,_0x1d0967){scripts[_0xa1af('0x58')](_0x53abe2[_0xa1af('0x59')],_0x53abe2[_0xa1af('0x5a')]||_0xa1af('0x5b'),_0x53abe2[_0xa1af('0x5b')],_0x53abe2[_0xa1af('0x5c')]||_0xa1af('0x5d'),_0x53abe2['ssmlGender']||'MALE',_0x53abe2[_0xa1af('0x5e')]||_0xa1af('0x5f'))[_0xa1af('0x19')](function(_0x4f73b5){_0x1d0967(null,_0x4f73b5);})[_0xa1af('0x14')](function(_0xe16f2d){_0x1d0967(_0xe16f2d);});};AGIVertices[_0xa1af('0x11')]['googleTTS']=function(_0x2982cf,_0x1c73d9){scripts['googleTTS'](_0x2982cf[_0xa1af('0x5b')],_0x2982cf[_0xa1af('0x60')]||'en',0x1)[_0xa1af('0x19')](function(_0x29fec7){_0x1c73d9(null,_0x29fec7);})[_0xa1af('0x14')](function(_0x1b275f){_0x1c73d9(_0x1b275f);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x61')]=function(_0x1e07f8,_0x5e080c){var _0x33b660={'uri':_0x1e07f8['url'],'method':_0x1e07f8[_0xa1af('0x62')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1e07f8['timeout'])===_0xa1af('0x63')&&parseInt(_0x1e07f8['timeout'])>=0x1?parseInt(_0x1e07f8[_0xa1af('0x64')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xa1af('0x65'),_0xa1af('0x66')],_0x33b660[_0xa1af('0x62')][_0xa1af('0x67')]())){try{_0x33b660['body']=_0x1e07f8[_0xa1af('0xa')]?JSON[_0xa1af('0x68')](_0x1e07f8[_0xa1af('0xa')]):{};}catch(_0x163d0f){logger[_0xa1af('0x2d')](_0xa1af('0x69'),_0x163d0f);}}try{_0x33b660[_0xa1af('0x6a')]=_0x1e07f8[_0xa1af('0x9')]?JSON[_0xa1af('0x68')](_0x1e07f8['rawHeaders']):{};}catch(_0x581eea){logger[_0xa1af('0x2d')](_0xa1af('0x6b'),_0x581eea);}if(_0x1e07f8[_0xa1af('0x6c')]){try{var _0x460f54=require(_0x1e07f8[_0xa1af('0x6c')])[_0xa1af('0x6d')](this,_0x33b660);_0x33b660[_0xa1af('0x6e')]=Mustache[_0xa1af('0x6f')](_0x1e07f8[_0xa1af('0x70')],_0x460f54,{},['$$','$$']);if(_0x33b660['headers']){_0x33b660['headers']=JSON[_0xa1af('0x68')](Mustache[_0xa1af('0x6f')](JSON[_0xa1af('0x71')](_0x33b660[_0xa1af('0x6a')]),_0x460f54,{},['$$','$$']));}if(_0x33b660[_0xa1af('0x72')]){_0x33b660['body']=JSON[_0xa1af('0x68')](Mustache[_0xa1af('0x6f')](JSON['stringify'](_0x33b660[_0xa1af('0x72')]),_0x460f54,{},['$$','$$']));}}catch(_0x5f3808){logger[_0xa1af('0x2d')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5f3808);}}rp(_0x33b660)[_0xa1af('0x19')](function(_0x631b95){var _0x292a14={'statusCode':_0x631b95[_0xa1af('0x73')]||0xc8,'statusMessage':_0x631b95[_0xa1af('0x74')]||'OK','headers':_0x631b95['headers']||{},'body':_0x631b95[_0xa1af('0x72')]||{}};_0x5e080c(null,_0x292a14);})['catch'](function(_0x4eea3a){var _0x52fbbb={'statusCode':_0x4eea3a[_0xa1af('0x73')]||0x1f4,'statusMessage':_0x4eea3a[_0xa1af('0x75')]||_0xa1af('0x76'),'headers':_0x4eea3a[_0xa1af('0x77')][_0xa1af('0x6a')]||{},'body':_0x4eea3a['options']['body']||{}};_0x5e080c(null,_0x52fbbb);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x78')]=function(_0x48877c,_0x52cceb){scripts[_0xa1af('0x78')](this[_0xa1af('0xe')][_0xa1af('0x38')],_0x48877c['key'],_0x48877c[_0xa1af('0x5b')],_0x48877c[_0xa1af('0x79')]||'en')[_0xa1af('0x19')](function(_0xee10e9){_0x52cceb(null,_0xee10e9);})['catch'](function(_0x22bb46){_0x52cceb(_0x22bb46);});};AGIVertices[_0xa1af('0x11')][_0xa1af('0x7a')]=function(_0x45d97f,_0x38d9ae){scripts[_0xa1af('0x7a')](this['channel'],_0x45d97f)[_0xa1af('0x19')](function(_0x2c74c1){_0x38d9ae(null,_0x2c74c1);})['catch'](function(_0x5b38bb){_0x38d9ae(_0x5b38bb);});};AGIVertices['prototype'][_0xa1af('0x7b')]=function(_0x2de261,_0x2f81a8){scripts[_0xa1af('0x7b')](_0x2de261[_0xa1af('0x7c')],_0x2de261[_0xa1af('0x5b')],_0x2de261[_0xa1af('0x7d')]||_0xa1af('0x5d'),_0x2de261['speed'])[_0xa1af('0x19')](function(_0x392562){_0x2f81a8(null,_0x392562);})[_0xa1af('0x14')](function(_0x2a8021){_0x2f81a8(_0x2a8021);});};AGIVertices['prototype'][_0xa1af('0x7e')]=function(_0x55e628,_0x305f52,_0x26f570){scripts[_0xa1af('0x7e')](_0x305f52,_0x55e628['key'],_0x55e628[_0xa1af('0x7f')]||_0xa1af('0x5d'),this[_0xa1af('0x80')](_0x55e628['model'])?_0x55e628[_0xa1af('0x81')]:undefined)['then'](function(_0x30511f){_0x26f570(null,_0x30511f);})[_0xa1af('0x14')](function(_0x52e16c){_0x26f570(_0x52e16c);});};AGIVertices['prototype'][_0xa1af('0x82')]=function(_0x41b1fd,_0x5ddd92){scripts[_0xa1af('0x82')](_0x41b1fd['aws_access_key_id'],_0x41b1fd[_0xa1af('0x83')],_0x41b1fd[_0xa1af('0x84')],_0x41b1fd[_0xa1af('0x85')]||_0xa1af('0x86'),_0x41b1fd[_0xa1af('0x5b')],_0x41b1fd[_0xa1af('0x87')]||_0xa1af('0x5b'))[_0xa1af('0x19')](function(_0x8fb219){_0x5ddd92(null,_0x8fb219);})[_0xa1af('0x14')](function(_0x13dd29){_0x5ddd92(_0x13dd29);});};AGIVertices['prototype'][_0xa1af('0x88')]=function(_0x16bc21,_0x1c43d3){scripts[_0xa1af('0x88')](this[_0xa1af('0xe')]['uniqueid'],_0x16bc21[_0xa1af('0x89')],_0x16bc21[_0xa1af('0x83')],_0x16bc21['aws_lex_region'],_0x16bc21[_0xa1af('0x5b')],_0x16bc21[_0xa1af('0x8a')])[_0xa1af('0x19')](function(_0x36e2e5){_0x1c43d3(null,_0x36e2e5);})[_0xa1af('0x14')](function(_0x3cc92b){_0x1c43d3(_0x3cc92b);});};AGIVertices[_0xa1af('0x11')]['googleASR']=function(_0x451816,_0x4a5311,_0x25d2bc){scripts[_0xa1af('0x8b')](_0x4a5311,_0x451816['key'],_0x451816['google_asr_language']||_0xa1af('0x5d'))[_0xa1af('0x19')](function(_0x59eabf){_0x25d2bc(null,_0x59eabf);})['catch'](function(_0x1762fb){_0x25d2bc(_0x1762fb);});};AGIVertices['prototype']['tildeASR']=function(_0x4fe878,_0x4666f2,_0x253d4e){scripts[_0xa1af('0x8c')](_0x4666f2,_0x4fe878[_0xa1af('0x8d')],_0x4fe878[_0xa1af('0x8e')],_0x4fe878['uri'])[_0xa1af('0x19')](function(_0x15b6cb){_0x253d4e(null,_0x15b6cb);})['catch'](function(_0x18a530){_0x253d4e(_0x18a530);});};AGIVertices['prototype'][_0xa1af('0x8f')]=function(_0x39288f){var _0x542250=_['includes'](verticesWithRetry,_0x39288f[_0xa1af('0x39')])?_0x39288f:_['clone'](_0x39288f);for(var _0x53842f in _0x542250){if(_0x542250[_0xa1af('0x90')](_0x53842f)){if(_0x542250[_0x53842f]&&_['isString'](_0x542250[_0x53842f])){if(_['includes'](recursiveMapAttributes,_0x53842f)){_0x542250[_0x53842f]=this['replaceObjectAllVariables'](_0x542250[_0x53842f]);}else{_0x542250[_0x53842f]=this[_0xa1af('0x91')](_0x542250[_0x53842f]);}}}}return _0x542250;};AGIVertices['prototype'][_0xa1af('0x92')]=function(_0x2dd276){for(var _0x39e06c in _0x2dd276){if(_0x2dd276['hasOwnProperty'](_0x39e06c)){if(_[_0xa1af('0x93')](_0x2dd276[_0x39e06c])){this[_0xa1af('0x92')](_0x2dd276[_0x39e06c]);}else if(_[_0xa1af('0x94')](_0x2dd276[_0x39e06c])){for(var _0x224af6=0x0;_0x224af6<_0x2dd276[_0x39e06c]['length'];_0x224af6++){this[_0xa1af('0x92')](_0x2dd276[_0x39e06c][_0x224af6]);}}else if(_[_0xa1af('0x95')](_0x2dd276[_0x39e06c])){_0x2dd276[_0x39e06c]=this[_0xa1af('0x91')](_0x2dd276[_0x39e06c]);}}}};AGIVertices[_0xa1af('0x11')][_0xa1af('0x96')]=function(_0x4ccd71,_0x2e19a3){for(var _0x3d4b37 in _0x4ccd71){if(_0x4ccd71[_0xa1af('0x90')](_0x3d4b37)){if(_[_0xa1af('0x93')](_0x4ccd71[_0x3d4b37])){if(!_[_0xa1af('0x97')](_0x4ccd71[_0x3d4b37])){this['saveRestApiResult'](_0x4ccd71[_0x3d4b37],util[_0xa1af('0x2a')](_0xa1af('0x98'),_0x2e19a3,_0x3d4b37));}}else if(_[_0xa1af('0x94')](_0x4ccd71[_0x3d4b37])){for(var _0x26dc5c=0x0;_0x26dc5c<_0x4ccd71[_0x3d4b37][_0xa1af('0x99')];_0x26dc5c++){this['saveRestApiResult'](_0x4ccd71[_0x3d4b37][_0x26dc5c],util[_0xa1af('0x2a')](_0xa1af('0x98'),_0x2e19a3,_0x3d4b37+'['+_0x26dc5c+']'));}}else{if(!_[_0xa1af('0x43')](_0x4ccd71[_0x3d4b37])){this[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0x98'),_0x2e19a3,_0x3d4b37),_0x4ccd71[_0x3d4b37]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x5cda83){try{var _0x108feb=JSON[_0xa1af('0x68')](_0x5cda83);this[_0xa1af('0x92')](_0x108feb);return JSON[_0xa1af('0x71')](_0x108feb);}catch(_0xa54ce4){return this[_0xa1af('0x91')](_0x5cda83);}};AGIVertices[_0xa1af('0x11')][_0xa1af('0x91')]=function(_0x16acf9){var _0x3e254d=_0x16acf9['split']('{');for(var _0x2bfb36=0x1;_0x2bfb36<_0x3e254d[_0xa1af('0x99')];_0x2bfb36+=0x1){var _0x593b67=_0x3e254d[_0x2bfb36]['split']('}');if(_0x593b67[_0xa1af('0x99')]>0x1){_0x16acf9=_0x16acf9['replaceAll']('{'+_0x593b67[0x0]+'}',this[_0xa1af('0xe')][_0xa1af('0x12')](_0x593b67[0x0])[_0xa1af('0x9b')]||_0x593b67[0x0]);}}if(_0x3e254d[_0xa1af('0x99')]===0x1){return _0x16acf9[_0xa1af('0x9c')]();}return this[_0xa1af('0x91')](_0x16acf9);};AGIVertices['prototype']['getAndSetVariable']=function(_0x42d8c0,_0x907d38){var _0x28f954=this[_0xa1af('0xe')]['getVariable'](_0x42d8c0);if(_0x28f954[_0xa1af('0x9d')]===-0x1){return _0x28f954;}logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x9e'),_0x907d38,_0x28f954[_0xa1af('0x9b')]));return this[_0xa1af('0xe')][_0xa1af('0x9a')](_0x907d38,_0x28f954['extra']);};AGIVertices['prototype'][_0xa1af('0x80')]=function(_0x3e4a1e){return _0x3e4a1e&&_0x3e4a1e!=='0'&&_0x3e4a1e!=='-1'&&_0x3e4a1e!=='';};AGIVertices[_0xa1af('0x11')][_0xa1af('0x9f')]=function(_0x3a28fd){this['createSquareDetailsReport'][_0xa1af('0x6d')](this,_0x3a28fd,'-');_0x3a28fd[_0xa1af('0xa0')]=_0x3a28fd[_0xa1af('0x9f')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa1af('0x11')][_0xa1af('0xa1')]=function(_0x54da60){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0xa2'),_0x54da60['label']));if(!this[_0xa1af('0x80')](_0x54da60['text'])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xa4'));}var _0x15508f='\x22'+_0x54da60[_0xa1af('0x5b')]+'\x22';if(this[_0xa1af('0x80')](_0x54da60[_0xa1af('0x77')])){_0x15508f+=','+_0x54da60[_0xa1af('0x77')];}var _0x397e6a=this[_0xa1af('0xe')][_0xa1af('0xa5')]('MRCPSynth',_0x15508f);if(_0x397e6a[_0xa1af('0x9d')]===-0x1){return _0x397e6a;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x15508f));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xa6')]=function(_0x317a62){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0xa7'),_0x317a62[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x317a62['grammar'])){return this['channel'][_0xa1af('0xa3')]('no\x20grammar\x20configured');}var _0x24d06c=_0x317a62[_0xa1af('0xa9')];if(this['isConfigured'](_0x317a62[_0xa1af('0x77')])){_0x24d06c+=','+_0x317a62[_0xa1af('0x77')];}var _0x4d22e0=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0xaa'),_0x24d06c);if(_0x4d22e0['result']===-0x1){return _0x4d22e0;}var _0x2f3972=this[_0xa1af('0xab')](_0xa1af('0xac'),'MRCP_RECOG_CONFIDENCE');if(_0x2f3972[_0xa1af('0x9d')]===-0x1){return _0x2f3972;}var _0x1cd317=this[_0xa1af('0xab')](_0xa1af('0xad'),_0xa1af('0xae'));if(_0x1cd317[_0xa1af('0x9d')]===-0x1){return _0x1cd317;}var _0x367dd8=this[_0xa1af('0xab')](_0xa1af('0xaf'),_0xa1af('0xb0'));if(_0x367dd8['result']===-0x1){return _0x367dd8;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xb1'),_0x24d06c));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xb2')]=function(_0x276081){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0xb3'),_0x276081[_0xa1af('0xa8')]));return this[_0xa1af('0xe')][_0xa1af('0xb2')]([_0x276081[_0xa1af('0xb4')],_0x276081[_0xa1af('0xb5')]]);};AGIVertices['prototype'][_0xa1af('0xb6')]=function(_0x2c44af){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2c44af[_0xa1af('0xa8')]));if(this[_0xa1af('0x80')](_0x2c44af[_0xa1af('0x64')])){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2c44af[_0xa1af('0x64')]));var _0x35f789=this[_0xa1af('0xe')]['wait'](_0x2c44af['timeout']);if(_0x35f789[_0xa1af('0x9d')]===-0x1){return _0x35f789;}}return this[_0xa1af('0xe')][_0xa1af('0xb6')]();};AGIVertices[_0xa1af('0x11')][_0xa1af('0x49')]=function(_0x53cfda){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0xb7'),_0x53cfda['label']));if(!this[_0xa1af('0x80')](_0x53cfda[_0xa1af('0xb8')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x53cfda,'no\x20list\x20selected');}_0x53cfda[_0xa1af('0x48')]=moment();if(this[_0xa1af('0x80')](_0x53cfda[_0xa1af('0xb9')])){_0x53cfda[_0xa1af('0x48')]=moment()['add'](_0x53cfda[_0xa1af('0xb9')],'minutes');}if(!this[_0xa1af('0x80')](_0x53cfda[_0xa1af('0x4b')])){_0x53cfda[_0xa1af('0x4b')]=0x2;}this[_0xa1af('0x42')]['sync'](this,_0x53cfda);return this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0xba'),_0x53cfda[_0xa1af('0x47')],_0x53cfda[_0xa1af('0xb8')],_0x53cfda[_0xa1af('0x48')]));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xbb')]=function(_0xc153c5){logger['info'](util[_0xa1af('0x2a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0xc153c5[_0xa1af('0xa8')]));var _0x2aad72=this['channel'][_0xa1af('0xa5')](_0xc153c5[_0xa1af('0xbc')],_0xc153c5['options']);if(_0x2aad72[_0xa1af('0x9d')]===-0x1){return _0x2aad72;}return this['channel']['noop'](util[_0xa1af('0x2a')](_0xa1af('0xbd'),_0xc153c5['application'],_0xc153c5['options']));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xbe')]=function(_0x51b373){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0xbf'),_0x51b373[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x51b373[_0xa1af('0x5b')])){return this['channel'][_0xa1af('0xa3')](_0xa1af('0xa4'));}var _0x22eec4='\x22'+_0x51b373[_0xa1af('0x5b')]+'\x22';if(this[_0xa1af('0x80')](_0x51b373[_0xa1af('0x77')])){_0x22eec4+=','+_0x51b373[_0xa1af('0x77')];}var _0x188132=this[_0xa1af('0xe')][_0xa1af('0xa5')]('MRCPSynth',_0x22eec4);if(_0x188132[_0xa1af('0x9d')]===-0x1){return _0x188132;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xc0'),_0x22eec4));};AGIVertices[_0xa1af('0x11')]['sestektts']=function(_0x5301af){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0xc1'),_0x5301af[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x5301af['text'])){return this['channel'][_0xa1af('0xa3')](_0xa1af('0xa4'));}var _0x23c153='\x22'+_0x5301af[_0xa1af('0x5b')]+'\x22';if(this[_0xa1af('0x80')](_0x5301af['options'])){_0x23c153+=','+_0x5301af[_0xa1af('0x77')];}var _0x2ee61d=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0xc2'),_0x23c153);if(_0x2ee61d[_0xa1af('0x9d')]===-0x1){return _0x2ee61d;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x23c153));};AGIVertices['prototype'][_0xa1af('0xc3')]=function(_0x24b61d){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x24b61d['label']));if(!this[_0xa1af('0x80')](_0x24b61d[_0xa1af('0xa9')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')]('no\x20grammar\x20configured');}var _0x2c847a=_0x24b61d['grammar'];if(this[_0xa1af('0x80')](_0x24b61d['options'])){_0x2c847a+=','+_0x24b61d[_0xa1af('0x77')];}var _0x32a332=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0xaa'),_0x2c847a);if(_0x32a332[_0xa1af('0x9d')]===-0x1){return _0x32a332;}var _0x5f5a9b=this[_0xa1af('0xab')](_0xa1af('0xac'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5f5a9b[_0xa1af('0x9d')]===-0x1){return _0x5f5a9b;}var _0x4d9cc4=this[_0xa1af('0xab')](_0xa1af('0xad'),_0xa1af('0xc4'));if(_0x4d9cc4[_0xa1af('0x9d')]===-0x1){return _0x4d9cc4;}var _0x105c88=this[_0xa1af('0xab')](_0xa1af('0xaf'),_0xa1af('0xc5'));if(_0x105c88['result']===-0x1){return _0x105c88;}return this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2c847a));};AGIVertices['prototype'][_0xa1af('0xc6')]=function(_0x818efb){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0xc7'),_0x818efb[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x818efb['grammar'])){return this[_0xa1af('0xe')]['noop']('no\x20grammar\x20configured');}var _0x415848=_0x818efb[_0xa1af('0xa9')];if(this[_0xa1af('0x80')](_0x818efb[_0xa1af('0x77')])){_0x415848+=','+_0x818efb[_0xa1af('0x77')];}var _0x55bd83=this['channel'][_0xa1af('0xa5')]('MRCPRecog',_0x415848);if(_0x55bd83['result']===-0x1){return _0x55bd83;}var _0x21a6be=this[_0xa1af('0xab')](_0xa1af('0xac'),_0xa1af('0xc8'));if(_0x21a6be[_0xa1af('0x9d')]===-0x1){return _0x21a6be;}var _0x42dcd5=this['getAndSetVariable'](_0xa1af('0xad'),_0xa1af('0xc9'));if(_0x42dcd5['result']===-0x1){return _0x42dcd5;}var _0x3e6319=this[_0xa1af('0xab')]('RECOG_INSTANCE()',_0xa1af('0xca'));if(_0x3e6319[_0xa1af('0x9d')]===-0x1){return _0x3e6319;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xb1'),_0x415848));};AGIVertices[_0xa1af('0x11')]['database']=function(_0xff7ca0){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0xff7ca0[_0xa1af('0xa8')]));if(!this['isConfigured'](_0xff7ca0['odbc_id'])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0xff7ca0,_0xa1af('0xcb'));}var _0x5615f0=this[_0xa1af('0xcc')]['sync'](this,_0xff7ca0[_0xa1af('0xcd')]);if(!_0x5615f0){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0xff7ca0,_0xa1af('0xce'));}if(!this[_0xa1af('0x80')](_0xff7ca0[_0xa1af('0x30')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0xff7ca0,_0xa1af('0xcf'));}var _0x454c0a=_0xff7ca0[_0xa1af('0x30')][_0xa1af('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0xd0'),_0x454c0a));var _0x5c4576=this['getQueryOdbc'][_0xa1af('0x6d')](this,_0x5615f0,_0x454c0a);this['createSquareDetailsReport']['sync'](this,_0xff7ca0,_0x454c0a);if(!this[_0xa1af('0x80')](_0xff7ca0[_0xa1af('0xd1')])){return this['channel'][_0xa1af('0xa3')](_0xa1af('0xd2'));}var _0x2f67af=this['getVariable'][_0xa1af('0x6d')](this,_0xff7ca0[_0xa1af('0xd1')]);if(!_0x2f67af){return this['channel'][_0xa1af('0x2d')](_0xff7ca0,_0xa1af('0xd3'));}var _0x47c6b0=this;_0x5c4576[_0xa1af('0xd4')](function(_0x60e80d,_0x22cfdc){Object[_0xa1af('0xd5')](_0x60e80d)[_0xa1af('0xd4')](function(_0x1c48b0){_0x47c6b0[_0xa1af('0xe')]['setVariable'](util['format'](_0xa1af('0xd6'),_0x2f67af,_0x22cfdc,_0x1c48b0),_0x60e80d[_0x1c48b0]);});});this['channel'][_0xa1af('0x9a')](util['format'](_0xa1af('0xd7'),_0x2f67af),_0x5c4576[_0xa1af('0x99')]);return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xd8'),_0x2f67af));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xd9')]=function(_0x36a111){logger[_0xa1af('0xda')](util[_0xa1af('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x36a111[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x36a111[_0xa1af('0xdb')])){return this['channel'][_0xa1af('0x2d')](_0x36a111,_0xa1af('0xdc'));}var _0x22e842=this[_0xa1af('0x1b')]['sync'](this,_0x36a111[_0xa1af('0xdb')]);if(!_0x22e842){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x36a111,_0xa1af('0xdd'));}var _0x128584=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0xde'),[util[_0xa1af('0x2a')](_0xa1af('0xdf'),_0x22e842),_0x36a111[_0xa1af('0x64')],_0x36a111[_0xa1af('0xe0')],_0x36a111[_0xa1af('0x70')]]);if(_0x128584[_0xa1af('0x9d')]===-0x1){return _0x128584;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util['format'](_0xa1af('0xe1'),_0xa1af('0xde')));};AGIVertices['prototype']['dialogflow']=function(_0x573309){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x573309['label']));if(!this[_0xa1af('0x80')](_0x573309['key'])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xe2'));}if(!this[_0xa1af('0x80')](_0x573309[_0xa1af('0x5b')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xa4'));}this['channel'][_0xa1af('0xe3')]=!![];this[_0xa1af('0x37')](_0x573309);this[_0xa1af('0xe4')](_0x573309['text'],'in');this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x573309[_0xa1af('0x5b')]));var _0x5e57a0=this[_0xa1af('0x78')]['sync'](this,_0x573309);if(_0x5e57a0){for(var _0x4ccd0a in _0x5e57a0){if(_0x5e57a0[_0xa1af('0x90')](_0x4ccd0a)){this[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0xe5'),_0x4ccd0a['toUpperCase']()),_0x5e57a0[_0x4ccd0a]);}}this[_0xa1af('0xe4')](_0x5e57a0[_0xa1af('0xe6')],_0xa1af('0xe7'));return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Dialogflow\x20Result\x20%s',_0x5e57a0[_0xa1af('0xe6')]));}return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x573309,_0xa1af('0xe8'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xe9')]=function(_0xc74324){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xc74324[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0xc74324[_0xa1af('0xea')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xeb'));}if(!this[_0xa1af('0x80')](_0xc74324[_0xa1af('0xec')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xed'));}if(!this[_0xa1af('0x80')](_0xc74324['password'])){return this[_0xa1af('0xe')][_0xa1af('0xa3')]('no\x20password\x20configured');}if(!this['isConfigured'](_0xc74324[_0xa1af('0xee')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xa4'));}this[_0xa1af('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0xc74324);this['createSquareMessage'](_0xc74324[_0xa1af('0x5b')],'in');this[_0xa1af('0xe')]['noop'](util['format'](_0xa1af('0xef'),_0xc74324['text']));var _0x1dc561=this['sestekNDA'][_0xa1af('0x6d')](this,_0xc74324);if(_0x1dc561){for(var _0xc357e2 in _0x1dc561){if(_0x1dc561[_0xa1af('0x90')](_0xc357e2)){this[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0xf0'),_0xc357e2[_0xa1af('0x67')]()),_0x1dc561[_0xc357e2]);}}this['createSquareMessage'](_0x1dc561['speech'],_0xa1af('0xe7'));if(_0x1dc561[_0xa1af('0xf1')]){this['channel'][_0xa1af('0xa3')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x1dc561[_0xa1af('0xf1')]));var _0x5cf24d=this['channel']['streamFile'](_0x1dc561[_0xa1af('0xf1')]);try{fs[_0xa1af('0xf2')](_0x1dc561[_0xa1af('0xf1')]+'.wav');}catch(_0x895f17){logger[_0xa1af('0x2d')](_0x895f17);}return _0x5cf24d;}else{return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xf3'),_0x1dc561[_0xa1af('0xe6')]));}}return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0xc74324,_0xa1af('0xf4'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xf5')]=function(_0x50356d){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0xf6'),_0x50356d['label']));return this[_0xa1af('0xe')]['noop'](_0xa1af('0xf5'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0xf7')]=function(_0x952bec){logger['info'](util[_0xa1af('0x2a')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x952bec[_0xa1af('0xa8')]));var _0x5d5678='';if(_0x952bec[_0xa1af('0xf8')]){if(!this[_0xa1af('0x80')](_0x952bec[_0xa1af('0xf8')])){return this[_0xa1af('0xe')]['error'](_0x952bec,_0xa1af('0xf9'));}else{var _0x3b73bd=parseInt(_0x952bec[_0xa1af('0xf8')],0xa);if(isNaN(_0x3b73bd)){_0x5d5678=_0x952bec[_0xa1af('0xf8')];}else{_0x5d5678=this[_0xa1af('0xfa')][_0xa1af('0x6d')](this,_0x952bec[_0xa1af('0xf8')]);if(!_0x5d5678){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x952bec,_0xa1af('0xfb'));}}}}else if(_0x952bec['trunk_name']){_0x5d5678=_0x952bec[_0xa1af('0xfc')];}else{return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x952bec,_0xa1af('0xf9'));}var _0x468d27=this[_0xa1af('0xe')]['exec'](_0xa1af('0xde'),[util[_0xa1af('0x2a')]('SIP/%s/%s',_0x5d5678,_0x952bec[_0xa1af('0x47')]),_0x952bec[_0xa1af('0x64')],_0x952bec[_0xa1af('0xe0')],_0x952bec[_0xa1af('0x70')]]);if(_0x468d27[_0xa1af('0x9d')]===-0x1){return _0x468d27;}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xe1'),_0xa1af('0xde')));};AGIVertices[_0xa1af('0x11')]['finally']=function(_0x38e9c2){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0xfd'),_0x38e9c2[_0xa1af('0xa8')]));return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xfe'));};AGIVertices['prototype']['getdigits']=function(_0x494acc){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0xff'),_0x494acc['label']));if(_0x494acc['retry']===0x0){return this[_0xa1af('0x9f')](_0x494acc);}_0x494acc['retry']-=0x1;if(!this['isConfigured'](_0x494acc['file_id'])){return this['channel'][_0xa1af('0x2d')](_0x494acc,_0xa1af('0x100'));}var _0x565cff=this['getSound'][_0xa1af('0x6d')](this,_0x494acc[_0xa1af('0x101')]);if(!_0x565cff){return this[_0xa1af('0xe')]['error'](_0x494acc,_0xa1af('0x102'));}if(!this[_0xa1af('0x80')](_0x494acc[_0xa1af('0xd1')])){return this['channel'][_0xa1af('0x2d')](_0xa1af('0xd2'));}var _0x3a008c=this[_0xa1af('0xe')][_0xa1af('0x103')](_0x565cff,_0x494acc[_0xa1af('0x104')],_0x494acc[_0xa1af('0x105')]);var _0x55b095=_0x3a008c[_0xa1af('0x9d')]?_0x3a008c[_0xa1af('0x9d')][_0xa1af('0x9c')]():'';logger[_0xa1af('0x2e')](_0xa1af('0x106'),JSON[_0xa1af('0x71')](_0x3a008c));if(_0x3a008c[_0xa1af('0x9d')]===-0x1){this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x494acc,_0x55b095);return _0x3a008c;}else if(_0x3a008c[_0xa1af('0x9b')]==='timeout'){_0x3a008c[_0xa1af('0x9d')]=_0x55b095[_0xa1af('0x99')]>=parseInt(_0x494acc[_0xa1af('0x107')])?'x':'i';}else{_0x3a008c[_0xa1af('0x9d')]=_0x55b095[_0xa1af('0x99')]>=parseInt(_0x494acc[_0xa1af('0x107')])&&_0x55b095[_0xa1af('0x99')]<=parseInt(_0x494acc[_0xa1af('0x105')])?'x':'i';}var _0xaac6e8=this[_0xa1af('0x12')]['sync'](this,_0x494acc[_0xa1af('0xd1')]);if(!_0xaac6e8){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x494acc,_0xa1af('0xd3'));}this[_0xa1af('0xe')][_0xa1af('0x9a')](_0xaac6e8,_0x55b095);if(this['isConfigured'](_0x494acc[_0xa1af('0x108')])){var _0x1ebff0=parseInt(_0x494acc[_0xa1af('0x108')],0xa);var _0x42bed4=rs['generate']({'charset':'*','length':_0x1ebff0});var _0x56b7b1=_0x55b095['length'];if(_0x56b7b1>0x0){if(_0x56b7b1>_0x1ebff0){this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x494acc,_0x494acc['hiddendigitspos']===_0xa1af('0x109')?_0x42bed4+_0x55b095['substr'](_0x1ebff0):_0x55b095['substr'](0x0,_0x56b7b1-_0x1ebff0)+_0x42bed4);}else{this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x494acc,rs[_0xa1af('0x10a')]({'charset':'*','length':_0x56b7b1}));}}else{this['createSquareDetailsReport']['sync'](this,_0x494acc,'');}}else{this['createSquareDetailsReport'][_0xa1af('0x6d')](this,_0x494acc,_0x55b095);}return _0x3a008c;};AGIVertices[_0xa1af('0x11')][_0xa1af('0xd')]=function(_0x1cd51d){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x10b'),_0x1cd51d['label']));return this['getdigits'](_0x1cd51d);};AGIVertices[_0xa1af('0x11')]['goal']=function(_0xd70504){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x10c'),_0xd70504[_0xa1af('0xa8')]));this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0xd70504,_0xd70504[_0xa1af('0x10d')]);return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('GOAL\x20%s',_0xd70504['goalname']));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x10e')]=function(_0x7925ed){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x10f'),_0x7925ed[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x7925ed['aws_access_key_id'])||!this[_0xa1af('0x80')](_0x7925ed['aws_secret_access_key'])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x110'));}if(!this[_0xa1af('0x80')](_0x7925ed[_0xa1af('0x5b')])){return this['channel']['noop'](_0xa1af('0xa4'));}this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x111'),_0x7925ed[_0xa1af('0x5b')]));var _0x2f7d1e=this[_0xa1af('0x82')][_0xa1af('0x6d')](this,_0x7925ed);if(_0x2f7d1e){this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x112'),_0x2f7d1e));var _0x5f551a=this[_0xa1af('0xe')]['streamFile'](_0x2f7d1e);try{fs['unlink'](_0x2f7d1e+_0xa1af('0x113'));}catch(_0x531519){logger[_0xa1af('0x2d')](_0x531519);}return _0x5f551a;}return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x7925ed,_0xa1af('0x114'));};AGIVertices[_0xa1af('0x11')]['awslex']=function(_0xc55e11){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x115'),_0xc55e11[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0xc55e11[_0xa1af('0x89')])||!this['isConfigured'](_0xc55e11[_0xa1af('0x83')])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0x110'));}if(!this['isConfigured'](_0xc55e11['aws_bot_name'])){return this['channel'][_0xa1af('0xa3')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0xc55e11['text'])){return this['channel'][_0xa1af('0xa3')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0xc55e11);this[_0xa1af('0xe4')](_0xc55e11[_0xa1af('0x5b')],'in');this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x116'),_0xc55e11[_0xa1af('0x5b')]));var _0x55ff73=this[_0xa1af('0x88')][_0xa1af('0x6d')](this,_0xc55e11);if(_0x55ff73){for(var _0x5d0585 in _0x55ff73){if(_0x55ff73[_0xa1af('0x90')](_0x5d0585)&&_[_0xa1af('0x95')](_0x55ff73[_0x5d0585])){this['channel'][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0x117'),_0x5d0585['toUpperCase']()),_0x55ff73[_0x5d0585]);}}if(_[_0xa1af('0x43')](_0x55ff73[_0xa1af('0x75')])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0x118'));}else{this['createSquareMessage'](_0x55ff73[_0xa1af('0x75')],_0xa1af('0xe7'));return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x119'),_0x55ff73[_0xa1af('0x75')]));}}return this['channel']['error'](_0xc55e11,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xa1af('0x11')][_0xa1af('0x11a')]=function(_0xc48b1f){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x11b'),_0xc48b1f[_0xa1af('0xa8')],_0xc48b1f[_0xa1af('0x64')]));if(!this[_0xa1af('0x80')](_0xc48b1f[_0xa1af('0x7c')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xe2'));}var _0x42c312=_0xa1af('0x11c');var _0x36d61e=util[_0xa1af('0x2a')](_0xa1af('0x11d'),FILES_PATH,rs[_0xa1af('0x10a')](0x4));var _0x1a9b09=util['format'](_0xa1af('0x98'),_0x36d61e,_0x42c312);var _0x5d2aa7=!![];if(_0xc48b1f[_0xa1af('0x11e')]==='NOBEEP'){_0x5d2aa7=![];}var _0x434d26=this[_0xa1af('0xe')][_0xa1af('0x11f')](_0x36d61e,_0x42c312,_0xc48b1f[_0xa1af('0x120')],_0xc48b1f['timeout'],undefined,_0x5d2aa7);if(_0x434d26['result']!==-0x1){this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x121'),_0x1a9b09));var _0x13d6ba=this[_0xa1af('0x8b')][_0xa1af('0x6d')](this,_0xc48b1f,_0x1a9b09);if(_0x13d6ba){for(var _0xedd95e in _0x13d6ba){if(_0x13d6ba[_0xa1af('0x90')](_0xedd95e)){this[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0x122'),_0xedd95e[_0xa1af('0x67')]()),_0x13d6ba[_0xedd95e]);}}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x123'),JSON['stringify'](_0x13d6ba)));}}return _0x434d26;};AGIVertices[_0xa1af('0x11')][_0xa1af('0x124')]=function(_0x2e2be3){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2e2be3['label']));if(!this[_0xa1af('0x80')](_0x2e2be3[_0xa1af('0x8d')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x125'));}if(!this[_0xa1af('0x80')](_0x2e2be3[_0xa1af('0x8e')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x126'));}var _0x3549cc='wav';var _0x3b34ed=util[_0xa1af('0x2a')](_0xa1af('0x11d'),FILES_PATH,rs['generate'](0x4));var _0x39a08b=util['format'](_0xa1af('0x98'),_0x3b34ed,_0x3549cc);var _0x43d960=!![];if(_0x2e2be3[_0xa1af('0x11e')]===_0xa1af('0x127')){_0x43d960=![];}var _0x324350=this['channel'][_0xa1af('0x11f')](_0x3b34ed,_0x3549cc,_0x2e2be3[_0xa1af('0x120')],_0x2e2be3[_0xa1af('0x64')],undefined,_0x43d960);if(_0x324350[_0xa1af('0x9d')]!==-0x1){this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x128'),_0x39a08b));var _0x3d07f2=this[_0xa1af('0x8c')]['sync'](this,_0x2e2be3,_0x39a08b);if(_0x3d07f2){for(var _0x57af6d in _0x3d07f2){if(_0x3d07f2[_0xa1af('0x90')](_0x57af6d)){this[_0xa1af('0xe')][_0xa1af('0x9a')](util['format'](_0xa1af('0x129'),_0x57af6d[_0xa1af('0x67')]()),_0x3d07f2[_0x57af6d]);}}return this[_0xa1af('0xe')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0xa1af('0x71')](_0x3d07f2)));}}return _0x324350;};AGIVertices[_0xa1af('0x11')][_0xa1af('0x12a')]=function(_0x437404){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x12b'),_0x437404['label']));return this['channel']['continueAt'](_0x437404[_0xa1af('0x3e')],_0x437404[_0xa1af('0x12c')],_0x437404['priority']);};AGIVertices['prototype'][_0xa1af('0x12d')]=function(_0x3332b9){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x12e'),_0x3332b9[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x3332b9[_0xa1af('0x12f')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x3332b9,'no\x20condition\x20configured');}try{var _0x578239=eval(_0x3332b9['condition'])?_0xa1af('0x130'):_0xa1af('0x131');this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x3332b9[_0xa1af('0x12f')],_0x578239));return{'code':0xc8,'result':_0x578239};}catch(_0xfa61b){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype'][_0xa1af('0x132')]=function(_0x5163d9){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x133'),_0x5163d9[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x5163d9['interval_id'])){return this['channel'][_0xa1af('0x2d')](_0x5163d9,'no\x20interval\x20configured');}var _0x281a72=this[_0xa1af('0x23')][_0xa1af('0x6d')](this,_0x5163d9[_0xa1af('0x134')]);if(!_0x281a72){return this['channel']['error'](_0x5163d9,_0xa1af('0x135'));}for(var _0x1baa37=0x0;_0x1baa37<_0x281a72['length'];_0x1baa37+=0x1){var _0x45f44a=this[_0xa1af('0xe')][_0xa1af('0x12')](util[_0xa1af('0x2a')]('IFTIME(%s?true:false)',_0x281a72[_0x1baa37]));if(_0x45f44a[_0xa1af('0x9d')]===-0x1){return _0x45f44a;}logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x136'),_0x281a72[_0x1baa37],_0x45f44a[_0xa1af('0x9b')]));if(_0x45f44a[_0xa1af('0x9b')]===_0xa1af('0x130')){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x136'),_0x281a72[_0x1baa37],'true'));this[_0xa1af('0xe')]['noop'](util['format'](_0xa1af('0x136'),_0x281a72[_0x1baa37],_0xa1af('0x130')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x136'),_0x281a72[_0x1baa37],'false'));this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x136'),_0x281a72[_0x1baa37],_0xa1af('0x131')));}}return{'code':0xc8,'result':_0xa1af('0x131')};};AGIVertices[_0xa1af('0x11')]['hangup']=function(_0x186041){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x137'),_0x186041['label']));return this[_0xa1af('0xe')][_0xa1af('0x138')]();};AGIVertices[_0xa1af('0x11')]['ispeechasr']=function(_0x46a43e){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x139'),_0x46a43e[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x46a43e['key'])){return this['channel'][_0xa1af('0xa3')]('no\x20key\x20configured');}var _0x101fd5=_0xa1af('0x11c');var _0x10a940=util[_0xa1af('0x2a')](_0xa1af('0x11d'),FILES_PATH,rs['generate'](0x4));var _0x299bf8=util[_0xa1af('0x2a')]('%s.%s',_0x10a940,_0x101fd5);var _0x13b99c=!![];if(_0x46a43e[_0xa1af('0x11e')]===_0xa1af('0x127')){_0x13b99c=![];}var _0x336eb6=this[_0xa1af('0xe')][_0xa1af('0x11f')](_0x10a940,_0x101fd5,_0x46a43e[_0xa1af('0x120')],_0x46a43e[_0xa1af('0x64')],undefined,_0x13b99c);if(_0x336eb6[_0xa1af('0x9d')]!==-0x1){this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x13a'),_0x299bf8));var _0x54ee0a=this[_0xa1af('0x7e')][_0xa1af('0x6d')](this,_0x46a43e,_0x299bf8);if(_0x54ee0a){for(var _0x530aaf in _0x54ee0a){if(_0x54ee0a[_0xa1af('0x90')](_0x530aaf)){this[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')](_0xa1af('0x13b'),_0x530aaf['toUpperCase']()),_0x54ee0a[_0x530aaf]);}}return this['channel'][_0xa1af('0xa3')](util['format'](_0xa1af('0x13c'),JSON[_0xa1af('0x71')](_0x54ee0a)));}}return _0x336eb6;};AGIVertices[_0xa1af('0x11')][_0xa1af('0x13d')]=function(_0x35e10f){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x13e'),_0x35e10f[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x35e10f[_0xa1af('0x7c')])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0xe2'));}if(!this[_0xa1af('0x80')](_0x35e10f[_0xa1af('0x5b')])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0xa4'));}this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x13f'),_0x35e10f['text']));var _0x52fda7=this['ispeechTTS'][_0xa1af('0x6d')](this,_0x35e10f);if(_0x52fda7){this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x13a'),_0x52fda7));var _0x24bad7=this[_0xa1af('0xe')][_0xa1af('0x140')](_0x52fda7,_0x35e10f[_0xa1af('0x120')]);try{fs[_0xa1af('0xf2')](_0x52fda7+'.wav');}catch(_0x1ebf07){logger[_0xa1af('0x2d')](_0x1ebf07);}return _0x24bad7;}return this['channel'][_0xa1af('0x2d')](_0x35e10f,_0xa1af('0x141'));};AGIVertices['prototype']['login']=function(_0x17ffdd){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x142'),_0x17ffdd[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x17ffdd[_0xa1af('0x143')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x17ffdd,_0xa1af('0x144'));}logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x145'),this['channel'][_0xa1af('0x3b')],_0x17ffdd[_0xa1af('0x143')]));var _0xeff46d=this[_0xa1af('0x54')][_0xa1af('0x6d')](this,_0x17ffdd[_0xa1af('0x143')]);if(_0xeff46d){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x146'),this['channel']['callerid'],_0x17ffdd[_0xa1af('0x143')]));this[_0xa1af('0xe')][_0xa1af('0xa3')](util['format'](_0xa1af('0x146'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x17ffdd[_0xa1af('0x143')]));return{'code':0xc8,'result':_0xa1af('0x147')};}else{logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x148'),this[_0xa1af('0xe')]['callerid'],_0x17ffdd[_0xa1af('0x143')]));this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x148'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x17ffdd[_0xa1af('0x143')]));return{'code':0xc8,'result':_0xa1af('0x149')};}};AGIVertices[_0xa1af('0x11')][_0xa1af('0x14a')]=function(_0x445bff){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x14b'),_0x445bff['label']));if(!this[_0xa1af('0x80')](_0x445bff[_0xa1af('0x143')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x445bff,_0xa1af('0x144'));}logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x145'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x445bff[_0xa1af('0x143')]));var _0x5d2e7b=this[_0xa1af('0x51')][_0xa1af('0x6d')](this,_0x445bff[_0xa1af('0x143')]);if(_0x5d2e7b){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x146'),this[_0xa1af('0xe')]['callerid'],_0x445bff['findBy']));this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x146'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x445bff[_0xa1af('0x143')]));return{'code':0xc8,'result':_0xa1af('0x147')};}else{logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa1af('0x3b')],_0x445bff['findBy']));this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x148'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x445bff[_0xa1af('0x143')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa1af('0x11')]['math']=function(_0x26ff53){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x14c'),_0x26ff53[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x26ff53['operation'])){return this['channel'][_0xa1af('0x2d')](_0x26ff53,_0xa1af('0x14d'));}this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x14e'),_0x26ff53[_0xa1af('0x14f')]));var _0x5b9898=eval(_0x26ff53[_0xa1af('0x14f')]);if(!this['isConfigured'](_0x26ff53[_0xa1af('0xd1')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b0875=this[_0xa1af('0x12')][_0xa1af('0x6d')](this,_0x26ff53['variable_id']);if(!_0x3b0875){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x26ff53,'no\x20variable\x20found');}if(_[_0xa1af('0x94')](_0x5b9898)){var _0xae18f2=this;_0x5b9898['forEach'](function(_0x1ed2e3,_0xe63c80){_0xae18f2[_0xa1af('0xe')][_0xa1af('0x9a')](util[_0xa1af('0x2a')]('%s[%s]',_0x3b0875,_0xe63c80),_0x1ed2e3);});return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x150'),_0x3b0875));}else{return this[_0xa1af('0xe')][_0xa1af('0x9a')](_0x3b0875,_0x5b9898);}};AGIVertices[_0xa1af('0x11')][_0xa1af('0xb')]=function(_0x5b805e){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x151'),_0x5b805e['label']));if(_0x5b805e[_0xa1af('0xa0')]===0x0){return this[_0xa1af('0x9f')](_0x5b805e);}_0x5b805e[_0xa1af('0xa0')]-=0x1;if(!this['isConfigured'](_0x5b805e[_0xa1af('0x101')])){return this['channel'][_0xa1af('0x2d')](_0x5b805e,_0xa1af('0x100'));}var _0x479f21=this[_0xa1af('0x1e')][_0xa1af('0x6d')](this,_0x5b805e[_0xa1af('0x101')]);if(!_0x479f21){return this['channel'][_0xa1af('0x2d')](_0x5b805e,_0xa1af('0x102'));}var _0x29b13e=this['channel'][_0xa1af('0x103')](_0x479f21,_0x5b805e['response'],_0x5b805e['digit']);var _0x35ea22=_0x29b13e[_0xa1af('0x9d')];if(_0x29b13e[_0xa1af('0x9d')]===-0x1){this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x5b805e,'-1');return _0x29b13e;}else if(_0x29b13e[_0xa1af('0x9b')]===_0xa1af('0x64')){_0x29b13e[_0xa1af('0x9d')]=_0x29b13e[_0xa1af('0x9d')][_0xa1af('0x99')]>0x0?_0x29b13e[_0xa1af('0x9d')]:'t';}else if(_['isEmpty'](_0x29b13e[_0xa1af('0x9d')])){_0x29b13e['result']='#';_0x35ea22='#';}if(!this['isConfigured'](_0x5b805e['variable_id'])){this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xd2'));}else{var _0xdb09be=this['getVariable']['sync'](this,_0x5b805e['variable_id']);if(!_0xdb09be){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x5b805e,'no\x20variable\x20found');}this['channel'][_0xa1af('0x9a')](_0xdb09be,_0x35ea22);}this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x5b805e,_0x35ea22);return _0x29b13e;};AGIVertices[_0xa1af('0x11')][_0xa1af('0xa3')]=function(_0x3d6b5e){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x152'),_0x3d6b5e[_0xa1af('0xa8')]));return this[_0xa1af('0xe')]['noop'](_0x3d6b5e[_0xa1af('0x153')]||_0x3d6b5e['label']);};AGIVertices[_0xa1af('0x11')][_0xa1af('0x154')]=function(_0x130ac7){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x155'),_0x130ac7['label']));if(!this['isConfigured'](_0x130ac7[_0xa1af('0x143')])){return this['channel']['error'](_0x130ac7,'no\x20find\x20by\x20configured');}logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x145'),this['channel'][_0xa1af('0x3b')],_0x130ac7['findBy']));var _0x4c545d=this[_0xa1af('0x4c')]['sync'](this,_0x130ac7[_0xa1af('0x156')]);var _0x26e9eb=this[_0xa1af('0x4e')][_0xa1af('0x6d')](this,_0x130ac7['findBy'],_0x4c545d);if(_0x26e9eb){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x146'),this[_0xa1af('0xe')]['callerid'],_0x130ac7[_0xa1af('0x143')]));this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x130ac7[_0xa1af('0x143')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa1af('0x3b')],_0x130ac7['findBy']));this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa1af('0x3b')],_0x130ac7[_0xa1af('0x143')]));return{'code':0xc8,'result':_0xa1af('0x149')};}};AGIVertices[_0xa1af('0x11')][_0xa1af('0x157')]=function(_0x2bd53e){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x158'),_0x2bd53e[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x2bd53e[_0xa1af('0x101')])){return this['channel'][_0xa1af('0x2d')](_0x2bd53e,_0xa1af('0x100'));}var _0x5a8ffb=this[_0xa1af('0x1e')][_0xa1af('0x6d')](this,_0x2bd53e[_0xa1af('0x101')]);if(!_0x5a8ffb){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x2bd53e,_0xa1af('0x102'));}var _0x408d93=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0x159'),[_0x5a8ffb,_0x2bd53e['opts']]);if(_0x408d93[_0xa1af('0x9d')]===-0x1){return _0x408d93;}return this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')]('Executed\x20command\x20%s\x20%s',_0xa1af('0x159'),_0x5a8ffb));};AGIVertices[_0xa1af('0x11')]['queue']=function(_0x52478e){logger[_0xa1af('0x2e')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x52478e['label']));if(!this[_0xa1af('0x80')](_0x52478e[_0xa1af('0x15a')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x52478e,'no\x20queue\x20selected');}var _0x2f9d77='';var _0x3e032b=parseInt(_0x52478e[_0xa1af('0x15a')],0xa);if(isNaN(_0x3e032b)){_0x2f9d77=_0x52478e[_0xa1af('0x15a')];}else{_0x2f9d77=this[_0xa1af('0x15')]['sync'](this,_0x52478e[_0xa1af('0x15a')]);if(!_0x2f9d77){return this[_0xa1af('0xe')]['error'](_0x52478e,_0xa1af('0x15b'));}}var _0x568482='';if(this[_0xa1af('0x80')](_0x52478e[_0xa1af('0x101')])){var _0x46e7a5=this[_0xa1af('0x1e')][_0xa1af('0x6d')](this,_0x52478e[_0xa1af('0x101')]);if(_0x46e7a5){_0x568482=_0x46e7a5;}}this['createSquareDetailsReport']['sync'](this,_0x52478e,_0x2f9d77);if(_0x52478e[_0xa1af('0xe0')]['indexOf']('x')<0x0){_0x52478e['opts']+='x';}if(_0x52478e['opts']['indexOf']('X')<0x0){_0x52478e[_0xa1af('0xe0')]+='X';}this[_0xa1af('0xe')][_0xa1af('0x9a')](_0xa1af('0x15c'),_0x2f9d77?_0x2f9d77[_0xa1af('0x15d')]():'');var _0x218c86=this[_0xa1af('0xe')]['exec'](_0xa1af('0x15e'),[_0x2f9d77,_0x52478e['opts'],_0x52478e[_0xa1af('0x70')],_0x568482,_0x52478e['timeout'],_0x52478e[_0xa1af('0xb2')],_0x52478e[_0xa1af('0x15f')],_0x52478e['gosub'],'',_0x52478e[_0xa1af('0x160')]]);if(_0x218c86['result']===-0x1){return _0x218c86;}return this['channel'][_0xa1af('0xa3')](util['format'](_0xa1af('0xbd'),_0xa1af('0x15e'),_0x2f9d77));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x161')]=function(_0x4745e5){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x162'),_0x4745e5[_0xa1af('0xa8')]));var _0x97f178=_0x4745e5[_0xa1af('0x163')]||_0xa1af('0x11c');var _0x35840c=util[_0xa1af('0x2a')](_0xa1af('0x164'),this[_0xa1af('0xe')]['uniqueid'],rs[_0xa1af('0x10a')](0x5));var _0x21a224=util['format'](_0xa1af('0x165'),FILES_PATH,_0x35840c,_0x97f178);var _0x343e78=util['format'](_0xa1af('0x11d'),FILES_PATH,_0x35840c);this['createSquareRecording'][_0xa1af('0x6d')](this,_0x4745e5,_0x35840c,_0x21a224);this[_0xa1af('0xe')][_0xa1af('0x9a')](_0xa1af('0x166'),_0x35840c);logger[_0xa1af('0x2e')](_0xa1af('0x167'),_0x343e78,_0x97f178,_0x4745e5[_0xa1af('0x168')],_0x4745e5[_0xa1af('0x64')]);return this[_0xa1af('0xe')][_0xa1af('0x11f')](_0x343e78,_0x97f178,_0x4745e5[_0xa1af('0x168')],_0x4745e5[_0xa1af('0x64')],undefined,!![]);};AGIVertices[_0xa1af('0x11')]['restapi']=function(_0x34cb1a){logger['info'](util['format'](_0xa1af('0x169'),_0x34cb1a[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x34cb1a[_0xa1af('0x70')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x16a'));}var _0x26a22e=this[_0xa1af('0x61')][_0xa1af('0x6d')](this,_0x34cb1a);logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x16b'),util['inspect'](_0x26a22e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x34cb1a['variable_id'])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0x16c'));}var _0x3f55b1=this[_0xa1af('0x12')][_0xa1af('0x6d')](this,_0x34cb1a[_0xa1af('0xd1')]);if(!_0x3f55b1){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x34cb1a,_0xa1af('0xd3'));}this[_0xa1af('0xe')][_0xa1af('0x9a')](util['format'](_0xa1af('0x16d'),_0x3f55b1),_0x26a22e[_0xa1af('0x73')]?_0x26a22e[_0xa1af('0x73')]:_0xa1af('0x16e'));this[_0xa1af('0xe')]['setVariable'](util[_0xa1af('0x2a')](_0xa1af('0x16f'),_0x3f55b1),_0x26a22e['statusMessage']?_0x26a22e[_0xa1af('0x74')]:'OK');if(_0x26a22e['body']){try{this['saveRestApiResult'](_0x26a22e[_0xa1af('0x72')],_0x3f55b1);}catch(_0x9591ae){logger[_0xa1af('0x2d')](util[_0xa1af('0x2a')](_0xa1af('0x170'),_0x3f55b1));}}return this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0xd8'),_0x3f55b1));};AGIVertices['prototype']['saydigits']=function(_0x1fbd80){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x171'),_0x1fbd80['label']));return this['channel'][_0xa1af('0x172')](_0x1fbd80[_0xa1af('0x173')]['replace'](/\s+/g,''),_0x1fbd80[_0xa1af('0x168')]);};AGIVertices[_0xa1af('0x11')][_0xa1af('0x174')]=function(_0x1a8c2b){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x175'),_0x1a8c2b[_0xa1af('0xa8')]));return this[_0xa1af('0xe')][_0xa1af('0x176')](_0x1a8c2b['number']['replace'](/\s+/g,''),_0x1a8c2b[_0xa1af('0x168')]);};AGIVertices[_0xa1af('0x11')][_0xa1af('0x177')]=function(_0xaede52){logger[_0xa1af('0x2e')](util['format'](_0xa1af('0x178'),_0xaede52[_0xa1af('0xa8')]));return this['channel'][_0xa1af('0x179')](_0xaede52['text'],_0xaede52[_0xa1af('0x168')]);};AGIVertices[_0xa1af('0x11')][_0xa1af('0x17a')]=function(_0x5e98c1){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x17b'),_0x5e98c1[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x5e98c1[_0xa1af('0x17c')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x17d'));}var _0x51371b=this[_0xa1af('0x20')]['sync'](this,_0x5e98c1[_0xa1af('0x17c')]);if(!_0x51371b||!_0x51371b[_0xa1af('0x17e')]){return this['channel'][_0xa1af('0x2d')](_0x5e98c1,_0xa1af('0x17f'));}var _0x5a44a4={'from':util['format'](_0xa1af('0x180'),_0x51371b[_0xa1af('0x16')],_0x51371b[_0xa1af('0x181')]||_0x51371b[_0xa1af('0x17e')][_0xa1af('0x182')]),'to':_0x5e98c1['to']||'','cc':_0x5e98c1['cc']||'','bcc':_0x5e98c1[_0xa1af('0x183')]||'','subject':_0x5e98c1[_0xa1af('0x184')],'html':_0x5e98c1[_0xa1af('0x5b')],'text':_0x5e98c1[_0xa1af('0x5b')]};var _0x14bfc7={'tls':{'rejectUnauthorized':![]}};if(_0x51371b['Smtp'][_0xa1af('0x185')]){_0x14bfc7['service']=_0x51371b[_0xa1af('0x17e')][_0xa1af('0x185')];}else{_0x14bfc7[_0xa1af('0x186')]=_0x51371b[_0xa1af('0x17e')][_0xa1af('0x186')];_0x14bfc7[_0xa1af('0x187')]=_0x51371b['Smtp'][_0xa1af('0x187')];_0x14bfc7['secure']=_0x51371b['Smtp'][_0xa1af('0x188')];}if(_0x51371b[_0xa1af('0x17e')]['authentication']){_0x14bfc7[_0xa1af('0x189')]={'user':_0x51371b[_0xa1af('0x17e')][_0xa1af('0x182')],'pass':_0x51371b['Smtp'][_0xa1af('0x18a')]};}if(this[_0xa1af('0x80')](_0x5e98c1['template_id'])){}logger['debug']('sendMail\x20message',JSON[_0xa1af('0x71')](_0x5a44a4));this[_0xa1af('0x37')]['sync'](this,_0x5e98c1,_0x5e98c1[_0xa1af('0x17c')]);this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x51371b[_0xa1af('0x16')]));this[_0xa1af('0x22')][_0xa1af('0x6d')](this,_0x14bfc7,_0x5a44a4);return this[_0xa1af('0xe')]['noop'](_0xa1af('0x18b'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x18c')]=function(_0xc5d0e7){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0xc5d0e7[_0xa1af('0xa8')]));return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x18d'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x18e')]=function(_0x45abe0){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x18f'),_0x45abe0[_0xa1af('0xa8')]));if(!this['isConfigured'](_0x45abe0['sms_account_id'])){return this['channel'][_0xa1af('0xa3')](_0xa1af('0x190'));}var _0xa6a506=this[_0xa1af('0x35')]['sync'](this,_0x45abe0[_0xa1af('0x191')]);if(!_0xa6a506){return this['channel'][_0xa1af('0x2d')](_0x45abe0,'no\x20sms\x20account\x20found');}var _0x10d6cb={'body':_0x45abe0[_0xa1af('0x192')],'phone':_0x45abe0['to']||'','SmsAccountId':_0xa6a506['id']};logger[_0xa1af('0xda')](_0xa1af('0x193'),JSON[_0xa1af('0x71')](_0x10d6cb));this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x45abe0,_0x45abe0[_0xa1af('0x191')]);this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xa6a506[_0xa1af('0x16')]));this[_0xa1af('0x36')]['sync'](this,_0x10d6cb);return this[_0xa1af('0xe')]['noop'](_0xa1af('0x194'));};AGIVertices[_0xa1af('0x11')]['set']=function(_0x430c55){logger[_0xa1af('0x2e')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x430c55[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x430c55[_0xa1af('0xd1')])){return this[_0xa1af('0xe')]['error'](_0x430c55,'no\x20variable\x20selected');}var _0x487751=this[_0xa1af('0x12')][_0xa1af('0x6d')](this,_0x430c55[_0xa1af('0xd1')]);if(!_0x487751){return this[_0xa1af('0xe')]['error'](_0x430c55,_0xa1af('0xd3'));}return this[_0xa1af('0xe')][_0xa1af('0x9a')](_0x487751,_0x430c55[_0xa1af('0x195')]);};AGIVertices[_0xa1af('0x11')]['start']=function(_0x73ce91){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x196'),_0x73ce91['label']));this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x197'));if(_0x73ce91[_0xa1af('0xb6')]===_0xa1af('0x198')){this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x199'));return this[_0xa1af('0xe')][_0xa1af('0xb6')]();}return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0x19a'));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x19b')]=function(_0x18152d){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x19c'),_0x18152d['label']));if(!this['isConfigured'](_0x18152d[_0xa1af('0x19d')])){return this['channel'][_0xa1af('0x2d')](_0x18152d,_0xa1af('0x19e'));}var _0x1638c4=this[_0xa1af('0x19f')][_0xa1af('0x6d')](this,_0x18152d[_0xa1af('0x19d')]);if(!this['isConfigured'](_0x1638c4)){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x18152d,util['format'](_0xa1af('0x1a0'),_0x18152d[_0xa1af('0x19d')]));}if(_0x1638c4===this[_0xa1af('0xe')][_0xa1af('0x3a')]){return this['channel'][_0xa1af('0x2d')](_0x18152d,_0xa1af('0x1a1'));}this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x18152d,_0x1638c4);var _0x2e1c78=this[_0xa1af('0xe')][_0xa1af('0xa5')]('AGI',util[_0xa1af('0x2a')](_0xa1af('0x1a2'),config[_0xa1af('0xb2')][_0xa1af('0x186')]||_0xa1af('0x1a3'),_0x1638c4,this[_0xa1af('0xe')][_0xa1af('0x3a')]));if(_0x2e1c78[_0xa1af('0x9d')]===-0x1){return _0x2e1c78;}return this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xbd'),_0xa1af('0x1a4'),_0x1638c4));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x1a5')]=function(_0x240f28){logger['info'](util[_0xa1af('0x2a')](_0xa1af('0x1a6'),_0x240f28['label']));var _0x262331=this[_0xa1af('0x55')][_0xa1af('0x6d')](this,_0x240f28[_0xa1af('0xb4')]);this[_0xa1af('0x37')][_0xa1af('0x6d')](this,_0x240f28,_0x240f28[_0xa1af('0xb4')]);if(this[_0xa1af('0x80')](_0x240f28[_0xa1af('0xd1')])){var _0x3d9cfc=this[_0xa1af('0x12')]['sync'](this,_0x240f28[_0xa1af('0xd1')]);if(_0x3d9cfc){this[_0xa1af('0xe')][_0xa1af('0x9a')](_0x3d9cfc,_0x262331);return this[_0xa1af('0xe')]['noop'](util[_0xa1af('0x2a')](_0xa1af('0x1a7'),_0x240f28[_0xa1af('0xb4')],_0x3d9cfc));}}return this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x1a8'),_0x240f28['command']));};AGIVertices['prototype'][_0xa1af('0x1a9')]=function(_0x442fe2){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x1aa'),_0x442fe2['label']));_0x442fe2[_0xa1af('0x5b')]=_0x442fe2['text'][_0xa1af('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa1af('0x80')](_0x442fe2['apiKey'])){return this[_0xa1af('0xe')]['noop'](_0xa1af('0x1ab'));}if(!this[_0xa1af('0x80')](_0x442fe2[_0xa1af('0x5b')])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xa4'));}this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x1ac'),_0x442fe2[_0xa1af('0x5b')]));var _0x3fd788=this[_0xa1af('0x58')][_0xa1af('0x6d')](this,_0x442fe2);if(_0x3fd788){this['channel'][_0xa1af('0xa3')](util['format'](_0xa1af('0x1ad'),_0x3fd788));var _0x5c4f67=this[_0xa1af('0xe')][_0xa1af('0x140')](_0x3fd788);try{fs['unlink'](_0x3fd788+'.wav');}catch(_0x30bf07){logger[_0xa1af('0x2d')](_0x30bf07);}return _0x5c4f67;}return this[_0xa1af('0xe')]['error'](_0x442fe2,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xa1af('0x1ae')]=function(_0x293df1){logger['info'](util[_0xa1af('0x2a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x293df1[_0xa1af('0xa8')]));_0x293df1['text']=_0x293df1[_0xa1af('0x5b')][_0xa1af('0x57')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa1af('0x80')](_0x293df1['text'])){return this[_0xa1af('0xe')][_0xa1af('0xa3')](_0xa1af('0xa4'));}this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')]('Trying\x20Google\x20TTS\x20%s',_0x293df1[_0xa1af('0x5b')]));var _0x280373=this['googleTTS']['sync'](this,_0x293df1);if(_0x280373){this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x1af'),_0x280373));var _0x4291ab=this['channel'][_0xa1af('0x140')](_0x280373);try{fs[_0xa1af('0xf2')](_0x280373+_0xa1af('0x113'));}catch(_0xa0a243){logger[_0xa1af('0x2d')](_0xa0a243);}return _0x4291ab;}return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x293df1,_0xa1af('0x1b0'));};AGIVertices[_0xa1af('0x11')]['unpause']=function(_0x1f5b5e){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x1b1'),_0x1f5b5e[_0xa1af('0xa8')]));if(!this[_0xa1af('0x80')](_0x1f5b5e[_0xa1af('0x143')])){return this[_0xa1af('0xe')]['error'](_0x1f5b5e,_0xa1af('0x144'));}logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x145'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x1f5b5e[_0xa1af('0x143')]));var _0x3df2cd=this[_0xa1af('0x50')][_0xa1af('0x6d')](this,_0x1f5b5e['findBy']);if(_0x3df2cd){logger[_0xa1af('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x1f5b5e['findBy']));this[_0xa1af('0xe')][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0x146'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x1f5b5e['findBy']));return{'code':0xc8,'result':_0xa1af('0x147')};}else{logger[_0xa1af('0x2e')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa1af('0xe')]['callerid'],_0x1f5b5e['findBy']));this[_0xa1af('0xe')][_0xa1af('0xa3')](util['format'](_0xa1af('0x148'),this[_0xa1af('0xe')][_0xa1af('0x3b')],_0x1f5b5e[_0xa1af('0x143')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa1af('0x11')]['voicemail']=function(_0x483ab0){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x1b2'),_0x483ab0[_0xa1af('0xa8')]));var _0x215385=this[_0xa1af('0xe')][_0xa1af('0xa5')](_0xa1af('0x1b3'),[_0x483ab0[_0xa1af('0x1b4')],_0x483ab0[_0xa1af('0x77')]]);if(_0x215385[_0xa1af('0x9d')]===-0x1){return _0x215385;}return this['channel'][_0xa1af('0xa3')](util[_0xa1af('0x2a')](_0xa1af('0xbd'),'VOICEMAIL',_0x483ab0[_0xa1af('0x1b4')]));};AGIVertices[_0xa1af('0x11')][_0xa1af('0x1b5')]=function(_0x11ce89){logger[_0xa1af('0x2e')](util[_0xa1af('0x2a')](_0xa1af('0x1b6'),_0x11ce89['label']));if(!this[_0xa1af('0x80')](_0x11ce89[_0xa1af('0xd1')])){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x11ce89,_0xa1af('0x1b7'));}var _0x5f0795=this[_0xa1af('0x12')][_0xa1af('0x6d')](this,_0x11ce89[_0xa1af('0xd1')]);if(!_0x5f0795){return this[_0xa1af('0xe')][_0xa1af('0x2d')](_0x11ce89,_0xa1af('0xd3'));}var _0x5e18fb=this[_0xa1af('0xe')][_0xa1af('0x12')](_0x5f0795);return{'code':0xc8,'result':_0x5e18fb[_0xa1af('0x9b')]?_0x5e18fb[_0xa1af('0x9b')]:'-'};};String[_0xa1af('0x11')][_0xa1af('0x1b8')]=function(_0x23f627,_0x3a6f13){return this[_0xa1af('0x1b9')](_0x23f627)[_0xa1af('0x1ba')](_0x3a6f13);};module[_0xa1af('0x1bb')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4e6d668..1a7703b 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 _0xb903=['attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','interface','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','prototype','startAcw','channels','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x3164c6,_0x4f5f3b){var _0x36e930=function(_0x2b1626){while(--_0x2b1626){_0x3164c6['push'](_0x3164c6['shift']());}};_0x36e930(++_0x4f5f3b);}(_0xb903,0x185));var _0x3b90=function(_0x5a415f,_0x40a462){_0x5a415f=_0x5a415f-0x0;var _0x3c7ad7=_0xb903[_0x5a415f];return _0x3c7ad7;};'use strict';var util=require(_0x3b90('0x0'));var _=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var ami=require(_0x3b90('0x3'));var logger=require('../../../config/logger')(_0x3b90('0x4'));var RpcUser=require(_0x3b90('0x5'));var RpcVoiceAgentReport=require(_0x3b90('0x6'));function Acw(_0x1cd5d8){this[_0x3b90('0x7')]=_0x1cd5d8[_0x3b90('0x7')];this[_0x3b90('0x8')]=_0x1cd5d8['agents'];this[_0x3b90('0x9')]=_0x1cd5d8['timers'];this['channels']={};ami['on'](_0x3b90('0xa'),this[_0x3b90('0xb')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0xd'),this['syncHangupRequest']['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0x3b90('0xe')][_0x3b90('0xc')](this));ami['on']('attendedtransfer',this[_0x3b90('0xf')][_0x3b90('0xc')](this));ami['on']('blindtransfer',this[_0x3b90('0x10')][_0x3b90('0xc')](this));ami['on'](_0x3b90('0x11'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x58c4d1){var _0x542cb3=moment()['milliseconds'](0x0);var _0x3a0a55=moment(_0x58c4d1)[_0x3b90('0x12')](0x0);return _0x542cb3['diff'](_0x3a0a55,'seconds');}Acw[_0x3b90('0x13')][_0x3b90('0x14')]=function(_0x381a9e){try{var _0x1af265=this;var _0x1efe01=this['channels'][_0x381a9e]['interface'];var _0xd83280=this[_0x3b90('0x15')][_0x381a9e]['queue'];var _0x269488=this[_0x3b90('0x7')][_0xd83280];var _0x11ad7d=![];var _0x131f3f='ACW';if(_0x269488[_0x3b90('0x16')]){if(_0x269488['mandatoryDispositionPause'][_0x3b90('0x17')]){_0x11ad7d=!![];_0x131f3f=_0x269488[_0x3b90('0x18')]['name'];}}ami[_0x3b90('0x19')]({'action':_0x3b90('0x1a'),'interface':_0x1efe01,'paused':!![],'reason':_0x131f3f})[_0x3b90('0x1b')](function(_0x3ce411){if(_0x1af265[_0x3b90('0x8')][_0x1efe01]){return RpcUser[_0x3b90('0x1c')](_0x1af265[_0x3b90('0x8')][_0x1efe01]['id'])[_0x3b90('0x1b')](function(_0xa98414){if(_0xa98414&&!_0xa98414[_0x3b90('0x1d')]){logger['info'](_0x3b90('0x1e'),_0x381a9e,_0x1efe01,_0xd83280);var _0x36b93e=_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x1f')]&&_0x1af265[_0x3b90('0x15')][_0x381a9e][_0x3b90('0x20')]?_0x1af265['channels'][_0x381a9e]['destlinkedid']:_0x381a9e;return RpcUser[_0x3b90('0x21')](_0x1af265[_0x3b90('0x8')][_0x1efe01],_0x131f3f,_0x36b93e)[_0x3b90('0x1b')](function(_0x2ffa1a){if(!_0x11ad7d){_0x1af265['timers'][_0x1efe01]={};logger[_0x3b90('0x22')](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280]['acwTimeout'],_0x1efe01,_0xd83280);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=setTimeout(_0x1af265[_0x3b90('0x25')][_0x3b90('0xc')](_0x1af265,_0x1efe01),_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')]*0x3e8);_0x1af265['timers'][_0x1efe01][_0x3b90('0x27')]=moment()['format'](_0x3b90('0x28'));_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x29')]=_0x381a9e;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2a')]=_0xd83280;_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x2b')]=function(){var _0x2430ec=getDiff(_0x1af265['timers'][_0x1efe01]['lastPauseAt']);clearTimeout(_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]);_0x1af265[_0x3b90('0x9')][_0x1efe01][_0x3b90('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2430ec},_0x1af265['timers'][_0x1efe01][_0x3b90('0x29')],_0x1efe01)[_0x3b90('0x1b')](function(_0x24d5c9){logger['info'](_0x3b90('0x2c'),_0x381a9e,_0x2430ec,_0x24d5c9);})['catch'](function(_0x49b4d2){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x381a9e,_0x49b4d2);});delete _0x1af265['timers'][_0x1efe01];};}});}else{logger[_0x3b90('0x22')](_0x3b90('0x2f'),_0x381a9e,_0x1efe01,_0xd83280);}});}})[_0x3b90('0x30')](function(_0x562882){logger['error'](_0x3b90('0x23'),_0x381a9e,_0x1af265[_0x3b90('0x7')][_0xd83280][_0x3b90('0x26')],_0x1efe01,_0xd83280);})[_0x3b90('0x31')](function(){delete _0x1af265['channels'][_0x381a9e];});}catch(_0x5a97fe){logger[_0x3b90('0x2d')](_0x3b90('0x32'),_0x5a97fe['message']);}};Acw['prototype'][_0x3b90('0x25')]=function(_0x146bc7){try{var _0x20416d=this;if(_0x20416d[_0x3b90('0x9')][_0x146bc7]){_0x20416d['timers'][_0x146bc7][_0x3b90('0x24')]=![];var _0x583842=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x29')];var _0x2355bf=_0x20416d[_0x3b90('0x9')][_0x146bc7][_0x3b90('0x2a')];var _0x3bf148=_0x20416d[_0x3b90('0x7')][_0x2355bf]['acwTimeout'];logger[_0x3b90('0x22')](_0x3b90('0x33'),_0x146bc7);RpcUser[_0x3b90('0x34')](this[_0x3b90('0x8')][_0x146bc7]);RpcVoiceAgentReport[_0x3b90('0x35')]({'acwtime':_0x3bf148,'agentacw':!![]},_0x583842,_0x146bc7)[_0x3b90('0x1b')](function(_0x63c44e){logger[_0x3b90('0x22')](_0x3b90('0x2c'),_0x583842,_0x3bf148,_0x63c44e);})['catch'](function(_0x369d0d){logger[_0x3b90('0x2d')](_0x3b90('0x2e'),_0x583842,_0x369d0d);});}else{logger[_0x3b90('0x2d')](_0x3b90('0x36'),_0x146bc7);if(_0x20416d[_0x3b90('0x9')]){logger[_0x3b90('0x22')](_0x3b90('0x37'),JSON[_0x3b90('0x38')](_0x20416d[_0x3b90('0x9')]));}}}catch(_0x47592a){logger[_0x3b90('0x2d')](_0x3b90('0x39'),_0x47592a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xb')]=function(_0x3a27cf){try{if(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]]['acw']||this[_0x3b90('0x7')][_0x3a27cf[_0x3b90('0x2a')]][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3a27cf['interface']]){this[_0x3b90('0x15')][_0x3a27cf['uniqueid']]={'queue':_0x3a27cf['queue'],'interface':_0x3a27cf[_0x3b90('0x3b')],'destlinkedid':_0x3a27cf[_0x3b90('0x20')]};}}}catch(_0x49187d){logger[_0x3b90('0x2d')](_0x3b90('0x3c'),_0x49187d[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3d')]=function(_0x3fd5a1){try{if(this[_0x3b90('0x7')][_0x3fd5a1[_0x3b90('0x2a')]]&&(this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x4')]||this[_0x3b90('0x7')][_0x3fd5a1['queue']][_0x3b90('0x16')])){if(this[_0x3b90('0x8')][_0x3fd5a1[_0x3b90('0x3b')]]){this[_0x3b90('0x15')][_0x3fd5a1[_0x3b90('0x29')]]={'queue':_0x3fd5a1['queue'],'interface':_0x3fd5a1['interface']};}}}catch(_0x4034a3){logger['error'](_0x3b90('0x3e'),_0x4034a3[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0x3f')]=function(_0x177234){try{if(this['channels'][_0x177234['uniqueid']]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234[_0x3b90('0x29')]]['attended'])){logger[_0x3b90('0x22')](_0x3b90('0x41'),_0x177234[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x177234[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x177234[_0x3b90('0x42')]]&&_[_0x3b90('0x40')](this[_0x3b90('0x15')][_0x177234['linkedid']][_0x3b90('0x1f')])){logger[_0x3b90('0x22')](_0x3b90('0x43'),_0x177234['linkedid']);this[_0x3b90('0x14')](_0x177234['linkedid']);}}catch(_0x288fbb){logger[_0x3b90('0x2d')](_0x3b90('0x44'),_0x288fbb['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x45')]=function(_0x5334b5){try{if(this['channels'][_0x5334b5[_0x3b90('0x29')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x29')]][_0x3b90('0x1f')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5334b5[_0x3b90('0x29')]);this[_0x3b90('0x14')](_0x5334b5[_0x3b90('0x29')]);}else if(this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]]&&this[_0x3b90('0x15')][_0x5334b5[_0x3b90('0x42')]][_0x3b90('0x1f')]){logger[_0x3b90('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5334b5[_0x3b90('0x42')]);this[_0x3b90('0x14')](_0x5334b5['linkedid']);}}catch(_0x1d211a){logger[_0x3b90('0x2d')]('[ACW][syncHangup]\x20%s',_0x1d211a[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xf')]=function(_0x1bada9){try{if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]])){this['startAcw'](_0x1bada9[_0x3b90('0x47')]);if(this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]]=this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x48')]];}}else if(!_[_0x3b90('0x46')](this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x49')]])){this['startAcw'](_0x1bada9[_0x3b90('0x49')]);if(this['channels'][_0x1bada9[_0x3b90('0x4a')]]){this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]][_0x3b90('0x1f')]=!![];this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x47')]]=this['channels'][_0x1bada9[_0x3b90('0x4a')]];delete this[_0x3b90('0x15')][_0x1bada9[_0x3b90('0x4a')]];}}}catch(_0x8e1229){logger[_0x3b90('0x2d')](_0x3b90('0x4b'),_0x8e1229['message']);}};Acw[_0x3b90('0x13')][_0x3b90('0x10')]=function(_0xb41920){try{if(this['channels'][_0xb41920[_0x3b90('0x4c')]]){logger[_0x3b90('0x22')](_0x3b90('0x4d'),JSON[_0x3b90('0x38')](_0xb41920[_0x3b90('0x4c')]));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4c')]);}else if(this[_0x3b90('0x15')][_0xb41920[_0x3b90('0x4e')]]){logger['info'](_0x3b90('0x4f'),JSON['stringify'](_0xb41920['transfererlinkedid']));this[_0x3b90('0x14')](_0xb41920[_0x3b90('0x4e')]);}}catch(_0x52c099){logger[_0x3b90('0x2d')](_0x3b90('0x50'),_0x52c099[_0x3b90('0x3a')]);}};Acw[_0x3b90('0x13')][_0x3b90('0xe')]=function(_0x260de4){try{if(this[_0x3b90('0x7')][_0x260de4['queue']]&&this['voiceQueues'][_0x260de4[_0x3b90('0x2a')]]['autopause']===_0x3b90('0x51')){if(this['agents'][_0x260de4[_0x3b90('0x3b')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x260de4['uniqueid'],_0x260de4[_0x3b90('0x3b')],_0x260de4[_0x3b90('0x2a')]);return RpcUser[_0x3b90('0x21')](this[_0x3b90('0x8')][_0x260de4[_0x3b90('0x3b')]],_0x3b90('0x52'),_0x260de4[_0x3b90('0x29')]);}}}catch(_0x490fd1){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x490fd1[_0x3b90('0x3a')]);}};module[_0x3b90('0x53')]=Acw; \ No newline at end of file +var _0x84ab=['attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','isUndefined','[%s][HANGUP:LINKEDID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x39b6ed,_0x1fbbb6){var _0x248244=function(_0x52caee){while(--_0x52caee){_0x39b6ed['push'](_0x39b6ed['shift']());}};_0x248244(++_0x1fbbb6);}(_0x84ab,0x12f));var _0xb84a=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x84ab[_0x1ba43c];return _0x2f60eb;};'use strict';var util=require(_0xb84a('0x0'));var _=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var ami=require(_0xb84a('0x3'));var logger=require(_0xb84a('0x4'))('acw');var RpcUser=require(_0xb84a('0x5'));var RpcVoiceAgentReport=require(_0xb84a('0x6'));function Acw(_0x47b8e3){this[_0xb84a('0x7')]=_0x47b8e3[_0xb84a('0x7')];this[_0xb84a('0x8')]=_0x47b8e3['agents'];this['timers']=_0x47b8e3['timers'];this[_0xb84a('0x9')]={};ami['on']('agentconnect',this[_0xb84a('0xa')][_0xb84a('0xb')](this));ami['on']('hanguprequest',this[_0xb84a('0xc')]['bind'](this));ami['on'](_0xb84a('0xd'),this[_0xb84a('0xe')][_0xb84a('0xb')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xb84a('0xf'),this[_0xb84a('0x10')][_0xb84a('0xb')](this));ami['on'](_0xb84a('0x11'),this[_0xb84a('0x12')]['bind'](this));ami['on'](_0xb84a('0x13'),this[_0xb84a('0x14')][_0xb84a('0xb')](this));}function getDiff(_0x3c161c){var _0x44b26b=moment()[_0xb84a('0x15')](0x0);var _0x12ccab=moment(_0x3c161c)[_0xb84a('0x15')](0x0);return _0x44b26b[_0xb84a('0x16')](_0x12ccab,_0xb84a('0x17'));}Acw[_0xb84a('0x18')][_0xb84a('0x19')]=function(_0x5716bd){try{var _0x11dd4d=this;var _0x4a691d=this[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x1a')];var _0x1c7378=this[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x1b')];var _0x34d82f=this[_0xb84a('0x7')][_0x1c7378];var _0x3f7437=![];var _0x11d5a0=_0xb84a('0x1c');if(_0x34d82f[_0xb84a('0x1d')]){if(_0x34d82f[_0xb84a('0x1e')]['name']){_0x3f7437=!![];_0x11d5a0=_0x34d82f[_0xb84a('0x1e')][_0xb84a('0x1f')];}}ami['Action']({'action':_0xb84a('0x20'),'interface':_0x4a691d,'paused':!![],'reason':_0x11d5a0})[_0xb84a('0x21')](function(_0x42c788){if(_0x11dd4d[_0xb84a('0x8')][_0x4a691d]){return RpcUser['getAgent'](_0x11dd4d['agents'][_0x4a691d]['id'])[_0xb84a('0x21')](function(_0x19097d){if(_0x19097d&&!_0x19097d[_0xb84a('0x22')]){logger[_0xb84a('0x23')](_0xb84a('0x24'),_0x5716bd,_0x4a691d,_0x1c7378);var _0x3b8fb2=_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x25')]&&_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x26')]?_0x11dd4d[_0xb84a('0x9')][_0x5716bd][_0xb84a('0x26')]:_0x5716bd;return RpcUser[_0xb84a('0x27')](_0x11dd4d[_0xb84a('0x8')][_0x4a691d],_0x11d5a0,_0x3b8fb2)[_0xb84a('0x21')](function(_0x3258a9){if(!_0x3f7437){_0x11dd4d[_0xb84a('0x28')][_0x4a691d]={};logger[_0xb84a('0x23')](_0xb84a('0x29'),_0x5716bd,_0x11dd4d[_0xb84a('0x7')][_0x1c7378][_0xb84a('0x2a')],_0x4a691d,_0x1c7378);_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]=setTimeout(_0x11dd4d[_0xb84a('0x2c')][_0xb84a('0xb')](_0x11dd4d,_0x4a691d),_0x11dd4d[_0xb84a('0x7')][_0x1c7378]['acwTimeout']*0x3e8);_0x11dd4d['timers'][_0x4a691d][_0xb84a('0x2d')]=moment()[_0xb84a('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2f')]=_0x5716bd;_0x11dd4d['timers'][_0x4a691d]['queue']=_0x1c7378;_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x30')]=function(){var _0x49ba3d=getDiff(_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2d')]);clearTimeout(_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]);_0x11dd4d[_0xb84a('0x28')][_0x4a691d][_0xb84a('0x2b')]=![];RpcVoiceAgentReport[_0xb84a('0x31')]({'acwtime':_0x49ba3d},_0x11dd4d[_0xb84a('0x28')][_0x4a691d]['uniqueid'],_0x4a691d)[_0xb84a('0x21')](function(_0x5b794f){logger['info'](_0xb84a('0x32'),_0x5716bd,_0x49ba3d,_0x5b794f);})[_0xb84a('0x33')](function(_0x47a5b6){logger['error'](_0xb84a('0x34'),_0x5716bd,_0x47a5b6);});delete _0x11dd4d[_0xb84a('0x28')][_0x4a691d];};}});}else{logger[_0xb84a('0x23')](_0xb84a('0x35'),_0x5716bd,_0x4a691d,_0x1c7378);}});}})[_0xb84a('0x33')](function(_0x1d7ef1){logger[_0xb84a('0x36')](_0xb84a('0x29'),_0x5716bd,_0x11dd4d['voiceQueues'][_0x1c7378][_0xb84a('0x2a')],_0x4a691d,_0x1c7378);})[_0xb84a('0x37')](function(){delete _0x11dd4d[_0xb84a('0x9')][_0x5716bd];});}catch(_0xf894a6){logger[_0xb84a('0x36')](_0xb84a('0x38'),_0xf894a6[_0xb84a('0x39')]);}};Acw['prototype'][_0xb84a('0x2c')]=function(_0x56d783){try{var _0x1a3115=this;if(_0x1a3115[_0xb84a('0x28')][_0x56d783]){_0x1a3115[_0xb84a('0x28')][_0x56d783]['timer']=![];var _0x4af084=_0x1a3115[_0xb84a('0x28')][_0x56d783][_0xb84a('0x2f')];var _0x4a3737=_0x1a3115[_0xb84a('0x28')][_0x56d783][_0xb84a('0x1b')];var _0x4cb5d4=_0x1a3115[_0xb84a('0x7')][_0x4a3737][_0xb84a('0x2a')];logger['info'](_0xb84a('0x3a'),_0x56d783);RpcUser[_0xb84a('0x3b')](this[_0xb84a('0x8')][_0x56d783]);RpcVoiceAgentReport[_0xb84a('0x31')]({'acwtime':_0x4cb5d4,'agentacw':!![]},_0x4af084,_0x56d783)['then'](function(_0x57a1a8){logger['info'](_0xb84a('0x32'),_0x4af084,_0x4cb5d4,_0x57a1a8);})[_0xb84a('0x33')](function(_0x43a071){logger[_0xb84a('0x36')]('[%s][UPDATE][ERRORS:%s]',_0x4af084,_0x43a071);});}else{logger[_0xb84a('0x36')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x56d783);if(_0x1a3115[_0xb84a('0x28')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x1a3115[_0xb84a('0x28')]));}}}catch(_0x22791f){logger[_0xb84a('0x36')](_0xb84a('0x3c'),_0x22791f['message']);}};Acw[_0xb84a('0x18')][_0xb84a('0xa')]=function(_0x3908c3){try{if(this[_0xb84a('0x7')][_0x3908c3['queue']]&&(this['voiceQueues'][_0x3908c3[_0xb84a('0x1b')]][_0xb84a('0x3d')]||this['voiceQueues'][_0x3908c3[_0xb84a('0x1b')]][_0xb84a('0x1d')])){if(this[_0xb84a('0x8')][_0x3908c3[_0xb84a('0x1a')]]){this[_0xb84a('0x9')][_0x3908c3[_0xb84a('0x2f')]]={'queue':_0x3908c3[_0xb84a('0x1b')],'interface':_0x3908c3[_0xb84a('0x1a')],'destlinkedid':_0x3908c3[_0xb84a('0x26')]};}}}catch(_0xcd1e3b){logger[_0xb84a('0x36')](_0xb84a('0x3e'),_0xcd1e3b[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x14')]=function(_0x4ad7d0){try{if(this[_0xb84a('0x7')][_0x4ad7d0[_0xb84a('0x1b')]]&&(this[_0xb84a('0x7')][_0x4ad7d0[_0xb84a('0x1b')]][_0xb84a('0x3d')]||this[_0xb84a('0x7')][_0x4ad7d0['queue']][_0xb84a('0x1d')])){if(this['agents'][_0x4ad7d0[_0xb84a('0x1a')]]){this[_0xb84a('0x9')][_0x4ad7d0[_0xb84a('0x2f')]]={'queue':_0x4ad7d0[_0xb84a('0x1b')],'interface':_0x4ad7d0['interface']};}}}catch(_0x21ef72){logger[_0xb84a('0x36')](_0xb84a('0x3f'),_0x21ef72['message']);}};Acw['prototype'][_0xb84a('0xc')]=function(_0x10b0cc){try{if(this[_0xb84a('0x9')][_0x10b0cc['uniqueid']]&&_['isUndefined'](this['channels'][_0x10b0cc[_0xb84a('0x2f')]][_0xb84a('0x25')])){logger[_0xb84a('0x23')](_0xb84a('0x40'),_0x10b0cc[_0xb84a('0x2f')]);this['startAcw'](_0x10b0cc['uniqueid']);}else if(this['channels'][_0x10b0cc['linkedid']]&&_[_0xb84a('0x41')](this[_0xb84a('0x9')][_0x10b0cc['linkedid']][_0xb84a('0x25')])){logger[_0xb84a('0x23')](_0xb84a('0x42'),_0x10b0cc[_0xb84a('0x43')]);this[_0xb84a('0x19')](_0x10b0cc[_0xb84a('0x43')]);}}catch(_0x5a07d2){logger['error'](_0xb84a('0x44'),_0x5a07d2['message']);}};Acw[_0xb84a('0x18')]['syncHangup']=function(_0x575908){try{if(this['channels'][_0x575908[_0xb84a('0x2f')]]&&this[_0xb84a('0x9')][_0x575908[_0xb84a('0x2f')]][_0xb84a('0x25')]){logger[_0xb84a('0x23')](_0xb84a('0x45'),_0x575908[_0xb84a('0x2f')]);this[_0xb84a('0x19')](_0x575908['uniqueid']);}else if(this['channels'][_0x575908['linkedid']]&&this[_0xb84a('0x9')][_0x575908[_0xb84a('0x43')]]['attended']){logger[_0xb84a('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x575908['linkedid']);this['startAcw'](_0x575908[_0xb84a('0x43')]);}}catch(_0x172076){logger[_0xb84a('0x36')]('[ACW][syncHangup]\x20%s',_0x172076[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x10')]=function(_0x505994){try{if(!_[_0xb84a('0x46')](this['channels'][_0x505994['transfereeuniqueid']])){this[_0xb84a('0x19')](_0x505994['transfereeuniqueid']);if(this[_0xb84a('0x9')][_0x505994['secondtransfereruniqueid']]){this[_0xb84a('0x9')][_0x505994[_0xb84a('0x47')]][_0xb84a('0x25')]=!![];this[_0xb84a('0x9')][_0x505994['transfertargetuniqueid']]=this['channels'][_0x505994['secondtransfereruniqueid']];delete this[_0xb84a('0x9')][_0x505994[_0xb84a('0x47')]];}}else if(!_['isNil'](this['channels'][_0x505994[_0xb84a('0x48')]])){this[_0xb84a('0x19')](_0x505994[_0xb84a('0x48')]);if(this['channels'][_0x505994[_0xb84a('0x49')]]){this[_0xb84a('0x9')][_0x505994['origtransfereruniqueid']][_0xb84a('0x25')]=!![];this[_0xb84a('0x9')][_0x505994[_0xb84a('0x4a')]]=this[_0xb84a('0x9')][_0x505994[_0xb84a('0x49')]];delete this[_0xb84a('0x9')][_0x505994[_0xb84a('0x49')]];}}}catch(_0x47c27f){logger[_0xb84a('0x36')](_0xb84a('0x4b'),_0x47c27f['message']);}};Acw[_0xb84a('0x18')][_0xb84a('0x12')]=function(_0x34ac0f){try{if(this[_0xb84a('0x9')][_0x34ac0f[_0xb84a('0x4c')]]){logger[_0xb84a('0x23')](_0xb84a('0x4d'),JSON[_0xb84a('0x4e')](_0x34ac0f[_0xb84a('0x4c')]));this['startAcw'](_0x34ac0f[_0xb84a('0x4c')]);}else if(this['channels'][_0x34ac0f['transfererlinkedid']]){logger[_0xb84a('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xb84a('0x4e')](_0x34ac0f['transfererlinkedid']));this[_0xb84a('0x19')](_0x34ac0f[_0xb84a('0x4f')]);}}catch(_0x4c7d56){logger[_0xb84a('0x36')](_0xb84a('0x50'),_0x4c7d56[_0xb84a('0x39')]);}};Acw[_0xb84a('0x18')][_0xb84a('0x51')]=function(_0x192c9a){try{if(this[_0xb84a('0x7')][_0x192c9a['queue']]&&this[_0xb84a('0x7')][_0x192c9a['queue']]['autopause']===_0xb84a('0x52')){if(this[_0xb84a('0x8')][_0x192c9a[_0xb84a('0x1a')]]){logger[_0xb84a('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x192c9a['uniqueid'],_0x192c9a[_0xb84a('0x1a')],_0x192c9a[_0xb84a('0x1b')]);return RpcUser[_0xb84a('0x27')](this[_0xb84a('0x8')][_0x192c9a['interface']],_0xb84a('0x53'),_0x192c9a['uniqueid']);}}}catch(_0x1eec1f){logger['error'](_0xb84a('0x54'),_0x1eec1f['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 0bfb23e..016a0cc 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 _0xeb62=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','resolve','then','actionSipPeerStatus','actionQueueSummary','log','close','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','coreshowchannels','info','once'];(function(_0x6030e6,_0x5ef878){var _0x433894=function(_0x2cef40){while(--_0x2cef40){_0x6030e6['push'](_0x6030e6['shift']());}};_0x433894(++_0x5ef878);}(_0xeb62,0x1f3));var _0x2eb6=function(_0x38d8f0,_0x178e91){_0x38d8f0=_0x38d8f0-0x0;var _0x502691=_0xeb62[_0x38d8f0];return _0x502691;};'use strict';var Manager=require(_0x2eb6('0x0'));var BPromise=require(_0x2eb6('0x1'));var moment=require(_0x2eb6('0x2'));var util=require(_0x2eb6('0x3'));var _=require(_0x2eb6('0x4'));var logger=require(_0x2eb6('0x5'))('ami');var config=require(_0x2eb6('0x6'));var ami=new Manager(config['asterisk'][_0x2eb6('0x7')],config[_0x2eb6('0x8')]['ip'],config['asterisk'][_0x2eb6('0x9')],config[_0x2eb6('0x8')]['password'],!![]);ami[_0x2eb6('0xa')]();ami[_0x2eb6('0xb')]=BPromise[_0x2eb6('0xc')](ami[_0x2eb6('0xd')]);function error(_0x5617ce){logger[_0x2eb6('0xe')](util[_0x2eb6('0xf')](_0x2eb6('0x10'),config[_0x2eb6('0x8')]['username'],config[_0x2eb6('0x8')]['ip'],config[_0x2eb6('0x8')][_0x2eb6('0x7')],util[_0x2eb6('0x11')](_0x5617ce,![],null)));}function close(){logger['error'](util[_0x2eb6('0xf')](_0x2eb6('0x12'),config[_0x2eb6('0x8')][_0x2eb6('0x9')],config[_0x2eb6('0x8')]['ip'],config['asterisk'][_0x2eb6('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2eb6('0xb')]({'action':_0x2eb6('0x13')});};};ami[_0x2eb6('0x14')]=function(){return function(){return ami[_0x2eb6('0xb')]({'action':_0x2eb6('0x15')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x2eb6('0xb')]({'action':_0x2eb6('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x2eb6('0xb')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x2eb6('0xb')]({'action':_0x2eb6('0x17')});};};function connect(_0x158455){logger[_0x2eb6('0x18')](util[_0x2eb6('0xf')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x2eb6('0x8')]['username'],config[_0x2eb6('0x8')]['ip'],config[_0x2eb6('0x8')][_0x2eb6('0x7')]));ami[_0x2eb6('0x19')]('error',error);ami['once']('close',close);}ami['on'](_0x2eb6('0x1a'),connect);ami['on'](_0x2eb6('0x1b'),function(_0x596f63){logger[_0x2eb6('0x18')](util[_0x2eb6('0xf')](_0x2eb6('0x1c'),config['asterisk'][_0x2eb6('0x9')],config[_0x2eb6('0x8')]['ip'],config[_0x2eb6('0x8')]['port'],util[_0x2eb6('0x11')](_0x596f63,![],null)));});ami['on']('fullybooted',function(_0x28ba02){logger[_0x2eb6('0x18')](util[_0x2eb6('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x2eb6('0x8')][_0x2eb6('0x9')],config[_0x2eb6('0x8')]['ip'],config[_0x2eb6('0x8')][_0x2eb6('0x7')]));return BPromise[_0x2eb6('0x1d')]()[_0x2eb6('0x1e')](ami['actionSipShowRegistry']())['then'](ami[_0x2eb6('0x14')]())[_0x2eb6('0x1e')](ami[_0x2eb6('0x1f')]())[_0x2eb6('0x1e')](ami[_0x2eb6('0x20')]())[_0x2eb6('0x1e')](ami['actionCoreShowChannels']())['catch'](function(_0x10bcd4){console[_0x2eb6('0x21')](_0x10bcd4);});});ami[_0x2eb6('0x19')]('error',error);ami[_0x2eb6('0x19')](_0x2eb6('0x22'),close);module['exports']=ami; \ No newline at end of file +var _0xab56=['actionSipPeerStatus','catch','log','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','asterisk','username','password','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','actionCoreShowChannels','info','port','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then'];(function(_0x5cf4cb,_0x4b5144){var _0x37d15a=function(_0x3702f1){while(--_0x3702f1){_0x5cf4cb['push'](_0x5cf4cb['shift']());}};_0x37d15a(++_0x4b5144);}(_0xab56,0x16b));var _0x6ab5=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xab56[_0x139a3c];return _0x2b375b;};'use strict';var Manager=require(_0x6ab5('0x0'));var BPromise=require(_0x6ab5('0x1'));var moment=require('moment');var util=require(_0x6ab5('0x2'));var _=require(_0x6ab5('0x3'));var logger=require(_0x6ab5('0x4'))(_0x6ab5('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x6ab5('0x6')]['port'],config[_0x6ab5('0x6')]['ip'],config[_0x6ab5('0x6')][_0x6ab5('0x7')],config['asterisk'][_0x6ab5('0x8')],!![]);ami['keepConnected']();ami[_0x6ab5('0x9')]=BPromise['promisify'](ami[_0x6ab5('0xa')]);function error(_0x5e8813){logger[_0x6ab5('0xb')](util[_0x6ab5('0xc')](_0x6ab5('0xd'),config[_0x6ab5('0x6')][_0x6ab5('0x7')],config[_0x6ab5('0x6')]['ip'],config[_0x6ab5('0x6')]['port'],util['inspect'](_0x5e8813,![],null)));}function close(){logger[_0x6ab5('0xb')](util[_0x6ab5('0xc')](_0x6ab5('0xe'),config[_0x6ab5('0x6')][_0x6ab5('0x7')],config['asterisk']['ip'],config[_0x6ab5('0x6')]['port']));}ami[_0x6ab5('0xf')]=function(){return function(){return ami['Action']({'action':_0x6ab5('0x10')});};};ami[_0x6ab5('0x11')]=function(){return function(){return ami[_0x6ab5('0x9')]({'action':_0x6ab5('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x6ab5('0x9')]({'action':'sippeerstatus'});};};ami[_0x6ab5('0x13')]=function(){return function(){return ami[_0x6ab5('0x9')]({'action':_0x6ab5('0x14')});};};ami[_0x6ab5('0x15')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0x448103){logger[_0x6ab5('0x16')](util[_0x6ab5('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x6ab5('0x6')]['username'],config[_0x6ab5('0x6')]['ip'],config[_0x6ab5('0x6')][_0x6ab5('0x17')]));ami[_0x6ab5('0x18')](_0x6ab5('0xb'),error);ami[_0x6ab5('0x18')](_0x6ab5('0x19'),close);}ami['on'](_0x6ab5('0x1a'),connect);ami['on'](_0x6ab5('0x1b'),function(_0x363e89){logger[_0x6ab5('0x16')](util['format'](_0x6ab5('0x1c'),config['asterisk'][_0x6ab5('0x7')],config[_0x6ab5('0x6')]['ip'],config[_0x6ab5('0x6')][_0x6ab5('0x17')],util['inspect'](_0x363e89,![],null)));});ami['on'](_0x6ab5('0x1d'),function(_0x3e5bb4){logger['info'](util['format'](_0x6ab5('0x1e'),config[_0x6ab5('0x6')][_0x6ab5('0x7')],config[_0x6ab5('0x6')]['ip'],config[_0x6ab5('0x6')]['port']));return BPromise[_0x6ab5('0x1f')]()[_0x6ab5('0x20')](ami[_0x6ab5('0xf')]())[_0x6ab5('0x20')](ami[_0x6ab5('0x11')]())[_0x6ab5('0x20')](ami[_0x6ab5('0x21')]())[_0x6ab5('0x20')](ami['actionQueueSummary']())['then'](ami[_0x6ab5('0x15')]())[_0x6ab5('0x22')](function(_0x509c56){console[_0x6ab5('0x23')](_0x509c56);});});ami[_0x6ab5('0x18')](_0x6ab5('0xb'),error);ami[_0x6ab5('0x18')](_0x6ab5('0x19'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5ed27c6..01f3840 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 _0xc179=['http','Request','request','then','debug','rpc','error','message','result','catch','memberReport','exports','jayson/promise','bluebird','../../config/logger','ami','client'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xc179,0x171));var _0x9c17=function(_0x40453a,_0x1ff061){_0x40453a=_0x40453a-0x0;var _0x2da74d=_0xc179[_0x40453a];return _0x2da74d;};'use strict';var jayson=require(_0x9c17('0x0'));var BPromise=require(_0x9c17('0x1'));var logger=require(_0x9c17('0x2'))(_0x9c17('0x3'));var client=jayson[_0x9c17('0x4')][_0x9c17('0x5')]({'port':0x2329});client[_0x9c17('0x6')]=function(_0x25f619,_0xaf4923){return new BPromise(function(_0x2a2773,_0x243aa0){return client[_0x9c17('0x7')](_0x25f619,_0xaf4923)[_0x9c17('0x8')](function(_0x4284a3){logger[_0x9c17('0x9')](_0x9c17('0xa'),'memberReport',_0x25f619,_0xaf4923,_0x4284a3);if(_0x4284a3['error']){logger[_0x9c17('0xb')](_0x9c17('0xa'),'memberReport',_0x25f619,_0x4284a3[_0x9c17('0xb')][_0x9c17('0xc')],_0xaf4923);return _0x243aa0(_0x4284a3[_0x9c17('0xb')][_0x9c17('0xc')]);}else{return _0x2a2773(_0x4284a3[_0x9c17('0xd')]);}})[_0x9c17('0xe')](function(_0x3f338c){logger[_0x9c17('0xb')](_0x9c17('0xa'),_0x9c17('0xf'),_0x25f619,_0x3f338c,_0xaf4923);return _0x243aa0(_0x3f338c);});});};module[_0x9c17('0x10')]=client; \ No newline at end of file +var _0xf08b=['then','debug','rpc','error','memberReport','message','catch','bluebird','../../config/logger','ami','client','Request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf08b,0xbb));var _0xbf08=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf08b[_0x2c91e9];return _0x13f0ff;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xbf08('0x0'));var logger=require(_0xbf08('0x1'))(_0xbf08('0x2'));var client=jayson[_0xbf08('0x3')]['http']({'port':0x2329});client[_0xbf08('0x4')]=function(_0x29ce5a,_0x57b78a){return new BPromise(function(_0x23bb32,_0x30f660){return client['request'](_0x29ce5a,_0x57b78a)[_0xbf08('0x5')](function(_0x35ec1d){logger[_0xbf08('0x6')](_0xbf08('0x7'),'memberReport',_0x29ce5a,_0x57b78a,_0x35ec1d);if(_0x35ec1d[_0xbf08('0x8')]){logger['error'](_0xbf08('0x7'),_0xbf08('0x9'),_0x29ce5a,_0x35ec1d['error'][_0xbf08('0xa')],_0x57b78a);return _0x30f660(_0x35ec1d[_0xbf08('0x8')][_0xbf08('0xa')]);}else{return _0x23bb32(_0x35ec1d['result']);}})[_0xbf08('0xb')](function(_0x386926){logger['error']('rpc',_0xbf08('0x9'),_0x29ce5a,_0x386926,_0x57b78a);return _0x30f660(_0x386926);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 7e2a7be..7ebb972 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 _0x6554=['moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','queue','exports','util','lodash'];(function(_0x58c50e,_0x573495){var _0x4a8199=function(_0x2f237c){while(--_0x2f237c){_0x58c50e['push'](_0x58c50e['shift']());}};_0x4a8199(++_0x573495);}(_0x6554,0x181));var _0x4655=function(_0x58d6ac,_0x3c9aff){_0x58d6ac=_0x58d6ac-0x0;var _0x41fbdb=_0x6554[_0x58d6ac];return _0x41fbdb;};'use strict';var util=require(_0x4655('0x0'));var _=require(_0x4655('0x1'));var moment=require(_0x4655('0x2'));function checkNameSurname(_0x1c9a68,_0x175a7a,_0x2247d8){var _0x44d586='';if(!_[_0x4655('0x3')](_0x175a7a)&&_0x4655('0x4')===typeof _0x175a7a){_0x44d586+=_0x175a7a;}if(!_[_0x4655('0x3')](_0x2247d8)&&_0x4655('0x4')===typeof _0x2247d8){_0x44d586+='\x20'+_0x2247d8;}if(_0x44d586!==''){return _0x44d586;}return _0x1c9a68;}function Action(_0x139557,_0x48ba0c,_0x23df55){this[_0x4655('0x5')]=_0x139557;this[_0x4655('0x6')]=_0x23df55||undefined;this[_0x4655('0x7')]=checkNameSurname(_0x48ba0c[_0x4655('0x8')][_0x4655('0x9')],_0x48ba0c[_0x4655('0x8')][_0x4655('0xa')],_0x48ba0c[_0x4655('0x8')]['lastName']);this[_0x4655('0xb')]=_0x48ba0c[_0x4655('0x8')]['phone'];this['queue']=_0x139557['name'];this[_0x4655('0xc')]=_0x48ba0c[_0x4655('0xc')]||![];this[_0x4655('0xd')]=_0x139557[_0x4655('0xd')];this[_0x4655('0xe')]=_0x139557[_0x4655('0xe')]||0x3;this['scheduledat']=_0x48ba0c['scheduledat'];this[_0x4655('0xf')]=_0x48ba0c[_0x4655('0xf')];this[_0x4655('0x10')]=_0x48ba0c[_0x4655('0x10')];this[_0x4655('0x11')]=_0x48ba0c[_0x4655('0x11')];this[_0x4655('0x12')]=_0x48ba0c[_0x4655('0x12')];this[_0x4655('0x13')]=_0x48ba0c['countdropretry'];this[_0x4655('0x14')]=_0x48ba0c[_0x4655('0x14')];this['countmachineretry']=_0x48ba0c[_0x4655('0x15')];this[_0x4655('0x16')]=_0x48ba0c['countagentrejectretry'];this['ContactId']=_0x48ba0c['ContactId'];this[_0x4655('0x17')]=_0x48ba0c['ListId'];this[_0x4655('0x18')]=_0x48ba0c['UserId'];this['VoiceQueueId']=_0x48ba0c['VoiceQueueId'];this[_0x4655('0x19')]=_0x48ba0c[_0x4655('0x19')];this[_0x4655('0x1a')]=_0x48ba0c['id'];this[_0x4655('0x1b')]=_0x48ba0c['Contact'][_0x4655('0xa')]||'';this[_0x4655('0x1c')]=moment()[_0x4655('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4655('0x1e')]=_0x48ba0c[_0x4655('0x1e')];this[_0x4655('0x1f')]=_0x48ba0c[_0x4655('0x1f')];this[_0x4655('0x20')]=_0x48ba0c[_0x4655('0x20')];this[_0x4655('0x21')]=_0x48ba0c['recallme'];this[_0x4655('0x22')]='';this[_0x4655('0x23')]='';}Action['prototype'][_0x4655('0x24')]=function(){return util[_0x4655('0x1d')](_0x4655('0x25'),this['name'],this[_0x4655('0x5')][_0x4655('0x26')]>0x0?this[_0x4655('0xb')][_0x4655('0x27')](this[_0x4655('0x5')][_0x4655('0x26')]):this[_0x4655('0xb')]);};Action[_0x4655('0x28')]['getQueue']=function(){return this[_0x4655('0x29')];};module[_0x4655('0x2a')]=Action; \ No newline at end of file +var _0x306e=['util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x306e,0x13b));var _0xe306=function(_0x1200d7,_0x5866a5){_0x1200d7=_0x1200d7-0x0;var _0x384b47=_0x306e[_0x1200d7];return _0x384b47;};'use strict';var util=require(_0xe306('0x0'));var _=require(_0xe306('0x1'));var moment=require('moment');function checkNameSurname(_0x42088e,_0x3c71d2,_0x19ad5e){var _0x22f3fa='';if(!_[_0xe306('0x2')](_0x3c71d2)&&_0xe306('0x3')===typeof _0x3c71d2){_0x22f3fa+=_0x3c71d2;}if(!_[_0xe306('0x2')](_0x19ad5e)&&'string'===typeof _0x19ad5e){_0x22f3fa+='\x20'+_0x19ad5e;}if(_0x22f3fa!==''){return _0x22f3fa;}return _0x42088e;}function Action(_0x2ba3a8,_0x239ba,_0x575e2f){this[_0xe306('0x4')]=_0x2ba3a8;this[_0xe306('0x5')]=_0x575e2f||undefined;this[_0xe306('0x6')]=checkNameSurname(_0x239ba[_0xe306('0x7')][_0xe306('0x8')],_0x239ba[_0xe306('0x7')][_0xe306('0x9')],_0x239ba[_0xe306('0x7')][_0xe306('0xa')]);this['number']=_0x239ba[_0xe306('0x7')][_0xe306('0x8')];this[_0xe306('0xb')]=_0x2ba3a8[_0xe306('0x6')];this[_0xe306('0xc')]=_0x239ba[_0xe306('0xc')]||![];this[_0xe306('0xd')]=_0x2ba3a8['type'];this[_0xe306('0xe')]=_0x2ba3a8['dialQueueTimeout']||0x3;this[_0xe306('0xf')]=_0x239ba[_0xe306('0xf')];this[_0xe306('0x10')]=_0x239ba[_0xe306('0x10')];this[_0xe306('0x11')]=_0x239ba[_0xe306('0x11')];this[_0xe306('0x12')]=_0x239ba[_0xe306('0x12')];this[_0xe306('0x13')]=_0x239ba[_0xe306('0x13')];this[_0xe306('0x14')]=_0x239ba[_0xe306('0x14')];this['countabandonedretry']=_0x239ba[_0xe306('0x15')];this[_0xe306('0x16')]=_0x239ba['countmachineretry'];this[_0xe306('0x17')]=_0x239ba['countagentrejectretry'];this[_0xe306('0x18')]=_0x239ba[_0xe306('0x18')];this[_0xe306('0x19')]=_0x239ba[_0xe306('0x19')];this['UserId']=_0x239ba[_0xe306('0x1a')];this[_0xe306('0x1b')]=_0x239ba[_0xe306('0x1b')];this[_0xe306('0x1c')]=_0x239ba['CampaignId'];this['idHopper']=_0x239ba['id'];this[_0xe306('0x1d')]=_0x239ba['Contact'][_0xe306('0x9')]||'';this[_0xe306('0x1e')]=moment()['format'](_0xe306('0x1f'));this['callback']=_0x239ba[_0xe306('0x20')];this[_0xe306('0x21')]=_0x239ba[_0xe306('0x21')];this[_0xe306('0x22')]=_0x239ba[_0xe306('0x22')];this[_0xe306('0x23')]=_0x239ba[_0xe306('0x23')];this[_0xe306('0x24')]='';this['originatecalleridname']='';}Action[_0xe306('0x25')][_0xe306('0x26')]=function(){return util[_0xe306('0x27')](_0xe306('0x28'),this[_0xe306('0x6')],this['voiceQueue'][_0xe306('0x29')]>0x0?this[_0xe306('0x2a')][_0xe306('0x2b')](this[_0xe306('0x4')][_0xe306('0x29')]):this[_0xe306('0x2a')]);};Action[_0xe306('0x25')][_0xe306('0x2c')]=function(){return this[_0xe306('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 34f2794..f792156 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 _0xd4a8=['uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry'];(function(_0x52d4ad,_0x25e611){var _0x34a767=function(_0x1f3daa){while(--_0x1f3daa){_0x52d4ad['push'](_0x52d4ad['shift']());}};_0x34a767(++_0x25e611);}(_0xd4a8,0x7b));var _0x8d4a=function(_0x130d34,_0xb829c2){_0x130d34=_0x130d34-0x0;var _0x3bf5d2=_0xd4a8[_0x130d34];return _0x3bf5d2;};'use strict';var util=require(_0x8d4a('0x0'));var _=require(_0x8d4a('0x1'));var moment=require(_0x8d4a('0x2'));function getSeconds(_0x41999c,_0x212326){var _0x5b15bd=moment(_0x41999c)['milliseconds'](0x0);var _0x2b65c4=moment(_0x212326)[_0x8d4a('0x3')](0x0);return _0x5b15bd['diff'](_0x2b65c4,_0x8d4a('0x4'));}function AgentComplete(_0x34b9a2,_0x1ca72e){this['state']=0x4;this[_0x8d4a('0x5')]=_0x8d4a('0x6');this[_0x8d4a('0x7')]=_0x34b9a2[_0x8d4a('0x7')];this[_0x8d4a('0x8')]=_0x34b9a2['type'];this[_0x8d4a('0x9')]=_0x34b9a2['type']===_0x8d4a('0xa')?_0x8d4a('0xb'):_0x34b9a2[_0x8d4a('0x8')];this[_0x8d4a('0xc')]=_0x34b9a2[_0x8d4a('0xc')];this['countcongestionretry']=_0x34b9a2[_0x8d4a('0xd')];this[_0x8d4a('0xe')]=_0x34b9a2[_0x8d4a('0xe')];this[_0x8d4a('0xf')]=_0x34b9a2['countbusyretry']+_0x34b9a2[_0x8d4a('0xd')]+_0x34b9a2['countnoanswerretry']+_0x34b9a2[_0x8d4a('0x10')]+_0x34b9a2['countdropretry']+_0x34b9a2['countabandonedretry']+_0x34b9a2[_0x8d4a('0x11')]+_0x34b9a2[_0x8d4a('0x12')];this[_0x8d4a('0x10')]=_0x34b9a2[_0x8d4a('0x10')];this['countdropretry']=_0x34b9a2[_0x8d4a('0x13')];this[_0x8d4a('0x14')]=_0x34b9a2[_0x8d4a('0x14')];this[_0x8d4a('0x11')]=_0x34b9a2[_0x8d4a('0x11')];this[_0x8d4a('0x12')]=_0x34b9a2[_0x8d4a('0x12')];this[_0x8d4a('0x15')]=_0x1ca72e[_0x8d4a('0x15')];this[_0x8d4a('0x16')]=_0x34b9a2[_0x8d4a('0x17')];this[_0x8d4a('0x18')]=_0x34b9a2[_0x8d4a('0x19')];this[_0x8d4a('0x1a')]=_0x34b9a2['starttime'];this[_0x8d4a('0x1b')]=_0x34b9a2[_0x8d4a('0x1b')];this[_0x8d4a('0x1c')]=_0x34b9a2[_0x8d4a('0x1c')];this[_0x8d4a('0x1d')]=moment()[_0x8d4a('0x1e')](_0x8d4a('0x1f'));this[_0x8d4a('0x20')]=getSeconds(_0x34b9a2[_0x8d4a('0x1b')],_0x34b9a2[_0x8d4a('0x1a')]);this[_0x8d4a('0x21')]=getSeconds(_0x34b9a2['answertime'],_0x34b9a2[_0x8d4a('0x1b')]);this[_0x8d4a('0x22')]=getSeconds(this['endtime'],_0x34b9a2['answertime']);this['queue']=_0x1ca72e[_0x8d4a('0xb')];this['membername']=_0x1ca72e[_0x8d4a('0x23')];this[_0x8d4a('0x24')]=_0x1ca72e[_0x8d4a('0x24')];this[_0x8d4a('0x25')]=_0x34b9a2[_0x8d4a('0x25')];this[_0x8d4a('0x26')]=_0x34b9a2[_0x8d4a('0x26')];this['callbackat']=_0x34b9a2[_0x8d4a('0x27')];this[_0x8d4a('0x28')]=_0x34b9a2[_0x8d4a('0x28')];this['ContactId']=_0x34b9a2[_0x8d4a('0x29')];this[_0x8d4a('0x2a')]=_0x34b9a2[_0x8d4a('0x2a')];this[_0x8d4a('0x2b')]=_0x34b9a2[_0x8d4a('0x2b')];this[_0x8d4a('0x2c')]=_0x34b9a2['VoiceQueueId'];this[_0x8d4a('0x2d')]=_0x34b9a2[_0x8d4a('0x2d')];this[_0x8d4a('0x2e')]=_0x34b9a2[_0x8d4a('0x2e')]||'';this['originatecalleridname']=_0x34b9a2[_0x8d4a('0x2f')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0xd507=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','answertime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x10cccd,_0x34cb5c){var _0x59c7f8=function(_0xb6ff06){while(--_0xb6ff06){_0x10cccd['push'](_0x10cccd['shift']());}};_0x59c7f8(++_0x34cb5c);}(_0xd507,0x180));var _0x7d50=function(_0x1f2470,_0x235e3f){_0x1f2470=_0x1f2470-0x0;var _0xbfd8ab=_0xd507[_0x1f2470];return _0xbfd8ab;};'use strict';var util=require(_0x7d50('0x0'));var _=require(_0x7d50('0x1'));var moment=require('moment');function getSeconds(_0x43d266,_0x5d924e){var _0x15f667=moment(_0x43d266)['milliseconds'](0x0);var _0x28bbf6=moment(_0x5d924e)['milliseconds'](0x0);return _0x15f667[_0x7d50('0x2')](_0x28bbf6,'seconds');}function AgentComplete(_0x6115e3,_0x415829){this[_0x7d50('0x3')]=0x4;this[_0x7d50('0x4')]=_0x7d50('0x5');this[_0x7d50('0x6')]=_0x6115e3[_0x7d50('0x6')];this['type']=_0x6115e3[_0x7d50('0x7')];this[_0x7d50('0x8')]=_0x6115e3['type']===_0x7d50('0x9')?_0x7d50('0xa'):_0x6115e3[_0x7d50('0x7')];this['countbusyretry']=_0x6115e3[_0x7d50('0xb')];this[_0x7d50('0xc')]=_0x6115e3[_0x7d50('0xc')];this[_0x7d50('0xd')]=_0x6115e3[_0x7d50('0xd')];this[_0x7d50('0xe')]=_0x6115e3[_0x7d50('0xb')]+_0x6115e3[_0x7d50('0xc')]+_0x6115e3[_0x7d50('0xd')]+_0x6115e3[_0x7d50('0xf')]+_0x6115e3['countdropretry']+_0x6115e3['countabandonedretry']+_0x6115e3[_0x7d50('0x10')]+_0x6115e3[_0x7d50('0x11')];this['countnosuchnumberretry']=_0x6115e3[_0x7d50('0xf')];this[_0x7d50('0x12')]=_0x6115e3['countdropretry'];this[_0x7d50('0x13')]=_0x6115e3[_0x7d50('0x13')];this[_0x7d50('0x10')]=_0x6115e3[_0x7d50('0x10')];this[_0x7d50('0x11')]=_0x6115e3[_0x7d50('0x11')];this['uniqueid']=_0x415829[_0x7d50('0x14')];this[_0x7d50('0x15')]=_0x6115e3[_0x7d50('0x16')];this[_0x7d50('0x17')]=_0x6115e3['number'];this[_0x7d50('0x18')]=_0x6115e3[_0x7d50('0x18')];this[_0x7d50('0x19')]=_0x6115e3[_0x7d50('0x19')];this['answertime']=_0x6115e3['answertime'];this[_0x7d50('0x1a')]=moment()[_0x7d50('0x1b')](_0x7d50('0x1c'));this[_0x7d50('0x1d')]=getSeconds(_0x6115e3[_0x7d50('0x19')],_0x6115e3[_0x7d50('0x18')]);this[_0x7d50('0x1e')]=getSeconds(_0x6115e3[_0x7d50('0x1f')],_0x6115e3['responsetime']);this[_0x7d50('0x20')]=getSeconds(this['endtime'],_0x6115e3[_0x7d50('0x1f')]);this[_0x7d50('0xa')]=_0x415829[_0x7d50('0xa')];this['membername']=_0x415829['membername'];this[_0x7d50('0x21')]=_0x415829['reason'];this[_0x7d50('0x22')]=_0x6115e3[_0x7d50('0x22')];this['callbackuniqueid']=_0x6115e3[_0x7d50('0x23')];this['callbackat']=_0x6115e3[_0x7d50('0x24')];this['recallme']=_0x6115e3[_0x7d50('0x25')];this[_0x7d50('0x26')]=_0x6115e3[_0x7d50('0x26')];this['ListId']=_0x6115e3[_0x7d50('0x27')];this['UserId']=_0x6115e3['UserId'];this['VoiceQueueId']=_0x6115e3['VoiceQueueId'];this[_0x7d50('0x28')]=_0x6115e3[_0x7d50('0x28')];this[_0x7d50('0x29')]=_0x6115e3['originatecalleridnum']||'';this[_0x7d50('0x2a')]=_0x6115e3[_0x7d50('0x2a')]||'';}module[_0x7d50('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 1ee03c2..b17dc5f 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 _0x27f5=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x27f5,0xf4));var _0x527f=function(_0xe89d97,_0x33e5ac){_0xe89d97=_0xe89d97-0x0;var _0x1b6e5d=_0x27f5[_0xe89d97];return _0x1b6e5d;};'use strict';var util=require('util');var _=require(_0x527f('0x0'));var moment=require(_0x527f('0x1'));function getSeconds(_0x32fff9,_0x1d15bf){var _0x845ba9=moment(_0x32fff9)[_0x527f('0x2')](0x0);var _0x28017f=moment(_0x1d15bf)[_0x527f('0x2')](0x0);return _0x845ba9[_0x527f('0x3')](_0x28017f,'seconds');}function Final(_0x380db0){this[_0x527f('0x4')]=_0x380db0[_0x527f('0x4')];this[_0x527f('0x5')]=_0x380db0[_0x527f('0x5')];this[_0x527f('0x6')]=_0x380db0[_0x527f('0x6')];this[_0x527f('0x7')]=_0x380db0[_0x527f('0x6')]===_0x527f('0x8')?'queue':_0x380db0[_0x527f('0x6')];this[_0x527f('0x9')]=_0x380db0['countbusyretry'];this['countcongestionretry']=_0x380db0['countcongestionretry'];this['countnoanswerretry']=_0x380db0[_0x527f('0xa')];this[_0x527f('0xb')]=_0x380db0['countbusyretry']+_0x380db0[_0x527f('0xc')]+_0x380db0['countnoanswerretry']+_0x380db0[_0x527f('0xd')]+_0x380db0[_0x527f('0xe')]+_0x380db0['countabandonedretry']+_0x380db0[_0x527f('0xf')]+_0x380db0[_0x527f('0x10')];this['countnosuchnumberretry']=_0x380db0[_0x527f('0xd')];this['countdropretry']=_0x380db0[_0x527f('0xe')];this['countabandonedretry']=_0x380db0[_0x527f('0x11')];this[_0x527f('0xf')]=_0x380db0[_0x527f('0xf')];this[_0x527f('0x10')]=_0x380db0['countagentrejectretry'];this[_0x527f('0x12')]=_0x380db0['queue'];this[_0x527f('0x13')]=_0x380db0[_0x527f('0x13')];this[_0x527f('0x14')]=_0x380db0['calleridnum'];this[_0x527f('0x15')]=_0x380db0[_0x527f('0x15')];this['responsetime']=_0x380db0[_0x527f('0x16')];this[_0x527f('0x17')]=_0x380db0['responsetime'];this[_0x527f('0x18')]=_0x380db0[_0x527f('0x18')]||0x0;this['holdtime']=_0x380db0[_0x527f('0x19')]||0x0;this[_0x527f('0x1a')]=_0x380db0[_0x527f('0x1a')]||0x0;this[_0x527f('0x1b')]=_0x380db0['callback'];this[_0x527f('0x1c')]=_0x380db0['callbackuniqueid'];this[_0x527f('0x1d')]=_0x380db0[_0x527f('0x1d')];this[_0x527f('0x1e')]=_0x380db0['recallme'];this[_0x527f('0x1f')]=_0x380db0[_0x527f('0x1f')];this[_0x527f('0x20')]=_0x380db0[_0x527f('0x20')];this[_0x527f('0x21')]=_0x380db0[_0x527f('0x21')];this[_0x527f('0x22')]=_0x380db0[_0x527f('0x22')];this['CampaignId']=_0x380db0[_0x527f('0x23')];this[_0x527f('0x24')]=_0x380db0['originatecalleridnum']||'';this[_0x527f('0x25')]=_0x380db0[_0x527f('0x25')]||'';}module[_0x527f('0x26')]=Final; \ No newline at end of file +var _0x5d56=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime'];(function(_0x422a6e,_0x51e8c9){var _0x56a178=function(_0x2693d5){while(--_0x2693d5){_0x422a6e['push'](_0x422a6e['shift']());}};_0x56a178(++_0x51e8c9);}(_0x5d56,0x134));var _0x65d5=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5d56[_0x126558];return _0x1f6d14;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x65d5('0x0'));function getSeconds(_0x2ed20a,_0x59d535){var _0x310a0f=moment(_0x2ed20a)[_0x65d5('0x1')](0x0);var _0x2ba334=moment(_0x59d535)[_0x65d5('0x1')](0x0);return _0x310a0f['diff'](_0x2ba334,'seconds');}function Final(_0x8a1b90){this['uniqueid']=_0x8a1b90[_0x65d5('0x2')];this[_0x65d5('0x3')]=_0x8a1b90[_0x65d5('0x3')];this['type']=_0x8a1b90[_0x65d5('0x4')];this[_0x65d5('0x5')]=_0x8a1b90['type']===_0x65d5('0x6')?'queue':_0x8a1b90[_0x65d5('0x4')];this['countbusyretry']=_0x8a1b90[_0x65d5('0x7')];this[_0x65d5('0x8')]=_0x8a1b90['countcongestionretry'];this['countnoanswerretry']=_0x8a1b90[_0x65d5('0x9')];this[_0x65d5('0xa')]=_0x8a1b90['countbusyretry']+_0x8a1b90[_0x65d5('0x8')]+_0x8a1b90[_0x65d5('0x9')]+_0x8a1b90['countnosuchnumberretry']+_0x8a1b90[_0x65d5('0xb')]+_0x8a1b90[_0x65d5('0xc')]+_0x8a1b90['countmachineretry']+_0x8a1b90[_0x65d5('0xd')];this[_0x65d5('0xe')]=_0x8a1b90[_0x65d5('0xe')];this[_0x65d5('0xb')]=_0x8a1b90[_0x65d5('0xb')];this[_0x65d5('0xc')]=_0x8a1b90['countabandonedretry'];this[_0x65d5('0xf')]=_0x8a1b90[_0x65d5('0xf')];this[_0x65d5('0xd')]=_0x8a1b90['countagentrejectretry'];this[_0x65d5('0x10')]=_0x8a1b90[_0x65d5('0x10')];this[_0x65d5('0x11')]=_0x8a1b90[_0x65d5('0x11')];this[_0x65d5('0x12')]=_0x8a1b90['calleridnum'];this[_0x65d5('0x13')]=_0x8a1b90[_0x65d5('0x13')];this[_0x65d5('0x14')]=_0x8a1b90[_0x65d5('0x14')];this[_0x65d5('0x15')]=_0x8a1b90[_0x65d5('0x14')];this[_0x65d5('0x16')]=_0x8a1b90[_0x65d5('0x16')]||0x0;this[_0x65d5('0x17')]=_0x8a1b90[_0x65d5('0x17')]||0x0;this[_0x65d5('0x18')]=_0x8a1b90[_0x65d5('0x18')]||0x0;this[_0x65d5('0x19')]=_0x8a1b90['callback'];this[_0x65d5('0x1a')]=_0x8a1b90[_0x65d5('0x1a')];this['callbackat']=_0x8a1b90[_0x65d5('0x1b')];this['recallme']=_0x8a1b90[_0x65d5('0x1c')];this[_0x65d5('0x1d')]=_0x8a1b90[_0x65d5('0x1d')];this[_0x65d5('0x1e')]=_0x8a1b90['ListId'];this[_0x65d5('0x1f')]=_0x8a1b90['UserId'];this[_0x65d5('0x20')]=_0x8a1b90['VoiceQueueId'];this[_0x65d5('0x21')]=_0x8a1b90[_0x65d5('0x21')];this[_0x65d5('0x22')]=_0x8a1b90['originatecalleridnum']||'';this[_0x65d5('0x23')]=_0x8a1b90[_0x65d5('0x23')]||'';}module[_0x65d5('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 4d2f1f0..d901d77 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 _0x2c19=['name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','milliseconds','seconds','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname'];(function(_0x55b25d,_0x5758d8){var _0x459162=function(_0x21774d){while(--_0x21774d){_0x55b25d['push'](_0x55b25d['shift']());}};_0x459162(++_0x5758d8);}(_0x2c19,0x118));var _0x92c1=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2c19[_0x376b45];return _0x2341b3;};'use strict';var util=require(_0x92c1('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2be165,_0x2f6ddc){var _0x2c1ae5=moment(_0x2be165)['milliseconds'](0x0);var _0x3ae84e=moment(_0x2f6ddc)[_0x92c1('0x1')](0x0);return _0x2c1ae5['diff'](_0x3ae84e,_0x92c1('0x2'));}function Hangup(_0x17e1b2,_0x135b49){this[_0x92c1('0x3')]=0x4;this[_0x92c1('0x4')]=_0x92c1('0x5');this[_0x92c1('0x6')]=_0x17e1b2['scheduledat'];this['type']=_0x17e1b2['type'];this[_0x92c1('0x7')]=_0x17e1b2[_0x92c1('0x8')]===_0x92c1('0x9')?_0x92c1('0xa'):_0x17e1b2[_0x92c1('0x8')];this[_0x92c1('0xb')]=_0x17e1b2[_0x92c1('0xb')];this[_0x92c1('0xc')]=_0x17e1b2[_0x92c1('0xc')];this['countnoanswerretry']=_0x17e1b2[_0x92c1('0xd')];this['countglobal']=_0x17e1b2['countbusyretry']+_0x17e1b2[_0x92c1('0xc')]+_0x17e1b2[_0x92c1('0xd')]+_0x17e1b2[_0x92c1('0xe')]+_0x17e1b2[_0x92c1('0xf')]+_0x17e1b2['countabandonedretry']+_0x17e1b2[_0x92c1('0x10')]+_0x17e1b2[_0x92c1('0x11')];this[_0x92c1('0xe')]=_0x17e1b2['countnosuchnumberretry'];this[_0x92c1('0xf')]=_0x17e1b2[_0x92c1('0xf')];this[_0x92c1('0x12')]=_0x17e1b2[_0x92c1('0x12')];this[_0x92c1('0x10')]=_0x17e1b2[_0x92c1('0x10')];this[_0x92c1('0x11')]=_0x17e1b2[_0x92c1('0x11')];this['uniqueid']=_0x135b49[_0x92c1('0x13')];this[_0x92c1('0x14')]=_0x17e1b2[_0x92c1('0x15')];this[_0x92c1('0x16')]=_0x17e1b2[_0x92c1('0x17')];this['starttime']=_0x17e1b2[_0x92c1('0x18')];this[_0x92c1('0x19')]=_0x17e1b2['responsetime'];this[_0x92c1('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x92c1('0x1b')]=getSeconds(_0x17e1b2['responsetime'],_0x17e1b2['starttime']);this[_0x92c1('0x1c')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x17e1b2[_0x92c1('0x19')]);this['queue']=_0x17e1b2[_0x92c1('0xa')];this[_0x92c1('0x1d')]=_0x92c1('0x1e');this[_0x92c1('0x1f')]=_0x135b49[_0x92c1('0x20')];this[_0x92c1('0x21')]=_0x17e1b2['callback'];this[_0x92c1('0x22')]=_0x17e1b2['callbackuniqueid'];this['callbackat']=_0x17e1b2[_0x92c1('0x23')];this['recallme']=_0x17e1b2[_0x92c1('0x24')];this['ContactId']=_0x17e1b2[_0x92c1('0x25')];this[_0x92c1('0x26')]=_0x17e1b2[_0x92c1('0x26')];this[_0x92c1('0x27')]=_0x17e1b2[_0x92c1('0x27')];this[_0x92c1('0x28')]=_0x17e1b2[_0x92c1('0x28')];this['CampaignId']=_0x17e1b2[_0x92c1('0x29')];}module[_0x92c1('0x2a')]=Hangup; \ No newline at end of file +var _0x0830=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme'];(function(_0x1d60fd,_0xa917f5){var _0x3941b5=function(_0x95a8ef){while(--_0x95a8ef){_0x1d60fd['push'](_0x1d60fd['shift']());}};_0x3941b5(++_0xa917f5);}(_0x0830,0x7e));var _0x0083=function(_0x4c9296,_0x5d07f5){_0x4c9296=_0x4c9296-0x0;var _0x3d8557=_0x0830[_0x4c9296];return _0x3d8557;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0083('0x0'));function getSeconds(_0x1931cc,_0x52acb0){var _0x4e57ca=moment(_0x1931cc)[_0x0083('0x1')](0x0);var _0x585f2f=moment(_0x52acb0)['milliseconds'](0x0);return _0x4e57ca[_0x0083('0x2')](_0x585f2f,'seconds');}function Hangup(_0x1cba24,_0x424422){this[_0x0083('0x3')]=0x4;this[_0x0083('0x4')]=_0x0083('0x5');this[_0x0083('0x6')]=_0x1cba24[_0x0083('0x6')];this[_0x0083('0x7')]=_0x1cba24[_0x0083('0x7')];this[_0x0083('0x8')]=_0x1cba24[_0x0083('0x7')]==='outbound'?_0x0083('0x9'):_0x1cba24[_0x0083('0x7')];this[_0x0083('0xa')]=_0x1cba24[_0x0083('0xa')];this['countcongestionretry']=_0x1cba24['countcongestionretry'];this[_0x0083('0xb')]=_0x1cba24[_0x0083('0xb')];this[_0x0083('0xc')]=_0x1cba24[_0x0083('0xa')]+_0x1cba24[_0x0083('0xd')]+_0x1cba24[_0x0083('0xb')]+_0x1cba24[_0x0083('0xe')]+_0x1cba24[_0x0083('0xf')]+_0x1cba24[_0x0083('0x10')]+_0x1cba24[_0x0083('0x11')]+_0x1cba24[_0x0083('0x12')];this['countnosuchnumberretry']=_0x1cba24[_0x0083('0xe')];this[_0x0083('0xf')]=_0x1cba24['countdropretry'];this['countabandonedretry']=_0x1cba24['countabandonedretry'];this[_0x0083('0x11')]=_0x1cba24[_0x0083('0x11')];this['countagentrejectretry']=_0x1cba24[_0x0083('0x12')];this[_0x0083('0x13')]=_0x424422[_0x0083('0x13')];this[_0x0083('0x14')]=_0x1cba24['name'];this['calleridnum']=_0x1cba24[_0x0083('0x15')];this[_0x0083('0x16')]=_0x1cba24[_0x0083('0x16')];this[_0x0083('0x17')]=_0x1cba24['responsetime'];this['endtime']=moment()['format'](_0x0083('0x18'));this['ringtime']=getSeconds(_0x1cba24[_0x0083('0x17')],_0x1cba24['starttime']);this[_0x0083('0x19')]=0x0;this[_0x0083('0x1a')]=getSeconds(this['endtime'],_0x1cba24[_0x0083('0x17')]);this[_0x0083('0x9')]=_0x1cba24[_0x0083('0x9')];this[_0x0083('0x1b')]=_0x0083('0x1c');this[_0x0083('0x1d')]=_0x424422[_0x0083('0x1e')];this['callback']=_0x1cba24[_0x0083('0x1f')];this['callbackuniqueid']=_0x1cba24['callbackuniqueid'];this['callbackat']=_0x1cba24[_0x0083('0x20')];this['recallme']=_0x1cba24[_0x0083('0x21')];this[_0x0083('0x22')]=_0x1cba24[_0x0083('0x22')];this[_0x0083('0x23')]=_0x1cba24[_0x0083('0x23')];this[_0x0083('0x24')]=_0x1cba24[_0x0083('0x24')];this[_0x0083('0x25')]=_0x1cba24[_0x0083('0x25')];this[_0x0083('0x26')]=_0x1cba24[_0x0083('0x26')];}module[_0x0083('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 1e6d506..7b766f1 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 _0xfb0e=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x573973,_0x58f5a4){var _0x1f0689=function(_0x12449b){while(--_0x12449b){_0x573973['push'](_0x573973['shift']());}};_0x1f0689(++_0x58f5a4);}(_0xfb0e,0x13c));var _0xefb0=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xfb0e[_0x3a6efd];return _0x487b9a;};'use strict';var util=require(_0xefb0('0x0'));var _=require(_0xefb0('0x1'));var moment=require(_0xefb0('0x2'));function getSeconds(_0x2e2f42,_0x223c4f){var _0x299e43=moment(_0x2e2f42)[_0xefb0('0x3')](0x0);var _0x1de224=moment(_0x223c4f)[_0xefb0('0x3')](0x0);return _0x299e43['diff'](_0x1de224,_0xefb0('0x4'));}function History(_0x468492){this[_0xefb0('0x5')]=_0x468492[_0xefb0('0x5')];this['scheduledat']=_0x468492[_0xefb0('0x6')]||undefined;this[_0xefb0('0x7')]=_0x468492[_0xefb0('0x7')];this[_0xefb0('0x8')]=_0x468492['type']===_0xefb0('0x9')?_0xefb0('0xa'):_0x468492[_0xefb0('0x7')];this['countbusyretry']=_0x468492[_0xefb0('0xb')];this[_0xefb0('0xc')]=_0x468492['countcongestionretry'];this[_0xefb0('0xd')]=_0x468492['countnoanswerretry'];this['countglobal']=_0x468492['countbusyretry']+_0x468492[_0xefb0('0xc')]+_0x468492['countnoanswerretry']+_0x468492[_0xefb0('0xe')]+_0x468492[_0xefb0('0xf')]+_0x468492['countabandonedretry']+_0x468492[_0xefb0('0x10')]+_0x468492[_0xefb0('0x11')];this['countnosuchnumberretry']=_0x468492[_0xefb0('0xe')];this[_0xefb0('0xf')]=_0x468492[_0xefb0('0xf')];this[_0xefb0('0x12')]=_0x468492[_0xefb0('0x12')];this[_0xefb0('0x10')]=_0x468492[_0xefb0('0x10')];this[_0xefb0('0x11')]=_0x468492[_0xefb0('0x11')];this[_0xefb0('0xa')]=_0x468492['queue'];this[_0xefb0('0x13')]=_0x468492[_0xefb0('0x14')];this[_0xefb0('0x15')]=_0x468492[_0xefb0('0x16')];this['starttime']=_0x468492['starttime'];this['responsetime']=_0x468492[_0xefb0('0x17')];this['endtime']=_0x468492['responsetime'];this[_0xefb0('0x18')]=getSeconds(_0x468492[_0xefb0('0x17')],_0x468492['starttime']);this[_0xefb0('0x19')]=0x0;this[_0xefb0('0x1a')]=0x0;this[_0xefb0('0x1b')]=_0x468492[_0xefb0('0x1b')];this[_0xefb0('0x1c')]=_0x468492[_0xefb0('0x1c')];this[_0xefb0('0x1d')]=_0x468492[_0xefb0('0x1d')];this[_0xefb0('0x1e')]=_0x468492[_0xefb0('0x1e')];this['ContactId']=_0x468492[_0xefb0('0x1f')];this['ListId']=_0x468492[_0xefb0('0x20')];this[_0xefb0('0x21')]=_0x468492[_0xefb0('0x21')];this[_0xefb0('0x22')]=_0x468492[_0xefb0('0x22')];this[_0xefb0('0x23')]=_0x468492[_0xefb0('0x23')];this[_0xefb0('0x24')]=_0x468492[_0xefb0('0x24')]||'';this[_0xefb0('0x25')]=_0x468492['originatecalleridname']||'';}module[_0xefb0('0x26')]=History; \ No newline at end of file +var _0x566c=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x4db0db,_0x2df73e){var _0x2cf8f8=function(_0x34e3a4){while(--_0x34e3a4){_0x4db0db['push'](_0x4db0db['shift']());}};_0x2cf8f8(++_0x2df73e);}(_0x566c,0x1e0));var _0xc566=function(_0x11a95d,_0x25a82a){_0x11a95d=_0x11a95d-0x0;var _0xef27e=_0x566c[_0x11a95d];return _0xef27e;};'use strict';var util=require('util');var _=require(_0xc566('0x0'));var moment=require(_0xc566('0x1'));function getSeconds(_0x4d05bc,_0x3aaa22){var _0x23ae4f=moment(_0x4d05bc)[_0xc566('0x2')](0x0);var _0x19beb5=moment(_0x3aaa22)['milliseconds'](0x0);return _0x23ae4f['diff'](_0x19beb5,_0xc566('0x3'));}function History(_0xf44d96){this[_0xc566('0x4')]=_0xf44d96[_0xc566('0x4')];this[_0xc566('0x5')]=_0xf44d96[_0xc566('0x5')]||undefined;this[_0xc566('0x6')]=_0xf44d96[_0xc566('0x6')];this[_0xc566('0x7')]=_0xf44d96['type']===_0xc566('0x8')?'queue':_0xf44d96[_0xc566('0x6')];this[_0xc566('0x9')]=_0xf44d96[_0xc566('0x9')];this[_0xc566('0xa')]=_0xf44d96[_0xc566('0xa')];this[_0xc566('0xb')]=_0xf44d96[_0xc566('0xb')];this[_0xc566('0xc')]=_0xf44d96[_0xc566('0x9')]+_0xf44d96[_0xc566('0xa')]+_0xf44d96['countnoanswerretry']+_0xf44d96[_0xc566('0xd')]+_0xf44d96[_0xc566('0xe')]+_0xf44d96[_0xc566('0xf')]+_0xf44d96[_0xc566('0x10')]+_0xf44d96[_0xc566('0x11')];this[_0xc566('0xd')]=_0xf44d96[_0xc566('0xd')];this['countdropretry']=_0xf44d96[_0xc566('0xe')];this[_0xc566('0xf')]=_0xf44d96[_0xc566('0xf')];this[_0xc566('0x10')]=_0xf44d96[_0xc566('0x10')];this[_0xc566('0x11')]=_0xf44d96[_0xc566('0x11')];this[_0xc566('0x12')]=_0xf44d96[_0xc566('0x12')];this[_0xc566('0x13')]=_0xf44d96[_0xc566('0x14')];this[_0xc566('0x15')]=_0xf44d96[_0xc566('0x16')];this[_0xc566('0x17')]=_0xf44d96[_0xc566('0x17')];this[_0xc566('0x18')]=_0xf44d96[_0xc566('0x18')];this['endtime']=_0xf44d96['responsetime'];this[_0xc566('0x19')]=getSeconds(_0xf44d96[_0xc566('0x18')],_0xf44d96[_0xc566('0x17')]);this['holdtime']=0x0;this[_0xc566('0x1a')]=0x0;this['callback']=_0xf44d96[_0xc566('0x1b')];this[_0xc566('0x1c')]=_0xf44d96[_0xc566('0x1c')];this['callbackat']=_0xf44d96[_0xc566('0x1d')];this[_0xc566('0x1e')]=_0xf44d96['recallme'];this[_0xc566('0x1f')]=_0xf44d96[_0xc566('0x1f')];this['ListId']=_0xf44d96[_0xc566('0x20')];this[_0xc566('0x21')]=_0xf44d96[_0xc566('0x21')];this[_0xc566('0x22')]=_0xf44d96[_0xc566('0x22')];this[_0xc566('0x23')]=_0xf44d96[_0xc566('0x23')];this[_0xc566('0x24')]=_0xf44d96['originatecalleridnum']||'';this[_0xc566('0x25')]=_0xf44d96[_0xc566('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cec9950..5950be2 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 _0x05c8=['outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','[uniqueid]','[actions]','clearZombieChannels','enqueue','isNil','Action','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','then','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','uniqueid','Machine','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countbusyretry','countabandonedretry','dialGlobalMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','cause-txt','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','strategy','actionid','stateinterface','locked','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','iftime\x20%s,%s','content','true','push','command','timezones','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','trim','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialAgentRejectMaxRetry','object','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','emit','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','buildObj','[syncAgentComplete][createHistory][3]','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[getContactCampaign2]','[countReScheduled]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','agentconnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','type','available','loggedIn','pTalking','sumBillable','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay'];(function(_0x5c9499,_0x221b1){var _0x1370d4=function(_0x2a077a){while(--_0x2a077a){_0x5c9499['push'](_0x5c9499['shift']());}};_0x1370d4(++_0x221b1);}(_0x05c8,0x1b9));var _0x805c=function(_0x276c93,_0x56a113){_0x276c93=_0x276c93-0x0;var _0x4462a3=_0x05c8[_0x276c93];return _0x4462a3;};'use strict';var util=require(_0x805c('0x0'));var _=require('lodash');var BPromise=require(_0x805c('0x1'));var uuid=require(_0x805c('0x2'));var moment=require(_0x805c('0x3'));var rr=require('rr');var md5=require(_0x805c('0x4'));var Redis=require(_0x805c('0x5'));var ut=require(_0x805c('0x6'));var config=require(_0x805c('0x7'));var logger=require(_0x805c('0x8'))('dialer');var loggerBooked=require(_0x805c('0x8'))(_0x805c('0x9'));var loggerPredictive=require('../../../config/logger')(_0x805c('0xa'));var loggerPredictiveCalls=require(_0x805c('0x8'))(_0x805c('0xb'));var loggerSyncQueueSummary=require(_0x805c('0x8'))(_0x805c('0xc'));var ami=require(_0x805c('0xd'));config[_0x805c('0xe')]=_[_0x805c('0xf')](config[_0x805c('0xe')],{'host':_0x805c('0x10'),'port':0x18eb});var io=require(_0x805c('0x11'))(new Redis(config[_0x805c('0xe')]));var cmHopper=require(_0x805c('0x12'));var cmHopperFinal=require(_0x805c('0x13'));var cmHopperHistory=require(_0x805c('0x14'));var cmHopperBlack=require(_0x805c('0x15'));var voiceQueueRt=require(_0x805c('0x16'));var Action=require('./action');var History=require(_0x805c('0x17'));var Final=require(_0x805c('0x18'));var AgentComplete=require(_0x805c('0x19'));var QueueCallerAbandon=require(_0x805c('0x1a'));var Hangup=require(_0x805c('0x1b'));var ipAgi=process[_0x805c('0x1c')][_0x805c('0x1d')]||_0x805c('0x1e');var strategy={'rrmemory':_0x805c('0x1f'),'roundrobin':_0x805c('0x20')};var Sequence=function(){};Sequence[_0x805c('0x21')]['enqueue']=function(_0x1a685b){this[_0x805c('0x22')]=this[_0x805c('0x22')]?this[_0x805c('0x22')][_0x805c('0x23')](_0x1a685b):_0x1a685b();};function Dialer(_0x33f181,_0xee5b55){this[_0x805c('0x24')]=new Sequence();this[_0x805c('0x25')]=_0xee5b55;this['voiceQueues']=_0x33f181[_0x805c('0x26')];this[_0x805c('0x27')]=_0x33f181[_0x805c('0x27')];this[_0x805c('0x28')]=_0x33f181['agents'];this['trunks']=_0x33f181[_0x805c('0x29')];this[_0x805c('0x2a')]=config[_0x805c('0x2a')]||0x2;this[_0x805c('0x2b')]={};this[_0x805c('0x2c')]={};this[_0x805c('0x2d')]={};this[_0x805c('0x2e')]={};this[_0x805c('0x2f')]={};this['startPredictive']={};this['startProgressive']={};this[_0x805c('0x30')]={};this[_0x805c('0x31')]={};this['queueBookedRR']={};ami['on'](_0x805c('0x32'),this['syncAgentConnect']['bind'](this));ami['on']('queuecallerabandon',this[_0x805c('0x33')][_0x805c('0x34')](this));ami['on'](_0x805c('0x35'),this[_0x805c('0x36')][_0x805c('0x34')](this));ami['on'](_0x805c('0x37'),this[_0x805c('0x38')]['bind'](this));ami['on'](_0x805c('0x39'),this[_0x805c('0xc')]['bind'](this));ami['on'](_0x805c('0x3a'),this[_0x805c('0x3b')][_0x805c('0x34')](this));ami['on'](_0x805c('0x3c'),this['syncNewExten'][_0x805c('0x34')](this));ami['on'](_0x805c('0x3d'),this[_0x805c('0x3e')]['bind'](this));ami['on'](_0x805c('0x3f'),this['syncQueueMember'][_0x805c('0x34')](this));ami['on'](_0x805c('0x40'),this[_0x805c('0x41')][_0x805c('0x34')](this));this[_0x805c('0x42')]();this[_0x805c('0x43')]();}function isNotNull(_0xf79b2c){return _0xf79b2c!==null&&!_[_0x805c('0x44')](_0xf79b2c);}function checkIsLoggedIn(_0x158608,_0x31526e){return function(){if(_0x31526e<=0x0){_0x158608['message']=_0x805c('0x45');throw _0x158608[_0x805c('0x46')]+_0x805c('0x47');}};}function isActive(_0x331f7d){return _0x331f7d;}function checkIsActive(_0x45ef5f,_0x5539e6){return function(){if(!isActive(_0x5539e6)){_0x45ef5f[_0x805c('0x48')]=_0x805c('0x49');throw _0x45ef5f['name']+_0x805c('0x4a');}};}function checkInterval(_0xa0cd1c){return function(){if(!isNotNull(_0xa0cd1c['Interval'])){_0xa0cd1c[_0x805c('0x48')]=_0x805c('0x4b');throw _0xa0cd1c[_0x805c('0x46')]+_0x805c('0x4c');}if(!isNotNull(_0xa0cd1c[_0x805c('0x4d')][_0x805c('0x4e')])){_0xa0cd1c[_0x805c('0x48')]=_0x805c('0x4b');throw _0xa0cd1c['name']+_0x805c('0x4c');}if(!isNotNull(_[_0x805c('0x4f')](_0xa0cd1c[_0x805c('0x4d')]['Intervals']))){_0xa0cd1c[_0x805c('0x48')]='INTERVAL_IS_NULL';throw _0xa0cd1c['name']+_0x805c('0x4c');}};}function msgResponse(_0x519e90,_0xd58ce9,_0x418da8){return{'action':_0x519e90,'response':_0xd58ce9,'message':_0x418da8,'stack':_0x418da8};}function myreject(_0xb6b4ef){return function(_0x35bd57){return _0xb6b4ef(msgResponse(_0x805c('0x50'),'Error',JSON[_0x805c('0x51')](_0x35bd57)));};}function getSeconds(_0x1f201b,_0x497be2){var _0x3c3a7f=moment(_0x1f201b)['milliseconds'](0x0);var _0x4f080c=moment(_0x497be2)[_0x805c('0x52')](0x0);return _0x3c3a7f[_0x805c('0x53')](_0x4f080c,_0x805c('0x54'));}function emit(_0x37f455,_0x274d13,_0x4088fd){io['to'](_0x37f455)['emit'](_0x274d13,_0x4088fd);}function emitVoiceQueueSummary(_0x46568b){if(_0x46568b[_0x805c('0x55')]==='outbound'){var _0x4587b6={'id':_0x46568b['id'],'name':_0x46568b['name'],'strategy':_0x46568b['strategy'],'answered':_0x46568b['answered'],'available':_0x46568b[_0x805c('0x56')],'loggedIn':_0x46568b[_0x805c('0x57')],'pTalking':_0x46568b[_0x805c('0x58')],'sumBillable':_0x46568b[_0x805c('0x59')],'sumDuration':_0x46568b['sumDuration'],'sumHoldTime':_0x46568b['sumHoldTime']||0x0,'talking':_0x46568b[_0x805c('0x5a')],'total':_0x46568b[_0x805c('0x5b')],'type':_0x46568b['type'],'unmanaged':_0x46568b['unmanaged'],'abandoned':_0x46568b[_0x805c('0x5c')],'waiting':_0x46568b[_0x805c('0x5d')],'loggedInDb':_0x46568b[_0x805c('0x5e')],'dialActive':_0x46568b[_0x805c('0x5f')],'dialMethod':_0x46568b[_0x805c('0x60')],'dialOriginateCallerIdName':_0x46568b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x46568b[_0x805c('0x61')],'dialOriginateTimeout':_0x46568b[_0x805c('0x62')],'dialPrefix':_0x46568b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x46568b[_0x805c('0x63')],'outboundAnswerCallsDay':_0x46568b[_0x805c('0x64')],'outboundBlacklistCallsDay':_0x46568b['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x46568b[_0x805c('0x65')],'outboundCongestionCallsDay':_0x46568b[_0x805c('0x66')],'outboundDropCallsDayACS':_0x46568b[_0x805c('0x67')],'outboundDropCallsDayCallersExit':_0x46568b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x46568b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x46568b[_0x805c('0x68')],'outboundNoSuchCallsDay':_0x46568b[_0x805c('0x69')],'outboundOriginateFailureCallsDay':_0x46568b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x46568b['outboundReCallsDay'],'outboundRejectCallsDay':_0x46568b[_0x805c('0x6a')],'outboundUnknownCallsDay':_0x46568b[_0x805c('0x6b')],'predictiveIntervalAnsweredCalls':_0x46568b[_0x805c('0x6c')],'predictiveIntervalAvgHoldtime':_0x46568b[_0x805c('0x6d')],'predictiveIntervalAvgTalktime':_0x46568b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x46568b[_0x805c('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x46568b[_0x805c('0x6f')],'predictiveIntervalErlangCalls':_0x46568b[_0x805c('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x46568b[_0x805c('0x71')],'predictiveIntervalHitRate':_0x46568b[_0x805c('0x72')],'predictiveIntervalMultiplicativeFactor':_0x46568b[_0x805c('0x73')],'predictiveIntervalPauses':_0x46568b[_0x805c('0x74')],'predictiveIntervalAvailable':_0x46568b[_0x805c('0x75')],'predictiveIntervalTotalCalls':_0x46568b[_0x805c('0x76')],'message':_0x46568b[_0x805c('0x48')],'originated':_0x46568b['originated'],'erlangCalls':_0x46568b[_0x805c('0x77')],'erlangCallToSecond':_0x46568b['erlangCallToSecond'],'erlangAbandonmentRate':_0x46568b[_0x805c('0x78')],'erlangBusyFactor':_0x46568b[_0x805c('0x79')],'startPredictive':_0x46568b[_0x805c('0x7a')],'startProgressive':_0x46568b['startProgressive']};if(_0x46568b[_0x805c('0x7b')]){_0x4587b6['Trunk']={'id':_0x46568b[_0x805c('0x7b')]['id'],'name':_0x46568b[_0x805c('0x7b')][_0x805c('0x46')],'active':_0x46568b['Trunk'][_0x805c('0x7c')],'callerid':_0x46568b[_0x805c('0x7b')][_0x805c('0x7d')]};}if(_0x46568b['Interval']){_0x4587b6[_0x805c('0x4d')]={'id':_0x46568b[_0x805c('0x4d')]['id'],'name':_0x46568b[_0x805c('0x4d')][_0x805c('0x46')]};}var _0x2e0392=md5(JSON[_0x805c('0x51')](_0x4587b6));if(_0x46568b['md5']!==_0x2e0392){_0x46568b['md5']=_0x2e0392;emit(util[_0x805c('0x7e')](_0x805c('0x7f'),_0x4587b6[_0x805c('0x46')]),_0x805c('0x80'),_0x4587b6);}}}function emitCampaignSummary(_0x4c2952){if(_0x4c2952['type']===_0x805c('0x81')){emit(util[_0x805c('0x7e')](_0x805c('0x82'),_0x4c2952['name']),'campaign:save',_0x4c2952);}}function checkGetDataPredictive(_0x1677c8){if(isNotNull(_0x1677c8)){if(!_['isEmpty'](_0x1677c8)){loggerPredictive[_0x805c('0x83')](_0x805c('0x84'));loggerPredictive[_0x805c('0x83')](_0x805c('0x85'),_0x1677c8[_0x805c('0x76')]);loggerPredictive['info'](_0x805c('0x86'),_0x1677c8[_0x805c('0x6c')]);loggerPredictive[_0x805c('0x83')](_0x805c('0x87'),_0x1677c8[_0x805c('0x6f')]);loggerPredictive[_0x805c('0x83')](_0x805c('0x88'),_0x1677c8['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x805c('0x83')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1677c8['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x805c('0x83')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1677c8[_0x805c('0x89')]);loggerPredictive[_0x805c('0x83')](_0x805c('0x8a'));if(_0x1677c8[_0x805c('0x76')]>0x0){if(!_[_0x805c('0x44')](_0x1677c8[_0x805c('0x89')])&&_0x1677c8[_0x805c('0x89')]>0x0){return!![];}else{loggerPredictive[_0x805c('0x83')](_0x805c('0x8b'));}if(!_[_0x805c('0x44')](_0x1677c8['predictiveIntervalAvgHoldtime'])&&_0x1677c8[_0x805c('0x6d')]>0x0){return!![];}else{loggerPredictive[_0x805c('0x83')](_0x805c('0x8c'));}}else{loggerPredictive[_0x805c('0x83')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x805c('0x83')](_0x805c('0x8d'));}}else{loggerPredictive[_0x805c('0x83')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x23d78f){return function(_0x35dcf5){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x805c('0x83')](_0x805c('0x8e'),_0x35dcf5['erlangCalls']);loggerPredictive[_0x805c('0x83')](_0x805c('0x8f'),_0x35dcf5['erlangCallToSecond']);loggerPredictive[_0x805c('0x83')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35dcf5[_0x805c('0x78')]);loggerPredictive[_0x805c('0x83')](_0x805c('0x90'),_0x35dcf5[_0x805c('0x79')]);loggerPredictive[_0x805c('0x83')](_0x805c('0x91'),_0x35dcf5['erlangAbandonmentRate']);loggerPredictive[_0x805c('0x83')]('---------------------------');_[_0x805c('0x92')](_0x23d78f,_0x35dcf5);};}function getDiff(_0x23b9ea){var _0x22e7f0=moment()[_0x805c('0x52')](0x0);var _0x41558e=moment(_0x23b9ea)[_0x805c('0x52')](0x0);return _0x22e7f0['diff'](_0x41558e,_0x805c('0x54'));}function ifInterval(_0x434870,_0x4350b9){if(_[_0x805c('0x44')](_0x4350b9)){return![];}if(getDiff(_0x4350b9)<_0x434870*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1e15b9){if(isNotNull(_0x1e15b9)){if(!_[_0x805c('0x44')](_0x1e15b9[_0x805c('0x93')])){_0x1e15b9[_0x805c('0x93')]=undefined;loggerPredictive[_0x805c('0x83')](_0x1e15b9[_0x805c('0x46')],_0x805c('0x94'));}if(!_[_0x805c('0x44')](_0x1e15b9['startPredictive'])){_0x1e15b9['startPredictive']=undefined;loggerPredictive['info'](_0x1e15b9[_0x805c('0x46')],_0x805c('0x95'));}if(!_[_0x805c('0x44')](_0x1e15b9[_0x805c('0x96')])){clearInterval(_0x1e15b9[_0x805c('0x96')]);_0x1e15b9[_0x805c('0x96')]=undefined;loggerPredictive['info'](_0x1e15b9[_0x805c('0x46')],_0x805c('0x97'));}}}function erlangb(_0x37e1f5,_0x1482f1){if(_0x1482f1===0x0){return 0x0;}var _0xc4714c=0x1;for(var _0x12df44=0x1;_0x12df44<=_0x1482f1;_0x12df44+=0x1){_0xc4714c=0x1+_0xc4714c*_0x12df44/_0x37e1f5;}return 0x1/_0xc4714c;}function isVoiceQueueOutbound(_0x37b539){return _0x37b539==='outbound';}function isNotPreview(_0x1a6409){return _0x1a6409!=='preview';}function isCampaignIvr(_0x42ab67){return _0x42ab67===_0x805c('0x81');}function getCallerId(_0x8f939f,_0x300dbe,_0x5442bd){if(!_[_0x805c('0x44')](_0x5442bd)&&'string'===typeof _0x5442bd&&!_[_0x805c('0x4f')](_0x5442bd)){if(!_[_0x805c('0x44')](_0x300dbe)&&_0x805c('0x98')===typeof _0x300dbe&&!_['isEmpty'](_0x300dbe)){return util[_0x805c('0x7e')](_0x805c('0x99'),_0x300dbe,_0x5442bd);}return util['format'](_0x805c('0x99'),_0x5442bd,_0x5442bd);}if(!_[_0x805c('0x44')](_0x8f939f)&&'string'===typeof _0x8f939f&&!_[_0x805c('0x4f')](_0x8f939f)){return _0x8f939f;}return _0x805c('0x9a');}function loggerCatchQueueSummary(_0x548503,_0x2566b7){return function(_0x4e5676){freeVariablesPredictive(_0x2566b7);emitVoiceQueueSummary(_0x2566b7);emitCampaignSummary(_0x2566b7);loggerSyncQueueSummary[_0x805c('0x9b')](_0x548503,util[_0x805c('0x9c')](_0x4e5676,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x190395,_0x348301){return function(_0x26be69){loggerPredictive['error'](_0x348301[_0x805c('0x46')],_0x190395);loggerPredictive[_0x805c('0x9b')](_0x26be69[_0x805c('0x9d')]);freeVariablesPredictive(_0x348301);};}function loggerCatch(_0x53c2f1){return function(_0x405bf8){logger[_0x805c('0x9b')](_0x53c2f1,util['inspect'](_0x405bf8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x476916){return _0x476916&&!_[_0x805c('0x44')](_0x476916)&&_0x476916[_0x805c('0x9e')]>0x0;}function decremetOriginate(_0x247546){if(!_[_0x805c('0x44')](_0x247546)&&_0x247546!==null){if(_0x247546[_0x805c('0x9f')]('originated')){if(_0x247546[_0x805c('0xa0')]>0x0){_0x247546[_0x805c('0xa0')]-=0x1;}else{logger[_0x805c('0x9b')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x805c('0x9b')](_0x805c('0xa1'));}}function checkContactLowerLimitOriginate(_0x5b570c,_0x20fa6b,_0xd7d8ba){if(_0x20fa6b>_0xd7d8ba){for(var _0x31ecf5=0x0;_0x31ecf5<_0x20fa6b-_0xd7d8ba;_0x31ecf5+=0x1){decremetOriginate(_0x5b570c);}}}function loggerGetContactDialer(_0x4aa79f,_0x31954d,_0x371acb){return function(_0x45d943){checkContactLowerLimitOriginate(_0x31954d,_0x371acb,0x0);logger[_0x805c('0x9b')](_0x4aa79f,util['inspect'](_0x45d943,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5621a6){return function(_0x5d9ea2){if(isNotNull(_0x5d9ea2)&&isNotNull(_0x5d9ea2[0x0])){if(_0x5d9ea2[0x0][_0x805c('0xa2')]>0x0){_0x5621a6[_0x805c('0x48')]=_0x805c('0xa3');logger[_0x805c('0x83')]('[getContactDialer2][ReScheduled]'+_0x5621a6['name'],_0x5d9ea2[0x0][_0x805c('0xa2')],_0x805c('0xa4'));}else{_0x5621a6[_0x805c('0x48')]=_0x805c('0xa5');logger[_0x805c('0x83')]('[getContactDialer2][Empty]'+_0x5621a6[_0x805c('0x46')]);}}};}function notSendMessagesQueue(_0x4ba027){if(_0x4ba027['sendMessageOneNotActive']){freeVariablesPredictive(_0x4ba027);if(_0x4ba027[_0x805c('0xa0')]===0x0&&_0x4ba027[_0x805c('0x5a')]===0x0&&_0x4ba027[_0x805c('0x5d')]===0x0&&(_0x4ba027[_0x805c('0x58')]||0x0)===0x0){_0x4ba027[_0x805c('0xa6')]=![];_0x4ba027[_0x805c('0x56')]=0x0;_0x4ba027[_0x805c('0x48')]=_0x805c('0x49');loggerSyncQueueSummary[_0x805c('0x9b')](_0x805c('0xa7'),_0x4ba027[_0x805c('0x46')],_0x805c('0xa8'));}else{_0x4ba027[_0x805c('0x48')]=_0x805c('0xa9');loggerSyncQueueSummary[_0x805c('0x9b')](_0x805c('0xa7'),_0x4ba027[_0x805c('0x46')],_0x805c('0xaa'));}emitVoiceQueueSummary(_0x4ba027);}}function notSendMessagesCampaign(_0x539e61){if(_0x539e61[_0x805c('0xa6')]){if(_0x539e61[_0x805c('0xa0')]===0x0){_0x539e61[_0x805c('0xa6')]=![];_0x539e61[_0x805c('0x48')]=_0x805c('0x49');loggerSyncQueueSummary[_0x805c('0x9b')](_0x805c('0xab'),_0x539e61[_0x805c('0x46')],'is\x20not\x20active');}else{_0x539e61[_0x805c('0x48')]=_0x805c('0xa9');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x539e61[_0x805c('0x46')],'is\x20disactive');}emitCampaignSummary(_0x539e61);}}function createObjHistory(_0x3756de,_0x296e58,_0x57549c,_0x1dd325,_0x17e737){_0x3756de[_0x805c('0x48')]=_0x57549c;var _0x3516f0=new Action(_0x3756de,_0x296e58);var _0x3b09bd=new History(_0x3516f0);_0x3b09bd[_0x805c('0xac')]=_0x1dd325;_0x3b09bd['statedesc']=_0x17e737;_0x3b09bd[_0x805c('0xad')]=_0x3516f0['starttime'];return _0x3b09bd;}Dialer[_0x805c('0x21')]['loopClearZombieChannels']=function(){var _0x13f498=this;setInterval(function(){_0x13f498['clearZombieChannels'](_0x13f498[_0x805c('0x2e')],_0x805c('0xae'));_0x13f498['clearZombieChannels'](_0x13f498[_0x805c('0x2c')],_0x805c('0xaf'));},0x32c8);};Dialer[_0x805c('0x21')][_0x805c('0xb0')]=function(_0x319801,_0x4a52cb){var _0x3ec525=this;for(var _0x6a5028 in _0x319801){if(_0x319801[_0x805c('0x9f')](_0x6a5028)){this[_0x805c('0x24')][_0x805c('0xb1')](function(){if(!_[_0x805c('0xb2')](_0x319801[_0x6a5028])){return ami[_0x805c('0xb3')]({'action':'status','channel':_0x319801[_0x6a5028][_0x805c('0xb4')]})[_0x805c('0xb5')](function(_0x15f95f){if(_0x15f95f[_0x805c('0x48')]===_0x805c('0xb6')){setTimeout(function(){if(_0x319801[_0x6a5028]&&_0x319801[_0x6a5028][_0x805c('0x55')]!==_0x805c('0x81')){_0x3ec525['updateOriginated'](_0x3ec525[_0x805c('0x26')][_0x319801[_0x6a5028]['queue']]);logger[_0x805c('0x9b')](_0x805c('0xb7'),_0x4a52cb,_0x6a5028,_0x319801[_0x6a5028][_0x805c('0xb8')]);delete _0x319801[_0x6a5028];}if(_0x319801[_0x6a5028]&&_0x319801[_0x6a5028][_0x805c('0x55')]===_0x805c('0x81')){_0x3ec525[_0x805c('0xb9')](_0x3ec525[_0x805c('0x27')][_0x319801[_0x6a5028][_0x805c('0xb8')]]);logger['error'](_0x805c('0xba'),_0x4a52cb,_0x6a5028,_0x319801[_0x6a5028][_0x805c('0xb8')]);delete _0x319801[_0x6a5028];}},0x2328);}});}});}}};Dialer['prototype'][_0x805c('0xbb')]=function(_0x548775){return BPromise['resolve']()[_0x805c('0xbc')](cmHopper[_0x805c('0xbb')](_0x548775))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x805c('0x21')][_0x805c('0xbd')]=function(_0x3372af){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopperBlack[_0x805c('0xbd')](_0x3372af))[_0x805c('0xb5')](loggerCatch(_0x805c('0xbf')));};Dialer['prototype'][_0x805c('0xc0')]=function(_0x28157e){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopperBlack['checkIsBlackListIvr'](_0x28157e))[_0x805c('0xb5')](loggerCatch(_0x805c('0xc1')));};Dialer[_0x805c('0x21')]['averageHandleTime']=function(_0x1d4e86){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopperHistory['avgHandleTime'](_0x1d4e86))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x805c('0x21')]['rescheduleContact']=function(_0x2d4627){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopper[_0x805c('0xc2')](_0x2d4627))[_0x805c('0xb5')](loggerCatch(_0x805c('0xc3')));};Dialer[_0x805c('0x21')][_0x805c('0xc4')]=function(_0x38bc22,_0x57cef0,_0x4e2e86){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopper[_0x805c('0xc4')](_0x38bc22,_0x57cef0,_0x4e2e86))[_0x805c('0xb5')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x805c('0x21')]['getContactDialer']=function(_0x4c9b16,_0x1964ad,_0x574cfe,_0x447c44){return BPromise['resolve']()[_0x805c('0xbc')](cmHopper[_0x805c('0xc5')](_0x4c9b16,_0x1964ad,_0x574cfe,_0x447c44))[_0x805c('0xb5')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x805c('0xc6')]=function(_0x55b04c,_0x3c68c4,_0xe64826){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopper[_0x805c('0xc6')](_0x55b04c,_0x3c68c4,_0xe64826))['catch'](loggerCatch(_0x805c('0xc7')));};Dialer['prototype'][_0x805c('0xc8')]=function(_0x4b308c){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](voiceQueueRt[_0x805c('0xc8')](_0x4b308c))['catch'](loggerCatch(_0x805c('0xc9')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x56be09){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopper[_0x805c('0xca')](_0x56be09))[_0x805c('0xb5')](loggerCatch(_0x805c('0xcb')));};Dialer[_0x805c('0x21')][_0x805c('0xcc')]=function(_0x3d84ae){return BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](cmHopperHistory[_0x805c('0xcc')](_0x3d84ae))['catch'](loggerCatch(_0x805c('0xcd')));};Dialer['prototype'][_0x805c('0xb9')]=function(_0x463cde){if(!_[_0x805c('0x44')](_0x463cde)&&_0x463cde!==null){if(_0x463cde[_0x805c('0x9f')](_0x805c('0xa0'))){if(_0x463cde[_0x805c('0xa0')]>0x0){_0x463cde[_0x805c('0xa0')]-=0x1;}else{logger[_0x805c('0x9b')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x805c('0x9b')](_0x805c('0xce'));}};Dialer['prototype']['loggerHandler']=function(_0x50df0e,_0x1ad7f4){var _0x496f1b=this;return function(_0x44494e){_0x496f1b[_0x805c('0xb9')](_0x1ad7f4);logger[_0x805c('0x9b')](_0x50df0e,util[_0x805c('0x9c')](_0x44494e,{'showHidden':![],'depth':null}));};};Dialer[_0x805c('0x21')][_0x805c('0xcf')]=function(_0x4f2ddc,_0x8ebcb8,_0x4f805f){var _0x96cddd={'state':0x19,'statedesc':_0x805c('0xd0')};this['updateOriginated'](_0x8ebcb8);this[_0x805c('0xd1')](_[_0x805c('0x92')](_0x96cddd,_[_0x805c('0xd2')](_0x4f805f,[_0x805c('0xd3'),_0x805c('0xd4'),_0x805c('0xd5'),_0x805c('0xd6'),_0x805c('0xd7')])),_0x805c('0xd8'),_0x805c('0xd9'));logger[_0x805c('0x9b')](_0x4f2ddc);};Dialer[_0x805c('0x21')]['isSuccess']=function(_0x57df6f){return _0x57df6f===_0x805c('0xda');};Dialer[_0x805c('0x21')][_0x805c('0xdb')]=function(_0xac7d3f){return!_[_0x805c('0x44')](_0xac7d3f)&&_0xac7d3f&&!_[_0x805c('0x44')](_0xac7d3f['name'])&&!_[_0x805c('0x44')](_0xac7d3f['active'])&&_0xac7d3f[_0x805c('0x7c')]&&(this['trunks'][util[_0x805c('0x7e')](_0x805c('0xdc'),_0xac7d3f[_0x805c('0x46')])][_0x805c('0xdd')]===_0x805c('0xde')||this[_0x805c('0x29')][util[_0x805c('0x7e')](_0x805c('0xdc'),_0xac7d3f['name'])][_0x805c('0xdd')]===_0x805c('0xdf'));};Dialer['prototype'][_0x805c('0xd1')]=function(_0x1f3aee,_0x110904,_0x443395){this['createHistory'](_0x1f3aee)[_0x805c('0xb5')](loggerCatch(_0x110904));this['moveContactManagedDialer'](_0x1f3aee)[_0x805c('0xb5')](loggerCatch(_0x443395));};Dialer[_0x805c('0x21')][_0x805c('0x3e')]=function(_0x230f91){var _0x5ebc4f=this['uniqueId'][_0x230f91['uniqueid']];var _0x1b8d3c;if(!_[_0x805c('0xb2')](_0x230f91)&&!_[_0x805c('0xb2')](_0x230f91[_0x805c('0xe0')])&&!_[_0x805c('0xb2')](_0x230f91[_0x805c('0xe0')][_0x805c('0xe1')])&&_0x230f91[_0x805c('0xe2')]===_0x805c('0xe3')&&_0x5ebc4f){if(_0x5ebc4f['type']!==_0x805c('0x81')&&this['voiceQueues'][_0x5ebc4f[_0x805c('0xb8')]][_0x805c('0xe4')]&&_0x230f91[_0x805c('0xe5')]===_0x805c('0xe6')){delete this[_0x805c('0x2e')][_0x230f91['uniqueid']];this[_0x805c('0xb9')](this[_0x805c('0x26')][_0x5ebc4f[_0x805c('0xb8')]]);this[_0x805c('0x26')][_0x5ebc4f['queue']][_0x805c('0x64')]+=0x1;this[_0x805c('0x26')][_0x5ebc4f[_0x805c('0xb8')]][_0x805c('0x63')]+=0x1;_0x1b8d3c=new Hangup(_0x5ebc4f,_0x230f91);_0x1b8d3c[_0x805c('0xac')]=0x12;_0x1b8d3c[_0x805c('0xe7')]=_0x805c('0xe8');_0x1b8d3c[_0x805c('0xe9')]=_0x805c('0xea');this[_0x805c('0xd1')](_0x1b8d3c,_0x805c('0xeb'),_0x805c('0xec'));}if(_0x5ebc4f[_0x805c('0x55')]!==_0x805c('0x81')&&this[_0x805c('0x26')][_0x5ebc4f['queue']][_0x805c('0xe4')]&&_0x230f91[_0x805c('0xe5')]==='MACHINE'){var _0x4f0ba3=this;return new BPromise(function(_0x5ea9de,_0x1a5668){delete _0x4f0ba3[_0x805c('0x2e')][_0x230f91[_0x805c('0xed')]];_0x4f0ba3['updateOriginated'](_0x4f0ba3[_0x805c('0x26')][_0x5ebc4f[_0x805c('0xb8')]]);_0x4f0ba3['voiceQueues'][_0x5ebc4f[_0x805c('0xb8')]][_0x805c('0x64')]+=0x1;_0x4f0ba3[_0x805c('0x26')][_0x5ebc4f[_0x805c('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x14739d=_0x4f0ba3[_0x805c('0x26')][_0x5ebc4f[_0x805c('0xb8')]];var _0x394c2b=new Hangup(_0x5ebc4f,_0x230f91);_0x394c2b[_0x805c('0xac')]=0x13;_0x394c2b[_0x805c('0xe7')]=_0x805c('0xee');_0x394c2b[_0x805c('0xe9')]='AMD';_0x394c2b['countmachineretry']+=0x1;_0x394c2b[_0x805c('0xef')]+=0x1;_0x394c2b[_0x805c('0xf0')]=!![];_0x4f0ba3[_0x805c('0xcc')](_0x394c2b)[_0x805c('0xb5')](loggerCatch(_0x805c('0xf1')));if(_0x394c2b['countbusyretry']+_0x394c2b[_0x805c('0xf2')]+_0x394c2b[_0x805c('0xf3')]+_0x394c2b[_0x805c('0xf4')]+_0x394c2b[_0x805c('0xf5')]+_0x394c2b['countabandonedretry']+_0x394c2b[_0x805c('0xf6')]+_0x394c2b[_0x805c('0xf7')]>=_0x14739d['dialGlobalMaxRetry']){_0x4f0ba3[_0x805c('0xf8')](_0x394c2b,_0x5ea9de,_0x1a5668,_0x805c('0xf9'));}else{if(_0x394c2b['countmachineretry']>=_0x14739d[_0x805c('0xfa')]){_0x4f0ba3[_0x805c('0xfb')](_0x394c2b,_0x5ea9de,_0x1a5668,_0x805c('0xfc'));}else{_0x4f0ba3[_0x805c('0xc2')]({'active':![],'countmachineretry':_0x394c2b['countmachineretry'],'scheduledat':moment()[_0x805c('0xfd')](_0x14739d[_0x805c('0xfe')],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x394c2b['ContactId'],'ListId':_0x394c2b[_0x805c('0xd4')],'VoiceQueueId':_0x394c2b['VoiceQueueId']||undefined,'CampaignId':_0x394c2b[_0x805c('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x5ea9de({'reschedule':0x1});}}});}if(_0x5ebc4f[_0x805c('0x55')]===_0x805c('0x81')&&this[_0x805c('0x27')][_0x5ebc4f['queue']]['dialAMDActive']&&_0x230f91['value']===_0x805c('0xe6')){delete this['uniqueId'][_0x230f91['uniqueid']];this[_0x805c('0xb9')](this[_0x805c('0x27')][_0x5ebc4f[_0x805c('0xb8')]]);_0x1b8d3c=new Hangup(_0x5ebc4f,_0x230f91);_0x1b8d3c[_0x805c('0xac')]=0x12;_0x1b8d3c[_0x805c('0xe7')]=_0x805c('0xe8');_0x1b8d3c[_0x805c('0xe9')]=_0x805c('0xea');this[_0x805c('0xd1')](_0x1b8d3c,_0x805c('0x101'),_0x805c('0x102'));}if(_0x5ebc4f[_0x805c('0x55')]===_0x805c('0x81')&&this[_0x805c('0x27')][_0x5ebc4f[_0x805c('0xb8')]]['dialAMDActive']&&_0x230f91['value']===_0x805c('0x103')){var _0x4f0ba3=this;return new BPromise(function(_0xf3f0c6,_0x16f668){delete _0x4f0ba3[_0x805c('0x2e')][_0x230f91['uniqueid']];_0x4f0ba3[_0x805c('0xb9')](_0x4f0ba3[_0x805c('0x27')][_0x5ebc4f[_0x805c('0xb8')]]);_0x4f0ba3[_0x805c('0x27')][_0x5ebc4f[_0x805c('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x4f0ba3[_0x805c('0x27')][_0x5ebc4f[_0x805c('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5591e2=_0x4f0ba3['campaigns'][_0x5ebc4f[_0x805c('0xb8')]];var _0x5d03b9=new Hangup(_0x5ebc4f,_0x230f91);_0x5d03b9[_0x805c('0xac')]=0x13;_0x5d03b9['statedesc']=_0x805c('0xee');_0x5d03b9[_0x805c('0xe9')]=_0x805c('0xea');_0x5d03b9[_0x805c('0xf6')]+=0x1;_0x5d03b9[_0x805c('0xef')]+=0x1;_0x5d03b9['amd']=!![];_0x4f0ba3[_0x805c('0xcc')](_0x5d03b9)[_0x805c('0xb5')](loggerCatch(_0x805c('0xf1')));if(_0x5d03b9[_0x805c('0x104')]+_0x5d03b9[_0x805c('0xf2')]+_0x5d03b9['countnoanswerretry']+_0x5d03b9[_0x805c('0xf4')]+_0x5d03b9['countdropretry']+_0x5d03b9[_0x805c('0x105')]+_0x5d03b9['countmachineretry']+_0x5d03b9[_0x805c('0xf7')]>=_0x5591e2[_0x805c('0x106')]){_0x4f0ba3[_0x805c('0xf8')](_0x5d03b9,_0xf3f0c6,_0x16f668,_0x805c('0xf9'));}else{if(_0x5d03b9['countmachineretry']>=_0x5591e2[_0x805c('0xfa')]){_0x4f0ba3[_0x805c('0xfb')](_0x5d03b9,_0xf3f0c6,_0x16f668,_0x805c('0xfc'));}else{_0x4f0ba3[_0x805c('0xc2')]({'active':![],'countmachineretry':_0x5d03b9[_0x805c('0xf6')],'scheduledat':moment()[_0x805c('0xfd')](_0x5591e2[_0x805c('0xfe')],_0x805c('0xff'))['format'](_0x805c('0x100')),'ContactId':_0x5d03b9[_0x805c('0xd3')],'ListId':_0x5d03b9[_0x805c('0xd4')],'VoiceQueueId':_0x5d03b9[_0x805c('0xd6')]||undefined,'CampaignId':_0x5d03b9[_0x805c('0xd7')]||undefined})['catch'](loggerCatch(_0x805c('0x107')));_0xf3f0c6({'reschedule':0x1});}}});}}};Dialer[_0x805c('0x21')][_0x805c('0x3b')]=function(_0x221729){var _0x3eeb96=this[_0x805c('0x2e')][_0x221729['uniqueid']];var _0x42781c=this;var _0x5a3d61;if(_0x3eeb96&&_0x3eeb96[_0x805c('0x55')]==='ivr'){delete this[_0x805c('0x2e')][_0x221729[_0x805c('0xed')]];this['updateOriginated'](this[_0x805c('0x27')][_0x3eeb96[_0x805c('0xb8')]]);this[_0x805c('0x27')][_0x3eeb96[_0x805c('0xb8')]][_0x805c('0x108')]+=0x1;_0x5a3d61=new Hangup(_0x3eeb96,_0x221729);this[_0x805c('0xcc')](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x109')));this['moveContactManagedDialer'](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x10a')));}if(_0x3eeb96&&_0x3eeb96['type']!==_0x805c('0x81')&&isNotNull(this[_0x805c('0x26')][_0x3eeb96['queue']]['dialQueueProject'])){delete this[_0x805c('0x2e')][_0x221729[_0x805c('0xed')]];this[_0x805c('0xb9')](this[_0x805c('0x26')][_0x3eeb96[_0x805c('0xb8')]]);this[_0x805c('0x26')][_0x3eeb96[_0x805c('0xb8')]][_0x805c('0x64')]+=0x1;this[_0x805c('0x26')][_0x3eeb96[_0x805c('0xb8')]][_0x805c('0x63')]+=0x1;_0x5a3d61=new Hangup(_0x3eeb96,_0x221729);_0x5a3d61['state']=0x10;_0x5a3d61[_0x805c('0xe7')]=_0x805c('0x10b');_0x5a3d61[_0x805c('0xe9')]='AGI';this['createHistory'](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x109')));this['moveContactManagedDialer'](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x10a')));}if(_0x3eeb96&&_0x3eeb96[_0x805c('0x55')]!==_0x805c('0x81')&&!isNotNull(this['voiceQueues'][_0x3eeb96[_0x805c('0xb8')]]['dialQueueProject'])){delete this['uniqueId'][_0x221729[_0x805c('0xed')]];this[_0x805c('0xb9')](this['voiceQueues'][_0x3eeb96[_0x805c('0xb8')]]);this['voiceQueues'][_0x3eeb96[_0x805c('0xb8')]][_0x805c('0x6b')]+=0x1;_0x5a3d61=new Hangup(_0x3eeb96,_0x221729);_0x5a3d61['state']=0xc;_0x5a3d61[_0x805c('0xe7')]=_0x221729[_0x805c('0x10c')];_0x5a3d61[_0x805c('0xe9')]='Unknow';this[_0x805c('0xcc')](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x109')));this[_0x805c('0xca')](_0x5a3d61)[_0x805c('0xb5')](loggerCatch(_0x805c('0x10a')));}};Dialer[_0x805c('0x21')][_0x805c('0x38')]=function(_0x516ad0){var _0x22c320=this['uniqueId'][_0x516ad0['uniqueid']];var _0x34da06=this;if(this['voiceQueues'][_0x516ad0[_0x805c('0xb8')]]){if(_0x22c320&&_0x22c320[_0x805c('0x55')]!=='ivr'){delete this[_0x805c('0x2e')][_0x516ad0[_0x805c('0xed')]];this[_0x805c('0x26')][_0x516ad0[_0x805c('0xb8')]]['outboundAnswerCallsDay']+=0x1;var _0x23cbac=new AgentComplete(_0x22c320,_0x516ad0);if(_0x516ad0[_0x805c('0x10d')]===_0x805c('0x10e')){_0x23cbac['agiafterat']=this[_0x805c('0x26')][_0x516ad0[_0x805c('0xb8')]][_0x805c('0x10f')]&&this[_0x805c('0x26')][_0x516ad0[_0x805c('0xb8')]][_0x805c('0x110')]?moment()['format'](_0x805c('0x100')):undefined;}this[_0x805c('0xcc')](_0x23cbac)[_0x805c('0xb5')](loggerCatch(_0x805c('0x111')));this[_0x805c('0xca')](_0x23cbac)[_0x805c('0xb5')](loggerCatch(_0x805c('0x112')));}}};Dialer['prototype'][_0x805c('0x113')]=function(_0x3597b2){if(this[_0x805c('0x26')][_0x3597b2[_0x805c('0xb8')]]){if(this['uniqueId'][_0x3597b2[_0x805c('0xed')]]&&this['uniqueId'][_0x3597b2[_0x805c('0xed')]][_0x805c('0x55')]!=='ivr'){this[_0x805c('0xb9')](this[_0x805c('0x26')][_0x3597b2['queue']]);this[_0x805c('0x2e')][_0x3597b2[_0x805c('0xed')]][_0x805c('0x114')]=moment()[_0x805c('0x7e')](_0x805c('0x100'));}}};Dialer[_0x805c('0x21')][_0x805c('0x115')]=function(_0xb824d4){this[_0x805c('0xcc')](_0xb824d4)[_0x805c('0xb5')](loggerCatch(_0x805c('0x111')));this[_0x805c('0xca')](_0xb824d4)[_0x805c('0xb5')](loggerCatch(_0x805c('0x116')));};Dialer[_0x805c('0x21')][_0x805c('0x33')]=function(_0x40d8aa){var _0xc74bd5=this[_0x805c('0x2e')][_0x40d8aa[_0x805c('0xed')]];var _0x17010f=this;if(this['voiceQueues'][_0x40d8aa[_0x805c('0xb8')]]){if(_0xc74bd5&&_0xc74bd5[_0x805c('0x55')]!==_0x805c('0x81')){delete this[_0x805c('0x2e')][_0x40d8aa['uniqueid']];this[_0x805c('0xb9')](this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]]);_0xc74bd5[_0x805c('0x117')]=moment()[_0x805c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x31e331=new QueueCallerAbandon(_0xc74bd5,_0x40d8aa);if(getSeconds(_0xc74bd5[_0x805c('0x117')],_0xc74bd5['responsetime'])>=_0xc74bd5[_0x805c('0x118')]){this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x805c('0x26')][_0x40d8aa['queue']][_0x805c('0x119')]+=0x1;this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]][_0x805c('0x71')]+=0x1;_0x31e331[_0x805c('0xac')]=0xa;_0x31e331['statedesc']=_0x805c('0x11a');_0x31e331[_0x805c('0x11b')]=_0x805c('0x11c');_0x31e331[_0x805c('0x11d')]=this['voiceQueues'][_0x40d8aa[_0x805c('0xb8')]]['dialQueueProject2']?moment()[_0x805c('0x7e')](_0x805c('0x100')):undefined;_0x31e331[_0x805c('0xf5')]+=0x1;_0x31e331[_0x805c('0xef')]+=0x1;if(_0x31e331['countdropretry']>=this['voiceQueues'][_0x40d8aa['queue']][_0x805c('0x11e')]){this[_0x805c('0x115')](_0x31e331);}else{this[_0x805c('0xc2')]({'active':![],'countdropretry':_0x31e331[_0x805c('0xf5')],'scheduledat':moment()[_0x805c('0xfd')](this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]][_0x805c('0x11f')],'minutes')[_0x805c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc74bd5['ContactId'],'ListId':_0xc74bd5[_0x805c('0xd4')],'VoiceQueueId':_0xc74bd5['VoiceQueueId']||undefined,'CampaignId':_0xc74bd5[_0x805c('0xd7')]||undefined})['catch'](loggerCatch(_0x805c('0x120')));var _0x5d9e4f=new History(_0x31e331);_0x5d9e4f['state']=0xa;_0x5d9e4f[_0x805c('0xe7')]=_0x805c('0x11a');_0x5d9e4f[_0x805c('0x121')]=moment()[_0x805c('0x7e')](_0x805c('0x100'));_0x5d9e4f[_0x805c('0xad')]=_0x5d9e4f[_0x805c('0x121')];_0x5d9e4f[_0x805c('0x122')]=_0x31e331['calleridname'];_0x5d9e4f['calleridnum']=_0x31e331[_0x805c('0x123')];this[_0x805c('0xcc')](_0x5d9e4f)[_0x805c('0xb5')](loggerCatch(_0x805c('0x124')));}}else{this[_0x805c('0x26')][_0x40d8aa['queue']][_0x805c('0x6e')]+=0x1;this[_0x805c('0x26')][_0x40d8aa['queue']][_0x805c('0x125')]+=0x1;_0x31e331[_0x805c('0xac')]=0xb;_0x31e331['statedesc']='Abandoned';_0x31e331[_0x805c('0x11b')]=_0x805c('0x126');_0x31e331[_0x805c('0x105')]+=0x1;_0x31e331[_0x805c('0xef')]+=0x1;if(_0x31e331[_0x805c('0x105')]>=this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]][_0x805c('0x127')]){this[_0x805c('0x115')](_0x31e331);}else{this[_0x805c('0xc2')]({'active':![],'countabandonedretry':_0x31e331[_0x805c('0x105')],'scheduledat':moment()[_0x805c('0xfd')](this[_0x805c('0x26')][_0x40d8aa[_0x805c('0xb8')]][_0x805c('0x128')],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0xc74bd5['ContactId'],'ListId':_0xc74bd5[_0x805c('0xd4')],'VoiceQueueId':_0xc74bd5[_0x805c('0xd6')]||undefined,'CampaignId':_0xc74bd5[_0x805c('0xd7')]||undefined})['catch'](loggerCatch(_0x805c('0x129')));var _0x5d9e4f=new History(_0x31e331);_0x5d9e4f[_0x805c('0xac')]=0xb;_0x5d9e4f[_0x805c('0xe7')]=_0x805c('0x12a');_0x5d9e4f[_0x805c('0x121')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d9e4f['endtime']=_0x5d9e4f['starttime'];_0x5d9e4f['calleridname']=_0x31e331[_0x805c('0x122')];_0x5d9e4f['calleridnum']=_0x31e331[_0x805c('0x123')];this['createHistory'](_0x5d9e4f)[_0x805c('0xb5')](loggerCatch(_0x805c('0x12b')));}}}}};Dialer[_0x805c('0x21')]['syncNewExten']=function(_0x39cd29){if(this[_0x805c('0x2c')][_0x39cd29['uniqueid']]){this[_0x805c('0x2c')][_0x39cd29[_0x805c('0xed')]][_0x805c('0xb4')]=_0x39cd29[_0x805c('0xb4')];}if(this['uniqueId'][_0x39cd29[_0x805c('0xed')]]){this[_0x805c('0x2e')][_0x39cd29[_0x805c('0xed')]][_0x805c('0xb4')]=_0x39cd29[_0x805c('0xb4')];}};Dialer[_0x805c('0x21')]['syncQueueMember']=function(_0x106ddb){if(strategy[this[_0x805c('0x26')][this[_0x805c('0x2c')][_0x106ddb['actionid']]['queue']][_0x805c('0x12c')]]===_0x805c('0x20')){if(this[_0x805c('0x2c')][_0x106ddb[_0x805c('0x12d')]]&&_[_0x805c('0xb2')](this['actions'][_0x106ddb[_0x805c('0x12d')]]['locked'])&&_0x106ddb[_0x805c('0xdd')]==='1'&&_0x106ddb['paused']==='0'){if(this[_0x805c('0x28')][_0x106ddb['stateinterface']]){if(!this[_0x805c('0x28')][_0x106ddb[_0x805c('0x12e')]][_0x805c('0x12f')]){this[_0x805c('0x28')][_0x106ddb[_0x805c('0x12e')]]['locked']=!![];this[_0x805c('0x2c')][_0x106ddb['actionid']][_0x805c('0x12f')]=!![];this[_0x805c('0x2c')][_0x106ddb[_0x805c('0x12d')]][_0x805c('0x12e')]=_0x106ddb[_0x805c('0x12e')];}}}}else if((strategy[this[_0x805c('0x26')][this['actions'][_0x106ddb[_0x805c('0x12d')]][_0x805c('0xb8')]][_0x805c('0x12c')]]||'rrmemory')==='rrmemory'){if(this[_0x805c('0x2c')][_0x106ddb[_0x805c('0x12d')]]){if(this[_0x805c('0x28')][_0x106ddb[_0x805c('0x12e')]]){this[_0x805c('0x2c')][_0x106ddb[_0x805c('0x12d')]]['stateinterface']=_0x106ddb[_0x805c('0x12e')];if(_['isNil'](this['queueBooked'][this[_0x805c('0x2c')][_0x106ddb['actionid']][_0x805c('0xb8')]])){this[_0x805c('0x31')][this['actions'][_0x106ddb[_0x805c('0x12d')]][_0x805c('0xb8')]]=[];}this['queueBooked'][this[_0x805c('0x2c')][_0x106ddb[_0x805c('0x12d')]][_0x805c('0xb8')]]['push'](_[_0x805c('0x92')](_[_0x805c('0xd2')](this['actions'][_0x106ddb[_0x805c('0x12d')]],[_0x805c('0x130'),_0x805c('0x12e')]),{'status':_0x106ddb[_0x805c('0xdd')],'paused':_0x106ddb[_0x805c('0x131')]}));}}}};function unlockQueueStatus(_0x3d077e,_0x1730fb){setTimeout(function(){if(_['isUndefined'](_0x3d077e[_0x805c('0x132')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x1730fb);}_0x3d077e[_0x805c('0x132')]=!![];loggerBooked['info'](_0x805c('0x133'),_0x1730fb,JSON[_0x805c('0x51')](_[_0x805c('0xd2')](_0x3d077e,[_0x805c('0x46'),_0x805c('0x132')])));},0x1f3);}Dialer[_0x805c('0x21')][_0x805c('0x41')]=function(_0x591d87){var _0x33df82=this;var _0x200d26=_0x33df82[_0x805c('0x26')][_0x33df82[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]];if(strategy[this[_0x805c('0x26')][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]]['queue']][_0x805c('0x12c')]]===_0x805c('0x20')){if(this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]]&&this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]]['stateinterface']){this[_0x805c('0x25')]['run'](this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0x130')],this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0x12e')])['catch'](function(_0xa054bf){logger[_0x805c('0x9b')](_0x805c('0x134'),util[_0x805c('0x9c')](_0xa054bf,{'showHidden':![],'depth':null}));})[_0x805c('0x23')](function(){_0x33df82['updateOriginated'](_0x33df82['voiceQueues'][_0x33df82[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]);_0x33df82[_0x805c('0x28')][_0x33df82[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0x12e')]][_0x805c('0x12f')]=![];delete _0x33df82[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]];unlockQueueStatus(_0x200d26);});}else{this[_0x805c('0xb9')](this[_0x805c('0x26')][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]);this[_0x805c('0xc2')]({'active':![],'ContactId':this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xd3')],'ListId':this[_0x805c('0x2c')][_0x591d87['actionid']][_0x805c('0xd4')],'VoiceQueueId':this[_0x805c('0x2c')][_0x591d87['actionid']][_0x805c('0xd6')]||undefined,'CampaignId':this['actions'][_0x591d87[_0x805c('0x12d')]][_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x591d87[_0x805c('0x12d')]];unlockQueueStatus(_0x200d26);}}else if((strategy[this[_0x805c('0x26')][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){var _0x1d53d0;if(this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]]&&!_[_0x805c('0x4f')](this[_0x805c('0x31')][this[_0x805c('0x2c')][_0x591d87['actionid']][_0x805c('0xb8')]])){if(this[_0x805c('0x135')][_0x33df82[_0x805c('0x2c')][_0x591d87['actionid']][_0x805c('0xb8')]]){this[_0x805c('0x135')][_0x33df82['actions'][_0x591d87['actionid']][_0x805c('0xb8')]]=this[_0x805c('0x135')][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]?this[_0x805c('0x135')][this['actions'][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]:this['queueBooked'][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]?this[_0x805c('0x31')][this['actions'][_0x591d87[_0x805c('0x12d')]]['queue']]['_rr']||0x0:0x0;}this[_0x805c('0x31')][this[_0x805c('0x2c')][_0x591d87[_0x805c('0x12d')]][_0x805c('0xb8')]]['_rr']=this[_0x805c('0x135')][this['actions'][_0x591d87[_0x805c('0x12d')]]['queue']];for(var _0x1f5c1a=0x0;_0x1f5c1a=0x0?!![]:![];})[_0x805c('0xb5')](myreject(_0x2e1e0b)));}}else{_0x481ccc[_0x805c('0x151')](ami[_0x805c('0xb3')]({'action':_0x805c('0x152'),'command':util[_0x805c('0x7e')]('iftime\x20%s,%s',_0x6e59a0,!_['isUndefined'](config[_0x805c('0x153')][_0x261f28])?_0x261f28:'')})[_0x805c('0xbc')](function(_0x38201a){return _0x38201a[_0x805c('0x14f')][_0x805c('0x154')](_0x805c('0x150'))>=0x0?!![]:![];})[_0x805c('0xb5')](myreject(_0x2e1e0b)));}BPromise[_0x805c('0x155')](_0x481ccc)[_0x805c('0xbc')](function(_0x43b8a1){var _0x1ebce7=_[_0x805c('0x156')](_0x43b8a1);if(_0x1ebce7){return _0x49e917(_0x1ebce7);}else{_0x4bc1ae[_0x805c('0x48')]=_0xa71a60?_0x805c('0x157'):_0x805c('0x158');return _0x2e1e0b(msgResponse(_0x805c('0x159'),'Failure',_0x805c('0x15a')+_0xa71a60+'\x20'+_0x46b17d+'\x20Interval\x20is\x20overtime:\x20'+util[_0x805c('0x9c')](_0x6e59a0,{'showHidden':![],'depth':null})+_0x805c('0x15b')+_0x261f28));}})['catch'](function(_0x281fd0){return _0x2e1e0b(msgResponse(_0x805c('0x147'),_0x805c('0x148'),JSON[_0x805c('0x51')](_0x281fd0)));});});};Dialer['prototype']['checkDialMethod']=function(_0x7b5049){var _0x131910=this;return function(){switch(_0x7b5049[_0x805c('0x60')]){case'progressive':freeVariablesPredictive(_0x7b5049);_0x131910[_0x805c('0x15c')](_0x7b5049,0x1);break;case'power':freeVariablesPredictive(_0x7b5049);_0x131910['handlePower'](_0x7b5049,_0x7b5049[_0x805c('0x15d')]);break;case _0x805c('0xa'):_0x131910[_0x805c('0xa')](_0x7b5049);break;case'booked':freeVariablesPredictive(_0x7b5049);_0x131910[_0x805c('0x15c')](_0x7b5049,0x1);break;default:freeVariablesPredictive(_0x7b5049);logger['error'](_0x805c('0x15e'),_0x7b5049[_0x805c('0x46')],_0x805c('0x15f'));}};};Dialer['prototype'][_0x805c('0x160')]=function(_0xd7c37){var _0x21cd12=this;return function(){_0x21cd12[_0x805c('0x161')](_0xd7c37);};};Dialer[_0x805c('0x21')][_0x805c('0xc')]=function(_0x13116e){var _0x288da5=this;if(isNotPreview(_0x13116e['dialMethod'])){if(isVoiceQueueOutbound(_0x13116e[_0x805c('0x55')])&&isActive(_0x13116e['dialActive'])){_0x13116e[_0x805c('0xa6')]=!![];BPromise[_0x805c('0xbe')]()[_0x805c('0xbc')](checkIsLoggedIn(_0x13116e,_0x13116e['loggedIn']))[_0x805c('0xbc')](checkIsActive(_0x13116e,_0x13116e[_0x805c('0x5f')]))['then'](checkInterval(_0x13116e))[_0x805c('0xbc')](_0x288da5[_0x805c('0x162')](_0x13116e))[_0x805c('0xbc')](_0x288da5[_0x805c('0x146')](_0x13116e[_0x805c('0x163')],_0x13116e[_0x805c('0x164')],_0x13116e['name'],_0x13116e))[_0x805c('0xbc')](_0x288da5['checkIfTimeIntervals'](_0x13116e[_0x805c('0x4d')],_0x13116e['dialTimezone'],_0x13116e[_0x805c('0x46')],_0x13116e))[_0x805c('0xbc')](_0x288da5[_0x805c('0x165')](_0x13116e))['catch'](loggerCatchQueueSummary(_0x805c('0x166'),_0x13116e));}else{notSendMessagesQueue(_0x13116e);}}else{freeVariablesPredictive(_0x13116e);}};Dialer[_0x805c('0x21')][_0x805c('0x142')]=function(){var _0x3a64f9=this;var _0x206f14;for(var _0x5d85e7 in this[_0x805c('0x27')]){if(this[_0x805c('0x27')][_0x805c('0x9f')](_0x5d85e7)){_0x206f14=this['campaigns'][_0x5d85e7];if(isCampaignIvr(_0x206f14['type'])&&isActive(_0x206f14[_0x805c('0x7c')])){_0x206f14[_0x805c('0xa6')]=!![];BPromise['resolve']()[_0x805c('0xbc')](checkIsActive(_0x206f14,_0x206f14[_0x805c('0x7c')]))[_0x805c('0xbc')](checkInterval(_0x206f14))['then'](_0x3a64f9[_0x805c('0x162')](_0x206f14))[_0x805c('0xbc')](_0x3a64f9['checkIfTime'](_0x206f14[_0x805c('0x163')],_0x206f14[_0x805c('0x164')],_0x206f14[_0x805c('0x46')],_0x206f14))[_0x805c('0xbc')](_0x3a64f9[_0x805c('0x167')](_0x206f14[_0x805c('0x4d')],_0x206f14[_0x805c('0x164')],_0x206f14[_0x805c('0x46')],_0x206f14))[_0x805c('0xbc')](_0x3a64f9['launchHandleIvr'](_0x206f14))[_0x805c('0xb5')](loggerCatchQueueSummary(_0x805c('0x168'),_0x206f14));}else{notSendMessagesCampaign(_0x206f14);}}}};function getCallerIdRandom(_0x482778,_0x190727){var _0x202f8a,_0x208a0b,_0x1d44ca;if(_0x190727<=0x0){_0x190727=0x1;}_0x202f8a=new RegExp(_0x805c('0x169')+_0x190727+'}$');_0x208a0b=Math[_0x805c('0x16a')](0xa,_0x190727-0x1);_0x1d44ca=Math[_0x805c('0x16a')](0xa,_0x190727)-0x1;return util[_0x805c('0x7e')]('%s',_[_0x805c('0x16b')](_0x482778,_0x202f8a,_[_0x805c('0x16c')](_0x208a0b,_0x1d44ca)));}function extractCalleridName(_0x1147b2){var _0x1dc259=_0x1147b2[_0x805c('0x16d')](/"(.*?)"/);return _0x1dc259?_0x1dc259[0x1]:_0x1147b2;}function extractCalleridNumber(_0x192904){var _0x587915=_0x192904['match'](/<(.*?)>/);return _0x587915?_0x587915[0x1]:_0x192904;}Dialer['prototype']['actionOriginate']=function(_0xacc201,_0x58e10){var _0x555b50=this;var _0x5b9342=uuid['v4']();this['actions'][_0x5b9342]=new Action(_0xacc201,_0x58e10,_0x5b9342);return new BPromise(function(_0x5de34e,_0x3a41f9){if(_['isUndefined'](_0xacc201)&&'object'!==typeof _0xacc201){return _0x3a41f9(msgResponse(_0x805c('0x16e'),'Failure',_0x805c('0x16f')));}if(_[_0x805c('0x44')](_0x58e10[_0x805c('0x170')][_0x805c('0x171')])||_0x58e10[_0x805c('0x170')]['phone']===null){return _0x3a41f9(msgResponse(_0x805c('0x16e'),_0x805c('0x148'),'contact\x20is\x20undefine'));}var _0x4a5f10={'XMD-CALLERID':_0x555b50[_0x805c('0x2c')][_0x5b9342][_0x805c('0x172')](),'XMD-AGI':_0xacc201['dialQueueProject']?util[_0x805c('0x7e')](_0x805c('0x173'),ipAgi,_0xacc201['dialQueueProject']):_0x805c('0x174'),'XMD-AGIAFTER':_0xacc201[_0x805c('0x10f')]?util[_0x805c('0x7e')](_0x805c('0x173'),ipAgi,_0xacc201[_0x805c('0x10f')]):_0x805c('0x174'),'XMD-QUEUE':_0xacc201[_0x805c('0x55')]===_0x805c('0x175')?util[_0x805c('0x7e')](_0x805c('0x176'),_0xacc201[_0x805c('0x46')],_0xacc201[_0x805c('0x177')]||'',_0xacc201[_0x805c('0x110')]?'c':'',_0xacc201[_0x805c('0x118')]||0x3):_0x805c('0x174'),'XMD-CONTACTID':_0x58e10[_0x805c('0xd3')],'XMD-CDRTYPE':_0x805c('0x178'),'CALLERID(all)':_0x555b50[_0x805c('0x2c')][_0x5b9342][_0x805c('0x172')](),'XMD-AMD':_0xacc201[_0x805c('0xe4')]?_0x805c('0x179'):_0x805c('0x174'),'XMD-DESTINATION':_0x805c('0xe3')};if(_0xacc201[_0x805c('0xe4')]){_0x4a5f10[_0x805c('0x17a')]=_0xacc201[_0x805c('0x17b')]||0x9c4;_0x4a5f10[_0x805c('0x17c')]=_0xacc201[_0x805c('0x17d')]||0x5dc;_0x4a5f10[_0x805c('0x17e')]=_0xacc201['dialAMDAfterGreetingSilence']||0x320;_0x4a5f10[_0x805c('0x17f')]=_0xacc201[_0x805c('0x180')]||0x1388;_0x4a5f10['XMD-AMDMINWORDLENGTH']=_0xacc201[_0x805c('0x181')]||0x64;_0x4a5f10['XMD-AMDBETWEENWORDSSILENCE']=_0xacc201[_0x805c('0x182')]||0x32;_0x4a5f10[_0x805c('0x183')]=_0xacc201['dialAMDMaximumNumberOfWords']||0x3;_0x4a5f10[_0x805c('0x184')]=_0xacc201[_0x805c('0x185')]||0x100;_0x4a5f10[_0x805c('0x186')]=_0xacc201[_0x805c('0x187')]||0x1388;}if(_0xacc201[_0x805c('0x55')]===_0x805c('0x175')){_0x4a5f10[_0x805c('0x188')]=_0x58e10[_0x805c('0xd6')];}else{_0x4a5f10[_0x805c('0x189')]=_0x58e10[_0x805c('0xd7')];}for(var _0x1f46cb in _0x58e10[_0x805c('0x170')]){if(_0x58e10['Contact'][_0x805c('0x9f')](_0x1f46cb)){if(isNotNull(_0x58e10[_0x805c('0x170')][_0x1f46cb])&&_0x1f46cb!=='id'&&_0x1f46cb!=='tags'&&_0x1f46cb!==_0x805c('0x18a')&&_0x1f46cb!==_0x805c('0x18b')){_0x4a5f10[util['format']('%s%s','XMD-',_[_0x805c('0x18c')](_0x1f46cb))]=_0x58e10[_0x805c('0x170')][_0x1f46cb];}}}var _0x47a09f=_0x555b50['isTrunkReachable'](_0xacc201[_0x805c('0x7b')])?getCallerId(_0xacc201[_0x805c('0x7b')][_0x805c('0x7d')],_0xacc201[_0x805c('0x18d')],_0xacc201['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xacc201[_0x805c('0x61')],_0xacc201['dialRandomLastDigitCallerIdNumber']):_0xacc201[_0x805c('0x61')]):getCallerId(_[_0x805c('0xb2')](_0xacc201[_0x805c('0x143')])?_0xacc201[_0x805c('0x7b')]['callerid']:_0xacc201[_0x805c('0x143')][_0x805c('0x7d')],_0xacc201[_0x805c('0x18d')],_0xacc201[_0x805c('0x18e')]>0x0?getCallerIdRandom(_0xacc201[_0x805c('0x61')],_0xacc201[_0x805c('0x18e')]):_0xacc201[_0x805c('0x61')]);if(_0x47a09f){_0x4a5f10[_0x805c('0x18f')]=_0x555b50['actions'][_0x5b9342]['originatecalleridname']=extractCalleridName(_0x47a09f);_0x4a5f10['XMD-ORIGINATECALLERIDNUM']=_0x555b50[_0x805c('0x2c')][_0x5b9342]['originatecalleridnum']=extractCalleridNumber(_0x47a09f);}return ami[_0x805c('0xb3')]({'actionid':_0x5b9342,'action':_0x805c('0x16e'),'channel':_0x555b50[_0x805c('0xdb')](_0xacc201[_0x805c('0x7b')])?util[_0x805c('0x7e')](_0x805c('0x190'),_0xacc201[_0x805c('0x7b')][_0x805c('0x46')],isNotNull(_0xacc201[_0x805c('0x191')])?_0xacc201[_0x805c('0x191')]['trim']()||'':'',_0xacc201['dialCutDigit']>0x0?_0x58e10['Contact'][_0x805c('0x171')][_0x805c('0x192')](_0xacc201[_0x805c('0x193')]):_0x58e10[_0x805c('0x170')][_0x805c('0x171')]):util[_0x805c('0x7e')](_0x805c('0x190'),_[_0x805c('0xb2')](_0xacc201[_0x805c('0x143')])?_0xacc201[_0x805c('0x7b')][_0x805c('0x46')]:_0xacc201[_0x805c('0x143')]['name'],isNotNull(_0xacc201[_0x805c('0x191')])?_0xacc201[_0x805c('0x191')][_0x805c('0x194')]()||'':'',_0xacc201['dialCutDigit']>0x0?_0x58e10[_0x805c('0x170')][_0x805c('0x171')][_0x805c('0x192')](_0xacc201['dialCutDigit']):_0x58e10['Contact']['phone']),'callerid':_0x47a09f,'Exten':_0x805c('0xe3'),'Context':'from-sip','Priority':'1','variable':_0x4a5f10,'timeout':(_0xacc201[_0x805c('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b9342})[_0x805c('0xbc')](function(_0x2343f2){return _0x5de34e(_0x2343f2);})[_0x805c('0xb5')](function(_0x3e8aba){_0xacc201[_0x805c('0x195')]+=0x1;var _0x489964=new History(_0x555b50['actions'][_0x5b9342]);logger[_0x805c('0x9b')](util[_0x805c('0x7e')]('[originateError]:\x20%s',JSON['stringify'](_0x3e8aba)));_0x489964[_0x805c('0xac')]=0xe;_0x489964['statedesc']=_0x805c('0x196');_0x489964[_0x805c('0x121')]=moment()[_0x805c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x489964[_0x805c('0xad')]=_0x489964[_0x805c('0x121')];_0x555b50[_0x805c('0xcc')](_0x489964)[_0x805c('0xb5')](loggerCatch(_0x805c('0x197')));_0x555b50[_0x805c('0xca')](_0x489964)[_0x805c('0xb5')](loggerCatch('[originate][error]'))[_0x805c('0x23')](function(){delete _0x555b50[_0x805c('0x2c')][_0x5b9342];return _0x3a41f9(msgResponse(_0x805c('0x16e'),_0x805c('0x198'),_0x805c('0x199')));});});});};Dialer[_0x805c('0x21')][_0x805c('0x36')]=function(_0x6bf81b){var _0x1ad003=this[_0x805c('0x2c')][_0x6bf81b[_0x805c('0x12d')]];var _0x1aef56=this;if(_0x1ad003){delete this[_0x805c('0x2c')][_0x6bf81b['actionid']];_0x1ad003['responsetime']=moment()[_0x805c('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1a2f4d=_0x1ad003[_0x805c('0x55')]===_0x805c('0x81')?this[_0x805c('0x27')][_0x1ad003[_0x805c('0xb8')]]:this['voiceQueues'][_0x1ad003['getQueue']()];if(!this[_0x805c('0x19a')](_0x6bf81b[_0x805c('0x19b')])){this[_0x805c('0xb9')](_0x1a2f4d);return this[_0x805c('0x19c')](_0x1ad003,_0x1a2f4d,_0x6bf81b)[_0x805c('0xbc')](function(_0x7a4534){})[_0x805c('0xb5')](loggerCatch(_0x805c('0x19d')));}else{this['uniqueId'][_0x6bf81b[_0x805c('0xed')]]=_0x1ad003;}}};Dialer[_0x805c('0x21')][_0x805c('0x19e')]=function(_0x2cdaed,_0x113830,_0x2a1524){var _0x3eb637=new History(_0x113830);if(_0x3eb637['countbusyretry']+_0x3eb637['countcongestionretry']+_0x3eb637[_0x805c('0xf3')]+_0x3eb637[_0x805c('0xf4')]+_0x3eb637[_0x805c('0xf5')]+_0x3eb637[_0x805c('0x105')]+_0x3eb637[_0x805c('0xf6')]+_0x3eb637[_0x805c('0xf7')]>=_0x2a1524[_0x805c('0x106')]-0x1){return!![];}switch(_0x2cdaed){case 0x3:if(_0x3eb637[_0x805c('0xf3')]>=_0x2a1524[_0x805c('0x19f')]-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countnoanswerretry':_0x3eb637[_0x805c('0xf3')]+=0x1,'scheduledat':moment()['add'](_0x2a1524[_0x805c('0x1a0')],'minutes')[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x1a1')));}break;case 0x5:if(_0x3eb637[_0x805c('0x104')]>=_0x2a1524[_0x805c('0x1a2')]-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countbusyretry':_0x3eb637['countbusyretry']+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524[_0x805c('0x1a3')],_0x805c('0xff'))['format'](_0x805c('0x100')),'ContactId':_0x3eb637['ContactId'],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x1a4')));}break;case 0x8:if(_0x3eb637[_0x805c('0xf2')]>=_0x2a1524[_0x805c('0x1a5')]-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countcongestionretry':_0x3eb637[_0x805c('0xf2')]+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524[_0x805c('0x1a6')],_0x805c('0xff'))['format'](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x1a7')));}break;case 0x0:if(_0x3eb637[_0x805c('0xf4')]>=_0x2a1524[_0x805c('0x1a8')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3eb637[_0x805c('0xf4')]+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524['dialNoSuchNumberRetryFrequency'],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637['ListId'],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3eb637[_0x805c('0xf5')]>=_0x2a1524[_0x805c('0x11e')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3eb637[_0x805c('0xf5')]+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524[_0x805c('0x11f')],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637['CampaignId']||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x120')));}break;case 0xb:if(_0x3eb637[_0x805c('0x105')]>=_0x2a1524[_0x805c('0x127')]-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countabandonedretry':_0x3eb637[_0x805c('0x105')]+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524[_0x805c('0x128')],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x129')));}break;case 0x13:if(_0x3eb637[_0x805c('0xf6')]>=_0x2a1524['dialMachineMaxRetry']-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countmachineretry':_0x3eb637[_0x805c('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x2a1524[_0x805c('0xfe')],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637['ContactId'],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})['catch'](loggerCatch(_0x805c('0x107')));}break;case 0x14:if(_0x3eb637[_0x805c('0xf7')]>=_0x2a1524[_0x805c('0x1a9')]-0x1){return!![];}else{this[_0x805c('0xc2')]({'active':![],'countagentrejectretry':_0x3eb637[_0x805c('0xf7')]+=0x1,'scheduledat':moment()[_0x805c('0xfd')](_0x2a1524['dialAgentRejectRetryFrequency'],_0x805c('0xff'))[_0x805c('0x7e')](_0x805c('0x100')),'ContactId':_0x3eb637[_0x805c('0xd3')],'ListId':_0x3eb637[_0x805c('0xd4')],'VoiceQueueId':_0x3eb637[_0x805c('0xd6')]||undefined,'CampaignId':_0x3eb637[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0x805c('0x21')][_0x805c('0x19c')]=function(_0x2d49d4,_0xb87c08,_0x335eef){var _0x1a3af7=this;var _0x51c9d7=new History(_0x2d49d4);return new BPromise(function(_0x349996,_0x447cb3){if(_[_0x805c('0x44')](_0xb87c08)&&_0x805c('0x1aa')!==typeof _0xb87c08){return _0x447cb3(msgResponse('[callProgressDetecting]',_0x805c('0x148'),_0x805c('0x1ab')));}if(_[_0x805c('0x44')](_0x335eef)&&_0x805c('0x1aa')!==typeof _0x335eef){return _0x447cb3(msgResponse(_0x805c('0x1ac'),_0x805c('0x148'),'evt\x20is\x20undefine'));}switch(_0x335eef[_0x805c('0x10d')]){case'0':_0xb87c08[_0x805c('0x69')]+=0x1;_0x51c9d7[_0x805c('0xac')]=0x0;_0x51c9d7['statedesc']=_0x805c('0x1ad');_0x51c9d7[_0x805c('0xf4')]+=0x1;_0x51c9d7[_0x805c('0xef')]+=0x1;ami[_0x805c('0x1ae')](_0x805c('0x1af'),ut['buildObj'](_0x2d49d4,_0x805c('0x1b0')));_0x1a3af7[_0x805c('0xcc')](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0xf1')));if(_0x1a3af7[_0x805c('0x19e')](0x0,_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0xf4')]>=_0xb87c08['dialNoSuchNumberMaxRetry']){_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,'reason\x200\x20no\x20such\x20number....');}else{_0x1a3af7[_0x805c('0xf8')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1b1'));}}break;case'3':_0xb87c08[_0x805c('0x68')]+=0x1;_0x51c9d7['state']=0x3;_0x51c9d7['statedesc']='NoAnswer';_0x51c9d7[_0x805c('0xf3')]+=0x1;_0x51c9d7['countglobal']+=0x1;ami[_0x805c('0x1ae')](_0x805c('0x1b2'),ut[_0x805c('0x1b3')](_0x2d49d4,'noanswer'));_0x1a3af7[_0x805c('0xcc')](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0x1b4')));if(_0x1a3af7['checkRetriveMax'](0x3,_0x2d49d4,_0xb87c08)){if(_0x51c9d7['countnoanswerretry']>=_0xb87c08[_0x805c('0x19f')]){_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1a3af7['stateGlobal'](_0x51c9d7,_0x349996,_0x447cb3,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xb87c08[_0x805c('0x65')]+=0x1;_0x51c9d7['state']=0x5;_0x51c9d7[_0x805c('0xe7')]='Busy';_0x51c9d7[_0x805c('0x104')]+=0x1;_0x51c9d7[_0x805c('0xef')]+=0x1;ami[_0x805c('0x1ae')](_0x805c('0x1b5'),ut['buildObj'](_0x2d49d4,_0x805c('0x1b6')));_0x1a3af7[_0x805c('0xcc')](_0x51c9d7)['catch'](loggerCatch(_0x805c('0x1b7')));if(_0x1a3af7[_0x805c('0x19e')](0x5,_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0x104')]>=_0xb87c08['dialBusyMaxRetry']){_0x1a3af7['createStateFinal'](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1b8'));}else{_0x1a3af7[_0x805c('0xf8')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1b8'));}}break;case'8':_0xb87c08[_0x805c('0x66')]+=0x1;_0x51c9d7['state']=0x8;_0x51c9d7[_0x805c('0xe7')]=_0x805c('0x1b9');_0x51c9d7[_0x805c('0xf2')]+=0x1;_0x51c9d7[_0x805c('0xef')]+=0x1;ami[_0x805c('0x1ae')](_0x805c('0x1ba'),ut[_0x805c('0x1b3')](_0x2d49d4,_0x805c('0x1bb')));_0x1a3af7[_0x805c('0xcc')](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0x1bc')));if(_0x1a3af7['checkRetriveMax'](0x8,_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0xf2')]>=_0xb87c08[_0x805c('0x1a5')]){_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1bd'));}else{_0x1a3af7['stateGlobal'](_0x51c9d7,_0x349996,_0x447cb3,'reason\x208\x20congestion');}}break;case'11':_0xb87c08['outboundAbandonedCallsDay']+=0x1;_0x51c9d7[_0x805c('0xac')]=0xb;_0x51c9d7['statedesc']=_0x805c('0x12a');_0x51c9d7[_0x805c('0x105')]+=0x1;_0x51c9d7[_0x805c('0xef')]+=0x1;_0x1a3af7['createHistory'](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0x12b')));if(_0x1a3af7['checkRetriveMax'](0xb,_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0x105')]>=_0xb87c08[_0x805c('0x127')]){_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1be'));}else{_0x1a3af7[_0x805c('0xf8')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1be'));}}break;case'20':_0xb87c08[_0x805c('0x6a')]+=0x1;_0x51c9d7[_0x805c('0xac')]=0x14;_0x51c9d7[_0x805c('0xe7')]='AgentReject';_0x51c9d7[_0x805c('0xf7')]+=0x1;_0x51c9d7[_0x805c('0xef')]+=0x1;ami[_0x805c('0x1ae')]('custom:agentreject',ut[_0x805c('0x1b3')](_0x2d49d4,_0x805c('0x1bf')));_0x1a3af7[_0x805c('0xcc')](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0x1c0')));if(_0x1a3af7[_0x805c('0x19e')](0x14,_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0xf7')]>=_0xb87c08['dialAgentRejectMaxRetry']){_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,'reason\x2020\x20agentreject');}else{_0x1a3af7[_0x805c('0xf8')](_0x51c9d7,_0x349996,_0x447cb3,_0x805c('0x1c1'));}}break;default:_0xb87c08[_0x805c('0x6b')]+=0x1;_0x51c9d7['state']=0xc;_0x51c9d7[_0x805c('0xe7')]=_0x335eef[_0x805c('0x10d')];_0x1a3af7['createHistory'](_0x51c9d7)[_0x805c('0xb5')](loggerCatch(_0x805c('0x1c2')));if(_0x1a3af7[_0x805c('0x19e')](_0x335eef[_0x805c('0x10d')],_0x2d49d4,_0xb87c08)){if(_0x51c9d7[_0x805c('0x104')]+_0x51c9d7[_0x805c('0xf2')]+_0x51c9d7[_0x805c('0xf3')]+_0x51c9d7['countnosuchnumberretry']+_0x51c9d7[_0x805c('0xf5')]+_0x51c9d7['countabandonedretry']+_0x51c9d7[_0x805c('0xf6')]+_0x51c9d7['countagentrejectretry']>=_0xb87c08[_0x805c('0x106')]){_0x1a3af7[_0x805c('0xf8')](_0x51c9d7,_0x349996,_0x447cb3,_0x335eef[_0x805c('0x10d')]);}else{_0x1a3af7[_0x805c('0xfb')](_0x51c9d7,_0x349996,_0x447cb3,_0x335eef[_0x805c('0x10d')]);}}}});};Dialer['prototype'][_0x805c('0xf8')]=function(_0x3d180e,_0x1148e0,_0x4a664b,_0x3439e7){var _0x31f545=new Final(_0x3d180e);_0x31f545[_0x805c('0xac')]=0xf;_0x31f545['statedesc']=_0x805c('0x1c3');this['createStateFinal'](_0x31f545,_0x1148e0,_0x4a664b,_0x3439e7);};Dialer[_0x805c('0x21')]['createStateFinal']=function(_0x37310e,_0x52e2f2,_0x234e64,_0xe267de){this[_0x805c('0xca')](_0x37310e)[_0x805c('0xbc')](function(_0xeaf9cc){return _0x52e2f2(msgResponse(_0x805c('0x1ac'),_0x805c('0xda'),_0xe267de));})[_0x805c('0xb5')](function(_0x28e00c){return _0x234e64(msgResponse(_0x805c('0x1c4'),_0x805c('0x148'),_0x805c('0x1c5')));});};Dialer[_0x805c('0x21')][_0x805c('0xa')]=function(_0x163caf){var _0x1a24fb=this;var _0x57a5ea=_0x163caf[_0x805c('0x1c6')]/0x64;var _0x3ddf0e=_0x163caf[_0x805c('0x119')]/(_0x163caf['outboundDropCallsDayTimeout']+_0x163caf['outboundAnswerCallsDay']);var _0x4b7fa1=Math['round'](_0x163caf[_0x805c('0x75')]*(_0x163caf[_0x805c('0x1c7')]/0x64));var _0x1c9103=Math['round'](_0x163caf[_0x805c('0x75')]*(_0x163caf[_0x805c('0x1c8')]/0x64));var _0x174516=_0x163caf[_0x805c('0x56')]+_0x163caf[_0x805c('0x5a')];var _0x1a13a2=Math[_0x805c('0x1c9')](_0x163caf['erlangCalls']*_0x163caf[_0x805c('0x78')]*_0x163caf[_0x805c('0x72')]*_0x163caf[_0x805c('0x73')]);if(_[_0x805c('0x44')](_0x163caf[_0x805c('0x93')])){if(!_[_0x805c('0x44')](_0x163caf[_0x805c('0x7a')])){_0x163caf[_0x805c('0x7a')]=undefined;loggerPredictive[_0x805c('0x9b')]('[startMethodPredictive][StartProgressive]',_0x805c('0x1ca'));}if(!_[_0x805c('0x44')](_0x163caf[_0x805c('0x96')])){loggerPredictive[_0x805c('0x9b')](_0x805c('0x1cb'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x163caf[_0x805c('0x96')]);_0x163caf['handlePredictive']=undefined;}_0x163caf['startProgressive']=moment()['format'](_0x805c('0x100'));loggerPredictive['info'](_0x163caf[_0x805c('0x46')],_0x805c('0x1cc'),_0x163caf[_0x805c('0x93')]);this[_0x805c('0x15c')](_0x163caf,0x1);}else if(ifInterval(_0x163caf['dialPredictiveInterval'],_0x163caf[_0x805c('0x93')])){this[_0x805c('0x15c')](_0x163caf,0x1);loggerPredictiveCalls[_0x805c('0x83')](_0x805c('0x1cd'),_0x163caf[_0x805c('0x93')],_0x163caf[_0x805c('0x46')]);_0x163caf[_0x805c('0x77')]=0x0;_0x163caf[_0x805c('0x71')]=0x0;}else if(_0x57a5ea<_0x3ddf0e&&_0x163caf[_0x805c('0x1ce')]===_0x805c('0x1cf')){freeVariablesPredictive(_0x163caf);loggerPredictive[_0x805c('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x805c('0x1d0'),_0x3ddf0e,_0x805c('0x93'),_0x163caf[_0x805c('0x46')]);}else if(_0x1a13a2<_0x163caf[_0x805c('0x71')]&&_0x163caf['dialPredictiveOptimization']===_0x805c('0x1cf')){freeVariablesPredictive(_0x163caf);loggerPredictive[_0x805c('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x805c('0x1d1'),_0x1a13a2,_0x805c('0x1d2'),_0x163caf['predictiveIntervalErlangCallsDroppedCalls'],_0x805c('0x93'),_0x163caf['name']);}else if(!ifInterval(_0x163caf[_0x805c('0x1d3')],_0x163caf[_0x805c('0x93')])&&_[_0x805c('0x44')](_0x163caf[_0x805c('0x7a')])&&!_[_0x805c('0x44')](_0x163caf[_0x805c('0x93')])){_0x163caf[_0x805c('0x7a')]=moment()['format'](_0x805c('0x100'));loggerPredictive['info'](_0x163caf['name'],_0x805c('0x1d4'),_0x163caf[_0x805c('0x7a')]);this[_0x805c('0x1d5')](_0x163caf[_0x805c('0x1d3')])[_0x805c('0xbc')](this[_0x805c('0x1d6')](_0x163caf))[_0x805c('0xbc')](mergeDataErlangB(_0x163caf))[_0x805c('0xbc')](this['startMethodPredictive'](_0x163caf))[_0x805c('0xb5')](loggerCatchPredictive(_0x805c('0x1d7'),_0x163caf));}else if(!ifInterval(_0x163caf['dialPredictiveInterval'],_0x163caf['startPredictive'])){_0x163caf[_0x805c('0x71')]=0x0;_0x163caf[_0x805c('0x7a')]=moment()[_0x805c('0x7e')](_0x805c('0x100'));loggerPredictive['info'](_0x163caf[_0x805c('0x46')],_0x805c('0x1d8'),_0x163caf[_0x805c('0x7a')]);clearInterval(_0x163caf[_0x805c('0x96')]);_0x163caf[_0x805c('0x96')]=undefined;this['averageHandleTime'](_0x163caf[_0x805c('0x1d3')])['then'](this[_0x805c('0x1d6')](_0x163caf))[_0x805c('0xbc')](mergeDataErlangB(_0x163caf))[_0x805c('0xbc')](this[_0x805c('0x1d9')](_0x163caf))[_0x805c('0xb5')](loggerCatchPredictive(_0x805c('0x1da'),_0x163caf));}else if(_0x163caf['predictiveIntervalAvailable']&&_0x174516<_0x163caf['predictiveIntervalAvailable']-_0x1c9103){freeVariablesPredictive(_0x163caf);loggerPredictive[_0x805c('0x83')](_0x163caf[_0x805c('0x46')],_0x805c('0x1db'),_0x174516,_0x805c('0x1dc'),_0x163caf[_0x805c('0x75')],'-',_0x1c9103,'=',_0x163caf[_0x805c('0x75')]-_0x1c9103,')');}else if(_0x163caf[_0x805c('0x75')]&&_0x174516>_0x163caf[_0x805c('0x75')]+_0x4b7fa1){freeVariablesPredictive(_0x163caf);loggerPredictive[_0x805c('0x83')](_0x163caf[_0x805c('0x46')],_0x805c('0x1db'),_0x174516,_0x805c('0x1dd'),_0x163caf[_0x805c('0x75')],'+',_0x4b7fa1,'=',_0x163caf[_0x805c('0x75')]+_0x4b7fa1,')');}};Dialer[_0x805c('0x21')][_0x805c('0x1d6')]=function(_0x547749){var _0x16109d=this;return function(_0x220051){return new BPromise(function(_0x420164,_0x2359b6){_[_0x805c('0x92')](_0x547749,_0x220051[0x0]);if(checkGetDataPredictive(_0x220051[0x0])){var _0x50efe7=_0x547749[_0x805c('0x75')]=_0x547749[_0x805c('0x5a')]+_0x547749[_0x805c('0x56')];var _0x25f5dc=_0x547749[_0x805c('0x1d3')]*0x3c;var _0x2f4fce=_0x220051[0x0][_0x805c('0x89')]+_0x220051[0x0][_0x805c('0x6d')];var _0x25224b=(_0x220051[0x0]['predictiveIntervalAnsweredCalls']+_0x220051[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x220051[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x220051[0x0]['predictiveIntervalTotalCalls'];_0x547749[_0x805c('0x72')]=_0x25224b>0x0?_0x25224b:0x1;switch(_0x547749['dialPredictiveOptimization']){case _0x805c('0x1cf'):var _0x14aaa6=_0x547749[_0x805c('0x1c6')]/0x64;return _0x16109d['abandonmentRate'](_0x50efe7,_0x25f5dc,_0x2f4fce,_0x25224b,_0x14aaa6)[_0x805c('0xbc')](function(_0x564787){return _0x420164(_0x564787);});case _0x805c('0x1de'):var _0x47061a=_0x547749[_0x805c('0x1c6')]/0x64;return _0x16109d[_0x805c('0x1df')](_0x50efe7,_0x25f5dc,_0x2f4fce,_0x25224b,_0x47061a)[_0x805c('0xbc')](function(_0x400365){return _0x420164(_0x400365);});default:return _0x2359b6(msgResponse(_0x805c('0x1e0'),_0x805c('0x148'),'Unknown\x20Predictive'));}}else{return _0x2359b6(msgResponse(_0x805c('0x1e0'),_0x805c('0x148'),_0x805c('0x1e1')));}});};};Dialer[_0x805c('0x21')][_0x805c('0x1e2')]=function(_0x82afdb){var _0x46c90d=this;return function(_0x32cf8e){return new BPromise(function(_0x138d27,_0x475e1d){_['merge'](_0x82afdb,_0x32cf8e[0x0]);if(checkGetDataPredictive(_0x32cf8e[0x0])){loggerPredictive[_0x805c('0x83')](JSON['stringify'](_0x32cf8e[0x0]));if(_0x82afdb[_0x805c('0x1ce')]===_0x805c('0x1cf')){return _0x46c90d[_0x805c('0xc8')](_0x82afdb['id'])['then'](function(_0x13bb34){var _0x4b6e66=_0x82afdb[_0x805c('0x57')]-_0x13bb34[0x0][_0x805c('0x1e3')];var _0x3b4804=_0x82afdb['dialPredictiveInterval']*0x3c;var _0x22a996=_0x32cf8e[0x0][_0x805c('0x89')]+_0x32cf8e[0x0]['predictiveIntervalAvgHoldtime'];var _0x3c9c30=(_0x32cf8e[0x0][_0x805c('0x6c')]+_0x32cf8e[0x0][_0x805c('0x6f')]+_0x32cf8e[0x0][_0x805c('0x6e')])/_0x32cf8e[0x0]['predictiveIntervalTotalCalls'];var _0x5f209b=_0x82afdb[_0x805c('0x1c6')]/0x64;_0x82afdb[_0x805c('0x74')]=_0x13bb34[0x0][_0x805c('0x1e3')]||0x0;_0x82afdb[_0x805c('0x72')]=_0x3c9c30>0x0?_0x3c9c30:0x1;return _0x46c90d[_0x805c('0x1e4')](_0x4b6e66,_0x3b4804,_0x22a996,_0x3c9c30,_0x5f209b);})[_0x805c('0xbc')](function(_0x37f4cd){return _0x138d27(_0x37f4cd);})['catch'](function(_0x1a70b9){return _0x475e1d(msgResponse(_0x805c('0x1e5'),_0x805c('0x148'),JSON[_0x805c('0x51')](_0x1a70b9)));});}if(_0x82afdb['dialPredictiveOptimization']==='agentBusyFactor'){return _0x46c90d[_0x805c('0xc8')](_0x82afdb['id'])[_0x805c('0xbc')](function(_0x2aee5c){var _0x220e1c=_0x82afdb[_0x805c('0x57')]-_0x2aee5c[0x0][_0x805c('0x1e3')];var _0x149d75=_0x82afdb['dialPredictiveInterval']*0x3c;var _0x40d794=_0x32cf8e[0x0]['predictiveIntervalAvgTalktime']+_0x32cf8e[0x0]['predictiveIntervalAvgHoldtime'];var _0x7dd15=(_0x32cf8e[0x0][_0x805c('0x6c')]+_0x32cf8e[0x0][_0x805c('0x6f')]+_0x32cf8e[0x0][_0x805c('0x6e')])/_0x32cf8e[0x0]['predictiveIntervalTotalCalls'];var _0x42846f=_0x82afdb[_0x805c('0x1c6')]/0x64;_0x82afdb[_0x805c('0x74')]=_0x2aee5c[0x0][_0x805c('0x1e3')]||0x0;_0x82afdb[_0x805c('0x72')]=_0x7dd15>0x0?_0x7dd15:0x1;return _0x46c90d[_0x805c('0x1df')](_0x220e1c,_0x149d75,_0x40d794,_0x7dd15,_0x42846f);})[_0x805c('0xbc')](function(_0x4555fc){return _0x138d27(_0x4555fc);})[_0x805c('0xb5')](function(_0x3ebdbf){return _0x475e1d(msgResponse(_0x805c('0x1e5'),'Failure',JSON[_0x805c('0x51')](_0x3ebdbf)));});}}else{return _0x475e1d(msgResponse('[getDataPredictive]',_0x805c('0x148'),'check\x20failure'));}});};};Dialer[_0x805c('0x21')][_0x805c('0x1d9')]=function(_0x30e92d){var _0x4c4324=this;return function(){var _0xe45e7c=0x0;var _0x29c40b=Math[_0x805c('0x1c9')](_0x30e92d[_0x805c('0x1e6')]*0x3e8);if(_0x29c40b>0x0){_0x29c40b=_0x29c40b<0x64?0x64:_0x29c40b;loggerPredictive[_0x805c('0x83')](_0x30e92d[_0x805c('0x46')],_0x805c('0x1e7'),_0x29c40b,_0x805c('0x52'));_0x30e92d[_0x805c('0x96')]=setInterval(function(){_0x4c4324[_0x805c('0x96')](_0x30e92d);loggerPredictiveCalls['info'](_0x805c('0x1e8'),_0xe45e7c+=0x1);},_0x29c40b);}else{loggerPredictive[_0x805c('0x83')](_0x30e92d['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x805c('0x21')][_0x805c('0x1e9')]=function(_0x3134e5,_0x180525){var _0x5d124e=this;return function(_0x1a512c){if(_[_0x805c('0x4f')](_0x1a512c)){if(_['isNil'](_0x180525[_0x805c('0xd5')])||!_0x180525[_0x805c('0x1ea')]){if(_0x3134e5[_0x805c('0x60')]===_0x805c('0x9')){_0x3134e5[_0x805c('0x132')]=_[_0x805c('0x44')](_0x3134e5['queueStatusComplete'])?!![]:_0x3134e5[_0x805c('0x132')];var _0x6d5be6=uuid['v4']();_0x5d124e[_0x805c('0x2c')][_0x6d5be6]=new Action(_0x3134e5,_0x180525,_0x6d5be6);loggerBooked['info'](_0x805c('0x1eb'),_0x6d5be6,_0x805c('0x1ec'),JSON[_0x805c('0x51')](_0x3134e5[_0x805c('0x132')]),_0x805c('0x1ed'),_0x3134e5[_0x805c('0x46')]);if(_0x3134e5[_0x805c('0x132')]){_0x3134e5[_0x805c('0x132')]=![];_0x5d124e[_0x805c('0x31')][_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xb8')]]=[];ami['Action']({'actionid':_0x6d5be6,'action':'queuestatus','queue':_0x3134e5['name']})[_0x805c('0xb5')](function(_0x1b6963){_0x5d124e[_0x805c('0xb9')](_0x3134e5);_0x5d124e[_0x805c('0xc2')]({'active':![],'ContactId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6]['ContactId'],'ListId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd4')],'VoiceQueueId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd6')]||undefined,'CampaignId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6]['CampaignId']||undefined})[_0x805c('0xb5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5d124e[_0x805c('0x2c')][_0x6d5be6];});}else{loggerBooked[_0x805c('0x83')](_0x805c('0x1ee'),JSON[_0x805c('0x51')](_0x3134e5[_0x805c('0x132')]),'Queue:\x20',_0x3134e5['name']);_0x5d124e[_0x805c('0xb9')](_0x3134e5);_0x5d124e[_0x805c('0xc2')]({'active':![],'ContactId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd3')],'ListId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd4')],'VoiceQueueId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd6')]||undefined,'CampaignId':_0x5d124e[_0x805c('0x2c')][_0x6d5be6][_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x1ef')));delete _0x5d124e[_0x805c('0x2c')][_0x6d5be6];}}else{return _0x5d124e[_0x805c('0x1f0')](_0x3134e5,_0x180525);}}else{if(getDiff(_0x180525[_0x805c('0x1f1')])<_0x3134e5[_0x805c('0x1f2')]*0x3c){if(_0x180525[_0x805c('0x1f3')]&&!_0x180525[_0x805c('0x1f3')][_0x805c('0x1f4')]){_0x5d124e['preview'][_0x805c('0x13b')](_0x180525['id'])['finally'](function(){_0x5d124e[_0x805c('0xb9')](_0x3134e5);});}else{_0x5d124e[_0x805c('0xc4')]({'active':![]},_0x180525['id'],0x1)[_0x805c('0x23')](function(){console[_0x805c('0x1f5')](_0x805c('0x1f6'));_0x5d124e[_0x805c('0xb9')](_0x3134e5);});}}else{_0x3134e5[_0x805c('0x1f7')]+=0x1;_0x5d124e[_0x805c('0xb9')](_0x3134e5);if(_0x3134e5['dialRecallInQueue']){_0x5d124e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x180525[_0x805c('0xd3')],'ListId':_0x180525[_0x805c('0xd4')],'VoiceQueueId':_0x180525['VoiceQueueId']||undefined,'CampaignId':_0x180525[_0x805c('0xd7')]||undefined})[_0x805c('0xb5')](loggerCatch(_0x805c('0x1f8')));_0x5d124e[_0x805c('0xcc')](createObjHistory(_0x3134e5,_0x180525,_0x805c('0x1f9'),0x17,_0x805c('0x1fa')))['catch'](loggerCatch(_0x805c('0x1fb')));}else{_0x5d124e['saveInDb'](createObjHistory(_0x3134e5,_0x180525,_0x805c('0x1fc'),0x16,_0x805c('0x1fd')),'[Originate][HistoryRecallClose][historyCatch]',_0x805c('0x1fe'));}}}}else{_0x3134e5[_0x805c('0x1ff')]+=0x1;_0x5d124e[_0x805c('0xd1')](createObjHistory(_0x3134e5,_0x180525,_0x805c('0x200'),0xd,'Blacklist'),_0x805c('0x201'),_0x805c('0x202'));throw'inBlackList';}};};Dialer[_0x805c('0x21')][_0x805c('0x161')]=function(_0x4c0eb5){var _0x36f08d=this;var _0x4c204a=[];var _0x1a5062=_0x4c0eb5[_0x805c('0x203')]-_0x4c0eb5[_0x805c('0xa0')]-_0x4c0eb5[_0x805c('0x204')];emitCampaignSummary(_0x4c0eb5);if(_0x1a5062>0x0){if(_0x1a5062>this[_0x805c('0x2a')]){_0x1a5062=this[_0x805c('0x2a')];}_0x4c0eb5[_0x805c('0x204')]+=_0x1a5062;this[_0x805c('0xc6')](_0x4c0eb5['id'],_0x1a5062,_0x4c0eb5[_0x805c('0x205')])[_0x805c('0xbc')](function(_0x15e09f){_0x4c0eb5[_0x805c('0x204')]-=_0x1a5062;_0x4c0eb5['temp']=_0x4c0eb5[_0x805c('0x204')]>0x0?_0x4c0eb5[_0x805c('0x204')]:0x0;if(!checkContactEmpty(_0x15e09f)){_0x4c0eb5[_0x805c('0x48')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x805c('0x83')](_0x805c('0x206')+_0x4c0eb5[_0x805c('0x46')]);}else{_0x4c0eb5[_0x805c('0xa0')]+=_0x15e09f[_0x805c('0x9e')];_0x4c0eb5[_0x805c('0x48')]=_0x805c('0x207');for(var _0x1677ed=0x0;_0x1677ed<_0x15e09f['length'];_0x1677ed+=0x1){_0x4c0eb5[_0x805c('0x208')]+=0x1;if(_[_0x805c('0xb2')](_0x15e09f[_0x1677ed])||_[_0x805c('0xb2')](_0x15e09f[_0x1677ed][_0x805c('0x170')])||_[_0x805c('0xb2')](_0x15e09f[_0x1677ed][_0x805c('0x170')][_0x805c('0x171')])){_0x36f08d[_0x805c('0xcf')](_0x805c('0x209'),_0x4c0eb5,_0x15e09f[_0x1677ed]);}else{_0x36f08d['checkIsBlackListIvr'](_[_0x805c('0xd2')](_0x15e09f[_0x1677ed],[_0x805c('0xd7'),_0x805c('0x20a')]))[_0x805c('0xbc')](_0x36f08d[_0x805c('0x1e9')](_0x4c0eb5,_0x15e09f[_0x1677ed]))['catch'](_0x36f08d[_0x805c('0x20b')]('[actionOriginateIvr]\x20',_0x4c0eb5));}}}})[_0x805c('0xb5')](loggerGetContactDialer(_0x805c('0x20c'),_0x4c0eb5,_0x1a5062));}};Dialer[_0x805c('0x21')][_0x805c('0x15c')]=function(_0x19d761,_0x5ba2c5){var _0x23d7cd=this;var _0x4fc407=[];var _0x247791=_0x5ba2c5>=0x1?_0x5ba2c5:0x1;var _0xd0bdc0=[];if(_0x19d761[_0x805c('0x60')]===_0x805c('0x9')){_0x247791=0x1;}var _0x20a33b=Math[_0x805c('0x1c9')](_0x19d761['available']*_0x247791)-_0x19d761['originated']-_0x19d761['temp'];emitVoiceQueueSummary(_0x19d761);if(_0x19d761['dialLimitQueue']>0x0){var _0x29e9a9=_0x19d761['dialLimitQueue']-_0x19d761[_0x805c('0xa0')]-_0x19d761[_0x805c('0x5a')]-_0x19d761[_0x805c('0x204')]-_0x19d761['pTalking'];if(_0x20a33b>_0x29e9a9){_0x20a33b=_0x29e9a9;}}if(_0x20a33b>0x0){if(_0x19d761[_0x805c('0x60')]===_0x805c('0x9')){_0x20a33b=0x1;}if(_0x20a33b>this[_0x805c('0x2a')]){_0x20a33b=this[_0x805c('0x2a')];}_0x19d761['temp']+=_0x20a33b;for(var _0x104eb1 in this[_0x805c('0x28')]){if(this[_0x805c('0x28')][_0x805c('0x9f')](_0x104eb1)){if(this[_0x805c('0x28')][_0x104eb1][_0x805c('0xac')]==='not_inuse'&&this[_0x805c('0x28')][_0x104eb1][_0x805c('0xdd')]===_0x805c('0xde')){_0x4fc407['push'](this[_0x805c('0x28')][_0x104eb1]['id']);}}}this[_0x805c('0xc5')](_0x19d761['id'],_0x4fc407,_0x20a33b,_0x19d761[_0x805c('0x205')])['then'](function(_0x145b7b){_0x19d761['temp']-=_0x20a33b;_0x19d761[_0x805c('0x204')]=_0x19d761['temp']>0x0?_0x19d761[_0x805c('0x204')]:0x0;if(!checkContactEmpty(_0x145b7b)){_0x23d7cd['countReScheduled'](_0x19d761)[_0x805c('0xbc')](sendMessageReschedule(_0x19d761))[_0x805c('0xb5')](loggerCatch(_0x805c('0x20d')));}else{_0x19d761[_0x805c('0xa0')]+=_0x145b7b[_0x805c('0x9e')];_0x19d761[_0x805c('0x48')]=_0x19d761[_0x805c('0x60')]===_0x805c('0x9')?_0x805c('0x179'):_0x805c('0x207');for(var _0x4bab7b=0x0;_0x4bab7b<_0x145b7b['length'];_0x4bab7b+=0x1){if(_[_0x805c('0xb2')](_0x145b7b[_0x4bab7b])||_[_0x805c('0xb2')](_0x145b7b[_0x4bab7b][_0x805c('0x170')])||_[_0x805c('0xb2')](_0x145b7b[_0x4bab7b]['Contact'][_0x805c('0x171')])){_0x23d7cd[_0x805c('0xcf')](_0x805c('0x209'),_0x19d761,_0x145b7b[_0x4bab7b]);}else{_0x23d7cd['checkIsBlackList'](_[_0x805c('0xd2')](_0x145b7b[_0x4bab7b],[_0x805c('0xd6'),_0x805c('0x20a')]))[_0x805c('0xbc')](_0x23d7cd[_0x805c('0x1e9')](_0x19d761,_0x145b7b[_0x4bab7b]))['catch'](_0x23d7cd[_0x805c('0x20b')](_0x805c('0x209'),_0x19d761));}}}})['catch'](loggerGetContactDialer(_0x805c('0x20e'),_0x19d761,_0x20a33b));}};Dialer['prototype'][_0x805c('0x96')]=function(_0xf29a9d){var _0x15a91d=this;if(_0xf29a9d[_0x805c('0x20f')]>0x0){var _0xdbd03b=_0xf29a9d[_0x805c('0x20f')]-_0xf29a9d[_0x805c('0xa0')]-_0xf29a9d[_0x805c('0x5a')];if(_0xdbd03b>0x0){this[_0x805c('0x210')](_0xf29a9d);}else{loggerPredictiveCalls[_0x805c('0x83')]('[handlePredictive][limitChannel]');}}else{this[_0x805c('0x210')](_0xf29a9d);}};Dialer['prototype']['tryOriginatePredictive']=function(_0xf2587a){var _0x1121ea=this;var _0x3b9326=[];_0xf2587a[_0x805c('0xa0')]+=0x1;for(var _0x363756 in this[_0x805c('0x28')]){if(this[_0x805c('0x28')][_0x805c('0x9f')](_0x363756)){if(this[_0x805c('0x28')][_0x363756][_0x805c('0xac')]===_0x805c('0x211')&&this[_0x805c('0x28')][_0x363756][_0x805c('0xdd')]==='reachable'){_0x3b9326[_0x805c('0x151')](this['agents'][_0x363756]['id']);}}}this[_0x805c('0xc5')](_0xf2587a['id'],_0x3b9326,0x1,_0xf2587a['dialOrderByScheduledAt'])['then'](function(_0x413128){if(!checkContactEmpty(_0x413128)){checkContactLowerLimitOriginate(_0xf2587a,0x1,0x0);_0x1121ea['countReScheduled'](_0xf2587a)[_0x805c('0xbc')](sendMessageReschedule(_0xf2587a))[_0x805c('0xb5')](loggerCatch('[countReScheduled]\x20'));}else{_0xf2587a[_0x805c('0x48')]=_0x805c('0x207');if(_[_0x805c('0xb2')](_0x413128[0x0])||_['isNil'](_0x413128[0x0]['Contact'])||_[_0x805c('0xb2')](_0x413128[0x0][_0x805c('0x170')][_0x805c('0x171')])){_0x1121ea[_0x805c('0xcf')]('[actionOriginate]\x20',_0xf2587a,_0x413128[0x0]);}else{_0x1121ea[_0x805c('0xbd')](_[_0x805c('0xd2')](_0x413128[0x0],[_0x805c('0xd6'),_0x805c('0x20a')]))[_0x805c('0xbc')](_0x1121ea[_0x805c('0x1e9')](_0xf2587a,_0x413128[0x0]))['catch'](_0x1121ea['loggerHandler'](_0x805c('0x212'),_0xf2587a));}}})[_0x805c('0xb5')](loggerGetContactDialer('[getContactDialerPredictive]',_0xf2587a,0x1));emitVoiceQueueSummary(_0xf2587a);};Dialer[_0x805c('0x21')][_0x805c('0x1e4')]=function(_0x32bdaf,_0x1d3b49,_0x1d4846,_0x4fc7d2,_0x50eae8,_0x2b3806){loggerPredictive[_0x805c('0x83')](_0x805c('0x213'));loggerPredictive[_0x805c('0x83')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32bdaf);loggerPredictive[_0x805c('0x83')](_0x805c('0x214'),_0x1d3b49);loggerPredictive[_0x805c('0x83')](_0x805c('0x215'),_0x1d4846);loggerPredictive[_0x805c('0x83')](_0x805c('0x216'),_0x4fc7d2);loggerPredictive[_0x805c('0x83')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50eae8);loggerPredictive[_0x805c('0x83')](_0x805c('0x8a'));return new BPromise(function(_0x4b4f5d,_0x525701){if(_0x32bdaf<=0x0||isNaN(_0x32bdaf)){return _0x525701(msgResponse('[abandonmentRate]',_0x805c('0x198'),'m\x20=\x20'+_0x32bdaf));}if(_0x1d4846<=0x0||isNaN(_0x1d4846)){return _0x525701(msgResponse(_0x805c('0x217'),'Error',_0x805c('0x218')+_0x1d4846));}if(_0x4fc7d2<=0x0||isNaN(_0x4fc7d2)){return _0x525701(msgResponse('[abandonmentRate]','Error',_0x805c('0x219')+_0x4fc7d2));}if(_0x1d3b49<=0x0||isNaN(_0x1d3b49)){return _0x525701(msgResponse(_0x805c('0x217'),_0x805c('0x198'),_0x805c('0x21a')+_0x1d3b49));}if(_0x50eae8<=0x0||isNaN(_0x50eae8)){return _0x525701(msgResponse('[abandonmentRate]',_0x805c('0x198'),_0x805c('0x21b')+_0x50eae8));}_0x2b3806=_0x2b3806||0x0;var _0x4c6624=0x1/_0x1d4846;var _0x66768a=0x0;var _0x177e48=0x0;var _0x20cc6d=0x0;var _0x20d3bd=0x0;for(var _0x3f48b5=0x0;_0x20cc6d<_0x50eae8;_0x3f48b5+=0x1){_0x177e48=_0x3f48b5/_0x1d3b49;_0x66768a=(_0x4fc7d2*_0x177e48+_0x2b3806)/_0x4c6624;_0x20cc6d=erlangb(_0x66768a,_0x32bdaf);_0x20d3bd=_0x66768a/_0x32bdaf*(0x1-erlangb(_0x66768a,_0x32bdaf));}return _0x4b4f5d({'erlangCalls':_0x3f48b5,'erlangCallToSecond':_0x1d3b49/_0x3f48b5,'erlangAbandonmentRate':_0x20cc6d,'erlangBusyFactor':_0x20d3bd});});};Dialer[_0x805c('0x21')][_0x805c('0x1df')]=function(_0x530118,_0x556cf4,_0x4008eb,_0x12fce6,_0x118e2d,_0x34543c){loggerPredictive['info'](_0x805c('0x21c'));loggerPredictive[_0x805c('0x83')](_0x805c('0x21d'),_0x530118);loggerPredictive['info'](_0x805c('0x214'),_0x556cf4);loggerPredictive['info'](_0x805c('0x215'),_0x4008eb);loggerPredictive[_0x805c('0x83')](_0x805c('0x216'),_0x12fce6);loggerPredictive['info'](_0x805c('0x21e'),_0x118e2d);loggerPredictive[_0x805c('0x83')]('---------------------------');return new BPromise(function(_0x5f12d5,_0x4c226b){if(_0x530118<=0x0||isNaN(_0x530118)){return _0x4c226b(msgResponse(_0x805c('0x21f'),_0x805c('0x198'),'m\x20=\x20'+_0x530118));}if(_0x4008eb<=0x0||isNaN(_0x4008eb)){return _0x4c226b(msgResponse(_0x805c('0x21f'),_0x805c('0x198'),'Ts\x20=\x20'+_0x4008eb));}if(_0x12fce6<=0x0||isNaN(_0x12fce6)){return _0x4c226b(msgResponse('[busyFactor]',_0x805c('0x198'),_0x805c('0x219')+_0x12fce6));}if(_0x556cf4<=0x0||isNaN(_0x556cf4)){return _0x4c226b(msgResponse(_0x805c('0x21f'),_0x805c('0x198'),_0x805c('0x21a')+_0x556cf4));}if(_0x118e2d<=0x0||isNaN(_0x118e2d)){return _0x4c226b(msgResponse(_0x805c('0x21f'),'Error',_0x805c('0x220')+_0x118e2d));}_0x34543c=_0x34543c||0x0;var _0x40c693=0x1/_0x4008eb;var _0x204319=0x0;var _0x56eccc=0x0;var _0x404a6e=0x0;var _0x357fd8=0x0;for(var _0x2f3ece=0x0;_0x357fd8<_0x118e2d;_0x2f3ece+=0x1){_0x56eccc=_0x2f3ece/_0x556cf4;_0x204319=(_0x12fce6*_0x56eccc+_0x34543c)/_0x40c693;_0x404a6e=erlangb(_0x204319,_0x530118);_0x357fd8=_0x204319/_0x530118*(0x1-erlangb(_0x204319,_0x530118));}return _0x5f12d5({'erlangCalls':_0x2f3ece,'erlangCallToSecond':_0x556cf4/_0x2f3ece,'erlangAbandonmentRate':_0x404a6e,'erlangBusyFactor':_0x357fd8});});};module[_0x805c('0x221')]=Dialer; \ No newline at end of file +var _0xc337=['Trunk','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','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','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','isUndefined','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','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','pTalking','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','uniqueId','[uniqueid]','clearZombieChannels','[actions]','sequence','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','active','SIP/%s','status','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','state','membername','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','VoiceQueueId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','starttime','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','stateinterface','queueBooked','push','idHopper','paused','[unlockQueueStatus][undefined]','queueStatusComplete','pick','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','Action','iftime\x20%s,%s','interval','indexOf','true','command','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','reason\x200\x20no\x20such\x20number....','buildObj','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','temp','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','RUNNING','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','reachable','[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]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','bind','originateresponse','syncOriginateResponse','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Interval','[ifTime][Action]','milliseconds','diff','emit','type','outbound','strategy','available','loggedIn','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangBusyFactor'];(function(_0x1eeba6,_0x532215){var _0x4b8916=function(_0x5be535){while(--_0x5be535){_0x1eeba6['push'](_0x1eeba6['shift']());}};_0x4b8916(++_0x532215);}(_0xc337,0x1b0));var _0x7c33=function(_0x51d893,_0x3e43d3){_0x51d893=_0x51d893-0x0;var _0x35e509=_0xc337[_0x51d893];return _0x35e509;};'use strict';var util=require('util');var _=require(_0x7c33('0x0'));var BPromise=require(_0x7c33('0x1'));var uuid=require(_0x7c33('0x2'));var moment=require(_0x7c33('0x3'));var rr=require('rr');var md5=require(_0x7c33('0x4'));var Redis=require(_0x7c33('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x7c33('0x6'))(_0x7c33('0x7'));var loggerBooked=require(_0x7c33('0x6'))(_0x7c33('0x8'));var loggerPredictive=require(_0x7c33('0x6'))('predictive');var loggerPredictiveCalls=require(_0x7c33('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x7c33('0x6'))(_0x7c33('0x9'));var ami=require(_0x7c33('0xa'));config[_0x7c33('0xb')]=_[_0x7c33('0xc')](config[_0x7c33('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x7c33('0xd'))(new Redis(config[_0x7c33('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x7c33('0xe'));var cmHopperHistory=require(_0x7c33('0xf'));var cmHopperBlack=require(_0x7c33('0x10'));var voiceQueueRt=require(_0x7c33('0x11'));var Action=require(_0x7c33('0x12'));var History=require(_0x7c33('0x13'));var Final=require(_0x7c33('0x14'));var AgentComplete=require(_0x7c33('0x15'));var QueueCallerAbandon=require(_0x7c33('0x16'));var Hangup=require(_0x7c33('0x17'));var ipAgi=process[_0x7c33('0x18')][_0x7c33('0x19')]||_0x7c33('0x1a');var strategy={'rrmemory':_0x7c33('0x1b'),'roundrobin':_0x7c33('0x1c')};var Sequence=function(){};Sequence[_0x7c33('0x1d')][_0x7c33('0x1e')]=function(_0x4fccad){this['tail']=this[_0x7c33('0x1f')]?this[_0x7c33('0x1f')][_0x7c33('0x20')](_0x4fccad):_0x4fccad();};function Dialer(_0x93c582,_0x153f44){this['sequence']=new Sequence();this[_0x7c33('0x21')]=_0x153f44;this[_0x7c33('0x22')]=_0x93c582[_0x7c33('0x22')];this[_0x7c33('0x23')]=_0x93c582['campaigns'];this[_0x7c33('0x24')]=_0x93c582['agents'];this['trunks']=_0x93c582[_0x7c33('0x25')];this[_0x7c33('0x26')]=config[_0x7c33('0x26')]||0x2;this[_0x7c33('0x27')]={};this[_0x7c33('0x28')]={};this[_0x7c33('0x29')]={};this['uniqueId']={};this[_0x7c33('0x2a')]={};this[_0x7c33('0x2b')]={};this[_0x7c33('0x2c')]={};this[_0x7c33('0x2d')]={};this['queueBooked']={};this[_0x7c33('0x2e')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x7c33('0x2f')](this));ami['on'](_0x7c33('0x30'),this[_0x7c33('0x31')][_0x7c33('0x2f')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x7c33('0x2f')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x7c33('0x2f')](this));ami['on']('hangup',this[_0x7c33('0x32')][_0x7c33('0x2f')](this));ami['on'](_0x7c33('0x33'),this['syncNewExten'][_0x7c33('0x2f')](this));ami['on'](_0x7c33('0x34'),this[_0x7c33('0x35')][_0x7c33('0x2f')](this));ami['on'](_0x7c33('0x36'),this[_0x7c33('0x37')][_0x7c33('0x2f')](this));ami['on'](_0x7c33('0x38'),this['syncQueueStatusComplete'][_0x7c33('0x2f')](this));this[_0x7c33('0x39')]();this[_0x7c33('0x3a')]();}function isNotNull(_0x129149){return _0x129149!==null&&!_['isUndefined'](_0x129149);}function checkIsLoggedIn(_0xf91789,_0x3d8a0b){return function(){if(_0x3d8a0b<=0x0){_0xf91789['message']=_0x7c33('0x3b');throw _0xf91789[_0x7c33('0x3c')]+_0x7c33('0x3d');}};}function isActive(_0x3de27e){return _0x3de27e;}function checkIsActive(_0x36ba39,_0x5c6fc8){return function(){if(!isActive(_0x5c6fc8)){_0x36ba39[_0x7c33('0x3e')]='NOT_ACTIVE';throw _0x36ba39['name']+_0x7c33('0x3f');}};}function checkInterval(_0x13eafc){return function(){if(!isNotNull(_0x13eafc['Interval'])){_0x13eafc[_0x7c33('0x3e')]=_0x7c33('0x40');throw _0x13eafc[_0x7c33('0x3c')]+_0x7c33('0x41');}if(!isNotNull(_0x13eafc['Interval'][_0x7c33('0x42')])){_0x13eafc[_0x7c33('0x3e')]=_0x7c33('0x40');throw _0x13eafc[_0x7c33('0x3c')]+_0x7c33('0x41');}if(!isNotNull(_[_0x7c33('0x43')](_0x13eafc[_0x7c33('0x44')][_0x7c33('0x42')]))){_0x13eafc[_0x7c33('0x3e')]=_0x7c33('0x40');throw _0x13eafc[_0x7c33('0x3c')]+_0x7c33('0x41');}};}function msgResponse(_0x541e50,_0x269a60,_0xf42706){return{'action':_0x541e50,'response':_0x269a60,'message':_0xf42706,'stack':_0xf42706};}function myreject(_0x837cf4){return function(_0x5f2522){return _0x837cf4(msgResponse(_0x7c33('0x45'),'Error',JSON['stringify'](_0x5f2522)));};}function getSeconds(_0x3afead,_0x56450c){var _0x29c0c8=moment(_0x3afead)[_0x7c33('0x46')](0x0);var _0x459fe8=moment(_0x56450c)[_0x7c33('0x46')](0x0);return _0x29c0c8[_0x7c33('0x47')](_0x459fe8,'seconds');}function emit(_0xbb8711,_0x57ac3b,_0x23eff9){io['to'](_0xbb8711)[_0x7c33('0x48')](_0x57ac3b,_0x23eff9);}function emitVoiceQueueSummary(_0x5ec00d){if(_0x5ec00d[_0x7c33('0x49')]===_0x7c33('0x4a')){var _0x86d0b5={'id':_0x5ec00d['id'],'name':_0x5ec00d[_0x7c33('0x3c')],'strategy':_0x5ec00d[_0x7c33('0x4b')],'answered':_0x5ec00d['answered'],'available':_0x5ec00d[_0x7c33('0x4c')],'loggedIn':_0x5ec00d[_0x7c33('0x4d')],'pTalking':_0x5ec00d['pTalking'],'sumBillable':_0x5ec00d['sumBillable'],'sumDuration':_0x5ec00d[_0x7c33('0x4e')],'sumHoldTime':_0x5ec00d[_0x7c33('0x4f')]||0x0,'talking':_0x5ec00d[_0x7c33('0x50')],'total':_0x5ec00d['total'],'type':_0x5ec00d[_0x7c33('0x49')],'unmanaged':_0x5ec00d[_0x7c33('0x51')],'abandoned':_0x5ec00d[_0x7c33('0x52')],'waiting':_0x5ec00d['waiting'],'loggedInDb':_0x5ec00d[_0x7c33('0x53')],'dialActive':_0x5ec00d[_0x7c33('0x54')],'dialMethod':_0x5ec00d[_0x7c33('0x55')],'dialOriginateCallerIdName':_0x5ec00d['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5ec00d[_0x7c33('0x56')],'dialOriginateTimeout':_0x5ec00d['dialOriginateTimeout'],'dialPrefix':_0x5ec00d[_0x7c33('0x57')],'outboundAnswerAgiCallsDay':_0x5ec00d[_0x7c33('0x58')],'outboundAnswerCallsDay':_0x5ec00d[_0x7c33('0x59')],'outboundBlacklistCallsDay':_0x5ec00d[_0x7c33('0x5a')],'outboundBusyCallsDay':_0x5ec00d[_0x7c33('0x5b')],'outboundCongestionCallsDay':_0x5ec00d[_0x7c33('0x5c')],'outboundDropCallsDayACS':_0x5ec00d[_0x7c33('0x5d')],'outboundDropCallsDayCallersExit':_0x5ec00d[_0x7c33('0x5e')],'outboundDropCallsDayTimeout':_0x5ec00d[_0x7c33('0x5f')],'outboundNoAnswerCallsDay':_0x5ec00d[_0x7c33('0x60')],'outboundNoSuchCallsDay':_0x5ec00d[_0x7c33('0x61')],'outboundOriginateFailureCallsDay':_0x5ec00d['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5ec00d[_0x7c33('0x62')],'outboundRejectCallsDay':_0x5ec00d[_0x7c33('0x63')],'outboundUnknownCallsDay':_0x5ec00d[_0x7c33('0x64')],'predictiveIntervalAnsweredCalls':_0x5ec00d[_0x7c33('0x65')],'predictiveIntervalAvgHoldtime':_0x5ec00d[_0x7c33('0x66')],'predictiveIntervalAvgTalktime':_0x5ec00d['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5ec00d[_0x7c33('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x5ec00d['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5ec00d[_0x7c33('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x5ec00d[_0x7c33('0x69')],'predictiveIntervalHitRate':_0x5ec00d[_0x7c33('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x5ec00d[_0x7c33('0x6b')],'predictiveIntervalPauses':_0x5ec00d[_0x7c33('0x6c')],'predictiveIntervalAvailable':_0x5ec00d[_0x7c33('0x6d')],'predictiveIntervalTotalCalls':_0x5ec00d['predictiveIntervalTotalCalls'],'message':_0x5ec00d[_0x7c33('0x3e')],'originated':_0x5ec00d[_0x7c33('0x6e')],'erlangCalls':_0x5ec00d['erlangCalls'],'erlangCallToSecond':_0x5ec00d[_0x7c33('0x6f')],'erlangAbandonmentRate':_0x5ec00d['erlangAbandonmentRate'],'erlangBusyFactor':_0x5ec00d[_0x7c33('0x70')],'startPredictive':_0x5ec00d[_0x7c33('0x2b')],'startProgressive':_0x5ec00d[_0x7c33('0x2c')]};if(_0x5ec00d['Trunk']){_0x86d0b5['Trunk']={'id':_0x5ec00d[_0x7c33('0x71')]['id'],'name':_0x5ec00d[_0x7c33('0x71')][_0x7c33('0x3c')],'active':_0x5ec00d[_0x7c33('0x71')]['active'],'callerid':_0x5ec00d[_0x7c33('0x71')][_0x7c33('0x72')]};}if(_0x5ec00d['Interval']){_0x86d0b5[_0x7c33('0x44')]={'id':_0x5ec00d[_0x7c33('0x44')]['id'],'name':_0x5ec00d[_0x7c33('0x44')][_0x7c33('0x3c')]};}var _0x709a83=md5(JSON[_0x7c33('0x73')](_0x86d0b5));if(_0x5ec00d[_0x7c33('0x4')]!==_0x709a83){_0x5ec00d[_0x7c33('0x4')]=_0x709a83;emit(util[_0x7c33('0x74')](_0x7c33('0x75'),_0x86d0b5[_0x7c33('0x3c')]),'voice_queue:save',_0x86d0b5);}}}function emitCampaignSummary(_0x1d928d){if(_0x1d928d['type']===_0x7c33('0x76')){emit(util[_0x7c33('0x74')](_0x7c33('0x77'),_0x1d928d[_0x7c33('0x3c')]),_0x7c33('0x78'),_0x1d928d);}}function checkGetDataPredictive(_0x44dffc){if(isNotNull(_0x44dffc)){if(!_[_0x7c33('0x43')](_0x44dffc)){loggerPredictive['info'](_0x7c33('0x79'));loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x7b'),_0x44dffc['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44dffc[_0x7c33('0x65')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x7c'),_0x44dffc[_0x7c33('0x7d')]);loggerPredictive[_0x7c33('0x7a')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44dffc[_0x7c33('0x67')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x7e'),_0x44dffc[_0x7c33('0x66')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x7f'),_0x44dffc[_0x7c33('0x80')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x81'));if(_0x44dffc[_0x7c33('0x82')]>0x0){if(!_[_0x7c33('0x83')](_0x44dffc['predictiveIntervalAvgTalktime'])&&_0x44dffc[_0x7c33('0x80')]>0x0){return!![];}else{loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x84'));}if(!_['isUndefined'](_0x44dffc[_0x7c33('0x66')])&&_0x44dffc[_0x7c33('0x66')]>0x0){return!![];}else{loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x85'));}}else{loggerPredictive['info'](_0x7c33('0x86'));}}else{loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x87'));}}else{loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x87'));}return![];}function mergeDataErlangB(_0x55ce09){return function(_0x567bcc){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x7c33('0x7a')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x567bcc[_0x7c33('0x88')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x89'),_0x567bcc[_0x7c33('0x6f')]);loggerPredictive[_0x7c33('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x567bcc[_0x7c33('0x8a')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x8b'),_0x567bcc[_0x7c33('0x70')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x8c'),_0x567bcc[_0x7c33('0x8a')]);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x81'));_[_0x7c33('0x8d')](_0x55ce09,_0x567bcc);};}function getDiff(_0x2bf5e2){var _0x155200=moment()[_0x7c33('0x46')](0x0);var _0x190995=moment(_0x2bf5e2)[_0x7c33('0x46')](0x0);return _0x155200[_0x7c33('0x47')](_0x190995,_0x7c33('0x8e'));}function ifInterval(_0xe7fb4f,_0x354ed3){if(_[_0x7c33('0x83')](_0x354ed3)){return![];}if(getDiff(_0x354ed3)<_0xe7fb4f*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xe3df7e){if(isNotNull(_0xe3df7e)){if(!_[_0x7c33('0x83')](_0xe3df7e['startProgressive'])){_0xe3df7e['startProgressive']=undefined;loggerPredictive['info'](_0xe3df7e['name'],_0x7c33('0x8f'));}if(!_[_0x7c33('0x83')](_0xe3df7e[_0x7c33('0x2b')])){_0xe3df7e['startPredictive']=undefined;loggerPredictive[_0x7c33('0x7a')](_0xe3df7e[_0x7c33('0x3c')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x7c33('0x83')](_0xe3df7e['handlePredictive'])){clearInterval(_0xe3df7e[_0x7c33('0x90')]);_0xe3df7e['handlePredictive']=undefined;loggerPredictive[_0x7c33('0x7a')](_0xe3df7e[_0x7c33('0x3c')],_0x7c33('0x91'));}}}function erlangb(_0x4edeb5,_0x5f30b3){if(_0x5f30b3===0x0){return 0x0;}var _0x21835e=0x1;for(var _0x242f0=0x1;_0x242f0<=_0x5f30b3;_0x242f0+=0x1){_0x21835e=0x1+_0x21835e*_0x242f0/_0x4edeb5;}return 0x1/_0x21835e;}function isVoiceQueueOutbound(_0x51f5a2){return _0x51f5a2===_0x7c33('0x4a');}function isNotPreview(_0x4b92b9){return _0x4b92b9!==_0x7c33('0x21');}function isCampaignIvr(_0x1a88b6){return _0x1a88b6===_0x7c33('0x76');}function getCallerId(_0x3fb54f,_0x5eef49,_0x3a41c7){if(!_[_0x7c33('0x83')](_0x3a41c7)&&_0x7c33('0x92')===typeof _0x3a41c7&&!_[_0x7c33('0x43')](_0x3a41c7)){if(!_[_0x7c33('0x83')](_0x5eef49)&&_0x7c33('0x92')===typeof _0x5eef49&&!_[_0x7c33('0x43')](_0x5eef49)){return util[_0x7c33('0x74')]('\x22%s\x22\x20<%s>',_0x5eef49,_0x3a41c7);}return util['format'](_0x7c33('0x93'),_0x3a41c7,_0x3a41c7);}if(!_[_0x7c33('0x83')](_0x3fb54f)&&_0x7c33('0x92')===typeof _0x3fb54f&&!_[_0x7c33('0x43')](_0x3fb54f)){return _0x3fb54f;}return _0x7c33('0x94');}function loggerCatchQueueSummary(_0x396eaa,_0x81261){return function(_0x584392){freeVariablesPredictive(_0x81261);emitVoiceQueueSummary(_0x81261);emitCampaignSummary(_0x81261);loggerSyncQueueSummary[_0x7c33('0x95')](_0x396eaa,util[_0x7c33('0x96')](_0x584392,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x502015,_0x4b2910){return function(_0x167c5c){loggerPredictive['error'](_0x4b2910[_0x7c33('0x3c')],_0x502015);loggerPredictive[_0x7c33('0x95')](_0x167c5c['stack']);freeVariablesPredictive(_0x4b2910);};}function loggerCatch(_0x1e254c){return function(_0x317d6f){logger[_0x7c33('0x95')](_0x1e254c,util[_0x7c33('0x96')](_0x317d6f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x42e076){return _0x42e076&&!_['isUndefined'](_0x42e076)&&_0x42e076['length']>0x0;}function decremetOriginate(_0x2655ac){if(!_[_0x7c33('0x83')](_0x2655ac)&&_0x2655ac!==null){if(_0x2655ac[_0x7c33('0x97')]('originated')){if(_0x2655ac[_0x7c33('0x6e')]>0x0){_0x2655ac['originated']-=0x1;}else{logger[_0x7c33('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x7c33('0x98'));}}function checkContactLowerLimitOriginate(_0x24219d,_0x2bc3e9,_0x56551f){if(_0x2bc3e9>_0x56551f){for(var _0x448fef=0x0;_0x448fef<_0x2bc3e9-_0x56551f;_0x448fef+=0x1){decremetOriginate(_0x24219d);}}}function loggerGetContactDialer(_0x4021d3,_0x12fde0,_0x5357c1){return function(_0x495622){checkContactLowerLimitOriginate(_0x12fde0,_0x5357c1,0x0);logger[_0x7c33('0x95')](_0x4021d3,util[_0x7c33('0x96')](_0x495622,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4538d9){return function(_0x5f25ea){if(isNotNull(_0x5f25ea)&&isNotNull(_0x5f25ea[0x0])){if(_0x5f25ea[0x0][_0x7c33('0x99')]>0x0){_0x4538d9[_0x7c33('0x3e')]=_0x7c33('0x9a');logger[_0x7c33('0x7a')](_0x7c33('0x9b')+_0x4538d9[_0x7c33('0x3c')],_0x5f25ea[0x0]['contactsRescheduled'],_0x7c33('0x9c'));}else{_0x4538d9['message']=_0x7c33('0x9d');logger[_0x7c33('0x7a')]('[getContactDialer2][Empty]'+_0x4538d9[_0x7c33('0x3c')]);}}};}function notSendMessagesQueue(_0x357cb3){if(_0x357cb3[_0x7c33('0x9e')]){freeVariablesPredictive(_0x357cb3);if(_0x357cb3[_0x7c33('0x6e')]===0x0&&_0x357cb3[_0x7c33('0x50')]===0x0&&_0x357cb3[_0x7c33('0x9f')]===0x0&&(_0x357cb3[_0x7c33('0xa0')]||0x0)===0x0){_0x357cb3[_0x7c33('0x9e')]=![];_0x357cb3[_0x7c33('0x4c')]=0x0;_0x357cb3[_0x7c33('0x3e')]=_0x7c33('0xa1');loggerSyncQueueSummary['error'](_0x7c33('0xa2'),_0x357cb3[_0x7c33('0x3c')],'is\x20not\x20active');}else{_0x357cb3[_0x7c33('0x3e')]=_0x7c33('0xa3');loggerSyncQueueSummary[_0x7c33('0x95')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x357cb3[_0x7c33('0x3c')],_0x7c33('0xa4'));}emitVoiceQueueSummary(_0x357cb3);}}function notSendMessagesCampaign(_0x501cd4){if(_0x501cd4[_0x7c33('0x9e')]){if(_0x501cd4['originated']===0x0){_0x501cd4['sendMessageOneNotActive']=![];_0x501cd4[_0x7c33('0x3e')]=_0x7c33('0xa1');loggerSyncQueueSummary[_0x7c33('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x501cd4[_0x7c33('0x3c')],_0x7c33('0xa5'));}else{_0x501cd4[_0x7c33('0x3e')]=_0x7c33('0xa3');loggerSyncQueueSummary[_0x7c33('0x95')](_0x7c33('0xa6'),_0x501cd4[_0x7c33('0x3c')],_0x7c33('0xa4'));}emitCampaignSummary(_0x501cd4);}}function createObjHistory(_0xd05ba4,_0xfa2605,_0x117422,_0x572fae,_0x544ea4){_0xd05ba4[_0x7c33('0x3e')]=_0x117422;var _0x5410d4=new Action(_0xd05ba4,_0xfa2605);var _0x2bfcea=new History(_0x5410d4);_0x2bfcea['state']=_0x572fae;_0x2bfcea[_0x7c33('0xa7')]=_0x544ea4;_0x2bfcea['endtime']=_0x5410d4['starttime'];return _0x2bfcea;}Dialer[_0x7c33('0x1d')][_0x7c33('0x3a')]=function(){var _0x510cd2=this;setInterval(function(){_0x510cd2['clearZombieChannels'](_0x510cd2[_0x7c33('0xa8')],_0x7c33('0xa9'));_0x510cd2[_0x7c33('0xaa')](_0x510cd2[_0x7c33('0x28')],_0x7c33('0xab'));},0x32c8);};Dialer[_0x7c33('0x1d')]['clearZombieChannels']=function(_0x52aea4,_0x566e74){var _0x547ec3=this;for(var _0x5a2eea in _0x52aea4){if(_0x52aea4[_0x7c33('0x97')](_0x5a2eea)){this[_0x7c33('0xac')][_0x7c33('0x1e')](function(){if(!_['isNil'](_0x52aea4[_0x5a2eea])){return ami['Action']({'action':'status','channel':_0x52aea4[_0x5a2eea][_0x7c33('0xad')]})[_0x7c33('0xae')](function(_0x191b90){if(_0x191b90[_0x7c33('0x3e')]===_0x7c33('0xaf')){setTimeout(function(){if(_0x52aea4[_0x5a2eea]&&_0x52aea4[_0x5a2eea][_0x7c33('0x49')]!==_0x7c33('0x76')){_0x547ec3[_0x7c33('0xb0')](_0x547ec3[_0x7c33('0x22')][_0x52aea4[_0x5a2eea]['queue']]);logger['error'](_0x7c33('0xb1'),_0x566e74,_0x5a2eea,_0x52aea4[_0x5a2eea]['queue']);delete _0x52aea4[_0x5a2eea];}if(_0x52aea4[_0x5a2eea]&&_0x52aea4[_0x5a2eea]['type']===_0x7c33('0x76')){_0x547ec3[_0x7c33('0xb0')](_0x547ec3['campaigns'][_0x52aea4[_0x5a2eea][_0x7c33('0xb2')]]);logger[_0x7c33('0x95')](_0x7c33('0xb3'),_0x566e74,_0x5a2eea,_0x52aea4[_0x5a2eea][_0x7c33('0xb2')]);delete _0x52aea4[_0x5a2eea];}},0x2328);}});}});}}};Dialer['prototype'][_0x7c33('0xb4')]=function(_0x15c91e){return BPromise['resolve']()[_0x7c33('0xb5')](cmHopper['countReScheduled'](_0x15c91e))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xb6')));};Dialer[_0x7c33('0x1d')][_0x7c33('0xb7')]=function(_0x346dae){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x346dae))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xb8')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x215bdf){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](cmHopperBlack['checkIsBlackListIvr'](_0x215bdf))[_0x7c33('0xae')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x7c33('0x1d')][_0x7c33('0xba')]=function(_0x5ec94f){return BPromise[_0x7c33('0xb9')]()['then'](cmHopperHistory[_0x7c33('0xbb')](_0x5ec94f))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xbc')));};Dialer[_0x7c33('0x1d')]['rescheduleContact']=function(_0x26f852){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](cmHopper[_0x7c33('0xbd')](_0x26f852))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xbe')));};Dialer['prototype'][_0x7c33('0xbf')]=function(_0x4213a7,_0x2942da,_0x2b6f0b){return BPromise[_0x7c33('0xb9')]()['then'](cmHopper[_0x7c33('0xbf')](_0x4213a7,_0x2942da,_0x2b6f0b))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xc0')));};Dialer['prototype'][_0x7c33('0xc1')]=function(_0x244b54,_0x58345e,_0x44adeb,_0x4c45b8){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](cmHopper[_0x7c33('0xc1')](_0x244b54,_0x58345e,_0x44adeb,_0x4c45b8))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xc2')));};Dialer[_0x7c33('0x1d')][_0x7c33('0xc3')]=function(_0x2db57c,_0x27061c,_0x2ce693){return BPromise['resolve']()['then'](cmHopper[_0x7c33('0xc3')](_0x2db57c,_0x27061c,_0x2ce693))['catch'](loggerCatch(_0x7c33('0xc2')));};Dialer[_0x7c33('0x1d')][_0x7c33('0xc4')]=function(_0x4cba3c){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](voiceQueueRt[_0x7c33('0xc4')](_0x4cba3c))[_0x7c33('0xae')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x7c33('0xc5')]=function(_0x2da332){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](cmHopper[_0x7c33('0xc5')](_0x2da332))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x7c33('0x1d')][_0x7c33('0xc6')]=function(_0x1df0f6){return BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](cmHopperHistory[_0x7c33('0xc6')](_0x1df0f6))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xc7')));};Dialer['prototype'][_0x7c33('0xb0')]=function(_0x5c1535){if(!_[_0x7c33('0x83')](_0x5c1535)&&_0x5c1535!==null){if(_0x5c1535[_0x7c33('0x97')](_0x7c33('0x6e'))){if(_0x5c1535[_0x7c33('0x6e')]>0x0){_0x5c1535['originated']-=0x1;}else{logger[_0x7c33('0x95')](_0x7c33('0xc8'));}}}else{logger[_0x7c33('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x7c33('0x1d')][_0x7c33('0xc9')]=function(_0x32db70,_0x432400){var _0x523a92=this;return function(_0x3fd1bb){_0x523a92[_0x7c33('0xb0')](_0x432400);logger[_0x7c33('0x95')](_0x32db70,util[_0x7c33('0x96')](_0x3fd1bb,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x7c33('0xca')]=function(_0xe35c62,_0x41a4cc,_0x1cc584){var _0x33e29a={'state':0x19,'statedesc':_0x7c33('0xcb')};this['updateOriginated'](_0x41a4cc);this[_0x7c33('0xcc')](_[_0x7c33('0x8d')](_0x33e29a,_['pick'](_0x1cc584,[_0x7c33('0xcd'),_0x7c33('0xce'),_0x7c33('0xcf'),'VoiceQueueId',_0x7c33('0xd0')])),_0x7c33('0xd1'),_0x7c33('0xd2'));logger[_0x7c33('0x95')](_0xe35c62);};Dialer[_0x7c33('0x1d')][_0x7c33('0xd3')]=function(_0x105283){return _0x105283==='Success';};Dialer[_0x7c33('0x1d')][_0x7c33('0xd4')]=function(_0x38643c){return!_[_0x7c33('0x83')](_0x38643c)&&_0x38643c&&!_['isUndefined'](_0x38643c[_0x7c33('0x3c')])&&!_[_0x7c33('0x83')](_0x38643c[_0x7c33('0xd5')])&&_0x38643c[_0x7c33('0xd5')]&&(this[_0x7c33('0x25')][util['format'](_0x7c33('0xd6'),_0x38643c[_0x7c33('0x3c')])][_0x7c33('0xd7')]==='reachable'||this[_0x7c33('0x25')][util[_0x7c33('0x74')](_0x7c33('0xd6'),_0x38643c[_0x7c33('0x3c')])][_0x7c33('0xd7')]===_0x7c33('0xd8'));};Dialer[_0x7c33('0x1d')][_0x7c33('0xcc')]=function(_0x20f53b,_0x4ea880,_0x5c94fe){this[_0x7c33('0xc6')](_0x20f53b)[_0x7c33('0xae')](loggerCatch(_0x4ea880));this[_0x7c33('0xc5')](_0x20f53b)[_0x7c33('0xae')](loggerCatch(_0x5c94fe));};Dialer[_0x7c33('0x1d')][_0x7c33('0x35')]=function(_0x328693){var _0x1aa2af=this[_0x7c33('0xa8')][_0x328693[_0x7c33('0xd9')]];var _0x6b0277;if(!_[_0x7c33('0xda')](_0x328693)&&!_[_0x7c33('0xda')](_0x328693['variable'])&&!_['isNil'](_0x328693[_0x7c33('0xdb')][_0x7c33('0xdc')])&&_0x328693[_0x7c33('0xdd')]===_0x7c33('0xde')&&_0x1aa2af){if(_0x1aa2af['type']!=='ivr'&&this[_0x7c33('0x22')][_0x1aa2af[_0x7c33('0xb2')]][_0x7c33('0xdf')]&&_0x328693[_0x7c33('0xe0')]==='HANGUP'){delete this[_0x7c33('0xa8')][_0x328693[_0x7c33('0xd9')]];this[_0x7c33('0xb0')](this[_0x7c33('0x22')][_0x1aa2af[_0x7c33('0xb2')]]);this[_0x7c33('0x22')][_0x1aa2af['queue']][_0x7c33('0x59')]+=0x1;this['voiceQueues'][_0x1aa2af[_0x7c33('0xb2')]][_0x7c33('0x58')]+=0x1;_0x6b0277=new Hangup(_0x1aa2af,_0x328693);_0x6b0277[_0x7c33('0xe1')]=0x12;_0x6b0277['statedesc']='HangupInAMD';_0x6b0277[_0x7c33('0xe2')]='AMD';this[_0x7c33('0xcc')](_0x6b0277,_0x7c33('0xe3'),'[syncHangupInAMD]');}if(_0x1aa2af['type']!=='ivr'&&this['voiceQueues'][_0x1aa2af[_0x7c33('0xb2')]]['dialAMDActive']&&_0x328693[_0x7c33('0xe0')]===_0x7c33('0xe4')){var _0x23be6f=this;return new BPromise(function(_0x4cc816,_0x5576a7){delete _0x23be6f[_0x7c33('0xa8')][_0x328693['uniqueid']];_0x23be6f[_0x7c33('0xb0')](_0x23be6f[_0x7c33('0x22')][_0x1aa2af[_0x7c33('0xb2')]]);_0x23be6f[_0x7c33('0x22')][_0x1aa2af[_0x7c33('0xb2')]]['outboundAnswerCallsDay']+=0x1;_0x23be6f['voiceQueues'][_0x1aa2af[_0x7c33('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4eac9c=_0x23be6f[_0x7c33('0x22')][_0x1aa2af[_0x7c33('0xb2')]];var _0x16ac6c=new Hangup(_0x1aa2af,_0x328693);_0x16ac6c[_0x7c33('0xe1')]=0x13;_0x16ac6c[_0x7c33('0xa7')]=_0x7c33('0xe5');_0x16ac6c[_0x7c33('0xe2')]=_0x7c33('0xe6');_0x16ac6c['countmachineretry']+=0x1;_0x16ac6c[_0x7c33('0xe7')]+=0x1;_0x16ac6c[_0x7c33('0xe8')]=!![];_0x23be6f['createHistory'](_0x16ac6c)[_0x7c33('0xae')](loggerCatch(_0x7c33('0xe9')));if(_0x16ac6c[_0x7c33('0xea')]+_0x16ac6c[_0x7c33('0xeb')]+_0x16ac6c['countnoanswerretry']+_0x16ac6c[_0x7c33('0xec')]+_0x16ac6c[_0x7c33('0xed')]+_0x16ac6c[_0x7c33('0xee')]+_0x16ac6c[_0x7c33('0xef')]+_0x16ac6c[_0x7c33('0xf0')]>=_0x4eac9c[_0x7c33('0xf1')]){_0x23be6f[_0x7c33('0xf2')](_0x16ac6c,_0x4cc816,_0x5576a7,_0x7c33('0xf3'));}else{if(_0x16ac6c[_0x7c33('0xef')]>=_0x4eac9c[_0x7c33('0xf4')]){_0x23be6f['createStateFinal'](_0x16ac6c,_0x4cc816,_0x5576a7,_0x7c33('0xf5'));}else{_0x23be6f['rescheduleContact']({'active':![],'countmachineretry':_0x16ac6c[_0x7c33('0xef')],'scheduledat':moment()[_0x7c33('0xf6')](_0x4eac9c[_0x7c33('0xf7')],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0x16ac6c[_0x7c33('0xcd')],'ListId':_0x16ac6c[_0x7c33('0xce')],'VoiceQueueId':_0x16ac6c['VoiceQueueId']||undefined,'CampaignId':_0x16ac6c[_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0xfa')));_0x4cc816({'reschedule':0x1});}}});}if(_0x1aa2af[_0x7c33('0x49')]===_0x7c33('0x76')&&this[_0x7c33('0x23')][_0x1aa2af[_0x7c33('0xb2')]][_0x7c33('0xdf')]&&_0x328693['value']===_0x7c33('0xfb')){delete this[_0x7c33('0xa8')][_0x328693['uniqueid']];this['updateOriginated'](this['campaigns'][_0x1aa2af[_0x7c33('0xb2')]]);_0x6b0277=new Hangup(_0x1aa2af,_0x328693);_0x6b0277[_0x7c33('0xe1')]=0x12;_0x6b0277[_0x7c33('0xa7')]=_0x7c33('0xfc');_0x6b0277[_0x7c33('0xe2')]=_0x7c33('0xe6');this[_0x7c33('0xcc')](_0x6b0277,_0x7c33('0xfd'),_0x7c33('0xfe'));}if(_0x1aa2af[_0x7c33('0x49')]===_0x7c33('0x76')&&this[_0x7c33('0x23')][_0x1aa2af['queue']][_0x7c33('0xdf')]&&_0x328693[_0x7c33('0xe0')]==='MACHINE'){var _0x23be6f=this;return new BPromise(function(_0x176e15,_0x440d8b){delete _0x23be6f[_0x7c33('0xa8')][_0x328693[_0x7c33('0xd9')]];_0x23be6f[_0x7c33('0xb0')](_0x23be6f[_0x7c33('0x23')][_0x1aa2af[_0x7c33('0xb2')]]);_0x23be6f[_0x7c33('0x23')][_0x1aa2af[_0x7c33('0xb2')]][_0x7c33('0x59')]+=0x1;_0x23be6f[_0x7c33('0x23')][_0x1aa2af['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x4ca51f=_0x23be6f[_0x7c33('0x23')][_0x1aa2af[_0x7c33('0xb2')]];var _0x588643=new Hangup(_0x1aa2af,_0x328693);_0x588643[_0x7c33('0xe1')]=0x13;_0x588643[_0x7c33('0xa7')]=_0x7c33('0xe5');_0x588643[_0x7c33('0xe2')]=_0x7c33('0xe6');_0x588643[_0x7c33('0xef')]+=0x1;_0x588643['countglobal']+=0x1;_0x588643['amd']=!![];_0x23be6f[_0x7c33('0xc6')](_0x588643)[_0x7c33('0xae')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x588643['countbusyretry']+_0x588643[_0x7c33('0xeb')]+_0x588643[_0x7c33('0xff')]+_0x588643[_0x7c33('0xec')]+_0x588643[_0x7c33('0xed')]+_0x588643['countabandonedretry']+_0x588643[_0x7c33('0xef')]+_0x588643[_0x7c33('0xf0')]>=_0x4ca51f[_0x7c33('0xf1')]){_0x23be6f[_0x7c33('0xf2')](_0x588643,_0x176e15,_0x440d8b,_0x7c33('0xf3'));}else{if(_0x588643['countmachineretry']>=_0x4ca51f[_0x7c33('0xf4')]){_0x23be6f[_0x7c33('0x100')](_0x588643,_0x176e15,_0x440d8b,_0x7c33('0xf5'));}else{_0x23be6f[_0x7c33('0xbd')]({'active':![],'countmachineretry':_0x588643[_0x7c33('0xef')],'scheduledat':moment()[_0x7c33('0xf6')](_0x4ca51f[_0x7c33('0xf7')],_0x7c33('0xf8'))[_0x7c33('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588643['ContactId'],'ListId':_0x588643[_0x7c33('0xce')],'VoiceQueueId':_0x588643['VoiceQueueId']||undefined,'CampaignId':_0x588643[_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch('[rescheduleContact][Machine]'));_0x176e15({'reschedule':0x1});}}});}}};Dialer[_0x7c33('0x1d')]['syncHangup']=function(_0x564a7c){var _0x8f817d=this['uniqueId'][_0x564a7c[_0x7c33('0xd9')]];var _0x46800d=this;var _0x37584b;if(_0x8f817d&&_0x8f817d[_0x7c33('0x49')]===_0x7c33('0x76')){delete this[_0x7c33('0xa8')][_0x564a7c[_0x7c33('0xd9')]];this['updateOriginated'](this[_0x7c33('0x23')][_0x8f817d[_0x7c33('0xb2')]]);this['campaigns'][_0x8f817d[_0x7c33('0xb2')]][_0x7c33('0x101')]+=0x1;_0x37584b=new Hangup(_0x8f817d,_0x564a7c);this[_0x7c33('0xc6')](_0x37584b)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x102')));this['moveContactManagedDialer'](_0x37584b)['catch'](loggerCatch(_0x7c33('0x103')));}if(_0x8f817d&&_0x8f817d[_0x7c33('0x49')]!==_0x7c33('0x76')&&isNotNull(this[_0x7c33('0x22')][_0x8f817d[_0x7c33('0xb2')]][_0x7c33('0x104')])){delete this[_0x7c33('0xa8')][_0x564a7c[_0x7c33('0xd9')]];this[_0x7c33('0xb0')](this[_0x7c33('0x22')][_0x8f817d[_0x7c33('0xb2')]]);this[_0x7c33('0x22')][_0x8f817d['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x8f817d['queue']][_0x7c33('0x58')]+=0x1;_0x37584b=new Hangup(_0x8f817d,_0x564a7c);_0x37584b[_0x7c33('0xe1')]=0x10;_0x37584b['statedesc']=_0x7c33('0x105');_0x37584b[_0x7c33('0xe2')]=_0x7c33('0x106');this[_0x7c33('0xc6')](_0x37584b)[_0x7c33('0xae')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x7c33('0xc5')](_0x37584b)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x103')));}if(_0x8f817d&&_0x8f817d[_0x7c33('0x49')]!=='ivr'&&!isNotNull(this[_0x7c33('0x22')][_0x8f817d[_0x7c33('0xb2')]][_0x7c33('0x104')])){delete this[_0x7c33('0xa8')][_0x564a7c['uniqueid']];this[_0x7c33('0xb0')](this[_0x7c33('0x22')][_0x8f817d[_0x7c33('0xb2')]]);this[_0x7c33('0x22')][_0x8f817d[_0x7c33('0xb2')]]['outboundUnknownCallsDay']+=0x1;_0x37584b=new Hangup(_0x8f817d,_0x564a7c);_0x37584b['state']=0xc;_0x37584b[_0x7c33('0xa7')]=_0x564a7c[_0x7c33('0x107')];_0x37584b['membername']=_0x7c33('0x108');this[_0x7c33('0xc6')](_0x37584b)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x102')));this[_0x7c33('0xc5')](_0x37584b)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x103')));}};Dialer[_0x7c33('0x1d')][_0x7c33('0x109')]=function(_0x5d5dbb){var _0x31ebc6=this[_0x7c33('0xa8')][_0x5d5dbb[_0x7c33('0xd9')]];var _0x768824=this;if(this[_0x7c33('0x22')][_0x5d5dbb[_0x7c33('0xb2')]]){if(_0x31ebc6&&_0x31ebc6['type']!==_0x7c33('0x76')){delete this[_0x7c33('0xa8')][_0x5d5dbb[_0x7c33('0xd9')]];this['voiceQueues'][_0x5d5dbb['queue']][_0x7c33('0x59')]+=0x1;var _0x4234b9=new AgentComplete(_0x31ebc6,_0x5d5dbb);if(_0x5d5dbb['reason']===_0x7c33('0x10a')){_0x4234b9[_0x7c33('0x10b')]=this['voiceQueues'][_0x5d5dbb[_0x7c33('0xb2')]][_0x7c33('0x10c')]&&this[_0x7c33('0x22')][_0x5d5dbb['queue']][_0x7c33('0x10d')]?moment()[_0x7c33('0x74')](_0x7c33('0xf9')):undefined;}this['createHistory'](_0x4234b9)[_0x7c33('0xae')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x7c33('0xc5')](_0x4234b9)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x10e')));}}};Dialer[_0x7c33('0x1d')][_0x7c33('0x10f')]=function(_0x4283db){if(this[_0x7c33('0x22')][_0x4283db[_0x7c33('0xb2')]]){if(this[_0x7c33('0xa8')][_0x4283db[_0x7c33('0xd9')]]&&this[_0x7c33('0xa8')][_0x4283db['uniqueid']][_0x7c33('0x49')]!==_0x7c33('0x76')){this[_0x7c33('0xb0')](this[_0x7c33('0x22')][_0x4283db[_0x7c33('0xb2')]]);this[_0x7c33('0xa8')][_0x4283db[_0x7c33('0xd9')]][_0x7c33('0x110')]=moment()[_0x7c33('0x74')](_0x7c33('0xf9'));}}};Dialer[_0x7c33('0x1d')][_0x7c33('0x111')]=function(_0x38ad63){this[_0x7c33('0xc6')](_0x38ad63)['catch'](loggerCatch(_0x7c33('0x112')));this['moveContactManagedDialer'](_0x38ad63)['catch'](loggerCatch(_0x7c33('0x113')));};Dialer[_0x7c33('0x1d')][_0x7c33('0x114')]=function(_0x1b1d24){var _0xfc43dc=this[_0x7c33('0xa8')][_0x1b1d24['uniqueid']];var _0x29d51a=this;if(this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]]){if(_0xfc43dc&&_0xfc43dc['type']!==_0x7c33('0x76')){delete this[_0x7c33('0xa8')][_0x1b1d24[_0x7c33('0xd9')]];this[_0x7c33('0xb0')](this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]]);_0xfc43dc[_0x7c33('0x115')]=moment()['format'](_0x7c33('0xf9'));var _0x3e1db8=new QueueCallerAbandon(_0xfc43dc,_0x1b1d24);if(getSeconds(_0xfc43dc[_0x7c33('0x115')],_0xfc43dc[_0x7c33('0x116')])>=_0xfc43dc[_0x7c33('0x117')]){this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]][_0x7c33('0x7d')]+=0x1;this['voiceQueues'][_0x1b1d24[_0x7c33('0xb2')]][_0x7c33('0x5f')]+=0x1;this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3e1db8[_0x7c33('0xe1')]=0xa;_0x3e1db8[_0x7c33('0xa7')]=_0x7c33('0x118');_0x3e1db8[_0x7c33('0x119')]=_0x7c33('0x11a');_0x3e1db8[_0x7c33('0x10b')]=this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]]['dialQueueProject2']?moment()[_0x7c33('0x74')](_0x7c33('0xf9')):undefined;_0x3e1db8[_0x7c33('0xed')]+=0x1;_0x3e1db8['countglobal']+=0x1;if(_0x3e1db8[_0x7c33('0xed')]>=this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]][_0x7c33('0x11b')]){this[_0x7c33('0x111')](_0x3e1db8);}else{this[_0x7c33('0xbd')]({'active':![],'countdropretry':_0x3e1db8[_0x7c33('0xed')],'scheduledat':moment()[_0x7c33('0xf6')](this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]][_0x7c33('0x11c')],'minutes')[_0x7c33('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfc43dc[_0x7c33('0xcd')],'ListId':_0xfc43dc['ListId'],'VoiceQueueId':_0xfc43dc[_0x7c33('0x11d')]||undefined,'CampaignId':_0xfc43dc[_0x7c33('0xd0')]||undefined})['catch'](loggerCatch(_0x7c33('0x11e')));var _0x303e32=new History(_0x3e1db8);_0x303e32[_0x7c33('0xe1')]=0xa;_0x303e32['statedesc']=_0x7c33('0x118');_0x303e32['starttime']=moment()[_0x7c33('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x303e32[_0x7c33('0x11f')]=_0x303e32['starttime'];_0x303e32[_0x7c33('0x120')]=_0x3e1db8['calleridname'];_0x303e32[_0x7c33('0x121')]=_0x3e1db8[_0x7c33('0x121')];this[_0x7c33('0xc6')](_0x303e32)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x122')));}}else{this[_0x7c33('0x22')][_0x1b1d24['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x7c33('0x22')][_0x1b1d24['queue']][_0x7c33('0x5e')]+=0x1;_0x3e1db8[_0x7c33('0xe1')]=0xb;_0x3e1db8[_0x7c33('0xa7')]='Abandoned';_0x3e1db8['dropreason']=_0x7c33('0x123');_0x3e1db8[_0x7c33('0xee')]+=0x1;_0x3e1db8[_0x7c33('0xe7')]+=0x1;if(_0x3e1db8[_0x7c33('0xee')]>=this[_0x7c33('0x22')][_0x1b1d24['queue']][_0x7c33('0x124')]){this[_0x7c33('0x111')](_0x3e1db8);}else{this[_0x7c33('0xbd')]({'active':![],'countabandonedretry':_0x3e1db8[_0x7c33('0xee')],'scheduledat':moment()['add'](this[_0x7c33('0x22')][_0x1b1d24[_0x7c33('0xb2')]][_0x7c33('0x125')],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0xfc43dc[_0x7c33('0xcd')],'ListId':_0xfc43dc[_0x7c33('0xce')],'VoiceQueueId':_0xfc43dc[_0x7c33('0x11d')]||undefined,'CampaignId':_0xfc43dc[_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0x126')));var _0x303e32=new History(_0x3e1db8);_0x303e32[_0x7c33('0xe1')]=0xb;_0x303e32[_0x7c33('0xa7')]='Abandoned';_0x303e32[_0x7c33('0x127')]=moment()['format'](_0x7c33('0xf9'));_0x303e32[_0x7c33('0x11f')]=_0x303e32['starttime'];_0x303e32['calleridname']=_0x3e1db8[_0x7c33('0x120')];_0x303e32[_0x7c33('0x121')]=_0x3e1db8['calleridnum'];this[_0x7c33('0xc6')](_0x303e32)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x128')));}}}}};Dialer[_0x7c33('0x1d')][_0x7c33('0x129')]=function(_0x454948){if(this[_0x7c33('0x28')][_0x454948[_0x7c33('0xd9')]]){this[_0x7c33('0x28')][_0x454948[_0x7c33('0xd9')]][_0x7c33('0xad')]=_0x454948[_0x7c33('0xad')];}if(this[_0x7c33('0xa8')][_0x454948['uniqueid']]){this[_0x7c33('0xa8')][_0x454948['uniqueid']][_0x7c33('0xad')]=_0x454948[_0x7c33('0xad')];}};Dialer['prototype'][_0x7c33('0x37')]=function(_0x1c0307){if(strategy[this[_0x7c33('0x22')][this['actions'][_0x1c0307[_0x7c33('0x12a')]]['queue']][_0x7c33('0x4b')]]===_0x7c33('0x1c')){if(this[_0x7c33('0x28')][_0x1c0307['actionid']]&&_['isNil'](this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]][_0x7c33('0x12b')])&&_0x1c0307['status']==='1'&&_0x1c0307['paused']==='0'){if(this[_0x7c33('0x24')][_0x1c0307[_0x7c33('0x12c')]]){if(!this['agents'][_0x1c0307[_0x7c33('0x12c')]][_0x7c33('0x12b')]){this[_0x7c33('0x24')][_0x1c0307[_0x7c33('0x12c')]][_0x7c33('0x12b')]=!![];this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]][_0x7c33('0x12b')]=!![];this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]][_0x7c33('0x12c')]=_0x1c0307[_0x7c33('0x12c')];}}}}else if((strategy[this[_0x7c33('0x22')][this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]][_0x7c33('0xb2')]]['strategy']]||_0x7c33('0x1b'))==='rrmemory'){if(this['actions'][_0x1c0307[_0x7c33('0x12a')]]){if(this[_0x7c33('0x24')][_0x1c0307[_0x7c33('0x12c')]]){this[_0x7c33('0x28')][_0x1c0307['actionid']][_0x7c33('0x12c')]=_0x1c0307[_0x7c33('0x12c')];if(_[_0x7c33('0xda')](this[_0x7c33('0x12d')][this[_0x7c33('0x28')][_0x1c0307['actionid']][_0x7c33('0xb2')]])){this[_0x7c33('0x12d')][this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]]['queue']]=[];}this['queueBooked'][this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]][_0x7c33('0xb2')]][_0x7c33('0x12e')](_[_0x7c33('0x8d')](_['pick'](this[_0x7c33('0x28')][_0x1c0307[_0x7c33('0x12a')]],[_0x7c33('0x12f'),_0x7c33('0x12c')]),{'status':_0x1c0307[_0x7c33('0xd7')],'paused':_0x1c0307[_0x7c33('0x130')]}));}}}};function unlockQueueStatus(_0x1cab1f,_0x472de6){setTimeout(function(){if(_[_0x7c33('0x83')](_0x1cab1f['queueStatusComplete'])){loggerBooked[_0x7c33('0x95')](_0x7c33('0x131'),_0x472de6);}_0x1cab1f[_0x7c33('0x132')]=!![];loggerBooked[_0x7c33('0x7a')]('[booked][unlockQueueStatus]',_0x472de6,JSON['stringify'](_[_0x7c33('0x133')](_0x1cab1f,[_0x7c33('0x3c'),_0x7c33('0x132')])));},0x1f3);}Dialer['prototype'][_0x7c33('0x134')]=function(_0x56645c){var _0x1bcff4=this;var _0x3a8b7b=_0x1bcff4['voiceQueues'][_0x1bcff4[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['queue']];if(strategy[this['voiceQueues'][this['actions'][_0x56645c['actionid']]['queue']][_0x7c33('0x4b')]]==='roundrobin'){if(this['actions'][_0x56645c[_0x7c33('0x12a')]]&&this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['stateinterface']){this['preview'][_0x7c33('0x135')](this[_0x7c33('0x28')][_0x56645c['actionid']][_0x7c33('0x12f')],this['actions'][_0x56645c[_0x7c33('0x12a')]]['stateinterface'])[_0x7c33('0xae')](function(_0x4583d9){logger[_0x7c33('0x95')](_0x7c33('0x136'),util['inspect'](_0x4583d9,{'showHidden':![],'depth':null}));})[_0x7c33('0x20')](function(){_0x1bcff4['updateOriginated'](_0x1bcff4[_0x7c33('0x22')][_0x1bcff4[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]);_0x1bcff4['agents'][_0x1bcff4[_0x7c33('0x28')][_0x56645c['actionid']][_0x7c33('0x12c')]][_0x7c33('0x12b')]=![];delete _0x1bcff4[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]];unlockQueueStatus(_0x3a8b7b);});}else{this[_0x7c33('0xb0')](this[_0x7c33('0x22')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]);this[_0x7c33('0xbd')]({'active':![],'ContactId':this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xcd')],'ListId':this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['ListId'],'VoiceQueueId':this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0x11d')]||undefined,'CampaignId':this['actions'][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xd0')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]];unlockQueueStatus(_0x3a8b7b);}}else if((strategy[this[_0x7c33('0x22')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]][_0x7c33('0x4b')]]||_0x7c33('0x1b'))===_0x7c33('0x1b')){var _0x3780a6;if(this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]&&!_['isEmpty'](this[_0x7c33('0x12d')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['queue']])){if(this[_0x7c33('0x2e')][_0x1bcff4[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]){this[_0x7c33('0x2e')][_0x1bcff4[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['queue']]=this[_0x7c33('0x2e')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]]['queue']]?this['queueBookedRR'][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]:this['queueBooked'][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]?this[_0x7c33('0x12d')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]][_0x7c33('0x137')]||0x0:0x0;}this[_0x7c33('0x12d')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]]['_rr']=this[_0x7c33('0x2e')][this[_0x7c33('0x28')][_0x56645c[_0x7c33('0x12a')]][_0x7c33('0xb2')]];for(var _0x528822=0x0;_0x528822=0x0?!![]:![];})[_0x7c33('0xae')](myreject(_0x38e0ac)));}}else{_0x5c1ef0[_0x7c33('0x12e')](ami[_0x7c33('0x14f')]({'action':_0x7c33('0x154'),'command':util[_0x7c33('0x74')](_0x7c33('0x150'),_0x3c4ebc,!_[_0x7c33('0x83')](config[_0x7c33('0x14b')][_0x1c4d5b])?_0x1c4d5b:'')})[_0x7c33('0xb5')](function(_0x2d2475){return _0x2d2475[_0x7c33('0x155')][_0x7c33('0x152')](_0x7c33('0x153'))>=0x0?!![]:![];})[_0x7c33('0xae')](myreject(_0x38e0ac)));}BPromise[_0x7c33('0x156')](_0x5c1ef0)[_0x7c33('0xb5')](function(_0x16d4a9){var _0x578119=_[_0x7c33('0x157')](_0x16d4a9);if(_0x578119){return _0x37be5e(_0x578119);}else{_0x344a89[_0x7c33('0x3e')]=_0x5e98c6?_0x7c33('0x158'):_0x7c33('0x159');return _0x38e0ac(msgResponse(_0x7c33('0x15a'),_0x7c33('0x149'),_0x7c33('0x15b')+_0x5e98c6+'\x20'+_0x577ca8+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x3c4ebc,{'showHidden':![],'depth':null})+_0x7c33('0x15c')+_0x1c4d5b));}})[_0x7c33('0xae')](function(_0x555b14){return _0x38e0ac(msgResponse(_0x7c33('0x148'),'Failure',JSON[_0x7c33('0x73')](_0x555b14)));});});};Dialer['prototype'][_0x7c33('0x15d')]=function(_0x524a62){var _0x493ccf=this;return function(){switch(_0x524a62['dialMethod']){case _0x7c33('0x15e'):freeVariablesPredictive(_0x524a62);_0x493ccf['handlePower'](_0x524a62,0x1);break;case'power':freeVariablesPredictive(_0x524a62);_0x493ccf[_0x7c33('0x15f')](_0x524a62,_0x524a62[_0x7c33('0x160')]);break;case _0x7c33('0x161'):_0x493ccf['predictive'](_0x524a62);break;case _0x7c33('0x8'):freeVariablesPredictive(_0x524a62);_0x493ccf[_0x7c33('0x15f')](_0x524a62,0x1);break;default:freeVariablesPredictive(_0x524a62);logger[_0x7c33('0x95')](_0x7c33('0x162'),_0x524a62[_0x7c33('0x3c')],_0x7c33('0x163'));}};};Dialer[_0x7c33('0x1d')][_0x7c33('0x164')]=function(_0x2ba5f1){var _0x2651f0=this;return function(){_0x2651f0[_0x7c33('0x165')](_0x2ba5f1);};};Dialer[_0x7c33('0x1d')][_0x7c33('0x9')]=function(_0x948a61){var _0x1a5ec1=this;if(isNotPreview(_0x948a61[_0x7c33('0x55')])){if(isVoiceQueueOutbound(_0x948a61['type'])&&isActive(_0x948a61[_0x7c33('0x54')])){_0x948a61[_0x7c33('0x9e')]=!![];BPromise[_0x7c33('0xb9')]()[_0x7c33('0xb5')](checkIsLoggedIn(_0x948a61,_0x948a61[_0x7c33('0x4d')]))[_0x7c33('0xb5')](checkIsActive(_0x948a61,_0x948a61[_0x7c33('0x54')]))[_0x7c33('0xb5')](checkInterval(_0x948a61))[_0x7c33('0xb5')](_0x1a5ec1[_0x7c33('0x142')](_0x948a61))[_0x7c33('0xb5')](_0x1a5ec1[_0x7c33('0x146')](_0x948a61['dialGlobalInterval'],_0x948a61[_0x7c33('0x166')],_0x948a61[_0x7c33('0x3c')],_0x948a61))[_0x7c33('0xb5')](_0x1a5ec1['checkIfTimeIntervals'](_0x948a61[_0x7c33('0x44')],_0x948a61[_0x7c33('0x166')],_0x948a61[_0x7c33('0x3c')],_0x948a61))['then'](_0x1a5ec1['checkDialMethod'](_0x948a61))[_0x7c33('0xae')](loggerCatchQueueSummary(_0x7c33('0x167'),_0x948a61));}else{notSendMessagesQueue(_0x948a61);}}else{freeVariablesPredictive(_0x948a61);}};Dialer[_0x7c33('0x1d')][_0x7c33('0x141')]=function(){var _0x1d0906=this;var _0x183b2b;for(var _0x51582a in this[_0x7c33('0x23')]){if(this[_0x7c33('0x23')]['hasOwnProperty'](_0x51582a)){_0x183b2b=this['campaigns'][_0x51582a];if(isCampaignIvr(_0x183b2b[_0x7c33('0x49')])&&isActive(_0x183b2b[_0x7c33('0xd5')])){_0x183b2b['sendMessageOneNotActive']=!![];BPromise[_0x7c33('0xb9')]()['then'](checkIsActive(_0x183b2b,_0x183b2b['active']))[_0x7c33('0xb5')](checkInterval(_0x183b2b))['then'](_0x1d0906[_0x7c33('0x142')](_0x183b2b))[_0x7c33('0xb5')](_0x1d0906[_0x7c33('0x146')](_0x183b2b['dialGlobalInterval'],_0x183b2b[_0x7c33('0x166')],_0x183b2b[_0x7c33('0x3c')],_0x183b2b))[_0x7c33('0xb5')](_0x1d0906[_0x7c33('0x147')](_0x183b2b[_0x7c33('0x44')],_0x183b2b['dialTimezone'],_0x183b2b[_0x7c33('0x3c')],_0x183b2b))[_0x7c33('0xb5')](_0x1d0906['launchHandleIvr'](_0x183b2b))[_0x7c33('0xae')](loggerCatchQueueSummary(_0x7c33('0x168'),_0x183b2b));}else{notSendMessagesCampaign(_0x183b2b);}}}};function getCallerIdRandom(_0x1930cc,_0x386535){var _0x424d01,_0x441d2f,_0x696429;if(_0x386535<=0x0){_0x386535=0x1;}_0x424d01=new RegExp(_0x7c33('0x169')+_0x386535+'}$');_0x441d2f=Math['pow'](0xa,_0x386535-0x1);_0x696429=Math[_0x7c33('0x16a')](0xa,_0x386535)-0x1;return util['format']('%s',_['replace'](_0x1930cc,_0x424d01,_[_0x7c33('0x16b')](_0x441d2f,_0x696429)));}function extractCalleridName(_0x40839a){var _0x42d85d=_0x40839a['match'](/"(.*?)"/);return _0x42d85d?_0x42d85d[0x1]:_0x40839a;}function extractCalleridNumber(_0x4596fe){var _0x4331e4=_0x4596fe[_0x7c33('0x16c')](/<(.*?)>/);return _0x4331e4?_0x4331e4[0x1]:_0x4596fe;}Dialer[_0x7c33('0x1d')][_0x7c33('0x16d')]=function(_0x4724b6,_0x327a84){var _0xddc223=this;var _0x511c33=uuid['v4']();this[_0x7c33('0x28')][_0x511c33]=new Action(_0x4724b6,_0x327a84,_0x511c33);return new BPromise(function(_0x81b94a,_0x1208c8){if(_[_0x7c33('0x83')](_0x4724b6)&&_0x7c33('0x16e')!==typeof _0x4724b6){return _0x1208c8(msgResponse(_0x7c33('0x16f'),_0x7c33('0x149'),_0x7c33('0x170')));}if(_['isUndefined'](_0x327a84['Contact'][_0x7c33('0x171')])||_0x327a84[_0x7c33('0x172')]['phone']===null){return _0x1208c8(msgResponse(_0x7c33('0x16f'),_0x7c33('0x149'),'contact\x20is\x20undefine'));}var _0x430a9a={'XMD-CALLERID':_0xddc223[_0x7c33('0x28')][_0x511c33][_0x7c33('0x173')](),'XMD-AGI':_0x4724b6['dialQueueProject']?util[_0x7c33('0x74')](_0x7c33('0x174'),ipAgi,_0x4724b6['dialQueueProject']):_0x7c33('0x175'),'XMD-AGIAFTER':_0x4724b6['dialQueueProject2']?util[_0x7c33('0x74')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4724b6[_0x7c33('0x10c')]):_0x7c33('0x175'),'XMD-QUEUE':_0x4724b6[_0x7c33('0x49')]===_0x7c33('0x4a')?util[_0x7c33('0x74')]('\x22%s,%s%s,,,%s\x22',_0x4724b6[_0x7c33('0x3c')],_0x4724b6[_0x7c33('0x176')]||'',_0x4724b6[_0x7c33('0x10d')]?'c':'',_0x4724b6[_0x7c33('0x117')]||0x3):_0x7c33('0x175'),'XMD-CONTACTID':_0x327a84['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xddc223['actions'][_0x511c33]['getCaller'](),'XMD-AMD':_0x4724b6[_0x7c33('0xdf')]?_0x7c33('0x177'):_0x7c33('0x175'),'XMD-DESTINATION':_0x7c33('0xde')};if(_0x4724b6[_0x7c33('0xdf')]){_0x430a9a[_0x7c33('0x178')]=_0x4724b6[_0x7c33('0x179')]||0x9c4;_0x430a9a[_0x7c33('0x17a')]=_0x4724b6[_0x7c33('0x17b')]||0x5dc;_0x430a9a[_0x7c33('0x17c')]=_0x4724b6[_0x7c33('0x17d')]||0x320;_0x430a9a[_0x7c33('0x17e')]=_0x4724b6['dialAMDTotalAnalysisTime']||0x1388;_0x430a9a[_0x7c33('0x17f')]=_0x4724b6[_0x7c33('0x180')]||0x64;_0x430a9a['XMD-AMDBETWEENWORDSSILENCE']=_0x4724b6[_0x7c33('0x181')]||0x32;_0x430a9a[_0x7c33('0x182')]=_0x4724b6['dialAMDMaximumNumberOfWords']||0x3;_0x430a9a['XMD-AMDSILENCETHRESHOLD']=_0x4724b6[_0x7c33('0x183')]||0x100;_0x430a9a[_0x7c33('0x184')]=_0x4724b6[_0x7c33('0x185')]||0x1388;}if(_0x4724b6[_0x7c33('0x49')]===_0x7c33('0x4a')){_0x430a9a[_0x7c33('0x186')]=_0x327a84['VoiceQueueId'];}else{_0x430a9a['XMD-CAMPAIGNID']=_0x327a84[_0x7c33('0xd0')];}for(var _0x5bdc1a in _0x327a84[_0x7c33('0x172')]){if(_0x327a84['Contact']['hasOwnProperty'](_0x5bdc1a)){if(isNotNull(_0x327a84['Contact'][_0x5bdc1a])&&_0x5bdc1a!=='id'&&_0x5bdc1a!==_0x7c33('0x187')&&_0x5bdc1a!==_0x7c33('0x188')&&_0x5bdc1a!=='updatedAt'){_0x430a9a[util['format'](_0x7c33('0x189'),_0x7c33('0x18a'),_[_0x7c33('0x18b')](_0x5bdc1a))]=_0x327a84[_0x7c33('0x172')][_0x5bdc1a];}}}var _0x321962=_0xddc223[_0x7c33('0xd4')](_0x4724b6[_0x7c33('0x71')])?getCallerId(_0x4724b6['Trunk']['callerid'],_0x4724b6[_0x7c33('0x18c')],_0x4724b6[_0x7c33('0x18d')]>0x0?getCallerIdRandom(_0x4724b6[_0x7c33('0x56')],_0x4724b6[_0x7c33('0x18d')]):_0x4724b6[_0x7c33('0x56')]):getCallerId(_[_0x7c33('0xda')](_0x4724b6[_0x7c33('0x143')])?_0x4724b6['Trunk'][_0x7c33('0x72')]:_0x4724b6['TrunkBackup']['callerid'],_0x4724b6[_0x7c33('0x18c')],_0x4724b6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4724b6[_0x7c33('0x56')],_0x4724b6[_0x7c33('0x18d')]):_0x4724b6['dialOriginateCallerIdNumber']);if(_0x321962){_0x430a9a[_0x7c33('0x18e')]=_0xddc223[_0x7c33('0x28')][_0x511c33][_0x7c33('0x18f')]=extractCalleridName(_0x321962);_0x430a9a[_0x7c33('0x190')]=_0xddc223[_0x7c33('0x28')][_0x511c33][_0x7c33('0x191')]=extractCalleridNumber(_0x321962);}return ami[_0x7c33('0x14f')]({'actionid':_0x511c33,'action':'originate','channel':_0xddc223[_0x7c33('0xd4')](_0x4724b6['Trunk'])?util[_0x7c33('0x74')](_0x7c33('0x192'),_0x4724b6[_0x7c33('0x71')][_0x7c33('0x3c')],isNotNull(_0x4724b6[_0x7c33('0x57')])?_0x4724b6[_0x7c33('0x57')][_0x7c33('0x193')]()||'':'',_0x4724b6[_0x7c33('0x194')]>0x0?_0x327a84[_0x7c33('0x172')]['phone'][_0x7c33('0x195')](_0x4724b6[_0x7c33('0x194')]):_0x327a84['Contact'][_0x7c33('0x171')]):util[_0x7c33('0x74')](_0x7c33('0x192'),_['isNil'](_0x4724b6[_0x7c33('0x143')])?_0x4724b6[_0x7c33('0x71')][_0x7c33('0x3c')]:_0x4724b6[_0x7c33('0x143')][_0x7c33('0x3c')],isNotNull(_0x4724b6[_0x7c33('0x57')])?_0x4724b6[_0x7c33('0x57')]['trim']()||'':'',_0x4724b6[_0x7c33('0x194')]>0x0?_0x327a84['Contact'][_0x7c33('0x171')][_0x7c33('0x195')](_0x4724b6[_0x7c33('0x194')]):_0x327a84[_0x7c33('0x172')][_0x7c33('0x171')]),'callerid':_0x321962,'Exten':_0x7c33('0xde'),'Context':'from-sip','Priority':'1','variable':_0x430a9a,'timeout':(_0x4724b6[_0x7c33('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x511c33})['then'](function(_0x282f42){return _0x81b94a(_0x282f42);})['catch'](function(_0x3c5754){_0x4724b6[_0x7c33('0x197')]+=0x1;var _0x16acc9=new History(_0xddc223[_0x7c33('0x28')][_0x511c33]);logger[_0x7c33('0x95')](util[_0x7c33('0x74')]('[originateError]:\x20%s',JSON[_0x7c33('0x73')](_0x3c5754)));_0x16acc9['state']=0xe;_0x16acc9[_0x7c33('0xa7')]=_0x7c33('0x198');_0x16acc9[_0x7c33('0x127')]=moment()['format'](_0x7c33('0xf9'));_0x16acc9['endtime']=_0x16acc9[_0x7c33('0x127')];_0xddc223['createHistory'](_0x16acc9)['catch'](loggerCatch(_0x7c33('0x199')));_0xddc223[_0x7c33('0xc5')](_0x16acc9)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x199')))[_0x7c33('0x20')](function(){delete _0xddc223[_0x7c33('0x28')][_0x511c33];return _0x1208c8(msgResponse(_0x7c33('0x16f'),_0x7c33('0x19a'),_0x7c33('0x19b')));});});});};Dialer[_0x7c33('0x1d')][_0x7c33('0x31')]=function(_0x4975c8){var _0x120efd=this[_0x7c33('0x28')][_0x4975c8[_0x7c33('0x12a')]];var _0x5a36b7=this;if(_0x120efd){delete this['actions'][_0x4975c8['actionid']];_0x120efd['responsetime']=moment()[_0x7c33('0x74')](_0x7c33('0xf9'));var _0x2dcf9d=_0x120efd[_0x7c33('0x49')]===_0x7c33('0x76')?this[_0x7c33('0x23')][_0x120efd[_0x7c33('0xb2')]]:this[_0x7c33('0x22')][_0x120efd[_0x7c33('0x19c')]()];if(!this[_0x7c33('0xd3')](_0x4975c8[_0x7c33('0x19d')])){this[_0x7c33('0xb0')](_0x2dcf9d);return this[_0x7c33('0x19e')](_0x120efd,_0x2dcf9d,_0x4975c8)['then'](function(_0x452b52){})['catch'](loggerCatch(_0x7c33('0x19f')));}else{this[_0x7c33('0xa8')][_0x4975c8[_0x7c33('0xd9')]]=_0x120efd;}}};Dialer[_0x7c33('0x1d')][_0x7c33('0x1a0')]=function(_0x13e3d0,_0x39f8b6,_0x5c8b82){var _0x108a33=new History(_0x39f8b6);if(_0x108a33['countbusyretry']+_0x108a33['countcongestionretry']+_0x108a33[_0x7c33('0xff')]+_0x108a33[_0x7c33('0xec')]+_0x108a33[_0x7c33('0xed')]+_0x108a33[_0x7c33('0xee')]+_0x108a33['countmachineretry']+_0x108a33[_0x7c33('0xf0')]>=_0x5c8b82[_0x7c33('0xf1')]-0x1){return!![];}switch(_0x13e3d0){case 0x3:if(_0x108a33[_0x7c33('0xff')]>=_0x5c8b82[_0x7c33('0x1a1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x108a33[_0x7c33('0xff')]+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82[_0x7c33('0x1a2')],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33['VoiceQueueId']||undefined,'CampaignId':_0x108a33[_0x7c33('0xd0')]||undefined})['catch'](loggerCatch(_0x7c33('0x1a3')));}break;case 0x5:if(_0x108a33[_0x7c33('0xea')]>=_0x5c8b82[_0x7c33('0x1a4')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countbusyretry':_0x108a33[_0x7c33('0xea')]+=0x1,'scheduledat':moment()['add'](_0x5c8b82[_0x7c33('0x1a5')],_0x7c33('0xf8'))[_0x7c33('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33['VoiceQueueId']||undefined,'CampaignId':_0x108a33['CampaignId']||undefined})[_0x7c33('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x108a33[_0x7c33('0xeb')]>=_0x5c8b82[_0x7c33('0x1a6')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countcongestionretry':_0x108a33['countcongestionretry']+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82[_0x7c33('0x1a7')],_0x7c33('0xf8'))[_0x7c33('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33[_0x7c33('0x11d')]||undefined,'CampaignId':_0x108a33['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x108a33['countnosuchnumberretry']>=_0x5c8b82[_0x7c33('0x1a8')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countnosuchnumberretry':_0x108a33['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82['dialNoSuchNumberRetryFrequency'],_0x7c33('0xf8'))['format'](_0x7c33('0xf9')),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33[_0x7c33('0x11d')]||undefined,'CampaignId':_0x108a33[_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1a9')));}break;case 0xa:if(_0x108a33[_0x7c33('0xed')]>=_0x5c8b82['dialDropMaxRetry']-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countdropretry':_0x108a33['countdropretry']+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82[_0x7c33('0x11c')],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0x108a33['ContactId'],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33[_0x7c33('0x11d')]||undefined,'CampaignId':_0x108a33['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x108a33[_0x7c33('0xee')]>=_0x5c8b82[_0x7c33('0x124')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countabandonedretry':_0x108a33[_0x7c33('0xee')]+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82['dialAbandonedRetryFrequency'],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33[_0x7c33('0xce')],'VoiceQueueId':_0x108a33['VoiceQueueId']||undefined,'CampaignId':_0x108a33[_0x7c33('0xd0')]||undefined})['catch'](loggerCatch(_0x7c33('0x126')));}break;case 0x13:if(_0x108a33[_0x7c33('0xef')]>=_0x5c8b82[_0x7c33('0xf4')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countmachineretry':_0x108a33[_0x7c33('0xef')]+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82[_0x7c33('0xf7')],_0x7c33('0xf8'))[_0x7c33('0x74')](_0x7c33('0xf9')),'ContactId':_0x108a33['ContactId'],'ListId':_0x108a33['ListId'],'VoiceQueueId':_0x108a33['VoiceQueueId']||undefined,'CampaignId':_0x108a33[_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0xfa')));}break;case 0x14:if(_0x108a33[_0x7c33('0xf0')]>=_0x5c8b82[_0x7c33('0x1aa')]-0x1){return!![];}else{this[_0x7c33('0xbd')]({'active':![],'countagentrejectretry':_0x108a33[_0x7c33('0xf0')]+=0x1,'scheduledat':moment()[_0x7c33('0xf6')](_0x5c8b82['dialAgentRejectRetryFrequency'],'minutes')['format'](_0x7c33('0xf9')),'ContactId':_0x108a33[_0x7c33('0xcd')],'ListId':_0x108a33['ListId'],'VoiceQueueId':_0x108a33['VoiceQueueId']||undefined,'CampaignId':_0x108a33['CampaignId']||undefined})['catch'](loggerCatch(_0x7c33('0x1ab')));}break;default:return!![];}};Dialer[_0x7c33('0x1d')][_0x7c33('0x19e')]=function(_0x3daf5b,_0x3a1644,_0x3273c1){var _0x307dbf=this;var _0x258153=new History(_0x3daf5b);return new BPromise(function(_0x2d4a27,_0x22824f){if(_[_0x7c33('0x83')](_0x3a1644)&&_0x7c33('0x16e')!==typeof _0x3a1644){return _0x22824f(msgResponse(_0x7c33('0x1ac'),_0x7c33('0x149'),'entity\x20is\x20undefine'));}if(_[_0x7c33('0x83')](_0x3273c1)&&_0x7c33('0x16e')!==typeof _0x3273c1){return _0x22824f(msgResponse('[callProgressDetecting]','Failure',_0x7c33('0x1ad')));}switch(_0x3273c1['reason']){case'0':_0x3a1644[_0x7c33('0x61')]+=0x1;_0x258153['state']=0x0;_0x258153['statedesc']=_0x7c33('0x1ae');_0x258153['countnosuchnumberretry']+=0x1;_0x258153['countglobal']+=0x1;ami[_0x7c33('0x48')]('custom:agentnosuchnumber',ut['buildObj'](_0x3daf5b,'nosuchnumber'));_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch(_0x7c33('0xe9')));if(_0x307dbf[_0x7c33('0x1a0')](0x0,_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xec')]>=_0x3a1644[_0x7c33('0x1a8')]){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1af'));}else{_0x307dbf[_0x7c33('0xf2')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1af'));}}break;case'3':_0x3a1644['outboundNoAnswerCallsDay']+=0x1;_0x258153['state']=0x3;_0x258153['statedesc']='NoAnswer';_0x258153['countnoanswerretry']+=0x1;_0x258153[_0x7c33('0xe7')]+=0x1;ami[_0x7c33('0x48')]('custom:agentnoanswer',ut[_0x7c33('0x1b0')](_0x3daf5b,_0x7c33('0x1b1')));_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x307dbf[_0x7c33('0x1a0')](0x3,_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xff')]>=_0x3a1644[_0x7c33('0x1a1')]){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1b2'));}else{_0x307dbf['stateGlobal'](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1b2'));}}break;case'5':_0x3a1644['outboundBusyCallsDay']+=0x1;_0x258153['state']=0x5;_0x258153[_0x7c33('0xa7')]=_0x7c33('0x1b3');_0x258153['countbusyretry']+=0x1;_0x258153[_0x7c33('0xe7')]+=0x1;ami[_0x7c33('0x48')](_0x7c33('0x1b4'),ut[_0x7c33('0x1b0')](_0x3daf5b,'busy'));_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1b5')));if(_0x307dbf[_0x7c33('0x1a0')](0x5,_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xea')]>=_0x3a1644[_0x7c33('0x1a4')]){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1b6'));}else{_0x307dbf[_0x7c33('0xf2')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1b6'));}}break;case'8':_0x3a1644[_0x7c33('0x5c')]+=0x1;_0x258153[_0x7c33('0xe1')]=0x8;_0x258153['statedesc']=_0x7c33('0x1b7');_0x258153[_0x7c33('0xeb')]+=0x1;_0x258153[_0x7c33('0xe7')]+=0x1;ami['emit'](_0x7c33('0x1b8'),ut[_0x7c33('0x1b0')](_0x3daf5b,_0x7c33('0x1b9')));_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1ba')));if(_0x307dbf[_0x7c33('0x1a0')](0x8,_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xeb')]>=_0x3a1644[_0x7c33('0x1a6')]){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1bb'));}else{_0x307dbf['stateGlobal'](_0x258153,_0x2d4a27,_0x22824f,'reason\x208\x20congestion');}}break;case'11':_0x3a1644[_0x7c33('0x1bc')]+=0x1;_0x258153[_0x7c33('0xe1')]=0xb;_0x258153['statedesc']=_0x7c33('0x1bd');_0x258153[_0x7c33('0xee')]+=0x1;_0x258153[_0x7c33('0xe7')]+=0x1;_0x307dbf['createHistory'](_0x258153)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x128')));if(_0x307dbf[_0x7c33('0x1a0')](0xb,_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xee')]>=_0x3a1644['dialAbandonedMaxRetry']){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,'reason\x2011\x20abandoned');}else{_0x307dbf[_0x7c33('0xf2')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1be'));}}break;case'20':_0x3a1644[_0x7c33('0x63')]+=0x1;_0x258153['state']=0x14;_0x258153['statedesc']=_0x7c33('0x1bf');_0x258153['countagentrejectretry']+=0x1;_0x258153['countglobal']+=0x1;ami[_0x7c33('0x48')]('custom:agentreject',ut[_0x7c33('0x1b0')](_0x3daf5b,_0x7c33('0x1c0')));_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1c1')));if(_0x307dbf[_0x7c33('0x1a0')](0x14,_0x3daf5b,_0x3a1644)){if(_0x258153['countagentrejectretry']>=_0x3a1644[_0x7c33('0x1aa')]){_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1c2'));}else{_0x307dbf[_0x7c33('0xf2')](_0x258153,_0x2d4a27,_0x22824f,_0x7c33('0x1c2'));}}break;default:_0x3a1644['outboundUnknownCallsDay']+=0x1;_0x258153[_0x7c33('0xe1')]=0xc;_0x258153[_0x7c33('0xa7')]=_0x3273c1['reason'];_0x307dbf[_0x7c33('0xc6')](_0x258153)[_0x7c33('0xae')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x307dbf['checkRetriveMax'](_0x3273c1[_0x7c33('0x1c3')],_0x3daf5b,_0x3a1644)){if(_0x258153[_0x7c33('0xea')]+_0x258153[_0x7c33('0xeb')]+_0x258153[_0x7c33('0xff')]+_0x258153[_0x7c33('0xec')]+_0x258153[_0x7c33('0xed')]+_0x258153['countabandonedretry']+_0x258153[_0x7c33('0xef')]+_0x258153[_0x7c33('0xf0')]>=_0x3a1644[_0x7c33('0xf1')]){_0x307dbf[_0x7c33('0xf2')](_0x258153,_0x2d4a27,_0x22824f,_0x3273c1['reason']);}else{_0x307dbf[_0x7c33('0x100')](_0x258153,_0x2d4a27,_0x22824f,_0x3273c1[_0x7c33('0x1c3')]);}}}});};Dialer[_0x7c33('0x1d')][_0x7c33('0xf2')]=function(_0x36dd33,_0x48230d,_0x2b9f58,_0x14770e){var _0x32d882=new Final(_0x36dd33);_0x32d882[_0x7c33('0xe1')]=0xf;_0x32d882[_0x7c33('0xa7')]='Global';this[_0x7c33('0x100')](_0x32d882,_0x48230d,_0x2b9f58,_0x14770e);};Dialer['prototype'][_0x7c33('0x100')]=function(_0x53018d,_0x3a56ed,_0x11bfa8,_0x3581f6){this[_0x7c33('0xc5')](_0x53018d)[_0x7c33('0xb5')](function(_0x5563e9){return _0x3a56ed(msgResponse(_0x7c33('0x1ac'),_0x7c33('0x1c4'),_0x3581f6));})['catch'](function(_0x568c24){return _0x11bfa8(msgResponse(_0x7c33('0x1c5'),_0x7c33('0x149'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x7c33('0x161')]=function(_0x3ea879){var _0x51a82a=this;var _0x573689=_0x3ea879[_0x7c33('0x1c6')]/0x64;var _0x378253=_0x3ea879['outboundDropCallsDayTimeout']/(_0x3ea879[_0x7c33('0x5f')]+_0x3ea879['outboundAnswerCallsDay']);var _0x5d9ffe=Math[_0x7c33('0x1c7')](_0x3ea879['predictiveIntervalAvailable']*(_0x3ea879[_0x7c33('0x1c8')]/0x64));var _0x5698ee=Math['round'](_0x3ea879[_0x7c33('0x6d')]*(_0x3ea879[_0x7c33('0x1c9')]/0x64));var _0x3290d6=_0x3ea879[_0x7c33('0x4c')]+_0x3ea879[_0x7c33('0x50')];var _0x33f7a2=Math[_0x7c33('0x1ca')](_0x3ea879[_0x7c33('0x88')]*_0x3ea879[_0x7c33('0x8a')]*_0x3ea879[_0x7c33('0x6a')]*_0x3ea879[_0x7c33('0x6b')]);if(_[_0x7c33('0x83')](_0x3ea879[_0x7c33('0x2c')])){if(!_['isUndefined'](_0x3ea879[_0x7c33('0x2b')])){_0x3ea879['startPredictive']=undefined;loggerPredictive[_0x7c33('0x95')](_0x7c33('0x1cb'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x7c33('0x83')](_0x3ea879[_0x7c33('0x90')])){loggerPredictive['error'](_0x7c33('0x1cb'),_0x7c33('0x1cc'));clearInterval(_0x3ea879['handlePredictive']);_0x3ea879[_0x7c33('0x90')]=undefined;}_0x3ea879['startProgressive']=moment()[_0x7c33('0x74')](_0x7c33('0xf9'));loggerPredictive[_0x7c33('0x7a')](_0x3ea879[_0x7c33('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x3ea879[_0x7c33('0x2c')]);this[_0x7c33('0x15f')](_0x3ea879,0x1);}else if(ifInterval(_0x3ea879[_0x7c33('0x1cd')],_0x3ea879[_0x7c33('0x2c')])){this[_0x7c33('0x15f')](_0x3ea879,0x1);loggerPredictiveCalls[_0x7c33('0x7a')](_0x7c33('0x1ce'),_0x3ea879[_0x7c33('0x2c')],_0x3ea879[_0x7c33('0x3c')]);_0x3ea879[_0x7c33('0x88')]=0x0;_0x3ea879[_0x7c33('0x69')]=0x0;}else if(_0x573689<_0x378253&&_0x3ea879['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x3ea879);loggerPredictive['info'](_0x7c33('0x1cf'),'Dropped\x20calls\x20day',_0x378253,_0x7c33('0x2c'),_0x3ea879[_0x7c33('0x3c')]);}else if(_0x33f7a2<_0x3ea879[_0x7c33('0x69')]&&_0x3ea879['dialPredictiveOptimization']===_0x7c33('0x1d0')){freeVariablesPredictive(_0x3ea879);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x7c33('0x1d1'),_0x33f7a2,'Drop\x20in\x20this\x20interval',_0x3ea879[_0x7c33('0x69')],_0x7c33('0x2c'),_0x3ea879['name']);}else if(!ifInterval(_0x3ea879[_0x7c33('0x1cd')],_0x3ea879['startProgressive'])&&_[_0x7c33('0x83')](_0x3ea879[_0x7c33('0x2b')])&&!_[_0x7c33('0x83')](_0x3ea879[_0x7c33('0x2c')])){_0x3ea879[_0x7c33('0x2b')]=moment()[_0x7c33('0x74')](_0x7c33('0xf9'));loggerPredictive[_0x7c33('0x7a')](_0x3ea879['name'],_0x7c33('0x1d2'),_0x3ea879[_0x7c33('0x2b')]);this[_0x7c33('0xba')](_0x3ea879[_0x7c33('0x1cd')])[_0x7c33('0xb5')](this[_0x7c33('0x1d3')](_0x3ea879))[_0x7c33('0xb5')](mergeDataErlangB(_0x3ea879))[_0x7c33('0xb5')](this[_0x7c33('0x1d4')](_0x3ea879))[_0x7c33('0xae')](loggerCatchPredictive(_0x7c33('0x1d5'),_0x3ea879));}else if(!ifInterval(_0x3ea879[_0x7c33('0x1cd')],_0x3ea879[_0x7c33('0x2b')])){_0x3ea879[_0x7c33('0x69')]=0x0;_0x3ea879['startPredictive']=moment()['format'](_0x7c33('0xf9'));loggerPredictive['info'](_0x3ea879[_0x7c33('0x3c')],_0x7c33('0x1d6'),_0x3ea879[_0x7c33('0x2b')]);clearInterval(_0x3ea879[_0x7c33('0x90')]);_0x3ea879['handlePredictive']=undefined;this[_0x7c33('0xba')](_0x3ea879['dialPredictiveInterval'])[_0x7c33('0xb5')](this[_0x7c33('0x1d3')](_0x3ea879))['then'](mergeDataErlangB(_0x3ea879))[_0x7c33('0xb5')](this['startMethodPredictive'](_0x3ea879))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3ea879));}else if(_0x3ea879[_0x7c33('0x6d')]&&_0x3290d6<_0x3ea879['predictiveIntervalAvailable']-_0x5698ee){freeVariablesPredictive(_0x3ea879);loggerPredictive[_0x7c33('0x7a')](_0x3ea879[_0x7c33('0x3c')],_0x7c33('0x1d7'),_0x3290d6,_0x7c33('0x1d8'),_0x3ea879['predictiveIntervalAvailable'],'-',_0x5698ee,'=',_0x3ea879['predictiveIntervalAvailable']-_0x5698ee,')');}else if(_0x3ea879[_0x7c33('0x6d')]&&_0x3290d6>_0x3ea879[_0x7c33('0x6d')]+_0x5d9ffe){freeVariablesPredictive(_0x3ea879);loggerPredictive['info'](_0x3ea879[_0x7c33('0x3c')],_0x7c33('0x1d7'),_0x3290d6,_0x7c33('0x1d9'),_0x3ea879[_0x7c33('0x6d')],'+',_0x5d9ffe,'=',_0x3ea879[_0x7c33('0x6d')]+_0x5d9ffe,')');}};Dialer[_0x7c33('0x1d')][_0x7c33('0x1d3')]=function(_0x381b2b){var _0x3d7d1e=this;return function(_0xfe4459){return new BPromise(function(_0x4da90e,_0x388554){_['merge'](_0x381b2b,_0xfe4459[0x0]);if(checkGetDataPredictive(_0xfe4459[0x0])){var _0x5262c3=_0x381b2b[_0x7c33('0x6d')]=_0x381b2b[_0x7c33('0x50')]+_0x381b2b[_0x7c33('0x4c')];var _0x4273f7=_0x381b2b[_0x7c33('0x1cd')]*0x3c;var _0xcb18bc=_0xfe4459[0x0][_0x7c33('0x80')]+_0xfe4459[0x0][_0x7c33('0x66')];var _0x47f5da=(_0xfe4459[0x0][_0x7c33('0x65')]+_0xfe4459[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xfe4459[0x0][_0x7c33('0x67')])/_0xfe4459[0x0][_0x7c33('0x82')];_0x381b2b[_0x7c33('0x6a')]=_0x47f5da>0x0?_0x47f5da:0x1;switch(_0x381b2b['dialPredictiveOptimization']){case _0x7c33('0x1d0'):var _0x141b56=_0x381b2b[_0x7c33('0x1c6')]/0x64;return _0x3d7d1e['abandonmentRate'](_0x5262c3,_0x4273f7,_0xcb18bc,_0x47f5da,_0x141b56)[_0x7c33('0xb5')](function(_0x4e35e7){return _0x4da90e(_0x4e35e7);});case _0x7c33('0x1da'):var _0x423e15=_0x381b2b[_0x7c33('0x1c6')]/0x64;return _0x3d7d1e[_0x7c33('0x1db')](_0x5262c3,_0x4273f7,_0xcb18bc,_0x47f5da,_0x423e15)['then'](function(_0x2da09c){return _0x4da90e(_0x2da09c);});default:return _0x388554(msgResponse(_0x7c33('0x1dc'),_0x7c33('0x149'),'Unknown\x20Predictive'));}}else{return _0x388554(msgResponse(_0x7c33('0x1dc'),_0x7c33('0x149'),_0x7c33('0x1dd')));}});};};Dialer['prototype'][_0x7c33('0x1de')]=function(_0x22cbc7){var _0x1901d8=this;return function(_0x308bbf){return new BPromise(function(_0x3a3d99,_0x24f1bb){_[_0x7c33('0x8d')](_0x22cbc7,_0x308bbf[0x0]);if(checkGetDataPredictive(_0x308bbf[0x0])){loggerPredictive[_0x7c33('0x7a')](JSON['stringify'](_0x308bbf[0x0]));if(_0x22cbc7['dialPredictiveOptimization']===_0x7c33('0x1d0')){return _0x1901d8[_0x7c33('0xc4')](_0x22cbc7['id'])[_0x7c33('0xb5')](function(_0x10bcd2){var _0x4a1bb0=_0x22cbc7[_0x7c33('0x4d')]-_0x10bcd2[0x0][_0x7c33('0x1df')];var _0x381dac=_0x22cbc7['dialPredictiveInterval']*0x3c;var _0x47e609=_0x308bbf[0x0][_0x7c33('0x80')]+_0x308bbf[0x0][_0x7c33('0x66')];var _0x3d1a6f=(_0x308bbf[0x0][_0x7c33('0x65')]+_0x308bbf[0x0][_0x7c33('0x7d')]+_0x308bbf[0x0][_0x7c33('0x67')])/_0x308bbf[0x0][_0x7c33('0x82')];var _0x2d4104=_0x22cbc7[_0x7c33('0x1c6')]/0x64;_0x22cbc7[_0x7c33('0x6c')]=_0x10bcd2[0x0][_0x7c33('0x1df')]||0x0;_0x22cbc7[_0x7c33('0x6a')]=_0x3d1a6f>0x0?_0x3d1a6f:0x1;return _0x1901d8[_0x7c33('0x1e0')](_0x4a1bb0,_0x381dac,_0x47e609,_0x3d1a6f,_0x2d4104);})[_0x7c33('0xb5')](function(_0x186d84){return _0x3a3d99(_0x186d84);})[_0x7c33('0xae')](function(_0x18573f){return _0x24f1bb(msgResponse(_0x7c33('0x1e1'),_0x7c33('0x149'),JSON[_0x7c33('0x73')](_0x18573f)));});}if(_0x22cbc7['dialPredictiveOptimization']===_0x7c33('0x1da')){return _0x1901d8[_0x7c33('0xc4')](_0x22cbc7['id'])[_0x7c33('0xb5')](function(_0x4110d9){var _0x55f033=_0x22cbc7[_0x7c33('0x4d')]-_0x4110d9[0x0]['outboundQueuePauses'];var _0x154b3d=_0x22cbc7[_0x7c33('0x1cd')]*0x3c;var _0x123bbb=_0x308bbf[0x0][_0x7c33('0x80')]+_0x308bbf[0x0][_0x7c33('0x66')];var _0x520ab7=(_0x308bbf[0x0][_0x7c33('0x65')]+_0x308bbf[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x308bbf[0x0][_0x7c33('0x67')])/_0x308bbf[0x0][_0x7c33('0x82')];var _0x588a14=_0x22cbc7[_0x7c33('0x1c6')]/0x64;_0x22cbc7[_0x7c33('0x6c')]=_0x4110d9[0x0][_0x7c33('0x1df')]||0x0;_0x22cbc7['predictiveIntervalHitRate']=_0x520ab7>0x0?_0x520ab7:0x1;return _0x1901d8[_0x7c33('0x1db')](_0x55f033,_0x154b3d,_0x123bbb,_0x520ab7,_0x588a14);})[_0x7c33('0xb5')](function(_0x40247e){return _0x3a3d99(_0x40247e);})[_0x7c33('0xae')](function(_0x1c4041){return _0x24f1bb(msgResponse(_0x7c33('0x1e1'),_0x7c33('0x149'),JSON[_0x7c33('0x73')](_0x1c4041)));});}}else{return _0x24f1bb(msgResponse(_0x7c33('0x1dc'),_0x7c33('0x149'),_0x7c33('0x1dd')));}});};};Dialer['prototype'][_0x7c33('0x1d4')]=function(_0x73e278){var _0x3ef085=this;return function(){var _0x2736cb=0x0;var _0x1fd5e8=Math[_0x7c33('0x1ca')](_0x73e278[_0x7c33('0x6f')]*0x3e8);if(_0x1fd5e8>0x0){_0x1fd5e8=_0x1fd5e8<0x64?0x64:_0x1fd5e8;loggerPredictive[_0x7c33('0x7a')](_0x73e278['name'],_0x7c33('0x1e2'),_0x1fd5e8,_0x7c33('0x46'));_0x73e278[_0x7c33('0x90')]=setInterval(function(){_0x3ef085[_0x7c33('0x90')](_0x73e278);loggerPredictiveCalls['info'](_0x7c33('0x1e3'),_0x2736cb+=0x1);},_0x1fd5e8);}else{loggerPredictive[_0x7c33('0x7a')](_0x73e278[_0x7c33('0x3c')],_0x7c33('0x1e4'));}};};Dialer[_0x7c33('0x1d')][_0x7c33('0x1e5')]=function(_0x414fb2,_0x187261){var _0x2f8b90=this;return function(_0x338f03){if(_[_0x7c33('0x43')](_0x338f03)){if(_['isNil'](_0x187261[_0x7c33('0xcf')])||!_0x187261[_0x7c33('0x1e6')]){if(_0x414fb2[_0x7c33('0x55')]===_0x7c33('0x8')){_0x414fb2[_0x7c33('0x132')]=_[_0x7c33('0x83')](_0x414fb2[_0x7c33('0x132')])?!![]:_0x414fb2[_0x7c33('0x132')];var _0x21d0b7=uuid['v4']();_0x2f8b90[_0x7c33('0x28')][_0x21d0b7]=new Action(_0x414fb2,_0x187261,_0x21d0b7);loggerBooked['info']('[booked][checkContactBlack]',_0x21d0b7,_0x7c33('0x1e7'),JSON[_0x7c33('0x73')](_0x414fb2[_0x7c33('0x132')]),_0x7c33('0x1e8'),_0x414fb2[_0x7c33('0x3c')]);if(_0x414fb2['queueStatusComplete']){_0x414fb2[_0x7c33('0x132')]=![];_0x2f8b90[_0x7c33('0x12d')][_0x2f8b90[_0x7c33('0x28')][_0x21d0b7]['queue']]=[];ami['Action']({'actionid':_0x21d0b7,'action':_0x7c33('0x1e9'),'queue':_0x414fb2['name']})[_0x7c33('0xae')](function(_0xf3947){_0x2f8b90[_0x7c33('0xb0')](_0x414fb2);_0x2f8b90['rescheduleContact']({'active':![],'ContactId':_0x2f8b90['actions'][_0x21d0b7][_0x7c33('0xcd')],'ListId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7][_0x7c33('0xce')],'VoiceQueueId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7][_0x7c33('0x11d')]||undefined,'CampaignId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7][_0x7c33('0xd0')]||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1ea')));delete _0x2f8b90[_0x7c33('0x28')][_0x21d0b7];});}else{loggerBooked['info'](_0x7c33('0x1eb'),JSON[_0x7c33('0x73')](_0x414fb2[_0x7c33('0x132')]),_0x7c33('0x1e8'),_0x414fb2[_0x7c33('0x3c')]);_0x2f8b90[_0x7c33('0xb0')](_0x414fb2);_0x2f8b90['rescheduleContact']({'active':![],'ContactId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7][_0x7c33('0xcd')],'ListId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7]['ListId'],'VoiceQueueId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7][_0x7c33('0x11d')]||undefined,'CampaignId':_0x2f8b90[_0x7c33('0x28')][_0x21d0b7]['CampaignId']||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1ea')));delete _0x2f8b90[_0x7c33('0x28')][_0x21d0b7];}}else{return _0x2f8b90[_0x7c33('0x16d')](_0x414fb2,_0x187261);}}else{if(getDiff(_0x187261[_0x7c33('0x1ec')])<_0x414fb2[_0x7c33('0x1ed')]*0x3c){if(_0x187261[_0x7c33('0x1ee')]&&!_0x187261['Agent'][_0x7c33('0x1ef')]){_0x2f8b90[_0x7c33('0x21')][_0x7c33('0x135')](_0x187261['id'])['finally'](function(){_0x2f8b90[_0x7c33('0xb0')](_0x414fb2);});}else{_0x2f8b90[_0x7c33('0xbf')]({'active':![]},_0x187261['id'],0x1)[_0x7c33('0x20')](function(){console[_0x7c33('0x1f0')](_0x7c33('0x1f1'));_0x2f8b90[_0x7c33('0xb0')](_0x414fb2);});}}else{_0x414fb2[_0x7c33('0x62')]+=0x1;_0x2f8b90[_0x7c33('0xb0')](_0x414fb2);if(_0x414fb2[_0x7c33('0x1f2')]){_0x2f8b90['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x187261[_0x7c33('0xcd')],'ListId':_0x187261[_0x7c33('0xce')],'VoiceQueueId':_0x187261[_0x7c33('0x11d')]||undefined,'CampaignId':_0x187261['CampaignId']||undefined})[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1f3')));_0x2f8b90[_0x7c33('0xc6')](createObjHistory(_0x414fb2,_0x187261,_0x7c33('0x1f4'),0x17,'RecallInQueue'))[_0x7c33('0xae')](loggerCatch(_0x7c33('0x1f5')));}else{_0x2f8b90[_0x7c33('0xcc')](createObjHistory(_0x414fb2,_0x187261,_0x7c33('0x1f6'),0x16,_0x7c33('0x1f7')),_0x7c33('0x1f8'),_0x7c33('0x1f9'));}}}}else{_0x414fb2['outboundBlacklistCallsDay']+=0x1;_0x2f8b90[_0x7c33('0xcc')](createObjHistory(_0x414fb2,_0x187261,_0x7c33('0x1fa'),0xd,_0x7c33('0x1fb')),_0x7c33('0x1fc'),_0x7c33('0x1fd'));throw _0x7c33('0x1fe');}};};Dialer[_0x7c33('0x1d')][_0x7c33('0x165')]=function(_0x48fa5f){var _0x346dfa=this;var _0x293a2c=[];var _0x2bf408=_0x48fa5f[_0x7c33('0x1ff')]-_0x48fa5f['originated']-_0x48fa5f['temp'];emitCampaignSummary(_0x48fa5f);if(_0x2bf408>0x0){if(_0x2bf408>this['maxNumberOriginate']){_0x2bf408=this[_0x7c33('0x26')];}_0x48fa5f['temp']+=_0x2bf408;this['getContactDialerIvr'](_0x48fa5f['id'],_0x2bf408,_0x48fa5f[_0x7c33('0x200')])[_0x7c33('0xb5')](function(_0x38a201){_0x48fa5f[_0x7c33('0x201')]-=_0x2bf408;_0x48fa5f[_0x7c33('0x201')]=_0x48fa5f[_0x7c33('0x201')]>0x0?_0x48fa5f[_0x7c33('0x201')]:0x0;if(!checkContactEmpty(_0x38a201)){_0x48fa5f[_0x7c33('0x3e')]=_0x7c33('0x9d');logger[_0x7c33('0x7a')]('[getContactCampaign2][Empty]'+_0x48fa5f[_0x7c33('0x3c')]);}else{_0x48fa5f[_0x7c33('0x6e')]+=_0x38a201[_0x7c33('0x138')];_0x48fa5f[_0x7c33('0x3e')]='RUNNING';for(var _0x44681c=0x0;_0x44681c<_0x38a201[_0x7c33('0x138')];_0x44681c+=0x1){_0x48fa5f[_0x7c33('0x202')]+=0x1;if(_[_0x7c33('0xda')](_0x38a201[_0x44681c])||_[_0x7c33('0xda')](_0x38a201[_0x44681c]['Contact'])||_['isNil'](_0x38a201[_0x44681c][_0x7c33('0x172')][_0x7c33('0x171')])){_0x346dfa[_0x7c33('0xca')]('[actionOriginate]\x20',_0x48fa5f,_0x38a201[_0x44681c]);}else{_0x346dfa['checkIsBlackListIvr'](_[_0x7c33('0x133')](_0x38a201[_0x44681c],['CampaignId',_0x7c33('0x203')]))[_0x7c33('0xb5')](_0x346dfa[_0x7c33('0x1e5')](_0x48fa5f,_0x38a201[_0x44681c]))[_0x7c33('0xae')](_0x346dfa[_0x7c33('0xc9')](_0x7c33('0x204'),_0x48fa5f));}}}})[_0x7c33('0xae')](loggerGetContactDialer(_0x7c33('0x205'),_0x48fa5f,_0x2bf408));}};Dialer['prototype'][_0x7c33('0x15f')]=function(_0x5605f0,_0x35d814){var _0x3f7dd6=this;var _0x4bfc4a=[];var _0x5bf8dc=_0x35d814>=0x1?_0x35d814:0x1;var _0x1146e7=[];if(_0x5605f0[_0x7c33('0x55')]===_0x7c33('0x8')){_0x5bf8dc=0x1;}var _0x29d927=Math[_0x7c33('0x1ca')](_0x5605f0[_0x7c33('0x4c')]*_0x5bf8dc)-_0x5605f0[_0x7c33('0x6e')]-_0x5605f0[_0x7c33('0x201')];emitVoiceQueueSummary(_0x5605f0);if(_0x5605f0[_0x7c33('0x206')]>0x0){var _0x50fde3=_0x5605f0[_0x7c33('0x206')]-_0x5605f0[_0x7c33('0x6e')]-_0x5605f0[_0x7c33('0x50')]-_0x5605f0['temp']-_0x5605f0[_0x7c33('0xa0')];if(_0x29d927>_0x50fde3){_0x29d927=_0x50fde3;}}if(_0x29d927>0x0){if(_0x5605f0[_0x7c33('0x55')]==='booked'){_0x29d927=0x1;}if(_0x29d927>this['maxNumberOriginate']){_0x29d927=this[_0x7c33('0x26')];}_0x5605f0[_0x7c33('0x201')]+=_0x29d927;for(var _0x28af35 in this[_0x7c33('0x24')]){if(this[_0x7c33('0x24')][_0x7c33('0x97')](_0x28af35)){if(this[_0x7c33('0x24')][_0x28af35][_0x7c33('0xe1')]==='not_inuse'&&this[_0x7c33('0x24')][_0x28af35][_0x7c33('0xd7')]==='reachable'){_0x4bfc4a[_0x7c33('0x12e')](this[_0x7c33('0x24')][_0x28af35]['id']);}}}this[_0x7c33('0xc1')](_0x5605f0['id'],_0x4bfc4a,_0x29d927,_0x5605f0[_0x7c33('0x200')])[_0x7c33('0xb5')](function(_0x438b95){_0x5605f0[_0x7c33('0x201')]-=_0x29d927;_0x5605f0['temp']=_0x5605f0[_0x7c33('0x201')]>0x0?_0x5605f0[_0x7c33('0x201')]:0x0;if(!checkContactEmpty(_0x438b95)){_0x3f7dd6[_0x7c33('0xb4')](_0x5605f0)[_0x7c33('0xb5')](sendMessageReschedule(_0x5605f0))['catch'](loggerCatch(_0x7c33('0xb6')));}else{_0x5605f0[_0x7c33('0x6e')]+=_0x438b95[_0x7c33('0x138')];_0x5605f0[_0x7c33('0x3e')]=_0x5605f0[_0x7c33('0x55')]===_0x7c33('0x8')?_0x7c33('0x177'):_0x7c33('0x207');for(var _0x2f042c=0x0;_0x2f042c<_0x438b95[_0x7c33('0x138')];_0x2f042c+=0x1){if(_[_0x7c33('0xda')](_0x438b95[_0x2f042c])||_[_0x7c33('0xda')](_0x438b95[_0x2f042c]['Contact'])||_[_0x7c33('0xda')](_0x438b95[_0x2f042c][_0x7c33('0x172')]['phone'])){_0x3f7dd6[_0x7c33('0xca')](_0x7c33('0x208'),_0x5605f0,_0x438b95[_0x2f042c]);}else{_0x3f7dd6['checkIsBlackList'](_[_0x7c33('0x133')](_0x438b95[_0x2f042c],[_0x7c33('0x11d'),_0x7c33('0x203')]))[_0x7c33('0xb5')](_0x3f7dd6[_0x7c33('0x1e5')](_0x5605f0,_0x438b95[_0x2f042c]))[_0x7c33('0xae')](_0x3f7dd6[_0x7c33('0xc9')](_0x7c33('0x208'),_0x5605f0));}}}})[_0x7c33('0xae')](loggerGetContactDialer(_0x7c33('0x209'),_0x5605f0,_0x29d927));}};Dialer[_0x7c33('0x1d')][_0x7c33('0x90')]=function(_0x387d9e){var _0x2a422f=this;if(_0x387d9e[_0x7c33('0x206')]>0x0){var _0x4a01d7=_0x387d9e['dialLimitQueue']-_0x387d9e['originated']-_0x387d9e[_0x7c33('0x50')];if(_0x4a01d7>0x0){this[_0x7c33('0x20a')](_0x387d9e);}else{loggerPredictiveCalls[_0x7c33('0x7a')](_0x7c33('0x20b'));}}else{this['tryOriginatePredictive'](_0x387d9e);}};Dialer[_0x7c33('0x1d')][_0x7c33('0x20a')]=function(_0x511dff){var _0x269104=this;var _0x7b4aab=[];_0x511dff[_0x7c33('0x6e')]+=0x1;for(var _0x355d96 in this[_0x7c33('0x24')]){if(this[_0x7c33('0x24')]['hasOwnProperty'](_0x355d96)){if(this[_0x7c33('0x24')][_0x355d96]['state']===_0x7c33('0x20c')&&this[_0x7c33('0x24')][_0x355d96][_0x7c33('0xd7')]===_0x7c33('0x20d')){_0x7b4aab[_0x7c33('0x12e')](this['agents'][_0x355d96]['id']);}}}this[_0x7c33('0xc1')](_0x511dff['id'],_0x7b4aab,0x1,_0x511dff[_0x7c33('0x200')])[_0x7c33('0xb5')](function(_0x4f1151){if(!checkContactEmpty(_0x4f1151)){checkContactLowerLimitOriginate(_0x511dff,0x1,0x0);_0x269104[_0x7c33('0xb4')](_0x511dff)[_0x7c33('0xb5')](sendMessageReschedule(_0x511dff))[_0x7c33('0xae')](loggerCatch(_0x7c33('0xb6')));}else{_0x511dff['message']=_0x7c33('0x207');if(_[_0x7c33('0xda')](_0x4f1151[0x0])||_['isNil'](_0x4f1151[0x0][_0x7c33('0x172')])||_['isNil'](_0x4f1151[0x0][_0x7c33('0x172')]['phone'])){_0x269104['emptyContact'](_0x7c33('0x208'),_0x511dff,_0x4f1151[0x0]);}else{_0x269104[_0x7c33('0xb7')](_[_0x7c33('0x133')](_0x4f1151[0x0],[_0x7c33('0x11d'),_0x7c33('0x203')]))['then'](_0x269104[_0x7c33('0x1e5')](_0x511dff,_0x4f1151[0x0]))[_0x7c33('0xae')](_0x269104['loggerHandler'](_0x7c33('0x20e'),_0x511dff));}}})[_0x7c33('0xae')](loggerGetContactDialer(_0x7c33('0x20f'),_0x511dff,0x1));emitVoiceQueueSummary(_0x511dff);};Dialer[_0x7c33('0x1d')][_0x7c33('0x1e0')]=function(_0x1e68f3,_0x5e090b,_0x194342,_0x3f986f,_0x265eb9,_0x5d3bf0){loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x210'));loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x211'),_0x1e68f3);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x212'),_0x5e090b);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x213'),_0x194342);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x214'),_0x3f986f);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x215'),_0x265eb9);loggerPredictive['info'](_0x7c33('0x81'));return new BPromise(function(_0xd4ffcb,_0x1db7dd){if(_0x1e68f3<=0x0||isNaN(_0x1e68f3)){return _0x1db7dd(msgResponse(_0x7c33('0x216'),'Error','m\x20=\x20'+_0x1e68f3));}if(_0x194342<=0x0||isNaN(_0x194342)){return _0x1db7dd(msgResponse(_0x7c33('0x216'),'Error',_0x7c33('0x217')+_0x194342));}if(_0x3f986f<=0x0||isNaN(_0x3f986f)){return _0x1db7dd(msgResponse(_0x7c33('0x216'),_0x7c33('0x19a'),_0x7c33('0x218')+_0x3f986f));}if(_0x5e090b<=0x0||isNaN(_0x5e090b)){return _0x1db7dd(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x5e090b));}if(_0x265eb9<=0x0||isNaN(_0x265eb9)){return _0x1db7dd(msgResponse(_0x7c33('0x216'),'Error',_0x7c33('0x219')+_0x265eb9));}_0x5d3bf0=_0x5d3bf0||0x0;var _0x34c376=0x1/_0x194342;var _0x336ccd=0x0;var _0x203083=0x0;var _0x1bfdad=0x0;var _0x43f131=0x0;for(var _0x4795d4=0x0;_0x1bfdad<_0x265eb9;_0x4795d4+=0x1){_0x203083=_0x4795d4/_0x5e090b;_0x336ccd=(_0x3f986f*_0x203083+_0x5d3bf0)/_0x34c376;_0x1bfdad=erlangb(_0x336ccd,_0x1e68f3);_0x43f131=_0x336ccd/_0x1e68f3*(0x1-erlangb(_0x336ccd,_0x1e68f3));}return _0xd4ffcb({'erlangCalls':_0x4795d4,'erlangCallToSecond':_0x5e090b/_0x4795d4,'erlangAbandonmentRate':_0x1bfdad,'erlangBusyFactor':_0x43f131});});};Dialer['prototype'][_0x7c33('0x1db')]=function(_0x3acddc,_0x1c973d,_0x2a2286,_0x32e558,_0x42dce2,_0x4cf807){loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x21a'));loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x211'),_0x3acddc);loggerPredictive[_0x7c33('0x7a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c973d);loggerPredictive[_0x7c33('0x7a')]('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',_0x2a2286);loggerPredictive['info'](_0x7c33('0x214'),_0x32e558);loggerPredictive[_0x7c33('0x7a')](_0x7c33('0x21b'),_0x42dce2);loggerPredictive['info'](_0x7c33('0x81'));return new BPromise(function(_0x17f793,_0x22e6a0){if(_0x3acddc<=0x0||isNaN(_0x3acddc)){return _0x22e6a0(msgResponse('[busyFactor]',_0x7c33('0x19a'),_0x7c33('0x21c')+_0x3acddc));}if(_0x2a2286<=0x0||isNaN(_0x2a2286)){return _0x22e6a0(msgResponse('[busyFactor]',_0x7c33('0x19a'),_0x7c33('0x217')+_0x2a2286));}if(_0x32e558<=0x0||isNaN(_0x32e558)){return _0x22e6a0(msgResponse(_0x7c33('0x21d'),'Error','p\x20=\x20'+_0x32e558));}if(_0x1c973d<=0x0||isNaN(_0x1c973d)){return _0x22e6a0(msgResponse('[busyFactor]',_0x7c33('0x19a'),_0x7c33('0x21e')+_0x1c973d));}if(_0x42dce2<=0x0||isNaN(_0x42dce2)){return _0x22e6a0(msgResponse('[busyFactor]',_0x7c33('0x19a'),_0x7c33('0x21f')+_0x42dce2));}_0x4cf807=_0x4cf807||0x0;var _0x4c7a4d=0x1/_0x2a2286;var _0x4218d2=0x0;var _0x4a6f05=0x0;var _0x298c78=0x0;var _0xc988a7=0x0;for(var _0xdb4fab=0x0;_0xc988a7<_0x42dce2;_0xdb4fab+=0x1){_0x4a6f05=_0xdb4fab/_0x1c973d;_0x4218d2=(_0x32e558*_0x4a6f05+_0x4cf807)/_0x4c7a4d;_0x298c78=erlangb(_0x4218d2,_0x3acddc);_0xc988a7=_0x4218d2/_0x3acddc*(0x1-erlangb(_0x4218d2,_0x3acddc));}return _0x17f793({'erlangCalls':_0xdb4fab,'erlangCallToSecond':_0x1c973d/_0xdb4fab,'erlangAbandonmentRate':_0x298c78,'erlangBusyFactor':_0xc988a7});});};module[_0x7c33('0x220')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ee66840..bb40f61 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 _0x5e78=['originatecalleridname','util','moment','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x3e9984,_0x4cbdf7){var _0x54d672=function(_0x12b842){while(--_0x12b842){_0x3e9984['push'](_0x3e9984['shift']());}};_0x54d672(++_0x4cbdf7);}(_0x5e78,0xbf));var _0x85e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e78[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x85e7('0x0'));var _=require('lodash');var moment=require(_0x85e7('0x1'));function getSeconds(_0x1d233f,_0x5144e2){var _0x226f64=moment(_0x1d233f)['milliseconds'](0x0);var _0x19fdbb=moment(_0x5144e2)['milliseconds'](0x0);return _0x226f64[_0x85e7('0x2')](_0x19fdbb,_0x85e7('0x3'));}function QueueCallerAbandon(_0x40d312,_0x36695e){this[_0x85e7('0x4')]=_0x40d312[_0x85e7('0x4')];this[_0x85e7('0x5')]=_0x40d312[_0x85e7('0x5')];this[_0x85e7('0x6')]=_0x40d312[_0x85e7('0x5')]===_0x85e7('0x7')?_0x85e7('0x8'):_0x40d312[_0x85e7('0x5')];this[_0x85e7('0x9')]=_0x40d312['countbusyretry'];this[_0x85e7('0xa')]=_0x40d312[_0x85e7('0xa')];this[_0x85e7('0xb')]=_0x40d312[_0x85e7('0xb')];this[_0x85e7('0xc')]=_0x40d312[_0x85e7('0x9')]+_0x40d312[_0x85e7('0xa')]+_0x40d312[_0x85e7('0xb')]+_0x40d312[_0x85e7('0xd')]+_0x40d312[_0x85e7('0xe')]+_0x40d312[_0x85e7('0xf')]+_0x40d312['countmachineretry']+_0x40d312[_0x85e7('0x10')];this['countnosuchnumberretry']=_0x40d312[_0x85e7('0xd')];this[_0x85e7('0xe')]=_0x40d312[_0x85e7('0xe')];this['countabandonedretry']=_0x40d312[_0x85e7('0xf')];this[_0x85e7('0x11')]=_0x40d312['countmachineretry'];this['countagentrejectretry']=_0x40d312[_0x85e7('0x10')];this[_0x85e7('0x12')]=_0x36695e[_0x85e7('0x12')];this['calleridname']=_0x40d312['name'];this['calleridnum']=_0x40d312['number'];this[_0x85e7('0x13')]=_0x40d312['starttime'];this[_0x85e7('0x14')]=_0x40d312[_0x85e7('0x14')];this['droptime']=_0x40d312[_0x85e7('0x15')];this[_0x85e7('0x16')]=this[_0x85e7('0x15')];this[_0x85e7('0x17')]=getSeconds(_0x40d312['responsetime'],_0x40d312[_0x85e7('0x13')]);this[_0x85e7('0x18')]=getSeconds(this[_0x85e7('0x15')],_0x40d312[_0x85e7('0x14')]);this[_0x85e7('0x19')]=0x0;this[_0x85e7('0x8')]=_0x36695e[_0x85e7('0x8')];this['membername']=_0x36695e[_0x85e7('0x1a')];this['reason']=_0x36695e[_0x85e7('0x1b')];this[_0x85e7('0x1c')]=_0x40d312[_0x85e7('0x1c')];this[_0x85e7('0x1d')]=_0x40d312[_0x85e7('0x1d')];this['callbackat']=_0x40d312[_0x85e7('0x1e')];this[_0x85e7('0x1f')]=_0x40d312[_0x85e7('0x1f')];this[_0x85e7('0x20')]=_0x40d312[_0x85e7('0x20')];this[_0x85e7('0x21')]=_0x40d312['ListId'];this[_0x85e7('0x22')]=_0x40d312[_0x85e7('0x22')];this['VoiceQueueId']=_0x40d312[_0x85e7('0x23')];this[_0x85e7('0x24')]=_0x40d312[_0x85e7('0x24')];this['originatecalleridnum']=_0x40d312['originatecalleridnum']||'';this[_0x85e7('0x25')]=_0x40d312[_0x85e7('0x25')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x6416=['number','starttime','responsetime','droptime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum'];(function(_0x3afb47,_0x54bee0){var _0xe566d2=function(_0x214891){while(--_0x214891){_0x3afb47['push'](_0x3afb47['shift']());}};_0xe566d2(++_0x54bee0);}(_0x6416,0x171));var _0x6641=function(_0xbd77c1,_0x50b969){_0xbd77c1=_0xbd77c1-0x0;var _0x47fa83=_0x6416[_0xbd77c1];return _0x47fa83;};'use strict';var util=require(_0x6641('0x0'));var _=require(_0x6641('0x1'));var moment=require(_0x6641('0x2'));function getSeconds(_0x147231,_0x178052){var _0x560a63=moment(_0x147231)[_0x6641('0x3')](0x0);var _0x4c9421=moment(_0x178052)[_0x6641('0x3')](0x0);return _0x560a63[_0x6641('0x4')](_0x4c9421,_0x6641('0x5'));}function QueueCallerAbandon(_0x1c8db4,_0x274b59){this[_0x6641('0x6')]=_0x1c8db4['scheduledat'];this[_0x6641('0x7')]=_0x1c8db4['type'];this['campaigntype']=_0x1c8db4[_0x6641('0x7')]===_0x6641('0x8')?_0x6641('0x9'):_0x1c8db4[_0x6641('0x7')];this[_0x6641('0xa')]=_0x1c8db4[_0x6641('0xa')];this[_0x6641('0xb')]=_0x1c8db4['countcongestionretry'];this['countnoanswerretry']=_0x1c8db4[_0x6641('0xc')];this['countglobal']=_0x1c8db4[_0x6641('0xa')]+_0x1c8db4['countcongestionretry']+_0x1c8db4['countnoanswerretry']+_0x1c8db4['countnosuchnumberretry']+_0x1c8db4[_0x6641('0xd')]+_0x1c8db4[_0x6641('0xe')]+_0x1c8db4[_0x6641('0xf')]+_0x1c8db4[_0x6641('0x10')];this[_0x6641('0x11')]=_0x1c8db4['countnosuchnumberretry'];this[_0x6641('0xd')]=_0x1c8db4[_0x6641('0xd')];this[_0x6641('0xe')]=_0x1c8db4[_0x6641('0xe')];this['countmachineretry']=_0x1c8db4[_0x6641('0xf')];this[_0x6641('0x10')]=_0x1c8db4[_0x6641('0x10')];this[_0x6641('0x12')]=_0x274b59[_0x6641('0x12')];this['calleridname']=_0x1c8db4[_0x6641('0x13')];this[_0x6641('0x14')]=_0x1c8db4[_0x6641('0x15')];this[_0x6641('0x16')]=_0x1c8db4[_0x6641('0x16')];this['responsetime']=_0x1c8db4[_0x6641('0x17')];this[_0x6641('0x18')]=_0x1c8db4[_0x6641('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x1c8db4[_0x6641('0x17')],_0x1c8db4[_0x6641('0x16')]);this['holdtime']=getSeconds(this[_0x6641('0x18')],_0x1c8db4['responsetime']);this[_0x6641('0x19')]=0x0;this[_0x6641('0x9')]=_0x274b59[_0x6641('0x9')];this[_0x6641('0x1a')]=_0x274b59[_0x6641('0x1b')];this[_0x6641('0x1c')]=_0x274b59[_0x6641('0x1c')];this[_0x6641('0x1d')]=_0x1c8db4[_0x6641('0x1d')];this[_0x6641('0x1e')]=_0x1c8db4[_0x6641('0x1e')];this['callbackat']=_0x1c8db4[_0x6641('0x1f')];this['recallme']=_0x1c8db4['recallme'];this[_0x6641('0x20')]=_0x1c8db4[_0x6641('0x20')];this[_0x6641('0x21')]=_0x1c8db4[_0x6641('0x21')];this[_0x6641('0x22')]=_0x1c8db4[_0x6641('0x22')];this['VoiceQueueId']=_0x1c8db4[_0x6641('0x23')];this[_0x6641('0x24')]=_0x1c8db4[_0x6641('0x24')];this['originatecalleridnum']=_0x1c8db4[_0x6641('0x25')]||'';this['originatecalleridname']=_0x1c8db4['originatecalleridname']||'';}module[_0x6641('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 33f72c2..6a61b8d 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 _0x2272=['path','AttachmentId','util','lodash','moment','uniqueid','format','tech','fax','localstationid','headerinfo'];(function(_0x342f14,_0x313a28){var _0x482405=function(_0x4b1aaa){while(--_0x4b1aaa){_0x342f14['push'](_0x342f14['shift']());}};_0x482405(++_0x313a28);}(_0x2272,0x136));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x2227('0x0'));var _=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));function Action(_0xdf8a79,_0x4acb17,_0x351338){this[_0x2227('0x3')]=_0xdf8a79||undefined;this['channel']=util[_0x2227('0x4')]('%s/%s/%s',_0x4acb17[_0x2227('0x5')],_0x4acb17['Trunk']['name'],_0x351338[_0x2227('0x6')]);this['localstationid']=_0x4acb17[_0x2227('0x7')];this[_0x2227('0x8')]=_0x4acb17[_0x2227('0x8')];this[_0x2227('0x9')]=_0x351338[_0x2227('0x9')];this[_0x2227('0xa')]=_0x351338[_0x2227('0xa')];}module['exports']=Action; \ No newline at end of file +var _0xa404=['moment','channel','%s/%s/%s','Trunk','name','fax','localstationid','headerinfo','path','exports','util','lodash'];(function(_0x580f74,_0x4e1022){var _0x14fc97=function(_0xf4807d){while(--_0xf4807d){_0x580f74['push'](_0x580f74['shift']());}};_0x14fc97(++_0x4e1022);}(_0xa404,0x1c6));var _0x4a40=function(_0x29549e,_0x32e837){_0x29549e=_0x29549e-0x0;var _0x3df3dd=_0xa404[_0x29549e];return _0x3df3dd;};'use strict';var util=require(_0x4a40('0x0'));var _=require(_0x4a40('0x1'));var moment=require(_0x4a40('0x2'));function Action(_0x54e969,_0x189bef,_0x40d45a){this['uniqueid']=_0x54e969||undefined;this[_0x4a40('0x3')]=util['format'](_0x4a40('0x4'),_0x189bef['tech'],_0x189bef[_0x4a40('0x5')][_0x4a40('0x6')],_0x40d45a[_0x4a40('0x7')]);this[_0x4a40('0x8')]=_0x189bef['localstationid'];this[_0x4a40('0x9')]=_0x189bef[_0x4a40('0x9')];this['path']=_0x40d45a[_0x4a40('0xa')];this['AttachmentId']=_0x40d45a['AttachmentId'];}module[_0x4a40('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index f60b99b..c758e38 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 _0xc8ed=['.pdf','application/pdf','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','syncNewExten','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse'];(function(_0x181f30,_0x59e7e0){var _0x175754=function(_0x5f0751){while(--_0x5f0751){_0x181f30['push'](_0x181f30['shift']());}};_0x175754(++_0x59e7e0);}(_0xc8ed,0x1a4));var _0xdc8e=function(_0x549a20,_0x4c58ab){_0x549a20=_0x549a20-0x0;var _0x537b8f=_0xc8ed[_0x549a20];return _0x537b8f;};'use strict';var util=require(_0xdc8e('0x0'));var _=require(_0xdc8e('0x1'));var BPromise=require(_0xdc8e('0x2'));var uuid=require(_0xdc8e('0x3'));var moment=require(_0xdc8e('0x4'));var path=require(_0xdc8e('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xdc8e('0x6'));var logger=require(_0xdc8e('0x7'))('fax');var ami=require('../ami');var rpcDb=require(_0xdc8e('0x8'));var Channel=require(_0xdc8e('0x9'));var ut=require(_0xdc8e('0xa'));var Action=require(_0xdc8e('0xb'));var faxAccount=require(_0xdc8e('0xc'));var attachment=require(_0xdc8e('0xd'));var faxMessage=require(_0xdc8e('0xe'));function Fax(_0x108cc4){this[_0xdc8e('0xf')]={};this[_0xdc8e('0x10')]=_0x108cc4[_0xdc8e('0x10')];this[_0xdc8e('0x11')]=_0x108cc4['trunks'];this[_0xdc8e('0x12')]={};ami['on'](_0xdc8e('0x13'),this[_0xdc8e('0x14')][_0xdc8e('0x15')](this));ami['on'](_0xdc8e('0x16'),this[_0xdc8e('0x17')][_0xdc8e('0x15')](this));ami['on']('newstate',this[_0xdc8e('0x18')][_0xdc8e('0x15')](this));ami['on']('newexten',this['syncNewExten'][_0xdc8e('0x15')](this));ami['on'](_0xdc8e('0x19'),this[_0xdc8e('0x1a')][_0xdc8e('0x15')](this));ami['on']('receivefax',this[_0xdc8e('0x1b')][_0xdc8e('0x15')](this));ami['on']('hangup',this[_0xdc8e('0x1c')][_0xdc8e('0x15')](this));ami['on']('originateresponse',this[_0xdc8e('0x1d')][_0xdc8e('0x15')](this));}Fax[_0xdc8e('0x1e')][_0xdc8e('0x14')]=function(_0x4c8850){if(_0x4c8850[_0xdc8e('0x1f')]===_0xdc8e('0x20')){for(var _0x58b44d in this[_0xdc8e('0x10')]){if(this[_0xdc8e('0x10')]['hasOwnProperty'](_0x58b44d)){if(_0x4c8850[_0xdc8e('0x21')]===this[_0xdc8e('0x10')][_0x58b44d][_0xdc8e('0x22')]){this[_0xdc8e('0xf')][_0x4c8850[_0xdc8e('0x23')]]={};this[_0xdc8e('0xf')][_0x4c8850[_0xdc8e('0x23')]][_0xdc8e('0x24')]=_0x4c8850[_0xdc8e('0x24')];this[_0xdc8e('0xf')][_0x4c8850[_0xdc8e('0x23')]]['id']=this[_0xdc8e('0x10')][_0x58b44d]['id'];this['channels'][_0x4c8850[_0xdc8e('0x23')]][_0xdc8e('0x25')]=this[_0xdc8e('0x10')][_0x58b44d]['name'];logger[_0xdc8e('0x26')](_0x4c8850['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0xdc8e('0x12')][_0x4c8850[_0xdc8e('0x23')]]){this[_0xdc8e('0xf')][_0x4c8850[_0xdc8e('0x23')]]={};this[_0xdc8e('0xf')][_0x4c8850[_0xdc8e('0x23')]]['channel']=_0x4c8850[_0xdc8e('0x24')];logger[_0xdc8e('0x26')](_0x4c8850['uniqueid'],_0xdc8e('0x27'));}};Fax[_0xdc8e('0x1e')][_0xdc8e('0x17')]=function(_0x21891c){if(this[_0xdc8e('0xf')][_0x21891c[_0xdc8e('0x23')]]){for(var _0x53b67f in _0x21891c['variable']){if(_0x21891c[_0xdc8e('0x28')][_0xdc8e('0x29')](_0x53b67f)){this[_0xdc8e('0xf')][_0x21891c[_0xdc8e('0x23')]][_0x53b67f]=_0x21891c['value'];}}}};Fax['prototype']['syncNewState']=function(_0x24b31e){if(this['channels'][_0x24b31e[_0xdc8e('0x23')]]){this[_0xdc8e('0xf')][_0x24b31e['uniqueid']][_0xdc8e('0x2a')]=_0x24b31e[_0xdc8e('0x2a')];this['channels'][_0x24b31e['uniqueid']][_0xdc8e('0x2b')]=_0x24b31e['channelstatedesc'];}};Fax['prototype'][_0xdc8e('0x2c')]=function(_0x3aca72){if(this[_0xdc8e('0xf')][_0x3aca72[_0xdc8e('0x23')]]){for(var _0x54d290 in _0x3aca72[_0xdc8e('0x28')]){if(_0x3aca72['variable']['hasOwnProperty'](_0x54d290)){this[_0xdc8e('0xf')][_0x3aca72[_0xdc8e('0x23')]][_0x54d290]=_0x3aca72[_0xdc8e('0x2d')];}}}};Fax['prototype'][_0xdc8e('0x1a')]=function(_0x1c1094){if(this['channels'][_0x1c1094[_0xdc8e('0x23')]]){this['channels'][_0x1c1094[_0xdc8e('0x23')]][_0xdc8e('0x2e')]=_0x1c1094[_0xdc8e('0x2e')];this[_0xdc8e('0xf')][_0x1c1094[_0xdc8e('0x23')]][_0xdc8e('0x2f')]=_0x1c1094[_0xdc8e('0x2f')];this[_0xdc8e('0xf')][_0x1c1094['uniqueid']][_0xdc8e('0x22')]=_0x1c1094['localstationid'];this[_0xdc8e('0xf')][_0x1c1094[_0xdc8e('0x23')]][_0xdc8e('0x30')]=_0x1c1094[_0xdc8e('0x30')];logger[_0xdc8e('0x26')](_0x1c1094[_0xdc8e('0x23')],_0xdc8e('0x31'));}};Fax[_0xdc8e('0x1e')][_0xdc8e('0x1b')]=function(_0x46a12d){var _0x2a9cb5=this;if(this['channels'][_0x46a12d[_0xdc8e('0x23')]]){var _0x5c8e8d=this['channels'][_0x46a12d[_0xdc8e('0x23')]]['id'];this['channels'][_0x46a12d[_0xdc8e('0x23')]][_0xdc8e('0x32')]=_0x46a12d[_0xdc8e('0x32')];this[_0xdc8e('0xf')][_0x46a12d[_0xdc8e('0x23')]][_0xdc8e('0x33')]=_0x46a12d['pagestransferred'];this[_0xdc8e('0xf')][_0x46a12d[_0xdc8e('0x23')]]['localstationid']=_0x46a12d['localstationid'];this[_0xdc8e('0xf')][_0x46a12d['uniqueid']]['resolution']=_0x46a12d[_0xdc8e('0x34')];this['channels'][_0x46a12d[_0xdc8e('0x23')]][_0xdc8e('0x35')]=_0x46a12d[_0xdc8e('0x35')];this[_0xdc8e('0xf')][_0x46a12d['uniqueid']][_0xdc8e('0x30')]=_0x46a12d[_0xdc8e('0x30')];this['channels'][_0x46a12d[_0xdc8e('0x23')]][_0xdc8e('0x36')]=_0x46a12d['calleridnum'];if(this[_0xdc8e('0xf')][_0x46a12d[_0xdc8e('0x23')]][_0xdc8e('0x33')]>0x0){tiff2pdf(_0x46a12d[_0xdc8e('0x30')],_0xdc8e('0x37'),function(_0x289f02){logger[_0xdc8e('0x26')](_0x46a12d[_0xdc8e('0x23')],_0xdc8e('0x38'),_0x289f02[_0xdc8e('0x39')]);attachment[_0xdc8e('0x3a')]({'name':path[_0xdc8e('0x3b')](_0x46a12d['filename'])[_0xdc8e('0x25')],'basename':path[_0xdc8e('0x3b')](_0x46a12d[_0xdc8e('0x30')])[_0xdc8e('0x25')]+_0xdc8e('0x3c'),'type':_0xdc8e('0x3d')})['then'](function(_0x59ce98){faxAccount[_0xdc8e('0x3e')](_0x5c8e8d,{'from':_0x46a12d[_0xdc8e('0x36')],'mapKey':_0xdc8e('0x3f'),'body':path[_0xdc8e('0x3b')](_0x46a12d[_0xdc8e('0x30')])[_0xdc8e('0x25')]+_0xdc8e('0x3c'),'AttachmentId':_0x59ce98['id']})[_0xdc8e('0x40')](function(_0x3e575e){logger[_0xdc8e('0x41')](_0x46a12d[_0xdc8e('0x23')],_0xdc8e('0x42'),JSON[_0xdc8e('0x43')](_0x3e575e));});})['catch'](function(_0x344b2f){logger[_0xdc8e('0x41')](_0x46a12d[_0xdc8e('0x23')],_0xdc8e('0x44'),JSON[_0xdc8e('0x43')](_0x344b2f));});});}logger[_0xdc8e('0x26')](_0x46a12d[_0xdc8e('0x23')],_0xdc8e('0x44'));}};Fax[_0xdc8e('0x1e')][_0xdc8e('0x1d')]=function(_0x3fb732){if(this[_0xdc8e('0x12')][_0x3fb732[_0xdc8e('0x23')]]){_[_0xdc8e('0x45')](this[_0xdc8e('0xf')][_0x3fb732[_0xdc8e('0x23')]],_[_0xdc8e('0x46')](_0x3fb732,[_0xdc8e('0x47'),_0xdc8e('0x48')]));}};function updateStatus(_0x54ecd1){if(_0x54ecd1[_0xdc8e('0x49')]){faxMessage[_0xdc8e('0x4a')](_0x54ecd1[_0xdc8e('0x49')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xdc8e('0x4b')](function(_0x202861){ut[_0xdc8e('0x4c')](_0xdc8e('0x4d'),_0x202861);})['catch'](function(_0xf83443){ut[_0xdc8e('0x4c')](_0xdc8e('0x4e'),_0xf83443);});}else{ut[_0xdc8e('0x4c')](_0xdc8e('0x4f'));}}Fax[_0xdc8e('0x1e')]['updateStatus']=function(_0x1bb707,_0x512475,_0x3766cf){var _0x17c1ae=this;var _0x48272d={};if(_0x512475){_0x48272d={'read':_0x512475};}else{_0x48272d={'failMessage':_0x3766cf};}if(this[_0xdc8e('0x12')][_0x1bb707][_0xdc8e('0x49')]){faxMessage[_0xdc8e('0x4a')](this[_0xdc8e('0x12')][_0x1bb707][_0xdc8e('0x49')],_0x48272d)['then'](function(_0xd4b26d){ut['logger'](_0xdc8e('0x50'),_0xd4b26d);})[_0xdc8e('0x40')](function(_0x4a0e0c){ut[_0xdc8e('0x4c')]('[Fax][Message][NoUpdate1]',_0x4a0e0c);})['finally'](function(){delete _0x17c1ae['channels'][_0x1bb707];delete _0x17c1ae[_0xdc8e('0x12')][_0x1bb707];});}else{ut[_0xdc8e('0x4c')](_0xdc8e('0x51'));delete this[_0xdc8e('0xf')][_0x1bb707];delete this['actions'][_0x1bb707];}};Fax[_0xdc8e('0x1e')][_0xdc8e('0x1c')]=function(_0x1f0a96){var _0x3f440e=this;if(this[_0xdc8e('0xf')][_0x1f0a96['uniqueid']]){if(this[_0xdc8e('0x12')][_0x1f0a96[_0xdc8e('0x23')]]){this['channels'][_0x1f0a96['uniqueid']]['id']=this[_0xdc8e('0x12')][_0x1f0a96[_0xdc8e('0x23')]]['id'];this[_0xdc8e('0xf')][_0x1f0a96['uniqueid']][_0xdc8e('0x25')]=this[_0xdc8e('0x12')][_0x1f0a96[_0xdc8e('0x23')]][_0xdc8e('0x25')];}logger[_0xdc8e('0x26')](_0x1f0a96[_0xdc8e('0x23')],this[_0xdc8e('0x12')][_0x1f0a96[_0xdc8e('0x23')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x1f0a96['uniqueid']]));if(this['actions'][_0x1f0a96[_0xdc8e('0x23')]]){if(this[_0xdc8e('0xf')][_0x1f0a96[_0xdc8e('0x23')]][_0xdc8e('0x52')]>0x0&&this[_0xdc8e('0xf')][_0x1f0a96['uniqueid']]['faxstatus']===_0xdc8e('0x53')){this['updateStatus'](_0x1f0a96['uniqueid'],!![]);}else{this[_0xdc8e('0x54')](_0x1f0a96['uniqueid'],![],this['channels'][_0x1f0a96['uniqueid']][_0xdc8e('0x55')]?'SENDING\x20FAILED:\x20'+this[_0xdc8e('0xf')][_0x1f0a96[_0xdc8e('0x23')]][_0xdc8e('0x55')]:_0xdc8e('0x56'));}}}};Fax[_0xdc8e('0x1e')][_0xdc8e('0x57')]=function(_0x57337d){var _0x17a777=this;return new BPromise(function(_0x2ea102,_0x52c574){_0x17a777[_0xdc8e('0x58')](_0x57337d,_0x17a777[_0xdc8e('0x10')][_0x57337d[_0xdc8e('0x59')]])[_0xdc8e('0x4b')](function(_0x2826c2){ut['logger'](_0xdc8e('0x5a'),_0x2826c2);_0x2ea102(ut[_0xdc8e('0x39')]('Fax\x20received'));})[_0xdc8e('0x40')](function(_0x3d4da7){ut[_0xdc8e('0x4c')](_0xdc8e('0x5b'),_0x3d4da7);updateStatus(_0x57337d);_0x52c574(ut[_0xdc8e('0x39')](_0xdc8e('0x5c')));});});};Fax[_0xdc8e('0x1e')][_0xdc8e('0x5d')]=function(_0x27b291){var _0x4c3b6e=this;return new BPromise(function(_0x5227c0,_0x2f4b7b){var _0x9fd684=_0x4c3b6e['checkTrunk'](_0x4c3b6e['faxAccounts'][_0x27b291[_0xdc8e('0x59')]][_0xdc8e('0x5e')],_0x27b291);if(_0x9fd684[_0xdc8e('0x5f')]){_0x5227c0(ut[_0xdc8e('0x39')](_0xdc8e('0x60')));}else{_0x2f4b7b(ut[_0xdc8e('0x39')](_0x9fd684[_0xdc8e('0x39')]));}});};function originate(_0x49ca53,_0x438df0,_0x4e480){return new BPromise(function(_0x33b71d,_0x5dedb1){if(_0x4e480){var _0x12e875=util['format'](_0xdc8e('0x61'),path[_0xdc8e('0x3b')](_0x49ca53[_0xdc8e('0x5')])[_0xdc8e('0x25')],_0x49ca53[_0xdc8e('0x5')]);gs[_0xdc8e('0x62')](_0x12e875)[_0xdc8e('0x4b')](function(){_0x49ca53[_0xdc8e('0x5')]=util[_0xdc8e('0x63')](_0xdc8e('0x64'),path[_0xdc8e('0x3b')](_0x49ca53[_0xdc8e('0x5')])[_0xdc8e('0x65')],path[_0xdc8e('0x3b')](_0x49ca53[_0xdc8e('0x5')])[_0xdc8e('0x25')]);_0x438df0[_0xdc8e('0x66')]=_0x49ca53[_0xdc8e('0x5')];ut[_0xdc8e('0x4c')]('Convert\x20pdf\x20to\x20tif','');ami[_0xdc8e('0x67')](ut[_0xdc8e('0x68')](_0x49ca53,_0x438df0))[_0xdc8e('0x4b')](function(_0x539027){_0x33b71d(_0x539027);})['catch'](function(_0x9b4cf3){_0x5dedb1(_0x9b4cf3);});})[_0xdc8e('0x40')](function(_0x252a8d){_0x5dedb1(_0x252a8d);});}else{ami[_0xdc8e('0x67')](ut['variablesAction'](_0x49ca53,_0x438df0))[_0xdc8e('0x4b')](function(_0x5b7820){_0x33b71d(_0x5b7820);})[_0xdc8e('0x40')](function(_0x20f5e0){_0x5dedb1(_0x20f5e0);});}});}Fax[_0xdc8e('0x1e')][_0xdc8e('0x58')]=function(_0x72c6e5,_0x138e94){var _0x2a2e07=this;return new BPromise(function(_0x3d42a6,_0x3ec2d5){var _0x1f954f=uuid['v4']();var _0x529744=ut['addVariables'](_0x72c6e5,_0x138e94);_0x2a2e07[_0xdc8e('0x12')][_0x1f954f]=new Action(_0x1f954f,_0x138e94,_0x72c6e5);var _0x15f1dd=_0x2a2e07[_0xdc8e('0x12')][_0x1f954f];if(path['parse'](_0x72c6e5[_0xdc8e('0x5')])[_0xdc8e('0x69')]===_0xdc8e('0x3c')){originate(_0x15f1dd,_0x529744,!![])[_0xdc8e('0x4b')](function(_0x1c2b6f){_0x3d42a6(_0x1c2b6f);})[_0xdc8e('0x40')](function(_0x3128e3){_0x3ec2d5(_0x3128e3);});}else{originate(_0x15f1dd,_0x529744,![])[_0xdc8e('0x4b')](function(_0x2eefb0){_0x3d42a6(_0x2eefb0);})[_0xdc8e('0x40')](function(_0x42ff1c){_0x3ec2d5(_0x42ff1c);});}});};Fax['prototype'][_0xdc8e('0x6a')]=function(_0x9fc6dd){return!_[_0xdc8e('0x6b')](_0x9fc6dd)&&!_[_0xdc8e('0x6b')](_0x9fc6dd[_0xdc8e('0x25')])&&!_[_0xdc8e('0x6b')](_0x9fc6dd[_0xdc8e('0x6c')])&&_0x9fc6dd['active']&&!_['isNil'](this['trunks'][util[_0xdc8e('0x63')]('SIP/%s',_0x9fc6dd['name'])])&&!_[_0xdc8e('0x6b')](this[_0xdc8e('0x11')][util['format'](_0xdc8e('0x6d'),_0x9fc6dd[_0xdc8e('0x25')])][_0xdc8e('0x2f')])&&(this[_0xdc8e('0x11')][util['format'](_0xdc8e('0x6d'),_0x9fc6dd[_0xdc8e('0x25')])][_0xdc8e('0x2f')]===_0xdc8e('0x6e')||this[_0xdc8e('0x11')][util[_0xdc8e('0x63')]('SIP/%s',_0x9fc6dd[_0xdc8e('0x25')])][_0xdc8e('0x2f')]===_0xdc8e('0x6f'));};Fax[_0xdc8e('0x1e')]['checkTrunk']=function(_0x1a832b,_0x5ed184){if(!this[_0xdc8e('0x6a')](_0x1a832b)){ut[_0xdc8e('0x4c')](_0xdc8e('0x70'),_[_0xdc8e('0x6b')](_0x1a832b)?'':_0x1a832b[_0xdc8e('0x25')]+_0xdc8e('0x71'));return{'isValid':![],'message':_0xdc8e('0x72')};}if(_['isNil'](_0x5ed184[_0xdc8e('0x3f')])){ut[_0xdc8e('0x4c')](_0xdc8e('0x73'),JSON[_0xdc8e('0x43')](_0x5ed184));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x5ed184[_0xdc8e('0x5')])){ut['logger'](_0xdc8e('0x74'),JSON[_0xdc8e('0x43')](_0x5ed184));return{'isValid':![],'message':_0xdc8e('0x75')};}return{'isValid':!![],'message':_0xdc8e('0x76')};};module[_0xdc8e('0x77')]=Fax; \ No newline at end of file +var _0xfb44=['[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','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','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','trunks','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','receivefax','syncHangup','prototype','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]'];(function(_0x44dcf4,_0x3de9ff){var _0x4c3ed8=function(_0x40d5fa){while(--_0x40d5fa){_0x44dcf4['push'](_0x44dcf4['shift']());}};_0x4c3ed8(++_0x3de9ff);}(_0xfb44,0x97));var _0x4fb4=function(_0x1064a9,_0x381d94){_0x1064a9=_0x1064a9-0x0;var _0x48f198=_0xfb44[_0x1064a9];return _0x48f198;};'use strict';var util=require(_0x4fb4('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x4fb4('0x1'));var moment=require(_0x4fb4('0x2'));var path=require(_0x4fb4('0x3'));var tiff2pdf=require(_0x4fb4('0x4'));var gs=require('./util/gs');var logger=require(_0x4fb4('0x5'))(_0x4fb4('0x6'));var ami=require(_0x4fb4('0x7'));var rpcDb=require(_0x4fb4('0x8'));var Channel=require(_0x4fb4('0x9'));var ut=require(_0x4fb4('0xa'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4fb4('0xb'));var faxMessage=require(_0x4fb4('0xc'));function Fax(_0x385094){this['channels']={};this['faxAccounts']=_0x385094['faxAccounts'];this['trunks']=_0x385094['trunks'];this[_0x4fb4('0xd')]={};ami['on'](_0x4fb4('0xe'),this[_0x4fb4('0xf')][_0x4fb4('0x10')](this));ami['on'](_0x4fb4('0x11'),this[_0x4fb4('0x12')]['bind'](this));ami['on'](_0x4fb4('0x13'),this[_0x4fb4('0x14')][_0x4fb4('0x10')](this));ami['on'](_0x4fb4('0x15'),this[_0x4fb4('0x16')][_0x4fb4('0x10')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x4fb4('0x10')](this));ami['on'](_0x4fb4('0x17'),this['syncReceiveFax'][_0x4fb4('0x10')](this));ami['on']('hangup',this[_0x4fb4('0x18')][_0x4fb4('0x10')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4fb4('0x10')](this));}Fax[_0x4fb4('0x19')][_0x4fb4('0xf')]=function(_0xaaa78){if(_0xaaa78[_0x4fb4('0x1a')]===_0x4fb4('0x1b')){for(var _0x10f0f2 in this[_0x4fb4('0x1c')]){if(this['faxAccounts'][_0x4fb4('0x1d')](_0x10f0f2)){if(_0xaaa78[_0x4fb4('0x1e')]===this[_0x4fb4('0x1c')][_0x10f0f2][_0x4fb4('0x1f')]){this[_0x4fb4('0x20')][_0xaaa78['uniqueid']]={};this[_0x4fb4('0x20')][_0xaaa78[_0x4fb4('0x21')]][_0x4fb4('0x22')]=_0xaaa78[_0x4fb4('0x22')];this[_0x4fb4('0x20')][_0xaaa78[_0x4fb4('0x21')]]['id']=this[_0x4fb4('0x1c')][_0x10f0f2]['id'];this[_0x4fb4('0x20')][_0xaaa78[_0x4fb4('0x21')]][_0x4fb4('0x23')]=this[_0x4fb4('0x1c')][_0x10f0f2]['name'];logger[_0x4fb4('0x24')](_0xaaa78['uniqueid'],_0x4fb4('0x25'));}}}}if(this[_0x4fb4('0xd')][_0xaaa78[_0x4fb4('0x21')]]){this['channels'][_0xaaa78[_0x4fb4('0x21')]]={};this[_0x4fb4('0x20')][_0xaaa78[_0x4fb4('0x21')]]['channel']=_0xaaa78['channel'];logger[_0x4fb4('0x24')](_0xaaa78[_0x4fb4('0x21')],_0x4fb4('0x25'));}};Fax[_0x4fb4('0x19')][_0x4fb4('0x12')]=function(_0x132d86){if(this['channels'][_0x132d86[_0x4fb4('0x21')]]){for(var _0x808dd8 in _0x132d86[_0x4fb4('0x26')]){if(_0x132d86[_0x4fb4('0x26')][_0x4fb4('0x1d')](_0x808dd8)){this[_0x4fb4('0x20')][_0x132d86[_0x4fb4('0x21')]][_0x808dd8]=_0x132d86[_0x4fb4('0x27')];}}}};Fax[_0x4fb4('0x19')]['syncNewState']=function(_0x2e9bae){if(this[_0x4fb4('0x20')][_0x2e9bae[_0x4fb4('0x21')]]){this['channels'][_0x2e9bae[_0x4fb4('0x21')]]['channelstate']=_0x2e9bae[_0x4fb4('0x28')];this[_0x4fb4('0x20')][_0x2e9bae['uniqueid']][_0x4fb4('0x29')]=_0x2e9bae['channelstatedesc'];}};Fax[_0x4fb4('0x19')][_0x4fb4('0x16')]=function(_0x81e92d){if(this['channels'][_0x81e92d['uniqueid']]){for(var _0x381b91 in _0x81e92d['variable']){if(_0x81e92d['variable'][_0x4fb4('0x1d')](_0x381b91)){this[_0x4fb4('0x20')][_0x81e92d['uniqueid']][_0x381b91]=_0x81e92d[_0x4fb4('0x27')];}}}};Fax[_0x4fb4('0x19')][_0x4fb4('0x2a')]=function(_0x9080eb){if(this['channels'][_0x9080eb['uniqueid']]){this[_0x4fb4('0x20')][_0x9080eb['uniqueid']]['operation']=_0x9080eb[_0x4fb4('0x2b')];this['channels'][_0x9080eb[_0x4fb4('0x21')]][_0x4fb4('0x2c')]=_0x9080eb[_0x4fb4('0x2c')];this[_0x4fb4('0x20')][_0x9080eb[_0x4fb4('0x21')]]['localstationid']=_0x9080eb['localstationid'];this[_0x4fb4('0x20')][_0x9080eb[_0x4fb4('0x21')]]['filename']=_0x9080eb[_0x4fb4('0x2d')];logger['info'](_0x9080eb[_0x4fb4('0x21')],_0x4fb4('0x2e'));}};Fax['prototype'][_0x4fb4('0x2f')]=function(_0x3ca1b6){var _0xba4b7a=this;if(this[_0x4fb4('0x20')][_0x3ca1b6['uniqueid']]){var _0x1cfa3b=this['channels'][_0x3ca1b6[_0x4fb4('0x21')]]['id'];this[_0x4fb4('0x20')][_0x3ca1b6[_0x4fb4('0x21')]][_0x4fb4('0x30')]=_0x3ca1b6[_0x4fb4('0x30')];this['channels'][_0x3ca1b6[_0x4fb4('0x21')]]['pagestransferred']=_0x3ca1b6[_0x4fb4('0x31')];this[_0x4fb4('0x20')][_0x3ca1b6['uniqueid']][_0x4fb4('0x1f')]=_0x3ca1b6[_0x4fb4('0x1f')];this[_0x4fb4('0x20')][_0x3ca1b6[_0x4fb4('0x21')]]['resolution']=_0x3ca1b6[_0x4fb4('0x32')];this[_0x4fb4('0x20')][_0x3ca1b6[_0x4fb4('0x21')]]['transferrate']=_0x3ca1b6['transferrate'];this['channels'][_0x3ca1b6[_0x4fb4('0x21')]][_0x4fb4('0x2d')]=_0x3ca1b6[_0x4fb4('0x2d')];this[_0x4fb4('0x20')][_0x3ca1b6[_0x4fb4('0x21')]]['calleridnum']=_0x3ca1b6[_0x4fb4('0x33')];if(this[_0x4fb4('0x20')][_0x3ca1b6[_0x4fb4('0x21')]][_0x4fb4('0x31')]>0x0){tiff2pdf(_0x3ca1b6['filename'],_0x4fb4('0x34'),function(_0x5b4cf6){logger['info'](_0x3ca1b6['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x5b4cf6[_0x4fb4('0x35')]);attachment[_0x4fb4('0x36')]({'name':path[_0x4fb4('0x37')](_0x3ca1b6[_0x4fb4('0x2d')])[_0x4fb4('0x23')],'basename':path[_0x4fb4('0x37')](_0x3ca1b6[_0x4fb4('0x2d')])[_0x4fb4('0x23')]+_0x4fb4('0x38'),'type':_0x4fb4('0x39')})[_0x4fb4('0x3a')](function(_0x2b0ca5){faxAccount[_0x4fb4('0x3b')](_0x1cfa3b,{'from':_0x3ca1b6[_0x4fb4('0x33')],'mapKey':_0x4fb4('0x6'),'body':path['parse'](_0x3ca1b6[_0x4fb4('0x2d')])[_0x4fb4('0x23')]+'.pdf','AttachmentId':_0x2b0ca5['id']})[_0x4fb4('0x3c')](function(_0x34fea2){logger[_0x4fb4('0x3d')](_0x3ca1b6[_0x4fb4('0x21')],'\x20notify\x20',JSON['stringify'](_0x34fea2));});})[_0x4fb4('0x3c')](function(_0x5c3fc4){logger['error'](_0x3ca1b6[_0x4fb4('0x21')],_0x4fb4('0x3e'),JSON[_0x4fb4('0x3f')](_0x5c3fc4));});});}logger[_0x4fb4('0x24')](_0x3ca1b6[_0x4fb4('0x21')],_0x4fb4('0x3e'));}};Fax[_0x4fb4('0x19')][_0x4fb4('0x40')]=function(_0x58516c){if(this[_0x4fb4('0xd')][_0x58516c[_0x4fb4('0x21')]]){_[_0x4fb4('0x41')](this[_0x4fb4('0x20')][_0x58516c[_0x4fb4('0x21')]],_[_0x4fb4('0x42')](_0x58516c,[_0x4fb4('0x43'),'reason']));}};function updateStatus(_0x5bd48){if(_0x5bd48[_0x4fb4('0x44')]){faxMessage[_0x4fb4('0x45')](_0x5bd48[_0x4fb4('0x44')],{'failMessage':_0x4fb4('0x46')})['then'](function(_0x291663){ut[_0x4fb4('0x47')]('[Fax][Message][Error][Updated]',_0x291663);})[_0x4fb4('0x3c')](function(_0x1a9e86){ut[_0x4fb4('0x47')](_0x4fb4('0x48'),_0x1a9e86);});}else{ut[_0x4fb4('0x47')](_0x4fb4('0x49'));}}Fax[_0x4fb4('0x19')][_0x4fb4('0x4a')]=function(_0x10f390,_0x51eb9c,_0x191355){var _0x36c0c2=this;var _0x2cca65={};if(_0x51eb9c){_0x2cca65={'read':_0x51eb9c};}else{_0x2cca65={'failMessage':_0x191355};}if(this[_0x4fb4('0xd')][_0x10f390][_0x4fb4('0x44')]){faxMessage[_0x4fb4('0x45')](this[_0x4fb4('0xd')][_0x10f390][_0x4fb4('0x44')],_0x2cca65)[_0x4fb4('0x3a')](function(_0x470a44){ut[_0x4fb4('0x47')](_0x4fb4('0x4b'),_0x470a44);})[_0x4fb4('0x3c')](function(_0x2eede8){ut[_0x4fb4('0x47')](_0x4fb4('0x4c'),_0x2eede8);})['finally'](function(){delete _0x36c0c2[_0x4fb4('0x20')][_0x10f390];delete _0x36c0c2[_0x4fb4('0xd')][_0x10f390];});}else{ut[_0x4fb4('0x47')](_0x4fb4('0x4d'));delete this[_0x4fb4('0x20')][_0x10f390];delete this['actions'][_0x10f390];}};Fax[_0x4fb4('0x19')][_0x4fb4('0x18')]=function(_0xb2683){var _0x2abe6e=this;if(this[_0x4fb4('0x20')][_0xb2683[_0x4fb4('0x21')]]){if(this[_0x4fb4('0xd')][_0xb2683[_0x4fb4('0x21')]]){this[_0x4fb4('0x20')][_0xb2683[_0x4fb4('0x21')]]['id']=this[_0x4fb4('0xd')][_0xb2683[_0x4fb4('0x21')]]['id'];this[_0x4fb4('0x20')][_0xb2683['uniqueid']][_0x4fb4('0x23')]=this['actions'][_0xb2683['uniqueid']][_0x4fb4('0x23')];}logger[_0x4fb4('0x24')](_0xb2683[_0x4fb4('0x21')],this[_0x4fb4('0xd')][_0xb2683['uniqueid']]?_0x4fb4('0x4e'):_0x4fb4('0x4f'),JSON['stringify'](this['channels'][_0xb2683[_0x4fb4('0x21')]]));if(this[_0x4fb4('0xd')][_0xb2683[_0x4fb4('0x21')]]){if(this[_0x4fb4('0x20')][_0xb2683[_0x4fb4('0x21')]][_0x4fb4('0x50')]>0x0&&this[_0x4fb4('0x20')][_0xb2683['uniqueid']][_0x4fb4('0x51')]==='SUCCESS'){this['updateStatus'](_0xb2683[_0x4fb4('0x21')],!![]);}else{this[_0x4fb4('0x4a')](_0xb2683[_0x4fb4('0x21')],![],this[_0x4fb4('0x20')][_0xb2683[_0x4fb4('0x21')]][_0x4fb4('0x52')]?'SENDING\x20FAILED:\x20'+this[_0x4fb4('0x20')][_0xb2683['uniqueid']][_0x4fb4('0x52')]:_0x4fb4('0x53'));}}}};Fax['prototype'][_0x4fb4('0x54')]=function(_0x5e73df){var _0x199874=this;return new BPromise(function(_0x4d3747,_0xdd2b76){_0x199874['execOriginate'](_0x5e73df,_0x199874[_0x4fb4('0x1c')][_0x5e73df['FaxAccountId']])['then'](function(_0x2fa0d1){ut[_0x4fb4('0x47')](_0x4fb4('0x55'),_0x2fa0d1);_0x4d3747(ut[_0x4fb4('0x35')]('Fax\x20received'));})[_0x4fb4('0x3c')](function(_0x361143){ut[_0x4fb4('0x47')]('[Fax][execOriginate][failure]',_0x361143);updateStatus(_0x5e73df);_0xdd2b76(ut[_0x4fb4('0x35')](_0x4fb4('0x56')));});});};Fax[_0x4fb4('0x19')][_0x4fb4('0x57')]=function(_0x2846fb){var _0x5054b8=this;return new BPromise(function(_0x4c12f2,_0x5d49c8){var _0x22020d=_0x5054b8[_0x4fb4('0x58')](_0x5054b8[_0x4fb4('0x1c')][_0x2846fb[_0x4fb4('0x59')]]['Trunk'],_0x2846fb);if(_0x22020d['isValid']){_0x4c12f2(ut[_0x4fb4('0x35')]('Trunk\x20Reachable'));}else{_0x5d49c8(ut[_0x4fb4('0x35')](_0x22020d[_0x4fb4('0x35')]));}});};function originate(_0x139744,_0x3fc5a7,_0x96a120){return new BPromise(function(_0x5a2a4c,_0x3b48d4){if(_0x96a120){var _0x4e6c88=util[_0x4fb4('0x5a')](_0x4fb4('0x5b'),path[_0x4fb4('0x37')](_0x139744[_0x4fb4('0x3')])['name'],_0x139744['path']);gs[_0x4fb4('0x5c')](_0x4e6c88)['then'](function(){_0x139744[_0x4fb4('0x3')]=util[_0x4fb4('0x5a')](_0x4fb4('0x5d'),path[_0x4fb4('0x37')](_0x139744[_0x4fb4('0x3')])[_0x4fb4('0x5e')],path[_0x4fb4('0x37')](_0x139744[_0x4fb4('0x3')])[_0x4fb4('0x23')]);_0x3fc5a7[_0x4fb4('0x5f')]=_0x139744[_0x4fb4('0x3')];ut[_0x4fb4('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x4fb4('0x60')](ut[_0x4fb4('0x61')](_0x139744,_0x3fc5a7))[_0x4fb4('0x3a')](function(_0x4b5482){_0x5a2a4c(_0x4b5482);})[_0x4fb4('0x3c')](function(_0xe579a7){_0x3b48d4(_0xe579a7);});})[_0x4fb4('0x3c')](function(_0x33795e){_0x3b48d4(_0x33795e);});}else{ami[_0x4fb4('0x60')](ut[_0x4fb4('0x61')](_0x139744,_0x3fc5a7))[_0x4fb4('0x3a')](function(_0x24900c){_0x5a2a4c(_0x24900c);})['catch'](function(_0x53fa36){_0x3b48d4(_0x53fa36);});}});}Fax[_0x4fb4('0x19')]['execOriginate']=function(_0x5542ca,_0x355f5a){var _0x2ad817=this;return new BPromise(function(_0x760d74,_0x516d7a){var _0x4497d0=uuid['v4']();var _0x2a1a25=ut['addVariables'](_0x5542ca,_0x355f5a);_0x2ad817[_0x4fb4('0xd')][_0x4497d0]=new Action(_0x4497d0,_0x355f5a,_0x5542ca);var _0x409294=_0x2ad817[_0x4fb4('0xd')][_0x4497d0];if(path[_0x4fb4('0x37')](_0x5542ca[_0x4fb4('0x3')])[_0x4fb4('0x62')]===_0x4fb4('0x38')){originate(_0x409294,_0x2a1a25,!![])[_0x4fb4('0x3a')](function(_0x1144d2){_0x760d74(_0x1144d2);})[_0x4fb4('0x3c')](function(_0x241a0c){_0x516d7a(_0x241a0c);});}else{originate(_0x409294,_0x2a1a25,![])[_0x4fb4('0x3a')](function(_0x318422){_0x760d74(_0x318422);})[_0x4fb4('0x3c')](function(_0x5c9ba0){_0x516d7a(_0x5c9ba0);});}});};Fax[_0x4fb4('0x19')][_0x4fb4('0x63')]=function(_0x3afc71){return!_[_0x4fb4('0x64')](_0x3afc71)&&!_[_0x4fb4('0x64')](_0x3afc71[_0x4fb4('0x23')])&&!_[_0x4fb4('0x64')](_0x3afc71['active'])&&_0x3afc71[_0x4fb4('0x65')]&&!_[_0x4fb4('0x64')](this['trunks'][util[_0x4fb4('0x5a')](_0x4fb4('0x66'),_0x3afc71['name'])])&&!_[_0x4fb4('0x64')](this['trunks'][util[_0x4fb4('0x5a')]('SIP/%s',_0x3afc71['name'])][_0x4fb4('0x2c')])&&(this[_0x4fb4('0x67')][util[_0x4fb4('0x5a')](_0x4fb4('0x66'),_0x3afc71['name'])][_0x4fb4('0x2c')]===_0x4fb4('0x68')||this['trunks'][util['format'](_0x4fb4('0x66'),_0x3afc71['name'])][_0x4fb4('0x2c')]==='unmonitored');};Fax[_0x4fb4('0x19')][_0x4fb4('0x58')]=function(_0x2b3fb0,_0x585c20){if(!this[_0x4fb4('0x63')](_0x2b3fb0)){ut[_0x4fb4('0x47')](_0x4fb4('0x69'),_[_0x4fb4('0x64')](_0x2b3fb0)?'':_0x2b3fb0[_0x4fb4('0x23')]+_0x4fb4('0x6a'));return{'isValid':![],'message':_0x4fb4('0x6b')};}if(_[_0x4fb4('0x64')](_0x585c20['fax'])){ut[_0x4fb4('0x47')](_0x4fb4('0x6c'),JSON[_0x4fb4('0x3f')](_0x585c20));return{'isValid':![],'message':_0x4fb4('0x6d')};}if(_[_0x4fb4('0x64')](_0x585c20['path'])){ut[_0x4fb4('0x47')](_0x4fb4('0x6e'),JSON['stringify'](_0x585c20));return{'isValid':![],'message':_0x4fb4('0x6f')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index e8b6259..ab97fd0 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 _0x1ed6=['[Notify]\x20','util','../../../config/logger','preview','error','notify','catch'];(function(_0x175f52,_0x25fab3){var _0x16e957=function(_0x4202e8){while(--_0x4202e8){_0x175f52['push'](_0x175f52['shift']());}};_0x16e957(++_0x25fab3);}(_0x1ed6,0x174));var _0x61ed=function(_0x1d6150,_0x11ece5){_0x1d6150=_0x1d6150-0x0;var _0x11d850=_0x1ed6[_0x1d6150];return _0x11d850;};'use strict';var util=require(_0x61ed('0x0'));var BPromise=require('bluebird');var logger=require(_0x61ed('0x1'))(_0x61ed('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x27c267){return function(_0xaa946b){logger[_0x61ed('0x3')](_0x27c267,util['inspect'](_0xaa946b,{'showHidden':![],'depth':null}));};}exports[_0x61ed('0x4')]=function(_0x398a9e,_0x4130cf){return BPromise['resolve']()['then'](faxAccount[_0x61ed('0x4')](_0x398a9e,_0x4130cf))[_0x61ed('0x5')](loggerCatch(_0x61ed('0x6')));}; \ No newline at end of file +var _0x4b7c=['catch','[Notify]\x20','bluebird','../../../config/logger','preview','error','inspect','notify','resolve','then'];(function(_0x3a7091,_0x590236){var _0x43d869=function(_0x3afbca){while(--_0x3afbca){_0x3a7091['push'](_0x3a7091['shift']());}};_0x43d869(++_0x590236);}(_0x4b7c,0x142));var _0xc4b7=function(_0x30f570,_0xd8f54a){_0x30f570=_0x30f570-0x0;var _0x3478ad=_0x4b7c[_0x30f570];return _0x3478ad;};'use strict';var util=require('util');var BPromise=require(_0xc4b7('0x0'));var logger=require(_0xc4b7('0x1'))(_0xc4b7('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5d51f1){return function(_0x10a942){logger[_0xc4b7('0x3')](_0x5d51f1,util[_0xc4b7('0x4')](_0x10a942,{'showHidden':![],'depth':null}));};}exports[_0xc4b7('0x5')]=function(_0x2fec69,_0x1da693){return BPromise[_0xc4b7('0x6')]()[_0xc4b7('0x7')](faxAccount[_0xc4b7('0x5')](_0x2fec69,_0x1da693))[_0xc4b7('0x8')](loggerCatch(_0xc4b7('0x9')));}; \ 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 6abf7cd..78fe516 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 _0xca87=['Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird','exec','info'];(function(_0x5282eb,_0x334de9){var _0x50c5da=function(_0xee8ec0){while(--_0xee8ec0){_0x5282eb['push'](_0x5282eb['shift']());}};_0x50c5da(++_0x334de9);}(_0xca87,0x1a2));var _0x7ca8=function(_0x163d47,_0x299557){_0x163d47=_0x163d47-0x0;var _0xb784cb=_0xca87[_0x163d47];return _0xb784cb;};'use strict';var util=require(_0x7ca8('0x0'));var logger=require(_0x7ca8('0x1'))(_0x7ca8('0x2'));var BPromise=require(_0x7ca8('0x3'));var exec=require('child_process')[_0x7ca8('0x4')];exports['execute']=function(_0x50a8e2){return new BPromise(function(_0x3965ab,_0x4b7c12){exec(_0x50a8e2,function(_0x3c1ec1,_0x22bb4f,_0x43c2a2){logger[_0x7ca8('0x5')](_0x7ca8('0x6'),_0x22bb4f);if(_0x3c1ec1){logger[_0x7ca8('0x5')]('Exec\x20gs','\x20Error\x20:',util[_0x7ca8('0x7')](_0x3c1ec1,{'showHidden':![],'depth':null}),_0x22bb4f,_0x43c2a2);_0x4b7c12(_0x3c1ec1);}_0x3965ab(_0x22bb4f);});});}; \ No newline at end of file +var _0x7dd6=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1f432f,_0x20b3a0){var _0x5b5c63=function(_0xafd89e){while(--_0xafd89e){_0x1f432f['push'](_0x1f432f['shift']());}};_0x5b5c63(++_0x20b3a0);}(_0x7dd6,0x1c9));var _0x67dd=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x7dd6[_0xb65e77];return _0x38134b;};'use strict';var util=require(_0x67dd('0x0'));var logger=require(_0x67dd('0x1'))(_0x67dd('0x2'));var BPromise=require(_0x67dd('0x3'));var exec=require(_0x67dd('0x4'))[_0x67dd('0x5')];exports[_0x67dd('0x6')]=function(_0x5966f8){return new BPromise(function(_0x1fe789,_0x2c9093){exec(_0x5966f8,function(_0x1d330f,_0x3d2c80,_0x360367){logger[_0x67dd('0x7')](_0x67dd('0x8'),_0x3d2c80);if(_0x1d330f){logger['info']('Exec\x20gs',_0x67dd('0x9'),util[_0x67dd('0xa')](_0x1d330f,{'showHidden':![],'depth':null}),_0x3d2c80,_0x360367);_0x2c9093(_0x1d330f);}_0x1fe789(_0x3d2c80);});});}; \ 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 17137ba..0273b7c 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 _0xf45e=['xcally-motion-fax','from-sip','util','moment','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel'];(function(_0x303be1,_0x11dcfc){var _0x3e0191=function(_0x2a2b1a){while(--_0x2a2b1a){_0x303be1['push'](_0x303be1['shift']());}};_0x3e0191(++_0x11dcfc);}(_0xf45e,0x115));var _0xef45=function(_0xb815e,_0x3f3236){_0xb815e=_0xb815e-0x0;var _0x403b6=_0xf45e[_0xb815e];return _0x403b6;};'use strict';var util=require(_0xef45('0x0'));var _=require('lodash');var moment=require(_0xef45('0x1'));var logger=require('../../../../config/logger')(_0xef45('0x2'));exports[_0xef45('0x3')]=function(_0x1cd055){return{'message':_0x1cd055};};exports[_0xef45('0x4')]=function(_0x37772f,_0x8b048c){logger[_0xef45('0x5')](_0x37772f,util[_0xef45('0x6')](_0x8b048c,{'showHidden':![],'depth':null}));};exports[_0xef45('0x7')]=function(_0x315b84,_0x2f2e92){var _0x3303ad={'XMF-ECM':_0x2f2e92[_0xef45('0x8')],'XMF-HEADERINFO':_0x2f2e92[_0xef45('0x9')],'XMF-MINRATE':_0x2f2e92[_0xef45('0xa')],'XMF-MAXRATE':_0x2f2e92[_0xef45('0xb')],'XMF-MODEM':util[_0xef45('0xc')](_0xef45('0xd'),_0x2f2e92[_0xef45('0xe')]),'XMF-GATEWAY':_0x2f2e92['gateway'],'XMF-FAXDETECT':_0x2f2e92[_0xef45('0xf')],'XMF-T38TIMEOUT':_0x2f2e92[_0xef45('0x10')],'XMF-LOCALSTATIONID':_0x2f2e92[_0xef45('0x11')],'XMF-PATH':_0x315b84[_0xef45('0x12')]};return _0x3303ad;};exports[_0xef45('0x13')]=function(_0x2b429f,_0x48eaf3){return{'actionid':_0x2b429f[_0xef45('0x14')],'action':_0xef45('0x15'),'channel':_0x2b429f[_0xef45('0x16')],'Exten':_0xef45('0x17'),'Context':_0xef45('0x18'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x2b429f[_0xef45('0x9')]?_0x2b429f['headerinfo']:'',_0x2b429f[_0xef45('0x11')]),'variable':_0x48eaf3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2b429f[_0xef45('0x14')]};}; \ No newline at end of file +var _0x0713=['from-sip','\x22%s\x22\x20<%s>','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate'];(function(_0x2edbe0,_0x340a07){var _0x18a6d0=function(_0xbc6a0){while(--_0xbc6a0){_0x2edbe0['push'](_0x2edbe0['shift']());}};_0x18a6d0(++_0x340a07);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3071('0x0'));var logger=require(_0x3071('0x1'))(_0x3071('0x2'));exports[_0x3071('0x3')]=function(_0x864539){return{'message':_0x864539};};exports['logger']=function(_0x2c547f,_0x7b18a4){logger[_0x3071('0x4')](_0x2c547f,util[_0x3071('0x5')](_0x7b18a4,{'showHidden':![],'depth':null}));};exports[_0x3071('0x6')]=function(_0x41cf76,_0x1d3dd6){var _0x2f1e87={'XMF-ECM':_0x1d3dd6[_0x3071('0x7')],'XMF-HEADERINFO':_0x1d3dd6[_0x3071('0x8')],'XMF-MINRATE':_0x1d3dd6[_0x3071('0x9')],'XMF-MAXRATE':_0x1d3dd6[_0x3071('0xa')],'XMF-MODEM':util[_0x3071('0xb')]('\x22%s\x22',_0x1d3dd6[_0x3071('0xc')]),'XMF-GATEWAY':_0x1d3dd6[_0x3071('0xd')],'XMF-FAXDETECT':_0x1d3dd6[_0x3071('0xe')],'XMF-T38TIMEOUT':_0x1d3dd6[_0x3071('0xf')],'XMF-LOCALSTATIONID':_0x1d3dd6[_0x3071('0x10')],'XMF-PATH':_0x41cf76['path']};return _0x2f1e87;};exports[_0x3071('0x11')]=function(_0x11a7ee,_0x401b4d){return{'actionid':_0x11a7ee[_0x3071('0x12')],'action':_0x3071('0x13'),'channel':_0x11a7ee['channel'],'Exten':'xcally-motion-fax','Context':_0x3071('0x14'),'Priority':'1','callerid':util['format'](_0x3071('0x15'),_0x11a7ee[_0x3071('0x8')]?_0x11a7ee['headerinfo']:'',_0x11a7ee[_0x3071('0x10')]),'variable':_0x401b4d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x11a7ee['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 3d537f8..4ffe03c 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 _0x95d7=['./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','./server','./report','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/sugarcrm'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x95d7,0xf0));var _0x795d=function(_0x1c03d8,_0xb20daf){_0x1c03d8=_0x1c03d8-0x0;var _0x4661a8=_0x95d7[_0x1c03d8];return _0x4661a8;};'use strict';var BPromise=require(_0x795d('0x0'));var util=require(_0x795d('0x1'));var moment=require('moment');var server=require(_0x795d('0x2'));var Realtime=require('./realtime');var Report=require(_0x795d('0x3'));var Acw=require('./acw');var Trigger=require(_0x795d('0x4'));var Dialer=require('./dialer');var Preview=require(_0x795d('0x5'));var Fax=require(_0x795d('0x6'));var user=require(_0x795d('0x7'));var voiceQueue=require(_0x795d('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x795d('0x9'));var trigger=require(_0x795d('0xa'));var template=require(_0x795d('0xb'));var cmHopperHistory=require(_0x795d('0xc'));var campaign=require(_0x795d('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x795d('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x795d('0xf'));var freshdesk=require(_0x795d('0x10'));var desk=require(_0x795d('0x11'));var zoho=require(_0x795d('0x12'));var vtiger=require(_0x795d('0x13'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x795d('0x14'));var dynamics365=require(_0x795d('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x795d('0x16')](_0x795d('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x795d('0x16')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x795d('0x18')]()['then'](user[_0x795d('0x19')]())[_0x795d('0x1a')](realtime[_0x795d('0x1b')]())[_0x795d('0x1a')](user[_0x795d('0x1c')]())[_0x795d('0x1a')](realtime['initTelephones']())[_0x795d('0x1a')](trunk['getTrunks']())[_0x795d('0x1a')](realtime[_0x795d('0x1d')]())[_0x795d('0x1a')](voiceQueue[_0x795d('0x1e')]())[_0x795d('0x1a')](realtime[_0x795d('0x1f')]())['then'](trigger[_0x795d('0x20')]())[_0x795d('0x1a')](realtime['initTriggers']())[_0x795d('0x1a')](template[_0x795d('0x21')]())[_0x795d('0x1a')](realtime[_0x795d('0x22')]())[_0x795d('0x1a')](zendesk[_0x795d('0x23')]())[_0x795d('0x1a')](realtime[_0x795d('0x24')]())[_0x795d('0x1a')](salesforce['getSalesforceAccounts']())[_0x795d('0x1a')](realtime[_0x795d('0x25')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x795d('0x1a')](realtime[_0x795d('0x26')]())[_0x795d('0x1a')](freshdesk[_0x795d('0x27')]())[_0x795d('0x1a')](realtime[_0x795d('0x28')]())[_0x795d('0x1a')](desk[_0x795d('0x29')]())[_0x795d('0x1a')](realtime[_0x795d('0x2a')]())[_0x795d('0x1a')](zoho[_0x795d('0x2b')]())[_0x795d('0x1a')](realtime[_0x795d('0x2c')]())[_0x795d('0x1a')](vtiger[_0x795d('0x2d')]())['then'](realtime[_0x795d('0x2e')]())['then'](freshsales[_0x795d('0x2f')]())[_0x795d('0x1a')](realtime['initFreshsalesAccounts']())[_0x795d('0x1a')](servicenow['getServicenowAccounts']())['then'](realtime[_0x795d('0x30')]())[_0x795d('0x1a')](dynamics365[_0x795d('0x31')]())[_0x795d('0x1a')](realtime[_0x795d('0x32')]())[_0x795d('0x1a')](campaign['getCampaigns']())['then'](realtime[_0x795d('0x33')]())['then'](voiceExtension['getVoiceExtensions']())[_0x795d('0x1a')](realtime[_0x795d('0x34')]())[_0x795d('0x1a')](faxAccount[_0x795d('0x35')]())['then'](realtime[_0x795d('0x36')]())[_0x795d('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x795d('0x18')]()[_0x795d('0x1a')](voiceQueueReport['getVoiceQueueReports']())[_0x795d('0x1a')](realtime[_0x795d('0x37')]())[_0x795d('0x1a')](cmHopperHistory[_0x795d('0x38')]())[_0x795d('0x1a')](realtime[_0x795d('0x39')]())['then'](cmHopperHistory[_0x795d('0x3a')]())[_0x795d('0x1a')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x795d('0x3b')]())['then'](realtime['initVoiceCallReports']())[_0x795d('0x1a')](function(_0x5e9657){})[_0x795d('0x3c')](function(_0x294be0){console[_0x795d('0x3d')](_0x294be0);});}function main(){return server[_0x795d('0x3e')](realtime,preview,fax)[_0x795d('0x1a')](function(_0x40dd8d){return initRealtime();})['then'](function(){return initParams();})[_0x795d('0x1a')](function(){report[_0x795d('0x3f')]();setInterval(initRealtime,0x1388);})[_0x795d('0x3c')](function(_0x5287df){console[_0x795d('0x3d')](_0x5287df);});}main(); \ No newline at end of file +var _0xbc4d=['./rpc/integrations/freshdesk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','getAgents','initAgents','then','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce'];(function(_0x349ff1,_0x37f26a){var _0x2985b0=function(_0x29c004){while(--_0x29c004){_0x349ff1['push'](_0x349ff1['shift']());}};_0x2985b0(++_0x37f26a);}(_0xbc4d,0x70));var _0xdbc4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbc4d[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0xdbc4('0x0'));var util=require(_0xdbc4('0x1'));var moment=require('moment');var server=require(_0xdbc4('0x2'));var Realtime=require(_0xdbc4('0x3'));var Report=require(_0xdbc4('0x4'));var Acw=require(_0xdbc4('0x5'));var Trigger=require(_0xdbc4('0x6'));var Dialer=require(_0xdbc4('0x7'));var Preview=require('./preview');var Fax=require(_0xdbc4('0x8'));var user=require(_0xdbc4('0x9'));var voiceQueue=require(_0xdbc4('0xa'));var voiceQueueReport=require(_0xdbc4('0xb'));var voiceCallReport=require(_0xdbc4('0xc'));var trunk=require(_0xdbc4('0xd'));var trigger=require(_0xdbc4('0xe'));var template=require(_0xdbc4('0xf'));var cmHopperHistory=require(_0xdbc4('0x10'));var campaign=require(_0xdbc4('0x11'));var voiceExtension=require(_0xdbc4('0x12'));var faxAccount=require(_0xdbc4('0x13'));var zendesk=require(_0xdbc4('0x14'));var salesforce=require(_0xdbc4('0x15'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xdbc4('0x16'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xdbc4('0x17'));var servicenow=require(_0xdbc4('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');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()[_0xdbc4('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xdbc4('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0xdbc4('0x1a')]())['then'](realtime[_0xdbc4('0x1b')]())[_0xdbc4('0x1c')](user['getTelephones']())[_0xdbc4('0x1c')](realtime['initTelephones']())[_0xdbc4('0x1c')](trunk[_0xdbc4('0x1d')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x1e')]())[_0xdbc4('0x1c')](voiceQueue[_0xdbc4('0x1f')]())[_0xdbc4('0x1c')](realtime['initVoiceQueues']())[_0xdbc4('0x1c')](trigger[_0xdbc4('0x20')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x21')]())['then'](template[_0xdbc4('0x22')]())['then'](realtime[_0xdbc4('0x23')]())[_0xdbc4('0x1c')](zendesk[_0xdbc4('0x24')]())[_0xdbc4('0x1c')](realtime['initZendeskAccounts']())['then'](salesforce[_0xdbc4('0x25')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x26')]())[_0xdbc4('0x1c')](sugarcrm[_0xdbc4('0x27')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x28')]())[_0xdbc4('0x1c')](freshdesk[_0xdbc4('0x29')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x2a')]())[_0xdbc4('0x1c')](desk['getDeskAccounts']())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x2b')]())['then'](zoho[_0xdbc4('0x2c')]())[_0xdbc4('0x1c')](realtime['initZohoAccounts']())[_0xdbc4('0x1c')](vtiger[_0xdbc4('0x2d')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x2e')]())[_0xdbc4('0x1c')](freshsales['getFreshsalesAccounts']())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x2f')]())['then'](servicenow[_0xdbc4('0x30')]())[_0xdbc4('0x1c')](realtime['initServicenowAccounts']())[_0xdbc4('0x1c')](dynamics365[_0xdbc4('0x31')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x32')]())[_0xdbc4('0x1c')](campaign[_0xdbc4('0x33')]())[_0xdbc4('0x1c')](realtime['initCampaigns']())['then'](voiceExtension[_0xdbc4('0x34')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x35')]())['then'](faxAccount[_0xdbc4('0x36')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x37')]())[_0xdbc4('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xdbc4('0x38')]()['then'](voiceQueueReport[_0xdbc4('0x39')]())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xdbc4('0x3a')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x3b')]())[_0xdbc4('0x1c')](cmHopperHistory[_0xdbc4('0x3c')]())[_0xdbc4('0x1c')](realtime[_0xdbc4('0x3d')]())[_0xdbc4('0x1c')](voiceCallReport[_0xdbc4('0x3e')]())['then'](realtime[_0xdbc4('0x3f')]())[_0xdbc4('0x1c')](function(_0x445e15){})[_0xdbc4('0x40')](function(_0x469dc8){console[_0xdbc4('0x41')](_0x469dc8);});}function main(){return server[_0xdbc4('0x42')](realtime,preview,fax)[_0xdbc4('0x1c')](function(_0x4c5ccf){return initRealtime();})['then'](function(){return initParams();})[_0xdbc4('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xdbc4('0x40')](function(_0xebaf02){console[_0xdbc4('0x41')](_0xebaf02);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f2095c0..fa2fd4c 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 _0x7238=['state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','toLowerCase','not_inuse','idle','inuse','talking','statePause','address','stringify','format','user:%s','user:save','lodash','moment','ioredis','redis','defaults','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x2ed48f,_0xdfa062){var _0x51da97=function(_0x455f34){while(--_0x455f34){_0x2ed48f['push'](_0x2ed48f['shift']());}};_0x51da97(++_0xdfa062);}(_0x7238,0x18d));var _0x8723=function(_0x569d43,_0x346aec){_0x569d43=_0x569d43-0x0;var _0x3797d5=_0x7238[_0x569d43];return _0x3797d5;};'use strict';var _=require(_0x8723('0x0'));var util=require('util');var moment=require(_0x8723('0x1'));var md5=require('md5');var Redis=require(_0x8723('0x2'));var config=require('../../../config/environment');config[_0x8723('0x3')]=_[_0x8723('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8723('0x5'))(new Redis(config[_0x8723('0x3')]));function Agent(_0x37de9a){this['id']=_0x37de9a['id']||0x0;this[_0x8723('0x6')]=_0x37de9a[_0x8723('0x6')]||'';this['email']=_0x37de9a[_0x8723('0x7')]||'';this[_0x8723('0x8')]=_0x37de9a['accountcode']||'';this[_0x8723('0x9')]=_0x37de9a[_0x8723('0x9')]||'';this[_0x8723('0xa')]=_0x8723('0xb');this[_0x8723('0xc')]=0x0;this[_0x8723('0xd')]=_0x8723('0xb');this['address']='';this[_0x8723('0xe')]='';this[_0x8723('0xf')]='';this[_0x8723('0x10')]='';this[_0x8723('0x11')]=_0x37de9a[_0x8723('0x11')]||![];this[_0x8723('0x12')]=_0x8723('0xb');this[_0x8723('0x13')]=0x0;this[_0x8723('0x14')]='';this[_0x8723('0x15')]='';this[_0x8723('0x16')]=![];this[_0x8723('0x17')]=![];this[_0x8723('0x18')]='';}Agent[_0x8723('0x19')]['updateStatusRealtime']=function(_0x357b8f){var _0x19c604;if(_0x357b8f&&_0x357b8f['state']){_0x19c604=_0x357b8f[_0x8723('0xa')][_0x8723('0x1a')]();switch(_0x19c604){case _0x8723('0x1b'):_0x19c604=_0x8723('0x1c');break;case _0x8723('0x1d'):_0x19c604=_0x8723('0x1e');break;}}if(_0x19c604&&this[_0x8723('0x12')]!==_0x19c604||_0x357b8f[_0x8723('0x1f')]){this['voiceStatusTime']=_['toNumber'](moment()['format']('x'));}if(_0x19c604){this[_0x8723('0x12')]=_0x19c604;}var _0x476479={'id':this['id'],'name':this['name'],'email':this[_0x8723('0x7')],'accountcode':this[_0x8723('0x8')],'fullname':this[_0x8723('0x9')],'state':this[_0x8723('0xa')],'stateTime':this[_0x8723('0xc')],'status':this['status'],'address':this[_0x8723('0x20')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x8723('0x13')],'voiceStatusCallerIdNumber':this[_0x8723('0x14')],'voiceStatusQueue':this[_0x8723('0x15')],'interface':this[_0x8723('0x10')],'onhold':this[_0x8723('0x16')]};var _0x28df74=md5(JSON[_0x8723('0x21')](_0x476479));if(this['md5']!==_0x28df74){this[_0x8723('0x18')]=_0x28df74;io['to'](util[_0x8723('0x22')](_0x8723('0x23'),_0x476479[_0x8723('0x6')]))['emit'](_0x8723('0x24'),_0x476479);}};module['exports']=Agent; \ No newline at end of file +var _0x7d2a=['inuse','statePause','toNumber','status','interface','format','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','unknown','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','toLowerCase'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x7d2a,0x112));var _0xa7d2=function(_0x3c2570,_0x2c95d7){_0x3c2570=_0x3c2570-0x0;var _0x445df1=_0x7d2a[_0x3c2570];return _0x445df1;};'use strict';var _=require(_0xa7d2('0x0'));var util=require(_0xa7d2('0x1'));var moment=require(_0xa7d2('0x2'));var md5=require(_0xa7d2('0x3'));var Redis=require('ioredis');var config=require(_0xa7d2('0x4'));config[_0xa7d2('0x5')]=_['defaults'](config[_0xa7d2('0x5')],{'host':_0xa7d2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa7d2('0x5')]));function Agent(_0x39200e){this['id']=_0x39200e['id']||0x0;this['name']=_0x39200e[_0xa7d2('0x7')]||'';this[_0xa7d2('0x8')]=_0x39200e['email']||'';this['accountcode']=_0x39200e[_0xa7d2('0x9')]||'';this[_0xa7d2('0xa')]=_0x39200e[_0xa7d2('0xa')]||'';this[_0xa7d2('0xb')]='unknown';this['stateTime']=0x0;this['status']=_0xa7d2('0xc');this[_0xa7d2('0xd')]='';this['phone']='';this[_0xa7d2('0xe')]='';this['interface']='';this[_0xa7d2('0xf')]=_0x39200e[_0xa7d2('0xf')]||![];this[_0xa7d2('0x10')]=_0xa7d2('0xc');this[_0xa7d2('0x11')]=0x0;this[_0xa7d2('0x12')]='';this[_0xa7d2('0x13')]='';this[_0xa7d2('0x14')]=![];this['local']=![];this[_0xa7d2('0x3')]='';}Agent[_0xa7d2('0x15')]['updateStatusRealtime']=function(_0x3c9af3){var _0x3bc380;if(_0x3c9af3&&_0x3c9af3[_0xa7d2('0xb')]){_0x3bc380=_0x3c9af3[_0xa7d2('0xb')][_0xa7d2('0x16')]();switch(_0x3bc380){case'not_inuse':_0x3bc380='idle';break;case _0xa7d2('0x17'):_0x3bc380='talking';break;}}if(_0x3bc380&&this[_0xa7d2('0x10')]!==_0x3bc380||_0x3c9af3[_0xa7d2('0x18')]){this[_0xa7d2('0x11')]=_[_0xa7d2('0x19')](moment()['format']('x'));}if(_0x3bc380){this['voiceStatus']=_0x3bc380;}var _0x3ed4b8={'id':this['id'],'name':this[_0xa7d2('0x7')],'email':this[_0xa7d2('0x8')],'accountcode':this[_0xa7d2('0x9')],'fullname':this['fullname'],'state':this[_0xa7d2('0xb')],'stateTime':this['stateTime'],'status':this[_0xa7d2('0x1a')],'address':this[_0xa7d2('0xd')],'online':this['online'],'voiceStatus':this[_0xa7d2('0x10')],'voiceStatusTime':this[_0xa7d2('0x11')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xa7d2('0x1b')],'onhold':this[_0xa7d2('0x14')]};var _0x2d44f7=md5(JSON['stringify'](_0x3ed4b8));if(this[_0xa7d2('0x3')]!==_0x2d44f7){this[_0xa7d2('0x3')]=_0x2d44f7;io['to'](util[_0xa7d2('0x1c')](_0xa7d2('0x1d'),_0x3ed4b8[_0xa7d2('0x7')]))[_0xa7d2('0x1e')](_0xa7d2('0x1f'),_0x3ed4b8);}};module[_0xa7d2('0x20')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 33ca6cd..357d8fa 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 _0xe773=['dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x36882c,_0x322593){var _0x9fc407=function(_0x159036){while(--_0x159036){_0x36882c['push'](_0x36882c['shift']());}};_0x9fc407(++_0x322593);}(_0xe773,0x19a));var _0x3e77=function(_0x131e7e,_0x26e756){_0x131e7e=_0x131e7e-0x0;var _0x4cb3a8=_0xe773[_0x131e7e];return _0x4cb3a8;};'use strict';function Campaign(_0x22ba1e){this['id']=_0x22ba1e['id']||0x0;this[_0x3e77('0x0')]=_0x22ba1e[_0x3e77('0x0')]||'';this[_0x3e77('0x1')]=_0x22ba1e['type']||_0x3e77('0x2');this[_0x3e77('0x3')]=0x0;this[_0x3e77('0x4')]=0x0;this[_0x3e77('0x5')]=0x0;this[_0x3e77('0x6')]=0x0;this['message']='';this[_0x3e77('0x7')]=!![];this[_0x3e77('0x8')]=_0x22ba1e[_0x3e77('0x8')];this[_0x3e77('0x9')]=_0x22ba1e[_0x3e77('0x9')];this[_0x3e77('0xa')]=_0x22ba1e[_0x3e77('0xa')]||null;this[_0x3e77('0xb')]=_0x22ba1e[_0x3e77('0xb')]?_0x22ba1e[_0x3e77('0xb')]:null;this[_0x3e77('0xc')]=_0x22ba1e['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x22ba1e[_0x3e77('0xd')];this[_0x3e77('0xe')]=_0x22ba1e[_0x3e77('0xe')]||0x1e;this[_0x3e77('0xf')]=_0x22ba1e[_0x3e77('0xf')];this['dialCongestionRetryFrequency']=_0x22ba1e[_0x3e77('0x10')];this['dialBusyMaxRetry']=_0x22ba1e['dialBusyMaxRetry'];this[_0x3e77('0x11')]=_0x22ba1e['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x22ba1e[_0x3e77('0x12')];this[_0x3e77('0x13')]=_0x22ba1e[_0x3e77('0x13')];this['dialGlobalMaxRetry']=_0x22ba1e[_0x3e77('0x14')];this['dialNoSuchNumberMaxRetry']=_0x22ba1e[_0x3e77('0x15')]||0x3;this[_0x3e77('0x16')]=_0x22ba1e['dialNoSuchNumberRetryFrequency']||0x96;this[_0x3e77('0x17')]=_0x22ba1e[_0x3e77('0x17')]||0x3;this[_0x3e77('0x18')]=_0x22ba1e[_0x3e77('0x18')]||0x96;this[_0x3e77('0x19')]=_0x22ba1e[_0x3e77('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x22ba1e[_0x3e77('0x1a')]||0x96;this[_0x3e77('0x1b')]=_0x22ba1e[_0x3e77('0x1b')]||0x3;this[_0x3e77('0x1c')]=_0x22ba1e['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x22ba1e[_0x3e77('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x22ba1e[_0x3e77('0x1e')]||0x96;this[_0x3e77('0x1f')]=_0x22ba1e[_0x3e77('0x1f')]||_0x3e77('0x20');this[_0x3e77('0x21')]=_0x22ba1e[_0x3e77('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x22ba1e[_0x3e77('0x22')]||undefined;this[_0x3e77('0x23')]=_0x22ba1e[_0x3e77('0x23')]||undefined;this[_0x3e77('0x24')]=_0x22ba1e[_0x3e77('0x24')]?_0x22ba1e[_0x3e77('0x24')]:undefined;this[_0x3e77('0x25')]=_0x22ba1e[_0x3e77('0x25')]?_0x22ba1e['Trunk']:undefined;this[_0x3e77('0x26')]=_0x22ba1e[_0x3e77('0x26')]?_0x22ba1e[_0x3e77('0x26')]:undefined;this[_0x3e77('0x27')]=_0x22ba1e['SquareProject']?_0x22ba1e[_0x3e77('0x27')]:undefined;this[_0x3e77('0x28')]=_0x22ba1e[_0x3e77('0x27')]?_0x22ba1e[_0x3e77('0x27')][_0x3e77('0x0')]:undefined;this[_0x3e77('0x29')]=_0x22ba1e[_0x3e77('0x29')]||![];this[_0x3e77('0x2a')]=_0x22ba1e[_0x3e77('0x2a')];this[_0x3e77('0x2b')]=_0x22ba1e[_0x3e77('0x2b')];this[_0x3e77('0x2c')]=_0x22ba1e['dialAMDAfterGreetingSilence'];this[_0x3e77('0x2d')]=_0x22ba1e[_0x3e77('0x2d')];this['dialAMDMinWordLength']=_0x22ba1e['dialAMDMinWordLength'];this[_0x3e77('0x2e')]=_0x22ba1e[_0x3e77('0x2e')];this[_0x3e77('0x2f')]=_0x22ba1e[_0x3e77('0x2f')];this['dialAMDSilenceThreshold']=_0x22ba1e[_0x3e77('0x30')];this['dialAMDMaximumWordLength']=_0x22ba1e[_0x3e77('0x31')];}module[_0x3e77('0x32')]=Campaign; \ No newline at end of file +var _0x662b=['Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x662b,0x19e));var _0xb662=function(_0x157446,_0x1669b9){_0x157446=_0x157446-0x0;var _0x5da228=_0x662b[_0x157446];return _0x5da228;};'use strict';function Campaign(_0x731d94){this['id']=_0x731d94['id']||0x0;this[_0xb662('0x0')]=_0x731d94[_0xb662('0x0')]||'';this['type']=_0x731d94[_0xb662('0x1')]||'campaign';this[_0xb662('0x2')]=0x0;this[_0xb662('0x3')]=0x0;this[_0xb662('0x4')]=0x0;this[_0xb662('0x5')]=0x0;this[_0xb662('0x6')]='';this[_0xb662('0x7')]=!![];this[_0xb662('0x8')]=_0x731d94[_0xb662('0x8')];this[_0xb662('0x9')]=_0x731d94[_0xb662('0x9')];this['dialTimezone']=_0x731d94['dialTimezone']||null;this[_0xb662('0xa')]=_0x731d94['dialGlobalInterval']?_0x731d94[_0xb662('0xa')]:null;this[_0xb662('0xb')]=_0x731d94['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x731d94[_0xb662('0xc')];this[_0xb662('0xd')]=_0x731d94[_0xb662('0xd')]||0x1e;this[_0xb662('0xe')]=_0x731d94[_0xb662('0xe')];this[_0xb662('0xf')]=_0x731d94[_0xb662('0xf')];this[_0xb662('0x10')]=_0x731d94[_0xb662('0x10')];this[_0xb662('0x11')]=_0x731d94[_0xb662('0x11')];this[_0xb662('0x12')]=_0x731d94[_0xb662('0x12')];this[_0xb662('0x13')]=_0x731d94[_0xb662('0x13')];this[_0xb662('0x14')]=_0x731d94['dialGlobalMaxRetry'];this[_0xb662('0x15')]=_0x731d94[_0xb662('0x15')]||0x3;this[_0xb662('0x16')]=_0x731d94[_0xb662('0x16')]||0x96;this[_0xb662('0x17')]=_0x731d94[_0xb662('0x17')]||0x3;this[_0xb662('0x18')]=_0x731d94[_0xb662('0x18')]||0x96;this['dialAbandonedMaxRetry']=_0x731d94[_0xb662('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x731d94['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x731d94[_0xb662('0x1a')]||0x3;this[_0xb662('0x1b')]=_0x731d94['dialMachineRetryFrequency']||0x96;this[_0xb662('0x1c')]=_0x731d94[_0xb662('0x1c')]||0x3;this[_0xb662('0x1d')]=_0x731d94['dialAgentRejectRetryFrequency']||0x96;this[_0xb662('0x1e')]=_0x731d94[_0xb662('0x1e')]||'DESC';this[_0xb662('0x1f')]=_0x731d94[_0xb662('0x1f')]||undefined;this[_0xb662('0x20')]=_0x731d94[_0xb662('0x20')]||undefined;this[_0xb662('0x21')]=_0x731d94[_0xb662('0x21')]||undefined;this[_0xb662('0x22')]=_0x731d94[_0xb662('0x22')]?_0x731d94[_0xb662('0x22')]:undefined;this[_0xb662('0x23')]=_0x731d94['Trunk']?_0x731d94[_0xb662('0x23')]:undefined;this[_0xb662('0x24')]=_0x731d94[_0xb662('0x24')]?_0x731d94[_0xb662('0x24')]:undefined;this[_0xb662('0x25')]=_0x731d94[_0xb662('0x25')]?_0x731d94[_0xb662('0x25')]:undefined;this[_0xb662('0x26')]=_0x731d94[_0xb662('0x25')]?_0x731d94[_0xb662('0x25')][_0xb662('0x0')]:undefined;this[_0xb662('0x27')]=_0x731d94[_0xb662('0x27')]||![];this[_0xb662('0x28')]=_0x731d94[_0xb662('0x28')];this[_0xb662('0x29')]=_0x731d94[_0xb662('0x29')];this['dialAMDAfterGreetingSilence']=_0x731d94[_0xb662('0x2a')];this[_0xb662('0x2b')]=_0x731d94[_0xb662('0x2b')];this[_0xb662('0x2c')]=_0x731d94['dialAMDMinWordLength'];this[_0xb662('0x2d')]=_0x731d94['dialAMDBetweenWordsSilence'];this[_0xb662('0x2e')]=_0x731d94[_0xb662('0x2e')];this[_0xb662('0x2f')]=_0x731d94[_0xb662('0x2f')];this[_0xb662('0x30')]=_0x731d94['dialAMDMaximumWordLength'];}module[_0xb662('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index ded7fe2..6f1b47d 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 _0xda2d=['tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime'];(function(_0x592c14,_0x34cf86){var _0x1cc2eb=function(_0x28b4ec){while(--_0x28b4ec){_0x592c14['push'](_0x592c14['shift']());}};_0x1cc2eb(++_0x34cf86);}(_0xda2d,0x102));var _0xdda2=function(_0xf7e318,_0x2ee4a3){_0xf7e318=_0xf7e318-0x0;var _0x277989=_0xda2d[_0xf7e318];return _0x277989;};'use strict';function Channel(){this['starttime']=null;this[_0xdda2('0x0')]='';this[_0xdda2('0x1')]='';this[_0xdda2('0x2')]=0x0;this[_0xdda2('0x3')]='';this[_0xdda2('0x4')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this['context']='';this[_0xdda2('0x5')]=0x0;this[_0xdda2('0x6')]=0x0;this[_0xdda2('0x7')]=0x0;this[_0xdda2('0x8')]=![];this[_0xdda2('0x9')]=null;this[_0xdda2('0xa')]=null;this[_0xdda2('0xb')]=![];this[_0xdda2('0xc')]=![];this[_0xdda2('0xd')]='';this[_0xdda2('0xe')]='';this['duration']=0x0;this[_0xdda2('0xf')]=0x0;this[_0xdda2('0x10')]=0x0;this['type']=null;this[_0xdda2('0x11')]=null;this[_0xdda2('0x12')]=null;this[_0xdda2('0x13')]=![];this[_0xdda2('0x14')]=null;this[_0xdda2('0x15')]=null;this[_0xdda2('0x16')]=[];this[_0xdda2('0x17')]=undefined;this[_0xdda2('0x18')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xf108=['calleridname','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','destinationchannel','calleridnum'];(function(_0xf51edd,_0x194dac){var _0x28800b=function(_0x1ecfd6){while(--_0x1ecfd6){_0xf51edd['push'](_0xf51edd['shift']());}};_0x28800b(++_0x194dac);}(_0xf108,0x1d9));var _0x8f10=function(_0x328578,_0x3cade2){_0x328578=_0x328578-0x0;var _0x4d3e5d=_0xf108[_0x328578];return _0x4d3e5d;};'use strict';function Channel(){this[_0x8f10('0x0')]=null;this['channel']='';this[_0x8f10('0x1')]='';this[_0x8f10('0x2')]=0x0;this[_0x8f10('0x3')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x8f10('0x4')]='';this[_0x8f10('0x5')]=0x0;this[_0x8f10('0x6')]=0x0;this[_0x8f10('0x7')]=0x0;this[_0x8f10('0x8')]=![];this[_0x8f10('0x9')]=null;this[_0x8f10('0xa')]=null;this[_0x8f10('0xb')]=![];this[_0x8f10('0xc')]=![];this[_0x8f10('0xd')]='';this[_0x8f10('0xe')]='';this['duration']=0x0;this[_0x8f10('0xf')]=0x0;this[_0x8f10('0x10')]=0x0;this[_0x8f10('0x11')]=null;this[_0x8f10('0x12')]=null;this[_0x8f10('0x13')]=null;this[_0x8f10('0x14')]=![];this[_0x8f10('0x15')]=null;this[_0x8f10('0x16')]=null;this[_0x8f10('0x17')]=[];this[_0x8f10('0x18')]=undefined;this[_0x8f10('0x19')]=undefined;this[_0x8f10('0x1a')]=0x0;}module[_0x8f10('0x1b')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d536c80..e0b3d68 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 _0x0faf=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x177f87,_0x5799d3){var _0x2dadb4=function(_0x162293){while(--_0x162293){_0x177f87['push'](_0x177f87['shift']());}};_0x2dadb4(++_0x5799d3);}(_0x0faf,0x132));var _0xf0fa=function(_0x9ac89b,_0x25b61d){_0x9ac89b=_0x9ac89b-0x0;var _0x40da74=_0x0faf[_0x9ac89b];return _0x40da74;};'use strict';function DeskAccount(_0x9ed8b6){this['id']=_0x9ed8b6['id']||0x0;this['name']=_0x9ed8b6[_0xf0fa('0x0')]||'';this[_0xf0fa('0x1')]=_0x9ed8b6[_0xf0fa('0x1')]||'';this[_0xf0fa('0x2')]=_0x9ed8b6[_0xf0fa('0x2')]||'';this[_0xf0fa('0x3')]=_0x9ed8b6[_0xf0fa('0x3')]||'';this[_0xf0fa('0x4')]=_0x9ed8b6[_0xf0fa('0x4')]||'';this['consumerKey']=_0x9ed8b6[_0xf0fa('0x5')]||'';this[_0xf0fa('0x6')]=_0x9ed8b6[_0xf0fa('0x6')]||'';this[_0xf0fa('0x7')]=_0x9ed8b6[_0xf0fa('0x7')]||'';this['tokenSecret']=_0x9ed8b6[_0xf0fa('0x8')]||'';this[_0xf0fa('0x9')]=_0x9ed8b6['type']||'';this['serverUrl']=_0x9ed8b6[_0xf0fa('0xa')]||'';this[_0xf0fa('0xb')]=_0x9ed8b6[_0xf0fa('0xb')]||{};}module[_0xf0fa('0xc')]=DeskAccount; \ No newline at end of file +var _0x482d=['type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x482d,0x16c));var _0xd482=function(_0x42163c,_0x2f19b5){_0x42163c=_0x42163c-0x0;var _0x4660bd=_0x482d[_0x42163c];return _0x4660bd;};'use strict';function DeskAccount(_0x15d935){this['id']=_0x15d935['id']||0x0;this['name']=_0x15d935[_0xd482('0x0')]||'';this[_0xd482('0x1')]=_0x15d935[_0xd482('0x1')]||'';this[_0xd482('0x2')]=_0x15d935[_0xd482('0x2')]||'';this[_0xd482('0x3')]=_0x15d935['authType']||'';this[_0xd482('0x4')]=_0x15d935[_0xd482('0x4')]||'';this[_0xd482('0x5')]=_0x15d935['consumerKey']||'';this[_0xd482('0x6')]=_0x15d935['consumerSecret']||'';this['token']=_0x15d935['token']||'';this[_0xd482('0x7')]=_0x15d935[_0xd482('0x7')]||'';this[_0xd482('0x8')]=_0x15d935['type']||'';this[_0xd482('0x9')]=_0x15d935[_0xd482('0x9')]||'';this[_0xd482('0xa')]=_0x15d935[_0xd482('0xa')]||{};}module[_0xd482('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 9e9faba..b11aec5 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 _0x9cb3=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x9cb3,0xb0));var _0x39cb=function(_0x57b3df,_0x445081){_0x57b3df=_0x57b3df-0x0;var _0x206656=_0x9cb3[_0x57b3df];return _0x206656;};'use strict';function Dynamics365Account(_0x42af8f){this['id']=_0x42af8f['id']||0x0;this[_0x39cb('0x0')]=_0x42af8f[_0x39cb('0x0')]||'';this[_0x39cb('0x1')]=_0x42af8f[_0x39cb('0x1')]||'';this['password']=_0x42af8f[_0x39cb('0x2')]||'';this[_0x39cb('0x3')]=_0x42af8f[_0x39cb('0x3')]||'';this[_0x39cb('0x4')]=_0x42af8f['tenantId']||'';this['clientId']=_0x42af8f[_0x39cb('0x5')]||'';this[_0x39cb('0x6')]=_0x42af8f[_0x39cb('0x6')]||{};this[_0x39cb('0x7')]=_0x42af8f[_0x39cb('0x7')]||'';this[_0x39cb('0x8')]=_0x42af8f[_0x39cb('0x8')]||{};}module[_0x39cb('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xc991=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x521eac,_0x5f267b){var _0x519363=function(_0x4c600d){while(--_0x4c600d){_0x521eac['push'](_0x521eac['shift']());}};_0x519363(++_0x5f267b);}(_0xc991,0xa3));var _0x1c99=function(_0x1baf8f,_0x200231){_0x1baf8f=_0x1baf8f-0x0;var _0x39dc42=_0xc991[_0x1baf8f];return _0x39dc42;};'use strict';function Dynamics365Account(_0x170b61){this['id']=_0x170b61['id']||0x0;this[_0x1c99('0x0')]=_0x170b61[_0x1c99('0x0')]||'';this[_0x1c99('0x1')]=_0x170b61[_0x1c99('0x1')]||'';this['password']=_0x170b61[_0x1c99('0x2')]||'';this[_0x1c99('0x3')]=_0x170b61['remoteUri']||'';this['tenantId']=_0x170b61[_0x1c99('0x4')]||'';this[_0x1c99('0x5')]=_0x170b61[_0x1c99('0x5')]||'';this['clientSecret']=_0x170b61[_0x1c99('0x6')]||{};this[_0x1c99('0x7')]=_0x170b61[_0x1c99('0x7')]||'';this[_0x1c99('0x8')]=_0x170b61[_0x1c99('0x8')]||{};}module[_0x1c99('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 8dea018..3fede7a 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 _0x3759=['exports','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP','Trunk','ListId','key'];(function(_0xb5145f,_0x20796a){var _0xf49fa8=function(_0x634974){while(--_0x634974){_0xb5145f['push'](_0xb5145f['shift']());}};_0xf49fa8(++_0x20796a);}(_0x3759,0x131));var _0x9375=function(_0xcc3d76,_0x1e943d){_0xcc3d76=_0xcc3d76-0x0;var _0x4da2a5=_0x3759[_0xcc3d76];return _0x4da2a5;};'use strict';function FaxAccount(_0x4e25c8){this['id']=_0x4e25c8['id']||0x0;this[_0x9375('0x0')]=_0x4e25c8[_0x9375('0x0')]||'';this[_0x9375('0x1')]=_0x4e25c8[_0x9375('0x1')];this['ecm']=_0x4e25c8['ecm'];this[_0x9375('0x2')]=_0x4e25c8[_0x9375('0x2')];this['localstationid']=_0x4e25c8[_0x9375('0x3')];this[_0x9375('0x4')]=_0x4e25c8['minrate']||0x960;this[_0x9375('0x5')]=_0x4e25c8[_0x9375('0x5')]||0x3840;this[_0x9375('0x6')]=_0x4e25c8[_0x9375('0x6')]||_0x9375('0x7');this[_0x9375('0x8')]=_0x4e25c8[_0x9375('0x8')]||'no';this[_0x9375('0x9')]=_0x4e25c8['faxdetect']||'no';this['t38timeout']=_0x4e25c8['t38timeout']||0x1388;this[_0x9375('0xa')]=_0x4e25c8[_0x9375('0xa')]||_0x9375('0xb');this['Trunk']=_0x4e25c8[_0x9375('0xc')]?_0x4e25c8[_0x9375('0xc')]:undefined;this[_0x9375('0xd')]=_0x4e25c8[_0x9375('0xd')];this['key']=_0x4e25c8[_0x9375('0xe')];}module[_0x9375('0xf')]=FaxAccount; \ No newline at end of file +var _0x130d=['SIP','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x351dcb,_0x3d1108){var _0x246b4f=function(_0xa3984a){while(--_0xa3984a){_0x351dcb['push'](_0x351dcb['shift']());}};_0x246b4f(++_0x3d1108);}(_0x130d,0x19d));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x57874c){this['id']=_0x57874c['id']||0x0;this[_0xd130('0x0')]=_0x57874c[_0xd130('0x0')]||'';this['description']=_0x57874c['description'];this[_0xd130('0x1')]=_0x57874c[_0xd130('0x1')];this[_0xd130('0x2')]=_0x57874c[_0xd130('0x2')];this[_0xd130('0x3')]=_0x57874c[_0xd130('0x3')];this[_0xd130('0x4')]=_0x57874c[_0xd130('0x4')]||0x960;this['maxrate']=_0x57874c[_0xd130('0x5')]||0x3840;this[_0xd130('0x6')]=_0x57874c['modem']||_0xd130('0x7');this['gateway']=_0x57874c[_0xd130('0x8')]||'no';this[_0xd130('0x9')]=_0x57874c[_0xd130('0x9')]||'no';this['t38timeout']=_0x57874c[_0xd130('0xa')]||0x1388;this['tech']=_0x57874c[_0xd130('0xb')]||_0xd130('0xc');this[_0xd130('0xd')]=_0x57874c['Trunk']?_0x57874c[_0xd130('0xd')]:undefined;this[_0xd130('0xe')]=_0x57874c[_0xd130('0xe')];this[_0xd130('0xf')]=_0x57874c[_0xd130('0xf')];}module[_0xd130('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index eab02f7..ebacff6 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 _0x7e32=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e32,0x175));var _0x27e3=function(_0x3a31c3,_0x4b2e4d){_0x3a31c3=_0x3a31c3-0x0;var _0x1ec91b=_0x7e32[_0x3a31c3];return _0x1ec91b;};'use strict';function FreshdeskAccount(_0xd89c69){this['id']=_0xd89c69['id']||0x0;this[_0x27e3('0x0')]=_0xd89c69[_0x27e3('0x0')]||'';this[_0x27e3('0x1')]=_0xd89c69[_0x27e3('0x1')]||'';this[_0x27e3('0x2')]=_0xd89c69[_0x27e3('0x3')]||'';this[_0x27e3('0x4')]=_0xd89c69[_0x27e3('0x4')]||'';this[_0x27e3('0x5')]=_0xd89c69[_0x27e3('0x5')]||'';this[_0x27e3('0x6')]=_0xd89c69[_0x27e3('0x6')]||{};}module[_0x27e3('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x6a4b=['username','apiKey','token','remoteUri','Configurations','exports','name'];(function(_0x28bed8,_0x128876){var _0x36aac2=function(_0x1e76aa){while(--_0x1e76aa){_0x28bed8['push'](_0x28bed8['shift']());}};_0x36aac2(++_0x128876);}(_0x6a4b,0x133));var _0xb6a4=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6a4b[_0x565ed7];return _0x183ad7;};'use strict';function FreshdeskAccount(_0x4f26e0){this['id']=_0x4f26e0['id']||0x0;this[_0xb6a4('0x0')]=_0x4f26e0[_0xb6a4('0x0')]||'';this[_0xb6a4('0x1')]=_0x4f26e0[_0xb6a4('0x1')]||'';this[_0xb6a4('0x2')]=_0x4f26e0[_0xb6a4('0x3')]||'';this[_0xb6a4('0x4')]=_0x4f26e0[_0xb6a4('0x4')]||'';this['serverUrl']=_0x4f26e0['serverUrl']||'';this[_0xb6a4('0x5')]=_0x4f26e0[_0xb6a4('0x5')]||{};}module[_0xb6a4('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 27ccbd4..7fef408 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 _0x9506=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0xb6ddbd,_0x17187f){var _0x17727=function(_0x918fd3){while(--_0x918fd3){_0xb6ddbd['push'](_0xb6ddbd['shift']());}};_0x17727(++_0x17187f);}(_0x9506,0xa9));var _0x6950=function(_0x313659,_0x2fc55){_0x313659=_0x313659-0x0;var _0x4023e5=_0x9506[_0x313659];return _0x4023e5;};'use strict';function FreshsalesAccount(_0xf3ebe3){this['id']=_0xf3ebe3['id']||0x0;this[_0x6950('0x0')]=_0xf3ebe3[_0x6950('0x0')]||'';this[_0x6950('0x1')]=_0xf3ebe3[_0x6950('0x1')]||'';this[_0x6950('0x2')]=_0xf3ebe3[_0x6950('0x3')]||'';this[_0x6950('0x4')]=_0xf3ebe3[_0x6950('0x4')]||'';this[_0x6950('0x5')]=_0xf3ebe3[_0x6950('0x5')]||'';this[_0x6950('0x6')]=_0xf3ebe3['Configurations']||{};}module[_0x6950('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xaa10=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaa10,0x107));var _0x0aa1=function(_0x3e039b,_0x422665){_0x3e039b=_0x3e039b-0x0;var _0x3210be=_0xaa10[_0x3e039b];return _0x3210be;};'use strict';function FreshsalesAccount(_0x43bb21){this['id']=_0x43bb21['id']||0x0;this[_0x0aa1('0x0')]=_0x43bb21[_0x0aa1('0x0')]||'';this[_0x0aa1('0x1')]=_0x43bb21[_0x0aa1('0x1')]||'';this[_0x0aa1('0x2')]=_0x43bb21[_0x0aa1('0x3')]||'';this['remoteUri']=_0x43bb21[_0x0aa1('0x4')]||'';this[_0x0aa1('0x5')]=_0x43bb21[_0x0aa1('0x5')]||'';this[_0x0aa1('0x6')]=_0x43bb21['Configurations']||{};}module[_0x0aa1('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 707785c..6e360a8 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 _0x1bfa=['queuecallerexit','originalposition','connectedlinenum','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete'];(function(_0x3bbd6b,_0x498df1){var _0x1d27fc=function(_0x2d7be7){while(--_0x2d7be7){_0x3bbd6b['push'](_0x3bbd6b['shift']());}};_0x1d27fc(++_0x498df1);}(_0x1bfa,0x1c2));var _0xa1bf=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1bfa[_0x55e08b];return _0xd1a7ff;};'use strict';function QueueReport(){this[_0xa1bf('0x0')]='inbound';this[_0xa1bf('0x1')]='';this['calleridnum']='';this[_0xa1bf('0x2')]='';this[_0xa1bf('0x3')]='';this[_0xa1bf('0x4')]=null;this[_0xa1bf('0x5')]=null;this[_0xa1bf('0x6')]=0x1;this[_0xa1bf('0x7')]=0x1;this[_0xa1bf('0x8')]=![];this['queuecallerabandonAt']=null;this[_0xa1bf('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xa1bf('0xa')]=![];this['queuecallerexitAt']=null;this[_0xa1bf('0xb')]=0x1;this['channel']='';this[_0xa1bf('0xc')]='';this[_0xa1bf('0xd')]='';this['accountcode']='';this[_0xa1bf('0xe')]='';this[_0xa1bf('0xf')]='';this[_0xa1bf('0x10')]='';this[_0xa1bf('0x11')]=0x0;this[_0xa1bf('0x12')]=![];this[_0xa1bf('0x13')]='';this[_0xa1bf('0x14')]=0x0;this[_0xa1bf('0x15')]={};}module[_0xa1bf('0x16')]=QueueReport; \ No newline at end of file +var _0x0065=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queuecallerleaveAt','position','count'];(function(_0x3a29d2,_0x14baf5){var _0x5bfeeb=function(_0x1fd310){while(--_0x1fd310){_0x3a29d2['push'](_0x3a29d2['shift']());}};_0x5bfeeb(++_0x14baf5);}(_0x0065,0x7b));var _0x5006=function(_0x1760e9,_0xbbfd0b){_0x1760e9=_0x1760e9-0x0;var _0x3fe586=_0x0065[_0x1760e9];return _0x3fe586;};'use strict';function QueueReport(){this['type']=_0x5006('0x0');this[_0x5006('0x1')]='';this[_0x5006('0x2')]='';this[_0x5006('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x5006('0x4')]=null;this[_0x5006('0x5')]=0x1;this[_0x5006('0x6')]=0x1;this[_0x5006('0x7')]=![];this[_0x5006('0x8')]=null;this[_0x5006('0x9')]=![];this[_0x5006('0xa')]=null;this[_0x5006('0xb')]=![];this[_0x5006('0xc')]=null;this[_0x5006('0xd')]=0x1;this[_0x5006('0xe')]='';this[_0x5006('0xf')]='';this[_0x5006('0x10')]='';this[_0x5006('0x11')]='';this[_0x5006('0x12')]='';this[_0x5006('0x13')]='';this[_0x5006('0x14')]='';this[_0x5006('0x15')]=0x0;this[_0x5006('0x16')]=![];this['lastAssignedTo']='';this[_0x5006('0x17')]=0x0;this[_0x5006('0x18')]={};}module[_0x5006('0x19')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c6b9e38..7ac4026 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 _0x517b=['integrationTab','serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','securityToken','type'];(function(_0x1a136b,_0x159444){var _0xcb20cc=function(_0x1974a4){while(--_0x1974a4){_0x1a136b['push'](_0x1a136b['shift']());}};_0xcb20cc(++_0x159444);}(_0x517b,0x88));var _0xb517=function(_0x5ce936,_0x4c5ce1){_0x5ce936=_0x5ce936-0x0;var _0x36fff0=_0x517b[_0x5ce936];return _0x36fff0;};'use strict';function SalesforceAccount(_0x3016df){this['id']=_0x3016df['id']||0x0;this[_0xb517('0x0')]=_0x3016df[_0xb517('0x0')]||'';this[_0xb517('0x1')]=_0x3016df[_0xb517('0x1')]||'';this['remoteUri']=_0x3016df['remoteUri']||'';this['password']=_0x3016df[_0xb517('0x2')]||'';this[_0xb517('0x3')]=_0x3016df[_0xb517('0x3')]||'';this[_0xb517('0x4')]=_0x3016df['clientSecret']||'';this[_0xb517('0x5')]=_0x3016df[_0xb517('0x5')]||'';this[_0xb517('0x6')]=_0x3016df[_0xb517('0x6')]||_0xb517('0x7');this[_0xb517('0x8')]=_0x3016df[_0xb517('0x8')]||'';this['Configurations']=_0x3016df[_0xb517('0x9')]||{};}module[_0xb517('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xcd43=['securityToken','type','serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xcd43,0x181));var _0x3cd4=function(_0xf27a6d,_0x46bff2){_0xf27a6d=_0xf27a6d-0x0;var _0x25961f=_0xcd43[_0xf27a6d];return _0x25961f;};'use strict';function SalesforceAccount(_0xa5fc10){this['id']=_0xa5fc10['id']||0x0;this['name']=_0xa5fc10['name']||'';this[_0x3cd4('0x0')]=_0xa5fc10[_0x3cd4('0x0')]||'';this[_0x3cd4('0x1')]=_0xa5fc10['remoteUri']||'';this[_0x3cd4('0x2')]=_0xa5fc10[_0x3cd4('0x2')]||'';this[_0x3cd4('0x3')]=_0xa5fc10[_0x3cd4('0x3')]||'';this[_0x3cd4('0x4')]=_0xa5fc10['clientSecret']||'';this[_0x3cd4('0x5')]=_0xa5fc10[_0x3cd4('0x5')]||'';this['type']=_0xa5fc10[_0x3cd4('0x6')]||'integrationTab';this[_0x3cd4('0x7')]=_0xa5fc10[_0x3cd4('0x7')]||'';this[_0x3cd4('0x8')]=_0xa5fc10[_0x3cd4('0x8')]||{};}module[_0x3cd4('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 1cbd1aa..02bbdb3 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 _0x5494=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x2882c1,_0x13c1fb){var _0x476c10=function(_0x487742){while(--_0x487742){_0x2882c1['push'](_0x2882c1['shift']());}};_0x476c10(++_0x13c1fb);}(_0x5494,0x191));var _0x4549=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x5494[_0x545fe3];return _0x480702;};'use strict';function ServicenowAccount(_0x158a43){this['id']=_0x158a43['id']||0x0;this['name']=_0x158a43[_0x4549('0x0')]||'';this[_0x4549('0x1')]=_0x158a43[_0x4549('0x1')]||'';this[_0x4549('0x2')]=_0x158a43['password']||'';this[_0x4549('0x3')]=_0x158a43['remoteUri']||'';this[_0x4549('0x4')]=_0x158a43['serverUrl']||'';this[_0x4549('0x5')]=_0x158a43[_0x4549('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x64d4=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x64d4,0x94));var _0x464d=function(_0xca44f,_0x3a01af){_0xca44f=_0xca44f-0x0;var _0x17ee70=_0x64d4[_0xca44f];return _0x17ee70;};'use strict';function ServicenowAccount(_0x4581ed){this['id']=_0x4581ed['id']||0x0;this[_0x464d('0x0')]=_0x4581ed[_0x464d('0x0')]||'';this['username']=_0x4581ed['username']||'';this[_0x464d('0x1')]=_0x4581ed[_0x464d('0x1')]||'';this[_0x464d('0x2')]=_0x4581ed[_0x464d('0x2')]||'';this[_0x464d('0x3')]=_0x4581ed[_0x464d('0x3')]||'';this[_0x464d('0x4')]=_0x4581ed[_0x464d('0x4')]||{};}module[_0x464d('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 7e06d5b..c0774c5 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 _0xec2f=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x3bba4c,_0x1554b5){var _0xb90a9a=function(_0x271abe){while(--_0x271abe){_0x3bba4c['push'](_0x3bba4c['shift']());}};_0xb90a9a(++_0x1554b5);}(_0xec2f,0xe3));var _0xfec2=function(_0x3fadd1,_0x289fee){_0x3fadd1=_0x3fadd1-0x0;var _0x22cb57=_0xec2f[_0x3fadd1];return _0x22cb57;};'use strict';function SugarcrmAccount(_0x3b64e7){this['id']=_0x3b64e7['id']||0x0;this[_0xfec2('0x0')]=_0x3b64e7['name']||'';this[_0xfec2('0x1')]=_0x3b64e7[_0xfec2('0x1')]||'';this[_0xfec2('0x2')]=_0x3b64e7['password']||'';this['remoteUri']=_0x3b64e7[_0xfec2('0x3')]||'';this[_0xfec2('0x4')]=_0x3b64e7[_0xfec2('0x4')]||'';this[_0xfec2('0x5')]=_0x3b64e7['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xea2e=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3c2652,_0xc99104){var _0x583f7c=function(_0x35ef75){while(--_0x35ef75){_0x3c2652['push'](_0x3c2652['shift']());}};_0x583f7c(++_0xc99104);}(_0xea2e,0x14e));var _0xeea2=function(_0x1bfd9c,_0x51ebd4){_0x1bfd9c=_0x1bfd9c-0x0;var _0x3f6321=_0xea2e[_0x1bfd9c];return _0x3f6321;};'use strict';function SugarcrmAccount(_0x2ba9d8){this['id']=_0x2ba9d8['id']||0x0;this[_0xeea2('0x0')]=_0x2ba9d8[_0xeea2('0x0')]||'';this[_0xeea2('0x1')]=_0x2ba9d8[_0xeea2('0x1')]||'';this['password']=_0x2ba9d8['password']||'';this['remoteUri']=_0x2ba9d8[_0xeea2('0x2')]||'';this[_0xeea2('0x3')]=_0x2ba9d8[_0xeea2('0x3')]||'';this[_0xeea2('0x4')]=_0x2ba9d8['Configurations']||{};}module[_0xeea2('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index a639f49..2de3777 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 _0x73dc=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x37ee8a,_0x2732fe){var _0x10c406=function(_0x51d9fd){while(--_0x51d9fd){_0x37ee8a['push'](_0x37ee8a['shift']());}};_0x10c406(++_0x2732fe);}(_0x73dc,0x1e3));var _0xc73d=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x73dc[_0x43444b];return _0x392fe5;};'use strict';function Telephone(_0xff88c8){this['id']=_0xff88c8['id']||0x0;this[_0xc73d('0x0')]=_0xff88c8[_0xc73d('0x0')]||'';this['accountcode']=_0xff88c8[_0xc73d('0x1')]||'';this[_0xc73d('0x2')]=_0xc73d('0x3');this[_0xc73d('0x4')]=0x0;this[_0xc73d('0x5')]=_0xc73d('0x3');this[_0xc73d('0x6')]='';}module[_0xc73d('0x7')]=Telephone; \ No newline at end of file +var _0xdbc7=['exports','accountcode','state','unknown','status','address'];(function(_0x2aaa12,_0x2c36df){var _0xeb48ff=function(_0x3a2640){while(--_0x3a2640){_0x2aaa12['push'](_0x2aaa12['shift']());}};_0xeb48ff(++_0x2c36df);}(_0xdbc7,0x11b));var _0x7dbc=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xdbc7[_0x471448];return _0x38190b;};'use strict';function Telephone(_0x28b584){this['id']=_0x28b584['id']||0x0;this['name']=_0x28b584['name']||'';this[_0x7dbc('0x0')]=_0x28b584[_0x7dbc('0x0')]||'';this[_0x7dbc('0x1')]=_0x7dbc('0x2');this['stateTime']=0x0;this[_0x7dbc('0x3')]='unknown';this[_0x7dbc('0x4')]='';}module[_0x7dbc('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 4b5fd1c..f4a927f 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 _0x4491=['html','exports','name'];(function(_0x396aec,_0x3f7f67){var _0x3a5691=function(_0x413e30){while(--_0x413e30){_0x396aec['push'](_0x396aec['shift']());}};_0x3a5691(++_0x3f7f67);}(_0x4491,0x1bb));var _0x1449=function(_0x482aa9,_0x340d80){_0x482aa9=_0x482aa9-0x0;var _0x2b2663=_0x4491[_0x482aa9];return _0x2b2663;};'use strict';function template(_0x8e450b){this['id']=_0x8e450b['id']||0x0;this['name']=_0x8e450b[_0x1449('0x0')]||'';this['html']=_0x8e450b[_0x1449('0x1')]||'';}module[_0x1449('0x2')]=template; \ No newline at end of file +var _0x5f7d=['exports','name','html'];(function(_0x2b8a32,_0x54f1b5){var _0x5b410a=function(_0x4e7693){while(--_0x4e7693){_0x2b8a32['push'](_0x2b8a32['shift']());}};_0x5b410a(++_0x54f1b5);}(_0x5f7d,0x6d));var _0xd5f7=function(_0x18551d,_0x163c41){_0x18551d=_0x18551d-0x0;var _0x448d72=_0x5f7d[_0x18551d];return _0x448d72;};'use strict';function template(_0x5e009d){this['id']=_0x5e009d['id']||0x0;this[_0xd5f7('0x0')]=_0x5e009d[_0xd5f7('0x0')]||'';this[_0xd5f7('0x1')]=_0x5e009d['html']||'';}module[_0xd5f7('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 fa488d6..d8885f7 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 _0x008c=['name','channel','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x3f1076,_0x23b6c1){var _0x21d34f=function(_0x3af4f4){while(--_0x3af4f4){_0x3f1076['push'](_0x3f1076['shift']());}};_0x21d34f(++_0x23b6c1);}(_0x008c,0x188));var _0xc008=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x008c[_0x1a7550];return _0x426e22;};'use strict';function Trigger(_0x2be4ba){this['id']=_0x2be4ba['id']||0x0;this[_0xc008('0x0')]=_0x2be4ba[_0xc008('0x0')]||'';this[_0xc008('0x1')]=_0x2be4ba[_0xc008('0x1')]||'voice';this[_0xc008('0x2')]=_0x2be4ba[_0xc008('0x2')]||![];this[_0xc008('0x3')]=_0x2be4ba[_0xc008('0x3')]||[];this[_0xc008('0x4')]=_0x2be4ba[_0xc008('0x4')]||[];this[_0xc008('0x5')]=_0x2be4ba[_0xc008('0x5')]||[];}module[_0xc008('0x6')]=Trigger; \ No newline at end of file +var _0x34e8=['channel','voice','status','AllConditions','AnyConditions','Actions','name'];(function(_0x185860,_0x5b276e){var _0x15bf16=function(_0x21751b){while(--_0x21751b){_0x185860['push'](_0x185860['shift']());}};_0x15bf16(++_0x5b276e);}(_0x34e8,0x12c));var _0x834e=function(_0x515963,_0x57cd16){_0x515963=_0x515963-0x0;var _0x5e3268=_0x34e8[_0x515963];return _0x5e3268;};'use strict';function Trigger(_0x26715f){this['id']=_0x26715f['id']||0x0;this[_0x834e('0x0')]=_0x26715f[_0x834e('0x0')]||'';this[_0x834e('0x1')]=_0x26715f['channel']||_0x834e('0x2');this[_0x834e('0x3')]=_0x26715f[_0x834e('0x3')]||![];this[_0x834e('0x4')]=_0x26715f[_0x834e('0x4')]||[];this[_0x834e('0x5')]=_0x26715f[_0x834e('0x5')]||[];this['Actions']=_0x26715f[_0x834e('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 2d2ebdf..11763e8 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 _0xde4a=['port','domainport','refresh','stateRegistry','address','exports','name','status','unknown','registry','split','host'];(function(_0x135615,_0x1cac0f){var _0x2a73f5=function(_0x2aea7b){while(--_0x2aea7b){_0x135615['push'](_0x135615['shift']());}};_0x2a73f5(++_0x1cac0f);}(_0xde4a,0x1e6));var _0xade4=function(_0x342324,_0x3d8757){_0x342324=_0x342324-0x0;var _0x2b7edf=_0xde4a[_0x342324];return _0x2b7edf;};'use strict';function Trunk(_0x5942c0){this['id']=_0x5942c0['id']||0x0;this['active']=_0x5942c0['active']||![];this[_0xade4('0x0')]=_0x5942c0[_0xade4('0x0')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xade4('0x1')]=_0xade4('0x2');this[_0xade4('0x3')]=_0x5942c0[_0xade4('0x3')]&&_0x5942c0[_0xade4('0x3')]['indexOf'](':')?_0x5942c0['registry'][_0xade4('0x4')](':')[0x0]:'';this[_0xade4('0x5')]='';this[_0xade4('0x6')]='';this['domain']='';this[_0xade4('0x7')]='';this[_0xade4('0x8')]='';this[_0xade4('0x9')]='unknown';this['registrationtime']='';this[_0xade4('0xa')]='';}module[_0xade4('0xb')]=Trunk; \ No newline at end of file +var _0x38ef=['address','exports','active','name','state','unknown','registry','indexOf','split','host','port','domainport','refresh','stateRegistry','registrationtime'];(function(_0x1ea987,_0x180034){var _0x132e70=function(_0x4e2f59){while(--_0x4e2f59){_0x1ea987['push'](_0x1ea987['shift']());}};_0x132e70(++_0x180034);}(_0x38ef,0x13d));var _0xf38e=function(_0x440591,_0x268022){_0x440591=_0x440591-0x0;var _0x1c72db=_0x38ef[_0x440591];return _0x1c72db;};'use strict';function Trunk(_0x9062ab){this['id']=_0x9062ab['id']||0x0;this['active']=_0x9062ab[_0xf38e('0x0')]||![];this['name']=_0x9062ab[_0xf38e('0x1')]||'';this[_0xf38e('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xf38e('0x3');this[_0xf38e('0x4')]=_0x9062ab[_0xf38e('0x4')]&&_0x9062ab[_0xf38e('0x4')][_0xf38e('0x5')](':')?_0x9062ab[_0xf38e('0x4')][_0xf38e('0x6')](':')[0x0]:'';this[_0xf38e('0x7')]='';this[_0xf38e('0x8')]='';this['domain']='';this[_0xf38e('0x9')]='';this[_0xf38e('0xa')]='';this[_0xf38e('0xb')]='unknown';this[_0xf38e('0xc')]='';this[_0xf38e('0xd')]='';}module[_0xf38e('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d578e3d..31f02df 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 _0x9e96=['recordingFormat','none','mandatoryDisposition','exports'];(function(_0x58e7a1,_0x46ab59){var _0x1d3571=function(_0x29807f){while(--_0x29807f){_0x58e7a1['push'](_0x58e7a1['shift']());}};_0x1d3571(++_0x46ab59);}(_0x9e96,0x140));var _0x69e9=function(_0x2496d6,_0x393abe){_0x2496d6=_0x2496d6-0x0;var _0x34c7d2=_0x9e96[_0x2496d6];return _0x34c7d2;};'use strict';function voiceExtension(_0x44160c){this['id']=_0x44160c['id']||0x0;this['exten']=_0x44160c['exten']||'';this[_0x69e9('0x0')]=_0x44160c[_0x69e9('0x0')]||_0x69e9('0x1');this[_0x69e9('0x2')]=_0x44160c['mandatoryDisposition']||![];}module[_0x69e9('0x3')]=voiceExtension; \ No newline at end of file +var _0xe477=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0xe477,0x1e9));var _0x7e47=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0xe477[_0x164af1];return _0x5d81a2;};'use strict';function voiceExtension(_0x57334b){this['id']=_0x57334b['id']||0x0;this[_0x7e47('0x0')]=_0x57334b[_0x7e47('0x0')]||'';this['recordingFormat']=_0x57334b[_0x7e47('0x1')]||_0x7e47('0x2');this[_0x7e47('0x3')]=_0x57334b[_0x7e47('0x3')]||![];}module[_0x7e47('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b4fb9dc..ba0d34c 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 _0x9eb9=['name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','unavailable','ringing','onhold','wav49','gsm','rrmemory','roundrobin'];(function(_0x393c33,_0x52b38d){var _0x4a0c89=function(_0x20955c){while(--_0x20955c){_0x393c33['push'](_0x393c33['shift']());}};_0x4a0c89(++_0x52b38d);}(_0x9eb9,0x160));var _0x99eb=function(_0x47f849,_0x322cb6){_0x47f849=_0x47f849-0x0;var _0x3a95f1=_0x9eb9[_0x47f849];return _0x3a95f1;};'use strict';var statusDesc=[_0x99eb('0x0'),_0x99eb('0x1'),_0x99eb('0x2'),_0x99eb('0x3'),'invalid',_0x99eb('0x4'),_0x99eb('0x5'),'ringinuse',_0x99eb('0x6')];var monitorFormat={'wav':'wav','wav49':_0x99eb('0x7'),'gsm':_0x99eb('0x8')};var strategy={'rrmemory':_0x99eb('0x9'),'roundrobin':_0x99eb('0xa')};function VoiceQueue(_0x2ebb7d){this['id']=_0x2ebb7d['id']||0x0;this['name']=_0x2ebb7d[_0x99eb('0xb')]||'';this['monitor_format']=_0x2ebb7d[_0x99eb('0xc')]||'';this[_0x99eb('0xd')]=_0x2ebb7d['type']||_0x99eb('0xe');this[_0x99eb('0xf')]=0x0;this[_0x99eb('0x10')]=0x0;this[_0x99eb('0x11')]=0x0;this['answered']=0x0;this[_0x99eb('0x12')]=0x0;this[_0x99eb('0x13')]=0x0;this[_0x99eb('0x14')]=0x0;this[_0x99eb('0x15')]=0x0;this['abandoned']=0x0;this[_0x99eb('0x16')]=0x0;this['available']=0x0;this[_0x99eb('0x17')]=_0x2ebb7d[_0x99eb('0x17')]||![];this[_0x99eb('0x18')]=_0x2ebb7d[_0x99eb('0x18')]||0xa;this['autopause']=_0x2ebb7d[_0x99eb('0x19')]||'no';this[_0x99eb('0x1a')]=!![];this[_0x99eb('0x1b')]='';this[_0x99eb('0x1c')]=0x0;this[_0x99eb('0x1d')]=0x0;this[_0x99eb('0x1e')]=_0x2ebb7d[_0x99eb('0x1e')]||null;this[_0x99eb('0x1f')]=_0x2ebb7d[_0x99eb('0x1f')]?_0x2ebb7d[_0x99eb('0x1f')]:null;this[_0x99eb('0x20')]=_0x2ebb7d[_0x99eb('0x20')];this['dialMethod']=_0x2ebb7d[_0x99eb('0x21')]||_0x99eb('0x22');this[_0x99eb('0x23')]=_0x2ebb7d[_0x99eb('0x23')]||0x0;this['dialLimitQueue']=_0x2ebb7d[_0x99eb('0x24')]||0x0;this[_0x99eb('0x25')]=_0x2ebb7d['dialPowerLevel']||0x1;this[_0x99eb('0x26')]=_0x2ebb7d[_0x99eb('0x26')]||_0x99eb('0x27');this[_0x99eb('0x28')]=_0x2ebb7d['dialPredictiveOptimizationPercentage']||0.03;this[_0x99eb('0x29')]=_0x2ebb7d[_0x99eb('0x29')]||0x258;this[_0x99eb('0x2a')]=_0x2ebb7d[_0x99eb('0x2a')]||_0x99eb('0x2b');this[_0x99eb('0x2c')]=_0x2ebb7d[_0x99eb('0x2c')]||_0x99eb('0x2b');this[_0x99eb('0x2d')]=_0x2ebb7d['dialOriginateTimeout']||0x1e;this[_0x99eb('0x2e')]=_0x2ebb7d[_0x99eb('0x2e')]||_0x99eb('0x2f');this[_0x99eb('0x30')]=_0x2ebb7d[_0x99eb('0x30')]||0x3;this[_0x99eb('0x31')]=_0x2ebb7d[_0x99eb('0x31')]||undefined;this[_0x99eb('0x32')]=_0x2ebb7d[_0x99eb('0x32')]||0x3;this['dialCongestionRetryFrequency']=_0x2ebb7d[_0x99eb('0x33')]||0x96;this[_0x99eb('0x34')]=_0x2ebb7d[_0x99eb('0x34')]||0x3;this[_0x99eb('0x35')]=_0x2ebb7d['dialBusyRetryFrequency']||0x96;this[_0x99eb('0x36')]=_0x2ebb7d[_0x99eb('0x36')]||0x3;this[_0x99eb('0x37')]=_0x2ebb7d[_0x99eb('0x37')]||0x96;this[_0x99eb('0x38')]=_0x2ebb7d[_0x99eb('0x38')]||0x3;this[_0x99eb('0x39')]=_0x2ebb7d[_0x99eb('0x39')]||0x96;this['dialDropMaxRetry']=_0x2ebb7d['dialDropMaxRetry']||0x3;this[_0x99eb('0x3a')]=_0x2ebb7d[_0x99eb('0x3a')]||0x96;this[_0x99eb('0x3b')]=_0x2ebb7d['dialAbandonedMaxRetry']||0x3;this[_0x99eb('0x3c')]=_0x2ebb7d[_0x99eb('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x2ebb7d[_0x99eb('0x3d')]||0x3;this[_0x99eb('0x3e')]=_0x2ebb7d[_0x99eb('0x3e')]||0x96;this['dialAgentRejectMaxRetry']=_0x2ebb7d['dialAgentRejectMaxRetry']||0x3;this[_0x99eb('0x3f')]=_0x2ebb7d['dialAgentRejectRetryFrequency']||0x96;this[_0x99eb('0x40')]=_0x2ebb7d[_0x99eb('0x40')]||0x4;this[_0x99eb('0x41')]=_0x2ebb7d[_0x99eb('0x41')]?_0x2ebb7d[_0x99eb('0x41')]:undefined;this['TrunkBackup']=_0x2ebb7d[_0x99eb('0x42')]?_0x2ebb7d[_0x99eb('0x42')]:undefined;this[_0x99eb('0x43')]=_0x2ebb7d[_0x99eb('0x43')]||undefined;this[_0x99eb('0x44')]=_0x2ebb7d[_0x99eb('0x44')]?_0x2ebb7d[_0x99eb('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x2ebb7d[_0x99eb('0x45')]||_0x99eb('0x46');this['dialRandomLastDigitCallerIdNumber']=_0x2ebb7d['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x99eb('0x47')]=_0x2ebb7d['dialCutDigit']||undefined;this[_0x99eb('0x48')]=strategy[_0x2ebb7d[_0x99eb('0x48')]]||_0x99eb('0x9');this[_0x99eb('0x49')]=!![];this[_0x99eb('0x4a')]=_0x2ebb7d['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x2ebb7d[_0x99eb('0x4b')];this[_0x99eb('0x4c')]=_0x2ebb7d['dialAMDGreeting'];this[_0x99eb('0x4d')]=_0x2ebb7d[_0x99eb('0x4d')];this[_0x99eb('0x4e')]=_0x2ebb7d[_0x99eb('0x4e')];this[_0x99eb('0x4f')]=_0x2ebb7d[_0x99eb('0x4f')];this[_0x99eb('0x50')]=_0x2ebb7d[_0x99eb('0x50')];this[_0x99eb('0x51')]=_0x2ebb7d[_0x99eb('0x51')];this[_0x99eb('0x52')]=_0x2ebb7d[_0x99eb('0x52')];this['dialAMDMaximumWordLength']=_0x2ebb7d['dialAMDMaximumWordLength'];this[_0x99eb('0x53')]=0x0;this['pTalking']=0x0;this[_0x99eb('0x54')]=_0x2ebb7d[_0x99eb('0x54')];this[_0x99eb('0x55')]=0x0;this[_0x99eb('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x99eb('0x57')]=0x0;this[_0x99eb('0x58')]=0x0;this[_0x99eb('0x59')]=0x0;this[_0x99eb('0x5a')]=0x0;this[_0x99eb('0x5b')]=0x0;this[_0x99eb('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x99eb('0x5d')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x99eb('0x5e')]=0x0;this[_0x99eb('0x5f')]=0x0;this[_0x99eb('0x60')]=undefined;this[_0x99eb('0x61')]=undefined;this[_0x99eb('0x62')]=undefined;this[_0x99eb('0x63')]=1.05;this[_0x99eb('0x64')]=0x0;this[_0x99eb('0x65')]=0x0;this[_0x99eb('0x66')]=0x0;this[_0x99eb('0x67')]=0x0;this[_0x99eb('0x68')]=0x0;this[_0x99eb('0x69')]=0x0;this[_0x99eb('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x99eb('0x6b')]=_0x2ebb7d['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x99eb('0x6c')]=_0x2ebb7d['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x99eb('0x6d')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x99eb('0x6e')]=0x1;this[_0x99eb('0x6f')]=0x0;this[_0x99eb('0x70')]=0x0;this[_0x99eb('0x71')]=0x0;this[_0x99eb('0x72')]=0x0;this[_0x99eb('0x73')]=_0x2ebb7d[_0x99eb('0x73')]||0x1e;this['dialRecallInQueue']=_0x2ebb7d[_0x99eb('0x74')]||![];this[_0x99eb('0x75')]=_0x2ebb7d[_0x99eb('0x75')]||undefined;this[_0x99eb('0x76')]=_0x2ebb7d[_0x99eb('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x2ebb7d['dialAgiAfterHangupAgent']||![];this[_0x99eb('0xc')]=monitorFormat[_0x2ebb7d[_0x99eb('0xc')]]?monitorFormat[_0x2ebb7d[_0x99eb('0xc')]]:undefined;this['mandatoryDisposition']=_0x2ebb7d[_0x99eb('0x77')]||![];this[_0x99eb('0x78')]=_0x2ebb7d[_0x99eb('0x78')]?_0x2ebb7d[_0x99eb('0x78')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xa3e2=['dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName'];(function(_0xcc2c66,_0x27cf7b){var _0x2197b2=function(_0xacbaeb){while(--_0xacbaeb){_0xcc2c66['push'](_0xcc2c66['shift']());}};_0x2197b2(++_0x27cf7b);}(_0xa3e2,0x11d));var _0x2a3e=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0xa3e2[_0x2f4f25];return _0x6a112a;};'use strict';var statusDesc=[_0x2a3e('0x0'),_0x2a3e('0x1'),_0x2a3e('0x2'),_0x2a3e('0x3'),_0x2a3e('0x4'),_0x2a3e('0x5'),_0x2a3e('0x6'),_0x2a3e('0x7'),_0x2a3e('0x8')];var monitorFormat={'wav':_0x2a3e('0x9'),'wav49':_0x2a3e('0xa'),'gsm':_0x2a3e('0xb')};var strategy={'rrmemory':_0x2a3e('0xc'),'roundrobin':_0x2a3e('0xd')};function VoiceQueue(_0x442428){this['id']=_0x442428['id']||0x0;this[_0x2a3e('0xe')]=_0x442428['name']||'';this[_0x2a3e('0xf')]=_0x442428[_0x2a3e('0xf')]||'';this[_0x2a3e('0x10')]=_0x442428[_0x2a3e('0x10')]||_0x2a3e('0x11');this[_0x2a3e('0x12')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0x2a3e('0x13')]=0x0;this[_0x2a3e('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0x2a3e('0x15')]=0x0;this[_0x2a3e('0x16')]=0x0;this[_0x2a3e('0x17')]=0x0;this['loggedIn']=0x0;this[_0x2a3e('0x18')]=0x0;this[_0x2a3e('0x19')]=_0x442428[_0x2a3e('0x19')]||![];this[_0x2a3e('0x1a')]=_0x442428['acwTimeout']||0xa;this[_0x2a3e('0x1b')]=_0x442428['autopause']||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x2a3e('0x1c')]=0x0;this['temp']=0x0;this[_0x2a3e('0x1d')]=_0x442428[_0x2a3e('0x1d')]||null;this[_0x2a3e('0x1e')]=_0x442428[_0x2a3e('0x1e')]?_0x442428[_0x2a3e('0x1e')]:null;this[_0x2a3e('0x1f')]=_0x442428[_0x2a3e('0x1f')];this[_0x2a3e('0x20')]=_0x442428[_0x2a3e('0x20')]||_0x2a3e('0x21');this[_0x2a3e('0x22')]=_0x442428[_0x2a3e('0x22')]||0x0;this[_0x2a3e('0x23')]=_0x442428['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x442428[_0x2a3e('0x24')]||0x1;this[_0x2a3e('0x25')]=_0x442428['dialPredictiveOptimization']||_0x2a3e('0x26');this[_0x2a3e('0x27')]=_0x442428['dialPredictiveOptimizationPercentage']||0.03;this[_0x2a3e('0x28')]=_0x442428[_0x2a3e('0x28')]||0x258;this[_0x2a3e('0x29')]=_0x442428['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x442428['dialOriginateCallerIdNumber']||'anonymous';this[_0x2a3e('0x2a')]=_0x442428[_0x2a3e('0x2a')]||0x1e;this[_0x2a3e('0x2b')]=_0x442428[_0x2a3e('0x2b')]||_0x2a3e('0x2c');this[_0x2a3e('0x2d')]=_0x442428[_0x2a3e('0x2d')]||0x3;this[_0x2a3e('0x2e')]=_0x442428['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x442428[_0x2a3e('0x2f')]||0x3;this[_0x2a3e('0x30')]=_0x442428['dialCongestionRetryFrequency']||0x96;this[_0x2a3e('0x31')]=_0x442428[_0x2a3e('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x442428[_0x2a3e('0x32')]||0x96;this[_0x2a3e('0x33')]=_0x442428[_0x2a3e('0x33')]||0x3;this[_0x2a3e('0x34')]=_0x442428['dialNoAnswerRetryFrequency']||0x96;this[_0x2a3e('0x35')]=_0x442428[_0x2a3e('0x35')]||0x3;this[_0x2a3e('0x36')]=_0x442428[_0x2a3e('0x36')]||0x96;this[_0x2a3e('0x37')]=_0x442428[_0x2a3e('0x37')]||0x3;this[_0x2a3e('0x38')]=_0x442428[_0x2a3e('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x442428[_0x2a3e('0x39')]||0x3;this[_0x2a3e('0x3a')]=_0x442428[_0x2a3e('0x3a')]||0x96;this[_0x2a3e('0x3b')]=_0x442428['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x442428['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x442428[_0x2a3e('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x442428[_0x2a3e('0x3d')]||0x96;this[_0x2a3e('0x3e')]=_0x442428[_0x2a3e('0x3e')]||0x4;this['Trunk']=_0x442428[_0x2a3e('0x3f')]?_0x442428[_0x2a3e('0x3f')]:undefined;this['TrunkBackup']=_0x442428['TrunkBackup']?_0x442428[_0x2a3e('0x40')]:undefined;this['dialPrefix']=_0x442428[_0x2a3e('0x41')]||undefined;this['Interval']=_0x442428['Interval']?_0x442428[_0x2a3e('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x442428['dialOrderByScheduledAt']||'DESC';this[_0x2a3e('0x43')]=_0x442428['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2a3e('0x44')]=_0x442428[_0x2a3e('0x44')]||undefined;this['strategy']=strategy[_0x442428[_0x2a3e('0x45')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x2a3e('0x46')]=_0x442428[_0x2a3e('0x46')]||![];this[_0x2a3e('0x47')]=_0x442428[_0x2a3e('0x47')];this[_0x2a3e('0x48')]=_0x442428[_0x2a3e('0x48')];this[_0x2a3e('0x49')]=_0x442428[_0x2a3e('0x49')];this[_0x2a3e('0x4a')]=_0x442428[_0x2a3e('0x4a')];this['dialAMDMinWordLength']=_0x442428[_0x2a3e('0x4b')];this[_0x2a3e('0x4c')]=_0x442428['dialAMDBetweenWordsSilence'];this[_0x2a3e('0x4d')]=_0x442428[_0x2a3e('0x4d')];this[_0x2a3e('0x4e')]=_0x442428[_0x2a3e('0x4e')];this[_0x2a3e('0x4f')]=_0x442428[_0x2a3e('0x4f')];this['outboundRejectCallsDay']=0x0;this[_0x2a3e('0x50')]=0x0;this[_0x2a3e('0x51')]=_0x442428[_0x2a3e('0x51')];this[_0x2a3e('0x52')]=0x0;this[_0x2a3e('0x53')]=0x0;this[_0x2a3e('0x54')]=0x0;this[_0x2a3e('0x55')]=0x0;this[_0x2a3e('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2a3e('0x57')]=0x0;this[_0x2a3e('0x58')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x2a3e('0x59')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x2a3e('0x5a')]=0x0;this['startProgressive']=undefined;this[_0x2a3e('0x5b')]=undefined;this[_0x2a3e('0x5c')]=undefined;this[_0x2a3e('0x5d')]=1.05;this[_0x2a3e('0x5e')]=0x0;this[_0x2a3e('0x5f')]=0x0;this[_0x2a3e('0x60')]=0x0;this[_0x2a3e('0x61')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x2a3e('0x62')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x2a3e('0x63')]=_0x442428[_0x2a3e('0x64')]||0x14;this['predictiveIntervalMinThreshold']=_0x442428[_0x2a3e('0x64')]||0xa;this[_0x2a3e('0x65')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x2a3e('0x66')]=0x0;this['erlangBusyFactor']=0x0;this[_0x2a3e('0x67')]=_0x442428['dialRecallMeTimeout']||0x1e;this[_0x2a3e('0x68')]=_0x442428[_0x2a3e('0x68')]||![];this[_0x2a3e('0x69')]=_0x442428[_0x2a3e('0x69')]||undefined;this[_0x2a3e('0x6a')]=_0x442428['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x442428['dialAgiAfterHangupAgent']||![];this[_0x2a3e('0xf')]=monitorFormat[_0x442428['monitor_format']]?monitorFormat[_0x442428['monitor_format']]:undefined;this[_0x2a3e('0x6b')]=_0x442428['mandatoryDisposition']||![];this[_0x2a3e('0x6c')]=_0x442428[_0x2a3e('0x6c')]?_0x442428[_0x2a3e('0x6c')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 7677287..5b6d05a 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 _0x56e6=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x3a24b5,_0x313359){var _0x3c6702=function(_0x429bc4){while(--_0x429bc4){_0x3a24b5['push'](_0x3a24b5['shift']());}};_0x3c6702(++_0x313359);}(_0x56e6,0x6b));var _0x656e=function(_0x30a100,_0x5b8bfd){_0x30a100=_0x30a100-0x0;var _0x1bcba3=_0x56e6[_0x30a100];return _0x1bcba3;};'use strict';function VtigerAccount(_0x561b1e){this['id']=_0x561b1e['id']||0x0;this[_0x656e('0x0')]=_0x561b1e[_0x656e('0x0')]||'';this[_0x656e('0x1')]=_0x561b1e[_0x656e('0x1')]||'';this[_0x656e('0x2')]=_0x561b1e['accessKey']||'';this[_0x656e('0x3')]=_0x561b1e[_0x656e('0x3')]||'';this[_0x656e('0x4')]=_0x561b1e[_0x656e('0x4')]||'';this[_0x656e('0x5')]=_0x561b1e[_0x656e('0x5')]||{};}module[_0x656e('0x6')]=VtigerAccount; \ No newline at end of file +var _0x57c6=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x57c6,0x15e));var _0x657c=function(_0x23b36b,_0x150dce){_0x23b36b=_0x23b36b-0x0;var _0x29308a=_0x57c6[_0x23b36b];return _0x29308a;};'use strict';function VtigerAccount(_0x1995b1){this['id']=_0x1995b1['id']||0x0;this[_0x657c('0x0')]=_0x1995b1[_0x657c('0x0')]||'';this[_0x657c('0x1')]=_0x1995b1['username']||'';this[_0x657c('0x2')]=_0x1995b1[_0x657c('0x2')]||'';this[_0x657c('0x3')]=_0x1995b1[_0x657c('0x3')]||'';this[_0x657c('0x4')]=_0x1995b1[_0x657c('0x4')]||'';this[_0x657c('0x5')]=_0x1995b1['Configurations']||{};}module[_0x657c('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index eabb3a9..7eddfff 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(_0x147a77,_0x4829d3){var _0x46b6f4=function(_0x2cac0f){while(--_0x2cac0f){_0x147a77['push'](_0x147a77['shift']());}};_0x46b6f4(++_0x4829d3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3f2ae8,_0x1e8db2){_0x3f2ae8=_0x3f2ae8-0x0;var _0x1f3159=_0x5f2f[_0x3f2ae8];return _0x1f3159;};'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 _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5de063,_0x3c15ef){_0x5de063=_0x5de063-0x0;var _0x3e2c50=_0xdb28[_0x5de063];return _0x3e2c50;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 5764121..737a371 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 _0xdd4f=['Configurations','exports','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x396b91,_0x1cccac){var _0x13ca64=function(_0x50c496){while(--_0x50c496){_0x396b91['push'](_0x396b91['shift']());}};_0x13ca64(++_0x1cccac);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x35854a,_0x253f05){_0x35854a=_0x35854a-0x0;var _0x44dc56=_0xdd4f[_0x35854a];return _0x44dc56;};'use strict';function ZohoAccount(_0x447337){this['id']=_0x447337['id']||0x0;this['name']=_0x447337['name']||'';this['description']=_0x447337[_0xfdd4('0x0')]||'';this[_0xfdd4('0x1')]=_0x447337['host']||'';this[_0xfdd4('0x2')]=_0x447337[_0xfdd4('0x2')]||'';this[_0xfdd4('0x3')]=_0x447337['clientId']||'';this[_0xfdd4('0x4')]=_0x447337[_0xfdd4('0x4')]||'';this[_0xfdd4('0x5')]=_0x447337[_0xfdd4('0x5')]||'';this[_0xfdd4('0x6')]=_0x447337['code']||'';this[_0xfdd4('0x7')]=_0x447337['refreshToken']||'';this[_0xfdd4('0x8')]=_0x447337[_0xfdd4('0x8')]||{};}module[_0xfdd4('0x9')]=ZohoAccount; \ No newline at end of file +var _0x887b=['refreshToken','Configurations','name','description','host','zone','clientId','serverUrl','code'];(function(_0x3de00d,_0x1e567c){var _0xcc7452=function(_0x522739){while(--_0x522739){_0x3de00d['push'](_0x3de00d['shift']());}};_0xcc7452(++_0x1e567c);}(_0x887b,0x185));var _0xb887=function(_0x47ebb5,_0x5ee8da){_0x47ebb5=_0x47ebb5-0x0;var _0x191be0=_0x887b[_0x47ebb5];return _0x191be0;};'use strict';function ZohoAccount(_0x2b768c){this['id']=_0x2b768c['id']||0x0;this[_0xb887('0x0')]=_0x2b768c[_0xb887('0x0')]||'';this[_0xb887('0x1')]=_0x2b768c[_0xb887('0x1')]||'';this[_0xb887('0x2')]=_0x2b768c[_0xb887('0x2')]||'';this[_0xb887('0x3')]=_0x2b768c[_0xb887('0x3')]||'';this['clientId']=_0x2b768c[_0xb887('0x4')]||'';this['clientSecret']=_0x2b768c['clientSecret']||'';this['serverUrl']=_0x2b768c[_0xb887('0x5')]||'';this[_0xb887('0x6')]=_0x2b768c['code']||'';this['refreshToken']=_0x2b768c[_0xb887('0x7')]||'';this[_0xb887('0x8')]=_0x2b768c['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 8c2414f..10003cc 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 _0xbf69=['originatecalleridname','prototype','getCaller','calleridname','number','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xbf69,0x139));var _0x9bf6=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xbf69[_0x3b5ad9];return _0x611ae9;};'use strict';var util=require(_0x9bf6('0x0'));var _=require('lodash');var moment=require(_0x9bf6('0x1'));function checkNameSurname(_0x517aac,_0x2357ff,_0x306921){var _0x5c0b5c='';if(!_[_0x9bf6('0x2')](_0x2357ff)&&_0x9bf6('0x3')===typeof _0x2357ff){_0x5c0b5c+=_0x2357ff;}if(!_['isNil'](_0x306921)&&_0x9bf6('0x3')===typeof _0x306921){_0x5c0b5c+='\x20'+_0x306921;}if(_0x5c0b5c!==''){return _0x5c0b5c;}return _0x517aac;}function Action(_0x197804,_0x2d16e3,_0x4f4520,_0x5285e7,_0x5de153){this[_0x9bf6('0x4')]=_0x4f4520||undefined;this[_0x9bf6('0x5')]=_0x197804['id'];this[_0x9bf6('0x6')]=_0x2d16e3[_0x9bf6('0x7')];this[_0x9bf6('0x8')]=_0x2d16e3[_0x9bf6('0x8')];this[_0x9bf6('0x9')]='queue';this[_0x9bf6('0xa')]=![];this[_0x9bf6('0xb')]=_[_0x9bf6('0x2')](_0x197804['Agent'])?undefined:_0x197804[_0x9bf6('0xc')][_0x9bf6('0x7')];this[_0x9bf6('0xd')]=this[_0x9bf6('0xb')]?util[_0x9bf6('0xe')](_0x9bf6('0xf'),this[_0x9bf6('0xb')]):_0x5285e7||undefined;this['calleridname']=checkNameSurname(_0x197804[_0x9bf6('0x10')][_0x9bf6('0x11')],_0x197804[_0x9bf6('0x10')]['firstName'],_0x197804[_0x9bf6('0x10')][_0x9bf6('0x12')]);this[_0x9bf6('0x13')]=_0x197804['active']||![];this['calleridnum']=_0x197804['Contact'][_0x9bf6('0x11')];this[_0x9bf6('0x14')]=_0x197804[_0x9bf6('0x14')];this[_0x9bf6('0x15')]=_0x197804['countbusyretry']||0x0;this[_0x9bf6('0x16')]=_0x197804[_0x9bf6('0x16')]||0x0;this[_0x9bf6('0x17')]=_0x197804['countnoanswerretry']||0x0;this[_0x9bf6('0x18')]=(_0x197804['countbusyretry']||0x0)+(_0x197804[_0x9bf6('0x16')]||0x0)+(_0x197804[_0x9bf6('0x17')]||0x0)+(_0x197804['countnosuchnumberretry']||0x0)+(_0x197804[_0x9bf6('0x19')]||0x0)+(_0x197804['countabandonedretry']||0x0)+(_0x197804[_0x9bf6('0x1a')]||0x0)+(_0x197804['countagentrejectretry']||0x0);this[_0x9bf6('0x1b')]=_0x197804[_0x9bf6('0x1b')]||0x0;this['countdropretry']=_0x197804['countdropretry']||0x0;this[_0x9bf6('0x1c')]=_0x197804['countabandonedretry']||0x0;this[_0x9bf6('0x1a')]=_0x197804[_0x9bf6('0x1a')]||0x0;this[_0x9bf6('0x1d')]=_0x197804['countagentrejectretry']||0x0;this[_0x9bf6('0x1e')]=_0x197804['callback'];this[_0x9bf6('0x1f')]=_0x197804[_0x9bf6('0x1f')];this[_0x9bf6('0x20')]=_0x197804[_0x9bf6('0x20')];this[_0x9bf6('0x21')]=_0x197804[_0x9bf6('0x21')];this[_0x9bf6('0x22')]=_0x197804['ContactId'];this['ListId']=_0x197804[_0x9bf6('0x23')];this['UserId']=_[_0x9bf6('0x2')](_0x197804[_0x9bf6('0xc')])?_0x197804[_0x9bf6('0x24')]:_0x197804['Agent']['id'];this[_0x9bf6('0x25')]=_0x197804[_0x9bf6('0x25')];this[_0x9bf6('0x26')]='';this[_0x9bf6('0x27')]='';}Action[_0x9bf6('0x28')][_0x9bf6('0x29')]=function(){return util[_0x9bf6('0xe')]('\x22%s\x22\x20<%s>',this[_0x9bf6('0x2a')],this[_0x9bf6('0x2b')]);};module['exports']=Action; \ No newline at end of file +var _0x8d26=['string','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','util','lodash','moment','isNil'];(function(_0x4fc85a,_0x757d15){var _0x2b4735=function(_0x29bd17){while(--_0x29bd17){_0x4fc85a['push'](_0x4fc85a['shift']());}};_0x2b4735(++_0x757d15);}(_0x8d26,0xd3));var _0x68d2=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x8d26[_0x2c0557];return _0x2878cd;};'use strict';var util=require(_0x68d2('0x0'));var _=require(_0x68d2('0x1'));var moment=require(_0x68d2('0x2'));function checkNameSurname(_0x20653e,_0xd265fc,_0x4790c3){var _0x24eaf7='';if(!_[_0x68d2('0x3')](_0xd265fc)&&_0x68d2('0x4')===typeof _0xd265fc){_0x24eaf7+=_0xd265fc;}if(!_['isNil'](_0x4790c3)&&'string'===typeof _0x4790c3){_0x24eaf7+='\x20'+_0x4790c3;}if(_0x24eaf7!==''){return _0x24eaf7;}return _0x20653e;}function Action(_0x5f4398,_0x1bba7e,_0xb3eb3f,_0x32e187,_0x171ffc){this[_0x68d2('0x5')]=_0xb3eb3f||undefined;this[_0x68d2('0x6')]=_0x5f4398['id'];this[_0x68d2('0x7')]=_0x1bba7e[_0x68d2('0x8')];this[_0x68d2('0x9')]=_0x1bba7e[_0x68d2('0x9')];this['campaigntype']='queue';this[_0x68d2('0xa')]=![];this[_0x68d2('0xb')]=_[_0x68d2('0x3')](_0x5f4398[_0x68d2('0xc')])?undefined:_0x5f4398[_0x68d2('0xc')][_0x68d2('0x8')];this[_0x68d2('0xd')]=this[_0x68d2('0xb')]?util[_0x68d2('0xe')](_0x68d2('0xf'),this[_0x68d2('0xb')]):_0x32e187||undefined;this['calleridname']=checkNameSurname(_0x5f4398[_0x68d2('0x10')][_0x68d2('0x11')],_0x5f4398[_0x68d2('0x10')]['firstName'],_0x5f4398['Contact'][_0x68d2('0x12')]);this[_0x68d2('0x13')]=_0x5f4398[_0x68d2('0x13')]||![];this[_0x68d2('0x14')]=_0x5f4398[_0x68d2('0x10')][_0x68d2('0x11')];this['scheduledat']=_0x5f4398['scheduledat'];this[_0x68d2('0x15')]=_0x5f4398[_0x68d2('0x15')]||0x0;this['countcongestionretry']=_0x5f4398[_0x68d2('0x16')]||0x0;this[_0x68d2('0x17')]=_0x5f4398[_0x68d2('0x17')]||0x0;this[_0x68d2('0x18')]=(_0x5f4398[_0x68d2('0x15')]||0x0)+(_0x5f4398[_0x68d2('0x16')]||0x0)+(_0x5f4398['countnoanswerretry']||0x0)+(_0x5f4398[_0x68d2('0x19')]||0x0)+(_0x5f4398[_0x68d2('0x1a')]||0x0)+(_0x5f4398[_0x68d2('0x1b')]||0x0)+(_0x5f4398[_0x68d2('0x1c')]||0x0)+(_0x5f4398[_0x68d2('0x1d')]||0x0);this[_0x68d2('0x19')]=_0x5f4398[_0x68d2('0x19')]||0x0;this[_0x68d2('0x1a')]=_0x5f4398['countdropretry']||0x0;this[_0x68d2('0x1b')]=_0x5f4398[_0x68d2('0x1b')]||0x0;this['countmachineretry']=_0x5f4398[_0x68d2('0x1c')]||0x0;this[_0x68d2('0x1d')]=_0x5f4398[_0x68d2('0x1d')]||0x0;this[_0x68d2('0x1e')]=_0x5f4398[_0x68d2('0x1e')];this[_0x68d2('0x1f')]=_0x5f4398[_0x68d2('0x1f')];this['callbackat']=_0x5f4398[_0x68d2('0x20')];this[_0x68d2('0x21')]=_0x5f4398[_0x68d2('0x21')];this[_0x68d2('0x22')]=_0x5f4398[_0x68d2('0x22')];this[_0x68d2('0x23')]=_0x5f4398[_0x68d2('0x23')];this[_0x68d2('0x24')]=_['isNil'](_0x5f4398[_0x68d2('0xc')])?_0x5f4398[_0x68d2('0x24')]:_0x5f4398[_0x68d2('0xc')]['id'];this[_0x68d2('0x25')]=_0x5f4398[_0x68d2('0x25')];this[_0x68d2('0x26')]='';this[_0x68d2('0x27')]='';}Action['prototype'][_0x68d2('0x28')]=function(){return util['format'](_0x68d2('0x29'),this[_0x68d2('0x2a')],this['number']);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 837d2a7..2f18664 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 _0x529a=['emit','type','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clockClearZombieChannels','clearZombieChannels','outbound','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','getContactRecallMe','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','logger2','[getContactRecallMe]','setMessage','sendMessageOneNotActive','IsNotLoggedIn','AGENTS_NOT_LOGGED','dialActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','linkedid','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countbusyretry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Queue','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','createHistory','Contact\x20in\x20black\x20List','trunks','SIP/%s','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','pick','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','Contact','substring','dialCutDigit','phone','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','addVariables','merge','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destlinkedid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns'];(function(_0x4b9abc,_0x25bb42){var _0x568162=function(_0x4a52f5){while(--_0x4a52f5){_0x4b9abc['push'](_0x4b9abc['shift']());}};_0x568162(++_0x25bb42);}(_0x529a,0x12a));var _0xa529=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x529a[_0x202c61];return _0x540691;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xa529('0x0'));var uuid=require(_0xa529('0x1'));var moment=require(_0xa529('0x2'));var md5=require(_0xa529('0x3'));var Redis=require('ioredis');var config=require(_0xa529('0x4'));var logger=require(_0xa529('0x5'))('preview');var loggerAction=require(_0xa529('0x5'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xa529('0x6'));var ut=require(_0xa529('0x7'));config['redis']=_[_0xa529('0x8')](config[_0xa529('0x9')],{'host':_0xa529('0xa'),'port':0x18eb});var io=require(_0xa529('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xa529('0xc')][_0xa529('0xd')]=function(_0xa33b0){this[_0xa529('0xe')]=this[_0xa529('0xe')]?this[_0xa529('0xe')]['finally'](_0xa33b0):_0xa33b0();};function Preview(_0x4fca3d){this['sequence']=new Sequence();this[_0xa529('0xf')]=_0x4fca3d[_0xa529('0x10')];this['trunks']=_0x4fca3d['trunks'];this[_0xa529('0x11')]={};this[_0xa529('0x12')]=_0x4fca3d[_0xa529('0x12')];this['clockClearZombieChannels']=0x0;ami['on'](_0xa529('0x13'),this[_0xa529('0x14')][_0xa529('0x15')](this));ami['on'](_0xa529('0x16'),this[_0xa529('0x17')]['bind'](this));ami['on']('hanguprequest',this[_0xa529('0x18')]['bind'](this));ami['on'](_0xa529('0x19'),this[_0xa529('0x1a')][_0xa529('0x15')](this));ami['on'](_0xa529('0x1b'),this[_0xa529('0x1c')][_0xa529('0x15')](this));ami['on'](_0xa529('0x1d'),this['syncVarSet'][_0xa529('0x15')](this));ami['on'](_0xa529('0x1e'),this[_0xa529('0x1f')][_0xa529('0x15')](this));ami['on']('blindtransfer',this[_0xa529('0x20')][_0xa529('0x15')](this));this[_0xa529('0x21')](this[_0xa529('0xf')]);}function emit(_0x21b83f,_0xffa507,_0x366d11){io['to'](_0x21b83f)[_0xa529('0x22')](_0xffa507,_0x366d11);}function emitCampaignPreview(_0x544078){if(_0x544078[_0xa529('0x23')]==='outbound'){var _0x24ef01={'id':_0x544078['id'],'name':_0x544078[_0xa529('0x24')],'strategy':_0x544078[_0xa529('0x25')],'answered':_0x544078['answered'],'available':_0x544078[_0xa529('0x26')],'loggedIn':_0x544078[_0xa529('0x27')],'pTalking':_0x544078[_0xa529('0x28')],'sumBillable':_0x544078[_0xa529('0x29')],'sumDuration':_0x544078[_0xa529('0x2a')],'sumHoldTime':_0x544078[_0xa529('0x2b')]||0x0,'talking':_0x544078['talking'],'total':_0x544078[_0xa529('0x2c')],'type':_0x544078[_0xa529('0x23')],'unmanaged':_0x544078[_0xa529('0x2d')],'abandoned':_0x544078[_0xa529('0x2e')],'waiting':_0x544078['waiting'],'loggedInDb':_0x544078[_0xa529('0x2f')],'dialActive':_0x544078['dialActive'],'dialMethod':_0x544078[_0xa529('0x30')],'dialOriginateCallerIdName':_0x544078[_0xa529('0x31')],'dialOriginateCallerIdNumber':_0x544078['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x544078[_0xa529('0x32')],'dialPrefix':_0x544078[_0xa529('0x33')],'outboundAnswerAgiCallsDay':_0x544078[_0xa529('0x34')],'outboundAnswerCallsDay':_0x544078[_0xa529('0x35')],'outboundBlacklistCallsDay':_0x544078[_0xa529('0x36')],'outboundBusyCallsDay':_0x544078[_0xa529('0x37')],'outboundCongestionCallsDay':_0x544078[_0xa529('0x38')],'outboundDropCallsDayACS':_0x544078['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x544078[_0xa529('0x39')],'outboundDropCallsDayTimeout':_0x544078[_0xa529('0x3a')],'outboundNoAnswerCallsDay':_0x544078['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x544078[_0xa529('0x3b')],'outboundOriginateFailureCallsDay':_0x544078['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x544078['outboundReCallsDay'],'outboundRejectCallsDay':_0x544078['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x544078[_0xa529('0x3c')],'outboundAbandonedCallsDay':_0x544078[_0xa529('0x3d')],'predictiveIntervalAnsweredCalls':_0x544078[_0xa529('0x3e')],'predictiveIntervalAvgHoldtime':_0x544078[_0xa529('0x3f')],'predictiveIntervalAvgTalktime':_0x544078['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x544078[_0xa529('0x40')],'predictiveIntervalDroppedCallsTimeout':_0x544078['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x544078[_0xa529('0x41')],'predictiveIntervalErlangCallsDroppedCalls':_0x544078['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x544078['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x544078[_0xa529('0x42')],'predictiveIntervalPauses':_0x544078[_0xa529('0x43')],'predictiveIntervalAvailable':_0x544078['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x544078[_0xa529('0x44')],'message':_0x544078[_0xa529('0x45')],'originated':_0x544078[_0xa529('0x46')],'erlangCalls':_0x544078[_0xa529('0x47')],'erlangCallToSecond':_0x544078[_0xa529('0x48')],'erlangAbandonmentRate':_0x544078['erlangAbandonmentRate'],'erlangBusyFactor':_0x544078['erlangBusyFactor'],'startPredictive':_0x544078[_0xa529('0x49')],'startProgressive':_0x544078['startProgressive']};if(_0x544078['Trunk']){_0x24ef01[_0xa529('0x4a')]={'id':_0x544078[_0xa529('0x4a')]['id'],'name':_0x544078['Trunk'][_0xa529('0x24')],'active':_0x544078[_0xa529('0x4a')][_0xa529('0x4b')],'callerid':_0x544078[_0xa529('0x4a')][_0xa529('0x4c')]};}if(_0x544078[_0xa529('0x4d')]){_0x24ef01[_0xa529('0x4d')]={'id':_0x544078[_0xa529('0x4d')]['id'],'name':_0x544078[_0xa529('0x4d')][_0xa529('0x24')]};}var _0x229991=md5(JSON[_0xa529('0x4e')](_0x24ef01));if(_0x544078[_0xa529('0x3')]!==_0x229991){_0x544078[_0xa529('0x3')]=_0x229991;emit(util[_0xa529('0x4f')](_0xa529('0x50'),_0x24ef01[_0xa529('0x24')]),_0xa529('0x51'),_0x24ef01);}}}function emitVoiceQueueChannelRemove(_0x5e14f7){logger[_0xa529('0x52')](_0xa529('0x53'),JSON[_0xa529('0x4e')](_0x5e14f7));emit(util['format'](_0xa529('0x50'),_0x5e14f7[_0xa529('0x24')]),_0xa529('0x54'),_0x5e14f7);}function notSendMessagesQueue(_0xb26915){if(_0xb26915['sendMessageOneNotActive']){if(_0xb26915[_0xa529('0x46')]===0x0&&_0xb26915['pTalking']===0x0){_0xb26915['sendMessageOneNotActive']=![];_0xb26915[_0xa529('0x26')]=0x0;_0xb26915[_0xa529('0x55')]=0x0;_0xb26915[_0xa529('0x45')]='NOT_ACTIVE';ut['logger'](_0xa529('0x56'),_0xb26915[_0xa529('0x24')]+_0xa529('0x57'));}else{_0xb26915[_0xa529('0x45')]=_0xa529('0x58');ut[_0xa529('0x59')](_0xa529('0x56'),_0xb26915['name']+_0xa529('0x5a'));}emitCampaignPreview(_0xb26915);}}Preview['prototype'][_0xa529('0x21')]=function(){var _0x2b7d85=this;setInterval(function(){_0x2b7d85[_0xa529('0x5b')]();},0x7cf);};Preview[_0xa529('0xc')][_0xa529('0x5b')]=function(){var _0x1ccce2=this[_0xa529('0xf')];this['clockClearZombieChannels']+=0x1;for(var _0x53658b in _0x1ccce2){if(_0x1ccce2[_0xa529('0x5c')](_0x53658b)&&(_0x1ccce2[_0x53658b]['dialMethod']===_0xa529('0x5d')||_0x1ccce2[_0x53658b][_0xa529('0x30')]===_0xa529('0x5e'))&&_0x1ccce2[_0x53658b]['type']==='outbound'){if(this[_0xa529('0x5f')]>0x7){this[_0xa529('0x5f')]=0x0;this[_0xa529('0x60')]();}}if(_0x1ccce2['hasOwnProperty'](_0x53658b)&&_0x1ccce2[_0x53658b][_0xa529('0x30')]==='preview'&&_0x1ccce2[_0x53658b]['type']===_0xa529('0x61')){if(_0x1ccce2[_0x53658b]['dialActive']){this['setMessage'](_0x1ccce2[_0x53658b]);this[_0xa529('0x62')](_0x1ccce2[_0x53658b]);}else{notSendMessagesQueue(_0x1ccce2[_0x53658b]);}}}};Preview[_0xa529('0xc')][_0xa529('0x63')]=function(_0x3210f4){var _0x483adb=this;this[_0xa529('0x64')]['enqueue'](function(){if(!_[_0xa529('0x65')](_0x483adb[_0xa529('0x11')][_0x3210f4])){loggerAction[_0xa529('0x52')](_0xa529('0x66'),_0x3210f4,'Queue',_0x483adb[_0xa529('0x11')][_0x3210f4]['queue'],_0xa529('0x67'),JSON[_0xa529('0x4e')](_0x483adb[_0xa529('0xf')][_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x68')]][_0xa529('0x46')]),_0xa529('0x69'),JSON[_0xa529('0x4e')](_0x483adb[_0xa529('0xf')][_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x68')]]['pTalking']),JSON[_0xa529('0x4e')](_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x6a')]),JSON[_0xa529('0x4e')](_['pick'](_0x483adb[_0xa529('0x11')][_0x3210f4],[_0xa529('0x6b'),_0xa529('0x6c'),_0xa529('0x6d'),_0xa529('0x6e')])));return ami[_0xa529('0x6f')]({'action':_0xa529('0x70'),'channel':_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x71')]})[_0xa529('0x72')](function(_0xac60ff){if(_0xac60ff['message']===_0xa529('0x73')){setTimeout(function(){if(_0x483adb[_0xa529('0x11')][_0x3210f4]){ut['updateOriginated'](_0x483adb[_0xa529('0xf')][_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x68')]],'[clearZombieChannel]');if(_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x6a')]===!![]){ut['decrementTalkink'](_0x483adb[_0xa529('0xf')][_0x483adb['actions'][_0x3210f4]['queue']],_0xa529('0x74'));ut[_0xa529('0x75')](_0xa529('0x76')+_0x3210f4,_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x68')]);}ut[_0xa529('0x75')](_0xa529('0x77')+_0x3210f4,_0x483adb[_0xa529('0x11')][_0x3210f4][_0xa529('0x68')]);delete _0x483adb['actions'][_0x3210f4];}},0x2328);}});}});};Preview[_0xa529('0xc')][_0xa529('0x60')]=function(){var _0x3e4d50=this;loggerAction['info']('[action]',_['size'](this[_0xa529('0x11')]));for(var _0x3c2eec in this['actions']){if(_0x3e4d50[_0xa529('0x11')]['hasOwnProperty'](_0x3c2eec)){_0x3e4d50[_0xa529('0x63')](_0x3c2eec);}}};Preview[_0xa529('0xc')][_0xa529('0x62')]=function(_0x183c24){var _0x48bbc8=this;rpcDb[_0xa529('0x78')](_0x183c24['id'],ut['agentReadyId'](this['agents']))[_0xa529('0x79')](function(_0x57f274){if(!_[_0xa529('0x65')](_0x57f274)){for(var _0x274ba7=0x0;_0x274ba7<_0x57f274[_0xa529('0x7a')];_0x274ba7+=0x1){if(ut['getDiff'](_0x57f274[_0x274ba7][_0xa529('0x7b')])<_0x183c24[_0xa529('0x7c')]*0x3c){if(_0x57f274[_0x274ba7][_0xa529('0x7d')]&&!_0x57f274[_0x274ba7][_0xa529('0x7d')][_0xa529('0x7e')]){_0x48bbc8[_0xa529('0x7f')](_0x57f274[_0x274ba7]['id'])[_0xa529('0x79')](ut['logger2'](_0xa529('0x80')))[_0xa529('0x72')](ut['logger2'](_0xa529('0x80')));}else{rpcDb[_0xa529('0x81')](_0x57f274[_0x274ba7]['id']);}}else{var _0x511a17=new Action(_0x57f274[_0x274ba7],_0x183c24);_0x511a17[_0xa529('0x82')]=moment()[_0xa529('0x4f')](_0xa529('0x83'));_0x183c24[_0xa529('0x84')]+=0x1;ut[_0xa529('0x85')](_0x511a17,0x17,_0xa529('0x86'));if(_0x183c24[_0xa529('0x87')]){rpcDb[_0xa529('0x88')](ut[_0xa529('0x89')](_0x57f274[_0x274ba7]));rpcDb[_0xa529('0x8a')](_0x511a17,_0xa529('0x8b'));}else{ut[_0xa529('0x85')](_0x511a17,0x16,'RecallFailedTimeout');rpcDb[_0xa529('0x8a')](_0x511a17,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x511a17,_0xa529('0x8c'));}}}}})[_0xa529('0x72')](ut[_0xa529('0x8d')](_0xa529('0x8e')));};Preview[_0xa529('0xc')][_0xa529('0x8f')]=function(_0x1c8e5e){_0x1c8e5e[_0xa529('0x90')]=!![];if(ut[_0xa529('0x91')](_0x1c8e5e['loggedIn'])){_0x1c8e5e['message']=_0xa529('0x92');}else if(!ut['isActive'](_0x1c8e5e[_0xa529('0x93')])){_0x1c8e5e[_0xa529('0x45')]=_0xa529('0x94');}else if(!this['isTrunkReachable'](_0x1c8e5e[_0xa529('0x4a')])){if(!this[_0xa529('0x95')](_0x1c8e5e[_0xa529('0x96')])){_0x1c8e5e[_0xa529('0x45')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1c8e5e[_0xa529('0x45')]=_0xa529('0x97');}}else{_0x1c8e5e[_0xa529('0x45')]='ACTIVE';}emitCampaignPreview(_0x1c8e5e);};Preview[_0xa529('0xc')][_0xa529('0x98')]=function(_0x57699f,_0x520cb1,_0x7c73bf){var _0xbc58a0=this;var _0x3eac3d=this['actions'][_0x520cb1];var _0x542597=this[_0xa529('0xf')][_0x3eac3d[_0xa529('0x68')]];var _0x5ddc03;if(_0x542597){switch(_0x7c73bf){case'1':_0x542597[_0xa529('0x3b')]+=0x1;_0x3eac3d[_0xa529('0x99')]+=0x1;_0x3eac3d[_0xa529('0x9a')]=ut[_0xa529('0x9b')](_0x3eac3d);ut['logCustomer'](_0x3eac3d,0x0,'NoSuchNumber');ami[_0xa529('0x22')]('custom:agentnosuchnumber',ut[_0xa529('0x9c')](_0x3eac3d,'nosuchnumber'));rpcDb['createCustomerHistory'](_0x3eac3d,_0xa529('0x9d'));if(ut[_0xa529('0x9b')](_0x3eac3d)>=_0x542597[_0xa529('0x9e')]){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0xf,_0xa529('0xa0'));rpcDb[_0xa529('0xa1')](_0x5ddc03,_0xa529('0xa2'));}else{if(_0x3eac3d[_0xa529('0x99')]>=_0x542597['dialNoSuchNumberMaxRetry']){rpcDb[_0xa529('0xa1')](_0x3eac3d,_0xa529('0xa2'));}else{rpcDb[_0xa529('0xa3')](ut[_0xa529('0xa4')](_0x3eac3d,_0xa529('0x99'),_0x542597[_0xa529('0xa5')]),_0x3eac3d[_0xa529('0xa6')],_0x3eac3d[_0xa529('0xa7')]);}}delete this[_0xa529('0x11')][_0x57699f['linkedid']];break;case _0xa529('0xa8'):var _0x1fceea=moment()[_0xa529('0x4f')](_0xa529('0x83'));_0x3eac3d[_0xa529('0xa9')]=_0x1fceea;_0x3eac3d['answertime']=_0x1fceea;_0x3eac3d[_0xa529('0x6a')]=!![];_0x542597[_0xa529('0x28')]+=0x1;logger['info'](_0xa529('0xaa'),_0x3eac3d[_0xa529('0xab')],_0xa529('0xac'),_0x542597[_0xa529('0x24')],_0xa529('0x69'),_0x542597['pTalking']);ami['emit']('custom:agentconnect',ut[_0xa529('0x9c')](_0x3eac3d,_0xa529('0xad')));if(_0x542597[_0xa529('0xae')]){ami[_0xa529('0x22')]('custom:agentConnectPreview',ut[_0xa529('0xaf')](_0x3eac3d));}break;case'16':ami[_0xa529('0x22')](_0xa529('0xb0'),ut['buildObj'](_0x3eac3d,'complete'));emitVoiceQueueChannelRemove(ut[_0xa529('0x9c')](_0x3eac3d,_0xa529('0xb1')));_0x542597[_0xa529('0x35')]+=0x1;_0x542597[_0xa529('0x2c')]+=0x1;_0x542597[_0xa529('0xb2')]+=0x1;ut[_0xa529('0xb3')](_0x542597,_0xa529('0xb4'));_0x3eac3d[_0xa529('0x9a')]=ut[_0xa529('0x9b')](_0x3eac3d);ut['logCustomer'](_0x3eac3d,0x4,'Answer');rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xb5'));rpcDb[_0xa529('0xa1')](_0x3eac3d,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x3eac3d);_0x542597['sumDuration']+=_0x3eac3d[_0xa529('0xb6')];_0x542597[_0xa529('0x29')]+=_0x3eac3d['talktime'];logger[_0xa529('0x52')](_0xa529('0xb7'),_0x3eac3d[_0xa529('0xab')],'\x20Queue',_0x542597['name'],'pTalking:\x20',_0x542597[_0xa529('0x28')]);delete this[_0xa529('0x11')][_0x57699f[_0xa529('0xb8')]];break;case'BUSY':_0x542597[_0xa529('0x37')]+=0x1;_0x3eac3d['countbusyretry']+=0x1;_0x3eac3d[_0xa529('0x9a')]=ut[_0xa529('0x9b')](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0x5,_0xa529('0xb9'));ami[_0xa529('0x22')]('custom:agentbusy',ut[_0xa529('0x9c')](_0x3eac3d,_0xa529('0xba')));rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xbb'));if(ut['totalGlobal'](_0x3eac3d)>=_0x542597['dialGlobalMaxRetry']){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0xf,_0xa529('0xa0'));rpcDb[_0xa529('0xa1')](_0x5ddc03,_0xa529('0xbc'));}else{if(_0x3eac3d['countbusyretry']>=_0x542597[_0xa529('0xbd')]){rpcDb[_0xa529('0xa1')](_0x3eac3d,_0xa529('0xbb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3eac3d,_0xa529('0xbe'),_0x542597[_0xa529('0xbf')]),_0x3eac3d[_0xa529('0xa6')],_0x3eac3d[_0xa529('0xa7')]);}}break;case _0xa529('0xc0'):_0x542597['outboundNoAnswerCallsDay']+=0x1;_0x3eac3d[_0xa529('0xc1')]+=0x1;_0x3eac3d['countglobal']=ut[_0xa529('0x9b')](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0x3,_0xa529('0xc2'));ami[_0xa529('0x22')](_0xa529('0xc3'),ut['buildObj'](_0x3eac3d,_0xa529('0xc4')));rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xc5'));if(ut[_0xa529('0x9b')](_0x3eac3d)>=_0x542597[_0xa529('0x9e')]){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0xf,_0xa529('0xa0'));rpcDb[_0xa529('0xa1')](_0x5ddc03,_0xa529('0xc6'));}else{if(_0x3eac3d['countnoanswerretry']>=_0x542597['dialNoAnswerMaxRetry']){rpcDb[_0xa529('0xa1')](_0x3eac3d,_0xa529('0xc5'));}else{rpcDb[_0xa529('0xa3')](ut[_0xa529('0xa4')](_0x3eac3d,'countnoanswerretry',_0x542597[_0xa529('0xc7')]),_0x3eac3d[_0xa529('0xa6')],_0x3eac3d[_0xa529('0xa7')]);}}break;case _0xa529('0xc8'):_0x542597[_0xa529('0x38')]+=0x1;_0x3eac3d[_0xa529('0xc9')]+=0x1;_0x3eac3d[_0xa529('0x9a')]=ut['totalGlobal'](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0x8,_0xa529('0xca'));ami[_0xa529('0x22')](_0xa529('0xcb'),ut['buildObj'](_0x3eac3d,_0xa529('0xcc')));rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xcd'));if(ut['totalGlobal'](_0x3eac3d)>=_0x542597[_0xa529('0x9e')]){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0xf,_0xa529('0xa0'));rpcDb['createCustomerFinal'](_0x5ddc03,_0xa529('0xce'));}else{if(_0x3eac3d[_0xa529('0xc9')]>=_0x542597[_0xa529('0xcf')]){rpcDb[_0xa529('0xa1')](_0x3eac3d,_0xa529('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xa529('0xa4')](_0x3eac3d,_0xa529('0xc9'),_0x542597[_0xa529('0xbf')]),_0x3eac3d['unlockAgent'],_0x3eac3d['activeContact']);}}break;case _0xa529('0xd0'):_0x542597[_0xa529('0xd1')]+=0x1;_0x3eac3d[_0xa529('0xd2')]+=0x1;_0x3eac3d['countglobal']=ut[_0xa529('0x9b')](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0x14,'AgentReject');ami['emit'](_0xa529('0xd3'),ut[_0xa529('0x9c')](_0x3eac3d,_0xa529('0xd4')));rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xd5'));if(ut['totalGlobal'](_0x3eac3d)>=_0x542597['dialGlobalMaxRetry']){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0x14,_0xa529('0xd6'));rpcDb[_0xa529('0xa1')](_0x5ddc03,_0xa529('0xd7'));}else{if(_0x3eac3d['countagentrejectretry']>=_0x542597[_0xa529('0xd8')]){rpcDb[_0xa529('0xa1')](_0x3eac3d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3eac3d,_0xa529('0xd2'),_0x542597[_0xa529('0xd9')]),_0x3eac3d[_0xa529('0xa6')],_0x3eac3d[_0xa529('0xa7')]);}}break;case _0xa529('0xda'):_0x542597[_0xa529('0x3d')]+=0x1;_0x3eac3d[_0xa529('0xdb')]+=0x1;_0x3eac3d['countglobal']=ut[_0xa529('0x9b')](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0xb,_0xa529('0xdc'));rpcDb[_0xa529('0x8a')](_0x3eac3d,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x3eac3d)>=_0x542597[_0xa529('0x9e')]){_0x5ddc03=ut[_0xa529('0x9f')](_0x3eac3d,0xf,_0xa529('0xa0'));rpcDb['createCustomerFinal'](_0x5ddc03,_0xa529('0xdd'));}else{if(_0x3eac3d[_0xa529('0xde')]>=_0x542597[_0xa529('0xdf')]){rpcDb[_0xa529('0xa1')](_0x3eac3d,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xa529('0xa3')](ut[_0xa529('0xa4')](_0x3eac3d,_0xa529('0xdb'),_0x542597[_0xa529('0xe0')]),_0x3eac3d[_0xa529('0xa6')],_0x3eac3d[_0xa529('0xa7')]);}}break;default:if(_0x3eac3d[_0xa529('0x6a')]){ut[_0xa529('0xb3')](_0x542597,_0xa529('0xe1'));ut[_0xa529('0x75')](_0xa529('0xe2')+_0x542597[_0xa529('0x24')],_0x57699f);}_0x542597[_0xa529('0x3c')]+=0x1;_0x3eac3d[_0xa529('0x9a')]=ut['totalGlobal'](_0x3eac3d);ut[_0xa529('0x85')](_0x3eac3d,0xc,_0x57699f[_0xa529('0xe3')]||_0x57699f[_0xa529('0xe4')]);rpcDb[_0xa529('0x8a')](_0x3eac3d,_0xa529('0xe5'));if(ut['totalGlobal'](_0x3eac3d)>=_0x542597[_0xa529('0x9e')]){_0x5ddc03=ut['cloneAction'](_0x3eac3d,0xf,'Global');rpcDb[_0xa529('0xa1')](_0x5ddc03,_0xa529('0xe6'));}else{rpcDb[_0xa529('0xa1')](_0x3eac3d,_0xa529('0xe6'));}delete this[_0xa529('0x11')][_0x57699f[_0xa529('0xb8')]];}if(!(_0x3eac3d[_0xa529('0x6a')]&&_0x7c73bf==='16')){ut[_0xa529('0xe7')](_0x542597,_0xa529('0xe8'));logger[_0xa529('0x52')](_0xa529('0xe9'),_0x3eac3d[_0xa529('0xab')],_0xa529('0xac'),_0x542597[_0xa529('0x24')],'originated:\x20',_0x542597[_0xa529('0x46')]);}if(_0x7c73bf!==_0xa529('0xa8')){delete this['actions'][_0x57699f['linkedid']];delete this[_0xa529('0x11')][_0x57699f['destlinkedid']];}}};Preview[_0xa529('0xc')][_0xa529('0xea')]=function(_0x32f2a6,_0x47e50f,_0x57e0c4){if(_['isUndefined'](_0x47e50f)&&_0xa529('0xeb')!==typeof _0x47e50f){return;}if(_['isUndefined'](_0x57e0c4)&&_0xa529('0xeb')!==typeof _0x57e0c4){return;}switch(_0x57e0c4[_0xa529('0xec')]){case'0':ut[_0xa529('0xed')](_0x32f2a6,0x0,_0xa529('0xee'));rpcDb[_0xa529('0xef')](_0x32f2a6,_0xa529('0xf0'));break;case'3':ut[_0xa529('0xed')](_0x32f2a6,0x3,_0xa529('0xc2'));rpcDb[_0xa529('0xef')](_0x32f2a6,_0xa529('0xf1'));break;case'5':ut[_0xa529('0xed')](_0x32f2a6,0x5,_0xa529('0xb9'));rpcDb['createAgentHistory'](_0x32f2a6,_0xa529('0xf2'));break;case'8':ut['logAgent'](_0x32f2a6,0x8,_0xa529('0xca'));rpcDb[_0xa529('0xef')](_0x32f2a6,_0xa529('0xf3'));break;case'22':ut[_0xa529('0xed')](_0x32f2a6,0x16,'AnswerAGI');rpcDb[_0xa529('0xef')](_0x32f2a6,_0xa529('0xf4'));break;default:ut[_0xa529('0xed')](_0x32f2a6,0xc,_0x57e0c4['reason']);rpcDb['createAgentHistory'](_0x32f2a6,_0xa529('0xf3'));}ut[_0xa529('0xe7')](_0x47e50f,_0xa529('0xf5'));logger[_0xa529('0x52')](_0xa529('0xf6'),_0x32f2a6[_0xa529('0xab')],_0xa529('0xac'),_0x47e50f[_0xa529('0x24')],'originated:\x20',_0x47e50f[_0xa529('0x46')]);delete this[_0xa529('0x11')][_0x32f2a6[_0xa529('0xab')]];};Preview['prototype']['checkInBlack']=function(_0x59acd8,_0x288e66,_0x215d69,_0x324d6f,_0x5133c4){var _0x54af9c=this;return new BPromise(function(_0x4f7c9e,_0x45cd25){if(_[_0xa529('0x65')](_0x288e66)||_['isNil'](_0x288e66['Contact'])||_['isNil'](_0x288e66['Contact']['phone'])||_['isNil'](_0x288e66[_0xa529('0x6d')])){_0x45cd25(ut['message']('Contact\x20is\x20undefined',_0x324d6f,_0x5133c4));return;}var _0xfb805c=uuid['v4']();var _0x116f35=_0x54af9c[_0xa529('0xf')][_0x288e66[_0xa529('0xf7')]['name']];var _0x39fed0=_0x215d69?_0x54af9c['agents'][_0x215d69]['id']:undefined;_0x54af9c[_0xa529('0x11')][_0xfb805c]=new Action(_0x288e66,_0x116f35,_0xfb805c,_0x215d69,_0x39fed0);var _0x160764=_0x54af9c[_0xa529('0x11')][_0xfb805c];_0x160764[_0xa529('0xa6')]=_0x324d6f;_0x160764[_0xa529('0xa7')]=_0x5133c4;_0x160764[_0xa529('0xf8')]=_0x215d69;if(_['isEmpty'](_0x59acd8)){_0x54af9c[_0xa529('0xf9')](_0x160764,_0x116f35,_0x288e66,_0x215d69)['then'](function(_0x4f3d0e){logger['info']('[Preview][execCall][success]',_0xa529('0xfa')+_0x160764[_0xa529('0x68')]+_0xa529('0xfb')+_0x160764[_0xa529('0xfc')],JSON[_0xa529('0x4e')](_0x4f3d0e));ami['emit'](_0xa529('0xfd'),ut[_0xa529('0x9c')](_0x160764,_0xa529('0xfe')));_0x4f7c9e(ut[_0xa529('0x45')]('Calling'));})[_0xa529('0x72')](function(_0x17a1d4){ut['logger'](_0xa529('0xff'),_0x17a1d4);_0x45cd25(ut['message']('Call\x20failed',_0x324d6f,_0x5133c4));});}else{_0x116f35[_0xa529('0x36')]+=0x1;ut[_0xa529('0x100')](_0x160764);rpcDb[_0xa529('0x101')](_0x160764,'[Blacklist][error]');delete _0x54af9c[_0xa529('0x11')][_0xfb805c];_0x45cd25(ut[_0xa529('0x45')](_0xa529('0x102'),_0x324d6f,_0x5133c4));}});};Preview['prototype']['isTrunkReachable']=function(_0x25d319){return!_[_0xa529('0x65')](_0x25d319)&&!_[_0xa529('0x65')](_0x25d319[_0xa529('0x24')])&&!_['isNil'](_0x25d319[_0xa529('0x4b')])&&_0x25d319[_0xa529('0x4b')]&&!_[_0xa529('0x65')](this[_0xa529('0x103')][util[_0xa529('0x4f')]('SIP/%s',_0x25d319[_0xa529('0x24')])])&&!_[_0xa529('0x65')](this['trunks'][util[_0xa529('0x4f')](_0xa529('0x104'),_0x25d319[_0xa529('0x24')])][_0xa529('0x70')])&&(this['trunks'][util[_0xa529('0x4f')]('SIP/%s',_0x25d319[_0xa529('0x24')])][_0xa529('0x70')]==='reachable'||this[_0xa529('0x103')][util[_0xa529('0x4f')](_0xa529('0x104'),_0x25d319[_0xa529('0x24')])][_0xa529('0x70')]===_0xa529('0x105'));};Preview[_0xa529('0xc')][_0xa529('0x7f')]=function(_0x27452b,_0x3f9b1f){var _0x3b106b=this;return new BPromise(function(_0x4c05e0,_0x3bf7bf){_0x3b106b[_0xa529('0x106')](_0x27452b,_0x3f9b1f)[_0xa529('0x79')](function(_0x214bc2){_0x4c05e0(_['pick'](_0x214bc2,[_0xa529('0x45')]));})[_0xa529('0x72')](function(_0x38ac82){if(_0x38ac82[_0xa529('0x107')]){rpcDb[_0xa529('0x108')](_0x27452b);}if(_0x38ac82['active']){rpcDb[_0xa529('0x81')](_0x27452b);}_0x3bf7bf(_['pick'](_0x38ac82,[_0xa529('0x45')]));});});};Preview['prototype'][_0xa529('0x106')]=function(_0x1e2c9a,_0x57b612){var _0x596c42=this;return new BPromise(function(_0x53ed26,_0x4950f8){var _0x209cea,_0x3efda9;rpcDb['getContactPreview'](_0x1e2c9a)[_0xa529('0x79')](function(_0x48ab40){if(!_[_0xa529('0x65')](_0x48ab40[0x0])){_0x3efda9=_0x48ab40[0x0][_0xa529('0x109')]?![]:!![];_0x209cea=_0x48ab40[0x0][_0xa529('0x109')]?!![]:![];_0x209cea=_0x57b612?!![]:_0x209cea;}var _0x2886e=_0x596c42[_0xa529('0x10a')](_0x48ab40);if(_0x2886e[_0xa529('0x10b')]){rpcDb[_0xa529('0x10c')](_[_0xa529('0x10d')](_0x48ab40[0x0],[_0xa529('0x6d'),'Contact.phone']))[_0xa529('0x79')](function(_0x39b964){_0x596c42[_0xa529('0x10e')](_0x39b964,_0x48ab40[0x0],_0x57b612,_0x3efda9,_0x209cea)[_0xa529('0x79')](function(_0x2ce9da){_0x53ed26(_0x2ce9da);})['catch'](function(_0x845f3f){_0x4950f8(_0x845f3f);});})['catch'](function(_0x345acf){ut[_0xa529('0x59')](_0xa529('0x10f'),_0x345acf);_0x4950f8(ut[_0xa529('0x45')](_0xa529('0x110'),_0x3efda9,_0x209cea));});}else{_0x4950f8(ut[_0xa529('0x45')](_0x2886e[_0xa529('0x45')],_0x3efda9,_0x209cea));}})[_0xa529('0x72')](function(_0x5ae736){ut[_0xa529('0x59')](_0xa529('0x111'),_0x5ae736);_0x4950f8(ut['message'](_0xa529('0x110'),![],!![]));});});};Preview[_0xa529('0xc')]['validateContact']=function(_0x10f947){if(_[_0xa529('0x65')](_0x10f947)||_['isEmpty'](_0x10f947)||!_[_0xa529('0x65')](_0x10f947[0x0][_0xa529('0x7d')])&&_['isNil'](_0x10f947[0x0][_0xa529('0x7d')][_0xa529('0x24')])){ut[_0xa529('0x59')](_0xa529('0x112'),_0x10f947);return{'isValid':![],'message':_0xa529('0x113')};}var _0x5a83d0=this[_0xa529('0xf')][_0x10f947[0x0][_0xa529('0xf7')][_0xa529('0x24')]];_0x5a83d0[_0xa529('0x45')]='ACTIVE';if(_[_0xa529('0x65')](_0x5a83d0)){ut[_0xa529('0x59')](_0xa529('0x114'),_0x5a83d0);return{'isValid':![],'message':_0xa529('0x115')};}if(!this[_0xa529('0x95')](_0x5a83d0[_0xa529('0x4a')])){ut[_0xa529('0x59')](_0xa529('0x116'),'campaign\x20Name:\x20'+_0x5a83d0[_0xa529('0x24')]+_0xa529('0x117'));if(!this[_0xa529('0x95')](_0x5a83d0[_0xa529('0x96')])){ut[_0xa529('0x59')](_0xa529('0x116'),_0x5a83d0[_0xa529('0x24')]+_0xa529('0x118'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x5a83d0[_0xa529('0x93')])){ut[_0xa529('0x59')](_0xa529('0x119'),_0x5a83d0[_0xa529('0x24')]+_0xa529('0x11a'));return{'isValid':![],'message':_0xa529('0x11b')+_0x5a83d0[_0xa529('0x24')]+_0xa529('0x11a')};}return{'isValid':!![],'message':_0xa529('0x11c')};};Preview[_0xa529('0xc')]['execCall']=function(_0x3dc774,_0x319874,_0x5afe3f,_0x4e1799){var _0x36f3a8=this;return new BPromise(function(_0x5e9d13,_0xf83205){var _0x5d9fd2=_0x3dc774[_0xa529('0xab')];var _0xdbd2cf=_0x36f3a8['isTrunkReachable'](_0x319874[_0xa529('0x4a')])?util[_0xa529('0x4f')](_0xa529('0x11d'),_0x319874['Trunk']['name'],_[_0xa529('0x65')](_0x319874[_0xa529('0x33')])?'':_0x319874['dialPrefix'][_0xa529('0x11e')]()||'',_0x319874['dialCutDigit']>0x0?_0x5afe3f[_0xa529('0x11f')]['phone'][_0xa529('0x120')](_0x319874[_0xa529('0x121')]):_0x5afe3f[_0xa529('0x11f')]['phone']):util[_0xa529('0x4f')](_0xa529('0x11d'),_['isNil'](_0x319874[_0xa529('0x96')])?_0x319874[_0xa529('0x4a')][_0xa529('0x24')]:_0x319874[_0xa529('0x96')][_0xa529('0x24')],_[_0xa529('0x65')](_0x319874[_0xa529('0x33')])?'':_0x319874[_0xa529('0x33')][_0xa529('0x11e')]()||'',_0x319874[_0xa529('0x121')]>0x0?_0x5afe3f[_0xa529('0x11f')][_0xa529('0x122')]['substring'](_0x319874[_0xa529('0x121')]):_0x5afe3f[_0xa529('0x11f')]['phone']);var _0x1064bf=_0x36f3a8['isTrunkReachable'](_0x319874[_0xa529('0x4a')])?ut['getCallerId'](_0x319874['Trunk'][_0xa529('0x4c')],_0x319874['dialOriginateCallerIdName'],_0x319874['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa529('0x123')](_0x319874['dialOriginateCallerIdNumber'],_0x319874[_0xa529('0x124')]):_0x319874[_0xa529('0x125')]):ut[_0xa529('0x126')](_[_0xa529('0x65')](_0x319874[_0xa529('0x96')])?_0x319874[_0xa529('0x4a')][_0xa529('0x4c')]:_0x319874[_0xa529('0x96')][_0xa529('0x4c')],_0x319874['dialOriginateCallerIdName'],_0x319874[_0xa529('0x124')]>0x0?ut[_0xa529('0x123')](_0x319874[_0xa529('0x125')],_0x319874[_0xa529('0x124')]):_0x319874[_0xa529('0x125')]);if(_0x1064bf){_0x3dc774[_0xa529('0x127')]=ut['extractCalleridName'](_0x1064bf);_0x3dc774[_0xa529('0x128')]=ut['extractCalleridNumber'](_0x1064bf);}var _0x2d7818=ut[_0xa529('0x129')](_0x319874,_0x5afe3f,_0xdbd2cf,_0x1064bf,_0x5d9fd2,_0x3dc774);_[_0xa529('0x12a')](_0x3dc774,ut['toLowerVariables'](_0x2d7818));_0x3dc774['starttime']=moment()[_0xa529('0x4f')](_0xa529('0x83'));ami[_0xa529('0x6f')](ut['variablesAction'](_0x3dc774,_0x319874,_0x2d7818,_0x3dc774['activeContact'],_0x4e1799))[_0xa529('0x79')](function(_0x4833f1){_0x319874[_0xa529('0x46')]+=0x1;logger['info'](_0xa529('0x12b'),_0x5d9fd2,_0xa529('0xac'),_0x319874[_0xa529('0x24')],_0xa529('0x67'),_0x319874['originated']);_0x5e9d13(_0x4833f1);})[_0xa529('0x72')](function(_0x51ea79){ut['logAgent'](_0x3dc774,0xe,_0xa529('0x12c'));rpcDb[_0xa529('0xef')](_0x3dc774,_0xa529('0x12d'));_0xf83205(_0x51ea79);});});};Preview[_0xa529('0xc')][_0xa529('0x1c')]=function(_0x2dcd37){if(this[_0xa529('0x11')][_0x2dcd37[_0xa529('0xb8')]]){this['actions'][_0x2dcd37[_0xa529('0xb8')]][_0xa529('0x71')]=_0x2dcd37[_0xa529('0x71')];}};Preview[_0xa529('0xc')][_0xa529('0x14')]=function(_0x466ba4){var _0x54cdef=this;var _0xe37260=this['actions'][_0x466ba4[_0xa529('0x12e')]];if(_0xe37260){if(_0xe37260['lookAgent']&&this[_0xa529('0x12')][_0xe37260[_0xa529('0xf8')]]){ut[_0xa529('0x12f')](_0xe37260,this[_0xa529('0x12')][_0xe37260[_0xa529('0xf8')]][_0xa529('0x24')],this[_0xa529('0x12')][_0xe37260['lookAgent']]['id']);}var _0x4bb360=_[_0xa529('0x130')](_0xe37260);_0x4bb360[_0xa529('0xa9')]=moment()[_0xa529('0x4f')](_0xa529('0x83'));var _0x316dbf=_0x54cdef[_0xa529('0xf')][_0xe37260[_0xa529('0x68')]];if(ut[_0xa529('0x131')](_0x466ba4[_0xa529('0x132')])){if(_0xe37260[_0xa529('0xa6')]){rpcDb[_0xa529('0x108')](_0xe37260[_0xa529('0xfc')]);}if(_0xe37260[_0xa529('0xa7')]){rpcDb['disableContact'](_0xe37260[_0xa529('0xfc')]);}ami[_0xa529('0x22')](_0xa529('0x133'),ut[_0xa529('0x9c')](_0xe37260,_0xa529('0x134')));this[_0xa529('0xea')](_0x4bb360,_0x316dbf,_0x466ba4);}else{_0xe37260[_0xa529('0x82')]=moment()['format'](_0xa529('0x83'));ut[_0xa529('0xed')](_0x4bb360,0x4,_0xa529('0x135'));rpcDb[_0xa529('0xef')](_0x4bb360,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xa529('0x17')]=function(_0x51099e){var _0x15dbfa=this;var _0x406d38=this[_0xa529('0x11')][_0x51099e[_0xa529('0xb8')]];var _0x1adc70;if(_0x406d38){_0x1adc70=this['campaignsPreview'][_0x406d38['queue']];logger[_0xa529('0x52')](_0xa529('0x136'),_0x51099e[_0xa529('0xb8')],_0xa529('0xac'),_0x1adc70[_0xa529('0x24')],_0xa529('0x69'),_0x1adc70['pTalking']);}if(this['actions'][_0x51099e[_0xa529('0xb8')]]&&_0x51099e[_0xa529('0xb8')]!==_0x51099e[_0xa529('0xab')]){if(_0x51099e[_0xa529('0x137')]==='16'&&this[_0xa529('0x11')][_0x51099e[_0xa529('0xb8')]]['dialAnswer']){this[_0xa529('0x98')](_0x51099e,_0x51099e[_0xa529('0xb8')],_0x51099e[_0xa529('0x137')]);}else if(this[_0xa529('0x11')][_0x51099e['linkedid']][_0xa529('0x6a')]){logger[_0xa529('0x52')](_0xa529('0x138'),_0x51099e[_0xa529('0xb8')],_0x51099e[_0xa529('0x137')],_0xa529('0xac'),_0x1adc70['name'],_0xa529('0x69'),_0x1adc70[_0xa529('0x28')]);this[_0xa529('0x98')](_0x51099e,_0x51099e['linkedid'],_0x51099e[_0xa529('0x137')]);}}else if(_0x406d38&&_[_0xa529('0x65')](_0x406d38['statedesc'])&&_0x1adc70[_0xa529('0x139')]&&_0x51099e[_0xa529('0xb8')]===_0x51099e[_0xa529('0xab')]&&_[_0xa529('0x65')](_0x51099e[_0xa529('0xec')])&&_0x51099e[_0xa529('0x137')]==='16'&&_0x51099e[_0xa529('0x13a')]==='6'&&_[_0xa529('0x13b')](_0x406d38[_0xa529('0x13c')])){if(_0x406d38[_0xa529('0xa6')]){rpcDb[_0xa529('0x108')](_0x406d38[_0xa529('0xfc')]);}if(_0x406d38['activeContact']){rpcDb['disableContact'](_0x406d38[_0xa529('0xfc')]);}_0x51099e['reason']='22';this[_0xa529('0xea')](_0x406d38,_0x1adc70,_0x51099e);}else if(_0x406d38&&_0x406d38[_0xa529('0x13c')]){if(_0x51099e['cause']==='16'&&this[_0xa529('0x11')][_0x51099e[_0xa529('0xb8')]][_0xa529('0x6a')]){logger['info'](_0xa529('0x13d'),_0x51099e['linkedid'],_0x51099e[_0xa529('0x137')],'\x20Queue',_0x1adc70[_0xa529('0x24')],_0xa529('0x69'),_0x1adc70[_0xa529('0x28')]);this[_0xa529('0x98')](_0x51099e,_0x51099e[_0xa529('0xb8')],_0x51099e[_0xa529('0x137')]);}else if(this[_0xa529('0x11')][_0x51099e[_0xa529('0xb8')]][_0xa529('0x6a')]){logger[_0xa529('0x52')](_0xa529('0x138'),_0x51099e[_0xa529('0xb8')],_0x51099e[_0xa529('0x137')],_0xa529('0xac'),_0x1adc70[_0xa529('0x24')],_0xa529('0x69'),_0x1adc70[_0xa529('0x28')]);this[_0xa529('0x98')](_0x51099e,_0x51099e[_0xa529('0xb8')],_0x51099e[_0xa529('0x137')]);}}};Preview[_0xa529('0xc')][_0xa529('0x1a')]=function(_0x342816){if(this['actions'][_0x342816[_0xa529('0x13e')]]&&_0x342816[_0xa529('0x13e')]!==_0x342816['destuniqueid']){this[_0xa529('0x98')](_0x342816,_0x342816[_0xa529('0x13e')],_0x342816[_0xa529('0xe4')]);}};Preview['prototype'][_0xa529('0x18')]=function(_0x791d99){if(this[_0xa529('0x11')][_0x791d99['linkedid']]&&_0x791d99[_0xa529('0xb8')]!==_0x791d99[_0xa529('0xab')]&&!this['actions'][_0x791d99[_0xa529('0xb8')]][_0xa529('0x6a')]){if(_0x791d99[_0xa529('0x137')]==='1'){this['callProgressDetectingCustomer'](_0x791d99,_0x791d99[_0xa529('0xb8')],_0x791d99[_0xa529('0x137')]);}}};Preview[_0xa529('0xc')][_0xa529('0x13f')]=function(_0x275f12,_0x19d182,_0x451a8e){if(this[_0xa529('0x11')][_0x275f12]){if(_[_0xa529('0x65')](this[_0xa529('0x11')][_0x275f12][_0xa529('0x140')])){this[_0xa529('0x11')][_0x275f12][_0xa529('0x140')]={};}this[_0xa529('0x11')][_0x275f12][_0xa529('0x140')][_0x19d182]=_0x451a8e;}};Preview[_0xa529('0xc')][_0xa529('0x141')]=function(_0x45c564){try{if(!_[_0xa529('0x65')](_0x45c564)){if(ut[_0xa529('0x142')](_[_0xa529('0x143')](_0x45c564[_0xa529('0x144')])[0x0])){this[_0xa529('0x13f')](_0x45c564[_0xa529('0xab')],_[_0xa529('0x143')](_0x45c564[_0xa529('0x144')])[0x0],_0x45c564[_0xa529('0x145')]);}}}catch(_0x4b856b){logger[_0xa529('0x146')](_0xa529('0x147'),util[_0xa529('0x148')](_0x4b856b,{'showHidden':![],'depth':null}));}};Preview[_0xa529('0xc')][_0xa529('0x1f')]=function(_0x303743){if(_0x303743){if(this[_0xa529('0x11')][_0x303743['transfertargetlinkedid']]){this[_0xa529('0x11')][_0x303743[_0xa529('0x149')]][_0xa529('0x13c')]=!![];}}};Preview[_0xa529('0xc')][_0xa529('0x20')]=function(_0x21aa1c){if(_0x21aa1c){if(this[_0xa529('0x11')][_0x21aa1c[_0xa529('0x14a')]]){this['actions'][_0x21aa1c[_0xa529('0x14a')]]['transfer']=!![];}}};module[_0xa529('0x14b')]=Preview; \ No newline at end of file +var _0xf458=['TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','emit','custom:agentnosuchnumber','buildObj','nosuchnumber','createCustomerHistory','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','CANCEL','countagentrejectretry','custom:agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','isNil','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','dialCutDigit','SIP/%s/%s%s','trim','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','OriginateError','actionid','logLookAgent','clone','isFailure','response','idContact','rejected','[syncHangup][talking]','callProgressDetectingCustomer','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','redis','localhost','prototype','enqueue','tail','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','campaignsPreview','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','clearZombieChannels','outbound','setMessage','recallMe','clearZombieChannel','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','contactId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable'];(function(_0x46dccd,_0x1d7f8c){var _0x1b2da6=function(_0x57a1f1){while(--_0x57a1f1){_0x46dccd['push'](_0x46dccd['shift']());}};_0x1b2da6(++_0x1d7f8c);}(_0xf458,0xb5));var _0x8f45=function(_0x29fff2,_0x5a0b5b){_0x29fff2=_0x29fff2-0x0;var _0x597d9d=_0xf458[_0x29fff2];return _0x597d9d;};'use strict';var util=require(_0x8f45('0x0'));var _=require(_0x8f45('0x1'));var BPromise=require(_0x8f45('0x2'));var uuid=require('uuid');var moment=require(_0x8f45('0x3'));var md5=require(_0x8f45('0x4'));var Redis=require(_0x8f45('0x5'));var config=require(_0x8f45('0x6'));var logger=require('../../../config/logger')(_0x8f45('0x7'));var loggerAction=require(_0x8f45('0x8'))(_0x8f45('0x9'));var ami=require('../ami');var rpcDb=require(_0x8f45('0xa'));var Action=require(_0x8f45('0xb'));var ut=require(_0x8f45('0xc'));config['redis']=_['defaults'](config[_0x8f45('0xd')],{'host':_0x8f45('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8f45('0xd')]));var Sequence=function(){};Sequence[_0x8f45('0xf')][_0x8f45('0x10')]=function(_0x3fb275){this[_0x8f45('0x11')]=this[_0x8f45('0x11')]?this[_0x8f45('0x11')]['finally'](_0x3fb275):_0x3fb275();};function Preview(_0x442d84){this[_0x8f45('0x12')]=new Sequence();this['campaignsPreview']=_0x442d84[_0x8f45('0x13')];this[_0x8f45('0x14')]=_0x442d84[_0x8f45('0x14')];this[_0x8f45('0x15')]={};this[_0x8f45('0x16')]=_0x442d84[_0x8f45('0x16')];this[_0x8f45('0x17')]=0x0;ami['on'](_0x8f45('0x18'),this[_0x8f45('0x19')]['bind'](this));ami['on'](_0x8f45('0x1a'),this[_0x8f45('0x1b')][_0x8f45('0x1c')](this));ami['on'](_0x8f45('0x1d'),this[_0x8f45('0x1e')][_0x8f45('0x1c')](this));ami['on'](_0x8f45('0x1f'),this[_0x8f45('0x20')][_0x8f45('0x1c')](this));ami['on']('newexten',this[_0x8f45('0x21')][_0x8f45('0x1c')](this));ami['on']('varset',this['syncVarSet'][_0x8f45('0x1c')](this));ami['on'](_0x8f45('0x22'),this[_0x8f45('0x23')][_0x8f45('0x1c')](this));ami['on']('blindtransfer',this[_0x8f45('0x24')]['bind'](this));this['loopCampaigns'](this[_0x8f45('0x25')]);}function emit(_0x33e947,_0xecbae6,_0xe6e554){io['to'](_0x33e947)['emit'](_0xecbae6,_0xe6e554);}function emitCampaignPreview(_0x57bcd2){if(_0x57bcd2['type']==='outbound'){var _0x35a320={'id':_0x57bcd2['id'],'name':_0x57bcd2[_0x8f45('0x26')],'strategy':_0x57bcd2[_0x8f45('0x27')],'answered':_0x57bcd2[_0x8f45('0x28')],'available':_0x57bcd2[_0x8f45('0x29')],'loggedIn':_0x57bcd2[_0x8f45('0x2a')],'pTalking':_0x57bcd2[_0x8f45('0x2b')],'sumBillable':_0x57bcd2[_0x8f45('0x2c')],'sumDuration':_0x57bcd2['sumDuration'],'sumHoldTime':_0x57bcd2[_0x8f45('0x2d')]||0x0,'talking':_0x57bcd2['talking'],'total':_0x57bcd2[_0x8f45('0x2e')],'type':_0x57bcd2[_0x8f45('0x2f')],'unmanaged':_0x57bcd2[_0x8f45('0x30')],'abandoned':_0x57bcd2[_0x8f45('0x31')],'waiting':_0x57bcd2['waiting'],'loggedInDb':_0x57bcd2['loggedInDb'],'dialActive':_0x57bcd2[_0x8f45('0x32')],'dialMethod':_0x57bcd2[_0x8f45('0x33')],'dialOriginateCallerIdName':_0x57bcd2[_0x8f45('0x34')],'dialOriginateCallerIdNumber':_0x57bcd2[_0x8f45('0x35')],'dialOriginateTimeout':_0x57bcd2['dialOriginateTimeout'],'dialPrefix':_0x57bcd2['dialPrefix'],'outboundAnswerAgiCallsDay':_0x57bcd2[_0x8f45('0x36')],'outboundAnswerCallsDay':_0x57bcd2['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x57bcd2[_0x8f45('0x37')],'outboundBusyCallsDay':_0x57bcd2[_0x8f45('0x38')],'outboundCongestionCallsDay':_0x57bcd2[_0x8f45('0x39')],'outboundDropCallsDayACS':_0x57bcd2[_0x8f45('0x3a')],'outboundDropCallsDayCallersExit':_0x57bcd2[_0x8f45('0x3b')],'outboundDropCallsDayTimeout':_0x57bcd2[_0x8f45('0x3c')],'outboundNoAnswerCallsDay':_0x57bcd2['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x57bcd2['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x57bcd2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x57bcd2[_0x8f45('0x3d')],'outboundRejectCallsDay':_0x57bcd2[_0x8f45('0x3e')],'outboundUnknownCallsDay':_0x57bcd2['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x57bcd2[_0x8f45('0x3f')],'predictiveIntervalAnsweredCalls':_0x57bcd2['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x57bcd2[_0x8f45('0x40')],'predictiveIntervalAvgTalktime':_0x57bcd2['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x57bcd2[_0x8f45('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x57bcd2['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x57bcd2[_0x8f45('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x57bcd2[_0x8f45('0x43')],'predictiveIntervalHitRate':_0x57bcd2['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x57bcd2[_0x8f45('0x44')],'predictiveIntervalPauses':_0x57bcd2[_0x8f45('0x45')],'predictiveIntervalAvailable':_0x57bcd2[_0x8f45('0x46')],'predictiveIntervalTotalCalls':_0x57bcd2[_0x8f45('0x47')],'message':_0x57bcd2[_0x8f45('0x48')],'originated':_0x57bcd2[_0x8f45('0x49')],'erlangCalls':_0x57bcd2[_0x8f45('0x4a')],'erlangCallToSecond':_0x57bcd2[_0x8f45('0x4b')],'erlangAbandonmentRate':_0x57bcd2[_0x8f45('0x4c')],'erlangBusyFactor':_0x57bcd2[_0x8f45('0x4d')],'startPredictive':_0x57bcd2[_0x8f45('0x4e')],'startProgressive':_0x57bcd2[_0x8f45('0x4f')]};if(_0x57bcd2['Trunk']){_0x35a320[_0x8f45('0x50')]={'id':_0x57bcd2[_0x8f45('0x50')]['id'],'name':_0x57bcd2[_0x8f45('0x50')][_0x8f45('0x26')],'active':_0x57bcd2[_0x8f45('0x50')][_0x8f45('0x51')],'callerid':_0x57bcd2['Trunk'][_0x8f45('0x52')]};}if(_0x57bcd2['Interval']){_0x35a320['Interval']={'id':_0x57bcd2[_0x8f45('0x53')]['id'],'name':_0x57bcd2[_0x8f45('0x53')]['name']};}var _0x468f72=md5(JSON[_0x8f45('0x54')](_0x35a320));if(_0x57bcd2[_0x8f45('0x4')]!==_0x468f72){_0x57bcd2['md5']=_0x468f72;emit(util['format'](_0x8f45('0x55'),_0x35a320[_0x8f45('0x26')]),_0x8f45('0x56'),_0x35a320);}}}function emitVoiceQueueChannelRemove(_0x219d08){logger[_0x8f45('0x57')](_0x8f45('0x58'),JSON[_0x8f45('0x54')](_0x219d08));emit(util[_0x8f45('0x59')](_0x8f45('0x55'),_0x219d08['name']),_0x8f45('0x5a'),_0x219d08);}function notSendMessagesQueue(_0x470b97){if(_0x470b97['sendMessageOneNotActive']){if(_0x470b97[_0x8f45('0x49')]===0x0&&_0x470b97[_0x8f45('0x2b')]===0x0){_0x470b97[_0x8f45('0x5b')]=![];_0x470b97[_0x8f45('0x29')]=0x0;_0x470b97[_0x8f45('0x5c')]=0x0;_0x470b97[_0x8f45('0x48')]=_0x8f45('0x5d');ut[_0x8f45('0x5e')](_0x8f45('0x5f'),_0x470b97[_0x8f45('0x26')]+'\x20is\x20not\x20active');}else{_0x470b97[_0x8f45('0x48')]=_0x8f45('0x60');ut[_0x8f45('0x5e')](_0x8f45('0x5f'),_0x470b97[_0x8f45('0x26')]+_0x8f45('0x61'));}emitCampaignPreview(_0x470b97);}}Preview[_0x8f45('0xf')][_0x8f45('0x62')]=function(){var _0x4064b4=this;setInterval(function(){_0x4064b4[_0x8f45('0x63')]();},0x7cf);};Preview[_0x8f45('0xf')]['syncCampaigns']=function(){var _0x23ecc6=this[_0x8f45('0x25')];this[_0x8f45('0x17')]+=0x1;for(var _0x1f2ac2 in _0x23ecc6){if(_0x23ecc6['hasOwnProperty'](_0x1f2ac2)&&(_0x23ecc6[_0x1f2ac2][_0x8f45('0x33')]==='preview'||_0x23ecc6[_0x1f2ac2][_0x8f45('0x33')]===_0x8f45('0x64'))&&_0x23ecc6[_0x1f2ac2][_0x8f45('0x2f')]==='outbound'){if(this[_0x8f45('0x17')]>0x7){this[_0x8f45('0x17')]=0x0;this[_0x8f45('0x65')]();}}if(_0x23ecc6['hasOwnProperty'](_0x1f2ac2)&&_0x23ecc6[_0x1f2ac2][_0x8f45('0x33')]==='preview'&&_0x23ecc6[_0x1f2ac2]['type']===_0x8f45('0x66')){if(_0x23ecc6[_0x1f2ac2][_0x8f45('0x32')]){this[_0x8f45('0x67')](_0x23ecc6[_0x1f2ac2]);this[_0x8f45('0x68')](_0x23ecc6[_0x1f2ac2]);}else{notSendMessagesQueue(_0x23ecc6[_0x1f2ac2]);}}}};Preview['prototype'][_0x8f45('0x69')]=function(_0x2bdbd9){var _0x8180c5=this;this[_0x8f45('0x12')][_0x8f45('0x10')](function(){if(!_['isNil'](_0x8180c5[_0x8f45('0x15')][_0x2bdbd9])){loggerAction[_0x8f45('0x57')](_0x8f45('0x6a'),_0x2bdbd9,'Queue',_0x8180c5[_0x8f45('0x15')][_0x2bdbd9]['queue'],_0x8f45('0x6b'),JSON['stringify'](_0x8180c5[_0x8f45('0x25')][_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]]['originated']),_0x8f45('0x6d'),JSON[_0x8f45('0x54')](_0x8180c5['campaignsPreview'][_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]][_0x8f45('0x2b')]),JSON[_0x8f45('0x54')](_0x8180c5[_0x8f45('0x15')][_0x2bdbd9]['dialAnswer']),JSON[_0x8f45('0x54')](_['pick'](_0x8180c5[_0x8f45('0x15')][_0x2bdbd9],[_0x8f45('0x6e'),'UserId','VoiceQueueId',_0x8f45('0x6f')])));return ami[_0x8f45('0x70')]({'action':_0x8f45('0x71'),'channel':_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x72')]})[_0x8f45('0x73')](function(_0x496cb3){if(_0x496cb3[_0x8f45('0x48')]===_0x8f45('0x74')){setTimeout(function(){if(_0x8180c5['actions'][_0x2bdbd9]){ut[_0x8f45('0x75')](_0x8180c5['campaignsPreview'][_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]],_0x8f45('0x76'));if(_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x77')]===!![]){ut['decrementTalkink'](_0x8180c5[_0x8f45('0x25')][_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]],_0x8f45('0x76'));ut[_0x8f45('0x78')](_0x8f45('0x79')+_0x2bdbd9,_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]);}ut['loggerError'](_0x8f45('0x7a')+_0x2bdbd9,_0x8180c5[_0x8f45('0x15')][_0x2bdbd9][_0x8f45('0x6c')]);delete _0x8180c5['actions'][_0x2bdbd9];}},0x2328);}});}});};Preview[_0x8f45('0xf')][_0x8f45('0x65')]=function(){var _0x5e7013=this;loggerAction[_0x8f45('0x57')](_0x8f45('0x7b'),_[_0x8f45('0x7c')](this[_0x8f45('0x15')]));for(var _0x4ee55d in this[_0x8f45('0x15')]){if(_0x5e7013['actions']['hasOwnProperty'](_0x4ee55d)){_0x5e7013[_0x8f45('0x69')](_0x4ee55d);}}};Preview[_0x8f45('0xf')][_0x8f45('0x68')]=function(_0x15c5ba){var _0x2080cc=this;rpcDb[_0x8f45('0x7d')](_0x15c5ba['id'],ut[_0x8f45('0x7e')](this['agents']))[_0x8f45('0x7f')](function(_0xdad8a8){if(!_['isNil'](_0xdad8a8)){for(var _0x519dc1=0x0;_0x519dc1<_0xdad8a8[_0x8f45('0x80')];_0x519dc1+=0x1){if(ut[_0x8f45('0x81')](_0xdad8a8[_0x519dc1][_0x8f45('0x82')])<_0x15c5ba[_0x8f45('0x83')]*0x3c){if(_0xdad8a8[_0x519dc1][_0x8f45('0x84')]&&!_0xdad8a8[_0x519dc1][_0x8f45('0x84')][_0x8f45('0x85')]){_0x2080cc[_0x8f45('0x86')](_0xdad8a8[_0x519dc1]['id'])[_0x8f45('0x7f')](ut[_0x8f45('0x87')](_0x8f45('0x88')))[_0x8f45('0x73')](ut[_0x8f45('0x87')](_0x8f45('0x88')));}else{rpcDb[_0x8f45('0x89')](_0xdad8a8[_0x519dc1]['id']);}}else{var _0x2870a8=new Action(_0xdad8a8[_0x519dc1],_0x15c5ba);_0x2870a8[_0x8f45('0x8a')]=moment()[_0x8f45('0x59')](_0x8f45('0x8b'));_0x15c5ba[_0x8f45('0x3d')]+=0x1;ut['logCustomer'](_0x2870a8,0x17,_0x8f45('0x8c'));if(_0x15c5ba[_0x8f45('0x8d')]){rpcDb[_0x8f45('0x8e')](ut[_0x8f45('0x8f')](_0xdad8a8[_0x519dc1]));rpcDb['createCustomerHistory'](_0x2870a8,_0x8f45('0x90'));}else{ut[_0x8f45('0x91')](_0x2870a8,0x16,_0x8f45('0x92'));rpcDb['createCustomerHistory'](_0x2870a8,_0x8f45('0x93'));rpcDb['createCustomerFinal'](_0x2870a8,_0x8f45('0x93'));}}}}})[_0x8f45('0x73')](ut[_0x8f45('0x87')](_0x8f45('0x94')));};Preview[_0x8f45('0xf')][_0x8f45('0x67')]=function(_0x40295f){_0x40295f[_0x8f45('0x5b')]=!![];if(ut[_0x8f45('0x95')](_0x40295f['loggedIn'])){_0x40295f[_0x8f45('0x48')]=_0x8f45('0x96');}else if(!ut[_0x8f45('0x97')](_0x40295f['dialActive'])){_0x40295f[_0x8f45('0x48')]=_0x8f45('0x5d');}else if(!this[_0x8f45('0x98')](_0x40295f[_0x8f45('0x50')])){if(!this[_0x8f45('0x98')](_0x40295f[_0x8f45('0x99')])){_0x40295f[_0x8f45('0x48')]=_0x8f45('0x9a');}else{_0x40295f[_0x8f45('0x48')]=_0x8f45('0x9b');}}else{_0x40295f[_0x8f45('0x48')]='ACTIVE';}emitCampaignPreview(_0x40295f);};Preview[_0x8f45('0xf')]['callProgressDetectingCustomer']=function(_0x304cb4,_0x58b136,_0xd31f15){var _0x415299=this;var _0x21ea1c=this[_0x8f45('0x15')][_0x58b136];var _0x7b8215=this['campaignsPreview'][_0x21ea1c['queue']];var _0xa91a6c;if(_0x7b8215){switch(_0xd31f15){case'1':_0x7b8215[_0x8f45('0x9c')]+=0x1;_0x21ea1c[_0x8f45('0x9d')]+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut[_0x8f45('0x9f')](_0x21ea1c);ut['logCustomer'](_0x21ea1c,0x0,_0x8f45('0xa0'));ami[_0x8f45('0xa1')](_0x8f45('0xa2'),ut[_0x8f45('0xa3')](_0x21ea1c,_0x8f45('0xa4')));rpcDb[_0x8f45('0xa5')](_0x21ea1c,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut[_0x8f45('0xa7')](_0x21ea1c,0xf,_0x8f45('0xa8'));rpcDb[_0x8f45('0xa9')](_0xa91a6c,_0x8f45('0xaa'));}else{if(_0x21ea1c[_0x8f45('0x9d')]>=_0x7b8215[_0x8f45('0xab')]){rpcDb[_0x8f45('0xa9')](_0x21ea1c,_0x8f45('0xaa'));}else{rpcDb[_0x8f45('0xac')](ut[_0x8f45('0xad')](_0x21ea1c,_0x8f45('0x9d'),_0x7b8215[_0x8f45('0xae')]),_0x21ea1c[_0x8f45('0xaf')],_0x21ea1c[_0x8f45('0xb0')]);}}delete this['actions'][_0x304cb4[_0x8f45('0xb1')]];break;case _0x8f45('0xb2'):var _0x1f7bae=moment()[_0x8f45('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x21ea1c[_0x8f45('0xb3')]=_0x1f7bae;_0x21ea1c[_0x8f45('0xb4')]=_0x1f7bae;_0x21ea1c[_0x8f45('0x77')]=!![];_0x7b8215[_0x8f45('0x2b')]+=0x1;logger[_0x8f45('0x57')](_0x8f45('0xb5'),_0x21ea1c[_0x8f45('0xb6')],_0x8f45('0xb7'),_0x7b8215[_0x8f45('0x26')],_0x8f45('0x6d'),_0x7b8215['pTalking']);ami[_0x8f45('0xa1')](_0x8f45('0xb8'),ut[_0x8f45('0xa3')](_0x21ea1c,_0x8f45('0xb9')));if(_0x7b8215[_0x8f45('0xba')]){ami['emit'](_0x8f45('0xbb'),ut[_0x8f45('0xbc')](_0x21ea1c));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x8f45('0xa3')](_0x21ea1c,_0x8f45('0xbd')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x21ea1c,_0x8f45('0xbd')));_0x7b8215[_0x8f45('0xbe')]+=0x1;_0x7b8215[_0x8f45('0x2e')]+=0x1;_0x7b8215[_0x8f45('0x28')]+=0x1;ut[_0x8f45('0xbf')](_0x7b8215,_0x8f45('0xc0'));_0x21ea1c['countglobal']=ut[_0x8f45('0x9f')](_0x21ea1c);ut['logCustomer'](_0x21ea1c,0x4,_0x8f45('0xc1'));rpcDb[_0x8f45('0xa5')](_0x21ea1c,_0x8f45('0xc2'));rpcDb[_0x8f45('0xa9')](_0x21ea1c,_0x8f45('0xc3'));rpcDb[_0x8f45('0xc4')](_0x21ea1c);_0x7b8215['sumDuration']+=_0x21ea1c[_0x8f45('0xc5')];_0x7b8215['sumBillable']+=_0x21ea1c[_0x8f45('0xc5')];logger['info'](_0x8f45('0xc6'),_0x21ea1c[_0x8f45('0xb6')],_0x8f45('0xb7'),_0x7b8215[_0x8f45('0x26')],_0x8f45('0x6d'),_0x7b8215['pTalking']);delete this[_0x8f45('0x15')][_0x304cb4[_0x8f45('0xb1')]];break;case _0x8f45('0xc7'):_0x7b8215[_0x8f45('0x38')]+=0x1;_0x21ea1c[_0x8f45('0xc8')]+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut[_0x8f45('0x9f')](_0x21ea1c);ut['logCustomer'](_0x21ea1c,0x5,'Busy');ami[_0x8f45('0xa1')](_0x8f45('0xc9'),ut[_0x8f45('0xa3')](_0x21ea1c,'busy'));rpcDb['createCustomerHistory'](_0x21ea1c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut[_0x8f45('0xa7')](_0x21ea1c,0xf,_0x8f45('0xa8'));rpcDb[_0x8f45('0xa9')](_0xa91a6c,_0x8f45('0xca'));}else{if(_0x21ea1c[_0x8f45('0xc8')]>=_0x7b8215['dialBusyMaxRetry']){rpcDb[_0x8f45('0xa9')](_0x21ea1c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8f45('0xac')](ut[_0x8f45('0xad')](_0x21ea1c,_0x8f45('0xc8'),_0x7b8215[_0x8f45('0xcb')]),_0x21ea1c['unlockAgent'],_0x21ea1c[_0x8f45('0xb0')]);}}break;case'NOANSWER':_0x7b8215['outboundNoAnswerCallsDay']+=0x1;_0x21ea1c['countnoanswerretry']+=0x1;_0x21ea1c['countglobal']=ut['totalGlobal'](_0x21ea1c);ut[_0x8f45('0x91')](_0x21ea1c,0x3,_0x8f45('0xcc'));ami[_0x8f45('0xa1')]('custom:agentnoanswer',ut['buildObj'](_0x21ea1c,_0x8f45('0xcd')));rpcDb[_0x8f45('0xa5')](_0x21ea1c,_0x8f45('0xce'));if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut['cloneAction'](_0x21ea1c,0xf,_0x8f45('0xa8'));rpcDb[_0x8f45('0xa9')](_0xa91a6c,_0x8f45('0xcf'));}else{if(_0x21ea1c[_0x8f45('0xd0')]>=_0x7b8215[_0x8f45('0xd1')]){rpcDb[_0x8f45('0xa9')](_0x21ea1c,_0x8f45('0xce'));}else{rpcDb[_0x8f45('0xac')](ut[_0x8f45('0xad')](_0x21ea1c,_0x8f45('0xd0'),_0x7b8215['dialNoAnswerRetryFrequency']),_0x21ea1c[_0x8f45('0xaf')],_0x21ea1c['activeContact']);}}break;case _0x8f45('0xd2'):_0x7b8215['outboundCongestionCallsDay']+=0x1;_0x21ea1c['countcongestionretry']+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut['totalGlobal'](_0x21ea1c);ut[_0x8f45('0x91')](_0x21ea1c,0x8,_0x8f45('0xd3'));ami[_0x8f45('0xa1')](_0x8f45('0xd4'),ut[_0x8f45('0xa3')](_0x21ea1c,_0x8f45('0xd5')));rpcDb[_0x8f45('0xa5')](_0x21ea1c,_0x8f45('0xd6'));if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut[_0x8f45('0xa7')](_0x21ea1c,0xf,_0x8f45('0xa8'));rpcDb[_0x8f45('0xa9')](_0xa91a6c,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x21ea1c[_0x8f45('0xd7')]>=_0x7b8215['dialCongestionMaxRetry']){rpcDb[_0x8f45('0xa9')](_0x21ea1c,_0x8f45('0xd6'));}else{rpcDb[_0x8f45('0xac')](ut[_0x8f45('0xad')](_0x21ea1c,'countcongestionretry',_0x7b8215[_0x8f45('0xcb')]),_0x21ea1c['unlockAgent'],_0x21ea1c[_0x8f45('0xb0')]);}}break;case _0x8f45('0xd8'):_0x7b8215[_0x8f45('0x3e')]+=0x1;_0x21ea1c[_0x8f45('0xd9')]+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut['totalGlobal'](_0x21ea1c);ut[_0x8f45('0x91')](_0x21ea1c,0x14,'AgentReject');ami[_0x8f45('0xa1')](_0x8f45('0xda'),ut[_0x8f45('0xa3')](_0x21ea1c,'agentreject'));rpcDb[_0x8f45('0xa5')](_0x21ea1c,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x21ea1c)>=_0x7b8215['dialGlobalMaxRetry']){_0xa91a6c=ut[_0x8f45('0xa7')](_0x21ea1c,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0xa91a6c,_0x8f45('0xdb'));}else{if(_0x21ea1c['countagentrejectretry']>=_0x7b8215[_0x8f45('0xdc')]){rpcDb[_0x8f45('0xa9')](_0x21ea1c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x8f45('0xac')](ut[_0x8f45('0xad')](_0x21ea1c,_0x8f45('0xd9'),_0x7b8215['dialAgentRejectRetryFrequency']),_0x21ea1c['unlockAgent'],_0x21ea1c['activeContact']);}}break;case _0x8f45('0xdd'):_0x7b8215[_0x8f45('0x3f')]+=0x1;_0x21ea1c[_0x8f45('0xde')]+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut[_0x8f45('0x9f')](_0x21ea1c);ut[_0x8f45('0x91')](_0x21ea1c,0xb,_0x8f45('0xdf'));rpcDb['createCustomerHistory'](_0x21ea1c,_0x8f45('0xe0'));if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut[_0x8f45('0xa7')](_0x21ea1c,0xf,'Global');rpcDb['createCustomerFinal'](_0xa91a6c,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x21ea1c[_0x8f45('0xe1')]>=_0x7b8215[_0x8f45('0xe2')]){rpcDb[_0x8f45('0xa9')](_0x21ea1c,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x8f45('0xad')](_0x21ea1c,'countabandonedretry',_0x7b8215[_0x8f45('0xe3')]),_0x21ea1c[_0x8f45('0xaf')],_0x21ea1c[_0x8f45('0xb0')]);}}break;default:if(_0x21ea1c['dialAnswer']){ut[_0x8f45('0xbf')](_0x7b8215,'[default]');ut[_0x8f45('0x78')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x7b8215[_0x8f45('0x26')],_0x304cb4);}_0x7b8215[_0x8f45('0xe4')]+=0x1;_0x21ea1c[_0x8f45('0x9e')]=ut[_0x8f45('0x9f')](_0x21ea1c);ut['logCustomer'](_0x21ea1c,0xc,_0x304cb4['cause-txt']||_0x304cb4[_0x8f45('0xe5')]);rpcDb['createCustomerHistory'](_0x21ea1c,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x8f45('0x9f')](_0x21ea1c)>=_0x7b8215[_0x8f45('0xa6')]){_0xa91a6c=ut['cloneAction'](_0x21ea1c,0xf,_0x8f45('0xa8'));rpcDb[_0x8f45('0xa9')](_0xa91a6c,_0x8f45('0xe6'));}else{rpcDb[_0x8f45('0xa9')](_0x21ea1c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x304cb4['linkedid']];}if(!(_0x21ea1c['dialAnswer']&&_0xd31f15==='16')){ut[_0x8f45('0x75')](_0x7b8215,'[callProgressDetectingCustomer]');logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x21ea1c[_0x8f45('0xb6')],_0x8f45('0xb7'),_0x7b8215['name'],_0x8f45('0x6b'),_0x7b8215[_0x8f45('0x49')]);}if(_0xd31f15!==_0x8f45('0xb2')){delete this[_0x8f45('0x15')][_0x304cb4[_0x8f45('0xb1')]];delete this[_0x8f45('0x15')][_0x304cb4['destlinkedid']];}}};Preview[_0x8f45('0xf')][_0x8f45('0xe7')]=function(_0x25da9a,_0x29549d,_0x3f5a6f){if(_[_0x8f45('0xe8')](_0x29549d)&&_0x8f45('0xe9')!==typeof _0x29549d){return;}if(_[_0x8f45('0xe8')](_0x3f5a6f)&&_0x8f45('0xe9')!==typeof _0x3f5a6f){return;}switch(_0x3f5a6f[_0x8f45('0xea')]){case'0':ut[_0x8f45('0xeb')](_0x25da9a,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x25da9a,_0x8f45('0xec'));break;case'3':ut[_0x8f45('0xeb')](_0x25da9a,0x3,_0x8f45('0xcc'));rpcDb[_0x8f45('0xed')](_0x25da9a,_0x8f45('0xee'));break;case'5':ut['logAgent'](_0x25da9a,0x5,_0x8f45('0xef'));rpcDb[_0x8f45('0xed')](_0x25da9a,_0x8f45('0xf0'));break;case'8':ut['logAgent'](_0x25da9a,0x8,'Congestion');rpcDb[_0x8f45('0xed')](_0x25da9a,_0x8f45('0xf1'));break;case'22':ut[_0x8f45('0xeb')](_0x25da9a,0x16,'AnswerAGI');rpcDb[_0x8f45('0xed')](_0x25da9a,_0x8f45('0xf2'));break;default:ut[_0x8f45('0xeb')](_0x25da9a,0xc,_0x3f5a6f[_0x8f45('0xea')]);rpcDb[_0x8f45('0xed')](_0x25da9a,_0x8f45('0xf1'));}ut[_0x8f45('0x75')](_0x29549d,_0x8f45('0xf3'));logger[_0x8f45('0x57')](_0x8f45('0xf4'),_0x25da9a['uniqueid'],'\x20Queue',_0x29549d[_0x8f45('0x26')],_0x8f45('0x6b'),_0x29549d['originated']);delete this[_0x8f45('0x15')][_0x25da9a[_0x8f45('0xb6')]];};Preview['prototype'][_0x8f45('0xf5')]=function(_0x422446,_0x435100,_0x46188a,_0x4f7a7f,_0x4da3af){var _0x4e8a27=this;return new BPromise(function(_0x3f6a09,_0x5e22a7){if(_['isNil'](_0x435100)||_['isNil'](_0x435100[_0x8f45('0xf6')])||_[_0x8f45('0xf7')](_0x435100['Contact'][_0x8f45('0xf8')])||_[_0x8f45('0xf7')](_0x435100[_0x8f45('0xf9')])){_0x5e22a7(ut[_0x8f45('0x48')](_0x8f45('0xfa'),_0x4f7a7f,_0x4da3af));return;}var _0x1d9b50=uuid['v4']();var _0x166e9c=_0x4e8a27[_0x8f45('0x25')][_0x435100[_0x8f45('0xfb')][_0x8f45('0x26')]];var _0xd6b14b=_0x46188a?_0x4e8a27[_0x8f45('0x16')][_0x46188a]['id']:undefined;_0x4e8a27[_0x8f45('0x15')][_0x1d9b50]=new Action(_0x435100,_0x166e9c,_0x1d9b50,_0x46188a,_0xd6b14b);var _0x4eb250=_0x4e8a27[_0x8f45('0x15')][_0x1d9b50];_0x4eb250[_0x8f45('0xaf')]=_0x4f7a7f;_0x4eb250[_0x8f45('0xb0')]=_0x4da3af;_0x4eb250[_0x8f45('0xfc')]=_0x46188a;if(_[_0x8f45('0xfd')](_0x422446)){_0x4e8a27[_0x8f45('0xfe')](_0x4eb250,_0x166e9c,_0x435100,_0x46188a)['then'](function(_0x103377){logger[_0x8f45('0x57')](_0x8f45('0xff'),_0x8f45('0x100')+_0x4eb250['queue']+_0x8f45('0x101')+_0x4eb250['idContact'],JSON[_0x8f45('0x54')](_0x103377));ami[_0x8f45('0xa1')]('custom:agentcalled',ut[_0x8f45('0xa3')](_0x4eb250,'called'));_0x3f6a09(ut[_0x8f45('0x48')]('Calling'));})['catch'](function(_0x3b722a){ut['logger'](_0x8f45('0x102'),_0x3b722a);_0x5e22a7(ut[_0x8f45('0x48')](_0x8f45('0x103'),_0x4f7a7f,_0x4da3af));});}else{_0x166e9c[_0x8f45('0x37')]+=0x1;ut[_0x8f45('0x104')](_0x4eb250);rpcDb[_0x8f45('0x105')](_0x4eb250,_0x8f45('0x106'));delete _0x4e8a27[_0x8f45('0x15')][_0x1d9b50];_0x5e22a7(ut[_0x8f45('0x48')](_0x8f45('0x107'),_0x4f7a7f,_0x4da3af));}});};Preview[_0x8f45('0xf')]['isTrunkReachable']=function(_0x553858){return!_[_0x8f45('0xf7')](_0x553858)&&!_[_0x8f45('0xf7')](_0x553858[_0x8f45('0x26')])&&!_[_0x8f45('0xf7')](_0x553858[_0x8f45('0x51')])&&_0x553858[_0x8f45('0x51')]&&!_[_0x8f45('0xf7')](this[_0x8f45('0x14')][util[_0x8f45('0x59')](_0x8f45('0x108'),_0x553858[_0x8f45('0x26')])])&&!_[_0x8f45('0xf7')](this['trunks'][util['format'](_0x8f45('0x108'),_0x553858['name'])]['status'])&&(this['trunks'][util[_0x8f45('0x59')]('SIP/%s',_0x553858[_0x8f45('0x26')])][_0x8f45('0x71')]===_0x8f45('0x109')||this[_0x8f45('0x14')][util[_0x8f45('0x59')](_0x8f45('0x108'),_0x553858[_0x8f45('0x26')])][_0x8f45('0x71')]===_0x8f45('0x10a'));};Preview[_0x8f45('0xf')][_0x8f45('0x86')]=function(_0x21bf49,_0x367712){var _0x54bdb5=this;return new BPromise(function(_0x242841,_0x261b13){_0x54bdb5[_0x8f45('0x10b')](_0x21bf49,_0x367712)[_0x8f45('0x7f')](function(_0x54efd3){_0x242841(_[_0x8f45('0x10c')](_0x54efd3,[_0x8f45('0x48')]));})[_0x8f45('0x73')](function(_0x4198eb){if(_0x4198eb[_0x8f45('0x10d')]){rpcDb[_0x8f45('0x10e')](_0x21bf49);}if(_0x4198eb[_0x8f45('0x51')]){rpcDb['disableContact'](_0x21bf49);}_0x261b13(_[_0x8f45('0x10c')](_0x4198eb,[_0x8f45('0x48')]));});});};Preview['prototype'][_0x8f45('0x10b')]=function(_0x3d4fc0,_0x2cb675){var _0x4fa1d2=this;return new BPromise(function(_0xcc7023,_0x326a8f){var _0x13fe54,_0x19de78;rpcDb[_0x8f45('0x10f')](_0x3d4fc0)['then'](function(_0x54f1d1){if(!_[_0x8f45('0xf7')](_0x54f1d1[0x0])){_0x19de78=_0x54f1d1[0x0][_0x8f45('0x110')]?![]:!![];_0x13fe54=_0x54f1d1[0x0][_0x8f45('0x110')]?!![]:![];_0x13fe54=_0x2cb675?!![]:_0x13fe54;}var _0x20737b=_0x4fa1d2['validateContact'](_0x54f1d1);if(_0x20737b[_0x8f45('0x111')]){rpcDb[_0x8f45('0x112')](_[_0x8f45('0x10c')](_0x54f1d1[0x0],['VoiceQueueId',_0x8f45('0x113')]))[_0x8f45('0x7f')](function(_0x36d5d8){_0x4fa1d2['checkInBlack'](_0x36d5d8,_0x54f1d1[0x0],_0x2cb675,_0x19de78,_0x13fe54)[_0x8f45('0x7f')](function(_0x3d3c68){_0xcc7023(_0x3d3c68);})[_0x8f45('0x73')](function(_0xb35c22){_0x326a8f(_0xb35c22);});})['catch'](function(_0x18218d){ut[_0x8f45('0x5e')](_0x8f45('0x114'),_0x18218d);_0x326a8f(ut['message'](_0x8f45('0x115'),_0x19de78,_0x13fe54));});}else{_0x326a8f(ut[_0x8f45('0x48')](_0x20737b[_0x8f45('0x48')],_0x19de78,_0x13fe54));}})[_0x8f45('0x73')](function(_0x53bbd7){ut[_0x8f45('0x5e')](_0x8f45('0x116'),_0x53bbd7);_0x326a8f(ut['message'](_0x8f45('0x115'),![],!![]));});});};Preview[_0x8f45('0xf')][_0x8f45('0x117')]=function(_0x40abde){if(_['isNil'](_0x40abde)||_[_0x8f45('0xfd')](_0x40abde)||!_[_0x8f45('0xf7')](_0x40abde[0x0]['Agent'])&&_[_0x8f45('0xf7')](_0x40abde[0x0][_0x8f45('0x84')]['name'])){ut['logger'](_0x8f45('0x118'),_0x40abde);return{'isValid':![],'message':_0x8f45('0x119')};}var _0xfbcb7b=this['campaignsPreview'][_0x40abde[0x0]['Queue']['name']];_0xfbcb7b[_0x8f45('0x48')]=_0x8f45('0x9b');if(_['isNil'](_0xfbcb7b)){ut['logger'](_0x8f45('0x11a'),_0xfbcb7b);return{'isValid':![],'message':_0x8f45('0x11b')};}if(!this['isTrunkReachable'](_0xfbcb7b[_0x8f45('0x50')])){ut['logger'](_0x8f45('0x11c'),_0x8f45('0x11d')+_0xfbcb7b[_0x8f45('0x26')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0xfbcb7b['TrunkBackup'])){ut['logger'](_0x8f45('0x11c'),_0xfbcb7b[_0x8f45('0x26')]+_0x8f45('0x11e'));return{'isValid':![],'message':_0x8f45('0x11f')};}}if(!ut[_0x8f45('0x97')](_0xfbcb7b['dialActive'])){ut[_0x8f45('0x5e')](_0x8f45('0x120'),_0xfbcb7b[_0x8f45('0x26')]+_0x8f45('0x121'));return{'isValid':![],'message':_0x8f45('0x11d')+_0xfbcb7b['name']+_0x8f45('0x121')};}return{'isValid':!![],'message':_0x8f45('0x122')};};Preview[_0x8f45('0xf')][_0x8f45('0xfe')]=function(_0x99a95f,_0x9ab2fe,_0x1ae5d9,_0x5c5398){var _0x1f13dc=this;return new BPromise(function(_0x33e3d1,_0x3f79ff){var _0x575969=_0x99a95f[_0x8f45('0xb6')];var _0x385ed7=_0x1f13dc[_0x8f45('0x98')](_0x9ab2fe[_0x8f45('0x50')])?util[_0x8f45('0x59')]('SIP/%s/%s%s',_0x9ab2fe[_0x8f45('0x50')][_0x8f45('0x26')],_[_0x8f45('0xf7')](_0x9ab2fe[_0x8f45('0x123')])?'':_0x9ab2fe[_0x8f45('0x123')]['trim']()||'',_0x9ab2fe[_0x8f45('0x124')]>0x0?_0x1ae5d9[_0x8f45('0xf6')][_0x8f45('0xf8')]['substring'](_0x9ab2fe[_0x8f45('0x124')]):_0x1ae5d9[_0x8f45('0xf6')][_0x8f45('0xf8')]):util[_0x8f45('0x59')](_0x8f45('0x125'),_[_0x8f45('0xf7')](_0x9ab2fe[_0x8f45('0x99')])?_0x9ab2fe['Trunk'][_0x8f45('0x26')]:_0x9ab2fe[_0x8f45('0x99')][_0x8f45('0x26')],_['isNil'](_0x9ab2fe['dialPrefix'])?'':_0x9ab2fe[_0x8f45('0x123')][_0x8f45('0x126')]()||'',_0x9ab2fe[_0x8f45('0x124')]>0x0?_0x1ae5d9[_0x8f45('0xf6')][_0x8f45('0xf8')]['substring'](_0x9ab2fe[_0x8f45('0x124')]):_0x1ae5d9[_0x8f45('0xf6')][_0x8f45('0xf8')]);var _0x2fd887=_0x1f13dc[_0x8f45('0x98')](_0x9ab2fe[_0x8f45('0x50')])?ut['getCallerId'](_0x9ab2fe['Trunk']['callerid'],_0x9ab2fe[_0x8f45('0x34')],_0x9ab2fe[_0x8f45('0x127')]>0x0?ut['getCallerIdRandom'](_0x9ab2fe[_0x8f45('0x35')],_0x9ab2fe['dialRandomLastDigitCallerIdNumber']):_0x9ab2fe[_0x8f45('0x35')]):ut[_0x8f45('0x128')](_['isNil'](_0x9ab2fe['TrunkBackup'])?_0x9ab2fe[_0x8f45('0x50')][_0x8f45('0x52')]:_0x9ab2fe['TrunkBackup'][_0x8f45('0x52')],_0x9ab2fe[_0x8f45('0x34')],_0x9ab2fe[_0x8f45('0x127')]>0x0?ut[_0x8f45('0x129')](_0x9ab2fe['dialOriginateCallerIdNumber'],_0x9ab2fe[_0x8f45('0x127')]):_0x9ab2fe['dialOriginateCallerIdNumber']);if(_0x2fd887){_0x99a95f['originatecalleridname']=ut[_0x8f45('0x12a')](_0x2fd887);_0x99a95f[_0x8f45('0x12b')]=ut['extractCalleridNumber'](_0x2fd887);}var _0x58ca45=ut[_0x8f45('0x12c')](_0x9ab2fe,_0x1ae5d9,_0x385ed7,_0x2fd887,_0x575969,_0x99a95f);_[_0x8f45('0x12d')](_0x99a95f,ut[_0x8f45('0x12e')](_0x58ca45));_0x99a95f[_0x8f45('0x8a')]=moment()[_0x8f45('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut['variablesAction'](_0x99a95f,_0x9ab2fe,_0x58ca45,_0x99a95f[_0x8f45('0xb0')],_0x5c5398))[_0x8f45('0x7f')](function(_0x2c6c28){_0x9ab2fe[_0x8f45('0x49')]+=0x1;logger[_0x8f45('0x57')]('[originated][increment]',_0x575969,_0x8f45('0xb7'),_0x9ab2fe[_0x8f45('0x26')],_0x8f45('0x6b'),_0x9ab2fe[_0x8f45('0x49')]);_0x33e3d1(_0x2c6c28);})[_0x8f45('0x73')](function(_0x565dfd){ut[_0x8f45('0xeb')](_0x99a95f,0xe,_0x8f45('0x12f'));rpcDb[_0x8f45('0xed')](_0x99a95f,'[originateFailure][logOriginateFailure]');_0x3f79ff(_0x565dfd);});});};Preview[_0x8f45('0xf')][_0x8f45('0x21')]=function(_0x211d95){if(this[_0x8f45('0x15')][_0x211d95[_0x8f45('0xb1')]]){this[_0x8f45('0x15')][_0x211d95['linkedid']]['channel']=_0x211d95['channel'];}};Preview['prototype'][_0x8f45('0x19')]=function(_0x2aab44){var _0x1b3044=this;var _0x5ee3be=this[_0x8f45('0x15')][_0x2aab44[_0x8f45('0x130')]];if(_0x5ee3be){if(_0x5ee3be[_0x8f45('0xfc')]&&this[_0x8f45('0x16')][_0x5ee3be[_0x8f45('0xfc')]]){ut[_0x8f45('0x131')](_0x5ee3be,this['agents'][_0x5ee3be[_0x8f45('0xfc')]][_0x8f45('0x26')],this['agents'][_0x5ee3be[_0x8f45('0xfc')]]['id']);}var _0x50740b=_[_0x8f45('0x132')](_0x5ee3be);_0x50740b[_0x8f45('0xb3')]=moment()[_0x8f45('0x59')](_0x8f45('0x8b'));var _0x9020eb=_0x1b3044[_0x8f45('0x25')][_0x5ee3be[_0x8f45('0x6c')]];if(ut[_0x8f45('0x133')](_0x2aab44[_0x8f45('0x134')])){if(_0x5ee3be['unlockAgent']){rpcDb[_0x8f45('0x10e')](_0x5ee3be['idContact']);}if(_0x5ee3be[_0x8f45('0xb0')]){rpcDb[_0x8f45('0x89')](_0x5ee3be[_0x8f45('0x135')]);}ami[_0x8f45('0xa1')]('custom:agentringnoanswer',ut[_0x8f45('0xa3')](_0x5ee3be,_0x8f45('0x136')));this[_0x8f45('0xe7')](_0x50740b,_0x9020eb,_0x2aab44);}else{_0x5ee3be['starttime']=moment()[_0x8f45('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8f45('0xeb')](_0x50740b,0x4,_0x8f45('0xc1'));rpcDb[_0x8f45('0xed')](_0x50740b,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x8f45('0x1b')]=function(_0x3587c8){var _0x5127ce=this;var _0x3e12f4=this[_0x8f45('0x15')][_0x3587c8['linkedid']];var _0x20b2dc;if(_0x3e12f4){_0x20b2dc=this[_0x8f45('0x25')][_0x3e12f4['queue']];logger[_0x8f45('0x57')](_0x8f45('0x137'),_0x3587c8['linkedid'],_0x8f45('0xb7'),_0x20b2dc['name'],_0x8f45('0x6d'),_0x20b2dc[_0x8f45('0x2b')]);}if(this[_0x8f45('0x15')][_0x3587c8[_0x8f45('0xb1')]]&&_0x3587c8[_0x8f45('0xb1')]!==_0x3587c8['uniqueid']){if(_0x3587c8['cause']==='16'&&this['actions'][_0x3587c8['linkedid']][_0x8f45('0x77')]){this[_0x8f45('0x138')](_0x3587c8,_0x3587c8[_0x8f45('0xb1')],_0x3587c8[_0x8f45('0x139')]);}else if(this[_0x8f45('0x15')][_0x3587c8['linkedid']][_0x8f45('0x77')]){logger['info']('[syncHangup][talking][cause]',_0x3587c8[_0x8f45('0xb1')],_0x3587c8[_0x8f45('0x139')],_0x8f45('0xb7'),_0x20b2dc['name'],_0x8f45('0x6d'),_0x20b2dc[_0x8f45('0x2b')]);this['callProgressDetectingCustomer'](_0x3587c8,_0x3587c8['linkedid'],_0x3587c8[_0x8f45('0x139')]);}}else if(_0x3e12f4&&_[_0x8f45('0xf7')](_0x3e12f4[_0x8f45('0x13a')])&&_0x20b2dc[_0x8f45('0x13b')]&&_0x3587c8[_0x8f45('0xb1')]===_0x3587c8[_0x8f45('0xb6')]&&_['isNil'](_0x3587c8[_0x8f45('0xea')])&&_0x3587c8[_0x8f45('0x139')]==='16'&&_0x3587c8[_0x8f45('0x13c')]==='6'&&_[_0x8f45('0xe8')](_0x3e12f4[_0x8f45('0x13d')])){if(_0x3e12f4[_0x8f45('0xaf')]){rpcDb['unlockContact'](_0x3e12f4[_0x8f45('0x135')]);}if(_0x3e12f4[_0x8f45('0xb0')]){rpcDb[_0x8f45('0x89')](_0x3e12f4[_0x8f45('0x135')]);}_0x3587c8['reason']='22';this['callProgressDetectingAgent'](_0x3e12f4,_0x20b2dc,_0x3587c8);}else if(_0x3e12f4&&_0x3e12f4[_0x8f45('0x13d')]){if(_0x3587c8['cause']==='16'&&this['actions'][_0x3587c8[_0x8f45('0xb1')]]['dialAnswer']){logger[_0x8f45('0x57')](_0x8f45('0x13e'),_0x3587c8[_0x8f45('0xb1')],_0x3587c8[_0x8f45('0x139')],_0x8f45('0xb7'),_0x20b2dc[_0x8f45('0x26')],_0x8f45('0x6d'),_0x20b2dc[_0x8f45('0x2b')]);this[_0x8f45('0x138')](_0x3587c8,_0x3587c8[_0x8f45('0xb1')],_0x3587c8['cause']);}else if(this['actions'][_0x3587c8[_0x8f45('0xb1')]][_0x8f45('0x77')]){logger[_0x8f45('0x57')](_0x8f45('0x13f'),_0x3587c8[_0x8f45('0xb1')],_0x3587c8[_0x8f45('0x139')],_0x8f45('0xb7'),_0x20b2dc[_0x8f45('0x26')],'pTalking:\x20',_0x20b2dc[_0x8f45('0x2b')]);this[_0x8f45('0x138')](_0x3587c8,_0x3587c8['linkedid'],_0x3587c8[_0x8f45('0x139')]);}}};Preview['prototype'][_0x8f45('0x20')]=function(_0x8034f8){if(this['actions'][_0x8034f8['destlinkedid']]&&_0x8034f8[_0x8f45('0x140')]!==_0x8034f8[_0x8f45('0x141')]){this[_0x8f45('0x138')](_0x8034f8,_0x8034f8[_0x8f45('0x140')],_0x8034f8[_0x8f45('0xe5')]);}};Preview[_0x8f45('0xf')][_0x8f45('0x1e')]=function(_0x4a63ae){if(this[_0x8f45('0x15')][_0x4a63ae[_0x8f45('0xb1')]]&&_0x4a63ae[_0x8f45('0xb1')]!==_0x4a63ae[_0x8f45('0xb6')]&&!this[_0x8f45('0x15')][_0x4a63ae[_0x8f45('0xb1')]]['dialAnswer']){if(_0x4a63ae[_0x8f45('0x139')]==='1'){this[_0x8f45('0x138')](_0x4a63ae,_0x4a63ae[_0x8f45('0xb1')],_0x4a63ae[_0x8f45('0x139')]);}}};Preview['prototype'][_0x8f45('0x142')]=function(_0x5d7241,_0x5de9e1,_0x2169e5){if(this['actions'][_0x5d7241]){if(_[_0x8f45('0xf7')](this[_0x8f45('0x15')][_0x5d7241][_0x8f45('0x143')])){this['actions'][_0x5d7241][_0x8f45('0x143')]={};}this[_0x8f45('0x15')][_0x5d7241]['variables'][_0x5de9e1]=_0x2169e5;}};Preview[_0x8f45('0xf')][_0x8f45('0x144')]=function(_0x2140f5){try{if(!_[_0x8f45('0xf7')](_0x2140f5)){if(ut[_0x8f45('0x145')](_[_0x8f45('0x146')](_0x2140f5[_0x8f45('0x147')])[0x0])){this[_0x8f45('0x142')](_0x2140f5[_0x8f45('0xb6')],_[_0x8f45('0x146')](_0x2140f5[_0x8f45('0x147')])[0x0],_0x2140f5[_0x8f45('0x148')]);}}}catch(_0x2017c8){logger[_0x8f45('0x149')]('[syncVarSet][Preview]',util[_0x8f45('0x14a')](_0x2017c8,{'showHidden':![],'depth':null}));}};Preview[_0x8f45('0xf')][_0x8f45('0x23')]=function(_0x13c63c){if(_0x13c63c){if(this[_0x8f45('0x15')][_0x13c63c[_0x8f45('0x14b')]]){this[_0x8f45('0x15')][_0x13c63c[_0x8f45('0x14b')]][_0x8f45('0x13d')]=!![];}}};Preview['prototype'][_0x8f45('0x24')]=function(_0x5cd64e){if(_0x5cd64e){if(this[_0x8f45('0x15')][_0x5cd64e['transfererlinkedid']]){this[_0x8f45('0x15')][_0x5cd64e[_0x8f45('0x14c')]][_0x8f45('0x13d')]=!![];}}};module[_0x8f45('0x14d')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d815a34..8a7584e 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 _0x425d=['[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact'];(function(_0x2472a6,_0x5f2d82){var _0x5c04b9=function(_0x184f77){while(--_0x184f77){_0x2472a6['push'](_0x2472a6['shift']());}};_0x5c04b9(++_0x5f2d82);}(_0x425d,0x1e0));var _0xd425=function(_0x1335f5,_0x1d6f12){_0x1335f5=_0x1335f5-0x0;var _0xa78c23=_0x425d[_0x1335f5];return _0xa78c23;};'use strict';var util=require(_0xd425('0x0'));var BPromise=require('bluebird');var logger=require(_0xd425('0x1'))(_0xd425('0x2'));var _=require(_0xd425('0x3'));var cmHopper=require(_0xd425('0x4'));var cmHopperFinal=require(_0xd425('0x5'));var cmHopperHistory=require(_0xd425('0x6'));var cmHopperBlack=require(_0xd425('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xd425('0x8'));var voiceQueueReport=require(_0xd425('0x9'));function loggerCatch(_0xc4e080){return function(_0x36866e){logger[_0xd425('0xa')](_0xc4e080,util[_0xd425('0xb')](_0x36866e,{'showHidden':![],'depth':null}));};}function create(_0x50b061){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopperHistory[_0xd425('0xe')](_0x50b061))[_0xd425('0xf')](loggerCatch(_0xd425('0x10')));}function createAgent(_0x2beb20){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](agentReportPreview[_0xd425('0xe')](_0x2beb20))[_0xd425('0xf')](loggerCatch(_0xd425('0x10')));}function moveContact(_0x10d463){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper[_0xd425('0x11')](_0x10d463,!![]))[_0xd425('0xf')](loggerCatch(_0xd425('0x12')));}exports[_0xd425('0x13')]=function(_0x3b5de8){return BPromise[_0xd425('0xc')]()['then'](cmHopperBlack[_0xd425('0x13')](_0x3b5de8))[_0xd425('0xf')](loggerCatch(_0xd425('0x14')));};exports['getContactPreview']=function(_0x309263){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper[_0xd425('0x15')](_0x309263))[_0xd425('0xf')](loggerCatch('[getContactPreview]\x20'));};exports[_0xd425('0xe')]=function(_0x471267,_0x7e267e){create(_0x471267)[_0xd425('0xf')](loggerCatch(_0x7e267e));moveContact(_0x471267)['catch'](loggerCatch(_0x7e267e));};exports[_0xd425('0x16')]=function(_0x434d97,_0x467a6c){createAgent(_0x434d97)[_0xd425('0xf')](loggerCatch(_0x467a6c));};exports['createCustomerHistory']=function(_0x58a0c1,_0x5debc3){create(_0x58a0c1)['catch'](loggerCatch(_0x5debc3));};exports[_0xd425('0x17')]=function(_0xb92870,_0x3c98db){moveContact(_0xb92870)['catch'](loggerCatch(_0x3c98db));};exports[_0xd425('0x18')]=function(_0x7e982e,_0x5f1e7e,_0x2e1ec4){if(_0x5f1e7e){_0x7e982e[_0xd425('0x19')]=null;}if(_0x2e1ec4){_0x7e982e[_0xd425('0x1a')]=![];}return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper[_0xd425('0x18')](_0x7e982e))[_0xd425('0xf')](loggerCatch(_0xd425('0x1b')));};exports[_0xd425('0x1c')]=function(_0x2b030b){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper['countReScheduled'](_0x2b030b))[_0xd425('0xf')](loggerCatch(_0xd425('0x1d')));};exports[_0xd425('0x1e')]=function(_0x1908a5){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper[_0xd425('0x1e')]({'UserId':null},_0x1908a5,0x1))['catch'](loggerCatch(_0xd425('0x1f')));};exports[_0xd425('0x20')]=function(_0x1d8861){return BPromise['resolve']()[_0xd425('0xd')](cmHopper[_0xd425('0x1e')]({'active':![]},_0x1d8861,0x1))[_0xd425('0xf')](loggerCatch(_0xd425('0x21')));};exports[_0xd425('0x22')]=function(_0x185d7e){var _0x2fd17a={};_0x2fd17a[_0xd425('0x23')]=_0x185d7e[_0xd425('0x23')];_0x2fd17a[_0xd425('0x24')]=_0x185d7e['uniqueid'];_0x2fd17a[_0xd425('0x25')]=_0x185d7e[_0xd425('0x25')];_0x2fd17a[_0xd425('0x26')]=_0x185d7e[_0xd425('0x26')];_0x2fd17a[_0xd425('0x27')]=_0x185d7e[_0xd425('0x27')];_0x2fd17a[_0xd425('0x28')]=_0x185d7e[_0xd425('0x29')];_0x2fd17a[_0xd425('0x2a')]=_0x185d7e[_0xd425('0x29')];_0x2fd17a[_0xd425('0x2b')]=0x1;_0x2fd17a['queuecallercompleteAt']=_0x185d7e[_0xd425('0x2c')];_0x2fd17a[_0xd425('0x2d')]=_0x185d7e[_0xd425('0x2e')];_0x2fd17a[_0xd425('0x2f')]=_0xd425('0x30');_0x2fd17a['exten']=_0xd425('0x31');_0x2fd17a[_0xd425('0x32')]=0x0;_0x2fd17a['assigned']=0x1;_0x2fd17a['lastAssignedTo']=_0x185d7e['membername'];_0x2fd17a[_0xd425('0x33')]=_0xd425('0x34');return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](voiceQueueReport['create'](_0x2fd17a))[_0xd425('0xf')](loggerCatch(_0xd425('0x35')));};exports[_0xd425('0x36')]=function(_0x1c7f72,_0x27b9e2){return BPromise[_0xd425('0xc')]()[_0xd425('0xd')](cmHopper['getContactRecallMe'](_0x1c7f72,_0x27b9e2))[_0xd425('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xd425('0x37')]=function(_0x29cca9){return BPromise[_0xd425('0xc')]()['then'](cmHopper[_0xd425('0x18')](_0x29cca9,!![],!![]))[_0xd425('0xf')](loggerCatch(_0xd425('0x38')));}; \ No newline at end of file +var _0xabce=['catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','error','resolve','then'];(function(_0x20896e,_0xcea268){var _0x1d11d0=function(_0x4a3b7f){while(--_0x4a3b7f){_0x20896e['push'](_0x20896e['shift']());}};_0x1d11d0(++_0xcea268);}(_0xabce,0x103));var _0xeabc=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xabce[_0x266618];return _0x54dbf5;};'use strict';var util=require(_0xeabc('0x0'));var BPromise=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var _=require(_0xeabc('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xeabc('0x5'));var cmHopperBlack=require(_0xeabc('0x6'));var voiceQueueRt=require(_0xeabc('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1b07a8){return function(_0x52a4d7){logger[_0xeabc('0x8')](_0x1b07a8,util['inspect'](_0x52a4d7,{'showHidden':![],'depth':null}));};}function create(_0x3bdc29){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](cmHopperHistory['createHistory'](_0x3bdc29))[_0xeabc('0xb')](loggerCatch(_0xeabc('0xc')));}function createAgent(_0x2f73e9){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](agentReportPreview[_0xeabc('0xd')](_0x2f73e9))[_0xeabc('0xb')](loggerCatch(_0xeabc('0xc')));}function moveContact(_0xdb5022){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](cmHopper[_0xeabc('0xe')](_0xdb5022,!![]))[_0xeabc('0xb')](loggerCatch(_0xeabc('0xf')));}exports[_0xeabc('0x10')]=function(_0xcfbf06){return BPromise['resolve']()[_0xeabc('0xa')](cmHopperBlack[_0xeabc('0x10')](_0xcfbf06))[_0xeabc('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x3170ea){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](cmHopper['getContactPreview'](_0x3170ea))[_0xeabc('0xb')](loggerCatch(_0xeabc('0x11')));};exports['createHistory']=function(_0x53fe28,_0x10fa8e){create(_0x53fe28)['catch'](loggerCatch(_0x10fa8e));moveContact(_0x53fe28)[_0xeabc('0xb')](loggerCatch(_0x10fa8e));};exports[_0xeabc('0x12')]=function(_0x58a3c0,_0x16f08b){createAgent(_0x58a3c0)[_0xeabc('0xb')](loggerCatch(_0x16f08b));};exports[_0xeabc('0x13')]=function(_0x384be5,_0x5e30ee){create(_0x384be5)['catch'](loggerCatch(_0x5e30ee));};exports[_0xeabc('0x14')]=function(_0x4d68ea,_0x31201a){moveContact(_0x4d68ea)[_0xeabc('0xb')](loggerCatch(_0x31201a));};exports['rescheduleContact']=function(_0x28063a,_0x41d67a,_0x254590){if(_0x41d67a){_0x28063a[_0xeabc('0x15')]=null;}if(_0x254590){_0x28063a[_0xeabc('0x16')]=![];}return BPromise['resolve']()[_0xeabc('0xa')](cmHopper[_0xeabc('0x17')](_0x28063a))[_0xeabc('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xeabc('0x18')]=function(_0x3854d2){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](cmHopper['countReScheduled'](_0x3854d2))[_0xeabc('0xb')](loggerCatch('[countReScheduled]\x20'));};exports[_0xeabc('0x19')]=function(_0x4d4e29){return BPromise[_0xeabc('0x9')]()[_0xeabc('0xa')](cmHopper[_0xeabc('0x19')]({'UserId':null},_0x4d4e29,0x1))[_0xeabc('0xb')](loggerCatch(_0xeabc('0x1a')));};exports[_0xeabc('0x1b')]=function(_0x131722){return BPromise['resolve']()['then'](cmHopper[_0xeabc('0x19')]({'active':![]},_0x131722,0x1))['catch'](loggerCatch(_0xeabc('0x1c')));};exports[_0xeabc('0x1d')]=function(_0x48fb52){var _0x2163e6={};_0x2163e6[_0xeabc('0x1e')]=_0x48fb52[_0xeabc('0x1e')];_0x2163e6[_0xeabc('0x1f')]=_0x48fb52[_0xeabc('0x1f')];_0x2163e6[_0xeabc('0x20')]=_0x48fb52[_0xeabc('0x20')];_0x2163e6[_0xeabc('0x21')]=_0x48fb52[_0xeabc('0x21')];_0x2163e6['queue']=_0x48fb52[_0xeabc('0x22')];_0x2163e6['queuecallerjoinAt']=_0x48fb52[_0xeabc('0x23')];_0x2163e6[_0xeabc('0x24')]=_0x48fb52[_0xeabc('0x23')];_0x2163e6[_0xeabc('0x25')]=0x1;_0x2163e6[_0xeabc('0x26')]=_0x48fb52[_0xeabc('0x27')];_0x2163e6[_0xeabc('0x28')]=_0x48fb52['membername'];_0x2163e6[_0xeabc('0x29')]=_0xeabc('0x2a');_0x2163e6[_0xeabc('0x2b')]='xcally-motion-preview';_0x2163e6[_0xeabc('0x2c')]=0x0;_0x2163e6[_0xeabc('0x2d')]=0x1;_0x2163e6[_0xeabc('0x2e')]=_0x48fb52['membername'];_0x2163e6[_0xeabc('0x2f')]=_0xeabc('0x30');return BPromise[_0xeabc('0x9')]()['then'](voiceQueueReport[_0xeabc('0x31')](_0x2163e6))[_0xeabc('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x254568,_0x3829a9){return BPromise['resolve']()[_0xeabc('0xa')](cmHopper[_0xeabc('0x32')](_0x254568,_0x3829a9))[_0xeabc('0xb')](loggerCatch(_0xeabc('0x33')));};exports[_0xeabc('0x34')]=function(_0x4b7923){return BPromise[_0xeabc('0x9')]()['then'](cmHopper[_0xeabc('0x17')](_0x4b7923,!![],!![]))[_0xeabc('0xb')](loggerCatch(_0xeabc('0x35')));}; \ 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 ddb9910..667afbb 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 _0x676c=['logger2','message','getCallerId','string','isEmpty','\x22%s\x22\x20<%s>','format','isUndefined','isActive','addVariables','calleridname','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','logAgent','responsetime','ringtime','starttime','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','buildAcw','interface','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','countglobal','callback','callbackuniqueid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','logger','info','loggerError','error'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc676('0x0'));var _=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var logger=require('../../../../config/logger')(_0xc676('0x3'));var ipAgi=process[_0xc676('0x4')][_0xc676('0x5')]||_0xc676('0x6');function getSeconds(_0x22b173,_0x2802bf){var _0x4e82ea=moment(_0x22b173)[_0xc676('0x7')](0x0);var _0x228e07=moment(_0x2802bf)[_0xc676('0x7')](0x0);return _0x4e82ea[_0xc676('0x8')](_0x228e07,_0xc676('0x9'));}exports['loggerCatch']=function(_0x26ad9c){return function(_0x5e8ad4){logger['error'](_0x26ad9c,util[_0xc676('0xa')](_0x5e8ad4,{'showHidden':![],'depth':null}));};};exports[_0xc676('0xb')]=function(_0x4aa733,_0x5085b6){logger[_0xc676('0xc')](_0x4aa733,util[_0xc676('0xa')](_0x5085b6,{'showHidden':![],'depth':null}));};exports[_0xc676('0xd')]=function(_0x4e72ff,_0x5c9329){logger[_0xc676('0xe')](_0x4e72ff,util[_0xc676('0xa')](_0x5c9329,{'showHidden':![],'depth':null}));};exports[_0xc676('0xf')]=function(_0x1e06ec){return function(_0x5e8565){logger[_0xc676('0xc')](_0x1e06ec,util[_0xc676('0xa')](_0x5e8565,{'showHidden':![],'depth':null}));};};exports[_0xc676('0x10')]=function(_0x23184f,_0x47adff,_0xcee1c5){return{'message':_0x23184f,'unlock':_0x47adff,'active':_0xcee1c5};};exports[_0xc676('0x11')]=function(_0x4f8832,_0x274463,_0x4fbfb7){if(!_['isUndefined'](_0x4fbfb7)&&_0xc676('0x12')===typeof _0x4fbfb7&&!_['isEmpty'](_0x4fbfb7)){if(!_['isUndefined'](_0x274463)&&'string'===typeof _0x274463&&!_[_0xc676('0x13')](_0x274463)){return util['format'](_0xc676('0x14'),_0x274463,_0x4fbfb7);}return util[_0xc676('0x15')](_0xc676('0x14'),_0x4fbfb7,_0x4fbfb7);}if(!_[_0xc676('0x16')](_0x4f8832)&&_0xc676('0x12')===typeof _0x4f8832&&!_[_0xc676('0x13')](_0x4f8832)){return _0x4f8832;}return'\x22\x22\x20<>';};exports[_0xc676('0x17')]=function(_0x289ed9){if(_['isNil'](_0x289ed9)){return![];}return _0x289ed9;};exports[_0xc676('0x18')]=function(_0xfc64cb,_0x1bd9d9,_0x27afd,_0x26a00b,_0x87b27d,_0x474ad2){var _0xc533a9={'XMD-QUEUE':_0x1bd9d9['Queue']?_0x1bd9d9['Queue']['name']:'','XMD-CALLERID':_0x26a00b,'XMD-CALLERID-PREVIEW':_0x474ad2?util[_0xc676('0x15')]('\x22%s\x22\x20<%s>',_0x474ad2[_0xc676('0x19')],_0x474ad2['calleridnum']):_0x26a00b,'XMD-DIALID':_0x87b27d,'XMD-CONTACTID':_0x1bd9d9['ContactId'],'XMD-CDRTYPE':_0xc676('0x1a'),'CALLERID(all)':_0x26a00b,'XMD-VOICEQUEUEID':_0x1bd9d9['VoiceQueueId'],'XMD-DIALCHANNEL':_0x27afd,'XMD-DIALTIMEOUT':_0xfc64cb[_0xc676('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xc676('0x15')](_0xc676('0x1c'),_0xfc64cb[_0xc676('0x1d')]?'g':'',_[_0xc676('0x13')](_0xfc64cb['monitor_format'])?'':_0xc676('0x1e')),'XMD-DIALURL':_0xfc64cb[_0xc676('0x1f')]||'','XMD-AGI':_0xfc64cb[_0xc676('0x20')]?util['format'](_0xc676('0x21'),ipAgi,_0xfc64cb['dialQueueProject']):_0xc676('0x22'),'XMD-AGIAFTER':_0xfc64cb[_0xc676('0x1d')]?util['format'](_0xc676('0x21'),ipAgi,_0xfc64cb[_0xc676('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x474ad2?_0x474ad2[_0xc676('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x474ad2?_0x474ad2[_0xc676('0x24')]:'','XMD-DESTINATION':_0xc676('0x25')};if(!_['isEmpty'](_0xfc64cb[_0xc676('0x26')])){_0xc533a9[util[_0xc676('0x15')]('%s',_0xc676('0x27'))]=_0xfc64cb[_0xc676('0x26')];_0xc533a9[util[_0xc676('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x87b27d;}if(_0x1bd9d9&&_0x1bd9d9[_0xc676('0x28')]){for(var _0x19338b in _0x1bd9d9[_0xc676('0x28')]){if(_0x1bd9d9[_0xc676('0x28')][_0xc676('0x29')](_0x19338b)){if(!_['isNil'](_0x1bd9d9[_0xc676('0x28')][_0x19338b])&&_0x19338b!=='id'&&_0x19338b!==_0xc676('0x2a')&&_0x19338b!==_0xc676('0x2b')&&_0x19338b!==_0xc676('0x2c')){_0xc533a9[util['format'](_0xc676('0x2d'),_0xc676('0x2e'),_[_0xc676('0x2f')](_0x19338b))]=_0x1bd9d9[_0xc676('0x28')][_0x19338b];}}}}return _0xc533a9;};exports[_0xc676('0x30')]=function(_0x3a38e0){var _0x1662c5={};for(var _0x30b018 in _0x3a38e0){if(_0x3a38e0[_0xc676('0x29')](_0x30b018)){_0x1662c5[util['format']('%s',_['toLower'](_0x30b018))]=_0x3a38e0[_0x30b018];}}return{'variables':_0x1662c5};};exports['updateOriginated']=function(_0x1c4120,_0x3cd065){if(!_[_0xc676('0x31')](_0x1c4120)){if(_0x1c4120[_0xc676('0x29')]('originated')){if(_0x1c4120[_0xc676('0x32')]>0x0){_0x1c4120[_0xc676('0x32')]-=0x1;}else{logger[_0xc676('0xe')](_0xc676('0x33'),_0x3cd065);}}}else{logger[_0xc676('0xe')](_0xc676('0x34'),_0x3cd065);}};exports['logBlacklist']=function(_0x51d533){var _0x41a3d8=moment()['format'](_0xc676('0x35'));_0x51d533[_0xc676('0x36')]=0xd;_0x51d533[_0xc676('0x37')]=_0xc676('0x38');_0x51d533['starttime']=_0x41a3d8;_0x51d533['responsetime']=_0x41a3d8;_0x51d533['endtime']=_0x41a3d8;};exports[_0xc676('0x39')]=function(_0x25e35f,_0xde0c55,_0x2704b1){var _0x2d40bc=moment()[_0xc676('0x15')](_0xc676('0x35'));_0x25e35f[_0xc676('0x36')]=_0xde0c55;_0x25e35f[_0xc676('0x37')]=_0x2704b1;_0x25e35f[_0xc676('0x3a')]=_0x2d40bc;_0x25e35f[_0xc676('0x3b')]=getSeconds(_0x25e35f[_0xc676('0x3a')],_0x25e35f[_0xc676('0x3c')]);};exports[_0xc676('0x3d')]=function(_0x455c7a,_0x2cba1a,_0x2b23a5){_0x455c7a['membername']=_0x2cba1a;_0x455c7a[_0xc676('0x3e')]=_0x2b23a5;};exports[_0xc676('0x3f')]=function(_0x2020d7,_0x584058,_0x2ce4a2){var _0x1373b6=moment()[_0xc676('0x15')](_0xc676('0x35'));_0x2020d7[_0xc676('0x36')]=_0x584058;_0x2020d7[_0xc676('0x37')]=_0x2ce4a2;_0x2020d7[_0xc676('0x3a')]=_0x2020d7['responsetime']?_0x2020d7[_0xc676('0x3a')]:_0x1373b6;_0x2020d7['endtime']=_0x2020d7[_0xc676('0x40')]?_0x2020d7[_0xc676('0x40')]:_0x1373b6;_0x2020d7['ringtime']=getSeconds(_0x2020d7[_0xc676('0x3a')]||0x0,_0x2020d7[_0xc676('0x3c')]||0x0);_0x2020d7[_0xc676('0x41')]=_0x2020d7[_0xc676('0x42')]?getSeconds(_0x2020d7[_0xc676('0x40')],_0x2020d7['answertime']):0x0;};exports[_0xc676('0x43')]=function(_0x2a5be2){return _0x2a5be2===_0xc676('0x44');};exports['variablesAction']=function(_0x78dbea,_0x3c3b91,_0xf3fbd1,_0x40cbeb,_0x488087){var _0x138f11=_0x40cbeb?'RECALL':_0x78dbea[_0xc676('0x19')];_0x138f11=_0x488087?_0xc676('0x45'):_0x138f11;return{'actionid':_0x78dbea[_0xc676('0x46')],'action':'originate','channel':_0x78dbea[_0xc676('0x47')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x138f11,_0x78dbea[_0xc676('0x48')]),'Exten':'xcally-motion-preview','Context':_0xc676('0x49'),'Priority':'1','variable':_0xf3fbd1,'timeout':(_0x3c3b91['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x78dbea['uniqueid']};};exports[_0xc676('0x4a')]=function(_0x55bbdf){return _0x55bbdf[_0xc676('0x4b')]+_0x55bbdf['countcongestionretry']+_0x55bbdf[_0xc676('0x4c')]+_0x55bbdf[_0xc676('0x4d')]+_0x55bbdf[_0xc676('0x4e')];};exports[_0xc676('0x4f')]=function(_0x4d8d1d){var _0x4e3329=_[_0xc676('0x50')](_0x4d8d1d);_0x4e3329[_0xc676('0x36')]=0xf;_0x4e3329['statedesc']=_0xc676('0x51');return _0x4e3329;};exports[_0xc676('0x52')]=function(_0x59be1a,_0x38d1bc,_0x28d937){var _0xa9b988={};_0xa9b988[_0x38d1bc]=_0x59be1a[_0x38d1bc];_0xa9b988[_0xc676('0x53')]=![];_0xa9b988[_0xc676('0x54')]=moment()['add'](_0x28d937,_0xc676('0x55'))[_0xc676('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0xa9b988[_0xc676('0x56')]=_0x59be1a[_0xc676('0x56')];_0xa9b988[_0xc676('0x57')]=_0x59be1a[_0xc676('0x57')];_0xa9b988['VoiceQueueId']=_0x59be1a[_0xc676('0x58')]||undefined;return _0xa9b988;};exports[_0xc676('0x59')]=function(_0x3e0e1d,_0x42ea7a){if(!_['isNil'](_0x3e0e1d)){if(_0x3e0e1d[_0xc676('0x5a')]>0x0){_0x3e0e1d[_0xc676('0x5a')]-=0x1;}else{logger[_0xc676('0xe')](_0x42ea7a,_0xc676('0x5b'));}}else{logger[_0xc676('0xe')](_0x42ea7a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc676('0x5c')]=function(_0x25c3f8){if(_0x25c3f8<=0x0){return!![];}return![];};exports[_0xc676('0x5d')]=function(_0x4b8ede,_0x447311){_0x4b8ede[_0xc676('0x5e')]=_0x447311;_0x4b8ede['name']=_0x4b8ede[_0xc676('0x5f')];_0x4b8ede['interface']=_0x4b8ede[_0xc676('0x47')];return _0x4b8ede;};exports[_0xc676('0x60')]=function(_0x3ac42f){var _0x2c2b1a={};_0x2c2b1a[_0xc676('0x5f')]=_0x3ac42f[_0xc676('0x5f')];_0x2c2b1a[_0xc676('0x61')]=_0x3ac42f[_0xc676('0x47')];_0x2c2b1a[_0xc676('0x46')]=_0x3ac42f['uniqueid'];return _0x2c2b1a;};exports['agentReadyId']=function(_0x365dd3){var _0x1b4a16=[];for(var _0x7e6447 in _0x365dd3){if(_0x365dd3['hasOwnProperty'](_0x7e6447)){if(!_[_0xc676('0x31')](_0x365dd3[_0x7e6447])&&_0x365dd3[_0x7e6447]['state']===_0xc676('0x62')&&_0x365dd3[_0x7e6447][_0xc676('0x63')]===_0xc676('0x64')){_0x1b4a16[_0xc676('0x65')](_0x365dd3[_0x7e6447]['id']);}}}return _0x1b4a16;};exports[_0xc676('0x66')]=function(_0x2f3c5d){var _0xd9eead=moment()[_0xc676('0x7')](0x0);var _0x2a1025=moment(_0x2f3c5d)[_0xc676('0x7')](0x0);return _0xd9eead[_0xc676('0x8')](_0x2a1025,_0xc676('0x9'));};exports[_0xc676('0x67')]=function(_0x4fadac){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fadac['ContactId'],'ListId':_0x4fadac['ListId'],'VoiceQueueId':_0x4fadac[_0xc676('0x58')]||undefined,'CampaignId':_0x4fadac[_0xc676('0x68')]||undefined};};exports[_0xc676('0x69')]=function(_0x3f4f17){if(_0x3f4f17===_0xc676('0x46')||_0x3f4f17===_0xc676('0x6a')||_0x3f4f17==='queue'||_0x3f4f17==='type'||_0x3f4f17===_0xc676('0x6b')||_0x3f4f17===_0xc676('0x6c')||_0x3f4f17===_0xc676('0x6d')||_0x3f4f17===_0xc676('0x47')||_0x3f4f17===_0xc676('0x19')||_0x3f4f17===_0xc676('0x53')||_0x3f4f17===_0xc676('0x48')||_0x3f4f17===_0xc676('0x54')||_0x3f4f17===_0xc676('0x4b')||_0x3f4f17==='countcongestionretry'||_0x3f4f17===_0xc676('0x4c')||_0x3f4f17===_0xc676('0x6e')||_0x3f4f17===_0xc676('0x6f')||_0x3f4f17===_0xc676('0x70')||_0x3f4f17==='callbackat'||_0x3f4f17==='recallme'||_0x3f4f17===_0xc676('0x56')||_0x3f4f17===_0xc676('0x57')||_0x3f4f17===_0xc676('0x3e')||_0x3f4f17===_0xc676('0x58')||_0x3f4f17==='sipcallid'||_0x3f4f17===_0xc676('0x71')||_0x3f4f17===_0xc676('0x72')||_0x3f4f17===_0xc676('0x73')||_0x3f4f17===_0xc676('0x74')||_0x3f4f17===_0xc676('0x75')||_0x3f4f17===_0xc676('0x76')||_0x3f4f17===_0xc676('0x77')||_0x3f4f17===_0xc676('0x78')||_0x3f4f17==='xmd-dialchannel'||_0x3f4f17===_0xc676('0x79')||_0x3f4f17===_0xc676('0x7a')||_0x3f4f17===_0xc676('0x7b')||_0x3f4f17===_0xc676('0x7c')||_0x3f4f17===_0xc676('0x7d')||_0x3f4f17===_0xc676('0x7e')||_0x3f4f17===_0xc676('0x7f')||_0x3f4f17===_0xc676('0x80')||_0x3f4f17===_0xc676('0x81')||_0x3f4f17===_0xc676('0x82')||_0x3f4f17===_0xc676('0x83')||_0x3f4f17===_0xc676('0x84')||_0x3f4f17===_0xc676('0x85')||_0x3f4f17==='rtpaudioqos'||_0x3f4f17==='rtpaudioqosbridged'||_0x3f4f17===_0xc676('0x80')||_0x3f4f17==='rtpaudioqosjitterbridged'||_0x3f4f17===_0xc676('0x82')||_0x3f4f17===_0xc676('0x83')||_0x3f4f17===_0xc676('0x84')||_0x3f4f17===_0xc676('0x85')||_0x3f4f17===_0xc676('0x86')||_0x3f4f17===_0xc676('0x87')||_0x3f4f17===_0xc676('0x36')||_0x3f4f17===_0xc676('0x37')){return![];}return!![];};exports[_0xc676('0x88')]=function(_0x409a18,_0x18219d){var _0x4ab37a,_0x1c6699,_0x4c3d34;if(_0x18219d<=0x0){_0x18219d=0x1;}_0x4ab37a=new RegExp(_0xc676('0x89')+_0x18219d+'}$');_0x1c6699=Math[_0xc676('0x8a')](0xa,_0x18219d-0x1);_0x4c3d34=Math['pow'](0xa,_0x18219d)-0x1;return util[_0xc676('0x15')]('%s',_['replace'](_0x409a18,_0x4ab37a,_['random'](_0x1c6699,_0x4c3d34)));};exports[_0xc676('0x8b')]=function(_0x38f9ac){var _0x387c57=_0x38f9ac[_0xc676('0x8c')](/"(.*?)"/);return _0x387c57?_0x387c57[0x1]:_0x38f9ac;};exports['extractCalleridNumber']=function(_0x21b860){var _0x51fdec=_0x21b860[_0xc676('0x8c')](/<(.*?)>/);return _0x51fdec?_0x51fdec[0x1]:_0x21b860;}; \ No newline at end of file +var _0xda81=['rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','buildAcw','not_inuse','status','getDiff','milliseconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countbusyretry','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosloss'];(function(_0x3f5c7e,_0x3f9962){var _0x2658d2=function(_0x19a26c){while(--_0x19a26c){_0x3f5c7e['push'](_0x3f5c7e['shift']());}};_0x2658d2(++_0x3f9962);}(_0xda81,0x1c3));var _0x1da8=function(_0x4e8f4f,_0x1b005c){_0x4e8f4f=_0x4e8f4f-0x0;var _0x5ed788=_0xda81[_0x4e8f4f];return _0x5ed788;};'use strict';var util=require(_0x1da8('0x0'));var _=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var logger=require('../../../../config/logger')(_0x1da8('0x3'));var ipAgi=process[_0x1da8('0x4')][_0x1da8('0x5')]||_0x1da8('0x6');function getSeconds(_0x48421c,_0x3357ac){var _0x2692c1=moment(_0x48421c)['milliseconds'](0x0);var _0x1aef7a=moment(_0x3357ac)['milliseconds'](0x0);return _0x2692c1[_0x1da8('0x7')](_0x1aef7a,_0x1da8('0x8'));}exports[_0x1da8('0x9')]=function(_0x1a3278){return function(_0x11dc1e){logger[_0x1da8('0xa')](_0x1a3278,util[_0x1da8('0xb')](_0x11dc1e,{'showHidden':![],'depth':null}));};};exports[_0x1da8('0xc')]=function(_0x45afb6,_0x5361ef){logger[_0x1da8('0xd')](_0x45afb6,util[_0x1da8('0xb')](_0x5361ef,{'showHidden':![],'depth':null}));};exports[_0x1da8('0xe')]=function(_0x24895e,_0x19543d){logger['error'](_0x24895e,util[_0x1da8('0xb')](_0x19543d,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x120d54){return function(_0x4127c8){logger[_0x1da8('0xd')](_0x120d54,util[_0x1da8('0xb')](_0x4127c8,{'showHidden':![],'depth':null}));};};exports[_0x1da8('0xf')]=function(_0x5c722d,_0x9d4cd3,_0x491a3f){return{'message':_0x5c722d,'unlock':_0x9d4cd3,'active':_0x491a3f};};exports[_0x1da8('0x10')]=function(_0x283169,_0x126954,_0x4a3025){if(!_[_0x1da8('0x11')](_0x4a3025)&&_0x1da8('0x12')===typeof _0x4a3025&&!_['isEmpty'](_0x4a3025)){if(!_[_0x1da8('0x11')](_0x126954)&&_0x1da8('0x12')===typeof _0x126954&&!_[_0x1da8('0x13')](_0x126954)){return util[_0x1da8('0x14')](_0x1da8('0x15'),_0x126954,_0x4a3025);}return util[_0x1da8('0x14')](_0x1da8('0x15'),_0x4a3025,_0x4a3025);}if(!_[_0x1da8('0x11')](_0x283169)&&_0x1da8('0x12')===typeof _0x283169&&!_['isEmpty'](_0x283169)){return _0x283169;}return _0x1da8('0x16');};exports[_0x1da8('0x17')]=function(_0x313172){if(_[_0x1da8('0x18')](_0x313172)){return![];}return _0x313172;};exports[_0x1da8('0x19')]=function(_0xb85101,_0x5380c7,_0x346662,_0x36f234,_0x3afeb3,_0x3a6ffa){var _0x9f2255={'XMD-QUEUE':_0x5380c7[_0x1da8('0x1a')]?_0x5380c7['Queue'][_0x1da8('0x1b')]:'','XMD-CALLERID':_0x36f234,'XMD-CALLERID-PREVIEW':_0x3a6ffa?util['format'](_0x1da8('0x15'),_0x3a6ffa[_0x1da8('0x1c')],_0x3a6ffa[_0x1da8('0x1d')]):_0x36f234,'XMD-DIALID':_0x3afeb3,'XMD-CONTACTID':_0x5380c7[_0x1da8('0x1e')],'XMD-CDRTYPE':_0x1da8('0x1f'),'CALLERID(all)':_0x36f234,'XMD-VOICEQUEUEID':_0x5380c7[_0x1da8('0x20')],'XMD-DIALCHANNEL':_0x346662,'XMD-DIALTIMEOUT':_0xb85101[_0x1da8('0x21')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0xb85101[_0x1da8('0x22')]?'g':'',_[_0x1da8('0x13')](_0xb85101['monitor_format'])?'':_0x1da8('0x23')),'XMD-DIALURL':_0xb85101[_0x1da8('0x24')]||'','XMD-AGI':_0xb85101[_0x1da8('0x25')]?util[_0x1da8('0x14')](_0x1da8('0x26'),ipAgi,_0xb85101[_0x1da8('0x25')]):'NONE','XMD-AGIAFTER':_0xb85101[_0x1da8('0x22')]?util[_0x1da8('0x14')](_0x1da8('0x26'),ipAgi,_0xb85101[_0x1da8('0x22')]):_0x1da8('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x3a6ffa?_0x3a6ffa[_0x1da8('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x3a6ffa?_0x3a6ffa[_0x1da8('0x29')]:'','XMD-DESTINATION':_0x1da8('0x2a')};if(!_[_0x1da8('0x13')](_0xb85101[_0x1da8('0x2b')])){_0x9f2255[util['format']('%s',_0x1da8('0x2c'))]=_0xb85101['monitor_format'];_0x9f2255[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x3afeb3;}if(_0x5380c7&&_0x5380c7['Contact']){for(var _0x3e7c00 in _0x5380c7[_0x1da8('0x2d')]){if(_0x5380c7['Contact'][_0x1da8('0x2e')](_0x3e7c00)){if(!_['isNil'](_0x5380c7[_0x1da8('0x2d')][_0x3e7c00])&&_0x3e7c00!=='id'&&_0x3e7c00!==_0x1da8('0x2f')&&_0x3e7c00!==_0x1da8('0x30')&&_0x3e7c00!=='updatedAt'){_0x9f2255[util[_0x1da8('0x14')](_0x1da8('0x31'),_0x1da8('0x32'),_[_0x1da8('0x33')](_0x3e7c00))]=_0x5380c7['Contact'][_0x3e7c00];}}}}return _0x9f2255;};exports[_0x1da8('0x34')]=function(_0x3e622f){var _0x32b72={};for(var _0x21cc4b in _0x3e622f){if(_0x3e622f[_0x1da8('0x2e')](_0x21cc4b)){_0x32b72[util[_0x1da8('0x14')]('%s',_['toLower'](_0x21cc4b))]=_0x3e622f[_0x21cc4b];}}return{'variables':_0x32b72};};exports[_0x1da8('0x35')]=function(_0x3bffcc,_0x3999b8){if(!_['isNil'](_0x3bffcc)){if(_0x3bffcc[_0x1da8('0x2e')](_0x1da8('0x36'))){if(_0x3bffcc[_0x1da8('0x36')]>0x0){_0x3bffcc[_0x1da8('0x36')]-=0x1;}else{logger[_0x1da8('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3999b8);}}}else{logger[_0x1da8('0xa')](_0x1da8('0x37'),_0x3999b8);}};exports[_0x1da8('0x38')]=function(_0x56df54){var _0x4f8291=moment()[_0x1da8('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x56df54['state']=0xd;_0x56df54['statedesc']=_0x1da8('0x39');_0x56df54[_0x1da8('0x3a')]=_0x4f8291;_0x56df54[_0x1da8('0x3b')]=_0x4f8291;_0x56df54['endtime']=_0x4f8291;};exports[_0x1da8('0x3c')]=function(_0x49c760,_0x7606ff,_0xd804a5){var _0x4f53fb=moment()[_0x1da8('0x14')](_0x1da8('0x3d'));_0x49c760[_0x1da8('0x3e')]=_0x7606ff;_0x49c760[_0x1da8('0x3f')]=_0xd804a5;_0x49c760[_0x1da8('0x3b')]=_0x4f53fb;_0x49c760[_0x1da8('0x40')]=getSeconds(_0x49c760[_0x1da8('0x3b')],_0x49c760[_0x1da8('0x3a')]);};exports[_0x1da8('0x41')]=function(_0x52f2f4,_0x3df5cb,_0x2431fb){_0x52f2f4['membername']=_0x3df5cb;_0x52f2f4[_0x1da8('0x42')]=_0x2431fb;};exports[_0x1da8('0x43')]=function(_0x3794ff,_0x5be265,_0x453f38){var _0x2b960d=moment()[_0x1da8('0x14')](_0x1da8('0x3d'));_0x3794ff[_0x1da8('0x3e')]=_0x5be265;_0x3794ff['statedesc']=_0x453f38;_0x3794ff[_0x1da8('0x3b')]=_0x3794ff[_0x1da8('0x3b')]?_0x3794ff[_0x1da8('0x3b')]:_0x2b960d;_0x3794ff['endtime']=_0x3794ff[_0x1da8('0x44')]?_0x3794ff['endtime']:_0x2b960d;_0x3794ff[_0x1da8('0x40')]=getSeconds(_0x3794ff[_0x1da8('0x3b')]||0x0,_0x3794ff[_0x1da8('0x3a')]||0x0);_0x3794ff[_0x1da8('0x45')]=_0x3794ff[_0x1da8('0x46')]?getSeconds(_0x3794ff[_0x1da8('0x44')],_0x3794ff[_0x1da8('0x46')]):0x0;};exports[_0x1da8('0x47')]=function(_0x15b10c){return _0x15b10c===_0x1da8('0x48');};exports['variablesAction']=function(_0x438a32,_0x175143,_0x354c75,_0x24e596,_0x2fd920){var _0x47cb29=_0x24e596?_0x1da8('0x49'):_0x438a32[_0x1da8('0x1c')];_0x47cb29=_0x2fd920?_0x1da8('0x4a'):_0x47cb29;return{'actionid':_0x438a32[_0x1da8('0x4b')],'action':_0x1da8('0x4c'),'channel':_0x438a32[_0x1da8('0x4d')],'callerid':util[_0x1da8('0x14')](_0x1da8('0x15'),_0x47cb29,_0x438a32[_0x1da8('0x1d')]),'Exten':_0x1da8('0x2a'),'Context':_0x1da8('0x4e'),'Priority':'1','variable':_0x354c75,'timeout':(_0x175143[_0x1da8('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x438a32[_0x1da8('0x4b')]};};exports[_0x1da8('0x50')]=function(_0x4e515f){return _0x4e515f['countbusyretry']+_0x4e515f[_0x1da8('0x51')]+_0x4e515f[_0x1da8('0x52')]+_0x4e515f[_0x1da8('0x53')]+_0x4e515f[_0x1da8('0x54')];};exports[_0x1da8('0x55')]=function(_0x1ed191){var _0x502c19=_[_0x1da8('0x56')](_0x1ed191);_0x502c19['state']=0xf;_0x502c19[_0x1da8('0x3f')]=_0x1da8('0x57');return _0x502c19;};exports[_0x1da8('0x58')]=function(_0x5d16cb,_0x319531,_0x3f5dac){var _0x26df80={};_0x26df80[_0x319531]=_0x5d16cb[_0x319531];_0x26df80[_0x1da8('0x59')]=![];_0x26df80[_0x1da8('0x5a')]=moment()[_0x1da8('0x5b')](_0x3f5dac,'minutes')[_0x1da8('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x26df80[_0x1da8('0x1e')]=_0x5d16cb['ContactId'];_0x26df80[_0x1da8('0x5c')]=_0x5d16cb['ListId'];_0x26df80[_0x1da8('0x20')]=_0x5d16cb[_0x1da8('0x20')]||undefined;return _0x26df80;};exports[_0x1da8('0x5d')]=function(_0x502192,_0x5454e9){if(!_[_0x1da8('0x18')](_0x502192)){if(_0x502192[_0x1da8('0x5e')]>0x0){_0x502192['pTalking']-=0x1;}else{logger['error'](_0x5454e9,_0x1da8('0x5f'));}}else{logger[_0x1da8('0xa')](_0x5454e9,_0x1da8('0x60'));}};exports[_0x1da8('0x61')]=function(_0xa5dab6){if(_0xa5dab6<=0x0){return!![];}return![];};exports[_0x1da8('0x62')]=function(_0x1d3cbe,_0x602bcd){_0x1d3cbe['lastevent']=_0x602bcd;_0x1d3cbe[_0x1da8('0x1b')]=_0x1d3cbe[_0x1da8('0x63')];_0x1d3cbe[_0x1da8('0x64')]=_0x1d3cbe['channelAgent'];return _0x1d3cbe;};exports[_0x1da8('0x65')]=function(_0x3ce2a6){var _0x2f3d17={};_0x2f3d17['queue']=_0x3ce2a6[_0x1da8('0x63')];_0x2f3d17['interface']=_0x3ce2a6['channelAgent'];_0x2f3d17[_0x1da8('0x4b')]=_0x3ce2a6['uniqueid'];return _0x2f3d17;};exports['agentReadyId']=function(_0x116214){var _0x303efc=[];for(var _0xec831f in _0x116214){if(_0x116214['hasOwnProperty'](_0xec831f)){if(!_['isNil'](_0x116214[_0xec831f])&&_0x116214[_0xec831f]['state']===_0x1da8('0x66')&&_0x116214[_0xec831f][_0x1da8('0x67')]==='reachable'){_0x303efc['push'](_0x116214[_0xec831f]['id']);}}}return _0x303efc;};exports[_0x1da8('0x68')]=function(_0x25a24f){var _0x5d6626=moment()[_0x1da8('0x69')](0x0);var _0x1965cf=moment(_0x25a24f)[_0x1da8('0x69')](0x0);return _0x5d6626[_0x1da8('0x7')](_0x1965cf,'seconds');};exports[_0x1da8('0x6a')]=function(_0x489c4a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x489c4a[_0x1da8('0x1e')],'ListId':_0x489c4a[_0x1da8('0x5c')],'VoiceQueueId':_0x489c4a['VoiceQueueId']||undefined,'CampaignId':_0x489c4a[_0x1da8('0x6b')]||undefined};};exports[_0x1da8('0x6c')]=function(_0x4b63fb){if(_0x4b63fb===_0x1da8('0x4b')||_0x4b63fb===_0x1da8('0x6d')||_0x4b63fb==='queue'||_0x4b63fb===_0x1da8('0x6e')||_0x4b63fb===_0x1da8('0x6f')||_0x4b63fb===_0x1da8('0x70')||_0x4b63fb===_0x1da8('0x71')||_0x4b63fb===_0x1da8('0x4d')||_0x4b63fb==='calleridname'||_0x4b63fb===_0x1da8('0x59')||_0x4b63fb===_0x1da8('0x1d')||_0x4b63fb===_0x1da8('0x5a')||_0x4b63fb===_0x1da8('0x72')||_0x4b63fb===_0x1da8('0x51')||_0x4b63fb===_0x1da8('0x52')||_0x4b63fb==='countglobal'||_0x4b63fb===_0x1da8('0x73')||_0x4b63fb===_0x1da8('0x74')||_0x4b63fb==='callbackat'||_0x4b63fb===_0x1da8('0x75')||_0x4b63fb===_0x1da8('0x1e')||_0x4b63fb===_0x1da8('0x5c')||_0x4b63fb==='UserId'||_0x4b63fb===_0x1da8('0x20')||_0x4b63fb==='sipcallid'||_0x4b63fb===_0x1da8('0x76')||_0x4b63fb===_0x1da8('0x77')||_0x4b63fb===_0x1da8('0x78')||_0x4b63fb===_0x1da8('0x79')||_0x4b63fb===_0x1da8('0x7a')||_0x4b63fb===_0x1da8('0x7b')||_0x4b63fb===_0x1da8('0x7c')||_0x4b63fb===_0x1da8('0x7d')||_0x4b63fb===_0x1da8('0x7e')||_0x4b63fb==='xmd-contactid'||_0x4b63fb===_0x1da8('0x7f')||_0x4b63fb===_0x1da8('0x80')||_0x4b63fb===_0x1da8('0x81')||_0x4b63fb===_0x1da8('0x82')||_0x4b63fb===_0x1da8('0x83')||_0x4b63fb==='rtpaudioqosbridged'||_0x4b63fb==='rtpaudioqosjitter'||_0x4b63fb==='rtpaudioqosjitterbridged'||_0x4b63fb===_0x1da8('0x84')||_0x4b63fb===_0x1da8('0x85')||_0x4b63fb===_0x1da8('0x86')||_0x4b63fb==='rtpaudioqosrttbridged'||_0x4b63fb===_0x1da8('0x83')||_0x4b63fb===_0x1da8('0x87')||_0x4b63fb==='rtpaudioqosjitter'||_0x4b63fb===_0x1da8('0x88')||_0x4b63fb===_0x1da8('0x84')||_0x4b63fb===_0x1da8('0x85')||_0x4b63fb===_0x1da8('0x86')||_0x4b63fb==='rtpaudioqosrttbridged'||_0x4b63fb===_0x1da8('0x89')||_0x4b63fb===_0x1da8('0x8a')||_0x4b63fb==='state'||_0x4b63fb===_0x1da8('0x3f')){return![];}return!![];};exports[_0x1da8('0x8b')]=function(_0x259721,_0x245fb1){var _0x326919,_0x5d03c8,_0x3ebd2f;if(_0x245fb1<=0x0){_0x245fb1=0x1;}_0x326919=new RegExp(_0x1da8('0x8c')+_0x245fb1+'}$');_0x5d03c8=Math[_0x1da8('0x8d')](0xa,_0x245fb1-0x1);_0x3ebd2f=Math[_0x1da8('0x8d')](0xa,_0x245fb1)-0x1;return util[_0x1da8('0x14')]('%s',_[_0x1da8('0x8e')](_0x259721,_0x326919,_[_0x1da8('0x8f')](_0x5d03c8,_0x3ebd2f)));};exports['extractCalleridName']=function(_0x1d35df){var _0x6b254a=_0x1d35df[_0x1da8('0x90')](/"(.*?)"/);return _0x6b254a?_0x6b254a[0x1]:_0x1d35df;};exports[_0x1da8('0x91')]=function(_0x22e212){var _0x4fed98=_0x22e212[_0x1da8('0x90')](/<(.*?)>/);return _0x4fed98?_0x4fed98[0x1]:_0x22e212;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index bf28f7b..60a8db0 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 _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x196b99,_0x1a5fb1){var _0x56ba4a=function(_0x3da098){while(--_0x3da098){_0x196b99['push'](_0x196b99['shift']());}};_0x56ba4a(++_0x1a5fb1);}(_0x7a54,0x106));var _0x47a5=function(_0x187da0,_0x5964c0){_0x187da0=_0x187da0-0x0;var _0x2bbf97=_0x7a54[_0x187da0];return _0x2bbf97;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('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(_0x503816,_0x1bf1ef){var _0x167117=function(_0x26ca67){while(--_0x26ca67){_0x503816['push'](_0x503816['shift']());}};_0x167117(++_0x1bf1ef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x422559,_0x1e4f5c){_0x422559=_0x422559-0x0;var _0x55532c=_0x5f2f[_0x422559];return _0x55532c;};'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 e918d97..705d7e3 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 _0x98a5=['outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','format','interface','total','sumDuration','isEmpty','answered','unmanaged','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','diff','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallerleaveAt','initVoiceCallReports'];(function(_0x4c84bf,_0xcae335){var _0x438e62=function(_0x25112e){while(--_0x25112e){_0x4c84bf['push'](_0x4c84bf['shift']());}};_0x438e62(++_0xcae335);}(_0x98a5,0x1aa));var _0x598a=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x98a5[_0x459423];return _0x42ed14;};'use strict';var BPromise=require(_0x598a('0x0'));var util=require(_0x598a('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x598a('0x2'));var Telephone=require(_0x598a('0x3'));var Trunk=require(_0x598a('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x598a('0x5'));var Template=require(_0x598a('0x6'));var Campaign=require(_0x598a('0x7'));var VoiceExtension=require(_0x598a('0x8'));var ZendeskAccount=require(_0x598a('0x9'));var SalesforceAccount=require(_0x598a('0xa'));var FreshdeskAccount=require(_0x598a('0xb'));var SugarcrmAccount=require(_0x598a('0xc'));var ZohoAccount=require(_0x598a('0xd'));var DeskAccount=require(_0x598a('0xe'));var VtigerAccount=require(_0x598a('0xf'));var ServicenowAccount=require(_0x598a('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x598a('0x11'));var FaxAccount=require(_0x598a('0x12'));var Realtime=function(){this[_0x598a('0x13')]={};this[_0x598a('0x14')]={};this[_0x598a('0x15')]={};this[_0x598a('0x16')]={};this[_0x598a('0x17')]={};this[_0x598a('0x18')]={};this[_0x598a('0x19')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x598a('0x1a')]={};this[_0x598a('0x1b')]={};this['queueChannels']={};this[_0x598a('0x1c')]={};this['timers']={};this[_0x598a('0x1d')]={};this[_0x598a('0x1e')]={};this[_0x598a('0x1f')]={};this['freshdeskAccounts']={};this[_0x598a('0x20')]={};this[_0x598a('0x21')]={};this[_0x598a('0x22')]={};this[_0x598a('0x23')]={};this[_0x598a('0x24')]={};this[_0x598a('0x25')]={};this[_0x598a('0x26')]={};};function freeIsNotKey(_0x176010,_0x3bf9a6,_0x5c83e5){var _0x24dd78=_[_0x598a('0x27')](_0x176010,function(_0xadaa72,_0x4cf50a){return _0xadaa72[_0x5c83e5];});for(var _0x586709 in _0x3bf9a6){if(_0x3bf9a6['hasOwnProperty'](_0x586709)){if(!_0x24dd78[_0x586709]){delete _0x3bf9a6[_0x586709];}}}}function freeIsNotKeySip(_0x502cdf,_0x28d8e6){var _0x35b6a8=_[_0x598a('0x27')](_0x502cdf,function(_0x17f19c,_0x4141f2){return util['format'](_0x598a('0x28'),_0x17f19c[_0x598a('0x29')]);});for(var _0x4f1593 in _0x28d8e6){if(_0x28d8e6[_0x598a('0x2a')](_0x4f1593)){if(!_0x35b6a8[_0x4f1593]){delete _0x28d8e6[_0x4f1593];}}}}function freeIsNotKeyAgent(_0x285812,_0x3887b5){var _0x6aaa66=_[_0x598a('0x27')](_0x285812,function(_0x43ddd5,_0x281d30){var _0x13bf02=_[_0x598a('0x2b')](_0x43ddd5['interface'])?util[_0x598a('0x2c')](_0x598a('0x28'),_0x43ddd5[_0x598a('0x29')]):_0x43ddd5[_0x598a('0x2d')];return _0x13bf02;});for(var _0x377b16 in _0x3887b5){if(_0x3887b5['hasOwnProperty'](_0x377b16)){if(!_0x6aaa66[_0x377b16]){delete _0x3887b5[_0x377b16];}}}}function clearVoiceCallReports(_0x28a8b8){_0x28a8b8[_0x598a('0x2e')]=0x0;_0x28a8b8['answered']=0x0;_0x28a8b8['sumHoldTime']=0x0;_0x28a8b8[_0x598a('0x2f')]=0x0;_0x28a8b8['sumBillable']=0x0;}function clearCampaigns(_0x20d183){if(!_[_0x598a('0x30')](_0x20d183)){for(var _0x2f8512 in _0x20d183){if(_0x20d183[_0x598a('0x2a')](_0x2f8512)){_0x20d183[_0x2f8512]['ivrTotalCallsDays']=0x0;_0x20d183[_0x2f8512]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2f683a){if(!_['isEmpty'](_0x2f683a)){for(var _0x410501 in _0x2f683a){if(_0x2f683a[_0x598a('0x2a')](_0x410501)){_0x2f683a[_0x410501][_0x598a('0x2e')]=0x0;_0x2f683a[_0x410501][_0x598a('0x31')]=0x0;_0x2f683a[_0x410501][_0x598a('0x32')]=0x0;_0x2f683a[_0x410501][_0x598a('0x33')]=0x0;_0x2f683a[_0x410501][_0x598a('0x34')]=0x0;_0x2f683a[_0x410501]['sumDuration']=0x0;_0x2f683a[_0x410501][_0x598a('0x35')]=0x0;_0x2f683a[_0x410501][_0x598a('0x36')]=0x0;_0x2f683a[_0x410501][_0x598a('0x37')]=0x0;_0x2f683a[_0x410501][_0x598a('0x38')]=0x0;_0x2f683a[_0x410501][_0x598a('0x39')]=0x0;_0x2f683a[_0x410501]['outboundNoSuchCallsDay']=0x0;_0x2f683a[_0x410501][_0x598a('0x3a')]=0x0;_0x2f683a[_0x410501][_0x598a('0x3b')]=0x0;_0x2f683a[_0x410501]['outboundDropCallsDayCallersExit']=0x0;_0x2f683a[_0x410501][_0x598a('0x3c')]=0x0;_0x2f683a[_0x410501][_0x598a('0x3d')]=0x0;_0x2f683a[_0x410501][_0x598a('0x3e')]=0x0;_0x2f683a[_0x410501][_0x598a('0x3f')]=0x0;_0x2f683a[_0x410501][_0x598a('0x36')]=0x0;_0x2f683a[_0x410501][_0x598a('0x40')]=0x0;_0x2f683a[_0x410501][_0x598a('0x41')]=!![];}}}}Realtime['prototype'][_0x598a('0x42')]=function(_0x13fa74,_0x3d7441){for(var _0x2da52f in _0x3d7441){if(_0x13fa74[_0x598a('0x2a')](_0x2da52f)){_0x13fa74[_0x2da52f]=_0x3d7441[_0x2da52f];}}};Realtime[_0x598a('0x43')][_0x598a('0x44')]=function(){var _0x4df1ac=this;return function(_0x45209e){if(_0x45209e){freeIsNotKeyAgent(_0x45209e,_0x4df1ac[_0x598a('0x13')]);for(var _0x4a0a58=0x0,_0x33365d={},_0x49f0f6={};_0x4a0a58<_0x45209e[_0x598a('0x45')];_0x4a0a58+=0x1){_0x33365d=_0x45209e[_0x4a0a58];var _0x2851dc=_[_0x598a('0x2b')](_0x33365d['interface'])?util[_0x598a('0x2c')](_0x598a('0x28'),_0x33365d[_0x598a('0x29')]):_0x33365d[_0x598a('0x2d')];if(_[_0x598a('0x46')](_0x4df1ac[_0x598a('0x13')][_0x2851dc])){_0x4df1ac[_0x598a('0x13')][_0x2851dc]=new Agent(_0x33365d);}else{_0x4df1ac[_0x598a('0x42')](_0x4df1ac[_0x598a('0x13')][_0x2851dc],_0x33365d);}}}return _0x4df1ac['agents'];};};Realtime[_0x598a('0x43')][_0x598a('0x47')]=function(){var _0x17dd28=this;return function(_0x41eaea){if(_0x41eaea){freeIsNotKeySip(_0x41eaea,_0x17dd28[_0x598a('0x14')]);for(var _0x380f4f=0x0,_0x13c0d1={},_0x386426={};_0x380f4f<_0x41eaea[_0x598a('0x45')];_0x380f4f+=0x1){_0x13c0d1=_0x41eaea[_0x380f4f];if(_[_0x598a('0x46')](_0x17dd28[_0x598a('0x14')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x13c0d1['name'])])){_0x17dd28[_0x598a('0x14')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x13c0d1['name'])]=new Telephone(_0x13c0d1);}else{_0x17dd28[_0x598a('0x42')](_0x17dd28[_0x598a('0x14')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x13c0d1['name'])],_0x13c0d1);}}}return _0x17dd28[_0x598a('0x14')];};};Realtime[_0x598a('0x43')][_0x598a('0x48')]=function(){var _0x219307=this;return function(_0x50d9d9){if(_0x50d9d9){freeIsNotKeySip(_0x50d9d9,_0x219307[_0x598a('0x15')]);for(var _0x22c8a9=0x0,_0x3b3672={},_0x43518f={};_0x22c8a9<_0x50d9d9[_0x598a('0x45')];_0x22c8a9+=0x1){_0x3b3672=_0x50d9d9[_0x22c8a9];if(_[_0x598a('0x46')](_0x219307[_0x598a('0x15')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x3b3672[_0x598a('0x29')])])){_0x219307[_0x598a('0x15')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x3b3672[_0x598a('0x29')])]=new Trunk(_0x3b3672);}else{_0x219307['mergeFromDatabase'](_0x219307[_0x598a('0x15')][util[_0x598a('0x2c')](_0x598a('0x28'),_0x3b3672[_0x598a('0x29')])],_0x3b3672);}}}return _0x219307['trunks'];};};Realtime[_0x598a('0x43')][_0x598a('0x49')]=function(){var _0x3ba2f5=this;return function(_0x2cc5cd){if(_0x2cc5cd){freeIsNotKey(_0x2cc5cd,_0x3ba2f5['voiceQueues'],_0x598a('0x29'));for(var _0x20dfa5=0x0,_0x384462={},_0x5c2292={};_0x20dfa5<_0x2cc5cd['length'];_0x20dfa5+=0x1){_0x384462=_0x2cc5cd[_0x20dfa5];if(_[_0x598a('0x46')](_0x3ba2f5[_0x598a('0x16')][_0x384462['name']])){_0x3ba2f5['voiceQueues'][_0x384462[_0x598a('0x29')]]=new VoiceQueue(_0x384462);}else{_0x3ba2f5[_0x598a('0x42')](_0x3ba2f5[_0x598a('0x16')][_0x384462[_0x598a('0x29')]],_0x384462);}}}return _0x3ba2f5[_0x598a('0x16')];};};Realtime[_0x598a('0x43')][_0x598a('0x4a')]=function(){var _0x5a64b1=this;return function(_0x4a1e60){if(_0x4a1e60){freeIsNotKey(_0x4a1e60,_0x5a64b1[_0x598a('0x17')],'id');for(var _0x5a5b80=0x0,_0x319f2b={},_0x4d530c={};_0x5a5b80<_0x4a1e60['length'];_0x5a5b80+=0x1){_0x319f2b=_0x4a1e60[_0x5a5b80];if(_['isUndefined'](_0x5a64b1[_0x598a('0x17')][_0x319f2b['id']])){_0x5a64b1['triggers'][_0x319f2b['id']]=new Trigger(_0x319f2b);}else{_0x5a64b1[_0x598a('0x42')](_0x5a64b1['triggers'][_0x319f2b['id']],_0x319f2b);}}}return _0x5a64b1[_0x598a('0x17')];};};Realtime['prototype']['initTemplates']=function(){var _0x2a4712=this;return function(_0x13a1cb){if(_0x13a1cb){freeIsNotKey(_0x13a1cb,_0x2a4712[_0x598a('0x19')],'id');for(var _0x450777=0x0,_0x276f44={},_0x1c7014={};_0x450777<_0x13a1cb[_0x598a('0x45')];_0x450777+=0x1){_0x276f44=_0x13a1cb[_0x450777];if(_[_0x598a('0x46')](_0x2a4712[_0x598a('0x19')][_0x276f44['id']])){_0x2a4712[_0x598a('0x19')][_0x276f44['id']]=new Template(_0x276f44);}else{_0x2a4712[_0x598a('0x42')](_0x2a4712[_0x598a('0x19')][_0x276f44['id']],_0x276f44);}}}return _0x2a4712[_0x598a('0x19')];};};Realtime[_0x598a('0x43')]['initZendeskAccounts']=function(){var _0x3170e1=this;return function(_0x1e20e1){if(_0x1e20e1){freeIsNotKey(_0x1e20e1,_0x3170e1[_0x598a('0x1d')],'id');for(var _0x2d40d3=0x0,_0x373458={},_0x2d8fb6={};_0x2d40d3<_0x1e20e1[_0x598a('0x45')];_0x2d40d3+=0x1){_0x373458=_0x1e20e1[_0x2d40d3];if(_['isUndefined'](_0x3170e1['zendeskAccounts'][_0x373458['id']])){_0x3170e1['zendeskAccounts'][_0x373458['id']]=new ZendeskAccount(_0x373458);}else{_0x3170e1[_0x598a('0x42')](_0x3170e1[_0x598a('0x1d')][_0x373458['id']],_0x373458);}}}return _0x3170e1['zendeskAccounts'];};};Realtime[_0x598a('0x43')][_0x598a('0x4b')]=function(){var _0x271e5d=this;return function(_0x28570b){if(_0x28570b){freeIsNotKey(_0x28570b,_0x271e5d['salesforceAccounts'],'id');for(var _0x5b7e31=0x0,_0x182f7e={},_0x28c397={};_0x5b7e31<_0x28570b[_0x598a('0x45')];_0x5b7e31+=0x1){_0x182f7e=_0x28570b[_0x5b7e31];if(_[_0x598a('0x46')](_0x271e5d[_0x598a('0x1e')][_0x182f7e['id']])){_0x271e5d['salesforceAccounts'][_0x182f7e['id']]=new SalesforceAccount(_0x182f7e);}else{_0x271e5d['mergeFromDatabase'](_0x271e5d[_0x598a('0x1e')][_0x182f7e['id']],_0x182f7e);}}}return _0x271e5d[_0x598a('0x1e')];};};Realtime[_0x598a('0x43')]['initFreshdeskAccounts']=function(){var _0x5d6abb=this;return function(_0x4afb43){if(_0x4afb43){freeIsNotKey(_0x4afb43,_0x5d6abb[_0x598a('0x4c')],'id');for(var _0x69fbaa=0x0,_0xf92d28={},_0x6656={};_0x69fbaa<_0x4afb43['length'];_0x69fbaa+=0x1){_0xf92d28=_0x4afb43[_0x69fbaa];if(_['isUndefined'](_0x5d6abb[_0x598a('0x4c')][_0xf92d28['id']])){_0x5d6abb['freshdeskAccounts'][_0xf92d28['id']]=new FreshdeskAccount(_0xf92d28);}else{_0x5d6abb[_0x598a('0x42')](_0x5d6abb[_0x598a('0x4c')][_0xf92d28['id']],_0xf92d28);}}}return _0x5d6abb[_0x598a('0x4c')];};};Realtime[_0x598a('0x43')][_0x598a('0x4d')]=function(){var _0x4060e0=this;return function(_0x57d26f){if(_0x57d26f){freeIsNotKey(_0x57d26f,_0x4060e0[_0x598a('0x20')],'id');for(var _0x2f4b83=0x0,_0x4b224e={},_0x499653={};_0x2f4b83<_0x57d26f[_0x598a('0x45')];_0x2f4b83+=0x1){_0x4b224e=_0x57d26f[_0x2f4b83];if(_['isUndefined'](_0x4060e0['zohoAccounts'][_0x4b224e['id']])){_0x4060e0[_0x598a('0x20')][_0x4b224e['id']]=new ZohoAccount(_0x4b224e);}else{_0x4060e0[_0x598a('0x42')](_0x4060e0['zohoAccounts'][_0x4b224e['id']],_0x4b224e);}}}return _0x4060e0[_0x598a('0x20')];};};Realtime[_0x598a('0x43')][_0x598a('0x4e')]=function(){var _0xb20b21=this;return function(_0x324c22){if(_0x324c22){freeIsNotKey(_0x324c22,_0xb20b21[_0x598a('0x21')],'id');for(var _0x587660=0x0,_0xd38ff={},_0x4ccd02={};_0x587660<_0x324c22[_0x598a('0x45')];_0x587660+=0x1){_0xd38ff=_0x324c22[_0x587660];if(_['isUndefined'](_0xb20b21[_0x598a('0x21')][_0xd38ff['id']])){_0xb20b21[_0x598a('0x21')][_0xd38ff['id']]=new DeskAccount(_0xd38ff);}else{_0xb20b21[_0x598a('0x42')](_0xb20b21[_0x598a('0x21')][_0xd38ff['id']],_0xd38ff);}}}return _0xb20b21[_0x598a('0x21')];};};Realtime['prototype'][_0x598a('0x4f')]=function(){var _0x262b57=this;return function(_0x4f83de){if(_0x4f83de){freeIsNotKey(_0x4f83de,_0x262b57[_0x598a('0x1f')],'id');for(var _0x1ca9c5=0x0,_0x40ad8b={},_0x547d92={};_0x1ca9c5<_0x4f83de[_0x598a('0x45')];_0x1ca9c5+=0x1){_0x40ad8b=_0x4f83de[_0x1ca9c5];if(_[_0x598a('0x46')](_0x262b57[_0x598a('0x1f')][_0x40ad8b['id']])){_0x262b57[_0x598a('0x1f')][_0x40ad8b['id']]=new SugarcrmAccount(_0x40ad8b);}else{_0x262b57[_0x598a('0x42')](_0x262b57[_0x598a('0x1f')][_0x40ad8b['id']],_0x40ad8b);}}}return _0x262b57[_0x598a('0x1f')];};};Realtime[_0x598a('0x43')]['initVtigerAccounts']=function(){var _0x3c4376=this;return function(_0x284df6){if(_0x284df6){freeIsNotKey(_0x284df6,_0x3c4376[_0x598a('0x22')],'id');for(var _0x3e753d=0x0,_0x5b8926={},_0x24f6aa={};_0x3e753d<_0x284df6['length'];_0x3e753d+=0x1){_0x5b8926=_0x284df6[_0x3e753d];if(_[_0x598a('0x46')](_0x3c4376[_0x598a('0x22')][_0x5b8926['id']])){_0x3c4376[_0x598a('0x22')][_0x5b8926['id']]=new VtigerAccount(_0x5b8926);}else{_0x3c4376[_0x598a('0x42')](_0x3c4376[_0x598a('0x22')][_0x5b8926['id']],_0x5b8926);}}}return _0x3c4376[_0x598a('0x22')];};};Realtime['prototype'][_0x598a('0x50')]=function(){var _0x44f98d=this;return function(_0x1bf476){if(_0x1bf476){freeIsNotKey(_0x1bf476,_0x44f98d[_0x598a('0x23')],'id');for(var _0x4fb85f=0x0,_0x4ac0ff={},_0x123897={};_0x4fb85f<_0x1bf476[_0x598a('0x45')];_0x4fb85f+=0x1){_0x4ac0ff=_0x1bf476[_0x4fb85f];if(_[_0x598a('0x46')](_0x44f98d['servicenowAccounts'][_0x4ac0ff['id']])){_0x44f98d['servicenowAccounts'][_0x4ac0ff['id']]=new ServicenowAccount(_0x4ac0ff);}else{_0x44f98d['mergeFromDatabase'](_0x44f98d[_0x598a('0x23')][_0x4ac0ff['id']],_0x4ac0ff);}}}return _0x44f98d[_0x598a('0x23')];};};Realtime[_0x598a('0x43')]['initDynamics365Accounts']=function(){var _0x34d963=this;return function(_0x1c5539){if(_0x1c5539){freeIsNotKey(_0x1c5539,_0x34d963[_0x598a('0x24')],'id');for(var _0x3faa1b=0x0,_0x32e6da={},_0x13e58b={};_0x3faa1b<_0x1c5539['length'];_0x3faa1b+=0x1){_0x32e6da=_0x1c5539[_0x3faa1b];if(_[_0x598a('0x46')](_0x34d963['dynamics365Accounts'][_0x32e6da['id']])){_0x34d963[_0x598a('0x24')][_0x32e6da['id']]=new Dynamics365Account(_0x32e6da);}else{_0x34d963[_0x598a('0x42')](_0x34d963[_0x598a('0x24')][_0x32e6da['id']],_0x32e6da);}}}return _0x34d963['dynamics365Accounts'];};};Realtime[_0x598a('0x43')][_0x598a('0x51')]=function(){var _0x3d3381=this;return function(_0x49ebeb){if(_0x49ebeb){freeIsNotKey(_0x49ebeb,_0x3d3381[_0x598a('0x25')],'id');for(var _0x4ccfc5=0x0,_0x5ee572={},_0x1cdb68={};_0x4ccfc5<_0x49ebeb['length'];_0x4ccfc5+=0x1){_0x5ee572=_0x49ebeb[_0x4ccfc5];if(_[_0x598a('0x46')](_0x3d3381['freshsalesAccounts'][_0x5ee572['id']])){_0x3d3381['freshsalesAccounts'][_0x5ee572['id']]=new FreshsalesAccount(_0x5ee572);}else{_0x3d3381['mergeFromDatabase'](_0x3d3381['freshsalesAccounts'][_0x5ee572['id']],_0x5ee572);}}}return _0x3d3381[_0x598a('0x25')];};};Realtime[_0x598a('0x43')][_0x598a('0x52')]=function(){var _0x148936=this;return function(_0x591532){for(var _0x2b0985=0x0;_0x2b0985<_0x591532['length'];_0x2b0985+=0x1){_['merge'](_0x148936[_0x598a('0x16')][_0x591532[_0x2b0985]['name']],_0x591532[_0x2b0985]);}return _0x148936['voiceQueues'];};};Realtime[_0x598a('0x43')][_0x598a('0x53')]=function(){var _0xd0b5d8=this;return function(_0x3de017){clearVoiceQueues(_0xd0b5d8[_0x598a('0x16')]);if(_0x3de017){_0x3de017=_['groupBy'](_0x3de017,_0x598a('0x54'));for(var _0x48e7c9 in _0x3de017){if(_0x3de017['hasOwnProperty'](_0x48e7c9)){var _0x467c80={};for(var _0x9adae1=0x0;_0x9adae1<_0x3de017[_0x48e7c9][_0x598a('0x45')];_0x9adae1+=0x1){var _0x1b77d8=_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x55')];if(_0xd0b5d8['voiceQueues'][_0x1b77d8]){if(_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x56')]){_0xd0b5d8[_0x598a('0x16')][_0x1b77d8]['unmanaged']+=0x1;}if(_0x3de017[_0x48e7c9][_0x9adae1]['queuecallerabandon']){_0xd0b5d8[_0x598a('0x16')][_0x1b77d8][_0x598a('0x33')]+=0x1;}_0xd0b5d8[_0x598a('0x16')][_0x1b77d8]['sumHoldTime']+=moment(_0x3de017[_0x48e7c9][_0x9adae1]['queuecallerleaveAt'])[_0x598a('0x57')](moment(_0x3de017[_0x48e7c9][_0x9adae1]['queuecallerjoinAt']),'seconds')||0x0;if(_0x9adae1===_0x3de017[_0x48e7c9][_0x598a('0x45')]-0x1){_0xd0b5d8[_0x598a('0x16')][_0x1b77d8][_0x598a('0x2f')]+=moment(_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x58')]||_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x59')]||_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x5a')])[_0x598a('0x57')](moment(_0x3de017[_0x48e7c9][_0x9adae1]['queuecallerjoinAt']),_0x598a('0x5b'))||0x0;_0xd0b5d8[_0x598a('0x16')][_0x1b77d8]['total']+=0x1;if(_0x3de017[_0x48e7c9][_0x9adae1]['queuecallercomplete']){_0xd0b5d8[_0x598a('0x16')][_0x1b77d8][_0x598a('0x31')]+=0x1;_0xd0b5d8['voiceQueues'][_0x1b77d8][_0x598a('0x35')]+=moment(_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x58')])[_0x598a('0x57')](moment(_0x3de017[_0x48e7c9][_0x9adae1][_0x598a('0x5c')]),_0x598a('0x5b'))||0x0;}}else{_0xd0b5d8[_0x598a('0x16')][_0x1b77d8][_0x598a('0x2f')]+=_0xd0b5d8[_0x598a('0x16')][_0x1b77d8]['sumHoldTime']||0x0;}}}}}}return _0xd0b5d8[_0x598a('0x16')];};};Realtime[_0x598a('0x43')][_0x598a('0x5d')]=function(){var _0xe7e76f=this;return function(_0x710c30){clearVoiceCallReports(_0xe7e76f['outbound']);if(_0x710c30){for(var _0x43cd5b=0x0;_0x43cd5b<_0x710c30[_0x598a('0x45')];_0x43cd5b+=0x1){_0xe7e76f[_0x598a('0x5e')][_0x598a('0x2e')]+=0x1;_0xe7e76f[_0x598a('0x5e')][_0x598a('0x2f')]+=_0x710c30[_0x43cd5b][_0x598a('0x5f')];if(_0x710c30[_0x43cd5b][_0x598a('0x60')]===_0x598a('0x61')){_0xe7e76f[_0x598a('0x5e')]['answered']+=0x1;_0xe7e76f[_0x598a('0x5e')][_0x598a('0x34')]+=_0x710c30[_0x43cd5b][_0x598a('0x5f')]-_0x710c30[_0x43cd5b][_0x598a('0x62')]||0x0;_0xe7e76f[_0x598a('0x5e')][_0x598a('0x35')]+=_0x710c30[_0x43cd5b][_0x598a('0x62')];}}}return _0xe7e76f[_0x598a('0x5e')];};};Realtime[_0x598a('0x43')][_0x598a('0x63')]=function(){var _0xe9e98=this;return function(_0x3289af){if(_0x3289af){freeIsNotKey(_0x3289af,_0xe9e98['campaigns'],_0x598a('0x29'));for(var _0x5ccb3a=0x0,_0x29974b={};_0x5ccb3a<_0x3289af[_0x598a('0x45')];_0x5ccb3a+=0x1){_0x29974b=_0x3289af[_0x5ccb3a];if(_[_0x598a('0x46')](_0xe9e98[_0x598a('0x18')][_0x29974b[_0x598a('0x29')]])){_0xe9e98[_0x598a('0x18')][_0x29974b[_0x598a('0x29')]]=new Campaign(_0x29974b);}else{_0xe9e98['mergeFromDatabase'](_0xe9e98['campaigns'][_0x29974b[_0x598a('0x29')]],_0x29974b);_0xe9e98[_0x598a('0x18')][_0x29974b[_0x598a('0x29')]][_0x598a('0x64')]=_0x29974b['SquareProject']?_0x29974b['SquareProject'][_0x598a('0x29')]:undefined;}}}return _0xe9e98['campaigns'];};};Realtime[_0x598a('0x43')]['initVoiceExtensions']=function(){var _0x5cf6f1=this;return function(_0x1131e1){if(_0x1131e1){freeIsNotKey(_0x1131e1,_0x5cf6f1[_0x598a('0x1a')],'id');for(var _0x9c4ba=0x0,_0x1b76dd={};_0x9c4ba<_0x1131e1[_0x598a('0x45')];_0x9c4ba+=0x1){_0x1b76dd=_0x1131e1[_0x9c4ba];if(_[_0x598a('0x46')](_0x5cf6f1[_0x598a('0x1a')][_0x1b76dd['id']])){_0x5cf6f1[_0x598a('0x1a')][_0x1b76dd['id']]=new VoiceExtension(_0x1b76dd);}else{_0x5cf6f1[_0x598a('0x42')](_0x5cf6f1[_0x598a('0x1a')][_0x1b76dd['id']],_0x1b76dd);}}}return _0x5cf6f1[_0x598a('0x1a')];};};Realtime[_0x598a('0x43')][_0x598a('0x65')]=function(){var _0x15f545=this;return function(_0x335c7c){clearCampaigns(_0x15f545[_0x598a('0x18')]);for(var _0x234c08=0x0;_0x234c08<_0x335c7c[_0x598a('0x45')];_0x234c08+=0x1){_['merge'](_0x15f545[_0x598a('0x18')][_0x335c7c[_0x234c08][_0x598a('0x29')]],_0x335c7c[_0x234c08]);}return _0x15f545[_0x598a('0x18')];};};Realtime['prototype'][_0x598a('0x66')]=function(){var _0x377a94=this;return function(_0x4ffd23){if(_0x4ffd23){freeIsNotKey(_0x4ffd23,_0x377a94['faxAccounts'],'id');for(var _0x3c0d6e=0x0,_0x17677f={},_0x37591f={};_0x3c0d6e<_0x4ffd23[_0x598a('0x45')];_0x3c0d6e+=0x1){_0x17677f=_0x4ffd23[_0x3c0d6e];if(_['isUndefined'](_0x377a94[_0x598a('0x26')][_0x17677f['id']])){_0x377a94['faxAccounts'][_0x17677f['id']]=new FaxAccount(_0x17677f);}else{_0x377a94['mergeFromDatabase'](_0x377a94[_0x598a('0x26')][_0x17677f['id']],_0x17677f);}}}return _0x377a94[_0x598a('0x26')];};};module[_0x598a('0x67')]=Realtime; \ No newline at end of file +var _0xa8b4=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','templates','queueChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','SIP/%s','initTrunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign'];(function(_0x272d85,_0xce812d){var _0x56cdf8=function(_0x5593f8){while(--_0x5593f8){_0x272d85['push'](_0x272d85['shift']());}};_0x56cdf8(++_0xce812d);}(_0xa8b4,0xcb));var _0x4a8b=function(_0x120b40,_0x4d7000){_0x120b40=_0x120b40-0x0;var _0x337847=_0xa8b4[_0x120b40];return _0x337847;};'use strict';var BPromise=require(_0x4a8b('0x0'));var util=require(_0x4a8b('0x1'));var _=require(_0x4a8b('0x2'));var moment=require(_0x4a8b('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x4a8b('0x4'));var Trunk=require(_0x4a8b('0x5'));var VoiceQueue=require(_0x4a8b('0x6'));var Trigger=require(_0x4a8b('0x7'));var Template=require('../model/template');var Campaign=require(_0x4a8b('0x8'));var VoiceExtension=require(_0x4a8b('0x9'));var ZendeskAccount=require(_0x4a8b('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x4a8b('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4a8b('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x4a8b('0xd'));var Dynamics365Account=require(_0x4a8b('0xe'));var FreshsalesAccount=require(_0x4a8b('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x4a8b('0x10')]={};this[_0x4a8b('0x11')]={};this[_0x4a8b('0x12')]={};this[_0x4a8b('0x13')]={};this[_0x4a8b('0x14')]={};this['campaigns']={};this[_0x4a8b('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x4a8b('0x16')]={};this['outboundChannels']={};this[_0x4a8b('0x17')]={};this[_0x4a8b('0x18')]={};this[_0x4a8b('0x19')]={};this[_0x4a8b('0x1a')]={};this[_0x4a8b('0x1b')]={};this['zohoAccounts']={};this[_0x4a8b('0x1c')]={};this[_0x4a8b('0x1d')]={};this[_0x4a8b('0x1e')]={};this[_0x4a8b('0x1f')]={};this[_0x4a8b('0x20')]={};this[_0x4a8b('0x21')]={};};function freeIsNotKey(_0x21812f,_0x346212,_0x21db53){var _0x17c6ad=_[_0x4a8b('0x22')](_0x21812f,function(_0x3edb33,_0x39cc2a){return _0x3edb33[_0x21db53];});for(var _0xffa71f in _0x346212){if(_0x346212[_0x4a8b('0x23')](_0xffa71f)){if(!_0x17c6ad[_0xffa71f]){delete _0x346212[_0xffa71f];}}}}function freeIsNotKeySip(_0x522d0a,_0x44f2ef){var _0x93dce9=_[_0x4a8b('0x22')](_0x522d0a,function(_0x1f1855,_0x3dadba){return util[_0x4a8b('0x24')]('SIP/%s',_0x1f1855[_0x4a8b('0x25')]);});for(var _0x2c0632 in _0x44f2ef){if(_0x44f2ef[_0x4a8b('0x23')](_0x2c0632)){if(!_0x93dce9[_0x2c0632]){delete _0x44f2ef[_0x2c0632];}}}}function freeIsNotKeyAgent(_0x1fc08f,_0x16c2cb){var _0xc853aa=_['mapKeys'](_0x1fc08f,function(_0x554900,_0x1cfede){var _0x25fdca=_[_0x4a8b('0x26')](_0x554900['interface'])?util[_0x4a8b('0x24')]('SIP/%s',_0x554900[_0x4a8b('0x25')]):_0x554900[_0x4a8b('0x27')];return _0x25fdca;});for(var _0x471689 in _0x16c2cb){if(_0x16c2cb[_0x4a8b('0x23')](_0x471689)){if(!_0xc853aa[_0x471689]){delete _0x16c2cb[_0x471689];}}}}function clearVoiceCallReports(_0x255c0e){_0x255c0e[_0x4a8b('0x28')]=0x0;_0x255c0e[_0x4a8b('0x29')]=0x0;_0x255c0e[_0x4a8b('0x2a')]=0x0;_0x255c0e[_0x4a8b('0x2b')]=0x0;_0x255c0e[_0x4a8b('0x2c')]=0x0;}function clearCampaigns(_0x1e642f){if(!_[_0x4a8b('0x2d')](_0x1e642f)){for(var _0x41b988 in _0x1e642f){if(_0x1e642f['hasOwnProperty'](_0x41b988)){_0x1e642f[_0x41b988][_0x4a8b('0x2e')]=0x0;_0x1e642f[_0x41b988][_0x4a8b('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x1c3afa){if(!_['isEmpty'](_0x1c3afa)){for(var _0x1e53c3 in _0x1c3afa){if(_0x1c3afa['hasOwnProperty'](_0x1e53c3)){_0x1c3afa[_0x1e53c3]['total']=0x0;_0x1c3afa[_0x1e53c3]['answered']=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x30')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x31')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x2a')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x2b')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x2c')]=0x0;_0x1c3afa[_0x1e53c3]['outboundAnswerAgiCallsDay']=0x0;_0x1c3afa[_0x1e53c3]['outboundNoAnswerCallsDay']=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x32')]=0x0;_0x1c3afa[_0x1e53c3]['outboundCongestionCallsDay']=0x0;_0x1c3afa[_0x1e53c3]['outboundNoSuchCallsDay']=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x33')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x34')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x35')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x36')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x37')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x38')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x39')]=0x0;_0x1c3afa[_0x1e53c3]['outboundAnswerAgiCallsDay']=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x3a')]=0x0;_0x1c3afa[_0x1e53c3][_0x4a8b('0x3b')]=!![];}}}}Realtime[_0x4a8b('0x3c')][_0x4a8b('0x3d')]=function(_0x4b25b6,_0x573973){for(var _0x236454 in _0x573973){if(_0x4b25b6[_0x4a8b('0x23')](_0x236454)){_0x4b25b6[_0x236454]=_0x573973[_0x236454];}}};Realtime['prototype'][_0x4a8b('0x3e')]=function(){var _0x18f5b3=this;return function(_0x1ddff5){if(_0x1ddff5){freeIsNotKeyAgent(_0x1ddff5,_0x18f5b3['agents']);for(var _0x25521a=0x0,_0x163e0b={},_0x4f26e0={};_0x25521a<_0x1ddff5[_0x4a8b('0x3f')];_0x25521a+=0x1){_0x163e0b=_0x1ddff5[_0x25521a];var _0x4120a2=_['isNil'](_0x163e0b['interface'])?util['format']('SIP/%s',_0x163e0b[_0x4a8b('0x25')]):_0x163e0b[_0x4a8b('0x27')];if(_[_0x4a8b('0x40')](_0x18f5b3['agents'][_0x4120a2])){_0x18f5b3[_0x4a8b('0x10')][_0x4120a2]=new Agent(_0x163e0b);}else{_0x18f5b3[_0x4a8b('0x3d')](_0x18f5b3['agents'][_0x4120a2],_0x163e0b);}}}return _0x18f5b3['agents'];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x41')]=function(){var _0x19d8aa=this;return function(_0x357fa9){if(_0x357fa9){freeIsNotKeySip(_0x357fa9,_0x19d8aa[_0x4a8b('0x11')]);for(var _0x5dd0a3=0x0,_0x4e88df={},_0x56877b={};_0x5dd0a3<_0x357fa9[_0x4a8b('0x3f')];_0x5dd0a3+=0x1){_0x4e88df=_0x357fa9[_0x5dd0a3];if(_['isUndefined'](_0x19d8aa[_0x4a8b('0x11')][util[_0x4a8b('0x24')]('SIP/%s',_0x4e88df['name'])])){_0x19d8aa['telephones'][util[_0x4a8b('0x24')](_0x4a8b('0x42'),_0x4e88df[_0x4a8b('0x25')])]=new Telephone(_0x4e88df);}else{_0x19d8aa['mergeFromDatabase'](_0x19d8aa[_0x4a8b('0x11')][util[_0x4a8b('0x24')](_0x4a8b('0x42'),_0x4e88df[_0x4a8b('0x25')])],_0x4e88df);}}}return _0x19d8aa[_0x4a8b('0x11')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x43')]=function(){var _0x3a5ed5=this;return function(_0x2ad0a0){if(_0x2ad0a0){freeIsNotKeySip(_0x2ad0a0,_0x3a5ed5[_0x4a8b('0x12')]);for(var _0x283818=0x0,_0x2106ea={},_0x5ee007={};_0x283818<_0x2ad0a0[_0x4a8b('0x3f')];_0x283818+=0x1){_0x2106ea=_0x2ad0a0[_0x283818];if(_[_0x4a8b('0x40')](_0x3a5ed5[_0x4a8b('0x12')][util[_0x4a8b('0x24')]('SIP/%s',_0x2106ea[_0x4a8b('0x25')])])){_0x3a5ed5['trunks'][util[_0x4a8b('0x24')]('SIP/%s',_0x2106ea[_0x4a8b('0x25')])]=new Trunk(_0x2106ea);}else{_0x3a5ed5[_0x4a8b('0x3d')](_0x3a5ed5[_0x4a8b('0x12')][util['format'](_0x4a8b('0x42'),_0x2106ea[_0x4a8b('0x25')])],_0x2106ea);}}}return _0x3a5ed5[_0x4a8b('0x12')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x44')]=function(){var _0x3614e4=this;return function(_0x5dee02){if(_0x5dee02){freeIsNotKey(_0x5dee02,_0x3614e4[_0x4a8b('0x13')],_0x4a8b('0x25'));for(var _0xea10c7=0x0,_0x5cb80e={},_0x1a8547={};_0xea10c7<_0x5dee02[_0x4a8b('0x3f')];_0xea10c7+=0x1){_0x5cb80e=_0x5dee02[_0xea10c7];if(_['isUndefined'](_0x3614e4[_0x4a8b('0x13')][_0x5cb80e['name']])){_0x3614e4[_0x4a8b('0x13')][_0x5cb80e['name']]=new VoiceQueue(_0x5cb80e);}else{_0x3614e4[_0x4a8b('0x3d')](_0x3614e4[_0x4a8b('0x13')][_0x5cb80e[_0x4a8b('0x25')]],_0x5cb80e);}}}return _0x3614e4[_0x4a8b('0x13')];};};Realtime[_0x4a8b('0x3c')]['initTriggers']=function(){var _0x3bd264=this;return function(_0x63a480){if(_0x63a480){freeIsNotKey(_0x63a480,_0x3bd264['triggers'],'id');for(var _0x2fcc84=0x0,_0x3ee85f={},_0x5af20e={};_0x2fcc84<_0x63a480['length'];_0x2fcc84+=0x1){_0x3ee85f=_0x63a480[_0x2fcc84];if(_[_0x4a8b('0x40')](_0x3bd264[_0x4a8b('0x14')][_0x3ee85f['id']])){_0x3bd264['triggers'][_0x3ee85f['id']]=new Trigger(_0x3ee85f);}else{_0x3bd264[_0x4a8b('0x3d')](_0x3bd264[_0x4a8b('0x14')][_0x3ee85f['id']],_0x3ee85f);}}}return _0x3bd264[_0x4a8b('0x14')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x45')]=function(){var _0x443f4c=this;return function(_0x15dd14){if(_0x15dd14){freeIsNotKey(_0x15dd14,_0x443f4c[_0x4a8b('0x15')],'id');for(var _0x37ef88=0x0,_0x219df5={},_0x436ad0={};_0x37ef88<_0x15dd14[_0x4a8b('0x3f')];_0x37ef88+=0x1){_0x219df5=_0x15dd14[_0x37ef88];if(_[_0x4a8b('0x40')](_0x443f4c[_0x4a8b('0x15')][_0x219df5['id']])){_0x443f4c[_0x4a8b('0x15')][_0x219df5['id']]=new Template(_0x219df5);}else{_0x443f4c['mergeFromDatabase'](_0x443f4c[_0x4a8b('0x15')][_0x219df5['id']],_0x219df5);}}}return _0x443f4c[_0x4a8b('0x15')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x46')]=function(){var _0x326c8b=this;return function(_0x4f21a5){if(_0x4f21a5){freeIsNotKey(_0x4f21a5,_0x326c8b['zendeskAccounts'],'id');for(var _0x15b094=0x0,_0x4e779c={},_0x49b5b6={};_0x15b094<_0x4f21a5[_0x4a8b('0x3f')];_0x15b094+=0x1){_0x4e779c=_0x4f21a5[_0x15b094];if(_['isUndefined'](_0x326c8b[_0x4a8b('0x18')][_0x4e779c['id']])){_0x326c8b[_0x4a8b('0x18')][_0x4e779c['id']]=new ZendeskAccount(_0x4e779c);}else{_0x326c8b[_0x4a8b('0x3d')](_0x326c8b['zendeskAccounts'][_0x4e779c['id']],_0x4e779c);}}}return _0x326c8b['zendeskAccounts'];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x47')]=function(){var _0x564b6e=this;return function(_0x576d77){if(_0x576d77){freeIsNotKey(_0x576d77,_0x564b6e[_0x4a8b('0x19')],'id');for(var _0x25de43=0x0,_0x2db359={},_0x4420ec={};_0x25de43<_0x576d77[_0x4a8b('0x3f')];_0x25de43+=0x1){_0x2db359=_0x576d77[_0x25de43];if(_[_0x4a8b('0x40')](_0x564b6e[_0x4a8b('0x19')][_0x2db359['id']])){_0x564b6e[_0x4a8b('0x19')][_0x2db359['id']]=new SalesforceAccount(_0x2db359);}else{_0x564b6e['mergeFromDatabase'](_0x564b6e[_0x4a8b('0x19')][_0x2db359['id']],_0x2db359);}}}return _0x564b6e[_0x4a8b('0x19')];};};Realtime['prototype'][_0x4a8b('0x48')]=function(){var _0x46ffb0=this;return function(_0x1f6f95){if(_0x1f6f95){freeIsNotKey(_0x1f6f95,_0x46ffb0[_0x4a8b('0x1b')],'id');for(var _0x27e434=0x0,_0x571e15={},_0x39b130={};_0x27e434<_0x1f6f95['length'];_0x27e434+=0x1){_0x571e15=_0x1f6f95[_0x27e434];if(_['isUndefined'](_0x46ffb0[_0x4a8b('0x1b')][_0x571e15['id']])){_0x46ffb0[_0x4a8b('0x1b')][_0x571e15['id']]=new FreshdeskAccount(_0x571e15);}else{_0x46ffb0['mergeFromDatabase'](_0x46ffb0[_0x4a8b('0x1b')][_0x571e15['id']],_0x571e15);}}}return _0x46ffb0['freshdeskAccounts'];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x49')]=function(){var _0xc83b03=this;return function(_0x102f59){if(_0x102f59){freeIsNotKey(_0x102f59,_0xc83b03['zohoAccounts'],'id');for(var _0x556ade=0x0,_0x436e0e={},_0x478773={};_0x556ade<_0x102f59['length'];_0x556ade+=0x1){_0x436e0e=_0x102f59[_0x556ade];if(_['isUndefined'](_0xc83b03['zohoAccounts'][_0x436e0e['id']])){_0xc83b03[_0x4a8b('0x4a')][_0x436e0e['id']]=new ZohoAccount(_0x436e0e);}else{_0xc83b03[_0x4a8b('0x3d')](_0xc83b03[_0x4a8b('0x4a')][_0x436e0e['id']],_0x436e0e);}}}return _0xc83b03[_0x4a8b('0x4a')];};};Realtime['prototype'][_0x4a8b('0x4b')]=function(){var _0x37cf4c=this;return function(_0x4ca260){if(_0x4ca260){freeIsNotKey(_0x4ca260,_0x37cf4c[_0x4a8b('0x1c')],'id');for(var _0x4f5b50=0x0,_0x47885c={},_0x41a432={};_0x4f5b50<_0x4ca260[_0x4a8b('0x3f')];_0x4f5b50+=0x1){_0x47885c=_0x4ca260[_0x4f5b50];if(_[_0x4a8b('0x40')](_0x37cf4c[_0x4a8b('0x1c')][_0x47885c['id']])){_0x37cf4c['deskAccounts'][_0x47885c['id']]=new DeskAccount(_0x47885c);}else{_0x37cf4c['mergeFromDatabase'](_0x37cf4c[_0x4a8b('0x1c')][_0x47885c['id']],_0x47885c);}}}return _0x37cf4c['deskAccounts'];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x4c')]=function(){var _0x2eab86=this;return function(_0x1e8ee2){if(_0x1e8ee2){freeIsNotKey(_0x1e8ee2,_0x2eab86[_0x4a8b('0x1a')],'id');for(var _0x2ac08e=0x0,_0x4d26a4={},_0x396373={};_0x2ac08e<_0x1e8ee2[_0x4a8b('0x3f')];_0x2ac08e+=0x1){_0x4d26a4=_0x1e8ee2[_0x2ac08e];if(_[_0x4a8b('0x40')](_0x2eab86[_0x4a8b('0x1a')][_0x4d26a4['id']])){_0x2eab86['sugarcrmAccounts'][_0x4d26a4['id']]=new SugarcrmAccount(_0x4d26a4);}else{_0x2eab86[_0x4a8b('0x3d')](_0x2eab86[_0x4a8b('0x1a')][_0x4d26a4['id']],_0x4d26a4);}}}return _0x2eab86[_0x4a8b('0x1a')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x3b0236=this;return function(_0x35193e){if(_0x35193e){freeIsNotKey(_0x35193e,_0x3b0236[_0x4a8b('0x1d')],'id');for(var _0x23d88f=0x0,_0xc66256={},_0x16de19={};_0x23d88f<_0x35193e['length'];_0x23d88f+=0x1){_0xc66256=_0x35193e[_0x23d88f];if(_[_0x4a8b('0x40')](_0x3b0236[_0x4a8b('0x1d')][_0xc66256['id']])){_0x3b0236[_0x4a8b('0x1d')][_0xc66256['id']]=new VtigerAccount(_0xc66256);}else{_0x3b0236[_0x4a8b('0x3d')](_0x3b0236[_0x4a8b('0x1d')][_0xc66256['id']],_0xc66256);}}}return _0x3b0236[_0x4a8b('0x1d')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x4d')]=function(){var _0x536c3c=this;return function(_0x1c5cee){if(_0x1c5cee){freeIsNotKey(_0x1c5cee,_0x536c3c['servicenowAccounts'],'id');for(var _0x5883fb=0x0,_0x4c432f={},_0x1c7c7f={};_0x5883fb<_0x1c5cee[_0x4a8b('0x3f')];_0x5883fb+=0x1){_0x4c432f=_0x1c5cee[_0x5883fb];if(_['isUndefined'](_0x536c3c[_0x4a8b('0x1e')][_0x4c432f['id']])){_0x536c3c[_0x4a8b('0x1e')][_0x4c432f['id']]=new ServicenowAccount(_0x4c432f);}else{_0x536c3c[_0x4a8b('0x3d')](_0x536c3c[_0x4a8b('0x1e')][_0x4c432f['id']],_0x4c432f);}}}return _0x536c3c[_0x4a8b('0x1e')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x4e')]=function(){var _0x36203d=this;return function(_0x2585d6){if(_0x2585d6){freeIsNotKey(_0x2585d6,_0x36203d['dynamics365Accounts'],'id');for(var _0x21dab5=0x0,_0x962ac7={},_0x2a9072={};_0x21dab5<_0x2585d6[_0x4a8b('0x3f')];_0x21dab5+=0x1){_0x962ac7=_0x2585d6[_0x21dab5];if(_['isUndefined'](_0x36203d[_0x4a8b('0x1f')][_0x962ac7['id']])){_0x36203d[_0x4a8b('0x1f')][_0x962ac7['id']]=new Dynamics365Account(_0x962ac7);}else{_0x36203d[_0x4a8b('0x3d')](_0x36203d['dynamics365Accounts'][_0x962ac7['id']],_0x962ac7);}}}return _0x36203d[_0x4a8b('0x1f')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x4f')]=function(){var _0x2ee1d7=this;return function(_0x7cc89d){if(_0x7cc89d){freeIsNotKey(_0x7cc89d,_0x2ee1d7[_0x4a8b('0x20')],'id');for(var _0x564b0d=0x0,_0x1e33f7={},_0x5cd4e9={};_0x564b0d<_0x7cc89d[_0x4a8b('0x3f')];_0x564b0d+=0x1){_0x1e33f7=_0x7cc89d[_0x564b0d];if(_[_0x4a8b('0x40')](_0x2ee1d7['freshsalesAccounts'][_0x1e33f7['id']])){_0x2ee1d7[_0x4a8b('0x20')][_0x1e33f7['id']]=new FreshsalesAccount(_0x1e33f7);}else{_0x2ee1d7[_0x4a8b('0x3d')](_0x2ee1d7[_0x4a8b('0x20')][_0x1e33f7['id']],_0x1e33f7);}}}return _0x2ee1d7['freshsalesAccounts'];};};Realtime[_0x4a8b('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x17efa8=this;return function(_0x4706a8){for(var _0x3693e8=0x0;_0x3693e8<_0x4706a8[_0x4a8b('0x3f')];_0x3693e8+=0x1){_[_0x4a8b('0x50')](_0x17efa8[_0x4a8b('0x13')][_0x4706a8[_0x3693e8]['name']],_0x4706a8[_0x3693e8]);}return _0x17efa8[_0x4a8b('0x13')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x51')]=function(){var _0x41fdeb=this;return function(_0x367d36){clearVoiceQueues(_0x41fdeb['voiceQueues']);if(_0x367d36){_0x367d36=_[_0x4a8b('0x52')](_0x367d36,_0x4a8b('0x53'));for(var _0x28a925 in _0x367d36){if(_0x367d36[_0x4a8b('0x23')](_0x28a925)){var _0x1280ad={};for(var _0x1571e1=0x0;_0x1571e1<_0x367d36[_0x28a925][_0x4a8b('0x3f')];_0x1571e1+=0x1){var _0x49b004=_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x54')];if(_0x41fdeb[_0x4a8b('0x13')][_0x49b004]){if(_0x367d36[_0x28a925][_0x1571e1]['queuecallerexit']){_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x30')]+=0x1;}if(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x55')]){_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x31')]+=0x1;}_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x2a')]+=moment(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x56')])[_0x4a8b('0x57')](moment(_0x367d36[_0x28a925][_0x1571e1]['queuecallerjoinAt']),_0x4a8b('0x58'))||0x0;if(_0x1571e1===_0x367d36[_0x28a925]['length']-0x1){_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x2b')]+=moment(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x59')]||_0x367d36[_0x28a925][_0x1571e1]['queuecallerabandonAt']||_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x5a')])[_0x4a8b('0x57')](moment(_0x367d36[_0x28a925][_0x1571e1]['queuecallerjoinAt']),_0x4a8b('0x58'))||0x0;_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x28')]+=0x1;if(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x5b')]){_0x41fdeb['voiceQueues'][_0x49b004][_0x4a8b('0x29')]+=0x1;_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x2c')]+=moment(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x59')])[_0x4a8b('0x57')](moment(_0x367d36[_0x28a925][_0x1571e1][_0x4a8b('0x56')]),_0x4a8b('0x58'))||0x0;}}else{_0x41fdeb['voiceQueues'][_0x49b004][_0x4a8b('0x2b')]+=_0x41fdeb[_0x4a8b('0x13')][_0x49b004][_0x4a8b('0x2a')]||0x0;}}}}}}return _0x41fdeb[_0x4a8b('0x13')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x5c')]=function(){var _0x14277c=this;return function(_0x1aed00){clearVoiceCallReports(_0x14277c[_0x4a8b('0x5d')]);if(_0x1aed00){for(var _0x3391dc=0x0;_0x3391dc<_0x1aed00[_0x4a8b('0x3f')];_0x3391dc+=0x1){_0x14277c[_0x4a8b('0x5d')][_0x4a8b('0x28')]+=0x1;_0x14277c[_0x4a8b('0x5d')][_0x4a8b('0x2b')]+=_0x1aed00[_0x3391dc][_0x4a8b('0x5e')];if(_0x1aed00[_0x3391dc][_0x4a8b('0x5f')]===_0x4a8b('0x60')){_0x14277c[_0x4a8b('0x5d')]['answered']+=0x1;_0x14277c[_0x4a8b('0x5d')][_0x4a8b('0x2a')]+=_0x1aed00[_0x3391dc]['duration']-_0x1aed00[_0x3391dc][_0x4a8b('0x61')]||0x0;_0x14277c[_0x4a8b('0x5d')][_0x4a8b('0x2c')]+=_0x1aed00[_0x3391dc][_0x4a8b('0x61')];}}}return _0x14277c[_0x4a8b('0x5d')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x62')]=function(){var _0x5dae9f=this;return function(_0x191299){if(_0x191299){freeIsNotKey(_0x191299,_0x5dae9f[_0x4a8b('0x63')],_0x4a8b('0x25'));for(var _0xcf931b=0x0,_0x2754fa={};_0xcf931b<_0x191299[_0x4a8b('0x3f')];_0xcf931b+=0x1){_0x2754fa=_0x191299[_0xcf931b];if(_[_0x4a8b('0x40')](_0x5dae9f[_0x4a8b('0x63')][_0x2754fa['name']])){_0x5dae9f[_0x4a8b('0x63')][_0x2754fa[_0x4a8b('0x25')]]=new Campaign(_0x2754fa);}else{_0x5dae9f['mergeFromDatabase'](_0x5dae9f[_0x4a8b('0x63')][_0x2754fa[_0x4a8b('0x25')]],_0x2754fa);_0x5dae9f['campaigns'][_0x2754fa[_0x4a8b('0x25')]][_0x4a8b('0x64')]=_0x2754fa['SquareProject']?_0x2754fa[_0x4a8b('0x65')][_0x4a8b('0x25')]:undefined;}}}return _0x5dae9f[_0x4a8b('0x63')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x66')]=function(){var _0x2957bf=this;return function(_0x114781){if(_0x114781){freeIsNotKey(_0x114781,_0x2957bf[_0x4a8b('0x67')],'id');for(var _0xf85f75=0x0,_0x3e38ad={};_0xf85f75<_0x114781[_0x4a8b('0x3f')];_0xf85f75+=0x1){_0x3e38ad=_0x114781[_0xf85f75];if(_[_0x4a8b('0x40')](_0x2957bf['voiceExtensions'][_0x3e38ad['id']])){_0x2957bf[_0x4a8b('0x67')][_0x3e38ad['id']]=new VoiceExtension(_0x3e38ad);}else{_0x2957bf['mergeFromDatabase'](_0x2957bf[_0x4a8b('0x67')][_0x3e38ad['id']],_0x3e38ad);}}}return _0x2957bf[_0x4a8b('0x67')];};};Realtime[_0x4a8b('0x3c')][_0x4a8b('0x68')]=function(){var _0x12df84=this;return function(_0x9551ca){clearCampaigns(_0x12df84[_0x4a8b('0x63')]);for(var _0x451900=0x0;_0x451900<_0x9551ca['length'];_0x451900+=0x1){_[_0x4a8b('0x50')](_0x12df84[_0x4a8b('0x63')][_0x9551ca[_0x451900][_0x4a8b('0x25')]],_0x9551ca[_0x451900]);}return _0x12df84['campaigns'];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x171cf8=this;return function(_0x2a3f75){if(_0x2a3f75){freeIsNotKey(_0x2a3f75,_0x171cf8['faxAccounts'],'id');for(var _0x396613=0x0,_0x40166d={},_0xe64770={};_0x396613<_0x2a3f75[_0x4a8b('0x3f')];_0x396613+=0x1){_0x40166d=_0x2a3f75[_0x396613];if(_[_0x4a8b('0x40')](_0x171cf8['faxAccounts'][_0x40166d['id']])){_0x171cf8[_0x4a8b('0x21')][_0x40166d['id']]=new FaxAccount(_0x40166d);}else{_0x171cf8[_0x4a8b('0x3d')](_0x171cf8[_0x4a8b('0x21')][_0x40166d['id']],_0x40166d);}}}return _0x171cf8['faxAccounts'];};};module[_0x4a8b('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 2acb994..9e5ea24 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 _0xb12b=['accountcode','name','isNil','interface','SIP/%s','length','assigned','lastAssignedTo','format','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','Local','indexOf','mobile','phone','lastIndexOf','exports','bluebird','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0xb12b,0x135));var _0xbb12=function(_0x3ccfe2,_0x5b30e5){_0x3ccfe2=_0x3ccfe2-0x0;var _0x3811f8=_0xb12b[_0x3ccfe2];return _0x3811f8;};'use strict';var BPromise=require(_0xbb12('0x0'));var _=require('lodash');var moment=require(_0xbb12('0x1'));var util=require(_0xbb12('0x2'));var config=require(_0xbb12('0x3'));var logger=require(_0xbb12('0x4'))(_0xbb12('0x5'));var ami=require(_0xbb12('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xbb12('0x7'));var RpcVoiceDialReport=require(_0xbb12('0x8'));var RpcMemberReport=require(_0xbb12('0x9'));var RpcVoiceQueueReport=require(_0xbb12('0xa'));var RpcVoiceRecording=require(_0xbb12('0xb'));var RpcVoiceTransferReport=require(_0xbb12('0xc'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xbb12('0xd'));var VoiceAgentReport=require(_0xbb12('0xe'));var VoiceDialReport=require(_0xbb12('0xf'));var UserReport=require(_0xbb12('0x10'));function Report(_0x2ec9cb){this[_0xbb12('0x11')]=_0x2ec9cb;this[_0xbb12('0x12')]=_0x2ec9cb[_0xbb12('0x12')];this[_0xbb12('0x13')]=_0x2ec9cb['telephones'];}Report[_0xbb12('0x14')]['sync']=function(_0x4769bf){var _0x1f38bf=new VoiceQueueReport(this[_0xbb12('0x11')]);var _0x5ca66a=new VoiceAgentReport(this['realtime']);var _0x1113f3=new VoiceDialReport(this[_0xbb12('0x11')]);var _0x2fc1a1=new VoiceCallReport(this[_0xbb12('0x11')]);var _0x4989e7=new UserReport(this['realtime']);if(config[_0xbb12('0x15')]&&config[_0xbb12('0x15')][_0xbb12('0x16')]){ami['on']('custom:voiceQueueReport',this[_0xbb12('0x17')][_0xbb12('0x18')](this));ami['on'](_0xbb12('0x19'),this['voiceCallReport'][_0xbb12('0x18')](this));ami['on']('custom:voiceAgentReport',this[_0xbb12('0x1a')][_0xbb12('0x18')](this));ami['on'](_0xbb12('0x1b'),this[_0xbb12('0x1c')][_0xbb12('0x18')](this));ami['on'](_0xbb12('0x1d'),this[_0xbb12('0x1e')][_0xbb12('0x18')](this));ami['on'](_0xbb12('0x1f'),this[_0xbb12('0x20')][_0xbb12('0x18')](this));}};Report[_0xbb12('0x14')][_0xbb12('0x21')]=function(_0x5ce871){var _0x5107c3=undefined;_0x5107c3=_[_0xbb12('0x22')](this[_0xbb12('0x12')],function(_0x3f3619){return _0x3f3619[_0xbb12('0x23')]==_0x5ce871||_0x3f3619[_0xbb12('0x24')]==_0x5ce871;});if(_[_0xbb12('0x25')](_0x5107c3)){var _0x37eda2=_[_0xbb12('0x22')](this[_0xbb12('0x13')],function(_0x29783b){return _0x29783b['accountcode']==_0x5ce871||_0x29783b['name']==_0x5ce871;});if(_0x37eda2){_0x5107c3=_['find'](this[_0xbb12('0x12')],function(_0x12ad69){return _0x12ad69[_0xbb12('0x26')]==util['format'](_0xbb12('0x27'),_0x37eda2[_0xbb12('0x24')]);});}}return _0x5107c3;};Report[_0xbb12('0x14')]['voiceQueueReport']=function(_0x1fda16){for(var _0x4b04d9=0x0;_0x4b04d9<_0x1fda16[_0xbb12('0x28')];_0x4b04d9+=0x1){var _0x1a1c0d=this[_0xbb12('0x21')](_0x1fda16[_0x4b04d9]['connectedlinenum']);if(_0x1a1c0d){_0x1fda16[_0x4b04d9][_0xbb12('0x23')]=_0x1a1c0d[_0xbb12('0x23')];_0x1fda16[_0x4b04d9][_0xbb12('0x29')]=!![];_0x1fda16[_0x4b04d9][_0xbb12('0x2a')]=_0x1a1c0d[_0xbb12('0x24')];_0x1fda16[_0x4b04d9][_0xbb12('0x26')]=_[_0xbb12('0x25')](_0x1a1c0d[_0xbb12('0x26')])?util[_0xbb12('0x2b')](_0xbb12('0x27'),_0x1a1c0d[_0xbb12('0x24')]):_0x1a1c0d[_0xbb12('0x26')];if(_0x1fda16[_0x4b04d9]['queuecallercomplete']){_0x1fda16[_0x4b04d9][_0xbb12('0x2c')]=moment()[_0xbb12('0x2b')](_0xbb12('0x2d'));}if(_0x1fda16[_0x4b04d9][_0xbb12('0x2e')]){_0x1fda16[_0x4b04d9][_0xbb12('0x2f')]=moment()['format'](_0xbb12('0x2d'));}RpcMemberReport[_0xbb12('0x17')](_0x1fda16[_0x4b04d9]);}RpcVoiceQueueReport[_0xbb12('0x30')](_0x1fda16[_0x4b04d9]);}};function extractCalleridNumber(_0x56bf8d){var _0x4177b7=_0x56bf8d[_0xbb12('0x31')](/<(.*?)>/);return _0x4177b7?_0x4177b7[0x1]:_0x56bf8d;}Report[_0xbb12('0x14')][_0xbb12('0x32')]=function(_0x4e9bd4){_0x4e9bd4[_0xbb12('0x33')]=_0x4e9bd4[_0xbb12('0x33')]||_0x4e9bd4[_0xbb12('0x34')];if(_0x4e9bd4[_0xbb12('0x35')]==_0xbb12('0x36')){_0x4e9bd4[_0xbb12('0x37')]=_0xbb12('0x38');_0x4e9bd4[_0xbb12('0x39')]=_0x4e9bd4['queue'];if(_0x4e9bd4[_0xbb12('0x3a')]==_0xbb12('0x3b')){_0x4e9bd4['accountcode']='';_0x4e9bd4['destination']=extractCalleridNumber(_0x4e9bd4[_0xbb12('0x3c')]);}else if(_0x4e9bd4[_0xbb12('0x3a')]=='from-sip'){if(_0x4e9bd4[_0xbb12('0x33')]==_0xbb12('0x3d')){_0x4e9bd4['destination']=extractCalleridNumber(_0x4e9bd4[_0xbb12('0x3e')]);_0x4e9bd4[_0xbb12('0x3f')]=_0x4e9bd4['originatecalleridnum'];_0x4e9bd4[_0xbb12('0x40')]=[_0x4e9bd4[_0xbb12('0x41')],_0x4e9bd4[_0xbb12('0x41')]=_0x4e9bd4['destinationchannel']][0x0];_0x4e9bd4[_0xbb12('0x3c')]=_0x4e9bd4['calleridpreview'];}else{_0x4e9bd4['destination']=_0x4e9bd4[_0xbb12('0x3f')];_0x4e9bd4[_0xbb12('0x3f')]=_0x4e9bd4[_0xbb12('0x42')];if(_0x4e9bd4['disposition']==_0xbb12('0x43')){_0x4e9bd4[_0xbb12('0x23')]=_0x4e9bd4[_0xbb12('0x44')];}else{_0x4e9bd4[_0xbb12('0x23')]='';}}}}else{_0x4e9bd4[_0xbb12('0x3c')]=util[_0xbb12('0x2b')](_0xbb12('0x45'),_0x4e9bd4[_0xbb12('0x46')],_0x4e9bd4[_0xbb12('0x3f')]);}RpcVoiceCallReport[_0xbb12('0x30')](_0x4e9bd4);if(_0x4e9bd4['monitor']){for(var _0x89bd82=0x0;_0x89bd82<_0x4e9bd4[_0xbb12('0x47')]['length'];_0x89bd82+=0x1){_0x4e9bd4[_0xbb12('0x48')]=_0x4e9bd4[_0xbb12('0x47')][_0x89bd82][_0xbb12('0x49')];_0x4e9bd4[_0xbb12('0x4a')]=_0x4e9bd4['monitors'][_0x89bd82][_0xbb12('0x4a')];if(_0x4e9bd4['exten']=='xcally-motion-preview'){_0x4e9bd4['calleridnum']=_0x4e9bd4[_0xbb12('0x44')];_0x4e9bd4['calleridname']=_0x4e9bd4[_0xbb12('0x4b')];_0x4e9bd4['connectedlinenum']=_0x4e9bd4[_0xbb12('0x23')];_0x4e9bd4[_0xbb12('0x4b')]=_0x4e9bd4[_0xbb12('0x4c')];_0x4e9bd4['exten']=_0x4e9bd4['originatecalleridnum'];}else if(_0x4e9bd4['exten']==_0xbb12('0x4d')){_0x4e9bd4['calleridnum']=_0x4e9bd4[_0xbb12('0x33')];_0x4e9bd4[_0xbb12('0x34')]=_0x4e9bd4['originatecalleridnum'];}RpcVoiceRecording[_0xbb12('0x30')](_0x4e9bd4);}}};Report[_0xbb12('0x14')][_0xbb12('0x1a')]=function(_0x7812d8){if(_[_0xbb12('0x4e')](_0x7812d8)){_0x7812d8[_0xbb12('0x4f')](function(_0x40999f){RpcVoiceAgentReport[_0xbb12('0x30')](_0x40999f);});}else{RpcVoiceAgentReport[_0xbb12('0x30')](_0x7812d8);}};Report[_0xbb12('0x14')][_0xbb12('0x1c')]=function(_0x325857){RpcVoiceDialReport['create'](_0x325857);var _0x2cd40b=undefined;var _0x1c7ad1=_0x325857[_0xbb12('0x41')];if(_['startsWith'](_0x1c7ad1,_0xbb12('0x50'))){var _0x22ea7c=_0x1c7ad1['substring'](_0x1c7ad1['indexOf']('/')+0x1,_0x1c7ad1[_0xbb12('0x51')]('@'));_0x2cd40b=_[_0xbb12('0x22')](this[_0xbb12('0x12')],function(_0x87c9fa){return _0x87c9fa[_0xbb12('0x52')]==_0x22ea7c||_0x87c9fa[_0xbb12('0x53')]==_0x22ea7c||_0x87c9fa[_0xbb12('0x23')]==_0x22ea7c;});}else{var _0x22ea7c=_0x1c7ad1['substring'](_0x1c7ad1[_0xbb12('0x51')]('/')+0x1,_0x1c7ad1[_0xbb12('0x54')]('-'));_0x2cd40b=this[_0xbb12('0x21')](_0x22ea7c);}if(_0x2cd40b){_0x325857[_0xbb12('0x26')]=_[_0xbb12('0x25')](_0x2cd40b[_0xbb12('0x26')])?util[_0xbb12('0x2b')](_0xbb12('0x27'),_0x2cd40b[_0xbb12('0x24')]):_0x2cd40b['interface'];_0x325857[_0xbb12('0x4c')]=_0x2cd40b[_0xbb12('0x24')];_0x325857[_0xbb12('0x23')]=_0x2cd40b['accountcode'];RpcMemberReport[_0xbb12('0x1c')](_0x325857);}};Report[_0xbb12('0x14')][_0xbb12('0x1e')]=function(_0x233f43){RpcVoiceTransferReport[_0xbb12('0x1e')](_0x233f43);};Report[_0xbb12('0x14')][_0xbb12('0x20')]=function(_0x1b526d){RpcVoiceTransferReport[_0xbb12('0x20')](_0x1b526d);};module[_0xbb12('0x55')]=Report; \ No newline at end of file +var _0xb0fe=['isArray','startsWith','Local','indexOf','phone','substring','lastIndexOf','exports','bluebird','lodash','moment','../../../config/logger','../ami','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','sync','custom:voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','assigned','queuecallercomplete','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','dialer','lastapplication','lastdata','queue','context','callerid','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitors','length','monitorFilename','filename','createdAt','calleridname','connectedlinename','accountcode','membername','xcally-motion-dialer'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0xb0fe,0xa6));var _0xeb0f=function(_0x31506e,_0x1412b2){_0x31506e=_0x31506e-0x0;var _0x316c44=_0xb0fe[_0x31506e];return _0x316c44;};'use strict';var BPromise=require(_0xeb0f('0x0'));var _=require(_0xeb0f('0x1'));var moment=require(_0xeb0f('0x2'));var util=require('util');var config=require('../../../config/environment');var logger=require(_0xeb0f('0x3'))('ami');var ami=require(_0xeb0f('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xeb0f('0x5'));var RpcVoiceQueueReport=require(_0xeb0f('0x6'));var RpcVoiceRecording=require(_0xeb0f('0x7'));var RpcVoiceTransferReport=require(_0xeb0f('0x8'));var VoiceQueueReport=require(_0xeb0f('0x9'));var VoiceCallReport=require(_0xeb0f('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xeb0f('0xb'));var UserReport=require('./userReport');function Report(_0x328f92){this[_0xeb0f('0xc')]=_0x328f92;this['agents']=_0x328f92[_0xeb0f('0xd')];this[_0xeb0f('0xe')]=_0x328f92[_0xeb0f('0xe')];}Report['prototype'][_0xeb0f('0xf')]=function(_0x1dee27){var _0x51629a=new VoiceQueueReport(this[_0xeb0f('0xc')]);var _0x4f1faa=new VoiceAgentReport(this[_0xeb0f('0xc')]);var _0x295c8d=new VoiceDialReport(this[_0xeb0f('0xc')]);var _0x39ac63=new VoiceCallReport(this[_0xeb0f('0xc')]);var _0x356b70=new UserReport(this['realtime']);if(config['xdr']&&config['xdr']['disabled']){ami['on'](_0xeb0f('0x10'),this['voiceQueueReport'][_0xeb0f('0x11')](this));ami['on']('custom:voiceCallReport',this[_0xeb0f('0x12')][_0xeb0f('0x11')](this));ami['on'](_0xeb0f('0x13'),this[_0xeb0f('0x14')][_0xeb0f('0x11')](this));ami['on'](_0xeb0f('0x15'),this[_0xeb0f('0x16')][_0xeb0f('0x11')](this));ami['on']('blindtransfer',this[_0xeb0f('0x17')][_0xeb0f('0x11')](this));ami['on'](_0xeb0f('0x18'),this[_0xeb0f('0x19')][_0xeb0f('0x11')](this));}};Report[_0xeb0f('0x1a')][_0xeb0f('0x1b')]=function(_0x39c602){var _0x438abe=undefined;_0x438abe=_[_0xeb0f('0x1c')](this[_0xeb0f('0xd')],function(_0x5ba18f){return _0x5ba18f['accountcode']==_0x39c602||_0x5ba18f[_0xeb0f('0x1d')]==_0x39c602;});if(_[_0xeb0f('0x1e')](_0x438abe)){var _0x565ae4=_[_0xeb0f('0x1c')](this[_0xeb0f('0xe')],function(_0x3e5771){return _0x3e5771['accountcode']==_0x39c602||_0x3e5771['name']==_0x39c602;});if(_0x565ae4){_0x438abe=_[_0xeb0f('0x1c')](this['agents'],function(_0x33138e){return _0x33138e[_0xeb0f('0x1f')]==util[_0xeb0f('0x20')](_0xeb0f('0x21'),_0x565ae4[_0xeb0f('0x1d')]);});}}return _0x438abe;};Report[_0xeb0f('0x1a')][_0xeb0f('0x22')]=function(_0x4f4ba0){for(var _0x1206e0=0x0;_0x1206e0<_0x4f4ba0['length'];_0x1206e0+=0x1){var _0x1414a8=this[_0xeb0f('0x1b')](_0x4f4ba0[_0x1206e0][_0xeb0f('0x23')]);if(_0x1414a8){_0x4f4ba0[_0x1206e0]['accountcode']=_0x1414a8['accountcode'];_0x4f4ba0[_0x1206e0][_0xeb0f('0x24')]=!![];_0x4f4ba0[_0x1206e0]['lastAssignedTo']=_0x1414a8[_0xeb0f('0x1d')];_0x4f4ba0[_0x1206e0][_0xeb0f('0x1f')]=_[_0xeb0f('0x1e')](_0x1414a8[_0xeb0f('0x1f')])?util[_0xeb0f('0x20')](_0xeb0f('0x21'),_0x1414a8[_0xeb0f('0x1d')]):_0x1414a8['interface'];if(_0x4f4ba0[_0x1206e0][_0xeb0f('0x25')]){_0x4f4ba0[_0x1206e0]['queuecallercompleteAt']=moment()[_0xeb0f('0x20')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4f4ba0[_0x1206e0][_0xeb0f('0x26')]){_0x4f4ba0[_0x1206e0]['queuecallerexitAt']=moment()['format'](_0xeb0f('0x27'));}RpcMemberReport['voiceQueueReport'](_0x4f4ba0[_0x1206e0]);}RpcVoiceQueueReport[_0xeb0f('0x28')](_0x4f4ba0[_0x1206e0]);}};function extractCalleridNumber(_0x3017ba){var _0x345798=_0x3017ba[_0xeb0f('0x29')](/<(.*?)>/);return _0x345798?_0x345798[0x1]:_0x3017ba;}Report['prototype'][_0xeb0f('0x12')]=function(_0x59e600){_0x59e600[_0xeb0f('0x2a')]=_0x59e600['destination']||_0x59e600[_0xeb0f('0x2b')];if(_0x59e600[_0xeb0f('0x2c')]==_0xeb0f('0x2d')){_0x59e600[_0xeb0f('0x2e')]='queue';_0x59e600[_0xeb0f('0x2f')]=_0x59e600[_0xeb0f('0x30')];if(_0x59e600[_0xeb0f('0x31')]=='from-voip-provider'){_0x59e600['accountcode']='';_0x59e600[_0xeb0f('0x2a')]=extractCalleridNumber(_0x59e600[_0xeb0f('0x32')]);}else if(_0x59e600['context']==_0xeb0f('0x33')){if(_0x59e600[_0xeb0f('0x2a')]==_0xeb0f('0x34')){_0x59e600[_0xeb0f('0x2a')]=extractCalleridNumber(_0x59e600['calleridpreview']);_0x59e600['calleridnum']=_0x59e600[_0xeb0f('0x35')];_0x59e600[_0xeb0f('0x36')]=[_0x59e600[_0xeb0f('0x37')],_0x59e600['channel']=_0x59e600[_0xeb0f('0x36')]][0x0];_0x59e600['callerid']=_0x59e600['calleridpreview'];}else{_0x59e600[_0xeb0f('0x2a')]=_0x59e600['calleridnum'];_0x59e600[_0xeb0f('0x38')]=_0x59e600[_0xeb0f('0x35')];if(_0x59e600[_0xeb0f('0x39')]==_0xeb0f('0x3a')){_0x59e600['accountcode']=_0x59e600[_0xeb0f('0x23')];}else{_0x59e600['accountcode']='';}}}}else{_0x59e600[_0xeb0f('0x32')]=util['format'](_0xeb0f('0x3b'),_0x59e600['calleridname'],_0x59e600[_0xeb0f('0x38')]);}RpcVoiceCallReport[_0xeb0f('0x28')](_0x59e600);if(_0x59e600[_0xeb0f('0x3c')]){for(var _0x164928=0x0;_0x164928<_0x59e600[_0xeb0f('0x3d')][_0xeb0f('0x3e')];_0x164928+=0x1){_0x59e600[_0xeb0f('0x3f')]=_0x59e600[_0xeb0f('0x3d')][_0x164928][_0xeb0f('0x40')];_0x59e600[_0xeb0f('0x41')]=_0x59e600[_0xeb0f('0x3d')][_0x164928][_0xeb0f('0x41')];if(_0x59e600['exten']==_0xeb0f('0x34')){_0x59e600[_0xeb0f('0x38')]=_0x59e600['connectedlinenum'];_0x59e600[_0xeb0f('0x42')]=_0x59e600[_0xeb0f('0x43')];_0x59e600[_0xeb0f('0x23')]=_0x59e600[_0xeb0f('0x44')];_0x59e600[_0xeb0f('0x43')]=_0x59e600[_0xeb0f('0x45')];_0x59e600[_0xeb0f('0x2b')]=_0x59e600[_0xeb0f('0x35')];}else if(_0x59e600['exten']==_0xeb0f('0x46')){_0x59e600[_0xeb0f('0x38')]=_0x59e600['destination'];_0x59e600['exten']=_0x59e600['originatecalleridnum'];}RpcVoiceRecording[_0xeb0f('0x28')](_0x59e600);}}};Report[_0xeb0f('0x1a')][_0xeb0f('0x14')]=function(_0x2dab8a){if(_[_0xeb0f('0x47')](_0x2dab8a)){_0x2dab8a['forEach'](function(_0xd00945){RpcVoiceAgentReport[_0xeb0f('0x28')](_0xd00945);});}else{RpcVoiceAgentReport[_0xeb0f('0x28')](_0x2dab8a);}};Report['prototype'][_0xeb0f('0x16')]=function(_0x3f95f6){RpcVoiceDialReport[_0xeb0f('0x28')](_0x3f95f6);var _0x44d708=undefined;var _0xa12d42=_0x3f95f6['channel'];if(_[_0xeb0f('0x48')](_0xa12d42,_0xeb0f('0x49'))){var _0x2d9e26=_0xa12d42['substring'](_0xa12d42[_0xeb0f('0x4a')]('/')+0x1,_0xa12d42[_0xeb0f('0x4a')]('@'));_0x44d708=_[_0xeb0f('0x1c')](this[_0xeb0f('0xd')],function(_0x2cbe38){return _0x2cbe38['mobile']==_0x2d9e26||_0x2cbe38[_0xeb0f('0x4b')]==_0x2d9e26||_0x2cbe38[_0xeb0f('0x44')]==_0x2d9e26;});}else{var _0x2d9e26=_0xa12d42[_0xeb0f('0x4c')](_0xa12d42[_0xeb0f('0x4a')]('/')+0x1,_0xa12d42[_0xeb0f('0x4d')]('-'));_0x44d708=this[_0xeb0f('0x1b')](_0x2d9e26);}if(_0x44d708){_0x3f95f6['interface']=_[_0xeb0f('0x1e')](_0x44d708[_0xeb0f('0x1f')])?util['format'](_0xeb0f('0x21'),_0x44d708['name']):_0x44d708[_0xeb0f('0x1f')];_0x3f95f6[_0xeb0f('0x45')]=_0x44d708['name'];_0x3f95f6[_0xeb0f('0x44')]=_0x44d708['accountcode'];RpcMemberReport[_0xeb0f('0x16')](_0x3f95f6);}};Report[_0xeb0f('0x1a')][_0xeb0f('0x17')]=function(_0x48d4e5){RpcVoiceTransferReport[_0xeb0f('0x17')](_0x48d4e5);};Report[_0xeb0f('0x1a')][_0xeb0f('0x19')]=function(_0x37aea2){RpcVoiceTransferReport[_0xeb0f('0x19')](_0x37aea2);};module[_0xeb0f('0x4e')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 7d8ed31..f2b1153 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 _0x5716=['toNumber','updateStatusRealtime','telephones','format','telephone:%s','telephone:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','peer','registered','address','status','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','trunks','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','prototype','isNotNull','emit','find','stateRegistry','state','event','actionid','username','trunk:%s','name','trunk:save','error','[syncRegistry][UserReport]','syncDeviceState','agents','device','local','toLowerCase','stateTime'];(function(_0x296897,_0x4d23ea){var _0x2b44ab=function(_0xdf90d8){while(--_0xdf90d8){_0x296897['push'](_0x296897['shift']());}};_0x2b44ab(++_0x4d23ea);}(_0x5716,0x11b));var _0x6571=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x5716[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0x6571('0x0'));var moment=require(_0x6571('0x1'));var BPromise=require(_0x6571('0x2'));var util=require(_0x6571('0x3'));var Redis=require(_0x6571('0x4'));var config=require(_0x6571('0x5'));var logger=require(_0x6571('0x6'))(_0x6571('0x7'));var ami=require(_0x6571('0x8'));config[_0x6571('0x9')]=_[_0x6571('0xa')](config[_0x6571('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6571('0x9')]));function UserReport(_0x1e4568){this[_0x6571('0xb')]=_0x1e4568['trunks'];this['agents']=_0x1e4568['agents'];this['telephones']=_0x1e4568['telephones'];ami['on'](_0x6571('0xc'),this[_0x6571('0xd')][_0x6571('0xe')](this));ami['on'](_0x6571('0xf'),this['syncRegistry']['bind'](this));ami['on'](_0x6571('0x10'),this['syncDeviceState'][_0x6571('0xe')](this));ami['on'](_0x6571('0x11'),this[_0x6571('0x12')][_0x6571('0xe')](this));this[_0x6571('0x13')]();return BPromise[_0x6571('0x14')]()[_0x6571('0x15')](ami['actionSipShowRegistry']())['then'](ami[_0x6571('0x16')]())['then'](ami[_0x6571('0x17')]())[_0x6571('0x18')](loggerCatch(_0x6571('0x19')));}function loggerCatch(_0x4b8f3f){return function(_0x158a1a){logger['error'](_0x4b8f3f,util[_0x6571('0x1a')](_0x158a1a,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x6571('0x13')]=function(){setInterval(function(){BPromise[_0x6571('0x14')]()[_0x6571('0x15')](ami['actionSipShowRegistry']())[_0x6571('0x15')](ami[_0x6571('0x16')]())[_0x6571('0x15')](ami[_0x6571('0x17')]())['catch'](loggerCatch(_0x6571('0x19')));},0x32c8);};UserReport[_0x6571('0x1b')][_0x6571('0x1c')]=function(_0x27d195){return _0x27d195!==null&&!_['isUndefined'](_0x27d195);};UserReport['prototype'][_0x6571('0x1d')]=function(_0x3fc7e6,_0x418da0,_0x526347){io['to'](_0x3fc7e6)['emit'](_0x418da0,_0x526347);};UserReport[_0x6571('0x1b')]['syncRegistry']=function(_0xe0b974){try{if(this[_0x6571('0x1c')](_0xe0b974)){var _0xe0abde=_[_0x6571('0x1e')](this[_0x6571('0xb')],{'registry':_0xe0b974['username']});if(_0xe0abde){_0xe0b974[_0x6571('0x1f')]=_0xe0b974[_0x6571('0x20')];_['merge'](_0xe0abde,_['omit'](_0xe0b974,[_0x6571('0x21'),_0x6571('0x22'),_0x6571('0x23'),_0x6571('0x20')]));this[_0x6571('0x1d')](util['format'](_0x6571('0x24'),_0xe0abde[_0x6571('0x25')]),_0x6571('0x26'),_0xe0abde);}}}catch(_0x2ac96f){logger[_0x6571('0x27')](_0x6571('0x28'),util[_0x6571('0x1a')](_0x2ac96f,{'showHidden':![],'depth':null}));}};UserReport[_0x6571('0x1b')][_0x6571('0x29')]=function(_0x49aa1d){try{if(this[_0x6571('0x1c')](_0x49aa1d)){if(this[_0x6571('0x2a')][_0x49aa1d['device']]){if(!this['agents'][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x2c')]||_0x49aa1d[_0x6571('0x20')]['toLowerCase']()=='inuse'){this[_0x6571('0x2a')][_0x49aa1d[_0x6571('0x2b')]]['local']=![];if(this[_0x6571('0x2a')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]!==_0x49aa1d[_0x6571('0x20')][_0x6571('0x2d')]()){this[_0x6571('0x2a')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x2e')]=_[_0x6571('0x2f')](moment()['format']('x'));}this[_0x6571('0x2a')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]=_0x49aa1d[_0x6571('0x20')]['toLowerCase']();this[_0x6571('0x2a')][_0x49aa1d['device']][_0x6571('0x30')](_0x49aa1d);}}else if(this[_0x6571('0x31')][_0x49aa1d[_0x6571('0x2b')]]){if(this[_0x6571('0x31')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]!==_0x49aa1d['state'][_0x6571('0x2d')]()){this[_0x6571('0x31')][_0x49aa1d[_0x6571('0x2b')]]['stateTime']=_[_0x6571('0x2f')](moment()['format']('x'));}this[_0x6571('0x31')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]=_0x49aa1d[_0x6571('0x20')]['toLowerCase']();this[_0x6571('0x1d')](util[_0x6571('0x32')](_0x6571('0x33'),this['telephones'][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x25')]),_0x6571('0x34'),this[_0x6571('0x31')][_0x49aa1d[_0x6571('0x2b')]]);}else if(this['trunks'][_0x49aa1d['device']]){if(this[_0x6571('0xb')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]!==_0x49aa1d[_0x6571('0x20')][_0x6571('0x2d')]()){this[_0x6571('0xb')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x2e')]=_[_0x6571('0x2f')](moment()[_0x6571('0x32')]('x'));}this['trunks'][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x20')]=_0x49aa1d[_0x6571('0x20')]['toLowerCase']();this['emit'](util[_0x6571('0x32')](_0x6571('0x24'),this[_0x6571('0xb')][_0x49aa1d[_0x6571('0x2b')]][_0x6571('0x25')]),_0x6571('0x26'),this[_0x6571('0xb')][_0x49aa1d[_0x6571('0x2b')]]);}else if(_[_0x6571('0x35')](_0x49aa1d['device'],'Queue')){}else if(_[_0x6571('0x35')](_0x49aa1d[_0x6571('0x2b')],_0x6571('0x36'))){var _0x3b3d45=_0x49aa1d['device'];var _0x125311=_0x3b3d45[_0x6571('0x37')](_0x3b3d45[_0x6571('0x38')]('/')+0x1,_0x3b3d45[_0x6571('0x38')]('@'));var _0x1e57ad=_[_0x6571('0x1e')](this[_0x6571('0x2a')],function(_0x36a19e){return _0x36a19e[_0x6571('0x39')]==_0x125311||_0x36a19e[_0x6571('0x3a')]==_0x125311||_0x36a19e[_0x6571('0x3b')]==_0x125311;});if(_0x1e57ad){if(_0x1e57ad['state']!==_0x49aa1d[_0x6571('0x20')]['toLowerCase']()){_0x1e57ad[_0x6571('0x2e')]=_['toNumber'](moment()[_0x6571('0x32')]('x'));}_0x1e57ad[_0x6571('0x20')]=_0x49aa1d[_0x6571('0x20')][_0x6571('0x2d')]();_0x1e57ad[_0x6571('0x2c')]=!![];_0x1e57ad[_0x6571('0x30')](_0x49aa1d);}}else{}}}catch(_0x4e1048){logger[_0x6571('0x27')]('[syncDeviceState][UserReport]',util[_0x6571('0x1a')](_0x4e1048,{'showHidden':![],'depth':null}));}};UserReport[_0x6571('0x1b')][_0x6571('0x12')]=function(_0x3b6036){try{if(this[_0x6571('0x1c')](_0x3b6036)&&this[_0x6571('0x1c')](_0x3b6036[_0x6571('0x11')])){if(this['agents'][_0x3b6036[_0x6571('0x3c')]]){if(!this['agents'][_0x3b6036[_0x6571('0x3c')]][_0x6571('0x2c')]||_0x3b6036[_0x6571('0x11')][_0x6571('0x2d')]()==_0x6571('0x3d')){this[_0x6571('0x2a')][_0x3b6036['peer']][_0x6571('0x2c')]=![];this['agents'][_0x3b6036[_0x6571('0x3c')]]['status']=_0x3b6036[_0x6571('0x11')][_0x6571('0x2d')]();this['agents'][_0x3b6036['peer']][_0x6571('0x3e')]=_0x3b6036[_0x6571('0x3e')];this[_0x6571('0x2a')][_0x3b6036[_0x6571('0x3c')]][_0x6571('0x30')](_0x3b6036);}}else if(this[_0x6571('0x31')][_0x3b6036[_0x6571('0x3c')]]){this[_0x6571('0x31')][_0x3b6036['peer']][_0x6571('0x3f')]=_0x3b6036[_0x6571('0x11')][_0x6571('0x2d')]();this['telephones'][_0x3b6036['peer']][_0x6571('0x3e')]=_0x3b6036[_0x6571('0x3e')];this[_0x6571('0x1d')](util[_0x6571('0x32')]('telephone:%s',this[_0x6571('0x31')][_0x3b6036['peer']][_0x6571('0x25')]),'telephone:save',this[_0x6571('0x31')][_0x3b6036[_0x6571('0x3c')]]);}else if(this[_0x6571('0xb')][_0x3b6036[_0x6571('0x3c')]]){this[_0x6571('0xb')][_0x3b6036['peer']][_0x6571('0x3f')]=_0x3b6036[_0x6571('0x11')][_0x6571('0x2d')]();this[_0x6571('0xb')][_0x3b6036[_0x6571('0x3c')]][_0x6571('0x3e')]=_0x3b6036['address'];this['emit'](util[_0x6571('0x32')](_0x6571('0x24'),this[_0x6571('0xb')][_0x3b6036[_0x6571('0x3c')]][_0x6571('0x25')]),_0x6571('0x26'),this['trunks'][_0x3b6036[_0x6571('0x3c')]]);}else{}}}catch(_0x10dc46){logger[_0x6571('0x27')](_0x6571('0x40'),util[_0x6571('0x1a')](_0x10dc46,{'showHidden':![],'depth':null}));}};module[_0x6571('0x41')]=UserReport; \ No newline at end of file +var _0x9332=['indexOf','phone','accountcode','syncPeerStatus','peer','registered','status','address','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','agents','telephones','registryentry','bind','registry','devicestatechange','syncDeviceState','peerstatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','emit','syncRegistry','find','stateRegistry','state','merge','omit','event','actionid','username','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','isNotNull','device','local','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','trunks','startsWith','Local','substring'];(function(_0x13ba52,_0x102381){var _0x4918c2=function(_0x1bd1f7){while(--_0x1bd1f7){_0x13ba52['push'](_0x13ba52['shift']());}};_0x4918c2(++_0x102381);}(_0x9332,0x1c9));var _0x2933=function(_0x42c20c,_0x31c57d){_0x42c20c=_0x42c20c-0x0;var _0x3d9b1e=_0x9332[_0x42c20c];return _0x3d9b1e;};'use strict';var _=require(_0x2933('0x0'));var moment=require(_0x2933('0x1'));var BPromise=require(_0x2933('0x2'));var util=require('util');var Redis=require(_0x2933('0x3'));var config=require(_0x2933('0x4'));var logger=require(_0x2933('0x5'))('ami');var ami=require('../ami');config[_0x2933('0x6')]=_[_0x2933('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2933('0x8'))(new Redis(config[_0x2933('0x6')]));function UserReport(_0x4fea4b){this['trunks']=_0x4fea4b['trunks'];this['agents']=_0x4fea4b[_0x2933('0x9')];this[_0x2933('0xa')]=_0x4fea4b[_0x2933('0xa')];ami['on'](_0x2933('0xb'),this['syncRegistry'][_0x2933('0xc')](this));ami['on'](_0x2933('0xd'),this['syncRegistry'][_0x2933('0xc')](this));ami['on'](_0x2933('0xe'),this[_0x2933('0xf')][_0x2933('0xc')](this));ami['on'](_0x2933('0x10'),this['syncPeerStatus'][_0x2933('0xc')](this));this[_0x2933('0x11')]();return BPromise['resolve']()[_0x2933('0x12')](ami[_0x2933('0x13')]())['then'](ami['actionDeviceStateList']())[_0x2933('0x12')](ami[_0x2933('0x14')]())[_0x2933('0x15')](loggerCatch(_0x2933('0x16')));}function loggerCatch(_0x868d92){return function(_0x53337b){logger[_0x2933('0x17')](_0x868d92,util[_0x2933('0x18')](_0x53337b,{'showHidden':![],'depth':null}));};}UserReport[_0x2933('0x19')][_0x2933('0x11')]=function(){setInterval(function(){BPromise[_0x2933('0x1a')]()['then'](ami[_0x2933('0x13')]())[_0x2933('0x12')](ami['actionDeviceStateList']())[_0x2933('0x12')](ami[_0x2933('0x14')]())[_0x2933('0x15')](loggerCatch(_0x2933('0x16')));},0x32c8);};UserReport[_0x2933('0x19')]['isNotNull']=function(_0x153544){return _0x153544!==null&&!_['isUndefined'](_0x153544);};UserReport[_0x2933('0x19')][_0x2933('0x1b')]=function(_0x410b86,_0x2312af,_0x5c3565){io['to'](_0x410b86)[_0x2933('0x1b')](_0x2312af,_0x5c3565);};UserReport[_0x2933('0x19')][_0x2933('0x1c')]=function(_0x208596){try{if(this['isNotNull'](_0x208596)){var _0x276361=_[_0x2933('0x1d')](this['trunks'],{'registry':_0x208596['username']});if(_0x276361){_0x208596[_0x2933('0x1e')]=_0x208596[_0x2933('0x1f')];_[_0x2933('0x20')](_0x276361,_[_0x2933('0x21')](_0x208596,[_0x2933('0x22'),_0x2933('0x23'),_0x2933('0x24'),_0x2933('0x1f')]));this[_0x2933('0x1b')](util['format'](_0x2933('0x25'),_0x276361[_0x2933('0x26')]),_0x2933('0x27'),_0x276361);}}}catch(_0x386616){logger[_0x2933('0x17')](_0x2933('0x28'),util[_0x2933('0x18')](_0x386616,{'showHidden':![],'depth':null}));}};UserReport[_0x2933('0x19')]['syncDeviceState']=function(_0x2e81cf){try{if(this[_0x2933('0x29')](_0x2e81cf)){if(this[_0x2933('0x9')][_0x2e81cf['device']]){if(!this['agents'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x2b')]||_0x2e81cf['state'][_0x2933('0x2c')]()=='inuse'){this[_0x2933('0x9')][_0x2e81cf[_0x2933('0x2a')]]['local']=![];if(this['agents'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x1f')]!==_0x2e81cf['state'][_0x2933('0x2c')]()){this[_0x2933('0x9')][_0x2e81cf['device']][_0x2933('0x2d')]=_[_0x2933('0x2e')](moment()[_0x2933('0x2f')]('x'));}this[_0x2933('0x9')][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x1f')]=_0x2e81cf['state'][_0x2933('0x2c')]();this['agents'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x30')](_0x2e81cf);}}else if(this[_0x2933('0xa')][_0x2e81cf[_0x2933('0x2a')]]){if(this['telephones'][_0x2e81cf[_0x2933('0x2a')]]['state']!==_0x2e81cf[_0x2933('0x1f')]['toLowerCase']()){this['telephones'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x2d')]=_['toNumber'](moment()[_0x2933('0x2f')]('x'));}this[_0x2933('0xa')][_0x2e81cf[_0x2933('0x2a')]]['state']=_0x2e81cf[_0x2933('0x1f')]['toLowerCase']();this['emit'](util['format'](_0x2933('0x31'),this['telephones'][_0x2e81cf['device']][_0x2933('0x26')]),_0x2933('0x32'),this[_0x2933('0xa')][_0x2e81cf[_0x2933('0x2a')]]);}else if(this[_0x2933('0x33')][_0x2e81cf[_0x2933('0x2a')]]){if(this['trunks'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x1f')]!==_0x2e81cf[_0x2933('0x1f')][_0x2933('0x2c')]()){this[_0x2933('0x33')][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x2d')]=_[_0x2933('0x2e')](moment()[_0x2933('0x2f')]('x'));}this['trunks'][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x1f')]=_0x2e81cf['state'][_0x2933('0x2c')]();this[_0x2933('0x1b')](util['format'](_0x2933('0x25'),this[_0x2933('0x33')][_0x2e81cf[_0x2933('0x2a')]][_0x2933('0x26')]),_0x2933('0x27'),this[_0x2933('0x33')][_0x2e81cf['device']]);}else if(_[_0x2933('0x34')](_0x2e81cf['device'],'Queue')){}else if(_[_0x2933('0x34')](_0x2e81cf['device'],_0x2933('0x35'))){var _0x4aa17e=_0x2e81cf[_0x2933('0x2a')];var _0x33a7c0=_0x4aa17e[_0x2933('0x36')](_0x4aa17e[_0x2933('0x37')]('/')+0x1,_0x4aa17e[_0x2933('0x37')]('@'));var _0x4086bf=_[_0x2933('0x1d')](this[_0x2933('0x9')],function(_0x52e8b7){return _0x52e8b7['mobile']==_0x33a7c0||_0x52e8b7[_0x2933('0x38')]==_0x33a7c0||_0x52e8b7[_0x2933('0x39')]==_0x33a7c0;});if(_0x4086bf){if(_0x4086bf[_0x2933('0x1f')]!==_0x2e81cf[_0x2933('0x1f')][_0x2933('0x2c')]()){_0x4086bf[_0x2933('0x2d')]=_[_0x2933('0x2e')](moment()[_0x2933('0x2f')]('x'));}_0x4086bf['state']=_0x2e81cf['state'][_0x2933('0x2c')]();_0x4086bf['local']=!![];_0x4086bf['updateStatusRealtime'](_0x2e81cf);}}else{}}}catch(_0x3ba484){logger[_0x2933('0x17')]('[syncDeviceState][UserReport]',util['inspect'](_0x3ba484,{'showHidden':![],'depth':null}));}};UserReport[_0x2933('0x19')][_0x2933('0x3a')]=function(_0x4793e2){try{if(this[_0x2933('0x29')](_0x4793e2)&&this[_0x2933('0x29')](_0x4793e2[_0x2933('0x10')])){if(this[_0x2933('0x9')][_0x4793e2[_0x2933('0x3b')]]){if(!this[_0x2933('0x9')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x2b')]||_0x4793e2[_0x2933('0x10')]['toLowerCase']()==_0x2933('0x3c')){this[_0x2933('0x9')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x2b')]=![];this[_0x2933('0x9')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x3d')]=_0x4793e2[_0x2933('0x10')]['toLowerCase']();this[_0x2933('0x9')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x3e')]=_0x4793e2[_0x2933('0x3e')];this['agents'][_0x4793e2[_0x2933('0x3b')]]['updateStatusRealtime'](_0x4793e2);}}else if(this[_0x2933('0xa')][_0x4793e2[_0x2933('0x3b')]]){this[_0x2933('0xa')][_0x4793e2[_0x2933('0x3b')]]['status']=_0x4793e2[_0x2933('0x10')][_0x2933('0x2c')]();this[_0x2933('0xa')][_0x4793e2[_0x2933('0x3b')]]['address']=_0x4793e2[_0x2933('0x3e')];this[_0x2933('0x1b')](util[_0x2933('0x2f')](_0x2933('0x31'),this[_0x2933('0xa')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x26')]),_0x2933('0x32'),this[_0x2933('0xa')][_0x4793e2['peer']]);}else if(this[_0x2933('0x33')][_0x4793e2[_0x2933('0x3b')]]){this[_0x2933('0x33')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x3d')]=_0x4793e2[_0x2933('0x10')][_0x2933('0x2c')]();this[_0x2933('0x33')][_0x4793e2[_0x2933('0x3b')]]['address']=_0x4793e2[_0x2933('0x3e')];this[_0x2933('0x1b')](util['format'](_0x2933('0x25'),this[_0x2933('0x33')][_0x4793e2[_0x2933('0x3b')]][_0x2933('0x26')]),'trunk:save',this[_0x2933('0x33')][_0x4793e2[_0x2933('0x3b')]]);}else{}}}catch(_0x3b21cd){logger[_0x2933('0x17')]('[syncPeerStatus][UserReport]',util[_0x2933('0x18')](_0x3b21cd,{'showHidden':![],'depth':null}));}};module[_0x2933('0x3f')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 5839aa0..99b5ff9 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 _0xaefc=['keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','transfereeuniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','syncBlindTransfer','emit','isNotNull','isUndefined','prototype','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','event','privilege','custom:agentcalled','format','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','agentringnoanswer','agentringnoanswerAt','rejected','custom:agentringnoanswer','error','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','agentacw','acwTimeout','interface','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable'];(function(_0x1b3d02,_0x2d32fe){var _0x34ed31=function(_0x60649f){while(--_0x60649f){_0x1b3d02['push'](_0x1b3d02['shift']());}};_0x34ed31(++_0x2d32fe);}(_0xaefc,0x199));var _0xcaef=function(_0x1d7377,_0x25a864){_0x1d7377=_0x1d7377-0x0;var _0x2d4c15=_0xaefc[_0x1d7377];return _0x2d4c15;};'use strict';var _=require(_0xcaef('0x0'));var moment=require(_0xcaef('0x1'));var util=require(_0xcaef('0x2'));var Redis=require(_0xcaef('0x3'));var config=require(_0xcaef('0x4'));var logger=require(_0xcaef('0x5'))(_0xcaef('0x6'));var ami=require('../ami');config['redis']=_[_0xcaef('0x7')](config[_0xcaef('0x8')],{'host':_0xcaef('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcaef('0x8')]));function VoiceAgentReport(_0x3c2199){this[_0xcaef('0xa')]={};this[_0xcaef('0xb')]=_0x3c2199[_0xcaef('0xb')];this[_0xcaef('0xc')]=_0x3c2199[_0xcaef('0xc')];this[_0xcaef('0xd')]={};ami['on']('agentcalled',this[_0xcaef('0xe')][_0xcaef('0xf')](this));ami['on'](_0xcaef('0x10'),this[_0xcaef('0x11')][_0xcaef('0xf')](this));ami['on']('agentringnoanswer',this[_0xcaef('0x12')]['bind'](this));ami['on'](_0xcaef('0x13'),this[_0xcaef('0x14')][_0xcaef('0xf')](this));ami['on'](_0xcaef('0x15'),this[_0xcaef('0x16')][_0xcaef('0xf')](this));ami['on'](_0xcaef('0x17'),this[_0xcaef('0x18')]['bind'](this));ami['on'](_0xcaef('0x19'),this[_0xcaef('0x1a')][_0xcaef('0xf')](this));ami['on']('musiconholdstart',this[_0xcaef('0x1b')][_0xcaef('0xf')](this));ami['on'](_0xcaef('0x1c'),this[_0xcaef('0x1d')]['bind'](this));ami['on']('attendedtransfer',this[_0xcaef('0x1e')][_0xcaef('0xf')](this));ami['on']('blindtransfer',this[_0xcaef('0x1f')][_0xcaef('0xf')](this));}VoiceAgentReport['prototype'][_0xcaef('0x20')]=function(_0x37d2e7,_0xc78c2c,_0x5a98c6){io['to'](_0x37d2e7)[_0xcaef('0x20')](_0xc78c2c,_0x5a98c6);};VoiceAgentReport['prototype'][_0xcaef('0x21')]=function(_0x151324){return _0x151324!==null&&!_[_0xcaef('0x22')](_0x151324);};VoiceAgentReport[_0xcaef('0x23')]['syncAgentCalled']=function(_0x433245){try{if(this['isNotNull'](_0x433245)){if(_[_0xcaef('0x22')](this['channels'][_0x433245[_0xcaef('0x24')]])){this[_0xcaef('0xa')][_0x433245[_0xcaef('0x24')]]={};}if(_['isUndefined'](this['channels'][_0x433245['uniqueid']][_0x433245[_0xcaef('0x25')]])){this[_0xcaef('0xa')][_0x433245['uniqueid']][_0x433245[_0xcaef('0x25')]]={'agentcalledAt':moment()['format'](_0xcaef('0x26')),'lastevent':'called','variables':this[_0xcaef('0xd')][_0x433245[_0xcaef('0x24')]],'type':this['voiceQueues'][_0x433245[_0xcaef('0x27')]]?this[_0xcaef('0xb')][_0x433245['queue']][_0xcaef('0x28')]||_0xcaef('0x29'):'inbound'};}_['merge'](this[_0xcaef('0xa')][_0x433245[_0xcaef('0x24')]][_0x433245[_0xcaef('0x25')]],_[_0xcaef('0x2a')](_0x433245,[_0xcaef('0x2b'),_0xcaef('0x2c')]));ami[_0xcaef('0x20')](_0xcaef('0x2d'),this[_0xcaef('0xa')][_0x433245[_0xcaef('0x24')]][_0x433245[_0xcaef('0x25')]]);this[_0xcaef('0x20')](util[_0xcaef('0x2e')](_0xcaef('0x2f'),_0x433245[_0xcaef('0x30')]),_0xcaef('0x31'),this[_0xcaef('0xa')][_0x433245[_0xcaef('0x24')]][_0x433245[_0xcaef('0x25')]]);}}catch(_0x143dba){logger['error'](_0xcaef('0x32'),util['inspect'](_0x143dba,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcaef('0x11')]=function(_0x482931){try{if(this[_0xcaef('0x21')](_0x482931)){if(this['channels'][_0x482931[_0xcaef('0x24')]]){for(var _0x5d066f in this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]]){if(this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0xcaef('0x33')](_0x5d066f)){if(_0x482931[_0xcaef('0x25')]===_0x5d066f){this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f][_0xcaef('0x34')]=moment()['format'](_0xcaef('0x26'));this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f][_0xcaef('0x35')]=_0xcaef('0x36');this['channels'][_0x482931[_0xcaef('0x24')]][_0x5d066f]['holdtime']=_0x482931[_0xcaef('0x37')];this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f]['connectedlinenum']=_0x482931[_0xcaef('0x38')];this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f]['connectedlinename']=_0x482931[_0xcaef('0x39')];this['channels'][_0x482931[_0xcaef('0x24')]][_0x5d066f]['destchannelstate']=_0x482931[_0xcaef('0x3a')];this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f]['destchannelstatedesc']=_0x482931[_0xcaef('0x3b')];_['merge'](this[_0xcaef('0xc')][_0x482931['interface']],_[_0xcaef('0x3c')](_0x482931,['queue',_0xcaef('0x3d')]));this['emit'](util[_0xcaef('0x2e')](_0xcaef('0x2f'),_0x482931['membername']),_0xcaef('0x3e'),this['channels'][_0x482931[_0xcaef('0x24')]][_0x482931[_0xcaef('0x25')]]);ami[_0xcaef('0x20')](_0xcaef('0x3f'),this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f]);}else if(!this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f]['agentringnoanswer']&&!this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f][_0xcaef('0x15')]){this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f]['agentringnoanswer']=!![];this['channels'][_0x482931['uniqueid']][_0x5d066f]['agentringnoanswerAt']=moment()[_0xcaef('0x2e')](_0xcaef('0x26'));this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f][_0xcaef('0x40')]='answered_elsewhere';this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f][_0xcaef('0x35')]=_0xcaef('0x41');this[_0xcaef('0xa')][_0x482931['uniqueid']][_0x5d066f][_0xcaef('0x42')]=_0x482931[_0xcaef('0x25')];this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f][_0xcaef('0x43')]=_0x482931[_0xcaef('0x30')];ami['emit'](_0xcaef('0x44'),this[_0xcaef('0xa')][_0x482931[_0xcaef('0x24')]][_0x5d066f]);}}}}}}catch(_0x216216){logger['error'](_0xcaef('0x45'),util[_0xcaef('0x46')](_0x216216,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcaef('0x23')][_0xcaef('0x12')]=function(_0x4bdf46){try{if(this[_0xcaef('0x21')](_0x4bdf46)){if(this[_0xcaef('0xa')][_0x4bdf46[_0xcaef('0x24')]]&&this['channels'][_0x4bdf46[_0xcaef('0x24')]][_0x4bdf46[_0xcaef('0x25')]]){this[_0xcaef('0xa')][_0x4bdf46[_0xcaef('0x24')]][_0x4bdf46[_0xcaef('0x25')]][_0xcaef('0x47')]=!![];this[_0xcaef('0xa')][_0x4bdf46[_0xcaef('0x24')]][_0x4bdf46[_0xcaef('0x25')]][_0xcaef('0x48')]=moment()['format'](_0xcaef('0x26'));this[_0xcaef('0xa')][_0x4bdf46['uniqueid']][_0x4bdf46[_0xcaef('0x25')]]['reason']=_0xcaef('0x49');this['channels'][_0x4bdf46[_0xcaef('0x24')]][_0x4bdf46['destuniqueid']][_0xcaef('0x35')]=_0xcaef('0x49');ami['emit'](_0xcaef('0x4a'),this['channels'][_0x4bdf46[_0xcaef('0x24')]][_0x4bdf46[_0xcaef('0x25')]]);}}}catch(_0x356af6){logger[_0xcaef('0x4b')](_0xcaef('0x4c'),util[_0xcaef('0x46')](_0x356af6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcaef('0x14')]=function(_0x534975){try{if(this[_0xcaef('0x21')](_0x534975)){if(this[_0xcaef('0xa')][_0x534975['uniqueid']]){for(var _0x1ca922 in this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]]){if(this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]][_0xcaef('0x33')](_0x1ca922)&&!this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]][_0x1ca922][_0xcaef('0x47')]&&!this['channels'][_0x534975[_0xcaef('0x24')]][_0x1ca922][_0xcaef('0x15')]){this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]][_0x1ca922][_0xcaef('0x47')]=!![];this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]][_0x1ca922]['agentringnoanswerAt']=moment()[_0xcaef('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcaef('0xa')][_0x534975['uniqueid']][_0x1ca922][_0xcaef('0x40')]='abandoned';this['channels'][_0x534975[_0xcaef('0x24')]][_0x1ca922][_0xcaef('0x35')]=_0xcaef('0x4d');ami[_0xcaef('0x20')](_0xcaef('0x4e'),this[_0xcaef('0xa')][_0x534975[_0xcaef('0x24')]][_0x1ca922]);}}}}}catch(_0x288ab3){logger[_0xcaef('0x4b')](_0xcaef('0x4f'),util[_0xcaef('0x46')](_0x288ab3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcaef('0x23')]['syncAgentComplete']=function(_0x37fd74){try{if(this[_0xcaef('0x21')](_0x37fd74)){if(this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]]){for(var _0x9812dd in this[_0xcaef('0xa')][_0x37fd74['uniqueid']]){if(this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]][_0xcaef('0x33')](_0x9812dd)){if(this['channels'][_0x37fd74[_0xcaef('0x24')]][_0x9812dd][_0xcaef('0x34')]&&!this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]][_0x9812dd][_0xcaef('0x15')]){this[_0xcaef('0xa')][_0x37fd74['uniqueid']][_0x9812dd][_0xcaef('0x15')]=!![];this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]][_0x9812dd][_0xcaef('0x50')]=moment()[_0xcaef('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcaef('0xa')][_0x37fd74['uniqueid']][_0x9812dd]['lastevent']=_0xcaef('0x51');this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]][_0x9812dd][_0xcaef('0x52')]=_0x37fd74[_0xcaef('0x52')];this['channels'][_0x37fd74['uniqueid']][_0x9812dd][_0xcaef('0x40')]=_0x37fd74[_0xcaef('0x40')]==_0xcaef('0x53')?_0xcaef('0x54'):_0x37fd74[_0xcaef('0x40')];if(this[_0xcaef('0xb')][_0x37fd74['queue']]&&this[_0xcaef('0xb')][_0x37fd74[_0xcaef('0x27')]]['acw']){this[_0xcaef('0xa')][_0x37fd74['uniqueid']][_0x9812dd][_0xcaef('0x55')]=!![];this[_0xcaef('0xa')][_0x37fd74[_0xcaef('0x24')]][_0x9812dd]['acwtime']=this['voiceQueues'][_0x37fd74['queue']][_0xcaef('0x56')];}this[_0xcaef('0xc')][_0x37fd74[_0xcaef('0x57')]]=_['omit'](this['agents'][_0x37fd74[_0xcaef('0x57')]],['queue','destconnectedlinenum']);this[_0xcaef('0x20')](util[_0xcaef('0x2e')](_0xcaef('0x2f'),_0x37fd74[_0xcaef('0x30')]),_0xcaef('0x58'),this['channels'][_0x37fd74['uniqueid']][_0x9812dd]);ami[_0xcaef('0x20')]('custom:agentcomplete',this[_0xcaef('0xa')][_0x37fd74['uniqueid']][_0x9812dd]);}}}}}}catch(_0x343594){logger['error'](_0xcaef('0x59'),util[_0xcaef('0x46')](_0x343594,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcaef('0x18')]=function(_0x92c14){try{if(this[_0xcaef('0x21')](_0x92c14)){this[_0xcaef('0x5a')](_0x92c14[_0xcaef('0x24')],_[_0xcaef('0x5b')](_0x92c14[_0xcaef('0x5c')])[0x0],_0x92c14[_0xcaef('0x5d')]);if(this[_0xcaef('0xa')][_0x92c14[_0xcaef('0x24')]]){for(var _0x32fb6d in this['channels'][_0x92c14[_0xcaef('0x24')]]){if(this[_0xcaef('0xa')][_0x92c14[_0xcaef('0x24')]]['hasOwnProperty'](_0x32fb6d)){if(_['isUndefined'](this[_0xcaef('0xa')][_0x92c14[_0xcaef('0x24')]][_0x32fb6d][_0xcaef('0xd')])){this['channels'][_0x92c14[_0xcaef('0x24')]][_0x32fb6d]['variables']={};}this[_0xcaef('0xa')][_0x92c14['uniqueid']][_0x32fb6d][_0xcaef('0xd')]=this[_0xcaef('0xd')][_0x92c14[_0xcaef('0x24')]];}}}}}catch(_0x32cdf5){logger['error'](_0xcaef('0x5e'),util[_0xcaef('0x46')](_0x32cdf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcaef('0x23')][_0xcaef('0x5a')]=function(_0x85b04d,_0x4725bc,_0x51eaac){var _0x53652c=['rtpaudioqos','rtpaudioqosbridged',_0xcaef('0x5f'),_0xcaef('0x60'),_0xcaef('0x61'),_0xcaef('0x62'),_0xcaef('0x63'),_0xcaef('0x64'),_0xcaef('0x65'),_0xcaef('0x66'),_0xcaef('0x67'),'bridgepvtcallid',_0xcaef('0x68'),_0xcaef('0x69'),_0xcaef('0x6a'),'memberlastcall',_0xcaef('0x30'),_0xcaef('0x6b'),_0xcaef('0x6c')];if(!_[_0xcaef('0x6d')](_0x4725bc)&&!_[_0xcaef('0x6e')](_0x53652c,_0x4725bc)){if(_[_0xcaef('0x22')](this[_0xcaef('0xd')][_0x85b04d])){this[_0xcaef('0xd')][_0x85b04d]={};}this[_0xcaef('0xd')][_0x85b04d][_0x4725bc]=_0x51eaac;}};VoiceAgentReport[_0xcaef('0x23')][_0xcaef('0x1a')]=function(_0x2cc25d){try{if(this[_0xcaef('0x21')](_0x2cc25d)){if(this['channels'][_0x2cc25d['uniqueid']]){for(var _0x17b66f in this[_0xcaef('0xa')][_0x2cc25d[_0xcaef('0x24')]]){if(this['channels'][_0x2cc25d[_0xcaef('0x24')]][_0xcaef('0x33')](_0x17b66f)){if(this[_0xcaef('0xa')][_0x2cc25d[_0xcaef('0x24')]][_0x17b66f]['reason']==_0xcaef('0x53')&&this[_0xcaef('0xa')][_0x2cc25d['uniqueid']][_0x17b66f][_0xcaef('0x15')]){this[_0xcaef('0xa')][_0x2cc25d[_0xcaef('0x24')]][_0x17b66f][_0xcaef('0x50')]=moment()[_0xcaef('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xcaef('0x20')](_0xcaef('0x6f'),_['values'](this[_0xcaef('0xa')][_0x2cc25d['uniqueid']]));delete this['channels'][_0x2cc25d[_0xcaef('0x24')]];}if(this[_0xcaef('0xd')][_0x2cc25d[_0xcaef('0x24')]]){delete this[_0xcaef('0xd')][_0x2cc25d[_0xcaef('0x24')]];}}}catch(_0x1dccf1){logger[_0xcaef('0x4b')](_0xcaef('0x70'),util[_0xcaef('0x46')](_0x1dccf1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcaef('0x23')][_0xcaef('0x1e')]=function(_0x342f80){try{if(this[_0xcaef('0x21')](_0x342f80)){if(this[_0xcaef('0xa')][_0x342f80['transfereeuniqueid']]){for(var _0x34d511 in this[_0xcaef('0xa')][_0x342f80['transfereeuniqueid']]){if(this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]][_0xcaef('0x33')](_0x34d511)){if(_0x342f80['origtransfereruniqueid']===_0x34d511){var _0x52ccf9=moment();this[_0xcaef('0xa')][_0x342f80['transfereeuniqueid']][_0x34d511][_0xcaef('0x15')]=!![];this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]][_0x34d511][_0xcaef('0x50')]=moment()['format'](_0xcaef('0x26'));this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]][_0x34d511]['reason']=_0xcaef('0x53');this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]][_0x34d511][_0xcaef('0x35')]=_0xcaef('0x51');this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]][_0x34d511][_0xcaef('0x52')]=_0x52ccf9['diff'](this['channels'][_0x342f80['transfereeuniqueid']][_0x34d511][_0xcaef('0x34')],_0xcaef('0x72'));}}}}if(this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x73')]]){var _0x38de9a=this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x73')]];this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x73')]]=this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]];this[_0xcaef('0xa')][_0x342f80[_0xcaef('0x71')]]=_0x38de9a;}}}catch(_0x379ea5){logger[_0xcaef('0x4b')](_0xcaef('0x74'),util['inspect'](_0x379ea5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xcaef('0x23')]['syncBlindTransfer']=function(_0x47b192){try{if(this['isNotNull'](_0x47b192)){if(this[_0xcaef('0xa')][_0x47b192['transfereeuniqueid']]){for(var _0x22a1b4 in this[_0xcaef('0xa')][_0x47b192[_0xcaef('0x71')]]){if(this['channels'][_0x47b192[_0xcaef('0x71')]][_0xcaef('0x33')](_0x22a1b4)){if(_0x47b192[_0xcaef('0x75')]===_0x22a1b4){var _0x23f1eb=moment();this[_0xcaef('0xa')][_0x47b192[_0xcaef('0x71')]][_0x22a1b4][_0xcaef('0x15')]=!![];this['channels'][_0x47b192['transfereeuniqueid']][_0x22a1b4][_0xcaef('0x50')]=_0x23f1eb;this[_0xcaef('0xa')][_0x47b192[_0xcaef('0x71')]][_0x22a1b4][_0xcaef('0x40')]=_0xcaef('0x53');this[_0xcaef('0xa')][_0x47b192[_0xcaef('0x71')]][_0x22a1b4][_0xcaef('0x35')]='complete';this[_0xcaef('0xa')][_0x47b192['transfereeuniqueid']][_0x22a1b4][_0xcaef('0x52')]=_0x23f1eb[_0xcaef('0x76')](this[_0xcaef('0xa')][_0x47b192['transfereeuniqueid']][_0x22a1b4][_0xcaef('0x34')],_0xcaef('0x72'));}}}}}}catch(_0x8f5924){logger[_0xcaef('0x4b')](_0xcaef('0x77'),util['inspect'](_0x8f5924,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcaef('0x1b')]=function(_0x5d9722){var _0x4351b7='';try{if(this[_0xcaef('0x21')](_0x5d9722)){if(_0x5d9722[_0xcaef('0x78')]){_0x4351b7=_0x5d9722['channel'][_0xcaef('0x79')](0x0,_0x5d9722[_0xcaef('0x78')][_0xcaef('0x7a')]('-'));if(this['agents'][_0x4351b7]){this[_0xcaef('0xc')][_0x4351b7][_0xcaef('0x7b')]=!![];}}}}catch(_0xfccb26){logger[_0xcaef('0x4b')](_0xcaef('0x7c'),util[_0xcaef('0x46')](_0xfccb26,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xcaef('0x1d')]=function(_0x2dce65){var _0x5e0a1f='';try{if(this[_0xcaef('0x21')](_0x2dce65)){if(_0x2dce65[_0xcaef('0x78')]){_0x5e0a1f=_0x2dce65[_0xcaef('0x78')][_0xcaef('0x79')](0x0,_0x2dce65['channel'][_0xcaef('0x7a')]('-'));if(this[_0xcaef('0xc')][_0x5e0a1f]){this[_0xcaef('0xc')][_0x5e0a1f][_0xcaef('0x7b')]=![];}}}}catch(_0x7220d4){logger['error']('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0xcaef('0x46')](_0x7220d4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x636e=['seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','exports','lodash','moment','ioredis','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncQueueCallerAbandon','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','event','privilege','custom:agentcalled','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','isNotNull','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentcomplete','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','acw','agentacw','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','custom:voiceAgentReport','[syncHangup][VoiceAgentReport]','transfereeuniqueid','diff'];(function(_0x167ef5,_0x392519){var _0x19e646=function(_0x49abd0){while(--_0x49abd0){_0x167ef5['push'](_0x167ef5['shift']());}};_0x19e646(++_0x392519);}(_0x636e,0x16b));var _0xe636=function(_0xc4e0c4,_0x5288f4){_0xc4e0c4=_0xc4e0c4-0x0;var _0x5ee9bc=_0x636e[_0xc4e0c4];return _0x5ee9bc;};'use strict';var _=require(_0xe636('0x0'));var moment=require(_0xe636('0x1'));var util=require('util');var Redis=require(_0xe636('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xe636('0x3'));var ami=require(_0xe636('0x4'));config[_0xe636('0x5')]=_[_0xe636('0x6')](config[_0xe636('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xe636('0x7'))(new Redis(config['redis']));function VoiceAgentReport(_0x2dfcf8){this[_0xe636('0x8')]={};this[_0xe636('0x9')]=_0x2dfcf8[_0xe636('0x9')];this[_0xe636('0xa')]=_0x2dfcf8[_0xe636('0xa')];this[_0xe636('0xb')]={};ami['on'](_0xe636('0xc'),this[_0xe636('0xd')]['bind'](this));ami['on'](_0xe636('0xe'),this[_0xe636('0xf')][_0xe636('0x10')](this));ami['on'](_0xe636('0x11'),this['syncAgentRingNoAnswer']['bind'](this));ami['on']('queuecallerabandon',this[_0xe636('0x12')][_0xe636('0x10')](this));ami['on']('agentcomplete',this[_0xe636('0x13')][_0xe636('0x10')](this));ami['on']('varset',this[_0xe636('0x14')][_0xe636('0x10')](this));ami['on'](_0xe636('0x15'),this[_0xe636('0x16')][_0xe636('0x10')](this));ami['on'](_0xe636('0x17'),this['syncMusicOnHoldStart'][_0xe636('0x10')](this));ami['on'](_0xe636('0x18'),this[_0xe636('0x19')][_0xe636('0x10')](this));ami['on'](_0xe636('0x1a'),this[_0xe636('0x1b')][_0xe636('0x10')](this));ami['on'](_0xe636('0x1c'),this[_0xe636('0x1d')]['bind'](this));}VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x1f')]=function(_0x191f98,_0x8184cc,_0x201ffb){io['to'](_0x191f98)[_0xe636('0x1f')](_0x8184cc,_0x201ffb);};VoiceAgentReport[_0xe636('0x1e')]['isNotNull']=function(_0x1d9d58){return _0x1d9d58!==null&&!_[_0xe636('0x20')](_0x1d9d58);};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0xd')]=function(_0x3e8b29){try{if(this['isNotNull'](_0x3e8b29)){if(_['isUndefined'](this['channels'][_0x3e8b29[_0xe636('0x21')]])){this[_0xe636('0x8')][_0x3e8b29['uniqueid']]={};}if(_[_0xe636('0x20')](this[_0xe636('0x8')][_0x3e8b29[_0xe636('0x21')]][_0x3e8b29['destuniqueid']])){this['channels'][_0x3e8b29[_0xe636('0x21')]][_0x3e8b29[_0xe636('0x22')]]={'agentcalledAt':moment()[_0xe636('0x23')](_0xe636('0x24')),'lastevent':_0xe636('0x25'),'variables':this[_0xe636('0xb')][_0x3e8b29['uniqueid']],'type':this[_0xe636('0x9')][_0x3e8b29[_0xe636('0x26')]]?this[_0xe636('0x9')][_0x3e8b29[_0xe636('0x26')]][_0xe636('0x27')]||_0xe636('0x28'):'inbound'};}_[_0xe636('0x29')](this[_0xe636('0x8')][_0x3e8b29['uniqueid']][_0x3e8b29[_0xe636('0x22')]],_['omit'](_0x3e8b29,[_0xe636('0x2a'),_0xe636('0x2b')]));ami[_0xe636('0x1f')](_0xe636('0x2c'),this[_0xe636('0x8')][_0x3e8b29[_0xe636('0x21')]][_0x3e8b29[_0xe636('0x22')]]);this[_0xe636('0x1f')](util['format']('user:%s',_0x3e8b29[_0xe636('0x2d')]),_0xe636('0x2e'),this['channels'][_0x3e8b29[_0xe636('0x21')]][_0x3e8b29['destuniqueid']]);}}catch(_0x568951){logger[_0xe636('0x2f')](_0xe636('0x30'),util[_0xe636('0x31')](_0x568951,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x2b387b){try{if(this[_0xe636('0x32')](_0x2b387b)){if(this[_0xe636('0x8')][_0x2b387b['uniqueid']]){for(var _0x1ba4f4 in this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]]){if(this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0xe636('0x33')](_0x1ba4f4)){if(_0x2b387b[_0xe636('0x22')]===_0x1ba4f4){this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x34')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xe636('0x8')][_0x2b387b['uniqueid']][_0x1ba4f4][_0xe636('0x35')]=_0xe636('0x36');this['channels'][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x37')]=_0x2b387b['holdtime'];this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x38')]=_0x2b387b[_0xe636('0x38')];this[_0xe636('0x8')][_0x2b387b['uniqueid']][_0x1ba4f4][_0xe636('0x39')]=_0x2b387b[_0xe636('0x39')];this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4]['destchannelstate']=_0x2b387b[_0xe636('0x3a')];this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x3b')]=_0x2b387b[_0xe636('0x3b')];_[_0xe636('0x29')](this[_0xe636('0xa')][_0x2b387b[_0xe636('0x3c')]],_[_0xe636('0x3d')](_0x2b387b,[_0xe636('0x26'),_0xe636('0x3e')]));this[_0xe636('0x1f')](util[_0xe636('0x23')]('user:%s',_0x2b387b[_0xe636('0x2d')]),_0xe636('0x3f'),this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x2b387b[_0xe636('0x22')]]);ami[_0xe636('0x1f')](_0xe636('0x40'),this['channels'][_0x2b387b['uniqueid']][_0x1ba4f4]);}else if(!this[_0xe636('0x8')][_0x2b387b['uniqueid']][_0x1ba4f4][_0xe636('0x11')]&&!this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x41')]){this['channels'][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x11')]=!![];this[_0xe636('0x8')][_0x2b387b['uniqueid']][_0x1ba4f4][_0xe636('0x42')]=moment()[_0xe636('0x23')](_0xe636('0x24'));this['channels'][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x43')]='answered_elsewhere';this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4][_0xe636('0x35')]=_0xe636('0x44');this[_0xe636('0x8')][_0x2b387b[_0xe636('0x21')]][_0x1ba4f4]['answeredelsewheredestinationuniqueid']=_0x2b387b['destuniqueid'];this[_0xe636('0x8')][_0x2b387b['uniqueid']][_0x1ba4f4][_0xe636('0x45')]=_0x2b387b[_0xe636('0x2d')];ami[_0xe636('0x1f')]('custom:agentansweredelsewhere',this['channels'][_0x2b387b['uniqueid']][_0x1ba4f4]);}}}}}}catch(_0x3928c4){logger[_0xe636('0x2f')](_0xe636('0x46'),util[_0xe636('0x31')](_0x3928c4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe636('0x47')]=function(_0x246017){try{if(this['isNotNull'](_0x246017)){if(this[_0xe636('0x8')][_0x246017[_0xe636('0x21')]]&&this[_0xe636('0x8')][_0x246017[_0xe636('0x21')]][_0x246017['destuniqueid']]){this[_0xe636('0x8')][_0x246017['uniqueid']][_0x246017[_0xe636('0x22')]][_0xe636('0x11')]=!![];this[_0xe636('0x8')][_0x246017[_0xe636('0x21')]][_0x246017['destuniqueid']][_0xe636('0x42')]=moment()[_0xe636('0x23')](_0xe636('0x24'));this['channels'][_0x246017[_0xe636('0x21')]][_0x246017[_0xe636('0x22')]][_0xe636('0x43')]=_0xe636('0x48');this['channels'][_0x246017[_0xe636('0x21')]][_0x246017['destuniqueid']][_0xe636('0x35')]=_0xe636('0x48');ami[_0xe636('0x1f')](_0xe636('0x49'),this[_0xe636('0x8')][_0x246017[_0xe636('0x21')]][_0x246017[_0xe636('0x22')]]);}}}catch(_0x60012d){logger[_0xe636('0x2f')](_0xe636('0x4a'),util[_0xe636('0x31')](_0x60012d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')]['syncQueueCallerAbandon']=function(_0x4f44ae){try{if(this[_0xe636('0x32')](_0x4f44ae)){if(this[_0xe636('0x8')][_0x4f44ae[_0xe636('0x21')]]){for(var _0x239bfe in this['channels'][_0x4f44ae[_0xe636('0x21')]]){if(this[_0xe636('0x8')][_0x4f44ae['uniqueid']][_0xe636('0x33')](_0x239bfe)&&!this['channels'][_0x4f44ae[_0xe636('0x21')]][_0x239bfe][_0xe636('0x11')]&&!this[_0xe636('0x8')][_0x4f44ae[_0xe636('0x21')]][_0x239bfe][_0xe636('0x41')]){this[_0xe636('0x8')][_0x4f44ae[_0xe636('0x21')]][_0x239bfe][_0xe636('0x11')]=!![];this['channels'][_0x4f44ae['uniqueid']][_0x239bfe][_0xe636('0x42')]=moment()[_0xe636('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe636('0x8')][_0x4f44ae['uniqueid']][_0x239bfe][_0xe636('0x43')]=_0xe636('0x4b');this[_0xe636('0x8')][_0x4f44ae[_0xe636('0x21')]][_0x239bfe][_0xe636('0x35')]=_0xe636('0x4b');ami[_0xe636('0x1f')](_0xe636('0x4c'),this[_0xe636('0x8')][_0x4f44ae[_0xe636('0x21')]][_0x239bfe]);}}}}}catch(_0x463dde){logger[_0xe636('0x2f')](_0xe636('0x4d'),util[_0xe636('0x31')](_0x463dde,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xe636('0x13')]=function(_0x2192d9){try{if(this[_0xe636('0x32')](_0x2192d9)){if(this[_0xe636('0x8')][_0x2192d9['uniqueid']]){for(var _0x293feb in this['channels'][_0x2192d9['uniqueid']]){if(this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0xe636('0x33')](_0x293feb)){if(this['channels'][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x34')]&&!this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb]['agentcomplete']){this['channels'][_0x2192d9['uniqueid']][_0x293feb]['agentcomplete']=!![];this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x4e')]=moment()[_0xe636('0x23')](_0xe636('0x24'));this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x35')]=_0xe636('0x4f');this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x50')]=_0x2192d9[_0xe636('0x50')];this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x43')]=_0x2192d9[_0xe636('0x43')]==_0xe636('0x51')?'agent':_0x2192d9['reason'];if(this[_0xe636('0x9')][_0x2192d9[_0xe636('0x26')]]&&this['voiceQueues'][_0x2192d9['queue']][_0xe636('0x52')]){this['channels'][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x53')]=!![];this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb][_0xe636('0x54')]=this[_0xe636('0x9')][_0x2192d9[_0xe636('0x26')]][_0xe636('0x55')];}this['agents'][_0x2192d9['interface']]=_[_0xe636('0x56')](this[_0xe636('0xa')][_0x2192d9[_0xe636('0x3c')]],[_0xe636('0x26'),_0xe636('0x3e')]);this['emit'](util[_0xe636('0x23')]('user:%s',_0x2192d9[_0xe636('0x2d')]),_0xe636('0x57'),this[_0xe636('0x8')][_0x2192d9[_0xe636('0x21')]][_0x293feb]);ami[_0xe636('0x1f')](_0xe636('0x58'),this['channels'][_0x2192d9['uniqueid']][_0x293feb]);}}}}}}catch(_0x467585){logger[_0xe636('0x2f')](_0xe636('0x59'),util[_0xe636('0x31')](_0x467585,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x14')]=function(_0x5da8a5){try{if(this['isNotNull'](_0x5da8a5)){this[_0xe636('0x5a')](_0x5da8a5[_0xe636('0x21')],_['keys'](_0x5da8a5[_0xe636('0x5b')])[0x0],_0x5da8a5['value']);if(this[_0xe636('0x8')][_0x5da8a5[_0xe636('0x21')]]){for(var _0x2200cc in this[_0xe636('0x8')][_0x5da8a5[_0xe636('0x21')]]){if(this[_0xe636('0x8')][_0x5da8a5['uniqueid']][_0xe636('0x33')](_0x2200cc)){if(_[_0xe636('0x20')](this[_0xe636('0x8')][_0x5da8a5[_0xe636('0x21')]][_0x2200cc][_0xe636('0xb')])){this[_0xe636('0x8')][_0x5da8a5['uniqueid']][_0x2200cc][_0xe636('0xb')]={};}this['channels'][_0x5da8a5[_0xe636('0x21')]][_0x2200cc]['variables']=this[_0xe636('0xb')][_0x5da8a5['uniqueid']];}}}}}catch(_0x185530){logger[_0xe636('0x2f')](_0xe636('0x5c'),util[_0xe636('0x31')](_0x185530,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x5a')]=function(_0x45665a,_0x12c697,_0x113ed6){var _0x39ea00=[_0xe636('0x5d'),_0xe636('0x5e'),_0xe636('0x5f'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xe636('0x60'),_0xe636('0x61'),'rtpaudioqosrttbridged','sipcallid',_0xe636('0x62'),_0xe636('0x63'),'bridgepvtcallid',_0xe636('0x64'),_0xe636('0x65'),'memberinterface',_0xe636('0x66'),_0xe636('0x2d'),_0xe636('0x67'),'memberrealtime'];if(!_[_0xe636('0x68')](_0x12c697)&&!_['includes'](_0x39ea00,_0x12c697)){if(_['isUndefined'](this[_0xe636('0xb')][_0x45665a])){this[_0xe636('0xb')][_0x45665a]={};}this[_0xe636('0xb')][_0x45665a][_0x12c697]=_0x113ed6;}};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x16')]=function(_0x3ca602){try{if(this[_0xe636('0x32')](_0x3ca602)){if(this[_0xe636('0x8')][_0x3ca602['uniqueid']]){for(var _0x429b6e in this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]]){if(this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]]['hasOwnProperty'](_0x429b6e)){if(this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]][_0x429b6e][_0xe636('0x43')]==_0xe636('0x51')&&this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]][_0x429b6e]['agentcomplete']){this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]][_0x429b6e][_0xe636('0x4e')]=moment()[_0xe636('0x23')](_0xe636('0x24'));}}}ami['emit'](_0xe636('0x69'),_['values'](this['channels'][_0x3ca602[_0xe636('0x21')]]));delete this[_0xe636('0x8')][_0x3ca602[_0xe636('0x21')]];}if(this[_0xe636('0xb')][_0x3ca602[_0xe636('0x21')]]){delete this['variables'][_0x3ca602[_0xe636('0x21')]];}}}catch(_0x4d42ce){logger[_0xe636('0x2f')](_0xe636('0x6a'),util[_0xe636('0x31')](_0x4d42ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x1b')]=function(_0x5c2bc7){try{if(this[_0xe636('0x32')](_0x5c2bc7)){if(this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]]){for(var _0x5eb86a in this[_0xe636('0x8')][_0x5c2bc7['transfereeuniqueid']]){if(this[_0xe636('0x8')][_0x5c2bc7['transfereeuniqueid']][_0xe636('0x33')](_0x5eb86a)){if(_0x5c2bc7['origtransfereruniqueid']===_0x5eb86a){var _0x4bbeeb=moment();this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]][_0x5eb86a][_0xe636('0x41')]=!![];this[_0xe636('0x8')][_0x5c2bc7['transfereeuniqueid']][_0x5eb86a]['agentcompleteAt']=moment()[_0xe636('0x23')](_0xe636('0x24'));this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]][_0x5eb86a]['reason']=_0xe636('0x51');this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]][_0x5eb86a][_0xe636('0x35')]=_0xe636('0x4f');this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]][_0x5eb86a][_0xe636('0x50')]=_0x4bbeeb[_0xe636('0x6c')](this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]][_0x5eb86a][_0xe636('0x34')],_0xe636('0x6d'));}}}}if(this[_0xe636('0x8')][_0x5c2bc7['secondtransfereruniqueid']]){var _0x19a7a7=this[_0xe636('0x8')][_0x5c2bc7['secondtransfereruniqueid']];this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6e')]]=this['channels'][_0x5c2bc7[_0xe636('0x6b')]];this[_0xe636('0x8')][_0x5c2bc7[_0xe636('0x6b')]]=_0x19a7a7;}}}catch(_0x13a91f){logger['error'](_0xe636('0x6f'),util[_0xe636('0x31')](_0x13a91f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')]['syncBlindTransfer']=function(_0x4eec58){try{if(this['isNotNull'](_0x4eec58)){if(this[_0xe636('0x8')][_0x4eec58[_0xe636('0x6b')]]){for(var _0xaa0993 in this['channels'][_0x4eec58['transfereeuniqueid']]){if(this[_0xe636('0x8')][_0x4eec58[_0xe636('0x6b')]][_0xe636('0x33')](_0xaa0993)){if(_0x4eec58[_0xe636('0x70')]===_0xaa0993){var _0x3770ff=moment();this[_0xe636('0x8')][_0x4eec58[_0xe636('0x6b')]][_0xaa0993][_0xe636('0x41')]=!![];this['channels'][_0x4eec58[_0xe636('0x6b')]][_0xaa0993][_0xe636('0x4e')]=_0x3770ff;this[_0xe636('0x8')][_0x4eec58[_0xe636('0x6b')]][_0xaa0993][_0xe636('0x43')]='transfer';this[_0xe636('0x8')][_0x4eec58['transfereeuniqueid']][_0xaa0993][_0xe636('0x35')]='complete';this[_0xe636('0x8')][_0x4eec58[_0xe636('0x6b')]][_0xaa0993][_0xe636('0x50')]=_0x3770ff[_0xe636('0x6c')](this[_0xe636('0x8')][_0x4eec58['transfereeuniqueid']][_0xaa0993][_0xe636('0x34')],_0xe636('0x6d'));}}}}}}catch(_0x216a23){logger[_0xe636('0x2f')](_0xe636('0x71'),util[_0xe636('0x31')](_0x216a23,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')]['syncMusicOnHoldStart']=function(_0x43a5da){var _0x17f468='';try{if(this['isNotNull'](_0x43a5da)){if(_0x43a5da[_0xe636('0x72')]){_0x17f468=_0x43a5da[_0xe636('0x72')]['substring'](0x0,_0x43a5da[_0xe636('0x72')][_0xe636('0x73')]('-'));if(this[_0xe636('0xa')][_0x17f468]){this['agents'][_0x17f468]['onhold']=!![];}}}}catch(_0x4de129){logger[_0xe636('0x2f')](_0xe636('0x74'),util[_0xe636('0x31')](_0x4de129,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xe636('0x1e')][_0xe636('0x19')]=function(_0x49e888){var _0x5cf80a='';try{if(this[_0xe636('0x32')](_0x49e888)){if(_0x49e888[_0xe636('0x72')]){_0x5cf80a=_0x49e888[_0xe636('0x72')]['substring'](0x0,_0x49e888[_0xe636('0x72')][_0xe636('0x73')]('-'));if(this['agents'][_0x5cf80a]){this[_0xe636('0xa')][_0x5cf80a]['onhold']=![];}}}}catch(_0x30aa45){logger[_0xe636('0x2f')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0xe636('0x31')](_0x30aa45,{'showHidden':![],'depth':null}));}};module[_0xe636('0x75')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index d2d7f50..021d3e7 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 _0xf098=['syncMusicOnHoldStop','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','linkedid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','merge','context','from-sip','split','destconnectedlinenum','exten','user:%s','accountcode','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','applicationdata','toLowerCase','duration','subtract','disposition','lastapplication','startsWith','cdr(','match','queue','answered','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','name','[syncNewState][VoiceCallReport]','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','rec','variable','mixmonitor_filename','syncMixMonitorFilename','xmd-phone','value','xmd-callerid','xmd-queue','xmd-originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','sipcallid','parse','sipcalllinkedid','endtime','seconds','billableseconds','answertime','omit','user:agentcomplete','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','agi','dial','NO\x20ANSWER','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','syncNewExten','newexten','syncNewChannel','bind','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart'];(function(_0x58719f,_0x42ed40){var _0x2d2b3c=function(_0xf4590d){while(--_0xf4590d){_0x58719f['push'](_0x58719f['shift']());}};_0x2d2b3c(++_0x42ed40);}(_0xf098,0x194));var _0x8f09=function(_0x5a674f,_0x14a558){_0x5a674f=_0x5a674f-0x0;var _0x2da376=_0xf098[_0x5a674f];return _0x2da376;};'use strict';var BPromise=require(_0x8f09('0x0'));var _=require(_0x8f09('0x1'));var moment=require(_0x8f09('0x2'));var util=require(_0x8f09('0x3'));var path=require('path');var Redis=require('ioredis');var config=require(_0x8f09('0x4'));var logger=require(_0x8f09('0x5'))(_0x8f09('0x6'));var ami=require('../ami');var Channel=require(_0x8f09('0x7'));var statusDesc=[_0x8f09('0x8'),_0x8f09('0x9'),_0x8f09('0xa'),_0x8f09('0xb'),_0x8f09('0xc'),_0x8f09('0xd'),_0x8f09('0xe'),_0x8f09('0xf'),_0x8f09('0x10')];var applications=[_0x8f09('0x11'),'queue',_0x8f09('0x12'),_0x8f09('0x13'),'playback','voicemail'];var dispositions=[_0x8f09('0x14'),'FAILED',_0x8f09('0x15'),_0x8f09('0x14'),_0x8f09('0x14'),_0x8f09('0x14'),'ANSWERED','BUSY',_0x8f09('0x15'),'FAILED',_0x8f09('0x15')];var actions={};config[_0x8f09('0x16')]=_[_0x8f09('0x17')](config[_0x8f09('0x16')],{'host':_0x8f09('0x18'),'port':0x18eb});var io=require(_0x8f09('0x19'))(new Redis(config[_0x8f09('0x16')]));function VoiceCallReport(_0x115643){this[_0x8f09('0x1a')]=_0x115643[_0x8f09('0x1a')];this[_0x8f09('0x1b')]=_0x115643[_0x8f09('0x1b')];ami['on']('coreshowchannel',this[_0x8f09('0x1c')]['bind'](this));ami['on'](_0x8f09('0x1d'),this[_0x8f09('0x1c')]['bind'](this));ami['on']('newchannel',this[_0x8f09('0x1e')][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x20'),this[_0x8f09('0x21')][_0x8f09('0x1f')](this));ami['on']('varset',this[_0x8f09('0x22')][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x23'),this[_0x8f09('0x24')][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x25'),this['syncNewCallerId'][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x26'),this[_0x8f09('0x27')][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x28'),this['syncBlindTransfer'][_0x8f09('0x1f')](this));ami['on'](_0x8f09('0x29'),this[_0x8f09('0x2a')][_0x8f09('0x1f')](this));ami['on']('musiconholdstop',this[_0x8f09('0x2b')][_0x8f09('0x1f')](this));return BPromise['resolve']()[_0x8f09('0x2c')](ami[_0x8f09('0x2d')]())[_0x8f09('0x2e')](function(_0x50d024){console[_0x8f09('0x2f')](_0x50d024);});}VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x31')]=function(_0x23d47c){return _0x23d47c!==null&&!_[_0x8f09('0x32')](_0x23d47c);};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x33')]=function(_0x1104db,_0xf41fda,_0x5284b0){io['to'](_0x1104db)['emit'](_0xf41fda,_0x5284b0);};VoiceCallReport['prototype'][_0x8f09('0x34')]=function(_0x4289a5){try{if(this[_0x8f09('0x31')](_0x4289a5)){if(_0x4289a5[_0x8f09('0x35')]===_0x4289a5[_0x8f09('0x36')]){if(!_['isUndefined'](this['channels'][_0x4289a5[_0x8f09('0x35')]])){_['merge'](this[_0x8f09('0x1a')][_0x4289a5[_0x8f09('0x35')]],_[_0x8f09('0x37')](_0x4289a5,_[_0x8f09('0x38')](this[_0x8f09('0x1a')][_0x4289a5['uniqueid']])));}}}}catch(_0x4d0c3b){logger[_0x8f09('0x39')](_0x8f09('0x3a'),util[_0x8f09('0x3b')](_0x4d0c3b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')]['syncNewChannel']=function(_0x1cc0b9){try{if(this['isNotNull'](_0x1cc0b9)){if(_0x1cc0b9['uniqueid']===_0x1cc0b9[_0x8f09('0x36')]&&_0x1cc0b9[_0x8f09('0x3c')]!='OutgoingSpoolFailed'){if(_[_0x8f09('0x32')](this['channels'][_0x1cc0b9[_0x8f09('0x35')]])){this[_0x8f09('0x1a')][_0x1cc0b9['uniqueid']]=new Channel();this[_0x8f09('0x1a')][_0x1cc0b9[_0x8f09('0x35')]][_0x8f09('0x3d')]=moment()[_0x8f09('0x3e')](_0x8f09('0x3f'));this[_0x8f09('0x1a')][_0x1cc0b9[_0x8f09('0x35')]]['disposition']=dispositions[_['toNumber'](_0x1cc0b9[_0x8f09('0x40')])];_[_0x8f09('0x41')](this[_0x8f09('0x1a')][_0x1cc0b9[_0x8f09('0x35')]],_[_0x8f09('0x37')](_0x1cc0b9,_[_0x8f09('0x38')](this[_0x8f09('0x1a')][_0x1cc0b9[_0x8f09('0x35')]])));if(_0x1cc0b9[_0x8f09('0x42')]===_0x8f09('0x43')){if(this[_0x8f09('0x1b')][_0x1cc0b9['channel'][_0x8f09('0x44')]('-')[0x0]]){this[_0x8f09('0x1b')][_0x1cc0b9[_0x8f09('0x3c')]['split']('-')[0x0]][_0x8f09('0x45')]=_0x1cc0b9[_0x8f09('0x46')];this[_0x8f09('0x33')](util['format'](_0x8f09('0x47'),this[_0x8f09('0x1b')][_0x1cc0b9[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x1cc0b9[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]][_0x8f09('0x48')],'destconnectedlinenum':_0x1cc0b9['exten']});}}}}}}catch(_0x388871){logger['error'](_0x8f09('0x49'),util[_0x8f09('0x3b')](_0x388871,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x1c')]=function(_0x78fb10){try{if(this[_0x8f09('0x31')](_0x78fb10)){if(_0x78fb10[_0x8f09('0x35')]===_0x78fb10['linkedid']&&_0x78fb10[_0x8f09('0x46')]!='h'&&_0x78fb10[_0x8f09('0x3c')]!=_0x8f09('0x4a')){_0x78fb10[_0x8f09('0x4b')]=_0x78fb10[_0x8f09('0x4b')]['toLowerCase']();_0x78fb10['applicationdata']=(_0x78fb10['appdata']||_0x78fb10[_0x8f09('0x4c')])[_0x8f09('0x4d')]();if(_['isUndefined'](this[_0x8f09('0x1a')][_0x78fb10['uniqueid']])){this[_0x8f09('0x1a')][_0x78fb10['uniqueid']]=new Channel();this[_0x8f09('0x1a')][_0x78fb10['uniqueid']][_0x8f09('0x3d')]=_0x78fb10[_0x8f09('0x4e')]?moment()[_0x8f09('0x4f')](moment[_0x8f09('0x4e')](_0x78fb10[_0x8f09('0x4e')])['seconds'](),'seconds')[_0x8f09('0x3e')](_0x8f09('0x3f')):moment()[_0x8f09('0x3e')](_0x8f09('0x3f'));this['channels'][_0x78fb10[_0x8f09('0x35')]][_0x8f09('0x50')]=_0x8f09('0x14');}_['merge'](this['channels'][_0x78fb10[_0x8f09('0x35')]],_['pick'](_0x78fb10,_['keys'](this[_0x8f09('0x1a')][_0x78fb10[_0x8f09('0x35')]])));if(_['includes'](applications,_0x78fb10[_0x8f09('0x4b')])){this[_0x8f09('0x1a')][_0x78fb10[_0x8f09('0x35')]][_0x8f09('0x51')]=_0x78fb10['application'];this[_0x8f09('0x1a')][_0x78fb10[_0x8f09('0x35')]]['lastdata']=_0x78fb10[_0x8f09('0x4c')];if(_0x78fb10[_0x8f09('0x4b')]===_0x8f09('0x11')&&_[_0x8f09('0x52')](_0x78fb10[_0x8f09('0x4c')],_0x8f09('0x53'))){var _0xab9370=_0x78fb10[_0x8f09('0x4c')][_0x8f09('0x44')]('=');var _0x4faf10=_0xab9370[0x0][_0x8f09('0x54')](/cdr\((.*)\)/);if(_0x4faf10){this[_0x8f09('0x1a')][_0x78fb10[_0x8f09('0x35')]][_0x4faf10[0x1]]=_0xab9370[0x1];}}else if(_0x78fb10[_0x8f09('0x4b')]===_0x8f09('0x55')){this[_0x8f09('0x1a')][_0x78fb10[_0x8f09('0x35')]]['queue']=_0x78fb10[_0x8f09('0x4c')]['split'](',')[0x0];}}}}}catch(_0x4993c1){logger['error']('[syncNewExten][VoiceCallReport]',util['inspect'](_0x4993c1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x21')]=function(_0x1a8545){try{if(this[_0x8f09('0x31')](_0x1a8545)){if(_0x1a8545[_0x8f09('0x35')]!==_0x1a8545[_0x8f09('0x36')]){if(this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]]){if(_0x1a8545['channelstate']==='6'){if(!this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x56')]){var _0x31ea6d=moment();this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]]['answered']=!![];this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]]['answertime']=_0x31ea6d['format'](_0x8f09('0x3f'));if(this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]]['starttime']){this[_0x8f09('0x1a')][_0x1a8545['linkedid']][_0x8f09('0x57')]=_0x31ea6d[_0x8f09('0x58')](this['channels'][_0x1a8545['linkedid']][_0x8f09('0x3d')],'seconds');}}this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x36')]=_0x1a8545[_0x8f09('0x35')];if(_0x1a8545[_0x8f09('0x59')]!==_0x8f09('0x5a')){this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x5b')]=_0x1a8545[_0x8f09('0x59')];}this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x5c')]=_0x1a8545[_0x8f09('0x5d')];this[_0x8f09('0x1a')][_0x1a8545['linkedid']][_0x8f09('0x5e')]=_0x1a8545[_0x8f09('0x3c')];this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x50')]=dispositions[_[_0x8f09('0x5f')](_0x1a8545[_0x8f09('0x40')])];if(this[_0x8f09('0x1b')][_0x1a8545[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]){this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x60')]=this[_0x8f09('0x1b')][_0x1a8545[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]['id'];this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x36')]][_0x8f09('0x61')]=this[_0x8f09('0x1b')][_0x1a8545[_0x8f09('0x3c')]['split']('-')[0x0]][_0x8f09('0x62')];}}}}else{if(this[_0x8f09('0x1a')][_0x1a8545['uniqueid']]){if(_0x1a8545[_0x8f09('0x40')]==='6'){if(this[_0x8f09('0x1b')][_0x1a8545[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]){this['channels'][_0x1a8545[_0x8f09('0x35')]]['UserId']=this[_0x8f09('0x1b')][_0x1a8545['channel'][_0x8f09('0x44')]('-')[0x0]]['id'];this[_0x8f09('0x1a')][_0x1a8545[_0x8f09('0x35')]][_0x8f09('0x61')]=this[_0x8f09('0x1b')][_0x1a8545['channel']['split']('-')[0x0]][_0x8f09('0x62')];}}}}}}catch(_0x3968d1){logger['error'](_0x8f09('0x63'),util[_0x8f09('0x3b')](_0x3968d1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMixMonitorFilename']=function(_0x5ca7d3,_0x1de480){if(this[_0x8f09('0x1a')][_0x5ca7d3]){this['channels'][_0x5ca7d3][_0x8f09('0x64')]=!![];if(_[_0x8f09('0x65')](_0x1de480,_0x8f09('0x66'))){_0x1de480=_0x1de480[_0x8f09('0x67')]('.wav49',_0x8f09('0x68'));}this['channels'][_0x5ca7d3][_0x8f09('0x69')]=_0x1de480;var _0x43e3aa=_['find'](this[_0x8f09('0x1a')][_0x5ca7d3][_0x8f09('0x6a')],{'filename':_0x1de480});if(_[_0x8f09('0x6b')](_0x43e3aa)){this[_0x8f09('0x1a')][_0x5ca7d3][_0x8f09('0x6a')][_0x8f09('0x6c')]({'filename':_0x1de480,'createdAt':moment()[_0x8f09('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x8f09('0x6d')});}}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x22')]=function(_0x3b0c9c){try{if(this['isNotNull'](_0x3b0c9c)){if(this['channels'][_0x3b0c9c[_0x8f09('0x35')]]&&_0x3b0c9c[_0x8f09('0x3c')]!=_0x8f09('0x4a')){if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')])){if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x6f')])){this[_0x8f09('0x70')](_0x3b0c9c['uniqueid'],_0x3b0c9c['value']);}else if(this['isNotNull'](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x71')])){this['channels'][_0x3b0c9c[_0x8f09('0x35')]][_0x8f09('0x59')]=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x73')])){this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x35')]]['callerid']=_0x3b0c9c[_0x8f09('0x72')];}else if(this['isNotNull'](_0x3b0c9c[_0x8f09('0x6e')]['xmd-cdrtype'])){this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x35')]]['type']=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x74')])){this['channels'][_0x3b0c9c[_0x8f09('0x35')]]['queue']=_0x3b0c9c[_0x8f09('0x72')]['split'](',')[0x0];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x75')])){this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x35')]]['originatecalleridnum']=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x76')])){this['channels'][_0x3b0c9c['uniqueid']]['destination']=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x77')])){this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x35')]][_0x8f09('0x78')]=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')]['xmcs-queue'])){this[_0x8f09('0x1a')][_0x3b0c9c['uniqueid']][_0x8f09('0x55')]=_0x3b0c9c[_0x8f09('0x72')];}else if(this[_0x8f09('0x31')](_0x3b0c9c['variable'][_0x8f09('0x79')])){this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x35')]]['sipcalluniqueid']=_0x3b0c9c[_0x8f09('0x72')];}}}else if(this['isNotNull'](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x6f')])){if(_0x3b0c9c[_0x8f09('0x72')]){var _0x15eb25=path[_0x8f09('0x7a')](_0x3b0c9c['value'])[_0x8f09('0x62')];this[_0x8f09('0x70')](_0x15eb25,_0x3b0c9c[_0x8f09('0x72')]);}}else if(this[_0x8f09('0x1a')][_0x3b0c9c[_0x8f09('0x36')]]){if(this['isNotNull'](_0x3b0c9c[_0x8f09('0x6e')])){if(this[_0x8f09('0x31')](_0x3b0c9c[_0x8f09('0x6e')][_0x8f09('0x79')])){this[_0x8f09('0x1a')][_0x3b0c9c['linkedid']][_0x8f09('0x7b')]=_0x3b0c9c[_0x8f09('0x72')];}}}}}catch(_0x266ea5){logger['error']('[syncVarSet][VoiceCallReport]',util[_0x8f09('0x3b')](_0x266ea5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x8f09('0x24')]=function(_0x8cc285){try{if(this[_0x8f09('0x31')](_0x8cc285)){if(this['channels'][_0x8cc285[_0x8f09('0x35')]]){var _0x4cf5df=moment();this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x7c')]=_0x4cf5df[_0x8f09('0x3e')](_0x8f09('0x3f'));this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]]['duration']=_0x4cf5df[_0x8f09('0x58')](this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x3d')],_0x8f09('0x7d'));if(this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x56')]){this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x7e')]=_0x4cf5df['diff'](this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x7f')],_0x8f09('0x7d'));this[_0x8f09('0x1a')][_0x8cc285['uniqueid']][_0x8f09('0x57')]=this['channels'][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x4e')]-this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]][_0x8f09('0x7e')];}if(_0x8cc285[_0x8f09('0x42')]===_0x8f09('0x43')){if(this[_0x8f09('0x1b')][_0x8cc285[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]){this[_0x8f09('0x1b')][_0x8cc285[_0x8f09('0x3c')]['split']('-')[0x0]]=_[_0x8f09('0x80')](this[_0x8f09('0x1b')][_0x8cc285[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]],['destconnectedlinenum']);this[_0x8f09('0x33')](util['format'](_0x8f09('0x47'),this[_0x8f09('0x1b')][_0x8cc285[_0x8f09('0x3c')]['split']('-')[0x0]][_0x8f09('0x62')]),_0x8f09('0x81'),{'destaccountcode':this[_0x8f09('0x1b')][_0x8cc285[_0x8f09('0x3c')][_0x8f09('0x44')]('-')[0x0]]['accountcode']});}}ami[_0x8f09('0x33')]('custom:voiceCallReport',this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]]);delete this[_0x8f09('0x1a')][_0x8cc285[_0x8f09('0x35')]];}}}catch(_0x238b5f){logger[_0x8f09('0x39')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x238b5f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x27')]=function(_0xc161b2){try{if(this[_0x8f09('0x31')](_0xc161b2)){if(this[_0x8f09('0x1a')][_0xc161b2['transfereeuniqueid']]){this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x82')]][_0x8f09('0x83')]=_0xc161b2[_0x8f09('0x84')];this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x82')]][_0x8f09('0x85')]=_0xc161b2[_0x8f09('0x86')];if(this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x87')]]){var _0x241f91=this['channels'][_0xc161b2['secondtransfereruniqueid']];this['channels'][_0xc161b2[_0x8f09('0x87')]]=this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x82')]];this['channels'][_0xc161b2[_0x8f09('0x82')]]=_0x241f91;}}else if(this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x88')]]){this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x88')]]['transfercalleridnum']=_0xc161b2[_0x8f09('0x84')];this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x88')]][_0x8f09('0x85')]=_0xc161b2[_0x8f09('0x86')];if(this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x89')]]){var _0x241f91=this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x89')]];this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x89')]]=this[_0x8f09('0x1a')][_0xc161b2['transfertargetuniqueid']];this[_0x8f09('0x1a')][_0xc161b2[_0x8f09('0x88')]]=_0x241f91;}}}}catch(_0x4bd33e){logger['error'](_0x8f09('0x8a'),util[_0x8f09('0x3b')](_0x4bd33e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x8b')]=function(_0x3a54a0){try{if(this[_0x8f09('0x31')](_0x3a54a0)){if(this[_0x8f09('0x1a')][_0x3a54a0[_0x8f09('0x82')]]){this[_0x8f09('0x1a')][_0x3a54a0[_0x8f09('0x82')]][_0x8f09('0x83')]=_0x3a54a0[_0x8f09('0x8c')];this[_0x8f09('0x1a')][_0x3a54a0[_0x8f09('0x82')]][_0x8f09('0x85')]=_0x3a54a0[_0x8f09('0x8d')];this[_0x8f09('0x24')]({'event':_0x8f09('0x8e'),'uniqueid':_0x3a54a0[_0x8f09('0x82')],'context':_0x3a54a0['context'],'channel':_0x3a54a0[_0x8f09('0x8f')]});}}}catch(_0x35a83d){logger[_0x8f09('0x39')](_0x8f09('0x90'),util[_0x8f09('0x3b')](_0x35a83d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x2a')]=function(_0x22ced3){try{if(this[_0x8f09('0x31')](_0x22ced3)){if(this[_0x8f09('0x1a')][_0x22ced3[_0x8f09('0x35')]]){if(!_[_0x8f09('0x6b')](this[_0x8f09('0x1a')][_0x22ced3[_0x8f09('0x35')]][_0x8f09('0x7f')])){this[_0x8f09('0x1a')][_0x22ced3['uniqueid']][_0x8f09('0x91')]=moment()[_0x8f09('0x3e')](_0x8f09('0x3f'));}}}}catch(_0x1f6148){logger[_0x8f09('0x39')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x8f09('0x3b')](_0x1f6148,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x8f09('0x30')][_0x8f09('0x2b')]=function(_0x33cc71){try{if(this['isNotNull'](_0x33cc71)){if(this[_0x8f09('0x1a')][_0x33cc71[_0x8f09('0x35')]]){if(!_[_0x8f09('0x6b')](this[_0x8f09('0x1a')][_0x33cc71[_0x8f09('0x35')]][_0x8f09('0x91')])){this[_0x8f09('0x1a')][_0x33cc71[_0x8f09('0x35')]][_0x8f09('0x92')]+=moment()['milliseconds'](0x0)[_0x8f09('0x58')](this[_0x8f09('0x1a')][_0x33cc71[_0x8f09('0x35')]][_0x8f09('0x91')],_0x8f09('0x7d'));delete this['channels'][_0x33cc71['uniqueid']][_0x8f09('0x91')];}}}}catch(_0x4e3626){logger[_0x8f09('0x39')](_0x8f09('0x93'),util['inspect'](_0x4e3626,{'showHidden':![],'depth':null}));}};module[_0x8f09('0x94')]=VoiceCallReport; \ No newline at end of file +var _0x1ff8=['type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','transfereecalleridnum','extension','BlindTransfer','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','exports','bluebird','moment','util','path','../../../config/logger','unknown','inuse','invalid','unavailable','ringing','ringinuse','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','syncHangup','newcallerid','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','log','isNotNull','isUndefined','prototype','emit','syncNewCallerId','uniqueid','pick','error','[syncNewCallerId][VoiceCallReport]','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','keys','context','from-sip','split','destconnectedlinenum','user:%s','accountcode','exten','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','appdata','applicationdata','subtract','duration','seconds','includes','lastapplication','lastdata','startsWith','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinename','calleridname','destinationchannel','membername','name','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype'];(function(_0x2c8272,_0x2ff02f){var _0x11490c=function(_0x173c69){while(--_0x173c69){_0x2c8272['push'](_0x2c8272['shift']());}};_0x11490c(++_0x2ff02f);}(_0x1ff8,0x154));var _0x81ff=function(_0x413426,_0x4f7814){_0x413426=_0x413426-0x0;var _0x5576e2=_0x1ff8[_0x413426];return _0x5576e2;};'use strict';var BPromise=require(_0x81ff('0x0'));var _=require('lodash');var moment=require(_0x81ff('0x1'));var util=require(_0x81ff('0x2'));var path=require(_0x81ff('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x81ff('0x4'))('ami');var ami=require('../ami');var Channel=require('../model/channel');var statusDesc=[_0x81ff('0x5'),'not_inuse',_0x81ff('0x6'),'busy',_0x81ff('0x7'),_0x81ff('0x8'),_0x81ff('0x9'),_0x81ff('0xa'),'onhold'];var applications=[_0x81ff('0xb'),_0x81ff('0xc'),_0x81ff('0xd'),_0x81ff('0xe'),_0x81ff('0xf'),_0x81ff('0x10')];var dispositions=[_0x81ff('0x11'),_0x81ff('0x12'),_0x81ff('0x12'),_0x81ff('0x11'),_0x81ff('0x11'),_0x81ff('0x11'),_0x81ff('0x13'),_0x81ff('0x14'),'FAILED',_0x81ff('0x12'),'FAILED'];var actions={};config[_0x81ff('0x15')]=_[_0x81ff('0x16')](config['redis'],{'host':_0x81ff('0x17'),'port':0x18eb});var io=require(_0x81ff('0x18'))(new Redis(config[_0x81ff('0x15')]));function VoiceCallReport(_0x160ec2){this[_0x81ff('0x19')]=_0x160ec2[_0x81ff('0x19')];this[_0x81ff('0x1a')]=_0x160ec2[_0x81ff('0x1a')];ami['on'](_0x81ff('0x1b'),this[_0x81ff('0x1c')][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x1e'),this['syncNewExten'][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x1f'),this[_0x81ff('0x20')][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x21'),this[_0x81ff('0x22')]['bind'](this));ami['on'](_0x81ff('0x23'),this['syncVarSet'][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x24'),this[_0x81ff('0x25')][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x26'),this['syncNewCallerId'][_0x81ff('0x1d')](this));ami['on']('attendedtransfer',this[_0x81ff('0x27')]['bind'](this));ami['on']('blindtransfer',this[_0x81ff('0x28')][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x29'),this[_0x81ff('0x2a')][_0x81ff('0x1d')](this));ami['on'](_0x81ff('0x2b'),this[_0x81ff('0x2c')][_0x81ff('0x1d')](this));return BPromise[_0x81ff('0x2d')]()[_0x81ff('0x2e')](ami['actionCoreShowChannels']())[_0x81ff('0x2f')](function(_0x1e1a4a){console[_0x81ff('0x30')](_0x1e1a4a);});}VoiceCallReport['prototype'][_0x81ff('0x31')]=function(_0x88e313){return _0x88e313!==null&&!_[_0x81ff('0x32')](_0x88e313);};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x34')]=function(_0x5f10bc,_0x4ff860,_0x387eed){io['to'](_0x5f10bc)[_0x81ff('0x34')](_0x4ff860,_0x387eed);};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x35')]=function(_0x48859e){try{if(this[_0x81ff('0x31')](_0x48859e)){if(_0x48859e['uniqueid']===_0x48859e['linkedid']){if(!_[_0x81ff('0x32')](this['channels'][_0x48859e['uniqueid']])){_['merge'](this[_0x81ff('0x19')][_0x48859e[_0x81ff('0x36')]],_[_0x81ff('0x37')](_0x48859e,_['keys'](this[_0x81ff('0x19')][_0x48859e[_0x81ff('0x36')]])));}}}}catch(_0x1fc112){logger[_0x81ff('0x38')](_0x81ff('0x39'),util['inspect'](_0x1fc112,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')]['syncNewChannel']=function(_0x167845){try{if(this[_0x81ff('0x31')](_0x167845)){if(_0x167845[_0x81ff('0x36')]===_0x167845[_0x81ff('0x3a')]&&_0x167845[_0x81ff('0x3b')]!=_0x81ff('0x3c')){if(_[_0x81ff('0x32')](this[_0x81ff('0x19')][_0x167845[_0x81ff('0x36')]])){this[_0x81ff('0x19')][_0x167845[_0x81ff('0x36')]]=new Channel();this['channels'][_0x167845['uniqueid']][_0x81ff('0x3d')]=moment()[_0x81ff('0x3e')](_0x81ff('0x3f'));this[_0x81ff('0x19')][_0x167845['uniqueid']][_0x81ff('0x40')]=dispositions[_[_0x81ff('0x41')](_0x167845[_0x81ff('0x42')])];_[_0x81ff('0x43')](this[_0x81ff('0x19')][_0x167845[_0x81ff('0x36')]],_[_0x81ff('0x37')](_0x167845,_[_0x81ff('0x44')](this[_0x81ff('0x19')][_0x167845['uniqueid']])));if(_0x167845[_0x81ff('0x45')]===_0x81ff('0x46')){if(this[_0x81ff('0x1a')][_0x167845[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]){this['agents'][_0x167845['channel'][_0x81ff('0x47')]('-')[0x0]][_0x81ff('0x48')]=_0x167845['exten'];this[_0x81ff('0x34')](util[_0x81ff('0x3e')](_0x81ff('0x49'),this['agents'][_0x167845['channel'][_0x81ff('0x47')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x81ff('0x1a')][_0x167845[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]][_0x81ff('0x4a')],'destconnectedlinenum':_0x167845[_0x81ff('0x4b')]});}}}}}}catch(_0x4de881){logger[_0x81ff('0x38')](_0x81ff('0x4c'),util[_0x81ff('0x4d')](_0x4de881,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x81ff('0x1c')]=function(_0x1b7d9e){try{if(this['isNotNull'](_0x1b7d9e)){if(_0x1b7d9e['uniqueid']===_0x1b7d9e['linkedid']&&_0x1b7d9e['exten']!='h'&&_0x1b7d9e['channel']!=_0x81ff('0x3c')){_0x1b7d9e[_0x81ff('0x4e')]=_0x1b7d9e[_0x81ff('0x4e')][_0x81ff('0x4f')]();_0x1b7d9e['applicationdata']=(_0x1b7d9e[_0x81ff('0x50')]||_0x1b7d9e[_0x81ff('0x51')])[_0x81ff('0x4f')]();if(_[_0x81ff('0x32')](this[_0x81ff('0x19')][_0x1b7d9e['uniqueid']])){this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]]=new Channel();this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]][_0x81ff('0x3d')]=_0x1b7d9e['duration']?moment()[_0x81ff('0x52')](moment[_0x81ff('0x53')](_0x1b7d9e[_0x81ff('0x53')])[_0x81ff('0x54')](),_0x81ff('0x54'))[_0x81ff('0x3e')](_0x81ff('0x3f')):moment()[_0x81ff('0x3e')](_0x81ff('0x3f'));this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]][_0x81ff('0x40')]='NO\x20ANSWER';}_['merge'](this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]],_['pick'](_0x1b7d9e,_[_0x81ff('0x44')](this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]])));if(_[_0x81ff('0x55')](applications,_0x1b7d9e[_0x81ff('0x4e')])){this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]][_0x81ff('0x56')]=_0x1b7d9e[_0x81ff('0x4e')];this['channels'][_0x1b7d9e[_0x81ff('0x36')]][_0x81ff('0x57')]=_0x1b7d9e[_0x81ff('0x51')];if(_0x1b7d9e[_0x81ff('0x4e')]===_0x81ff('0xb')&&_[_0x81ff('0x58')](_0x1b7d9e[_0x81ff('0x51')],'cdr(')){var _0x30d756=_0x1b7d9e[_0x81ff('0x51')]['split']('=');var _0x76dbb9=_0x30d756[0x0]['match'](/cdr\((.*)\)/);if(_0x76dbb9){this[_0x81ff('0x19')][_0x1b7d9e['uniqueid']][_0x76dbb9[0x1]]=_0x30d756[0x1];}}else if(_0x1b7d9e[_0x81ff('0x4e')]===_0x81ff('0xc')){this[_0x81ff('0x19')][_0x1b7d9e[_0x81ff('0x36')]][_0x81ff('0xc')]=_0x1b7d9e[_0x81ff('0x51')]['split'](',')[0x0];}}}}}catch(_0x339737){logger[_0x81ff('0x38')](_0x81ff('0x59'),util[_0x81ff('0x4d')](_0x339737,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')]['syncNewState']=function(_0xd07ac5){try{if(this[_0x81ff('0x31')](_0xd07ac5)){if(_0xd07ac5[_0x81ff('0x36')]!==_0xd07ac5['linkedid']){if(this['channels'][_0xd07ac5[_0x81ff('0x3a')]]){if(_0xd07ac5[_0x81ff('0x42')]==='6'){if(!this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x5a')]){var _0x544b8f=moment();this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]]['answered']=!![];this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x5b')]=_0x544b8f['format'](_0x81ff('0x3f'));if(this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x3d')]){this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x5c')]=_0x544b8f[_0x81ff('0x5d')](this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x3d')],_0x81ff('0x54'));}}this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x3a')]=_0xd07ac5[_0x81ff('0x36')];if(_0xd07ac5[_0x81ff('0x5e')]!==_0x81ff('0x5f')){this[_0x81ff('0x19')][_0xd07ac5['linkedid']]['connectedlinenum']=_0xd07ac5[_0x81ff('0x5e')];}this['channels'][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x60')]=_0xd07ac5[_0x81ff('0x61')];this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x62')]=_0xd07ac5[_0x81ff('0x3b')];this['channels'][_0xd07ac5[_0x81ff('0x3a')]]['disposition']=dispositions[_[_0x81ff('0x41')](_0xd07ac5[_0x81ff('0x42')])];if(this['agents'][_0xd07ac5[_0x81ff('0x3b')]['split']('-')[0x0]]){this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x3a')]]['UserId']=this[_0x81ff('0x1a')][_0xd07ac5['channel'][_0x81ff('0x47')]('-')[0x0]]['id'];this['channels'][_0xd07ac5[_0x81ff('0x3a')]][_0x81ff('0x63')]=this[_0x81ff('0x1a')][_0xd07ac5[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]][_0x81ff('0x64')];}}}}else{if(this['channels'][_0xd07ac5['uniqueid']]){if(_0xd07ac5[_0x81ff('0x42')]==='6'){if(this[_0x81ff('0x1a')][_0xd07ac5[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]){this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x36')]]['UserId']=this[_0x81ff('0x1a')][_0xd07ac5[_0x81ff('0x3b')]['split']('-')[0x0]]['id'];this[_0x81ff('0x19')][_0xd07ac5[_0x81ff('0x36')]]['membername']=this[_0x81ff('0x1a')][_0xd07ac5[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]['name'];}}}}}}catch(_0x43f1e2){logger[_0x81ff('0x38')]('[syncNewState][VoiceCallReport]',util[_0x81ff('0x4d')](_0x43f1e2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x65')]=function(_0x5a4393,_0x4e9f78){if(this[_0x81ff('0x19')][_0x5a4393]){this['channels'][_0x5a4393][_0x81ff('0x66')]=!![];if(_[_0x81ff('0x67')](_0x4e9f78,_0x81ff('0x68'))){_0x4e9f78=_0x4e9f78[_0x81ff('0x69')](_0x81ff('0x68'),_0x81ff('0x6a'));}this[_0x81ff('0x19')][_0x5a4393][_0x81ff('0x6b')]=_0x4e9f78;var _0xfd8d08=_['find'](this['channels'][_0x5a4393][_0x81ff('0x6c')],{'filename':_0x4e9f78});if(_[_0x81ff('0x6d')](_0xfd8d08)){this['channels'][_0x5a4393][_0x81ff('0x6c')][_0x81ff('0x6e')]({'filename':_0x4e9f78,'createdAt':moment()['format'](_0x81ff('0x3f')),'mixmonitorid':'','status':_0x81ff('0x6f')});}}};VoiceCallReport[_0x81ff('0x33')]['syncVarSet']=function(_0x26038e){try{if(this[_0x81ff('0x31')](_0x26038e)){if(this[_0x81ff('0x19')][_0x26038e['uniqueid']]&&_0x26038e['channel']!='OutgoingSpoolFailed'){if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')])){if(this['isNotNull'](_0x26038e[_0x81ff('0x70')][_0x81ff('0x71')])){this[_0x81ff('0x65')](_0x26038e[_0x81ff('0x36')],_0x26038e['value']);}else if(this[_0x81ff('0x31')](_0x26038e['variable'][_0x81ff('0x72')])){this[_0x81ff('0x19')][_0x26038e['uniqueid']]['calleridnum']=_0x26038e[_0x81ff('0x73')];}else if(this['isNotNull'](_0x26038e[_0x81ff('0x70')][_0x81ff('0x74')])){this[_0x81ff('0x19')][_0x26038e['uniqueid']][_0x81ff('0x75')]=_0x26038e[_0x81ff('0x73')];}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')][_0x81ff('0x76')])){this[_0x81ff('0x19')][_0x26038e[_0x81ff('0x36')]][_0x81ff('0x77')]=_0x26038e[_0x81ff('0x73')];}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')][_0x81ff('0x78')])){this['channels'][_0x26038e[_0x81ff('0x36')]][_0x81ff('0xc')]=_0x26038e['value'][_0x81ff('0x47')](',')[0x0];}else if(this[_0x81ff('0x31')](_0x26038e['variable'][_0x81ff('0x79')])){this[_0x81ff('0x19')][_0x26038e[_0x81ff('0x36')]][_0x81ff('0x7a')]=_0x26038e['value'];}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')]['xmd-destination'])){this[_0x81ff('0x19')][_0x26038e['uniqueid']][_0x81ff('0x7b')]=_0x26038e[_0x81ff('0x73')];}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')][_0x81ff('0x7c')])){this[_0x81ff('0x19')][_0x26038e['uniqueid']][_0x81ff('0x7d')]=_0x26038e[_0x81ff('0x73')];}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')][_0x81ff('0x7e')])){this[_0x81ff('0x19')][_0x26038e[_0x81ff('0x36')]]['queue']=_0x26038e[_0x81ff('0x73')];}else if(this[_0x81ff('0x31')](_0x26038e['variable'][_0x81ff('0x7f')])){this[_0x81ff('0x19')][_0x26038e[_0x81ff('0x36')]][_0x81ff('0x80')]=_0x26038e[_0x81ff('0x73')];}}}else if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')]['mixmonitor_filename'])){if(_0x26038e[_0x81ff('0x73')]){var _0x4d6cac=path[_0x81ff('0x81')](_0x26038e['value'])[_0x81ff('0x64')];this[_0x81ff('0x65')](_0x4d6cac,_0x26038e[_0x81ff('0x73')]);}}else if(this[_0x81ff('0x19')][_0x26038e[_0x81ff('0x3a')]]){if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')])){if(this[_0x81ff('0x31')](_0x26038e[_0x81ff('0x70')][_0x81ff('0x7f')])){this['channels'][_0x26038e['linkedid']][_0x81ff('0x82')]=_0x26038e['value'];}}}}}catch(_0x2364c4){logger['error'](_0x81ff('0x83'),util[_0x81ff('0x4d')](_0x2364c4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x25')]=function(_0x43a977){try{if(this[_0x81ff('0x31')](_0x43a977)){if(this['channels'][_0x43a977[_0x81ff('0x36')]]){var _0x2cdc14=moment();this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x84')]=_0x2cdc14[_0x81ff('0x3e')](_0x81ff('0x3f'));this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x53')]=_0x2cdc14['diff'](this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x3d')],_0x81ff('0x54'));if(this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x5a')]){this[_0x81ff('0x19')][_0x43a977['uniqueid']]['billableseconds']=_0x2cdc14[_0x81ff('0x5d')](this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x5b')],_0x81ff('0x54'));this[_0x81ff('0x19')][_0x43a977['uniqueid']][_0x81ff('0x5c')]=this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]][_0x81ff('0x53')]-this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]]['billableseconds'];}if(_0x43a977['context']===_0x81ff('0x46')){if(this[_0x81ff('0x1a')][_0x43a977[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]){this[_0x81ff('0x1a')][_0x43a977[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]=_['omit'](this[_0x81ff('0x1a')][_0x43a977['channel'][_0x81ff('0x47')]('-')[0x0]],[_0x81ff('0x48')]);this[_0x81ff('0x34')](util[_0x81ff('0x3e')](_0x81ff('0x49'),this[_0x81ff('0x1a')][_0x43a977['channel'][_0x81ff('0x47')]('-')[0x0]]['name']),_0x81ff('0x85'),{'destaccountcode':this['agents'][_0x43a977[_0x81ff('0x3b')][_0x81ff('0x47')]('-')[0x0]]['accountcode']});}}ami[_0x81ff('0x34')](_0x81ff('0x86'),this[_0x81ff('0x19')][_0x43a977['uniqueid']]);delete this[_0x81ff('0x19')][_0x43a977[_0x81ff('0x36')]];}}}catch(_0x2229d2){logger[_0x81ff('0x38')](_0x81ff('0x87'),util[_0x81ff('0x4d')](_0x2229d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x27')]=function(_0x2d4b79){try{if(this[_0x81ff('0x31')](_0x2d4b79)){if(this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x88')]]){this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x88')]][_0x81ff('0x89')]=_0x2d4b79[_0x81ff('0x8a')];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x88')]]['transferconnectedlinenum']=_0x2d4b79[_0x81ff('0x8b')];if(this[_0x81ff('0x19')][_0x2d4b79['secondtransfereruniqueid']]){var _0x53fbcf=this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8c')]];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8c')]]=this['channels'][_0x2d4b79[_0x81ff('0x88')]];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x88')]]=_0x53fbcf;}}else if(this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8d')]]){this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8d')]]['transfercalleridnum']=_0x2d4b79[_0x81ff('0x8a')];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8d')]][_0x81ff('0x8e')]=_0x2d4b79[_0x81ff('0x8b')];if(this[_0x81ff('0x19')][_0x2d4b79['origtransfereruniqueid']]){var _0x53fbcf=this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8f')]];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8f')]]=this['channels'][_0x2d4b79['transfertargetuniqueid']];this[_0x81ff('0x19')][_0x2d4b79[_0x81ff('0x8d')]]=_0x53fbcf;}}}}catch(_0x519e6b){logger['error']('[syncAttendedTransfer][VoiceCallReport]',util[_0x81ff('0x4d')](_0x519e6b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x28')]=function(_0x54efb9){try{if(this[_0x81ff('0x31')](_0x54efb9)){if(this['channels'][_0x54efb9[_0x81ff('0x88')]]){this[_0x81ff('0x19')][_0x54efb9[_0x81ff('0x88')]]['transfercalleridnum']=_0x54efb9[_0x81ff('0x90')];this[_0x81ff('0x19')][_0x54efb9[_0x81ff('0x88')]]['transferconnectedlinenum']=_0x54efb9[_0x81ff('0x91')];this[_0x81ff('0x25')]({'event':_0x81ff('0x92'),'uniqueid':_0x54efb9[_0x81ff('0x88')],'context':_0x54efb9[_0x81ff('0x45')],'channel':_0x54efb9[_0x81ff('0x93')]});}}}catch(_0x40ff70){logger[_0x81ff('0x38')]('[syncBlindTransfer][VoiceCallReport]',util[_0x81ff('0x4d')](_0x40ff70,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')]['syncMusicOnHoldStart']=function(_0x373181){try{if(this[_0x81ff('0x31')](_0x373181)){if(this[_0x81ff('0x19')][_0x373181[_0x81ff('0x36')]]){if(!_['isNil'](this[_0x81ff('0x19')][_0x373181[_0x81ff('0x36')]][_0x81ff('0x5b')])){this[_0x81ff('0x19')][_0x373181[_0x81ff('0x36')]][_0x81ff('0x94')]=moment()[_0x81ff('0x3e')](_0x81ff('0x3f'));}}}}catch(_0x1795bf){logger[_0x81ff('0x38')](_0x81ff('0x95'),util['inspect'](_0x1795bf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x81ff('0x33')][_0x81ff('0x2c')]=function(_0x368368){try{if(this['isNotNull'](_0x368368)){if(this[_0x81ff('0x19')][_0x368368[_0x81ff('0x36')]]){if(!_['isNil'](this[_0x81ff('0x19')][_0x368368['uniqueid']][_0x81ff('0x94')])){this[_0x81ff('0x19')][_0x368368[_0x81ff('0x36')]][_0x81ff('0x96')]+=moment()[_0x81ff('0x97')](0x0)['diff'](this[_0x81ff('0x19')][_0x368368['uniqueid']][_0x81ff('0x94')],_0x81ff('0x54'));delete this[_0x81ff('0x19')][_0x368368[_0x81ff('0x36')]][_0x81ff('0x94')];}}}}catch(_0x1934db){logger[_0x81ff('0x38')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x1934db,{'showHidden':![],'depth':null}));}};module[_0x81ff('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 0d55511..6664e73 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 _0x09f1=['total','answered','holdtime','starttime','seconds','billableseconds','sumHoldTime','sumDuration','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','bind','dialend','syncDialEnd','varset','syncVarSet','syncHangup','prototype','isUndefined','emit','syncDialBegin','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','custom:dialconnect','[syncDialEnd][VoiceDialReport]','isNotNull','addVariable','keys','variable','value','variables','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','duration','endtime','diff','lastevent','complete'];(function(_0x30c53c,_0x1c93f4){var _0x42500f=function(_0x1ba019){while(--_0x1ba019){_0x30c53c['push'](_0x30c53c['shift']());}};_0x42500f(++_0x1c93f4);}(_0x09f1,0xbf));var _0x109f=function(_0x359cf5,_0x4c6775){_0x359cf5=_0x359cf5-0x0;var _0x23b25c=_0x09f1[_0x359cf5];return _0x23b25c;};'use strict';var _=require(_0x109f('0x0'));var moment=require(_0x109f('0x1'));var util=require('util');var Redis=require(_0x109f('0x2'));var config=require(_0x109f('0x3'));var logger=require(_0x109f('0x4'))(_0x109f('0x5'));var ami=require(_0x109f('0x6'));config[_0x109f('0x7')]=_[_0x109f('0x8')](config[_0x109f('0x7')],{'host':_0x109f('0x9'),'port':0x18eb});var io=require(_0x109f('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x3aa5b5){this[_0x109f('0xb')]=_0x3aa5b5[_0x109f('0xc')];this[_0x109f('0xd')]=_0x3aa5b5[_0x109f('0xd')];this['variables']={};ami['on']('dialbegin',this['syncDialBegin'][_0x109f('0xe')](this));ami['on'](_0x109f('0xf'),this[_0x109f('0x10')][_0x109f('0xe')](this));ami['on'](_0x109f('0x11'),this[_0x109f('0x12')][_0x109f('0xe')](this));ami['on']('hangup',this[_0x109f('0x13')]['bind'](this));}VoiceDialReport[_0x109f('0x14')]['isNotNull']=function(_0x15d179){return _0x15d179!==null&&!_[_0x109f('0x15')](_0x15d179);};VoiceDialReport['prototype'][_0x109f('0x16')]=function(_0x464aff,_0x5a439d,_0x15dbe6){io['to'](_0x464aff)[_0x109f('0x16')](_0x5a439d,_0x15dbe6);};VoiceDialReport[_0x109f('0x14')][_0x109f('0x17')]=function(_0x268a3b){try{if(this['isNotNull'](_0x268a3b)){if(this[_0x109f('0xb')][_0x268a3b[_0x109f('0x18')]]){_[_0x109f('0x19')](this[_0x109f('0xb')][_0x268a3b[_0x109f('0x18')]],{'starttime':moment()['format'](_0x109f('0x1a')),'lastevent':_0x109f('0x1b'),'interface':_0x268a3b[_0x109f('0x1c')][_0x109f('0x1d')](0x0,_0x268a3b[_0x109f('0x1c')][_0x109f('0x1e')]('-')),'membername':_0x268a3b['channel']['substring'](_0x268a3b[_0x109f('0x1c')][_0x109f('0x1e')]('/')+0x1,_0x268a3b[_0x109f('0x1c')]['lastIndexOf']('-'))},_[_0x109f('0x1f')](_0x268a3b,[_0x109f('0x20'),'privilege']));this['emit'](_0x109f('0x21'),_0x109f('0x22'),this[_0x109f('0xb')][_0x268a3b['uniqueid']]);ami[_0x109f('0x16')]('custom:dialbegin',this[_0x109f('0xb')][_0x268a3b[_0x109f('0x18')]]);}}}catch(_0x379dac){logger[_0x109f('0x23')](_0x109f('0x24'),util[_0x109f('0x25')](_0x379dac,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x386289){try{if(this['isNotNull'](_0x386289)){if(this['channels'][_0x386289['uniqueid']]){this[_0x109f('0xb')][_0x386289['uniqueid']][_0x109f('0x26')]=_0x386289[_0x109f('0x26')];if(_0x386289[_0x109f('0x26')]===_0x109f('0x27')){this[_0x109f('0xb')][_0x386289['uniqueid']][_0x109f('0x28')]=_0x386289[_0x109f('0x28')];this[_0x109f('0xb')][_0x386289[_0x109f('0x18')]]['connectedlinename']=_0x386289[_0x109f('0x29')];this[_0x109f('0xb')][_0x386289[_0x109f('0x18')]][_0x109f('0x2a')]=moment()[_0x109f('0x2b')](_0x109f('0x1a'));this['channels'][_0x386289[_0x109f('0x18')]]['lastevent']='connect';ami[_0x109f('0x16')](_0x109f('0x2c'),this[_0x109f('0xb')][_0x386289['uniqueid']]);}this['emit']('voice:outbound',_0x109f('0x22'),this[_0x109f('0xb')][_0x386289[_0x109f('0x18')]]);}}}catch(_0x63b745){logger[_0x109f('0x23')](_0x109f('0x2d'),util[_0x109f('0x25')](_0x63b745,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x109f('0x14')][_0x109f('0x12')]=function(_0x1a11f3){try{if(this[_0x109f('0x2e')](_0x1a11f3)){this[_0x109f('0x2f')](_0x1a11f3[_0x109f('0x18')],_[_0x109f('0x30')](_0x1a11f3[_0x109f('0x31')])[0x0],_0x1a11f3[_0x109f('0x32')]);if(this[_0x109f('0x2e')](_0x1a11f3[_0x109f('0x31')])&&this['isNotNull'](_0x1a11f3[_0x109f('0x31')]['outboundrouteid'])){if(_['isUndefined'](this[_0x109f('0xb')][_0x1a11f3[_0x109f('0x18')]])){this[_0x109f('0xb')][_0x1a11f3[_0x109f('0x18')]]={'routeId':_0x1a11f3['value'],'variables':this[_0x109f('0x33')][_0x1a11f3['uniqueid']]};this[_0x109f('0x16')](_0x109f('0x21'),_0x109f('0x22'),this[_0x109f('0xb')][_0x1a11f3[_0x109f('0x18')]]);}}}}catch(_0x42085c){logger[_0x109f('0x23')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x42085c,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x109f('0x2f')]=function(_0x126b69,_0x47900b,_0x25e746){var _0x2f4285=['rtpaudioqos',_0x109f('0x34'),_0x109f('0x35'),'rtpaudioqosjitterbridged',_0x109f('0x36'),_0x109f('0x37'),'rtpaudioqosrtt',_0x109f('0x38'),_0x109f('0x39'),'sipuri',_0x109f('0x3a'),_0x109f('0x3b'),_0x109f('0x3c'),_0x109f('0x3d'),'memberinterface',_0x109f('0x3e'),_0x109f('0x3f'),_0x109f('0x40'),_0x109f('0x41')];if(!_[_0x109f('0x42')](_0x47900b)&&!_[_0x109f('0x43')](_0x2f4285,_0x47900b)){if(_['isUndefined'](this[_0x109f('0x33')][_0x126b69])){this['variables'][_0x126b69]={};}this[_0x109f('0x33')][_0x126b69][_0x47900b]=_0x25e746;}};VoiceDialReport[_0x109f('0x14')]['syncHangup']=function(_0x906240){try{if(this[_0x109f('0x2e')](_0x906240)){if(this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]]){this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]]['endtime']=moment()[_0x109f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x44')]=moment(this['channels'][_0x906240[_0x109f('0x18')]][_0x109f('0x45')])[_0x109f('0x46')](this['channels'][_0x906240[_0x109f('0x18')]]['starttime'],'seconds');this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x47')]=_0x109f('0x48');this[_0x109f('0xd')][_0x109f('0x49')]+=0x1;if(this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x2a')]){this[_0x109f('0xd')][_0x109f('0x4a')]+=0x1;this['channels'][_0x906240[_0x109f('0x18')]][_0x109f('0x4b')]=moment(this['channels'][_0x906240[_0x109f('0x18')]]['answertime'])[_0x109f('0x46')](this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x4c')],_0x109f('0x4d'));this[_0x109f('0xb')][_0x906240['uniqueid']][_0x109f('0x4e')]=moment(this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x45')])[_0x109f('0x46')](this[_0x109f('0xb')][_0x906240['uniqueid']][_0x109f('0x2a')],_0x109f('0x4d'));this[_0x109f('0xd')][_0x109f('0x4f')]+=this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x4b')]||0x0;this['outbound']['sumBillable']+=this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]][_0x109f('0x4e')];}this[_0x109f('0xd')][_0x109f('0x50')]+=this[_0x109f('0xb')][_0x906240['uniqueid']][_0x109f('0x44')];ami[_0x109f('0x16')]('custom:voiceDialReport',this['channels'][_0x906240['uniqueid']]);ami[_0x109f('0x16')]('custom:dialend',this['channels'][_0x906240[_0x109f('0x18')]]);this[_0x109f('0x16')](_0x109f('0x21'),_0x109f('0x51'),this[_0x109f('0xd')]);logger[_0x109f('0x52')](_0x109f('0x53'),JSON[_0x109f('0x54')](this['channels'][_0x906240[_0x109f('0x18')]]));this[_0x109f('0x16')](_0x109f('0x21'),_0x109f('0x55'),this['channels'][_0x906240[_0x109f('0x18')]]);delete this[_0x109f('0xb')][_0x906240[_0x109f('0x18')]];}if(this[_0x109f('0x33')][_0x906240['uniqueid']]){delete this[_0x109f('0x33')][_0x906240['uniqueid']];}}}catch(_0x28cd47){logger[_0x109f('0x23')](_0x109f('0x56'),util[_0x109f('0x25')](_0x28cd47,{'showHidden':![],'depth':null}));}};module[_0x109f('0x57')]=VoiceDialReport; \ No newline at end of file +var _0x4e5d=['syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','syncHangup','prototype','emit','uniqueid','merge','format','called','substring','channel','lastIndexOf','event','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','voice:outbound','voice_outbound_channel:save','isNotNull','addVariable','keys','variable','value','outboundrouteid','error','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','isUndefined','endtime','duration','diff','starttime','seconds','total','answered','holdtime','sumBillable','billableseconds','sumDuration','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin'];(function(_0x10a94d,_0x3bf30f){var _0x33b351=function(_0x10277c){while(--_0x10277c){_0x10a94d['push'](_0x10a94d['shift']());}};_0x33b351(++_0x3bf30f);}(_0x4e5d,0x152));var _0xd4e5=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x4e5d[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0xd4e5('0x0'));var moment=require('moment');var util=require(_0xd4e5('0x1'));var Redis=require(_0xd4e5('0x2'));var config=require(_0xd4e5('0x3'));var logger=require('../../../config/logger')(_0xd4e5('0x4'));var ami=require(_0xd4e5('0x5'));config['redis']=_[_0xd4e5('0x6')](config[_0xd4e5('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd4e5('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x3ccbf3){this[_0xd4e5('0x9')]=_0x3ccbf3[_0xd4e5('0xa')];this['outbound']=_0x3ccbf3[_0xd4e5('0xb')];this[_0xd4e5('0xc')]={};ami['on'](_0xd4e5('0xd'),this[_0xd4e5('0xe')][_0xd4e5('0xf')](this));ami['on'](_0xd4e5('0x10'),this[_0xd4e5('0x11')][_0xd4e5('0xf')](this));ami['on']('varset',this[_0xd4e5('0x12')][_0xd4e5('0xf')](this));ami['on']('hangup',this[_0xd4e5('0x13')][_0xd4e5('0xf')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x13278e){return _0x13278e!==null&&!_['isUndefined'](_0x13278e);};VoiceDialReport[_0xd4e5('0x14')][_0xd4e5('0x15')]=function(_0x18befc,_0x37f386,_0x345ffb){io['to'](_0x18befc)['emit'](_0x37f386,_0x345ffb);};VoiceDialReport[_0xd4e5('0x14')][_0xd4e5('0xe')]=function(_0x338966){try{if(this['isNotNull'](_0x338966)){if(this[_0xd4e5('0x9')][_0x338966[_0xd4e5('0x16')]]){_[_0xd4e5('0x17')](this[_0xd4e5('0x9')][_0x338966[_0xd4e5('0x16')]],{'starttime':moment()[_0xd4e5('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xd4e5('0x19'),'interface':_0x338966['channel'][_0xd4e5('0x1a')](0x0,_0x338966[_0xd4e5('0x1b')][_0xd4e5('0x1c')]('-')),'membername':_0x338966['channel']['substring'](_0x338966['channel']['lastIndexOf']('/')+0x1,_0x338966['channel'][_0xd4e5('0x1c')]('-'))},_['omit'](_0x338966,[_0xd4e5('0x1d'),'privilege']));this[_0xd4e5('0x15')]('voice:outbound','voice_outbound_channel:save',this[_0xd4e5('0x9')][_0x338966[_0xd4e5('0x16')]]);ami['emit'](_0xd4e5('0x1e'),this[_0xd4e5('0x9')][_0x338966[_0xd4e5('0x16')]]);}}}catch(_0x273a3d){logger['error'](_0xd4e5('0x1f'),util[_0xd4e5('0x20')](_0x273a3d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd4e5('0x14')][_0xd4e5('0x11')]=function(_0xedce99){try{if(this['isNotNull'](_0xedce99)){if(this[_0xd4e5('0x9')][_0xedce99[_0xd4e5('0x16')]]){this['channels'][_0xedce99[_0xd4e5('0x16')]]['dialstatus']=_0xedce99[_0xd4e5('0x21')];if(_0xedce99['dialstatus']===_0xd4e5('0x22')){this[_0xd4e5('0x9')][_0xedce99[_0xd4e5('0x16')]][_0xd4e5('0x23')]=_0xedce99[_0xd4e5('0x23')];this[_0xd4e5('0x9')][_0xedce99['uniqueid']][_0xd4e5('0x24')]=_0xedce99[_0xd4e5('0x24')];this['channels'][_0xedce99['uniqueid']][_0xd4e5('0x25')]=moment()[_0xd4e5('0x18')](_0xd4e5('0x26'));this[_0xd4e5('0x9')][_0xedce99[_0xd4e5('0x16')]][_0xd4e5('0x27')]=_0xd4e5('0x28');ami[_0xd4e5('0x15')](_0xd4e5('0x29'),this[_0xd4e5('0x9')][_0xedce99[_0xd4e5('0x16')]]);}this[_0xd4e5('0x15')](_0xd4e5('0x2a'),_0xd4e5('0x2b'),this[_0xd4e5('0x9')][_0xedce99[_0xd4e5('0x16')]]);}}}catch(_0x4e871d){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0xd4e5('0x20')](_0x4e871d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd4e5('0x14')][_0xd4e5('0x12')]=function(_0x220fe6){try{if(this[_0xd4e5('0x2c')](_0x220fe6)){this[_0xd4e5('0x2d')](_0x220fe6[_0xd4e5('0x16')],_[_0xd4e5('0x2e')](_0x220fe6[_0xd4e5('0x2f')])[0x0],_0x220fe6[_0xd4e5('0x30')]);if(this[_0xd4e5('0x2c')](_0x220fe6[_0xd4e5('0x2f')])&&this[_0xd4e5('0x2c')](_0x220fe6[_0xd4e5('0x2f')][_0xd4e5('0x31')])){if(_['isUndefined'](this['channels'][_0x220fe6[_0xd4e5('0x16')]])){this[_0xd4e5('0x9')][_0x220fe6[_0xd4e5('0x16')]]={'routeId':_0x220fe6[_0xd4e5('0x30')],'variables':this[_0xd4e5('0xc')][_0x220fe6[_0xd4e5('0x16')]]};this['emit'](_0xd4e5('0x2a'),'voice_outbound_channel:save',this['channels'][_0x220fe6[_0xd4e5('0x16')]]);}}}}catch(_0x5a3703){logger[_0xd4e5('0x32')](_0xd4e5('0x33'),util[_0xd4e5('0x20')](_0x5a3703,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd4e5('0x14')][_0xd4e5('0x2d')]=function(_0x203886,_0x5d2f30,_0x393b61){var _0x17ffd1=['rtpaudioqos',_0xd4e5('0x34'),_0xd4e5('0x35'),'rtpaudioqosjitterbridged',_0xd4e5('0x36'),_0xd4e5('0x37'),_0xd4e5('0x38'),_0xd4e5('0x39'),_0xd4e5('0x3a'),'sipuri',_0xd4e5('0x3b'),_0xd4e5('0x3c'),_0xd4e5('0x3d'),_0xd4e5('0x3e'),_0xd4e5('0x3f'),_0xd4e5('0x40'),_0xd4e5('0x41'),_0xd4e5('0x42'),_0xd4e5('0x43')];if(!_[_0xd4e5('0x44')](_0x5d2f30)&&!_[_0xd4e5('0x45')](_0x17ffd1,_0x5d2f30)){if(_[_0xd4e5('0x46')](this[_0xd4e5('0xc')][_0x203886])){this[_0xd4e5('0xc')][_0x203886]={};}this['variables'][_0x203886][_0x5d2f30]=_0x393b61;}};VoiceDialReport['prototype'][_0xd4e5('0x13')]=function(_0x4e7f0c){try{if(this[_0xd4e5('0x2c')](_0x4e7f0c)){if(this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]]){this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x47')]=moment()[_0xd4e5('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd4e5('0x9')][_0x4e7f0c['uniqueid']][_0xd4e5('0x48')]=moment(this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x47')])[_0xd4e5('0x49')](this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x4a')],_0xd4e5('0x4b'));this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x27')]='complete';this[_0xd4e5('0xb')][_0xd4e5('0x4c')]+=0x1;if(this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x25')]){this[_0xd4e5('0xb')][_0xd4e5('0x4d')]+=0x1;this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x4e')]=moment(this['channels'][_0x4e7f0c['uniqueid']]['answertime'])[_0xd4e5('0x49')](this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x4a')],_0xd4e5('0x4b'));this['channels'][_0x4e7f0c[_0xd4e5('0x16')]]['billableseconds']=moment(this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x47')])[_0xd4e5('0x49')](this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]]['answertime'],_0xd4e5('0x4b'));this[_0xd4e5('0xb')]['sumHoldTime']+=this['channels'][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x4e')]||0x0;this[_0xd4e5('0xb')][_0xd4e5('0x4f')]+=this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]][_0xd4e5('0x50')];}this[_0xd4e5('0xb')][_0xd4e5('0x51')]+=this[_0xd4e5('0x9')][_0x4e7f0c['uniqueid']][_0xd4e5('0x48')];ami[_0xd4e5('0x15')]('custom:voiceDialReport',this['channels'][_0x4e7f0c[_0xd4e5('0x16')]]);ami['emit']('custom:dialend',this[_0xd4e5('0x9')][_0x4e7f0c['uniqueid']]);this[_0xd4e5('0x15')](_0xd4e5('0x2a'),_0xd4e5('0x52'),this[_0xd4e5('0xb')]);logger[_0xd4e5('0x53')](_0xd4e5('0x54'),JSON[_0xd4e5('0x55')](this['channels'][_0x4e7f0c[_0xd4e5('0x16')]]));this[_0xd4e5('0x15')](_0xd4e5('0x2a'),_0xd4e5('0x56'),this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]]);delete this[_0xd4e5('0x9')][_0x4e7f0c[_0xd4e5('0x16')]];}if(this[_0xd4e5('0xc')][_0x4e7f0c[_0xd4e5('0x16')]]){delete this[_0xd4e5('0xc')][_0x4e7f0c[_0xd4e5('0x16')]];}}}catch(_0x6d0ec1){logger['error']('[syncHangup][VoiceDialReport]',util[_0xd4e5('0x20')](_0x6d0ec1,{'showHidden':![],'depth':null}));}};module[_0xd4e5('0x57')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index ea08d57..f2d86e8 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 _0xd1de=['transfer','reason','startsWith','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','variable','value','queuestatus','CONTINUE','lastevent','timeout','custom:timeout','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','length','abandoned','sumHoldTime','diff','sumBillable','milliseconds','custom:queuecallerunmanaged','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','transfereeuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','[syncAttendedTransfer][VoiceQueueReport]','BLIND','BlindTransfer','context','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','md5','../../../config/environment','../ami','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','channels','switch','isNil','Action','status','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice_queue_channel:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumDuration','total','unmanaged','Trunk','active','callerid','Interval','stringify','voice_queue:save','isUndefined','loopQueueShow','clearZombieChannels','queues','loopQueueSummary','then','[queuesummary]','isNotNull','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexit','queuecallerexitAt'];(function(_0x885bab,_0x452e79){var _0xc0265e=function(_0x4d16a4){while(--_0x4d16a4){_0x885bab['push'](_0x885bab['shift']());}};_0xc0265e(++_0x452e79);}(_0xd1de,0x1df));var _0xed1d=function(_0x55fbce,_0x42a1ba){_0x55fbce=_0x55fbce-0x0;var _0x4ca400=_0xd1de[_0x55fbce];return _0x4ca400;};'use strict';var _=require(_0xed1d('0x0'));var moment=require(_0xed1d('0x1'));var BPromise=require(_0xed1d('0x2'));var util=require(_0xed1d('0x3'));var md5=require(_0xed1d('0x4'));var Redis=require('ioredis');var config=require(_0xed1d('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0xed1d('0x6'));var QueueReport=require('../model/queueReport');config['redis']=_[_0xed1d('0x7')](config[_0xed1d('0x8')],{'host':_0xed1d('0x9'),'port':0x18eb});var io=require(_0xed1d('0xa'))(new Redis(config[_0xed1d('0x8')]));var Sequence=function(){};Sequence[_0xed1d('0xb')][_0xed1d('0xc')]=function(_0x58df2f){this[_0xed1d('0xd')]=this[_0xed1d('0xd')]?this['tail'][_0xed1d('0xe')](_0x58df2f):_0x58df2f();};function VoiceQueueReport(_0x562b93){this['sequence']=new Sequence();this['queueReports']={};this[_0xed1d('0xf')]=_0x562b93[_0xed1d('0xf')];this['channels']=_0x562b93[_0xed1d('0x10')];this[_0xed1d('0x11')]=_0x562b93[_0xed1d('0x11')];this[_0xed1d('0x12')]=!![];this[_0xed1d('0x13')]=_0x562b93[_0xed1d('0x13')];this[_0xed1d('0x14')]={};ami['on'](_0xed1d('0x15'),this[_0xed1d('0x16')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x18'),this[_0xed1d('0x19')][_0xed1d('0x17')](this));ami['on']('queuecallerjoin',this[_0xed1d('0x1a')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x1b'),this[_0xed1d('0x1c')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x1d'),this['syncQueueCallerLeave'][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x1e'),this[_0xed1d('0x1f')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x20'),this[_0xed1d('0x21')]['bind'](this));ami['on'](_0xed1d('0x22'),this[_0xed1d('0x23')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x24'),this[_0xed1d('0x25')]['bind'](this));ami['on'](_0xed1d('0x26'),this[_0xed1d('0x27')][_0xed1d('0x17')](this));ami['on']('musiconholdstart',this[_0xed1d('0x28')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x29'),this[_0xed1d('0x2a')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x2b'),this[_0xed1d('0x2c')][_0xed1d('0x17')](this));ami['on'](_0xed1d('0x2d'),this[_0xed1d('0x2e')][_0xed1d('0x17')](this));this['loopQueueSummary']();this['loopQueueShow']();}function isNotNull(_0x40e6f0){return _0x40e6f0!==null&&!_['isUndefined'](_0x40e6f0);}function clearChannels(_0x5afa6a){if(!_[_0xed1d('0x2f')](_0x5afa6a)){for(var _0x3333e0 in _0x5afa6a){if(_0x5afa6a[_0xed1d('0x30')](_0x3333e0)){delete _0x5afa6a[_0x3333e0];}}}}function clearCampaigns(_0xf1abf8){if(!_[_0xed1d('0x2f')](_0xf1abf8)){for(var _0x2c3931 in _0xf1abf8){if(_0xf1abf8[_0xed1d('0x30')](_0x2c3931)){_0xf1abf8[_0x2c3931][_0xed1d('0x31')]=0x0;}}}}function clearVoiceQueues(_0x3687b8){if(!_[_0xed1d('0x2f')](_0x3687b8)){for(var _0x3f3342 in _0x3687b8){if(_0x3687b8['hasOwnProperty'](_0x3f3342)){_0x3687b8[_0x3f3342]['originated']=0x0;_0x3687b8[_0x3f3342][_0xed1d('0x32')]=0x0;_0x3687b8[_0x3f3342][_0xed1d('0x33')]=0x0;_0x3687b8[_0x3f3342][_0xed1d('0x34')]=0x0;_0x3687b8[_0x3f3342][_0xed1d('0x35')]=!![];}}}}function clearAgentBooked(_0x18ada1){if(!_['isEmpty'](_0x18ada1)){for(var _0x52e213 in _0x18ada1){if(_0x18ada1[_0xed1d('0x30')](_0x52e213)){_0x18ada1[_0x52e213][_0xed1d('0x36')]=!![];}}}}VoiceQueueReport[_0xed1d('0xb')]['clearZombieChannels']=function(){var _0x56d636=this;for(var _0x1ee72a in this['channels']){if(this[_0xed1d('0x37')][_0xed1d('0x30')](_0x1ee72a)&&!this['channels'][_0x1ee72a][_0xed1d('0x38')]){this['sequence']['enqueue'](function(){if(!_[_0xed1d('0x39')](_0x56d636[_0xed1d('0x37')][_0x1ee72a])){return ami[_0xed1d('0x3a')]({'action':_0xed1d('0x3b'),'channel':_0x56d636[_0xed1d('0x37')][_0x1ee72a]['channel']})[_0xed1d('0x3c')](function(_0x149a01){if(_0x149a01[_0xed1d('0x3d')]===_0xed1d('0x3e')){setTimeout(function(){if(_0x56d636['channels'][_0x1ee72a]){delete _0x56d636[_0xed1d('0x37')][_0x1ee72a];logger[_0xed1d('0x3f')](_0xed1d('0x40'),_0x1ee72a);}if(_0x56d636['queueReports'][_0x1ee72a]){delete _0x56d636[_0xed1d('0x41')][_0x1ee72a];logger[_0xed1d('0x3f')](_0xed1d('0x42'),_0x1ee72a);}if(_0x56d636[_0xed1d('0x14')][_0x1ee72a]){delete _0x56d636[_0xed1d('0x14')][_0x1ee72a];logger['error'](_0xed1d('0x43'),_0x1ee72a);}},0x1f40);}});}});}}};VoiceQueueReport[_0xed1d('0xb')]['syncFullyBooted']=function(){logger[_0xed1d('0x3f')](_0xed1d('0x44'));clearChannels(this['channels']);this['clearQueueReport'](this[_0xed1d('0x41')]);clearAgentBooked(this[_0xed1d('0xf')]);clearVoiceQueues(this[_0xed1d('0x11')]);clearCampaigns(this[_0xed1d('0x13')]);};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x45')]=function(_0x457093){var _0x198c93=this;if(!_[_0xed1d('0x2f')](_0x457093)){for(var _0x3fe5e6 in _0x457093){if(_0x457093[_0xed1d('0x30')](_0x3fe5e6)){_0x198c93[_0xed1d('0x46')](_0x457093[_0x3fe5e6]);delete _0x457093[_0x3fe5e6];}}}};function loggerCatch(_0x1162ff){return function(_0x8aaaaf){logger[_0xed1d('0x3f')](_0x1162ff,util[_0xed1d('0x47')](_0x8aaaaf,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0xed1d('0x48')]=function(_0x4b26b7,_0x3feba7,_0x2cd4d3){io['to'](_0x4b26b7)['emit'](_0x3feba7,_0x2cd4d3);};VoiceQueueReport['prototype'][_0xed1d('0x49')]=function(_0x1186dd){this['emit'](util[_0xed1d('0x4a')]('voice:queue:%s',_0x1186dd['name']),_0xed1d('0x4b'),_0x1186dd);};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x46')]=function(_0x1096d3){logger[_0xed1d('0x4c')](_0xed1d('0x4d'),JSON['stringify'](_0x1096d3));this['emit'](util['format'](_0xed1d('0x4e'),_0x1096d3[_0xed1d('0x4f')]),'voice_queue_channel:remove',_0x1096d3);};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x50')]=function(_0x4e1a2d){if(_0x4e1a2d[_0xed1d('0x51')]===_0xed1d('0x52')){var _0x144956={'id':_0x4e1a2d['id'],'name':_0x4e1a2d['name'],'strategy':_0x4e1a2d[_0xed1d('0x53')],'answered':_0x4e1a2d[_0xed1d('0x54')],'available':_0x4e1a2d[_0xed1d('0x55')],'loggedIn':_0x4e1a2d['loggedIn'],'pTalking':_0x4e1a2d[_0xed1d('0x33')],'sumBillable':_0x4e1a2d['sumBillable'],'sumDuration':_0x4e1a2d[_0xed1d('0x56')],'sumHoldTime':_0x4e1a2d['sumHoldTime']||0x0,'talking':_0x4e1a2d[_0xed1d('0x32')],'total':_0x4e1a2d[_0xed1d('0x57')],'type':_0x4e1a2d[_0xed1d('0x51')],'unmanaged':_0x4e1a2d[_0xed1d('0x58')],'abandoned':_0x4e1a2d['abandoned'],'waiting':_0x4e1a2d[_0xed1d('0x34')]};if(_0x4e1a2d['Trunk']){_0x144956['Trunk']={'id':_0x4e1a2d[_0xed1d('0x59')]['id'],'name':_0x4e1a2d['Trunk'][_0xed1d('0x4f')],'active':_0x4e1a2d['Trunk'][_0xed1d('0x5a')],'callerid':_0x4e1a2d['Trunk'][_0xed1d('0x5b')]};}if(_0x4e1a2d[_0xed1d('0x5c')]){_0x144956[_0xed1d('0x5c')]={'id':_0x4e1a2d[_0xed1d('0x5c')]['id'],'name':_0x4e1a2d[_0xed1d('0x5c')][_0xed1d('0x4f')]};}var _0x227a7e=md5(JSON[_0xed1d('0x5d')](_0x144956));if(_0x4e1a2d[_0xed1d('0x4')]!==_0x227a7e){_0x4e1a2d[_0xed1d('0x4')]=_0x227a7e;this[_0xed1d('0x48')](util[_0xed1d('0x4a')](_0xed1d('0x4e'),_0x144956[_0xed1d('0x4f')]),_0xed1d('0x5e'),_0x144956);}}};VoiceQueueReport[_0xed1d('0xb')]['isNotNull']=function(_0x2981e4){return _0x2981e4!==null&&!_[_0xed1d('0x5f')](_0x2981e4);};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x60')]=function(){var _0x5a0bf3=this;setInterval(function(){_0x5a0bf3[_0xed1d('0x61')]();ami[_0xed1d('0x3a')]({'action':_0xed1d('0x62')})['catch'](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport['prototype'][_0xed1d('0x63')]=function(){var _0xe18fac=this;setInterval(function(){if(_0xe18fac[_0xed1d('0x12')]){return ami[_0xed1d('0x3a')]({'action':'queuesummary'})[_0xed1d('0x64')](function(_0x4d8cfa){_0xe18fac[_0xed1d('0x12')]=![];})[_0xed1d('0x3c')](loggerCatch(_0xed1d('0x65')));}},0x3e8);};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x16')]=function(_0x1bf2ea){try{if(this[_0xed1d('0x66')](_0x1bf2ea)&&this['isNotNull'](_0x1bf2ea[_0xed1d('0x67')])){if(this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]]){var _0x194031=_[_0xed1d('0x68')](this[_0xed1d('0x37')],_0xed1d('0x67'))[_0x1bf2ea['queue']]||0x0;var _0x34a141=_0x194031-_0x1bf2ea[_0xed1d('0x69')];if(this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x34')]!==_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x69')])||this['voiceQueues'][_0x1bf2ea[_0xed1d('0x67')]]['loggedIn']!==_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x6b')])||this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x55')]!==_[_0xed1d('0x6a')](_0x1bf2ea['available'])||this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x32')]!==_0x34a141){this[_0xed1d('0x11')][_0x1bf2ea['queue']]['waiting']=_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x69')]);this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]]['loggedIn']=_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x6b')]);this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x55')]=_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x55')]);this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x32')]=_0x34a141>0x0?_0x34a141:0x0;this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x32')]=this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]][_0xed1d('0x32')]>_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x6b')])?_[_0xed1d('0x6a')](_0x1bf2ea[_0xed1d('0x6b')]):this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]]['talking'];this[_0xed1d('0x50')](this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]]);}ami[_0xed1d('0x48')](_0xed1d('0x6c'),this[_0xed1d('0x11')][_0x1bf2ea[_0xed1d('0x67')]]);}}}catch(_0x2c9fad){logger[_0xed1d('0x3f')]('[syncQueueSummary][VoiceQueueReport]',util[_0xed1d('0x47')](_0x2c9fad,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x44a0e0){this[_0xed1d('0x12')]=!![];};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x6d')]=function(_0x9aa8db){};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x1a')]=function(_0x2e0a14){try{if(this[_0xed1d('0x66')](_0x2e0a14)){if(_['isUndefined'](this[_0xed1d('0x41')][_0x2e0a14[_0xed1d('0x6e')]])){this['queueReports'][_0x2e0a14[_0xed1d('0x6e')]]=[];this[_0xed1d('0x37')][_0x2e0a14['uniqueid']]={};}var _0x261830=new QueueReport();_0x261830[_0xed1d('0x4f')]=_0x2e0a14[_0xed1d('0x67')];_0x261830['type']=this['voiceQueues'][_0x261830['name']]&&this[_0xed1d('0x11')][_0x261830[_0xed1d('0x4f')]][_0xed1d('0x51')]?this['voiceQueues'][_0x261830[_0xed1d('0x4f')]][_0xed1d('0x51')]||_0xed1d('0x52'):_0xed1d('0x52');_0x261830['queue']=_0x2e0a14[_0xed1d('0x67')];_0x261830[_0xed1d('0x6f')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));_0x261830['position']=_0x2e0a14[_0xed1d('0x71')];_0x261830[_0xed1d('0x72')]=_0x2e0a14[_0xed1d('0x72')];_[_0xed1d('0x73')](_0x261830,_[_0xed1d('0x74')](_0x2e0a14,_[_0xed1d('0x75')](_0x261830)));this[_0xed1d('0x41')][_0x2e0a14['uniqueid']][_0xed1d('0x76')](_0x261830);this[_0xed1d('0x37')][_0x2e0a14[_0xed1d('0x6e')]]=_0x261830;this[_0xed1d('0x49')](_0x261830);}}catch(_0x1bb3a8){logger[_0xed1d('0x3f')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xed1d('0x47')](_0x1bb3a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xed1d('0xb')]['syncQueueCallerAbandon']=function(_0x1f44b0){try{if(this[_0xed1d('0x66')](_0x1f44b0)){if(this['queueReports'][_0x1f44b0['uniqueid']]){var _0x263f50=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x1f44b0[_0xed1d('0x6e')]]);_0x263f50[_0xed1d('0x78')]=![];_0x263f50[_0xed1d('0x79')]=null;_0x263f50[_0xed1d('0x7a')]=_0x1f44b0[_0xed1d('0x7a')];_0x263f50[_0xed1d('0x7b')]=_0x1f44b0['originalposition'];_0x263f50['queuecallerabandon']=!![];_0x263f50[_0xed1d('0x7c')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));_0x263f50[_0xed1d('0x7d')]=_0xed1d('0x7e');_0x263f50[_0xed1d('0x7f')]=null;this[_0xed1d('0x37')][_0x1f44b0[_0xed1d('0x6e')]]=_0x263f50;this[_0xed1d('0x46')](_0x263f50);}}}catch(_0x584a9b){logger[_0xed1d('0x3f')](_0xed1d('0x80'),util[_0xed1d('0x47')](_0x584a9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x46d921){try{if(this[_0xed1d('0x66')](_0x46d921)){if(this[_0xed1d('0x41')][_0x46d921['uniqueid']]){var _0x4c6a05=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x46d921['uniqueid']]);_0x4c6a05[_0xed1d('0x81')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));_0x4c6a05[_0xed1d('0x82')]=_0x46d921[_0xed1d('0x82')];_0x4c6a05['connectedlinename']=_0x46d921[_0xed1d('0x83')];this[_0xed1d('0x37')][_0x46d921[_0xed1d('0x6e')]]=_0x4c6a05;this['emitVoiceQueueChannelSave'](_0x4c6a05);}}}catch(_0x729fa6){logger[_0xed1d('0x3f')](_0xed1d('0x84'),util['inspect'](_0x729fa6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x21')]=function(_0x59b351){try{if(this[_0xed1d('0x66')](_0x59b351)){if(this['queueReports'][_0x59b351[_0xed1d('0x6e')]]){var _0x262148=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x59b351['uniqueid']]);_0x262148[_0xed1d('0x78')]=!![];_0x262148['queuecallerexitreason']=_0xed1d('0x85');}}}catch(_0x29fc59){logger[_0xed1d('0x3f')](_0xed1d('0x86'),util[_0xed1d('0x47')](_0x29fc59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x1f')]=function(_0x555424){try{if(this['isNotNull'](_0x555424)){if(this[_0xed1d('0x41')][_0x555424['uniqueid']]){var _0x2e5401=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x555424['uniqueid']]);_0x2e5401[_0xed1d('0x1b')]=![];_0x2e5401['queuecallerabandonAt']=null;_0x2e5401[_0xed1d('0x87')]=!![];_0x2e5401['lastAssignedTo']=_0x555424[_0xed1d('0x88')];_0x2e5401['holdtime']=_0x555424['holdtime'];_0x2e5401['queuecallercomplete']=!![];_0x2e5401[_0xed1d('0x89')]=![];_0x2e5401[_0xed1d('0x8a')]=null;if(!_0x2e5401[_0xed1d('0x8b')]){if(_0x555424[_0xed1d('0x8c')]==_0xed1d('0x8b')){_0x2e5401[_0xed1d('0x7d')]='COMPLETED';}else{if(_[_0xed1d('0x8d')](_0x555424[_0xed1d('0x8e')][_0xed1d('0x8f')](),_0xed1d('0x90'))){if(this[_0xed1d('0x41')][_0x555424['linkedid']]){var _0x52629d=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x555424[_0xed1d('0x91')]]);_0x52629d[_0xed1d('0x78')]=![];_0x52629d[_0xed1d('0x89')]=!![];_0x52629d[_0xed1d('0x8a')]=moment(_0x2e5401['queuecallerjoinAt'])[_0xed1d('0x92')](_0x555424[_0xed1d('0x7a')],_0xed1d('0x93'))[_0xed1d('0x4a')](_0xed1d('0x70'));_0x52629d[_0xed1d('0x7d')]=_0xed1d('0x94');_0x52629d['transfer']=!![];_0x52629d['transfertype']=_0xed1d('0x95');_0x52629d[_0xed1d('0x96')]=_0x555424[_0xed1d('0x97')];_0x52629d[_0xed1d('0x98')]=_0x555424['uniqueid'];var _0x1d977f=this[_0xed1d('0x41')][_0x555424['linkedid']];this['queueReports'][_0x555424[_0xed1d('0x91')]]=this[_0xed1d('0x41')][_0x555424[_0xed1d('0x6e')]];this['queueReports'][_0x555424[_0xed1d('0x6e')]]=_0x1d977f;}}else{_0x2e5401[_0xed1d('0x7d')]=_0xed1d('0x99')+_0x555424[_0xed1d('0x8c')][_0xed1d('0x9a')]();}}}this[_0xed1d('0x37')][_0x555424[_0xed1d('0x6e')]]=_0x2e5401;this[_0xed1d('0x46')](_0x2e5401);}}}catch(_0x5f13bf){logger[_0xed1d('0x3f')](_0xed1d('0x9b'),util[_0xed1d('0x47')](_0x5f13bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x23')]=function(_0x26f2b9){try{if(this['isNotNull'](_0x26f2b9)){this['addVariable'](_0x26f2b9['uniqueid'],_[_0xed1d('0x75')](_0x26f2b9[_0xed1d('0x9c')])[0x0],_0x26f2b9[_0xed1d('0x9d')]);if(this[_0xed1d('0x41')][_0x26f2b9[_0xed1d('0x6e')]]){var _0x40da85=_[_0xed1d('0x77')](this[_0xed1d('0x41')][_0x26f2b9[_0xed1d('0x6e')]]);if(_0x40da85){if(this[_0xed1d('0x66')](_0x26f2b9[_0xed1d('0x9c')])&&this['isNotNull'](_0x26f2b9[_0xed1d('0x9c')][_0xed1d('0x9e')])){switch(_0x26f2b9[_0xed1d('0x9d')]){case _0xed1d('0x9f'):_0x40da85[_0xed1d('0x89')]=![];_0x40da85[_0xed1d('0x8a')]=null;break;case'TIMEOUT':_0x40da85[_0xed1d('0xa0')]=_0xed1d('0xa1');ami['emit'](_0xed1d('0xa2'),_0x40da85);break;default:_0x40da85[_0xed1d('0x89')]=!![];_0x40da85[_0xed1d('0x8a')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));_0x40da85[_0xed1d('0x81')]=moment()['format'](_0xed1d('0x70'));}_0x40da85[_0xed1d('0x1b')]=![];_0x40da85['queuecallerabandonAt']=null;_0x40da85['queuecallerexitreason']=_0x26f2b9[_0xed1d('0x9d')];this[_0xed1d('0x37')][_0x26f2b9[_0xed1d('0x6e')]]=_0x40da85;this[_0xed1d('0x46')](_0x40da85);}else if(this['isNotNull'](_0x26f2b9[_0xed1d('0x9c')])&&this['isNotNull'](_0x26f2b9[_0xed1d('0x9c')]['queueposition'])){if(!_0x40da85[_0xed1d('0x1b')]){_0x40da85[_0xed1d('0x89')]=!![];_0x40da85[_0xed1d('0x8a')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));_0x40da85[_0xed1d('0x7d')]=_0xed1d('0xa3');_0x40da85[_0xed1d('0x81')]=moment()[_0xed1d('0x4a')](_0xed1d('0x70'));this[_0xed1d('0x37')][_0x26f2b9[_0xed1d('0x6e')]]=_0x40da85;}}_0x40da85[_0xed1d('0x14')]=this[_0xed1d('0x14')][_0x26f2b9[_0xed1d('0x6e')]];}}}}catch(_0x206b90){logger[_0xed1d('0x3f')]('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x206b90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xed1d('0xb')]['addVariable']=function(_0x4437db,_0x265c02,_0x2350f0){var _0x314b5b=[_0xed1d('0xa4'),_0xed1d('0xa5'),_0xed1d('0xa6'),_0xed1d('0xa7'),'rtpaudioqosloss',_0xed1d('0xa8'),_0xed1d('0xa9'),_0xed1d('0xaa'),_0xed1d('0xab'),'sipuri','bridgepeer',_0xed1d('0xac'),_0xed1d('0xad'),'memberdynamic',_0xed1d('0xae'),_0xed1d('0xaf'),'membername',_0xed1d('0xb0'),_0xed1d('0xb1')];if(!_[_0xed1d('0x39')](_0x265c02)&&!_[_0xed1d('0xb2')](_0x314b5b,_0x265c02)){if(_[_0xed1d('0x5f')](this[_0xed1d('0x14')][_0x4437db])){this['variables'][_0x4437db]={};}this['variables'][_0x4437db][_0x265c02]=_0x2350f0;}};VoiceQueueReport[_0xed1d('0xb')][_0xed1d('0x25')]=function(_0x122ecf){try{if(this[_0xed1d('0x66')](_0x122ecf)){if(this['queueReports'][_0x122ecf[_0xed1d('0x6e')]]){for(var _0x4b5f7d=0x0,_0x49120e={};_0x4b5f7d0x0?_0x580072:0x0;this[_0x61da('0x13')][_0x31a1c3[_0x61da('0x63')]][_0x61da('0x56')]=this['voiceQueues'][_0x31a1c3['queue']]['talking']>_[_0x61da('0x64')](_0x31a1c3['loggedin'])?_[_0x61da('0x64')](_0x31a1c3[_0x61da('0x65')]):this[_0x61da('0x13')][_0x31a1c3[_0x61da('0x63')]]['talking'];this[_0x61da('0x67')](this['voiceQueues'][_0x31a1c3[_0x61da('0x63')]]);}ami[_0x61da('0x48')](_0x61da('0x68'),this[_0x61da('0x13')][_0x31a1c3[_0x61da('0x63')]]);}}}catch(_0x2bf9a3){logger[_0x61da('0x3f')](_0x61da('0x69'),util[_0x61da('0x47')](_0x2bf9a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x19')]=function(_0x325bc4){this[_0x61da('0x14')]=!![];};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x6a')]=function(_0x5b580b){};VoiceQueueReport[_0x61da('0xc')]['syncQueueCallerJoin']=function(_0x54674f){try{if(this['isNotNull'](_0x54674f)){if(_[_0x61da('0x31')](this['queueReports'][_0x54674f['uniqueid']])){this['queueReports'][_0x54674f[_0x61da('0x6b')]]=[];this[_0x61da('0x39')][_0x54674f[_0x61da('0x6b')]]={};}var _0x459355=new QueueReport();_0x459355['name']=_0x54674f[_0x61da('0x63')];_0x459355[_0x61da('0x50')]=this[_0x61da('0x13')][_0x459355[_0x61da('0x52')]]&&this[_0x61da('0x13')][_0x459355[_0x61da('0x52')]][_0x61da('0x50')]?this[_0x61da('0x13')][_0x459355['name']][_0x61da('0x50')]||_0x61da('0x51'):_0x61da('0x51');_0x459355[_0x61da('0x63')]=_0x54674f['queue'];_0x459355['queuecallerjoinAt']=moment()[_0x61da('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x459355[_0x61da('0x6c')]=_0x54674f[_0x61da('0x6c')];_0x459355[_0x61da('0x6d')]=_0x54674f[_0x61da('0x6d')];_[_0x61da('0x6e')](_0x459355,_[_0x61da('0x6f')](_0x54674f,_[_0x61da('0x70')](_0x459355)));this[_0x61da('0x41')][_0x54674f[_0x61da('0x6b')]][_0x61da('0x71')](_0x459355);this['channels'][_0x54674f[_0x61da('0x6b')]]=_0x459355;this[_0x61da('0x49')](_0x459355);}}catch(_0x42be71){logger[_0x61da('0x3f')](_0x61da('0x72'),util[_0x61da('0x47')](_0x42be71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x73')]=function(_0x47d70d){try{if(this['isNotNull'](_0x47d70d)){if(this[_0x61da('0x41')][_0x47d70d[_0x61da('0x6b')]]){var _0x35a509=_['last'](this[_0x61da('0x41')][_0x47d70d[_0x61da('0x6b')]]);_0x35a509[_0x61da('0x74')]=![];_0x35a509['queuecallercompleteAt']=null;_0x35a509[_0x61da('0x75')]=_0x47d70d['holdtime'];_0x35a509[_0x61da('0x76')]=_0x47d70d[_0x61da('0x76')];_0x35a509[_0x61da('0x1d')]=!![];_0x35a509[_0x61da('0x77')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x35a509[_0x61da('0x78')]=_0x61da('0x79');_0x35a509[_0x61da('0x7a')]=null;this[_0x61da('0x39')][_0x47d70d['uniqueid']]=_0x35a509;this[_0x61da('0x7b')](_0x35a509);}}}catch(_0x5c0fe5){logger[_0x61da('0x3f')](_0x61da('0x7c'),util[_0x61da('0x47')](_0x5c0fe5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x1f')]=function(_0x3d839e){try{if(this[_0x61da('0x5e')](_0x3d839e)){if(this[_0x61da('0x41')][_0x3d839e[_0x61da('0x6b')]]){var _0x394156=_[_0x61da('0x7d')](this['queueReports'][_0x3d839e[_0x61da('0x6b')]]);_0x394156[_0x61da('0x7e')]=moment()[_0x61da('0x4a')](_0x61da('0x7f'));_0x394156[_0x61da('0x80')]=_0x3d839e[_0x61da('0x80')];_0x394156[_0x61da('0x81')]=_0x3d839e[_0x61da('0x81')];this['channels'][_0x3d839e[_0x61da('0x6b')]]=_0x394156;this[_0x61da('0x49')](_0x394156);}}}catch(_0x4e76dc){logger[_0x61da('0x3f')](_0x61da('0x82'),util[_0x61da('0x47')](_0x4e76dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x21')]=function(_0x31a237){try{if(this[_0x61da('0x5e')](_0x31a237)){if(this[_0x61da('0x41')][_0x31a237[_0x61da('0x6b')]]){var _0x1f6622=_['last'](this['queueReports'][_0x31a237[_0x61da('0x6b')]]);_0x1f6622[_0x61da('0x74')]=!![];_0x1f6622[_0x61da('0x78')]='COMPLETEDBYAGENT';}}}catch(_0x5e85b5){logger[_0x61da('0x3f')]('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x5e85b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x20')]=function(_0x1e78d2){try{if(this[_0x61da('0x5e')](_0x1e78d2)){if(this['queueReports'][_0x1e78d2[_0x61da('0x6b')]]){var _0x35ed2f=_['last'](this['queueReports'][_0x1e78d2[_0x61da('0x6b')]]);_0x35ed2f[_0x61da('0x1d')]=![];_0x35ed2f['queuecallerabandonAt']=null;_0x35ed2f[_0x61da('0x83')]=!![];_0x35ed2f[_0x61da('0x7a')]=_0x1e78d2['membername'];_0x35ed2f['holdtime']=_0x1e78d2[_0x61da('0x75')];_0x35ed2f[_0x61da('0x74')]=!![];_0x35ed2f['queuecallerexit']=![];_0x35ed2f[_0x61da('0x84')]=null;if(!_0x35ed2f[_0x61da('0x85')]){if(_0x1e78d2[_0x61da('0x86')]==_0x61da('0x85')){_0x35ed2f[_0x61da('0x78')]=_0x61da('0x87');}else{if(_['startsWith'](_0x1e78d2[_0x61da('0x3c')][_0x61da('0x88')](),_0x61da('0x89'))){if(this[_0x61da('0x41')][_0x1e78d2['linkedid']]){var _0x47824f=_['last'](this[_0x61da('0x41')][_0x1e78d2[_0x61da('0x8a')]]);_0x47824f['queuecallercomplete']=![];_0x47824f[_0x61da('0x8b')]=!![];_0x47824f[_0x61da('0x84')]=moment(_0x35ed2f[_0x61da('0x8c')])[_0x61da('0x8d')](_0x1e78d2[_0x61da('0x75')],_0x61da('0x8e'))[_0x61da('0x4a')](_0x61da('0x7f'));_0x47824f['queuecallerexitreason']=_0x61da('0x8f');_0x47824f[_0x61da('0x85')]=!![];_0x47824f['transfertype']=_0x61da('0x90');_0x47824f[_0x61da('0x91')]=_0x1e78d2[_0x61da('0x92')];_0x47824f['transferuniqueid']=_0x1e78d2[_0x61da('0x6b')];var _0x412974=this[_0x61da('0x41')][_0x1e78d2[_0x61da('0x8a')]];this[_0x61da('0x41')][_0x1e78d2[_0x61da('0x8a')]]=this[_0x61da('0x41')][_0x1e78d2[_0x61da('0x6b')]];this[_0x61da('0x41')][_0x1e78d2['uniqueid']]=_0x412974;}}else{_0x35ed2f[_0x61da('0x78')]=_0x61da('0x93')+_0x1e78d2['reason'][_0x61da('0x94')]();}}}this[_0x61da('0x39')][_0x1e78d2[_0x61da('0x6b')]]=_0x35ed2f;this[_0x61da('0x7b')](_0x35ed2f);}}}catch(_0x403565){logger['error'](_0x61da('0x95'),util[_0x61da('0x47')](_0x403565,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x61da('0x23')]=function(_0x5539bb){try{if(this[_0x61da('0x5e')](_0x5539bb)){this[_0x61da('0x96')](_0x5539bb['uniqueid'],_[_0x61da('0x70')](_0x5539bb[_0x61da('0x97')])[0x0],_0x5539bb[_0x61da('0x98')]);if(this[_0x61da('0x41')][_0x5539bb['uniqueid']]){var _0x555f84=_[_0x61da('0x7d')](this[_0x61da('0x41')][_0x5539bb[_0x61da('0x6b')]]);if(_0x555f84){if(this[_0x61da('0x5e')](_0x5539bb[_0x61da('0x97')])&&this[_0x61da('0x5e')](_0x5539bb[_0x61da('0x97')][_0x61da('0x99')])){switch(_0x5539bb[_0x61da('0x98')]){case'CONTINUE':_0x555f84['queuecallerexit']=![];_0x555f84[_0x61da('0x84')]=null;break;case _0x61da('0x9a'):_0x555f84[_0x61da('0x9b')]=_0x61da('0x9c');ami[_0x61da('0x48')](_0x61da('0x9d'),_0x555f84);break;default:_0x555f84[_0x61da('0x8b')]=!![];_0x555f84[_0x61da('0x84')]=moment()[_0x61da('0x4a')](_0x61da('0x7f'));_0x555f84[_0x61da('0x7e')]=moment()[_0x61da('0x4a')](_0x61da('0x7f'));}_0x555f84[_0x61da('0x1d')]=![];_0x555f84[_0x61da('0x77')]=null;_0x555f84['queuecallerexitreason']=_0x5539bb[_0x61da('0x98')];this[_0x61da('0x39')][_0x5539bb[_0x61da('0x6b')]]=_0x555f84;this[_0x61da('0x7b')](_0x555f84);}else if(this[_0x61da('0x5e')](_0x5539bb[_0x61da('0x97')])&&this[_0x61da('0x5e')](_0x5539bb[_0x61da('0x97')][_0x61da('0x9e')])){if(!_0x555f84['queuecallerabandon']){_0x555f84['queuecallerexit']=!![];_0x555f84['queuecallerexitAt']=moment()[_0x61da('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x555f84['queuecallerexitreason']=_0x61da('0x9f');_0x555f84[_0x61da('0x7e')]=moment()['format'](_0x61da('0x7f'));this[_0x61da('0x39')][_0x5539bb[_0x61da('0x6b')]]=_0x555f84;}}_0x555f84[_0x61da('0x43')]=this['variables'][_0x5539bb['uniqueid']];}}}}catch(_0x172a59){logger[_0x61da('0x3f')](_0x61da('0xa0'),util[_0x61da('0x47')](_0x172a59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x96')]=function(_0x43ddf6,_0x246c1d,_0x84e4a8){var _0x1c44be=[_0x61da('0xa1'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x61da('0xa2'),_0x61da('0xa3'),_0x61da('0xa4'),_0x61da('0xa5'),_0x61da('0xa6'),'sipcallid',_0x61da('0xa7'),_0x61da('0xa8'),_0x61da('0xa9'),'membercalls',_0x61da('0xaa'),_0x61da('0xab'),_0x61da('0xac'),_0x61da('0xad'),_0x61da('0xae'),_0x61da('0xaf')];if(!_['isNil'](_0x246c1d)&&!_[_0x61da('0xb0')](_0x1c44be,_0x246c1d)){if(_['isUndefined'](this['variables'][_0x43ddf6])){this[_0x61da('0x43')][_0x43ddf6]={};}this[_0x61da('0x43')][_0x43ddf6][_0x246c1d]=_0x84e4a8;}};VoiceQueueReport[_0x61da('0xc')][_0x61da('0x25')]=function(_0x10cb3d){try{if(this[_0x61da('0x5e')](_0x10cb3d)){if(this[_0x61da('0x41')][_0x10cb3d['uniqueid']]){for(var _0xe081=0x0,_0x2283bf={};_0xe081=0x0?moment(_0x5559d2[_0xbcaf('0x19')])[_0xbcaf('0xf')](_0x5559d2['starttime'],'seconds'):null,'data1':_0xbcaf('0x1a'),'data2':_0x5559d2[_0xbcaf('0x15')],'data3':_0x5559d2[_0xbcaf('0x1b')],'data4':_0x5559d2[_0xbcaf('0x1c')]||null,'role':_0xbcaf('0x13'),'internal':_0x5559d2[_0xbcaf('0x15')]?_['toNumber'](_0x5559d2['accountcode']):undefined,'uniqueid':_0x5559d2[_0xbcaf('0x16')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x383e=['toNumber','uniqueid','voiceDialReport','voice','membername','TALKING','starttime','endtime','seconds','exten','dialstring','agent','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','isNil','lastAssignedTo','interface','queuecallerleaveAt','diff','inbound','calleridnum','queue','accountcode'];(function(_0x22dae3,_0x5d9029){var _0x289728=function(_0x2c4060){while(--_0x2c4060){_0x22dae3['push'](_0x22dae3['shift']());}};_0x289728(++_0x5d9029);}(_0x383e,0x140));var _0xe383=function(_0x367751,_0x238bb3){_0x367751=_0x367751-0x0;var _0x221124=_0x383e[_0x367751];return _0x221124;};'use strict';var moment=require('moment');var _=require(_0xe383('0x0'));var util=require(_0xe383('0x1'));var client=require(_0xe383('0x2'));exports['voiceQueueReport']=function(_0x17a9f8){var _0x12634f=_0x17a9f8[_0xe383('0x3')]||_0x17a9f8[_0xe383('0x4')];return client[_0xe383('0x5')](_0xe383('0x6'),{'body':{'channel':'voice','membername':_0x17a9f8['lastAssignedTo'],'interface':_[_0xe383('0x7')](_0x17a9f8['interface'])?util['format']('SIP/%s',_0x17a9f8[_0xe383('0x8')]):_0x17a9f8[_0xe383('0x9')],'type':'TALKING','enterAt':_0x17a9f8[_0xe383('0xa')],'exitAt':_0x12634f,'duration':moment(_0x12634f)[_0xe383('0xb')](_0x17a9f8['queuecallerleaveAt'],'seconds'),'data1':_0xe383('0xc'),'data2':_0x17a9f8[_0xe383('0xd')],'data3':_0x17a9f8['exten'],'data4':null,'data5':_0x17a9f8[_0xe383('0xe')],'role':'agent','internal':_0x17a9f8[_0xe383('0xf')]?_[_0xe383('0x10')](_0x17a9f8['accountcode']):undefined,'uniqueid':_0x17a9f8[_0xe383('0x11')]},'log':_0xe383('0x6')});};exports[_0xe383('0x12')]=function(_0x56704f){return client[_0xe383('0x5')]('CreateMemberReport',{'body':{'channel':_0xe383('0x13'),'membername':_0x56704f[_0xe383('0x14')],'interface':_0x56704f[_0xe383('0x9')],'type':_0xe383('0x15'),'enterAt':_0x56704f[_0xe383('0x16')],'exitAt':_0x56704f[_0xe383('0x17')],'duration':moment(_0x56704f[_0xe383('0x17')])['diff'](_0x56704f[_0xe383('0x16')],'seconds')>=0x0?moment(_0x56704f['endtime'])[_0xe383('0xb')](_0x56704f[_0xe383('0x16')],_0xe383('0x18')):null,'data1':'outbound','data2':_0x56704f[_0xe383('0xf')],'data3':_0x56704f[_0xe383('0x19')],'data4':_0x56704f[_0xe383('0x1a')]||null,'role':_0xe383('0x1b'),'internal':_0x56704f[_0xe383('0xf')]?_['toNumber'](_0x56704f[_0xe383('0xf')]):undefined,'uniqueid':_0x56704f[_0xe383('0x11')]},'log':_0xe383('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ca8d836..2a2ce83 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 _0xb6b1=['Request','GetTemplate','html','../client'];(function(_0x3508f3,_0x4945f6){var _0x620cb0=function(_0x29e643){while(--_0x29e643){_0x3508f3['push'](_0x3508f3['shift']());}};_0x620cb0(++_0x4945f6);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xb6b1[_0x207811];return _0x170d56;};'use strict';var client=require(_0x1b6b('0x0'));exports['getTemplates']=function(_0x669faa){return function(_0x4fc13d){return client[_0x1b6b('0x1')](_0x1b6b('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x1b6b('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x7d98=['Request','GetTemplate','html','../client'];(function(_0x4b9bcd,_0x1bdc36){var _0xaa4780=function(_0x1dbdce){while(--_0x1dbdce){_0x4b9bcd['push'](_0x4b9bcd['shift']());}};_0xaa4780(++_0x1bdc36);}(_0x7d98,0xe7));var _0x87d9=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7d98[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x87d9('0x0'));exports['getTemplates']=function(_0x450298){return function(_0x11bc33){return client[_0x87d9('0x1')](_0x87d9('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0x87d9('0x3')]},'log':_0x87d9('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9e4a8c6..8cd461e 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 _0xdccd=['data1','data2','data3','data5','data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action'];(function(_0x4550f1,_0xcb817b){var _0x5c57b3=function(_0x108159){while(--_0x108159){_0x4550f1['push'](_0x4550f1['shift']());}};_0x5c57b3(++_0xcb817b);}(_0xdccd,0x12b));var _0xddcc=function(_0x45e1c6,_0x1ef39d){_0x45e1c6=_0x45e1c6-0x0;var _0x5e52ca=_0xdccd[_0x45e1c6];return _0x5e52ca;};'use strict';var client=require(_0xddcc('0x0'));exports[_0xddcc('0x1')]=function(_0x3570cf){return function(_0x54cb2a){return client[_0xddcc('0x2')](_0xddcc('0x3'),{'options':{'raw':![],'attributes':['id',_0xddcc('0x4'),_0xddcc('0x5'),_0xddcc('0x6')],'include':[{'model':_0xddcc('0x7'),'as':_0xddcc('0x8'),'attributes':['id','field',_0xddcc('0x9'),_0xddcc('0xa')]},{'model':_0xddcc('0x7'),'as':_0xddcc('0xb'),'attributes':['id',_0xddcc('0xc'),'operator',_0xddcc('0xa')]},{'model':_0xddcc('0xd'),'as':_0xddcc('0xe'),'attributes':['id',_0xddcc('0xf'),_0xddcc('0x10'),_0xddcc('0x11'),_0xddcc('0x12'),'data4',_0xddcc('0x13'),_0xddcc('0x14'),'data7']}]},'log':_0xddcc('0x3')});};}; \ No newline at end of file +var _0x901c=['Condition','operator','value','AnyConditions','field','Action','Actions','action','data1','data3','data4','data5','data6','data7','GetTrigger','name','channel','status'];(function(_0x37bd46,_0x2cd9de){var _0x560101=function(_0x447878){while(--_0x447878){_0x37bd46['push'](_0x37bd46['shift']());}};_0x560101(++_0x2cd9de);}(_0x901c,0x11c));var _0xc901=function(_0x57d27a,_0xc4e9c4){_0x57d27a=_0x57d27a-0x0;var _0x5d467a=_0x901c[_0x57d27a];return _0x5d467a;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x2bb628){return function(_0x49c51f){return client['Request'](_0xc901('0x0'),{'options':{'raw':![],'attributes':['id',_0xc901('0x1'),_0xc901('0x2'),_0xc901('0x3')],'include':[{'model':_0xc901('0x4'),'as':'AllConditions','attributes':['id','field',_0xc901('0x5'),_0xc901('0x6')]},{'model':'Condition','as':_0xc901('0x7'),'attributes':['id',_0xc901('0x8'),_0xc901('0x5'),'value']},{'model':_0xc901('0x9'),'as':_0xc901('0xa'),'attributes':['id',_0xc901('0xb'),_0xc901('0xc'),'data2',_0xc901('0xd'),_0xc901('0xe'),_0xc901('0xf'),_0xc901('0x10'),_0xc901('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a4e606d..c76ff7c 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 _0xc1a2=['GetTrunk','name','registry','../client','getTrunks'];(function(_0x3f8920,_0x73187b){var _0x2c3682=function(_0x2d5295){while(--_0x2d5295){_0x3f8920['push'](_0x3f8920['shift']());}};_0x2c3682(++_0x73187b);}(_0xc1a2,0x1e3));var _0x2c1a=function(_0x2be788,_0x30582c){_0x2be788=_0x2be788-0x0;var _0x33576a=_0xc1a2[_0x2be788];return _0x33576a;};'use strict';var client=require(_0x2c1a('0x0'));exports[_0x2c1a('0x1')]=function(_0x7aa4bc){return function(_0x161a29){return client['Request'](_0x2c1a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2c1a('0x3'),_0x2c1a('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x3272=['Request','GetTrunk','name','registry','../client','getTrunks'];(function(_0xd0965,_0x1f94fc){var _0x3f5839=function(_0x28492c){while(--_0x28492c){_0xd0965['push'](_0xd0965['shift']());}};_0x3f5839(++_0x1f94fc);}(_0x3272,0x9a));var _0x2327=function(_0x33ecb4,_0x4a554b){_0x33ecb4=_0x33ecb4-0x0;var _0x1699c3=_0x3272[_0x33ecb4];return _0x1699c3;};'use strict';var client=require(_0x2327('0x0'));exports[_0x2327('0x1')]=function(_0x18be35){return function(_0x4b92b7){return client[_0x2327('0x2')](_0x2327('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x2327('0x4'),_0x2327('0x5')]},'log':_0x2327('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 43f9552..4f70318 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 _0x8c31=['../client','getAgents','GetUser','agent','name','email','accountcode','fullname','online','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','savePause','Request','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x8c31,0xdc));var _0x18c3=function(_0xa2d152,_0x5555e6){_0xa2d152=_0xa2d152-0x0;var _0x3e973a=_0x8c31[_0xa2d152];return _0x3e973a;};'use strict';var client=require(_0x18c3('0x0'));exports[_0x18c3('0x1')]=function(){return function(){return client['Request'](_0x18c3('0x2'),{'options':{'raw':![],'where':{'role':_0x18c3('0x3')},'attributes':['id',_0x18c3('0x4'),_0x18c3('0x5'),_0x18c3('0x6'),_0x18c3('0x7'),_0x18c3('0x8'),'lastLoginAt',_0x18c3('0x9'),_0x18c3('0xa'),_0x18c3('0xb'),_0x18c3('0xc'),_0x18c3('0xd'),_0x18c3('0xe')]},'log':_0x18c3('0x1')});};};exports['getTelephones']=function(){return function(){return client['Request'](_0x18c3('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x18c3('0x4'),_0x18c3('0x6'),'internal']},'log':_0x18c3('0xf')});};};exports[_0x18c3('0x10')]=function(_0x4e44b3,_0x2d93be,_0x3bd619){return client[_0x18c3('0x11')]('PauseUser',{'body':{'type':_0x2d93be,'uniqueid':_0x3bd619},'options':{'where':{'id':_0x4e44b3['id']}},'log':_0x18c3('0x10')});};exports[_0x18c3('0x12')]=function(_0x2fd322){return client[_0x18c3('0x11')](_0x18c3('0x13'),{'body':{},'options':{'where':{'id':_0x2fd322['id']}},'log':'savePause'});};exports[_0x18c3('0x14')]=function(_0x5f184a){return client[_0x18c3('0x11')](_0x18c3('0x15'),{'options':{'raw':![],'where':{'role':_0x18c3('0x3'),'id':_0x5f184a},'attributes':['id','name',_0x18c3('0x5'),'accountcode',_0x18c3('0x7'),_0x18c3('0x8'),'lastLoginAt',_0x18c3('0x9'),'lastPauseAt',_0x18c3('0xb'),'interface']},'log':_0x18c3('0x14')});}; \ No newline at end of file +var _0xf7da=['pauseType','lastPauseAt','phone','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','agent','online','lastLoginAt','getAgents','Request','GetUser','name','email','accountcode','fullname'];(function(_0x1d5001,_0x2e6fdb){var _0x42ede1=function(_0x355cdf){while(--_0x355cdf){_0x1d5001['push'](_0x1d5001['shift']());}};_0x42ede1(++_0x2e6fdb);}(_0xf7da,0x169));var _0xaf7d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xf7da[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../client');exports[_0xaf7d('0x0')]=function(){return function(){return client[_0xaf7d('0x1')](_0xaf7d('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xaf7d('0x3'),_0xaf7d('0x4'),_0xaf7d('0x5'),_0xaf7d('0x6'),'online','lastLoginAt',_0xaf7d('0x7'),_0xaf7d('0x8'),'voicePause',_0xaf7d('0x9'),_0xaf7d('0xa'),_0xaf7d('0xb')]},'log':_0xaf7d('0x0')});};};exports[_0xaf7d('0xc')]=function(){return function(){return client[_0xaf7d('0x1')](_0xaf7d('0x2'),{'options':{'raw':!![],'where':{'role':_0xaf7d('0xd')},'attributes':['id',_0xaf7d('0x3'),'accountcode',_0xaf7d('0xe')]},'log':_0xaf7d('0xc')});};};exports[_0xaf7d('0xf')]=function(_0x301bb3,_0x715cd0,_0x3e486f){return client[_0xaf7d('0x1')](_0xaf7d('0x10'),{'body':{'type':_0x715cd0,'uniqueid':_0x3e486f},'options':{'where':{'id':_0x301bb3['id']}},'log':_0xaf7d('0xf')});};exports[_0xaf7d('0x11')]=function(_0x5aa5f8){return client['Request'](_0xaf7d('0x12'),{'body':{},'options':{'where':{'id':_0x5aa5f8['id']}},'log':_0xaf7d('0xf')});};exports[_0xaf7d('0x13')]=function(_0x2c563f){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0xaf7d('0x14'),'id':_0x2c563f},'attributes':['id',_0xaf7d('0x3'),_0xaf7d('0x4'),_0xaf7d('0x5'),_0xaf7d('0x6'),_0xaf7d('0x15'),_0xaf7d('0x16'),_0xaf7d('0x7'),'lastPauseAt','voicePause',_0xaf7d('0xb')]},'log':_0xaf7d('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index e965e13..2fa3a99 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 _0x613c=['update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x5a3e85,_0x1c6294){var _0x1e1021=function(_0x496e11){while(--_0x496e11){_0x5a3e85['push'](_0x5a3e85['shift']());}};_0x1e1021(++_0x1c6294);}(_0x613c,0xd9));var _0xc613=function(_0xb1362b,_0x571fcd){_0xb1362b=_0xb1362b-0x0;var _0x50507b=_0x613c[_0xb1362b];return _0x50507b;};'use strict';var client=require(_0xc613('0x0'));exports[_0xc613('0x1')]=function(_0x51361d){return client[_0xc613('0x2')]('CreateVoiceAgentReport',{'body':_0x51361d,'log':'CreateVoiceAgentReport'});};exports[_0xc613('0x3')]=function(_0x23ca9b,_0x377732,_0x1e33a2){return client['Request'](_0xc613('0x4'),{'body':_0x23ca9b,'options':{'where':{'uniqueid':_0x377732,'interface':_0x1e33a2,'agentcomplete':!![]}},'log':_0xc613('0x4')});}; \ No newline at end of file +var _0x2aaa=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x2140a3,_0x5805f1){var _0x1ab35c=function(_0x5687b7){while(--_0x5687b7){_0x2140a3['push'](_0x2140a3['shift']());}};_0x1ab35c(++_0x5805f1);}(_0x2aaa,0x1d8));var _0xa2aa=function(_0x3acda2,_0x7798e){_0x3acda2=_0x3acda2-0x0;var _0x127156=_0x2aaa[_0x3acda2];return _0x127156;};'use strict';var client=require(_0xa2aa('0x0'));exports['create']=function(_0x2ef98c){return client[_0xa2aa('0x1')](_0xa2aa('0x2'),{'body':_0x2ef98c,'log':'CreateVoiceAgentReport'});};exports[_0xa2aa('0x3')]=function(_0x1ee084,_0x441603,_0x58066a){return client['Request'](_0xa2aa('0x4'),{'body':_0x1ee084,'options':{'where':{'uniqueid':_0x441603,'interface':_0x58066a,'agentcomplete':!![]}},'log':_0xa2aa('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d349570..b30b0fb 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 _0x34b7=['Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','moment','util','lodash','../client'];(function(_0xd9d38e,_0x3c90ef){var _0x376fc0=function(_0x7e9cef){while(--_0x7e9cef){_0xd9d38e['push'](_0xd9d38e['shift']());}};_0x376fc0(++_0x3c90ef);}(_0x34b7,0x16c));var _0x734b=function(_0x146edd,_0x2be255){_0x146edd=_0x146edd-0x0;var _0x46079b=_0x34b7[_0x146edd];return _0x46079b;};'use strict';var moment=require(_0x734b('0x0'));var util=require(_0x734b('0x1'));var _=require(_0x734b('0x2'));var client=require(_0x734b('0x3'));exports['create']=function(_0x397708){return client[_0x734b('0x4')](_0x734b('0x5'),{'body':_[_0x734b('0x6')](_0x397708,{'source':_0x397708[_0x734b('0x7')],'destinationcontext':_0x397708['context'],'callerid':_0x397708['callerid'],'amaflags':_0x734b('0x8')}),'log':_0x734b('0x5')});};exports[_0x734b('0x9')]=function(){return function(){return client['Request'](_0x734b('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x734b('0xb')](_0x734b('0xc'))[_0x734b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x734b('0xc'))[_0x734b('0xd')](_0x734b('0xe'))]}},'attributes':['type',_0x734b('0xf'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x7a69=['format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day'];(function(_0x265ab5,_0x494f68){var _0x4936de=function(_0x3b95ac){while(--_0x3b95ac){_0x265ab5['push'](_0x265ab5['shift']());}};_0x4936de(++_0x494f68);}(_0x7a69,0x141));var _0x97a6=function(_0x5e8e2c,_0x252225){_0x5e8e2c=_0x5e8e2c-0x0;var _0x1e765b=_0x7a69[_0x5e8e2c];return _0x1e765b;};'use strict';var moment=require(_0x97a6('0x0'));var util=require(_0x97a6('0x1'));var _=require(_0x97a6('0x2'));var client=require(_0x97a6('0x3'));exports[_0x97a6('0x4')]=function(_0x4cde7a){return client[_0x97a6('0x5')](_0x97a6('0x6'),{'body':_[_0x97a6('0x7')](_0x4cde7a,{'source':_0x4cde7a[_0x97a6('0x8')],'destinationcontext':_0x4cde7a['context'],'callerid':_0x4cde7a['callerid'],'amaflags':_0x97a6('0x9')}),'log':_0x97a6('0x6')});};exports[_0x97a6('0xa')]=function(){return function(){return client[_0x97a6('0x5')](_0x97a6('0xb'),{'options':{'where':{'type':[_0x97a6('0xc')],'createdAt':{'$between':[moment()[_0x97a6('0xd')](_0x97a6('0xe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x97a6('0xf')](_0x97a6('0x10'))]}},'attributes':[_0x97a6('0x11'),_0x97a6('0x12'),_0x97a6('0x13'),'billableseconds']},'log':_0x97a6('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e69d294..3c125eb 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 _0x9450=['CreateVoiceDialReport','../client','create','Request'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x9450,0xed));var _0x0945=function(_0x910e82,_0x560fcc){_0x910e82=_0x910e82-0x0;var _0x4fb7a9=_0x9450[_0x910e82];return _0x4fb7a9;};'use strict';var client=require(_0x0945('0x0'));exports[_0x0945('0x1')]=function(_0x4c30d3){return client[_0x0945('0x2')](_0x0945('0x3'),{'body':_0x4c30d3,'log':_0x0945('0x3')});}; \ No newline at end of file +var _0xc819=['CreateVoiceDialReport','Request'];(function(_0x21fd61,_0x3ce7ae){var _0x2f2480=function(_0x26aa39){while(--_0x26aa39){_0x21fd61['push'](_0x21fd61['shift']());}};_0x2f2480(++_0x3ce7ae);}(_0xc819,0xed));var _0x9c81=function(_0x9d2e33,_0xf0ddda){_0x9d2e33=_0x9d2e33-0x0;var _0x16860a=_0xc819[_0x9d2e33];return _0x16860a;};'use strict';var client=require('../client');exports['create']=function(_0x2693e9){return client[_0x9c81('0x0')](_0x9c81('0x1'),{'body':_0x2693e9,'log':_0x9c81('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1ccbd3e..b627dc9 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 _0x47fd=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x47fd,0x13c));var _0xd47f=function(_0x3a0dbc,_0x52e9c2){_0x3a0dbc=_0x3a0dbc-0x0;var _0x2b9ea3=_0x47fd[_0x3a0dbc];return _0x2b9ea3;};'use strict';var client=require(_0xd47f('0x0'));exports[_0xd47f('0x1')]=function(){return function(){return client[_0xd47f('0x2')](_0xd47f('0x3'),{'options':{'raw':!![],'attributes':['id',_0xd47f('0x4'),_0xd47f('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xd47f('0x1')});};}; \ No newline at end of file +var _0xe3db=['../client','getVoiceExtensions','GetVoiceExtension','exten','recordingFormat'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xe3db,0xc8));var _0xbe3d=function(_0xda6d4,_0x284ca1){_0xda6d4=_0xda6d4-0x0;var _0x627bf1=_0xe3db[_0xda6d4];return _0x627bf1;};'use strict';var client=require(_0xbe3d('0x0'));exports[_0xbe3d('0x1')]=function(){return function(){return client['Request'](_0xbe3d('0x2'),{'options':{'raw':!![],'attributes':['id',_0xbe3d('0x3'),_0xbe3d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xbe3d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6987fa0..e185054 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 _0x486d=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','callerid','Interval','name','interval','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x486d,0xdd));var _0xd486=function(_0x49e134,_0x2c789f){_0x49e134=_0x49e134-0x0;var _0x13ff4d=_0x486d[_0x49e134];return _0x13ff4d;};'use strict';var client=require('../client');exports[_0xd486('0x0')]=function(){return function(){return client['Request'](_0xd486('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xd486('0x2'),_0xd486('0x3'),_0xd486('0x4'),_0xd486('0x5'),_0xd486('0x6'),_0xd486('0x7'),_0xd486('0x8'),'dialLimitChannel',_0xd486('0x9'),_0xd486('0xa'),'dialPredictiveOptimization',_0xd486('0xb'),_0xd486('0xc'),_0xd486('0xd'),_0xd486('0xe'),_0xd486('0xf'),'dialQueueOptions',_0xd486('0x10'),'dialQueueProject',_0xd486('0x11'),_0xd486('0x12'),_0xd486('0x13'),_0xd486('0x14'),_0xd486('0x15'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone',_0xd486('0x16'),_0xd486('0x17'),_0xd486('0x18'),_0xd486('0x19'),_0xd486('0x1a'),_0xd486('0x1b'),_0xd486('0x1c'),_0xd486('0x1d'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0xd486('0x1e'),_0xd486('0x1f'),'dialAMDMaximumWordLength',_0xd486('0x20'),_0xd486('0x21'),_0xd486('0x22'),_0xd486('0x23'),_0xd486('0x24'),_0xd486('0x25'),_0xd486('0x26'),_0xd486('0x5'),_0xd486('0x27'),_0xd486('0x28'),_0xd486('0x29'),_0xd486('0x2a'),_0xd486('0x2b'),_0xd486('0x2c'),'dialDropRetryFrequency',_0xd486('0x2d'),_0xd486('0x2e'),_0xd486('0x2f'),_0xd486('0x30'),_0xd486('0x31'),'dialAgentRejectRetryFrequency',_0xd486('0x32'),_0xd486('0x33'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xd486('0x34'),'as':_0xd486('0x34'),'attributes':['id','name','callerid',_0xd486('0x35')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xd486('0x34'),'as':'TrunkBackup','attributes':['id','name',_0xd486('0x36'),'active']},{'model':_0xd486('0x37'),'as':_0xd486('0x37'),'attributes':['id',_0xd486('0x38')],'include':[{'model':_0xd486('0x37'),'as':'Intervals','attributes':['id','name',_0xd486('0x39')]}]}]},'log':_0xd486('0x0')});};}; \ No newline at end of file +var _0x925f=['dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','monitor_format','dialActive','dialLimitChannel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0xd9ed0b,_0x3be903){var _0x5c9b4a=function(_0x176810){while(--_0x176810){_0xd9ed0b['push'](_0xd9ed0b['shift']());}};_0x5c9b4a(++_0x3be903);}(_0x925f,0x1cc));var _0xf925=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x925f[_0x1a595a];return _0x33f008;};'use strict';var client=require(_0xf925('0x0'));exports[_0xf925('0x1')]=function(){return function(){return client['Request'](_0xf925('0x2'),{'options':{'raw':![],'attributes':['id',_0xf925('0x3'),'acw','acwTimeout','autopause',_0xf925('0x4'),'type',_0xf925('0x5'),'dialMethod',_0xf925('0x6'),'dialLimitQueue','dialPowerLevel',_0xf925('0x7'),_0xf925('0x8'),'dialPredictiveInterval',_0xf925('0x9'),_0xf925('0xa'),_0xf925('0xb'),_0xf925('0xc'),'dialQueueTimeout',_0xf925('0xd'),_0xf925('0xe'),_0xf925('0xf'),_0xf925('0x10'),_0xf925('0x11'),_0xf925('0x12'),'dialNoAnswerRetryFrequency',_0xf925('0x13'),'dialTimezone',_0xf925('0x14'),'dialPrefix',_0xf925('0x15'),_0xf925('0x16'),_0xf925('0x17'),_0xf925('0x18'),_0xf925('0x19'),_0xf925('0x1a'),_0xf925('0x1b'),_0xf925('0x1c'),_0xf925('0x1d'),_0xf925('0x1e'),'dialAMDMaximumWordLength',_0xf925('0x1f'),_0xf925('0x20'),'dialRecallInQueue',_0xf925('0x21'),_0xf925('0x22'),'dialAgiAfterHangupClient',_0xf925('0x23'),_0xf925('0x4'),_0xf925('0x24'),_0xf925('0x25'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0xf925('0x26'),_0xf925('0x27'),_0xf925('0x28'),'dialAbandonedMaxRetry',_0xf925('0x29'),'dialMachineMaxRetry',_0xf925('0x2a'),_0xf925('0x2b'),_0xf925('0x2c'),_0xf925('0x2d'),_0xf925('0x2e'),_0xf925('0x2f')],'include':[{'model':'Trunk','as':_0xf925('0x30'),'attributes':['id','name','callerid',_0xf925('0x31')]},{'model':'Pause','as':_0xf925('0x32'),'attributes':['id',_0xf925('0x3')]},{'model':_0xf925('0x30'),'as':_0xf925('0x33'),'attributes':['id',_0xf925('0x3'),_0xf925('0x34'),_0xf925('0x31')]},{'model':_0xf925('0x35'),'as':_0xf925('0x35'),'attributes':['id','name'],'include':[{'model':_0xf925('0x35'),'as':_0xf925('0x36'),'attributes':['id',_0xf925('0x3'),_0xf925('0x37')]}]}]},'log':_0xf925('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d2c49a8..6d6e4a4 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 _0x0b1b=['queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x0b1b,0x6f));var _0xb0b1=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0b1b[_0x1da527];return _0x40fc7c;};'use strict';var moment=require(_0xb0b1('0x0'));var _=require('lodash');var client=require('../client');exports[_0xb0b1('0x1')]=function(_0x289b4d){return client[_0xb0b1('0x2')](_0xb0b1('0x3'),{'body':_0x289b4d,'log':_0xb0b1('0x3')});};exports[_0xb0b1('0x4')]=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xb0b1('0x5')]('day')[_0xb0b1('0x6')](_0xb0b1('0x7')),moment()[_0xb0b1('0x8')]('day')['format'](_0xb0b1('0x7'))]}},'attributes':['uniqueid',_0xb0b1('0x9'),_0xb0b1('0xa'),_0xb0b1('0xb'),_0xb0b1('0xc'),_0xb0b1('0xd'),_0xb0b1('0xe'),_0xb0b1('0xf'),'queuecallerabandon',_0xb0b1('0x10')]},'log':_0xb0b1('0x11')});};}; \ No newline at end of file +var _0xcc90=['queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','../client','CreateVoiceQueueReport','Request','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xcc90,0x148));var _0x0cc9=function(_0x1de822,_0x58cf0c){_0x1de822=_0x1de822-0x0;var _0x48fba9=_0xcc90[_0x1de822];return _0x48fba9;};'use strict';var moment=require(_0x0cc9('0x0'));var _=require('lodash');var client=require(_0x0cc9('0x1'));exports['create']=function(_0x223004){return client['Request']('CreateVoiceQueueReport',{'body':_0x223004,'log':_0x0cc9('0x2')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x0cc9('0x3')](_0x0cc9('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0cc9('0x5')](_0x0cc9('0x6'))[_0x0cc9('0x7')](_0x0cc9('0x8')),moment()[_0x0cc9('0x9')](_0x0cc9('0x6'))[_0x0cc9('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0x0cc9('0xa'),'queuecallerjoinAt',_0x0cc9('0xb'),_0x0cc9('0xc'),_0x0cc9('0xd'),_0x0cc9('0xe'),_0x0cc9('0xf'),'queuecallerabandon',_0x0cc9('0x10')]},'log':_0x0cc9('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 20372d5..3ed6712 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 _0xbddd=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x2a6880,_0xc4f0d8){var _0x391945=function(_0x135df8){while(--_0x135df8){_0x2a6880['push'](_0x2a6880['shift']());}};_0x391945(++_0xc4f0d8);}(_0xbddd,0x1e8));var _0xdbdd=function(_0x571991,_0x349e23){_0x571991=_0x571991-0x0;var _0xe90fd9=_0xbddd[_0x571991];return _0xe90fd9;};'use strict';var client=require(_0xdbdd('0x0'));exports[_0xdbdd('0x1')]=function(_0x5d698d){return function(){return client[_0xdbdd('0x2')](_0xdbdd('0x3'),{'options':{'where':{'VoiceQueueId':_0x5d698d,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x54f1=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x54f1,0x170));var _0x154f=function(_0x1016d0,_0x407e20){_0x1016d0=_0x1016d0-0x0;var _0x53ade5=_0x54f1[_0x1016d0];return _0x53ade5;};'use strict';var client=require('../client');exports[_0x154f('0x0')]=function(_0x14e4bc){return function(){return client[_0x154f('0x1')](_0x154f('0x2'),{'options':{'where':{'VoiceQueueId':_0x14e4bc,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c821ad9..edcb408 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 _0xf2c8=['lodash','../client','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x55b588,_0x406c55){var _0xc1a320=function(_0x5a7b43){while(--_0x5a7b43){_0x55b588['push'](_0x55b588['shift']());}};_0xc1a320(++_0x406c55);}(_0xf2c8,0x13e));var _0x8f2c=function(_0x2878fc,_0x1cb098){_0x2878fc=_0x2878fc-0x0;var _0x1a1acd=_0xf2c8[_0x2878fc];return _0x1a1acd;};'use strict';var _=require(_0x8f2c('0x0'));var client=require(_0x8f2c('0x1'));exports['create']=function(_0x55ce4f){return client[_0x8f2c('0x2')](_0x8f2c('0x3'),{'body':_[_0x8f2c('0x4')](_0x55ce4f,{'value':_0x55ce4f[_0x8f2c('0x5')]}),'log':_0x8f2c('0x3')});}; \ No newline at end of file +var _0xe7aa=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create','Request'];(function(_0x165508,_0x2c0a81){var _0x151872=function(_0x44d448){while(--_0x44d448){_0x165508['push'](_0x165508['shift']());}};_0x151872(++_0x2c0a81);}(_0xe7aa,0xff));var _0xae7a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xe7aa[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xae7a('0x0'));var client=require(_0xae7a('0x1'));exports[_0xae7a('0x2')]=function(_0x48df34){return client[_0xae7a('0x3')](_0xae7a('0x4'),{'body':_[_0xae7a('0x5')](_0x48df34,{'value':_0x48df34[_0xae7a('0x6')]}),'log':_0xae7a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 3fc909f..e3c4284 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 _0x9323=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridname'];(function(_0x4efe5a,_0x42fd6f){var _0x1a5cf1=function(_0x233e46){while(--_0x233e46){_0x4efe5a['push'](_0x4efe5a['shift']());}};_0x1a5cf1(++_0x42fd6f);}(_0x9323,0xd0));var _0x3932=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9323[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0x3932('0x0'));exports[_0x3932('0x1')]=function(_0x2b8ff1){return client['Request'](_0x3932('0x2'),{'body':{'result':_0x2b8ff1['result'],'transfererchannel':_0x2b8ff1[_0x3932('0x3')],'transferercalleridnum':_0x2b8ff1[_0x3932('0x4')],'transferercalleridname':_0x2b8ff1[_0x3932('0x5')],'transfererconnectedlinenum':_0x2b8ff1[_0x3932('0x6')],'transfererconnectedlinename':_0x2b8ff1[_0x3932('0x7')],'transfereraccountcode':_0x2b8ff1[_0x3932('0x8')],'transferercontext':_0x2b8ff1[_0x3932('0x9')],'transfererexten':_0x2b8ff1[_0x3932('0xa')],'transfererlinkedid':_0x2b8ff1[_0x3932('0xb')],'transfereechannel':_0x2b8ff1['transfereechannel'],'transfereecalleridnum':_0x2b8ff1[_0x3932('0xc')],'transfereecalleridname':_0x2b8ff1[_0x3932('0xd')],'transfereeconnectedlinenum':_0x2b8ff1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2b8ff1['transfereeconnectedlinename'],'transfereeaccountcode':_0x2b8ff1[_0x3932('0xe')],'transfereecontext':_0x2b8ff1[_0x3932('0xf')],'transfereeexten':_0x2b8ff1[_0x3932('0x10')],'transfereelinkedid':_0x2b8ff1[_0x3932('0x11')],'isexternal':_0x2b8ff1[_0x3932('0x12')],'context':_0x2b8ff1[_0x3932('0x13')],'extension':_0x2b8ff1[_0x3932('0x14')],'type':'blind'},'log':_0x3932('0x2')});};exports[_0x3932('0x15')]=function(_0x2f5fa9){return client[_0x3932('0x16')]('CreateVoiceTransferReport',{'body':{'result':_0x2f5fa9[_0x3932('0x17')],'transfererchannel':_0x2f5fa9[_0x3932('0x18')],'transferercalleridnum':_0x2f5fa9['origtransferercalleridnum'],'transferercalleridname':_0x2f5fa9[_0x3932('0x19')],'transfererconnectedlinenum':_0x2f5fa9['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2f5fa9[_0x3932('0x1a')],'transfereraccountcode':_0x2f5fa9[_0x3932('0x1b')],'transferercontext':_0x2f5fa9[_0x3932('0x1c')],'transfererexten':_0x2f5fa9[_0x3932('0x1d')],'transfererlinkedid':_0x2f5fa9['origtransfererlinkedid'],'transfereechannel':_0x2f5fa9['transfertargetchannel'],'transfereecalleridnum':_0x2f5fa9['transfertargetcalleridnum'],'transfereecalleridname':_0x2f5fa9[_0x3932('0x1e')],'transfereeconnectedlinenum':_0x2f5fa9[_0x3932('0x1f')],'transfereeconnectedlinename':_0x2f5fa9[_0x3932('0x20')],'transfereeaccountcode':_0x2f5fa9['transfertargetaccountcode'],'transfereecontext':_0x2f5fa9[_0x3932('0x21')],'transfereeexten':_0x2f5fa9[_0x3932('0x22')],'transfereelinkedid':_0x2f5fa9[_0x3932('0x23')],'isexternal':_0x2f5fa9[_0x3932('0x12')],'context':_0x2f5fa9[_0x3932('0x24')],'extension':_0x2f5fa9[_0x3932('0x25')],'type':_0x3932('0x26')},'log':_0x3932('0x2')});}; \ No newline at end of file +var _0xa741=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','../client','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereelinkedid','context','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname'];(function(_0x1cd094,_0x4288cc){var _0xf8ec77=function(_0x20ebc8){while(--_0x20ebc8){_0x1cd094['push'](_0x1cd094['shift']());}};_0xf8ec77(++_0x4288cc);}(_0xa741,0xbf));var _0x1a74=function(_0x44bcde,_0x386fb5){_0x44bcde=_0x44bcde-0x0;var _0x3f1e9c=_0xa741[_0x44bcde];return _0x3f1e9c;};'use strict';var client=require(_0x1a74('0x0'));exports['blindTransfer']=function(_0x423389){return client[_0x1a74('0x1')](_0x1a74('0x2'),{'body':{'result':_0x423389[_0x1a74('0x3')],'transfererchannel':_0x423389['transfererchannel'],'transferercalleridnum':_0x423389[_0x1a74('0x4')],'transferercalleridname':_0x423389[_0x1a74('0x5')],'transfererconnectedlinenum':_0x423389[_0x1a74('0x6')],'transfererconnectedlinename':_0x423389['transfererconnectedlinename'],'transfereraccountcode':_0x423389[_0x1a74('0x7')],'transferercontext':_0x423389[_0x1a74('0x8')],'transfererexten':_0x423389[_0x1a74('0x9')],'transfererlinkedid':_0x423389[_0x1a74('0xa')],'transfereechannel':_0x423389[_0x1a74('0xb')],'transfereecalleridnum':_0x423389[_0x1a74('0xc')],'transfereecalleridname':_0x423389[_0x1a74('0xd')],'transfereeconnectedlinenum':_0x423389[_0x1a74('0xe')],'transfereeconnectedlinename':_0x423389[_0x1a74('0xf')],'transfereeaccountcode':_0x423389['transfereeaccountcode'],'transfereecontext':_0x423389[_0x1a74('0x10')],'transfereeexten':_0x423389['transfereeexten'],'transfereelinkedid':_0x423389[_0x1a74('0x11')],'isexternal':_0x423389['isexternal'],'context':_0x423389[_0x1a74('0x12')],'extension':_0x423389['extension'],'type':_0x1a74('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0x1a74('0x14')]=function(_0x3470b5){return client[_0x1a74('0x1')](_0x1a74('0x2'),{'body':{'result':_0x3470b5[_0x1a74('0x3')],'transfererchannel':_0x3470b5['origtransfererchannel'],'transferercalleridnum':_0x3470b5[_0x1a74('0x15')],'transferercalleridname':_0x3470b5[_0x1a74('0x16')],'transfererconnectedlinenum':_0x3470b5[_0x1a74('0x17')],'transfererconnectedlinename':_0x3470b5[_0x1a74('0x18')],'transfereraccountcode':_0x3470b5[_0x1a74('0x19')],'transferercontext':_0x3470b5[_0x1a74('0x1a')],'transfererexten':_0x3470b5[_0x1a74('0x1b')],'transfererlinkedid':_0x3470b5[_0x1a74('0x1c')],'transfereechannel':_0x3470b5[_0x1a74('0x1d')],'transfereecalleridnum':_0x3470b5['transfertargetcalleridnum'],'transfereecalleridname':_0x3470b5[_0x1a74('0x1e')],'transfereeconnectedlinenum':_0x3470b5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3470b5[_0x1a74('0x1f')],'transfereeaccountcode':_0x3470b5[_0x1a74('0x20')],'transfereecontext':_0x3470b5[_0x1a74('0x21')],'transfereeexten':_0x3470b5[_0x1a74('0x22')],'transfereelinkedid':_0x3470b5['transfertargetlinkedid'],'isexternal':_0x3470b5['isexternal'],'context':_0x3470b5[_0x1a74('0x23')],'extension':_0x3470b5[_0x1a74('0x24')],'type':'attended'},'log':_0x1a74('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 019e355..fb2897e 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 _0x9923=['predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','callerid','Interval','length','values','channels','voicechannel','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','find','monitors','toLowerCase','isNil','push','/var/spool/asterisk/monitor/','rec','status','mixmonitorid','resolve','destinationchannel','StopMixMonitor','%s.%s','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','map','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../../../config/environment','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','then','catch','message','error','command','action','Command','Action','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x502ca3,_0x36be36){var _0x27f42c=function(_0x1e3045){while(--_0x1e3045){_0x502ca3['push'](_0x502ca3['shift']());}};_0x27f42c(++_0x36be36);}(_0x9923,0x150));var _0x3992=function(_0x31bbf7,_0x292c9a){_0x31bbf7=_0x31bbf7-0x0;var _0x1469f3=_0x9923[_0x31bbf7];return _0x1469f3;};'use strict';var _=require(_0x3992('0x0'));var util=require('util');var jayson=require(_0x3992('0x1'));var schema=require(_0x3992('0x2'));var BPromise=require(_0x3992('0x3'));var moment=require(_0x3992('0x4'));var config=require(_0x3992('0x5'));var properties=require('../properties');var ami=require('../ami');exports[_0x3992('0x6')]=function(_0x5e5524,_0x524a02,_0x5ea3a7){return new BPromise(function(_0x2f3689,_0xb6d6a7){var _0x1cf5a8={'QueuePause':function(_0x1afff8){return new Promise(function(_0x1d0823,_0x6c4e80){var _0x4c1d55=util[_0x3992('0x7')](_0x3992('0x8'),_0x3992('0x9'),_0x1afff8[_0x3992('0xa')]);if(_0x5e5524[_0x3992('0xb')]&&_0x5e5524['timers'][_0x4c1d55]&&_0x5e5524[_0x3992('0xb')][_0x4c1d55][_0x3992('0xc')]){_0x5e5524[_0x3992('0xb')][_0x4c1d55][_0x3992('0xd')]();}if(_0x5e5524['agents'][_0x4c1d55]){_0x5e5524[_0x3992('0xe')][_0x4c1d55][_0x3992('0xf')]({'statePause':_0x1afff8[_0x3992('0x10')]?!![]:![]});}_0x1d0823({'code':0xc8,'message':_0x3992('0x11')});});},'Reload':function(_0x168766){var _0x261d72=this;return new Promise(function(_0x55d288,_0x1a78b3){if(ami[_0x3992('0x12')]()==![]){return _0x1a78b3(_0x261d72['error'](0x1f4,[config['asterisk']['ip'],config[_0x3992('0x13')][_0x3992('0x14')],_0x3992('0x15')][_0x3992('0x16')]('\x20')));}_0x168766=_[_0x3992('0x17')](_0x168766,_[_0x3992('0x18')](properties[_0x3992('0x19')]));_0x168766['action']=_0x3992('0x1a');return ami['Action'](_0x168766)[_0x3992('0x1b')](function(_0x387691){_0x55d288({'code':0xc8,'message':_0x387691['message']});})[_0x3992('0x1c')](function(_0xceaabf){_0x1a78b3(_0x261d72['error'](0x1f5,_0xceaabf[_0x3992('0x1d')]));});});},'Command':function(_0x98857f){var _0x9460dd=this;return new Promise(function(_0x3ec1ea,_0x3a5aae){if(ami['isConnected']()==![]){return _0x3a5aae(_0x9460dd[_0x3992('0x1e')](0x1f4,[config[_0x3992('0x13')]['ip'],config[_0x3992('0x13')][_0x3992('0x14')],_0x3992('0x15')]['join']('\x20')));}_0x98857f=_['pick'](_0x98857f,_0x3992('0x1f'));_0x98857f[_0x3992('0x20')]=_0x3992('0x21');return ami[_0x3992('0x22')](_0x98857f)[_0x3992('0x1b')](function(_0x800721){_0x3ec1ea({'code':0xc8,'message':_0x800721[_0x3992('0x23')]});})['catch'](function(_0xa55d8c){_0x3a5aae(_0x9460dd['error'](0x1f5,_0xa55d8c[_0x3992('0x1d')]));});});},'VoiceQueues':function(_0x1bef86){return new Promise(function(_0x2217aa,_0xfbb708){var _0x959c41=[];for(var _0xddfd7e in _0x5e5524[_0x3992('0x24')]){if(_0x5e5524['voiceQueues'][_0x3992('0x25')](_0xddfd7e)){var _0x52b27c=_0x5e5524[_0x3992('0x24')][_0xddfd7e];var _0x3a535a={'id':_0x52b27c['id'],'name':_0x52b27c[_0x3992('0xa')],'strategy':_0x52b27c[_0x3992('0x26')],'answered':_0x52b27c[_0x3992('0x27')],'available':_0x52b27c[_0x3992('0x28')],'loggedIn':_0x52b27c[_0x3992('0x29')],'pTalking':_0x52b27c[_0x3992('0x2a')],'sumBillable':_0x52b27c[_0x3992('0x2b')],'sumDuration':_0x52b27c[_0x3992('0x2c')],'sumHoldTime':_0x52b27c['sumHoldTime']||0x0,'talking':_0x52b27c[_0x3992('0x2d')],'total':_0x52b27c['total'],'type':_0x52b27c[_0x3992('0x2e')],'unmanaged':_0x52b27c[_0x3992('0x2f')],'abandoned':_0x52b27c[_0x3992('0x30')],'waiting':_0x52b27c[_0x3992('0x31')],'loggedInDb':_0x52b27c[_0x3992('0x32')]};if(_0x52b27c[_0x3992('0x2e')]===_0x3992('0x33')){_0x3a535a['dialActive']=_0x52b27c['dialActive'];_0x3a535a[_0x3992('0x34')]=_0x52b27c[_0x3992('0x34')];_0x3a535a[_0x3992('0x35')]=_0x52b27c[_0x3992('0x35')];_0x3a535a[_0x3992('0x36')]=_0x52b27c[_0x3992('0x36')];_0x3a535a[_0x3992('0x37')]=_0x52b27c['dialOriginateTimeout'];_0x3a535a['dialPrefix']=_0x52b27c[_0x3992('0x38')];_0x3a535a['outboundAnswerAgiCallsDay']=_0x52b27c[_0x3992('0x39')];_0x3a535a[_0x3992('0x3a')]=_0x52b27c[_0x3992('0x3a')];_0x3a535a[_0x3992('0x3b')]=_0x52b27c[_0x3992('0x3b')];_0x3a535a['outboundBusyCallsDay']=_0x52b27c[_0x3992('0x3c')];_0x3a535a['outboundCongestionCallsDay']=_0x52b27c[_0x3992('0x3d')];_0x3a535a[_0x3992('0x3e')]=_0x52b27c['outboundDropCallsDayACS'];_0x3a535a[_0x3992('0x3f')]=_0x52b27c[_0x3992('0x3f')];_0x3a535a[_0x3992('0x40')]=_0x52b27c[_0x3992('0x40')];_0x3a535a[_0x3992('0x41')]=_0x52b27c[_0x3992('0x41')];_0x3a535a['outboundNoSuchCallsDay']=_0x52b27c[_0x3992('0x42')];_0x3a535a['outboundOriginateFailureCallsDay']=_0x52b27c['outboundOriginateFailureCallsDay'];_0x3a535a[_0x3992('0x43')]=_0x52b27c['outboundReCallsDay'];_0x3a535a[_0x3992('0x44')]=_0x52b27c[_0x3992('0x44')];_0x3a535a[_0x3992('0x45')]=_0x52b27c['outboundUnknownCallsDay'];_0x3a535a[_0x3992('0x46')]=_0x52b27c[_0x3992('0x46')];_0x3a535a[_0x3992('0x47')]=_0x52b27c[_0x3992('0x47')];_0x3a535a[_0x3992('0x48')]=_0x52b27c[_0x3992('0x48')];_0x3a535a[_0x3992('0x49')]=_0x52b27c[_0x3992('0x49')];_0x3a535a[_0x3992('0x4a')]=_0x52b27c[_0x3992('0x4a')];_0x3a535a[_0x3992('0x4b')]=_0x52b27c[_0x3992('0x4b')];_0x3a535a[_0x3992('0x4c')]=_0x52b27c['predictiveIntervalErlangCallsDroppedCalls'];_0x3a535a[_0x3992('0x4d')]=_0x52b27c[_0x3992('0x4d')];_0x3a535a[_0x3992('0x4e')]=_0x52b27c[_0x3992('0x4e')];_0x3a535a[_0x3992('0x4f')]=_0x52b27c[_0x3992('0x4f')];_0x3a535a[_0x3992('0x50')]=_0x52b27c[_0x3992('0x50')];_0x3a535a[_0x3992('0x51')]=_0x52b27c[_0x3992('0x51')];_0x3a535a[_0x3992('0x1d')]=_0x52b27c[_0x3992('0x1d')];_0x3a535a[_0x3992('0x52')]=_0x52b27c[_0x3992('0x52')];_0x3a535a[_0x3992('0x53')]=_0x52b27c['erlangCalls'];_0x3a535a[_0x3992('0x54')]=_0x52b27c[_0x3992('0x54')];_0x3a535a['erlangAbandonmentRate']=_0x52b27c['erlangAbandonmentRate'];_0x3a535a['erlangBusyFactor']=_0x52b27c['erlangBusyFactor'];_0x3a535a[_0x3992('0x55')]=_0x52b27c['startPredictive'];_0x3a535a['startProgressive']=_0x52b27c[_0x3992('0x56')];}if(_0x52b27c[_0x3992('0x57')]){_0x3a535a[_0x3992('0x57')]={'id':_0x52b27c[_0x3992('0x57')]['id'],'name':_0x52b27c[_0x3992('0x57')][_0x3992('0xa')],'active':_0x52b27c[_0x3992('0x57')]['active'],'callerid':_0x52b27c[_0x3992('0x57')][_0x3992('0x58')]};}if(_0x52b27c[_0x3992('0x59')]){_0x3a535a['Interval']={'id':_0x52b27c[_0x3992('0x59')]['id'],'name':_0x52b27c[_0x3992('0x59')][_0x3992('0xa')]};}_0x959c41['push'](_0x3a535a);}}_0x2217aa({'count':_0x959c41[_0x3992('0x5a')],'rows':_0x959c41});});},'VoiceChannels':function(_0x5b1bb6){return new Promise(function(_0x42d54a,_0x2baec0){var _0x47b8c6=_[_0x3992('0x5b')](_0x5e5524[_0x3992('0x5c')]);_0x42d54a({'count':_0x47b8c6[_0x3992('0x5a')],'rows':_0x47b8c6});});},'VoiceChannelMixMonitor':function(_0x333f66){var _0x322ab2=this;return new Promise(function(_0x470da6,_0x50f1e5){if(ami[_0x3992('0x12')]()==![]){return _0x50f1e5(_0x322ab2[_0x3992('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x3992('0x13')][_0x3992('0x14')],_0x3992('0x15')][_0x3992('0x16')]('\x20')));}var _0x117106=schema(properties[_0x3992('0x5d')])['validate'](_0x333f66);if(_0x117106[_0x3992('0x5a')]>0x0){return _0x50f1e5(_0x322ab2[_0x3992('0x1e')](0x1f4,_['map'](_0x117106,_0x3992('0x1d'))['join'](',\x20')));}var _0x5d9c01=_['find'](_0x5e5524[_0x3992('0x5c')],{'uniqueid':_0x333f66[_0x3992('0x5e')]});if(_0x5d9c01&&_0x5d9c01[_0x3992('0x5f')]){var _0x3bd0d3=util[_0x3992('0x7')]('%s.%s',_0x333f66[_0x3992('0x60')]||_0x333f66[_0x3992('0x5e')],_0x333f66[_0x3992('0x7')]||_0x3992('0x61'));return ami[_0x3992('0x22')]({'action':_0x3992('0x62'),'channel':_0x5d9c01[_0x3992('0x5f')],'file':_0x3bd0d3,'options':_0x3992('0x63')})[_0x3992('0x1b')](function(_0x5cc380){var _0xa69939=_[_0x3992('0x64')](_0x5d9c01[_0x3992('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x3bd0d3[_0x3992('0x66')]()});if(_[_0x3992('0x67')](_0xa69939)){_0x5d9c01[_0x3992('0x65')][_0x3992('0x68')]({'filename':_0x3992('0x69')+_0x3bd0d3[_0x3992('0x66')](),'createdAt':moment()[_0x3992('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5cc380['mixmonitorid'],'status':_0x3992('0x6a')});}else{_0xa69939['mixmonitorid']=_0x5cc380['mixmonitorid'];_0xa69939[_0x3992('0x6b')]=_0x3992('0x6a');}_0x470da6({'code':0xc8,'message':[_0x333f66[_0x3992('0x5e')],'MixMonitor\x20Success',_0x5cc380[_0x3992('0x6c')]]['join']('\x20'),'mixmonitorid':_0x5cc380[_0x3992('0x6c')]});})[_0x3992('0x1c')](function(_0x2a5839){_0x50f1e5(_0x322ab2[_0x3992('0x1e')](0x1f5,[_0x333f66[_0x3992('0x5e')],_0x2a5839['message'][_0x3992('0x66')]()][_0x3992('0x16')]('\x20')));});}else{return _0x50f1e5(_0x322ab2[_0x3992('0x1e')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3362ed){var _0x243b24=this;return new Promise(function(_0x2f379f,_0x335b2f){if(ami['isConnected']()==![]){return _0x335b2f(_0x243b24[_0x3992('0x1e')](0x1f4,[config[_0x3992('0x13')]['ip'],config['asterisk'][_0x3992('0x14')],_0x3992('0x15')][_0x3992('0x16')]('\x20')));}var _0x17ea47=schema(properties[_0x3992('0x5d')])[_0x3992('0x2')](_0x3362ed);if(_0x17ea47[_0x3992('0x5a')]>0x0){return _0x335b2f(_0x243b24[_0x3992('0x1e')](0x1f4,_['map'](_0x17ea47,_0x3992('0x1d'))[_0x3992('0x16')](',\x20')));}var _0x9090a9=_['find'](_0x5e5524[_0x3992('0x5c')],{'uniqueid':_0x3362ed[_0x3992('0x5e')]});if(_0x9090a9){return BPromise[_0x3992('0x6d')]()['then'](function(){if(_0x9090a9['channel']){return ami[_0x3992('0x22')]({'action':'StopMixMonitor','channel':_0x9090a9[_0x3992('0x5f')],'mixmonitorid':_0x3362ed[_0x3992('0x6c')]})[_0x3992('0x1c')](function(_0x532051){});}})[_0x3992('0x1b')](function(){if(_0x9090a9[_0x3992('0x6e')]){return ami[_0x3992('0x22')]({'action':_0x3992('0x6f'),'channel':_0x9090a9[_0x3992('0x6e')],'mixmonitorid':_0x3362ed[_0x3992('0x6c')]})[_0x3992('0x1c')](function(_0x290285){});}})[_0x3992('0x1b')](function(_0x4a7ff1){var _0x468964=_['find'](_0x9090a9[_0x3992('0x65')],{'mixmonitorid':_0x3362ed['mixmonitorid']});if(_0x468964){_0x468964[_0x3992('0x6b')]='stop';}})[_0x3992('0x1b')](function(){var _0x263417=util[_0x3992('0x7')](_0x3992('0x70'),_0x3362ed[_0x3992('0x60')]||_0x3362ed[_0x3992('0x5e')],_0x3362ed[_0x3992('0x7')]||_0x3992('0x61'));var _0x5af13f=_[_0x3992('0x64')](_0x9090a9[_0x3992('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x263417[_0x3992('0x66')]()});if(_0x5af13f){_0x5af13f[_0x3992('0x6b')]=_0x3992('0x71');}})['then'](function(){_0x2f379f({'code':0xc8,'message':[_0x3362ed[_0x3992('0x5e')],_0x3992('0x72')][_0x3992('0x16')]('\x20')});})['catch'](function(_0x424a73){_0x335b2f(_0x243b24[_0x3992('0x1e')](0x1f5,[_0x3362ed['uniqueid'],_0x424a73['message'][_0x3992('0x66')]()][_0x3992('0x16')]('\x20')));});}else{return _0x335b2f(_0x243b24[_0x3992('0x1e')](0x1f5,_0x3992('0x73')));}});},'VoiceQueuesChannels':function(_0x30058d){return new Promise(function(_0x749692,_0x2cd7d6){var _0x183e70=_[_0x3992('0x5b')](_0x5e5524['queueChannels']);_0x749692({'count':_0x183e70[_0x3992('0x5a')],'rows':_0x183e70});});},'VoiceQueuesChannel':function(_0x5dc2b5){var _0x55fcb0=this;return new Promise(function(_0x37f0da,_0x4ba780){var _0x5636c0=schema(properties[_0x3992('0x74')])['validate'](_0x5dc2b5);if(_0x5636c0[_0x3992('0x5a')]>0x0){return _0x4ba780(_0x55fcb0['error'](0x1f4,_[_0x3992('0x75')](_0x5636c0,'message')[_0x3992('0x16')](',\x20')));}var _0x4ad53a=_[_0x3992('0x64')](_0x5e5524['queueChannels'],{'uniqueid':_0x5dc2b5[_0x3992('0x5e')]});if(_0x4ad53a){_0x37f0da(_0x4ad53a);}else{return _0x4ba780(_0x55fcb0[_0x3992('0x1e')](0x1f5,_0x3992('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x17739f){var _0x1189b1=this;return new Promise(function(_0x4c51b1,_0xe65042){if(ami['isConnected']()==![]){return _0xe65042(_0x1189b1[_0x3992('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0x3992('0x13')][_0x3992('0x14')],_0x3992('0x15')]['join']('\x20')));}var _0xfa35c4=schema(properties[_0x3992('0x76')])[_0x3992('0x2')](_0x17739f);if(_0xfa35c4[_0x3992('0x5a')]>0x0){return _0xe65042(_0x1189b1[_0x3992('0x1e')](0x1f4,_['map'](_0xfa35c4,_0x3992('0x1d'))['join'](',\x20')));}var _0x420f46=_[_0x3992('0x64')](_0x5e5524['queueChannels'],{'uniqueid':_0x17739f[_0x3992('0x5e')]});if(_0x420f46&&_0x420f46[_0x3992('0x5f')]){return ami[_0x3992('0x22')]({'action':_0x3992('0x77'),'channel':_0x420f46['channel']})[_0x3992('0x1b')](function(_0xaa5fc8){_0x4c51b1({'code':0xc8,'message':[_0x17739f['uniqueid'],_0xaa5fc8[_0x3992('0x1d')][_0x3992('0x66')]()][_0x3992('0x16')]('\x20')});})[_0x3992('0x1c')](function(_0x58ce2f){_0xe65042(_0x1189b1[_0x3992('0x1e')](0x1f5,[_0x17739f[_0x3992('0x5e')],_0x58ce2f[_0x3992('0x1d')][_0x3992('0x66')]()][_0x3992('0x16')]('\x20')));});}else{return _0xe65042(_0x1189b1[_0x3992('0x1e')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x18d15f){var _0x545a3d=this;return new Promise(function(_0x54dfcd,_0x4d0ba6){if(ami['isConnected']()==![]){return _0x4d0ba6(_0x545a3d['error'](0x1f4,[config[_0x3992('0x13')]['ip'],config[_0x3992('0x13')][_0x3992('0x14')],_0x3992('0x15')][_0x3992('0x16')]('\x20')));}var _0x147ba2=schema(properties[_0x3992('0x78')])[_0x3992('0x2')](_0x18d15f);if(_0x147ba2[_0x3992('0x5a')]>0x0){return _0x4d0ba6(_0x545a3d[_0x3992('0x1e')](0x1f4,_[_0x3992('0x75')](_0x147ba2,'message')[_0x3992('0x16')](',\x20')));}var _0x4849e2=_[_0x3992('0x64')](_0x5e5524['queueChannels'],{'uniqueid':_0x18d15f['uniqueid']});if(_0x4849e2&&_0x4849e2['channel']){return ami['Action']({'action':_0x3992('0x79'),'channel':_0x4849e2[_0x3992('0x5f')],'exten':_0x18d15f[_0x3992('0x7a')],'context':_0x18d15f[_0x3992('0x7b')]||_0x4849e2['context'],'priority':0x1})[_0x3992('0x1b')](function(_0x15dcd6){_0x54dfcd({'code':0xc8,'message':[_0x18d15f['uniqueid'],_0x15dcd6[_0x3992('0x1d')]['toLowerCase']()][_0x3992('0x16')]('\x20')});})[_0x3992('0x1c')](function(_0x9d1751){_0x4d0ba6(_0x545a3d[_0x3992('0x1e')](0x1f5,[_0x18d15f['uniqueid'],_0x9d1751['message'][_0x3992('0x66')]()]['join']('\x20')));});}else{return _0x4d0ba6(_0x545a3d[_0x3992('0x1e')](0x1f5,_0x3992('0x73')));}});},'Agents':function(_0x4665f9){return new Promise(function(_0x4e05e8,_0x3d3f69){var _0x3df1fa=_[_0x3992('0x5b')](_0x5e5524[_0x3992('0xe')]);_0x4e05e8({'count':_0x3df1fa[_0x3992('0x5a')],'rows':_0x3df1fa});});},'Telephones':function(_0x32b333){return new Promise(function(_0x100f2d,_0x5adaed){var _0x5a6ddc=_['values'](_0x5e5524['telephones']);_0x100f2d({'count':_0x5a6ddc['length'],'rows':_0x5a6ddc});});},'Trunks':function(_0x2c7986){return new Promise(function(_0x31d3ea,_0x29f65f){var _0x26cd07=_[_0x3992('0x5b')](_0x5e5524[_0x3992('0x7c')]);_0x31d3ea({'count':_0x26cd07['length'],'rows':_0x26cd07});});},'OutboundChannels':function(_0x3b1cf1){return new Promise(function(_0x59bc30,_0x10695f){var _0x2189da=_[_0x3992('0x5b')](_0x5e5524['outboundChannels']);_0x59bc30({'count':_0x2189da[_0x3992('0x5a')],'rows':_0x2189da});});},'Outbound':function(_0x23ab83){return new Promise(function(_0x2a92ba,_0x542f84){_0x2a92ba(_0x5e5524['outbound']);});},'Campaigns':function(_0x4a06f4){return new Promise(function(_0xcb34c2,_0x28d4cf){var _0x34521d=_[_0x3992('0x5b')](_0x5e5524[_0x3992('0x7d')]);_0xcb34c2({'count':_0x34521d['length'],'rows':_0x34521d});});},'VoiceQueuesPreview':function(_0x4ac26f){var _0x2a0f99=this;return new Promise(function(_0x3837cf,_0x4fa32b){_0x524a02[_0x3992('0x7e')](_0x4ac26f['id'])[_0x3992('0x1b')](function(_0xdfc72d){_0x3837cf({'code':0xc8,'message':_0xdfc72d['message']});})[_0x3992('0x1c')](function(_0x2fa17e){_0x4fa32b(_0x2a0f99['error'](0x1f4,_0x2fa17e['message']));});});},'EventManager':function(_0x2f19ac){var _0x510534=this;return new Promise(function(_0x92239c,_0x570adb){if(!_0x2f19ac[_0x3992('0x7f')]){return _0x570adb(_0x510534[_0x3992('0x1e')](0x1f4,_0x3992('0x80')));}ami[_0x3992('0x81')]('custom:'+_0x2f19ac[_0x3992('0x7f')],_0x2f19ac[_0x3992('0x1d')]);_0x92239c({'code':0xc8,'message':_0x2f19ac});});},'FaxAccounts':function(_0xd1f3bd){return new Promise(function(_0x2e0a30,_0x2b2b03){var _0x94e767=_[_0x3992('0x5b')](_0x5e5524[_0x3992('0x82')]);_0x2e0a30({'count':_0x94e767[_0x3992('0x5a')],'rows':_0x94e767});});},'SendFax':function(_0x3b7b8b){var _0x28f74f=this;return new Promise(function(_0x133048,_0x34e716){_0x5ea3a7[_0x3992('0x83')](_0x3b7b8b)[_0x3992('0x1b')](function(_0x3afcaa){_0x133048({'code':0xc8,'message':_0x3afcaa[_0x3992('0x1d')]});})[_0x3992('0x1c')](function(_0x3efff3){_0x34e716(_0x28f74f[_0x3992('0x1e')](0x1f4,_0x3efff3[_0x3992('0x1d')]));});});},'CheckAfterSend':function(_0x4c0c9a){var _0x37e673=this;return new Promise(function(_0x3a2843,_0x4211fc){_0x5ea3a7[_0x3992('0x84')](_0x4c0c9a)['then'](function(_0x2345a0){_0x3a2843({'code':0xc8,'message':_0x2345a0[_0x3992('0x1d')]});})['catch'](function(_0x28a99d){_0x4211fc(_0x37e673[_0x3992('0x1e')](0x1f4,_0x28a99d[_0x3992('0x1d')]));});});}};var _0x5315c7=jayson[_0x3992('0x85')](_0x1cf5a8)[_0x3992('0x86')]();_0x5315c7['on'](_0x3992('0x1e'),function(_0x27148f){return _0xb6d6a7(_0x27148f);});_0x5315c7[_0x3992('0x6')](0x232a,_0x3992('0x87'),function(){console[_0x3992('0x88')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2f3689(_0x3992('0x89')+0x232a);});});}; \ No newline at end of file +var _0xde6a=['map','uniqueid','channel','format','%s.%s','filename','ai(mixmonitorid)','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','monitors','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','server','http','log','RPC\x20listening\x20on\x20port:','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','catch','command','Command','then','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','waiting','loggedInDb','outbound','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','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xde6a,0xb0));var _0xade6=function(_0x2ad2b9,_0x1a8c53){_0x2ad2b9=_0x2ad2b9-0x0;var _0x5e5edc=_0xde6a[_0x2ad2b9];return _0x5e5edc;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0xade6('0x0'));var schema=require(_0xade6('0x1'));var BPromise=require(_0xade6('0x2'));var moment=require('moment');var config=require(_0xade6('0x3'));var properties=require(_0xade6('0x4'));var ami=require(_0xade6('0x5'));exports[_0xade6('0x6')]=function(_0xd19a9f,_0x26daf5,_0x5845a7){return new BPromise(function(_0x127f95,_0x4f11eb){var _0x41c129={'QueuePause':function(_0x1a935e){return new Promise(function(_0x361590,_0x336dd7){var _0x209797=util['format']('%s/%s',_0xade6('0x7'),_0x1a935e[_0xade6('0x8')]);if(_0xd19a9f[_0xade6('0x9')]&&_0xd19a9f[_0xade6('0x9')][_0x209797]&&_0xd19a9f[_0xade6('0x9')][_0x209797]['timer']){_0xd19a9f[_0xade6('0x9')][_0x209797][_0xade6('0xa')]();}if(_0xd19a9f['agents'][_0x209797]){_0xd19a9f[_0xade6('0xb')][_0x209797][_0xade6('0xc')]({'statePause':_0x1a935e[_0xade6('0xd')]?!![]:![]});}_0x361590({'code':0xc8,'message':_0xade6('0xe')});});},'Reload':function(_0x29a4db){var _0x4aee48=this;return new Promise(function(_0x5d81a7,_0x4c2f5f){if(ami[_0xade6('0xf')]()==![]){return _0x4c2f5f(_0x4aee48[_0xade6('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xade6('0x11')][_0xade6('0x12')],_0xade6('0x13')][_0xade6('0x14')]('\x20')));}_0x29a4db=_[_0xade6('0x15')](_0x29a4db,_[_0xade6('0x16')](properties['module']));_0x29a4db[_0xade6('0x17')]=_0xade6('0x18');return ami[_0xade6('0x19')](_0x29a4db)['then'](function(_0x1836cd){_0x5d81a7({'code':0xc8,'message':_0x1836cd['message']});})[_0xade6('0x1a')](function(_0x44d496){_0x4c2f5f(_0x4aee48['error'](0x1f5,_0x44d496['message']));});});},'Command':function(_0x5decf4){var _0x60fb52=this;return new Promise(function(_0x249e0d,_0x1ce0df){if(ami[_0xade6('0xf')]()==![]){return _0x1ce0df(_0x60fb52['error'](0x1f4,[config[_0xade6('0x11')]['ip'],config[_0xade6('0x11')]['username'],_0xade6('0x13')][_0xade6('0x14')]('\x20')));}_0x5decf4=_[_0xade6('0x15')](_0x5decf4,_0xade6('0x1b'));_0x5decf4[_0xade6('0x17')]=_0xade6('0x1c');return ami[_0xade6('0x19')](_0x5decf4)[_0xade6('0x1d')](function(_0x58bea0){_0x249e0d({'code':0xc8,'message':_0x58bea0[_0xade6('0x1e')]});})['catch'](function(_0x326cea){_0x1ce0df(_0x60fb52['error'](0x1f5,_0x326cea['message']));});});},'VoiceQueues':function(_0x3c9d29){return new Promise(function(_0x34db65,_0x1dbaa1){var _0x3699e2=[];for(var _0x31320b in _0xd19a9f['voiceQueues']){if(_0xd19a9f[_0xade6('0x1f')][_0xade6('0x20')](_0x31320b)){var _0x231563=_0xd19a9f['voiceQueues'][_0x31320b];var _0x3b3331={'id':_0x231563['id'],'name':_0x231563[_0xade6('0x8')],'strategy':_0x231563['strategy'],'answered':_0x231563[_0xade6('0x21')],'available':_0x231563['available'],'loggedIn':_0x231563[_0xade6('0x22')],'pTalking':_0x231563[_0xade6('0x23')],'sumBillable':_0x231563[_0xade6('0x24')],'sumDuration':_0x231563[_0xade6('0x25')],'sumHoldTime':_0x231563[_0xade6('0x26')]||0x0,'talking':_0x231563['talking'],'total':_0x231563['total'],'type':_0x231563[_0xade6('0x27')],'unmanaged':_0x231563[_0xade6('0x28')],'abandoned':_0x231563['abandoned'],'waiting':_0x231563[_0xade6('0x29')],'loggedInDb':_0x231563[_0xade6('0x2a')]};if(_0x231563['type']===_0xade6('0x2b')){_0x3b3331[_0xade6('0x2c')]=_0x231563[_0xade6('0x2c')];_0x3b3331[_0xade6('0x2d')]=_0x231563[_0xade6('0x2d')];_0x3b3331[_0xade6('0x2e')]=_0x231563[_0xade6('0x2e')];_0x3b3331[_0xade6('0x2f')]=_0x231563[_0xade6('0x2f')];_0x3b3331[_0xade6('0x30')]=_0x231563[_0xade6('0x30')];_0x3b3331[_0xade6('0x31')]=_0x231563[_0xade6('0x31')];_0x3b3331[_0xade6('0x32')]=_0x231563[_0xade6('0x32')];_0x3b3331[_0xade6('0x33')]=_0x231563['outboundAnswerCallsDay'];_0x3b3331[_0xade6('0x34')]=_0x231563[_0xade6('0x34')];_0x3b3331['outboundBusyCallsDay']=_0x231563[_0xade6('0x35')];_0x3b3331[_0xade6('0x36')]=_0x231563[_0xade6('0x36')];_0x3b3331[_0xade6('0x37')]=_0x231563[_0xade6('0x37')];_0x3b3331[_0xade6('0x38')]=_0x231563[_0xade6('0x38')];_0x3b3331['outboundDropCallsDayTimeout']=_0x231563[_0xade6('0x39')];_0x3b3331['outboundNoAnswerCallsDay']=_0x231563[_0xade6('0x3a')];_0x3b3331[_0xade6('0x3b')]=_0x231563['outboundNoSuchCallsDay'];_0x3b3331[_0xade6('0x3c')]=_0x231563[_0xade6('0x3c')];_0x3b3331['outboundReCallsDay']=_0x231563[_0xade6('0x3d')];_0x3b3331[_0xade6('0x3e')]=_0x231563[_0xade6('0x3e')];_0x3b3331[_0xade6('0x3f')]=_0x231563['outboundUnknownCallsDay'];_0x3b3331['predictiveIntervalAnsweredCalls']=_0x231563[_0xade6('0x40')];_0x3b3331[_0xade6('0x41')]=_0x231563[_0xade6('0x41')];_0x3b3331[_0xade6('0x42')]=_0x231563[_0xade6('0x42')];_0x3b3331['predictiveIntervalDroppedCallsCallersExit']=_0x231563[_0xade6('0x43')];_0x3b3331[_0xade6('0x44')]=_0x231563[_0xade6('0x44')];_0x3b3331[_0xade6('0x45')]=_0x231563[_0xade6('0x45')];_0x3b3331[_0xade6('0x46')]=_0x231563['predictiveIntervalErlangCallsDroppedCalls'];_0x3b3331[_0xade6('0x47')]=_0x231563[_0xade6('0x47')];_0x3b3331[_0xade6('0x48')]=_0x231563[_0xade6('0x48')];_0x3b3331[_0xade6('0x49')]=_0x231563[_0xade6('0x49')];_0x3b3331['predictiveIntervalAvailable']=_0x231563['predictiveIntervalAvailable'];_0x3b3331[_0xade6('0x4a')]=_0x231563[_0xade6('0x4a')];_0x3b3331[_0xade6('0x4b')]=_0x231563['message'];_0x3b3331[_0xade6('0x4c')]=_0x231563[_0xade6('0x4c')];_0x3b3331[_0xade6('0x4d')]=_0x231563[_0xade6('0x4d')];_0x3b3331[_0xade6('0x4e')]=_0x231563[_0xade6('0x4e')];_0x3b3331[_0xade6('0x4f')]=_0x231563[_0xade6('0x4f')];_0x3b3331['erlangBusyFactor']=_0x231563[_0xade6('0x50')];_0x3b3331['startPredictive']=_0x231563[_0xade6('0x51')];_0x3b3331[_0xade6('0x52')]=_0x231563[_0xade6('0x52')];}if(_0x231563[_0xade6('0x53')]){_0x3b3331['Trunk']={'id':_0x231563['Trunk']['id'],'name':_0x231563[_0xade6('0x53')][_0xade6('0x8')],'active':_0x231563[_0xade6('0x53')][_0xade6('0x54')],'callerid':_0x231563[_0xade6('0x53')][_0xade6('0x55')]};}if(_0x231563[_0xade6('0x56')]){_0x3b3331[_0xade6('0x56')]={'id':_0x231563[_0xade6('0x56')]['id'],'name':_0x231563[_0xade6('0x56')][_0xade6('0x8')]};}_0x3699e2[_0xade6('0x57')](_0x3b3331);}}_0x34db65({'count':_0x3699e2[_0xade6('0x58')],'rows':_0x3699e2});});},'VoiceChannels':function(_0x3323a7){return new Promise(function(_0x4a33ee,_0xe48950){var _0x27072b=_[_0xade6('0x59')](_0xd19a9f[_0xade6('0x5a')]);_0x4a33ee({'count':_0x27072b[_0xade6('0x58')],'rows':_0x27072b});});},'VoiceChannelMixMonitor':function(_0x382756){var _0x208894=this;return new Promise(function(_0x3dd11c,_0x4726ce){if(ami[_0xade6('0xf')]()==![]){return _0x4726ce(_0x208894['error'](0x1f4,[config['asterisk']['ip'],config[_0xade6('0x11')]['username'],_0xade6('0x13')][_0xade6('0x14')]('\x20')));}var _0x35d19c=schema(properties[_0xade6('0x5b')])[_0xade6('0x1')](_0x382756);if(_0x35d19c[_0xade6('0x58')]>0x0){return _0x4726ce(_0x208894[_0xade6('0x10')](0x1f4,_[_0xade6('0x5c')](_0x35d19c,'message')['join'](',\x20')));}var _0x2eaf77=_['find'](_0xd19a9f['channels'],{'uniqueid':_0x382756[_0xade6('0x5d')]});if(_0x2eaf77&&_0x2eaf77[_0xade6('0x5e')]){var _0x1679d3=util[_0xade6('0x5f')](_0xade6('0x60'),_0x382756[_0xade6('0x61')]||_0x382756[_0xade6('0x5d')],_0x382756[_0xade6('0x5f')]||'wav');return ami[_0xade6('0x19')]({'action':'MixMonitor','channel':_0x2eaf77['channel'],'file':_0x1679d3,'options':_0xade6('0x62')})[_0xade6('0x1d')](function(_0x4aacc1){var _0x1fd7b0=_[_0xade6('0x63')](_0x2eaf77['monitors'],{'filename':_0xade6('0x64')+_0x1679d3[_0xade6('0x65')]()});if(_[_0xade6('0x66')](_0x1fd7b0)){_0x2eaf77['monitors'][_0xade6('0x57')]({'filename':'/var/spool/asterisk/monitor/'+_0x1679d3[_0xade6('0x65')](),'createdAt':moment()[_0xade6('0x5f')](_0xade6('0x67')),'mixmonitorid':_0x4aacc1['mixmonitorid'],'status':_0xade6('0x68')});}else{_0x1fd7b0[_0xade6('0x69')]=_0x4aacc1[_0xade6('0x69')];_0x1fd7b0[_0xade6('0x6a')]=_0xade6('0x68');}_0x3dd11c({'code':0xc8,'message':[_0x382756[_0xade6('0x5d')],_0xade6('0x6b'),_0x4aacc1[_0xade6('0x69')]][_0xade6('0x14')]('\x20'),'mixmonitorid':_0x4aacc1[_0xade6('0x69')]});})[_0xade6('0x1a')](function(_0x2a84f2){_0x4726ce(_0x208894[_0xade6('0x10')](0x1f5,[_0x382756['uniqueid'],_0x2a84f2[_0xade6('0x4b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x4726ce(_0x208894[_0xade6('0x10')](0x1f5,_0xade6('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x4dcdcb){var _0x2b58cb=this;return new Promise(function(_0x225640,_0x31a289){if(ami[_0xade6('0xf')]()==![]){return _0x31a289(_0x2b58cb[_0xade6('0x10')](0x1f4,[config[_0xade6('0x11')]['ip'],config['asterisk'][_0xade6('0x12')],'ami\x20disconnected'][_0xade6('0x14')]('\x20')));}var _0x3021ae=schema(properties['voicechannel'])[_0xade6('0x1')](_0x4dcdcb);if(_0x3021ae[_0xade6('0x58')]>0x0){return _0x31a289(_0x2b58cb['error'](0x1f4,_['map'](_0x3021ae,_0xade6('0x4b'))[_0xade6('0x14')](',\x20')));}var _0x4a4498=_[_0xade6('0x63')](_0xd19a9f[_0xade6('0x5a')],{'uniqueid':_0x4dcdcb['uniqueid']});if(_0x4a4498){return BPromise[_0xade6('0x6d')]()[_0xade6('0x1d')](function(){if(_0x4a4498[_0xade6('0x5e')]){return ami[_0xade6('0x19')]({'action':_0xade6('0x6e'),'channel':_0x4a4498[_0xade6('0x5e')],'mixmonitorid':_0x4dcdcb[_0xade6('0x69')]})[_0xade6('0x1a')](function(_0x3a6b44){});}})[_0xade6('0x1d')](function(){if(_0x4a4498[_0xade6('0x6f')]){return ami[_0xade6('0x19')]({'action':'StopMixMonitor','channel':_0x4a4498['destinationchannel'],'mixmonitorid':_0x4dcdcb[_0xade6('0x69')]})[_0xade6('0x1a')](function(_0x5140cf){});}})[_0xade6('0x1d')](function(_0xd7541d){var _0x1cfadb=_['find'](_0x4a4498['monitors'],{'mixmonitorid':_0x4dcdcb[_0xade6('0x69')]});if(_0x1cfadb){_0x1cfadb['status']=_0xade6('0x70');}})[_0xade6('0x1d')](function(){var _0x248feb=util['format'](_0xade6('0x60'),_0x4dcdcb[_0xade6('0x61')]||_0x4dcdcb['uniqueid'],_0x4dcdcb[_0xade6('0x5f')]||'wav');var _0x4880b0=_[_0xade6('0x63')](_0x4a4498[_0xade6('0x71')],{'filename':_0xade6('0x64')+_0x248feb[_0xade6('0x65')]()});if(_0x4880b0){_0x4880b0[_0xade6('0x6a')]=_0xade6('0x70');}})[_0xade6('0x1d')](function(){_0x225640({'code':0xc8,'message':[_0x4dcdcb[_0xade6('0x5d')],_0xade6('0x72')][_0xade6('0x14')]('\x20')});})[_0xade6('0x1a')](function(_0x2cef1c){_0x31a289(_0x2b58cb[_0xade6('0x10')](0x1f5,[_0x4dcdcb[_0xade6('0x5d')],_0x2cef1c[_0xade6('0x4b')][_0xade6('0x65')]()][_0xade6('0x14')]('\x20')));});}else{return _0x31a289(_0x2b58cb[_0xade6('0x10')](0x1f5,_0xade6('0x6c')));}});},'VoiceQueuesChannels':function(_0x4fd347){return new Promise(function(_0x15594e,_0x2b0223){var _0x38ebfe=_['values'](_0xd19a9f['queueChannels']);_0x15594e({'count':_0x38ebfe['length'],'rows':_0x38ebfe});});},'VoiceQueuesChannel':function(_0x1dc438){var _0xbb4b96=this;return new Promise(function(_0xcd7864,_0x3e16a5){var _0x3de1ee=schema(properties[_0xade6('0x73')])[_0xade6('0x1')](_0x1dc438);if(_0x3de1ee[_0xade6('0x58')]>0x0){return _0x3e16a5(_0xbb4b96[_0xade6('0x10')](0x1f4,_[_0xade6('0x5c')](_0x3de1ee,_0xade6('0x4b'))[_0xade6('0x14')](',\x20')));}var _0x2e29b8=_[_0xade6('0x63')](_0xd19a9f[_0xade6('0x74')],{'uniqueid':_0x1dc438[_0xade6('0x5d')]});if(_0x2e29b8){_0xcd7864(_0x2e29b8);}else{return _0x3e16a5(_0xbb4b96[_0xade6('0x10')](0x1f5,_0xade6('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x48ab53){var _0x1fa60b=this;return new Promise(function(_0x56fae4,_0xa9772b){if(ami[_0xade6('0xf')]()==![]){return _0xa9772b(_0x1fa60b[_0xade6('0x10')](0x1f4,[config[_0xade6('0x11')]['ip'],config[_0xade6('0x11')][_0xade6('0x12')],_0xade6('0x13')]['join']('\x20')));}var _0xeb58b2=schema(properties[_0xade6('0x75')])['validate'](_0x48ab53);if(_0xeb58b2[_0xade6('0x58')]>0x0){return _0xa9772b(_0x1fa60b['error'](0x1f4,_['map'](_0xeb58b2,_0xade6('0x4b'))[_0xade6('0x14')](',\x20')));}var _0x35a7e8=_['find'](_0xd19a9f[_0xade6('0x74')],{'uniqueid':_0x48ab53[_0xade6('0x5d')]});if(_0x35a7e8&&_0x35a7e8[_0xade6('0x5e')]){return ami['Action']({'action':_0xade6('0x76'),'channel':_0x35a7e8['channel']})['then'](function(_0x4a5aa4){_0x56fae4({'code':0xc8,'message':[_0x48ab53[_0xade6('0x5d')],_0x4a5aa4['message'][_0xade6('0x65')]()]['join']('\x20')});})['catch'](function(_0x44d88d){_0xa9772b(_0x1fa60b[_0xade6('0x10')](0x1f5,[_0x48ab53[_0xade6('0x5d')],_0x44d88d[_0xade6('0x4b')][_0xade6('0x65')]()][_0xade6('0x14')]('\x20')));});}else{return _0xa9772b(_0x1fa60b['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x485493){var _0x3cb4ae=this;return new Promise(function(_0x18dcdd,_0x4ce415){if(ami[_0xade6('0xf')]()==![]){return _0x4ce415(_0x3cb4ae[_0xade6('0x10')](0x1f4,[config[_0xade6('0x11')]['ip'],config[_0xade6('0x11')][_0xade6('0x12')],_0xade6('0x13')][_0xade6('0x14')]('\x20')));}var _0x366dc1=schema(properties[_0xade6('0x77')])['validate'](_0x485493);if(_0x366dc1[_0xade6('0x58')]>0x0){return _0x4ce415(_0x3cb4ae[_0xade6('0x10')](0x1f4,_[_0xade6('0x5c')](_0x366dc1,_0xade6('0x4b'))[_0xade6('0x14')](',\x20')));}var _0x5695da=_[_0xade6('0x63')](_0xd19a9f[_0xade6('0x74')],{'uniqueid':_0x485493[_0xade6('0x5d')]});if(_0x5695da&&_0x5695da[_0xade6('0x5e')]){return ami['Action']({'action':'Redirect','channel':_0x5695da['channel'],'exten':_0x485493[_0xade6('0x78')],'context':_0x485493[_0xade6('0x79')]||_0x5695da[_0xade6('0x79')],'priority':0x1})[_0xade6('0x1d')](function(_0x1a955d){_0x18dcdd({'code':0xc8,'message':[_0x485493[_0xade6('0x5d')],_0x1a955d[_0xade6('0x4b')][_0xade6('0x65')]()]['join']('\x20')});})[_0xade6('0x1a')](function(_0x18445d){_0x4ce415(_0x3cb4ae['error'](0x1f5,[_0x485493[_0xade6('0x5d')],_0x18445d[_0xade6('0x4b')][_0xade6('0x65')]()][_0xade6('0x14')]('\x20')));});}else{return _0x4ce415(_0x3cb4ae[_0xade6('0x10')](0x1f5,_0xade6('0x6c')));}});},'Agents':function(_0xcc1d42){return new Promise(function(_0x4690d4,_0x3a0f2b){var _0x87e5d3=_[_0xade6('0x59')](_0xd19a9f[_0xade6('0xb')]);_0x4690d4({'count':_0x87e5d3[_0xade6('0x58')],'rows':_0x87e5d3});});},'Telephones':function(_0x17275c){return new Promise(function(_0x27d91c,_0x5c739a){var _0x433c52=_['values'](_0xd19a9f[_0xade6('0x7a')]);_0x27d91c({'count':_0x433c52[_0xade6('0x58')],'rows':_0x433c52});});},'Trunks':function(_0x44a1b2){return new Promise(function(_0x26f560,_0x3ceeaa){var _0x3e12af=_[_0xade6('0x59')](_0xd19a9f['trunks']);_0x26f560({'count':_0x3e12af[_0xade6('0x58')],'rows':_0x3e12af});});},'OutboundChannels':function(_0xbb32ab){return new Promise(function(_0xfe2157,_0x200bfe){var _0x17e791=_[_0xade6('0x59')](_0xd19a9f[_0xade6('0x7b')]);_0xfe2157({'count':_0x17e791['length'],'rows':_0x17e791});});},'Outbound':function(_0x4c8c11){return new Promise(function(_0x229d2f,_0x28792d){_0x229d2f(_0xd19a9f[_0xade6('0x2b')]);});},'Campaigns':function(_0x2907f7){return new Promise(function(_0x2c8575,_0x1348be){var _0x4dc3c1=_[_0xade6('0x59')](_0xd19a9f[_0xade6('0x7c')]);_0x2c8575({'count':_0x4dc3c1['length'],'rows':_0x4dc3c1});});},'VoiceQueuesPreview':function(_0x12dca4){var _0x96118e=this;return new Promise(function(_0x55ecf7,_0x1bb3fd){_0x26daf5[_0xade6('0x7d')](_0x12dca4['id'])[_0xade6('0x1d')](function(_0x1a8466){_0x55ecf7({'code':0xc8,'message':_0x1a8466[_0xade6('0x4b')]});})['catch'](function(_0xc76fec){_0x1bb3fd(_0x96118e[_0xade6('0x10')](0x1f4,_0xc76fec[_0xade6('0x4b')]));});});},'EventManager':function(_0x3ed49a){var _0x11d812=this;return new Promise(function(_0x338d8f,_0x1d042b){if(!_0x3ed49a[_0xade6('0x7e')]){return _0x1d042b(_0x11d812[_0xade6('0x10')](0x1f4,_0xade6('0x7f')));}ami[_0xade6('0x80')](_0xade6('0x81')+_0x3ed49a[_0xade6('0x7e')],_0x3ed49a[_0xade6('0x4b')]);_0x338d8f({'code':0xc8,'message':_0x3ed49a});});},'FaxAccounts':function(_0x5444d3){return new Promise(function(_0x24b9ab,_0x150f87){var _0x2a26ed=_[_0xade6('0x59')](_0xd19a9f['faxAccounts']);_0x24b9ab({'count':_0x2a26ed[_0xade6('0x58')],'rows':_0x2a26ed});});},'SendFax':function(_0xd620){var _0x48bff9=this;return new Promise(function(_0x541d03,_0x3ed863){_0x5845a7['send'](_0xd620)['then'](function(_0x2d0555){_0x541d03({'code':0xc8,'message':_0x2d0555[_0xade6('0x4b')]});})[_0xade6('0x1a')](function(_0x4ac601){_0x3ed863(_0x48bff9['error'](0x1f4,_0x4ac601[_0xade6('0x4b')]));});});},'CheckAfterSend':function(_0x3640af){var _0x38db7b=this;return new Promise(function(_0x303985,_0x3184ef){_0x5845a7['checkAfterSend'](_0x3640af)['then'](function(_0xccae25){_0x303985({'code':0xc8,'message':_0xccae25[_0xade6('0x4b')]});})['catch'](function(_0x5e6981){_0x3184ef(_0x38db7b[_0xade6('0x10')](0x1f4,_0x5e6981['message']));});});}};var _0x5b525a=jayson[_0xade6('0x82')](_0x41c129)[_0xade6('0x83')]();_0x5b525a['on'](_0xade6('0x10'),function(_0x46f216){return _0x4f11eb(_0x46f216);});_0x5b525a['listen'](0x232a,'127.0.0.1',function(){console[_0xade6('0x84')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x127f95(_0xade6('0x85')+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 1282da5..2e69331 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 _0x7a54=['map','calleridnum','getContacts','then','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','[CM][%s][%s]\x20Autocreate\x20enabled','data4','isNil','routeId','destcalleridnum','calleridname','','Unknown','firstName','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','emit','exec','data1','data2','xmd-contactid2','isEmpty','ListId','data3','split','phone','$or'];(function(_0x556473,_0x3d6b76){var _0x151f27=function(_0x1d60a5){while(--_0x1d60a5){_0x556473['push'](_0x556473['shift']());}};_0x151f27(++_0x3d6b76);}(_0x7a54,0x106));var _0x47a5=function(_0x275d3f,_0x3e3a47){_0x275d3f=_0x275d3f-0x0;var _0x35624a=_0x7a54[_0x275d3f];return _0x35624a;};'use strict';var _=require(_0x47a5('0x0'));var BPromise=require(_0x47a5('0x1'));var Redis=require(_0x47a5('0x2'));var util=require('util');var config=require(_0x47a5('0x3'));var logger=require(_0x47a5('0x4'))('trigger');var cmContactRpc=require(_0x47a5('0x5'));config[_0x47a5('0x6')]=_[_0x47a5('0x7')](config[_0x47a5('0x6')],{'host':_0x47a5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47a5('0x6')]));function emit(_0x59199c,_0x343372,_0x30e405,_0x506eda,_0x194fb0){logger['info']('[CM][%s][%s]',_0x59199c,_0x343372['id'],_0x30e405,_0x506eda,JSON['stringify'](_0x194fb0));io['to'](_0x30e405)[_0x47a5('0x9')](_0x506eda,_0x194fb0);}exports[_0x47a5('0xa')]=function(_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){var _0x1f47f4,_0x69e4d4;var _0x2f399b={};var _0x250fad=Number(_0x49e844[_0x47a5('0xb')]);var _0xd308b8=_0x49e844[_0x47a5('0xc')]?Boolean(Number(_0x49e844['data2'])):![];if(_0x5de6d7[_0x47a5('0xd')]&&!_[_0x47a5('0xe')](_0x5de6d7[_0x47a5('0xd')]))_0x2f399b['id']=_0x5de6d7[_0x47a5('0xd')];if(!_0x2f399b['id']){_0x2f399b[_0x47a5('0xf')]=_0x250fad;var _0x620ee9=_0x49e844[_0x47a5('0x10')]&&_0x49e844[_0x47a5('0x10')]!=='0'?_0x49e844['data3'][_0x47a5('0x11')](','):[_0x47a5('0x12')];_0x2f399b[_0x47a5('0x13')]=_[_0x47a5('0x14')](_0x620ee9,function(_0x1ef44c){return{['field']:_0x5de6d7['routeId']?_0x5de6d7['destcalleridnum']:_0x5de6d7[_0x47a5('0x15')]};});}BPromise['resolve']()['then'](cmContactRpc[_0x47a5('0x16')]({'where':_0x2f399b}))[_0x47a5('0x17')](function(_0x2ce454){_0x69e4d4=_0x2ce454;if(!_[_0x47a5('0xe')](_0x69e4d4)){if(_0x69e4d4[_0x47a5('0x18')]===0x1){_0x1f47f4=_0x69e4d4[0x0];logger[_0x47a5('0x19')](_0x47a5('0x1a'),_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id'],_0x1f47f4['id']);}else{logger[_0x47a5('0x19')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id'],_[_0x47a5('0x14')](_0x69e4d4,'id')['join'](','));}return;}else{logger[_0x47a5('0x19')](_0x47a5('0x1c'),_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id']);if(_0xd308b8){logger['info'](_0x47a5('0x1d'),_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id']);var _0x23db32=_0x49e844[_0x47a5('0x1e')]&&_0x49e844['data4']!=='0'?_0x49e844[_0x47a5('0x1e')]:_0x47a5('0x12');var _0x513981={'ListId':_0x250fad,['creationField']:_[_0x47a5('0x1f')](_0x5de6d7[_0x47a5('0x20')])?_0x5de6d7[_0x47a5('0x15')]:_0x5de6d7[_0x47a5('0x21')]};if(_[_0x47a5('0x1f')](_0x5de6d7['routeId'])){_0x513981['firstName']=_0x5de6d7[_0x47a5('0x22')]&&_0x5de6d7['calleridname']!==_0x47a5('0x23')?_0x5de6d7['calleridname']:_0x47a5('0x24');}else{_0x513981[_0x47a5('0x25')]=_0x5de6d7[_0x47a5('0x26')]&&_0x5de6d7[_0x47a5('0x26')]!==_0x47a5('0x23')?_0x5de6d7[_0x47a5('0x26')]:_0x47a5('0x24');}return BPromise[_0x47a5('0x27')]()[_0x47a5('0x17')](cmContactRpc[_0x47a5('0x28')](_0x513981))[_0x47a5('0x17')](function(_0x11a4fa){_0x1f47f4=_0x11a4fa;if(_0x1f47f4){logger[_0x47a5('0x19')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id'],_0x1f47f4['id']);}return;});}else{logger['info'](_0x47a5('0x29'),_0x5de6d7[_0x47a5('0x1b')],_0x2eb0dd['id']);return;}}})[_0x47a5('0x17')](function(){if(_0x5e31dd){emit(_0x5de6d7['uniqueid'],_0x2eb0dd,util[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x5e31dd[_0x47a5('0x2c')]),util[_0x47a5('0x2a')]('trigger:%s',_0x49e844['action'][_0x47a5('0x2d')]()),{'evt':_[_0x47a5('0x2e')](_0x5de6d7,{'autoCreate':_0xd308b8}),'contact':_0x1f47f4,'contacts':!_0x1f47f4?_0x69e4d4:undefined});}});}; \ No newline at end of file +var _0x2a9a=['destcalleridname','then','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','trigger:%s','action','toLowerCase','lodash','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','xmd-contactid2','isEmpty','ListId','data3','phone','map','routeId','destcalleridnum','resolve','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Autocreate\x20enabled','data4','calleridnum','isNil','firstName','calleridname','','Unknown'];(function(_0x53e70c,_0x310fed){var _0x3e8443=function(_0x1b85e5){while(--_0x1b85e5){_0x53e70c['push'](_0x53e70c['shift']());}};_0x3e8443(++_0x310fed);}(_0x2a9a,0x64));var _0xa2a9=function(_0x4ffccc,_0x2576e6){_0x4ffccc=_0x4ffccc-0x0;var _0x349f01=_0x2a9a[_0x4ffccc];return _0x349f01;};'use strict';var _=require(_0xa2a9('0x0'));var BPromise=require('bluebird');var Redis=require(_0xa2a9('0x1'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0xa2a9('0x2'))(_0xa2a9('0x3'));var cmContactRpc=require(_0xa2a9('0x4'));config[_0xa2a9('0x5')]=_[_0xa2a9('0x6')](config['redis'],{'host':_0xa2a9('0x7'),'port':0x18eb});var io=require(_0xa2a9('0x8'))(new Redis(config[_0xa2a9('0x5')]));function emit(_0x2bd1f3,_0x5c1fb2,_0x5d933f,_0x540979,_0x523164){logger[_0xa2a9('0x9')](_0xa2a9('0xa'),_0x2bd1f3,_0x5c1fb2['id'],_0x5d933f,_0x540979,JSON[_0xa2a9('0xb')](_0x523164));io['to'](_0x5d933f)[_0xa2a9('0xc')](_0x540979,_0x523164);}exports['exec']=function(_0x2daf1c,_0x375682,_0x5e9222,_0x149ebe){var _0x77ffee,_0x312aa9;var _0x302ca3={};var _0x4fb822=Number(_0x5e9222[_0xa2a9('0xd')]);var _0x252808=_0x5e9222[_0xa2a9('0xe')]?Boolean(Number(_0x5e9222[_0xa2a9('0xe')])):![];if(_0x149ebe[_0xa2a9('0xf')]&&!_[_0xa2a9('0x10')](_0x149ebe['xmd-contactid2']))_0x302ca3['id']=_0x149ebe[_0xa2a9('0xf')];if(!_0x302ca3['id']){_0x302ca3[_0xa2a9('0x11')]=_0x4fb822;var _0x4e4078=_0x5e9222['data3']&&_0x5e9222['data3']!=='0'?_0x5e9222[_0xa2a9('0x12')]['split'](','):[_0xa2a9('0x13')];_0x302ca3['$or']=_[_0xa2a9('0x14')](_0x4e4078,function(_0x11838f){return{['field']:_0x149ebe[_0xa2a9('0x15')]?_0x149ebe[_0xa2a9('0x16')]:_0x149ebe['calleridnum']};});}BPromise[_0xa2a9('0x17')]()['then'](cmContactRpc[_0xa2a9('0x18')]({'where':_0x302ca3}))['then'](function(_0x398419){_0x312aa9=_0x398419;if(!_['isEmpty'](_0x312aa9)){if(_0x312aa9[_0xa2a9('0x19')]===0x1){_0x77ffee=_0x312aa9[0x0];logger[_0xa2a9('0x9')](_0xa2a9('0x1a'),_0x149ebe[_0xa2a9('0x1b')],_0x375682['id'],_0x77ffee['id']);}else{logger[_0xa2a9('0x9')](_0xa2a9('0x1c'),_0x149ebe[_0xa2a9('0x1b')],_0x375682['id'],_[_0xa2a9('0x14')](_0x312aa9,'id')[_0xa2a9('0x1d')](','));}return;}else{logger[_0xa2a9('0x9')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x149ebe[_0xa2a9('0x1b')],_0x375682['id']);if(_0x252808){logger[_0xa2a9('0x9')](_0xa2a9('0x1e'),_0x149ebe[_0xa2a9('0x1b')],_0x375682['id']);var _0x313c59=_0x5e9222[_0xa2a9('0x1f')]&&_0x5e9222['data4']!=='0'?_0x5e9222[_0xa2a9('0x1f')]:'phone';var _0x4de5fd={'ListId':_0x4fb822,['creationField']:_['isNil'](_0x149ebe[_0xa2a9('0x15')])?_0x149ebe[_0xa2a9('0x20')]:_0x149ebe['destcalleridnum']};if(_[_0xa2a9('0x21')](_0x149ebe[_0xa2a9('0x15')])){_0x4de5fd[_0xa2a9('0x22')]=_0x149ebe[_0xa2a9('0x23')]&&_0x149ebe['calleridname']!==_0xa2a9('0x24')?_0x149ebe[_0xa2a9('0x23')]:_0xa2a9('0x25');}else{_0x4de5fd['firstName']=_0x149ebe[_0xa2a9('0x26')]&&_0x149ebe[_0xa2a9('0x26')]!==_0xa2a9('0x24')?_0x149ebe['destcalleridname']:'Unknown';}return BPromise['resolve']()[_0xa2a9('0x27')](cmContactRpc[_0xa2a9('0x28')](_0x4de5fd))[_0xa2a9('0x27')](function(_0xca45e8){_0x77ffee=_0xca45e8;if(_0x77ffee){logger[_0xa2a9('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x149ebe[_0xa2a9('0x1b')],_0x375682['id'],_0x77ffee['id']);}return;});}else{logger[_0xa2a9('0x9')](_0xa2a9('0x29'),_0x149ebe[_0xa2a9('0x1b')],_0x375682['id']);return;}}})[_0xa2a9('0x27')](function(){if(_0x2daf1c){emit(_0x149ebe['uniqueid'],_0x375682,util['format'](_0xa2a9('0x2a'),_0x2daf1c['name']),util['format'](_0xa2a9('0x2b'),_0x5e9222[_0xa2a9('0x2c')][_0xa2a9('0x2d')]()),{'evt':_['merge'](_0x149ebe,{'autoCreate':_0x252808}),'contact':_0x77ffee,'contacts':!_0x77ffee?_0x312aa9:undefined});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index dae0008..fc6daf0 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 _0x3f11=['./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','html','data2','render','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','600','winApplication','winArguments','format','name','trigger:%s:%s','jscripty','user:%s','trigger:%s','exec','integration','urlforward','parse','query','search','replace','every','checkConditions','AnyConditions','channel','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','queue','membername','lastevent','routeId','exports','util','ioredis','./urlforward'];(function(_0x3ec751,_0x3009cd){var _0x252150=function(_0x5091e8){while(--_0x5091e8){_0x3ec751['push'](_0x3ec751['shift']());}};_0x252150(++_0x3009cd);}(_0x3f11,0x6c));var _0x13f1=function(_0x4f9ae8,_0x1e0972){_0x4f9ae8=_0x4f9ae8-0x0;var _0x5cb56e=_0x3f11[_0x4f9ae8];return _0x5cb56e;};'use strict';var util=require(_0x13f1('0x0'));var _=require('lodash');var url=require('url');var Mustache=require('mustache');var Redis=require(_0x13f1('0x1'));var urlforward=require(_0x13f1('0x2'));var integration=require('./integration');var cmContact=require(_0x13f1('0x3'));var script=require('./script');var config=require(_0x13f1('0x4'));var logger=require(_0x13f1('0x5'))(_0x13f1('0x6'));var ami=require(_0x13f1('0x7'));config[_0x13f1('0x8')]=_[_0x13f1('0x9')](config[_0x13f1('0x8')],{'host':_0x13f1('0xa'),'port':0x18eb});var io=require(_0x13f1('0xb'))(new Redis(config[_0x13f1('0x8')]));var operators={'equals':function(_0x48c547,_0x374905){return _0x48c547==_0x374905;},'not_equals':function(_0x2e7dcb,_0x41a59f){return _0x2e7dcb!=_0x41a59f;}};var barAndWebActions=[_0x13f1('0xc'),_0x13f1('0xd'),_0x13f1('0xe')];function Trigger(_0x40cc69){this[_0x13f1('0xf')]=_0x40cc69[_0x13f1('0xf')];this[_0x13f1('0x10')]=_0x40cc69['agents'];this[_0x13f1('0x11')]=_0x40cc69[_0x13f1('0x11')];this[_0x13f1('0x12')]=_0x40cc69[_0x13f1('0x12')];this[_0x13f1('0x13')]=_0x40cc69[_0x13f1('0x13')];this[_0x13f1('0x14')]=_0x40cc69['zendeskAccounts'];this[_0x13f1('0x15')]=_0x40cc69[_0x13f1('0x15')];this[_0x13f1('0x16')]=_0x40cc69[_0x13f1('0x16')];this[_0x13f1('0x17')]=_0x40cc69['sugarcrmAccounts'];this[_0x13f1('0x18')]=_0x40cc69[_0x13f1('0x18')];this[_0x13f1('0x19')]=_0x40cc69['deskAccounts'];this[_0x13f1('0x1a')]=_0x40cc69[_0x13f1('0x1a')];this[_0x13f1('0x1b')]=_0x40cc69[_0x13f1('0x1b')];this[_0x13f1('0x1c')]=_0x40cc69['dynamics365Accounts'];this[_0x13f1('0x1d')]=_0x40cc69[_0x13f1('0x1d')];this[_0x13f1('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x13f1('0x16')],'freshdesk':this[_0x13f1('0x15')],'sugarcrm':this[_0x13f1('0x17')],'zoho':this[_0x13f1('0x18')],'desk':this[_0x13f1('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x13f1('0x1c')],'freshsales':this[_0x13f1('0x1d')],'servicenow':this[_0x13f1('0x1b')]};ami['on']('custom:agentcalled',this[_0x13f1('0x1f')]['bind'](this));ami['on'](_0x13f1('0x20'),this['syncCustomEvent'][_0x13f1('0x21')](this));ami['on']('custom:agentringnoanswer',this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x22'),this[_0x13f1('0x1f')]['bind'](this));ami['on'](_0x13f1('0x23'),this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x24'),this['syncCustomEvent'][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on']('custom:agentreject',this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on']('custom:queuecallerabandon',this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x26'),this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x27'),this[_0x13f1('0x28')][_0x13f1('0x21')](this));ami['on']('custom:dialconnect',this[_0x13f1('0x28')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x29'),this[_0x13f1('0x28')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x2a'),this[_0x13f1('0x1f')]['bind'](this));ami['on']('custom:closedinteraction',this[_0x13f1('0x1f')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x2b'),this[_0x13f1('0x1f')][_0x13f1('0x21')](this));ami['on'](_0x13f1('0x2c'),this[_0x13f1('0x1f')]['bind'](this));ami['on'](_0x13f1('0x2d'),this[_0x13f1('0x1f')]['bind'](this));}Trigger[_0x13f1('0x2e')][_0x13f1('0x2f')]=function(_0x551ebd,_0x14a5d1,_0x34aa08){logger['info'](_0x551ebd,_0x14a5d1,JSON[_0x13f1('0x30')](_0x34aa08));io['to'](_0x551ebd)[_0x13f1('0x2f')](_0x14a5d1,_0x34aa08);};Trigger[_0x13f1('0x2e')][_0x13f1('0x1f')]=function(_0x5db2e2){var _0x17e364=_[_0x13f1('0x31')](_0x5db2e2);this[_0x13f1('0x32')](_0x17e364);};Trigger[_0x13f1('0x2e')][_0x13f1('0x28')]=function(_0x3d51b2){if(this[_0x13f1('0x10')][_0x3d51b2[_0x13f1('0x33')]]){this[_0x13f1('0x1f')](_0x3d51b2);}};Trigger[_0x13f1('0x2e')][_0x13f1('0x32')]=function(_0x1f94e7){var _0x1c883a;for(var _0x4bf36f in this[_0x13f1('0xf')]){if(this[_0x13f1('0xf')][_0x13f1('0x34')](_0x4bf36f)){if(this[_0x13f1('0xf')][_0x4bf36f]['status']){_0x1c883a=this[_0x13f1('0x35')](this['triggers'][_0x4bf36f],_0x1f94e7);if(_0x1c883a){_[_0x13f1('0x36')](_0x1f94e7,_0x1f94e7[_0x13f1('0x37')]);for(var _0x208084=0x0,_0x21d07e,_0x452774,_0x370e03;_0x2080840x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ No newline at end of file +var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ 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 419c568..03d6a5a 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 _0xe94a=['ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecalls','callDirection','queue','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','format','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum','contacts','4.0','headers','lastIndexOf','contacts?$select=telephone1','toLowerCase','telephone1','enduserId','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','nameField','customField','substring','indexOf','content'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xe94a,0x87));var _0xae94=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0xe94a[_0x81dcac];return _0xc7803b;};'use strict';var _=require(_0xae94('0x0'));var BPromise=require(_0xae94('0x1'));var rp=require(_0xae94('0x2'));var util=require(_0xae94('0x3'));var intUtil=require(_0xae94('0x4'));var md5=require(_0xae94('0x5'));var Redis=require(_0xae94('0x6'));var logger=require(_0xae94('0x7'))('dynamics365');var config=require(_0xae94('0x8'));config[_0xae94('0x9')]=_[_0xae94('0xa')](config[_0xae94('0x9')],{'host':_0xae94('0xb'),'port':0x18eb});var io=require(_0xae94('0xc'))(new Redis(config[_0xae94('0x9')]));function getAuthToken(_0xb7489b,_0x587b86,_0x2cbf55){var _0x30b292={'method':_0xae94('0xd'),'uri':_0x587b86,'form':{'client_id':_0xb7489b[_0xae94('0xe')],'resource':_0xb7489b[_0xae94('0xf')],'username':_0xb7489b[_0xae94('0x10')],'password':_0xb7489b['password'],'grant_type':_0xae94('0x11'),'client_secret':_0xb7489b[_0xae94('0x12')]},'json':!![]};return rp(_0x30b292)[_0xae94('0x13')](function(_0x18df14){return _0x18df14[_0xae94('0x14')];})[_0xae94('0x15')](function(_0x100f9a){logger[_0xae94('0x16')]('['+[_0x2cbf55['toUpperCase']()]+_0xae94('0x17'));return _0x100f9a[_0xae94('0x18')];});}function getUser(_0x38dc4f,_0x3bca3a,_0x51b4fb,_0x4d2261,_0x44bbf0,_0x190cef){return new BPromise(function(_0x1db87f,_0x3272ff){return getAuthToken(_0x3bca3a,_0x4d2261,_0x190cef)[_0xae94('0x13')](function(_0xca358d){var _0x3d407f={'method':_0xae94('0x19'),'uri':_0x44bbf0+_0xae94('0x1a'),'headers':{'Authorization':_0xae94('0x1b')+_0xca358d,'OData-Version':'4.0'},'json':!![]};return rp(_0x3d407f);})[_0xae94('0x13')](function(_0x5bbd21){var _0x2ba14b=_0x5bbd21['value'];var _0x57bdfb=![];var _0x129478=null;if(!_['isNil'](_0x51b4fb)){if(intUtil[_0xae94('0x1c')](_0x51b4fb[_0xae94('0x1d')])){_0x38dc4f[_0xae94('0x1e')]=_0x51b4fb[_0xae94('0x1d')];for(_0x129478=0x0;_0x129478<_0x2ba14b[_0xae94('0x1f')];_0x129478++){if(_0x2ba14b[_0x129478][_0xae94('0x20')]===_0x51b4fb['email']&&!_0x2ba14b[_0x129478][_0xae94('0x21')]){_0x57bdfb=!![];logger['info']('['+[_0x190cef[_0xae94('0x22')]()]+_0xae94('0x23')+_0x2ba14b[_0x129478][_0xae94('0x24')]+'!');_0x38dc4f[_0xae94('0x25')]=_0x2ba14b[_0x129478][_0xae94('0x24')];}}}}if(!_0x57bdfb){logger['info']('['+[_0x190cef[_0xae94('0x22')]()]+_0xae94('0x26'));_0x38dc4f[_0xae94('0x1e')]=_0x3bca3a['username'];for(_0x129478=0x0;_0x129478<_0x2ba14b[_0xae94('0x1f')];_0x129478++){if(_0x2ba14b[_0x129478][_0xae94('0x20')]===_0x3bca3a[_0xae94('0x10')]){_0x38dc4f[_0xae94('0x25')]=_0x2ba14b[_0x129478][_0xae94('0x24')];}}}_0x1db87f(_0x38dc4f);})['catch'](function(_0x16322d){_0x3272ff(_0x16322d[_0xae94('0x18')]);});});}function createEndUser(_0x4afe41,_0xdd475f,_0x53a509,_0x25477c,_0x41a7b2,_0x3241cb){return new BPromise(function(_0xdc4adf,_0x28fa81){return getAuthToken(_0xdd475f,_0x53a509,_0x3241cb)[_0xae94('0x13')](function(_0x4b9c93){var _0x4fd30e=_0x3241cb['toLowerCase']()===_0xae94('0x27')?_0x41a7b2[_0xae94('0x28')]:_0x41a7b2[_0xae94('0x29')];var _0x4741c6={'method':_0xae94('0xd'),'uri':_0x25477c+_0xae94('0x2a'),'body':{'telephone1':_0x4fd30e,'fullname':_0x4fd30e,'firstname':_0x4fd30e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4afe41[_0xae94('0x25')]+')'},'headers':{'Authorization':_0xae94('0x1b')+_0x4b9c93,'OData-Version':_0xae94('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4741c6);})['then'](function(_0x51645d){var _0x516b53=_0x51645d[_0xae94('0x2c')]['odata-entityid'];var _0x31f9bb=_0x516b53['substring'](_0x516b53[_0xae94('0x2d')]('(')+0x1,_0x516b53[_0xae94('0x2d')](')'));_0x4afe41['enduserId']=_0x31f9bb;_0xdc4adf(_0x4afe41);})['catch'](function(_0x48c7df){_0x28fa81(_0x48c7df[_0xae94('0x18')]);});});}function getEndUser(_0x1bb10c,_0x324d49,_0x549917,_0x57edf6,_0x5eb4f4,_0x2c00ba){return new BPromise(function(_0xd9ba5a,_0x35abc1){return getAuthToken(_0x324d49,_0x549917,_0x2c00ba)[_0xae94('0x13')](function(_0x427e0b){var _0x2f1c2b={'method':'GET','uri':_0x57edf6+_0xae94('0x2e'),'headers':{'Authorization':_0xae94('0x1b')+_0x427e0b,'If-None-Match':null,'OData-Version':_0xae94('0x2b')},'json':!![]};return rp(_0x2f1c2b);})[_0xae94('0x13')](function(_0x1438a4){var _0x2a63a9=null;if(_0x1438a4){var _0x13d796=_0x1438a4['value'];var _0x3614bf=![];for(_0x2a63a9=0x0;_0x2a63a9<_0x13d796[_0xae94('0x1f')];_0x2a63a9++){var _0x2442de=_0x2c00ba[_0xae94('0x2f')]()===_0xae94('0x27')?_0x5eb4f4['destcalleridnum']:_0x5eb4f4[_0xae94('0x29')];if(_0x13d796[_0x2a63a9][_0xae94('0x30')]===_0x2442de){_0x3614bf=!![];_0x1bb10c[_0xae94('0x31')]=_0x13d796[_0x2a63a9][_0xae94('0x32')];}}if(_0x3614bf){_0xd9ba5a(_0x1bb10c);}else{return createEndUser(_0x1bb10c,_0x324d49,_0x549917,_0x57edf6,_0x5eb4f4,_0x2c00ba)['then'](function(_0x15f249){logger[_0xae94('0x33')]('['+[_0x2c00ba['toUpperCase']()]+_0xae94('0x34'),_0x15f249[_0xae94('0x31')]);_0xd9ba5a(_0x15f249);});}}else{return createEndUser(_0x1bb10c,_0x324d49,_0x549917,_0x57edf6,_0x5eb4f4,_0x2c00ba)['then'](function(_0x46bd2c){logger[_0xae94('0x33')]('['+[_0x2c00ba[_0xae94('0x22')]()]+_0xae94('0x35'),_0x46bd2c['enduserId']);_0xd9ba5a(_0x46bd2c);});}});});}function getCustomFields(_0x132b46,_0x5a9d39,_0x1b6f04){var _0x4a1de4={};if(_0x132b46['length']>0x0){_[_0xae94('0x36')](_0x132b46,function(_0xd5b1b4){if(_0xd5b1b4['type']===_0xae94('0x37')&&_0xd5b1b4[_0xae94('0x38')]&&!_0xd5b1b4[_0xae94('0x39')]){var _0x3ad666=_0xd5b1b4['idField'][_0xae94('0x2f')]();var _0x5d3775=_0x3ad666[_0xae94('0x3a')](0x0,_0x3ad666[_0xae94('0x3b')]('_'));var _0x44df08=_0x3ad666[_0xae94('0x3a')](_0x3ad666[_0xae94('0x3b')]('_')+0x1);if(_0x5d3775===_0x1b6f04){_0x4a1de4[_0x44df08]=_0xd5b1b4[_0xae94('0x3c')];}}});}return _0x4a1de4;}function getTicket(_0x5eb988,_0x545aec,_0x495aa3,_0x3f8e53,_0x4b8a65,_0x4dc8ec,_0x13b5bb){return new BPromise(function(_0x404249,_0x509aa2){var _0xe95087;return getAuthToken(_0x545aec,_0x495aa3,_0x13b5bb)[_0xae94('0x13')](function(_0x4862c2){if(_0x4dc8ec[_0xae94('0x3d')]===_0xae94('0x3e')){_0xe95087={'method':_0xae94('0xd'),'uri':_0x3f8e53+'incidents','body':Object[_0xae94('0x3f')]({},{'title':intUtil[_0xae94('0x40')](_0x4dc8ec[_0xae94('0x41')],_0x4b8a65,'\x20'),'description':intUtil[_0xae94('0x40')](_0x4dc8ec[_0xae94('0x42')],_0x4b8a65,'\x0a'),'customerid_contact@odata.bind':_0xae94('0x43')+_0x5eb988['enduserId']+')','ownerid@odata.bind':_0xae94('0x44')+_0x5eb988[_0xae94('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x4dc8ec[_0xae94('0x45')],_0x4b8a65,_0x4dc8ec[_0xae94('0x3d')])),'headers':{'Authorization':_0xae94('0x1b')+_0x4862c2,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4dc8ec[_0xae94('0x3d')]==='phonecall'){_0xe95087={'method':_0xae94('0xd'),'uri':_0x3f8e53+_0xae94('0x46'),'body':Object[_0xae94('0x3f')]({},{'subject':intUtil[_0xae94('0x40')](_0x4dc8ec[_0xae94('0x41')],_0x4b8a65,'\x20'),'phonenumber':String(_0x4b8a65['calleridnum']),'description':intUtil[_0xae94('0x40')](_0x4dc8ec[_0xae94('0x42')],_0x4b8a65,'\x0a'),'regardingobjectid_contact@odata.bind':_0xae94('0x43')+_0x5eb988['enduserId']+')','ownerid@odata.bind':_0xae94('0x44')+_0x5eb988['userId']+')','directioncode':_0x5eb988[_0xae94('0x47')]===_0xae94('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xae94('0x44')+_0x5eb988[_0xae94('0x25')]+')','participationtypemask':_0x5eb988[_0xae94('0x47')]===_0xae94('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0xae94('0x43')+_0x5eb988[_0xae94('0x31')]+')','participationtypemask':_0x5eb988['callDirection']===_0xae94('0x48')?0x1:0x2}]},getCustomFields(_0x4dc8ec['Fields'],_0x4b8a65,_0x4dc8ec[_0xae94('0x3d')])),'headers':{'Authorization':_0xae94('0x1b')+_0x4862c2,'OData-Version':_0xae94('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xe95087);})[_0xae94('0x13')](function(_0x502e34){var _0x4b5493=_0x502e34[_0xae94('0x2c')][_0xae94('0x49')];var _0x45afd2=_0x4b5493[_0xae94('0x3a')](_0x4b5493[_0xae94('0x2d')]('(')+0x1,_0x4b5493[_0xae94('0x2d')](')'));_0x5eb988[_0xae94('0x4a')]=_0x45afd2;_0x404249(_0x5eb988);})[_0xae94('0x15')](function(_0x5b2260){_0x509aa2(_0x5b2260[_0xae94('0x18')]);});});}function emit(_0x2088a6,_0x5e4dc5,_0x364917,_0x20c215){var _0x32a306={'uri':util['format'](_0xae94('0x4b'),_0x2088a6,_0x364917,_0x20c215)};io['to'](util['format'](_0xae94('0x4c'),_0x5e4dc5))['emit'](_0xae94('0x4d'),_0x32a306);}exports['cs']=function(_0x39d7b0,_0x1a3f8a,_0x25bdae,_0x6a2f21,_0x55f75b,_0x28998b,_0x853e9f,_0x4eda9b){var _0x408592={};_0x28998b['remoteUri']=intUtil[_0xae94('0x4e')](_0x28998b[_0xae94('0xf')]);_0x28998b['serverUrl']=intUtil[_0xae94('0x4e')](_0x28998b[_0xae94('0x4f')]);_0x408592[_0xae94('0x47')]=_0x4eda9b===_0xae94('0x48')||_0x4eda9b===_0xae94('0x50')?_0xae94('0x48'):_0xae94('0x27');var _0x129233=util[_0xae94('0x51')](_0xae94('0x52'),_0x28998b[_0xae94('0xf')]);var _0x797863=util[_0xae94('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x28998b[_0xae94('0x53')]);var _0x572daf=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28998b['serverUrl'],_0x1a3f8a['uniqueid'],md5(_0x1a3f8a[_0xae94('0x54')]));if(_0x55f75b&&_0x55f75b[_0xae94('0x55')]){logger[_0xae94('0x33')](_0xae94('0x56'),_0xae94('0x57'));_0x1a3f8a[_0xae94('0x58')]=_0x572daf;}else if(_0x853e9f&&_0x853e9f[_0xae94('0x59')]&&_0x853e9f[_0xae94('0x59')]!=='none'){logger[_0xae94('0x33')]('[OUTBOUND]',_0xae94('0x57'));_0x1a3f8a[_0xae94('0x58')]=_0x572daf;}else{_0x1a3f8a[_0xae94('0x58')]='';}return getUser(_0x408592,_0x28998b,_0x6a2f21,_0x797863,_0x129233,_0x4eda9b)[_0xae94('0x13')](function(_0x180dc0){logger[_0xae94('0x33')]('['+_0x4eda9b[_0xae94('0x22')]()+']\x20The\x20User\x20ID\x20is:',_0x180dc0[_0xae94('0x25')]);logger[_0xae94('0x33')]('['+_0x4eda9b[_0xae94('0x22')]()+_0xae94('0x5a'),_0x180dc0[_0xae94('0x1e')]);return getEndUser(_0x180dc0,_0x28998b,_0x797863,_0x129233,_0x1a3f8a,_0x4eda9b);})[_0xae94('0x13')](function(_0x5ed941){logger[_0xae94('0x33')]('['+_0x4eda9b[_0xae94('0x22')]()+_0xae94('0x5b'),_0x5ed941['enduserId']);logger[_0xae94('0x33')]('['+_0x4eda9b[_0xae94('0x22')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x1a3f8a[_0xae94('0x29')]);return getTicket(_0x5ed941,_0x28998b,_0x797863,_0x129233,_0x1a3f8a,_0x25bdae,_0x4eda9b);})[_0xae94('0x13')](function(_0x19ccd0){logger['info'](util[_0xae94('0x51')]('['+_0x4eda9b[_0xae94('0x22')]()+_0xae94('0x5c'),_0x25bdae[_0xae94('0x3d')],_0x19ccd0[_0xae94('0x4a')]));logger[_0xae94('0x33')](util['format']('['+_0x4eda9b['toUpperCase']()+_0xae94('0x5d'),_0x4eda9b));if(_0x4eda9b!==_0xae94('0x50')){logger[_0xae94('0x33')]('['+_0x4eda9b['toUpperCase']()+']',_0xae94('0x5e'));emit(_0x28998b[_0xae94('0xf')],_0x6a2f21[_0xae94('0x5f')],_0x25bdae[_0xae94('0x3d')],_0x19ccd0[_0xae94('0x4a')]);}})[_0xae94('0x15')](function(_0x197c11){logger['error']('['+_0x4eda9b[_0xae94('0x22')]()+_0xae94('0x60'),util[_0xae94('0x61')](_0x197c11,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x47b0=['https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1','Bearer\x20','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Descriptions','/contacts(','Subjects','callDirection','queue','Fields','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x47b0,0xd6));var _0x047b=function(_0x5f2481,_0x313fd9){_0x5f2481=_0x5f2481-0x0;var _0x49f81f=_0x47b0[_0x5f2481];return _0x49f81f;};'use strict';var _=require(_0x047b('0x0'));var BPromise=require('bluebird');var rp=require(_0x047b('0x1'));var util=require('util');var intUtil=require(_0x047b('0x2'));var md5=require(_0x047b('0x3'));var Redis=require(_0x047b('0x4'));var logger=require(_0x047b('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_[_0x047b('0x6')](config[_0x047b('0x7')],{'host':_0x047b('0x8'),'port':0x18eb});var io=require(_0x047b('0x9'))(new Redis(config[_0x047b('0x7')]));function getAuthToken(_0x131cbf,_0xf6dc66,_0x51c424){var _0x290320={'method':_0x047b('0xa'),'uri':_0xf6dc66,'form':{'client_id':_0x131cbf[_0x047b('0xb')],'resource':_0x131cbf[_0x047b('0xc')],'username':_0x131cbf['username'],'password':_0x131cbf['password'],'grant_type':_0x047b('0xd'),'client_secret':_0x131cbf[_0x047b('0xe')]},'json':!![]};return rp(_0x290320)['then'](function(_0x2d618d){return _0x2d618d[_0x047b('0xf')];})[_0x047b('0x10')](function(_0x24f89a){logger[_0x047b('0x11')]('['+[_0x51c424[_0x047b('0x12')]()]+_0x047b('0x13'));return _0x24f89a[_0x047b('0x14')];});}function getUser(_0x394496,_0x127699,_0x54b58f,_0x2b5c2a,_0x2224c6,_0x1736d4){return new BPromise(function(_0x12980a,_0x57e747){return getAuthToken(_0x127699,_0x2b5c2a,_0x1736d4)[_0x047b('0x15')](function(_0x273f21){var _0x42dde8={'method':_0x047b('0x16'),'uri':_0x2224c6+_0x047b('0x17'),'headers':{'Authorization':'Bearer\x20'+_0x273f21,'OData-Version':_0x047b('0x18')},'json':!![]};return rp(_0x42dde8);})[_0x047b('0x15')](function(_0x3bde29){var _0x1e2cf2=_0x3bde29[_0x047b('0x19')];var _0x174146=![];var _0x1344dd=null;if(!_[_0x047b('0x1a')](_0x54b58f)){if(intUtil[_0x047b('0x1b')](_0x54b58f[_0x047b('0x1c')])){_0x394496[_0x047b('0x1d')]=_0x54b58f[_0x047b('0x1c')];for(_0x1344dd=0x0;_0x1344dd<_0x1e2cf2[_0x047b('0x1e')];_0x1344dd++){if(_0x1e2cf2[_0x1344dd][_0x047b('0x1f')]===_0x54b58f['email']&&!_0x1e2cf2[_0x1344dd][_0x047b('0x20')]){_0x174146=!![];logger[_0x047b('0x21')]('['+[_0x1736d4[_0x047b('0x12')]()]+_0x047b('0x22')+_0x1e2cf2[_0x1344dd][_0x047b('0x23')]+'!');_0x394496[_0x047b('0x24')]=_0x1e2cf2[_0x1344dd][_0x047b('0x23')];}}}}if(!_0x174146){logger[_0x047b('0x21')]('['+[_0x1736d4[_0x047b('0x12')]()]+_0x047b('0x25'));_0x394496[_0x047b('0x1d')]=_0x127699[_0x047b('0x26')];for(_0x1344dd=0x0;_0x1344dd<_0x1e2cf2['length'];_0x1344dd++){if(_0x1e2cf2[_0x1344dd][_0x047b('0x1f')]===_0x127699[_0x047b('0x26')]){_0x394496[_0x047b('0x24')]=_0x1e2cf2[_0x1344dd][_0x047b('0x23')];}}}_0x12980a(_0x394496);})[_0x047b('0x10')](function(_0x3440ce){_0x57e747(_0x3440ce['message']);});});}function createEndUser(_0x8e6fba,_0x170fd5,_0x323d94,_0x1a80c1,_0x2b6b39,_0x526bb9){return new BPromise(function(_0x361f44,_0x58f41f){return getAuthToken(_0x170fd5,_0x323d94,_0x526bb9)[_0x047b('0x15')](function(_0x26001c){var _0x451417=_0x526bb9[_0x047b('0x27')]()===_0x047b('0x28')?_0x2b6b39[_0x047b('0x29')]:_0x2b6b39[_0x047b('0x2a')];var _0xf2ab03={'method':_0x047b('0xa'),'uri':_0x1a80c1+_0x047b('0x2b'),'body':{'telephone1':_0x451417,'fullname':_0x451417,'firstname':_0x451417,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x047b('0x2c')+_0x8e6fba[_0x047b('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x26001c,'OData-Version':_0x047b('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf2ab03);})[_0x047b('0x15')](function(_0x2899f7){var _0x211223=_0x2899f7[_0x047b('0x2d')]['odata-entityid'];var _0x4c63bc=_0x211223[_0x047b('0x2e')](_0x211223[_0x047b('0x2f')]('(')+0x1,_0x211223[_0x047b('0x2f')](')'));_0x8e6fba[_0x047b('0x30')]=_0x4c63bc;_0x361f44(_0x8e6fba);})['catch'](function(_0x345779){_0x58f41f(_0x345779[_0x047b('0x14')]);});});}function getEndUser(_0x106476,_0x4c9391,_0x2a6048,_0xc9e29e,_0x3de44b,_0x1f2bfc){return new BPromise(function(_0x420ba2,_0x565490){return getAuthToken(_0x4c9391,_0x2a6048,_0x1f2bfc)[_0x047b('0x15')](function(_0x49ac2b){var _0x3b87de={'method':_0x047b('0x16'),'uri':_0xc9e29e+_0x047b('0x31'),'headers':{'Authorization':_0x047b('0x32')+_0x49ac2b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3b87de);})[_0x047b('0x15')](function(_0x260e5a){var _0x2f0bb1=null;if(_0x260e5a){var _0x21ce23=_0x260e5a[_0x047b('0x19')];var _0x284cd2=![];for(_0x2f0bb1=0x0;_0x2f0bb1<_0x21ce23[_0x047b('0x1e')];_0x2f0bb1++){var _0x2e8a21=_0x1f2bfc[_0x047b('0x27')]()==='outbound'?_0x3de44b[_0x047b('0x29')]:_0x3de44b[_0x047b('0x2a')];if(_0x21ce23[_0x2f0bb1][_0x047b('0x33')]===_0x2e8a21){_0x284cd2=!![];_0x106476[_0x047b('0x30')]=_0x21ce23[_0x2f0bb1][_0x047b('0x34')];}}if(_0x284cd2){_0x420ba2(_0x106476);}else{return createEndUser(_0x106476,_0x4c9391,_0x2a6048,_0xc9e29e,_0x3de44b,_0x1f2bfc)['then'](function(_0x562be1){logger[_0x047b('0x21')]('['+[_0x1f2bfc[_0x047b('0x12')]()]+_0x047b('0x35'),_0x562be1[_0x047b('0x30')]);_0x420ba2(_0x562be1);});}}else{return createEndUser(_0x106476,_0x4c9391,_0x2a6048,_0xc9e29e,_0x3de44b,_0x1f2bfc)[_0x047b('0x15')](function(_0x1a0e96){logger['info']('['+[_0x1f2bfc[_0x047b('0x12')]()]+_0x047b('0x36'),_0x1a0e96[_0x047b('0x30')]);_0x420ba2(_0x1a0e96);});}});});}function getCustomFields(_0x5dd234,_0xa5edb9,_0x5954bc){var _0x5ba2ef={};if(_0x5dd234[_0x047b('0x1e')]>0x0){_[_0x047b('0x37')](_0x5dd234,function(_0x2f51f0){if(_0x2f51f0[_0x047b('0x38')]===_0x047b('0x39')&&_0x2f51f0['nameField']&&!_0x2f51f0[_0x047b('0x3a')]){var _0x5d47e2=_0x2f51f0[_0x047b('0x3b')][_0x047b('0x27')]();var _0x14f207=_0x5d47e2[_0x047b('0x2e')](0x0,_0x5d47e2['indexOf']('_'));var _0x1f9298=_0x5d47e2[_0x047b('0x2e')](_0x5d47e2[_0x047b('0x3c')]('_')+0x1);if(_0x14f207===_0x5954bc){_0x5ba2ef[_0x1f9298]=_0x2f51f0[_0x047b('0x3d')];}}});}return _0x5ba2ef;}function getTicket(_0x554914,_0x5bd93d,_0x516b1f,_0x101ccf,_0xcd641b,_0x3e80f1,_0x49762b){return new BPromise(function(_0x3797a5,_0x5b7ac6){var _0x42bc79;return getAuthToken(_0x5bd93d,_0x516b1f,_0x49762b)[_0x047b('0x15')](function(_0x1b7d81){if(_0x3e80f1[_0x047b('0x3e')]==='incident'){_0x42bc79={'method':'POST','uri':_0x101ccf+_0x047b('0x3f'),'body':Object[_0x047b('0x40')]({},{'title':intUtil[_0x047b('0x41')](_0x3e80f1['Subjects'],_0xcd641b,'\x20'),'description':intUtil[_0x047b('0x41')](_0x3e80f1[_0x047b('0x42')],_0xcd641b,'\x0a'),'customerid_contact@odata.bind':_0x047b('0x43')+_0x554914[_0x047b('0x30')]+')','ownerid@odata.bind':_0x047b('0x2c')+_0x554914['userId']+')','caseorigincode':'1'},getCustomFields(_0x3e80f1['Fields'],_0xcd641b,_0x3e80f1[_0x047b('0x3e')])),'headers':{'Authorization':'Bearer\x20'+_0x1b7d81,'OData-Version':_0x047b('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3e80f1[_0x047b('0x3e')]==='phonecall'){_0x42bc79={'method':'POST','uri':_0x101ccf+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x047b('0x41')](_0x3e80f1[_0x047b('0x44')],_0xcd641b,'\x20'),'phonenumber':String(_0xcd641b['calleridnum']),'description':intUtil[_0x047b('0x41')](_0x3e80f1[_0x047b('0x42')],_0xcd641b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x047b('0x43')+_0x554914[_0x047b('0x30')]+')','ownerid@odata.bind':_0x047b('0x2c')+_0x554914[_0x047b('0x24')]+')','directioncode':_0x554914[_0x047b('0x45')]===_0x047b('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x047b('0x2c')+_0x554914[_0x047b('0x24')]+')','participationtypemask':_0x554914[_0x047b('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x047b('0x43')+_0x554914[_0x047b('0x30')]+')','participationtypemask':_0x554914[_0x047b('0x45')]===_0x047b('0x46')?0x1:0x2}]},getCustomFields(_0x3e80f1[_0x047b('0x47')],_0xcd641b,_0x3e80f1['ticketType'])),'headers':{'Authorization':_0x047b('0x32')+_0x1b7d81,'OData-Version':_0x047b('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x42bc79);})['then'](function(_0x206f17){var _0x75d6ed=_0x206f17[_0x047b('0x2d')][_0x047b('0x48')];var _0x5258f5=_0x75d6ed[_0x047b('0x2e')](_0x75d6ed[_0x047b('0x2f')]('(')+0x1,_0x75d6ed[_0x047b('0x2f')](')'));_0x554914['ticketId']=_0x5258f5;_0x3797a5(_0x554914);})[_0x047b('0x10')](function(_0x21c19f){_0x5b7ac6(_0x21c19f[_0x047b('0x14')]);});});}function emit(_0x517987,_0x151826,_0x25e608,_0x32acca){var _0x763ff7={'uri':util[_0x047b('0x49')](_0x047b('0x4a'),_0x517987,_0x25e608,_0x32acca)};io['to'](util[_0x047b('0x49')](_0x047b('0x4b'),_0x151826))[_0x047b('0x4c')]('trigger:browser:url',_0x763ff7);}exports['cs']=function(_0x32943d,_0x3155bc,_0x3194d0,_0x5bf7e8,_0x1e81e0,_0x167d81,_0x302806,_0x3bb930){var _0x1de81b={};_0x167d81[_0x047b('0xc')]=intUtil[_0x047b('0x4d')](_0x167d81['remoteUri']);_0x167d81['serverUrl']=intUtil[_0x047b('0x4d')](_0x167d81[_0x047b('0x4e')]);_0x1de81b[_0x047b('0x45')]=_0x3bb930==='queue'||_0x3bb930==='unmanaged'?_0x047b('0x46'):_0x047b('0x28');var _0x4bf406=util[_0x047b('0x49')](_0x047b('0x4f'),_0x167d81[_0x047b('0xc')]);var _0x22d7b1=util[_0x047b('0x49')](_0x047b('0x50'),_0x167d81['tenantId']);var _0x4acc37=util[_0x047b('0x49')](_0x047b('0x51'),_0x167d81[_0x047b('0x4e')],_0x3155bc[_0x047b('0x52')],md5(_0x3155bc[_0x047b('0x52')]));if(_0x1e81e0&&_0x1e81e0[_0x047b('0x53')]){logger[_0x047b('0x21')](_0x047b('0x54'),_0x047b('0x55'));_0x3155bc[_0x047b('0x56')]=_0x4acc37;}else if(_0x302806&&_0x302806[_0x047b('0x57')]&&_0x302806[_0x047b('0x57')]!==_0x047b('0x58')){logger[_0x047b('0x21')](_0x047b('0x59'),_0x047b('0x55'));_0x3155bc[_0x047b('0x56')]=_0x4acc37;}else{_0x3155bc['recordingURL']='';}return getUser(_0x1de81b,_0x167d81,_0x5bf7e8,_0x22d7b1,_0x4bf406,_0x3bb930)[_0x047b('0x15')](function(_0x177447){logger[_0x047b('0x21')]('['+_0x3bb930['toUpperCase']()+_0x047b('0x5a'),_0x177447[_0x047b('0x24')]);logger['info']('['+_0x3bb930['toUpperCase']()+_0x047b('0x5b'),_0x177447[_0x047b('0x1d')]);return getEndUser(_0x177447,_0x167d81,_0x22d7b1,_0x4bf406,_0x3155bc,_0x3bb930);})[_0x047b('0x15')](function(_0x39af6e){logger['info']('['+_0x3bb930[_0x047b('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x39af6e[_0x047b('0x30')]);logger[_0x047b('0x21')]('['+_0x3bb930[_0x047b('0x12')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x3155bc['calleridnum']);return getTicket(_0x39af6e,_0x167d81,_0x22d7b1,_0x4bf406,_0x3155bc,_0x3194d0,_0x3bb930);})[_0x047b('0x15')](function(_0x33607f){logger[_0x047b('0x21')](util[_0x047b('0x49')]('['+_0x3bb930[_0x047b('0x12')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x3194d0['ticketType'],_0x33607f['ticketId']));logger[_0x047b('0x21')](util[_0x047b('0x49')]('['+_0x3bb930[_0x047b('0x12')]()+_0x047b('0x5c'),_0x3bb930));if(_0x3bb930!==_0x047b('0x5d')){logger[_0x047b('0x21')]('['+_0x3bb930['toUpperCase']()+']',_0x047b('0x5e'));emit(_0x167d81[_0x047b('0xc')],_0x5bf7e8[_0x047b('0x5f')],_0x3194d0[_0x047b('0x3e')],_0x33607f['ticketId']);}})[_0x047b('0x10')](function(_0x2afd80){logger[_0x047b('0x11')]('['+_0x3bb930[_0x047b('0x12')]()+_0x047b('0x60'),util[_0x047b('0x61')](_0x2afd80,{'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 9b37e8d..d97d514 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 _0x8fa8=['Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','stringify','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','monitor_format','lastevent','Authorization','catch','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','
','Tags','name','custom_fields','mapValues','value','remoteUri','POST','validateEmail','%s/api/v2/agents','then','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','[HTTP]','GET','forEach','type','nameField','customField','string','push','idField','toString','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]'];(function(_0x439621,_0x30104f){var _0x4ab3b0=function(_0x580b88){while(--_0x580b88){_0x439621['push'](_0x439621['shift']());}};_0x4ab3b0(++_0x30104f);}(_0x8fa8,0xcc));var _0x88fa=function(_0xcd8b90,_0x4bd816){_0xcd8b90=_0xcd8b90-0x0;var _0x57a0ab=_0x8fa8[_0xcd8b90];return _0x57a0ab;};'use strict';var _=require(_0x88fa('0x0'));var rp=require(_0x88fa('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x88fa('0x2'));var intUtil=require(_0x88fa('0x3'));var config=require(_0x88fa('0x4'));var logger=require('../../../../config/logger')(_0x88fa('0x5'));config[_0x88fa('0x6')]=_[_0x88fa('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x88fa('0x8'))(new Redis(config[_0x88fa('0x6')]));var headers={'Content-Type':_0x88fa('0x9'),'Accept':'application/json'};function emit(_0xa7bff,_0x29f465,_0xe1e387){io['to'](_0xa7bff)[_0x88fa('0xa')](_0x29f465,_0xe1e387);}function getTicket(_0x201a1f,_0x1afca6,_0x78fe03,_0x1bcbd2,_0x5b1aae){logger[_0x88fa('0xb')](_0x88fa('0xc'));var _0x5b4442=_[_0x88fa('0xd')]({'responder_id':_0x1afca6['id'],'requester_id':_0x78fe03['id'],'name':util[_0x88fa('0xe')]('Caller\x20-\x20%s',_0x5b1aae[_0x88fa('0xf')]),'phone':_0x5b1aae[_0x88fa('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x88fa('0x11')](_0x1bcbd2[_0x88fa('0x12')],_0x5b1aae,'\x20'),'description':intUtil['getString'](_0x1bcbd2['Descriptions'],_0x5b1aae,_0x88fa('0x13')),'tags':getTags(_0x1bcbd2[_0x88fa('0x14')],_0x88fa('0x15'))},getCustomFields(_0x1bcbd2['Fields'],_0x5b1aae));_0x5b4442[_0x88fa('0x16')]=_[_0x88fa('0x17')](_['keyBy'](_0x5b4442[_0x88fa('0x16')],'id'),_0x88fa('0x18'));return request({'uri':util[_0x88fa('0xe')]('%s/api/v2/tickets',_0x201a1f[_0x88fa('0x19')]),'method':_0x88fa('0x1a'),'body':_0x5b4442})['then'](function(_0x5d5789){logger[_0x88fa('0xb')]('Ticket\x20created!');return _0x5d5789;});}function getUser(_0x41a263,_0x1946f3){if(intUtil[_0x88fa('0x1b')](_0x1946f3)){return request({'uri':util['format'](_0x88fa('0x1c'),_0x41a263[_0x88fa('0x19')]),'qs':{'email':_0x1946f3}})[_0x88fa('0x1d')](function(_0x44766a){if(_0x44766a[_0x88fa('0x1e')]){logger[_0x88fa('0xb')]('Agent\x20found!');return _[_0x88fa('0x1f')](_0x44766a,function(_0x2ac438){return _0x2ac438[_0x88fa('0x20')][_0x88fa('0x21')]===_0x1946f3;});}else{logger[_0x88fa('0xb')](_0x88fa('0x22'));return request({'uri':util[_0x88fa('0xe')](_0x88fa('0x23'),_0x41a263[_0x88fa('0x19')])})[_0x88fa('0x1d')](function(_0x236e1a){logger[_0x88fa('0xb')](_0x88fa('0x24'));return _0x236e1a;});}});}else{logger[_0x88fa('0xb')](_0x88fa('0x25'));return request({'uri':util['format'](_0x88fa('0x23'),_0x41a263[_0x88fa('0x19')])})[_0x88fa('0x1d')](function(_0x176a9c){logger[_0x88fa('0xb')](_0x88fa('0x24'));return _0x176a9c;});}}function getEndUser(_0x1ca374,_0x1eb45f,_0x1dd0c2){logger['info'](_0x88fa('0x26'),_0x1dd0c2);return request({'uri':util[_0x88fa('0xe')](_0x88fa('0x27'),_0x1ca374[_0x88fa('0x19')]),'qs':{'phone':_0x1dd0c2}})['then'](function(_0x2e9921){if(_0x2e9921[_0x88fa('0x1e')]){logger[_0x88fa('0xb')](_0x88fa('0x28'));return _['find'](_0x2e9921,{'phone':_0x1dd0c2});}else{logger[_0x88fa('0xb')](_0x88fa('0x29'));return request({'uri':util[_0x88fa('0xe')]('%s/api/v2/contacts',_0x1ca374['remoteUri']),'method':_0x88fa('0x1a'),'body':{'name':_0x1eb45f,'phone':_0x1dd0c2}})[_0x88fa('0x1d')](function(_0x53b861){logger['info'](_0x88fa('0x2a'));return _0x53b861;});}});}function getAuth(_0x3fa8d4){return util[_0x88fa('0xe')](_0x88fa('0x2b'),new Buffer(_0x3fa8d4['apiKey']+':X')['toString'](_0x88fa('0x2c')));}function request(_0x25f048){logger['debug'](_0x88fa('0x2d'),JSON['stringify'](_0x25f048));return rp(_[_0x88fa('0x7')](_0x25f048,{'method':_0x88fa('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x197812,_0x1bc29a){var _0x211dc0=[];if(_0x197812&&_0x197812[_0x88fa('0x1e')]>0x0){_0x211dc0=_['map'](_0x197812,_0x1bc29a);}return _0x211dc0;}function getCustomFields(_0x12c62f,_0x2ceb39){var _0xbca7be=[];var _0x42ea4b={'custom_fields':[]};if(_0x12c62f['length']>0x0){_[_0x88fa('0x2f')](_0x12c62f,function(_0x4cf503){if(_0x4cf503[_0x88fa('0x30')]==='string'&&_0x4cf503[_0x88fa('0x31')]&&!_0x4cf503[_0x88fa('0x32')]){_0x42ea4b[_0x4cf503[_0x88fa('0x31')]['toLowerCase']()]=_0x4cf503['content']['toString']();}else if(_0x4cf503['type']===_0x88fa('0x33')&&_0x4cf503['idField']&&_0x4cf503[_0x88fa('0x32')]){_0x42ea4b[_0x88fa('0x16')][_0x88fa('0x34')]({'id':_0x4cf503[_0x88fa('0x35')],'value':_0x4cf503['content'][_0x88fa('0x36')]()});}else if(_0x4cf503[_0x88fa('0x30')]===_0x88fa('0x37')&&_0x4cf503[_0x88fa('0x38')]&&_0x4cf503[_0x88fa('0x35')]&&_0x4cf503[_0x88fa('0x32')]){_0x2ceb39[_0x4cf503[_0x88fa('0x38')]]&&_0x42ea4b[_0x88fa('0x16')][_0x88fa('0x34')]({'id':_0x4cf503[_0x88fa('0x35')],'value':_0x2ceb39[_0x4cf503[_0x88fa('0x38')]][_0x88fa('0x36')]()});}else if(_0x4cf503['type']===_0x88fa('0x39')&&_0x4cf503[_0x88fa('0x3a')]&&_0x4cf503[_0x88fa('0x3a')][_0x88fa('0x15')]&&_0x4cf503[_0x88fa('0x35')]&&_0x4cf503['customField']){_0x2ceb39[_0x4cf503[_0x88fa('0x3a')][_0x88fa('0x15')][_0x88fa('0x3b')]()]&&_0x42ea4b[_0x88fa('0x16')][_0x88fa('0x34')]({'id':_0x4cf503[_0x88fa('0x35')],'value':_0x2ceb39[_0x4cf503[_0x88fa('0x3a')][_0x88fa('0x15')][_0x88fa('0x3b')]()][_0x88fa('0x36')]()});}});}return _0x42ea4b;}exports['queue']=function(_0x39a912,_0x44db63,_0x4025ee,_0x38f27a,_0x2f96e3,_0x4c5543){var _0xc68a2a,_0x5545d0;_0x4c5543[_0x88fa('0x19')]=intUtil[_0x88fa('0x3c')](_0x4c5543[_0x88fa('0x19')]);_0x4c5543[_0x88fa('0x3d')]=intUtil['stripTrailingSlash'](_0x4c5543['serverUrl']);if(_0x2f96e3&&_0x2f96e3['monitor_format']){logger[_0x88fa('0xb')](_0x88fa('0x3e'),_0x88fa('0x3f'));_0x44db63[_0x88fa('0x40')]=util[_0x88fa('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4c5543[_0x88fa('0x3d')],_0x44db63[_0x88fa('0x41')],md5(_0x44db63[_0x88fa('0x41')]));}else{_0x44db63['recordingURL']='';}headers['Authorization']=getAuth(_0x4c5543);return getUser(_0x4c5543,_0x38f27a[_0x88fa('0x21')])['then'](function(_0x273833){_0xc68a2a=_0x273833;logger[_0x88fa('0xb')](_0x88fa('0x42'),_0xc68a2a['id']);return getEndUser(_0x4c5543,_0x44db63[_0x88fa('0xf')],_0x44db63[_0x88fa('0x10')]);})[_0x88fa('0x1d')](function(_0x184521){_0x5545d0=_0x184521;logger[_0x88fa('0xb')](_0x88fa('0x43'),_0x5545d0['id']);return getTicket(_0x4c5543,_0xc68a2a,_0x5545d0,_0x4025ee,_0x44db63);})[_0x88fa('0x1d')](function(_0x1672fc){if(_0x1672fc&&_0x1672fc['id']){logger[_0x88fa('0xb')](_0x88fa('0x44'));logger[_0x88fa('0xb')](_0x88fa('0x45'),_0x1672fc['id']);logger[_0x88fa('0xb')](_0x88fa('0x3e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x88fa('0x46'),_0x38f27a['name']),_0x88fa('0x47'),{'uri':util['format'](_0x88fa('0x48'),_0x4c5543[_0x88fa('0x19')],_0x1672fc['id'])});}})['catch'](function(_0x5c976f){logger['error']('[QUEUE]',JSON[_0x88fa('0x49')](_0x5c976f));});};exports[_0x88fa('0x4a')]=function(_0x38d786,_0x3ae6d5,_0x258978,_0x18bd31,_0x503d25,_0x4ac1e3,_0x27f3b9){var _0x3b655e,_0x30ef03;_0x4ac1e3[_0x88fa('0x19')]=intUtil['stripTrailingSlash'](_0x4ac1e3['remoteUri']);_0x4ac1e3['serverUrl']=intUtil['stripTrailingSlash'](_0x4ac1e3[_0x88fa('0x3d')]);if(_0x27f3b9&&_0x27f3b9['recordingFormat']&&_0x27f3b9[_0x88fa('0x4b')]!==_0x88fa('0x4c')){logger[_0x88fa('0xb')](_0x88fa('0x4d'),_0x88fa('0x3f'));_0x3ae6d5[_0x88fa('0x40')]=util[_0x88fa('0xe')](_0x88fa('0x4e'),_0x4ac1e3[_0x88fa('0x3d')],_0x3ae6d5[_0x88fa('0x41')],md5(_0x3ae6d5[_0x88fa('0x41')]));}headers['Authorization']=getAuth(_0x4ac1e3);return getUser(_0x4ac1e3,_0x18bd31[_0x88fa('0x21')])[_0x88fa('0x1d')](function(_0x2aac75){_0x3b655e=_0x2aac75;logger[_0x88fa('0xb')](_0x88fa('0x42'),_0x3b655e['id']);return getEndUser(_0x4ac1e3,_0x3ae6d5[_0x88fa('0x4f')],_0x3ae6d5[_0x88fa('0x50')]);})[_0x88fa('0x1d')](function(_0x16351a){_0x30ef03=_0x16351a;logger[_0x88fa('0xb')](_0x88fa('0x43'),_0x30ef03['id']);return getTicket(_0x4ac1e3,_0x3b655e,_0x30ef03,_0x258978,_0x3ae6d5);})[_0x88fa('0x1d')](function(_0x1008a8){if(_0x1008a8&&_0x1008a8['id']){logger['info']('Ticket\x20created!');logger[_0x88fa('0xb')](_0x88fa('0x45'),_0x1008a8['id']);logger[_0x88fa('0xb')](_0x88fa('0x4d'),_0x88fa('0x51'));emit(util[_0x88fa('0xe')](_0x88fa('0x46'),_0x18bd31['name']),_0x88fa('0x47'),{'uri':util[_0x88fa('0xe')](_0x88fa('0x48'),_0x4ac1e3[_0x88fa('0x19')],_0x1008a8['id'])});}})['catch'](function(_0x4ab4da){logger[_0x88fa('0x52')](_0x88fa('0x4d'),JSON[_0x88fa('0x49')](_0x4ab4da));});};exports[_0x88fa('0x53')]=function(_0x57a2ee,_0x3d9d28,_0x4980c7,_0x45a0f5,_0x5594a5,_0x3af1cf){var _0x9640ac,_0x42fc69;_0x3af1cf['remoteUri']=intUtil[_0x88fa('0x3c')](_0x3af1cf[_0x88fa('0x19')]);_0x3af1cf[_0x88fa('0x3d')]=intUtil[_0x88fa('0x3c')](_0x3af1cf[_0x88fa('0x3d')]);if(_0x5594a5&&_0x5594a5[_0x88fa('0x54')]){logger[_0x88fa('0xb')]('['+_0x3d9d28[_0x88fa('0x55')]['toUpperCase']()+']',_0x88fa('0x3f'));_0x3d9d28[_0x88fa('0x40')]=util[_0x88fa('0xe')](_0x88fa('0x4e'),_0x3af1cf[_0x88fa('0x3d')],_0x3d9d28[_0x88fa('0x41')],md5(_0x3d9d28[_0x88fa('0x41')]));}else{_0x3d9d28[_0x88fa('0x40')]='';}headers[_0x88fa('0x56')]=getAuth(_0x3af1cf);return getUser(_0x3af1cf,'')[_0x88fa('0x1d')](function(_0x26a2f0){_0x9640ac=_0x26a2f0;logger[_0x88fa('0xb')](_0x88fa('0x42'),_0x9640ac['id']);return getEndUser(_0x3af1cf,_0x3d9d28[_0x88fa('0xf')],_0x3d9d28[_0x88fa('0x10')]);})[_0x88fa('0x1d')](function(_0x1f123b){_0x42fc69=_0x1f123b;logger[_0x88fa('0xb')](_0x88fa('0x43'),_0x42fc69['id']);return getTicket(_0x3af1cf,_0x9640ac,_0x42fc69,_0x4980c7,_0x3d9d28);})[_0x88fa('0x1d')](function(_0x13274b){if(_0x13274b){logger[_0x88fa('0xb')](_0x88fa('0x44'));logger['info'](_0x88fa('0x45'),_0x13274b['id']);}})[_0x88fa('0x57')](function(_0x18f0fa){logger[_0x88fa('0x52')]('['+_0x3d9d28[_0x88fa('0x55')][_0x88fa('0x58')]()+']',JSON[_0x88fa('0x49')](_0x18f0fa));});}; \ No newline at end of file +var _0x2e91=['socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','then','info','Ticket\x20created!','validateEmail','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','apiKey','toString','debug','defaults','map','forEach','string','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','Variable','queue','serverUrl','stripTrailingSlash','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20Enduser\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','stringify','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','error','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis'];(function(_0x1e9d5d,_0x30e641){var _0xf0c163=function(_0x7a2b4){while(--_0x7a2b4){_0x1e9d5d['push'](_0x1e9d5d['shift']());}};_0xf0c163(++_0x30e641);}(_0x2e91,0xf7));var _0x12e9=function(_0x43c2a1,_0xc2c07c){_0x43c2a1=_0x43c2a1-0x0;var _0x39c3b6=_0x2e91[_0x43c2a1];return _0x39c3b6;};'use strict';var _=require('lodash');var rp=require(_0x12e9('0x0'));var md5=require(_0x12e9('0x1'));var util=require(_0x12e9('0x2'));var Redis=require('ioredis');var intUtil=require(_0x12e9('0x3'));var config=require(_0x12e9('0x4'));var logger=require(_0x12e9('0x5'))(_0x12e9('0x6'));config[_0x12e9('0x7')]=_['defaults'](config[_0x12e9('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x12e9('0x8'))(new Redis(config[_0x12e9('0x7')]));var headers={'Content-Type':_0x12e9('0x9'),'Accept':_0x12e9('0x9')};function emit(_0x4bdad4,_0x3e9b29,_0x18c7c4){io['to'](_0x4bdad4)[_0x12e9('0xa')](_0x3e9b29,_0x18c7c4);}function getTicket(_0x1f8792,_0x103435,_0x502358,_0x31302f,_0x53dd03){logger['info'](_0x12e9('0xb'));var _0x2b6783=_[_0x12e9('0xc')]({'responder_id':_0x103435['id'],'requester_id':_0x502358['id'],'name':util[_0x12e9('0xd')](_0x12e9('0xe'),_0x53dd03[_0x12e9('0xf')]),'phone':_0x53dd03[_0x12e9('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x12e9('0x11')](_0x31302f['Subjects'],_0x53dd03,'\x20'),'description':intUtil[_0x12e9('0x11')](_0x31302f[_0x12e9('0x12')],_0x53dd03,_0x12e9('0x13')),'tags':getTags(_0x31302f[_0x12e9('0x14')],_0x12e9('0x15'))},getCustomFields(_0x31302f[_0x12e9('0x16')],_0x53dd03));_0x2b6783[_0x12e9('0x17')]=_[_0x12e9('0x18')](_['keyBy'](_0x2b6783[_0x12e9('0x17')],'id'),_0x12e9('0x19'));return request({'uri':util[_0x12e9('0xd')](_0x12e9('0x1a'),_0x1f8792[_0x12e9('0x1b')]),'method':'POST','body':_0x2b6783})[_0x12e9('0x1c')](function(_0x41355f){logger[_0x12e9('0x1d')](_0x12e9('0x1e'));return _0x41355f;});}function getUser(_0x385449,_0x31b554){if(intUtil[_0x12e9('0x1f')](_0x31b554)){return request({'uri':util[_0x12e9('0xd')]('%s/api/v2/agents',_0x385449[_0x12e9('0x1b')]),'qs':{'email':_0x31b554}})[_0x12e9('0x1c')](function(_0x2be9e1){if(_0x2be9e1[_0x12e9('0x20')]){logger['info']('Agent\x20found!');return _[_0x12e9('0x21')](_0x2be9e1,function(_0x2e28f9){return _0x2e28f9[_0x12e9('0x22')]['email']===_0x31b554;});}else{logger[_0x12e9('0x1d')](_0x12e9('0x23'));return request({'uri':util[_0x12e9('0xd')](_0x12e9('0x24'),_0x385449[_0x12e9('0x1b')])})[_0x12e9('0x1c')](function(_0x5d3ec8){logger[_0x12e9('0x1d')](_0x12e9('0x25'));return _0x5d3ec8;});}});}else{logger[_0x12e9('0x1d')](_0x12e9('0x26'));return request({'uri':util[_0x12e9('0xd')](_0x12e9('0x24'),_0x385449[_0x12e9('0x1b')])})[_0x12e9('0x1c')](function(_0x5dee10){logger[_0x12e9('0x1d')]('Admin\x20account\x20selected.');return _0x5dee10;});}}function getEndUser(_0x1e5a87,_0x468356,_0x5be6b1){logger['info'](_0x12e9('0x27'),_0x5be6b1);return request({'uri':util[_0x12e9('0xd')](_0x12e9('0x28'),_0x1e5a87[_0x12e9('0x1b')]),'qs':{'phone':_0x5be6b1}})[_0x12e9('0x1c')](function(_0x5a7d34){if(_0x5a7d34[_0x12e9('0x20')]){logger[_0x12e9('0x1d')](_0x12e9('0x29'));return _[_0x12e9('0x21')](_0x5a7d34,{'phone':_0x5be6b1});}else{logger[_0x12e9('0x1d')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x12e9('0x28'),_0x1e5a87[_0x12e9('0x1b')]),'method':'POST','body':{'name':_0x468356,'phone':_0x5be6b1}})['then'](function(_0x4cdc8a){logger['info']('Enduser\x20created.');return _0x4cdc8a;});}});}function getAuth(_0x2223d0){return util['format'](_0x12e9('0x2a'),new Buffer(_0x2223d0[_0x12e9('0x2b')]+':X')[_0x12e9('0x2c')]('base64'));}function request(_0x506c9c){logger[_0x12e9('0x2d')]('[HTTP]',JSON['stringify'](_0x506c9c));return rp(_[_0x12e9('0x2e')](_0x506c9c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x18a33a,_0x371d3e){var _0x3a4dec=[];if(_0x18a33a&&_0x18a33a['length']>0x0){_0x3a4dec=_[_0x12e9('0x2f')](_0x18a33a,_0x371d3e);}return _0x3a4dec;}function getCustomFields(_0x2168d1,_0x4aa42a){var _0x34d145=[];var _0x3f5dff={'custom_fields':[]};if(_0x2168d1[_0x12e9('0x20')]>0x0){_[_0x12e9('0x30')](_0x2168d1,function(_0x5203e1){if(_0x5203e1['type']===_0x12e9('0x31')&&_0x5203e1[_0x12e9('0x32')]&&!_0x5203e1[_0x12e9('0x33')]){_0x3f5dff[_0x5203e1[_0x12e9('0x32')][_0x12e9('0x34')]()]=_0x5203e1[_0x12e9('0x35')][_0x12e9('0x2c')]();}else if(_0x5203e1[_0x12e9('0x36')]===_0x12e9('0x31')&&_0x5203e1[_0x12e9('0x37')]&&_0x5203e1[_0x12e9('0x33')]){_0x3f5dff[_0x12e9('0x17')][_0x12e9('0x38')]({'id':_0x5203e1[_0x12e9('0x37')],'value':_0x5203e1[_0x12e9('0x35')][_0x12e9('0x2c')]()});}else if(_0x5203e1[_0x12e9('0x36')]===_0x12e9('0x39')&&_0x5203e1[_0x12e9('0x3a')]&&_0x5203e1[_0x12e9('0x37')]&&_0x5203e1['customField']){_0x4aa42a[_0x5203e1[_0x12e9('0x3a')]]&&_0x3f5dff[_0x12e9('0x17')]['push']({'id':_0x5203e1['idField'],'value':_0x4aa42a[_0x5203e1[_0x12e9('0x3a')]][_0x12e9('0x2c')]()});}else if(_0x5203e1[_0x12e9('0x36')]==='customVariable'&&_0x5203e1[_0x12e9('0x3b')]&&_0x5203e1[_0x12e9('0x3b')][_0x12e9('0x15')]&&_0x5203e1[_0x12e9('0x37')]&&_0x5203e1[_0x12e9('0x33')]){_0x4aa42a[_0x5203e1[_0x12e9('0x3b')][_0x12e9('0x15')][_0x12e9('0x34')]()]&&_0x3f5dff[_0x12e9('0x17')][_0x12e9('0x38')]({'id':_0x5203e1[_0x12e9('0x37')],'value':_0x4aa42a[_0x5203e1[_0x12e9('0x3b')][_0x12e9('0x15')][_0x12e9('0x34')]()][_0x12e9('0x2c')]()});}});}return _0x3f5dff;}exports[_0x12e9('0x3c')]=function(_0x4efaa8,_0x7b354f,_0x4aa9a9,_0x10af2d,_0x231428,_0x43664b){var _0x10711a,_0x44da85;_0x43664b[_0x12e9('0x1b')]=intUtil['stripTrailingSlash'](_0x43664b['remoteUri']);_0x43664b[_0x12e9('0x3d')]=intUtil[_0x12e9('0x3e')](_0x43664b[_0x12e9('0x3d')]);if(_0x231428&&_0x231428['monitor_format']){logger[_0x12e9('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x7b354f['recordingURL']=util[_0x12e9('0xd')](_0x12e9('0x3f'),_0x43664b[_0x12e9('0x3d')],_0x7b354f[_0x12e9('0x40')],md5(_0x7b354f[_0x12e9('0x40')]));}else{_0x7b354f[_0x12e9('0x41')]='';}headers[_0x12e9('0x42')]=getAuth(_0x43664b);return getUser(_0x43664b,_0x10af2d[_0x12e9('0x43')])[_0x12e9('0x1c')](function(_0x9182b6){_0x10711a=_0x9182b6;logger['info']('The\x20User\x20ID\x20is:',_0x10711a['id']);return getEndUser(_0x43664b,_0x7b354f[_0x12e9('0xf')],_0x7b354f[_0x12e9('0x10')]);})[_0x12e9('0x1c')](function(_0x5cfca8){_0x44da85=_0x5cfca8;logger[_0x12e9('0x1d')](_0x12e9('0x44'),_0x44da85['id']);return getTicket(_0x43664b,_0x10711a,_0x44da85,_0x4aa9a9,_0x7b354f);})[_0x12e9('0x1c')](function(_0x1a0bff){if(_0x1a0bff&&_0x1a0bff['id']){logger[_0x12e9('0x1d')](_0x12e9('0x1e'));logger[_0x12e9('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x1a0bff['id']);logger[_0x12e9('0x1d')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x12e9('0xd')](_0x12e9('0x45'),_0x10af2d[_0x12e9('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x12e9('0x46'),_0x43664b[_0x12e9('0x1b')],_0x1a0bff['id'])});}})[_0x12e9('0x47')](function(_0x25cf41){logger['error']('[QUEUE]',JSON[_0x12e9('0x48')](_0x25cf41));});};exports['outbound']=function(_0x198374,_0x246ffb,_0x5afbcb,_0x49ddbf,_0x37298a,_0x38d39f,_0x230df6){var _0x402f5a,_0x528451;_0x38d39f[_0x12e9('0x1b')]=intUtil[_0x12e9('0x3e')](_0x38d39f['remoteUri']);_0x38d39f[_0x12e9('0x3d')]=intUtil[_0x12e9('0x3e')](_0x38d39f['serverUrl']);if(_0x230df6&&_0x230df6[_0x12e9('0x49')]&&_0x230df6[_0x12e9('0x49')]!==_0x12e9('0x4a')){logger[_0x12e9('0x1d')]('[OUTBOUND]',_0x12e9('0x4b'));_0x246ffb[_0x12e9('0x41')]=util['format'](_0x12e9('0x3f'),_0x38d39f[_0x12e9('0x3d')],_0x246ffb[_0x12e9('0x40')],md5(_0x246ffb[_0x12e9('0x40')]));}headers['Authorization']=getAuth(_0x38d39f);return getUser(_0x38d39f,_0x49ddbf['email'])[_0x12e9('0x1c')](function(_0xac661f){_0x402f5a=_0xac661f;logger['info'](_0x12e9('0x4c'),_0x402f5a['id']);return getEndUser(_0x38d39f,_0x246ffb[_0x12e9('0x4d')],_0x246ffb[_0x12e9('0x4e')]);})[_0x12e9('0x1c')](function(_0x15bdce){_0x528451=_0x15bdce;logger[_0x12e9('0x1d')](_0x12e9('0x44'),_0x528451['id']);return getTicket(_0x38d39f,_0x402f5a,_0x528451,_0x5afbcb,_0x246ffb);})['then'](function(_0x3441db){if(_0x3441db&&_0x3441db['id']){logger[_0x12e9('0x1d')]('Ticket\x20created!');logger[_0x12e9('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x3441db['id']);logger['info'](_0x12e9('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x12e9('0xd')](_0x12e9('0x45'),_0x49ddbf['name']),'trigger:browser:url',{'uri':util['format'](_0x12e9('0x46'),_0x38d39f[_0x12e9('0x1b')],_0x3441db['id'])});}})[_0x12e9('0x47')](function(_0x1d99f0){logger[_0x12e9('0x50')](_0x12e9('0x4f'),JSON[_0x12e9('0x48')](_0x1d99f0));});};exports[_0x12e9('0x51')]=function(_0x6017c5,_0x2b9198,_0x1a9a97,_0x4c1608,_0xc8264a,_0x7f7e33){var _0x41d001,_0x247ef2;_0x7f7e33[_0x12e9('0x1b')]=intUtil['stripTrailingSlash'](_0x7f7e33[_0x12e9('0x1b')]);_0x7f7e33[_0x12e9('0x3d')]=intUtil[_0x12e9('0x3e')](_0x7f7e33[_0x12e9('0x3d')]);if(_0xc8264a&&_0xc8264a['monitor_format']){logger[_0x12e9('0x1d')]('['+_0x2b9198[_0x12e9('0x52')][_0x12e9('0x53')]()+']',_0x12e9('0x4b'));_0x2b9198[_0x12e9('0x41')]=util[_0x12e9('0xd')](_0x12e9('0x3f'),_0x7f7e33['serverUrl'],_0x2b9198['uniqueid'],md5(_0x2b9198[_0x12e9('0x40')]));}else{_0x2b9198[_0x12e9('0x41')]='';}headers[_0x12e9('0x42')]=getAuth(_0x7f7e33);return getUser(_0x7f7e33,'')[_0x12e9('0x1c')](function(_0x421307){_0x41d001=_0x421307;logger[_0x12e9('0x1d')](_0x12e9('0x4c'),_0x41d001['id']);return getEndUser(_0x7f7e33,_0x2b9198[_0x12e9('0xf')],_0x2b9198[_0x12e9('0x10')]);})['then'](function(_0x47cf5a){_0x247ef2=_0x47cf5a;logger[_0x12e9('0x1d')](_0x12e9('0x44'),_0x247ef2['id']);return getTicket(_0x7f7e33,_0x41d001,_0x247ef2,_0x1a9a97,_0x2b9198);})[_0x12e9('0x1c')](function(_0x48df07){if(_0x48df07){logger['info'](_0x12e9('0x1e'));logger[_0x12e9('0x1d')](_0x12e9('0x54'),_0x48df07['id']);}})[_0x12e9('0x47')](function(_0x515ae8){logger[_0x12e9('0x50')]('['+_0x2b9198[_0x12e9('0x52')]['toUpperCase']()+']',JSON[_0x12e9('0x48')](_0x515ae8));});}; \ 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 741ba02..597b0cf 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 _0xc284=['user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','forEach','name','Getting\x20contact\x20list','/api/contacts/view/','contacts','work_number','contactNumber','mobile_number','endUserId','Contact\x20created:','POST','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','Task\x20created:','toUpperCase'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xc284,0x70));var _0x4c28=function(_0x4e9ec3,_0xab9d7e){_0x4e9ec3=_0x4e9ec3-0x0;var _0x1d813b=_0xc284[_0x4e9ec3];return _0x1d813b;};'use strict';var _=require('lodash');var rp=require(_0x4c28('0x0'));var md5=require(_0x4c28('0x1'));var util=require('util');var moment=require(_0x4c28('0x2'));var Promise=require(_0x4c28('0x3'));var Redis=require(_0x4c28('0x4'));var intUtil=require(_0x4c28('0x5'));var config=require(_0x4c28('0x6'));var logger=require(_0x4c28('0x7'))(_0x4c28('0x8'));config[_0x4c28('0x9')]=_[_0x4c28('0xa')](config[_0x4c28('0x9')],{'host':_0x4c28('0xb'),'port':0x18eb});var io=require(_0x4c28('0xc'))(new Redis(config[_0x4c28('0x9')]));function getAdminId(_0x1e7a18,_0x11512a,_0x3d6bf7,_0x49793f){return new Promise(function(_0x3277a0,_0x5ac31b){var _0x16cce1=![];var _0x1cf53c={'method':_0x4c28('0xd'),'uri':_0x49793f+_0x4c28('0xe'),'json':!![]};_0x1cf53c[_0x4c28('0xf')]=_0x3d6bf7;logger[_0x4c28('0x10')](_0x4c28('0x11'));return rp(_0x1cf53c)['then'](function(_0x232339){if(_0x232339){var _0x4efb87=_0x232339[_0x4c28('0x12')];var _0x5063fc=null;for(_0x5063fc=0x0;_0x5063fc<_0x4efb87[_0x4c28('0x13')];_0x5063fc++){if(_0x4efb87[_0x5063fc][_0x4c28('0x14')]===_0x1e7a18[_0x4c28('0x15')]){_0x1e7a18['adminId']=_0x4efb87[_0x5063fc]['id'];_0x16cce1=!![];}}if(_0x16cce1){logger[_0x4c28('0x10')](_0x4c28('0x16'),_0x1e7a18[_0x4c28('0x17')]);_0x3277a0(_0x1e7a18);}else{_0x5ac31b({'statusCode':0x194,'message':_0x4c28('0x18')});}}else{_0x5ac31b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x4c28('0x19')](function(_0x8e7085){logger[_0x4c28('0x1a')]('['+[_0x11512a['toUpperCase']()]+']',_0x8e7085[_0x4c28('0x1b')]);_0x5ac31b(_0x8e7085);});});}function getUser(_0x2b5bab,_0x1017f8,_0x3ca305){return function(_0x92eb07){return new Promise(function(_0x2e15d3,_0x53b18e){var _0xdaf597={'method':_0x4c28('0xd'),'uri':_0x3ca305+'/api/selector/owners','json':!![]};_0xdaf597[_0x4c28('0xf')]=_0x1017f8;logger[_0x4c28('0x10')]('Getting\x20user\x20list');return rp(_0xdaf597)[_0x4c28('0x1c')](function(_0x3c7229){if(_0x3c7229){var _0x2d3a56=_0x3c7229[_0x4c28('0x12')];var _0x2845bf=![];var _0x9f30f8=null;if(_0x92eb07[_0x4c28('0x1d')]!==null){logger[_0x4c28('0x10')](_0x4c28('0x1e'),_0x92eb07[_0x4c28('0x1d')]);_0x92eb07[_0x4c28('0x1f')]=_0x92eb07[_0x4c28('0x1d')];for(_0x9f30f8=0x0;_0x9f30f8<_0x2d3a56[_0x4c28('0x13')];_0x9f30f8++){if(_0x2d3a56[_0x9f30f8][_0x4c28('0x14')]===_0x92eb07[_0x4c28('0x1d')]){_0x2845bf=!![];_0x92eb07[_0x4c28('0x20')]=_0x2d3a56[_0x9f30f8]['id'];logger[_0x4c28('0x10')](_0x4c28('0x21'),_0x92eb07[_0x4c28('0x20')]);}}}if(!_0x2845bf){logger[_0x4c28('0x10')](_0x4c28('0x22'));_0x92eb07['userEmail']=_0x92eb07[_0x4c28('0x15')];_0x92eb07[_0x4c28('0x20')]=_0x92eb07[_0x4c28('0x17')];_0x2845bf=!![];}if(_0x2845bf){_0x2e15d3(_0x92eb07);}else{_0x53b18e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x53b18e({'statusCode':0x194,'message':_0x4c28('0x18')});}})[_0x4c28('0x19')](function(_0x4d6d17){logger[_0x4c28('0x1a')]('['+[_0x2b5bab['toUpperCase']()]+']',_0x4d6d17['message']);_0x53b18e(_0x4d6d17);});});};}function getEndUser(_0x1b60d3,_0x2a0204,_0x50fb4e){return function(_0x4ac3cc){return new Promise(function(_0x1831ef,_0x53d0fb){var _0x3a275c=0x0;var _0x1d9e4b={'method':_0x4c28('0xd'),'uri':_0x50fb4e+'/api/contacts/filters','json':!![]};_0x1d9e4b[_0x4c28('0xf')]=_0x2a0204;logger[_0x4c28('0x10')]('Getting\x20contacts\x20filter');return rp(_0x1d9e4b)[_0x4c28('0x1c')](function(_0x2c6454){_0x2c6454['filters'][_0x4c28('0x23')](function(_0x52f42f){if(_0x52f42f[_0x4c28('0x24')]==='All\x20Contacts'){_0x3a275c=_0x52f42f['id'];}});})[_0x4c28('0x1c')](function(){logger[_0x4c28('0x10')](_0x4c28('0x25'));var _0x283c1d={'method':_0x4c28('0xd'),'uri':_0x50fb4e+_0x4c28('0x26')+_0x3a275c,'json':!![]};_0x283c1d[_0x4c28('0xf')]=_0x2a0204;return rp(_0x283c1d);})[_0x4c28('0x1c')](function(_0x5056ec){logger[_0x4c28('0x10')]('Searching\x20contact\x20with\x20phone',_0x4ac3cc['contactNumber']);if(_0x5056ec[_0x4c28('0x27')]['length']>0x0){var _0x2e27bc=_['find'](_0x5056ec[_0x4c28('0x27')],function(_0x5c2b3e){if(_0x5c2b3e[_0x4c28('0x28')]===_0x4ac3cc[_0x4c28('0x29')]||_0x5c2b3e[_0x4c28('0x2a')]===_0x4ac3cc['contactNumber']){return _0x5c2b3e;}});if(_0x2e27bc){_0x4ac3cc[_0x4c28('0x2b')]=_0x2e27bc['id'];logger[_0x4c28('0x10')]('Contact\x20found:',_0x4ac3cc[_0x4c28('0x2b')]);_0x1831ef(_0x4ac3cc);}else{return createEndUser(_0x4ac3cc,_0x1b60d3,_0x2a0204,_0x50fb4e)[_0x4c28('0x1c')](function(_0x96c1a0){logger['info'](_0x4c28('0x2c'),_0x4ac3cc[_0x4c28('0x2b')]);_0x1831ef(_0x96c1a0);});}}else{return createEndUser(_0x4ac3cc,_0x1b60d3,_0x2a0204,_0x50fb4e)['then'](function(_0x207747){logger['info']('Contact\x20created:',_0x4ac3cc['endUserId']);_0x1831ef(_0x207747);});}})[_0x4c28('0x19')](function(_0x34736f){throw new Error(_0x34736f[_0x4c28('0x1b')]);});});};}function createEndUser(_0x54ba04,_0x4f9d54,_0x3b7ad5,_0x9fd5fc){return new Promise(function(_0x13292a,_0x1dacac){var _0x165b4a=moment();var _0x17f3d8={'method':_0x4c28('0x2d'),'uri':_0x9fd5fc+'/api/contacts','body':{'contact':{'last_name':_0x54ba04[_0x4c28('0x29')],'work_number':_0x54ba04['contactNumber'],'mobile_number':_0x54ba04[_0x4c28('0x29')],'owner_id':_0x54ba04[_0x4c28('0x20')],'created_at':_0x165b4a[_0x4c28('0x2e')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x17f3d8[_0x4c28('0xf')]=_0x3b7ad5;logger['info'](_0x4c28('0x2f'));return rp(_0x17f3d8)[_0x4c28('0x1c')](function(_0x22d154){_0x54ba04['endUserId']=_0x22d154[_0x4c28('0x30')]['id'];_0x13292a(_0x54ba04);})['catch'](function(_0x19e5cc){logger[_0x4c28('0x1a')]('['+[_0x4f9d54['toUpperCase']()]+']',_0x19e5cc[_0x4c28('0x1b')]);_0x1dacac(_0x19e5cc[_0x4c28('0x1b')]);});});}function getTicket(_0x5e31e7,_0x4070b3,_0x55b6d7,_0x2dc2fe,_0x3cd5c2){return function(_0x532769){logger['info'](_0x4c28('0x31'));return new Promise(function(_0x4b9952,_0x338d03){var _0x57e9b8=moment();var _0xb3e1e={'method':_0x4c28('0x2d'),'uri':_0x55b6d7+'/api/tasks','body':{'title':intUtil[_0x4c28('0x32')](_0x2dc2fe['Subjects'],_0x3cd5c2,'\x20'),'description':intUtil[_0x4c28('0x32')](_0x2dc2fe[_0x4c28('0x33')],_0x3cd5c2,'\x0a'),'owner_id':_0x532769[_0x4c28('0x20')],'creater_id':_0x532769[_0x4c28('0x17')],'targetable_id':_0x532769[_0x4c28('0x2b')],'targetable_type':_0x4c28('0x34'),'created_at':_0x57e9b8['format'](_0x4c28('0x35')),'due_date':_0x57e9b8[_0x4c28('0x36')](0x1e,'m')[_0x4c28('0x2e')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0xb3e1e['headers']=_0x4070b3;return rp(_0xb3e1e)[_0x4c28('0x1c')](function(_0x4d8671){_0x532769[_0x4c28('0x37')]=_0x4d8671['task']['id'];logger['info'](_0x4c28('0x38'),_0x532769[_0x4c28('0x37')]);_0x4b9952(_0x532769);})[_0x4c28('0x19')](function(_0x4b4a26){logger[_0x4c28('0x1a')]('['+[_0x5e31e7[_0x4c28('0x39')]()]+']',_0x4b4a26[_0x4c28('0x1b')]);_0x338d03(_0x4b4a26['message']);});});};}function emit(_0xace259,_0x516fb7,_0x2f0089){var _0x55efa5={'uri':_0xace259+'/contacts/'+_0x2f0089};io['to'](util[_0x4c28('0x2e')](_0x4c28('0x3a'),_0x516fb7))[_0x4c28('0x3b')](_0x4c28('0x3c'),_0x55efa5);}exports['cs']=function(_0x2ccbe7,_0x47ebfb,_0x4a243d,_0x54550e,_0x17a3e1,_0x53967b,_0x312dc6,_0x3b29e4){var _0x23b311={};var _0x2dc7e2={'Authorization':_0x4c28('0x3d')+_0x53967b['apiKey']};_0x53967b[_0x4c28('0x3e')]=intUtil[_0x4c28('0x3f')](_0x53967b[_0x4c28('0x3e')]);_0x53967b['serverUrl']=intUtil[_0x4c28('0x3f')](_0x53967b['serverUrl']);var _0x47ba3a=_0x53967b[_0x4c28('0x3e')];_0x23b311[_0x4c28('0x15')]=_0x53967b[_0x4c28('0x40')];_0x23b311[_0x4c28('0x29')]=_0x3b29e4[_0x4c28('0x41')]()===_0x4c28('0x42')?_0x47ebfb[_0x4c28('0x43')]:_0x47ebfb[_0x4c28('0x44')];_0x23b311[_0x4c28('0x45')]=_0x3b29e4===_0x4c28('0x46')||_0x3b29e4==='unmanaged'?_0x4c28('0x46'):_0x4c28('0x42');if(_0x54550e){_0x23b311['agentEmail']=_0x54550e[_0x4c28('0x14')];}var _0x2261fd=util[_0x4c28('0x2e')](_0x4c28('0x47'),_0x53967b[_0x4c28('0x48')],_0x47ebfb[_0x4c28('0x49')],md5(_0x47ebfb[_0x4c28('0x49')]));if(_0x17a3e1&&_0x17a3e1[_0x4c28('0x4a')]){logger[_0x4c28('0x10')](_0x4c28('0x4b'),_0x4c28('0x4c'));_0x47ebfb[_0x4c28('0x4d')]=_0x2261fd;}else if(_0x312dc6&&_0x312dc6[_0x4c28('0x4e')]&&_0x312dc6[_0x4c28('0x4e')]!==_0x4c28('0x4f')){logger['info'](_0x4c28('0x50'),_0x4c28('0x4c'));_0x47ebfb[_0x4c28('0x4d')]=_0x2261fd;}else{_0x47ebfb[_0x4c28('0x4d')]='';}return getAdminId(_0x23b311,_0x3b29e4,_0x2dc7e2,_0x47ba3a)[_0x4c28('0x1c')](getUser(_0x3b29e4,_0x2dc7e2,_0x47ba3a))[_0x4c28('0x1c')](getEndUser(_0x3b29e4,_0x2dc7e2,_0x47ba3a))[_0x4c28('0x1c')](getTicket(_0x3b29e4,_0x2dc7e2,_0x47ba3a,_0x4a243d,_0x47ebfb))['then'](function(_0x7f7630){logger[_0x4c28('0x10')](util[_0x4c28('0x2e')](_0x4c28('0x51'),_0x7f7630['ticketId']));if(_0x3b29e4!==_0x4c28('0x52')){logger['info']('['+[_0x3b29e4[_0x4c28('0x39')]()]+']',_0x4c28('0x53'));emit(_0x47ba3a,_0x54550e[_0x4c28('0x24')],_0x7f7630['endUserId']);}})[_0x4c28('0x19')](function(_0x21892f){logger[_0x4c28('0x1a')]('['+[_0x3b29e4[_0x4c28('0x39')]()]+_0x4c28('0x54'),util['inspect'](_0x21892f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1967=['toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','userEmail','userId','Admin\x20selected','adminEmail','/api/contacts/filters','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','GET','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','contactNumber','mobile_number','Contact\x20found:','endUserId','Contact\x20created:','catch','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','format','add','YYYY-MM-DDTHH:mm:ss','task','Task\x20created:','/contacts/','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','username'];(function(_0x36cfcb,_0x5969fd){var _0x51631b=function(_0x9c096e){while(--_0x9c096e){_0x36cfcb['push'](_0x36cfcb['shift']());}};_0x51631b(++_0x5969fd);}(_0x1967,0x173));var _0x7196=function(_0x4eb7af,_0x355fb7){_0x4eb7af=_0x4eb7af-0x0;var _0x3fc764=_0x1967[_0x4eb7af];return _0x3fc764;};'use strict';var _=require('lodash');var rp=require(_0x7196('0x0'));var md5=require(_0x7196('0x1'));var util=require(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var Promise=require(_0x7196('0x4'));var Redis=require(_0x7196('0x5'));var intUtil=require(_0x7196('0x6'));var config=require(_0x7196('0x7'));var logger=require(_0x7196('0x8'))(_0x7196('0x9'));config['redis']=_[_0x7196('0xa')](config[_0x7196('0xb')],{'host':_0x7196('0xc'),'port':0x18eb});var io=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xb')]));function getAdminId(_0xad78a,_0x510c72,_0x218520,_0xc6366f){return new Promise(function(_0x3f846e,_0x259b18){var _0x1e862d=![];var _0x503070={'method':'GET','uri':_0xc6366f+_0x7196('0xe'),'json':!![]};_0x503070[_0x7196('0xf')]=_0x218520;logger[_0x7196('0x10')](_0x7196('0x11'));return rp(_0x503070)[_0x7196('0x12')](function(_0x46f26c){if(_0x46f26c){var _0x1bf0a5=_0x46f26c[_0x7196('0x13')];var _0x24f1c3=null;for(_0x24f1c3=0x0;_0x24f1c3<_0x1bf0a5[_0x7196('0x14')];_0x24f1c3++){if(_0x1bf0a5[_0x24f1c3][_0x7196('0x15')]===_0xad78a['adminEmail']){_0xad78a[_0x7196('0x16')]=_0x1bf0a5[_0x24f1c3]['id'];_0x1e862d=!![];}}if(_0x1e862d){logger[_0x7196('0x10')](_0x7196('0x17'),_0xad78a[_0x7196('0x16')]);_0x3f846e(_0xad78a);}else{_0x259b18({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x259b18({'statusCode':0x194,'message':_0x7196('0x18')});}})['catch'](function(_0xe32933){logger[_0x7196('0x19')]('['+[_0x510c72[_0x7196('0x1a')]()]+']',_0xe32933[_0x7196('0x1b')]);_0x259b18(_0xe32933);});});}function getUser(_0x12dce7,_0x2e3e0e,_0x22bd62){return function(_0x1ed296){return new Promise(function(_0x3e4e69,_0x32fe2b){var _0x385f2d={'method':'GET','uri':_0x22bd62+'/api/selector/owners','json':!![]};_0x385f2d[_0x7196('0xf')]=_0x2e3e0e;logger[_0x7196('0x10')](_0x7196('0x1c'));return rp(_0x385f2d)['then'](function(_0x39b944){if(_0x39b944){var _0x539d8b=_0x39b944['users'];var _0x296e07=![];var _0x627223=null;if(_0x1ed296[_0x7196('0x1d')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x1ed296[_0x7196('0x1d')]);_0x1ed296[_0x7196('0x1e')]=_0x1ed296['agentEmail'];for(_0x627223=0x0;_0x627223<_0x539d8b[_0x7196('0x14')];_0x627223++){if(_0x539d8b[_0x627223][_0x7196('0x15')]===_0x1ed296[_0x7196('0x1d')]){_0x296e07=!![];_0x1ed296[_0x7196('0x1f')]=_0x539d8b[_0x627223]['id'];logger[_0x7196('0x10')]('User\x20found:',_0x1ed296[_0x7196('0x1f')]);}}}if(!_0x296e07){logger['info'](_0x7196('0x20'));_0x1ed296[_0x7196('0x1e')]=_0x1ed296[_0x7196('0x21')];_0x1ed296[_0x7196('0x1f')]=_0x1ed296[_0x7196('0x16')];_0x296e07=!![];}if(_0x296e07){_0x3e4e69(_0x1ed296);}else{_0x32fe2b({'statusCode':0x194,'message':_0x7196('0x18')});}}else{_0x32fe2b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x1482e5){logger[_0x7196('0x19')]('['+[_0x12dce7[_0x7196('0x1a')]()]+']',_0x1482e5['message']);_0x32fe2b(_0x1482e5);});});};}function getEndUser(_0x5aa538,_0x41cfd2,_0x162cfc){return function(_0x675e64){return new Promise(function(_0x4c6006,_0x35eef9){var _0x4ecea1=0x0;var _0x4fd339={'method':'GET','uri':_0x162cfc+_0x7196('0x22'),'json':!![]};_0x4fd339[_0x7196('0xf')]=_0x41cfd2;logger[_0x7196('0x10')]('Getting\x20contacts\x20filter');return rp(_0x4fd339)[_0x7196('0x12')](function(_0x45d567){_0x45d567[_0x7196('0x23')][_0x7196('0x24')](function(_0x50c386){if(_0x50c386[_0x7196('0x25')]===_0x7196('0x26')){_0x4ecea1=_0x50c386['id'];}});})[_0x7196('0x12')](function(){logger[_0x7196('0x10')](_0x7196('0x27'));var _0x2786f3={'method':_0x7196('0x28'),'uri':_0x162cfc+_0x7196('0x29')+_0x4ecea1,'json':!![]};_0x2786f3[_0x7196('0xf')]=_0x41cfd2;return rp(_0x2786f3);})[_0x7196('0x12')](function(_0x1ff4b4){logger['info'](_0x7196('0x2a'),_0x675e64['contactNumber']);if(_0x1ff4b4[_0x7196('0x2b')]['length']>0x0){var _0x372ddc=_[_0x7196('0x2c')](_0x1ff4b4['contacts'],function(_0x628e7d){if(_0x628e7d[_0x7196('0x2d')]===_0x675e64[_0x7196('0x2e')]||_0x628e7d[_0x7196('0x2f')]===_0x675e64[_0x7196('0x2e')]){return _0x628e7d;}});if(_0x372ddc){_0x675e64['endUserId']=_0x372ddc['id'];logger[_0x7196('0x10')](_0x7196('0x30'),_0x675e64[_0x7196('0x31')]);_0x4c6006(_0x675e64);}else{return createEndUser(_0x675e64,_0x5aa538,_0x41cfd2,_0x162cfc)[_0x7196('0x12')](function(_0x3e8f98){logger[_0x7196('0x10')]('Contact\x20created:',_0x675e64[_0x7196('0x31')]);_0x4c6006(_0x3e8f98);});}}else{return createEndUser(_0x675e64,_0x5aa538,_0x41cfd2,_0x162cfc)[_0x7196('0x12')](function(_0x191df2){logger['info'](_0x7196('0x32'),_0x675e64[_0x7196('0x31')]);_0x4c6006(_0x191df2);});}})[_0x7196('0x33')](function(_0xa24847){throw new Error(_0xa24847[_0x7196('0x1b')]);});});};}function createEndUser(_0x31fca7,_0x938e49,_0x1ab720,_0x92cfb1){return new Promise(function(_0x3ee114,_0x5354d3){var _0x257754=moment();var _0x17cefd={'method':'POST','uri':_0x92cfb1+_0x7196('0x34'),'body':{'contact':{'last_name':_0x31fca7['contactNumber'],'work_number':_0x31fca7['contactNumber'],'mobile_number':_0x31fca7[_0x7196('0x2e')],'owner_id':_0x31fca7[_0x7196('0x1f')],'created_at':_0x257754['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x17cefd[_0x7196('0xf')]=_0x1ab720;logger[_0x7196('0x10')](_0x7196('0x35'));return rp(_0x17cefd)['then'](function(_0x36a990){_0x31fca7[_0x7196('0x31')]=_0x36a990[_0x7196('0x36')]['id'];_0x3ee114(_0x31fca7);})[_0x7196('0x33')](function(_0x16da09){logger[_0x7196('0x19')]('['+[_0x938e49[_0x7196('0x1a')]()]+']',_0x16da09[_0x7196('0x1b')]);_0x5354d3(_0x16da09['message']);});});}function getTicket(_0x89c8ea,_0xa852e1,_0x4f8b4a,_0x266bd7,_0x43d4c0){return function(_0x48178f){logger[_0x7196('0x10')](_0x7196('0x37'));return new Promise(function(_0x3b78c8,_0x5749e2){var _0x455fea=moment();var _0x4713d3={'method':'POST','uri':_0x4f8b4a+_0x7196('0x38'),'body':{'title':intUtil[_0x7196('0x39')](_0x266bd7['Subjects'],_0x43d4c0,'\x20'),'description':intUtil[_0x7196('0x39')](_0x266bd7['Descriptions'],_0x43d4c0,'\x0a'),'owner_id':_0x48178f['userId'],'creater_id':_0x48178f['adminId'],'targetable_id':_0x48178f['endUserId'],'targetable_type':'Contact','created_at':_0x455fea[_0x7196('0x3a')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x455fea[_0x7196('0x3b')](0x1e,'m')[_0x7196('0x3a')](_0x7196('0x3c'))},'json':!![]};_0x4713d3[_0x7196('0xf')]=_0xa852e1;return rp(_0x4713d3)['then'](function(_0x3f3171){_0x48178f['ticketId']=_0x3f3171[_0x7196('0x3d')]['id'];logger[_0x7196('0x10')](_0x7196('0x3e'),_0x48178f['ticketId']);_0x3b78c8(_0x48178f);})[_0x7196('0x33')](function(_0x44d8e5){logger[_0x7196('0x19')]('['+[_0x89c8ea['toUpperCase']()]+']',_0x44d8e5['message']);_0x5749e2(_0x44d8e5[_0x7196('0x1b')]);});});};}function emit(_0x5a7896,_0x29c7e8,_0x582884){var _0x53b4c7={'uri':_0x5a7896+_0x7196('0x3f')+_0x582884};io['to'](util['format']('user:%s',_0x29c7e8))['emit'](_0x7196('0x40'),_0x53b4c7);}exports['cs']=function(_0x5052ee,_0x48e3b5,_0x28591e,_0x182c8b,_0x2262d8,_0x1786fa,_0x55de40,_0x50cc66){var _0x564688={};var _0x36844f={'Authorization':_0x7196('0x41')+_0x1786fa['apiKey']};_0x1786fa[_0x7196('0x42')]=intUtil[_0x7196('0x43')](_0x1786fa[_0x7196('0x42')]);_0x1786fa['serverUrl']=intUtil[_0x7196('0x43')](_0x1786fa['serverUrl']);var _0x44f7cc=_0x1786fa[_0x7196('0x42')];_0x564688[_0x7196('0x21')]=_0x1786fa[_0x7196('0x44')];_0x564688[_0x7196('0x2e')]=_0x50cc66[_0x7196('0x45')]()===_0x7196('0x46')?_0x48e3b5[_0x7196('0x47')]:_0x48e3b5['calleridnum'];_0x564688['callDirection']=_0x50cc66===_0x7196('0x48')||_0x50cc66===_0x7196('0x49')?_0x7196('0x48'):_0x7196('0x46');if(_0x182c8b){_0x564688['agentEmail']=_0x182c8b[_0x7196('0x15')];}var _0x6948a=util[_0x7196('0x3a')](_0x7196('0x4a'),_0x1786fa[_0x7196('0x4b')],_0x48e3b5[_0x7196('0x4c')],md5(_0x48e3b5[_0x7196('0x4c')]));if(_0x2262d8&&_0x2262d8[_0x7196('0x4d')]){logger[_0x7196('0x10')](_0x7196('0x4e'),_0x7196('0x4f'));_0x48e3b5['recordingURL']=_0x6948a;}else if(_0x55de40&&_0x55de40[_0x7196('0x50')]&&_0x55de40[_0x7196('0x50')]!==_0x7196('0x51')){logger['info'](_0x7196('0x52'),'Recording\x20is\x20enabled!');_0x48e3b5[_0x7196('0x53')]=_0x6948a;}else{_0x48e3b5[_0x7196('0x53')]='';}return getAdminId(_0x564688,_0x50cc66,_0x36844f,_0x44f7cc)[_0x7196('0x12')](getUser(_0x50cc66,_0x36844f,_0x44f7cc))[_0x7196('0x12')](getEndUser(_0x50cc66,_0x36844f,_0x44f7cc))[_0x7196('0x12')](getTicket(_0x50cc66,_0x36844f,_0x44f7cc,_0x28591e,_0x48e3b5))['then'](function(_0x3ece9f){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x3ece9f[_0x7196('0x54')]));if(_0x50cc66!==_0x7196('0x49')){logger[_0x7196('0x10')]('['+[_0x50cc66[_0x7196('0x1a')]()]+']',_0x7196('0x55'));emit(_0x44f7cc,_0x182c8b[_0x7196('0x25')],_0x3ece9f[_0x7196('0x31')]);}})['catch'](function(_0x293467){logger[_0x7196('0x19')]('['+[_0x50cc66[_0x7196('0x1a')]()]+_0x7196('0x56'),util[_0x7196('0x57')](_0x293467,{'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 b502d65..aa0a7cf 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 _0x5f66=['dynamics365','freshsales','toLowerCase','data1','data2','find','Configurations','data3','queue','outbound','unmanaged','salesforce','sugarcrm','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./freshsales','zendesk','freshdesk','zoho','desk','vtiger'];(function(_0x101645,_0x4c4dea){var _0x563807=function(_0x5854aa){while(--_0x5854aa){_0x101645['push'](_0x101645['shift']());}};_0x563807(++_0x4c4dea);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x65f6('0x1'));var sugarcrm=require(_0x65f6('0x2'));var freshdesk=require(_0x65f6('0x3'));var zoho=require(_0x65f6('0x4'));var desk=require(_0x65f6('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x65f6('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x65f6('0x7'));var integrations=[_0x65f6('0x8'),'salesforce','sugarcrm',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'servicenow'];exports['exec']=function(_0x18fea1,_0x2f6d5b,_0x264647,_0x25c416,_0x50d26d,_0x41a7fd){if(_0x264647){if(_['includes'](integrations,_0x18fea1['data1'][_0x65f6('0xf')]())){try{var _0x576875=null;var _0x419819='';var _0x4862a5=_0x264647[_0x18fea1[_0x65f6('0x10')][_0x65f6('0xf')]()];if(_0x4862a5){var _0x2c4ee5=_0x4862a5[_0x18fea1[_0x65f6('0x11')]];if(_0x2c4ee5){var _0x369f96=_[_0x65f6('0x12')](_0x2c4ee5[_0x65f6('0x13')],{'id':parseInt(_0x18fea1[_0x65f6('0x14')],0xa)});if(_0x369f96){if(_0x25c416){if(_0x50d26d&&_0x2f6d5b[_0x65f6('0x15')]){_0x419819=_0x65f6('0x15');}else if(_0x2f6d5b['routeId']){_0x419819=_0x65f6('0x16');}else{console['log']('EVENT\x20UNKNOWN',_0x2f6d5b);}}else{_0x419819=_0x65f6('0x17');}switch(_0x18fea1[_0x65f6('0x10')][_0x65f6('0xf')]()){case _0x65f6('0x8'):zendesk[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case _0x65f6('0x18'):salesforce[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case _0x65f6('0x19'):sugarcrm[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case _0x65f6('0x9'):freshdesk[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case _0x65f6('0xa'):zoho[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case'desk':desk[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case'vtiger':vtiger[_0x419819](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd);break;case _0x65f6('0xe'):freshsales['cs'](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd,_0x419819);break;case'servicenow':servicenow['cs'](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd,_0x419819);break;case'dynamics365':dynamics365['cs'](_0x18fea1,_0x2f6d5b,_0x369f96,_0x25c416,_0x50d26d,_0x2c4ee5,_0x41a7fd,_0x419819);break;default:console['log'](_0x65f6('0x1a'));}}else{_0x576875=require(_0x65f6('0x1b'))(_0x18fea1['data1'][_0x65f6('0xf')]());_0x576875[_0x65f6('0x1c')](_0x65f6('0x1d'),util[_0x65f6('0x1e')](_0x65f6('0x1f'),_0x18fea1[_0x65f6('0x10')]['toLowerCase'](),_0x18fea1[_0x65f6('0x14')]));}}else{_0x576875=require('../../../../config/logger')(_0x18fea1['data1'][_0x65f6('0xf')]());_0x576875[_0x65f6('0x1c')]('[EXEC]',util[_0x65f6('0x1e')](_0x65f6('0x20'),_0x18fea1[_0x65f6('0x10')][_0x65f6('0xf')](),_0x18fea1['data2']));}}else{}}catch(_0x9d7bb0){console[_0x65f6('0x1c')](_0x9d7bb0);}}}}; \ No newline at end of file +var _0x34b7=['desk','vtiger','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshsales','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x34b7,0x196));var _0x734b=function(_0xe3bbea,_0x3ae4d3){_0xe3bbea=_0xe3bbea-0x0;var _0x18713d=_0x34b7[_0xe3bbea];return _0x18713d;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x734b('0x0'));var salesforce=require(_0x734b('0x1'));var sugarcrm=require(_0x734b('0x2'));var freshdesk=require(_0x734b('0x3'));var zoho=require(_0x734b('0x4'));var desk=require(_0x734b('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x734b('0x6'));var freshsales=require(_0x734b('0x7'));var integrations=[_0x734b('0x8'),_0x734b('0x9'),_0x734b('0xa'),_0x734b('0xb'),'zoho',_0x734b('0xc'),_0x734b('0xd'),'dynamics365','freshsales','servicenow'];exports[_0x734b('0xe')]=function(_0x598dee,_0x43c5e0,_0x333738,_0x2860a2,_0x222dc7,_0x3a442b){if(_0x333738){if(_[_0x734b('0xf')](integrations,_0x598dee[_0x734b('0x10')][_0x734b('0x11')]())){try{var _0x257657=null;var _0x1e0fca='';var _0x189a82=_0x333738[_0x598dee[_0x734b('0x10')][_0x734b('0x11')]()];if(_0x189a82){var _0x1c893d=_0x189a82[_0x598dee['data2']];if(_0x1c893d){var _0x18fc18=_[_0x734b('0x12')](_0x1c893d[_0x734b('0x13')],{'id':parseInt(_0x598dee[_0x734b('0x14')],0xa)});if(_0x18fc18){if(_0x2860a2){if(_0x222dc7&&_0x43c5e0[_0x734b('0x15')]){_0x1e0fca=_0x734b('0x15');}else if(_0x43c5e0[_0x734b('0x16')]){_0x1e0fca=_0x734b('0x17');}else{console[_0x734b('0x18')](_0x734b('0x19'),_0x43c5e0);}}else{_0x1e0fca=_0x734b('0x1a');}switch(_0x598dee['data1'][_0x734b('0x11')]()){case _0x734b('0x8'):zendesk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0x9'):salesforce[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xa'):sugarcrm[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case'freshdesk':freshdesk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case'zoho':zoho[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xc'):desk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xd'):vtiger[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0x1b'):freshsales['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;case _0x734b('0x1c'):servicenow['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;case _0x734b('0x1d'):dynamics365['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;default:console[_0x734b('0x18')](_0x734b('0x1e'));}}else{_0x257657=require(_0x734b('0x1f'))(_0x598dee[_0x734b('0x10')][_0x734b('0x11')]());_0x257657[_0x734b('0x20')](_0x734b('0x21'),util[_0x734b('0x22')](_0x734b('0x23'),_0x598dee['data1'][_0x734b('0x11')](),_0x598dee[_0x734b('0x14')]));}}else{_0x257657=require('../../../../config/logger')(_0x598dee[_0x734b('0x10')][_0x734b('0x11')]());_0x257657[_0x734b('0x20')](_0x734b('0x21'),util[_0x734b('0x22')](_0x734b('0x24'),_0x598dee[_0x734b('0x10')][_0x734b('0x11')](),_0x598dee[_0x734b('0x25')]));}}else{}}catch(_0x3abbe6){console[_0x734b('0x20')](_0x3abbe6);}}}}; \ 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 c144982..bb83039 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 _0x56bc=['./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','sobject','create','isNil','validateEmail','find','then','length','Email','Agent\x20%s\x20found.','Name','info','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','variableName','toString','Variable','name','toLowerCase','concat','Connection','remoteUri','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','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','ioredis'];(function(_0x20f987,_0x3e02b0){var _0x39393d=function(_0x27342e){while(--_0x27342e){_0x20f987['push'](_0x20f987['shift']());}};_0x39393d(++_0x3e02b0);}(_0x56bc,0xcd));var _0xc56b=function(_0x3212e6,_0x3ef4a2){_0x3212e6=_0x3212e6-0x0;var _0xc25ada=_0x56bc[_0x3212e6];return _0xc25ada;};'use strict';var _=require(_0xc56b('0x0'));var rp=require('request-promise');var moment=require(_0xc56b('0x1'));var BPromise=require(_0xc56b('0x2'));var md5=require(_0xc56b('0x3'));var jsforce=require(_0xc56b('0x4'));var util=require(_0xc56b('0x5'));var Redis=require(_0xc56b('0x6'));var intUtil=require(_0xc56b('0x7'));var config=require(_0xc56b('0x8'));var logger=require(_0xc56b('0x9'))(_0xc56b('0xa'));config['redis']=_['defaults'](config[_0xc56b('0xb')],{'host':_0xc56b('0xc'),'port':0x18eb});var io=require(_0xc56b('0xd'))(new Redis(config[_0xc56b('0xb')]));function emit(_0x3268d0,_0x96beca,_0x474473){io['to'](_0x3268d0)['emit'](_0x96beca,_0x474473);}function getTicket(_0x4b3462,_0x29e45d,_0x4f626e,_0x2e4723,_0x1cb460,_0xaff2dd,_0x47b39e,_0x4f6f5a){var _0x40157e={};if(_0x2e4723[_0xc56b('0xe')]===_0xc56b('0xf')){_0x40157e=Object[_0xc56b('0x10')]({},{'OwnerId':_0x29e45d['id'],'ActivityDate':moment[_0xc56b('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xc56b('0x12')](_0x2e4723[_0xc56b('0x13')],_0x1cb460,'\x20'),'Description':intUtil[_0xc56b('0x12')](_0x2e4723[_0xc56b('0x14')],_0x1cb460,'\x0a')},getCustomFields(_0xaff2dd,_0x1cb460));if(_0x4f626e){_0x40157e[_0xc56b('0x15')]=_0x4f626e['id'];}}else if(_0x2e4723['ticketType']===_0xc56b('0x16')){_0x40157e=Object['assign']({},{'OwnerId':_0x29e45d['id'],'Subject':intUtil[_0xc56b('0x12')](_0x2e4723[_0xc56b('0x13')],_0x1cb460,'\x20'),'Description':intUtil[_0xc56b('0x12')](_0x2e4723[_0xc56b('0x14')],_0x1cb460,'\x0a')},getCustomFields(_0xaff2dd,_0x1cb460));if(_0x4f626e){_0x40157e['ContactId']=_0x4f626e['id'];}}return _0x47b39e[_0xc56b('0x17')](_0x2e4723[_0xc56b('0xe')])[_0xc56b('0x18')](_0x40157e);}function getUser(_0x383766,_0x399cf8,_0x3ee85b){if(!_[_0xc56b('0x19')](_0x399cf8)&&intUtil[_0xc56b('0x1a')](_0x399cf8)){var _0x428449={'Email':_0x399cf8};var _0x50f194={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3ee85b[_0xc56b('0x17')]('User')[_0xc56b('0x1b')](_0x428449,_0x50f194)['execute']()[_0xc56b('0x1c')](function(_0x2c6d47){if(_0x2c6d47[_0xc56b('0x1d')]){var _0x4d8257=_[_0xc56b('0x1b')](_0x2c6d47,function(_0x3c5ccf){return _0x3c5ccf[_0xc56b('0x1e')]===_0x399cf8;});if(_0x4d8257){logger['info'](_0xc56b('0x1f'),_0x399cf8);return BPromise['resolve']({'id':_0x4d8257['Id'],'name':_0x4d8257[_0xc56b('0x20')]});}}else{logger[_0xc56b('0x21')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x399cf8);return _0x3ee85b[_0xc56b('0x22')]()[_0xc56b('0x1c')](function(_0x387b09){return BPromise['resolve']({'id':_0x387b09[_0xc56b('0x23')],'name':_0x387b09[_0xc56b('0x24')]});});}});}else{logger[_0xc56b('0x21')](_0xc56b('0x25'),_0x399cf8);return _0x3ee85b[_0xc56b('0x22')]()[_0xc56b('0x1c')](function(_0x3a4155){return BPromise[_0xc56b('0x26')]({'id':_0x3a4155['user_id'],'name':_0x3a4155[_0xc56b('0x24')]});});}}function getEndUser(_0x1ea7f7,_0x19f558,_0x538383,_0x444e91,_0x1202cf){var _0x52bcf0={'Phone':_0x444e91};var _0x320aa5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){if(_0x19f558['ticketType']===_0xc56b('0xf')){logger[_0xc56b('0x21')](_0xc56b('0x27'),_0x444e91,_0x19f558[_0xc56b('0x28')]);switch(_0x19f558[_0xc56b('0x28')]){case'contact_lead':return _0x1202cf['sobject'](_0xc56b('0x29'))['find'](_0x52bcf0,_0x320aa5)[_0xc56b('0x2a')]()['then'](function(_0x49c47b){if(_0x49c47b&&_0x49c47b[_0xc56b('0x1d')]){return _0x49c47b;}else{return _0x1202cf[_0xc56b('0x17')]('Lead')[_0xc56b('0x1b')](_0x52bcf0,_0x320aa5);}});case _0xc56b('0x2b'):return _0x1202cf[_0xc56b('0x17')](_0xc56b('0x29'))[_0xc56b('0x1b')](_0x52bcf0,_0x320aa5)[_0xc56b('0x2a')]();case _0xc56b('0x2c'):return _0x1202cf[_0xc56b('0x17')]('Lead')[_0xc56b('0x1b')](_0x52bcf0,_0x320aa5);default:return null;}}else if(_0x19f558['ticketType']===_0xc56b('0x16')){logger['info'](_0xc56b('0x27'),_0x444e91,_0xc56b('0x2b'));return _0x1202cf['sobject'](_0xc56b('0x29'))[_0xc56b('0x1b')](_0x52bcf0,_0x320aa5)[_0xc56b('0x2a')]();}})['then'](function(_0x25e120){if(_0x25e120&&_0x25e120[_0xc56b('0x1d')]){var _0x226dac=_['find'](_0x25e120,function(_0x642343){return _0x642343[_0xc56b('0x2d')]===_0x444e91;});if(_0x226dac){return BPromise[_0xc56b('0x26')]({'id':_0x226dac['Id'],'name':_0x226dac[_0xc56b('0x20')],'phone':_0x226dac[_0xc56b('0x2d')]});}}})[_0xc56b('0x1c')](function(_0x383595){if(_0x383595){logger['info'](_0xc56b('0x2e'),_0x444e91);return BPromise[_0xc56b('0x26')](_0x383595);}else{logger[_0xc56b('0x21')](_0xc56b('0x2f'),_0x444e91);var _0x3b3208={'LastName':_0x538383!==''?_0x538383:util[_0xc56b('0x30')](_0xc56b('0x31'),_0x444e91),'Phone':_0x444e91};if(_0x19f558[_0xc56b('0x32')]){if(_0x19f558[_0xc56b('0x32')]==='contact'){logger[_0xc56b('0x21')](_0xc56b('0x33'),_0x444e91,_0x19f558['moduleCreate']);}else if(_0x19f558[_0xc56b('0x32')]===_0xc56b('0x2c')&&_0x19f558['ticketType']===_0xc56b('0xf')){logger[_0xc56b('0x21')](_0xc56b('0x33'),_0x444e91,_0x19f558['moduleCreate']);_0x3b3208[_0xc56b('0x34')]=_0xc56b('0x35');}else{return null;}}return _0x1202cf[_0xc56b('0x17')](_[_0xc56b('0x36')](_0x19f558[_0xc56b('0x32')]))['create'](_0x3b3208);}});}function getCustomFields(_0x1aac63,_0x22959e){var _0x13f37b={};if(_0x1aac63[_0xc56b('0x1d')]>0x0){_[_0xc56b('0x37')](_0x1aac63,function(_0x46dd5e){if(_0x46dd5e[_0xc56b('0x38')]===_0xc56b('0x39')&&_0x46dd5e['idField']){_0x13f37b[_0x46dd5e[_0xc56b('0x3a')]]=_0x46dd5e[_0xc56b('0x3b')]['toString']();}else if(_0x46dd5e[_0xc56b('0x38')]==='variable'&&_0x46dd5e[_0xc56b('0x3c')]&&_0x46dd5e['idField']){_0x22959e[_0x46dd5e[_0xc56b('0x3c')]]&&(_0x13f37b[_0x46dd5e['idField']]=_0x22959e[_0x46dd5e[_0xc56b('0x3c')]][_0xc56b('0x3d')]());}else if(_0x46dd5e[_0xc56b('0x38')]==='customVariable'&&_0x46dd5e['Variable']&&_0x46dd5e[_0xc56b('0x3e')][_0xc56b('0x3f')]&&_0x46dd5e['idField']){_0x22959e[_0x46dd5e[_0xc56b('0x3e')][_0xc56b('0x3f')]['toLowerCase']()]&&(_0x13f37b[_0x46dd5e['idField']]=_0x22959e[_0x46dd5e[_0xc56b('0x3e')]['name'][_0xc56b('0x40')]()][_0xc56b('0x3d')]());}});}return _0x13f37b;}function getConnection(_0x4f2cc6){var _0x3383a8=_0x4f2cc6['password'][_0xc56b('0x41')](_0x4f2cc6['securityToken']);var _0x496159=new jsforce[(_0xc56b('0x42'))]({'oauth2':{'loginUrl':_0x4f2cc6[_0xc56b('0x43')]||'https://login.salesforce.com','clientId':_0x4f2cc6['clientId'],'clientSecret':_0x4f2cc6[_0xc56b('0x44')]}});return _0x496159[_0xc56b('0x45')](_0x4f2cc6[_0xc56b('0x46')],_0x3383a8)[_0xc56b('0x1c')](function(){logger[_0xc56b('0x21')](_0xc56b('0x47'));return _0x496159;});}exports[_0xc56b('0x48')]=function(_0x585d32,_0x1262b7,_0x1fca95,_0x236515,_0x541aa5,_0x409180){var _0x169607,_0x3ad3a2,_0x107382,_0x29d016;_0x409180[_0xc56b('0x49')]=intUtil[_0xc56b('0x4a')](_0x409180[_0xc56b('0x49')]);_0x409180[_0xc56b('0x43')]=intUtil[_0xc56b('0x4a')](_0x409180[_0xc56b('0x43')]);if(_0x541aa5&&_0x541aa5[_0xc56b('0x4b')]){logger[_0xc56b('0x21')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1262b7[_0xc56b('0x4c')]=util[_0xc56b('0x30')](_0xc56b('0x4d'),_0x409180['serverUrl'],_0x1262b7[_0xc56b('0x4e')],md5(_0x1262b7[_0xc56b('0x4e')]));}else{_0x1262b7['recordingURL']='';}return getConnection(_0x409180)[_0xc56b('0x1c')](function(_0x44ca47){_0x29d016=_0x44ca47;return getUser(_0x409180,_0x236515[_0xc56b('0x4f')],_0x29d016);})[_0xc56b('0x1c')](function(_0x2f9685){_0x169607=_0x2f9685;return getEndUser(_0x409180,_0x1fca95,_0x1262b7[_0xc56b('0x50')],_0x1262b7[_0xc56b('0x51')],_0x29d016);})[_0xc56b('0x1c')](function(_0x18f913){_0x3ad3a2=_0x18f913;return getTicket(_0x409180,_0x169607,_0x3ad3a2,_0x1fca95,_0x1262b7,_0x1fca95['Fields'],_0x29d016,_0xc56b('0x48'));})[_0xc56b('0x1c')](function(_0x32ead5){_0x107382=_0x32ead5;logger['info'](_0xc56b('0x52'),_0x107382['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x107382['id'],_0x236515[_0xc56b('0x3f')],_0x409180[_0xc56b('0x38')]);switch(_0x409180[_0xc56b('0x38')]){case'integrationTab':emit(util[_0xc56b('0x30')](_0xc56b('0x53'),_0x236515[_0xc56b('0x3f')]),_0xc56b('0x54'),{'recordId':_0x107382['id']});break;case'newTab':emit(util[_0xc56b('0x30')](_0xc56b('0x53'),_0x236515[_0xc56b('0x3f')]),'trigger:browser:url',{'uri':util['format'](_0xc56b('0x55'),_0x29d016[_0xc56b('0x56')],_0x107382['id'])});break;default:logger[_0xc56b('0x57')](_0xc56b('0x58'));}})['catch'](function(_0x19e9b9){logger[_0xc56b('0x57')](_0xc56b('0x59'),JSON[_0xc56b('0x5a')](_0x19e9b9));});};exports[_0xc56b('0x5b')]=function(_0xc38bc7,_0x4f75ee,_0x65f1ac,_0x28c147,_0x1efc62,_0x323f7d,_0x2bbbba){var _0x59903b,_0x17462d,_0x9db06d,_0x52a982;_0x323f7d[_0xc56b('0x49')]=intUtil[_0xc56b('0x4a')](_0x323f7d[_0xc56b('0x49')]);_0x323f7d[_0xc56b('0x43')]=intUtil[_0xc56b('0x4a')](_0x323f7d[_0xc56b('0x43')]);if(_0x2bbbba&&_0x2bbbba[_0xc56b('0x5c')]&&_0x2bbbba[_0xc56b('0x5c')]!==_0xc56b('0x5d')){logger[_0xc56b('0x21')](_0xc56b('0x5e'),'Recording\x20is\x20enabled!');_0x4f75ee['recordingURL']=util[_0xc56b('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x323f7d[_0xc56b('0x49')],_0x4f75ee['uniqueid'],md5(_0x4f75ee[_0xc56b('0x4e')]));}return getConnection(_0x323f7d)[_0xc56b('0x1c')](function(_0x1f8f8b){_0x52a982=_0x1f8f8b;return getUser(_0x323f7d,_0x28c147[_0xc56b('0x4f')],_0x52a982);})[_0xc56b('0x1c')](function(_0x288c5a){_0x59903b=_0x288c5a;return getEndUser(_0x323f7d,_0x65f1ac,_0x4f75ee['destcalleridname'],_0x4f75ee['destcalleridnum'],_0x52a982);})[_0xc56b('0x1c')](function(_0x2238ef){_0x17462d=_0x2238ef;return getTicket(_0x323f7d,_0x59903b,_0x17462d,_0x65f1ac,_0x4f75ee,_0x65f1ac['Fields'],_0x52a982,'outbound');})[_0xc56b('0x1c')](function(_0x420227){_0x9db06d=_0x420227;logger[_0xc56b('0x21')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x9db06d['id']);logger[_0xc56b('0x21')](_0xc56b('0x5f'),_0x9db06d['id'],_0x28c147['name'],_0x323f7d[_0xc56b('0x38')]);switch(_0x323f7d[_0xc56b('0x38')]){case _0xc56b('0x60'):emit(util[_0xc56b('0x30')](_0xc56b('0x53'),_0x28c147['name']),_0xc56b('0x54'),{'recordId':_0x9db06d['id']});break;case _0xc56b('0x61'):emit(util[_0xc56b('0x30')](_0xc56b('0x53'),_0x28c147['name']),_0xc56b('0x62'),{'uri':util[_0xc56b('0x30')](_0xc56b('0x55'),_0x52a982[_0xc56b('0x56')],_0x9db06d['id'])});break;default:logger[_0xc56b('0x57')](_0xc56b('0x5e'),_0xc56b('0x63'));}})['catch'](function(_0x3f838c){logger[_0xc56b('0x57')]('[OUTBOUND]',JSON['stringify'](_0x3f838c));});};exports[_0xc56b('0x64')]=function(_0x4371f9,_0x1f3aac,_0x2544d3,_0x2e9e05,_0x2f9c94,_0x114e1a){var _0x5a48be,_0x37684b,_0x5791e5,_0x4108f6;_0x114e1a['serverUrl']=intUtil[_0xc56b('0x4a')](_0x114e1a[_0xc56b('0x49')]);_0x114e1a[_0xc56b('0x43')]=intUtil[_0xc56b('0x4a')](_0x114e1a[_0xc56b('0x43')]);if(_0x2f9c94&&_0x2f9c94[_0xc56b('0x4b')]){logger['info']('['+_0x1f3aac[_0xc56b('0x65')][_0xc56b('0x66')]()+']',_0xc56b('0x67'));_0x1f3aac[_0xc56b('0x4c')]=util[_0xc56b('0x30')](_0xc56b('0x4d'),_0x114e1a['serverUrl'],_0x1f3aac[_0xc56b('0x4e')],md5(_0x1f3aac[_0xc56b('0x4e')]));}else{_0x1f3aac['recordingURL']='';}return getConnection(_0x114e1a)[_0xc56b('0x1c')](function(_0x146885){_0x4108f6=_0x146885;if(!_[_0xc56b('0x19')](_0x2e9e05)){return getUser(_0x114e1a,_0x2e9e05[_0xc56b('0x3f')],_0x4108f6);}else{return getUser(_0x114e1a,null,_0x4108f6);}})['then'](function(_0xb1df31){_0x5a48be=_0xb1df31;return getEndUser(_0x114e1a,_0x2544d3,_0x1f3aac[_0xc56b('0x50')],_0x1f3aac[_0xc56b('0x51')],_0x4108f6);})[_0xc56b('0x1c')](function(_0xde3172){_0x37684b=_0xde3172;return getTicket(_0x114e1a,_0x5a48be,_0x37684b,_0x2544d3,_0x1f3aac,_0x2544d3['Fields'],_0x4108f6);})['then'](function(_0x280192){_0x5791e5=_0x280192;logger[_0xc56b('0x21')]('['+_0x1f3aac[_0xc56b('0x65')][_0xc56b('0x66')]()+_0xc56b('0x68'),_0x5791e5['id']);logger['info']('['+_0x1f3aac['lastevent'][_0xc56b('0x66')]()+_0xc56b('0x69'),_0x114e1a[_0xc56b('0x38')]);})['catch'](function(_0x172e97){logger[_0xc56b('0x57')]('['+_0x1f3aac['lastevent'][_0xc56b('0x66')]()+']',JSON['stringify'](_0x172e97));});}; \ No newline at end of file +var _0x4823=['type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','recordingFormat','none','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','ticketType','assign','utc','getString','WhoId','Case','Subjects','Descriptions','ContactId','sobject','create','isNil','validateEmail','User','find','execute','then','Agent\x20%s\x20found.','resolve','Name','info','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.','Contact','Lead','length','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','format','Caller\x20-\x20%s','moduleCreate','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Task','Company','No\x20Company','forEach'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4823,0xa0));var _0x3482=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x4823[_0x1d426f];return _0x17f71a;};'use strict';var _=require(_0x3482('0x0'));var rp=require(_0x3482('0x1'));var moment=require(_0x3482('0x2'));var BPromise=require('bluebird');var md5=require(_0x3482('0x3'));var jsforce=require('jsforce');var util=require(_0x3482('0x4'));var Redis=require(_0x3482('0x5'));var intUtil=require(_0x3482('0x6'));var config=require(_0x3482('0x7'));var logger=require(_0x3482('0x8'))('salesforce');config[_0x3482('0x9')]=_[_0x3482('0xa')](config[_0x3482('0x9')],{'host':_0x3482('0xb'),'port':0x18eb});var io=require(_0x3482('0xc'))(new Redis(config[_0x3482('0x9')]));function emit(_0x3a368f,_0x4956f9,_0x295ece){io['to'](_0x3a368f)[_0x3482('0xd')](_0x4956f9,_0x295ece);}function getTicket(_0x54a98d,_0xf3e927,_0x3417ab,_0x1cce53,_0x25f63b,_0x57f419,_0x167934,_0x48bd8b){var _0x249ed6={};if(_0x1cce53[_0x3482('0xe')]==='Task'){_0x249ed6=Object[_0x3482('0xf')]({},{'OwnerId':_0xf3e927['id'],'ActivityDate':moment[_0x3482('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3482('0x11')](_0x1cce53['Subjects'],_0x25f63b,'\x20'),'Description':intUtil[_0x3482('0x11')](_0x1cce53['Descriptions'],_0x25f63b,'\x0a')},getCustomFields(_0x57f419,_0x25f63b));if(_0x3417ab){_0x249ed6[_0x3482('0x12')]=_0x3417ab['id'];}}else if(_0x1cce53[_0x3482('0xe')]===_0x3482('0x13')){_0x249ed6=Object[_0x3482('0xf')]({},{'OwnerId':_0xf3e927['id'],'Subject':intUtil[_0x3482('0x11')](_0x1cce53[_0x3482('0x14')],_0x25f63b,'\x20'),'Description':intUtil[_0x3482('0x11')](_0x1cce53[_0x3482('0x15')],_0x25f63b,'\x0a')},getCustomFields(_0x57f419,_0x25f63b));if(_0x3417ab){_0x249ed6[_0x3482('0x16')]=_0x3417ab['id'];}}return _0x167934[_0x3482('0x17')](_0x1cce53[_0x3482('0xe')])[_0x3482('0x18')](_0x249ed6);}function getUser(_0x2bc2a3,_0x362ee7,_0x339338){if(!_[_0x3482('0x19')](_0x362ee7)&&intUtil[_0x3482('0x1a')](_0x362ee7)){var _0x2aeaeb={'Email':_0x362ee7};var _0x13f98f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x339338[_0x3482('0x17')](_0x3482('0x1b'))[_0x3482('0x1c')](_0x2aeaeb,_0x13f98f)[_0x3482('0x1d')]()[_0x3482('0x1e')](function(_0x2d5657){if(_0x2d5657['length']){var _0x381098=_['find'](_0x2d5657,function(_0x45d048){return _0x45d048['Email']===_0x362ee7;});if(_0x381098){logger['info'](_0x3482('0x1f'),_0x362ee7);return BPromise[_0x3482('0x20')]({'id':_0x381098['Id'],'name':_0x381098[_0x3482('0x21')]});}}else{logger[_0x3482('0x22')](_0x3482('0x23'),_0x362ee7);return _0x339338[_0x3482('0x24')]()[_0x3482('0x1e')](function(_0x3b5487){return BPromise[_0x3482('0x20')]({'id':_0x3b5487[_0x3482('0x25')],'name':_0x3b5487['display_name']});});}});}else{logger[_0x3482('0x22')](_0x3482('0x23'),_0x362ee7);return _0x339338['identity']()[_0x3482('0x1e')](function(_0x4a0a5c){return BPromise['resolve']({'id':_0x4a0a5c[_0x3482('0x25')],'name':_0x4a0a5c[_0x3482('0x26')]});});}}function getEndUser(_0x588c90,_0x4aabe7,_0x28f479,_0x20ee16,_0x5a0b3b){var _0x5aeb9a={'Phone':_0x20ee16};var _0x4dacc9={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3482('0x20')]()['then'](function(){if(_0x4aabe7[_0x3482('0xe')]==='Task'){logger['info'](_0x3482('0x27'),_0x20ee16,_0x4aabe7['moduleSearch']);switch(_0x4aabe7['moduleSearch']){case'contact_lead':return _0x5a0b3b['sobject'](_0x3482('0x28'))['find'](_0x5aeb9a,_0x4dacc9)[_0x3482('0x1d')]()[_0x3482('0x1e')](function(_0x4db71d){if(_0x4db71d&&_0x4db71d['length']){return _0x4db71d;}else{return _0x5a0b3b[_0x3482('0x17')](_0x3482('0x29'))[_0x3482('0x1c')](_0x5aeb9a,_0x4dacc9);}});case'contact':return _0x5a0b3b[_0x3482('0x17')]('Contact')['find'](_0x5aeb9a,_0x4dacc9)['execute']();case'lead':return _0x5a0b3b[_0x3482('0x17')]('Lead')[_0x3482('0x1c')](_0x5aeb9a,_0x4dacc9);default:return null;}}else if(_0x4aabe7[_0x3482('0xe')]==='Case'){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x20ee16,'contact');return _0x5a0b3b[_0x3482('0x17')](_0x3482('0x28'))[_0x3482('0x1c')](_0x5aeb9a,_0x4dacc9)[_0x3482('0x1d')]();}})[_0x3482('0x1e')](function(_0x2777e8){if(_0x2777e8&&_0x2777e8[_0x3482('0x2a')]){var _0x516875=_['find'](_0x2777e8,function(_0x56f942){return _0x56f942[_0x3482('0x2b')]===_0x20ee16;});if(_0x516875){return BPromise['resolve']({'id':_0x516875['Id'],'name':_0x516875['Name'],'phone':_0x516875['Phone']});}}})[_0x3482('0x1e')](function(_0x5b94e8){if(_0x5b94e8){logger[_0x3482('0x22')](_0x3482('0x2c'),_0x20ee16);return BPromise['resolve'](_0x5b94e8);}else{logger[_0x3482('0x22')](_0x3482('0x2d'),_0x20ee16);var _0xbac07c={'LastName':_0x28f479!==''?_0x28f479:util[_0x3482('0x2e')](_0x3482('0x2f'),_0x20ee16),'Phone':_0x20ee16};if(_0x4aabe7[_0x3482('0x30')]){if(_0x4aabe7[_0x3482('0x30')]===_0x3482('0x31')){logger[_0x3482('0x22')](_0x3482('0x32'),_0x20ee16,_0x4aabe7[_0x3482('0x30')]);}else if(_0x4aabe7[_0x3482('0x30')]===_0x3482('0x33')&&_0x4aabe7[_0x3482('0xe')]===_0x3482('0x34')){logger[_0x3482('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x20ee16,_0x4aabe7[_0x3482('0x30')]);_0xbac07c[_0x3482('0x35')]=_0x3482('0x36');}else{return null;}}return _0x5a0b3b[_0x3482('0x17')](_['upperFirst'](_0x4aabe7[_0x3482('0x30')]))[_0x3482('0x18')](_0xbac07c);}});}function getCustomFields(_0x38630d,_0x4553b6){var _0x1d7796={};if(_0x38630d[_0x3482('0x2a')]>0x0){_[_0x3482('0x37')](_0x38630d,function(_0xfda152){if(_0xfda152[_0x3482('0x38')]==='string'&&_0xfda152[_0x3482('0x39')]){_0x1d7796[_0xfda152[_0x3482('0x39')]]=_0xfda152[_0x3482('0x3a')][_0x3482('0x3b')]();}else if(_0xfda152[_0x3482('0x38')]===_0x3482('0x3c')&&_0xfda152[_0x3482('0x3d')]&&_0xfda152[_0x3482('0x39')]){_0x4553b6[_0xfda152['variableName']]&&(_0x1d7796[_0xfda152[_0x3482('0x39')]]=_0x4553b6[_0xfda152[_0x3482('0x3d')]][_0x3482('0x3b')]());}else if(_0xfda152[_0x3482('0x38')]===_0x3482('0x3e')&&_0xfda152[_0x3482('0x3f')]&&_0xfda152[_0x3482('0x3f')]['name']&&_0xfda152[_0x3482('0x39')]){_0x4553b6[_0xfda152[_0x3482('0x3f')][_0x3482('0x40')][_0x3482('0x41')]()]&&(_0x1d7796[_0xfda152[_0x3482('0x39')]]=_0x4553b6[_0xfda152['Variable'][_0x3482('0x40')][_0x3482('0x41')]()][_0x3482('0x3b')]());}});}return _0x1d7796;}function getConnection(_0x5b46ca){var _0x5abb5b=_0x5b46ca['password']['concat'](_0x5b46ca['securityToken']);var _0x462d46=new jsforce[(_0x3482('0x42'))]({'oauth2':{'loginUrl':_0x5b46ca[_0x3482('0x43')]||_0x3482('0x44'),'clientId':_0x5b46ca['clientId'],'clientSecret':_0x5b46ca[_0x3482('0x45')]}});return _0x462d46[_0x3482('0x46')](_0x5b46ca[_0x3482('0x47')],_0x5abb5b)[_0x3482('0x1e')](function(){logger[_0x3482('0x22')](_0x3482('0x48'));return _0x462d46;});}exports[_0x3482('0x49')]=function(_0x4453a0,_0x139945,_0x43dd82,_0x35a583,_0x5d2149,_0x3f64af){var _0x3d7d09,_0x486f0b,_0x96a28d,_0x36262a;_0x3f64af['serverUrl']=intUtil['stripTrailingSlash'](_0x3f64af[_0x3482('0x4a')]);_0x3f64af[_0x3482('0x43')]=intUtil['stripTrailingSlash'](_0x3f64af['remoteUri']);if(_0x5d2149&&_0x5d2149['monitor_format']){logger[_0x3482('0x22')]('[QUEUE]',_0x3482('0x4b'));_0x139945[_0x3482('0x4c')]=util[_0x3482('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f64af[_0x3482('0x4a')],_0x139945[_0x3482('0x4d')],md5(_0x139945[_0x3482('0x4d')]));}else{_0x139945[_0x3482('0x4c')]='';}return getConnection(_0x3f64af)[_0x3482('0x1e')](function(_0x3d5a15){_0x36262a=_0x3d5a15;return getUser(_0x3f64af,_0x35a583['email'],_0x36262a);})[_0x3482('0x1e')](function(_0x162136){_0x3d7d09=_0x162136;return getEndUser(_0x3f64af,_0x43dd82,_0x139945[_0x3482('0x4e')],_0x139945[_0x3482('0x4f')],_0x36262a);})[_0x3482('0x1e')](function(_0x5ed907){_0x486f0b=_0x5ed907;return getTicket(_0x3f64af,_0x3d7d09,_0x486f0b,_0x43dd82,_0x139945,_0x43dd82[_0x3482('0x50')],_0x36262a,_0x3482('0x49'));})[_0x3482('0x1e')](function(_0x54d427){_0x96a28d=_0x54d427;logger[_0x3482('0x22')](_0x3482('0x51'),_0x96a28d['id']);logger['info'](_0x3482('0x52'),_0x96a28d['id'],_0x35a583[_0x3482('0x40')],_0x3f64af[_0x3482('0x38')]);switch(_0x3f64af['type']){case _0x3482('0x53'):emit(util[_0x3482('0x2e')]('user:%s',_0x35a583[_0x3482('0x40')]),_0x3482('0x54'),{'recordId':_0x96a28d['id']});break;case _0x3482('0x55'):emit(util[_0x3482('0x2e')](_0x3482('0x56'),_0x35a583['name']),_0x3482('0x57'),{'uri':util['format'](_0x3482('0x58'),_0x36262a[_0x3482('0x59')],_0x96a28d['id'])});break;default:logger[_0x3482('0x5a')](_0x3482('0x5b'));}})[_0x3482('0x5c')](function(_0x3b2159){logger[_0x3482('0x5a')]('[QUEUE]',JSON[_0x3482('0x5d')](_0x3b2159));});};exports['outbound']=function(_0x473afc,_0x2f3e23,_0x5ab34f,_0x1053ac,_0x5cf315,_0x2f57c3,_0x4f68e5){var _0x25b5ee,_0x2dc918,_0x10e3aa,_0x530572;_0x2f57c3[_0x3482('0x4a')]=intUtil['stripTrailingSlash'](_0x2f57c3[_0x3482('0x4a')]);_0x2f57c3[_0x3482('0x43')]=intUtil['stripTrailingSlash'](_0x2f57c3[_0x3482('0x43')]);if(_0x4f68e5&&_0x4f68e5[_0x3482('0x5e')]&&_0x4f68e5[_0x3482('0x5e')]!==_0x3482('0x5f')){logger[_0x3482('0x22')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2f3e23['recordingURL']=util[_0x3482('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f57c3['serverUrl'],_0x2f3e23[_0x3482('0x4d')],md5(_0x2f3e23[_0x3482('0x4d')]));}return getConnection(_0x2f57c3)['then'](function(_0x5ca74b){_0x530572=_0x5ca74b;return getUser(_0x2f57c3,_0x1053ac['email'],_0x530572);})[_0x3482('0x1e')](function(_0xe8e720){_0x25b5ee=_0xe8e720;return getEndUser(_0x2f57c3,_0x5ab34f,_0x2f3e23[_0x3482('0x60')],_0x2f3e23[_0x3482('0x61')],_0x530572);})[_0x3482('0x1e')](function(_0x163b13){_0x2dc918=_0x163b13;return getTicket(_0x2f57c3,_0x25b5ee,_0x2dc918,_0x5ab34f,_0x2f3e23,_0x5ab34f[_0x3482('0x50')],_0x530572,_0x3482('0x62'));})[_0x3482('0x1e')](function(_0x568bf4){_0x10e3aa=_0x568bf4;logger[_0x3482('0x22')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x10e3aa['id']);logger['info'](_0x3482('0x63'),_0x10e3aa['id'],_0x1053ac[_0x3482('0x40')],_0x2f57c3[_0x3482('0x38')]);switch(_0x2f57c3[_0x3482('0x38')]){case _0x3482('0x53'):emit(util['format'](_0x3482('0x56'),_0x1053ac[_0x3482('0x40')]),_0x3482('0x54'),{'recordId':_0x10e3aa['id']});break;case _0x3482('0x55'):emit(util[_0x3482('0x2e')](_0x3482('0x56'),_0x1053ac[_0x3482('0x40')]),_0x3482('0x57'),{'uri':util[_0x3482('0x2e')](_0x3482('0x58'),_0x530572['instanceUrl'],_0x10e3aa['id'])});break;default:logger[_0x3482('0x5a')](_0x3482('0x64'),_0x3482('0x65'));}})[_0x3482('0x5c')](function(_0x529b56){logger[_0x3482('0x5a')](_0x3482('0x64'),JSON[_0x3482('0x5d')](_0x529b56));});};exports['unmanaged']=function(_0x4ce974,_0x1ba0db,_0x1c15dc,_0x1db01b,_0x5829df,_0x2df438){var _0xb1cda2,_0x49eb9f,_0x54f583,_0x59cec4;_0x2df438['serverUrl']=intUtil['stripTrailingSlash'](_0x2df438[_0x3482('0x4a')]);_0x2df438[_0x3482('0x43')]=intUtil['stripTrailingSlash'](_0x2df438['remoteUri']);if(_0x5829df&&_0x5829df[_0x3482('0x66')]){logger['info']('['+_0x1ba0db['lastevent'][_0x3482('0x67')]()+']','Recording\x20is\x20enabled!');_0x1ba0db[_0x3482('0x4c')]=util[_0x3482('0x2e')](_0x3482('0x68'),_0x2df438[_0x3482('0x4a')],_0x1ba0db['uniqueid'],md5(_0x1ba0db[_0x3482('0x4d')]));}else{_0x1ba0db[_0x3482('0x4c')]='';}return getConnection(_0x2df438)[_0x3482('0x1e')](function(_0x326c7d){_0x59cec4=_0x326c7d;if(!_['isNil'](_0x1db01b)){return getUser(_0x2df438,_0x1db01b[_0x3482('0x40')],_0x59cec4);}else{return getUser(_0x2df438,null,_0x59cec4);}})[_0x3482('0x1e')](function(_0x1b9e86){_0xb1cda2=_0x1b9e86;return getEndUser(_0x2df438,_0x1c15dc,_0x1ba0db[_0x3482('0x4e')],_0x1ba0db[_0x3482('0x4f')],_0x59cec4);})[_0x3482('0x1e')](function(_0x45d84d){_0x49eb9f=_0x45d84d;return getTicket(_0x2df438,_0xb1cda2,_0x49eb9f,_0x1c15dc,_0x1ba0db,_0x1c15dc['Fields'],_0x59cec4);})[_0x3482('0x1e')](function(_0x1d4584){_0x54f583=_0x1d4584;logger[_0x3482('0x22')]('['+_0x1ba0db[_0x3482('0x69')][_0x3482('0x67')]()+_0x3482('0x6a'),_0x54f583['id']);logger[_0x3482('0x22')]('['+_0x1ba0db['lastevent'][_0x3482('0x67')]()+_0x3482('0x6b'),_0x2df438[_0x3482('0x38')]);})['catch'](function(_0x19d6b8){logger[_0x3482('0x5a')]('['+_0x1ba0db[_0x3482('0x69')][_0x3482('0x67')]()+']',JSON[_0x3482('0x5d')](_0x19d6b8));});}; \ 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 7d3cc3f..d89bb07 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 _0x7a54=['getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','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','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign'];(function(_0x41f96e,_0x333851){var _0x48a4ac=function(_0xdad934){while(--_0xdad934){_0x41f96e['push'](_0x41f96e['shift']());}};_0x48a4ac(++_0x333851);}(_0x7a54,0x106));var _0x47a5=function(_0x5b0dac,_0x5da18d){_0x5b0dac=_0x5b0dac-0x0;var _0x17f34d=_0x7a54[_0x5b0dac];return _0x17f34d;};'use strict';var _=require(_0x47a5('0x0'));var Promise=require(_0x47a5('0x1'));var rp=require(_0x47a5('0x2'));var util=require('util');var md5=require(_0x47a5('0x3'));var Redis=require(_0x47a5('0x4'));var intUtil=require('./util');var config=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));function getAdminUser(_0x30e405,_0x506eda,_0x194fb0,_0x5077f3,_0x5d90b3,_0x582352){return new Promise(function(_0x2a0e98,_0x2baee7){var _0x5e31dd={'method':_0x47a5('0xb'),'uri':_0x5077f3+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5d90b3+'&'+_0x582352,'auth':_0x506eda,'json':!![]};return rp(_0x5e31dd)['then'](function(_0x1f47f4){if(_0x1f47f4[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x194fb0[_0x47a5('0xe')]=_0x1f47f4[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}logger[_0x47a5('0x10')]('['+[_0x30e405['toUpperCase']()]+_0x47a5('0x11'),_0x194fb0);_0x2a0e98(_0x194fb0);})[_0x47a5('0x12')](function(_0x1cf309){logger[_0x47a5('0x13')]('['+[_0x30e405[_0x47a5('0x14')]()]+']',_0x1cf309[_0x47a5('0x15')]);_0x2baee7(_0x1cf309[_0x47a5('0x15')]);});});}function getUser(_0x190faa,_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return function(_0x2a2cbb){logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x2a2cbb);return new Promise(function(_0x138bc0,_0x4b966e){if(intUtil['validateEmail'](_0x2a2cbb[_0x47a5('0x16')])){var _0xaf70a6={'method':_0x47a5('0xb'),'uri':_0x362359+_0x47a5('0x17')+_0x2a2cbb[_0x47a5('0x16')]+'&'+_0x11faf5+'&'+_0x3b001e,'auth':_0x4e99a8,'json':!![]};logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x18'),_0xaf70a6);return rp(_0xaf70a6)[_0x47a5('0x19')](function(_0x4a9fcb){logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+'],\x20getUser\x20entity',_0x4a9fcb);if(_0x4a9fcb[_0x47a5('0xc')][_0x47a5('0xd')]>0x0&&String(_0x4a9fcb[_0x47a5('0xc')][0x0]['active'])===_0x47a5('0x1a')){_0x2a2cbb[_0x47a5('0x1b')]=_0x4a9fcb[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}else{_0x2a2cbb['userId']=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb['adminEmail'];}logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x1c'),_0x2a2cbb);_0x138bc0(_0x2a2cbb);})[_0x47a5('0x12')](function(_0x3abd6a){logger['error']('['+[_0x190faa['toUpperCase']()]+']',_0x3abd6a[_0x47a5('0x15')]);_0x4b966e(_0x3abd6a['message']);});}else{logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+_0x47a5('0x1d'));_0x2a2cbb[_0x47a5('0x1b')]=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb[_0x47a5('0x1e')];_0x138bc0(_0x2a2cbb);}});};}function createEndUser(_0x3ba0b7,_0x24b162,_0x136b14,_0x16631f,_0x361bfa){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+_0x47a5('0x1f'),_0x136b14);return new Promise(function(_0x528582,_0x243210){var _0x51833b={'method':_0x47a5('0x20'),'uri':_0x16631f+_0x47a5('0x21')+_0x361bfa,'body':{'user_name':_0x136b14[_0x47a5('0x22')],'roles':'user','first_name':_0x136b14[_0x47a5('0x22')],'active':_0x47a5('0x1a'),'date_format':_0x47a5('0x23'),'phone':_0x136b14[_0x47a5('0x22')]},'auth':_0x24b162,'json':!![]};return rp(_0x51833b)['then'](function(_0x50d875){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+'],\x20EndUser\x20schema',_0x50d875['result']);_0x136b14[_0x47a5('0x24')]=_0x50d875[_0x47a5('0xc')]['sys_id'];_0x528582(_0x136b14);})[_0x47a5('0x12')](function(_0x53119b){logger[_0x47a5('0x13')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+']',_0x53119b['message']);_0x243210(_0x53119b['message']);});});}function getEndUser(_0x274e34,_0x5910bb,_0x403028,_0x87e4c9,_0xf269a8){return function(_0x52749b){logger[_0x47a5('0x10')]('['+[_0x274e34['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x52749b);return new Promise(function(_0x65542e,_0x5a8a7c){var _0x25cce0={'method':'GET','uri':_0x403028+_0x47a5('0x25')+_0x52749b[_0x47a5('0x22')]+'&'+_0x87e4c9+'&'+_0xf269a8,'auth':_0x5910bb,'json':!![]};return rp(_0x25cce0)[_0x47a5('0x19')](function(_0x199698){if(_0x199698[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x52749b[_0x47a5('0x24')]=_0x199698[_0x47a5('0xc')][0x0][_0x47a5('0xf')];logger['info']('['+[_0x274e34[_0x47a5('0x14')]()]+_0x47a5('0x26'),_0x52749b);_0x65542e(_0x52749b);}else{return createEndUser(_0x274e34,_0x5910bb,_0x52749b,_0x403028,_0x87e4c9)['then'](function(_0x2c50d6){logger[_0x47a5('0x10')]('['+[_0x274e34[_0x47a5('0x14')]()]+'],\x20createEndUser\x20crm',_0x2c50d6);_0x65542e(_0x2c50d6);});}})[_0x47a5('0x12')](function(_0x10f660){logger['error']('['+[_0x274e34[_0x47a5('0x14')]()]+']',_0x10f660[_0x47a5('0x15')]);_0x5a8a7c(_0x10f660['message']);});});};}function getCustomFields(_0x55c5eb,_0x5ebd8c){var _0x12d9f2={};if(_0x55c5eb['length']>0x0){_[_0x47a5('0x27')](_0x55c5eb,function(_0x1f9631){if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2a')]&&!_0x1f9631[_0x47a5('0x2b')]){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2c')]&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631['type']===_0x47a5('0x30')&&_0x1f9631['variableName']&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631['idField'][_0x47a5('0x2d')]()]=_0x5ebd8c[_0x1f9631['variableName']][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x31')&&_0x1f9631['Variable']&&_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')]&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')]['toLowerCase']()]=_0x5ebd8c[_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')][_0x47a5('0x2d')]()][_0x47a5('0x2f')]();}});}return _0x12d9f2;}function getTicket(_0x34a9ae,_0xf0edbb,_0x434227,_0x17cc42,_0xac9c15,_0x162fa0){return function(_0x24ecb1){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+_0x47a5('0x34'),_0x24ecb1);return new Promise(function(_0x4e5e7,_0x3a2b38){var _0x512e65=_0x34a9ae[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x24ecb1['userId']:_0x24ecb1['endUserId'];var _0x3d0a88={'method':'POST','uri':_0x434227+_0x47a5('0x36')+'?'+_0x162fa0,'body':Object[_0x47a5('0x37')]({},{'active':'true','caller_id':_0x512e65,'assigned_to':_0x24ecb1['userId'],'short_description':intUtil[_0x47a5('0x38')](_0x17cc42['Subjects'],_0xac9c15,'\x20'),'description':intUtil[_0x47a5('0x38')](_0x17cc42[_0x47a5('0x39')],_0xac9c15,'\x0a')},getCustomFields(_0x17cc42[_0x47a5('0x3a')],_0xac9c15)),'auth':_0xf0edbb,'json':!![]};return rp(_0x3d0a88)[_0x47a5('0x19')](function(_0x44fe8a){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x44fe8a['result']);_0x24ecb1[_0x47a5('0x3b')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0xf')];_0x24ecb1[_0x47a5('0x3c')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0x3d')];logger[_0x47a5('0x10')]('['+[_0x34a9ae['toUpperCase']()]+_0x47a5('0x3e'),_0x24ecb1);_0x4e5e7(_0x24ecb1);})[_0x47a5('0x12')](function(_0x5f6a){logger['error']('['+[_0x34a9ae[_0x47a5('0x14')]()]+']',_0x5f6a['message']);_0x3a2b38(_0x5f6a[_0x47a5('0x15')]);});});};}function createRemoteTag(_0xe31817,_0x46e90b,_0xf03bd5,_0x588551){return new Promise(function(_0x3adf14,_0x1e6de3){var _0x2f66e9={'method':_0x47a5('0x20'),'uri':_0xf03bd5+_0x47a5('0x3f')+'?'+_0x588551,'body':{'short_description':_0xe31817,'global':!![],'active':!![],'name':_0xe31817},'auth':_0x46e90b,'json':!![]};return rp(_0x2f66e9)[_0x47a5('0x19')](function(_0x24e9f4){var _0x481089=_0x24e9f4[_0x47a5('0xc')][_0x47a5('0xf')];_0x3adf14(_0x481089);});});}function getRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf,_0x572233){return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581={'method':'GET','uri':_0x3329aa+_0x47a5('0x3f')+_0x47a5('0x40')+_0x187d7e+'&'+_0x1ab0bf,'auth':_0x8da9fb,'json':!![]};return rp(_0x1aa581)[_0x47a5('0x19')](function(_0x5d8d4a){if(_0x5d8d4a['result'][_0x47a5('0xd')]>0x0){var _0x376e1d=_0x5d8d4a['result'][0x0]['sys_id'];_0x1ad6a9(_0x376e1d);}else{return createRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf)[_0x47a5('0x19')](function(_0x4d6a82){_0x1ad6a9(_0x4d6a82);});}});});}function assignTagToIncident(_0x16bb8a,_0x5d383d,_0x482de6,_0x389ed9,_0x46d2d3){return new Promise(function(_0x53eedf,_0x1b958b){var _0x72fe={'method':'POST','uri':_0x482de6+'label_entry'+'?'+_0x46d2d3,'body':{'label':_0x16bb8a,'table':_0x47a5('0x36'),'id_type':_0x47a5('0x41'),'table_key':_0x389ed9[_0x47a5('0x3b')],'title':_0x47a5('0x42')+_0x389ed9['ticketNumber'],'id_display':_0x389ed9[_0x47a5('0x3c')]},'auth':_0x5d383d,'json':!![]};return rp(_0x72fe)[_0x47a5('0x19')](function(_0x1af800){_0x53eedf();})['catch'](function(){_0x53eedf();});});}function manageTags(_0x30ea7a,_0x4db625,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b,_0x3603b7){return new Promise(function(_0x4966af,_0x144af9){var _0x5d1550=[];_0x4db625['forEach'](function(_0x5eb150){_0x5d1550['push'](getRemoteTag(_0x5eb150,_0x485e3c,_0x470da6,_0x1c485b,_0x3603b7));});return Promise[_0x47a5('0x43')](_0x5d1550)[_0x47a5('0x19')](function(_0x1e2bb4){if(_0x1e2bb4['length']){logger['info']('['+[_0x30ea7a[_0x47a5('0x14')]()]+_0x47a5('0x44'),_0x1e2bb4);var _0x45d4b6=[];_0x1e2bb4[_0x47a5('0x27')](function(_0xc45e25){_0x45d4b6['push'](assignTagToIncident(_0xc45e25,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b));});return Promise[_0x47a5('0x43')](_0x45d4b6)['then'](function(){_0x4966af();})[_0x47a5('0x12')](function(){_0x4966af();});}else{_0x4966af();}});});}function getTags(_0x274d31,_0x4d545f,_0x32b4de,_0x345104,_0x132854,_0x3e8274){return function(_0x2d6494){return new Promise(function(_0x215634,_0x35cca8){var _0x3ac38c=[];var _0x57ed0a=_0x345104[_0x47a5('0x45')];if(_0x57ed0a&&_0x57ed0a[_0x47a5('0xd')]>0x0){_0x3ac38c=_[_0x47a5('0x46')](_0x57ed0a,_0x47a5('0x33'));}if(_0x3ac38c[_0x47a5('0xd')]>0x0){return manageTags(_0x274d31,_0x3ac38c,_0x4d545f,_0x32b4de,_0x2d6494,_0x132854,_0x3e8274)['then'](function(){_0x215634(_0x2d6494);});}else{_0x215634(_0x2d6494);}});};}function emit(_0xbec033,_0xdfcecc,_0x1224bc){var _0x144aaa=_0x47a5('0x47')+_0x47a5('0x48')+_0x47a5('0x49')+_0x47a5('0x4a');var _0x350af8={'uri':_0xbec033+_0x47a5('0x4b')+_0x1224bc+_0x144aaa};io['to'](util[_0x47a5('0x4c')](_0x47a5('0x4d'),_0xdfcecc))[_0x47a5('0x4e')](_0x47a5('0x4f'),_0x350af8);}exports['cs']=function(_0x3edd17,_0x5a6161,_0x42dd7d,_0x284fb8,_0x30504e,_0x4b42f3,_0x37ac59,_0x2e46af){var _0x36c67={};var _0x26f1ac={'user':_0x4b42f3['username'],'pass':_0x4b42f3[_0x47a5('0x50')]};var _0x522ccf=_0x47a5('0x51');var _0x487e21=_0x47a5('0x52');_0x4b42f3['remoteUri']=intUtil[_0x47a5('0x53')](_0x4b42f3[_0x47a5('0x54')]);_0x4b42f3[_0x47a5('0x55')]=intUtil['stripTrailingSlash'](_0x4b42f3['serverUrl']);var _0x4b8084=util[_0x47a5('0x4c')](_0x47a5('0x56'),_0x4b42f3[_0x47a5('0x54')]);_0x36c67[_0x47a5('0x16')]=!_['isNil'](_0x284fb8)?_0x284fb8[_0x47a5('0x57')]:null;_0x36c67[_0x47a5('0x1e')]=_0x4b42f3[_0x47a5('0x57')];_0x36c67[_0x47a5('0x22')]=_0x2e46af[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x5a6161[_0x47a5('0x58')]:_0x5a6161[_0x47a5('0x59')];_0x36c67[_0x47a5('0x5a')]=_0x2e46af===_0x47a5('0x5b')||_0x2e46af===_0x47a5('0x5c')?_0x47a5('0x5b'):'outbound';var _0x1e3212=util['format'](_0x47a5('0x5d'),_0x4b42f3[_0x47a5('0x55')],_0x5a6161[_0x47a5('0x5e')],md5(_0x5a6161[_0x47a5('0x5e')]));if(_0x30504e&&_0x30504e[_0x47a5('0x5f')]){logger[_0x47a5('0x10')](_0x47a5('0x60'),_0x47a5('0x61'));_0x5a6161[_0x47a5('0x62')]=_0x1e3212;}else if(_0x37ac59&&_0x37ac59[_0x47a5('0x63')]&&_0x37ac59[_0x47a5('0x63')]!==_0x47a5('0x64')){logger[_0x47a5('0x10')](_0x47a5('0x65'),_0x47a5('0x61'));_0x5a6161['recordingURL']=_0x1e3212;}else{_0x5a6161['recordingURL']='';}return getAdminUser(_0x2e46af,_0x26f1ac,_0x36c67,_0x4b8084,_0x487e21,_0x522ccf)['then'](getUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))['then'](getEndUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))[_0x47a5('0x19')](getTicket(_0x2e46af,_0x26f1ac,_0x4b8084,_0x42dd7d,_0x5a6161,_0x487e21))[_0x47a5('0x19')](function(_0x5d6916){logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x66'),_0x5d6916[_0x47a5('0x3b')]));logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x67'),_0x2e46af));if(_0x2e46af!==_0x47a5('0x5c')){logger[_0x47a5('0x10')]('['+[_0x2e46af[_0x47a5('0x14')]()]+']',_0x47a5('0x68'));emit(_0x4b42f3['remoteUri'],_0x284fb8[_0x47a5('0x33')],_0x5d6916[_0x47a5('0x3b')]);}})[_0x47a5('0x12')](function(_0x4f35ff){logger[_0x47a5('0x13')]('['+[_0x2e46af[_0x47a5('0x14')]()]+_0x47a5('0x69'),util['inspect'](_0x4f35ff,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2ef3=['userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','catch','label','?sysparm_query=name%3D','label_entry','Incident','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','validateEmail'];(function(_0x35d4f4,_0x23bd5b){var _0x3c095f=function(_0x5ea2c6){while(--_0x5ea2c6){_0x35d4f4['push'](_0x35d4f4['shift']());}};_0x3c095f(++_0x23bd5b);}(_0x2ef3,0xba));var _0x32ef=function(_0x2b2990,_0x39232a){_0x2b2990=_0x2b2990-0x0;var _0x385d79=_0x2ef3[_0x2b2990];return _0x385d79;};'use strict';var _=require(_0x32ef('0x0'));var Promise=require(_0x32ef('0x1'));var rp=require(_0x32ef('0x2'));var util=require(_0x32ef('0x3'));var md5=require(_0x32ef('0x4'));var Redis=require(_0x32ef('0x5'));var intUtil=require('./util');var config=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('servicenow');config[_0x32ef('0x8')]=_[_0x32ef('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x32ef('0xa'))(new Redis(config[_0x32ef('0x8')]));function getAdminUser(_0x367c39,_0x2fb8eb,_0x234863,_0x298066,_0x2484a0,_0x2bbb50){return new Promise(function(_0x28275c,_0x77df79){var _0x56eb42={'method':'GET','uri':_0x298066+_0x32ef('0xb')+'&'+_0x2484a0+'&'+_0x2bbb50,'auth':_0x2fb8eb,'json':!![]};return rp(_0x56eb42)[_0x32ef('0xc')](function(_0x45bfd5){if(_0x45bfd5[_0x32ef('0xd')]['length']>0x0){_0x234863[_0x32ef('0xe')]=_0x45bfd5['result'][0x0][_0x32ef('0xf')];}logger['info']('['+[_0x367c39[_0x32ef('0x10')]()]+_0x32ef('0x11'),_0x234863);_0x28275c(_0x234863);})['catch'](function(_0x539d18){logger[_0x32ef('0x12')]('['+[_0x367c39['toUpperCase']()]+']',_0x539d18[_0x32ef('0x13')]);_0x77df79(_0x539d18[_0x32ef('0x13')]);});});}function getUser(_0x93d492,_0x54c7f5,_0x57aff1,_0x55bf0b,_0x531e30){return function(_0x13db1a){logger[_0x32ef('0x14')]('['+[_0x93d492[_0x32ef('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x13db1a);return new Promise(function(_0x5d559b,_0x1eb468){if(intUtil[_0x32ef('0x15')](_0x13db1a[_0x32ef('0x16')])){var _0x57863c={'method':_0x32ef('0x17'),'uri':_0x57aff1+_0x32ef('0x18')+_0x13db1a['userEmail']+'&'+_0x55bf0b+'&'+_0x531e30,'auth':_0x54c7f5,'json':!![]};logger[_0x32ef('0x14')]('['+[_0x93d492[_0x32ef('0x10')]()]+_0x32ef('0x19'),_0x57863c);return rp(_0x57863c)[_0x32ef('0xc')](function(_0x445cda){logger[_0x32ef('0x14')]('['+[_0x93d492['toUpperCase']()]+_0x32ef('0x1a'),_0x445cda);if(_0x445cda['result'][_0x32ef('0x1b')]>0x0&&String(_0x445cda[_0x32ef('0xd')][0x0]['active'])===_0x32ef('0x1c')){_0x13db1a[_0x32ef('0x1d')]=_0x445cda[_0x32ef('0xd')][0x0]['sys_id'];}else{_0x13db1a['userId']=_0x13db1a[_0x32ef('0xe')];_0x13db1a[_0x32ef('0x16')]=_0x13db1a[_0x32ef('0x1e')];}logger['info']('['+[_0x93d492['toUpperCase']()]+_0x32ef('0x1f'),_0x13db1a);_0x5d559b(_0x13db1a);})['catch'](function(_0x51a412){logger[_0x32ef('0x12')]('['+[_0x93d492[_0x32ef('0x10')]()]+']',_0x51a412[_0x32ef('0x13')]);_0x1eb468(_0x51a412[_0x32ef('0x13')]);});}else{logger[_0x32ef('0x14')]('['+[_0x93d492[_0x32ef('0x10')]()]+_0x32ef('0x20'));_0x13db1a[_0x32ef('0x1d')]=_0x13db1a[_0x32ef('0xe')];_0x13db1a[_0x32ef('0x16')]=_0x13db1a[_0x32ef('0x1e')];_0x5d559b(_0x13db1a);}});};}function createEndUser(_0xba4b3f,_0x5a88a5,_0xd65fde,_0x2f5d06,_0x5a04cd){logger[_0x32ef('0x14')]('['+[_0xba4b3f[_0x32ef('0x10')]()]+_0x32ef('0x21'),_0xd65fde);return new Promise(function(_0x26e207,_0x50a95b){var _0x10e38c={'method':_0x32ef('0x22'),'uri':_0x2f5d06+_0x32ef('0x23')+_0x5a04cd,'body':{'user_name':_0xd65fde[_0x32ef('0x24')],'roles':_0x32ef('0x25'),'first_name':_0xd65fde[_0x32ef('0x24')],'active':_0x32ef('0x1c'),'date_format':'System','phone':_0xd65fde[_0x32ef('0x24')]},'auth':_0x5a88a5,'json':!![]};return rp(_0x10e38c)['then'](function(_0x38bf73){logger[_0x32ef('0x14')]('['+[_0xba4b3f['toUpperCase']()]+_0x32ef('0x26'),_0x38bf73[_0x32ef('0xd')]);_0xd65fde[_0x32ef('0x27')]=_0x38bf73[_0x32ef('0xd')][_0x32ef('0xf')];_0x26e207(_0xd65fde);})['catch'](function(_0x50ecd6){logger[_0x32ef('0x12')]('['+[_0xba4b3f['toUpperCase']()]+']',_0x50ecd6[_0x32ef('0x13')]);_0x50a95b(_0x50ecd6[_0x32ef('0x13')]);});});}function getEndUser(_0x2f1349,_0x390670,_0x389583,_0x22fa1a,_0x566b56){return function(_0x482d3a){logger['info']('['+[_0x2f1349[_0x32ef('0x10')]()]+_0x32ef('0x28'),_0x482d3a);return new Promise(function(_0x136b02,_0x5f2443){var _0x4fb402={'method':_0x32ef('0x17'),'uri':_0x389583+_0x32ef('0x29')+_0x482d3a[_0x32ef('0x24')]+'&'+_0x22fa1a+'&'+_0x566b56,'auth':_0x390670,'json':!![]};return rp(_0x4fb402)['then'](function(_0x4abbd6){if(_0x4abbd6[_0x32ef('0xd')][_0x32ef('0x1b')]>0x0){_0x482d3a[_0x32ef('0x27')]=_0x4abbd6[_0x32ef('0xd')][0x0][_0x32ef('0xf')];logger[_0x32ef('0x14')]('['+[_0x2f1349[_0x32ef('0x10')]()]+_0x32ef('0x2a'),_0x482d3a);_0x136b02(_0x482d3a);}else{return createEndUser(_0x2f1349,_0x390670,_0x482d3a,_0x389583,_0x22fa1a)[_0x32ef('0xc')](function(_0x4de939){logger[_0x32ef('0x14')]('['+[_0x2f1349[_0x32ef('0x10')]()]+_0x32ef('0x2b'),_0x4de939);_0x136b02(_0x4de939);});}})['catch'](function(_0x365125){logger[_0x32ef('0x12')]('['+[_0x2f1349[_0x32ef('0x10')]()]+']',_0x365125[_0x32ef('0x13')]);_0x5f2443(_0x365125[_0x32ef('0x13')]);});});};}function getCustomFields(_0x33a0fb,_0x256c40){var _0x1cebed={};if(_0x33a0fb[_0x32ef('0x1b')]>0x0){_[_0x32ef('0x2c')](_0x33a0fb,function(_0xb4db74){if(_0xb4db74[_0x32ef('0x2d')]==='string'&&_0xb4db74[_0x32ef('0x2e')]&&!_0xb4db74[_0x32ef('0x2f')]){_0x1cebed[_0xb4db74[_0x32ef('0x30')][_0x32ef('0x31')]()]=_0xb4db74[_0x32ef('0x32')][_0x32ef('0x33')]();}else if(_0xb4db74[_0x32ef('0x2d')]==='string'&&_0xb4db74['idField']&&_0xb4db74[_0x32ef('0x2f')]){_0x1cebed[_0xb4db74[_0x32ef('0x30')][_0x32ef('0x31')]()]=_0xb4db74[_0x32ef('0x32')]['toString']();}else if(_0xb4db74[_0x32ef('0x2d')]===_0x32ef('0x34')&&_0xb4db74['variableName']&&_0xb4db74[_0x32ef('0x30')]&&_0xb4db74['customField']){_0x1cebed[_0xb4db74[_0x32ef('0x30')][_0x32ef('0x31')]()]=_0x256c40[_0xb4db74[_0x32ef('0x35')]][_0x32ef('0x33')]();}else if(_0xb4db74[_0x32ef('0x2d')]===_0x32ef('0x36')&&_0xb4db74[_0x32ef('0x37')]&&_0xb4db74[_0x32ef('0x37')][_0x32ef('0x38')]&&_0xb4db74[_0x32ef('0x30')]&&_0xb4db74['customField']){_0x1cebed[_0xb4db74[_0x32ef('0x30')]['toLowerCase']()]=_0x256c40[_0xb4db74[_0x32ef('0x37')][_0x32ef('0x38')][_0x32ef('0x31')]()]['toString']();}});}return _0x1cebed;}function getTicket(_0x502113,_0x230ac9,_0x37b954,_0x241f82,_0x35b4e0,_0x40bf12){return function(_0x12c9e6){logger['info']('['+[_0x502113['toUpperCase']()]+_0x32ef('0x39'),_0x12c9e6);return new Promise(function(_0x270826,_0x27d65b){var _0x13b270=_0x502113[_0x32ef('0x31')]()===_0x32ef('0x3a')?_0x12c9e6[_0x32ef('0x1d')]:_0x12c9e6[_0x32ef('0x27')];var _0xc10e7={'method':_0x32ef('0x22'),'uri':_0x37b954+_0x32ef('0x3b')+'?'+_0x40bf12,'body':Object[_0x32ef('0x3c')]({},{'active':_0x32ef('0x1c'),'caller_id':_0x13b270,'assigned_to':_0x12c9e6['userId'],'short_description':intUtil[_0x32ef('0x3d')](_0x241f82[_0x32ef('0x3e')],_0x35b4e0,'\x20'),'description':intUtil[_0x32ef('0x3d')](_0x241f82[_0x32ef('0x3f')],_0x35b4e0,'\x0a')},getCustomFields(_0x241f82[_0x32ef('0x40')],_0x35b4e0)),'auth':_0x230ac9,'json':!![]};return rp(_0xc10e7)[_0x32ef('0xc')](function(_0x278696){logger[_0x32ef('0x14')]('['+[_0x502113[_0x32ef('0x10')]()]+_0x32ef('0x41'),_0x278696[_0x32ef('0xd')]);_0x12c9e6[_0x32ef('0x42')]=_0x278696[_0x32ef('0xd')][_0x32ef('0xf')];_0x12c9e6[_0x32ef('0x43')]=_0x278696[_0x32ef('0xd')][_0x32ef('0x44')];logger[_0x32ef('0x14')]('['+[_0x502113['toUpperCase']()]+']\x20getTicket\x20crm',_0x12c9e6);_0x270826(_0x12c9e6);})[_0x32ef('0x45')](function(_0x259c32){logger[_0x32ef('0x12')]('['+[_0x502113[_0x32ef('0x10')]()]+']',_0x259c32[_0x32ef('0x13')]);_0x27d65b(_0x259c32[_0x32ef('0x13')]);});});};}function createRemoteTag(_0x1572d9,_0x1f105a,_0x15b640,_0x368bf1){return new Promise(function(_0x3697a7,_0x4a6fd2){var _0x21216d={'method':_0x32ef('0x22'),'uri':_0x15b640+_0x32ef('0x46')+'?'+_0x368bf1,'body':{'short_description':_0x1572d9,'global':!![],'active':!![],'name':_0x1572d9},'auth':_0x1f105a,'json':!![]};return rp(_0x21216d)[_0x32ef('0xc')](function(_0x38314a){var _0x387cf0=_0x38314a['result'][_0x32ef('0xf')];_0x3697a7(_0x387cf0);});});}function getRemoteTag(_0x1eeb3e,_0x31d5d8,_0x56b7ce,_0x1b0faa,_0x52692a){return new Promise(function(_0x2ee3dd,_0xbe35b){var _0x579bc1={'method':_0x32ef('0x17'),'uri':_0x56b7ce+'label'+_0x32ef('0x47')+_0x1eeb3e+'&'+_0x1b0faa,'auth':_0x31d5d8,'json':!![]};return rp(_0x579bc1)[_0x32ef('0xc')](function(_0x2bff39){if(_0x2bff39[_0x32ef('0xd')][_0x32ef('0x1b')]>0x0){var _0x30e377=_0x2bff39[_0x32ef('0xd')][0x0]['sys_id'];_0x2ee3dd(_0x30e377);}else{return createRemoteTag(_0x1eeb3e,_0x31d5d8,_0x56b7ce,_0x1b0faa)['then'](function(_0xdfa103){_0x2ee3dd(_0xdfa103);});}});});}function assignTagToIncident(_0x52232a,_0x4fbab6,_0xb519e9,_0x89d0b3,_0x2ef0f8){return new Promise(function(_0x6aae59,_0x2468e6){var _0x356704={'method':_0x32ef('0x22'),'uri':_0xb519e9+_0x32ef('0x48')+'?'+_0x2ef0f8,'body':{'label':_0x52232a,'table':_0x32ef('0x3b'),'id_type':_0x32ef('0x49'),'table_key':_0x89d0b3['ticketId'],'title':'Incident\x20-\x20'+_0x89d0b3[_0x32ef('0x43')],'id_display':_0x89d0b3[_0x32ef('0x43')]},'auth':_0x4fbab6,'json':!![]};return rp(_0x356704)['then'](function(_0xda1d1){_0x6aae59();})[_0x32ef('0x45')](function(){_0x6aae59();});});}function manageTags(_0x2b5703,_0x49c245,_0x2ac877,_0x3c31d0,_0x20dcc5,_0x52dfe0,_0x5e6030){return new Promise(function(_0x13ea1a,_0x47d8bf){var _0x17f447=[];_0x49c245['forEach'](function(_0x58b652){_0x17f447[_0x32ef('0x4a')](getRemoteTag(_0x58b652,_0x2ac877,_0x3c31d0,_0x52dfe0,_0x5e6030));});return Promise[_0x32ef('0x4b')](_0x17f447)[_0x32ef('0xc')](function(_0x5dca6a){if(_0x5dca6a[_0x32ef('0x1b')]){logger[_0x32ef('0x14')]('['+[_0x2b5703[_0x32ef('0x10')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5dca6a);var _0x4557ce=[];_0x5dca6a[_0x32ef('0x2c')](function(_0x4c3bab){_0x4557ce['push'](assignTagToIncident(_0x4c3bab,_0x2ac877,_0x3c31d0,_0x20dcc5,_0x52dfe0));});return Promise[_0x32ef('0x4b')](_0x4557ce)[_0x32ef('0xc')](function(){_0x13ea1a();})[_0x32ef('0x45')](function(){_0x13ea1a();});}else{_0x13ea1a();}});});}function getTags(_0x339625,_0x4c4df8,_0x40700e,_0x4c89e8,_0x285330,_0x63b65){return function(_0x25b6d6){return new Promise(function(_0x36ed97,_0x21e930){var _0x340861=[];var _0x1dc755=_0x4c89e8[_0x32ef('0x4c')];if(_0x1dc755&&_0x1dc755[_0x32ef('0x1b')]>0x0){_0x340861=_['map'](_0x1dc755,_0x32ef('0x38'));}if(_0x340861[_0x32ef('0x1b')]>0x0){return manageTags(_0x339625,_0x340861,_0x4c4df8,_0x40700e,_0x25b6d6,_0x285330,_0x63b65)[_0x32ef('0xc')](function(){_0x36ed97(_0x25b6d6);});}else{_0x36ed97(_0x25b6d6);}});};}function emit(_0x1c629d,_0x79ae28,_0x5ad75c){var _0x47c0ed=_0x32ef('0x4d')+_0x32ef('0x4e')+_0x32ef('0x4f')+_0x32ef('0x50');var _0x1a8bad={'uri':_0x1c629d+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x5ad75c+_0x47c0ed};io['to'](util[_0x32ef('0x51')]('user:%s',_0x79ae28))[_0x32ef('0x52')](_0x32ef('0x53'),_0x1a8bad);}exports['cs']=function(_0x48b6f4,_0x5402b4,_0x2c9f7a,_0x1538d0,_0x2e0873,_0x5b378b,_0x52b63b,_0x3b4a8e){var _0x5edd29={};var _0x7d2c3a={'user':_0x5b378b[_0x32ef('0x54')],'pass':_0x5b378b['password']};var _0x476bbf=_0x32ef('0x55');var _0x974974=_0x32ef('0x56');_0x5b378b[_0x32ef('0x57')]=intUtil[_0x32ef('0x58')](_0x5b378b[_0x32ef('0x57')]);_0x5b378b[_0x32ef('0x59')]=intUtil[_0x32ef('0x58')](_0x5b378b[_0x32ef('0x59')]);var _0x132d9f=util[_0x32ef('0x51')]('%s/api/now/table/',_0x5b378b['remoteUri']);_0x5edd29[_0x32ef('0x16')]=!_[_0x32ef('0x5a')](_0x1538d0)?_0x1538d0['email']:null;_0x5edd29[_0x32ef('0x1e')]=_0x5b378b['email'];_0x5edd29[_0x32ef('0x24')]=_0x3b4a8e[_0x32ef('0x31')]()===_0x32ef('0x3a')?_0x5402b4['destcalleridnum']:_0x5402b4[_0x32ef('0x5b')];_0x5edd29['callDirection']=_0x3b4a8e===_0x32ef('0x5c')||_0x3b4a8e===_0x32ef('0x5d')?'queue':'outbound';var _0x3c9039=util['format'](_0x32ef('0x5e'),_0x5b378b['serverUrl'],_0x5402b4[_0x32ef('0x5f')],md5(_0x5402b4[_0x32ef('0x5f')]));if(_0x2e0873&&_0x2e0873[_0x32ef('0x60')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5402b4[_0x32ef('0x61')]=_0x3c9039;}else if(_0x52b63b&&_0x52b63b['recordingFormat']&&_0x52b63b[_0x32ef('0x62')]!==_0x32ef('0x63')){logger[_0x32ef('0x14')](_0x32ef('0x64'),_0x32ef('0x65'));_0x5402b4[_0x32ef('0x61')]=_0x3c9039;}else{_0x5402b4['recordingURL']='';}return getAdminUser(_0x3b4a8e,_0x7d2c3a,_0x5edd29,_0x132d9f,_0x974974,_0x476bbf)[_0x32ef('0xc')](getUser(_0x3b4a8e,_0x7d2c3a,_0x132d9f,_0x974974,_0x476bbf))['then'](getEndUser(_0x3b4a8e,_0x7d2c3a,_0x132d9f,_0x974974,_0x476bbf))['then'](getTicket(_0x3b4a8e,_0x7d2c3a,_0x132d9f,_0x2c9f7a,_0x5402b4,_0x974974))[_0x32ef('0xc')](function(_0x5c4f2a){logger[_0x32ef('0x14')](util[_0x32ef('0x51')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5c4f2a[_0x32ef('0x42')]));logger[_0x32ef('0x14')](util[_0x32ef('0x51')](_0x32ef('0x66'),_0x3b4a8e));if(_0x3b4a8e!==_0x32ef('0x5d')){logger[_0x32ef('0x14')]('['+[_0x3b4a8e['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5b378b[_0x32ef('0x57')],_0x1538d0['name'],_0x5c4f2a[_0x32ef('0x42')]);}})[_0x32ef('0x45')](function(_0x114d8e){logger[_0x32ef('0x12')]('['+[_0x3b4a8e[_0x32ef('0x10')]()]+_0x32ef('0x67'),util['inspect'](_0x114d8e,{'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 8e446cd..6a8ffab 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 _0x8b8e=['outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','version','unmanaged','lastevent','isNil','Ticket\x20created!','toUpperCase','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','get_entry_list','Employees','user_name','then','entry_list','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','merge','map','forEach','string','nameField','customField','toLowerCase','content','type','custom_fields','variable','push','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','[QUEUE]'];(function(_0x4433fd,_0x4319a7){var _0x5270ef=function(_0x4e5296){while(--_0x4e5296){_0x4433fd['push'](_0x4433fd['shift']());}};_0x5270ef(++_0x4319a7);}(_0x8b8e,0x108));var _0xe8b8=function(_0x38f1a4,_0x66148d){_0x38f1a4=_0x38f1a4-0x0;var _0x453a1a=_0x8b8e[_0x38f1a4];return _0x453a1a;};'use strict';var _=require(_0xe8b8('0x0'));var rp=require('request-promise');var BPromise=require(_0xe8b8('0x1'));var md5=require('md5');var util=require(_0xe8b8('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xe8b8('0x3'));var logger=require(_0xe8b8('0x4'))(_0xe8b8('0x5'));config[_0xe8b8('0x6')]=_[_0xe8b8('0x7')](config[_0xe8b8('0x6')],{'host':_0xe8b8('0x8'),'port':0x18eb});var io=require(_0xe8b8('0x9'))(new Redis(config[_0xe8b8('0x6')]));var def={'method':_0xe8b8('0xa'),'json':!![]};function emit(_0x4ce796,_0x2a4ccd,_0x5cd238){io['to'](_0x4ce796)[_0xe8b8('0xb')](_0x2a4ccd,_0x5cd238);}function getTicket(_0x4ea70a,_0x48b59f,_0x2ccbeb,_0xcf1e01,_0x568241,_0x54eb14,_0x259a1a,_0x42bb8a){logger[_0xe8b8('0xc')](_0xe8b8('0xd'));var _0xf5b5b1=new Date();var _0x298bae=[{'name':_0xe8b8('0xe'),'value':intUtil[_0xe8b8('0xf')](_0xcf1e01[_0xe8b8('0x10')],_0x568241,'\x20')},{'name':_0xe8b8('0x11'),'value':_0x48b59f['id']},{'name':_0xe8b8('0x12'),'value':_0x48b59f['id']},{'name':_0xe8b8('0x13'),'value':intUtil[_0xe8b8('0xf')](_0xcf1e01[_0xe8b8('0x14')],_0x568241,'\x0a')},{'name':'date_start','value':_0xf5b5b1[_0xe8b8('0x15')]()['slice'](0x0,0x13)[_0xe8b8('0x16')]('T','\x20')},{'name':_0xe8b8('0x17'),'value':'0'},{'name':_0xe8b8('0x18'),'value':'15'},{'name':_0xe8b8('0x19'),'value':_0x2ccbeb['id']},{'name':_0xe8b8('0x1a'),'value':_0xe8b8('0x1b')},{'name':_0xe8b8('0x1c'),'value':_0x2ccbeb[_0xe8b8('0xe')]},{'name':_0xe8b8('0x1d'),'value':_0x42bb8a}];if(_0x54eb14[_0xe8b8('0x1e')]){_['forEach'](_0x54eb14,function(_0xbaca4a){if(_0x568241[_0xbaca4a[_0xe8b8('0x1f')]]){_0x298bae['push']({'name':_0xbaca4a[_0xe8b8('0x20')],'value':_0x568241[_0xbaca4a[_0xe8b8('0x1f')]]});}});}return request({'form':{'method':_0xe8b8('0x21'),'input_type':_0xe8b8('0x22'),'response_type':_0xe8b8('0x22'),'rest_data':JSON[_0xe8b8('0x23')]({'session':_0x259a1a['id'],'module_name':_0xe8b8('0x24'),'name_value_list':_0x298bae})}});}function getAuth(_0x36c273){return util[_0xe8b8('0x25')](_0xe8b8('0x26'),new Buffer(_0x36c273[_0xe8b8('0x27')]+':X')[_0xe8b8('0x28')](_0xe8b8('0x29')));}function getServerInfo(_0x15abeb){return request({'form':{'method':_0xe8b8('0x2a'),'input_type':_0xe8b8('0x22'),'response_type':_0xe8b8('0x22'),'rest_data':JSON['stringify']({'session':_0x15abeb['id']})}});}function getUser(_0x57faf7,_0x566721,_0x4769fe){if(!_['isNil'](_0x566721)){logger[_0xe8b8('0xc')]('Getting\x20agent\x20with\x20name',_0x566721);return request({'form':{'method':_0xe8b8('0x2b'),'input_type':_0xe8b8('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4769fe['id'],'module_name':_0xe8b8('0x2c'),'query':util[_0xe8b8('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x566721),'order_by':'','offset':'0','select_fields':['id',_0xe8b8('0xe'),_0xe8b8('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe8b8('0x2e')](function(_0x46b2dc){if(_0x46b2dc[_0xe8b8('0x2f')]['length']){var _0x2e9ca5=_['find'](_0x46b2dc[_0xe8b8('0x2f')],function(_0x402e6c){return _0x402e6c[_0xe8b8('0x30')][_0xe8b8('0x2d')]['value']===_0x566721;});if(_0x2e9ca5){logger['info'](_0xe8b8('0x31'));return BPromise[_0xe8b8('0x32')]({'id':_0x2e9ca5[_0xe8b8('0x30')]['id'][_0xe8b8('0x33')],'name':_0x2e9ca5[_0xe8b8('0x30')]['name'][_0xe8b8('0x33')]});}}logger[_0xe8b8('0xc')](_0xe8b8('0x34'));return BPromise[_0xe8b8('0x32')]({'id':_0x4769fe[_0xe8b8('0x30')][_0xe8b8('0x35')][_0xe8b8('0x33')],'name':_0x4769fe[_0xe8b8('0x30')][_0xe8b8('0x2d')][_0xe8b8('0x33')]});});}else{logger[_0xe8b8('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe8b8('0x32')]({'id':_0x4769fe[_0xe8b8('0x30')][_0xe8b8('0x35')]['value'],'name':_0x4769fe[_0xe8b8('0x30')][_0xe8b8('0x2d')][_0xe8b8('0x33')]});}}function getEndUser(_0x30d02c,_0x2ceb8b,_0x472753,_0x2e949c){logger[_0xe8b8('0xc')](_0xe8b8('0x36'),_0x472753);return request({'form':{'method':'get_entry_list','input_type':_0xe8b8('0x22'),'response_type':_0xe8b8('0x22'),'rest_data':JSON['stringify']({'session':_0x2e949c['id'],'module_name':_0xe8b8('0x1b'),'query':util[_0xe8b8('0x25')](_0xe8b8('0x37'),_0x472753),'order_by':'','offset':'0','select_fields':['id',_0xe8b8('0xe'),_0xe8b8('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2b2127){if(_0x2b2127[_0xe8b8('0x2f')][_0xe8b8('0x1e')]){var _0x16f8fa=_[_0xe8b8('0x39')](_0x2b2127[_0xe8b8('0x2f')],function(_0x4d617b){return _0x4d617b[_0xe8b8('0x30')]['phone_home'][_0xe8b8('0x33')]===_0x472753;});if(_0x16f8fa){logger[_0xe8b8('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x16f8fa[_0xe8b8('0x30')]['id'][_0xe8b8('0x33')],'name':_0x16f8fa[_0xe8b8('0x30')][_0xe8b8('0xe')]['value'],'phone':_0x16f8fa[_0xe8b8('0x30')][_0xe8b8('0x38')][_0xe8b8('0x33')]});}}else{logger[_0xe8b8('0xc')](_0xe8b8('0x3a'));return request({'form':{'method':_0xe8b8('0x21'),'input_type':_0xe8b8('0x22'),'response_type':_0xe8b8('0x22'),'rest_data':JSON['stringify']({'session':_0x2e949c['id'],'module_name':'Contacts','name_value_list':[{'name':_0xe8b8('0x3b'),'value':_0x2ceb8b!==_0xe8b8('0x3c')?_0x2ceb8b:util[_0xe8b8('0x25')]('Caller\x20-\x20%s',_0x472753)},{'name':_0xe8b8('0x38'),'value':_0x472753}]})}})[_0xe8b8('0x2e')](function(_0x7a96fd){logger[_0xe8b8('0xc')](_0xe8b8('0x3d'));return BPromise[_0xe8b8('0x32')]({'id':_0x7a96fd['id'],'name':_0x7a96fd[_0xe8b8('0x2f')]['first_name']['value'],'phone':_0x7a96fd['entry_list'][_0xe8b8('0x38')][_0xe8b8('0x33')]});});}});}function request(_0x1068eb){logger[_0xe8b8('0x3e')]('[HTTP]',JSON[_0xe8b8('0x23')](_0x1068eb));return rp(_[_0xe8b8('0x3f')](def,_0x1068eb));}function getTags(_0x34a6a1,_0x1c51f7){var _0x5484f5=[];if(_0x34a6a1&&_0x34a6a1['length']>0x0){_0x5484f5=_[_0xe8b8('0x40')](_0x34a6a1,_0x1c51f7);}return _0x5484f5;}function getCustomFields(_0x376c8c,_0x19d4f4){var _0x51cfc1=[];var _0x1cd734={'custom_fields':[]};if(_0x376c8c[_0xe8b8('0x1e')]>0x0){_[_0xe8b8('0x41')](_0x376c8c,function(_0x5391f5){if(_0x5391f5['type']===_0xe8b8('0x42')&&_0x5391f5[_0xe8b8('0x43')]&&!_0x5391f5[_0xe8b8('0x44')]){_0x1cd734[_0x5391f5[_0xe8b8('0x43')][_0xe8b8('0x45')]()]=_0x5391f5[_0xe8b8('0x46')][_0xe8b8('0x28')]();}else if(_0x5391f5[_0xe8b8('0x47')]===_0xe8b8('0x42')&&_0x5391f5[_0xe8b8('0x20')]&&_0x5391f5[_0xe8b8('0x44')]){_0x1cd734[_0xe8b8('0x48')]['push']({'id':_0x5391f5['idField'],'value':_0x5391f5[_0xe8b8('0x46')][_0xe8b8('0x28')]()});}else if(_0x5391f5[_0xe8b8('0x47')]===_0xe8b8('0x49')&&_0x5391f5[_0xe8b8('0x1f')]&&_0x5391f5[_0xe8b8('0x20')]&&_0x5391f5[_0xe8b8('0x44')]){_0x19d4f4[_0x5391f5['variableName']]&&_0x1cd734['custom_fields'][_0xe8b8('0x4a')]({'id':_0x5391f5[_0xe8b8('0x20')],'value':_0x19d4f4[_0x5391f5['variableName']][_0xe8b8('0x28')]()});}else if(_0x5391f5[_0xe8b8('0x47')]===_0xe8b8('0x4b')&&_0x5391f5[_0xe8b8('0x4c')]&&_0x5391f5[_0xe8b8('0x4c')][_0xe8b8('0xe')]&&_0x5391f5[_0xe8b8('0x20')]&&_0x5391f5[_0xe8b8('0x44')]){_0x19d4f4[_0x5391f5[_0xe8b8('0x4c')][_0xe8b8('0xe')][_0xe8b8('0x45')]()]&&_0x1cd734[_0xe8b8('0x48')]['push']({'id':_0x5391f5[_0xe8b8('0x20')],'value':_0x19d4f4[_0x5391f5['Variable'][_0xe8b8('0xe')][_0xe8b8('0x45')]()][_0xe8b8('0x28')]()});}});}return _0x1cd734;}function getConnection(_0x11fc39){return request({'method':'POST','form':{'method':_0xe8b8('0x4d'),'input_type':_0xe8b8('0x22'),'response_type':'JSON','rest_data':JSON[_0xe8b8('0x23')]({'user_auth':{'user_name':_0x11fc39[_0xe8b8('0x4e')],'password':_0x11fc39[_0xe8b8('0x4f')],'encryption':_0xe8b8('0x50')},'application':_0xe8b8('0x51')})}})[_0xe8b8('0x2e')](function(_0x487e3a){var _0x163b6d=_0x487e3a;if(_0x163b6d['id']){def['sessionID']=_0x163b6d['id'];return BPromise['resolve'](_0x163b6d);}else{throw new Error(util[_0xe8b8('0x25')](_0xe8b8('0x52'),_0x11fc39['id']));}});}function setRelationship(_0x4743c3,_0x152c65,_0x1b30ac,_0x17d0e0){return request({'form':{'method':_0xe8b8('0x53'),'input_type':_0xe8b8('0x22'),'response_type':_0xe8b8('0x22'),'rest_data':JSON[_0xe8b8('0x23')]({'session':_0x4743c3['id'],'module_name':_0xe8b8('0x24'),'module_id':_0x1b30ac['id'],'link_field_name':_0x17d0e0,'related_ids':[_0x152c65['id']]})}});}exports['queue']=function(_0x8cb41b,_0x1ddef8,_0x98f10f,_0x3de2d4,_0x4dfd76,_0x330be9){var _0x4c419a,_0x385e35,_0x46ff8d,_0x4ab15e;_0x330be9[_0xe8b8('0x54')]=intUtil['stripTrailingSlash'](_0x330be9[_0xe8b8('0x54')]);_0x330be9[_0xe8b8('0x55')]=intUtil[_0xe8b8('0x56')](_0x330be9['serverUrl']);def[_0xe8b8('0x57')]=util[_0xe8b8('0x25')](_0xe8b8('0x58'),_0x330be9[_0xe8b8('0x54')]);if(_0x4dfd76&&_0x4dfd76[_0xe8b8('0x59')]){logger[_0xe8b8('0xc')]('[QUEUE]',_0xe8b8('0x5a'));_0x1ddef8[_0xe8b8('0x5b')]=util[_0xe8b8('0x25')](_0xe8b8('0x5c'),_0x330be9[_0xe8b8('0x55')],_0x1ddef8[_0xe8b8('0x5d')],md5(_0x1ddef8[_0xe8b8('0x5d')]));}else{_0x1ddef8[_0xe8b8('0x5b')]='';}return getConnection(_0x330be9)[_0xe8b8('0x2e')](function(_0x497844){_0x4ab15e=_0x497844;return getUser(_0x330be9,_0x3de2d4['name'],_0x4ab15e);})['then'](function(_0x537907){_0x4c419a=_0x537907;logger[_0xe8b8('0xc')](_0xe8b8('0x5e'),_0x4c419a['id']);return getEndUser(_0x330be9,_0x1ddef8[_0xe8b8('0x5f')],_0x1ddef8[_0xe8b8('0x60')],_0x4ab15e);})[_0xe8b8('0x2e')](function(_0x3387e7){_0x385e35=_0x3387e7;logger[_0xe8b8('0xc')](_0xe8b8('0x61'),_0x385e35['id']);return getTicket(_0x330be9,_0x4c419a,_0x385e35,_0x98f10f,_0x1ddef8,_0x98f10f[_0xe8b8('0x62')],_0x4ab15e,_0xe8b8('0x63'));})[_0xe8b8('0x2e')](function(_0x290764){_0x46ff8d=_0x290764;logger[_0xe8b8('0xc')]('Ticket\x20created!');logger[_0xe8b8('0xc')]('The\x20Ticket\x20ID\x20is:',_0x46ff8d['id']);return setRelationship(_0x4ab15e,_0x4c419a,_0x46ff8d,_0xe8b8('0x64'));})['then'](function(){return setRelationship(_0x4ab15e,_0x385e35,_0x46ff8d,_0xe8b8('0x65'));})[_0xe8b8('0x2e')](function(){return getServerInfo(_0x4ab15e);})[_0xe8b8('0x2e')](function(_0x261af8){var _0x3b52ab=parseInt(_0x261af8['version'][_0xe8b8('0x66')](0x0));var _0x39c471=util['format'](_0xe8b8('0x67'),_0x330be9[_0xe8b8('0x54')],_0x46ff8d['id']);if(_0x3b52ab>0x6){_0x39c471=util['format'](_0xe8b8('0x68'),_0x330be9[_0xe8b8('0x54')],_0x46ff8d['id']);}logger[_0xe8b8('0xc')]('[QUEUE]',_0xe8b8('0x69'));emit(util[_0xe8b8('0x25')](_0xe8b8('0x6a'),_0x3de2d4[_0xe8b8('0xe')]),_0xe8b8('0x6b'),{'uri':_0x39c471});})[_0xe8b8('0x6c')](function(_0x2be0a0){logger[_0xe8b8('0x6d')](_0xe8b8('0x6e'),JSON[_0xe8b8('0x23')](_0x2be0a0));});};exports[_0xe8b8('0x6f')]=function(_0x35a30b,_0x813d30,_0x118b6a,_0x4de7d1,_0x3f5a9f,_0x4d632b,_0x49d044){var _0x4f08e0,_0x1dc6fb,_0x1b382a,_0x2d739c;_0x4d632b[_0xe8b8('0x54')]=intUtil['stripTrailingSlash'](_0x4d632b[_0xe8b8('0x54')]);_0x4d632b['serverUrl']=intUtil[_0xe8b8('0x56')](_0x4d632b['serverUrl']);def[_0xe8b8('0x57')]=util[_0xe8b8('0x25')](_0xe8b8('0x58'),_0x4d632b[_0xe8b8('0x54')]);if(_0x49d044&&_0x49d044['recordingFormat']&&_0x49d044[_0xe8b8('0x70')]!==_0xe8b8('0x71')){logger['info'](_0xe8b8('0x72'),'Recording\x20is\x20enabled!');_0x813d30['recordingURL']=util[_0xe8b8('0x25')](_0xe8b8('0x5c'),_0x4d632b[_0xe8b8('0x55')],_0x813d30[_0xe8b8('0x5d')],md5(_0x813d30[_0xe8b8('0x5d')]));}return getConnection(_0x4d632b)[_0xe8b8('0x2e')](function(_0x1a0334){_0x2d739c=_0x1a0334;return getUser(_0x4d632b,_0x4de7d1[_0xe8b8('0xe')],_0x2d739c);})[_0xe8b8('0x2e')](function(_0x459f99){_0x4f08e0=_0x459f99;logger[_0xe8b8('0xc')]('The\x20User\x20ID\x20is:',_0x4f08e0['id']);return getEndUser(_0x4d632b,_0x813d30[_0xe8b8('0x73')],_0x813d30[_0xe8b8('0x74')],_0x2d739c);})['then'](function(_0x376a5c){_0x1dc6fb=_0x376a5c;logger['info'](_0xe8b8('0x61'),_0x1dc6fb['id']);return getTicket(_0x4d632b,_0x4f08e0,_0x1dc6fb,_0x118b6a,_0x813d30,_0x118b6a[_0xe8b8('0x62')],_0x2d739c,_0xe8b8('0x75'));})[_0xe8b8('0x2e')](function(_0x8e64f7){_0x1b382a=_0x8e64f7;logger[_0xe8b8('0xc')]('Ticket\x20created!');logger[_0xe8b8('0xc')](_0xe8b8('0x76'),_0x1b382a['id']);return setRelationship(_0x2d739c,_0x4f08e0,_0x1b382a,'users');})[_0xe8b8('0x2e')](function(){return setRelationship(_0x2d739c,_0x1dc6fb,_0x1b382a,_0xe8b8('0x65'));})[_0xe8b8('0x2e')](function(){return getServerInfo(_0x2d739c);})[_0xe8b8('0x2e')](function(_0x525d66){var _0x8eba01=parseInt(_0x525d66[_0xe8b8('0x77')][_0xe8b8('0x66')](0x0));var _0x30e7fd=util['format'](_0xe8b8('0x67'),_0x4d632b[_0xe8b8('0x54')],_0x1b382a['id']);if(_0x8eba01>0x6){_0x30e7fd=util[_0xe8b8('0x25')](_0xe8b8('0x68'),_0x4d632b['remoteUri'],_0x1b382a['id']);}logger['info']('[OUTBOUND]',_0xe8b8('0x69'));emit(util[_0xe8b8('0x25')](_0xe8b8('0x6a'),_0x4de7d1[_0xe8b8('0xe')]),_0xe8b8('0x6b'),{'uri':_0x30e7fd});})[_0xe8b8('0x6c')](function(_0x5cf5b3){logger[_0xe8b8('0x6d')]('[OUTBOUND]',JSON[_0xe8b8('0x23')](_0x5cf5b3));});};exports[_0xe8b8('0x78')]=function(_0x5ab64e,_0x2d2580,_0x765bd,_0x28f1c4,_0x3268bf,_0x522de9){var _0x203e63,_0x11a911,_0x8515a9,_0x536bc3;_0x522de9['remoteUri']=intUtil['stripTrailingSlash'](_0x522de9[_0xe8b8('0x54')]);_0x522de9[_0xe8b8('0x55')]=intUtil[_0xe8b8('0x56')](_0x522de9[_0xe8b8('0x55')]);def[_0xe8b8('0x57')]=util[_0xe8b8('0x25')](_0xe8b8('0x58'),_0x522de9[_0xe8b8('0x54')]);if(_0x3268bf&&_0x3268bf[_0xe8b8('0x59')]){logger[_0xe8b8('0xc')]('['+_0x2d2580[_0xe8b8('0x79')]['toUpperCase']()+']',_0xe8b8('0x5a'));_0x2d2580[_0xe8b8('0x5b')]=util[_0xe8b8('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x522de9[_0xe8b8('0x55')],_0x2d2580['uniqueid'],md5(_0x2d2580[_0xe8b8('0x5d')]));}else{_0x2d2580[_0xe8b8('0x5b')]='';}return getConnection(_0x522de9)[_0xe8b8('0x2e')](function(_0xd5cb61){_0x536bc3=_0xd5cb61;if(!_[_0xe8b8('0x7a')](_0x28f1c4)){return getUser(_0x522de9,_0x28f1c4['name'],_0x536bc3);}else{return getUser(_0x522de9,null,_0x536bc3);}})[_0xe8b8('0x2e')](function(_0x41c34b){_0x203e63=_0x41c34b;logger['info'](_0xe8b8('0x5e'),_0x203e63['id']);return getEndUser(_0x522de9,_0x2d2580[_0xe8b8('0x5f')],_0x2d2580[_0xe8b8('0x60')],_0x536bc3);})[_0xe8b8('0x2e')](function(_0x5a75b5){_0x11a911=_0x5a75b5;logger[_0xe8b8('0xc')](_0xe8b8('0x61'),_0x11a911['id']);return getTicket(_0x522de9,_0x203e63,_0x11a911,_0x765bd,_0x2d2580,_0x765bd[_0xe8b8('0x62')],_0x536bc3,_0xe8b8('0x63'));})[_0xe8b8('0x2e')](function(_0x45d463){_0x8515a9=_0x45d463;logger[_0xe8b8('0xc')](_0xe8b8('0x7b'));logger[_0xe8b8('0xc')](_0xe8b8('0x76'),_0x8515a9['id']);return setRelationship(_0x536bc3,_0x203e63,_0x8515a9,_0xe8b8('0x64'));})[_0xe8b8('0x2e')](function(){return setRelationship(_0x536bc3,_0x11a911,_0x8515a9,'contacts');})['then'](function(){return getServerInfo(_0x536bc3);})[_0xe8b8('0x6c')](function(_0x3232d4){logger['error']('['+_0x2d2580[_0xe8b8('0x79')][_0xe8b8('0x7c')]()+']',JSON[_0xe8b8('0x23')](_0x3232d4));});}; \ No newline at end of file +var _0x0adf=['../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','name','getString','assigned_user_id','created_by','date_start','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','variableName','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','length','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','merge','map','forEach','type','string','nameField','customField','content','custom_fields','push','customVariable','Variable','toLowerCase','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','version','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','lodash','request-promise','bluebird','util','ioredis','./util'];(function(_0x28edbc,_0x180c07){var _0x4b665f=function(_0xb060ec){while(--_0xb060ec){_0x28edbc['push'](_0x28edbc['shift']());}};_0x4b665f(++_0x180c07);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x42191b,_0x4865c8){_0x42191b=_0x42191b-0x0;var _0x56fcf3=_0x0adf[_0x42191b];return _0x56fcf3;};'use strict';var _=require(_0xf0ad('0x0'));var rp=require(_0xf0ad('0x1'));var BPromise=require(_0xf0ad('0x2'));var md5=require('md5');var util=require(_0xf0ad('0x3'));var Redis=require(_0xf0ad('0x4'));var intUtil=require(_0xf0ad('0x5'));var config=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));config[_0xf0ad('0x9')]=_['defaults'](config[_0xf0ad('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf0ad('0xa'))(new Redis(config[_0xf0ad('0x9')]));var def={'method':_0xf0ad('0xb'),'json':!![]};function emit(_0x41c99d,_0xa9a315,_0x3bc706){io['to'](_0x41c99d)[_0xf0ad('0xc')](_0xa9a315,_0x3bc706);}function getTicket(_0x5bdf69,_0x2ab4eb,_0x53c81a,_0x24db70,_0x1f2952,_0x43fb01,_0x2a5d0e,_0x3daf42){logger['info']('Creating\x20new\x20ticket...');var _0x13ed94=new Date();var _0x19892c=[{'name':_0xf0ad('0xd'),'value':intUtil[_0xf0ad('0xe')](_0x24db70['Subjects'],_0x1f2952,'\x20')},{'name':_0xf0ad('0xf'),'value':_0x2ab4eb['id']},{'name':_0xf0ad('0x10'),'value':_0x2ab4eb['id']},{'name':'description','value':intUtil['getString'](_0x24db70['Descriptions'],_0x1f2952,'\x0a')},{'name':_0xf0ad('0x11'),'value':_0x13ed94['toISOString']()[_0xf0ad('0x12')](0x0,0x13)[_0xf0ad('0x13')]('T','\x20')},{'name':_0xf0ad('0x14'),'value':'0'},{'name':_0xf0ad('0x15'),'value':'15'},{'name':_0xf0ad('0x16'),'value':_0x53c81a['id']},{'name':'parent_type','value':_0xf0ad('0x17')},{'name':_0xf0ad('0x18'),'value':_0x53c81a[_0xf0ad('0xd')]},{'name':_0xf0ad('0x19'),'value':_0x3daf42}];if(_0x43fb01['length']){_['forEach'](_0x43fb01,function(_0x2466e8){if(_0x1f2952[_0x2466e8[_0xf0ad('0x1a')]]){_0x19892c['push']({'name':_0x2466e8[_0xf0ad('0x1b')],'value':_0x1f2952[_0x2466e8[_0xf0ad('0x1a')]]});}});}return request({'form':{'method':_0xf0ad('0x1c'),'input_type':_0xf0ad('0x1d'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2a5d0e['id'],'module_name':_0xf0ad('0x1e'),'name_value_list':_0x19892c})}});}function getAuth(_0x2da425){return util[_0xf0ad('0x1f')](_0xf0ad('0x20'),new Buffer(_0x2da425[_0xf0ad('0x21')]+':X')[_0xf0ad('0x22')]('base64'));}function getServerInfo(_0x33c95d){return request({'form':{'method':_0xf0ad('0x23'),'input_type':_0xf0ad('0x1d'),'response_type':_0xf0ad('0x1d'),'rest_data':JSON[_0xf0ad('0x24')]({'session':_0x33c95d['id']})}});}function getUser(_0x88b47b,_0xb91769,_0x276322){if(!_[_0xf0ad('0x25')](_0xb91769)){logger[_0xf0ad('0x26')](_0xf0ad('0x27'),_0xb91769);return request({'form':{'method':_0xf0ad('0x28'),'input_type':_0xf0ad('0x1d'),'response_type':_0xf0ad('0x1d'),'rest_data':JSON[_0xf0ad('0x24')]({'session':_0x276322['id'],'module_name':'Employees','query':util[_0xf0ad('0x1f')](_0xf0ad('0x29'),_0xb91769),'order_by':'','offset':'0','select_fields':['id',_0xf0ad('0xd'),_0xf0ad('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf0ad('0x2b')](function(_0x30f8ee){if(_0x30f8ee['entry_list'][_0xf0ad('0x2c')]){var _0x19a32a=_[_0xf0ad('0x2d')](_0x30f8ee[_0xf0ad('0x2e')],function(_0x1b6880){return _0x1b6880[_0xf0ad('0x2f')][_0xf0ad('0x2a')][_0xf0ad('0x30')]===_0xb91769;});if(_0x19a32a){logger[_0xf0ad('0x26')](_0xf0ad('0x31'));return BPromise[_0xf0ad('0x32')]({'id':_0x19a32a['name_value_list']['id'][_0xf0ad('0x30')],'name':_0x19a32a['name_value_list'][_0xf0ad('0xd')]['value']});}}logger[_0xf0ad('0x26')](_0xf0ad('0x33'));return BPromise[_0xf0ad('0x32')]({'id':_0x276322[_0xf0ad('0x2f')][_0xf0ad('0x34')][_0xf0ad('0x30')],'name':_0x276322[_0xf0ad('0x2f')][_0xf0ad('0x2a')]['value']});});}else{logger['info'](_0xf0ad('0x35'));return BPromise[_0xf0ad('0x32')]({'id':_0x276322[_0xf0ad('0x2f')][_0xf0ad('0x34')]['value'],'name':_0x276322[_0xf0ad('0x2f')]['user_name'][_0xf0ad('0x30')]});}}function getEndUser(_0x4c83c7,_0x4136b9,_0x4846b1,_0x3d9e48){logger[_0xf0ad('0x26')](_0xf0ad('0x36'),_0x4846b1);return request({'form':{'method':_0xf0ad('0x28'),'input_type':_0xf0ad('0x1d'),'response_type':_0xf0ad('0x1d'),'rest_data':JSON[_0xf0ad('0x24')]({'session':_0x3d9e48['id'],'module_name':_0xf0ad('0x17'),'query':util['format'](_0xf0ad('0x37'),_0x4846b1),'order_by':'','offset':'0','select_fields':['id','name',_0xf0ad('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3f7e2b){if(_0x3f7e2b[_0xf0ad('0x2e')][_0xf0ad('0x2c')]){var _0x2eeb3f=_[_0xf0ad('0x2d')](_0x3f7e2b['entry_list'],function(_0x4721d3){return _0x4721d3[_0xf0ad('0x2f')][_0xf0ad('0x38')][_0xf0ad('0x30')]===_0x4846b1;});if(_0x2eeb3f){logger[_0xf0ad('0x26')](_0xf0ad('0x39'));return BPromise[_0xf0ad('0x32')]({'id':_0x2eeb3f['name_value_list']['id'][_0xf0ad('0x30')],'name':_0x2eeb3f[_0xf0ad('0x2f')][_0xf0ad('0xd')][_0xf0ad('0x30')],'phone':_0x2eeb3f[_0xf0ad('0x2f')][_0xf0ad('0x38')][_0xf0ad('0x30')]});}}else{logger[_0xf0ad('0x26')](_0xf0ad('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xf0ad('0x1d'),'response_type':_0xf0ad('0x1d'),'rest_data':JSON[_0xf0ad('0x24')]({'session':_0x3d9e48['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x4136b9!==''?_0x4136b9:util[_0xf0ad('0x1f')](_0xf0ad('0x3b'),_0x4846b1)},{'name':_0xf0ad('0x38'),'value':_0x4846b1}]})}})[_0xf0ad('0x2b')](function(_0x383633){logger[_0xf0ad('0x26')](_0xf0ad('0x3c'));return BPromise[_0xf0ad('0x32')]({'id':_0x383633['id'],'name':_0x383633[_0xf0ad('0x2e')][_0xf0ad('0x3d')][_0xf0ad('0x30')],'phone':_0x383633['entry_list']['phone_home']['value']});});}});}function request(_0x1c0609){logger[_0xf0ad('0x3e')]('[HTTP]',JSON[_0xf0ad('0x24')](_0x1c0609));return rp(_[_0xf0ad('0x3f')](def,_0x1c0609));}function getTags(_0x52438c,_0x29fc6b){var _0x2372bb=[];if(_0x52438c&&_0x52438c[_0xf0ad('0x2c')]>0x0){_0x2372bb=_[_0xf0ad('0x40')](_0x52438c,_0x29fc6b);}return _0x2372bb;}function getCustomFields(_0x50ede2,_0x33feab){var _0x10d58b=[];var _0x172e14={'custom_fields':[]};if(_0x50ede2[_0xf0ad('0x2c')]>0x0){_[_0xf0ad('0x41')](_0x50ede2,function(_0x317757){if(_0x317757[_0xf0ad('0x42')]===_0xf0ad('0x43')&&_0x317757[_0xf0ad('0x44')]&&!_0x317757[_0xf0ad('0x45')]){_0x172e14[_0x317757[_0xf0ad('0x44')]['toLowerCase']()]=_0x317757[_0xf0ad('0x46')][_0xf0ad('0x22')]();}else if(_0x317757[_0xf0ad('0x42')]==='string'&&_0x317757['idField']&&_0x317757[_0xf0ad('0x45')]){_0x172e14[_0xf0ad('0x47')][_0xf0ad('0x48')]({'id':_0x317757[_0xf0ad('0x1b')],'value':_0x317757[_0xf0ad('0x46')][_0xf0ad('0x22')]()});}else if(_0x317757[_0xf0ad('0x42')]==='variable'&&_0x317757[_0xf0ad('0x1a')]&&_0x317757['idField']&&_0x317757[_0xf0ad('0x45')]){_0x33feab[_0x317757[_0xf0ad('0x1a')]]&&_0x172e14[_0xf0ad('0x47')][_0xf0ad('0x48')]({'id':_0x317757[_0xf0ad('0x1b')],'value':_0x33feab[_0x317757['variableName']]['toString']()});}else if(_0x317757[_0xf0ad('0x42')]===_0xf0ad('0x49')&&_0x317757[_0xf0ad('0x4a')]&&_0x317757[_0xf0ad('0x4a')][_0xf0ad('0xd')]&&_0x317757[_0xf0ad('0x1b')]&&_0x317757[_0xf0ad('0x45')]){_0x33feab[_0x317757['Variable'][_0xf0ad('0xd')][_0xf0ad('0x4b')]()]&&_0x172e14[_0xf0ad('0x47')][_0xf0ad('0x48')]({'id':_0x317757[_0xf0ad('0x1b')],'value':_0x33feab[_0x317757['Variable'][_0xf0ad('0xd')][_0xf0ad('0x4b')]()][_0xf0ad('0x22')]()});}});}return _0x172e14;}function getConnection(_0x3b3b50){return request({'method':_0xf0ad('0xb'),'form':{'method':_0xf0ad('0x4c'),'input_type':_0xf0ad('0x1d'),'response_type':'JSON','rest_data':JSON[_0xf0ad('0x24')]({'user_auth':{'user_name':_0x3b3b50[_0xf0ad('0x4d')],'password':_0x3b3b50[_0xf0ad('0x4e')],'encryption':'PLAIN'},'application':_0xf0ad('0x4f')})}})[_0xf0ad('0x2b')](function(_0x2f2fae){var _0xc708ba=_0x2f2fae;if(_0xc708ba['id']){def[_0xf0ad('0x50')]=_0xc708ba['id'];return BPromise[_0xf0ad('0x32')](_0xc708ba);}else{throw new Error(util[_0xf0ad('0x1f')](_0xf0ad('0x51'),_0x3b3b50['id']));}});}function setRelationship(_0x7e2a23,_0x3d78a2,_0x273ba4,_0x55a261){return request({'form':{'method':'set_relationship','input_type':_0xf0ad('0x1d'),'response_type':_0xf0ad('0x1d'),'rest_data':JSON['stringify']({'session':_0x7e2a23['id'],'module_name':_0xf0ad('0x1e'),'module_id':_0x273ba4['id'],'link_field_name':_0x55a261,'related_ids':[_0x3d78a2['id']]})}});}exports[_0xf0ad('0x52')]=function(_0x57a83b,_0x4eb299,_0x326aa7,_0x529201,_0x4e00aa,_0x57d216){var _0x476853,_0x5aa270,_0x56c8aa,_0x16f29d;_0x57d216[_0xf0ad('0x53')]=intUtil[_0xf0ad('0x54')](_0x57d216[_0xf0ad('0x53')]);_0x57d216[_0xf0ad('0x55')]=intUtil[_0xf0ad('0x54')](_0x57d216[_0xf0ad('0x55')]);def['uri']=util[_0xf0ad('0x1f')]('%s/service/v4_1/rest.php',_0x57d216['remoteUri']);if(_0x4e00aa&&_0x4e00aa['monitor_format']){logger['info'](_0xf0ad('0x56'),_0xf0ad('0x57'));_0x4eb299[_0xf0ad('0x58')]=util[_0xf0ad('0x1f')](_0xf0ad('0x59'),_0x57d216[_0xf0ad('0x55')],_0x4eb299[_0xf0ad('0x5a')],md5(_0x4eb299[_0xf0ad('0x5a')]));}else{_0x4eb299[_0xf0ad('0x58')]='';}return getConnection(_0x57d216)[_0xf0ad('0x2b')](function(_0x3e5b8c){_0x16f29d=_0x3e5b8c;return getUser(_0x57d216,_0x529201['name'],_0x16f29d);})['then'](function(_0x2baccb){_0x476853=_0x2baccb;logger[_0xf0ad('0x26')]('The\x20User\x20ID\x20is:',_0x476853['id']);return getEndUser(_0x57d216,_0x4eb299[_0xf0ad('0x5b')],_0x4eb299[_0xf0ad('0x5c')],_0x16f29d);})['then'](function(_0xecfee9){_0x5aa270=_0xecfee9;logger[_0xf0ad('0x26')](_0xf0ad('0x5d'),_0x5aa270['id']);return getTicket(_0x57d216,_0x476853,_0x5aa270,_0x326aa7,_0x4eb299,_0x326aa7['Fields'],_0x16f29d,_0xf0ad('0x5e'));})[_0xf0ad('0x2b')](function(_0x384e2a){_0x56c8aa=_0x384e2a;logger[_0xf0ad('0x26')](_0xf0ad('0x5f'));logger[_0xf0ad('0x26')](_0xf0ad('0x60'),_0x56c8aa['id']);return setRelationship(_0x16f29d,_0x476853,_0x56c8aa,_0xf0ad('0x61'));})['then'](function(){return setRelationship(_0x16f29d,_0x5aa270,_0x56c8aa,_0xf0ad('0x62'));})['then'](function(){return getServerInfo(_0x16f29d);})[_0xf0ad('0x2b')](function(_0x83769d){var _0x1e59ab=parseInt(_0x83769d['version'][_0xf0ad('0x63')](0x0));var _0x5d1bc0=util[_0xf0ad('0x1f')](_0xf0ad('0x64'),_0x57d216[_0xf0ad('0x53')],_0x56c8aa['id']);if(_0x1e59ab>0x6){_0x5d1bc0=util[_0xf0ad('0x1f')](_0xf0ad('0x65'),_0x57d216[_0xf0ad('0x53')],_0x56c8aa['id']);}logger[_0xf0ad('0x26')]('[QUEUE]',_0xf0ad('0x66'));emit(util[_0xf0ad('0x1f')]('user:%s',_0x529201[_0xf0ad('0xd')]),_0xf0ad('0x67'),{'uri':_0x5d1bc0});})[_0xf0ad('0x68')](function(_0x2b8907){logger[_0xf0ad('0x69')](_0xf0ad('0x56'),JSON[_0xf0ad('0x24')](_0x2b8907));});};exports[_0xf0ad('0x6a')]=function(_0x8e1333,_0x3b56d3,_0x2463cd,_0x391eea,_0x47021c,_0x51eb6d,_0x19429d){var _0x3402b0,_0x46a4cd,_0x232c6b,_0x4e48df;_0x51eb6d[_0xf0ad('0x53')]=intUtil[_0xf0ad('0x54')](_0x51eb6d[_0xf0ad('0x53')]);_0x51eb6d['serverUrl']=intUtil[_0xf0ad('0x54')](_0x51eb6d['serverUrl']);def[_0xf0ad('0x6b')]=util[_0xf0ad('0x1f')](_0xf0ad('0x6c'),_0x51eb6d[_0xf0ad('0x53')]);if(_0x19429d&&_0x19429d['recordingFormat']&&_0x19429d[_0xf0ad('0x6d')]!=='none'){logger['info'](_0xf0ad('0x6e'),_0xf0ad('0x57'));_0x3b56d3[_0xf0ad('0x58')]=util[_0xf0ad('0x1f')](_0xf0ad('0x59'),_0x51eb6d['serverUrl'],_0x3b56d3['uniqueid'],md5(_0x3b56d3[_0xf0ad('0x5a')]));}return getConnection(_0x51eb6d)[_0xf0ad('0x2b')](function(_0xba7a26){_0x4e48df=_0xba7a26;return getUser(_0x51eb6d,_0x391eea[_0xf0ad('0xd')],_0x4e48df);})[_0xf0ad('0x2b')](function(_0x1d9e1f){_0x3402b0=_0x1d9e1f;logger[_0xf0ad('0x26')]('The\x20User\x20ID\x20is:',_0x3402b0['id']);return getEndUser(_0x51eb6d,_0x3b56d3[_0xf0ad('0x6f')],_0x3b56d3[_0xf0ad('0x70')],_0x4e48df);})[_0xf0ad('0x2b')](function(_0x2e247f){_0x46a4cd=_0x2e247f;logger[_0xf0ad('0x26')](_0xf0ad('0x5d'),_0x46a4cd['id']);return getTicket(_0x51eb6d,_0x3402b0,_0x46a4cd,_0x2463cd,_0x3b56d3,_0x2463cd['Fields'],_0x4e48df,'Outbound');})[_0xf0ad('0x2b')](function(_0x2bb959){_0x232c6b=_0x2bb959;logger[_0xf0ad('0x26')](_0xf0ad('0x5f'));logger['info'](_0xf0ad('0x60'),_0x232c6b['id']);return setRelationship(_0x4e48df,_0x3402b0,_0x232c6b,'users');})['then'](function(){return setRelationship(_0x4e48df,_0x46a4cd,_0x232c6b,_0xf0ad('0x62'));})['then'](function(){return getServerInfo(_0x4e48df);})[_0xf0ad('0x2b')](function(_0x54c72b){var _0x559e92=parseInt(_0x54c72b[_0xf0ad('0x71')][_0xf0ad('0x63')](0x0));var _0x3511a4=util[_0xf0ad('0x1f')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x51eb6d[_0xf0ad('0x53')],_0x232c6b['id']);if(_0x559e92>0x6){_0x3511a4=util[_0xf0ad('0x1f')](_0xf0ad('0x65'),_0x51eb6d['remoteUri'],_0x232c6b['id']);}logger['info']('[OUTBOUND]',_0xf0ad('0x66'));emit(util[_0xf0ad('0x1f')]('user:%s',_0x391eea[_0xf0ad('0xd')]),_0xf0ad('0x67'),{'uri':_0x3511a4});})[_0xf0ad('0x68')](function(_0x21710b){logger[_0xf0ad('0x69')](_0xf0ad('0x6e'),JSON[_0xf0ad('0x24')](_0x21710b));});};exports[_0xf0ad('0x72')]=function(_0x3bd86a,_0x56bda2,_0x244333,_0x30d0fd,_0x540124,_0x2cd0ce){var _0x2ec429,_0x13c804,_0xbc45c4,_0x20ad7b;_0x2cd0ce[_0xf0ad('0x53')]=intUtil[_0xf0ad('0x54')](_0x2cd0ce[_0xf0ad('0x53')]);_0x2cd0ce[_0xf0ad('0x55')]=intUtil[_0xf0ad('0x54')](_0x2cd0ce['serverUrl']);def[_0xf0ad('0x6b')]=util[_0xf0ad('0x1f')](_0xf0ad('0x6c'),_0x2cd0ce[_0xf0ad('0x53')]);if(_0x540124&&_0x540124['monitor_format']){logger[_0xf0ad('0x26')]('['+_0x56bda2[_0xf0ad('0x73')][_0xf0ad('0x74')]()+']',_0xf0ad('0x57'));_0x56bda2[_0xf0ad('0x58')]=util[_0xf0ad('0x1f')](_0xf0ad('0x59'),_0x2cd0ce[_0xf0ad('0x55')],_0x56bda2[_0xf0ad('0x5a')],md5(_0x56bda2[_0xf0ad('0x5a')]));}else{_0x56bda2['recordingURL']='';}return getConnection(_0x2cd0ce)[_0xf0ad('0x2b')](function(_0x2bdf7a){_0x20ad7b=_0x2bdf7a;if(!_['isNil'](_0x30d0fd)){return getUser(_0x2cd0ce,_0x30d0fd[_0xf0ad('0xd')],_0x20ad7b);}else{return getUser(_0x2cd0ce,null,_0x20ad7b);}})[_0xf0ad('0x2b')](function(_0x4e186e){_0x2ec429=_0x4e186e;logger[_0xf0ad('0x26')](_0xf0ad('0x75'),_0x2ec429['id']);return getEndUser(_0x2cd0ce,_0x56bda2[_0xf0ad('0x5b')],_0x56bda2[_0xf0ad('0x5c')],_0x20ad7b);})[_0xf0ad('0x2b')](function(_0x408bce){_0x13c804=_0x408bce;logger[_0xf0ad('0x26')](_0xf0ad('0x5d'),_0x13c804['id']);return getTicket(_0x2cd0ce,_0x2ec429,_0x13c804,_0x244333,_0x56bda2,_0x244333['Fields'],_0x20ad7b,_0xf0ad('0x5e'));})[_0xf0ad('0x2b')](function(_0x578631){_0xbc45c4=_0x578631;logger[_0xf0ad('0x26')](_0xf0ad('0x5f'));logger[_0xf0ad('0x26')](_0xf0ad('0x60'),_0xbc45c4['id']);return setRelationship(_0x20ad7b,_0x2ec429,_0xbc45c4,_0xf0ad('0x61'));})[_0xf0ad('0x2b')](function(){return setRelationship(_0x20ad7b,_0x13c804,_0xbc45c4,_0xf0ad('0x62'));})['then'](function(){return getServerInfo(_0x20ad7b);})[_0xf0ad('0x68')](function(_0x118ac2){logger['error']('['+_0x56bda2[_0xf0ad('0x73')][_0xf0ad('0x74')]()+']',JSON[_0xf0ad('0x24')](_0x118ac2));});}; \ 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 64b2e91..087594a 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 _0xcd93=['util','getString','length','sortBy','type','string','content','variable','variableName','Variable','name','toLowerCase','push','toString','keyValue','keyType','key','%s:\x20%s','keyContent','format','customVariable','join','stripTrailingSlash','slice','substring','test'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd93,0x186));var _0x3cd9=function(_0x4a2c82,_0x3a7eeb){_0x4a2c82=_0x4a2c82-0x0;var _0x5d7462=_0xcd93[_0x4a2c82];return _0x5d7462;};'use strict';var _=require('lodash');var util=require(_0x3cd9('0x0'));exports[_0x3cd9('0x1')]=function(_0x25b74f,_0x1286be,_0x173e54){var _0x3ba1a9=[];if(_0x25b74f[_0x3cd9('0x2')]>0x0){var _0x102312=_[_0x3cd9('0x3')](_0x25b74f,['id']);for(var _0x4ff201=0x0;_0x4ff201<_0x102312[_0x3cd9('0x2')];_0x4ff201++){var _0x478ce5=_0x102312[_0x4ff201];if(_0x478ce5[_0x3cd9('0x4')]===_0x3cd9('0x5')){_0x3ba1a9['push'](_0x478ce5[_0x3cd9('0x6')]);}else if(_0x478ce5[_0x3cd9('0x4')]===_0x3cd9('0x7')&&_0x478ce5[_0x3cd9('0x8')]){_0x1286be[_0x478ce5[_0x3cd9('0x8')]]&&_0x3ba1a9['push'](_0x1286be[_0x478ce5['variableName']]['toString']());}else if(_0x478ce5[_0x3cd9('0x4')]==='customVariable'&&_0x478ce5[_0x3cd9('0x9')]&&_0x478ce5[_0x3cd9('0x9')][_0x3cd9('0xa')]){_0x1286be[_0x478ce5['Variable'][_0x3cd9('0xa')][_0x3cd9('0xb')]()]&&_0x3ba1a9[_0x3cd9('0xc')](_0x1286be[_0x478ce5['Variable'][_0x3cd9('0xa')]['toLowerCase']()][_0x3cd9('0xd')]());}else if(_0x478ce5[_0x3cd9('0x4')]===_0x3cd9('0xe')){if(_0x478ce5[_0x3cd9('0xf')]===_0x3cd9('0x5')&&_0x478ce5[_0x3cd9('0x10')]){_0x3ba1a9[_0x3cd9('0xc')](util['format'](_0x3cd9('0x11'),_0x478ce5[_0x3cd9('0x10')],_0x478ce5[_0x3cd9('0x12')]));}else if(_0x478ce5[_0x3cd9('0xf')]==='variable'&&_0x478ce5[_0x3cd9('0x8')]&&_0x478ce5[_0x3cd9('0x10')]){_0x1286be[_0x478ce5[_0x3cd9('0x8')]]&&_0x3ba1a9[_0x3cd9('0xc')](util[_0x3cd9('0x13')](_0x3cd9('0x11'),_0x478ce5[_0x3cd9('0x10')],_0x1286be[_0x478ce5[_0x3cd9('0x8')]]));}else if(_0x478ce5[_0x3cd9('0xf')]===_0x3cd9('0x14')&&_0x478ce5[_0x3cd9('0x9')]&&_0x478ce5['Variable'][_0x3cd9('0xa')]&&_0x478ce5[_0x3cd9('0x10')]){_0x1286be[_0x478ce5['Variable'][_0x3cd9('0xa')][_0x3cd9('0xb')]()]&&_0x3ba1a9[_0x3cd9('0xc')](util[_0x3cd9('0x13')]('%s:\x20%s',_0x478ce5[_0x3cd9('0x10')],_0x1286be[_0x478ce5[_0x3cd9('0x9')][_0x3cd9('0xa')][_0x3cd9('0xb')]()]));}}}}return _0x3ba1a9[_0x3cd9('0x15')](_0x173e54);};exports[_0x3cd9('0x16')]=function(_0x67682e){var _0x43f456=_0x67682e[_0x3cd9('0x17')](-0x1);if(_0x43f456==='/'){_0x67682e=_0x67682e[_0x3cd9('0x18')](0x0,_0x67682e['lastIndexOf'](_0x43f456));}return _0x67682e;};exports['validateEmail']=function(_0xf9a43f){if(!_['isNil'](_0xf9a43f)&&_0xf9a43f!==''){var _0x1f1310=/^(([^<>()\[\]\\.,;:\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 _0x1f1310[_0x3cd9('0x19')](String(_0xf9a43f)[_0x3cd9('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xa078=['stripTrailingSlash','substring','validateEmail','isNil','test','getString','length','sortBy','type','string','push','content','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','customVariable'];(function(_0x1b1520,_0x393506){var _0x8092cb=function(_0x329b22){while(--_0x329b22){_0x1b1520['push'](_0x1b1520['shift']());}};_0x8092cb(++_0x393506);}(_0xa078,0x9b));var _0x8a07=function(_0x18a613,_0x5a62a3){_0x18a613=_0x18a613-0x0;var _0x2e9268=_0xa078[_0x18a613];return _0x2e9268;};'use strict';var _=require('lodash');var util=require('util');exports[_0x8a07('0x0')]=function(_0x4d7501,_0x4a7958,_0x29ac00){var _0x38f16e=[];if(_0x4d7501[_0x8a07('0x1')]>0x0){var _0x1b8d2c=_[_0x8a07('0x2')](_0x4d7501,['id']);for(var _0x4fa670=0x0;_0x4fa670<_0x1b8d2c[_0x8a07('0x1')];_0x4fa670++){var _0xa3fa5=_0x1b8d2c[_0x4fa670];if(_0xa3fa5[_0x8a07('0x3')]===_0x8a07('0x4')){_0x38f16e[_0x8a07('0x5')](_0xa3fa5[_0x8a07('0x6')]);}else if(_0xa3fa5['type']==='variable'&&_0xa3fa5[_0x8a07('0x7')]){_0x4a7958[_0xa3fa5[_0x8a07('0x7')]]&&_0x38f16e['push'](_0x4a7958[_0xa3fa5['variableName']][_0x8a07('0x8')]());}else if(_0xa3fa5[_0x8a07('0x3')]==='customVariable'&&_0xa3fa5[_0x8a07('0x9')]&&_0xa3fa5['Variable'][_0x8a07('0xa')]){_0x4a7958[_0xa3fa5['Variable']['name'][_0x8a07('0xb')]()]&&_0x38f16e[_0x8a07('0x5')](_0x4a7958[_0xa3fa5['Variable'][_0x8a07('0xa')][_0x8a07('0xb')]()][_0x8a07('0x8')]());}else if(_0xa3fa5[_0x8a07('0x3')]===_0x8a07('0xc')){if(_0xa3fa5[_0x8a07('0xd')]===_0x8a07('0x4')&&_0xa3fa5[_0x8a07('0xe')]){_0x38f16e['push'](util[_0x8a07('0xf')](_0x8a07('0x10'),_0xa3fa5[_0x8a07('0xe')],_0xa3fa5[_0x8a07('0x11')]));}else if(_0xa3fa5[_0x8a07('0xd')]===_0x8a07('0x12')&&_0xa3fa5[_0x8a07('0x7')]&&_0xa3fa5[_0x8a07('0xe')]){_0x4a7958[_0xa3fa5[_0x8a07('0x7')]]&&_0x38f16e['push'](util[_0x8a07('0xf')](_0x8a07('0x10'),_0xa3fa5[_0x8a07('0xe')],_0x4a7958[_0xa3fa5[_0x8a07('0x7')]]));}else if(_0xa3fa5[_0x8a07('0xd')]===_0x8a07('0x13')&&_0xa3fa5[_0x8a07('0x9')]&&_0xa3fa5[_0x8a07('0x9')]['name']&&_0xa3fa5[_0x8a07('0xe')]){_0x4a7958[_0xa3fa5['Variable']['name'][_0x8a07('0xb')]()]&&_0x38f16e[_0x8a07('0x5')](util[_0x8a07('0xf')](_0x8a07('0x10'),_0xa3fa5[_0x8a07('0xe')],_0x4a7958[_0xa3fa5[_0x8a07('0x9')]['name'][_0x8a07('0xb')]()]));}}}}return _0x38f16e['join'](_0x29ac00);};exports[_0x8a07('0x14')]=function(_0x4c48a3){var _0x365499=_0x4c48a3['slice'](-0x1);if(_0x365499==='/'){_0x4c48a3=_0x4c48a3[_0x8a07('0x15')](0x0,_0x4c48a3['lastIndexOf'](_0x365499));}return _0x4c48a3;};exports[_0x8a07('0x16')]=function(_0x46fe0f){if(!_[_0x8a07('0x17')](_0x46fe0f)&&_0x46fe0f!==''){var _0x48d09a=/^(([^<>()\[\]\\.,;:\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 _0x48d09a[_0x8a07('0x18')](String(_0x46fe0f)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 6806445..0b838f6 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 _0xf749=['createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','format','length','Agent\x20found!','resolve','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','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;','success','Enduser\x20found!','firstname','lastname','Enduser\x20created.','getEndUser','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','monitor_format','lastevent','toUpperCase','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','defaults','redis','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','Descriptions','POST','remoteUri','create','username','sessionName','HelpDesk','stringify','then','result','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x129327,_0x3ada11){var _0x53a8c3=function(_0x52f008){while(--_0x52f008){_0x129327['push'](_0x129327['shift']());}};_0x53a8c3(++_0x3ada11);}(_0xf749,0xf7));var _0x9f74=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf749[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x9f74('0x0'));var md5=require(_0x9f74('0x1'));var util=require(_0x9f74('0x2'));var Redis=require(_0x9f74('0x3'));var intUtil=require(_0x9f74('0x4'));var config=require(_0x9f74('0x5'));var logger=require(_0x9f74('0x6'))(_0x9f74('0x7'));config['redis']=_[_0x9f74('0x8')](config[_0x9f74('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9f74('0x9')]));function emit(_0xe45a23,_0x137007,_0x1825cd){io['to'](_0xe45a23)['emit'](_0x137007,_0x1825cd);}function getCustomFields(_0x37ae58,_0x273545){var _0x506e43={};if(_0x37ae58['length']>0x0){_[_0x9f74('0xa')](_0x37ae58,function(_0x420295){if(_0x420295[_0x9f74('0xb')]===_0x9f74('0xc')&&_0x420295[_0x9f74('0xd')]){_0x506e43[_0x420295['idField']]=_0x420295[_0x9f74('0xe')][_0x9f74('0xf')]();}else if(_0x420295[_0x9f74('0xb')]==='variable'&&_0x420295[_0x9f74('0x10')]&&_0x420295[_0x9f74('0xd')]&&_0x273545[_0x420295[_0x9f74('0x10')]]){_0x506e43[_0x420295[_0x9f74('0xd')]]=_0x273545[_0x420295[_0x9f74('0x10')]][_0x9f74('0xf')]();}else if(_0x420295['type']===_0x9f74('0x11')&&_0x420295['Variable']&&_0x420295[_0x9f74('0x12')][_0x9f74('0x13')]&&_0x420295[_0x9f74('0xd')]&&_0x273545[_0x420295['Variable'][_0x9f74('0x13')]['toLowerCase']()]){_0x506e43[_0x420295[_0x9f74('0xd')]]=_0x273545[_0x420295[_0x9f74('0x12')][_0x9f74('0x13')]['toLowerCase']()][_0x9f74('0xf')]();}});}return _0x506e43;}function createTicket(_0x32250f,_0x1a508c,_0x4db3e3,_0x6864d0,_0x4fde97,_0x193872,_0x3d89b8){logger[_0x9f74('0x14')](_0x9f74('0x15'));var _0x4af72f=_[_0x9f74('0x16')]({'parent_id':'','assigned_user_id':_0x1a508c['id'],'ticketpriorities':_0x9f74('0x17'),'ticketstatus':_0x9f74('0x18'),'ticket_title':intUtil[_0x9f74('0x19')](_0x6864d0[_0x9f74('0x1a')],_0x4fde97,'\x20'),'description':intUtil[_0x9f74('0x19')](_0x6864d0[_0x9f74('0x1b')],_0x4fde97,'\x0a'),'contact_id':_0x4db3e3['id']},getCustomFields(_0x193872,_0x4fde97));var _0x5c3db7={'method':_0x9f74('0x1c'),'uri':util['format']('%s/webservice.php',_0x32250f[_0x9f74('0x1d')]),'form':{'operation':_0x9f74('0x1e'),'username':_0x32250f[_0x9f74('0x1f')],'sessionName':_0x3d89b8[_0x9f74('0x20')],'elementType':_0x9f74('0x21'),'element':JSON[_0x9f74('0x22')](_0x4af72f)},'json':!![]};return request(_0x5c3db7)[_0x9f74('0x23')](function(_0x4fabac){if(_0x4fabac['success']){return BPromise['resolve']({'id':_0x4fabac[_0x9f74('0x24')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON['stringify'](_0x4fabac[_0x9f74('0x25')])));}})[_0x9f74('0x26')](function(_0x4b89ca){var _0x1548ef=_0x4b89ca[_0x9f74('0x27')]||0x1f4;logger['error'](_0x9f74('0x28'),_0x9f74('0x29'),_0x1548ef,JSON[_0x9f74('0x22')](_0x4b89ca));});}function getUser(_0x1a1f58,_0x178ad6,_0xb87292){if(intUtil[_0x9f74('0x2a')](_0x178ad6)){logger[_0x9f74('0x14')](_0x9f74('0x2b'),_0x178ad6);return request({'method':_0x9f74('0x2c'),'uri':util['format'](_0x9f74('0x2d'),_0x1a1f58[_0x9f74('0x1d')]),'qs':{'operation':_0x9f74('0x2e'),'username':_0x1a1f58[_0x9f74('0x1f')],'sessionName':_0xb87292[_0x9f74('0x20')],'query':util[_0x9f74('0x2f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x178ad6)},'json':!![]})[_0x9f74('0x23')](function(_0x588ff5){if(_0x588ff5['success']&&_0x588ff5[_0x9f74('0x24')][_0x9f74('0x30')]){logger[_0x9f74('0x14')](_0x9f74('0x31'));return BPromise[_0x9f74('0x32')]({'id':_0x588ff5['result'][0x0]['id'],'email':_0x588ff5[_0x9f74('0x24')][0x0][_0x9f74('0x33')],'name':_0x588ff5['result'][0x0]['first_name']+'\x20'+_0x588ff5[_0x9f74('0x24')]['last_name']});}else{logger[_0x9f74('0x14')](_0x9f74('0x34'));return BPromise['resolve']({'id':_0xb87292[_0x9f74('0x35')],'email':_0x1a1f58[_0x9f74('0x1f')],'name':_0x9f74('0x36')});}})[_0x9f74('0x26')](function(_0x3e5456){var _0x2996c4=_0x3e5456[_0x9f74('0x27')]||0x1f4;logger['error'](_0x9f74('0x28'),'getUser',_0x2996c4,JSON['stringify'](_0x3e5456));});}else{logger[_0x9f74('0x14')](_0x9f74('0x34'));return BPromise[_0x9f74('0x32')]({'id':_0xb87292[_0x9f74('0x35')],'email':_0x1a1f58[_0x9f74('0x1f')],'name':_0x9f74('0x36')})[_0x9f74('0x26')](function(_0x84ab1d){var _0x5d70a7=_0x84ab1d[_0x9f74('0x27')]||0x1f4;logger['error'](_0x9f74('0x28'),_0x9f74('0x37'),_0x5d70a7,JSON[_0x9f74('0x22')](_0x84ab1d));});}}function getEndUser(_0x3573fb,_0x2ddad8,_0x4cd251,_0x3a11e1){logger['info'](_0x9f74('0x38'),_0x4cd251);return request({'method':'GET','uri':util['format']('%s/webservice.php',_0x3573fb['remoteUri']),'qs':{'operation':_0x9f74('0x2e'),'username':_0x3573fb[_0x9f74('0x1f')],'sessionName':_0x3a11e1[_0x9f74('0x20')],'query':util['format'](_0x9f74('0x39'),_0x4cd251,_0x4cd251,_0x4cd251,_0x4cd251,_0x4cd251)},'json':!![]})['then'](function(_0x2f61c3){if(_0x2f61c3[_0x9f74('0x3a')]&&_0x2f61c3[_0x9f74('0x24')][_0x9f74('0x30')]){logger[_0x9f74('0x14')](_0x9f74('0x3b'));return BPromise[_0x9f74('0x32')]({'id':_0x2f61c3['result'][0x0]['id'],'name':_0x2f61c3[_0x9f74('0x24')][0x0][_0x9f74('0x3c')]+'\x20'+_0x2f61c3[_0x9f74('0x24')][0x0][_0x9f74('0x3d')],'phone':_0x4cd251});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x9f74('0x1c'),'uri':util[_0x9f74('0x2f')]('%s/webservice.php',_0x3573fb[_0x9f74('0x1d')]),'form':{'operation':_0x9f74('0x1e'),'sessionName':_0x3a11e1[_0x9f74('0x20')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x2ddad8,'phone':_0x4cd251,'assigned_user_id':'\x20'})},'json':!![]})[_0x9f74('0x23')](function(_0x2913e2){logger[_0x9f74('0x14')](_0x9f74('0x3e'));return BPromise[_0x9f74('0x32')]({'id':_0x2913e2['result']['id'],'name':_0x2913e2[_0x9f74('0x24')]['lastname'],'phone':_0x2913e2[_0x9f74('0x24')]['phone']});})[_0x9f74('0x26')](function(_0x1b3a15){var _0x36c237=_0x1b3a15[_0x9f74('0x27')]||0x1f4;logger[_0x9f74('0x25')](_0x9f74('0x28'),_0x9f74('0x3f'),_0x36c237,JSON['stringify'](_0x1b3a15));});}});}function getConnection(_0x4dd3e1){var _0x592cf7=_0x4dd3e1[_0x9f74('0x1f')];var _0x3ac78a=_0x4dd3e1['accessKey'];return request({'method':_0x9f74('0x2c'),'uri':util[_0x9f74('0x2f')]('%s/webservice.php',_0x4dd3e1['remoteUri']),'qs':{'operation':'getchallenge','username':_0x592cf7},'json':!![]})['then'](function(_0x54c8ed){if(_0x54c8ed['success']){return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x4dd3e1[_0x9f74('0x1d')]),'form':{'operation':_0x9f74('0x40'),'username':_0x592cf7,'accessKey':md5(_0x54c8ed[_0x9f74('0x24')][_0x9f74('0x41')]+_0x3ac78a)},'json':!![]});}})[_0x9f74('0x23')](function(_0x19e179){if(_0x19e179['success']){return BPromise['resolve'](_0x19e179[_0x9f74('0x24')]);}else{throw new Error(util[_0x9f74('0x2f')](_0x9f74('0x42'),_0x4dd3e1['id']));}})[_0x9f74('0x26')](function(_0x5bf9ed){var _0x1de1c5=_0x5bf9ed[_0x9f74('0x27')]||0x1f4;logger['error'](_0x9f74('0x28'),_0x9f74('0x43'),_0x1de1c5,JSON['stringify'](_0x5bf9ed));});}function request(_0x466de2){logger[_0x9f74('0x14')](_0x9f74('0x44'),JSON[_0x9f74('0x22')](_0x466de2));return rp(_0x466de2);}exports[_0x9f74('0x45')]=function(_0x51a2eb,_0x57c165,_0x3454ec,_0x43f8db,_0x4580d1,_0x11c2dd){var _0x4a676f,_0x261dc0,_0x2437a5,_0x11c8f8;_0x11c2dd['remoteUri']=intUtil[_0x9f74('0x46')](_0x11c2dd[_0x9f74('0x1d')]);if(_0x4580d1&&_0x4580d1['monitor_format']){logger[_0x9f74('0x14')](_0x9f74('0x47'),_0x9f74('0x48'));_0x57c165[_0x9f74('0x49')]=util[_0x9f74('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x11c2dd[_0x9f74('0x4a')],_0x57c165[_0x9f74('0x4b')],md5(_0x57c165[_0x9f74('0x4b')]));}else{_0x57c165[_0x9f74('0x49')]='';}return getConnection(_0x11c2dd)[_0x9f74('0x23')](function(_0x2d294b){_0x11c8f8=_0x2d294b;return getUser(_0x11c2dd,_0x43f8db[_0x9f74('0x4c')],_0x11c8f8);})[_0x9f74('0x23')](function(_0x33b1a2){_0x4a676f=_0x33b1a2;logger[_0x9f74('0x14')](_0x9f74('0x4d'),_0x4a676f['id']);return getEndUser(_0x11c2dd,_0x57c165[_0x9f74('0x4e')],_0x57c165[_0x9f74('0x4f')],_0x11c8f8);})['then'](function(_0x165e36){_0x261dc0=_0x165e36;logger['info'](_0x9f74('0x50'),_0x261dc0['id']);return createTicket(_0x11c2dd,_0x4a676f,_0x261dc0,_0x3454ec,_0x57c165,_0x3454ec[_0x9f74('0x51')],_0x11c8f8);})[_0x9f74('0x23')](function(_0x452052){_0x2437a5=_0x452052;logger['info']('Ticket\x20created!');logger[_0x9f74('0x14')]('The\x20Ticket\x20ID\x20is:',_0x2437a5['id']);var _0x755588=util['format'](_0x9f74('0x52'),_0x11c2dd[_0x9f74('0x1d')],_[_0x9f74('0x53')](_0x2437a5['id'],'x')[0x1]);logger[_0x9f74('0x14')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9f74('0x2f')](_0x9f74('0x54'),_0x43f8db['name']),_0x9f74('0x55'),{'uri':_0x755588});})['catch'](function(_0x8ecdad){logger['error'](_0x9f74('0x47'),JSON[_0x9f74('0x22')](_0x8ecdad));});};exports[_0x9f74('0x56')]=function(_0x257508,_0x4102d3,_0x275402,_0x240729,_0x18376f,_0xa41a1b,_0x8c7f38){var _0x12c7f5,_0x44cc83,_0x2ea4c8,_0x48b0d1;_0xa41a1b['remoteUri']=intUtil['stripTrailingSlash'](_0xa41a1b[_0x9f74('0x1d')]);_0xa41a1b[_0x9f74('0x4a')]=intUtil['stripTrailingSlash'](_0xa41a1b['serverUrl']);if(_0x8c7f38&&_0x8c7f38[_0x9f74('0x57')]&&_0x8c7f38['recordingFormat']!==_0x9f74('0x58')){logger[_0x9f74('0x14')](_0x9f74('0x59'),_0x9f74('0x48'));_0x4102d3[_0x9f74('0x49')]=util[_0x9f74('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa41a1b['serverUrl'],_0x4102d3[_0x9f74('0x4b')],md5(_0x4102d3[_0x9f74('0x4b')]));}return getConnection(_0xa41a1b)['then'](function(_0x528423){_0x48b0d1=_0x528423;return getUser(_0xa41a1b,_0x240729['email'],_0x48b0d1);})['then'](function(_0x446c56){_0x12c7f5=_0x446c56;logger['info'](_0x9f74('0x4d'),_0x12c7f5['id']);return getEndUser(_0xa41a1b,_0x4102d3[_0x9f74('0x5a')],_0x4102d3['destcalleridnum'],_0x48b0d1);})[_0x9f74('0x23')](function(_0x9d4c56){_0x44cc83=_0x9d4c56;logger[_0x9f74('0x14')](_0x9f74('0x50'),_0x44cc83['id']);return createTicket(_0xa41a1b,_0x12c7f5,_0x44cc83,_0x275402,_0x4102d3,_0x275402[_0x9f74('0x51')],_0x48b0d1);})[_0x9f74('0x23')](function(_0x553b48){_0x2ea4c8=_0x553b48;logger['info'](_0x9f74('0x5b'));logger[_0x9f74('0x14')](_0x9f74('0x5c'),_0x2ea4c8['id']);var _0x37956c=util[_0x9f74('0x2f')](_0x9f74('0x52'),_0xa41a1b[_0x9f74('0x1d')],_[_0x9f74('0x53')](_0x2ea4c8['id'],'x')[0x1]);logger['info'](_0x9f74('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9f74('0x2f')](_0x9f74('0x54'),_0x240729[_0x9f74('0x13')]),_0x9f74('0x55'),{'uri':_0x37956c});})[_0x9f74('0x26')](function(_0x5be924){logger[_0x9f74('0x25')](_0x9f74('0x59'),JSON['stringify'](_0x5be924));});};exports['unmanaged']=function(_0x3760a4,_0x1827c2,_0x14cbb3,_0x149b19,_0x4dff5a,_0x2a5460){var _0x5404cd,_0x21f099,_0x205641,_0x20fed5;_0x2a5460['remoteUri']=intUtil[_0x9f74('0x46')](_0x2a5460[_0x9f74('0x1d')]);_0x2a5460[_0x9f74('0x4a')]=intUtil[_0x9f74('0x46')](_0x2a5460['serverUrl']);if(_0x4dff5a&&_0x4dff5a[_0x9f74('0x5d')]){logger['info']('['+_0x1827c2[_0x9f74('0x5e')][_0x9f74('0x5f')]()+']',_0x9f74('0x48'));_0x1827c2[_0x9f74('0x49')]=util[_0x9f74('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a5460[_0x9f74('0x4a')],_0x1827c2[_0x9f74('0x4b')],md5(_0x1827c2[_0x9f74('0x4b')]));}else{_0x1827c2[_0x9f74('0x49')]='';}return getConnection(_0x2a5460)[_0x9f74('0x23')](function(_0xe30aab){_0x20fed5=_0xe30aab;return getUser(_0x2a5460,'',_0x20fed5);})[_0x9f74('0x23')](function(_0x5757c0){_0x5404cd=_0x5757c0;logger[_0x9f74('0x14')](_0x9f74('0x4d'),_0x5404cd['id']);return getEndUser(_0x2a5460,_0x1827c2[_0x9f74('0x4e')],_0x1827c2['calleridnum'],_0x20fed5);})[_0x9f74('0x23')](function(_0x3b4842){_0x21f099=_0x3b4842;logger['info']('The\x20Enduser\x20ID\x20is:',_0x21f099['id']);return createTicket(_0x2a5460,_0x5404cd,_0x21f099,_0x14cbb3,_0x1827c2,_0x14cbb3[_0x9f74('0x51')],_0x20fed5);})[_0x9f74('0x23')](function(_0x3f16d1){_0x205641=_0x3f16d1;logger[_0x9f74('0x14')](_0x9f74('0x5b'));logger[_0x9f74('0x14')]('The\x20Ticket\x20ID\x20is:',_0x205641['id']);})[_0x9f74('0x26')](function(_0x24f709){logger[_0x9f74('0x25')]('['+_0x1827c2[_0x9f74('0x5e')][_0x9f74('0x5f')]()+']',JSON['stringify'](_0x24f709));});}; \ No newline at end of file +var _0x64d7=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','Fields','user:%s','unmanaged','lastevent','toUpperCase','calleridnum','Ticket\x20created!','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','vTiger','defaults','localhost','socket.io-emitter','emit','length','type','idField','content','toString','variable','variableName','customVariable','name','Variable','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','username','sessionName','HelpDesk','stringify','then','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','remoteUri','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','email1','first_name','last_name','resolve','userId','admin','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','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!','Enduser\x20created.','phone','getEndUser','accessKey','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]'];(function(_0x39b4bd,_0x4e355f){var _0x502467=function(_0x232c3b){while(--_0x232c3b){_0x39b4bd['push'](_0x39b4bd['shift']());}};_0x502467(++_0x4e355f);}(_0x64d7,0x148));var _0x764d=function(_0x14f7fe,_0x5132c4){_0x14f7fe=_0x14f7fe-0x0;var _0x3d8309=_0x64d7[_0x14f7fe];return _0x3d8309;};'use strict';var _=require(_0x764d('0x0'));var rp=require(_0x764d('0x1'));var BPromise=require('bluebird');var md5=require(_0x764d('0x2'));var util=require(_0x764d('0x3'));var Redis=require(_0x764d('0x4'));var intUtil=require(_0x764d('0x5'));var config=require('../../../../config/environment');var logger=require(_0x764d('0x6'))(_0x764d('0x7'));config['redis']=_[_0x764d('0x8')](config['redis'],{'host':_0x764d('0x9'),'port':0x18eb});var io=require(_0x764d('0xa'))(new Redis(config['redis']));function emit(_0x3d85b2,_0x2fd2aa,_0x5bf301){io['to'](_0x3d85b2)[_0x764d('0xb')](_0x2fd2aa,_0x5bf301);}function getCustomFields(_0xb00b39,_0x1b4d92){var _0x191324={};if(_0xb00b39[_0x764d('0xc')]>0x0){_['forEach'](_0xb00b39,function(_0x3ab33f){if(_0x3ab33f[_0x764d('0xd')]==='string'&&_0x3ab33f['idField']){_0x191324[_0x3ab33f[_0x764d('0xe')]]=_0x3ab33f[_0x764d('0xf')][_0x764d('0x10')]();}else if(_0x3ab33f[_0x764d('0xd')]===_0x764d('0x11')&&_0x3ab33f['variableName']&&_0x3ab33f[_0x764d('0xe')]&&_0x1b4d92[_0x3ab33f['variableName']]){_0x191324[_0x3ab33f[_0x764d('0xe')]]=_0x1b4d92[_0x3ab33f[_0x764d('0x12')]][_0x764d('0x10')]();}else if(_0x3ab33f[_0x764d('0xd')]===_0x764d('0x13')&&_0x3ab33f['Variable']&&_0x3ab33f['Variable'][_0x764d('0x14')]&&_0x3ab33f[_0x764d('0xe')]&&_0x1b4d92[_0x3ab33f[_0x764d('0x15')][_0x764d('0x14')][_0x764d('0x16')]()]){_0x191324[_0x3ab33f['idField']]=_0x1b4d92[_0x3ab33f[_0x764d('0x15')]['name'][_0x764d('0x16')]()]['toString']();}});}return _0x191324;}function createTicket(_0xff810d,_0x3cad9a,_0x2d1ee0,_0x50eaba,_0x21fd2e,_0x2997ca,_0x2be345){logger[_0x764d('0x17')](_0x764d('0x18'));var _0xcd39a7=_[_0x764d('0x19')]({'parent_id':'','assigned_user_id':_0x3cad9a['id'],'ticketpriorities':_0x764d('0x1a'),'ticketstatus':'Open','ticket_title':intUtil[_0x764d('0x1b')](_0x50eaba[_0x764d('0x1c')],_0x21fd2e,'\x20'),'description':intUtil[_0x764d('0x1b')](_0x50eaba[_0x764d('0x1d')],_0x21fd2e,'\x0a'),'contact_id':_0x2d1ee0['id']},getCustomFields(_0x2997ca,_0x21fd2e));var _0x537f39={'method':_0x764d('0x1e'),'uri':util['format'](_0x764d('0x1f'),_0xff810d['remoteUri']),'form':{'operation':'create','username':_0xff810d[_0x764d('0x20')],'sessionName':_0x2be345[_0x764d('0x21')],'elementType':_0x764d('0x22'),'element':JSON[_0x764d('0x23')](_0xcd39a7)},'json':!![]};return request(_0x537f39)[_0x764d('0x24')](function(_0x2eea74){if(_0x2eea74['success']){return BPromise['resolve']({'id':_0x2eea74[_0x764d('0x25')]['id']});}else{throw new Error(util[_0x764d('0x26')](_0x764d('0x27'),JSON[_0x764d('0x23')](_0x2eea74[_0x764d('0x28')])));}})[_0x764d('0x29')](function(_0x2dcf12){var _0x4f0299=_0x2dcf12[_0x764d('0x2a')]||0x1f4;logger[_0x764d('0x28')](_0x764d('0x2b'),_0x764d('0x2c'),_0x4f0299,JSON[_0x764d('0x23')](_0x2dcf12));});}function getUser(_0x55b05c,_0x1e143e,_0x278c8f){if(intUtil[_0x764d('0x2d')](_0x1e143e)){logger[_0x764d('0x17')](_0x764d('0x2e'),_0x1e143e);return request({'method':_0x764d('0x2f'),'uri':util[_0x764d('0x26')](_0x764d('0x1f'),_0x55b05c[_0x764d('0x30')]),'qs':{'operation':_0x764d('0x31'),'username':_0x55b05c['username'],'sessionName':_0x278c8f[_0x764d('0x21')],'query':util[_0x764d('0x26')](_0x764d('0x32'),_0x1e143e)},'json':!![]})[_0x764d('0x24')](function(_0x37e513){if(_0x37e513[_0x764d('0x33')]&&_0x37e513['result'][_0x764d('0xc')]){logger[_0x764d('0x17')](_0x764d('0x34'));return BPromise['resolve']({'id':_0x37e513['result'][0x0]['id'],'email':_0x37e513[_0x764d('0x25')][0x0][_0x764d('0x35')],'name':_0x37e513[_0x764d('0x25')][0x0][_0x764d('0x36')]+'\x20'+_0x37e513[_0x764d('0x25')][_0x764d('0x37')]});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x764d('0x38')]({'id':_0x278c8f[_0x764d('0x39')],'email':_0x55b05c['username'],'name':_0x764d('0x3a')});}})[_0x764d('0x29')](function(_0x1c89f1){var _0x1afe1d=_0x1c89f1[_0x764d('0x2a')]||0x1f4;logger[_0x764d('0x28')](_0x764d('0x2b'),'getUser',_0x1afe1d,JSON[_0x764d('0x23')](_0x1c89f1));});}else{logger[_0x764d('0x17')](_0x764d('0x3b'));return BPromise[_0x764d('0x38')]({'id':_0x278c8f[_0x764d('0x39')],'email':_0x55b05c['username'],'name':_0x764d('0x3a')})['catch'](function(_0x265819){var _0x4a60d6=_0x265819[_0x764d('0x2a')]||0x1f4;logger['error'](_0x764d('0x2b'),'getUser',_0x4a60d6,JSON[_0x764d('0x23')](_0x265819));});}}function getEndUser(_0x30500c,_0x202004,_0x200ed9,_0x1c0462){logger['info'](_0x764d('0x3c'),_0x200ed9);return request({'method':_0x764d('0x2f'),'uri':util[_0x764d('0x26')](_0x764d('0x1f'),_0x30500c[_0x764d('0x30')]),'qs':{'operation':'query','username':_0x30500c['username'],'sessionName':_0x1c0462[_0x764d('0x21')],'query':util[_0x764d('0x26')](_0x764d('0x3d'),_0x200ed9,_0x200ed9,_0x200ed9,_0x200ed9,_0x200ed9)},'json':!![]})[_0x764d('0x24')](function(_0xefe052){if(_0xefe052[_0x764d('0x33')]&&_0xefe052['result'][_0x764d('0xc')]){logger[_0x764d('0x17')](_0x764d('0x3e'));return BPromise[_0x764d('0x38')]({'id':_0xefe052['result'][0x0]['id'],'name':_0xefe052[_0x764d('0x25')][0x0][_0x764d('0x3f')]+'\x20'+_0xefe052[_0x764d('0x25')][0x0][_0x764d('0x40')],'phone':_0x200ed9});}else{logger[_0x764d('0x17')](_0x764d('0x41'));return request({'method':'POST','uri':util[_0x764d('0x26')]('%s/webservice.php',_0x30500c[_0x764d('0x30')]),'form':{'operation':'create','sessionName':_0x1c0462[_0x764d('0x21')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x202004,'phone':_0x200ed9,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x37866a){logger[_0x764d('0x17')](_0x764d('0x42'));return BPromise['resolve']({'id':_0x37866a[_0x764d('0x25')]['id'],'name':_0x37866a[_0x764d('0x25')][_0x764d('0x40')],'phone':_0x37866a[_0x764d('0x25')][_0x764d('0x43')]});})[_0x764d('0x29')](function(_0x595234){var _0x5c5ee7=_0x595234[_0x764d('0x2a')]||0x1f4;logger[_0x764d('0x28')](_0x764d('0x2b'),_0x764d('0x44'),_0x5c5ee7,JSON[_0x764d('0x23')](_0x595234));});}});}function getConnection(_0x117f6a){var _0x4908c0=_0x117f6a['username'];var _0x1bbd82=_0x117f6a[_0x764d('0x45')];return request({'method':_0x764d('0x2f'),'uri':util[_0x764d('0x26')](_0x764d('0x1f'),_0x117f6a[_0x764d('0x30')]),'qs':{'operation':'getchallenge','username':_0x4908c0},'json':!![]})[_0x764d('0x24')](function(_0x1dd9ec){if(_0x1dd9ec[_0x764d('0x33')]){return request({'method':_0x764d('0x1e'),'uri':util['format'](_0x764d('0x1f'),_0x117f6a['remoteUri']),'form':{'operation':'login','username':_0x4908c0,'accessKey':md5(_0x1dd9ec[_0x764d('0x25')][_0x764d('0x46')]+_0x1bbd82)},'json':!![]});}})[_0x764d('0x24')](function(_0x5a014d){if(_0x5a014d[_0x764d('0x33')]){return BPromise[_0x764d('0x38')](_0x5a014d[_0x764d('0x25')]);}else{throw new Error(util[_0x764d('0x26')](_0x764d('0x47'),_0x117f6a['id']));}})['catch'](function(_0x1092d6){var _0x464ed5=_0x1092d6[_0x764d('0x2a')]||0x1f4;logger[_0x764d('0x28')](_0x764d('0x2b'),_0x764d('0x48'),_0x464ed5,JSON['stringify'](_0x1092d6));});}function request(_0x6f74ce){logger[_0x764d('0x17')](_0x764d('0x49'),JSON['stringify'](_0x6f74ce));return rp(_0x6f74ce);}exports[_0x764d('0x4a')]=function(_0x4230a2,_0x59562a,_0x145dbc,_0x746433,_0x2d5221,_0x12a646){var _0x2ad481,_0x1fee38,_0x503a29,_0x56fcdd;_0x12a646[_0x764d('0x30')]=intUtil[_0x764d('0x4b')](_0x12a646[_0x764d('0x30')]);if(_0x2d5221&&_0x2d5221[_0x764d('0x4c')]){logger[_0x764d('0x17')]('[QUEUE]',_0x764d('0x4d'));_0x59562a[_0x764d('0x4e')]=util[_0x764d('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12a646[_0x764d('0x4f')],_0x59562a['uniqueid'],md5(_0x59562a[_0x764d('0x50')]));}else{_0x59562a['recordingURL']='';}return getConnection(_0x12a646)[_0x764d('0x24')](function(_0x2069a7){_0x56fcdd=_0x2069a7;return getUser(_0x12a646,_0x746433['email'],_0x56fcdd);})[_0x764d('0x24')](function(_0xedebc){_0x2ad481=_0xedebc;logger[_0x764d('0x17')](_0x764d('0x51'),_0x2ad481['id']);return getEndUser(_0x12a646,_0x59562a[_0x764d('0x52')],_0x59562a['calleridnum'],_0x56fcdd);})[_0x764d('0x24')](function(_0x5a7697){_0x1fee38=_0x5a7697;logger[_0x764d('0x17')](_0x764d('0x53'),_0x1fee38['id']);return createTicket(_0x12a646,_0x2ad481,_0x1fee38,_0x145dbc,_0x59562a,_0x145dbc['Fields'],_0x56fcdd);})[_0x764d('0x24')](function(_0x5619cd){_0x503a29=_0x5619cd;logger[_0x764d('0x17')]('Ticket\x20created!');logger['info'](_0x764d('0x54'),_0x503a29['id']);var _0x5705e8=util[_0x764d('0x26')](_0x764d('0x55'),_0x12a646[_0x764d('0x30')],_[_0x764d('0x56')](_0x503a29['id'],'x')[0x1]);logger['info'](_0x764d('0x57'),_0x764d('0x58'));emit(util[_0x764d('0x26')]('user:%s',_0x746433[_0x764d('0x14')]),_0x764d('0x59'),{'uri':_0x5705e8});})['catch'](function(_0x55bc78){logger[_0x764d('0x28')]('[QUEUE]',JSON[_0x764d('0x23')](_0x55bc78));});};exports[_0x764d('0x5a')]=function(_0x407fb9,_0x4feb09,_0xf438fd,_0x386291,_0x490e6d,_0x12d299,_0x2ed112){var _0x33cec9,_0x3e5d98,_0x163aea,_0x1ba884;_0x12d299[_0x764d('0x30')]=intUtil[_0x764d('0x4b')](_0x12d299[_0x764d('0x30')]);_0x12d299['serverUrl']=intUtil['stripTrailingSlash'](_0x12d299[_0x764d('0x4f')]);if(_0x2ed112&&_0x2ed112[_0x764d('0x5b')]&&_0x2ed112[_0x764d('0x5b')]!=='none'){logger['info'](_0x764d('0x5c'),_0x764d('0x4d'));_0x4feb09[_0x764d('0x4e')]=util[_0x764d('0x26')](_0x764d('0x5d'),_0x12d299[_0x764d('0x4f')],_0x4feb09[_0x764d('0x50')],md5(_0x4feb09[_0x764d('0x50')]));}return getConnection(_0x12d299)[_0x764d('0x24')](function(_0x22bce0){_0x1ba884=_0x22bce0;return getUser(_0x12d299,_0x386291[_0x764d('0x5e')],_0x1ba884);})[_0x764d('0x24')](function(_0x14cd48){_0x33cec9=_0x14cd48;logger[_0x764d('0x17')]('The\x20User\x20ID\x20is:',_0x33cec9['id']);return getEndUser(_0x12d299,_0x4feb09[_0x764d('0x5f')],_0x4feb09[_0x764d('0x60')],_0x1ba884);})[_0x764d('0x24')](function(_0x581ae3){_0x3e5d98=_0x581ae3;logger[_0x764d('0x17')](_0x764d('0x53'),_0x3e5d98['id']);return createTicket(_0x12d299,_0x33cec9,_0x3e5d98,_0xf438fd,_0x4feb09,_0xf438fd[_0x764d('0x61')],_0x1ba884);})['then'](function(_0x36dd98){_0x163aea=_0x36dd98;logger[_0x764d('0x17')]('Ticket\x20created!');logger[_0x764d('0x17')]('The\x20Ticket\x20ID\x20is:',_0x163aea['id']);var _0x5b7ad1=util[_0x764d('0x26')](_0x764d('0x55'),_0x12d299['remoteUri'],_['split'](_0x163aea['id'],'x')[0x1]);logger['info'](_0x764d('0x5c'),_0x764d('0x58'));emit(util[_0x764d('0x26')](_0x764d('0x62'),_0x386291['name']),_0x764d('0x59'),{'uri':_0x5b7ad1});})[_0x764d('0x29')](function(_0x5001c9){logger[_0x764d('0x28')]('[OUTBOUND]',JSON[_0x764d('0x23')](_0x5001c9));});};exports[_0x764d('0x63')]=function(_0x5361af,_0x3f0683,_0x2325bf,_0x1a2cc8,_0x27fb7b,_0x3e1271){var _0x2d1a56,_0x306e09,_0x1134c2,_0x44dcfc;_0x3e1271[_0x764d('0x30')]=intUtil[_0x764d('0x4b')](_0x3e1271['remoteUri']);_0x3e1271['serverUrl']=intUtil[_0x764d('0x4b')](_0x3e1271['serverUrl']);if(_0x27fb7b&&_0x27fb7b['monitor_format']){logger[_0x764d('0x17')]('['+_0x3f0683[_0x764d('0x64')][_0x764d('0x65')]()+']',_0x764d('0x4d'));_0x3f0683[_0x764d('0x4e')]=util['format'](_0x764d('0x5d'),_0x3e1271[_0x764d('0x4f')],_0x3f0683[_0x764d('0x50')],md5(_0x3f0683[_0x764d('0x50')]));}else{_0x3f0683[_0x764d('0x4e')]='';}return getConnection(_0x3e1271)['then'](function(_0xc6c75){_0x44dcfc=_0xc6c75;return getUser(_0x3e1271,'',_0x44dcfc);})['then'](function(_0x449015){_0x2d1a56=_0x449015;logger[_0x764d('0x17')](_0x764d('0x51'),_0x2d1a56['id']);return getEndUser(_0x3e1271,_0x3f0683[_0x764d('0x52')],_0x3f0683[_0x764d('0x66')],_0x44dcfc);})['then'](function(_0x3923d3){_0x306e09=_0x3923d3;logger[_0x764d('0x17')](_0x764d('0x53'),_0x306e09['id']);return createTicket(_0x3e1271,_0x2d1a56,_0x306e09,_0x2325bf,_0x3f0683,_0x2325bf[_0x764d('0x61')],_0x44dcfc);})[_0x764d('0x24')](function(_0x177c84){_0x1134c2=_0x177c84;logger[_0x764d('0x17')](_0x764d('0x67'));logger[_0x764d('0x17')](_0x764d('0x54'),_0x1134c2['id']);})[_0x764d('0x29')](function(_0x368673){logger['error']('['+_0x3f0683[_0x764d('0x64')][_0x764d('0x65')]()+']',JSON['stringify'](_0x368673));});}; \ 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 f52755a..c10e933 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 _0x7341=['catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','calleridname','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','Agent\x20found!','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','length','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','stringify','GET','forEach','type','nameField','toLowerCase','content','string','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','queue','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','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','%s/agent/tickets/%s','error'];(function(_0x3c270c,_0x43c16e){var _0x374145=function(_0x25287d){while(--_0x25287d){_0x3c270c['push'](_0x3c270c['shift']());}};_0x374145(++_0x43c16e);}(_0x7341,0xe4));var _0x1734=function(_0x546a71,_0x283a88){_0x546a71=_0x546a71-0x0;var _0x331d01=_0x7341[_0x546a71];return _0x331d01;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1734('0x0'));var util=require('util');var Redis=require(_0x1734('0x1'));var intUtil=require(_0x1734('0x2'));var config=require('../../../../config/environment');var logger=require(_0x1734('0x3'))(_0x1734('0x4'));config[_0x1734('0x5')]=_[_0x1734('0x6')](config[_0x1734('0x5')],{'host':_0x1734('0x7'),'port':0x18eb});var io=require(_0x1734('0x8'))(new Redis(config['redis']));function emit(_0x1ca30b,_0x2c223d,_0x45c529){io['to'](_0x1ca30b)['emit'](_0x2c223d,_0x45c529);}var headers={'Content-Type':_0x1734('0x9'),'Accept':'application/json'};function getTicket(_0x56f0d5,_0x55b846,_0xcf0632,_0x11b325,_0x23d8d2){logger[_0x1734('0xa')](_0x1734('0xb'));return request({'uri':util[_0x1734('0xc')](_0x1734('0xd'),_0x56f0d5[_0x1734('0xe')]),'method':_0x1734('0xf'),'body':{'ticket':_['merge']({'requester_id':_0xcf0632['id'],'submitter_id':_0x55b846?_0x55b846['id']:undefined,'assignee_id':_0x55b846?_0x55b846['id']:undefined,'tags':getTags(_0x11b325[_0x1734('0x10')],_0x1734('0x11')),'subject':intUtil[_0x1734('0x12')](_0x11b325[_0x1734('0x13')],_0x23d8d2,'\x20'),'description':intUtil[_0x1734('0x12')](_0x11b325[_0x1734('0x14')],_0x23d8d2,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1734('0x12')](_0x11b325[_0x1734('0x14')],_0x23d8d2,'\x0a')}},getCustomFields(_0x11b325[_0x1734('0x15')],_0x23d8d2))}})[_0x1734('0x16')](function(_0x444527){logger[_0x1734('0xa')](_0x1734('0x17'));return _0x444527[_0x1734('0x18')];});}function getUser(_0x3989a6,_0x24bbf3){if(intUtil[_0x1734('0x19')](_0x24bbf3)){logger[_0x1734('0xa')](_0x1734('0x1a'),_0x24bbf3);return request({'uri':util['format']('%s/search.json',_0x3989a6[_0x1734('0xe')]),'qs':{'query':util[_0x1734('0xc')]('type:user\x20role:agent\x20email:%s',_0x24bbf3)}})[_0x1734('0x16')](function(_0x58f566){if(_0x58f566['count']){logger['info'](_0x1734('0x1b'));return _['find'](_0x58f566[_0x1734('0x1c')],{'email':_0x24bbf3,'role':_0x1734('0x1d')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x1734('0x1e'),_0x3989a6['remoteUri'])})[_0x1734('0x16')](function(_0x5ad801){logger[_0x1734('0xa')](_0x1734('0x1f'));return _0x5ad801[_0x1734('0x20')];});}});}else{logger[_0x1734('0xa')](_0x1734('0x21'));return request({'uri':util[_0x1734('0xc')](_0x1734('0x1e'),_0x3989a6[_0x1734('0xe')])})[_0x1734('0x16')](function(_0x5c1be3){logger[_0x1734('0xa')]('Admin\x20account\x20selected.');return _0x5c1be3['user'];});}}function getEndUser(_0x7478fd,_0x46b2fa,_0x309d3f){logger[_0x1734('0xa')](_0x1734('0x22'),_0x309d3f);return request({'uri':util[_0x1734('0xc')](_0x1734('0x23'),_0x7478fd[_0x1734('0xe')]),'qs':{'query':util['format'](_0x1734('0x24'),_0x309d3f)}})['then'](function(_0x17e068){var _0x16a35f;if(_0x17e068[_0x1734('0x1c')]['length']){_0x17e068[_0x1734('0x1c')]=_[_0x1734('0x25')](_0x17e068[_0x1734('0x1c')],{'suspended':![],'role':'end-user'});if(_0x17e068[_0x1734('0x1c')][_0x1734('0x26')]){_0x16a35f=_['first'](_0x17e068[_0x1734('0x1c')]);}}if(_0x16a35f){logger[_0x1734('0xa')](_0x1734('0x27'));return _0x16a35f;}else{logger[_0x1734('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1734('0xc')](_0x1734('0x28'),_0x7478fd['remoteUri']),'method':'POST','body':{'user':{'role':_0x1734('0x29'),'name':util[_0x1734('0xc')](_0x1734('0x2a'),_0x46b2fa||_0x309d3f),'phone':_0x309d3f}}})[_0x1734('0x16')](function(_0x2c95d2){logger[_0x1734('0xa')](_0x1734('0x2b'));return _0x2c95d2[_0x1734('0x20')];});}});}function getAuth(_0x1ae386){var _0x2921c8;if(_0x1ae386[_0x1734('0x2c')]===_0x1734('0x2d')){_0x2921c8=util[_0x1734('0xc')](_0x1734('0x2e'),_0x1ae386[_0x1734('0x2f')],_0x1ae386[_0x1734('0x2d')]);}else if(_0x1ae386[_0x1734('0x2c')]==='token'){_0x2921c8=util[_0x1734('0xc')]('%s/token:%s',_0x1ae386[_0x1734('0x2f')],_0x1ae386[_0x1734('0x30')]);}return util[_0x1734('0xc')](_0x1734('0x31'),new Buffer(_0x2921c8)[_0x1734('0x32')](_0x1734('0x33')));}function request(_0x14760f){logger[_0x1734('0x34')]('[HTTP]',JSON[_0x1734('0x35')](_0x14760f));return rp(_[_0x1734('0x6')](_0x14760f,{'method':_0x1734('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x16d081,_0x30817d){var _0x1b7caa=[];if(_0x16d081&&_0x16d081[_0x1734('0x26')]>0x0){_0x1b7caa=_['map'](_0x16d081,_0x30817d);}return _0x1b7caa;}function getCustomFields(_0x1f67b4,_0x44c5cc){var _0x283a8c=[];var _0x3a9bcd={'custom_fields':[]};if(_0x1f67b4[_0x1734('0x26')]>0x0){_[_0x1734('0x37')](_0x1f67b4,function(_0x29590b){if(_0x29590b[_0x1734('0x38')]==='string'&&_0x29590b[_0x1734('0x39')]&&!_0x29590b['customField']){_0x3a9bcd[_0x29590b[_0x1734('0x39')][_0x1734('0x3a')]()]=_0x29590b[_0x1734('0x3b')][_0x1734('0x32')]();}else if(_0x29590b[_0x1734('0x38')]===_0x1734('0x3c')&&_0x29590b[_0x1734('0x3d')]&&_0x29590b[_0x1734('0x3e')]){_0x3a9bcd[_0x1734('0x3f')][_0x1734('0x40')]({'id':_0x29590b[_0x1734('0x3d')],'value':_0x29590b['content'][_0x1734('0x32')]()});}else if(_0x29590b[_0x1734('0x38')]===_0x1734('0x41')&&_0x29590b[_0x1734('0x42')]&&_0x29590b['idField']&&_0x29590b[_0x1734('0x3e')]){_0x44c5cc[_0x29590b['variableName']]&&_0x3a9bcd['custom_fields'][_0x1734('0x40')]({'id':_0x29590b[_0x1734('0x3d')],'value':_0x44c5cc[_0x29590b[_0x1734('0x42')]][_0x1734('0x32')]()});}else if(_0x29590b['type']===_0x1734('0x43')&&_0x29590b[_0x1734('0x44')]&&_0x29590b['Variable'][_0x1734('0x11')]&&_0x29590b[_0x1734('0x3d')]&&_0x29590b['customField']){_0x44c5cc[_0x29590b[_0x1734('0x44')]['name'][_0x1734('0x3a')]()]&&_0x3a9bcd[_0x1734('0x3f')][_0x1734('0x40')]({'id':_0x29590b[_0x1734('0x3d')],'value':_0x44c5cc[_0x29590b[_0x1734('0x44')][_0x1734('0x11')][_0x1734('0x3a')]()]['toString']()});}});}return _0x3a9bcd;}exports[_0x1734('0x45')]=function(_0xbf1023,_0x4f6d90,_0x23537e,_0x9e37e5,_0x1ebfec,_0x3b300b){var _0x57bf4b,_0x6f821f;_0x3b300b[_0x1734('0xe')]=intUtil[_0x1734('0x46')](_0x3b300b['remoteUri']);_0x3b300b[_0x1734('0x47')]=intUtil[_0x1734('0x46')](_0x3b300b[_0x1734('0x47')]);if(_0x1ebfec&&_0x1ebfec[_0x1734('0x48')]){logger[_0x1734('0xa')](_0x1734('0x49'),_0x1734('0x4a'));_0x4f6d90[_0x1734('0x4b')]=util[_0x1734('0xc')](_0x1734('0x4c'),_0x3b300b[_0x1734('0x47')],_0x4f6d90[_0x1734('0x4d')],md5(_0x4f6d90[_0x1734('0x4d')]));}else{_0x4f6d90[_0x1734('0x4b')]='';}headers[_0x1734('0x4e')]=getAuth(_0x3b300b);return getUser(_0x3b300b,_0x9e37e5[_0x1734('0x4f')])[_0x1734('0x16')](function(_0x1b4ea1){_0x57bf4b=_0x1b4ea1;logger['info'](_0x1734('0x50'),_0x57bf4b['id']);return getEndUser(_0x3b300b,_0x4f6d90['calleridname'],_0x4f6d90[_0x1734('0x51')]);})[_0x1734('0x16')](function(_0x95d24f){_0x6f821f=_0x95d24f;logger[_0x1734('0xa')]('The\x20Enduser\x20ID\x20is:',_0x6f821f['id']);return getTicket(_0x3b300b,_0x57bf4b,_0x6f821f,_0x23537e,_0x4f6d90);})['then'](function(_0x294097){if(_0x294097){logger[_0x1734('0xa')]('The\x20Ticket\x20ID\x20is:',_0x294097['id']);switch(_0x3b300b[_0x1734('0x38')]){case _0x1734('0x52'):logger[_0x1734('0xa')](_0x1734('0x49'),_0x1734('0x53'));return request({'uri':util[_0x1734('0xc')](_0x1734('0x54'),_0x3b300b['remoteUri'],_0x57bf4b['id'],_0x294097['id']),'method':_0x1734('0xf')});case _0x1734('0x55'):logger[_0x1734('0xa')]('[QUEUE]',_0x1734('0x56'));emit(util[_0x1734('0xc')](_0x1734('0x57'),_0x9e37e5[_0x1734('0x11')]),'trigger:browser:url',{'uri':util[_0x1734('0xc')](_0x1734('0x58'),_0x3b300b[_0x1734('0xe')],_0x294097['id'])});break;default:logger[_0x1734('0x59')](_0x1734('0x49'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x1734('0x5a')](function(_0x480a5a){logger['error'](_0x1734('0x5b'),util[_0x1734('0x5c')](_0x480a5a,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4ff6a9,_0x36492b,_0x30bc47,_0x553fc0,_0x515e39,_0x4fb75c,_0x28510e){var _0x6fbdf0,_0x881d5a;_0x4fb75c[_0x1734('0xe')]=intUtil['stripTrailingSlash'](_0x4fb75c['remoteUri']);_0x4fb75c[_0x1734('0x47')]=intUtil[_0x1734('0x46')](_0x4fb75c['serverUrl']);if(_0x28510e&&_0x28510e[_0x1734('0x5d')]&&_0x28510e[_0x1734('0x5d')]!==_0x1734('0x5e')){logger['info'](_0x1734('0x5f'),_0x1734('0x4a'));_0x36492b[_0x1734('0x4b')]=util[_0x1734('0xc')](_0x1734('0x4c'),_0x4fb75c[_0x1734('0x47')],_0x36492b[_0x1734('0x4d')],md5(_0x36492b[_0x1734('0x4d')]));}headers[_0x1734('0x4e')]=getAuth(_0x4fb75c);return getUser(_0x4fb75c,_0x553fc0['email'])[_0x1734('0x16')](function(_0x25f886){_0x6fbdf0=_0x25f886;logger[_0x1734('0xa')](_0x1734('0x50'),_0x6fbdf0['id']);return getEndUser(_0x4fb75c,_0x36492b[_0x1734('0x60')],_0x36492b[_0x1734('0x61')]);})[_0x1734('0x16')](function(_0x30848e){_0x881d5a=_0x30848e;logger[_0x1734('0xa')](_0x1734('0x62'),_0x881d5a['id']);return getTicket(_0x4fb75c,_0x6fbdf0,_0x881d5a,_0x30bc47,_0x36492b);})[_0x1734('0x16')](function(_0x568861){if(_0x568861){logger[_0x1734('0xa')](_0x1734('0x63'),_0x568861['id']);switch(_0x4fb75c[_0x1734('0x38')]){case _0x1734('0x52'):logger[_0x1734('0xa')](_0x1734('0x5f'),_0x1734('0x53'));return request({'uri':util['format'](_0x1734('0x54'),_0x4fb75c['remoteUri'],_0x6fbdf0['id'],_0x568861['id']),'method':_0x1734('0xf')});case _0x1734('0x55'):logger[_0x1734('0xa')](_0x1734('0x5f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1734('0x57'),_0x553fc0['name']),_0x1734('0x64'),{'uri':util[_0x1734('0xc')](_0x1734('0x58'),_0x4fb75c[_0x1734('0xe')],_0x568861['id'])});break;default:logger['error']('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x1734('0x5a')](function(_0x314023){logger[_0x1734('0x59')](_0x1734('0x65'),util[_0x1734('0x5c')](_0x314023,{'showHidden':!![],'depth':null}));});};exports[_0x1734('0x66')]=function(_0x17c177,_0x2d3a75,_0x5a02cc,_0x37d04f,_0x4fd501,_0x5dc7ba){var _0x319918,_0x476f8e;_0x5dc7ba[_0x1734('0xe')]=intUtil['stripTrailingSlash'](_0x5dc7ba[_0x1734('0xe')]);_0x5dc7ba[_0x1734('0x47')]=intUtil['stripTrailingSlash'](_0x5dc7ba[_0x1734('0x47')]);if(_0x4fd501&&_0x4fd501[_0x1734('0x48')]){logger[_0x1734('0xa')]('['+_0x2d3a75[_0x1734('0x67')][_0x1734('0x68')]()+']','Recording\x20is\x20enabled!');_0x2d3a75['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5dc7ba[_0x1734('0x47')],_0x2d3a75['uniqueid'],md5(_0x2d3a75[_0x1734('0x4d')]));}else{_0x2d3a75[_0x1734('0x4b')]='';}headers[_0x1734('0x4e')]=getAuth(_0x5dc7ba);return getUser(_0x5dc7ba)[_0x1734('0x16')](function(_0x18509a){_0x319918=_0x18509a;logger[_0x1734('0xa')](_0x1734('0x50'),_0x319918['id']);return getEndUser(_0x5dc7ba,_0x2d3a75[_0x1734('0x69')],_0x2d3a75['calleridnum']);})[_0x1734('0x16')](function(_0x589fcb){_0x476f8e=_0x589fcb;logger[_0x1734('0xa')](_0x1734('0x62'),_0x476f8e['id']);return getTicket(_0x5dc7ba,_0x319918,_0x476f8e,_0x5a02cc,_0x2d3a75);})['then'](function(_0x6cafb4){if(_0x6cafb4){logger[_0x1734('0xa')]('The\x20Ticket\x20ID\x20is:',_0x6cafb4['id']);}})['catch'](function(_0x616d03){logger[_0x1734('0x59')]('['+_0x2d3a75[_0x1734('0x67')][_0x1734('0x68')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x1734('0x5c')](_0x616d03,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x765e=['Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','map','type','string','toLowerCase','toString','idField','custom_fields','push','content','variable','variableName','customField','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','merge','Tags','name','getString','Subjects'];(function(_0x3af769,_0x58160b){var _0x31aa07=function(_0x627b69){while(--_0x627b69){_0x3af769['push'](_0x3af769['shift']());}};_0x31aa07(++_0x58160b);}(_0x765e,0x131));var _0xe765=function(_0x59088f,_0x369f6e){_0x59088f=_0x59088f-0x0;var _0x4d7f9c=_0x765e[_0x59088f];return _0x4d7f9c;};'use strict';var _=require(_0xe765('0x0'));var rp=require(_0xe765('0x1'));var md5=require(_0xe765('0x2'));var util=require(_0xe765('0x3'));var Redis=require(_0xe765('0x4'));var intUtil=require(_0xe765('0x5'));var config=require(_0xe765('0x6'));var logger=require(_0xe765('0x7'))(_0xe765('0x8'));config[_0xe765('0x9')]=_[_0xe765('0xa')](config[_0xe765('0x9')],{'host':_0xe765('0xb'),'port':0x18eb});var io=require(_0xe765('0xc'))(new Redis(config[_0xe765('0x9')]));function emit(_0x504542,_0x35d891,_0x28e955){io['to'](_0x504542)[_0xe765('0xd')](_0x35d891,_0x28e955);}var headers={'Content-Type':_0xe765('0xe'),'Accept':_0xe765('0xe')};function getTicket(_0x41801f,_0x89a285,_0x53b110,_0x42953c,_0x37db1b){logger[_0xe765('0xf')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xe765('0x10')]('%s/tickets.json',_0x41801f['remoteUri']),'method':'POST','body':{'ticket':_[_0xe765('0x11')]({'requester_id':_0x53b110['id'],'submitter_id':_0x89a285?_0x89a285['id']:undefined,'assignee_id':_0x89a285?_0x89a285['id']:undefined,'tags':getTags(_0x42953c[_0xe765('0x12')],_0xe765('0x13')),'subject':intUtil[_0xe765('0x14')](_0x42953c[_0xe765('0x15')],_0x37db1b,'\x20'),'description':intUtil['getString'](_0x42953c[_0xe765('0x16')],_0x37db1b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe765('0x14')](_0x42953c[_0xe765('0x16')],_0x37db1b,'\x0a')}},getCustomFields(_0x42953c[_0xe765('0x17')],_0x37db1b))}})[_0xe765('0x18')](function(_0x5b9436){logger['info'](_0xe765('0x19'));return _0x5b9436[_0xe765('0x1a')];});}function getUser(_0x3c887b,_0x4856fe){if(intUtil[_0xe765('0x1b')](_0x4856fe)){logger[_0xe765('0xf')](_0xe765('0x1c'),_0x4856fe);return request({'uri':util[_0xe765('0x10')](_0xe765('0x1d'),_0x3c887b[_0xe765('0x1e')]),'qs':{'query':util[_0xe765('0x10')](_0xe765('0x1f'),_0x4856fe)}})[_0xe765('0x18')](function(_0x57fb61){if(_0x57fb61[_0xe765('0x20')]){logger['info'](_0xe765('0x21'));return _[_0xe765('0x22')](_0x57fb61['results'],{'email':_0x4856fe,'role':_0xe765('0x23')});}else{logger['info'](_0xe765('0x24'));return request({'uri':util[_0xe765('0x10')](_0xe765('0x25'),_0x3c887b['remoteUri'])})['then'](function(_0x4b789b){logger[_0xe765('0xf')](_0xe765('0x26'));return _0x4b789b[_0xe765('0x27')];});}});}else{logger[_0xe765('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe765('0x25'),_0x3c887b[_0xe765('0x1e')])})[_0xe765('0x18')](function(_0x18ddd4){logger[_0xe765('0xf')]('Admin\x20account\x20selected.');return _0x18ddd4[_0xe765('0x27')];});}}function getEndUser(_0x5464b4,_0x2b1f66,_0xff097f){logger[_0xe765('0xf')](_0xe765('0x28'),_0xff097f);return request({'uri':util[_0xe765('0x10')](_0xe765('0x1d'),_0x5464b4[_0xe765('0x1e')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0xff097f)}})[_0xe765('0x18')](function(_0x4bc5c1){var _0xf19724;if(_0x4bc5c1[_0xe765('0x29')][_0xe765('0x2a')]){_0x4bc5c1[_0xe765('0x29')]=_[_0xe765('0x2b')](_0x4bc5c1['results'],{'suspended':![],'role':_0xe765('0x2c')});if(_0x4bc5c1[_0xe765('0x29')][_0xe765('0x2a')]){_0xf19724=_['first'](_0x4bc5c1['results']);}}if(_0xf19724){logger[_0xe765('0xf')]('Enduser\x20found!');return _0xf19724;}else{logger[_0xe765('0xf')](_0xe765('0x2d'));return request({'uri':util[_0xe765('0x10')](_0xe765('0x2e'),_0x5464b4[_0xe765('0x1e')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0xe765('0x10')](_0xe765('0x2f'),_0x2b1f66||_0xff097f),'phone':_0xff097f}}})[_0xe765('0x18')](function(_0x368365){logger[_0xe765('0xf')]('Enduser\x20created.');return _0x368365['user'];});}});}function getAuth(_0x2a1046){var _0x5bdd4b;if(_0x2a1046[_0xe765('0x30')]===_0xe765('0x31')){_0x5bdd4b=util[_0xe765('0x10')](_0xe765('0x32'),_0x2a1046[_0xe765('0x33')],_0x2a1046[_0xe765('0x31')]);}else if(_0x2a1046[_0xe765('0x30')]==='token'){_0x5bdd4b=util['format']('%s/token:%s',_0x2a1046[_0xe765('0x33')],_0x2a1046[_0xe765('0x34')]);}return util[_0xe765('0x10')](_0xe765('0x35'),new Buffer(_0x5bdd4b)['toString'](_0xe765('0x36')));}function request(_0xa86090){logger[_0xe765('0x37')](_0xe765('0x38'),JSON['stringify'](_0xa86090));return rp(_[_0xe765('0xa')](_0xa86090,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x1e084c,_0x227f4a){var _0xe2beaf=[];if(_0x1e084c&&_0x1e084c[_0xe765('0x2a')]>0x0){_0xe2beaf=_[_0xe765('0x39')](_0x1e084c,_0x227f4a);}return _0xe2beaf;}function getCustomFields(_0x18bd22,_0xcc4e48){var _0x1be1fc=[];var _0xc6618c={'custom_fields':[]};if(_0x18bd22[_0xe765('0x2a')]>0x0){_['forEach'](_0x18bd22,function(_0x1f7da2){if(_0x1f7da2[_0xe765('0x3a')]===_0xe765('0x3b')&&_0x1f7da2['nameField']&&!_0x1f7da2['customField']){_0xc6618c[_0x1f7da2['nameField'][_0xe765('0x3c')]()]=_0x1f7da2['content'][_0xe765('0x3d')]();}else if(_0x1f7da2[_0xe765('0x3a')]===_0xe765('0x3b')&&_0x1f7da2[_0xe765('0x3e')]&&_0x1f7da2['customField']){_0xc6618c[_0xe765('0x3f')][_0xe765('0x40')]({'id':_0x1f7da2[_0xe765('0x3e')],'value':_0x1f7da2[_0xe765('0x41')][_0xe765('0x3d')]()});}else if(_0x1f7da2[_0xe765('0x3a')]===_0xe765('0x42')&&_0x1f7da2[_0xe765('0x43')]&&_0x1f7da2[_0xe765('0x3e')]&&_0x1f7da2[_0xe765('0x44')]){_0xcc4e48[_0x1f7da2['variableName']]&&_0xc6618c[_0xe765('0x3f')]['push']({'id':_0x1f7da2[_0xe765('0x3e')],'value':_0xcc4e48[_0x1f7da2[_0xe765('0x43')]]['toString']()});}else if(_0x1f7da2[_0xe765('0x3a')]==='customVariable'&&_0x1f7da2['Variable']&&_0x1f7da2['Variable'][_0xe765('0x13')]&&_0x1f7da2[_0xe765('0x3e')]&&_0x1f7da2[_0xe765('0x44')]){_0xcc4e48[_0x1f7da2['Variable'][_0xe765('0x13')][_0xe765('0x3c')]()]&&_0xc6618c[_0xe765('0x3f')][_0xe765('0x40')]({'id':_0x1f7da2[_0xe765('0x3e')],'value':_0xcc4e48[_0x1f7da2[_0xe765('0x45')][_0xe765('0x13')][_0xe765('0x3c')]()][_0xe765('0x3d')]()});}});}return _0xc6618c;}exports['queue']=function(_0x374a32,_0x5d0a15,_0x57405f,_0x33eac6,_0x4d4d13,_0x1b9580){var _0xc3ed99,_0x1707aa;_0x1b9580['remoteUri']=intUtil[_0xe765('0x46')](_0x1b9580['remoteUri']);_0x1b9580[_0xe765('0x47')]=intUtil[_0xe765('0x46')](_0x1b9580[_0xe765('0x47')]);if(_0x4d4d13&&_0x4d4d13['monitor_format']){logger[_0xe765('0xf')](_0xe765('0x48'),_0xe765('0x49'));_0x5d0a15[_0xe765('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b9580['serverUrl'],_0x5d0a15[_0xe765('0x4b')],md5(_0x5d0a15[_0xe765('0x4b')]));}else{_0x5d0a15[_0xe765('0x4a')]='';}headers['Authorization']=getAuth(_0x1b9580);return getUser(_0x1b9580,_0x33eac6[_0xe765('0x4c')])['then'](function(_0x10fb48){_0xc3ed99=_0x10fb48;logger[_0xe765('0xf')](_0xe765('0x4d'),_0xc3ed99['id']);return getEndUser(_0x1b9580,_0x5d0a15[_0xe765('0x4e')],_0x5d0a15[_0xe765('0x4f')]);})[_0xe765('0x18')](function(_0x4a7c2a){_0x1707aa=_0x4a7c2a;logger[_0xe765('0xf')](_0xe765('0x50'),_0x1707aa['id']);return getTicket(_0x1b9580,_0xc3ed99,_0x1707aa,_0x57405f,_0x5d0a15);})[_0xe765('0x18')](function(_0x1214a8){if(_0x1214a8){logger[_0xe765('0xf')](_0xe765('0x51'),_0x1214a8['id']);switch(_0x1b9580['type']){case'integrationTab':logger[_0xe765('0xf')](_0xe765('0x48'),_0xe765('0x52'));return request({'uri':util['format'](_0xe765('0x53'),_0x1b9580[_0xe765('0x1e')],_0xc3ed99['id'],_0x1214a8['id']),'method':_0xe765('0x54')});case _0xe765('0x55'):logger[_0xe765('0xf')](_0xe765('0x48'),_0xe765('0x56'));emit(util[_0xe765('0x10')]('user:%s',_0x33eac6['name']),_0xe765('0x57'),{'uri':util['format'](_0xe765('0x58'),_0x1b9580[_0xe765('0x1e')],_0x1214a8['id'])});break;default:logger[_0xe765('0x59')]('[QUEUE]',_0xe765('0x5a'));}}})[_0xe765('0x5b')](function(_0x5dd192){logger[_0xe765('0x59')](_0xe765('0x5c'),util[_0xe765('0x5d')](_0x5dd192,{'showHidden':!![],'depth':null}));});};exports[_0xe765('0x5e')]=function(_0xabbaa1,_0x1de0af,_0x3fa5df,_0x361e36,_0x45be53,_0x1f6da3,_0x2e122d){var _0x2763f7,_0x333929;_0x1f6da3['remoteUri']=intUtil[_0xe765('0x46')](_0x1f6da3[_0xe765('0x1e')]);_0x1f6da3[_0xe765('0x47')]=intUtil[_0xe765('0x46')](_0x1f6da3[_0xe765('0x47')]);if(_0x2e122d&&_0x2e122d[_0xe765('0x5f')]&&_0x2e122d[_0xe765('0x5f')]!==_0xe765('0x60')){logger[_0xe765('0xf')]('[OUTBOUND]',_0xe765('0x49'));_0x1de0af['recordingURL']=util[_0xe765('0x10')](_0xe765('0x61'),_0x1f6da3['serverUrl'],_0x1de0af[_0xe765('0x4b')],md5(_0x1de0af[_0xe765('0x4b')]));}headers[_0xe765('0x62')]=getAuth(_0x1f6da3);return getUser(_0x1f6da3,_0x361e36[_0xe765('0x4c')])[_0xe765('0x18')](function(_0x1c2d34){_0x2763f7=_0x1c2d34;logger[_0xe765('0xf')]('The\x20User\x20ID\x20is:',_0x2763f7['id']);return getEndUser(_0x1f6da3,_0x1de0af[_0xe765('0x63')],_0x1de0af[_0xe765('0x64')]);})['then'](function(_0x413849){_0x333929=_0x413849;logger[_0xe765('0xf')](_0xe765('0x50'),_0x333929['id']);return getTicket(_0x1f6da3,_0x2763f7,_0x333929,_0x3fa5df,_0x1de0af);})['then'](function(_0x4e3e9a){if(_0x4e3e9a){logger[_0xe765('0xf')](_0xe765('0x51'),_0x4e3e9a['id']);switch(_0x1f6da3['type']){case'integrationTab':logger['info'](_0xe765('0x65'),_0xe765('0x52'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1f6da3[_0xe765('0x1e')],_0x2763f7['id'],_0x4e3e9a['id']),'method':'POST'});case _0xe765('0x55'):logger[_0xe765('0xf')](_0xe765('0x65'),_0xe765('0x56'));emit(util[_0xe765('0x10')](_0xe765('0x66'),_0x361e36[_0xe765('0x13')]),_0xe765('0x57'),{'uri':util[_0xe765('0x10')](_0xe765('0x58'),_0x1f6da3[_0xe765('0x1e')],_0x4e3e9a['id'])});break;default:logger['error'](_0xe765('0x65'),_0xe765('0x5a'));}}})[_0xe765('0x5b')](function(_0x2b30cd){logger['error'](_0xe765('0x67'),util[_0xe765('0x5d')](_0x2b30cd,{'showHidden':!![],'depth':null}));});};exports[_0xe765('0x68')]=function(_0x4c5d81,_0x20ad2a,_0x4a9673,_0x46f77b,_0x129468,_0x349c56){var _0x41a96d,_0x394aea;_0x349c56[_0xe765('0x1e')]=intUtil[_0xe765('0x46')](_0x349c56[_0xe765('0x1e')]);_0x349c56[_0xe765('0x47')]=intUtil[_0xe765('0x46')](_0x349c56['serverUrl']);if(_0x129468&&_0x129468[_0xe765('0x69')]){logger[_0xe765('0xf')]('['+_0x20ad2a['lastevent'][_0xe765('0x6a')]()+']',_0xe765('0x49'));_0x20ad2a[_0xe765('0x4a')]=util[_0xe765('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x349c56[_0xe765('0x47')],_0x20ad2a[_0xe765('0x4b')],md5(_0x20ad2a[_0xe765('0x4b')]));}else{_0x20ad2a[_0xe765('0x4a')]='';}headers[_0xe765('0x62')]=getAuth(_0x349c56);return getUser(_0x349c56)[_0xe765('0x18')](function(_0x77e081){_0x41a96d=_0x77e081;logger[_0xe765('0xf')]('The\x20User\x20ID\x20is:',_0x41a96d['id']);return getEndUser(_0x349c56,_0x20ad2a['calleridname'],_0x20ad2a[_0xe765('0x4f')]);})[_0xe765('0x18')](function(_0x529aaf){_0x394aea=_0x529aaf;logger[_0xe765('0xf')](_0xe765('0x50'),_0x394aea['id']);return getTicket(_0x349c56,_0x41a96d,_0x394aea,_0x4a9673,_0x20ad2a);})[_0xe765('0x18')](function(_0x4cd09a){if(_0x4cd09a){logger[_0xe765('0xf')](_0xe765('0x51'),_0x4cd09a['id']);}})[_0xe765('0x5b')](function(_0x9dfef3){logger[_0xe765('0x59')]('['+_0x20ad2a[_0xe765('0x6b')][_0xe765('0x6a')]()+']'+_0xe765('0x6c'),util[_0xe765('0x5d')](_0x9dfef3,{'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 1ecd189..52a9427 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 _0xfff0=['none','zoho.eu','Outbound','[OUTBOUND]','user:%s','https://crm.','toUpperCase','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/logger','zoho','defaults','redis','localhost','emit','[HTTP]','stringify','length','forEach','type','string','idField','content','variable','variableName','Variable','name','toLowerCase','toString','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.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','startCase','moduleCreate','role','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','first_name','Subject','getString','Subjects','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','connect','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','merge','Fields','Call\x20created!','stack','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','recordingFormat'];(function(_0x3962bf,_0x64c428){var _0x33f85d=function(_0x518abc){while(--_0x518abc){_0x3962bf['push'](_0x3962bf['shift']());}};_0x33f85d(++_0x64c428);}(_0xfff0,0x139));var _0x0fff=function(_0x180123,_0x2854d2){_0x180123=_0x180123-0x0;var _0x37542b=_0xfff0[_0x180123];return _0x37542b;};'use strict';var _=require('lodash');var rp=require(_0x0fff('0x0'));var md5=require(_0x0fff('0x1'));var util=require(_0x0fff('0x2'));var intUtil=require('./util');var moment=require(_0x0fff('0x3'));var Redis=require(_0x0fff('0x4'));var BPromise=require(_0x0fff('0x5'));var config=require('../../../../config/environment');var logger=require(_0x0fff('0x6'))(_0x0fff('0x7'));config['redis']=_[_0x0fff('0x8')](config[_0x0fff('0x9')],{'host':_0x0fff('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0fff('0x9')]));function emit(_0x5e9672,_0x1f2658,_0x5304a5){io['to'](_0x5e9672)[_0x0fff('0xb')](_0x1f2658,_0x5304a5);}function request(_0x3db6f6){logger['debug'](_0x0fff('0xc'),JSON[_0x0fff('0xd')](_0x3db6f6));return rp(_0x3db6f6);}function getCustomFields(_0x1de923,_0x289e01){var _0x209b6d={};if(_0x1de923[_0x0fff('0xe')]>0x0){_[_0x0fff('0xf')](_0x1de923,function(_0x288aee){if(_0x288aee[_0x0fff('0x10')]===_0x0fff('0x11')&&_0x288aee[_0x0fff('0x12')]){_0x209b6d[_0x288aee['idField']]=_0x288aee[_0x0fff('0x13')]['toString']();}else if(_0x288aee[_0x0fff('0x10')]===_0x0fff('0x14')&&_0x288aee[_0x0fff('0x15')]&&_0x288aee[_0x0fff('0x12')]&&_0x289e01[_0x288aee['variableName']]){_0x209b6d[_0x288aee['idField']]=_0x289e01[_0x288aee[_0x0fff('0x15')]]['toString']();}else if(_0x288aee['type']==='customVariable'&&_0x288aee[_0x0fff('0x16')]&&_0x288aee[_0x0fff('0x16')]['name']&&_0x288aee[_0x0fff('0x12')]&&_0x289e01[_0x288aee[_0x0fff('0x16')]['name']['toLowerCase']()]){_0x209b6d[_0x288aee['idField']]=_0x289e01[_0x288aee[_0x0fff('0x16')][_0x0fff('0x17')][_0x0fff('0x18')]()][_0x0fff('0x19')]();}});}return _0x209b6d;}function getName(_0x253de9){if(_0x253de9[_0x0fff('0x1a')]('\x20')>0x0){var _0x4c88ae=_0x253de9[_0x0fff('0x1b')](/ (.+)/);if(_0x4c88ae[0x1]){return _0x4c88ae;}}return[_0x253de9,_0x253de9];}var accountsTokens={};function getAccessToken(_0x136520){return new Promise(function(_0x48e6f9,_0x49d211){if(!_['isNil'](accountsTokens[_0x136520['id']])&&!_[_0x0fff('0x1c')](accountsTokens[_0x136520['id']][_0x0fff('0x1d')])){if(moment()[_0x0fff('0x1e')](accountsTokens[_0x136520['id']][_0x0fff('0x1f')])){_0x48e6f9(accountsTokens[_0x136520['id']]['access_token']);}}var _0x155132;switch(_0x136520[_0x0fff('0x20')]){case'US':_0x155132=_0x0fff('0x21');break;case'AU':_0x155132=_0x0fff('0x22');break;case'EU':_0x155132=_0x0fff('0x23');break;case'IN':_0x155132=_0x0fff('0x24');break;case'CN':_0x155132='https://accounts.zoho.com.cn';break;default:_0x155132=_0x0fff('0x23');break;}var _0x29f702={'method':_0x0fff('0x25'),'uri':_0x155132+_0x0fff('0x26'),'qs':{'refresh_token':_0x136520[_0x0fff('0x27')],'client_id':_0x136520[_0x0fff('0x28')],'client_secret':_0x136520['clientSecret'],'grant_type':_0x0fff('0x29')},'json':!![]};return rp(_0x29f702)[_0x0fff('0x2a')](function(_0x2d1610){accountsTokens[_0x136520['id']]={'access_token':_0x2d1610[_0x0fff('0x1d')],'expires_in':moment()[_0x0fff('0x2b')](_0x2d1610[_0x0fff('0x1f')],_0x0fff('0x2c'))};_0x48e6f9(_0x2d1610[_0x0fff('0x1d')]);})[_0x0fff('0x2d')](function(_0xc32a61){logger[_0x0fff('0x2e')](_0x0fff('0x2f'),_0xc32a61['stack']);_0x49d211(_0xc32a61);});});}function getUser(_0x7046a3,_0x2d1800,_0x17ab6f,_0x42441e){logger[_0x0fff('0x30')](_0x0fff('0x31'));return request({'method':'GET','uri':util[_0x0fff('0x32')](_0x0fff('0x33'),_0x2d1800),'qs':{'type':_0x0fff('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x7046a3},'json':!![]})[_0x0fff('0x2a')](function(_0x3fa6fc){if(_0x3fa6fc['users']){var _0x3daf51=-0x1;if(_[_0x0fff('0x35')](_0x3fa6fc[_0x0fff('0x36')])){if(!_[_0x0fff('0x1c')](_0x42441e)){_0x3daf51=_[_0x0fff('0x37')](_0x3fa6fc[_0x0fff('0x36')],function(_0x1da352){return _0x1da352[_0x0fff('0x38')]===_0x42441e;});}if(_0x3daf51>=0x0){logger[_0x0fff('0x30')](_0x0fff('0x39'));}else{logger['info'](_0x0fff('0x3a'));_0x3daf51=_[_0x0fff('0x37')](_0x3fa6fc[_0x0fff('0x36')],function(_0x1bbb9e){return _0x1bbb9e[_0x0fff('0x3b')]['name']==='Administrator';});}return _0x3fa6fc[_0x0fff('0x36')][_0x3daf51];}else{if(_0x3fa6fc[_0x0fff('0x3c')][_0x0fff('0x3b')][_0x0fff('0x17')]==='Administrator'){logger[_0x0fff('0x30')](_0x0fff('0x3a'));user=_0x3fa6fc[_0x0fff('0x3c')];return user;}else{logger[_0x0fff('0x2e')]('The\x20failing\x20result\x20is',JSON[_0x0fff('0xd')](_0x3fa6fc));throw new Error(_0x0fff('0x3d')+JSON[_0x0fff('0xd')](_0x3fa6fc));}}}else{logger[_0x0fff('0x2e')](_0x0fff('0x3e'),JSON[_0x0fff('0xd')](_0x3fa6fc));throw new Error(_0x0fff('0x3d')+JSON[_0x0fff('0xd')](_0x3fa6fc));}})[_0x0fff('0x2d')](function(_0x388193){console[_0x0fff('0x2e')](_0x388193);});}function getZohoUser(_0xeea9a7,_0x53a026){return new BPromise(function(_0x114e9a,_0xe6bdb0){request(_0xeea9a7)[_0x0fff('0x2a')](function(_0x312b0d){var _0xd65638=null;if(_0x312b0d){_0xd65638=_0x312b0d[_0x0fff('0x3f')][0x0];_0xd65638['enduserType']=_0x53a026;}_0x114e9a(_0xd65638);})[_0x0fff('0x2d')](function(_0x44e547){_0xe6bdb0(_0x44e547);});});}function createEndUser(_0x8e13e7,_0x6d47f9,_0x1e7128,_0x101151,_0x3dc0b8,_0x425ec1){var _0x1e7128=getName(_0x1e7128);return request({'method':'POST','uri':_0x0fff('0x40')+_0x6d47f9+'/crm/v2/'+_[_0x0fff('0x41')](_0x425ec1[_0x0fff('0x42')])+'s','body':{'data':[{'Last_Name':_0x1e7128[0x1],'First_Name':_0x1e7128[0x0],'Phone':_0x101151,'Owner':{'name':!_[_0x0fff('0x1c')](_0x3dc0b8['role']['name'])?_0x3dc0b8[_0x0fff('0x43')][_0x0fff('0x17')]:!_[_0x0fff('0x1c')](_0x3dc0b8['first_name'])?_0x3dc0b8['first_name']+'\x20'+_0x3dc0b8[_0x0fff('0x44')]:_0x3dc0b8['last_name'],'id':_0x3dc0b8['id']}}]},'headers':{'Authorization':_0x0fff('0x45')+_0x8e13e7},'json':!![]})[_0x0fff('0x2a')](function(_0x8352c1){if(_0x8352c1&&_0x8352c1[_0x0fff('0x3f')][0x0][_0x0fff('0x46')]===_0x0fff('0x47')){var _0x543bcb=_0x8352c1[_0x0fff('0x3f')][0x0][_0x0fff('0x48')];_0x543bcb[_0x0fff('0x49')]=_[_0x0fff('0x41')](_0x425ec1[_0x0fff('0x42')])+'s';return _0x543bcb;}logger[_0x0fff('0x2e')](_0x0fff('0x3e'),JSON['stringify'](data));throw new Error(_0x0fff('0x4a')+JSON[_0x0fff('0xd')](data));})[_0x0fff('0x2d')](function(_0x56a121){console[_0x0fff('0x4b')](_0x0fff('0x4c'),_0x56a121);});}function getEndUser(_0x227b9a,_0x1fbbbf,_0x3c5cc0,_0x451b47,_0x2f73cf,_0x2059f2,_0x29b210){var _0x1ab27d={'method':_0x0fff('0x4d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x227b9a},'json':!![]};switch(_0x29b210[_0x0fff('0x4e')]){case _0x0fff('0x4f'):_0x1ab27d['uri']=_0x0fff('0x40')+_0x1fbbbf+_0x0fff('0x50')+_0x2f73cf+'))';return getZohoUser(_0x1ab27d,_0x0fff('0x51'))['then'](function(_0x502037){if(_0x502037)return _0x502037;_0x1ab27d[_0x0fff('0x52')]='https://www.zohoapis.'+_0x1fbbbf+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2f73cf+'))';return getZohoUser(_0x1ab27d,_0x0fff('0x53'))[_0x0fff('0x2a')](function(_0x29524d){if(_0x29524d)return _0x29524d;if(_0x29b210[_0x0fff('0x42')]!=_0x0fff('0x54')){return createEndUser(_0x227b9a,_0x1fbbbf,_0x451b47,_0x2f73cf,_0x2059f2,_0x29b210);}else{return{};}});});break;case _0x0fff('0x55'):_0x1ab27d['uri']=_0x0fff('0x40')+_0x1fbbbf+_0x0fff('0x50')+_0x2f73cf+'))';return getZohoUser(_0x1ab27d,_0x0fff('0x51'))[_0x0fff('0x2a')](function(_0x30c4d6){if(_0x30c4d6)return _0x30c4d6;if(_0x29b210[_0x0fff('0x42')]!='nothing'){return createEndUser(_0x227b9a,_0x1fbbbf,_0x451b47,_0x2f73cf,_0x2059f2,_0x29b210);}else{return{};}});break;case _0x0fff('0x56'):_0x1ab27d[_0x0fff('0x52')]='https://www.zohoapis.'+_0x1fbbbf+_0x0fff('0x57')+_0x2f73cf+'))';return getZohoUser(_0x1ab27d,'Leads')['then'](function(_0x5aa5d3){if(_0x5aa5d3)return _0x5aa5d3;if(_0x29b210[_0x0fff('0x42')]!=_0x0fff('0x54')){return createEndUser(_0x227b9a,_0x1fbbbf,_0x451b47,_0x2f73cf,_0x2059f2,_0x29b210);}else{return{};}});break;}}function getCall(_0x15f725,_0x194ed8,_0x579291,_0x4bf98d,_0x2524ad,_0x2c765f,_0x2cbe43,_0x3b6c98){logger[_0x0fff('0x30')]('Creating\x20new\x20call...');var _0x3b401c={};_0x3b401c[_0x0fff('0x58')]={'name':!_[_0x0fff('0x1c')](_0x4bf98d[_0x0fff('0x43')][_0x0fff('0x17')])&&!_[_0x0fff('0x1c')](_0x4bf98d[_0x0fff('0x3b')][_0x0fff('0x17')])&&_0x4bf98d[_0x0fff('0x3b')][_0x0fff('0x17')]===_0x0fff('0x59')?_0x4bf98d[_0x0fff('0x43')][_0x0fff('0x17')]:!_[_0x0fff('0x1c')](_0x4bf98d[_0x0fff('0x5a')])?_0x4bf98d[_0x0fff('0x5a')]+'\x20'+_0x4bf98d[_0x0fff('0x44')]:_0x4bf98d[_0x0fff('0x44')],'id':_0x4bf98d['id']};_0x3b401c[_0x0fff('0x5b')]=intUtil[_0x0fff('0x5c')](_0x2c765f[_0x0fff('0x5d')],_0x2cbe43,'\x20');_0x3b401c['Description']=intUtil[_0x0fff('0x5c')](_0x2c765f[_0x0fff('0x5e')],_0x2cbe43,'\x0a');if(_0x2524ad[_0x0fff('0x49')]===_0x0fff('0x51')){_0x3b401c['Who_Id']={'name':!_[_0x0fff('0x1c')](_0x2524ad['Full_Name'])?_0x2524ad[_0x0fff('0x5f')]:!_[_0x0fff('0x1c')](_0x2524ad[_0x0fff('0x60')])?_0x2524ad[_0x0fff('0x60')]+'\x20'+_0x2524ad['Last_Name']:_0x2524ad[_0x0fff('0x61')],'id':_0x2524ad['id']};}if(_0x2524ad[_0x0fff('0x49')]===_0x0fff('0x53')){_0x3b401c[_0x0fff('0x62')]={'name':!_['isNil'](_0x2524ad['Full_Name'])?_0x2524ad[_0x0fff('0x5f')]:!_[_0x0fff('0x1c')](_0x2524ad[_0x0fff('0x60')])?_0x2524ad[_0x0fff('0x60')]+'\x20'+_0x2524ad[_0x0fff('0x61')]:_0x2524ad[_0x0fff('0x61')],'id':_0x2524ad['id']};_0x3b401c['$se_module']=_['startCase'](_0x2524ad[_0x0fff('0x49')]);}if(_0x2cbe43[_0x0fff('0x63')]){_0x3b401c[_0x0fff('0x64')]=moment[_0x0fff('0x65')](parseInt(_0x2cbe43[_0x0fff('0x63')])*0x3e8)[_0x0fff('0x32')](_0x0fff('0x66'));}else if(_0x2cbe43[_0x0fff('0x67')]&&_0x2cbe43['endtime']){_0x3b401c[_0x0fff('0x64')]=moment['utc'](moment(_0x2cbe43[_0x0fff('0x68')],_0x0fff('0x69'))[_0x0fff('0x6a')](moment(_0x2cbe43['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x0fff('0x32')]('mm:ss');}switch(_0x2cbe43[_0x0fff('0x6b')]){case _0x0fff('0x6c'):_0x3b401c[_0x0fff('0x6d')]=_0x0fff('0x6e');break;case'complete':case _0x0fff('0x6f'):_0x3b401c[_0x0fff('0x6d')]='Answered';break;case _0x0fff('0x70'):_0x3b401c[_0x0fff('0x6d')]=_0x0fff('0x71');break;case'abandoned':_0x3b401c[_0x0fff('0x6d')]=_0x0fff('0x72');break;case _0x0fff('0x73'):_0x3b401c[_0x0fff('0x6d')]=_0x0fff('0x74');default:}_0x3b401c[_0x0fff('0x75')]=(_0x3b6c98===_0x0fff('0x76')?moment(_0x2cbe43[_0x0fff('0x77')])[_0x0fff('0x32')](_0x0fff('0x69')):moment(_0x2cbe43[_0x0fff('0x78')])[_0x0fff('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x0fff('0x69'));_0x3b401c['Call_Type']=_0x3b6c98||'Inbound';_0x3b401c=_[_0x0fff('0x79')](_0x3b401c,getCustomFields(_0x2c765f[_0x0fff('0x7a')],_0x2cbe43));return request({'method':_0x0fff('0x25'),'uri':'https://www.zohoapis.'+_0x194ed8+'/crm/v2/Calls','headers':{'Authorization':_0x0fff('0x45')+_0x15f725},'body':{'data':[_0x3b401c]},'json':!![]})[_0x0fff('0x2a')](function(_0x2e996c){if(_0x2e996c&&_0x2e996c[_0x0fff('0x3f')][0x0]['code']===_0x0fff('0x47')){logger[_0x0fff('0x30')](_0x0fff('0x7b'));return{'id':_0x2e996c[_0x0fff('0x3f')][0x0]['details']['id']};}})[_0x0fff('0x2d')](function(_0x1858fb){logger['info']('err',_0x1858fb[_0x0fff('0x7c')]);console[_0x0fff('0x4b')](_0x0fff('0x7d'),_0x1858fb);});}exports[_0x0fff('0x7e')]=function(_0x167e55,_0x50eaa6,_0x27cb67,_0x7b040,_0x2c97c8,_0x2d77bd){var _0x256246,_0x522a4c,_0x5d57fc;_0x2d77bd[_0x0fff('0x7f')]=intUtil['stripTrailingSlash'](_0x2d77bd[_0x0fff('0x7f')]);_0x2d77bd[_0x0fff('0x80')]=intUtil[_0x0fff('0x81')](_0x2d77bd[_0x0fff('0x80')]);if(_0x2c97c8&&_0x2c97c8[_0x0fff('0x82')]){logger['info'](_0x0fff('0x83'),_0x0fff('0x84'));_0x50eaa6[_0x0fff('0x85')]=_0x2d77bd[_0x0fff('0x80')]+_0x0fff('0x86')+_0x50eaa6[_0x0fff('0x87')]+_0x0fff('0x88')+md5(_0x50eaa6[_0x0fff('0x87')]);}else{_0x50eaa6[_0x0fff('0x85')]='';}var _0xfac929=_0x2d77bd[_0x0fff('0x7f')]==='zoho.eu'?'eu':_0x0fff('0x89');return getAccessToken(_0x2d77bd)[_0x0fff('0x2a')](function(_0x5d2411){_0x5d57fc=_0x5d2411;return getUser(_0x5d57fc,_0xfac929,_0x2d77bd,_0x7b040[_0x0fff('0x38')]);})['then'](function(_0x27dc72){_0x256246=_0x27dc72;logger[_0x0fff('0x30')](_0x0fff('0x8a'),_0x256246['id']);return getEndUser(_0x5d57fc,_0xfac929,_0x2d77bd,_0x50eaa6[_0x0fff('0x8b')],_0x50eaa6[_0x0fff('0x8c')],_0x256246,_0x27cb67);})['then'](function(_0x1cd2b8){_0x522a4c=_0x1cd2b8;return getCall(_0x5d57fc,_0xfac929,_0x2d77bd,_0x256246,_0x522a4c,_0x27cb67,_0x50eaa6,_0x0fff('0x8d'));})['then'](function(_0x309cb9){if(_0x309cb9){logger[_0x0fff('0x30')](_0x0fff('0x8e'),_0x309cb9['id']);logger['info'](_0x0fff('0x83'),_0x0fff('0x8f'));emit(util['format']('user:%s',_0x7b040[_0x0fff('0x17')]),'trigger:browser:url',{'uri':'https://crm.'+_0x2d77bd[_0x0fff('0x7f')]+_0x0fff('0x90')+_0x309cb9['id']});}})[_0x0fff('0x2d')](function(_0x47b5d0){logger['error'](_0x0fff('0x83'),JSON['stringify'](_0x47b5d0));});};exports[_0x0fff('0x76')]=function(_0x299e95,_0x15c1cd,_0x130904,_0x14aaa6,_0x1e940c,_0x194712,_0x533d8a){var _0x38ff68,_0x38b027,_0x374701;_0x194712[_0x0fff('0x7f')]=intUtil[_0x0fff('0x81')](_0x194712[_0x0fff('0x7f')]);_0x194712['serverUrl']=intUtil[_0x0fff('0x81')](_0x194712['serverUrl']);if(_0x533d8a&&_0x533d8a[_0x0fff('0x91')]&&_0x533d8a[_0x0fff('0x91')]!==_0x0fff('0x92')){logger[_0x0fff('0x30')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x15c1cd[_0x0fff('0x85')]=_0x194712['serverUrl']+_0x0fff('0x86')+_0x15c1cd[_0x0fff('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x15c1cd['uniqueid']);}var _0x36cc4e=_0x194712[_0x0fff('0x7f')]===_0x0fff('0x93')?'eu':_0x0fff('0x89');return getAccessToken(_0x194712)['then'](function(_0x407f0a){_0x374701=_0x407f0a;return getUser(_0x374701,_0x36cc4e,_0x194712,_0x14aaa6['email']);})[_0x0fff('0x2a')](function(_0x20d348){_0x38ff68=_0x20d348;logger[_0x0fff('0x30')]('The\x20User\x20ID\x20is:',_0x38ff68['id']);return getEndUser(_0x374701,_0x36cc4e,_0x194712,_0x15c1cd['destcalleridname'],_0x15c1cd['destcalleridnum'],_0x38ff68,_0x130904);})[_0x0fff('0x2a')](function(_0x547816){_0x38b027=_0x547816;return getCall(_0x374701,_0x36cc4e,_0x194712,_0x38ff68,_0x38b027,_0x130904,_0x15c1cd,_0x0fff('0x94'));})[_0x0fff('0x2a')](function(_0x12d309){if(_0x12d309){logger[_0x0fff('0x30')](_0x0fff('0x8e'),_0x12d309['id']);logger[_0x0fff('0x30')](_0x0fff('0x95'),_0x0fff('0x8f'));emit(util[_0x0fff('0x32')](_0x0fff('0x96'),_0x14aaa6[_0x0fff('0x17')]),'trigger:browser:url',{'uri':_0x0fff('0x97')+_0x194712[_0x0fff('0x7f')]+_0x0fff('0x90')+_0x12d309['id']});}})[_0x0fff('0x2d')](function(_0x1b15a0){logger['error'](_0x0fff('0x95'),JSON[_0x0fff('0xd')](_0x1b15a0));});};exports['unmanaged']=function(_0x35559c,_0x12673f,_0x45fe6e,_0x2c3b21,_0x139241,_0x2b1688){var _0xe06663,_0x9a3823,_0x40c4f3;_0x2b1688[_0x0fff('0x7f')]=intUtil['stripTrailingSlash'](_0x2b1688[_0x0fff('0x7f')]);_0x2b1688[_0x0fff('0x80')]=intUtil[_0x0fff('0x81')](_0x2b1688[_0x0fff('0x80')]);if(_0x139241&&_0x139241[_0x0fff('0x82')]){logger[_0x0fff('0x30')]('['+_0x12673f[_0x0fff('0x6b')]['toUpperCase']()+']',_0x0fff('0x84'));_0x12673f['recordingURL']=_0x2b1688[_0x0fff('0x80')]+_0x0fff('0x86')+_0x12673f[_0x0fff('0x87')]+_0x0fff('0x88')+md5(_0x12673f[_0x0fff('0x87')]);}else{_0x12673f['recordingURL']='';}var _0x359653=_0x2b1688['host']==='zoho.eu'?'eu':_0x0fff('0x89');return getAccessToken(_0x2b1688)[_0x0fff('0x2a')](function(_0x3d8df3){_0x40c4f3=_0x3d8df3;return getUser(_0x40c4f3,_0x359653,_0x2b1688);})[_0x0fff('0x2a')](function(_0x394cc4){_0xe06663=_0x394cc4;logger[_0x0fff('0x30')]('The\x20User\x20ID\x20is:',_0xe06663['id']);return getEndUser(_0x40c4f3,_0x359653,_0x2b1688,_0x12673f['calleridname'],_0x12673f['calleridnum'],_0xe06663,_0x45fe6e);})[_0x0fff('0x2a')](function(_0x41b755){_0x9a3823=_0x41b755;return getCall(_0x40c4f3,_0x359653,_0x2b1688,_0xe06663,_0x9a3823,_0x45fe6e,_0x12673f,_0x0fff('0x8d'));})[_0x0fff('0x2a')](function(_0x21c6ae){if(_0x21c6ae){logger[_0x0fff('0x30')](_0x0fff('0x8e'),_0x21c6ae['id']);}})[_0x0fff('0x2d')](function(_0xed7e93){logger[_0x0fff('0x2e')]('['+_0x12673f[_0x0fff('0x6b')][_0x0fff('0x98')]()+']',JSON[_0x0fff('0xd')](_0xed7e93));});}; \ No newline at end of file +var _0xa49b=['https://crm.','unmanaged','toUpperCase','calleridname','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','idField','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','users','isArrayLikeObject','Agent\x20found!','profile','Administrator','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','utc','mm:ss','answertime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','serverUrl','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','uniqueid','com','destcalleridnum','[OUTBOUND]'];(function(_0xed8e74,_0x17b96d){var _0x5b7826=function(_0x50cd09){while(--_0x50cd09){_0xed8e74['push'](_0xed8e74['shift']());}};_0x5b7826(++_0x17b96d);}(_0xa49b,0x126));var _0xba49=function(_0x24d9ec,_0x4e7855){_0x24d9ec=_0x24d9ec-0x0;var _0x529bf8=_0xa49b[_0x24d9ec];return _0x529bf8;};'use strict';var _=require('lodash');var rp=require(_0xba49('0x0'));var md5=require(_0xba49('0x1'));var util=require(_0xba49('0x2'));var intUtil=require(_0xba49('0x3'));var moment=require('moment');var Redis=require(_0xba49('0x4'));var BPromise=require(_0xba49('0x5'));var config=require(_0xba49('0x6'));var logger=require('../../../../config/logger')(_0xba49('0x7'));config[_0xba49('0x8')]=_[_0xba49('0x9')](config['redis'],{'host':_0xba49('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xba49('0x8')]));function emit(_0x47340c,_0x2bfae5,_0x4f0b8c){io['to'](_0x47340c)[_0xba49('0xb')](_0x2bfae5,_0x4f0b8c);}function request(_0x249dd6){logger[_0xba49('0xc')](_0xba49('0xd'),JSON['stringify'](_0x249dd6));return rp(_0x249dd6);}function getCustomFields(_0x27ec37,_0x1c26a0){var _0x1e5a50={};if(_0x27ec37['length']>0x0){_['forEach'](_0x27ec37,function(_0x19d2f8){if(_0x19d2f8['type']==='string'&&_0x19d2f8['idField']){_0x1e5a50[_0x19d2f8[_0xba49('0xe')]]=_0x19d2f8['content']['toString']();}else if(_0x19d2f8[_0xba49('0xf')]===_0xba49('0x10')&&_0x19d2f8[_0xba49('0x11')]&&_0x19d2f8[_0xba49('0xe')]&&_0x1c26a0[_0x19d2f8['variableName']]){_0x1e5a50[_0x19d2f8[_0xba49('0xe')]]=_0x1c26a0[_0x19d2f8[_0xba49('0x11')]]['toString']();}else if(_0x19d2f8['type']===_0xba49('0x12')&&_0x19d2f8[_0xba49('0x13')]&&_0x19d2f8[_0xba49('0x13')][_0xba49('0x14')]&&_0x19d2f8['idField']&&_0x1c26a0[_0x19d2f8[_0xba49('0x13')][_0xba49('0x14')][_0xba49('0x15')]()]){_0x1e5a50[_0x19d2f8['idField']]=_0x1c26a0[_0x19d2f8[_0xba49('0x13')][_0xba49('0x14')][_0xba49('0x15')]()][_0xba49('0x16')]();}});}return _0x1e5a50;}function getName(_0x5d9f45){if(_0x5d9f45[_0xba49('0x17')]('\x20')>0x0){var _0x59af33=_0x5d9f45[_0xba49('0x18')](/ (.+)/);if(_0x59af33[0x1]){return _0x59af33;}}return[_0x5d9f45,_0x5d9f45];}var accountsTokens={};function getAccessToken(_0x5cd475){return new Promise(function(_0x2c6617,_0x36b21b){if(!_[_0xba49('0x19')](accountsTokens[_0x5cd475['id']])&&!_[_0xba49('0x19')](accountsTokens[_0x5cd475['id']][_0xba49('0x1a')])){if(moment()[_0xba49('0x1b')](accountsTokens[_0x5cd475['id']][_0xba49('0x1c')])){_0x2c6617(accountsTokens[_0x5cd475['id']][_0xba49('0x1a')]);}}var _0x2abc3b;switch(_0x5cd475['zone']){case'US':_0x2abc3b='https://accounts.zoho.com';break;case'AU':_0x2abc3b=_0xba49('0x1d');break;case'EU':_0x2abc3b=_0xba49('0x1e');break;case'IN':_0x2abc3b='https://accounts.zoho.in';break;case'CN':_0x2abc3b='https://accounts.zoho.com.cn';break;default:_0x2abc3b='https://accounts.zoho.eu';break;}var _0x4e65c4={'method':_0xba49('0x1f'),'uri':_0x2abc3b+_0xba49('0x20'),'qs':{'refresh_token':_0x5cd475[_0xba49('0x21')],'client_id':_0x5cd475[_0xba49('0x22')],'client_secret':_0x5cd475[_0xba49('0x23')],'grant_type':_0xba49('0x24')},'json':!![]};return rp(_0x4e65c4)[_0xba49('0x25')](function(_0x216e1e){accountsTokens[_0x5cd475['id']]={'access_token':_0x216e1e['access_token'],'expires_in':moment()[_0xba49('0x26')](_0x216e1e[_0xba49('0x1c')],_0xba49('0x27'))};_0x2c6617(_0x216e1e['access_token']);})[_0xba49('0x28')](function(_0xf4d76c){logger[_0xba49('0x29')]('Failing\x20creating\x20the\x20access_token',_0xf4d76c[_0xba49('0x2a')]);_0x36b21b(_0xf4d76c);});});}function getUser(_0x15f9ac,_0x529415,_0x2c0854,_0x3d62af){logger[_0xba49('0x2b')](_0xba49('0x2c'));return request({'method':_0xba49('0x2d'),'uri':util[_0xba49('0x2e')]('https://www.zohoapis.%s/crm/v2/users',_0x529415),'qs':{'type':_0xba49('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x15f9ac},'json':!![]})[_0xba49('0x25')](function(_0x3a1ef4){if(_0x3a1ef4[_0xba49('0x30')]){var _0x47d776=-0x1;if(_[_0xba49('0x31')](_0x3a1ef4[_0xba49('0x30')])){if(!_[_0xba49('0x19')](_0x3d62af)){_0x47d776=_['findIndex'](_0x3a1ef4[_0xba49('0x30')],function(_0x1fe99c){return _0x1fe99c['email']===_0x3d62af;});}if(_0x47d776>=0x0){logger[_0xba49('0x2b')](_0xba49('0x32'));}else{logger[_0xba49('0x2b')]('Using\x20the\x20admin\x20account!');_0x47d776=_['findIndex'](_0x3a1ef4[_0xba49('0x30')],function(_0x3fdb3c){return _0x3fdb3c[_0xba49('0x33')][_0xba49('0x14')]===_0xba49('0x34');});}return _0x3a1ef4[_0xba49('0x30')][_0x47d776];}else{if(_0x3a1ef4['user'][_0xba49('0x33')][_0xba49('0x14')]==='Administrator'){logger[_0xba49('0x2b')]('Using\x20the\x20admin\x20account!');user=_0x3a1ef4['user'];return user;}else{logger[_0xba49('0x29')]('The\x20failing\x20result\x20is',JSON[_0xba49('0x35')](_0x3a1ef4));throw new Error(_0xba49('0x36')+JSON[_0xba49('0x35')](_0x3a1ef4));}}}else{logger[_0xba49('0x29')](_0xba49('0x37'),JSON[_0xba49('0x35')](_0x3a1ef4));throw new Error(_0xba49('0x36')+JSON[_0xba49('0x35')](_0x3a1ef4));}})[_0xba49('0x28')](function(_0x1e23b9){console['error'](_0x1e23b9);});}function getZohoUser(_0x219cdf,_0xda87d6){return new BPromise(function(_0x257a97,_0x115168){request(_0x219cdf)[_0xba49('0x25')](function(_0x38ad63){var _0x1a438f=null;if(_0x38ad63){_0x1a438f=_0x38ad63['data'][0x0];_0x1a438f[_0xba49('0x38')]=_0xda87d6;}_0x257a97(_0x1a438f);})['catch'](function(_0x1fe48e){_0x115168(_0x1fe48e);});});}function createEndUser(_0x532c40,_0x51b3e4,_0x2f47ae,_0xd14a74,_0x28e5fa,_0x484295){var _0x2f47ae=getName(_0x2f47ae);return request({'method':'POST','uri':_0xba49('0x39')+_0x51b3e4+'/crm/v2/'+_[_0xba49('0x3a')](_0x484295[_0xba49('0x3b')])+'s','body':{'data':[{'Last_Name':_0x2f47ae[0x1],'First_Name':_0x2f47ae[0x0],'Phone':_0xd14a74,'Owner':{'name':!_['isNil'](_0x28e5fa[_0xba49('0x3c')][_0xba49('0x14')])?_0x28e5fa[_0xba49('0x3c')][_0xba49('0x14')]:!_[_0xba49('0x19')](_0x28e5fa[_0xba49('0x3d')])?_0x28e5fa['first_name']+'\x20'+_0x28e5fa['last_name']:_0x28e5fa[_0xba49('0x3e')],'id':_0x28e5fa['id']}}]},'headers':{'Authorization':_0xba49('0x3f')+_0x532c40},'json':!![]})[_0xba49('0x25')](function(_0x1d61af){if(_0x1d61af&&_0x1d61af[_0xba49('0x40')][0x0][_0xba49('0x41')]===_0xba49('0x42')){var _0x1f69e2=_0x1d61af[_0xba49('0x40')][0x0][_0xba49('0x43')];_0x1f69e2[_0xba49('0x38')]=_[_0xba49('0x3a')](_0x484295[_0xba49('0x3b')])+'s';return _0x1f69e2;}logger[_0xba49('0x29')]('The\x20failing\x20result\x20is',JSON[_0xba49('0x35')](data));throw new Error(_0xba49('0x44')+JSON[_0xba49('0x35')](data));})['catch'](function(_0x2fca2e){console[_0xba49('0x45')]('CREATE\x20ERROR',_0x2fca2e);});}function getEndUser(_0x480949,_0x12dee5,_0x59a556,_0x2688ca,_0xa077b7,_0x3ef36f,_0x16f005){var _0x10e0a8={'method':_0xba49('0x2d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x480949},'json':!![]};switch(_0x16f005[_0xba49('0x46')]){case _0xba49('0x47'):_0x10e0a8[_0xba49('0x48')]=_0xba49('0x39')+_0x12dee5+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xa077b7+'))';return getZohoUser(_0x10e0a8,_0xba49('0x49'))[_0xba49('0x25')](function(_0xd899bb){if(_0xd899bb)return _0xd899bb;_0x10e0a8['uri']='https://www.zohoapis.'+_0x12dee5+_0xba49('0x4a')+_0xa077b7+'))';return getZohoUser(_0x10e0a8,_0xba49('0x4b'))[_0xba49('0x25')](function(_0x4f5d27){if(_0x4f5d27)return _0x4f5d27;if(_0x16f005[_0xba49('0x3b')]!=_0xba49('0x4c')){return createEndUser(_0x480949,_0x12dee5,_0x2688ca,_0xa077b7,_0x3ef36f,_0x16f005);}else{return{};}});});break;case _0xba49('0x4d'):_0x10e0a8['uri']=_0xba49('0x39')+_0x12dee5+_0xba49('0x4e')+_0xa077b7+'))';return getZohoUser(_0x10e0a8,_0xba49('0x49'))[_0xba49('0x25')](function(_0xb1d7f3){if(_0xb1d7f3)return _0xb1d7f3;if(_0x16f005[_0xba49('0x3b')]!='nothing'){return createEndUser(_0x480949,_0x12dee5,_0x2688ca,_0xa077b7,_0x3ef36f,_0x16f005);}else{return{};}});break;case'lead':_0x10e0a8['uri']=_0xba49('0x39')+_0x12dee5+_0xba49('0x4a')+_0xa077b7+'))';return getZohoUser(_0x10e0a8,'Leads')[_0xba49('0x25')](function(_0x4061d6){if(_0x4061d6)return _0x4061d6;if(_0x16f005[_0xba49('0x3b')]!=_0xba49('0x4c')){return createEndUser(_0x480949,_0x12dee5,_0x2688ca,_0xa077b7,_0x3ef36f,_0x16f005);}else{return{};}});break;}}function getCall(_0x5b0e7f,_0x28c063,_0xa230ca,_0x57ab99,_0x1a5501,_0x4efab4,_0x56fc82,_0x3c87a2){logger['info'](_0xba49('0x4f'));var _0x137355={};_0x137355[_0xba49('0x50')]={'name':!_[_0xba49('0x19')](_0x57ab99[_0xba49('0x3c')][_0xba49('0x14')])&&!_['isNil'](_0x57ab99[_0xba49('0x33')][_0xba49('0x14')])&&_0x57ab99['profile']['name']===_0xba49('0x51')?_0x57ab99[_0xba49('0x3c')][_0xba49('0x14')]:!_[_0xba49('0x19')](_0x57ab99[_0xba49('0x3d')])?_0x57ab99[_0xba49('0x3d')]+'\x20'+_0x57ab99[_0xba49('0x3e')]:_0x57ab99[_0xba49('0x3e')],'id':_0x57ab99['id']};_0x137355[_0xba49('0x52')]=intUtil['getString'](_0x4efab4[_0xba49('0x53')],_0x56fc82,'\x20');_0x137355[_0xba49('0x54')]=intUtil[_0xba49('0x55')](_0x4efab4[_0xba49('0x56')],_0x56fc82,'\x0a');if(_0x1a5501[_0xba49('0x38')]===_0xba49('0x49')){_0x137355[_0xba49('0x57')]={'name':!_[_0xba49('0x19')](_0x1a5501[_0xba49('0x58')])?_0x1a5501[_0xba49('0x58')]:!_[_0xba49('0x19')](_0x1a5501['First_Name'])?_0x1a5501[_0xba49('0x59')]+'\x20'+_0x1a5501['Last_Name']:_0x1a5501['Last_Name'],'id':_0x1a5501['id']};}if(_0x1a5501[_0xba49('0x38')]===_0xba49('0x4b')){_0x137355['What_Id']={'name':!_['isNil'](_0x1a5501[_0xba49('0x58')])?_0x1a5501[_0xba49('0x58')]:!_['isNil'](_0x1a5501['First_Name'])?_0x1a5501[_0xba49('0x59')]+'\x20'+_0x1a5501[_0xba49('0x5a')]:_0x1a5501[_0xba49('0x5a')],'id':_0x1a5501['id']};_0x137355[_0xba49('0x5b')]=_[_0xba49('0x3a')](_0x1a5501['enduserType']);}if(_0x56fc82[_0xba49('0x5c')]){_0x137355['Call_Duration']=moment[_0xba49('0x5d')](parseInt(_0x56fc82['talktime'])*0x3e8)['format'](_0xba49('0x5e'));}else if(_0x56fc82[_0xba49('0x5f')]&&_0x56fc82['endtime']){_0x137355[_0xba49('0x60')]=moment[_0xba49('0x5d')](moment(_0x56fc82[_0xba49('0x61')],_0xba49('0x62'))[_0xba49('0x63')](moment(_0x56fc82[_0xba49('0x64')],_0xba49('0x62'))))['format'](_0xba49('0x5e'));}switch(_0x56fc82[_0xba49('0x65')]){case'called':_0x137355[_0xba49('0x66')]=_0xba49('0x67');break;case _0xba49('0x68'):case'connect':_0x137355[_0xba49('0x66')]=_0xba49('0x69');break;case _0xba49('0x6a'):_0x137355['Call_Result']=_0xba49('0x6b');break;case _0xba49('0x6c'):_0x137355['Call_Result']=_0xba49('0x6d');break;case _0xba49('0x6e'):_0x137355[_0xba49('0x66')]=_0xba49('0x6f');default:}_0x137355['Call_Start_Time']=(_0x3c87a2===_0xba49('0x70')?moment(_0x56fc82[_0xba49('0x64')])[_0xba49('0x2e')](_0xba49('0x62')):moment(_0x56fc82['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xba49('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x137355[_0xba49('0x71')]=_0x3c87a2||_0xba49('0x72');_0x137355=_['merge'](_0x137355,getCustomFields(_0x4efab4[_0xba49('0x73')],_0x56fc82));return request({'method':_0xba49('0x1f'),'uri':'https://www.zohoapis.'+_0x28c063+_0xba49('0x74'),'headers':{'Authorization':_0xba49('0x3f')+_0x5b0e7f},'body':{'data':[_0x137355]},'json':!![]})['then'](function(_0x2d64b4){if(_0x2d64b4&&_0x2d64b4[_0xba49('0x40')][0x0]['code']===_0xba49('0x42')){logger[_0xba49('0x2b')]('Call\x20created!');return{'id':_0x2d64b4[_0xba49('0x40')][0x0][_0xba49('0x43')]['id']};}})[_0xba49('0x28')](function(_0x3f1a43){logger[_0xba49('0x2b')]('err',_0x3f1a43[_0xba49('0x2a')]);console[_0xba49('0x45')](_0xba49('0x75'),_0x3f1a43);});}exports[_0xba49('0x76')]=function(_0x22d4e3,_0x51c167,_0x27b43e,_0x5b0200,_0x162c0a,_0x29ca82){var _0x53e6b0,_0x5b7b61,_0x2d582b;_0x29ca82[_0xba49('0x77')]=intUtil[_0xba49('0x78')](_0x29ca82[_0xba49('0x77')]);_0x29ca82[_0xba49('0x79')]=intUtil['stripTrailingSlash'](_0x29ca82[_0xba49('0x79')]);if(_0x162c0a&&_0x162c0a['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x51c167[_0xba49('0x7a')]=_0x29ca82[_0xba49('0x79')]+_0xba49('0x7b')+_0x51c167['uniqueid']+_0xba49('0x7c')+md5(_0x51c167['uniqueid']);}else{_0x51c167[_0xba49('0x7a')]='';}var _0x3536fc=_0x29ca82[_0xba49('0x77')]===_0xba49('0x7d')?'eu':'com';return getAccessToken(_0x29ca82)[_0xba49('0x25')](function(_0x240c45){_0x2d582b=_0x240c45;return getUser(_0x2d582b,_0x3536fc,_0x29ca82,_0x5b0200['email']);})[_0xba49('0x25')](function(_0x442115){_0x53e6b0=_0x442115;logger[_0xba49('0x2b')](_0xba49('0x7e'),_0x53e6b0['id']);return getEndUser(_0x2d582b,_0x3536fc,_0x29ca82,_0x51c167['calleridname'],_0x51c167[_0xba49('0x7f')],_0x53e6b0,_0x27b43e);})['then'](function(_0x513087){_0x5b7b61=_0x513087;return getCall(_0x2d582b,_0x3536fc,_0x29ca82,_0x53e6b0,_0x5b7b61,_0x27b43e,_0x51c167,_0xba49('0x72'));})['then'](function(_0x30d5cf){if(_0x30d5cf){logger[_0xba49('0x2b')](_0xba49('0x80'),_0x30d5cf['id']);logger['info']('[QUEUE]',_0xba49('0x81'));emit(util[_0xba49('0x2e')](_0xba49('0x82'),_0x5b0200['name']),_0xba49('0x83'),{'uri':'https://crm.'+_0x29ca82[_0xba49('0x77')]+_0xba49('0x84')+_0x30d5cf['id']});}})['catch'](function(_0x441b47){logger[_0xba49('0x29')](_0xba49('0x85'),JSON[_0xba49('0x35')](_0x441b47));});};exports[_0xba49('0x70')]=function(_0x5bbd53,_0x1f0045,_0x10bde4,_0x2970cc,_0x258c14,_0x40da98,_0x28de5c){var _0x37d4e3,_0x509736,_0x1333f1;_0x40da98['host']=intUtil[_0xba49('0x78')](_0x40da98['host']);_0x40da98['serverUrl']=intUtil[_0xba49('0x78')](_0x40da98[_0xba49('0x79')]);if(_0x28de5c&&_0x28de5c[_0xba49('0x86')]&&_0x28de5c['recordingFormat']!==_0xba49('0x87')){logger[_0xba49('0x2b')]('[OUTBOUND]',_0xba49('0x88'));_0x1f0045[_0xba49('0x7a')]=_0x40da98[_0xba49('0x79')]+_0xba49('0x7b')+_0x1f0045[_0xba49('0x89')]+_0xba49('0x7c')+md5(_0x1f0045[_0xba49('0x89')]);}var _0x452b47=_0x40da98[_0xba49('0x77')]===_0xba49('0x7d')?'eu':_0xba49('0x8a');return getAccessToken(_0x40da98)['then'](function(_0x54b740){_0x1333f1=_0x54b740;return getUser(_0x1333f1,_0x452b47,_0x40da98,_0x2970cc['email']);})[_0xba49('0x25')](function(_0x23eac0){_0x37d4e3=_0x23eac0;logger[_0xba49('0x2b')](_0xba49('0x7e'),_0x37d4e3['id']);return getEndUser(_0x1333f1,_0x452b47,_0x40da98,_0x1f0045['destcalleridname'],_0x1f0045[_0xba49('0x8b')],_0x37d4e3,_0x10bde4);})['then'](function(_0x1a25f0){_0x509736=_0x1a25f0;return getCall(_0x1333f1,_0x452b47,_0x40da98,_0x37d4e3,_0x509736,_0x10bde4,_0x1f0045,'Outbound');})[_0xba49('0x25')](function(_0x207467){if(_0x207467){logger[_0xba49('0x2b')]('The\x20Call\x20ID\x20is:',_0x207467['id']);logger[_0xba49('0x2b')](_0xba49('0x8c'),_0xba49('0x81'));emit(util[_0xba49('0x2e')](_0xba49('0x82'),_0x2970cc[_0xba49('0x14')]),_0xba49('0x83'),{'uri':_0xba49('0x8d')+_0x40da98['host']+_0xba49('0x84')+_0x207467['id']});}})['catch'](function(_0x135738){logger[_0xba49('0x29')]('[OUTBOUND]',JSON['stringify'](_0x135738));});};exports[_0xba49('0x8e')]=function(_0x1a4ba4,_0x27ab7c,_0x5c2734,_0x25c771,_0x1f9b21,_0x41af30){var _0x31ef88,_0x1a349b,_0x18ccf5;_0x41af30[_0xba49('0x77')]=intUtil[_0xba49('0x78')](_0x41af30[_0xba49('0x77')]);_0x41af30[_0xba49('0x79')]=intUtil[_0xba49('0x78')](_0x41af30[_0xba49('0x79')]);if(_0x1f9b21&&_0x1f9b21['monitor_format']){logger[_0xba49('0x2b')]('['+_0x27ab7c[_0xba49('0x65')][_0xba49('0x8f')]()+']','Recording\x20is\x20enabled!');_0x27ab7c[_0xba49('0x7a')]=_0x41af30['serverUrl']+'/api/voice/recordings/'+_0x27ab7c[_0xba49('0x89')]+'/downloads?type=uniqueid&token='+md5(_0x27ab7c[_0xba49('0x89')]);}else{_0x27ab7c[_0xba49('0x7a')]='';}var _0x32d57f=_0x41af30[_0xba49('0x77')]===_0xba49('0x7d')?'eu':_0xba49('0x8a');return getAccessToken(_0x41af30)[_0xba49('0x25')](function(_0xcd9a93){_0x18ccf5=_0xcd9a93;return getUser(_0x18ccf5,_0x32d57f,_0x41af30);})['then'](function(_0x54aaa1){_0x31ef88=_0x54aaa1;logger['info'](_0xba49('0x7e'),_0x31ef88['id']);return getEndUser(_0x18ccf5,_0x32d57f,_0x41af30,_0x27ab7c[_0xba49('0x90')],_0x27ab7c[_0xba49('0x7f')],_0x31ef88,_0x5c2734);})[_0xba49('0x25')](function(_0x4a4d50){_0x1a349b=_0x4a4d50;return getCall(_0x18ccf5,_0x32d57f,_0x41af30,_0x31ef88,_0x1a349b,_0x5c2734,_0x27ab7c,_0xba49('0x72'));})['then'](function(_0x444cfd){if(_0x444cfd){logger[_0xba49('0x2b')]('The\x20Call\x20ID\x20is:',_0x444cfd['id']);}})[_0xba49('0x28')](function(_0x108a21){logger['error']('['+_0x27ab7c[_0xba49('0x65')][_0xba49('0x8f')]()+']',JSON[_0xba49('0x35')](_0x108a21));});}; \ 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 ef5e79f..262de89 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(_0x5d1101,_0x7a03f4){var _0x5d75d1=function(_0x554ee0){while(--_0x554ee0){_0x5d1101['push'](_0x5d1101['shift']());}};_0x5d75d1(++_0x7a03f4);}(_0x7a54,0x106));var _0x47a5=function(_0x525833,_0x3d5fc3){_0x525833=_0x525833-0x0;var _0x1fcb29=_0x7a54[_0x525833];return _0x1fcb29;};'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(_0x43d7b2,_0x5d8dd6){var _0x1561a5=function(_0x7b8443){while(--_0x7b8443){_0x43d7b2['push'](_0x43d7b2['shift']());}};_0x1561a5(++_0x5d8dd6);}(_0x7a54,0x106));var _0x47a5=function(_0x2cd649,_0x154ea7){_0x2cd649=_0x2cd649-0x0;var _0x4316ce=_0x7a54[_0x2cd649];return _0x4316ce;};'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 5fb6f20..8edce47 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 _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x3e0a5e,_0x3c2da2){var _0x4aa148=function(_0xc3d3d8){while(--_0xc3d3d8){_0x3e0a5e['push'](_0x3e0a5e['shift']());}};_0x4aa148(++_0x3c2da2);}(_0x7a54,0x106));var _0x47a5=function(_0x29bed6,_0x3a84b3){_0x29bed6=_0x29bed6-0x0;var _0xa1f450=_0x7a54[_0x29bed6];return _0xa1f450;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x30a67d,_0x1525cf){var _0x25faaf=function(_0xe44325){while(--_0xe44325){_0x30a67d['push'](_0x30a67d['shift']());}};_0x25faaf(++_0x1525cf);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ac4a1,_0x2e9361){_0x4ac4a1=_0x4ac4a1-0x0;var _0x5d5bb1=_0xb10b[_0x4ac4a1];return _0x5d5bb1;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8d2b5fa..397364b 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 _0xac31=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then'];(function(_0x2e2e2e,_0x4ef307){var _0x15f38f=function(_0x1c608d){while(--_0x1c608d){_0x2e2e2e['push'](_0x2e2e2e['shift']());}};_0x15f38f(++_0x4ef307);}(_0xac31,0xca));var _0x1ac3=function(_0x239a10,_0x5da00a){_0x239a10=_0x239a10-0x0;var _0x4f0a34=_0xac31[_0x239a10];return _0x4f0a34;};'use strict';var jayson=require(_0x1ac3('0x0'));var BPromise=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var client=jayson[_0x1ac3('0x4')][_0x1ac3('0x5')]({'port':0x2329});client[_0x1ac3('0x6')]=function(_0x59b42c,_0x33b5ab){return new BPromise(function(_0x434b5e,_0x4dcc96){return client['request'](_0x59b42c,_0x33b5ab)[_0x1ac3('0x7')](function(_0x20027f){logger[_0x1ac3('0x8')](_0x1ac3('0x9'),_0x1ac3('0x3'),_0x59b42c,_0x33b5ab,_0x20027f);if(_0x20027f['error']){logger[_0x1ac3('0xa')]('rpc',_0x1ac3('0x3'),_0x59b42c,_0x20027f[_0x1ac3('0xa')][_0x1ac3('0xb')],_0x33b5ab);return _0x4dcc96(_0x20027f['error'][_0x1ac3('0xb')]);}else{return _0x434b5e(_0x20027f[_0x1ac3('0xc')]);}})[_0x1ac3('0xd')](function(_0x24f0d2){logger[_0x1ac3('0xa')](_0x1ac3('0x9'),'routing',_0x59b42c,_0x24f0d2,_0x33b5ab);return _0x4dcc96(_0x24f0d2);});});};module[_0x1ac3('0xe')]=client; \ No newline at end of file +var _0xb5bb=['jayson/promise','bluebird','../../config/logger','client','http','then','rpc','routing','error','message','result','catch','exports'];(function(_0x4858ba,_0x784f06){var _0x5ee0c3=function(_0x33d81b){while(--_0x33d81b){_0x4858ba['push'](_0x4858ba['shift']());}};_0x5ee0c3(++_0x784f06);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x2a3ac4,_0x5a1994){_0x2a3ac4=_0x2a3ac4-0x0;var _0x159fe4=_0xb5bb[_0x2a3ac4];return _0x159fe4;};'use strict';var jayson=require(_0xbb5b('0x0'));var BPromise=require(_0xbb5b('0x1'));var logger=require(_0xbb5b('0x2'))('routing');var client=jayson[_0xbb5b('0x3')][_0xbb5b('0x4')]({'port':0x2329});client['Request']=function(_0x5d0b8a,_0x51fd39){return new BPromise(function(_0x5dfa85,_0x509dc0){return client['request'](_0x5d0b8a,_0x51fd39)[_0xbb5b('0x5')](function(_0x161047){logger['debug'](_0xbb5b('0x6'),_0xbb5b('0x7'),_0x5d0b8a,_0x51fd39,_0x161047);if(_0x161047[_0xbb5b('0x8')]){logger[_0xbb5b('0x8')](_0xbb5b('0x6'),_0xbb5b('0x7'),_0x5d0b8a,_0x161047[_0xbb5b('0x8')][_0xbb5b('0x9')],_0x51fd39);return _0x509dc0(_0x161047[_0xbb5b('0x8')][_0xbb5b('0x9')]);}else{return _0x5dfa85(_0x161047[_0xbb5b('0xa')]);}})[_0xbb5b('0xb')](function(_0x6d71ad){logger[_0xbb5b('0x8')](_0xbb5b('0x6'),_0xbb5b('0x7'),_0x5d0b8a,_0x6d71ad,_0x51fd39);return _0x509dc0(_0x6d71ad);});});};module[_0xbb5b('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b293388..4b0c18c 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 _0x86f4=['loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','getMailAccounts','then','refresh','mailAccounts','listen','Setting','findOne'];(function(_0x2943c4,_0x47d2f1){var _0x1a21aa=function(_0x3342a3){while(--_0x3342a3){_0x2943c4['push'](_0x2943c4['shift']());}};_0x1a21aa(++_0x47d2f1);}(_0x86f4,0x18a));var _0x486f=function(_0x769e9d,_0xc7e55){_0x769e9d=_0x769e9d-0x0;var _0x4f3bd0=_0x86f4[_0x769e9d];return _0x4f3bd0;};'use strict';var BPromise=require(_0x486f('0x0'));var server=require(_0x486f('0x1'));var Realtime=require(_0x486f('0x2'));var EmailChannel=require(_0x486f('0x3'));var mailAccount=require(_0x486f('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x486f('0x5'))['db'];function initRealtime(){return BPromise[_0x486f('0x6')]()['then'](mailAccount[_0x486f('0x7')]())[_0x486f('0x8')](realtime['initMailAccounts']())[_0x486f('0x8')](function(){email[_0x486f('0x9')](realtime[_0x486f('0xa')]);return realtime;});}function main(){return server[_0x486f('0xb')](realtime,email)[_0x486f('0x8')](function(_0x3a0791){return initRealtime();})['then'](function(_0x33363d){return db[_0x486f('0xc')][_0x486f('0xd')]({'attributes':['id',_0x486f('0xe')],'raw':!![]});})[_0x486f('0x8')](function(_0x362036){return setInterval(initRealtime,_0x362036[_0x486f('0xe')]*0x3e8);})[_0x486f('0xf')](function(_0x37cf58){console[_0x486f('0x10')](_0x37cf58);});}main(); \ No newline at end of file +var _0x41f2=['./rpc/mailAccount','../../mysqldb','resolve','getMailAccounts','then','refresh','mailAccounts','listen','loginMailFrequency','catch','bluebird','./server','./lib/email'];(function(_0x2ab633,_0x16e847){var _0x3f2202=function(_0x5c34f0){while(--_0x5c34f0){_0x2ab633['push'](_0x2ab633['shift']());}};_0x3f2202(++_0x16e847);}(_0x41f2,0x14f));var _0x241f=function(_0x27a3f0,_0x49e36b){_0x27a3f0=_0x27a3f0-0x0;var _0x2848b1=_0x41f2[_0x27a3f0];return _0x2848b1;};'use strict';var BPromise=require(_0x241f('0x0'));var server=require(_0x241f('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x241f('0x2'));var mailAccount=require(_0x241f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x241f('0x4'))['db'];function initRealtime(){return BPromise[_0x241f('0x5')]()['then'](mailAccount[_0x241f('0x6')]())[_0x241f('0x7')](realtime['initMailAccounts']())[_0x241f('0x7')](function(){email[_0x241f('0x8')](realtime[_0x241f('0x9')]);return realtime;});}function main(){return server[_0x241f('0xa')](realtime,email)[_0x241f('0x7')](function(_0x4e7af6){return initRealtime();})[_0x241f('0x7')](function(_0x41f672){return db['Setting']['findOne']({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0x241f('0x7')](function(_0x481686){return setInterval(initRealtime,_0x481686[_0x241f('0xb')]*0x3e8);})[_0x241f('0xc')](function(_0xdabda7){console['log'](_0xdabda7);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 451369c..21677f8 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 _0x3e69=['key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError','status','disabled','connected','messages','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','localhost','redis','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','prototype','emit','name'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x3e69,0x1dd));var _0x93e6=function(_0x8c6164,_0x1dc7db){_0x8c6164=_0x8c6164-0x0;var _0x1ca172=_0x3e69[_0x8c6164];return _0x1ca172;};'use strict';var _=require(_0x93e6('0x0'));var moment=require(_0x93e6('0x1'));var BPromise=require('bluebird');var md5=require(_0x93e6('0x2'));var Redis=require(_0x93e6('0x3'));var config=require(_0x93e6('0x4'));var logger=require(_0x93e6('0x5'))(_0x93e6('0x6'));config['redis']=_[_0x93e6('0x7')](config['redis'],{'host':_0x93e6('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x93e6('0x9')]));var EmailImap=require(_0x93e6('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x93e6('0xb'));var md5Accounts={};function EmailChannel(_0x441c41){logger[_0x93e6('0xc')](_0x93e6('0xd'));this['mailAccounts']=_0x441c41[_0x93e6('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x93e6('0xf')][_0x93e6('0x10')]=function(_0x106ef6){var _0x24c93b=this[_0x93e6('0xe')][_0x106ef6];var _0x481997={'id':_0x24c93b['id'],'name':_0x24c93b[_0x93e6('0x11')],'key':_0x24c93b[_0x93e6('0x12')],'active':_0x24c93b[_0x93e6('0x13')],'Imap':{'status':_0x24c93b[_0x93e6('0x14')]['status'],'messageStatus':_0x24c93b['Imap'][_0x93e6('0x15')],'total':_0x24c93b[_0x93e6('0x14')][_0x93e6('0x16')]}};if(_[_0x93e6('0x17')](md5Accounts[_0x106ef6])){md5Accounts[_0x106ef6]={};}var _0x1c2260=md5(JSON[_0x93e6('0x18')](_0x481997));if(md5Accounts[_0x106ef6][_0x93e6('0x2')]!==_0x1c2260){md5Accounts[_0x106ef6]['md5']=_0x1c2260;io[_0x93e6('0x10')](_0x93e6('0x19'),_0x481997);}};EmailChannel[_0x93e6('0xf')][_0x93e6('0x1a')]=function(_0x3e0e44){for(var _0x5136c9 in _0x3e0e44){if(_0x3e0e44[_0x93e6('0x1b')](_0x5136c9)){if(_0x3e0e44[_0x5136c9][_0x93e6('0x14')]&&_0x3e0e44[_0x5136c9]['active']){var _0x547f86=_0x3e0e44[_0x5136c9][_0x93e6('0x14')];if(!this[_0x93e6('0x1c')][_0x93e6('0x1b')](_0x547f86['id'])){this[_0x93e6('0x1c')][_0x547f86['id']]=new EmailImap(_0x547f86,_0x3e0e44[_0x5136c9]['email']);this[_0x93e6('0x1c')][_0x547f86['id']]['on'](_0x93e6('0x1d'),this[_0x93e6('0x1e')]['bind'](this,_0x5136c9));this[_0x93e6('0x1c')][_0x547f86['id']]['on'](_0x93e6('0x6'),this[_0x93e6('0x1f')][_0x93e6('0x20')](this,_0x5136c9));this[_0x93e6('0x1c')][_0x547f86['id']]['on'](_0x93e6('0x21'),this[_0x93e6('0x22')][_0x93e6('0x20')](this,_0x5136c9));this[_0x93e6('0x1c')][_0x547f86['id']]['on']('error',this[_0x93e6('0x23')][_0x93e6('0x20')](this,_0x5136c9));}}else{if(_[_0x93e6('0x17')](this['mailAccounts'][_0x5136c9][_0x93e6('0x14')])){this['mailAccounts'][_0x5136c9][_0x93e6('0x14')]={};}this[_0x93e6('0xe')][_0x5136c9]['Imap'][_0x93e6('0x24')]=_0x93e6('0x25');this[_0x93e6('0xe')][_0x5136c9][_0x93e6('0x14')][_0x93e6('0x15')]='';this[_0x93e6('0x10')](_0x5136c9);}}}};EmailChannel['prototype'][_0x93e6('0x1e')]=function(_0x135230,_0x4b23f3){if(this[_0x93e6('0xe')][_0x135230]){this[_0x93e6('0xe')][_0x135230][_0x93e6('0x14')]['status']=_0x93e6('0x26');this['mailAccounts'][_0x135230][_0x93e6('0x14')][_0x93e6('0x15')]=_0x4b23f3[_0x93e6('0x11')];if(_0x4b23f3[_0x93e6('0x27')]){this['mailAccounts'][_0x135230]['Imap'][_0x93e6('0x16')]=_0x4b23f3[_0x93e6('0x27')][_0x93e6('0x16')];}return this[_0x93e6('0x10')](_0x135230);}};EmailChannel['prototype'][_0x93e6('0x1f')]=function(_0x3bab0d,_0x531538){logger[_0x93e6('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x531538['firstName'],_0x531538[_0x93e6('0x28')],_0x531538[_0x93e6('0x29')],_0x3bab0d);if(this[_0x93e6('0xe')][_0x3bab0d]){return mailAccount['notify'](_0x3bab0d,_0x531538)[_0x93e6('0x2a')](function(_0xbf9100){if(_0xbf9100){logger[_0x93e6('0xc')](_0x93e6('0x2b'));}})[_0x93e6('0x2c')](function(_0x46f767){logger[_0x93e6('0x2d')](_0x93e6('0x2e'),JSON['stringify'](_0x46f767));});}};EmailChannel['prototype'][_0x93e6('0x22')]=function(_0x11793a){if(this[_0x93e6('0xe')][_0x11793a]&&this[_0x93e6('0xe')][_0x11793a][_0x93e6('0x14')]){if(this['imapAccounts'][this[_0x93e6('0xe')][_0x11793a][_0x93e6('0x14')]['id']]){delete this[_0x93e6('0x1c')][this[_0x93e6('0xe')][_0x11793a]['Imap']['id']];}this[_0x93e6('0xe')][_0x11793a][_0x93e6('0x14')][_0x93e6('0x2f')]=moment();this[_0x93e6('0x10')](_0x11793a);}};EmailChannel[_0x93e6('0xf')][_0x93e6('0x23')]=function(_0x1dd9fc,_0x295157){if(this[_0x93e6('0xe')][_0x1dd9fc]){this['mailAccounts'][_0x1dd9fc][_0x93e6('0x14')][_0x93e6('0x24')]='error';this['mailAccounts'][_0x1dd9fc][_0x93e6('0x14')][_0x93e6('0x15')]=_0x295157;return this[_0x93e6('0x10')](_0x1dd9fc);}};EmailChannel[_0x93e6('0xf')][_0x93e6('0x30')]=function(_0x4e4e82,_0x2e0b17){return this[_0x93e6('0x31')][_0x93e6('0x32')](_0x4e4e82,_0x2e0b17);};EmailChannel['prototype'][_0x93e6('0x33')]=function(_0xa74c3b){var _0x20868d=this;if(this['mailAccounts'][_0xa74c3b['id']]){if(_['isNil'](this[_0x93e6('0xe')][_0xa74c3b['id']]['Smtp'])){this['mailAccounts'][_0xa74c3b['id']][_0x93e6('0x34')]={};}this[_0x93e6('0xe')][_0xa74c3b['id']]['Smtp'][_0x93e6('0x2f')]=moment();return new BPromise(function(_0x28b47f,_0x5cd5cc){return _0x20868d[_0x93e6('0x31')][_0x93e6('0x35')](_0xa74c3b)[_0x93e6('0x2a')](function(_0x273d37){_0x20868d['mailAccounts'][_0xa74c3b['id']][_0x93e6('0x34')][_0x93e6('0x24')]='verified';_0x20868d[_0x93e6('0xe')][_0xa74c3b['id']]['Smtp'][_0x93e6('0x15')]='';_0x20868d['emit'](_0xa74c3b['id']);_0x28b47f(_0x273d37);})['catch'](function(_0x321704){_0x20868d[_0x93e6('0xe')][_0xa74c3b['id']][_0x93e6('0x34')][_0x93e6('0x24')]=_0x93e6('0x2d');_0x20868d[_0x93e6('0xe')][_0xa74c3b['id']][_0x93e6('0x34')][_0x93e6('0x15')]=_0x321704;_0x20868d[_0x93e6('0x10')](_0xa74c3b['id']);_0x5cd5cc(_0x321704);});});}return this['smtp']['verify'](_0xa74c3b);};module[_0x93e6('0x36')]=EmailChannel; \ No newline at end of file +var _0x9622=['redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','refresh','hasOwnProperty','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','connected','messages','info','firstName','lastName','from','notify','then','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','md5','../../../config/environment','email'];(function(_0x442843,_0x47e470){var _0x1d0650=function(_0x3c627c){while(--_0x3c627c){_0x442843['push'](_0x442843['shift']());}};_0x1d0650(++_0x47e470);}(_0x9622,0x160));var _0x2962=function(_0x4a3fbb,_0x567e57){_0x4a3fbb=_0x4a3fbb-0x0;var _0x10c7c1=_0x9622[_0x4a3fbb];return _0x10c7c1;};'use strict';var _=require(_0x2962('0x0'));var moment=require(_0x2962('0x1'));var BPromise=require('bluebird');var md5=require(_0x2962('0x2'));var Redis=require('ioredis');var config=require(_0x2962('0x3'));var logger=require('../../../config/logger')(_0x2962('0x4'));config[_0x2962('0x5')]=_['defaults'](config[_0x2962('0x5')],{'host':_0x2962('0x6'),'port':0x18eb});var io=require(_0x2962('0x7'))(new Redis(config[_0x2962('0x5')]));var EmailImap=require(_0x2962('0x8'));var EmailSmtp=require(_0x2962('0x9'));var mailAccount=require(_0x2962('0xa'));var md5Accounts={};function EmailChannel(_0x55fd0c){logger['info'](_0x2962('0xb'));this[_0x2962('0xc')]=_0x55fd0c[_0x2962('0xc')];this[_0x2962('0xd')]={};this[_0x2962('0xe')]=new EmailSmtp();}EmailChannel[_0x2962('0xf')][_0x2962('0x10')]=function(_0x448357){var _0xca2503=this[_0x2962('0xc')][_0x448357];var _0xd2b972={'id':_0xca2503['id'],'name':_0xca2503[_0x2962('0x11')],'key':_0xca2503[_0x2962('0x12')],'active':_0xca2503[_0x2962('0x13')],'Imap':{'status':_0xca2503[_0x2962('0x14')][_0x2962('0x15')],'messageStatus':_0xca2503[_0x2962('0x14')][_0x2962('0x16')],'total':_0xca2503['Imap'][_0x2962('0x17')]}};if(_[_0x2962('0x18')](md5Accounts[_0x448357])){md5Accounts[_0x448357]={};}var _0x21ddcc=md5(JSON[_0x2962('0x19')](_0xd2b972));if(md5Accounts[_0x448357][_0x2962('0x2')]!==_0x21ddcc){md5Accounts[_0x448357][_0x2962('0x2')]=_0x21ddcc;io[_0x2962('0x10')]('mailAccount:update',_0xd2b972);}};EmailChannel[_0x2962('0xf')][_0x2962('0x1a')]=function(_0x57eea5){for(var _0x392a28 in _0x57eea5){if(_0x57eea5[_0x2962('0x1b')](_0x392a28)){if(_0x57eea5[_0x392a28][_0x2962('0x14')]&&_0x57eea5[_0x392a28]['active']){var _0x2e65ec=_0x57eea5[_0x392a28][_0x2962('0x14')];if(!this[_0x2962('0xd')][_0x2962('0x1b')](_0x2e65ec['id'])){this[_0x2962('0xd')][_0x2e65ec['id']]=new EmailImap(_0x2e65ec,_0x57eea5[_0x392a28]['email']);this['imapAccounts'][_0x2e65ec['id']]['on']('box',this[_0x2962('0x1c')]['bind'](this,_0x392a28));this['imapAccounts'][_0x2e65ec['id']]['on'](_0x2962('0x4'),this[_0x2962('0x1d')][_0x2962('0x1e')](this,_0x392a28));this[_0x2962('0xd')][_0x2e65ec['id']]['on'](_0x2962('0x1f'),this[_0x2962('0x20')][_0x2962('0x1e')](this,_0x392a28));this[_0x2962('0xd')][_0x2e65ec['id']]['on'](_0x2962('0x21'),this['handleImapError']['bind'](this,_0x392a28));}}else{if(_[_0x2962('0x18')](this[_0x2962('0xc')][_0x392a28][_0x2962('0x14')])){this['mailAccounts'][_0x392a28][_0x2962('0x14')]={};}this[_0x2962('0xc')][_0x392a28][_0x2962('0x14')][_0x2962('0x15')]='disabled';this[_0x2962('0xc')][_0x392a28][_0x2962('0x14')][_0x2962('0x16')]='';this[_0x2962('0x10')](_0x392a28);}}}};EmailChannel[_0x2962('0xf')][_0x2962('0x1c')]=function(_0x4bab79,_0x223eaf){if(this[_0x2962('0xc')][_0x4bab79]){this[_0x2962('0xc')][_0x4bab79][_0x2962('0x14')][_0x2962('0x15')]=_0x2962('0x22');this['mailAccounts'][_0x4bab79][_0x2962('0x14')][_0x2962('0x16')]=_0x223eaf['name'];if(_0x223eaf[_0x2962('0x23')]){this[_0x2962('0xc')][_0x4bab79][_0x2962('0x14')]['total']=_0x223eaf[_0x2962('0x23')][_0x2962('0x17')];}return this[_0x2962('0x10')](_0x4bab79);}};EmailChannel[_0x2962('0xf')][_0x2962('0x1d')]=function(_0x126bdd,_0x3dd7cf){logger[_0x2962('0x24')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3dd7cf[_0x2962('0x25')],_0x3dd7cf[_0x2962('0x26')],_0x3dd7cf[_0x2962('0x27')],_0x126bdd);if(this[_0x2962('0xc')][_0x126bdd]){return mailAccount[_0x2962('0x28')](_0x126bdd,_0x3dd7cf)[_0x2962('0x29')](function(_0x184464){if(_0x184464){logger[_0x2962('0x24')]('Mail\x20accepted\x20from\x20routing');}})[_0x2962('0x2a')](function(_0x1fabcd){logger[_0x2962('0x21')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x2962('0x19')](_0x1fabcd));});}};EmailChannel[_0x2962('0xf')][_0x2962('0x20')]=function(_0xc1e208){if(this[_0x2962('0xc')][_0xc1e208]&&this['mailAccounts'][_0xc1e208][_0x2962('0x14')]){if(this[_0x2962('0xd')][this[_0x2962('0xc')][_0xc1e208][_0x2962('0x14')]['id']]){delete this[_0x2962('0xd')][this['mailAccounts'][_0xc1e208][_0x2962('0x14')]['id']];}this[_0x2962('0xc')][_0xc1e208][_0x2962('0x14')][_0x2962('0x2b')]=moment();this[_0x2962('0x10')](_0xc1e208);}};EmailChannel[_0x2962('0xf')]['handleImapError']=function(_0x2cfd74,_0x3c6c82){if(this[_0x2962('0xc')][_0x2cfd74]){this['mailAccounts'][_0x2cfd74][_0x2962('0x14')]['status']=_0x2962('0x21');this['mailAccounts'][_0x2cfd74][_0x2962('0x14')][_0x2962('0x16')]=_0x3c6c82;return this['emit'](_0x2cfd74);}};EmailChannel[_0x2962('0xf')][_0x2962('0x2c')]=function(_0x45d835,_0xaa7c42){return this[_0x2962('0xe')][_0x2962('0x2d')](_0x45d835,_0xaa7c42);};EmailChannel['prototype'][_0x2962('0x2e')]=function(_0x8d6f03){var _0x28b1fe=this;if(this[_0x2962('0xc')][_0x8d6f03['id']]){if(_[_0x2962('0x18')](this[_0x2962('0xc')][_0x8d6f03['id']][_0x2962('0x2f')])){this[_0x2962('0xc')][_0x8d6f03['id']]['Smtp']={};}this['mailAccounts'][_0x8d6f03['id']][_0x2962('0x2f')][_0x2962('0x2b')]=moment();return new BPromise(function(_0x4e6b54,_0x28c30a){return _0x28b1fe[_0x2962('0xe')][_0x2962('0x30')](_0x8d6f03)[_0x2962('0x29')](function(_0x4f8c1b){_0x28b1fe['mailAccounts'][_0x8d6f03['id']][_0x2962('0x2f')][_0x2962('0x15')]=_0x2962('0x31');_0x28b1fe['mailAccounts'][_0x8d6f03['id']][_0x2962('0x2f')]['messageStatus']='';_0x28b1fe['emit'](_0x8d6f03['id']);_0x4e6b54(_0x4f8c1b);})['catch'](function(_0x4de6d2){_0x28b1fe[_0x2962('0xc')][_0x8d6f03['id']][_0x2962('0x2f')]['status']=_0x2962('0x21');_0x28b1fe[_0x2962('0xc')][_0x8d6f03['id']][_0x2962('0x2f')][_0x2962('0x16')]=_0x4de6d2;_0x28b1fe['emit'](_0x8d6f03['id']);_0x28c30a(_0x4de6d2);});});}return this[_0x2962('0xe')]['verify'](_0x8d6f03);};module[_0x2962('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5d951af..4b3faff 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 _0x4c51=['handleMessageEnd','handleSimpleParser','parser','handleCloseBox','stringify','textCode','hasOwnProperty','exports','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','handleReady','bind','end','handleEnd','error','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','tls','getHost','port','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes'];(function(_0x5b8a99,_0x2e0c12){var _0x31fa01=function(_0x21396c){while(--_0x21396c){_0x5b8a99['push'](_0x5b8a99['shift']());}};_0x31fa01(++_0x2e0c12);}(_0x4c51,0x182));var _0x14c5=function(_0x2393d2,_0x196e61){_0x2393d2=_0x2393d2-0x0;var _0x34d75f=_0x4c51[_0x2393d2];return _0x34d75f;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x14c5('0x0'));var Imap=require(_0x14c5('0x1'));var _=require(_0x14c5('0x2'));var rs=require(_0x14c5('0x3'));var simpleParser=require(_0x14c5('0x4'))[_0x14c5('0x5')];var Iconv=require(_0x14c5('0x6'))[_0x14c5('0x7')];var EventEmitter=require(_0x14c5('0x8'))[_0x14c5('0x9')];var utils=require(_0x14c5('0xa'));var logger=require(_0x14c5('0xb'))(_0x14c5('0xc'));function EmailImap(_0x139a3b,_0x2f830f){this[_0x14c5('0xd')]=_0x14c5('0xe');this['account']=this['getAccount'](_0x139a3b,_0x2f830f);this['imap']=new Imap(this[_0x14c5('0xf')]);this[_0x14c5('0x1')][_0x14c5('0x10')]('ready',this[_0x14c5('0x11')][_0x14c5('0x12')](this));this[_0x14c5('0x1')][_0x14c5('0x10')](_0x14c5('0x13'),this[_0x14c5('0x14')][_0x14c5('0x12')](this));this[_0x14c5('0x1')]['on'](_0x14c5('0x15'),this['handleError']['bind'](this));this[_0x14c5('0x1')][_0x14c5('0x16')]();}util[_0x14c5('0x17')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x41e5b6,_0x304c41){var _0x4e6152={'connTimeout':_0x41e5b6[_0x14c5('0x18')]?_0x41e5b6[_0x14c5('0x18')]*0x3e8:0x2710,'authTimeout':_0x41e5b6[_0x14c5('0x19')]?_0x41e5b6[_0x14c5('0x19')]*0x3e8:0x1388};if(_[_0x14c5('0x1a')](_0x41e5b6[_0x14c5('0x1b')])){if(_0x41e5b6[_0x14c5('0x1c')]){_0x4e6152[_0x14c5('0x1d')]=_0x41e5b6[_0x14c5('0x1d')];_0x4e6152[_0x14c5('0x1e')]=_0x41e5b6['password'];}_0x4e6152[_0x14c5('0x1f')]=_0x41e5b6['host'];_0x4e6152['port']=_0x41e5b6['port']||0x3e1;if(_0x41e5b6['tls']){_0x4e6152[_0x14c5('0x20')]=!![];}else{_0x4e6152[_0x14c5('0x20')]=![];_0x4e6152['autotls']='required';}}else{_0x4e6152[_0x14c5('0x1d')]=_0x41e5b6['user'];_0x4e6152[_0x14c5('0x1e')]=_0x41e5b6[_0x14c5('0x1e')];_0x4e6152['host']=utils[_0x14c5('0x21')](_0x41e5b6[_0x14c5('0x1b')]);_0x4e6152[_0x14c5('0x22')]=0x3e1;_0x4e6152[_0x14c5('0x20')]=!![];}_0x4e6152[_0x14c5('0xc')]=_0x304c41||_0x41e5b6[_0x14c5('0x1d')]||_0x14c5('0x23');return _0x4e6152;};EmailImap[_0x14c5('0x24')][_0x14c5('0x11')]=function(){this[_0x14c5('0x1')][_0x14c5('0x25')](this[_0x14c5('0xd')],![],this[_0x14c5('0x26')]['bind'](this));};EmailImap[_0x14c5('0x24')][_0x14c5('0x26')]=function(_0x2844c1,_0x2a532a){if(_0x2844c1){this[_0x14c5('0x27')](_0x2844c1,!![]);}else{this[_0x14c5('0x28')](_0x14c5('0x29'),_0x2a532a);this['readUnseen']();}};EmailImap[_0x14c5('0x24')]['handleCloseBox']=function(_0x2a5818){if(_0x2a5818){this['handleError'](_0x2a5818,!![]);}else{this[_0x14c5('0x1')][_0x14c5('0x13')]();}};EmailImap['prototype'][_0x14c5('0x2a')]=function(){this[_0x14c5('0x1')][_0x14c5('0x2b')]([_0x14c5('0x2c')],this[_0x14c5('0x2d')][_0x14c5('0x12')](this));};EmailImap[_0x14c5('0x24')][_0x14c5('0x2d')]=function(_0x410e80,_0xefc6ed){if(_0x410e80){this[_0x14c5('0x27')](_0x410e80,!![]);}else{if(_0xefc6ed[_0x14c5('0x2e')]){try{var _0x317128=this[_0x14c5('0x1')][_0x14c5('0x2f')](_0xefc6ed,{'bodies':'','markSeen':!![]});_0x317128['on'](_0x14c5('0x30'),this[_0x14c5('0x31')][_0x14c5('0x12')](this));_0x317128[_0x14c5('0x10')](_0x14c5('0x15'),this['handleFetchError'][_0x14c5('0x12')](this));_0x317128[_0x14c5('0x10')](_0x14c5('0x13'),this[_0x14c5('0x32')][_0x14c5('0x12')](this));}catch(_0x302a2b){logger[_0x14c5('0x15')](_0x302a2b);}}else{this['imap'][_0x14c5('0x33')](!![],this['handleCloseBox'][_0x14c5('0x12')](this));}}};EmailImap['prototype'][_0x14c5('0x31')]=function(_0x3743d8,_0x4a2747){_0x3743d8['on'](_0x14c5('0x34'),this[_0x14c5('0x35')][_0x14c5('0x12')](this));_0x3743d8[_0x14c5('0x10')](_0x14c5('0x36'),this['handleMessageAttributes'][_0x14c5('0x12')](this));_0x3743d8[_0x14c5('0x10')](_0x14c5('0x13'),this[_0x14c5('0x37')]['bind'](this));};EmailImap['prototype']['handleMessageBody']=function(_0xe23045,_0x41a084){simpleParser(_0xe23045,{'Iconv':Iconv},this[_0x14c5('0x38')][_0x14c5('0x12')](this));};EmailImap[_0x14c5('0x24')]['handleMessageAttributes']=function(_0x1339ce){};EmailImap[_0x14c5('0x24')][_0x14c5('0x37')]=function(){};EmailImap[_0x14c5('0x24')][_0x14c5('0x38')]=function(_0x2a376a,_0x66b9bd){if(_0x2a376a){logger[_0x14c5('0x15')](_0x2a376a);}else{var _0x1b55ee=this;utils[_0x14c5('0x39')](this[_0x14c5('0xf')],_0x66b9bd,function(_0x1e6622){_0x1b55ee[_0x14c5('0x28')](_0x14c5('0xc'),_0x1e6622);});}};EmailImap[_0x14c5('0x24')][_0x14c5('0x32')]=function(){this[_0x14c5('0x1')]['closeBox'](!![],this[_0x14c5('0x3a')][_0x14c5('0x12')](this));};EmailImap[_0x14c5('0x24')]['handleFetchError']=function(_0x4c3118){this[_0x14c5('0x27')](_0x4c3118);this[_0x14c5('0x1')]['closeBox'](!![],this[_0x14c5('0x3a')][_0x14c5('0x12')](this));};EmailImap[_0x14c5('0x24')][_0x14c5('0x14')]=function(){this[_0x14c5('0x28')](_0x14c5('0x13'));};EmailImap[_0x14c5('0x24')]['handleError']=function(_0x1bef08,_0x22e9fe){logger[_0x14c5('0x15')]('handleError',this[_0x14c5('0xf')]['email'],JSON[_0x14c5('0x3b')](_0x1bef08));var _0x18f4e8='';if(_0x1bef08){if(_0x1bef08[_0x14c5('0x3c')]){_0x18f4e8=_0x1bef08[_0x14c5('0x3c')];}else{for(var _0x21b70c in _0x1bef08){if(_0x1bef08[_0x14c5('0x3d')](_0x21b70c)){_0x18f4e8+=_['upperFirst'](_0x21b70c)+':\x20'+_0x1bef08[_0x21b70c]+'\x0a';}}}}if(_0x22e9fe){this[_0x14c5('0x1')]['end']();}else{this[_0x14c5('0x28')]('error',_0x18f4e8);this['emit'](_0x14c5('0x13'));}};module[_0x14c5('0x3e')]=EmailImap; \ No newline at end of file +var _0xdd9a=['required','getHost','email','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','account','handleCloseBox','textCode','hasOwnProperty','upperFirst','exports','path','imap','randomstring','mailparser','simpleParser','Iconv','EventEmitter','./utils','INBOX','getAccount','once','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','authTimeout','isNil','authentication','user','password','host','port','tls','autotls'];(function(_0x3399d8,_0x4d6da7){var _0x1a14b1=function(_0x141d18){while(--_0x141d18){_0x3399d8['push'](_0x3399d8['shift']());}};_0x1a14b1(++_0x4d6da7);}(_0xdd9a,0x95));var _0xadd9=function(_0x5867b2,_0x476123){_0x5867b2=_0x5867b2-0x0;var _0x388cc1=_0xdd9a[_0x5867b2];return _0x388cc1;};'use strict';var fs=require('fs');var path=require(_0xadd9('0x0'));var util=require('util');var Imap=require(_0xadd9('0x1'));var _=require('lodash');var rs=require(_0xadd9('0x2'));var simpleParser=require(_0xadd9('0x3'))[_0xadd9('0x4')];var Iconv=require('iconv')[_0xadd9('0x5')];var EventEmitter=require('events')[_0xadd9('0x6')];var utils=require(_0xadd9('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x1dc781,_0x297bd3){this['mailbox']=_0xadd9('0x8');this['account']=this[_0xadd9('0x9')](_0x1dc781,_0x297bd3);this['imap']=new Imap(this['account']);this[_0xadd9('0x1')][_0xadd9('0xa')]('ready',this[_0xadd9('0xb')][_0xadd9('0xc')](this));this[_0xadd9('0x1')][_0xadd9('0xa')](_0xadd9('0xd'),this[_0xadd9('0xe')]['bind'](this));this[_0xadd9('0x1')]['on'](_0xadd9('0xf'),this['handleError']['bind'](this));this['imap'][_0xadd9('0x10')]();}util[_0xadd9('0x11')](EmailImap,EventEmitter);EmailImap[_0xadd9('0x12')][_0xadd9('0x9')]=function(_0x29f16a,_0x4aea21){var _0x570e94={'connTimeout':_0x29f16a['connTimeout']?_0x29f16a['connTimeout']*0x3e8:0x2710,'authTimeout':_0x29f16a['authTimeout']?_0x29f16a[_0xadd9('0x13')]*0x3e8:0x1388};if(_[_0xadd9('0x14')](_0x29f16a['service'])){if(_0x29f16a[_0xadd9('0x15')]){_0x570e94[_0xadd9('0x16')]=_0x29f16a['user'];_0x570e94[_0xadd9('0x17')]=_0x29f16a[_0xadd9('0x17')];}_0x570e94['host']=_0x29f16a[_0xadd9('0x18')];_0x570e94[_0xadd9('0x19')]=_0x29f16a[_0xadd9('0x19')]||0x3e1;if(_0x29f16a[_0xadd9('0x1a')]){_0x570e94[_0xadd9('0x1a')]=!![];}else{_0x570e94[_0xadd9('0x1a')]=![];_0x570e94[_0xadd9('0x1b')]=_0xadd9('0x1c');}}else{_0x570e94[_0xadd9('0x16')]=_0x29f16a['user'];_0x570e94[_0xadd9('0x17')]=_0x29f16a['password'];_0x570e94[_0xadd9('0x18')]=utils[_0xadd9('0x1d')](_0x29f16a['service']);_0x570e94['port']=0x3e1;_0x570e94[_0xadd9('0x1a')]=!![];}_0x570e94[_0xadd9('0x1e')]=_0x4aea21||_0x29f16a[_0xadd9('0x16')]||_0xadd9('0x1f');return _0x570e94;};EmailImap[_0xadd9('0x12')][_0xadd9('0xb')]=function(){this[_0xadd9('0x1')][_0xadd9('0x20')](this[_0xadd9('0x21')],![],this[_0xadd9('0x22')][_0xadd9('0xc')](this));};EmailImap[_0xadd9('0x12')]['handleOpenBox']=function(_0x294807,_0x1bc539){if(_0x294807){this[_0xadd9('0x23')](_0x294807,!![]);}else{this[_0xadd9('0x24')](_0xadd9('0x25'),_0x1bc539);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x1f45b9){if(_0x1f45b9){this[_0xadd9('0x23')](_0x1f45b9,!![]);}else{this['imap']['end']();}};EmailImap[_0xadd9('0x12')][_0xadd9('0x26')]=function(){this[_0xadd9('0x1')]['search']([_0xadd9('0x27')],this[_0xadd9('0x28')][_0xadd9('0xc')](this));};EmailImap[_0xadd9('0x12')][_0xadd9('0x28')]=function(_0x2ba18b,_0x5d7af5){if(_0x2ba18b){this['handleError'](_0x2ba18b,!![]);}else{if(_0x5d7af5[_0xadd9('0x29')]){try{var _0x3cd6d0=this[_0xadd9('0x1')][_0xadd9('0x2a')](_0x5d7af5,{'bodies':'','markSeen':!![]});_0x3cd6d0['on']('message',this[_0xadd9('0x2b')]['bind'](this));_0x3cd6d0[_0xadd9('0xa')](_0xadd9('0xf'),this[_0xadd9('0x2c')][_0xadd9('0xc')](this));_0x3cd6d0[_0xadd9('0xa')]('end',this[_0xadd9('0x2d')][_0xadd9('0xc')](this));}catch(_0xad1b85){logger[_0xadd9('0xf')](_0xad1b85);}}else{this['imap'][_0xadd9('0x2e')](!![],this['handleCloseBox'][_0xadd9('0xc')](this));}}};EmailImap[_0xadd9('0x12')][_0xadd9('0x2b')]=function(_0x7d4501,_0x539b05){_0x7d4501['on'](_0xadd9('0x2f'),this[_0xadd9('0x30')][_0xadd9('0xc')](this));_0x7d4501[_0xadd9('0xa')](_0xadd9('0x31'),this[_0xadd9('0x32')]['bind'](this));_0x7d4501[_0xadd9('0xa')](_0xadd9('0xd'),this[_0xadd9('0x33')]['bind'](this));};EmailImap[_0xadd9('0x12')][_0xadd9('0x30')]=function(_0x54eeb1,_0x45c2f6){simpleParser(_0x54eeb1,{'Iconv':Iconv},this[_0xadd9('0x34')][_0xadd9('0xc')](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x5a768d){};EmailImap[_0xadd9('0x12')]['handleMessageEnd']=function(){};EmailImap[_0xadd9('0x12')][_0xadd9('0x34')]=function(_0x279fce,_0x3c2ce8){if(_0x279fce){logger['error'](_0x279fce);}else{var _0x1b3550=this;utils['parser'](this[_0xadd9('0x35')],_0x3c2ce8,function(_0x2ff82c){_0x1b3550[_0xadd9('0x24')]('email',_0x2ff82c);});}};EmailImap[_0xadd9('0x12')][_0xadd9('0x2d')]=function(){this['imap'][_0xadd9('0x2e')](!![],this[_0xadd9('0x36')]['bind'](this));};EmailImap[_0xadd9('0x12')]['handleFetchError']=function(_0xddccd4){this['handleError'](_0xddccd4);this[_0xadd9('0x1')][_0xadd9('0x2e')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xadd9('0x12')][_0xadd9('0xe')]=function(){this['emit']('end');};EmailImap[_0xadd9('0x12')]['handleError']=function(_0x39dbde,_0x39b5ef){logger[_0xadd9('0xf')](_0xadd9('0x23'),this[_0xadd9('0x35')][_0xadd9('0x1e')],JSON['stringify'](_0x39dbde));var _0x55b166='';if(_0x39dbde){if(_0x39dbde[_0xadd9('0x37')]){_0x55b166=_0x39dbde['textCode'];}else{for(var _0xb0f0dd in _0x39dbde){if(_0x39dbde[_0xadd9('0x38')](_0xb0f0dd)){_0x55b166+=_[_0xadd9('0x39')](_0xb0f0dd)+':\x20'+_0x39dbde[_0xb0f0dd]+'\x0a';}}}}if(_0x39b5ef){this['imap']['end']();}else{this[_0xadd9('0x24')]('error',_0x55b166);this[_0xadd9('0x24')](_0xadd9('0xd'));}};module[_0xadd9('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 04a7101..0ea4fc1 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 _0x8ab7=['prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x8ab7,0x142));var _0x78ab=function(_0x48d5ad,_0x1f9e90){_0x48d5ad=_0x48d5ad-0x0;var _0x12f5fc=_0x8ab7[_0x48d5ad];return _0x12f5fc;};'use strict';var nodemailer=require(_0x78ab('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x78ab('0x1'));function EmailSmtp(){}EmailSmtp[_0x78ab('0x2')][_0x78ab('0x3')]=function(_0x5b0db0,_0x790851){return new BPromise(function(_0x3bc3d9,_0x109713){var _0x13fd79=nodemailer[_0x78ab('0x4')](_0x5b0db0);_0x13fd79[_0x78ab('0x5')](_0x78ab('0x6'),inlineBase64());_0x13fd79[_0x78ab('0x7')](_0x790851,function(_0x3cfa89,_0x535054){if(_0x3cfa89){_0x109713(_0x3cfa89[_0x78ab('0x8')]());}else{_0x3bc3d9(_0x535054);}});});};EmailSmtp[_0x78ab('0x2')]['verify']=function(_0x32e033){return new BPromise(function(_0x382ffc,_0x589124){var _0x1ca373=nodemailer['createTransport'](_0x32e033);_0x1ca373[_0x78ab('0x9')](function(_0x805fe3,_0x3a9ab7){if(_0x805fe3){_0x589124(_0x805fe3[_0x78ab('0x8')]());}else{if(_0x3a9ab7){_0x382ffc(_0x3a9ab7);}else{_0x589124(_0x78ab('0xa'));}}});});};module[_0x78ab('0xb')]=EmailSmtp; \ No newline at end of file +var _0x5f43=['use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x42cdc3,_0xf611af){var _0x38caa0=function(_0x126cd5){while(--_0x126cd5){_0x42cdc3['push'](_0x42cdc3['shift']());}};_0x38caa0(++_0xf611af);}(_0x5f43,0x14c));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0x35f4('0x0'));var BPromise=require(_0x35f4('0x1'));var inlineBase64=require(_0x35f4('0x2'));function EmailSmtp(){}EmailSmtp[_0x35f4('0x3')][_0x35f4('0x4')]=function(_0x5230f4,_0x19dd08){return new BPromise(function(_0x17306e,_0x3b830c){var _0x24bfec=nodemailer[_0x35f4('0x5')](_0x5230f4);_0x24bfec[_0x35f4('0x6')](_0x35f4('0x7'),inlineBase64());_0x24bfec[_0x35f4('0x8')](_0x19dd08,function(_0x1d6cb6,_0x155c4c){if(_0x1d6cb6){_0x3b830c(_0x1d6cb6[_0x35f4('0x9')]());}else{_0x17306e(_0x155c4c);}});});};EmailSmtp['prototype']['verify']=function(_0x320368){return new BPromise(function(_0xcd7ed8,_0x1926af){var _0x1fc915=nodemailer[_0x35f4('0x5')](_0x320368);_0x1fc915[_0x35f4('0xa')](function(_0x35a0f6,_0x2c2b37){if(_0x35a0f6){_0x1926af(_0x35a0f6[_0x35f4('0x9')]());}else{if(_0x2c2b37){_0xcd7ed8(_0x2c2b37);}else{_0x1926af(_0x35f4('0xb'));}}});});};module[_0x35f4('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 096e532..5fd8826 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 _0xcd3a=['address','anonymous','@xcally.com','value','name','split','slice','join','Anonymous','head','length','pop','isEmpty','generate','html','test','replace','body','Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','../../../config/logger','../../../config/environment'];(function(_0x19a22c,_0x13c898){var _0x5e96b8=function(_0x40ad05){while(--_0x40ad05){_0x19a22c['push'](_0x19a22c['shift']());}};_0x5e96b8(++_0x13c898);}(_0xcd3a,0x179));var _0xacd3=function(_0x124555,_0x2f5784){_0x124555=_0x124555-0x0;var _0xb8690d=_0xcd3a[_0x124555];return _0xb8690d;};'use strict';var _=require(_0xacd3('0x0'));var moment=require(_0xacd3('0x1'));var random=require(_0xacd3('0x2'));var fs=require('fs');var path=require(_0xacd3('0x3'));var util=require(_0xacd3('0x4'));var tnef=require('node-tnef');var logger=require(_0xacd3('0x5'))('email');var config=require(_0xacd3('0x6'));function getAddress(_0x249faa){var _0x40373b=_['head'](_0x249faa['value']);return _0x40373b&&_0x40373b['address']?_0x40373b[_0xacd3('0x7')]:_0xacd3('0x8')+random['generate'](0x6)+_0xacd3('0x9');}function getFirstName(_0x35322e){var _0x45671b=_['head'](_0x35322e[_0xacd3('0xa')]);if(_0x45671b&&_0x45671b[_0xacd3('0xb')]){var _0x36c4d8=_0x45671b[_0xacd3('0xb')][_0xacd3('0xc')](/\s+/);return _0x36c4d8['length']?_0x36c4d8[_0xacd3('0xd')](0x0,-0x1)[_0xacd3('0xe')]('\x20'):_0x45671b[_0xacd3('0xb')];}return _0xacd3('0xf');}function getLastName(_0x2ec1a4){var _0x55adcd=_[_0xacd3('0x10')](_0x2ec1a4[_0xacd3('0xa')]);if(_0x55adcd&&_0x55adcd[_0xacd3('0xb')]){var _0x44b155=_0x55adcd['name'][_0xacd3('0xc')](/\s+/);return _0x44b155[_0xacd3('0x11')]>0x1?_0x44b155[_0xacd3('0x12')]():'';}return'';}function getMails(_0x25c4e5,_0xf4a192){var _0x379214='';for(var _0x311abd=0x0;_0x311abd<_0xf4a192[_0xacd3('0xa')]['length'];_0x311abd+=0x1){if(_0xf4a192[_0xacd3('0xa')][_0x311abd][_0xacd3('0x7')]!==_0x25c4e5){if(!_[_0xacd3('0x13')](_0x379214)){_0x379214+=',';}_0x379214+=_0xf4a192[_0xacd3('0xa')][_0x311abd][_0xacd3('0xb')]||_0xf4a192[_0xacd3('0xa')][_0x311abd][_0xacd3('0x7')]||'';_0x379214+='\x20<';_0x379214+=_0xf4a192[_0xacd3('0xa')][_0x311abd][_0xacd3('0x7')]?_0xf4a192[_0xacd3('0xa')][_0x311abd][_0xacd3('0x7')]:_0xacd3('0x8')+random[_0xacd3('0x14')](0x6)+_0xacd3('0x9');_0x379214+='>';}}return _0x379214;}function parseEmail(_0x2ff9ea,_0x35bacb,_0x190f2f){if(_0x35bacb[_0xacd3('0x15')]){var _0x1bb27d=/)<[^<]*)*<\/script>/gi;while(_0x1bb27d[_0xacd3('0x16')](_0x35bacb[_0xacd3('0x15')])){_0x35bacb[_0xacd3('0x15')]=_0x35bacb[_0xacd3('0x15')][_0xacd3('0x17')](_0x1bb27d,'');}_0x190f2f['body']=_0x35bacb[_0xacd3('0x15')];}else{_0x190f2f[_0xacd3('0x18')]=_0x35bacb['textAsHtml'];}if(_0x190f2f[_0xacd3('0x18')]){_0x190f2f['body']=_0x190f2f[_0xacd3('0x18')][_0xacd3('0x17')](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','address','@xcally.com','value','name','length','slice','join','Anonymous','split','pop','isEmpty','anonymous','html','test','body','textAsHtml','replace','0x1?_0x5a49a4[_0xe655('0x12')]():'';}return'';}function getMails(_0x478b3c,_0x25a4ae){var _0x3ea548='';for(var _0x4b9e74=0x0;_0x4b9e74<_0x25a4ae[_0xe655('0xb')]['length'];_0x4b9e74+=0x1){if(_0x25a4ae['value'][_0x4b9e74][_0xe655('0x9')]!==_0x478b3c){if(!_[_0xe655('0x13')](_0x3ea548)){_0x3ea548+=',';}_0x3ea548+=_0x25a4ae[_0xe655('0xb')][_0x4b9e74][_0xe655('0xc')]||_0x25a4ae[_0xe655('0xb')][_0x4b9e74][_0xe655('0x9')]||'';_0x3ea548+='\x20<';_0x3ea548+=_0x25a4ae[_0xe655('0xb')][_0x4b9e74]['address']?_0x25a4ae[_0xe655('0xb')][_0x4b9e74]['address']:_0xe655('0x14')+random['generate'](0x6)+_0xe655('0xa');_0x3ea548+='>';}}return _0x3ea548;}function parseEmail(_0x5b2170,_0x1131e1,_0x67bb4d){if(_0x1131e1[_0xe655('0x15')]){var _0x1d3f13=/)<[^<]*)*<\/script>/gi;while(_0x1d3f13[_0xe655('0x16')](_0x1131e1[_0xe655('0x15')])){_0x1131e1[_0xe655('0x15')]=_0x1131e1[_0xe655('0x15')]['replace'](_0x1d3f13,'');}_0x67bb4d[_0xe655('0x17')]=_0x1131e1[_0xe655('0x15')];}else{_0x67bb4d[_0xe655('0x17')]=_0x1131e1[_0xe655('0x18')];}if(_0x67bb4d[_0xe655('0x17')]){_0x67bb4d['body']=_0x67bb4d[_0xe655('0x17')][_0xe655('0x19')](/0x0){if(this[_0x190ccd+'Capacity']>0x0&&this[_0x190ccd+_0xde35('0x28')]>=this[_0x190ccd+'Capacity']){return _0xde35('0x29');}else{return _0xde35('0x2a');}}else{return'idle';}};Agent[_0xde35('0x26')][_0xde35('0x25')]=function(){var _0xbbb922=['mail',_0xde35('0x2b'),_0xde35('0x2c'),_0xde35('0x2d'),_0xde35('0x2e'),_0xde35('0x2f')];for(var _0x1b3a37=0x0;_0x1b3a37<_0xbbb922[_0xde35('0x30')];_0x1b3a37+=0x1){var _0x4a29a2=this[_0xde35('0x27')](_0xbbb922[_0x1b3a37]);if(this[_0xbbb922[_0x1b3a37]+'Status']!==_0x4a29a2){this[_0xbbb922[_0x1b3a37]+_0xde35('0x31')]=_[_0xde35('0x32')](moment()[_0xde35('0x33')]('x'));}this[_0xbbb922[_0x1b3a37]+_0xde35('0x34')]=_0x4a29a2;}var _0x52a08a={'id':this['id'],'name':this[_0xde35('0x7')],'online':this[_0xde35('0x8')],'voicePause':this[_0xde35('0x9')],'chatPause':this[_0xde35('0xa')],'mailPause':this[_0xde35('0xb')],'smsPause':this[_0xde35('0xd')],'faxPause':this[_0xde35('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xde35('0xf')],'chatStatusTime':this[_0xde35('0x10')],'chatCapacity':this[_0xde35('0x11')],'chatCurrentCapacity':this[_0xde35('0x35')],'mailStatus':this[_0xde35('0x36')],'mailStatusTime':this[_0xde35('0x37')],'mailCapacity':this[_0xde35('0x12')],'mailCurrentCapacity':this[_0xde35('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xde35('0x14')],'faxCapacity':this[_0xde35('0x15')],'faxCurrentCapacity':this[_0xde35('0x16')],'smsStatus':this[_0xde35('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xde35('0x1a')],'whatsappStatus':this[_0xde35('0x1b')],'whatsappStatusTime':this[_0xde35('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xde35('0x38')],'openchannelStatus':this[_0xde35('0x39')],'openchannelStatusTime':this[_0xde35('0x1f')],'openchannelCapacity':this[_0xde35('0x20')],'openchannelCurrentCapacity':this[_0xde35('0x21')],'busy':this['busy'],'busyQueue':this[_0xde35('0x23')]};var _0x2aae80=md5(JSON['stringify'](_0x52a08a));if(this[_0xde35('0x24')]!==_0x2aae80){this[_0xde35('0x24')]=_0x2aae80;io[_0xde35('0x3a')](_0xde35('0x3b'),_0x52a08a);}};module[_0xde35('0x3c')]=Agent; \ No newline at end of file +var _0xbb59=['sms','whatsapp','Status','toNumber','format','faxStatus','faxStatusTime','openchannelStatus','openchannelCurrentCapacity','stringify','emit','exports','lodash','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb59,0xec));var _0x9bb5=function(_0x83a6ab,_0x52e78f){_0x83a6ab=_0x83a6ab-0x0;var _0x976806=_0xbb59[_0x83a6ab];return _0x976806;};'use strict';var _=require(_0x9bb5('0x0'));var moment=require(_0x9bb5('0x1'));var md5=require(_0x9bb5('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x9bb5('0x3')]=_[_0x9bb5('0x4')](config[_0x9bb5('0x3')],{'host':_0x9bb5('0x5'),'port':0x18eb});var io=require(_0x9bb5('0x6'))(new Redis(config['redis']));function Agent(_0x3b2795){this['id']=_0x3b2795['id']||0x0;this[_0x9bb5('0x7')]=_0x3b2795[_0x9bb5('0x7')]||'';this[_0x9bb5('0x8')]=_0x3b2795[_0x9bb5('0x8')]||!![];this[_0x9bb5('0x9')]=_0x3b2795[_0x9bb5('0x9')]||![];this[_0x9bb5('0xa')]=_0x3b2795[_0x9bb5('0xa')]||![];this[_0x9bb5('0xb')]=_0x3b2795[_0x9bb5('0xb')]||![];this[_0x9bb5('0xc')]=_0x3b2795[_0x9bb5('0xc')]||![];this['smsPause']=_0x3b2795[_0x9bb5('0xd')]||![];this[_0x9bb5('0xe')]=_0x3b2795[_0x9bb5('0xe')]||![];this[_0x9bb5('0xf')]=_0x9bb5('0x10');this[_0x9bb5('0x11')]=0x0;this[_0x9bb5('0x12')]=_0x3b2795[_0x9bb5('0x12')]||0x0;this[_0x9bb5('0x13')]=0x0;this[_0x9bb5('0x14')]=_0x9bb5('0x10');this[_0x9bb5('0x15')]=0x0;this[_0x9bb5('0x16')]=_0x3b2795[_0x9bb5('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x9bb5('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x3b2795[_0x9bb5('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x9bb5('0x18')]=_0x9bb5('0x10');this[_0x9bb5('0x19')]=0x0;this['smsCapacity']=_0x3b2795[_0x9bb5('0x1a')]||0x0;this[_0x9bb5('0x1b')]=0x0;this[_0x9bb5('0x1c')]=_0x9bb5('0x10');this[_0x9bb5('0x1d')]=0x0;this[_0x9bb5('0x1e')]=_0x3b2795[_0x9bb5('0x1e')]||0x0;this[_0x9bb5('0x1f')]=0x0;this['openchannelStatus']='unknown';this[_0x9bb5('0x20')]=0x0;this[_0x9bb5('0x21')]=_0x3b2795['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x9bb5('0x22')]=![];this[_0x9bb5('0x23')]=undefined;this[_0x9bb5('0x2')]='';this['updateRealtime']();}Agent[_0x9bb5('0x24')][_0x9bb5('0x25')]=function(_0x2a15b8){if(this[_0x2a15b8+_0x9bb5('0x26')]>0x0){if(this[_0x2a15b8+'Capacity']>0x0&&this[_0x2a15b8+_0x9bb5('0x26')]>=this[_0x2a15b8+_0x9bb5('0x27')]){return'maxcapacity';}else{return _0x9bb5('0x28');}}else{return'idle';}};Agent[_0x9bb5('0x24')]['updateRealtime']=function(){var _0x4be52b=[_0x9bb5('0x29'),_0x9bb5('0x2a'),'openchannel',_0x9bb5('0x2b'),_0x9bb5('0x2c'),_0x9bb5('0x2d')];for(var _0x5cf6ef=0x0;_0x5cf6ef<_0x4be52b['length'];_0x5cf6ef+=0x1){var _0x12b230=this[_0x9bb5('0x25')](_0x4be52b[_0x5cf6ef]);if(this[_0x4be52b[_0x5cf6ef]+_0x9bb5('0x2e')]!==_0x12b230){this[_0x4be52b[_0x5cf6ef]+'StatusTime']=_[_0x9bb5('0x2f')](moment()[_0x9bb5('0x30')]('x'));}this[_0x4be52b[_0x5cf6ef]+_0x9bb5('0x2e')]=_0x12b230;}var _0x4b38d5={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0x9bb5('0x9')],'chatPause':this[_0x9bb5('0xa')],'mailPause':this[_0x9bb5('0xb')],'smsPause':this[_0x9bb5('0xd')],'faxPause':this[_0x9bb5('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x9bb5('0x12')],'chatCurrentCapacity':this[_0x9bb5('0x13')],'mailStatus':this[_0x9bb5('0x14')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9bb5('0x31')],'faxStatusTime':this[_0x9bb5('0x32')],'faxCapacity':this[_0x9bb5('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x9bb5('0x19')],'smsCapacity':this[_0x9bb5('0x1a')],'smsCurrentCapacity':this[_0x9bb5('0x1b')],'whatsappStatus':this[_0x9bb5('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x9bb5('0x1e')],'whatsappCurrentCapacity':this[_0x9bb5('0x1f')],'openchannelStatus':this[_0x9bb5('0x33')],'openchannelStatusTime':this[_0x9bb5('0x20')],'openchannelCapacity':this[_0x9bb5('0x21')],'openchannelCurrentCapacity':this[_0x9bb5('0x34')],'busy':this[_0x9bb5('0x22')],'busyQueue':this['busyQueue']};var _0x5d7841=md5(JSON[_0x9bb5('0x35')](_0x4b38d5));if(this[_0x9bb5('0x2')]!==_0x5d7841){this['md5']=_0x5d7841;io[_0x9bb5('0x36')]('user:save',_0x4b38d5);}};module[_0x9bb5('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 9319830..a01d844 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 _0x3163=['md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','waiting','prototype','_rr','mapAgentsId','updateRealtime','loggedIn','paused','length','online','available','stringify','chat_queue:save','exports'];(function(_0x9b346f,_0x5218f7){var _0x1683a6=function(_0x56141c){while(--_0x56141c){_0x9b346f['push'](_0x9b346f['shift']());}};_0x1683a6(++_0x5218f7);}(_0x3163,0x159));var _0x3316=function(_0x1aa9bd,_0xb7e622){_0x1aa9bd=_0x1aa9bd-0x0;var _0x1260bb=_0x3163[_0x1aa9bd];return _0x1260bb;};'use strict';var _=require('lodash');var md5=require(_0x3316('0x0'));var util=require('util');var Redis=require(_0x3316('0x1'));var config=require(_0x3316('0x2'));config['redis']=_[_0x3316('0x3')](config[_0x3316('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x3316('0x5'))(new Redis(config[_0x3316('0x4')]));function ChatQueue(_0x2a6987){this['id']=_0x2a6987['id']||0x0;this[_0x3316('0x6')]=_0x2a6987[_0x3316('0x6')]||'';this[_0x3316('0x7')]=_0x2a6987['timeout']||0xa;this['strategy']=_0x2a6987[_0x3316('0x8')]||'beepall';this[_0x3316('0x9')]=_0x2a6987[_0x3316('0x9')];this['mapAgentsId']={};this[_0x3316('0xa')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x3316('0xb')]['updateRouting']=function(){var _0x3c87c3=this['mapAgentsId'][_0x3316('0xc')];this[_0x3316('0xd')]=_['map'](this[_0x3316('0x9')],'id');this[_0x3316('0xd')][_0x3316('0xc')]=_0x3c87c3;};ChatQueue[_0x3316('0xb')][_0x3316('0xe')]=function(){this[_0x3316('0xf')]=0x0;this[_0x3316('0x10')]=0x0;for(var _0x5c6aa0=0x0;_0x5c6aa0=0x0?this[_0x3316('0x13')]:0x0;var _0x57d522={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3316('0xf')],'name':this['name'],'paused':this[_0x3316('0x10')],'waiting':this['waiting']};var _0x597115=md5(JSON[_0x3316('0x14')](_0x57d522));if(this['md5']!==_0x597115){this[_0x3316('0x0')]=_0x597115;io['to'](util['format']('chat:queue:%s',_0x57d522[_0x3316('0x6')]))['emit'](_0x3316('0x15'),_0x57d522);}};module[_0x3316('0x16')]=ChatQueue; \ No newline at end of file +var _0x4a55=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost'];(function(_0x5a280a,_0xd1c6e8){var _0x20a1df=function(_0x2bfee9){while(--_0x2bfee9){_0x5a280a['push'](_0x5a280a['shift']());}};_0x20a1df(++_0xd1c6e8);}(_0x4a55,0x107));var _0x54a5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4a55[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x54a5('0x0'));var md5=require(_0x54a5('0x1'));var util=require(_0x54a5('0x2'));var Redis=require(_0x54a5('0x3'));var config=require(_0x54a5('0x4'));config['redis']=_[_0x54a5('0x5')](config['redis'],{'host':_0x54a5('0x6'),'port':0x18eb});var io=require(_0x54a5('0x7'))(new Redis(config['redis']));function ChatQueue(_0x55ac78){this['id']=_0x55ac78['id']||0x0;this[_0x54a5('0x8')]=_0x55ac78[_0x54a5('0x8')]||'';this[_0x54a5('0x9')]=_0x55ac78[_0x54a5('0x9')]||0xa;this['strategy']=_0x55ac78[_0x54a5('0xa')]||_0x54a5('0xb');this[_0x54a5('0xc')]=_0x55ac78[_0x54a5('0xc')];this[_0x54a5('0xd')]={};this[_0x54a5('0xe')]=0x0;this[_0x54a5('0x1')]='';this[_0x54a5('0xf')]();this[_0x54a5('0x10')]();}ChatQueue[_0x54a5('0x11')][_0x54a5('0xf')]=function(){var _0x3335da=this[_0x54a5('0xd')][_0x54a5('0x12')];this[_0x54a5('0xd')]=_[_0x54a5('0x13')](this[_0x54a5('0xc')],'id');this[_0x54a5('0xd')][_0x54a5('0x12')]=_0x3335da;};ChatQueue[_0x54a5('0x11')][_0x54a5('0x10')]=function(){this[_0x54a5('0x14')]=0x0;this[_0x54a5('0x15')]=0x0;for(var _0x318d06=0x0;_0x318d06=0x0?this[_0x54a5('0x18')]:0x0;var _0x4fbfba={'id':this['id'],'available':this[_0x54a5('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x54a5('0x8')],'paused':this['paused'],'waiting':this[_0x54a5('0xe')]};var _0x5b540a=md5(JSON[_0x54a5('0x19')](_0x4fbfba));if(this[_0x54a5('0x1')]!==_0x5b540a){this[_0x54a5('0x1')]=_0x5b540a;io['to'](util['format'](_0x54a5('0x1a'),_0x4fbfba[_0x54a5('0x8')]))[_0x54a5('0x1b')](_0x54a5('0x1c'),_0x4fbfba);}};module[_0x54a5('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index a85ac33..4c46ce0 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(_0x32e3bd,_0x63121b){var _0x541ab9=function(_0xf41130){while(--_0xf41130){_0x32e3bd['push'](_0x32e3bd['shift']());}};_0x541ab9(++_0x63121b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x3b6fb8,_0x28c172){var _0x5c16e0=function(_0x67d693){while(--_0x67d693){_0x3b6fb8['push'](_0x3b6fb8['shift']());}};_0x5c16e0(++_0x28c172);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 2c5e2bc..2f070bd 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 _0xe2ca=['Intervals','exports','name'];(function(_0x216008,_0x2d1023){var _0x4d384f=function(_0x3fd7e2){while(--_0x3fd7e2){_0x216008['push'](_0x216008['shift']());}};_0x4d384f(++_0x2d1023);}(_0xe2ca,0x1e8));var _0xae2c=function(_0x4543cc,_0xb1ddeb){_0x4543cc=_0x4543cc-0x0;var _0x245a31=_0xe2ca[_0x4543cc];return _0x245a31;};'use strict';function Interval(_0x2707a3){this['id']=_0x2707a3['id']||0x0;this[_0xae2c('0x0')]=_0x2707a3[_0xae2c('0x0')]||'';this['Intervals']=_0x2707a3[_0xae2c('0x1')]||{};}module[_0xae2c('0x2')]=Interval; \ No newline at end of file +var _0x1387=['Intervals','exports','name'];(function(_0x271fb2,_0x2a55e1){var _0x802dc8=function(_0x3ae7e8){while(--_0x3ae7e8){_0x271fb2['push'](_0x271fb2['shift']());}};_0x802dc8(++_0x2a55e1);}(_0x1387,0x65));var _0x7138=function(_0x1f6875,_0x6859db){_0x1f6875=_0x1f6875-0x0;var _0x5860b9=_0x1387[_0x1f6875];return _0x5860b9;};'use strict';function Interval(_0x2c3baf){this['id']=_0x2c3baf['id']||0x0;this[_0x7138('0x0')]=_0x2c3baf[_0x7138('0x0')]||'';this[_0x7138('0x1')]=_0x2c3baf[_0x7138('0x1')]||{};}module[_0x7138('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 c3f17fb..8e0043e 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 _0xb839=['updateRouting','updateRealtime','mapAgentsId','_rr','paused','length','mailPause','available','loggedIn','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','md5'];(function(_0x13a96e,_0xfc4ed5){var _0x3b5bdc=function(_0x408d77){while(--_0x408d77){_0x13a96e['push'](_0x13a96e['shift']());}};_0x3b5bdc(++_0xfc4ed5);}(_0xb839,0x11d));var _0x9b83=function(_0x2e550d,_0x2d683c){_0x2e550d=_0x2e550d-0x0;var _0x13eafc=_0xb839[_0x2e550d];return _0x13eafc;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x9b83('0x0'));var Redis=require(_0x9b83('0x1'));var config=require(_0x9b83('0x2'));config['redis']=_[_0x9b83('0x3')](config[_0x9b83('0x4')],{'host':_0x9b83('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9b83('0x4')]));function MailQueue(_0x4e8d5f){this['id']=_0x4e8d5f['id']||0x0;this['name']=_0x4e8d5f[_0x9b83('0x6')]||'';this['timeout']=_0x4e8d5f[_0x9b83('0x7')]||0xa;this[_0x9b83('0x8')]=_0x4e8d5f[_0x9b83('0x8')]||_0x9b83('0x9');this['Agents']=_0x4e8d5f[_0x9b83('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x9b83('0xb')]='';this[_0x9b83('0xc')]();this[_0x9b83('0xd')]();}MailQueue['prototype'][_0x9b83('0xc')]=function(){var _0x52162d=this[_0x9b83('0xe')][_0x9b83('0xf')];this[_0x9b83('0xe')]=_['map'](this[_0x9b83('0xa')],'id');this['mapAgentsId']['_rr']=_0x52162d;};MailQueue['prototype'][_0x9b83('0xd')]=function(){this['loggedIn']=0x0;this[_0x9b83('0x10')]=0x0;for(var _0x303402=0x0;_0x303402=0x0?this['available']:0x0;var _0x1b5825={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9b83('0x14')],'name':this[_0x9b83('0x6')],'paused':this[_0x9b83('0x10')],'waiting':this['waiting']};var _0xf2d0ed=md5(JSON[_0x9b83('0x15')](_0x1b5825));if(this['md5']!==_0xf2d0ed){this['md5']=_0xf2d0ed;io['to'](util[_0x9b83('0x16')](_0x9b83('0x17'),_0x1b5825[_0x9b83('0x6')]))[_0x9b83('0x18')](_0x9b83('0x19'),_0x1b5825);}};module[_0x9b83('0x1a')]=MailQueue; \ No newline at end of file +var _0x49c1=['lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','emit'];(function(_0x292b04,_0x4526f9){var _0x392195=function(_0x498e8e){while(--_0x498e8e){_0x292b04['push'](_0x292b04['shift']());}};_0x392195(++_0x4526f9);}(_0x49c1,0x16c));var _0x149c=function(_0x35187d,_0x1bcc56){_0x35187d=_0x35187d-0x0;var _0x2b4ceb=_0x49c1[_0x35187d];return _0x2b4ceb;};'use strict';var _=require(_0x149c('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x149c('0x1'));var config=require(_0x149c('0x2'));config[_0x149c('0x3')]=_['defaults'](config[_0x149c('0x3')],{'host':_0x149c('0x4'),'port':0x18eb});var io=require(_0x149c('0x5'))(new Redis(config[_0x149c('0x3')]));function MailQueue(_0x35cd29){this['id']=_0x35cd29['id']||0x0;this[_0x149c('0x6')]=_0x35cd29[_0x149c('0x6')]||'';this['timeout']=_0x35cd29[_0x149c('0x7')]||0xa;this['strategy']=_0x35cd29[_0x149c('0x8')]||_0x149c('0x9');this['Agents']=_0x35cd29[_0x149c('0xa')];this[_0x149c('0xb')]={};this['waiting']=0x0;this[_0x149c('0xc')]='';this[_0x149c('0xd')]();this['updateRealtime']();}MailQueue[_0x149c('0xe')]['updateRouting']=function(){var _0x4ffc70=this[_0x149c('0xb')]['_rr'];this[_0x149c('0xb')]=_[_0x149c('0xf')](this[_0x149c('0xa')],'id');this['mapAgentsId'][_0x149c('0x10')]=_0x4ffc70;};MailQueue[_0x149c('0xe')][_0x149c('0x11')]=function(){this[_0x149c('0x12')]=0x0;this[_0x149c('0x13')]=0x0;for(var _0x5359fb=0x0;_0x5359fb=0x0?this[_0x149c('0x17')]:0x0;var _0xa2f9e4={'id':this['id'],'available':this[_0x149c('0x17')],'loggedIn':this[_0x149c('0x12')],'name':this[_0x149c('0x6')],'paused':this[_0x149c('0x13')],'waiting':this[_0x149c('0x18')]};var _0x59526a=md5(JSON[_0x149c('0x19')](_0xa2f9e4));if(this[_0x149c('0xc')]!==_0x59526a){this['md5']=_0x59526a;io['to'](util[_0x149c('0x1a')]('mail:queue:%s',_0xa2f9e4[_0x149c('0x6')]))[_0x149c('0x1b')]('mail_queue:save',_0xa2f9e4);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index fd40ab1..9c68086 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 _0xd030=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','available','format','emit','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x32ab72,_0x47dd1b){var _0x83eea5=function(_0x5dc26c){while(--_0x5dc26c){_0x32ab72['push'](_0x32ab72['shift']());}};_0x83eea5(++_0x47dd1b);}(_0xd030,0x161));var _0x0d03=function(_0x3daad4,_0x404a0b){_0x3daad4=_0x3daad4-0x0;var _0x128c0d=_0xd030[_0x3daad4];return _0x128c0d;};'use strict';var _=require(_0x0d03('0x0'));var md5=require(_0x0d03('0x1'));var util=require(_0x0d03('0x2'));var Redis=require(_0x0d03('0x3'));var config=require(_0x0d03('0x4'));config[_0x0d03('0x5')]=_['defaults'](config['redis'],{'host':_0x0d03('0x6'),'port':0x18eb});var io=require(_0x0d03('0x7'))(new Redis(config[_0x0d03('0x5')]));function OpenchannelQueue(_0x440b22){this['id']=_0x440b22['id']||0x0;this['name']=_0x440b22[_0x0d03('0x8')]||'';this[_0x0d03('0x9')]=_0x440b22[_0x0d03('0x9')]||0xa;this['strategy']=_0x440b22[_0x0d03('0xa')]||_0x0d03('0xb');this[_0x0d03('0xc')]=_0x440b22[_0x0d03('0xc')];this[_0x0d03('0xd')]={};this[_0x0d03('0xe')]=0x0;this[_0x0d03('0x1')]='';this['updateRouting']();this[_0x0d03('0xf')]();}OpenchannelQueue[_0x0d03('0x10')]['updateRouting']=function(){var _0x2dd78c=this[_0x0d03('0xd')]['_rr'];this['mapAgentsId']=_[_0x0d03('0x11')](this[_0x0d03('0xc')],'id');this['mapAgentsId'][_0x0d03('0x12')]=_0x2dd78c;};OpenchannelQueue[_0x0d03('0x10')][_0x0d03('0xf')]=function(){this[_0x0d03('0x13')]=0x0;this[_0x0d03('0x14')]=0x0;for(var _0x163416=0x0;_0x163416=0x0?this[_0x0d03('0x17')]:0x0;var _0x2ffdf8={'id':this['id'],'available':this[_0x0d03('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x0d03('0x8')],'paused':this[_0x0d03('0x14')],'waiting':this[_0x0d03('0xe')]};var _0x18360d=md5(JSON['stringify'](_0x2ffdf8));if(this[_0x0d03('0x1')]!==_0x18360d){this['md5']=_0x18360d;io['to'](util[_0x0d03('0x18')]('openchannel:queue:%s',_0x2ffdf8[_0x0d03('0x8')]))[_0x0d03('0x19')](_0x0d03('0x1a'),_0x2ffdf8);}};module[_0x0d03('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0x6b06=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','updateRealtime','loggedIn','paused','length','online','openchannelPause','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','md5','ioredis','redis','localhost','socket.io-emitter'];(function(_0x2dbbe5,_0xb7c79b){var _0x3af882=function(_0x190eb6){while(--_0x190eb6){_0x2dbbe5['push'](_0x2dbbe5['shift']());}};_0x3af882(++_0xb7c79b);}(_0x6b06,0x14d));var _0x66b0=function(_0x15ee34,_0x1633db){_0x15ee34=_0x15ee34-0x0;var _0x277a9d=_0x6b06[_0x15ee34];return _0x277a9d;};'use strict';var _=require('lodash');var md5=require(_0x66b0('0x0'));var util=require('util');var Redis=require(_0x66b0('0x1'));var config=require('../../../config/environment');config[_0x66b0('0x2')]=_['defaults'](config[_0x66b0('0x2')],{'host':_0x66b0('0x3'),'port':0x18eb});var io=require(_0x66b0('0x4'))(new Redis(config[_0x66b0('0x2')]));function OpenchannelQueue(_0x326c32){this['id']=_0x326c32['id']||0x0;this[_0x66b0('0x5')]=_0x326c32['name']||'';this[_0x66b0('0x6')]=_0x326c32['timeout']||0xa;this[_0x66b0('0x7')]=_0x326c32[_0x66b0('0x7')]||_0x66b0('0x8');this['Agents']=_0x326c32[_0x66b0('0x9')];this[_0x66b0('0xa')]={};this[_0x66b0('0xb')]=0x0;this[_0x66b0('0x0')]='';this[_0x66b0('0xc')]();this['updateRealtime']();}OpenchannelQueue[_0x66b0('0xd')][_0x66b0('0xc')]=function(){var _0x3a40d7=this['mapAgentsId']['_rr'];this[_0x66b0('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x3a40d7;};OpenchannelQueue[_0x66b0('0xd')][_0x66b0('0xe')]=function(){this[_0x66b0('0xf')]=0x0;this[_0x66b0('0x10')]=0x0;for(var _0x3e5bc1=0x0;_0x3e5bc1=0x0?this[_0x66b0('0x14')]:0x0;var _0x78afcd={'id':this['id'],'available':this[_0x66b0('0x14')],'loggedIn':this[_0x66b0('0xf')],'name':this[_0x66b0('0x5')],'paused':this[_0x66b0('0x10')],'waiting':this[_0x66b0('0xb')]};var _0x1bc4ae=md5(JSON[_0x66b0('0x15')](_0x78afcd));if(this[_0x66b0('0x0')]!==_0x1bc4ae){this[_0x66b0('0x0')]=_0x1bc4ae;io['to'](util['format'](_0x66b0('0x16'),_0x78afcd[_0x66b0('0x5')]))[_0x66b0('0x17')](_0x66b0('0x18'),_0x78afcd);}};module[_0x66b0('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9f70d21..4145591 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 _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(_0x42ab91,_0x2a0179){var _0x259d35=function(_0x2d48bf){while(--_0x2d48bf){_0x42ab91['push'](_0x42ab91['shift']());}};_0x259d35(++_0x2a0179);}(_0x757a,0xde));var _0xa757=function(_0x39ff0a,_0x377f81){_0x39ff0a=_0x39ff0a-0x0;var _0x2b0341=_0x757a[_0x39ff0a];return _0x2b0341;};'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 +var _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x1042d8,_0x44f71c){var _0x3da9f3=function(_0x553b1d){while(--_0x553b1d){_0x1042d8['push'](_0x1042d8['shift']());}};_0x3da9f3(++_0x44f71c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4306bac..90f0886 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf777=['paused','online','available','stringify','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn'];(function(_0x3abe5e,_0x515b4f){var _0x4c2e5e=function(_0x146f04){while(--_0x146f04){_0x3abe5e['push'](_0x3abe5e['shift']());}};_0x4c2e5e(++_0x515b4f);}(_0xf777,0x180));var _0x7f77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf777[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f77('0x0'));var md5=require(_0x7f77('0x1'));var util=require(_0x7f77('0x2'));var Redis=require(_0x7f77('0x3'));var config=require(_0x7f77('0x4'));config['redis']=_[_0x7f77('0x5')](config['redis'],{'host':_0x7f77('0x6'),'port':0x18eb});var io=require(_0x7f77('0x7'))(new Redis(config[_0x7f77('0x8')]));function WhatsappQueue(_0x3107f5){this['id']=_0x3107f5['id']||0x0;this[_0x7f77('0x9')]=_0x3107f5['name']||'';this[_0x7f77('0xa')]=_0x3107f5[_0x7f77('0xa')]||0xa;this[_0x7f77('0xb')]=_0x3107f5['strategy']||_0x7f77('0xc');this[_0x7f77('0xd')]=_0x3107f5[_0x7f77('0xd')];this[_0x7f77('0xe')]={};this[_0x7f77('0xf')]=0x0;this[_0x7f77('0x1')]='';this['updateRouting']();this[_0x7f77('0x10')]();}WhatsappQueue['prototype'][_0x7f77('0x11')]=function(){var _0x478468=this[_0x7f77('0xe')][_0x7f77('0x12')];this[_0x7f77('0xe')]=_[_0x7f77('0x13')](this[_0x7f77('0xd')],'id');this[_0x7f77('0xe')][_0x7f77('0x12')]=_0x478468;};WhatsappQueue[_0x7f77('0x14')][_0x7f77('0x10')]=function(){this[_0x7f77('0x15')]=0x0;this[_0x7f77('0x16')]=0x0;for(var _0x2174a2=0x0;_0x2174a2=0x0?this['available']:0x0;var _0x2b5fcb={'id':this['id'],'available':this[_0x7f77('0x18')],'loggedIn':this[_0x7f77('0x15')],'name':this['name'],'paused':this[_0x7f77('0x16')],'waiting':this['waiting']};var _0x5a02c8=md5(JSON[_0x7f77('0x19')](_0x2b5fcb));if(this[_0x7f77('0x1')]!==_0x5a02c8){this[_0x7f77('0x1')]=_0x5a02c8;io['to'](util['format'](_0x7f77('0x1a'),_0x2b5fcb['name']))[_0x7f77('0x1b')]('whatsapp_queue:save',_0x2b5fcb);}};module[_0x7f77('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x8e20=['Agents','mapAgentsId','prototype','updateRouting','map','_rr','updateRealtime','paused','online','loggedIn','available','waiting','stringify','whatsapp:queue:%s','whatsapp_queue:save','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x13fa3a,_0x3783f7){var _0x4ae7c5=function(_0x379a88){while(--_0x379a88){_0x13fa3a['push'](_0x13fa3a['shift']());}};_0x4ae7c5(++_0x3783f7);}(_0x8e20,0x1af));var _0x08e2=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x8e20[_0x585d09];return _0x7d9a14;};'use strict';var _=require(_0x08e2('0x0'));var md5=require(_0x08e2('0x1'));var util=require(_0x08e2('0x2'));var Redis=require('ioredis');var config=require(_0x08e2('0x3'));config[_0x08e2('0x4')]=_['defaults'](config[_0x08e2('0x4')],{'host':_0x08e2('0x5'),'port':0x18eb});var io=require(_0x08e2('0x6'))(new Redis(config[_0x08e2('0x4')]));function WhatsappQueue(_0x32f1ba){this['id']=_0x32f1ba['id']||0x0;this['name']=_0x32f1ba[_0x08e2('0x7')]||'';this[_0x08e2('0x8')]=_0x32f1ba['timeout']||0xa;this[_0x08e2('0x9')]=_0x32f1ba[_0x08e2('0x9')]||_0x08e2('0xa');this[_0x08e2('0xb')]=_0x32f1ba[_0x08e2('0xb')];this[_0x08e2('0xc')]={};this['waiting']=0x0;this[_0x08e2('0x1')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0x08e2('0xd')][_0x08e2('0xe')]=function(){var _0x3ab530=this[_0x08e2('0xc')]['_rr'];this['mapAgentsId']=_[_0x08e2('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x08e2('0x10')]=_0x3ab530;};WhatsappQueue['prototype'][_0x08e2('0x11')]=function(){this['loggedIn']=0x0;this[_0x08e2('0x12')]=0x0;for(var _0x4cffce=0x0;_0x4cffce=0x0?this[_0x08e2('0x15')]:0x0;var _0x90db85={'id':this['id'],'available':this[_0x08e2('0x15')],'loggedIn':this[_0x08e2('0x14')],'name':this[_0x08e2('0x7')],'paused':this[_0x08e2('0x12')],'waiting':this[_0x08e2('0x16')]};var _0x3ebd09=md5(JSON[_0x08e2('0x17')](_0x90db85));if(this['md5']!==_0x3ebd09){this['md5']=_0x3ebd09;io['to'](util['format'](_0x08e2('0x18'),_0x90db85[_0x08e2('0x7')]))['emit'](_0x08e2('0x19'),_0x90db85);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 878c51f..3254753 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 _0x7fbe=['../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','lodash','moment'];(function(_0x382f53,_0x2b46e5){var _0x4071c7=function(_0x4ea716){while(--_0x4ea716){_0x382f53['push'](_0x382f53['shift']());}};_0x4071c7(++_0x2b46e5);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1c90a7,_0x115e4d){_0x1c90a7=_0x1c90a7-0x0;var _0x408b33=_0x7fbe[_0x1c90a7];return _0x408b33;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xe7fb('0x0'));var moment=require(_0xe7fb('0x1'));var Agent=require(_0xe7fb('0x2'));var Interval=require(_0xe7fb('0x3'));var OpenchannelQueue=require(_0xe7fb('0x4'));var ChatQueue=require(_0xe7fb('0x5'));var SmsQueue=require(_0xe7fb('0x6'));var MailQueue=require(_0xe7fb('0x7'));var FaxQueue=require(_0xe7fb('0x8'));var WhatsappQueue=require(_0xe7fb('0x9'));var Realtime=function(){this[_0xe7fb('0xa')]={};this[_0xe7fb('0xb')]={};this[_0xe7fb('0xc')]={};this[_0xe7fb('0xd')]={};this['smsQueues']={};this[_0xe7fb('0xe')]={};this[_0xe7fb('0xf')]={};this[_0xe7fb('0x10')]={};this[_0xe7fb('0x11')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xe7fb('0x12')]={};this[_0xe7fb('0x13')]={};this[_0xe7fb('0x14')]={};};function freeIsNotKey(_0x348a73,_0x2a2223,_0x42435c){var _0x3e934b=_[_0xe7fb('0x15')](_0x348a73,function(_0x325035,_0x2fe8ab){return _0x325035[_0x42435c];});for(var _0x2437d4 in _0x2a2223){if(_0x2a2223[_0xe7fb('0x16')](_0x2437d4)){if(!_0x3e934b[_0x2437d4]){delete _0x2a2223[_0x2437d4];}}}}Realtime[_0xe7fb('0x17')][_0xe7fb('0x18')]=function(_0x7fe4d3,_0x598729){for(var _0x278b75 in _0x598729){if(_0x7fe4d3[_0xe7fb('0x16')](_0x278b75)){_0x7fe4d3[_0x278b75]=_0x598729[_0x278b75];}}};Realtime['prototype'][_0xe7fb('0x19')]=function(){var _0x37eb9f=this;return function(_0x482f7d){if(_0x482f7d){freeIsNotKey(_0x482f7d,_0x37eb9f[_0xe7fb('0xa')],'id');for(var _0x559129=0x0,_0x12fff6={},_0x18d23c={};_0x559129<_0x482f7d[_0xe7fb('0x1a')];_0x559129+=0x1){_0x12fff6=_0x482f7d[_0x559129];if(_[_0xe7fb('0x1b')](_0x37eb9f['agents'][_0x12fff6['id']])){_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']]=new Agent(_0x12fff6);}else{_0x37eb9f['mergeFromDatabase'](_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']],_0x12fff6);}}}return _0x37eb9f['agents'];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1c')]=function(){var _0x3f96a7=this;return function(_0x182269){if(_0x182269){freeIsNotKey(_0x182269,_0x3f96a7['intervals'],'id');for(var _0x44466e=0x0,_0x5d1c87={},_0x11cae0={};_0x44466e<_0x182269['length'];_0x44466e+=0x1){_0x5d1c87=_0x182269[_0x44466e];if(_[_0xe7fb('0x1b')](_0x3f96a7['intervals'][_0x5d1c87['id']])){_0x3f96a7[_0xe7fb('0xb')][_0x5d1c87['id']]=new Interval(_0x5d1c87);}else{_0x3f96a7[_0xe7fb('0x18')](_0x3f96a7['intervals'][_0x5d1c87['id']],_0x5d1c87);}}}return _0x3f96a7[_0xe7fb('0xb')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1d')]=function(){var _0x4dcb4b=this;return function(_0x469d50){if(_0x469d50){freeIsNotKey(_0x469d50,_0x4dcb4b[_0xe7fb('0xc')],'id');for(var _0x5da3d9=0x0,_0x5bea27={},_0x52f08b={};_0x5da3d9<_0x469d50[_0xe7fb('0x1a')];_0x5da3d9+=0x1){_0x5bea27=_0x469d50[_0x5da3d9];if(_['isUndefined'](_0x4dcb4b['openchannelQueues'][_0x5bea27['id']])){_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']]=new OpenchannelQueue(_0x5bea27);}else{_0x4dcb4b[_0xe7fb('0x18')](_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']],_0x5bea27);}_0x4dcb4b['openchannelQueues'][_0x5bea27['id']][_0xe7fb('0x1e')]();_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']][_0xe7fb('0x1f')]();}}return _0x4dcb4b[_0xe7fb('0xc')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x20')]=function(){var _0x380130=this;return function(_0x59e015){if(_0x59e015){freeIsNotKey(_0x59e015,_0x380130['chatQueues'],'id');for(var _0x1086e6=0x0,_0x3bdee9={},_0xead63={};_0x1086e6<_0x59e015['length'];_0x1086e6+=0x1){_0x3bdee9=_0x59e015[_0x1086e6];if(_[_0xe7fb('0x1b')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']])){_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]=new ChatQueue(_0x3bdee9);}else{_0x380130[_0xe7fb('0x18')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']],_0x3bdee9);}_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']][_0xe7fb('0x1e')]();_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]['updateRealtime']();}}return _0x380130[_0xe7fb('0xd')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x21')]=function(){var _0x547a04=this;return function(_0x517d70){if(_0x517d70){freeIsNotKey(_0x517d70,_0x547a04[_0xe7fb('0x22')],'id');for(var _0x4a9fea=0x0,_0xac56b4={},_0x2f8774={};_0x4a9fea<_0x517d70[_0xe7fb('0x1a')];_0x4a9fea+=0x1){_0xac56b4=_0x517d70[_0x4a9fea];if(_[_0xe7fb('0x1b')](_0x547a04['smsQueues'][_0xac56b4['id']])){_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']]=new SmsQueue(_0xac56b4);}else{_0x547a04[_0xe7fb('0x18')](_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']],_0xac56b4);}_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']][_0xe7fb('0x1e')]();_0x547a04['smsQueues'][_0xac56b4['id']][_0xe7fb('0x1f')]();}}return _0x547a04[_0xe7fb('0x22')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x23')]=function(){var _0x46f430=this;return function(_0x25e925){if(_0x25e925){freeIsNotKey(_0x25e925,_0x46f430[_0xe7fb('0xe')],'id');for(var _0x147eb1=0x0,_0x389903={},_0x59f9df={};_0x147eb1<_0x25e925[_0xe7fb('0x1a')];_0x147eb1+=0x1){_0x389903=_0x25e925[_0x147eb1];if(_[_0xe7fb('0x1b')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']])){_0x46f430['mailQueues'][_0x389903['id']]=new MailQueue(_0x389903);}else{_0x46f430[_0xe7fb('0x18')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']],_0x389903);}_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1e')]();_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1f')]();}}return _0x46f430[_0xe7fb('0xe')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x24')]=function(){var _0xebfe1d=this;return function(_0x29c34a){if(_0x29c34a){freeIsNotKey(_0x29c34a,_0xebfe1d[_0xe7fb('0xf')],'id');for(var _0x1544f2=0x0,_0x1c81fe={},_0xeb7c29={};_0x1544f2<_0x29c34a[_0xe7fb('0x1a')];_0x1544f2+=0x1){_0x1c81fe=_0x29c34a[_0x1544f2];if(_[_0xe7fb('0x1b')](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']])){_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]=new FaxQueue(_0x1c81fe);}else{_0xebfe1d['mergeFromDatabase'](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']],_0x1c81fe);}_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']][_0xe7fb('0x1e')]();_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]['updateRealtime']();}}return _0xebfe1d[_0xe7fb('0xf')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x25')]=function(){var _0x413a13=this;return function(_0x49fe9d){if(_0x49fe9d){freeIsNotKey(_0x49fe9d,_0x413a13[_0xe7fb('0x10')],'id');for(var _0x451a6c=0x0,_0x34265f={},_0x62a8a1={};_0x451a6c<_0x49fe9d[_0xe7fb('0x1a')];_0x451a6c+=0x1){_0x34265f=_0x49fe9d[_0x451a6c];if(_[_0xe7fb('0x1b')](_0x413a13['whatsappQueues'][_0x34265f['id']])){_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]=new WhatsappQueue(_0x34265f);}else{_0x413a13[_0xe7fb('0x18')](_0x413a13[_0xe7fb('0x10')][_0x34265f['id']],_0x34265f);}_0x413a13['whatsappQueues'][_0x34265f['id']][_0xe7fb('0x1e')]();_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]['updateRealtime']();}}return _0x413a13['whatsappQueues'];};};module['exports']=Realtime; \ No newline at end of file +var _0x7fbe=['../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','initWhatsappQueues','lodash','moment'];(function(_0x528748,_0x1a259d){var _0x571df2=function(_0x5ca768){while(--_0x5ca768){_0x528748['push'](_0x528748['shift']());}};_0x571df2(++_0x1a259d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x11aee5,_0x27fa94){_0x11aee5=_0x11aee5-0x0;var _0x2e8c9d=_0x7fbe[_0x11aee5];return _0x2e8c9d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xe7fb('0x0'));var moment=require(_0xe7fb('0x1'));var Agent=require(_0xe7fb('0x2'));var Interval=require(_0xe7fb('0x3'));var OpenchannelQueue=require(_0xe7fb('0x4'));var ChatQueue=require(_0xe7fb('0x5'));var SmsQueue=require(_0xe7fb('0x6'));var MailQueue=require(_0xe7fb('0x7'));var FaxQueue=require(_0xe7fb('0x8'));var WhatsappQueue=require(_0xe7fb('0x9'));var Realtime=function(){this[_0xe7fb('0xa')]={};this[_0xe7fb('0xb')]={};this[_0xe7fb('0xc')]={};this[_0xe7fb('0xd')]={};this['smsQueues']={};this[_0xe7fb('0xe')]={};this[_0xe7fb('0xf')]={};this[_0xe7fb('0x10')]={};this[_0xe7fb('0x11')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0xe7fb('0x12')]={};this[_0xe7fb('0x13')]={};this[_0xe7fb('0x14')]={};};function freeIsNotKey(_0x348a73,_0x2a2223,_0x42435c){var _0x3e934b=_[_0xe7fb('0x15')](_0x348a73,function(_0x325035,_0x2fe8ab){return _0x325035[_0x42435c];});for(var _0x2437d4 in _0x2a2223){if(_0x2a2223[_0xe7fb('0x16')](_0x2437d4)){if(!_0x3e934b[_0x2437d4]){delete _0x2a2223[_0x2437d4];}}}}Realtime[_0xe7fb('0x17')][_0xe7fb('0x18')]=function(_0x7fe4d3,_0x598729){for(var _0x278b75 in _0x598729){if(_0x7fe4d3[_0xe7fb('0x16')](_0x278b75)){_0x7fe4d3[_0x278b75]=_0x598729[_0x278b75];}}};Realtime['prototype'][_0xe7fb('0x19')]=function(){var _0x37eb9f=this;return function(_0x482f7d){if(_0x482f7d){freeIsNotKey(_0x482f7d,_0x37eb9f[_0xe7fb('0xa')],'id');for(var _0x559129=0x0,_0x12fff6={},_0x18d23c={};_0x559129<_0x482f7d[_0xe7fb('0x1a')];_0x559129+=0x1){_0x12fff6=_0x482f7d[_0x559129];if(_[_0xe7fb('0x1b')](_0x37eb9f['agents'][_0x12fff6['id']])){_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']]=new Agent(_0x12fff6);}else{_0x37eb9f['mergeFromDatabase'](_0x37eb9f[_0xe7fb('0xa')][_0x12fff6['id']],_0x12fff6);}}}return _0x37eb9f['agents'];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1c')]=function(){var _0x3f96a7=this;return function(_0x182269){if(_0x182269){freeIsNotKey(_0x182269,_0x3f96a7['intervals'],'id');for(var _0x44466e=0x0,_0x5d1c87={},_0x11cae0={};_0x44466e<_0x182269['length'];_0x44466e+=0x1){_0x5d1c87=_0x182269[_0x44466e];if(_[_0xe7fb('0x1b')](_0x3f96a7['intervals'][_0x5d1c87['id']])){_0x3f96a7[_0xe7fb('0xb')][_0x5d1c87['id']]=new Interval(_0x5d1c87);}else{_0x3f96a7[_0xe7fb('0x18')](_0x3f96a7['intervals'][_0x5d1c87['id']],_0x5d1c87);}}}return _0x3f96a7[_0xe7fb('0xb')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x1d')]=function(){var _0x4dcb4b=this;return function(_0x469d50){if(_0x469d50){freeIsNotKey(_0x469d50,_0x4dcb4b[_0xe7fb('0xc')],'id');for(var _0x5da3d9=0x0,_0x5bea27={},_0x52f08b={};_0x5da3d9<_0x469d50[_0xe7fb('0x1a')];_0x5da3d9+=0x1){_0x5bea27=_0x469d50[_0x5da3d9];if(_['isUndefined'](_0x4dcb4b['openchannelQueues'][_0x5bea27['id']])){_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']]=new OpenchannelQueue(_0x5bea27);}else{_0x4dcb4b[_0xe7fb('0x18')](_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']],_0x5bea27);}_0x4dcb4b['openchannelQueues'][_0x5bea27['id']][_0xe7fb('0x1e')]();_0x4dcb4b[_0xe7fb('0xc')][_0x5bea27['id']][_0xe7fb('0x1f')]();}}return _0x4dcb4b[_0xe7fb('0xc')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x20')]=function(){var _0x380130=this;return function(_0x59e015){if(_0x59e015){freeIsNotKey(_0x59e015,_0x380130['chatQueues'],'id');for(var _0x1086e6=0x0,_0x3bdee9={},_0xead63={};_0x1086e6<_0x59e015['length'];_0x1086e6+=0x1){_0x3bdee9=_0x59e015[_0x1086e6];if(_[_0xe7fb('0x1b')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']])){_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]=new ChatQueue(_0x3bdee9);}else{_0x380130[_0xe7fb('0x18')](_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']],_0x3bdee9);}_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']][_0xe7fb('0x1e')]();_0x380130[_0xe7fb('0xd')][_0x3bdee9['id']]['updateRealtime']();}}return _0x380130[_0xe7fb('0xd')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x21')]=function(){var _0x547a04=this;return function(_0x517d70){if(_0x517d70){freeIsNotKey(_0x517d70,_0x547a04[_0xe7fb('0x22')],'id');for(var _0x4a9fea=0x0,_0xac56b4={},_0x2f8774={};_0x4a9fea<_0x517d70[_0xe7fb('0x1a')];_0x4a9fea+=0x1){_0xac56b4=_0x517d70[_0x4a9fea];if(_[_0xe7fb('0x1b')](_0x547a04['smsQueues'][_0xac56b4['id']])){_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']]=new SmsQueue(_0xac56b4);}else{_0x547a04[_0xe7fb('0x18')](_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']],_0xac56b4);}_0x547a04[_0xe7fb('0x22')][_0xac56b4['id']][_0xe7fb('0x1e')]();_0x547a04['smsQueues'][_0xac56b4['id']][_0xe7fb('0x1f')]();}}return _0x547a04[_0xe7fb('0x22')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x23')]=function(){var _0x46f430=this;return function(_0x25e925){if(_0x25e925){freeIsNotKey(_0x25e925,_0x46f430[_0xe7fb('0xe')],'id');for(var _0x147eb1=0x0,_0x389903={},_0x59f9df={};_0x147eb1<_0x25e925[_0xe7fb('0x1a')];_0x147eb1+=0x1){_0x389903=_0x25e925[_0x147eb1];if(_[_0xe7fb('0x1b')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']])){_0x46f430['mailQueues'][_0x389903['id']]=new MailQueue(_0x389903);}else{_0x46f430[_0xe7fb('0x18')](_0x46f430[_0xe7fb('0xe')][_0x389903['id']],_0x389903);}_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1e')]();_0x46f430[_0xe7fb('0xe')][_0x389903['id']][_0xe7fb('0x1f')]();}}return _0x46f430[_0xe7fb('0xe')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x24')]=function(){var _0xebfe1d=this;return function(_0x29c34a){if(_0x29c34a){freeIsNotKey(_0x29c34a,_0xebfe1d[_0xe7fb('0xf')],'id');for(var _0x1544f2=0x0,_0x1c81fe={},_0xeb7c29={};_0x1544f2<_0x29c34a[_0xe7fb('0x1a')];_0x1544f2+=0x1){_0x1c81fe=_0x29c34a[_0x1544f2];if(_[_0xe7fb('0x1b')](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']])){_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]=new FaxQueue(_0x1c81fe);}else{_0xebfe1d['mergeFromDatabase'](_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']],_0x1c81fe);}_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']][_0xe7fb('0x1e')]();_0xebfe1d[_0xe7fb('0xf')][_0x1c81fe['id']]['updateRealtime']();}}return _0xebfe1d[_0xe7fb('0xf')];};};Realtime[_0xe7fb('0x17')][_0xe7fb('0x25')]=function(){var _0x413a13=this;return function(_0x49fe9d){if(_0x49fe9d){freeIsNotKey(_0x49fe9d,_0x413a13[_0xe7fb('0x10')],'id');for(var _0x451a6c=0x0,_0x34265f={},_0x62a8a1={};_0x451a6c<_0x49fe9d[_0xe7fb('0x1a')];_0x451a6c+=0x1){_0x34265f=_0x49fe9d[_0x451a6c];if(_[_0xe7fb('0x1b')](_0x413a13['whatsappQueues'][_0x34265f['id']])){_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]=new WhatsappQueue(_0x34265f);}else{_0x413a13[_0xe7fb('0x18')](_0x413a13[_0xe7fb('0x10')][_0x34265f['id']],_0x34265f);}_0x413a13['whatsappQueues'][_0x34265f['id']][_0xe7fb('0x1e')]();_0x413a13[_0xe7fb('0x10')][_0x34265f['id']]['updateRealtime']();}}return _0x413a13['whatsappQueues'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 02e9dcc..29aa256 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 _0xa087=['Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xa087,0xd0));var _0x7a08=function(_0x8d274b,_0xbdfd29){_0x8d274b=_0x8d274b-0x0;var _0x30a202=_0xa087[_0x8d274b];return _0x30a202;};'use strict';var client=require(_0x7a08('0x0'));exports[_0x7a08('0x1')]=function(_0x2114f6,_0x10c739){return client[_0x7a08('0x2')](_0x7a08('0x3'),{'body':_0x10c739,'options':{'where':{'id':_0x2114f6}},'log':_0x7a08('0x4')});};exports['addTags']=function(_0x13951e,_0x3c9d6c){return client[_0x7a08('0x2')](_0x7a08('0x5'),{'body':_0x3c9d6c,'options':{'where':{'id':_0x13951e}},'log':_0x7a08('0x6')});}; \ No newline at end of file +var _0xc10e=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x466d81,_0x5afd36){var _0x35cff4=function(_0x4c208c){while(--_0x4c208c){_0x466d81['push'](_0x466d81['shift']());}};_0x35cff4(++_0x5afd36);}(_0xc10e,0x133));var _0xec10=function(_0xcd32e1,_0x20fbed){_0xcd32e1=_0xcd32e1-0x0;var _0x5821d8=_0xc10e[_0xcd32e1];return _0x5821d8;};'use strict';var client=require(_0xec10('0x0'));exports[_0xec10('0x1')]=function(_0x3123d1,_0x430509){return client[_0xec10('0x2')]('UpdateChatInteraction',{'body':_0x430509,'options':{'where':{'id':_0x3123d1}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x52d261,_0x254d72){return client[_0xec10('0x2')](_0xec10('0x3'),{'body':_0x254d72,'options':{'where':{'id':_0x52d261}},'log':_0xec10('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index cd19525..7fd3478 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 _0x960a=['Request','createChatMessage','../client'];(function(_0x548382,_0x4625fc){var _0x46f525=function(_0x30042c){while(--_0x30042c){_0x548382['push'](_0x548382['shift']());}};_0x46f525(++_0x4625fc);}(_0x960a,0x9b));var _0xa960=function(_0x5aaefc,_0x582a57){_0x5aaefc=_0x5aaefc-0x0;var _0x2eb88a=_0x960a[_0x5aaefc];return _0x2eb88a;};'use strict';var client=require(_0xa960('0x0'));exports['create']=function(_0x417c4b){return client[_0xa960('0x1')]('CreateChatMessage',{'body':_0x417c4b,'log':_0xa960('0x2')});}; \ No newline at end of file +var _0x0704=['../client','CreateChatMessage'];(function(_0x4756eb,_0x5d6d44){var _0xab57d7=function(_0x4b53a4){while(--_0x4b53a4){_0x4756eb['push'](_0x4756eb['shift']());}};_0xab57d7(++_0x5d6d44);}(_0x0704,0x7e));var _0x4070=function(_0x30d4cb,_0x200058){_0x30d4cb=_0x30d4cb-0x0;var _0x2759f1=_0x0704[_0x30d4cb];return _0x2759f1;};'use strict';var client=require(_0x4070('0x0'));exports['create']=function(_0x3f5788){return client['Request'](_0x4070('0x1'),{'body':_0x3f5788,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9c2ad35..d3007d3 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 _0x4cbd=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','strategy','User','Agents'];(function(_0xa1fc86,_0x419a28){var _0x38c1a2=function(_0x433416){while(--_0x433416){_0xa1fc86['push'](_0xa1fc86['shift']());}};_0x38c1a2(++_0x419a28);}(_0x4cbd,0xac));var _0xd4cb=function(_0x55a101,_0x3df81b){_0x55a101=_0x55a101-0x0;var _0x43466b=_0x4cbd[_0x55a101];return _0x43466b;};'use strict';var client=require(_0xd4cb('0x0'));exports[_0xd4cb('0x1')]=function(){return function(){return client[_0xd4cb('0x2')](_0xd4cb('0x3'),{'options':{'raw':![],'attributes':['id',_0xd4cb('0x4'),'timeout',_0xd4cb('0x5')],'include':[{'model':_0xd4cb('0x6'),'as':_0xd4cb('0x7'),'attributes':['id',_0xd4cb('0x4'),'online',_0xd4cb('0x8')]}]},'log':_0xd4cb('0x1')});};}; \ No newline at end of file +var _0xdd7c=['Agents','online','chatPause','getChatQueues','name','timeout','strategy','User'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdd7c,0xfb));var _0xcdd7=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0xdd7c[_0x4f2c3a];return _0x17d91c;};'use strict';var client=require('../client');exports[_0xcdd7('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xcdd7('0x1'),_0xcdd7('0x2'),_0xcdd7('0x3')],'include':[{'model':_0xcdd7('0x4'),'as':_0xcdd7('0x5'),'attributes':['id',_0xcdd7('0x1'),_0xcdd7('0x6'),_0xcdd7('0x7')]}]},'log':_0xcdd7('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e8bf328..8451e98 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 _0x8d53=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x22015c,_0x2aa7a4){var _0x251a91=function(_0x4d5058){while(--_0x4d5058){_0x22015c['push'](_0x22015c['shift']());}};_0x251a91(++_0x2aa7a4);}(_0x8d53,0x1c2));var _0x38d5=function(_0x2e0851,_0x4bcf4c){_0x2e0851=_0x2e0851-0x0;var _0xb79e84=_0x8d53[_0x2e0851];return _0xb79e84;};'use strict';var client=require(_0x38d5('0x0'));exports[_0x38d5('0x1')]=function(_0x5e0848){return client[_0x38d5('0x2')](_0x38d5('0x3'),{'body':_0x5e0848,'log':_0x38d5('0x3')});};exports[_0x38d5('0x4')]=function(_0x3a7660,_0x19c115){return client[_0x38d5('0x2')](_0x38d5('0x5'),{'body':_0x19c115,'options':{'where':{'uniqueid':_0x3a7660},'order':[['id','DESC']],'limit':0x1},'log':_0x38d5('0x5')});}; \ No newline at end of file +var _0x867f=['create','Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client'];(function(_0x1e3a0a,_0x49cd48){var _0x284267=function(_0x279223){while(--_0x279223){_0x1e3a0a['push'](_0x1e3a0a['shift']());}};_0x284267(++_0x49cd48);}(_0x867f,0xe6));var _0xf867=function(_0x2f163c,_0x27bd79){_0x2f163c=_0x2f163c-0x0;var _0x3dd996=_0x867f[_0x2f163c];return _0x3dd996;};'use strict';var client=require(_0xf867('0x0'));exports[_0xf867('0x1')]=function(_0x419241){return client[_0xf867('0x2')](_0xf867('0x3'),{'body':_0x419241,'log':_0xf867('0x3')});};exports[_0xf867('0x4')]=function(_0x394856,_0x333d91){return client['Request']('UpdateChatQueueReport',{'body':_0x333d91,'options':{'where':{'uniqueid':_0x394856},'order':[['id',_0xf867('0x5')]],'limit':0x1},'log':_0xf867('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 4a5cfe1..0f1babc 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 _0xb48a=['../client','Request','UpdateFaxInteraction','updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x4e8f33,_0x3edf1f){var _0x2bc1b8=function(_0x4dc6a6){while(--_0x4dc6a6){_0x4e8f33['push'](_0x4e8f33['shift']());}};_0x2bc1b8(++_0x3edf1f);}(_0xb48a,0x1d4));var _0xab48=function(_0x539d03,_0x4c32cd){_0x539d03=_0x539d03-0x0;var _0x51b31c=_0xb48a[_0x539d03];return _0x51b31c;};'use strict';var client=require(_0xab48('0x0'));exports['update']=function(_0x1e94fa,_0x38354b){return client[_0xab48('0x1')](_0xab48('0x2'),{'body':_0x38354b,'options':{'where':{'id':_0x1e94fa}},'log':_0xab48('0x3')});};exports['addTags']=function(_0x46fe12,_0x49f562){return client['Request'](_0xab48('0x4'),{'body':_0x49f562,'options':{'where':{'id':_0x46fe12}},'log':_0xab48('0x5')});}; \ No newline at end of file +var _0x50db=['UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x50db,0x154));var _0xb50d=function(_0x498796,_0x2a9b20){_0x498796=_0x498796-0x0;var _0x4e168a=_0x50db[_0x498796];return _0x4e168a;};'use strict';var client=require(_0xb50d('0x0'));exports['update']=function(_0x1c4976,_0x4e9a65){return client[_0xb50d('0x1')](_0xb50d('0x2'),{'body':_0x4e9a65,'options':{'where':{'id':_0x1c4976}},'log':'updateFaxInteraction'});};exports[_0xb50d('0x3')]=function(_0x17944f,_0x38b0d6){return client['Request'](_0xb50d('0x4'),{'body':_0x38b0d6,'options':{'where':{'id':_0x17944f}},'log':_0xb50d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f1fba70..f6acaeb 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 _0xb556=['create','Request','../client'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xb556,0x1eb));var _0x6b55=function(_0x4fef03,_0x2099dd){_0x4fef03=_0x4fef03-0x0;var _0xd54639=_0xb556[_0x4fef03];return _0xd54639;};'use strict';var client=require(_0x6b55('0x0'));exports[_0x6b55('0x1')]=function(_0x364dc0){return client[_0x6b55('0x2')]('CreateFaxMessage',{'body':_0x364dc0,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x5088=['../client','create','CreateFaxMessage','createFaxMessage'];(function(_0x2e8721,_0x4f2eaa){var _0x4b092c=function(_0x10d12c){while(--_0x10d12c){_0x2e8721['push'](_0x2e8721['shift']());}};_0x4b092c(++_0x4f2eaa);}(_0x5088,0x14c));var _0x8508=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0x5088[_0x57e00e];return _0x415e60;};'use strict';var client=require(_0x8508('0x0'));exports[_0x8508('0x1')]=function(_0x395e00){return client['Request'](_0x8508('0x2'),{'body':_0x395e00,'log':_0x8508('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 5ff7375..d0ce5b6 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 _0x2bec=['strategy','User','Agents','name','online','faxPause','getFaxQueues','GetFaxQueue'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x2bec,0xb6));var _0xc2be=function(_0x2b434f,_0x290663){_0x2b434f=_0x2b434f-0x0;var _0x553180=_0x2bec[_0x2b434f];return _0x553180;};'use strict';var client=require('../client');exports[_0xc2be('0x0')]=function(){return function(){return client['Request'](_0xc2be('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc2be('0x2')],'include':[{'model':_0xc2be('0x3'),'as':_0xc2be('0x4'),'attributes':['id',_0xc2be('0x5'),_0xc2be('0x6'),_0xc2be('0x7')]}]},'log':_0xc2be('0x0')});};}; \ No newline at end of file +var _0x4387=['name','timeout','strategy','User','Agents','getFaxQueues','Request'];(function(_0x249f6e,_0xf58756){var _0xaa9e42=function(_0x57c159){while(--_0x57c159){_0x249f6e['push'](_0x249f6e['shift']());}};_0xaa9e42(++_0xf58756);}(_0x4387,0x6e));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x7438('0x0')]=function(){return function(){return client[_0x7438('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x7438('0x2'),_0x7438('0x3'),_0x7438('0x4')],'include':[{'model':_0x7438('0x5'),'as':_0x7438('0x6'),'attributes':['id',_0x7438('0x2'),'online','faxPause']}]},'log':_0x7438('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 1ddf98b..fae8c6b 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 _0x4c01=['UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x529be5,_0x20e047){var _0x50826a=function(_0x3cac56){while(--_0x3cac56){_0x529be5['push'](_0x529be5['shift']());}};_0x50826a(++_0x20e047);}(_0x4c01,0x13c));var _0x14c0=function(_0x433543,_0x54fae1){_0x433543=_0x433543-0x0;var _0x3ce2f3=_0x4c01[_0x433543];return _0x3ce2f3;};'use strict';var client=require(_0x14c0('0x0'));exports['create']=function(_0x33cf28){return client[_0x14c0('0x1')](_0x14c0('0x2'),{'body':_0x33cf28,'log':_0x14c0('0x2')});};exports[_0x14c0('0x3')]=function(_0x20f959,_0xccba62){return client[_0x14c0('0x1')]('UpdateFaxQueueReport',{'body':_0xccba62,'options':{'where':{'uniqueid':_0x20f959},'order':[['id','DESC']],'limit':0x1},'log':_0x14c0('0x4')});}; \ No newline at end of file +var _0x88ac=['UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ac,0x12d));var _0xc88a=function(_0x21efd3,_0x445165){_0x21efd3=_0x21efd3-0x0;var _0x3898f5=_0x88ac[_0x21efd3];return _0x3898f5;};'use strict';var client=require(_0xc88a('0x0'));exports['create']=function(_0x4bb45c){return client[_0xc88a('0x1')]('CreateFaxQueueReport',{'body':_0x4bb45c,'log':_0xc88a('0x2')});};exports[_0xc88a('0x3')]=function(_0x3c1a94,_0x5e751c){return client['Request'](_0xc88a('0x4'),{'body':_0x5e751c,'options':{'where':{'uniqueid':_0x3c1a94},'order':[['id','DESC']],'limit':0x1},'log':_0xc88a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b1005f6..c362a84 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 _0x06ef=['getIntervals','Request','name','interval'];(function(_0x47e9c2,_0x445d9d){var _0x53db04=function(_0x46180e){while(--_0x46180e){_0x47e9c2['push'](_0x47e9c2['shift']());}};_0x53db04(++_0x445d9d);}(_0x06ef,0x185));var _0xf06e=function(_0x5c8758,_0x581cf7){_0x5c8758=_0x5c8758-0x0;var _0x3b874a=_0x06ef[_0x5c8758];return _0x3b874a;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0xf06e('0x0')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xf06e('0x1'),_0xf06e('0x2')]}]},'log':_0xf06e('0x3')});};}; \ No newline at end of file +var _0x7462=['interval','../client','getIntervals','name'];(function(_0x558cf7,_0xaac786){var _0x2c1d0d=function(_0x53b30d){while(--_0x53b30d){_0x558cf7['push'](_0x558cf7['shift']());}};_0x2c1d0d(++_0xaac786);}(_0x7462,0x165));var _0x2746=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x7462[_0x39e164];return _0x13fa6b;};'use strict';var client=require(_0x2746('0x0'));exports[_0x2746('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2746('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x2746('0x2'),_0x2746('0x3')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 7280da9..410ec60 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 _0x3fb5=['Request','AddTagsToMailInteraction','../client','addTags'];(function(_0x433993,_0x483f38){var _0x53eb75=function(_0x29372d){while(--_0x29372d){_0x433993['push'](_0x433993['shift']());}};_0x53eb75(++_0x483f38);}(_0x3fb5,0x1ea));var _0x53fb=function(_0x4e864f,_0x2488ec){_0x4e864f=_0x4e864f-0x0;var _0x7ca8ab=_0x3fb5[_0x4e864f];return _0x7ca8ab;};'use strict';var client=require(_0x53fb('0x0'));exports['update']=function(_0x33154d,_0x4a427c){return client['Request']('UpdateMailInteraction',{'body':_0x4a427c,'options':{'where':{'id':_0x33154d}},'log':'updateMailInteraction'});};exports[_0x53fb('0x1')]=function(_0x5757f2,_0x1e0ad3){return client[_0x53fb('0x2')](_0x53fb('0x3'),{'body':_0x1e0ad3,'options':{'where':{'id':_0x5757f2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xceae=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x4dd269,_0x4b8f0c){var _0x27473b=function(_0x1723e5){while(--_0x1723e5){_0x4dd269['push'](_0x4dd269['shift']());}};_0x27473b(++_0x4b8f0c);}(_0xceae,0xe2));var _0xecea=function(_0x31c6b6,_0xdd33b7){_0x31c6b6=_0x31c6b6-0x0;var _0x32b27b=_0xceae[_0x31c6b6];return _0x32b27b;};'use strict';var client=require(_0xecea('0x0'));exports[_0xecea('0x1')]=function(_0x412b49,_0x4d914d){return client[_0xecea('0x2')](_0xecea('0x3'),{'body':_0x4d914d,'options':{'where':{'id':_0x412b49}},'log':_0xecea('0x4')});};exports[_0xecea('0x5')]=function(_0x722a67,_0x46a24a){return client[_0xecea('0x2')](_0xecea('0x6'),{'body':_0x46a24a,'options':{'where':{'id':_0x722a67}},'log':_0xecea('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d15876b..ca2e3cf 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 _0x2cea=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x3869f6,_0x2ea2d5){var _0x536687=function(_0x335054){while(--_0x335054){_0x3869f6['push'](_0x3869f6['shift']());}};_0x536687(++_0x2ea2d5);}(_0x2cea,0x185));var _0xa2ce=function(_0x49fb87,_0x5d65bb){_0x49fb87=_0x49fb87-0x0;var _0x17db71=_0x2cea[_0x49fb87];return _0x17db71;};'use strict';var client=require(_0xa2ce('0x0'));exports[_0xa2ce('0x1')]=function(_0x49a64c){return client[_0xa2ce('0x2')](_0xa2ce('0x3'),{'body':_0x49a64c,'log':_0xa2ce('0x4')});}; \ No newline at end of file +var _0x29b3=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x20f25f,_0x3b5bee){var _0x3bcb18=function(_0x55a600){while(--_0x55a600){_0x20f25f['push'](_0x20f25f['shift']());}};_0x3bcb18(++_0x3b5bee);}(_0x29b3,0x1c8));var _0x329b=function(_0x406c93,_0x570ebf){_0x406c93=_0x406c93-0x0;var _0x3bb74f=_0x29b3[_0x406c93];return _0x3bb74f;};'use strict';var client=require(_0x329b('0x0'));exports[_0x329b('0x1')]=function(_0x1f4085){return client['Request'](_0x329b('0x2'),{'body':_0x1f4085,'log':_0x329b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1924e17..cffa44c 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 _0xdbf2=['name','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x2c00d2,_0x3b5392){var _0x4ce770=function(_0x29b4ea){while(--_0x29b4ea){_0x2c00d2['push'](_0x2c00d2['shift']());}};_0x4ce770(++_0x3b5392);}(_0xdbf2,0xed));var _0x2dbf=function(_0x154d73,_0x52a619){_0x154d73=_0x154d73-0x0;var _0x3ecd5e=_0xdbf2[_0x154d73];return _0x3ecd5e;};'use strict';var client=require(_0x2dbf('0x0'));exports[_0x2dbf('0x1')]=function(){return function(){return client['Request'](_0x2dbf('0x2'),{'options':{'raw':![],'attributes':['id',_0x2dbf('0x3'),'timeout','strategy'],'include':[{'model':_0x2dbf('0x4'),'as':_0x2dbf('0x5'),'attributes':['id',_0x2dbf('0x3'),_0x2dbf('0x6'),_0x2dbf('0x7')]}]},'log':_0x2dbf('0x1')});};}; \ No newline at end of file +var _0xbe00=['Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','getMailQueues','../client'];(function(_0x5f5eb2,_0x3868f5){var _0x58df87=function(_0x91d228){while(--_0x91d228){_0x5f5eb2['push'](_0x5f5eb2['shift']());}};_0x58df87(++_0x3868f5);}(_0xbe00,0xaf));var _0x0be0=function(_0x225e15,_0x209074){_0x225e15=_0x225e15-0x0;var _0x108e03=_0xbe00[_0x225e15];return _0x108e03;};'use strict';var client=require(_0x0be0('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x0be0('0x1')](_0x0be0('0x2'),{'options':{'raw':![],'attributes':['id',_0x0be0('0x3'),_0x0be0('0x4'),_0x0be0('0x5')],'include':[{'model':_0x0be0('0x6'),'as':_0x0be0('0x7'),'attributes':['id',_0x0be0('0x3'),_0x0be0('0x8'),_0x0be0('0x9')]}]},'log':_0x0be0('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index ab1c8c1..4af4cfe 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 _0x12b0=['update','UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0x12b0,0x111));var _0x012b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x12b0[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x012b('0x0'));exports[_0x012b('0x1')]=function(_0x43b762){return client['Request']('CreateMailQueueReport',{'body':_0x43b762,'log':_0x012b('0x2')});};exports[_0x012b('0x3')]=function(_0x2c9d6b,_0x2e564e){return client['Request'](_0x012b('0x4'),{'body':_0x2e564e,'options':{'where':{'uniqueid':_0x2c9d6b},'order':[['id',_0x012b('0x5')]],'limit':0x1},'log':_0x012b('0x4')});}; \ No newline at end of file +var _0xd362=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xd362,0x110));var _0x2d36=function(_0xc611b1,_0x52b4bd){_0xc611b1=_0xc611b1-0x0;var _0xad5709=_0xd362[_0xc611b1];return _0xad5709;};'use strict';var client=require(_0x2d36('0x0'));exports[_0x2d36('0x1')]=function(_0x10d71f){return client[_0x2d36('0x2')](_0x2d36('0x3'),{'body':_0x10d71f,'log':_0x2d36('0x3')});};exports['update']=function(_0x2ff7c6,_0x33b093){return client[_0x2d36('0x2')](_0x2d36('0x4'),{'body':_0x33b093,'options':{'where':{'uniqueid':_0x2ff7c6},'order':[['id',_0x2d36('0x5')]],'limit':0x1},'log':_0x2d36('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 54aa061..b46b01f 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 _0x5cfb=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x465126,_0x4240d6){var _0xd92991=function(_0x57114a){while(--_0x57114a){_0x465126['push'](_0x465126['shift']());}};_0xd92991(++_0x4240d6);}(_0x5cfb,0x1e9));var _0xb5cf=function(_0x55e75c,_0x51cb2d){_0x55e75c=_0x55e75c-0x0;var _0x24f4bd=_0x5cfb[_0x55e75c];return _0x24f4bd;};'use strict';var client=require(_0xb5cf('0x0'));exports[_0xb5cf('0x1')]=function(_0x5bd5c8,_0x11bb55){return client[_0xb5cf('0x2')](_0xb5cf('0x3'),{'body':_0x11bb55,'options':{'where':{'id':_0x5bd5c8}},'log':_0xb5cf('0x4')});};exports['addTags']=function(_0x3fbda8,_0x4a3d6b){return client['Request'](_0xb5cf('0x5'),{'body':_0x4a3d6b,'options':{'where':{'id':_0x3fbda8}},'log':_0xb5cf('0x6')});}; \ No newline at end of file +var _0x3062=['addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x3062,0x120));var _0x2306=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x3062[_0x4a53d];return _0x27410e;};'use strict';var client=require(_0x2306('0x0'));exports['update']=function(_0xb18f37,_0x50d23e){return client[_0x2306('0x1')](_0x2306('0x2'),{'body':_0x50d23e,'options':{'where':{'id':_0xb18f37}},'log':_0x2306('0x3')});};exports[_0x2306('0x4')]=function(_0x308545,_0x5b64c0){return client[_0x2306('0x1')](_0x2306('0x5'),{'body':_0x5b64c0,'options':{'where':{'id':_0x308545}},'log':_0x2306('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0f8452d..425c1c2 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 _0xf4eb=['../client','createOpenchannelMessage'];(function(_0x1fa31c,_0x1123bd){var _0x1aa48c=function(_0x34d17e){while(--_0x34d17e){_0x1fa31c['push'](_0x1fa31c['shift']());}};_0x1aa48c(++_0x1123bd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x35d65a,_0xd366af){_0x35d65a=_0x35d65a-0x0;var _0x17e924=_0xf4eb[_0x35d65a];return _0x17e924;};'use strict';var client=require(_0xbf4e('0x0'));exports['create']=function(_0x50f2fc){return client['Request']('CreateOpenchannelMessage',{'body':_0x50f2fc,'log':_0xbf4e('0x1')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xedd9,0xfc));var _0x9edd=function(_0x38761b,_0x31cbdf){_0x38761b=_0x38761b-0x0;var _0x28b740=_0xedd9[_0x38761b];return _0x28b740;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 7a83a5a..450ccde 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 _0x0567=['online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents'];(function(_0x319ca2,_0x45774a){var _0x243a33=function(_0x5c37b7){while(--_0x5c37b7){_0x319ca2['push'](_0x319ca2['shift']());}};_0x243a33(++_0x45774a);}(_0x0567,0x17e));var _0x7056=function(_0x2a37a7,_0x202763){_0x2a37a7=_0x2a37a7-0x0;var _0x3791e2=_0x0567[_0x2a37a7];return _0x3791e2;};'use strict';var client=require('../client');exports[_0x7056('0x0')]=function(){return function(){return client[_0x7056('0x1')](_0x7056('0x2'),{'options':{'raw':![],'attributes':['id',_0x7056('0x3'),_0x7056('0x4'),_0x7056('0x5')],'include':[{'model':_0x7056('0x6'),'as':_0x7056('0x7'),'attributes':['id',_0x7056('0x3'),_0x7056('0x8'),_0x7056('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xb1d8=['getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','Agents','name','online','openchannelPause'];(function(_0x30641c,_0x826474){var _0x50a008=function(_0x2247ae){while(--_0x2247ae){_0x30641c['push'](_0x30641c['shift']());}};_0x50a008(++_0x826474);}(_0xb1d8,0xe6));var _0x8b1d=function(_0x143c79,_0x3cae40){_0x143c79=_0x143c79-0x0;var _0x8de9d9=_0xb1d8[_0x143c79];return _0x8de9d9;};'use strict';var client=require('../client');exports[_0x8b1d('0x0')]=function(){return function(){return client[_0x8b1d('0x1')](_0x8b1d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8b1d('0x3'),_0x8b1d('0x4')],'include':[{'model':_0x8b1d('0x5'),'as':_0x8b1d('0x6'),'attributes':['id',_0x8b1d('0x7'),_0x8b1d('0x8'),_0x8b1d('0x9')]}]},'log':_0x8b1d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 70c795d..cca3966 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 _0x304e=['update','UpdateOpenchannelQueueReport','DESC','create','CreateOpenchannelQueueReport'];(function(_0x3b234d,_0x249d15){var _0x47788c=function(_0x13f513){while(--_0x13f513){_0x3b234d['push'](_0x3b234d['shift']());}};_0x47788c(++_0x249d15);}(_0x304e,0xf3));var _0xe304=function(_0x16ff93,_0x3b1a77){_0x16ff93=_0x16ff93-0x0;var _0x44f62a=_0x304e[_0x16ff93];return _0x44f62a;};'use strict';var client=require('../client');exports[_0xe304('0x0')]=function(_0x458b21){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x458b21,'log':_0xe304('0x1')});};exports[_0xe304('0x2')]=function(_0x330fd1,_0x46b543){return client['Request'](_0xe304('0x3'),{'body':_0x46b543,'options':{'where':{'uniqueid':_0x330fd1},'order':[['id',_0xe304('0x4')]],'limit':0x1},'log':_0xe304('0x3')});}; \ No newline at end of file +var _0x9396=['../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x4c9c5f,_0x72b841){var _0x48c866=function(_0xecc3a5){while(--_0xecc3a5){_0x4c9c5f['push'](_0x4c9c5f['shift']());}};_0x48c866(++_0x72b841);}(_0x9396,0x1e6));var _0x6939=function(_0x3579a9,_0x4728cb){_0x3579a9=_0x3579a9-0x0;var _0x9a342b=_0x9396[_0x3579a9];return _0x9a342b;};'use strict';var client=require(_0x6939('0x0'));exports['create']=function(_0x164f8c){return client[_0x6939('0x1')](_0x6939('0x2'),{'body':_0x164f8c,'log':_0x6939('0x2')});};exports[_0x6939('0x3')]=function(_0x42b0ce,_0x69ca8a){return client[_0x6939('0x1')](_0x6939('0x4'),{'body':_0x69ca8a,'options':{'where':{'uniqueid':_0x42b0ce},'order':[['id',_0x6939('0x5')]],'limit':0x1},'log':_0x6939('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 6c993c1..e04d0f5 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 _0xaaab=['addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xaaab,0x121));var _0xbaaa=function(_0x724b06,_0x2b1082){_0x724b06=_0x724b06-0x0;var _0x21e9ad=_0xaaab[_0x724b06];return _0x21e9ad;};'use strict';var client=require(_0xbaaa('0x0'));exports[_0xbaaa('0x1')]=function(_0x13310b,_0x43abf2){return client['Request'](_0xbaaa('0x2'),{'body':_0x43abf2,'options':{'where':{'id':_0x13310b}},'log':_0xbaaa('0x3')});};exports[_0xbaaa('0x4')]=function(_0x42b5ac,_0x5e3fa6){return client[_0xbaaa('0x5')](_0xbaaa('0x6'),{'body':_0x5e3fa6,'options':{'where':{'id':_0x42b5ac}},'log':_0xbaaa('0x7')});}; \ No newline at end of file +var _0x2c30=['update','UpdateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','../client'];(function(_0x14c8eb,_0xa648fa){var _0x476a1d=function(_0x431b37){while(--_0x431b37){_0x14c8eb['push'](_0x14c8eb['shift']());}};_0x476a1d(++_0xa648fa);}(_0x2c30,0x6b));var _0x02c3=function(_0x116b62,_0x21ea26){_0x116b62=_0x116b62-0x0;var _0x110fd6=_0x2c30[_0x116b62];return _0x110fd6;};'use strict';var client=require(_0x02c3('0x0'));exports[_0x02c3('0x1')]=function(_0x56274f,_0x31d62c){return client['Request'](_0x02c3('0x2'),{'body':_0x31d62c,'options':{'where':{'id':_0x56274f}},'log':'updateSmsInteraction'});};exports[_0x02c3('0x3')]=function(_0x75a6db,_0x17e525){return client[_0x02c3('0x4')](_0x02c3('0x5'),{'body':_0x17e525,'options':{'where':{'id':_0x75a6db}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 1181aa4..7246ff4 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 _0xc090=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0xc090,0x129));var _0x0c09=function(_0x44d8a1,_0x2e7674){_0x44d8a1=_0x44d8a1-0x0;var _0xc7f60c=_0xc090[_0x44d8a1];return _0xc7f60c;};'use strict';var client=require('../client');exports[_0x0c09('0x0')]=function(_0x229761){return client[_0x0c09('0x1')](_0x0c09('0x2'),{'body':_0x229761,'log':_0x0c09('0x3')});}; \ No newline at end of file +var _0x692a=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0xe6466f,_0x43337e){var _0x4fb15b=function(_0x43f655){while(--_0x43f655){_0xe6466f['push'](_0xe6466f['shift']());}};_0x4fb15b(++_0x43337e);}(_0x692a,0x171));var _0xa692=function(_0x25092c,_0x115577){_0x25092c=_0x25092c-0x0;var _0xe4fe3f=_0x692a[_0x25092c];return _0xe4fe3f;};'use strict';var client=require(_0xa692('0x0'));exports[_0xa692('0x1')]=function(_0x5670c7){return client[_0xa692('0x2')](_0xa692('0x3'),{'body':_0x5670c7,'log':_0xa692('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index cc3eccc..6a8b099 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 _0x121d=['name','timeout','strategy','User','Agents','online','../client','getSmsQueues','GetSmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x121d,0xf0));var _0xd121=function(_0x244837,_0x32e5dc){_0x244837=_0x244837-0x0;var _0x51bd5f=_0x121d[_0x244837];return _0x51bd5f;};'use strict';var client=require(_0xd121('0x0'));exports[_0xd121('0x1')]=function(){return function(){return client['Request'](_0xd121('0x2'),{'options':{'raw':![],'attributes':['id',_0xd121('0x3'),_0xd121('0x4'),_0xd121('0x5')],'include':[{'model':_0xd121('0x6'),'as':_0xd121('0x7'),'attributes':['id','name',_0xd121('0x8'),'smsPause']}]},'log':_0xd121('0x1')});};}; \ No newline at end of file +var _0x9eac=['name','timeout','strategy','online','smsPause','getSmsQueues','Request','GetSmsQueue'];(function(_0x5ee391,_0x3c62c0){var _0x4fdb0c=function(_0x226ff3){while(--_0x226ff3){_0x5ee391['push'](_0x5ee391['shift']());}};_0x4fdb0c(++_0x3c62c0);}(_0x9eac,0x14d));var _0xc9ea=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x9eac[_0x4f6d08];return _0x53a9c6;};'use strict';var client=require('../client');exports[_0xc9ea('0x0')]=function(){return function(){return client[_0xc9ea('0x1')](_0xc9ea('0x2'),{'options':{'raw':![],'attributes':['id',_0xc9ea('0x3'),_0xc9ea('0x4'),_0xc9ea('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xc9ea('0x3'),_0xc9ea('0x6'),_0xc9ea('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index b7e63a4..44e053c 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 _0x3b45=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1bae6f,_0x558b79){var _0x11bc15=function(_0x2ccea0){while(--_0x2ccea0){_0x1bae6f['push'](_0x1bae6f['shift']());}};_0x11bc15(++_0x558b79);}(_0x3b45,0x68));var _0x53b4=function(_0x4f51af,_0x212b4d){_0x4f51af=_0x4f51af-0x0;var _0x3f79db=_0x3b45[_0x4f51af];return _0x3f79db;};'use strict';var client=require(_0x53b4('0x0'));exports[_0x53b4('0x1')]=function(_0x11d160){return client[_0x53b4('0x2')](_0x53b4('0x3'),{'body':_0x11d160,'log':'CreateSmsQueueReport'});};exports[_0x53b4('0x4')]=function(_0x2de921,_0x1bfd8e){return client[_0x53b4('0x2')](_0x53b4('0x5'),{'body':_0x1bfd8e,'options':{'where':{'uniqueid':_0x2de921},'order':[['id',_0x53b4('0x6')]],'limit':0x1},'log':_0x53b4('0x5')});}; \ No newline at end of file +var _0xcd3b=['CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcd3b,0x19c));var _0xbcd3=function(_0x118085,_0x363df9){_0x118085=_0x118085-0x0;var _0x496ca3=_0xcd3b[_0x118085];return _0x496ca3;};'use strict';var client=require(_0xbcd3('0x0'));exports['create']=function(_0x30db39){return client[_0xbcd3('0x1')](_0xbcd3('0x2'),{'body':_0x30db39,'log':_0xbcd3('0x2')});};exports[_0xbcd3('0x3')]=function(_0x4ab5fb,_0x263b28){return client[_0xbcd3('0x1')](_0xbcd3('0x4'),{'body':_0x263b28,'options':{'where':{'uniqueid':_0x4ab5fb},'order':[['id',_0xbcd3('0x5')]],'limit':0x1},'log':_0xbcd3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 263aa50..14d1c50 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 _0x5bc6=['getAgents','Request','GetUser','agent','name','online','pauseType','lastPauseAt','chatPause','mailPause','faxPause','smsPause','whatsappPause','chatCapacity','faxCapacity','smsCapacity','whatsappCapacity','openchannelCapacity','../client'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5bc6,0x12f));var _0x65bc=function(_0xcce8dd,_0x261b67){_0xcce8dd=_0xcce8dd-0x0;var _0x57672c=_0x5bc6[_0xcce8dd];return _0x57672c;};'use strict';var client=require(_0x65bc('0x0'));exports[_0x65bc('0x1')]=function(){return function(){return client[_0x65bc('0x2')](_0x65bc('0x3'),{'options':{'raw':!![],'where':{'role':_0x65bc('0x4')},'attributes':['id',_0x65bc('0x5'),_0x65bc('0x6'),_0x65bc('0x7'),_0x65bc('0x8'),'voicePause',_0x65bc('0x9'),_0x65bc('0xa'),_0x65bc('0xb'),_0x65bc('0xc'),_0x65bc('0xd'),'openchannelPause',_0x65bc('0xe'),'mailCapacity',_0x65bc('0xf'),_0x65bc('0x10'),_0x65bc('0x11'),_0x65bc('0x12')]},'log':'getAgents'});};}; \ No newline at end of file +var _0xa9a4=['openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','GetUser','agent','name','pauseType','lastPauseAt','voicePause','mailPause','faxPause','whatsappPause'];(function(_0x52a1a7,_0x64af9d){var _0x3c0843=function(_0x596456){while(--_0x596456){_0x52a1a7['push'](_0x52a1a7['shift']());}};_0x3c0843(++_0x64af9d);}(_0xa9a4,0xd3));var _0x4a9a=function(_0x56fce8,_0xe21b15){_0x56fce8=_0x56fce8-0x0;var _0x44ad12=_0xa9a4[_0x56fce8];return _0x44ad12;};'use strict';var client=require(_0x4a9a('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x4a9a('0x1'),{'options':{'raw':!![],'where':{'role':_0x4a9a('0x2')},'attributes':['id',_0x4a9a('0x3'),'online',_0x4a9a('0x4'),_0x4a9a('0x5'),_0x4a9a('0x6'),'chatPause',_0x4a9a('0x7'),_0x4a9a('0x8'),'smsPause',_0x4a9a('0x9'),_0x4a9a('0xa'),_0x4a9a('0xb'),_0x4a9a('0xc'),_0x4a9a('0xd'),_0x4a9a('0xe'),'whatsappCapacity',_0x4a9a('0xf')]},'log':_0x4a9a('0x10')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 2c568c0..5c83062 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ed2=['AddTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ed2,0x114));var _0x25ed=function(_0x3eb998,_0x4f5cee){_0x3eb998=_0x3eb998-0x0;var _0x272be1=_0x5ed2[_0x3eb998];return _0x272be1;};'use strict';var client=require(_0x25ed('0x0'));exports['update']=function(_0xf95d0a,_0x106489){return client['Request'](_0x25ed('0x1'),{'body':_0x106489,'options':{'where':{'id':_0xf95d0a}},'log':_0x25ed('0x2')});};exports['addTags']=function(_0x1ce8d8,_0x2e6fb6){return client[_0x25ed('0x3')](_0x25ed('0x4'),{'body':_0x2e6fb6,'options':{'where':{'id':_0x1ce8d8}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x1542=['addTags','AddTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1542,0x116));var _0x2154=function(_0x4c096e,_0x507afb){_0x4c096e=_0x4c096e-0x0;var _0x3a5398=_0x1542[_0x4c096e];return _0x3a5398;};'use strict';var client=require(_0x2154('0x0'));exports[_0x2154('0x1')]=function(_0x24448e,_0x2dd755){return client[_0x2154('0x2')]('UpdateWhatsappInteraction',{'body':_0x2dd755,'options':{'where':{'id':_0x24448e}},'log':_0x2154('0x3')});};exports[_0x2154('0x4')]=function(_0x13e41b,_0x4ded8a){return client[_0x2154('0x2')](_0x2154('0x5'),{'body':_0x4ded8a,'options':{'where':{'id':_0x13e41b}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 0ac2abf..5880405 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b9a=['createWhatsappMessage','create','Request'];(function(_0xc27236,_0x21b0f0){var _0x3473f1=function(_0x94f3d1){while(--_0x94f3d1){_0xc27236['push'](_0xc27236['shift']());}};_0x3473f1(++_0x21b0f0);}(_0x0b9a,0x76));var _0xa0b9=function(_0x382242,_0x33d33f){_0x382242=_0x382242-0x0;var _0x312cb4=_0x0b9a[_0x382242];return _0x312cb4;};'use strict';var client=require('../client');exports[_0xa0b9('0x0')]=function(_0x16df3a){return client[_0xa0b9('0x1')]('CreateWhatsappMessage',{'body':_0x16df3a,'log':_0xa0b9('0x2')});}; \ No newline at end of file +var _0x0ed4=['CreateWhatsappMessage','../client','create','Request'];(function(_0x5cf1f5,_0x4326bb){var _0x3db23b=function(_0x2cbfd0){while(--_0x2cbfd0){_0x5cf1f5['push'](_0x5cf1f5['shift']());}};_0x3db23b(++_0x4326bb);}(_0x0ed4,0x16d));var _0x40ed=function(_0x1a9eb8,_0x32c795){_0x1a9eb8=_0x1a9eb8-0x0;var _0xe8be84=_0x0ed4[_0x1a9eb8];return _0xe8be84;};'use strict';var client=require(_0x40ed('0x0'));exports[_0x40ed('0x1')]=function(_0x267467){return client[_0x40ed('0x2')](_0x40ed('0x3'),{'body':_0x267467,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index efaae16..2437edc 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f7b=['getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents','name','online','whatsappPause','../client'];(function(_0x2a61a8,_0x197215){var _0x1488b8=function(_0x500a62){while(--_0x500a62){_0x2a61a8['push'](_0x2a61a8['shift']());}};_0x1488b8(++_0x197215);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x17bfaa,_0x5e6bf2){_0x17bfaa=_0x17bfaa-0x0;var _0x5df68c=_0x4f7b[_0x17bfaa];return _0x5df68c;};'use strict';var client=require(_0xb4f7('0x0'));exports[_0xb4f7('0x1')]=function(){return function(){return client[_0xb4f7('0x2')](_0xb4f7('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xb4f7('0x4'),_0xb4f7('0x5')],'include':[{'model':_0xb4f7('0x6'),'as':_0xb4f7('0x7'),'attributes':['id',_0xb4f7('0x8'),_0xb4f7('0x9'),_0xb4f7('0xa')]}]},'log':_0xb4f7('0x1')});};}; \ No newline at end of file +var _0x5ec6=['online','../client','getWhatsappQueues','Request','name','strategy','Agents'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5ec6,0x7f));var _0x65ec=function(_0x1344d1,_0x1b6b7f){_0x1344d1=_0x1344d1-0x0;var _0x45cd36=_0x5ec6[_0x1344d1];return _0x45cd36;};'use strict';var client=require(_0x65ec('0x0'));exports[_0x65ec('0x1')]=function(){return function(){return client[_0x65ec('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x65ec('0x3'),'timeout',_0x65ec('0x4')],'include':[{'model':'User','as':_0x65ec('0x5'),'attributes':['id','name',_0x65ec('0x6'),'whatsappPause']}]},'log':_0x65ec('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4aeebf8..81b1f53 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd92d=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create'];(function(_0x3fb6b2,_0x239e80){var _0x28f8b2=function(_0x41d655){while(--_0x41d655){_0x3fb6b2['push'](_0x3fb6b2['shift']());}};_0x28f8b2(++_0x239e80);}(_0xd92d,0x71));var _0xdd92=function(_0x4e44d6,_0x395d6d){_0x4e44d6=_0x4e44d6-0x0;var _0x1f328c=_0xd92d[_0x4e44d6];return _0x1f328c;};'use strict';var client=require('../client');exports[_0xdd92('0x0')]=function(_0x3b16d8){return client[_0xdd92('0x1')](_0xdd92('0x2'),{'body':_0x3b16d8,'log':_0xdd92('0x2')});};exports[_0xdd92('0x3')]=function(_0x381d3b,_0x148cb2){return client[_0xdd92('0x1')](_0xdd92('0x4'),{'body':_0x148cb2,'options':{'where':{'uniqueid':_0x381d3b},'order':[['id',_0xdd92('0x5')]],'limit':0x1},'log':_0xdd92('0x4')});}; \ No newline at end of file +var _0x868e=['update','../client','Request','CreateWhatsappQueueReport'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x868e,0x1dd));var _0xe868=function(_0x468104,_0x487820){_0x468104=_0x468104-0x0;var _0x2130e9=_0x868e[_0x468104];return _0x2130e9;};'use strict';var client=require(_0xe868('0x0'));exports['create']=function(_0x539551){return client[_0xe868('0x1')](_0xe868('0x2'),{'body':_0x539551,'log':_0xe868('0x2')});};exports[_0xe868('0x3')]=function(_0x448bff,_0x21d03c){return client[_0xe868('0x1')]('UpdateWhatsappQueueReport',{'body':_0x21d03c,'options':{'where':{'uniqueid':_0x448bff},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index f7834e7..c3ed284 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 _0x51e8=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','consequence','[%s][AGENT]\x20%s','message','join','stop','find','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','agent','error'];(function(_0x3c789a,_0x21708c){var _0x4f7bff=function(_0x6f91bf){while(--_0x6f91bf){_0x3c789a['push'](_0x3c789a['shift']());}};_0x4f7bff(++_0x21708c);}(_0x51e8,0x14d));var _0x851e=function(_0x33bcda,_0xd94d81){_0x33bcda=_0x33bcda-0x0;var _0x3ab3c8=_0x51e8[_0x33bcda];return _0x3ab3c8;};'use strict';var schema=require(_0x851e('0x0'));var _=require(_0x851e('0x1'));var util=require('util');var seqqueue=require(_0x851e('0x2'));var logger=require(_0x851e('0x3'))('routing');var strategy=require(_0x851e('0x4'));var queue=schema({'name':{'type':_0x851e('0x5'),'required':!![],'message':_0x851e('0x6')},'timeout':{'type':_0x851e('0x7'),'message':_0x851e('0x8')}});function writeLog(_0x4c82ef,_0x78dae3,_0x48f87d){return logger[_0x851e('0x9')](util[_0x851e('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4c82ef,_0x78dae3[_0x851e('0xb')],_0x48f87d));}function handleFindAgent(_0x159acf){return function(_0x2793aa){return _0x2793aa[_0x851e('0xb')]['toLowerCase']()===_0x159acf['toLowerCase']();};}exports[_0x851e('0xc')]=function(_0x3179d1,_0xb1165e,_0x303640,_0xa99dc){return function(_0x2dcf04){try{var _0x44411f={'name':_0xb1165e[0x0],'timeout':_0xb1165e[0x1]};var _0x22b0f9=queue[_0x851e('0x0')](_0x44411f,{'typecast':!![]});if(_0x22b0f9['length']){logger['error'](_0x851e('0xd'),_0x3179d1,_['map'](_0x22b0f9,_0x851e('0xe'))[_0x851e('0xf')](',\x20'));_0x2dcf04[_0x851e('0x10')]();}else{var _0x252926=_[_0x851e('0x11')](_0x303640['agents'],handleFindAgent(_0x44411f[_0x851e('0xb')]));if(_0x252926){var _0x305769=(_0x44411f['timeout']||0xa)*0x3e8;var _0x54db37,_0x5ba105;var _0x534366=seqqueue[_0x851e('0x12')](_0x305769);_0x534366['id']=_0x3179d1;_0x534366[_0x851e('0x13')]=_0x305769;_0x534366[_0x851e('0x14')]=_0xa99dc['channel'];writeLog(_0x3179d1,_0x252926,util[_0x851e('0xa')](_0x851e('0x15'),_0x305769));_0x303640['rules'][_0x3179d1]['on']('end',function(){logger['info'](_0x851e('0x16'),_0x3179d1);clearTimeout(_0x5ba105);_0x5ba105=undefined;_0x534366[_0x851e('0x17')]();if(_0x303640['rules'][_0x3179d1]){delete _0x303640[_0x851e('0x18')][_0x3179d1];}_0x2dcf04[_0x851e('0x10')]();});_0x303640[_0x851e('0x18')][_0x3179d1]['on']('complete',function(){if(_0x303640[_0x851e('0x18')][_0x3179d1]){delete _0x303640[_0x851e('0x18')][_0x3179d1];}});_0x5ba105=setTimeout(function(){logger[_0x851e('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x3179d1);clearTimeout(_0x5ba105);_0x534366['close']();_0x2dcf04['next']();},_0x305769);strategy[_0x851e('0x19')](_0x534366,_0x252926,_0x303640,_0xa99dc);}else{logger[_0x851e('0x1a')](_0x851e('0x1b'),_0x3179d1,_0x44411f[_0x851e('0xb')]);_0x2dcf04[_0x851e('0x10')]();}}}catch(_0x2a747a){console[_0x851e('0x1c')](_0x2a747a);logger[_0x851e('0x1a')]('[%s][QUEUE]\x20%s',_0x3179d1,_0x2a747a[_0x851e('0x1d')]);_0x2dcf04[_0x851e('0x10')]();}};}; \ No newline at end of file +var _0xd67a=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','stop','timeout','createQueue'];(function(_0x11ef11,_0x40ac2c){var _0x28c3e6=function(_0x2641d0){while(--_0x2641d0){_0x11ef11['push'](_0x11ef11['shift']());}};_0x28c3e6(++_0x40ac2c);}(_0xd67a,0x160));var _0xad67=function(_0x5f171b,_0x33d11a){_0x5f171b=_0x5f171b-0x0;var _0x2303d8=_0xd67a[_0x5f171b];return _0x2303d8;};'use strict';var schema=require(_0xad67('0x0'));var _=require('lodash');var util=require(_0xad67('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xad67('0x2'))(_0xad67('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xad67('0x4'),'required':!![],'message':_0xad67('0x5')},'timeout':{'type':_0xad67('0x6'),'message':_0xad67('0x7')}});function writeLog(_0x238d78,_0x17112a,_0x3fc6e6){return logger[_0xad67('0x8')](util[_0xad67('0x9')](_0xad67('0xa'),_0x238d78,_0x17112a['name'],_0x3fc6e6));}function handleFindAgent(_0x577408){return function(_0x55c8a0){return _0x55c8a0[_0xad67('0xb')][_0xad67('0xc')]()===_0x577408[_0xad67('0xc')]();};}exports[_0xad67('0xd')]=function(_0x36b939,_0x50fe5d,_0x3a262c,_0x4b70fd){return function(_0x3cae99){try{var _0x132f0e={'name':_0x50fe5d[0x0],'timeout':_0x50fe5d[0x1]};var _0xa179d9=queue[_0xad67('0x0')](_0x132f0e,{'typecast':!![]});if(_0xa179d9[_0xad67('0xe')]){logger[_0xad67('0xf')]('[%s][AGENT]\x20%s',_0x36b939,_['map'](_0xa179d9,_0xad67('0x10'))['join'](',\x20'));_0x3cae99[_0xad67('0x11')]();}else{var _0xab4d79=_['find'](_0x3a262c['agents'],handleFindAgent(_0x132f0e[_0xad67('0xb')]));if(_0xab4d79){var _0xf79e3c=(_0x132f0e[_0xad67('0x12')]||0xa)*0x3e8;var _0x53fa60,_0x366855;var _0x48cd40=seqqueue[_0xad67('0x13')](_0xf79e3c);_0x48cd40['id']=_0x36b939;_0x48cd40['atimeout']=_0xf79e3c;_0x48cd40['channel']=_0x4b70fd[_0xad67('0x14')];writeLog(_0x36b939,_0xab4d79,util[_0xad67('0x9')](_0xad67('0x15'),_0xf79e3c));_0x3a262c[_0xad67('0x16')][_0x36b939]['on'](_0xad67('0x17'),function(){logger[_0xad67('0x8')](_0xad67('0x18'),_0x36b939);clearTimeout(_0x366855);_0x366855=undefined;_0x48cd40['close']();if(_0x3a262c[_0xad67('0x16')][_0x36b939]){delete _0x3a262c['rules'][_0x36b939];}_0x3cae99[_0xad67('0x11')]();});_0x3a262c[_0xad67('0x16')][_0x36b939]['on']('complete',function(){if(_0x3a262c[_0xad67('0x16')][_0x36b939]){delete _0x3a262c[_0xad67('0x16')][_0x36b939];}});_0x366855=setTimeout(function(){logger[_0xad67('0x8')](_0xad67('0x19'),_0x36b939);clearTimeout(_0x366855);_0x48cd40['close']();_0x3cae99[_0xad67('0x1a')]();},_0xf79e3c);strategy[_0xad67('0x1b')](_0x48cd40,_0xab4d79,_0x3a262c,_0x4b70fd);}else{logger[_0xad67('0xf')](_0xad67('0x1c'),_0x36b939,_0x132f0e[_0xad67('0xb')]);_0x3cae99[_0xad67('0x11')]();}}}catch(_0x17d519){console[_0xad67('0x1d')](_0x17d519);logger[_0xad67('0xf')](_0xad67('0x1e'),_0x36b939,_0x17d519['stack']);_0x3cae99['stop']();}};}; \ 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 8835d00..82c1c5e 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 _0xe2fe=['info','[%s][AMAZONLEX]\x20%s','next','account','upperFirst','AccountId','InteractionId','isEmpty','getMustacheRender','Message','create','then','catch','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','body','channel','toString','postText','error','amazonlex','Failed','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xee2f('0x1'));var logger=require('../../../../config/logger')(_0xee2f('0x2'));var rpc={'chatMessage':require(_0xee2f('0x3')),'openchannelMessage':require(_0xee2f('0x4')),'mailMessage':require(_0xee2f('0x5')),'smsMessage':require(_0xee2f('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xee2f('0x7'))};exports[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return function(_0x2e1c8c){try{if(!_['isNil'](this[_0xee2f('0x9')]['UserId'])){logger[_0xee2f('0xa')](_0xee2f('0xb'),_0x49926b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2e1c8c[_0xee2f('0xc')]();}var _0x43f451={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x2b8fb1=this['channel'];if(_0x2b8fb1==='chat'){_0x43f451['ChatWebsiteId']=this[_0xee2f('0xd')]['id'];}else{_0x43f451[_[_0xee2f('0xe')](_0x2b8fb1)+_0xee2f('0xf')]=this[_0xee2f('0xd')]['id'];}_0x43f451[_[_0xee2f('0xe')](_0x2b8fb1)+_0xee2f('0x10')]=this['interaction']['id'];if(this[_0xee2f('0x9')]['created']){var _0x36db10=_0x1533a0[0x4];if(!_[_0xee2f('0x11')](_0x36db10)){_0x43f451['body']=utils[_0xee2f('0x12')](_0x36db10,this);return rpc[_0x2b8fb1+_0xee2f('0x13')][_0xee2f('0x14')](_0x43f451)[_0xee2f('0x15')](function(_0x390c2c){logger['info'](_0xee2f('0xb'),_0x49926b,_0x43f451['body']);})[_0xee2f('0x16')](function(_0x3359ff){logger['error']('[%s][AMAZONLEX]\x20%s',_0x49926b,JSON[_0xee2f('0x17')](_0x3359ff));})['finally'](function(){logger[_0xee2f('0xa')](_0xee2f('0x18'),_0x49926b);_0x2e1c8c[_0xee2f('0x19')]();});}else{logger['info'](_0xee2f('0x1a'),_0x49926b);_0x2e1c8c[_0xee2f('0x19')]();}}else{var _0x4db2cc=this;var _0x21fdf4=new AWS[(_0xee2f('0x1b'))]({'accessKeyId':_0x1533a0[0x0],'secretAccessKey':_0x1533a0[0x1],'region':_0x1533a0[0x2]});var _0x5d36d4={'botAlias':'$LATEST','botName':_0x1533a0[0x3],'inputText':this[_0xee2f('0x1c')][_0xee2f('0x1d')],'userId':this[_0xee2f('0x1e')]+':'+this[_0xee2f('0x9')]['id'][_0xee2f('0x1f')]()};_0x21fdf4[_0xee2f('0x20')](_0x5d36d4,function(_0x39a39c,_0x4d68d3){if(_0x39a39c){logger[_0xee2f('0x21')](_0xee2f('0xb'),_0x49926b,_0x39a39c[_0xee2f('0x1c')]);_0x2e1c8c[_0xee2f('0xc')]();}else if(_0x4d68d3&&_0x4d68d3[_0xee2f('0x1c')]){_0x4db2cc[_0xee2f('0x1d')][_0xee2f('0x22')]=_0x4d68d3;_0x43f451[_0xee2f('0x1d')]=_0x4d68d3[_0xee2f('0x1c')];return rpc[_0x2b8fb1+_0xee2f('0x13')][_0xee2f('0x14')](_0x43f451)[_0xee2f('0x15')](function(_0x1c8454){logger[_0xee2f('0xa')]('[%s][AMAZONLEX]\x20%s',_0x49926b,_0x43f451['body']);if(_0x4d68d3['dialogState']==_0xee2f('0x23')){_0x2e1c8c[_0xee2f('0xc')]();}else{_0x2e1c8c[_0xee2f('0x19')]();}})[_0xee2f('0x16')](function(_0x892a4e){logger[_0xee2f('0x21')]('[%s][AMAZONLEX]\x20%s',_0x49926b,JSON[_0xee2f('0x17')](_0x892a4e));_0x2e1c8c['next']();});}else{_0x2e1c8c[_0xee2f('0xc')]();}});}}catch(_0x180429){logger[_0xee2f('0x21')](_0xee2f('0xb'),_0x49926b,JSON[_0xee2f('0x17')](_0x180429));_0x2e1c8c['stop']();}};}; \ No newline at end of file +var _0xdbf5=['$LATEST','channel','interaction','toString','postText','message','amazonlex','dialogState','Failed','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','getMustacheRender','Message','create','then','info','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime'];(function(_0x3087a5,_0x522072){var _0x3ca976=function(_0x43c70e){while(--_0x43c70e){_0x3087a5['push'](_0x3087a5['shift']());}};_0x3ca976(++_0x522072);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x42da3c,_0x310d92){_0x42da3c=_0x42da3c-0x0;var _0x28f9a9=_0xdbf5[_0x42da3c];return _0x28f9a9;};'use strict';var _=require('lodash');var moment=require(_0x5dbf('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x5dbf('0x1'))(_0x5dbf('0x2'));var rpc={'chatMessage':require(_0x5dbf('0x3')),'openchannelMessage':require(_0x5dbf('0x4')),'mailMessage':require(_0x5dbf('0x5')),'smsMessage':require(_0x5dbf('0x6')),'faxMessage':require(_0x5dbf('0x7')),'whatsappMessage':require(_0x5dbf('0x8'))};exports[_0x5dbf('0x9')]=function(_0x3f8222,_0x209b7d){return function(_0x88128e){try{if(!_[_0x5dbf('0xa')](this['interaction'][_0x5dbf('0xb')])){logger['info'](_0x5dbf('0xc'),_0x3f8222,_0x5dbf('0xd'));return _0x88128e[_0x5dbf('0xe')]();}var _0x1813bb={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5dbf('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x1c7389=this['channel'];if(_0x1c7389==='chat'){_0x1813bb[_0x5dbf('0x10')]=this['account']['id'];}else{_0x1813bb[_[_0x5dbf('0x11')](_0x1c7389)+_0x5dbf('0x12')]=this[_0x5dbf('0x13')]['id'];}_0x1813bb[_[_0x5dbf('0x11')](_0x1c7389)+_0x5dbf('0x14')]=this['interaction']['id'];if(this['interaction'][_0x5dbf('0x15')]){var _0x3480c8=_0x209b7d[0x4];if(!_['isEmpty'](_0x3480c8)){_0x1813bb[_0x5dbf('0x16')]=utils[_0x5dbf('0x17')](_0x3480c8,this);return rpc[_0x1c7389+_0x5dbf('0x18')][_0x5dbf('0x19')](_0x1813bb)[_0x5dbf('0x1a')](function(_0x472eb9){logger[_0x5dbf('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x3f8222,_0x1813bb['body']);})[_0x5dbf('0x1c')](function(_0xc4cb1c){logger[_0x5dbf('0x1d')](_0x5dbf('0xc'),_0x3f8222,JSON[_0x5dbf('0x1e')](_0xc4cb1c));})['finally'](function(){logger[_0x5dbf('0x1b')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3f8222);_0x88128e['stop']();});}else{logger['info'](_0x5dbf('0x1f'),_0x3f8222);_0x88128e[_0x5dbf('0x20')]();}}else{var _0x358d46=this;var _0x2ab57c=new AWS[(_0x5dbf('0x21'))]({'accessKeyId':_0x209b7d[0x0],'secretAccessKey':_0x209b7d[0x1],'region':_0x209b7d[0x2]});var _0x5b2518={'botAlias':_0x5dbf('0x22'),'botName':_0x209b7d[0x3],'inputText':this['message'][_0x5dbf('0x16')],'userId':this[_0x5dbf('0x23')]+':'+this[_0x5dbf('0x24')]['id'][_0x5dbf('0x25')]()};_0x2ab57c[_0x5dbf('0x26')](_0x5b2518,function(_0x2f154e,_0x58085e){if(_0x2f154e){logger[_0x5dbf('0x1d')](_0x5dbf('0xc'),_0x3f8222,_0x2f154e[_0x5dbf('0x27')]);_0x88128e[_0x5dbf('0xe')]();}else if(_0x58085e&&_0x58085e[_0x5dbf('0x27')]){_0x358d46[_0x5dbf('0x16')][_0x5dbf('0x28')]=_0x58085e;_0x1813bb[_0x5dbf('0x16')]=_0x58085e[_0x5dbf('0x27')];return rpc[_0x1c7389+_0x5dbf('0x18')][_0x5dbf('0x19')](_0x1813bb)[_0x5dbf('0x1a')](function(_0x3f9e60){logger[_0x5dbf('0x1b')](_0x5dbf('0xc'),_0x3f8222,_0x1813bb[_0x5dbf('0x16')]);if(_0x58085e[_0x5dbf('0x29')]==_0x5dbf('0x2a')){_0x88128e[_0x5dbf('0xe')]();}else{_0x88128e[_0x5dbf('0x20')]();}})[_0x5dbf('0x1c')](function(_0x471027){logger[_0x5dbf('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3f8222,JSON[_0x5dbf('0x1e')](_0x471027));_0x88128e[_0x5dbf('0xe')]();});}else{_0x88128e[_0x5dbf('0xe')]();}});}}catch(_0x1fb9a7){logger[_0x5dbf('0x1d')](_0x5dbf('0xc'),_0x3f8222,JSON[_0x5dbf('0x1e')](_0x1fb9a7));_0x88128e[_0x5dbf('0x20')]();}};}; \ 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 4d77b47..fe5377b 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 _0x9d5c=['error','[RPC][%s][AUTOREPLY]\x20%s','stringify','create','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','isNil','interaction','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','getMustacheRender','contact','format','out','message','from','phone','subject','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','mail','Smtp','service','host','port','secure','authentication','user','inReplyTo','','';return mailRpc[_0xc9d5('0x2e')](_0x39f1bc,_0x41fa09)[_0xc9d5('0x2f')](function(_0xc550bc){logger['info'](_0xc9d5('0x30'),_0x34894f);_0x41fa09[_0xc9d5('0x31')]=_0xc550bc[_0xc9d5('0x15')][_0xc9d5('0x31')];return rpc[_0x16ae71+_0xc9d5('0x21')]['create'](_0x41fa09);})['then'](function(_0x27714c){logger[_0xc9d5('0xc')](_0xc9d5('0xd'),_0x34894f,JSON['stringify'](_0x27714c));})[_0xc9d5('0x32')](function(_0x947390){logger[_0xc9d5('0x33')](_0xc9d5('0x34'),_0x34894f,JSON[_0xc9d5('0x35')](_0x947390));})['finally'](function(){_0x455676[_0xc9d5('0xf')]();});}else{return rpc[this[_0xc9d5('0x10')]+_0xc9d5('0x21')][_0xc9d5('0x36')](_0x41fa09)[_0xc9d5('0x2f')](function(_0x24272c){logger[_0xc9d5('0xc')](_0xc9d5('0xd'),_0x34894f,_0x41fa09['body']);})['catch'](function(_0x3cc5aa){logger[_0xc9d5('0x33')]('[%s][AUTOREPLY]\x20%s',_0x34894f,JSON[_0xc9d5('0x35')](_0x3cc5aa));})['finally'](function(){_0x455676[_0xc9d5('0xf')]();});}}}catch(_0x895393){logger[_0xc9d5('0x33')](_0xc9d5('0xd'),_0x34894f,JSON[_0xc9d5('0x35')](_0x895393));_0x455676[_0xc9d5('0x37')]();}};}; \ No newline at end of file +var _0xb1dc=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','Message','mail','service','host','Smtp','secure','authentication','auth','user','inReplyTo','messageId','','';return mailRpc['sendMailMessage'](_0x96b5e1,_0x386d4f)[_0xcb1d('0x2e')](function(_0x4ea0a5){logger[_0xcb1d('0xd')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3bf356);_0x386d4f[_0xcb1d('0x2b')]=_0x4ea0a5[_0xcb1d('0x15')][_0xcb1d('0x2b')];return rpc[_0x4efa15+_0xcb1d('0x21')]['create'](_0x386d4f);})['then'](function(_0x1a9342){logger[_0xcb1d('0xd')]('[%s][AUTOREPLY]\x20%s',_0x3bf356,JSON[_0xcb1d('0x2f')](_0x1a9342));})['catch'](function(_0xfcfbe4){logger['error'](_0xcb1d('0x30'),_0x3bf356,JSON['stringify'](_0xfcfbe4));})['finally'](function(){_0x15c492[_0xcb1d('0x31')]();});}else{return rpc[this[_0xcb1d('0x1e')]+_0xcb1d('0x21')]['create'](_0x386d4f)[_0xcb1d('0x2e')](function(_0x5d1b8d){logger[_0xcb1d('0xd')](_0xcb1d('0xe'),_0x3bf356,_0x386d4f['body']);})[_0xcb1d('0x32')](function(_0x212081){logger['error'](_0xcb1d('0xe'),_0x3bf356,JSON['stringify'](_0x212081));})[_0xcb1d('0x33')](function(){_0x15c492['next']();});}}}catch(_0x17486b){logger['error'](_0xcb1d('0xe'),_0x3bf356,JSON[_0xcb1d('0x2f')](_0x17486b));_0x15c492['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 8f48a3e..242de34 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 _0xe260=['stringify','finally','stop','[%s][CLOSE]\x20%s','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x9065f2,_0x35e146){var _0x4a35fd=function(_0x2ecb55){while(--_0x2ecb55){_0x9065f2['push'](_0x9065f2['shift']());}};_0x4a35fd(++_0x35e146);}(_0xe260,0x94));var _0x0e26=function(_0xcd9444,_0x411ed8){_0xcd9444=_0xcd9444-0x0;var _0x55105e=_0xe260[_0xcd9444];return _0x55105e;};'use strict';var moment=require(_0x0e26('0x0'));var logger=require('../../../../config/logger')(_0x0e26('0x1'));var rpc={'chatInteraction':require(_0x0e26('0x2')),'openchannelInteraction':require(_0x0e26('0x3')),'smsInteraction':require(_0x0e26('0x4')),'mailInteraction':require(_0x0e26('0x5')),'faxInteraction':require(_0x0e26('0x6')),'whatsappInteraction':require(_0x0e26('0x7'))};exports[_0x0e26('0x8')]=function(_0x141a58,_0x239f5e,_0x48cea9,_0x593669){return function(_0x15018a){try{logger[_0x0e26('0x9')](_0x0e26('0xa'),_0x141a58,_0x239f5e[0x0]);var _0x2ed98e={'closed':0x1,'closedAt':moment()[_0x0e26('0xb')](_0x0e26('0xc')),'closeReason':_0x0e26('0xd'),'disposition':_0x239f5e[0x0]};if(rpc[_0x593669['channel']+_0x0e26('0xe')]){rpc[_0x593669['channel']+_0x0e26('0xe')][_0x0e26('0xf')](_0x593669[_0x0e26('0x10')]['id'],_0x2ed98e)['then'](function(_0x5053fa){logger[_0x0e26('0x9')](_0x0e26('0x11'),_0x141a58,_0x593669['interaction']['id']);})[_0x0e26('0x12')](function(_0x6cf83e){logger[_0x0e26('0x13')]('[%s][CLOSE]\x20%s',_0x141a58,JSON[_0x0e26('0x14')](_0x6cf83e));})[_0x0e26('0x15')](function(){_0x15018a[_0x0e26('0x16')]();});}}catch(_0x3208a9){logger[_0x0e26('0x13')](_0x0e26('0x17'),_0x141a58,JSON[_0x0e26('0x14')](_0x3208a9));_0x15018a['stop']();}};}; \ No newline at end of file +var _0x4489=['../../rpc/smsInteraction','../../rpc/mailInteraction','[%s][CLOSE]\x20reason\x20%s','format','Interaction','channel','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0xa9b067,_0x2047eb){var _0x492156=function(_0x32a056){while(--_0x32a056){_0xa9b067['push'](_0xa9b067['shift']());}};_0x492156(++_0x2047eb);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9448('0x0'));var logger=require(_0x9448('0x1'))('routing');var rpc={'chatInteraction':require(_0x9448('0x2')),'openchannelInteraction':require(_0x9448('0x3')),'smsInteraction':require(_0x9448('0x4')),'mailInteraction':require(_0x9448('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x5333bf,_0x541cbe,_0x117d3a,_0x59f0d7){return function(_0x302cae){try{logger['info'](_0x9448('0x6'),_0x5333bf,_0x541cbe[0x0]);var _0x3996a1={'closed':0x1,'closedAt':moment()[_0x9448('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x541cbe[0x0]};if(rpc[_0x59f0d7['channel']+_0x9448('0x8')]){rpc[_0x59f0d7[_0x9448('0x9')]+_0x9448('0x8')][_0x9448('0xa')](_0x59f0d7[_0x9448('0xb')]['id'],_0x3996a1)['then'](function(_0x389647){logger[_0x9448('0xc')](_0x9448('0xd'),_0x5333bf,_0x59f0d7[_0x9448('0xb')]['id']);})[_0x9448('0xe')](function(_0x3a9c09){logger[_0x9448('0xf')](_0x9448('0x10'),_0x5333bf,JSON['stringify'](_0x3a9c09));})[_0x9448('0x11')](function(){_0x302cae['stop']();});}}catch(_0x323fd2){logger[_0x9448('0xf')]('[%s][CLOSE]\x20%s',_0x5333bf,JSON[_0x9448('0x12')](_0x323fd2));_0x302cae[_0x9448('0x13')]();}};}; \ 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 d82e9a9..4af8b2d 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 _0x7eda=['speech','result','metadata','endConversation','next','message','lodash','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','fulfillment'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x7eda,0x1e6));var _0xa7ed=function(_0x30c14c,_0x32d8dd){_0x30c14c=_0x30c14c-0x0;var _0x2527d1=_0x7eda[_0x30c14c];return _0x2527d1;};'use strict';var _=require(_0xa7ed('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0xa7ed('0x1'));var utils=require('./utils');var logger=require(_0xa7ed('0x2'))(_0xa7ed('0x3'));var rpc={'chatMessage':require(_0xa7ed('0x4')),'openchannelMessage':require(_0xa7ed('0x5')),'mailMessage':require(_0xa7ed('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x36f3a6,_0x10fdcf){return function(_0x1f7eb3){try{if(!_[_0xa7ed('0x7')](this[_0xa7ed('0x8')]['UserId'])){logger[_0xa7ed('0x9')]('[%s][DIALOGFLOW]\x20%s',_0x36f3a6,_0xa7ed('0xa'));return _0x1f7eb3['next']();}var _0x390467={'ContactId':this[_0xa7ed('0xb')]['id'],'sentAt':moment()[_0xa7ed('0xc')](_0xa7ed('0xd')),'direction':'out'};var _0x41c62b=this[_0xa7ed('0xe')];if(_0x41c62b===_0xa7ed('0xf')){_0x390467[_0xa7ed('0x10')]=this[_0xa7ed('0x11')]['id'];}else{_0x390467[_[_0xa7ed('0x12')](_0x41c62b)+'AccountId']=this[_0xa7ed('0x11')]['id'];}_0x390467[_[_0xa7ed('0x12')](_0x41c62b)+_0xa7ed('0x13')]=this['interaction']['id'];if(this['interaction']['created']){var _0x188130=_0x10fdcf[0x2];if(!_[_0xa7ed('0x14')](_0x188130)){_0x390467[_0xa7ed('0x15')]=utils['getMustacheRender'](_0x188130,this);return rpc[_0x41c62b+_0xa7ed('0x16')][_0xa7ed('0x17')](_0x390467)[_0xa7ed('0x18')](function(_0x5ca8fb){logger[_0xa7ed('0x9')](_0xa7ed('0x19'),_0x36f3a6,_0x390467[_0xa7ed('0x15')]);})[_0xa7ed('0x1a')](function(_0x716034){logger[_0xa7ed('0x1b')](_0xa7ed('0x19'),_0x36f3a6,JSON[_0xa7ed('0x1c')](_0x716034));})[_0xa7ed('0x1d')](function(){logger[_0xa7ed('0x9')](_0xa7ed('0x1e'),_0x36f3a6);_0x1f7eb3[_0xa7ed('0x1f')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x36f3a6);_0x1f7eb3[_0xa7ed('0x1f')]();}}else{var _0x524dcc=this;var _0x463db6=apiai(_0x10fdcf[0x0],{'language':_0x10fdcf[0x1]||'en'});return _0x463db6[_0xa7ed('0x20')](this['message'][_0xa7ed('0x15')],{'sessionId':md5(this[_0xa7ed('0x8')]['id'])})[_0xa7ed('0x18')](function(_0x2b7e7c){_0x524dcc[_0xa7ed('0x15')]['dialogflow']=_0x2b7e7c;_0x390467[_0xa7ed('0x15')]=_0x2b7e7c['result'][_0xa7ed('0x21')][_0xa7ed('0x22')];return rpc[_0x41c62b+_0xa7ed('0x16')][_0xa7ed('0x17')](_0x390467)[_0xa7ed('0x18')](function(_0x31c870){logger['info'](_0xa7ed('0x19'),_0x36f3a6,_0x390467[_0xa7ed('0x15')]);if(_0x2b7e7c[_0xa7ed('0x23')][_0xa7ed('0x24')][_0xa7ed('0x25')]){_0x1f7eb3[_0xa7ed('0x26')]();}else{_0x1f7eb3[_0xa7ed('0x1f')]();}})[_0xa7ed('0x1a')](function(_0x59c9d0){logger[_0xa7ed('0x1b')](_0xa7ed('0x19'),_0x36f3a6,JSON[_0xa7ed('0x1c')](_0x59c9d0));_0x1f7eb3['next']();});})['catch'](function(_0x1f99f3){logger[_0xa7ed('0x1b')](_0xa7ed('0x19'),_0x36f3a6,_0x1f99f3[_0xa7ed('0x27')]);_0x1f7eb3[_0xa7ed('0x26')]();});}}catch(_0x1bb6b3){logger[_0xa7ed('0x1b')](_0xa7ed('0x19'),_0x36f3a6,JSON['stringify'](_0x1bb6b3));_0x1f7eb3[_0xa7ed('0x1f')]();}};}; \ No newline at end of file +var _0x6fde=['AccountId','account','InteractionId','isEmpty','Message','create','body','catch','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','then','dialogflow','result','fulfillment','speech','metadata','error','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','format','out','chat','ChatWebsiteId'];(function(_0x2c10d1,_0x9a1e2b){var _0x119b4a=function(_0xcee1a5){while(--_0xcee1a5){_0x2c10d1['push'](_0x2c10d1['shift']());}};_0x119b4a(++_0x9a1e2b);}(_0x6fde,0x8f));var _0xe6fd=function(_0x1dc7f0,_0x50a883){_0x1dc7f0=_0x1dc7f0-0x0;var _0x505485=_0x6fde[_0x1dc7f0];return _0x505485;};'use strict';var _=require('lodash');var moment=require(_0xe6fd('0x0'));var apiai=require(_0xe6fd('0x1'));var md5=require(_0xe6fd('0x2'));var utils=require(_0xe6fd('0x3'));var logger=require(_0xe6fd('0x4'))(_0xe6fd('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe6fd('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe6fd('0x7')),'faxMessage':require(_0xe6fd('0x8')),'whatsappMessage':require(_0xe6fd('0x9'))};exports[_0xe6fd('0xa')]=function(_0x5836f0,_0x5711e8){return function(_0x2d52e4){try{if(!_[_0xe6fd('0xb')](this[_0xe6fd('0xc')][_0xe6fd('0xd')])){logger[_0xe6fd('0xe')](_0xe6fd('0xf'),_0x5836f0,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2d52e4[_0xe6fd('0x10')]();}var _0x356b03={'ContactId':this['contact']['id'],'sentAt':moment()[_0xe6fd('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xe6fd('0x12')};var _0x1e283c=this['channel'];if(_0x1e283c===_0xe6fd('0x13')){_0x356b03[_0xe6fd('0x14')]=this['account']['id'];}else{_0x356b03[_['upperFirst'](_0x1e283c)+_0xe6fd('0x15')]=this[_0xe6fd('0x16')]['id'];}_0x356b03[_['upperFirst'](_0x1e283c)+_0xe6fd('0x17')]=this[_0xe6fd('0xc')]['id'];if(this[_0xe6fd('0xc')]['created']){var _0x34231e=_0x5711e8[0x2];if(!_[_0xe6fd('0x18')](_0x34231e)){_0x356b03['body']=utils['getMustacheRender'](_0x34231e,this);return rpc[_0x1e283c+_0xe6fd('0x19')][_0xe6fd('0x1a')](_0x356b03)['then'](function(_0x53a149){logger[_0xe6fd('0xe')](_0xe6fd('0xf'),_0x5836f0,_0x356b03[_0xe6fd('0x1b')]);})[_0xe6fd('0x1c')](function(_0x59546d){logger['error'](_0xe6fd('0xf'),_0x5836f0,JSON[_0xe6fd('0x1d')](_0x59546d));})[_0xe6fd('0x1e')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5836f0);_0x2d52e4[_0xe6fd('0x1f')]();});}else{logger[_0xe6fd('0xe')](_0xe6fd('0x20'),_0x5836f0);_0x2d52e4[_0xe6fd('0x1f')]();}}else{var _0x47c400=this;var _0xc6c12b=apiai(_0x5711e8[0x0],{'language':_0x5711e8[0x1]||'en'});return _0xc6c12b[_0xe6fd('0x21')](this['message']['body'],{'sessionId':md5(this[_0xe6fd('0xc')]['id'])})[_0xe6fd('0x22')](function(_0x1821a2){_0x47c400['body'][_0xe6fd('0x23')]=_0x1821a2;_0x356b03[_0xe6fd('0x1b')]=_0x1821a2[_0xe6fd('0x24')][_0xe6fd('0x25')][_0xe6fd('0x26')];return rpc[_0x1e283c+_0xe6fd('0x19')][_0xe6fd('0x1a')](_0x356b03)[_0xe6fd('0x22')](function(_0x49524a){logger['info'](_0xe6fd('0xf'),_0x5836f0,_0x356b03['body']);if(_0x1821a2[_0xe6fd('0x24')][_0xe6fd('0x27')]['endConversation']){_0x2d52e4[_0xe6fd('0x10')]();}else{_0x2d52e4[_0xe6fd('0x1f')]();}})[_0xe6fd('0x1c')](function(_0x448c15){logger[_0xe6fd('0x28')](_0xe6fd('0xf'),_0x5836f0,JSON[_0xe6fd('0x1d')](_0x448c15));_0x2d52e4[_0xe6fd('0x10')]();});})[_0xe6fd('0x1c')](function(_0x50383d){logger[_0xe6fd('0x28')](_0xe6fd('0xf'),_0x5836f0,_0x50383d['message']);_0x2d52e4[_0xe6fd('0x10')]();});}}catch(_0x550a99){logger['error'](_0xe6fd('0xf'),_0x5836f0,JSON[_0xe6fd('0x1d')](_0x550a99));_0x2d52e4[_0xe6fd('0x1f')]();}};}; \ 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 307c5b3..a16de6d 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 _0x41cf=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityTrue','priorityFalse'];(function(_0x248b28,_0x775889){var _0x4d6ff5=function(_0x15bf75){while(--_0x15bf75){_0x248b28['push'](_0x248b28['shift']());}};_0x4d6ff5(++_0x775889);}(_0x41cf,0x1d8));var _0xf41c=function(_0xa8f24a,_0x48d7d3){_0xa8f24a=_0xa8f24a-0x0;var _0x3a1471=_0x41cf[_0xa8f24a];return _0x3a1471;};'use strict';var schema=require(_0xf41c('0x0'));var _=require(_0xf41c('0x1'));var htmlToText=require(_0xf41c('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xf41c('0x3'));var gotoif=schema({'condition':{'type':_0xf41c('0x4'),'required':!![],'message':_0xf41c('0x5')},'priorityTrue':{'type':_0xf41c('0x6'),'message':_0xf41c('0x7')},'priorityFalse':{'type':_0xf41c('0x6'),'message':_0xf41c('0x8')}});exports[_0xf41c('0x9')]=function(_0x3b2e06,_0x2165bb){return function(_0x1d600b){try{var _0x5ba56f={'condition':htmlToText[_0xf41c('0xa')](utils[_0xf41c('0xb')](_0x2165bb[0x0],this),{'wordwrap':![]})[_0xf41c('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2165bb[0x1],'priorityFalse':_0x2165bb[0x2]};var _0x3a32dc=gotoif[_0xf41c('0x0')](_0x5ba56f,{'typecast':!![]});if(_0x3a32dc['length']){logger[_0xf41c('0xd')](_0xf41c('0xe'),_0x3b2e06,_[_0xf41c('0xf')](_0x3a32dc,_0xf41c('0x10'))[_0xf41c('0x11')](',\x20'));_0x1d600b[_0xf41c('0x12')]();}else{try{var _0x393458=eval('('+_0x5ba56f['condition']+')');var _0x6d55d=_0x393458?_0x5ba56f[_0xf41c('0x13')]:_0x5ba56f[_0xf41c('0x14')];logger[_0xf41c('0x15')](_0xf41c('0x16'),_0x3b2e06,_0x5ba56f['condition'],_0x393458,_0x6d55d||_0xf41c('0x17'));if(_0x6d55d){var _0x77eba0=_[_0xf41c('0x18')](_0x1d600b[_0xf41c('0x19')](),{'p':_0x6d55d});if(_0x77eba0>=0x0){logger[_0xf41c('0x15')](_0xf41c('0x1a'),_0x3b2e06,_0x6d55d||_0xf41c('0x17'),_0x77eba0);_0x1d600b[_0xf41c('0x17')](_0x77eba0);}else{logger[_0xf41c('0x15')](_0xf41c('0x1b'),_0x3b2e06,_0x6d55d||'next');_0x1d600b['stop']();}}else{_0x1d600b['next']();}}catch(_0x21fcae){logger[_0xf41c('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3b2e06,_0x21fcae[_0xf41c('0x10')]);_0x1d600b[_0xf41c('0x12')]();}}}catch(_0x2691a2){logger[_0xf41c('0xd')](_0xf41c('0xe'),_0x3b2e06,JSON[_0xf41c('0x1c')](_0x2691a2));_0x1d600b[_0xf41c('0x12')]();}};}; \ No newline at end of file +var _0x1ae5=['message','join','stop','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1ae5,0x12f));var _0x51ae=function(_0x22c3ce,_0x55e6c0){_0x22c3ce=_0x22c3ce-0x0;var _0x459157=_0x1ae5[_0x22c3ce];return _0x459157;};'use strict';var schema=require(_0x51ae('0x0'));var _=require(_0x51ae('0x1'));var htmlToText=require(_0x51ae('0x2'));var utils=require(_0x51ae('0x3'));var logger=require(_0x51ae('0x4'))('routing');var gotoif=schema({'condition':{'type':_0x51ae('0x5'),'required':!![],'message':_0x51ae('0x6')},'priorityTrue':{'type':_0x51ae('0x7'),'message':_0x51ae('0x8')},'priorityFalse':{'type':_0x51ae('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x51ae('0x9')]=function(_0x129756,_0x384f14){return function(_0x38c3a3){try{var _0x3da6bd={'condition':htmlToText[_0x51ae('0xa')](utils['getMustacheRender'](_0x384f14[0x0],this),{'wordwrap':![]})[_0x51ae('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x384f14[0x1],'priorityFalse':_0x384f14[0x2]};var _0x4e773a=gotoif[_0x51ae('0x0')](_0x3da6bd,{'typecast':!![]});if(_0x4e773a[_0x51ae('0xc')]){logger[_0x51ae('0xd')](_0x51ae('0xe'),_0x129756,_[_0x51ae('0xf')](_0x4e773a,_0x51ae('0x10'))[_0x51ae('0x11')](',\x20'));_0x38c3a3[_0x51ae('0x12')]();}else{try{var _0x20088b=eval('('+_0x3da6bd[_0x51ae('0x13')]+')');var _0x3e5ad5=_0x20088b?_0x3da6bd['priorityTrue']:_0x3da6bd[_0x51ae('0x14')];logger['info'](_0x51ae('0x15'),_0x129756,_0x3da6bd['condition'],_0x20088b,_0x3e5ad5||_0x51ae('0x16'));if(_0x3e5ad5){var _0x5f53ce=_[_0x51ae('0x17')](_0x38c3a3[_0x51ae('0x18')](),{'p':_0x3e5ad5});if(_0x5f53ce>=0x0){logger['info'](_0x51ae('0x19'),_0x129756,_0x3e5ad5||_0x51ae('0x16'),_0x5f53ce);_0x38c3a3[_0x51ae('0x16')](_0x5f53ce);}else{logger['info'](_0x51ae('0x1a'),_0x129756,_0x3e5ad5||_0x51ae('0x16'));_0x38c3a3[_0x51ae('0x12')]();}}else{_0x38c3a3['next']();}}catch(_0x5e3bcb){logger[_0x51ae('0xd')](_0x51ae('0x1b'),_0x129756,_0x5e3bcb[_0x51ae('0x10')]);_0x38c3a3['stop']();}}}catch(_0x32257c){logger[_0x51ae('0xd')](_0x51ae('0xe'),_0x129756,JSON[_0x51ae('0x1c')](_0x32257c));_0x38c3a3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 31f56fb..2965f78 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 _0x8e7e=['[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error'];(function(_0x299cd2,_0xdac798){var _0x57c9e5=function(_0x162b51){while(--_0x162b51){_0x299cd2['push'](_0x299cd2['shift']());}};_0x57c9e5(++_0xdac798);}(_0x8e7e,0xc9));var _0xe8e7=function(_0x45cdbb,_0x2b59a9){_0x45cdbb=_0x45cdbb-0x0;var _0x3beaa1=_0x8e7e[_0x45cdbb];return _0x3beaa1;};'use strict';var schema=require('validate');var _=require(_0xe8e7('0x0'));var logger=require(_0xe8e7('0x1'))('routing');var gotop=schema({'priority':{'type':_0xe8e7('0x2'),'required':!![],'message':_0xe8e7('0x3')}});exports[_0xe8e7('0x4')]=function(_0x3ac90f,_0x263d50){return function(_0x50f922){try{var _0x498991={'priority':_0x263d50[0x0]};var _0x4b28c7=gotop[_0xe8e7('0x5')](_0x498991,{'typecast':!![]});if(_0x4b28c7[_0xe8e7('0x6')]){logger[_0xe8e7('0x7')](_0xe8e7('0x8'),_0x3ac90f,_[_0xe8e7('0x9')](_0x4b28c7,'message')[_0xe8e7('0xa')](',\x20'));_0x50f922[_0xe8e7('0xb')]();}else{logger[_0xe8e7('0xc')](_0xe8e7('0xd'),_0x3ac90f,_0x498991[_0xe8e7('0xe')]);if(_0x498991[_0xe8e7('0xe')]){var _0x2eaba7=_[_0xe8e7('0xf')](_0x50f922[_0xe8e7('0x10')](),{'p':_0x498991[_0xe8e7('0xe')]});if(_0x2eaba7>=0x0){logger[_0xe8e7('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3ac90f,_0x498991['priority']||'next',_0x2eaba7);_0x50f922['next'](_0x2eaba7);}else{logger[_0xe8e7('0xc')](_0xe8e7('0x11'),_0x3ac90f,_0x498991[_0xe8e7('0xe')]||'next');_0x50f922[_0xe8e7('0xb')]();}}else{_0x50f922['next']();}}}catch(_0x25848e){logger[_0xe8e7('0x7')]('[%s][GOTOP]\x20%s',_0x3ac90f,JSON[_0xe8e7('0x12')](_0x25848e));_0x50f922[_0xe8e7('0xb')]();}};}; \ No newline at end of file +var _0xb27c=['routing','number','consequence','error','map','message','join','stop','info','priority','findIndex','next','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger'];(function(_0x536f9f,_0x50116a){var _0x2012bc=function(_0x18256a){while(--_0x18256a){_0x536f9f['push'](_0x536f9f['shift']());}};_0x2012bc(++_0x50116a);}(_0xb27c,0x18e));var _0xcb27=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0xb27c[_0x4b6830];return _0x239e4a;};'use strict';var schema=require(_0xcb27('0x0'));var _=require('lodash');var logger=require(_0xcb27('0x1'))(_0xcb27('0x2'));var gotop=schema({'priority':{'type':_0xcb27('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xcb27('0x4')]=function(_0x22aeda,_0x1ee3a4){return function(_0xbecefd){try{var _0x1b38da={'priority':_0x1ee3a4[0x0]};var _0x3acb21=gotop[_0xcb27('0x0')](_0x1b38da,{'typecast':!![]});if(_0x3acb21['length']){logger[_0xcb27('0x5')]('[%s][GOTOP]\x20%s',_0x22aeda,_[_0xcb27('0x6')](_0x3acb21,_0xcb27('0x7'))[_0xcb27('0x8')](',\x20'));_0xbecefd[_0xcb27('0x9')]();}else{logger[_0xcb27('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x22aeda,_0x1b38da[_0xcb27('0xb')]);if(_0x1b38da[_0xcb27('0xb')]){var _0x4b8d03=_[_0xcb27('0xc')](_0xbecefd['rules'](),{'p':_0x1b38da['priority']});if(_0x4b8d03>=0x0){logger[_0xcb27('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x22aeda,_0x1b38da[_0xcb27('0xb')]||_0xcb27('0xd'),_0x4b8d03);_0xbecefd['next'](_0x4b8d03);}else{logger[_0xcb27('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x22aeda,_0x1b38da['priority']||'next');_0xbecefd[_0xcb27('0x9')]();}}else{_0xbecefd['next']();}}}catch(_0x4fcc73){logger[_0xcb27('0x5')](_0xcb27('0xe'),_0x22aeda,JSON[_0xcb27('0xf')](_0x4fcc73));_0xbecefd[_0xcb27('0x9')]();}};}; \ 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 fe31036..63ca066 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 _0x5d44=['consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x69c91e,_0x2ab08c){var _0x22cb44=function(_0x5402d8){while(--_0x5402d8){_0x69c91e['push'](_0x69c91e['shift']());}};_0x22cb44(++_0x2ab08c);}(_0x5d44,0x18e));var _0x45d4=function(_0x378544,_0xe4fc9a){_0x378544=_0x378544-0x0;var _0x5aafab=_0x5d44[_0x378544];return _0x5aafab;};'use strict';var _=require(_0x45d4('0x0'));var utils=require(_0x45d4('0x1'));var logger=require(_0x45d4('0x2'))(_0x45d4('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x45d4('0x4')),'mailMessage':require(_0x45d4('0x5')),'smsMessage':require(_0x45d4('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x45d4('0x7'))};exports[_0x45d4('0x8')]=function(_0x2d44ac,_0x599e9a){return function(_0x43e7af){try{var _0x28b4b4={'body':utils[_0x45d4('0x9')](_0x599e9a[0x0],this),'ContactId':this[_0x45d4('0xa')]['id']};if(this[_0x45d4('0xb')]===_0x45d4('0xc')){_0x28b4b4[_0x45d4('0xd')]=this[_0x45d4('0xe')]['id'];}else{_0x28b4b4[_['upperFirst'](this['channel'])+_0x45d4('0xf')]=this['account']['id'];}_0x28b4b4[_[_0x45d4('0x10')](this[_0x45d4('0xb')])+_0x45d4('0x11')]=this[_0x45d4('0x12')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x45d4('0xb')]+_0x45d4('0x13')][_0x45d4('0x14')](_0x28b4b4)[_0x45d4('0x15')](function(_0x156cec){logger[_0x45d4('0x16')](_0x45d4('0x17'),_0x2d44ac,_0x28b4b4[_0x45d4('0x18')]);_0x43e7af[_0x45d4('0x19')]();})['catch'](function(_0xe1de01){logger[_0x45d4('0x1a')](_0x45d4('0x17'),_0x2d44ac,JSON[_0x45d4('0x1b')](_0xe1de01));_0x43e7af['stop']();});}}catch(_0x4f2e5){logger[_0x45d4('0x1a')]('[%s][MESSAGE]\x20%s',_0x2d44ac,JSON[_0x45d4('0x1b')](_0x4f2e5));_0x43e7af[_0x45d4('0x1c')]();}};}; \ No newline at end of file +var _0xf288=['next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','Message','create','info','[%s][MESSAGE]\x20%s'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xf288,0x163));var _0x8f28=function(_0x16cf9e,_0x3d3cfd){_0x16cf9e=_0x16cf9e-0x0;var _0x56aefd=_0xf288[_0x16cf9e];return _0x56aefd;};'use strict';var _=require(_0x8f28('0x0'));var utils=require(_0x8f28('0x1'));var logger=require(_0x8f28('0x2'))(_0x8f28('0x3'));var rpc={'chatMessage':require(_0x8f28('0x4')),'openchannelMessage':require(_0x8f28('0x5')),'mailMessage':require(_0x8f28('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8f28('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x20d63c,_0xe2086e){return function(_0x1ff991){try{var _0x55a529={'body':utils[_0x8f28('0x8')](_0xe2086e[0x0],this),'ContactId':this[_0x8f28('0x9')]['id']};if(this['channel']===_0x8f28('0xa')){_0x55a529[_0x8f28('0xb')]=this[_0x8f28('0xc')]['id'];}else{_0x55a529[_[_0x8f28('0xd')](this[_0x8f28('0xe')])+_0x8f28('0xf')]=this[_0x8f28('0xc')]['id'];}_0x55a529[_[_0x8f28('0xd')](this[_0x8f28('0xe')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x8f28('0xe')]+_0x8f28('0x10')]){return rpc[this[_0x8f28('0xe')]+_0x8f28('0x10')][_0x8f28('0x11')](_0x55a529)['then'](function(_0x4ca222){logger[_0x8f28('0x12')](_0x8f28('0x13'),_0x20d63c,_0x55a529['body']);_0x1ff991[_0x8f28('0x14')]();})[_0x8f28('0x15')](function(_0x47242b){logger[_0x8f28('0x16')](_0x8f28('0x13'),_0x20d63c,JSON[_0x8f28('0x17')](_0x47242b));_0x1ff991[_0x8f28('0x18')]();});}}catch(_0x39ea6d){logger[_0x8f28('0x16')](_0x8f28('0x13'),_0x20d63c,JSON[_0x8f28('0x17')](_0x39ea6d));_0x1ff991[_0x8f28('0x18')]();}};}; \ 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 f0b5852..31d035d 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 _0xc0c2=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0xc0c2,0x1c5));var _0x2c0c=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0xc0c2[_0x1b51ea];return _0x18bbdc;};'use strict';var utils=require(_0x2c0c('0x0'));var logger=require(_0x2c0c('0x1'))(_0x2c0c('0x2'));exports[_0x2c0c('0x3')]=function(_0x5b068a,_0x16a611){return function(_0x50bf62){try{logger[_0x2c0c('0x4')](_0x2c0c('0x5'),_0x5b068a,utils[_0x2c0c('0x6')](_0x16a611[0x0],this));_0x50bf62[_0x2c0c('0x7')]();}catch(_0x41bc5a){logger[_0x2c0c('0x8')](_0x2c0c('0x5'),_0x5b068a,JSON[_0x2c0c('0x9')](_0x41bc5a));_0x50bf62[_0x2c0c('0xa')]();}};}; \ No newline at end of file +var _0x5b14=['stringify','stop','./utils','../../../../config/logger','routing','consequence','getMustacheRender','next','error','[%s][NOOP]\x20%s'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5b14,0xfc));var _0x45b1=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x5b14[_0x43c8b8];return _0x413be3;};'use strict';var utils=require(_0x45b1('0x0'));var logger=require(_0x45b1('0x1'))(_0x45b1('0x2'));exports[_0x45b1('0x3')]=function(_0x345189,_0x28237f){return function(_0x2e6eeb){try{logger['info']('[%s][NOOP]\x20%s',_0x345189,utils[_0x45b1('0x4')](_0x28237f[0x0],this));_0x2e6eeb[_0x45b1('0x5')]();}catch(_0x13382f){logger[_0x45b1('0x6')](_0x45b1('0x7'),_0x345189,JSON[_0x45b1('0x8')](_0x13382f));_0x2e6eeb[_0x45b1('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index e0d9460..e7e0dfc 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 _0x55ca=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','find','Queues','createQueue','atimeout','rules','end','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0xa5a5d5,_0x15167e){var _0x4561a3=function(_0x296281){while(--_0x296281){_0xa5a5d5['push'](_0xa5a5d5['shift']());}};_0x4561a3(++_0x15167e);}(_0x55ca,0x126));var _0xa55c=function(_0x248703,_0xa58c07){_0x248703=_0x248703-0x0;var _0x12daa9=_0x55ca[_0x248703];return _0x12daa9;};'use strict';var schema=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));var strategy=require(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));var attributes=['id',_0xa55c('0xa'),_0xa55c('0xb'),'queue',_0xa55c('0xc'),_0xa55c('0xd')];function emit(_0x52a3bc,_0x5849ad,_0x473d0e){io['to'](_0x52a3bc)[_0xa55c('0xe')](_0x5849ad,_0x473d0e);}function emitChannelQueueInteraction(_0x381d07,_0x5d8e5a,_0x31646d,_0xe6d826,_0x508342,_0x70c2de,_0x3998f7,_0x15eec8){var _0x5d47ff=_['clone'](_0x31646d);_0x5d47ff[_0xa55c('0xa')]=_0x15eec8;_0x5d47ff['queue']=_0x5d8e5a;_0x5d47ff['account']=_0xe6d826;_0x5d47ff['id']=_0x508342;if(_0x70c2de){_0x3998f7[util['format'](_0xa55c('0xf'),_0x381d07)][_0x508342]=_[_0xa55c('0x10')](_0x5d47ff,attributes);}else{delete _0x3998f7[util[_0xa55c('0x11')](_0xa55c('0xf'),_0x381d07)][_0x508342];}emit(util[_0xa55c('0x11')](_0xa55c('0x12'),_0x381d07,_0x5d8e5a),util['format'](_0xa55c('0x13'),_0x381d07,_0x70c2de?_0xa55c('0x14'):_0xa55c('0x15')),_[_0xa55c('0x10')](_0x5d47ff,attributes));}var rpc={'openchannelQueueReport':require(_0xa55c('0x16')),'mailQueueReport':require(_0xa55c('0x17')),'chatQueueReport':require(_0xa55c('0x18')),'smsQueueReport':require(_0xa55c('0x19')),'faxQueueReport':require(_0xa55c('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xa55c('0x1b'),'required':!![],'message':_0xa55c('0x1c')},'timeout':{'type':_0xa55c('0x1d'),'message':_0xa55c('0x1e')}});function startRouting(_0x23a1ae,_0x5426e5,_0x4c0daf,_0x5f5158){if(_0x23a1ae&&_0x5426e5&&_0x4c0daf){_0x5426e5[_0xa55c('0x1f')]+=0x1;var _0x3776ac={'uniqueid':_0x23a1ae,'from':_0x4c0daf[_0xa55c('0x20')]?_0x4c0daf['body'][_0xa55c('0xc')]:'','joinAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c0daf[_0xa55c('0x21')]?_0x4c0daf[_0xa55c('0x21')]['id']:null,'ListId':_0x4c0daf[_0xa55c('0x22')]?_0x4c0daf[_0xa55c('0x22')]['id']:null};_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf['channel'])+_0xa55c('0x24')]=_0x5426e5['id']||null;_0x3776ac[_['upperFirst'](_0x4c0daf['channel'])+'InteractionId']=_0x4c0daf[_0xa55c('0x25')]?_0x4c0daf['interaction']['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+_0xa55c('0x27')]=_0x4c0daf[_0xa55c('0x28')]?_0x4c0daf[_0xa55c('0x28')]['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+(_0x4c0daf[_0xa55c('0x26')]!==_0xa55c('0x29')?_0xa55c('0x2a'):_0xa55c('0x2b'))]=_0x4c0daf['account']?_0x4c0daf[_0xa55c('0xb')]['id']:null;logger[_0xa55c('0x2c')](util[_0xa55c('0x11')](_0xa55c('0x2d'),_0x23a1ae,_0x5426e5['name']));emitChannelQueueInteraction(_0x4c0daf[_0xa55c('0x26')],_0x5426e5[_0xa55c('0x2e')],_0x3776ac,_0x4c0daf[_0xa55c('0xb')][_0xa55c('0x2e')],_0x4c0daf[_0xa55c('0x28')]['id'],!![],_0x5f5158,_0x5426e5['id']);if(rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport']){return rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport'][_0xa55c('0x2f')](_0x3776ac)[_0xa55c('0x30')](function(_0x1cc53e){logger[_0xa55c('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d28fb,_0x2096ae,_0x331e58,_0x20da31){if(_0x3d28fb&&_0x2096ae){_0x2096ae[_0xa55c('0x1f')]-=0x1;var _0x1225c3={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'acceptAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'reason':_0xa55c('0x33')};logger['info'](util['format'](_0xa55c('0x34'),_0x3d28fb,_0x2096ae[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x331e58['channel'],_0x2096ae[_0xa55c('0x2e')],_0x331e58[_0xa55c('0x20')],_0x331e58[_0xa55c('0xb')][_0xa55c('0x2e')],_0x331e58[_0xa55c('0x28')]['id'],![],_0x20da31,_0x2096ae['id']);if(rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]){return rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]['update'](_0x3d28fb,_0x1225c3)['catch'](function(_0x4b23d3){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function endRouting(_0x2bb4f0,_0x5802e4,_0x768408,_0x547930){if(_0x2bb4f0&&_0x5802e4){_0x5802e4[_0xa55c('0x1f')]-=0x1;var _0x4ad813={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'exitAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa55c('0x37')};logger[_0xa55c('0x2c')](util['format'](_0xa55c('0x38'),_0x2bb4f0,_0x5802e4[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x768408['channel'],_0x5802e4['name'],_0x768408[_0xa55c('0x20')],_0x768408['account'][_0xa55c('0x2e')],_0x768408[_0xa55c('0x28')]['id'],![],_0x547930);if(rpc[_0x768408['channel']+'QueueReport']){return rpc[_0x768408['channel']+'QueueReport'][_0xa55c('0x39')](_0x2bb4f0,_0x4ad813)[_0xa55c('0x30')](function(_0x429336){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function handleFindQueue(_0x56d17c){return function(_0x3d52d8){return _0x3d52d8[_0xa55c('0x2e')][_0xa55c('0x3a')]()===_0x56d17c[_0xa55c('0x3a')]();};}exports[_0xa55c('0x3b')]=function(_0x23cef5,_0x554620,_0x386e34,_0x5ee63d){return function(_0x57a972){try{var _0x404e7f={'name':_0x554620[0x0],'timeout':_0x554620[0x1]};var _0x1f63d8=queue['validate'](_0x404e7f,{'typecast':!![]});if(_0x1f63d8[_0xa55c('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x23cef5,_[_0xa55c('0x3d')](_0x1f63d8,_0xa55c('0x28'))[_0xa55c('0x3e')](',\x20'));_0x57a972['stop']();}else{var _0x1b2708=_[_0xa55c('0x3f')](_0x386e34[_0x5ee63d['channel']+_0xa55c('0x40')],handleFindQueue(_0x404e7f['name']));if(_0x1b2708){startRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);var _0x39886a=(_0x1b2708[_0xa55c('0x37')]||0xa)*0x3e8;var _0x5be43f=(_0x404e7f[_0xa55c('0x37')]||0x14)*0x3e8;var _0x1dae70,_0x5d834d;if(_0x39886a>_0x5be43f){_0x5be43f=_0x39886a;}var _0x40c352=seqqueue[_0xa55c('0x41')](_0x39886a);_0x40c352['id']=_0x23cef5;_0x40c352[_0xa55c('0x42')]=_0x39886a;_0x40c352['qtimeout']=_0x5be43f;_0x40c352[_0xa55c('0x26')]=_0x5ee63d['channel'];_0x386e34[_0xa55c('0x43')][_0x23cef5]['on'](_0xa55c('0x44'),function(){logger[_0xa55c('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x23cef5);stopRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x1dae70=undefined;_0x40c352[_0xa55c('0x45')](!![]);if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34['rules'][_0x23cef5];}_0x57a972[_0xa55c('0x46')]();});_0x386e34[_0xa55c('0x43')][_0x23cef5]['on']('complete',function(){if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34[_0xa55c('0x43')][_0x23cef5];}});_0x1dae70=setTimeout(function(){logger['info'](_0xa55c('0x47'),_0x23cef5);endRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x40c352[_0xa55c('0x45')](!![]);_0x57a972[_0xa55c('0x48')]();},_0x5be43f);switch(_0x1b2708[_0xa55c('0x49')]){case'rrmemory':strategy[_0xa55c('0x4a')](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);break;default:strategy['beepall'](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);}}else{logger[_0xa55c('0x31')](_0xa55c('0x4b'),_0x23cef5,_0x404e7f[_0xa55c('0x2e')]);_0x57a972['stop']();}}}catch(_0x39bd3d){console[_0xa55c('0x4c')](_0x39bd3d);logger['error'](_0xa55c('0x4d'),_0x23cef5,_0x39bd3d[_0xa55c('0x4e')]);_0x57a972[_0xa55c('0x46')]();}};}; \ No newline at end of file +var _0x9957=['seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','account','queue','joinAt','emit','clone','queue_id','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','create','catch','error','waiting','accepted','body','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util'];(function(_0x25d3cf,_0x2bc676){var _0x574a12=function(_0x25325f){while(--_0x25325f){_0x25d3cf['push'](_0x25d3cf['shift']());}};_0x574a12(++_0x2bc676);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var util=require(_0x7995('0x2'));var seqqueue=require(_0x7995('0x3'));var moment=require('moment');var Redis=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var strategy=require('./strategy');config[_0x7995('0x8')]=_[_0x7995('0x9')](config[_0x7995('0x8')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x8')]));var attributes=['id','queue_id',_0x7995('0xc'),_0x7995('0xd'),'from',_0x7995('0xe')];function emit(_0x3116fb,_0x18c8a3,_0x35b5fe){io['to'](_0x3116fb)[_0x7995('0xf')](_0x18c8a3,_0x35b5fe);}function emitChannelQueueInteraction(_0x1e400a,_0x341672,_0x524f7b,_0x245143,_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e=_[_0x7995('0x10')](_0x524f7b);_0x19a27e[_0x7995('0x11')]=_0x2cb37a;_0x19a27e[_0x7995('0xd')]=_0x341672;_0x19a27e[_0x7995('0xc')]=_0x245143;_0x19a27e['id']=_0x41c652;if(_0x581f22){_0xb0c872[util['format']('%sQueuesWaitingInteractions',_0x1e400a)][_0x41c652]=_[_0x7995('0x12')](_0x19a27e,attributes);}else{delete _0xb0c872[util[_0x7995('0x13')](_0x7995('0x14'),_0x1e400a)][_0x41c652];}emit(util[_0x7995('0x13')](_0x7995('0x15'),_0x1e400a,_0x341672),util[_0x7995('0x13')](_0x7995('0x16'),_0x1e400a,_0x581f22?_0x7995('0x17'):'remove'),_[_0x7995('0x12')](_0x19a27e,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x7995('0x18')),'chatQueueReport':require(_0x7995('0x19')),'smsQueueReport':require(_0x7995('0x1a')),'faxQueueReport':require(_0x7995('0x1b')),'whatsappQueueReport':require(_0x7995('0x1c'))};var queue=schema({'name':{'type':_0x7995('0x1d'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7995('0x1e')}});function startRouting(_0x5e6f90,_0x555f74,_0x3ec178,_0x3d463e){if(_0x5e6f90&&_0x555f74&&_0x3ec178){_0x555f74['waiting']+=0x1;var _0x3a9b54={'uniqueid':_0x5e6f90,'from':_0x3ec178['body']?_0x3ec178['body'][_0x7995('0x1f')]:'','joinAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'ContactId':_0x3ec178[_0x7995('0x21')]?_0x3ec178[_0x7995('0x21')]['id']:null,'ListId':_0x3ec178[_0x7995('0x22')]?_0x3ec178['list']['id']:null};_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+_0x7995('0x25')]=_0x555f74['id']||null;_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+_0x7995('0x26')]=_0x3ec178[_0x7995('0x27')]?_0x3ec178[_0x7995('0x27')]['id']:null;_0x3a9b54[_['upperFirst'](_0x3ec178[_0x7995('0x24')])+_0x7995('0x28')]=_0x3ec178[_0x7995('0x29')]?_0x3ec178[_0x7995('0x29')]['id']:null;_0x3a9b54[_[_0x7995('0x23')](_0x3ec178[_0x7995('0x24')])+(_0x3ec178['channel']!==_0x7995('0x2a')?'AccountId':_0x7995('0x2b'))]=_0x3ec178[_0x7995('0xc')]?_0x3ec178[_0x7995('0xc')]['id']:null;logger[_0x7995('0x2c')](util[_0x7995('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x5e6f90,_0x555f74[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x3ec178['channel'],_0x555f74[_0x7995('0x2d')],_0x3a9b54,_0x3ec178[_0x7995('0xc')][_0x7995('0x2d')],_0x3ec178['message']['id'],!![],_0x3d463e,_0x555f74['id']);if(rpc[_0x3ec178['channel']+'QueueReport']){return rpc[_0x3ec178[_0x7995('0x24')]+_0x7995('0x2e')][_0x7995('0x2f')](_0x3a9b54)[_0x7995('0x30')](function(_0x2e3493){logger[_0x7995('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x481c74,_0xfa8f15,_0x5524af,_0x553671){if(_0x481c74&&_0xfa8f15){_0xfa8f15[_0x7995('0x32')]-=0x1;var _0x29fac5={'leaveAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'acceptAt':moment()['format'](_0x7995('0x20')),'reason':_0x7995('0x33')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x481c74,_0xfa8f15[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x5524af[_0x7995('0x24')],_0xfa8f15['name'],_0x5524af[_0x7995('0x34')],_0x5524af['account'][_0x7995('0x2d')],_0x5524af[_0x7995('0x29')]['id'],![],_0x553671,_0xfa8f15['id']);if(rpc[_0x5524af[_0x7995('0x24')]+'QueueReport']){return rpc[_0x5524af['channel']+_0x7995('0x2e')]['update'](_0x481c74,_0x29fac5)['catch'](function(_0x3e99cd){logger[_0x7995('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x1baa15,_0x1922b4,_0x2b772f,_0x18667c){if(_0x1baa15&&_0x1922b4){_0x1922b4[_0x7995('0x32')]-=0x1;var _0x53002a={'leaveAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'exitAt':moment()[_0x7995('0x13')](_0x7995('0x20')),'reason':'timeout'};logger[_0x7995('0x2c')](util[_0x7995('0x13')](_0x7995('0x35'),_0x1baa15,_0x1922b4[_0x7995('0x2d')]));emitChannelQueueInteraction(_0x2b772f[_0x7995('0x24')],_0x1922b4[_0x7995('0x2d')],_0x2b772f['body'],_0x2b772f[_0x7995('0xc')][_0x7995('0x2d')],_0x2b772f[_0x7995('0x29')]['id'],![],_0x18667c);if(rpc[_0x2b772f[_0x7995('0x24')]+_0x7995('0x2e')]){return rpc[_0x2b772f[_0x7995('0x24')]+_0x7995('0x2e')][_0x7995('0x36')](_0x1baa15,_0x53002a)[_0x7995('0x30')](function(_0x447981){logger[_0x7995('0x31')](_0x7995('0x37'));});}}}function handleFindQueue(_0x7b4e67){return function(_0x53cda2){return _0x53cda2['name'][_0x7995('0x38')]()===_0x7b4e67[_0x7995('0x38')]();};}exports['consequence']=function(_0x4b0855,_0x3f8522,_0x4a9fef,_0x504a33){return function(_0x23da6b){try{var _0x36e28b={'name':_0x3f8522[0x0],'timeout':_0x3f8522[0x1]};var _0x35c8ff=queue['validate'](_0x36e28b,{'typecast':!![]});if(_0x35c8ff[_0x7995('0x39')]){logger['error'](_0x7995('0x3a'),_0x4b0855,_['map'](_0x35c8ff,'message')[_0x7995('0x3b')](',\x20'));_0x23da6b[_0x7995('0x3c')]();}else{var _0xc04e5=_[_0x7995('0x3d')](_0x4a9fef[_0x504a33['channel']+_0x7995('0x3e')],handleFindQueue(_0x36e28b[_0x7995('0x2d')]));if(_0xc04e5){startRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);var _0x31b347=(_0xc04e5[_0x7995('0x3f')]||0xa)*0x3e8;var _0x4e09b7=(_0x36e28b['timeout']||0x14)*0x3e8;var _0x1c37c6,_0x55791b;if(_0x31b347>_0x4e09b7){_0x4e09b7=_0x31b347;}var _0x23c41d=seqqueue['createQueue'](_0x31b347);_0x23c41d['id']=_0x4b0855;_0x23c41d[_0x7995('0x40')]=_0x31b347;_0x23c41d['qtimeout']=_0x4e09b7;_0x23c41d[_0x7995('0x24')]=_0x504a33[_0x7995('0x24')];_0x4a9fef['rules'][_0x4b0855]['on'](_0x7995('0x41'),function(){logger[_0x7995('0x2c')](_0x7995('0x42'),_0x4b0855);stopRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);clearTimeout(_0x1c37c6);_0x1c37c6=undefined;_0x23c41d[_0x7995('0x43')](!![]);if(_0x4a9fef['rules'][_0x4b0855]){delete _0x4a9fef[_0x7995('0x44')][_0x4b0855];}_0x23da6b[_0x7995('0x3c')]();});_0x4a9fef[_0x7995('0x44')][_0x4b0855]['on']('complete',function(){if(_0x4a9fef[_0x7995('0x44')][_0x4b0855]){delete _0x4a9fef[_0x7995('0x44')][_0x4b0855];}});_0x1c37c6=setTimeout(function(){logger[_0x7995('0x2c')](_0x7995('0x45'),_0x4b0855);endRouting(_0x4b0855,_0xc04e5,_0x504a33,_0x4a9fef);clearTimeout(_0x1c37c6);_0x23c41d[_0x7995('0x43')](!![]);_0x23da6b['next']();},_0x4e09b7);switch(_0xc04e5[_0x7995('0x46')]){case _0x7995('0x47'):strategy['rrmemory'](_0x23c41d,_0xc04e5,_0x4a9fef,_0x504a33);break;default:strategy[_0x7995('0x48')](_0x23c41d,_0xc04e5,_0x4a9fef,_0x504a33);}}else{logger['error'](_0x7995('0x49'),_0x4b0855,_0x36e28b[_0x7995('0x2d')]);_0x23da6b[_0x7995('0x3c')]();}}}catch(_0x30e220){console[_0x7995('0x4a')](_0x30e220);logger[_0x7995('0x31')](_0x7995('0x3a'),_0x4b0855,_0x30e220['stack']);_0x23da6b[_0x7995('0x3c')]();}};}; \ 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 edc3a5d..8314ec8 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 _0x5f3a=['push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','busy','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','lodash','uuid','./util','notificationId','squeue','agent','routing'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x5f3a,0x16d));var _0xa5f3=function(_0x3f4bc1,_0x15ace5){_0x3f4bc1=_0x3f4bc1-0x0;var _0x46fcf6=_0x5f3a[_0x3f4bc1];return _0x46fcf6;};'use strict';var _=require(_0xa5f3('0x0'));var uuid=require(_0xa5f3('0x1'));var util=require(_0xa5f3('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x370387,_0x285ad6,_0x28476a,_0x23ed55){this[_0xa5f3('0x3')]=uuid['v4']();this[_0xa5f3('0x4')]=_0x370387;this[_0xa5f3('0x5')]=_0x285ad6;this['realtime']=_0x28476a;this[_0xa5f3('0x6')]=_0x23ed55;this[_0xa5f3('0x4')][_0xa5f3('0x7')](this[_0xa5f3('0x8')]['bind'](this),this['handleTimeout'][_0xa5f3('0x9')](this));this[_0xa5f3('0x4')]['on'](_0xa5f3('0xa'),this[_0xa5f3('0xb')]['bind'](this));this['squeue']['on'](_0xa5f3('0xc'),this[_0xa5f3('0xd')][_0xa5f3('0x9')](this));};Agent[_0xa5f3('0xe')][_0xa5f3('0x7')]=function(){this[_0xa5f3('0x4')][_0xa5f3('0x7')](this['handleRun']['bind'](this),this['handleTimeout'][_0xa5f3('0x9')](this));};Agent[_0xa5f3('0xe')][_0xa5f3('0xd')]=function(){this[_0xa5f3('0xb')](!![]);};Agent['prototype'][_0xa5f3('0x8')]=function(_0x3fb7c9){logger[_0xa5f3('0xf')](_0xa5f3('0x10'),this[_0xa5f3('0x4')]['id'],this[_0xa5f3('0x5')]['id']);if(_['isNil'](this[_0xa5f3('0x11')]['agents'][this[_0xa5f3('0x5')]['id']])){logger['info'](_0xa5f3('0x12'),this[_0xa5f3('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xa5f3('0x7')]['bind'](this),0x3e8);}else{if(this[_0xa5f3('0x6')]['forcedOwnership']||util['isAgentAvailable'](this[_0xa5f3('0x4')]['id'],this[_0xa5f3('0x11')][_0xa5f3('0x13')][this[_0xa5f3('0x5')]['id']],this['squeue']['channel'],![])){this[_0xa5f3('0x11')][_0xa5f3('0x13')][this['agent']['id']][_0xa5f3('0x14')]=!![];this[_0xa5f3('0x11')]['agents'][this[_0xa5f3('0x5')]['id']]['busyQueue']=undefined;util['showNotification'](this['notificationId'],this[_0xa5f3('0x4')]['id'],this[_0xa5f3('0x11')][_0xa5f3('0x13')][this['agent']['id']],null,this['routing']);util[_0xa5f3('0x15')](this[_0xa5f3('0x4')]['id'],this['realtime']['agents'][this[_0xa5f3('0x5')]['id']],_0xa5f3('0x16')+(this[_0xa5f3('0x6')][_0xa5f3('0x17')]?_0xa5f3('0x18'):''));}else{logger[_0xa5f3('0xf')](_0xa5f3('0x19'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype'][_0xa5f3('0xb')]=function(_0x16f382){if(_[_0xa5f3('0x1a')](this['realtime'][_0xa5f3('0x13')][this['agent']['id']])){return logger[_0xa5f3('0xf')](_0xa5f3('0x12'),this['squeue']['id'],this[_0xa5f3('0x5')]['id']);}else{logger[_0xa5f3('0xf')](_0xa5f3('0x1b'),this['squeue']['id'],this[_0xa5f3('0x5')]['id']);util['hideNotification'](this[_0xa5f3('0x3')],this['squeue']['id'],this[_0xa5f3('0x11')][_0xa5f3('0x13')][this[_0xa5f3('0x5')]['id']],null,this[_0xa5f3('0x6')]);this[_0xa5f3('0x11')]['agents'][this['agent']['id']][_0xa5f3('0x14')]=![];this[_0xa5f3('0x11')]['agents'][this[_0xa5f3('0x5')]['id']][_0xa5f3('0x1c')]=undefined;util[_0xa5f3('0x15')](this['squeue']['id'],this[_0xa5f3('0x11')][_0xa5f3('0x13')][this[_0xa5f3('0x5')]['id']],_0x16f382?_0xa5f3('0x1d'):_0xa5f3('0x1e'));}if(!_0x16f382){setTimeout(this['push'][_0xa5f3('0x9')](this),0x3e8);}};function agent(_0x25f3d9,_0x463a7d,_0x21d6dd,_0x3d6f68){return new Agent(_0x25f3d9,_0x463a7d,_0x21d6dd,_0x3d6f68);}module['exports']=agent; \ No newline at end of file +var _0x52a6=['isNil','realtime','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0x52a6,0x19e));var _0x652a=function(_0x92706d,_0x5e096c){_0x92706d=_0x92706d-0x0;var _0x15a7eb=_0x52a6[_0x92706d];return _0x15a7eb;};'use strict';var _=require(_0x652a('0x0'));var uuid=require(_0x652a('0x1'));var util=require(_0x652a('0x2'));var logger=require(_0x652a('0x3'))(_0x652a('0x4'));var Agent=function(_0x180d2e,_0x3631cc,_0x3c3457,_0x303c9b){this[_0x652a('0x5')]=uuid['v4']();this[_0x652a('0x6')]=_0x180d2e;this[_0x652a('0x7')]=_0x3631cc;this['realtime']=_0x3c3457;this['routing']=_0x303c9b;this[_0x652a('0x6')]['push'](this['handleRun']['bind'](this),this[_0x652a('0x8')][_0x652a('0x9')](this));this[_0x652a('0x6')]['on'](_0x652a('0xa'),this[_0x652a('0x8')][_0x652a('0x9')](this));this['squeue']['on'](_0x652a('0xb'),this[_0x652a('0xc')][_0x652a('0x9')](this));};Agent[_0x652a('0xd')][_0x652a('0xe')]=function(){this[_0x652a('0x6')][_0x652a('0xe')](this['handleRun']['bind'](this),this[_0x652a('0x8')][_0x652a('0x9')](this));};Agent['prototype'][_0x652a('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x652a('0xd')][_0x652a('0xf')]=function(_0x1e9ad6){logger[_0x652a('0x10')](_0x652a('0x11'),this[_0x652a('0x6')]['id'],this[_0x652a('0x7')]['id']);if(_[_0x652a('0x12')](this[_0x652a('0x13')]['agents'][this[_0x652a('0x7')]['id']])){logger[_0x652a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x652a('0x7')]['id']);setTimeout(this[_0x652a('0xe')][_0x652a('0x9')](this),0x3e8);}else{if(this[_0x652a('0x4')][_0x652a('0x14')]||util[_0x652a('0x15')](this[_0x652a('0x6')]['id'],this[_0x652a('0x13')][_0x652a('0x16')][this[_0x652a('0x7')]['id']],this[_0x652a('0x6')][_0x652a('0x17')],![])){this[_0x652a('0x13')]['agents'][this[_0x652a('0x7')]['id']][_0x652a('0x18')]=!![];this['realtime'][_0x652a('0x16')][this[_0x652a('0x7')]['id']][_0x652a('0x19')]=undefined;util[_0x652a('0x1a')](this['notificationId'],this['squeue']['id'],this[_0x652a('0x13')][_0x652a('0x16')][this[_0x652a('0x7')]['id']],null,this[_0x652a('0x4')]);util[_0x652a('0x1b')](this['squeue']['id'],this[_0x652a('0x13')][_0x652a('0x16')][this['agent']['id']],_0x652a('0x1c')+(this[_0x652a('0x4')][_0x652a('0x14')]?_0x652a('0x1d'):''));}else{logger[_0x652a('0x10')](_0x652a('0x1e'),this['squeue']['id'],this[_0x652a('0x7')]['id']);setTimeout(this[_0x652a('0xe')][_0x652a('0x9')](this),0x3e8);}}};Agent[_0x652a('0xd')][_0x652a('0x8')]=function(_0x16b985){if(_[_0x652a('0x12')](this[_0x652a('0x13')][_0x652a('0x16')][this['agent']['id']])){return logger[_0x652a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x652a('0x6')]['id'],this[_0x652a('0x7')]['id']);}else{logger[_0x652a('0x10')](_0x652a('0x1f'),this[_0x652a('0x6')]['id'],this[_0x652a('0x7')]['id']);util[_0x652a('0x20')](this[_0x652a('0x5')],this['squeue']['id'],this[_0x652a('0x13')][_0x652a('0x16')][this[_0x652a('0x7')]['id']],null,this[_0x652a('0x4')]);this[_0x652a('0x13')]['agents'][this[_0x652a('0x7')]['id']][_0x652a('0x18')]=![];this[_0x652a('0x13')][_0x652a('0x16')][this[_0x652a('0x7')]['id']][_0x652a('0x19')]=undefined;util[_0x652a('0x1b')](this[_0x652a('0x6')]['id'],this['realtime'][_0x652a('0x16')][this['agent']['id']],_0x16b985?_0x652a('0x21'):_0x652a('0x22'));}if(!_0x16b985){setTimeout(this[_0x652a('0xe')]['bind'](this),0x3e8);}};function agent(_0x159d26,_0x1724ac,_0x4549db,_0xbeedd9){return new Agent(_0x159d26,_0x1724ac,_0x4549db,_0xbeedd9);}module[_0x652a('0x23')]=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 b8a3881..36e3830 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 _0x2191=['drained','handleDrained','prototype','push','handleTimeout','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','handleRun','bind'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2191,0x14b));var _0x1219=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x2191[_0x5027b1];return _0x4a46cf;};'use strict';var _=require(_0x1219('0x0'));var uuid=require(_0x1219('0x1'));var util=require(_0x1219('0x2'));var logger=require('../../../../../config/logger')(_0x1219('0x3'));var Beepall=function(_0x2a9d92,_0x1cddc7,_0xd1d28f,_0x4f25b8){this[_0x1219('0x4')]=uuid['v4']();this[_0x1219('0x5')]=_0x2a9d92;this[_0x1219('0x6')]=_0x1cddc7;this['realtime']=_0xd1d28f;this[_0x1219('0x3')]=_0x4f25b8;this[_0x1219('0x5')]['push'](this[_0x1219('0x7')][_0x1219('0x8')](this),this['handleTimeout'][_0x1219('0x8')](this));this[_0x1219('0x5')]['on']('timeout',this['handleTimeout'][_0x1219('0x8')](this));this['squeue']['on'](_0x1219('0x9'),this[_0x1219('0xa')][_0x1219('0x8')](this));};Beepall[_0x1219('0xb')]['push']=function(){this['squeue'][_0x1219('0xc')](this['handleRun']['bind'](this),this[_0x1219('0xd')][_0x1219('0x8')](this));};Beepall[_0x1219('0xb')][_0x1219('0xa')]=function(_0x4a7b7a){this['handleTimeout'](!![]);};Beepall['prototype'][_0x1219('0x7')]=function(_0x2e9fcd){var _0x41ef73=!![];if(!_[_0x1219('0xe')](this['queue'])&&!_[_0x1219('0xe')](this[_0x1219('0x6')]['Agents'])&&this['queue'][_0x1219('0xf')]['length']>0x0){for(var _0x1acd77=0x0,_0x343283;_0x1acd770x0){for(var _0x10e62b=0x0,_0x4b1e5f;_0x10e62b0x0&&_0x81239b[_0x23208a+_0x2e9e('0x27')]>=_0x81239b[_0x23208a+_0x2e9e('0x28')]){writeLog(_0x11cd44,_0x81239b,_0x23208a[_0x2e9e('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x2e9e('0x2a')]=function(_0x428f98,_0x35ee53,_0x4dea06,_0x251ea0,_0x42699c){return sendNotification(!![],_0x428f98,_0x35ee53,_0x4dea06,_0x251ea0,_0x42699c);};exports['hideNotification']=function(_0x5446ad,_0xde4011,_0x2b03c4,_0x1ea440,_0x3ea986){return sendNotification(![],_0x5446ad,_0xde4011,_0x2b03c4,_0x1ea440,_0x3ea986);};exports[_0x2e9e('0x2b')]=writeLog; \ No newline at end of file +var _0x7334=['writeLog','lodash','util','../utils','../../../../../config/environment','routing','redis','defaults','localhost','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification'];(function(_0x26dd9a,_0x28a8e1){var _0x32c5f8=function(_0x2c7f12){while(--_0x2c7f12){_0x26dd9a['push'](_0x26dd9a['shift']());}};_0x32c5f8(++_0x28a8e1);}(_0x7334,0x184));var _0x4733=function(_0x3ce73c,_0x1ca0bb){_0x3ce73c=_0x3ce73c-0x0;var _0x36c79e=_0x7334[_0x3ce73c];return _0x36c79e;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var utils=require(_0x4733('0x2'));var Mustache=require('mustache');var Redis=require('ioredis');var config=require(_0x4733('0x3'));var logger=require('../../../../../config/logger')(_0x4733('0x4'));config[_0x4733('0x5')]=_[_0x4733('0x6')](config[_0x4733('0x5')],{'host':_0x4733('0x7'),'port':0x18eb});var io=require(_0x4733('0x8'))(new Redis(config[_0x4733('0x5')]));function emit(_0x283754,_0x12cafa,_0x43d95c){io['to'](_0x283754)[_0x4733('0x9')](_0x12cafa,_0x43d95c);}function sendNotification(_0x3562b7,_0x4c5c0,_0x38b7f5,_0x2d5fde,_0x1bc511,_0x2bafad){io['to'](util['format'](_0x4733('0xa'),_0x2d5fde[_0x4733('0xb')]))['emit'](_0x4733('0xc'),_0x2d5fde);var _0x5240a4=_0x2bafad||{};var _0xa8e91b=_0x38b7f5[_0x4733('0xd')]('.');var _0x44cb92={'uniqueid':_0x4c5c0,'channel':_0xa8e91b[0x0],'id':_0xa8e91b[0x1],'title':_0xa8e91b[0x0]+_0x4733('0xe'),'interactionId':_0xa8e91b[0x2],'queue':_0x1bc511?_0x1bc511[_0x4733('0xb')]:null,'sound':_0x5240a4[_0x4733('0xf')][_0x4733('0x10')],'shake':_0x5240a4['account'][_0x4733('0x11')]};try{if(!_0x5240a4['body']){_0x5240a4[_0x4733('0x12')]={};}if(_0x1bc511){_0x5240a4[_0x4733('0x12')][_0x4733('0x13')]=_0x1bc511;}else if(_0x5240a4[_0x4733('0x12')][_0x4733('0x13')]){delete _0x5240a4[_0x4733('0x12')][_0x4733('0x13')];}_0x44cb92[_0x4733('0x14')]=utils[_0x4733('0x15')](_0x5240a4['account'][_0x4733('0x16')],_0x5240a4);}catch(_0x71e96c){_0x44cb92['msg']=_0x4733('0x17');logger[_0x4733('0x18')](util[_0x4733('0x19')](_0x4733('0x1a'),_0x4c5c0,_0x71e96c['message']));}io['to'](util['format'](_0x4733('0xa'),_0x2d5fde[_0x4733('0xb')]))['emit'](util[_0x4733('0x19')](_0x4733('0x1b'),_0x3562b7?_0x4733('0x1c'):_0x4733('0x1d')),_0x44cb92);}function writeLog(_0x493cd3,_0x1232e5,_0xb45e1){return logger['info'](util[_0x4733('0x19')](_0x4733('0x1e'),_0x493cd3,_0x1232e5['name'],_0xb45e1));}exports[_0x4733('0x1f')]=function(_0x115ce4,_0xa7b8e3,_0x1a0643,_0x3a2542){if(_0xa7b8e3[_0x4733('0x20')]){writeLog(_0x115ce4,_0xa7b8e3,_0x4733('0x21'));return![];}if(!_0xa7b8e3[_0x4733('0x22')]){writeLog(_0x115ce4,_0xa7b8e3,'OFFLINE');return![];}if(_0xa7b8e3[_0x1a0643+_0x4733('0x23')]){writeLog(_0x115ce4,_0xa7b8e3,_0x4733('0x24'));return![];}if(_0x3a2542&&_0xa7b8e3[_0x4733('0x25')](_0x1a0643+_0x4733('0x26'))&&_0xa7b8e3[_0x4733('0x25')](_0x1a0643+_0x4733('0x27'))){if(_0xa7b8e3[_0x1a0643+_0x4733('0x26')]>0x0&&_0xa7b8e3[_0x1a0643+_0x4733('0x27')]>=_0xa7b8e3[_0x1a0643+_0x4733('0x26')]){writeLog(_0x115ce4,_0xa7b8e3,_0x1a0643[_0x4733('0x28')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x4733('0x29')]=function(_0x4c91bc,_0x5b6fc0,_0x24e975,_0x49c516,_0xcde4f4){return sendNotification(!![],_0x4c91bc,_0x5b6fc0,_0x24e975,_0x49c516,_0xcde4f4);};exports['hideNotification']=function(_0x4abc0d,_0x517c73,_0x2976b0,_0x3bfe53,_0x29621e){return sendNotification(![],_0x4abc0d,_0x517c73,_0x2976b0,_0x3bfe53,_0x29621e);};exports[_0x4733('0x2a')]=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 73cfbde..487e51a 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 _0x7068=['consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7068,0x18b));var _0x8706=function(_0x10df1e,_0xf56f85){_0x10df1e=_0x10df1e-0x0;var _0x3e24fb=_0x7068[_0x10df1e];return _0x3e24fb;};'use strict';var schema=require(_0x8706('0x0'));var sh=require(_0x8706('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x8706('0x2'));var system=schema({'command':{'type':_0x8706('0x3'),'required':!![],'message':_0x8706('0x4')}});exports[_0x8706('0x5')]=function(_0x2895b9,_0x1c4205){return function(_0x45775b){try{var _0xbba957={'command':_0x1c4205[0x0]};var _0x198a9d=system[_0x8706('0x0')](_0xbba957,{'typecast':!![]});if(_0x198a9d[_0x8706('0x6')]){logger[_0x8706('0x7')](_0x8706('0x8'),_0x2895b9,_[_0x8706('0x9')](_0x198a9d,'message')[_0x8706('0xa')](',\x20'));logger[_0x8706('0xb')](_0x8706('0xc'),_0x2895b9);_0x45775b[_0x8706('0xd')]();}else{var _0x14034e=this;var _0x477fde=utils[_0x8706('0xe')](_0x1c4205[0x0],this);logger[_0x8706('0xb')](_0x8706('0xf'),_0x2895b9,_0x477fde);sh[_0x8706('0x10')](_[_0x8706('0x11')](_0x477fde),function(_0x1dc386,_0x26739b){logger[_0x8706('0xb')](_0x8706('0x12'),_0x2895b9,_0x1dc386);if(_0x1dc386==0x0){var _0x240010=_0x26739b[_0x8706('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x8706('0x14')](_0x1c4205[0x1])||_[_0x8706('0x15')](_0x1c4205[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x2895b9);_0x14034e[_0x8706('0x16')][_0x1c4205[0x1]]=_0x240010;}else{logger[_0x8706('0xb')](_0x8706('0x17'),_0x2895b9,_0x1c4205[0x1],_0x240010);_0x14034e[_0x8706('0x16')][_0x1c4205[0x1]]=_0x240010;}}_0x45775b['next']();});}}catch(_0x56a77b){logger[_0x8706('0x7')](_0x8706('0x8'),_0x2895b9,_[_0x8706('0x18')](_0x56a77b)?JSON['stringify'](_0x56a77b):_0x56a77b);logger[_0x8706('0xb')](_0x8706('0xc'),_0x2895b9);_0x45775b[_0x8706('0xd')]();}};}; \ No newline at end of file +var _0x74c6=['isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body'];(function(_0x1cb701,_0xaebc06){var _0x2ac38d=function(_0x33003b){while(--_0x33003b){_0x1cb701['push'](_0x1cb701['shift']());}};_0x2ac38d(++_0xaebc06);}(_0x74c6,0x17d));var _0x674c=function(_0x150c78,_0x2a95a3){_0x150c78=_0x150c78-0x0;var _0x92575b=_0x74c6[_0x150c78];return _0x92575b;};'use strict';var schema=require(_0x674c('0x0'));var sh=require(_0x674c('0x1'));var _=require('lodash');var utils=require(_0x674c('0x2'));var logger=require(_0x674c('0x3'))(_0x674c('0x4'));var system=schema({'command':{'type':_0x674c('0x5'),'required':!![],'message':_0x674c('0x6')}});exports[_0x674c('0x7')]=function(_0x59647d,_0x3adebe){return function(_0x402628){try{var _0x535891={'command':_0x3adebe[0x0]};var _0x49bff4=system[_0x674c('0x0')](_0x535891,{'typecast':!![]});if(_0x49bff4[_0x674c('0x8')]){logger[_0x674c('0x9')](_0x674c('0xa'),_0x59647d,_['map'](_0x49bff4,_0x674c('0xb'))[_0x674c('0xc')](',\x20'));logger[_0x674c('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x59647d);_0x402628[_0x674c('0xe')]();}else{var _0x1823c3=this;var _0x3b78fa=utils[_0x674c('0xf')](_0x3adebe[0x0],this);logger[_0x674c('0xd')](_0x674c('0x10'),_0x59647d,_0x3b78fa);sh['exec'](_[_0x674c('0x11')](_0x3b78fa),function(_0x3852ce,_0x250525){logger[_0x674c('0xd')](_0x674c('0x12'),_0x59647d,_0x3852ce);if(_0x3852ce==0x0){var _0x57e514=_0x250525[_0x674c('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x674c('0x14')](_0x3adebe[0x1])||_[_0x674c('0x15')](_0x3adebe[0x1])){logger[_0x674c('0xd')](_0x674c('0x16'),_0x59647d);_0x1823c3[_0x674c('0x17')][_0x3adebe[0x1]]=_0x57e514;}else{logger[_0x674c('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x59647d,_0x3adebe[0x1],_0x57e514);_0x1823c3[_0x674c('0x17')][_0x3adebe[0x1]]=_0x57e514;}}_0x402628[_0x674c('0xe')]();});}}catch(_0x573273){logger['error']('[%s][SYSTEM]\x20%s',_0x59647d,_[_0x674c('0x18')](_0x573273)?JSON[_0x674c('0x19')](_0x573273):_0x573273);logger['info'](_0x674c('0x1a'),_0x59647d);_0x402628[_0x674c('0xe')]();}};}; \ 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 9ee8c1a..e0b3300 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 _0x713a=['info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join'];(function(_0x19dd32,_0x5b5417){var _0x501852=function(_0x2c04d5){while(--_0x2c04d5){_0x19dd32['push'](_0x19dd32['shift']());}};_0x501852(++_0x5b5417);}(_0x713a,0x1bc));var _0xa713=function(_0x5166bc,_0x359710){_0x5166bc=_0x5166bc-0x0;var _0x27684d=_0x713a[_0x5166bc];return _0x27684d;};'use strict';var schema=require(_0xa713('0x0'));var _=require(_0xa713('0x1'));var rpc={'chatInteraction':require(_0xa713('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xa713('0x3')),'faxInteraction':require(_0xa713('0x4')),'whatsappInteraction':require(_0xa713('0x5'))};var logger=require(_0xa713('0x6'))(_0xa713('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xa713('0x8')}});exports[_0xa713('0x9')]=function(_0x100e28,_0x3fb240,_0x503345,_0x10b588){return function(_0x400dd9){try{var _0x145b86={'tag':_0x3fb240[0x0]};var _0x52e3c1=tag[_0xa713('0x0')](_0x145b86,{'typecast':!![]});if(_0x52e3c1['length']){logger[_0xa713('0xa')](_0xa713('0xb'),_0x100e28,_[_0xa713('0xc')](_0x52e3c1,_0xa713('0xd'))[_0xa713('0xe')](',\x20'));logger[_0xa713('0xf')](_0xa713('0x10'),_0x100e28);_0x400dd9[_0xa713('0x11')]();}else{var _0x39867f={'ids':[_0x3fb240[0x0]]};if(rpc[_0x10b588[_0xa713('0x12')]+_0xa713('0x13')]){rpc[_0x10b588[_0xa713('0x12')]+'Interaction'][_0xa713('0x14')](_0x10b588[_0xa713('0x15')]['id'],_0x39867f)[_0xa713('0x16')](function(_0x1b8c38){logger[_0xa713('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x100e28,_0x3fb240[0x1],_0x10b588[_0xa713('0x12')],_0x10b588['interaction']['id']);})[_0xa713('0x17')](function(_0xb11c80){logger['error']('[%s][TAG]\x20%s',_0x100e28,JSON['stringify'](_0xb11c80));logger[_0xa713('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x100e28);})[_0xa713('0x18')](function(){_0x400dd9[_0xa713('0x11')]();});}}}catch(_0x3d9598){logger['error'](_0xa713('0xb'),_0x100e28,_[_0xa713('0x19')](_0x3d9598)?JSON[_0xa713('0x1a')](_0x3d9598):_0x3d9598);logger[_0xa713('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x100e28);_0x400dd9['next']();}};}; \ No newline at end of file +var _0xb51b=['lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','consequence','length','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','finally','isObject','stringify','next','validate'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb51b,0x194));var _0xbb51=function(_0x1e4430,_0x4613a1){_0x1e4430=_0x1e4430-0x0;var _0x5ca16b=_0xb51b[_0x1e4430];return _0x5ca16b;};'use strict';var schema=require(_0xbb51('0x0'));var _=require(_0xbb51('0x1'));var rpc={'chatInteraction':require(_0xbb51('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xbb51('0x3')),'mailInteraction':require(_0xbb51('0x4')),'faxInteraction':require(_0xbb51('0x5')),'whatsappInteraction':require(_0xbb51('0x6'))};var logger=require(_0xbb51('0x7'))(_0xbb51('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xbb51('0x9')]=function(_0x1bca93,_0x4c652d,_0x2822f9,_0x102575){return function(_0x31a373){try{var _0x6c66fc={'tag':_0x4c652d[0x0]};var _0x52b5d2=tag[_0xbb51('0x0')](_0x6c66fc,{'typecast':!![]});if(_0x52b5d2[_0xbb51('0xa')]){logger[_0xbb51('0xb')]('[%s][TAG]\x20%s',_0x1bca93,_[_0xbb51('0xc')](_0x52b5d2,_0xbb51('0xd'))[_0xbb51('0xe')](',\x20'));logger[_0xbb51('0xf')](_0xbb51('0x10'),_0x1bca93);_0x31a373['next']();}else{var _0x4c12d0={'ids':[_0x4c652d[0x0]]};if(rpc[_0x102575[_0xbb51('0x11')]+'Interaction']){rpc[_0x102575['channel']+'Interaction']['addTags'](_0x102575[_0xbb51('0x12')]['id'],_0x4c12d0)[_0xbb51('0x13')](function(_0x4ae221){logger[_0xbb51('0xf')](_0xbb51('0x14'),_0x1bca93,_0x4c652d[0x1],_0x102575['channel'],_0x102575[_0xbb51('0x12')]['id']);})[_0xbb51('0x15')](function(_0x5d2947){logger['error'](_0xbb51('0x16'),_0x1bca93,JSON['stringify'](_0x5d2947));logger[_0xbb51('0xf')](_0xbb51('0x10'),_0x1bca93);})[_0xbb51('0x17')](function(){_0x31a373['next']();});}}}catch(_0x2443b8){logger[_0xbb51('0xb')](_0xbb51('0x16'),_0x1bca93,_[_0xbb51('0x18')](_0x2443b8)?JSON[_0xbb51('0x19')](_0x2443b8):_0x2443b8);logger[_0xbb51('0xf')](_0xbb51('0x10'),_0x1bca93);_0x31a373[_0xbb51('0x1a')]();}};}; \ 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 419c11f..ad380f0 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 _0xad95=['exports','render','merge','message','mustache','lodash'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xad95,0x70));var _0x5ad9=function(_0x5ea0b4,_0x5396a4){_0x5ea0b4=_0x5ea0b4-0x0;var _0x3e89bd=_0xad95[_0x5ea0b4];return _0x3e89bd;};'use strict';var Mustache=require(_0x5ad9('0x0'));var _=require(_0x5ad9('0x1'));module[_0x5ad9('0x2')]={'getMustacheRender':function(_0x51c14c,_0x52ad89){return Mustache[_0x5ad9('0x3')](_0x51c14c,_[_0x5ad9('0x4')](_0x52ad89['body'],{'contact':_0x52ad89['contact'],'message':_0x52ad89[_0x5ad9('0x5')],'account':_0x52ad89['account'],'interaction':_0x52ad89['interaction'],'list':_0x52ad89['list']}))||'';}}; \ No newline at end of file +var _0xe13a=['merge','body','contact','message','account','interaction','list','lodash','exports'];(function(_0x508660,_0x6ae4fa){var _0x3f1cda=function(_0x543ccc){while(--_0x543ccc){_0x508660['push'](_0x508660['shift']());}};_0x3f1cda(++_0x6ae4fa);}(_0xe13a,0x178));var _0xae13=function(_0x428e14,_0x389802){_0x428e14=_0x428e14-0x0;var _0x46e969=_0xe13a[_0x428e14];return _0x46e969;};'use strict';var Mustache=require('mustache');var _=require(_0xae13('0x0'));module[_0xae13('0x1')]={'getMustacheRender':function(_0x3dd3e8,_0x6066c0){return Mustache['render'](_0x3dd3e8,_[_0xae13('0x2')](_0x6066c0[_0xae13('0x3')],{'contact':_0x6066c0[_0xae13('0x4')],'message':_0x6066c0[_0xae13('0x5')],'account':_0x6066c0[_0xae13('0x6')],'interaction':_0x6066c0[_0xae13('0x7')],'list':_0x6066c0[_0xae13('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3ca7eb7..28048aa 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 _0xccc1=['stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','interaction','isArray','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','tag','TagId','format','%s:%s:%s','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','.js','Applications\x20executed','emit','complete','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','channel','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http'];(function(_0xf34484,_0x3b3953){var _0x3c2851=function(_0x2b45dc){while(--_0x2b45dc){_0xf34484['push'](_0xf34484['shift']());}};_0x3c2851(++_0x3b3953);}(_0xccc1,0x65));var _0x1ccc=function(_0x4070fe,_0x4f253b){_0x4070fe=_0x4070fe-0x0;var _0x430c8b=_0xccc1[_0x4070fe];return _0x430c8b;};'use strict';var _=require(_0x1ccc('0x0'));var util=require(_0x1ccc('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x1ccc('0x2'));var BPromise=require(_0x1ccc('0x3'));var uuid=require(_0x1ccc('0x4'));var config=require(_0x1ccc('0x5'));var logger=require(_0x1ccc('0x6'))(_0x1ccc('0x7'));var rpc={'openchannelQueueReport':require(_0x1ccc('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x1ccc('0x9')),'smsQueueReport':require(_0x1ccc('0xa')),'faxQueueReport':require(_0x1ccc('0xb')),'whatsappQueueReport':require(_0x1ccc('0xc'))};var RuleEngine=require(_0x1ccc('0xd'));function getId(_0x339c00,_0x4df419,_0x521746){return util['format'](_0x1ccc('0xe'),_0x339c00,_0x4df419||0x0,_0x521746||0x0);}function getIntervals(_0x2fdec7,_0x33bf8b){var _0x3df3ed=[];if(!_[_0x1ccc('0xf')](_0x33bf8b[_0x1ccc('0x10')])&&!_['isNil'](_0x2fdec7[_0x33bf8b[_0x1ccc('0x10')]])&&!_[_0x1ccc('0xf')](_0x2fdec7[_0x33bf8b[_0x1ccc('0x10')]][_0x1ccc('0x11')])){_0x3df3ed=_['map'](_0x2fdec7[_0x33bf8b[_0x1ccc('0x10')]][_0x1ccc('0x11')],_0x1ccc('0x12'));}else if(!_[_0x1ccc('0xf')](_0x33bf8b[_0x1ccc('0x12')])){_0x3df3ed=[_0x33bf8b[_0x1ccc('0x12')]];}return _0x3df3ed;}exports[_0x1ccc('0x13')]=function(_0x383278){_0x383278[_0x1ccc('0x14')]={};return new BPromise(function(_0x1e14d3,_0x11a69f){var _0x2f456b={'Start':function(_0x1eb940){var _0x340b6d=this;return new Promise(function(_0x1372ce,_0x331b52){if(_0x1eb940){try{var _0x29fff8=[];var _0x41b4bd=getId(_0x1eb940['channel'],_0x1eb940[_0x1ccc('0x15')]?_0x1eb940[_0x1ccc('0x15')]['id']:0x0,_0x1eb940[_0x1ccc('0x16')]?_0x1eb940[_0x1ccc('0x16')]['id']:0x0);if(_0x1eb940['applications']&&_[_0x1ccc('0x17')](_0x1eb940[_0x1ccc('0x18')])&&_0x1eb940[_0x1ccc('0x18')][_0x1ccc('0x19')]){for(var _0x841c1a=0x0;_0x841c1a<_0x1eb940[_0x1ccc('0x18')][_0x1ccc('0x19')];_0x841c1a+=0x1){var _0x808b5c=_0x1eb940[_0x1ccc('0x18')][_0x841c1a];if(fs[_0x1ccc('0x1a')](path['join'](__dirname,_0x1ccc('0x18'),_0x808b5c[_0x1ccc('0x1b')]+'.js'))){var _0x4b276e=[];switch(_0x808b5c[_0x1ccc('0x1b')][_0x1ccc('0x1c')]()){case _0x1ccc('0x1d'):var _0xf89bb3=_0x808b5c[_0x1ccc('0x1e')][_0x1ccc('0x1f')](',');_0x4b276e[_0x1ccc('0x20')](_0xf89bb3[0x0]);_0x4b276e[_0x1ccc('0x20')](_0xf89bb3[_0x1ccc('0x21')](0x1,_0xf89bb3[_0x1ccc('0x19')])[_0x1ccc('0x22')](','));break;case _0x1ccc('0x23'):var _0xdd49b6=_0x808b5c[_0x1ccc('0x1e')][_0x1ccc('0x1f')](',');_0x4b276e[_0x1ccc('0x20')](_0xdd49b6[0x0]);_0x4b276e['push'](_0xdd49b6[0x1]);_0x4b276e[_0x1ccc('0x20')](_0xdd49b6[_0x1ccc('0x21')](0x2,_0xdd49b6['length'])['join'](','));break;case _0x1ccc('0x24'):var _0x102d5e=_0x808b5c[_0x1ccc('0x1e')][_0x1ccc('0x1f')](',');_0x4b276e[_0x1ccc('0x20')](_0x102d5e[0x0]);_0x4b276e[_0x1ccc('0x20')](_0x102d5e[0x1]);_0x4b276e[_0x1ccc('0x20')](_0x102d5e[0x2]);_0x4b276e[_0x1ccc('0x20')](_0x102d5e[0x3]);_0x4b276e[_0x1ccc('0x20')](_0x102d5e[_0x1ccc('0x21')](0x4,_0x102d5e[_0x1ccc('0x19')])[_0x1ccc('0x22')](','));break;case'message':_0x4b276e[_0x1ccc('0x20')](_0x808b5c[_0x1ccc('0x1e')]);break;case _0x1ccc('0x25'):_0x4b276e['push'](_0x808b5c[_0x1ccc('0x26')]);_0x4b276e['push'](_0x808b5c[_0x1ccc('0x1e')]);break;default:_0x4b276e=_['isNil'](_0x808b5c[_0x1ccc('0x1e')])?[]:_0x808b5c[_0x1ccc('0x1e')][_0x1ccc('0x1f')](',');}var _0x34bee0={'id':util[_0x1ccc('0x27')](_0x1ccc('0x28'),_0x41b4bd,_0x808b5c['id'],_0x808b5c[_0x1ccc('0x1b')]),'condition':require('./interval')[_0x1ccc('0x29')](_0x41b4bd,getIntervals(_0x383278[_0x1ccc('0x2a')],_0x808b5c),_0x383278),'consequence':require('./applications/'+_0x808b5c['app'])[_0x1ccc('0x2b')](_0x41b4bd,_0x4b276e,_0x383278,_0x1eb940),'p':_0x808b5c[_0x1ccc('0x2c')]||0x0};logger[_0x1ccc('0x2d')](_0x1ccc('0x2e'),_0x34bee0['id'],_0x1ccc('0x2f'),getIntervals(_0x383278[_0x1ccc('0x2a')],_0x808b5c)[_0x1ccc('0x22')](_0x1ccc('0x30')));_0x29fff8[_0x1ccc('0x20')](_0x34bee0);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x1ccc('0x22')](__dirname,_0x1ccc('0x18'),_0x808b5c['app']+_0x1ccc('0x31')));}}_0x383278['rules'][_0x41b4bd]=new RuleEngine(_0x29fff8);_0x383278[_0x1ccc('0x14')][_0x41b4bd]['execute'](_0x1eb940,function(_0x30515e){logger[_0x1ccc('0x2d')](_0x1ccc('0x32'),JSON['stringify'](_0x30515e['matchPath']));if(_0x383278[_0x1ccc('0x14')][_0x41b4bd]){_0x383278[_0x1ccc('0x14')][_0x41b4bd][_0x1ccc('0x33')](_0x1ccc('0x34'));}});return _0x1372ce({'code':0xc8,'message':_0x1eb940});}else{logger[_0x1ccc('0x2d')](_0x1ccc('0x35'));return _0x1372ce({'code':0xc8,'message':_0x1eb940});}}catch(_0x2e82cf){logger[_0x1ccc('0x36')](_0x2e82cf[_0x1ccc('0x37')]);return _0x331b52(_0x340b6d[_0x1ccc('0x36')](0x1f4,_0x2e82cf));}}return _0x331b52(_0x1ccc('0x38'));});},'AcceptMessage':function(_0x33b202){var _0xba19b=this;return new Promise(function(_0x209af3,_0x49735a){if(_0x33b202[_0x1ccc('0x15')]&&_0x33b202[_0x1ccc('0x15')]['id']){try{var _0x163363=getId(_0x33b202[_0x1ccc('0x39')],_0x33b202[_0x1ccc('0x15')]?_0x33b202['message']['id']:0x0,_0x33b202['interaction']?_0x33b202[_0x1ccc('0x16')]['id']:0x0);if(_0x383278[_0x1ccc('0x14')][_0x163363]){_0x383278[_0x1ccc('0x14')][_0x163363][_0x1ccc('0x33')](_0x1ccc('0x3a'));if(rpc[_0x33b202['channel']+_0x1ccc('0x3b')]){rpc[_0x33b202[_0x1ccc('0x39')]+_0x1ccc('0x3b')][_0x1ccc('0x3c')](_0x163363,{'UserId':_0x33b202[_0x1ccc('0x15')][_0x1ccc('0x3d')]})[_0x1ccc('0x3e')](function(_0x20fefd){logger[_0x1ccc('0x36')](_0x1ccc('0x3f'));});}}return _0x209af3({'code':0xc8,'message':_0x33b202});}catch(_0x336183){logger[_0x1ccc('0x36')](_0x336183[_0x1ccc('0x37')]);return _0x49735a(_0xba19b['error'](0x1f4,_0x336183));}}logger[_0x1ccc('0x36')](_0x1ccc('0x40'));return _0x49735a(_0xba19b['error'](0x1f4,_0x1ccc('0x40')));});},'RejectMessage':function(_0x1cdf50){var _0x53c345=this;return new Promise(function(_0x3ec897,_0x427d10){if(_0x1cdf50['agent']&&_0x1cdf50[_0x1ccc('0x41')]['id']){try{if(_0x383278[_0x1ccc('0x42')][_0x1cdf50['agent']['id']]){_0x383278[_0x1ccc('0x42')][_0x1cdf50[_0x1ccc('0x41')]['id']][_0x1ccc('0x43')]=![];_0x383278[_0x1ccc('0x42')][_0x1cdf50['agent']['id']][_0x1ccc('0x44')]=undefined;}return _0x3ec897({'code':0xc8,'message':_0x1cdf50});}catch(_0x5033e8){logger[_0x1ccc('0x36')](_0x5033e8['stack']);return _0x427d10(_0x53c345['error'](0x1f4,_0x5033e8));}}logger[_0x1ccc('0x36')]('message\x20is\x20empty');return _0x427d10(_0x53c345[_0x1ccc('0x36')](0x1f4,_0x1ccc('0x40')));});},'AbandonInteraction':function(_0xfe4af2){var _0x140f9c=this;return new Promise(function(_0x221cd1,_0x5a8516){if(_0xfe4af2[_0x1ccc('0x39')]&&_0xfe4af2['interaction']&&_0xfe4af2['interaction']['id']){try{var _0x5266f0=getId(_0xfe4af2[_0x1ccc('0x39')],_0xfe4af2['message']?_0xfe4af2[_0x1ccc('0x15')]['id']:0x0,_0xfe4af2[_0x1ccc('0x16')]?_0xfe4af2[_0x1ccc('0x16')]['id']:0x0);if(_0x383278[_0x1ccc('0x14')][_0x5266f0]){_0x383278[_0x1ccc('0x14')][_0x5266f0][_0x1ccc('0x33')]('end');}return _0x221cd1({'code':0xc8,'message':_0xfe4af2});}catch(_0xa179fd){logger[_0x1ccc('0x36')](_0xa179fd[_0x1ccc('0x37')]);return _0x5a8516(_0x140f9c[_0x1ccc('0x36')](0x1f4,_0xa179fd));}}logger[_0x1ccc('0x36')](_0x1ccc('0x40'));return _0x5a8516(_0x140f9c[_0x1ccc('0x36')](0x1f4,_0x1ccc('0x40')));});},'AgentCapacity':function(_0xe243c7){var _0x541ba3=this;return new Promise(function(_0x16434,_0x3fa57f){if(_0x383278[_0x1ccc('0x42')][_0x1ccc('0x45')](_0xe243c7['id'])){for(var _0x5e75b2 in _0xe243c7[_0x1ccc('0x46')]){if(_0xe243c7[_0x1ccc('0x46')][_0x1ccc('0x45')](_0x5e75b2)){if(_0x383278[_0x1ccc('0x42')][_0xe243c7['id']][_0x1ccc('0x45')](_0x5e75b2+_0x1ccc('0x47'))){_0x383278[_0x1ccc('0x42')][_0xe243c7['id']][_0x5e75b2+_0x1ccc('0x47')]=parseInt(_0xe243c7['capacity'][_0x5e75b2],0xa);}}}_0x383278[_0x1ccc('0x42')][_0xe243c7['id']]['updateRealtime']();return _0x16434({'code':0xc8,'message':_0x383278[_0x1ccc('0x42')][_0xe243c7['id']]});}else{return _0x3fa57f(_0x541ba3[_0x1ccc('0x36')](0x1f4,_0x1ccc('0x48')));}});},'Agents':function(_0x557855){return new Promise(function(_0x29da5a,_0x1141fd){var _0xd7d11b=_[_0x1ccc('0x49')](_0x383278['agents']);_0x29da5a({'count':_0xd7d11b[_0x1ccc('0x19')],'rows':_0xd7d11b});});},'ChatQueues':function(_0x4fe7bb){return new Promise(function(_0xb5e28f,_0x2e53fb){var _0x2c62e1=[];for(var _0x2affa7 in _0x383278['chatQueues']){if(_0x383278['chatQueues']['hasOwnProperty'](_0x2affa7)){var _0x419419=_0x383278[_0x1ccc('0x4a')][_0x2affa7];var _0x510bf0={'id':_0x419419['id'],'available':_0x419419[_0x1ccc('0x4b')],'loggedIn':_0x419419[_0x1ccc('0x4c')],'name':_0x419419['name'],'paused':_0x419419[_0x1ccc('0x4d')],'waiting':_0x419419[_0x1ccc('0x4e')]};_0x2c62e1[_0x1ccc('0x20')](_0x510bf0);}}_0xb5e28f({'count':_0x2c62e1[_0x1ccc('0x19')],'rows':_0x2c62e1});});},'MailQueues':function(_0x2d67f9){return new Promise(function(_0x2129cb,_0x3514f0){var _0x33cfc7=[];for(var _0x472913 in _0x383278['mailQueues']){if(_0x383278['mailQueues'][_0x1ccc('0x45')](_0x472913)){var _0x33d345=_0x383278[_0x1ccc('0x4f')][_0x472913];var _0x411447={'id':_0x33d345['id'],'available':_0x33d345[_0x1ccc('0x4b')],'loggedIn':_0x33d345[_0x1ccc('0x4c')],'name':_0x33d345[_0x1ccc('0x50')],'paused':_0x33d345['paused'],'waiting':_0x33d345[_0x1ccc('0x4e')]};_0x33cfc7['push'](_0x411447);}}_0x2129cb({'count':_0x33cfc7[_0x1ccc('0x19')],'rows':_0x33cfc7});});},'OpenchannelQueues':function(_0x3adcd7){return new Promise(function(_0x493811,_0x42b7ff){var _0x46dbce=[];for(var _0x3122c7 in _0x383278[_0x1ccc('0x51')]){if(_0x383278[_0x1ccc('0x51')][_0x1ccc('0x45')](_0x3122c7)){var _0x41eeef=_0x383278[_0x1ccc('0x51')][_0x3122c7];var _0x336651={'id':_0x41eeef['id'],'available':_0x41eeef[_0x1ccc('0x4b')],'loggedIn':_0x41eeef[_0x1ccc('0x4c')],'name':_0x41eeef[_0x1ccc('0x50')],'paused':_0x41eeef[_0x1ccc('0x4d')],'waiting':_0x41eeef[_0x1ccc('0x4e')]};_0x46dbce[_0x1ccc('0x20')](_0x336651);}}_0x493811({'count':_0x46dbce['length'],'rows':_0x46dbce});});},'SmsQueues':function(_0x4d22d5){return new Promise(function(_0x491e41,_0x2d0a4c){var _0x527b6e=[];for(var _0x31fa43 in _0x383278[_0x1ccc('0x52')]){if(_0x383278['smsQueues'][_0x1ccc('0x45')](_0x31fa43)){var _0x13a15c=_0x383278[_0x1ccc('0x52')][_0x31fa43];var _0x45639b={'id':_0x13a15c['id'],'available':_0x13a15c[_0x1ccc('0x4b')],'loggedIn':_0x13a15c[_0x1ccc('0x4c')],'name':_0x13a15c['name'],'paused':_0x13a15c[_0x1ccc('0x4d')],'waiting':_0x13a15c[_0x1ccc('0x4e')]};_0x527b6e['push'](_0x45639b);}}_0x491e41({'count':_0x527b6e[_0x1ccc('0x19')],'rows':_0x527b6e});});},'FaxQueues':function(_0x4e0741){return new Promise(function(_0x1ca483,_0x3b4b94){var _0x1da573=[];for(var _0x1ce314 in _0x383278[_0x1ccc('0x53')]){if(_0x383278[_0x1ccc('0x53')][_0x1ccc('0x45')](_0x1ce314)){var _0x407477=_0x383278[_0x1ccc('0x53')][_0x1ce314];var _0x30b89b={'id':_0x407477['id'],'available':_0x407477[_0x1ccc('0x4b')],'loggedIn':_0x407477[_0x1ccc('0x4c')],'name':_0x407477[_0x1ccc('0x50')],'paused':_0x407477[_0x1ccc('0x4d')],'waiting':_0x407477[_0x1ccc('0x4e')]};_0x1da573[_0x1ccc('0x20')](_0x30b89b);}}_0x1ca483({'count':_0x1da573[_0x1ccc('0x19')],'rows':_0x1da573});});},'WhatsappQueues':function(_0x1b0bdc){return new Promise(function(_0x4eadfa,_0x546348){var _0x4c0d9b=[];for(var _0x3e0b65 in _0x383278['whatsappQueues']){if(_0x383278[_0x1ccc('0x54')][_0x1ccc('0x45')](_0x3e0b65)){var _0x148ecd=_0x383278[_0x1ccc('0x54')][_0x3e0b65];var _0x202a22={'id':_0x148ecd['id'],'available':_0x148ecd[_0x1ccc('0x4b')],'loggedIn':_0x148ecd[_0x1ccc('0x4c')],'name':_0x148ecd[_0x1ccc('0x50')],'paused':_0x148ecd[_0x1ccc('0x4d')],'waiting':_0x148ecd['waiting']};_0x4c0d9b[_0x1ccc('0x20')](_0x202a22);}}_0x4eadfa({'count':_0x4c0d9b[_0x1ccc('0x19')],'rows':_0x4c0d9b});});},'ChatQueuesWaitingInteractions':function(_0x22b70){return new Promise(function(_0xc82a8e,_0x5ec62e){var _0x1b697a=_['values'](_0x383278['chatQueuesWaitingInteractions']);_0xc82a8e({'count':_0x1b697a[_0x1ccc('0x19')],'rows':_0x1b697a});});},'MailQueuesWaitingInteractions':function(_0x4c6e40){return new Promise(function(_0x497890,_0x294eaa){var _0xdfb68c=_[_0x1ccc('0x49')](_0x383278[_0x1ccc('0x55')]);_0x497890({'count':_0xdfb68c['length'],'rows':_0xdfb68c});});},'OpenchannelQueuesWaitingInteractions':function(_0x4eec91){return new Promise(function(_0x26d0d7,_0x7182d){var _0xa9a557=_[_0x1ccc('0x49')](_0x383278[_0x1ccc('0x56')]);_0x26d0d7({'count':_0xa9a557[_0x1ccc('0x19')],'rows':_0xa9a557});});},'SmsQueuesWaitingInteractions':function(_0x55235a){return new Promise(function(_0x182249,_0x53cce6){var _0x291142=_[_0x1ccc('0x49')](_0x383278[_0x1ccc('0x57')]);_0x182249({'count':_0x291142[_0x1ccc('0x19')],'rows':_0x291142});});},'FaxQueuesWaitingInteractions':function(_0x355ddd){return new Promise(function(_0x273b4b,_0x2ab129){var _0x4e9e8f=_[_0x1ccc('0x49')](_0x383278[_0x1ccc('0x58')]);_0x273b4b({'count':_0x4e9e8f[_0x1ccc('0x19')],'rows':_0x4e9e8f});});},'WhatsappQueuesWaitingInteractions':function(_0x1ede6c){return new Promise(function(_0x54bbbc,_0x3c8f30){var _0x23791a=_[_0x1ccc('0x49')](_0x383278['whatsappQueuesWaitingInteractions']);_0x54bbbc({'count':_0x23791a[_0x1ccc('0x19')],'rows':_0x23791a});});}};var _0x25acc8=jayson[_0x1ccc('0x59')](_0x2f456b)[_0x1ccc('0x5a')]();_0x25acc8['on']('error',function(_0x49d208){logger['error'](JSON[_0x1ccc('0x5b')](_0x49d208));return _0x11a69f(_0x49d208);});_0x25acc8[_0x1ccc('0x13')](0x232c,_0x1ccc('0x5c'),function(){console[_0x1ccc('0x5d')](_0x1ccc('0x5e'),0x232c);return _0x1e14d3(_0x1ccc('0x5f')+0x232c);});});}; \ No newline at end of file +var _0x23ea=['../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','%s:%s:%s','./interval','condition','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','emit','routing\x20is\x20empty','QueueReport','update','UserId','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','CurrentCapacity','capacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport'];(function(_0x37813e,_0x15a7d1){var _0x407630=function(_0x4a24fd){while(--_0x4a24fd){_0x37813e['push'](_0x37813e['shift']());}};_0x407630(++_0x15a7d1);}(_0x23ea,0xa7));var _0xa23e=function(_0x4d6453,_0x4dfc5a){_0x4d6453=_0x4d6453-0x0;var _0x14d362=_0x23ea[_0x4d6453];return _0x14d362;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var path=require(_0xa23e('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xa23e('0x3'));var uuid=require(_0xa23e('0x4'));var config=require('../../../config/environment');var logger=require(_0xa23e('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0xa23e('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa23e('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xa23e('0x8'))};var RuleEngine=require(_0xa23e('0x9'));function getId(_0x19fb1c,_0x3c3021,_0x16d383){return util['format'](_0xa23e('0xa'),_0x19fb1c,_0x3c3021||0x0,_0x16d383||0x0);}function getIntervals(_0x3dd707,_0x28025d){var _0x1b0d64=[];if(!_[_0xa23e('0xb')](_0x28025d[_0xa23e('0xc')])&&!_[_0xa23e('0xb')](_0x3dd707[_0x28025d[_0xa23e('0xc')]])&&!_[_0xa23e('0xb')](_0x3dd707[_0x28025d[_0xa23e('0xc')]][_0xa23e('0xd')])){_0x1b0d64=_[_0xa23e('0xe')](_0x3dd707[_0x28025d[_0xa23e('0xc')]][_0xa23e('0xd')],_0xa23e('0xf'));}else if(!_[_0xa23e('0xb')](_0x28025d[_0xa23e('0xf')])){_0x1b0d64=[_0x28025d[_0xa23e('0xf')]];}return _0x1b0d64;}exports[_0xa23e('0x10')]=function(_0x2f85a4){_0x2f85a4[_0xa23e('0x11')]={};return new BPromise(function(_0x5258ef,_0xd889ce){var _0x3749b3={'Start':function(_0x1ea932){var _0x2a6214=this;return new Promise(function(_0x493082,_0x18a0a8){if(_0x1ea932){try{var _0x241738=[];var _0x2f8911=getId(_0x1ea932[_0xa23e('0x12')],_0x1ea932['message']?_0x1ea932[_0xa23e('0x13')]['id']:0x0,_0x1ea932[_0xa23e('0x14')]?_0x1ea932[_0xa23e('0x14')]['id']:0x0);if(_0x1ea932[_0xa23e('0x15')]&&_[_0xa23e('0x16')](_0x1ea932[_0xa23e('0x15')])&&_0x1ea932[_0xa23e('0x15')][_0xa23e('0x17')]){for(var _0x16bd65=0x0;_0x16bd65<_0x1ea932['applications'][_0xa23e('0x17')];_0x16bd65+=0x1){var _0x27c1f8=_0x1ea932[_0xa23e('0x15')][_0x16bd65];if(fs['existsSync'](path[_0xa23e('0x18')](__dirname,_0xa23e('0x15'),_0x27c1f8[_0xa23e('0x19')]+'.js'))){var _0x1d6a0a=[];switch(_0x27c1f8[_0xa23e('0x19')][_0xa23e('0x1a')]()){case _0xa23e('0x1b'):var _0x972d3=_0x27c1f8[_0xa23e('0x1c')][_0xa23e('0x1d')](',');_0x1d6a0a['push'](_0x972d3[0x0]);_0x1d6a0a[_0xa23e('0x1e')](_0x972d3[_0xa23e('0x1f')](0x1,_0x972d3[_0xa23e('0x17')])[_0xa23e('0x18')](','));break;case _0xa23e('0x20'):var _0x103f1e=_0x27c1f8['appdata'][_0xa23e('0x1d')](',');_0x1d6a0a['push'](_0x103f1e[0x0]);_0x1d6a0a[_0xa23e('0x1e')](_0x103f1e[0x1]);_0x1d6a0a['push'](_0x103f1e[_0xa23e('0x1f')](0x2,_0x103f1e[_0xa23e('0x17')])['join'](','));break;case _0xa23e('0x21'):var _0x2cc662=_0x27c1f8[_0xa23e('0x1c')][_0xa23e('0x1d')](',');_0x1d6a0a[_0xa23e('0x1e')](_0x2cc662[0x0]);_0x1d6a0a[_0xa23e('0x1e')](_0x2cc662[0x1]);_0x1d6a0a[_0xa23e('0x1e')](_0x2cc662[0x2]);_0x1d6a0a[_0xa23e('0x1e')](_0x2cc662[0x3]);_0x1d6a0a[_0xa23e('0x1e')](_0x2cc662[_0xa23e('0x1f')](0x4,_0x2cc662[_0xa23e('0x17')])[_0xa23e('0x18')](','));break;case _0xa23e('0x13'):_0x1d6a0a[_0xa23e('0x1e')](_0x27c1f8[_0xa23e('0x1c')]);break;case _0xa23e('0x22'):_0x1d6a0a[_0xa23e('0x1e')](_0x27c1f8['TagId']);_0x1d6a0a[_0xa23e('0x1e')](_0x27c1f8[_0xa23e('0x1c')]);break;default:_0x1d6a0a=_[_0xa23e('0xb')](_0x27c1f8[_0xa23e('0x1c')])?[]:_0x27c1f8[_0xa23e('0x1c')][_0xa23e('0x1d')](',');}var _0x1cc0aa={'id':util['format'](_0xa23e('0x23'),_0x2f8911,_0x27c1f8['id'],_0x27c1f8[_0xa23e('0x19')]),'condition':require(_0xa23e('0x24'))[_0xa23e('0x25')](_0x2f8911,getIntervals(_0x2f85a4['intervals'],_0x27c1f8),_0x2f85a4),'consequence':require(_0xa23e('0x26')+_0x27c1f8['app'])[_0xa23e('0x27')](_0x2f8911,_0x1d6a0a,_0x2f85a4,_0x1ea932),'p':_0x27c1f8[_0xa23e('0x28')]||0x0};logger['info'](_0xa23e('0x29'),_0x1cc0aa['id'],_0xa23e('0x2a'),getIntervals(_0x2f85a4[_0xa23e('0x2b')],_0x27c1f8)[_0xa23e('0x18')](_0xa23e('0x2c')));_0x241738[_0xa23e('0x1e')](_0x1cc0aa);}else{logger[_0xa23e('0x2d')](_0xa23e('0x2e'),path[_0xa23e('0x18')](__dirname,'applications',_0x27c1f8[_0xa23e('0x19')]+'.js'));}}_0x2f85a4[_0xa23e('0x11')][_0x2f8911]=new RuleEngine(_0x241738);_0x2f85a4['rules'][_0x2f8911]['execute'](_0x1ea932,function(_0x1d22a1){logger[_0xa23e('0x2f')](_0xa23e('0x30'),JSON[_0xa23e('0x31')](_0x1d22a1['matchPath']));if(_0x2f85a4[_0xa23e('0x11')][_0x2f8911]){_0x2f85a4[_0xa23e('0x11')][_0x2f8911][_0xa23e('0x32')]('complete');}});return _0x493082({'code':0xc8,'message':_0x1ea932});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x493082({'code':0xc8,'message':_0x1ea932});}}catch(_0x32913f){logger[_0xa23e('0x2d')](_0x32913f['stack']);return _0x18a0a8(_0x2a6214['error'](0x1f4,_0x32913f));}}return _0x18a0a8(_0xa23e('0x33'));});},'AcceptMessage':function(_0xec2878){var _0x2f1c0c=this;return new Promise(function(_0x5d1091,_0xf8731b){if(_0xec2878[_0xa23e('0x13')]&&_0xec2878['message']['id']){try{var _0x436fdb=getId(_0xec2878[_0xa23e('0x12')],_0xec2878['message']?_0xec2878[_0xa23e('0x13')]['id']:0x0,_0xec2878['interaction']?_0xec2878[_0xa23e('0x14')]['id']:0x0);if(_0x2f85a4[_0xa23e('0x11')][_0x436fdb]){_0x2f85a4['rules'][_0x436fdb][_0xa23e('0x32')]('end');if(rpc[_0xec2878['channel']+_0xa23e('0x34')]){rpc[_0xec2878[_0xa23e('0x12')]+_0xa23e('0x34')][_0xa23e('0x35')](_0x436fdb,{'UserId':_0xec2878[_0xa23e('0x13')][_0xa23e('0x36')]})['catch'](function(_0x2e0eb4){logger[_0xa23e('0x2d')]('error\x20update\x20queue\x20report');});}}return _0x5d1091({'code':0xc8,'message':_0xec2878});}catch(_0x2b4fac){logger[_0xa23e('0x2d')](_0x2b4fac[_0xa23e('0x37')]);return _0xf8731b(_0x2f1c0c[_0xa23e('0x2d')](0x1f4,_0x2b4fac));}}logger[_0xa23e('0x2d')](_0xa23e('0x38'));return _0xf8731b(_0x2f1c0c[_0xa23e('0x2d')](0x1f4,_0xa23e('0x38')));});},'RejectMessage':function(_0x1ed59d){var _0x376052=this;return new Promise(function(_0x4e4f94,_0x2badcf){if(_0x1ed59d[_0xa23e('0x39')]&&_0x1ed59d[_0xa23e('0x39')]['id']){try{if(_0x2f85a4[_0xa23e('0x3a')][_0x1ed59d[_0xa23e('0x39')]['id']]){_0x2f85a4[_0xa23e('0x3a')][_0x1ed59d[_0xa23e('0x39')]['id']][_0xa23e('0x3b')]=![];_0x2f85a4[_0xa23e('0x3a')][_0x1ed59d['agent']['id']][_0xa23e('0x3c')]=undefined;}return _0x4e4f94({'code':0xc8,'message':_0x1ed59d});}catch(_0x3ae39b){logger['error'](_0x3ae39b['stack']);return _0x2badcf(_0x376052[_0xa23e('0x2d')](0x1f4,_0x3ae39b));}}logger['error'](_0xa23e('0x38'));return _0x2badcf(_0x376052['error'](0x1f4,_0xa23e('0x38')));});},'AbandonInteraction':function(_0x374198){var _0x1ed51b=this;return new Promise(function(_0xc05634,_0x4fb6c1){if(_0x374198['channel']&&_0x374198[_0xa23e('0x14')]&&_0x374198[_0xa23e('0x14')]['id']){try{var _0xb9f5ef=getId(_0x374198['channel'],_0x374198['message']?_0x374198[_0xa23e('0x13')]['id']:0x0,_0x374198[_0xa23e('0x14')]?_0x374198[_0xa23e('0x14')]['id']:0x0);if(_0x2f85a4['rules'][_0xb9f5ef]){_0x2f85a4[_0xa23e('0x11')][_0xb9f5ef][_0xa23e('0x32')]('end');}return _0xc05634({'code':0xc8,'message':_0x374198});}catch(_0x5be03a){logger[_0xa23e('0x2d')](_0x5be03a[_0xa23e('0x37')]);return _0x4fb6c1(_0x1ed51b[_0xa23e('0x2d')](0x1f4,_0x5be03a));}}logger['error'](_0xa23e('0x38'));return _0x4fb6c1(_0x1ed51b[_0xa23e('0x2d')](0x1f4,_0xa23e('0x38')));});},'AgentCapacity':function(_0x4ac8f7){var _0x5729b7=this;return new Promise(function(_0x3aa0ad,_0x4fa205){if(_0x2f85a4[_0xa23e('0x3a')][_0xa23e('0x3d')](_0x4ac8f7['id'])){for(var _0x1818cc in _0x4ac8f7['capacity']){if(_0x4ac8f7['capacity'][_0xa23e('0x3d')](_0x1818cc)){if(_0x2f85a4[_0xa23e('0x3a')][_0x4ac8f7['id']][_0xa23e('0x3d')](_0x1818cc+_0xa23e('0x3e'))){_0x2f85a4[_0xa23e('0x3a')][_0x4ac8f7['id']][_0x1818cc+_0xa23e('0x3e')]=parseInt(_0x4ac8f7[_0xa23e('0x3f')][_0x1818cc],0xa);}}}_0x2f85a4[_0xa23e('0x3a')][_0x4ac8f7['id']][_0xa23e('0x40')]();return _0x3aa0ad({'code':0xc8,'message':_0x2f85a4[_0xa23e('0x3a')][_0x4ac8f7['id']]});}else{return _0x4fa205(_0x5729b7[_0xa23e('0x2d')](0x1f4,_0xa23e('0x41')));}});},'Agents':function(_0x2a9648){return new Promise(function(_0x477dfe,_0x268197){var _0x10cbad=_[_0xa23e('0x42')](_0x2f85a4[_0xa23e('0x3a')]);_0x477dfe({'count':_0x10cbad[_0xa23e('0x17')],'rows':_0x10cbad});});},'ChatQueues':function(_0xeee6a8){return new Promise(function(_0x4795fe,_0x481920){var _0x27d520=[];for(var _0x364df7 in _0x2f85a4[_0xa23e('0x43')]){if(_0x2f85a4[_0xa23e('0x43')][_0xa23e('0x3d')](_0x364df7)){var _0x5e2601=_0x2f85a4[_0xa23e('0x43')][_0x364df7];var _0x4ce344={'id':_0x5e2601['id'],'available':_0x5e2601[_0xa23e('0x44')],'loggedIn':_0x5e2601[_0xa23e('0x45')],'name':_0x5e2601[_0xa23e('0x46')],'paused':_0x5e2601[_0xa23e('0x47')],'waiting':_0x5e2601[_0xa23e('0x48')]};_0x27d520['push'](_0x4ce344);}}_0x4795fe({'count':_0x27d520[_0xa23e('0x17')],'rows':_0x27d520});});},'MailQueues':function(_0x340b27){return new Promise(function(_0x5e8bcf,_0x47cb46){var _0x5e8177=[];for(var _0x3403c4 in _0x2f85a4[_0xa23e('0x49')]){if(_0x2f85a4['mailQueues'][_0xa23e('0x3d')](_0x3403c4)){var _0x2f66e0=_0x2f85a4[_0xa23e('0x49')][_0x3403c4];var _0x24a9b5={'id':_0x2f66e0['id'],'available':_0x2f66e0['available'],'loggedIn':_0x2f66e0['loggedIn'],'name':_0x2f66e0[_0xa23e('0x46')],'paused':_0x2f66e0['paused'],'waiting':_0x2f66e0[_0xa23e('0x48')]};_0x5e8177[_0xa23e('0x1e')](_0x24a9b5);}}_0x5e8bcf({'count':_0x5e8177[_0xa23e('0x17')],'rows':_0x5e8177});});},'OpenchannelQueues':function(_0x1850c5){return new Promise(function(_0x185a59,_0x19abdb){var _0x2ed815=[];for(var _0x34172e in _0x2f85a4[_0xa23e('0x4a')]){if(_0x2f85a4[_0xa23e('0x4a')][_0xa23e('0x3d')](_0x34172e)){var _0x412e90=_0x2f85a4[_0xa23e('0x4a')][_0x34172e];var _0x45541b={'id':_0x412e90['id'],'available':_0x412e90[_0xa23e('0x44')],'loggedIn':_0x412e90[_0xa23e('0x45')],'name':_0x412e90['name'],'paused':_0x412e90[_0xa23e('0x47')],'waiting':_0x412e90['waiting']};_0x2ed815['push'](_0x45541b);}}_0x185a59({'count':_0x2ed815['length'],'rows':_0x2ed815});});},'SmsQueues':function(_0x3ceaea){return new Promise(function(_0x2b43e8,_0x2d24f2){var _0x38a5ad=[];for(var _0x26784c in _0x2f85a4['smsQueues']){if(_0x2f85a4[_0xa23e('0x4b')][_0xa23e('0x3d')](_0x26784c)){var _0x55ba87=_0x2f85a4['smsQueues'][_0x26784c];var _0x2ad1d4={'id':_0x55ba87['id'],'available':_0x55ba87[_0xa23e('0x44')],'loggedIn':_0x55ba87[_0xa23e('0x45')],'name':_0x55ba87['name'],'paused':_0x55ba87[_0xa23e('0x47')],'waiting':_0x55ba87[_0xa23e('0x48')]};_0x38a5ad[_0xa23e('0x1e')](_0x2ad1d4);}}_0x2b43e8({'count':_0x38a5ad['length'],'rows':_0x38a5ad});});},'FaxQueues':function(_0x4ec6e3){return new Promise(function(_0x3c60e2,_0x2a1508){var _0x5d0114=[];for(var _0x5a09e4 in _0x2f85a4['faxQueues']){if(_0x2f85a4[_0xa23e('0x4c')][_0xa23e('0x3d')](_0x5a09e4)){var _0x100e92=_0x2f85a4[_0xa23e('0x4c')][_0x5a09e4];var _0x4ac397={'id':_0x100e92['id'],'available':_0x100e92['available'],'loggedIn':_0x100e92[_0xa23e('0x45')],'name':_0x100e92[_0xa23e('0x46')],'paused':_0x100e92['paused'],'waiting':_0x100e92['waiting']};_0x5d0114['push'](_0x4ac397);}}_0x3c60e2({'count':_0x5d0114[_0xa23e('0x17')],'rows':_0x5d0114});});},'WhatsappQueues':function(_0x410d5f){return new Promise(function(_0x1bdc1b,_0x341df1){var _0x2f91b8=[];for(var _0x1323c4 in _0x2f85a4[_0xa23e('0x4d')]){if(_0x2f85a4[_0xa23e('0x4d')]['hasOwnProperty'](_0x1323c4)){var _0x34e37c=_0x2f85a4[_0xa23e('0x4d')][_0x1323c4];var _0xf0a6cf={'id':_0x34e37c['id'],'available':_0x34e37c['available'],'loggedIn':_0x34e37c[_0xa23e('0x45')],'name':_0x34e37c[_0xa23e('0x46')],'paused':_0x34e37c['paused'],'waiting':_0x34e37c[_0xa23e('0x48')]};_0x2f91b8['push'](_0xf0a6cf);}}_0x1bdc1b({'count':_0x2f91b8[_0xa23e('0x17')],'rows':_0x2f91b8});});},'ChatQueuesWaitingInteractions':function(_0xe57b59){return new Promise(function(_0x12b232,_0x32bdd4){var _0x1ec513=_['values'](_0x2f85a4[_0xa23e('0x4e')]);_0x12b232({'count':_0x1ec513[_0xa23e('0x17')],'rows':_0x1ec513});});},'MailQueuesWaitingInteractions':function(_0x3b101b){return new Promise(function(_0x14d01b,_0x2d58cd){var _0x32bd90=_['values'](_0x2f85a4[_0xa23e('0x4f')]);_0x14d01b({'count':_0x32bd90[_0xa23e('0x17')],'rows':_0x32bd90});});},'OpenchannelQueuesWaitingInteractions':function(_0x4045d4){return new Promise(function(_0x572393,_0x146eca){var _0x2746ab=_['values'](_0x2f85a4[_0xa23e('0x50')]);_0x572393({'count':_0x2746ab[_0xa23e('0x17')],'rows':_0x2746ab});});},'SmsQueuesWaitingInteractions':function(_0x368e17){return new Promise(function(_0x1b7ff3,_0x6240df){var _0x396b98=_[_0xa23e('0x42')](_0x2f85a4[_0xa23e('0x51')]);_0x1b7ff3({'count':_0x396b98[_0xa23e('0x17')],'rows':_0x396b98});});},'FaxQueuesWaitingInteractions':function(_0x5c8f94){return new Promise(function(_0x15b33c,_0x37f242){var _0x55af8a=_[_0xa23e('0x42')](_0x2f85a4[_0xa23e('0x52')]);_0x15b33c({'count':_0x55af8a[_0xa23e('0x17')],'rows':_0x55af8a});});},'WhatsappQueuesWaitingInteractions':function(_0x2199f2){return new Promise(function(_0x574de1,_0x5a7ac2){var _0x8c738b=_[_0xa23e('0x42')](_0x2f85a4[_0xa23e('0x53')]);_0x574de1({'count':_0x8c738b['length'],'rows':_0x8c738b});});}};var _0x19754c=jayson[_0xa23e('0x54')](_0x3749b3)['http']();_0x19754c['on']('error',function(_0xe64a65){logger[_0xa23e('0x2d')](JSON[_0xa23e('0x31')](_0xe64a65));return _0xd889ce(_0xe64a65);});_0x19754c[_0xa23e('0x10')](0x232c,_0xa23e('0x55'),function(){console[_0xa23e('0x56')](_0xa23e('0x57'),0x232c);return _0x5258ef('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 5b28cfe..ac6d2d0 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 _0x991a=['message','result','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','catch','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','lodash','../../../config/logger','routing','client','request','then','error'];(function(_0x2a606e,_0xc991c4){var _0x1fba0f=function(_0x3fa658){while(--_0x3fa658){_0x2a606e['push'](_0x2a606e['shift']());}};_0x1fba0f(++_0xc991c4);}(_0x991a,0x1ef));var _0xa991=function(_0x468e5f,_0x446fd0){_0x468e5f=_0x468e5f-0x0;var _0xb5be1b=_0x991a[_0x468e5f];return _0xb5be1b;};'use strict';var util=require(_0xa991('0x0'));var BPromise=require(_0xa991('0x1'));var jayson=require('jayson/promise');var _=require(_0xa991('0x2'));var logger=require(_0xa991('0x3'))(_0xa991('0x4'));var client=jayson[_0xa991('0x5')]['http']({'port':0x232a});function request(_0x40a83f,_0x1f53f1){return new BPromise(function(_0x10c2ac,_0x523b06){return client[_0xa991('0x6')](_0x40a83f,_0x1f53f1)[_0xa991('0x7')](function(_0x38711d){if(_0x38711d[_0xa991('0x8')]){return _0x523b06(_0x38711d[_0xa991('0x8')][_0xa991('0x9')]);}else{return _0x10c2ac(_0x38711d[_0xa991('0xa')]);}})['catch'](function(_0x3918f6){return _0x523b06(_0x3918f6);});});}exports[_0xa991('0xb')]=function(_0x75deee,_0x242283,_0x1f5784){return function(_0x3395ce){if(_0x1f5784[_0xa991('0xc')]&&!_0x1f5784['rules'][_0x75deee]){logger[_0xa991('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x75deee);return _0x3395ce[_0xa991('0xe')]();}var _0x3e1746=[];for(var _0x2f791d=0x0;_0x2f791d<_0x242283[_0xa991('0xf')];_0x2f791d+=0x1){_0x3e1746[_0xa991('0x10')](request(_0xa991('0x11'),{'command':util['format'](_0xa991('0x12'),_0x242283[_0x2f791d])})[_0xa991('0x7')](function(_0x49e663){return _0x49e663&&_0x49e663[_0xa991('0x9')]&&_0x49e663[_0xa991('0x9')][_0xa991('0x13')]('true')>=0x0?!![]:![];})[_0xa991('0x14')](function(_0x50326e){logger[_0xa991('0x8')](_0xa991('0x15'),_0x75deee,_0x242283[_0x2f791d]);}));}BPromise['all'](_0x3e1746)['then'](function(_0x5eacf0){var _0x43ac2b=_['some'](_0x5eacf0);logger[_0xa991('0xd')](_0xa991('0x16'),_0x75deee,_0x242283[_0xa991('0x17')](_0xa991('0x18')),_0x43ac2b);_0x3395ce[_0xa991('0x19')](_0x43ac2b);})['catch'](function(_0x3ae7ca){console[_0xa991('0x1a')](_0x3ae7ca);logger[_0xa991('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x75deee,_0x242283[_0xa991('0x17')](_0xa991('0x18')),_0x3ae7ca[_0xa991('0x1b')]);_0x3395ce[_0xa991('0xe')]();});};}; \ No newline at end of file +var _0x8ff3=['../../../config/logger','client','http','request','then','error','message','catch','condition','rules','stop','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird'];(function(_0x4af2ad,_0x53ca39){var _0x1a55f8=function(_0x4634a3){while(--_0x4634a3){_0x4af2ad['push'](_0x4af2ad['shift']());}};_0x1a55f8(++_0x53ca39);}(_0x8ff3,0x1a7));var _0x38ff=function(_0x27b423,_0x312583){_0x27b423=_0x27b423-0x0;var _0x5c11b8=_0x8ff3[_0x27b423];return _0x5c11b8;};'use strict';var util=require(_0x38ff('0x0'));var BPromise=require(_0x38ff('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x38ff('0x2'))('routing');var client=jayson[_0x38ff('0x3')][_0x38ff('0x4')]({'port':0x232a});function request(_0x269ad9,_0x21c8a4){return new BPromise(function(_0x11959c,_0x2cb01e){return client[_0x38ff('0x5')](_0x269ad9,_0x21c8a4)[_0x38ff('0x6')](function(_0x4d948f){if(_0x4d948f[_0x38ff('0x7')]){return _0x2cb01e(_0x4d948f[_0x38ff('0x7')][_0x38ff('0x8')]);}else{return _0x11959c(_0x4d948f['result']);}})[_0x38ff('0x9')](function(_0x386a71){return _0x2cb01e(_0x386a71);});});}exports[_0x38ff('0xa')]=function(_0x43dbbf,_0x519523,_0x5d850c){return function(_0x1ca786){if(_0x5d850c[_0x38ff('0xb')]&&!_0x5d850c[_0x38ff('0xb')][_0x43dbbf]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x43dbbf);return _0x1ca786[_0x38ff('0xc')]();}var _0x52500b=[];for(var _0x35bc95=0x0;_0x35bc95<_0x519523['length'];_0x35bc95+=0x1){_0x52500b['push'](request(_0x38ff('0xd'),{'command':util[_0x38ff('0xe')](_0x38ff('0xf'),_0x519523[_0x35bc95])})[_0x38ff('0x6')](function(_0x333257){return _0x333257&&_0x333257[_0x38ff('0x8')]&&_0x333257[_0x38ff('0x8')][_0x38ff('0x10')](_0x38ff('0x11'))>=0x0?!![]:![];})[_0x38ff('0x9')](function(_0x31ef5a){logger[_0x38ff('0x7')](_0x38ff('0x12'),_0x43dbbf,_0x519523[_0x35bc95]);}));}BPromise['all'](_0x52500b)[_0x38ff('0x6')](function(_0x17519b){var _0x261032=_['some'](_0x17519b);logger['info'](_0x38ff('0x13'),_0x43dbbf,_0x519523['join']('\x20|\x20'),_0x261032);_0x1ca786[_0x38ff('0x14')](_0x261032);})[_0x38ff('0x9')](function(_0x42c8a3){console[_0x38ff('0x15')](_0x42c8a3);logger[_0x38ff('0x7')](_0x38ff('0x13'),_0x43dbbf,_0x519523[_0x38ff('0x16')](_0x38ff('0x17')),_0x42c8a3[_0x38ff('0x18')]);_0x1ca786[_0x38ff('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 4ea14af..816923c 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 _0xba28=['forIn','includes','abandoned','holdtime','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','transfertargetuniqueid','rejected','indexOf','agent','complete','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','ringtime','talktime','queuecallerabandon'];(function(_0x1bb29c,_0x297df2){var _0x7262c6=function(_0x53057e){while(--_0x53057e){_0x1bb29c['push'](_0x1bb29c['shift']());}};_0x7262c6(++_0x297df2);}(_0xba28,0xb0));var _0x8ba2=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xba28[_0x50e593];return _0x3821d0;};'use strict';var _=require(_0x8ba2('0x0'));var util=require(_0x8ba2('0x1'));var utils=require(_0x8ba2('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4be17c,_0x2e587f){utils['info'](util[_0x8ba2('0x3')](_0x8ba2('0x4'),_0x4be17c[_0x8ba2('0x5')],_0x4be17c[_0x8ba2('0x6')],_0x4be17c[_0x8ba2('0x7')],_0x4be17c[_0x8ba2('0x8')],_0x4be17c['interface'],_0x4be17c[_0x8ba2('0x9')],_0x4be17c[_0x8ba2('0xa')],_0x4be17c[_0x8ba2('0xb')]));if(_0x4be17c['queue']){utils[_0x8ba2('0xc')](_0x4be17c[_0x8ba2('0x7')])['then'](function(_0x2f37a2){if(_0x2f37a2){_0x4be17c[_0x8ba2('0xd')]=_0x2f37a2[_0x8ba2('0xd')];_0x4be17c[_0x8ba2('0xe')]=_0x4be17c[_0x8ba2('0xf')]?_0x2f37a2[_0x8ba2('0x10')]:![];_0x4be17c[_0x8ba2('0x11')]=_0x4be17c['agentacw']?_0x2f37a2[_0x8ba2('0x12')]:0x0;}utils['request'](_0x8ba2('0x13'),_0x4be17c);});}else{utils[_0x8ba2('0x14')](_0x8ba2('0x13'),_0x4be17c);}if(_0x2e587f){delete transfers[_0x4be17c['uniqueid']];}else{delete agents[_0x4be17c[_0x8ba2('0x15')]];}}exports[_0x8ba2('0x16')]=function(_0x171580){try{agents[_0x171580[_0x8ba2('0x15')]]=_0x171580;agents[_0x171580['destuniqueid']][_0x8ba2('0x17')]=utils[_0x8ba2('0x18')]();agents[_0x171580[_0x8ba2('0x15')]][_0x8ba2('0xb')]=_0x8ba2('0x19');agents[_0x171580['destuniqueid']][_0x8ba2('0xa')]=null;agents[_0x171580[_0x8ba2('0x15')]][_0x8ba2('0x1a')]=null;}catch(_0x2a611e){utils[_0x8ba2('0x1b')](_0x2a611e[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0x1d')]=function(_0x5c4f63){try{if(!_[_0x8ba2('0x1e')](agents[_0x5c4f63[_0x8ba2('0x15')]])){agents[_0x5c4f63['destuniqueid']]['agentringnoanswer']=!![];agents[_0x5c4f63['destuniqueid']][_0x8ba2('0x1f')]=utils[_0x8ba2('0x18')]();agents[_0x5c4f63[_0x8ba2('0x15')]][_0x8ba2('0xb')]=_0x8ba2('0x20');agents[_0x5c4f63['destuniqueid']][_0x8ba2('0x21')]=_0x8ba2('0x20');agents[_0x5c4f63[_0x8ba2('0x15')]]['holdtime']=_0x5c4f63['ringtime']?parseInt(_0x5c4f63[_0x8ba2('0x22')])/0x3e8:0x0;agents[_0x5c4f63[_0x8ba2('0x15')]][_0x8ba2('0x23')]=0x0;unanswered['push'](_0x5c4f63['destuniqueid']);}}catch(_0x53f6bc){utils[_0x8ba2('0x1b')](_0x53f6bc[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0x24')]=function(_0x264550){try{_[_0x8ba2('0x25')](agents,function(_0x16a76a,_0x20af23){if(_0x16a76a[_0x8ba2('0x5')]==_0x264550['uniqueid']&&!_[_0x8ba2('0x26')](unanswered,_0x16a76a[_0x8ba2('0x15')])){_0x16a76a['agentringnoanswer']=!![];_0x16a76a[_0x8ba2('0x1f')]=utils[_0x8ba2('0x18')]();_0x16a76a[_0x8ba2('0xb')]=_0x8ba2('0x27');_0x16a76a['reason']='abandoned';_0x16a76a[_0x8ba2('0x28')]=_0x264550[_0x8ba2('0x28')];_0x16a76a[_0x8ba2('0x23')]=0x0;writeDB(_0x16a76a);}});}catch(_0x355f04){utils['error'](_0x355f04[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0x29')]=function(_0x429e8b){try{if(agents[_0x429e8b[_0x8ba2('0x15')]]){agents[_0x429e8b[_0x8ba2('0x15')]][_0x8ba2('0x2a')]=utils[_0x8ba2('0x18')]();agents[_0x429e8b[_0x8ba2('0x15')]][_0x8ba2('0xa')]=_0x429e8b[_0x8ba2('0xa')];agents[_0x429e8b[_0x8ba2('0x15')]]['connectedlinename']=_0x429e8b[_0x8ba2('0x1a')];agents[_0x429e8b[_0x8ba2('0x15')]]['holdtime']=_0x429e8b['ringtime'];agents[_0x429e8b[_0x8ba2('0x15')]][_0x8ba2('0xb')]=_0x8ba2('0x2b');_[_0x8ba2('0x25')](agents,function(_0x372502,_0x781883){if(_0x372502['destuniqueid']!=_0x429e8b[_0x8ba2('0x15')]&&_0x372502['uniqueid']==_0x429e8b['uniqueid']){_0x372502[_0x8ba2('0x23')]=0x0;_0x372502['holdtime']=_0x429e8b['ringtime'];_0x372502[_0x8ba2('0x1d')]=!![];_0x372502[_0x8ba2('0x1f')]=utils[_0x8ba2('0x18')]();_0x372502[_0x8ba2('0xb')]=_0x8ba2('0x2c');_0x372502[_0x8ba2('0x21')]=_0x8ba2('0x2c');_0x372502['answeredelsewheredestinationuniqueid']=_0x429e8b['destuniqueid'];_0x372502[_0x8ba2('0x2d')]=_0x429e8b[_0x8ba2('0x8')];writeDB(_0x372502);}});}}catch(_0x185f60){utils[_0x8ba2('0x1b')](_0x185f60[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0xf')]=function(_0x4b9a32){try{if(!_[_0x8ba2('0x1e')](agents[_0x4b9a32['destuniqueid']])){agents[_0x4b9a32['destuniqueid']]['agentcomplete']=!![];agents[_0x4b9a32['destuniqueid']][_0x8ba2('0x2e')]=utils[_0x8ba2('0x18')]();agents[_0x4b9a32['destuniqueid']][_0x8ba2('0x23')]=utils[_0x8ba2('0x2f')](agents[_0x4b9a32[_0x8ba2('0x15')]][_0x8ba2('0x2e')],agents[_0x4b9a32[_0x8ba2('0x15')]][_0x8ba2('0x2a')]);agents[_0x4b9a32[_0x8ba2('0x15')]][_0x8ba2('0x21')]=_0x4b9a32[_0x8ba2('0x21')];agents[_0x4b9a32[_0x8ba2('0x15')]][_0x8ba2('0xb')]='complete';writeDB(agents[_0x4b9a32[_0x8ba2('0x15')]]);}}catch(_0x1b1508){utils['error'](_0x1b1508[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0x30')]=function(_0x471143){try{if(!_[_0x8ba2('0x1e')](agents[_0x471143[_0x8ba2('0x31')]])){agents[_0x471143[_0x8ba2('0x31')]]['transfer']=!![];agents[_0x471143[_0x8ba2('0x31')]][_0x8ba2('0x32')]=_0x8ba2('0x33');agents[_0x471143[_0x8ba2('0x31')]][_0x8ba2('0x34')]=_0x471143[_0x8ba2('0x35')];agents[_0x471143[_0x8ba2('0x31')]][_0x8ba2('0x36')]=agents[_0x471143[_0x8ba2('0x31')]][_0x8ba2('0x5')];}}catch(_0x2b1b80){utils[_0x8ba2('0x1b')](_0x2b1b80[_0x8ba2('0x1c')]);}};exports[_0x8ba2('0x37')]=function(_0x596153){try{if(_0x596153[_0x8ba2('0x38')]==_0x596153[_0x8ba2('0x39')]){if(!_['isNil'](agents[_0x596153[_0x8ba2('0x3a')]])){agents[_0x596153[_0x8ba2('0x3a')]][_0x8ba2('0x3b')]=!![];agents[_0x596153[_0x8ba2('0x3a')]][_0x8ba2('0x32')]=_0x8ba2('0x3c');agents[_0x596153['secondtransfereruniqueid']][_0x8ba2('0x34')]=_0x596153[_0x8ba2('0x3d')];agents[_0x596153[_0x8ba2('0x3a')]][_0x8ba2('0x36')]=_0x596153[_0x8ba2('0x38')];}if(_0x596153[_0x8ba2('0x3e')]&&agents[_0x596153[_0x8ba2('0x3e')]]){agents[_0x596153[_0x8ba2('0x3e')]][_0x8ba2('0x3f')]=0x1;transfers[_0x596153[_0x8ba2('0x3e')]]=_[_0x8ba2('0x40')](agents[_0x596153[_0x8ba2('0x3e')]]);transfers[_0x596153[_0x8ba2('0x3e')]][_0x8ba2('0x9')]=agents[_0x596153[_0x8ba2('0x3a')]][_0x8ba2('0x9')];transfers[_0x596153[_0x8ba2('0x3e')]]['calleridname']=agents[_0x596153[_0x8ba2('0x3a')]][_0x8ba2('0x41')];transfers[_0x596153['transfereeuniqueid']]['agentcalledAt']=utils[_0x8ba2('0x18')]();transfers[_0x596153[_0x8ba2('0x3e')]][_0x8ba2('0x2a')]=utils['now']();transfers[_0x596153[_0x8ba2('0x3e')]]['holdtime']=0x0;transfers[_0x596153[_0x8ba2('0x3e')]]['agententerreason']=0x2;}}else if(_0x596153[_0x8ba2('0x3a')]==_0x596153['secondtransfererlinkedid']){if(!_[_0x8ba2('0x1e')](agents[_0x596153[_0x8ba2('0x38')]])){agents[_0x596153['origtransfereruniqueid']]['transfer']=!![];agents[_0x596153[_0x8ba2('0x38')]][_0x8ba2('0x32')]=_0x8ba2('0x3c');agents[_0x596153[_0x8ba2('0x38')]][_0x8ba2('0x34')]=_0x596153['secondtransfererexten'];agents[_0x596153[_0x8ba2('0x38')]][_0x8ba2('0x36')]=_0x596153[_0x8ba2('0x3a')];}if(_0x596153[_0x8ba2('0x42')]&&agents[_0x596153[_0x8ba2('0x42')]]){agents[_0x596153[_0x8ba2('0x42')]]['agententerreason']=0x1;transfers[_0x596153[_0x8ba2('0x42')]]=_['clone'](agents[_0x596153[_0x8ba2('0x42')]]);transfers[_0x596153[_0x8ba2('0x42')]][_0x8ba2('0x9')]=agents[_0x596153[_0x8ba2('0x38')]]['calleridnum'];transfers[_0x596153[_0x8ba2('0x42')]][_0x8ba2('0x41')]=agents[_0x596153[_0x8ba2('0x38')]][_0x8ba2('0x41')];transfers[_0x596153[_0x8ba2('0x42')]]['agentcalledAt']=utils[_0x8ba2('0x18')]();transfers[_0x596153[_0x8ba2('0x42')]][_0x8ba2('0x2a')]=utils[_0x8ba2('0x18')]();transfers[_0x596153[_0x8ba2('0x42')]][_0x8ba2('0x28')]=0x0;transfers[_0x596153[_0x8ba2('0x42')]][_0x8ba2('0x3f')]=0x2;}}}catch(_0x484300){utils[_0x8ba2('0x1b')](_0x484300['stack']);}};exports['hangup']=function(_0x5c7c10){try{if(agents[_0x5c7c10['uniqueid']]&&agents[_0x5c7c10[_0x8ba2('0x5')]]['reason']===_0x8ba2('0x20')){if(_0x5c7c10['cause']==='21'){agents[_0x5c7c10['uniqueid']][_0x8ba2('0x21')]=_0x8ba2('0x43');agents[_0x5c7c10[_0x8ba2('0x5')]]['lastevent']='rejected';}writeDB(agents[_0x5c7c10['uniqueid']]);var _0x3f4a30=unanswered[_0x8ba2('0x44')](_0x5c7c10[_0x8ba2('0x5')]);if(_0x3f4a30>-0x1)unanswered['splice'](_0x3f4a30,0x1);}if(transfers[_0x5c7c10[_0x8ba2('0x5')]]){transfers[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0xf')]=!![];transfers[_0x5c7c10[_0x8ba2('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x23')]=utils[_0x8ba2('0x2f')](transfers[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x2e')],transfers[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x2a')]);transfers[_0x5c7c10['uniqueid']][_0x8ba2('0x21')]=_0x8ba2('0x45');transfers[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0xb')]='complete';writeDB(transfers[_0x5c7c10[_0x8ba2('0x5')]],!![]);}if(agents[_0x5c7c10[_0x8ba2('0x5')]]&&agents[_0x5c7c10[_0x8ba2('0x5')]]['agentconnectAt']){agents[_0x5c7c10['uniqueid']][_0x8ba2('0xf')]=!![];agents[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x2e')]=utils[_0x8ba2('0x18')]();agents[_0x5c7c10[_0x8ba2('0x5')]]['talktime']=utils[_0x8ba2('0x2f')](agents[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x2e')],agents[_0x5c7c10['uniqueid']][_0x8ba2('0x2a')]);agents[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0x21')]=agents[_0x5c7c10['uniqueid']][_0x8ba2('0x3b')]?_0x8ba2('0x3b'):_0x8ba2('0x45');agents[_0x5c7c10[_0x8ba2('0x5')]][_0x8ba2('0xb')]=_0x8ba2('0x46');writeDB(agents[_0x5c7c10[_0x8ba2('0x5')]]);}}catch(_0xf89abe){utils[_0x8ba2('0x1b')](_0xf89abe['stack']);}}; \ No newline at end of file +var _0x49d9=['queue','getVoiceQueueByName','type','agentacw','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','stack','queuecallerabandon','abandoned','agentconnect','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentconnectAt','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','cause','rejected','splice','agent','complete','agentcompleteAt','diffTime','util','./utils','format','uniqueid','channel','membername','connectedlinenum','lastevent'];(function(_0x2f6054,_0x2be213){var _0x333803=function(_0x151fa1){while(--_0x151fa1){_0x2f6054['push'](_0x2f6054['shift']());}};_0x333803(++_0x2be213);}(_0x49d9,0x10c));var _0x949d=function(_0x1a2dac,_0x25dad6){_0x1a2dac=_0x1a2dac-0x0;var _0x289351=_0x49d9[_0x1a2dac];return _0x289351;};'use strict';var _=require('lodash');var util=require(_0x949d('0x0'));var utils=require(_0x949d('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x409ebf,_0xbc1f79){utils['info'](util[_0x949d('0x2')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x409ebf[_0x949d('0x3')],_0x409ebf[_0x949d('0x4')],_0x409ebf['queue'],_0x409ebf[_0x949d('0x5')],_0x409ebf['interface'],_0x409ebf['calleridnum'],_0x409ebf[_0x949d('0x6')],_0x409ebf[_0x949d('0x7')]));if(_0x409ebf[_0x949d('0x8')]){utils[_0x949d('0x9')](_0x409ebf['queue'])['then'](function(_0x3f6d08){if(_0x3f6d08){_0x409ebf[_0x949d('0xa')]=_0x3f6d08[_0x949d('0xa')];_0x409ebf[_0x949d('0xb')]=_0x409ebf['agentcomplete']?_0x3f6d08[_0x949d('0xc')]:![];_0x409ebf[_0x949d('0xd')]=_0x409ebf['agentacw']?_0x3f6d08['acwTimeout']:0x0;}utils['request'](_0x949d('0xe'),_0x409ebf);});}else{utils[_0x949d('0xf')](_0x949d('0xe'),_0x409ebf);}if(_0xbc1f79){delete transfers[_0x409ebf[_0x949d('0x3')]];}else{delete agents[_0x409ebf[_0x949d('0x10')]];}}exports[_0x949d('0x11')]=function(_0x59b494){try{agents[_0x59b494[_0x949d('0x10')]]=_0x59b494;agents[_0x59b494['destuniqueid']][_0x949d('0x12')]=utils[_0x949d('0x13')]();agents[_0x59b494[_0x949d('0x10')]][_0x949d('0x7')]=_0x949d('0x14');agents[_0x59b494['destuniqueid']][_0x949d('0x6')]=null;agents[_0x59b494['destuniqueid']][_0x949d('0x15')]=null;}catch(_0x459a87){utils[_0x949d('0x16')](_0x459a87['stack']);}};exports[_0x949d('0x17')]=function(_0x541ecc){try{if(!_[_0x949d('0x18')](agents[_0x541ecc[_0x949d('0x10')]])){agents[_0x541ecc[_0x949d('0x10')]]['agentringnoanswer']=!![];agents[_0x541ecc[_0x949d('0x10')]][_0x949d('0x19')]=utils[_0x949d('0x13')]();agents[_0x541ecc[_0x949d('0x10')]][_0x949d('0x7')]=_0x949d('0x1a');agents[_0x541ecc['destuniqueid']][_0x949d('0x1b')]=_0x949d('0x1a');agents[_0x541ecc['destuniqueid']][_0x949d('0x1c')]=_0x541ecc[_0x949d('0x1d')]?parseInt(_0x541ecc[_0x949d('0x1d')])/0x3e8:0x0;agents[_0x541ecc[_0x949d('0x10')]][_0x949d('0x1e')]=0x0;unanswered[_0x949d('0x1f')](_0x541ecc[_0x949d('0x10')]);}}catch(_0x971aa9){utils[_0x949d('0x16')](_0x971aa9[_0x949d('0x20')]);}};exports[_0x949d('0x21')]=function(_0x5d50c6){try{_['forIn'](agents,function(_0x108e28,_0x28a700){if(_0x108e28[_0x949d('0x3')]==_0x5d50c6[_0x949d('0x3')]&&!_['includes'](unanswered,_0x108e28[_0x949d('0x10')])){_0x108e28[_0x949d('0x17')]=!![];_0x108e28[_0x949d('0x19')]=utils[_0x949d('0x13')]();_0x108e28[_0x949d('0x7')]=_0x949d('0x22');_0x108e28[_0x949d('0x1b')]=_0x949d('0x22');_0x108e28[_0x949d('0x1c')]=_0x5d50c6[_0x949d('0x1c')];_0x108e28[_0x949d('0x1e')]=0x0;writeDB(_0x108e28);}});}catch(_0x159f02){utils[_0x949d('0x16')](_0x159f02[_0x949d('0x20')]);}};exports[_0x949d('0x23')]=function(_0x517688){try{if(agents[_0x517688['destuniqueid']]){agents[_0x517688[_0x949d('0x10')]]['agentconnectAt']=utils['now']();agents[_0x517688['destuniqueid']][_0x949d('0x6')]=_0x517688[_0x949d('0x6')];agents[_0x517688[_0x949d('0x10')]][_0x949d('0x15')]=_0x517688[_0x949d('0x15')];agents[_0x517688[_0x949d('0x10')]]['holdtime']=_0x517688['ringtime'];agents[_0x517688[_0x949d('0x10')]]['lastevent']=_0x949d('0x24');_[_0x949d('0x25')](agents,function(_0x3424cb,_0x2610b0){if(_0x3424cb[_0x949d('0x10')]!=_0x517688[_0x949d('0x10')]&&_0x3424cb[_0x949d('0x3')]==_0x517688['uniqueid']){_0x3424cb['talktime']=0x0;_0x3424cb[_0x949d('0x1c')]=_0x517688[_0x949d('0x1d')];_0x3424cb['agentringnoanswer']=!![];_0x3424cb[_0x949d('0x19')]=utils[_0x949d('0x13')]();_0x3424cb[_0x949d('0x7')]='answered_elsewhere';_0x3424cb[_0x949d('0x1b')]=_0x949d('0x26');_0x3424cb[_0x949d('0x27')]=_0x517688[_0x949d('0x10')];_0x3424cb[_0x949d('0x28')]=_0x517688[_0x949d('0x5')];writeDB(_0x3424cb);}});}}catch(_0x4a97d5){utils[_0x949d('0x16')](_0x4a97d5[_0x949d('0x20')]);}};exports[_0x949d('0x29')]=function(_0x4f8016){try{if(!_[_0x949d('0x18')](agents[_0x4f8016[_0x949d('0x10')]])){agents[_0x4f8016[_0x949d('0x10')]][_0x949d('0x29')]=!![];agents[_0x4f8016[_0x949d('0x10')]]['agentcompleteAt']=utils[_0x949d('0x13')]();agents[_0x4f8016[_0x949d('0x10')]][_0x949d('0x1e')]=utils['diffTime'](agents[_0x4f8016[_0x949d('0x10')]]['agentcompleteAt'],agents[_0x4f8016[_0x949d('0x10')]][_0x949d('0x2a')]);agents[_0x4f8016['destuniqueid']][_0x949d('0x1b')]=_0x4f8016[_0x949d('0x1b')];agents[_0x4f8016[_0x949d('0x10')]][_0x949d('0x7')]='complete';writeDB(agents[_0x4f8016[_0x949d('0x10')]]);}}catch(_0x4768c3){utils[_0x949d('0x16')](_0x4768c3[_0x949d('0x20')]);}};exports[_0x949d('0x2b')]=function(_0x5e17c4){try{if(!_[_0x949d('0x18')](agents[_0x5e17c4[_0x949d('0x2c')]])){agents[_0x5e17c4[_0x949d('0x2c')]][_0x949d('0x2d')]=!![];agents[_0x5e17c4[_0x949d('0x2c')]][_0x949d('0x2e')]=_0x949d('0x2f');agents[_0x5e17c4[_0x949d('0x2c')]][_0x949d('0x30')]=_0x5e17c4['extension'];agents[_0x5e17c4[_0x949d('0x2c')]][_0x949d('0x31')]=agents[_0x5e17c4['transfereruniqueid']][_0x949d('0x3')];}}catch(_0x49db0f){utils[_0x949d('0x16')](_0x49db0f[_0x949d('0x20')]);}};exports['attendedtransfer']=function(_0x3f25a7){try{if(_0x3f25a7[_0x949d('0x32')]==_0x3f25a7[_0x949d('0x33')]){if(!_[_0x949d('0x18')](agents[_0x3f25a7[_0x949d('0x34')]])){agents[_0x3f25a7[_0x949d('0x34')]]['transfer']=!![];agents[_0x3f25a7['secondtransfereruniqueid']][_0x949d('0x2e')]='ATTENDED';agents[_0x3f25a7[_0x949d('0x34')]][_0x949d('0x30')]=_0x3f25a7['origtransfererexten'];agents[_0x3f25a7['secondtransfereruniqueid']][_0x949d('0x31')]=_0x3f25a7[_0x949d('0x32')];}if(_0x3f25a7[_0x949d('0x35')]&&agents[_0x3f25a7['transfereeuniqueid']]){agents[_0x3f25a7[_0x949d('0x35')]][_0x949d('0x36')]=0x1;transfers[_0x3f25a7[_0x949d('0x35')]]=_[_0x949d('0x37')](agents[_0x3f25a7[_0x949d('0x35')]]);transfers[_0x3f25a7[_0x949d('0x35')]][_0x949d('0x38')]=agents[_0x3f25a7['secondtransfereruniqueid']][_0x949d('0x38')];transfers[_0x3f25a7[_0x949d('0x35')]]['calleridname']=agents[_0x3f25a7[_0x949d('0x34')]][_0x949d('0x39')];transfers[_0x3f25a7[_0x949d('0x35')]][_0x949d('0x12')]=utils['now']();transfers[_0x3f25a7['transfereeuniqueid']]['agentconnectAt']=utils[_0x949d('0x13')]();transfers[_0x3f25a7[_0x949d('0x35')]][_0x949d('0x1c')]=0x0;transfers[_0x3f25a7[_0x949d('0x35')]][_0x949d('0x36')]=0x2;}}else if(_0x3f25a7[_0x949d('0x34')]==_0x3f25a7[_0x949d('0x3a')]){if(!_['isNil'](agents[_0x3f25a7[_0x949d('0x32')]])){agents[_0x3f25a7['origtransfereruniqueid']][_0x949d('0x2d')]=!![];agents[_0x3f25a7[_0x949d('0x32')]][_0x949d('0x2e')]=_0x949d('0x3b');agents[_0x3f25a7[_0x949d('0x32')]][_0x949d('0x30')]=_0x3f25a7[_0x949d('0x3c')];agents[_0x3f25a7[_0x949d('0x32')]]['transferuniqueid']=_0x3f25a7[_0x949d('0x34')];}if(_0x3f25a7[_0x949d('0x3d')]&&agents[_0x3f25a7[_0x949d('0x3d')]]){agents[_0x3f25a7[_0x949d('0x3d')]][_0x949d('0x36')]=0x1;transfers[_0x3f25a7[_0x949d('0x3d')]]=_['clone'](agents[_0x3f25a7['transfertargetuniqueid']]);transfers[_0x3f25a7['transfertargetuniqueid']][_0x949d('0x38')]=agents[_0x3f25a7[_0x949d('0x32')]][_0x949d('0x38')];transfers[_0x3f25a7[_0x949d('0x3d')]][_0x949d('0x39')]=agents[_0x3f25a7[_0x949d('0x32')]][_0x949d('0x39')];transfers[_0x3f25a7[_0x949d('0x3d')]][_0x949d('0x12')]=utils['now']();transfers[_0x3f25a7[_0x949d('0x3d')]][_0x949d('0x2a')]=utils['now']();transfers[_0x3f25a7['transfertargetuniqueid']][_0x949d('0x1c')]=0x0;transfers[_0x3f25a7['transfertargetuniqueid']][_0x949d('0x36')]=0x2;}}}catch(_0x2b4e4d){utils[_0x949d('0x16')](_0x2b4e4d[_0x949d('0x20')]);}};exports['hangup']=function(_0x290439){try{if(agents[_0x290439['uniqueid']]&&agents[_0x290439[_0x949d('0x3')]]['reason']===_0x949d('0x1a')){if(_0x290439[_0x949d('0x3e')]==='21'){agents[_0x290439[_0x949d('0x3')]]['reason']=_0x949d('0x3f');agents[_0x290439['uniqueid']]['lastevent']=_0x949d('0x3f');}writeDB(agents[_0x290439[_0x949d('0x3')]]);var _0x59cadb=unanswered['indexOf'](_0x290439[_0x949d('0x3')]);if(_0x59cadb>-0x1)unanswered[_0x949d('0x40')](_0x59cadb,0x1);}if(transfers[_0x290439[_0x949d('0x3')]]){transfers[_0x290439[_0x949d('0x3')]][_0x949d('0x29')]=!![];transfers[_0x290439[_0x949d('0x3')]]['agentcompleteAt']=utils['now']();transfers[_0x290439[_0x949d('0x3')]][_0x949d('0x1e')]=utils['diffTime'](transfers[_0x290439[_0x949d('0x3')]]['agentcompleteAt'],transfers[_0x290439['uniqueid']][_0x949d('0x2a')]);transfers[_0x290439[_0x949d('0x3')]][_0x949d('0x1b')]=_0x949d('0x41');transfers[_0x290439[_0x949d('0x3')]][_0x949d('0x7')]=_0x949d('0x42');writeDB(transfers[_0x290439[_0x949d('0x3')]],!![]);}if(agents[_0x290439[_0x949d('0x3')]]&&agents[_0x290439[_0x949d('0x3')]][_0x949d('0x2a')]){agents[_0x290439[_0x949d('0x3')]]['agentcomplete']=!![];agents[_0x290439['uniqueid']][_0x949d('0x43')]=utils[_0x949d('0x13')]();agents[_0x290439[_0x949d('0x3')]][_0x949d('0x1e')]=utils[_0x949d('0x44')](agents[_0x290439[_0x949d('0x3')]][_0x949d('0x43')],agents[_0x290439['uniqueid']][_0x949d('0x2a')]);agents[_0x290439[_0x949d('0x3')]][_0x949d('0x1b')]=agents[_0x290439[_0x949d('0x3')]][_0x949d('0x2d')]?_0x949d('0x2d'):_0x949d('0x41');agents[_0x290439['uniqueid']][_0x949d('0x7')]=_0x949d('0x42');writeDB(agents[_0x290439['uniqueid']]);}}catch(_0x306196){utils[_0x949d('0x16')](_0x306196['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 84ef4bc..bdd32bf 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 _0xe754=['billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','destination','\x22\x20<','xmd-callerid','xmcs-queue','lastapplication','Queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','application','set','startsWith','appdata','toLowerCase','cdr','substring','lastIndexOf','includes','noop','lastdata','lodash','util','NO\x20ANSWER','FAILED','BUSY','format','uniqueid','channel','type','accountcode','source','UserId','request','CreateVoiceCallReport','newchannel','calleridnum','exten','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','linkedid','channelstate','context','answertime','toNumber','hangup','callerid','calleridname','duration','diffTime','endtime','starttime'];(function(_0x37edaf,_0x399cda){var _0x21c4ae=function(_0x377a19){while(--_0x377a19){_0x37edaf['push'](_0x37edaf['shift']());}};_0x21c4ae(++_0x399cda);}(_0xe754,0x1f0));var _0x4e75=function(_0x39ebfb,_0x3e95ef){_0x39ebfb=_0x39ebfb-0x0;var _0x20f247=_0xe754[_0x39ebfb];return _0x20f247;};'use strict';var _=require(_0x4e75('0x0'));var util=require(_0x4e75('0x1'));var utils=require('./utils');var dispositions=[_0x4e75('0x2'),_0x4e75('0x3'),'FAILED','NO\x20ANSWER',_0x4e75('0x2'),_0x4e75('0x2'),'ANSWERED',_0x4e75('0x4'),'FAILED',_0x4e75('0x3'),'FAILED'];var channels={};function writeDB(_0x410d49){utils['info'](util[_0x4e75('0x5')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x410d49[_0x4e75('0x6')],_0x410d49[_0x4e75('0x7')],_0x410d49[_0x4e75('0x8')],_0x410d49[_0x4e75('0x9')],_0x410d49[_0x4e75('0xa')],_0x410d49['destination'],_0x410d49['callerid'],_0x410d49['disposition']));if(_0x410d49[_0x4e75('0x9')]){utils['getUserByInternal'](_0x410d49[_0x4e75('0x9')])['then'](function(_0x410f0c){if(_0x410f0c){_0x410d49[_0x4e75('0xb')]=_0x410f0c['id'];}utils[_0x4e75('0xc')]('CreateVoiceCallReport',_0x410d49);});}else{utils[_0x4e75('0xc')](_0x4e75('0xd'),_0x410d49);}if(channels[_0x410d49[_0x4e75('0x6')]]){delete channels[_0x410d49[_0x4e75('0x6')]];}}exports[_0x4e75('0xe')]=function(_0x5142ad){try{if(_0x5142ad[_0x4e75('0x6')]==_0x5142ad['linkedid']&&_0x5142ad[_0x4e75('0x7')]!='OutgoingSpoolFailed'){channels[_0x5142ad['uniqueid']]={'uniqueid':_0x5142ad['uniqueid'],'accountcode':_0x5142ad['accountcode'],'source':_0x5142ad[_0x4e75('0xf')],'destination':_0x5142ad[_0x4e75('0x10')],'destinationcontext':_0x5142ad['context'],'channel':_0x5142ad[_0x4e75('0x7')],'starttime':utils[_0x4e75('0x11')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x4e75('0x12')};}}catch(_0x1fd072){utils[_0x4e75('0x13')](_0x1fd072[_0x4e75('0x14')]);}};exports[_0x4e75('0x15')]=function(_0x2e21a3){try{if(!_['isNil'](channels[_0x2e21a3[_0x4e75('0x6')]])&&_0x2e21a3['channelstate']==0x6){if(_[_0x4e75('0x16')](channels[_0x2e21a3['uniqueid']]['systemanswertime'])){channels[_0x2e21a3[_0x4e75('0x6')]][_0x4e75('0x17')]=utils[_0x4e75('0x11')]();}}else if(!_['isNil'](channels[_0x2e21a3[_0x4e75('0x18')]])&&_0x2e21a3[_0x4e75('0x19')]==0x6&&_0x2e21a3[_0x4e75('0x1a')]!='transfer'){channels[_0x2e21a3['linkedid']]['accountcode']=_0x2e21a3[_0x4e75('0x9')];channels[_0x2e21a3[_0x4e75('0x18')]]['destinationchannel']=_0x2e21a3[_0x4e75('0x7')];if(_['isNil'](channels[_0x2e21a3[_0x4e75('0x18')]]['answertime'])){channels[_0x2e21a3[_0x4e75('0x18')]][_0x4e75('0x1b')]=utils[_0x4e75('0x11')]();}channels[_0x2e21a3[_0x4e75('0x18')]]['disposition']=dispositions[_[_0x4e75('0x1c')](_0x2e21a3['channelstate'])]||'ANSWERED';}}catch(_0x423d37){utils[_0x4e75('0x13')](_0x423d37[_0x4e75('0x14')]);}};exports[_0x4e75('0x1d')]=function(_0x3f602d){try{if(!_['isNil'](channels[_0x3f602d['uniqueid']])){if(_['isNil'](channels[_0x3f602d['uniqueid']][_0x4e75('0x1e')])){channels[_0x3f602d[_0x4e75('0x6')]][_0x4e75('0x1e')]=_0x3f602d[_0x4e75('0x1f')]+'\x20<'+_0x3f602d[_0x4e75('0xf')]+'>';}channels[_0x3f602d[_0x4e75('0x6')]]['endtime']=utils['now']();channels[_0x3f602d['uniqueid']][_0x4e75('0x20')]=utils[_0x4e75('0x21')](channels[_0x3f602d['uniqueid']][_0x4e75('0x22')],channels[_0x3f602d[_0x4e75('0x6')]][_0x4e75('0x23')]);channels[_0x3f602d[_0x4e75('0x6')]][_0x4e75('0x24')]=channels[_0x3f602d['uniqueid']][_0x4e75('0x1b')]?utils['diffTime'](channels[_0x3f602d[_0x4e75('0x6')]][_0x4e75('0x22')],channels[_0x3f602d[_0x4e75('0x6')]][_0x4e75('0x1b')]):0x0;writeDB(channels[_0x3f602d[_0x4e75('0x6')]]);}}catch(_0xbe175b){utils[_0x4e75('0x13')](_0xbe175b[_0x4e75('0x14')]);}};exports[_0x4e75('0x25')]=function(_0x27a9f5){try{if(!_[_0x4e75('0x16')](channels[_0x27a9f5[_0x4e75('0x26')]])){if(channels[_0x27a9f5[_0x4e75('0x26')]][_0x4e75('0x7')]==_0x27a9f5[_0x4e75('0x27')]){channels[_0x27a9f5[_0x4e75('0x26')]][_0x4e75('0x28')]=_0x27a9f5[_0x4e75('0x29')];channels[_0x27a9f5[_0x4e75('0x26')]][_0x4e75('0x2a')]=_0x4e75('0x2b');}else if(channels[_0x27a9f5[_0x4e75('0x26')]][_0x4e75('0x7')]=_0x27a9f5[_0x4e75('0x2c')]){channels[_0x27a9f5['localtwolinkedid']][_0x4e75('0x28')]=_0x27a9f5[_0x4e75('0x2d')];channels[_0x27a9f5['localtwolinkedid']][_0x4e75('0x2a')]=_0x4e75('0x2b');}}}catch(_0x2fd2de){utils[_0x4e75('0x13')](_0x2fd2de[_0x4e75('0x14')]);}};exports[_0x4e75('0x2e')]=function(_0x16f1f1){try{if(!_[_0x4e75('0x16')](channels[_0x16f1f1[_0x4e75('0x6')]])){channels[_0x16f1f1[_0x4e75('0x6')]][_0x4e75('0x2f')]=utils[_0x4e75('0x11')]();}}catch(_0x18e54f){utils['error'](_0x18e54f[_0x4e75('0x14')]);}};exports['musiconholdstop']=function(_0x187281){try{if(!_['isNil'](channels[_0x187281[_0x4e75('0x6')]])){if(!_[_0x4e75('0x16')](channels[_0x187281[_0x4e75('0x6')]][_0x4e75('0x2f')])){channels[_0x187281[_0x4e75('0x6')]][_0x4e75('0x30')]+=utils['diffTime'](utils[_0x4e75('0x11')](),channels[_0x187281[_0x4e75('0x6')]][_0x4e75('0x2f')]);delete channels[_0x187281[_0x4e75('0x6')]][_0x4e75('0x2f')];}}}catch(_0x42f15f){utils['error'](_0x42f15f[_0x4e75('0x14')]);}};exports[_0x4e75('0x31')]=function(_0x5e175b){try{if(!_[_0x4e75('0x16')](channels[_0x5e175b['uniqueid']])){if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x33')])){channels[_0x5e175b[_0x4e75('0x6')]]['source']=_0x5e175b[_0x4e75('0x34')];}if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x35')])){channels[_0x5e175b['uniqueid']][_0x4e75('0x36')]=_0x5e175b[_0x4e75('0x34')];channels[_0x5e175b['uniqueid']][_0x4e75('0x1e')]='\x22'+_0x5e175b[_0x4e75('0x34')]+_0x4e75('0x37')+_0x5e175b[_0x4e75('0x34')]+'>';}if(!_['isNil'](_0x5e175b[_0x4e75('0x32')]['xmd-callerid-preview'])||!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x38')])){channels[_0x5e175b[_0x4e75('0x6')]]['callerid']=_0x5e175b[_0x4e75('0x34')];}if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')]['xmd-queue'])||!_[_0x4e75('0x16')](_0x5e175b['variable'][_0x4e75('0x39')])){channels[_0x5e175b[_0x4e75('0x6')]][_0x4e75('0x3a')]=_0x4e75('0x3b');channels[_0x5e175b[_0x4e75('0x6')]]['lastdata']=_0x5e175b[_0x4e75('0x34')];channels[_0x5e175b[_0x4e75('0x6')]]['queue']=!![];}if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x3c')])){channels[_0x5e175b['uniqueid']][_0x4e75('0x3d')]=_0x5e175b[_0x4e75('0x34')];}if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x3e')])){channels[_0x5e175b[_0x4e75('0x6')]][_0x4e75('0x8')]=_0x5e175b[_0x4e75('0x34')];}if(!_[_0x4e75('0x16')](_0x5e175b['variable'][_0x4e75('0x3f')])){channels[_0x5e175b[_0x4e75('0x6')]]['routeid']=_0x5e175b['value'];}if(!_[_0x4e75('0x16')](_0x5e175b[_0x4e75('0x32')][_0x4e75('0x40')])){channels[_0x5e175b[_0x4e75('0x6')]][_0x4e75('0x40')]=_0x5e175b[_0x4e75('0x34')];}}}catch(_0x13383d){utils[_0x4e75('0x13')](_0x13383d[_0x4e75('0x14')]);}};exports['newexten']=function(_0x32a1fa){try{if(!_['isNil'](channels[_0x32a1fa['uniqueid']])){if(_0x32a1fa[_0x4e75('0x41')]['toLowerCase']()==_0x4e75('0x42')&&_[_0x4e75('0x43')](_0x32a1fa[_0x4e75('0x44')][_0x4e75('0x45')](),_0x4e75('0x46'))){var _0x36b074=_0x32a1fa[_0x4e75('0x44')]['split']('=');var _0x380ccf=_0x36b074[0x0][_0x4e75('0x47')](_0x36b074[0x0][_0x4e75('0x48')]('(')+0x1,_0x36b074[0x0][_0x4e75('0x48')](')'));var _0x597b0e=_0x36b074[0x1];channels[_0x32a1fa[_0x4e75('0x6')]][_0x380ccf]=_0x597b0e;}if(!_[_0x4e75('0x49')]([_0x4e75('0x1d'),_0x4e75('0x4a'),'execif',_0x4e75('0x42'),'gotoif'],_0x32a1fa['application'][_0x4e75('0x45')]())){channels[_0x32a1fa[_0x4e75('0x6')]]['lastapplication']=_0x32a1fa[_0x4e75('0x41')];channels[_0x32a1fa[_0x4e75('0x6')]][_0x4e75('0x4b')]=_0x32a1fa[_0x4e75('0x44')];}}}catch(_0xf8147e){utils[_0x4e75('0x13')](_0xf8147e[_0x4e75('0x14')]);}}; \ No newline at end of file +var _0x75c8=['musiconholdstartAt','mohtime','xmd-originatecalleridnum','source','value','xmd-phone','\x22\x20<','variable','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','error','stack','isNil','channelstate','transfer','destinationchannel','answertime','now','toNumber','ANSWERED','hangup','calleridname','endtime','duration','diffTime','starttime','localtwolinkedid','transfereechannel','userfield','_attended','transfertargetchannel'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x75c8,0x1b1));var _0x875c=function(_0x551393,_0x4ef62b){_0x551393=_0x551393-0x0;var _0x2c0e03=_0x75c8[_0x551393];return _0x2c0e03;};'use strict';var _=require(_0x875c('0x0'));var util=require(_0x875c('0x1'));var utils=require(_0x875c('0x2'));var dispositions=[_0x875c('0x3'),'FAILED',_0x875c('0x4'),_0x875c('0x3'),_0x875c('0x3'),_0x875c('0x3'),'ANSWERED',_0x875c('0x5'),_0x875c('0x4'),_0x875c('0x4'),_0x875c('0x4')];var channels={};function writeDB(_0xa996d3){utils['info'](util['format'](_0x875c('0x6'),_0xa996d3[_0x875c('0x7')],_0xa996d3[_0x875c('0x8')],_0xa996d3[_0x875c('0x9')],_0xa996d3[_0x875c('0xa')],_0xa996d3['source'],_0xa996d3[_0x875c('0xb')],_0xa996d3[_0x875c('0xc')],_0xa996d3[_0x875c('0xd')]));if(_0xa996d3[_0x875c('0xa')]){utils[_0x875c('0xe')](_0xa996d3[_0x875c('0xa')])[_0x875c('0xf')](function(_0x2be696){if(_0x2be696){_0xa996d3[_0x875c('0x10')]=_0x2be696['id'];}utils[_0x875c('0x11')](_0x875c('0x12'),_0xa996d3);});}else{utils[_0x875c('0x11')](_0x875c('0x12'),_0xa996d3);}if(channels[_0xa996d3[_0x875c('0x7')]]){delete channels[_0xa996d3[_0x875c('0x7')]];}}exports[_0x875c('0x13')]=function(_0x496045){try{if(_0x496045[_0x875c('0x7')]==_0x496045[_0x875c('0x14')]&&_0x496045[_0x875c('0x8')]!=_0x875c('0x15')){channels[_0x496045[_0x875c('0x7')]]={'uniqueid':_0x496045['uniqueid'],'accountcode':_0x496045[_0x875c('0xa')],'source':_0x496045[_0x875c('0x16')],'destination':_0x496045[_0x875c('0x17')],'destinationcontext':_0x496045[_0x875c('0x18')],'channel':_0x496045['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x875c('0x3'),'amaflags':_0x875c('0x19')};}}catch(_0x29ee55){utils[_0x875c('0x1a')](_0x29ee55[_0x875c('0x1b')]);}};exports['newstate']=function(_0xa0708b){try{if(!_[_0x875c('0x1c')](channels[_0xa0708b['uniqueid']])&&_0xa0708b['channelstate']==0x6){if(_[_0x875c('0x1c')](channels[_0xa0708b[_0x875c('0x7')]]['systemanswertime'])){channels[_0xa0708b[_0x875c('0x7')]]['systemanswertime']=utils['now']();}}else if(!_[_0x875c('0x1c')](channels[_0xa0708b[_0x875c('0x14')]])&&_0xa0708b[_0x875c('0x1d')]==0x6&&_0xa0708b['context']!=_0x875c('0x1e')){channels[_0xa0708b['linkedid']]['accountcode']=_0xa0708b[_0x875c('0xa')];channels[_0xa0708b[_0x875c('0x14')]][_0x875c('0x1f')]=_0xa0708b[_0x875c('0x8')];if(_[_0x875c('0x1c')](channels[_0xa0708b[_0x875c('0x14')]][_0x875c('0x20')])){channels[_0xa0708b[_0x875c('0x14')]][_0x875c('0x20')]=utils[_0x875c('0x21')]();}channels[_0xa0708b[_0x875c('0x14')]][_0x875c('0xd')]=dispositions[_[_0x875c('0x22')](_0xa0708b[_0x875c('0x1d')])]||_0x875c('0x23');}}catch(_0xa2767b){utils[_0x875c('0x1a')](_0xa2767b[_0x875c('0x1b')]);}};exports[_0x875c('0x24')]=function(_0x62807d){try{if(!_[_0x875c('0x1c')](channels[_0x62807d[_0x875c('0x7')]])){if(_[_0x875c('0x1c')](channels[_0x62807d[_0x875c('0x7')]][_0x875c('0xc')])){channels[_0x62807d['uniqueid']][_0x875c('0xc')]=_0x62807d[_0x875c('0x25')]+'\x20<'+_0x62807d[_0x875c('0x16')]+'>';}channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x26')]=utils[_0x875c('0x21')]();channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x27')]=utils[_0x875c('0x28')](channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x26')],channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x29')]);channels[_0x62807d[_0x875c('0x7')]]['billableseconds']=channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x20')]?utils[_0x875c('0x28')](channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x26')],channels[_0x62807d[_0x875c('0x7')]][_0x875c('0x20')]):0x0;writeDB(channels[_0x62807d['uniqueid']]);}}catch(_0x708a2e){utils[_0x875c('0x1a')](_0x708a2e['stack']);}};exports['attendedtransfer']=function(_0x1b8d15){try{if(!_['isNil'](channels[_0x1b8d15[_0x875c('0x2a')]])){if(channels[_0x1b8d15['localtwolinkedid']]['channel']==_0x1b8d15[_0x875c('0x2b')]){channels[_0x1b8d15[_0x875c('0x2a')]]['destinationchannel']=_0x1b8d15['secondtransfererchannel'];channels[_0x1b8d15[_0x875c('0x2a')]][_0x875c('0x2c')]=_0x875c('0x2d');}else if(channels[_0x1b8d15[_0x875c('0x2a')]][_0x875c('0x8')]=_0x1b8d15[_0x875c('0x2e')]){channels[_0x1b8d15[_0x875c('0x2a')]][_0x875c('0x1f')]=_0x1b8d15['origtransfererchannel'];channels[_0x1b8d15[_0x875c('0x2a')]][_0x875c('0x2c')]=_0x875c('0x2d');}}}catch(_0x1fcb13){utils[_0x875c('0x1a')](_0x1fcb13[_0x875c('0x1b')]);}};exports['musiconholdstart']=function(_0x50b15a){try{if(!_[_0x875c('0x1c')](channels[_0x50b15a['uniqueid']])){channels[_0x50b15a[_0x875c('0x7')]][_0x875c('0x2f')]=utils[_0x875c('0x21')]();}}catch(_0x2e7813){utils['error'](_0x2e7813[_0x875c('0x1b')]);}};exports['musiconholdstop']=function(_0x286b45){try{if(!_['isNil'](channels[_0x286b45['uniqueid']])){if(!_[_0x875c('0x1c')](channels[_0x286b45[_0x875c('0x7')]][_0x875c('0x2f')])){channels[_0x286b45[_0x875c('0x7')]][_0x875c('0x30')]+=utils[_0x875c('0x28')](utils[_0x875c('0x21')](),channels[_0x286b45[_0x875c('0x7')]][_0x875c('0x2f')]);delete channels[_0x286b45[_0x875c('0x7')]]['musiconholdstartAt'];}}}catch(_0x5c3da2){utils[_0x875c('0x1a')](_0x5c3da2[_0x875c('0x1b')]);}};exports['varset']=function(_0x5c3457){try{if(!_[_0x875c('0x1c')](channels[_0x5c3457[_0x875c('0x7')]])){if(!_[_0x875c('0x1c')](_0x5c3457['variable'][_0x875c('0x31')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x32')]=_0x5c3457[_0x875c('0x33')];}if(!_['isNil'](_0x5c3457['variable'][_0x875c('0x34')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0xb')]=_0x5c3457[_0x875c('0x33')];channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0xc')]='\x22'+_0x5c3457['value']+_0x875c('0x35')+_0x5c3457[_0x875c('0x33')]+'>';}if(!_['isNil'](_0x5c3457['variable']['xmd-callerid-preview'])||!_[_0x875c('0x1c')](_0x5c3457[_0x875c('0x36')][_0x875c('0x37')])){channels[_0x5c3457[_0x875c('0x7')]]['callerid']=_0x5c3457[_0x875c('0x33')];}if(!_['isNil'](_0x5c3457[_0x875c('0x36')][_0x875c('0x38')])||!_[_0x875c('0x1c')](_0x5c3457[_0x875c('0x36')][_0x875c('0x39')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x3a')]=_0x875c('0x3b');channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x3c')]=_0x5c3457[_0x875c('0x33')];channels[_0x5c3457[_0x875c('0x7')]]['queue']=!![];}if(!_[_0x875c('0x1c')](_0x5c3457[_0x875c('0x36')][_0x875c('0x3d')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x3e')]=_0x5c3457[_0x875c('0x33')];}if(!_[_0x875c('0x1c')](_0x5c3457['variable'][_0x875c('0x3f')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x9')]=_0x5c3457[_0x875c('0x33')];}if(!_[_0x875c('0x1c')](_0x5c3457[_0x875c('0x36')][_0x875c('0x40')])){channels[_0x5c3457[_0x875c('0x7')]][_0x875c('0x41')]=_0x5c3457[_0x875c('0x33')];}if(!_['isNil'](_0x5c3457[_0x875c('0x36')][_0x875c('0x42')])){channels[_0x5c3457[_0x875c('0x7')]]['sipcallid']=_0x5c3457['value'];}}}catch(_0x10806c){utils['error'](_0x10806c[_0x875c('0x1b')]);}};exports[_0x875c('0x43')]=function(_0xc6395d){try{if(!_[_0x875c('0x1c')](channels[_0xc6395d['uniqueid']])){if(_0xc6395d[_0x875c('0x44')][_0x875c('0x45')]()==_0x875c('0x46')&&_[_0x875c('0x47')](_0xc6395d[_0x875c('0x48')][_0x875c('0x45')](),_0x875c('0x49'))){var _0x2bfc04=_0xc6395d[_0x875c('0x48')][_0x875c('0x4a')]('=');var _0x201e85=_0x2bfc04[0x0][_0x875c('0x4b')](_0x2bfc04[0x0][_0x875c('0x4c')]('(')+0x1,_0x2bfc04[0x0][_0x875c('0x4c')](')'));var _0xe4609e=_0x2bfc04[0x1];channels[_0xc6395d[_0x875c('0x7')]][_0x201e85]=_0xe4609e;}if(!_['includes'](['hangup',_0x875c('0x4d'),_0x875c('0x4e'),'set',_0x875c('0x4f')],_0xc6395d[_0x875c('0x44')][_0x875c('0x45')]())){channels[_0xc6395d[_0x875c('0x7')]]['lastapplication']=_0xc6395d[_0x875c('0x44')];channels[_0xc6395d[_0x875c('0x7')]][_0x875c('0x3c')]=_0xc6395d[_0x875c('0x48')];}}}catch(_0x4245cd){utils['error'](_0x4245cd[_0x875c('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 7cfbba4..3743763 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 _0xc6ac=['lodash','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','CLOSE','managerevent','./utils'];(function(_0x35805a,_0x25f3f2){var _0x48b5c4=function(_0x4bb7da){while(--_0x4bb7da){_0x35805a['push'](_0x35805a['shift']());}};_0x48b5c4(++_0x25f3f2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x489efc,_0x1f1730){_0x489efc=_0x489efc-0x0;var _0x122a45=_0xc6ac[_0x489efc];return _0x122a45;};'use strict';var utils=require(_0xcc6a('0x0'));var _=require(_0xcc6a('0x1'));exports[_0xcc6a('0x2')]=function(){utils[_0xcc6a('0x3')](_0xcc6a('0x4'));};exports[_0xcc6a('0x5')]=function(){utils[_0xcc6a('0x3')](_0xcc6a('0x6'));};exports[_0xcc6a('0x7')]=function(){utils[_0xcc6a('0x3')](_0xcc6a('0x8'));};exports[_0xcc6a('0x9')]=function(_0x12330e){utils[_0xcc6a('0x9')](_0x12330e);};exports['close']=function(){utils[_0xcc6a('0x3')](_0xcc6a('0xa'));};exports[_0xcc6a('0xb')]=function(_0x560cc4){}; \ No newline at end of file +var _0x1261=['lodash','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent'];(function(_0xa9d458,_0x41d203){var _0x246c8c=function(_0x4c7fbb){while(--_0x4c7fbb){_0xa9d458['push'](_0xa9d458['shift']());}};_0x246c8c(++_0x41d203);}(_0x1261,0x144));var _0x1126=function(_0x3060e3,_0x14f2c6){_0x3060e3=_0x3060e3-0x0;var _0x497d2c=_0x1261[_0x3060e3];return _0x497d2c;};'use strict';var utils=require('./utils');var _=require(_0x1126('0x0'));exports[_0x1126('0x1')]=function(){utils[_0x1126('0x2')](_0x1126('0x3'));};exports[_0x1126('0x4')]=function(){utils[_0x1126('0x2')](_0x1126('0x5'));};exports[_0x1126('0x6')]=function(){utils[_0x1126('0x2')](_0x1126('0x7'));};exports['error']=function(_0x5c68c8){utils[_0x1126('0x8')](_0x5c68c8);};exports[_0x1126('0x9')]=function(){utils['info'](_0x1126('0xa'));};exports[_0x1126('0xb')]=function(_0x245be9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 855f7ef..1491ed8 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 _0xf116=['stack','ANSWER','answertime','hangup','endtime','holdtime','diffTime','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','isNil','value','dialbegin','assign','starttime','now','lastevent','called'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf116,0x16f));var _0x6f11=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0xf116[_0x834bb6];return _0xa35d00;};'use strict';var _=require('lodash');var util=require(_0x6f11('0x0'));var utils=require(_0x6f11('0x1'));var dials={};function writeDB(_0x2f9f5b){utils[_0x6f11('0x2')](util[_0x6f11('0x3')](_0x6f11('0x4'),_0x2f9f5b['uniqueid'],_0x2f9f5b[_0x6f11('0x5')],_0x2f9f5b[_0x6f11('0x6')],_0x2f9f5b[_0x6f11('0x7')],_0x2f9f5b[_0x6f11('0x8')],_0x2f9f5b[_0x6f11('0x9')]));utils[_0x6f11('0xa')](_0x6f11('0xb'),_0x2f9f5b);delete dials[_0x2f9f5b[_0x6f11('0xc')]];}exports[_0x6f11('0xd')]=function(_0x407bdd){try{if(_0x407bdd[_0x6f11('0xe')][_0x6f11('0xf')]()==_0x6f11('0x10')&&_[_0x6f11('0x11')](_0x407bdd[_0x6f11('0x12')][_0x6f11('0xf')](),_0x6f11('0x13'))){var _0xb245b1=_0x407bdd[_0x6f11('0x12')]['split']('=');dials[_0x407bdd[_0x6f11('0xc')]]={'routeId':_0xb245b1[0x1]};}}catch(_0xad6aa0){utils[_0x6f11('0x14')](_0xad6aa0['stack']);}};exports['varset']=function(_0x5dcf13){try{if(!_[_0x6f11('0x15')](_0x5dcf13['variable']['outboundrouteid'])){dials[_0x5dcf13['uniqueid']]={'routeId':_0x5dcf13[_0x6f11('0x16')]};}}catch(_0x226f6f){utils[_0x6f11('0x14')](_0x226f6f['stack']);}};exports[_0x6f11('0x17')]=function(_0x3f80f8){try{if(!_[_0x6f11('0x15')](dials[_0x3f80f8['uniqueid']])){dials[_0x3f80f8[_0x6f11('0xc')]]=_[_0x6f11('0x18')](dials[_0x3f80f8['uniqueid']],_0x3f80f8);dials[_0x3f80f8['uniqueid']][_0x6f11('0x19')]=utils[_0x6f11('0x1a')]();dials[_0x3f80f8[_0x6f11('0xc')]][_0x6f11('0x1b')]=_0x6f11('0x1c');}}catch(_0x1c8976){utils['error'](_0x1c8976[_0x6f11('0x1d')]);}};exports['dialend']=function(_0x5bd928){try{if(!_[_0x6f11('0x15')](dials[_0x5bd928['uniqueid']])){dials[_0x5bd928[_0x6f11('0xc')]]['dialstatus']=_0x5bd928['dialstatus'];if(_0x5bd928['dialstatus']==_0x6f11('0x1e')){dials[_0x5bd928[_0x6f11('0xc')]]=_[_0x6f11('0x18')](dials[_0x5bd928[_0x6f11('0xc')]],_0x5bd928);dials[_0x5bd928[_0x6f11('0xc')]][_0x6f11('0x1f')]=utils[_0x6f11('0x1a')]();dials[_0x5bd928[_0x6f11('0xc')]][_0x6f11('0x1b')]='connect';}}}catch(_0xd17d07){utils[_0x6f11('0x14')](_0xd17d07[_0x6f11('0x1d')]);}};exports[_0x6f11('0x20')]=function(_0x4ef5d7){try{if(!_[_0x6f11('0x15')](dials[_0x4ef5d7[_0x6f11('0xc')]])){dials[_0x4ef5d7[_0x6f11('0xc')]]=_[_0x6f11('0x18')](dials[_0x4ef5d7[_0x6f11('0xc')]],{'endtime':utils[_0x6f11('0x1a')](),'lastevent':'complete'});dials[_0x4ef5d7['uniqueid']]['duration']=utils['diffTime'](dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x21')],dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x19')]);dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x22')]=utils[_0x6f11('0x23')](dials[_0x4ef5d7[_0x6f11('0xc')]]['answertime']||dials[_0x4ef5d7['uniqueid']][_0x6f11('0x21')],dials[_0x4ef5d7[_0x6f11('0xc')]]['starttime']);dials[_0x4ef5d7[_0x6f11('0xc')]]['billableseconds']=dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x1f')]?utils[_0x6f11('0x23')](dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x21')],dials[_0x4ef5d7[_0x6f11('0xc')]][_0x6f11('0x1f')]):0x0;writeDB(dials[_0x4ef5d7[_0x6f11('0xc')]]);}}catch(_0x14aef0){utils[_0x6f11('0x14')](_0x14aef0[_0x6f11('0x1d')]);}}; \ No newline at end of file +var _0x56a8=['CreateVoiceDialReport','newexten','set','startsWith','appdata','toLowerCase','cdr(routeid)','error','varset','isNil','variable','outboundrouteid','stack','assign','now','lastevent','called','answertime','connect','complete','duration','diffTime','endtime','starttime','holdtime','billableseconds','util','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','connectedlinenum','dialstatus','request'];(function(_0xaee011,_0x4a2cce){var _0x30eff6=function(_0x811d50){while(--_0x811d50){_0xaee011['push'](_0xaee011['shift']());}};_0x30eff6(++_0x4a2cce);}(_0x56a8,0x13a));var _0x856a=function(_0x59f312,_0xf60bb8){_0x59f312=_0x59f312-0x0;var _0x469ad2=_0x56a8[_0x59f312];return _0x469ad2;};'use strict';var _=require('lodash');var util=require(_0x856a('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x2bd869){utils[_0x856a('0x1')](util[_0x856a('0x2')](_0x856a('0x3'),_0x2bd869[_0x856a('0x4')],_0x2bd869[_0x856a('0x5')],_0x2bd869['dialstring'],_0x2bd869[_0x856a('0x6')],_0x2bd869[_0x856a('0x7')],_0x2bd869[_0x856a('0x8')]));utils[_0x856a('0x9')](_0x856a('0xa'),_0x2bd869);delete dials[_0x2bd869[_0x856a('0x4')]];}exports[_0x856a('0xb')]=function(_0x301c96){try{if(_0x301c96['application']['toLowerCase']()==_0x856a('0xc')&&_[_0x856a('0xd')](_0x301c96[_0x856a('0xe')][_0x856a('0xf')](),_0x856a('0x10'))){var _0x583333=_0x301c96[_0x856a('0xe')]['split']('=');dials[_0x301c96[_0x856a('0x4')]]={'routeId':_0x583333[0x1]};}}catch(_0x119453){utils[_0x856a('0x11')](_0x119453['stack']);}};exports[_0x856a('0x12')]=function(_0x5b0a55){try{if(!_[_0x856a('0x13')](_0x5b0a55[_0x856a('0x14')][_0x856a('0x15')])){dials[_0x5b0a55[_0x856a('0x4')]]={'routeId':_0x5b0a55['value']};}}catch(_0x277bd7){utils['error'](_0x277bd7[_0x856a('0x16')]);}};exports['dialbegin']=function(_0x52a6e6){try{if(!_['isNil'](dials[_0x52a6e6[_0x856a('0x4')]])){dials[_0x52a6e6['uniqueid']]=_[_0x856a('0x17')](dials[_0x52a6e6['uniqueid']],_0x52a6e6);dials[_0x52a6e6[_0x856a('0x4')]]['starttime']=utils[_0x856a('0x18')]();dials[_0x52a6e6[_0x856a('0x4')]][_0x856a('0x19')]=_0x856a('0x1a');}}catch(_0x576e9c){utils[_0x856a('0x11')](_0x576e9c[_0x856a('0x16')]);}};exports['dialend']=function(_0x324038){try{if(!_['isNil'](dials[_0x324038[_0x856a('0x4')]])){dials[_0x324038[_0x856a('0x4')]][_0x856a('0x8')]=_0x324038[_0x856a('0x8')];if(_0x324038[_0x856a('0x8')]=='ANSWER'){dials[_0x324038[_0x856a('0x4')]]=_[_0x856a('0x17')](dials[_0x324038['uniqueid']],_0x324038);dials[_0x324038[_0x856a('0x4')]][_0x856a('0x1b')]=utils[_0x856a('0x18')]();dials[_0x324038[_0x856a('0x4')]]['lastevent']=_0x856a('0x1c');}}}catch(_0x4ede26){utils[_0x856a('0x11')](_0x4ede26['stack']);}};exports['hangup']=function(_0xec7cc2){try{if(!_['isNil'](dials[_0xec7cc2[_0x856a('0x4')]])){dials[_0xec7cc2[_0x856a('0x4')]]=_[_0x856a('0x17')](dials[_0xec7cc2[_0x856a('0x4')]],{'endtime':utils[_0x856a('0x18')](),'lastevent':_0x856a('0x1d')});dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x1e')]=utils[_0x856a('0x1f')](dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x20')],dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x21')]);dials[_0xec7cc2['uniqueid']][_0x856a('0x22')]=utils[_0x856a('0x1f')](dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x1b')]||dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x20')],dials[_0xec7cc2[_0x856a('0x4')]]['starttime']);dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x23')]=dials[_0xec7cc2[_0x856a('0x4')]]['answertime']?utils['diffTime'](dials[_0xec7cc2[_0x856a('0x4')]][_0x856a('0x20')],dials[_0xec7cc2[_0x856a('0x4')]]['answertime']):0x0;writeDB(dials[_0xec7cc2[_0x856a('0x4')]]);}}catch(_0x5f4284){utils['error'](_0x5f4284[_0x856a('0x16')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 39aa497..54336e2 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 _0x3009=['fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','asterisk','username','password','keepConnected','xdr','info','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x3009,0x14f));var _0x9300=function(_0x411ce2,_0x4dbe79){_0x411ce2=_0x411ce2-0x0;var _0xa4a520=_0x3009[_0x411ce2];return _0xa4a520;};var AsteriskManager=require(_0x9300('0x0'));var config=require(_0x9300('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x9300('0x2')]['port'],config[_0x9300('0x2')]['ip'],config[_0x9300('0x2')][_0x9300('0x3')],config['asterisk'][_0x9300('0x4')],!![]);ami[_0x9300('0x5')]();if(config[_0x9300('0x6')]&&config[_0x9300('0x6')]['disabled']){utils[_0x9300('0x7')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require(_0x9300('0x8'));var queues=require(_0x9300('0x9'));var recordings=require(_0x9300('0xa'));var members=require(_0x9300('0xb'));var dials=require('./dials.controller');var transfers=require(_0x9300('0xc'));var core=require(_0x9300('0xd'));ami['on'](_0x9300('0xe'),core[_0x9300('0xe')]);ami['on'](_0x9300('0xf'),core['shutdown']);ami['on']('fullybooted',core[_0x9300('0x10')]);ami['on'](_0x9300('0x11'),core[_0x9300('0x11')]);ami['on'](_0x9300('0x12'),core['close']);ami['on'](_0x9300('0x13'),core[_0x9300('0x13')]);ami['on'](_0x9300('0x14'),function(_0x57c5fd){try{members[_0x9300('0x14')](_0x57c5fd);}catch(_0x3586fb){utils[_0x9300('0x11')](_0x3586fb);}});ami['on'](_0x9300('0x15'),function(_0x23128e){try{agents[_0x9300('0x15')](_0x23128e);}catch(_0x20a7b2){utils[_0x9300('0x11')](_0x20a7b2);}});ami['on'](_0x9300('0x16'),function(_0x355eb1){try{agents[_0x9300('0x16')](_0x355eb1);}catch(_0x178ef9){utils[_0x9300('0x11')](_0x178ef9);}});ami['on']('agentconnect',function(_0x186ebe){try{agents[_0x9300('0x17')](_0x186ebe);queues['agentconnect'](_0x186ebe);}catch(_0x32b528){utils['error'](_0x32b528);}});ami['on']('agentcomplete',function(_0x2e0e14){try{agents['agentcomplete'](_0x2e0e14);queues[_0x9300('0x18')](_0x2e0e14);members['agentcomplete'](_0x2e0e14);}catch(_0x391f8a){utils['error'](_0x391f8a);}});ami['on'](_0x9300('0x19'),function(_0x149e7e){try{agents[_0x9300('0x19')](_0x149e7e);queues[_0x9300('0x19')](_0x149e7e);}catch(_0x37dad0){utils[_0x9300('0x11')](_0x37dad0);}});ami['on'](_0x9300('0x1a'),function(_0x60e440){try{queues[_0x9300('0x1a')](_0x60e440);recordings['queuecallerjoin'](_0x60e440);}catch(_0x5b5aad){utils[_0x9300('0x11')](_0x5b5aad);}});ami['on'](_0x9300('0x1b'),function(_0x5d2536){try{queues[_0x9300('0x1b')](_0x5d2536);}catch(_0x4aedcf){utils['error'](_0x4aedcf);}});ami['on']('musiconholdstart',function(_0x1d6a2b){try{queues[_0x9300('0x1c')](_0x1d6a2b);calls[_0x9300('0x1c')](_0x1d6a2b);}catch(_0x1678f7){utils[_0x9300('0x11')](_0x1678f7);}});ami['on'](_0x9300('0x1d'),function(_0x40f8f4){try{queues[_0x9300('0x1d')](_0x40f8f4);calls[_0x9300('0x1d')](_0x40f8f4);}catch(_0x28a1c7){utils[_0x9300('0x11')](_0x28a1c7);}});ami['on'](_0x9300('0x1e'),function(_0x36c9c3){try{calls[_0x9300('0x1e')](_0x36c9c3);recordings['newstate'](_0x36c9c3);}catch(_0x4970c7){utils[_0x9300('0x11')](_0x4970c7);}});ami['on']('hangup',function(_0x10b688){try{calls[_0x9300('0x1f')](_0x10b688);recordings[_0x9300('0x1f')](_0x10b688);dials[_0x9300('0x1f')](_0x10b688);agents[_0x9300('0x1f')](_0x10b688);queues[_0x9300('0x1f')](_0x10b688);}catch(_0x44e5ca){utils['error'](_0x44e5ca);}});ami['on'](_0x9300('0x20'),function(_0x1b4f7e){try{members[_0x9300('0x20')](_0x1b4f7e);}catch(_0x1ff1aa){utils[_0x9300('0x11')](_0x1ff1aa);}});ami['on']('blindtransfer',function(_0x136e83){try{queues[_0x9300('0x21')](_0x136e83);agents['blindtransfer'](_0x136e83);transfers['blindtransfer'](_0x136e83);}catch(_0x397a91){utils[_0x9300('0x11')](_0x397a91);}});ami['on'](_0x9300('0x22'),function(_0x346afa){try{queues['attendedtransfer'](_0x346afa);transfers[_0x9300('0x22')](_0x346afa);agents[_0x9300('0x22')](_0x346afa);calls[_0x9300('0x22')](_0x346afa);}catch(_0x4c5a7e){utils['error'](_0x4c5a7e);}});ami['on'](_0x9300('0x23'),function(_0x2e4835){try{queues[_0x9300('0x23')](_0x2e4835);recordings[_0x9300('0x23')](_0x2e4835);calls[_0x9300('0x23')](_0x2e4835);dials[_0x9300('0x23')](_0x2e4835);}catch(_0x36945d){utils[_0x9300('0x11')](_0x36945d);}});ami['on'](_0x9300('0x24'),function(_0x3d4432){try{calls[_0x9300('0x24')](_0x3d4432);recordings[_0x9300('0x24')](_0x3d4432);dials[_0x9300('0x24')](_0x3d4432);}catch(_0xfefb9b){utils[_0x9300('0x11')](_0xfefb9b);}});ami['on'](_0x9300('0x25'),function(_0xaf979){try{calls[_0x9300('0x25')](_0xaf979);recordings['newchannel'](_0xaf979);}catch(_0x872796){utils['error'](_0x872796);}});ami['on'](_0x9300('0x26'),function(_0x56a2e5){try{dials[_0x9300('0x26')](_0x56a2e5);}catch(_0x588169){utils[_0x9300('0x11')](_0x588169);}});ami['on']('dialend',function(_0x14079a){try{dials['dialend'](_0x14079a);}catch(_0xa4da6a){utils['error'](_0xa4da6a);}});} \ No newline at end of file +var _0xe54e=['port','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialend','asterisk-manager','../../config/environment','./utils','asterisk'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe54e,0x1e8));var _0xee54=function(_0x3fc428,_0x5232c6){_0x3fc428=_0x3fc428-0x0;var _0x598897=_0xe54e[_0x3fc428];return _0x598897;};var AsteriskManager=require(_0xee54('0x0'));var config=require(_0xee54('0x1'));var utils=require(_0xee54('0x2'));var ami=new AsteriskManager(config[_0xee54('0x3')][_0xee54('0x4')],config[_0xee54('0x3')]['ip'],config[_0xee54('0x3')]['username'],config[_0xee54('0x3')]['password'],!![]);ami[_0xee54('0x5')]();if(config[_0xee54('0x6')]&&config[_0xee54('0x6')][_0xee54('0x7')]){utils[_0xee54('0x8')](_0xee54('0x9'));}else{var agents=require(_0xee54('0xa'));var calls=require('./calls.controller');var queues=require(_0xee54('0xb'));var recordings=require(_0xee54('0xc'));var members=require(_0xee54('0xd'));var dials=require(_0xee54('0xe'));var transfers=require(_0xee54('0xf'));var core=require('./core.controller');ami['on'](_0xee54('0x10'),core[_0xee54('0x10')]);ami['on']('shutdown',core[_0xee54('0x11')]);ami['on'](_0xee54('0x12'),core[_0xee54('0x12')]);ami['on']('error',core[_0xee54('0x13')]);ami['on'](_0xee54('0x14'),core['close']);ami['on']('managerevent',core[_0xee54('0x15')]);ami['on'](_0xee54('0x16'),function(_0x396356){try{members[_0xee54('0x16')](_0x396356);}catch(_0x98914){utils[_0xee54('0x13')](_0x98914);}});ami['on'](_0xee54('0x17'),function(_0xddf235){try{agents['agentcalled'](_0xddf235);}catch(_0x59af3f){utils['error'](_0x59af3f);}});ami['on'](_0xee54('0x18'),function(_0x511c01){try{agents[_0xee54('0x18')](_0x511c01);}catch(_0x1ddd56){utils[_0xee54('0x13')](_0x1ddd56);}});ami['on']('agentconnect',function(_0x42182b){try{agents[_0xee54('0x19')](_0x42182b);queues[_0xee54('0x19')](_0x42182b);}catch(_0x302d29){utils[_0xee54('0x13')](_0x302d29);}});ami['on']('agentcomplete',function(_0x58a292){try{agents[_0xee54('0x1a')](_0x58a292);queues[_0xee54('0x1a')](_0x58a292);members[_0xee54('0x1a')](_0x58a292);}catch(_0x4c048a){utils[_0xee54('0x13')](_0x4c048a);}});ami['on'](_0xee54('0x1b'),function(_0x55db09){try{agents[_0xee54('0x1b')](_0x55db09);queues[_0xee54('0x1b')](_0x55db09);}catch(_0x47b407){utils[_0xee54('0x13')](_0x47b407);}});ami['on'](_0xee54('0x1c'),function(_0x258fbb){try{queues['queuecallerjoin'](_0x258fbb);recordings[_0xee54('0x1c')](_0x258fbb);}catch(_0x494d49){utils['error'](_0x494d49);}});ami['on'](_0xee54('0x1d'),function(_0x51f7c0){try{queues[_0xee54('0x1d')](_0x51f7c0);}catch(_0x56b6ec){utils[_0xee54('0x13')](_0x56b6ec);}});ami['on'](_0xee54('0x1e'),function(_0x12874d){try{queues['musiconholdstart'](_0x12874d);calls[_0xee54('0x1e')](_0x12874d);}catch(_0x2a8963){utils[_0xee54('0x13')](_0x2a8963);}});ami['on'](_0xee54('0x1f'),function(_0x368afc){try{queues[_0xee54('0x1f')](_0x368afc);calls[_0xee54('0x1f')](_0x368afc);}catch(_0x540de5){utils[_0xee54('0x13')](_0x540de5);}});ami['on'](_0xee54('0x20'),function(_0x1132df){try{calls['newstate'](_0x1132df);recordings[_0xee54('0x20')](_0x1132df);}catch(_0x5b380c){utils['error'](_0x5b380c);}});ami['on'](_0xee54('0x21'),function(_0x1d092e){try{calls[_0xee54('0x21')](_0x1d092e);recordings[_0xee54('0x21')](_0x1d092e);dials['hangup'](_0x1d092e);agents[_0xee54('0x21')](_0x1d092e);queues['hangup'](_0x1d092e);}catch(_0x1dcdfa){utils['error'](_0x1dcdfa);}});ami['on']('cdr',function(_0xac1a30){try{members[_0xee54('0x22')](_0xac1a30);}catch(_0x27bf9b){utils['error'](_0x27bf9b);}});ami['on'](_0xee54('0x23'),function(_0x24ff57){try{queues['blindtransfer'](_0x24ff57);agents[_0xee54('0x23')](_0x24ff57);transfers['blindtransfer'](_0x24ff57);}catch(_0x3c3984){utils[_0xee54('0x13')](_0x3c3984);}});ami['on'](_0xee54('0x24'),function(_0x114bec){try{queues['attendedtransfer'](_0x114bec);transfers[_0xee54('0x24')](_0x114bec);agents[_0xee54('0x24')](_0x114bec);calls[_0xee54('0x24')](_0x114bec);}catch(_0x220e7e){utils['error'](_0x220e7e);}});ami['on'](_0xee54('0x25'),function(_0x38bdb0){try{queues[_0xee54('0x25')](_0x38bdb0);recordings[_0xee54('0x25')](_0x38bdb0);calls[_0xee54('0x25')](_0x38bdb0);dials['varset'](_0x38bdb0);}catch(_0x312ee1){utils['error'](_0x312ee1);}});ami['on'](_0xee54('0x26'),function(_0x26a8a){try{calls[_0xee54('0x26')](_0x26a8a);recordings[_0xee54('0x26')](_0x26a8a);dials[_0xee54('0x26')](_0x26a8a);}catch(_0xfa0a27){utils['error'](_0xfa0a27);}});ami['on'](_0xee54('0x27'),function(_0x3c034a){try{calls[_0xee54('0x27')](_0x3c034a);recordings[_0xee54('0x27')](_0x3c034a);}catch(_0x3e4652){utils[_0xee54('0x13')](_0x3e4652);}});ami['on']('dialbegin',function(_0x29646a){try{dials['dialbegin'](_0x29646a);}catch(_0x4b09fd){utils[_0xee54('0x13')](_0x4b09fd);}});ami['on']('dialend',function(_0x195343){try{dials[_0xee54('0x28')](_0x195343);}catch(_0x1fc8d3){utils[_0xee54('0x13')](_0x1fc8d3);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c705447..3408693 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 _0xf59f=['./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','some','devicestatechange','state','INUSE','BUSY','device','TALKING','now','NOT_INUSE','exitAt','diffTime','queue','cdr','source','data3','destination','destinationchannel','isNil','data1','lodash','util'];(function(_0x269ff3,_0x3c46c6){var _0x577252=function(_0x275800){while(--_0x275800){_0x269ff3['push'](_0x269ff3['shift']());}};_0x577252(++_0x3c46c6);}(_0xf59f,0xee));var _0xff59=function(_0xe71b04,_0x5e9a38){_0xe71b04=_0xe71b04-0x0;var _0x26485c=_0xf59f[_0xe71b04];return _0x26485c;};'use strict';var _=require(_0xff59('0x0'));var util=require(_0xff59('0x1'));var utils=require(_0xff59('0x2'));var members={};var exclude=[_0xff59('0x3'),'Queue:'];function writeDB(_0x11b66e){utils[_0xff59('0x4')](util[_0xff59('0x5')](_0xff59('0x6'),_0x11b66e[_0xff59('0x7')],_0x11b66e[_0xff59('0x8')],_0x11b66e[_0xff59('0x9')],_0x11b66e[_0xff59('0xa')],_0x11b66e[_0xff59('0xb')],_0x11b66e[_0xff59('0xc')]));if(_0x11b66e[_0xff59('0x8')]){utils[_0xff59('0xd')](_0x11b66e[_0xff59('0x8')])[_0xff59('0xe')](function(_0x41078b){if(_0x41078b){_0x11b66e[_0xff59('0xb')]=_0x41078b[_0xff59('0xf')];_0x11b66e[_0xff59('0x10')]=_0x41078b[_0xff59('0x10')];utils[_0xff59('0x11')](_0xff59('0x12'),_0x11b66e);}else{utils[_0xff59('0x13')](_0x11b66e[_0xff59('0x8')][_0xff59('0x14')]('/')[0x1])[_0xff59('0xe')](function(_0x16d0d2){if(_0x16d0d2){_0x11b66e[_0xff59('0xb')]=_0x16d0d2[_0xff59('0xf')];_0x11b66e[_0xff59('0x10')]=_0x16d0d2[_0xff59('0x10')];utils['request']('CreateMemberReport',_0x11b66e);}});}})['catch'](function(_0x4baf26){utils['error'](_0x4baf26);});}delete members[_0x11b66e['interface']];}function startsWith(_0x26639b,_0x3c6b14){return _[_0xff59('0x15')](_0x26639b,function(_0x2ab2f1){return _['startsWith'](_0x3c6b14,_0x2ab2f1);});}exports[_0xff59('0x16')]=function(_0x3c6b6e){switch(_0x3c6b6e[_0xff59('0x17')]){case _0xff59('0x18'):case _0xff59('0x19'):if(!startsWith(exclude,_0x3c6b6e[_0xff59('0x1a')])){members[_0x3c6b6e[_0xff59('0x1a')]]={'channel':'voice','interface':_0x3c6b6e[_0xff59('0x1a')],'type':_0xff59('0x1b'),'enterAt':utils[_0xff59('0x1c')](),'role':'agent'};}break;case _0xff59('0x1d'):if(!_['isNil'](members[_0x3c6b6e[_0xff59('0x1a')]])){members[_0x3c6b6e[_0xff59('0x1a')]][_0xff59('0x1e')]=utils[_0xff59('0x1c')]();members[_0x3c6b6e[_0xff59('0x1a')]]['duration']=utils[_0xff59('0x1f')](members[_0x3c6b6e[_0xff59('0x1a')]][_0xff59('0x1e')],members[_0x3c6b6e[_0xff59('0x1a')]]['enterAt']);if(members[_0x3c6b6e[_0xff59('0x1a')]][_0xff59('0x7')]){writeDB(members[_0x3c6b6e[_0xff59('0x1a')]]);}}default:break;}};exports['agentcomplete']=function(_0xa62e9f){if(!_['isNil'](members[_0xa62e9f['interface']])){members[_0xa62e9f[_0xff59('0x8')]]=_['assign'](members[_0xa62e9f['interface']],{'data4':_0xa62e9f[_0xff59('0x20')],'uniqueid':_0xa62e9f[_0xff59('0x7')]});}};exports[_0xff59('0x21')]=function(_0x5085d8){if(_0x5085d8['channel']){var _0x7e929a=_0x5085d8[_0xff59('0x9')][_0xff59('0x14')]('-')[0x0];if(!_['isNil'](members[_0x7e929a])){members[_0x7e929a]=_['assign'](members[_0x7e929a],{'data1':members[_0x7e929a]['data1']||_0x5085d8[_0xff59('0xc')],'data2':members[_0x7e929a][_0xff59('0xa')]||_0x5085d8[_0xff59('0x22')],'data3':members[_0x7e929a][_0xff59('0x23')]||_0x5085d8[_0xff59('0x24')],'uniqueid':members[_0x7e929a][_0xff59('0x7')]||_0x5085d8[_0xff59('0x7')]});if(members[_0x7e929a]['exitAt']){writeDB(members[_0x7e929a]);}}}if(_0x5085d8[_0xff59('0x25')]){var _0x52c6d0=_0x5085d8[_0xff59('0x25')]['split']('-')[0x0];if(!_[_0xff59('0x26')](members[_0x52c6d0])){members[_0x52c6d0]=_['assign'](members[_0x52c6d0],{'data1':members[_0x52c6d0][_0xff59('0x27')]||_0x5085d8['type'],'data2':members[_0x52c6d0][_0xff59('0xa')]||_0x5085d8[_0xff59('0x22')],'data3':members[_0x52c6d0]['data3']||_0x5085d8['destination'],'uniqueid':members[_0x52c6d0][_0xff59('0x7')]||_0x5085d8['uniqueid']});if(members[_0x52c6d0][_0xff59('0x1e')]){writeDB(members[_0x52c6d0]);}}}}; \ No newline at end of file +var _0x7d28=['internal','request','CreateMemberReport','getUserByName','name','catch','INUSE','BUSY','device','voice','now','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','channel','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','then'];(function(_0x10afee,_0xed7b17){var _0x2ab1da=function(_0x438ae3){while(--_0x438ae3){_0x10afee['push'](_0x10afee['shift']());}};_0x2ab1da(++_0xed7b17);}(_0x7d28,0x1d3));var _0x87d2=function(_0x17d1a2,_0x2650e4){_0x17d1a2=_0x17d1a2-0x0;var _0x24c998=_0x7d28[_0x17d1a2];return _0x24c998;};'use strict';var _=require(_0x87d2('0x0'));var util=require(_0x87d2('0x1'));var utils=require(_0x87d2('0x2'));var members={};var exclude=[_0x87d2('0x3'),_0x87d2('0x4')];function writeDB(_0x3957f5){utils[_0x87d2('0x5')](util['format'](_0x87d2('0x6'),_0x3957f5[_0x87d2('0x7')],_0x3957f5[_0x87d2('0x8')],_0x3957f5['channel'],_0x3957f5[_0x87d2('0x9')],_0x3957f5[_0x87d2('0xa')],_0x3957f5[_0x87d2('0xb')]));if(_0x3957f5[_0x87d2('0x8')]){utils['getUserByInterface'](_0x3957f5[_0x87d2('0x8')])[_0x87d2('0xc')](function(_0x4cda73){if(_0x4cda73){_0x3957f5['membername']=_0x4cda73['name'];_0x3957f5['internal']=_0x4cda73[_0x87d2('0xd')];utils[_0x87d2('0xe')](_0x87d2('0xf'),_0x3957f5);}else{utils[_0x87d2('0x10')](_0x3957f5[_0x87d2('0x8')]['split']('/')[0x1])[_0x87d2('0xc')](function(_0x4b99bf){if(_0x4b99bf){_0x3957f5[_0x87d2('0xa')]=_0x4b99bf[_0x87d2('0x11')];_0x3957f5[_0x87d2('0xd')]=_0x4b99bf[_0x87d2('0xd')];utils[_0x87d2('0xe')](_0x87d2('0xf'),_0x3957f5);}});}})[_0x87d2('0x12')](function(_0x19cbf4){utils['error'](_0x19cbf4);});}delete members[_0x3957f5['interface']];}function startsWith(_0x128957,_0x3e35dc){return _['some'](_0x128957,function(_0x8f9e77){return _['startsWith'](_0x3e35dc,_0x8f9e77);});}exports['devicestatechange']=function(_0x7895ac){switch(_0x7895ac['state']){case _0x87d2('0x13'):case _0x87d2('0x14'):if(!startsWith(exclude,_0x7895ac[_0x87d2('0x15')])){members[_0x7895ac[_0x87d2('0x15')]]={'channel':_0x87d2('0x16'),'interface':_0x7895ac[_0x87d2('0x15')],'type':'TALKING','enterAt':utils[_0x87d2('0x17')](),'role':'agent'};}break;case _0x87d2('0x18'):if(!_[_0x87d2('0x19')](members[_0x7895ac[_0x87d2('0x15')]])){members[_0x7895ac[_0x87d2('0x15')]]['exitAt']=utils['now']();members[_0x7895ac[_0x87d2('0x15')]][_0x87d2('0x1a')]=utils[_0x87d2('0x1b')](members[_0x7895ac[_0x87d2('0x15')]][_0x87d2('0x1c')],members[_0x7895ac[_0x87d2('0x15')]][_0x87d2('0x1d')]);if(members[_0x7895ac[_0x87d2('0x15')]][_0x87d2('0x7')]){writeDB(members[_0x7895ac[_0x87d2('0x15')]]);}}default:break;}};exports[_0x87d2('0x1e')]=function(_0x21fdff){if(!_[_0x87d2('0x19')](members[_0x21fdff[_0x87d2('0x8')]])){members[_0x21fdff[_0x87d2('0x8')]]=_[_0x87d2('0x1f')](members[_0x21fdff[_0x87d2('0x8')]],{'data4':_0x21fdff[_0x87d2('0x20')],'uniqueid':_0x21fdff[_0x87d2('0x7')]});}};exports[_0x87d2('0x21')]=function(_0x5f272b){if(_0x5f272b[_0x87d2('0x22')]){var _0x146352=_0x5f272b[_0x87d2('0x22')]['split']('-')[0x0];if(!_[_0x87d2('0x19')](members[_0x146352])){members[_0x146352]=_[_0x87d2('0x1f')](members[_0x146352],{'data1':members[_0x146352][_0x87d2('0x23')]||_0x5f272b['type'],'data2':members[_0x146352]['data2']||_0x5f272b[_0x87d2('0x24')],'data3':members[_0x146352][_0x87d2('0x25')]||_0x5f272b[_0x87d2('0x26')],'uniqueid':members[_0x146352][_0x87d2('0x7')]||_0x5f272b[_0x87d2('0x7')]});if(members[_0x146352][_0x87d2('0x1c')]){writeDB(members[_0x146352]);}}}if(_0x5f272b[_0x87d2('0x27')]){var _0x5bcf92=_0x5f272b[_0x87d2('0x27')]['split']('-')[0x0];if(!_[_0x87d2('0x19')](members[_0x5bcf92])){members[_0x5bcf92]=_['assign'](members[_0x5bcf92],{'data1':members[_0x5bcf92]['data1']||_0x5f272b[_0x87d2('0xb')],'data2':members[_0x5bcf92]['data2']||_0x5f272b['source'],'data3':members[_0x5bcf92][_0x87d2('0x25')]||_0x5f272b[_0x87d2('0x26')],'uniqueid':members[_0x5bcf92]['uniqueid']||_0x5f272b['uniqueid']});if(members[_0x5bcf92]['exitAt']){writeDB(members[_0x5bcf92]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2ad994a..286051f 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 _0xbd3b=['musiconholdstart','musiconholdstartAt','musiconholdstop','diffTime','lodash','./utils','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','varset','variable','queuestatus','value','CONTINUE','queuecallerexitAt','toUpperCase','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','lastAssignedTo','membername','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone'];(function(_0x21d9af,_0x431b30){var _0x4b208b=function(_0x55bdf4){while(--_0x55bdf4){_0x21d9af['push'](_0x21d9af['shift']());}};_0x4b208b(++_0x431b30);}(_0xbd3b,0x9c));var _0xbbd3=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0xbd3b[_0xc8db6b];return _0x12cb81;};'use strict';var _=require(_0xbbd3('0x0'));var util=require('util');var utils=require(_0xbbd3('0x1'));var queues={};function writeDB(_0x36cd9e){utils['info'](util[_0xbbd3('0x2')](_0xbbd3('0x3'),_0x36cd9e[_0xbbd3('0x4')],_0x36cd9e[_0xbbd3('0x5')],_0x36cd9e['queue'],_0x36cd9e['lastAssignedTo'],_0x36cd9e[_0xbbd3('0x6')],_0x36cd9e[_0xbbd3('0x7')],_0x36cd9e[_0xbbd3('0x8')]));if(_0x36cd9e[_0xbbd3('0x9')]){utils[_0xbbd3('0xa')](_0x36cd9e[_0xbbd3('0x9')])[_0xbbd3('0xb')](function(_0x41cdb7){if(_0x41cdb7){_0x36cd9e[_0xbbd3('0xc')]=_0x41cdb7['type'];}utils[_0xbbd3('0xd')]('CreateVoiceQueueReport',_0x36cd9e);});}else{utils[_0xbbd3('0xd')](_0xbbd3('0xe'),_0x36cd9e);}if(_0x36cd9e[_0xbbd3('0xf')]){delete queues[_0x36cd9e['transfereduniqueid']];}else{delete queues[_0x36cd9e['uniqueid']];}}exports['queuecallerjoin']=function(_0x5be7d5){queues[_0x5be7d5[_0xbbd3('0x4')]]=_[_0xbbd3('0x10')](_0x5be7d5,{'originalposition':_0x5be7d5[_0xbbd3('0x11')],'queuecallerjoinAt':utils[_0xbbd3('0x12')](),'mohtime':0x0});};exports[_0xbbd3('0x13')]=function(_0x126a06){if(!_[_0xbbd3('0x14')](queues[_0x126a06[_0xbbd3('0x4')]])){if(queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0x15')]){if(!queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0x16')]&&!queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0x17')]){queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0x18')]=!![];queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0x19')]=utils['now']();queues[_0x126a06[_0xbbd3('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x126a06['uniqueid']]);}else{if(queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0xf')]){queues[queues[_0x126a06[_0xbbd3('0x4')]][_0xbbd3('0xf')]]=queues[_0x126a06['uniqueid']];queues[queues[_0x126a06[_0xbbd3('0x4')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x126a06[_0xbbd3('0x4')]];}}}};exports[_0xbbd3('0x1a')]=function(_0x49445f){if(!_[_0xbbd3('0x14')](_0x49445f[_0xbbd3('0x1b')][_0xbbd3('0x1c')])&&_0x49445f[_0xbbd3('0x1d')]['toUpperCase']()!==_0xbbd3('0x1e')){if(!_[_0xbbd3('0x14')](queues[_0x49445f[_0xbbd3('0x4')]])){queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x16')]=![];queues[_0x49445f[_0xbbd3('0x4')]]['queuecallerabandonAt']=null;queues[_0x49445f['uniqueid']][_0xbbd3('0x17')]=!![];queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x1f')]=utils[_0xbbd3('0x12')]();queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x8')]=_0x49445f[_0xbbd3('0x1d')][_0xbbd3('0x20')]();writeDB(queues[_0x49445f[_0xbbd3('0x4')]]);}}else if(!_['isNil'](_0x49445f['variable'][_0xbbd3('0x21')])){if(!_[_0xbbd3('0x14')](queues[_0x49445f['uniqueid']])&&!queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x16')]){queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x16')]=![];queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x22')]=null;queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x17')]=!![];queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x1f')]=utils[_0xbbd3('0x12')]();queues[_0x49445f[_0xbbd3('0x4')]][_0xbbd3('0x8')]=_0xbbd3('0x23');}}};exports[_0xbbd3('0x16')]=function(_0x4ebecf){if(!_[_0xbbd3('0x14')](queues[_0x4ebecf[_0xbbd3('0x4')]])){queues[_0x4ebecf[_0xbbd3('0x4')]][_0xbbd3('0x17')]=![];queues[_0x4ebecf['uniqueid']][_0xbbd3('0x1f')]=null;queues[_0x4ebecf[_0xbbd3('0x4')]][_0xbbd3('0x16')]=!![];queues[_0x4ebecf[_0xbbd3('0x4')]][_0xbbd3('0x22')]=utils['now']();queues[_0x4ebecf[_0xbbd3('0x4')]][_0xbbd3('0x8')]=_0xbbd3('0x24');}};exports[_0xbbd3('0x25')]=function(_0x30bb90){if(!_[_0xbbd3('0x14')](queues[_0x30bb90['uniqueid']])){queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x25')]=!![];queues[_0x30bb90['uniqueid']][_0xbbd3('0x15')]=utils['now']();queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x26')]=utils['diffTime'](queues[_0x30bb90[_0xbbd3('0x4')]]['queuecallerleaveAt'],queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x27')]);queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x11')]=_0x30bb90[_0xbbd3('0x11')];queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x28')]=_0x30bb90['count'];queues[_0x30bb90[_0xbbd3('0x4')]][_0xbbd3('0x29')]=_0x30bb90[_0xbbd3('0x29')];queues[_0x30bb90['uniqueid']][_0xbbd3('0x2a')]=_0x30bb90[_0xbbd3('0x2a')];}};exports[_0xbbd3('0x2b')]=function(_0x3f4a6c){if(!_[_0xbbd3('0x14')](queues[_0x3f4a6c[_0xbbd3('0x4')]])){queues[_0x3f4a6c['uniqueid']]['queuecallerabandon']=![];queues[_0x3f4a6c['uniqueid']][_0xbbd3('0x16')]=![];queues[_0x3f4a6c[_0xbbd3('0x4')]][_0xbbd3('0x22')]=null;queues[_0x3f4a6c[_0xbbd3('0x4')]][_0xbbd3('0x17')]=![];queues[_0x3f4a6c[_0xbbd3('0x4')]]['queuecallerexitreason']=null;queues[_0x3f4a6c[_0xbbd3('0x4')]]['queuecallerexitAt']=null;queues[_0x3f4a6c['uniqueid']][_0xbbd3('0x2c')]=!![];queues[_0x3f4a6c[_0xbbd3('0x4')]][_0xbbd3('0x7')]=_0x3f4a6c[_0xbbd3('0x2d')];queues[_0x3f4a6c['uniqueid']][_0xbbd3('0x2e')]=_0x3f4a6c[_0xbbd3('0x2f')];}};exports['agentcomplete']=function(_0xd4d17){if(!_['isNil'](queues[_0xd4d17[_0xbbd3('0x4')]])){if(queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x15')]){queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x16')]=![];queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x16')]=![];queues[_0xd4d17[_0xbbd3('0x4')]]['queuecallerabandonAt']=null;queues[_0xd4d17['uniqueid']][_0xbbd3('0x17')]=![];queues[_0xd4d17[_0xbbd3('0x4')]]['queuecallerexitAt']=null;queues[_0xd4d17['uniqueid']][_0xbbd3('0x2c')]=!![];queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x2e')]=_0xd4d17[_0xbbd3('0x2f')];queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x18')]=!![];queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x19')]=utils[_0xbbd3('0x12')]();if(_0xd4d17[_0xbbd3('0x30')]==_0xbbd3('0x31')){if(!queues[_0xd4d17[_0xbbd3('0x4')]]['transfer']){queues[_0xd4d17[_0xbbd3('0x4')]]['queuecallerexitreason']=_0xbbd3('0x32');}}else{queues[_0xd4d17[_0xbbd3('0x4')]][_0xbbd3('0x8')]=_0xbbd3('0x33')+_0xd4d17[_0xbbd3('0x30')][_0xbbd3('0x20')]();}writeDB(queues[_0xd4d17[_0xbbd3('0x4')]]);}}};exports['blindtransfer']=function(_0x3f6d82){if(!_[_0xbbd3('0x14')](queues[_0x3f6d82[_0xbbd3('0x34')]])){queues[_0x3f6d82[_0xbbd3('0x34')]][_0xbbd3('0x31')]=!![];queues[_0x3f6d82['transfereeuniqueid']][_0xbbd3('0x35')]=_0xbbd3('0x36');queues[_0x3f6d82[_0xbbd3('0x34')]]['transferexten']=_0x3f6d82[_0xbbd3('0x37')];queues[_0x3f6d82[_0xbbd3('0x34')]][_0xbbd3('0x38')]=_0x3f6d82['transfereeuniqueid'];queues[_0x3f6d82[_0xbbd3('0x34')]][_0xbbd3('0x8')]=_0xbbd3('0x39');}};exports[_0xbbd3('0x3a')]=function(_0x574f16){try{if(_0x574f16['origtransfereruniqueid']==_0x574f16[_0xbbd3('0x3b')]){if(!_['isNil'](queues[_0x574f16['secondtransfererlinkedid']])){queues[_0x574f16[_0xbbd3('0x3c')]]['transfer']=!![];queues[_0x574f16[_0xbbd3('0x3c')]][_0xbbd3('0x35')]='ATTENDED';queues[_0x574f16[_0xbbd3('0x3c')]][_0xbbd3('0x3d')]=_0x574f16['origtransfererexten'];queues[_0x574f16[_0xbbd3('0x3c')]][_0xbbd3('0x38')]=_0x574f16['origtransfereruniqueid'];queues[_0x574f16[_0xbbd3('0x3c')]]['queuecallerexitreason']=_0xbbd3('0x3e');}if(!_['isNil'](queues[_0x574f16[_0xbbd3('0x3b')]])){if(_0x574f16[_0xbbd3('0x3f')]&&queues[_0x574f16[_0xbbd3('0x3f')]]){queues[_0x574f16[_0xbbd3('0x3f')]][_0xbbd3('0x40')]=0x1;queues[_0x574f16[_0xbbd3('0x34')]]=_['clone'](queues[_0x574f16[_0xbbd3('0x3f')]]);queues[_0x574f16[_0xbbd3('0x34')]][_0xbbd3('0xf')]=_0x574f16[_0xbbd3('0x41')];queues[_0x574f16['transfereeuniqueid']][_0xbbd3('0x40')]=0x2;queues[_0x574f16[_0xbbd3('0x34')]]['calleridnum']=queues[_0x574f16[_0xbbd3('0x3c')]][_0xbbd3('0x6')];queues[_0x574f16[_0xbbd3('0x34')]][_0xbbd3('0x42')]=queues[_0x574f16['secondtransfererlinkedid']][_0xbbd3('0x42')];queues[_0x574f16[_0xbbd3('0x34')]][_0xbbd3('0x27')]=utils['now']();queues[_0x574f16['transfereeuniqueid']][_0xbbd3('0x15')]=utils[_0xbbd3('0x12')]();queues[_0x574f16[_0xbbd3('0x34')]]['holdtime']=0x0;queues[_0x574f16['transfereeuniqueid']][_0xbbd3('0x43')]=0x0;}else{queues[_0x574f16[_0xbbd3('0x3b')]][_0xbbd3('0xf')]=_0x574f16['secondtransfererlinkedid'];}}}else if(_0x574f16[_0xbbd3('0x44')]==_0x574f16[_0xbbd3('0x3c')]){if(!_[_0xbbd3('0x14')](queues[_0x574f16[_0xbbd3('0x3b')]])){queues[_0x574f16[_0xbbd3('0x3b')]][_0xbbd3('0x31')]=!![];queues[_0x574f16[_0xbbd3('0x3b')]][_0xbbd3('0x35')]='ATTENDED';queues[_0x574f16['origtransfererlinkedid']][_0xbbd3('0x3d')]=_0x574f16[_0xbbd3('0x45')];queues[_0x574f16[_0xbbd3('0x3b')]][_0xbbd3('0x38')]=_0x574f16[_0xbbd3('0x44')];queues[_0x574f16[_0xbbd3('0x3b')]][_0xbbd3('0x8')]=_0xbbd3('0x3e');}if(!_[_0xbbd3('0x14')](queues[_0x574f16[_0xbbd3('0x3c')]])){if(_0x574f16[_0xbbd3('0x46')]&&queues[_0x574f16[_0xbbd3('0x46')]]){queues[_0x574f16[_0xbbd3('0x46')]][_0xbbd3('0x40')]=0x1;queues[_0x574f16[_0xbbd3('0x41')]]=_[_0xbbd3('0x47')](queues[_0x574f16[_0xbbd3('0x46')]]);queues[_0x574f16[_0xbbd3('0x41')]][_0xbbd3('0xf')]=_0x574f16[_0xbbd3('0x41')];queues[_0x574f16[_0xbbd3('0x41')]][_0xbbd3('0x40')]=0x2;queues[_0x574f16['transfertargetuniqueid']][_0xbbd3('0x6')]=queues[_0x574f16[_0xbbd3('0x3b')]]['calleridnum'];queues[_0x574f16[_0xbbd3('0x41')]][_0xbbd3('0x42')]=queues[_0x574f16['origtransfererlinkedid']][_0xbbd3('0x42')];queues[_0x574f16['transfertargetuniqueid']][_0xbbd3('0x27')]=utils['now']();queues[_0x574f16['transfertargetuniqueid']][_0xbbd3('0x15')]=utils[_0xbbd3('0x12')]();queues[_0x574f16['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x574f16['transfertargetuniqueid']][_0xbbd3('0x43')]=0x0;}else{queues[_0x574f16[_0xbbd3('0x3c')]][_0xbbd3('0xf')]=_0x574f16['origtransfererlinkedid'];}}}}catch(_0x216a99){utils['error'](_0x216a99['stack']);}};exports[_0xbbd3('0x48')]=function(_0x5e921b){if(!_[_0xbbd3('0x14')](queues[_0x5e921b[_0xbbd3('0x4')]])){queues[_0x5e921b[_0xbbd3('0x4')]][_0xbbd3('0x49')]=utils['now']();}};exports[_0xbbd3('0x4a')]=function(_0x1e50e3){if(!_[_0xbbd3('0x14')](queues[_0x1e50e3['uniqueid']])){if(!_[_0xbbd3('0x14')](queues[_0x1e50e3['uniqueid']][_0xbbd3('0x49')])){queues[_0x1e50e3[_0xbbd3('0x4')]]['mohtime']+=utils[_0xbbd3('0x4b')](utils['now'](),queues[_0x1e50e3[_0xbbd3('0x4')]]['musiconholdstartAt']);delete queues[_0x1e50e3[_0xbbd3('0x4')]][_0xbbd3('0x49')];}}}; \ No newline at end of file +var _0xd162=['position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','EXITWITHKEY','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','assigned','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','origtransfereruniqueid','transfereelinkedid','clone','transfertargetuniqueid','mohtime','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','calleridname','error','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign'];(function(_0x4dd4f5,_0x19dcfc){var _0x19543e=function(_0x202ca1){while(--_0x202ca1){_0x4dd4f5['push'](_0x4dd4f5['shift']());}};_0x19543e(++_0x19dcfc);}(_0xd162,0x16a));var _0x2d16=function(_0x23b1d5,_0x3043fa){_0x23b1d5=_0x23b1d5-0x0;var _0x3f5702=_0xd162[_0x23b1d5];return _0x3f5702;};'use strict';var _=require(_0x2d16('0x0'));var util=require(_0x2d16('0x1'));var utils=require(_0x2d16('0x2'));var queues={};function writeDB(_0xe74d24){utils[_0x2d16('0x3')](util['format'](_0x2d16('0x4'),_0xe74d24[_0x2d16('0x5')],_0xe74d24[_0x2d16('0x6')],_0xe74d24[_0x2d16('0x7')],_0xe74d24[_0x2d16('0x8')],_0xe74d24[_0x2d16('0x9')],_0xe74d24[_0x2d16('0xa')],_0xe74d24[_0x2d16('0xb')]));if(_0xe74d24['queue']){utils['getVoiceQueueByName'](_0xe74d24[_0x2d16('0x7')])[_0x2d16('0xc')](function(_0x37a230){if(_0x37a230){_0xe74d24['type']=_0x37a230[_0x2d16('0xd')];}utils[_0x2d16('0xe')](_0x2d16('0xf'),_0xe74d24);});}else{utils[_0x2d16('0xe')](_0x2d16('0xf'),_0xe74d24);}if(_0xe74d24[_0x2d16('0x10')]){delete queues[_0xe74d24[_0x2d16('0x10')]];}else{delete queues[_0xe74d24['uniqueid']];}}exports['queuecallerjoin']=function(_0x57a8b6){queues[_0x57a8b6[_0x2d16('0x5')]]=_[_0x2d16('0x11')](_0x57a8b6,{'originalposition':_0x57a8b6[_0x2d16('0x12')],'queuecallerjoinAt':utils[_0x2d16('0x13')](),'mohtime':0x0});};exports[_0x2d16('0x14')]=function(_0x237a7f){if(!_[_0x2d16('0x15')](queues[_0x237a7f[_0x2d16('0x5')]])){if(queues[_0x237a7f[_0x2d16('0x5')]][_0x2d16('0x16')]){if(!queues[_0x237a7f['uniqueid']][_0x2d16('0x17')]&&!queues[_0x237a7f[_0x2d16('0x5')]]['queuecallerexit']){queues[_0x237a7f[_0x2d16('0x5')]][_0x2d16('0x18')]=!![];queues[_0x237a7f['uniqueid']][_0x2d16('0x19')]=utils[_0x2d16('0x13')]();queues[_0x237a7f[_0x2d16('0x5')]]['queuecallerexitreason']=_0x2d16('0x1a');}writeDB(queues[_0x237a7f[_0x2d16('0x5')]]);}else{if(queues[_0x237a7f[_0x2d16('0x5')]][_0x2d16('0x10')]){queues[queues[_0x237a7f[_0x2d16('0x5')]][_0x2d16('0x10')]]=queues[_0x237a7f[_0x2d16('0x5')]];queues[queues[_0x237a7f[_0x2d16('0x5')]][_0x2d16('0x10')]][_0x2d16('0x1b')]=0x2;delete queues[_0x237a7f[_0x2d16('0x5')]];}}}};exports['varset']=function(_0x23370f){if(!_[_0x2d16('0x15')](_0x23370f[_0x2d16('0x1c')]['queuestatus'])&&_0x23370f[_0x2d16('0x1d')][_0x2d16('0x1e')]()!==_0x2d16('0x1f')){if(!_[_0x2d16('0x15')](queues[_0x23370f['uniqueid']])){queues[_0x23370f[_0x2d16('0x5')]][_0x2d16('0x17')]=![];queues[_0x23370f[_0x2d16('0x5')]][_0x2d16('0x20')]=null;queues[_0x23370f['uniqueid']][_0x2d16('0x21')]=!![];queues[_0x23370f[_0x2d16('0x5')]][_0x2d16('0x22')]=utils[_0x2d16('0x13')]();queues[_0x23370f[_0x2d16('0x5')]]['queuecallerexitreason']=_0x23370f['value'][_0x2d16('0x1e')]();writeDB(queues[_0x23370f[_0x2d16('0x5')]]);}}else if(!_[_0x2d16('0x15')](_0x23370f['variable']['queueposition'])){if(!_[_0x2d16('0x15')](queues[_0x23370f[_0x2d16('0x5')]])&&!queues[_0x23370f['uniqueid']][_0x2d16('0x17')]){queues[_0x23370f['uniqueid']][_0x2d16('0x17')]=![];queues[_0x23370f['uniqueid']][_0x2d16('0x20')]=null;queues[_0x23370f[_0x2d16('0x5')]][_0x2d16('0x21')]=!![];queues[_0x23370f[_0x2d16('0x5')]][_0x2d16('0x22')]=utils[_0x2d16('0x13')]();queues[_0x23370f[_0x2d16('0x5')]]['queuecallerexitreason']=_0x2d16('0x23');}}};exports['queuecallerabandon']=function(_0x1a1bdc){if(!_[_0x2d16('0x15')](queues[_0x1a1bdc[_0x2d16('0x5')]])){queues[_0x1a1bdc['uniqueid']][_0x2d16('0x21')]=![];queues[_0x1a1bdc[_0x2d16('0x5')]][_0x2d16('0x22')]=null;queues[_0x1a1bdc['uniqueid']][_0x2d16('0x17')]=!![];queues[_0x1a1bdc['uniqueid']]['queuecallerabandonAt']=utils[_0x2d16('0x13')]();queues[_0x1a1bdc[_0x2d16('0x5')]]['queuecallerexitreason']='ABANDONED';}};exports['queuecallerleave']=function(_0x43a172){if(!_[_0x2d16('0x15')](queues[_0x43a172['uniqueid']])){queues[_0x43a172[_0x2d16('0x5')]]['queuecallerleave']=!![];queues[_0x43a172[_0x2d16('0x5')]]['queuecallerleaveAt']=utils[_0x2d16('0x13')]();queues[_0x43a172['uniqueid']][_0x2d16('0x24')]=utils[_0x2d16('0x25')](queues[_0x43a172[_0x2d16('0x5')]][_0x2d16('0x16')],queues[_0x43a172[_0x2d16('0x5')]][_0x2d16('0x26')]);queues[_0x43a172['uniqueid']]['position']=_0x43a172[_0x2d16('0x12')];queues[_0x43a172[_0x2d16('0x5')]]['count']=_0x43a172[_0x2d16('0x27')];queues[_0x43a172[_0x2d16('0x5')]]['connectedlinenum']=_0x43a172[_0x2d16('0x28')];queues[_0x43a172[_0x2d16('0x5')]]['connectedlinename']=_0x43a172['connectedlinename'];}};exports[_0x2d16('0x29')]=function(_0x455570){if(!_[_0x2d16('0x15')](queues[_0x455570['uniqueid']])){queues[_0x455570['uniqueid']][_0x2d16('0x17')]=![];queues[_0x455570['uniqueid']]['queuecallerabandon']=![];queues[_0x455570[_0x2d16('0x5')]]['queuecallerabandonAt']=null;queues[_0x455570[_0x2d16('0x5')]][_0x2d16('0x21')]=![];queues[_0x455570[_0x2d16('0x5')]][_0x2d16('0xb')]=null;queues[_0x455570[_0x2d16('0x5')]]['queuecallerexitAt']=null;queues[_0x455570[_0x2d16('0x5')]][_0x2d16('0x2a')]=!![];queues[_0x455570[_0x2d16('0x5')]][_0x2d16('0xa')]=_0x455570['destaccountcode'];queues[_0x455570['uniqueid']][_0x2d16('0x8')]=_0x455570[_0x2d16('0x2b')];}};exports[_0x2d16('0x2c')]=function(_0x3f9d26){if(!_[_0x2d16('0x15')](queues[_0x3f9d26[_0x2d16('0x5')]])){if(queues[_0x3f9d26[_0x2d16('0x5')]]['queuecallerleaveAt']){queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x17')]=![];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x17')]=![];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x20')]=null;queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x21')]=![];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x22')]=null;queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x2a')]=!![];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x8')]=_0x3f9d26[_0x2d16('0x2b')];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x18')]=!![];queues[_0x3f9d26[_0x2d16('0x5')]][_0x2d16('0x19')]=utils[_0x2d16('0x13')]();if(_0x3f9d26[_0x2d16('0x2d')]==_0x2d16('0x2e')){if(!queues[_0x3f9d26['uniqueid']][_0x2d16('0x2e')]){queues[_0x3f9d26['uniqueid']][_0x2d16('0xb')]=_0x2d16('0x2f');}}else{queues[_0x3f9d26[_0x2d16('0x5')]]['queuecallerexitreason']=_0x2d16('0x30')+_0x3f9d26[_0x2d16('0x2d')][_0x2d16('0x1e')]();}writeDB(queues[_0x3f9d26[_0x2d16('0x5')]]);}}};exports[_0x2d16('0x31')]=function(_0x36fb83){if(!_[_0x2d16('0x15')](queues[_0x36fb83[_0x2d16('0x32')]])){queues[_0x36fb83[_0x2d16('0x32')]][_0x2d16('0x2e')]=!![];queues[_0x36fb83[_0x2d16('0x32')]][_0x2d16('0x33')]=_0x2d16('0x34');queues[_0x36fb83[_0x2d16('0x32')]][_0x2d16('0x35')]=_0x36fb83[_0x2d16('0x36')];queues[_0x36fb83[_0x2d16('0x32')]][_0x2d16('0x37')]=_0x36fb83[_0x2d16('0x32')];queues[_0x36fb83[_0x2d16('0x32')]][_0x2d16('0xb')]=_0x2d16('0x38');}};exports[_0x2d16('0x39')]=function(_0x40d5a1){try{if(_0x40d5a1['origtransfereruniqueid']==_0x40d5a1[_0x2d16('0x3a')]){if(!_[_0x2d16('0x15')](queues[_0x40d5a1[_0x2d16('0x3b')]])){queues[_0x40d5a1[_0x2d16('0x3b')]][_0x2d16('0x2e')]=!![];queues[_0x40d5a1[_0x2d16('0x3b')]][_0x2d16('0x33')]=_0x2d16('0x3c');queues[_0x40d5a1[_0x2d16('0x3b')]][_0x2d16('0x35')]=_0x40d5a1[_0x2d16('0x3d')];queues[_0x40d5a1[_0x2d16('0x3b')]][_0x2d16('0x37')]=_0x40d5a1[_0x2d16('0x3e')];queues[_0x40d5a1['secondtransfererlinkedid']][_0x2d16('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x2d16('0x15')](queues[_0x40d5a1[_0x2d16('0x3a')]])){if(_0x40d5a1[_0x2d16('0x3f')]&&queues[_0x40d5a1['transfereelinkedid']]){queues[_0x40d5a1[_0x2d16('0x3f')]]['queuecallerenterreason']=0x1;queues[_0x40d5a1['transfereeuniqueid']]=_[_0x2d16('0x40')](queues[_0x40d5a1[_0x2d16('0x3f')]]);queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x10')]=_0x40d5a1[_0x2d16('0x41')];queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x1b')]=0x2;queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x9')]=queues[_0x40d5a1['secondtransfererlinkedid']][_0x2d16('0x9')];queues[_0x40d5a1[_0x2d16('0x32')]]['calleridname']=queues[_0x40d5a1['secondtransfererlinkedid']]['calleridname'];queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x26')]=utils[_0x2d16('0x13')]();queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x16')]=utils[_0x2d16('0x13')]();queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x24')]=0x0;queues[_0x40d5a1[_0x2d16('0x32')]][_0x2d16('0x42')]=0x0;}else{queues[_0x40d5a1[_0x2d16('0x3a')]]['transfereduniqueid']=_0x40d5a1['secondtransfererlinkedid'];}}}else if(_0x40d5a1[_0x2d16('0x43')]==_0x40d5a1[_0x2d16('0x3b')]){if(!_[_0x2d16('0x15')](queues[_0x40d5a1[_0x2d16('0x3a')]])){queues[_0x40d5a1['origtransfererlinkedid']][_0x2d16('0x2e')]=!![];queues[_0x40d5a1[_0x2d16('0x3a')]][_0x2d16('0x33')]=_0x2d16('0x3c');queues[_0x40d5a1[_0x2d16('0x3a')]][_0x2d16('0x35')]=_0x40d5a1[_0x2d16('0x44')];queues[_0x40d5a1[_0x2d16('0x3a')]][_0x2d16('0x37')]=_0x40d5a1['secondtransfereruniqueid'];queues[_0x40d5a1[_0x2d16('0x3a')]][_0x2d16('0xb')]=_0x2d16('0x45');}if(!_['isNil'](queues[_0x40d5a1[_0x2d16('0x3b')]])){if(_0x40d5a1[_0x2d16('0x46')]&&queues[_0x40d5a1[_0x2d16('0x46')]]){queues[_0x40d5a1[_0x2d16('0x46')]][_0x2d16('0x1b')]=0x1;queues[_0x40d5a1[_0x2d16('0x41')]]=_[_0x2d16('0x40')](queues[_0x40d5a1['transfertargetlinkedid']]);queues[_0x40d5a1['transfertargetuniqueid']]['transfereduniqueid']=_0x40d5a1[_0x2d16('0x41')];queues[_0x40d5a1[_0x2d16('0x41')]]['queuecallerenterreason']=0x2;queues[_0x40d5a1['transfertargetuniqueid']][_0x2d16('0x9')]=queues[_0x40d5a1[_0x2d16('0x3a')]][_0x2d16('0x9')];queues[_0x40d5a1[_0x2d16('0x41')]][_0x2d16('0x47')]=queues[_0x40d5a1[_0x2d16('0x3a')]]['calleridname'];queues[_0x40d5a1[_0x2d16('0x41')]][_0x2d16('0x26')]=utils[_0x2d16('0x13')]();queues[_0x40d5a1[_0x2d16('0x41')]][_0x2d16('0x16')]=utils['now']();queues[_0x40d5a1['transfertargetuniqueid']][_0x2d16('0x24')]=0x0;queues[_0x40d5a1[_0x2d16('0x41')]]['mohtime']=0x0;}else{queues[_0x40d5a1[_0x2d16('0x3b')]][_0x2d16('0x10')]=_0x40d5a1[_0x2d16('0x3a')];}}}}catch(_0x438054){utils[_0x2d16('0x48')](_0x438054[_0x2d16('0x49')]);}};exports['musiconholdstart']=function(_0x5f14cb){if(!_['isNil'](queues[_0x5f14cb['uniqueid']])){queues[_0x5f14cb[_0x2d16('0x5')]][_0x2d16('0x4a')]=utils[_0x2d16('0x13')]();}};exports[_0x2d16('0x4b')]=function(_0x9abc){if(!_[_0x2d16('0x15')](queues[_0x9abc[_0x2d16('0x5')]])){if(!_[_0x2d16('0x15')](queues[_0x9abc[_0x2d16('0x5')]][_0x2d16('0x4a')])){queues[_0x9abc[_0x2d16('0x5')]][_0x2d16('0x42')]+=utils['diffTime'](utils['now'](),queues[_0x9abc[_0x2d16('0x5')]][_0x2d16('0x4a')]);delete queues[_0x9abc['uniqueid']][_0x2d16('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index dfbe69a..3618412 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 _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x34e8,0x12c));var _0x834e=function(_0xfd1c81,_0x2c9a83){_0xfd1c81=_0xfd1c81-0x0;var _0x4f1f7b=_0x34e8[_0xfd1c81];return _0x4f1f7b;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x3a9f05,_0x4920ae){var _0x542061=function(_0x22a55b){while(--_0x22a55b){_0x3a9f05['push'](_0x3a9f05['shift']());}};_0x542061(++_0x4920ae);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xcb91[_0x30cd7e];return _0x462a02;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 2393be1..9880c0d 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 _0x5a53=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','stack','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','attendedtransfer','assign'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x5a53,0x1d2));var _0x35a5=function(_0x51b4ad,_0x182f4e){_0x51b4ad=_0x51b4ad-0x0;var _0x10bb0f=_0x5a53[_0x51b4ad];return _0x10bb0f;};'use strict';var _=require(_0x35a5('0x0'));var util=require(_0x35a5('0x1'));var utils=require(_0x35a5('0x2'));function writeDB(_0x417a7a){utils[_0x35a5('0x3')](util[_0x35a5('0x4')](_0x35a5('0x5'),_0x417a7a[_0x35a5('0x6')]));utils[_0x35a5('0x7')](_0x35a5('0x8'),_0x417a7a);}exports[_0x35a5('0x9')]=function(_0x517f58){try{_0x517f58[_0x35a5('0x6')]=_0x35a5('0xa');writeDB(_0x517f58);}catch(_0x17ec7f){utils[_0x35a5('0xb')](_0x17ec7f['stack']);}};exports[_0x35a5('0xc')]=function(_0x373810){try{_0x373810=_[_0x35a5('0xd')](_0x373810,{'transfererchannel':_0x373810['origtransfererchannel'],'transferercalleridnum':_0x373810['origtransferercalleridnum'],'transferercalleridname':_0x373810[_0x35a5('0xe')],'transfererconnectedlinenum':_0x373810[_0x35a5('0xf')],'transfererconnectedlinename':_0x373810[_0x35a5('0x10')],'transfereraccountcode':_0x373810['origtransfereraccountcode'],'transferercontext':_0x373810['secondtransferercontext'],'transfererexten':_0x373810['secondtransfererexten'],'transfererlinkedid':_0x373810[_0x35a5('0x11')],'context':_0x373810[_0x35a5('0x12')],'extension':_0x373810[_0x35a5('0x13')],'type':_0x35a5('0x14')});if(_['isNil'](_0x373810[_0x35a5('0x15')])){_0x373810=_[_0x35a5('0xd')](_0x373810,{'transfereechannel':_0x373810['transfertargetchannel'],'transfereecalleridnum':_0x373810[_0x35a5('0x16')],'transfereecalleridname':_0x373810[_0x35a5('0x17')],'transfereeconnectedlinenum':_0x373810[_0x35a5('0x18')],'transfereeconnectedlinename':_0x373810[_0x35a5('0x19')],'transfereeaccountcode':_0x373810[_0x35a5('0x1a')],'transfereecontext':_0x373810['transfertargetcontext'],'transfereeexten':_0x373810[_0x35a5('0x1b')],'transfereelinkedid':_0x373810[_0x35a5('0x1c')]});}writeDB(_0x373810);}catch(_0xa45a3b){utils[_0x35a5('0xb')](_0xa45a3b[_0x35a5('0x1d')]);}}; \ No newline at end of file +var _0xf3be=['blind','error','stack','attendedtransfer','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','format','blindtransfer'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xf3be,0x1e1));var _0xef3b=function(_0x3bd66c,_0x240b3c){_0x3bd66c=_0x3bd66c-0x0;var _0x59624b=_0xf3be[_0x3bd66c];return _0x59624b;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var utils=require(_0xef3b('0x2'));function writeDB(_0x17b458){utils['info'](util[_0xef3b('0x3')]('TRANSFER|%s',_0x17b458['type']));utils['request']('CreateVoiceTransferReport',_0x17b458);}exports[_0xef3b('0x4')]=function(_0x40dd26){try{_0x40dd26['type']=_0xef3b('0x5');writeDB(_0x40dd26);}catch(_0x3f7873){utils[_0xef3b('0x6')](_0x3f7873[_0xef3b('0x7')]);}};exports[_0xef3b('0x8')]=function(_0x3a36db){try{_0x3a36db=_['assign'](_0x3a36db,{'transfererchannel':_0x3a36db['origtransfererchannel'],'transferercalleridnum':_0x3a36db[_0xef3b('0x9')],'transferercalleridname':_0x3a36db['origtransferercalleridname'],'transfererconnectedlinenum':_0x3a36db[_0xef3b('0xa')],'transfererconnectedlinename':_0x3a36db[_0xef3b('0xb')],'transfereraccountcode':_0x3a36db[_0xef3b('0xc')],'transferercontext':_0x3a36db['secondtransferercontext'],'transfererexten':_0x3a36db[_0xef3b('0xd')],'transfererlinkedid':_0x3a36db['origtransfererlinkedid'],'context':_0x3a36db[_0xef3b('0xe')],'extension':_0x3a36db[_0xef3b('0xf')],'type':_0xef3b('0x10')});if(_[_0xef3b('0x11')](_0x3a36db[_0xef3b('0x12')])){_0x3a36db=_[_0xef3b('0x13')](_0x3a36db,{'transfereechannel':_0x3a36db[_0xef3b('0x14')],'transfereecalleridnum':_0x3a36db[_0xef3b('0x15')],'transfereecalleridname':_0x3a36db[_0xef3b('0x16')],'transfereeconnectedlinenum':_0x3a36db[_0xef3b('0x17')],'transfereeconnectedlinename':_0x3a36db['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3a36db['transfertargetaccountcode'],'transfereecontext':_0x3a36db[_0xef3b('0x18')],'transfereeexten':_0x3a36db[_0xef3b('0x19')],'transfereelinkedid':_0x3a36db[_0xef3b('0x1a')]});}writeDB(_0x3a36db);}catch(_0x118a31){utils[_0xef3b('0x6')](_0x118a31['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5bd452d..4687c87 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 _0xfe2f=['acw','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','internal','name','interface','GETUSER|','result','length','FOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type'];(function(_0x4ec62d,_0x4f46d6){var _0x3c1d7c=function(_0x1a6a68){while(--_0x1a6a68){_0x4ec62d['push'](_0x4ec62d['shift']());}};_0x3c1d7c(++_0x4f46d6);}(_0xfe2f,0xeb));var _0xffe2=function(_0x47f622,_0x108409){_0x47f622=_0x47f622-0x0;var _0x34358a=_0xfe2f[_0x47f622];return _0x34358a;};'use strict';var jayson=require(_0xffe2('0x0'));var moment=require(_0xffe2('0x1'));var BPromise=require(_0xffe2('0x2'));var client=jayson[_0xffe2('0x3')][_0xffe2('0x4')]({'port':0x2329});var logger=require(_0xffe2('0x5'))(_0xffe2('0x6'));exports[_0xffe2('0x7')]=function(_0x113f3c){logger[_0xffe2('0x7')](_0x113f3c);};exports[_0xffe2('0x8')]=function(_0x906827){logger['debug'](JSON[_0xffe2('0x9')](_0x906827));};exports[_0xffe2('0xa')]=function(_0x10253c){logger[_0xffe2('0xa')](_0x10253c[_0xffe2('0xb')]);};exports[_0xffe2('0xc')]=function(_0x10f137,_0x29b499){return client[_0xffe2('0xc')](_0x10f137,{'body':_0x29b499})[_0xffe2('0xd')](function(_0x5b4401){logger['debug'](JSON[_0xffe2('0x9')](_0x5b4401));})[_0xffe2('0xe')](function(_0x34253b){logger[_0xffe2('0xa')](_0x34253b[_0xffe2('0xb')]);});};function getUser(_0x57552a){return client['request'](_0xffe2('0xf'),{'options':{'raw':!![],'attributes':['id',_0xffe2('0x10'),_0xffe2('0x11'),_0xffe2('0x12')],'where':_0x57552a,'limit':0x1}})[_0xffe2('0xd')](function(_0x81dbc6){logger[_0xffe2('0x7')](_0xffe2('0x13')+JSON['stringify'](_0x57552a)+'|'+(_0x81dbc6[_0xffe2('0x14')][_0xffe2('0x15')]?_0xffe2('0x16'):'NOTFOUND'));return _0x81dbc6[_0xffe2('0x14')][_0xffe2('0x15')]?_0x81dbc6[_0xffe2('0x14')][0x0]:null;});}exports[_0xffe2('0x17')]=function(_0x1997d0){return new BPromise(function(_0x545b4e,_0x413b1d){if(_0x1997d0){return getUser({'internal':_0x1997d0})[_0xffe2('0xd')](function(_0x16b2e9){return _0x545b4e(_0x16b2e9);})[_0xffe2('0xe')](function(_0x146d73){logger[_0xffe2('0xa')](_0x146d73['stack']);return _0x545b4e(null);});}else{return _0x545b4e(null);}});};exports[_0xffe2('0x18')]=function(_0x3492f3){return new BPromise(function(_0x4e706f,_0x166861){if(_0x3492f3){return getUser({'interface':_0x3492f3})[_0xffe2('0xd')](function(_0x571c3a){return _0x4e706f(_0x571c3a);})[_0xffe2('0xe')](function(_0x5b3940){logger[_0xffe2('0xa')](_0x5b3940[_0xffe2('0xb')]);return _0x4e706f(null);});}else{return _0x4e706f(null);}});};exports[_0xffe2('0x19')]=function(_0x53a872){return new BPromise(function(_0x444d11,_0x332cee){if(_0x53a872){return getUser({'name':_0x53a872})[_0xffe2('0xd')](function(_0x167ec8){return _0x444d11(_0x167ec8);})[_0xffe2('0xe')](function(_0x22e01a){logger[_0xffe2('0xa')](_0x22e01a[_0xffe2('0xb')]);return _0x444d11(null);});}else{return _0x444d11(null);}});};exports[_0xffe2('0x1a')]=function(_0x433e11){return new BPromise(function(_0x3700aa,_0x11f105){if(_0x433e11){return client[_0xffe2('0xc')](_0xffe2('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xffe2('0x11'),_0xffe2('0x1c'),_0xffe2('0x1d'),_0xffe2('0x1e')],'where':{'name':_0x433e11},'limit':0x1}})[_0xffe2('0xd')](function(_0x58c94a){logger['info'](_0xffe2('0x1f')+_0x433e11+'|'+(_0x58c94a[_0xffe2('0x14')][_0xffe2('0x15')]?_0xffe2('0x16'):_0xffe2('0x20')));return _0x3700aa(_0x58c94a[_0xffe2('0x14')][_0xffe2('0x15')]?_0x58c94a[_0xffe2('0x14')][0x0]:null);})[_0xffe2('0xe')](function(_0x4d5d30){logger['error'](_0x4d5d30['stack']);return _0x3700aa(null);});}else{return _0x3700aa(null);}});};exports[_0xffe2('0x21')]=function(_0x59a8d0,_0x38ac4f){return moment(_0x59a8d0)[_0xffe2('0x22')](_0x38ac4f,'seconds')[_0xffe2('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x3d09f4,_0x284702){return moment(_0x3d09f4)[_0xffe2('0x24')](_0x284702,'seconds')[_0xffe2('0x23')](_0xffe2('0x25'));};exports[_0xffe2('0x26')]=function(_0x1655b7,_0xe56841){return moment(_0x1655b7)[_0xffe2('0x27')](moment(_0xe56841),'seconds');};exports[_0xffe2('0x28')]=function(_0x676f83,_0x1eb856){return parseInt(_0x676f83,0xa)+parseInt(_0x1eb856,0xa);};exports[_0xffe2('0x29')]=function(){return moment()[_0xffe2('0x23')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xffe2('0x2a')]=function(_0x3ee1bd,_0x1d45e9){if(_0x1d45e9){return moment(_0x3ee1bd)['isAfter'](_0x1d45e9);}else{return!![];}};exports[_0xffe2('0x2b')]=function(_0x4d03bc,_0x26a2bc){if(_0x26a2bc){return moment(_0x4d03bc)[_0xffe2('0x2b')](_0x26a2bc);}else if(_0x4d03bc){return!![];}else{return![];}}; \ No newline at end of file +var _0x033d=['interface','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','acw','acwTimeout','GETVOICEQUEUEBYNAME|','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','name'];(function(_0x3b4725,_0x5601a7){var _0x553153=function(_0xbfb93c){while(--_0xbfb93c){_0x3b4725['push'](_0x3b4725['shift']());}};_0x553153(++_0x5601a7);}(_0x033d,0xd5));var _0xd033=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x033d[_0x2dafbe];return _0x58a45a;};'use strict';var jayson=require('jayson/promise');var moment=require('moment');var BPromise=require(_0xd033('0x0'));var client=jayson[_0xd033('0x1')][_0xd033('0x2')]({'port':0x2329});var logger=require(_0xd033('0x3'))(_0xd033('0x4'));exports[_0xd033('0x5')]=function(_0x3db9cf){logger[_0xd033('0x5')](_0x3db9cf);};exports[_0xd033('0x6')]=function(_0x2a9b8a){logger[_0xd033('0x6')](JSON[_0xd033('0x7')](_0x2a9b8a));};exports[_0xd033('0x8')]=function(_0x3ec5f1){logger[_0xd033('0x8')](_0x3ec5f1[_0xd033('0x9')]);};exports[_0xd033('0xa')]=function(_0x434da4,_0x1ade95){return client['request'](_0x434da4,{'body':_0x1ade95})[_0xd033('0xb')](function(_0x160e41){logger['debug'](JSON[_0xd033('0x7')](_0x160e41));})[_0xd033('0xc')](function(_0x592b4a){logger['error'](_0x592b4a[_0xd033('0x9')]);});};function getUser(_0x2fe763){return client[_0xd033('0xa')](_0xd033('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xd033('0xe'),_0xd033('0xf')],'where':_0x2fe763,'limit':0x1}})[_0xd033('0xb')](function(_0x20734e){logger[_0xd033('0x5')]('GETUSER|'+JSON['stringify'](_0x2fe763)+'|'+(_0x20734e[_0xd033('0x10')][_0xd033('0x11')]?_0xd033('0x12'):_0xd033('0x13')));return _0x20734e[_0xd033('0x10')][_0xd033('0x11')]?_0x20734e[_0xd033('0x10')][0x0]:null;});}exports[_0xd033('0x14')]=function(_0x2da59d){return new BPromise(function(_0x3374ed,_0x59730d){if(_0x2da59d){return getUser({'internal':_0x2da59d})[_0xd033('0xb')](function(_0x402318){return _0x3374ed(_0x402318);})[_0xd033('0xc')](function(_0x519d9b){logger[_0xd033('0x8')](_0x519d9b[_0xd033('0x9')]);return _0x3374ed(null);});}else{return _0x3374ed(null);}});};exports[_0xd033('0x15')]=function(_0x4aefbf){return new BPromise(function(_0x58c960,_0x27b246){if(_0x4aefbf){return getUser({'interface':_0x4aefbf})['then'](function(_0x497981){return _0x58c960(_0x497981);})[_0xd033('0xc')](function(_0x4702cb){logger[_0xd033('0x8')](_0x4702cb[_0xd033('0x9')]);return _0x58c960(null);});}else{return _0x58c960(null);}});};exports[_0xd033('0x16')]=function(_0x29d2ef){return new BPromise(function(_0x447ff7,_0x586d1c){if(_0x29d2ef){return getUser({'name':_0x29d2ef})[_0xd033('0xb')](function(_0x5ed3b2){return _0x447ff7(_0x5ed3b2);})[_0xd033('0xc')](function(_0x5b81cd){logger['error'](_0x5b81cd[_0xd033('0x9')]);return _0x447ff7(null);});}else{return _0x447ff7(null);}});};exports[_0xd033('0x17')]=function(_0x4d7976){return new BPromise(function(_0x5b2d70,_0x1317a3){if(_0x4d7976){return client[_0xd033('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xd033('0xe'),'type',_0xd033('0x18'),_0xd033('0x19')],'where':{'name':_0x4d7976},'limit':0x1}})[_0xd033('0xb')](function(_0x301cdb){logger[_0xd033('0x5')](_0xd033('0x1a')+_0x4d7976+'|'+(_0x301cdb[_0xd033('0x10')][_0xd033('0x11')]?'FOUND':_0xd033('0x13')));return _0x5b2d70(_0x301cdb[_0xd033('0x10')][_0xd033('0x11')]?_0x301cdb[_0xd033('0x10')][0x0]:null);})[_0xd033('0xc')](function(_0x9cc69a){logger['error'](_0x9cc69a['stack']);return _0x5b2d70(null);});}else{return _0x5b2d70(null);}});};exports['addTime']=function(_0x7d67f,_0x1d3f58){return moment(_0x7d67f)[_0xd033('0x1b')](_0x1d3f58,'seconds')[_0xd033('0x1c')](_0xd033('0x1d'));};exports[_0xd033('0x1e')]=function(_0x6d7b19,_0x48ce76){return moment(_0x6d7b19)['subtract'](_0x48ce76,_0xd033('0x1f'))[_0xd033('0x1c')](_0xd033('0x1d'));};exports[_0xd033('0x20')]=function(_0x2f3aec,_0x41b0cd){return moment(_0x2f3aec)[_0xd033('0x21')](moment(_0x41b0cd),_0xd033('0x1f'));};exports[_0xd033('0x22')]=function(_0x4440bc,_0xf4768f){return parseInt(_0x4440bc,0xa)+parseInt(_0xf4768f,0xa);};exports[_0xd033('0x23')]=function(){return moment()[_0xd033('0x1c')](_0xd033('0x1d'));};exports[_0xd033('0x24')]=function(_0x1dc40a,_0x5f41dd){if(_0x5f41dd){return moment(_0x1dc40a)[_0xd033('0x24')](_0x5f41dd);}else{return!![];}};exports[_0xd033('0x25')]=function(_0x821c67,_0x393ee2){if(_0x393ee2){return moment(_0x821c67)[_0xd033('0x25')](_0x393ee2);}else if(_0x821c67){return!![];}else{return![];}}; \ No newline at end of file